diff --git a/gmic-py.tar b/gmic-py.tar new file mode 100644 index 0000000..4bdcbd5 Binary files /dev/null and b/gmic-py.tar differ diff --git a/gmic/gmic_qt_faves (copy).json b/gmic/gmic_qt_faves (copy).json new file mode 100644 index 0000000..27d0047 --- /dev/null +++ b/gmic/gmic_qt_faves (copy).json @@ -0,0 +1,86 @@ +[ + { + "Name": "Temperature Balance", + "command": "gcd_temp_balance", + "defaultParameters": [ + "0", + "0", + "1", + "0" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2 + ], + "originalName": "Temperature Balance", + "preview": "gcd_temp_balance" + }, + { + "Name": "Boost Chromaticity", + "command": "fx_boost_chroma", + "defaultParameters": [ + "50", + "0", + "0", + "50,50" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 0 + ], + "originalName": "Boost Chromaticity", + "preview": "fx_boost_chroma_preview" + }, + { + "Name": "Zone System", + "command": "fx_zonesystem", + "defaultParameters": [ + "1", + "10", + "1", + "1", + "0", + "255", + "0" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "originalName": "Zone System", + "preview": "fx_zonesystem_preview" + }, + { + "Name": "Basic Adjustments", + "command": "fx_adjust_colors", + "defaultParameters": [ + "0", + "0", + "0", + "0", + "0", + "0", + "50,50" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 0 + ], + "originalName": "Basic Adjustments", + "preview": "fx_adjust_colors_preview" + } +] diff --git a/gmic/gmic_qt_faves.json b/gmic/gmic_qt_faves.json new file mode 100644 index 0000000..5353680 --- /dev/null +++ b/gmic/gmic_qt_faves.json @@ -0,0 +1,996 @@ +[ + { + "Name": "Auto Balance", + "command": "gcd_auto_balance", + "defaultParameters": [ + "30", + "0", + "0", + "1", + "0" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2 + ], + "originalName": "Auto Balance", + "preview": "gcd_auto_balance" + }, + { + "Name": "Depth Blur", + "command": "gcd_depth_blur", + "defaultParameters": [ + "0", + "15", + "0.25", + "2", + "4", + "0", + "1" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "originalName": "Depth Blur", + "preview": "gcd_depth_blur" + }, + { + "Name": "Local Contrast", + "command": "afre_localcontrast", + "defaultParameters": [ + "4", + "50" + ], + "defaultVisibilities": [ + 2, + 2 + ], + "originalName": "Local Contrast", + "preview": "afre_localcontrast_preview" + }, + { + "Name": "Sharpen [Deblur]", + "command": "fx_deblur", + "defaultParameters": [ + "2", + "10", + "20", + "0.1", + "1", + "11", + "0", + "24", + "0", + "50,50" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 0 + ], + "originalName": "Sharpen [Deblur]", + "preview": "fx_deblur_preview" + }, + { + "Name": "Color Grading", + "command": "jl_colorgrading", + "defaultParameters": [ + "0", + "0", + "1", + "1", + "-9", + "0", + "0", + "0", + "0", + "0", + "1", + "0", + "0", + "0", + "70", + "0", + "0", + "0", + "0", + "0", + "70", + "180", + "0", + "1", + "0", + "0", + "0" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "originalName": "Color Grading", + "preview": "jl_colorgrading_preview" + }, + { + "Name": "Satellite", + "command": "fx_satellite", + "defaultParameters": [ + "10", + "0", + "0", + "100", + "1", + "0", + "255", + "0", + "0", + "0", + "50,50" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "originalName": "Satellite", + "preview": "fx_satellite_preview" + }, + { + "Name": "Temperature Balance", + "command": "gcd_temp_balance", + "defaultParameters": [ + "0", + "0", + "1", + "0" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2 + ], + "originalName": "Temperature Balance", + "preview": "gcd_temp_balance" + }, + { + "Name": "Contrast Swiss Mask", + "command": "fx_contrast_swm", + "defaultParameters": [ + "2", + "0", + "1" + ], + "defaultVisibilities": [ + 2, + 2, + 2 + ], + "originalName": "Contrast Swiss Mask", + "preview": "fx_contrast_swm" + }, + { + "Name": "Recursive Median", + "command": "iain_recursive_median_p", + "defaultParameters": [ + "3", + "1", + "0", + "0", + "1" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2 + ], + "originalName": "Recursive Median", + "preview": "iain_recursive_median_p_preview" + }, + { + "Name": "Poster Edges", + "command": "fx_poster_edges", + "defaultParameters": [ + "20", + "60", + "5", + "0", + "10", + "0", + "0", + "0", + "50,50" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 0 + ], + "originalName": "Poster Edges", + "preview": "fx_poster_edges_preview" + }, + { + "Name": "Despeckle", + "command": "gcd_despeckle", + "defaultParameters": [ + "20", + "10" + ], + "defaultVisibilities": [ + 2, + 2 + ], + "originalName": "Despeckle", + "preview": "gcd_despeckle" + }, + { + "Name": "JPEG Artefacts", + "command": "fx_jpeg_artefacts", + "defaultParameters": [ + "50", + "0", + "50,50" + ], + "defaultVisibilities": [ + 2, + 2, + 0 + ], + "originalName": "JPEG Artefacts", + "preview": "fx_jpeg_artefacts_preview" + }, + { + "Name": "Split Details [Wavelets]", + "command": "fx_split_details_wavelets", + "defaultParameters": [ + "6", + "0", + "0" + ], + "defaultVisibilities": [ + 2, + 2, + 2 + ], + "originalName": "Split Details [Wavelets]", + "preview": "fx_split_details_wavelets_preview" + }, + { + "Name": "Make Up", + "command": "make_up", + "defaultParameters": [ + "15", + "4", + "0", + "0", + "0" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2 + ], + "originalName": "Make Up", + "preview": "make_up_preview" + }, + { + "Name": "Saturation EQ", + "command": "Saturation_EQ_p", + "defaultParameters": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "originalName": "Saturation EQ", + "preview": "Saturation_EQ_p" + }, + { + "Name": "Easy Skin Retouch", + "command": "iain_easy_skin_retouch", + "defaultParameters": [ + "7", + "2", + "0.7", + "1", + "1", + "0.7", + "0.6", + "0.5", + "0.5", + "0.5", + "0" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "originalName": "Easy Skin Retouch", + "preview": "iain_easy_skin_retouch_preview" + }, + { + "Name": "Cartoon", + "command": "cartoon", + "defaultParameters": [ + "3", + "200", + "20", + "0.25", + "1.5", + "8", + "0", + "50,50" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 0 + ], + "originalName": "Cartoon", + "preview": "fx_cartoon_preview" + }, + { + "Name": "Desaturate Norm", + "command": "fx_gcd_norm_eq", + "defaultParameters": [ + "0.5", + "0.5", + "2", + "0" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2 + ], + "originalName": "Desaturate Norm", + "preview": "fx_gcd_norm_eq_preview" + }, + { + "Name": "Brightness", + "command": "afre_brightness", + "defaultParameters": [ + "50" + ], + "defaultVisibilities": [ + 2 + ], + "originalName": "Brightness", + "preview": "afre_brightness_preview" + }, + { + "Name": "Random", + "command": "deform", + "defaultParameters": [ + "10" + ], + "defaultVisibilities": [ + 2 + ], + "originalName": "Random", + "preview": "deform" + }, + { + "Name": "Posterize", + "command": "fx_posterize", + "defaultParameters": [ + "150", + "30", + "1", + "12", + "0", + "0", + "0", + "0", + "50,50" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 0 + ], + "originalName": "Posterize", + "preview": "fx_posterize_preview" + }, + { + "Name": "Dream Smoothing", + "command": "fx_dreamsmooth", + "defaultParameters": [ + "1", + "1", + "1", + "0.8", + "0", + "0.8", + "1", + "24", + "0" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "originalName": "Dream Smoothing", + "preview": "fx_dreamsmooth_preview" + }, + { + "Name": "Normalize Brightness", + "command": "gcd_normalize_brightness", + "defaultParameters": [ + "0", + "10", + "0", + "3", + "0", + "0" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2 + ], + "originalName": "Normalize Brightness", + "preview": "gcd_normalize_brightness" + }, + { + "Name": "Contrast", + "command": "afre_contrast", + "defaultParameters": [ + "-163" + ], + "defaultVisibilities": [ + 2 + ], + "originalName": "Contrast", + "preview": "afre_contrast_preview" + }, + { + "Name": "Channel Processing", + "command": "fx_channel_processing", + "defaultParameters": [ + "2", + "4.8", + "0", + "0", + "0", + "0", + "100", + "256", + "0", + "0", + "0", + "2", + "0", + "0", + "50,50" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 0 + ], + "originalName": "Channel Processing", + "preview": "fx_channel_processing_preview" + }, + { + "Name": "Boost Chromaticity", + "command": "fx_boost_chroma", + "defaultParameters": [ + "50", + "0", + "0", + "50,50" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 0 + ], + "originalName": "Boost Chromaticity", + "preview": "fx_boost_chroma_preview" + }, + { + "Name": "Spherize", + "command": "fx_spherize", + "defaultParameters": [ + "50", + "1", + "0", + "50,50", + "0", + "0", + "2", + "0" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "originalName": "Spherize", + "preview": "fx_spherize_preview" + }, + { + "Name": "Distort Lens", + "command": "fx_distort_lens", + "defaultParameters": [ + "0.1", + "0", + "0", + "50,50", + "0" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2 + ], + "originalName": "Distort Lens", + "preview": "fx_distort_lens" + }, + { + "Name": "Mighty Details", + "command": "fx_mighty_details", + "defaultParameters": [ + "25", + "1", + "25", + "1", + "11", + "0", + "50,50" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 0 + ], + "originalName": "Mighty Details", + "preview": "fx_mighty_details_preview" + }, + { + "Name": "Specific Saturation", + "command": "gcd_hio_levels", + "defaultParameters": [ + "1", + "1", + "39", + "0", + "1", + "1", + "0", + "0", + "0", + "0" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "originalName": "Specific Saturation", + "preview": "gcd_hio_levels_preview" + }, + { + "Name": "Dodge and Burn", + "command": "fx_dodgeburn", + "defaultParameters": [ + "15", + "1.5", + "25", + "10", + "40", + "1.5", + "25", + "10", + "0", + "0", + "10", + "0" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "originalName": "Dodge and Burn", + "preview": "fx_dodgeburn_preview" + }, + { + "Name": "Hue Lighten-Darken", + "command": "iain_hue_light_dark_p", + "defaultParameters": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "255", + "100", + "255", + "0", + "0", + "0" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "originalName": "Hue Lighten-Darken", + "preview": "iain_hue_light_dark_p" + }, + { + "Name": "Retinex", + "command": "fx_retinex", + "defaultParameters": [ + "75", + "16", + "1", + "1", + "1", + "5", + "15", + "80", + "250", + "0", + "50,50" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 0 + ], + "originalName": "Retinex", + "preview": "fx_retinex_preview" + }, + { + "Name": "Zone System", + "command": "fx_zonesystem", + "defaultParameters": [ + "1", + "10", + "1", + "1", + "0", + "255", + "0" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ], + "originalName": "Zone System", + "preview": "fx_zonesystem_preview" + }, + { + "Name": "Color Balance", + "command": "fx_balance_gamma", + "defaultParameters": [ + "128,128,128", + "1", + "0", + "50,50" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 0 + ], + "originalName": "Color Balance", + "preview": "fx_balance_gamma_preview" + }, + { + "Name": "Lens Blur", + "command": "fx_gb_lb", + "defaultParameters": [ + "10", + "7", + "0" + ], + "defaultVisibilities": [ + 2, + 2, + 2 + ], + "originalName": "Lens Blur", + "preview": "fx_gb_lb_preview" + }, + { + "Name": "Sharpen FFT", + "command": "afre_sharpenfft", + "defaultParameters": [ + "15", + "1" + ], + "defaultVisibilities": [ + 2, + 2 + ], + "originalName": "Sharpen FFT", + "preview": "afre_sharpenfft_preview" + }, + { + "Name": "Basic Adjustments", + "command": "fx_adjust_colors", + "defaultParameters": [ + "0", + "0", + "0", + "0", + "0", + "0", + "50,50" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 0 + ], + "originalName": "Basic Adjustments", + "preview": "fx_adjust_colors_preview" + }, + { + "Name": "Burn", + "command": "fx_burn", + "defaultParameters": [ + "0.5", + "30", + "1", + "0", + "0", + "0", + "50,50" + ], + "defaultVisibilities": [ + 2, + 2, + 2, + 2, + 2, + 2, + 0 + ], + "originalName": "Burn", + "preview": "fx_burn_preview" + }, + { + "Name": "Color Temperature", + "command": "fx_tk_colortemp", + "defaultParameters": [ + "0", + "0", + "0" + ], + "defaultVisibilities": [ + 2, + 2, + 2 + ], + "originalName": "Color Temperature", + "preview": "fx_tk_colortemp_preview" + } +] diff --git a/gmic/gmic_qt_filters.dat b/gmic/gmic_qt_filters.dat new file mode 100644 index 0000000..95ca7cf Binary files /dev/null and b/gmic/gmic_qt_filters.dat differ diff --git a/gmic/gmic_qt_log b/gmic/gmic_qt_log new file mode 100644 index 0000000..e69de29 diff --git a/gmic/gmic_qt_params.dat b/gmic/gmic_qt_params.dat new file mode 100644 index 0000000..8e9f90b Binary files /dev/null and b/gmic/gmic_qt_params.dat differ diff --git a/gmic/gmic_qt_tags.dat b/gmic/gmic_qt_tags.dat new file mode 100644 index 0000000..f543eba Binary files /dev/null and b/gmic/gmic_qt_tags.dat differ diff --git a/gmic/gmic_qt_tags.dat.bak b/gmic/gmic_qt_tags.dat.bak new file mode 100644 index 0000000..f543eba Binary files /dev/null and b/gmic/gmic_qt_tags.dat.bak differ diff --git a/gmic/gmic_qt_visibility.dat b/gmic/gmic_qt_visibility.dat new file mode 100644 index 0000000..533fc9b Binary files /dev/null and b/gmic/gmic_qt_visibility.dat differ diff --git a/gmic/update324.gmic b/gmic/update324.gmic new file mode 100644 index 0000000..3eb3201 --- /dev/null +++ b/gmic/update324.gmic @@ -0,0 +1,123947 @@ +#@gmic +# +# File : update327.gmic +# ( G'MIC command file ) +# +# Description : Update file for G'MIC commands and filters, for version 3.2.7 (pre-release #23082209)). +# ( https://gmic.eu ) +# +# License : CeCILL v2.1 +# ( https://cecill.info/licences/Licence_CeCILL_V2.1-en.html ) +# +# Generated on : 2023/08/24, 12:02 +# +#@gui パターン +#@gui_ja ロールシャッハ図形:fx_rorschach,fx_rorschach +#@gui_ja :スケール=float(3,0,10) +#@gui_ja :対称軸=choice(1,"なし","X 軸","Y 軸","X 軸と Y 軸") +#@gui_ja :ステンシルの種類=choice(2,"白黒","RGB","色付き") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2011/03/12") +#@gui_ja 迷彩:fx_camouflage,fx_camouflage +#@gui_ja :スケール=int(9,2,12) +#@gui_ja :Levels=int(12,2,32) +#@gui_ja :Coherence=float(100,0,1000) +#@gui_ja :色 1=color(#1e2e21) +#@gui_ja :色 2=color(#4b5a41) +#@gui_ja :色 3=color(#b3bd75) +#@gui_ja :色 4=color(#fff69e) +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2016/10/26") +#@gui _フィルムエミュレーション +#@gui_ja インスタント [業務用]:fx_emulate_film_instant_pro,fx_emulate_film_instant_pro_preview(1)+ +#@gui_ja :プリセット=choice("なし","FUJIFILM FP-100c --","FUJIFILM FP-100c -","FUJIFILM FP-100c","FUJIFILM FP-100c +","FUJIFILM FP-100c ++","FUJIFILM FP-100c ++a","FUJIFILM FP-100c +++","FUJIFILM FP-100c Cool --","FUJIFILM FP-100c Cool -","FUJIFILM FP-100c Cool","FUJIFILM FP-100c Cool +","FUJIFILM FP-100c Cool ++","FUJIFILM FP-100c Negative --","FUJIFILM FP-100c Negative -","FUJIFILM FP-100c Negative","FUJIFILM FP-100c Negative +","FUJIFILM FP-100c Negative ++","FUJIFILM FP-100c Negative ++a","FUJIFILM FP-100c Negative +++","FUJIFILM FP-3000b --","FUJIFILM FP-3000b -","FUJIFILM FP-3000b","FUJIFILM FP-3000b +","FUJIFILM FP-3000b ++","FUJIFILM FP-3000b +++","FUJIFILM FP-3000b HC","FUJIFILM FP-3000b Negative --","FUJIFILM FP-3000b Negative -","FUJIFILM FP-3000b Negative","FUJIFILM FP-3000b Negative +","FUJIFILM FP-3000b Negative ++","FUJIFILM FP-3000b Negative +++","FUJIFILM FP-3000b Negative Early","ポラロイド 665 --","ポラロイド 665 -","ポラロイド 665","ポラロイド 665 +","ポラロイド 665 ++","ポラロイド 665 Negative -","ポラロイド 665 Negative","ポラロイド 665 Negative +","ポラロイド 665 Negative HC","ポラロイド 669 --","ポラロイド 669 -","ポラロイド 669","ポラロイド 669 +","ポラロイド 669 ++","ポラロイド 669 +++","ポラロイド 669 Cold --","ポラロイド 669 Cold -","ポラロイド 669 Cold","ポラロイド 669 Cold +","ポラロイド 690 --","ポラロイド 690 -","ポラロイド 690","ポラロイド 690 +","ポラロイド 690 ++","ポラロイド 690 Cold --","ポラロイド 690 Cold -","ポラロイド 690 Cold","ポラロイド 690 Cold +","ポラロイド 690 Cold ++","ポラロイド 690 Warm --","ポラロイド 690 Warm -","ポラロイド 690 Warm","ポラロイド 690 Warm +","ポラロイド 690 Warm ++") +#@gui_ja :_=separator() +#@gui_ja :不透明度=float(1,0,1) +#@gui_ja :ガンマ=float(0,-1.2,1.2) +#@gui_ja :コントラスト=float(1,0,4) +#@gui_ja :輝度=float(0,-255,255) +#@gui_ja :色相=float(0,-180,180) +#@gui_ja :彩度=float(0,-1,1) +#@gui_ja :事前に正規化=bool(0) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("注: このセクションで使用されているカラー LUT は Patrick David により作成されました。詳細は以下の Web ページをご覧ください。") +#@gui_ja :_=link("Film Emulation Presets in G'MIC","http://gmic.eu/film_emulation/index.shtml") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: Patrick DavidDavid Tschumperlé 最終更新: 2013/08/29") +#@gui_ja インスタント [民生用]:fx_emulate_film_instant_consumer,fx_emulate_film_instant_consumer_preview(1)+ +#@gui_ja :プリセット=choice{"なし","ポラロイド PX-100UV+ Cold --","ポラロイド PX-100UV+ Cold -","ポラロイド PX-100UV+ Cold","ポラロイド PX-100UV+ Cold +","ポラロイド PX-100UV+ Cold ++","ポラロイド PX-100UV+ Cold +++","ポラロイド PX-100UV+ Warm --","ポラロイド PX-100UV+ Warm -","ポラロイド PX-100UV+ Warm","ポラロイド PX-100UV+ Warm +","ポラロイド PX-100UV+ Warm ++","ポラロイド PX-100UV+ Warm +++","ポラロイド PX-680 --","ポラロイド PX-680 -","ポラロイド PX-680","ポラロイド PX-680 +","ポラロイド PX-680 ++","ポラロイド PX-680 Cold --","ポラロイド PX-680 Cold -","ポラロイド PX-680 Cold","ポラロイド PX-680 Cold +","ポラロイド PX-680 Cold ++","ポラロイド PX-680 Cold ++a","ポラロイド PX-680 Warm --","ポラロイド PX-680 Warm -","ポラロイド PX-680 Warm","ポラロイド PX-680 Warm +","ポラロイド PX-680 Warm ++","ポラロイド PX-70 --","ポラロイド PX-70 -","ポラロイド PX-70","ポラロイド PX-70 +","ポラロイド PX-70 ++","ポラロイド PX-70 +++","ポラロイド PX-70 Cold --","ポラロイド PX-70 Cold -","ポラロイド PX-70 Cold","ポラロイド PX-70 Cold +","ポラロイド PX-70 Cold ++","ポラロイド PX-70 Warm --","ポラロイド PX-70 Warm -","ポラロイド PX-70 Warm","ポラロイド PX-70 Warm +","ポラロイド PX-70 Warm ++","ポラロイド Time Zero (絶版) ---","ポラロイド Time Zero (絶版) --","ポラロイド Time Zero (絶版) -","ポラロイド Time Zero (絶版)","ポラロイド Time Zero (絶版) +","ポラロイド Time Zero (絶版) ++","ポラロイド Time Zero (絶版) Cold ---","ポラロイド Time Zero (絶版) Cold --","ポラロイド Time Zero (絶版) Cold -","ポラロイド Time Zero (絶版) Cold"} +#@gui_ja :_=separator() +#@gui_ja :不透明度=float(1,0,1) +#@gui_ja :ガンマ=float(0,-1.2,1.2) +#@gui_ja :コントラスト=float(1,0,4) +#@gui_ja :輝度=float(0,-255,255) +#@gui_ja :色相=float(0,-180,180) +#@gui_ja :彩度=float(0,-1,1) +#@gui_ja :事前に正規化=bool(0) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("注: このセクションで使用されているカラー LUT は Patrick David により作成されました。詳細は以下の Web ページをご覧ください。") +#@gui_ja :_=link("Film Emulation Presets in G'MIC","http://gmic.eu/film_emulation/index.shtml") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: Patrick DavidDavid Tschumperlé 最終更新: 2013/08/29") +#@gui_ja ネガフィルム [カラー]:fx_emulate_film_negative_color,fx_emulate_film_negative_color_preview(1)+ +#@gui_ja :プリセット=choice("なし","Agfa Ultra Color 100","Agfa Vista 200","Fuji Superia 200","Fuji Superia HG 1600","Fuji Superia Reala 100","Fuji Superia X-Tra 800","Kodak Elite 100 XPRO","Kodak Elite Color 200","Kodak Elite Color 400","Kodak Portra 160 NC","Kodak Portra 160 VC","Lomography Redscale 100") +#@gui_ja :_=separator() +#@gui_ja :強さ (%)=float(100,0,100) +#@gui_ja :輝度 (%)=float(0,-100,100) +#@gui_ja :コントラスト (%)=float(0,-100,100) +#@gui_ja :ガンマ (%)=float(0,-100,100) +#@gui_ja :色相 (%)=float(0,-100,100) +#@gui_ja :彩度 (%)=float(0,-100,100) +#@gui_ja :色を正規化=choice("無し","処理前","処理後","両方") +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("注: このセクションで使用されているカラー LUT は Patrick David により作成されました。詳細は以下の Web ページをご覧ください。") +#@gui_ja :_=link("Film Emulation Presets in G'MIC","http://gmic.eu/film_emulation/index.shtml") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: Patrick DavidDavid Tschumperlé 最終更新: 2016/08/02") +#@gui _フレーム +#@gui_ja フレーム [ぼかし]:fx_frame_blur,fx_frame_blur(1) +#@gui_ja :水平サイズ (%)=float(30,0,100) +#@gui_ja :垂直サイズ (%)=float(30,0,100) +#@gui_ja :_=separator() +#@gui_ja :切り抜き=float(0,0,100) +#@gui_ja :ぼかし=float(5,0,10) +#@gui_ja :丸み=float(0,0,1) +#@gui_ja :カラーバランスを調整=bool(0) +#@gui_ja :着色=color(#808080) +#@gui_ja :正規化=choice("なし","伸張","平均化") +#@gui_ja :_=separator() +#@gui_ja :輪郭線のサイズ=float(5,0,50) +#@gui_ja :輪郭線の色=color(#ffffff) +#@gui_ja :影の位置 (左右)=float(2,-10,10) +#@gui_ja :影の位置 (上下)=float(2,-10,10) +#@gui_ja :影のぼかし=float(1,0,5) +#@gui_ja :影のコントラスト=float(0,0,100) +#@gui_ja :画像の位置 (左右)=float(0.5,0,1) +#@gui_ja :画像の位置 (上下)=float(0.5,0,1) +#@gui_ja :角度=float(0,-180,180) +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2014/01/19") +#@gui _修復 +#@gui_ja アップスケール [Scale2x]:fx_scalenx,fx_scalenx_preview(0) +#@gui_ja :拡大率=choice("X 2","X 3","X 4","X 6","X 8","X 9","X 12","X 16","X 18","X 27") +#@gui_ja :色空間=choice(0,"RGB","YCbCr","Lab") +#@gui_ja :_=note("\n注: このフィルタは、以下の Web サイトで公開されている画像拡大アルゴリズムを実装したものです。 ") +#@gui_ja :_=link("http://scale2x.sourceforge.net") +#@gui_ja :_=note(" このフィルタは、インデックス画像等の色数の少ない画像のリサイズを目的としたものです。 フルカラー画像に対しての使用には基本的に適しません。 ") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja インターレース除去:deinterlace,fx_deinterlace_preview(0) +#@gui_ja :アルゴリズム=choice("標準","Motion-Compensated") +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja ホットピクセル除去:fx_remove_hotpixels,fx_remove_hotpixels_preview(0) +#@gui_ja :マスクサイズ=int(3,3,20) +#@gui_ja :閾値=float(10,0,200) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: Jérome Boulanger 最終更新: 2010/12/29") +#@gui_ja 補修 [パッチベース]:fx_inpaint_patch,gui_no_preview +#@gui_ja :パッチサイズ=_int(7,1,64) +#@gui_ja :参照サイズ=_float(16,1,32) +#@gui_ja :参照基数=_float(0.1,0,1) +#@gui_ja :ぼかしサイズ=_float(1.2,0,5) +#@gui_ja :ぼかししきい値=_float(0,0,1) +#@gui_ja :ぼかし減衰=_float(0.05,0,0.5) +#@gui_ja :スケールの階層数=_int(10,1,20) +#@gui_ja :マスク外領域のぼかしを許可=_bool(1) +#@gui_ja :マスクの色=_color(#ff0000ff) +#@gui_ja :マスクを広げる=_int(0,0,32) +#@gui_ja :_=separator() +#@gui_ja :_=note("このフィルタの詳しい使い方はこちらで参照できます。") +#@gui_ja :_=link{"Patrick David 氏によるこのフィルタについてのチュートリアル (英語)","http://blog.patdavid.net/2014/02/getting-around-in-gimp-gmic-inpainting.html"} +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David TschumperléMaxime Daisy 最終更新: 2015/11/25") +#@gui_ja 補修 [マルチスケール]:fx_inpaint_matchpatch,fx_inpaint_matchpatch_preview +#@gui_ja :スケールの階層数=_int(0,0,16) +#@gui_ja :_=note{"(自動で設定するには 0 を入力してください)"} +#@gui_ja :パッチサイズ=_int(9,1,64) +#@gui_ja :スケールごとの処理回数=_int(10,1,100) +#@gui_ja :ぼかしサイズ=_int(5,0,32) +#@gui_ja :マスク外領域のぼかしを許可=_bool(1) +#@gui_ja :マスクの色=_color(#ff0000ff) +#@gui_ja :マスクを広げる=_int(0,0,32) +#@gui_ja :_=separator() +#@gui_ja :処理中に進捗状況をプレビュー=_bool(0) +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2015/11/25") +#@gui_ja 透明部分を埋める:fx_solidify_td,fx_solidify_td_preview(1) +#@gui_ja :なめらかさ (%)=float(75,0,100) +#@gui_ja :正規化=choice(1,"等方性","Delaunay-Oriented","Edge-Oriented") +#@gui_ja :正規化の反復処理=int(20,0,100) +#@gui_ja :拡張 / 収縮=int(0,-20,20) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("注: このフィルタは、輸送拡散アルゴリズムを使用して画像の透明部分を再構成します。アルファチャンネルを有する画像にのみ効果があります。 ") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2016/04/07") +#@gui_ja Iain 式高速ノイズ除去:iain_fast_denoise_p,iain_fast_denoise_p_preview(0) +#@gui_ja :輝度=float(0,0,3) +#@gui_ja :色度=float(0,0,3) +#@gui_ja :ガンマ=float(1,.5,3) +#@gui_ja :斑点ノイズ除去=float(0,0,1) +#@gui_ja :出力結果にディザリングをかける=bool(0) +#@gui_ja :プレビューの表示=choice(0,"通常","輝度ノイズ","色度ノイズ") +#@gui_ja :_=separator() +#@gui_ja :並列実行=choice(1,"オフ","自動") +#@gui_ja :_=separator() +#@gui_ja :_=note("このノイズ除去フィルタは高速動作を再優先に設計されています。画像のディテールは損なわれる場合があります。") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: Iain Fergusson") +#@gui_ja :_=note("更新 2015/3/28 - 画像の乱れを解消するために並列実行時のオーバーラップ部分を拡大") +#@gui_ja :_=note("更新 2013/10/26 - 並列実行") +#@gui_ja :_=note("リリース 2013/2/22") +#@gui _光と影 +#@gui_ja ライトリーク:fx_light_leaks,fx_light_leaks_preview(1) +#@gui_ja :ライトリークの種類=int(0,0,70) +#@gui_ja :角度=float(0,-180,180) +#@gui_ja :X 方向のスケール=float(1,1,10) +#@gui_ja :Y 方向のスケール=float(1,1,10) +#@gui_ja :色相=float(0,-180,180) +#@gui_ja :不透明度=float(0.85,0,1) +#@gui_ja :合成モード=choice(2,"標準","明るくする","スクリーン","覆い焼き","加算","暗くする","乗算","焼き込み","オーバーレイ","ソフトライト","ハードライト","差分","減算","微粒取り出し","微粒結合","除算","色相","彩度","明度") +#@gui_ja :別のレイヤーに出力=_bool(1) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("このフィルタは、以下のリンク先で提供されているライトリーク用フリー素材を使用しています。") +#@gui_ja :_=link("Lomo Light Leaks","http://www.photoshoptutorials.ws/downloads/mockups-graphics/lomo-light-leaks/") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2015/07/01") +#@gui _劣化 +#@gui_ja ぼかし [ガウス]:fx_gaussian_blur,fx_gaussian_blur_preview(0) +#@gui_ja :大きさ (X、Y)=float(3,0,20) +#@gui_ja :大きさ (X)=float(0,0,20) +#@gui_ja :大きさ (Y)=float(0,0,20) +#@gui_ja :画像端での処理=choice(1,"黒を使用","最も近いピクセルの色を使用") +#@gui_ja :_=separator() +#@gui_ja :チャンネル=choice("すべて","RGBA [すべて]","RGB [すべて]","RGB [赤]","RGB [緑]","RGB [青]","RGBA [アルファ]","リニア RGB [すべて]","リニア RGB [赤]","リニア RGB [緑]","リニア RGB [青]","YCbCr [輝度]","YCbCr [色度、青-赤]","YCbCr [色度、青]","YCbCr [色度、赤]","YCbCr [色度、緑]","Lab [明度]","Lab [色度、ab]","Lab [色度、a]","Lab [色度、b]","Lch [色度、ch]","Lch [色度、c]","Lch [色度、h]","HSV [色相]","HSV [彩度]","HSV [明度]","HSI [輝度]","HSL [明度]","CMYK [シアン]","CMYK [マゼンタ]","CMYK [イエロー]","CMYK [キー]","YIQ [輝度]","YIQ [色度]") +#@gui_ja :範囲外の値の処理=choice("何もしない","切り捨て","正規化") +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja ぼかし [グロー]:fx_glow,fx_glow_preview(0) +#@gui_ja :大きさ=float(6,0,20) +#@gui_ja :_=separator() +#@gui_ja :チャンネル=choice(7,"すべて","RGBA [すべて]","RGB [すべて]","RGB [赤]","RGB [緑]","RGB [青]","RGBA [アルファ]","リニア RGB [すべて]","リニア RGB [赤]","リニア RGB [緑]","リニア RGB [青]","YCbCr [輝度]","YCbCr [色度、青-赤]","YCbCr [色度、青]","YCbCr [色度、赤]","YCbCr [色度、緑]","Lab [明度]","Lab [色度、ab]","Lab [色度、a]","Lab [色度、b]","Lch [色度、ch]","Lch [色度、c]","Lch [色度、h]","HSV [色相]","HSV [彩度]","HSV [明度]","HSI [輝度]","HSL [明度]","CMYK [シアン]","CMYK [マゼンタ]","CMYK [イエロー]","CMYK [キー]","YIQ [輝度]","YIQ [色度]") +#@gui_ja :範囲外の値の処理=choice("何もしない","切り捨て","正規化") +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja ぼかし [回転]:fx_blur_angular,fx_blur_angular_preview(1) +#@gui_ja :大きさ=float(2,0,10) +#@gui_ja :X 軸方向の中心 (%)=float(50,0,100) +#@gui_ja :Y 軸方向の中心 (%)=float(50,0,100) +#@gui_ja :シャープネス=float(0,0,500) +#@gui_ja :ガイドをプレビューに表示=bool(1) +#@gui_ja :_=separator() +#@gui_ja :チャンネル=choice(7,"すべて","RGBA [すべて]","RGB [すべて]","RGB [赤]","RGB [緑]","RGB [青]","RGBA [アルファ]","リニア RGB [すべて]","リニア RGB [赤]","リニア RGB [緑]","リニア RGB [青]","YCbCr [輝度]","YCbCr [色度、青-赤]","YCbCr [色度、青]","YCbCr [色度、赤]","YCbCr [色度、緑]","Lab [明度]","Lab [色度、ab]","Lab [色度、a]","Lab [色度、b]","Lch [色度、ch]","Lch [色度、c]","Lch [色度、h]","HSV [色相]","HSV [彩度]","HSV [明度]","HSI [輝度]","HSL [明度]","CMYK [シアン]","CMYK [マゼンタ]","CMYK [イエロー]","CMYK [キー]","YIQ [輝度]","YIQ [色度]") +#@gui_ja :範囲外の値の処理=choice("何もしない","切り捨て","正規化") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2015/1/16") +#@gui_ja ぼかし [放射状]:fx_blur_radial,fx_blur_radial_preview(1) +#@gui_ja :大きさ=float(3,0,20) +#@gui_ja :X 軸方向の中心 (%)=float(50,0,100) +#@gui_ja :Y 軸方向の中心 (%)=float(50,0,100) +#@gui_ja :シャープネス=float(0,0,500) +#@gui_ja :ガイドをプレビューに表示=bool(1) +#@gui_ja :_=separator() +#@gui_ja :チャンネル=choice(7,"すべて","RGBA [すべて]","RGB [すべて]","RGB [赤]","RGB [緑]","RGB [青]","RGBA [アルファ]","リニア RGB [すべて]","リニア RGB [赤]","リニア RGB [緑]","リニア RGB [青]","YCbCr [輝度]","YCbCr [色度、青-赤]","YCbCr [色度、青]","YCbCr [色度、赤]","YCbCr [色度、緑]","Lab [明度]","Lab [色度、ab]","Lab [色度、a]","Lab [色度、b]","Lch [色度、ch]","Lch [色度、c]","Lch [色度、h]","HSV [色相]","HSV [彩度]","HSV [明度]","HSI [輝度]","HSL [明度]","CMYK [シアン]","CMYK [マゼンタ]","CMYK [イエロー]","CMYK [キー]","YIQ [輝度]","YIQ [色度]") +#@gui_ja :範囲外の値の処理=choice("何もしない","切り捨て","正規化") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2015/1/16") +#@gui_ja ぼかし [線形]:fx_blur_linear,fx_blur_linear_preview(1) +#@gui_ja :平行方向の半径=float(10,0,100) +#@gui_ja :直交方向の半径=float(0.5,0,100) +#@gui_ja :角度=float(0,0,180) +#@gui_ja :シャープネス=float(0,0,500) +#@gui_ja :画像端での処理=choice(1,"黒を使用","最も近いピクセルの色を使用") +#@gui_ja :_=separator() +#@gui_ja :チャンネル=choice(7,"すべて","RGBA [すべて]","RGB [すべて]","RGB [赤]","RGB [緑]","RGB [青]","RGBA [アルファ]","リニア RGB [すべて]","リニア RGB [赤]","リニア RGB [緑]","リニア RGB [青]","YCbCr [輝度]","YCbCr [色度、青-赤]","YCbCr [色度、青]","YCbCr [色度、赤]","YCbCr [色度、緑]","Lab [明度]","Lab [色度、ab]","Lab [色度、a]","Lab [色度、b]","Lch [色度、ch]","Lch [色度、c]","Lch [色度、h]","HSV [色相]","HSV [彩度]","HSV [明度]","HSI [輝度]","HSL [明度]","CMYK [シアン]","CMYK [マゼンタ]","CMYK [イエロー]","CMYK [キー]","YIQ [輝度]","YIQ [色度]") +#@gui_ja :範囲外の値の処理=choice("何もしない","切り捨て","正規化") +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja ぼかし [被写界深度]:fx_blur_dof,fx_blur_dof_preview(1) +#@gui_ja :大きさ=float(3,0,20) +#@gui_ja :精度=int(16,2,64) +#@gui_ja :被写界深度の種類=choice{"ガウス","ユーザー定義 (最背面のレイヤー)"} +#@gui_ja :ぼかしを反転=bool(0) +#@gui_ja :_=separator() +#@gui_ja :_=note{"被写界深度 (ガウス):"} +#@gui_ja :X 軸方向の中心=float(50,0,100) +#@gui_ja :Y 軸方向の中心=float(50,0,100) +#@gui_ja :半径 1=float(30,0,200) +#@gui_ja :半径 2=float(30,0,200) +#@gui_ja :角度=float(0,0,180) +#@gui_ja :シャープネス=float(1,0,8) +#@gui_ja :ガイドをプレビューに表示=bool(1) +#@gui_ja :_=separator() +#@gui_ja :_=note{"被写界深度 (ユーザー定義):"} +#@gui_ja :ガンマ=float(0,-2,2) +#@gui_ja :_=note("各ピクセルの深度を輝度で表した深度マップ画像を最背面のレイヤーに配置することでフィルタに入力できます。 「入力レイヤー」コンボボックスでレイヤーを有効化するのをお忘れなく。") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2014/02/25") +#@gui_ja 色収差:fx_chromatic_aberrations,fx_chromatic_aberrations_preview(0) +#@gui_ja :第 1 色=color(#ff0000) +#@gui_ja :X 軸シフト=float(2,-16,16) +#@gui_ja :Y 軸シフト=float(2,-16,16) +#@gui_ja :_=separator() +#@gui_ja :第 2 色=color(#00ff00) +#@gui_ja :X 軸シフト (px)=float(0,-16,16) +#@gui_ja :Y 軸シフト (px)=float(0,-16,16) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2015/07/05") +#@gui_ja LOMO 風:fx_lomo,fx_lomo_preview(1) +#@gui_ja :ビネット効果の大きさ=float(20,0,100) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: Jérome BoulangerDavid Tschumperlé 最終更新: 06/06/2012") +#@gui _変形 +#@gui_ja レンズ歪み:fx_distort_lens,fx_distort_lens_preview(1) +#@gui_ja :強度=float(0.1,-1,1) +#@gui_ja :アスペクト比=float(0,-2,2) +#@gui_ja :ズーム=float(0,-4,4) +#@gui_ja :X 方向の中心 (%)=float(50,0,100) +#@gui_ja :Y 方向の中心 (%)=float(50,0,100) +#@gui_ja :画像の外側=choice(0,"透明","最近傍","繰り返し","反転") +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2017/02/18") +#@gui_ja 正距円筒図法画像から天頂・天底を生成:fx_equirectangular2nadirzenith,fx_equirectangular2nadirzenith(1) +#@gui_ja :モード=choice("天頂・天底を生成","正距円筒図法に戻す") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2015/12/29") +#@gui _描画 +#@gui_ja キューピッド:fx_cupid,fx_cupid +#@gui_ja :ぼかし=float(0,0,10) +#@gui_ja :色=color(#ff0000ff) +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2013/11/13") +#@gui_ja グラデーション [四隅]:fx_corner_gradient,fx_corner_gradient +#@gui_ja :色 1 (左上)=color(#ffffff80) +#@gui_ja :色 2 (右上)=color(#ff0000ff) +#@gui_ja :色 3 (左下)=color(#00ff00ff) +#@gui_ja :色 4 (右下)=color(#0000ffff) +#@gui_ja :_=separator() +#@gui_ja :色空間=choice(1,"SRGB","Linear RGB","Lab") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja シェルピンスキーの三角形:fx_sierpinski,fx_sierpinski(1) +#@gui_ja :反復=int(6,0,10) +#@gui_ja :第 1 頂点の X 座標=float(50,0,100) +#@gui_ja :第 1 頂点の Y 座標=float(0,0,100) +#@gui_ja :第 2 頂点の X 座標=float(0,0,100) +#@gui_ja :第 2 頂点の Y 座標=float(100,0,100) +#@gui_ja :第 3 頂点の X 座標=float(100,0,100) +#@gui_ja :第 3 頂点の Y 座標=float(100,0,100) +#@gui_ja :色=color(#808080) +#@gui_ja :不透明度=float(1,0,1) +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja ハートマーク:fx_heart,fx_heart_preview +#@gui_ja :サイズ=float(75,0,100) +#@gui_ja :ぼかし=float(0,0,10) +#@gui_ja :色=color(#ff0000ff) +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2013/11/13") +#@gui_ja バーンスレイのシダ:fx_barnsley_fern,fx_barnsley_fern_preview(1) +#@gui_ja :種類=choice("Asplenium Adiantum-Nigrum","Thelypteridaceae") +#@gui_ja :密度 (%)=float(100,0,300) +#@gui_ja :角度=float(30,-180,180) +#@gui_ja :不透明度 (%)=float(40,0,100) +#@gui_ja :色=color(#0ab200ff) +#@gui_ja :新しいレイヤーに出力=_bool(1) +#@gui_ja :_=separator() +#@gui_ja :_=note{"このフィルタは『バーンスレイのシダ (Barnsley fern} +#@gui_ja :_=link("https://en.wikipedia.org/wiki/Barnsley_fern") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2016/10/18") +#@gui_ja ボール:fx_ball,fx_ball_preview(0) +#@gui_ja :半径=int(128,1,1024) +#@gui_ja :光沢の明るさ=float(0.8,0,8) +#@gui_ja :光沢のサイズ=float(1,0,8) +#@gui_ja :陰影=float(1.5,0,4) +#@gui_ja :色=color(#ff00ff) +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2013/11/27") +#@gui_ja 方程式プロット [パラメトリック]:fx_equation_parametric,fx_equation_parametric +#@gui_ja :X(t)=text{"sin(t)*(exp(cos(t))-2*cos(4*t)-sin(t/12)^5)"} +#@gui_ja :Y(t)=text{"cos(t)*(exp(cos(t))-2*cos(4*t)-sin(t/12)^5)"} +#@gui_ja :Min-T=float(0,-1000,1000) +#@gui_ja :Max-T=float(100,-1000,1000) +#@gui_ja :解像度=int(4096,2,32768) +#@gui_ja :Outline Opacity=float(1,0,1) +#@gui_ja :Dot Size=int(0,0,16) +#@gui_ja :開始色=color(#400000) +#@gui_ja :終了色=color(#800000) +#@gui_ja :Colored Outline=bool(1) +#@gui_ja :アンチエイリアス=bool(1) +#@gui_ja :Decoration=bool(1) +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2013/11/13") +#@gui_ja 虹:fx_rainbow,fx_rainbow +#@gui_ja :左端の位置=float(80,0,100) +#@gui_ja :右端の位置=float(80,0,100) +#@gui_ja :左側の傾き=float(175,0,400) +#@gui_ja :右側の傾き=float(175,0,400) +#@gui_ja :細さ=float(3,0.1,8) +#@gui_ja :不透明度=float(80,0,199) +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja 雪片:fx_snowflake,fx_snowflake(1) +#@gui_ja :反復=int(5,0,6) +#@gui_ja :不透明度=float(1,0,1) +#@gui_ja :色=color(#ffffff) +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja 3D 押し出し:fx_extrude3d,fx_extrude3d_preview(1) +#@gui_ja :奥行き=float(10,1,1024) +#@gui_ja :解像度=int(512,1,1024) +#@gui_ja :丸み=float(0.6,0,3) +#@gui_ja :_=separator() +#@gui_ja :幅=_int(1024,1,4096) +#@gui_ja :高さ=_int(1024,1,4096) +#@gui_ja :サイズ=float(0.5,0,3) +#@gui_ja :X 角度=float(57,0,360) +#@gui_ja :Y 角度=float(41,0,360) +#@gui_ja :Z 角度=float(21,0,360) +#@gui_ja :パース=float(45,1,90) +#@gui_ja :光源位置 X=float(0,-100,100) +#@gui_ja :光源位置 Y=float(0,-100,100) +#@gui_ja :光源位置 Z=float(-100,-100,0) +#@gui_ja :光沢の大きさ=float(0.5,0,1) +#@gui_ja :光沢の強さ=float(0.7,0,3) +#@gui_ja :レンダリング方法=choice(4,"頂点","ワイヤーフレーム","単色","フラットシェーディング","グーローシェーディング","フォンシェーディング") +#@gui_ja :アンチエイリアシング=bool(1) +#@gui_ja :_=separator() +#@gui_ja :_=note("注: 最前面のレイヤーをテクスチャとして使用できます。") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui _白黒画像編集 +#@gui_ja 彩色 [インタラクティブ]:fx_colorize_interactive,fx_colorize_interactive_preview +#@gui_ja :入力タイプ=_choice("白黒写真","線画") +#@gui_ja :出力タイプ=_choice{"彩色済み画像 (1 レイヤー)","色のみ (1 レイヤー)","画像 + 色 (2 レイヤー)","画像 + 色 (複数レイヤー)"} +#@gui_ja :表示解像度=_choice{1,"小 (高速)","中","大 (低速)","最大 (最低速)"} +#@gui_ja :追加パレット 1 (.gpl ファイル)=_file("") +#@gui_ja :追加パレット 2 (.gpl ファイル)=_file("") +#@gui_ja :_=separator() +#@gui_ja :_=note{"説明:\n このフィルタでは、白黒写真や線画を簡単に彩色できます。 ウィンドウ下部の適用または OK をクリックすると、インタラクティブウィンドウが開き、コントロールポイントを追加できます。 コントロールポイントの配置が完了したら、インタラクティブウィンドウを終了すると、彩色処理が実行され結果が GIMP に出力されます。\n\n 処理結果がお気に召さなかった場合はアンドゥ (Ctrl+Z) を行ったあと適用をもう一度クリックし、コントロールポイントの配置を調整してください。 ウィンドウ下部のリセットをクリックするとコントロールポイントをすべて消去できます。 "} +#@gui_ja :コントロールポイントを消去=button(0.5) +#@gui_ja :Last Image Size=const(0,0) +#@gui_ja :Control Points=const(-1) +#@gui_ja :_=separator() +#@gui_ja :_=note{"操作説明:\n インタラクティブウィンドウでは以下のアクションが利用できます。\n\n - 左マウスボタン クリックで新しいコントロールポイントを作成 (またはドラッグで既存のものを移動)\n - 右マウスボタンまたはX キー クリックしたコントロールポイントを削除\n - 右マウスボタンまたはP キー (コントロールポイントのない場所で) クリックした場所の色を取得\n - マウスホイールまたはCtrl+矢印キー上/下 表示を拡大/縮小\n - Ctrl+マウスホイールShift+マウスホイールまたは矢印キー 拡大した画像の表示範囲を移動\n - スペースキー 処理結果予測の表示を更新\n - Tab キー コントロールポイントの表示方法を切り替え\n - Backspace キー 最後に追加したコントロールポイントを削除\n - PageUp キー 画像のコントラストを上げる\n - PageDown キー 画像のコントラストを下げる\n - R キー 色置換モードのオン/オフを切り替え\n - Ctrl+D ウィンドウサイズを大きくする\n - Ctrl+C ウィンドウサイズを小さくする\n - Ctrl+R ウィンドウサイズをリセット\n - Esc キーQ キーまたは Enter キー インタラクティブウィンドウを終了 "} +#@gui_ja :_=separator() +#@gui_ja :_=note("このフィルタの詳しい使い方は以下の Web ページで参照できます。") +#@gui_ja :_=link{"David Revoy 氏による G'MIC Colorize フィルタのチュートリアル (英語)","http://www.davidrevoy.com/article240/gmic-line-art-colorization"} +#@gui_ja :_=link("ぐるぐる氏による上記チュートリアルの日本語翻訳","http://sp-cute.hatenablog.com/entry/2014/10/12/142939") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2014/12/09") +#@gui_ja 彩色 [コミック]:fx_colorize_comics,fx_colorize_comics_preview(1) +#@gui_ja :_=note("レイヤー順序:") +#@gui_ja :入力レイヤー=choice(0,"カラースポット + 線画","線画 + カラースポット","カラースポット + 色分け処理結果 + 線画","線画 + カラースポット + 色分け処理結果") +#@gui_ja :出力レイヤー=_choice(1,"1 レイヤーに統合","色分け処理結果 + 線画","線画 + 色分け処理結果","カラースポット + 色分け処理結果 + 線画","線画 + カラースポット + 色分け処理結果") +#@gui_ja :色分け処理結果の出力=choice("1 レイヤー","2 レイヤー","3 レイヤー","4 レイヤー","5 レイヤー","6 レイヤー","7 レイヤー","8 レイヤー","9 レイヤー","10 レイヤー","色ごとに 1 レイヤーずつ","範囲ごとに 1 レイヤーずつ") +#@gui_ja :_=separator() +#@gui_ja :なめらかさ=float(0.05,0,1) +#@gui_ja :_=separator() +#@gui_ja :_=note{"注: ウィンドウ左側の「入力レイヤー」で「すべて」を選択してください。\n カラースポット = 色指定を描きこんだレイヤーです。\n 線画 = 線画のレイヤー (白黒または空白部分が透明のもの) です。\n 色分け処理結果 = 色分け処理の結果が出力されるレイヤーです。\n\n 注意: \n - プレビューは実際の処理結果と異なる場合があります。 \n - 十分なメモリを搭載していない PC では、「色分け処理結果の出力」で「色ごとに 1 レイヤーずつ」「範囲ごとに 1 レイヤーずつ」のオプションを使用しないでください。 "} +#@gui_ja :_=separator() +#@gui_ja :_=link{"このフィルタの詳しい使い方はこちらで参照できます。(英語)","http://www.gimpchat.com/viewtopic.php?f=28&t=7567"} +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David TschumperléTimothée GietDavid Revoy 最終更新: 2013/06/19") +#@gui_ja 線画を自動的に色分け:fx_autofill_lineart,fx_autofill_lineart_preview(0) +#@gui_ja :輪郭のしきい値 (%)=float(90,0,100) +#@gui_ja :輪郭の正規化=bool(1) +#@gui_ja :Minimal Region Area=int(8,0,256) +#@gui_ja :Tolerance to Gaps=int(0,0,10) +#@gui_ja :プレビューの表示方法=choice("線画と色","色のみ") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2016/11/12") +#@gui_ja :使用する色=choice("ランダム","最前面の色指定レイヤー") +#@gui_ja :_=separator() +#@gui_ja :_=note("Global geometry parameters:") +#@gui_ja :輪郭の検出 (%)=float(95,0,100) +#@gui_ja :輪郭の膨らまし=int(0,-1,10) +#@gui_ja :_=note("輪郭を膨らませるサイズを自動で設定するには、「輪郭の膨らまし」を -1 に設定します。") +#@gui_ja :Output Region Delimiters=_bool(0) +#@gui_ja :_=separator() +#@gui_ja :_=note("「使用する色」に「ランダム」を設定した場合のみ:") +#@gui_ja :色の最大彩度=int(32,0,255) +#@gui_ja :色の最小輝度=int(200,0,255) +#@gui_ja :_=separator() +#@gui_ja :_=note("「使用する色」に「最前面の色指定レイヤー」を設定した場合のみ:") +#@gui_ja :Color Shading (%)=int(0,0,100) +#@gui_ja :_=separator() +#@gui_ja :_=note("接続パラメーター:") +#@gui_ja :End Point Rate (%)=float(85,0,100) +#@gui_ja :端点の最大接続数=int(2,1,5) +#@gui_ja :スプライン曲線の長さの上限 (px)=float(60,0,256) +#@gui_ja :セグメントの長さの上限 (px)=float(20,0,256) +#@gui_ja :スプライン曲線の角度の上限 (度)=float(90,0,180) +#@gui_ja :Spline Roundness=float(1,0,2) +#@gui_ja :Minimal Region Area=float(10,0,100) +#@gui_ja :自己交差を許可=bool(1) +#@gui_ja :_=separator() +#@gui_ja :プレビューの種類=choice(0,"Colored Geometry","Colored Regions","Colored Lineart") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé、Sébastien Fourey、David Revoy 最終更新: 2016/12/13") +#@gui _ +#@gui_ja セピア:fx_sepia,fx_sepia_preview +#@gui_ja :ガンマ=float(0,-1.2,1.2) +#@gui_ja :コントラスト=float(1,0,4) +#@gui_ja :輝度=float(0,-255,255) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja 色を転写 [基本的]:fx_transfer_colors,fx_transfer_colors +#@gui_ja :輝度を転写=bool(0) +#@gui_ja :レイヤー順序を反転=bool(0) +#@gui_ja :_=note("注: 最背面のレイヤーの色を参照します。\n このフィルタを正しく動作させるには、最低でも 2 枚のレイヤーが必要となります。複数のレイヤーを入力できるよう、「入力レイヤー」オプションを調整してください。 ") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja 色を選択して置換:fx_select_color,fx_select_color_preview(0) +#@gui_ja :色空間=choice(0,"RGB[A]","RGB","YCbCr","赤","緑","青","不透明度","輝度","赤・青 色度","色相","彩度") +#@gui_ja :許容誤差=float(20,0,100) +#@gui_ja :なめらかさ=float(0,0,10) +#@gui_ja :穴を埋める=int(0,0,256) +#@gui_ja :選択する色=color(#ffffffff) +#@gui_ja :出力画像=choice(0,"選択した色","選択した色のマスク","除外された色","除外された色のマスク","色を置換") +#@gui_ja :置換に使う色=color(#ff0000ff) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja 選択的脱色:fx_selective_desaturation,fx_selective_desaturation_preview(1) +#@gui_ja :指定する色=color(#ffffff) +#@gui_ja :脱色対象=choice("指定色","指定色以外のすべて") +#@gui_ja :効果の強さ=float(3,0,10) +#@gui_ja :正則化=int(0,0,20) +#@gui_ja :彩度の上限=choice("入力画像","指定色","Maximum Value") +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2015/7/15") +#@gui _芸術的 +#@gui_ja 四分木画像処理:fx_quadtree,fx_quadtree_preview(1) +#@gui_ja :モード=choice("Squares","Sierpinksi Design","楕円ブラシで描画") +#@gui_ja :精度=int(1024,2,4096) +#@gui_ja :均一性=float(0.5,0,2) +#@gui_ja :輪郭線=int(0,0,4) +#@gui_ja :_=separator() +#@gui_ja :_=note("「楕円ブラシで描画」用の設定:") +#@gui_ja :第 1 半径=float(3,0,5) +#@gui_ja :第 2 半径=float(1.5,0,5) +#@gui_ja :異方性=float(1,0,4) +#@gui_ja :Only Leafs=bool(1) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体に適用","下半分に適用","右半分に適用","上半分に適用","左半分に適用","複製して上下に並べる","複製して左右に並べる") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2017/06/15") +#@gui _詳細 +#@gui_ja シャープ化 [テクスチャ]:fx_sharpen_texture,fx_sharpen_texture_preview(0) +#@gui_ja :強さ=float(1,0,4) +#@gui_ja :半径=float(4,0,32) +#@gui_ja :_=separator() +#@gui_ja :チャンネル=choice(16,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2016/09/20") +#@gui_ja DCP 霞除去:jeje_dehaze,jeje_dehaze_preview +#@gui_ja :スケール=int(5,1,20) +#@gui_ja :強さ=float(1,0,2) +#@gui_ja :最小=float(.2,0,1) +#@gui_ja :最大=float(1,0,1) +#@gui_ja :輝度=float(0,-100,100) +#@gui_ja :コントラスト=float(0,-100,100) +#@gui_ja :ガンマ=float(0,-100,100) +#@gui_ja :透過率マップ=bool(false) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("Dark Channel Prior Author に基づく霞除去フィルタです。作者: Jérôme Boulanger 最終更新: 2016/08/09") +#@gui _輪郭 +#@gui_ja 前景切り出し [インタラクティブ]:fx_extract_foreground,gui_no_preview +#@gui_ja :縁のぼかし=_float(0,0,4) +#@gui_ja :広げ=int(0,-32,32) +#@gui_ja :出力モード=choice{3,"RGBA 画像 (背景を完全に透明化 / 1 レイヤー)","RGBA 画像 (可逆的 / 1 レイヤー)","RGB 画像 + 2 値マスク (2 レイヤー)","RGBA 前景 + 背景 (2 レイヤー)"} +#@gui_ja :表示解像度=_choice{1,"小 (高速)","中","大 (低速)","最大 (最低速)"} +#@gui_ja :_=separator() +#@gui_ja :_=note("説明:\n このフィルタでは、不透明な RGB 画像から前景オブジェクトを簡単に切り出すことができます。 ウィンドウ下部の適用または OK をクリックすると、インタラクティブウィンドウが開き、コントロールポイントを追加できます。 コントロールポイントの配置が完了したら、インタラクティブウィンドウを終了すると、切り出し処理が実行され結果が GIMP に出力されます。\n\n 処理結果がお気に召さなかった場合は、適用をもう一度クリックしてコントロールポイントの配置を調整してください。 ウィンドウ下部のリセットをクリックするとコントロールポイントをすべて消去できます。 ") +#@gui_ja :Last Image Size=const(0,0) +#@gui_ja :Control Points=const(-1) +#@gui_ja :_=separator() +#@gui_ja :_=note{"操作:\n インタラクティブ ウィンドウでは以下のアクションが利用できます。\n\n - 左マウスボタンまたは F キー: クリックで新しい前景コントロールポイントを作成 (ドラッグで既存のものを移動)\n - 右マウスボタンまたは B キー: クリックで新しい背景コントロールポイントを作成 (ドラッグで既存のものを移動)\n - マウスホイールまたは Ctrl+矢印キー上/下: 表示を拡大/縮小\n - スペースキー: 切り出しマスクを更新\n - Tab キー: 背景の表示モードを切り替え\n - M キー: コントロールポイントの表示モードを切り替え\n - Backspace キー: 最後に追加したコントロールポイントを削除\n - PageUp キー: 背景の不透明度を上げる\n - PageDown キー: 背景の不透明度を下げる\n - Ctrl+D: ウィンドウサイズを大きくする\n - Ctrl+C: ウィンドウサイズを小さくする\n - Ctrl+R: ウィンドウサイズをリセット\n - Esc キーQ キーまたは Enter キー: インタラクティブウィンドウを終了 "} +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2014/09/29") +#@gui _配列とタイリング +#@gui_ja シームレス化 [パッチベース]:fx_frame_seamless,fx_frame_seamless_preview(0) +#@gui_ja :フレームサイズ=int(32,0,256) +#@gui_ja :パッチサイズ=int(9,3,64) +#@gui_ja :合成部分のサイズ=int(0,0,64) +#@gui_ja :Frame Type=choice(1,"Inner","Outer") +#@gui_ja :Equalize Light=float(100,0,100) +#@gui_ja :_=separator() +#@gui_ja :Preview Original=bool(0) +#@gui_ja :Tiled Preview=choice(3,"None","2x1","1x2","2x2","3x3","4x4") +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("注: このフィルタを使用すると、入力した画像をつなぎ目のないパターンに簡単に変換できます。") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2015/12/15") +#@gui _About +#@gui ♥ Support Us ! ♥:_none_,fx_support_us +#@gui :_=note("
") +#@gui :_=note("
is proposed to you by
") +#@gui :_=note("
   David Tschumperlé     and        Sébastien Fourey
") +#@gui :_=link{"( IMAGE Team / GREYC Laboratory - CNRS UMR 6072 )","https://www.greyc.fr/?page_id=443&lang=en"} +#@gui :_=note("\nIf you appreciate what we do on G'MIC and want to help us maintaining and developing this piece of software, please consider making a donation!\n\n") +#@gui :_=note(
) +#@gui :_=link("Go to the donation page","https://libreart.info/en/projects/gmic") +#@gui :_=separator() +#@gui :_=note{"\nG'MIC officially collaborates with LILA ("Libre comme l'Art"), a French non-profit organization, which promotes Arts and Artists as well as access to technics and knowledge for everyone.\n LILA collects donations to help developing G'MIC."} +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/03/13.") +#@gui About G'MIC:_none_,_none_ +#@gui :_=note("
") +#@gui :_=note("
is proposed to you by
") +#@gui :_=note("
   David Tschumperlé     and        Sébastien Fourey
") +#@gui :_=link{"( IMAGE Team / GREYC Laboratory - CNRS UMR 6072 )","https://www.greyc.fr/?page_id=443&lang=en"} +#@gui :_=note{"\n This plug-in is based on our open-source libraries G'MIC and CImg (C++ Template Image Processing Library), available at:"} +#@gui :_=note(
  https://gmic.eu     and       http://cimg.eu
) +#@gui :_=note{"\n If you appreciate G'MIC, you are welcome to send us a nice postcard from your place, at:\n\n David Tschumperlé,\n Laboratoire GREYC (CNRS UMR 6072), Equipe Image,\n 6 Bd du Maréchal Juin,\n 14050 Caen Cedex / France."} +#@gui :_=note{"Postcards senders automatically enter the Friends Hall of Fame :) !\nYou may also consider making a donation!"} +#@gui Contributors:_none_,_none_ +#@gui :_=note{" We would like to thank all these people who contributed to G'MIC in one way or another. A big hug to : \n\n - Sylvie Alexandre (packaging, testing & filters) - Partha Bagchi (packaging) - Daniel P. Berrangé (packaging) - Sébastien Bougleux (debugging) - Jérome Boulanger (testing & code) - Claude Bulin (packaging) - Aurélien Ceyden (packaging) - François Collard (testing) - Patrick David (testing & filters) - Maxime Daisy (code & testing) - Frédéric Devernay (code) - Iain Fergusson (filters) - Tobias Fleischer (testing & code) - Roberto Ferramosca (packaging) - Jérome Ferrari (testing, code & tutorials) - Andrea Ferrero (testing, code) - Chris Fiedler (gfx) - Sébastien Fourey (G'MIC-Qt, ZArt code & G'MIC online) - Gentlemanbeggar (filters) - David Gowers (testing) - Claes Holmerson (tutorials) - Arto Huotari (filters) - Dan Leinir Turthra Jensen (debugging) - Tom Keil (testing, filters & tutorials) - Andy Kelday (testing & filters) - Alan Kwan (afre) (testing & filters) - Angelo Lama (testing & EKD integration) - John Lakkas (filters) - Stéphane de la Linuxerie (design) - Mark (translation) - Mahvin (testing & design) - MareroQ (translation) - Ramon Miranda (translation) - Tou Omiya (translation) - Mauro Quercia (translation) - PhotoComiX (testing, translation & filters) - Garry Osgood (documentation & filters) - Jehan Pages (testing & code) - Andreas Påhlsson (filters) - James Prichard (testing & filters) - Guilherme Razgriz (translation) - Karsten Rodenacker (packaging & code) - Marc Roovers (clut data) - Dani Sardà (translation) - Yuri Shemanin (debugging) - Silvio Grosso (debugging) - Stepanekos (translation) - Thorsten "otto" Stettin (packaging) - Lukas Tvrdy (Krita integration) - Martin Wolff (testing & filters) - Bernd Zeimetz (packaging) - Matthias Zepper (testing) -"} +#@gui Download External Data:gui_download_all_data,gui_no_preview(1) +#@gui :_=note{"This filter will download all external data files used by some filters of the G'MIC plug-in (Color Grading, Light Leaks, Grain, etc...), and will install them as persistent files on your hard drive. After this operation, you won't need a permanent internet connection anymore in order to use some of the G'MIC filters."} +#@gui :_=note() +#@gui :_=note("Warning: A lot of data will be downloaded. This can take a long time !") +#@gui :_=separator() +#@gui :Force Re-Download from Scratch=_bool(0) +#@gui :_=separator() +#@gui :_=note{"Alternative (manual) method:\nIf, for any reasons, your plug-in is unable to retrieve data from the Internet, you can download all those data files manually (as a single .zip file) at this address :"} +#@gui :_=link("https://gmic.eu/gmic_all_data.zip") +#@gui :_=note("You must then decompress all files contained in this archive at the following location:\n - for Unix-like systems : $HOME/.cache/gmic/\n - for Windows systems : %APPDATA%/gmic/ ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/16/04.") +#@gui Filter Design:_none_,_none_ +#@gui :_=note{" G'MIC is an open image processing framework. Thus, including user-defined filters into this plug-in is possible.\n\n To do so, you need to create a .gmic file in your $HOME/ folder (or %USERPROFILE%/user.gmic on Windows). It will be read each time the plug-in is launched, or when the Refresh button (under the central pane) is pressed. It must be a regular text file, containing the declarations and implementations of the filters (written in the G'MIC language) that will be added to the list of available ones."} +#@gui :_=note(" Existing filters are already defined this way. Writing a filter from scratch in G'MIC requires some skills, but can be generally done in very few lines.\n\n Example of a valid .gmic entry :") +#@gui :_=note("#@gui My effect : my_effect, my_effect") +#@gui :_=note{"#@gui : Sigma = float(2,0,10)"} +#@gui :_=note("my_effect :\n +blur $1 n 0,255 xor") +#@gui :_=note(" Look at the reference documentation and the tutorial whose links are given below, to learn more. By the way, you are encouraged to share your nice custom filters with us on our forums, for inclusion into next releases of G'MIC. ") +#@gui :_=separator() +#@gui :_=link(0,"[1] G'MIC reference documentation","https://gmic.eu/reference/") +#@gui :_=link(0,"[2] G'MIC scripting tutorial","https://gmic.eu/tutorial/") +#@gui :_=link(0,"[3] G'MIC filter template","https://github.com/GreycLab/gmic-community/blob/master/include/template.gmic") +#@gui Friends Hall of Fame:_none_,fx_friends +#@gui :_=note("\nSupporters:") +#@gui :_=note(" - A big hug goes to these friends who supported the project:") +#@gui :_=note(" Christian Stenner, Daniel Balle, Matthias Fuchs, Alban Bourrat, Elizabeth Hayman, Nicolas Künzler, Mikael Wargh, Giovanni Bianchessi, Job van der Zwan, Laurent Espitallier, Mark van der Grijp, Patrick Wauters, Marc-André Gasser, Steven Shupe, Mika Yrjölä, Silvio Grosso, Marek Kubica, Mike Bing, Dave Allen, Margaret Wong, Adrian Bottomley, Pamela Young, Chris Bowness, Peter Howarth, Marlon Montalvo, Christian Freiherr von Malchus, Nolan Tyrrell, Gilles Bouquerel, Mihail Balabanov, Rolf Niepraschk, Volkmar Geske, Menno Tjoelker, Abhijeet Borkar, Arleta Lesniewska, Nicola Giaccobe, Helmut Mühleisen, Paul Buckley, Olivier Lecarme, Edward Ingram, Stefan Städtler-Ley, Michel Pastor, Sz.U, Sven Kraft, Frederik Elwert, Jessica Leonard, Kenneth Simons, Milos Ciuk, Manlio Barolo, John Lewandowski, Didier Lima, Žygimantas Tauras, Massimo Ferri, Hiroshi Takekawa, Freelance writer, Elaine Hutchings, András Somogyi, Jason Dora, Boris Hajdukovic, Jeff Combs / Mappish, BTraven, Steven Brener, Susanne Gabrielski, Andrea Correani, Mads Thomsen, Djek Eykhout, Michael Calabrese, Joachim Steiert Christian Dubettier, J. Casseur, Okki, Dariusz Duma, Mahvin, Elleen Hennessy, BluffStuffPlus, Bertrand Chan, Mirella Scotto, Paul Sauve, Lars Mielke, Devin Sorell, Pepe Baeza, Andrey Pivovarova, David Oliver, errore, Anudai, James Stalnaker, Paolo Finetti, Luigi Scarselli, Pat David, Juan Jose Rodriguez Vela, Thomas Jakob, Kim Bartholomew, Sudi, Michael Prostka, Arkadi Gelfond, Sabine Schäfers, Bull O'Woods, Jost Jakob Schaper, Dominik Wefers, Frank McLaughlin, Jonas Wagner, Void lon iXaarii, Mark Boadey, Laura Haglund, Lee Elliott, Bernard Desenclos, Randy Gordon-Gilmore, Eddie Dedrick, Greg FitzPatrick, Zsolt Szabo, Daniel Hanna, Peter Bengtsson, Diego Nassetti, William Tweedy, Shawnee Horn, Stephan Munsch, MysticAli3n-Wear, Mika Mantere, Christian Beuschel, Tore Busch, Douc McGregor. Marcel Dahm, Susan Voitel, Henk Koning, Arnie Jordan, Carol Jennings, Sébastien Huart, Jess Stryker, Rui Luis, Renato Salles, Petr Zagalak, Antonio Vicién Faure, Vincent Bermel, Christian Stocco, Richard Benedict, Dr. Helmut Jarausch, Michael Beck, Riccardo Leone, Gisela Looram, Frank Tegtmeyer, David Kettrey, Peter Hoge, Alexander Heitmann, Olivier Larski, Victor Fandrey, Stefan Peter, Dimitrios Psychogios, Antti Luoma, Eddy Young Tie Yang, Thomas Elfstrom, Valentine Boyce, George Harnett, Darius Manka, Chris Knox, Thomas Tapping, Phillip R Ziesemer, Jean Francois. Franz Ziereis, Alessandro Renzi, Tsuda Koshi, Boxrec Ltd, Wolfgang Schweizer, Ramon Miranda, Volker Bradley, Marco Zara, Marco Tedaldi, Rodney Lee, Konstantinos Blatzonis, Simon Chanson, Herbert Malle, Matthias Zepper, Christian Mariucci, M. R., Mark Link, Rolf Steinort, Daniel Tauro, Ben Langhinrichs, Paolo Pedaletti, Ricardo Corin, James Prichard, Matt Jones, Eddy Vervest, Flavio Casadei Della Chiesa, Lyle Kroll. ") +#@gui :_=separator() +#@gui :_=note("\nPostcard senders:") +#@gui :_=note{" - We've received 46 postcards from G'MIC enthusiasts so far. You could be the 47rd sender :)"} +#@gui :_=note{" - A big hug goes to these postcard senders (recently received first) :"} +#@gui :_=note{" Benjamin Russell (Portsmouth/USA), Andreas Weissenburger (Bochum/Germany), Patrick Wanters (USA), Josep Febrer (Pregonda/Menorca), Richard Gledson (Newcastle upon tyne/England), James Jaworski (Winnipeg/Canada), Powlux (France), Volker Doebel (Haldern/Germany), Patrick Wauters (Bilbao/Spain), Sebastien Fourey (Konstanz/Germany), David Revoy (Toulouse/France), Giulio Canevari (Pavia/Italy), Bruno Steinbach (Pondicherry/India), Steve Gillow (Fort Worth/Texas/USA), Peter Neave (Sydney/Australia), Andrea [Photoflow] (Italy), Garry R. Osgood (New York/USA), Justin Pletzfeld (Germany), Werner Meier (Germany), Patrick Wauters (Roma/Italy), Marc Lis (Belgium), ZondeR (France), Bill C. (USA), Michael T. (France), Patrick Wauters (Lisboa), Akky [Gimpchat] (Australia), Michel Thomas (Germany), Pierre-Yves (Ile de Batz/France), Family Hamacher (Trier/Germany), Benoit Gauzere and Francois Lozes (Hokusai/Japan), Dr. Rainer Teubner (Seligenstadt/Germany), Mauro Mitrino (Mantova/Italy), Werner Meier (Mettlach/Germany), Arto Huotari (Helsinki/Finland), Benoit Gauzere (California/USA), Arkadi Gelfond (Foster City - California/USA), Corinne Masimann (Neuchatel/Switzerland), Mahvin (Portland/USA), Vincent Roullier (Caen/France), M???? (Munich/Germany), F. Albior (Jaca/Spain), PhotoComIX (Frascati/Italy), Guy Poizat (Cabestany/France), Institut for Biomathematik und Biometrie (Neuherberg/Germany), Jean-Michel Webbe (Guadeloupe/France), Jaime (Barcelona/Spain). "} +#@gui :_=separator() +#@gui :_=note("\nMay the force be with you!") +#@gui_ca G'MIC per Al GIMP:_none_,_none_ +#@gui_ca :_=note{" ( GREYC's Magic for Image Computing )\n\n és una gentilesa de"} +#@gui_ca :_=link("David Tschumperlé","https://tschumperle.users.greyc.fr/") +#@gui_ca :_=link("Sébastien Fourey","https://foureys.users.greyc.fr/") +#@gui_ca :_=link{"( IMAGE Team / GREYC Laboratory - CNRS UMR 6072 )","https://www.greyc.fr/node/36"} +#@gui_ca :_=note{" Aquest connector està basat en les biblioteques de codi obert G'MIC i CImg (C++ Template Image Processing Library), disponibles a :"} +#@gui_ca :_=link("https://gmic.eu/") +#@gui_ca :_=note("i") +#@gui_ca :_=link("https://cimg.eu/") +#@gui_ca :_=note{"\n Si t'agrada el G'MIC, pots enviar-nos una postal del lloc on vius, a :\n\n David Tschumperlé,\n Laboratoire GREYC (CNRS UMR 6072), Equipe Image,\n 6 Bd du Maréchal Juin,\n 14050 Caen Cedex / France.\n\n Tot aquell que enviï una postal apareixerà al Friends Hall of Fame :) ! "} +#@gui Gmicky - Roddy:fx_gmicky,fx_gmicky_preview +#@gui :Mascot Image=choice{"Gmicky (by Deevad)","Gmicky (by Mahvin)","Gmicky & Wilber (by Mahvin)","Roddy (by Mahvin)"} +#@gui :_=separator() +#@gui :_=note{"Gmicky is the name of the G'MIC mascot. He is a small and cute tiger who knows how to do magic. Gmicky is a tiger, i.e. fast, agile and elegant, just as the G'MIC code is :). As many magicians, Gmicky knows lot of gimmicks, and he is a direct and friendly companion of the ImageMagick's wizard, or the GraphicMagick's frog."} +#@gui :_=note("Roddy is another mascot designed specifically for the Artistic / Rodilius filter of G'MIC.\n") +#@gui :_=note("Gmicky and Roddy have been both created and drawn by ") +#@gui :_=link("Mahvelous Mahvin","http://www.mahvin.com/") +#@gui :_=note("and") +#@gui :_=link{"David Revoy (Deevad)","http://www.davidrevoy.com/"} +#@gui Privacy Notice:_none_,_none_ +#@gui :_=note{"This plugin may download up-to-date filter definitions from the gmic.eu server.\n\n It is the case when first launched after a fresh installation, and periodically with a frequency which can be set in the settings dialog. The user should be aware that the following information may be retrieved from the server logs: IP address of the client; date and time of the request; as well as a short string, supplied through the HTTP protocol "User Agent" header field, which describes the full plugin version as shown in the window title (e.g. "G'MIC-Qt for GIMP 2.10 - Linux 64 bits - 3.2.6").\n\n Note that this information may solely be used for purely anonymous statistical purposes. "} +#@gui :_=separator() +#@gui :_=note("Author: Sébastien Fourey.      Latest Update: 2018/03/01.") +#@gui Release Notes:_none_,_none_ +#@gui :_=note{" - 2009/01/13 : version 1.3.0 (initial plug-in release).\n - 2010/09/03 : version 1.4.0.\n - 2011/07/07 : version 1.5.0.\n - 2014/08/20 : version 1.6.0.\n - 2016/03/25 : version 1.7.0.\n - 2017/05/29 : version 2.0.0.\n - 2017/10/09 : version 2.1.0.\n - 2018/02/15 : version 2.2.0.\n - 2018/06/21 : version 2.3.0.\n - 2018/10/04 : version 2.4.0.\n - 2019/03/15 : version 2.5.0.\n - 2019/04/29 : version 2.6.0.\n - 2019/08/14 : version 2.7.0.\n - 2019/12/04 : version 2.8.0.\n - 2020/03/28 : version 2.9.0.\n - 2021/12/09 : version 3.0.0.\n - 2022/04/06 : version 3.1.0.\n - 2023/01/16 : version 3.2.0.\n - 2023/06/26 : version 3.2.6 (Current stable).\n - 2023/07/03 : version 3.2.7_pre (Current pre-release).\n "} +#@gui :_=separator() +#@gui :_=link{"View changelog to upcoming minor version (3.3)","https://discuss.pixls.us/t/on-the-road-to-3-3"} +#@gui :_=link{"View latest major changelog (3.2)","https://discuss.pixls.us/t/release-of-gmic-3-2"} +#@gui What's New?:_none_,fx_whatsnew_preview +#@gui :_=note("Here you'll find a list of filter additions and deletions in the plug-in, since your last visit. When you have seen what's new, press the Got It! button to reset the list of changes.") +#@gui :_=separator() +#@gui :_=value(0)_0+ +#@gui :_=note("\nThere have been no changes since your last visit.\n\n") +#@gui :New Filters=text(1,"")_0 +#@gui :Removed Filters=text(1,"")_0 +#@gui :Got It!=button(0.5)_0+ +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.       Latest Update: 2021/01/18.") +#@gui _Arrays & Tiles +#@gui Array [Faded]:fx_array_fade,fx_array_fade_preview(1) +#@gui :X-Tiles=int(2,1,10) +#@gui :Y-Tiles=int(2,1,10) +#@gui :X-Offset (%)=float(0,0,100) +#@gui :Y-Offset (%)=float(0,0,100) +#@gui :Fade Start (%)=float(80,1,100) +#@gui :Fade End (%)=float(90,1,100) +#@gui :Mirror=choice("None","X-Axis","Y-Axis","XY-Axes") +#@gui :Size=_choice("Shrink","Expand","Repeat [Memory Consuming!]") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Array [Mirrored]:fx_array_mirror,fx_array_mirror_preview(1) +#@gui :Iterations=int(1,1,10) +#@gui :X-Offset (%)=float(0,0,100) +#@gui :Y-Offset (%)=float(0,0,100) +#@gui :Array Mode=choice(2,"X-Axis","Y-Axis","XY-Axes","2XY-Axes") +#@gui :Initialization=choice("Original","Mirror X","Mirror Y","Rotate 90 Deg.","Rotate 180 Deg.","Rotate 270 Deg.") +#@gui :Expand Size=_bool(false) +#@gui :Crop (%)=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Array [Random Colors]:fx_array_color,fx_array_color(1) +#@gui :X-Tiles=int(5,1,20) +#@gui :Y-Tiles=int(5,1,20) +#@gui :Opacity=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Array [Random]:array_random,array_random(1) +#@gui :Source X-Tiles=int(5,1,20) +#@gui :Source Y-Tiles=int(5,1,20) +#@gui :Destination X-Tiles=int(7,1,20) +#@gui :Destination Y-Tiles=int(7,1,20) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Array [Regular]:fx_array,fx_array_preview(1) +#@gui :X-Tiles=int(2,1,10) +#@gui :Y-Tiles=int(2,1,10) +#@gui :X-Offset (%)=float(0,0,100) +#@gui :Y-Offset (%)=float(0,0,100) +#@gui :Mirror=choice("None","X-Axis","Y-Axis","XY-Axes") +#@gui :Size=_choice("Shrink","Expand","Repeat [Memory Consuming!]") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Ascii Art:fx_asciiart,fx_asciiart_preview(0)+ +#@gui :Charset=choice(5,"Custom","Binary Digits","Digits","Lowercase Letters","Uppercase Letters","Ascii","Card Suits","Math Symbols") +#@gui :Custom Dictionary=text(" .oO0") +#@gui :Analysis Scale=int(16,8,103) +#@gui :Analysis Smoothness=float(15,0,100) +#@gui :Synthesis Scale=int(16,8,103) +#@gui :Result Type=choice(2,"White on Black","Black on White","Colored on Black","Colored on Transparent") +#@gui :_=separator() +#@gui :Gamma=float(0,-3,3) +#@gui :Smoothness=float(0.2,0,5) +#@gui :Colors=choice("Full Colors","2 Colors","3 Colors","4 Colors","8 Colors","12 Colors","16 Colors","Grayscale","2 Grays","3 Grays","4 Grays","8 Grays","12 Grays","16 Grays") +#@gui :_=separator() +#@gui :Output Ascii File=_bool(0) +#@gui :Output Folder=_folder() +#@gui :Output Filename=_text("gmic_asciiart.txt") +#@gui :_=separator() +#@gui :_=link("Click here for a detailed description of this filter.","http://www.gimpchat.com/viewtopic.php?f=28&t=10047") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/27/03.") +#@gui Chessboard:fx_chessboard,fx_chessboard_preview(0) +#@gui :First Size=int(64,1,512) +#@gui :Second Size=int(64,1,512) +#@gui :First Offset=int(0,0,512) +#@gui :Second Offset=int(0,0,512) +#@gui :Angle=float(0,0,180) +#@gui :Opacity=float(0.5,0,1) +#@gui :First Color=color(#000000ff) +#@gui :Second Color=color(#ffffffff) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Dices:fx_dices,fx_dices(0) +#@gui :Resolution=float(2,1,10) +#@gui :Size=int(24,8,64) +#@gui :Color Model=choice(1,"Black Dices","White Dices","Dices with Colored Numbers","Dices with Colored Sides") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/27/06.") +#@gui Drawn Montage:fx_drawn_montage,fx_drawn_montage_preview(1) : * +#@gui :Layer=choice("1st","2nd","3rd","4th","5th","6th","7th","8th","9th","10th","11th","12th","13th","14th","15th","16th") +#@gui :Associated Color=color(#000000) +#@gui :Zoom=float(-10,0,10) +#@gui :X-Centering (%)=float(50,0,100) +#@gui :Y-Centering (%)=float(50,0,100) +#@gui :Angle=choice("0 Deg.","90 Deg.","180 Deg.","270 Deg.") +#@gui :_=value(-1) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=separator() +#@gui :_=note("Note: This filter requires a top layer containing the desired montage layout defined as free-form shapes of different colors. You can then assign each layer to a layout color to create the montage. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/01/29.") +#@gui Extract Objects:fx_extract_objects,fx_extract_objects_preview(1) +#@gui :Background Point (%)=point(0,0) +#@gui :_=separator() +#@gui :Color Tolerance=int(20,0,256) +#@gui :Opacity Threshold (%)=int(50,0,100) +#@gui :Minimal Area=float(0.3,0,5) +#@gui :Connectivity=choice("Low","High") +#@gui :Output As=_choice(0,"Crop","Segmentation") +#@gui :_=separator() +#@gui :Preview Guides=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/23/02.") +#@gui :_=link("Filter explained here","http://gimpchat.com/viewtopic.php?f=28&t=7905") +#@gui Grid [Cartesian]:fx_imagegrid,fx_imagegrid(0) +#@gui :X-Size=int(10,2,512) +#@gui :Y-Size=int(10,2,512) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Grid [Hexagonal]:fx_imagegrid_hexagonal,fx_imagegrid_hexagonal(1) +#@gui :Resolution=int(32,1,128) +#@gui :Outline=float(0.1,0,0.5) +#@gui :Anti-Aliasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/12/01.") +#@gui Grid [Triangular]:fx_imagegrid_triangular,fx_imagegrid_triangular(0) +#@gui :Pattern Width=int(10,8,128) +#@gui :Pattern Height=int(18,8,128) +#@gui :Pattern Type=choice(0,"Horizontal","Vertical","Crossed","Cube","Decreasing","Increasing") +#@gui :Outline Color=color(#ffffff80) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/08/07.") +#@gui Make Seamless [Diffusion]:fx_make_seamless,fx_make_seamless_preview(1) +#@gui :Equalize Light=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Original=bool(0) +#@gui :Tiled Preview=choice(3,"None","2x1","1x2","2x2","3x3","4x4") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note{"Note: This filter helps in converting your input pattern as a seamless (a.k.a periodic) texture."} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/24/02.") +#@gui Make Seamless [Patch-Based]:fx_frame_seamless,fx_frame_seamless_preview(0) +#@gui :Frame Size=int(32,0,256) +#@gui :Patch Size=int(9,3,64) +#@gui :Blend Size=int(0,0,64) +#@gui :Frame Type=choice(1,"Inner","Outer") +#@gui :Equalize Light=float(100,0,100) +#@gui :_=separator() +#@gui :Preview Original=bool(0) +#@gui :Tiled Preview=choice(3,"None","2x1","1x2","2x2","3x3","4x4") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note{"Note: This filter helps in converting your input pattern as a seamless (a.k.a periodic) texture."} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/15/12.") +#@gui Ministeck:fx_ministeck,fx_ministeck_preview(1) +#@gui :Number of Colors=int(8,2,24) +#@gui :Resolution (px)=int(64,16,256) +#@gui :Piece Size (px)=int(8,1,64) +#@gui :Piece Complexity=int(2,1,10) +#@gui :Relief Amplitude=float(100,0,256) +#@gui :Relief Size=float(0.3,0,1) +#@gui :Add 1px Outline=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/14/01.") +#@gui Montage:fx_montage,fx_montage_preview(1) : * +#@gui :Montage Type=choice("Auto","Custom Layout","Horizontal","Vertical","Horizontal Array","Vertical Array") +#@gui :Custom Layout=text{"V(H(0,1),H(2,V(3,4)))"} +#@gui :Merging Mode=choice(1,"Aligned","Scaled") +#@gui :Centering / Scale=float(0.5,0,1) +#@gui :Padding (px)=int(0,0,128) +#@gui :_=separator() +#@gui :Frame (px)=int(0,0,128) +#@gui :Frame Color=color(#000000ff) +#@gui :_=separator() +#@gui :Angle=float(0,0,360) +#@gui :Angle Variations=float(0,0,180) +#@gui :_=separator() +#@gui :Cycle Layers=int(0,-255,255) +#@gui :Revert Layer Order=bool() +#@gui :Output As=_choice("Single Layer","Multiple Layers") +#@gui :_=separator() +#@gui :_=note{"Instructions:\n - Don't forget to set the Input layers... option on the left if you have multiple input layers for your montage.\n - The Custom layout parameter is only active when Montage type is set to Custom layout. This is basically a string containing expressions such as:\n \n . H(a,b) or V(a,b) stand respectively for an horizontal and vertical merge of two blocks a and b. \n . R(a), stands for a 90-deg. rotated version of a block a. Use RR(a) and RRR(a) for resp. 180-deg and 270-deg. rotations. \n . M(a), stands for a X-mirrored version of a block a. Use MRR(a) for a Y-mirrored version of a.\n\n - A block a can be a layer index or a nested montage expression itself.\n - Layer indices start from 0 (top layer) and are treated periodically. "} +#@gui :_=link("Click here for a tutorial","https://patdavid.net/2014/05/gmic-montage.html") +#@gui :_=link("+ video tutorial","http://www.youtube.com/watch?v=iM42vx22gwg") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/22/12.") +#@gui Puzzle:fx_puzzle,fx_puzzle_preview(1) +#@gui :_=note("Pattern parameters:") +#@gui :X-Tiles=int(5,2,32) +#@gui :Y-Tiles=int(5,2,32) +#@gui :Curvature=float(0.5,0,1.5) +#@gui :Connectors Centering=float(0,0,1) +#@gui :Connectors Variability=float(0,0,2) +#@gui :_=separator() +#@gui :_=note("Blending parameters:") +#@gui :Relief Smoothness=float(0.3,0,3) +#@gui :Relief Contrast=float(100,0,255) +#@gui :Outline Smoothness=float(0.2,0,3) +#@gui :Outline Contrast=float(255,0,255) +#@gui :_=separator() +#@gui :_=note("Recomposition parameters:") +#@gui :Scale=float(100,0,150) +#@gui :Scale Variations=float(0,0,100) +#@gui :Angle=float(0,-180,180) +#@gui :Angle Variations=float(0,0,180) +#@gui :Shuffle Pieces=bool(0) +#@gui :Additional Outline=bool(0) +#@gui :Output Each Piece on a Different Layer=_bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/06/01.") +#@gui Shuffle Patches:fx_shuffle_patches,fx_shuffle_patches_preview(0)* +#@gui :Mode=choice("Shuffle","Rotate","Shuffle & Rotate") +#@gui :Reconstruct From=choice("Colors","Gradients","Laplacians") +#@gui :Patch Size=int(64,4,512) +#@gui :Overlap (%)=float(0,0,50) +#@gui :Overlap Std (%)=float(20,0,100) +#@gui :Random Seed=int(0,0,65535) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2022/08/08.") +#@gui Taquin:fx_taquin,fx_taquin(1) +#@gui :X-Tiles=int(7,1,20) +#@gui :Y-Tiles=int(7,1,20) +#@gui :Remove Tile=choice("None","First","Last","Random") +#@gui :_=separator() +#@gui :Relief=float(50,0,255) +#@gui :Border Thickness (%)=float(5,0,100) +#@gui :Border Outline=int(0,0,16) +#@gui :Ouline Color=color(#000000ff) +#@gui :_=separator() +#@gui :Random Seed=int(0,0,65535) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/13/01.") +#@gui Tileable Rotation:fx_rotate_tileable,fx_rotate_tileable_preview(1) +#@gui :Angle=float(45,0,360) +#@gui :Maximum Size Factor=int(8,0,20) +#@gui :Array Mode=choice(0,"None","X-Axis","Y-Axis","Xy-Axes","2xy-Axes") +#@gui :_=separator() +#@gui :_=note("Note: This filter implements the tileable rotation technique described by Peter Yu, at:") +#@gui :_=link("[Peter Yu] Create rotated tileable patterns","http://www.peteryu.ca/tutorials/gimp/rotate_tileable_patterns") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/26/05.") +#@gui Tiled Isolation:fx_isolate_tiles,fx_isolate_tiles(0) +#@gui :X-Size=float(10,0,100) +#@gui :Y-Size=float(10,0,100) +#@gui :X-Border=float(5,0,100) +#@gui :Y-Border=float(5,0,100) +#@gui :Keep Tiles Square=bool(1) +#@gui :Keep Borders Square=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/13/04.") +#@gui Tiled Normalization:fx_normalize_tiles,fx_normalize_tiles(1) +#@gui :X-Tiles=int(25,1,80) +#@gui :Y-Tiles=int(25,1,80) +#@gui :Minimal Value=float(0,0,255) +#@gui :Maximal Value=float(255,0,255) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Tiled Parameterization:fx_parameterize_tiles,fx_parameterize_tiles(1) +#@gui :X-Tiles=int(10,1,30) +#@gui :Y-Tiles=int(10,1,30) +#@gui :Fitting Function=choice("Linear","Quadratic") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Tiled Random Shifts:fx_shift_tiles,fx_shift_tiles(1) +#@gui :X-Tiles=int(10,1,30) +#@gui :Y-Tiles=int(10,1,30) +#@gui :Amplitude=float(10,0,100) +#@gui :Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Tiled Rotation:fx_rotate_tiles,fx_rotate_tiles(1) +#@gui :X-Tiles=int(5,1,80) +#@gui :Y-Tiles=int(5,1,80) +#@gui :Angle=float(15,0,360) +#@gui :X-Shadow=float(3,-20,20) +#@gui :Y-Shadow=float(3,-20,20) +#@gui :Smoothness=float(1.8,0,5) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui _Artistic +#@gui Aurora:gcd_aurora,gcd_aurora(1) +#@gui :_=note("Simple aurora effect filter") +#@gui :_=separator() +#@gui :Vertical Amount=float(6,0,50) +#@gui :Horizontal Amount=float(1,0,50) +#@gui :Blend Mode=choice(0,"None","Average") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2013/02/09.") +#@gui Black Crayon Graffiti:fx_crayongraffiti2,fx_crayongraffiti2_preview(0) +#@gui :Amplitude=float(300,0,4000) +#@gui :Density=float(50,0,100) +#@gui :Smoothness=float(1,0,10) +#@gui :Opacity=float(0.4,0,1) +#@gui :Edge=float(12,0,50) +#@gui :Fast Approximation=bool(1) +#@gui :Color Smoothness=float(2,1,30) +#@gui :Mixer Style=choice(2,"Lightness","Value","Color Doping") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/07/12.") +#@gui Bokeh:fx_bokeh,fx_bokeh_preview(1) +#@gui :Number of Scales=int(3,1,10) +#@gui :Shape=choice(8,"Triangle","Square","Diamond","Pentagon","Hexagon","Octogon","Decagon","Star","Circular") +#@gui :Random Seed=int(0,0,65535) +#@gui :_=separator() +#@gui :_=note("Starting parameters:") +#@gui :Density=int(30,1,256) +#@gui :Radius (%)=float(8,0,50) +#@gui :Outline (%)=float(4,0,100) +#@gui :Inner Shade=float(0.3,0,1) +#@gui :Smoothness=float(0.2,0,8) +#@gui :Color=color(#d2d250a0) +#@gui :Color Dispersion=float(0.7,0,1) +#@gui :_=separator() +#@gui :_=note("Ending parameters:") +#@gui :Density=int(30,1,256) +#@gui :Radius (%)=float(20,0,50) +#@gui :Outline (%)=float(20,0,100) +#@gui :Inner Shade=float(1,0,1) +#@gui :Smoothness=float(2,0,8) +#@gui :Color=color(#aa82146e) +#@gui :Color Dispersion=float(0.15,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/02/07.") +#@gui Brushify:fx_brushify,fx_brushify_preview(0) +#@gui :_=note("Brush parameters:") +#@gui :Shape=choice(7,"Bottom Layer","Top Layer","Rectangle","Diamond","Pentagon","Hexagon","Octogon","Ellipse","Gaussian","Star","Heart") +#@gui :Ratio=float(0.25,0,1) +#@gui :Number of Sizes=int(4,1,16) +#@gui :Maximal Size=int(64,1,128) +#@gui :Minimal Size (%)=float(25,0,100) +#@gui :Number of Orientations=int(12,1,24) +#@gui :Fuzzyness=float(0,0,10) +#@gui :Smoothness=float(2,0,10) +#@gui :Light Type=choice(4,"None","Flat","Darken","Lighten","Full") +#@gui :Light Strength=float(0.2,0,1) +#@gui :Opacity=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Painting parameters:") +#@gui :Density (%)=float(30,0,100) +#@gui :Contour Coherence=float(1,0,1) +#@gui :Orientation Coherence=float(1,0,1) +#@gui :Gradient Smoothness=float(1,0,10) +#@gui :Structure Smoothness=float(5,0,10) +#@gui :Primary Angle=float(0,-180,180) +#@gui :Angle Dispersion=float(0.2,0,1) +#@gui :_=separator() +#@gui :Preview Brush=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/22/04.") +#@gui Cartoon:cartoon,fx_cartoon_preview(0) +#@gui :Smoothness=float(3,0,10) +#@gui :Sharpening=float(200,0,400) +#@gui :Edge Threshold=float(20,1,30) +#@gui :Edge Thickness=float(0.25,0,1) +#@gui :Color Strength=float(1.5,0,3) +#@gui :Color Quantization=int(8,2,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Circle Abstraction:fx_circle_abstraction,fx_circle_abstraction_preview(1) +#@gui :Number of Colors=int(8,2,16) +#@gui :Density=int(5,1,100) +#@gui :Opacity=float(0.8,0,1) +#@gui :Smoothness=float(0,0,4) +#@gui :Filled Circles=bool(1) +#@gui :Fill Transparent Holes=bool(1) +#@gui :Normalize Colors=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/16/06.") +#@gui Color Abstraction Paint:fx_ColorAbstractionPaint,fx_ColorAbstractionPaint_Preview(0) +#@gui :Abstraction=int(5,1,10) +#@gui :Ellipse Ratio=float(10,1,100) +#@gui :_=separator() +#@gui :_=note("Opacities, try 0 to see individual effect layers") +#@gui :Ellipsionism Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :Use as Hue=bool(0) +#@gui :Painting Opacity=float(1,-1,1) +#@gui :_=separator() +#@gui :Use as Saturation=bool(0) +#@gui :Color Abstraction Opacity=float(1,-1,1) +#@gui :Negative Color Abstraction=bool(0) +#@gui :Cubism on Color Abstraction=bool(0) +#@gui :Kuwahara on Painting=bool(0) +#@gui :Soften=float(0,0,100) +#@gui :Soften All Channels=bool(0) +#@gui :DoNotMergeLayers=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=link("Sample art here","http://www.flickr.com/photos/naggobot/6640743133/") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2014/02/23.") +#@gui Colored Pencils:fx_cpencil,fx_cpencil_preview(0) +#@gui :Size=float(1.3,0,5) +#@gui :Amplitude=float(50,0,200) +#@gui :Quantize Colors=int(20,2,255) +#@gui :Color Smoothness=float(2,0,30) +#@gui :Mixer Mode=choice(2,"Color Doping","Darken","Hard Light","Grain Merge","Lightness","Multiply","Soft Light","Value") +#@gui :Color Intensity=float(1,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2010/29/12.") +#@gui Comicbook:cl_comic,cl_comic_preview(0) +#@gui :_=note("Note: Photo to cartoon") +#@gui :_=separator() +#@gui :_=note(" ") +#@gui :Simplification=choice(0,"None","Light","Light Antialias","Strong Antialias","Median","Iuwt","Thin Brush","Mean Curvature") +#@gui :_=separator() +#@gui :_=note("For edges:") +#@gui :Flattening for Edge (bilateral)=int(2,0,5) +#@gui :Edge Method=choice(0,"Diff. of Gauss.","Diff. of BoxBlur","Diff. of Median") +#@gui :Edge Desaturation Method=choice(1,"Lightness","MaxRGB","MinRGB") +#@gui :Line Thickness=float(1,0.5,2) +#@gui :Line Strength=float(15,0,19) +#@gui :Line Antialias=int(15,0,100) +#@gui :_=separator() +#@gui :Add Colors=bool(1) +#@gui :_=note("For colors:") +#@gui :Luminosity Increase=int(10,0,50) +#@gui :Saturation Increase=int(20,0,50) +#@gui :Final Flattening (bilateral)=int(6,0,10) +#@gui :Color Effect=choice(2,"None","Deep Black","Local Contrast Enhancement","Colorful") +#@gui :Flat Color Effect=choice(0,"None","Rainbow","Hard Rainbow","Posterize Softly","Super Flat") +#@gui :Colors to Black or White=choice(0,"No","Soft Threshold","Threshold with Soft Antialias","Lines and Black") +#@gui :_=separator() +#@gui :Relief Effect=choice(0,"None","Groove","Bump") +#@gui :Special Effect=choice(0,"None","Dream","Past","Sketch of Future") +#@gui :_=separator() +#@gui :Final Antialias=choice(0,"None","Simple","Double") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=link("Filter discussed here","http://gimpchat.com/viewtopic.php?f=11&t=19335&p=266517#p266512") +#@gui :_=note("Author: Claude Lion. Latest Update: 2022/05/10.") +#@gui :_=note("It uses filters of David Tschumperlé and a few filters of Jérôme Boulanger.") +#@gui Cubism:fx_cubism,fx_cubism_preview(1) +#@gui :Iterations=int(2,0,10) +#@gui :Density=float(50,0,200) +#@gui :Thickness=float(10,0,50) +#@gui :Angle=float(90,0,360) +#@gui :Opacity=float(0.7,0.01,1) +#@gui :Smoothness=float(0,0,5) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/05/06.") +#@gui Cutout:fx_cutout,fx_cutout_preview(1) +#@gui :Number of Levels=int(4,2,32) +#@gui :Edge Simplicity=float(0.5,0,3) +#@gui :Edge Fidelity=int(4,0,10) +#@gui :Normalize=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé and Garagecoder       Latest Update: 2014/03/06.") +#@gui Diffusion Tensors:fx_diffusiontensors,fx_diffusiontensors_preview(0) +#@gui :Resolution (%)=float(10,0,20) +#@gui :Size=float(5,0,16) +#@gui :Color Mode=choice(3,"Monochrome","Grayscale","Orientation","Color") +#@gui :Outline=int(1,0,16) +#@gui :_=separator() +#@gui :Sharpness=float(0.15,0,1) +#@gui :Anisotropy=float(1,0,1) +#@gui :Gradient Smoothness=float(0,0,10) +#@gui :Tensor Smoothness=float(3,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/19/10.") +#@gui Doodle:fx_doodle,gui_no_preview(0) +#@gui :Precision (%)=float(30,0,100) +#@gui :Smoothness=float(2,0,10) +#@gui :Coherence=float(2,0,10) +#@gui :Contour Threshold=float(1.5,0,10) +#@gui :Spacing=int(2,0,20) +#@gui :Minimal Stroke Length=float(70,0,255) +#@gui :Preview Progression While Running=_bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/07/08.") +#@gui Dream Smoothing:fx_dreamsmooth,fx_dreamsmooth_preview(0) +#@gui :_=note("Updated for 1.5.4.0") +#@gui :_=note("A relatively slow filter that uses anisotropic filtering to smooth an image. More iterations produces softer image as does lower opacity values. Practical modes for merging are Alpha and Average. Note that results are resolution dependent.") +#@gui :_=separator() +#@gui :_=note("General settings") +#@gui :Iterations=int(3,1,10) +#@gui :Equalize at Each Step=bool(1) +#@gui :_=separator() +#@gui :_=note("Merging of iterations") +#@gui :Merging Option=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor","Edges") +#@gui :Opacity=float(0.8,0,1) +#@gui :Reverse Order=bool(0) +#@gui :_=note("Settings for layer mode edges") +#@gui :Smoothness=float(0.8,0,5) +#@gui :_=separator() +#@gui :_=note("Parallel processing settings. Increase spatial overlap if vertical bands appear.") +#@gui :Parallel Processing=choice(1,"Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note(" Author: Arto Huotari Latest update : 2014/02/20.") +#@gui :_=link("Sample processing here","http://www.flickr.com/photos/naggobot/7644006608/") +#@gui Ellipsionism:fx_ellipsionism,fx_ellipsionism_preview(0) +#@gui :Primary Radius=float(20,1,100) +#@gui :Secondary Radius=float(10,1,100) +#@gui :Smoothness=float(0.5,0,10) +#@gui :Opacity=float(0.7,0,1) +#@gui :Outline=float(3,1,3) +#@gui :Density=float(0.5,0.1,2) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Felt Pen:fx_feltpen,fx_feltpen_preview(0) +#@gui :Amplitude=float(300,0,4000) +#@gui :Density=float(50,0,100) +#@gui :Smoothness=float(1,0,10) +#@gui :Opacity=float(0.1,0,1) +#@gui :Edge=float(20,0,100) +#@gui :Thickness=int(5,2,32) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/25/10.") +#@gui Finger Paint:gtutor_fpaint,gtutor_fpaint_preview(0) +#@gui :_=note("Paint Detail") +#@gui :Finger Size=float(0.5,0,1) +#@gui :Keep Detail=float(0.5,0,1) +#@gui :Bristle Size=float(0.0,0,1) +#@gui :Edge Detect Includes Chroma=bool(0) +#@gui :_=separator() +#@gui :_=note("Render Detail") +#@gui :Light Direction=float(45.0,0,360.0) +#@gui :Shadow=float(0.5,0,1) +#@gui :Highlight=float(0.5,0,1) +#@gui :Specular=float(0.5,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Garry R. Osgood. Latest update: 2015/02/26.") +#@gui :_=link("Finger paint instructions and tutorial.","https://gmic.eu/oldtutorial/the-fingerpainting-filter.shtml") +#@gui :_=link("Fingerpaint theory.","https://gmic.eu/tutorial/fingerpainting.html") +#@gui Fractalize:fractalize,fractalize(1) +#@gui :Detail Level=float(0.8,0,1) +#@gui :_=separator() +#@gui :_=note("Note: This filter uses lot of random values to generate its result, so running it twice will give you different results !") +#@gui :_=separator() +#@gui :_=link("Click here for a detailed description of this filter.","http://www.gimpchat.com/viewtopic.php?f=28&t=10036") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/25/04.") +#@gui Ghost:fx_ghost,fx_ghost_preview(0) +#@gui :_=note("Ghost Effect:") +#@gui :Amplitude=float(200,0,1000) +#@gui :Smoothness=float(2,0,10) +#@gui :Coherence=float(2,0,10) +#@gui :Gamma=float(1,-3,3) +#@gui :_=separator() +#@gui :_=note("Normalization:") +#@gui :Amplitude=float(3,0,10) +#@gui :Radius=float(16,1,64) +#@gui :Invert=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/01/30.") +#@gui Graphic Boost:fx_graphic_boost4,fx_graphic_boost4(0) +#@gui :_=separator() +#@gui :_=note("Unsharp Mask controls") +#@gui :Radius=float(1.25,0,20) +#@gui :Darken=float(2,0,10) +#@gui :_=separator() +#@gui :Skip Others Steps=bool(false) +#@gui :_=note("Check for visual control, UNcheck to reactivate the other controls") +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("BW_Pencil Controls") +#@gui :Pencil Size=float(0.15,0,4) +#@gui :Pencil Amplitude=float(14,0,200) +#@gui :_=separator() +#@gui :Skip Others Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :Activate 'Pencil Smoother'=bool(true) +#@gui :_=note("If unchecked the 3 sliders below are disabled") +#@gui :Pencil Smoother Sharpness=float(0.5,0,2) +#@gui :Pencil Smoother Edge Protection=float(0.45,0,1) +#@gui :Pencil Smoother Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Skip Others Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Merging Options") +#@gui :Swap Layers=bool(True) +#@gui :_=note("'Swap' change the effect of Merging and Intesity") +#@gui :Merging Option=choice("Hard Light","Grain Merge","Multiply","Color Burn","Overlay","Value","Darken","Lightness","Luminance","*Colors Doping*","Comix Colors","Graphic Colours","Graphix Colors","Vivid Edges*","Dark Edges","Dark Screen","Vivid Screen","Interpolate") +#@gui :Opacity=float(1,0,1) +#@gui :Intensity=float(1,0,1) +#@gui :_=separator() +#@gui :Add Painter's Touch=bool(true) +#@gui :_=note("If unchecked the 3 sliders below are disabled") +#@gui :_=separator() +#@gui :Painter's Touch Sharpness=float(0.5,0,2) +#@gui :Painter's Edge Protection Flow=float(0.45,0,1) +#@gui :Painter's Smoothness=float(1,0,10) +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11 .") +#@gui :_=link("Filter explained here","http://www.gimpchat.com/viewtopic.php?f=9&t=775") +#@gui Graphic Novel:fx_graphic_novelfxl,fx_graphic_novelfxl(0) +#@gui :_=separator() +#@gui :_=note("Apply Local Normalization") +#@gui :Skip This Step=bool(false) +#@gui :_=separator() +#@gui :_=note("Local Normalization Controls") +#@gui :LN Amplititude=float(2,0,60) +#@gui :LN Size=float(6,0,64) +#@gui :LN Neightborhood-Smoothness=float(5,0,40) +#@gui :LN Average-Smoothness=float(20,0,40) +#@gui :_=separator() +#@gui :Skip All Other Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Pencil Options") +#@gui :Pencil Size=float(0.62,0,4) +#@gui :Pencil Amplitude=float(14,0,200) +#@gui :_=separator() +#@gui :Skip All Other Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :Activate 'Pencil Smoother'=bool(true) +#@gui :_=note("If unchecked the 3 sliders below are disabled") +#@gui :_=separator() +#@gui :Pencil Smoother Sharpness=float(0.5,0,2) +#@gui :Pencil Smoother Edge Protection=float(0.78,0,1) +#@gui :Pencil Smoother Smoothness=float(1.92,0,10) +#@gui :_=separator() +#@gui :Skip All Other Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Boost Merging Options") +#@gui :Swap Layers=bool(false) +#@gui :MIxer=choice("Overlay","Multiply","Soft Light","Color Burn","Darken","Stamp","Hard Light","Value","Grain Merge","Freeze","Lightness","Luminance","*Colors Doping","*Comix Colors*","Graphic Colours","*Graphix Colors","*Vivid Edges*","*Dark Edges*","*Dark Screen*","*Vivid Screen*","Interpolate") +#@gui :Opacity=float(1,0,1) +#@gui :Intensity=float(1,0,1) +#@gui :_=separator() +#@gui :Add Painter's Touch=bool(true) +#@gui :_=separator() +#@gui :Painter's Touch Sharpness=float(0.5,0,2) +#@gui :Painter's Edge Protection Flow=float(0.8,0,1) +#@gui :Painter's Smoothness=float(1.28,0,10) +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui :_=link("Filter explained here","http://www.gimpchat.com/viewtopic.php?f=9&t=1582") +#@gui Hard Sketch:fx_hardsketchbw,fx_hardsketchbw_preview(0) +#@gui :Amplitude=float(300,0,4000) +#@gui :Density=float(50,0,100) +#@gui :Smoothness=float(1,0,10) +#@gui :Opacity=float(0.1,0,1) +#@gui :Edge=float(20,0,100) +#@gui :Fast Approximation=bool(0) +#@gui :Color Model=choice(4,"Black on White","White on Black","Black on Transparent White","White on Transparent Black","Color on White") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Highlight Bloom:fx_highlight_bloom,fx_highlight_bloom_preview(0) +#@gui :Details Strength (%)=float(90,0,400) +#@gui :Details Scale=float(60,0,255) +#@gui :Smoothness=float(60,0,255) +#@gui :Highlight (%)=int(30,0,100) +#@gui :Contrast (%)=float(20,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/24/10.") +#@gui :_=separator() +#@gui :_=note("This effect has been inspired by:") +#@gui :_=link("This tutorial by Sebastien Guyader and Patrick David","https://pixls.us/articles/highlight-bloom-and-photoillustration-look/") +#@gui Hope Poster:fx_poster_hope,fx_poster_hope_preview(0)+ +#@gui :Gamma=float(0,-3,3) +#@gui :Smoothness=float(3,0,20) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/07/11.") +#@gui Hough Sketch:fx_houghsketchbw,fx_houghsketchbw_preview(0) +#@gui :Smoothness=float(1.25,0,10) +#@gui :Density (%)=float(10,0,100) +#@gui :Radius=int(5,0,30) +#@gui :Threshold=float(80,0,100) +#@gui :Opacity=float(0.1,0,1) +#@gui :Color Model=choice(4,"Black on White","White on Black","Black on Transparent White","White on Transparent Black","Color on White") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2023/05/29.") +#@gui Illustration Look:fx_illustration_look,fx_illustration_look_preview(0) +#@gui :Tone Mapping (%)=float(100,0,100) +#@gui :Desaturate (%)=float(0,0,100) +#@gui :Vintage Tone (%)=float(0,0,100) +#@gui :Output as Multiple Layers=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Authors: Sébastien Guyader and David Tschumperlé. Latest update: 2017/05/01.") +#@gui Kuwahara:fx_kuwahara,fx_kuwahara_preview(0) +#@gui :Iterations=int(2,1,20) +#@gui :Radius=int(5,1,30) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/31/05.") +#@gui Lineart:cl_lineart,cl_lineart_preview(0) +#@gui :_=note("Photo to Line Art") +#@gui :_=separator() +#@gui :_=note(" ") +#@gui :Local Contrast Enhancement=int(0,0,4) +#@gui :Simplification=bool(0) +#@gui :_=separator() +#@gui :_=note("For edges:") +#@gui :Flattening for Edge (bilateral)=int(2,0,5) +#@gui :Line Thickness=float(1,0.5,2) +#@gui :Line Strength=float(15,0,19) +#@gui :Lines Antialias=int(15,0,100) +#@gui :_=separator() +#@gui :Add Black or Gray=bool(1) +#@gui :_=note("For black and grays:") +#@gui :Luminosity Increase=int(0,0,40) +#@gui :Final Flattening (bilateral)=int(6,0,10) +#@gui :Type=choice(2,"Soft Threshold","Gray Patches","Lines and Black","Black and Lines") +#@gui :_=separator() +#@gui :Final Antialias=choice(2,"None","Light Simple","Simple","Very Strong") +#@gui :Pen Drawing=choice(0,"None","Simple","Undoing Patterns") +#@gui :_=separator() +#@gui :Effect=choice(0,"None","Charcoal","Groove") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=link("Filter discussed here","http://gimpchat.com/viewtopic.php?f=15&t=5328&start=20#p272779") +#@gui :_=note("Author: Claude Lion. Latest Update: 2022/05/10.") +#@gui :_=note("It uses filters of David Tschumperlé and a few filters of Jérôme Boulanger.") +#@gui :_=note("Type='Lines and Black' is a shortcut of 'Black and Lines' with 'Local Contrast Enhancement = 1' and 'Luminosity Increase = 40'. In this case, 'Local Contrast Enhancement' and 'Luminosity Increase' cursors have no effect.") +#@gui Linify:fx_linify,fx_linify_preview(0) +#@gui :Density=float(40,0,100) +#@gui :Spreading=float(2,0,10) +#@gui :Resolution (%)=float(40,0,100) +#@gui :Line Opacity=float(10,0,30) +#@gui :Line Precision=int(24,1,128) +#@gui :Color Mode=choice(0,"Subtractive","Additive") +#@gui :_=separator() +#@gui :Preview Progression While Running=_bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note{"Note:\n\n - This filter is our own implementation of the nice algorithm proposed on the webpage http://linify.me.\n - This is a quite resource-demanding filter, so please be patient when running it.\n - It actually renders better when applied on small images (<1024). "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/11/21.") +#@gui Lylejk's Painting:fx_lylejk_painting,fx_lylejk_painting_preview(0) +#@gui :Iterations=int(10,1,20) +#@gui :Abstraction=int(2,1,20) +#@gui :Radius=int(4,1,30) +#@gui :Canvas=float(10,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: Lyle Kroll and David Tschumperlé.       Latest Update: 2015/23/02.") +#@gui :_=link("Filter Explained here","http://www.gimpchat.com/viewtopic.php?f=10&t=2624") +#@gui Make Squiggly:fx_Squiggly,fx_Squiggly_Preview(0) +#@gui :_=note("Squigles an image") +#@gui :_=note("Squigle parameters") +#@gui :Spread Noise Amount=float(2,0,20) +#@gui :Segmentation Edge Threshold=float(12,0,15) +#@gui :Segmentation Smoothness=float(0.8,0,5) +#@gui :GradienNormSmoothness=float(0,0,10) +#@gui :GradienNormLinearity=float(0.5,0,1.5) +#@gui :Invert Luminance=bool(1) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Optional color enhancement") +#@gui :_=note("Note that the effect of sliders depends on the merge setting.") +#@gui :Activate Color Enhancement=bool(0) +#@gui :Toggle to View Base Image=bool(0) +#@gui :_=note("Check this to view base image") +#@gui :IncreaseChroma1=float(3,1,4) +#@gui :Tone Threshold=float(0.2,0,1) +#@gui :Tone Gamma=float(0.4,0,1) +#@gui :_=note("Select merging mode to original") +#@gui :Merging Option=choice("Alpha","And","Average","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grain Extract","Grain Merge","Hard Light","Hue","Interpolation","Lighten","Lightness","Luminance","Multiply","Negation","Or","Overlay","Reflect","Saturation","Soft Light","Screen","Stamp","Value","Xor") +#@gui :Opacity=float(1,0,1) +#@gui :Reverse Order=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2013/09/28.") +#@gui :_=link("Filter Explained here","http://www.flickr.com/photos/naggobot/6667673847/") +#@gui Morphology Painting:fx_MorphoPaint,fx_MorphoPaint_preview(0) +#@gui :_=separator() +#@gui :_=note("Creates a painting using Morphology-, Segmentation- and Painting- filters. CPU intensive filter that may take long.") +#@gui :_=separator() +#@gui :_=note("Morphology settings") +#@gui :_=separator() +#@gui :Method=choice(1,"Erosion","Dilation","Opening","Closing") +#@gui :MorphoStrenght=int(18,2,60) +#@gui :Shape=choice(2,"Square","Octagonal","Circular") +#@gui :_=separator() +#@gui :_=note("Lightness for Morpholayer") +#@gui :Black Point=int(25,0,50) +#@gui :Expand Shadows=int(100,50,255) +#@gui :Compress Highlights=int(230,200,255) +#@gui :_=separator() +#@gui :_=note("Smoothing strength") +#@gui :Spread Amount=int(8,0,20) +#@gui :Blur Strength=int(3,0,10) +#@gui :_=separator() +#@gui :_=note("Segmentation settings") +#@gui :Edge Threshold=float(4,0,15) +#@gui :Smoothness=float(0.5,0,5) +#@gui :_=separator() +#@gui :_=note("Painting Settings") +#@gui :Abstraction=int(2,1,10) +#@gui :Details Scale=float(0.5,0,5) +#@gui :Smoothness=float(200,0,1000) +#@gui :_=separator() +#@gui :Merge Layers?=bool(1) +#@gui :_=note("When unchecked the filter will output layers separately for manual composing. Set G'Mic output to new layers.") +#@gui :_=separator() +#@gui :Enable Paintstroke=bool(1) +#@gui :Stroke Strength=float(1,0,1) +#@gui :Enable Segmentation=bool(1) +#@gui :Segments Strength=float(1,0,1) +#@gui :Enable Morphology=bool(1) +#@gui :Morphology Strength=float(1,0,1) +#@gui :Normalize=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2013/09/28.") +#@gui :_=link("Filter Explained here","http://www.flickr.com/photos/naggobot/6108637935/") +#@gui Paint With Brush:fx_paint_with_brush,fx_paint_with_brush_preview(0) +#@gui :Predefined Style=choice("Default","Felt Spots","Colored Edges","Circles","Dreamy","Fuzzy","Whirls","Smooth") +#@gui :_=value(-1) +#@gui :_=separator() +#@gui :_=note("Global Settings:") +#@gui :Painting Order=choice(1,"Random","Coarse to Fine","Fine to Coarse") +#@gui :Number of Iterations=int(16,1,128) +#@gui :Precision (%)=float(30,0,100) +#@gui :Details (%)=float(100,0,100) +#@gui :Background (%)=float(100,0,100) +#@gui :Sharpness (%)=float(10,0,100) +#@gui :Anisotropy (%)=float(80,0,100) +#@gui :Smoothness=float(0.5,0,8) +#@gui :Coherence=float(3,0,16) +#@gui :Twist Angle (°)=int(45,-1,360) +#@gui :_=note{"(-1 means 'Random Angle')."} +#@gui :Twist Strength (%)=int(0,-1,100) +#@gui :_=note{"(-1 means 'Angle Shift')."} +#@gui :Init Canvas=choice(6,"Black","Gray","White","Self","Blur","Kuwahara","Vector Painting") +#@gui :_=separator() +#@gui :_=note("Brush for Details:") +#@gui :Brush Diameter (px)=float(2,0,100) +#@gui :Stroke Length (px)=float(10,0,100) +#@gui :Hue Randomness (%)=float(0,0,100) +#@gui :Saturation Randomness (%)=float(0,0,100) +#@gui :Value Randomness (%)=float(0,0,100) +#@gui :Opacity (%)=float(60,0,100) +#@gui :_=separator() +#@gui :_=note("Brush for Background:") +#@gui :Brush Diameter (px)=float(20,0,100) +#@gui :Stroke Length (px)=float(1,0,100) +#@gui :Hue Randomness (%)=float(0,0,100) +#@gui :Saturation Randomness (%)=float(0,0,100) +#@gui :Value Randomness (%)=float(0,0,100) +#@gui :Opacity (%)=float(30,0,100) +#@gui :_=separator() +#@gui :_=note("Brush Dynamics:") +#@gui :Brush Diameter=float(15,0,255) +#@gui :Stroke Length=float(15,0,255) +#@gui :Hue Randomness=float(15,0,255) +#@gui :Saturation Randomness=float(15,0,255) +#@gui :Value Randomness=float(15,0,255) +#@gui :Opacity=float(15,0,255) +#@gui :Spatial Step=float(1,0,3) +#@gui :Angular Step (°)=float(45,0,90) +#@gui :_=separator() +#@gui :Preview Progression While Running=_bool(0) +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.\nLatest Update: 2021/08/30.") +#@gui Painting:fx_painting,fx_painting_preview(0)+ +#@gui :Abstraction=int(5,1,10) +#@gui :Details Scale=float(2.5,0,5) +#@gui :Color=float(1.5,0,4) +#@gui :Smoothness=float(50,0,1000) +#@gui :Sharpen Shades=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: Lyle Kroll, Angelo Lama and David Tschumperlé. \nLatest Update: 2011/28/02.") +#@gui Pastell Art:fx_pastell,fx_pastell_preview(1) +#@gui :MasterOpacity=float(0.6,0.3,1) +#@gui :BG Textured=bool(1) +#@gui :Reverse Effect=bool(0) +#@gui :_=separator() +#@gui :_=note("Rodilius settings") +#@gui :Amplitude=float(20,0,30) +#@gui :Thickness=float(30,0,100) +#@gui :Sharpness=float(300,0,1000) +#@gui :Orientations=int(1,1,36) +#@gui :Offset=float(30,0,180) +#@gui :Color Mode=choice(1,"Darker","Lighter") +#@gui :_=separator() +#@gui :_=note("Gradient settings") +#@gui :Smoothness=float(1,0,10) +#@gui :Linearity=float(0.5,0,1.5) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :Activate Shakes=bool(0) +#@gui :Amount=float(10,0,30) +#@gui :Strength=float(3,1,300) +#@gui :_=separator() +#@gui :Activate Lizards=bool(0) +#@gui :Toes=float(9,0,300) +#@gui :Shivers=float(3,0,4) +#@gui :_=separator() +#@gui :Activate Pink Elephants=bool(0) +#@gui :Trunks=float(12,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2013/09/28.") +#@gui :_=link("Filter Explained here","http://www.flickr.com/photos/naggobot/6294075073/") +#@gui Pen Drawing:fx_pen_drawing,fx_pen_drawing_preview(0)+ +#@gui :Amplitude=float(10,0,30) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Photoillustration:fx_tk_photoillustration,fx_tk_photoillustration_preview(0) +#@gui :_=note("adding an illustrative effect to any photograph") +#@gui :_=separator() +#@gui :Local Contrast Style=choice("Tone Mapping","Tone Mapping Soft","Tone Mapping Fast","Local Normalisation","Unsharp Mask","Global Mapping","Dynamic Range Increase","None") +#@gui :Local Contrast Effect=float(0.25,0.00,2.5) +#@gui :Smoothing Style=choice("Anisotropic","Bilateral","Color Channel Smoothing","Segmentation","Morphological Closing","Selective Gaussian","Wavelet","Kuwahara","None") +#@gui :Contour Precision=float(0.30,0.00,1.00) +#@gui :Area Smoothness=float(0.50,0.00,10.00) +#@gui :Sharpening Radius=float(0.50,0.00,10.00) +#@gui :Sharpening Strength=float(1.00,0.00,5.00) +#@gui :Special Effects=choice("None","Soft Glow","Dusty","Orton Glow","Extra Smooth","Bloom","Paintstroke") +#@gui :Effect Strength=float(5.00,0.00,20.00) +#@gui :Overall Lightness=float(0,-50,50) +#@gui :Overall Contrast=float(1,0.5,1.5) +#@gui :Shadows Lightness=float(0,-100,100) +#@gui :Highlights Lightness=float(0,-100,100) +#@gui :Mid Tone Contrast=float(1,0.5,4) +#@gui :Color Green-Magenta=float(0,-20,20) +#@gui :Color Blue-Yellow=float(0,-20,20) +#@gui :Color Boost=float(1.2,0,4) +#@gui :Detail Reconstruction Detection=float(98.5,50,100) +#@gui :Detail Reconstruction Smoothness=float(5,0,10) +#@gui :Detail Reconstruction Strength=float(0.5,0,1) +#@gui :Detail Reconstruction Style=choice("Micro/macro Details Adjusted","Fine","Strong","High Pass","Artistic Round","Artistic Hard","Artistic Modern","Comic Style","Gritty","None") +#@gui :Keep Detail Layer Separate=bool(0) +#@gui :Remove Artifacts From Micro/Macro Detail=bool(0) +#@gui :Skin Tone Protection=bool(0) +#@gui :Sharpen Edges Only=bool(0) +#@gui :Computation Mode=choice(1,"High Quality","Normal","High Speed") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil Latest update: 2012/08/28.") +#@gui Polygonize [Delaunay]:fx_polygonize_delaunay,fx_polygonize_delaunay_preview(0) +#@gui :Density (%)=float(40,0,100) +#@gui :Edges=float(5,0,100) +#@gui :Boundaries (%)=float(75,0,100) +#@gui :Smoothness=float(0.5,0,8) +#@gui :Filling=choice(3,"Black","White","Random","Average","Linear") +#@gui :Outline (%)=float(50,0,100) +#@gui :Outline Color=color(#000000ff) +#@gui :Anti-Aliasing=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/06/05.") +#@gui Polygonize [Energy]:fx_polygonize,fx_polygonize_preview(0) +#@gui :Amplitude=int(300,0,2000) +#@gui :Smoothness=float(10,0,100) +#@gui :Minimal Area=float(10,0,100) +#@gui :X-Resolution=float(10,1,256) +#@gui :Y-Resolution=float(10,1,256) +#@gui :Outline Color=color(#000000ff) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=link("Click here for a detailed description of this filter.","http://www.gimpchat.com/viewtopic.php?f=28&t=9174") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/02/12.") +#@gui Poster Edges:fx_poster_edges,fx_poster_edges_preview(0) +#@gui :Image Smoothness=float(20,0,100) +#@gui :Edge Threshold=float(60,0,100) +#@gui :Edge Shade=float(5,0,30) +#@gui :Edge Thickness=float(0,0,5) +#@gui :Edge Antialiasing=float(10,0,100) +#@gui :Posterization Level=int(0,0,15) +#@gui :Posterization Antialiasing=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=link("Click here for a detailed description of this filter.","http://www.davidrevoy.com/article147/gmic-new-filter-poster-edges") +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé and David Revoy.       Latest Update: 2012/30/11.") +#@gui Posterize:fx_posterize,fx_posterize_preview(0) +#@gui :Smoothness=float(150,0,800) +#@gui :Edges (%)=float(30,0,100) +#@gui :Paint=float(1,0,10) +#@gui :Colors=int(12,2,32) +#@gui :Minimal Area=int(0,0,64) +#@gui :Outline (%)=float(0,0,100) +#@gui :Normalize Colors=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/25/10.") +#@gui Posterized Dithering:fx_pdithered,fx_pdithered_preview(0) +#@gui :Gamma=float(1,0.01,5) +#@gui :Contrast=float(1,0,4) +#@gui :Brightness=float(0,-255,255) +#@gui :Smoothness=float(0,0,10) +#@gui :Quantize Colors=int(20,2,255) +#@gui :Smooth Colors=float(1,0,30) +#@gui :Mixer Mode=choice("Color Doping","Darken","Soft Light","Grain Merge","Multiply","Value") +#@gui :Color Intensity=float(1,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2010/29/12.") +#@gui Quadtree Variations:fx_quadtree,fx_quadtree_preview(1) +#@gui :Mode=choice("Squares","Sierpinksi Design","Ellipse Painting") +#@gui :Precision=int(1024,2,4096) +#@gui :Homogeneity=float(0.5,0,2) +#@gui :Outline=int(0,0,4) +#@gui :_=separator() +#@gui :_=note("For 'Ellipse painting' only:") +#@gui :Primary Radius=float(3,0,5) +#@gui :Secondary Radius=float(1.5,0,5) +#@gui :Anisotropy=float(1,0,4) +#@gui :Only Leafs=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/15/06.") +#@gui Rodilius:fx_rodilius,fx_rodilius_preview(1) +#@gui :Amplitude=float(10,0,30) +#@gui :Thickness=float(10,0,100) +#@gui :Sharpness=float(300,0,1000) +#@gui :Orientations=int(5,2,36) +#@gui :Offset=float(30,0,180) +#@gui :Smoothness=int(0,0,5) +#@gui :Color Mode=choice(1,"Darker","Lighter") +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=link("Click here for a video tutorial","http://www.youtube.com/watch?v=RC07VUpzwGc") +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé and Rod/GimpChat.       Latest Update: 2013/05/03.") +#@gui Shapeism:fx_shapeism,fx_shapeism_preview(0)+ +#@gui :Shape=choice(2,"Squares","Triangles","Circles","Diamond","Hexagon","Octagon","Stars","Custom") +#@gui :Branches=int(7,3,16) +#@gui :Thickness=float(0.38,0,1) +#@gui :Angle=float(0,0,360) +#@gui :_=note("Note: Parameters Branches, Thickness and Angle are used only for Custom shapes.") +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :Scales=int(5,1,16) +#@gui :Maximal Size=int(32,1,256) +#@gui :Minimal Size=int(8,1,256) +#@gui :Allow Angle=choice(3,"0 Deg.","180 Deg.","90 Deg.","Any") +#@gui :Spacing=int(1,-5,5) +#@gui :Precision=int(5,1,10) +#@gui :Edges=float(0.5,0,2) +#@gui :Smoothness=float(1,0,10) +#@gui :Background=color(#000000ff) +#@gui :_=separator() +#@gui :_=link("Click here for a detailed description of this filter.","http://gimpchat.com/viewtopic.php?f=28&t=7500&sid=5b483979826903b8f8fc8fdaf1767dae") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/11/06.") +#@gui Sharp Abstract:fx_sharp_abstract,fx_sharp_abstract_preview(0) +#@gui :Spatial Scale=float(4,0,32) +#@gui :Value Scale=float(10,0,16) +#@gui :Precision=float(0.5,0,2) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/09.") +#@gui Simple Noise Canvas:fx_SimpleNoiseCanvas,fx_SimpleNoiseCanvasPreview(0) +#@gui :_=note("Simpe noise based xy canvas effect. Preserve canvas and bumpmap image with canvas after filtering for best results. Merge option DoNothing outputs only original image if Preserve canvas option is not selected.") +#@gui :_=separator() +#@gui :Scale Factor=float(0,0,1) +#@gui :_=separator() +#@gui :_=note("Noise Parameters") +#@gui :Amplitude=float(3,0,20) +#@gui :Noise Type=choice(2,"Gaussian","Uniform","Salt and Pepper","Poisson") +#@gui :_=separator() +#@gui :_=note("Thread Length") +#@gui :Horisontal Length=float(5,2,15) +#@gui :Vertical Length=float(5,2,15) +#@gui :Overall Blur=float(0,0,15) +#@gui :Canvas Brightness=float(255,230,255) +#@gui :Canvas Darkness=float(0,0,255) +#@gui :_=separator() +#@gui :_=note("How to combine XY threads") +#@gui :Merging Option=choice(2,"Average","Multiply","Darken","Edges") +#@gui :Invert Canvas Colors=bool(0) +#@gui :Invert Image Colors=bool(0) +#@gui :_=note("How to combine image + canvas") +#@gui :Reverse Order=bool(0) +#@gui :Merging Option=choice(1,"Avg","Multiply","Scr","Darken","Lighten","Dif","Negation","Exclusion","Overlay","Hardlight","Softlight","Dodge","Colorburn","Reflect","Freeze","Stamp","Interpolate","Grainext","Grainmerge","Xor","Edges","DoNothing") +#@gui :Preserve Canvas for Post Bump Mapping=bool(0) +#@gui :Canvas Color=color(#ffffffff) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2013/09/28.") +#@gui :_=link("Filter Explained here","http://www.flickr.com/photos/naggobot/6152040642/") +#@gui Sketch:fx_sketchbw,fx_sketchbw_preview(0) +#@gui :Number of Orientations=int(3,1,16) +#@gui :Starting Angle=float(45,0,180) +#@gui :Angle Range=float(180,0,180) +#@gui :Stroke Length=float(30,0,1000) +#@gui :Contour Threshold=float(1.75,0,10) +#@gui :Opacity=float(0.02,0,0.3) +#@gui :Background Intensity=float(0.5,0,2) +#@gui :Density=float(0.75,0,5) +#@gui :Sharpness=float(0.1,0,1) +#@gui :Anisotropy=float(0.7,0,1) +#@gui :Smoothness=float(3,0,10) +#@gui :Coherence=float(6,0,10) +#@gui :Boost Stroke=bool(0) +#@gui :Curved Stroke=bool(1) +#@gui :Color Model=choice(4,"Black on White","White on Black","Black on Transparent White","White on Transparent Black","Color on White") +#@gui :Random Seed=int(0,0,65535) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/05/11.") +#@gui Smooth Abstract:fx_smooth_abstract,fx_smooth_abstract_preview(0) +#@gui :Smoothness (%)=float(75,0,100) +#@gui :Regularization=choice(0,"Isotropic","Delaunay-Guided","Edge-Oriented") +#@gui :Regularization Iterations=int(20,0,100) +#@gui :Geometry=float(1,0,5) +#@gui :Details=float(30,0,50) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/06/04.") +#@gui Stylize:fx_stylize,fx_stylize_preview +#@gui :Style=choice{0,"Custom Style (Top Layer)","Custom Style (Bottom Layer)","Braque: Landscape near Antwerp","Braque: Le Viaduc à L'Estaque","Braque: Little Bay at La Ciotat","Braque: The Mandola","Christine Garner: Black Colour Pencil","Christine Garner: Colour Pencil Sepia","Christine Garner: Dark Coloured Pencil","Christine Garner: Pencil","Christine Garner: Sketching Pastel","Christine Garner: Willow Charcoal","Delaunay: Windows Open Simultaneously","Delaunay: Portrait De Metzinger","Hokusai: The Great Wave","Kandinsky: Squares with Concentric Circles","Kandinsky: Yellow-Red-Blue","Klee: Death and Fire","Klee: In the Style of Kairouan","Klee: Oriental Pleasure Garden Anagoria","Klee: Polyphony 2","Klee: Red Waistcoat","Klimt: The Kiss","Mondrian: Composition in Red-Yellow-Blue","Mondrian: Evening; Red Tree","Mondrian: Gray Tree","Monet: San Giorgio Maggiore at Dusk","Monet: Water-Lily Pond","Monet: Wheatstacks - End of Summer","Munch: The Scream","Picabia: Udnie","Picasso: Les Demoiselles D'Avignon","Picasso: Seated Woman","Picasso: The Reservoir - Horta De Ebro","Pollock: Convergence","Pollock: Summertime Number 9A","Van Gogh: Almond Blossom","Van Gogh: Irises","Van Gogh: The Starry Night","Van Gogh: Wheat Field with Crows"} +#@gui :Scale Style to Fit Target Resolution=choice(5,"No Rescaling","10%","20%","30%","50%","75%","100%","150%","200%","250%","300%") +#@gui :Style Variations=choice("None","All XY-Flips","All 90° Rotations","All 45° Rotations") +#@gui :Preview Progression While Running=bool(1) +#@gui :_=separator() +#@gui :_=note("Style/Target Parameters:") +#@gui :Fidelity to Target (Finest)=float(0.5,0,5) +#@gui :Fidelity to Target (Coarsest)=float(2,0,5) +#@gui :Fidelity Smoothness (Finest)=float(3,0,5) +#@gui :Fidelity Smoothness (Coarsest)=float(0.5,0,5) +#@gui :Fidelity Chromaticity=float(0.1,0,1) +#@gui :_=separator() +#@gui :_=note("Image Matching Parameters:") +#@gui :Match Colors With=choice(3,"Nothing","Gamma Balance","Histogram Transfer","PCA Transfer") +#@gui :Colorspace=choice{3,"SRGB","Linear RGB","YCbCr","YCbCr (Luma/Chroma),"YCbCr (Luma Only)","YCbCr (Chroma Only)","Lab","Lab (Luma/Chroma)","Lab (Luma Only)","Lab (Chroma Only)"} +#@gui :Keep Color Channels=choice{"All","Luminance Only (YCbCr)","Luminance Only (Lab)","Chrominances Only (CbCr)","Chrominances Only (ab)"} +#@gui :Smoothness=float(0.7,0,5) +#@gui :Also Match Gradients=float(1,0,5) +#@gui :_=separator() +#@gui :_=note("Advanced Parameters:") +#@gui :Init. Type=choice("Best Match","Identity","Randomized") +#@gui :Init. Resolution=choice(1,"8px","16px","32px","64px","128px","256px") +#@gui :Init. With High Gradients Only=float(0,0,100) +#@gui :Patch Size for Analysis=int(5,2,16) +#@gui :Patch Size for Synthesis=int(5,2,16) +#@gui :Patch Size for Synthesis (Final)=int(7,2,16) +#@gui :Number of Matches (Finest)=int(1,0,10) +#@gui :Number of Matches (Coarsest)=int(30,0,200) +#@gui :Penalize Patch Repetitions=int(2,0,300) +#@gui :Matching Precision (Smaller Is Faster)=float(2,0,10) +#@gui :Scale Factor=float(1.85,1.1,4) +#@gui :Skip Finest Scales=int(0,0,3) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/03/23.") +#@gui Vector Painting:fx_vector_painting,fx_vector_painting_preview(1) +#@gui :Details=float(9,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.\nLatest Update: 2015/25/08.") +#@gui Warhol:warhol,warhol(1) +#@gui :X-Tiles=int(3,1,10) +#@gui :Y-Tiles=int(3,1,10) +#@gui :Smoothness=float(2,0,10) +#@gui :Color=float(40,0,60) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Whirl Drawing:fx_draw_whirl,fx_draw_whirl_preview(0) +#@gui :Amplitude=float(20,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui _Black & White +#@gui B&W Stencil:fx_stencilbw,fx_stencilbw_preview(0) +#@gui :Threshold=float(10,0,30) +#@gui :Smoothness=float(10,0,30) +#@gui :Hue=float(0,0,360) +#@gui :Saturation=float(0,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Black & White:fx_blackandwhite,fx_blackandwhite_preview(1)+ +#@gui :Red Level=float(0.299,0,1) +#@gui :Red Smoothness=float(0,0,10) +#@gui :Green Level=float(0.587,0,1) +#@gui :Green Smoothness=float(0,0,10) +#@gui :Blue Level=float(0.114,0,1) +#@gui :Blue Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :Grain (Shadows)=float(0,0,200) +#@gui :Grain (Midtones)=float(0,0,200) +#@gui :Grain (Highlights)=float(0,0,200) +#@gui :Grain Tone Fading=float(2,0,10) +#@gui :Grain Scale=float(0,0,3) +#@gui :Grain Type=choice("Gaussian","Uniform","Salt and Pepper","Poisson") +#@gui :_=separator() +#@gui :Local Contrast=float(0,0,60) +#@gui :Radius=int(16,1,512) +#@gui :Contrast Smoothness=float(4,0,10) +#@gui :_=separator() +#@gui :Pseudo-Gray Dithering=int(0,0,5) +#@gui :Use Maximum Tones=bool(false) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/20/02.") +#@gui Charcoal:fx_charcoal,fx_charcoal_preview(0) +#@gui :Granularity=int(65,0,800) +#@gui :Lowlights Crossover Point=int(70,0,255) +#@gui :Highlights Crossover Point=int(170,0,255) +#@gui :Boost Contrast=bool(0) +#@gui :Resize Image for Optimum Effect=bool(1) +#@gui :Add Chalk Highlights=bool(0) +#@gui :Minimal Highlights=int(50,0,255) +#@gui :Maximal Highlights=int(70,0,255) +#@gui :Background Color=color(#ffffff) +#@gui :Foreground Color=color(#000000) +#@gui :Invert Background / Foreground=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/17/03.") +#@gui :_=note("Inspired from the Charcoal script by micomicon :") +#@gui :_=link("http://registry.gimp.org/node/25078") +#@gui Colorize [Interactive]:fx_colorize_interactive,fx_colorize_interactive_preview +#@gui :Input Type=_choice("B&W Photograph","Lineart") +#@gui :Output Type=_choice{"Colorized Image (1 Layer)","Colors Only (1 Layer)","Image + Colors (2 Layers)","Image + Colors (Multi-Layers)"} +#@gui :View Resolution=_choice{1,"Small (Faster)","Medium","High (Slower)","Very High (Even Slower)"} +#@gui :1st Additional Palette (.gpl)=_filein() +#@gui :2nd Additional Palette (.gpl)=_filein() +#@gui :Image to Grab Color from (.png)=_filein() +#@gui :_=separator() +#@gui :_=note{"Description:\n This filter allows to quickly colorize a B&W image or lineart. Click on the Apply or OK buttons below to open the G'MIC interactive window and start adding color control points. When you're done, exit the interactive window: your colored result will be transferred back to the host software.\n\n If you are not satisfied with the result, Undo it (CTRL+Z), and click on Apply once again to modify your control points defined previously. To clear all control points, click on the Reset button above. "} +#@gui :Clear Control Points=button(0.5) +#@gui :_=value(0,0) +#@gui :_=value(-1) +#@gui :_=separator() +#@gui :_=note{"Interactions:\n Use the following actions in the interactive window to manage your colorization :\n\n - Left mouse button creates a new color control point (or move an existing one).\n - Right mouse button or key X over a control point deletes it.\n - Right mouse button or key P anywhere else picks a color from the image.\n - Mouse wheel, or keys CTRL+arrows up/down zoom view in/out.\n - CTRL+mouse wheel, SHIFT+wheel or arrow keys move image in zoomed view.\n - Key SPACE updates the extrapolated color field.\n - Key TAB toggles markers view modes.\n - Key BACKSPACE deletes the last control point added.\n - Key PAGE UP increases image contrast.\n - Key PAGE DOWN decreases image contrast.\n - Key R enters/exits color replace mode.\n - Keys CTRL+D increase window size.\n - Keys CTRL+C decrease window size.\n - Keys CTRL+R resets window size.\n - Keys ESC, Q or ENTER exit the interactive window. "} +#@gui :_=separator() +#@gui :_=note("You can find more information on how to use this filter here :") +#@gui :_=link("David Revoy's G'MIC Colorization Page","http://www.davidrevoy.com/article240/gmic-line-art-colorization") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/12/07.") +#@gui Colorize [Photographs]:fx_recolorize,fx_recolorize_preview(1) +#@gui :Smoothness=int(2,0,6) +#@gui :Anisotropy=float(0.2,0,1) +#@gui :Output Mode=choice("Merge Brightness / Colors","Split Brightness / Colors") +#@gui :_=separator() +#@gui :_=note{"Note: This filter needs two layers to work properly. The bottom layer must be a B&W image, while the top layer contains color patches that will be extrapolated in a smart way (edge-directed) to fill the entire image. At the end, you get a completely recolored image."} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/16/01.") +#@gui Colorize [with Colormap]:fx_bwrecolorize,fx_bwrecolorize_preview +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Normalize Input=bool(0) +#@gui :_=separator() +#@gui :Gradient Preset=choice("User-Defined","Black to White","White to Black","Sepia","Solarize") +#@gui :Interpolation Type=choice(1,"Nearest","Linear","Cubic","Lanczos") +#@gui :Preserve Initial Brightness=bool(0) +#@gui :_=separator() +#@gui :_=note("User-defined gradient :") +#@gui :Number of Tones=int(5,2,8) +#@gui :1st Tone=color(#000000ff) +#@gui :2nd Tone=color(#2b1937ff) +#@gui :3rd Tone=color(#9e89bdff) +#@gui :4th Tone=color(#e0bfe4ff) +#@gui :5th Tone=color(#ffffffff) +#@gui :6th Tone=color(#ffffffff) +#@gui :7th Tone=color(#ffffffff) +#@gui :8th Tone=color(#ffffffff) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Colorize Lineart [Auto-Fill]:fx_autofill_lineart,fx_autofill_lineart_preview(0) +#@gui :Contour Threshold (%)=float(90,0,100) +#@gui :Contour Normalization=bool(1) +#@gui :Minimal Region Area=int(8,0,256) +#@gui :Tolerance to Gaps=int(0,0,10) +#@gui :Preview Type=choice("Lineart + Colors","Colors Only") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/12/11.") +#@gui Colorize Lineart [Propagation]:fx_colorize_lineart,fx_colorize_lineart_preview(1) +#@gui :_=note("Layers ordering:") +#@gui :Input Layers=choice(0,"Color Spots + Lineart","Lineart + Color Spots","Color Spots + Extrapolated Colors + Lineart","Lineart + Color Spots + Extrapolated Colors") +#@gui :Output Layers=_choice{1,"Single (Merged)","Extrapolated Colors + Lineart","Lineart + Extrapolated Colors","Color Spots + Extrapolated Colors + Lineart","Lineart + Color Spots + Extrapolated Colors"} +#@gui :Extrapolate Colors As=choice("One Layer","Two Layers","Three Layers","Four Layers","Five Layers","Six Layers","Seven Layers","Eight Layers","Nine Layers","Ten Layers","One Layer per Single Color","One Layer per Single Region") +#@gui :_=separator() +#@gui :Smoothness=float(0.05,0,1) +#@gui :_=separator() +#@gui :_=note{"Note: You probably need to select All for the Input layers option on the left.\n Color Spots = your layer with color indications.\n Lineart = your layer with line-art (B&W or transparent).\n Extrapolated Colors = the G'MIC generated layer with flat colors.\n\n Warnings: \n - Do not rely too much on the preview, it is probably not accurate ! \n - Activate option Extrapolate color as one layer per single color/region only if you have a lot of available memory ! "} +#@gui :_=separator() +#@gui :_=link("Click here for a detailed description of this filter.","http://www.gimpchat.com/viewtopic.php?f=28&t=7567") +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé, Timothée Giet and David Revoy.       Latest Update: 2013/19/06.") +#@gui Colorize Lineart [Smart Coloring]:fx_colorize_lineart_smart,fx_colorize_lineart_smart_preview(0) +#@gui :Colorize Mode=choice("Generate Random-Colors Layer","Extrapolate Color Spots on Transparent Top Layer","Auto-Clean Bottom Color Layer") +#@gui :_=separator() +#@gui :_=note("Global geometry parameters:") +#@gui :Contour Detection (%)=float(95,0,100) +#@gui :Discard Contour Guides=bool(0) +#@gui :_=note{"Add strokes with a saturated color having value 255 (e.g. pure red) on your lineart allows to guide the colorization algorithm with virtual contours."} +#@gui :Output Region Delimiters=_bool(0) +#@gui :_=separator() +#@gui :_=note("For Random colors mode only:") +#@gui :Make Hue Depends on Region Size=float(1,0,1) +#@gui :Maximal Color Saturation=int(24,0,255) +#@gui :Minimal Color Intensity=int(200,0,255) +#@gui :_=separator() +#@gui :_=note("For color spots mode only:") +#@gui :Color Shading (%)=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("Connection parameters:") +#@gui :End Point Rate (%)=float(75,0,100) +#@gui :End Point Connectivity=int(2,1,5) +#@gui :Spline Max Length (px)=float(60,0,256) +#@gui :Segment Max Length (px)=float(20,0,256) +#@gui :Spline Max Angle (deg)=float(90,0,180) +#@gui :Spline Roundness=float(1,0,2) +#@gui :Minimal Region Area=float(10,0,100) +#@gui :Allow Self Intersections=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice(0,"Colored Geometry","Colored Regions","Colored Lineart") +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé, Sébastien Fourey and David Revoy.      Latest Update: 2018/11/09.") +#@gui Desaturate Norm:fx_gcd_norm_eq,fx_gcd_norm_eq_preview(0) +#@gui :_=note("Desaturate sRGB using equalized norm") +#@gui :_=separator() +#@gui :Red=float(0.5,0,1) +#@gui :Blue=float(0.5,0,1) +#@gui :Exp=float(2,1,3) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2016/12/27.") +#@gui Dithering:fx_ditheredbw,fx_ditheredbw_preview(0) +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue=float(0,0,360) +#@gui :Saturation (%)=float(0,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Engrave:fx_engrave,fx_engrave_preview(0) +#@gui :_=note("Black & White foreground:") +#@gui :Radius=float(0.5,0,2) +#@gui :Density=float(50,0,200) +#@gui :Edges=float(0,0,10) +#@gui :Coherence=float(8,0,40) +#@gui :Threshold (%)=float(40,0,100) +#@gui :Minimal Area=int(0,-256,256) +#@gui :Flat Regions Removal=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Color background:") +#@gui :Add Color Background=bool() +#@gui :Quantization=float(10,0,40) +#@gui :Shading=int(1,0,5) +#@gui :Hue=float(0,-180,180) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :Lightness (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :Anti-Aliasing=choice(1,"Disabled","X1.5","X2","X3") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: Lyle Kroll and David Tschumperlé.       Latest Update: 03/13/2015.") +#@gui Freaky B&W:fx_freaky_bw,fx_freaky_bw_preview +#@gui :Strength (%)=float(90,0,100) +#@gui :Oddness (%)=float(20,0,100) +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/30/09.") +#@gui Ink Wash:fx_ink_wash,fx_ink_wash(0) +#@gui :_=note("Ink wash controls") +#@gui :Size=float(0.14,0,4) +#@gui :Amplitude=float(23,0,200) +#@gui :_=separator() +#@gui :_=note("Check if you wish visual control on this step") +#@gui :Skip All Other Steps=bool(false) +#@gui :_=note("UNcheck to reactivate the other controls") +#@gui :_=separator() +#@gui :Smoother Sharpness=float(0.5,0,2) +#@gui :Smoother Edge Protection=float(0.54,0,1) +#@gui :Smoother Softness=float(2.25,0,10) +#@gui :_=separator() +#@gui :Stretch Contrast=choice("None","Automatic","Automatic & Contrast Mask","Manual Controls") +#@gui :_=note("To activate the sliders below chose 'Manual Controls'") +#@gui :_=separator() +#@gui :LN Amplitude=float(2,0,60) +#@gui :LN Size=float(6,0,64) +#@gui :LN Neightborhood-Smoothness=float(5,0,40) +#@gui :LN Average-Smoothness=float(20,0,40) +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX.       Latest Update: 2011/05/04.") +#@gui :_=link(0,"Forum thread about the filter discussion","http://gimpchat.com/viewtopic.php?f=10&t=914") +#@gui Multi-Layer Etch:fx_gcd_layeretch,fx_gcd_layeretch(2) +#@gui :_=note("Etch with selectable number of layers") +#@gui :_=note("Warning: With high number of layers this can be VERY slow!") +#@gui :_=separator() +#@gui :Total Layers=int(11,2,16) +#@gui :White Layers=int(4,1,15) +#@gui :Etch Tones=int(12,2,32) +#@gui :Tone Blur=float(0.12,0,1) +#@gui :Noise Level=int(100,5,200) +#@gui :Dark Length=float(8.5,0,20) +#@gui :Bright Length=float(5,0,20) +#@gui :Start Angle=int(0,0,180) +#@gui :Random Angle=int(0,0,45) +#@gui :Max Curve=int(3,0,20) +#@gui :Gamma=float(1,0.01,2) +#@gui :Spread Angles=bool(1) +#@gui :Fast Resize=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2012/12/21.") +#@gui Pencil:fx_pencilbw,fx_pencilbw_preview(0) +#@gui :Size=float(0.3,0,5) +#@gui :Amplitude=float(60,0,200) +#@gui :Hue=float(0,0,360) +#@gui :Saturation=float(0,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/05/03.") +#@gui Pencil Portrait:fx_pencil_portraitbw,fx_pencil_portraitbw_preview(0) +#@gui :Stroke Length=float(30,0,500) +#@gui :Stroke Angle=float(120,0,180) +#@gui :Contour Threshold=float(1,0,10) +#@gui :Opacity=float(0.5,0,1) +#@gui :Color=color(#904f15) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: Jamac4k and David Tschumperlé.       Latest Update: 2015/29/06.") +#@gui Stamp:fx_stamp,fx_stamp_preview(0) +#@gui :Auto-Threshold=bool(1) +#@gui :Threshold=int(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Sharpening=float(0,0,30) +#@gui :Grain=float(0,0,100) +#@gui :Negative=bool() +#@gui :Anti-Aliasing=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: Antaron, Mahvin and David Tschumperlé.      Latest Update: 2015/16/03.") +#@gui Threshold Etch:fx_gcd_etch,fx_gcd_etch_preview(1) +#@gui :_=note("Replace tones with noise generated lines") +#@gui :_=note("\nInput Image Settings") +#@gui :_=separator() +#@gui :Threshold Low=int(125,10,255) +#@gui :Threshold Mid=int(153,10,255) +#@gui :Threshold High=int(171,10,255) +#@gui :Threshold Max=int(185,10,255) +#@gui :Blur Amount=float(0.1,0,2) +#@gui :_=note("\nOutput Etch Settings") +#@gui :_=separator() +#@gui :Horizontal Amount=int(50,0,100) +#@gui :Cross-Hatch Amount=int(80,0,100) +#@gui :Vertical 1 Amount=int(50,0,100) +#@gui :Vertical 2 Amount=int(10,0,100) +#@gui :_=separator() +#@gui :Horizontal Length=int(15,0,50) +#@gui :Vertical 1 Length=int(12,0,50) +#@gui :Vertical 2 Length=int(20,0,50) +#@gui :Flip Cross-Hatch=bool(0) +#@gui :_=separator() +#@gui :Curve Amount=int(1,0,20) +#@gui :Gamma=float(0.3,0.01,1) +#@gui :Fast Resize=bool(1) +#@gui :Color Image=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2013/02/09.") +#@gui _Colors +#@gui Abstraction:fx_color_abstraction,fx_color_abstraction_preview(0) +#@gui :Smoothness=float(1,0,10) +#@gui :Levels=int(10,2,100) +#@gui :Contrast=float(0.2,0.01,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/10/19.") +#@gui Apply External CLUT:fx_apply_haldclut,fx_apply_haldclut_preview(1)+ +#@gui :Specify HaldCLUT As=choice(2,"Top Layer","Bottom Layer","Filename") +#@gui :HaldCLUT Filename=filein() +#@gui :_=note("Note: Do not forget to set the Input layers option if you select Top layer or Bottom layer.") +#@gui :_=separator() +#@gui :Strength (%)=float(100,0,100) +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :Normalize Colors=choice("None","Pre-Normalize","Post-Normalize","Both") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/02/08.") +#@gui Apply From CLUT Set:apply_from_clut_set,apply_from_clut_set_preview(1)+ +#@gui :CLUT Set (.gmz File)=file("") +#@gui :Index=int(1,1,1024) +#@gui :_=separator() +#@gui :Strength (%)=float(100,0,100) +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :Normalize Colors=choice("None","Pre-Normalize","Post-Normalize","Both") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2022/05/08.") +#@gui Basic Adjustments:fx_adjust_colors,fx_adjust_colors_preview +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/16/06.") +#@gui Boost Chromaticity:fx_boost_chroma,fx_boost_chroma_preview(1) +#@gui :Amplitude (%)=float(50,0,100) +#@gui :Color Space=choice{"YCbCr (Distinct)","YCbCr (Mixed)","Lab (Distinct)","Lab (Mixed)"} +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/19/07.") +#@gui Boost-Fade:fx_boost_fade,fx_boost_fade_preview +#@gui :Amplitude=float(5,0,10) +#@gui :Chromaticity From=choice("YCbCr","Lab") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/11/26.") +#@gui Brightness:afre_brightness,afre_brightness_preview(1)+ +#@gui :_=note("Enhance luminance brightness.  Filter by afre 2020-2021 Jan8.\n\n") +#@gui :Amount=int(50,-300,300) +#@gui :Smooth=int(0,0,50) +#@gui :_=note("\n\nNote\n\nG'MIC's preview is inaccurate. Apply the filter and review the results in your host editor.") +#@gui Channel Processing:fx_channel_processing,fx_channel_processing_preview(1) +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Value Action=choice("None","Cut","Cut & Normalize","Normalize","Threshold") +#@gui :Low Value=float(0,0,100) +#@gui :High Value=float(100,0,100) +#@gui :Quantization=int(256,1,256) +#@gui :Equalization=bool(0) +#@gui :Negation=bool(0) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Channels to Layers:fx_channels2layers,fx_channels2layers_preview +#@gui :Colorspace=choice("RGB","CMY","HSV") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/15/07.") +#@gui CLUT from After - Before Layers:fx_clut_from_ab,fx_clut_from_ab_preview +#@gui :Output Mode=choice("Replace Layer with CLUT","Insert New CLUT Layer","Save CLUT as .cube or .png File") +#@gui :Output CLUT Resolution=choice(4,16,25,36,49,64,81,100,121,144,169,225,256)_2 +#@gui :_=separator() +#@gui :Output Folder=_folder()_1- +#@gui :Output Filename=_text("output.cube")_1+ +#@gui :_=separator() +#@gui :Influence of Color Samples (%)=float(50,0,100)_2 +#@gui :_=separator() +#@gui :_=note{"What is this filter for?\n\n This filter requires at least two input layers to work properly.\n It assumes you have an input top layer A and a base layer B such that A and B both represent the same image but with only color variations (typically A has been obtained from B using the color curves tool).\n\n This filter is then able to estimate and outputs a color HaldCLUT H so that applying H on the base layer B gives back A.\n\n This is useful when you have a color transformation between two images, that you want to recover and re-apply on a bunch of other images. "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.       Latest Update: 2019/08/27.") +#@gui CMYK Tone:iain_cmyk_tone_p,iain_cmyk_tone_p +#@gui :_=note("Adjust cyans for pixels that have:") +#@gui :A Lot of Cyan=int(0,-255,255) +#@gui :Some Cyan=int(0,-255,255) +#@gui :Little Cyan=int(0,-255,255) +#@gui :_=note("Adjust cyans for pixels that have:") +#@gui :A Lot of Magenta=int(0,-255,255) +#@gui :Some Magenta=int(0,-255,255) +#@gui :Little Magenta=int(0,-255,255) +#@gui :_=note("Adjust cyans for pixels that have:") +#@gui :A Lot of Yellow=int(0,-255,255) +#@gui :Some Yellow=int(0,-255,255) +#@gui :Little Yellow=int(0,-255,255) +#@gui :_=note("Adjust cyans for pixels that have:") +#@gui :A Lot of Key=int(0,-255,255) +#@gui :Some Key=int(0,-255,255) +#@gui :Little Key=int(0,-255,255) +#@gui :_=separator() +#@gui :_=note("Adjust Magentas for pixels that have:") +#@gui :A Lot of Cyan=int(0,-255,255) +#@gui :Some Cyan=int(0,-255,255) +#@gui :Little Cyan=int(0,-255,255) +#@gui :_=note("Adjust Magentas for pixels that have:") +#@gui :A Lot of Magenta=int(0,-255,255) +#@gui :Some Magenta=int(0,-255,255) +#@gui :Little Magenta=int(0,-255,255) +#@gui :_=note("Adjust Magentas for pixels that have:") +#@gui :A Lot of Yellow=int(0,-255,255) +#@gui :Some Yellow=int(0,-255,255) +#@gui :Little Yellow=int(0,-255,255) +#@gui :_=note("Adjust Magentas for pixels that have:") +#@gui :A Lot of Key=int(0,-255,255) +#@gui :Some Key=int(0,-255,255) +#@gui :Little Key=int(0,-255,255) +#@gui :_=separator() +#@gui :_=note("Adjust Yellows for pixels that have:") +#@gui :A Lot of Cyan=int(0,-255,255) +#@gui :Some Cyan=int(0,-255,255) +#@gui :Little Cyan=int(0,-255,255) +#@gui :_=note("Adjust Yellows for pixels that have:") +#@gui :A Lot of Magenta=int(0,-255,255) +#@gui :Some Magenta=int(0,-255,255) +#@gui :Little Magenta=int(0,-255,255) +#@gui :_=note("Adjust Yellows for pixels that have:") +#@gui :A Lot of Yellow=int(0,-255,255) +#@gui :Some Yellow=int(0,-255,255) +#@gui :Little Yellow=int(0,-255,255) +#@gui :_=note("Adjust Yellows for pixels that have:") +#@gui :A Lot of Key=int(0,-255,255) +#@gui :Some Key=int(0,-255,255) +#@gui :Little Key=int(0,-255,255) +#@gui :_=separator() +#@gui :_=note("Adjust Key for pixels that have:") +#@gui :A Lot of Cyan=int(0,-255,255) +#@gui :Some Cyan=int(0,-255,255) +#@gui :Little Cyan=int(0,-255,255) +#@gui :_=note("Adjust Key for pixels that have:") +#@gui :A Lot of Magenta=int(0,-255,255) +#@gui :Some Magenta=int(0,-255,255) +#@gui :Little Magenta=int(0,-255,255) +#@gui :_=note("Adjust Key for pixels that have:") +#@gui :A Lot of Yellow=int(0,-255,255) +#@gui :Some Yellow=int(0,-255,255) +#@gui :Little Yellow=int(0,-255,255) +#@gui :_=note("Adjust Key for pixels that have:") +#@gui :A Lot of Key=int(0,-255,255) +#@gui :Some Key=int(0,-255,255) +#@gui :Little Key=int(0,-255,255) +#@gui :_=separator() +#@gui :_=note("Strength of effect for Saturation level:") +#@gui :None=int(255,0,255) +#@gui :Little=int(255,0,255) +#@gui :Some=int(255,0,255) +#@gui :Much=int(255,0,255) +#@gui :Most=int(255,0,255) +#@gui :_=separator() +#@gui :Output=choice(0,"Perserve Luminance","Clip CMYK","Clip RGB","Scale CMYK","Scale RGB") +#@gui :_=separator() +#@gui :Parallel Processing=choice(0,"Auto","Off") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. Update: 4 March 2014 - Added parallel processing option") +#@gui Color Balance:fx_balance_gamma,fx_balance_gamma_preview +#@gui :Neutral Color=color(#808080) +#@gui :Stretch Colors=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/01/07.") +#@gui Color Blindness:colorblind,fx_colorblind_preview +#@gui :Blindness Type=choice("Protanopia","Protanomaly","Deuteranopia","Deuteranomaly","Tritanopia","Tritanomaly","Achromatopsia","Achromatomaly") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Note: This filter simulates different types of colorblindness vision. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/04.") +#@gui Color Grading:jl_colorgrading,jl_colorgrading_preview(1) +#@gui :_=note("A filter for basic photo editing and color grading.") +#@gui :_=note("Note: Saturation channel gamma affects more the less saturated areas. S-curve contrast, affects shadows and highlights equally. When using noise reduction or sharpening tools, zoom in for more accurate view.") +#@gui :_=separator() +#@gui :HDR Effect (Tone Map)=float(0.,0.0,1) +#@gui :Cool / Warm=int(0,-50,50) +#@gui :Saturation=float(1,0,2) +#@gui :Saturation Channel Gamma=float(1,0.1,3) +#@gui :_=note("Note: Saturation channel gamma may introduce artifacts depending on the image.") +#@gui :_=separator() +#@gui :S-Curve Contrast=int(0,-30,30) +#@gui :Shadows=int(0,-50,50) +#@gui :Highlights=int(0,-50,50) +#@gui :Blacks=int(0,0,50) +#@gui :Brightness=int(0,-50,50) +#@gui :Contrast=int(0,-50,50) +#@gui :Gamma=float(1,0.1,3) +#@gui :_=separator() +#@gui :Clarity=float(0,0.0,2.0) +#@gui :Local Contrast Enhance=float(0,0,3) +#@gui :_=separator() +#@gui :Color Grading=bool(0) +#@gui :Highlights Color Intensity=int(70,0,130) +#@gui :Highlights Hue=int(0,0,360) +#@gui :Highlights Brightness=int(0,-100,100) +#@gui :Midtones Color Intensity=int(0,0,130) +#@gui :Midtones Hue=int(0,0,360) +#@gui :Midtones Brightness=int(0,-100,100) +#@gui :Shadows Color Intensity=int(70,0,130) +#@gui :Shadows Hue Shift=int(180,0,360) +#@gui :Shadows Brightness=int(0,-100,100) +#@gui :_=note("Color grading subsection usage: Use intensity sliders to control the amount of color being applied in the highlights/midtones/shadows, use brightness sliders for bringing up or down highlights/midtones/shadows. Hues here follow rotation axis in color wheel ie: 0 or 360 deg is red, 180 is blue it's complimentary. Shadows hue shift in default position uses always the complimentary color of highlights in the shadows. Default sliders for grading apply red highlights and blue shadows effect.") +#@gui :_=separator() +#@gui :Output Saturation=float(1,0,2) +#@gui :Output Sharpening=float(0,0,10) +#@gui :Output Chroma NR=float(0,0,20) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: John Lakkas. Latest update: 17/03/2015.") +#@gui Color Mask [Interactive]:fx_mask_color,gui_no_preview +#@gui :Color Metric=_choice(13,"RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [all]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [all]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [all]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [all]","HSI [intensity]","HSL [all]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :Spatial Tolerance=_float(10,0,100) +#@gui :Color Tolerance=_float(5,0,100) +#@gui :_=separator() +#@gui :Output Mode=_choice(0,"Masked Image","Color Mask") +#@gui :_=separator() +#@gui :_=note{"Note: This filter is CPU consuming, so use it at least with 4+ cores (or reduce the size of the interactive window to speed up computation)."} +#@gui :_=note{"Interactions:\n Use the following actions in the interactive window to build your color mask :\n\n - Left mouse button make the color pointed by the mouse wanted for the mask.\n - Right mouse button make the color pointed by the mouse unwanted for the mask.\n - Middle mouse button or key R resets color mask.\n - Key SPACE or TAB toggles view modes (half/full-masked RGB or color mask).\n - Keys CTRL+D increase window size.\n - Keys CTRL+C decrease window size.\n - Keys CTRL+R resets window size.\n - Keys ESC, Q or ENTER exit the interactive window. "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 01/20/2017.") +#@gui Color Presets:fx_color_presets,fx_color_presets_preview(1)+ +#@gui :LUTs Pack=choice{21,"Abigail Gonzalez (21)","Alex Jordan (81)","Berat (10)","Cinematic (8)","Cinematic Travel (29)","Creative Pack (33)","EditingCorp (60)","Eric Ellerbrock (14)","FilterGrade Cinematic (8)","Hollywood Movies (74)","InAvision (15)","J.T. Semple (14)","Kyler Holland (10)","Lutify.Me (7)","Michael Ezra (2)","Moviz (48)","Ohad Peretz (7)","Olivio Sarikas (19)","ON1 Photography (90)","PictureFX (25)","Pixelmator (45)","PIXLS.US (31)","Purple11 (12)","RocketStock (35)","Shamoon Abbasi (25)","SmallHD Movie Look (7)","Todd Blankenship (13)","Youssef Hossam (5)","Others (69)"} +#@gui :Preset=choice(1,"All [Collage]","None","Blade Runner","Blue House","Blue Ice","Caribe","Cinema","Cinema 2","Cinema 3","Cinema 4","Cinema 5","Cinema Noir","Cinematic for Flog","Day4Nite","Eterna for Flog","Filmic","Fuji HDR","Golden Gate","Matrix","Monochrome 1","Monochrome 2","Old West","Science Fiction")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Action Magenta 01","Action Red 01","Adventure 1453","Aggressive Highlights Recovery 5","Bleech Bypass Green","Bleech Bypass Yellow 01","Blue Dark","Blue Shadows 01","Bright Green 01","Brownish","Colorful 0209","Conflict 01","Contrast with Highlights Protection","Contrasty Afternoon","Contrasty Green","Cross Process CP 130","Cross Process CP 14","Cross Process CP 15","Cross Process CP 16","Cross Process CP 18","Cross Process CP 3","Cross Process CP 4","Cross Process CP 6","Dark Green 02","Dark Green 1","Dark Place 01","Dream 1","Dream 85","Faded Retro 01","Faded Retro 02","Film 0987","Film 9879","Film Highlight Contrast","Flat 30","Green 2025","Green Action","Green Afternoon","Green Conflict","Green Day 01","Green Day 02","Green G09","Green Indoor","Green Light","Harsh Day","Harsh Sunset","Highlights Protection","Indoor Blue","Low Contrast Blue","Low Key 01","Magenta Day","Magenta Day 01","Magenta Dream","Memories","Moonlight 01","Mostly Blue","Muted 01","Night 01","Only Red","Only Red and Blue","Operation Yellow","Orange Dark 4","Orange Dark 7","Orange Dark Look","Orange Underexposed","Protect Highlights 01","Red Afternoon 01","Red Day 01","Red Dream 01","Retro Brown 01","Retro Magenta 01","Retro Yellow 01","Saturated Blue","Smart Contrast","Subtle Blue","Subtle Green","Yellow 55B","Yellow Film 01")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Brown BM","Cine Blue","Cine BM4k","Golden Time","Green and Orange","Monochrome","Sevsuz","Sunlight Love","Western","Western Lut 2")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Deep","Dimension","Enchanted","Flavin","Frosted","Shine","Ultra Water","Wipe")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Blue Cold Fade","Bright Teal Orange","Bright Warm","Clear Teal Fade","Cold Clear Blue","Cold Clear Blue 1","Deep Blue","Deep Dark Warm","Deep High Contrast","Deep Teal Fade","Deep Warm Fade","Faded Green","Greenish Contrasty","Greenish Fade","Greenish Fade 1","Hard Teal Orange","Neutral Teal Orange","Neutral Warm Fade","Smooth Clear","Smooth Green Orange","Smooth Teal Orange","Teal Fade","Very Warm Greenish","Warm Dark Contrasty","Warm Fade","Warm Fade 1","Warm Neutral","Warm Sunset Red","Warm Teal")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Anime","Bleach Bypass 1","Bleach Bypass 2","Bleach Bypass 3","Bleach Bypass 4","Candle Light","Color Negative","Crisp Warm","Crip Winter","Drop Blues","Edgy Ember","Fall Colors","Foggy Night","Futuristic Bleak 1","Futuristic Bleak 2","Futuristic Bleak 3","Futuristic Bleak 4","Horror Blue","Late Sunset","Moonlight","Night From Day","Red Blue Yellow","Smokey","Soft Warming","Teal Magenta Gold","Teal Orange","Teal Orange 1","Teal Orange 2","Teal Orange 3","Tension Green 1","Tension Green 2","Tension Green 3","Tension Green 4")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Ampio","Asistas","Atusa","Basuco","Beati","Bisogno","Boyado","Calidum","Colore","Convold","Cosa","Culor","Dimmer","Ensaya","Falua","Farkling","Fatos","Fezzle","Filo","Foresta","Huesio","Husmes","Huyan","Ideo","Jarklin","Lavark","Levex","Litore","Loro","Lotta","Maesky","Mercato","Molti","Motus","Mucca","Nigrum","Onda","Padre","Partia","Perso","Picola","Randas","Satid","Scala","Scrittle","Seges","Selor","Sensum","Sino","Soldi","Strano","Stringa","Tirare","Tutto","Upglow","Valize","Valsky","Vita","Vubes","Wavefire")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Avalanche","Black Star","Helios","Hydracore","Hypnosis","Killstreak","Nemesis","Night Blade 4","Paladin","Seringe 4","Serpent","Terra 4","Victory","Yellowstone")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Cine Basic","Cine Bright","Cine Cold","Cine Drama","Cine Teal Orange 1","Cine Teal Orange 2","Cine Vibrant","Cine Warm")_0 +#@gui :Preset=choice(1,"All [Collage]","None","12 Years a Slave","1917","Ad Astra","Aladdin","Ant-Man","Aquaman","Avengers Endgame","Baby Driver","Bad Boys for Life","Beauty and the Beast","Black Panther","Bohemian Rhapsody","Bombshell","Captain Marvel","City of God","Creed 2","Doctor Strange","Dunkirk","Fight Club","Ford V Ferrari","Green Book","Greyhound","Inception","I Tonya","Jojo Rabbit","Joker ","Jumanji The Next Level","Jurassic World Fallen Kingdom","Justice League","Kingsman The Golden Circle","Knives Out","La La Land","Little Women","Logan","Mad Max Fury Road","Marriage Story","Moonlight","Mother!","No Time to Die","Once Upon a Time in Hollywood","Parasite","Pirates of the Caribbean","Rocketman","Separation","Sicario","Spider-Man Far From Home","Spotlight","Star Wars The Rise of Skywalker","Sully","TENET","The Darkest Hour","The Dark Knight","The Gentelmen","The Grand Budapest Hotel","The Hurt Locker","The Irishman","The Lighthouse","The Lobster","The Martian","The Revenant","The Shape of Water","The Social Network","The Two Popes","The Way Back","Thor Ragnarok","Top Gun Maverick","Uncut Gems","Underwater","Venom","War for the Planet of the Apes","Wolf of Wall Street","Wonder Woman","X-Men Dark Phoenix","Zombieland Double Tap")_0 +#@gui :Preset=choice(1,"All [Collage]","None","7Drk21","BC Darkum","Brown Mobster","Cold Ice","Dark Man X","Film GB-19","Formula B","Gremerta","Hitman","J. Wick 21","London Nights","Louetta","Nightlife","VFB 21","Vintage Mob")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Bright Green","Crisp Romance","Crushin","Frosted Beach Picnic","Just Peachy","Late Afternoon Wanderlust","Lush Green Summer","Magenta Coffee","Minimalist Caffeination","Mystic Purple Sunset","Nostalgia Honey","Spring Morning","Toasted Garden","Winter Lighthouse")_0 +#@gui :Preset=choice(1,"All [Collage]","None","KH 1","KH 2","KH 3","KH 4","KH 5","KH 6","KH 7","KH 8","KH 9","KH 10")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Hackmanite","Herderite","Heulandite","Hiddenite","Hilutite","Howlite","Hypersthene")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Deep Skin Tones 2","Deep Skin Tones 3")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Moviz 1","Moviz 2","Moviz 3","Moviz 4","Moviz 5","Moviz 6","Moviz 7","Moviz 8","Moviz 9","Moviz 10","Moviz 11","Moviz 12","Moviz 13","Moviz 14","Moviz 15","Moviz 16","Moviz 17","Moviz 18","Moviz 19","Moviz 20","Moviz 21","Moviz 22","Moviz 23","Moviz 24","Moviz 25","Moviz 26","Moviz 27","Moviz 28","Moviz 29","Moviz 30","Moviz 31","Moviz 32","Moviz 33","Moviz 34","Moviz 35","Moviz 36","Moviz 37","Moviz 38","Moviz 39","Moviz 40","Moviz 41","Moviz 42","Moviz 43","Moviz 44","Moviz 45","Moviz 46","Moviz 47","Moviz 48")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Cold Simplicity 2","D and O 1","Retro Summer 3","Subtle Yellow","Teal Moonlight","True Colors 8","Vintage Warmth 1")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Analog Film 1","Atomic Pink","Beach Aqua Orange","Beach Faded Analog","BW but Yellow","City Dust","Dark Orange Teal","Day to Night King's Blue","DuoTone Blue Red","Faded Pink-Ish","Flat Blue Moon","Honey Light","Infrared - Dust Pink","Neutral Pump","Shade King's Ink","Sunset Aqua Orange","Sunset Intense Violet Blue","Sunset Violet Mood","Violet Taste")_0 +#@gui :Preset=choice(1,"All [Collage]","None","2-Strip Process","Aqua","Aqua and Orange Dark","Berlin Sky","Blues","Black & White-1","Black & White-2","Black & White-3","Black & White-4","Black & White-5","Black & White-6","Black & White-7","Black & White-8","Black & White-9","Black & White-10","Chrome 01","Cinematic-1","Cinematic-2","Cinematic-3","Cinematic-4","Cinematic-5","Cinematic-6","Cinematic-7","Cinematic-8","Cinematic-9","Cinematic-10","Classic Teal and Orange","Earth Tone Boost","Fade to Green","Film Print 01","Film Print 02","French Comedy","Green Blues","Green Yellow","Landscape-1","Landscape-2","Landscape-3","Landscape-4","Landscape-5","Landscape-6","Landscape-7","Landscape-8","Landscape-9","Landscape-10","Lifestyle & Commercial-1","Lifestyle & Commercial-2","Lifestyle & Commercial-3","Lifestyle & Commercial-4","Lifestyle & Commercial-5","Lifestyle & Commercial-6","Lifestyle & Commercial-7","Lifestyle & Commercial-8","Lifestyle & Commercial-9","Lifestyle & Commercial-10","Moody-1","Moody-2","Moody-3","Moody-4","Moody-5","Moody-6","Moody-7","Moody-8","Moody-9","Moody-10","Nature & Wildlife-1","Nature & Wildlife-2","Nature & Wildlife-3","Nature & Wildlife-4","Nature & Wildlife-5","Nature & Wildlife-6","Nature & Wildlife-7","Nature & Wildlife-8","Nature & Wildlife-9","Nature & Wildlife-10","Oranges","Portrait-1","Portrait-2","Portrait-3","Portrait-4","Portrait-5","Portrait-6","Portrait-7","Portrait-8","Portrait-9","Portrait10","Purple","Reds","Reds Oranges Yellows","Studio Skin Tone Shaper","Vintage Chrome")_0 +#@gui :Preset=choice(1,"All [Collage]","None","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","PictureFX - Faux Infrared B&W1","PictureFX - Faux Infrared Color P2","PictureFX - Faux Infrared Color P3","PictureFX - Faux Infrared R0a","PictureFX - Faux Infrared R0b","PictureFX - Faux Infrared YP1","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","TechnicalFX - Backlight Filter","ZilverFX - B&W Solarization","ZilverFX - InfraRed","ZilverFX - Vintage B&W")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Black & White 01","Black & White 02","Black & White 03","Black & White 04","Black & White 05","Black & White 06","Cinematic 01","Cinematic 02","Cinematic 03","Cinematic 04","Cinematic 05","Cinematic 06","Cinematic 07","Classic Films 01","Classic Films 02","Classic Films 03","Classic Films 04","Classic Films 05","Landscape 01","Landscape 02","Landscape 03","Landscape 04","Landscape 05","Modern Films 01","Modern Films 02","Modern Films 03","Modern Films 04","Modern Films 05","Modern Films 06","Modern Films 07","Night 01","Night 02","Night 03","Night 04","Night 05","Urban 01","Urban 02","Urban 03","Urban 04","Urban 05","Vintage 01","Vintage 02","Vintage 03","Vintage 04","Vintage 05")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Amstragram","Amstragram+","Autumn","Cinematic Lady Bird","Cinematic Mexico","Dark Blues in Sunlight","Delicatessen","Expired 69","Faded Look","Faded Print","Hypressen","Magenta Yellow","Metropolis","Modern Film","Newspaper","Night Spy","Progressen","Prussian Blue","Seventies Magazine","Street","Sweet Bubblegum","Sweet Gelatto","Taiga","Tarraco","Unknown","Uzbek Bukhara","Uzbek Marriage","Uzbek Samarcande","Velvetia","Warm Vintage","Whiter Whites")_2 +#@gui :Preset=choice(1,"All [Collage]","None","Going for a Walk","Good Morning","Nah","Once Upon a Time","Passing By","Serenity","Smooth Sailing","Undeniable","Undeniable 2","Urban Cowboy","We'll See","You Can Do It")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Arabica 12","Ava 614","Azrael 93","Bourbon 64","Byers 11","Chemical 168","Clayton 33","Clouseau 54","Cobi 3","Contrail 35","Cubicle 99","Django 25","Domingo 145","Faded 47","Folger 50","Fusion 88","Hyla 68","Korben 214","Lenox 340","Lucky 64","McKinnon 75","Milo 5","Neon 770","Paladin 1875","Pasadena 21","Pitaya 15","Reeve 38","Remy 24","Sprocket 231","Teigen 28","Trent 18","Tweed 71","Vireo 37","Zed 32","Zeke 39")_0 +#@gui :Preset=choice(1,"All [Collage]","None","City 7","Coffee 44","Date 39","Day for Night","Denoise Simple 40","Desert Gold 37","Directions 23","Drop Green Tint 14","Elegance 38","Golden Night Softner 43","Golden Sony 37","Green 15","Happyness 133","HLG 1","Industrial 33","Morning 6","Morroco 16","Night King 141","Rest 33","Shadow King 39","Spy 29","Thriller 2","Turkiest 42","Vintage 163","Wooden Gold 20")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Apocalypse This Very Moment","B-Boyz 2","Bob Ford","Life Giving Tree","Moonrise","Saving Private Damon","The Matrices")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Blue Architecture","Blue Hour","Cold Chrome","Crisp Autumn","Dark And Somber","Hard Boost","Long Beach Morning","Lush Green","Magic Hour","Natural Boost","Orange And Blue","Soft Black And White","Waves")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Cinematic Forest","City","Darkness","Hallowen Dark","Sea")_0 +#@gui :Preset=choice{1,"All [Collage]","None","60's","60's (faded)","60's (faded Alt)","Alien Green","Black & White","Bleach Bypass","Blue Mono","Cinematic-01","Cinematic-02","Cinematic-03","Color (rich)","Faded","Faded (alt)","Faded (analog)","Faded (extreme)","Faded (vivid)","Expired (fade)","Expired (polaroid)","Extreme","Fade","Faux Infrared","Golden","Golden (bright)","Golden (fade)","Golden (mono)","Golden (vibrant)","Green Mono","Hong Kong","Instant-C","K-Tone Vintage Kodachrome","Light (blown)","Lomo","Mono Tinted","Muted Fade","Mute Shift","Natural (vivid)","Nostalgic","Orange Tone","Pink Fade","Purple","Retro","Rotate (muted)","Rotate (vibrant)","Rotated","Rotated (crush)","Smooth Crome-Ish","Smooth Fade","Soft Fade","Solarize Color","Solarized Color2","Summer","Summer (alt)","Sunny","Sunny (alt)","Sunny (warm)","Sunny (rich)","Super Warm","Super Warm (rich)","Sutro FX","Vibrant","Vibrant (alien)","Vibrant (contrast)","Vibrant (crome-Ish)","Vintage","Vintage (alt)","Vintage (brighter)","Warm","Warm (highlight)","Warm (yellow)"}_0 +#@gui :Thumbnail Size=int(512,0,1024)_1 +#@gui :_=separator() +#@gui :Strength (%)=float(100,0,100) +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :Normalize Colors=choice("None","Pre-Normalize","Post-Normalize","Both") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=value(0)_2+ +#@gui :_=separator() +#@gui :_=note("Note: The color LUTs proposed in this category come from:\n") +#@gui :_=value(0)_0+ +#@gui :_=note("
  Abigail Gonzalez - FreshLUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  Alex Jordan - FreshLUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
Berat - FreshLUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
Free Cinematic LUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  30 Cinematic Travel Color
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  RawTherapee Film Simulation
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  EditingCorp - 60 Free Hand-Picked LUTs For Cinematic Color Grading
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  Eric Ellerbrock - FreshLUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  FilterGrade Free Cinematic LUTs Pack
") +#@gui :_=value(0)_0+ +#@gui :_=note("
Hollywood LUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  InAvision - FreshLUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  J.T. Semple - FreshLUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  Kyler Holland 10 Free CLUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  Lutify.Me Free LUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
Michael Ezra
") +#@gui :_=value(0)_0+ +#@gui :_=note("
Moviz LUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
Ohad Peretz - FreshLUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  Olivio Sarikas - Free LUT Packs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  ON1 Free Photography LUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
PictureFX - A Free HaldCLUT Set
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  Pixelmator Free LUTs
") +#@gui :_=value(0)_2+ +#@gui :_=note("
  PIXLS.US Contributors
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  Purple11 - Free LUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  RocketStock 35 Free LUTs for Color Grading
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  Shamoon Abbasi - FreshLUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  SmallHD Free Movie Look Pack
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  Todd Blankenship - Free LUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
Youssef Hossam
") +#@gui :_=value(0)_2+ +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.         Latest Update: 2023/06/01.") +#@gui Color Temperature:fx_tk_colortemp,fx_tk_colortemp_preview +#@gui :Color Temperature=float(0,-20,20) +#@gui :Automatic Color Balance=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil. Latest update: 2012/04/05.") +#@gui Colorful Blobs:fx_colorful_blobs,fx_colorful_blobs_preview +#@gui :Colorspace=choice(1,"SRGB","Linear RGB","Lab") +#@gui :Background Color=color(#c8c8c800) +#@gui :Display Blob Controls=bool(1) +#@gui :_=separator() +#@gui :Blob 1=point(25,25,1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 1 Color=color(#ff0000) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob2=point(75,25,1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 2 Color=color(#00ff00) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob 3=point(50,75,1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 3 Color=color(#0000ff) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob 4=point(5,90,-1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 4 Color=color(#ffff00) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob 5=point(5,90,-1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 5 Color=color(#ff00ff) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob 6=point(5,90,-1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 6 Color=color(#00ffff) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob 7=point(5,90,-1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 7 Color=color(#ffffff) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob 8=point(5,90,-1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 8 Color=color(#000000) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob 9=point(5,90,-1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 9 Color=color(#ff8040) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob 10=point(5,90,-1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 10 Color=color(#ff4080) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob 11=point(5,90,-1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 11 Color=color(#8040ff) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob 12=point(5,90,-1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 12 Color=color(#4080ff) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :_=note("This filter can be used to create custom palettes with given color shades. It has been inspired by Adobe's Playful Palette.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/08/26.") +#@gui Colormap:fx_colormap,fx_colormap_preview +#@gui :Colormap=choice{2,"Adaptive","Custom","Standard (256)","HSV (256)","Lines (256)","Hot (256)","Cool (256)","Jet (256)","Flag (256)","Cube (256)"} +#@gui :Dithering=float(1,0,1) +#@gui :_=separator() +#@gui :Number of Tones=int(32,2,256)_0 +#@gui :Number of Colors=int(8,2,8)_0 +#@gui :1st Color=color(#000000)_0 +#@gui :2nd Color=color(#ffffff)_0 +#@gui :3rd Color=color(#ff0000)_0 +#@gui :4th Color=color(#00ff00)_0 +#@gui :5th Color=color(#0000ff)_0 +#@gui :6th Color=color(#ffff00)_0 +#@gui :7th Color=color(#ff00ff)_0 +#@gui :8th Color=color(#00ffff)_0+ +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/27/12.") +#@gui Contrast:afre_contrast,afre_contrast_preview(1)+ +#@gui :_=note("Enhance luminance contrast.  Filter by afre 2020 Jan9.\n\n") +#@gui :Amount=int(50,-200,200) +#@gui :_=note("\n\nNote\n\nG'MIC's preview is inaccurate. Apply the filter and review the results in your host editor.") +#@gui Curves:fx_curves_interactive,fx_curves_interactive_preview +#@gui :Colorspace=choice("RGB","CMY","CMYK","HSI","HSL","HSV","Lab","Lch","YCbCr") +#@gui :Output Preset as a HaldCLUT Layer=_choice("Disable","Lowres CLUT","Highres CLUT") +#@gui :Apply Transformation From=_choice("New Curves [Interactive]","Curves Previously Defined") +#@gui :_=value(0) +#@gui :_=value(0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100) +#@gui :_=separator() +#@gui :_=note("Description:\n This filter allows to apply color curves on your images, in many different colorspaces. Click on the Apply or OK buttons below to open the G'MIC interactive windows and start building your color curves. When you're done, exit the main image window: your modified result will be transferred back to the host software.\n\n Once you've set curves, you can save them by pressing the Add to faves button below the filter tree. To clear control points for your curves, click on the Reset button above. ") +#@gui :_=separator() +#@gui :_=note{"Interactions:\n Use the following actions in the interactive windows to manage your colorization :\n\n - Left mouse button on a curve creates a new color control point (or move an existing one).\n - Right mouse button on a control point deletes it.\n - Left mouse button on the main image window shows the initial image until button is released.\n - Right mouse button on the main image window adds a keypoint to all curves from picked color.\n - Key R on a curve resets it.\n - Keys CTRL+D increase window size.\n - Keys CTRL+C decrease window size.\n - Keys CTRL+R resets window size.\n - Keys ESC, Q or ENTER close the current window. "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 09/28/2014.") +#@gui Customize CLUT:fx_customize_clut,fx_customize_clut_preview(1)+ +#@gui :Keypoint Influence (%)=float(100,0,100) +#@gui :Lock Uniform Sampling=choice{0,"None","8 Keypoints (RGB Corners)","27 Keypoints","64 Keypoints","125 Keypoints","216 Keypoints","343 Keypoints"} +#@gui :Spatial Regularization=int(10,0,30) +#@gui :_=separator() +#@gui :_=note("Global correction:") +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :Post-Normalize=bool(0) +#@gui :_=separator() +#@gui :Output Corresponding CLUT=_choice("Disable","512x512 Layer","4096x4096 Layer") +#@gui :Preview Type=choice{8,"Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Horizontal","Duplicate Vertical","HaldCLUT","3D CLUT (Fast)","3D CLUT (Precise)"} +#@gui :CLUT Opacity=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Color correspondences:") +#@gui :Action #1=choice(1,"Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #1=color(#000000) +#@gui :Target Color #1=color(#000000) +#@gui :_=separator() +#@gui :Action #2=choice(1,"Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #2=color(#ffffff) +#@gui :Target Color #2=color(#ffc480) +#@gui :_=separator() +#@gui :Action #3=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #3=color(#000000) +#@gui :Target Color #3=color(#000000) +#@gui :_=separator() +#@gui :Action #4=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #4=color(#000000) +#@gui :Target Color #4=color(#000000) +#@gui :_=separator() +#@gui :Action #5=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #5=color(#000000) +#@gui :Target Color #5=color(#000000) +#@gui :_=separator() +#@gui :Action #6=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #6=color(#000000) +#@gui :Target Color #6=color(#000000) +#@gui :_=separator() +#@gui :Action #7=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #7=color(#000000) +#@gui :Target Color #7=color(#000000) +#@gui :_=separator() +#@gui :Action #8=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #8=color(#000000) +#@gui :Target Color #8=color(#000000) +#@gui :_=separator() +#@gui :Action #9=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #9=color(#000000) +#@gui :Target Color #9=color(#000000) +#@gui :_=separator() +#@gui :Action #10=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #10=color(#000000) +#@gui :Target Color #10=color(#000000) +#@gui :_=separator() +#@gui :Action #11=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #11=color(#000000) +#@gui :Target Color #11=color(#000000) +#@gui :_=separator() +#@gui :Action #12=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #12=color(#000000) +#@gui :Target Color #12=color(#000000) +#@gui :_=separator() +#@gui :Action #13=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #13=color(#000000) +#@gui :Target Color #13=color(#000000) +#@gui :_=separator() +#@gui :Action #14=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #14=color(#000000) +#@gui :Target Color #14=color(#000000) +#@gui :_=separator() +#@gui :Action #15=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #15=color(#000000) +#@gui :Target Color #15=color(#000000) +#@gui :_=separator() +#@gui :Action #16=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #16=color(#000000) +#@gui :Target Color #16=color(#000000) +#@gui :_=separator() +#@gui :Action #17=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #17=color(#000000) +#@gui :Target Color #17=color(#000000) +#@gui :_=separator() +#@gui :Action #18=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #18=color(#000000) +#@gui :Target Color #18=color(#000000) +#@gui :_=separator() +#@gui :Action #19=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #19=color(#000000) +#@gui :Target Color #19=color(#000000) +#@gui :_=separator() +#@gui :Action #20=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #20=color(#000000) +#@gui :Target Color #20=color(#000000) +#@gui :_=separator() +#@gui :Action #21=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #21=color(#000000) +#@gui :Target Color #21=color(#000000) +#@gui :_=separator() +#@gui :Action #22=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #22=color(#000000) +#@gui :Target Color #22=color(#000000) +#@gui :_=separator() +#@gui :Action #23=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #23=color(#000000) +#@gui :Target Color #23=color(#000000) +#@gui :_=separator() +#@gui :Action #24=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #24=color(#000000) +#@gui :Target Color #24=color(#000000) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/14/06.") +#@gui Dark Sky:afre_darksky,afre_darksky_preview(1)+ +#@gui :_=note("Enhance landscape by darkening the sky.  Filter by afre 2017-2020 Sep9.\n\n") +#@gui :Blend=choice("Softlight","Overlay") +#@gui :Contrast=int(0,-100,100) +#@gui :Smooth=choice(1,"Fast (Approx.)","Slow (Accurate)") +#@gui :Radius=int(0,0,3) +#@gui :_=note("\n\nNote\n\nG'MIC's preview is inaccurate. Apply the filter and review the results in your host editor.\n\nE.g. Smooth(fast) may appear to cause artifacts when in fact it does not.") +#@gui Decompose Channels:fx_decompose_channels,fx_decompose_channels_preview +#@gui :Color Basis=choice(7,"RGB","HSV","HSL","HSI","YUV","YCbCr","XYZ","Lab","Lch","CMY","CMYK","YIQ") +#@gui :Action=choice("Decompose","Recompose") +#@gui :Output Multiple Layers=_bool(0) +#@gui :Include Opacity Layer=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/19/07.") +#@gui Detect Skin:fx_detect_skin,fx_detect_skin_preview(1) +#@gui :Skin Estimation=choice(1,"Manual","Automatic") +#@gui :_=separator() +#@gui :Tolerance=float(0.5,0,1) +#@gui :Smoothness=float(0.5,0,5) +#@gui :Threshold=float(1,0,10) +#@gui :Pre-Normalize Image=bool(1) +#@gui :_=separator() +#@gui :_=note("Manual estimation:\n Use the sliders below to target as much skin pixels as you can.") +#@gui :X-Coordinate=float(50,0,100) +#@gui :Y-Coordinate=float(50,0,100) +#@gui :Radius=float(5,0,25) +#@gui :_=separator() +#@gui :Output Mode=choice(1,"Probability Map","Opaque Skin","Transparent Skin") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/03/01.") +#@gui Equalize HSI-HSL-HSV:fx_equalize_hsv,fx_equalize_hsv_preview(0)+ +#@gui :Colorspace=choice(1,"HSI","HSL","HSV") +#@gui :Opacity (%)=float(100,0,100) +#@gui :Value Blending=float(0,0,64) +#@gui :Color Blending=float(0,0,64) +#@gui :_=separator() +#@gui :Preview Mapping=choice("None","Grey","Color") +#@gui :_=separator() +#@gui :_=note("Black:") +#@gui :Hue Offset=float(0,-180,180) +#@gui :Saturation Offset=float(0,-1,1) +#@gui :Value Offset=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("Near black:") +#@gui :Hue Offset=float(0,-180,180) +#@gui :Saturation Offset=float(0,-1,1) +#@gui :Value Offset=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("Dark grey:") +#@gui :Hue Offset=float(0,-180,180) +#@gui :Saturation Offset=float(0,-1,1) +#@gui :Value Offset=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("Mi-dark grey:") +#@gui :Hue Offset=float(0,-180,180) +#@gui :Saturation Offset=float(0,-1,1) +#@gui :Value Offset=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("Middle grey:") +#@gui :Hue Offset=float(0,-180,180) +#@gui :Saturation Offset=float(0,-1,1) +#@gui :Value Offset=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("Mid-light grey:") +#@gui :Hue Offset=float(0,-180,180) +#@gui :Saturation Offset=float(0,-1,1) +#@gui :Value Offset=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("Light grey:") +#@gui :Hue Offset=float(0,-180,180) +#@gui :Saturation Offset=float(0,-1,1) +#@gui :Value Offset=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("Highlights:") +#@gui :Hue Offset=float(0,-180,180) +#@gui :Saturation Offset=float(0,-1,1) +#@gui :Value Offset=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("White:") +#@gui :Hue Offset=float(0,-180,180) +#@gui :Saturation Offset=float(0,-1,1) +#@gui :Value Offset=float(0,-1,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé and David Revoy.       Latest Update: 2018/01/19.") +#@gui Equalize HSV:fx_hsv_equalizer,fx_hsv_equalizer_preview +#@gui :Preview Bands=bool(false) +#@gui :_=separator() +#@gui :Hue Band=float(180,0,360) +#@gui :Band Width=float(40,1,360) +#@gui :Hue Shift=float(0,-180,180) +#@gui :Saturation Correction=float(0,-0.99,0.99) +#@gui :Value Correction=float(0,-0.99,0.99) +#@gui :_=separator() +#@gui :Hue Band=float(180,0,360) +#@gui :Band Width=float(40,1,360) +#@gui :Hue Shift=float(0,-180,180) +#@gui :Saturation Correction=float(0,-0.99,0.99) +#@gui :Value Correction=float(0,-0.99,0.99) +#@gui :_=separator() +#@gui :Hue Band=float(180,0,360) +#@gui :Band Width=float(40,1,360) +#@gui :Hue Shift=float(0,-180,180) +#@gui :Saturation Correction=float(0,-0.99,0.99) +#@gui :Value Correction=float(0,-0.99,0.99) +#@gui :_=separator() +#@gui :_=note("Author: Jérome Ferrari.       Latest Update: 01/14/2011.") +#@gui :_=link("Filter explained here","http://www.flickr.com/groups/gmic/discuss/72157625798533482") +#@gui HSL Adjustment:gcd_hsl,gcd_hsl_preview(1) +#@gui :_=note("\nInput Saturation Settings") +#@gui :_=separator() +#@gui :Contrast=float(1,0,2) +#@gui :Level=float(0,-1,1) +#@gui :Auto Reduce Level (Level Slider Is Disabled)=bool(0) +#@gui :_=note("\nOutput Hue Settings") +#@gui :_=separator() +#@gui :Hue=float(180,0,360) +#@gui :Amount=float(0.2,0,1) +#@gui :Auto Set Hue Inverse (Hue Slider Is Disabled)=bool(0) +#@gui :_=note("\nOutput Luminance Settings") +#@gui :_=separator() +#@gui :Gamma=float(1,0,2) +#@gui :Contrast=float(1,0,2) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2015/05/15.") +#@gui HSV Select:gcd_hsv_select,gcd_hsv_select(2) +#@gui :_=note("Color Selection") +#@gui :_=separator() +#@gui :Hue=int(0,0,360) +#@gui :Saturation=float(0.5,0,1) +#@gui :Value=float(1,0,1) +#@gui :_=note("\nColor Range") +#@gui :_=separator() +#@gui :Hue Range=int(180,0,180) +#@gui :Sat Range=float(0.5,0,0.5) +#@gui :Val Range=float(0.5,0,0.5) +#@gui :_=note("\nOutput Options") +#@gui :_=separator() +#@gui :Grow Alpha=int(2,-20,20) +#@gui :Blur Alpha=int(2,0,20) +#@gui :_=note("\nAdvanced Options") +#@gui :_=separator() +#@gui :Patch Size=int(18,3,100) +#@gui :Fill Holes %=int(0,0,50) +#@gui :Min Area %=int(0,0,50) +#@gui :Show Watershed=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2013/02/11.") +#@gui Hue Lighten-Darken:iain_hue_light_dark_p,iain_hue_light_dark_p +#@gui :Red=float(0,-255,255) +#@gui :2=float(0,-255,255) +#@gui :3=float(0,-255,255) +#@gui :Yellow=float(0,-255,255) +#@gui :5=float(0,-255,255) +#@gui :6=float(0,-255,255) +#@gui :Green=float(0,-255,255) +#@gui :8=float(0,-255,255) +#@gui :Cyan=float(0,-255,255) +#@gui :10=float(0,-255,255) +#@gui :11=float(0,-255,255) +#@gui :Blue=float(0,-255,255) +#@gui :13=float(0,-255,255) +#@gui :14=float(0,-255,255) +#@gui :Magenta=float(0,-255,255) +#@gui :16=float(0,-255,255) +#@gui :17=float(0,-255,255) +#@gui :18=float(0,-255,255) +#@gui :_=separator() +#@gui :Global=float(0,-255,255) +#@gui :HSL=bool(0) +#@gui :_=separator() +#@gui :Sat Top=float(255,0,255) +#@gui :Sat Bottom=float(100,0,255) +#@gui :Value Top=float(255,0,255) +#@gui :Value Bottom=float(0,0,255) +#@gui :_=separator() +#@gui :B&W=bool(0) +#@gui :_=separator() +#@gui :Parallel Processing=choice(0,"Auto","Off") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. Update: 4 March 2014 - Added parallel processing option") +#@gui Local Contrast:afre_localcontrast,afre_localcontrast_preview(1)+ +#@gui :_=note("Enhance local contrast.  Filter by afre 2020 Jul28-Sep5.\n\n") +#@gui :Radius=int(1,1,10) +#@gui :Amount=int(50,-100,100) +#@gui :_=note("\n\nNote\n\nG'MIC's preview is inaccurate. Apply the filter and review the results in your host editor.") +#@gui Metallic Look:fx_tk_metallic,fx_tk_metallic_preview(1) +#@gui :Strength=float(1,0,1) +#@gui :Smoothness=float(0,0,20) +#@gui :Metal=choice("Silver","Gold","Copper","Bronze","Blue Steel") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Tom Keil. Latest update: 2011/12/04.") +#@gui Mixer [CMYK]:fx_mix_cmyk,fx_mix_cmyk_preview(1)+ +#@gui :Cyan Factor=float(1,0,4) +#@gui :Cyan Shift=float(0,-255,255) +#@gui :Cyan Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Magenta Factor=float(1,0,4) +#@gui :Magenta Shift=float(0,-255,255) +#@gui :Magenta Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Yellow Factor=float(1,0,4) +#@gui :Yellow Shift=float(0,-255,255) +#@gui :Yellow Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Key Factor=float(1,0,4) +#@gui :Key Shift=float(0,-255,255) +#@gui :Key Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/06.") +#@gui Mixer [HSV]:fx_mix_hsv,fx_mix_hsv_preview(1)+ +#@gui :Hue Factor=float(1,0,4) +#@gui :Hue Shift=float(0,-180,180) +#@gui :Hue Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Saturation Factor=float(1,0,4) +#@gui :Saturation Shift=float(0,-1,1) +#@gui :Saturation Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Value Factor=float(1,0,4) +#@gui :Value Shift=float(0,-1,1) +#@gui :Value Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/06.") +#@gui Mixer [Lab]:fx_mix_lab,fx_mix_lab_preview(1)+ +#@gui :Lightness Factor=float(1,0.5,1.5) +#@gui :Lightness Shift=float(0,-50,50) +#@gui :Lightness Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :A-Color Factor=float(1,0,4) +#@gui :A-Color Shift=float(0,-20,20) +#@gui :A-Color Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :B-Color Factor=float(1,0,4) +#@gui :B-Color Shift=float(0,-20,20) +#@gui :B-Color Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/06.") +#@gui Mixer [PCA]:fx_mix_pca,fx_mix_pca_preview(1)+ +#@gui :Primary Factor=float(0,-1.5,1.5) +#@gui :Primary Shift=float(0,-255,255) +#@gui :Primary Twist=float(0,-180,180) +#@gui :Primary Gamma=float(0,-100,100) +#@gui :_=separator() +#@gui :Secondary Factor=float(0,-1.5,1.5) +#@gui :Secondary Shift=float(0,-255,255) +#@gui :Secondary Twist=float(0,-180,180) +#@gui :Secondary Gamma=float(0,-100,100) +#@gui :_=separator() +#@gui :Tertiary Factor=float(0,-1.5,1.5) +#@gui :Tertiary Shift=float(0,-255,255) +#@gui :Tertiary Twist=float(0,-180,180) +#@gui :Tertiary Gamma=float(0,-100,100) +#@gui :_=separator() +#@gui :Display Color Axes=bool(1) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=value(0,0,0,0,0,0,0,0,0,0,0,0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/07/18.") +#@gui Mixer [RGB]:fx_mix_rgb,fx_mix_rgb_preview(1)+ +#@gui :Red Factor=float(1,0,4) +#@gui :Red Shift=float(0,-255,255) +#@gui :Red Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Green Factor=float(1,0,4) +#@gui :Green Shift=float(0,-255,255) +#@gui :Green Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Blue Factor=float(1,0,4) +#@gui :Blue Shift=float(0,-255,255) +#@gui :Blue Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/06.") +#@gui Mixer [YCbCr]:fx_mix_ycbcr,fx_mix_ycbcr_preview(1)+ +#@gui :Luminance Factor=float(1,0,4) +#@gui :Luminance Shift=float(0,-255,255) +#@gui :Luminance Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Blue Chroma Factor=float(1,0,4) +#@gui :Blue Chroma Shift=float(0,-255,255) +#@gui :Blue Chroma Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Red Chroma Factor=float(1,0,4) +#@gui :Red Chroma Shift=float(0,-255,255) +#@gui :Red Chroma Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/06.") +#@gui Random Color Transformation:fx_random_color_transformation,fx_random_color_transformation_preview(1)+ +#@gui :Seed=float(0,0,100000) +#@gui :Randomize Seed=button() +#@gui :_=value(1) +#@gui :_=separator() +#@gui :Amplitude (%)=float(100,0,100) +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2023/03/10.") +#@gui Retinex:fx_retinex,fx_retinex_preview(0)+ +#@gui :Strength (%)=float(75,0,100) +#@gui :Value Offset=float(16,1,256) +#@gui :Colorspace=choice(1,"HSI","HSV","Lab","Linear RGB","RGB","YCbCr") +#@gui :Min Cut (%)=float(1,0,100) +#@gui :Max Cut (%)=float(1,0,100) +#@gui :Regularization=float(5,0,32) +#@gui :_=separator() +#@gui :Low Scale=float(15,1,512) +#@gui :Middle Scale=float(80,1,512) +#@gui :High Scale=float(250,1,512) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Note: This filter implements the Multiscale Color Retinex algorithm, as described in:") +#@gui :_=link("http://www.ipol.im/pub/art/2014/107/") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/13/09.") +#@gui Retro Fade:fx_retrofade,fx_retrofade_preview +#@gui :Iterations=int(20,1,64) +#@gui :Colors=int(6,2,32) +#@gui :Grain=float(40,1,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/25/10.") +#@gui RGB Tone:iain_rgb_tone,iain_rgb_tone +#@gui :_=note("Adjust Reds for pixels that have:") +#@gui :Little Red=float(0,-255,255) +#@gui :Some Red=float(0,-255,255) +#@gui :Much Red=float(0,-255,255) +#@gui :_=note("Adjust Reds for pixels that have:") +#@gui :Little Green=float(0,-255,255) +#@gui :Some Green=float(0,-255,255) +#@gui :Much Green=float(0,-255,255) +#@gui :_=note("Adjust Reds for pixels that have:") +#@gui :Little Blue=float(0,-255,255) +#@gui :Some Blue=float(0,-255,255) +#@gui :Much Blue=float(0,-255,255) +#@gui :_=separator(xx) +#@gui :_=note("Adjust Greens for pixels that have:") +#@gui :Little Red=float(0,-255,255) +#@gui :Some Red=float(0,-255,255) +#@gui :Much Red=float(0,-255,255) +#@gui :_=note("Adjust Greens for pixels that have:") +#@gui :Little Green=float(0,-255,255) +#@gui :Some Green=float(0,-255,255) +#@gui :Much Green=float(0,-255,255) +#@gui :_=note("Adjust Greens for pixels that have:") +#@gui :Little Blue=float(0,-255,255) +#@gui :Some Blue=float(0,-255,255) +#@gui :Much Blue=float(0,-255,255) +#@gui :_=separator() +#@gui :_=note("Adjust Blues for pixels that have:") +#@gui :Little Red=float(0,-255,255) +#@gui :Some Red=float(0,-255,255) +#@gui :Much Red=float(0,-255,255) +#@gui :_=note("Adjust Blues for pixels that have:") +#@gui :Little Green=float(0,-255,255) +#@gui :Some Green=float(0,-255,255) +#@gui :Much Green=float(0,-255,255) +#@gui :_=note("Adjust Blues for pixels that have:") +#@gui :Little Blue=float(0,-255,255) +#@gui :Some Blue=float(0,-255,255) +#@gui :Much Blue=float(0,-255,255) +#@gui :_=separator() +#@gui :_=note("Strength of effect for Saturation level:") +#@gui :None=float(255,0,255) +#@gui :Little=float(255,0,255) +#@gui :Some=float(255,0,255) +#@gui :Much=float(255,0,255) +#@gui :Most=float(255,0,255) +#@gui :_=separator() +#@gui :Output=choice(0,"Perserve Luminance","Clip","Scale") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson.") +#@gui Saturation EQ:Saturation_EQ_p,Saturation_EQ_p +#@gui :_=note("Lightness") +#@gui :Black=float(0,-128,128) +#@gui :Near Black=float(0,-128,128) +#@gui :Dark Grey=float(0,-128,128) +#@gui :Mid-Dark Grey=float(0,-128,128) +#@gui :Middle Grey=float(0,-128,128) +#@gui :Mid-Light Grey=float(0,-128,128) +#@gui :Light Grey=float(0,-128,128) +#@gui :Highlights=float(0,-128,128) +#@gui :White=float(0,-128,128) +#@gui :_=separator() +#@gui :_=note("Hue") +#@gui :0=float(0,-128,128) +#@gui :45=float(0,-128,128) +#@gui :90=float(0,-128,128) +#@gui :135=float(0,-128,128) +#@gui :180=float(0,-128,128) +#@gui :225=float(0,-128,128) +#@gui :270=float(0,-128,128) +#@gui :315=float(0,-128,128) +#@gui :360=float(0,-128,128) +#@gui :Rotate Hue Bands=float(0,-45,45) +#@gui :_=separator() +#@gui :Parallel Processing=choice(0,"Auto","Off") +#@gui :_=separator() +#@gui :_=note("This filter allows you to adjust the Saturation based on the Lightness or Hue of the pixel. The Rotate Hue Bands control allows you shift the hue that each band controls by 45 degrees.") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. Update: 4 March 2014 - Added parallel processing option") +#@gui Select-Replace Color:fx_select_color,fx_select_color_preview(0) +#@gui :Similarity Space=choice(0,"RGB[A]","RGB","YCbCr","Red","Green","Blue","Opacity","Luminance","Blue & Red Chrominances","Hue","Saturation") +#@gui :Tolerance=float(20,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Fill Holes=int(0,0,256) +#@gui :Selected Color=color(#ffffffff) +#@gui :Output As=choice(0,"Selected Colors","Selected Mask","Rejected Colors","Rejected Mask","Replaced Color") +#@gui :Replacement Color=color(#ff0000ff) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Selective Desaturation:fx_selective_desaturation,fx_selective_desaturation_preview(1) +#@gui :Reference Color=color(#ffffff) +#@gui :Desaturate=choice("Reference Color","All but Reference Color") +#@gui :Strength=float(3,0,10) +#@gui :Regularization=int(0,0,20) +#@gui :Maximum Saturation=choice("From Input","From Reference Color","Maximum Value") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/15/07.") +#@gui Sepia:fx_sepia,fx_sepia_preview(1)+ +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Simulate Film:fx_simulate_film,fx_simulate_film_preview(1)+ +#@gui :Category=choice{"Black & White (25)","Instant [Consumer] (54)","Instant [Pro] (68)","Fuji XTrans III (15)","Negative [Color] (13)","Negative [New] (39)","Negative [Old] (44)","Print Films (12)","Slide [Color] (26)"} +#@gui :Preset=choice{1,"All [Collage]","None","Agfa APX 100","Agfa APX 25","Fuji Neopan 1600","Fuji Neopan Acros 100","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","Kodak BW 400 CN","Kodak HIE (HS Infra)","Kodak T-Max 100","Kodak T-Max 3200","Kodak T-Max 400","Kodak Tri-X 400","Polaroid 664","Polaroid 667","Polaroid 672","Rollei IR 400","Rollei Ortho 25","Rollei Retro 100 Tonal","Rollei Retro 80s"}_2 +#@gui :Preset=choice{1,"All [Collage]","None","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 +","Polaroid PX-680 Cold ++","Polaroid PX-680 Cold ++a","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"}_0 +#@gui :Preset=choice{1,"All [Collage]","None","Fuji FP-100c --","Fuji FP-100c -","Fuji FP-100c","Fuji FP-100c (alt)","Fuji FP-100c +","Fuji FP-100c ++","Fuji FP-100c ++a","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 ++","Fuji FP-100c Negative ++a","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","Polaroid 665 --","Polaroid 665 -","Polaroid 665","Polaroid 665 +","Polaroid 665 ++","Polaroid 665 Negative -","Polaroid 665 Negative","Polaroid 665 Negative +","Polaroid 665 Negative HC","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 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 ++"}_0 +#@gui :Preset=choice(1,"All [Collage]","None","Acros","Acros+G","Acros+R","Acros+Ye","Astia","Classic Chrome","Mono","Mono+G","Mono+R","Mono+Ye","Pro Neg Hi","Pro Neg Std","Provia","Sepia","Velvia")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Agfa Ultra Color 100","Agfa Vista 200","Fuji Superia 200","Fuji Superia HG 1600","Fuji Superia Reala 100","Fuji Superia X-Tra 800","Kodak Ektar 100","Kodak Elite 100 XPRO","Kodak Elite Color 200","Kodak Elite Color 400","Kodak Portra 160 NC","Kodak Portra 160 VC","Lomography Redscale 100")_0 +#@gui :Preset=choice{1,"All [Collage]","None","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 Ilford HP5 -","Fuji Ilford HP5","Fuji Ilford HP5 +","Fuji Ilford HP5 ++","Kodak Portra 160 -","Kodak Portra 160","Kodak Portra 160 +","Kodak Portra 160 ++","Kodak Portra 400 -","Kodak Portra 400","Kodak Portra 400 +","Kodak Portra 400 ++","Kodak Portra 800 -","Kodak Portra 800","Kodak Portra 800 +","Kodak Portra 800 ++","Kodak Portra 800 HC","Kodak T-MAX 3200 -","Kodak T-MAX 3200","Kodak T-MAX 3200 +","Kodak T-MAX 3200 ++","Kodak T-MAX 3200 (alt)","Kodak TRI-X 400 -","Kodak TRI-X 400","Kodak TRI-X 400 +","Kodak TRI-X 400 ++","Kodak TRI-X 400 (alt)"}_0 +#@gui :Preset=choice(1,"All [Collage]","None","Fuji Ilford Delta 3200 -","Fuji Ilford Delta 3200","Fuji Ilford Delta 3200 +","Fuji Ilford Delta 3200 ++","Fuji Neopan 1600 -","Fuji Neopan 1600","Fuji Neopan 1600 +","Fuji Neopan 1600 ++","Fuji Superia 100 -","Fuji Superia 100","Fuji Superia 100 +","Fuji Superia 100 ++","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 1600 -","Fuji Superia 1600","Fuji Superia 1600 +","Fuji Superia 1600 ++","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 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 ++")_0 +#@gui :Preset=choice{1,"All [Collage]","None","Fuji 3510 (Constlclip)","Fuji 3510 (Constlmap)","Fuji 3510 (Cuspclip)","Fuji 3513 (Constlclip)","Fuji 3513 (Constlmap)","Fuji 3513 (Cuspclip)","Kodak 2383 (Constlclip)","Kodak 2383 (Constlmap)","Kodak 2383 (Cuspclip)","Kodak 2393 (Constlclip)","Kodak 2393 (Constlmap)","Kodak 2393 (Cuspclip)"}_0 +#@gui :Preset=choice(1,"All [Collage]","None","Agfa Precisa 100","Fuji Astia 100F","Fuji FP 100C","Fuji Provia 100F","Fuji Provia 400F","Fuji Provia 400X","Fuji Sensia 100","Fuji Superia 200 XPRO","Fuji Velvia 50","Generic Fuji Astia 100","Generic Fuji Provia 100","Generic Fuji Velvia 100","Generic Kodachrome 64","Generic Kodak Ektachrome 100 VS","Kodak E-100 GX Ektachrome 100","Kodak Ektachrome 100 VS","Kodak Elite Chrome 200","Kodak Elite Chrome 400","Kodak Elite ExtraColor 100","Kodak Kodachrome 200","Kodak Kodachrome 25","Kodak Kodachrome 64","Lomography X-Pro Slide 200","Polaroid 669","Polaroid 690","Polaroid Polachrome")_0 +#@gui :Thumbnail Size=int(512,0,1024)_1 +#@gui :_=separator() +#@gui :Strength (%)=float(100,0,100) +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :Normalize Colors=choice("None","Pre-Normalize","Post-Normalize","Both") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Note: The color LUTs proposed in this filter come from various free sources :") +#@gui :_=note("* RawTherapee Film Simulation.") +#@gui :_=note("* Pat David Film Emulation. ") +#@gui :_=note("* Fuji Film Simulation Profiles.") +#@gui :_=note("* Print Film LUTs For Download. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/02/27.") +#@gui Softlight:afre_softlight,afre_softlight_preview(1)+ +#@gui :_=note("Blend image with itself or another image using softlight.  Filter by afre 2019-2020 Sept9.\n\n") +#@gui :Amount=int(50,-100,100) +#@gui :Reverse Order=bool(0) +#@gui :_=note("\n\nHint\n\nUse the  Input layers  menu to select the layer(s) you would like to blend.") +#@gui :_=note("\nNote\n\nG'MIC's preview is inaccurate. Apply the filter and review the results in your host editor.") +#@gui Specific Saturation:gcd_hio_levels,gcd_hio_levels_preview(1) +#@gui :_=note("\nHue Levels") +#@gui :_=separator() +#@gui :Input=float(1,0,2) +#@gui :Opposing=float(1,0,2) +#@gui :Hue=int(39,0,360) +#@gui :Level=float(0,-0.5,0.5) +#@gui :_=note("\nLuma Levels") +#@gui :_=separator() +#@gui :Gamma=float(1,0.2,1.8) +#@gui :Contrast=float(1,0.2,1.8) +#@gui :SRGB Conversion=bool(0) +#@gui :Process Top Layer Only=bool(0) +#@gui :_=separator() +#@gui :Preview=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Horizontal","Duplicate Vertical","Blend All Layers") +#@gui :_=value(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2016/01/22.") +#@gui Tone Presets:iain_tone_presets_p,iain_tone_presets_p +#@gui :Preset=choice("Whiter Whites","Warm Vintage","Magenta-Yellow","Velvetia","Seventies Magazine","Faded Print","Expired 69","Modern Film") +#@gui :Strength=float(100,-200,200) +#@gui :Scale Output=bool(0) +#@gui :_=separator() +#@gui :Parallel Processing=choice(0,"Auto","Off") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. Update: 4 March 2014 - Added parallel processing option") +#@gui Transfer Colors [Histogram]:fx_transfer_histogram,fx_transfer_histogram_preview(1)+ : * +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Reference Colors=choice("Bottom Layer","Top Layer") +#@gui :_=separator() +#@gui :Preview Ref Point=point(1,1,0,0,255,255,255,128,4)_0 +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Note: This filter needs at least two layers to work properly. Set the Input layers option to handle multiple input layers. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/01/13.") +#@gui Transfer Colors [Patch-Based]:fx_gcd_transfer_colors_patch,fx_gcd_transfer_colors_patch_preview(1) +#@gui :_=note("Generate a CLUT and apply it to other images.") +#@gui :_=note("\nInput Options") +#@gui :_=separator() +#@gui :Resolution=int(6,2,8) +#@gui :Smooth=float(3,0,10) +#@gui :Iters=int(5,0,20) +#@gui :Random=int(5,0,20) +#@gui :_=note("\nOutput Options") +#@gui :_=separator() +#@gui :Reference=choice("Top Layer","Bottom Layer") +#@gui :Output CLUT=_choice("Disable","512x512 Layer","4096x4096 Layer") +#@gui :_=note("\n") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2017/08/17.") +#@gui :_=note("\nNotes") +#@gui :_=note("Set the Input layers option to transfer colors to other layers.") +#@gui :_=note("If only one input layer is selected a CLUT is always output.") +#@gui :_=note("Higher resolution, iters, or random generally produce better results - at the cost of processing time.") +#@gui :_=note("Results are not necessarily the same every time due to the random based algorithm.") +#@gui Transfer Colors [PCA]:fx_transfer_pca,fx_transfer_pca_preview(1)+ : * +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Reference Colors=choice("Bottom Layer","Top Layer") +#@gui :_=separator() +#@gui :Preview Ref Point=point(1,1,0,0,255,255,255,128,4)_0 +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Note: This filter needs at least two layers to work properly. Set the Input layers option to handle multiple input layers. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/01/13.") +#@gui Transfer Colors [Variational]:fx_transfer_rgb,fx_transfer_rgb_preview(1)+ : * +#@gui :Regularization=int(8,0,32) +#@gui :Preserve Luminance=float(0.2,0,1) +#@gui :Precision=_choice(1,"Low","Normal","High","Very High") +#@gui :Reference Colors=choice("Bottom Layer","Top Layer") +#@gui :Add User-Defined Constraints (Interactive)=_bool(0) +#@gui :_=separator() +#@gui :Preview Ref Point=point(1,1,0,0,255,255,255,128,4)_0 +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Instructions:\n - This filter transfers the colors of one layer to all the others.\n - Don't forget to set the Input layers... option on the left to manage your input layers.\n ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/04/04.") +#@gui Tune HSV Colors:fx_tune_hsv,fx_tune_hsv_preview(1) +#@gui :Dark=choice(2,"Ignore","Lock","Remap") +#@gui :Dark Color=color(#000000) +#@gui :Target Hue (%)=float(100,0,100) +#@gui :Target Saturation (%)=float(100,0,100) +#@gui :Target Value (%)=float(100,0,100) +#@gui :_=separator() +#@gui :Light=choice(2,"Ignore","Lock","Remap") +#@gui :Light Color=color(#ffffff) +#@gui :Target Hue (%)=float(100,0,100) +#@gui :Target Saturation (%)=float(100,0,100) +#@gui :Target Value (%)=float(100,0,100) +#@gui :_=separator() +#@gui :Average=choice(1,"Ignore","Lock","Remap") +#@gui :Average Color=color(#808080)_0 +#@gui :Target Hue (%)=float(0,0,100)_0 +#@gui :Target Saturation (%)=float(50,0,100)_0 +#@gui :Target Value (%)=float(100,0,100)_0 +#@gui :_=separator() +#@gui :Red=choice("Ignore","Lock","Remap") +#@gui :Red Color=color(#ff0000)_0 +#@gui :Target Hue (%)=float(100,0,100)_0 +#@gui :Target Saturation (%)=float(12.5,0,100)_0 +#@gui :Target Value (%)=float(0,0,100)_0 +#@gui :_=separator() +#@gui :Yellow=choice("Ignore","Lock","Remap") +#@gui :Yellow Color=color(#ffff00)_0 +#@gui :Target Hue (%)=float(100,0,100)_0 +#@gui :Target Saturation (%)=float(12.5,0,100)_0 +#@gui :Target Value (%)=float(0,0,100)_0 +#@gui :_=separator() +#@gui :Green=choice("Ignore","Lock","Remap") +#@gui :Green Color=color(#00ff00)_0 +#@gui :Target Hue (%)=float(100,0,100)_0 +#@gui :Target Saturation (%)=float(12.5,0,100)_0 +#@gui :Target Value (%)=float(0,0,100)_0 +#@gui :_=separator() +#@gui :Cyan=choice("Ignore","Lock","Remap") +#@gui :Cyan Color=color(#00ffff)_0 +#@gui :Target Hue (%)=float(100,0,100)_0 +#@gui :Target Saturation (%)=float(12.5,0,100)_0 +#@gui :Target Value (%)=float(0,0,100)_0 +#@gui :_=separator() +#@gui :Blue=choice("Ignore","Lock","Remap") +#@gui :Blue Color=color(#0000ff)_0 +#@gui :Target Hue (%)=float(100,0,100)_0 +#@gui :Target Saturation (%)=float(12.5,0,100)_0 +#@gui :Target Value (%)=float(0,0,100)_0 +#@gui :_=separator() +#@gui :Magenta=choice("Ignore","Lock","Remap") +#@gui :Magenta Color=color(#ff00ff)_0 +#@gui :Target Hue (%)=float(100,0,100)_0 +#@gui :Target Saturation (%)=float(12.5,0,100)_0 +#@gui :Target Value (%)=float(0,0,100)_0 +#@gui :_=separator() +#@gui :Preview Color Mapping=choice(2,"None","Center","Top Left","Top Right","Bottom Left","Bottom Right") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/12/17.") +#@gui User-Defined:fx_custom_transform,fx_custom_transform +#@gui :Red - Green - Blue - Alpha=text("i") +#@gui :Red - Green - Blue=text{"i + 90*(x/w)*cos(i/10)"} +#@gui :Red=text("i") +#@gui :Green=text("i") +#@gui :Blue=text("i") +#@gui :Alpha=text("i") +#@gui :Value Normalization=choice("None","RGB","RGBA") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Vibrance:fx_vibrance,fx_vibrance_preview(1)+ +#@gui :Strength=float(0.5,-1,3) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Age / Pixls.us.      Latest Update: 2022/06/28.") +#@gui Vintage Style:fx_tk_vintage,fx_tk_vintage_preview(1) +#@gui :Exposure=float(2,-5,5) +#@gui :Contrast=float(0.85,0.5,1.5) +#@gui :Saturation=float(0.7,0,4) +#@gui :Shadows Threshold=float(80,0,128) +#@gui :Highlights Threshold=float(200,128,255) +#@gui :Transition Smoothness=float(5,0,50) +#@gui :_=separator() +#@gui :Color Shadows=color(#931aa1) +#@gui :Strength Shadows=float(0.3,0,1) +#@gui :Color Midtones=color(#ebdcb0) +#@gui :Strength Midtones=float(0.4,0,1) +#@gui :Color Highlights=color(#beb56c) +#@gui :Strength Highlights=float(0.2,0,1) +#@gui :Color Overall Effect=color(#000064) +#@gui :Color Effect Mode=choice("Exclusion","Overlay","Soft Light","Multiply","Screen") +#@gui :Strength Effect=float(0.3,0,1) +#@gui :_=separator() +#@gui :Vignette Size=float(25,0,100) +#@gui :Vignette Strenth=float(0,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical") +#@gui :_=separator() +#@gui :_=note("Author : Tom Keil. Latest update: 2011/04/06.") +#@gui Zone System:fx_zonesystem,fx_zonesystem_preview(1) +#@gui :Shadows Zone=int(1,1,5) +#@gui :Highlights Zone=int(10,6,10) +#@gui :Gamma=float(1,0,5) +#@gui :Contrast=float(1,0,4) +#@gui :Black Point=int(0,0,255) +#@gui :White Point=int(255,0,255) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Tom Keil. Latest update: 2011/13/02.") +#@gui _Contours +#@gui Convolve:fx_convolve,fx_convolve_preview(0) +#@gui :Kernel=choice("Custom","Average 3x3","Average 5x5","Average 7x7","Average 9x9","Prewitt-X","Prewitt-Y","Sobel-X","Sobel-Y","Rotinv-X","Rotinv-Y","Laplacian","Robert Cross 1","Robert Cross 2","Impulses 5x5","Impulses 7x7","Impulses 9x9") +#@gui :Boundary=choice(1,"Dirichlet","Neumann") +#@gui :_=separator() +#@gui :_=note("Note: If parameter Kernel is set to Custom, it uses the custom convolution kernel defined below. Use commas and semicolons as separators for res. matrix columns and rows. ") +#@gui :Custom Kernel=text("0,1,0;1,-4,1;0,1,0") +#@gui :_=separator() +#@gui :_=note("Note: Kernel multiplier is useful only when parameter Value range is set to Cut.") +#@gui :Value Range=choice(1,"Cut","Normalize") +#@gui :Kernel Multiplier=float(1,0,50) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/06/06.") +#@gui Curvature:fx_curvature,fx_curvature_preview(0) +#@gui :Smoothness=float(2,0,10) +#@gui :Min Threshold=float(0,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Absolute Value=bool(0) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Difference of Gaussians:fx_dog,fx_dog_preview(1)* +#@gui :1st Variance=float(1.4,0,5) +#@gui :2nd Variance=float(1.5,0,5) +#@gui :Threshold=float(0,0,49) +#@gui :Negative Colors=bool(0) +#@gui :Monochrome=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Distance Transform:fx_distance,fx_distance_preview(0) +#@gui :Value=int(128,0,255) +#@gui :Metric=choice(2,"Chebyshev","Manhattan","Euclidean","Squared-Euclidean") +#@gui :Normalization=choice(2,"Cut","Normalize","Modulo") +#@gui :Modulo Value=int(32,1,255) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/07/04.") +#@gui Edge:afre_edge,afre_edge_preview(0)+ +#@gui :_=note("Compute edge.  Filter by afre 2019-2020 May3.\n\n") +#@gui :Method=choice(0,"Gradient","Standard Deviation") +#@gui :Thinning=int(1,1,10) +#@gui :Recovery=float(1,0.5,4) +#@gui :Brightness=float(1,0.5,4) +#@gui :Details=float(1,0.5,4) +#@gui Edges:fx_edges,fx_edges_preview(0) +#@gui :Smoothness=float(0,0,10) +#@gui :Threshold=float(15,0,50) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Edges Offsets:fx_edge_offsets,fx_edge_offsets_preview(0) +#@gui :Smoothness=float(0,0,10) +#@gui :Threshold=float(15,0,50) +#@gui :Scale=int(4,0,32) +#@gui :Thickness=int(1,0,16) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Extract Foreground [Interactive]:fx_extract_foreground,gui_no_preview +#@gui :Feathering=_float(0,0,4) +#@gui :Dilation=int(0,-32,32) +#@gui :Output Mode=choice{3,"RGBA Image (Full-Transparency / 1 Layer)","RGBA Image (Updatable / 1 Layer)","RGB Image + Binary Mask (2 Layers)","RGBA Foreground + Background (2 Layers)"} +#@gui :View Resolution=_choice{1,"Small (Faster)","Medium","High (Slower)","Very High (Even Slower)"} +#@gui :_=separator() +#@gui :_=note("Description:\n This filter allows to quickly extract foreground objects from background in opaque RGB images. Click on the Apply or OK buttons below to open the interactive window and start adding foreground and background control points. When you're done, exit the interactive window: your extracted foreground will be transferred back to the host software.\n\n If you are not satisfied with the result, click on Apply once again to modify your control points defined previously. To remove all control points, click on the Reset button above. ") +#@gui :_=value(0,0) +#@gui :_=value(-1) +#@gui :_=separator() +#@gui :_=note{"Interactions:\n Use the following actions in the interactive window to build your extraction mask :\n\n - Left mouse button or key F create a new foreground control point (or move an existing one).\n - Right mouse button or key B create a new background control point (or move an existing one).\n - Mouse wheel, or keys CTRL+arrows UP/DOWN zoom view in/out.\n - Key SPACE updates the extraction mask.\n - Key TAB toggles background view modes.\n - Key M toggles marker view modes.\n - Key BACKSPACE deletes the last control point added.\n - Key PAGE UP increases background opacity.\n - Key PAGE DOWN decreases background opacity.\n - Keys CTRL+D increase window size.\n - Keys CTRL+C decrease window size.\n - Keys CTRL+R reset window size.\n - Keys ESC, Q or ENTER exit the interactive window. "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/29/09.") +#@gui Gradient Norm:fx_gradient_norm,fx_gradient_norm_preview(0) +#@gui :Smoothness=float(0,0,10) +#@gui :Linearity=float(0.5,0,1.5) +#@gui :Min Threshold=float(0,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Gradient RGB:fx_gradient2rgb,fx_gradient2rgb_preview(0) +#@gui :Smoothness=float(0,0,10) +#@gui :Min Threshold=float(0,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Orientation Only=bool(0) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Isophotes:fx_isophotes,fx_isophotes_preview(0) +#@gui :Levels=int(8,1,256) +#@gui :Smoothness=float(0,0,5) +#@gui :Filling=choice(1,"Transparent","Colors") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Laplacian:fx_laplacian,fx_laplacian_preview(0) +#@gui :Smoothness=float(0,0,10) +#@gui :Min Threshold=float(0,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Absolute Value=bool(0) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Local Orientation:fx_local_orientation,fx_local_orientation_preview(1) +#@gui :Smoothness=float(0,0,5) +#@gui :Min Threshold=float(0,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Morphological Filter:fx_morphological,fx_morphological_preview(0) +#@gui :Action=choice{"Erosion","Dilation","Opening","Closing","Original - Erosion","Dilation - Original","Original - Opening","Closing - Original","Original - (Opening + Closing)/2","Closing - Opening"} +#@gui :Kernel=choice(0,"Square","Octagonal","Circular","Custom") +#@gui :Size=int(5,2,60) +#@gui :_=note("Parameter Size is inactive for Custom kernel.") +#@gui :Custom Kernel=text("1,0,1; 0,1,0; 1,0,1") +#@gui :Negative=bool() +#@gui :Process Transparency=bool(0) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Stretch") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/22/06.") +#@gui Segmentation:fx_segment_watershed,fx_segment_watershed_preview(0) +#@gui :Edge Threshold=float(2,0,15) +#@gui :Smoothness=float(1,0,5) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Skeleton:fx_skeleton,fx_skeleton_preview(1) +#@gui :Method=choice{"Distance (Fast)","Thinning (Slow)"} +#@gui :Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/07/04.") +#@gui Super-Pixels:fx_superpixels,fx_superpixels_preview(0) +#@gui :Size=int(16,4,64) +#@gui :Regularity=float(10,0,128) +#@gui :Iterations=int(5,1,16) +#@gui :Colors=choice(1,"Random","Average") +#@gui :Border Opacity=float(1,0,1) +#@gui :Border Color=color(#000000ff) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/11/16.") +#@gui Thin Edges:fx_thin_edges,fx_thin_edges_preview(0) +#@gui :Smoothness=float(0,0,10) +#@gui :Threshold=float(15,0,50) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui _Deformations +#@gui Breaks:fx_breaks,fx_breaks(0) +#@gui :Type=choice("Flat","Relief") +#@gui :Amplitude=float(30,0,300) +#@gui :Frequency (%)=float(30,0,100) +#@gui :Smoothness=float(0.5,0,10) +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/09/09.") +#@gui Cartesian Transform:fx_custom_deformation,fx_custom_deformation(1) +#@gui :X-Warping=text{"(w+h)/20 * cos(y*20/h)"} +#@gui :Y-Warping=text{"(w+h)/20 * sin(x*20/w)"} +#@gui :Relative Warping=bool(1) +#@gui :Interpolation=choice(1,"Nearest Neighbor","Linear") +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Circle Transform:fx_circle_transform,fx_circle_transform_preview(1) +#@gui :Center (%)=point(50,50,0,1) +#@gui :Radius=point(75,50,0,1) +#@gui :X-Scale=float(-2,-16,16) +#@gui :Y-Scale=float(-2,-16,16) +#@gui :Symmetry=choice("None","Inside","Outside") +#@gui :Interpolation=choice(1,"Nearest Neighbor","Linear") +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :Preview Reference Circle=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/08/01.") +#@gui Conformal Maps:fx_conformal_maps,fx_conformal_maps_preview(1) +#@gui :Mapping=choice{8,"Custom Formula","Z","(z+1)/(z-1)","Cos(z)","Sin(z)","Tan(z)","Exp(z)","Log(z)","Dipole: 1/(4*z^2-1)","Star: -5*(z^3/3-Z/4)/2"} +#@gui :Exponent (Real)=float(1,-16,16) +#@gui :Exponent (Imaginary)=float(0,-16,16) +#@gui :Custom Formula=text{1,"((1.1 + i*z/6)/(1.04 - i*z/6))^6.2"} +#@gui :_=separator() +#@gui :Zoom=float(0,-4,4) +#@gui :Angle=float(0,-180,180) +#@gui :Aspect Ratio=float(0,-1,1) +#@gui :X-Shift=float(0,-5,5) +#@gui :Y-Shift=float(0,-5,5) +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :Anti-Aliasing=int(0,0,3) +#@gui :_=separator() +#@gui :Specify Different Output Size=_bool(0) +#@gui :Output Width=_text("1024") +#@gui :Output Height=_text("1024") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/15/02.") +#@gui Continuous Droste:souphead_droste10,souphead_droste10_preview(1) +#@gui :Inner Radius=float(40,1,100) +#@gui :Outer Radius=float(100,1,100) +#@gui :Periodicity=float(1,-6,6) +#@gui :Strands=int(1,-6,6) +#@gui :Zoom=int(1,1,100) +#@gui :Rotate=int(0,-360,360) +#@gui :X-Shift=int(0,-100,100) +#@gui :Y-Shift=int(0,-100,100) +#@gui :Center X-Shift=int(0,-100,100) +#@gui :Center Y-Shift=int(0,-100,100) +#@gui :Starting Level=int(1,1,20) +#@gui :Number of Levels=int(10,1,20) +#@gui :Level Frequency=int(1,1,10) +#@gui :_=separator() +#@gui :Show Both Poles=bool(0) +#@gui :Pole Rotation=int(90,-180,180) +#@gui :Pole Long=int(0,-100,100) +#@gui :Pole Lat=int(0,-100,100) +#@gui :_=separator() +#@gui :Tile Poles=bool(0) +#@gui :Hyper Droste=bool(0) +#@gui :Fractal Points=int(1,1,10) +#@gui :_=separator() +#@gui :Auto-Set Periodicity=bool(0) +#@gui :No Transparency=bool(0) +#@gui :External Transparency=bool(1) +#@gui :Mirror Effect=bool(0) +#@gui :Untwist=bool(0) +#@gui :Do Not Flatten Transparency=bool(0) +#@gui :_=separator() +#@gui :Show Grid=bool(0) +#@gui :Show Frame=bool(0) +#@gui :_=separator() +#@gui :Antialiasing=bool(1) +#@gui :Edge Behavior X=choice("Blank","Wrap","Reflect","Rotate") +#@gui :Edge Behavior Y=choice("Blank","Wrap","Reflect","Rotate") +#@gui :_=separator() +#@gui :_=note("This filter is a conversion of the Mathmap script originally proposed here:") +#@gui :_=link("Droste effect for Mathmap.","https://www.flickr.com/groups/88221799@N00/discuss/72157601071820707/") +#@gui :_=note("Original design by Breic and coding by Josh Sommers.") +#@gui :_=separator() +#@gui :_=note("Author : Souphead. Latest update : 2016/19/01.") +#@gui Crease:fx_crease,fx_crease(0) +#@gui :Amplitude=float(30,0,300) +#@gui :Frequency (%)=float(10,0,100) +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/01/22.") +#@gui Distort Lens:fx_distort_lens,fx_distort_lens(1) +#@gui :Amplitude=float(0.1,-1,1) +#@gui :Aspect Ratio=float(0,-2,2) +#@gui :Zoom=float(0,-4,4) +#@gui :Center (%)=point(50,50,0,1) +#@gui :Boundary=choice(0,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/18/02.") +#@gui Drop Water:fx_drop_water,fx_drop_water_preview(1) +#@gui :_=note("Shape geometry:") +#@gui :Shapes=choice("Procedural","Opaque Regions on Top Layer") +#@gui :Density=float(20,0,100) +#@gui :Radius=float(2,0,5) +#@gui :Variability=float(80,0,100) +#@gui :Random Seed=int(0,0,16384) +#@gui :_=note("Parameters Density, Radius, Variability and Random seed are used only in Procedural shapes mode.") +#@gui :_=separator() +#@gui :_=note("Light parameters:") +#@gui :Refraction=float(3,0,20) +#@gui :Light Angle=float(35,0,360) +#@gui :Specular Size=float(10,0,100) +#@gui :Specular Intensity=float(1,0,1) +#@gui :Specular Centering=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Shadow parameters:") +#@gui :Shadow Size=float(0.25,0,3) +#@gui :Shadow Intensity=float(0.5,0,1) +#@gui :Shadow Smoothness=float(0.75,0,3) +#@gui :Diffuse Shadow=float(0.05,0,3) +#@gui :_=separator() +#@gui :Smoothness=float(0.15,0,3) +#@gui :Output as Separate Layers=_bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/21/07.") +#@gui Equirectangular to Nadir-Zenith:fx_equirectangular2nadirzenith,fx_equirectangular2nadirzenith(1) +#@gui :Mode=choice("to Nadir / Zenith","to Equirectangular") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/29/12.") +#@gui Euclidean - Polar:fx_euclidean2polar,fx_euclidean2polar(1) +#@gui :Center (%)=point(50,50,0,1) +#@gui :Stretch Factor=float(1,0.1,10) +#@gui :Boundary=choice(1,"Transparent","Nearest","Periodic","Mirror") +#@gui :Inverse Transform=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Fish-Eye:fisheye,fisheye(1) +#@gui :Center (%)=point(50,50,0,1,255) +#@gui :Radius=float(70,0,100) +#@gui :Amplitude=float(1,0,2) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Flower:fx_flower,fx_flower_preview(1) +#@gui :Center (%)=point(50,50,0,1) +#@gui :Amplitude / Angle=point(75,50,0,1) +#@gui :Petals=int(6,2,20) +#@gui :Offset (%)=float(0,0,100) +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Kaleidoscope [Blended]:fx_rotoidoscope,fx_rotoidoscope(1) +#@gui :Center (%)=point(50,50) +#@gui :Angular Tiles=int(10,1,72) +#@gui :Smoothness=float(0.5,0,5) +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Kaleidoscope [Polar]:fx_kaleidoscope,fx_kaleidoscope(1) +#@gui :Center (%)=point(50,50) +#@gui :X-Offset (%)=float(0,0,100) +#@gui :Y-Offset (%)=float(0,0,100) +#@gui :Radius Cut=float(100,0,100) +#@gui :Angle Cut=float(10,0,100) +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Kaleidoscope [Symmetry]:fx_symmetrizoscope,fx_symmetrizoscope(1) +#@gui :Iterations=int(4,1,32) +#@gui :Angle=float(0,0,360) +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :Symmetry Sides=choice("Backward","Forward","Swap") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/07/01.") +#@gui Morph [Interactive]:fx_morph_interactive,fx_morph_interactive_preview : + +#@gui :Number of Frames=int(16,3,1024) +#@gui :Preview Precision=choice{2,"Coarsest (faster)","Coarse","Normal","Fine","Finest (slower)"} +#@gui :_=value(-1) +#@gui :_=separator() +#@gui :_=note("Instructions:") +#@gui :_=note(" Use mouse buttons to add/move/remove correspondence keypoints over the interactive window that will appear, in order to create the morphing.\n\n Source/target window:\n\n - Left mouse button: Add new keypoint on current image and move it on the other one.\n - Right mouse button: Add/move keypoint on current image.\n - Key DELETE or middle mouse button: Delete keypoint.\n - Key SPACE or mouse wheel: Toggle source/target.\n\n In-between window:\n\n - Mouse wheel: Change morphing time, from 0 to 1.\n - Left mouse button: Reset morphing time to 0.5.\n\n Both windows:\n\n - Key TAB: Change keypoint radius.\n - Key ENTER: Play/stop in-between animation.\n - Key R: Reset keypoints.\n - Key K: Show/hide keypoints.\n - Keys ESC or Q: Process fullres and exit. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/04/16.") +#@gui Perspective:fx_warp_perspective,fx_warp_perspective(1) +#@gui :X-Angle=float(1.73,-4,4) +#@gui :Y-Angle=float(0,-4,4) +#@gui :Zoom=float(1,0.1,4) +#@gui :Center (%)=point(50,50,0,1,255) +#@gui :X-Offset=float(0,0,100) +#@gui :Y-Offset=float(0,0,100) +#@gui :Boundary=choice(2,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Polar Transform:fx_transform_polar,fx_transform_polar(1) +#@gui :Preset=choice("Custom Transform","Inverse Radius","Swap Radius / Angle") +#@gui :Center (%)=point(50,50,0,1) +#@gui :Radius=text{"r + R/10*cos(a*5)"} +#@gui :Angle=text("a") +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Quadrangle:fx_quadrangle,fx_quadrangle_preview(1) +#@gui :Top-Left Vertex (%)=point(5,5,0,1,255,0,0) +#@gui :Top-Right Vertex (%)=point(95,25,0,1,0,255,0) +#@gui :Bottom-Right Vertex (%)=point(60,95,0,1,64,128,255) +#@gui :Bottom-Left Vertex (%)=point(40,95,0,1,255,255,0) +#@gui :Interpolation=choice(1,"Nearest Neighbor","Linear") +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :Preview Type=choice(1,"Input","Output","Both") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/10/11.") +#@gui Raindrops:raindrops,raindrops(0) +#@gui :Amplitude=float(80,0,300) +#@gui :Density=float(0.1,0,1) +#@gui :Wavelength=float(1,0,2) +#@gui :Merging Steps=int(0,0,20) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/28/11.") +#@gui Random:deform,deform(0) +#@gui :Amplitude=float(10,0,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Reflection:fx_reflect,fx_reflect(1) +#@gui :Height=float(50,0,100) +#@gui :Attenuation=float(1,0.1,4) +#@gui :Color=color(#6ea0be40) +#@gui :Waves Amplitude=float(0,0,100) +#@gui :Waves Smoothness=float(1.5,0,4) +#@gui :X-Angle=float(0,-10,10) +#@gui :Y-Angle=float(-3.30,-10,10) +#@gui :Focale=float(7,0,10) +#@gui :Zoom=float(1.5,1,5) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Ripple:ripple,ripple(0) +#@gui :Amplitude=float(10,0,100) +#@gui :Bandwidth=float(20,1,300) +#@gui :Shape=choice(2,"Block","Triangle","Sine","Sine+","Random") +#@gui :Angle=float(0,0,360) +#@gui :Offset=float(0,0,500) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/23/08.") +#@gui Seamcarve:fx_seamcarve,fx_seamcarve_preview(1) +#@gui :Width (%)=float(85,0,200) +#@gui :Height (%)=float(100,0,200) +#@gui :Maximal Seams per Iteration (%)=float(15,0,100) +#@gui :Use Top Layer as a Priority Mask=bool(0) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Note: You can define a transparent top layer that will help the seam-carving algorithm to preserve or force removing image structures:\n \n - Draw areas in red to force removing them. \n - Draw areas in green to preserve them. \n - Don't forget also to set the Input layers... parameter to input both layers to the filter. ") +#@gui :_=separator() +#@gui :_=note("Authors: Garagecoder and David Tschumperlé.       Latest Update: 2014/02/06.") +#@gui Sphere:fx_map_sphere,fx_map_sphere_preview(1) +#@gui :Width=_int(512,1,4096) +#@gui :Height=_int(512,1,4096) +#@gui :Radius=float(90,0,400) +#@gui :Dilation=float(0.5,0,1) +#@gui :Angle=float(0,-50,50) +#@gui :Border Smoothness=float(0,0,200) +#@gui :Border Width=float(20,0,100) +#@gui :Orientation=choice("0 Deg.","90 Deg.","180 Deg.","270 Deg.") +#@gui :Background=choice("Transparent","Mean Color") +#@gui :Fading=float(0,0,100) +#@gui :Fading Shape=float(0.5,0,3) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/07/11.") +#@gui Spherize:fx_spherize,fx_spherize_preview(1) +#@gui :Radius (%)=float(50,0,300) +#@gui :Strength=float(1,-10,10) +#@gui :Smoothness (%)=float(0,0,4) +#@gui :Center (%)=point(50,50,0,1,255,255,255,170,10) +#@gui :Ratio=float(0,-2,2) +#@gui :Angle=float(0,-90,90) +#@gui :Interpolation=choice(2,"Nearest Neighbor","Linear","Cubic") +#@gui :Preview Grid=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/10/03.") +#@gui Square to Circle:fx_square_circle,fx_square_circle +#@gui :Mode=choice(0,"Square to Circle","Circle to Square") +#@gui :Interpolation=choice(1,"Nearest Neighbor","Linear") +#@gui :Boundary=choice(0,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :X-Factor (%)=float(0,-100,100) +#@gui :Y-Factor (%)=float(0,-100,100) +#@gui :X-Offset (%)=float(0,-300,300) +#@gui :Y-Offset (%)=float(0,-300,300) +#@gui :_=separator() +#@gui :_=note("This filter implements the mapping functions described in this page, by C. Fong:") +#@gui :_=link("http://squircular.blogspot.com/2015/09/mapping-circle-to-square.html") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/10/30.") +#@gui Stereographic Projection:fx_project_stereographic,fx_project_stereographic_preview(1) +#@gui :Transform=choice("Direct","Inverse") +#@gui :Center (%)=point(50,50,0,1,255,255,255,170) +#@gui :Radius / Angle=point(50,75,0,1,255,0,255,170) +#@gui :Horizon Leveling (deg)=float(0,-10,10) +#@gui :Left / Right Blur (%)=float(0,0,20) +#@gui :Dilation=float(0,-2,2) +#@gui :Mirror=choice("None","X-Axis","Y-Axis","XY-Axis") +#@gui :Boundary=choice(0,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=value(50,50) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/07/04.") +#@gui Symmetrize:fx_symmetrize,fx_symmetrize_preview(1) +#@gui :Point 1=point(50,50,0,1,0,255,0,170,10) +#@gui :Point 2=point(50,75,-1,1,255,255,0,170,10) +#@gui :Angle=float(0,-180,180) +#@gui :Boundary=choice(0,"Transparent","Nearest","Periodic","Mirror") +#@gui :Type=choice("Symmetry","Antisymmetry") +#@gui :Swap Sides=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/06/11.") +#@gui Textured Glass:fx_textured_glass,fx_textured_glass_preview(0) +#@gui :X-Amplitude=float(40,0,400) +#@gui :Y-Amplitude=float(40,0,400) +#@gui :X-Smoothness=float(1,0,5) +#@gui :Y-Smoothness=float(1,0,5) +#@gui :Edge Attenuation=float(0,0,1) +#@gui :Edge Influence=float(2,0,10) +#@gui :Noise Scale=int(0,0,16) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/21/11.") +#@gui Twirl:fx_twirl,fx_twirl(1) +#@gui :Amplitude=float(1,-5,5) +#@gui :Center (%)=point(50,50,0,1) +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Warp [Interactive]:fx_warp_interactive,fx_warp_interactive_preview(1) +#@gui :Preview Precision=choice{1,"Coarsest (faster)","Coarse","Normal","Fine","Finest (slower)"} +#@gui :_=separator() +#@gui :_=note("Pre-defined keypoints") +#@gui :Regular Grid=int(2,2,10) +#@gui :Contours=int(0,0,32) +#@gui :_=value(-1) +#@gui :_=separator() +#@gui :_=note("Instructions:") +#@gui :_=note(" Use mouse to add/move/delete keypoints over the interactive window that will appear, in order to create the deformation map.\n\n - Left mouse button: Add and move keypoint.\n - Right mouse button: Delete keypoint.\n - Key SPACE or middle mouse button: Show/hide keypoints.\n - Key TAB: Change keypoint radius.\n - Key SHIFT: Toggle to original image.\n - Key R: Reset keypoints.\n - Keys ESC, ENTER or Q: Process fullres and exit. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/04/08.") +#@gui Water:water,water(0) +#@gui :Amplitude=float(30,0,300) +#@gui :Smoothness=float(1.5,0,4) +#@gui :Angle=float(45,0,180) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/07/10.") +#@gui Wave:wave,wave(1) +#@gui :Amplitude=float(10,0,30) +#@gui :Frequency=float(0.4,0,2) +#@gui :Center (%)=point(50,50,0,1,255,255,255,170,10) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Wind:fx_wind,fx_wind_preview(0) +#@gui :Amplitude=int(20,0,500) +#@gui :Angle=float(0,0,360) +#@gui :Attenuation=float(0.7,0,1) +#@gui :Threshold=float(20,0,100) +#@gui :Mode=choice(1,"Darker","Brighter") +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2023/05/26.") +#@gui Zoom:fx_zoom,fx_zoom(1) +#@gui :Factor=float(2,0.01,10) +#@gui :Center (%)=point(50,50,0,1,255) +#@gui :Boundary=choice(0,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui _Degradations +#@gui Add Grain:fx_simulate_grain,fx_simulate_grain_preview(0) +#@gui :Preset=choice("Orwo NP20-GDR","Kodak TMAX 400","Kodak TMAX 3200","Kodak TRI-X 1600","Unknown") +#@gui :Blend Mode=choice(1,"Alpha","Grain Merge","Hard Light","Overlay","Soft Light","Grain Only") +#@gui :Opacity=float(0.2,0,1) +#@gui :Scale=float(100,30,800) +#@gui :Sharpness=float(0,0,512) +#@gui :Colored Grain=bool() +#@gui :_=separator() +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Grain Alone=bool() +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/02/08.") +#@gui Blur [Angular]:fx_blur_angular,fx_blur_angular_preview(1) +#@gui :Amplitude (%)=float(2,0,20) +#@gui :Center (%)=point(50,50,0,1) +#@gui :Sharpness=float(0,0,500) +#@gui :Preview Guides=bool(1) +#@gui :_=separator() +#@gui :Channel(s)=choice(7,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/16/01.") +#@gui Blur [Bloom]:fx_blur_bloom,fx_blur_bloom_preview(0) +#@gui :Amplitude=float(1,0,10) +#@gui :Ratio=float(2,0,5) +#@gui :Iterations=int(5,0,100) +#@gui :Operator=choice("Add","Max","Min") +#@gui :Kernel=choice(1,"Deriche","Gaussian","Box","Triangle","Quadratic") +#@gui :Normalize Scales=bool(0) +#@gui :Anisotropy=float(0,0,1) +#@gui :Angle=float(0,-180,180) +#@gui :_=note("Parameter Angle is only active when Anisotropy>0") +#@gui :_=separator() +#@gui :Channel(s)=choice(7,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/03/02.") +#@gui Blur [Depth-Of-Field]:fx_blur_dof,fx_blur_dof_preview(1) +#@gui :Blur Amplitude=float(3,0,20) +#@gui :Blur Precision=int(16,2,64) +#@gui :Depth-Of-Field Type=choice{"Gaussian","User-Defined (Bottom Layer)"} +#@gui :Invert Blur=bool(0) +#@gui :_=separator() +#@gui :_=note("Gaussian depth-of-field:") +#@gui :Center (%)=point(50,50,0,0,255) +#@gui :First Radius=float(30,0,200) +#@gui :Second Radius=float(30,0,200) +#@gui :Angle=float(0,0,180) +#@gui :Sharpness=float(1,0,8) +#@gui :Preview Guides=bool(1) +#@gui :_=separator() +#@gui :_=note("User-defined depth-of-field:") +#@gui :Gamma=float(0,-2,2) +#@gui :_=note("You can specify your own depth-of-field image, as a bottom layer image whose luminance encodes the depth for each pixel. Don't forget to modify the Input layers combo-box to make this layer active for the filter.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/25/02.") +#@gui Blur [Gaussian]:fx_gaussian_blur,fx_gaussian_blur_preview(0) +#@gui :XY-Amplitude=float(3,0,20) +#@gui :X-Amplitude=float(0,0,20) +#@gui :Y-Amplitude=float(0,0,20) +#@gui :Boundary=choice(1,"Black","Nearest") +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Blur [Glow]:fx_glow,fx_glow_preview(0) +#@gui :Amplitude=float(6,0,20) +#@gui :_=separator() +#@gui :Channel(s)=choice(7,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Blur [Linear]:fx_blur_linear,fx_blur_linear_preview(1) +#@gui :Tangent Radius (%)=float(10,0,25) +#@gui :Orthogonal Radius (%)=float(0.5,0,25) +#@gui :Angle=float(0,0,180) +#@gui :Sharpness=float(0,0,500) +#@gui :Boundary=choice(1,"Black","Nearest") +#@gui :_=separator() +#@gui :Channel(s)=choice(7,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Blur [Multidirectional]:fx_blur_multidirectional,fx_blur_multidirectional_preview(0) +#@gui :Number of Orientations=int(5,1,16) +#@gui :Reference Angle (deg.)=float(0,0,360) +#@gui :Angle Range (deg.)=float(360,0,360) +#@gui :_=separator() +#@gui :Smoothness=float(150,0,1024) +#@gui :Kernel Type=choice(0,"Mono-Directional","Bi-Directional") +#@gui :Boundary Conditions=choice(1,"Dirichlet","Neumann","Periodic","Mirror") +#@gui :Sharpness=float(0,0,1000) +#@gui :Blend Mode=choice{2,"Min","Max","Average","Edges-0.5 (beware: Memory-Consuming!)","Edges-1 (beware: Memory-Consuming!)","Edges-2 (beware: Memory-Consuming!)","Median (beware: Memory-Consuming!)"} +#@gui :Boost Contrast=float(2,0,32) +#@gui :_=separator() +#@gui :Channel(s)=choice(7,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/09/11.") +#@gui Blur [Radial]:fx_blur_radial,fx_blur_radial_preview(1) +#@gui :Amplitude=float(3,0,20) +#@gui :Center (%)=point(50,50,0,1) +#@gui :Sharpness=float(0,0,500) +#@gui :Preview Guides=bool(1) +#@gui :_=separator() +#@gui :Channel(s)=choice(7,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/16/01.") +#@gui Chromatic Aberrations:fx_chromatic_aberrations,fx_chromatic_aberrations_preview(0) +#@gui :Primary Color=color(#ff0000) +#@gui :Deformation Type=choice("Shift","Radial","Angular","Random") +#@gui :X-Amplitude=float(2,-32,32) +#@gui :Y-Amplitude=float(2,-32,32) +#@gui :Smoothness=float(0,0,10) +#@gui :Attenuation Near Center (%)=float(50,-100,100) +#@gui :Attenuation Decay=float(1,0,8) +#@gui :_=separator() +#@gui :Secondary Color=color(#00ff00) +#@gui :Deformation Type=choice("Shift","Radial","Angular","Random") +#@gui :X-Amplitude=float(0,-32,32) +#@gui :Y-Amplitude=float(0,-32,32) +#@gui :Smoothness=float(0,0,10) +#@gui :Attenuation Near Center (%)=float(0,-100,100) +#@gui :Attenuation Decay=float(1,0,8) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/08/10.") +#@gui CRT Sub-Pixels:fx_gcd_crt,fx_gcd_crt(2) +#@gui :_=note("Cathode ray tube sub-pixel rendering filter") +#@gui :_=separator() +#@gui :Horizontal Blur=float(1.8,0,5) +#@gui :Vertical Blur=float(1.8,0,5) +#@gui :Screen Border=bool(0) +#@gui :Equalize=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2014/12/11.") +#@gui Dirty:fx_dirty,fx_dirty_preview(0) +#@gui :Amplitude=float(30,0,100) +#@gui :Monochrome=bool(1) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/24/11.") +#@gui Flip & Rotate Blocks:fx_flip_blocks,fx_flip_blocks_preview(0) +#@gui :X-Size (px)=int(4,1,128) +#@gui :Y-Size (px)=int(4,1,128) +#@gui :Flip=choice(3,"None","X-Axis","Y-Axis","XY-Axes") +#@gui :Rotate=choice(1,"-90 Deg.","0 Deg.","90 Deg.") +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/01/09.") +#@gui Huffman Glitches:fx_huffman_glitches,fx_huffman_glitches_preview(1) +#@gui :Noise Level (%)=float(30,0,100) +#@gui :Split Mode=choice("None","Horizontal Blocs","Vertical Blocs","Patches") +#@gui :Bloc Size (%)=int(25,0,100)_1 +#@gui :Patch Overlap (%)=float(0,0,50)_1 +#@gui :Color Space=choice("RGB","CMYK","HCY","HSI","HSL","HSV","Jzazbz","Lab","Lch","OKLab","YCbCr","YIQ") +#@gui :Quantization=int(0,0,64) +#@gui :_=note{"(Set to 0 to turn quantization off)"} +#@gui :_=separator() +#@gui :Random Seed=int(0,0,65536) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Beware:\n\n- The preview does not perfectly reflect what the resulting image will be. It just gives an idea on the kind of effects the filter produces with the specified parameters.\n\n- The filter is slow to compute on large images.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2023/04/26.") +#@gui JPEG Artefacts:fx_jpeg_artefacts,fx_jpeg_artefacts_preview(0) +#@gui :_=note("This filter simulates the JPEG compression artifacts, using DCT quantization on 8x8 blocks.") +#@gui :Quality (%)=int(50,1,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/05/07.") +#@gui Lomo:fx_lomo,fx_lomo_preview(1) +#@gui :Vignette Size=float(20,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: Jérome Boulanger and David Tschumperlé.       Latest Update: 2012/06/06.") +#@gui Mess with Bits:fx_mess_with_bits,fx_mess_with_bits_preview +#@gui :_=note("Input processing:") +#@gui :Pre-Normalize=bool(1) +#@gui :Smoothness (%)=float(15,0,100) +#@gui :Multiplier=int(1,1,256) +#@gui :_=separator() +#@gui :_=note("Output processing:") +#@gui :Reversing=choice(1,"None","Reverse Bits","Reverse Bytes") +#@gui :Bit Masking (Start)=int(0,0,15) +#@gui :Bit Masking (End)=int(15,0,15) +#@gui :Opacity (%)=float(100,0,100) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/01/16.") +#@gui Noise [Additive]:fx_noise,fx_noise_preview(0) +#@gui :Amplitude=float(10,0,200) +#@gui :Noise Type=choice("Gaussian","Uniform","Salt and Pepper","Poisson") +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice(1,"None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Noise [Perlin]:fx_noise_perlin,fx_noise_perlin_preview(1) +#@gui :Random Seed=int(0,0,65536) +#@gui :_=separator() +#@gui :_=note("1st scale:") +#@gui :Amplitude=float(100,0,512) +#@gui :Scale (%)=float(8,0,100) +#@gui :X/Y-Ratio=float(0,-4,4) +#@gui :_=separator() +#@gui :_=note("2nd scale:") +#@gui :Amplitude=float(0,0,512) +#@gui :Scale (%)=float(4,0,100) +#@gui :X/Y-Ratio=float(0,-4,4) +#@gui :_=separator() +#@gui :_=note("3rd scale:") +#@gui :Amplitude=float(0,0,512) +#@gui :Scale (%)=float(2,0,100) +#@gui :X/Y-Ratio=float(0,-4,4) +#@gui :_=separator() +#@gui :_=note("4th scale:") +#@gui :Amplitude=float(0,0,512) +#@gui :Scale (%)=float(1,0,100) +#@gui :X/Y-Ratio=float(0,-4,4) +#@gui :_=separator() +#@gui :Channel(s)=choice(2,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/01/24.") +#@gui Noise [Spread]:fx_spread,fx_spread_preview(0) +#@gui :X-Variations=float(4,0,20) +#@gui :Y-Variations=float(4,0,20) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Old-Movie Stripes:fx_stripes_y,fx_stripes_y_preview(1) +#@gui :Frequency=float(10,0,100) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Oldschool 8bits:fx_8bits,fx_8bits_preview(0) +#@gui :Scale=float(25,1,100) +#@gui :Dithering=float(800,0,10000) +#@gui :Levels=int(16,2,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/02/11.") +#@gui Pixel Sort:fx_pixelsort,fx_pixelsort_preview(1)+ +#@gui :_=note("Sorting parameters:") +#@gui :Order=choice(1,"Decreasing","Increasing") +#@gui :Axis=choice("X-Axis","Y-Axis","X-Axis Then Y-Axis","Y-Axis Then X-Axis") +#@gui :Sorting Criterion=choice("Red","Green","Blue","Intensity","Luminance","Lightness","Hue","Saturation","Minimum","Maximum","Random") +#@gui :_=separator() +#@gui :_=note("Masking parameters:") +#@gui :Mask By=choice(1,"Bottom Layer","Criterion","Contours","Random") +#@gui :Lower Mask Threshold (%)=float(0,0,100) +#@gui :Higher Mask Threshold (%)=float(100,0,100) +#@gui :Mask Smoothness (%)=float(0,0,5) +#@gui :Invert Mask=bool(0) +#@gui :Preview Mask=bool(0) +#@gui :_=separator() +#@gui :_=note("Note: This filter implements one version of the algorithm described here : ") +#@gui :_=link("http://satyarth.me/articles/pixel-sorting/") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/10/29.") +#@gui Rain & Snow:fx_rain,fx_rain_preview(0) +#@gui :Angle=float(65,-180,180) +#@gui :Speed=float(10,0,50) +#@gui :Density (%)=float(50,0,100) +#@gui :Radius=float(0.1,0,3) +#@gui :Gamma=float(1,0,2) +#@gui :Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/29/06.") +#@gui Random Shade Stripes:fx_shade_stripes,fx_shade_stripes_preview(1) +#@gui :Frequency=float(30,1,100) +#@gui :Orientation=choice(1,"Horizontal","Vertical") +#@gui :Darkness=float(0.8,0,3) +#@gui :Lightness=float(1.3,0,3) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Rebuild From Similar Blocks:fx_rebuild_from_similar_blocks,fx_rebuild_from_similar_blocks(1) +#@gui :Block Size (%)=float(5,2,50) +#@gui :_=separator() +#@gui :Regularization Factor=float(10,0,20) +#@gui :Luminance Factor=float(0.75,0,3) +#@gui :Norm Type=choice(1,"L1","L2") +#@gui :_=separator() +#@gui :_=note("This filter subdivides the image into blocks, and replace each block by the most similar block found in the other blocks.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/09/17.") +#@gui Scanlines:fx_scanlines,fx_scanlines_preview(0) +#@gui :Amplitude=float(60,0,255) +#@gui :Bandwidth=float(2,1,300) +#@gui :Shape=choice(0,"Block","Triangle","Sine","Sine+","Random") +#@gui :Angle=float(0,0,360) +#@gui :Offset=float(0,0,500) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/19/11.") +#@gui Self Glitching:fx_self_glitching,fx_self_glitching_preview(1) +#@gui :Multiplier=float(0,-5,5) +#@gui :Bias=float(0,-255,255) +#@gui :Negate=bool(0) +#@gui :Operator=choice("Add","Mul","And","Or","Xor","Pow","Reverse Pow","Mod","Reverse Mod") +#@gui :Shift Point=point(50,50,0,1) +#@gui :Boundary=choice(3,"Zero","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/08/19.") +#@gui Sloppy Mess:fx_sloppymess,fx_sloppymess_preview(0) +#@gui :_=note("Slices:") +#@gui :Angle=int(0,0,360) +#@gui :Width (px)=int(1,1,5000) +#@gui :Axis=choice("X-Axis","Y-Axis") +#@gui :Mirror Axis=choice("X-Axis","Y-Axis") +#@gui :Mirror Selection Interval (0:Off, -1:Random)=int(-1,-1,50) +#@gui :Invert Mirror Selection=bool(0,0,1) +#@gui :_=separator() +#@gui :_=note("Rotation:") +#@gui :Range Clockwise=int(35,0,90) +#@gui :Range Counter-Clockwise=int(-35,-90,0) +#@gui :Boundary Conditions=int(2,0,3) +#@gui :Center X(%)=int(0,0,100) +#@gui :Center Y(%)=int(0,0,100) +#@gui :_=separator() +#@gui :Deform=int(3,0,20) +#@gui :_=separator() +#@gui :Iterations=int(1,1,20) +#@gui :Blending=choice(3,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lchlightness","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Seamless","Seamless Mixed","Shapeareamax","Shapeareamax0","Shapeareamin","Shapeareamin0","Shapeaverage","Shapeaverage0","Shapemedian","Shapemedian0","Shapemin","Shapemin0","Shapemax","Shapemax0","Shapeprevalent","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Strength=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("Author: Prawnsushi.      Latest Update: 2023/08/17.") +#@gui Streak:fx_streak,fx_streak(1) +#@gui :Mask Color=color(#ff0000ff) +#@gui :Step (%)=float(0,0,30) +#@gui :Angle=float(0,0,360) +#@gui :Propagation=choice(3,"Backward","Forward","Bidirectional [Sharp]","Bidirectional [Smooth]") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/12/22.") +#@gui Visible Watermark:fx_watermark_visible,fx_watermark_visible(0) +#@gui :Text=text("\\251 G'MIC") +#@gui :Opacity=float(0.4,0.1,0.9) +#@gui :Size=int(50,13,128) +#@gui :Angle=float(25,0,360) +#@gui :Smoothness=float(0.5,0,5) +#@gui :Lightness=choice(1,"Darker","Brighter") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Warp by Intensity:fx_warp_by_intensity,fx_warp_by_intensity_preview(0) +#@gui :X-Factor=float(0.04,-6,6) +#@gui :Y-Factor=float(0.04,-6,6) +#@gui :_=separator() +#@gui :X-Offset=float(128,0,255) +#@gui :Y-Offset=float(128,0,255) +#@gui :_=separator() +#@gui :Correlated Channels=bool(0) +#@gui :Interpolation=choice(1,"Nearest Neighbor","Linear") +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/02/09.") +#@gui _Details +#@gui Constrained Sharpen:iain_constrained_sharpen,iain_constrained_sharpen(0) +#@gui :Sharpen Radius=float(.75,0,10) +#@gui :Amount=float(2,0,10) +#@gui :Threshold=float(1,0,50) +#@gui :Constraint Radius=int(5,0,10) +#@gui :Overshoot=float(0,0,50) +#@gui :Channel(s)=choice(11,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :Value Action=choice(1,"None","Cut","Normalize") +#@gui :_=separator() +#@gui :_=note("Sharpens image but restricts pixels values to local minimum and maximum values to significantly reduce halos.") +#@gui :_=note("Sharpen Radius, Amount and Threshold are the normal unsharp controls.) +#@gui :_=note("A high Amount will produce aliasing") +#@gui :_=note("Constraint Radius sets the radius to find the local minimum and maximum.) +#@gui :_=note("Overshoot sets how far the sharpening is allowed to go past the local minimum and maximum values.) +#@gui :_=note("Author : Iain Fergusson. release: 2 August 2016 update: 25 August 2018") +#@gui DCP Dehaze:jeje_dehaze,jeje_dehaze_preview +#@gui :Scale=int(5,1,20) +#@gui :Strength=float(1,0,2) +#@gui :Min=float(.2,0,1) +#@gui :Max=float(1,0,1) +#@gui :Brighness=float(0,-100,100) +#@gui :Contrast=float(0,-100,100) +#@gui :Gamma=float(0,-100,100) +#@gui :Transmittance Map=bool(false) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Dark Channel Prior dehazing.Author : Jérôme Boulanger. Latest update: 2016/08/09.") +#@gui Details Equalizer:fx_equalize_details,fx_equalize_details_preview(0) +#@gui :Base Scale=float(5,0,15) +#@gui :Detail Scale=float(0.5,0,5) +#@gui :_=note("Coarse scale:") +#@gui :Threshold=float(0,0,10) +#@gui :Smoothness=float(0,0,10) +#@gui :Smoothness Type=choice(2,"Gaussian","Bilateral","Diffusion") +#@gui :Gain=float(0,-4,4) +#@gui :_=separator() +#@gui :_=note("Medium scale:") +#@gui :Threshold=float(0,0,10) +#@gui :Smoothness=float(0,0,10) +#@gui :Smoothness Type=choice(2,"Gaussian","Bilateral","Diffusion") +#@gui :Gain=float(0,-4,4) +#@gui :_=separator() +#@gui :_=note("Small scale:") +#@gui :Threshold=float(0,0,10) +#@gui :Smoothness=float(0,0,10) +#@gui :Smoothness Type=choice(2,"Gaussian","Bilateral","Diffusion") +#@gui :Gain=float(0,-4,4) +#@gui :_=separator() +#@gui :_=note("Fine scale:") +#@gui :Threshold=float(0,0,10) +#@gui :Smoothness=float(0,0,10) +#@gui :Smoothness Type=choice(2,"Gaussian","Bilateral","Diffusion") +#@gui :Gain=float(0,-4,4) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(32,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Jérome Boulanger and David Tschumperlé.       Latest Update: 2015/11/11.") +#@gui Dynamic Range Increase:fx_tk_dri,fx_tk_dri_preview(1) +#@gui :Map Tones=float(0,0,1) +#@gui :Recover Shadows=float(0,0,1) +#@gui :Recover Highlights=float(0,0,1) +#@gui :Enhance Details=float(1,0,5) +#@gui :Detail Strength=float(0.5,0,1) +#@gui :Map Tones=bool(1) +#@gui :Enhance Details=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil Latest update: 2011/12/04.") +#@gui Equalize Local Histograms:fx_equalize_local_histograms,fx_equalize_local_histograms_preview(0) +#@gui :Strength (%)=float(75,0,100) +#@gui :Mode=choice(2,"Raw","Hard","Soft") +#@gui :Radius=int(4,1,16) +#@gui :Sigma=float(100,0,256) +#@gui :Regularization=float(8,0,32) +#@gui :Reduce Halos=bool(1) +#@gui :_=separator() +#@gui :Channel(s)=choice(16,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/01/31.") +#@gui Freaky Details:fx_freaky_details,fx_freaky_details_preview(0) +#@gui :Amplitude=int(2,1,5) +#@gui :Scale=float(10,0,100) +#@gui :Iterations=int(1,1,4) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé and Patrick David.       Latest Update: 2013/27/02.") +#@gui :_=separator() +#@gui :_=note("This effect has been done following:") +#@gui :_=link("This tutorial from Patrick David","https://patdavid.net/2013/02/calvin-hollywood-freaky-details-in-gimp.html") +#@gui High Pass:fx_highpass,fx_highpass_preview(0) +#@gui :Radius=float(5,0,100) +#@gui :Contrast=float(2,0,7) +#@gui :Inverse=bool(0) +#@gui :Greyscale=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Tom Keil. Latest update: 2011/05/01.") +#@gui Local Contrast Enhancement:fx_LCE,fx_LCE_preview(0) +#@gui :_=note("Local contrast enhancement is Unsharp Mask with high radius. Apply filter to RGB channels for color and contrast enhancement.") +#@gui :Spatial Radius=float(80,30,200) +#@gui :Amount=float(0.5,0,5) +#@gui :Darkness Level=float(1,0,4) +#@gui :Lightness Level=float(1,0,4) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=note("\n\nNote : Original USM code by by David Tschumperlé. ") +#@gui :_=separator() +#@gui :_=note("Authors : Arto Huotari, PhotoComiX. Latest update : 2013/03/23.") +#@gui Local Normalization:fx_normalize_local,fx_normalize_local_preview(0) +#@gui :Amplitude=float(2,0,60) +#@gui :Radius=int(6,1,64) +#@gui :Neighborhood Smoothness=float(5,0,40) +#@gui :Average Smoothness=float(20,0,40) +#@gui :Constrain Values=bool(1) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Local Processing:fx_local_processing,fx_local_processing_preview(1) +#@gui :Action=choice("Normalize","Equalize") +#@gui :Strength (%)=float(75,0,100) +#@gui :Neighborhood Size (%)=float(10,1,100) +#@gui :Overlap (%)=float(50,0,75) +#@gui :Regularization (%)=float(20,0,100) +#@gui :Process Channels Individually=bool(0) +#@gui :_=separator() +#@gui :Channel(s)=choice(7,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/02/28.") +#@gui Local Variance Normalization:jeje_normalize_local_variance,jeje_normalize_local_variance_preview +#@gui :Amplitude=float(50,0,100) +#@gui :Smoothness=float(5,0,20) +#@gui :Threshold=float(5,0,100) +#@gui :Repeat=int(1,1,4) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/10/30.") +#@gui Magic Details:fx_magic_details,fx_magic_details_preview(0) +#@gui :Amplitude=float(6,0,30) +#@gui :Spatial Scale=float(3,0,10) +#@gui :Value Scale=float(15,0,20) +#@gui :Edges=float(-0.5,-3,3) +#@gui :Smoothness=float(2,0,20) +#@gui :_=separator() +#@gui :Channel(s)=choice(27,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/01/10.") +#@gui Make Up:make_up,make_up_preview(0) +#@gui :Space=float(15,1,40) +#@gui :Value=float(4,0,30) +#@gui :Fast=bool(0) +#@gui :Limit Hue Range=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. - Update: 1 March 2013: Fixed resizing issue, some memory useage improvements, and added more options.") +#@gui Mask Creator:fx_tk_mask,fx_tk_mask_preview(1) +#@gui :_=separator() +#@gui :Mask Type=choice("Luminance","Saturation","Hue","LAB-Lightness") +#@gui :Color Channels=choice("All","Red","Green","Blue","Yellow","Magenta","Cyan","LAB-A","LAB-B") +#@gui :Shadows Threshold=float(0,0,255) +#@gui :Highlights Threshold=float(255,0,255) +#@gui :Tones Smoothness=float(0,0,20) +#@gui :Mask Contrast=float(1,0,10) +#@gui :Negative=bool(0) +#@gui :Apply Mask=bool(0) +#@gui :Transparency=float(1,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil. Latest update: 2011/11/04.") +#@gui Mighty Details:fx_mighty_details,fx_mighty_details_preview(0) +#@gui :Amplitude=float(25,0,100) +#@gui :Details Amount=float(1,0,2) +#@gui :Details Scale=float(25,1,100) +#@gui :Details Smoothness=int(1,0,10) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/08/08.") +#@gui Portrait Retouching:fx_tk_portrait,fx_tk_portrait_preview(0) +#@gui :_=separator() +#@gui :Retouching Style=choice("Standard","Glamour Glow","Masculine","High Key","Low Key") +#@gui :Effect Strength=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("Retouching settings:") +#@gui :Fine Details Smoothness=float(1,0,10) +#@gui :Medium Details Smoothness=float(5,0,25) +#@gui :Areas Smoothness=float(20,0,100) +#@gui :Fine Details Threshold=float(3,0,10) +#@gui :Medium Details Threshold=float(20,0,100) +#@gui :Areas Light Adjustment=float(10,0,100) +#@gui :Smoothing Type=choice("Gaussian","Bilateral","Anisotropic","Median") +#@gui :Output Mode=choice("Retouched Image","Composed Layers","All Layers and Masks") +#@gui :_=separator() +#@gui :_=note("Skin tone mask settings:") +#@gui :Apply Skin Tone Mask=bool(1) +#@gui :Similarity Space=choice(2,"RGB[A]","RGB","YCbCr","Red","Green","Blue","Opacity","Luminance","Blue & Red Chrominances","Hue","Saturation") +#@gui :Tolerance=float(25,0,100) +#@gui :Smoothness=float(2,0,25) +#@gui :Selected Color=color(#fab496ff) +#@gui :Generic Skin Structure=bool(0) +#@gui :_=separator() +#@gui :_=note("Enhancement settings:") +#@gui :Apply Adjustments On=choice(0,"Final Image","Retouched Areas Only","Sharpened Areas Only","Retouched and Sharpened Areas") +#@gui :Sharpening Radius=float(1,0,10) +#@gui :Sharpening Strength=float(1.5,0,5) +#@gui :Edge Threshold=float(10,0,50) +#@gui :Edge Smoothness=float(1,0,10) +#@gui :Color Temperature=float(0,-20,20) +#@gui :Lightness=float(0,-50,50) +#@gui :Contrast=float(1,0.5,1.5) +#@gui :Saturation=float(1,0,4) +#@gui :_=separator() +#@gui :Preview Selection=choice("Retouched Image Final","Retouched Image Basic","Retouch Layer","Sharpening Layer","Skin Tone Mask","Skin Tone Colors","Edge Mask","High Frequency Layer","Medium Frequency Layer","Low Frequency Layer") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil. Latest update: 2012/18/04.") +#@gui Pyramid Processing:iain_pyramid_processing,iain_pyramid_processing(0) +#@gui :1 Levels=int(4,1,6) +#@gui :2 Noise=float(50,1,100) +#@gui :3 Mix=float(.5,0,1) +#@gui :Type=choice(0,"Mix","Add") +#@gui :Channels=choice(0,"Lightness","Luma","RGB") +#@gui :_=note("Author : Iain Fergusson. 20 Aug 2019 - Update") +#@gui :_=note(" 14 June 2017 - First release") +#@gui Sharpen [Deblur]:fx_deblur,fx_deblur_preview(0) +#@gui :Radius=float(2,0,20) +#@gui :Iterations=int(10,0,100) +#@gui :Time Step=float(20,0,50) +#@gui :Smoothness=float(0.1,0,10) +#@gui :Regularization=choice(1,"Tikhonov","Mean Curvature","Total Variation") +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Sharpen [Gold-Meinel]:fx_unsharp_goldmeinel,fx_unsharp_goldmeinel_preview(0) +#@gui :Sigma=float(1,0.5,10) +#@gui :Iterations=int(5,1,15) +#@gui :Acceleration=float(1,1,3) +#@gui :Blur=choice(1,"Exponential","Gaussian") +#@gui :Cut=bool(true) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Jérôme Boulanger.      Latest Update: 2013/29/03.") +#@gui Sharpen [Hessian]:jeje_hessian_sharpen,jeje_hessian_sharpen_preview(0) +#@gui :Number of Scales=int(3,2,10) +#@gui :Strength=float(1,0,10) +#@gui :Repeat=float(1,1,5) +#@gui :Cut=bool(false) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2019/04/30.") +#@gui Sharpen [Inverse Diffusion]:fx_sharpen_inversediff,fx_sharpen_inversediff_preview(0) +#@gui :Amplitude=float(50,1,300) +#@gui :Iterations=int(2,1,10) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Sharpen [Multiscale]:fx_sharpen_multiscale,fx_sharpen_multiscale_preview(0) +#@gui :Strength (%)=float(15,0,100) +#@gui :Regularity (%)=float(20,0,100) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/01/14.") +#@gui Sharpen [Octave Sharpening]:fx_unsharp_octave,fx_unsharp_octave_preview(0) +#@gui :Scales=int(4,1,10) +#@gui :Maximal Radius=float(5,0,20) +#@gui :Amount=float(3,0,10) +#@gui :Threshold=float(0,0,255) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice(1,"Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Sharpen [Richardson-Lucy]:fx_unsharp_richardsonlucy,fx_unsharp_richardsonlucy_preview +#@gui :Sigma=float(1,0.5,10) +#@gui :Iterations=int(10,1,100) +#@gui :Blur=choice(1,"Exponential","Gaussian") +#@gui :Cut=bool(true) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Jérôme Boulanger.      Latest Update: 2013/29/03.") +#@gui Sharpen [Shock Filters]:fx_sharpen_shock,fx_sharpen_shock_preview(0) +#@gui :Amplitude=float(150,1,400) +#@gui :Edge Threshold=float(0.1,0,0.7) +#@gui :Gradient Smoothness=float(0.8,0,10) +#@gui :Tensor Smoothness=float(1.1,0,10) +#@gui :Iterations=int(1,1,10) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Sharpen [Texture]:fx_sharpen_texture,fx_sharpen_texture_preview(0) +#@gui :Strength=float(1,0,4) +#@gui :Radius=float(4,0,32) +#@gui :_=separator() +#@gui :Channel(s)=choice(16,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/09.") +#@gui Sharpen [Unsharp Mask]:fx_unsharp,fx_unsharp_preview(0) +#@gui :Sharpening Type=choice(1,"Gaussian","Bilateral") +#@gui :Spatial Radius=float(1.25,0,20) +#@gui :Bilateral Radius=float(10,0,60) +#@gui :Amount=float(2,0,10) +#@gui :Threshold=float(0,0,20) +#@gui :Darkness Level=float(1,0,4) +#@gui :Lightness Level=float(1,0,4) +#@gui :Iterations=int(1,1,10) +#@gui :Negative Effect=bool(0) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=note("\n\nNote: This filter is inspired by the original GIMP Unsharp Mask filter, with additional parameters. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Sharpen [Whiten]:jeje_whiten_frequency,jeje_whiten_frequency_preview(0) +#@gui :Alpha=float(50,0,100) +#@gui :Cut=bool(false) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note(Note:This filter equalizes frequencies in the image.) +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/06/01.") +#@gui Split Details [Alpha]:fx_split_details_alpha,fx_split_details_alpha_preview(0) +#@gui :Number of Levels=int(6,2,8) +#@gui :Base Scale=float(10,0,30) +#@gui :Details Scale=float(1,0,20) +#@gui :Opacity Gain=float(5,1,20) +#@gui :_=separator() +#@gui :Preview Without Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/22/04.") +#@gui Split Details [Gaussian]:fx_split_details_gaussian,fx_split_details_gaussian_preview(0) +#@gui :Number of Scales=int(6,3,12) +#@gui :Base Scale=float(10,0,200) +#@gui :Details Scale=float(1,0,20) +#@gui :_=separator() +#@gui :Sharpen Details in Preview=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/22/01.") +#@gui Split Details [Wavelets]:fx_split_details_wavelets,fx_split_details_wavelets_preview(0) +#@gui :Number of Scales=int(6,2,12) +#@gui :Add Alpha Channels to Detail Scale Layers=_bool(0) +#@gui :_=separator() +#@gui :Sharpen Details in Preview=bool(0) +#@gui :_=separator() +#@gui :_=note{"Note: This filter decomposes an image into several detail scales, using wavelet atrous. It should provide similar results to the Wavelet Decompose Plug-in (by Marco Rossini). "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/23/03.") +#@gui Spotify:jeje_spotify,jeje_spotify_preview +#@gui :Scale=float(1,0.75,10) +#@gui :Iteration=int(1,1,50) +#@gui :Gamma=float(1,0,10) +#@gui :Cut=bool(1) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/12/16.") +#@gui Texture:afre_texture,afre_texture_preview(1)+ +#@gui :_=note("Enhance texture with detail scales.  Filter by afre 2020 Aug10-18.\n\n") +#@gui :_=note("Detail Scale") +#@gui :Coarse=int(0,-100,100) +#@gui :Medium=int(0,-100,100) +#@gui :Fine=int(0,-100,100) +#@gui :_=note("\n\nNote\n\nG'MIC's preview is inaccurate. Apply the filter and review the results in your host editor.") +#@gui Texture Enhance:iain_texture_enhance_p,iain_texture_enhance_p_preview(0) +#@gui :Radius=int(2,2,11) +#@gui :Strength=float(2,0,10) +#@gui :Reduce Halos=float(30,0,255) +#@gui :Reduce Noise=float(0,0,255) +#@gui :Channel(s)=choice(11,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :_=separator() +#@gui :Parallel Processing=choice(0,"Auto","Off") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. Update: 4 March 2014 - Added parallel processing option") +#@gui :_=note("Update: 4 March 2013 - Different halo protection method, added option to reduce noise, faster.") +#@gui Tone Enhance:gcd_tone_enhance,gcd_tone_enhance(1) +#@gui :_=note("Sharpen or adjust shadows and highlights") +#@gui :_=separator() +#@gui :_=note("Shadows") +#@gui :Detail=float(0,0,2) +#@gui :Gamma=float(1,0.2,1.8) +#@gui :_=separator() +#@gui :_=note("Highlights") +#@gui :Detail=float(0,0,2) +#@gui :Gamma=float(1,0.2,1.8) +#@gui :_=separator() +#@gui :_=note("Mid Point") +#@gui :Centre=int(128,0,255) +#@gui :Detail=float(0,0,2) +#@gui :Gamma=float(1,0.2,1.8) +#@gui :_=separator() +#@gui :_=note("Extra Shadow/Highlight recovery") +#@gui :Boost=float(0.5,0,1) +#@gui :Smooth=float(0,0,2) +#@gui :_=separator() +#@gui :_=note("Detail Mask") +#@gui :Smooth=int(0,0,20) +#@gui :_=separator() +#@gui :Channels=choice(4,"HSI","HSV","Lab","Linear RGB","RGB","YCbCr") +#@gui :Values=choice("Cut","Normalize") +#@gui :Color Median=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2017/01/03.") +#@gui Tone Mapping:fx_map_tones,fx_map_tones_preview(0) +#@gui :Threshold=float(0.5,0,1) +#@gui :Gamma=float(0.7,0,1) +#@gui :Smoothness=float(0.1,0,10) +#@gui :Iterations=int(30,0,500) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Tone Mapping [Fast]:fx_map_tones_fast,fx_map_tones_fast_preview(0) +#@gui :Radius=float(3,0,20) +#@gui :Power=float(0.5,0,1) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: Paul Nasca and David Tschumperlé.       Latest Update: 2011/10/06.") +#@gui YAG Effect:fx_yag_soften,fx_yag_soften_preview(0) +#@gui :Darken=float(0,0,100) +#@gui :Soften=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2013/09/28.") +#@gui :_=link("Filter Explained here","http://www.flickr.com/photos/naggobot/6260257923/") +#@gui _Frames +#@gui Droste:fx_droste,fx_droste_preview(1) +#@gui :_=note("Upper-left coordinates :") +#@gui :Point #0=point(20,20,0,1,255,0,0) +#@gui :_=separator() +#@gui :_=note("Upper-right coordinates :") +#@gui :Point #1=point(80,20,0,1,255,0,255) +#@gui :_=separator() +#@gui :_=note("Lower-right coordinates :") +#@gui :Point #2=point(80,80,0,1,0,128,255) +#@gui :_=separator() +#@gui :_=note("Lower-left coordinates :") +#@gui :Point #3=point(20,80,0,1,0,255,255) +#@gui :_=separator() +#@gui :Iterations=int(1,1,10) +#@gui :X-Shift=float(0,-100,100) +#@gui :Y-Shift=float(0,-100,100) +#@gui :Angle=float(0,0,360) +#@gui :Zoom=float(1,0.1,5) +#@gui :Mirror=choice("None","X-Axis","Y-Axis","XY-Axes") +#@gui :Boundary=choice(1,"Transparent","Nearest","Periodic","Mirror") +#@gui :Drawing Mode=choice{"Replace","Replace (Sharpest)","Behind","Below"} +#@gui :View Outlines Only=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/11/06.") +#@gui Frame [Blur]:fx_frame_blur,fx_frame_blur(1) +#@gui :Horizontal Size (%)=float(30,0,100) +#@gui :Vertical Size (%)=float(30,0,100) +#@gui :_=separator() +#@gui :Crop=float(0,0,100) +#@gui :Blur=float(5,0,10) +#@gui :Roundness=float(0,0,1) +#@gui :Apply Color Balance=bool(0) +#@gui :Balance Color=color(#808080) +#@gui :Normalization=choice("None","Stretch","Equalize") +#@gui :_=separator() +#@gui :Outline Size=float(5,0,50) +#@gui :Outline Color=color(#ffffff) +#@gui :X-Shadow=float(2,-10,10) +#@gui :Y-Shadow=float(2,-10,10) +#@gui :Shadow Smoothness=float(1,0,5) +#@gui :Shadow Contrast=float(0,0,100) +#@gui :X-Centering=float(0.5,0,1) +#@gui :Y-Centering=float(0.5,0,1) +#@gui :Angle=float(0,-180,180) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/19/01.") +#@gui Frame [Cube]:frame_cube,frame_cube(1) +#@gui :Depth=float(3,0,30) +#@gui :X-Center=float(0,-2,2) +#@gui :Y-Center=float(0,-2,2) +#@gui :Left Side Orientation=choice("Normal","Mirror-X","Mirror-Y","Mirror-XY") +#@gui :Right Side Orientation=choice("Normal","Mirror-X","Mirror-Y","Mirror-XY") +#@gui :Upper Side Orientation=choice("Normal","Mirror-X","Mirror-Y","Mirror-XY") +#@gui :Lower Side Orientation=choice("Normal","Mirror-X","Mirror-Y","Mirror-XY") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé, Angelo Lama.       Latest Update: 2012/29/01.") +#@gui Frame [Fuzzy]:fx_frame_fuzzy,fx_frame_fuzzy(0) +#@gui :Horizontal Size (%)=float(5,0,100) +#@gui :Vertical Size (%)=float(5,0,100) +#@gui :Fuzzyness=float(10,0,40) +#@gui :Smoothness=float(1,0,5) +#@gui :Color=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Frame [Mirror]:fx_frame_mirror,fx_frame_mirror_preview(1) +#@gui :_=note("Frame size:") +#@gui :Horizontal (%)=float(10,0,100) +#@gui :Vertical (%)=float(10,0,100) +#@gui :_=separator() +#@gui :_=note("Image alignment:") +#@gui :Horizontal (%)=float(50,0,100) +#@gui :Vertical (%)=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Frame dilation/shrinking:") +#@gui :Left=float(0,-5,5) +#@gui :Right=float(0,-5,5) +#@gui :Up=float(0,-5,5) +#@gui :Bottom=float(0,-5,5) +#@gui :_=separator() +#@gui :Preview Opacity (%)=float(0.75,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/08/20.") +#@gui Frame [Painting]:fx_frame_painting,fx_frame_painting_preview(1) +#@gui :Size (%)=float(10,0,100) +#@gui :Contrast=float(0.4,0,1) +#@gui :Smoothness=float(6,0,30) +#@gui :Color=color(#e1c878) +#@gui :_=separator() +#@gui :Vignette Size=float(2,0,50) +#@gui :Vignette Contrast=float(400,0,1000) +#@gui :_=separator() +#@gui :Defects Contrast=float(50,0,512) +#@gui :Defects Density=float(10,0,100) +#@gui :Defects Size=float(1,0,10) +#@gui :Defects Smoothness=float(0.5,0,20) +#@gui :_=separator() +#@gui :Serial Number=int(123456,0,1000000) +#@gui :Frame as a New Layer=_bool(false) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/07/06.") +#@gui Frame [Pattern]:fx_frame_pattern,fx_frame_pattern_preview(1) +#@gui :Tiles=int(10,3,30) +#@gui :Pattern=choice(1,"Top Layer","Self Image") +#@gui :Iterations=int(1,1,10) +#@gui :Constrain Image Size=_bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/01/08.") +#@gui Frame [Regular]:fx_frame,fx_frame(1) +#@gui :_=note("Crop parameters :") +#@gui :X-Start (%)=int(0,0,100) +#@gui :X-End (%)=int(100,0,100) +#@gui :Y-Start (%)=int(0,0,100) +#@gui :Y-End (%)=int(100,0,100) +#@gui :_=separator() +#@gui :_=note("Frame parameters :") +#@gui :Width (%)=int(10,0,100) +#@gui :Height (%)=int(10,0,100) +#@gui :Color=color(#000000ff) +#@gui :Outline Size=int(1,0,100) +#@gui :Outline Color=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Frame [Relief]:cl_reliefFrame,cl_reliefFrame(1) +#@gui :_=note("Frame Limit:") +#@gui :Type=choice(2,"Outset","Inset","Groove","Ridge") +#@gui :Size=float(10,6,40) +#@gui :Relief Width=float(1.5,0,10) +#@gui :Relief Amount=float(75,0,127) +#@gui :_=separator() +#@gui :_=note("Frame Area:") +#@gui :Kaleidoscope Effect=bool(1) +#@gui :Frame Blur=float(60,5,80) +#@gui :Frame Hue Change=float(0,-180,180) +#@gui :Frame Saturation Change=float(0,-1,1) +#@gui :Frame Luminosity Change=float(0,-0.5,0.5) +#@gui :_=separator() +#@gui :_=note("Uniform Frame Color:") +#@gui :_=note("This overrides "Frame Area" section.") +#@gui :Set Uniform Frame Color=bool(0) +#@gui :Frame Color=color(#c0c0c0) +#@gui :_=separator() +#@gui :_=note("Graininess:") +#@gui :Graininess Type=choice("Gaussian","Uniform","Poisson") +#@gui :Graininess Amount=float(0,0,80) +#@gui :Graininess On=choice("Frame","Picture","Both") +#@gui :_=separator() +#@gui :_=link("Filter discussed here","http://gimpchat.com/viewtopic.php?f=28&t=20005#p274661") +#@gui :_=note("Author: Claude Lion. Latest Update: 2022/08/26.") +#@gui :_=note("It uses filters of David Tschumperlé and an algorithm of Reptorian.") +#@gui Frame [Round]:fx_frame_round,fx_frame_round(1) +#@gui :Size (%)=float(1,0,100) +#@gui :Radius (%)=float(20,0,100) +#@gui :Smoothness=float(0.1,0,15) +#@gui :Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Frame [Smooth]:fx_frame_smooth,fx_frame_smooth(1) +#@gui :Width (%)=int(10,0,100) +#@gui :Height (%)=int(10,0,100) +#@gui :Roundness=float(0.25,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/25/04.") +#@gui Old Photograph:fx_old_photo,fx_old_photo(1) +#@gui :Vignette Strength=float(200,0,255) +#@gui :Vignette Min Radius=float(50,0,100) +#@gui :Vignette Max Radius=float(85,0,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Polaroid:fx_polaroid,fx_polaroid(1) +#@gui :Frame Size=int(10,0,400) +#@gui :Bottom Size=int(20,0,400) +#@gui :X-Shadow=float(0,-20,20) +#@gui :Y-Shadow=float(0,-20,20) +#@gui :Smoothness=float(3,0,5) +#@gui :Curvature=float(0,0,1) +#@gui :Angle=float(20,-180,180) +#@gui :Vignette Strength=float(50,0,255) +#@gui :Vignette Min Radius=float(70,0,100) +#@gui :Vignette Max Radius=float(95,0,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/06.") +#@gui Tunnel:fx_tunnel,fx_tunnel(1) +#@gui :Depth=int(4,1,100) +#@gui :Factor=float(80,1,99) +#@gui :Center (%)=point(50,50) +#@gui :Opacity=float(0.2,0,1) +#@gui :Angle=float(0,-90,90) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/22/11.") +#@gui Vignette:fx_vignette,fx_vignette +#@gui :Strength=float(70,0,255) +#@gui :Min Radius=float(70,0,100) +#@gui :Max Radius=float(95,0,100) +#@gui :Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/24/10.") +#@gui _Frequencies +#@gui Bandpass:fx_bandpass,fx_bandpass_preview(0) +#@gui :Low Frequency=float(0,0,100) +#@gui :High Frequency=float(100,0,100) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice(2,"None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Fourier Analysis:fx_display_fft,fx_display_fft(1)* +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Fourier Transform:fx_fourier_transform,fx_fourier_transform_preview(1)* : * +#@gui :Discard Transparency=bool(1) +#@gui :_=separator() +#@gui :_=note("Note: Apply this filter once to get the direct FFT, and once again to get the reverse transform.") +#@gui :_=link("Click here for a video tutorial","http://www.youtube.com/watch?v=3137dDa6P4s") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2022/04/26.") +#@gui Fourier Transform [Old]:fx_fourier_old,fx_fourier_old_preview(1)* : * +#@gui :Magnitude / Phase=choice{0,"One Layer (Horizontal)","One Layer (Vertical)","Two Layers"} +#@gui :Discard Transparency=bool(1) +#@gui :_=separator() +#@gui :_=note("Note: Apply this filter once to get the direct FFT, and once again to get the reverse transform.") +#@gui :_=link("Click here for a video tutorial","http://www.youtube.com/watch?v=3137dDa6P4s") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/06/16.") +#@gui Fourier Watermark:fx_watermark_fourier,_none_ +#@gui :Text=text{"(c) G'MIC"} +#@gui :Size=int(53,13,128) +#@gui :_=separator() +#@gui :_=note("Note: To make the watermark visible afterwards, use the 'Fourier Analysis' filter. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui _Layers +#@gui Align Layers:fx_align_layers,fx_align_layers_preview : * +#@gui :Alignment Type=choice(0,"Rigid","Non-Rigid") +#@gui :Smoothness=float(0.7,0,1) +#@gui :Scales=choice(0,"Auto","1","2","3","4","5","6","7","8") +#@gui :Revert Layers=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/01/11.") +#@gui Blend [Average All]:fx_blend_average_all,fx_blend_average_all : * +#@gui :Colorspace=choice(0,"SRGB","Linear RGB","Lab") +#@gui :_=separator() +#@gui :_=note("Note: This filter takes multiple layers as input and average them. Set the Input layers option to handle multiple input layers. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/11/08.") +#@gui Blend [Edges]:fx_blend_edges,fx_blend_edges(0) : * +#@gui :Opacity=float(1,0,1) +#@gui :Smoothness=float(0.8,0,5) +#@gui :Revert Layers=bool(0) +#@gui :_=separator() +#@gui :_=note("Note: This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/21/01.") +#@gui Blend [Fade]:fx_blend_fade,fx_blend_fade(1) : + +#@gui :Preset=choice(1,"Custom","Linear","Circular","Wave","Keftales") +#@gui :Offset=float(0,-1,1) +#@gui :Thinness=float(0,0,10) +#@gui :Sharpness=float(5,1,20) +#@gui :Sharpest=bool(0) +#@gui :Revert Layers=bool(0) +#@gui :Colorspace=choice("SRGB","Linear RGB","Lab") +#@gui :_=note(\n The parameters below are used in most presets. ) +#@gui :1st Parameter=float(0,-1,1) +#@gui :2nd Parameter=float(0,-1,1) +#@gui :3rd Parameter=float(0,-1,1) +#@gui :_=note(\n The formula below is used for the Custom preset. ) +#@gui :Formula=text{"cos(4*pi*x/w) * sin(4*pi*y/h)"} +#@gui :_=note("Note: This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/21/01.") +#@gui Blend [Median]:fx_blend_median,fx_blend_median(0) : * +#@gui :Colorspace=choice(0,"SRGB","Linear RGB","Lab") +#@gui :_=separator() +#@gui :_=note("Note: This filter needs at least two layers to work properly. Set the Input layers option to handle multiple input layers. ") +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé and Iain Fergusson.       Latest Update: 2014/16/12.") +#@gui Blend [Seamless]:fx_blend_seamless,fx_blend_seamless_preview(1) : * +#@gui :Mixed Mode=bool(0) +#@gui :Inner Fading=float(0,0,100) +#@gui :Outer Fading=float(25,0,100) +#@gui :Colorspace=choice(0,"SRGB","Linear RGB","Lab") +#@gui :_=separator() +#@gui :Output as Separate Layers=_bool(0) +#@gui :_=separator() +#@gui :_=note("Note: This filter needs at least two layers to work properly. Set the Input layers option to handle multiple input layers. ") +#@gui :_=separator() +#@gui :_=link("Click here for a detailed description of this filter.","http://gimpchat.com/viewtopic.php?f=28&t=10204") +#@gui :_=link("+ Video tutorial 1","http://www.youtube.com/watch?v=Nu-S1HmOCgE") +#@gui :_=link("+ Video tutorial 2","http://www.youtube.com/watch?v=zsHgQY6025I") +#@gui :_=link("+ Video tutorial 3","http://www.youtube.com/watch?v=2e6FikWMkaQ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/04/05.") +#@gui Blend [Standard]:fx_blend,fx_blend_preview : * +#@gui :Mode=choice(6,"Add","Alpha","And","Average","Blue","Burn","Custom Formula","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Area Max","Shape Area Max0","Shape Area Min","Shape Area Min0","Shape Average","Shape Average0","Shape Median","Shape Median0","Shape Min","Shape Min0","Shape Max","Shape Max0","Shape Prevalent","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Process As=choice("Two-By-Two","Upper Layer Is the Top Layer for All Blends","Lower Layer Is the Bottom Layer for All Blends") +#@gui :Opacity (%)=float(100,0,100) +#@gui :Preview All Outputs=bool(1) +#@gui :_=separator() +#@gui :Custom Formula=text{"1/2 - 1/4*cos(pi*a) - 1/4*cos(pi*b)"} +#@gui :_=note("Note: In custom formulas, a and b respectively stand for the values of the base layer and the blend layer, and are defined in value range [0,1].") +#@gui :_=separator() +#@gui :_=note("Note: This filter needs at least two layers to work properly. Do not forget to set the Input layers option below to handle multiple input layers. ") +#@gui :_=link("Reference page for G'MIC blending modes","https://github.com/GreycLab/gmic-community/wiki/Blending-modes") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/03/08.") +#@gui Colors to Layers:fx_split_colors,fx_split_colors_preview(1) +#@gui :Color Tolerance=float(50,0,256) +#@gui :Maximum Number of Output Layers=int(16,2,256) +#@gui :Minimal Area (%)=float(1,0,100) +#@gui :Autocrop Output Layers=bool() +#@gui :_=separator() +#@gui :_=note{"Note: This filter decomposes an image into several layers each with a single color + a residual layer (if any). "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/11/03.") +#@gui Fade Layers:fx_fade_layers,fx_fade_layers_preview : + +#@gui :Inter-Frames=_int(10,2,100) +#@gui :_=separator() +#@gui :_=note("Note: This filter needs at least two layers to work properly. Set the Input layers option to handle multiple input layers. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/04/08.") +#@gui Layers to Tiles:append_tiles,fx_append_tiles_preview(1) : * +#@gui :X-Tiles=int(0,0,256) +#@gui :Y-Tiles=int(0,0,256) +#@gui :_=note("For both parameters, 0 means automatic.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Morph Layers:fx_morph_layers,gui_no_preview : * +#@gui :Inter-Frames=_int(10,2,100) +#@gui :Smoothness=_float(0.2,0,2) +#@gui :Precision=_float(0.1,0,2) +#@gui :Revert Layers=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Multiscale Operator:fx_apply_multiscale,fx_apply_multiscale_preview(1) +#@gui :Number of Scales=int(4,2,16) +#@gui :_=separator() +#@gui :Starting Scale (%)=float(25,0,400) +#@gui :Ending Scale (%)=float(100,0,400) +#@gui :Non-Linearity=float(0,-1,1) +#@gui :Rescaling=choice(3,"Block","Linear","Cubic","Lanczsos") +#@gui :_=separator() +#@gui :X-Centering=float(0.5,0,1) +#@gui :Y-Centering=float(0.5,0,1) +#@gui :Angle=float(0,-180,180) +#@gui :_=separator() +#@gui :Enable Interpolated Motion=bool(0) +#@gui :Ending X-Centering=float(0.5,0,1) +#@gui :Ending Y-Centering=float(0.5,0,1) +#@gui :Ending Angle=float(0,-180,180) +#@gui :_=separator() +#@gui :G'MIC Operator=text("") +#@gui :Return Scaling=choice("None","Block","Linear","Cubic","Lanczos") +#@gui :Lock Return Scaling to Source Layer=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/30/03.") +#@gui Pack:fx_pack,fx_pack_preview(1) : * +#@gui :Order By=choice(2,"Width","Height","Maximum Dimension","Area","Name") +#@gui :Tends to Be Square=bool(1) +#@gui :Force Transparency=bool(1) +#@gui :Add Image Label=bool(0) +#@gui :Font Height (px)=float(16,0,64)_0 +#@gui :Font Colors=choice(1,"White on Black","Black on White")_0 +#@gui :_=separator() +#@gui :Output Coordinates File=_bool(0) +#@gui :Output Folder=_folder() +#@gui :_=separator() +#@gui :_=note{"This filter tries to pack all input layers into a single image, while trying to minimize the empty areas. This problem being NP-hard, the algorithm finds (of course) a non-optimal, but often acceptable solution to this packing problem."} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/03/20.") +#@gui Stroke:fx_stroke,fx_stroke_preview(0) +#@gui :Thickness (px)=int(3,1,256) +#@gui :Threshold (%)=float(50,0,100) +#@gui :Smoothness (px)=float(0,0,10) +#@gui :Shape=choice(2,"Square","Diamond","Round") +#@gui :Direction=choice(1,"Inward","Outward") +#@gui :_=separator() +#@gui :Zoom (%)=float(100,1,300) +#@gui :X-Shift (px)=int(0,-256,256) +#@gui :Y-Shift (px)=int(0,-256,256) +#@gui :_=separator() +#@gui :Starting Color=color(#ffffffff) +#@gui :Ending Color=color(#ffffffff) +#@gui :Inside Color=color(#00000000) +#@gui :Outside Color=color(#00000000) +#@gui :_=separator() +#@gui :Output Stroke Layer On=choice(1,"Bottom","Top") +#@gui :Keep Original Image Size=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/24/06.") +#@gui Tiles to Layers:fx_tiles2layers,fx_tiles2layers_preview(1) +#@gui :X-Tiles=int(3,1,100) +#@gui :Y-Tiles=int(3,1,100) +#@gui :Force Tiles to Have Same Size=_bool(false) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Tones to Layers:fx_tones2layers,fx_tones2layers_preview(0) +#@gui :Number of Tones=int(3,2,10) +#@gui :Start of Mid-Tones=int(85,0,255) +#@gui :End of Mid-Tones=int(170,0,255) +#@gui :Smoothness=float(0.5,0,5) +#@gui :Alpha=choice("Binary","Scalar") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/05/04.") +#@gui _Lights & Shadows +#@gui Burn:fx_burn,fx_burn_preview(1) +#@gui :Amplitude=float(0.5,0,1) +#@gui :Scale=float(30,1,100) +#@gui :Smoothness=float(1,0,4) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/24/11.") +#@gui Contrast Swiss Mask:fx_contrast_swm,fx_contrast_swm(0) +#@gui :_=separator() +#@gui :Blur the Mask=float(2,0.5,10) +#@gui :_=separator() +#@gui :_=note("Contrast Mask need the negative of the mask") +#@gui :Skip to Use the Mask to Boost=bool(false) +#@gui :_=note("Uncheck for Contrast Mask,Check for Contrast Boost") +#@gui :_=separator() +#@gui :_=note("Merge the Mask") +#@gui :Intensity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX.      Latest Update: 2011/01/01.") +#@gui :_=link("Filter explained here","http://www.gimpchat.com/viewtopic.php?f=9&t=864") +#@gui Dodge and Burn:fx_dodgeburn,fx_dodgeburn_preview(1) +#@gui :_=note("automatic dodging and burning") +#@gui :_=separator() +#@gui :Highlights Selection=float(15,0,100) +#@gui :Highlights Abstraction=float(1.5,0,10) +#@gui :Dodge Strength=float(25,0,256) +#@gui :Dodge Blur=float(10,0,20) +#@gui :Shadows Selection=float(40,0,100) +#@gui :Shadows Abstraction=float(1.5,0,10) +#@gui :Burn Strength=float(25,0,256) +#@gui :Burn Blur=float(10,0,20) +#@gui :_=separator() +#@gui :_=note("Advanved: output dodge and burn layer separate") +#@gui :Keep Layers Separate=bool(0) +#@gui :Keep Original Layer=bool(0) +#@gui :Blur Dodge and Burn Layer=float(10,0,20) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil. Latest update: 2011/15/02.") +#@gui Drop Shadow:fx_drop_shadow,fx_drop_shadow(1) +#@gui :X-Shadow=float(3,-20,20) +#@gui :Y-Shadow=float(3,-20,20) +#@gui :Smoothness=float(1.8,0,5) +#@gui :Curvature=float(0,0,1) +#@gui :Corner Brightness=float(0,0,1) +#@gui :Angle=float(0,0,360) +#@gui :Keep Original Size=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/14/11.") +#@gui Drop Shadow 3D:fx_drop_shadow3d,fx_drop_shadow3d_preview(1) +#@gui :X-Angle=float(0,-90,90) +#@gui :Y-Angle=float(0,-90,90) +#@gui :Z-Angle=float(0,-90,90) +#@gui :Zoom=float(0,-100,100) +#@gui :X-Offset=float(1,-50,50) +#@gui :Y-Offset=float(1,-50,50) +#@gui :Perspective=float(2,0,10) +#@gui :Smoothness=float(0.5,0,5) +#@gui :Color=color(#000000c8) +#@gui :Preview Only Shadow=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/02/07.") +#@gui Equalize Light:fx_equalize_light,fx_equalize_light_preview(1) +#@gui :Amount (%)=float(75,0,100) +#@gui :Mode=choice("Preserve Range","Preserve Covariance") +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/03/23.") +#@gui Equalize Shadow:fx_equalize_shadow,fx_equalize_shadow_preview(1) +#@gui :Amplitude=float(1,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: Francois Grassard and David Tschumperlé.       Latest Update: 2021/03/23.") +#@gui Guided Light Rays:fx_guided_lightrays,fx_guided_lightrays_preview(1) : + +#@gui :Amplitude (%)=float(10,0,100) +#@gui :Ray Length=float(2,0,2) +#@gui :Mode=choice("Boundary","Dense") +#@gui :Density (%)=float(80,0,100) +#@gui :Smoothness (%)=float(0.1,0,5) +#@gui :Threshold (%)=float(50,0,100) +#@gui :Light Position=point(50,50,0,1,255,255,0,-128,1%) +#@gui :Light Color=color(#ffffff) +#@gui :Blend Mode=choice(7,"Add","Alpha","Grain Merge","Hard Light","Lighten","Lightness","Luminance","Overlay","Soft Light","Value") +#@gui :Opacity (%)=float(100,0,100) +#@gui :_=separator() +#@gui :Preview Light Shape=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/04/06.") +#@gui Illuminate 2D Shape:fx_illuminate_shape2d,fx_illuminate_shape2d_preview(1)+ +#@gui :_=note("Input / Output:) +#@gui :Input Type=choice("Single Opaque Shapes Over Transp. BG","Multiple Colored Shapes Over Transp. BG","Bump Map","Normal Map") +#@gui :Output Type=choice("Illumination","Bump Map","Normal Map") +#@gui :Input Guide Color=color(#ff0000ff) +#@gui :Keep Base Layer as Input Background=bool(1) +#@gui :Keep Transparency in Output=bool(1) +#@gui :_=separator() +#@gui :_=note("Shape:) +#@gui :Minimal Shape Area=int(4,1,100) +#@gui :_=note("Parameter Minimal shape area is only active in Multiple colored shapes input mode.") +#@gui :Preview Detected Shapes=bool(0) +#@gui :Erosion / Dilation=float(0,-10,10) +#@gui :Smoothness=float(3,0,6) +#@gui :Bump Factor=float(1,-5,5) +#@gui :Std / Max Weight=float(0.5,0,1) +#@gui :Resolution=choice{4,"Full (Slower)","2048","1024","512","256","128","64 (Faster)"} +#@gui :_=separator() +#@gui :_=note("Illumination:) +#@gui :Blending Mode=choice(10,"Normal","Lighten","Screen","Dodge","Add","Darken","Multiply","Burn","Overlay","Soft Light","Hard Light","Grain Merge") +#@gui :Opacity (%)=float(75,0,100) +#@gui :Ambient (%)=float(30,-100,100) +#@gui :Diffuse (%)=float(40,0,200) +#@gui :Specular (%)=float(40,0,300) +#@gui :Shininess=float(80,0,100) +#@gui :Smoothness=float(0.2,0,5) +#@gui :Flatness=float(1,0,3) +#@gui :Linearity=float(0,-100,100) +#@gui :Levels=int(0,0,16) +#@gui :Light-X=float(2,-20,20) +#@gui :Light-Y=float(-2,-20,20) +#@gui :Light-Z=float(2,0,20) +#@gui :Normalize Illumination=bool(0) +#@gui :_=separator() +#@gui :Open Interactive Preview=button() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Note: This filter automatically adds illumination to an opaque shape defined over a transparent background.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/05/18.") +#@gui Light Glow:fx_lightglow,fx_lightglow_preview(0) +#@gui :Density=float(30,0,100) +#@gui :Amplitude=float(0.5,0,2) +#@gui :Mode=choice(8,"Burn","Dodge","Freeze","Grain Merge","Hard Light","Interpolation","Lighten","Multiply","Overlay","Reflect","Soft Light","Stamp","Value") +#@gui :Opacity=float(0.8,0,1) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/21/02.") +#@gui Light Leaks:fx_light_leaks,fx_light_leaks_preview(1) +#@gui :Leak Type=int(0,0,70) +#@gui :Angle=float(0,-180,180) +#@gui :X-Scale=float(1,1,10) +#@gui :Y-Scale=float(1,1,10) +#@gui :Hue=float(0,-180,180) +#@gui :Opacity=float(0.85,0,1) +#@gui :Blend Mode=choice(2,"Normal","Lighten","Screen","Dodge","Add","Darken","Multiply","Burn","Overlay","Soft Light","Hard Light","Difference","Subtract","Grain Extract","Grain Merge","Divide","Hue","Saturation","Value") +#@gui :Output as Separate Layers=_bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("This filter uses the free light leaks dataset available at :") +#@gui :_=link("Lomo Light Leaks","http://www.photoshoptutorials.ws/downloads/mockups-graphics/lomo-light-leaks/") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/01/07.") +#@gui Light Patch:fx_light_patch,fx_light_patch(0) +#@gui :Density=int(5,2,30) +#@gui :Darkness=float(0.7,0,1) +#@gui :Lightness=float(2.5,1,4) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Light Rays:fx_lightrays,fx_lightrays(1) +#@gui :Density=float(80,0,100) +#@gui :Center (%)=point(50,50,0,1) +#@gui :Length=float(1,0,1) +#@gui :Attenuation=float(0.5,0,1) +#@gui :Transparency=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/03/01.") +#@gui Pop Shadows:fx_pop_shadows,fx_pop_shadows_preview(1) +#@gui :Strength=float(0.75,0,1) +#@gui :Scale=float(5,0,20) +#@gui :Post-Normalize=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: Morgan Hardwood and David Tschumperlé.       Latest Update: 2017/03/05.") +#@gui Relief Light:fx_light_relief,fx_light_relief(1) +#@gui :Ambient Lightness=float(0.3,0,5) +#@gui :Specular Lightness=float(0.2,0,2) +#@gui :Specular Size=float(0.2,0,1) +#@gui :Darkness=float(0,0,1) +#@gui :Light Smoothness=float(1,0,5) +#@gui :XY-Light=point(50,50,0,1,255,255,128,200,10) +#@gui :Z-Light=float(5,0,20) +#@gui :Z-Scale=float(0.5,0,3) +#@gui :Opacity as Heightmap=bool(0) +#@gui :Image Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Shadow Patch:fx_shadow_patch,fx_shadow_patch(1) +#@gui :Opacity=float(0.7,0,1) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Slice Luminosity:fx_slice_luminosity,fx_slice_luminosity_preview +#@gui :Luminosity Type=choice(1,"Average RGB","Luminance","Lightness","Value") +#@gui :Output As=_choice(1,"Mask","Masked Image") +#@gui :Preview Type=choice(2,"Mask","Mask + Background","Image","Image + Background") +#@gui :_=separator() +#@gui :_=note{"Slice 1 (shadows):"} +#@gui :Activate Slice 1=bool(1) +#@gui :Starting Value=int(0,0,255) +#@gui :Ending Value=int(64,0,255) +#@gui :Starting Feathering=int(0,0,255) +#@gui :Ending Feathering=int(0,0,255) +#@gui :_=separator() +#@gui :_=note{"Slice 2 (low midtones):"} +#@gui :Activate Slice 2=bool(1) +#@gui :Starting Value=int(64,0,255) +#@gui :Ending Value=int(128,0,255) +#@gui :Starting Feathering=int(0,0,255) +#@gui :Ending Feathering=int(0,0,255) +#@gui :_=separator() +#@gui :_=note{"Slice 3 (high midtones):"} +#@gui :Activate Slice 3=bool() +#@gui :Starting Value=int(128,0,255) +#@gui :Ending Value=int(192,0,255) +#@gui :Starting Feathering=int(0,0,255) +#@gui :Ending Feathering=int(0,0,255) +#@gui :_=separator() +#@gui :_=note{"Slice 4 (highlights):"} +#@gui :Activate Slice 4=bool() +#@gui :Starting Value=int(192,0,255) +#@gui :Ending Value=int(255,0,255) +#@gui :Starting Feathering=float(0,0,255) +#@gui :Ending Feathering=float(0,0,255) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/22/09.") +#@gui _Patterns +#@gui Bayer Filter:rgb2bayer,rgb2bayer(0) +#@gui :Starting Pattern=choice(0,"Red-Green","Blue-Green","Green-Red","Green-Blue") +#@gui :Keep Colors=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Box Fitting:fx_boxfitting,fx_boxfitting(0) +#@gui :Minimal Size=int(3,1,32) +#@gui :Maximal Size=int(0,0,32) +#@gui :_=note("Note: Set Maximal size to 0 to allow any size for the squares.") +#@gui :Initial Density=float(0.25,0,1) +#@gui :Minimal Spacing=int(2,1,16) +#@gui :Transparency=bool(0) +#@gui :_=separator() +#@gui :_=note("Note: This filter has been highly inspired by the work of Jared Tarbell, described on the page:") +#@gui :_=link("http://www.complexification.net/gallery/machines/boxFittingImg/") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/06/06.") +#@gui Camouflage:fx_camouflage,fx_camouflage +#@gui :Scale=int(9,2,12) +#@gui :Levels=int(12,2,32) +#@gui :Coherence=float(100,0,1000) +#@gui :Color 1=color(#1e2e21) +#@gui :Color 2=color(#4b5a41) +#@gui :Color 3=color(#b3bd75) +#@gui :Color 4=color(#fff69e) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/26/10.") +#@gui Canvas:fx_canvas,fx_canvas_preview(0) +#@gui :_=note("First direction :") +#@gui :Amplitude=float(70,0,300) +#@gui :Angle=float(45,0,180) +#@gui :Sharpness=float(400,0,2000) +#@gui :_=note("\nSecond direction : ") +#@gui :Activate Second Direction=bool(true) +#@gui :Amplitude=float(70,0,300) +#@gui :Angle=float(135,0,180) +#@gui :Sharpness=float(400,0,2000) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Canvas Texture:texturize_canvas,texturize_canvas(0) +#@gui :Amplitude=float(20,0,256) +#@gui :Fibrousness=float(3,0,20) +#@gui :Emboss=float(0.6,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Clouds:jeje_clouds,jeje_clouds_preview +#@gui :Density=float(50,0,100) +#@gui :Smoothness=float(.5,0,1) +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/05/29.") +#@gui Cracks:fx_cracks,fx_cracks_preview(0) +#@gui :Density (%)=float(30,0,100) +#@gui :Relief=bool(true) +#@gui :Color=color(#ffffff80) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/07.") +#@gui Crystal:fx_crystal,fx_crystal_preview(0) +#@gui :Density=float(50,0,100) +#@gui :Smoothness=float(0.2,0,2) +#@gui :Edges=float(20,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/19/01.") +#@gui Crystal Background:fx_crystal_background,fx_crystal_background +#@gui :Iterations=int(10,1,32) +#@gui :Density (%)=float(25,0,100) +#@gui :Random Seed=int(0,0,65535) +#@gui :Opacity (%)=float(100,0,100) +#@gui :Color=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/18/10.") +#@gui Fibers:jeje_fibers,jeje_fibers_preview +#@gui :Number=int(10,1,100) +#@gui :Length=int(50,1,100) +#@gui :Smoothness=float(10,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2015/07/17.") +#@gui Freqy Pattern:jeje_freqy_pattern,jeje_freqy_pattern_preview +#@gui :Random=float(50,0,100) +#@gui :Scale 1=float(33,1,100) +#@gui :Scale 2=float(50,1,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2018/09/25.") +#@gui Halftone:fx_halftone,fx_halftone_preview(0) +#@gui :_=note("Image parameters :") +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Halftone parameters :") +#@gui :Number of Tones=int(5,2,32) +#@gui :Size for Dark Tones=int(8,2,256) +#@gui :Size for Bright Tones=int(8,2,256) +#@gui :Shape=choice{5,"Square","Diamond","Circle","Square (Inv.)","Diamond (Inv.)","Circle (Inv.)"} +#@gui :Smoothness=float(0.1,0,32) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/23/07.") +#@gui Halftone [Generic]:fx_generic_halftone,fx_generic_halftone_preview(1)* +#@gui :_=note("Global Settings:") +#@gui :Background=choice("Black","White") +#@gui :Base Shape=choice(1,"Square","Disc") +#@gui :Max Radius (%)=float(100,0,300) +#@gui :Smoothness (%)=float(10,0,100) +#@gui :Antialiasing=choice(1,"None","X1.25","X1.5","X2","X2.5") +#@gui :Black & White=bool() +#@gui :_=separator() +#@gui :_=note("Halftoning Shape:") +#@gui :Shape=choice{4,"Custom (Top Layer)","Dots","Lines","Self","Spiral"} +#@gui :Layout=choice("Regular","Semi-Regular","Random")_0 +#@gui :Density (%)=float(75,0,100) +#@gui :Smoothness (%)=float(1,0,100)_0 +#@gui :Angle=float(0,0,360)_0 +#@gui :_=separator() +#@gui :_=note{"Note: When adding a top layer that defines a custom halftoning shape, it is recommended to use 1px wide strokes, for a better (and faster) result. "} +#@gui :_=value("-1") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.       Latest Update: 2022/11/07.") +#@gui Hearts:fx_hearts,fx_hearts_preview(0) +#@gui :Density=float(2,0,30) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Lava:fx_lava,fx_lava_preview(0) +#@gui :Perturbation=int(8,0,15) +#@gui :Smoothness=float(5,0,100) +#@gui :Scale=float(3,0,20) +#@gui :Sharpness=float(0,0,1000) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/26/11.") +#@gui Marble:fx_marble,fx_marble +#@gui :Image Weight=float(.5,0,30) +#@gui :Pattern Weight=float(1,0,30) +#@gui :Pattern Angle=float(0,0,360) +#@gui :Amplitude=float(0,0,1000) +#@gui :Sharpness=float(.4,0,5) +#@gui :Anisotropy=float(.6,0,1) +#@gui :Alpha=float(.6,0,20) +#@gui :Sigma=float(1.1,0,20) +#@gui :Cut Low=float(0,0,100) +#@gui :Cut High=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("Author: Preben Soeberg.      Latest Update: 2010/29/12.") +#@gui Maze:fx_maze,fx_maze +#@gui :Cell Size=int(24,1,256) +#@gui :Thickness=int(1,1,10) +#@gui :Masking=choice("None","Render on Dark Areas","Render on White Areas") +#@gui :Preserve Image Dimension=bool(1) +#@gui :Maze Type=choice("Dark Walls","White Walls") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/02/09.") +#@gui Mineral Mosaic:fx_mineral_mosaic,fx_mineral_mosaic(0) +#@gui :Density=float(1,0,3) +#@gui :Area=float(2,0,32) +#@gui :Smoothness=float(1,0,10) +#@gui :Shade Strength=float(100,0,255) +#@gui :Shade Angle=float(0,0,360) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/01/02.") +#@gui Mosaic:fx_mosaic,fx_mosaic_preview(0) +#@gui :Density (%)=float(50,0,100) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/19/07.") +#@gui Op Art:fx_shapes,fx_shapes_preview(0) +#@gui :Shape=choice{1,"Custom Layers","Circles","Squares","Diamonds","Triangles","Horizontal Stripes","Vertical Stripes","Balls","Hearts","Stars","Arrows","Truchet","Circles (Outline)","Squares (Outline)","Diamonds (Outline)","Triangles (Outline)","Hearts (Outline)","Stars (Outline)","Arrows (Outline)"} +#@gui :Number of Scales=int(16,2,24) +#@gui :Resolution=float(10,1,50) +#@gui :Zoom Factor=_int(2,1,8) +#@gui :Minimal Size=float(5,0,150) +#@gui :Maximal Size=float(90,0,150) +#@gui :Stencil Type=choice(0,"Black & White","RGB","Color") +#@gui :Allow Angle=choice("0 Deg.","90 Deg.","180 Deg.") +#@gui :Negative=bool(1) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Note: If you set the parameter Shape to Custom layers, the different shapes used to map the pixel intensities will be defined as the Number of scales top layers of your image. Don't forget to set also Input layers to All to be sure these layers are passed to the filter. ") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/16/12.") +#@gui Pack Ellipses:fx_pack_ellipses,fx_pack_ellipses_preview(0) +#@gui :Min Radius (px)=float(3,1,256) +#@gui :Max Radius (px)=float(20,1,256) +#@gui :Radius Dilation/Erosion (px)=float(0,-10,10) +#@gui :Min Isotropy (%)=float(30,0,100) +#@gui :Max Isotropy (%)=float(100,0,100) +#@gui :Isotropy Quantization=int(6,0,16) +#@gui :Orientation=choice{1,"Isotropic (Circles Only)","Anisotropic (Along Contours)","Anisotropic (Orthogonal to Contours)"} +#@gui :Region Analysis Size=int(3,0,10) +#@gui :Background Color=color(#000000ff) +#@gui :Render Resolution=_choice("X1","X2","X3","X4","X5","X6","X7","X8") +#@gui :Preserve Image Size=_bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2023/03/29.") +#@gui Pack Sprites:fx_pack_sprites,gui_no_preview +#@gui :Number of Scales=int(5,1,16) +#@gui :Minimal Scale (%)=float(25,1,100) +#@gui :Allow Angle=choice(3,"0 Deg.","180 Deg.","90 Deg.","Any") +#@gui :Spacing=int(1,-16,16) +#@gui :Precision=int(7,1,32) +#@gui :_=separator() +#@gui :Masking=choice("No Masking","Mask as Bottom Layer") +#@gui :Width=int(512,32,2048) +#@gui :Height=int(512,32,2048) +#@gui :_=note("Notes:\n - Parameters Width and Height are considered only when No masking mode is selected.\n - Set different sprites on different layers to pack multiple sprites at the same time.") +#@gui :_=link("Click here for a video tutorial","http://www.youtube.com/watch?v=bpg7CGH7vCM") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/24/06.") +#@gui Paper Texture:fx_paper,fx_paper_preview(0) +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Periodic Dots:jeje_periodic_dots,jeje_periodic_dots_preview +#@gui :Number=int(6,2,32) +#@gui :Scale=float(4,1,12) +#@gui :Angle=float(0,0,360) +#@gui :Repeat=int(1,1,10) +#@gui :Map=choice(None,Default,HSV,Lines,Hot,Cool,Jet,Flag,Cube) +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/05/29.") +#@gui Pills:fx_pills,fx_pills_preview +#@gui :Mode=choice("Gray","RGB") +#@gui :_=separator() +#@gui :_=note("Gray Settings:") +#@gui :Cycles=float(4,0,32)_2- +#@gui :Angle=float(0,0,360)_2 +#@gui :_=separator() +#@gui :_=note("Red Settings:") +#@gui :Cycles=float(4,0,32)_0- +#@gui :Angle=float(0,0,360)_0 +#@gui :_=separator() +#@gui :_=note("Green Settings:") +#@gui :Cycles=float(4,0,32)_0- +#@gui :Angle=float(0,0,360)_0 +#@gui :_=separator() +#@gui :_=note("Blue Settings:") +#@gui :Cycles=float(4,0,32)_0- +#@gui :Angle=float(0,0,360)_0 +#@gui :_=separator() +#@gui :_=note{"Note: This filter evaluates the awesome math formula proposed by Miloslav Číž (a.k.a. DrummyFish) on this Wikipedia page. "} +#@gui :_=separator() +#@gui :_=note("Authors: Miloslav Číž and David Tschumperlé.       Latest Update: 2022/11/08.") +#@gui Plaid:fx_plaid_texture,fx_plaid_texture(1) +#@gui :Line=float(50,0,100) +#@gui :Number of Angles=int(2,1,8) +#@gui :Starting Angle=float(0,0,360) +#@gui :Angle Range=float(90,0,360) +#@gui :Smoothness=float(1,0,5) +#@gui :Sharpen=float(300,0,1000) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/16/05.") +#@gui Polka Dots:fx_polka_dots,fx_polka_dots(1) +#@gui :Size=float(80,0,100) +#@gui :Density=float(20,0.1,100) +#@gui :First Offset=float(50,0,100) +#@gui :Second Offset=float(50,0,100) +#@gui :Angle=float(0,0,180) +#@gui :Aliasing=float(0.5,0.1,1) +#@gui :Shading=float(0.1,0.1,1) +#@gui :Opacity=float(1,0,1) +#@gui :Color=color(#ff0000ff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Random Color Ellipses:fx_color_ellipses,fx_color_ellipses(1) +#@gui :Density=int(400,0,3000) +#@gui :Radius=float(8,0,30) +#@gui :Opacity=float(0.1,0.01,0.5) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Random Pattern:fx_random_pattern,fx_random_pattern_preview(1) +#@gui :Size=_int(1024,16,8192) +#@gui :Min Detail Level=float(2,0,20) +#@gui :Seed=float(4038,0,100000) +#@gui :Randomize Seed=button() +#@gui :_=separator() +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/10/08.") +#@gui Rays:jeje_rays,jeje_rays_preview +#@gui :X Center=float(50,0,100) +#@gui :Y Center=float(50,0,100) +#@gui :Frequency=float(10,0,100) +#@gui :Angle=float(0,0,360) +#@gui :Proportion=float(0.5,0,1) +#@gui :Color 1=color(#ff0000) +#@gui :Color 2=color(#ffff00) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2023/07/13.") +#@gui Resynthetize Texture [FFT]:syntexturize,fx_syntexturize_preview(1) +#@gui :Width=_int(1024,32,8192) +#@gui :Height=_int(1024,32,8192) +#@gui :Equalize Light=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note{"Note: This filter tries to re-synthetize a micro-texture (given as the input image) onto an output (seamless) image with an arbitrary size. It uses a phase randomization technique, as described in:"} +#@gui :_=link("Micro-Texture Synthesis by Phase Randomization","http://www.ipol.im/pub/art/2011/ggm_rpn/") +#@gui :_=note("This filter is based on the work of Bruno Galerne, Yann Gousseau and Jean-Michel Morel.") +#@gui :_=separator() +#@gui :_=link("Click here for a detailed description of this filter.","http://gimpchat.com/viewtopic.php?f=28&t=10141") +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé and Jérome Boulanger.       Latest Update: 2014/09/04.") +#@gui Resynthetize Texture [Patch-Based]:syntexturize_matchpatch,fx_syntexturize_matchpatch_preview(1) +#@gui :Width=_int(512,32,8192) +#@gui :Height=_int(512,32,8192) +#@gui :Number of Scales=int(0,0,16) +#@gui :Patch Size=int(7,1,32) +#@gui :Blending Size=int(5,1,24) +#@gui :Precision=float(1,0,5) +#@gui :Equalize Light=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note{"Note: This filter tries to re-synthetize an input texture image onto a bigger output image (with an arbitrary size). Beware, this filter is quite slow to compute!"} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/22/10.") +#@gui Rorschach:fx_rorschach,fx_rorschach +#@gui :Scale=float(3,0,10) +#@gui :Mirror=choice(1,"None","X-Axis","Y-Axis","XY-Axes") +#@gui :Stencil Type=choice(2,"Black & White","RGB","Color") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/12/03.") +#@gui Satin:fx_satin,fx_satin(1) +#@gui :Iterations=int(20,4,128) +#@gui :Smoothness (%)=float(1,0,5) +#@gui :Seed=int(0,0,65535) +#@gui :_=separator() +#@gui :Dark Color=color(#000000ff) +#@gui :Light Color=color(#ffffffff) +#@gui :Stretch Contrast=bool(0) +#@gui :_=separator() +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(-50,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :_=note("This filter has been inspired by this tutorial from DeviantArt user fence-post.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/11/27.") +#@gui Seamless Deco:fx_mad_rorscharchp,fx_mad_rorscharchp +#@gui :Scale=float(3,0,15) +#@gui :Mixer=choice("Average","Grain Extract","Vivid Edges","Difference","Exclusion","Negation") +#@gui :_=separator() +#@gui :Line=float(50,0,100) +#@gui :Smoothness=float(1,0,5) +#@gui :Sharpen=float(300,0,1000) +#@gui :_=separator() +#@gui :Remix=choice("Vivid Edges","Average","Difference","Negation","Dark Edges") +#@gui :PhotoComix Preset=choice("Neat Merge","Lighty Smooth","Dream","Moody","Soft","Naif","Dark Boost","Whitening","None- Skip") +#@gui :Activate Mirror=choice("No-Skip",XY Mirror","2XY Mirror") +#@gui :_=separator() +#@gui :_=note("WARNING,'Expanding Mirrors' multiply image size of x4 or if '2XY Mirrors' x9") +#@gui :_=separator() +#@gui :Expanding Mirrors=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: PhotoComix. Latest update : 2011/13/11.") +#@gui Seamless Turbulence:fx_seamless_turbulence,fx_seamless_turbulence(0) +#@gui :Amplitude=float(15,0,30) +#@gui :Smoothness=float(20,0,40) +#@gui :Orientation=float(0,0,180) +#@gui :Deviation=float(1,0,1) +#@gui :Contrast=float(3,0,4) +#@gui :Color Rendering=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/02/04.") +#@gui Shock Waves:fx_shockwaves,fx_shockwaves_preview +#@gui :Amplitude=float(10,0,100) +#@gui :Low Frequency=float(10,0,100) +#@gui :Frequency Range=float(20,0,100) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/01/12.") +#@gui Sponge:fx_sponge,fx_sponge_preview(0) +#@gui :Size=int(13,3,21) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Stained Glass:fx_stained_glass,fx_stained_glass_preview(0) +#@gui :Edges=float(20,0,100) +#@gui :Shading=float(0.1,0,0.5) +#@gui :Thin Separators=bool(1) +#@gui :_=separator() +#@gui :Equalize=bool(1) +#@gui :Colors=float(1,0,3) +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/18/03.") +#@gui Stars:fx_stars,fx_stars(0) +#@gui :Density=float(10,0,200) +#@gui :Depth=float(0,0,5) +#@gui :Size=int(32,8,128) +#@gui :Branches=int(5,3,16) +#@gui :Thickness=float(0.38,0.1,1) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffff64c8) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/01/10.") +#@gui Stencil:fx_stencil,fx_stencil_preview(0) +#@gui :Radius=float(3,0,10) +#@gui :Smoothness=float(0,0,30) +#@gui :Iterations=int(8,1,100) +#@gui :Aliasing=float(0,0,5) +#@gui :Stencil Type=choice(2,"Black & White","RGB","Color") +#@gui :Transparency=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Strip:jeje_strip,jeje_strip_preview +#@gui :Angle=float(45,0,90) +#@gui :Frequency=float(50,0,100) +#@gui :Phase=float(0,0,180) +#@gui :Amplitude=float(1,0,2) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/06/07.") +#@gui Tetris:fx_tetris,fx_tetris(0) +#@gui :Scale=int(10,1,20) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Triangular Pattern:fx_triangular_pattern,fx_triangular_pattern(1)+ +#@gui :Random Seed=int(43,0,65535) +#@gui :_=separator() +#@gui :Depth=int(7,0,16) +#@gui :Split Type-1=int(4,0,20) +#@gui :Split Type-2=int(4,0,20) +#@gui :Split Type-3=int(4,0,20) +#@gui :Split Type-4=int(0,0,20) +#@gui :Split Type-5=int(0,0,20) +#@gui :Holes Probability (Type-5) (%)=float(0,0,100) +#@gui :_=separator() +#@gui :Filling Opacity (%)=float(100,0,100) +#@gui :Outline Color=color(#000000a0) +#@gui :Anti-Aliasing=choice(1,"None","X1.5","X2","X3","X4") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/09/29.") +#@gui Truchet:fx_truchet,fx_truchet(0) +#@gui :Scale=int(32,1,256) +#@gui :Radius=int(5,1,64) +#@gui :Smoothness=float(1,0,10) +#@gui :Type=choice(1,"Straight","Curved") +#@gui :Color=choice("White on Black","Black on White","White on Transparent","Black on Transparent","Transparent on White","Transparent on Black","Random") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/26/10.") +#@gui Turing:jeje_turing_pattern,gui_no_preview +#@gui :Scale=float(1,0,1) +#@gui :Iterations=int(2000,1,10000) +#@gui :Time Step=float(.1,.01,1) +#@gui :Alpha=float(.899,0,2) +#@gui :Beta=float(-.91,-2,2) +#@gui :Q=float(2,0,3) +#@gui :R=float(.1,0,3) +#@gui :Diffusivity=float(.25,.01,.6) +#@gui :_=separator() +#@gui :_=note(Generate turing pattern using a system of coupled reaction/diffusion equations. The patterns can change from line to spots like structures depending on the parameters. You may use the 'Stencil' filter to achieve similar effects. http://en.wikipedia.org/wiki/The_Chemical_Basis_of_Morphogenesis) +#@gui :_=note(Since the computation is long there is no preview. ) +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2015/01/16.") +#@gui Voronoi:fx_voronoi,fx_voronoi_preview(0) +#@gui :Threshold=float(160,0,255) +#@gui :Threshold On=choice(1,"Pixel Values","Gradient Values") +#@gui :Smoothness=float(0.5,0,10) +#@gui :Subsampling (%)=float(50,0,100) +#@gui :_=separator() +#@gui :Flat Color=choice(3,"Black","White","Transparent","Image") +#@gui :Outline Thickness=int(1,0,8) +#@gui :Outline Color=color(#00000064) +#@gui :Centers Radius=int(2,0,10) +#@gui :Centers Color=color(#ffffff28) +#@gui :_=separator() +#@gui :Anti-Aliasing=choice{1,"X1 (none)","X1.5","X2","X2.5"} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/04/30.") +#@gui Weave:weave,weave(1) +#@gui :Density=int(6,1,32) +#@gui :Thickness=float(65,0,100) +#@gui :Shadow=float(0,0,100) +#@gui :Shading=float(0.5,0,3) +#@gui :Fibers Amplitude=float(0,0,255) +#@gui :Fibers Smoothness=float(0,0,10) +#@gui :Angle=choice("0 Deg.","22.5 Deg.","45 Deg.","67.5 Deg.") +#@gui :X-Curvature=float(0,-1,1) +#@gui :Y-Curvature=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/18/01.") +#@gui Whirls:fx_whirls,fx_whirls_preview(0) +#@gui :Density=int(7,3,20) +#@gui :Smoothness=float(2,0,10) +#@gui :Darkness=float(0.2,0,1) +#@gui :Lightness=float(1.8,1,3) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui _Rendering +#@gui 3D Blocks:fx_blocks3d,fx_blocks3d(1) +#@gui :Resolution=int(32,1,128) +#@gui :Smoothness=float(0,0,40) +#@gui :Elevation=float(4,-10,10) +#@gui :Size=float(1.5,0,3) +#@gui :Angle=float(30,0,360) +#@gui :Tilt=float(60,0,90) +#@gui :FOV=float(45,1,90) +#@gui :Centering (%)=point(50,50) +#@gui :_=separator() +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(-50,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :Use Light=bool(1) +#@gui :Antialiasing=bool(1) +#@gui :Outline Color=color(#00000080) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/10/02.") +#@gui 3D Colored Object:fx_coloredobject3d,fx_coloredobject3d_preview(1) +#@gui :Type=choice(1,"Plane","Box","Pyramid","Ellipsoid","Torus","Gyroid","Weird","Cup") +#@gui :Color=color(#808080ff) +#@gui :_=separator() +#@gui :Size-1=float(0.5,0,3) +#@gui :Size-2=float(0.5,0,3) +#@gui :Size-3=float(0.5,0,3) +#@gui :X-Angle=float(57,0,360) +#@gui :Y-Angle=float(41,0,360) +#@gui :Z-Angle=float(21,0,360) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :Rendering=choice(4,"Dots","Wireframe","Flat","Flat-Shaded","Gouraud","Phong") +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/16/05.") +#@gui 3D Elevation:fx_elevation3d,fx_elevation3d_preview(1) +#@gui :Factor=float(100,-1000,1000) +#@gui :Smoothness=float(1,0,10) +#@gui :_=separator() +#@gui :Width=_int(1024,8,4096) +#@gui :Height=_int(1024,8,4096) +#@gui :Size=float(0.8,0,3) +#@gui :X-Angle=float(25,0,360) +#@gui :Y-Angle=float(0,0,360) +#@gui :Z-Angle=float(21,0,360) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :Rendering=choice(2,"Dots","Wireframe","Flat","Flat-Shaded","Gouraud","Phong") +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :Top Layer Defines Object Texture=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/11/10.") +#@gui 3D Extrusion:fx_extrude3d,fx_extrude3d_preview(1) +#@gui :Depth=float(10,1,1024) +#@gui :Resolution=int(512,1,1024) +#@gui :Smoothness=float(0.6,0,3) +#@gui :_=separator() +#@gui :Width=_int(1024,1,4096) +#@gui :Height=_int(1024,1,4096) +#@gui :Size=float(0.5,0,3) +#@gui :X-Angle=float(57,0,360) +#@gui :Y-Angle=float(41,0,360) +#@gui :Z-Angle=float(21,0,360) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :Rendering=choice(4,"Dots","Wireframe","Flat","Flat-Shaded","Gouraud","Phong") +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :Top Layer Defines Object Texture=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/11/10.") +#@gui 3D Image Object:fx_imageobject3d,fx_imageobject3d_preview(1) +#@gui :Type=choice(1,"Plane","Cube","Pyramid","Sphere","Torus","Gyroid","Weird","Cup","Rubik") +#@gui :_=separator() +#@gui :Width=_int(1024,1,4096) +#@gui :Height=_int(1024,1,4096) +#@gui :Size=float(0.5,0,3) +#@gui :X-Angle=float(57,0,360) +#@gui :Y-Angle=float(41,0,360) +#@gui :Z-Angle=float(21,0,360) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :Rendering=choice(4,"Dots","Wireframe","Flat","Flat-Shaded","Gouraud","Phong") +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui 3D Lathing:fx_lathing3d,fx_lathing3d_preview(1) +#@gui :Resolution=int(76,1,1024) +#@gui :Smoothness=float(2,0,5) +#@gui :Max Angle=float(361,0,361) +#@gui :_=separator() +#@gui :Width=_int(1024,1,4096) +#@gui :Height=_int(1024,1,4096) +#@gui :Size=float(0.5,0,3) +#@gui :X-Angle=float(0,0,360) +#@gui :Y-Angle=float(0,0,360) +#@gui :Z-Angle=float(0,0,360) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :Rendering=choice(4,"Dots","Wireframe","Flat","Flat-Shaded","Gouraud","Phong") +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :Top Layer Defines Object Texture=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui 3D Mesh:fx_mesh3d,fx_mesh3d_preview(1) : * +#@gui :3D Mesh Filename=file("") +#@gui :_=note{"(supported file formats are: .obj, .off and .gmz)."} +#@gui :_=value("0") +#@gui :_=separator() +#@gui :X-Axis=point(80,50,0,1,255,0,128,164,1%)_0 +#@gui :Y-Axis=point(50,70,0,1,128,255,0,164,1%)_0 +#@gui :Scale=point(60,60,0,1,255,200,128,164,0.75%)_0 +#@gui :Center=point(50,50,0,1,255,255,255,-100,2%)_0 +#@gui :_=value(-1) +#@gui :_=value(-1) +#@gui :Pre-Rotate / X=choice("0 Deg.","45 Deg.","90 Deg.","135 Deg.","180 Deg.","225 Deg.","270 Deg.","315 Deg.") +#@gui :Pre-Rotate / Y=choice("0 Deg.","45 Deg.","90 Deg.","135 Deg.","180 Deg.","225 Deg.","270 Deg.","315 Deg.") +#@gui :Pre-Rotate / Z=choice("0 Deg.","45 Deg.","90 Deg.","135 Deg.","180 Deg.","225 Deg.","270 Deg.","315 Deg.") +#@gui :Rendering Mode=choice(5,"Bounding Box","Dots","Wireframe","Flat","Flat Shaded","Gouraud Shaded","Phong Shaded") +#@gui :Face Orientation=choice("Normal","Reverted","Double-Sided") +#@gui :Materials=choice(2,"Discard Colors","Discard Textures","Keep Textures") +#@gui :Recovery Color=color(#c8c8c8) +#@gui :Focale (%)=float(100,0,500) +#@gui :Anti-Aliasing=_choice(1,"None","X1.5","X2","X3","X4") +#@gui :Custom Light=point(50,50,-1,1,255,255,0,-100,3%) +#@gui :Reset 3D Position=button() +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé       Latest Update: 2022/06/21.") +#@gui 3D Random Objects:fx_random3d,fx_random3d(1) +#@gui :Type=choice("Cube","Cone","Cylinder","Sphere","Torus") +#@gui :Density=int(50,1,300) +#@gui :Size=float(3,1,20) +#@gui :Z-Range=float(100,0,300) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :Rendering=choice(3,"Dots","Wireframe","Flat","Flat-Shaded","Gouraud","Phong") +#@gui :Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Algorithm A:fx_memoakten_algorithm_a,fx_memoakten_algorithm_a_preview(1)* +#@gui :Random Seed=int(0,0,65535) +#@gui :Density of Initial Points (%)=float(20,0,100) +#@gui :Rate of Primary Segments (%)=float(30,0,100) +#@gui :Rate of Secondary Segments (%)=float(30,0,100) +#@gui :Max Secondary Segments Occurences=int(2,1,16) +#@gui :Secondary Segments Centering Constraint (%)=float(50,0,100) +#@gui :Min Segment Length (%)=float(10,0,100) +#@gui :Max Segment Length (%)=float(50,0,100) +#@gui :Angle Constraint (%)=float(40,0,100) +#@gui :Line Thickness (px)=int(3,1,16) +#@gui :Density of Color Fill (%)=float(60,0,100) +#@gui :Anti-Aliasing=choice(1,"None","X1.5","X2") +#@gui :_=separator() +#@gui :Foreground Color=color(#000000) +#@gui :Background Color=color(#ffffff) +#@gui :Fill Color 1=color(#ff0000) +#@gui :Fill Color 2=color(#ff8000) +#@gui :Fill Color 3=color(#ffff00) +#@gui :Fill Color 4=color(#000000) +#@gui :_=separator() +#@gui :_=note("Note: This filter has been implemented after reading the following tweet from Memo Akten:") +#@gui :_=link("https://twitter.com/memotv/status/1556619064491102209") +#@gui :_=note{"I (David) found the idea really nice so I tried to convert the algorithm into a G'MIC script. The code is not optimized and probably very perfectible, but at least it works :)} +#@gui :_=separator() +#@gui :_=note{"Authors: Memo Akten (algorithm) and David Tschumperlé (G'MIC conversion)       Latest Update: 2022/08/09."} +#@gui Ball:fx_ball,fx_ball_preview(0) +#@gui :Radius=int(128,1,1024) +#@gui :Specular Light=float(0.8,0,8) +#@gui :Specular Size=float(1,0,8) +#@gui :Shadow=float(1.5,0,4) +#@gui :Color=color(#ff00ff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/27/11.") +#@gui Circle Art:fx_circle_art,fx_circle_art +#@gui :Type=choice(1,"Random","Lissajous Spiral") +#@gui :Density=float(15,0,100) +#@gui :Radius=float(0.5,0,1) +#@gui :Modulo=int(8,2,16) +#@gui :Anti-Aliasing=bool(1) +#@gui :Random Colors=bool(1) +#@gui :_=separator() +#@gui :_=note("Lissajous parameters:") +#@gui :Curve Length=float(15,0,50) +#@gui :Curve Angle=float(0,0,360) +#@gui :Minimal Radius=float(0,-5,5) +#@gui :Maximal Radius=float(0.5,-5,5) +#@gui :X-Dispersion=float(1,0,4) +#@gui :Y-Dispersion=float(1,0,4) +#@gui :X-Factor=int(1,0,16) +#@gui :Y-Factor=int(1,0,16) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/22/08.") +#@gui Equation Plot [Parametric]:fx_equation_parametric,fx_equation_parametric +#@gui :X(t)=text{"sin(t)*(exp(cos(t))-2*cos(4*t)-sin(t/12)^5)"} +#@gui :Y(t)=text{"cos(t)*(exp(cos(t))-2*cos(4*t)-sin(t/12)^5)"} +#@gui :Min-T=float(0,-1000,1000) +#@gui :Max-T=float(100,-1000,1000) +#@gui :Resolution=int(4096,2,32768) +#@gui :Outline Opacity=float(1,0,1) +#@gui :Dot Size=int(0,0,16) +#@gui :Start Color=color(#400000) +#@gui :End Color=color(#800000) +#@gui :Colored Outline=bool(1) +#@gui :Antialiasing=bool(1) +#@gui :Decoration=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/13/11.") +#@gui Equation Plot [Y=f(X)]:fx_equation_plot,fx_equation_plot +#@gui :F(X)=text{"X*c+10*cos(X+c+u)"} +#@gui :X-Min=float(-10,-100,100) +#@gui :X-Max=float(10,-100,100) +#@gui :Resolution=int(100,2,1024) +#@gui :Channels=int(3,1,32) +#@gui :Plot Type=choice(2,"None","Lines","Splines","Bars") +#@gui :Vertex Type=choice(0,"None","Points","Crosses 1","Crosses 2","Circles 1","Circles 2","Square 1","Square 2") +#@gui :_=separator() +#@gui :_=note("Note : Use variable X instead of x in the above equation to take care of the X-min/max settings. Variable c refers to the current channel number. Variable u refers to a uniformly distributed random value in [0,1]. Reduce resolution to be able to view separate graph vertices.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Gradient [Corners]:fx_corner_gradient,fx_corner_gradient +#@gui :Color 1 (Up/Left Corner)=color(#ffffff80) +#@gui :Color 2 (Up/Right Corner)=color(#ff0000ff) +#@gui :Color 3 (Bottom/Left Corner)=color(#00ff00ff) +#@gui :Color 4 (Bottom/Right Corner)=color(#0000ffff) +#@gui :_=separator() +#@gui :Colorspace=choice(1,"SRGB","Linear RGB","Lab") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Gradient [Custom Shape]:fx_custom_gradient,fx_custom_gradient_preview(1) +#@gui :_=note("Shape selection:") +#@gui :Select By=choice("Auto","Dark Pixels","Bright Pixels","Opaque Pixels") +#@gui :Smoothness=float(0,0,10) +#@gui :Threshold=float(0,0,100) +#@gui :Preview Shape=bool(1) +#@gui :_=note("Note: Shapes with small strokes may lead to incorrect previews.") +#@gui :_=separator() +#@gui :_=note("Gradient parameters:") +#@gui :Number of Colors=int(4,2,10) +#@gui :Cycles=float(1,1,16) +#@gui :Offset=float(0,0,100) +#@gui :Shading=float(128,1,256) +#@gui :Inner Length=float(100,0,100) +#@gui :Outer Length=float(100,0,100) +#@gui :Spatial Metric=choice(2,"Chebyshev","Manhattan","Euclidean") +#@gui :Color Metric=choice("RGB","HSV","Lab") +#@gui :Shade Back to First Color=bool(1) +#@gui :Preview Gradient=bool(0) +#@gui :Save Gradient As=_text("") +#@gui :_=separator() +#@gui :_=note("Color definitions:") +#@gui :Colormap Type=choice(1,"Pre-Defined","User-Defined") +#@gui :Pre-Defined Colormap=int(0,0,65535) +#@gui :1st Color=color(#000000ff) +#@gui :2nd Color=color(#ff0000ff) +#@gui :3rd Color=color(#ffff00ff) +#@gui :4th Color=color(#ffffffff) +#@gui :5th Color=color(#00ffffff) +#@gui :6th Color=color(#00ff00ff) +#@gui :7th Color=color(#0000ffff) +#@gui :8th Color=color(#808080ff) +#@gui :9th Color=color(#ff00ffff) +#@gui :10th Color=color(#00000000) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/03/10.") +#@gui Gradient [from Line]:fx_line_gradient,fx_line_gradient_preview(1) +#@gui :Starting Point (%)=point(0,0,0,1,255,0,0) +#@gui :Ending Point (%)=point(100,100,0,1,64,128,255) +#@gui :Sampling=float(100,0,100) +#@gui :Length=int(0,0,4096) +#@gui :_=note("Note: Set length to 0 to release gradient length constraints.") +#@gui :Sort Colors=choice("Don't Sort","By Red Component","By Green Component","By Blue Component","By Luminance","By Blue Chrominance","By Red Chrominance","By Lightness") +#@gui :Reverse Gradient=bool(0) +#@gui :_=separator() +#@gui :Preview Gradient=bool(1) +#@gui :Save Gradient As=_text("") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/29/06.") +#@gui Gradient [Linear]:fx_linear_gradient,fx_linear_gradient +#@gui :Starting Color=color(#000000ff) +#@gui :Ending Color=color(#ffffffff) +#@gui :Swap Colors=bool(0) +#@gui :Angle=float(45,0,360) +#@gui :Fade Start=float(0,0,100) +#@gui :Fade End=float(100,0,100) +#@gui :_=separator() +#@gui :Colorspace=choice(0,"SRGB","Linear RGB","Lab") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Gradient [Radial]:fx_radial_gradient,fx_radial_gradient +#@gui :Starting Color=color(#000000ff) +#@gui :Ending Color=color(#ffffffff) +#@gui :Swap Colors=bool(0) +#@gui :Fade Start=float(0,0,100) +#@gui :Fade End=float(100,0,100) +#@gui :Center (%)=point(50,50,0,1,255) +#@gui :_=separator() +#@gui :Colorspace=choice(0,"SRGB","Linear RGB","Lab") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/29/06.") +#@gui Gradient [Random]:fx_random_gradient,fx_random_gradient +#@gui :Density=int(32,1,1024) +#@gui :Seed=int(0,0,65535) +#@gui :Smoothness=float(0,0,10) +#@gui :Color Balance=color(#808080) +#@gui :Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/08/04.") +#@gui Hair Locks:gtutor_hairlock,gtutor_hairlock_preview(0) +#@gui :_=note("Geometry") +#@gui :Spread=float(0.5,0,1) +#@gui :Thickness=float(0.5,0,1) +#@gui :Length=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Color") +#@gui :Color=color(#ffff00ff) +#@gui :Variance=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Lighting") +#@gui :Azimuth=float(45,0,360) +#@gui :Highlight=float(0.5,0,1) +#@gui :Specular=float(0.5,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Garry R. Osgood. Latest update: 2014/12/11.") +#@gui :_=link("Hairlock instructions and tutorial.","https://gmic.eu/oldtutorial/the-hairlock-filter.shtml") +#@gui Hypotrochoid:fx_hypotrochoid,fx_hypotrochoid(1) +#@gui :Periods=int(37,1,100) +#@gui :Outer Radius (%)=float(100,0,300) +#@gui :Inner Radius (%)=float(74,0,300) +#@gui :Distance to Center (%)=float(80,0,300) +#@gui :Thickness (%)=float(0.5,0,5) +#@gui :Color=color(#ffffffff) +#@gui :Anti-Aliasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/01/25.") +#@gui Lightning:fx_lightning,fx_lightning_preview +#@gui :_=note("Global parameters:") +#@gui :Number of Streaks=int(20,1,1024) +#@gui :Size (%)=float(90,0,150) +#@gui :Resolution=int(256,2,4096) +#@gui :Randomness=float(3,0,16) +#@gui :Smoothness=float(1.5,0,10) +#@gui :Balance=float(0.75,0,1) +#@gui :Color=color(#ffffffff) +#@gui :Seed=int(0,0,65535) +#@gui :_=separator() +#@gui :_=note("Initial streak:") +#@gui :XY-Coordinates (%)=point(50,5,0,1) +#@gui :Angle (deg)=float(0,-180,180) +#@gui :Thickness (px)=int(6,1,64) +#@gui :Blur=float(0.2,0,3) +#@gui :_=separator() +#@gui :_=note("Auxiliary streaks:") +#@gui :Min Offset (%)=float(25,0,100) +#@gui :Max Offset (%)=float(60,0,100) +#@gui :Min Length (%)=float(95,0,200) +#@gui :Max Length (%)=float(100,0,200) +#@gui :Min Angle Deviation (deg)=float(30,0,180) +#@gui :Max Angle Deviation (deg)=float(40,0,180) +#@gui :Thickness Factor=float(-0.25,-1,1) +#@gui :Blur Factor=float(-0.1,-1,1) +#@gui :Opacity Factor=float(-0.20,-1,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/27/11.") +#@gui Lissajous:fx_lissajous,fx_lissajous(1) +#@gui :Resolution=int(4096,2,8192) +#@gui :_=separator() +#@gui :X-Size=float(0.9,0,2) +#@gui :Y-Size=float(0.9,0,2) +#@gui :Z-Size=float(3,1,10) +#@gui :_=separator() +#@gui :X-Multiplier=float(8,0,32) +#@gui :Y-Multiplier=float(7,0,32) +#@gui :Z-Multiplier=float(0,0,32) +#@gui :_=separator() +#@gui :X-Offset=float(0,0,1) +#@gui :Y-Offset=float(0,0,1) +#@gui :Z-Offset=float(0,0,1) +#@gui :_=separator() +#@gui :X-Angle=float(0,0,360) +#@gui :Y-Angle=float(0,0,360) +#@gui :Z-Angle=float(0,0,360) +#@gui :_=separator() +#@gui :Thickness=float(0,0,50) +#@gui :Color=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/18/04.") +#@gui Mandelbrot - Julia Sets:fx_mandelbrot,fx_mandelbrot_preview +#@gui :_=value(-2) +#@gui :_=value(-2) +#@gui :_=value(2) +#@gui :_=value(2) +#@gui :_=note("Fractal Type:") +#@gui :Fractal Set=choice("Mandelbrot","Julia") +#@gui :Iterations=int(1024,16,65535) +#@gui :X-Seed (Julia)=float(0.317,-2,2) +#@gui :Y-Seed (Julia)=float(0.03,-2,2) +#@gui :_=separator() +#@gui :_=note("Colormap:") +#@gui :Number of Colors=int(16,2,2048) +#@gui :Smoothness=int(8,1,256) +#@gui :Seed=int(255,0,65536) +#@gui :_=separator() +#@gui :_=note("Navigation:") +#@gui :Zoom Center=point(50,50,0,0,255,255,255,200) +#@gui :Zoom Factor=float(0.25,0,1) +#@gui :Zoom In=button() +#@gui :Center=button() +#@gui :Zoom Out=button() +#@gui :Display Coordinates=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/06/27.") +#@gui Neon Lightning:fx_neon_lightning,fx_neon_lightning(1) +#@gui :Source (%)=point(50,50) +#@gui :R0=float(0,0,100) +#@gui :Destination (%)=point(50,50) +#@gui :R1=float(100,0,100) +#@gui :_=separator() +#@gui :Density=int(50,1,512) +#@gui :Glow=float(0.7,0,5) +#@gui :Thickness=float(3,0,20) +#@gui :_=separator() +#@gui :Color=color(#825032) +#@gui :Color Dispersion=float(0.25,0,1) +#@gui :Transparency=float(0,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/30/06.") +#@gui Newton Fractal:fx_newton_fractal,fx_newton_fractal_preview +#@gui :_=value(-2) +#@gui :_=value(-2) +#@gui :_=value(2) +#@gui :_=value(2) +#@gui :_=note("Fractal Type:") +#@gui :Expression=choice(2,"Custom","Z^^2 - 1","Z^^3 - 1","Z^^5 - 1","Z^^6 + Z^^3 - 1","Z^^8 + 15*z^^4 - 1") +#@gui :P(z)=text{"rot(35°)*z^^3 - z^^2 + 1"}_1 +#@gui :P'(z)=text("3*z^^2 - 2*z")_1 +#@gui :P''(z)=text("6*z - 2")_1 +#@gui :Descent Method=choice(1,"Secant","Newton","Householder") +#@gui :Max Iterations=int(200,16,1024) +#@gui :Precision=float(2,0,12) +#@gui :_=separator() +#@gui :_=note("Rendering:") +#@gui :Coloring=choice(1,"By Custom Expression","By Iteration","By Value") +#@gui :Number of Colors=int(16,2,2048) +#@gui :Smoothness=int(8,1,256) +#@gui :Seed=int(255,0,65536) +#@gui :Colorspace=choice(2,"HSI","HSL","HSV")_0 +#@gui :Hue Min (%)=float(100,0,500)_0 +#@gui :Hue Max (%)=float(150,0,500)_0 +#@gui :Lightness Min (%)=float(20,0,500)_0 +#@gui :Lightness Max (%)=float(400,0,500)_0 +#@gui :Colorspace=choice(3,"RGB,"HSI","HSL","HSV","Lab")_0 +#@gui :Pre-Process=choice(2,"None","Equalize","Normalize","Equalize and Normalize")_0+ +#@gui :_=note{"Tips for Custom expressions:\n - Variables i0,i1 stand for the real and imaginary parts of the iterated complex number.\n - Variable i2 is the number of iterations required for convergence.\n - Variable z is the complex number with value [ i0,i1 ].\n - Functions p(z), dp(z) and d2p(z) are the expressions used for computing the fractal. "} +#@gui :Channel #1=text{"carg(-z)"}_0 +#@gui :Channel #2=text{"(i0 + i1)/2"}_0 +#@gui :Channel #3=text{"10*(i2^0.4)"}_0 +#@gui :Post-Process=choice(0,"None","Equalize","Normalize","Equalize and Normalize")_0 +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :Equalization (%)=float(0,0,100) +#@gui :Anti-Aliasing=choice(2,"X1","X1.5","X2","X2.5","X3","X3.5","4") +#@gui :_=note("Note: Anti-aliasing is applied on final rendering only, not on preview.") +#@gui :_=value(0)_2- +#@gui :_=separator() +#@gui :_=note("Navigation:") +#@gui :Zoom Center=point(50,50,0,0,255,255,255,200) +#@gui :Zoom Factor=float(0.5,0,1) +#@gui :Angle=float(0,-180,180) +#@gui :Zoom In=button() +#@gui :Center=button() +#@gui :Zoom Out=button() +#@gui :Reset View=button() +#@gui :Display Coordinates on Preview Window=bool(1) +#@gui :Preview Subsampling=choice(2,"None","X1.5","X2","X2.5","X3","X3.5","X4") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/01/09.") +#@gui Plasma:fx_plasma,fx_plasma(0) +#@gui :Alpha=float(0.5,0,5) +#@gui :Beta=float(0,0,100) +#@gui :Scale=int(8,2,10) +#@gui :Randomize=bool(0) +#@gui :Transparency=bool(0) +#@gui :Color Balance=color(#808080) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/20/03.") +#@gui Quick Copyright:fx_quick_copyright,fx_quick_copyright(0) +#@gui :Text=text("\\251 G'MIC") +#@gui :Size=int(27,13,128) +#@gui :Color=color(#ffffff80) +#@gui :Outline=int(1,0,4) +#@gui :Position=choice(3,"Up-Left","Up-Right","Bottom-Left","Bottom-Right") +#@gui :Offset=int(5,0,40) +#@gui :Orientation=choice(1,"-90 Deg.","0 Deg.","+90 Deg.","+180 Deg.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Rainbow:fx_rainbow,fx_rainbow +#@gui :Left Position=float(80,0,100) +#@gui :Right Position=float(80,0,100) +#@gui :Left Slope=float(175,0,400) +#@gui :Right Slope=float(175,0,400) +#@gui :Thinness=float(3,0.1,8) +#@gui :Opacity=float(80,0,199) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Shade Bobs:fx_shadebobs,fx_shadebobs +#@gui :_=note("Bobs parameters :") +#@gui :Density=int(50,1,200) +#@gui :Radius=int(5,1,100) +#@gui :Duration=int(200,1,500) +#@gui :Velocity=float(1,0,10) +#@gui :_=separator() +#@gui :_=note("Curve parameters :") +#@gui :Rx=float(-1,-3,3) +#@gui :Ry=float(2,-3,3) +#@gui :Rz=float(1,-3,3) +#@gui :Rt=float(0.8,-3,3) +#@gui :Rcx=float(0,-3,3) +#@gui :Colormap=choice(8,"Grayscale","Standard","HSV","Lines","Hot","Cool","Jet","Flag","Cube") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/18/04.") +#@gui Sine Curve:fx_sine_curve,fx_sine_curve_preview +#@gui :_=note("Curve parameters:") +#@gui :Preset=choice{1,"Default (Circle)","Alien Rasta","All Round","Carnivorous Plant","Cat Pad","Flower","Flower Cushion","Fly Karateka","Hearts","Moving Leaf","Radioactive Flower","Rosace","Spaceship","Transformer","Tubular Waves","Twisted Heart","Twisted Heart 2","Twisted Tunnel","Waterslide"} +#@gui :_=value(-1) +#@gui :Resolution (%)=float(75,0,100) +#@gui :Periods=float(1,0,3) +#@gui :_=separator() +#@gui :Parameter Settings=choice(1,"Ratios","Multipliers","Offsets","Exponents","Signs","3D Angles") +#@gui :_=note("Ratios:") +#@gui :Xa/Xb=float(0.5,0,1)_0- +#@gui :Ya/Yb=float(0.5,0,1)_0 +#@gui :Za/Zb=float(0.5,0,1)_0 +#@gui :_=note("Multipliers:") +#@gui :Xa-Multiplier=int(1,0,1024)_2- +#@gui :Ya-Multiplier=int(1,0,1024)_2 +#@gui :Za-Multiplier=int(0,0,1024)_2 +#@gui :Xb-Multiplier=int(800,0,1024)_2 +#@gui :Yb-Multiplier=int(800,0,1024)_2 +#@gui :Zb-Multiplier=int(1,0,1024)_2 +#@gui :_=note("Offsets:") +#@gui :Xa-Offset (deg.)=float(90,0,360)_0- +#@gui :Ya-Offset (deg.)=float(0,0,360)_0 +#@gui :Za-Offset (deg.)=float(0,0,360)_0 +#@gui :Xb-Offset (deg.)=float(90,0,360)_0 +#@gui :Yb-Offset (deg.)=float(0,0,360)_0 +#@gui :Zb-Offset (deg.)=float(0,0,360)_0 +#@gui :_=note("Exponents:") +#@gui :Xa-Exponent=float(1,0,32)_0- +#@gui :Ya-Exponent=float(1,0,32)_0 +#@gui :Za-Exponent=float(1,0,32)_0 +#@gui :Xb-Exponent=float(1,0,32)_0 +#@gui :Yb-Exponent=float(1,0,32)_0 +#@gui :Zb-Exponent=float(1,0,32)_0 +#@gui :_=note("Signs:") +#@gui :Xa-Sign=choice("Preserve","Invert","Negative","Positive")_0- +#@gui :Ya-Sign=choice("Preserve","Invert","Negative","Positive")_0 +#@gui :Za-Sign=choice("Preserve","Invert","Negative","Positive")_0 +#@gui :Xb-Sign=choice("Preserve","Invert","Negative","Positive")_0 +#@gui :Yb-Sign=choice("Preserve","Invert","Negative","Positive")_0 +#@gui :Zb-Sign=choice("Preserve","Invert","Negative","Positive")_0 +#@gui :_=note("3D Angles:") +#@gui :X-Angle (deg.)=float(0,-180,180)_0- +#@gui :Y-Angle (deg.)=float(0,-180,180)_0 +#@gui :Z-Angle (deg.)=float(0,-180,180)_0 +#@gui :Zoom=float(1,0,10)_0 +#@gui :Focale=int(8,1,20)_0 +#@gui :_=separator() +#@gui :_=note("Rendering parameters:") +#@gui :Center=point(50,50,0,1,0,238,85,-170,10)_0 +#@gui :_=value(50) +#@gui :_=value(50) +#@gui :Radius=point(68,68,0,1,238,0,85,-170,10)_0 +#@gui :Angle=point(75,50,0,1,238,85,0,-170,10)_0 +#@gui :_=value(75) +#@gui :_=value(50) +#@gui :Primary Radius (%)=float(3,0,100) +#@gui :Secondary Radius (%)=float(2,0,100) +#@gui :Opacity (%)=float(40,0,100) +#@gui :Color=color(#ffffff) +#@gui :Anti-Aliasing=choice(2,"None","× 1.25","× 1.5","× 2","× 3") +#@gui :_=separator() +#@gui :Preview Background=choice(1,"Image","Black","White") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/03/04.") +#@gui Superformula:fx_superformula,fx_superformula(1) +#@gui :Resolution=int(4096,2,8192) +#@gui :_=separator() +#@gui :X-Size=float(0.9,0,2) +#@gui :Y-Size=float(0.9,0,2) +#@gui :_=separator() +#@gui :M=int(8,1,32) +#@gui :N1=float(1,-32,32) +#@gui :N2=float(5,-32,32) +#@gui :N3=float(8,-32,32) +#@gui :_=separator() +#@gui :X-Angle=float(0,0,360) +#@gui :Y-Angle=float(0,0,360) +#@gui :Z-Angle=float(0,0,360) +#@gui :_=separator() +#@gui :Thickness=float(3,0,50) +#@gui :Color=color(#80ff80ff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/18/04.") +#@gui Symmetric 2D Shape:fx_symmetric_shape2d,fx_symmetric_shape2d_preview(1) +#@gui :Subdivisions=int(5,2,32) +#@gui :Center=point(50,50,0,1,255,255,255,128) +#@gui :_=value(50,50) +#@gui :Angle / Size=point(50,30,0,1,255,255,255,128) +#@gui :_=value(50,30) +#@gui :_=separator() +#@gui :Control Point 1=point(50,25,1,1,255,128,0,255,4) +#@gui :Control Point 2=point(56,42,1,1,255,128,0,255,4) +#@gui :Control Point 3=point(52,52,-1,1,255,128,0,255,4) +#@gui :Control Point 4=point(52,52,-1,1,255,128,0,255,4) +#@gui :Control Point 5=point(52,52,-1,1,255,128,0,255,4) +#@gui :Control Point 6=point(52,52,-1,1,255,128,0,255,4) +#@gui :_=separator() +#@gui :Drawing Mode=choice(1,"Outlined","Filled") +#@gui :Color=color(#ff00ff) +#@gui :Opacity (%)=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/06/17.") +#@gui Tangential Circles:cl_tangentialCircle,cl_tangentialCircle(1) +#@gui :_=note("Warning: This is a slow filter and it might consume too much RAM.") +#@gui :_=separator() +#@gui :_=note("Drawing:") +#@gui :Draw Big Circle=bool(1) +#@gui :Big Circle Radius=float(100,10,1000) +#@gui :Dimensions=choice{0,"According to Radius","According to Layer","According to Layer (Proportionate)","According to Layer (Scaling)"} +#@gui :_=note("If you choose "proportionate" or "Scaling", the Big Circle Radius is a percentage of 1/3 of the smaller dimension of the layer. Otherwise, it is a number of pixels.") +#@gui :Stroke Width=float(1,0.5,10) +#@gui :Number of Small Circles=int(5,2,100) +#@gui :Number of Levels=int(1,1,4) +#@gui :_=separator() +#@gui :_=note("Colors:") +#@gui :Background Color=color(#ffffff) +#@gui :Foreground Color=color(#000000) +#@gui :_=separator() +#@gui :_=note("Effects:") +#@gui :Effect=choice(0,"None","Transparent Background","Strange Polygons","Multicolored","Rainbow","Double","Colored Tube","Red-Yellow Halo","Blue-Cyan Halo") +#@gui :_=separator() +#@gui :_=note("Note: The preview might be much more aliased than the final result and some effects ignore colors.") +#@gui :_=separator() +#@gui :_=link("Filter discussed here","http://gimpchat.com/viewtopic.php?f=28&t=20121") +#@gui :_=note("Author: Claude Lion. Latest Update: 2022/11/14.") +#@gui :_=note("It uses filters of David Tschumperlé and Rod/GimpChat and an algorithm of Reptorian.") +#@gui Thorn Fractal - Secant Sea:gui_rep_tfrac,gui_rep_tfrac_preview +#@gui :_=note("Thorn Fractal is the fractal attributed to Andrew Wayne Graff, alternatively named the "Secant Sea".\nThe code was adapted from Sample C source code provided by Adam Majewski.\n\nDocumentation - Thorn Fractal by Paul Bourke\n\nAlternating Chaos formula are made by MadJik, and they are originally used in Fractal Attractor plugin for Paint.NET software.") +#@gui :_=separator() +#@gui :_=note("Style Setting") +#@gui :Predefined Formula=choice(0,"Normal","Normal Inverted","Arctangent","Tangent","Tanh Stroke","Asymphological Vibrato","Asymphological Basic","Asymphological Basic 2","Asymphochaos","Petallian","Semi-Thorny Petallian","Thorny Petal 1","Thorny Petal 2","Inflation","Inflation 2","Chaotic Creation","Earthing","Acrylic Earthing","Unearthing Origami","Cubic Unearthing","Webbing Cubic Unearthing","Chaotic Hooks Unearthing","Chaotic Hooks","Sinusoidal Liquid","Cosinusoidal Liquid","Echo Wide","Echo Squircle","Echo Hall","Echo Hall 2","Liquid Parabolic","Chaos-Vibrato","Chaos Deep-Vibrato","Chaos Spacetime","Parabolic","Parabolic Chaos","Cubic-Diamond Chaos","C-Line","Contour Chaos","Spiderweb-Diamond","Acrylica","Refractive Space","Smooth-Artistry","Ferrofluid","Triangular Interweaving","Fabric Chaos","Reverse Tangent Division","Chaotic Tangent","Alternating Chaos 0","Alternating Chaos 1 [Legacy]","Alternating Chaos 2 [Legacy]","Alternating Chaos 3 [Legacy]","Alternating Chaos 4 [Legacy]","Alternating Chaos 5 [Legacy]","Alternating Chaos 1","Alternating Chaos 2","Alternating Chaos 3","Alternating Chaos 4","Alternating Chaos 5") +#@gui :Custom Formula=choice(0,"None","Custom Formula","Alternating Custom Formula Level 1","Alternating Custom Formula Level 2","Alternative Custom Formula Level 3","Alternating Custom Formula Level 4") +#@gui :_=separator() +#@gui :_=note("Fractal Calculation Constraints") +#@gui :_=note("Information at bottom of filter. Some predefined formulas requires you to use low values. You may need to type in values from 5-1024 manually.") +#@gui :Escape Value=int(10000,5,3000000) +#@gui :Loop Limitation=int(255,1,1024) +#@gui :Subsampling Level=float(3,1,10) +#@gui :_=separator() +#@gui :_=note("Distortion Factors") +#@gui :Distortion X-[dx]=float(0,-50,50) +#@gui :Distortion Y-[dy]=float(0,-50,50) +#@gui :_=separator() +#@gui :_=note("Transformations") +#@gui :_=note("- Scaling -") +#@gui :Scaling XY-Axis=float(1,.01,15) +#@gui :Scaling X-Axis=float(1,.01,15) +#@gui :Scaling Y-Axis=float(1,.01,15) +#@gui :PI-Based Scaling=bool(1) +#@gui :_=separator() +#@gui :_=note("- Displacement -") +#@gui :Offset X-Transformation=float(0,-5,5) +#@gui :Offset Y-Transformation=float(0,-5,5) +#@gui :_=separator() +#@gui :_=note("- Rotation -") +#@gui :Function Angle=float(0,-180,180) +#@gui :_=separator() +#@gui :_=note("Custom Formula) +#@gui :_=note("See bottom of this filter to see instruction of usage") +#@gui :Custom A-X-[vx]=text{a/sin(b)} +#@gui :Custom A-Y-[vy]=text{b/cos(a)} +#@gui :Custom B-X-[vx]=text{sin(a)/cos(b)} +#@gui :Custom B-Y-[vy]=text{b/cos(a)} +#@gui :Custom C-X-[vx]=text{a/sin(b)} +#@gui :Custom C-Y-[vy]=text{b/cos(a+b)} +#@gui :Custom D-X-[vx]=text(a) +#@gui :Custom D-Y-[vy]=text(b) +#@gui :Custom E-X-[vx]=text(a) +#@gui :Custom E-Y-[vy]=text(b) +#@gui :_=separator() +#@gui :_=note("- Overload -") +#@gui :Activate Overload Functions=bool(0) +#@gui :Enable CFA/CFB* Formulas for OVX and OVY Formulas?=bool(1) +#@gui :Overload X=text{a/(cfb*cos(b))} +#@gui :Overload Y=text{b/(cfa*sin(a))} +#@gui :CFA-[cfa]=text{cos(vx)/tan(vx)} +#@gui :CFB-[cfb]=text{sin(vy)/tan(vy)} +#@gui :Overload Count**=int(1,1,4) +#@gui :Use Negative Overload=bool(0) +#@gui :_=note("*=cfa and cfb must be lowercase when using in overload formula!\n\n**=Negative Overload Count utilize last vector number rather than second last to find cfa,cfb.") +#@gui :_=separator() +#@gui :_=note("Colour Setting) +#@gui :Fractal Mapping=choice(0,"Grayscale","Hue","Random Color Map") +#@gui :Colours=int(3,3,8) +#@gui :Colour Generation Seed=int(0,0,5000) +#@gui :_=separator() +#@gui :_=note("Information of Thorn Fractal - Secant Sea filter") +#@gui :_=separator() +#@gui :_=note("Fractal Calculation Constraints\n\nEscape Value defines the minimum value to escape from the loop used to determine the amount of iteration needed to be bigger than the specified value per pixels. The lower the value, the more contrast at a sacrifise of details.\n\nIterations defines the maximum possible amount of loop per pixels when escape value is not reached. The lower the value, the more contrast and the more posterization of values.\n\nSubsampling Level is used to alter the dimensions before calculation of fractal, and it is resized to the original dimension after the fractal has been generated. The bigger the value, the more computationally intensive it is. In fact, this has the most consistent impact on performance.") +#@gui :_=separator() +#@gui :_=note("Custom Formula\n\nTo use this, type in a formula utilizing the syntax given by the G'MIC reference manual. Use notes given the information provided below.\n\nMultiple expressions are supported, and they are separated by \";\" character. If it the only expression, then it would be used for calculation of vx or vy. Otherwise, the first expression may be the only one used for calculation of vx or vy.\n\nAvailable variables - v,vx,vy,dx,dy,a,b,cfa,cfb\n\nv - Iteration number within Thorn Fractal.\n\nvx - Output of distortion function for x-axis.\n\nvy - Output of distortion function for y-axis.\n\ndx - Distortion-X Number.\n\ndy - Distortion-Y Number.\n\na - Value of a is given by vx equation based on the number of repeats needed to escape from the iterative loop to check when resulting value is greater than escape number.\n\nb - Value of b is given by vx equation based on the number of repeats needed to escape from the iterative loop to check when resulting value is greater than escape number.\n\ncfa - Output of CFA function. Useful if and only if using overload function.\n\ncfb - Output of CFB function. Useful if and only if using overload function.") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/6/13.") +#@gui Tree:fx_tree,fx_tree_preview(1) +#@gui :_=note("Global parameters:") +#@gui :Recursion Depth=int(11,1,18) +#@gui :Random Seed=int(10000,0,65535) +#@gui :X-Ratio=float(0,-1,1) +#@gui :Y-Ratio=float(0,-1,1) +#@gui :_=note("Note: Set Random Seed to 0 to make it random as well.") +#@gui :_=separator() +#@gui :_=note("Trunk:") +#@gui :Thickness (%)=float(15,0,100) +#@gui :Base Thickness (%)=float(150,0,300) +#@gui :Angle (deg.)=float(0,-90,90) +#@gui :_=separator() +#@gui :_=note("Recursion:") +#@gui :Avg Branching=float(2.15,1,6) +#@gui :Std Branching=float(0.8,0,6) +#@gui :Avg Left Angle (deg.)=float(-40,-90,90) +#@gui :Avg Right Angle (deg.)=float(40,-90,90) +#@gui :Std Angle (deg.)=float(10,0,90) +#@gui :Avg Length Factor (%)=float(75,0,200) +#@gui :Std Length Factor (%)=float(0,0,200) +#@gui :Avg Thickness Factor (%)=float(70,0,200) +#@gui :Std Thickness Factor (%)=float(20,0,200) +#@gui :_=separator() +#@gui :_=note("Colors / Opacity:") +#@gui :Trunk Color=color(#281900ff) +#@gui :Trunk Opacity (%)=float(100,0,100) +#@gui :Leaf Color=color(#468c3cff) +#@gui :Leaf Opacity (%)=float(100,0,100) +#@gui :Color Gamma=float(0.4,-2,2) +#@gui :Opacity Gamma=float(0.4,-2,2) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/03/24.") +#@gui Turbulence:fx_turbulence,fx_turbulence +#@gui :Radius=float(128,1,1024) +#@gui :Octaves=int(6,1,12) +#@gui :Damping per Octave=float(4,1,10) +#@gui :Difference Mixing=float(0,-10,10) +#@gui :Mode=choice("Turbulence","Turbulence 2","Fractal Noise","Fractured Clouds","Stardust","Pea Soup") +#@gui :_=separator() +#@gui :_=note("Author: Preben Soeberg.      Latest Update: 2010/29/12.") +#@gui _Repair +#@gui Banding Denoise:banding_denoise_v2,banding_denoise_v2_preview(0) +#@gui :V Cutoff=float(5,0,50) +#@gui :H Cutoff=float(5,0,50) +#@gui :Space=float(5,0,20) +#@gui :Value=float(10,0,100) +#@gui :Size of Tiles=choice("No Tiling","64px","128px","256px","512px","1024px","2048px") +#@gui :Preview Difference=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: Iain Fergusson and David Tschumperlé       Latest Update: 2023/02/23.") +#@gui Bayer Reconstruction:bayer2rgb,gui_no_preview +#@gui :G/M Smoothness=_float(6,0,20) +#@gui :R/B Smoothness (Principal)=_float(6,0,20) +#@gui :R/B Smoothness (Secondary)=_float(4,0,20) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Clean Text:afre_cleantext,afre_cleantext_preview(0)+ +#@gui :_=note("Clean scanned text.  Filter by afre 2019 Jun8.\n\n") +#@gui :Clean=int(8,0,10) +#@gui :Range=float(1,0.2,1) +#@gui :Black=int(80,0,100) +#@gui :White=int(95,0,100) +#@gui Deinterlace:deinterlace,fx_deinterlace_preview(0) +#@gui :Algorithm=choice("Standard","Motion-Compensated") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Deinterlace2x:gcd_deinterlace2x,gcd_deinterlace2x_preview(0) +#@gui :_=note("Blend 2x frames for 4:2:0 YUV") +#@gui :_=separator() +#@gui :Balance=int(40,1,255) +#@gui :2x Type=choice("DCCI2x","Edge","Fast Blend","Set Aspect Only") +#@gui :Aspect=choice("None","1:1","4:3","5:4","16:9","16:10","2.35:1","1.85:1") +#@gui :Interp=choice(2,"Linear","Bicubic","Lanczos") +#@gui :Ignore Current Aspect=bool(0) +#@gui :Fast Blend Preview=bool(1) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2017/05/01.") +#@gui :_=note("\nNote: preview may be inaccurate") +#@gui :_=note("Interp is only used when setting aspect") +#@gui Denoise:fx_denoise,fx_denoise_preview(0) +#@gui :Noise Type=choice{"Soft","Heavy","Heavy (Faster)","Poisson + Gaussian","Poisson + Gaussian (v2)"} +#@gui :Iterations=int(1,1,5) +#@gui :_=separator() +#@gui :Update Neural Network=button() +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note{" Note: This filter uses a convolutional neural network (CNN) to denoise images. This filter does not take advantage of GPU computing, so expect it to be quite slow if you don't have many CPU cores available. "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/11/06.") +#@gui Denoise Smooth:afre_denoisesmooth,afre_denoisesmooth_preview(1)+ +#@gui :_=note("Denoise noisy image, or smooth low noise image.  Filter by afre 2020 Oct4.\n\n Filter is slow when the radius  and amount  are high. Start small and increase as appropriate.\n\n") +#@gui :Radius=int(3,1,10) +#@gui :Amount=int(10,1,1000) +#@gui :_=note("\n\nNote\n\nG'MIC's preview is inaccurate. Apply the filter and review the results in your host editor.") +#@gui Denoise Smooth Alt:afre_denoisesmooth_alt,afre_denoisesmooth_alt_preview(1)+ +#@gui :_=note("Denoise noisy image, or smooth low noise image.  Filter by afre 2020 Oct4-11.\n\n Filter is slow when the radius  and amount  are high. Start small and increase as appropriate.\n\n") +#@gui :Radius=int(3,1,10) +#@gui :Amount=int(10,1,1000) +#@gui :_=note("\n\nNote\n\nG'MIC's preview is inaccurate. Apply the filter and review the results in your host editor.") +#@gui Descreen:fx_pahlsson_descreen,fx_pahlsson_descreen_preview(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Andreas Påhlsson. Latest update: 2016/27/06.") +#@gui Despeckle:gcd_despeckle,gcd_despeckle(3) +#@gui :_=note("Remove small dots and specks") +#@gui :_=separator() +#@gui :Tolerance=int(20,0,50) +#@gui :Max Area=int(10,0,100) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2013/02/01.") +#@gui :_=note("\nNotes") +#@gui :_=note("Set max area to 0 for no area size limit.") +#@gui Iain Noise Reduction 2019:iain_nr_2019,iain_nr_2019_preview(0) +#@gui :Gamma=float(1,.05,2) +#@gui :Shadows=float(0,-1,1) +#@gui :Light=float(0,-1,1) +#@gui :Mid Offset=float(0,-0.5,0.5) +#@gui :Desaturate=float(0.5,0,1) +#@gui :Guide Mix=float(1,0,1) +#@gui :Soften Guide=bool(0) +#@gui :Fine=float(5,0,30) +#@gui :Mid=float(3,0,30) +#@gui :Large=float(0,0,30) +#@gui :Lookup=int(3,1,7) +#@gui :Recovery=choice(0,"No Recovery","Fast Recovery","Slow Recovery","Guide Recovery") +#@gui :Recover=float(.5,0,2) +#@gui :Preview Shows=choice(4,"Noise","Fine Noise","Mid Noise","Large Noise","Output") +#@gui :Preview Tones Map=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: Iain Fergusson - completely re-written Dec 2019") +#@gui :_=note("previous update 10 Jan 2013") +#@gui Iain's Fast Denoise:iain_fast_denoise_p,iain_fast_denoise_p_preview(0) +#@gui :Luma=float(0,0,3) +#@gui :Chroma=float(0,0,3) +#@gui :Gamma=float(1,.5,3) +#@gui :Despeckle=float(0,0,1) +#@gui :Dither Output=bool(0) +#@gui :Preview Shows=choice(0,"Normal Output","Luma Noise","Chroma Noise") +#@gui :_=separator() +#@gui :Parallel Processing=choice(1,"Off","Auto") +#@gui :_=separator() +#@gui :_=note("This noise reduction filter is designed for speed, and some quality has been sacrificed.") +#@gui :_=separator() +#@gui :_=note("Author: Iain Fergusson") +#@gui :_=note("Update 28 March 2015 - increased parallel overlap to remove artefacts") +#@gui :_=note("Update 26 Oct 2013 - parallel processing") +#@gui :_=note("Released 22 Feb 2013") +#@gui Inpaint [Holes]:fx_inpaint_holes,fx_inpaint_holes(0) +#@gui :Maximal Area=float(4,1,512) +#@gui :Tolerance=float(20,0,255) +#@gui :Connectivity=choice(1,"Low","High") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/27/05.") +#@gui Inpaint [Morphological]:fx_inpaint_morpho,fx_inpaint_morpho_preview(1) +#@gui :Mask Color=_color(#ff0000ff) +#@gui :Mask Dilation=_int(0,0,32) +#@gui :_=separator() +#@gui :_=note("Note: It is strongly suggested to apply this filter only on a selection around the region to inpaint, to save computation time!") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/25/11.") +#@gui Inpaint [Multi-Scale]:fx_inpaint_matchpatch,fx_inpaint_matchpatch_preview(1) +#@gui :Number of Scales=int(0,0,16) +#@gui :_=note{"(Set Number of scales to 0 for automatic scale detection)"} +#@gui :Patch Size=int(9,1,64) +#@gui :Number of Iterations per Scale=int(10,1,100) +#@gui :Blend Size=int(5,0,32) +#@gui :Allow Outer Blending=bool(1) +#@gui :Mask Color=color(#ff0000ff) +#@gui :Mask Dilation=int(0,0,32) +#@gui :_=separator() +#@gui :Preview Progression While Running=_bool(0) +#@gui :_=separator() +#@gui :_=note("Note: Preview and final result may strongly differ.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/25/11.") +#@gui Inpaint [Patch-Based]:fx_inpaint_patch,fx_inpaint_patch_preview +#@gui :Patch Size=_int(7,1,64) +#@gui :Lookup Size=_float(16,1,32) +#@gui :Lookup Factor=_float(0.1,0,1) +#@gui :Blend Size=_float(1.2,0,5) +#@gui :Blend Threshold=_float(0,0,1) +#@gui :Blend Decay=_float(0.05,0,0.5) +#@gui :Blend Scales=_int(10,1,20) +#@gui :Allow Outer Blending=_bool(1) +#@gui :Mask Color=_color(#ff0000ff) +#@gui :Mask Dilation=_int(0,0,32) +#@gui :Process by Blocks of Size=_choice("100%","75%","50%","25%","10%","5%","2%","1%") +#@gui :_=separator() +#@gui :_=note("A quick tutorial on how to use this filter can be found here:") +#@gui :_=link("G'MIC Inpainting tutorial on Patrick David's blog.","https://patdavid.net/2014/02/getting-around-in-gimp-gmic-inpainting.html") +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé and Maxime Daisy.       Latest Update: 2015/25/11.") +#@gui Inpaint [Transport-Diffusion]:fx_inpaint_pde,fx_inpaint_pde_preview(1) +#@gui :Smoothness (%)=float(75,0,100) +#@gui :Regularization=choice(1,"Isotropic","Delaunay-Guided","Edge-Oriented") +#@gui :Regularization Iterations=int(20,0,100) +#@gui :Mask Color=_color(#ff0000ff) +#@gui :Mask Dilation=_int(0,0,32) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/10/04.") +#@gui Local Similarity Mask:local_similarity_mask,local_similarity_mask(1) +#@gui :_=note("Select pixels at") +#@gui :Center (%)=point(50,50,0,1) +#@gui :_=note("With similarity") +#@gui :Keep=int(50,0,255) +#@gui :Reject=int(128,0,255) +#@gui :_=note("On these channels") +#@gui :Channel(s)=choice(4,"RGB","Red","Green","Blue","Luminance","A-Component","B-Component","Hue","Saturation","Value","Lightness","[Cyan]MYK","C[Magenta]YK","CM[Yellow]K","CMY[Key]") +#@gui :Steps=int(10,2,100) +#@gui :_=separator() +#@gui :_=note("This filter creates a mask based on pixels that are close to, and similar to, the selected pixel.") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. Update 12 September 2018: Added interactive point and Steps control") +#@gui Pixel Denoise:iain_pixel_denoise_p,iain_pixel_denoise_p_preview(0) +#@gui :Method=choice(2,"Old Method - Slowest","Hybrid Median - Medium Speed Softest Output","Morphological - Fastest Sharpest Output") +#@gui :_=separator() +#@gui :Iterations=int(1,1,10) +#@gui :Channel(s)=choice(11,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :_=separator() +#@gui :Preview Shows=choice(0,"Output","Difference") +#@gui :_=separator() +#@gui :Parallel Processing=choice(1,"Off","Auto") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. ") +#@gui :_=note("Update - 1 July 2014 - Added much faster Morphological method. Note: The iteration setting is ignored for this method. There is no change to the output for iterations greater than one.") +#@gui :_=note("Update - 1 December 2013 - Fixed some bugs.") +#@gui :_=note("Update - 20 October 2013 - Parallel Processing") +#@gui :_=note("Update - 8 March 2013 - Incorperated Hybrid Median into this filter and added a choice between the old method and hybrid median") +#@gui Recursive Median:iain_recursive_median_p,iain_recursive_median_p_preview(0) +#@gui :Median Radius=int(3,1,20) +#@gui :Repeats=int(1,1,20) +#@gui :Channel(s)=choice(0,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :_=separator() +#@gui :Preview Shows=choice("Output","Difference") +#@gui :_=separator() +#@gui :Parallel Processing=choice(1,"Off","Auto") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson.") +#@gui :_=note{"Update - 25 October 2013 - Parallel Processing was not working properly, fixed now. note = note("Update - 20 October 2013 - Parallel Processing and Control Layout"} +#@gui Red-Eye Attenuation:red_eye,red_eye +#@gui :Threshold=float(75,0,100) +#@gui :Smoothness=float(3.5,0,20) +#@gui :Factor=float(0.1,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Remove Hot Pixels:fx_remove_hotpixels,fx_remove_hotpixels_preview(0) +#@gui :Mask Size=int(3,3,20) +#@gui :Threshold=float(10,0,200) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Jérome Boulanger.      Latest Update: 2010/29/12.") +#@gui Repair Scanned Document:jeje_scandoc,jeje_scandoc_preview(0) +#@gui :_=note(Use filter is useful to post process document you scan with a digital camera. It peforms smoothing, background correction and white balance adjustement) +#@gui :Smoothness=int(3,1,7) +#@gui :Background=float(1,10,100) +#@gui :White Level=float(90,0,100) +#@gui :Black Level=float(5,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/11/03.") +#@gui Smooth [Anisotropic]:fx_smooth_anisotropic,fx_smooth_anisotropic_preview(0) +#@gui :Amplitude=float(60,0,1000) +#@gui :Sharpness=float(0.7,0,2) +#@gui :Anisotropy=float(0.3,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(1.1,0,10) +#@gui :Spatial Precision=float(0.8,0.1,2) +#@gui :Angular Precision=float(30,1,180) +#@gui :Value Precision=float(2,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(1,1,10) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/08/27.") +#@gui Smooth [Antialias]:fx_smooth_antialias,fx_smooth_antialias_preview(0) +#@gui :Amplitude=float(5,0,100) +#@gui :Edge Threshold (%)=float(10,0,100) +#@gui :Smoothness=float(0.8,0,5) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/11/13.") +#@gui Smooth [Bilateral]:fx_smooth_bilateral,fx_smooth_bilateral_preview(0) +#@gui :Spatial Variance=float(10,0,100) +#@gui :Value Variance=float(7,0,100) +#@gui :Iterations=int(2,1,10) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/27/08.") +#@gui Smooth [Block PCA]:jeje_denoise_patch_dict,jeje_denoise_patch_dict_preview(0) +#@gui :Patch=choice(1,4,8,16,32) +#@gui :Cycles=int(8,1,32) +#@gui :Components=float(1.1,1,9) +#@gui :Coefficients=float(1.1,0,9) +#@gui :Remix=float(0,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note(Note:This filter is quite time consuming.) +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/03/29.") +#@gui Smooth [Diffusion]:fx_smooth_diffusion,fx_smooth_diffusion_preview(0) +#@gui :Sharpness=float(0.7,0,2) +#@gui :Anisotropy=float(0.3,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(1.1,0,10) +#@gui :Time Step=float(15,5,50) +#@gui :Iterations=int(8,1,100) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/27/08.") +#@gui Smooth [Guided]:fx_smooth_guided,fx_smooth_guided_preview(0) +#@gui :Guide As=choice("Self","Top Layer","Bottom Layer") +#@gui :Radius=int(5,1,100) +#@gui :Smoothness=float(30,0,512) +#@gui :Iterations=int(1,1,10) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/10/02.") +#@gui Smooth [IUWT]:jeje_denoise_iuwt,jeje_denoise_iuwt_preview(0) +#@gui :Threshold=float(3,0,10) +#@gui :Number of Scales=int(4,2,6) +#@gui :Wavelet=choice(2,"Spline B1","Spline B2","Spline B3","Spline B4","Spline B5","Spline B6") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Note:Denoise the image by thresholding the coefficient of the Isotropic Undecimated Wavelet Transform.") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/17/12.") +#@gui Smooth [Mean-Curvature]:fx_smooth_meancurvature,fx_smooth_meancurvature_preview(0) +#@gui :Time Step=float(30,5,50) +#@gui :Iterations=int(4,1,30) +#@gui :Keep Iterations as Different Layers=bool(false) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/27/08.") +#@gui Smooth [Median]:fx_smooth_median,fx_smooth_median_preview(0) +#@gui :Radius=int(3,1,20) +#@gui :Threshold=float(255,0,255) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Smooth [NL-Means]:fx_smooth_nlmeans,fx_smooth_nlmeans_preview(0) +#@gui :Patch Size=float(4,0.5,10) +#@gui :Spatial Bandwidth=int(4,3,13) +#@gui :Tonal Bandwidth=float(10,1,50) +#@gui :Patch Measure=choice(3,"Linf-Norm","L1-Norm","L2-Norm","Luminance","Lightness","RGB") +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Jérôme Boulanger.      Latest Update: 2015/01/07.") +#@gui Smooth [Patch-Based]:fx_smooth_patch,fx_smooth_patch_preview(0) +#@gui :Spatial Variance=float(10,0.1,200) +#@gui :Patch Variance=float(10,0.1,200) +#@gui :Patch Size=int(3,2,21) +#@gui :Lookup Size=int(5,2,21) +#@gui :Patch Smoothness=float(0,0,4) +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(1,1,10) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/27/08.") +#@gui Smooth [Patch-PCA]:fx_smooth_patchpca,fx_smooth_patchpca_preview(0) +#@gui :Strength=float(4,0,16) +#@gui :Patch Size=int(7,2,21) +#@gui :Lookup Size=int(11,2,21) +#@gui :Spatial Sampling=int(7,1,16) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note{"Note: Beware, this filter uses a very computationally intensive algorithm to denoise images. So, do not complain too much if you have less than 8 cores available for the computation :) "} +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé and Jérome Boulanger.       Latest Update: 2016/24/03.") +#@gui Smooth [Perona-Malik]:fx_smooth_peronamalik,fx_smooth_peronamalik_preview(0) +#@gui :K-Factor=float(20,0,255) +#@gui :Time Step=float(5,5,50) +#@gui :Iterations=int(5,1,30) +#@gui :Keep Iterations as Different Layers=bool(false) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/26/11.") +#@gui Smooth [Selective Gaussian]:fx_smooth_selective,fx_smooth_selective_preview(0) +#@gui :Amplitude=float(5,0,20) +#@gui :Edges=float(0.5,0,2) +#@gui :Scales=int(5,1,10) +#@gui :Iterations=int(1,1,10) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/27/08.") +#@gui Smooth [Skin]:fx_smooth_skin,fx_smooth_skin_preview(1) +#@gui :_=note("Step 1: Skin detection") +#@gui :Skin Estimation=choice(2,"None","Manual","Automatic") +#@gui :Tolerance=float(0.5,0,1) +#@gui :Smoothness=float(1,0,5) +#@gui :Threshold=float(1,0,10) +#@gui :Pre-Normalize Image=bool(1) +#@gui :X-Coordinate [Manual]=float(50,0,100) +#@gui :Y-Coordinate [Manual]=float(50,0,100) +#@gui :Radius [Manual]=float(5,0,25) +#@gui :_=separator() +#@gui :_=note("Step 2: Medium scale smoothing") +#@gui :Base Scale=float(2,0,10) +#@gui :Fine Scale=float(0.2,0,0.8) +#@gui :Smoothness=float(3,0,10) +#@gui :Smoothness Type=choice(1,"Gaussian","Bilateral") +#@gui :_=separator() +#@gui :_=note("Step 3: Details enhancement") +#@gui :Gain=float(0.05,0,0.5) +#@gui :_=separator() +#@gui :Preview Data=choice{5,"Skin Mask","Base Scale","Medium Scale (Original)","Medium Scale (Smoothed)","Fine Scale","Result Image"} +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=link("Click here for a video tutorial","http://www.youtube.com/watch?v=H8pQfq-ybCc") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/20/12.") +#@gui Smooth [Thin Brush]:fx_smooth_anisotropic,fx_smooth_anisotropic(0) +#@gui :Amplitude=float(60,0,1000) +#@gui :Sharpness=float(0.9,0,2) +#@gui :Anisotropy=float(0.64,0,1) +#@gui :Gradient Smoothness=float(3.1,0,10) +#@gui :Tensor Smoothness=float(1.10,0,10) +#@gui :Spatial Precision=float(0.8,0.1,2) +#@gui :Angular Precision=float(30,1,180) +#@gui :Value Precision=float(2,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(1,1,10) +#@gui :Channel(s)=choice("RGB","Luminance","Blue & Red Chrominances","Blue Chrominance","Red Chrominance") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=note("\nNote: This set of anisotropic smoothing parameters has been suggested by PhotoComiX.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX.      Latest Update: 2010/26/12.") +#@gui Smooth [Total Variation]:fx_smooth_tv,fx_smooth_tv_preview(0) +#@gui :Time Step=float(30,5,100) +#@gui :Iterations=int(10,1,40) +#@gui :Keep Iterations as Different Layers=bool(false) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/27/08.") +#@gui Smooth [Wavelets]:fx_smooth_haar,fx_smooth_haar_preview(0) +#@gui :Threshold=float(1,0,10) +#@gui :Iterations=int(10,1,32) +#@gui :Scales=int(10,2,10) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Jérome Boulanger and David Tschumperlé.       Latest Update: 2013/27/08.") +#@gui Smooth [Wiener]:jeje_local_wiener,jeje_local_wiener_preview(0) +#@gui :Scale=float(2,.5,10) +#@gui :Channel(s)=choice(11,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/06/07.") +#@gui Solidify:fx_solidify_td,fx_solidify_td_preview(1) +#@gui :Smoothness (%)=float(75,0,100) +#@gui :Regularization=choice(1,"Isotropic","Delaunay-Guided","Edge-Oriented") +#@gui :Regularization Iterations=int(20,0,100) +#@gui :Dilation / Erosion=int(0,-20,20) +#@gui :Colorspace=choice(1,"SRGB","Linear RGB") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Note: This filter reconstructs transparent regions of an image using a transport-diffusion algorithm. Useful only for images having an alpha-channel. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/07/04.") +#@gui Unpurple:unpurple,unpurple_preview(0)+ +#@gui :Intensity of Purple Fringe=float(1,0,1) +#@gui :Minimum Brightness=float(0,0,1) +#@gui :Minimum Red:Blue Ratio in the Fringe=float(0,0,1) +#@gui :Maximum Red:Blue Ratio in the Fringe=float(0.33,0,1) +#@gui :Blur Standard Deviation=int(5,1,10) +#@gui :Gentle Mode (overrides Minimum Brightness and Minimun Red:Blue Ratio)=bool(0) +#@gui :_=value(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Unpurple removes purple fringing") +#@gui :_=note("Based on https://github.com/mjambon/purple-fringe by Martin Jambon.") +#@gui :_=note("This implementation works with RGB and RGBA images in any bit depth.") +#@gui :_=note("Note: the minimum brightness and intensity are relative to the maximum blue value.") +#@gui :_=note("Ported to G'MIC by Stanislav Paskalev ") +#@gui Unstrip:jeje_unstrip,jeje_unstrip_preview(0) +#@gui :Smoothness=float(1,0,10) +#@gui :Size=float(20,1,50) +#@gui :Sensitivity=float(4,1,10) +#@gui :Normalize=bool(true) +#@gui :FFT Preview=bool(false) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/06/10.") +#@gui Upscale [DCCI2x]:fx_scale_dcci2x,fx_scale_dcci2x_preview(0) +#@gui :_=note("Directional Cubic Convolution Interpolation") +#@gui :_=separator() +#@gui :Threshold=float(1.15,1,2) +#@gui :Exponent=int(5,1,6) +#@gui :Extend 1px=_bool(0) +#@gui :_=separator() +#@gui :_=note("Author: Garagecoder. Latest Update : 2015/11/07.") +#@gui :_=note("\nNote: This filter re-implements the scaling algorithm described at : ") +#@gui :_=link("wikipedia.org","https://en.wikipedia.org/wiki/Directional_Cubic_Convolution_Interpolation") +#@gui :_=note("The algorithm is intended for enlarging images while avoiding") +#@gui :_=note("artifacts, e.g. staircase artifacts.") +#@gui :_=note("\nThreshold controls edge[lower] to texture[higher] balance.") +#@gui :_=note("Exponent controls texture edge sharpness[higher].") +#@gui :_=note("Warning: highly experimental...") +#@gui Upscale [Diffusion]:fx_upscale_smart,fx_upscale_smart_preview(0) +#@gui :Width=text("200%") +#@gui :Height=text("200%") +#@gui :Smoothness=float(2,0,20) +#@gui :Anisotropy=float(0.4,0,1) +#@gui :Sharpness=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Upscale [Scale2x]:fx_scalenx,fx_scalenx_preview(0) +#@gui :Scaling Factor=choice("X 2","X 3","X 4","X 6","X 8","X 9","X 12","X 16","X 18","X 27") +#@gui :Colorbase=choice(0,"RGB","YCbCr","Lab") +#@gui :_=note("\nNote: This filter re-implements the scaling algorithm described at : ") +#@gui :_=link("http://scale2x.sourceforge.net") +#@gui :_=note{" This filter is useful for resizing images that have very few colors (e.g. indexed images). It is generally useless for true colors images. "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui _Sequences +#@gui 3D Elevation [Animated]:fx_animate_elevation3d,fx_animate_elevation3d_preview(1) +#@gui :Frames=_int(10,2,100) +#@gui :Output as Frames=_bool(1) +#@gui :Output as Files=_bool(0) +#@gui :Output Folder=_folder() +#@gui :_=note("\nGlobal parameters :") +#@gui :Factor=float(100,-1000,1000) +#@gui :Smoothness=float(1,0,10) +#@gui :Width=_int(1024,8,4096) +#@gui :Height=_int(1024,8,4096) +#@gui :Rendering=choice(2,"Dots","Wireframe","Flat","Flat-Shaded","Gouraud","Phong") +#@gui :_=note("\nStarting parameters :") +#@gui :Size=float(0.8,0,3) +#@gui :X-Angle=float(35,0,360) +#@gui :Y-Angle=float(0,0,360) +#@gui :Z-Angle=float(0,0,360) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :_=note("\nEnding parameters :") +#@gui :Size=float(0.8,0,3) +#@gui :X-Angle=float(35,0,1440) +#@gui :Y-Angle=float(0,0,1440) +#@gui :Z-Angle=float(360,0,1440) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui 3D Extrusion [Animated]:fx_animate_extrude3d,fx_animate_extrude3d_preview(1) +#@gui :Frames=_int(10,2,100) +#@gui :Output as Frames=_bool(1) +#@gui :Output as Files=_bool(0) +#@gui :Output Folder=_folder() +#@gui :_=note("\nGlobal parameters :") +#@gui :Depth=float(10,1,256) +#@gui :Resolution=int(512,1,1024) +#@gui :Smoothness=float(0.6,0,3) +#@gui :Width=_int(1024,8,4096) +#@gui :Height=_int(1024,8,4096) +#@gui :Rendering=choice(4,"Dots","Wireframe","Flat","Flat-Shaded","Gouraud","Phong") +#@gui :_=note("\nStarting parameters :") +#@gui :Size=float(0.8,0,3) +#@gui :X-Angle=float(35,0,360) +#@gui :Y-Angle=float(0,0,360) +#@gui :Z-Angle=float(0,0,360) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :_=note("\nEnding parameters :") +#@gui :Size=float(0.8,0,3) +#@gui :X-Angle=float(35,0,1440) +#@gui :Y-Angle=float(360,0,1440) +#@gui :Z-Angle=float(0,0,1440) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui 3D Image Object [Animated]:fx_animate_imageobject3d,fx_animate_imageobject3d_preview(1) +#@gui :Frames=_int(10,2,100) +#@gui :Output as Frames=_bool(1) +#@gui :Output as Files=_bool(0) +#@gui :Output Folder=_folder() +#@gui :_=note("\nGlobal parameters :") +#@gui :Type=choice(1,"Plane","Cube","Pyramid","Sphere","Torus","Gyroid","Weird","Cup","Rubik") +#@gui :Width=_int(1024,1,4096) +#@gui :Height=_int(1024,1,4096) +#@gui :Rendering=choice(4,"Dots","Wireframe","Flat","Flat-Shaded","Gouraud","Phong") +#@gui :_=note("\nStarting parameters :") +#@gui :Size=float(0.5,0,3) +#@gui :X-Angle=float(57,0,360) +#@gui :Y-Angle=float(41,0,360) +#@gui :Z-Angle=float(21,0,360) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :_=note("\nEnding parameters :") +#@gui :Size=float(0.5,0,3) +#@gui :X-Angle=float(57,0,1440) +#@gui :Y-Angle=float(401,0,1440) +#@gui :Z-Angle=float(21,0,1440) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui 3D Text Pointcloud:fx_text_pointcloud3d,fx_text_pointcloud3d_preview +#@gui :Frames=_int(64,1,256) +#@gui :1st Text=text("G'MIC") +#@gui :2nd Text=text("Rocks!") +#@gui :Smoothness=float(1,0,5) +#@gui :Color=color(#c8dcff) +#@gui :Background=color(#ffffffff) +#@gui :X-Shadow=float(2,0,10) +#@gui :Y-Shadow=float(2,0,10) +#@gui :Shadow Smoothness=float(1,0,5) +#@gui :Stationary Frames=_int(19,1,32) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/01/09.") +#@gui 3D Tiles:fx_transition3d,fx_transition3d_preview(0) +#@gui :Inter-Frames=_int(10,3,100) +#@gui :X-Tiles=int(8,1,64) +#@gui :Y-Tiles=int(8,1,64) +#@gui :X-Rotation=text("1") +#@gui :Y-Rotation=text("1") +#@gui :Z-Rotation=text("0") +#@gui :Focale=float(800,100,2000) +#@gui :Enable Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Note: This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/13/08.") +#@gui B&W Pencil [Animated]:fx_animate_pencilbw,fx_animate_pencilbw_preview(0) +#@gui :Frames=_int(10,2,100) +#@gui :Output Frames=_bool(1) +#@gui :Output Files=_bool(0) +#@gui :Output Folder=_folder() +#@gui :_=note("\nStarting Parameters :") +#@gui :Pencil Type=float(2.3,0,5) +#@gui :Amplitude=float(100,0,200) +#@gui :_=note("\nEnding Parameters :") +#@gui :Pencil Type=float(0.3,0,5) +#@gui :Amplitude=float(60,0,200) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui B&W Stencil [Animated]:fx_animate_stencilbw,fx_animate_stencilbw_preview(1) +#@gui :Frames=_int(10,2,100) +#@gui :Output Frames=_bool(1) +#@gui :Output Files=_bool(0) +#@gui :Output Folder=_folder() +#@gui :_=note("\nStarting Parameters :") +#@gui :Edge Threshold=float(10,0,30) +#@gui :Smoothness=float(10,0,30) +#@gui :_=note("\nEnding Parameters :") +#@gui :Edge Threshold=float(10,0,30) +#@gui :Smoothness=float(20,0,30) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Cartoon [Animated]:fx_animate_cartoon,fx_animate_cartoon_preview(0) +#@gui :Frames=_int(10,2,100) +#@gui :Output Frames=_bool(1) +#@gui :Output Files=_bool(0) +#@gui :Output Folder=_folder() +#@gui :_=note("\nGlobal Parameters :") +#@gui :Color Quantization=int(4,2,256) +#@gui :_=note("\nStarting parameters :") +#@gui :Smoothness=float(0.5,0,2) +#@gui :Sharpening=float(200,0,400) +#@gui :Edge Threshold=float(10,1,30) +#@gui :Edge Thickness=float(0.1,0,1) +#@gui :Color Strength=float(1.5,0,3) +#@gui :_=note("\nEnding parameters :") +#@gui :Smoothness=float(3,0,2) +#@gui :Sharpening=float(200,0,400) +#@gui :Edge Threshold=float(10,1,30) +#@gui :Edge Thickness=float(0.1,0,1) +#@gui :Color Strength=float(1.5,0,3) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Edges [Animated]:fx_animate_edges,fx_animate_edges_preview(0) +#@gui :Frames=_int(10,2,100) +#@gui :Output Frames=_bool(1) +#@gui :Output Files=_bool(0) +#@gui :Output Folder=_folder() +#@gui :_=note("\nGlobal Parameters :") +#@gui :Negative Colors=bool(0) +#@gui :_=note("\nStarting Parameters :") +#@gui :Smoothness=float(0,0,10) +#@gui :Edge Threshold=float(10,0,30) +#@gui :_=note("\nEnding Parameters :") +#@gui :Smoothness=float(0,0,10) +#@gui :Edge Threshold=float(30,0,30) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Edges on Fire:fx_fire_edges,fx_fire_edges_preview(0) +#@gui :Edges=float(0.7,0,3) +#@gui :Attenuation=float(0.25,0,1) +#@gui :Smoothness=float(0.5,0,5) +#@gui :Threshold=float(25,0,100) +#@gui :_=separator() +#@gui :Number of Frames=_int(20,1,999) +#@gui :Starting Frame=int(20,0,199) +#@gui :Frame Skip=_int(0,0,20) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/06/07.") +#@gui Lava Lamp:fx_lavalampbw,fx_lavalampbw_preview(0) +#@gui :Number of Key-Frames=_int(3,2,50) +#@gui :Number of Inter-Frames=_int(30,2,100) +#@gui :Smooth Looping=_bool(1) +#@gui :_=separator() +#@gui :Resolution=float(20,1,100) +#@gui :Size=float(2,0,30) +#@gui :Smoothness=_float(0.01,0,1) +#@gui :Transparent Background=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/06/07.") +#@gui Lissajous [Animated]:fx_animate_lissajous,fx_animate_lissajous_preview(1) +#@gui :Frames=_int(10,2,100) +#@gui :Output as Frames=_bool(1) +#@gui :Output as Files=_bool(0) +#@gui :Output Folder=_folder() +#@gui :_=separator() +#@gui :_=note("Starting parameters :") +#@gui :Resolution=int(4096,2,8192) +#@gui :X-Size=float(0.9,0,2) +#@gui :Y-Size=float(0.9,0,2) +#@gui :Z-Size=float(3,1,10) +#@gui :X-Multiplier=float(8,0,32) +#@gui :Y-Multiplier=float(7,0,32) +#@gui :Z-Multiplier=float(0,0,32) +#@gui :X-Offset=float(0,0,1) +#@gui :Y-Offset=float(0,0,1) +#@gui :Z-Offset=float(0,0,1) +#@gui :X-Angle=float(0,0,360) +#@gui :Y-Angle=float(0,0,360) +#@gui :Z-Angle=float(0,0,360) +#@gui :Thickness=float(0,0,50) +#@gui :Color=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("Ending parameters :") +#@gui :Resolution=int(4096,2,8192) +#@gui :X-Size=float(0.9,0,2) +#@gui :Y-Size=float(0.9,0,2) +#@gui :Z-Size=float(3,1,10) +#@gui :X-Multiplier=float(8,0,32) +#@gui :Y-Multiplier=float(7,0,32) +#@gui :Z-Multiplier=float(0,0,32) +#@gui :X-Offset=float(0,0,1) +#@gui :Y-Offset=float(0,0,1) +#@gui :Z-Offset=float(0,0,1) +#@gui :X-Angle=float(0,0,360) +#@gui :Y-Angle=float(0,0,360) +#@gui :Z-Angle=float(0,0,360) +#@gui :Thickness=float(0,0,50) +#@gui :Color=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/18/04.") +#@gui Moiré Animation:fx_moire,fx_moire_preview(1)+ : * +#@gui :Stripe Orientation=choice(1,"Horizontal","Vertical") +#@gui :Input Transparency=choice("Replace With White","Reconstruct From Previous Frames") +#@gui :Output Format=choice{2,"Same as Input","A4 / 75 PPI","A4 / 100 PPI (Recommended)","A4 / 150 PPI","A4 / 300 PPI"} +#@gui :Auto-Reduce Number of Frames=bool(1) +#@gui :Landscape=bool(1) +#@gui :Margin (%)=float(2,0,30) +#@gui :_=separator() +#@gui :Print Frame Numbers=choice(1,"Disable","Top Left","Top Right","Bottom Left","Bottom Right") +#@gui :Size of Frame Numbers (%)=float(5,0,30) +#@gui :_=separator() +#@gui :_=note{"Instructions:\n\n This filter renders Moire Animations, as shown on this video.\n To make the animation visible:\n\n • Before running the filter, ensure that all frames are aligned and have the same size (and preferably without alpha)!\n • Run the filter. It is recommended to keep the number of frames <=6.\n • Print the first layer (merged frames) on a A4 blank paper, at 300 PPI.\n • Print the second layer (mask) on a A4 transparent sheet, at 300 PPI.\n • Drag the transparent layer over the A4 paper to render the animation effect. "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/03/02.") +#@gui Object Animation:fx_tk_animateobject,fx_tk_animateobject_preview(1) +#@gui :_=separator() +#@gui :_=note("Object motion:") +#@gui :X-Motion=float(0,-100,100) +#@gui :Y-Motion=float(0,-100,100) +#@gui :Z-Motion=float(0,-10,50) +#@gui :_=separator() +#@gui :_=note("Camera position:") +#@gui :Camera X=float(0.5,0,1) +#@gui :Camera Y=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Frame settings:") +#@gui :Frame Size=int(400,50,1920) +#@gui :Frames=int(2,2,100) +#@gui :Reverse Motion=bool(0) +#@gui :_=note("Your mask must be placed below your image. Switch input layers to Active and below.") +#@gui :_=separator() +#@gui :Work on Frameset=bool(0) +#@gui :_=note("To use this option your mask must be placed below your frames. Switch input layers to All.") +#@gui :_=separator() +#@gui :_=note("Advanced settings:") +#@gui :Sharpen Object=float(0,0,10) +#@gui :Expand Background Reconstruction=float(0,0,50) +#@gui :Smoothen Background Reconstruction=float(0,0,1) +#@gui :Adjust Background Reconstruction=float(1,1,256) +#@gui :_=separator() +#@gui :Blue Screen Mode=bool(0) +#@gui :_=note("Layer stack for images: Object image top, background image below, mask bottom. Layer stack for framesets: Frameset top, object image below, mask bottom. Switch input layers to All.") +#@gui :_=separator() +#@gui :Camera Motion Only=bool(0) +#@gui :Closeup=float(1,1,10) +#@gui :_=note("Use this option without mask layer. Switch input layers to Active or All") +#@gui :_=separator() +#@gui :_=note("Author : Tom Keil. Latest update: 2012/08/04.") +#@gui Rodilius [Animated]:fx_animate_rodilius,fx_animate_rodilius_preview(1) +#@gui :Frames=_int(10,2,100) +#@gui :Output as Frames=_bool(1) +#@gui :Output as Files=_bool(0) +#@gui :Output Folder=_folder() +#@gui :Color Mode=choice(1,"Darker","Lighter") +#@gui :_=note("\nStarting Parameters :") +#@gui :Amplitude=float(10,0,30) +#@gui :Thickness=float(10,0,100) +#@gui :Sharpness=float(300,0,1000) +#@gui :Orientations=int(5,2,20) +#@gui :Offset=float(0,0,180) +#@gui :_=note("\nEnding Parameters :") +#@gui :Amplitude=float(10,0,30) +#@gui :Thickness=float(10,0,100) +#@gui :Sharpness=float(300,0,1000) +#@gui :Orientations=int(5,2,20) +#@gui :Offset=float(180,0,180) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Soft Glow [Animated]:fx_animate_glow,fx_animate_glow_preview(1) +#@gui :Frames=_int(10,2,100) +#@gui :Output as Frames=_bool(1) +#@gui :Output as Files=_bool(0) +#@gui :Output Folder=_folder() +#@gui :_=note("\nStarting Parameters :") +#@gui :Amplitude=float(0,0,8) +#@gui :_=note("\nEnding Parameters :") +#@gui :Amplitude=float(3,0,8) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Spatial Transition:fx_spatial_transition,fx_spatial_transition_preview(1) : * +#@gui :Number of Added Frames=_int(10,1,256) +#@gui :Shading (%)=float(0,0,100) +#@gui :Transition Shape=choice(7,"Bottom Layer","Top Layer","Custom Formula","Horizontal","Vertical","Angular","Radial","Plasma") +#@gui :Custom Formula=text{"cos(x*y/(16+32*A))"}_1 +#@gui :A-Value=float(0,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice(1,"Transition Map","Timed Image","Sequence X4","Sequence X6","Sequence X8") +#@gui :Preview Time=float(0.5,0,1) +#@gui :_=value(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/10/04.") +#@gui _Silhouettes +#@gui Animals +#@gui Dragonfly:mc_dragonfly,mc_dragonfly_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 4th of September 2018.") +#@gui Kookaburra:mc_kookaburra,mc_kookaburra_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 4th of September 2018.") +#@gui Paw:mc_paw,mc_paw_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 4th of September 2018.") +#@gui Rooster:mc_rooster,mc_rooster_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 4th of September 2018.") +#@gui _Icons +#@gui Flip:mc_flip,mc_flip_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 5th of September 2018.") +#@gui Information:mc_information,mc_information_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 5th of September 2018.") +#@gui Mail:mc_mail,mc_mail_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 5th of September 2018.") +#@gui Phone:mc_phone,mc_phone_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 5th of September 2018.") +#@gui Shopping Cart:mc_shopping_cart,mc_shopping_cart_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 5th of September 2018.") +#@gui _Misc +#@gui Barbed Wire:mc_barbed_wire,mc_barbed_wire_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 4th of September 2018.") +#@gui Crosshair:mc_crosshair,mc_crosshair_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 4th of September 2018.") +#@gui Cupid:fx_cupid,fx_cupid_preview +#@gui :Size (%)=float(75,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/01/08.") +#@gui Gear:fx_gear,fx_gear_preview +#@gui :Size (%)=float(75,0,100) +#@gui :Number of Teeth=int(12,1,96) +#@gui :Elevation (%)=float(15,0,100) +#@gui :Angle (%)=float(0,0,100) +#@gui :Inner Radius (%)=float(40,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/01/08.") +#@gui Heart:fx_heart,fx_heart_preview +#@gui :Size (%)=float(75,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/01/08.") +#@gui Paint Splat:mc_paint_splat,mc_paint_splat_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 5th of September 2018.") +#@gui Sierpinski Triangle:fx_sierpinski,fx_sierpinski(1) +#@gui :Recursions=int(6,0,10) +#@gui :1st X-Coord=float(50,0,100) +#@gui :1st Y-Coord=float(0,0,100) +#@gui :2nd X-Coord=float(0,0,100) +#@gui :2nd Y-Coord=float(100,0,100) +#@gui :3rd X-Coord=float(100,0,100) +#@gui :3rd Y-Coord=float(100,0,100) +#@gui :Color=color(#ffffff) +#@gui :Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui _Nature +#@gui Australia:mc_australia,mc_australia_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 4th of September 2018.") +#@gui Barnsley Fern:fx_barnsley_fern,fx_barnsley_fern_preview(1) +#@gui :Type=choice("Asplenium Adiantum-Nigrum","Thelypteridaceae") +#@gui :Density (%)=float(100,0,300) +#@gui :Angle=float(30,-180,180) +#@gui :Opacity (%)=float(40,0,100) +#@gui :Color=color(#0ab200ff) +#@gui :Add as a New Layer=_bool(1) +#@gui :_=separator() +#@gui :_=note("This filter renders the Barnsley fern fractal, described here:") +#@gui :_=link("https://en.wikipedia.org/wiki/Barnsley_fern") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/18/10.") +#@gui Gum Leaf:mc_gum_leaf,mc_gum_leaf_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 4th of September 2018.") +#@gui Japanese Maple Leaf:mc_maple_leaf,mc_maple_leaf_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 4th of September 2018.") +#@gui Snowflake:fx_snowflake,fx_snowflake(1) +#@gui :Recursions=int(5,0,6) +#@gui :Opacity=float(1,0,1) +#@gui :Color=color(#ffffff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui _Others +#@gui Dragon Curve:fx_dragoncurve,fx_dragoncurve(1) +#@gui :Recursions=int(20,0,30) +#@gui :Angle=float(0,-180,180) +#@gui :Opacity=float(1,0,1) +#@gui :Color=color(#ffffff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/01/29.") +#@gui __Stereoscopic 3D +#@gui 3D Conversion:fx_tk_make3D,fx_tk_make3D_preview(1) +#@gui :_=separator() +#@gui :_=note("Stereoscopic settings:") +#@gui :Scene Selector=choice("Automatic Depth Estimation","Daylight Scene","Optimized Lateral Inhibition","Light Motive","Dark Motive","Landscape","Center Foreground","Center Background","Left Foreground","Left Diagonal Foreground","Right Foreground","Right Diagonal Foreground","Left and Right Foreground","Left and Right Background","Bottom and Top Foreground","Bottom and Left Foreground","Bottom and Right Foreground","Central Perspective Outdoor","Central Perspective Indoor","Portrait","Human 1","Human 2","Studio","Underwater","Flat") +#@gui :Far Point Deviation=float(20,-100,100) +#@gui :Stereoscopic Window Position=float(0,-100,100) +#@gui :Depth Field Control=float(20,0,100) +#@gui :Feature Analyzer Threshold=float(0,0,5) +#@gui :Feature Analyzer Smoothness=float(0,0,5) +#@gui :Local Detail Enhancer=float(0,0,5) +#@gui :DOF Analyzer=float(0,0,5) +#@gui :Frequency Analyzer=float(0,0,5) +#@gui :Flip Left / Right=bool(0) +#@gui :Use Individual Depth Map=bool(0) +#@gui :_=note("To use this option your depth map must be placed below your image. Switch input layers to Active and below.") +#@gui :_=separator() +#@gui :_=note("Image settings:") +#@gui :Black & White=bool(0) +#@gui :Output Format=choice("Anaglyph Red/cyan","Anaglyph Red/cyan Optimized","Anaglyph Blue/yellow","Anaglyph Blue/yellow Optimized","Anaglyph Green/magenta","Anaglyph Green/magenta Optimized","Full Side by Side Keep Width","Full Side by Side Keep Uncompressed","Full Bottom/top","Half Side by Side","Half Bottom/top","Interlace Horizontal","Interlace Vertical","Full HD Frame Packing","Unaligned Images","Depth Map Only") +#@gui :Gamma Compensation=float(1.2,0,4) +#@gui :Anti-Ghosting=float(25,0,255) +#@gui :Color Boost=float(1,0,4) +#@gui :Anaglyph Glasses Adjustment=float(0,-100,100) +#@gui :Autocrop=bool(1) +#@gui :Bidirectional Rendering=bool(0) +#@gui :_=separator() +#@gui :_=note("Frame settings:") +#@gui :Render Multiple Frames=bool(0) +#@gui :Render Routine for Wiggle Animations=bool(0) +#@gui :Frames=int(2,2,100) +#@gui :Frame Size=int(200,50,1920) +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil. Latest update: 2012/20/09.") +#@gui 3D Video Conversion:fx_tk_video3D,fx_tk_video3D_preview(1) +#@gui :_=separator() +#@gui :_=note("Stereoscopic settings:") +#@gui :Scene Selector=choice("Automatic Depth Estimation","Daylight Scene","Optimized Lateral Inhibition","Light Motive","Dark Motive","Landscape","Center Foreground","Center Background","Left Foreground","Left Diagonal Foreground","Right Foreground","Right Diagonal Foreground","Left and Right Foreground","Left and Right Background","Bottom and Top Foreground","Bottom and Left Foreground","Bottom and Right Foreground","Central Perspective Outdoor","Central Perspective Indoor","Portrait","Human 1","Human 2","Studio","Underwater","Flat") +#@gui :Far Point Deviation=float(10,-100,100) +#@gui :Stereo Window Position=float(-10,-100,100) +#@gui :Depth Field Control=float(20,0,100) +#@gui :Feature Analyzer Threshold=float(0,0,5) +#@gui :Feature Analyzer Smoothness=float(0,0,5) +#@gui :Local Detail Enhancer=float(0,0,5) +#@gui :DOF Analyzer=float(0,0,5) +#@gui :Frequency Analyzer=float(0,0,5) +#@gui :Motion Analyzer=float(0,-5,5) +#@gui :Flip Left / Right=bool(0) +#@gui :_=separator() +#@gui :_=note("Frames settings:") +#@gui :Black & White=bool(0) +#@gui :Output Format=choice("Anaglyph Red/cyan","Anaglyph Red/cyan Optimized","Anaglyph Blue/yellow","Anaglyph Blue/yellow Optimized","Anaglyph Green/magenta","Anaglyph Green/magenta Optimized","Full Side by Side Keep Width","Full Side by Uncompressed","Full Bottom/top","Half Side by Side","Half Bottom/top","Interlace Horizontal","Interlace Vertical","Full HD Frame Packing","Left and Right Image Streams","Depth Maps Only") +#@gui :Output to Folder=bool(0) +#@gui :Folder Name=folder() +#@gui :Gamma Compensation=float(1.2,0,4) +#@gui :Anti-Ghosting=float(25,0,255) +#@gui :Color Boost=float(1,0,4) +#@gui :Anaglyph Glasses Adjustment=float(0,-100,100) +#@gui :Autocrop=bool(1) +#@gui :Set Frame Format=bool(1) +#@gui :Frame Width=int(1280,128,4096) +#@gui :Frame Format=choice(1,"4:3","16:9","3:2","2:1","21:9","Keep Aspect Ratio") +#@gui :Frames Offset=int(0,-5,5) +#@gui :Reverse Frame Stack=bool(0) +#@gui :_=separator() +#@gui :_=note("Input settings:") +#@gui :Processing Mode=choice("Layer Processing","Batch Processing") +#@gui :Input Folder=folder() +#@gui :Input Frame Files Name=text("frame_") +#@gui :Start Frame Number=int(0,0,99998) +#@gui :End Frame Number=int(1,1,99999) +#@gui :Frame Files Format=choice(".png",".bmp") +#@gui :_=separator() +#@gui :_=note("Advanced editing:") +#@gui :Activate Custom Filter=choice("Off","On","Left Stream Only","Right Stream Only") +#@gui :Custom Filter Code=text(1,"#old movie\n#luminance fx_stripes_y 10,3,0 sepia \n\n#simple vintage\n#+fc 0,15,125 rv fx_compose_exclusion 0.3 \n\n#HDR popout\n#fx_map_tones_fast 2,0.3,3,2 fx_unsharp_octave 4,5,3,0,0,0") +#@gui :Depth Fade In Frames=int(0,0,120) +#@gui :Depth Fade Out Frames=int(0,0,120) +#@gui :_=separator() +#@gui :_=note("Advanced quality control:") +#@gui :Key Frame Rate=int(1,1,100) +#@gui :Stabilizer=float(5,0,100) +#@gui :Preprocessor Radius=float(0,0,5) +#@gui :Preprocessor Power=float(0,0,5) +#@gui :Custom Depth Correction=choice("None","Custom Correction Map","Single Custom Depth Map","Custom Depth Maps Stream") +#@gui :Rendering Mode=choice(1,"Right Eye View","Bidirectional Rendering","Align Image Streams","Anaglyph Reconstruction") +#@gui :_=separator() +#@gui :_=note("Preview:") +#@gui :Preview Type=choice("First Frame","Last Frame","Selected Frame","Full Layer Stack -Slow!-") +#@gui :Preview Frame Selection=int(0,0,99999) +#@gui :_=separator() +#@gui :_=note("Switch input layers to All.") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil. Latest update: 2012/07/10.") +#@gui Automatic Depth Estimation:fx_tk_autodepth,fx_tk_autodepth(1) +#@gui :_=separator() +#@gui :_=note("This filter estimates a depth map from a 2D image by analyzing various monoscopic image properties.") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil Latest update: 2012/30/07.") +#@gui De-Anaglyph:fx_tk_deana,fx_tk_deana(1) +#@gui :_=separator() +#@gui :_=note("This filter reconstructs strereoscopic full colour views from anaglyphs") +#@gui :_=separator() +#@gui :Colour Smoothing=float(20,0,100) +#@gui :Gamma Equalizer=float(2,0.1,10) +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil Latest update: 2012/20/09.") +#@gui Depth Map Construction:fx_tk_depthmap,fx_tk_depthmap(1) +#@gui :_=separator() +#@gui :_=note("This filter estimates and constructs a depth map for a 2D image ") +#@gui :Scene Selector=choice("Automatic Depth Estimation","Daylight Scene","Optimized Lateral Inhibition","Light Motive","Dark Motive","Landscape","Center Foreground","Center Background","Left Foreground","Left Diagonal Foreground","Right Foreground","Right Diagonal Foreground","Left and Right Foreground","Left and Right Background","Bottom and Top Foreground","Bottom and Left Foreground","Bottom and Right Foreground","Central Perspective Outdoor","Central Perspective Indoor","Portrait","Human 1","Human 2","Studio","Underwater","Flat") +#@gui :Depth Field Control=float(20,0,100) +#@gui :Feature Analyzer Threshold=float(0,0,5) +#@gui :Feature Analyzer Smoothness=float(0,0,5) +#@gui :Local Detail Enhancer=float(0,0,5) +#@gui :DOF Analyzer=float(0,0,5) +#@gui :Frequency Analyzer=float(0,0,5) +#@gui :Preprocessor Radius=float(0,0,5) +#@gui :Preprocessor Power=float(0,0,5) +#@gui :Smoothing=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil Latest update: 2012/30/07.") +#@gui Depth Map Reconstruction:fx_tk_depth_obtain,fx_tk_depth_obtain(1) +#@gui :_=note("This filter estimates a depth map from the left and the right view of a stereoscopic image. Images must be aligned correct to compute correct depth information.") +#@gui :Flip Left/Right=bool(0) +#@gui :Smoothness=float(0.1,0,1) +#@gui :Center Size=float(100,0,100) +#@gui :Center Smoothness=float(0,0,50) +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil Latest update: 2012/04/09.") +#@gui Lenticular Print:fx_tk_lenticular,fx_tk_lenticular(1) +#@gui :_=separator() +#@gui :Lenticular Density LPI=float(30,5,200) +#@gui :Lenticular Orientation=choice("Vertical","Horizontal") +#@gui :Print Size Width=float(5,1,50) +#@gui :Print Size Unit=choice("Inch","Centimeter") +#@gui :Print Adjustment Marks=bool(1) +#@gui :Automatic Upscale for Optimum Results=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil. Latest update: 2011/10/06.") +#@gui Single Image Stereogram:fx_tk_stereogram,fx_tk_stereogram_preview(1) +#@gui :_=separator() +#@gui :Deviation=float(50,0,200) +#@gui :_=separator() +#@gui :_=note("Pattern generator") +#@gui :Pattern Variation 1=float(0.5,0,1) +#@gui :Pattern Variation 2=float(10,0,20) +#@gui :Pattern Variation 3=float(0,0,1) +#@gui :Tiles=int(40,10,100) +#@gui :Color 1=color(#ffff00) +#@gui :Color 2=color(#ff0000) +#@gui :Color 3=color(#00ff00) +#@gui :Color 4=color(#0000ff) +#@gui :Color Strength=float(0.5,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil. Latest update: 2012/25/02.") +#@gui :_=note("Input image should be a depth map which is turned into an autostereogram, also known as magic eye image") +#@gui :_=link("Background explained here","http://en.wikipedia.org/wiki/Autostereogram") +#@gui Stereo Image:gcd_stereo_img,gcd_stereo_img(1) +#@gui :_=note("Create a 3D image from a flat one") +#@gui :_=note("\n3D Options") +#@gui :_=separator() +#@gui :3D Image Type=choice("Anaglyph: Red/Cyan","Side by Side","Depth Map","Inverse Depth Map") +#@gui :Balance Color=float(0.5,0,1) +#@gui :Depth=float(1.2,0,3) +#@gui :Distance=float(1,-2,2) +#@gui :_=note("\nDepth Map Options") +#@gui :_=separator() +#@gui :Blur Percentage=float(0.25,0,2) +#@gui :Object Ratio=float(2,0,4) +#@gui :Object Tolerance=int(4,0,5) +#@gui :Despeckle=bool(1) +#@gui :_=note("\nOutput Options") +#@gui :_=separator() +#@gui :Auto Crop=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2015/07/02.") +#@gui Stereoscopic Image Alignment:fx_tk_stereoimage,fx_tk_stereoimage(1) +#@gui :_=separator() +#@gui :Mode=choice("Anaglyph Red/cyan","Anaglyph Red/cyan Optimized","Anaglyph Blue/yellow","Anaglyph Blue/yellow Optimized","Anaglyph Green/magenta","Anaglypgh Green/magenta Optimized","Full Side by Side Keep Width","Full Side by Side Keep Uncompressed","Full Bottom/top","Half Side by Side","Half Bottom/top","Interlace Horizontal","Interlace Vertical","Full HD Frame Packing") +#@gui :Flip Left / Right=bool(0) +#@gui :Gamma Compensation=float(1,0,4) +#@gui :Anti-Ghosting=float(0,0,255) +#@gui :Color Boost=float(1,0,4) +#@gui :Anaglyph Glasses Adjustment=float(0,-100,100) +#@gui :_=separator() +#@gui :_=note("This filter needs two aligned input images.") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil Latest update: 2012/04/08.") +#@gui Undo Anaglyph:gcd_unstereo,gcd_unstereo_preview(1) +#@gui :_=note("Attempt to revert red/cyan anaglyph to 2D") +#@gui :_=note("Warning: with high precision or large image this can be VERY slow!") +#@gui :_=note("\nDisplacement Settings") +#@gui :_=separator() +#@gui :Precision=float(5,1,6) +#@gui :Smoothness=float(0.1,0,1) +#@gui :Horizontal Warp Only=bool(1) +#@gui :Fast (Low Precision) Preview=bool(1) +#@gui :_=note("\nTile Settings") +#@gui :_=separator() +#@gui :Horizontal Tiles=int(1,1,8) +#@gui :Vertical Tiles=int(1,1,8) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2013/10/26.") +#@gui _Testing +#@gui afre +#@gui Contrast FFT:afre_contrastfft,afre_contrastfft_preview(0)+ +#@gui :_=note("Enhance contrast with Fourier transform.  Filter by afre 2019.\n\n") +#@gui :Strength=int(75,1,100) +#@gui :Amount=int(50,0,100) +#@gui :Iterations=int(1,1,10) +#@gui Denoise [afre]:afre_denoise,afre_denoise_preview(1)+ +#@gui :_=note("Denoise.  Filter by afre 2022 Feb9-17.\n\n") +#@gui :Radius=int(1,1,10) +#@gui :_=note("\n\nNote\n\nG'MIC's preview is inaccurate. Apply the filter and review the results in your host editor.") +#@gui Details:afre_details,afre_details_preview(2)+ +#@gui :_=note("Split image into detail scales.  Filter by afre 2020 Aug10.\n\n") +#@gui :Scales=int(2,2,6) +#@gui :_=note("\n\nInstructions\n\nDrag preview image to examine different regions of interest.") +#@gui :_=note("\n\nNote\n\nG'MIC's preview is inaccurate. Apply the filter and review the results in your host editor.") +#@gui Gamify:fx_gamify,fx_gamify_preview(0)+ +#@gui :Lightness=int(50,50,60) +#@gui :Chroma=float(2,1.1,5) +#@gui :_=separator() +#@gui :Normalize=bool(1) +#@gui :Contrast=float(1,1,1.5) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Filter by afre. Latest update: 2017-01-05.") +#@gui Gleam:afre_gleam,afre_gleam_preview(0)+ +#@gui :_=note("Add gleam effect.  Hint: Try different combinations of smooth and threshold.  Filter by afre 2019.\n\n * Experimental filter.\n\n") +#@gui :Smooth=int(3,2,100) +#@gui :Threshold=int(50,10,90) +#@gui Half & Half:afre_halfhalf,afre_halfhalf_preview(0)+ +#@gui :_=note("Stitch left and right halves of 2 images, respectively.  Filter by afre 2020-Feb21.\n\n * Remember to set Input layers.\n * Match size doesn't work in Krita.\n\n") +#@gui :Match Size=bool(0) +#@gui Hessian Norm:fx_hnorm,fx_hnorm_preview(0)+ +#@gui :Strength=float(1,0.5,1.5) +#@gui :Contrast=int(50,1,99) +#@gui :Invert=bool(0) +#@gui :_=separator() +#@gui :_=note("Filter by afre. Latest update: 2018-05-09.") +#@gui Montage X:afre_montagex,afre_montagex_preview(1)+ +#@gui :_=note("Generate montage without resizing.  Filter by afre 2021 Apr16.\n\n - Set Input layers to All.\n\n") +#@gui :Max Per Row=int(5,1,25) +#@gui :Spacing=int(1,0,10) +#@gui :Matte Colour=color(#e6ffe6) +#@gui Portrait Montage:afre_portraitmontage,afre_portraitmontage_preview(1)+ +#@gui :_=note("Generate portrait montage with resizing.  Filter by afre 2020-2021 Apr18.\n\n - Set Input layers to All.\n - Centre subjects for best results.\n\n") +#@gui :Size=choice(1,"Small","Large") +#@gui :Spacing=int(1,1,20) +#@gui :Matte Shape=choice("None","Circle","Polygon","Star") +#@gui :Matte Colour=color(#e6ffe6) +#@gui Query Primary:afre_queryprimary,afre_queryprimary_preview(1)+ +#@gui :_=note("Query pixel minima, maxima or medians.  Filter by afre 2021 Jul14.\n\n") +#@gui :Mode=choice(1,"Minima","Maxima","Medians") +#@gui :Skip Last Channel=bool(1) +#@gui :_=note("* Disable if image does not have an alpha or transparency channel.\n\n") +#@gui Sharpen FFT:afre_sharpenfft,afre_sharpenfft_preview(0)+ +#@gui :_=note("Sharpen with Fourier transform.  Filter by afre 2019-2020 Jan18.\n\n") +#@gui :Strength=int(15,1,50) +#@gui :Size=int(1,1,10) +#@gui Vigcirc:afre_vigcirc,afre_vigcirc_preview(0)+ +#@gui :_=note("Add circular vignette.  Filter by afre 2019.\n
Instructions:\n\n * Negative strength brightens the periphery.\n\n") +#@gui :Size=int(90,50,150) +#@gui :Strength=int(75,-500,500) +#@gui :Left-Right=int(50,0,100) +#@gui :Up-Down=int(50,0,100) +#@gui Vigrect:afre_vigrect,afre_vigrect_preview(0)+ +#@gui :_=note("Add rectangular vignette.  Filter by afre 2017-2019.\n
Instructions:\n\n * Negative strength brightens the periphery.\n\n") +#@gui :Size=int(50,1,100) +#@gui :Strength=int(75,-500,500) +#@gui :Blur=int(10,1,50) +#@gui :Left-Right=int(50,0,100) +#@gui :Up-Down=int(50,0,100) +#@gui _Chris From Pixls.Us +#@gui Remove Scratches:fx_remove_scratches,fx_remove_scratches_preview(0) +#@gui :_=note("Note: Scratch removal for scanned film images") +#@gui :_=separator() +#@gui :Threshold=float(72,0,100) +#@gui :Erosion=int(2,0,5) +#@gui :Dilation=int(4,0,7) +#@gui :Show Preview After=choice(3,"Threshold","Erosion","Dilation","Final Image") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Chris/Pixls.us. Latest update: 2017/04/01.") +#@gui _Corvo +#@gui Corvo's Painting 5:fx_corvo_painting_5,fx_corvo_painting_5(0) +#@gui :_=note("Polygonize settings") +#@gui :Amplitude=int(35,0,2000) +#@gui :Smoothness=float(10,0,100) +#@gui :Minimal Area=float(10,0,100) +#@gui :Alpha Polygonize=float(0.5,0,1) +#@gui :_=separator() +#@gui :Texture=float(50,0,100) +#@gui :Plasma=float(0.3,0,1) +#@gui :_=separator() +#@gui :_=note("Smooth settings") +#@gui :Amplitude=float(50,0,1000) +#@gui :Gradient Smoothness=float(2,0,10) +#@gui :Tensor Smoothness=float(5,0,10) +#@gui :Alpha Filter=float(1,0,1) +#@gui _Deprecated +#@gui Morphological Filter (Deprecated):fx_morpho,fx_morpho_preview(0) +#@gui :Action=choice("Erosion","Dilation","Opening","Closing","Original - Erosion","Dilation - Original","Original - Opening","Closing - Original") +#@gui :Size=int(5,2,60) +#@gui :Negative=bool() +#@gui :Shape=choice(0,"Square","Octagonal","Circular") +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :Value Action=choice("None","Cut","Stretch") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2014/06/08.") +#@gui __Repair +#@gui Anti Alias:gcd_anti_alias,gcd_anti_alias_preview(0) +#@gui :_=note("Selectively smooth resizing pixelation") +#@gui :_=separator() +#@gui :Smooth Amount=int(60,0,200) +#@gui :Edge Exponent=float(0.3,0,10) +#@gui :Lighten Edges=int(50,0,255) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2013/02/09.") +#@gui _Colors +#@gui Auto Balance:gcd_auto_balance,gcd_auto_balance(1) +#@gui :_=note("Map based tone and color balance") +#@gui :_=separator() +#@gui :Area=float(30,0,200) +#@gui :Smooth=float(0,0,2) +#@gui :Channels=choice(0,"HSI","HSV","Lab","Linear RGB","RGB","YCbCr") +#@gui :Balance SRGB=bool(1) +#@gui :Reduce RAM=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2018/08/08.") +#@gui _Testing +#@gui Garagecoder +#@gui Blend [Feather]:gcd_blend_feather,gcd_blend_feather(1) +#@gui :_=note("Overlay layers seamlessly by feathering edges") +#@gui :_=note("1. Set Input layers to Active & below for two layers") +#@gui :_=note("2. For best results ensure layers are the same size") +#@gui :_=note("\nOutput Options") +#@gui :_=separator() +#@gui :Max Delta=int(100,0,200) +#@gui :Color Transfer=float(0.5,0,1) +#@gui :Hue Extent=float(2,0,6) +#@gui :Remove BG=int(0,0,20) +#@gui :Keep Layers=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2014/05/05.") +#@gui :_=note("\nNotes") +#@gui :_=note("Remove BG can help mask off unwanted areas, which works") +#@gui :_=note("best on objects surrounded by simple backgrounds.") +#@gui :_=note("Overlaying a larger area can sometimes improve the output.") +#@gui Blend [Multiscale]:fx_gcd_blend_multiscale,fx_gcd_blend_multiscale(0) +#@gui :_=note("Alpha blend with multiscale laplacian filter") +#@gui :_=separator() +#@gui :_=note("* Set Input layers to Active & below for two layers") +#@gui :Scales=int(5,1,10) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2022/05/29.") +#@gui :_=note("\nNotes") +#@gui :_=note("Top layer must have an opacity channel") +#@gui :_=note("Blending occurs at the edges of an opaque region") +#@gui :_=note("Higher scales increase blend distance and cpu cost") +#@gui Colored Signum:fx_gcd_signum_color,fx_gcd_signum_color(1) +#@gui :_=separator() +#@gui :Sigma1=float(0.1,0,1) +#@gui :Sigma2=float(5,0,20) +#@gui :Axes1=choice(2,"Xy","X","Y") +#@gui :Axes2=choice(0,"Xy","X","Y") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2022/11/01.") +#@gui __Repair +#@gui Compression Blur:gcd_comp_blur,gcd_comp_blur_preview(0) +#@gui :_=note("For subtle smoothing of compression artifacts") +#@gui :_=separator() +#@gui :_=note("1. Preview will not show the final result accurately.") +#@gui :_=note("2. Be sure to apply before any image resizing.") +#@gui :_=note("3. Reduce grid width when increasing divisions to avoid over-smoothing.") +#@gui :_=note("4. Set grid divisions to zero for 100% smoothing.\n") +#@gui :_=separator() +#@gui :Grid Divisions=int(2,0,3) +#@gui :Grid Width=int(3,1,3) +#@gui :Grid Smoothing=float(1,0,1) +#@gui :Preserve Edges=int(100,0,100) +#@gui :Colour Channels=bool(1) +#@gui :Boost Smooth=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2015/05/15.") +#@gui _Testing +#@gui Garagecoder +#@gui CRMT Tiles:fx_gcd_crmt_tile,fx_gcd_crmt_tile(1) +#@gui :_=note("Tiling by Clone, Rotate, Mirror, Translate method.") +#@gui :_=separator() +#@gui :Constants=text{"t_w=[w] t_h=[round(1/2*sqrt(3)*$t_w)]"} +#@gui :Render Size=text("[3*$t_w,2*$t_h]") +#@gui :Command List=text(1,"C0 T0 C0 Fo R-60 T[-1/2*$t_w,0]") +#@gui :Inpaint=bool(0) +#@gui :_=separator() +#@gui :_=note("Implementation : Garagecoder. Latest update : 2019/05/10.") +#@gui :_=note("Author: G. Bachelier") +#@gui :_=note("\nWarning: alpha version, don't expect perfection!") +#@gui Cumulative Math:fx_gcd_cumul_math,fx_gcd_cumul_math_preview(1) +#@gui :_=note("Cumulative Math glitch filter") +#@gui :_=separator() +#@gui :Operation=choice(0,"Add","Or","Xor","And","Mod") +#@gui :Amount=int(1,1,512) +#@gui :Step=int(1,1,256) +#@gui :Horizontal=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2018/08/18.") +#@gui Deblur Texture:fx_gcd_blur_deblur_texture,fx_gcd_blur_deblur_texture_preview(0) +#@gui :_=note("Variance-based edge preserving deblur or smooth") +#@gui :_=separator() +#@gui :Iters=int(4,1,20) +#@gui :Sigma=float(1,0,4) +#@gui :Edges=float(0.5,0,1) +#@gui :Action=choice("Deblur","Smooth") +#@gui :Channels=choice(2,"RGB","Linear RGB","Luma","Chroma") +#@gui :Percentage Sigma=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2018/09/02.") +#@gui :_=note("\nNotes") +#@gui :_=note("Iters: overall amount, increases computation time.") +#@gui :_=note("Sigma: detail scale.") +#@gui :_=note("Edges: amount of edge preservation.") +#@gui :_=note("Percentage sigma: make detail scale relative to image size.") +#@gui Depth Blur:gcd_depth_blur,gcd_depth_blur(1) +#@gui :_=note("Selectively blur based on estimated depth") +#@gui :_=note("Amount of blur applied is relative to luminance of the depth map") +#@gui :_=note("\nFocus Options") +#@gui :_=separator() +#@gui :Distance Threshold=int(0,0,100) +#@gui :Blur Amount=int(15,0,100) +#@gui :_=note("\nDepth Map Options") +#@gui :_=separator() +#@gui :Blur Percentage=float(0.25,0,2) +#@gui :Object Ratio=float(2,0,4) +#@gui :Object Tolerance=int(4,0,5) +#@gui :Create/View Depth Map=bool(0) +#@gui :Reverse Map=bool(1) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2013/02/24.") +#@gui Dither SRGB:fx_gcd_dither_srgb,fx_gcd_dither_srgb(0) +#@gui :_=note("Dither sRGB image with selected levels per channel") +#@gui :_=separator() +#@gui :Levels=int(2,2,16) +#@gui :Luminance=bool(1) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2021/10/17.") +#@gui __Black & White +#@gui Emboss:gcd_emboss,gcd_emboss_preview(1) +#@gui :_=note("Make an image look embossed") +#@gui :_=separator() +#@gui :Midpoint=int(128,0,255) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2014/11/11.") +#@gui _Testing +#@gui Garagecoder +#@gui Geometric Color Balance:gcd_geometric_balance,gcd_geometric_balance(1) +#@gui :_=note("Equalize XYZ channel gammas") +#@gui :_=separator() +#@gui :_=note("Input is assumed to be sRGB D65 [0,255]") +#@gui :Target=float(0,0,1) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2019/01/01.") +#@gui :_=note("\nSet target to zero to use input Y geometric mean.") +#@gui Gradient Exponent:fx_gcd_gradient_exponent,fx_gcd_gradient_exponent(1) +#@gui :_=note("Adjust global gradient ratios") +#@gui :_=separator() +#@gui :Exponent=float(0.5,0,2) +#@gui :_=separator() +#@gui :Channels=choice(0,"RGB","HSI","HSV","YCbCr","Lab") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2022/09/02.") +#@gui Image InfoMap:gcd_infomap,gcd_infomap(1) +#@gui :_=note("View images in various informational ways") +#@gui :_=separator() +#@gui :Output=choice("Spectral Tones","Detail Map","JPEG CbCr Detail","Local Equality","Standard Score") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2016/09/26.") +#@gui Inpaint [Clone]:fx_gcd_clone_inpaint,fx_gcd_clone_inpaint(1) +#@gui :_=note("Simple proximity cloning inpaint for object removal") +#@gui :_=separator() +#@gui :Type=choice("Horizontal","Vertical") +#@gui :Bias=choice(1,"Left/Top","None","Right/Bottom") +#@gui :Scale=float(10,1,100) +#@gui :Blend to Boundary=bool(1) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2022/08/08.") +#@gui :_=note("\nNotes") +#@gui :_=note("Transparent regions will be inpainted") +#@gui :_=note("This filter is not automatic: adjust scale as required") +#@gui :_=note("For best results, inpaint a single region with a simple shape") +#@gui Inverse Bezier Warp:gcd_ebwarp,gcd_ebwarp(1) +#@gui :_=note("Horizontal inverse conformal bezier warp") +#@gui :_=separator() +#@gui :Mid=float(0.5,0,1) +#@gui :End=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2016/02/06.") +#@gui :_=link("http://benpaulthurstonblog.blogspot.co.uk/2015/12/ebezier.html") +#@gui __Repair +#@gui JPEG Smooth:gcd_jpeg_smooth,gcd_jpeg_smooth_preview(0) +#@gui :_=note("Quick JPEG cleanup for moderate compression glitches") +#@gui :_=separator() +#@gui :Compression Filter=bool(1) +#@gui :Anti Alias=bool(1) +#@gui :Quick Enlarge=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2013/02/09.") +#@gui _Testing +#@gui Garagecoder +#@gui Layer Manipulation:gcd_layers,gcd_layers_preview(1) +#@gui :_=note("\nTransform") +#@gui :_=separator() +#@gui :Scale=float(100,1,200) +#@gui :Angle=int(0,-90,90) +#@gui :Reduce Only (Requires Two Layers)=bool(1) +#@gui :_=note("\nPosition") +#@gui :_=separator() +#@gui :CentreX=float(0,-50,50) +#@gui :CentreY=float(0,-50,50) +#@gui :_=note("\nEdges") +#@gui :_=separator() +#@gui :Erode=float(0,0,50) +#@gui :Smooth=int(0,0,25) +#@gui :Curvature (Instead of Gaussian)=bool(0) +#@gui :_=note("\nLayer") +#@gui :_=separator() +#@gui :Opacity=float(1,0,1) +#@gui :Mode=choice("Normal","Add","Burn","Darken","Difference","Divide","Dodge","Grain Extract","Grain Merge","Hard Light","Hue","Lighten","Multiply","Overlay","Saturation","Soft Light","Screen","Subtract","Value") +#@gui :Flip=choice("None","Horizontal","Vertical","Both") +#@gui :Match Lower Layer Size=bool(1) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2017/06/05.") +#@gui :_=note("\nNote: preview is low quality for speed") +#@gui __Colors +#@gui LMS Adjustment:gcd_balance_lms,gcd_balance_lms(1) +#@gui :_=note("Chromatically adapt to a new illuminant") +#@gui :_=separator() +#@gui :Long=float(1,0.5,1.5) +#@gui :Medium=float(1,0.5,1.5) +#@gui :Short=float(1,0.5,1.5) +#@gui :_=separator() +#@gui :Adapt Luminance=bool(0) +#@gui :Pre Normalize=bool(0) +#@gui :Auto Balance=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2018/09/08.") +#@gui :_=note("\nNotes") +#@gui :_=note("sRGB D65 input is assumed.") +#@gui :_=note("LMS sliders: control illuminant ratios.") +#@gui :_=note("Adapt Luminance: adjust luminance as well, may cause clipping.") +#@gui :_=note("Pre Normalize: stretch input RGB ranges to maximum.") +#@gui :_=note("Auto Balance: attempt to set neutral grey lighting.") +#@gui _Testing +#@gui Garagecoder +#@gui Local F-Mean:gcd_fx_local_fmean,gcd_fx_local_fmean(1) +#@gui :_=note("Map local f-mean to match global or target") +#@gui :_=separator() +#@gui :Radius=float(15,0,100) +#@gui :Bright=float(0,0,1) +#@gui :Mean=choice(0,"Harmonic","Geometric","Arithmetic","Quadratic") +#@gui :Channels=choice(5,"HSI","HSV","Lab","Linear RGB","RGB","Luminance","YCbCr") +#@gui :Normalize=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2019/05/11.") +#@gui :_=link("https://en.wikipedia.org/wiki/Quasi-arithmetic_mean") +#@gui :_=note("\nNotes") +#@gui :_=note("Set bright to zero to auto match global f-mean") +#@gui :_=note("Normalize will disable bright control for arithmetic and quadratic") +#@gui Multi Thresholds:tran_multi_threshold,tran_multi_threshold(1) +#@gui :_=note("Apply color to selectable tones") +#@gui :_=separator() +#@gui :Threshold 1=int(50,0,255) +#@gui :Threshold 2=int(100,0,255) +#@gui :Threshold 3=int(150,0,255) +#@gui :Threshold 4=int(200,0,255) +#@gui :1st Color=color(#090001) +#@gui :2nd Color=color(#af2a1b) +#@gui :3rd Color=color(#656565) +#@gui :4th Color=color(#aea583) +#@gui :5th Color=color(#f7e4a0) +#@gui :_=separator() +#@gui :_=note("Author : trandoductin. Latest update : 2016/08/25.") +#@gui __Colors +#@gui Normalize Brightness:gcd_normalize_brightness,gcd_normalize_brightness(1) +#@gui :_=note("Normalize brightness across the image") +#@gui :_=separator() +#@gui :Bright=float(0,-2,2) +#@gui :Area=float(10,0,100) +#@gui :Smooth=float(0,0,4) +#@gui :Channels=choice(3,"HSI","HSV","Lab","YCbCr","SRGB") +#@gui :Mask=choice("Normal","Darken","Lighten") +#@gui :Absolute Brightness=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2017/05/27.") +#@gui :_=note("\nTips:\n\nDefault settings for de-haze.") +#@gui :_=note("Large area and Lab for very bright images.") +#@gui :_=note("Small area and HSV for very dark images.") +#@gui :_=note("Medium area and HSV for high contrast images.") +#@gui :_=note("Smooth to reduce artifacts, however some detail may be lost.") +#@gui _Testing +#@gui Garagecoder +#@gui PQCT Example:gcd_pqct,gcd_pqct(1) +#@gui :_=note("Parameterized Quadratic Conformal transformation") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2016/02/07.") +#@gui :_=note("\nBased on example code from:") +#@gui :_=link("http://benpaulthurstonblog.blogspot.co.uk/2015/12/parameterized-quadratic-conformal.html") +#@gui __Details +#@gui Quick Tonemap:fx_gcd_quicktone,fx_gcd_quicktone(1) +#@gui :_=note("Simple tone and detail control") +#@gui :_=separator() +#@gui :Power=float(1,0.5,2.5) +#@gui :Radius=float(4,0,10) +#@gui :Range=float(20,0,20) +#@gui :Smooth=float(0,0,4) +#@gui :Channels=choice(3,"HSI","HSV","Lab","YCbCr") +#@gui :Values=choice(1,"Cut","Normalize") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2018/06/26.") +#@gui _Testing +#@gui Garagecoder +#@gui Recolor:gcd_recol,gcd_recol(1) +#@gui :_=note("Apply colors to a black and white image") +#@gui :_=separator() +#@gui :Min Hue Drift=int(-14,-45,0) +#@gui :Max Hue Drift=int(14,0,45) +#@gui :_=separator() +#@gui :_=note("Note : This filter needs two layers to work properly.") +#@gui :_=note("Original Author : David Tschumperlé") +#@gui :_=note("Adapted by : Garagecoder. Latest update: 2013/01/16.") +#@gui __Details +#@gui Sharpen [Gradient]:gcd_sharpen_gradient,gcd_sharpen_gradient_preview(1) +#@gui :_=note("Sharpen areas with low detail") +#@gui :_=separator() +#@gui :Amount=float(0.5,0,2) +#@gui :Scale=float(2,0.1,2) +#@gui :Values=choice("Cut","Normalize Luma") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2015/09/28.") +#@gui Sharpen [Tones]:gcd_sharpen_tones,gcd_sharpen_tones_preview(1) +#@gui :_=note("Sharpen shadows and highlights") +#@gui :_=separator() +#@gui :Amount=float(1,0,4) +#@gui :Centre=int(128,0,255) +#@gui :Values=choice("Cut","Normalize Luma") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2015/09/28.") +#@gui _Testing +#@gui Garagecoder +#@gui Simple Dehaze:gcd_simple_dehaze,gcd_simple_dehaze(1) +#@gui :_=note("Simple sRGB dehaze") +#@gui :_=separator() +#@gui :Haze=float(0.75,0,1) +#@gui :Exposure=float(1,0,2) +#@gui :Scale=float(0.75,0,25) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2023/04/08.") +#@gui Smart Rotate:gcd_srotate,gcd_srotate(1) +#@gui :_=note("Rotate an image and extrapolate the corners") +#@gui :_=note("\nRotation Options") +#@gui :_=separator() +#@gui :Angle=int(0,-90,90) +#@gui :Centrex=int(50,0,100) +#@gui :Centrey=int(50,0,100) +#@gui :_=note("\nQuality Options") +#@gui :_=separator() +#@gui :Interpolation=choice(1,"Linear","Bicubic") +#@gui :Inpainting=choice(1,"Low","Normal","High","Ultra") +#@gui :Lookup Scale=int(6,1,16) +#@gui :Lookup Factor=float(0.6,0.2,2) +#@gui :Seamless=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2014/12/05.") +#@gui :_=note("\nNotes") +#@gui :_=note("* Dimensions are not altered") +#@gui :_=note("* Quality settings affect speed!") +#@gui :_=note("The preview is a rough guide only. Images with simple edges tend to work best.") +#@gui :_=note("Results can be improved by selecting a higher inpainting quality, but processing will take longer.") +#@gui :_=note("Select seamless to reduce visible seams at the corners.") +#@gui __Repair +#@gui Smooth [Geometric-Median]:fx_gcd_geometric_median,fx_gcd_geometric_median_preview(0) +#@gui :_=note("Smooth using windowed geometric median of vectors") +#@gui :_=separator() +#@gui :Radius=int(3,1,9) +#@gui :Iters=int(12,1,20) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2018/07/18.") +#@gui :_=note("\nNotes") +#@gui :_=note("This prototype filter can be extremely slow to compute!") +#@gui :_=note("Only odd window sizes are currently supported.") +#@gui _Testing +#@gui Garagecoder +#@gui Split Objects:gcd_splitobj,gcd_splitobj_preview(1) +#@gui :_=note("Extract objects from an image to a new layer") +#@gui :_=note("1. Create a new transparent layer, mark background red and objects green") +#@gui :_=note("2. Set Input layers to Active & below, objects will be split to two layers") +#@gui :_=note("\nEdge Detection Options") +#@gui :_=separator() +#@gui :Alpha Min=int(50,0,100) +#@gui :Edge Flow=int(3,0,20) +#@gui :Median=int(3,0,7) +#@gui :_=note("\nOutput Options") +#@gui :_=separator() +#@gui :Swap Layers=bool(0) +#@gui :Grow Alpha=int(0,-20,20) +#@gui :Blur Alpha=int(0,0,20) +#@gui :Opacity=int(40,0,100) +#@gui :Inpainting=choice(0,"Off","Low","Normal","High","Ultra") +#@gui :_=value(0) +#@gui :_=separator() +#@gui :_=note("Note : This filter needs two layers to work properly.") +#@gui :_=note("Author : Garagecoder. Latest update: 2016/01/22.") +#@gui Stereo Video:gcd_stereo_vid,gcd_stereo_vid_preview(1) +#@gui :_=note("Convert a series of image files to 3D") +#@gui :_=note("\nFile Options") +#@gui :_=separator() +#@gui :Start Image=file() +#@gui :End Image=file() +#@gui :Output Folder=_folder() +#@gui :_=note("\n3D Options") +#@gui :_=separator() +#@gui :3D Image Type=choice("Anaglyph: Red/Cyan","Side by Side","Depth Map","Inverse Depth Map") +#@gui :Balance Color=float(0.5,0,1) +#@gui :Depth=float(1.2,0,2) +#@gui :_=note("\nDepth Map Options") +#@gui :_=separator() +#@gui :Blur Percentage=float(0.25,0,2) +#@gui :Object Ratio=float(2,0,4) +#@gui :Object Tolerance=int(4,0,5) +#@gui :Despeckle=bool(1) +#@gui :_=note("\nVideo Options") +#@gui :_=separator() +#@gui :Frame Buffer=_int(5,1,10) +#@gui :Scene Detection=bool(1) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2015/07/02.") +#@gui Target Color Spot:fx_gcd_color_target,fx_gcd_color_target(1) +#@gui :_=note("Use color curves to make the selected point match the target") +#@gui :_=separator() +#@gui :Coordinates=point(50,50,0,1,40,250,60,128,2%)_0 +#@gui :Target Color=color(#afafaf) +#@gui :Chromacity Range=choice("Global","Wide","Narrow") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2022/06/15.") +#@gui :_=note("\nNotes") +#@gui :_=note("Set the target to the desired color for the spot you selected.") +#@gui :_=note("Reduce chromacity range to limit the affected regions.") +#@gui :_=note("sRGB D65 input is assumed.") +#@gui __Colors +#@gui Temperature Balance:gcd_temp_balance,gcd_temp_balance(1) +#@gui :_=note("Auto-detect lighting and adjust color temperature") +#@gui :_=separator() +#@gui :Saturation=float(0,-1,1) +#@gui :Level=float(0,-1,1) +#@gui :Color=float(1,0,2) +#@gui :Lighting=choice("Automatic","Automatic [Scan All Hues]","Standard [No Scan]") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2016/08/30.") +#@gui _Testing +#@gui Garagecoder +#@gui Transfer Colors [Curves]:fx_gcd_color_spot_matching,fx_gcd_color_spot_matching_preview(1) +#@gui :_=note("Use color curves to match the target to the source") +#@gui :_=separator() +#@gui :Source=point(75,75,0,1,0,150,250,128,2%) +#@gui :Target=point(25,25,0,1,250,250,0,128,2%) +#@gui :Chromacity Range=choice(1,"Global","Wide","Narrow") +#@gui :Preview=choice(0,"Vertical","Horizontal","Layers") +#@gui :Swap Layers=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2022/06/15.") +#@gui :_=note("\nNotes") +#@gui :_=note("Ensure the layer dimensions match for best results.") +#@gui :_=note("Reduce chromacity range to limit the affected regions.") +#@gui :_=note("sRGB D65 input is assumed.") +#@gui Undo Unsharp Mask:fx_gcd_undo_unsharp,fx_gcd_undo_unsharp_preview(0) +#@gui :_=note("Reverse the effect of an unsharp mask") +#@gui :_=separator() +#@gui :Radius=float(3,0,30) +#@gui :Amount=float(0.5,0,5) +#@gui :Type=choice(1,"Box","Gaussian") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2021/12/19.") +#@gui :_=note("\nNotes") +#@gui :_=note("Useful for fixing halos due to excessive unsharp mask application.") +#@gui :_=note("For best results, settings should match the original unsharp filter.") +#@gui :_=note("This obviously requires estimation if the settings are unknown.") +#@gui __Repair +#@gui Unquantize [JPEG Smooth]:gcd_unquantize,gcd_unquantize(0) +#@gui :_=note("Remove quantization artifacts") +#@gui :_=note("1. Preview will not show the final result accurately.") +#@gui :_=note("2. Be sure to apply before any image resizing.") +#@gui :_=note("\nBlock Smoothing Options") +#@gui :_=separator() +#@gui :Iterations=int(6,0,8) +#@gui :Preserve Edges=float(1,0,1) +#@gui :Color Channels=bool(1) +#@gui :_=note("\nAnti-Aliasing Options") +#@gui :_=separator() +#@gui :Iterations=int(5,0,30) +#@gui :Threshold=int(15,1,200) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2014/04/29.") +#@gui :_=note("\nNotes") +#@gui :_=note("Useful for removal of common compression and rescaling artifacts.") +#@gui :_=note("* If a specific glitch remains, try reducing edge preservation.") +#@gui :_=note("* For AA only set Block Iterations to 0.") +#@gui Upscale [Edge]:fx_gcd_upscale_edge,fx_gcd_upscale_edge_preview(0) +#@gui :_=note("Edge sharpening upscale") +#@gui :_=separator() +#@gui :Factor=choice(1,"Custom","2","3","4","5","6","7","8") +#@gui :Factor=float(1,1,8)_0 +#@gui :Type=choice(1,"Linear","Bicubic") +#@gui :Values=choice(1,"Unbounded","Cut","Normalize") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2021/01/12.") +#@gui :_=note("\nVariance smoothed upscale for high scale factors.") +#@gui :_=note("Image dimensions are multiplied by specified factor.") +#@gui _Testing +#@gui Garagecoder +#@gui Upscale [Noise]:gcd_upscale_noise,gcd_upscale_noise_preview(0) +#@gui :_=note("Upscale 2x using randomized estimation of original") +#@gui :_=separator() +#@gui :Noise=int(16,0,32) +#@gui :Iters=int(2,1,3) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2018/08/08.") +#@gui :_=note("\nNote: reduce iters and increase noise for poor images.") +#@gui Upscale [Recursive2x]:fx_gcd_upscale_recursive2x,fx_gcd_upscale_recursive2x_preview(0) +#@gui :_=note("Self similarity 2x upscale") +#@gui :_=note("\nQuality Options") +#@gui :_=separator() +#@gui :Kernel=_int(4,0,10) +#@gui :_=note("\nProcessing Options") +#@gui :_=separator() +#@gui :Sharpness=float(0.05,0,0.4) +#@gui :Grain=float(0.01,0,0.1) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2023/02/14.") +#@gui :_=note("\nNotes") +#@gui :_=note("Preview is fixed to lowest quality kernel.") +#@gui :_=note("Kernel size zero will use randomized matching.") +#@gui :_=note("Due to the algorithm some glitches are expected.") +#@gui :_=note("\nWarning: large kernels are slow to compute.") +#@gui :_=note("Image size also affects computation time significantly.") +#@gui Upscale [Solver2x]:fx_gcd_upscale_solver2x,fx_gcd_upscale_solver2x_preview(0) +#@gui :_=note("Anisotropic 2x upscale with optional unsharpening") +#@gui :_=note("\nQuality Options") +#@gui :_=separator() +#@gui :Kernel=_int(4,1,6) +#@gui :_=note("\nUnsharp Options") +#@gui :_=separator() +#@gui :Enabled=bool(0) +#@gui :Radius=float(1,0,30) +#@gui :Amount=float(1,0,5) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2022/12/20.") +#@gui :_=note("\nUsage") +#@gui :_=note("Preview is fixed to lowest quality kernel.") +#@gui :_=note("Very small images tend to require a small kernel.") +#@gui :_=note("Enable unsharpening to counteract prominent halos.") +#@gui :_=note("\nWarning: large kernels are slow to compute.") +#@gui :_=note("Image size also affects computation time significantly.") +#@gui Warp Map:gcd_warpmap,gcd_warpmap(1) +#@gui :_=note("Warp an image using another as a surface") +#@gui :_=separator() +#@gui :Depth=float(5,0,100) +#@gui :Detail=float(0,0,10) +#@gui :Smoothness=float(0,0,10) +#@gui :Blend Mode=choice("Warp","Multiply","Softlight","None") +#@gui :Swap Layers=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2013/02/09.") +#@gui :_=note("\nNotes") +#@gui :_=note("The top layer will be warped using the bottom layer as a surface.") +#@gui :_=note("\nDepth: Set the apparent depth of the surface.") +#@gui :_=note("Detail: Perform second warp with no smooth for fine detail.") +#@gui :_=note("Smooth: Set low for emboss, high to wrap around large objects.") +#@gui __Rendering +#@gui Wiremap:gcd_wiremap,gcd_wiremap(1) +#@gui :_=note("Turn an image into a wireframe map") +#@gui :_=separator() +#@gui :Segments=int(100,4,400) +#@gui :Depth=int(100,4,400) +#@gui :Smoothness=float(0.5,0,2) +#@gui :Distance=float(0.5,-2,2) +#@gui :Output=choice("Black & White","Color","Transparent Black & White","Transparent Color") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2016/01/27.") +#@gui :_=note("\nWarning: can be extremely slow with high segments!") +#@gui :_=note("Lower layer will be used for color if available.") +#@gui _Testing +#@gui Garagecoder +#@gui Xbr2x:gcd_xbr2x,gcd_xbr2x(1) +#@gui :_=note("Implementation of the xBR 2x [noblend] algorithm by Hyllian.") +#@gui :_=link("http://code.google.com/p/2dimagefilter/wiki/ImageResizer") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2013/05/29.") +#@gui :_=note("Disclaimer : This is a near complete recode based on C# source from ImageResizer") +#@gui :_=note("The results may not fully represent the original routine!") +#@gui _Gentlemanbeggar +#@gui 60's Cinema:fx_gb_cfx,fx_gb_cfx_preview(0) +#@gui :Grain=float(10,0,25) +#@gui :Noon for Midnight=bool(0) +#@gui :GeneKelly=bool() +#@gui :RayHarryhausen=bool() +#@gui :CaryGrant=bool() +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("\nUsage Notes: Set Output mode to 'New Layer'. After running filter, I recommend setting the newly created layer blend mode to 'hard light' when using 'noon for midnight' and 'soft light' for other images. This filter looks best on well lit scenes.") +#@gui About:_none_,gui_gb_about +#@gui :_=note{" ( Gentlemanbeggar?s Filter Set for G'MIC)\n\nis proposed to you by"} +#@gui :_=note("Gentlemanbeggar") +#@gui :_=note("\n") +#@gui :_=separator() +#@gui :_=note(" The source code of this filter is available at :") +#@gui :_=link("http://gentlemanbeggar.wordpress.com") +#@gui :_=separator() +#@gui :_=note("\nThe filters in this folder are still under development and may be subject to changes.") +#@gui Lens Blur:fx_gb_lb,fx_gb_lb_preview(0) +#@gui :_=note("\nUsage Notes: Set Output mode to 'New image' or 'in place' to simply reverse the frames in this image. Set mode to 'New layers' to add the reversing effect to your current image.") +#@gui :Amplitude=float(10,5,20) +#@gui :Bokeh=float(7,0,20) +#@gui :_=separator() +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui Ping Pong:fx_gb_pp,gui_no_preview +#@gui :_=note("\nUsage Notes: Set Output mode to 'New image' or 'in place' to simply reverse the frames in this image. Set mode to 'New layers' to add the reversing effect to your current image.") +#@gui _Gmic Tutorials +#@gui Blur by Color:gtutor_blur_img,gtutor_blur_img_preview +#@gui :Range=choice(3,"XL","VL","L","N","M","VM","XM") +#@gui :Amplitude=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Author: Garry R. Osgood. Latest update: 2014/08/30.") +#@gui :_=link("Blur by color instructions and tutorial.","https://gmic.eu/oldtutorial/blur-by-color-filter.shtml") +#@gui __Patterns +#@gui Hedcut (Experimental):hedcut,gtutor_hedcut_preview(0) +#@gui :_=note("Photometric:") +#@gui :Contrast=float(0.5,0,1) +#@gui :Luminance Level=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Pattern:") +#@gui :Smoothing=float(0.5,0,1) +#@gui :Size=float(0.0,0,1) +#@gui :Step=float(0.5,0,1) +#@gui :_=note("Choice:") +#@gui :Quality=bool(0) +#@gui :Force Gray=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Garry R. Osgood. Latest update: 2015/03/05.") +#@gui :_=link("Hedcut instructions and tutorial","https://gmic.eu/oldtutorial/hedcut-filter.shtml") +#@gui _Testing +#@gui Gmic Tutorials +#@gui Rectangular Tiling:_rec_tileit,gtutor_rectangular_tiling_preview +#@gui :_=note("Generate a mosaic from an image. Works best with line art cartoons with flat color.") +#@gui :_=separator() +#@gui :Tile Size=float(1.0,0.05,5.0) +#@gui :Disrupt Orientation=float(5.0,0.0,10.0) +#@gui :Spread Tiles Apart=float(1.5,0.25,5.0) +#@gui :Fill Holes=bool(1) +#@gui :Color Count=int(4,2,32) +#@gui :Flat Color=bool(0) +#@gui :Light Angle=float(45.0,-180,180) +#@gui :Soften Lighting=float(0.5,0.0,5.0) +#@gui :_=note(Author: Garry R. Osgood. Latest Update: 2021/29/05) +#@gui :_=link("Technical Notes",https://gmic.eu/tutorial/tiled_art.html) +#@gui _Iain Fergusson +#@gui 2D Scopes:iain_2d_scopes,iain_2d_scopes(1) +#@gui :Y Axis=choice(1,"Yuv","YUv","YuV","Hsv","HSv","HsV","Lab","LAb","LaB","LCh","LcH","Cmyk","CMyk","CmYk","CmyK","Rgb","RGb","RgB") +#@gui :X Axis=choice(2,"Yuv","YUv","YuV","Hsv","HSv","HsV","Lab","LAb","LaB","LCh","LcH","Cmyk","CMyk","CmYk","CmyK","Rgb","RGb","RgB") +#@gui :Type=choice(2,"Dots","Circles","Circles Scaled by Luma","Heat Map") +#@gui :Colour Bits=int(6,1,8) +#@gui :Plot Size=int(512,64,1024) +#@gui :Max Samples=int(2048,16,4096) +#@gui :Chart Elements=choice(1,"No Info","Axes","Underlay") +#@gui :Generate Test Colours=bool(0) +#@gui :Mirror Y Axis=bool(0) +#@gui :Mirror X Axis=bool(0) +#@gui :Rotate=choice(0,"0","90","180","270") +#@gui Anisotropic Tutorial:iain_smooth_tutorial,iain_smooth_tutorial(0) +#@gui :Amplitude=float(1000,0,2000) +#@gui :_=separator() +#@gui :_=note("Edge Sensitivity") +#@gui :Sharpness=float(0.5,0,2) +#@gui :_=separator() +#@gui :_=note("Directionality") +#@gui :Anisotropy=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Swirl") +#@gui :Gradient Smoothness=float(0.6,0,20) +#@gui :_=separator() +#@gui :_=note("Align") +#@gui :Tensor Smoothness=float(1.1,0,20) +#@gui :_=separator() +#@gui :Show Tensor Field=choice(0,"Hidden","Overlay","Exclusive") +#@gui :Show Gradient Blur=bool(0) +#@gui Auto WB by Hue Variance:iain_auto_wb,iain_auto_wb_preview(1) +#@gui :_=note("Restrict analysis to this box") +#@gui :Corner 1=point(5,5,0,1,255,255,255,128,10) +#@gui :Corner 2=point(95,95,0,1,255,255,255,128,10) +#@gui :_=separator() +#@gui :Normalise=bool(1) +#@gui :Negative=bool(0) +#@gui :_=separator() +#@gui :_=note("This filter finds the white balance of the image by maxiumising the variation of hues. The area for analysis should contain a range of hues. Do not try to select a neutral grey area.") +#@gui Automixer:automixer,automixer(0) +#@gui :Output Colour Difference=bool(0) +#@gui :Use Partial Image for Noise Calculation=bool(0) +#@gui :_=separator() +#@gui :_=note{"This filter creates a black and white mage with the most pleasant noise characteristics (IMHO). It measures the noise in each colour channel and scales each channel so that the noise levels are even and produces a greyscale output and optionally an extra image with the colour information."} +#@gui :_=note("Author : Iain Fergusson. Latest update : 2012/10/26") +#@gui Brown Spot Clean:iain_brown_spot_clean,iain_brown_spot_clean(0) +#@gui :Red/Green Radius=int(1,1,7) +#@gui :Blue Radius=int(2,1,7) +#@gui CA Correction:iain_CA_correction,iain_CA_correction_pr(0) +#@gui :Blue Adjustment=float(0,-5,5) +#@gui :Red Adjustment=float(0,-5,5) +#@gui :Interpolation Quality=choice(2,"Low","Med","High") +#@gui :_=separator() +#@gui :Preview Shows=choice("Output","Colours Only") +#@gui :Preview Corner=choice(3,"North-West","Northeast","Southeast","South-West") +#@gui :_=note("The preview is only accurate for the corners. Make sure you navigate to the same corner as selected above. ") +#@gui Detect Moire:iain_detect_moire,iain_detect_moire_preview(0) +#@gui :Threshold=float(50,0,100) +#@gui :Mask Size=float(5,0,100) +#@gui :Expand/Contract=int(9,-50,50) +#@gui :_=separator() +#@gui :Preview Saturation=float(30,0,100) +#@gui :_=separator() +#@gui :_=note("Detect Moire on bayer patterns. Requires RGB bayer image as input. Output is a black and white mask.") +#@gui :_=note("Preview shows mask boundary on top of a fast demosaic that will show more moire than a good demosaicing algorithm.") +#@gui __Details +#@gui Easy Skin Retouch:iain_easy_skin_retouch,iain_easy_skin_retouch_preview(0) +#@gui :_=note("Base Smoothing") +#@gui :Edge Sensitivity=float(7,0,25) +#@gui :Iterations=int(2,1,5) +#@gui :Low Bias=float(.7,0,1) +#@gui :_=separator() +#@gui :_=note("Detail Intensity") +#@gui :_=note("If preview appears dark, increase size of preview window.") +#@gui :On=bool(1) +#@gui :Very Fine=float(1,0,2) +#@gui :Fine 2=float(.7,0,2) +#@gui :Medium 3=float(.6,0,2) +#@gui :Course 4=float(.5,0,2) +#@gui :Very Course 5=float(.5,0,2) +#@gui :Reduce Redness=float(.5,0,1) +#@gui :_=separator() +#@gui :Split Base and Detail Output=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: Iain Fergusson - update 12 May 2013 - now handles alpha channel and some internal changes") +#@gui _Testing +#@gui Iain Fergusson +#@gui Exfuse:exfuse,exfuse +#@gui :Exposure=float(1,0,2) +#@gui :Contrast Bias=float(0.6,0,1) +#@gui :Saturation Bias=float(0,0,1) +#@gui :Exposure Sigma=float(0.5,0,1) +#@gui :Exposure Bias=float(1,0,1) +#@gui :Blur=float(5,0,50) +#@gui Exfusion:exfusion,exfusion +#@gui :Width=float(20,0,50) +#@gui Exfusion3:exfusion3,exfusion3 +#@gui :Contrast Bias=float(0.3,0,1) +#@gui :Saturation Bias=float(0.3,0,1) +#@gui :Exposure Sigma=float(0.2,0,1) +#@gui :Exposure Bias=float(0.3,0,1) +#@gui :_=separator() +#@gui :Maxlevels Adjust=int(-1,-5,0) +#@gui :Base Level Median Stack=bool(0) +#@gui :_=separator() +#@gui :_=note("Pyramid levels are calculated automatically, but you can reduce the number of pyramid levels to save memory. You can choose how the base level is fused, by using weight maps like normal, or by using a median of the image stack") +#@gui Exfusion5:exfusion5,exfusion5 +#@gui :Contrast Bias=float(0,0,1) +#@gui :Saturation Bias=float(.2,0,1) +#@gui :Exposure Sigma=float(0.2,0,1) +#@gui :Exposure Bias=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Post Fusion Options") +#@gui :Local Contrast=float(0,0,3) +#@gui :Curve=float(0,-127,127) +#@gui Fast Formula:iain_fast_formula,iain_fast_formula +#@gui :Apply Formula=text("apply_gamma 2.2") +#@gui Fast Median Stack:iain_fast_median_stack,iain_fast_median_stack +#@gui :_=note("This filter gives the median value of the input images at each pixel location and therefore a single input image will have no change. Two input images will be averaged.") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. Update 16 December 2014 - filter now accepts any number of images. ") +#@gui :_=note("Author : Iain Fergusson. Update 8 March 2013 - Combined median_3_stack and median_5_stack into this filter, added median_4_stack and added auto-select based on number of input images. ") +#@gui FFT Tile:fft_tile,fft_tile_preview(0) +#@gui :Threshold=float(500,0,50000) +#@gui :Tile Size=int(128,16,256) +#@gui :Fast=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. Latest update : 2012/08/08") +#@gui Fill Holes:fill_holes,fill_holes_preview(0) +#@gui :Morph Radius=int(11,3,50) +#@gui :Edge Radius=int(21,0,50) +#@gui :Close Radius=int(5,0,10) +#@gui :Channel(s)=choice(0,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :Fill Light Colours=bool(0) +#@gui :Fast=bool(1) +#@gui :_=separator() +#@gui :_=note("Set Morph radius to close holes, set Edge radius to restore edges, set Close radius to fill small holes near the edge") +#@gui :_=note("Author : Iain Fergusson. Latest update : 28 August 2012 - added 'fast' option") +#@gui Grey Descreen:iain_descreen2,iain_descreen2(0) +#@gui :Analysis Cindow=float(3,0,20) +#@gui :Strength=float(-10000,-10000,10000) +#@gui :Range=float(10,0,20) +#@gui __Patterns +#@gui Halftone Shapes:iain_halftone_shapes,iain_halftone_shapes(0) +#@gui :Scale=float(100,5,200) +#@gui :Negative=bool(0) +#@gui :Shape=choice("Circle","Star","Triangle","Heart") +#@gui :Oversample=bool(0) +#@gui :Rotate=float(0,0,180) +#@gui :Twirl=float(0,0,2) +#@gui :Turn on Rotate and Twirl=bool(0) +#@gui :_=separator() +#@gui :_=note("Oversample gives smoother results but takes much longer.") +#@gui :_=note("Twirl distorts the hafltone grid. The preview is not accurate. For best results use with oversample.") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson.") +#@gui _Testing +#@gui Iain Fergusson +#@gui Heart Tone:iain_hearttone,iain_hearttone(0) +#@gui :Scale=float(100,10,200) +#@gui :Enhance Details=float(0,0,10) +#@gui Iain 2x:iain_2x,iain_2x(0) +#@gui Iain Demosaic:iain_demosiac,iain_demosiac(0) +#@gui :Starting Pattern=choice(0,"Red-Green","Blue-Green","Green-Red","Green-Blue") +#@gui :_=separator() +#@gui :_=note("Author: Iain Fergusson - released 6 June 2013") +#@gui Iain Denoise 2019 Beta3:iain_denoise_2019_beta3,iain_denoise_2019_beta3_preview(0) +#@gui :Gamma=float(1,.05,2) +#@gui :Shadows=float(0,-1,1) +#@gui :Light=float(0,-1,1) +#@gui :Mid Offset=float(0,-0.5,0.5) +#@gui :Desaturate=float(0.5,0,1) +#@gui :Guide Mix=float(1,0,1) +#@gui :Soften Guide=bool(0) +#@gui :Fine=float(5,0,30) +#@gui :Mid=float(3,0,30) +#@gui :Large=float(0,0,30) +#@gui :Lookup=int(3,1,7) +#@gui :Recovery=choice(0,"No Recovery","Fast Recovery","Slow Recovery","Guide Recovery") +#@gui :Recover=float(.5,0,2) +#@gui :Preview Shows=choice(4,"Noise","Fine Noise","Mid Noise","Large Noise","Output") +#@gui :Preview Tones Map=bool(0) +#@gui Iain Remove Pattern:iain_remove_pattern,iain_remove_pattern_preview(0) +#@gui :_=note("Smooth") +#@gui :Pre-Blur=float(3,1,50) +#@gui :Smoothness=float(3,1,14) +#@gui :Radius=float(3,1,40) +#@gui :_=separator() +#@gui :_=note("Recover detials") +#@gui :Recover Details=bool(0) +#@gui :Recovery Amount=float(4,0,10) +#@gui :Tile Size=int(128,16,512) +#@gui :Quality=choice(1,"1","3","5","Super Slow") +#@gui :_=separator() +#@gui :Preview=choice(0,"Output","FFT of Input","FFT of Output","FFT Difference") +#@gui :_=separator() +#@gui :_=note("This filter remove patterns by eliminating peaks in frequency domain while protecting edges.") +#@gui :_=note("Stage 1 Pre-blur: Create a guide image that has the pattern blured out") +#@gui :_=note("Stage 2 Smooth: Use guide image to do edge-protected smoothing. Make sure pattern is removed before trying to recover detials.") +#@gui :_=note("Stage 3 Detials: Recover detials by keeping non-peaks the the frequency domain.") +#@gui Iain Star Burst:iain_star_burst,iain_star_burst(0) +#@gui :Threshold=int(254,0,255) +#@gui :Radius=float(50,1,255) +#@gui :Intensity=float(5,0,10) +#@gui :Rotate=int(45,0,90) +#@gui :Lines=int(2,1,10) +#@gui :Colour Modify=bool(0) +#@gui :Output Stars Only=bool(0) +#@gui Iain Unindex:iain_unindex,iain_unindex_preview(0) +#@gui :Smooth=float(30,0,100) +#@gui :Edge Threshold=float(20,0,50) +#@gui :Preview Zoom=bool(1) +#@gui :Zoom Center H=float(50,0,100) +#@gui :Zoom Center V=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Author: Iain Fergusson - released 19 Feb 2013") +#@gui Iain Weightmap:iain_weightmap,iain_weightmap +#@gui :Lap Weight=float(1,0,4) +#@gui :Blur Width=float(40,0,100) +#@gui Iain's Noise Reduction Old:iain_iains_nr,iain_iains_nr_preview(0) +#@gui :1 Luma NR=float(3,0,20) +#@gui :2 Chroma NR=float(3,0,20) +#@gui :3 Despeckle=int(1,0,4) +#@gui :_=note(" Adjust noise reduction by tone") +#@gui :4 Highlights=float(0,-50000,50000) +#@gui :5 Shadows=float(0,-32000,32000) +#@gui :_=separator() +#@gui :_=note("Recover Details") +#@gui :6 Recover Details=choice(0,"Do Not Recover Details","Recover Details","Recover Details as Separate Layer") +#@gui :7 Recovery Amount=float(1,.1,10) +#@gui :_=note(" Adjust detial recovery by size") +#@gui :8 Adjust Fine Details=float(0,-500,500) +#@gui :9 Adjust Medium Details=float(0,-500,500) +#@gui :10 Adjust Large Details=float(0,-500,500) +#@gui :11 Detail Emphasis=float(1.35,1,4) +#@gui :_=separator() +#@gui :12 Sharpen Edges=float(0,0,4) +#@gui :_=note("Preview options") +#@gui :13 Preview Shows=choice(0,"Normal Output","Luma Noise","Chroma Noise","Details") +#@gui :_=separator() +#@gui :_=note("Author: Iain Fergusson - update 10 Jan 2013") +#@gui Iain Highlight Synthesis:iain_highlight_synthesis,iain_highlight_synthesis(0) +#@gui :Red=float(1,0,2) +#@gui :Green=float(0.6,0,2) +#@gui :Blue=float(1,0,2) +#@gui :Rgb to Srgb=bool(0) +#@gui IID Demosaic:iain_iid_demosaic,iain_iid_demosaic(0) +#@gui :1 Starting Pattern=choice(1,"Red-Green","Blue-Green","Green-Red","Green-Blue") +#@gui :2 Clamp Radius=int(1,1,3) +#@gui :3 Refinement Steps=int(1,0,10) +#@gui :4 Reduce Moire=bool(0) +#@gui :_=separator() +#@gui :5 Use Gamma Adjustment=bool(0) +#@gui :_=separator() +#@gui :_=note("IID is a demosaicing algorithm that produces good colour detail and works well in the presence of chromatic aberrations. It attempts to reduce moire patterns. Noise tends to render as a maze like texture.") +#@gui :_=separator() +#@gui :_=note("Clamp Radius: Interploated green pixels are clamped to local values. A clamp radius of 1 reduces ringing and overshoots but may limit some detials. A clamp radius of 3 will give more detials but also more ringing and overshoots. Not much difference can been seen unless you zoom in.") +#@gui :_=note("Refinement Steps: Uses the initital demosaic as a guide for a new partial demosaic, and can be repeated. Each step gives better luma details and noise rendering but degrades chroma edges. Use a low value of clamp radius to reduce arefacts but also the effectiveness. Two or three refinements steps is probably the sweet spot.") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. 25 March 2017 - First release") +#@gui Luminance NR2:luminance_nr_two,luminance_nr_two(0) +#@gui :Patch Variance=float(10,0.1,20) +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(1,1,5) +#@gui :_=separator() +#@gui :_=note("Adjust NR for for larger scales as %") +#@gui :Scale 2=float(.8,0,1) +#@gui :Scale 3=float(.7,0,1) +#@gui :Scale 4=float(.6,0,1) +#@gui :Scale 5=float(.5,0,1) +#@gui :Scale 6=float(.4,0,1) +#@gui :Scale 7=float(.3,0,1) +#@gui :_=separator() +#@gui :_=note("Master threshold for details") +#@gui :Threshold=float(1200,0,10000) +#@gui :Tile Size=int(64,32,128) +#@gui :Nothing=float(0,0,0) +#@gui :_=separator() +#@gui :_=note("Adjust threshold for detials") +#@gui :Fine=float(0,-1000,1000) +#@gui :Medium=float(0,-1000,1000) +#@gui :Course=float(0,-1000,1000) +#@gui :Recover Details=bool(0) +#@gui :_=separator() +#@gui :_=note("Adjust noise reduction by tone") +#@gui :Blacks=int(0,0,500) +#@gui :Darks=int(0,0,500) +#@gui :Midtones=int(0,0,500) +#@gui :Lights=int(0,0,500) +#@gui :White=int(0,0,500) +#@gui :_=separator() +#@gui :Median Pass First=bool(0) +#@gui :_=note("This filter is slow!") +#@gui :_=note("Author : Iain Fergusson. Latest update : 25 August 2012") +#@gui Minimum Chroma Demosaic:iain_minimum_chroma_demosaic,iain_minimum_chroma_demosaic(0) +#@gui :Starting Pattern=choice(0,"Red-Green","Blue-Green","Green-Red","Green-Blue") +#@gui :Moire Size=choice(2,"Small","Medium","Large","Extra Large") +#@gui :Details=choice(0,"Less Detial but Better Colour Edges","More Detial but Degraded Colour Edges") +#@gui __Repair +#@gui Moire Removal:iain_moire_removal,iain_moire_removal(0) +#@gui :Smoothing=float(5,0,20) +#@gui :Smart Threshold=float(5,0,10) +#@gui :Moire Removal Method=choice(0,"Smart","Aggresive","Smooth Only") +#@gui :_=separator() +#@gui :_=note("Moire removal consists of two parts, first, an edge-protected smoothing and second a frequency analyisis of the difference between the smoothed and original image. The image is broken into tiles, and each tile processed. A tile that is a solid colour is skipped.") +#@gui :_=note("Smoothing must be high enough to remove the moire. The Smart Threshold sets the detection of moire for each frequency on each colour channel. If a frequency in one colour channel is determined to be moire it is replaced by the colour channel least likely to have moire.") +#@gui :_=note("The Agressive setting skips the thresolding step and uses the lowest frequency level from the colour channels.") +#@gui :_=note("The filter will reduce chroma details/noise") +#@gui _Testing +#@gui Iain Fergusson +#@gui Moire Removal Not Parallel:iain_moire_removal_NP,iain_moire_removal_NP(0) +#@gui :Smoothing=float(5,0,20) +#@gui :Smart Threshold=float(5,0,10) +#@gui :Moire Removal Method=choice(0,"Smart","Aggresive","Smooth Only") +#@gui :_=separator() +#@gui :_=note("This filter is the same as the other one but doe snot have parallel processing") +#@gui :_=separator() +#@gui :_=note("Moire removal consists of two parts, first, an edge-protected smoothing and second a frequency analyisis of the difference between the smoothed and original image. The image is broken into tiles, and each tile processed. A tile that is a solid colour is skipped.") +#@gui :_=note("Smoothing must be high enough to remove the moire. The Smart Threshold sets the detection of moire for each frequency on each colour channel. If a frequency in one colour channel is determined to be moire it is replaced by the colour channel least likely to have moire.") +#@gui :_=note("The Agressive setting skips the thresolding step and uses the lowest frequency level from the colour channels.") +#@gui :_=note("The filter will reduce chroma details/noise") +#@gui MS NL-Means C Noise2:ms_nlmeans_c_noise2_p,ms_nlmeans_c_noise2_p_preview(0) +#@gui :_=note("Noise Reduction") +#@gui :1 Fine=float(3,0,10) +#@gui :2 Coarse=float(1,0,10) +#@gui :3 Blacks=float(0,-10,10) +#@gui :4 Shadows=float(0,-10,10) +#@gui :5 Midtones=float(0,-10,10) +#@gui :6 Highlights=float(0,-10,10) +#@gui :7 Whites=float(0,-10,10) +#@gui :8 Smooth Curve=float(10,0,50) +#@gui :_=separator() +#@gui :_=note("Advanced settings") +#@gui :9 Patch Size=float(2,1,10) +#@gui :10 Search Radius=int(4,1,10) +#@gui :11 Patch Size=float(2,1,10) +#@gui :12 Search Radius=int(7,1,10) +#@gui :_=separator() +#@gui :_=note("Side chain Processing") +#@gui :13 Red/Blue Median=bool(0) +#@gui :14 Green Despeckle=bool(0) +#@gui :_=separator() +#@gui :15 Use Noise Estimate=bool(0) +#@gui :_=separator() +#@gui :16 Show Info=bool(0) +#@gui MS Patch Chroma:ms_patch_c,ms_patch_c_preview(0) +#@gui :_=note{"Master Patch based smoothing (scale 1)"} +#@gui :Patch Variance=float(5,0.1,50) +#@gui :Median Pass=bool(1) +#@gui :Global Iterations=int(1,1,5) +#@gui :_=separator() +#@gui :Scale 2=float(5,0,25) +#@gui :Scale 3=float(4,0,25) +#@gui :Scale 4=float(3,0,25) +#@gui :Scale 5=float(2,0,25) +#@gui :Scale 6=float(1,0,25) +#@gui :Scale 7=float(1,0,25) +#@gui :Undo Gamma=float(1.3,1,3) +#@gui :_=separator() +#@gui :_=note("Customise Luma weighting") +#@gui :Red=float(0.375,0,1) +#@gui :Green=float(.5,0,1) +#@gui :Blue=float(0.125,0,1) +#@gui :_=separator() +#@gui :Show Difference=bool(0) +#@gui :_=note("Author : Iain Fergusson. Latest update : 10 December 2012 - added show difference option and changed interations from local operation to global operation.") +#@gui MS Patch NR:MS_Patch_NR,MS_Patch_NR(0) +#@gui :Gamma=float(1.3,.5,2) +#@gui :Fine=float(0,0,250) +#@gui :Coarse=float(0,0,250) +#@gui :Coarsest=float(0,0,250) +#@gui :Patch Size=int(3,3,7) +#@gui :Search Radius=int(5,3,17) +#@gui MS Patch NR3:MS_Patch_NR3,MS_Patch_NR3_p(0) +#@gui :Gamma=float(1.3,.5,2) +#@gui :L Fine=int(0,0,250) +#@gui :L Coarse=int(0,0,250) +#@gui :L Coarsest=int(0,0,250) +#@gui :Patch Size=int(3,3,7) +#@gui :Search Radius=int(5,3,17) +#@gui :Fast=choice(1,"Smooth","Fast") +#@gui :Pre-Salt and Pepper=choice(0,"None","Smooth","Fast","Strong") +#@gui :Post-Salt and Pepper=choice(0,"None","Smooth","Fast","Strong") +#@gui :C Fine=int(0,0,250) +#@gui :C Coarse=int(0,0,250) +#@gui :C Coarsest=int(0,0,250) +#@gui Multi Scale Patch Smoothing:ms_patch_smooth,ms_patch_smooth_preview(0) +#@gui :_=note{"Normal Patch based smoothing (scale 1)"} +#@gui :Spatial Variance=float(10,0,20) +#@gui :Patch Variance=float(5,0.1,50) +#@gui :Patch Size=int(3,2,21) +#@gui :Lookup Size=int(5,2,21) +#@gui :Patch Smoothness=float(0,0,4) +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(1,1,5) +#@gui :Channel(s)=choice(7,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :_=separator() +#@gui :_=note("Patch Variance for additional scales") +#@gui :Scale 2=float(5,0,25) +#@gui :Scale 3=float(4,0,25) +#@gui :Scale 4=float(3,0,25) +#@gui :Scale 5=float(2,0,25) +#@gui :Scale 6=float(1,0,25) +#@gui :Scale 7=float(1,0,25) +#@gui :Undo Gamma=float(1.3,1,3) +#@gui :_=separator() +#@gui :Show Difference=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. Latest update : 28 August 2012 - minor speed up, but level 7 does not do anything now.") +#@gui Multi Scale Smoothing:ms_smooth,ms_smooth_preview(0) +#@gui :Smooth Scale 1=float(0,0,100) +#@gui :Smooth Scale 2=float(0,0,100) +#@gui :Smooth Scale 3=float(0,0,100) +#@gui :Smooth Scale 4=float(0,0,100) +#@gui :Smooth Scale 5=float(0,0,100) +#@gui :Smooth Scale 6=float(0,0,100) +#@gui :Smoothness=float(2,0,15) +#@gui :Log Scales=bool(0) +#@gui :Global Repeats=int(2,0,5) +#@gui :Show Difference=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: Iain Fergusson - update 7 Dec 2012") +#@gui Noise Reduction 5:nr5,nr5_preview(0) +#@gui :1 Luma Denoise=float(1.6,0,10) +#@gui :2 Colour Denoie=float(5,0,20) +#@gui :_=separator() +#@gui :3 Recover Details=bool(1) +#@gui :4 Amount=float(1,0.1,10) +#@gui :_=separator() +#@gui :_=note(" sharpen details") +#@gui :5 Radius=float(.75,.25,5) +#@gui :6 Amount=float(3,0,10) +#@gui :7 Threshold=float(0,0,100) +#@gui :_=separator() +#@gui :_=note(" sharpen edges") +#@gui :8 Radius=float(.75,.25,5) +#@gui :9 Amount=float(.5,0,10) +#@gui :10 Threshold=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("Advanced options") +#@gui :11 Base Luma Method=choice(1,"Wavelet","Multi-Scale Patch Smoothing","Semi-Auto MS Patch","Median First MS Patch","Multi Scale Median") +#@gui :12 Chroma Method=choice(1,"Wavelet","Multi-Scale Patch Smoothing") +#@gui :_=separator() +#@gui :13 Adjust Fine Details=float(100,-5000,500) +#@gui :14 Adjust Medium Details=float(0,-5000,500) +#@gui :15 Adjust Large Details=float(-100,-5000,500) +#@gui :_=separator() +#@gui :Experimental Curves=bool(0) +#@gui :Gamma=float(1.3,.3,2) +#@gui :Show Noise=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. Latest update : 28 November 2012 - added abiltity to view noise") +#@gui PNG Processing:iain_png_processing,iain_png_processing(0) +#@gui :Number of Colours=int(4,2,256) +#@gui :Refine Palette=bool(0) +#@gui :Dither Pattern=choice(0,"Lines","Checkerboard","Diffusion","None") +#@gui :_=separator() +#@gui :Pre Smooth=bool(0) +#@gui :Smooth Radius=float(3,0,20) +#@gui :Smooth Amount=float(3,0,20) +#@gui :_=separator() +#@gui :Pre-Sharpen (Constrained)=bool(0) +#@gui :Sharpen Radius=float(.75,0,10) +#@gui :Amount=float(2,0,10) +#@gui :Threshold=float(1,0,50) +#@gui :Constraint Radius=int(5,0,10) +#@gui :Overshoot=float(0,0,50) +#@gui :_=separator() +#@gui :Post Median=bool(0) +#@gui :Median Radius=int(1,1,10) +#@gui :Median Repeats=int(1,1,5) +#@gui :_=separator() +#@gui :_=note("This filter provides tools to improve the compressabilty or visual quality when creating an indexed image.) +#@gui :_=note("Author : Iain Fergusson. release: 9 September 2018) +#@gui Save Noise Print:iain_savenoiseprint,iain_savenoiseprint_p(0) +#@gui :Pass=choice("Pass 1 Create Noise Print","Pass 2 Remove Noise") +#@gui :Detail Threshold=float(1,0,5) +#@gui :Gamma=float(1.4,1,4) +#@gui :_=note("This filter requires 2 images as input, the bottom image should be noisey and the top image should be the same image only with some kind of noise reduction.") +#@gui :_=note("You need to do 2 passes of this filter to get the results. The first pass analyses the residual noise and creates a noise print and saves it to your computer. On the 1st pass you can click apply and the noise print will be generated after a while. When that has finished switch to 2nd pass and adjust the Detail Threshold to your liking and hit okay or apply.") +#@gui :_=note(" Set output mode to 'New Layers'") +#@gui __Details +#@gui Simple Local Contrast:simplelocalcontrast_p,simplelocalcontrast_p(0) +#@gui :Edge Sensitivity=float(16,0,25) +#@gui :Iterations=int(2,1,5) +#@gui :Paint Effect=float(0,0,50) +#@gui :Channels=choice(1,"Colour","Luminance Only") +#@gui :Pre-Gamma=float(1,.1,5) +#@gui :Post-Gamma=float(1,.1,5) +#@gui :_=separator() +#@gui :_=note("Luminance Mask") +#@gui :Blacks=float(1,0,1) +#@gui :Dark Grey=float(1,0,1) +#@gui :Mid Grey=float(1,0,1) +#@gui :Light Grey=float(1,0,1) +#@gui :Whites=float(1,0,1) +#@gui :_=separator() +#@gui :Parallel Processing=choice(0,"Auto","None") +#@gui :_=separator() +#@gui :_=note("Author: Iain Fergusson - update 18 April 2014 - added parallel processing and luminance mask") +#@gui _Testing +#@gui Iain Fergusson +#@gui Skin Mask:iain_fx_skin_mask,iain_fx_skin_mask_pr +#@gui :_=note("Main Controls") +#@gui :Magenta Ratio=float(55,0,255) +#@gui :Cyan Ratio=float(200,2,255) +#@gui :_=separator() +#@gui :_=note("Refine Hue Range") +#@gui :Remove Reds=float(0,0,255) +#@gui :Remove Yellows=float(0,0,100) +#@gui :_=separator() +#@gui :Output=choice("Masked Image","Just the Mask") +#@gui :Preview Shows=choice(1,"Output","Highlighted Mask") +#@gui :_=separator() +#@gui :_=note("Skin mask uses CMYK colour model to selct skin tones. Skin tones generally have a predictable ratios of Cyan, Magetna and Yellow. Different ethnicies have slighty different ratios. ") +#@gui :_=note("Magenta Ratio: This sets how much the Magenta content is allowed to be below the Yellow content. Increase to include dark skin tones and shadows.") +#@gui :_=note("Cyan Ratio: This set the how much the Cyan content is allowed to be below the Yellow content. Increase to include pale skin tones and highlights.") +#@gui :_=note("Refine Hue Range: This allows you to remove tones that pass through the main controls but are not present in your subject.") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson.") +#@gui Smart Demosaic:iain_smartdemos,iain_smartdemos(0) +#@gui :Starting Pattern=choice(0,"Red-Green","Blue-Green","Green-Red","Green-Blue") +#@gui :Blur Radius=float(1.5,.5,3) +#@gui :Wrong Way-Zippers=float(2,0,5) +#@gui Split Detials [Orientation]:iain_split_orientation,iain_split_orientation_preview(0) +#@gui :Center (%)=point(75,50,0,1) +#@gui :Angle Range=int(45,1,90) +#@gui :Residual Size=float(10,0,50) +#@gui :Snap to Angle=int(5,0,45) +#@gui :Angle Transition=int(5,0,45) +#@gui :Preview Line Only=bool(0) +#@gui :Top Layer=choice(0,"Isolate Orientation","Remove Orientation") +#@gui :Output=choice(1,"Isolated/Removed Only","Isolated/Removed & Residual","Residual Only") +#@gui Star Tone:star_tone,star_tone(0) +#@gui :Scale=float(100,10,200) +#@gui Subtract Cast:iain_sub_cast,iain_sub_cast(0) +#@gui :Noise Reduction=float(5,0,10) +#@gui :Black Level=float(20,0,128) +#@gui :White Level=float(250,128,255) +#@gui __Patterns +#@gui Turbulent Halftone:iain_turbulent_halftone,iain_turbulent_halftone_preview(0) +#@gui :Amplitude=float(15,0,30) +#@gui :Smoothness=float(20,0,40) +#@gui :Orientation=float(0,0,180) +#@gui :Deviation=float(1,0,1) +#@gui :Tile Size=int(512,128,2048) +#@gui :Blob Size=float(0.75,0,4) +#@gui :Colour Model=choice("RGB","CMYK","Luminance") +#@gui :Enhance Detail=float(0,0,10) +#@gui :Oversample=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: Iain Fergusson. Latest update: 2019/09/20 - Improved quality and added oversample.") +#@gui :_=note("Older updates: 2018/08/24.") +#@gui _Testing +#@gui JéJé +#@gui 3D Rendering:jeje_render3d,jeje_render3d_preview +#@gui :Input Image=file() +#@gui :Size=int(8,4,16) +#@gui :Quality=int(6,2,16) +#@gui :Opacity=float(0.1,0,1) +#@gui :Angle X=float(240,0,360) +#@gui :Angle Y=float(0,0,360) +#@gui :Angle Z=float(30,0,360) +#@gui :Zoom=float(1,0,3) +#@gui :Top Color=color(#202040ff) +#@gui :Bottom Color=color(#408060ff) +#@gui :Render=bool(false) +#@gui :_=separator() +#@gui :_=note(Note:Adjust the 3D view first and then enable render to compute the volume rendering.) +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/05/29.") +#@gui Deconvolve:jeje_deconvolve,jeje_deconvolve_preview +#@gui :Iterations=int(20,1,100) +#@gui :Algorithm=choice(0,"Richardson-Lucy","Gold-Meinel") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note{"Need two layers (top layer is the blur)
Author : Jérôme Boulanger. Latest update: 2016/22/02."} +#@gui Zernike:jeje_zernike_preview +#@gui :X=float(50,0,100) +#@gui :Y=float(50,0,100) +#@gui :R=float(50,0,100) +#@gui :Piston=float(0,-1,1) +#@gui :Horizontal Tilt=float(0,-1,1) +#@gui :Vertical Tilt=float(0,-1,1) +#@gui :Oblique Astigmatism=float(0,-1,1) +#@gui :Defocus=float(0,-1,1) +#@gui :Vertical Astigmatism=float(0,-1,1) +#@gui :Vertical Trefoil=float(0,-1,1) +#@gui :Vertical Coma=float(0,-1,1) +#@gui :Horizontal Coma=float(0,-1,1) +#@gui :Oblique Trefoil=float(0,-1,1) +#@gui :Oblique Quadrafoil=float(0,-1,1) +#@gui :Oblique Secondary Astigmatism=float(0,-1,1) +#@gui :Primary Spherical=float(0,-1,1) +#@gui :Vertical Secondary Astigmatism=float(0,-1,1) +#@gui :Vertical Quadrafoil=float(0,-1,1) +#@gui :Binarize=bool(false) +#@gui :Period=float(0,0,256) +#@gui :Cycle Ratio=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("https://en.wikipedia.org/wiki/Zernike_polynomials
Author : Jérôme Boulanger. Latest update: 2018/03/12.") +#@gui _Jayprich +#@gui About:_none_,jpr_about +#@gui :_=note("@jayprich filters for G'MIC\nare proposed to you by James Prichard") +#@gui :_=note("source code http://www.h-ps.demon.co.uk/GMIC/jayprich.gmic") +#@gui Jpr Colour Illusion:jpr_colourillusion,jpr_colourillusion(1) +#@gui :_=note("recreated from a Java example http://fiji.sc/wiki/ see Spirals Macro") +#@gui :Arms=int(2,2,10) +#@gui :Scale=float(25,10,50) +#@gui :_=note("update 2013-Feb-06 author @jayprich") +#@gui Jpr Coltexindex:jpr_coltexindex,jpr_coltexindex(1) +#@gui :_=note("Index the image using its colour channels plus the local analysis of its luminance channel.") +#@gui :_=note("Inspired by questions on masking for similar textures and how to make poster art from a photo.") +#@gui :_=note("Watch out for JPEG block-artifacts in colour channels") +#@gui :Number of Types=int(5,3,20) +#@gui :X1=float(55,0,100) +#@gui :Y1=float(55,0,100) +#@gui :X2=float(45,0,100) +#@gui :Y2=float(45,0,100) +#@gui :Factor (X1,Y1) Vs (X2,Y2)=float(1,0,5) +#@gui :Display (X,Y)=bool(1) +#@gui :_=separator() +#@gui :_=note("Luminance Y") +#@gui :Smoothness=float(0,0,5) +#@gui :Black=float(0.05,0,1) +#@gui :Midtone=float(0.5,0,1) +#@gui :Highlight=float(0.95,0,1) +#@gui :_=separator() +#@gui :_=note("Colour & Texture") +#@gui :Colour Smoothing=float(0.5,0,5) +#@gui :_=separator() +#@gui :_=note("Locally Average Gradient Norm or Variance from Luminance") +#@gui :Use Gradient Norm=bool(1) +#@gui :Local Size=float(2,1,9) +#@gui :Weight=float(0.7,0.2,2) +#@gui :_=note("update 2013-Mar-17 author @jayprich") +#@gui Jpr Decimate:jpr_decimate,jpr_decimate(1) +#@gui :_=note("Rescale in linear RGB space by cropping the frequency domain weighted") +#@gui :_=note("to decrease high frequency akin to Lanczos window on Sinc lobes.") +#@gui :_=note("This filter may corrupt the alpha channel") +#@gui :_=note("High sharpness just crops frequency and gives bad halo") +#@gui :Downsample Scale=float(0.375,0.1,1) +#@gui :Sharpness Factor=float(2,1.5,4) +#@gui :_=note("update 2013-Jun-24 author @jayprich") +#@gui Jpr Gradient Smooth:jpr_gradient_smooth,jpr_gradient_smooth(1) +#@gui :_=note("image and its gradient in x y are treated as solid angles and smoothed on the topology of the surface of a sphere\nthis means a loop bright/dark/bright cannot contract through the centre of the sphere") +#@gui :Offset Brightness=float(0,-0.9,0.9) +#@gui :Smoothing Amount=float(1.5,0.8,2.5) +#@gui :_=note("update 2013-Feb-03 author @jayprich") +#@gui Jpr Line Edges:jpr_line_edges,jpr_line_edges(1) +#@gui :_=note("combines the results in several orientations, each one blurs one way and looks for points of max gradient at 90 degrees to the blur") +#@gui :_=note("works best on photographs not line-art") +#@gui :Angles per Quadrant=int(2,1,9) +#@gui :Blurring=int(2,2,24) +#@gui :Gradient Threshold=float(4,0,30) +#@gui :Anti Alias=bool(1) +#@gui :_=note("update 2013-Jan-22 author @jayprich") +#@gui Jpr Orientedthinning:jpr_orientedthinning,jpr_orientedthinning(1) +#@gui :_=note{"Skeleton of a shape against a zero-value (pure-black) background using locally oriented local maxima to find only relevant ridges - not micro ridges from a noisy boundary"} +#@gui :Pre Smooth Borders=float(5,0,10) +#@gui :Propagate Direction=float(15,3,50) +#@gui :Threshold Width=int(1,1,10) +#@gui :Preview Orientation=bool(0) +#@gui :Distance Metric=choice(Max |x| |y| Chebyshev,|x|+|y| Manhattan,|x Y| Euclidean) +#@gui :_=note("update 2013-Apr-14 author @jayprich") +#@gui Jpr Phasecongruence:jpr_phasecongruence,jpr_phasecongruence(1) +#@gui :_=note("Edge detect with directional Phase Congruence using proportionality to Local Energy.") +#@gui :Start Angle=float(45,0,360) +#@gui :Directions=int(1,1,20) +#@gui :Energy Threshold=float(50,0,500) +#@gui :Local Maxima=bool(1) +#@gui :_=note("update 2013-Mar-31 author @jayprich") +#@gui Jpr Remove Blocks1:jpr_remove_blocks1,jpr_remove_blocks1(0) +#@gui :_=separator() +#@gui :_=note("subtracts square edged blocks with limited-amplitude while masking less-smooth areas of an image\n\nthis can reduce low quality jpeg artifacts in very smooth parts of an image\n1. choose a block size in pixels to fit\n2. set smallest amplitude that catches block noise in smooth areas but masks real edges in the image\n3. fine tune the strength around 70, the amount of estimated block-noise to subtract") +#@gui :Spatial Block Size=float(4,2,25) +#@gui :Amplitude=float(3,1,64) +#@gui :Strength Fine-Tune=float(70,20,300) +#@gui :_=note("update 2012-Nov-30 author @jayprich") +#@gui Jpr Shapes Gradient:jpr_shapes_gradient,jpr_shapes_gradient(0) +#@gui :_=note("convert an image to local patches with some gradient patch shape is via watershed algorithm") +#@gui :Pre Blur=float(2,0,15) +#@gui :Watershed Threshold=float(0.25,0.01,10) +#@gui :Gradient Flatten=float(0.001,0.001,0.1) +#@gui :Gradient Cap=float(100,5,200) +#@gui :_=note("update 2017-Jun-10 author @jayprich") +#@gui Jpr Specularbumps:jpr_specularbumps,jpr_specularbumps(1) +#@gui :_=note("Add highlights using brightness gradient.") +#@gui :Gradient Illuminate Angle=float(270,0,360) +#@gui :Pre Smooth=float(1,0,5) +#@gui :Gradient Range=float(13,0,30) +#@gui :Illumination Adjust=float(0,-45,45) +#@gui :Illumination Offset=float(80,0,90) +#@gui :Highlight Size=float(0.1,0,0.25) +#@gui :Roughness=float(0.1,0.05,0.35) +#@gui :Output Type=choice("Black and White","White with Alpha","Compose to Image") +#@gui :_=note("update 2013-Mar-31 author @jayprich") +#@gui Jpr Warpfromthreshold:jpr_warpfromthreshold,jpr_warpfromthreshold(1) +#@gui :_=note("a dummy 100x100 grid is warped using smoothed orientation as a map") +#@gui :Brightness Threshold=float(170,10,245) +#@gui :Simplify Regions=float(2,0,6) +#@gui :Blur & Renormalise Loop=int(10,3,50) +#@gui :Blur Amount per Step=float(2,1,10) +#@gui :_=note("update 2013-Feb-03 author @jayprich") +#@gui _Joan Rake +#@gui Artistic +#@gui Charred Plastic:fx_charred_plastic,fx_charred_plastic_preview +#@gui :_=separator() +#@gui :_=note("Difference of Gaussians") +#@gui :1. Amplitude=float(1,-10,10) +#@gui :2. Gaussian 1=float(10,0,100) +#@gui :3. Gaussian 2=float(40,0,100) +#@gui :4. Mode=choice(1,"Pixels","Percent") +#@gui :_=separator() +#@gui :_=note("Noise") +#@gui :5. Amplitude=float(10,0,200) +#@gui :6. Noise Type=choice("Gaussian","Uniform","Salt and Pepper","Poisson","Rice") +#@gui :7. Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :_=separator() +#@gui :_=note("Local Normalization") +#@gui :8. Amplitude=float(2,0,60) +#@gui :9. Radius=int(6,1,64) +#@gui :10. Neighborhood Smoothness=float(5,0,40) +#@gui :11. Average Smoothness=float(20,0,40) +#@gui :12. Constrain Values=bool(0) +#@gui :13. Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui Dreamy Abstraction:fx_dreamy_abstraction,fx_dreamy_abstraction_preview +#@gui :_=note("A less-aggressive alternative to the Painting filter. Yes, 'Joan Rake' made a filter that isn't aggressive! What kind of digital paint has she been sniffing?") +#@gui :_=separator() +#@gui :_=note("Segmentation") +#@gui :1. Edge Threshold=float(2,0,30) +#@gui :2. Smoothness=float(1,0,10) +#@gui :3. Blend Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :4. Opacity=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Noise") +#@gui :5. Noise Amplitude=float(10,0,100) +#@gui :6. Noise Type=choice("Gaussian","Uniform","Salt and Pepper","Poisson","Rice","Spread") +#@gui :7. Noise Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :8. Blend Mode=choice(7,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :9. Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Blur & Constrained Sharpen") +#@gui :11. Blur Strength=float(3,0,20) +#@gui :12. Sharpen Radius Factor=float(1,0,5) +#@gui :13. Amount Factor=float(1,0,5) +#@gui :14. Threshold=float(1,0,5) +#@gui :15. Constraint Radius Factor=float(1,0,5) +#@gui :16. Overshoot Factor=float(1,0,20) +#@gui :17. Sharpen Channel(s)=choice(11,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :18. Value Action=choice(1,"None","Cut","Normalize") +#@gui :19. Antialias=float(25,0,100) +#@gui :_=separator() +#@gui :_=note("Glow") +#@gui :20. Size=float(5,0,50) +#@gui :21. Intensity=float(1,0,3) +#@gui :22. Darken=float(0,0,1) +#@gui :23. Saturation=float(1.5,0,4) +#@gui :_=separator() +#@gui :24-26. Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui Dreamy Watercolour:fx_dreamy_watercolour,fx_dreamy_watercolour(0) +#@gui :_=note("Creates abstract watercolour images.") +#@gui :_=separator() +#@gui :_=note("Gradient norm") +#@gui :1. Smoothness=float(0,0,10) +#@gui :2. Linearity=float(0.3,0,2) +#@gui :3. Min Threshold=float(40,0,100) +#@gui :4. Max Threshold=float(60,0,100) +#@gui :5. Negative=bool(0) +#@gui :6. Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Antialias") +#@gui :7. Amplitude=float(50,0,200) +#@gui :8. Edge Threshold (%)=float(0,0,100) +#@gui :9. Smoothness=float(10,0,20) +#@gui :_=separator() +#@gui :_=note("Dreamy abstraction") +#@gui :_=separator() +#@gui :_=note("Segmentation") +#@gui :10. Edge Threshold=float(2,0,30) +#@gui :11. Smoothness=float(1,0,10) +#@gui :12. Blend Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :13. Opacity=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Noise") +#@gui :14. Noise Amplitude=float(10,0,100) +#@gui :15. Noise Type=choice("Gaussian","Uniform","Salt and Pepper","Poisson","Rice","Spread") +#@gui :16. Noise Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :17. Blend Mode=choice(7,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :18. Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Blur & Constrained Sharpen") +#@gui :19. Blur Strength=float(3,0,20) +#@gui :20. Sharpen Radius Factor=float(1,0,5) +#@gui :21. Amount Factor=float(1,0,5) +#@gui :22. Threshold=float(1,0,5) +#@gui :23. Constraint Radius Factor=float(1,0,5) +#@gui :24. Overshoot Factor=float(1,0,20) +#@gui :25. Sharpen Channel(s)=choice(11,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :26. Value Action=choice(1,"None","Cut","Normalize") +#@gui :27. Antialias=float(25,0,100) +#@gui :_=separator() +#@gui :_=note("Deform colour layer") +#@gui :28. Amplitude=float(5,0,50) +#@gui :29. Interpolation=choice(1,"None","Linear","Bicubic") +#@gui :30. Matrix Density=float(10,1,100) +#@gui :31. Matrix Interpolation=choice(1,"Linear","Bicubic") +#@gui :32. Mode=choice("Noise","Spread Noise") +#@gui :33. Character=float(0,-100,100) +#@gui :34. Boundary=choice(1,"Dirichlet","Neumann","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Plasma") +#@gui :35. Alpha=float(0.5,0,5) +#@gui :36. Beta=float(0,0,100) +#@gui :37. Scale=float(8,1,20) +#@gui :38. Randomize=bool(1) +#@gui :39. Transparency=bool(0) +#@gui :40-42. Color Balance=color(#808080) +#@gui :43. Fix Edges=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Transfer colours") +#@gui :44. Enable=bool(1) +#@gui :45. Regularization=int(8,0,32) +#@gui :46. Preserve Luminance=float(0.2,0,1) +#@gui :47. Precision=_choice(1,"Low","Normal","High","Very High") +#@gui :48. Reference Colors=choice(1,"Plasma","Painting") +#@gui :49. Add User-Defined Constraints (Interactive)=_bool(0) +#@gui :50. Blend Mode=choice(27,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :51. Opacity=float(0.75,0,1) +#@gui :52. Reverse Order=bool(0) +#@gui :_=separator() +#@gui :_=note("Local normalisation") +#@gui :53. Amplitude=float(1,0,80) +#@gui :54. Radius=int(20,1,96) +#@gui :55. Neighborhood Smoothness=float(40,0,60) +#@gui :56. Average Smoothness=float(40,0,60) +#@gui :57. Constrain Values=bool(1) +#@gui :58. Channel(s)=choice(2,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :_=separator() +#@gui :_=note("Noise") +#@gui :59. Power=float(1.25,0,5) +#@gui :60. Noise Type=choice("Gaussian","Uniform","Salt and Pepper","Poisson","Rice") +#@gui :61. Channel(s)=choice(2,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :62. Value Action=choice(1,"None","Cut","Normalize") +#@gui :63. Blend Mode=choice(27,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :64. Opacity=float(1,0,1) +#@gui Hard Painting:fx_hard_painting,fx_hard_painting_preview(0)+ +#@gui :_=note("Modular filter which can be used to apply an extremely-glossy paint effect.") +#@gui :_=separator() +#@gui :_=note("Painting authors: Lyle Kroll, Angelo Lama and David Tschumperlé.\nLatest update: 2011/28/02.") +#@gui :1. Abstraction=int(1,0,20) +#@gui :2. Details Scale=float(2.5,0,100) +#@gui :3. Color=float(4,0,25) +#@gui :4. Smoothness=float(50,0,2000) +#@gui :5. Sharpen Shades=bool(1) +#@gui :_=separator() +#@gui :_=note("Graphic novel author: PhotoComiX. Latest update : 2011/13/11.") +#@gui :_=link("Filter explained here","http://www.gimpchat.com/viewtopic.php?f=9&t=1582") +#@gui :6. Graphic Novel Iterations=int(1,0,10) +#@gui :_=separator() +#@gui :_=note("Apply Local Normalization") +#@gui :7. Skip This Step=bool(false) +#@gui :_=separator() +#@gui :_=note("Local Normalization Controls") +#@gui :8. Ln Amplititude=float(2,0,60) +#@gui :9. Ln Size=float(6,0,64) +#@gui :10. Ln Neightborhood-Smoothness=float(5,0,40) +#@gui :11. Ln Average-Smoothness=float(20,0,40) +#@gui :_=separator() +#@gui :12. Skip All Other Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note(" Pencil Options") +#@gui :13. Pencil Size=float(0.62,0,4) +#@gui :14. Pencil Amplitude=float(14,0,200) +#@gui :_=separator() +#@gui :15. Skip All Other Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :16. Activate "Pencil Smoother"=bool(true) +#@gui :_=note(" If unchecked the 3 sliders below are disabled ") +#@gui :_=separator() +#@gui :17. Pencil Smoother Sharpness=float(0.5,0,2) +#@gui :18. Pencil Smoother Edge Protection=float(0.78,0,1) +#@gui :19. Pencil Smoother Smoothness=float(1.92,0,10) +#@gui :_=separator() +#@gui :20. Skip All Other Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Boost Merging Options") +#@gui :21. Swap Layers=bool(false) +#@gui :22. Mixer=choice("Overlay","Multiply","Soft Light","Color Burn","Darken","Stamp","Hard Light","Value","Grain Merge","Freeze","Lightness","Luminance","*Colors Doping","*Comix Colors*","Graphic Colours","*Graphix Colors","*Vivid Edges*","*Dark Edges*","*Dark Screen*","*Vivid Screen*","Interpolate") +#@gui :23. Opacity=float(1,0,1) +#@gui :24. Intensity=float(1,0,1) +#@gui :_=separator() +#@gui :25. Add Painter's Touch=bool(true) +#@gui :_=separator() +#@gui :26. Painter's Touch Sharpness=float(0.5,0,2) +#@gui :27. Painter's Edge Protection Flow=float(0.8,0,1) +#@gui :28. Painter's Smoothness=float(1.28,0,10) +#@gui :_=separator() +#@gui :29-31. Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui Neon:fx_neon,fx_neon_preview +#@gui :_=note("Turns bright image outlines into bright, neon-like lines.") +#@gui :_=separator() +#@gui :_=note("Lines") +#@gui :1. Norm Mode=choice("Gradient Norm","Hessian","Laplacian","Rotation-Invariant Gradient","Afre's Edge Algorithm") +#@gui :2. Thinning=int(1,1,10) +#@gui :3. Recovery=float(1,.5,4) +#@gui :4. Brightness=float(1,.5,4) +#@gui :5. Details=float(1,.5,4) +#@gui :6. Smoothness=float(0,0,10) +#@gui :7. Contrast=float(0.45,0,1.5) +#@gui :8. Min Threshold=float(40,0,100) +#@gui :9. Max Threshold=float(60,0,100) +#@gui :10. Negative=bool(0) +#@gui :11. Opacity Over Original=float(1,0,1) +#@gui :12. Saturation=float(1.15,0,4) +#@gui :13. Blur Colours=float(2,0,20) +#@gui :_=separator() +#@gui :_=note("Antialias") +#@gui :14. Amplitude=float(3,0,100) +#@gui :15. Edge Threshold (%)=float(0,0,100) +#@gui :16. Smoothness=float(3,0,5) +#@gui :_=separator() +#@gui :_=note("Colour Glow 1") +#@gui :17. Size=float(20,0,100) +#@gui :18. Intensity=float(0.4,0,3) +#@gui :19. Darken=float(0.1,0,1) +#@gui :20. Saturation=float(1.5,0,4) +#@gui :_=separator() +#@gui :_=note("Colour Glow 2") +#@gui :21. Size=float(5,0,100) +#@gui :22. Intensity=float(0.2,0,3) +#@gui :23. Darken=float(0.1,0,1) +#@gui :24. Saturation=float(1,0,4) +#@gui :_=separator() +#@gui :_=note("Boost Glow") +#@gui :25. Size=float(2,0,5) +#@gui :26. Intensity=float(1,0,3) +#@gui :_=separator() +#@gui :27. Smooth Hues=float(0,0,20) +#@gui :_=separator() +#@gui :28. Alpha=bool(0) +#@gui :29. Alpha Power=float(1,0,5) +#@gui :30. Alpha Multiplier=float(1,0,5) +#@gui :_=separator() +#@gui :31. Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :32-33. Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui Neon Alpha:fx_neon_alpha,fx_neon_alpha_preview(0) +#@gui :_=note("An attempt to make the Neon filter work with alpha channels. Low-quality, comes with some artefacts.") +#@gui :_=separator() +#@gui :_=note("Gradient norm") +#@gui :1. Smoothness=float(0,0,10) +#@gui :2. Linearity=float(0.45,0,1.5) +#@gui :3. Min Threshold=float(40,0,100) +#@gui :4. Max Threshold=float(60,0,100) +#@gui :5. Negative=bool(0) +#@gui :6. Blur Original=float(2,0,20) +#@gui :7. Saturation=float(1.15,0,4) +#@gui :_=separator() +#@gui :_=note("Colour Glow 1") +#@gui :8. Size=float(20,0,100) +#@gui :9. Intensity=float(0.4,0,3) +#@gui :10. Darken=float(0.1,0,1) +#@gui :11. Saturation=float(2.25,0,4) +#@gui :_=separator() +#@gui :_=note("Colour Glow 2") +#@gui :12. Size=float(5,0,100) +#@gui :13. Intensity=float(0.2,0,3) +#@gui :14. Darken=float(0.1,0,1) +#@gui :15. Saturation=float(2.25,0,4) +#@gui :_=separator() +#@gui :_=note("Boost Glow") +#@gui :16. Size=float(2,0,5) +#@gui :17. Intensity=float(1,0,2) +#@gui Otsu-Hessian Blend:fx_otsu_hessian_blend,fx_otsu_hessian_blend_preview(1) +#@gui :_=note("Expansion of a one-line filter by Afre.") +#@gui :Otsu Levels=int(4,1,32) +#@gui :Norm 1=float(0,-5,5) +#@gui :Norm 2=float(1,-5,5) +#@gui :Merging Option=choice(27,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Opacity=float(1,0,1) +#@gui :Reverse Order=bool(0) +#@gui Whirling Lines:fx_whirling_lines,fx_whirling_lines_preview +#@gui :_=note("Creates fingerprint-like lines out of images by blurring and rounding their values. Works best with single-channel images.") +#@gui :1. Blur=float(30,0,100) +#@gui :2. Round=float(6,0,255) +#@gui :_=separator() +#@gui :_=note("Gradient norm") +#@gui :3. Norm Mode=choice("Gradient Norm","Hessian","Laplacian","Rotation-Invariant Gradient") +#@gui :4. Smoothness=float(0,0,10) +#@gui :5. Contrast=float(0.45,0,1.5) +#@gui :6. Min Threshold=float(40,0,100) +#@gui :7. Max Threshold=float(60,0,100) +#@gui :8. Dilate or Erode=int(0,-5,20) +#@gui :9. Negative=bool(0) +#@gui :_=separator() +#@gui :_=note("Antialias") +#@gui :10. Amplitude=float(30,0,100) +#@gui :11. Edge Threshold (%)=float(0,0,100) +#@gui :12. Smoothness=float(3,0,10) +#@gui :13. Value Action=choice(3,"None","Cut","Normalize","Cut Then Normalize") +#@gui _Colors +#@gui Colour Space Swap:csswap,csswap_preview +#@gui :To RGB From=choice("RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :From RGB To=choice("RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","Jzczhz","HCY") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui CubeHelix:fx_cubehelix,fx_cubehelix_preview(1) +#@gui :_=note("Implements and extends the CubeHelix family of colour schemes, allowing for interpolation between two colours as well as scaling the helix dimensions for each individual channel based on those colours.") +#@gui :Pre-Greyscale=choice(1,"Off","Luminance","SRGB Mean") +#@gui :Min Threshold=float(0,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Pre-Normalise=bool(0) +#@gui :Start Colour=color(#000000) +#@gui :End Colour=color(#ffffff) +#@gui :_=separator() +#@gui :Start Hue=float(1,0,3) +#@gui :Rotations=float(-1.5,-20,20) +#@gui :Rotation Bend=float(0,-3,3) +#@gui :_=separator() +#@gui :Saturation Bend=float(0,-3,3) +#@gui :Saturation Start=float(1,0,5) +#@gui :Saturation End=float(1,0,5) +#@gui :Gamma Bend=float(0,-3,3) +#@gui :Gamma Start=float(0,0,1) +#@gui :Gamma End=float(1,0,1) +#@gui :_=separator() +#@gui :Scale Colour Variations=float(1,-4,4) +#@gui :_=note("Scales the colour variations to reflect the difference between the start and end colours. For example, a value of 0 when going from black to yellow will flatten the helix so that only the red and green channels vary.") +#@gui :_=separator() +#@gui :Red Amplitude=float(1,0,4.00000) +#@gui :Red Phase Shift=float(0,0,360) +#@gui :Green Amplitude=float(1,0,4.00000) +#@gui :Green Phase Shift=float(0,0,360) +#@gui :Blue Amplitude=float(1,0,4.00000) +#@gui :Blue Phase Shift=float(0,0,360) +#@gui :_=separator() +#@gui :Preview Colour Scheme=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui Frequency Representation:fx_frequency_representation,fx_frequency_representation_preview(1) +#@gui :_=note("Changes values based on relative frequencies of those values in a histogram of image intensity.") +#@gui :Iterations=int(3,1,20) +#@gui :Clusters=int(256,2,1024) +#@gui :Split Channels=bool(0) +#@gui :Blur=float(40,0,100) +#@gui :Colour Space=choice("RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui Quick Desaturate:jr_desaturate,jr_desaturate_preview(1) +#@gui :_=note("Generates greyscale images, allowing for different (s/)RGB channel intensities before merging. A smaller counterpart to the 'Black & White' filter intended for generating intensity maps.") +#@gui :Colour Space=choice("RGB","SRGB") +#@gui :Channel 1=float(1,0,3) +#@gui :Channel 2=float(1,0,3) +#@gui :Channel 3=float(1,0,3) +#@gui :Normalize=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui Satellite:fx_satellite,fx_satellite_preview(1) +#@gui :_=note("Expresses luminance of images using image enhancement colour schemes which are used in NOAA satellite weather products.") +#@gui :_=separator() +#@gui :Colour Scheme=choice("Aviation","Dvorak","Funktop","JSL2","Shortwave IR2 (Standard and Tropical)","Shortwave IR2 (Fire)","Shortwave IR2 (Summer Fire)","Shortwave IR2 (Winter Fire)","Rainbow (Old)","Rainbow (New)","Water Vapour","Water Vapour (Blue)","IR Window (White-White)","IR Window (White-Brown)","IR Window (White-Black)","IR Window (Blue-White)","IR Window (Blue-Brown)","IR Window (Blue-Black)") +#@gui :Gamma Bend=float(0,-3,3) +#@gui :_=note("Cut range from original image") +#@gui :Cut Lower Threshold=float(0,0,100) +#@gui :Cut Higher Threshold=float(100,0,100) +#@gui :_=note("Apply range of colour scheme to image") +#@gui :Normalise=bool(1) +#@gui :Normalise Lower Threshold=float(0,0,255) +#@gui :Normalise Higher Threshold=float(255,0,255) +#@gui :To SRGB=bool(0) +#@gui :Preview Colour Scheme=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui _Contours +#@gui Gradient Norm [JR's Mod]:fx_jr_gradient_norm,fx_jr_gradient_norm_preview(1) +#@gui :Smoothness=float(0,0,10) +#@gui :Contrast=float(0.45,0,1.5) +#@gui :Min Threshold=float(40,0,100) +#@gui :Max Threshold=float(60,0,100) +#@gui :Negative=bool(0) +#@gui :Include Orientation=choice("Off","On","On (Extrapolate If Negative)") +#@gui :Scale X=float(1,0,5) +#@gui :Scale Y=float(1,0,5) +#@gui :Interpolation=choice(2,"Nearest","Average","Bilinear","Bicubic") +#@gui :Alpha=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui _Deformations +#@gui Auto-Gnarl:fx_auto_gnarl,fx_auto_gnarl_preview(1) +#@gui :_=note("Applies random deformations mainly to sharp edges.") +#@gui :_=separator() +#@gui :_=note("Gradient Norm") +#@gui :Smoothness=float(3,0,10) +#@gui :Contrast=float(0.45,0,1.5) +#@gui :Min Threshold=float(40,0,100) +#@gui :Max Threshold=float(60,0,100) +#@gui :Negative=bool(0) +#@gui :Scale X=float(1,0,5) +#@gui :Scale Y=float(1,0,5) +#@gui :Interpolation=choice(2,"Nearest","Average","Bilinear","Bicubic") +#@gui :_=separator() +#@gui :_=note("Noise Local Normalisation") +#@gui :Amplitude=float(4,0,60) +#@gui :Radius=int(6,1,64) +#@gui :Neighborhood Smoothness=float(5,0,40) +#@gui :Average Smoothness=float(20,0,40) +#@gui :Constrain Values=bool(1) +#@gui :_=separator() +#@gui :_=note("Warping") +#@gui :Smoothness=float(2.5,0,30) +#@gui :Rounding=float(0.5,0,1) +#@gui :Amplitude=float(2,0,5) +#@gui :Interpolation=choice(2,"Nearest","Bilinear","Bicubic") +#@gui :Boundary=choice(3,"None","Nearest","Periodic","Mirror") +#@gui Buffer Destroyer:fx_buffer_destroyer,fx_buffer_destroyer_preview(0) +#@gui :_=note("A preset combo of filters which rip images apart through simulated buffer manipulation and warping.") +#@gui :0. Recompute=button(0) +#@gui :1. Alpha=bool(1) +#@gui :_=separator() +#@gui :_=note("Buffer Error 1") +#@gui :2. Width=float(75,0,200) +#@gui :3. Height=float(40,0,200) +#@gui :4. Buffer Selection Start (%)=float(0,0,100) +#@gui :5. Buffer Selection Length (%)=float(100,0,400) +#@gui :6. Buffer Selection Shift (%)=float(0,0,100) +#@gui :7. Repeat Buffer=bool(1) +#@gui :_=separator() +#@gui :_=note("Shredder") +#@gui :8. Randomised Start=bool(1) +#@gui :9. Channels=choice("Correlated","RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :10. Min Gap=float(50,0,100) +#@gui :11. Max Gap=float(100,0,100) +#@gui :12. Strength=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Pixel Sort") +#@gui :_=note("Sorting parameters:") +#@gui :13. Order=choice(1,"Decreasing","Increasing") +#@gui :14. Axis=choice("X-Axis","Y-Axis","X-Axis Then Y-Axis","Y-Axis Then X-Axis") +#@gui :15. Sorting Criterion=choice(3,"Red","Green","Blue","Intensity","Luminance","Lightness","Hue","Saturation","Minimum","Maximum","Random") +#@gui :_=note("Masking parameters:") +#@gui :16. Mask By=choice("Criterion","Contours","Random") +#@gui :17. Lower Mask Threshold (%)=float(50,0,100) +#@gui :18. Higher Mask Threshold (%)=float(100,0,100) +#@gui :19. Mask Smoothness (%)=float(0,0,5) +#@gui :20. Invert Mask=bool(0) +#@gui :21. Preview Mask=bool(0) +#@gui :_=separator() +#@gui :_=note("Shifter") +#@gui :_=note("Amplitudes are cubed to tame the distortion a little bit.") +#@gui :22. Channels=choice("Correlated","RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :23. X Amplitude=float(2.5,0,10) +#@gui :24. X Iterations=int(20,0,400) +#@gui :25. Y Amplitude=float(2.5,0,10) +#@gui :26. Y Iterations=int(20,0,400) +#@gui :27. Matrix Warp Multiplier=float(1,0,5) +#@gui :28. Matrix Boundary=choice(5,"Random","Random [non-Transparent]","Transparent","Nearest","Periodic","Mirror") +#@gui :29. Warp Boundary=choice(5,"Random","Random [non-Transparent]","Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Buffer Error 2") +#@gui :30. Inverse Of BE1=bool(1) +#@gui :31. Width=float(120,0,200) +#@gui :32. Height=float(80,0,200) +#@gui :33. Buffer Selection Start (%)=float(0,0,100) +#@gui :34. Buffer Selection Length (%)=float(100,0,100) +#@gui :35. Buffer Selection Shift (%)=float(0,0,100) +#@gui :36. Repeat Buffer=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui Buffer Error:fx_buffer_error,fx_buffer_error_preview(0) +#@gui :_=note("Resizes an image without changing the positions of pixels in a specified selection of a simulated image buffer. Buffer shift scales with the buffer length.") +#@gui :1. Width=float(50,0,200) +#@gui :2. Height=float(50,0,200) +#@gui :3. Buffer Selection Start (%)=float(0,0,100) +#@gui :4. Buffer Selection Length (%)=float(100,0,400) +#@gui :5. Buffer Selection Shift (%)=float(0,0,100) +#@gui :6. Repeat Buffer=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui Kaleidoscope Layer Cake:fx_jr_klc,fx_jr_klc_preview(1) +#@gui :_=separator() +#@gui :Kaleidoscope Mirrors=int(6,0,64) +#@gui :Mirror Rotation=float(0,-360,360) +#@gui :M-Rot Mode=choice("Fixed Mirrors","Fixed Background") +#@gui :Result Rotation=float(0,-360,360) +#@gui :R-Rot Mode=choice("Full","Sector") +#@gui :Mirror Offset (%)=point(50,50,0,1) +#@gui :Centre (%)=point(50,50,0,1) +#@gui :Slice Mode=choice("Symmetric","Asymmetric","Reverse Asymmetric") +#@gui :_=separator() +#@gui :Layer Cake Density=float(30,0,100) +#@gui :Angle=float(0,-1440,1440) +#@gui :Angle Mode=choice("Layer","Density","Sector","Density & Sector") +#@gui :_=separator() +#@gui :Scale (%)=float(100,0,1000) +#@gui :Anti-Alias=float(1,0,2) +#@gui :Interpolation=choice(2,"None","Linear","Bicubic") +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui Layer Cake:fx_layer_cake,fx_layer_cake_preview(1) +#@gui :_=note("Splits image into annular or circular layers and rotates each layer. Based on the Paint.NET plugin.") +#@gui :Iterations=int(4,1,32) +#@gui :Angle at Centre=float(360,-1440,1440) +#@gui :Angle Times Iteration=bool(0) +#@gui :Size=float(75,0,200) +#@gui :Centre=point(50,50,0,1,255,255,255,175) +#@gui :Boundary=choice(3,"None","Nearest","Periodic","Mirror") +#@gui :Interpolation=choice(1,"None","Linear","Bicubic") +#@gui :Blur=float(0,0,200) +#@gui :_=separator() +#@gui :Anti-Alias Amplitude=float(30,0,100) +#@gui :Edge Threshold (%)=float(0,0,100) +#@gui :Smoothness=float(3,0,10) +#@gui :Output Layers=choice("Off","Hollow","Filled") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui Layer Cake 2:fx_layer_cake_2,fx_layer_cake_2_preview(1) +#@gui :Layer Density=float(4,1,100) +#@gui :Angle Value=float(360,-2880,2880) +#@gui :Angle Mode=choice("Divided by Density","Per Layer") +#@gui :Centre=point(50,50,0,1,255,255,255,175) +#@gui :Interpolation=choice(2,"None","Linear","Bicubic") +#@gui :Boundary=choice(3,"None","Nearest","Periodic","Mirror") +#@gui :Blur=float(50,0,100) +#@gui :Blur Mode=choice("Anti-Alias","Layer Smoothing") +#@gui :Output Mode=choice("Full","Filled Layers","Hollow Layers") +#@gui PowerTwirl:fx_powertwirl,fx_powertwirl_preview(1) +#@gui :Amplitude=float(1,-20,20) +#@gui :Offset=float(0,-180,180) +#@gui :Center (%)=point(50,50,0,1) +#@gui :Power=float(1,-20,20) +#@gui :Interpolation=choice(2,"None","Linear","Bicubic") +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :Mode=choice(0,"Polar","Cartesian") +#@gui Random Deformations (JR's Mod):fx_jr_deform,fx_jr_deform_preview(1) +#@gui :Recompute=button(0) +#@gui :Amplitude=float(5,0,50) +#@gui :Interpolation=choice(1,"None","Linear","Bicubic") +#@gui :Matrix Density=float(10,1,100) +#@gui :Matrix Interpolation=choice(1,"Linear","Bicubic") +#@gui :Mode=choice("Noise","Spread Noise") +#@gui :Character=float(0,-100,100) +#@gui :Boundary=choice(1,"Dirichlet","Neumann","Periodic","Mirror") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui Rays from Image:fx_rays_from_image,fx_rays_from_image(1) +#@gui :_=note("Creates rays from the colours of an image. If the power is 5, the lines radiate outwards as if the image is being exploded from the chosen point.") +#@gui :_=separator() +#@gui :Power=float(5,0,10) +#@gui :Centre=point(50,50,0,1,255,255,255,175) +#@gui :Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui Shifter:fx_shifter,fx_shifter_preview(1) +#@gui :_=note("Shifts portions of an image using warp maps made from difference blending of rectangles.") +#@gui :_=separator() +#@gui :Recompute=button(0) +#@gui :Channels=choice("Correlated","RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :Alpha=bool(1) +#@gui :X Amplitude=float(1,0,10) +#@gui :X Iterations=int(20,0,400) +#@gui :Y Amplitude=float(1,0,10) +#@gui :Y Iterations=int(20,0,400) +#@gui :Matrix Warp Multiplier=float(1,0,5) +#@gui :Matrix Boundary=choice(5,"Random","Random [non-Transparent]","Transparent","Nearest","Periodic","Mirror") +#@gui :Warp Boundary=choice(5,"Random","Random [non-Transparent]","Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui Spiral Matrix Transformation:fx_jr_spiral_transform,fx_jr_spiral_transform_preview(1) +#@gui :_=note("Transforms images into rectangular spirals. The main use is to run effects on the transformed images and then use a corresponding reverse transformation for unusual effects. Preview may be highly-inaccurate. Based off an unfinished script from the PolyGlitch Paint.NET plugin.\n\n Details of the Spiral Matrix Transform's mathematics can be found in this thread - Challenge: Spiralbw as a parametric function (x(t),y(t)).") +#@gui :_=separator() +#@gui :Mode=choice("Spiral","Inverse Spiral") +#@gui :Spiral Rotation=choice("Clockwise","Anticlockwise") +#@gui :Direction=choice("Down","Up") +#@gui :Starting Axis=choice("X","Y") +#@gui :Spiral Start=choice("Outside","Inside") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian, David Tschumperlé.,Joan Rake and Garagecoder. Latest Update: 2019/5/28.") +#@gui UltraWarp 2:fx_ultrawarptwo,fx_ultrawarptwo_preview(1) +#@gui :_=note("A sequence of multiple self-warps and HSV/HSI/HSL operations. A remake of UltraWarp++++ but with more focus on granular features rather than preset combinations of filters. 'Range' parameters determine the upper and lower bounds while the 'centre' parameters set the mean values.") +#@gui :_=separator() +#@gui :0. Recompute=button(0) +#@gui :_=separator() +#@gui :_=note("Warping") +#@gui :1. Iterations=int(3,1,30) +#@gui :2. From RGB To=choice(1,"Random","RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :3. X-Factor Centre=float(0,-30,30) +#@gui :4. X-Factor Range=float(3,0,30) +#@gui :5. Y-Factor Centre=float(0,-30,30) +#@gui :6. Y-Factor Range=float(3,0,30) +#@gui :7. X-Offset Centre=float(0,-30,30) +#@gui :8. X-Offset Range=float(3,0,30) +#@gui :9. Y-Offset Centre=float(0,-30,30) +#@gui :10. Y-Offset Range=float(3,0,30) +#@gui :11. Correlated Channels=choice(2,"On","Off","Random") +#@gui :12. Interpolation=choice(2,"Nearest","Linear","Random") +#@gui :13. Boundary=choice(5,"Transparent","Nearest","Periodic","Mirror","Random","Random (Non-Transparent)") +#@gui :14. Warp Channel(s)=choice(3,"None","Random","All","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :15. Include Alpha=bool(0) +#@gui :16. To RGB From=choice(1,"Random","RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :17. Random Negation=bool(1) +#@gui :_=separator() +#@gui :_=note("Post-warping HSX8 mixing") +#@gui :18. Repeat For Each Iteration=bool(1) +#@gui :19. X Channel=choice("Value","Intensity","Lightness") +#@gui :20. Hue Factor Centre=float(1,-20,20) +#@gui :21. Hue Factor Range=float(0.5,0,20) +#@gui :22. Saturation Factor Centre=float(2.5,-20,20) +#@gui :23. Saturation Factor Range=float(5,0,20) +#@gui :24. X Channel Factor Centre=float(1,-20,20) +#@gui :25. X Channel Factor Range=float(0,0,20) +#@gui :26. Alpha Factor Centre=float(1,-20,20) +#@gui :27. Alpha Factor Range=float(0,0,20) +#@gui :28. Hue Shift Centre=float(0,-255,255) +#@gui :29. Hue Shift Range=float(255,0,255) +#@gui :30. Saturation Shift Centre=float(0,-255,255) +#@gui :31. Saturation Shift Range=float(255,0,255) +#@gui :32. X Channel Shift Centre=float(0,-255,255) +#@gui :33. X Channel Shift Range=float(0,0,255) +#@gui :34. Alpha Shift Centre=float(0,-255,255) +#@gui :35. Alpha Shift Range=float(0,0,255) +#@gui ___Degradations +#@gui UltraWarp++++:fx_ultrawarp4plus,fx_ultrawarp4plus_preview(0) +#@gui :_=note("A sequence of multiple partially-randomised texture generation and image deformation filters with multi-iteration warping.") +#@gui :_=note("This modular filter is extremely complex and its logic may not follow that which you expect. Left on its default settings, it is very likely to munge your image beyond recognition. This original version has been kept alive despite being slower than UltraWarp 2.") +#@gui :_=separator() +#@gui :0. Recompute=button(0) +#@gui :_=separator() +#@gui :1. Plasma Texture [Discards Input Image]=bool(0) +#@gui :2. Plasma Scale=float(3.3,0,20) +#@gui :3. Plasma Alpha Channel=bool(0) +#@gui :_=separator() +#@gui :4. Segmentation [No Alpha Channel]=bool(0) +#@gui :5. Edge Threshold=float(5,0.01,60) +#@gui :6. Smoothness=float(0,0,60) +#@gui :_=separator() +#@gui :7. Blur=float(0,0,30) +#@gui :_=separator() +#@gui :8. Quadtree Pixelisation [No Alpha Channel]=bool(0) +#@gui :9. Quadtree Min Precision=int(4,2,8192) +#@gui :10. Quadtree Max Precision=int(256,0,8192) +#@gui :11. Quadtree Min Homogeneity=float(4.8,0,5) +#@gui :12. Quadtree Max Homogeneity=float(5,0,5) +#@gui :_=separator() +#@gui :13. Noise Type=choice(2,"Gaussian","Uniform","Salt and Pepper","Poisson") +#@gui :14. Minimum Noise=float(0,0,8) +#@gui :15. Maximum Noise=float(0,0,8) +#@gui :16. Noise Channel(s)=choice(2,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :_=separator() +#@gui :_=note("Warping") +#@gui :17. Warp Iterations=int(3,0,30) +#@gui :18. Warp Intensity=float(3,0,10) +#@gui :19. Warp Offset=float(20,0,2000) +#@gui :20. Scale to Width=bool(1) +#@gui :21. Scale to Height=bool(1) +#@gui :22. Correlated Channels=choice("Random","Off","On") +#@gui :23. Boundary=choice(5,"Random","Random [non-Transparent]","Transparent","Nearest","Periodic","Mirror") +#@gui :24. Warp Channel(s)=choice(2,"Random","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :25. Random Negation=bool(1) +#@gui :26. Random Negation Channel(s)=choice(2,"Random","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :27. Gamma Offset=float(0.25,0,1) +#@gui :28. Hue Offset=float(1,0,1) +#@gui :29. Normalise=bool(1) +#@gui :_=separator() +#@gui :_=note("Final HSV Scaling") +#@gui :30. Minimum Hue=float(0,0,20) +#@gui :31. Maximum Hue=float(5,0,20) +#@gui :32. Minimum Saturation=float(0,0,20) +#@gui :33. Maximum Saturation=float(3,0,20) +#@gui :34. Minimum Value=float(0.5,0,20) +#@gui :35. Maximum Value=float(2,0,20) +#@gui :_=note("Set these to their minimum values for randomisation") +#@gui :36. Hue Offset=float(-180,-180,180) +#@gui :37. Saturation Offset=float(0,-1.01,1) +#@gui :38. Value Offset=float(0,-20.01,20) +#@gui :_=separator() +#@gui :-4. Normalise=bool(1) +#@gui :-3. Normalisation Channel(s)=choice(11,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :_=separator() +#@gui :-2. Overall Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :-1. Value Action=choice("None","Cut","Normalize") +#@gui _Testing +#@gui Joan Rake +#@gui Degradations +#@gui Blur [Bloom Glare]:fx_blur_bloom_glare,fx_blur_bloom_glare_preview(0) +#@gui :Amplitude=float(1,0,20) +#@gui :Ratio=float(2,0,10) +#@gui :Iterations=int(5,0,200) +#@gui :Operator=choice("Add","Max","Min") +#@gui :Kernel=choice("Quasi-Gaussian","Gaussian","Box","Triangle","Quadratic") +#@gui :Normalize Scales=bool(0) +#@gui :Anisotropy=bool(0) +#@gui :Angle=float(0,0,180) +#@gui :Axis=int(3,1,20) +#@gui :Opacity=float(0.5,0,1) +#@gui :_=note("Parameters Angle, Axis and Opacity are only active when Anisotropy is checked") +#@gui :_=separator() +#@gui :Channel(s)=choice(7,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé. Latest update: 2015/03/02.") +#@gui Bomb Blend:fx_blend_bomb,fx_blend_bomb_preview +#@gui :_=note("Creates a random transfer function 'mesh' and then blends images accordingly. Based on method shown on discuss.pixls.us.") +#@gui :Recompute=button(0) +#@gui :Process As=choice(1,"Two-By-Two","Self-Blend for Each Layer") +#@gui :Mesh X=int(16,1,256) +#@gui :Mesh Y=int(16,1,256) +#@gui :Mesh Smoothness=float(2,0,10) +#@gui :Contrast Scheme=choice("Arctan","Clip","Power") +#@gui :Mesh Contrast=float(50,0,100) +#@gui :Reverse Blending Layers=bool(0) +#@gui :Dimensions=choice("Bottom Layer","Top Layer") +#@gui :Alpha=bool(0) +#@gui :Normalise=bool(0) +#@gui :Output Mesh=bool(0) +#@gui Broken Texture Afre:fx_texture_afre_broken,fx_texture_afre_broken_preview(0) +#@gui :_=note("This shouldn't have happened.") +#@gui :_=separator() +#@gui :P1=float(1,0,10) +#@gui :P2=float(10,0,100) +#@gui :Difference=bool(0) +#@gui Butterworth Bandpass:fx_butterworth_bp,fx_butterworth_bp_preview(0) +#@gui :_=note("Lowpass and highpass zero-phase resonant Butterworth-style filters.") +#@gui :_=separator() +#@gui :LP Frequency Power=float(3,0,16) +#@gui :LP Order Cube Root=float(2,0,4) +#@gui :LP Resonance=float(0,0,5) +#@gui :HP Frequency Power=float(4,0,16) +#@gui :HP Order Cube Root=float(2,0,4) +#@gui :HP Resonance=float(0,0,5) +#@gui :Colour Space=choice("RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :Alpha=bool(0) +#@gui :Absolute=bool(1) +#@gui :Makeup Gain=bool(1) +#@gui :Preview Frequency Response=bool(0) +#@gui Cascading Self Glitching:fx_self_glitching_cascade,fx_self_glitching_cascade_preview(1) +#@gui :_=note("Shifts images in a cascading fashion but computes values based on shifted and original images.") +#@gui :_=note("This filter has many channel options and many operation options allowing for extremely-distorted images. Don't always trust the preview!") +#@gui :_=separator() +#@gui :1. Shift Channels=choice("RGB/SRGB","CMYK/CMY","HSV/HSV8","HSL/HSL8","HSI/HSI8","LCH/LCH8","Lab/Lab8","YCbCr/YCbCrGLIC","YIQ/YIQ8","YUV/YUV8","RYB/HCY","XYZ/XYZ8") +#@gui :2. Alt Choice=bool(0) +#@gui :3. Process Alpha=bool(0) +#@gui :4,5. Zeroth Shift=point(50,50,0,1,255,255,255,175) +#@gui :6. Boundary=choice(3,"Zero","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :7. Iterations=int(3,1,64) +#@gui :8. Repeat Post-Shift Operations=bool(1) +#@gui :_=separator() +#@gui :9,10. Shift Target=point(55,55,0,1,255,0,0,175) +#@gui :11. Target for Final (Rather than First) Shift=bool(0) +#@gui :12,13. Cascade Centre Point=point(45,45,0,1,0,255,0,175) +#@gui :14. Shift Randomness=float(0.75,0,4) +#@gui :15. Boundary=choice(3,"Zero","Nearest","Periodic","Mirror") +#@gui :16. Power=float(0,-5,5) +#@gui :17. Bias=float(0,-256,256) +#@gui :18. Negation=bool(0) +#@gui :19. Shift Operator=choice("Add","Multiply","Bitwise And","Bitwise Or","Bitwise Xor","Power","Reverse Power","Modulo","Reverse Modulo","Divide","Reverse Divide","Subtract","Reverse Subtract","Left Bitwise Shift","Reverse LBS","Right Bitwise Shift","Reverse RBS","Left Bitwise Rotation","Reverse LBR","Right Bitwise Rotation","Reverse RBR","Average","Round","Reverse Round","Sine","Reverse Sine","Cosine","Reverse Cosine","Tangent","Reverse Tangent (CPU-Intensive)","Cosecant","Reverse Cosecant","Secant","Reverse Secant","Cotangent","Reverse Cotangent","Variance","Difference","Minimum","Maximum","Interference (Add)","Reverse Interference (Add)","Interference (Multiply)","Interference (Divide)","Reverse Interference (Div)","Interference (Subtract)","Reverse Interference (Subt)","Interference (Rev Subt)","Reverse Interference (Rev Subt)","Interference (Difference)","Reverse Interference (Diff)","Interference (Variance)","Screen","Colour Dodge","Reverse Colour Dodge","Colour Burn","Reverse Colour Burn","Soft Light (Illusions.Hu)","Reverse Soft Light (Illusions.Hu)","Geometric Mean","Bright Hard Mix","Dark Hard Mix") +#@gui :20. Multiplier 1=float(1,-10,10) +#@gui :21. Addition 1=int(0,-1024,1024) +#@gui :22. Sawtoother Mode=choice(0,"Modulo","Triangular-Modulo","Legacy Modulo") +#@gui :23. Maximum End Value=int(256,0,1024) +#@gui :24. Multiplier 2=float(1,-10,10) +#@gui :25. Addition 2=int(0,-1024,1024) +#@gui :_=separator() +#@gui :26. Run on Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :_=separator() +#@gui :_=note("Original author: David Tschumperlé; extended by some nobody who calls themselves 'Joan Rake' or something.

Latest update: 2018/08/24.") +#@gui DCT FSU:fx_dct_fsu,fx_dct_fsu_preview(0) +#@gui :1. Operation=choice("Low Pass 1","Low Pass 2","High Pass 1","High Pass 2","Isolate","Plaid","Plaid LP","Plaid HP","Randomised Spread","Randomised Spread [intense]") +#@gui :2. X (%)=float(50,0,100) +#@gui :3. Y (%)=float(50,0,100) +#@gui :4-5. Shift Before=point(0,0,0,-1,255,127,0,175) +#@gui :6-7. Shift After=point(100,100,0,-1,127,255,0,175) +#@gui :8. Absolute=bool(0) +#@gui :9. Normalise=bool(1) +#@gui :10. Colour Space=choice("RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :11. Alpha=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui Fake JFIF (JPEG) Encoder:fx_jfif_fake,fx_jfif_fake_preview(0)* +#@gui :_=note("A fake jfif encoder.") +#@gui :Quality (%)=int(50,1,100) +#@gui :Encoding=choice("444","442","424","422") +#@gui :_=separator() +#@gui :_=note("Fake Glitch") +#@gui :Power=float(0,0,5) +#@gui :Colour Distortion=float(1.25,0,10) +#@gui :Max Tile Error Length=int(5,1,10) +#@gui :Persistent Tile Error Power=float(0.25,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui :_=separator() +#@gui :_=note("Author: Joan Rake, \'borrowed\' from David Tschumperlé. Latest Update: 2017/05/07.") +#@gui Faux-QAM Glitch:fx_qam_glitch,fx_qam_glitch_preview(0) +#@gui :_=note("Tries to emulate the effect of a faulty Quadrature Amplitude Modulator.") +#@gui :_=separator() +#@gui :_=note("Channel Modulation") +#@gui :1. Amplitude=float(2,0,10) +#@gui :2. Period=float(20,0,100) +#@gui :3. Phase Offset=float(0,-180,180) +#@gui :4. Angle=float(0,-180,180) +#@gui :5. Amplitude Offset=float(1,-10,10) +#@gui :6. Wave Offset=float(127.5,0,255) +#@gui :7. Colour Space=choice("RGBA","SRGBA","HSVA8","HSVA","HSLA8","HSLA","HSIA8","HSIA","LCHA8","LCHA","LabA8","LabA","YCbCrA","YCbCrAGLIC","YCbCrAJPEG","YIQA8","YIQA","YUVA8","YUVA","HCYA","XYZA8","XYZA","RYBA","CMYA") +#@gui :8. Channel 0=bool(1) +#@gui :9. Channel 1=bool(1) +#@gui :10. Channel 2=bool(1) +#@gui :11. Alpha=bool(0) +#@gui :12. Glitch Negation=bool(0) +#@gui :_=separator() +#@gui :_=note("Scanlines") +#@gui :13. Amplitude=float(20,0,255) +#@gui :14. Bandwidth=float(5,0,20) +#@gui :15. Shape=choice(0,"Bloc","Triangle","Sine","Sine+","Random") +#@gui :16. Angle Offset=float(0,-180,180) +#@gui :17. Offset=float(0,0,500) +#@gui :18. Blur=float(2,0,10) +#@gui :19. Amplitude Modulation=float(0.6,0,1) +#@gui :20. Phase Modulation=float(0.05,0,1) +#@gui :_=separator() +#@gui :21-23. Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui JFIF [JPEG] Self-Bomb:fx_jfif_bomb,fx_jfif_bomb_preview +#@gui :_=note("OI! TRY SMOOTHING THIS!") +#@gui :_=note("Adds JPEG artefacts and then self-bomb-blends. Use grid interpolation with scale factors above 1 to destroy the results even more.") +#@gui :Recompute=button(0) +#@gui :_=separator() +#@gui :Quality (%)=int(50,1,100) +#@gui :Mesh X=int(16,1,256) +#@gui :Mesh Y=int(16,1,256) +#@gui :Mesh Smoothness=float(0.5,0,10) +#@gui :Contrast Scheme=choice(1,"Arctan","Clip","Power) +#@gui :Mesh Contrast=float(75,0,100) +#@gui :Scale X=float(1,0.05,16) +#@gui :Scale Y=float(1,0.05,16) +#@gui :Interpolation=choice(0,"None","Nearest","Average","Bilinear","Grid","Bicubic") +#@gui :Normalize=bool(0) +#@gui :Output Mesh=bool(0) +#@gui :_=separator() +#@gui :Solidify Alpha=bool(1) +#@gui :Smoothness (%)=float(75,0,100) +#@gui :Regularization=choice(1,"Isotropic","Delaunay-Oriented","Edge-Oriented") +#@gui :Regularization Iterations=int(20,0,100) +#@gui :Dilation / Erosion=int(0,-20,20) +#@gui :Colorspace=choice(1,"SRGB","Linear RGB") +#@gui JFIF Effects:fx_jfif,fx_jfif_preview(0) +#@gui :_=note("A poorly-implemented JFIF encoder with extras, all designed to screw with images. Quite slow and very aggressive.") +#@gui :1. Quality (%)=int(50,1,100) +#@gui :2. Encoding=choice(3,"444","442","424","422") +#@gui :_=separator() +#@gui :_=note("Fake Glitch") +#@gui :3. Power=float(0,0,10) +#@gui :4. Colour Distortion=float(1,0,2) +#@gui :5. Max Glitch Length=int(5,2,10) +#@gui :6. Max Value Errors Per Tile=int(5,0,10) +#@gui :7. Error Strength=float(3,0,8) +#@gui :8. Persistent Value Errors Power=float(0.25,0,1) +#@gui :9. Error Bias=float(0.5,0,1) +#@gui :10. Tile Shift Power=float(0.25,0,1) +#@gui :11. Mirror=choice("None","X","Y","XY") +#@gui :12. Rotate=choice("None,"90 Clockwise","180","90 Anticlockwise") +#@gui :_=separator() +#@gui :_=note("Self-Bomb") +#@gui :13. Enable=bool(0) +#@gui :14. Mesh X=int(16,1,256) +#@gui :15. Mesh Y=int(16,1,256) +#@gui :16. Mesh Smoothness=float(0.5,0,10) +#@gui :17. Contrast Scheme=choice(1,"Arctan","Clip","Power) +#@gui :18. Mesh Contrast=float(75,0,100) +#@gui :19. Scale X=float(1,0.05,16) +#@gui :20. Scale Y=float(1,0.05,16) +#@gui :21. Interpolation=choice(0,"None","Nearest","Average","Bilinear","Grid","Bicubic") +#@gui :22. Normalise=bool(0) +#@gui :23. Output Mesh=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui :_=separator() +#@gui :_=note("Author: Joan Rake, \'borrowed\' from David Tschumperlé. Latest Update: 2017/05/07.") +#@gui JFIF Effects Extended:fx_jfif_xt,fx_jfif_xt_preview(0) +#@gui :_=note("A poorly-implemented JFIF encoder with extras, all designed to screw with images. Quite slow and very aggressive.") +#@gui :1. Quality (%)=float(50,0,100) +#@gui :2. Size X=int(8,1,100) +#@gui :3. Size Y=int(8,1,100) +#@gui JPEG Encoder:fx_jpeg_preview +#@gui :_=separator() +#@gui :1. Quality=float(80,0,100) +#@gui :2. Colour Space=choice(21,"RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :3. Channel 1 Block Width=int(8,2,32) +#@gui :4. Channel 1 Block Height=int(8,2,32) +#@gui :5. Channel 2 Block Width=int(16,2,32) +#@gui :6. Channel 2 Block Height=int(16,2,32) +#@gui :7. Channel 3 Block Width=int(16,2,32) +#@gui :8. Channel 3 Block Height=int(16,2,32) +#@gui :Toggle Block Offsets=bool(0) +#@gui :9. Channel 1 Block X Offset=int(0,-32,32) +#@gui :10. Channel 1 Block Y Offset=int(0,-32,32) +#@gui :11. Channel 2 Block X Offset=int(0,-32,32) +#@gui :12. Channel 2 Block Y Offset=int(0,-32,32) +#@gui :13. Channel 3 Block X Offset=int(0,-32,32) +#@gui :14. Channel 3 Block Y Offset=int(0,-32,32) +#@gui Multi-Mosaic:fx_jr_multi_mosaic_preview +#@gui :_=separator() +#@gui :0. Recompute=button() +#@gui :1. Iterations=int(3,1,10) +#@gui :_=separator() +#@gui :_=note("Mosaic") +#@gui :2. Lowest Density=float(15,0,100) +#@gui :3. Highest Density=float(45,0,100) +#@gui :4. Details Influence=float(50,0,100) +#@gui :5. Details Smoothness=float(0,0,100) +#@gui :6-8. Colour Balance=color(#808080) +#@gui :9. Luma Range=float(0,0,100) +#@gui :10. Chroma Range=float(0,0,100) +#@gui :11. Hue Range=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("Edges [Gradient Norm]") +#@gui :12. Opacity=float(1,-1,1) +#@gui :13. Smoothness=float(0,0,10) +#@gui :14. Linearity=float(0.5,0,1.5) +#@gui :15. Min Threshold=float(0,0,100) +#@gui :16. Max Threshold=float(100,0,100) +#@gui :17. Thickness=int(1,1,10) +#@gui :18-20. Color=color(#000000) +#@gui :21. Luma Range=float(0,0,100) +#@gui :22. Chroma Range=float(0,0,100) +#@gui :23. Hue Range=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("Final Edge Blend") +#@gui :24. Edge Blend=bool(1) +#@gui :25. Smoothness=float(15,0,100) +#@gui :_=separator() +#@gui :_=note("Smooth [Diffusion]") +#@gui :26. Iterations=int(16,0,100) +#@gui :27. Sharpness=float(0.5,0,2) +#@gui :28. Anisotropy=float(1,0,1) +#@gui :29. Gradient Smoothness=float(3,0,10) +#@gui :30. Tensor Smoothness=float(5,0,10) +#@gui :31. Time Step=float(15,5,50) +#@gui :_=separator() +#@gui :_=note("Local Normalization") +#@gui :32. Amplitude=float(2,0,60) +#@gui :33. Radius=int(6,1,64) +#@gui :34. Neighborhood Smoothness=float(5,0,40) +#@gui :35. Average Smoothness=float(20,0,40) +#@gui :36. Constrain Values=bool(1) +#@gui :37 .Channel(s)=choice(2,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui Pseudo-ECB (Electronic Code Book Algorithm):pseudo_ecb,_pseudo_ecb_preview(0) +#@gui :_=note("This filter is inspired by one of the glitch plugin for Paint.NET. This doesn't actually emulate how the codebook encryption algorithm actually work, but it is inspired from it. This filter uses bomb blending mode which involves RGBA Transfer Function Mesh. See Mesh Blend filter for a link. \n\n Note that the filter works best on images with large patches of single colors. ") +#@gui :_=separator() +#@gui :_=note("Color Space Choice \n\n Keep in mind that you may not necessarily get what you imagine. Just treat these as themes. ") +#@gui :Colour Space=choice("RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :_=separator() +#@gui :_=note("Final Color Processing \n\n This refers to the how the colors are going to be processed. If you find that there's too little difference in hues or chroma or luminosity in local areas, this should be on. Sometimes, the result are better without the final processing.") +#@gui :Equalize Filter=bool(0) +#@gui :Pseudo-Coloring=bool(1) +#@gui :Tonality Blend=choice(20,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Tonality Blend Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("ECB Pattern Key Generator") +#@gui :Double Gradient?=bool(1) +#@gui :Length of Gradient#1=float(5,0,32) +#@gui :ECB Gradient#1 Angle=float(0,0,360) +#@gui :ECB Inversion#1=bool(0) +#@gui :Length of Gradient#2=float(5,0,32) +#@gui :ECB Gradient#2 Angle=float(90,0,360) +#@gui :ECB Inversion#2=bool(0) +#@gui :Gradient Blend=choice(41,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Gradient Blend Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Sharpen Filtering") +#@gui :Sharpening Noise Processing=float(15,0,200) +#@gui :_=separator() +#@gui :_=note("ECB Image Processing") +#@gui :Transfer Mesh Size for Image (Squared)=int(256,2,256) +#@gui :Image Mesh Contrast=int(75,25,100) +#@gui :Transfer Mesh Size for Gradient (Squared)=int(16,2,256) +#@gui :Gradient Mesh Contrast=int(100,25,100) +#@gui :Double Encryption Effect=bool(1) +#@gui :Inner Blend=choice(41,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Inner Blend Opacity=float(1,0,1) +#@gui :Outer Blend=choice(41,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Outer Blend Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Self-Image Post-Processing \n\n This invokes a self-blending operation after the main pseudo-ecb has been generated with different blend mode.") +#@gui :Activate Self-Image Post-Processing=bool(1) +#@gui :Equalize ECB Processing=bool(0) +#@gui :Pseudo-Coloring=bool(1) +#@gui :Self-Blend=choice(41,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Self-Blend Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Multilayer processing\n\nWarning:All layer must be of same size for expected result!") +#@gui :Apply to All Layers?=bool(0) +#@gui :Boundary Condition=choice(0,"Neumann","Periodic","Mirror") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui :_=separator() +#@gui :_=note("Author : Reptorian Latest update: 2018/12/30.") +#@gui Row Shifter:fx_row_shift,fx_row_shift_preview(0) +#@gui :_=note("Shifts rows.") +#@gui :_=separator() +#@gui :Order=choice("X Then Y","Simultaneous","Y Then X") +#@gui :X Shift=float(0,-5,5) +#@gui :X Centre=float(0.5,0,1) +#@gui :Y Shift=float(0,-5,5) +#@gui :Y Centre=float(0.5,0,1) +#@gui :Interpolation=choice(3,"None","Nearest","Average","Bilinear","Grid","Bicubic","Lanczos") +#@gui :Invert Shifts=bool(0) +#@gui Sawtoother [CMY(-K)]:sawtoother_cmy_k,sawtoother_cmy_k_preview(1)+ +#@gui :_=note("Splits image into CMY or CMYK channels and uses modulo operations to generate sawtooth waves and map channel intensities to them.") +#@gui :_=note("This filter was intended for screwing up images but it can also be used for quick analysis among other things.") +#@gui :_=separator() +#@gui :_=note("Cyan") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Magenta") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Yellow") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Key") +#@gui :Include Channel=bool(0) +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui Sawtoother [HSX]:sawtoother_hsx,sawtoother_hsx_preview(1)+ +#@gui :_=note("Splits image into HSV, HSI or HSL channels and uses modulo operations to generate sawtooth waves and map channel intensities to them.") +#@gui :_=note("This filter was intended for screwing up images but it can also be used for quick analysis among other things.") +#@gui :_=separator() +#@gui :_=note("Hue") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-180,180) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-180,180) +#@gui :_=separator() +#@gui :_=note("Saturation") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-1,1) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("Value/Intensity/Lightness") +#@gui :Channel=choice("Value","Intensity","Lightness) +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-1,1) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-1,1) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui Sawtoother [Lab8]:sawtoother_lab8,sawtoother_lab8_preview(1)+ +#@gui :_=note("Splits image into Lab8 channels and uses modulo operations to generate sawtooth waves and map channel intensities to them.") +#@gui :_=note("This filter was intended for screwing up images but it can also be used for quick analysis among other things.") +#@gui :_=separator() +#@gui :_=note("Luminance") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Chrominance a") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Chrominance b") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui Sawtoother [LCH8]:sawtoother_lch8,sawtoother_lch8_preview(1)+ +#@gui :_=note("Splits image into LCH8 channels and uses modulo operations to generate sawtooth waves and map channel intensities to them.") +#@gui :_=note("This filter was intended for screwing up images but it can also be used for quick analysis among other things.") +#@gui :_=separator() +#@gui :_=note("Luminance") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Chroma") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Hue") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui Sawtoother [RGB]:sawtoother_rgb,sawtoother_rgb_preview(1)+ +#@gui :_=note("Splits image into RGB channels and uses modulo operations to generate sawtooth waves and map channel intensities to them.") +#@gui :_=note("This filter was intended for screwing up images but it can also be used for quick analysis among other things.") +#@gui :_=separator() +#@gui :_=note("Red") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Green") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Blue") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui Sawtoother [sRGB]:sawtoother_srgb,sawtoother_srgb_preview(1)+ +#@gui :_=note("Splits image into sRGB channels and uses modulo operations to generate sawtooth waves and map channel intensities to them.") +#@gui :_=note("This filter was intended for screwing up images but it can also be used for quick analysis among other things.") +#@gui :_=separator() +#@gui :_=note("Red") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Green") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Blue") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui Sawtoother [XYZ8]:sawtoother_xyz8,sawtoother_xyz8_preview(1)+ +#@gui :_=note("Splits image into XYZ8 channels and uses modulo operations to generate sawtooth waves and map channel intensities to them.") +#@gui :_=note("This filter was intended for screwing up images but it can also be used for quick analysis among other things.") +#@gui :_=separator() +#@gui :_=note("X") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Y") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Z") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui Sawtoother [YCbCr-(-GLIC-JPEG)]:sawtoother_ycbcr,sawtoother_ycbcr_preview(1)+ +#@gui :_=note("Splits image into YCbCr channels and uses modulo operations to generate sawtooth waves and map channel intensities to them. One can choose between the original G'MIC implementation, the GLIC implementation, and the JPEG-style implementation by Garagecoder.") +#@gui :_=note("This filter was intended for screwing up images but it can also be used for quick analysis among other things.") +#@gui :Channel=choice("YCbCr","YCbCrGLIC","YCbCrJPEG") +#@gui :_=separator() +#@gui :_=note("Y (Luminance)") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Blue Chrominance") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Red Chrominance") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui Sawtoother [YIQ8]:sawtoother_yiq8,sawtoother_yiq8_preview(1)+ +#@gui :_=note("Splits image into YIQ8 channels and uses modulo operations to generate sawtooth waves and map channel intensities to them.") +#@gui :_=note("This filter was intended for screwing up images but it can also be used for quick analysis among other things.") +#@gui :_=separator() +#@gui :_=note("Y (Luminance)") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Chrominance I") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Chrominance Q") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui Sawtoother [YUV8]:sawtoother_yuv8,sawtoother_yuv8_preview(1)+ +#@gui :_=note("Splits image into YUV8 channels and uses modulo operations to generate sawtooth waves and map channel intensities to them.") +#@gui :_=note("This filter was intended for screwing up images but it can also be used for quick analysis among other things.") +#@gui :_=separator() +#@gui :_=note("Y (Luminance)") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Chrominance I") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Chrominance Q") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui Shredder:fx_shredder,fx_shredder_preview(0) +#@gui :_=note("Re-fills an image with its own values but makes random jumps in the relative positions where the lookup for the values takes place. Can be channel-independent. Relative gap sizes are cubed to make it easier to use small gaps between jumps.") +#@gui :0. Recompute=button(0) +#@gui :1. Randomised Start=bool(1) +#@gui :2. Channels=choice("Correlated","RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :3. Alpha=bool(1) +#@gui :4. X Min Gap=float(0,0,100) +#@gui :5. X Max Gap=float(100,0,100) +#@gui :6. X Strength=float(0.5,0,1) +#@gui :7. Y Min Gap=float(0,0,100) +#@gui :8. Y Max Gap=float(100,0,100) +#@gui :9. Y Strength=float(0.5,0,1) +#@gui :10. Mirror=choice("None","X","Y","XY") +#@gui :11. Rotate=choice("None,"90 Clockwise","180","90 Anticlockwise") +#@gui Smooth EQ:fx_jr_smooth_eq,fx_jr_smooth_eq_preview(0) +#@gui :_=note("A zero-phase equaliser with low-pass and high-pass filters and 5 band shelves.") +#@gui :_=separator() +#@gui :_=note("Low Pass") +#@gui :Frequency Power=float(8,0,16) +#@gui :Order Cube Root=float(2,0,4) +#@gui :Resonance=float(0,0,5) +#@gui :_=separator() +#@gui :_=note("Band Shelf 1") +#@gui :Frequency Power=float(3,0,16) +#@gui :Order Cube Root=float(2,0,4) +#@gui :Bandwidth=float(1.5,0,16) +#@gui :Gain=float(0,-10,10) +#@gui :_=separator() +#@gui :_=note("Band Shelf 2") +#@gui :Frequency Power=float(4,0,16) +#@gui :Order Cube Root=float(2,0,4) +#@gui :Bandwidth=float(2,0,16) +#@gui :Gain=float(0,-10,10) +#@gui :_=separator() +#@gui :_=note("Band Shelf 3") +#@gui :Frequency Power=float(5,0,16) +#@gui :Order Cube Root=float(2,0,4) +#@gui :Bandwidth=float(2,0,16) +#@gui :Gain=float(0,-10,10) +#@gui :_=separator() +#@gui :_=note("Band Shelf 4") +#@gui :Frequency Power=float(6,0,16) +#@gui :Order Cube Root=float(2,0,4) +#@gui :Bandwidth=float(2,0,16) +#@gui :Gain=float(0,-10,10) +#@gui :_=separator() +#@gui :_=note("Band Shelf 5") +#@gui :Frequency Power=float(7,0,16) +#@gui :Order Cube Root=float(2,0,4) +#@gui :Bandwidth=float(2,0,16) +#@gui :Gain=float(0,-10,10) +#@gui :_=separator() +#@gui :_=note("High Pass") +#@gui :Frequency Power=float(3,0,16) +#@gui :Order Cube Root=float(2,0,4) +#@gui :Resonance=float(0,0,5) +#@gui :Colour Space=choice("RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :Alpha=bool(0) +#@gui :Absolute=bool(1) +#@gui :Makeup Gain=bool(1) +#@gui :Preview Frequency Response=bool(0) +#@gui Superstreak:fx_superstreak,fx_superstreak_preview(0) +#@gui :_=separator() +#@gui :1. Random Seed=int(10,0,65535) +#@gui :2. Iterations=int(10,1,20) +#@gui :3. Propagation=choice(3,"Backward","Forward","Bidirectional [Sharp]","Bidirectional [Smooth]") +#@gui :4. Min Threshold=float(0.50,0.00,1.00) +#@gui :5. Max Threshold=float(0.50,0.00,1.00) +#@gui :6. Min Step Size=float(10,0,100) +#@gui :7. Max Step Size=float(30,0,100) +#@gui UltraWarp 3:fx_ultrawarp3_preview +#@gui :_=separator() +#@gui :0. Recompute=button() +#@gui :1. Random Seed=int(-1,-1,65535) +#@gui :2. Iterations=int(1,1,10) +#@gui :3. Warp Magnitude=float(1,0,10) +#@gui :4. WM Range=float(1,0,10) +#@gui :5. Warp Angle=float(0,0,360) +#@gui :6. WA Range=float(360,0,360) +#@gui :7. Offset Magnitude=float(1,0,100) +#@gui :8. OM Range=float(1,0,100) +#@gui :9. Offset Angle=float(0,0,360) +#@gui :10. OA Range=float(360,0,360) +#@gui :11. Correlated Channels=bool(0) +#@gui :12. Interpolation=choice(1,"Nearest Neighbor","Linear") +#@gui :13. Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :14. Colour Space=choice("RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :_=separator() +#@gui :15. Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :0. Recompute=button() +#@gui :1. Density=float(15,0,100) +#@gui :2. Details Influence=float(50,0,100) +#@gui :3. X Offset Centre=float(0,-100,100) +#@gui :4. X Offset Range=float(25,0,200) +#@gui :5. Y Offset Centre=float(0,-100,100) +#@gui :6. Y Offset Range=float(25,0,200) +#@gui :7. Z Offset Centre=float(0,-100,100) +#@gui :8. Z Offset Range=float(0,0,200) +#@gui :9. Rot Angle Centre=float(0,-360,360) +#@gui :10. Rot Angle Range=float(360,0,360) +#@gui :11. Rot Axis X Centre=float(0,-1,1) +#@gui :12. Rot Axis X Range=float(0,0,2) +#@gui :13. Rot Axis Y Centre=float(0,-1,1) +#@gui :14. Rot Axis Y Range=float(0,0,2) +#@gui :15. Rot Axis Z Centre=float(1,-1,1) +#@gui :16. Rot Axis Z Range=float(0,0,2) +#@gui :17. AA Iterations=int(16,0,100) +#@gui :18. Sharpness=float(0,0,2) +#@gui :19. AA Anisotropy=float(1,0,1) +#@gui :20. AA Gradient Smoothness=float(1,0,10) +#@gui :21. Tensor Smoothness=float(5,0,10) +#@gui :22. Time Step=float(15,5,50) +#@gui _Details +#@gui 8-Bit Plane Splitter:fx_bitplane8,fx_bitplane8_preview(1) +#@gui :Mode=choice("Decompose","Recompose") +#@gui :Split Mode=choice(1,"Z Layers","Separate Images") +#@gui :Value Mode=choice("Real","1","255") +#@gui :Alpha=bool(0) +#@gui Bilinear Enhancement:fx_jr_bilinear,fx_jr_bilinear_preview(1) +#@gui :Overall Iterations=int(1,1,10) +#@gui :Bilateral Sub-Iterations=int(3,1,10) +#@gui :Spatial Variance=float(10,0,100) +#@gui :Value Variance=float(10,0,100) +#@gui :Amplitude=float(1,-10,10) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui _ +#@gui Mesh Blend:fx_mesh_blend,fx_mesh_blend_preview(1) +#@gui :_=note("Universal blending algorithm. Resizes an RGB(A) image to a 256x256 image and uses it as an RGBA LUT 'transfer function mesh' to blend two other images together. Based on method shown on discuss.pixls.us.") +#@gui :_=separator() +#@gui :_=note("[0] is bottom layer, [1] is top layer, [2] is mesh. Mesh origin is at bottom-left. Plugin GUI preview does not accurately show mesh.") +#@gui :Process As=choice(0,"Three-By-Three","Self-Mesh and Self-Blend for Each Layer") +#@gui :Resize Interpolation=choice(3,"None","Nearest","Average","Bilinear","Grid","Bicubic") +#@gui :Reverse Blending Layers=bool(0) +#@gui :Dimensions=choice("Bottom Layer","Top Layer") +#@gui :Blend Alpha Channels=bool(0) +#@gui :Keep Mesh=bool(0) +#@gui Rendering +#@gui Crazy Texture:fx_crazy_texture,fx_crazy_texture_preview(1) +#@gui :_=note("Generates black and white textures using deformed edge offsets applied to Poisson-disk noise. The textures can range from smoothly-deformed and trippy to gnarled and wood-like.") +#@gui :0. Recompute=button(0) +#@gui :_=separator() +#@gui :_=note("Poisson-Disk Noise") +#@gui :1. Radius=float(75,1,1000) +#@gui :2. Max Sampling Attempts=int(30,1,200) +#@gui :_=separator() +#@gui :_=note("Edge Offsets") +#@gui :3. Smoothness=float(0,0,10) +#@gui :4. Threshold=float(15,0,50) +#@gui :5. Scale=int(6,0,64) +#@gui :6. Thickness=int(3,0,32) +#@gui :7. Negative Colors=bool(0) +#@gui :_=separator() +#@gui :_=note("Deform 1") +#@gui :_=note("Set matrix density to 1 for automatic size (coarse)") +#@gui :8. Strength=float(15,0,30) +#@gui :9. Interpolation=choice("None","Bilinear","Bicubic") +#@gui :10. Matrix Density (%)=float(1,1,100) +#@gui :11. Matrix Interpolation (%)=choice(1,"Bilinear","Bicubic") +#@gui :12. Matrix Contrast=float(0,-100,100) +#@gui :_=separator() +#@gui :_=note("Deform 2") +#@gui :_=note("Set matrix density to 1 for automatic size (fine)") +#@gui :13. Strength=float(1.5,0,30) +#@gui :14. Interpolation=choice("None","Bilinear","Bicubic") +#@gui :15. Matrix Density (%)=float(1,1,100) +#@gui :16. Matrix Interpolation (%)=choice(1,"Bilinear","Bicubic") +#@gui :17. Matrix Contrast=float(0,-100,100) +#@gui :_=separator() +#@gui :_=note("This can slow things down a lot if both deform strengths are high!") +#@gui :18. Accurate Boundaries=bool(1) +#@gui :19. Crop Strength=float(1,0,1) +#@gui Rectexture:fx_rectexture,fx_rectexture(1) +#@gui :_=note("Generates textures from rectangles, difference blending and warping.") +#@gui :Recompute=button() +#@gui :Iterations=int(10,0,500) +#@gui :Colours=choice(3,"Random Colours (Difference Blending)","Random Colours (Diffblend + Sine Mapping)","Random Colours (Diffblend + Sinemap + Random HSV Mixing)","Black and White") +#@gui :Warp Multiplier=float(1,0,5) +#@gui :Warp Boundary=choice(5,"Random","Random [non-Transparent]","Transparent","Nearest","Periodic","Mirror") +#@gui :Channel(s)=choice(2,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui __KaRo's Tests +#@gui About:_none_,karos_about +#@gui :_=note("KaRo's test files for G'MIC\n\written by") +#@gui :_=link("Karsten Rodenacker","http://K.Rodenacker.de") +#@gui :_=note("\n") +#@gui :_=note("The source code of this set of filters is located at :") +#@gui :_=link("https://github.com/GreycLab/gmic-community/blob/master/karsten_rodenacker.gmic") +#@gui :_=note("Some help can be found under ") +#@gui :_=link("http://karo03.bplaced.net/gmic/html/") +#@gui :_=separator() +#@gui :_=note{"Several operations here rely on external executables existing in search PATH ($PATH unter Mac/Unix). This means that the executable is downloaded or built and properly located on the local machine. E. g. CImg examples from github have to be built and copied to a location in the search path, (under unix /usr/local/bin). Similar with PINK executables. For Mac they have to be built according the README with ./makelin and PATH as to be extended by ..pink location../linux/bin."} +#@gui :_=separator() +#@gui :_=note(" CImg Skeleton: use_skeleton and \n CImg nlmeans: use_nlmeans in search PATH, sources are under: ") +#@gui :_=link("https://github.com/GreycLab/CImg/blob/master/examples/") +#@gui :_=note(" mM Differences: \n mathematical morphology operation differences\nmM operation size - mM operation size2") +#@gui :_=note(" oC Differences: \n mathematical morphology open/close differences\nmM open size - mM close size") +#@gui :_=note(" Pink operations binary: Pink applications in search PATH") +#@gui :_=link("https://perso.esiee.fr/~coupriem/Pink/doc/html/index.html") +#@gui :_=separator() +#@gui :_=note("\nThe functions defined are quite experimental and subject to changes. Please do not rely on the fact that they will perform equally forever.") +#@gui CImg NL-Means:fx_karo_cimg_nlmeans,fx_karo_cimg_nlmeans_preview(0) +#@gui :Add Gauss Noise=float(0.0,0.0,30.0) +#@gui :Add Uniform Noise=float(0.0,0.0,30.0) +#@gui :Add Salt & Pepper Noise=float(0.0,0.0,30.0) +#@gui :Half Size of Patch=int(1,1,15) +#@gui :Band Width Lambda=float(-1,-1,25) +#@gui :Noise SD Sigma=float(-1,-1,25) +#@gui :Neighborhood Size Alpha=int(3,1,15) +#@gui :Sampling Step Size=int(2,1,5) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note(Smoothing using CImg example plugin use_nlmeans.) +#@gui :_=note("CImg nlmeans: use_nlmeans in search PATH") +#@gui :_=separator() +#@gui :_=note("Author : KaRo. Latest update : 2019/09/03.") +#@gui CImg Skeleton:fx_karo_cimg_skel,fx_karo_cimg_skel_preview(0) +#@gui :Auto-Threshold=bool(1) +#@gui :Threshold (%)=float(50,0,100) +#@gui :Size Median=int(0,0,15) +#@gui :Invert=bool(false) +#@gui :Threshold on Flux=float(-0.3,-5,5) +#@gui :Medial Curve=bool(false) +#@gui :Torsello Correction=bool(false) +#@gui :Discrete Step=int(1,1,15) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note(Skeleton using CImg example plugin use_skeleton.) +#@gui :_=note("CImg Skeleton: use_skeleton in search PATH") +#@gui :_=separator() +#@gui :_=note("Author : KaRo. Latest update : 2012/10/26.") +#@gui MM Differences:fx_karo_mm_diff,fx_karo_mm_diff_preview(0) +#@gui :Size=int(5,1,25) +#@gui :Size2=int(7,1,25) +#@gui :Operation=choice(2,"Erosion","Dilation","Open","Close") +#@gui :Shape=choice(1,"Square","Octagon","Circle") +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Scale=bool(true) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Arithmetical difference of a morphological operation of size and size2.") +#@gui :_=separator() +#@gui :_=note("Author : KaRo. Latest update : 2012/10/26.") +#@gui OC Differences:fx_karo_oc_diff,fx_karo_oc_diff_preview +#@gui :Size=int(5,2,25) +#@gui :Shape=choice(1,"Square","Octagon","Circle") +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Scale=bool(true) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Difference of mean of morphological opening and closing with original.") +#@gui :_=separator() +#@gui :_=note("Author : KaRo. Latest update : 2013/07/04.") +#@gui Pink Operator:fx_karo_pink,fx_karo_pink_preview +#@gui :Pink Operator=choice("Wshedtopo","Wshedtopo Inv","Minima","Maxima","Heightminima","Heightmaxima","Grayskel","Htkern","Htkernu","Lvkern","Lvkernu","Saliency","Asf","Asflin","Asfr","Asft","Asftmed","Asftndg","Dilatballnum","Erosballnum","Lintophat") +#@gui :Connectivity / Dir=choice("Four/x","Eight/y") +#@gui :Smoothness=float(0,0,5) +#@gui :Height/Rep=int(5,0,25) +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=link("https://perso.esiee.fr/~coupriem/Pink/doc/html/") +#@gui Pink Operator Binary:fx_karo_pink_bin,fx_karo_pink_bin_preview +#@gui :Auto-Threshold=bool(1) +#@gui :Threshold (%)=int(50,0,100) +#@gui :Pink Operator=choice(3,"Skelpar","Skelend","Skelcurv","Skeleton","Barycentre","Border","Closeball","Openball","Convexhull","Dist","Distc","Label Pla","Lantuejoul") +#@gui :Connectivity / Dir=choice("Four/x","Eight/y") +#@gui :Height/Rep=int(5,-1,25) +#@gui :Algorithm=int(4,0,31) +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note(Binary operations with Pink externals.) +#@gui :_=note("Diverse Pink executables in search PATH") +#@gui :_=separator() +#@gui :_=note("Author : KaRo. Latest update : 2014/02/05.") +#@gui :_=link("https://perso.esiee.fr/~coupriem/Pink/doc/html/") +#@gui Pink Test Operator Bianca:fx_karo_pink_bianca,fx_karo_pink_bianca_preview(0) +#@gui :ASF Smooth Size=int(5,1,10) +#@gui :Threshold (%)=int(60,0,100) +#@gui :Watershed Height Min=int(5,0,20) +#@gui :Opening Radius=int(1,0,10) +#@gui :Invert=bool(0) +#@gui :Use G Instead of B=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note(Pink test operator Bianca for RGB image; only B used.) +#@gui :_=note("Pink executables in search PATH or C:\\Pink\\bin\\ for Windows") +#@gui :_=separator() +#@gui :_=note("Author : KaRo. Latest update : 2012/10/26.") +#@gui :_=link("https://perso.esiee.fr/~coupriem/Pink/doc/html/files.html") +#@gui _Lylejk +#@gui Blend [Shape Average]:fx_blend_shapeaverage,fx_blend_shapeaverage(0) +#@gui :Preserve Shading=bool(1) +#@gui :Transparency=bool(0) +#@gui :Revert Layers=bool(0) +#@gui :_=note("Note: This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2011/19/10.") +#@gui Lylejk Luma Invert:Lylejk_Luma_Invert,Lylejk_Luma_Invert_preview(0) +#@gui :_=note("Pow") +#@gui :Value=float(1,0.5,4) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: samj. Latest update: 2018/05/03.") +#@gui Lylejk Quantize Wicker:Lylejk_Quantize_Wicker,Lylejk_Quantize_Wicker_preview(0) +#@gui :_=note("Quantize") +#@gui :Levels=int(16,2,256) +#@gui :_=note("Offset") +#@gui :X (%)=float(50,0,100) +#@gui :Y (%)=float(50,0,100) +#@gui :Offset=choice(0,"No","Yes") +#@gui :_=note("Superpixels") +#@gui :Size=int(16,4,64) +#@gui :Regularity=float(10,0,128) +#@gui :Iterations=int(5,1,16) +#@gui :Colors=choice(1,"Random","Average") +#@gui :Border Opacity=float(1,0,1) +#@gui :Border Color=color(#000000ff) +#@gui :_=note("Dilate") +#@gui :Dilatation=int(1,1,16) +#@gui :_=note("Lylejk_Wicker Rodilius") +#@gui :Amplitude=float(10,0,30) +#@gui :Thickness=float(10,0,100) +#@gui :Sharpness=float(153,0,1000) +#@gui :_=note("Sharpen Deblur") +#@gui :Sharpen Deblur=bool(0) +#@gui :Radius=float(2,0,20) +#@gui :Iterations=int(10,0,100) +#@gui :Time Step=float(20,0,50) +#@gui :Smoothness=float(0.1,0,10) +#@gui :Regularization=choice(1,"Tikhonov","Mean Curvature","Total Variation") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Authors: Lylejk - samj. Latest update: 2018/04/06.") +#@gui Lylejk Ribbon:Lylejk_Ribbon,Lylejk_Ribbon_preview(0) +#@gui :_=link("http://gimpchat.com/viewtopic.php?f=11&t=16390","http://gimpchat.com/viewtopic.php?f=11&t=16390") +#@gui :_=note("Fake Smudge") +#@gui :Amplitude=float(150,0,1000) +#@gui :Sharpness=float(0.42,0,2) +#@gui :Anisotropy=float(0.85,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(7.83,0,10) +#@gui :Spatial Precision=float(0.68,0.1,2) +#@gui :Angular Precision=float(19,1,180) +#@gui :Value Precision=float(2.64,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(2,1,10) +#@gui :_=note("Diffusion tensors") +#@gui :Resolution (%)=float(16,0,20) +#@gui :Size=float(3.44,0,16) +#@gui :Color Mode=choice(0,"Monochrome","Grayscale","Orientation","Color") +#@gui :Outline=int(3,0,16) +#@gui :Sharpness=float(0.79,0,1) +#@gui :Anisotropy=float(0.72,0,1) +#@gui :Gradient Smoothness=float(4.97,0,10) +#@gui :Tensor Smoothness=float(1.70,0,10) +#@gui :_=note("Fake Smudge") +#@gui :Amplitude=float(150,0,1000) +#@gui :Sharpness=float(0.42,0,2) +#@gui :Anisotropy=float(0.85,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(7.83,0,10) +#@gui :Spatial Precision=float(0.68,0.1,2) +#@gui :Angular Precision=float(19,1,180) +#@gui :Value Precision=float(2.64,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(2,1,10) +#@gui :_=note("Gradient Norm 3") +#@gui :Smoothness=float(0,0,10) +#@gui :Linearity=float(0.32,0,1.5) +#@gui :Min Threshold=float(43.1,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=note("Upscale [dcci2x] by Garagecoder") +#@gui :Upscale=choice(2,"No","Yes","Yes and No") +#@gui :Threshold=float(1.15,1,2) +#@gui :Exponent=int(5,1,6) +#@gui :Extend 1px=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Authors: Lylejk - samj. Latest update: 2020/10/24.") +#@gui Lylejk Ripple:ripple,ripple(0) +#@gui :Amplitude=float(10,-100,100) +#@gui :Bandwidth=float(20,1,300) +#@gui :Shape=choice(2,"Bloc","Triangle","Sine","Sine+","Random") +#@gui :Angle=float(0,-360,360) +#@gui :Offset=float(0,-500,500) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2011/23/08.") +#@gui Lylejk Test TRW:lylejk_test_TRW,lylejk_test_TRW_preview(0) +#@gui :_=note("Offset") +#@gui :X (%)=float(50,0,100) +#@gui :Y (%)=float(50,0,100) +#@gui :Offset=choice(1,"A","B") +#@gui :_=note("Superpixels") +#@gui :Size=int(16,4,64) +#@gui :Regularity=float(10,0,128) +#@gui :Iterations=int(5,1,16) +#@gui :Colors=choice(1,"Random","Average") +#@gui :Border Opacity=float(1,0,1) +#@gui :Border Color=color(#000000ff) +#@gui :_=note("Euclidean - Polar") +#@gui :X-Center (%)=float(50,0,100) +#@gui :Y-Center (%)=float(50,0,100) +#@gui :Stretch Factor=float(1,0.1,10) +#@gui :Boundary=choice(1,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=note("Lylejk_Wicker") +#@gui :_=note("Rodilius") +#@gui :Amplitude=float(1.8,0,30) +#@gui :Thickness=float(10,0,100) +#@gui :Sharpness=float(153,0,1000) +#@gui :_=note("Fake Smudge") +#@gui :Amplitude=float(150,0,1000) +#@gui :Sharpness=float(0.42,0,2) +#@gui :Anisotropy=float(0.85,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(7.83,0,10) +#@gui :Spatial Precision=float(0.68,0.1,2) +#@gui :Angular Precision=float(19,1,180) +#@gui :Value Precision=float(2.64,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(1,1,10) +#@gui :_=note("Gradient Norm 1") +#@gui :Smoothness=float(0,0,10) +#@gui :Linearity=float(0.5,0,1.5) +#@gui :Min Threshold=float(10.5,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=note("Gradient Norm 2") +#@gui :Smoothness=float(0,0,10) +#@gui :Linearity=float(0.5,0,1.5) +#@gui :Min Threshold=float(10.5,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=note("Upscale [dcci2x] by Garagecoder") +#@gui :Threshold=float(1.15,1,2) +#@gui :Exponent=int(5,1,6) +#@gui :Extend 1px=bool(1) +#@gui :_=note("Gradient Norm 3") +#@gui :Smoothness=float(0.68,0,10) +#@gui :Linearity=float(0.5,0,1.5) +#@gui :Min Threshold=float(10.5,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=note("Option Lylejk stencil") +#@gui :Apply Lylejk Stencil=bool(0) +#@gui :Amplitude=int(1,1,10) +#@gui :Sharpness=float(10,0,100) +#@gui :Radius=float(1,0,10) +#@gui :Channel(s)=choice(0,"All","RGBA","RGB","Luminance","Blue/red Chrominances","Blue Chrominance","Red Chrominance","Lightness","Ab-Components","A-Component","B-Component","Hue","Saturation","Value","Key","Alpha","Ch-Components","C-Component","H-Component","Red","Green","Blue","Alpha") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Authors: Lyle Kroll - samj. Latest update: 2018/04/06.") +#@gui Lylejk Wicker:Lylejk_Wicker,Lylejk_Wicker_preview(0) +#@gui :_=link("https://github.com/GreycLab/gmic-community/blob/master/tutorial/WickerTute.pdf","https://github.com/GreycLab/gmic-community/blob/master/tutorial/WickerTute.pdf") +#@gui :_=note("Rodilius") +#@gui :Amplitude=float(10,0,30) +#@gui :Thickness=float(10,0,100) +#@gui :Sharpness=float(153,0,1000) +#@gui :_=note("Fake Smudge") +#@gui :Amplitude=float(150,0,1000) +#@gui :Sharpness=float(0.42,0,2) +#@gui :Anisotropy=float(0.85,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(7.83,0,10) +#@gui :Spatial Precision=float(0.68,0.1,2) +#@gui :Angular Precision=float(19,1,180) +#@gui :Value Precision=float(2.64,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(1,1,10) +#@gui :_=note("Gradient Norm 1") +#@gui :Smoothness=float(0,0,10) +#@gui :Linearity=float(0.5,0,1.5) +#@gui :Min Threshold=float(10.5,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=note("Gradient Norm 2") +#@gui :Smoothness=float(0,0,10) +#@gui :Linearity=float(0.5,0,1.5) +#@gui :Min Threshold=float(10.5,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=note("Upscale [dcci2x] by Garagecoder") +#@gui :Threshold=float(1.15,1,2) +#@gui :Exponent=int(5,1,6) +#@gui :Extend 1px=bool(1) +#@gui :_=note("Gradient Norm 3") +#@gui :Smoothness=float(0.68,0,10) +#@gui :Linearity=float(0.5,0,1.5) +#@gui :Min Threshold=float(10.5,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=note("Option Lylejk stencil") +#@gui :Apply Lylejk Stencil=bool(0) +#@gui :Amplitude=int(1,1,10) +#@gui :Sharpness=float(10,0,100) +#@gui :Radius=float(1,0,10) +#@gui :Channel(s)=choice(0,"All","RGBA","RGB","Luminance","Blue/red Chrominances","Blue Chrominance","Red Chrominance","Lightness","Ab-Components","A-Component","B-Component","Hue","Saturation","Value","Key","Alpha","Ch-Components","C-Component","H-Component","Red","Green","Blue","Alpha") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Lyle Kroll. Latest update: 2018/04/03.") +#@gui Lylejk Woven:Lylejk_Woven,Lylejk_Woven_preview(0) +#@gui :_=link("http://gimpchat.com/viewtopic.php?f=11&t=16384&start=10#p226895","http://gimpchat.com/viewtopic.php?f=11&t=16384&start=10#p226895") +#@gui :_=note("Ripple 1") +#@gui :Amplitude=float(19.6,-100,100) +#@gui :Bandwidth=float(32.4,1,300) +#@gui :Shape=choice(1,"Bloc","Triangle","Sine","Sine+","Random") +#@gui :Angle=float(0,-360,360) +#@gui :Offset=float(0,-500,500) +#@gui :_=note("Ripple 2") +#@gui :Amplitude=float(19.6,-100,100) +#@gui :Bandwidth=float(32.4,1,300) +#@gui :Shape=choice(1,"Bloc","Triangle","Sine","Sine+","Random") +#@gui :Angle=float(0,-360,360) +#@gui :Offset=float(0,-500,500) +#@gui :_=note("Superpixels") +#@gui :Size=int(12,4,64) +#@gui :Regularity=float(10,0,128) +#@gui :Iterations=int(5,1,16) +#@gui :Colors=choice(1,"Random","Average") +#@gui :Border Opacity=float(1,0,1) +#@gui :Border Color=color(#000000ff) +#@gui :_=note("Ripple 3") +#@gui :Amplitude=float(19.6,-100,100) +#@gui :Bandwidth=float(32.4,1,300) +#@gui :Shape=choice(1,"Bloc","Triangle","Sine","Sine+","Random") +#@gui :Angle=float(0,-360,360) +#@gui :Offset=float(0,-500,500) +#@gui :_=note("Ripple 4") +#@gui :Amplitude=float(19.6,-100,100) +#@gui :Bandwidth=float(32.4,1,300) +#@gui :Shape=choice(1,"Bloc","Triangle","Sine","Sine+","Random") +#@gui :Angle=float(0,-360,360) +#@gui :Offset=float(0,-500,500) +#@gui :_=note("Fake Smudge") +#@gui :Amplitude=float(150,0,1000) +#@gui :Sharpness=float(0.61,0,2) +#@gui :Anisotropy=float(0.85,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(7.83,0,10) +#@gui :Spatial Precision=float(0.68,0.1,2) +#@gui :Angular Precision=float(19,1,180) +#@gui :Value Precision=float(2.64,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(1,1,10) +#@gui :_=note("Gradient Norm") +#@gui :Smoothness=float(0,0,10) +#@gui :Linearity=float(0.29,0,1.5) +#@gui :Min Threshold=float(37.2,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :_=note("Options Start With ...") +#@gui :Start With Blur=bool(0) +#@gui :Blur=float(2,0,20) +#@gui :Start With Quantize=bool(0) +#@gui :Quantize Levels=int(16,2,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Lyle Kroll. Latest update: 2018/04/22.") +#@gui Lylejk's Stencil:fx_lylejk_stencil,fx_lylejk_stencil(0) +#@gui :Amplitude=int(5,1,10) +#@gui :Sharpness=float(10,0,100) +#@gui :Radius=float(3,0,10) +#@gui :Channel(s)=choice("All","RGBA","RGB","Luminance","Blue/red Chrominances","Blue Chrominance","Red Chrominance","Lightness","Ab-Components","A-Component","B-Component","Hue","Saturation","Value","Key","Alpha","Ch-Components","C-Component","H-Component","Red","Green","Blue","Alpha") +#@gui :_=separator() +#@gui :_=note("Authors: Lyle Kroll, David Tschumperlé. Latest update: 2010/29/12.") +#@gui Lylejk Wicker 2:Lylejk_Wicker_2,Lylejk_Wicker_2_preview(0) +#@gui :_=link("https://github.com/GreycLab/gmic-community/blob/master/tutorial/wicker_tut.pdf","https://github.com/GreycLab/gmic-community/blob/master/tutorial/wicker_tut.pdf") +#@gui :_=note("Applying the tutorial from page 1 to 8") +#@gui :_=separator() +#@gui :_=note("Offset") +#@gui :X (%)=float(50,0,100) +#@gui :Y (%)=float(50,0,100) +#@gui :Offset=choice(1,"No","Yes") +#@gui :_=note("Euclidean - Polar") +#@gui :X-Center (%)=float(50,0,100) +#@gui :Y-Center (%)=float(50,0,100) +#@gui :Stretch Factor=float(1,0.1,10) +#@gui :Boundary=choice(1,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=note("Superpixels") +#@gui :Size=int(12,4,64) +#@gui :Regularity=float(10,0,128) +#@gui :Iterations=int(5,1,16) +#@gui :Colors=choice(1,"Random","Average") +#@gui :Border Opacity=float(1,0,1) +#@gui :Border Color=color(#000000ff) +#@gui :_=note("Fake Smudge") +#@gui :Amplitude=float(150,0,1000) +#@gui :Sharpness=float(0.54,0,2) +#@gui :Anisotropy=float(0.85,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(7.83,0,10) +#@gui :Spatial Precision=float(0.68,0.1,2) +#@gui :Angular Precision=float(19,1,180) +#@gui :Value Precision=float(2.64,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(3,1,10) +#@gui :_=note("Gradient Norm") +#@gui :Smoothness=float(0,0,10) +#@gui :Linearity=float(0.29,0,1.5) +#@gui :Min Threshold=float(28.7,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Improve Contrast") +#@gui :Apply a Contrast=choice(0,"No","Sharpen Deblur","Improve Contrast By Lyle Kroll") +#@gui :_=separator() +#@gui :_=note("Sharpen Deblur") +#@gui :Radius=float(1,0,20) +#@gui :Iterations=int(10,0,100) +#@gui :Time Step=float(20,0,50) +#@gui :Smoothness=float(0.1,0,10) +#@gui :Regularization=choice(1,"Tikhonov","Mean Curvature","Total Variation") +#@gui :_=separator() +#@gui :_=note("Improve Contrast By Lyle Kroll") +#@gui :_=note("Smooth Bilateral Contrast") +#@gui :Spatial Variance=float(10,0,100) +#@gui :Value Variance=float(12,0,100) +#@gui :Iterations=int(2,1,10) +#@gui :_=note("Fake Smudge Contrast") +#@gui :Amplitude=float(40,0,1000) +#@gui :Sharpness=float(0.7,0,2) +#@gui :Anisotropy=float(0.3,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(1.1,0,10) +#@gui :Spatial Precision=float(0.8,0.1,2) +#@gui :Angular Precision=float(30,1,180) +#@gui :Value Precision=float(2,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(3,1,10) +#@gui :_=note("Grain Merge Contrast") +#@gui :Amplitude=float(1,0,1) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Option Start With Quantize") +#@gui :Quantize=choice(0,"No","Yes") +#@gui :Levels=int(16,2,256) +#@gui :_=note("Option Euclidian To Polar") +#@gui :Euclidian To Polar=choice(1,"No","Yes") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Lyle Kroll. Latest update: 2018/04/07.") +#@gui Point Star Outline:garagecoder_lylejk_samj_points_outlines,garagecoder_lylejk_samj_points_outlines_preview(0) +#@gui :_=link("https://discuss.pixls.us/t/place-some-points-on-outlines-with-gmic/7006/5","https://discuss.pixls.us/t/place-some-points-on-outlines-with-gmic/7006/5") +#@gui :_=note("Choice Filter") +#@gui :Choice Filter=choice(0,"Garagecoder Staroutline","Garagecoder Pointoutline","Samj") +#@gui :_=note("Garagecoder Staroutline") +#@gui :Less Than Staroutline=float(0.05,0,0.5) +#@gui :Shapecloud=int(10,3,20) +#@gui :_=note("Garagecoder Pointoutline") +#@gui :Less Than Pointoutline=float(0.12,0,0.5) +#@gui :_=note("samj") +#@gui :Determination Contours=int(0,0,2) +#@gui :Type Rendu=int(0,0,2) +#@gui :Dilatation=int(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Authors: Garagecoder - Lyle Kroll - samj. Latest update: 2018/04/04.") +#@gui _Marcos Capelini +#@gui Film Grain:mc_film_grain,mc_film_grain_preview(0)* +#@gui :_=note("Grain Pattern") +#@gui :Grain Pattern File:=file() +#@gui :Texture Generator:=choice("Syntexturize","Patch Matching") +#@gui :_=separator() +#@gui :_=note("Blend") +#@gui :Blend Mode:=choice(1,"Grain Only","Grain Merge","Overlay","Soft Light","Hard Light","Alpha") +#@gui :Opacity (%):=float(20,0,100) +#@gui :_=separator() +#@gui :_=note("Grain Size") +#@gui :Film Format:=choice(0,"135 (35mm)","135 Half-Frame (Olympus PEN)","110 (Pocket Instamatic)","120 (Medium Format)","APS (H,C,P Auto-Detect)") +#@gui :Scale (%):=int(100,20,300) +#@gui :Micrograin:=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Grain Appearance") +#@gui :Blur/Sharpen:=float(0,-10,10) +#@gui :Contrast:=int(0,-100,100) +#@gui :Gamma:=int(0,-50,50) +#@gui :_=separator() +#@gui :_=note("Grain Normalise/Cut") +#@gui :Mode:=choice(1,"None","Normalise","Cut") +#@gui :Lowest Value:=int(0,0,127) +#@gui :Highest Value:=int(255,128,255) +#@gui :_=separator() +#@gui :_=note("Image Adustments") +#@gui :Blur/Sharpen:=float(0,-10,10) +#@gui :Highlight Compression:=float(0,0,10) +#@gui :_=separator() +#@gui :Preview:=choice("Filter Output","Grain Only","Filter Output + Debug Info","Grain Only + Debug Info") +#@gui :_=separator() +#@gui :_=note("Author: Marcos Capelini. Latest Update: 2023/04/25") +#@gui :_=note("Based on the \"Add Grain\" filter by: David Tschumperlé.") +#@gui :_=note("\n") +#@gui :Show Usage Tips=button(2) +#@gui _McCap +#@gui Hue Overlay Masks:fx_hue_overlay_masks,fx_hue_overlay_masks_preview(0) +#@gui :_=note("This plugin creates RGB hue masks. They are be exported in overlay mode into Gimp. Try each one to see how it changes your picture. Alternatively you can use them as masks to select regions based on hue.") +#@gui :_=separator() +#@gui :Stretch Constrast=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice(5,"Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui :_=separator() +#@gui :_=note("More details here.") +#@gui :_=separator() +#@gui :_=note("Author: McCap/pixls.us. Latest update: 2017/09/02.") +#@gui _Naggobot +#@gui Abstract Flood:fx_AbstractFlood,fx_AbstractFlood_Preview(1) +#@gui :_=separator() +#@gui :_=note("Warning: Really really slow filter especially with Cubism enabled. Use a maximum of 1 megapixel image. Random walk algorihm is used to select new areas to flood. If Cubism is enabled the filter has to run cubims for every succesful repeat defined in the flood settings section.") +#@gui :Preprocess with Bilateral Filtering=bool(1) +#@gui :Spatial Variance=float(10,0,100) +#@gui :Value Variance=float(7,0,100) +#@gui :Iterations=int(2,1,10) +#@gui :_=separator() +#@gui :_=note("Flood settings") +#@gui :Activate Flood=bool(0) +#@gui :Repeats=int(10,1,1000) +#@gui :Flood Tolerance=int(5,0,100) +#@gui :Flood Base Step=int(3,1,10) +#@gui :Canvas Color=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("Abstraction setting, Consider disabling preview if using high flood repeats!") +#@gui :Activate Cubism=bool(0) +#@gui :Cubism Iterations=int(300,1,2000) +#@gui :Bloc Size=float(10,0,40) +#@gui :Angle=float(90,0,360) +#@gui :Opacity=float(0.7,0.01,1) +#@gui :Smoothness=float(0,0,5) +#@gui :_=note("Opacity threshold used to make decision about flooding. Use 0 if Cubism is not enabled.") +#@gui :Opacity Tolerance=int(0,0,254) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2013/09/28.") +#@gui :_=link("Filter Explained here","http://www.flickr.com/photos/naggobot/6243715666") +#@gui Black & White Film:fx_bwfilmsimulate,fx_bwfilmsimulate_preview(1) +#@gui :Film Type / RGB Balance=choice(0,"Manual","Agfa 200X","Agfapan 25","Agfapan 100","Agfapan 400","Iford Delta 100","Iford Delta 400","Iford Delta 400 Pro & 3200","Ilford FP4","Ilford HP4","Ilford Pan F","Ilford SFX","Ilford XP2 Super","Kodak Tmax 100","Kodak Tmax 400","Kodak Tri-X") +#@gui :_=note("Simpler version available in main tree. This filter will be removed in future from testing. PM me if you need this for some reason.") +#@gui :_=note("RGB sliders work only with manual selection") +#@gui :Red Level=float(0.299,0,1) +#@gui :Red Smoothness=float(0,0,10) +#@gui :Green Level=float(0.587,0,1) +#@gui :Green Smoothness=float(0,0,10) +#@gui :Blue Level=float(0.114,0,1) +#@gui :Blue Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Gamma=float(1,0.01,5) +#@gui :Contrast=float(1,0,4) +#@gui :Brightness=float(0,-255,255) +#@gui :Hue=float(0,0,360) +#@gui :Saturation=float(0,0,1) +#@gui :_=separator() +#@gui :Grain (Shadows)=float(0,0,200) +#@gui :Grain (Midtones)=float(0,0,200) +#@gui :Grain (Highlights)=float(0,0,200) +#@gui :Grain Tone Fading=float(2,0,10) +#@gui :Grain Scale=float(0,0,3) +#@gui :Grain Type=choice("Gaussian","Uniform","Salt and Pepper","Poisson") +#@gui :_=separator() +#@gui :Local Contrast=float(0,0,60) +#@gui :Radius=int(16,1,512) +#@gui :Contrast Smoothness=float(4,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : David Tschumperlé, Arto Huotari;. Latest update : 2019/09/28.") +#@gui __Artistic +#@gui Blockism:fx_blockism,fx_blockism_preview(1) +#@gui :_=note("Renders rectangles on to the image.") +#@gui :_=note("Parameters") +#@gui :Relative Size=float(3,0,20) +#@gui :Ratio=float(1.6,1,10) +#@gui :Size Variance=float(0.5,0,10) +#@gui :Relative Block Count=int(50,0,500) +#@gui :Opacity=float(0.5,0,1) +#@gui :Flip Tolerance=int(64,0,255) +#@gui :Reverse Flip=bool(0) +#@gui :Colorspace=choice("Lab","RGB") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=link("Filter Explained here","http://www.flickr.com/photos/naggobot/8063058705/") +#@gui :_=separator() +#@gui :_=note(" Author: Arto Huotari Latest update : 2012/10/07.") +#@gui _Testing +#@gui Naggobot +#@gui Composition Analysis:fx_CompositionAnalysis,fx_no_preview +#@gui :_=note("A tool to abstract the image for subjective composition analysis. Two different methods are available. Set filter output to New layers. For actual analysis the aesthetic sense of the artist is required.") +#@gui :Method=choice(0,"Thumbnail Abstraction","Value and Lines") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2015/01/17.") +#@gui Dodge Sketch:fx_dodgesketch,fx_dodgesketchpreview(0) +#@gui :_=note("Simple BW sketch") +#@gui :_=link("Method is described here","http://www.gimpusers.com/tutorials/making-a-pencil-drawing-from-a-photo.html") +#@gui :_=note("in addition an option to color the sketch is included") +#@gui :_=separator() +#@gui :_=note("Power setting for sketch") +#@gui :Power=int(3,0,10) +#@gui :_=separator() +#@gui :_=note("Presmoothing settins of bilateral filter") +#@gui :Spatial Variance=float(10,0,100) +#@gui :Value Variance=float(7,0,100) +#@gui :Iterations=int(2,1,10) +#@gui :_=separator() +#@gui :Colored?=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2013/09/28.") +#@gui Exposure Fusion Weight Map:fx_ExposureWeightMap,fx_ExposureWeightMapPreview(1) +#@gui :_=separator() +#@gui :_=note("Create exposure fusion weight map") +#@gui :_=separator() +#@gui :_=note("Set filter output to "New layers". Copy filter output to corresponding layer mask. Use aligned layers to combine multiple exposures.") +#@gui :_=separator() +#@gui :Contrast Bias=float(0.3,0,1) +#@gui :Saturation Bias=float(0.3,0,1) +#@gui :Exposure Sigma=float(0.2,0,1) +#@gui :Exposure Bias=float(0.3,0,1) +#@gui :BlurMap=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note(" Author: Arto Huotari Latest update : 2014/11/30 v2.") +#@gui GMic Structure Tensors:fx_StructureTensors,fx_StructureTensorsPreview(0) +#@gui :_=separator() +#@gui :_=note("Structure tensors calculation for Gimp plugin. This is just an interface to built in GMic Structure tensors command") +#@gui :Power=float(0.1,0.1,2) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2011/12/06.") +#@gui Import 16bits Image:fx_import_image_16,fx_import_image_16 +#@gui :_=note("Filter can be used to import and adjust 16 bit images to Gimp. Plugin may have limited set of import formats available depending on compilation. At minimum only .png should work reliably.") +#@gui :_=note("1. Create new empty image to Gimp") +#@gui :_=note("2. Open G'Mic from filters menu") +#@gui :_=note("3. Set G'Mic output to "new layers") +#@gui :_=note("4. Select 16 bit image from folder") +#@gui :_=note("5. Make adjustments using sliders") +#@gui :_=note("6. Image will be outputted to Gimp") +#@gui :_=note("By default a scaled down image is processed. Before processing full size disable preview window from gui.") +#@gui :_=note("LAB adjustment often yields more aesthetic results than RGB adjustment.") +#@gui :Input Image=file() +#@gui :Process Selection=choice(1,"Preview Only","Histogram","Logarithmic Histogram","Full Resolution") +#@gui :Gamma=float(2.2,0,5) +#@gui :_=separator() +#@gui :_=note("LAB adjustment") +#@gui :Brightness=float(0,-1,1) +#@gui :Contrast=float(1,0,3) +#@gui :Equalize=float(0,0,1) +#@gui :Saturation=float(0,-1,10) +#@gui :A(R-G)=float(0,-1,1) +#@gui :B(Y-B)=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("RGB cut and normalize histogram by percentage") +#@gui :Cut Highlight Values=float(100,0,100) +#@gui :Cut Dark Values=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("Author: Arto Huotari;. Latest update: 2014/04/02.") +#@gui Luminance to Alpha:fx_split_luminance,fx_split_luminance(1) +#@gui :_=note("Filter splits image to different levels of Luminance. Set preview output to "all outputs". Order of output to Gimp from top to bottom is Midtones,Light,LL,..,Dark,DD,.. If reduced overlap is used then first Light layer is removed from output as redundant if more than one level is processed. Mutilevel output becomes Midtones,,LL,LLL,..,Dark,DD,DDD.. with intermediary light and dark levels containing midtones. ") +#@gui :_=separator() +#@gui :Levels=int(1,1,6) +#@gui :Output as Alpha=bool(1) +#@gui :Reduce Overlap=bool(1) +#@gui :_=separator() +#@gui :_=note("Use keep[] or remove[] to select output images") +#@gui :Keep Custom=bool(0) +#@gui :Keep Custom=text(0,keep.) +#@gui :_=separator() +#@gui :_=note("Author: Arto Huotari;. Latest update: 2014/04/13.") +#@gui Make Old Squiggly:fx_OldSquiggly,fx_OldSquiggly +#@gui :_=note("Development version. This version will be removed in future from sources so if you prefer this then copy and save the source to your local .gmic file") +#@gui :Spread Noise Amount=float(2,0,20) +#@gui :Segmentation Edge Threshold=float(12,0,15) +#@gui :Segmentation Smoothness=float(0.8,0,5) +#@gui :GradienNormSmoothness=float(0,0,10) +#@gui :GradienNormLinearity=float(0.5,0,1.5) +#@gui :IncreaseChroma1=float(3,1,4) +#@gui :Tone Threshold=float(0.2,0,1) +#@gui :Tone Gamma=float(0.4,0,1) +#@gui :Paper Grayness=int(50,0,255) +#@gui :Paper Whiteness=int(245,0,255) +#@gui :Squiggle Gamma=int(45,1,128) +#@gui :Squiggle Multiplier=float(0.5,0,1) +#@gui Mapped Smoothing:fx_MappedSmooth,fx_MappedSmooth +#@gui :_=separator() +#@gui :_=note("Two layers required if automap is not used. Set input to active and below. Filter Smooths image with a vector field map. Map is created from R and G channels so that R128,G128 becomes [0 0]. Experiment with solid 128,128,0 color layer and add hues of red and green. Angle shift rotates the vector field and Zero point offset moves the default 0 0 point. This is somewhat a development version, sample art is still missing.") +#@gui :_=separator() +#@gui :Map Type=choice("Automap","Layer Map") +#@gui :Angle Shift=float(0,-180,180) +#@gui :Zero Point Offset=float(0,-128,128) +#@gui :Amplitude=float(300,10,10000) +#@gui :Vector Length Multipler=float(1,0.1,5) +#@gui :_=separator() +#@gui :_=note("Optional viewing of vector field") +#@gui :Show Quiver=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2012/02/25.") +#@gui Night HDR Image Black Noise Correction:fx_fix_HDR_black,fx_fix_HDR_black_preview(0) +#@gui :_=note("Filter to remove blue, magenta and red noise from the black areas of HDR images. Filter is designed specifically for HDR night shots but may work on other images as well. Bilateral filtering and Haar Wavelets are used to filter the noise from the image and mask is used to apply the noise removal only to dark areas.") +#@gui :_=separator() +#@gui :_=note("Mask opacity settings, Black values must be lower than Highlight values. Tick Show mask to view mask and to see the effect of the sliders.") +#@gui :_=note("Black cutoff") +#@gui :X-Coord(1)=int(20,0,255) +#@gui :Y-Coord(1)=int(25,0,255) +#@gui :_=note("Highlight raising") +#@gui :X-Coord(2)=int(50,0,255) +#@gui :Y-Coord(2)=int(200,0,255) +#@gui :Show Mask=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note(" Author: Arto Huotari Latest update : 2013/11/02.") +#@gui Noise Painting:fx_noisepainting,fx_noisepainting_preview(0) +#@gui :_=note("A preprocess suggestion for the painting filter.") +#@gui :_=separator() +#@gui :_=note("Pre process for painting") +#@gui :Spread Noise=int(0,0,20) +#@gui :Additive Noise=int(0,0,30) +#@gui :Luminance Only=bool(0) +#@gui :_=separator() +#@gui :_=note("Painting abstration") +#@gui :Abstraction=int(5,1,10) +#@gui :Details Scale=float(2.5,0,5) +#@gui :Color=float(1.5,0,4) +#@gui :Smoothness=float(50,0,1000) +#@gui :Sharpen Shades=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note(" Author: Arto Huotari Latest update : 2012/07/12.") +#@gui Smooth Sketch:fx_SmoothSketch,fx_SmoothSketch_preview(0) +#@gui :_=note("Convert image to black and white sketch. By default gradient edges are used but if filter input set to Active and Below a premade edge layer can be used from the layer below. Sketch strength slider will not have any effect if premade edges layer is used.") +#@gui :_=separator() +#@gui :_=note("Sketch and edges") +#@gui :Create Sketch=bool(1) +#@gui :Sketch Strength=float(6,0,20) +#@gui :Sharpness=float(0.8,0,1) +#@gui :Anisotropy=float(0.3,0.1,1) +#@gui :Smoother Scaling=float(0.3,0.1,2.5) +#@gui :Smoother Degradation=float(0,0,1) +#@gui :Smoothing Amplitude=float(1000,1,3000) +#@gui :Smudge Angle=float(0,-180,180) +#@gui :_=separator() +#@gui :_=note("Empty area coloring") +#@gui :Coloring Density=float(50,0,200) +#@gui :Coloring Stroke Length=float(10,0,100) +#@gui :Coloring Style=choice(2,"Linear","Angular","Linear Wavy","Angular Wavy") +#@gui :Coloring Opacity=float(0.6,0,1) +#@gui :_=separator() +#@gui :_=note("Post processing parameters") +#@gui :Post Gamma=float(0.55,0.1,2) +#@gui :Fast=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2014/08/31.") +#@gui :_=link("Filter Explained here","http://www.flickr.com/groups/gmic/discuss/72157628307225747") +#@gui Vector Field Rotation Demo:fx_DemoVecRot,fx_DemoVecRot +#@gui :_=note("Vector field rotation and quiver sample") +#@gui :Angle Shift=float(0,-180,180) +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari with help from David Tschumperlé. Latest update : 2012/02/25.") +#@gui Warp Test:fx_WarpTest,fx_WarpTest +#@gui :_=separator() +#@gui :_=note("Two layers required if automap is not used. Set input to active and below. Filter offsetts image with a vector field map. Map is created from R and G channels so that R128,G128 becomes [0 0]. Experiment with solid 128,128,0 color layer and add hues of red and green. Angle shift rotates the vector field and Zero point offset moves the default 0 0 point. This is mainly for fun and testing.") +#@gui :_=separator() +#@gui :Map Type=choice("Automap","Layer Map") +#@gui :Angle Shift=float(0,-180,180) +#@gui :Zero Point Offset=float(0,-128,128) +#@gui :Vector Length Multipler=float(1,0.1,128) +#@gui :_=separator() +#@gui :_=note("Optional viewing of vector field") +#@gui :Show Quiver=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2012/02/28.") +#@gui _Okyl168 +#@gui Jobs Colors:fx_jobs_colors,fx_jobs_colors_preview +#@gui :Gamma=float(0,-2,2) +#@gui :Equalize=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Oberon Leung. Latest update: 2014/25/01.") +#@gui _PhotoComix +#@gui B&W Steampunk Pencil:fx_steampen,fx_steampen_preview(0) +#@gui :_=separator() +#@gui :Radius=float(0.95,0,4) +#@gui :Amplitude=float(14,0,200) +#@gui :Iterations=int(2,1,20) +#@gui :Steam Pressure=int(2,1,30) +#@gui :Lubrication=float(0.9,0,1.9) +#@gui :_=separator() +#@gui :Contrast FX=choice("None-Skip","L Normalization","Mask","Boost","Fast Tone Map") +#@gui :Equalize=bool(true) +#@gui :_=separator() +#@gui :_=note("For a more 'painted' effect") +#@gui :Add Painter's Touch=bool(false) +#@gui :_=note("If unchecked the 3 sliders below are disabled") +#@gui :_=separator() +#@gui :Painter's Touch Sharpness=float(0.5,0,2) +#@gui :Painter's Edge Protection Flow=float(0.75,0,1) +#@gui :Painter's Smoothness=float(0.48,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Last update : 2011/6/29 .") +#@gui Boost Screen:fx_compose_boostscreen,fx_compose_boostscreen +#@gui :Opacity=float(0.7,0,1) +#@gui :Revert Layers=bool(0) +#@gui :Opacity 2=float(0.7,0,1) +#@gui :_=note("This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Color Doping:fx_compose_colordoping,fx_compose_colordoping +#@gui :Opacity=float(1,0,1) +#@gui :Revert Layers=bool(0) +#@gui :_=note("This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Color Sketch:fx_colorsketchbw,fx_colorsketchbw_preview(0) +#@gui :Amplitude=float(300,0,4000) +#@gui :Density=float(50,0,100) +#@gui :Smoothness=float(1,0,10) +#@gui :Opacity=float(0.1,0,1) +#@gui :Edge=float(20,0,100) +#@gui :Fast Approximation=bool(1) +#@gui :Negative=bool(0) +#@gui :Quantize Colors=int(20,2,255) +#@gui :Color Smoothness=float(2,0.50,30) +#@gui :Mixer Mode=choice("Color Doping","Darken","Hard Light","Grain Merge","Lightness","Multiply","Value") +#@gui :Color Intensity=float(1,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2010/29/12.") +#@gui Color Stamp:fx_colorstamp,fx_colorstamp_preview(0) +#@gui :_=note("BW module,analog to Stamp filter") +#@gui :_=separator() +#@gui :Auto-Threshold=bool(1) +#@gui :Threshold=int(50,0,100) +#@gui :_=separator() +#@gui :_=note("Color module") +#@gui :Activate Color Module=bool(1) +#@gui :Quantize Colors=int(20,2,255) +#@gui :Color Smoothness=float(2,0,20) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Authors: PhotoComiX , Antaron, Mahvin, David Tschumperlé. Latest update : 2011/17/05.") +#@gui Comix Colors:fx_compose_comix_color,fx_compose_comix_color +#@gui :Opacity=float(1,0,1) +#@gui :Revert Layers=bool(0) +#@gui :Opacity 2=float(1,0,1) +#@gui :_=note("This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Dark Edges:fx_compose_darkedges,fx_compose_darkedges(0) +#@gui :Opacity=float(1,0,1) +#@gui :Edges Smoothness=float(0.5,0,5) +#@gui :Revert Layers=bool(0) +#@gui :Opacity 2=float(0.7,0,1) +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Dark Screen:fx_compose_darkscreen,fx_compose_darkscreen +#@gui :Opacity=float(0.7,0,1) +#@gui :Revert Layers=bool(0) +#@gui :Opacity 2=float(0.7,0,1) +#@gui :_=note("This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Graphic Boost-Old:fx_graphic_boost,fx_graphic_boost_preview(0) +#@gui :_=separator() +#@gui :_=note("Unsharp Mask controls") +#@gui :Radius=float(1.25,0,20) +#@gui :Darken=float(2,0,10) +#@gui :_=separator() +#@gui :Skip Others Steps=bool(false) +#@gui :_=note("Check for visual control, UNcheck to reactivate the other controls") +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("BW_Pencil Controls") +#@gui :Pencil Size=float(0.15,0,4) +#@gui :Pencil Amplitude=float(14,0,200) +#@gui :_=separator() +#@gui :Skip Others Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :Activate 'Pencil Smoother'=bool(true) +#@gui :_=note("If unchecked the 3 sliders below are disabled") +#@gui :Pencil Smoother Sharpness=float(0.5,0,2) +#@gui :Pencil Smoother Edge Protection=float(0.45,0,1) +#@gui :Pencil Smoother Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Skip Others Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Merging Options") +#@gui :Swap Layers=bool(True) +#@gui :_=note("'Swap' change the effect of Merging and Intensity") +#@gui :Merging Option=choice("Hard Light","Grain Merge","Multiply","Color Burn","Overlay","Value","Darken","Stamp") +#@gui :Intensity=float(1,0,1) +#@gui :_=separator() +#@gui :Add Painter's Touch=bool(true) +#@gui :_=note("If unchecked the 3 sliders below are disabled") +#@gui :_=separator() +#@gui :Painter's Touch Sharpness=float(0.5,0,2) +#@gui :Painter's Edge Protection Flow=float(0.45,0,1) +#@gui :Painter's Smoothness=float(1,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/10/01.") +#@gui :_=link("Filter explained here","http://www.gimpchat.com/viewtopic.php?f=9&t=775") +#@gui Graphic Colors:fx_compose_graphicolor,fx_compose_graphicolor +#@gui :Opacity=float(0.6,0,1) +#@gui :Revert Layers=bool(0) +#@gui :Opacity 2=float(0.8,0,1) +#@gui :_=note("This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Graphic Novel-Old:fx_novelfx,fx_novelfx_preview(0) +#@gui :_=separator() +#@gui :_=note("Apply Local Normalization") +#@gui :Skip This Step=bool(false) +#@gui :_=separator() +#@gui :_=note("Local Normalization Controls") +#@gui :LN Amplititude=float(2,0,60) +#@gui :LN Size=float(6,0,64) +#@gui :LN Neightborhood-Smoothness=float(5,0,40) +#@gui :LN Average-Smoothness=float(20,0,40) +#@gui :_=separator() +#@gui :Skip All Other Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Pencil Options") +#@gui :Pencil Size=float(0.62,0,4) +#@gui :Pencil Amplitude=float(14,0,200) +#@gui :_=separator() +#@gui :Skip All Other Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :Activate 'Pencil Smoother'=bool(true) +#@gui :_=note("If unchecked the 3 sliders below are disabled") +#@gui :_=separator() +#@gui :Pencil Smoother Sharpness=float(0.5,0,2) +#@gui :Pencil Smoother Edge Protection=float(0.78,0,1) +#@gui :Pencil Smoother Smoothness=float(1.92,0,10) +#@gui :_=separator() +#@gui :Skip All Other Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Boost Merging Options") +#@gui :Swap Layers=bool(false) +#@gui :Boost Merging Option=choice("Overlay","Multiply","Soft Light","Color Burn","Darken","Stamp","Hard Light","Value","Grain Merge","Freeze") +#@gui :Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :Add Painter's Touch=bool(true) +#@gui :_=separator() +#@gui :Painter's Touch Sharpness=float(0.5,0,2) +#@gui :Painter's Edge Protection Flow=float(0.8,0,1) +#@gui :Painter's Smoothness=float(1.28,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/24/04.") +#@gui :_=link("Filter explained here","http://www.gimpchat.com/viewtopic.php?f=9&t=1582") +#@gui GraphiX Colors:fx_compose_graphixcolor,fx_compose_graphixcolor +#@gui :Opacity=float(1,0,1) +#@gui :Revert Layers=bool(0) +#@gui :_=note("This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Heavy Screen:fx_compose_heavyscreen,fx_compose_heavyscreen +#@gui :Opacity=float(0.6,0,1) +#@gui :Revert Layers=bool(0) +#@gui :Opacity 2=float(0.7,0,1) +#@gui :_=note("This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Metallic Grain:fx_metalgrain,fx_metalgrain_preview +#@gui :_=note("add a metallic grain adapt to pictorial and special effects") +#@gui :_=separator() +#@gui :_=note("dependent from 'Couleurs Metalliques' by Samj") +#@gui :_=separator() +#@gui :Intensity=float(0.5,0.1,1) +#@gui :Swap Layers=bool(false) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComix,a hack of a Samj filter. Latest update : 2012/29/02.") +#@gui Metallic Stencils:fx_metallicstencils,fx_metallicstencils_preview +#@gui :Set Mode=choice("Darken","Lighten","Overlay") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComix,a hack of a Samj filter. Latest update : 2012/03/10.") +#@gui Phoenix Steam-Pencil:fx_phoenix,fx_phoenix_preview(0) +#@gui :_=separator() +#@gui :_=note("Controls for 'Pencil' applied on a copy of original) +#@gui :_=separator() +#@gui :Radius=float(0.95,0,4) +#@gui :Amplitude=float(14,0,200) +#@gui :_=separator() +#@gui :_=note("Controls for 'Steam' applied on the Pencil layer) +#@gui :_=separator() +#@gui :Iterations=int(2,1,7) +#@gui :Steam Pressure=int(2,1,7) +#@gui :Lubrication=float(0.9,0,1.9) +#@gui :_=separator() +#@gui :_=note("To exit here or merge with the original") +#@gui :BW or Colours=choice("Black and White","Colours") +#@gui :_=note("to activate the Merging Options below chose 'Colours'") +#@gui :_=separator() +#@gui :Swap Layers=bool(0) +#@gui :Merging Options=choice("Value","Lightness","Luminance","*Colors Doping*","*Comix Colors*","Graphic Colors*",*Dark Edges*","*Vivid Edges*","Multiply","Color Burn","Darken","Lighten","Hard Light","Soft Light","Overlay","Grain Merge","Edges","Interpolation") +#@gui :Opacity=float(1,0,1) +#@gui :*Intensity*=float(1,0,1) +#@gui :_=separator() +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Last update : 2011/11/14 .") +#@gui :_=link("Filter how to and help","http://www.gimpchat.com/viewtopic.php?f=9&t=2983") +#@gui PhotoComiX Smoothing:fx_smooth_anisotropic,fx_smooth_anisotropic(0) +#@gui :Amplitude=float(60,0,1000) +#@gui :Sharpness=float(0.16,0,2) +#@gui :Anisotropy=float(0.63,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(2.35,0,10) +#@gui :Spatial Precision=float(0.8,0.1,2) +#@gui :Angular Precision=float(30,1,180) +#@gui :Value Precision=float(2,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(1,1,10) +#@gui :Channel(s)=choice("RGB","Luminance","Blue & Red Chrominances","Blue Chrominance","Red Chrominance") +#@gui :Tiles=int(1,1,10) +#@gui :_=note("\nNote : This set of anisotropic smoothing parameters has been suggested by PhotoComiX.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2010/29/12.") +#@gui Psychedelic Glasswork Tiler:fx_psyglass,fx_psyglass_preview(1) +#@gui :_=separator() +#@gui :_=note("Stained Glass controls") +#@gui :White Separators=bool(false) +#@gui :Edges=float(20,0,100) +#@gui :Shading=float(0.1,0,0.5) +#@gui :Thin Separators=bool(1) +#@gui :Equalize=bool(1) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("To skip Layer Fx set Opacity to 0") +#@gui :_=separator() +#@gui :Layer Fx=choice("Grain Merge","Hard Light","Soft Light","Overlay","Color Burn","Multiply") +#@gui :Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Quick Corrections and Special Fx") +#@gui :Apply Mask=bool(true) +#@gui :_=note("Contrast Mask preset") +#@gui :_=separator() +#@gui :Raise Local Contrast=bool(false) +#@gui :_=note("Local Normalization preset") +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Mirrors Controls") +#@gui :Activate Mirrors=bool(true) +#@gui :_=separator() +#@gui :Iterations=int(1,1,10) +#@gui :X-Offset=float(0,0,100) +#@gui :Y-Offset=float(0,0,100) +#@gui :Array Mode=choice(2,"X-Axis","Y-Axis","XY-Axes","2XY-Axes") +#@gui :Initialization=choice("Original","Mirror X","Mirror Y","Rotate 90 Deg.","Rotate 180 Deg.","Rotate 270 Deg.") +#@gui :Expand Size=_bool(false) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/30/03.") +#@gui Scale Down Neat:fx_scaledown3,fx_scaledown3_preview(0) +#@gui :_=separator() +#@gui :_=note("To scale down preserving clean edges and smoothly sharpen") +#@gui :_=separator() +#@gui :Automatic Pre-Blur=bool(false) +#@gui :_=separator() +#@gui :_=note("Automatic pre-blur disable the 2 sliders below") +#@gui :_=separator() +#@gui :Blur X=float(1,0.2,4) +#@gui :Blur Y=float(1,0.2,4) +#@gui :_=separator() +#@gui :Scale Down To=choice(1,"New Width and Height","Preserve Image Ratio Set New Width","Preserve Image Ratio Set New Height") +#@gui :New Width=int(1600,16,3200) +#@gui :New Height=int(1600,16,3200) +#@gui :_=separator() +#@gui :Skip Post Sharpening=bool(false) +#@gui :_=separator() +#@gui :_=note(""Skip Post Sharpening": if chosen will deactivate all controls below") +#@gui :_=separator() +#@gui :Amount=float(2.3,0,10) +#@gui :Darkness/Lightness Level=float(1,0,4) +#@gui :Channel(s)=choice(3,"All","RGBA","RGB","Luminance","Blue/red Chrominances","Blue Chrominance","Red Chrominance","Lightness","Ab-Components","A-Component","B-Component","Hue","Saturation","Value","Key","Alpha","Ch-Components","C-Component","H-Component","Red","Green","Blue","Alpha") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Author: PhotoComix. Latest update : 2012/25/09.") +#@gui Symmetry Master:fx_viral,fx_viral +#@gui :Scale=float(8,0,15) +#@gui :Mixer=choice("Average","Grain Extract","Vivid","Difference","Exclusion","Negation") +#@gui :Remix=choice("Vivid","Average","Difference","Negation","Darken") +#@gui :PhotoComix Preset=choice("Neat Merge","Lighty Smooth","Dream","Moody","Soft","Naif","Dark Boost","Whitening","None- Skip") +#@gui :Activate Mirror=choice("No-Skip",XY Mirror","2XY Mirror") +#@gui :_=separator() +#@gui :_=note("WARNING,'Expanding Mirrors' multiply image size of x4 or if '2XY Mirrors' x9") +#@gui :_=separator() +#@gui :Expanding Mirrors=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: PhotoComix. Latest update : 2011/13/11.") +#@gui Vivid Colors:fx_compose_vivid_color,fx_compose_vivid_color +#@gui :Opacity=float(1,0,1) +#@gui :Revert Layers=bool(0) +#@gui :Opacity 2=float(1,0,1) +#@gui :_=note("This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Vivid Edges:fx_compose_vividedges,fx_compose_vividedges +#@gui :Opacity=float(1,0,1) +#@gui :Edges Smoothness=float(0.5,0,5) +#@gui :Revert Layers=bool(0) +#@gui :Opacity 2=float(0.7,0,1) +#@gui :_=note("This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Vivid Screen:fx_compose_vividscreen,fx_compose_vividscreen +#@gui :Opacity=float(0.6,0,1) +#@gui :Revert Layers=bool(0) +#@gui :Opacity 2=float(0.7,0,1) +#@gui :_=note("This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Wild Cartoonizer:fx_m_l_unsharp2,fx_m_l_unsharp2_preview(0) +#@gui :_=separator() +#@gui :_=separator() +#@gui :Radius 1=float(12,0,100) +#@gui :Amount 1=float(2.18,0,10) +#@gui :Radius 2=float(0.3,0,100) +#@gui :Amount 2=float(1.5,0,10) +#@gui :Darken Merge Opacity=float(1,0,1) +#@gui :Lighten Merge Opacity=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Additional Painter Module") +#@gui :_=separator() +#@gui :Add Painter's Touch=bool(false) +#@gui :Painter's Touch Sharpness=float(0.5,0,2) +#@gui :Painter's Edge Protection Flow=float(0.8,0,1) +#@gui :Painter's Smoothness=float(1.28,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=note("Author: PhotoComiX. Latest update : 12/29/2010.") +#@gui _Prawnsushi +#@gui Channel Shuffle:fx_chanshuff,fx_chanshuff_preview(1)* +#@gui :Slices (0:Random)=int(0,0,1000) +#@gui :Angle=int(0,0,360) +#@gui :Axis=choice(0,"X","Y") +#@gui :Sorting=choice(1,"Reverse","Shuffle","Minimum Value X","Minimum Value Y","Minimum Value Z","Minimum Value C","Maximum Value X","Maximum Value Y","Maximum Value Z","Maximum Value C","Red","Green","Blue","Alpha","Minimum Deviation","Maximum Deviation","Average Deviation","Variance Deviation","Standard Deviation","Sum Value","Product Value","Median Value","L2-Norm","Width","Height","Depth") +#@gui :Ordering=choice(0,"Positive","Negative") +#@gui :_=note("Author: Prawnsushi, David Tschumperlé.Latest Update: 2023/08/17.") +#@gui :_=note("Forum thread: Pixls.us: Channel Shuffle.") +#@gui Line Spam:fx_linespam,fx_linespam_preview(1)* +#@gui :Iterations=int(30,1,100) +#@gui :Line Base Thickness=float(3,0.01,50) +#@gui :Thickness Scaling=float(1.02,0.01,1.2) +#@gui :Line Opacity=float(0.8,0,1) +#@gui :Start X=float(-1,-100,100) +#@gui :Start Y=float(10,-100,100) +#@gui :End X=float(101,0,200) +#@gui :End Y=float(100,0,200) +#@gui :Deform=float(0,0,20) +#@gui :Style=choice(0,"A","B","C","D") +#@gui :Base Color=color(#ff5500ff) +#@gui :Color Variation=float(0,-15,15) +#@gui :Randomize Colors=bool(0,0,1) +#@gui :_=separator() +#@gui :Antialiasing=bool(0,0,1) +#@gui :Amplitude=int(5,0,100) +#@gui :Edge Threshold (%)=int(10,0,100) +#@gui :Smoothness=float(0.8,0,5) +#@gui :_=separator() +#@gui :Spam!=int(1,1,10) +#@gui :Transparent Background=bool(0,0,1) +#@gui :_=note("Author: Prawnsushi.Latest Update: 2023/08/17.") +#@gui Paper Cuts:fx_papercuts,fx_papercuts_preview(0) +#@gui :Simplification=float(3,0,32) +#@gui :Local Normalization=float(0,0,6) +#@gui :Colors* ( RAM Hungry! )=int(8,2,40) +#@gui :Color Mode=choice(1,"Original","Monochrome","Random") +#@gui :Monochrome Color=color(#507fff) +#@gui :Color Variation (Off If Random)=int(0,0,10) +#@gui :Sorting=choice(14,"None","Reverse","Shuffle","Minimum Value X","Minimum Value Y","Minimum Value Z","Minimum Value C","Maximum Value X","Maximum Value Y","Maximum Value Z","Maximum Value C","Red","Green","Blue","Alpha","Minimum Deviation","Maximum Deviation","Average Deviation","Variance Deviation","Standard Deviation","Sum Value","Product Value","Median Value","L2-Norm","Width","Height","Depth") +#@gui :Ordering=choice(1,"Forward","Backward") +#@gui :_=separator() +#@gui :_=note("Shadows:") +#@gui :Softness=float(4,0,6) +#@gui :Opacity=float(0.6,0,1) +#@gui :Shifting=float(4,0,10) +#@gui :Angle=float(225,0,360) +#@gui :_=separator() +#@gui :Output to Multiple Layers=bool(1,0,1) +#@gui :_=note("First layer will contain all other layers, merged") +#@gui :_=separator() +#@gui :_=note("Imperfections:") +#@gui :Color Dithering=bool(0,0,1) +#@gui :Deformation=float(0,0,40) +#@gui :Canvas Effect=bool(1,0,1) +#@gui :Canvas Strength=float(0.6,0,1) +#@gui :Downscaling % (Uses Less RAM)=float(100,1,100) +#@gui :_=separator() +#@gui :_=note("Author: Prawnsushi.# Latest Update: 2023/13/08.") +#@gui :_=separator() +#@gui :_=note("*Depends on the number of colors in the indexed version of the input image.\n If "Output to Multiple Layers" is checked, 1 color = 1 layer. \n Try not use a lot of colors if you have less than 16 GB of RAM, or use downsampling.\n Preview itself is already downscaled by 50% unless you choose a value lower than 100.") +#@gui Prawn Canvas:fx_prawn_canvas,fx_prawn_canvas_preview(0) +#@gui :Strength=float(0.3,0,1) +#@gui :Details=float(0,0,30) +#@gui :Colored=bool(0,0,1) +#@gui :Color=color(#ffffffff) +#@gui :_=note("Author: Prawnsushi.Latest Update: 2023/08/17.") +#@gui Sick Painter:fx_sickpaint,fx_sickpaint_preview(0) +#@gui :Obstinacy=int(30,5,100) +#@gui :Start X (px Range)=int(0,-1000,1000) +#@gui :Start Y (px Range)=int(0,-1000,1000) +#@gui :Step X (px Range)=int(100,50,1000) +#@gui :Step Y (px Range)=int(100,50,1000) +#@gui :Line Base Thickness (px Range)=int(100,10,200) +#@gui :Max Opacity=float(0.7,0.01,1) +#@gui :Min Opacity=float(0.4,0.01,1) +#@gui :Anger & Rage=int(1000,1,20000) +#@gui :Color 1=color(#ff0000) +#@gui :Color 2=color(#2099a2) +#@gui :Panels=int(12,3,50) +#@gui :_=separator() +#@gui :_=note("Author: Prawnsushi.Latest Update: 2023/08/17.") +#@gui Slice Stretch-Squeeze:fx_streeze,fx_streeze_preview(1)+ +#@gui :Iterations=int(10,1,100) +#@gui :_=note("Do not set this higher than the smallest side of the image:") +#@gui :Slices=int(101,5,1001) +#@gui :_=note("If there is a seam in the image try adding or removing Slices. Odd numbers seem to work better. ") +#@gui :_=separator() +#@gui :_=note("Resizing:") +#@gui :Outer Range A (Starting @0%)=int(20,0,100) +#@gui :Outer Range B (Ending @100%)=int(80,0,100) +#@gui :O.R. Factor (%)=int(80,1,200) +#@gui :Inner Selection A (Starting %)=int(20,0,100) +#@gui :Inner Selection B (Ending %)=int(80,0,100) +#@gui :I.S. Factor (%)=int(120,1,200) +#@gui :Axis=choice(0,"X","Y","XY") +#@gui :Interpolation=choice(2,"Nearest","Average","Linear","Grid","Bicubic","Lanczos") +#@gui :Show Steps=bool(0,0,1) +#@gui :Delay (ms)=int(1,1,1000) +#@gui :_=separator() +#@gui :_=note("Author: Prawnsushi.Latest Update: 2023/08/17.") +#@gui Uglify:uglify,uglify_preview(0) +#@gui :Write Settings on Picture=bool(0,0,1) +#@gui :_=note{"Use original input image resolution or choose processing resolution (i.e. Half res + Upscale 2x). Beware: Preview lies."} +#@gui :Original Resolution=bool(1,0,1) +#@gui :Processing Resolution=int(1000,500,5000) +#@gui :Upscale 2x (Iterations)=_int(0,0,5) +#@gui :_=separator() +#@gui :- Presets=choice(0,"Default","1 - From Scratch","2 - Soft","3- Cracked","4 - Black","5 - Faded Black","6 - Nuudlz for a Blank Page") +#@gui :_=separator() +#@gui :Pre-Process=bool(0,0,1) +#@gui :- Sharpening=int(0,0,500) +#@gui :- Blur=float(0,0,10) +#@gui :- Local Normalization=float(0,0,3) +#@gui :_=separator() +#@gui :Sloppiness=bool(1,0,1) +#@gui :- Distort=float(3,0,20) +#@gui :- Blur=float(3,0,50) +#@gui :- Blend Mode=choice(13,"Add","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :- Strength=float(0.5,0.0,1.0) +#@gui :_=separator() +#@gui :Watering=bool(1,0,1) +#@gui :- Smoothing=int(12,0,40) +#@gui :- Iterations=int(1,0,10) +#@gui :Fuzzy Frame Size (%)=float(5,0,45) +#@gui :- Frame Blur=int(20,0,150) +#@gui :- Frame Strentgh=float(0.5,0,1) +#@gui :Plasma Seed ( -1 : Random )=int(-1,-1,999999) +#@gui :- Plasma Saturation=int(-100,-100,100) +#@gui :- Plasma Blur=float(0,0,50) +#@gui :- Blend Mode=choice(7,"Add","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation",Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :- Plasma Strength=float(0.6,0,1) +#@gui :_=separator() +#@gui :Cracks=bool(1,0,1) +#@gui :Sharpening=int(150,0,500) +#@gui :- Shock Filter=int(1,0,1) +#@gui :Light Relief (0 Means All Off)=float(0.05,0,1) +#@gui :- Light2=float(0.02,0,1) +#@gui :- Light3=float(0.02,0,1) +#@gui :_=separator() +#@gui :Sketch=bool(1,0,1) +#@gui :- Likeness=int(25,0,30) +#@gui :- Contrast=int(0,-100,100) +#@gui :- Gamma=int(0,-100,100) +#@gui :- Thickness=int(2,0,40) +#@gui :- Sketch Strength=float(1,0,1) +#@gui :--- Messy Lines=float(0.8,0,1) +#@gui :- White Lines=float(0.6,0,1) +#@gui :--- W. L. Deform=float(1.6,0,40) +#@gui :- Blend Mode=choice(22,"Add","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation",Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :_=note("Setting Sktech Strength to 0 disables Messy lines too.\n Messy lines uses 'Breaks' by David Tschumperlé.") +#@gui :_=separator() +#@gui :Noise=float(3,0,6) +#@gui :Canvas=float(0.3,0,1) +#@gui :Canvas Density=int(0,0,30) +#@gui :Color=color(#ffffffff) +#@gui :_=separator() +#@gui :Post-Process=bool(1,0,1) +#@gui :Emboss=float(1.5,0,5) +#@gui :Mix Original Hue/Sat=float(0.5,0,1) +#@gui :Brightness=float(0,-100,100) +#@gui :Contrast=float(0,-100,100) +#@gui :Gamma=float(0,-100,100) +#@gui :Hue=float(0,-100,100) +#@gui :Saturation=float(0,-100,100) +#@gui :_=separator() +#@gui :- Old Presets=_choice(0,"Default","1 - From Scratch","2 -Soft","3 - Cracked","4 - Black","5 - Faded Black","6 - Nuudlz for Blank Page")_0 +#@gui :_=separator() +#@gui :_=note("Author: Prawnsushi.      Latest Update: 2023/08/17.") +#@gui _Reptorian +#@gui Array [Random] [Jumble by Px]:fx_rep_array_random_jumble_by_px,fx_rep_array_random_jumble_by_px_preview(1)* +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Tile Width(px)=int(128,1,2048) +#@gui :Tile Height=int(128,1,2048) +#@gui :Old Tile Width(px)=int(128,1,2048)_0 +#@gui :Old Tile Height=int(128,1,2048)_0 +#@gui :Link Dimensions=bool(0) +#@gui :Enforce Factors=bool(0) +#@gui :Reshuffle Tiles=button() +#@gui :_=separator() +#@gui :_=note("Image Factors") +#@gui :List of Width Factors=text("List of Factors") +#@gui :List of Height Factors=text("List of Factors") +#@gui :List of Width and Height Factors=text("List of Factors") +#@gui :Stored List of Width(s) Factors=text("List of Factors")_0 +#@gui :Stored List of Height(s) Factors=text("List of Factors")_0 +#@gui :Stored List of Width(s) and Height(s) Factors=text("List of Factors")_0 +#@gui :Stored Number of Width(s) Factors=int(1,1,16777216)_0 +#@gui :Stored Number of Height(s) Factors=int(1,1,16777216)_0 +#@gui :Stored Number of Width(s) and Height(s) Factors=int(1,1,16777216)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2023/07/06.") +#@gui Attractor:fx_rep_trsa,fx_rep_trsa_preview(0) +#@gui :_=note("Generates Attractor fractal.") +#@gui :_=separator() +#@gui :_=note("Input") +#@gui :Algorithm=choice(0,A,B,C,D,E,F,G) +#@gui :Density=float(7,.5,50) +#@gui :Scale=float(1,.1,3) +#@gui :_=note("Parameters) +#@gui :A=float(1,-1,1) +#@gui :B=float(1,-1,1) +#@gui :C=float(1,-1,1) +#@gui :D=float(1,-1,1) +#@gui :E=float(1,-1,1) +#@gui :F=float(1,-1,1) +#@gui :G=float(1,-1,1) +#@gui :H=float(1,-1,1) +#@gui :I=float(1,-1,1) +#@gui :Randomize Parameters=button() +#@gui :_=separator() +#@gui :_=note("Output") +#@gui :Mode=choice(0,"A","A/B","A/A") +#@gui :Negative Exponential Factor=float(1,1,10) +#@gui :Multiplier=float(1,1,10) +#@gui :Quality=float(1,1,3) +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Fill Percentage=bool(0) +#@gui :_=separator() +#@gui :_=note("Instruction") +#@gui :_=note("Attractor are fractals in which values lean toward a location within phase space.\n\n1. Input setting defines the format of attractor fractal as well as its density and scaling.\n\n2. Parameters are different variables with different numbers assigned. This is used to alter the forms of attractor.\n\n3. Output influence the shading of attractor. A implies that negative exponental factor is applicable while B means that it's not applicable. In case of two letter, the last letter is the alpha channel. The greater the negative exponential factor value is, the more visible the attractor will be.\n\n4. Quality resizes the image and multiply the density by the quality number, then resize the image back to the original size. It is used to reduce noise.\n\n5. Fill Percentage is used as a way to diagnose whether there is a fractal appearing or not. A very low percentage means there is no fractal. Percentage higher than 100% implies some values are out of range in respect to the image boundary.") +#@gui :_=separator() +#@gui :_=note("Info") +#@gui :_=note("Conversion of a PDN plugin made by TechnoRobbo.\n\nSource Code: TR's Strange Attractor Plugin") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/3/29.") +#@gui Autofill Coloring Book:gui_rep_acb,gui_rep_acb_preview(0) +#@gui :_=note("This filter is specifically designed to autofill areas with random colors that only appear once.\n\nDon't trust the preview for colors, test the result first!") +#@gui :_=separator() +#@gui :Line Threshold=int(180,1,254) +#@gui :Dilate/Erode=int(0,-3,3) +#@gui :Line Mode=choice(1,"Hard","Soft") +#@gui :Alpha Threshold=int(0,0,254) +#@gui :Coloring Seed=int(250000,0,500000) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/6/4.") +#@gui Axis Streak:gui_axis_streak,gui_axis_streak_preview +#@gui :_=note("Streaks pixel taking into account of opacity by blending pixels-by-pixels.") +#@gui :_=separator() +#@gui :Orientation=choice(0,"Horizontal","Vertical") +#@gui :Direction=choice(0,"Left","Right") +#@gui :Direction=choice(0,"Up","Down") +#@gui :Alpha Exponential Factor(%)=float(0,-100,500) +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/12/7.") +#@gui Binary Alternating Quaddro Texture [Basic]:rep_binary_quaddro_basic_gui,rep_binary_quaddro_basic_gui_preview(0) +#@gui :_=note("This filter is a extended version of a filter found inAsmageddon Tools Pack v3. Translated to G'MIC using a source code, and then extended. It is a mixture of two texture filters.") +#@gui :_=separator() +#@gui :_=note("Channel Processing") +#@gui :Texture Output=choice(0,"Grayscale","Hue","Degradation Mode") +#@gui :_=separator() +#@gui :_=note("Main Texture Processing") +#@gui :Style=choice(0,"Cracking Alternating Texture","Alternating Glasses","Simple") +#@gui :Variable#1=int(8,-512,512) +#@gui :Variable#2=int(8,-512,512) +#@gui :Variable#3=int(128,-200,200) +#@gui :Operand=choice(2,"AND","OR","XOR") +#@gui :Angle=float(0,-180,180) +#@gui :X-Flip=bool(0) +#@gui :Y-Flip=bool(0) +#@gui :Number Modulo=int(256,256,2048) +#@gui :Internal Normalize=int(255,255,2048) +#@gui :Internal Normalization=bool(1) +#@gui :Number Modulo=int(361,256,2048) +#@gui :Internal Normalize=int(361,360,2048) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2018/12/19.") +#@gui Binary Alternating Quaddro Texture [MultiChannel]:rep_binary_quaddro_mc_gui,rep_binary_quaddro_mc_gui_preview(0) +#@gui :_=note("This filter is a extended version of a filter found in Asmageddon Tools Pack v3. Translated to G'MIC using a source code, and then extended. It is a mixture of two texture filters.") +#@gui :_=separator() +#@gui :_=note("Configuration") +#@gui :Color Space=choice(0,"RGB","RYB","CMY","CMYK","HSI","HSV","HSL","LAB","LCH","YCbCr","YCbCrGLIC","YIQ","YUV","XYZ") +#@gui :Contain Alpha?=bool(0) +#@gui :8-Bit Mode?=bool(0) +#@gui :_=separator() +#@gui :_=note("Channel Order") +#@gui :Channel #1=choice(0,"0","1","2") +#@gui :Channel #2=choice(1,"0","1","2") +#@gui :Channel #3=choice(2,"0","1","2") +#@gui :Channel #1=choice(0,"0","1","2","3") +#@gui :Channel #2=choice(1,"0","1","2","3") +#@gui :Channel #3=choice(2,"0","1","2","3") +#@gui :Channel #4=choice(3,"0","1","2","3") +#@gui :Channel #1=choice(0,"0","1","2","3","4") +#@gui :Channel #2=choice(1,"0","1","2","3","4") +#@gui :Channel #3=choice(2,"0","1","2","3","4") +#@gui :Channel #4=choice(3,"0","1","2","3","4") +#@gui :Channel #5=choice(4,"0","1","2","3","4") +#@gui :_=separator() +#@gui :_=note("Main Texture Processing") +#@gui :_=note("Channel #1") +#@gui :Style=choice(0,"Bumping Alternating Texture","Alternating Glasses","Simple") +#@gui :Variable#1=int(8,-512,512) +#@gui :Variable#2=int(8,-512,512) +#@gui :Variable#3=int(128,-200,200) +#@gui :Operand=choice(2,"AND","OR","XOR") +#@gui :Angle=float(0,-180,180) +#@gui :X-Flip=bool(0) +#@gui :Y-Flip=bool(0) +#@gui :Normalize=bool(1) +#@gui :_=separator() +#@gui :_=note("Channel #2") +#@gui :Style=choice(0,"Bumping Alternating Texture","Alternating Glasses","Simple") +#@gui :Variable#1=int(8,-512,512) +#@gui :Variable#2=int(8,-512,512) +#@gui :Variable#3=int(128,-200,200) +#@gui :Operand=choice(2,"AND","OR","XOR") +#@gui :Angle=float(0,-180,180) +#@gui :X-Flip=bool(0) +#@gui :Y-Flip=bool(0) +#@gui :Normalize=bool(1) +#@gui :_=separator() +#@gui :_=note("Channel #3") +#@gui :Style=choice(0,"Bumping Alternating Texture","Alternating Glasses","Simple") +#@gui :Variable#1=int(8,-512,512) +#@gui :Variable#2=int(8,-512,512) +#@gui :Variable#3=int(128,-200,200) +#@gui :Operand=choice(2,"AND","OR","XOR") +#@gui :Angle=float(0,-180,180) +#@gui :X-Flip=bool(0) +#@gui :Y-Flip=bool(0) +#@gui :Normalize=bool(1) +#@gui :_=separator() +#@gui :_=note("Channel #4") +#@gui :Style=choice(0,"Bumping Alternating Texture","Alternating Glasses","Simple") +#@gui :Variable#1=int(8,-512,512) +#@gui :Variable#2=int(8,-512,512) +#@gui :Variable#3=int(128,-200,200) +#@gui :Operand=choice(2,"AND","OR","XOR") +#@gui :Angle=float(0,-180,180) +#@gui :X-Flip=bool(0) +#@gui :Y-Flip=bool(0) +#@gui :Normalize=bool(1) +#@gui :_=separator() +#@gui :_=note("Channel #5") +#@gui :Style=choice(0,"Bumping Alternating Texture","Alternating Glasses","Simple") +#@gui :Variable#1=int(8,-512,512) +#@gui :Variable#2=int(8,-512,512) +#@gui :Variable#3=int(128,-200,200) +#@gui :Operand=choice(2,"AND","OR","XOR") +#@gui :Angle=float(0,-180,180) +#@gui :X-Flip=bool(0) +#@gui :Y-Flip=bool(0) +#@gui :Normalize=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2018/12/19.") +#@gui Bit-Plane Shuffler:fx_rep_bitplane_shuffle,fx_rep_bitplane_shuffle_preview +#@gui :_=separator() +#@gui :_=note("Main) +#@gui :Direction=choice(1,"Backward","Forward") +#@gui :Depth=choice(0,"8-Bit","16-Bit") +#@gui :Use Alpha?=bool(0) +#@gui :_=separator() +#@gui :_=note("Plane Shuffling) +#@gui :Index=int(100,1,40320) +#@gui :Index=int(100,1,40320)_0 +#@gui :Plane A=int(1,1,8) +#@gui :Plane B=int(2,1,8) +#@gui :Plane C=int(3,1,8) +#@gui :Plane D=int(4,1,8) +#@gui :Plane E=int(5,1,8) +#@gui :Plane F=int(6,1,8) +#@gui :Plane G=int(7,1,8) +#@gui :Plane H=int(8,1,8) +#@gui :Plane A=int(1,1,8)_0 +#@gui :Plane B=int(2,1,8)_0 +#@gui :Plane C=int(3,1,8)_0 +#@gui :Plane D=int(4,1,8)_0 +#@gui :Plane E=int(5,1,8)_0 +#@gui :Plane F=int(6,1,8)_0 +#@gui :Plane G=int(7,1,8)_0 +#@gui :Plane H=int(8,1,8)_0 +#@gui :Randomize Index=button() +#@gui :Index=text("9896398100167")_0 +#@gui :Index=text("9896398100167")_0 +#@gui :Plane A=int(8,1,16) +#@gui :Plane B=int(10,1,16) +#@gui :Plane C=int(9,1,16) +#@gui :Plane D=int(4,1,16) +#@gui :Plane E=int(7,1,16) +#@gui :Plane F=int(13,1,16) +#@gui :Plane G=int(1,1,16) +#@gui :Plane H=int(3,1,16) +#@gui :Plane I=int(11,1,16) +#@gui :Plane J=int(14,1,16) +#@gui :Plane K=int(6,1,16) +#@gui :Plane L=int(2,1,16) +#@gui :Plane M=int(12,1,16) +#@gui :Plane N=int(5,1,16) +#@gui :Plane O=int(15,1,16) +#@gui :Plane P=int(16,1,16) +#@gui :Plane A=int(8,1,16)_0 +#@gui :Plane B=int(10,1,16)_0 +#@gui :Plane C=int(9,1,16)_0 +#@gui :Plane D=int(4,1,16)_0 +#@gui :Plane E=int(7,1,16)_0 +#@gui :Plane F=int(13,1,16)_0 +#@gui :Plane G=int(1,1,16)_0 +#@gui :Plane H=int(3,1,16)_0 +#@gui :Plane I=int(11,1,16)_0 +#@gui :Plane J=int(14,1,16)_0 +#@gui :Plane K=int(6,1,16)_0 +#@gui :Plane L=int(2,1,16)_0 +#@gui :Plane M=int(12,1,16)_0 +#@gui :Plane N=int(5,1,16)_0 +#@gui :Plane O=int(15,1,16)_0 +#@gui :Plane P=int(16,1,16)_0 +#@gui :Randomize Order=button() +#@gui :Direction=choice(1,"Backward","Forward")_0 +#@gui :Depth=choice(0,"8-Bit","16-Bit")_0 +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2022/09/02.") +#@gui __Degradations +#@gui Blur [Splinter]:fx_rep_blur_splinter,fx_rep_blur_splinter_preview +#@gui :_=note(" Apply Splinter Blur.\n\nBased off observation from using Splinter Blur plugin within Paint.NET made by Ed Harvey, and it is inspired by this filter.\n\nComputationally intensive!") +#@gui :_=separator() +#@gui :Half Image-Diagonal(%)=float(20,0.1,100) +#@gui :Duplicates=int(3,3,100) +#@gui :Angle=float(0,-180,180) +#@gui :Thickness(%)=float(0,0,100) +#@gui :Contrast(%)=float(0,0,100) +#@gui :Balance(%)=float(0,-100,100) +#@gui :Boundary=choice(3,"None","Neumann","Periodic","Mirror") +#@gui :Use Bi-Sided Convolution?=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/9/10.") +#@gui _Testing +#@gui Reptorian +#@gui Bricks:gui_rep_shape_brick +#@gui :_=note("This filter on the Bricks plugin for Paint.NET made by Jesse Chunn as part of his plugin pack.\n\n This is a extended version of the bricks filter with bevel options, and blending mode option.") +#@gui :_=separator() +#@gui :_=note("Brick Main Setting") +#@gui :Brick Width (px)=int(150,4,2048) +#@gui :Brick Height (px)=int(150,4,2048) +#@gui :Mortar Width (px)=int(5,0,512) +#@gui :Mortar Height (px)=int(5,0,512) +#@gui :Outline (px)=int(0,0,50) +#@gui :_=separator() +#@gui :_=note("Offset Setting) +#@gui :Brick Offset (%)=float(0,-100,100) +#@gui :Offset Direction=choice(0,"Horizontal","Vertical") +#@gui :Reverse Offset=bool(0) +#@gui :_=separator() +#@gui :_=note("Bevel Setting) +#@gui :Bevel Radius (px)=int(0,0,50) +#@gui :Bevel Style=choice(0,"Round","Inverse Round","Chamfer") +#@gui :_=separator() +#@gui :_=note("Colouring and Blending Options") +#@gui :Brick Colour=color(#aa0000ff) +#@gui :Brick Outline=color(#550000ff) +#@gui :Mortar Colour=color(#794d02ff) +#@gui :Use Blending Mode?=bool(0) +#@gui :Blending Mode=choice(41,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Opacity (%)=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("Antialias) +#@gui :Antialias Level=float(0,0,3) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/10/15.") +#@gui Chirikov-Taylor:fx_rep_cstdmap,fx_rep_cstdmap_preview +#@gui :_=note("Creates Chirikov-Taylor discrete map.") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Lines=int(500,1,10000) +#@gui :Points per Line=int(5000,1,100000) +#@gui :K=float(1,-5,5) +#@gui :Mode=choice(0,"Regular","Symmetric Modified") +#@gui :Center Main Rotor=bool(0) +#@gui :Orientation=choice(0,"XY",YX") +#@gui :Multithreaded Processing=bool(1) +#@gui :_=separator() +#@gui :_=note("Scaling") +#@gui :Factor=float(1,.1,10) +#@gui :Use Image Ratio?=bool(0) +#@gui :_=separator() +#@gui :_=note("Coloring") +#@gui :_=note("Preliminary") +#@gui :Mode=choice(0,"Grayscale","HSX","Palette","Random","From Image") +#@gui :Use Alpha?=bool(0) +#@gui :_=separator() +#@gui :_=note("Additional") +#@gui :HSX Mode=choice(2,"HCY","HSI","HSL/HSV") +#@gui :Palette=choice(0,"RGB-3","B-RGB-4","BW-RGB-5","CMY-3","CMYK-4","WCMYK-5","RGBCMY-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus-256","PLAYPAl-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette","Koni32","Linear Color Palette Basic","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8","CD-BAC-16","CG Arne-16","Dinoknight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar [Lake Water Lily]-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet-20","Matrix-96","Material Design-96","Rainbow A-88","Rainbow B-96","SCRJ-XXXVI-36","Pxls Default-32","Moderna-24","Oak21-21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80s-8","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R\place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A-15","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-8","Ocean Glass-8","RoyalGuard-6","Eulbink-8","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-4","Rabbit 7-4","Amiga 2600 NTSC-128","Amiga 2600 PAL-108","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","C64[Pepto]-16","C64[Colodore]-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-256","Win95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Human Faces-94","MadjikHSV-96","ST24 Christmas","Reds-24","Pastel Rainbow-6") +#@gui :Color Count=int(20,2,360) +#@gui :Color Seed=int(0,0,100000) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/12/28.") +#@gui Color Existence Distribution [RGB-8]:rep_color_existence_distribution_rgb8,rep_color_existence_distribution_rgb8 +#@gui :_=note("This filter is used to find colors that does or does not exist within a image.\n\n For Paint.NET users, please refer to this tutorial named Finding millions of colors that does or does not exist - G'MIC QT Tutorial") +#@gui :Sep Separator() Set of Color(s)=choice(1,"Nonexistent Colors","Existing Colors") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/9/20.") +#@gui Color Harmonies:_none_,fx_rep_color_harmonies_preview(1)* +#@gui :_=note("This is a recreation of the Color Harmonies plugin for Paint.NET. which was made by midora who is also known as Martin Osieka.") +#@gui :_=separator() +#@gui :_=note("Reference Point") +#@gui :Hue=float(50,0,360) +#@gui :Saturation(%)=float(100,0,100) +#@gui :Shade/Tint(%)=float(0,-100,100) +#@gui :Color Space=choice(0,"RGB",RYB") +#@gui :_=separator() +#@gui :_=note("Additional Information") +#@gui :Palette Mode=choice(0,"Neutral 8","Neutral 15","Analogous 30","Complementary","Split-Complementary","Triadic","Tetradic","Clash","Four Tones","Five Tones","Six Tones") +#@gui :_=separator() +#@gui :_=note("Output Color") +#@gui :Color A=color(#000000) +#@gui :Color B=color(#000000) +#@gui :Color C=color(#000000) +#@gui :Color D=color(#000000) +#@gui :Color E=color(#000000) +#@gui :Color F=color(#000000) +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Color Point Position=point(50,50,0,1,128,128,128,255) +#@gui :Color Select Position(%)=float(10,10,50) +#@gui :Scaling(%)=float(90,30,100) +#@gui :Point=point(50,50,0,0,0,0,0,0,0)_0 +#@gui :Color A=color(#000000)_0 +#@gui :Color B=color(#000000)_0 +#@gui :Color C=color(#000000)_0 +#@gui :Color D=color(#000000)_0 +#@gui :Color E=color(#000000)_0 +#@gui :Color F=color(#000000)_0 +#@gui :Hue=float(0,0,360)_0 +#@gui :Saturation(%)=float(100,0,100)_0 +#@gui :Shade/Tint(%)=float(0,-100,100)_0 +#@gui :Hue=float(0,0,360)_0 +#@gui :Saturation(%)=float(100,0,100)_0 +#@gui :Shade/Tint(%)=float(0,-100,100)_0 +#@gui :Hue=float(0,0,360)_0 +#@gui :Saturation(%)=float(100,0,100)_0 +#@gui :Shade/Tint(%)=float(0,-100,100)_0 +#@gui :Hue=float(0,0,360)_0 +#@gui :Saturation(%)=float(100,0,100)_0 +#@gui :Shade/Tint(%)=float(0,-100,100)_0 +#@gui :Hue=float(0,0,360)_0 +#@gui :Saturation(%)=float(100,0,100)_0 +#@gui :Shade/Tint(%)=float(0,-100,100)_0 +#@gui :Hue=float(0,0,360)_0 +#@gui :Saturation(%)=float(100,0,100)_0 +#@gui :Shade/Tint(%)=float(0,-100,100)_0 +#@gui :Color Space=choice(0,"RGB",RYB")_0 +#@gui :Palette Mode=choice(0,"Neutral 8","Neutral 15","Analogous 30","Complementary","Split-Complementary","Triadic","Tetradic","Clash","Four Tones","Five Tones","Six Tones")_0 +#@gui :Color Select Position(%)=float(10,10,50)_0 +#@gui :Scaling(%)=float(90,30,100)_0 +#@gui :Preview Palette?=bool(0)_0 +#@gui :Orientation=choice(0,"Horizontal","Vertical")_0 +#@gui :Palette X=choice(1,"Bottom","Middle","Top")_0 +#@gui :Palette Y=choice(1,"Left","Middle","Top")_0 +#@gui :_=separator() +#@gui :_=note("Export") +#@gui :Output Location=folder() +#@gui :File Name=text("color_harmonies") +#@gui :Format=choice(0,"GIMP Palette - .gpl","Paint.NET Palette - .txt","JASC-PAL - .pal") +#@gui :Export=button() +#@gui :_=separator() +#@gui :_=note("Miscellaneous") +#@gui :Console Message=text("This is a interactive tool meant to create palette.") +#@gui :Mode=int(-1,-1,2)_0 +#@gui :Old Preview Height=int(0,0,15360)_0 +#@gui :Old Preview Height=int(0,0,15360)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2022/07/01.") +#@gui Color Modulo Texture:gui_rep_colmt,gui_rep_colmt_preview +#@gui :_=note("This filter is inspired by Color Modulo plugin made by MadJik for Paint.NET software.\n\nPreview is inaccurate! Use 100% Zoom Preview for most accuracy!") +#@gui :_=separator() +#@gui :_=note("Colour and Channel Setting") +#@gui :_=separator() +#@gui :_=note("- Colour Space and Alpha Setting -") +#@gui :Colour Space=choice(0,"RGB-8","RYB-8","CMY-8","CMYK-8","HSI-8","HSL-8","HSV-8","LAB-8","LCH-8","YIQ-8","YUV-8","YCbCr-8","YCbCrGLIC-8","XYZ-8","YES-8") +#@gui :Contain Alpha?=bool(0) +#@gui :_=separator() +#@gui :_=note("- Channel Setting -") +#@gui :Channel Order=choice(0,"1-2-3-4","1-2-4-3","1-3-2-4","1-3-4-2","1-4-2-3","1-4-3-2","2-1-3-4","2-1-4-3","2-3-1-4","2-3-4-1","2-4-1-3","2-4-3-1","3-1-2-4","3-1-4-2","3-2-1-4","3-2-4-1","3-4-1-2","3-4-2-1","4-1-2-3","4-1-3-2","4-2-1-3","4-2-3-1","4-3-1-2","4-3-2-1") +#@gui :Channel Order=choice(0,"1-2-3","1-3-2","2-1-3","2-3-1","3-1-2","3-2-1") +#@gui :Edit Multiple Channel Separately?=bool(1) +#@gui :_=separator() +#@gui :_=note("Diagonal Setting") +#@gui :_=separator() +#@gui :Flip Diagonal?=bool(0) +#@gui :_=separator() +#@gui :_=note("Modulo Texture Setting") +#@gui :_=separator() +#@gui :_=note("- Multichannel Editing-") +#@gui :Modulo Mode=choice(3,"Regular Modulo","Continuous Regular Modulo","Divisive Modulo","Continuous Divisive Modulo") +#@gui :Modulo Variable #1=int(0,0,786) +#@gui :Modulo Variable #2=int(255,0,786) +#@gui :Function Angle=float(0,-180,180) +#@gui :Value Shift=int(0,0,786) +#@gui :Centered=bool(1) +#@gui :Negate=bool(0) +#@gui :Normalize=bool(1) +#@gui :_=note("Option available when Edit Multiple Channel Separately is turned off") +#@gui :_=separator() +#@gui :_=note("- Separate Channel Editing -") +#@gui :Channel Section=choice(0,"Channel #1","Channel #2","Channel #3","Channel #4") +#@gui :Channel Section=choice(0,"Channel #1","Channel #2","Channel #3") +#@gui :_=note("Option available when Edit Multiple Channel Separately is turned on") +#@gui :_=separator() +#@gui :Modulo Mode=choice(3,"Regular Modulo","Continuous Regular Modulo","Divisive Modulo","Continuous Divisive Modulo") +#@gui :Modulo Variable #1=int(0,0,786) +#@gui :Modulo Variable #2=int(255,0,786) +#@gui :Function Angle=float(0,-180,180) +#@gui :Value Shift=int(0,0,786) +#@gui :Centered=bool(1) +#@gui :Negate=bool(0) +#@gui :Normalize=bool(1) +#@gui :Modulo Mode=choice(3,"Regular Modulo","Continuous Regular Modulo","Divisive Modulo","Continuous Divisive Modulo") +#@gui :Modulo Variable #1=int(0,0,786) +#@gui :Modulo Variable #2=int(255,0,786) +#@gui :Function Angle=float(0,-180,180) +#@gui :Value Shift=int(0,0,786) +#@gui :Centered=bool(1) +#@gui :Negate=bool(0) +#@gui :Normalize=bool(1) +#@gui :Modulo Mode=choice(3,"Regular Modulo","Continuous Regular Modulo","Divisive Modulo","Continuous Divisive Modulo") +#@gui :Modulo Variable #1=int(0,0,786) +#@gui :Modulo Variable #2=int(255,0,786) +#@gui :Function Angle=float(0,-180,180) +#@gui :Value Shift=int(0,0,786) +#@gui :Centered=bool(1) +#@gui :Negate=bool(0) +#@gui :Normalize=bool(1) +#@gui :Modulo Mode=choice(3,"Regular Modulo","Continuous Regular Modulo","Divisive Modulo","Continuous Divisive Modulo") +#@gui :Modulo Variable #1=int(0,0,786) +#@gui :Modulo Variable #2=int(255,0,786) +#@gui :Function Angle=float(0,-180,180) +#@gui :Value Shift=int(0,0,786) +#@gui :Centered=bool(1) +#@gui :Negate=bool(0) +#@gui :Normalize=bool(1) +#@gui :_=note("Option available when Edit Multiple Channel Separately is turned on") +#@gui :_=separator() +#@gui :_=note("Subpixel Processing Setting") +#@gui :_=separator() +#@gui :Subpixel Rendering Level=float(1,0,1) +#@gui :Subpixel Interpolation=choice(5,"Nearest","Average","Grid","Linear","Bicubic","Lanczos") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/10/07.") +#@gui Color Region:fx_rep_color_region,fx_rep_color_region_preview(0)* +#@gui :Area Threshold (%)=float(5,1,100) +#@gui :Stray Threshold (%)=float(5,0,100) +#@gui :Color Distance Threshold=float(6,0,10) +#@gui :Old Area Threshold (%)=float(-1,-1,100)_0 +#@gui :Old Stray Threshold (%)=float(-1,-1,100)_0 +#@gui :Old Color Distance Threshold=float(-1,-1,10)_0 +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2023/3/15.") +#@gui Complexion Burst:fx_rep_compb,fx_rep_compb_preview +#@gui :_=note("Complex-Plane adaptation of the Pickover Popcorn Fractal. Discovered By Reptorian.") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Points=int(50,1,200) +#@gui :Density=float(1,.01,2) +#@gui :H-Real=float(.05,-75,75) +#@gui :H-Imag=float(3,-75,75) +#@gui :K-Real=float(3,-75,75) +#@gui :K-Imag=float(3,-75,75) +#@gui :Zoom=float(2,.1,20) +#@gui :Angle=float(0,-180,180) +#@gui :Origin=point(50,50,0,1,255,255,255,255) +#@gui :_=separator() +#@gui :_=note("Number Extraction") +#@gui :Method=choice(0,"Per-Axis","Additive") +#@gui :_=separator() +#@gui :_=note("Complex Trigonometric") +#@gui :Mode=choice(0,"Z-4","Z-6") +#@gui :Complex-Plane Mode?=bool(1) +#@gui :Real-Axis Formula S=choice(0,"Complex Sinusoidal","Complex Cosinusoidal","Complex Tangent","Complex Log") +#@gui :Real-Axis Formula T=choice(1,"Complex Sinusoidal","Complex Cosinusoidal","Complex Tangent","Complex Log") +#@gui :Real-Axis Formula U=choice(2,"Complex Sinusoidal","Complex Cosinusoidal","Complex Tangent","Complex Log") +#@gui :Imaginary-Axis Formula S=choice(0,"Complex Sinusoidal","Complex Cosinusoidal","Complex Tangent","Complex Log") +#@gui :Imaginary-Axis Formula T=choice(1,"Complex Sinusoidal","Complex Cosinusoidal","Complex Tangent","Complex Log") +#@gui :Imaginary-Axis Formula U=choice(2,"Complex Sinusoidal","Complex Cosinusoidal","Complex Tangent","Complex Log") +#@gui :XY-Axis Formula S=choice(0,"Complex Sinusoidal","Complex Cosinusoidal","Complex Tangent","Complex Log") +#@gui :XY-Axis Formula T=choice(1,"Complex Sinusoidal","Complex Cosinusoidal","Complex Tangent","Complex Log") +#@gui :XY-Axis Formula U=choice(2,"Complex Sinusoidal","Complex Cosinusoidal","Complex Tangent","Complex Log") +#@gui :_=separator() +#@gui :_=note("Output") +#@gui :Value Limit(%)=float(.5,.5,100) +#@gui :Midpoint Shift=float(.5,-1,1) +#@gui :Multiplier=float(1,.1,10) +#@gui :Normalize=bool(1) +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Show Fill Ratio?=bool(0) +#@gui :_=note("Fill Ratio provides information on whether there is sufficient filled pixels on canvas. The closer to 100%, the more the canvas is filled.") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/08/19.") +#@gui __Rendering +#@gui Construction Material Texture:_cons_turb,_cons_turb_preview(0) +#@gui :_=note("Construction Material Texture filter is based off the following tutorial by theonlychad for Paint.NET software: Concrete Texture Tutorial.\n") +#@gui :_=separator() +#@gui :_=note("Turbulance Texture") +#@gui :Radius=float(88,1,1024) +#@gui :Octaves=int(8,1,12) +#@gui :Damping per Octave=float(2.5,1,10) +#@gui :Mode=choice(2,"Turbulence","Turbulence 2","Fractal Noise","Fractured Clouds","Stardust","Pea Soup") +#@gui :Color Balance=color(#808080) +#@gui :_=separator() +#@gui :_=note("Noise Processing") +#@gui :Amplitude=float(20,0,200) +#@gui :Noise Type=choice(3,"Gaussian","Uniform","Salt and Pepper","Poisson") +#@gui :_=separator() +#@gui :Channel(s)=choice(0,"RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]") +#@gui :Value Action=choice(1,"None","Cut","Normalize") +#@gui :_=separator() +#@gui :_=note("Grayscale Processing") +#@gui :Colour Space=choice("RGB","SRGB") +#@gui :Channel 1=float(1,0,3) +#@gui :Channel 2=float(1,0,3) +#@gui :Channel 3=float(1,0,3) +#@gui :Normalise=bool(1) +#@gui :Desaturation (%)=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("Self-Image Processing") +#@gui :Self-Blending=choice(20,"Add","Burn","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Hardlight","Hardmix","Interpolation","Linearburn","Linearlight","Luminance","Multiply","Negation","Overlay","Pinlight","Reflect","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Vividlight") +#@gui :Self-Blending Opacity (%)=float(100,0,100) +#@gui :Self-Blending V. Original Blending=choice(15,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Self-Blend V. Original Opacity (%)=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("Value Processing") +#@gui :Value Action=choice(2,"None","Cut","Normalize") +#@gui :Number #1=float(0,0,255) +#@gui :Number #2=float(188,0,255) +#@gui :Equalize?=bool(0) +#@gui :Negate?=bool(0) +#@gui :_=separator() +#@gui :_=note("Warp by Intensity") +#@gui :X-Factor=float(0.19,-6,6) +#@gui :Y-Factor=float(0.52,-6,6) +#@gui :_=separator() +#@gui :X-Offset=float(128,0,255) +#@gui :Y-Offset=float(128,0,255) +#@gui :_=separator() +#@gui :Correlated Channels=bool(0) +#@gui :Interpolation=choice(1,"Nearest Neighbor","Linear") +#@gui :Boundary=choice(2,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]") +#@gui :_=separator() +#@gui :_=note("Style Processing") +#@gui :Blur Original=float(0,0,16) +#@gui :_=separator() +#@gui :_=note("Butterworth Bandpass Processing") +#@gui :Activate Butterworth Bandpass Processing=bool(0) +#@gui :Create Copy?=bool(0) +#@gui :LP Frequency Power=float(3,0,16) +#@gui :LP Order Cube Root=float(2,0,4) +#@gui :LP Resonance=float(0,0,5) +#@gui :HP Frequency Power=float(4,0,16) +#@gui :HP Order Cube Root=float(2,0,4) +#@gui :HP Resonance=float(2,0,4) +#@gui :Colour Space=choice("RGB","SRGB","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","Lab8","Lab","YCbCr","YCbCrGLIC","YCbCrJPEG","YIQ8","YIQ","YUV8","YUV","HCY","XYZ8","XYZ","CMY","CMYK","Bayer") +#@gui :Absolute=bool(1) +#@gui :Makeup Gain=bool(1) +#@gui :_=separator() +#@gui :_=note("Relief Processing") +#@gui :Activate Relief Processing=bool(1) +#@gui :Radius=int(5,5,100) +#@gui :Angle=float(0,-180,180) +#@gui :Sigma=float(.5,.05,4) +#@gui :Value Scale=float(2,.5,10) +#@gui :Output Color=bool(1) +#@gui :Blending Mode=choice(0,"Grain Extract","Grain Merge") +#@gui :Blending Opacity (%)=float(100,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/12/07.") +#@gui _Testing +#@gui Reptorian +#@gui Detailed Information:_none_,fx_rep_detailed_info_preview(0)* +#@gui :User and Images Information=_text(1,"Every information can be found here") +#@gui :Ratio Proposition Number (0 Disables It)=int(16,0,256) +#@gui :Ratio Proposition Number (0 Disables It)=int(16,0,256)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2022/07/09.") +#@gui Diffusion Limited Aggregation:fx_rep_dla,fx_rep_dla_preview(0)* +#@gui :Attempts=int(100,5,2000) +#@gui :Aggregation Mode=choice(0,"Corners","Axis[Slow!]","All-Around","Alternating") +#@gui :Stem Tone=choice("Dark",Light") +#@gui :Border Size=int(0,0,100) +#@gui :Spread Factor(%)=float(0,0,100) +#@gui :Utilize Dense Point Map=bool(0) +#@gui :Preserve Silhoutte=bool(1) +#@gui :Negate=bool(0) +#@gui :Regenerate Map=button() +#@gui :Old Attempts=int(100,5,2000)_0 +#@gui :Old Aggregation Mode=choice(0,"Corners","Axis[Slow!]","All-Around","Alternating")_0 +#@gui :Old Stem Tone=choice("Dark",Light")_0 +#@gui :Old Border Size=int(0,0,100)_0 +#@gui :Old Spread Factor(%)=float(0,0,100)_0 +#@gui :Old Utilize Dense Point Map=bool(0)_0 +#@gui :Old Preserve Silhoutte=bool(1)_0 +#@gui :Old Negate=bool(0)_0 +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2023/01/04.") +#@gui Dungeon Floor (Super Slow!):fx_rep_dungeon_floor,fx_rep_dungeon_floor_preview +#@gui :Tile Size=choice(0,"1x1","2x2") +#@gui :Tile Choice (If 1x1)=choice(0,"1","2","3","4") +#@gui :Subsampling=float(2,0,5) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2021/6/02.") +#@gui Dynamic Contrast:rep_dynamic_contrast,rep_dynamic_contrast_preview +#@gui :Amount=float(0,-64,64) +#@gui :Threshold=float(128,0,255) +#@gui :Intensity=float(255,0,255) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Code adapted from Source Code to Dynamic Contrast PDN plugin made by Remake.") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/12/18.") +#@gui Edge Fade:fx_rep_edgefade,fx_rep_edgefade_preview(0) +#@gui :_=note("If your image has slim alpha, activate Use Max Distance for better control over the fade, however preview will not be as accurate unless you view the full image.") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Half Image-Diagonal(%)=float(10,.1,100) +#@gui :Max Distance (%)=float(10,.1,100) +#@gui :Use Max Distance?=bool(0) +#@gui :Exponential Factor=float(2,0,3) +#@gui :_=separator() +#@gui :_=note("Local Normalization") +#@gui :Amplitude=float(0,0,15) +#@gui :Neighborhood Smoothness (%)=float(4,.1,100) +#@gui :Average Smoothness (%)=float(2,.1,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/7/13.") +#@gui Ellsworth Kelly Board:fx_rep_ekb,fx_rep_ekb_preview +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Square Size - Half Minimum-Dimension(%)=float(10,1,100) +#@gui :Border Size - Square Size(%)=float(10,-100,100) +#@gui :Border Size - Pixel=int(1,-50,50) +#@gui :Use Pixel Unit to Define Border=bool(1) +#@gui :Frequency(%)=float(50,5,100) +#@gui :Output=choice(0,"Inside","Resized") +#@gui :_=separator() +#@gui :_=note("Color Options") +#@gui :Unfilled Area Color=color(#6e6982) +#@gui :Keep Unfilled Area Empty?=bool(0) +#@gui :Exterior Border Color=color(#ffffff) +#@gui :Keep Exterior Border Color Empty?=bool(0) +#@gui :Border Value(%)=float(25,0,100) +#@gui :Palette=choice(0,"Predefined","Random") +#@gui :Number of Colors=int(12,5,100) +#@gui :Color Space=choice(0,"RGB","RYB","CMY","CMYK","HCY","HSI","HSL","HSV","LAB","LCH","YCbCr","YCbCrGLIC","YIQ","YUV","XYZ","YES") +#@gui :Predefined Palette=choice(10,"BW-RGB-5","WCMYK-5","RGBCMY-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus-256","PLAYPAl-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette","Koni32","Linear Color Palette Basic","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8","CD-BAC-16","CG Arne-16","Dinoknight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar [Lake Water Lily]-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet-20","Matrix-96","Material Design-96","Rainbow A-88","Rainbow B-96","SCRJ-XXXVI-36","Pxls Default-32","Moderna-24","Oak21-21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80s-8","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R\place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A-15","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Blessing-5","Fairydust 8","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-8","Ocean Glass-8","RoyalGuard-6","Eulbink-8","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 5","Tritanopia-4","Rabbit 7-4","Amiga 2600 NTSC-128","Amiga 2600 PAL-108","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series-256","CGA-16","C64[Pepto]-16","C64[Colodore]-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","VGA-256","Win95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Human Faces-94","MadjikHSV-96","ST24 Christmas","Reds-24","Pastel Rainbow-6") +#@gui :_=separator() +#@gui :_=note("Random") +#@gui :Main=int(0,0,1000000) +#@gui :Color=int(0,0,1000000) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/09/16.") +#@gui __Details +#@gui Emboss-Relief:fx_emboss_relief,fx_emboss_relief_preview(0) +#@gui :Radius=int(5,5,100) +#@gui :Angle=float(0,-180,180) +#@gui :Sigma=float(.5,.05,4) +#@gui :Value Scale=float(2,.5,10) +#@gui :Output=choice(0,"Emboss","Relief") +#@gui :Output Color=bool(1) +#@gui :Preserve Alpha?=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/12/07.") +#@gui _Testing +#@gui Reptorian +#@gui Fibonacci:fx_rep_fibonacci,fx_rep_fibonacci +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Fill Mode=choice(1,"Textile","Fill") +#@gui :Iterations=int(10,3,20) +#@gui :Direction=choice(0,"Top Left","Top Right","Bottom Left","Bottom Right") +#@gui :Fibonacci Style=choice(0,"Corner","Spiral") +#@gui :Initial Orientation=choice(0,"Landscape","Portrait") +#@gui :Center - Point=point(50,50) +#@gui :Boundary=choice(0,"Periodic","Mirror") +#@gui :Attachment=choice(0,"A","B") +#@gui :Integer Scale=int(1,1,10) +#@gui :_=separator() +#@gui :_=note("Coloring/Shading") +#@gui :Palette=choice(0,"Normalized Grayscale","BW-2","RGB-3","B-RGB-4","BW-RGB-5","CMY-3","CMYK-4","WCMYK-5","RGBCMY-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus-256","PLAYPAl-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette","Koni32","Linear Color Palette Basic","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8","CD-BAC-16","CG Arne-16","Dinoknight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar [Lake Water Lily]-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet-20","Matrix-96","Material Design-96","Rainbow A-88","Rainbow B-96","SCRJ-XXXVI-36","Pxls Default-32","Moderna-24","Oak21-21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80s-8","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R\place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A-15","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-8","Ocean Glass-8","RoyalGuard-6","Eulbink-8","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-4","Rabbit 7-4","Amiga 2600 NTSC-128","Amiga 2600 PAL-108","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","C64[Pepto]-16","C64[Colodore]-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-256","Win95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Human Faces-94","MadjikHSV-96","ST24 Christmas","Reds-24","Pastel Rainbow-6") +#@gui :Cycle Color(%)=float(0,0,100) +#@gui :Color Random Ordering Seed=int(2500,0,5000) +#@gui :Color Random Ordering Seed A=int(100,0,5000) +#@gui :Color Random Ordering Seed B=int(500,0,5000) +#@gui :Negate?=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/09/22.") +#@gui __Degradations +#@gui Fragment Blur:gui_rep_frblur,gui_rep_frblur_preview(0) +#@gui :_=note("Inspired by the Paint.NET Fragment Blur filter, this implementation improves upon it by adding color space options, preservation of original image as a option, boundary condition option, and interpolation option.\n\nWarning - Preview may not be accurate with image with completely opaque images. The output will not show any transparency regardless.") +#@gui :_=separator() +#@gui :_=note("Main Setting") +#@gui :Color Space=choice(0,"RGB","SRGB","RYB","CMYK","HCY","HSI","HSL","HSV","LAB","LCH") +#@gui :Additional Duplicates Count=int(10,2,100) +#@gui :Half Image-Diagonal (%)=float(5,0,100) +#@gui :Angle=float(0,-180,180) +#@gui :Superimpose with Original?=bool(0) +#@gui :_=separator() +#@gui :_=note("Secondary Setting") +#@gui :Boundary=choice(1,"None","Neumann","Periodic","Mirror") +#@gui :Shift Linear Interpolation?=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author : Reptorian Latest update: 2019/9/26.") +#@gui _Testing +#@gui Reptorian +#@gui Gaussian Blur By Color Space:fx_rep_blur_cs,fx_rep_blur_cs_preview +#@gui :XY-Amplitude=float(3,0,100) +#@gui :X-Amplitude=float(0,0,20) +#@gui :Y-Amplitude=float(0,0,20) +#@gui :Boundary=choice(1,"Black","Nearest") +#@gui :_=separator() +#@gui :Color Space=choice(0,"RGB","SRGB","RYB","CMY","CMYKA","HCY","HSI","HSL","HSV","LAB","LCH") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/10/04.") +#@gui Glass Vignette:gui_rep_gv,gui_rep_gv_preview(0) +#@gui :_=note("Distorts images as if it is based from the view of a bulged car mirror or camera len. This G'MIC filter is a heavily extended version of TR's Glass Vignette plugin made by TechnoRobbo for Paint.NET. It can also be used for generating abstract art as well.") +#@gui :_=separator() +#@gui :_=note("Refraction Settings") +#@gui :Refraction (%)=float(100,-200,200) +#@gui :Refraction Power (%)=float(0,-200,200) +#@gui :Len Size (%)=float(100,25,200) +#@gui :Chromatic Aberration (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :_=note("Transformations Settings") +#@gui :_=note("Preliminary Image Transformations") +#@gui :Preliminary Image Shift=point(50,50,0,1,128,128,128,255) +#@gui :Image Additional Zoom (%)=float(0,0,500) +#@gui :Image Angle=float(0,-180,180) +#@gui :_=separator() +#@gui :_=note("Distortion Transformations") +#@gui :Distortion Scale by X-Axis (%)=float(100,0,1000) +#@gui :Distortion Scale by Y-Axis (%)=float(100,0,1000) +#@gui :Distortion Scale by XY-Axis (%)=float(100,0.01,500) +#@gui :Distortion Angle=float(0,-180,180) +#@gui :Distortion Offset=point(50,50,0,1,255,255,255,255) +#@gui :_=note("When Distortion Scale by X-Axis and/or Y-Axis is 0, then distortion will be based on image ratio.") +#@gui :_=separator() +#@gui :_=note("Processing Settings") +#@gui :Colour Space=choice(0,"RGB","SRGB","RYB","CMY","CMYK",HCY",HSI","HSL","HSV","LAB","LCH","YIQ","YUV","YCbCr","YCbCrGLIC","XYZ","YES","Kodak 1","Ohta") +#@gui :Boundary=choice(3,"None","Neumann","Periodic","Mirror") +#@gui :Interpolation=choice(5,"Nearest","Average","Linear","Grid","Bicubic","Lanczos") +#@gui :Subpixel=float(1,0,2) +#@gui :_=separator() +#@gui :_=note("Preview Settings") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/04/06.") +#@gui Graduated Filter:fx_rep_graduated_filter,fx_rep_graduated_filter_preview(0) +#@gui :Strength (%)=float(50,0,100) +#@gui :Luminosity Filtering Strength (%)=float(100,0,100) +#@gui :Placement (%)=float(50,0,100) +#@gui :Filtering Angle=float(0,-180,180) +#@gui :Graduated Filter Color=color(#000000) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2020/1/4.") +#@gui Graphical Tiling Glitch (Interactive):fx_rep_x_graphical_tiling,fx_rep_x_graphical_tiling_preview(0) +#@gui :_=note("Launch the interactive graphical tiling window.\n\nDetails: The main purpose of this filter is to stimulate graphical tiling glitch observed in Microsoft Windows XP Operating System. However, you can also use it to tile images by hand to artistic purpose.\n\nPlease Read Instruction Below!") +#@gui :_=separator() +#@gui :_=note("Main) +#@gui :Initial Insertion Rate (milliseconds)=int(0,0,1000) +#@gui :Background Color=color(#000000) +#@gui :Autocrop and Separate?=bool(0) +#@gui :Reverse Layers?=bool(0) +#@gui :Output Mode=choice(1,"Tiled Only","New Layer","Blended") +#@gui :_=separator() +#@gui :_=note("Preview) +#@gui :Background Mode=choice(0,"Image","Colored","Alpha") +#@gui :Offset=point(50,50,0,1,255,255,255,255) +#@gui :Duplicates=int(5,1,50) +#@gui :Display Message?=bool(1) +#@gui :_=separator() +#@gui :_=note("Instruction) +#@gui :_=note("\nAll Mode\n\n- O: Change Preview Mode\n- SPACE: Switch Mode\n- ESC: End Interactive Window\n\nImportant Note: Check the message in the title bar.\n\nImage Placement Mode\n\n- D: Display Overlay Image\n- H: Flip Image Horizontally\n- V: Flip Image Vertically\n- Mouse Click: Move/Place Image\n- ARROW UP/DOWN: Change Tiling Image\n- ARROW LEFT/RIGHT: Rotate Image\n\nTiling Mode\n\n- Mouse Move: Place Tile at Insertion Rate\n- ARROW UP/DOWN: Add/Subtract Insertion Rate by 100 ms\n- ARROW LEFT/RIGHT: Add/Subtract Insertion rate by 10 ms") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/8/9.") +#@gui Grouped Pixel Axis-Based Shift:fx_rep_sptbwgp,fx_rep_sptbwgp_preview(1) +#@gui :_=note("Based off MadJik's Paint.NET Gravity Plugin. New feature are shift position, and influence factor.") +#@gui :_=separator() +#@gui :Shift Position (%)=float(0,-100,100) +#@gui :Influence Factor (%)=float(0,0,100) +#@gui :Threshold (%)=float(0,0,100) +#@gui :Axis=choice(0,"Horizontal","Vertical") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2022/11/24.") +#@gui Grouped Pixel Axis-Based Shift[Full Image]:fx_rep_sptbwgp_full,fx_rep_sptbwgp_preview_full(0)* +#@gui :_=note("Based off MadJik's Paint.NET Gravity Plugin. New feature are shift position, and influence factor. Full Image means the preview is utilizing full-sized image, so you may experience slow-down with huge images!") +#@gui :_=separator() +#@gui :Shift Position (%)=float(0,-100,100) +#@gui :Influence Factor (%)=float(100,0,100) +#@gui :Threshold (%)=float(0,0,100) +#@gui :Axis=choice(0,"Horizontal","Vertical") +#@gui :Old X Shift Position (%)=float(0,-100,100)_0 +#@gui :Old X Influence Factor (%)=float(100,0,100)_0 +#@gui :Old X Threshold (%)=float(0,0,100)_0 +#@gui :Old Y Shift Position (%)=float(0,-100,100)_0 +#@gui :Old Y Influence Factor (%)=float(100,0,100)_0 +#@gui :Old Y Threshold (%)=float(0,0,100)_0 +#@gui :Old Axis=choice(0,"Horizontal","Vertical")_0 +#@gui :Contain Alpha=int(0,0,1)_0 +#@gui :Minimum Alpha Index=int(0,0,100000000)_0 +#@gui :Has Activated Post-Changes=bool(0)_0 +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2022/11/24.") +#@gui Henon Phase Diagram:fx_rep_henon_phase_diagram,fx_rep_henon_phase_diagram_preview +#@gui :_=note("Creates Henon Phase Diagram.\n\nWarning!: If your image does not show up as expected, you may have to increase points per line and/or lines. Preview is inaccurate!") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :A-Factor=float(2.569,-3.1415,3.1415) +#@gui :Lines=int(500,1,1000000) +#@gui :Points Per Line=int(1000,1,2000) +#@gui :X0-Start=float(-.5,-5,0) +#@gui :X0-End=float(.5,0,5) +#@gui :X0-Increments=int(8,1,14) +#@gui :_=separator() +#@gui :_=note("Transformation") +#@gui :Scale=float(1,.01,4) +#@gui :Rotation=float(0,-180,180) +#@gui :Position=point(50,50,0,1,255,255,255,255) +#@gui :_=separator() +#@gui :_=note("Post-Processing") +#@gui :Subpixel Level=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Coloring") +#@gui :_=note("Preliminary") +#@gui :Mode=choice(0,"Grayscale","HSX","Palette") +#@gui :Use Alpha?=bool(0) +#@gui :_=separator() +#@gui :_=note("Additional") +#@gui :Gray Output=choice(0,"Normalized","Cut","Threshold") +#@gui :Multiplier=float(1,.01,50) +#@gui :HSX Mode=choice(2,"HCY","HSI","HSL/HSV") +#@gui :Palette=choice(0,"RGB-3","B-RGB-4","BW-RGB-5","CMY-3","CMYK-4","WCMYK-5","RGBCMY-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus-256","PLAYPAl-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette","Koni32","Linear Color Palette Basic","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8","CD-BAC-16","CG Arne-16","Dinoknight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar [Lake Water Lily]-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet-20","Matrix-96","Material Design-96","Rainbow A-88","Rainbow B-96","SCRJ-XXXVI-36","Pxls Default-32","Moderna-24","Oak21-21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80s-8","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R\place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A-15","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-8","Ocean Glass-8","RoyalGuard-6","Eulbink-8","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-4","Rabbit 7-4","Amiga 2600 NTSC-128","Amiga 2600 PAL-108","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","C64[Pepto]-16","C64[Colodore]-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-256","Win95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Human Faces-94","MadjikHSV-96","ST24 Christmas","Reds-24","Pastel Rainbow-6") +#@gui :Color Count=int(20,2,360)_0 +#@gui :Color Seed=int(0,0,100000)_0 +#@gui :Hue Shift(%)=float(0,0,100)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/3/14.") +#@gui Hitomezashi:fx_rep_hitomezashi,fx_rep_hitomezashi_preview(0)* +#@gui :_=note("Initial") +#@gui :_=separator() +#@gui :Mode=choice(0,"One String","Two Strings") +#@gui :Pixel Size=int(5,1,20) +#@gui :Symmetry=choice(0,"None","Symmetry A","Symmetry B","Symmetry C","Symmetry D") +#@gui :Output=choice(0,"Inside","Resized") +#@gui :Background Color=choice(0,"Black","White") +#@gui :Background Value=int(0,0,255) +#@gui :Background Color=color(#ffffff) +#@gui :_=note("\n\nString") +#@gui :_=separator() +#@gui :String=text("") +#@gui :String A=text("") +#@gui :String B=text("") +#@gui :⠀Randomize String⠀=button() +#@gui :⠀Randomize String A⠀=button() +#@gui :⠀Randomize String B⠀=button() +#@gui :⠀⠀Randomize Both⠀⠀=button() +#@gui :_=note("\nNote : Randomize has been programmed to generate binary as characters are converted as binary in the end.\n\n") +#@gui :_=note("Coloring and Shading") +#@gui :_=separator() +#@gui :Mode=choice(3,"Base Binary","Grayscale","Monotone","Duotone","Palette") +#@gui :Gray A=float(0,0,255) +#@gui :Gray B=float(255,0,255) +#@gui :Background Color=color(#808080) +#@gui :Color A=color(#f1ff55) +#@gui :Color B=color(#9f1a9d) +#@gui :Overall Coloring Palette=choice(0,"Pre-Defined Palettes","Random","Random Split-Gradients") +#@gui :Overall Color Space=choice(0,"RGB","HSL") +#@gui :Overall Palette Collection=choice(0,"256 Colors Collection","Pixel Art Palettes") +#@gui :Overall Palette=choice(44,"Default","HSV","Lines","Hot","Cool","Jet","Flag","Cube","Rainbow","Parula","Spring","Summer","Autumn","Winter","Bone","Copper","Pink","Vga","Algae","Amp","Balance","Curl","Deep","Delta","Dense","Diff","Gray","Haline","Ice","Matter","Oxy","Phase","Rain","Solar","Speed","Tarn","Tempo","Thermal","Topo","Turbid","Aurora","Hocus Pocus","SRB2","Uzebox","Amiga 7800","Amiga7800 MESS","Fornax Void I") +#@gui :Overall Palette=choice(10,"BW-2","RGB-3","B-RGB-4","BW-RGB-5","CMY-3","CMYK-4","WCMYK-5","RGBCMY-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus-256","PLAYPAl-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette","Koni32","Linear Color Palette Basic","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8","CD-BAC-16","CG Arne-16","Dinoknight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar [Lake Water Lily]-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet-20","Matrix-96","Material Design-96","Rainbow A-88","Rainbow B-96","SCRJ-XXXVI-36","Pxls Default-32","Moderna-24","Oak21-21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80s-8","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R\place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A-15","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-8","Ocean Glass-8","RoyalGuard-6","Eulbink-8","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-4","Rabbit 7-4","Amiga 2600 NTSC-128","Amiga 2600 PAL-108","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","C64[Pepto]-16","C64[Colodore]-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-256","Win95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Human Faces-94","MadjikHSV-96","ST24 Christmas","Reds-24","Pastel Rainbow-6") +#@gui :Overall Number of Colors=int(8,2,255) +#@gui :Overall Number of Split-Colors=int(5,1,25) +#@gui :Overall Number of Colors Per Split=int(4,2,10) +#@gui :Overall Seed=int(0,0,200000) +#@gui :Overall Seed=int(0,0,200000) +#@gui :Overall Randomize Seed=button() +#@gui :Overall Boundary=choice(0,"Periodic","Continuous") +#@gui :Overall Shift Colors(%)=float(0,0,100) +#@gui :Overall Reverse Internal=bool(0) +#@gui :Overall Reverse Entire=bool(0) +#@gui :Overall Reverse=bool(0) +#@gui :Stray Coloring Palette=choice(0,"Single","Pre-Defined Palette","Random") +#@gui :Stray Color=color(#000000) +#@gui :Stray Palette=choice(10,"BW-2","RGB-3","B-RGB-4","BW-RGB-5","CMY-3","CMYK-4","WCMYK-5","RGBCMY-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus-256","PLAYPAl-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette","Koni32","Linear Color Palette Basic","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8","CD-BAC-16","CG Arne-16","Dinoknight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar [Lake Water Lily]-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet-20","Matrix-96","Material Design-96","Rainbow A-88","Rainbow B-96","SCRJ-XXXVI-36","Pxls Default-32","Moderna-24","Oak21-21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80s-8","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R\place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A-15","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-8","Ocean Glass-8","RoyalGuard-6","Eulbink-8","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-4","Rabbit 7-4","Amiga 2600 NTSC-128","Amiga 2600 PAL-108","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","C64[Pepto]-16","C64[Colodore]-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-256","Win95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Human Faces-94","MadjikHSV-96","ST24 Christmas","Reds-24","Pastel Rainbow-6") +#@gui :Stray Number of Colors=int(8,2,20) +#@gui :Stray Seed=int(0,0,200000) +#@gui :Stray Randomize Seed=button() +#@gui :Stray Symmetry=bool(0)_0 +#@gui :Stray Reverse=bool(0) +#@gui :_=note("Border") +#@gui :_=separator() +#@gui :Border Size(%)=float(10,0,100) +#@gui :Border Value=float(128,0,255) +#@gui :Border Color=color(#000000) +#@gui :_=note("Preview") +#@gui :_=separator() +#@gui :Cropped Viewport Point=point(50,50,-1,1,255,255,255,255,1%) +#@gui :Reset Points to Center=button() +#@gui :Started Filter=bool(1)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2022/04/29.") +#@gui HSX Posterize-Index:fx_rep_p_i,fx_rep_p_i_preview +#@gui :Hue Bands=int(10,2,360) +#@gui :Saturation Bands=int(10,2,100) +#@gui :Luminosity Bands=int(10,2,100) +#@gui :Dithering (%)=float(50,0,100) +#@gui :Start Hue=float(0,0,360) +#@gui :Colour Space=choice(2,"HSI","HSL","HSV","HCY") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2022/12/08.") +#@gui Image Dimensions Factors:_none_,fx_find_factors_of_images_preview(1)* +#@gui :_=note("This tool is used to calculate factors of your image dimension. It is not used to change image.") +#@gui :_=separator() +#@gui :Image Index Position(%)=float(0,0,100) +#@gui :Image Index=text("0") +#@gui :Width Factors=_text("Width Factors will be calculated and inserted here") +#@gui :Height Factors=_text("Height Factors will be calculated and inserted here") +#@gui :Width and Height Factors=_text("Width and Height Factors will be calculated and inserted here") +#@gui :Factors Information=_text(1,"Every factors can be copied and pasted from this box") +#@gui :Image Index Position(%)=float(0,0,100)_0 +#@gui :Image Index=text("0")_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2022/12/11.") +#@gui __Deformations +#@gui Kaleidoscope [Reptorian-Polar]:gui_rep_polkal,gui_rep_polkal +#@gui :Angle Cut=float(2,.01,100) +#@gui :Radius Cut=float(1,.01,100) +#@gui :Surface Angle=float(0,-180,180) +#@gui :Center (%)=point(50,50) +#@gui :Flip Angle Direction?=bool(0) +#@gui :Flip Radial Direction?=bool(0) +#@gui :Angle Edge Behaviour=choice(1,"Repeat","Alternating") +#@gui :Radial Edge Behaviour=choice(2,"None","Repeat","Alternating") +#@gui :Fit Radial End to Min/Max Dimension=choice(0,"Minimum Dimension","Maximum Dimension") +#@gui :Conical Start at 0?=bool(1) +#@gui :_=note("Conical start is only used for matching other software filter behavior with conical gradients") +#@gui :_=separator() +#@gui :Sublevel=float(.5,0,3) +#@gui :Interpolation=choice(2,"Nearest","Average","Linear","Grid","Bicubic","Lanczos") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/9/7.") +#@gui _Testing +#@gui Reptorian +#@gui Lavander Binary Map:fx_rep_lavander_binary_map,fx_rep_lavander_binary_map_preview(0)* +#@gui :_=note("Based on the work of Lavander at discord/generative. Instruction on how it works is described at the bottom of this filter.") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Size of Array=choice(0,"Auto","User-Defined") +#@gui :User-Defined Size=int(8,2,14) +#@gui :Formula=choice(5,"AND-Simple","OR-Simple","XOR-Simple","AND","OR","XOR","User-Defined") +#@gui :Binary String A=text("01") +#@gui :Binary String B=text("10") +#@gui :Binary String=text("01") +#@gui :Shift Factor=int(0,0,1000000) +#@gui :Custom Formula=text{"xor(min(xor(x(),y()),xor(ix(),iy())),ix()|iy())"} +#@gui :_=separator() +#@gui :_=note("Additional") +#@gui :TODO Direction=choice(0,"Default","Mirror-X","Mirror-Y","Mirror-XY")_0 +#@gui :Symmetry=choice(0,"None","Symmetry A","Symmetry B","Symmetry C","Symmetry D") +#@gui :TODO Smooth-Shading=bool(0)_0 +#@gui :Post-Process Out-Of-Bound=choice(0,"None","Periodic","Reflected") +#@gui :_=separator() +#@gui :_=note("Random Binary String") +#@gui :Number of Digits for Binary String A=int(2,1,4) +#@gui :Number of Digits for Binary String B=int(2,1,4) +#@gui :Number of Digits for Binary String=int(2,1,4) +#@gui :Binary String A Index=int(0,0,1) +#@gui :Binary String A Index=int(1,0,3) +#@gui :Binary String A Index=int(2,0,7) +#@gui :Binary String A Index=int(0,0,15) +#@gui :Binary String B Index=int(1,0,1) +#@gui :Binary String B Index=int(2,0,3) +#@gui :Binary String B Index=int(5,0,7) +#@gui :Binary String B Index=int(1,0,15) +#@gui :Binary String Index=int(1,0,1) +#@gui :Binary String Index=int(2,0,3) +#@gui :Binary String Index=int(5,0,7) +#@gui :Binary String Index=int(1,0,15) +#@gui :Randomize Binary String A=button() +#@gui :Randomize Binary String B=button() +#@gui :Randomize Both=button() +#@gui :Randomize=button() +#@gui :_=separator() +#@gui :_=note("Color") +#@gui :Color Mode=choice(1,"Normalized","Colorized") +#@gui :Number of Colors=int(5,3,5) +#@gui :Color A=color(#000000) +#@gui :Color B=color(#906f7a) +#@gui :Color C=color(#ffffff) +#@gui :Color A=color(#000000) +#@gui :Color B=color(#2e7d59) +#@gui :Color C=color(#9d9cbd) +#@gui :Color D=color(#ffffff) +#@gui :Color A=color(#000000) +#@gui :Color B=color(#057a49) +#@gui :Color C=color(#906f7a) +#@gui :Color D=color(#a4b8da) +#@gui :Color E=color(#ffffff) +#@gui :Recolor Using Changed Number of Color=button() +#@gui :Random Shade Exponential Factor (%)=float(0,-80,80) +#@gui :Random Lightness Start A (%)=float(0,0,100) +#@gui :Random Darkness Start B(%)=float(0,0,100) +#@gui :TODO Maximum - Lightness=_float(50,50,100)_0 +#@gui :TODO Minimum - Darkness=_float(0,0,50)_0 +#@gui :Random Seed Index=int(12000,0,24000) +#@gui :Randomize Colors=button() +#@gui :Recolor with Current Seed=button() +#@gui :Randomization Status=int(2,0,2)_0 +#@gui :Previous Randomization Status=int(2,0,2)_0 +#@gui :_=separator() +#@gui :_=note("CLI Command") +#@gui :Copy-Able Text=_text("Input Text") +#@gui :Stored Text=_text("Restore Text")_0 +#@gui :Stored Text 2=_text("Stored Text 2")_0 +#@gui :Color Information=_text("Color Information")_0 +#@gui :Mapping Information=_text("Mapping Information")_0 +#@gui :Escape Quotation Mark=bool(0) +#@gui :_=separator() +#@gui :_=note("Custom Formula Available Macros and Variables") +#@gui :_=note{"\nBasic Description:\n\nRecommended Variables to Use\n\n1 - x : X-Coordinate of image\n2 - y : Y-Coordinate of image\n3 - ix : Inverted X-Coordinate of image\n4 - iy : Inverted Y-Coordinate of image\n\nRecommended Macros to Use\n\n1 - x() : Value at index X-Coordinate of image inside reference array\n2 - y() : Value at index Y-Coordinate of image inside reference array\n3 - ix() : Value at index Inverted X-Coordinate of image inside reference array\n4 - iy() : Value at index Inverted X-Coordinate of image inside reference array\n\nRecommended Operators to Use\n\n1 - xor( a,b ) : Return the value of XOR operation using a,b\n2 - a & b / and(a,b): Return the AND value using a,b\n3 - a | b / or(a,b) : Return the OR value using a,b\n4 - flip(v) : Flip bits of value."} +#@gui :_=separator() +#@gui :_=note("Description of How this filter work") +#@gui :_=note{"\nBasic Description:\n\nGenerates a image based on the count of binary number found in string of binary. Initial array contains value count-sorted by count of binary number within binary representation of integers.\n\nStep:\n\n1) Create an array of integer that matches index with size of 2^n.\n2) Create another array which is the count of 'bin_a' in binary representation of the previous array.\n3) Count sort the array of integer with the count of binary number array.\n4) Delete all other array other than the sorted array.\n5) Generate a surface with row and column the same size as the primary array, and use formula which takes values from the sorted value, and then find the count of 'bin_b' in binary representation of the found value.\n\nSource Code: \n\nAuthor: Lavander in discord/generative AKA weightt_an in discuss.pixls.us"} +#@gui :Python Source Code=_text{1,"def m_show(m,size = 4,cmap = 'afmhot'):\n import matplotlib.pyplot as plt\n from numpy import array\n cmaps = ['binary','gist_yarg','gist_gray','gray','bone',\n 'pink','spring','summer','autumn','winter','cool',\n 'Wistia','hot','afmhot','gist_heat','copper']\n plt.figure(num = None,figsize=(size,size),dpi=300)\n plt.axis('off')\n plot = plt.imshow(array(m),cmap = cmap) #,interpolation='bicubic' )\n plt.show()\n plt.close()\n\nfrom tqdm import tqdm\n\ndef get_matrix_bin(s):\n n = len(s)\n mat = [[0]*n for i in range(n)]\n for x in tqdm(range(0,n)):\n for y in range(0,n):\n f = format((s[x] ^ s[y]),'b').count('10')\n mat[x][y] = f\n #mat[y][x] = f\n return mat\n\nbig_n = 11\n\npows = [i for i in range(0,2**big_n)]\npows = sorted(pows,key = lambda k: format(k,'b').count('01'))\nadj_m = get_matrix_bin(pows)\n\nm_show(adj_m)"} +#@gui :Stored Text=_text{1,"def m_show(m,size = 4,cmap = 'afmhot'):\n import matplotlib.pyplot as plt\n from numpy import array\n cmaps = ['binary','gist_yarg','gist_gray','gray','bone',\n 'pink','spring','summer','autumn','winter','cool',\n 'Wistia','hot','afmhot','gist_heat','copper']\n plt.figure(num = None,figsize=(size,size),dpi=300)\n plt.axis('off')\n plot = plt.imshow(array(m),cmap = cmap) #,interpolation='bicubic' )\n plt.show()\n plt.close()\n\nfrom tqdm import tqdm\n\ndef get_matrix_bin(s):\n n = len(s)\n mat = [[0]*n for i in range(n)]\n for x in tqdm(range(0,n)):\n for y in range(0,n):\n f = format((s[x] ^ s[y]),'b').count('10')\n mat[x][y] = f\n #mat[y][x] = f\n return mat\n\nbig_n = 11\n\npows = [i for i in range(0,2**big_n)]\npows = sorted(pows,key = lambda k: format(k,'b').count('01'))\nadj_m = get_matrix_bin(pows)\n\nm_show(adj_m)"}_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2023/03/21.") +#@gui :Started?=bool(0)_0 +#@gui :Size of Array=choice(0,"Auto","User-Defined")_0 +#@gui :Formula=choice(2,"AND-Simple","OR-Simple","XOR-Simple","AND","OR","XOR","User-Defined")_0 +#@gui :Binary String A=text("01")_0 +#@gui :Binary String B=text("10")_0 +#@gui :Binary String=text("01")_0 +#@gui :Binary String A Index=int(0,0,1)_0 +#@gui :Binary String A Index=int(1,0,3)_0 +#@gui :Binary String A Index=int(2,0,7)_0 +#@gui :Binary String A Index=int(0,0,15)_0 +#@gui :Binary String B Index=int(1,0,1)_0 +#@gui :Binary String B Index=int(2,0,3)_0 +#@gui :Binary String B Index=int(5,0,7)_0 +#@gui :Binary String B Index=int(1,0,15)_0 +#@gui :Binary String Index=int(1,0,1)_0 +#@gui :Binary String Index=int(2,0,3)_0 +#@gui :Binary String Index=int(5,0,7)_0 +#@gui :Binary String Index=int(1,0,15)_0 +#@gui :Shift Factor=int(0,0,1000000)_0 +#@gui :Custom Formula=text{"xor(min(xor(x(),y()),xor(ix(),iy())),ix()|iy())"}_0 +#@gui :TODO Direction=choice(0,"Default","Mirror-X","Mirror-Y","Mirror-XY")_0 +#@gui : 0 Symmetry=choice(0,"None","Symmetry A","Symmetry B","Symmetry C","Symmetry D")_0 +#@gui :TODO Smooth-Shading=bool(0)_0 +#@gui :User-Defined Size=int(8,2,14)_0 +#@gui :Size of Image=int(8,2,14)_0 +#@gui :Auto-Size of Image=int(0,0,14)_0 +#@gui :Auto-Size of Symmetric Image=int(0,0,14)_0 +#@gui :Color Mode=choice(1,"Normalized","Colorized")_0 +#@gui :Number of Colors=int(5,3,5)_0 +#@gui :Color A=color(#000000)_0 +#@gui :Color B=color(#906f7a)_0 +#@gui :Color C=color(#ffffff)_0 +#@gui :Color A=color(#000000)_0 +#@gui :Color B=color(#2e7d59)_0 +#@gui :Color C=color(#9d9cbd)_0 +#@gui :Color D=color(#ffffff)_0 +#@gui :Color A=color(#000000)_0 +#@gui :Color B=color(#057a49)_0 +#@gui :Color C=color(#906f7a)_0 +#@gui :Color D=color(#a4b8da)_0 +#@gui :Color E=color(#ffffff)_0 +#@gui :Random Shade Exponential Factor (%)=_float(0,-80,80)_0 +#@gui :Random Lightness Start A (%)=_float(0,0,100)_0 +#@gui :Random Darkness Start B(%)=_float(0,0,100)_0 +#@gui :TODO Maximum - Lightness=_float(50,50,100)_0 +#@gui :TODO Minimum - Darkness=_float(0,0,50)_0 +#@gui :Random Seed Index=int(12000,0,24000)_0 +#@gui :TODO Has Activated Smooth?-Shade=bool(0)_0 +#@gui __Deformations +#@gui Logarithmic Distortion:rep_logpindis_gui,rep_logpindis_gui_preview(0) +#@gui :_=note("This filter is a extended version of a filter found in Asmageddon Tools Pack v3. Translated to G'MIC using a source code, and then extended. It is a mixture of two texture filters.") +#@gui :_=separator() +#@gui :Distortion Factor=float(1,.1,1000) +#@gui :Preliminary Surface Shift=point(50,50,0,1,128,128,128,255) +#@gui :Distortion Surface Position=point(50,50,0,1,255,255,255,255) +#@gui :Preliminary X-Axis Scaling=float(1,.1,10) +#@gui :Preliminary Y-Axis Scaling=float(1,.1,10) +#@gui :Effect X-Axis Scaling=float(1,.1,10) +#@gui :Effect Y-Axis Scaling=float(1,.1,10) +#@gui :Distortion Surface Angle=float(0,0,360) +#@gui :Placement=choice(0,"Inside-Out","Outside-In") +#@gui :Logarithmic Distortion Axis Combination for X-Axis=choice(0,"Different Axis","Same Axis") +#@gui :Logarithmic Distortion Axis Combination for Y-Axis=choice(0,"Different Axis","Same Axis") +#@gui :Logarithmic Distortion X-Axis Direction=choice(0,"Negative","Positive") +#@gui :Logarithmic Distortion Y-Axis Direction=choice(0,"Negative","Positive") +#@gui :Boundary Condition=choice(0,"Periodic","Mirror") +#@gui :Interpolation=choice(2,"Nearest","Linear","Bicubic") +#@gui :Base Reference Dimension=int(1024,10,4096) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/6/4.") +#@gui _Testing +#@gui Reptorian +#@gui Majority:gui_rep_majority,gui_rep_majority_preview +#@gui :_=separator() +#@gui :_=note("Filter Options") +#@gui :Color Space=choice(11,"RGB","SRGB","RYB","CMY","CMYK","HCY","HSI","HSL","HSV","LAB","LCH","YIQ","YUV","YCbCr","YCbCrGLIC","XYZ","YES","Kodak 1","Ohta") +#@gui :Contain Alpha=bool(0) +#@gui :Kernel Size=int(5,2,50) +#@gui :Mode=choice(0,"Soft Regular","Soft Average Channels","Hard Regular,"Hard Average Channels") +#@gui :Convert to Black and White?=bool(0) +#@gui :_=separator() +#@gui :_=note("Preview Setting") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Info about filter\n\nMajority effects comes in one of those two version.\n\n1- Use a predefined value to take either the value of the min/max values within kernel.\n\n2-Automatically let the average of kernel to define which values to take which can be either min/max value within kernel.") +#@gui :_=separator() +#@gui :_=note("More information - Paint.NET Majority Effect") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/12/31.") +#@gui Majority [Threshold]:gui_rep_majority_threshold,gui_rep_majority_threshold_preview +#@gui :_=separator() +#@gui :_=note("Filter Options") +#@gui :Color Space=choice(11,"RGB","SRGB","RYB","CMY","CMYK","HCY","HSI","HSL","HSV","LAB","LCH","YIQ","YUV","YCbCr","YCbCrGLIC","XYZ","YES","Kodak 1","Ohta") +#@gui :Contain Alpha=bool(0) +#@gui :Kernel Size=int(5,2,50) +#@gui :Tolerance (%)=float(50,0,100) +#@gui :Conditional Mode=choice(1,"Less Than","Greater Than") +#@gui :Output Mode=choice(0,"Soft","Hard") +#@gui :Convert to Black and White?=bool(0) +#@gui :_=separator() +#@gui :_=note("Preview Setting") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Info about filter\n\nMajority effects comes in one of those two version.\n\n1- Use a predefined value to take either the value of the min/max values within kernel.\n\n2-Automatically let the average of kernel to define which values to take which can be either min/max value within kernel.") +#@gui :_=separator() +#@gui :_=note("More information - Paint.NET Majority Effect") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/12/31.") +#@gui Markus-Lyapunov Fractal:fx_rep_mlfrac,fx_rep_mlfrac +#@gui :_=note("Create a mapping of Lyapunov exponent within two values or three values.") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :ABC-String=text("ab") +#@gui :ABC-String Repeats=int(50,1,255) +#@gui :Subsampling Level=float(1,0,6) +#@gui :Viewport(%)=float(100,0,100) +#@gui :Position=point(50,50,0,1,255,255,255,255) +#@gui :C-Time(%)=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Output") +#@gui :Mode=choice(0,"Grayscale","Duotone","Random","Palette","Layers") +#@gui :Use Inverted?=bool(0) +#@gui :Color A=color(#0000ffff) +#@gui :Color B=color(#ffff00ff) +#@gui :Set of Palettes=choice(0,"Single","Double") +#@gui :Seed=int(0,0,10000000) +#@gui :Random Palette Color Count=int(8,2,64) +#@gui :Random Palette A Color Count=int(8,2,64) +#@gui :Random Palette B Color Count=int(8,2,64) +#@gui :Color Space=choice(0,"HSL","LAB","LCH") +#@gui :Palette=choice(12,"BW-2","RGB-3","B-RGB-4","BW-RGB-5","CMY-3","CMYK-4","WCMYK-5","RGBCMY-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus-256","PLAYPAl-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette","Koni32","Linear Color Palette Basic","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8","CD-BAC-16","CG Arne-16","Dinoknight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar [Lake Water Lily]-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet-20","Matrix-96","Material Design-96","Rainbow A-88","Rainbow B-96","SCRJ-XXXVI-36","Pxls Default-32","Moderna-24","Oak21-21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80s-8","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R\place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A-15","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-8","Ocean Glass-8","RoyalGuard-6","Eulbink-8","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-4","Rabbit 7-4","Amiga 2600 NTSC-128","Amiga 2600 PAL-108","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","C64[Pepto]-16","C64[Colodore]-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-256","Win95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Human Faces-94","MadjikHSV-96","ST24 Christmas","Reds-24","Pastel Rainbow-6") +#@gui :Palette Order=choice(0,"Default","Randomized","Mirrored") +#@gui :Palette A=choice(16,"BW-2","RGB-3","B-RGB-4","BW-RGB-5","CMY-3","CMYK-4","WCMYK-5","RGBCMY-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus-256","PLAYPAl-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette","Koni32","Linear Color Palette Basic","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8","CD-BAC-16","CG Arne-16","Dinoknight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar [Lake Water Lily]-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet-20","Matrix-96","Material Design-96","Rainbow A-88","Rainbow B-96","SCRJ-XXXVI-36","Pxls Default-32","Moderna-24","Oak21-21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80s-8","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R\place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A-15","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-8","Ocean Glass-8","RoyalGuard-6","Eulbink-8","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-4","Rabbit 7-4","Amiga 2600 NTSC-128","Amiga 2600 PAL-108","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","C64[Pepto]-16","C64[Colodore]-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-256","Win95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Human Faces-94","MadjikHSV-96","ST24 Christmas","Reds-24","Pastel Rainbow-6") +#@gui :Palette A Order=choice(0,"Default","Randomized","Mirrored") +#@gui :Palette B=choice(50,"BW-2","RGB-3","B-RGB-4","BW-RGB-5","CMY-3","CMYK-4","WCMYK-5","RGBCMY-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus-256","PLAYPAl-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette","Koni32","Linear Color Palette Basic","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8","CD-BAC-16","CG Arne-16","Dinoknight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar [Lake Water Lily]-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet-20","Matrix-96","Material Design-96","Rainbow A-88","Rainbow B-96","SCRJ-XXXVI-36","Pxls Default-32","Moderna-24","Oak21-21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80s-8","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R\place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A-15","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-8","Ocean Glass-8","RoyalGuard-6","Eulbink-8","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-4","Rabbit 7-4","Amiga 2600 NTSC-128","Amiga 2600 PAL-108","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","C64[Pepto]-16","C64[Colodore]-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-256","Win95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Human Faces-94","MadjikHSV-96","ST24 Christmas","Reds-24","Pastel Rainbow-6") +#@gui :Palette B Order=choice(0,"Default","Randomized","Mirrored") +#@gui :Color Count=int(8,2,64) +#@gui :Palette Order=choice(0,"Default","Randomized","Mirrored") +#@gui :Color Count A=int(8,2,64) +#@gui :Palette A Order=choice(0,"Default","Randomized","Mirrored") +#@gui :Color Count B=int(8,2,64) +#@gui :Palette B Order=choice(0,"Default","Randomized","Mirrored") +#@gui :Reverse Layers=bool(0) +#@gui :Reverse Non-Target Layers=bool(0) +#@gui :Mode=choice(0,"Import One File Only","Import Two Files")_0 +#@gui :File=file()_0 +#@gui :File A=file()_0 +#@gui :File B=file()_0 +#@gui :Color Count=int(8,2,64)_0 +#@gui :Randomize Color Position=bool(0)_0 +#@gui :Color Count A=int(8,2,64)_0 +#@gui :Randomize Colors A Position=bool(0)_0 +#@gui :Color Count B=int(8,2,64)_0 +#@gui :Randomize Colors B Position=bool(0)_0 +#@gui :_=separator() +#@gui :_=note("Orientation") +#@gui :X-Direction=choice(0,"Default","Mirrored")_0 +#@gui :Y-Direction=choice(0,"Default","Mirrored")_0 +#@gui :_=note("Under Development!") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/08/25.") +#@gui Mitchell Concatenation:fx_rep_mitchell_concatenation,fx_rep_mitchell_concatenation_preview(0)* +#@gui :_=note("This filter is a recreation of Kerry's Mitchell Concatenation.\n\nWarning: Make sure of the options being applied!") +#@gui :_=separator() +#@gui :_=note("Initial") +#@gui :Mode=choice(0,"Singular","Dual") +#@gui :Pixel Size(%)=float(0,0,50) +#@gui :Output=choice(0,"New Dimension","Old Dimension") +#@gui :_=separator() +#@gui :_=note("Starting Point") +#@gui :Start=int(1,1,2000000) +#@gui :Start A=int(1,1,2000000) +#@gui :Start B=int(1,1,2000000) +#@gui :Link Start Numbers?=bool(0) +#@gui :_=separator() +#@gui :_=note("Base System") +#@gui :Base=int(10,2,1000) +#@gui :Base A=int(10,2,1000) +#@gui :Base B=int(10,2,1000) +#@gui :Link Bases?=bool(0) +#@gui :_=separator() +#@gui :_=note("Method") +#@gui :Method=choice(0,"Subtraction","Addition","Multiplication") +#@gui :Method A=choice(0,"Subtraction","Addition","Multiplication") +#@gui :Method B=choice(1,"Subtraction","Addition","Multiplication") +#@gui :Link Method?=bool(0) +#@gui :_=separator() +#@gui :_=note("Palette") +#@gui :Mode=choice(1,"Singular","Dual") +#@gui :Set=choice(0,"Foreground","Background") +#@gui :Color 1=color(#ffffff) +#@gui :Color 2=color(#f3ebe3) +#@gui :Color 3=color(#c8c888) +#@gui :Color 4=color(#7c8f5b) +#@gui :Color 5=color(#354a43) +#@gui :Color 6=color(#221724) +#@gui :Color 7=color(#000000) +#@gui :Color 1=color(#cecece) +#@gui :Color 2=color(#c6bab6) +#@gui :Color 3=color(#a687b6) +#@gui :Color 4=color(#786946) +#@gui :Color 5=color(#374530) +#@gui :Color 6=color(#25212f) +#@gui :Color 7=color(#181818) +#@gui :Color 1=color(#ffffff) +#@gui :Color 2=color(#f3ece3) +#@gui :Color 3=color(#bac888) +#@gui :Color 4=color(#668f5b) +#@gui :Color 5=color(#37354a) +#@gui :Color 6=color(#241719) +#@gui :Color 7=color(#000000) +#@gui :Link Color Palettes?=bool(0) +#@gui :_=separator() +#@gui :_=note("Shape") +#@gui :Use Shape=bool(1) +#@gui :Tiled Shape=choice(2,"Australia","Barbedwire","Circle","Crosshair","Cupid","Diamond","Dragon Curve-[D]","Dragonfly","Fern-[D]","Flip","Gear-[D]","Gumleaf","Heart","Information","Kookaburra","Mail","Mapleleaf","Paint Splat","Paw","Phone","Polygon-[D]","Rooster","Shopping Cart","Snowflake-[D]","Star-[D]") +#@gui :Use Image as Shape?=bool(0) +#@gui :Ratio(%)=float(100,.1,100) +#@gui :Angle=float(0,-180,180) +#@gui :Direction=choice(0,"None","Mirror X","Mirror Y") +#@gui :Tile Boundary=choice(0,"Periodic","Mirror - X","Mirror - Y","Mirror - XY") +#@gui :Fit Tile?=bool(1) +#@gui :Dragon Curve Recursion=int(10,0,30) +#@gui :Dragon Curve Rotation=float(0,-180,180) +#@gui :Fern Type=choice("Asplenium Adiantum-Nigrum","Thelypteridaceae") +#@gui :Fern Density (%)=float(100,0,300) +#@gui :Gear Teeth Count=int(8,3,32) +#@gui :Gear Height (%)=float(25,0.1,100) +#@gui :Gear Offset Teeth (%)=float(0,0,100) +#@gui :Gear Inner Ratio (%)=float(50,0.1,100) +#@gui :Polygon Vertices=int(5,3,100) +#@gui :Snowflake Recursion=int(5,1,6) +#@gui :Star Branches=int(3,5,100) +#@gui :Star Thickness (%)=float(38,.1,100) +#@gui :_=separator() +#@gui :_=note("Misc") +#@gui :Position=choice(0,"10","100","1000","10000","100000") +#@gui :Position A=choice(0,"10","100","1000","10000","100000") +#@gui :Position B=choice(0,"10","100","1000","10000","100000") +#@gui :Push into Start Number=button() +#@gui :Push into Start A=button() +#@gui :Push into Start B=button() +#@gui :Push into Both=button() +#@gui :Start A=int(1,1,2000000)_0 +#@gui :Start B=int(1,1,2000000)_0 +#@gui :Base A=int(10,2,1000)_0 +#@gui :Base B=int(10,2,1000)_0 +#@gui :Method A=choice(0,"Subtraction","Addition","Multiplication")_0 +#@gui :Method B=choice(0,"Subtraction","Addition","Multiplication")_0 +#@gui :Color 1=color(#ffffff)_0 +#@gui :Color 2=color(#f3ebe3)_0 +#@gui :Color 3=color(#c8c888)_0 +#@gui :Color 4=color(#7c8f5b)_0 +#@gui :Color 5=color(#354a43)_0 +#@gui :Color 6=color(#221724)_0 +#@gui :Color 7=color(#000000)_0 +#@gui :Color 1=color(#cecece)_0 +#@gui :Color 2=color(#c6bab6)_0 +#@gui :Color 3=color(#a687b6)_0 +#@gui :Color 4=color(#786946)_0 +#@gui :Color 5=color(#374530)_0 +#@gui :Color 6=color(#25212f)_0 +#@gui :Color 7=color(#181818)_0 +#@gui :Color 1=color(#ffffff)_0 +#@gui :Color 2=color(#f3ece3)_0 +#@gui :Color 3=color(#bac888)_0 +#@gui :Color 4=color(#668f5b)_0 +#@gui :Color 5=color(#37354a)_0 +#@gui :Color 6=color(#241719)_0 +#@gui :Color 7=color(#000000)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2022/02/08.") +#@gui __Rendering +#@gui Nebulous:fx_rep_nebulous,fx_rep_nebulous_preview +#@gui :_=note("Based off MadJik's PDN Nebulous plugin. The G'MIC version of Nebulous allows you to manipulate the result by angle within the main surface and the distortion surface, and allows you to shift the positioning of the Nebulous surface. Furthermore, the G'MIC version of Nebulous doesn't use integer on the output of surface.") +#@gui :_=separator() +#@gui :_=note("Surface Theme") +#@gui :Colour Space Mode=choice(0,"RGB8","RYB8","HSI8","HSL8","HSV8","LAB8","LCH8","YIQ8","YUV8","XYZ8","YES8","Kodak 1-8","Ohta8","YCoCg-R") +#@gui :_=separator() +#@gui :_=note("Surface Generation") +#@gui :XY-Factor=float(4,.1,1000) +#@gui :X-Factor=float(10,.01,1000) +#@gui :Y-Factor=float(10,.01,1000) +#@gui :X-Shift (%)=float(0,-10,10) +#@gui :Y-Shift (%)=float(0,-10,10) +#@gui :Angle of Main Nebulous Surface=float(0,-180,180) +#@gui :Wave(s)=float(1,-25,25) +#@gui :Lighting Angle=float(0,-180,180) +#@gui :Surface Disturbance=float(0,0,2000) +#@gui :Surface Disturbance Multiplier=float(1,1,500) +#@gui :Disturbance X=float(0,0,1000) +#@gui :Disturbance Y=float(0,0,1000) +#@gui :Angle of Disturbance Surface=float(0,-180,180) +#@gui :Disturbance Scale-By-Factor=bool(0) +#@gui :Output Mode=choice(2,"Built-in Gray","Luminosity from Color","Color") +#@gui :Alpha Mode=choice(0,"None","Hard Light","Hard Dark","Smooth Light","Smooth Dark") +#@gui :_=separator() +#@gui :_=note("Subpixel Processing\n\n You do not need to touch this unless you want higher amount of precision, but the difference is small. If you are using a very small surface or hard alpha mode, then it makes sense to touch subpixel processing variables.") +#@gui :Subpixel Level=float(1,0,3) +#@gui :Subpixel Interpolation=choice(3,"Average","Linear","Grid","Bicubic","Lanczos") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2019/5/11.") +#@gui _Testing +#@gui Reptorian +#@gui Newton Fractal [MadJik Style]:rep_mj_newf,rep_mj_newf +#@gui :_=note("Warning- Filter is very hard to control!Also,filter is computationally intensive!\n\nMight be solved later.") +#@gui :_=separator() +#@gui :Zoom=float(16,1,1000000) +#@gui :X-Pan=float(0,-10000,10000) +#@gui :Y-Pan=float(0,-10000,10000) +#@gui :Color Range=float(128,0,255) +#@gui :Factor A=float(9,-100,100) +#@gui :Factor B=float(0,-100,100) +#@gui :Factor C=float(75,-100,100) +#@gui :Factor D=float(5,-100,100) +#@gui :Exponent=float(10,0,17) +#@gui :Depth=float(50,1,500) +#@gui :Background Frequency=float(50,1,500) +#@gui :Color Angle=float(45,-180,180) +#@gui :Alternate Color Function=bool(0) +#@gui :Symmetry=bool(0) +#@gui :Channel Swap=bool(0) +#@gui :_=separator() +#@gui :_=note{"Original Code made by MadJik - Newton Fractal texture (ymd 170915} +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/1/2.") +#@gui Non-Convolution Edge Extraction:fx_ncee,fx_ncee_preview(0) +#@gui :_=note("Based off PS Embossing filtering. The way it works is that you duplicate once and then shift with wrap-around using original image data using an angle and offset. Then finally, you invert one of the layer, and average those values. In this filter, you have several options when it comes to alpha and how the image wrap-around. Also, CMYK mode may be fixed later as I'm trying to avoid the problem with Alpha mode and CMYK mode.") +#@gui :_=separator() +#@gui :Colour Space=choice(0,"RGB8","RYB8","CMY8","CMYK8","HSI8","HSL8","HSV8","LAB8","LCH8","YIQ8","YUV8","XYZ8","YES8","Kodak 1-8","Ohta8") +#@gui :_=separator() +#@gui :Angle=float(0,0,360) +#@gui :Offset=float(1,.5,256) +#@gui :Contrast Factor [%]=float(100,0,500) +#@gui :Wraparound Mode=choice(2,"Dirichlet","Neumann","Periodic","Mirror") +#@gui :Interpolation=bool(0) +#@gui :_=separator() +#@gui :_=note("Alpha Processing") +#@gui :Alpha Mode=choice(0,"Preserve Original Alpha","Multiply Alphas") +#@gui :_=separator() +#@gui :_=note("Blending Processing\n\nIf you're looking for normal blending mode, you do not need to touch this and if you did, set mode to alpha and opacity to 100.") +#@gui :Blending Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :9. Blending Opacity=float(100,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest Update: 2019/4/25.") +#@gui Non-Isometric RPG Tiler (Interactive):fx_rep_rpgtiler_noniso,fx_rep_rpgtiler_noniso_preview +#@gui :_=note("Launch the interactive non-isometric RPG Tiling toolkit.\n\nNote : When using Custom Tileset, you must load the file in tileset!\n\nPlease Read Instruction Below!") +#@gui :_=separator() +#@gui :_=note("Tileset") +#@gui :Premade Tileset=choice(0,LPC House Interior[32],Generic Platform[32],Metroid Like[16],Omega Team[16],Classic RPG[16],Dungeon[32],Happyland[16]) +#@gui :Import Custom Tileset?=bool(0) +#@gui :Tileset=file() +#@gui :_=separator() +#@gui :_=note("Interactive Window Setting") +#@gui :Tile Size=int(32,3,128) +#@gui :Max Selection Increment=int(2,0,8) +#@gui :Interactive Tileset Width=int(16,2,64) +#@gui :Interactive Tileset Height=int(16,2,64) +#@gui :Layer as Placed Tiles?=bool(0) +#@gui :Apply Image Background on Final Image?=bool(0) +#@gui :Alpha to RGB Background Mode=choice(0,"Checkerboard","Colored") +#@gui :Background Colour=color(#000000) +#@gui :Grid Color=float(0,0,255) +#@gui :Trackpad Color=float(45,0,255) +#@gui :_=separator() +#@gui :_=note("Preprocessing") +#@gui :Reverse Layers?=bool(0) +#@gui :_=note("This option is usable for programs that supports editing on two or more layer at once with G'MIC-QT!") +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Hide Background?=bool(0) +#@gui :Preview Grid and Tracker?=bool(1) +#@gui :Hide Tileset?=bool(0) +#@gui :_=separator() +#@gui :_=note("Paint.NET Workaround") +#@gui :Output Mode=choice(0,"Center Result","Output to File") +#@gui :Output Folder=folder() +#@gui :Output Filename=text("placed_tile.png") +#@gui :_=note("This section is only for Paint.NET users! If you don't use this this software, then you don't need use this section!") +#@gui :_=separator() +#@gui :_=note("\n- Instruction -\n\n") +#@gui :_=separator() +#@gui :_=note("Section 1 - Preview Window") +#@gui :_=separator() +#@gui :_=note("Before processing to the interactive window - Test the following conditions:\n\n1. Tileset is correct\n2. Grid fits and is very visible\n3. Tracker is very visible\n\nIf the preview looks good, then proceed to the interactive tool by clicking OK.\n\nWarning: Apply will only waste your time!") +#@gui :_=separator() +#@gui :_=note("Section 2 - Interactive Windows") +#@gui :_=separator() +#@gui :_=note("Press Escape on Canvas Window to exit!\n\nMain Editing Mode\n\nOn Any Windows\n\n- D: Switch between Place/Eraser Mode\n- R: Activate Replace Mode\n- W: Restore All Windows\n- SPACEBAR: Switch Editing Mode\n\nOn Canvas Window\n\n- C: Copy Mode On/Off\n- X: Cut Mode On/Off\n- Z: Undo Canvas Change\n- F: Activate/Deactivate Background Tile Layering Mode\n- G: Grid Mode On/Off\n- Q: Remove/Restore Background\n- A: Tracker On/Off\n- S: Symmetry Mode On/Off\n\n=== On Canvas[Symmetry Mode] ===\n--- 1: Switch Symmetry Axis to X-Axis\n--- 2: Switch Symmetry Axis to Y-Axis\n--- 3: Switch Symmetry Axis to Cross XY-Axis\n--- 4: Switch Symmetry Axis to Mirror XY-Axis\n--- ARROWKEY: Move Symmetry Line\n--- B: Switch Axis in Symmetry Mode\n--- M: Switch Axis in Periodic/Mirror Mode\n--- J: Symmetry Line to Center\n--- S: Deactivate Symmetry Mode\n\nOn Tileset Window\n\n- G: Grid Mode On/Off\n- CTRL+ARROWKEY : Resize Tile Selection\n- ARROWKEY : Scroll Through Tileset\n\nOn Tile Window\n\n- CTRL+ARROWKEY : Resize Tile Selection\n- ARROWKEY : Scroll Through Tileset\n- MOUSE BUTTON : Switch Between Place/Eraser Mode\n\n=== On Tile[No Symmetry Mode] ===\n--- 1: Switch Fill Boundary to Periodic\n--- 2: Switch Fill Boundary to Mirror\n--- 3: Switch Fill Boundary to Mirror X\n--- 4: Switch Fill Boundary to Mirror Y\n--- B: Switch Fill Boundary Mode\n\nRow/Column Editing Mode\n\nOn Any Windows\n\n- W: Restore All Windows\n- SPACEBAR: Switch Editing Mode\n\nOn Canvas Window\n\n- Z: Undo Canvas Change\n- T: Enable Row/Column Shifting Mode\n- E: Place Mode On/Off\n- G: Grid Mode On/Off\n- Q: Remove/Restore Background\n- A: Tracker On/Off\n- S: Activate Symmetrical Selection Mode\n\n=== On Canvas[Selection] ===\n--- C: Keep Selected Row/Column\n--- X: Delete Selected Row/Column\n--- D: Select/Deselect\n--- R: Clear Selection\n--- V: View Selection Box/Hide Selection Box\n--- Mouse Button: Select/Deselect\n--- ARROWKEY: Switch between Row/Column Selection\n\n=== On Canvas[Symmetry Mode-Symmetry] ===\n--- J: Symmetry Line to Center\n--- ARROWKEY: Move Symmetry Line\n--- S: Deactivate Symmetrical Selection Mode\n\n=== On Canvas[Row/Column Shifting Mode] ===\n--- Mouse Button[1st Click]: Activate Shifting\n--- Mouse Button[2nd Click]: Finalize Shifting\n--- 0: Shift Boundary Mode - None\n--- 1: Shift Boundary Mode - Neumann [Periodic]\n--- 2: Shift Boundary Mode - Neumann [Mirror]\n--- 3: Shift Boundary Mode - Neumann [Alternating]\n--- 4: Shift Boundary Mode - Periodic\n--- 5: Shift Boundary Mode - Mirror\n--- ARROWKEY: Switch between Row/Column Selection\n--- T: Disable Row/Column Shifting Mode\n\n=== On Canvas[Place Mode] ===\n--- Mouse Button: Place Row/Column\n--- B: Switch between Replacement/Placement Mode\n--- F: Place Row/Column as Foreground/Background\n--- Mouse Button: Place Row/Column\n--- E: Deactivate Place Mode\n\nOn Tile Window\n\n- ARROWKEY: Flip Row/Column") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/10/20.") +#@gui Object Size Filtering:gui_rep_objvf,gui_rep_objvf_preview(0) +#@gui :Mode of Object Filtering=choice(0,"Auto","Alpha","Colour") +#@gui :Threshold for Auto-Mode Switching(%)=float(10,0,100) +#@gui :_=separator() +#@gui :_=note("Object Filtering Options") +#@gui :Volume 1 (%)=float(1,0,100) +#@gui :Volume 2 (%)=float(99,0,100) +#@gui :Preserve=choice(0,"Inclusive","Exclusive") +#@gui :Preserve=choice(0,"Inclusive by Secondary Max Area","Exclusive by Secondary Max Area") +#@gui :Use Secondary Maximum Area?=bool(0) +#@gui :Colour=color(#00000000) +#@gui :_=separator() +#@gui :_=note("Preview Settings") +#@gui :Reveal Erased Objects?=bool(1) +#@gui :Colour of Erased Object=color(#7f7f7f) +#@gui :Render Mode=choice(0,"Main","Removed Alpha Mode","Alpha Details") +#@gui :List Percentiles?=bool(0)_0 +#@gui :_=separator() +#@gui :_=note("-Instruction-\n\nThe purpose of this filter is to filter objects based on their volume. It is based on the principle of the Object Pruner plugin for Paint.NET made by MJW.\n\nNote: Use Colour Mode for fully opaque image.\nAlternative Note: Use Colour Mode with Alpha or Auto.\n\nSpecial Note: If you're seeing error, switch the render mode and pick the colors until error no longer show up on Main Render Mode.Sometimes changing Mode of Object Filtering can resolve it.\n----\nWarning: Untested on GIMP!") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/2/21.") +#@gui Ordered Dithering:fx_rep_loupasc_ordered_dither,fx_rep_loupasc_ordered_dither_preview +#@gui :Dithering Method=choice(4,"Checkerboard","Dispersed","Arcade","Ordered","Lines","Matrix","Random") +#@gui :Color Count=choice(3,"2","4","6","16") +#@gui :Use Luminosity?=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Dithering algorithm developed by Pascal Ollive. - Source Code Link") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/5/15.") +#@gui Panel Image:rep_fx_shift,rep_fx_shift_preview +#@gui :Offset=point(50,50,0,1,255,255,255,255) +#@gui :Boundary=choice(2,"None","Neumann","Periodic","Mirror") +#@gui :Interpolation=choice(2,"Nearest","Linear","Bicubic") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/2/04.") +#@gui Perspective Streak:gui_rep_perspective_streak,gui_rep_perspective_streak_preview(0) +#@gui :_=note("Creates streak effect toward vanishing point. Read notes below the filter option for more instructions.\n\nWarning - This is a computationally intensive filter.\n\nNote - Future versions may come with easier way to utilize this filter.") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Vanishing Point (%)=point(50,50,0,1,128,128,128,255) +#@gui :Alpha Exponential Factor (%)=float(0,-100,500) +#@gui :Distance Threshold (%)=float(100,.1,100) +#@gui :Distance Start (%)=float(0,0,99.99) +#@gui :Streak Direction=choice(0,"Inside","Outside") +#@gui :_=separator() +#@gui :_=note("Info Output") +#@gui :Streak Mode=choice(0,"Color","Grayscale","Binary","Grayscale+Binary") +#@gui :Preserve Edges=bool(1) +#@gui :_=note("Preserve Edges are not available on binary mode.") +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("- Instruction Notes-\n\nNote 1 - To effectively use this filter, experiment using Secondary Settings on multiple copies of original image[s].\n\nNote 2 - Use blending modes.\n\nNote 3 - If your software supports alpha inheritance, use that to advantage.") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/12/8.") +#@gui Picture Mosaic:fx_rep_photomosaic,fx_rep_photomosaic_preview +#@gui :_=note("Generates picture mosaic using indexing,color searching, and scaling.\n\nNote - Instruction are found below!") +#@gui :_=separator() +#@gui :_=note("- Input -") +#@gui :Use Folder?=bool(0) +#@gui :Mosaic Tile Pictures=folder() +#@gui :Target Layer=choice(0,"Top","Bottom") +#@gui :_=separator() +#@gui :_=note("- Mosaic Generation -\n\nNote: When either tile_height or tile_width is equal to 0, it will automatically create the tile ratio based on which side is smaller.") +#@gui :Tile Width=int(15,0,50) +#@gui :Tile Height=int(0,0,50) +#@gui :Dithering (%)=float(50,0,100) +#@gui :Scaling Interpolation=choice(0,"Nearest","Average","Linear","Grid","Bicubic","Lanczos") +#@gui :Palette Choice=choice(0,"Average","Median") +#@gui :Autocrop=bool(0) +#@gui :Preserve Original Dimension=bool(0) +#@gui :_=separator() +#@gui :_=note("Paint.NET Workaround") +#@gui :Workaround Mode=choice(1,"Export","Clipped-Center",Both") +#@gui :Folder=folder() +#@gui :Filename=text("mosaic.png") +#@gui :_=note("This section is only for Paint.NET users! If you don't use this this software, then you don't need use this section!") +#@gui :_=separator() +#@gui :_=note("- Information -\n\nDo not be alarmed when multiple command prompt shows up when using folder input as it is a normal process!\n\nThis filter is used for generation of mosaic pictures. Also, the mosaic cli command cannot support a number of images that is less than 3, so this gui filter will automatically use folder input option instead. So, you need at least 2 images inside a folder for the mosaic filter to work when using folder input. For more information, see below.\n\n-Software Usage -\n\nFor Krita, and GIMP: Set to input layers to All assuming 3 or more layers are in your file to create mosaic using the top image as a mosaic target.If you are using folder input instead, it is recommended to set layer input to Active.\n\nFor Paint.NET: Using 3 or more layer is unsupported due to the Paint.NET plugin restriction, so you can only use folder input. This is a workaround as G'MIC itself supports more than 2 layers.") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/5/1.") +#@gui __Deformations +#@gui Pixel Push:fx_rep_pxpush,fx_pxpush_preview(0) +#@gui :Push Point=point(50,50,0,1,255,255,255,255) +#@gui :_=separator() +#@gui :_=note("Recreation of filter from source code to TR's Pixel Push plugin for Paint.NET.Currently only Bezier option is supported until the secondary option is figured out.") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/2/26.") +#@gui Point Warp:gui_rep_pw,gui_rep_pw_preview(0) +#@gui :Point Width=float(100,0,100) +#@gui :Distance=float(100,0,100) +#@gui :Radial Influence=float(0,0,100) +#@gui :Placement of Distortion=point(50,50,0,1,128,128,128,255) +#@gui :Distortion Angle=float(0,-180,180) +#@gui :Boundary Condition=choice(3,"None","Neumann","Periodic","Mirror") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("This is a modified code of a conversion of Illab2014's Paint.NET plugin named Point Warp. The difference between this and Illab2014's filter is that this one takes into account of image size and contains boundary conditions.") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2020/2/26.") +#@gui _Rendering +#@gui Popcorn Fractal:fx_rep_pfrac,fx_rep_pfrac_preview +#@gui :_=note("Fractal attributed to Clifford Pickover. Code adapted from Paul Bourke's C code.") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Points=int(50,1,200) +#@gui :Density=float(1,.01,2) +#@gui :H Variable=float(.05,-5,5) +#@gui :K Variable=float(3,-75,75) +#@gui :Zoom=float(1,.1,10) +#@gui :Angle=float(0,-180,180) +#@gui :Origin=point(50,50,0,1,255,255,255,255) +#@gui :_=separator() +#@gui :_=note("Trigonometric") +#@gui :Mode=choice(0,"Trig-4","Trig-6") +#@gui :XY-Axis Mode?=bool(1) +#@gui :X-Axis Formula S=choice(0,"Sinusoidal","Cosinusoidal","Tangent","Arc-Tangent") +#@gui :X-Axis Formula T=choice(1,"Sinusoidal","Cosinusoidal","Tangent","Arc-Tangent") +#@gui :X-Axis Formula U=choice(2,"Sinusoidal","Cosinusoidal","Tangent","Arc-Tangent") +#@gui :Y-Axis Formula S=choice(0,"Sinusoidal","Cosinusoidal","Tangent","Arc-Tangent") +#@gui :Y-Axis Formula T=choice(1,"Sinusoidal","Cosinusoidal","Tangent","Arc-Tangent") +#@gui :Y-Axis Formula U=choice(2,"Sinusoidal","Cosinusoidal","Tangent","Arc-Tangent") +#@gui :XY-Axis Formula S=choice(0,"Sinusoidal","Cosinusoidal","Tangent","Arc-Tangent") +#@gui :XY-Axis Formula T=choice(1,"Sinusoidal","Cosinusoidal","Tangent","Arc-Tangent") +#@gui :XY-Axis Formula U=choice(2,"Sinusoidal","Cosinusoidal","Tangent","Arc-Tangent") +#@gui :_=separator() +#@gui :_=note("Output") +#@gui :Midpoint Shift=float(0,-1,1) +#@gui :Multiplier=float(1,.1,10) +#@gui :Normalize=bool(0) +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Show Fill Ratio?=bool(0) +#@gui :_=note("Fill Ratio provides information on whether there is sufficient filled pixels on canvas. The closer to 100%, the more the canvas is filled.") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/11/1.") +#@gui _Testing +#@gui Reptorian +#@gui Popcorn Fractal [Transformative]:fx_rep_pfrac_t_rs +#@gui :_=note("Generates Transformative Pickover Popcorn Fractal. Discovered by T.Gangopadhyay at XLRI in C.H.Area[E],Jamshedpur,India in 2012.\n\nThere are two style modes for Transformative Popcorn Fractal.") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :_=separator() +#@gui :Points=int(50,1,200) +#@gui :Density=float(1,.01,10) +#@gui :H Variable=float(.05,-5,5) +#@gui :K Variable=float(3,-75,75) +#@gui :Zoom=float(.5,.1,10) +#@gui :Angle=float(45,-180,180) +#@gui :Origin=point(50,50,0,1,255,255,255,255) +#@gui :Use Swirling Hall Mode?=bool(0) +#@gui :_=separator() +#@gui :_=note("Trigonometric") +#@gui :Mode=choice(0,"Trig-4","Trig-6") +#@gui :XY-Axis Mode?=bool(1) +#@gui :Expression A=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :A=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-3 - Include V?=bool(1) +#@gui :Expression B=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :B=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-3 - Include V?=bool(1) +#@gui :Expression A=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :A=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-3 - Include V?=bool(1) +#@gui :Expression B=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :B=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-3 - Include V?=bool(1) +#@gui :Expression C=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :C=choice(2,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-3 - Include V?=bool(1) +#@gui :Axis=choice(0,"X-Axis","Y-Axis") +#@gui :Expression A=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :A=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-3 - Include V?=bool(1) +#@gui :Expression B=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :B=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-3 - Include V?=bool(1) +#@gui :Expression A=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :A=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-3 - Include V?=bool(1) +#@gui :Expression B=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :B=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-3 - Include V?=bool(1) +#@gui :Expression C=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :C=choice(2,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-3 - Include V?=bool(1) +#@gui :Expression A=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :A=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-3 - Include V?=bool(1) +#@gui :Expression B=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :B=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-3 - Include V?=bool(1) +#@gui :Expression A=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :A=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-3 - Include V?=bool(1) +#@gui :Expression B=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :B=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-3 - Include V?=bool(1) +#@gui :Expression C=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :C=choice(2,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-3 - Include V?=bool(1) +#@gui :_=separator() +#@gui :_=note("Shading") +#@gui :Max Value (%)=float(100,0,100) +#@gui :Mid-Point Shift=float(0,-1,1) +#@gui :Sigmoid-Shift=float(0,-100,100) +#@gui :Value Shift=float(0,-1,1) +#@gui :Multiplier=float(.5,.1,10) +#@gui :Normalize=bool(0) +#@gui :Negate?=bool(0) +#@gui Premade Palette:fx_rep_premade_palette,fx_rep_premade_palette_preview(0) : . +#@gui :_=note("This filter creates palettes. Credits are given below. ") +#@gui :_=separator() +#@gui :Palette=choice(10,"BW-2","RGB-3","B-RGB-4","BW-RGB-5","CMY-3","CMYK-4","WCMYK-5","RGBCMY-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus-256","PLAYPAl-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette","Koni32","Linear Color Palette Basic","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8","CD-BAC-16","CG Arne-16","Dinoknight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar [Lake Water Lily]-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet-20","Matrix-96","Material Design-96","Rainbow A-88","Rainbow B-96","SCRJ-XXXVI-36","Pxls Default-32","Moderna-24","Oak21-21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80s-8","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R\place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A-15","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-8","Ocean Glass-8","RoyalGuard-6","Eulbink-8","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-4","Rabbit 7-4","Amiga 2600 NTSC-128","Amiga 2600 PAL-108","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","C64[Pepto]-16","C64[Colodore]-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-256","Win95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Human Faces-94","MadjikHSV-96","ST24 Christmas","Reds-24","Pastel Rainbow-6") +#@gui :X-Position=choice(1,"Left","Middle","Right") +#@gui :Y-Position=choice(1,"Top","Middle","Bottom") +#@gui :Palette Width=int(16,1,256) +#@gui :Palette Scaling=int(12,1,32) +#@gui :Alternating Flips=bool(0) +#@gui :Palette Rotation=choice(2,"180","90","0,"-90") +#@gui :Mirror X-Axis Palette=bool(0) +#@gui :Mirror Y-Axis Palette=bool(0) +#@gui :Blend Palette to Image(s)?=bool(1) +#@gui :_=separator() +#@gui :_=note("Export") +#@gui :Output Location=folder() +#@gui :File Name=text("color_harmonies") +#@gui :Format=choice(0,"GIMP Palette - .gpl","Paint.NET Palette - .txt","JASC-PAL - .pal") +#@gui :Message=_text("Available for Export!") +#@gui :Export=button() +#@gui :Palette=choice(0,"BW-2","RGB-3","B-RGB-4","BW-RGB-5","CMY-3","CMYK-4","WCMYK-5","RGBCMY-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus-256","PLAYPAl-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette","Koni32","Linear Color Palette Basic","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8","CD-BAC-16","CG Arne-16","Dinoknight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar [Lake Water Lily]-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet-20","Matrix-96","Material Design-96","Rainbow A-88","Rainbow B-96","SCRJ-XXXVI-36","Pxls Default-32","Moderna-24","Oak21-21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80s-8","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R\place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A-15","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-8","Ocean Glass-8","RoyalGuard-6","Eulbink-8","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-4","Rabbit 7-4","Amiga 2600 NTSC-128","Amiga 2600 PAL-108","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","C64[Pepto]-16","C64[Colodore]-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-256","Win95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Human Faces-94","MadjikHSV-96","ST24 Christmas","Reds-24","Pastel Rainbow-6")_0 +#@gui :_=separator() +#@gui :_=note("Palette CLI Information\n\n Main Source of Palettes - LoSpec Palette List\n\nPalette Number -- pal number_id = pal name_id -- Full Palette Name by Author[if mentioned]\n\n1 -- pal 0 = pal bw -- Black & White\n2 -- pal 1 = pal rgb -- Red-Green-Blue\n3 -- pal 2 = pal b_rgb -- Black with Red-Green-Blue\n4 -- pal 3 = pal bw_rgb -- Black & White with Red-Green-Blue\n5 -- pal 4 = pal cmy -- Cyan-Magenta-Yellow\n6 -- pal 5 = pal cmyk -- Cyan-Magenta-Yellow-Black\n7 -- pal 6 = pal wcmyk -- White-Cyan-Magenta-Yellow-Black\n8 -- pal 7 = pal rgbcmy -- Red-Green-Blue with Cyan-Magenta-Yellow\n9 -- pal 8 = pal 1bitrgb -- 1-Bit RGB\n10 -- pal 9 = pal aurora -- Aurora by GrafxKid\n11 -- pal 10 = pal zenit_241 -- Zenit-241 by Zenit40\n12 -- pal 11 = pal gbg -- Game Builder Garage: Texture-Sprite Editor Palette\n13 -- pal 12 = pal duel -- Duel by Arilyn\n14 -- pal 13 = pal hocuspocus -- Hocus Pocus Palette by Apogee Software,Ltd.\n15 -- pal 14 = pal playpal -- PLAYPAL by id Tech 1 | DOOM Engine\n16 -- pal 15 = pal srb2 -- Sonic Robo Blast 2\n17 -- pal 16 = pal uzebox -- Uzebox from Uzebox console\n18 -- pal 17 = pal kens16 -- Andrew Kensler - 16 by Andrew Kensler\n19 -- pal 18 = pal kens32 -- Andrew Kensler - 32 by Andrew Kensler\n20 -- pal 19 = pal kens54 -- Andrew Kensler - 54 by Andrew Kensler\n21 -- pal 20 = pal aap12 -- AAP-Micro 12 by Adigun A. Polack\n22 -- pal 21 = pal aap16 -- AAP-16 by Adigun A. Polack\n23 -- pal 22 = pal aap64 -- AAP-64 by Adigun A. Polack\n24 -- pal 23 = pal aap96 -- AAP-RadiantPLUS by Adigun A. Polack\n25 -- pal 24 = pal aap128 -- AAP-SPLENDOR128 by Adigun A. Polack\n26 -- pal 25 = pal aap_dga16 -- AAP-DGA16 by Adigun A. Polack\n27 -- pal 26 = pal cheerful32 -- Cheerful-32 by SoundsDotZip\n28 -- pal 27 = pal db8 -- DB8 by DawnBringer\n29 -- pal 28 = pal db16 -- DB16 by DawnBringer\n30 -- pal 29 = pal db32 -- DB32 by DawnBringer\n31 -- pal 30 = pal db_iso22 -- DB-ISO22 by DawnBringer\n32 -- pal 31 = pal dimwid17 -- DimWiddy 17 by DimWiddy\n33 -- pal 32 = pal dimwid23 -- DimWiddy 23 by DimWiddy\n34 -- pal 33 = pal edg4 -- Endesga-4 by Endesga\n35 -- pal 34 = pal edg8 -- Endesga-8 by Endesga\n36 -- pal 35 = pal edg16 -- Endesga-16 by Endesga\n37 -- pal 36 = pal edg32 -- Endesga-32 by Endesga\n38 -- pal 37 = pal edg36 -- Endesga-36 by Endesga\n39 -- pal 38 = pal edg64 -- Endesga-64 by Endesga\n40 -- pal 39 = pal famicube -- Famicube by Arne\n41 -- pal 40 = pal juicy32 -- Juicy-32 by Real Juice\n42 -- pal 41 = pal juicy56 -- Juicy-56 by Real Juice\n43 -- pal 42 = pal xaiue -- XAIUE-22 by xaiue\n44 -- pal 43 = pal 15pdx -- 15P-DX by GrafxKid\n45 -- pal 44 = pal 20pdx -- 20P-DX by GrafxKid\n46 -- pal 45 = pal 24pdx -- 24P-DX by GrafxKid\n47 -- pal 46 = pal cabana64 -- Cabana-64 by Crabby\n48 -- pal 47 = pal fant16 -- Fantasy 16 by Brettybooop\n49 -- pal 48 = pal fant24 -- Fantasy 24 by Gabriel C.\n50 -- pal 49 = pal tf23 -- Tranquil Fantasy 23 by windfall.apples\n51 -- pal 50 = pal tfp39 -- Tranquility Plus 39 by windfall.apples\n52 -- pal 51 = pal faraway48 -- Faraway 48 by Igor Ferreira.\n53 -- pal 52 = pal fleja_m -- Fleja Master Palette by Fleja\n54 -- pal 53 = pal koni32 -- Koni32 by Konic\n55 -- pal 54 = pal linearbasic -- Linear Color Palette Basic by GrafxKid\n56 -- pal 55 = pal lego -- LEGO colors from LEGO wiki\n57 -- pal 56 = pal lego2021 -- Lego Colours 2021 by Six Pies\n58 -- pal 57 = pal vinelinear -- Vines Flexible Linear Ramps by Vine 2D\n59 -- pal 58 = pal arcade29 -- Arcade Standard 29 by GrafxKid\n60 -- pal 59 = pal arq16 -- ARQ16 by Endesga\n61 -- pal 60 = pal atom8 -- Atom-8 by polyphrog\n62 -- pal 61 = pal blk36 -- BLK 36 by BlackedIRL.\n63 -- pal 62 = pal blkneo -- BLK-NEO by BlackedIRL.\n64 -- pal 63 = pal brokefac -- Broken Facility by telepathic-melon\n65 -- pal 64 = pal bubblegum -- Bubblegum-16 by PineTreePizza\n66 -- pal 65 = pal cpcboy -- CPC BOY by Arne Niklas Jansson\n67 -- pal 66 = pal cade15 -- Cade 15 by MonstersGoBoom\n68 -- pal 67 = pal calder8 -- Calder 8 by Philip Dodderige\n69 -- pal 68 = pal cdbac -- CD-BAC by DimWiddy\n70 -- pal 69 = pal cgarne -- CG Arne by Arne Niklas Jansson\n71 -- pal 70 = pal dino -- Dinoknight 16 by Retrospec\n72 -- pal 71 = pal 4l -- ||||-22 by ||||\n73 -- pal 72 = pal fzteth16 -- FZT Ethereal 16 by Fusionnist\n74 -- pal 73 = pal indc -- Indecision by Nelson SMG\n75 -- pal 74 = pal island16 -- Island Joy 16 by Kerrie Lake\n76 -- pal 75 = pal journey -- Journey by PineTreePizza\n77 -- pal 76 = pal shallowmarsh26 -- Shallowmarsh26 by archer\n78 -- pal 77 = pal lago_nenufar -- Lago Nenufar [Lake Water Lily] by Popxel Art\n79 -- pal 78 = pal juicy -- Juicy 17 by JerryPie\n80 -- pal 79 = pal chocolateganache -- ChocolateGanache by Ladybug\n81 -- pal 80 = pal brightwinter1 -- Bright Winter 1 by Nai\n82 -- pal 81 = pal brightwinter2 -- Bright Winter 2 by Nai\n83 -- pal 82 = pal kawaii -- Kawaii16 by Arisuki\n84 -- pal 83 = pal xdb_01 -- 0xdb-01 by 0xDB\n85 -- pal 84 = pal gzxp -- GZXP by GrafxKid\n86 -- pal 85 = pal chrom16 -- Chromatic16 by DragonDePlatino\n87 -- pal 86 = pal piet -- Piet by P-Tux7\n88 -- pal 87 = pal boltbait_matrix -- Matrix by BoltBait\n89 -- pal 88 = pal material_design -- Material Design by Ruchir L. Sharma [@aguynamedruchir]\n90 -- pal 89 = pal thehamster_rainbow -- Rainbow by thehamster\n91 -- pal 90 = pal boltbait_rainbow -- Rainbow by BoltBait\n92 -- pal 91 = pal scrj36 -- SCRJ-XXXVI by StudioCRJ\n93 -- pal 92 = pal pxls_default -- Pxls Default from pxls.space\n94 -- pal 93 = pal moderna -- Moderna by yedamameday\n95 -- pal 94 = pal oak -- Oak21 by Dan Oak\n96 -- pal 95 = pal nature55 -- Nature's Embrace 55 by GrafxKid\n97 -- pal 96 = pal rbypgo -- RBYPGO by Marilynx\n98 -- pal 97 = pal new_worlds -- New Worlds 46 by Count Moriarty\n99 -- pal 98 = pal nauris16 -- Nauris-16 by Nauris\n100 -- pal 99 = pal dynamite -- Dynamite by Pixi\n101 -- pal 100 = pal interstate_28 -- Interstate 28 by maine\n102 -- pal 101 = pal downgraded_32 -- Downgraded 32 by daniel\n103 -- pal 102 = pal pear36 -- Pear 36 by PineTreePizza\n104 -- pal 103 = pal pineapple32 -- Pineapple 32 by PineTreePizza\n105 -- pal 104 = pal peach -- Peachy Pop 16 by Kerrie Lake\n106 -- pal 105 = pal resurrect -- Resurrect 32 by Kerrie Lake\n107 -- pal 106 = pal rosy42 -- Rosy 42 by PineTreePizza\n108 -- pal 107 = pal slso -- SLSO-CLR17 by Luis Miguel Maldonado\n109 -- pal 108 = pal softy15 -- Softy 15 by Eggy\n110 -- pal 109 = pal spec12 -- SPEC12 by Smalls\n111 -- pal 110 = pal roarin80s -- The Roarin 80's by Malo\n112 -- pal 111 = pal starmancer -- Starmancer by Ominux Games\n113 -- pal 112 = pal superfuture -- SuperFuture25 by Endesga\n114 -- pal 113 = pal sunshine_35 -- SUNSHINE 35 by mysunnyrose\n115 -- pal 114 = pal sweetie16 -- Sweetie 16 by GrafxKid\n116 -- pal 115 = pal calm48 -- Calm 48 by Xina\n117 -- pal 116 = pal optimism -- Optimism by mingapur\n118 -- pal 117 = pal taffy16 -- Taffy 16 by PineTreePizza\n119 -- pal 118 = pal todayland -- Todayland Palette V2 by GrafxKid\n120 -- pal 119 = pal trirampo -- TriRampo by ANoob\n121 -- pal 120 = pal reddit_place_2022 -- r|place 2022\n122 -- pal 121 = pal tropical_cone_24 -- Tropical Cone 24 by yedamameday\n123 -- pal 122 = pal vivid17 -- Vivid-17 by Irenaart\n124 -- pal 123 = pal shido76 -- SHIDO50+ by Shidoengie\n125 -- pal 124 = pal intacto -- Intacto14 by Anoob\n126 -- pal 125 = pal itatsi -- Itatsi by SoundsDotZip\n127 -- pal 126 = pal enos16 -- ENOS16 by Endesga\n128 -- pal 127 = pal grixel_grotto -- Grixel Grotto by Northernite\n129 -- pal 128 = pal sup8 -- Superb 8 by BigPotato\n130 -- pal 129 = pal undertones -- Undertones-17 by Irenaart\n131 -- pal 130 = pal tango -- Tango by Duck\n132 -- pal 131 = pal cheese -- Cheese Palette by Gors\n133 -- pal 132 = pal equpix15 -- Equpix 15 by Night\n134 -- pal 133 = pal zu32 -- Zughy 32 by Zughy\n135 -- pal 134 = pal voodo -- Voodo34 by Shamaboy\n136 -- pal 135 = pal franzston_30 -- Franzston 30 by Virus610\n137 -- pal 136 = pal night16 -- Night 16 by Night\n138 -- pal 137 = pal star29 -- Star 29 by Starlane\n139 -- pal 138 = pal star34 -- Star 34 by Starlane\n140 -- pal 139 = pal stilllife -- Still-Life by cure\n141 -- pal 140 = pal simjpc16 -- SimpleJPC-16 by Adigun A. Polack\n142 -- pal 141 = pal acid15 -- Acid 15 by pyrometal\n143 -- pal 142 = pal battery24 -- Battery 24 by Battery Jellyfish\n144 -- pal 143 = pal clump18 -- Clumpy 18 by windfall.apples\n145 -- pal 144 = pal cthul -- Cthulhu by Starlane\n146 -- pal 145 = pal crimso11 -- Crimso 11 by Crimso\n147 -- pal 146 = pal coptec -- Copper-Tech by Arne Niklas Jansson\n148 -- pal 147 = pal drz15 -- DRZ15A by Drazille\n149 -- pal 148 = pal eggy15 -- Eggy 15 by Eggy\n150 -- pal 149 = pal europa -- Europa 16 by Starlane\n151 -- pal 150 = pal greyt -- GreyT-bit by Sam Keddy\n152 -- pal 151 = pal jewel -- Jewel by AprilSundae\n153 -- pal 152 = pal polar11 -- Polar 11 by Smalls\n154 -- pal 153 = pal sheltzy -- Sheltzy 32 by Please Check - NatTorpedia\n155 -- pal 154 = pal wyrm -- Wyrm 24 by FrogWyrm\n156 -- pal 155 = pal yume_nikki -- Yume Nikki by Space Sandwich\n157 -- pal 156 = pal rube_goldberg -- Rube-Goldberg\n158 -- pal 157 = pal boomboom -- BoomBoom by Salman_Shh\n159 -- pal 158 = pal g8 -- Generic-8 by GrafxKid\n160 -- pal 159 = pal crayola -- Crayola Blind\n161 -- pal 160 = pal matriax8c -- Matriax8c by Davit Masia\n162 -- pal 161 = pal nt1h -- NT1H by NatTorpedia\n163 -- pal 162 = pal jerrypie22 -- JerryPie 22 by JerryPie\n164 -- pal 163 = pal nineties_nine -- Nineties Nine by Cubby Crazes\n165 -- pal 164 = pal on70 -- On70 by By8Bits\n166 -- pal 165 = pal anb16 -- ANB16 by Anoob\n167 -- pal 166 = pal retrocal -- Retrocal-8 by polyphrog\n168 -- pal 167 = pal punolit -- Punolit by Punoli\n169 -- pal 168 = pal luap_40 -- Luap 40 by Luap\n170 -- pal 169 = pal autumvil6 -- Autum Villan 6 by Chase Stemel\n171 -- pal 170 = pal au15 -- Autum 15 by jok\n172 -- pal 171 = pal au15y -- Autum 15 [Yellow] by jok\n173 -- pal 172 = pal galaxy_flame -- Galaxy Flame by Rhoq\n174 -- pal 173 = pal antiquity16 -- Antiquity16 by ILTA\n175 -- pal 174 = pal mushroom -- Mushroom by Jimison3\n176 -- pal 175 = pal aerugo -- Aerugo by Lizalot\n177 -- pal 176 = pal hotel_paintings -- Hotel Paintings 6 by Chase Stemel\n178 -- pal 177 = pal nopal -- Nopal-12 by BlackedIRL.\n179 -- pal 178 = pal gpy -- Brightness GPY by rickthepalette\n180 -- pal 179 = pal blessing -- Blessing by Maruki\n181 -- pal 180 = pal fairydust_8 -- Fairydust 8 by Yousurname\n182 -- pal 181 = pal fuzz4 -- Fuzzy Four by P-Tux7\n183 -- pal 182 = pal fairy -- Fairy Tales by lollige\n184 -- pal 183 = pal naji16 -- Naji 16 by Naji\n185 -- pal 184 = pal easter -- Easter Island by skamocore\n186 -- pal 185 = pal pastel_and_darks58 -- Pastel and Darks 58 Palette by Glxss\n187 -- pal 186 = pal pastel17 -- 17 Pastels by Irenaart\n188 -- pal 187 = pal nostalgia15 -- NOSTALGIA15 by Arisuki\n189 -- pal 188 = pal ocaso -- Ocaso by Minord\n190 -- pal 189 = pal pastel -- Oh Hell, Pastel by StarlitSunset\n191 -- pal 190 = pal pollen8 -- Pollen-8 by Conker\n192 -- pal 191 = pal kule -- KULE-16 by Cuymacu\n193 -- pal 192 = pal hydrangea -- Hydrangea 11 by Dinchen's Art\n194 -- pal 193 = pal fluffy8 -- Fluffy8 by vee\n195 -- pal 194 = pal st8rb -- ST 8 R&B Remake by Skiller Thomson\n196 -- pal 195 = pal neon_space -- Neon Space by Jimison3\n197 -- pal 196 = pal cyclope6 -- Cyclope6 by Royal_Naym\n198 -- pal 197 = pal sy17 -- Sy17 by xaiue\n199 -- pal 198 = pal syz15 -- Syz15 by Fusionnist\n200 -- pal 199 = pal tui15 -- TUI-15 by Jeremy\n201 -- pal 200 = pal cave -- Cave by PineTreePizza\n202 -- pal 201 = pal psygnosia -- Psygnosia by Arne Niklas Jansson\n203 -- pal 202 = pal marshmellow32 -- MarshMellow32 by FormalPrejudice\n204 -- pal 203 = pal lost_century -- Lost Century 24 by CalmRadish\n205 -- pal 204 = pal finlal11 -- Finlal 11 by Finlal\n206 -- pal 205 = pal industrial_factory -- TY - Industrial Factory 16 by Toby_Yasha\n207 -- pal 206 = pal murder_mystery -- TY - Murder Mystery 16 by Toby_Yasha\n208 -- pal 207 = pal fatedestiny -- TY - Fate & Destiny 12 by Toby_Yasha\n209 -- pal 208 = pal vinik24 -- Vinik 24 by Vinik\n210 -- pal 209 = pal ykb22 -- YKB-22 by yahkehbu\n211 -- pal 210 = pal halloween -- Halloween by Mememellow\n212 -- pal 211 = pal graveyard -- Graveyard-21 by AprilSundae\n213 -- pal 212 = pal steamlords -- Steam Lords by Slynyrd\n214 -- pal 213 = pal frostical -- Frostical by yedamameday\n215 -- pal 214 = pal deuterospill -- DeuteroSpill by Royal_Naym\n216 -- pal 215 = pal cool_bone_7 -- Cool Bone 7 by Chase Stemel\n217 -- pal 216 = pal muted_ally_6 -- Muted Ally 6 by Chase Stemel\n218 -- pal 217 = pal ephemera -- EPHEMERA by K C\n219 -- pal 218 = pal ink -- Ink by AprilSundae\n220 -- pal 219 = pal violet_dreams -- Violet Dreams by Solitaire\n221 -- pal 220 = pal tinyfolks -- Tinyfolks by Pierr Vandermaesan\n222 -- pal 221 = pal old_gold_7 -- Old Gold 7 by Chase Stemel\n223 -- pal 222 = pal rosemoss -- Rosemoss-8 by polyphrog\n224 -- pal 223 = pal aaprad -- AAP-RadiantXV by Adigun A. Polack\n225 -- pal 224 = pal aapmaj -- AAP-Majesty XVII by Adigun A. Polack\n226 -- pal 225 = pal dead_weight_8 -- Dead Weight-8 by polyphrog\n227 -- pal 226 = pal mojave -- Mojave20 by magodellepercussioni\n228 -- pal 227 = pal pet8 -- Petite-8 by Adigun A. Polack\n229 -- pal 228 = pal pet8d -- Petite-8 Afterdark by Adigun A. Polack\n230 -- pal 229 = pal xaiue_rad -- XAIUE-Radiant by xaiue\n231 -- pal 230 = pal daruda -- Daruda 22 by daruda\n232 -- pal 231 = pal firestorm -- Firestorm by theartistjulian\n233 -- pal 232 = pal borkfest -- Borkfest by まるき\n234 -- pal 233 = pal spicy_07 -- Spicy 07 by green guy\n235 -- pal 234 = pal rust6 -- Rust-6 by Blue Phoenix\n236 -- pal 235 = pal apricot -- Apricot by Chase Stemel\n237 -- pal 236 = pal supernova7 -- SuperNova 7 by Blue Phoenix\n238 -- pal 237 = pal pastry -- Pastry by MirruTatep\n239 -- pal 238 = pal sandy_06 -- Sandy 06 by green guy\n240 -- pal 239 = pal illumination -- Illumination by MirruTatep\n241 -- pal 240 = pal nyx8 -- NYX8 by Javier Guerrero\n242 -- pal 241 = pal dreamhaze -- Dream Haze 8 by Klafooty\n243 -- pal 242 = pal oil6 -- OIL6 by GrafxKid\n244 -- pal 243 = pal regal -- Regal10 by JRiggles\n245 -- pal 244 = pal softdemon -- Soft Demon 7 by Chase Stemel\n246 -- pal 245 = pal sgm -- SGM-Palette 2 by s.g.m\n247 -- pal 246 = pal midnight_ablaze -- Midnight ablaze by Inkpendude\n248 -- pal 247 = pal black_cherry -- Black Cherry by MirruTatep\n249 -- pal 248 = pal sunset_red -- Sunset Red by Cabezinu\n250 -- pal 249 = pal inkpink -- INKPINK by Inkpendude\n251 -- pal 250 = pal brash_pink -- Brash Pink by ItzFred\n252 -- pal 251 = pal pink_neon_sign_6 -- Pink Neon Sign 6 by Chase Stemel\n253 -- pal 252 = pal enchanted_purple -- Enchanted Purple by Kaiburn\n254 -- pal 253 = pal arch -- Arch by Poltergasm\n255 -- pal 254 = pal spaceyeaster -- Spacey Easter by Spark Norris\n256 -- pal 255 = pal fornaxvoid1 -- Fornax Void I by Fornax Void\n257 -- pal 256 = pal fornaxvoid2 -- Fornax Void II by Fornax Void\n258 -- pal 257 = pal pixelwave -- Pixelwave by Reptorian\n259 -- pal 258 = pal s1_6 -- S1-6 by Blyzz\n260 -- pal 259 = pal berry_nebula -- Berry Nebula by LostInIndigo\n261 -- pal 260 = pal abyss9 -- ABYSS-9 by Jusiv\n262 -- pal 261 = pal moonlight -- Moonlight 15 by Tofu\n263 -- pal 262 = pal moon39 -- Moonlit-39 by theartistjulian\n264 -- pal 263 = pal h2o -- H2O by maine\n265 -- pal 264 = pal magic_waters_9 -- Magic Waters 9 by Chase Stemel\n266 -- pal 265 = pal bluemold -- Bluem0ld by warpixel\n267 -- pal 266 = pal moss -- Moss by Zetomis\n268 -- pal 267 = pal deep_maze -- DEEP MAZE by Ryosuke\n269 -- pal 268 = pal toxic_slime -- Toxic Slime by MirruTatep\n270 -- pal 269 = pal lush_green -- Lush Green by EerieJam\n271 -- pal 270 = pal tsunami -- Tsunami by MirruTatep\n272 -- pal 271 = pal cryptic_ocean -- Cryptic Ocean by Klafooty\n273 -- pal 272 = pal marsh_madness -- Marsh Madness by MirruTatep\n274 -- pal 273 = pal oxyd -- OXYD by ItzFred\n275 -- pal 274 = pal pinkgreen -- Pink&Green by q1\n276 -- pal 275 = pal walking_in_the_woods -- Walking in the Woods 8 by Chase Stemel\n277 -- pal 276 = pal paper_8 -- Paper 8 by Frosty Rabbid\n278 -- pal 277 = pal sahara_pastell -- Sahara Pastell by wermz\n279 -- pal 278 = pal sunflower_painting_7 -- Sunflower Painting 7 by Chase Stemel\n280 -- pal 279 = pal arthoe7 -- Art Hoe Aesthetic 7 by Chase Stemel\n281 -- pal 280 = pal sky5 -- Sky5 by MiniTe\n282 -- pal 281 = pal ocean_glass -- Ocean Glass by Solitaire\n283 -- pal 282 = pal royalguard -- RoyalGuard by Royal_Naym\n284 -- pal 283 = pal eulbink -- Eulbink by Inkpendude\n285 -- pal 284 = pal winter_wonderland -- Winter Wonderland by Jimison3\n286 -- pal 285 = pal moon_squid -- Moon Squid 7 by Chase Stemel\n287 -- pal 286 = pal stratus -- Stratus by MirruTatep\n288 -- pal 287 = pal arctic_dust -- Arctic Dust by MirruTatep\n289 -- pal 288 = pal clouds_sunset -- CL8UDS by _Nicola\n290 -- pal 289 = pal lilac_skies -- Lilac Skies 5 by Chase Stemel\n291 -- pal 290 = pal sea_of_fire -- Sea of Fire by TATA-PIXEL\n292 -- pal 291 = pal autochrome3 -- Autochrome 3 by Reptorian\n293 -- pal 292 = pal autochrome5 -- Autochrome 5 by Reptorian\n294 -- pal 293 = pal gb_d_1 -- GB Default 1\n295 -- pal 294 = pal gb_d_2 -- GB Default 2\n296 -- pal 295 = pal gb_andrade -- GB Andrade by Andrade\n297 -- pal 296 = pal gb_blue -- GB Blue Seni by WildLeoKnight\n298 -- pal 297 = pal gb_bz -- GB Blackzone\n299 -- pal 298 = pal gb_suburb -- GB Suburb by Poppysalmon\n300 -- pal 299 = pal gb_crimson -- GB Crimson by WildLeoKnight\n301 -- pal 300 = pal gb_didi -- GB Didi by DidiGameboy\n302 -- pal 301 = pal gb_dirty -- GB Dirty by WildLeoKnight\n303 -- pal 302 = pal gb_arne -- GB Arne by Arne\n304 -- pal 303 = pal gb_easy -- GB Easy by GrafxKid\n305 -- pal 304 = pal gb_forest -- GB Forest\n306 -- pal 305 = pal gb_hg -- GB Harsh Green by WildLeoKnight\n307 -- pal 306 = pal gb_lg -- GB Light Green by WildLeoKnight\n308 -- pal 307 = pal gb_nostalgia -- GB Nostalgia by WildLeoKnight\n309 -- pal 308 = pal gb_platinum -- GB Platinum by WildLeoKnight\n310 -- pal 309 = pal gb_kirokaze -- GB Kirokaze by Kirokaze\n311 -- pal 310 = pal gb_cyber -- GB Cyber\n312 -- pal 311 = pal gb_wish -- GB Wish by Kerrie Lake\n313 -- pal 312 = pal gb_grapefruit -- GB Grapefruit by GrafxKid\n314 -- pal 313 = pal gb_ice_cream -- GB Ice Cream by Kerrie Lake\n315 -- pal 314 = pal gb_rb -- GB Red_Blue\n316 -- pal 315 = pal gb_gold -- Gold GB by Isa\n317 -- pal 316 = pal gb_choco -- GB Chocolate by GrafxKid\n318 -- pal 317 = pal gb_gray -- GB Gray by GrafxKid\n319 -- pal 318 = pal gb_space -- GB Spacehaze by WildLeoKnight\n320 -- pal 319 = pal gb_purpdawn -- GB Purple Dawn by WildLeoKnight\n321 -- pal 320 = pal moon_crystal -- Moon Crystal by Doph\n322 -- pal 321 = pal arne4 -- ARNE4 by Arne\n323 -- pal 322 = pal autumn_chill -- Autumn Chill by Doph\n324 -- pal 323 = pal cherrymelon -- CherryMelon by WildLeoKnight\n325 -- pal 324 = pal hal4 -- HallowPumpkin by WildLeoKnight\n326 -- pal 325 = pal hollow -- Hollow by Poltergasm\n327 -- pal 326 = pal lavender4 -- Lavender4 by Solitaire\n328 -- pal 327 = pal maw -- MAW by bloo\n329 -- pal 328 = pal voltage_warning -- Voltage Warning by Wuchta\n330 -- pal 329 = pal tritanopia -- Tritanopia by Allappini\n331 -- pal 330 = pal rabbit7 -- Rabbit 7 by GrafxKid\n332 -- pal 331 = pal amiga2600ntsc -- Amiga 2600 NTSC\n333 -- pal 332 = pal amiga2600pal -- Amiga 2600 PAL\n334 -- pal 333 = pal amiga2600secam -- Amiga 2600 SECAM\n335 -- pal 334 = pal amiga7800mess -- Amiga 7800 M.E.S.S by Nabuko78\n336 -- pal 335 = pal amiga7800 -- Amiga 7800\n337 -- pal 336 = pal amstrad_cpc -- Amstrad CPC\n338 -- pal 337 = pal apple2 -- Apple II\n339 -- pal 338 = pal atari8bit -- Atari 8-Bit Series - GTIA by PixelCrunch\n340 -- pal 339 = pal cga -- CGA\n341 -- pal 340 = pal cga00 -- CGA Mode 0 [Low]\n342 -- pal 341 = pal cga01 -- CGA Mode 0 [High]\n343 -- pal 342 = pal cga10 -- CGA Mode 1 [Low]\n344 -- pal 343 = pal cga11 -- CGA Mode 1 [High]\n345 -- pal 344 = pal cga20 -- CGA Mode 2 [Low]\n346 -- pal 345 = pal cga21 -- CGA Mode 2 [High]\n347 -- pal 346 = pal c64_pepto -- Commodore 64 - Pepto\n348 -- pal 347 = pal c64_colodore -- Commodore 64 - Colodore\n349 -- pal 348 = pal com_vic_20 -- Commodore VIC-20\n350 -- pal 349 = pal colecovision -- Colecovision\n351 -- pal 350 = pal jmp -- Japanese Machine Palette by Arne Niklas Jansson\n352 -- pal 351 = pal mac2 -- Macintosh II\n353 -- pal 352 = pal mac8 -- Macintosh 8-Bit System Palette\n354 -- pal 353 = pal msx -- MSX\n355 -- pal 354 = pal nes -- NES\n356 -- pal 355 = pal pico_8 -- PICO-8 by Lexaloffle Games\n357 -- pal 356 = pal risc -- RISC OS\n358 -- pal 357 = pal samcoupe -- SAM Coupe\n359 -- pal 358 = pal mo5 -- Thomson MO5\n360 -- pal 359 = pal trs80 -- TRS-80 Color Computer Palette\n361 -- pal 360 = pal virtualboy -- Virtual Boy interpreted by Bruno Weinberger\n362 -- pal 361 = pal vga -- VGA\n363 -- pal 362 = pal win95 -- Win 95-256\n364 -- pal 363 = pal zx -- ZX Spectrum\n365 -- pal 364 = pal gnome32 -- GNOME 32\n366 -- pal 365 = pal elc22 -- Electronic Crayon 22\n367 -- pal 366 = pal chip16 -- Chip16\n368 -- pal 367 = pal deluxepaint -- Deluxe Paint\n369 -- pal 368 = pal flat_ui -- FlatUI from flat ui colors website\n370 -- pal 369 = pal makecode_arcade -- MakeCode Arcade Palette\n371 -- pal 370 = pal oekaki -- Oekaki from Oekaki.nl\n372 -- pal 371 = pal lms -- Legacy Paint\n373 -- pal 372 = pal msxp -- XP Paint\n374 -- pal 373 = pal vis -- Vista Paint\n375 -- pal 374 = pal humanfaces -- Human Faces by Romney57\n376 -- pal 375 = pal madjikhsv -- HSV Palette by MadJik\n377 -- pal 376 = pal st24_christmas -- ST24 Christmas by Skiller Thomson\n378 -- pal 377 = pal ladybugreds -- Reds by Ladybug\n379 -- pal 378 = pal dullish_rainbow -- Pastel Rainbow by Jayden Bowman") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2022/4/01.") +#@gui Prime Surface:gui_rep_prime_surface +#@gui :Negate Direction?=bool(0) +#@gui :Mirror Direction=choice(0,"None","X","Y") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2020/2/26.") +#@gui __Rendering +#@gui Pseudorandom Noise:fx_rep_mj_prn,fx_rep_mj_prn_preview +#@gui :_=note("Generates pseudorandom noise.\n\nBased off MadJik's Regular Noise Paint.NET Plugin. This is a extended version. Preview may not be accurate!") +#@gui :_=separator() +#@gui :_=note("Preliminary") +#@gui :K-1=float(8,-8,8) +#@gui :K-2=float(2,-8,8) +#@gui :K Mode=choice(0,"Mode 0","Mode 1") +#@gui :Shift=float(1,-256,256) +#@gui :_=separator() +#@gui :_=note("Non-K Factors") +#@gui :Color Angle=float(0,-180,180) +#@gui :Pixel Size=int(1,1,16) +#@gui :Position=point(50,50,0,1,128,128,128,255) +#@gui :Formula=choice(1,"Gray","Sinusoidal","RGB","Tangent") +#@gui :Double Pixel Axis?=bool(0) +#@gui :_=separator() +#@gui :_=note("Grid") +#@gui :Activate Grid?=bool(0) +#@gui :Shade=float(0,0,255) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/1/17.") +#@gui _Testing +#@gui Reptorian +#@gui Rainbowify:fx_rep_rainbowify,fx_rep_rainbowify_preview(0) +#@gui :_=note("Apply rainbowify effect into image. Inspired by Rainbowify effect made by Jonathan Frech.") +#@gui :_=separator() +#@gui :Hue Shift=float(0,-180,180) +#@gui :Gradient Angle=float(0,-180,180) +#@gui :Gradient Scale(%)=float(100,50,200) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/7/26.") +#@gui Random Gradient Bars:fx_rep_randgradbar,fx_rep_randgradbar_preview +#@gui :_=note("Create Random Gradient Bar.\n\nNote - Preview is only for giving a idea.") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Seed=int(0,0,100000) +#@gui :Bar Size - Quarter Image-Diagonal(%)=float(2,0,100) +#@gui :Space Size - Quarter Image-Diagonal(%)=float(0,0,100) +#@gui :Angle=float(0,-180,180) +#@gui :Skew Angle=float(0,-89,89) +#@gui :Origin=point(50,50,0,1,255,255,255,255) +#@gui :Subsampling=float(1,0,3) +#@gui :_=separator() +#@gui :_=note("Gradient Transformation") +#@gui :Shift=float(0,0,100) +#@gui :Multiplier A=float(1,.1,250) +#@gui :Multiplier B=float(100,.1,250) +#@gui :_=separator() +#@gui :_=note("Gradient Modulo") +#@gui :Repetition=choice(0,"Random","Cut","Periodic","Continuous") +#@gui :Random Bar Repetition=choice(0,"All","Cut and Periodic","Cut and Continuous","Periodic and Continuous") +#@gui :Space Mode=choice(0,"Alpha","Cut","Gradient") +#@gui :Symmetry Mode=choice(0,"None","Symmetry A","Symmetry B") +#@gui :Inversion Mode=choice(0,"None","Random-Inversion","Full-Inversion") +#@gui :_=separator() +#@gui :_=note("Color") +#@gui :Output Color=choice(0,"Grayscale","Duotone","RGB - Random Bars","HSV - Random Bars") +#@gui :Space Color A=color(#ff007f) +#@gui :Space Color B=color(#f9d72d) +#@gui :_=separator() +#@gui :_=note("Animation") +#@gui :Shift=float(0,-5,5)_0 +#@gui :Multiplier A=float(1,.1,250)_0 +#@gui :Multiplier B=float(100,.1,250)_0 +#@gui :_=note("Under Development!") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2021/5/24.") +#@gui Random Rectangle Division:fx_rep_rrd,fx_rep_rrd +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Division=int(10,1,20) +#@gui :Additional Thickness=int(5,0,100) +#@gui :Maximum Division Iteration=int(5,2,40) +#@gui :Probability of Division(%)=float(95,20,100) +#@gui :Loop Limit=int(50000,1000,2097152) +#@gui :Seed=int(0,0,300) +#@gui :Border(%)=float(35,0,100) +#@gui :_=separator() +#@gui :_=note("Color") +#@gui :Mode=choice(0,"Grayscale","Palette","Random") +#@gui :Normalize?=bool(1) +#@gui :Palette=choice(12,"BW-2","RGB-3","B-RGB-4","BW-RGB-5","CMY-3","CMYK-4","WCMYK-5","RGBCMY-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus-256","PLAYPAl-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette","Koni32","Linear Color Palette Basic","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8","CD-BAC-16","CG Arne-16","Dinoknight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar [Lake Water Lily]-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet-20","Matrix-96","Material Design-96","Rainbow A-88","Rainbow B-96","SCRJ-XXXVI-36","Pxls Default-32","Moderna-24","Oak21-21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80s-8","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R\place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A-15","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-8","Ocean Glass-8","RoyalGuard-6","Eulbink-8","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-4","Rabbit 7-4","Amiga 2600 NTSC-128","Amiga 2600 PAL-108","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","C64[Pepto]-16","C64[Colodore]-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-256","Win95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Human Faces-94","MadjikHSV-96","ST24 Christmas","Reds-24","Pastel Rainbow-6") +#@gui :Color Space=choice(0,"RGB","HSV") +#@gui :Number of Color=int(0,0,100) +#@gui :Seed=int(0,0,100000) +#@gui :Border=color(#000000) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/10/04.") +#@gui Rectangle-Square Fill:fx_rep_rand_sqrrecfill,fx_rep_rand_sqrrecfill +#@gui :_=note("Main") +#@gui :1.Palette=choice(0,"None","RGB-3","B-RGB-4","BW-RGB-5","CMY-3","CMYK-4","WCMYK-5","RGBCMY-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus-256","PLAYPAl-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette","Koni32","Linear Color Palette Basic","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8","CD-BAC-16","CG Arne-16","Dinoknight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar [Lake Water Lily]-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet-20","Matrix-96","Material Design-96","Rainbow A-88","Rainbow B-96","SCRJ-XXXVI-36","Pxls Default-32","Moderna-24","Oak21-21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80s-8","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R\place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A-15","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-8","Ocean Glass-8","RoyalGuard-6","Eulbink-8","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-4","Rabbit 7-4","Amiga 2600 NTSC-128","Amiga 2600 PAL-108","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","C64[Pepto]-16","C64[Colodore]-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-256","Win95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Human Faces-94","MadjikHSV-96","ST24 Christmas","Reds-24","Pastel Rainbow-6") +#@gui :2.Use Random Color Instead?=bool(0) +#@gui :3.Square Size=int(15,2,150) +#@gui :4.Max Primary Dimension of Rectangle=int(2,1,10) +#@gui :5.Max Secondary Dimension of Rectangle=int(1,1,10) +#@gui :6.Frequency of Rectangle=float(1,0,1) +#@gui :7.Line Erosion=int(0,-15,15) +#@gui :8.Line Output=bool(1) +#@gui :9.Reduce Non-Rectangular Shape=bool(1) +#@gui :10.Remove Black from Palette?=bool(1) +#@gui :Seed=int(0,0,50000) +#@gui :Colour Space=choice(0,"RGB-8","RYB-8","HSI-8","HSL-8","HSV-8","LAB-8","LCH-8","YIQ-8","YUV-8") +#@gui :_=separator() +#@gui :_=note("Extra") +#@gui :Output Mode=choice(0,"Clipped","Enlarged","Shrinked") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2020/1/8.") +#@gui Red Acrylic Plastic Filter:fx_rep_red_acrylic_filter,fx_rep_red_acrylic_filter_preview(1) : + +#@gui :_=note("This generates image in which you use red acrylic plastic cover in order to reveal a image.\n\nThis filter require multiple images.") +#@gui :_=separator() +#@gui :_=note("Initial") +#@gui :Use Imported Image?=bool(0) +#@gui :Image Location=file() +#@gui :Use Reference Layer=bool(0) +#@gui :Reference Layer=choice(0,"Top","Bottom") +#@gui :_=separator() +#@gui :_=note("Effect") +#@gui :Luminosity Blend=float(0,0,100) +#@gui :Green Cut Point=float(0,0,100) +#@gui :Green Visibility=float(100,0,100) +#@gui :Use Imported Image?=bool(0)_0 +#@gui :Image Location=file()_0 +#@gui :Use Reference Layer=bool(0)_0 +#@gui :Reference Layer=choice(0,"Top","Bottom")_0 +#@gui :Luminosity Blend=float(0,0,100)_0 +#@gui :Green Cut Point=float(0,0,100)_0 +#@gui :Green Visibility=float(100,0,100)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2022/09/12.") +#@gui Reverse Digits:fx_rep_rd,fx_rep_rd_preview(0) +#@gui :_=note("Reverses digits of image. Used for glitch art.\n\nNote:Max-1 for Out-Of-Bound Mode is only applicable in float color space.") +#@gui :_=separator() +#@gui :_=note("Color and Alpha") +#@gui :Colour Space=choice(0,"RGB-8","SRGB-8","RYB-8","CMY","CMYK","HSI-8,"HSL-8","HSV-8","LAB-8","LCH-8","YCBCR-8","YIQ-8","YUV-8","YES-8","K1-8","Ohta-8") +#@gui :Use Alpha?=bool(0) +#@gui :_=separator() +#@gui :_=note("Values") +#@gui :Base=int(10,2,50) +#@gui :Out-Of-Bound Mode=choice(0,"None","Periodic","Continuous) +#@gui :Cut Value?=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/9/26.") +#@gui Reverse Engineer Color Curve:gui_rep_recc,gui_rep_recc_preview(0) : + +#@gui :_=note("Reverse engineer color curves map. You must export, and then import to your program of choice!") +#@gui :_=separator() +#@gui :_=note("Processing") +#@gui :Gradient Thickness=int(10,1,100) +#@gui :Use First Layer?=bool(1) +#@gui :_=separator() +#@gui :_=note("Export") +#@gui :Folder=folder() +#@gui :Filename=text("gradient.png") +#@gui :Export Gradient=button() +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Preview All Gradient at Once?=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/1/2.") +#@gui Reverse Engineer Gradient Map:gui_rep_regm,gui_rep_regm_preview(0) : + +#@gui :_=note("Reverse engineer gradient map. You must export, and then import to your program of choice!") +#@gui :_=separator() +#@gui :_=note("Processing") +#@gui :Gradient Thickness=int(10,1,100) +#@gui :Use First Layer?=bool(1) +#@gui :Normalize?=bool(0) +#@gui :_=separator() +#@gui :_=note("Export") +#@gui :Folder=folder() +#@gui :Filename=text("gradient.png") +#@gui :Export Gradient=button() +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Preview All Gradient at Once?=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/12/27.") +#@gui RGB-Gray Linear Interpolation:fx_rep_lerp_rgb_gray,fx_rep_lerp_rgb_gray_preview(0) +#@gui :_=note("Formula") +#@gui :Mode=choice(0,"Luminosity A","Luminosity B","Lightness","Minimum","Maximum","Average",Weighted") +#@gui :Limit Factor to 100%=bool(0) +#@gui :_=separator() +#@gui :_=note("Channel Factor") +#@gui :Red Factor (%)=float(100,0,150) +#@gui :Green Factor (%)=float(100,0,150) +#@gui :Blue Factor (%)=float(100,0,150) +#@gui :Red Factor (%)=float(100,0,100) +#@gui :Green Factor (%)=float(100,0,100) +#@gui :Blue Factor (%)=float(100,0,100) +#@gui :Red Weight=float(1,0,1) +#@gui :Green Weight=float(1,0,1) +#@gui :Blue Weight=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/14/3.") +#@gui Rotate by Torus Map:fx_rep_rbtt,fx_rep_rbtt_preview(0) +#@gui :_=note("Main") +#@gui :Circumference A (%)=float(100,0,100) +#@gui :Circumference B (%)=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Distortion") +#@gui :Distortion Angle=float(-180,-720,720) +#@gui :Distortion Mode=choice(3,"Soft","Medium","Hard","Alternative Hard","Distroy","Inverse-Distroy","Quad Extrude","Hexagonal Extrude") +#@gui :Distortion Mode A=choice(3,"Soft","Medium","Hard","Alternative Hard","Distroy","Inverse-Distroy","Quad Extrude","Hexagonal Extrude") +#@gui :Distortion Mode B=choice(7,"Soft","Medium","Hard","Alternative Hard","Distroy","Inverse-Distroy","Quad Extrude","Hexagonal Extrude") +#@gui :Distortion Mode Blending (%)=float(50,0,100) +#@gui :Enable Distortion Mode Blending=bool(1) +#@gui :Distortion Position=point(50,50,0,1,255,255,255,255) +#@gui :Wraparound Distortion?=bool(1) +#@gui :_=separator() +#@gui :_=note("Additional") +#@gui :Remove Background?=bool(0) +#@gui :Activate Isolated Torus Mode?=bool(0) +#@gui :_=separator() +#@gui :_=note("Rendering") +#@gui :Interpolation=choice(1,"None","Linear") +#@gui :Boundary Condition=choice(2,"None","Neumann","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Information\n") +#@gui :_=note("This filter is inspired by Donut Distortion Paint.NET plugin by MadJik.\n\n This G'MIC version includes additional modes,wraparound mode, and special mode which isolates the distortion.") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/11/08.") +#@gui Serendipitous Circle:fx_rep_serendipitous_circle,fx_rep_serendipitous_circle(0)* +#@gui :_=note("Iterations") +#@gui :_=separator() +#@gui :Points=int(1000,10,100000) +#@gui :Repeats=int(500,10,20000) +#@gui :_=note("Coefficient") +#@gui :_=separator() +#@gui :Coefficient A=float(2,-100,100) +#@gui :Coefficient B=float(2,-100,100) +#@gui :Use -0 for Coefficient A?=bool(0) +#@gui :Use -0 for Coefficient B?=bool(0) +#@gui :Coefficient A to 0=button() +#@gui :Coefficient B to 0=button() +#@gui :Coefficients to 0=button() +#@gui :Linked Coefficient?=bool(0) +#@gui :_=note("Operators") +#@gui :_=separator() +#@gui :Mode A=choice(1,"Multiplication","Division") +#@gui :Mode B=choice(1,"Multiplication","Division") +#@gui :_=note("Variable") +#@gui :_=separator() +#@gui :Use Old Mode=bool(0) +#@gui :_=note("Rendering") +#@gui :_=separator() +#@gui :Sublevel=float(1,0,10) +#@gui :Symmetry Mode=choice(1,"Mode 0","Mode 1") +#@gui :Seed=int(0,0,1000000) +#@gui :Randomize Seed=button() +#@gui :Normalization Convolution=int(0,1,500) +#@gui :Use Exponential-Sigmoid Adjustment?=bool(1) +#@gui :Mid-Point Shift=float(.25,-1,1) +#@gui :Sigmoid-Shift=float(0,-100,100) +#@gui :Value-Shift=float(0,-1,1) +#@gui :Coefficient A=float(2,-100,100)_0 +#@gui :Coefficient B=float(2,-100,100)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2022/03/09.") +#@gui __Deformations +#@gui Sinusoidal Water Distortion:rep_sinowaterdist_gui,rep_sinowaterdist_gui_preview(0) +#@gui :X-Balance=float(0,-100,100) +#@gui :Y-Balance=float(0,-100,100) +#@gui :Scale=float(.5,.1,100) +#@gui :Interpolation=choice(2,"Nearest","Linear","Bicubic") +#@gui :Boundary Condition=choice(0,"Periodic","Mirror") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/6/4.") +#@gui _Testing +#@gui Reptorian +#@gui Skew:rep_skew,rep_skew_preview +#@gui :Angle=float(0,-89.99,89.99) +#@gui :Position(%)=float(0,-100,100) +#@gui :Axis=choice(0,"X","Y") +#@gui :Boundary=choice(3,"None","Neumann","Periodic","Mirror") +#@gui :Interpolation=choice(2,"Nearest","Linear","Bicubic") +#@gui :Enlarge?=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/4/16.") +#@gui Spiral Distortion:gui_rep_sd,gui_rep_sd_preview(0) +#@gui :_=note("Transform image using spiral gradient for x-coordinate, and radial gradient for y-coordinate.") +#@gui :_=separator() +#@gui :Revolution=float(1,.1,10) +#@gui :Spiral Height=float(1,.5,10) +#@gui :Refraction Power=float(0,-.99,2) +#@gui :Direction=choice(0,"Clockwise","Counterclockwise") +#@gui :Angle=float(0,-180,180) +#@gui :Spiral Mode=choice(0,"Periodic","Continuous") +#@gui :Preshift Position=point(50,50,0,1,200,200,200,255) +#@gui :Preshift Boundary=choice(0,"Periodic","Mirror") +#@gui :Skew Position (%)=point(50,50,0,1,100,100,100,255) +#@gui :Skew Multiplier=float(1,-.5,3) +#@gui :Offset (%)=point(50,50,0,1,255,255,255,255) +#@gui :Scale X-Coordinate (%)=float(100,1,1000) +#@gui :Scale Y-Coordinate (%)=float(100,1,1000) +#@gui :Boundary Condition=choice(3,"None","Neumann","Periodic","Mirror") +#@gui :Interpolation=choice(4,"Nearest","Average","Linear","Bicubic","Lanczos") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/10/15.") +#@gui Squareroot - Logarithmic Distortion:rep_sqrlogpindis_gui,rep_sqrlogpindis_gui_preview(0) +#@gui :_=note("This filter is a extended version of a filter found in Asmageddon Tools Pack v3. Translated to G'MIC using a source code, and then extended. It is a mixture of two texture filters.") +#@gui :_=separator() +#@gui :Distortion Factor=float(1,.1,1000) +#@gui :Preliminary Surface Shift=point(50,50,0,1,128,128,128,255) +#@gui :Distortion Surface Position=point(50,50,0,1,255,255,255,255) +#@gui :Preliminary X-Axis Scaling=float(1,.1,10) +#@gui :Preliminary Y-Axis Scaling=float(1,.1,10) +#@gui :Effect X-Axis Scaling=float(1,.1,10) +#@gui :Effect Y-Axis Scaling=float(1,.1,10) +#@gui :Distortion Surface Angle=float(0,0,360) +#@gui :Placement=choice(0,"Inside-Out","Outside-In") +#@gui :Logarithmic Distortion Axis Combination for X-Axis=choice(0,"Different Axis","Same Axis") +#@gui :Logarithmic Distortion Axis Combination for Y-Axis=choice(0,"Different Axis","Same Axis") +#@gui :Logarithmic Distortion X-Axis Direction=choice(0,"Negative","Positive") +#@gui :Logarithmic Distortion Y-Axis Direction=choice(0,"Negative","Positive") +#@gui :Boundary Condition=choice(0,"Periodic","Mirror") +#@gui :Interpolation=choice(2,"Nearest","Linear","Bicubic") +#@gui :Base Reference Dimension=int(1024,10,4096) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/6/4.") +#@gui Statistical Average:fx_rep_bchstatfunc_average,fx_rep_bchstatfunc_average_preview +#@gui :Mode=choice(0,"RGB","SRGB","RYB","LAB") +#@gui :Use Alpha?=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/4/07.") +#@gui Stitch Distort:fx_rep_stitch,fx_rep_stitch_preview +#@gui :_=note("Main") +#@gui :Offset by Half-Image-Diagonal(%)=float(5,-100,100) +#@gui :Strip Thickness(%)=float(1,0,75) +#@gui :Modulo=int(0,0,32) +#@gui :Modulo Boundary=choice(0,"Periodic","Continuous") +#@gui :Image Boundary=choice(3,"None","Neumann","Periodic","Mirror") +#@gui :Offset Mode=choice(0,"Single Iteration of Randomization","Multiple Iteration of Randomization") +#@gui :Strip Mode=choice(0,"None","Single Iteration of Randomization","Multiple Iteration of Randomization") +#@gui :Offset Seed=int(128,0,255) +#@gui :Strip Seed=int(128,0,255) +#@gui :_=separator() +#@gui :_=note("Rendering") +#@gui :Subpixel Processing Level=float(1,0,2) +#@gui :Interpolation=choice(4,"Nearest","Average","Linear","Bicubic","Lanczos") +#@gui :_=separator() +#@gui :_=note("Angles") +#@gui :Angles Mode=choice(1,"Non-Symmetrical","Symmetrical") +#@gui :Start Angle=float(0,-180,180) +#@gui :Number of Angles=int(2,2,12) +#@gui :Number of Angles=int(2,1,12) +#@gui :Angle #1=float(45,-180,180) +#@gui :Angle #2=float(-45,-180,180) +#@gui :Angle #3=float(90,-180,180) +#@gui :Angle #4=float(0,-180,180) +#@gui :Angle #5=float(60,-180,180) +#@gui :Angle #6=float(-60,-180,180) +#@gui :Angle #7=float(15,-180,180) +#@gui :Angle #8=float(-15,-180,180) +#@gui :Angle #9=float(30,-180,180) +#@gui :Angle #10=float(-30,-180,180) +#@gui :Angle #11=float(5,-180,180) +#@gui :Angle #12=float(-5,-180,180) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2022/4/16.") +#@gui Strange Bulger:rep_strbul,rep_strbul_preview(0) +#@gui :Angle=float(0,-180,180) +#@gui :Axis=choice(0,"X-Axis","Y-Axis") +#@gui :Interpolation=choice(2,"Nearest","Linear","Bicubic") +#@gui :Boundary Condition=choice(0,"Periodic","Mirror") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/6/4.") +#@gui Strange Bulger Kaleidoscope:rep_strbulkal_gui,rep_strbulkal_gui_preview(0) +#@gui :_=note("This filter is a extended version of the filters named 'Strange Bulger A', and 'Strange Bulger B' found inAsmageddon Tools Pack v3. Translated to G'MIC using source code for Asmageddon's tool, and then extended.") +#@gui :_=separator() +#@gui :Bulge Angle=float(0,-180,180) +#@gui :Axis of Bulge=choice(0,"X-Axis","Y-Axis") +#@gui :Scale=float(1,.1,10) +#@gui :Preliminary Surface Shift=point(50,50,0,1,128,128,128,255) +#@gui :Distortion Surface Position=point(50,50,0,1,255,255,255,255) +#@gui :Distortion Surface Angle=float(0,0,360) +#@gui :Placement=choice(0,"Inside-Out","Outside-In") +#@gui :Boundary Condition=choice(0,"Periodic","Mirror") +#@gui :Interpolation=choice(2,"Nearest","Linear","Bicubic") +#@gui :Base Reference Dimension=int(1024,10,4096) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/6/4.") +#@gui Three-Coupled Oscillators:fx_rep_tco,fx_rep_tco +#@gui :_=note("Main") +#@gui :_=separator() +#@gui :Maximum Iteration=int(50,1,200) +#@gui :K-A Tau(%)=float(50,-100,100) +#@gui :K-B Tau(%)=float(-50,-100,100) +#@gui :Subpixel Level=float(1,0,2) +#@gui :Angle=float(0,-180,180) +#@gui :Position=point(50,50,0,1,128,128,128,255) +#@gui :Axis-Scale=float(1,1,15) +#@gui :_=note("Coloring") +#@gui :_=separator() +#@gui :Mode=choice(0,"Grayscale","Palette","Random") +#@gui :Palette=choice(12,"BW-2","RGB-3","B-RGB-4","BW-RGB-5","CMY-3","CMYK-4","WCMYK-5","RGBCMY-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus-256","PLAYPAl-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette","Koni32","Linear Color Palette Basic","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8","CD-BAC-16","CG Arne-16","Dinoknight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar [Lake Water Lily]-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet-20","Matrix-96","Material Design-96","Rainbow A-88","Rainbow B-96","SCRJ-XXXVI-36","Pxls Default-32","Moderna-24","Oak21-21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80s-8","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R\place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A-15","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-8","Ocean Glass-8","RoyalGuard-6","Eulbink-8","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-4","Rabbit 7-4","Amiga 2600 NTSC-128","Amiga 2600 PAL-108","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","C64[Pepto]-16","C64[Colodore]-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-256","Win95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Human Faces-94","MadjikHSV-96","ST24 Christmas","Reds-24","Pastel Rainbow-6") +#@gui :Number of Colors=int(6,2,100) +#@gui :Color Space=choice(0,"RGB","HSI","HCY","LAB") +#@gui :Seed=int(0,0,3000) +#@gui :Boundary=choice(1,"Periodic","Periodic-Smooth","Continuous") +#@gui :Negate=bool(0) +#@gui :Shift Value=float(0,-1,1) +#@gui :Multiplier=float(1,.25,10) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/10/15.") +#@gui Tiled Form:gui_rep_form_pixel,gui_rep_form_pixel_preview +#@gui :_=note("Colour Space Processing") +#@gui :Colour Space=choice(0,"RGB","RYB","CMYK","HCY","HSI","HSL","HSV","LAB","LCH") +#@gui :_=separator() +#@gui :_=note("Tile Shape") +#@gui :Tiled Shape=choice(3,"By Layer","Australia","Barbedwire","Circle","Crosshair","Cupid","Diamond","Dragon Curve-[D]","Dragonfly","Fern-[D]","Flip","Gear-[D]","Gumleaf","Heart","Information","Kookaburra","Mail","Mapleleaf","Paint Splat","Paw","Phone","Polygon-[D]","Rooster","Shopping Cart","Snowflake-[D]","Star-[D]") +#@gui :Reverse Layer=bool(0) +#@gui :_=note("For the first option, you must use at least 2 layer to use layer as shape reference, else it'll use the only image itself as shape reference. Reverse Layer option might have to be used to generate the proper result when using first option.") +#@gui :_=separator() +#@gui :_=note("Tiles") +#@gui :Shape Width (px)=int(30,0,512) +#@gui :Shape Height (px)=int(30,0,512) +#@gui :Shape Ratio (%)=float(100,5,100) +#@gui :Shape Rotation=float(0,-180,180) +#@gui :Shape Mirror Axis=choice(0,"None","X","Y") +#@gui :Subpixel Level=float(.5,0,2) +#@gui :Z-Convolution Factor (%)=float(50,0,200) +#@gui :Z-Convolution Boundary=choice(0,"Neumann","Periodic") +#@gui :Interpolation=choice(5,"Nearest","Average","Linear","Grid","Bicubic","Lanczos") +#@gui :Tile Boundary=choice(0,"Periodic","Mirror - X","Mirror - Y","Mirror - XY") +#@gui :Preprocess Boundary=choice(2,"Neumann","Periodic","Mirror") +#@gui :Fit Tile?=bool(1) +#@gui :Output=choice(0,"New Dimension","New Dimension - New Layer","Old Dimension","Old Dimension - New Layer") +#@gui :_=note("If using Krita and New Layer option, then you may have to reorder one layer.") +#@gui :_=separator() +#@gui :_=note("Dynamic Shape") +#@gui :Dragon Curve Recursion=int(10,0,30) +#@gui :Dragon Curve Rotation=float(0,-180,180) +#@gui :Fern Type=choice("Asplenium Adiantum-Nigrum","Thelypteridaceae") +#@gui :Fern Density (%)=float(100,0,300) +#@gui :Gear Teeth Count=int(8,3,32) +#@gui :Gear Height (%)=float(25,0.1,100) +#@gui :Gear Offset Teeth (%)=float(0,0,100) +#@gui :Gear Inner Ratio (%)=float(50,0.1,100) +#@gui :Polygon Vertices=int(5,3,100) +#@gui :Snowflake Recursion=int(5,1,6) +#@gui :Star Branches=int(3,5,100) +#@gui :Star Thickness (%)=float(38,.1,100) +#@gui :_=note("Dynamic Shapes Options are only visible for dynamic shapes!") +#@gui :_=separator() +#@gui :_=note("Original idea comes from TR's Tiled Pixels V1.2 plugin by TechnoRobbo for Paint.NET. This version is a extended version utilizing weighted average sampling per area per tile, boundary option, anti-aliasing, dynamic shape, color space,and transformation. Dynamic shapes are also supported by this filter.") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/12/15.") +#@gui Tiled Zoom:fx_rep_tz,fx_rep_tz_preview(0) +#@gui :_=note("Create tiled zoom.") +#@gui :_=separator() +#@gui :Square Width - Half Image-Diagonal(%)=float(10,1,100) +#@gui :Square Height - Half Image-Diagonal(%)=float(10,1,100) +#@gui :Scale=float(2,1,10) +#@gui :Boundary=choice(0,"None","Neumann","Periodic","Mirror") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/9/22.") +#@gui TR's Intense Filtration:gui_rep_trif,gui_rep_trif_preview(0) +#@gui :Hue=float(45,0,360) +#@gui :Image Coefficient (%)=float(100,0,200) +#@gui :Mix Factor (%)=float(0,0,100) +#@gui :Style Base=choice(0,"Based from Original Image","Based on Grayscale","Based on Hue") +#@gui :_=separator() +#@gui :_=note("Preview Setting") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("TR's Intense Filtration is a filter that filters out colors and augment a color based on hue. The formula for the filter is created by TechnoRobbo. The code for this filter is based on the source code of TechnoRobbo's Intense Filtration v1.3 plugin for Paint.NET.") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/11/1.") +#@gui TR's Pixel Sharpener:gui_rep_trps,gui_rep_trps_preview(0) +#@gui :Sharpening=float(0,0,50) +#@gui :Internal Blurring=int(0,0,4) +#@gui :Blur Type=choice(0,"Photo","Horizontal","Vertical","Angle - One Axis","Angle - Two Axis","Angle - Two Axis [Disconnected]") +#@gui :Angle=float(0,-180,180) +#@gui :Angle 2=float(0,-180,180) +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :_=note("This is a extended filter which was based on a Paint.NET plugin that was created by TechnoRobbo - TR's Pixel Sharpener") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/11/2.") +#@gui Transfer Color [Reduced Colors]:fx_rep_transfer_color_reduced,fx_rep_transfer_color_reduced_preview(0)* +#@gui :_=separator() +#@gui :_=note("Preliminary Setup") +#@gui :Style of Dithering=choice(0,"Indexing","Ordered") +#@gui :Dithering (%)=float(50,0,100) +#@gui :Special Effect=choice(0,"None","Horizontal-D","Vertical-D","Horizontal-L","Vertical-L","Checkerboard-D","Checkerboard-L") +#@gui :Special Effect Factor (%)=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Palette") +#@gui :Coloring Method=choice(0,"Premade Palette","Bit Depth/Levels") +#@gui :Palette Method=choice(0,"Premade","Auto","Import","Custom") +#@gui :Use Bit Depth=bool(0) +#@gui :Levels=int(4,1,64) +#@gui :Red Levels=int(4,1,64) +#@gui :Green Levels=int(4,1,64) +#@gui :Blue Levels=int(4,1,64) +#@gui :Use Same Levels for All Channels=bool(0) +#@gui :Bit-Depth=int(2,1,8) +#@gui :Red Bit-Depth=int(2,1,8) +#@gui :Green Bit-Depth=int(2,1,8) +#@gui :Blue Bit-Depth=int(2,1,8) +#@gui :Use Same Bit-Depths for All Channel=bool(0) +#@gui :Palette to Use=choice(18,"BW-2","RGB-3","B-RGB-4","BW-RGB-5","CMY-3","CMYK-4","WCMYK-5","RGBCMY-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus-256","PLAYPAl-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette","Koni32","Linear Color Palette Basic","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8","CD-BAC-16","CG Arne-16","Dinoknight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar [Lake Water Lily]-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet-20","Matrix-96","Material Design-96","Rainbow A-88","Rainbow B-96","SCRJ-XXXVI-36","Pxls Default-32","Moderna-24","Oak21-21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80s-8","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R\place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A-15","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-8","Ocean Glass-8","RoyalGuard-6","Eulbink-8","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-4","Rabbit 7-4","Amiga 2600 NTSC-128","Amiga 2600 PAL-108","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","C64[Pepto]-16","C64[Colodore]-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-256","Win95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Human Faces-94","MadjikHSV-96","ST24 Christmas","Reds-24","Pastel Rainbow-6") +#@gui :‎ - Send to Custom Palette‎ -=button() +#@gui :Palette File Location=file() +#@gui :Re-Import File‎‎=button() +#@gui :Number of Color=int(8,2,256) +#@gui :Number of Color=int(8,2,256) +#@gui :Color Restriction Per Whole Image=int(0,0,256) +#@gui :Color Restriction Per Window=int(0,0,16) +#@gui :Display Custom Palette Colors=bool(1) +#@gui :Multi-Select Palette Color=bool(0) +#@gui :_=separator() +#@gui :Delete All Selected Palette=button(0) +#@gui :_=separator() +#@gui :Palette Color 1=color(#f7f4bf) +#@gui :‎ ‎ ‎ ‎ Delete Color 1‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 1 Selected=_bool(0) +#@gui :Palette Color 2=color(#fff02b) +#@gui :‎ ‎ ‎ ‎ Delete Color 2‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 2 Selected=_bool(0) +#@gui :Palette Color 3=color(#ffcf05) +#@gui :‎ ‎ ‎ ‎ Delete Color 3‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 3 Selected=_bool(0) +#@gui :Palette Color 4=color(#ffb108) +#@gui :‎ ‎ ‎ ‎ Delete Color 4‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 4 Selected=_bool(0) +#@gui :Palette Color 5=color(#e98627) +#@gui :‎ ‎ ‎ ‎ Delete Color 5‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 5 Selected=_bool(0) +#@gui :Palette Color 6=color(#bf5a3e) +#@gui :‎ ‎ ‎ ‎ Delete Color 6‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 6 Selected=_bool(0) +#@gui :Palette Color 7=color(#9c3327) +#@gui :‎ ‎ ‎ ‎ Delete Color 7‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 7 Selected=_bool(0) +#@gui :Palette Color 8=color(#721c03) +#@gui :‎ ‎ ‎ ‎ Delete Color 8‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 8 Selected=_bool(0) +#@gui :Palette Color 9=color(#ffe2cf) +#@gui :‎ ‎ ‎ ‎ Delete Color 9‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 9 Selected=_bool(0) +#@gui :Palette Color 10=color(#d4aeaa) +#@gui :‎ ‎ ‎ ‎ Delete Color 10‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 10 Selected=_bool(0) +#@gui :Palette Color 11=color(#b58b94) +#@gui :‎ ‎ ‎ ‎ Delete Color 11‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 11 Selected=_bool(0) +#@gui :Palette Color 12=color(#ad7984) +#@gui :‎ ‎ ‎ ‎ Delete Color 12‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 12 Selected=_bool(0) +#@gui :Palette Color 13=color(#91606a) +#@gui :‎ ‎ ‎ ‎ Delete Color 13‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 13 Selected=_bool(0) +#@gui :Palette Color 14=color(#77535b) +#@gui :‎ ‎ ‎ ‎ Delete Color 14‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 14 Selected=_bool(0) +#@gui :Palette Color 15=color(#5e414a) +#@gui :‎ ‎ ‎ ‎ Delete Color 15‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 15 Selected=_bool(0) +#@gui :Palette Color 16=color(#492129) +#@gui :‎ ‎ ‎ ‎ Delete Color 16‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 16 Selected=_bool(0) +#@gui :Palette Color 17=color(#8393c3) +#@gui :‎ ‎ ‎ ‎ Delete Color 17‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 17 Selected=_bool(0) +#@gui :Palette Color 18=color(#6c82c4) +#@gui :‎ ‎ ‎ ‎ Delete Color 18‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 18 Selected=_bool(0) +#@gui :Palette Color 19=color(#5274c5) +#@gui :‎ ‎ ‎ ‎ Delete Color 19‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 19 Selected=_bool(0) +#@gui :Palette Color 20=color(#5165ae) +#@gui :‎ ‎ ‎ ‎ Delete Color 20‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 20 Selected=_bool(0) +#@gui :Palette Color 21=color(#3d5083) +#@gui :‎ ‎ ‎ ‎ Delete Color 21‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 21 Selected=_bool(0) +#@gui :Palette Color 22=color(#2d3d72) +#@gui :‎ ‎ ‎ ‎ Delete Color 22‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 22 Selected=_bool(0) +#@gui :Palette Color 23=color(#28335d) +#@gui :‎ ‎ ‎ ‎ Delete Color 23‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 23 Selected=_bool(0) +#@gui :Palette Color 24=color(#262450) +#@gui :‎ ‎ ‎ ‎ Delete Color 24‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 24 Selected=_bool(0) +#@gui :Palette Color 25=color(#d1bdfe) +#@gui :‎ ‎ ‎ ‎ Delete Color 25‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 25 Selected=_bool(0) +#@gui :Palette Color 26=color(#baabf7) +#@gui :‎ ‎ ‎ ‎ Delete Color 26‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 26 Selected=_bool(0) +#@gui :Palette Color 27=color(#a996ec) +#@gui :‎ ‎ ‎ ‎ Delete Color 27‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 27 Selected=_bool(0) +#@gui :Palette Color 28=color(#9585f1) +#@gui :‎ ‎ ‎ ‎ Delete Color 28‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 28 Selected=_bool(0) +#@gui :Palette Color 29=color(#7964ba) +#@gui :‎ ‎ ‎ ‎ Delete Color 29‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 29 Selected=_bool(0) +#@gui :Palette Color 30=color(#584a7f) +#@gui :‎ ‎ ‎ ‎ Delete Color 30‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 30 Selected=_bool(0) +#@gui :Palette Color 31=color(#3c3151) +#@gui :‎ ‎ ‎ ‎ Delete Color 31‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 31 Selected=_bool(0) +#@gui :Palette Color 32=color(#1d1d21) +#@gui :‎ ‎ ‎ ‎ Delete Color 32‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 32 Selected=_bool(0) +#@gui :Palette Color 33=color(#fdf786) +#@gui :‎ ‎ ‎ ‎ Delete Color 33‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 33 Selected=_bool(0) +#@gui :Palette Color 34=color(#ffd59b) +#@gui :‎ ‎ ‎ ‎ Delete Color 34‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 34 Selected=_bool(0) +#@gui :Palette Color 35=color(#ebbd9d) +#@gui :‎ ‎ ‎ ‎ Delete Color 35‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 35 Selected=_bool(0) +#@gui :Palette Color 36=color(#d5a39a) +#@gui :‎ ‎ ‎ ‎ Delete Color 36‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 36 Selected=_bool(0) +#@gui :Palette Color 37=color(#b98c93) +#@gui :‎ ‎ ‎ ‎ Delete Color 37‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 37 Selected=_bool(0) +#@gui :Palette Color 38=color(#977488) +#@gui :‎ ‎ ‎ ‎ Delete Color 38‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 38 Selected=_bool(0) +#@gui :Palette Color 39=color(#765d73) +#@gui :‎ ‎ ‎ ‎ Delete Color 39‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 39 Selected=_bool(0) +#@gui :Palette Color 40=color(#554769) +#@gui :‎ ‎ ‎ ‎ Delete Color 40‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 40 Selected=_bool(0) +#@gui :Palette Color 41=color(#6dccff) +#@gui :‎ ‎ ‎ ‎ Delete Color 41‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 41 Selected=_bool(0) +#@gui :Palette Color 42=color(#55b1f1) +#@gui :‎ ‎ ‎ ‎ Delete Color 42‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 42 Selected=_bool(0) +#@gui :Palette Color 43=color(#4097ea) +#@gui :‎ ‎ ‎ ‎ Delete Color 43‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 43 Selected=_bool(0) +#@gui :Palette Color 44=color(#1476c0) +#@gui :‎ ‎ ‎ ‎ Delete Color 44‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 44 Selected=_bool(0) +#@gui :Palette Color 45=color(#105da2) +#@gui :‎ ‎ ‎ ‎ Delete Color 45‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 45 Selected=_bool(0) +#@gui :Palette Color 46=color(#07487c) +#@gui :‎ ‎ ‎ ‎ Delete Color 46‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 46 Selected=_bool(0) +#@gui :Palette Color 47=color(#03315f) +#@gui :‎ ‎ ‎ ‎ Delete Color 47‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 47 Selected=_bool(0) +#@gui :Palette Color 48=color(#001b40) +#@gui :‎ ‎ ‎ ‎ Delete Color 48‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 48 Selected=_bool(0) +#@gui :Palette Color 49=color(#e0faeb) +#@gui :‎ ‎ ‎ ‎ Delete Color 49‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 49 Selected=_bool(0) +#@gui :Palette Color 50=color(#a9d1c1) +#@gui :‎ ‎ ‎ ‎ Delete Color 50‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 50 Selected=_bool(0) +#@gui :Palette Color 51=color(#8ac196) +#@gui :‎ ‎ ‎ ‎ Delete Color 51‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 51 Selected=_bool(0) +#@gui :Palette Color 52=color(#87ae8e) +#@gui :‎ ‎ ‎ ‎ Delete Color 52‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 52 Selected=_bool(0) +#@gui :Palette Color 53=color(#71957d) +#@gui :‎ ‎ ‎ ‎ Delete Color 53‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 53 Selected=_bool(0) +#@gui :Palette Color 54=color(#5b7b69) +#@gui :‎ ‎ ‎ ‎ Delete Color 54‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 54 Selected=_bool(0) +#@gui :Palette Color 55=color(#47655a) +#@gui :‎ ‎ ‎ ‎ Delete Color 55‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 55 Selected=_bool(0) +#@gui :Palette Color 56=color(#2d4b47) +#@gui :‎ ‎ ‎ ‎ Delete Color 56‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 56 Selected=_bool(0) +#@gui :Palette Color 57=color(#f4a380) +#@gui :‎ ‎ ‎ ‎ Delete Color 57‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 57 Selected=_bool(0) +#@gui :Palette Color 58=color(#d79374) +#@gui :‎ ‎ ‎ ‎ Delete Color 58‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 58 Selected=_bool(0) +#@gui :Palette Color 59=color(#bf7e63) +#@gui :‎ ‎ ‎ ‎ Delete Color 59‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 59 Selected=_bool(0) +#@gui :Palette Color 60=color(#a96d58) +#@gui :‎ ‎ ‎ ‎ Delete Color 60‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 60 Selected=_bool(0) +#@gui :Palette Color 61=color(#945d4f) +#@gui :‎ ‎ ‎ ‎ Delete Color 61‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 61 Selected=_bool(0) +#@gui :Palette Color 62=color(#784c49) +#@gui :‎ ‎ ‎ ‎ Delete Color 62‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 62 Selected=_bool(0) +#@gui :Palette Color 63=color(#53393a) +#@gui :‎ ‎ ‎ ‎ Delete Color 63‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 63 Selected=_bool(0) +#@gui :Palette Color 64=color(#372423) +#@gui :‎ ‎ ‎ ‎ Delete Color 64‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 64 Selected=_bool(0) +#@gui :Palette Color 65=color(#7fbd39) +#@gui :‎ ‎ ‎ ‎ Delete Color 65‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 65 Selected=_bool(0) +#@gui :Palette Color 66=color(#789e24) +#@gui :‎ ‎ ‎ ‎ Delete Color 66‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 66 Selected=_bool(0) +#@gui :Palette Color 67=color(#6b842d) +#@gui :‎ ‎ ‎ ‎ Delete Color 67‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 67 Selected=_bool(0) +#@gui :Palette Color 68=color(#58712c) +#@gui :‎ ‎ ‎ ‎ Delete Color 68‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 68 Selected=_bool(0) +#@gui :Palette Color 69=color(#4c5f33) +#@gui :‎ ‎ ‎ ‎ Delete Color 69‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 69 Selected=_bool(0) +#@gui :Palette Color 70=color(#394d3c) +#@gui :‎ ‎ ‎ ‎ Delete Color 70‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 70 Selected=_bool(0) +#@gui :Palette Color 71=color(#2e3d47) +#@gui :‎ ‎ ‎ ‎ Delete Color 71‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 71 Selected=_bool(0) +#@gui :Palette Color 72=color(#1d2c43) +#@gui :‎ ‎ ‎ ‎ Delete Color 72‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 72 Selected=_bool(0) +#@gui :Palette Color 73=color(#fedfb1) +#@gui :‎ ‎ ‎ ‎ Delete Color 73‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 73 Selected=_bool(0) +#@gui :Palette Color 74=color(#cfaf8e) +#@gui :‎ ‎ ‎ ‎ Delete Color 74‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 74 Selected=_bool(0) +#@gui :Palette Color 75=color(#b39783) +#@gui :‎ ‎ ‎ ‎ Delete Color 75‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 75 Selected=_bool(0) +#@gui :Palette Color 76=color(#917a7b) +#@gui :‎ ‎ ‎ ‎ Delete Color 76‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 76 Selected=_bool(0) +#@gui :Palette Color 77=color(#75686e) +#@gui :‎ ‎ ‎ ‎ Delete Color 77‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 77 Selected=_bool(0) +#@gui :Palette Color 78=color(#56506f) +#@gui :‎ ‎ ‎ ‎ Delete Color 78‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 78 Selected=_bool(0) +#@gui :Palette Color 79=color(#3b3855) +#@gui :‎ ‎ ‎ ‎ Delete Color 79‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 79 Selected=_bool(0) +#@gui :Palette Color 80=color(#26233d) +#@gui :‎ ‎ ‎ ‎ Delete Color 80‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 80 Selected=_bool(0) +#@gui :Palette Color 81=color(#fff64f) +#@gui :‎ ‎ ‎ ‎ Delete Color 81‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 81 Selected=_bool(0) +#@gui :Palette Color 82=color(#e8d24b) +#@gui :‎ ‎ ‎ ‎ Delete Color 82‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 82 Selected=_bool(0) +#@gui :Palette Color 83=color(#d1aa39) +#@gui :‎ ‎ ‎ ‎ Delete Color 83‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 83 Selected=_bool(0) +#@gui :Palette Color 84=color(#ba882e) +#@gui :‎ ‎ ‎ ‎ Delete Color 84‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 84 Selected=_bool(0) +#@gui :Palette Color 85=color(#9e6520) +#@gui :‎ ‎ ‎ ‎ Delete Color 85‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 85 Selected=_bool(0) +#@gui :Palette Color 86=color(#854f12) +#@gui :‎ ‎ ‎ ‎ Delete Color 86‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 86 Selected=_bool(0) +#@gui :Palette Color 87=color(#753b09) +#@gui :‎ ‎ ‎ ‎ Delete Color 87‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 87 Selected=_bool(0) +#@gui :Palette Color 88=color(#622a00) +#@gui :‎ ‎ ‎ ‎ Delete Color 88‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 88 Selected=_bool(0) +#@gui :Palette Color 89=color(#d0cc32) +#@gui :‎ ‎ ‎ ‎ Delete Color 89‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 89 Selected=_bool(0) +#@gui :Palette Color 90=color(#b4aa33) +#@gui :‎ ‎ ‎ ‎ Delete Color 90‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 90 Selected=_bool(0) +#@gui :Palette Color 91=color(#969a26) +#@gui :‎ ‎ ‎ ‎ Delete Color 91‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 91 Selected=_bool(0) +#@gui :Palette Color 92=color(#7c831e) +#@gui :‎ ‎ ‎ ‎ Delete Color 92‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 92 Selected=_bool(0) +#@gui :Palette Color 93=color(#617308) +#@gui :‎ ‎ ‎ ‎ Delete Color 93‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 93 Selected=_bool(0) +#@gui :Palette Color 94=color(#495d00) +#@gui :‎ ‎ ‎ ‎ Delete Color 94‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 94 Selected=_bool(0) +#@gui :Palette Color 95=color(#2f4f08) +#@gui :‎ ‎ ‎ ‎ Delete Color 95‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 95 Selected=_bool(0) +#@gui :Palette Color 96=color(#202900) +#@gui :‎ ‎ ‎ ‎ Delete Color 96‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 96 Selected=_bool(0) +#@gui :Palette Color 97=color(#e59a7c) +#@gui :‎ ‎ ‎ ‎ Delete Color 97‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 97 Selected=_bool(0) +#@gui :Palette Color 98=color(#d28d7a) +#@gui :‎ ‎ ‎ ‎ Delete Color 98‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 98 Selected=_bool(0) +#@gui :Palette Color 99=color(#c17e7a) +#@gui :‎ ‎ ‎ ‎ Delete Color 99‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 99 Selected=_bool(0) +#@gui :Palette Color 100=color(#ac6f6e) +#@gui :‎ ‎ ‎ ‎ Delete Color 100‎ ‎ ‎ ‎‎=button(0) +#@gui :Color 100 Selected=_bool(0) +#@gui :Palette Color 101=color(#98595a) +#@gui :‎ ‎ ‎ ‎Delete Color 101‎ ‎ ‎ ‎=button(0) +#@gui :Color 101 Selected=_bool(0) +#@gui :Palette Color 102=color(#7c4b47) +#@gui :‎ ‎ ‎ ‎Delete Color 102‎ ‎ ‎ ‎=button(0) +#@gui :Color 102 Selected=_bool(0) +#@gui :Palette Color 103=color(#633432) +#@gui :‎ ‎ ‎ ‎Delete Color 103‎ ‎ ‎ ‎=button(0) +#@gui :Color 103 Selected=_bool(0) +#@gui :Palette Color 104=color(#49251c) +#@gui :‎ ‎ ‎ ‎Delete Color 104‎ ‎ ‎ ‎=button(0) +#@gui :Color 104 Selected=_bool(0) +#@gui :Palette Color 105=color(#ffcdff) +#@gui :‎ ‎ ‎ ‎Delete Color 105‎ ‎ ‎ ‎=button(0) +#@gui :Color 105 Selected=_bool(0) +#@gui :Palette Color 106=color(#ffa6c5) +#@gui :‎ ‎ ‎ ‎Delete Color 106‎ ‎ ‎ ‎=button(0) +#@gui :Color 106 Selected=_bool(0) +#@gui :Palette Color 107=color(#ff7daf) +#@gui :‎ ‎ ‎ ‎Delete Color 107‎ ‎ ‎ ‎=button(0) +#@gui :Color 107 Selected=_bool(0) +#@gui :Palette Color 108=color(#f85d80) +#@gui :‎ ‎ ‎ ‎Delete Color 108‎ ‎ ‎ ‎=button(0) +#@gui :Color 108 Selected=_bool(0) +#@gui :Palette Color 109=color(#d94a69) +#@gui :‎ ‎ ‎ ‎Delete Color 109‎ ‎ ‎ ‎=button(0) +#@gui :Color 109 Selected=_bool(0) +#@gui :Palette Color 110=color(#9f3b52) +#@gui :‎ ‎ ‎ ‎Delete Color 110‎ ‎ ‎ ‎=button(0) +#@gui :Color 110 Selected=_bool(0) +#@gui :Palette Color 111=color(#712b3b) +#@gui :‎ ‎ ‎ ‎Delete Color 111‎ ‎ ‎ ‎=button(0) +#@gui :Color 111 Selected=_bool(0) +#@gui :Palette Color 112=color(#431729) +#@gui :‎ ‎ ‎ ‎Delete Color 112‎ ‎ ‎ ‎=button(0) +#@gui :Color 112 Selected=_bool(0) +#@gui :Palette Color 113=color(#dcd4ff) +#@gui :‎ ‎ ‎ ‎Delete Color 113‎ ‎ ‎ ‎=button(0) +#@gui :Color 113 Selected=_bool(0) +#@gui :Palette Color 114=color(#b8aeff) +#@gui :‎ ‎ ‎ ‎Delete Color 114‎ ‎ ‎ ‎=button(0) +#@gui :Color 114 Selected=_bool(0) +#@gui :Palette Color 115=color(#9c9bef) +#@gui :‎ ‎ ‎ ‎Delete Color 115‎ ‎ ‎ ‎=button(0) +#@gui :Color 115 Selected=_bool(0) +#@gui :Palette Color 116=color(#8e8ce2) +#@gui :‎ ‎ ‎ ‎Delete Color 116‎ ‎ ‎ ‎=button(0) +#@gui :Color 116 Selected=_bool(0) +#@gui :Palette Color 117=color(#7877c1) +#@gui :‎ ‎ ‎ ‎Delete Color 117‎ ‎ ‎ ‎=button(0) +#@gui :Color 117 Selected=_bool(0) +#@gui :Palette Color 118=color(#64659d) +#@gui :‎ ‎ ‎ ‎Delete Color 118‎ ‎ ‎ ‎=button(0) +#@gui :Color 118 Selected=_bool(0) +#@gui :Palette Color 119=color(#4a5280) +#@gui :‎ ‎ ‎ ‎Delete Color 119‎ ‎ ‎ ‎=button(0) +#@gui :Color 119 Selected=_bool(0) +#@gui :Palette Color 120=color(#323558) +#@gui :‎ ‎ ‎ ‎Delete Color 120‎ ‎ ‎ ‎=button(0) +#@gui :Color 120 Selected=_bool(0) +#@gui :Palette Color 121=color(#edd493) +#@gui :‎ ‎ ‎ ‎Delete Color 121‎ ‎ ‎ ‎=button(0) +#@gui :Color 121 Selected=_bool(0) +#@gui :Palette Color 122=color(#edb67c) +#@gui :‎ ‎ ‎ ‎Delete Color 122‎ ‎ ‎ ‎=button(0) +#@gui :Color 122 Selected=_bool(0) +#@gui :Palette Color 123=color(#ce9770) +#@gui :‎ ‎ ‎ ‎Delete Color 123‎ ‎ ‎ ‎=button(0) +#@gui :Color 123 Selected=_bool(0) +#@gui :Palette Color 124=color(#bd7d64) +#@gui :‎ ‎ ‎ ‎Delete Color 124‎ ‎ ‎ ‎=button(0) +#@gui :Color 124 Selected=_bool(0) +#@gui :Palette Color 125=color(#a76057) +#@gui :‎ ‎ ‎ ‎Delete Color 125‎ ‎ ‎ ‎=button(0) +#@gui :Color 125 Selected=_bool(0) +#@gui :Palette Color 126=color(#904647) +#@gui :‎ ‎ ‎ ‎Delete Color 126‎ ‎ ‎ ‎=button(0) +#@gui :Color 126 Selected=_bool(0) +#@gui :Palette Color 127=color(#6e2434) +#@gui :‎ ‎ ‎ ‎Delete Color 127‎ ‎ ‎ ‎=button(0) +#@gui :Color 127 Selected=_bool(0) +#@gui :Palette Color 128=color(#5f0926) +#@gui :‎ ‎ ‎ ‎Delete Color 128‎ ‎ ‎ ‎=button(0) +#@gui :Color 128 Selected=_bool(0) +#@gui :Palette Color 129=color(#fbeaa3) +#@gui :‎ ‎ ‎ ‎Delete Color 129‎ ‎ ‎ ‎=button(0) +#@gui :Color 129 Selected=_bool(0) +#@gui :Palette Color 130=color(#e8cb82) +#@gui :‎ ‎ ‎ ‎Delete Color 130‎ ‎ ‎ ‎=button(0) +#@gui :Color 130 Selected=_bool(0) +#@gui :Palette Color 131=color(#cca96e) +#@gui :‎ ‎ ‎ ‎Delete Color 131‎ ‎ ‎ ‎=button(0) +#@gui :Color 131 Selected=_bool(0) +#@gui :Palette Color 132=color(#b29062) +#@gui :‎ ‎ ‎ ‎Delete Color 132‎ ‎ ‎ ‎=button(0) +#@gui :Color 132 Selected=_bool(0) +#@gui :Palette Color 133=color(#997951) +#@gui :‎ ‎ ‎ ‎Delete Color 133‎ ‎ ‎ ‎=button(0) +#@gui :Color 133 Selected=_bool(0) +#@gui :Palette Color 134=color(#7e6144) +#@gui :‎ ‎ ‎ ‎Delete Color 134‎ ‎ ‎ ‎=button(0) +#@gui :Color 134 Selected=_bool(0) +#@gui :Palette Color 135=color(#614a3c) +#@gui :‎ ‎ ‎ ‎Delete Color 135‎ ‎ ‎ ‎=button(0) +#@gui :Color 135 Selected=_bool(0) +#@gui :Palette Color 136=color(#453125) +#@gui :‎ ‎ ‎ ‎Delete Color 136‎ ‎ ‎ ‎=button(0) +#@gui :Color 136 Selected=_bool(0) +#@gui :Palette Color 137=color(#00deda) +#@gui :‎ ‎ ‎ ‎Delete Color 137‎ ‎ ‎ ‎=button(0) +#@gui :Color 137 Selected=_bool(0) +#@gui :Palette Color 138=color(#00bfa3) +#@gui :‎ ‎ ‎ ‎Delete Color 138‎ ‎ ‎ ‎=button(0) +#@gui :Color 138 Selected=_bool(0) +#@gui :Palette Color 139=color(#00a087) +#@gui :‎ ‎ ‎ ‎Delete Color 139‎ ‎ ‎ ‎=button(0) +#@gui :Color 139 Selected=_bool(0) +#@gui :Palette Color 140=color(#008279) +#@gui :‎ ‎ ‎ ‎Delete Color 140‎ ‎ ‎ ‎=button(0) +#@gui :Color 140 Selected=_bool(0) +#@gui :Palette Color 141=color(#006b6d) +#@gui :‎ ‎ ‎ ‎Delete Color 141‎ ‎ ‎ ‎=button(0) +#@gui :Color 141 Selected=_bool(0) +#@gui :Palette Color 142=color(#005162) +#@gui :‎ ‎ ‎ ‎Delete Color 142‎ ‎ ‎ ‎=button(0) +#@gui :Color 142 Selected=_bool(0) +#@gui :Palette Color 143=color(#004051) +#@gui :‎ ‎ ‎ ‎Delete Color 143‎ ‎ ‎ ‎=button(0) +#@gui :Color 143 Selected=_bool(0) +#@gui :Palette Color 144=color(#002e49) +#@gui :‎ ‎ ‎ ‎Delete Color 144‎ ‎ ‎ ‎=button(0) +#@gui :Color 144 Selected=_bool(0) +#@gui :Palette Color 145=color(#f8c6da) +#@gui :‎ ‎ ‎ ‎Delete Color 145‎ ‎ ‎ ‎=button(0) +#@gui :Color 145 Selected=_bool(0) +#@gui :Palette Color 146=color(#db99bf) +#@gui :‎ ‎ ‎ ‎Delete Color 146‎ ‎ ‎ ‎=button(0) +#@gui :Color 146 Selected=_bool(0) +#@gui :Palette Color 147=color(#c178aa) +#@gui :‎ ‎ ‎ ‎Delete Color 147‎ ‎ ‎ ‎=button(0) +#@gui :Color 147Selected=_bool(0) +#@gui :Palette Color 148=color(#b96d91) +#@gui :‎ ‎ ‎ ‎Delete Color 148‎ ‎ ‎ ‎=button(0) +#@gui :Color 148 Selected=_bool(0) +#@gui :Palette Color 149=color(#975475) +#@gui :‎ ‎ ‎ ‎Delete Color 149‎ ‎ ‎ ‎=button(0) +#@gui :Color 149 Selected=_bool(0) +#@gui :Palette Color 150=color(#663659) +#@gui :‎ ‎ ‎ ‎Delete Color 150‎ ‎ ‎ ‎=button(0) +#@gui :Color 150 Selected=_bool(0) +#@gui :Palette Color 151=color(#49283d) +#@gui :‎ ‎ ‎ ‎Delete Color 151‎ ‎ ‎ ‎=button(0) +#@gui :Color 151 Selected=_bool(0) +#@gui :Palette Color 152=color(#2e1026) +#@gui :‎ ‎ ‎ ‎Delete Color 152‎ ‎ ‎ ‎=button(0) +#@gui :Color 152 Selected=_bool(0) +#@gui :Palette Color 153=color(#ddbf9a) +#@gui :‎ ‎ ‎ ‎Delete Color 153‎ ‎ ‎ ‎=button(0) +#@gui :Color 153 Selected=_bool(0) +#@gui :Palette Color 154=color(#c0a588) +#@gui :‎ ‎ ‎ ‎Delete Color 154‎ ‎ ‎ ‎=button(0) +#@gui :Color 154 Selected=_bool(0) +#@gui :Palette Color 155=color(#9e8a6e) +#@gui :‎ ‎ ‎ ‎Delete Color 155‎ ‎ ‎ ‎=button(0) +#@gui :Color 155 Selected=_bool(0) +#@gui :Palette Color 156=color(#7e6c54) +#@gui :‎ ‎ ‎ ‎Delete Color 156‎ ‎ ‎ ‎=button(0) +#@gui :Color 156 Selected=_bool(0) +#@gui :Palette Color 157=color(#725a51) +#@gui :‎ ‎ ‎ ‎Delete Color 157‎ ‎ ‎ ‎=button(0) +#@gui :Color 157 Selected=_bool(0) +#@gui :Palette Color 158=color(#5e4646) +#@gui :‎ ‎ ‎ ‎Delete Color 158‎ ‎ ‎ ‎=button(0) +#@gui :Color 158 Selected=_bool(0) +#@gui :Palette Color 159=color(#4a353c) +#@gui :‎ ‎ ‎ ‎Delete Color 159‎ ‎ ‎ ‎=button(0) +#@gui :Color 159 Selected=_bool(0) +#@gui :Palette Color 160=color(#31222a) +#@gui :‎ ‎ ‎ ‎Delete Color 160‎ ‎ ‎ ‎=button(0) +#@gui :Color 160 Selected=_bool(0) +#@gui :Palette Color 161=color(#fffaab) +#@gui :‎ ‎ ‎ ‎Delete Color 161‎ ‎ ‎ ‎=button(0) +#@gui :Color 161 Selected=_bool(0) +#@gui :Palette Color 162=color(#ecc581) +#@gui :‎ ‎ ‎ ‎Delete Color 162‎ ‎ ‎ ‎=button(0) +#@gui :Color 162 Selected=_bool(0) +#@gui :Palette Color 163=color(#d89f75) +#@gui :‎ ‎ ‎ ‎Delete Color 163‎ ‎ ‎ ‎=button(0) +#@gui :Color 163 Selected=_bool(0) +#@gui :Palette Color 164=color(#c7826c) +#@gui :‎ ‎ ‎ ‎Delete Color 164‎ ‎ ‎ ‎=button(0) +#@gui :Color 164 Selected=_bool(0) +#@gui :Palette Color 165=color(#ae6b60) +#@gui :‎ ‎ ‎ ‎Delete Color 165‎ ‎ ‎ ‎=button(0) +#@gui :Color 165 Selected=_bool(0) +#@gui :Palette Color 166=color(#8a5258) +#@gui :‎ ‎ ‎ ‎Delete Color 166‎ ‎ ‎ ‎=button(0) +#@gui :Color 166 Selected=_bool(0) +#@gui :Palette Color 167=color(#5a3c45) +#@gui :‎ ‎ ‎ ‎Delete Color 167‎ ‎ ‎ ‎=button(0) +#@gui :Color 167 Selected=_bool(0) +#@gui :Palette Color 168=color(#3b303c) +#@gui :‎ ‎ ‎ ‎Delete Color 168‎ ‎ ‎ ‎=button(0) +#@gui :Color 168 Selected=_bool(0) +#@gui :Palette Color 169=color(#ebf0f6) +#@gui :‎ ‎ ‎ ‎Delete Color 169‎ ‎ ‎ ‎=button(0) +#@gui :Color 169 Selected=_bool(0) +#@gui :Palette Color 170=color(#bac7db) +#@gui :‎ ‎ ‎ ‎Delete Color 170‎ ‎ ‎ ‎=button(0) +#@gui :Color 170 Selected=_bool(0) +#@gui :Palette Color 171=color(#abaebe) +#@gui :‎ ‎ ‎ ‎Delete Color 171‎ ‎ ‎ ‎=button(0) +#@gui :Color 171 Selected=_bool(0) +#@gui :Palette Color 172=color(#848795) +#@gui :‎ ‎ ‎ ‎Delete Color 172‎ ‎ ‎ ‎=button(0) +#@gui :Color 172 Selected=_bool(0) +#@gui :Palette Color 173=color(#73737f) +#@gui :‎ ‎ ‎ ‎Delete Color 173‎ ‎ ‎ ‎=button(0) +#@gui :Color 173 Selected=_bool(0) +#@gui :Palette Color 174=color(#5b5c69) +#@gui :‎ ‎ ‎ ‎Delete Color 174‎ ‎ ‎ ‎=button(0) +#@gui :Color 174 Selected=_bool(0) +#@gui :Palette Color 175=color(#48474d) +#@gui :‎ ‎ ‎ ‎Delete Color 175‎ ‎ ‎ ‎=button(0) +#@gui :Color 175 Selected=_bool(0) +#@gui :Palette Color 176=color(#2d3136) +#@gui :‎ ‎ ‎ ‎Delete Color 176‎ ‎ ‎ ‎=button(0) +#@gui :Color 176 Selected=_bool(0) +#@gui :Palette Color 177=color(#ffdbff) +#@gui :‎ ‎ ‎ ‎Delete Color 177‎ ‎ ‎ ‎=button(0) +#@gui :Color 177 Selected=_bool(0) +#@gui :Palette Color 178=color(#ffbbc7) +#@gui :‎ ‎ ‎ ‎Delete Color 178‎ ‎ ‎ ‎=button(0) +#@gui :Color 178 Selected=_bool(0) +#@gui :Palette Color 179=color(#ff9ba8) +#@gui :‎ ‎ ‎ ‎Delete Color 179‎ ‎ ‎ ‎=button(0) +#@gui :Color 179 Selected=_bool(0) +#@gui :Palette Color 180=color(#ff7676) +#@gui :‎ ‎ ‎ ‎Delete Color 180‎ ‎ ‎ ‎=button(0) +#@gui :Color 180 Selected=_bool(0) +#@gui :Palette Color 181=color(#e45c5f) +#@gui :‎ ‎ ‎ ‎Delete Color 181‎ ‎ ‎ ‎=button(0) +#@gui :Color 181 Selected=_bool(0) +#@gui :Palette Color 182=color(#b63c35) +#@gui :‎ ‎ ‎ ‎Delete Color 182‎ ‎ ‎ ‎=button(0) +#@gui :Color 182 Selected=_bool(0) +#@gui :Palette Color 183=color(#82211d) +#@gui :‎ ‎ ‎ ‎Delete Color 183‎ ‎ ‎ ‎=button(0) +#@gui :Color 183 Selected=_bool(0) +#@gui :Palette Color 184=color(#5e0711) +#@gui :‎ ‎ ‎ ‎Delete Color 184‎ ‎ ‎ ‎=button(0) +#@gui :Color 184 Selected=_bool(0) +#@gui :Palette Color 185=color(#91daa1) +#@gui :‎ ‎ ‎ ‎Delete Color 185‎ ‎ ‎ ‎=button(0) +#@gui :Color 185 Selected=_bool(0) +#@gui :Palette Color 186=color(#55b67d) +#@gui :‎ ‎ ‎ ‎Delete Color 186‎ ‎ ‎ ‎=button(0) +#@gui :Color 186 Selected=_bool(0) +#@gui :Palette Color 187=color(#498960) +#@gui :‎ ‎ ‎ ‎Delete Color 187‎ ‎ ‎ ‎=button(0) +#@gui :Color 187 Selected=_bool(0) +#@gui :Palette Color 188=color(#417455) +#@gui :‎ ‎ ‎ ‎Delete Color 188‎ ‎ ‎ ‎=button(0) +#@gui :Color 188 Selected=_bool(0) +#@gui :Palette Color 189=color(#325c40) +#@gui :‎ ‎ ‎ ‎Delete Color 189‎ ‎ ‎ ‎=button(0) +#@gui :Color 189 Selected=_bool(0) +#@gui :Palette Color 190=color(#385140) +#@gui :‎ ‎ ‎ ‎Delete Color 190‎ ‎ ‎ ‎=button(0) +#@gui :Color 190 Selected=_bool(0) +#@gui :Palette Color 191=color(#2f3f38) +#@gui :‎ ‎ ‎ ‎Delete Color 191‎ ‎ ‎ ‎=button(0) +#@gui :Color 191 Selected=_bool(0) +#@gui :Palette Color 192=color(#1a332c) +#@gui :‎ ‎ ‎ ‎Delete Color 192‎ ‎ ‎ ‎=button(0) +#@gui :Color 192 Selected=_bool(0) +#@gui :Palette Color 193=color(#74f5fd) +#@gui :‎ ‎ ‎ ‎Delete Color 193‎ ‎ ‎ ‎=button(0) +#@gui :Color 193 Selected=_bool(0) +#@gui :Palette Color 194=color(#52d2ff) +#@gui :‎ ‎ ‎ ‎Delete Color 194‎ ‎ ‎ ‎=button(0) +#@gui :Color 194 Selected=_bool(0) +#@gui :Palette Color 195=color(#41b2e3) +#@gui :‎ ‎ ‎ ‎Delete Color 195‎ ‎ ‎ ‎=button(0) +#@gui :Color 195 Selected=_bool(0) +#@gui :Palette Color 196=color(#318eb8) +#@gui :‎ ‎ ‎ ‎Delete Color 196‎ ‎ ‎ ‎=button(0) +#@gui :Color 196 Selected=_bool(0) +#@gui :Palette Color 197=color(#366b8a) +#@gui :‎ ‎ ‎ ‎Delete Color 197‎ ‎ ‎ ‎=button(0) +#@gui :Color 197 Selected=_bool(0) +#@gui :Palette Color 198=color(#25466b) +#@gui :‎ ‎ ‎ ‎Delete Color 198‎ ‎ ‎ ‎=button(0) +#@gui :Color 198 Selected=_bool(0) +#@gui :Palette Color 199=color(#23324d) +#@gui :‎ ‎ ‎ ‎Delete Color 199‎ ‎ ‎ ‎=button(0) +#@gui :Color 199 Selected=_bool(0) +#@gui :Palette Color 200=color(#181f2f) +#@gui :‎ ‎ ‎ ‎Delete Color 200‎ ‎ ‎ ‎=button(0) +#@gui :Color 200 Selected=_bool(0) +#@gui :Palette Color 201=color(#a6cc34) +#@gui :‎ ‎ ‎ ‎Delete Color 201‎ ‎ ‎ ‎=button(0) +#@gui :Color 201 Selected=_bool(0) +#@gui :Palette Color 202=color(#7da42d) +#@gui :‎ ‎ ‎ ‎Delete Color 202‎ ‎ ‎ ‎=button(0) +#@gui :Color 202 Selected=_bool(0) +#@gui :Palette Color 203=color(#518822) +#@gui :‎ ‎ ‎ ‎Delete Color 203‎ ‎ ‎ ‎=button(0) +#@gui :Color 203 Selected=_bool(0) +#@gui :Palette Color 204=color(#2f690c) +#@gui :‎ ‎ ‎ ‎Delete Color 204‎ ‎ ‎ ‎=button(0) +#@gui :Color 204 Selected=_bool(0) +#@gui :Palette Color 205=color(#225918) +#@gui :‎ ‎ ‎ ‎Delete Color 205‎ ‎ ‎ ‎=button(0) +#@gui :Color 205 Selected=_bool(0) +#@gui :Palette Color 206=color(#174a1b) +#@gui :‎ ‎ ‎ ‎Delete Color 206‎ ‎ ‎ ‎=button(0) +#@gui :Color 206 Selected=_bool(0) +#@gui :Palette Color 207=color(#003221) +#@gui :‎ ‎ ‎ ‎Delete Color 207‎ ‎ ‎ ‎=button(0) +#@gui :Color 207 Selected=_bool(0) +#@gui :Palette Color 208=color(#002219) +#@gui :‎ ‎ ‎ ‎Delete Color 208‎ ‎ ‎ ‎=button(0) +#@gui :Color 208 Selected=_bool(0) +#@gui :Palette Color 209=color(#c6ecff) +#@gui :‎ ‎ ‎ ‎Delete Color 209‎ ‎ ‎ ‎=button(0) +#@gui :Color 209 Selected=_bool(0) +#@gui :Palette Color 210=color(#c7d6ff) +#@gui :‎ ‎ ‎ ‎Delete Color 210‎ ‎ ‎ ‎=button(0) +#@gui :Color 210 Selected=_bool(0) +#@gui :Palette Color 211=color(#96b2d9) +#@gui :‎ ‎ ‎ ‎Delete Color 211‎ ‎ ‎ ‎=button(0) +#@gui :Color 211 Selected=_bool(0) +#@gui :Palette Color 212=color(#8690b2) +#@gui :‎ ‎ ‎ ‎Delete Color 212‎ ‎ ‎ ‎=button(0) +#@gui :Color 212 Selected=_bool(0) +#@gui :Palette Color 213=color(#7a7799) +#@gui :‎ ‎ ‎ ‎Delete Color 213‎ ‎ ‎ ‎=button(0) +#@gui :Color 213 Selected=_bool(0) +#@gui :Palette Color 214=color(#615f84) +#@gui :‎ ‎ ‎ ‎Delete Color 214‎ ‎ ‎ ‎=button(0) +#@gui :Color 214 Selected=_bool(0) +#@gui :Palette Color 215=color(#3a4568) +#@gui :‎ ‎ ‎ ‎Delete Color 215‎ ‎ ‎ ‎=button(0) +#@gui :Color 215 Selected=_bool(0) +#@gui :Palette Color 216=color(#282b4a) +#@gui :‎ ‎ ‎ ‎Delete Color 216‎ ‎ ‎ ‎=button(0) +#@gui :Color 216 Selected=_bool(0) +#@gui :Palette Color 217=color(#ffe949) +#@gui :‎ ‎ ‎ ‎Delete Color 217‎ ‎ ‎ ‎=button(0) +#@gui :Color 217 Selected=_bool(0) +#@gui :Palette Color 218=color(#ffbc4e) +#@gui :‎ ‎ ‎ ‎Delete Color 218‎ ‎ ‎ ‎=button(0) +#@gui :Color 218 Selected=_bool(0) +#@gui :Palette Color 219=color(#f99b4e) +#@gui :‎ ‎ ‎ ‎Delete Color 219‎ ‎ ‎ ‎=button(0) +#@gui :Color 219 Selected=_bool(0) +#@gui :Palette Color 220=color(#e37840) +#@gui :‎ ‎ ‎ ‎Delete Color 220‎ ‎ ‎ ‎=button(0) +#@gui :Color 220 Selected=_bool(0) +#@gui :Palette Color 221=color(#cd5e46) +#@gui :‎ ‎ ‎ ‎Delete Color 221‎ ‎ ‎ ‎=button(0) +#@gui :Color 221 Selected=_bool(0) +#@gui :Palette Color 222=color(#b64d46) +#@gui :‎ ‎ ‎ ‎Delete Color 222‎ ‎ ‎ ‎=button(0) +#@gui :Color 222 Selected=_bool(0) +#@gui :Palette Color 223=color(#94363a) +#@gui :‎ ‎ ‎ ‎Delete Color 223‎ ‎ ‎ ‎=button(0) +#@gui :Color 223 Selected=_bool(0) +#@gui :Palette Color 224=color(#662b29) +#@gui :‎ ‎ ‎ ‎Delete Color 224‎ ‎ ‎ ‎=button(0) +#@gui :Color 224 Selected=_bool(0) +#@gui :Palette Color 225=color(#88d6ff) +#@gui :‎ ‎ ‎ ‎Delete Color 225‎ ‎ ‎ ‎=button(0) +#@gui :Color 225 Selected=_bool(0) +#@gui :Palette Color 226=color(#24aed6) +#@gui :‎ ‎ ‎ ‎Delete Color 226‎ ‎ ‎ ‎=button(0) +#@gui :Color 226 Selected=_bool(0) +#@gui :Palette Color 227=color(#328ca7) +#@gui :‎ ‎ ‎ ‎Delete Color 227‎ ‎ ‎ ‎=button(0) +#@gui :Color 227 Selected=_bool(0) +#@gui :Palette Color 228=color(#006f89) +#@gui :‎ ‎ ‎ ‎Delete Color 228‎ ‎ ‎ ‎=button(0) +#@gui :Color 228 Selected=_bool(0) +#@gui :Palette Color 229=color(#0b667f) +#@gui :‎ ‎ ‎ ‎Delete Color 229‎ ‎ ‎ ‎=button(0) +#@gui :Color 229 Selected=_bool(0) +#@gui :Palette Color 230=color(#004d5e) +#@gui :‎ ‎ ‎ ‎Delete Color 230‎ ‎ ‎ ‎=button(0) +#@gui :Color 230 Selected=_bool(0) +#@gui :Palette Color 231=color(#003850) +#@gui :‎ ‎ ‎ ‎Delete Color 231‎ ‎ ‎ ‎=button(0) +#@gui :Color 231 Selected=_bool(0) +#@gui :Palette Color 232=color(#002735) +#@gui :‎ ‎ ‎ ‎Delete Color 232‎ ‎ ‎ ‎=button(0) +#@gui :Color 232 Selected=_bool(0) +#@gui :Palette Color 233=color(#ffce7f) +#@gui :‎ ‎ ‎ ‎Delete Color 233‎ ‎ ‎ ‎=button(0) +#@gui :Color 233 Selected=_bool(0) +#@gui :Palette Color 234=color(#fbaa84) +#@gui :‎ ‎ ‎ ‎Delete Color 234‎ ‎ ‎ ‎=button(0) +#@gui :Color 234 Selected=_bool(0) +#@gui :Palette Color 235=color(#d58d6b) +#@gui :‎ ‎ ‎ ‎Delete Color 235‎ ‎ ‎ ‎=button(0) +#@gui :Color 235 Selected=_bool(0) +#@gui :Palette Color 236=color(#ad6e51) +#@gui :‎ ‎ ‎ ‎Delete Color 236‎ ‎ ‎ ‎=button(0) +#@gui :Color 236 Selected=_bool(0) +#@gui :Palette Color 237=color(#9a624c) +#@gui :‎ ‎ ‎ ‎Delete Color 237‎ ‎ ‎ ‎=button(0) +#@gui :Color 237 Selected=_bool(0) +#@gui :Palette Color 238=color(#885041) +#@gui :‎ ‎ ‎ ‎Delete Color 238‎ ‎ ‎ ‎=button(0) +#@gui :Color 238 Selected=_bool(0) +#@gui :Palette Color 239=color(#733d3b) +#@gui :‎ ‎ ‎ ‎Delete Color 239‎ ‎ ‎ ‎=button(0) +#@gui :Color 239 Selected=_bool(0) +#@gui :Palette Color 240=color(#583126) +#@gui :‎ ‎ ‎ ‎Delete Color 240‎ ‎ ‎ ‎=button(0) +#@gui :Color 240 Selected=_bool(0) +#@gui :Palette Color 241=color(#fff3d6) +#@gui :‎ ‎ ‎ ‎Delete Color 241‎ ‎ ‎ ‎=button(0) +#@gui :Color 241 Selected=_bool(0) +#@gui :Palette Color 242=color(#eadbc9) +#@gui :‎ ‎ ‎ ‎Delete Color 242‎ ‎ ‎ ‎=button(0) +#@gui :Color 242 Selected=_bool(0) +#@gui :Palette Color 243=color(#ccc3b1) +#@gui :‎ ‎ ‎ ‎Delete Color 243‎ ‎ ‎ ‎=button(0) +#@gui :Color 243 Selected=_bool(0) +#@gui :Palette Color 244=color(#bbafa4) +#@gui :‎ ‎ ‎ ‎Delete Color 244‎ ‎ ‎ ‎=button(0) +#@gui :Color 244 Selected=_bool(0) +#@gui :Palette Color 245=color(#aea189) +#@gui :‎ ‎ ‎ ‎Delete Color 245‎ ‎ ‎ ‎=button(0) +#@gui :Color 245 Selected=_bool(0) +#@gui :Palette Color 246=color(#9e8c79) +#@gui :‎ ‎ ‎ ‎Delete Color 246‎ ‎ ‎ ‎=button(0) +#@gui :Color 246 Selected=_bool(0) +#@gui :Palette Color 247=color(#857565) +#@gui :‎ ‎ ‎ ‎Delete Color 247‎ ‎ ‎ ‎=button(0) +#@gui :Color 247 Selected=_bool(0) +#@gui :Palette Color 248=color(#625d54) +#@gui :‎ ‎ ‎ ‎Delete Color 248‎ ‎ ‎ ‎=button(0) +#@gui :Color 248 Selected=_bool(0) +#@gui :Palette Color 249=color(#f5f7fa) +#@gui :‎ ‎ ‎ ‎Delete Color 249‎ ‎ ‎ ‎=button(0) +#@gui :Color 249 Selected=_bool(0) +#@gui :Palette Color 250=color(#cdd2da) +#@gui :‎ ‎ ‎ ‎Delete Color 250‎ ‎ ‎ ‎=button(0) +#@gui :Color 250 Selected=_bool(0) +#@gui :Palette Color 251=color(#a6aeba) +#@gui :‎ ‎ ‎ ‎Delete Color 251‎ ‎ ‎ ‎=button(0) +#@gui :Color 251 Selected=_bool(0) +#@gui :Palette Color 252=color(#828b98) +#@gui :‎ ‎ ‎ ‎Delete Color 252‎ ‎ ‎ ‎=button(0) +#@gui :Color 252 Selected=_bool(0) +#@gui :Palette Color 253=color(#626871) +#@gui :‎ ‎ ‎ ‎Delete Color 253‎ ‎ ‎ ‎=button(0) +#@gui :Color 253 Selected=_bool(0) +#@gui :Palette Color 254=color(#434549) +#@gui :‎ ‎ ‎ ‎Delete Color 254‎ ‎ ‎ ‎=button(0) +#@gui :Color 254 Selected=_bool(0) +#@gui :Palette Color 255=color(#222323) +#@gui :‎ ‎ ‎ ‎Delete Color 255‎ ‎ ‎ ‎=button(0) +#@gui :Color 255 Selected=_bool(0) +#@gui :Palette Color 256=color(#000000) +#@gui :‎ ‎ ‎ ‎Delete Color 256‎ ‎ ‎ ‎=button(0) +#@gui :Color 256 Selected=_bool(0) +#@gui :_=separator() +#@gui :‎ ‎ ‎ Add Palette Color‎ ‎ ‎ ‎‎=button(0) +#@gui :Delete All Selected Palette=button(0) +#@gui :_=separator() +#@gui :_=note("RGB Output") +#@gui :Pixel Width=int(1,1,8) +#@gui :Pixel Height=int(1,1,8) +#@gui :Windows Width=int(1,1,128) +#@gui :Use Image Width as Windows Width=bool(0) +#@gui :Windows Height=int(1,1,128) +#@gui :Use Image Height as Windows Height=bool(0) +#@gui :Threshold Map Iteration=int(3,1,6) +#@gui :_=separator() +#@gui :_=note("Alpha Output") +#@gui :Enable Alpha Processing=bool(0) +#@gui :Number of Alpha=int(2,2,256) +#@gui :Alpha Dithering (%)=float(50,0,100) +#@gui :Alpha Mode=choice(0,"Indexed","Windows-Based Indexing","Ordered") +#@gui :Alpha Mode=choice(0,"Indexed","Ordered") +#@gui :Alpha Restriction=int(0,0,128) +#@gui :Alpha Threshold Map Iteration=int(3,1,6) +#@gui :_=note("If this section is empty, it is because there is no alpha on any images.") +#@gui :_=separator() +#@gui :_=note("CLI Command") +#@gui :CLI Version=_text("Here is where you copy command to command line interface.") +#@gui :Import Palette File=file()_0 +#@gui :Imported=bool(0)_0 +#@gui :_=note("Note: Here is where you copy command to command line interface. ") +#@gui :_=separator() +#@gui :_=note("Post-Processing") +#@gui :Crop to Original Dimension=bool(1) +#@gui :Message Out=text("Initialized GUI Filter!") +#@gui :Status=int(0,0,3)_0 +#@gui :Color Status=color(#ffffff) +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2022/07/26.") +#@gui Trigonometry Mapping:fx_rep_tg3,fx_rep_tg3_preview(0) +#@gui :_=note("Processing) +#@gui :Colour Space=choice(0,"RGB-8","RYB-8","CMY-8","HSI-8","HSL-8","HSV-8","LAB-8","LCH-8","YIQ-8","YUV-8","XYZ-8","YES-8","OHTA-8","Kodak 1-8") +#@gui :Mode=choice(0,"Direct Trig-3","Luminosity to Trig-3") +#@gui :Preserve Luminosity=bool(1) +#@gui :_=separator() +#@gui :_=note("Mapping) +#@gui :Channel Order=choice(0,"First-Second-Third","First-Third-Second","Second-First-Third","Second-Third-First","Third-First-Second","Third-Second-Third") +#@gui :Channel=choice(0,"First","Second","Third") +#@gui :Channel=choice(0,"First","Third","Second") +#@gui :Channel=choice(0,"Second","First","Third") +#@gui :Channel=choice(0,"Second","Third","First") +#@gui :Channel=choice(0,"Third","First","Second") +#@gui :Channel=choice(0,"Third","Second","First") +#@gui :Formula=choice(0,"Sinusoidal","Cosinusodial","Cubic Sinusoidal","Cubic Cosinusodial","Cubic Sinusoidal-Cosinusodial") +#@gui :Multiplier=float(1,.1,5) +#@gui :Value Shift=float(0,-1,1) +#@gui :Midgray Exponential Factor=float(1,.01,2) +#@gui :Lightness Merge Factor=float(1,0,1) +#@gui :Lightness Exponential Factor=float(1,.01,5) +#@gui :End Value to Base Factor=float(1,0,1) +#@gui :Formula=choice(0,"Sinusoidal","Cosinusodial","Cubic Sinusoidal","Cubic Cosinusodial","Cubic Sinusoidal-Cosinusodial") +#@gui :Multiplier=float(1,.1,5) +#@gui :Value Shift=float(0,-1,1) +#@gui :Midgray Exponential Factor=float(1,.01,2) +#@gui :Lightness Merge Factor=float(1,0,1) +#@gui :Lightness Exponential Factor=float(1,.01,5) +#@gui :End Value to Base Factor=float(1,0,1) +#@gui :Formula=choice(0,"Sinusoidal","Cosinusodial","Cubic Sinusoidal","Cubic Cosinusodial","Cubic Sinusoidal-Cosinusodial") +#@gui :Multiplier=float(1,.1,5) +#@gui :Value Shift=float(0,-1,1) +#@gui :Midgray Exponential Factor=float(1,.01,2) +#@gui :Lightness Merge Factor=float(1,0,1) +#@gui :Lightness Exponential Factor=float(1,.01,5) +#@gui :End Value to Base Factor=float(1,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2020/8/9.") +#@gui Tupper's Self-Referential Formula:fx_rep_self_referential_formula,fx_rep_self_referential_formula_preview(1)* +#@gui :_=note("This filter is to be seen as a showcase filter.\n\nNote - To get the most feature of this filter, you must use a single image of size 106x17.\n\nWarning! - Do not use on images that are not much larger than 106x17. Due to the lack of BIGINT support inside G'MIC, the implementation is quite slow.") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Mode=choice(1,"Generate Image from K","Find K from Images") +#@gui :Mode=choice(1,"Generate Image from K","Find K from Images")_0 +#@gui :K Input=choice(0,"User","Tupper's Self-Referential Formula","Euler's Identity","Pacman","Sick App Bro! - Daves") +#@gui :K Input=choice(0,"User","Tupper's Self-Referential Formula","Euler's Identity","Pacman","Sick App Bro! - Daves")_0 +#@gui :K Value=text(1,"0") +#@gui :K Value=text("0")_0 +#@gui :Predefined K Value=text(1,"0") +#@gui :Predefined K Value=text("0")_0 +#@gui :Copy from Stored K Value=button() +#@gui :Negate After Using K-Input Result?=bool(1) +#@gui :Negate After Using K-Input Result?=bool(1)_0 +#@gui :K Values from Image(s)=text(1,"1") +#@gui :Stored K Value(s) from Images=text(1,"1")_0 +#@gui :Pre-Negation?=bool(1) +#@gui :Pre-Negation?=bool(1)_0 +#@gui :Allow Examples=bool(1)_0 +#@gui :Allow Mode Switch?=bool(1)_0 +#@gui :Started=bool(0)_0 +#@gui :_=separator() +#@gui :_=note("Details") +#@gui :_=note("Tupper's Self Referential Formula refers to a formula which refers to itself when a specific value is assigned. This was founded by Jeff Tupper.\n\nK Values for pre-defined K Inputs are based from Tupper's Self-Referential Formula Playground and Tupper Paper by Margaret Fortman.") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2023/01/19.") +#@gui Vibrance [YCH]:fx_rep_vibrance_ych,fx_rep_vibrance_ych_preview +#@gui :Vibrance=float(30,-100,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2022/07/05.") +#@gui Vibrato:fx_vibrato,_fx_vibrato_preview(0) +#@gui :_=note("This is the advanced version of the Vibrato filter. If you do want to manipulate multiple channels at once, use Vibrato - Basic filter. Note: Disable channel mulplication for non-transparent images. \n\n") +#@gui :_=note("This filter is the one of the G'MIC version of MadJik's Paint.NET plugin") +#@gui :_=separator() +#@gui :Colour Space=choice("RGB","CMY","HSI","HSL","HSV","LAB","LCH","YCbCr","YCbCr-Glic","YUV","YIQ","XYZ","Bayer") +#@gui :_=separator() +#@gui :Manipulate Multiple Channels at Once?=bool(1) +#@gui :Process Channel 1?=bool(1) +#@gui :Process Channel 2?=bool(1) +#@gui :Process Channel 3?=bool(1) +#@gui :Process Alpha Channel?=bool(1) +#@gui :Inherit Alpha?=bool(1) +#@gui :X-Orientation=bool(1) +#@gui :Y-Orientation=bool(1) +#@gui :U- Factor=float(.85,.1,15) +#@gui :V- Factor=float(.85,.1,15) +#@gui :X-Scale Factor=float(1,.1,15) +#@gui :Y-Scale Factor=float(1,.1,15) +#@gui :XY-Scale Factor=float(1,.1,3) +#@gui :Percentage-Based X Pixel Shift=float(0,-200,200) +#@gui :Percentage-Based Y Pixel Shift=float(0,-200,200) +#@gui :Elevation=float(.7,-100,100) +#@gui :Multiply Blending=bool(0) +#@gui :Invert Vibrato=bool(0) +#@gui :Vibrato Blending Factor=float(100,0,100) +#@gui :Channel Influence Factor=float(1,-8,8) +#@gui :Final Channel Modulos Multiplication Factor=float(1,1,32) +#@gui :_=separator() +#@gui :_=note("- Channel #1 - ") +#@gui :Process Channel?=bool(1) +#@gui :X-Orientation=bool(1) +#@gui :Y-Orientation=bool(1) +#@gui :U-Factor=float(.85,.1,15) +#@gui :V-Factor=float(.85,.1,15) +#@gui :X-Scale Factor=float(1,.1,15) +#@gui :Y-Scale Factor=float(1,.1,15) +#@gui :XY-Scale Factor=float(1,.1,3) +#@gui :Percentage-Based X Pixel Shift=float(0,-200,200) +#@gui :Percentage-Based Y Pixel Shift=float(0,-200,200) +#@gui :Elevation=float(.7,-100,100) +#@gui :Multiply Blending=bool(0) +#@gui :Invert Vibrato=bool(0) +#@gui :Vibrato Blending Factor=float(100,0,100) +#@gui :Channel Influence Factor=float(1,-8,8) +#@gui :Final Channel Modulos Multiplication Factor=float(1,1,32) +#@gui :_=separator() +#@gui :_=note("- Channel #2 - ") +#@gui :Process Channel?=bool(1) +#@gui :X-Orientation=bool(1) +#@gui :Y-Orientation=bool(1) +#@gui :U-Factor=float(.85,.1,15) +#@gui :V-Factor=float(.85,.1,15) +#@gui :X-Scale Factor=float(1,.1,15) +#@gui :Y-Scale Factor=float(1,.1,15) +#@gui :XY-Scale Factor=float(1,.1,3) +#@gui :Percentage-Based X Pixel Shift=float(0,-200,200) +#@gui :Percentage-Based Y Pixel Shift=float(0,-200,200) +#@gui :Elevation=float(.7,-100,100) +#@gui :Multiply Blending=bool(0) +#@gui :Invert Vibrato=bool(0) +#@gui :Vibrato Blending Factor=float(100,0,100) +#@gui :Channel Influence Factor=float(1,-8,8) +#@gui :Final Channel Modulos Multiplication Factor=float(1,1,32) +#@gui :_=separator() +#@gui :_=note("- Channel #3 - ") +#@gui :Process Channel?=bool(1) +#@gui :X-Orientation=bool(1) +#@gui :Y-Orientation=bool(1) +#@gui :U-Factor=float(.85,.1,15) +#@gui :V-Factor=float(.85,.1,15) +#@gui :X-Scale Factor=float(1,.1,15) +#@gui :Y-Scale Factor=float(1,.1,15) +#@gui :XY-Scale Factor=float(1,.1,3) +#@gui :Percentage-Based X Pixel Shift=float(0,-200,200) +#@gui :Percentage-Based Y Pixel Shift=float(0,-200,200) +#@gui :Elevation=float(.7,-100,100) +#@gui :Multiply Blending=bool(0) +#@gui :Invert Vibrato=bool(0) +#@gui :Vibrato Blending Factor=float(100,0,100) +#@gui :Channel Influence Factor=float(1,-8,8) +#@gui :Final Channel Modulos Multiplication Factor=float(1,1,32) +#@gui :_=separator() +#@gui :_=note("- Alpha Channel #1 - ") +#@gui :Process Channel?=bool(0) +#@gui :X-Orientation=bool(1) +#@gui :Y-Orientation=bool(1) +#@gui :U-Factor=float(.85,.1,15) +#@gui :V-Factor=float(.85,.1,15) +#@gui :X-Scale Factor=float(1,.1,15) +#@gui :Y-Scale Factor=float(1,.1,15) +#@gui :XY-Scale Factor=float(1,.1,3) +#@gui :Percentage-Based X Pixel Shift=float(0,-200,200) +#@gui :Percentage-Based Y Pixel Shift=float(0,-200,200) +#@gui :Elevation=float(.7,-100,100) +#@gui :Multiply Blending=bool(1) +#@gui :Invert Vibrato=bool(0) +#@gui :Vibrato Blending Factor=float(100,0,100) +#@gui :Channel Influence Factor=float(1,-8,8) +#@gui :Final Channel Modulos Multiplication Factor=float(1,1,32) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2018/12/19.") +#@gui Weighted RGB To Grayscale:fx_rep_w_rgb82gray,fx_rep_w_rgb82gray_preview(0) +#@gui :_=note("Weigh the R-G-B Channel, and then output based on their weight") +#@gui :_=separator() +#@gui :_=note("Main RGB to Grayscale") +#@gui :Red Weight(%)=float(33.33,0,100) +#@gui :Green Weight(%)=float(33.33,0,100) +#@gui :Blue Weight(%)=float(33.33,0,100) +#@gui :Use Weighted Ratio?=bool(1) +#@gui :_=separator() +#@gui :_=note("Min-Max Value") +#@gui :Min Value Weight(%)=float(0,0,100) +#@gui :Max Value Weight(%)=float(0,0,100) +#@gui :Min-Max Interpolation=float(0,0,1) +#@gui :_=separator() +#@gui :_=note("Post-Process Adjustment") +#@gui :Value Shift=float(0,-128,128) +#@gui :Midgray Shift=float(0,-1,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/6/25.") +#@gui Z-Time:rep_z_render : * +#@gui :_=note("Z-Time Rendering is a filter that utilize the value of a layer to represent the frame where frames are interpolated and normalized to the value of that layer. In other word, the reference layer can be seen as a representative of time.Note:Try to use a gradient for top or bottom layer depending on option you use.\n\nZ-Depth Values is recommended to be altered when using float image as reference. Use values less than 255 in order to posterize.\n\nThis filter do not work with Paint.NET as you need 3 images!") +#@gui :_=separator() +#@gui :Layer to Use as Time Reference?=choice(0,"Top Layer","Bottom Layer") +#@gui :Z-Depth Values=int(255,3,1024) +#@gui :Mirror Frame Ordering?=bool(0) +#@gui :Separate Time by Channels?=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/10/13.") +#@gui _RL +#@gui Plasma Transition:plasma_transition,plasma_transition +#@gui :Balance=float(0.5,0,1) +#@gui :Scale=int(5,0,50) +#@gui :Smoothness=float(1,0,10) +#@gui :Random Initialization=int(42,1,100) +#@gui :_=separator() +#@gui :_=note("Authors: Jean-Baptiste Rolland, Julien Levillain. Latest update: 2013/28/03.") +#@gui RandomWaves:randomwaves,randomwaves +#@gui :Steps Number=int(84,1,1000) +#@gui :Probability of Impulse (% / Step)=float(80.,1.,100.) +#@gui :Lessening=float(1.2,0.01,10.) +#@gui :Random Initialization=int(42,1,100) +#@gui :_=separator() +#@gui :_=note("Authors: Jean-Baptiste Rolland, Julien Levillain. Latest update: 2013/28/03.") +#@gui _Ronounours +#@gui Auto-Adjust Orientation:fx_adjust_orientation,fx_adjust_orientation(1) +#@gui :Threshold=float(5,0,100) +#@gui Blur [Quad]:fx_blur_quad,fx_blur_quad_preview +#@gui :_=note("Blur parameters:") +#@gui :1st Amplitude (%)=float(0,0,100) +#@gui :2nd Amplitude (%)=float(5,0,100) +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacity (%)=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("Quad coordinates:") +#@gui :P0=point(40,25,0,1) +#@gui :P1=point(60,25,0,1) +#@gui :P2=point(95,90,0,1) +#@gui :P3=point(5,90,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/01/18.") +#@gui Curves:fx_apply_curve,fx_apply_curve_preview +#@gui :Starting Y=int(0,0,255) +#@gui :_=separator() +#@gui :X-Coord(1)=int(-1,-1,255) +#@gui :Y-Coord(1)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(2)=int(-1,-1,255) +#@gui :Y-Coord(2)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(3)=int(-1,-1,255) +#@gui :Y-Coord(3)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(4)=int(-1,-1,255) +#@gui :Y-Coord(4)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(5)=int(-1,-1,255) +#@gui :Y-Coord(5)=int(128,0,255) +#@gui :_=separator() +#@gui :Ending Y=int(255,0,255) +#@gui :_=separator() +#@gui :Curve Smoothness=float(1,0,1) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :Display Histogram=float(0,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui Curves [Lab] +#@gui A-Color:fx_apply_Labcurve,fx_apply_acurve_preview +#@gui :Starting Y=int(0,0,255) +#@gui :_=separator() +#@gui :X-Coord(1)=int(-1,-1,255) +#@gui :Y-Coord(1)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(2)=int(-1,-1,255) +#@gui :Y-Coord(2)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(3)=int(-1,-1,255) +#@gui :Y-Coord(3)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(4)=int(-1,-1,255) +#@gui :Y-Coord(4)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(5)=int(-1,-1,255) +#@gui :Y-Coord(5)=int(128,0,255) +#@gui :_=separator() +#@gui :Ending Y=int(255,0,255) +#@gui :_=separator() +#@gui :Curve Smoothness=float(1,0,1) +#@gui :Display Histogram=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui B-Color:fx_apply_Labcurve,fx_apply_bcurve_preview +#@gui :Starting Y=int(0,0,255) +#@gui :_=separator() +#@gui :X-Coord(1)=int(-1,-1,255) +#@gui :Y-Coord(1)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(2)=int(-1,-1,255) +#@gui :Y-Coord(2)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(3)=int(-1,-1,255) +#@gui :Y-Coord(3)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(4)=int(-1,-1,255) +#@gui :Y-Coord(4)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(5)=int(-1,-1,255) +#@gui :Y-Coord(5)=int(128,0,255) +#@gui :_=separator() +#@gui :Ending Y=int(255,0,255) +#@gui :_=separator() +#@gui :Curve Smoothness=float(1,0,1) +#@gui :Display Histogram=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui Lightness:fx_apply_Labcurve,fx_apply_Lcurve_preview +#@gui :Starting Y=int(0,0,255) +#@gui :_=separator() +#@gui :X-Coord(1)=int(-1,-1,255) +#@gui :Y-Coord(1)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(2)=int(-1,-1,255) +#@gui :Y-Coord(2)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(3)=int(-1,-1,255) +#@gui :Y-Coord(3)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(4)=int(-1,-1,255) +#@gui :Y-Coord(4)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(5)=int(-1,-1,255) +#@gui :Y-Coord(5)=int(128,0,255) +#@gui :_=separator() +#@gui :Ending Y=int(255,0,255) +#@gui :_=separator() +#@gui :Curve Smoothness=float(1,0,1) +#@gui :Display Histogram=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui _Curves [RGB] +#@gui Blue:fx_apply_RGBcurve,fx_apply_Bcurve_preview +#@gui :Starting Y=int(0,0,255) +#@gui :_=separator() +#@gui :X-Coord(1)=int(-1,-1,255) +#@gui :Y-Coord(1)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(2)=int(-1,-1,255) +#@gui :Y-Coord(2)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(3)=int(-1,-1,255) +#@gui :Y-Coord(3)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(4)=int(-1,-1,255) +#@gui :Y-Coord(4)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(5)=int(-1,-1,255) +#@gui :Y-Coord(5)=int(128,0,255) +#@gui :_=separator() +#@gui :Ending Y=int(255,0,255) +#@gui :_=separator() +#@gui :Curve Smoothness=float(1,0,1) +#@gui :Display Histogram=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui Green:fx_apply_RGBcurve,fx_apply_Gcurve_preview +#@gui :Starting Y=int(0,0,255) +#@gui :_=separator() +#@gui :X-Coord(1)=int(-1,-1,255) +#@gui :Y-Coord(1)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(2)=int(-1,-1,255) +#@gui :Y-Coord(2)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(3)=int(-1,-1,255) +#@gui :Y-Coord(3)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(4)=int(-1,-1,255) +#@gui :Y-Coord(4)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(5)=int(-1,-1,255) +#@gui :Y-Coord(5)=int(128,0,255) +#@gui :_=separator() +#@gui :Ending Y=int(255,0,255) +#@gui :_=separator() +#@gui :Curve Smoothness=float(1,0,1) +#@gui :Display Histogram=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui Red:fx_apply_RGBcurve,fx_apply_Rcurve_preview +#@gui :Starting Y=int(0,0,255) +#@gui :_=separator() +#@gui :X-Coord(1)=int(-1,-1,255) +#@gui :Y-Coord(1)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(2)=int(-1,-1,255) +#@gui :Y-Coord(2)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(3)=int(-1,-1,255) +#@gui :Y-Coord(3)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(4)=int(-1,-1,255) +#@gui :Y-Coord(4)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(5)=int(-1,-1,255) +#@gui :Y-Coord(5)=int(128,0,255) +#@gui :_=separator() +#@gui :Ending Y=int(255,0,255) +#@gui :_=separator() +#@gui :Curve Smoothness=float(1,0,1) +#@gui :Display Histogram=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui _Curves [YCbCr] +#@gui Blue Chrominance:fx_apply_YCbCrcurve,fx_apply_Cbcurve_preview +#@gui :Starting Y=int(0,0,255) +#@gui :_=separator() +#@gui :X-Coord(1)=int(-1,-1,255) +#@gui :Y-Coord(1)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(2)=int(-1,-1,255) +#@gui :Y-Coord(2)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(3)=int(-1,-1,255) +#@gui :Y-Coord(3)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(4)=int(-1,-1,255) +#@gui :Y-Coord(4)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(5)=int(-1,-1,255) +#@gui :Y-Coord(5)=int(128,0,255) +#@gui :_=separator() +#@gui :Ending Y=int(255,0,255) +#@gui :_=separator() +#@gui :Curve Smoothness=float(1,0,1) +#@gui :Display Histogram=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui Luminance:fx_apply_YCbCrcurve,fx_apply_Ycurve_preview +#@gui :Starting Y=int(0,0,255) +#@gui :_=separator() +#@gui :X-Coord(1)=int(-1,-1,255) +#@gui :Y-Coord(1)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(2)=int(-1,-1,255) +#@gui :Y-Coord(2)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(3)=int(-1,-1,255) +#@gui :Y-Coord(3)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(4)=int(-1,-1,255) +#@gui :Y-Coord(4)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(5)=int(-1,-1,255) +#@gui :Y-Coord(5)=int(128,0,255) +#@gui :_=separator() +#@gui :Ending Y=int(255,0,255) +#@gui :_=separator() +#@gui :Curve Smoothness=float(1,0,1) +#@gui :Display Histogram=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui Red Chrominance:fx_apply_YCbCrcurve,fx_apply_Crcurve_preview +#@gui :Starting Y=int(0,0,255) +#@gui :_=separator() +#@gui :X-Coord(1)=int(-1,-1,255) +#@gui :Y-Coord(1)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(2)=int(-1,-1,255) +#@gui :Y-Coord(2)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(3)=int(-1,-1,255) +#@gui :Y-Coord(3)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(4)=int(-1,-1,255) +#@gui :Y-Coord(4)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(5)=int(-1,-1,255) +#@gui :Y-Coord(5)=int(128,0,255) +#@gui :_=separator() +#@gui :Ending Y=int(255,0,255) +#@gui :_=separator() +#@gui :Curve Smoothness=float(1,0,1) +#@gui :Display Histogram=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui _ +#@gui Faded Mirror:fx_faded_mirror,fx_faded_mirror(1) +#@gui :Axis=choice("X-Axis","Y-Axis") +#@gui :Fading=float(10,0,100) +#@gui :Overlapping=float(10,0,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2013/29/05.") +#@gui Frame [Round] Old:fx_frame_round_old,fx_frame_round_old(1) +#@gui :Sharpness=float(6,0.1,40) +#@gui :Size (%)=float(20,0,100) +#@gui :Smoothness=float(0.1,0,15) +#@gui :Shade=float(0,0,1) +#@gui :Color=color(#ffffffff) +#@gui :Blur Frame=float(0,0,100) +#@gui :Blur Shade=float(0.1,0,1) +#@gui :Blur Amplitude=float(3,0,10) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest Update: 2010/29/12.") +#@gui GAAP Test:gaap_test,gaap_test +#@gui :Sigma=float(0,0,100) +#@gui :Color=color(#000000) +#@gui Graduated Color Accent:fx_gca,fx_gca_preview +#@gui :Reference Color=color(#ffffff) +#@gui :Amplitude=float(1,0,5) +#@gui :Max Value=choice("From Input","From Reference Color","Maximum Allowed") +#@gui :Channel=choice(0,"Saturation","Lightness") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2015/15/07.") +#@gui Grain [Old]:fx_grain,fx_grain_preview(0) +#@gui :Amplitude=float(40,0,512) +#@gui :Tone Smoothness=float(5,0,15) +#@gui :Grain Type=choice("Gaussian","Uniform") +#@gui :Channel(s)=choice(2,"All","RGBA","RGB","Luminance","Blue/red Chrominances","Blue Chrominance","Red Chrominance","Lightness","Ab-Components","A-Component","B-Component","Hue","Saturation","Value","Key","Green Chrominance","Ch-Components","C-Component","H-Component","Red","Green","Blue","Alpha") +#@gui :_=separator() +#@gui :_=note("Shadows:") +#@gui :Strength=float(0.8,0,1) +#@gui :Scale=float(0.5,0,2) +#@gui :Channel Correlation=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Mid-tones:") +#@gui :Strength=float(1,0,1) +#@gui :Scale=float(0,0,2) +#@gui :Channel Correlation=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Highlights:") +#@gui :Strength=float(0.6,0,1) +#@gui :Scale=float(0.2,0,2) +#@gui :Channel Correlation=float(0.5,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2013/21/11.") +#@gui Krita Helper:fx_krita,fx_krita +#@gui Layer Info:gui_layer_info,gui_layer_info_preview +#@gui :Number of Output Layers for Each Input Layer=int(1,1,5) +#@gui :_=note("Note: This filter displays layer info on each layer.") +#@gui Perspective Scale:fx_perspective_scale,fx_perspective_scale_preview(1) +#@gui :Iterations=int(2,2,10) +#@gui :Factor=float(75,0,100) +#@gui :X-Offset=float(0,-100,100) +#@gui :Y-Offset=float(0,-100,100) +#@gui :Output Mode=_choice("Single Layer","Multiple Layers") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2013/08/02.") +#@gui Shaded Segmentation:dt_segment_shaded,dt_segment_shaded(0) +#@gui :Density=float(1,0,3) +#@gui :Shading=float(0.7,0,2) +#@gui :Smoothness=float(1,0,10) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2013/01/02.") +#@gui _Samj +#@gui About:_none_,samj_about +#@gui :_=note("Informations - Compilations :) +#@gui :_=link("http://www.aljacom.com/~gmic/","http://www.aljacom.com/~gmic/") +#@gui :_=link("http://samjcreations.blogspot.ca/","http://samjcreations.blogspot.ca/") +#@gui :_=note("Filtres :) +#@gui :_=link("https://github.com/GreycLab/gmic-community","https://github.com/GreycLab/gmic-community") +#@gui :_=note("Les filtres contenus dans ce répertoire sont majoritairement traduits en français et/ou en cours de développement.") +#@gui :_=note("The filters included in this directory are mostly translated into French and/or experimental.") +#@gui :_=note("Nettoyage du code/Cleaning the code :) +#@gui :_=note("Thank RepTorian1125 for modernizing the source code of these filters for GMIC 3.1.0") +#@gui :_=note("Merci Reptorian1125 pour avoir modernisé le code source de ces filtres pour GMIC 3.1.0") +#@gui :_=note("Version 2023/07/12 GMIC 3.2.7_pre") +#@gui __Arrays & Tiles +#@gui Annular Steiner Chain Round Tile:Annular_Steiner_Chain_Round_Tile,Annular_Steiner_Chain_Round_Tile(1) +#@gui :_=note("Annular Steiner Chain Round Tiles") +#@gui :_=link("http://en.wikipedia.org/wiki/Steiner_chain","http://en.wikipedia.org/wiki/Steiner_chain") +#@gui :_=separator() +#@gui :_=note("Image Finale") +#@gui :Dimension En Pixels=int(800,256,1920) +#@gui :Supprimer Calque / Delete Layer=bool(1) +#@gui :_=separator() +#@gui :_=note("Image") +#@gui :Position X Origine (%)=float(0,0,100) +#@gui :Position Y Origine (%)=float(0,0,100) +#@gui :Dimension (%)=float(100,1,100) +#@gui :Angle Décalage Image Contour=float(0,0,360) +#@gui :Image Contour Dimension=float(100,1,100) +#@gui :Nb Cercles Extérieurs / Circles Surrounding=int(12,3,180) +#@gui :Angle Inclinaison / Tilt=float(0,0,360) +#@gui :_=separator() +#@gui :_=note("Couleurs Formes") +#@gui :Activer Couleurs Formes=bool(1) +#@gui :Contours=color(#000000ff) +#@gui :Affichage / Display Contours=choice(0,"Sans","A","B","C","D","E","F","G") +#@gui :Cercle / Circle C=color(#ffff007f) +#@gui :Cercle / Circle D=color(#0000ff7f) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui _Testing +#@gui Samj +#@gui Arrays & Tiles +#@gui Bulles Colorees:samj_Bulles_Colorees,samj_Bulles_Colorees(1) +#@gui :_=note("samj_Bulles_Colorees") +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Couleur Limite=color(#404040ff) +#@gui :_=separator() +#@gui :_=note("Resolution") +#@gui :Résolution=int(8,1,32) +#@gui :_=separator() +#@gui :_=note("Bulles") +#@gui :Variation L=int(0,-255,255) +#@gui :Variation H=int(0,-255,255) +#@gui :Grossissement A=float(3,1,9) +#@gui :Grossissement B=float(0,-3,3) +#@gui :Angle=bool(0) +#@gui :Angle Variation=float(0,0,180) +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Rendu=choice(0,"A","Inverser","A + Inverser") +#@gui :Flou / Blur Contours=float(0,0,5) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond / Background Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Carres Noirs:samj_Carres_Noirs,samj_Carres_Noirs (1) +#@gui :_=separator() +#@gui :_=note("Avant plan") +#@gui :Limite Détails=int(128,1,255) +#@gui :Résolution=int(40,8,64) +#@gui :Épaisseur / Thickness=int(7,1,7) +#@gui :Dilate=int(0,0,8) +#@gui :Couleur Avant Plan=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("Ombre") +#@gui :Flou/Blur=float(2,0,10) +#@gui :Couleur Ombre=color(#606060ff) +#@gui :Décalage Ombre=int(2,0,7) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("Isophotes") +#@gui :Ajout Isophotes=bool(0) +#@gui :Flou/Blur=float(2,0,10) +#@gui :Ajout Couleur=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/14.") +#@gui Cercles Concentriques:Cercles_Concentriques_A,Cercles_Concentriques_A(1) +#@gui :_=separator() +#@gui :_=note("Image Finale / Resulting Image") +#@gui :Dimension En Pixels=int(800,256,1920) +#@gui :Supprimer Calque / Delete Layer=bool(1) +#@gui :_=note("Cercles / Circles Rings") +#@gui :Nb Cercles / Circles (anneaux)=int(6,1,180) +#@gui :Variation Dimensions / Size=choice(0,"Sin A","Sin B","Lineaire") +#@gui :Angle Variation Origine=float(0,0,180) +#@gui :Angle Variation Fin / End=float(90,0,180) +#@gui :Coef. Variation=float(1,-1,1) +#@gui :Rotation Horaire / Rotate Clockwise=bool(1) +#@gui :Décalage Cercles % / Shift=float(50,0,500) +#@gui :Conserver Extérieur / Keep Outside=bool(1) +#@gui :_=note("Rayons De Couleurs Et Contours / Colored Rays And Contours") +#@gui :Activer Rayons De Couleurs / Enable=bool(1) +#@gui :_=note(" - Contours - ") +#@gui :Contours=color(#000000ff) +#@gui :Affichage / Display Contours=choice(0,"Sans","Rayons Et Cercles","Rayons","Cercles") +#@gui :Dilate Contours=int(0,0,16) +#@gui :Flou / Blur Contours=float(0,0,5) +#@gui :Sharpen=int(0,0,600) +#@gui :_=note(" - Couleurs - ") +#@gui :Répétition Des Couleurs=int(5,1,180) +#@gui :Angle Décalage Des Couleurs=float(0,0,360) +#@gui :Couleur / Color A=color(#0000ffff) +#@gui :Couleur / Color B=color(#ffff00ff) +#@gui :Couleur / Color C=color(#ff0000ff) +#@gui :Couleur / Color D=color(#00ffffff) +#@gui :Couleur / Color E=color(#ff00ffff) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Mélange Couleurs Contours / Blend=bool(1) +#@gui :_=note("Symmetrizoscope") +#@gui :Activer Symmetrizoscope=bool(0) +#@gui :Itérations=int(5,1,32) +#@gui :Angle=float(0,0,360) +#@gui :Symmetry Sides=choice("Backward","Forward","Swap") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Coeurs Hearts 002:samj_Coeurs_Hearts_002,samj_Coeurs_Hearts_002(1) +#@gui :_=separator() +#@gui :_=note("Des cœurs aux couleurs de l'image.") +#@gui :_=separator() +#@gui :_=note("Cœurs / Hearts") +#@gui :Résolution=int(16,4,128) +#@gui :Remplissage % / Filling %=float(100,20,100) +#@gui :Angle Rotation=int(0,0,360) +#@gui :Flou / Blur=float(0,0,2) +#@gui :Coeurs / Hearts=bool(1) +#@gui :Interpolation=int(0,0,3) +#@gui :Couleur Fond / Background Color=color(#ffffffff) +#@gui :Gris / Grey=bool(0) +#@gui :Amplification Couleurs / Colors Boost=bool(0) +#@gui :_=separator() +#@gui :_=note("Mélange / Blend") +#@gui :Type Avant Plan / Foreground=choice(0,"Type A","Type B") +#@gui :Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/14.") +#@gui Deconstruction:samj_Tiles_Deconstruction,samj_Tiles_Deconstruction +#@gui :_=link("https://samjcreations.blogspot.com","https://samjcreations.blogspot.com") +#@gui :Tuiles/Tiles=int(63,2,1000) +#@gui :_=note("Contours Tuiles/Tiles") +#@gui :Lignes/Lines=choice(0,"None","XY","X","Y") +#@gui :Couleur/Color=color(#00000040) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/11/13.") +#@gui Ellipses Colorees:samj_Ellipses_Colorees,samj_Ellipses_Colorees(1) +#@gui :_=note("samj_Ellipses_Colorees") +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Couleur Limite=color(#404040ff) +#@gui :_=separator() +#@gui :_=note("Ellipse") +#@gui :Rayon L=int(8,1,32) +#@gui :Rayon H=int(8,1,32) +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Rendu=choice(0,"A","Inverser","A + Inverser") +#@gui :Flou / Blur Contours=float(0,0,5) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond / Background Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Filters On Tiles:samj_Filtres_Sur_Tuiles,samj_Filtres_Sur_Tuiles +#@gui :_=note("L'image est découpée en tuiles puis réassemblée.") +#@gui :_=note("Chaque tuile est modifiable par les filtres définis au paramètre 3.") +#@gui :_=note("Les filtres du paramètre 4 modifient l'aspect final si validation dans paramètre 2.") +#@gui :_=separator() +#@gui :_=note("The image is cut into tiles and then reassembled.") +#@gui :_=note("Each tile can be modified by the filters defined in parameter 3.") +#@gui :_=note("The filters of parameter 4 modify the final appearance if validation is allowed in parameter 2.") +#@gui :_=link("PDF Reference","http://gmic.eu/reference/gmic_reference.pdf") +#@gui :_=separator() +#@gui :1 - XY Découpage/Cutting=int(20,2,256) +#@gui :2 - Filtres À Utiliser=choice(0,"Tuiles/Tiles","Tuiles+Réassemblage/Tiles+Reassembly") +#@gui :3 - Tuiles/Tiles=text("shift 2,2,0,0,0 mirror y") +#@gui :4 - Réassemblage/Reassembly=text("dilate 20") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2021/01/16.") +#@gui Filters On Tiles V2:samj_Filtres_Sur_Tuiles_V2,samj_Filtres_Sur_Tuiles_V2 +#@gui :_=note("L'image est découpée en tuiles puis réassemblée.") +#@gui :_=note("Chaque tuile est modifiable par les filtres définis au paramètre 3.") +#@gui :_=note("Les filtres du paramètre 7 modifient l'aspect final si validation dans paramètre 2.") +#@gui :_=separator() +#@gui :_=note("The image is cut into tiles and then reassembled.") +#@gui :_=note("Each tile can be modified by the filters defined in parameter 3.") +#@gui :_=note("The filters of parameter 7 modify the final appearance if validation is allowed in parameter 2.") +#@gui :_=link("PDF Reference","http://gmic.eu/reference/gmic_reference.pdf") +#@gui :_=separator() +#@gui :1 - Tuiles/Tiles Size=int(40,4,512) +#@gui :2 - Filtres À Utiliser=choice(1,"Tuiles/Tiles","Tuiles+Réassemblage/Tiles+Reassembly") +#@gui :3 - Tuiles/Tiles=text("dilate 3 shift 1,1,0,0,0") +#@gui :4 - Overlap (%)=float(0,0,50) +#@gui :5 - Overlap Std (%)=float(0,0,100) +#@gui :6 - Boundary Conditions=choice(3,"Dirichlet","Neumann","Periodic","Mirror") +#@gui :_=separator() +#@gui :7 - Réassemblage/Reassembly=text("pow 1.5 n 0,255") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/08/08.") +#@gui Floutage Blurring:samj_Flouter,samj_Flouter +#@gui :_=link("https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-floutage-blurring.html","https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-floutage-blurring.html") +#@gui :Flou/Blur=float(0,0,20) +#@gui :Netteté/Sharpen=float(0,0,100) +#@gui :Autoindex=int(0,0,255) +#@gui :Grille/Grid=int(10,4,100) +#@gui :Cercle/Circle=bool(0) +#@gui :Taille/Size=int(0,0,100) +#@gui :Norm.=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/10/21.") +#@gui Losanges Colores:samj_Losanges_Colores,samj_Losanges_Colores(1) +#@gui :_=note("samj_Losanges_Colores") +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Couleur Limite=color(#404040ff) +#@gui :_=separator() +#@gui :_=note("Resolution") +#@gui :Résolution=int(8,1,32) +#@gui :_=separator() +#@gui :_=note("Losanges - Rectangles") +#@gui :Inclinaison=bool(0) +#@gui :Variation L=int(0,-255,255) +#@gui :Variation H=int(0,-255,255) +#@gui :Grossissement A=float(1.5,0.5,9) +#@gui :Grossissement B=float(0,-10,10) +#@gui :Dimension Variation=float(1,0.3,3) +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Rendu=choice(0,"A","Inverser","A + Inverser") +#@gui :Flou / Blur Contours=float(0,0,5) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond / Background Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("Contours") +#@gui :Contours Losanges=choice(0,"Sans","Couleur Fond","Blanc","Gris Moyen","Fonce") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Moirage Spline:samj_Moirage_Spline,samj_Moirage_Spline(0) +#@gui :_=note("samj_Moirage_Spline") +#@gui :_=separator() +#@gui :_=note("Calque A") +#@gui :Couleur A=color(#000000ff) +#@gui :Résolution A=int(8,2,32) +#@gui :Décalage A=float(0,-100,100) +#@gui :Spline A U0=float(-50,-250,250) +#@gui :Spline A V0=float(50,-250,250) +#@gui :Spline A U1=float(-50,-250,250) +#@gui :Spline A V1=float(50,-250,250) +#@gui :Orientation A=float(0,0,360) +#@gui :Dilate A %=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("Calque B") +#@gui :Couleur B=color(#000000ff) +#@gui :Résolution B=int(8,2,32) +#@gui :Décalage B=float(0,-100,100) +#@gui :Spline B U0=float(-50,-250,250) +#@gui :Spline B V0=float(50,-250,250) +#@gui :Spline B U1=float(-50,-250,250) +#@gui :Spline B V1=float(50,-250,250) +#@gui :Orientation A=float(0,0,360) +#@gui :Dilate B %=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/04.") +#@gui Moirage Spline XY:samj_Moirage_Spline_XY,samj_Moirage_Spline_XY(0) +#@gui :_=note("samj_Moirage_Spline_XY") +#@gui :_=separator() +#@gui :_=note("Calque A") +#@gui :Couleur A=color(#000000ff) +#@gui :Résolution A=int(8,2,32) +#@gui :Décalage A=float(0,-100,100) +#@gui :Spline A U0=float(-50,-400,400) +#@gui :Spline A V0=float(50,-400,400) +#@gui :Spline A U1=float(-50,-400,400) +#@gui :Spline A V1=float(50,-400,400) +#@gui :Dilate A %=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("Calque B") +#@gui :Couleur B=color(#000000ff) +#@gui :Résolution B=int(8,2,32) +#@gui :Décalage B=float(0,-100,100) +#@gui :Spline B U0=float(-50,-400,400) +#@gui :Spline B V0=float(50,-400,400) +#@gui :Spline B U1=float(-50,-400,400) +#@gui :Spline B V1=float(50,-400,400) +#@gui :Dilate B %=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("Calques Visibles") +#@gui :Choix=choice(0,"Calques A B","Calque A","Calque B") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Montage Annular Steiner Chain:samj_Montage_Annular_Steiner_Chain,samj_Montage_Annular_Steiner_Chain_Preview +#@gui :_=link("Documentation","https://samjcreations.blogspot.com/2020/12/nouveaux-montages-dimages-avec-gmic.html") +#@gui :_=note("Utiliser au moins 4 calques pour ce filtre. La qualité de la prévisualisation est limitée.") +#@gui :_=note("Use at least 4 layers for this filter. The quality of the preview is limited.") +#@gui :_=separator() +#@gui :_=note("Image Finale") +#@gui :1 - Dimension Pix.=int(2400,800,7200) +#@gui :2 - Nb Images Extérieures/Annular Chain=int(12,3,180) +#@gui :3 - Sélection=choice(1,"Calques Du Bas/Bottom Layers","Calques Du Haut/Top Layers") +#@gui :4-5-6-7 Fond/Background=color(#00000000) +#@gui :_=separator() +#@gui :_=note("Image Centrale") +#@gui :8 - Position X Origine (%)=float(0,-100,100) +#@gui :9 - Position Y Origine (%)=float(0,-100,100) +#@gui :10 - Agrandissement/Enlarging=float(1,1,100) +#@gui :11 - Décalage/Shift X (%)=float(0,-100,100) +#@gui :12 - Décalage/Shift Y (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :_=note("Images Extérieures/Annular Chain") +#@gui :13 - Angle Décalage Image Contour=float(90,0,360) +#@gui :14 - Rotation Images=bool(1) +#@gui :15 - Image Contour Dimension=float(100,1,100) +#@gui :16 - Angle Inclinaison/Tilt=float(0,0,360) +#@gui :17 - Agrandissement/Enlarging=float(1,0.2,2) +#@gui :18 - Décalage/Shift X (%)=float(0,-100,100) +#@gui :19 - Décalage/Shift Y (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/12/09.") +#@gui Montage Cercle Spirale:samj_Montage_Cercle_Spirale,samj_Montage_Cercle_Spirale_preview +#@gui :_=link("Documentation","https://samjcreations.blogspot.com/2020/12/samuser-avec-gmic-gimp-filtre-montage_21.html") +#@gui :_=note("Utiliser au moins 6 calques pour ce filtre. La qualité de la prévisualisation est limitée.") +#@gui :_=note("Use at least 6 layers for this filter. The quality of the preview is limited.") +#@gui :_=separator() +#@gui :_=note("Montage Cercle Spirale") +#@gui :1 - Dimensions Approx. Pixels=int(2400,800,5100) +#@gui :2 - Nb Images=int(8,6,36) +#@gui :3 - Sélection=choice(0,"Calques Du Haut/Top Layers","Calques Du Bas/Bottom Layers") +#@gui :4 - Forme=choice(1,"Cercle","Spirale","Spirale Inversée") +#@gui :5-6-7-8 Fond/Background=color(#00000000) +#@gui :9 - Rotation Angle=choice(0,"0","90","-90","180") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/12/22.") +#@gui Montage Geometric Figures:samj_Montage_Figures_Geometriques,samj_Montage_Figures_Geometriques +#@gui :_=link("Documentation","https://samjcreations.blogspot.com/2020/12/nouveaux-montages-dimages-avec-gmic.html") +#@gui :_=note("Rapidité de traitement/Speed of image processing") +#@gui :1 - Dimensions Max. Pixels=int(4800,2400,11400) +#@gui :_=note("Montage") +#@gui :2 - Colonnes/Columns - 0 Automatique=int(0,0,20) +#@gui :3 - Colonnes Vers Lignes / Columns to Rows=bool(0) +#@gui :4 - Montage Type=choice(1,"Basique","Polygones - Param 17-18","Rideau - Param 19-20","Oeuf Egg Rosillo - Param 21-22","Kiss Curve","Fleur Flower") +#@gui :5-6-7-8 Fond/Background=color(#00000000) +#@gui :_=note("Calques/Layers") +#@gui :9 - Sélection=choice(1,"Calques Du Bas/Bottom Layers","Calques Du Haut/Top Layers") +#@gui :10 - Image Carrée / Square Image=bool(0) +#@gui :11 - Décalage/Shift X (%)=float(0,-100,100) +#@gui :12 - Décalage/Shift Y (%)=float(0,-100,100) +#@gui :13 - Agrandissement/Enlarging=float(1,0.35,2.75) +#@gui :14 - Contour/Padding=int(10,0,20) +#@gui :15-16-17 Contour/Padding=color(#ffffff) +#@gui :_=note("Polygones") +#@gui :18 - Nb Côtés/Sides Polygone=int(6,3,24) +#@gui :19 - Rotation Polygone=float(30,0,360) +#@gui :_=note("Rideau") +#@gui :20 - Effet / Effect=choice(1,"1","2","3","4","5","6","7","8","9","10","11","12") +#@gui :21 - Intensité=int(-3,-5,1) +#@gui :_=note("Oeuf Egg") +#@gui :22 - Forme=float(300,200,400) +#@gui :23 - Angle=float(270,-360,360) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/12/17.") +#@gui Montage Multi Rows:samj_montage_multi_rows_GUI,samj_montage_multi_rows_GUI +#@gui :_=link("Documentation","https://samjcreations.blogspot.com/2020/12/nouveaux-montages-dimages-avec-gmic.html") +#@gui :_=note(" - Montage d'images assemblées horizontalement - Au moins 4 calques/Images pour 2 lignes") +#@gui :_=note(" - Montage of horizontally assembled images - At least 4 layers/Images for 2 rows") +#@gui :_=note(" - 1 ligne est ajoutée automatiquement si modulo Images/Lignes différent de 0") +#@gui :_=note(" - 1 row is automatically added if modulo Images/Rows different from 0") +#@gui :_=separator() +#@gui :_=note("Montage Multi Rows") +#@gui :1 - Nb. Images Montage=int(4,4,200) +#@gui :2 - Lignes/Rows=int(2,2,20) +#@gui :3 - Sélection=choice(0,"Calques Du Haut/Top Layers","Calques Du Bas/Bottom Layers") +#@gui :4 - Montage Type=choice(1,"Hauteurs Proportionnelles/Proportional Heights","Hauteur Constante/Same Height") +#@gui :5 - Dimension Pixels=int(2400,800,11400) +#@gui :6 - Contours Pixels=int(2,0,24) +#@gui :7 - Espacement/Padding Pixels=int(2,0,24) +#@gui :8 - Rotation Images=bool(0) +#@gui :9 - Lignes Vers Colonnes/Rows to Columns=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/12/11.") +#@gui Montage Pappus Chain:samj_Montage_Pappus_Chain,samj_Montage_Pappus_Chain_Preview +#@gui :_=link("Documentation","https://samjcreations.blogspot.com/2020/12/nouveaux-montages-dimages-avec-gmic.html") +#@gui :_=note("Utiliser 10 calques pour ce filtre. La qualité de la prévisualisation est limitée.") +#@gui :_=note("Use 10 layers for this filter. The quality of the preview is limited.") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :1 - Rayon Cercle Extérieur Pix.=int(1200,600,3600) +#@gui :2 - Rotation Rendu/Rendering=float(0,0,360) +#@gui :_=note("Images Montage") +#@gui :3 - Sélection=choice(1,"Calques Du Bas/Bottom Layers","Calques Du Haut/Top Layers") +#@gui :4 - Rotation Angle=choice(0,"0","90","-90","180") +#@gui :5 - Dimension Images=float(35,5,80) +#@gui :6 - Agrandissement/Enlarging %=float(100,20,200) +#@gui :7 - Décalage/Shift X (%)=float(0,-100,100) +#@gui :8 - Décalage/Shift Y (%)=float(0,-100,100) +#@gui :_=note("Fond/Background") +#@gui :9-10-11-12 Cercle Central=color(#ffffffff) +#@gui :13-14-15-16 Extérieur=color(#00000000) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/12/09.") +#@gui Montage Row:samj_montage_row_GUI,samj_montage_row_GUI_preview +#@gui :_=link("Documentation","https://samjcreations.blogspot.com/2020/12/nouveaux-montages-dimages-avec-gmic.html") +#@gui :_=note("Montage d'images assemblées horizontalement") +#@gui :_=note("Montage of horizontally assembled images") +#@gui :_=separator() +#@gui :_=note("Montage Row") +#@gui :1 - Max. Images=int(8,1,200) +#@gui :2 - Sélection=choice(0,"Calques Du Haut/Top Layers","Calques Du Bas/Bottom Layers") +#@gui :3 - Montage Type=choice(1,"Hauteurs Proportionnelles/Proportional Heights","Hauteur Constante/Same Height") +#@gui :4 - Dimension Pixels=int(2400,800,11400) +#@gui :5 - Contours Pixels=int(2,0,24) +#@gui :6 - Espacement/Padding Pixels=int(2,0,24) +#@gui :7 - Rotation Images=bool(0) +#@gui :8 - Ligne Vers Colonne/Row to Column=bool(0) +#@gui :_=note("Déformation") +#@gui :9 - Déformation=bool(0) +#@gui :10 - Forme/Shape=choice(1,"Angle","Sinus") +#@gui :11 - Offset %=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/12/11.") +#@gui Montage Zigzag:samj_Montage_Zigzag,samj_Montage_Zigzag +#@gui :_=link("Documentation","https://samjcreations.blogspot.com/2020/12/samuser-avec-gmic-gimp-filtre-montage.html") +#@gui :_=note("La hauteur du montage sera automatiquement ajustée si la valeur du paramètre 1 est dépassée.") +#@gui :_=note("The mounting height will be automatically adjusted if the value of parameter 1 is exceeded.") +#@gui :_=separator() +#@gui :_=note("Largeur Max. Approximative/Approximate Maximum Width") +#@gui :1 - Dimensions Max. Pixels=int(4800,1200,11400) +#@gui :_=note("Montage Zigzag") +#@gui :2 - Nb Images=int(8,1,200) +#@gui :3 - Sélection=choice(1,"Calques Du Bas/Bottom Layers","Calques Du Haut/Top Layers") +#@gui :4 - Demi Hauteur/Half Height=int(256,0,1200) +#@gui :5 - Inverser Inclinaison/Reverse Tilt=bool(0) +#@gui :6 - Adoucir/Smooth=int(0,0,100) +#@gui :7-8-9-10 Fond/Background=color(#00000000) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/12/20.") +#@gui Pixelisation Contours:samj_Pixelisation_Contours,samj_Pixelisation_Contours(1) +#@gui :_=separator() +#@gui :_=note("Pixélisation") +#@gui :Flou/Blur=float(0.5,0,16) +#@gui :Forme=choice(0,"Carrée","Hexagonale","Triangulaire A","Triangulaire B","Triangulaire C","Triangulaire D","Triangulaire E","Triangulaire F") +#@gui :Pixélisation=int(20,2,128) +#@gui :Levels=int(8,1,256) +#@gui :Smoothness=float(0,0,5) +#@gui :Décalages=int(0,0,32) +#@gui :Rendu=int(1,1,6) +#@gui :_=separator() +#@gui :_=note("Smooth [antialias]") +#@gui :Amplitude=float(0,0,100) +#@gui :Edge Threshold (%)=float(10,0,100) +#@gui :Smoothness=float(0.8,0,5) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/20.") +#@gui Pointes De Diamants Colorees:samj_Pointes_De_Diamants_Colorees,samj_Pointes_De_Diamants_Colorees(1) +#@gui :_=note("samj_Pointes_De_Diamants_Colorees") +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Couleur Limite=color(#404040ff) +#@gui :_=separator() +#@gui :_=note("Resolution") +#@gui :Résolution=int(8,1,32) +#@gui :_=separator() +#@gui :_=note("Polygones") +#@gui :Variation L=int(0,-255,255) +#@gui :Variation H=int(0,-255,255) +#@gui :Grossissement A=float(1.5,0.5,9) +#@gui :Grossissement B=float(0,-10,10) +#@gui :Angle Variation=float(0,0,180) +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Rendu=choice(0,"A","Inverser","A + Inverser") +#@gui :Flou / Blur Contours=float(0,0,5) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond / Background Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("Contours") +#@gui :Contours Polygones=choice(0,"Sans","Couleur Fond","Blanc","Gris Moyen","Fonce") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui ___Patterns +#@gui Reptile:samj_reptile,samj_reptile(1) +#@gui :_=note("samj_reptile") +#@gui :_=separator() +#@gui :_=note("Texture Peau / Skin Texture") +#@gui :Forme=choice(0,"Hexagonal","Grid","Triangular Ha","Triangular Hb","Triangular Va","Triangular Vb") +#@gui :Résolution=int(64,1,256) +#@gui :Spread=int(25,5,100) +#@gui :Color=float(2,0,10) +#@gui :Orientation=float(0,0,1) +#@gui :Light=int(40,0,100) +#@gui :_=separator() +#@gui :_=note("Blend") +#@gui :Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui _Testing +#@gui Samj +#@gui Arrays & Tiles +#@gui Scintillements Colores:samj_Scintillements_Colores,samj_Scintillements_Colores(1) +#@gui :_=note("Color Rays / samj_Scintillements_Colores") +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Couleur Limite=color(#404040ff) +#@gui :_=separator() +#@gui :_=note("Scintillement") +#@gui :Résolution L=int(8,1,32) +#@gui :Résolution H=int(8,1,32) +#@gui :Dimension Variation=float(1,0.3,3) +#@gui :Variation Couleur=int(768,1,768) +#@gui :Scintillement / Rays=int(12,3,24) +#@gui :Angle Décalage / Shift Angle=float(0,0,120) +#@gui :Variation Aléatoire / Random=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Rendu / Rendering=choice(0,"A","Inverser","A + Inverser") +#@gui :Flou / Blur Contours=float(0,0,5) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond / Background Color=color(#000000ff) +#@gui :Déformation=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui ___Artistic +#@gui Angoisse Anguish:samj_Angoisse,samj_Angoisse(1) +#@gui :_=separator() +#@gui :_=note("Itérations") +#@gui :Itérations=int(1,1,3) +#@gui :_=separator() +#@gui :_=note("Paramètres Filtre dog") +#@gui :Sigma 1=float(5,0,10) +#@gui :Sigma 2=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Paramètres Filtre segment_watershed") +#@gui :Threshold=float(5,0,10) +#@gui :_=separator() +#@gui :_=note("Paramètres Filtre smooth") +#@gui :Amplitude=float(100,0,200) +#@gui :_=separator() +#@gui :_=note("Paramètres Filtre noise") +#@gui :Amplitude=float(2,0,10) +#@gui :Type=choice(4,"Gaussian","Uniform","Salt and Pepper","Poisson","Rice") +#@gui :_=separator() +#@gui :_=note("Paramètres Filtre blend") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Paramètres Filtre sharpen") +#@gui :Amplitude=int(250,0,500) +#@gui :_=separator() +#@gui :_=note("samj Dernière mise à jour : 2016/01/19.") +#@gui Barbouillage Paint Daub:samj_Barbouillage_Paint_Daub,samj_Barbouillage_Paint_Daub(0) +#@gui :_=note("Barbouillage / Paint Daub") +#@gui :_=separator() +#@gui :_=note("Gradient Norm") +#@gui :Itérations=int(2,1,3) +#@gui :_=separator() +#@gui :_=note("Smooth") +#@gui :Amplitude=int(2,1,5) +#@gui :Sharpness=int(100,0,500) +#@gui :Anisotropy=float(0.2,0,0.5) +#@gui :Sigma=float(1,0,10) +#@gui :Dl=float(4,0,10) +#@gui :_=separator() +#@gui :_=note("Equalize") +#@gui :Equalize=bool(1) +#@gui :_=separator() +#@gui :_=note("Plasma Aléatoire / Random Plasma") +#@gui :Plasma=choice(0,"Non / Without","Couleurs A","Couleurs B") +#@gui :Scale Plasma=int(8,1,30) +#@gui :_=separator() +#@gui :_=note("samj Dernière mise à jour : 2015/04/17.") +#@gui Chalk It Up [Fr]:samj_chalkitup,samj_chalkitup_preview +#@gui :_=note("Inspiré du didacticiel proposé par Lylejk") +#@gui :_=note("Inspired by the tutorial proposed by Lylejk") +#@gui :_=link("http://justpaste.it/chalk_it_up","http://justpaste.it/chalk_it_up") +#@gui :_=separator() +#@gui :_=note("Paramètres peinturage / Painting parameters") +#@gui :Abstraction=int(5,0,10) +#@gui :Précision Détails / Details Scale=float(2.5,0,10) +#@gui :Couleur / Color=float(1.5,0,5) +#@gui :Douceur / Smoothness=float(50,0,200) +#@gui :Accentuation Nuances / Sharpen Shades=bool(1) +#@gui :_=separator() +#@gui :_=note("Paramètres filtre Morpho / Morpho parameters") +#@gui :Action=choice(5,"Erosion","Dilation","Opening","Closing","Original - Erosion","Dilation - Original","Original - Opening","Closing - Original") +#@gui :Taille / Size=int(5,0,32) +#@gui :Inversion Couleurs / Invert Colors=bool(0) +#@gui :Modeler / Shape=bool(0) +#@gui :Canaux / Channel(s)=choice(7,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :_=separator() +#@gui :_=note("Paramètres filtre Spread / Spread parameters") +#@gui :X-Variations=float(0.8,-5,5) +#@gui :Y-Variations=float(1.9,-5,5) +#@gui :Canaux / Channel(s)=choice(7,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :_=separator() +#@gui :Type Aperçu=choice("Tout","Rendu En Bas","Rendu a Droite","Rendu En Haut","Rendu a Gauche") +#@gui :_=separator() +#@gui :_=note("Auteurs / Authors : Lylejk/samj/Ronounours. Dernière mise à jour : 2015/03/31.") +#@gui _Testing +#@gui Samj +#@gui Artistic +#@gui Color Edges Engrave:samj_Color_EdgesO_Engrave,samj_Color_EdgesO_Engrave(0) +#@gui :_=note("samj_Color_EdgesO_Engrave") +#@gui :_=separator() +#@gui :_=note("Edges offsets") +#@gui :Smoothness=float(0,0,10) +#@gui :Threshold=float(50,0,100) +#@gui :Scale=int(9,0,32) +#@gui :Thickness=int(1,0,16) +#@gui :_=separator() +#@gui :_=note("Engrave") +#@gui :Radius=float(2,0,4) +#@gui :Density=float(50,0,200) +#@gui :Edges=float(0,0,10) +#@gui :Cohérence=float(8,0,40) +#@gui :Threshold (%)=float(40,0,100) +#@gui :Minimal Area=int(0,-256,256) +#@gui :Flat Regions Removal=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Variations") +#@gui :Areas=float(1,0.8,1.2) +#@gui :Invert Areas=bool(0) +#@gui :Segment=int(0,0,15) +#@gui :Add=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/25.") +#@gui Contour Drawings:samj_Contour_Drawings_en,samj_Contour_Drawings_en (1) +#@gui :_=separator() +#@gui :_=note("Contour") +#@gui :Isophotes=int(5,3,16) +#@gui :Smoothness=float(0,0,5) +#@gui :Dilate=int(2,0,5) +#@gui :Color Autoindex=int(0,0,64) +#@gui :To Gray=bool(0) +#@gui :_=separator() +#@gui :_=note("Smooth [antialias]") +#@gui :Amplitude=float(5,0,100) +#@gui :Edge Threshold (%)=float(10,0,100) +#@gui :Smoothness=float(0.8,0,5) +#@gui :_=separator() +#@gui :_=note("Background") +#@gui :Background=bool(0) +#@gui :Color=float(1.1,0,1.2) +#@gui :Variation=int(10,2,200) +#@gui :_=separator() +#@gui :_=note("Chalk") +#@gui :Chalk=bool(0) +#@gui :Spread=float(1,0,4) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2016/11/18.") +#@gui Contour Epais:samj_Contour_Epais,samj_Contour_Epais (1) +#@gui :_=separator() +#@gui :_=note("Edges") +#@gui :Itérations=int(1,1,5) +#@gui :Flou/Blur=float(0,0,5) +#@gui :Edges %=float(5,0,100) +#@gui :_=separator() +#@gui :_=note("Isophotes") +#@gui :Validation=bool(1) +#@gui :Isophotes=int(5,4,7) +#@gui :_=separator() +#@gui :_=note("Smooth [antialias]") +#@gui :Amplitude=float(5,0,100) +#@gui :Edge Threshold (%)=float(10,0,100) +#@gui :Smoothness=float(0.8,0,5) +#@gui :_=separator() +#@gui :_=note("Rendu") +#@gui :Épaisseur=int(2,0,10) +#@gui :Type Rendu=int(1,1,6) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/14.") +#@gui Couleurs Rayees:samj_Couleurs_Rayees,samj_Couleurs_Rayees (1) +#@gui :_=separator() +#@gui :_=note("Avant plan") +#@gui :Lumin=bool(0) +#@gui :Pixélisation=int(30,8,100) +#@gui :Flou=float(0,0,10) +#@gui :PA=int(100,1,255) +#@gui :DeformA=int(4,-16,16) +#@gui :DeformB=int(4,-16,16) +#@gui :Couleur=int(0,0,255) +#@gui :Itérations=int(2,1,4) +#@gui :Puissance=float(0.7,0.1,2) +#@gui :Equalize=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/14.") +#@gui Couleurs Rayees 2:samj_Couleurs_Rayees_2,samj_Couleurs_Rayees_2 (1) +#@gui :_=separator() +#@gui :_=note("Avant plan") +#@gui :Lumin=bool(0) +#@gui :Pixélisation=int(30,8,100) +#@gui :Flou=float(0,0,10) +#@gui :PA=int(100,1,255) +#@gui :DeformA=int(4,-16,16) +#@gui :DeformB=int(4,-16,16) +#@gui :Limite=int(255,1,255) +#@gui :Itérations=int(1,1,4) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/07.") +#@gui Cubisme A:samj_Test_Cubisme_A,samj_Test_Cubisme_A +#@gui :_=link("Inspiration","https://fr.wikipedia.org/wiki/Portrait_de_Pablo_Picasso#/media/Fichier:Juan_Gris_-_Portrait_of_Pablo_Picasso_-_Google_Art_Project.jpg") +#@gui :_=link("Documentation","https://samjcreations.blogspot.com/2021/01/samuser-avec-gmic-gimp-filtre-cubisme-a.html") +#@gui :_=separator() +#@gui :_=note("Dilate") +#@gui :1 - Dilate=bool(1) +#@gui :2 - DiA=int(120,4,200) +#@gui :3 - DiB=int(70,4,200) +#@gui :_=note("Imagegrid Triangular") +#@gui :4 - Imagegrid=bool(1) +#@gui :5 - X=int(30,1,256) +#@gui :6 - Y=int(30,1,256) +#@gui :7 - Type=choice(2,"Horizontal","Vertical","Crossed","Cube","Decreasing","Increasing") +#@gui :_=note("Variante") +#@gui :8 - Variante=bool(0) +#@gui :9 - Noise-Spread=int(6,1,40) +#@gui :10 - Flou/Blur=float(0,0,10) +#@gui :_=note("Polygonize") +#@gui :11 - Polygonize=bool(1) +#@gui :12 - Amplitude=int(300,0,2000) +#@gui :13 - Douceur/Smoothness=float(8,0,100) +#@gui :14 - Surface Minimale/Minimal Area=float(10,0,100) +#@gui :15 - X-Resolution=float(10,1,256) +#@gui :16 - Y-Resolution=float(20,1,256) +#@gui :_=note("Kuwahara") +#@gui :17 - Kuwahara=bool(1) +#@gui :18 - Répétition/Repeat=int(1,1,4) +#@gui :19 - Size=int(5,1,50) +#@gui :_=note("Drawing-Smooth") +#@gui :20 - Drawing=bool(1) +#@gui :_=note("Brushify") +#@gui :21 - Brushify=bool(1) +#@gui :22 - Nb Dimensions/Sizes=int(64,1,128) +#@gui :23 - Opacité/Opacity=int(25,0,100) +#@gui :24 - Brosse/Brush Dimension=int(8,8,40) +#@gui :25 - Inverser/Invert=bool(1) +#@gui :_=note("Pseudo Gray") +#@gui :26 - Pseudo Gray=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2021/01/12.") +#@gui Cubisme B:samj_Test_Cubisme_B,samj_Test_Cubisme_B +#@gui :_=link("Documentation","https://samjcreations.blogspot.com/2021/01/samuser-avec-gmic-gimp-filtre-cubisme-b.html") +#@gui :_=separator() +#@gui :_=note("Decoupage Triangle A") +#@gui :1 - Tuiles=int(11,1,64) +#@gui :2 - Type Imagegrid=choice(6,"Horizontal","Vertical","Crossed","Cube","Decreasing","Increasing","All Types") +#@gui :3 - Noise-Spread=int(0,0,40) +#@gui :4 - Shift X=int(30,0,300) +#@gui :5 - Shift Y=int(40,0,300) +#@gui :_=note("Decoupage Triangle B") +#@gui :6 - Tuiles=int(17,1,64) +#@gui :7 - Type Imagegrid=choice(6,"Horizontal","Vertical","Crossed","Cube","Decreasing","Increasing,"All Types") +#@gui :8 - Noise-Spread=int(0,0,40) +#@gui :9 - Shift X=int(0,0,300) +#@gui :10 - Shift Y=int(0,0,300) +#@gui :_=note("Mélange/Blend") +#@gui :11 - Inverser/Invert A-B=bool(0) +#@gui :12 - Mode=choice(3,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Seamless","Seamless Mixed","Screen","Shapeareamax","Shapeareamax0","Shapeareamin","Shapeareamin0","Shapeaverage","Shapeaverage0","Shapemedian","Shapemedian0","Shapemin","Shapemin0","Shapemax","Shapemax0","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :13 - Opacité / Opacity=float(1,0,1) +#@gui :_=note("Brushify") +#@gui :14 - Brushify=bool(1) +#@gui :15 - Nb Dimensions/Sizes=int(64,1,128) +#@gui :16 - Opacité/Opacity=int(25,0,100) +#@gui :17 - Brosse/Brush Dimension=int(8,8,40) +#@gui :18 - Inverser/Invert=bool(1) +#@gui :_=note("Pseudo Gray") +#@gui :19 - Pseudo Gray=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2021/01/13.") +#@gui Diff Tensors Blend:samj_Diff_Tensors_Blend,samj_Diff_Tensors_Blend(1) +#@gui :_=note("samj_Diff_Tensors_Blend") +#@gui :_=separator() +#@gui :_=note("Diffusion Tensors") +#@gui :Résolution (%)=float(10,1,20) +#@gui :Size=float(5,0,16) +#@gui :Outline=int(1,0,16) +#@gui :Sharpness=float(0.15,0,1) +#@gui :Anisotropy=float(1,0,1) +#@gui :Gradient Smoothness=float(0,0,10) +#@gui :Tensor Smoothness=float(3,0,10) +#@gui :Itérations=int(1,1,10) +#@gui :_=separator() +#@gui :_=note("Flou-Blur") +#@gui :Flou/Blur=int(0,0,50) +#@gui :_=separator() +#@gui :_=note("Blend") +#@gui :Mode=choice(3,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/10/30.") +#@gui Edges And LIC:samj_Edges_And_LIC,samj_Edges_And_LIC(1) +#@gui :_=separator() +#@gui :_=note("samj_Edges_And_LIC") +#@gui :_=separator() +#@gui :_=note("Background [Step 1]") +#@gui :Rendering=choice(0,"A","B","C") +#@gui :Lic=int(200,10,1000) +#@gui :Dilate=int(0,0,2) +#@gui :Sharpen=int(0,0,5000) +#@gui :Blur=float(0,0,5) +#@gui :_=separator() +#@gui :Edges %=float(15,0,100) +#@gui :Pow=float(8,0.2,8) +#@gui :N Min=int(127,0,255) +#@gui :N Max=int(255,0,255) +#@gui :Gray=choice(0,"A","B","C","D","E","F","G") +#@gui :_=separator() +#@gui :_=note("Abstraction [Optional Step 2]") +#@gui :Abstraction=bool(0) +#@gui :Smoothness=float(1,0,10) +#@gui :Levels=int(20,2,100) +#@gui :Contrast=float(0.2,0.01,1) +#@gui :_=separator() +#@gui :_=note("Blend [Optional Step 3]") +#@gui :Blend=bool(0) +#@gui :Mode=choice(14,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Area Max","Shape Area Max0","Shape Area Min","Shape Area Min0","Shape Average","Shape Average0","Shape Min","Shape Min0","Shape Max","Shape Max0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Reverse=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2017/01/09.") +#@gui Flamboyance Test:samj_Flamboyance_Test,samj_Flamboyance_Test_preview +#@gui :_=separator() +#@gui :_=link("GMIC Adaptation of the tutorial written by Lyle Kroll","http://gimpchat.com/viewtopic.php?f=10&t=14999") +#@gui :_=note("Thank you for this beautiful and interesting effect") +#@gui :_=separator() +#@gui :_=note("Hard Sketch") +#@gui :Amplitude=float(65,0,4000) +#@gui :Density=float(28,0,100) +#@gui :Smoothness=float(9.25,0,10) +#@gui :Opacity=float(0.3,0,1) +#@gui :Edge=float(0,0,100) +#@gui :Fast Approximation=bool(1) +#@gui :Color Variation=float(1.1,0.5,2) +#@gui :_=separator() +#@gui :_=note("Smooth Bilateral") +#@gui :Spatial Variance=float(10,0,100) +#@gui :Value Variance=float(12,0,100) +#@gui :Iterations=int(2,1,10) +#@gui :_=separator() +#@gui :_=note("Blend") +#@gui :Grain Type=choice(0,"A","B","C","D") +#@gui :Iterations=int(0,0,10) +#@gui :Blend Proportion=float(1,0,1) +#@gui :Interruption Flamboyance=bool(0) +#@gui :_=separator() +#@gui :_=note("Smooth") +#@gui :Amplitude=float(150,0,1000) +#@gui :Sharpness=float(0.42,0,2) +#@gui :Anisotropy=float(0.85,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(7.83,0,10) +#@gui :Spatial Precision=float(0.68,0.1,2) +#@gui :Angular Precision=float(19,1,180) +#@gui :Value Precision=float(2.65,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Color Variation=float(1,0.5,2) +#@gui :_=separator() +#@gui :_=note("Cartoon") +#@gui :Smoothness=float(3,0,10) +#@gui :Sharpening=float(200,0,400) +#@gui :Edge Threshold=float(20,1,30) +#@gui :Edge Thickness=float(0.1,0,1) +#@gui :Color Strength=float(1.5,0,3) +#@gui :Color Quantization=int(8,2,256) +#@gui :Color Variation=float(1,0.5,2) +#@gui :_=separator() +#@gui :_=note("Blend GMIC") +#@gui :Mode=choice(3,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacity=float(1,0,1) +#@gui :Reverse=bool(0) +#@gui :Sharpen=float(20,0,500) +#@gui :Noise=float(0,0,40) +#@gui :Spread X=float(0,0,20) +#@gui :Spread Y=float(0,0,20) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Authors: Lyle Kroll and samj. Latest update: 2016/12/06.") +#@gui Fond Broderie:samj_fond_broderie,samj_fond_broderie(1) +#@gui :_=note("samj_fond_broderie") +#@gui :_=note("topographic_map") +#@gui :Levels=int(8,1,32) +#@gui :Smoothness=float(2,0,5) +#@gui :_=note("gimp_skeleton") +#@gui :Curviness=float(0,0,2) +#@gui :_=note("fx_LCE") +#@gui :Activer Fx LCE=bool(1) +#@gui :_=note("gimp_frame_blur") +#@gui :Activer Gimp Frame Blur=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/01/19.") +#@gui Fond Brosse:samj_Fond_Brosse,samj_Fond_Brosse(1) +#@gui :_=note("samj_Fond_Brosse") +#@gui :_=separator() +#@gui :_=note("Brosse") +#@gui :Brosse=int(3,2,10) +#@gui :_=separator() +#@gui :_=note("Couleur") +#@gui :Couleur=float(1,0.8,1.2) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/01/27.") +#@gui Fx Sketchbw Modifie:samj_fx_sketchbw_modifie,samj_fx_sketchbw_modifie_preview(0) +#@gui :_=separator() +#@gui :_=note("Sketch") +#@gui :Number of Orientations=int(3,1,16) +#@gui :Starting Angle=float(45,0,180) +#@gui :Angle Range=float(180,0,180) +#@gui :Stroke Length=float(30,0,1000) +#@gui :Contour Threshold=float(1.75,0,10) +#@gui :Opacity=float(0.02,0,0.3) +#@gui :Background Intensity=float(0.5,0,2) +#@gui :Density=float(0.75,0,5) +#@gui :Sharpness=float(0.1,0,1) +#@gui :Anisotropy=float(0.7,0,1) +#@gui :Smoothness=float(3,0,10) +#@gui :Cohérence=float(6,0,10) +#@gui :Boost Stroke=bool(0) +#@gui :Curved Stroke=bool(1) +#@gui :Color Model=choice(4,"Black on White","White on Black","Black on Transparent White","White on Transparent Black","Color on White") +#@gui :Forme Aléatoire=bool(0) +#@gui :Forme=int(1234,1,111111) +#@gui :_=separator() +#@gui :_=note("Smooth") +#@gui :Smooth=bool(0) +#@gui :Amplitude=int(2,1,5) +#@gui :Sharpness=int(100,0,500) +#@gui :Anisotropy=float(0.2,0,0.5) +#@gui :Sigma=float(1,0,10) +#@gui :Dl=float(4,0,10) +#@gui :Equalize=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé / ❤❤ modifications : samj. Latest update: 2018/05/15.") +#@gui Granular Texture:samj_Texture_Granuleuse,samj_Texture_Granuleuse_preview(0) +#@gui :_=note("Texture Granuleuse / Granular Texture") +#@gui :_=separator() +#@gui :Douceur / Smoothness Gradient RGB=float(0,0.5,2) +#@gui :Maximum Seuil Dégradé / Max Threshold Gradient RGB=float(20,10,50) +#@gui :_=separator() +#@gui :Amplitude Bruit / Noise=float(80.0,40,200) +#@gui :_=separator() +#@gui :Couleurs / Colors=float(0,-20,20) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/03/31.") +#@gui Gris Raye:samj_Gris_Raye,samj_Gris_Raye (1) +#@gui :_=separator() +#@gui :_=note("Avant plan") +#@gui :Lumin=bool(0) +#@gui :Pixélisation=int(30,8,100) +#@gui :Flou=float(0,0,10) +#@gui :PA=int(100,1,255) +#@gui :DeformA=int(4,-16,16) +#@gui :DeformB=int(4,-16,16) +#@gui :Limite=int(255,1,255) +#@gui :Itérations=int(1,1,4) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/11/29.") +#@gui Hallucinogen:samj_Hallucinogen,samj_Hallucinogen +#@gui :_=link("https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre.html","https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre.html") +#@gui :_=note("Filtre HallucinoGenerator") +#@gui :Autoindex=int(80,1,255) +#@gui :Flou/Blur=float(2,0,10) +#@gui :Puissance/Pow=float(80,0,100) +#@gui :Modulo=float(1.5,0.5,2) +#@gui :Adoucir/Smooth=int(2,0,5) +#@gui :Inverser/Invert=bool(0) +#@gui :Répéter Ce Filtre/Repeat=bool(0) +#@gui :_=separator() +#@gui :_=note("Brushify") +#@gui :Brushify=bool(0) +#@gui :Nb Dimensions/Sizes=int(1,1,16) +#@gui :Opacité/Opacity=int(80,0,100) +#@gui :Brosse/Brush Dimension=int(8,8,40) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/10/19.") +#@gui Hallucinogen 2:samj_Hallucinogen_b,samj_Hallucinogen_b +#@gui :_=note("Filtre Polygonize") +#@gui :Polygonize=bool(1) +#@gui :Amplitude=int(300,0,2000) +#@gui :Douceur/Smoothness=float(10,0,100) +#@gui :Surface Minimale/Minimal Area=float(10,0,100) +#@gui :X-Resolution=float(10,1,256) +#@gui :Y-Resolution=float(10,1,256) +#@gui :_=note("Filtre HallucinoGenerator") +#@gui :Autoindex=int(80,1,255) +#@gui :Flou/Blur=float(2,0,10) +#@gui :Puissance/Pow=float(80,0,100) +#@gui :Modulo=float(1.5,0.5,2) +#@gui :Adoucir/Smooth=int(2,0,5) +#@gui :Inverser/Invert=bool(0) +#@gui :Répéter Ce Filtre/Repeat=bool(0) +#@gui :_=note("Brushify") +#@gui :Brushify=bool(1) +#@gui :Nb Dimensions/Sizes=int(1,1,16) +#@gui :Opacité/Opacity=int(80,0,100) +#@gui :Brosse/Brush Dimension=int(8,8,40) +#@gui :_=note("Blend") +#@gui :Blend=bool(1) +#@gui :Inverser Calques/Reverse Layers=bool(0) +#@gui :Mode=choice(14,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Seamless","Seamless Mixed","Screen","Shapeareamax","Shapeareamax0","Shapeareamin","Shapeareamin0","Shapeaverage","Shapeaverage0","Shapemedian","Shapemedian0","Shapemin","Shapemin0","Shapemax","Shapemax0","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/11/25.") +#@gui Impressions:samj_Impressions,samj_Impressions(1) +#@gui :_=note("Spread") +#@gui :Spread=float(10,0,50) +#@gui :_=note("Textured Glass") +#@gui :X-Amplitude=float(5,0,400) +#@gui :Y-Amplitude=float(5,0,400) +#@gui :X-Smoothness=float(1,0,5) +#@gui :Y-Smoothness=float(1,0,5) +#@gui :Edge Atténuation=float(0,0,1) +#@gui :Edge Influence=float(2,0,10) +#@gui :Noise Scale=int(0,0,16) +#@gui :_=note("Abstraction") +#@gui :Itérations=int(1,1,3) +#@gui :_=note("Abstraction Dog") +#@gui :Sigma 1=float(5,0,10) +#@gui :Sigma 2=float(0,0,10) +#@gui :_=note("Abstraction Segment Watershed") +#@gui :Threshold=float(5,0,10) +#@gui :_=note("Abstraction Smooth") +#@gui :Amplitude=float(100,0,200) +#@gui :_=note("Abstraction Noise") +#@gui :Amplitude=float(2,0,10) +#@gui :Type=choice(4,"Gaussian","Uniform","Salt and Pepper","Poisson","Rice") +#@gui :_=note("Blend") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=note("Sharpen") +#@gui :Amplitude=int(250,0,500) +#@gui :_=note("Couleurs") +#@gui :Couleurs=float(1.2,0.1,5) +#@gui :_=separator() +#@gui :_=note("samj Dernière mise à jour : 2016/01/19.") +#@gui Isophotes Vers Aquarelle:samj_Isophotes_Vers_Aquarelle,samj_Isophotes_Vers_Aquarelle (1) +#@gui :_=note("Isophotes") +#@gui :Nb Décomposition Couleurs=int(16,2,32) +#@gui :Variation Flou=float(0.5,0.1,2) +#@gui :Isophotes=int(4,3,16) +#@gui :Dilate=int(0,0,8) +#@gui :_=note("Segmentation") +#@gui :Segmentation=bool(1) +#@gui :Edge Threshold=float(10,0,30) +#@gui :Smoothness=float(1,0,5) +#@gui :Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=note("Contours") +#@gui :Flou=float(0,0,2) +#@gui :Couleurs=float(0,-2,2) +#@gui :_=note("Fond") +#@gui :Fond=bool(1) +#@gui :Amplitude Noise=float(10,5,200) +#@gui :Density Hardsketchbw=float(10,5,100) +#@gui :Spread Variations=float(4,3,20) +#@gui :Amplitude Water=float(3,2,10) +#@gui :Couleur / Color=color(#fbedce) +#@gui :Opacité / Opacity=float(1,-1,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2017/01/20.") +#@gui Plasmic:samj_Plasmic,samj_Plasmic(1) +#@gui :_=note("Plasmic filter is based on a composition of Lylejk") +#@gui :_=link("https://www.flickr.com/photos/34520999@N05/24513476052/sizes/o/","https://www.flickr.com/photos/34520999@N05/24513476052/sizes/o/") +#@gui :_=separator() +#@gui :_=note("Blur") +#@gui :Blur=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Contours") +#@gui :Pow=float(1.1,0.2,2) +#@gui :_=separator() +#@gui :_=note("Segment") +#@gui :Edge Threshold=float(2,0,15) +#@gui :_=separator() +#@gui :_=note("Cut") +#@gui :Cut=int(40,0,255) +#@gui :_=separator() +#@gui :_=note("Dilate") +#@gui :Dilate Contours=int(0,0,16) +#@gui :_=separator() +#@gui :_=note("Plasma") +#@gui :Plasmic=int(0,0,20) +#@gui :_=separator() +#@gui :_=note("Dégradation Deform") +#@gui :Deform=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Dégradation Spread") +#@gui :Spread=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2016/02/03.") +#@gui Plasmic V2:samj_Plasmic_V2,samj_Plasmic_V2(0) +#@gui :_=note("samj_Plasmic_V2") +#@gui :_=separator() +#@gui :_=note("Plasma") +#@gui :Plasmic=int(2,-20,20) +#@gui :_=separator() +#@gui :_=note("Lines") +#@gui :Thickness=int(4,1,32) +#@gui :Accuracy=int(10,1,32) +#@gui :Coeff. Accuracy=float(2,0.1,8) +#@gui :Coeff. Blur=float(0.02,0,1) +#@gui :Isophotes=int(8,2,32) +#@gui :_=separator() +#@gui :_=note("Dégradation Deform") +#@gui :Deform=float(0,-200,200) +#@gui :_=separator() +#@gui :_=note("Dilate") +#@gui :Dilate Contours=int(0,0,16) +#@gui :_=separator() +#@gui :_=note("Dégradation Spread") +#@gui :Spread=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Background") +#@gui :Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2020/10/24.") +#@gui Pointillisme:samj_Pointillisme,samj_Pointillisme (1) +#@gui :_=separator() +#@gui :_=note("Points") +#@gui :Intensite=int(10,1,100) +#@gui :Densité=float(2,0,100) +#@gui :Dimension=int(5,2,20) +#@gui :Rond Vs Carré=bool(1) +#@gui :Variation=float(1,0.2,2) +#@gui :_=separator() +#@gui :_=note("Arriere plan") +#@gui :Fond Transparent=bool(1) +#@gui :Couleur=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/08.") +#@gui Pointillisme B:samj_Pointillisme_B,samj_Pointillisme_B (1) +#@gui :_=separator() +#@gui :_=note("Couleurs") +#@gui :Variation=float(1,0.2,2) +#@gui :Dilatation=int(0,0,16) +#@gui :Pixels=float(90,0,100) +#@gui :_=separator() +#@gui :_=note("Points") +#@gui :Dimension=int(3,0,20) +#@gui :Rond Vs Carré=bool(1) +#@gui :_=separator() +#@gui :_=note("Arriere plan") +#@gui :Fond Transparent=bool(1) +#@gui :Couleur=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/14.") +#@gui Posterize B:samj_Posterize_B,samj_Posterize_B(0) +#@gui :_=separator() +#@gui :_=note("Posterize B") +#@gui :Blur=float(1,0,5) +#@gui :Colors=int(12,2,32) +#@gui :Inpaint Holes=float(1,0.1,5) +#@gui :Smooth=int(0,0,8) +#@gui :Smooth - Smoothness=float(40,10,800) +#@gui :Smooth - Edges (%)=float(30,0,100) +#@gui :Smooth - Paint=float(1,0,10) +#@gui :Sharpen=int(0,0,5000) +#@gui :Normalize Colors=bool(0) +#@gui :_=separator() +#@gui :_=note("Contours Difference") +#@gui :Contours Difference=bool(0) +#@gui :XY-Offset=choice(0,"1 1","1 -1","-1 1","-1 -1","0 1","1 0","0 -1","-1 0") +#@gui :Thickness=int(1,1,8) +#@gui :Dithering=bool(0) +#@gui :Erasure Grid=int(0,0,16) +#@gui :Vivid Light - Type=choice(0,"No","Vivid Light 1","Vivid Light 2","Vivid Light 3") +#@gui :Vivid Light - Colors=int(0,0,200) +#@gui :Black and White=bool(0) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/10/24.") +#@gui Samj Ripple Houghsketchbw:samj_ripple_houghsketchbw,samj_ripple_houghsketchbw_preview(0)* +#@gui :_=separator() +#@gui :_=note("Blur") +#@gui :1 - Blur=float(2,0.1,10) +#@gui :_=note("Ripple") +#@gui :2 Amplitude=int(100,1,300) +#@gui :3 Bandwidth=float(50,1,300) +#@gui :4 Shape=choice(1,"Sine","Sine+") +#@gui :5 Angle=float(45,0,360) +#@gui :6 Offset=float(0,0,500) +#@gui :_=note("houghsketchbw") +#@gui :7 Density=float(10,0,70) +#@gui :8 Radius=int(5,0,30) +#@gui :9 Threshold=float(80,0,100) +#@gui :10 Opacity=float(0.1,0,1) +#@gui :11 Votesize=float(100,10,200) +#@gui :_=note("Color") +#@gui :12 Blend Color=bool(1) +#@gui :13 Mode=choice(17,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Seamless","Seamless Mixed","Screen","Shapeareamax","Shapeareamax0","Shapeareamin","Shapeareamin0","Shapeaverage","Shapeaverage0","Shapemedian","Shapemedian0","Shapemin","Shapemin0","Shapemax","Shapemax0","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :14 Opacity=float(1,0,1) +#@gui :15 Reverse Layers=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/05/28.") +#@gui ___Artistic +#@gui Skeletik:samj_Test_Skeletik,samj_Test_Skeletik(0) +#@gui :_=note("samj_Test_Skeletik") +#@gui :_=separator() +#@gui :_=note("Lines - Cobweb") +#@gui :Itérations=int(10,1,50) +#@gui :Skeleton=int(1,1,20) +#@gui :Deform=float(0,0,200) +#@gui :Dilate=int(0,0,16) +#@gui :Spread=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Blend") +#@gui :Mode=choice(3,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Area Max","Shape Area Max0","Shape Area Min","Shape Area Min0","Shape Average","Shape Average0","Shape Min","Shape Min0","Shape Max","Shape Max0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :_=separator() +#@gui :_=note("Colors") +#@gui :Lines=float(1,0.75,1.25) +#@gui :Background Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2019/12/14.") +#@gui _Testing +#@gui Samj +#@gui Artistic +#@gui Tensor Test:samj_TensorTest,samj_TensorTest(1) +#@gui :_=note("Tensor Test") +#@gui :_=separator() +#@gui :_=note("diffusiontensors") +#@gui :Sharpness=float(0.3,0,1) +#@gui :Anisotropy=float(0.9,0,1) +#@gui :Alpha=float(0.6,0,100) +#@gui :Sigma=float(1.1,0,100) +#@gui :Is Sqrt=bool(0) +#@gui :_=separator() +#@gui :_=note("ABS") +#@gui :Abs=bool(0) +#@gui :_=separator() +#@gui :_=note("resize2dx") +#@gui :SizeX=int(20,8,64) +#@gui :_=separator() +#@gui :_=note("display tensors") +#@gui :Size Factor=int(32,16,128) +#@gui :Ellipse Size=float(20,0,100) +#@gui :Color Mode=choice(2,"Monochrome","Grayscale","Color") +#@gui :Outline=bool(1) +#@gui :_=separator() +#@gui :_=note("Couleur") +#@gui :Couleur=float(0,0,2) +#@gui :_=separator() +#@gui :_=note("Resize") +#@gui :Resize=choice(2,"Non RVBA","Oui RVB","Oui RVBA") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/11/01.") +#@gui Texture Coloree:samj_texture_coloree,samj_texture_coloree(1) +#@gui :_=note("samj_texture_coloree") +#@gui :_=note("diffusiontensors") +#@gui :Type=choice("A","B","C","D","E","F") +#@gui :Sharpness=float(0.7,0.2,2) +#@gui :_=note("Color") +#@gui :Fond / Background Color=color(#c87d32) +#@gui :_=note("Blur Linear") +#@gui :Amplitude A=float(5,0,10) +#@gui :Amplitude B=float(5,0,100) +#@gui :Angle=float(45,0,360) +#@gui :_=note("Sharpen") +#@gui :Amplitude S=int(200,50,1000) +#@gui :_=note("Blend") +#@gui :Itérations=int(4,1,8) +#@gui :Opacité / Opacity=float(0.2,0,0.3) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/04/05.") +#@gui Variations on a Single Color:samj_texture_coloree_en,samj_texture_coloree_en(1) +#@gui :_=note("Variations On A Single Color") +#@gui :_=note("Diffusion Tensors") +#@gui :Type=choice("A","B","C","D","E","F") +#@gui :Sharpness=float(0.7,0.2,1) +#@gui :_=note("Color") +#@gui :Single Color=color(#c87d32) +#@gui :_=note("Blur Linear") +#@gui :Amplitude A=float(5,0,10) +#@gui :Amplitude B=float(5,0,100) +#@gui :Angle=float(45,0,360) +#@gui :_=note("Sharpen") +#@gui :Amplitude S=int(200,50,1000) +#@gui :_=note("Blend") +#@gui :Iterations=int(4,1,8) +#@gui :Opacity=float(0.2,0,0.3) +#@gui :_=note("Richardson Lucy") +#@gui :Sigma=float(1,0.5,10) +#@gui :Iterations=int(10,0,100) +#@gui :Blur=choice(1,"Exponential","Gaussian") +#@gui :Cut=bool(true) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2015/04/13.") +#@gui _Black & White +#@gui Colored Engraving:Engrave_colore,Engrave_colore(1) +#@gui :_=note("Modification du Filtre de Lyle Kroll et David Tschumperlé") +#@gui :_=note("pour obtenir des gravures colorées - samj 20150321") +#@gui :_=separator() +#@gui :Exemples / Examples=choice(0,"Non / None","A","B","C","D ***","E","F","G") +#@gui :_=note("Gravure / Engraving") +#@gui :Radius=float(0.5,0,2) +#@gui :Densité A=float(4,0,10) +#@gui :Edges=float(0,0,10) +#@gui :Cohérence=float(8,0,40) +#@gui :Threshold (%)=float(40,0,100) +#@gui :Minimal Area=int(0,-256,256) +#@gui :Répétition=int(25,0,50) +#@gui :_=note("Anti-aliasing") +#@gui :Anti-Aliasing=choice(1,"Disabled","A","B","C") +#@gui :_=note("Couleurs / Colors") +#@gui :Gravure / Engraving=choice(2,"Avant Plan","Image Avec Contours Des Couleurs 8","Image Avec Contours Des Couleurs 16","Image Avec Contours Des Couleurs 32","Image Avec Contours Des Couleurs 64","Image Sans Contours Des Couleurs 8","Image Sans Contours Des Couleurs 16","Image Sans Contours Des Couleurs 32","Image Sans Contours Des Couleurs 64","3 Calques - Image Sans Contours Des Couleurs 8","3 Calques - Image Sans Contours Des Couleurs 16","3 Calques - Image Sans Contours Des Couleurs 32","3 Calques - Image Sans Contours Des Couleurs 64") +#@gui :Avant Plan=color(#000000) +#@gui :Fond / Background Color=color(#ffffff) +#@gui :_=separator() +#@gui :_=note("Authors: Lyle Kroll and David Tschumperlé . Latest update: 2020/10/24.") +#@gui Engrave Modifie:engrave_modifie,engrave_modifie(1) +#@gui :_=note("Aussi pour obtenir des contours") +#@gui :Exemples / Examples=choice(0,"Non / None","A","B","C","D ***","E","F","G") +#@gui :_=note("Black & White foreground:") +#@gui :Radius=float(0.5,0,2) +#@gui :Densité A=float(4,0,10) +#@gui :Edges=float(0,0,10) +#@gui :Cohérence=float(8,0,40) +#@gui :Threshold (%)=float(40,0,100) +#@gui :Minimal Area=int(0,-256,256) +#@gui :Répétition=int(25,0,50) +#@gui :_=separator() +#@gui :Anti-Aliasing=choice(1,"Disabled","X1.5","X2","X3") +#@gui :_=separator() +#@gui :_=note("Authors: Lyle Kroll and David Tschumperlé. Latest update: samj 2015/03/20.") +#@gui Grid BW Color:samj_Grid_BW_Color,samj_Grid_BW_Color +#@gui :_=link("https://samjcreations.blogspot.com/2020/12/samuser-avec-gmic-gimp-filtre-grid-bw.html","https://samjcreations.blogspot.com/2020/12/samuser-avec-gmic-gimp-filtre-grid-bw.html") +#@gui :1 Flou/Blur=float(3,0,10) +#@gui :2 - Adoucir/Smooth=int(0,0,5000) +#@gui :_=note("Grille/Grid") +#@gui :3 - Grille/Grid=choice(1,"Non/No","Rectangle","Triangle","Hexagone Paramètre 4","Rectangle Sans Contour","Triangle Sans Contour","Hexagone Sans Contour Paramètre 4") +#@gui :4 - X Grille/Grid=int(4,2,64) +#@gui :5 - Y Grille/Grid=int(4,2,64) +#@gui :_=note("Fond Noir/Black Background") +#@gui :6 - Noir/Black=int(32,16,160) +#@gui :7 - Negate=bool(1) +#@gui :8 - Index=int(2,2,8) +#@gui :_=note("Couleur/Color") +#@gui :9 - Color=bool(0) +#@gui :10 - Index=int(32,2,32) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/12/19.") +#@gui Hard Sketch XY:XY_hardsketchbw_samj,XY_hardsketchbw_samj(0) +#@gui :_=separator() +#@gui :_=note("Paramètres Filtre Hard Sketch BW") +#@gui :XY=float(0.2,0,1) +#@gui :Densité / Amplitude=float(300,0,4000) +#@gui :Density / Density=float(50,0,100) +#@gui :Douceur / Smoothness=float(1,0,10) +#@gui :Opacité / Opacity=float(0.1,0,1) +#@gui :Bordure / Edge=float(20,0,100) +#@gui :Approximation Rapide / Fast Approximation=bool(0) +#@gui :Color Model=choice("Black on White","White on Black","Black on Transparent White","White on Transparent Black","Color on White") +#@gui :_=separator() +#@gui :_=note("Calques / Layers") +#@gui :Nb.=choice(0,"1 : XY","2 : XY + Hard Sketch BW Normal") +#@gui :_=separator() +#@gui :_=note("Netteté / Sharpen") +#@gui :Filtre Octave Sharpening=bool(0) +#@gui :_=separator() +#@gui :_=note("XY_hardsketch Color") +#@gui :Couleur / Color=color(#b428a0ff) +#@gui :Remplir / Fill=bool(0) +#@gui :_=separator() +#@gui :_=note("samj Dernière mise à jour : 2015/03/10.") +#@gui Masques B&W Masks:samj_Masques_Noir_Et_Blanc,samj_Masques_Noir_Et_Blanc_Preview +#@gui :_=separator() +#@gui :_=note("Création de 2 masques : Noir/Transparent et Blanc/Transparent") +#@gui :_=note("Create 2 masks : Black/Transparent and White/Transparent") +#@gui :1 - Flou/Blur=float(3,0,10) +#@gui :2 - Masque/Mask %=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/03/06.") +#@gui NB Edges Engrave:samj_NB_EdgesO_Engrave,samj_NB_EdgesO_Engrave(0) +#@gui :_=note("samj_NB_EdgesO_Engrave") +#@gui :_=separator() +#@gui :_=note("Edges offsets") +#@gui :Smoothness=float(0,0,10) +#@gui :Threshold=float(50,0,100) +#@gui :Scale=int(9,0,32) +#@gui :Thickness=int(1,0,16) +#@gui :_=separator() +#@gui :_=note("Engrave") +#@gui :Radius=float(2,0,4) +#@gui :Density=float(50,0,200) +#@gui :Edges=float(0,0,10) +#@gui :Cohérence=float(8,0,40) +#@gui :Threshold (%)=float(40,0,100) +#@gui :Minimal Area=int(0,-256,256) +#@gui :Flat Regions Removal=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Variation") +#@gui :Variation=float(1,0.8,1.2) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/24.") +#@gui Scintillements:samj_scintillements,samj_scintillements(1) +#@gui :_=note("samj_scintillements") +#@gui :Exemples=choice("Non","A","B","C","D Image Noire","E Image Noire - Scintillements","F Image Noire - Stars") +#@gui :_=note("Dog") +#@gui :Sigma 1=float(5,0,10) +#@gui :Sigma 2=float(0,0,10) +#@gui :Itérations=int(1,1,8) +#@gui :_=note("Noise") +#@gui :Variation=int(20,0,100) +#@gui :Type=choice(2,"Gaussian","Uniform","Salt and Pepper","Poisson","Rice") +#@gui :_=note("Circle") +#@gui :Amplitude=int(6,3,20) +#@gui :_=note("Blur Linear") +#@gui :Amplitude A=float(20,0,100) +#@gui :Amplitude B=float(5,0,100) +#@gui :Angle=float(45,0,120) +#@gui :_=note("Local normalization") +#@gui :Amplitude=float(2,0,60) +#@gui :Radius=int(6,1,64) +#@gui :Neighborhood Smoothness=float(5,0,40) +#@gui :Average Smoothness=float(20,0,40) +#@gui :Constrain Values=bool(1) +#@gui :Channel(s)=choice(7,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :_=note("Couleurs") +#@gui :Inverser Couleur=bool(0) +#@gui :Dégradation=float(0,-50,50) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/01/19.") +#@gui _Colors +#@gui 64 Couleurs Max:samj_64_Couleurs_Max,samj_64_Couleurs_Max(0) +#@gui :_=link("https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre-64.html","https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre-64.html") +#@gui :Graine/Seed=int(9,0,65536) +#@gui :Nb. Max. Couleurs/Colors=int(4,2,64) +#@gui :Flou/Blur=float(2,0,100) +#@gui :Netteté/Sharpen=float(50,0,100) +#@gui :Map Sur Gris/On Gray=bool(1) +#@gui :_=separator() +#@gui :_=note("Palette de couleurs predefinie/Preset color palette") +#@gui :Palette Prédéfinie/Preset Color=choice(0,"Non/No","Palette Origine","N&B-Gris/B&W-Grey","B&N-Gris/W&B-Grey","Choix/Choice 2 Colors A B","Choix/Choice 2 Colors B A") +#@gui :Couleur - Color A=color(#f0f028) +#@gui :Couleur - Color B=color(#7828f0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/10/18.") +#@gui 9 Colors:samj_test_9_colors,samj_test_9_colors +#@gui :_=link("https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre-9-colors.html","https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre-9-colors.html") +#@gui :_=link("https://discuss.pixls.us/t/help-with-gmic-map-command/20801","https://discuss.pixls.us/t/help-with-gmic-map-command/20801") +#@gui :Couleur/Color 1=color(#46110a) +#@gui :Couleur/Color 2=color(#862314) +#@gui :Couleur/Color 3=color(#9a1b3a) +#@gui :Couleur/Color 4=color(#ba3d59) +#@gui :Couleur/Color 5=color(#dc6781) +#@gui :Couleur/Color 6=color(#ef97a9) +#@gui :Couleur/Color 7=color(#f6c2cd) +#@gui :Couleur/Color 8=color(#fdc9d4) +#@gui :Couleur/Color 9=color(#ffffff) +#@gui :Flou/Blur=float(0,0,5) +#@gui :Netteté/Sharpen=float(0,0,200) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/10/19.") +#@gui At06A 2017 VarCouleurs:samj_At06A_2017_VarCouleurs,samj_At06A_2017_VarCouleurs(1) +#@gui :_=separator() +#@gui :_=note("samj_At06A_2017_VarCouleurs") +#@gui :Puissance=float(1,0,8) +#@gui :Couper A %=float(0,0,100) +#@gui :Couper B %=float(100,0,100) +#@gui :Noir Et Blanc=choice(0,"Non","To Gray","Lightness - Lab") +#@gui :Normaliser=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2017/02/27.") +#@gui Color Harmonies:samj_Color_Palettes,samj_Color_Palettes(1) +#@gui :_=separator() +#@gui :_=note("samj_Color_Palettes") +#@gui :_=separator() +#@gui :_=note("Geometry") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Tilt Angle=float(0,0,360) +#@gui :Radius Center Circle=float(6,0,100) +#@gui :Number Of Shades Per Circle=int(24,16,90) +#@gui :Angle Offset Rings=float(0,0,360) +#@gui :Variation Dimension=float(0,-100,200) +#@gui :_=separator() +#@gui :_=note("Color - Palettes") +#@gui :Reference Color=color(#b45a2d) +#@gui :Fill Color=bool(1) +#@gui :RGB XYZ Matrices=int(3,0,15) +#@gui :XYZ Tristimulus=int(2,0,18) +#@gui :Outline Reference Color=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2020/10/24.") +#@gui Couleurs Metalliques:Couleurs_Metalliques,Couleurs_Metalliques_preview +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Transparence / Transparency=choice(0,"Conserver / Preserve","Supprimer / Remove") +#@gui :Rendu / Rendering=choice("YCbCr [luminance]","Lab [lightness]","HSV [value]","HSL [lightness]","Linear RGB [all]","RGB [all]","RGB [all]") +#@gui :_=separator() +#@gui :_=note("Paramètres Filtre Noise - Noise parameters") +#@gui :Amplitude=float(22,0,200) +#@gui :Type De Bruit / Noise Type=choice("Gaussian","Uniform","Salt and Pepper","Poisson") +#@gui :Étendue / Value Range=choice("Cut","Normalize") +#@gui :_=separator() +#@gui :_=note("Paramètres Filtre Local normalization - Local normalization parameters") +#@gui :Double Effet=bool(0) +#@gui :Amplitude=float(0,0,60) +#@gui :Rayon / Radius=int(6,1,64) +#@gui :Lissage Voisinage / Neighborhood Smoothness=float(5,0,40) +#@gui :Lissage Moyenne / Average Smoothness=float(20,0,40) +#@gui :Imposer Valeurs / Constrain Values=bool(1) +#@gui :Canaux / Channel(s)=choice(0,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :_=separator() +#@gui :_=note("Paramètres Filtre Boost-Fade - Boost-Fade parameters : Siif Amplitude Sup. 0") +#@gui :Amplitude=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("PhotoComix Options") +#@gui :Utiliser / Use PC Options=bool(0) +#@gui :Filtre Pencilbw Taille / Size=float(0.3,0,5) +#@gui :Filtre Pencilbw Amplitude=float(60,0,200) +#@gui :Opacité Mélange / Blend Opacity=float(1,0,1) +#@gui :Mélange Permuter Calques / Blend Revert Layers=bool(1) +#@gui :_=separator() +#@gui :_=separator() +#@gui :Type Aperçu=choice("Tout","Rendu En Bas","Rendu a Droite","Rendu En Haut","Rendu a Gauche") +#@gui :_=separator() +#@gui :_=note("samj Dernière mise à jour : 2015/03/31.") +#@gui Dorure Gilding:samj_Dorure,samj_Dorure +#@gui :_=link("https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre-dorure.html","https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre-dorure.html") +#@gui :_=note("Relief Light") +#@gui :_=note("Obtenir une couleur dorée ou cuivrée par Lightness et Darkness.") +#@gui :_=note("Obtain a golden or copper color by Lightness et Darkness.") +#@gui :Ambient Lightness=float(0.4,0.2,0.7) +#@gui :Specular Lightness=float(0.2,0,2) +#@gui :Specular Size=float(0.2,0,1) +#@gui :Darkness=float(0,0,1) +#@gui :Light Smoothness=float(1,0,5) +#@gui :XY-Light=point(20,20,0,1,255,255,128,200,10) +#@gui :Z-Light=float(0,0,20) +#@gui :Z-Scale=float(0.5,0,3) +#@gui :_=note("Dorure/Gilding") +#@gui :Inverser/Invert Relief=bool(0) +#@gui :Adoucir/Smooth=int(60,0,200) +#@gui :Large Image=bool(0) +#@gui :Flou/Blur=float(0,0,5) +#@gui :Netteté/Sharpen=float(100,0,200) +#@gui :Aspect=float(45,0,360) +#@gui :Map 1=int(18,2,64) +#@gui :Map 2=int(32,2,255) +#@gui :Map 3=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/03/04.") +#@gui Samj Remplir Fill Flood:samj_Remplir_Fill_Flood,samj_Remplir_Fill_Flood(1) +#@gui :_=separator() +#@gui :_=note("Position") +#@gui :1 2 - Origine Flood/Remplissage=point(50,50,0,1,255,255,0,-128,1%) +#@gui :_=note("Remplissage/Filling") +#@gui :3 4 5 6 - Couleur/Color=color(#ff0000ff) +#@gui :7 - Seuil/Threshold=float(20,0,255) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/05/04.") +#@gui Samj Test Shapeprevalent:samj_test_shapeprevalent,samj_test_shapeprevalent +#@gui :_=separator() +#@gui :1 - Flou/Blur=float(2,1,5) +#@gui :2 - Quantize=int(32,4,128) +#@gui :3 - Surface/Area=int(50,2,100) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/03/18.") +#@gui Samj Topographie Eliminate Contour Lines:samj_Topographie_Eliminate_Contour_Lines,samj_Topographie_Eliminate_Contour_Lines_preview(0)* +#@gui :_=separator() +#@gui :_=link("discuss.pixls.us","https://discuss.pixls.us/t/is-there-a-way-to-filter-out-lines-that-are-within-a-common-color/36840") +#@gui :_=link("Cartes/GPS Nautical Charts","https://www.gpsnauticalcharts.com/") +#@gui :_=separator() +#@gui :_=note("Chercher/Look For Minimum") +#@gui :1 - Dilate/Erode=int(10,1,30) +#@gui :_=note("Couleur/Color 1 Masque/Mask") +#@gui :2 3 4 - Couleur/Color 1=color(#98c5f2) +#@gui :5 - Minimum Precision Couleur/Color 1=float(10,0,100) +#@gui :_=note("Couleur/Color 2 Masque/Mask") +#@gui :6 7 8 - Couleur/Color 2=color(#72b6ef) +#@gui :9 - Minimum Precision Couleur/Color 2=float(90,0,100) +#@gui :_=separator() +#@gui :_=note("Lignes/Lines 1") +#@gui :10 11 12 - Lignes/Lines 1=color(#5c5f62) +#@gui :13 - Minimum Precision Lignes/Lines 1=float(30,0,100) +#@gui :_=note("Lignes/Lines 2") +#@gui :14 15 16 - Lignes/Lines 2=color(#85a4c4) +#@gui :17 - Minimum Precision Lignes/Lines 2=float(10,0,100) +#@gui :_=note("Lignes/Lines 3") +#@gui :18 19 20 - Lignes/Lines 3=color(#788fa6) +#@gui :21 - Minimum Precision Lignes/Lines 3=float(10,0,100) +#@gui :_=note("Texte/Text") +#@gui :22 23 24 - Texte/Text=color(#1600f5) +#@gui :25 - Minimum Precision Texte/Text=float(60,0,100) +#@gui :_=separator() +#@gui :_=note("Finition") +#@gui :26 - Finition/Finishing=bool(1) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Pour améliorer les finitions essayer le filtre Select-Replace Color par David Tschumperlé.") +#@gui :_=note("To improve finishes try the Select-Replace Color filter by David Tschumperlé.") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/05/03.") +#@gui Valeur Moyenne LCH:samj_Valeur_Moyenne_LCH,samj_Valeur_Moyenne_LCH_Preview(0) +#@gui :_=separator() +#@gui :_=link("http://colormine.org/convert/rgb-to-lch","http://colormine.org/convert/rgb-to-lch") +#@gui :_=separator() +#@gui :_=note("samj_Valeur_Moyenne_LCH") +#@gui :Dimension Echantillon Image=int(400,10,800) +#@gui :_=link("http://www.brucelindbloom.com/Eqn_RGB_XYZ_Matrix.html","http://www.brucelindbloom.com/Eqn_RGB_XYZ_Matrix.html") +#@gui :RGB XYZ Matrices=choice(14,"0 Adobe RGB 1998 D65","1 AppleRGB D65","2 Best RGB D50","3 Beta RGB D50","4 Bruce RGB D65","5 CIE RGB E","6 ColorMatch RGB D50","7 Don RGB 4 D50","8 ECI RGB D50","9 Ekta Space PS5 D50 ","10 NTSC RGB C","11 PAL SECAM RGB D65","12 ProPhoto RGB D50","13 SMPTE C RGB D65","14 Observateur 2deg Illuminant D65 SRGB REF","15 Wide Gamut RGB D50") +#@gui :XYZ Tristimulus=choice(4,"0 2deg CIE 1931 A Incandescent","1 2deg CIE 1931 C","2 2deg CIE 1931 D50","3 2deg CIE 1931 D55","4 2deg CIE 1931 D65 Daylight REF","5 2deg CIE 1931 D75","6 2deg CIE 1931 F2 Fluorescent","7 2deg CIE 1931 F7","8 2deg CIE 1931 F11","9 RIEN NONE","10 10deg CIE 1964 A Incandescent","11 10deg CIE 1964 C","12 10deg CIE 1964 D50","13 10deg CIE 1964 D55","14 10deg CIE 1964 D65 Daylight ","15 10deg CIE 1964 D75 ","16 10deg CIE 1964 F2 Fluorescent ","17 10deg CIE 1964 F7 ","18 10deg CIE 1964 F11") +#@gui :_=separator() +#@gui :_=note("Fichier Sauvegarde File") +#@gui :Output Folder=_folder() +#@gui :Output Filename=_text("samj_Valeur_Moyenne_LCH.txt") +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2019/03/26.") +#@gui Variations RVB:samj_Variations_RVB,samj_Variations_RVB(1) +#@gui :_=separator() +#@gui :_=note("samj_Variations_RVB") +#@gui :_=separator() +#@gui :_=note("Geometry") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Tilt Angle=float(0,0,360) +#@gui :Radius Center Circle=float(6,0,100) +#@gui :Angle Offset Rings=float(0,0,360) +#@gui :Variation Dimension=float(0,-100,200) +#@gui :_=separator() +#@gui :_=note("Variations RVB") +#@gui :Reference Color=color(#b45a2d) +#@gui :Fill Color=bool(0) +#@gui :Outline Reference Color=bool(1) +#@gui :Type Variation=int(0,0,20) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2020/10/24.") +#@gui _Contours +#@gui Carte De Repoussage:samj_Carte_De_Repoussage,samj_Carte_De_Repoussage(0) +#@gui :_=separator() +#@gui :_=note("15 Matrices Emboss Pivotees") +#@gui :Matrices Emboss=int(30,0,59) +#@gui :Gris/Gray=bool(1) +#@gui :Flou/Blur=float(0,0,32) +#@gui :Netteté/Sharpen=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/03/22.") +#@gui Colored Outlines:samj_Colored_Outlines,samj_Colored_Outlines(1) +#@gui :_=note("samj_Colored_Outlines") +#@gui :_=separator() +#@gui :_=note("Blur") +#@gui :Axes=choice(0,"XY","X","Y") +#@gui :Blur=float(2,0,10) +#@gui :_=separator() +#@gui :_=note("Isophote") +#@gui :Isophote=float(8,6,16) +#@gui :_=separator() +#@gui :_=note("Smooth") +#@gui :Smooth=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("Dilate") +#@gui :Dilate=int(0,0,16) +#@gui :_=separator() +#@gui :_=note("Background") +#@gui :Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/01/29.") +#@gui Coloriage:samj_Coloriage,samj_Coloriage_preview +#@gui :_=separator() +#@gui :_=note("Filtre Lent") +#@gui :_=note("Pour obtenir un contour de 1 couleur") +#@gui :_=separator() +#@gui :Dimension Max Echantillon=int(612,256,800) +#@gui :Limites=int(255,1,255) +#@gui :Flou Lissage=float(2,0,10) +#@gui :Isophotes Nb Levels=int(6,4,16) +#@gui :Dilatation=int(2,1,16) +#@gui :Couleur Contour=color(#000000ff) +#@gui :Dimensions Origine=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/04.") +#@gui Contours Arrondis:samj_Contours_Arrondis,samj_Contours_Arrondis(1) +#@gui :_=note("samj_Contours_Arrondis") +#@gui :_=note("Lissage") +#@gui :Itérations=int(1,1,25) +#@gui :Quantize=int(3,2,25) +#@gui :Blur=int(5,5,50) +#@gui :_=note("Traits") +#@gui :Isophotes=int(10,2,50) +#@gui :RGBA=bool(0) +#@gui :Dilate Circ=int(0,0,10) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/04/06.") +#@gui Contours Blancs:samj_Contours_Blancs,samj_Contours_Blancs_preview(0) +#@gui :_=separator() +#@gui :_=note("Option Quantize") +#@gui :Quantize=choice(1,"No","A","B","A + B") +#@gui :Levels=int(16,2,256) +#@gui :Blur=float(2,0,100) +#@gui :_=note("Gradient Norm") +#@gui :Smoothness=float(0,0,10) +#@gui :Linearity=float(0.5,0,1.5) +#@gui :Min Threshold=float(0,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=note("Blanc Contours") +#@gui :White Level Contour=int(3,0,12) +#@gui :_=note("Segment Watershed") +#@gui :Edge Threshold=float(2,0,15) +#@gui :Smoothness=float(1,0,5) +#@gui :Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=note("Edges Offsets") +#@gui :Smoothness=float(0,0,10) +#@gui :Threshold=float(15,0,50) +#@gui :Scale=int(4,0,32) +#@gui :Thickness=int(1,0,16) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: samj. Latest update: 2019/12/16.") +#@gui Contours Coins Vifs:samj_Contours_Coins_Vifs,samj_Contours_Coins_Vifs +#@gui :_=separator() +#@gui :1 - Autoindex (Détails)=int(20,2,255) +#@gui :2 - Dilate (Étendue Zones/Size Areas)=int(20,2,100) +#@gui :3 - Grosseur Traits/Thickness Lines=int(2,1,100) +#@gui :4 - Rendu/Rendering=choice(0,"Couleurs","Blanc","Noir") +#@gui :_=note("Couleurs/Colors") +#@gui :5 - Intensité/intensity=float(0.05,-0.1,0.2) +#@gui :_=note("Flou/Blur") +#@gui :6 - Étendue/Extent=int(0,0,300) +#@gui :7 - Intensité/Intensity=float(0,-0.05,0.2) +#@gui :_=note("Fond/Background") +#@gui :8-9-10-11 Color=color(#00000000) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2021/01/15.") +#@gui Contours Colores:samj_Contours_Colores,samj_Contours_Colores(1) +#@gui :_=note("samj_Contours_Colores") +#@gui :_=separator() +#@gui :_=note("Contours") +#@gui :Puissance / Pow=float(1.1,1,2) +#@gui :_=separator() +#@gui :_=note("Segment") +#@gui :Edge Threshold=float(2,0,15) +#@gui :_=separator() +#@gui :_=note("Cut") +#@gui :Couper / Cut=int(40,0,255) +#@gui :_=separator() +#@gui :_=note("Dilate") +#@gui :Dilate Contours=int(0,0,16) +#@gui :_=separator() +#@gui :_=note("Dégradation Spread") +#@gui :Spread=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/01/25.") +#@gui Edges Offsets Dots:samj_Edges_Offsets_Dots,samj_Edges_Offsets_Dots +#@gui :_=note("Edges Offsets") +#@gui :1 - Smoothness=float(1.3,0,10) +#@gui :2 - Threshold=float(40,0,50) +#@gui :3 - Scale=int(18,4,32) +#@gui :_=note("Points/Dots") +#@gui :4 - Rayon/Radius=int(2,1,4) +#@gui :5 - Densité/Density=int(4,1,5) +#@gui :6 - Couleurs=float(0,-0.1,0.2) +#@gui :_=note("Fond/Background") +#@gui :7-8-9-10 Couleur/Color=color(#00000000) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2021/01/19.") +#@gui Quelques Isophotes:samj_Quelques_Isophotes,samj_Quelques_Isophotes (1) +#@gui :Épaisseur=int(10,1,32) +#@gui :Précision=int(10,1,32) +#@gui :Coeff Précision=float(1,0.1,8) +#@gui :Coeff Flou=float(0.02,0,1) +#@gui :Isophotes=int(8,2,32) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/11/23.") +#@gui Quelques Isophotes B:samj_Quelques_Isophotes_B,samj_Quelques_Isophotes_B (1) +#@gui :Nb Décomposition Couleurs=int(16,2,32) +#@gui :Variation Couleurs %=float(100,25,100) +#@gui :Type Variation Couleurs=choice(0,"Min","Max","Min Max") +#@gui :Dilate=int(0,0,8) +#@gui :Isophotes=int(4,2,16) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2017/01/14.") +#@gui Quelques Isophotes C:samj_Quelques_Isophotes_C,samj_Quelques_Isophotes_C +#@gui :_=link("https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre-quelques.html","https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre-quelques.html") +#@gui :_=separator() +#@gui :_=note("Contours") +#@gui :Flou/Blur=float(0,0,20) +#@gui :Normalize Min=int(0,0,255) +#@gui :Normalize Max=int(160,0,255) +#@gui :Cut Min=int(0,0,255) +#@gui :Cut Max=int(80,0,255) +#@gui :Isophotes=int(6,2,64) +#@gui :Épaisseur/thickness=int(4,1,64) +#@gui :Decalage X=int(1,-20,+20) +#@gui :Decalage Y=int(1,-20,+20) +#@gui :_=separator() +#@gui :_=note("Wind") +#@gui :Wind=bool(0) +#@gui :Amplitude=int(20,1,100) +#@gui :Angle=float(45,0,360) +#@gui :Attenuation=float(0.7,0,1) +#@gui :Threshold=int(20,1,50) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/10/28.") +#@gui Samj Shapeprevalent Contours:samj_shapeprevalent_contours,samj_shapeprevalent_contours_preview(0)* +#@gui :_=separator() +#@gui :_=note("Fond/Background") +#@gui :1 - Flou/Blur=float(4,0,8) +#@gui :2 - Sharpen=int(0,0,4000) +#@gui :3 - Smooth=int(200,0,400) +#@gui :4 - Quantize=int(32,8,128) +#@gui :5 - Dilate=int(8,0,32) +#@gui :6 - Erode=int(4,0,32) +#@gui :7 - Surface/Area=int(50,2,100) +#@gui :8 - Repeat=int(1,1,10) +#@gui :9 - Couleurs/Colors=float(1,0.5,2) +#@gui :_=separator() +#@gui :_=note("Contours") +#@gui :10 - Ligne/Thickness=int(2,1,16) +#@gui :11 - Antialiasing=bool(1) +#@gui :12 - Seulement/Only Contours=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/04/08.") +#@gui Scintillements Colores Contours:samj_Scintillements_Colores_Contours,samj_Scintillements_Colores_Contours(1) +#@gui :_=note("samj_Scintillements_Colores_Contours") +#@gui :_=separator() +#@gui :_=note("Limites via Isophote") +#@gui :Flou=int(0,0,10) +#@gui :Isophotes=int(8,6,16) +#@gui :Dilate=int(0,0,10) +#@gui :_=separator() +#@gui :_=note("Scintillement") +#@gui :Résolution L=int(8,1,32) +#@gui :Résolution H=int(8,1,32) +#@gui :Dimension Variation=float(1,0.3,3) +#@gui :Variation Couleur=int(768,1,768) +#@gui :Scintillement=int(12,3,24) +#@gui :Angle Décalage=float(0,0,120) +#@gui :Variation Aléatoire=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("Flou") +#@gui :Flou / Blur Contours=float(0,0,5) +#@gui :_=separator() +#@gui :_=note("Overlay") +#@gui :Overlay=bool(0) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond / Background Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/04.") +#@gui Skeletation:samj_Skeletation,samj_Skeletation(1) +#@gui :_=note("samj_Skeletation") +#@gui :_=note("Skeleton") +#@gui :Skeletation=int(2,2,10) +#@gui :Smoothness A %=int(100,10,100) +#@gui :Smoothness B %=int(100,10,100) +#@gui :_=note("Blend") +#@gui :Blend=bool(0) +#@gui :Mode=choice(0,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/01/20.") +#@gui Test Mauvais Contours:samj_Test_Mauvais_Contours,samj_Test_Mauvais_Contours(0) +#@gui :_=note("samj_Test_Mauvais_Contours") +#@gui :Spread - Watershed +=float(0,-30,30) +#@gui :Déformation A=int(0,0,20) +#@gui :Déformation B=int(0,0,20) +#@gui :Itérations=int(2,1,10) +#@gui :Pow=float(1,0.1,3) +#@gui :Na=int(0,0,255) +#@gui :Nb=int(255,0,255) +#@gui :Ca=int(0,0,255) +#@gui :Cb=int(255,0,255) +#@gui :Negate=bool(0) +#@gui :_=separator() +#@gui :_=note("Blend") +#@gui :Blend=bool(0) +#@gui :Mode=choice(3,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Area Max","Shape Area Max0","Shape Area Min","Shape Area Min0","Shape Average","Shape Average0","Shape Min","Shape Min0","Shape Max","Shape Max0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Reverse=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2016/12/30.") +#@gui _Deformations +#@gui Beigne Donut:samj_Beigne,samj_Beigne +#@gui :_=link("Documentation","https://samjcreations.blogspot.com/2021/01/samuser-avec-gmic-gimp-filtre-beigne.html") +#@gui :_=note("Bonne Année 2021") +#@gui :1 - Trou De Beigne/Donut Hole=float(100,0,300) +#@gui :2 - Effet/Effect=choice(0,"Circulaire/Circular","Carré/Square") +#@gui :3 - Rotation Angle=choice(0,"0","90","-90","180") +#@gui :4-5-6-7 Fond/Background=color(#00000000) +#@gui :_=note("Contours") +#@gui :8 - Contours=bool(0) +#@gui :9 - X=int(20,0,300) +#@gui :10 - Y=int(20,0,300) +#@gui :11-12-13-14 Couleur/Color=color(#ffffffff) +#@gui :_=note("Symétrie/Symmetry") +#@gui :15 - Symétrie/Symmetry=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2021/01/01.") +#@gui Cercle Polaire:samj_Cercle_Polaire,samj_Cercle_Polaire(1) +#@gui :_=note("samj_Cercle_Polaire") +#@gui :_=separator() +#@gui :_=note("Rendu") +#@gui :Répétitions=int(1,1,4) +#@gui :Rotation=float(0,0,360) +#@gui :Type Raccord=choice(0,"Sans","A","B","A+B","C") +#@gui :_=separator() +#@gui :_=note("Array [mirrored]") +#@gui :Itérations=int(1,1,4) +#@gui :X-Offset (%)=float(0,0,100) +#@gui :Y-Offset (%)=float(0,0,100) +#@gui :Array Mode=choice(2,"X-Axis","Y-Axis","Xy-Axes","2xy-Axes") +#@gui :Initialization=choice(0,"Original","Mirror X","Mirror Y","Rotate 90 Deg.","Rotate 180 Deg.","Rotate 270 Deg.") +#@gui :Expand Size=bool(0) +#@gui :Crop (%)=int(0,0,100) +#@gui :_=note("Polar To Euclidean") +#@gui :X-Center (%)=float(50,0,100) +#@gui :Y-Center (%)=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Ecraser Etirer:samj_Ecraser_Etirer,samj_Ecraser_Etirer_preview(0) +#@gui :_=note("samj_Ecraser_Etirer") +#@gui :Découpage=int(12,2,32) +#@gui :Effet=choice(0,"Ecraser Le Bas","Ecraser Le Haut","Etirer Le Haut","Etirer Le Bas") +#@gui :Taille Origine=bool(0) +#@gui :Pivoter Image Origine 90=bool(0) +#@gui :Pourcentage Step=float(100,1,300) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: samj. Latest update: 2018/04/25.") +#@gui Ecraser Etirer V2:samj_Ecraser_Etirer_V2,samj_Ecraser_Etirer_V2_preview(0) +#@gui :_=note("samj_Ecraser_Etirer_V2") +#@gui :Découpage=int(12,2,32) +#@gui :Effet=choice(0,"A","B","C","D") +#@gui :Taille Origine=bool(0) +#@gui :Pourcentage Step=float(100,1,300) +#@gui :Pourcentage Découpe=float(50,25,75) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: samj. Latest update: 2020/10/24.") +#@gui Random Small Deformations:samj_Random_Small_Deformations,samj_Random_Small_Deformations(0) +#@gui :_=separator() +#@gui :_=note("samj_Random_Small_Deformations") +#@gui :Noise Amplitude=float(10,0,200) +#@gui :Dilate=int(5,1,20) +#@gui :Blur=float(3,0,20) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2016/12/07.") +#@gui Random Small Deformations B:samj_Random_Small_Deformations_B,samj_Random_Small_Deformations_B +#@gui :_=separator() +#@gui :_=note("samj_Random_Small_Deformations_B") +#@gui :1 - Noise Amplitude=float(10,0,200) +#@gui :2 - Dilate=int(5,1,20) +#@gui :3 - Blur=float(3,0,20) +#@gui :4 - Outline=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2022/08/18.") +#@gui Samj Deformation 20230712:samj_deformation_20230712,samj_deformation_20230712 +#@gui :_=separator() +#@gui :1 - Deform Iter=int(6,3,12) +#@gui :2 - Deform=int(6,3,12) +#@gui :3 - Mélange/Blend=float(0.25,0.25,1) +#@gui :4 - Normalize=bool(1) +#@gui :5 - Graine/Seed=int(1,0,65536) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/07/12.") +#@gui _Degradations +#@gui Deteriorated Areas:samj_Zones_Grises,samj_Zones_Grises(1) +#@gui :_=note("samj_Zones_Grises / Deteriorated Areas") +#@gui :_=note("Contours") +#@gui :Itérations=int(3,1,10) +#@gui :Type=choice(0,"A","B","C") +#@gui :Variations=float(3,1,10) +#@gui :_=note("Blend") +#@gui :Itérations=int(4,1,8) +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj Dernière mise à jour : 2015/04/04.") +#@gui Ellipses Inpaint:samj_Ellipses_Inpaint,samj_Ellipses_Inpaint(1) +#@gui :_=note("samj_Ellipses_Inpaint") +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Couleur Limite=color(#000000) +#@gui :_=separator() +#@gui :_=note("Ellipse") +#@gui :Rayon L=int(8,1,32) +#@gui :Rayon H=int(8,1,32) +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Rendu=choice(2,"A","Inverser","A + Inverser") +#@gui :_=separator() +#@gui :_=note("Random Dégradation") +#@gui :Dégradation=bool(0) +#@gui :Sponge=int(10,1,16) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Image Segments Degrades:samj_Image_Segments_Degrades,samj_Image_Segments_Degrades(0) +#@gui :_=separator() +#@gui :_=note("Ce filtre est très lent - This filter is very slow") +#@gui :_=separator() +#@gui :_=note("Mettre au moins 2000 pour avoir des résultats intéressants.") +#@gui :_=note("Configure 2000 to have interesting results.") +#@gui :1 - Densité/Density=int(2000,1,33333) +#@gui :_=separator() +#@gui :2 - Variation=float(5,1,100) +#@gui :3 - Dilate=int(1,1,5) +#@gui :4 - Fond/Background=bool(0) +#@gui :5 6 7 8 - Fond/Background=color(#000000ff) +#@gui :9 - Graine/Seed=int(1234,0,65536) +#@gui :10 - Deformation=int(0,0,10) +#@gui :11 - X=choice(0,"Sans/Without","X") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/09/06.") +#@gui Image Vers Segments:samj_Image_Vers_Segments,samj_Image_Vers_Segments(0) +#@gui :_=separator() +#@gui :_=note("Ce filtre est très lent - This filter is very slow") +#@gui :_=separator() +#@gui :_=note("Mettre au moins 15000 pour avoir des résultats intéressants.") +#@gui :_=note("Configure 15000 to have interesting results.") +#@gui :1 - Densité/Density=int(1500,1,33333) +#@gui :_=separator() +#@gui :_=note("Si le paramètre 2 est à 0 tracé des segments sur toute l'image pour faire un cadre par exemple.") +#@gui :_=note("If parameter 2 is 0 drawn segments over the entire image to make a frame for example.") +#@gui :2 - Variation=float(5,0,100) +#@gui :_=separator() +#@gui :3 - Dilate=int(1,1,5) +#@gui :4 - Fond/Background=bool(0) +#@gui :5 6 7 8 - Fond/Background=color(#000000ff) +#@gui :9 - Graine/Seed=int(1234,0,65536) +#@gui :10 - Deformation=int(0,0,10) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/08/26.") +#@gui Path Et Solidify:samj_Degradations_Path_Solidify,samj_Degradations_Path_Solidify (1) +#@gui :_=separator() +#@gui :_=note("samj_Degradations_Path_Solidify") +#@gui :_=separator() +#@gui :_=note("Dégradations Image Origine") +#@gui :Pixelise=int(0,0,32) +#@gui :Spread=int(0,0,32) +#@gui :Deform=int(0,0,10) +#@gui :Isophotes=int(0,0,15) +#@gui :Blur=float(0,0,2) +#@gui :_=separator() +#@gui :_=note("Path") +#@gui :Patch Type=choice(2,"Max Patch","Min Patch","Max Et Min Path") +#@gui :Valeur Patch=int(10,1,50) +#@gui :_=separator() +#@gui :_=note("Dégradations Apres Path") +#@gui :Dilate Type=choice(1,"Dilate Circ","Dilate") +#@gui :Valeur Dilate=int(0,0,16) +#@gui :_=separator() +#@gui :Valeur Erode=int(0,0,16) +#@gui :_=separator() +#@gui :_=note("Solidify") +#@gui :Valider Solidify=bool(1) +#@gui :Smoothness %=float(75,0,100) +#@gui :Diffusion Type=choice(0,"Isotropic","Delaunay Oriented","Edge Oriented") +#@gui :Diffusion Iter=int(20,1,200) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/14.") +#@gui Random Plasma:samj_Random_Plasma,samj_Random_Plasma(1) +#@gui :_=note("samj_Random_Plasma") +#@gui :Random Colors=int(0,0,4) +#@gui :Blur=int(80,20,120) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2016/11/05.") +#@gui Samj Rotate Flip Image:samj_rotate_flip_image,samj_rotate_flip_image(1) +#@gui :_=separator() +#@gui :_=note("Rotation") +#@gui :1 - Rotation=bool(1) +#@gui :2 - Angle Degrés/Degrees=float(-45,-180,180) +#@gui :3 - Interpolation=choice(2,"None","Linear","Bicubic") +#@gui :4 - Remplissage/Boundary Conditions=choice(0,"Dirichlet","Neumann","Periodic","Mirror") +#@gui :5 - Ajuster/Adjust Image=bool(1) +#@gui :_=separator() +#@gui :_=note("Retourner / Flip") +#@gui :6 - Retourner/Flip=bool(0) +#@gui :7 - Horizontal Vs Vertical=bool(0) +#@gui :_=separator() +#@gui :_=note("Couleur du fond / Background Color") +#@gui :8 - Fond/Background=bool(0) +#@gui :9 10 11 12 - Fond/Background=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/05/06.") +#@gui Samj Selection Ellipse:samj_Selection_Ellipse,samj_Selection_Ellipse_preview(1) +#@gui :_=separator() +#@gui :_=note("Position") +#@gui :1 2 - Centre=point(50,50,0,1,255,255,0,-128,1%) +#@gui :_=note("Dimensions") +#@gui :3 - R % Diagonale/Diagonal=float(30,0,200) +#@gui :4 - R % Diagonale/Diagonal=float(20,0,200) +#@gui :_=note("Angle") +#@gui :5 - Degrés/Degrees=float(0,-180,180) +#@gui :_=note("Complément/Complement") +#@gui :6 - Extérieur/Outside=bool(0) +#@gui :_=note("Rogner selon le contenu / Crop to content") +#@gui :7 - Autocrop=bool(0) +#@gui :_=note("Pivoter la sélection / Rotate the selection") +#@gui :8 - Pivoter/Rotate=choice(0,"Non/No","Angle","Angle-90","Angle+90","Angle+180") +#@gui :_=separator() +#@gui :_=note("Aperçu Grille / Preview Grid") +#@gui :9 - Visualiser/Preview=bool(0) +#@gui :10 - Divisions X Y=int(2,2,40) +#@gui :11 - Couleur Grille/Color Grid=int(255,0,255) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Pour ajouter un flou utiliser le filtre Blur [Depth-Of-Field] par David Tschumperlé.") +#@gui :_=note("To add a blur use the Blur [Depth-Of-Field] filter by David Tschumperlé.") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/05/06.") +#@gui Samj Selection Hermite Spline:samj_Selection_Hermite_Spline,gui_no_preview +#@gui :_=separator() +#@gui :_=note("Ce filtre utilise la commande interactive 'x_spline'\net affichera une nouvelle fenêtre selon le paramètrage ci-dessous.\n") +#@gui :_=note("This filter uses the interactive command 'x_spline'\nand will display a new window according to the parameters below.\n") +#@gui :_=separator() +#@gui :_=note("Launch spline curve editor.") +#@gui :_=note("Spline curve editor:\n\nMouse to insert/move/delete points.\nKey 'R' to reset the curve.\nKey 'SPACE' to shows/hide spline curve.\nKey 'P' to shows/hide control points.") +#@gui :_=note("Key 'ENTER' to shows/hide control polygon.\nKey 'T' to shows/hide point tangents.\nKey 'I' to shows/hide point indices.") +#@gui :_=note("Key 'C' to shows/hide point coordinates.\nKeys '+' and '-' to increase/decrease roundness.\nKeys 'ESC' or 'Q' to exit.\n") +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Rogner selon le contenu / Crop to content") +#@gui :1 - Autocrop=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/05/06.") +#@gui Samj Selection Polygone:samj_Selection_Polygone,samj_Selection_Polygone_preview(1) +#@gui :_=separator() +#@gui :_=note("Nombre de points/Number of points") +#@gui :1 - Points=int(8,3,8) +#@gui :_=note("Point A") +#@gui :2 3 - A=point(3,3,0,1,255,0,0,-128,1%) +#@gui :_=note("Point B") +#@gui :4 5 - B=point(50,20,0,1,255,255,0,-128,1%) +#@gui :_=note("Point C") +#@gui :6 7 - C=point(97,3,0,1,0,255,0,-128,1%) +#@gui :_=note("Point D") +#@gui :8 9 - D=point(80,50,0,1,0,255,255,-128,1%) +#@gui :_=note("Point E") +#@gui :10 11 - E=point(97,97,0,1,0,0,255,-128,1%) +#@gui :_=note("Point F") +#@gui :12 13 - F=point(50,80,0,1,255,0,255,-128,1%) +#@gui :_=note("Point G") +#@gui :14 15 - G=point(3,97,0,1,255,255,255,-128,1%) +#@gui :_=note("Point H") +#@gui :16 17 - H=point(20,50,0,1,127,127,127,-128,1%) +#@gui :_=note("Complément/Complement") +#@gui :18 - Extérieur/Outside=bool(0) +#@gui :_=note("Rogner selon le contenu / Crop to content") +#@gui :19 - Autocrop=bool(0) +#@gui :_=separator() +#@gui :_=note("Aperçu Grille / Preview Grid") +#@gui :20 - Visualiser/Preview=bool(0) +#@gui :21 - Divisions X Y=int(2,2,40) +#@gui :22 - Couleur Grille/Color Grid=int(255,0,255) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/05/15.") +#@gui Samj Selection Rectangle:samj_Selection_Rectangle,samj_Selection_Rectangle_preview(1) +#@gui :_=separator() +#@gui :_=note("Position") +#@gui :1 2 - Centre=point(50,50,0,1,255,255,0,-128,1%) +#@gui :_=note("Dimensions") +#@gui :3 - Côté/Side A % Diagonale/Diagonal Image=float(50,0,200) +#@gui :4 - Côté/Side B % Diagonale/Diagonal Image=float(40,0,200) +#@gui :_=note("Angle") +#@gui :5 - Degrés/Degrees=float(0,-180,180) +#@gui :_=note("Complément/Complement") +#@gui :6 - Extérieur/Outside=bool(0) +#@gui :_=note("Rogner selon le contenu / Crop to content") +#@gui :7 - Autocrop=bool(0) +#@gui :_=note("Pivoter la sélection / Rotate the selection") +#@gui :8 - Pivoter/Rotate=choice(0,"Non/No","Angle","Angle-90","Angle+90","Angle+180") +#@gui :_=separator() +#@gui :_=note("Aperçu Grille / Preview Grid") +#@gui :9 - Visualiser/Preview=bool(0) +#@gui :10 - Divisions X Y=int(2,2,40) +#@gui :11 - Couleur Grille/Color Grid=int(255,0,255) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/05/06.") +#@gui Samj Selection Spline Rounded:samj_Selection_Spline_Rounded,samj_Selection_Spline_Rounded_preview(1) +#@gui :_=separator() +#@gui :_=note("Précision du trait / Precision of the line") +#@gui :1 - Précision/Precision=int(20,1,200) +#@gui :_=note("4 Splines Ou/Or 3 Splines ") +#@gui :2 - Quatre/Four Splines=bool(1) +#@gui :_=note("Point A") +#@gui :3 4 - A=point(80,20,0,1,255,0,0,-128,1%) +#@gui :_=note("Point B") +#@gui :5 6 - Deform. AC=point(95,50,0,1,255,255,0,-128,1%) +#@gui :_=note("Point C") +#@gui :7 8 - B=point(97,97,0,1,0,255,0,-128,1%) +#@gui :_=note("Point D") +#@gui :9 10 - Deform. CE=point(50,95,0,1,0,255,255,-128,1%) +#@gui :_=note("Point E") +#@gui :11 12 - C=point(20,80,0,1,0,0,255,-128,1%) +#@gui :_=note("Point F") +#@gui :13 14 - Deform. CA Ou/or CF=point(25,40,0,1,255,0,255,-128,1%) +#@gui :_=note("Point G") +#@gui :15 16 - G=point(3,3,0,1,255,255,255,-128,1%) +#@gui :_=note("Point H") +#@gui :17 18 - Deform. GA=point(40,25,0,1,127,127,127,-128,1%) +#@gui :_=note("Barycentre - Pour tester/Try Out") +#@gui :19 - Point Vs Deform=bool(0) +#@gui :_=note("Inverser la sélection / Reverse the selection") +#@gui :20 - Inverser/Reverse=bool(0) +#@gui :_=note("Rogner selon le contenu / Crop to content") +#@gui :21 - Autocrop=bool(0) +#@gui :_=separator() +#@gui :_=note("Aperçu Grille / Preview Grid") +#@gui :22 - Visualiser/Preview=bool(0) +#@gui :23 - Divisions X Y=int(2,2,40) +#@gui :24 - Couleur Grille/Color Grid=int(255,0,255) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/05/15.") +#@gui Samj Shapeprevalent Degradations:samj_shapeprevalent_degradations,samj_shapeprevalent_degradations_preview(0)* +#@gui :_=separator() +#@gui :1 - Flou/Blur=float(2,0,5) +#@gui :2 - Sharpen=int(200,0,4000) +#@gui :3 - Smooth=int(20,0,200) +#@gui :4 - Quantize=int(64,2,128) +#@gui :5 - Dilate=int(8,0,32) +#@gui :6 - Erode=int(4,0,32) +#@gui :7 - Surface/Area=int(50,2,100) +#@gui :8 - Repeat=int(1,1,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/04/06.") +#@gui _Details +#@gui Antialias Wavelet:samj_Antialias_Wavelet,samj_Antialias_Wavelet (0) +#@gui :_=note("Pour dessins avec crenelage") +#@gui :Flou=int(40,0,255) +#@gui :Trait=int(0,0,255) +#@gui :Cut Bas=int(127,0,255) +#@gui :Cut Haut=int(255,0,255) +#@gui :Dilate Circle W=int(1,1,3) +#@gui :Netteté=int(60,0,128) +#@gui :Dilate Circle R=int(1,1,3) +#@gui :Normaliser=bool(1) +#@gui :Itérations=int(1,1,3) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/11/17.") +#@gui Sharpen [Wavelet]:samj_Wavelet_Sharpen_Test_en,samj_Wavelet_Sharpen_Test_en(1) +#@gui :_=note("Test") +#@gui :Type=choice(0,"Decompose 2","Decompose 6") +#@gui :Iterations=int(0,0,2) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2016/11/07.") +#@gui Wavelet Sharpen Test:samj_Wavelet_Sharpen_Test,samj_Wavelet_Sharpen_Test(1) +#@gui :_=note("samj_Wavelet_Sharpen_Test") +#@gui :_=note("gimp_split_details_wavelets 2,0,0") +#@gui :Itérations=int(1,1,4) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2016/11/06.") +#@gui _Frames +#@gui At06B 2017 Frame Painting:samj_At06A_2017_frame_painting,samj_At06A_2017_frame_painting(1) +#@gui :_=separator() +#@gui :_=note("Frame") +#@gui :Size (%)=float(10,0,100) +#@gui :Contrast=float(0.4,0,1) +#@gui :Smoothness=float(6,0,30) +#@gui :Color=color(#7f7f7f) +#@gui :Vignette Size=float(2,0,50) +#@gui :Vignette Contrast=float(400,0,1000) +#@gui :Defects Contrast=float(50,0,512) +#@gui :Defects Density=float(10,0,100) +#@gui :Defects Size=float(1,0,10) +#@gui :Defects Smoothness=float(0.5,0,20) +#@gui :Serial Number=int(123456,0,1000000) +#@gui :_=separator() +#@gui :_=note("Blend GMIC") +#@gui :Mode=choice(35,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacity=float(1,0,1) +#@gui :Reverse=bool(1) +#@gui :_=separator() +#@gui :_=note("Frame Color Variation") +#@gui :Pow=float(1,0,8) +#@gui :Cut A %=float(0,0,100) +#@gui :Cut B %=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé + modification samj. Latest update: 2017/02/23.") +#@gui _Lights & Shadows +#@gui Ombre Portee:samj_Ombre_Portee,samj_Ombre_Portee (1) +#@gui :_=separator() +#@gui :_=note("Avant plan") +#@gui :QuA=int(0,0,100) +#@gui :FlA=float(0,0,10) +#@gui :InvC=bool(0) +#@gui :Limite Détails=int(128,1,255) +#@gui :Dilate=int(0,0,8) +#@gui :Couleur Avant=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("Ombre") +#@gui :Couleur Ombre=color(#7f7f7fff) +#@gui :Décalage Ombre=int(2,0,7) +#@gui :Rendu=int(2,1,7) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("Flou") +#@gui :Flou/Blur=float(0.1,0,2) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/14.") +#@gui Ombre Portee B:samj_Ombre_Portee_B,samj_Ombre_Portee_B (1) +#@gui :_=separator() +#@gui :_=note("Avant plan") +#@gui :Résolution=int(16,4,64) +#@gui :Limite Détails=int(128,1,255) +#@gui :Supprimer Noir=bool(0) +#@gui :Contour=bool(1) +#@gui :Variation Contour=int(16,-127,127) +#@gui :Clair Foncé=float(1,0,2) +#@gui :Précision Blanc=float(0,0,1) +#@gui :Précision Noir=float(0,0,1) +#@gui :_=separator() +#@gui :_=note("Ombre") +#@gui :Couleur Ombre=color(#7f7f7fff) +#@gui :Dilate=int(2,0,16) +#@gui :Flou/Blur=float(2,0,10) +#@gui :Décalage Ombre=int(2,0,7) +#@gui :Rendu=int(2,1,7) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/01.") +#@gui Ombre Portee C:samj_Ombre_Portee_C,samj_Ombre_Portee_C (1) +#@gui :_=separator() +#@gui :_=note("Avant plan") +#@gui :Isophotes=int(32,4,64) +#@gui :Dilatation=int(8,1,64) +#@gui :_=note("samj_Ombre_Portee_B") +#@gui :Résolution=int(16,4,64) +#@gui :Limite Détails=int(192,1,255) +#@gui :Supprimer Noir=bool(0) +#@gui :Contour=bool(1) +#@gui :Variation Contour=int(16,-127,127) +#@gui :Clair Foncé=float(1,0,2) +#@gui :Précision Blanc=float(0,0,1) +#@gui :Précision Noir=float(0,0,1) +#@gui :_=separator() +#@gui :_=note("Ombre") +#@gui :Couleur Ombre=color(#606060ff) +#@gui :Dilate=int(2,0,16) +#@gui :Flou/Blur=float(2,0,10) +#@gui :Décalage Ombre=int(2,0,7) +#@gui :Rendu=int(2,1,7) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/01.") +#@gui Ombre Portee D:samj_Ombre_Portee_D,samj_Ombre_Portee_D (1) +#@gui :_=separator() +#@gui :_=note("Avant Plan") +#@gui :Résolution=int(16,4,64) +#@gui :Détection A=int(64,0,255) +#@gui :Détection B=int(64,0,255) +#@gui :Flou Lissage=float(2,0,10) +#@gui :Couleur=float(1,0,4) +#@gui :Isophotes AP=int(16,4,64) +#@gui :Dilate AP=int(5,0,16) +#@gui :_=separator() +#@gui :_=note("Contours Avant Plan") +#@gui :Contour=bool(1) +#@gui :Variation Contour=int(-32,-127,127) +#@gui :_=separator() +#@gui :_=note("Ombre") +#@gui :Dilate=int(4,0,16) +#@gui :Couleur Ombre=float(1,0,4) +#@gui :Flou/Blur=float(2,0,10) +#@gui :Décalage Ombre=int(2,0,7) +#@gui :Rendu=int(2,1,7) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/03.") +#@gui Posterize Relief:samj_Posterize_Relief,samj_Posterize_Relief +#@gui :_=separator() +#@gui :_=note("Posterize") +#@gui :1 - Blur=float(1,0,5) +#@gui :2 - Colors=int(12,2,32) +#@gui :3 - Inpaint Holes=float(20,0.1,50) +#@gui :4 - Smooth=int(0,0,8) +#@gui :5 - Smooth - Smoothness=float(40,10,800) +#@gui :6 - Smooth - Edges (%)=float(30,0,100) +#@gui :7 - Smooth - Paint=float(1,0,10) +#@gui :8 - Sharpen=int(0,0,1000) +#@gui :_=separator() +#@gui :_=note("Light Relief") +#@gui :9 - Ambient Lightness=float(0.4,0.2,0.7) +#@gui :10 - Darkness=float(0,0,1) +#@gui :11 - Light Smoothness=float(1,0,5) +#@gui :12 - XY-Light=point(15,60,0,1,255,255,128,200,10) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/08/17.") +#@gui _Patterns +#@gui Contours Gros Pixels:samj_Contours_Gros_Pixels,samj_Contours_Gros_Pixels(1) +#@gui :_=note("Contours GrosPixels") +#@gui :Flou/Blur=float(1,0,5) +#@gui :Isophotes Nb Levels=int(8,1,256) +#@gui :Dilatation=int(0,0,10) +#@gui :Gros Pixels X=int(20,5,90) +#@gui :Gros Pixels Y=int(20,5,90) +#@gui :Quantize Levels=int(16,1,256) +#@gui :Couleur=float(1.1,0.8,4) +#@gui :Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("Edges") +#@gui :VALIDATION EDGES=bool(0) +#@gui :Threshold=float(15,0.5,50) +#@gui :Colorization=bool(0) +#@gui :Alpha Colorization=bool(0) +#@gui :Colorization Mode=choice(0,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Colorization Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Degrades HSL TSL:samj_Degrades_HSL_TSL,samj_Degrades_HSL_TSL(1) +#@gui :_=separator() +#@gui :_=note("Rendu") +#@gui :Type Dégradé=choice(4,"V Couleur A","H Couleur A","V Couleur B","H Couleur B","V Couleurs A/B","H Couleurs A/B","V Couleurs A/B Inv.","H Couleurs A/B Inv.") +#@gui :Dimensions Image=int(800,128,2048) +#@gui :Couleur A=color(#f0f028ff) +#@gui :Couleur B=color(#7828f0ff) +#@gui :Décalage H=float(0,0,360) +#@gui :Décalage S=float(0,0,100) +#@gui :Décalage L=float(0,0,100) +#@gui :Variation H=float(360,1,360) +#@gui :Variation S=float(100,1,100) +#@gui :Variation L=float(100,1,100) +#@gui :Valider Variations Canal Alpha=bool(0) +#@gui :Dégradés Aléatoires=bool(0) +#@gui :H Min. Ded. Aléa.=float(0,0,718) +#@gui :H Max. Ded. Aléa.=float(718,0,718) +#@gui :S Min. Ded. Aléa.=float(75,0,100) +#@gui :S Max. Ded. Aléa.=float(100,0,100) +#@gui :L Min. Ded. Aléa.=float(0,0,100) +#@gui :L Max. Ded. Aléa.=float(100,0,100) +#@gui :Inverser Dégradé=bool(0) +#@gui :Formes=choice(0,"Non","Sinus V - Param A B","Sinus H - Param A B","Cercles - Param A B","Rayons - Param A B","Lignes V Norm - Param A B","Lignes H Norm - Param A B","Plaid","Carré","Croix","Perspective - Param A","Sphere A","Sphere B") +#@gui :Paramètre Forme A=int(0,0,100) +#@gui :Paramètre Forme B=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui ___Patterns +#@gui Denim Texture:Denim_samj,Denim_samj(0) +#@gui :_=separator() +#@gui :_=note("Texture") +#@gui :Dimension Motif Base=int(5,2,30) +#@gui :Dilatation Motif / Pattern=int(2,0,5) +#@gui :Retourner Motif / Flip Pattern=bool(0) +#@gui :Déformation 1=int(40,0,200) +#@gui :Déformation 2=int(40,0,200) +#@gui :Denim [bruit/noise]=int(25,0,100) +#@gui :Usure [bruit/noise]=int(50,0,100) +#@gui :Netteté / Sharpness=float(0,0,500) +#@gui :_=separator() +#@gui :_=note("Couleur") +#@gui :Couleur Denim=color(#2b6c7eff) +#@gui :_=separator() +#@gui :_=note("samj - Version : 2020/10/24.") +#@gui _Testing +#@gui Samj +#@gui Patterns +#@gui EPPE Transform:samj_EPPE_Transform,samj_EPPE_Transform(1) +#@gui :_=note("samj_EPPE_Transform") +#@gui :X Centre=float(50,0,100) +#@gui :Y Centre=float(50,0,100) +#@gui :Rendu=choice(0,"Imagegrid","Imagegrid Hexagonal","Imagegrid Triangular","BoxFitting") +#@gui :_=separator() +#@gui :_=note("Imagegrid") +#@gui :X-Size=int(10,2,100) +#@gui :Y-Size=int(10,2,100) +#@gui :_=separator() +#@gui :_=note("Imagegrid Hexagonal") +#@gui :Résolution=int(32,1,128) +#@gui :Outline=float(0.1,0,0.5) +#@gui :_=separator() +#@gui :_=note("Imagegrid Triangular") +#@gui :Pattern Width=int(10,8,128) +#@gui :Pattern Height=int(18,8,128) +#@gui :Pattern Type=choice(0,"Horizontal","Vertical","Crossed","Cube","Decreasing","Increasing") +#@gui :Outline Color=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("BoxFitting") +#@gui :Minimal Size=int(3,1,32) +#@gui :Maximal Size=int(0,0,32) +#@gui :Initial Density=float(0.1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Formes Couleurs Variees Dans Image:samj_Formes_Couleurs_Variees_Dans_Image,samj_Formes_Couleurs_Variees_Dans_Image(1) +#@gui :Formes=choice(0,"Sinus V - Param A B","Sinus H - Param A B","Cercles - Param A B","Rayons - Param A B","Lignes V","Lignes H","Tiled V - Param A B C D","Tiled H - Param A B C D","Lignes V Norm - Param A B","Lignes H Norm - Param A B","Plaid","Carré","Croix","Perspective - Param A","Sphere A","Sphere B") +#@gui :Paramètre Forme A=int(0,0,100) +#@gui :Paramètre Forme B=int(0,0,100) +#@gui :Paramètre Forme C=int(0,0,100) +#@gui :Paramètre Forme D=int(0,0,100) +#@gui :Canal R=int(192,0,255) +#@gui :Canal V=int(128,0,255) +#@gui :Canal B=int(64,0,255) +#@gui :Canal Alpha=int(255,0,255) +#@gui :Valider Variations Canal R=bool(1) +#@gui :Valider Variations Canal V=bool(1) +#@gui :Valider Variations Canal B=bool(1) +#@gui :Valider Variations Canal Alpha=bool(0) +#@gui :Type Variations=choice(0,"A","B","C","D","E","F") +#@gui :Décalage=int(127,0,255) +#@gui :Etendue=int(255,1,255) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,200) +#@gui :Canal Alpha=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Lignes H Ou V Colorees:samj_Lignes_H_ou_V_Colorees,samj_Lignes_H_ou_V_Colorees(1) +#@gui :_=separator() +#@gui :_=note("samj_Lignes_H_ou_V_Colorees - Colored Lines") +#@gui :Couleur - Color A=color(#9fbec3) +#@gui :Couleur - Color B=color(#37438c) +#@gui :Couleur - Color C=color(#362827) +#@gui :Couleur - Color D=color(#8c5158) +#@gui :Couleur - Color E=color(#cfafbe) +#@gui :Couleur - Color F=color(#dccac4) +#@gui :Couleur - Color G=color(#aabac0) +#@gui :Couleur - Color H=color(#82958b) +#@gui :Couleur - Color I=color(#706060) +#@gui :Couleur - Color J=color(#eda88a) +#@gui :Couleur - Color K=color(#dcc7cd) +#@gui :Couleur - Color L=color(#ead9db) +#@gui :Alpha=int(255,1,255) +#@gui :Largeur - Width=int(256,2,1024) +#@gui :Nombre De Lignes - Number Of Lines=int(256,2,1024) +#@gui :Hauteur De Une Ligne - Height Of One Line=int(1,1,20) +#@gui :Rotation 90 Degrés - Vertical Lines=bool(0) +#@gui :Origine - First Color=choice(0,"A","B","C","D","E","F","G","H","I","J","K","L") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Marbre Marble:samj_Marbre,samj_Marbre(1) +#@gui :_=note("samj_Marbre") +#@gui :_=separator() +#@gui :_=note("Plasma") +#@gui :Alpha=float(1,0,5) +#@gui :Beta=float(1,0,100) +#@gui :Scale=int(8,2,10) +#@gui :_=separator() +#@gui :_=note("Flou-Blur") +#@gui :Flou/Blur=float(5,2,20) +#@gui :_=separator() +#@gui :_=note("Gris-Gray") +#@gui :Gris/Gray=float(0.2,0.1,0.6) +#@gui :_=separator() +#@gui :_=note("Bruit-Noise") +#@gui :Spread=int(0,0,10) +#@gui :Atténuation=float(0,0,2) +#@gui :_=separator() +#@gui :_=note("Couleur-Color") +#@gui :Colorisation=bool(0) +#@gui :Couleur / Color=color(#8c78dc) +#@gui :_=separator() +#@gui :_=note("Blend Image") +#@gui :Blend Image=bool(0) +#@gui :Mode=choice(3,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Mosaic A:samj_Mosaic_A,samj_Mosaic_A +#@gui :1 - Tuiles Taille/Tiles Size=int(20,10,40) +#@gui :2 - Joints=int(3,2,5) +#@gui :_=note("Relief") +#@gui :3 - Relief=bool(1) +#@gui :4 - Lumière/Light=float(0,0,1) +#@gui :5 - Lumière/Light Orientation=int(0,0,3) +#@gui :6 - Fancy Mosaic - Slow=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2021/05/09.") +#@gui Mosaic B:samj_Mosaic_B,samj_Mosaic_B +#@gui :_=note("Rendu aléatoire/Random rendering") +#@gui :1 - Tuiles Densité/Tiles Density=int(30,5,50) +#@gui :2 - Créativité/Creativity A=int(400,0,4000) +#@gui :3 - Créativité/Creativity B=int(1,0,10) +#@gui :4 - Créativité/Creativity C=int(100,0,200) +#@gui :5 - Joints=int(1,0,5) +#@gui :_=note("Relief") +#@gui :6 - Relief=bool(1) +#@gui :7 - Lumière/Light=float(0,0,1) +#@gui :8 - Lumière/Light Orientation=int(0,0,3) +#@gui :9 - Fancy Mosaic - Slow=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/02/13.") +#@gui Motif Plasma:samj_Motif_Plasma,samj_Motif_Plasma(0) +#@gui :_=separator() +#@gui :_=note("Motif Plasma") +#@gui :Détails=int(2,1,8) +#@gui :Plasma A=int(20,0,32) +#@gui :Plasma B=int(20,0,32) +#@gui :Flou Pourcent=int(30,1,100) +#@gui :Mélange Mode=int(1,0,1) +#@gui :Mélange Pourcent=int(75,0,100) +#@gui :Graine - 0 Pour Motif Aléatoire=int(0,0,1000000) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/02/17.") +#@gui Motifs 7200:samj_Motifs_7200,samj_Motifs_7200(0) +#@gui :_=separator() +#@gui :_=note("Motif Plasma") +#@gui :Détails=int(2,1,8) +#@gui :Plasma 0 - Bruit Aléatoire 1=bool(0) +#@gui :Plasma A - Bruit Dimension=int(20,0,32) +#@gui :Plasma B - Bruit Dimension=int(20,0,32) +#@gui :Flou Pourcent=int(30,1,100) +#@gui :Mélange Mode=int(1,0,1) +#@gui :Mélange Pourcent=int(75,0,100) +#@gui :Graine - 0 Pour Motif Aléatoire=int(0,0,1000000) +#@gui :Effet=choice(0,"0 Plasma","1 CA","2 BR","3 CA BR","4 RS CA","5 RS BR","6 RS CA BR","7 PD","8 PD RS","9 PD BR","10 PD RS BR") +#@gui :Couleur Random Shade=color(#ff00ddff) +#@gui :Ajouter Rolling Guidance [lissage]=bool(0) +#@gui :Ajouter Mess With Bits=bool(0) +#@gui :Ajouter CeKoaSa 004=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/02/17.") +#@gui Motifs 7200 Variante A:samj_Motifs_7200_VarianteA,samj_Motifs_7200_VarianteA(0) +#@gui :_=separator() +#@gui :_=note("Pour obtenir des motifs autour de la couleur choisie") +#@gui :_=separator() +#@gui :_=note("Motif Plasma") +#@gui :Détails=int(2,1,8) +#@gui :Plasma 0 - Bruit Aléatoire 1=bool(0) +#@gui :Plasma A - Bruit Dimension=int(20,0,32) +#@gui :Plasma B - Bruit Dimension=int(20,0,32) +#@gui :Flou Pourcent=int(30,1,100) +#@gui :Mélange Mode=int(1,0,1) +#@gui :Mélange Pourcent=int(75,0,100) +#@gui :Graine - 0 Pour Motif Aléatoire=int(0,0,1000000) +#@gui :Effet=choice(0,"0 Plasma","1 CA","2 BR","3 CA BR","4 RS CA","5 RS BR","6 RS CA BR","7 PD","8 PD RS","9 PD BR","10 PD RS BR") +#@gui :Couleur Random Shade=color(#ff00ddff) +#@gui :Ajouter Rolling Guidance [lissage]=bool(0) +#@gui :Ajouter Mess With Bits=bool(0) +#@gui :Ajouter CeKoaSa 004=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/02/19.") +#@gui Motifs 7200 VarianteB:samj_Motifs_7200_VarianteB,samj_Motifs_7200_VarianteB(0) +#@gui :_=separator() +#@gui :_=note("Pour obtenir des motifs cheveux peignes") +#@gui :Détails=int(4,1,8) +#@gui :Bruit En Plus=int(0,0,64) +#@gui :Déformation En Plus=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("sketchbw") +#@gui :Number of Orientations=int(3,1,16) +#@gui :Starting Angle=float(45,0,180) +#@gui :Angle Range=float(180,0,180) +#@gui :Stroke Length=float(30,0,1000) +#@gui :Contour Threshold=float(0.75,0,10) +#@gui :Opacity=float(0.02,0,0.3) +#@gui :Background Intensity=float(0.5,0,2) +#@gui :Density=float(1.5,0,5) +#@gui :Sharpness=float(0.1,0,1) +#@gui :Anisotropy=float(1,0,1) +#@gui :Smoothness=float(10,0,10) +#@gui :Cohérence=float(10,0,10) +#@gui :Boost Stroke=bool(1) +#@gui :Curved Stroke=bool(1) +#@gui :Color Model=choice(4,"Black on White","White on Black","Black on Transparent White","White on Transparent Black","Color on White") +#@gui :_=separator() +#@gui :_=note("Dispersion") +#@gui :Dispersion=int(48,1,100) +#@gui :DispersionDeform=int(4,1,10) +#@gui :Cut Vs Norm=bool(1) +#@gui :Seamless Vs Edges=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/02/20.") +#@gui Motifs 7200 VarianteC:samj_Motifs_7200_VarianteC,samj_Motifs_7200_VarianteC(0) +#@gui :_=separator() +#@gui :_=note("Pour obtenir des chemins courbes") +#@gui :Détails=int(4,1,8) +#@gui :Bruit=int(32,2,64) +#@gui :Flou A=int(64,2,128) +#@gui :Déformation=int(32,1,100) +#@gui :Seamless Vs Edges A=bool(1) +#@gui :Flou B=int(5,2,10) +#@gui :Couleur=color(#ff00dd) +#@gui :Seamless Vs Edges B=bool(0) +#@gui :Etendue Couleurs=choice(0,"Cut Norm","Cut","Norm","Rien") +#@gui :_=separator() +#@gui :_=note("Dégradé") +#@gui :Ajouter Dégradé=bool(0) +#@gui :Type H / V=choice(0,"H","V") +#@gui :Swap Colors=bool(0) +#@gui :Starting Color A=color(#f028a0ff) +#@gui :Ending Color B=color(#f0f028ff) +#@gui :Colorspace=choice(0,"SRGB","Linear RGB","Lab") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/02/20.") +#@gui Motifs Aleatoires Symetriques Degrades:samj_Motifs_Aleatoires_Symetriques_Degrades,samj_Motifs_Aleatoires_Symetriques_Degrades(1) +#@gui :_=separator() +#@gui :_=note("Rendu") +#@gui :Type Dégradé=choice(0,"Dégradés XYZ CIE A","Dégradés XYZ CIE B","Dégradés HSL TSL","Formes Couleurs Variees Dans Image") +#@gui :Dimensions Motif=int(400,128,2048) +#@gui :Forme=int(4,3,12) +#@gui :Limite / Boundary=int(1,0,2) +#@gui :Symétrie=int(1,0,2) +#@gui :Utiliser GIMP Feltpen=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/11/15.") +#@gui Motifs Degrades CIE:samj_Degrades_XYZ_CIE,samj_Degrades_XYZ_CIE(0) +#@gui :_=separator() +#@gui :_=note("Dégradé Rendu CIE Lab") +#@gui :Type Dégradé=choice(6,"V Couleur A","H Couleur A","V Couleur B","H Couleur B","V Couleurs A/B Inv.","H Couleurs A/B Inv.","V Couleurs A/B","H Couleurs A/B") +#@gui :Dimensions Image=int(800,128,2048) +#@gui :Couleur A=color(#f0f028ff) +#@gui :Couleur B=color(#7828f0ff) +#@gui :Décalage L=float(0,0,100) +#@gui :Décalage A=float(0,-128,127) +#@gui :Décalage B=float(0,-128,127) +#@gui :Variation L=float(100,0,100) +#@gui :Variation A=float(64,0,255) +#@gui :Variation B=float(64,0,255) +#@gui :Valider Variations Canal Alpha=bool(0) +#@gui :Trou Noir=choice(0,"Non","Mode A","Mode B") +#@gui :Dégradés Aléatoires=bool(1) +#@gui :L Min. Ded. Aléa.=float(0,0,100) +#@gui :L Max. Ded. Aléa.=float(100,0,100) +#@gui :A Min. Ded. Aléa.=float(-128,-128,127) +#@gui :A Max. Ded. Aléa.=float(128,-128,127) +#@gui :B Min. Ded. Aléa.=float(-128,-128,127) +#@gui :B Max. Ded. Aléa.=float(128,-128,127) +#@gui :Inverser Dégradé=bool(0) +#@gui :Formes=choice(11,"Non","Sinus V - Param A B","Sinus H - Param A B","Cercles - Param A B","Rayons - Param A B","Lignes V Norm - Param A B","Lignes H Norm - Param A B","Plaid","Carré","Croix","Perspective - Param A","Sphere A","Sphere B") +#@gui :Paramètre Forme A=int(0,0,100) +#@gui :Paramètre Forme B=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("Author: Samj. - Dernière mise à jour : 2010/10/24.") +#@gui Perpendicular Lines:samj_Lignes_Perpendiculaires,samj_Lignes_Perpendiculaires +#@gui :_=link("https://samjcreations.blogspot.com","https://samjcreations.blogspot.com") +#@gui :_=note("Lignes / Lines ") +#@gui :Couleur/Color=color(#ffffffff) +#@gui :Fréquence/Frequency=int(10,1,100) +#@gui :Répétitions/Repeat=int(1,1,100) +#@gui :Dilate=int(2,1,64) +#@gui :Graine/Seed A=int(1234,1,65536) +#@gui :Graine/Seed B=int(5678,1,65536) +#@gui :_=note("Mélange/Blend") +#@gui :Mélange Avec Image / Blend=bool(0) +#@gui :Mode=choice(0,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Seamless","Seamless Mixed","Screen","Shapeareamax","Shapeareamax0","Shapeareamin","Shapeareamin0","Shapeaverage","Shapeaverage0","Shapemedian","Shapemedian0","Shapemin","Shapemin0","Shapemax","Shapemax0","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/10/30.") +#@gui Points Aleatoires 001:samj_Points_Aleatoires_001,gui_no_preview +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Points") +#@gui :Itérations=int(10,1,200) +#@gui :Couleur Point=color(#ffff00ff) +#@gui :Mode=choice(3,"XY Aléatoire","X Aléatoire","Y Aléatoire","Cavalier","Fou","Tour","Reine") +#@gui :Couleurs Aléatoires=bool(0) +#@gui :Continuité Entre Itérations=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Pouring:samj_pouring,samj_pouring +#@gui :1 - Orientation=choice(0,"-X","-Y","+X","+Y","-XY","-YX","+XY","+YX") +#@gui :2 - Mélange/Mix A=float(1,0,2) +#@gui :3 - Mélange/Mix B=choice(0,"Forme A","Forme B","Forme C","Forme D","Forme E","Forme F") +#@gui :4 - Couleurs/Colors=float(0,0,25) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/02/25.") +#@gui Pseudo Vitrail:samj_Pseudo_Vitrail,samj_Pseudo_Vitrail +#@gui :_=separator() +#@gui :1 - Autoindex=int(0,0,1024) +#@gui :2 - Densité/Density=int(40,1,100) +#@gui :3 - Voronoi=bool(0) +#@gui :4 - Détails=float(0,0,1) +#@gui :5 - Grosseur Trait/Line Thickness=int(2,1,5) +#@gui :6-7-8-9 Trait/Line=color(#000000ff) +#@gui :10 - Itération=bool(0) +#@gui :11 - Couleurs/Colors=float(0,-0.1,0.2) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2021/01/17.") +#@gui Quickly Create Colorful Patterns:samj_Motifs_Rapides,samj_Motifs_Rapides(0) +#@gui :_=link("https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre-quickly.html","https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre-quickly.html") +#@gui :_=separator() +#@gui :_=note("Array") +#@gui :Color=int(2345,0,65536) +#@gui :_=note("Set dimension to 20 or very close for very large images.") +#@gui :Dimension=float(19,0,20) +#@gui :_=note("Deform") +#@gui :Seed=int(1234,1,65536) +#@gui :Amplitude=int(30,0,1000) +#@gui :_=note("Tiles") +#@gui :Tiles=bool(0) +#@gui :Nb X Y Tiles=int(10,2,32) +#@gui :_=note("Spread") +#@gui :Seed=int(1234,1,65536) +#@gui :DxDy=int(0,0,100) +#@gui :_=note("Blur") +#@gui :Add Blur=bool(0) +#@gui :Blur=float(1,0,100) +#@gui :_=note("Dominant Color") +#@gui :Add A Dominant Color=bool(0) +#@gui :Color=color(#ffaa0080) +#@gui :_=note("Geometry") +#@gui :Symmetrize=bool(0) +#@gui :Mirror X Y=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/10/14.") +#@gui Quickly Create Colorful Patterns B:samj_Motifs_Rapides_B,samj_Motifs_Rapides_B(0) +#@gui :_=link("https://samjcreations.blogspot.com","https://samjcreations.blogspot.com") +#@gui :_=note("Pour créer rapidement des motifs sur des grosses images 7800*11400 - 13/19") +#@gui :_=note("To quickly create patterns on large images 7800*11400 - 13/19") +#@gui :_=note("Fond/Background") +#@gui :Lignes Verticales/Vertical Lines=bool(1) +#@gui :Couleurs/Colors=int(1234,1,65536) +#@gui :Épaisseur Des Lignes/Line Thickness=int(16,1,128) +#@gui :_=note("Bandes/Strips") +#@gui :Bandes/Strips=bool(0) +#@gui :Nb=int(8,2,16) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/10/31.") +#@gui Random Pattern Courtepointe:samj_Courtepointe,gui_no_preview +#@gui :_=note("Motif au rendu aléatoire / Random Pattern") +#@gui :_=separator() +#@gui :Cossin 1 / Parameter 1=int(20,1,100) +#@gui :Cossin 2 / Parameter 2=bool(0) +#@gui :Répetition / Repeat=int(1,1,5) +#@gui :Croix / Cross=bool(0) +#@gui :Texture=bool(1) +#@gui :Courbes Des Couleurs / Color Curves=choice("RGB","CMY","CMYK","HSI","HSL","HSV","Lab","Lch","YCbCr") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Rays Of Colors:samj_Rays_Of_Colors,samj_Rays_Of_Colors(0) +#@gui :Color Intensity=int(300,1,1600) +#@gui :Color Density=int(12,2,40) +#@gui :Radius=float(40,0,400) +#@gui :Border Smoothness=float(16,0,200) +#@gui :Border Width=float(38,0,100) +#@gui :Merge Layers=bool(1) +#@gui :Background Color=color(#000000) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2020/10/24.") +#@gui ___Patterns +#@gui Soft Random Shades:samj_Soft_Random_Shades,samj_Soft_Random_Shades(1) +#@gui :_=separator() +#@gui :_=note("samj_Soft_Random_Shades") +#@gui :Background Color=color(#8c78dcff) +#@gui :Variation A=int(0,0,4) +#@gui :Variation B=int(20,20,120) +#@gui :Variation C=float(0,0,0.25) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2016/12/06.") +#@gui _Testing +#@gui Samj +#@gui Patterns +#@gui Steps V2:samj_Steps_V2,samj_Steps_V2(1) +#@gui :_=separator() +#@gui :_=note("Background") +#@gui :Pixelise X=int(10,1,256) +#@gui :Pixelise X=int(10,1,256) +#@gui :Area=int(4,1,16) +#@gui :Area IHC=bool(1) +#@gui :Isophotes=int(10,1,127) +#@gui :Dilate Circle=int(2,1,5) +#@gui :Smoothness=float(60,0,100) +#@gui :_=separator() +#@gui :_=note("Background") +#@gui :Background=bool(0) +#@gui :Color=float(1.1,1,1.2) +#@gui :Variation=int(10,5,200) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2020/10/24.") +#@gui Tissu Fond Flou:samj_Tissu_Fond_Flou,samj_Tissu_Fond_Flou_preview(1) +#@gui :_=separator() +#@gui :_=note("Capture Ligne") +#@gui :X Origine=float(0,0,100) +#@gui :Y Origine=float(0,0,100) +#@gui :X Fin=float(100,0,100) +#@gui :Y Fin=float(100,0,100) +#@gui :Déplacement A=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("Tissu") +#@gui :Tissu=bool(1) +#@gui :Forme=choice(0,"A","B","C","D") +#@gui :Blend 0pacity=float(1,0,1) +#@gui :Inversion Calques Blend=bool(0) +#@gui :Angle Rotation=float(0,0,360) +#@gui :Déplacement B=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("Flou/Blur") +#@gui :Flou/Blur=float(0,0,1) +#@gui :Coeff. Flou=choice(0,"Flou/Blur *1","Flou/Blur *10","Flou/Blur *100","Flou/Blur *1000") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/02.") +#@gui Variation Stained Glass:samj_Variation_Stained_Glass,samj_Variation_Stained_Glass(1) +#@gui :_=separator() +#@gui :_=note("Colored Outlines") +#@gui :Axes=choice(0,"XY","X","Y") +#@gui :Blur=float(2,0,10) +#@gui :Isophote=float(8,6,16) +#@gui :Smooth=int(0,0,100) +#@gui :Dilate=int(3,1,16) +#@gui :_=separator() +#@gui :_=note("Stained Glass") +#@gui :Edges=float(40,0,100) +#@gui :Shading=int(100,0,200) +#@gui :Is Precise=bool(0) +#@gui :_=separator() +#@gui :_=note("Background") +#@gui :Color=float(1.1,1,1.2) +#@gui :Variation=int(20,10,200) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/11/13.") +#@gui _Rendering +#@gui Adjacent Annular Steiner Chains:samj_Adjacent_Annular_Steiner_Chains,samj_Adjacent_Annular_Steiner_Chains(1) +#@gui :_=link("http://en.wikipedia.org/wiki/Steiner_chain","http://en.wikipedia.org/wiki/Steiner_chain") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Angle Inclinaison / Tilt=float(0,0,360) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("Cercles") +#@gui :Rayon Cercle Centre / Radius Center Circle A=float(6,-100,100) +#@gui :Nb Cercles Extérieurs / Circles Surrounding=int(56,7,360) +#@gui :_=separator() +#@gui :_=note("Anneaux") +#@gui :Nb Anneaux=int(20,1,100) +#@gui :Angle Décalage / Offset Angle %=float(50,-100,100) +#@gui :Variation Increment Anneaux %=float(0,-100,200) +#@gui :_=separator() +#@gui :_=note("Couleurs Cercles") +#@gui :Couleur / Color A=color(#ff00dd7f) +#@gui :Couleur / Color B=color(#4800ff7f) +#@gui :Couleur / Color C=color(#0091ff7f) +#@gui :Couleur / Color D=color(#00ff907f) +#@gui :Couleur / Color E=color(#48ff007f) +#@gui :Couleur / Color F=color(#ffd9007f) +#@gui :Couleur / Color G=color(#ff00007f) +#@gui :Choix Des Couleurs / Choice Of Colors=choice(5,"Couleurs / Colors AB","Couleurs / Colors ABC","Couleurs / Colors ABCD","Couleurs / Colors ABCDE","Couleurs / Colors ABCDEF","Couleurs / Colors ABCDEFG","Ordre ABCDEFG") +#@gui :Variations Des Couleurs=float(0,-2,2) +#@gui :Couleurs Aléatoires / Random Colors=choice(0,"Non / No","A","B","C") +#@gui :_=separator() +#@gui :_=note("Contours") +#@gui :Affichage / Display Contours=choice(2,"Non / No","A","B","C","D","E") +#@gui :Contours=color(#000000ff) +#@gui :Dilate Contours=int(0,0,16) +#@gui :Flou / Blur Contours=float(0,0,5) +#@gui :Sharpen=int(0,0,600) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Adjacent Rectangles:samj_Rectangles_Adjacents,samj_Rectangles_Adjacents(1) +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X Haut Gauche / Top Left=float(10,-100,100) +#@gui :Position Y Haut Gauche / Top Left=float(10,-100,100) +#@gui :Position X Bas Droite / Down Right=float(80,0,100) +#@gui :Position Y Bas Droite / Down Right=float(80,0,100) +#@gui :Type / Location Contact=choice(0,"Haut - Top","Bas - Down","Gauche - Left","Droite - Right") +#@gui :Position Contact=float(50,0,100) +#@gui :Nb Rectangles=int(6,2,25) +#@gui :Type N=choice(0,"Inc 1","Lin 0.1","Lin 0.2","Lin 0.3","Rand","M1","M2") +#@gui :Angle Inclinaison / Tilt=float(0,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage / Display Contours=bool(1) +#@gui :Rectangle A=color(#ffff007f) +#@gui :Rectangle B=color(#0000ff7f) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Miroir / Mirror=choice(0,"Sans - Wihout"," X "," Y "," X Y ") +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :Décalage Ombre X / Shadow Offset X=float(0,-20,20) +#@gui :Décalage Ombre Y / Shadow Offset Y=float(0,-20,20) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Annular Steiner Chains:samj_Annular_Steiner_Chains,samj_Annular_Steiner_Chains(1) +#@gui :_=link("http://en.wikipedia.org/wiki/Steiner_chain","http://en.wikipedia.org/wiki/Steiner_chain") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Rayon Cercle Extérieur / Radius Outer Circle A (>0 W%) (<0 H%)=float(50,-400,400) +#@gui :Nb Cercles Extérieurs / Circles Surrounding=int(6,3,360) +#@gui :Angle Inclinaison / Tilt=float(0,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage / Display Contours=choice(1,"Sans","CE CI CA","CE CI CA CC","CE CI CA CC CT","CE CI CA CT","CE CA","CI CA","CA") +#@gui :Cercle Extérieur / Exterior Circle A=color(#ffff007f) +#@gui :Cercle Centre / Centre Circle B=color(#40c0807f) +#@gui :Cercle / Circle C=color(#00ff007f) +#@gui :Cercle / Circle D=color(#0000ff7f) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :Décalage Ombre X / Shadow Offset X=float(0,-20,20) +#@gui :Décalage Ombre Y / Shadow Offset Y=float(0,-20,20) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Chains Solidify:samj_Chains_Solidify,samj_Chains_Solidify(1) +#@gui :_=separator() +#@gui :_=note("samj_Chains_Solidify") +#@gui :_=separator() +#@gui :_=note("Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Angle Tilt=float(0,0,360) +#@gui :_=separator() +#@gui :_=note("Circles") +#@gui :Radius Center Circle=float(6,-100,100) +#@gui :Nb Circles Surrounding=int(56,7,360) +#@gui :_=separator() +#@gui :_=note("Rings") +#@gui :Nb Rings=int(20,1,100) +#@gui :Offset Angle %=float(50,-100,100) +#@gui :Change Increment %=float(0,-100,200) +#@gui :_=separator() +#@gui :_=note("Coulors") +#@gui :Color A=color(#ff00ddff) +#@gui :Color B=color(#4800ffff) +#@gui :Color C=color(#0091ffff) +#@gui :Color D=color(#00ff90ff) +#@gui :Color E=color(#48ff00ff) +#@gui :Color F=color(#ffd900ff) +#@gui :Color G=color(#ff0000ff) +#@gui :Choice Of Colors=choice(5,"Couleurs / Colors AB","Couleurs / Colors ABC","Couleurs / Colors ABCD","Couleurs / Colors ABCDE","Couleurs / Colors ABCDEF","Couleurs / Colors ABCDEFG","Ordre ABCDEFG") +#@gui :Center Color=color(#ff7f00ff) +#@gui :Background=color(#000000ff) +#@gui :Variation=float(100,0,1000) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2020/10/24.") +#@gui Christmas Balls:samj_Noel_2016,samj_Noel_2016(1) +#@gui :_=separator() +#@gui :_=note("samj_Noel_2016") +#@gui :X Origine=float(50,0,100) +#@gui :Y Origine=float(50,0,100) +#@gui :Ellipse / Circle A=float(100,1,500) +#@gui :Ellipse B=float(150,1,500) +#@gui :Depth Max=int(7,1,13) +#@gui :Line=bool(0) +#@gui :Color=color(#f02d0fff) +#@gui :Color Variation=int(-15,-255,255) +#@gui :Spacing=float(2.5,0,8) +#@gui :Rendering=choice(2,"Ellipse A","Ellipse B","Ball A","Ball B") +#@gui :_=separator() +#@gui :_=note("Ball [light]") +#@gui :Specular Light=float(0.8,0,8) +#@gui :Specular Size=float(1,0,8) +#@gui :Shadow=float(1.5,0,4) +#@gui :Angle=float(0,-180,180) +#@gui :_=separator() +#@gui :_=note("Rotation") +#@gui :Rotate=float(0,-180,180) +#@gui :_=separator() +#@gui :_=note("Smooth [antialias]") +#@gui :Smooth [antialias]=bool(0) +#@gui :Amplitude=float(0.25,0,100) +#@gui :Edge Threshold (%)=float(10,0,100) +#@gui :Smoothness=float(0.8,0,5) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2020/10/24.") +#@gui Chryzodes:samj_Chryzodes,samj_Chryzodes(1) +#@gui :_=link("http://www.chryzode.org/fr/ligne.htm","http://www.chryzode.org/fr/ligne.htm") +#@gui :_=separator() +#@gui :_=note("New Image") +#@gui :Image Dimensions=float(100,30,400) +#@gui :Background Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("Rendering") +#@gui :Examples=choice(0,"None","431/7/VC=0","353/3/VC=0","619/4/VC=0","691/12/VC=0","613/20/VC=0","358/13/VC=1","118/20/VC=1","699/6/VC=0") +#@gui :X Position (%)=float(50,0,100) +#@gui :Y Position (%)=float(50,0,100) +#@gui :External Circle Radius=float(45,10,200) +#@gui :Number of Points - Module=int(79,10,1080) +#@gui :Multiplier=int(3,3,33) +#@gui :First Point=int(1,1,1080) +#@gui :Color Straight Lines=color(#f08040ff) +#@gui :Tilt Angle=float(0,-360,360) +#@gui :Type Straight Lines=choice(0,"Lines Inside The Circle","Over The Entire Image") +#@gui :Random Colors=choice(0,"None","Variations","Lines") +#@gui :_=separator() +#@gui :_=note("Variations Rendering Image Filter") +#@gui :Variations A=int(0,0,1080) +#@gui :Variations B=int(0,0,3) +#@gui :Variation C=bool(0) +#@gui :_=separator() +#@gui :_=note("Changes Rendering Image Filter") +#@gui :Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Deform=float(0,0,5) +#@gui :Noise=float(0,0,100) +#@gui :Draw The Circle=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2020/10/24.") +#@gui Contour Line Laser:samj_Contour_Line_Laser_LED,samj_Contour_Line_Laser_LED +#@gui :_=link("https://samjcreations.blogspot.com/2019/12/samuser-avec-gmic-gimp-decoupes-laser.html","https://samjcreations.blogspot.com/2019/12/samuser-avec-gmic-gimp-decoupes-laser.html") +#@gui :_=note("Epaissir Adoucir Les Lignes Du Contour") +#@gui :_=note("Thick / Soft Contour Line") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Type=choice(0,"Non / No","Gros/Thick Contour","Doux/Soft Contour","Gros+Doux/Thick+Soft Contour") +#@gui :Dilatation=int(1,1,48) +#@gui :Ajuster Dimension Image=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/28.") +#@gui Dessiner Un Polygone - Draw a Polygon:samj_dessiner_un_polygone,samj_dessiner_un_polygone(1) +#@gui :_=separator() +#@gui :_=note("Polygone / Polygone") +#@gui :Nombre De Côtés / Number of Sides=int(5,3,90) +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Angle Inclinaison=float(0,0,120) +#@gui :Rayon Cercle Circonscrit / Circumcircle Radius (>0 W%) (<0 H%)=float(40,-400,400) +#@gui :Rayon Cercle Intérieur / Inner Circle Radius (%)=float(50,0,100) +#@gui :Remplir Polygone Extérieur / Fill=bool(1) +#@gui :Couleur Polygone Extérieur=color(#ffff00) +#@gui :Contour Polygone Extérieur=bool(0) +#@gui :Couleur Contour Polygone Extérieur=color(#000000) +#@gui :Remplir Polygone Intérieur / Fill=bool(1) +#@gui :Couleur Polygone Intérieur=color(#0000ff) +#@gui :Contour Polygone Intérieur=bool(0) +#@gui :Couleur Contour Polygone Intérieur=color(#00ff00) +#@gui :Variation De Couleur / Color Variation=choice("Pas De Variation / No Change","Couleurs Aleatoires / Random Colors","Faiblement Nuancee / Poorly Nuanced","Moyennement Nuancee / Moderately Nuanced","Fortement Nuancee / Highly Nuanced") +#@gui :_=separator() +#@gui :_=note("cercles / circles") +#@gui :Remplir Cercle Intérieur / Fill=bool(0) +#@gui :Couleur Cercle Intérieur=color(#7f7f7f) +#@gui :Contour Cercle Intérieur=bool(0) +#@gui :Couleur Contour Cercle Intérieur=color(#000000) +#@gui :Remplir Cercle Extérieur / Fill=bool(0) +#@gui :Couleur Cercle Extérieur=color(#ffffff) +#@gui :Contour Cercle Extérieur=bool(0) +#@gui :Couleur Contour Cercle Extérieur=color(#000000) +#@gui :Dilatation (épaisseur)=int(1,1,48) +#@gui :_=separator() +#@gui :_=note("Transparence / Transparency") +#@gui :Transparence Des Couleurs / Color Transparency=int(255,0,255) +#@gui :_=separator() +#@gui :_=note("Divers / Foo") +#@gui :Flou / Blur=float(0,0,10) +#@gui :Spread=float(0,0,10) +#@gui :Déformation=float(0,0,25) +#@gui :_=separator() +#@gui :_=note("Mélange / Blend") +#@gui :Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/02.") +#@gui Egg Oeuf Granville:samj_Egg_Oeuf_Granville,samj_Egg_Oeuf_Granville(1) +#@gui :_=link("http://en.wikipedia.org/wiki/William_Anthony_Granville","http://en.wikipedia.org/wiki/William_Anthony_Granville") +#@gui :_=link("http://www.mathcurve.com/courbes2d/oeuf/oeufgranville.shtml","http://www.mathcurve.com/courbes2d/oeuf/oeufgranville.shtml") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Décalage X=float(0,-100,100) +#@gui :Valeur A Forme=float(20,0,100) +#@gui :Valeur B Forme=float(30,1,100) +#@gui :Valeur R Forme=float(10,0.1,99) +#@gui :Angle Inclinaison=float(0,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage Contours=choice(1,"Sans","Egg Oeuf","Egg Oeuf CA CB CR") +#@gui :Couleur=color(#ffff007f) +#@gui :Couleur Aléatoire / Random Color=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre=bool(0) +#@gui :X-Ombre=float(0.5,-5,5) +#@gui :Y-Ombre=float(0.5,-5,5) +#@gui :Douceur / Smoothness Ombre=float(1.8,0,5) +#@gui :Courbure / Curvature Ombre=float(0,0,1) +#@gui :Compensation Décalage Ombre X=float(0,-50,50) +#@gui :Compensation Décalage Ombre Y=float(0,-50,50) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/02.") +#@gui Egg Oeuf Hugelschaffer:samj_Egg_Oeuf_Hugelschaffer,samj_Egg_Oeuf_Hugelschaffer(1) +#@gui :_=link("http://www.mathcurve.com/courbes2d/oeuf/oeuf.shtml","http://www.mathcurve.com/courbes2d/oeuf/oeuf.shtml") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Dimension=float(50,0,100) +#@gui :Valeur A Forme=float(6,0,10) +#@gui :Valeur B Forme=float(48,0,100) +#@gui :Valeur D Forme=float(0,0,24) +#@gui :Angle Inclinaison=float(0,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage Contours=choice(1,"Sans","Egg Oeuf","Egg Oeuf CA CB") +#@gui :Couleur=color(#ffff007f) +#@gui :Couleur Aléatoire / Random Color=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre=bool(0) +#@gui :X-Ombre=float(0.5,-5,5) +#@gui :Y-Ombre=float(0.5,-5,5) +#@gui :Douceur / Smoothness Ombre=float(1.8,0,5) +#@gui :Courbure / Curvature Ombre=float(0,0,1) +#@gui :Compensation Décalage Ombre X=float(0,-20,20) +#@gui :Compensation Décalage Ombre Y=float(0,-20,20) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/02.") +#@gui Egg Oeuf Rosillo:samj_Egg_Oeuf_Rosillo,samj_Egg_Oeuf_Rosillo(1) +#@gui :_=link("http://www.mathcurve.com/courbes2d/rosillo/rosillo.shtml","http://www.mathcurve.com/courbes2d/rosillo/rosillo.shtml") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Valeur A Dimension=float(40,0,100) +#@gui :Valeur B Forme 200%A=float(200,0,400) +#@gui :Valeur C Forme 300%A=float(300,0,400) +#@gui :Angle Inclinaison=float(0,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage Contours=choice(1,"Sans","Egg Oeuf","Egg Oeuf CA CB CC") +#@gui :Couleur=color(#ffff007f) +#@gui :Couleur Aléatoire / Random Color=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre=bool(0) +#@gui :X-Ombre=float(0.5,-5,5) +#@gui :Y-Ombre=float(0.5,-5,5) +#@gui :Douceur / Smoothness Ombre=float(1.8,0,5) +#@gui :Courbure / Curvature Ombre=float(0,0,1) +#@gui :Compensation Décalage Ombre X=float(0,-50,50) +#@gui :Compensation Décalage Ombre Y=float(0,-50,50) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/02.") +#@gui Engrenages Gears Laser:samj_Engrenages_Laser_LED,samj_Engrenages_Laser_LED_Preview +#@gui :_=separator() +#@gui :_=note("Engrenages Gears Laser Cutting Engraving") +#@gui :_=link("https://samjcreations.blogspot.com/2020/01/samuser-avec-gmic-gimp-engrenages.html","https://samjcreations.blogspot.com/2020/01/samuser-avec-gmic-gimp-engrenages.html") +#@gui :_=separator() +#@gui :_=note("Paramètres / Settings") +#@gui :_=link("https://fr.wikipedia.org/wiki/Engrenage","https://fr.wikipedia.org/wiki/Engrenage") +#@gui :Module M [pixels]=int(80,10,200) +#@gui :_=note("Diminuer Angle De Pression alpha pour inscrire Z1 ou Z2 dans cercle de tête [ 14.5 par exemple ] ") +#@gui :Angle De Pression Alpha / Pressure Angle [20 Degrés]=float(20,10,20) +#@gui :Diam. Trou Central [pixels]=int(12,12,600) +#@gui :Nb De Dents Roue Z1 / Nb of Teeth Gear Z1 [13...17]=int(14,7,151) +#@gui :Nb De Dents Roue Z2 / Nb of Teeth Gear Z2 [13...39]=int(17,7,151) +#@gui :Forme=choice(1,"Dent Plus Petite - Calcul Sur Cercle De Base","Dent=Creux Sur Cercle Primitif") +#@gui :Contours +=bool(1) +#@gui :_=separator() +#@gui :_=note("Trous pour assemblage / Mechanical assembly") +#@gui :Nb. Trous Assemblage / Holes=int(2,0,12) +#@gui :Diam. Trous Assemblage / Holes [pixels]=int(19,12,600) +#@gui :Distance Du Centre / Center Spacing [pixels]=int(250,12,3000) +#@gui :Décalage Angulaire / Angular Offset [Degrés]=float(0,0,360) +#@gui :_=separator() +#@gui :_=note("Mortaise clavette trou central / Keyway cutting") +#@gui :_=link("https://fr.wikipedia.org/wiki/Clavette_(mécanique)","https://fr.wikipedia.org/wiki/Clavette_(mécanique)") +#@gui :Largeur / Width [pixels]=int(0,0,150) +#@gui :Hauteur / Height [pixels]=int(0,0,100) +#@gui :Décalage Angulaire / Angular Offset [Degrés]=float(0,0,360) +#@gui :_=separator() +#@gui :_=note("Ce script est lent car les engrenages sont dessinés point par point.") +#@gui :_=note("Le script donne 3 calques de dimensions identiques max. 7200 pixels : ") +#@gui :_=note(" - 1 calque au fond transparent avec des données techniques.") +#@gui :_=note(" - 1 calque blanc avec un dessin noir pour la roue Z2.") +#@gui :_=note(" - 1 calque blanc avec un dessin noir pour la roue Z1.") +#@gui :_=note("This script is slow because the gears are plotted point by point.") +#@gui :_=note("The script gives 3 layers of the same dimensions max.7200 pixels : ") +#@gui :_=note(" - 1 layer with transparent background with technical data.") +#@gui :_=note(" - 1 white layer with a black outline for the Z2 wheel.") +#@gui :_=note(" - 1 white layer with a black outline for the Z1 wheel.") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/01/06.") +#@gui Etoile De Pompei:samj_etoile_de_pompei_153,samj_etoile_de_pompei_153(1) +#@gui :_=separator() +#@gui :1 - Position X (%)=float(50,0,100) +#@gui :2 - Position Y (%)=float(50,0,100) +#@gui :3 - Angle Inclinaison=float(30,0,60) +#@gui :4 - Dimension (%)=float(90,0,200) +#@gui :5 6 7 8 - Couleur / Color 1=color(#ffffffff) +#@gui :9 10 11 12 -Couleur / Color 2=color(#aaffffff) +#@gui :13 14 15 16 - Couleur / Color 3=color(#006293ff) +#@gui :17 18 19 20 - Couleur / Color 4=color(#003b59ff) +#@gui :21 - Remplir Cercle / Fill Circle=bool(1) +#@gui :22 - Smooth=int(0,0,2000) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/08/21.") +#@gui Etoile De Pompei Triangles Sierpinski:samj_Etoile_De_Pompei_Triangles_Sierpinski,samj_Etoile_De_Pompei_Triangles_Sierpinski(1) +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Angle Inclinaison=float(30,0,60) +#@gui :Dimension (>0 W%) (<0 H%)=float(100,-400,400) +#@gui :Cadre=color(#000000ff) +#@gui :Afficher Cadre=choice(0,"Pas Affichage","Affichage Contours Centre","Affichage Contours") +#@gui :Récursions Sierpinski=int(5,1,7) +#@gui :Centre A=color(#ff00007f) +#@gui :Centre B=color(#ff00ff7f) +#@gui :Triangle=color(#0000ff7f) +#@gui :Demi Losange A=color(#00ffff7f) +#@gui :Demi Losange B=color(#ffff007f) +#@gui :Cercle=color(#003fff40) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :Décalage Ombre X / Shadow Offset X=float(0,-20,20) +#@gui :Décalage Ombre Y / Shadow Offset Y=float(0,-20,20) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/02.") +#@gui Etoiles Remplies Triangles Sierpinski:samj_Etoiles_Remplies_Triangles_Sierpinski,samj_Etoiles_Remplies_Triangles_Sierpinski(1) +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Nombre De Sommets=int(6,2,18) +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Rayon Cercle Extérieur / Outer Circle Radius (>0 W%) (<0 H%)=float(50,-400,400) +#@gui :Rayon Cercle Intérieur / Inner Circle Radius (%)=float(40,0,100) +#@gui :Angle Inclinaison=float(30,0,60) +#@gui :Excentricité / Eccentricity (%)=float(0,0,100) +#@gui :Angle Excentricité / Eccentricity Angle=float(0,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage=choice(1,"Pas De Contours A","Pas De Contours B","Pas De Contours C","Pas De Contours D","Contours A","Contours B","Contours C","Contours D") +#@gui :Recursions Sierpinski=int(4,0,7) +#@gui :Centre A=color(#ff00007f) +#@gui :Centre B=color(#ffc0407f) +#@gui :Sommets A=color(#0000ff7f) +#@gui :Sommets B=color(#00ffff7f) +#@gui :Cercle=color(#ffff007f) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :Décalage Ombre X / Shadow Offset X=float(0,-20,20) +#@gui :Décalage Ombre Y / Shadow Offset Y=float(0,-20,20) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Etoiles Stars Laser:samj_Etoiles_Laser_LED,samj_Etoiles_Laser_LED +#@gui :_=note("Étoiles/Stars Laser Cutting Engraving") +#@gui :_=note("Formes Arrondies / Rounded Shapes") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Dimension X Y=int(1400,800,3200) +#@gui :Nb Branches / Rays=int(5,5,72) +#@gui :Type=choice(2,"Pompei A 12 Branches/Rays","Pompei B 12 Branches/Rays"","C","Annular SteinerChains","Traits/Strokes","Gear","Spirographe 4") +#@gui :Affichage / Display Contours=choice(0,"Non / No","Contours Image","Contours Étoile/Star","Contours Image + Étoile/Star") +#@gui :Dilate=int(0,0,48) +#@gui :Cercle Central Noir/Black=float(0,0,48) +#@gui :Cercle Central Blanc/White=float(0,0,48) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/27.") +#@gui Flocon Snowflake Laser:samj_Flocon_Laser_LED,samj_Flocon_Laser_LED +#@gui :_=note("Flocon/Snowflake Laser Cutting Engraving") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Dimension X Y=int(1400,800,3200) +#@gui :Nb Branches / Rays=int(6,3,15) +#@gui :Type Flocon / Snowflake=choice(5,"A","B","C","A2","B2","C2") +#@gui :Affichage / Display Contours=choice(0,"Non / No","Contours Image","Contours Flocon/Snowflake","Contours Image + Flocon/Snowflake") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/26.") +#@gui Fractal Tree:samj_Fractal_Tree,samj_Fractal_Tree +#@gui :_=separator() +#@gui :_=link("Source code from rosettacode.org","https://www.rosettacode.org/wiki/Fractal_tree") +#@gui :X Origine=float(50,0,100) +#@gui :Y Origine=float(100,0,100) +#@gui :Angle Origine=float(-90,-360,360) +#@gui :Depth=int(8,1,13) +#@gui :Variation Dimension=float(10,1,500) +#@gui :Variation Angle=float(20,-360,360) +#@gui :Color=color(#ff0000ff) +#@gui :Color Variation [random -1]=int(20,-1,255) +#@gui :Rendering=choice("Lines","Circles A","Circles B") +#@gui :Circle Dimension=int(4,1,50) +#@gui :Dilatation=int(1,1,8) +#@gui :_=separator() +#@gui :_=note("Smooth [antialias]") +#@gui :Smooth [antialias]=bool(0) +#@gui :Amplitude=float(0.25,0,100) +#@gui :Edge Threshold (%)=float(10,0,100) +#@gui :Smoothness=float(0.8,0,5) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2020/10/24.") +#@gui Gradient CIE Lab [Linear]:samj_Linear_Gradient_CIE_Lab,samj_Linear_Gradient_CIE_Lab(1) +#@gui :_=link("http://samjcreations.blogspot.ca","http://samjcreations.blogspot.ca") +#@gui :_=separator() +#@gui :_=note("Dégradé / Gradient CIE Lab") +#@gui :Type H / V=choice(0,"H","V") +#@gui :Swap Colors=bool(0) +#@gui :Starting Color A=color(#f028a0ff) +#@gui :Ending Color B=color(#f0f028ff) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2020/10/24.") +#@gui Gradient CIE Lab [Shape]:samj_Shape_Linear_Gradient_CIE_Lab,samj_Shape_Linear_Gradient_CIE_Lab(1) +#@gui :_=link("http://samjcreations.blogspot.ca","http://samjcreations.blogspot.ca") +#@gui :_=note("Dégradé / Gradient CIE Lab") +#@gui :_=separator() +#@gui :_=note("Starting Point / Diameter :") +#@gui :X0=float(10,0,100) +#@gui :Y0=float(10,0,100) +#@gui :_=note("Ending Point / Center :") +#@gui :X1=float(90,0,100) +#@gui :Y1=float(90,0,100) +#@gui :_=note("Parameters :") +#@gui :Shape=choice(2,"Linear H","Linear V","Square","Square Overflow","Circle X0","Circle X0+YO") +#@gui :Swap Colors=bool(0) +#@gui :Starting Color A=color(#f028a0ff) +#@gui :Ending Color B=color(#f0f028ff) +#@gui :Background=choice(0,"Image","Transparent","Color") +#@gui :Background Color=color(#000000ff) +#@gui :Examples=choice(0,"None","10 10 90 90 Linear H","10 10 90 90 Linear V","10 10 90 90 Square","10 10 90 90 Square Overflow","40 40 50 50 Circle X0","40 40 50 50 Circle X0+YO","71 71 100 100 Circle X0+YO") +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2020/10/24.") +#@gui Harmonograph:Harmonograph_samj,Harmonograph_samj(1) +#@gui :_=link("http://en.wikipedia.org/wiki/Harmonograph") +#@gui :_=separator() +#@gui :_=note("Centre / Center") +#@gui :Centre / Center X (%)=float(50,0,100) +#@gui :Centre / Center Y (%)=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Harmonograph") +#@gui :Stylo / Pen (Couleur/Color)=color(#c08040ff) +#@gui :Stylo / Pen (Variation De Couleur/Color Variation)=choice("Pas De Variation / No Change","Couleurs Aleatoires / Random Colors","Faiblement Nuancee / Poorly Nuanced","Moyennement Nuancee / Moderately Nuanced","Fortement Nuancee / Highly Nuanced") +#@gui :Stylo / Pen (Dilate Pixels)=int(0,0,32) +#@gui :Itérations=int(1000,2,30000) +#@gui :Multiplier=choice(0,"Iterations * 1","Iterations * 5 LENT / SLOW","Iterations * 10 TRES LENT / VERY SLOW") +#@gui :Increment Temps / Time Increment [*10000]=float(400,10,500) +#@gui :_=separator() +#@gui :_=note("Amplitude") +#@gui :Amplitude 1 (>0 W) (<0 H)=float(150,-1000,1000) +#@gui :Amplitude 2 (>0 W) (<0 H)=float(200,-1000,1000) +#@gui :Amplitude 3 (>0 W) (<0 H)=float(200,-1000,1000) +#@gui :Amplitude 4 (>0 W) (<0 H)=float(100,-1000,1000) +#@gui :_=separator() +#@gui :_=note("Fréquence / Frequency") +#@gui :Fréquence 1=float(4,0,16) +#@gui :Fréquence 2=float(6,0,16) +#@gui :Fréquence 3=float(2,0,16) +#@gui :Fréquence 4=float(2,0,16) +#@gui :_=separator() +#@gui :_=note("Phase") +#@gui :Phase 1=float(15,0,360) +#@gui :Phase 2=float(270,0,360) +#@gui :Phase 3=float(75,0,360) +#@gui :Phase 4=float(60,0,360) +#@gui :_=separator() +#@gui :_=note("Amortissement / Damping") +#@gui :Amortissement 1=float(0.04,0,1) +#@gui :Amortissement 2=float(0.04,0,1) +#@gui :Amortissement 3=float(0.05,0,1) +#@gui :Amortissement 4=float(0.06,0,1) +#@gui :_=separator() +#@gui :_=note("Divers / Foo") +#@gui :Flou / Blur=float(0,0,10) +#@gui :Spread=float(0,0,10) +#@gui :Déformation=float(0,0,25) +#@gui :_=separator() +#@gui :_=note("Mélange / Blend") +#@gui :Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/02.") +#@gui Hawaiian Earring:samj_Hawaiian_Earring,samj_Hawaiian_Earring(1) +#@gui :_=link("http://en.wikipedia.org/wiki/Hawaiian_earring","http://en.wikipedia.org/wiki/Hawaiian_earring") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Rayon Cercle A / Circle A Radius (%)=float(40,1,200) +#@gui :Nb Cercles / Circles=int(6,2,25) +#@gui :Type N=choice(0,"Inc 1","Lin 0.1","Lin 0.2","Lin 0.3","Rand") +#@gui :Angle Inclinaison / Tilt=float(0,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage / Display Contours=bool(1) +#@gui :Cercle A / Circle A=color(#ffff007f) +#@gui :Cercles B / Circles B=color(#0000ff7f) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Miroir / Mirror=choice(0,"Sans - Wihout"," X "," Y "," X Y ") +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :Décalage Ombre X / Shadow Offset X=float(0,-20,20) +#@gui :Décalage Ombre Y / Shadow Offset Y=float(0,-20,20) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Lines of Varying Thickness:samj_Lignes_Epaisseur_Variable,samj_Lignes_Epaisseur_Variable(1) +#@gui :_=note("Lignes Épaisseur Variable / Lines Of Varying Thickness") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Orientation Lignes / Lines=choice(0,"Vertical Lines","Horizontal Lines") +#@gui :Résolution Largeur / Width=int(32,16,64) +#@gui :Épaisseur Ligne / Line Thickness=int(3,1,7) +#@gui :Fond / Background=color(#000000ff) +#@gui :Ligne / Line=color(#ffffffff) +#@gui :Inverser Fond-Ligne / Invert Background-Line=bool(0) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Resize=choice(1,"Non / No","Dim. Origines") +#@gui :Flou / Blur=int(0,0,200) +#@gui :Deblur=int(0,0,48) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation / Deform=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Orbites:samj_Orbites,samj_Orbites(1) +#@gui :_=link("https://youtu.be/_JgHQU1Fntg","https://youtu.be/_JgHQU1Fntg") +#@gui :_=separator() +#@gui :_=note("New Image") +#@gui :Image Dimensions=float(100,30,400) +#@gui :Background Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("Rendering") +#@gui :X Position (%)=float(50,0,100) +#@gui :Y Position (%)=float(50,0,100) +#@gui :Circle A Radius=float(20,10,1000) +#@gui :Number of Points Circle A=int(79,10,1080) +#@gui :Circle B Radius=float(45,1,1000) +#@gui :Multiplier Number of Points Circle B=float(2,0.1,20) +#@gui :Color Straight Lines=color(#f08040ff) +#@gui :Tilt Angle A=float(0,-360,360) +#@gui :Tilt Angle B=float(0,-360,360) +#@gui :Random Colors=bool(0) +#@gui :_=separator() +#@gui :_=note("Changes Rendering Image Filter") +#@gui :Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Deform=float(0,0,5) +#@gui :Noise=float(0,0,100) +#@gui :Draw Circles=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2018/02/04.") +#@gui Palette De Degrades:samj_Palette_De_Degrades,samj_Palette_De_Degrades_preview(1) +#@gui :_=separator() +#@gui :_=note("samj_Palette_De_Degrades - Gradient Palette") +#@gui :_=separator() +#@gui :_=note("Obtenir des degrades avec 12 couleurs plus noir et blanc en option - Lent") +#@gui :_=note("Get gradients from 12 colors with optional black and white - Slow") +#@gui :_=separator() +#@gui :Couleur - Color A=color(#9fbec3) +#@gui :Couleur - Color B=color(#37438c) +#@gui :Couleur - Color C=color(#362827) +#@gui :Couleur - Color D=color(#8c5158) +#@gui :Couleur - Color E=color(#cfafbe) +#@gui :Couleur - Color F=color(#dccac4) +#@gui :Couleur - Color G=color(#aabac0) +#@gui :Couleur - Color H=color(#82958b) +#@gui :Couleur - Color I=color(#706060) +#@gui :Couleur - Color J=color(#eda88a) +#@gui :Couleur - Color K=color(#dcc7cd) +#@gui :Couleur - Color L=color(#ead9db) +#@gui :Ajouter Du Noir - Add Black=bool(0) +#@gui :Ajouter Du Blanc - Add White=bool(0) +#@gui :Étendue Degradé - Width=int(256,2,1024) +#@gui :Hauteur D'un Degradé - Height Of One Gradient=int(2,2,20) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Pappus Chain:samj_Cercles_Tangents_Dans_Cercle,samj_Cercles_Tangents_Dans_Cercle(1) +#@gui :_=link("http://en.wikipedia.org/wiki/Pappus_chain","http://en.wikipedia.org/wiki/Pappus_chain") +#@gui :_=link("http://en.wikipedia.org/wiki/Steiner_chain","http://en.wikipedia.org/wiki/Steiner_chain") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Rayon Cercle Extérieur / Radius Outer Circle A (>0 W%) (<0 H%)=float(50,-400,400) +#@gui :Rayon Premier Cercle B=float(40,0,99) +#@gui :Angle Inclinaison / Tilt=float(0,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage / Display Contours=bool(1) +#@gui :Cercle Extérieur / Outer Circle A=color(#7f7f7f7f) +#@gui :Premier Cercle / First Circle B=color(#ff00007f) +#@gui :Cercle / Circle C=color(#00ff007f) +#@gui :Cercle / Circle D=color(#0000ff7f) +#@gui :Cercle / Circle E=color(#ff00ff7f) +#@gui :Cercle / Circle F=color(#ffff007f) +#@gui :Cercle / Circle G=color(#00ffff7f) +#@gui :Cercle / Circle H=color(#c080407f) +#@gui :Cercle / Circle I=color(#40c0807f) +#@gui :Cercle / Circle J=color(#8040c07f) +#@gui :Cercle / Circle K=color(#c040807f) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :Décalage Ombre X / Shadow Offset X=float(0,-20,20) +#@gui :Décalage Ombre Y / Shadow Offset Y=float(0,-20,20) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/20.") +#@gui Pintograph:Pintograph_samj,Pintograph_samj(1) +#@gui :_=link("http://en.wikipedia.org/wiki/Pintograph") +#@gui :_=separator() +#@gui :_=note("Centre / Center") +#@gui :Centre / Center X (%)=float(50,0,100) +#@gui :Centre / Center Y (%)=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Pintograph") +#@gui :Stylo / Pen (Couleur/Color)=color(#c08040ff) +#@gui :Stylo / Pen (Variation De Couleur/Color Variation)=choice("Pas De Variation / No Change","Couleurs Aleatoires / Random Colors","Faiblement Nuancee / Poorly Nuanced","Moyennement Nuancee / Moderately Nuanced","Fortement Nuancee / Highly Nuanced") +#@gui :Stylo / Pen (Dilate Pixels)=int(0,0,32) +#@gui :Itérations=int(1000,2,30000) +#@gui :Multiplier=choice(0,"Itérations * 1","Itérations * 5 LENT / SLOW","Itérations * 10 TRES LENT / VERY SLOW") +#@gui :Increment Temps / Time Increment [*10000]=float(400,10,500) +#@gui :_=separator() +#@gui :_=note("Amplitude") +#@gui :Amplitude 1 (>0 W) (<0 H)=float(150,-1000,1000) +#@gui :Amplitude 2 (>0 W) (<0 H)=float(200,-1000,1000) +#@gui :Amplitude 3 (>0 W) (<0 H)=float(200,-1000,1000) +#@gui :Amplitude 4 (>0 W) (<0 H)=float(100,-1000,1000) +#@gui :_=separator() +#@gui :_=note("Fréquence / Frequency") +#@gui :Fréquence 1=float(4.00,0,16) +#@gui :Fréquence 2=float(4.05,0,16) +#@gui :Fréquence 3=float(4.16,0,16) +#@gui :Fréquence 4=float(4.32,0,16) +#@gui :_=separator() +#@gui :_=note("Phase") +#@gui :Phase 1=float(75,0,360) +#@gui :Phase 2=float(150,0,360) +#@gui :Phase 3=float(75,0,360) +#@gui :Phase 4=float(60,0,360) +#@gui :_=separator() +#@gui :_=note("Divers / Foo") +#@gui :Flou / Blur=float(0,0,10) +#@gui :Spread=float(0,0,10) +#@gui :Déformation=float(0,0,25) +#@gui :_=separator() +#@gui :_=note("Mélange / Blend") +#@gui :Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/02.") +#@gui Poisson D'Avril:samj_Poisson_D_Avril,samj_Poisson_D_Avril(1) +#@gui :_=link("http://www.mathcurve.com/courbes2d/poisson/poisson.shtml","http://www.mathcurve.com/courbes2d/poisson/poisson.shtml") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Valeur A Dimension=float(40,1,100) +#@gui :Valeur K=float(2,0,4) +#@gui :Angle Inclinaison=float(0,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage Contours=choice(1,"Sans","Poisson","Poisson CA") +#@gui :Couleur A=color(#fa3c0aff) +#@gui :Couleur B=color(#ffffffff) +#@gui :Couleur Aléatoire / Random Color=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre=bool(0) +#@gui :X-Ombre=float(0.5,-5,5) +#@gui :Y-Ombre=float(0.5,-5,5) +#@gui :Douceur / Smoothness Ombre=float(1.8,0,5) +#@gui :Courbure / Curvature Ombre=float(0,0,1) +#@gui :Compensation Décalage Ombre X=float(0,-50,50) +#@gui :Compensation Décalage Ombre Y=float(0,-50,50) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/02.") +#@gui ___Rendering +#@gui Pythagoras Tree:samj_Arbre_Pythagore,samj_Arbre_Pythagore +#@gui :_=separator() +#@gui :_=link("Source code from rosettacode.org","https://rosettacode.org/wiki/Pythagoras_tree") +#@gui :X Origine=float(50,0,100) +#@gui :Y Origine=float(95,0,100) +#@gui :Depth=int(8,1,14) +#@gui :Dimension [Diff]=float(12,4,100) +#@gui :Color=color(#ff0000ff) +#@gui :Color Variation [Random -1]=int(20,-1,255) +#@gui :Rendering=choice("A","B","C") +#@gui :Dilatation=int(1,1,8) +#@gui :Rotate Tree=float(0,-180,180) +#@gui :_=separator() +#@gui :_=note("Smooth [antialias]") +#@gui :Smooth [Antialias]=bool(0) +#@gui :Amplitude=float(0.25,0,100) +#@gui :Edge Threshold (%)=float(10,0,100) +#@gui :Smoothness=float(0.8,0,5) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2020/10/24.") +#@gui _Testing +#@gui Samj +#@gui Rendering +#@gui Rosace Triangles Sierpinski:samj_Rosace_Triangles_Sierpinski,samj_Rosace_Triangles_Sierpinski(1) +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Nombre De Zones=int(6,3,24) +#@gui :Nombre De Couches=int(6,1,50) +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Rayon Premier Cercle (>0 W%) (<0 H%)=float(50,-400,400) +#@gui :Décalage Angle=float(-15,-30,30) +#@gui :Dimension Triangle=float(25,0,100) +#@gui :Recouvrement Triangle=float(5,0,100) +#@gui :Angle Inclinaison=float(30,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage Contours=choice(0,"Sans","Triangle A Et B","Triangle A","Triangle B","Triangle A Et B Et Cercle","Triangle A Et Cercle","Triangle B Et Cercle") +#@gui :Type Triangles A=choice(0,"JDH","JDE","JDB","JAH","JAE","JAB","Sans") +#@gui :Type Triangles B=choice(0,"HBI","HBF","HBC","Sans") +#@gui :Type Decalage=choice(0,"Couches","Cercles","Couches Et Cercles") +#@gui :Recursions Sierpinski=int(3,0,7) +#@gui :Triangle A=color(#0000ff7f) +#@gui :Triangle Ab=color(#ffff007f) +#@gui :Triangle B=color(#8040c07f) +#@gui :Triangle Ba=color(#4080c07f) +#@gui :Cercle=color(#00ffff7f) +#@gui :Afficher Cercle=bool(0) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :Décalage Ombre X / Shadow Offset X=float(0,-20,20) +#@gui :Décalage Ombre Y / Shadow Offset Y=float(0,-20,20) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Rotating Circles:samj_Cercles_Qui_Tournent,samj_Cercles_Qui_Tournent(1) +#@gui :_=note("Cercles Qui Tournent / Rotating Circles") +#@gui :_=link("http://rouxjeanbernard.ch/AM/html/amch57.html","http://rouxjeanbernard.ch/AM/html/amch57.html") +#@gui :_=separator() +#@gui :_=note("Nouvelle New Image") +#@gui :Dimension Image=int(800,2,32768) +#@gui :Fond / Background=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("Exemples Examples") +#@gui :Examples=choice(0,"Non No","A","B","C","D","E","F") +#@gui :_=separator() +#@gui :_=note("Param. X") +#@gui :Cax=float(1,0.5,2) +#@gui :Cbx=float(0.5,0.05,5) +#@gui :Ccx=float(0.33,0.05,5) +#@gui :Vbx=int(7,-50,50) +#@gui :Vcx=int(17,-50,50) +#@gui :_=separator() +#@gui :_=note("Param. Y") +#@gui :Cay=float(1,0.5,2) +#@gui :Cby=float(0.5,0.05,5) +#@gui :Ccy=float(0.33,0.05,5) +#@gui :Vby=int(7,-50,50) +#@gui :Vcy=int(17,-50,50) +#@gui :_=separator() +#@gui :_=note("Rendu Rendering") +#@gui :Égalite / Equality : Param. X & Param. Y=bool(1) +#@gui :Théta=int(10,1,5000) +#@gui :Ligne / Line=color(#000000ff) +#@gui :Angle Inclinaison=float(0,-360,360) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,200) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/14.") +#@gui Rows Columns:samj_Lignes_Colonnes,samj_Lignes_Colonnes +#@gui :Colonnes/Columns=int(16,2,128) +#@gui :Lignes/Rows=int(16,2,128) +#@gui :Afficher/Display=choice(0,"Lignes Colonnes/Rows Columns","Colonnes/Columns","Lignes/Rows") +#@gui :Couleur/Color=color(#00000040) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/11/20.") +#@gui Simple Geometric Shapes:samj_Formes_Geometriques_Simples,samj_Formes_Geometriques_Simples(1) +#@gui :_=separator() +#@gui :_=note("Formes Géometriques Simples / Simple Geometric Shapes") +#@gui :_=separator() +#@gui :_=note("Effet") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Couleur Externe / External Color=color(#7f7f7f7f) +#@gui :Couleur Interne / Interior Color=color(#ffff00ff) +#@gui :Couleur / Color Contour=color(#0000ffff) +#@gui :Forme / Shape=choice(5,"Polygone Inscrit Dimension 1","Polygone Inscrit Dimension 2","Cercle / Ellipse","Étoile Star Dimension 1","Étoile Star Dimension 2","Polygone Étoile Star Dimension 1","Polygone Étoile Star Dimension 2") +#@gui :Dimension 1 (% Width)=float(40,0,400) +#@gui :Dimension 2 (% Height)=float(40,0,400) +#@gui :Nb Côtés / Number Of Sides=int(4,3,26) +#@gui :Angle Inclinaison / Tilt=float(0,0,120) +#@gui :Dilate=int(0,0,48) +#@gui :Blend=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/03/09.") +#@gui ___Rendering +#@gui Snowflake 2:samj_Flocon_De_Neige,samj_Flocon_De_Neige(1) +#@gui :_=note("Ah! comme la neige a neigé! Soir d'hiver / Ėmile Nelligan") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Nb Branches / Rays=int(6,3,12) +#@gui :Rayon Cercle Extérieur / Radius Outer Circle A (>0 W%) (<0 H%)=float(50,-400,400) +#@gui :Rayon Cercle Milieu / Radius Middle Circle=float(40,1,100) +#@gui :Angle Inclinaison / Tilt=float(0,0,360) +#@gui :Récursions Contours=int(3,0,5) +#@gui :Contours=color(#c0c0c0) +#@gui :Opacité / Opacity Contours=float(1,0,1) +#@gui :Affichage / Display Contours=choice(0,"Non / No","Contours + Flocon/Snowflake","Contours") +#@gui :Recursions Flocon / Snowflake=int(3,0,5) +#@gui :Flocon / Snowflake=color(#ffffff) +#@gui :Opacité Flocon / Opacity Snowflake=float(0.7,0,1) +#@gui :Type Flocon / Snowflake=choice(0,"A","B","C","A2","B2","C2") +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :Décalage Ombre X / Shadow Offset X=float(0,-20,20) +#@gui :Décalage Ombre Y / Shadow Offset Y=float(0,-20,20) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/02.") +#@gui _Testing +#@gui Samj +#@gui Rendering +#@gui Spirographe:Spirographe_samj,Spirographe_samj(1) +#@gui :_=link("http://en.wikipedia.org/wiki/Spirograph") +#@gui :_=separator() +#@gui :_=note("Centre / Center") +#@gui :Centre / Center X (%)=float(50,0,100) +#@gui :Centre / Center Y (%)=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Spirographe") +#@gui :Rayon/Radius R (>0 W) (<0 H)=float(200,-500,500) +#@gui :Rayon/Radius R (>0 W) (<0 H)=float(50,-500,500) +#@gui :Stylo / Pen (Position) (>0 W) (<0 H)=float(150,-500,500) +#@gui :Stylo / Pen (Couleur/Color)=color(#c08040ff) +#@gui :Stylo / Pen (Variation De Couleur/Color Variation)=choice("Pas De Variation / No Change","Couleurs Aleatoires / Random Colors","Faiblement Nuancee / Poorly Nuanced","Moyennement Nuancee / Moderately Nuanced","Fortement Nuancee / Highly Nuanced") +#@gui :Stylo / Pen (Dilate Pixels)=int(0,0,32) +#@gui :Nombre De Tours / Number of Turns=float(3,0.01,20) +#@gui :Multiplier=choice(0,"Tours / Turns * 1","Tours / Turns * 10 LENT / SLOW","Tours / Turns * 100 TRES LENT / VERY SLOW") +#@gui :Incrément Angulaire / Angular Increment (Degrés)=float(1,1,360) +#@gui :Diviser / Divide=choice(0,"Increment Angulaire-Angular Increment / 1","Increment Angulaire-Angular Increment /10 LENT / SLOW","Increment Angulaire-Angular Increment /100 TRES LENT / VERY SLOW") +#@gui :Type De Rendu / Rendering Type=choice("Formule/Formula 1","Formule/Formula 2","Formule/Formula 3","Formule/Formula 4","Formule/Formula 5","Formule/Formula 6","Formule/Formula 7","Formule/Formula 8") +#@gui :Points (Rayon/Radius)=int(0,0,32) +#@gui :Points (Couleur/Color)=color(#ff0000ff) +#@gui :Lignes (Épaisseur/Thickness)=int(0,0,32) +#@gui :Lignes (Couleur/Color)=color(#ffff00ff) +#@gui :_=separator() +#@gui :_=note("Divers / Foo") +#@gui :Flou / Blur=float(0,0,10) +#@gui :Spread=float(0,0,10) +#@gui :Déformation=float(0,0,25) +#@gui :_=separator() +#@gui :_=note("Mélange / Blend") +#@gui :Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Splines Test:samj_Splines_Test,samj_Splines_Test_preview (1) +#@gui :_=separator() +#@gui :_=note("samj_Splines_Test") +#@gui :X Origine=float(50,0,100) +#@gui :Y Origine=float(50,0,100) +#@gui :Angle Origine=float(30,0,360) +#@gui :Variation Angle=float(30,-360,360) +#@gui :Variation Dimension=int(90,1,400) +#@gui :Répétition Spline=int(30,1,360) +#@gui :Répétition Dim=int(1,1,8) +#@gui :Increment Angle=float(10,-360,360) +#@gui :UA0=float(2,-100,100) +#@gui :VA0=float(2,-100,100) +#@gui :UA1=float(2,-100,100) +#@gui :VA1=float(2,-100,100) +#@gui :UB0=float(2,-100,100) +#@gui :VB0=float(2,-100,100) +#@gui :UB1=float(2,-100,100) +#@gui :VB1=float(2,-100,100) +#@gui :Couleur Spline A=color(#ffff00ff) +#@gui :Couleur Spline B=color(#00ffffff) +#@gui :Dilatation=int(1,1,8) +#@gui :Blend=bool(0) +#@gui :Version De Spline=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/09.") +#@gui Straight Lines:samj_Des_Lignes_002,samj_Des_Lignes_002(1) +#@gui :_=separator() +#@gui :_=note("Des Lignes / Straight Lines") +#@gui :_=separator() +#@gui :_=note("Paramètres des lignes") +#@gui :Nombre Lignes / Number Of Lines=int(100,1,4096) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Gris / Gray=bool(0) +#@gui :Couleur / Color=color(#c08040ff) +#@gui :Symétrie / Symmetry=int(0,0,3) +#@gui :Effet / Effect=choice(0,"1","2","3","4","5","6","7","8","9","10","11","12") +#@gui :Etendue / Extent=float(1,1,10) +#@gui :_=separator() +#@gui :_=note("Effet 12 / Effect 12") +#@gui :Origine X (% W)=float(50,-400,400) +#@gui :Origine Y (% H)=float(50,-400,400) +#@gui :_=separator() +#@gui :_=note("Distorsions") +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("Mélange / Blend") +#@gui :Mélange / Blend=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/02.") +#@gui Superposition Triangles Sierpinski:samj_Superposition_Triangles_Sierpinski,samj_Superposition_Triangles_Sierpinski(1) +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Nombre De Zones=int(6,3,24) +#@gui :Nombre De Superpositions=int(6,1,50) +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Dimension Premier Cercle (>0 W%) (<0 H%)=float(50,-400,400) +#@gui :Coeff. Superpositions=float(1,0,4) +#@gui :Hauteur Triangle=float(20,0,100) +#@gui :Angle Inclinaison=float(30,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage=choice(1,"Sans Contours Triangles Ext.","Sans Contours Triangles Int.","Sans Contours Triangles Ext. Et Lat.","Sans Contours Triangles Int. Et Lat.","Triangles Ext.","Triangles Int.","Triangles Ext. Et Lat.","Triangles Int. Et Lat.") +#@gui :Recursions Sierpinski=int(4,0,7) +#@gui :Triangle A=color(#0000ff7f) +#@gui :Triangle B=color(#ffff007f) +#@gui :Triangle Lat. A=color(#8040c07f) +#@gui :Triangle Lat. B=color(#4080c07f) +#@gui :Cercle=color(#00ffff7f) +#@gui :Afficher Cercle=bool(0) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :Décalage Ombre X / Shadow Offset X=float(0,-20,20) +#@gui :Décalage Ombre Y / Shadow Offset Y=float(0,-20,20) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Test Visu 3D:samj_Test_Visu_3D,samj_Test_Visu_3D(1) +#@gui :_=separator() +#@gui :_=note("samj_Test_Visu_3D") +#@gui :Type 3D=choice(1,"Fichier 3D .off","Elevation3d","Imageplane3d","Imagecube3d","Gmic3d") +#@gui :Fichier 3D .off=text("C:\\\\GimpEval-2.9.5-Win\\\\images_test\\\\GMIC\\\\cube.off") +#@gui :Elevation3d=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("rotate3d") +#@gui :U=bool(1) +#@gui :V=bool(1) +#@gui :W=bool(0) +#@gui :Angle=float(0,0,360) +#@gui :_=separator() +#@gui :_=note("gaussians3d") +#@gui :Size=int(0,0,32) +#@gui :Opacity=float(1,0,2) +#@gui :_=separator() +#@gui :_=note("Rendu") +#@gui :Type=choice(0,"Fx Render3d","Snapshot3d") +#@gui :Autocrop=bool(0) +#@gui :Dimensions Origine=bool(0) +#@gui :_=separator() +#@gui :_=note("fx render3d") +#@gui :Width=int(1024,8,4096) +#@gui :Height=int(1024,8,4096) +#@gui :Object Size=float(0.5,0,3) +#@gui :X Angle=float(0,0,360) +#@gui :Y Angle=float(0,0,360) +#@gui :Z Angle=float(0,0,360) +#@gui :FOV=float(45,1,90) +#@gui :X Light=float(0,-100,100) +#@gui :Y Light=float(0,-100,100) +#@gui :Z Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :Rendering=choice(2,"Dots","Wireframe","Flat","Flat Shaded","Gouraud","Phong") +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("snapshot3d") +#@gui :Dimension=int(400,256,4096) +#@gui :Zoom=float(1,1,2) +#@gui :Fond=color(#e1ffffff) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2017/01/15.") +#@gui Traits Strokes:Traits_Strokes_samj,Traits_Strokes_samj(1) +#@gui :_=separator() +#@gui :_=note("Origine") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Traits / Strokes") +#@gui :Longueur / Length (>0 %W) (<0 )=float(35,-400,400) +#@gui :Mode Variations=choice(0,"Non / No","Plus / More","Moins / Less","Plus / More [milieu-Middle]","Moins / Less [milieu-Middle]") +#@gui :Variations % (Longueur/Length)=float(100,0,1000) +#@gui :Éloignement Du Centre / Distance from Center (>0 %W) (<0 )=float(0,-400,400) +#@gui :Nombre De Traits / Number of Strokes=int(30,1,2160) +#@gui :Angle (Départ / Start)=float(0,0,360) +#@gui :Angle (Fin / End)=float(360,0,360) +#@gui :Couleur/ Color=color(#f03c78ff) +#@gui :Variation De Couleur / Color Variation=choice("Pas De Variation / No Change","Couleurs Aleatoires / Random Colors","Faiblement Nuancee / Poorly Nuanced","Moyennement Nuancee / Moderately Nuanced","Fortement Nuancee / Highly Nuanced") +#@gui :Épaisseur / Thickness=int(0,0,32) +#@gui :_=separator() +#@gui :_=note("Symétrie / Symmetry") +#@gui :Symétrie / Symmetry=bool(0) +#@gui :Longueur / Length (%)=float(20,0,100) +#@gui :_=separator() +#@gui :_=note("Divers / Foo") +#@gui :Flou / Blur=float(0,0,10) +#@gui :Spread=float(0,0,10) +#@gui :Déformation=float(0,0,25) +#@gui :_=separator() +#@gui :_=note("Mélange / Blend") +#@gui :Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Triangles Shades Adjacents:Triangles_Shades_Adjacents,Triangles_Shades_Adjacents(1) +#@gui :_=note("Image Finale / Resulting Image") +#@gui :Supprimer Calque Origine / Delete Layer Source=bool(0) +#@gui :Position Centre X / X Center=float(50,0,100) +#@gui :Position Centre Y / Y Center=float(50,0,100) +#@gui :Nb Triangles=int(60,3,360) +#@gui :Artefacts / Artifacts=int(-1,-1,10) +#@gui :_=note("Couleurs / Colors") +#@gui :Décalage Des Couleurs / Offset (Angle)=float(0,-360,360) +#@gui :- - - Centre / Center - - -=color(#ffffff) +#@gui :Couleur / Color A=color(#ff00dd) +#@gui :Couleur / Color B=color(#4800ff) +#@gui :Couleur / Color C=color(#0091ff) +#@gui :Couleur / Color D=color(#00ff90) +#@gui :Couleur / Color E=color(#48ff00) +#@gui :Couleur / Color F=color(#ffd900) +#@gui :Couleur / Color G=color(#ff0000) +#@gui :Choix Des Couleurs / Choice Of Colors=choice(5,"Couleurs / Colors AB","Couleurs / Colors ABC","Couleurs / Colors ABCD","Couleurs / Colors ABCDE","Couleurs / Colors ABCDEF","Couleurs / Colors ABCDEFG") +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :_=note("Color Balance") +#@gui :Activer / Enable Color Balance=bool(0) +#@gui :Neutral Color=color(#808080) +#@gui :Stretch Colors=bool(1) +#@gui :_=note("Mélange / Blend") +#@gui :Activer Mélange / Enable Blend=bool(0) +#@gui :Mode=choice(3,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacity=float(1,0,1) +#@gui :Revert Layers=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui ___Rendering +#@gui Twisted Rays:Twisted_Rays,Twisted_Rays(1) +#@gui :_=note("Image Finale") +#@gui :Dimension En Pixels=int(800,256,1920) +#@gui :Supprimer Calque / Delete Layer=bool(1) +#@gui :Twirl=float(0.2,-5,5) +#@gui :Mélanges Rayons / Blend Rays=choice(2,"Add","And","Average","Darken","Difference","Edges","Grainextract","Grainmerge","Multiply","Negation","Or","Screen","Softburn","Softdodge","Subtract","Xor","- NON / NO -") +#@gui :Rendu=choice(5,"Rayons Couleurs AB","Rayons Couleurs ABC","Rayons Couleurs ABCD","Rayons Couleurs ABCDE","Rayons Couleurs ABCDEF","Rayons Couleurs ABCDEFG") +#@gui :_=note("Rayons De Couleurs") +#@gui :Nombre De Rayons / Number Of Rays=int(21,3,360) +#@gui :Angle Décalage Des Couleurs A / Offset=float(0,-360,360) +#@gui :Angle Décalage Des Couleurs B / Offset=float(0,-360,360) +#@gui :Couleur / Color A=color(#0000ffff) +#@gui :Couleur / Color B=color(#00ffffff) +#@gui :Couleur / Color C=color(#00ff00ff) +#@gui :Couleur / Color D=color(#ffff00ff) +#@gui :Couleur / Color E=color(#ff0000ff) +#@gui :Couleur / Color F=color(#ff00ffff) +#@gui :Couleur / Color G=color(#ffffffff) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :_=note("Contours") +#@gui :Contours=color(#000000ff) +#@gui :Affichage / Display Contours=bool(0) +#@gui :Dilate Contours=int(2,1,16) +#@gui :Flou / Blur Contours=float(2,0,5) +#@gui :Sharpen=int(0,200,400) +#@gui :_=note("Symmetrizoscope") +#@gui :Activer Symmetrizoscope=bool(0) +#@gui :Itérations=int(5,1,32) +#@gui :Angle=float(0,0,360) +#@gui :Symmetry Sides=choice("Backward","Forward","Swap") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui _Testing +#@gui Samj +#@gui Repair +#@gui CorLine:samj_CorLine,samj_CorLine_preview +#@gui :_=note("samj_CorLine pour vieilles photos décolorées scannées \r\nsamj_CorLine for old faded scanned photos") +#@gui :_=separator() +#@gui :_=note("Couleurs") +#@gui :Balance=int(0,-64,64) +#@gui :Chroma=int(10,0,50) +#@gui :_=separator() +#@gui :_=note("Netteté") +#@gui :Netteté A=float(0.5,0,1.5) +#@gui :Netteté B=float(0,0,1.5) +#@gui :_=separator() +#@gui :_=note("Réparation") +#@gui :Type=choice(0,"Anisotropic","Diffusion") +#@gui :Amplitude=int(50,0,100) +#@gui :Répétition(s)=int(1,1,5) +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Horizontal","Duplicate Vertical") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/05/10.") +#@gui CorLine B:samj_CorLine_B,samj_CorLine_B_preview +#@gui :_=note("samj_CorLine_B pour vieilles photos décolorées scannées \r\nsamj_CorLine_B for old faded scanned photos") +#@gui :_=separator() +#@gui :_=note("Couleurs") +#@gui :Balance=int(0,-64,64) +#@gui :Gamma=float(1,0.8,2.2) +#@gui :Chroma=int(10,0,50) +#@gui :Cyan=int(0,-127,128) +#@gui :Magenta=int(0,-127,128) +#@gui :Jaune=int(0,-127,128) +#@gui :_=separator() +#@gui :_=note("Netteté") +#@gui :Netteté A=float(0.5,0,1.5) +#@gui :Netteté B=float(0,0,1.5) +#@gui :_=separator() +#@gui :_=note("Réparation") +#@gui :Type=choice(0,"Anisotropic","Diffusion") +#@gui :Amplitude=int(50,0,100) +#@gui :Répétition(s)=int(1,1,5) +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Horizontal","Duplicate Vertical") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/05/11.") +#@gui _Sequences +#@gui Spatial Transition To PNG:samj_fx_spatial_transition_to_PNG,fx_spatial_transition_preview(1) +#@gui :_=separator() +#@gui :_=note("Export all frames/layers as PNG files in :") +#@gui :_=note("/G'MIC folder used to store configuration files/Spatial_Transition_000000.png") +#@gui :_=separator() +#@gui :_=note("PNG to Video with FFMPEG :") +#@gui :_=note("ffmpeg -i Spatial_Transition_%06d.png -c:v libx264 -vf \"yadif,fps=25,format=yuv420p\" GMIC_Transition.mp4") +#@gui :_=separator() +#@gui :Number of Added Frames=_int(10,1,256) +#@gui :Shading (%)=float(0,0,100) +#@gui :Transition Shape=choice(5,"Bottom Layer","Top Layer","Custom Formula","Horizontal","Vertical","Angular","Radial","Plasma") +#@gui :Custom Formula=text{"cos(x*y/(16+32*A))"}_1 +#@gui :A-Value=float(0,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice(4,"Transition Map","Timed Image","Sequence X4","Sequence X6","Sequence X8") +#@gui :Preview Time=float(0,0,1) +#@gui :_=value(0) +#@gui :_=separator() +#@gui :Visualize the Middle Frame of the Transition.=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/10/04.") +#@gui Transition H V To PNG:samj_transition_H_V_to_PNG,samj_transition_H_V_to_PNG_Preview(1) +#@gui :_=separator() +#@gui :_=note("Export all frames/layers as PNG files in :") +#@gui :_=note("/G'MIC folder used to store configuration files/TransitionHV_000000.png") +#@gui :_=separator() +#@gui :_=note("PNG to Video with FFMPEG :") +#@gui :_=note("ffmpeg -i TransitionHV_%06d.png -c:v libx264 -vf \"yadif,fps=25,format=yuv420p\" GMIC_TransitionHV.mp4") +#@gui :_=separator() +#@gui :1 - Number of Frames=_int(10,3,300) +#@gui :2 - Transition Shape=choice(1,"Horizontal A","Horizontal B","Vertical A","Vertical B") +#@gui :3 - Reverse Scrolling=bool(0) +#@gui :_=separator() +#@gui :4 - Visualize the Middle Frame of the Transition.=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/04/26.") +#@gui _Various +#@gui BoxFiter Map:samj_BoxFiter_Map,samj_BoxFiter_Map(1) +#@gui :_=note("samj_BoxFiter_Map") +#@gui :_=separator() +#@gui :_=note("BoxFiter") +#@gui :Blur=int(2,0,32) +#@gui :X=int(3,1,32) +#@gui :Y=int(3,1,32) +#@gui :Codage=choice(0,"Gray","Luminance") +#@gui :Blend=choice(0,"Alpha","Add") +#@gui :_=separator() +#@gui :_=note("Sharpen") +#@gui :Type=choice(0,"No","Decompose 2","Decompose 6") +#@gui :Itérations=int(2,0,3) +#@gui :_=separator() +#@gui :_=note("Map") +#@gui :Equalize=int(127,1,256) +#@gui :Colormap=int(16,2,256) +#@gui :Dithering=float(0,0,1) +#@gui :_=separator() +#@gui :_=note("Transfer Color - Slow") +#@gui :Transfer=bool(0) +#@gui :Luminosity Constraints=float(0.2,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/11/13.") +#@gui BoxFiter Test:samj_BoxFiter_Test,samj_BoxFiter_Test(1) +#@gui :_=note("samj_BoxFiter_Test") +#@gui :Blur=int(2,0,32) +#@gui :X=int(3,1,32) +#@gui :Y=int(3,1,32) +#@gui :_=separator() +#@gui :_=note("Sharpen") +#@gui :Type=choice(1,"No","Decompose 2","Decompose 6") +#@gui :Itérations=int(2,0,3) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/11/12.") +#@gui Carres Lignes - Squares Lines:samj_Carres_Lignes,samj_Carres_Lignes(0) +#@gui :_=separator() +#@gui :_=note("Ce filtre est très lent - This filter is very slow") +#@gui :_=separator() +#@gui :1 - Densité/Density=int(2000,10,10000) +#@gui :2 - Variation=float(3,0,100) +#@gui :3 - Graine/Seed=int(1234,0,65536) +#@gui :4 - Degradation=int(0,0,10) +#@gui :_=note("Carrés/Squares") +#@gui :5 - Alpha=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Lignes/Lines") +#@gui :6 - Densité/Density=float(1.5,0,100) +#@gui :7 - Alpha LA=float(0,0,1) +#@gui :8 - Alpha LB=float(0,0,1) +#@gui :9 - Dilate=int(1,1,5) +#@gui :_=separator() +#@gui :_=note("Fond/Background") +#@gui :10 11 12 13 - Fond/Background=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/08/29.") +#@gui CeKoaSa 001:samj_CeKoaSa_001,samj_CeKoaSa_001(1) +#@gui :_=separator() +#@gui :Douceur / Smoothness=float(0,0,10) +#@gui :Seuil / Threshold=float(15,0,50) +#@gui :Déformation=float(3,0,6) +#@gui :Renforcer Couleurs / Boost=bool(1) +#@gui :Taille / Size=int(3,1,10) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/11/24.") +#@gui CeKoaSa 002:samj_CeKoaSa_002,samj_CeKoaSa_002(1) +#@gui :_=separator() +#@gui :Douceur / Smoothness=float(0,0,10) +#@gui :Seuil / Threshold=float(15,0,50) +#@gui :Déformation=float(3,0,6) +#@gui :Renforcer Couleurs / Boost=bool(1) +#@gui :Taille / Size=int(3,1,10) +#@gui :Otsu=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/11/24.") +#@gui CeKoaSa 003:samj_CeKoaSa_003,samj_CeKoaSa_003(1) +#@gui :_=separator() +#@gui :Douceur / Smoothness=float(0,0,10) +#@gui :Seuil / Threshold=float(5,0,50) +#@gui :Déformation=float(1,0,6) +#@gui :Renforcer Couleurs / Boost=bool(1) +#@gui :Taille / Size=int(3,1,10) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/11/24.") +#@gui CeKoaSa 004:samj_CeKoaSa_004,samj_CeKoaSa_004(1) +#@gui :_=separator() +#@gui :Modulo=int(30,0,130) +#@gui :Négatif=bool(0) +#@gui :Filtre B&W Pencil=int(0,0,120) +#@gui :Opacité / Opacity=float(0.8,0.5,1) +#@gui :Filtre Denoise=int(0,0,20) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/11/24.") +#@gui CeKoaSa 005:samj_CeKoaSa_005,samj_CeKoaSa_005(1) +#@gui :_=separator() +#@gui :_=note("Grille / Grid") +#@gui :Grille / Grid X=int(16,2,100) +#@gui :Grille / Grid Y=int(16,2,100) +#@gui :Grille Carrée X=bool(0) +#@gui :Grille Carrée Y=bool(0) +#@gui :_=separator() +#@gui :_=note("Couleurs / Colors") +#@gui :Intensité=float(0.2,0,1) +#@gui :Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :Inverser Calques / Revert Layers=bool(0) +#@gui :Normaliser=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/11/24.") +#@gui CeKoaSa 007:samj_CeKoaSa_007,samj_CeKoaSa_007 (1) +#@gui :_=separator() +#@gui :_=note("samj_CeKoaSa_007") +#@gui :Max Patch=int(8,1,32) +#@gui :Min Patch=int(8,1,32) +#@gui :Dilate=int(10,1,16) +#@gui :Pixelize=int(8,2,100) +#@gui :Blur=int(8,0,30) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2016/11/15.") +#@gui CeKoaSa 008:samj_CeKoaSa_008,samj_CeKoaSa_008_preview(1) +#@gui :_=separator() +#@gui :_=note("Filtre Lent") +#@gui :Détection A=int(64,0,127) +#@gui :Détection B=int(64,0,127) +#@gui :Flou Lissage=float(4,0,10) +#@gui :Couleur=float(1,0,4) +#@gui :Rendu=int(2,1,7) +#@gui :_=separator() +#@gui :_=note("Topographic Map") +#@gui :Levels=int(16,4,256) +#@gui :Smoothness=float(1,0,5) +#@gui :_=separator() +#@gui :_=note("Stained Glass") +#@gui :Edges=float(20,0,100) +#@gui :Shading=float(0.1,0,0.5) +#@gui :Thin Separators=bool(0) +#@gui :Intensité=int(1,1,8) +#@gui :_=separator() +#@gui :_=note("Isophotes") +#@gui :Isophotes Nb Levels=int(64,1,128) +#@gui :_=separator() +#@gui :_=note("Smooth [antialias]") +#@gui :Smooth [antialias]=bool(1) +#@gui :Amplitude=float(2,0,100) +#@gui :Edge Threshold (%)=float(10,0,100) +#@gui :Smoothness=float(0.8,0,5) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond=color(#ffffffff) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/04.") +#@gui CeKoaSa 009:samj_CeKoaSa_009,samj_CeKoaSa_009(0) +#@gui :_=separator() +#@gui :_=link("Essai adaptation du didacticiel de Sebastien Guyader et du code de Iain Fergusson","https://discuss.pixls.us/t/highlight-bloom-and-photoillustration-look/2509/29") +#@gui :_=separator() +#@gui :_=note("Smooth") +#@gui :Itérations=int(1,1,10) +#@gui :Amplitude=float(5,0,1000) +#@gui :Sharpness=float(0.5,0,2) +#@gui :Anisotropy=float(0.63,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(2.35,0,10) +#@gui :Spatial Precision=float(0.8,0.1,2) +#@gui :Angular Precision=float(30,1,180) +#@gui :Value Precision=float(2,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :_=separator() +#@gui :_=note("Iain Fergusson - Simplelocal Contrast") +#@gui :Edge Sensitivity=float(25,0,25) +#@gui :Itérations=int(1,1,5) +#@gui :Paint Effect=float(50,0,50) +#@gui :Channels=choice(1,"Colour","Luminance Only") +#@gui :Pre Gamma=float(1.0,0.1,5) +#@gui :Post Gamma=float(1.2,0.1,5) +#@gui :_=note("Luminance Mask") +#@gui :Blacks=float(1,0,1) +#@gui :Dark Grey=float(1,0,1) +#@gui :Mid Grey=float(1,0,1) +#@gui :Light Grey=float(1,0,1) +#@gui :Whites=float(1,0,1) +#@gui :Parallel Processing=choice(1,"Auto","None") +#@gui :_=separator() +#@gui :_=note("Wavelet Sharpen") +#@gui :Wavelet Sharpen Vs Graphic Novel=choice(0,"Wavelet Sharpen","Photocomix Graphic Novel") +#@gui :Type=choice(0,"Decompose 2","Decompose 6") +#@gui :Itérations=int(0,0,2) +#@gui :_=separator() +#@gui :_=note("Script Origine de Iain Fergusson") +#@gui :Script Origine=bool(0) +#@gui :_=separator() +#@gui :_=note("Courbes") +#@gui :Utiliser Courbes=choice(0,"Non"," Utiliser Curves Interactive") +#@gui :Colorspace=choice(7,"RGB","CMY","CMYK","HSI","HSL","HSV","Lab","Lch","YCbCr") +#@gui :_=value(0) +#@gui :Apply Transformation From=_choice("New Curves [interactive]","Curves Defined Previously") +#@gui :_=value(0) +#@gui :_=value(0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2017/01/05.") +#@gui CeKoaSa 010:samj_CeKoaSa_010,samj_CeKoaSa_010(1) +#@gui :Flou A=int(30,0,128) +#@gui :Flou B=int(10,0,128) +#@gui :Diff A=float(0.1,0.1,16) +#@gui :Diff B=float(2,0.1,16) +#@gui :Isop=int(10,2,16) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/11/18.") +#@gui CeKoaSa 011:samj_CeKoaSa_011,samj_CeKoaSa_011(0) +#@gui :_=separator() +#@gui :_=note("Masque") +#@gui :Flou=float(0.2,0,32) +#@gui :Ditheredbw=choice(0,"Non","A","B","C") +#@gui :Bump2Normal=bool(0) +#@gui :Orientation=choice(5,"A","B","C","D","E","F") +#@gui :_=separator() +#@gui :_=note("Mélange Blend Image Origine") +#@gui :Mélange=bool(0) +#@gui :_=separator() +#@gui :_=note("Degrade") +#@gui :Ajouter Degrade=bool(0) +#@gui :Type H / V=choice(0,"H","V") +#@gui :Swap Colors=bool(0) +#@gui :Starting Color A=color(#f028a0ff) +#@gui :Ending Color B=color(#f0f028ff) +#@gui :_=separator() +#@gui :_=note("Niveaux Masque") +#@gui :Valider Niveaux=bool(0) +#@gui :Valeur 1=float(50,0,255) +#@gui :Valeur 2=float(205,0,255) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/03/19.") +#@gui Diaporama - Slideshow:samj_diaporama,gui_no_preview +#@gui :_=note("Ce filtre démarre un diaporama automatique en mode plein écran.\n Paramétrage à faire :\n - Calques en entrée = Tous.\n - Mode de sortie = Nouvelle image.") +#@gui :_=note(" - Delai / Time Secondes = Temps d'affichage de chaque calque.\n - Diaporama Infini / Infinite slideshow = Boucle infinie d'affichage des images.") +#@gui :_=note("Utilisation du clavier :\n - Barre d'espacement ou Entrée = Image suivante.\n - Échap ou Q = Sortie du diaporama.\n - Page Haut = Image précédente.") +#@gui :_=separator() +#@gui :_=note("This filter starts an automatic slideshow in full screen mode.\n Important settings to do :\n - Input layers = All.\n - Output mode = New image.") +#@gui :_=note(" - Delai / Time Secondes = Display time of each layer.\n - Diaporama Infini / Infinite slideshow = Infinite image display loop.") +#@gui :_=note("Using the keyboard :\n - Space bar or Enter = Next image.\n - Esc or Q = Exit.\n - Page UP = Previous image.") +#@gui :_=separator() +#@gui :Delai / Time Secondes=int(1,1,300) +#@gui :Diaporama Infini / Infinite Slideshow=bool(0) +#@gui Do Nothing:Je_passe_l_hiver_en_Floride,Je_passe_l_hiver_en_Floride +#@gui :_=note("Note : This filters does nothing on the image. Use it to manipulate layers in conjunction with the input/output options of the G'MIC plug-in.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/12/29.") +#@gui Layers To PNG:samj_Layers_To_PNG,samj_Layers_To_PNG_Preview +#@gui :_=separator() +#@gui :_=note("Enregistre chaque calque comme une image PNG) +#@gui :_=note("Save all layers as a PNG file) +#@gui :_=separator() +#@gui :_=note("Paramétrage pour une animation :\n - Calques en entrée = Tous.") +#@gui :_=note("Settings for an animation :\n - Input layers = All") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/04/13.") +#@gui Polygonize:polygonize_GUI,polygonize_GUI(0) +#@gui :_=separator() +#@gui :_=note("Paramètres filtre Polygonize / Polygonize parameters") +#@gui :Amplitude=int(300,0,2000) +#@gui :Douceur / Smoothness=float(10,0,100) +#@gui :Surface Minimale / Minimal Area=float(10,0,100) +#@gui :X-Resolution=float(10,1,256) +#@gui :Y-Resolution=float(10,1,256) +#@gui :_=separator() +#@gui :_=note("Test") +#@gui :Test Cadre Et Otsu=int(0,0,256) +#@gui :_=separator() +#@gui :_=note("Filtre créé par David Tschumperlé Dernière mise à jour : 2020/11/24.") +#@gui Recolorize 20130115:gimp_recolorize_20130115_modifie,gimp_recolorize_20130115_modifie(1) +#@gui :_=link("http://www.flickr.com/groups/gmic/discuss/72157632525934815/","http://www.flickr.com/groups/gmic/discuss/72157632525934815/") +#@gui :_=link("http://www.gimpchat.com/viewtopic.php?f=28&t=6207&start=0","http://www.gimpchat.com/viewtopic.php?f=28&t=6207&start=0") +#@gui :Douceur / Smoothness=float(30,0,200) +#@gui :Nuances/decompose=choice(0,"Origine","Canal Y De YUV","Canal L De HSL 8","Canal L De LCH","Canal K De CMYK") +#@gui :Étendue / Normalize A=int(0,0,255) +#@gui :Étendue / Normalize B=int(255,0,255) +#@gui :Dégoulinade A / Extension Colors A=int(0,0,20) +#@gui :Dégoulinade B / Extension Colors B=float(0,0,10) +#@gui :Précision=bool(1) +#@gui :_=separator() +#@gui :_=note{"Note : This filter needs two layers to work properly. The bottom layer can be a B&W or a colored image, while the top layer contains color patches that will be extrapolated in a smart way (edge-directed) to fill the entire image. At the end, you get a completely recolored image."} +#@gui :_=separator() +#@gui :_=note("Auteur / Author : David Tschumperlé. Dernière mise à jour: 2013/01/18 samj.") +#@gui Relief A:samj_Relief_A,samj_Relief_A(1) +#@gui :_=separator() +#@gui :_=note("Vanvliet") +#@gui :Variation=float(3,0,6) +#@gui :Order=int(1,0,3) +#@gui :Axis=choice(0,"X","Y","-X","-Y") +#@gui :Boundary=choice(1,"Dirichlet","Neumann") +#@gui :_=separator() +#@gui :_=note("Iain Fergusson - Simplelocal Contrast") +#@gui :Edge Sensitivity=float(16,0,25) +#@gui :Itérations=int(1,1,5) +#@gui :Paint Effect=float(50,0,50) +#@gui :Channels=choice(1,"Colour","Luminance Only") +#@gui :Pre Gamma=float(1.0,0.1,5) +#@gui :Post Gamma=float(1.2,0.1,5) +#@gui :_=note("Luminance Mask") +#@gui :Blacks=float(1,0,1) +#@gui :Dark Grey=float(1,0,1) +#@gui :Mid Grey=float(1,0,1) +#@gui :Light Grey=float(1,0,1) +#@gui :Whites=float(1,0,1) +#@gui :Parallel Processing=choice(1,"Auto","None") +#@gui :_=separator() +#@gui :_=note("Wavelet Sharpen") +#@gui :Sharpen=choice(0,"Sharpen A","Sharpen B","Sharpen A B") +#@gui :Sharpen A Type=choice(0,"Decompose 2","Decompose 6") +#@gui :Sharpen A Itérations=int(0,0,2) +#@gui :Sharpen B Type=choice(0,"Decompose 2","Decompose 6") +#@gui :Sharpen B Itérations=int(0,0,2) +#@gui :_=separator() +#@gui :_=note("Relief") +#@gui :Cut A %=float(0,0,100) +#@gui :Cut B %=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2020/10/24.") +#@gui Segments Points TSP:samj_TSP_Segments_GUI,samj_TSP_Segments_GUI(0) +#@gui :_=separator() +#@gui :_=note("TSP - samj_Masques_Noir_Et_Blanc") +#@gui :1 - Flou/Blur=float(3,0,10) +#@gui :2 - Masque/Mask %=float(50,20,80) +#@gui :_=separator() +#@gui :3 - Variation Segments=float(2,0,10) +#@gui :4 - Densité/Density=float(0.5,0.01,1) +#@gui :5 - Graine/Seed=int(12345,0,123456) +#@gui :6 - Dilate=int(0,0,10) +#@gui :7 8 9 10 - Fond/Background=color(#000000ff) +#@gui :11 - Deformation=int(0,0,10) +#@gui :12 - Boost Couleur/Color=float(1,1,1.2) +#@gui :13 - X=choice(1,"Sans/Without","X") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/08/28.") +#@gui SVG Symetries A:samj_SVG_Symetries_A,samj_SVG_Symetries_A_preview(1) +#@gui :_=separator() +#@gui :_=note("Prévisualisation : Les couleurs sont aléatoires.") +#@gui :_=note("Preview : The colors displayed are random.") +#@gui :_=separator() +#@gui :_=note("Formes") +#@gui :1 Répétitions=int(8,3,90) +#@gui :2 Amplitude A=float(0,0,1) +#@gui :3 Angle A=float(0,-2,2) +#@gui :4 Amplitude B=float(0.33,0,1) +#@gui :5 Angle B=float(1,-2,2) +#@gui :6 Amplitude C=float(0.66,0,1) +#@gui :7 Angle C=float(-1,-2,2) +#@gui :8 Amplitude D=float(1,0,1) +#@gui :9 Angle D=float(0.5,-2,2) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("SVG") +#@gui :10 - Couleur Ligne/ Stroke Color=_choice(0,"Black","Blue","Brown","Chartreuse","Chocolate","Coral","Cyan","DarkRed","DeepPink","FireBrick","ForestGreen","Fuchsia","Gold","Green","HotPink","Indigo","Lime","Magenta","Maroon","Olive","Orange","Orchid","Pink","Purple","Red","Salmon","SeaGreen","Sienna","Violet","Wheat","White","Yellow") +#@gui :11 - Épaisseur Ligne/ Stroke Width=_int(2,1,10) +#@gui :_=separator() +#@gui :_=note("SVG - Filtre Ombre Portée/Drop Shadow Filter ") +#@gui :12 - Ombre Portée/Drop Shadow=bool(0) +#@gui :13 - X=_int(-5,-10,10) +#@gui :14 - Y=_int(5,-10,10) +#@gui :15 - Couleur Ombre/ Shadow Color=_choice(0,"Black","Blue","Brown","Chartreuse","Chocolate","Coral","Cyan","DarkRed","DeepPink","FireBrick","ForestGreen","Fuchsia","Gold","Green","HotPink","Indigo","Lime","Magenta","Maroon","Olive","Orange","Orchid","Pink","Purple","Red","Salmon","SeaGreen","Sienna","Violet","Wheat","White","Yellow") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2022/04/10.") +#@gui SVG TSP:samj_GUI_Test_Liste_Points_TSP,samj_GUI_Test_Liste_Points_TSP_Preview +#@gui :_=separator() +#@gui :_=note("Les zones noires des masques seront remplies de lignes.") +#@gui :_=note("The black areas of the masks will be filled with lines.") +#@gui :_=separator() +#@gui :_=note("Masque/Mask 1 - Gauche/Left") +#@gui :1 - Flou/Blur=float(0,0,10) +#@gui :2 - Masque/Mask %=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Masque/Mask 2 - Droite/Right") +#@gui :3 - Flou/Blur=float(3,0,10) +#@gui :4 - Masque/Mask %=float(48,0,100) +#@gui :_=separator() +#@gui :_=note("SVG) +#@gui :_=separator() +#@gui :5 - Précision=_float(1,0.1,2) +#@gui :6 - Couleur Ligne/ Stroke Color=_choice(0,"Black","Blue","Brown","Chartreuse","Chocolate","Coral","Cyan","DarkRed","DeepPink","FireBrick","ForestGreen","Fuchsia","Gold","Green","HotPink","Indigo","Lime","Magenta","Maroon","Olive","Orange","Orchid","Pink","Purple","Red","Salmon","SeaGreen","Sienna","Violet","Wheat","White","Yellow") +#@gui :7 - Épaisseur Ligne/ Stroke Width=_int(2,1,10) +#@gui :_=separator() +#@gui :8 - 2 Contours=bool(1) +#@gui :_=separator() +#@gui :_=note("SVG - Filtre Ombre Portée/Drop Shadow Filter ") +#@gui :9 - Ombre Portée/Drop Shadow=bool(1) +#@gui :10 - X=_int(-5,-10,10) +#@gui :11 - Y=_int(5,-10,10) +#@gui :12 - Couleur Ombre/ Shadow Color=_choice(0,"Black","Blue","Brown","Chartreuse","Chocolate","Coral","Cyan","DarkRed","DeepPink","FireBrick","ForestGreen","Fuchsia","Gold","Green","HotPink","Indigo","Lime","Magenta","Maroon","Olive","Orange","Orchid","Pink","Purple","Red","Salmon","SeaGreen","Sienna","Violet","Wheat","White","Yellow") +#@gui :_=separator() +#@gui :13 - Courbes De Bézier/Curves=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/03/18.") +#@gui Test A:samj_test_A,samj_test_A(1) +#@gui :_=note("samj_test_A") +#@gui :A=int(64,0,255) +#@gui :B=int(192,0,255) +#@gui :C=int(500,0,10000) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/03/14.") +#@gui Test B:samj_test_B,gui_no_preview +#@gui :_=note("samj_test_B") +#@gui :A=int(100,10,200) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/03/15.") +#@gui Test C:samj_test_C,gui_no_preview +#@gui :_=note("samj_test_C") +#@gui :A=int(100,10,200) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/03/16.") +#@gui Test Courbes:samj_test_x_color_curves,samj_test_x_color_curves(0) +#@gui :_=note("Demo. samj_test_x_color_curves") +#@gui :_=note("") +#@gui :Utiliser=choice(1,"X Color Curves","Gimp Curves Interactive") +#@gui :Appliquer Courbes=choice("Aucun","Appliquer Le Dernier","RGB","CMY","CMYK","HSI","HSL","HSV","Lab","Lch","YCbCr") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/03/04.") +#@gui Test D:samj_test_D,samj_test_D(1) +#@gui :_=note("samj_test_D") +#@gui :Var Sub=float(40,0,255) +#@gui :Var N=float(255,0,255) +#@gui :Var Spread=float(10,0,60) +#@gui :Var Dilate=float(30,0,60) +#@gui :Var Blur=float(5,0,20) +#@gui :Déformation=float(0,0,5) +#@gui :_=separator() +#@gui :Levels=int(8,1,256) +#@gui :Smoothness=float(0,0,5) +#@gui :Var Dilate Circ=float(4,0,60) +#@gui :_=separator() +#@gui :Inner Fading=float(0,0,100) +#@gui :Outer Fading=float(25,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/01/19.") +#@gui Test Dither Color:samj_test_Dither_Color,samj_test_Dither_Color(1) +#@gui :_=note("samj_test_Dither_Color") +#@gui :Flou=int(2,0,10) +#@gui :Dilatation=int(0,0,10) +#@gui :Couleur Fond=color(#e6e696) +#@gui :Tolerance (%)=float(0,0,100) +#@gui :Smoothness (%)=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/11/08.") +#@gui Test E:samj_test_E,samj_test_E(1) +#@gui :_=note("samj_test_E") +#@gui :_=note("Exemples") +#@gui :Exemple=choice("Non/No","A","B","C") +#@gui :_=note("diffusiontensors") +#@gui :Sharpness=float(0.7,0,2) +#@gui :Anisotropy=float(0.3,0,1) +#@gui :Alpha=float(0.6,0,10) +#@gui :Sigma=float(1.1,0,10) +#@gui :Is Sqrt=bool(0) +#@gui :_=note("Blend") +#@gui :Fond / Background Color=color(#c87d32) +#@gui :Mode=choice("Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/01/19.") +#@gui Test F:samj_test_F,samj_test_F(1) +#@gui :_=note("samj_test_F") +#@gui :_=note("Flou Effet Verre") +#@gui :A=float(40,0.1,200) +#@gui :B=float(50,0.1,200) +#@gui :Itérations=int(1,1,8) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/04/20.") +#@gui Test G:samj_test_G,samj_test_G(1) +#@gui :_=note("samj_test_G") +#@gui :A=int(0,0,20) +#@gui :B=float(0,0,10) +#@gui :C=float(0,0,1) +#@gui :D=int(30,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/01/20.") +#@gui Test Solidify:samj_Test_Solidify,samj_Test_Solidify (1) +#@gui :_=separator() +#@gui :_=note("samj_Quelques_Isophotes") +#@gui :Épaisseur=int(10,1,32) +#@gui :Précision=int(10,1,32) +#@gui :Coeff Précision=float(1,0.1,8) +#@gui :Coeff Flou=float(0.02,0,1) +#@gui :Isophotes=int(8,2,32) +#@gui :_=separator() +#@gui :_=note("Solidify") +#@gui :Valider Solidify=bool(1) +#@gui :Smoothness %=float(75,0,100) +#@gui :Diffusion Type=choice(0,"Isotropic","Delaunay Oriented","Edge Oriented") +#@gui :Diffusion Iter=int(20,1,200) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2017/01/05.") +#@gui Tests Fill:samj_Tests_Fill,samj_Tests_Fill +#@gui :_=note("Adaptation des exemples de David Tschumperlé, Garry Osgood") +#@gui :_=separator() +#@gui :_=note("Type Fill") +#@gui :1 - Fill=choice(0,"Logo","Julia 1","Julia 2","Courbe","Vector Painting","Gradients","Colorisation","Lignes","Motifs","Couleur","Negatif","Artistic") +#@gui :_=separator() +#@gui :_=note("----- Logo -----") +#@gui :2 - Rayon=int(30,0,100) +#@gui :_=note("----- Julia 1 -----") +#@gui :3 - Zoom=float(2,0.5,4) +#@gui :4 - A=float(-0.8,-1.6,1.6) +#@gui :5 - B=float(0.4,-0.8,0.8) +#@gui :_=note("----- Courbe -----") +#@gui :6 - Display Parametric=bool(1) +#@gui :_=note("----- Vector Painting -----") +#@gui :7 - A=int(1,1,50) +#@gui :_=note("----- Gradients -----") +#@gui :8 - Choix=choice(0,"H","V","H V","Sur Image","2 Couleurs") +#@gui :_=note("----- Lignes -----") +#@gui :9 - Choix=choice(0,"Diagonale","Diagonale Négatif","45 Degrés","Verticales Grises 4 Pix.","Médiane") +#@gui :_=note("----- Motifs -----") +#@gui :10 - Choix=choice(0,"A","B") +#@gui :_=note("----- Couleur -----") +#@gui :11,12,13 - Couleur=color(#7828f0) +#@gui :_=note("----- Artistic -----") +#@gui :14 - Choix=choice(0,"Série Dégradés V","Série Dégradés H","Série 2 - Dégradés V","Série 2 - Dégradés H","Hallucinogen","Zones Couleurs","XorXY","XorXY Blend","Distraction","Carrés","Rayons","Rayé","Tamis") +#@gui :15 - Variation Artistic=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/11/29.") +#@gui Texture 002:samj_gimp_texture_zero_zero_deux,samj_gimp_texture_zero_zero_deux(1) +#@gui :Détails=int(0,0,127) +#@gui :Résolution=float(10,4,20) +#@gui :Threshold=float(4,2,20) +#@gui :_=separator() +#@gui :Edges=float(10,5,20) +#@gui :Blend Colors=float(0.5,0,1) +#@gui :Colors Boost=bool(1) +#@gui :Boost Intensity=float(1,0,1) +#@gui :_=separator() +#@gui :Black Lines=bool(1) +#@gui :Blend Black Lines=float(0.3,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2016/11/16.") +#@gui Texture 003:samj_Texture_Aquarelle_1,samj_Texture_Aquarelle_1(1) +#@gui :_=note("Texture") +#@gui :Amplitude Noise=float(10,5,200) +#@gui :Density Hardsketchbw=float(10,5,100) +#@gui :Spread Variations=float(4,3,20) +#@gui :Amplitude Water=float(3,2,10) +#@gui :_=separator() +#@gui :_=note("Couleur / Color") +#@gui :Couleur / Color=color(#fbedce) +#@gui :Opacité / Opacity=float(1,-1,1) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2016/11/16.") +#@gui Toile Araignee:samj_Toile_D_Araignee,samj_Toile_D_Araignee(1) +#@gui :Détails=int(0,0,127) +#@gui :Résolution=float(10,4,20) +#@gui :Threshold=float(4,2,20) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2016/11/16.") +#@gui Tout Interactif:samj_test_tout_interactif,gui_no_preview +#@gui :_=note("Demo. Tout interactif") +#@gui :_=note("") +#@gui :_=note("2 filtres interactifs successifs : x_paint et threshold") +#@gui :_=note("x_paint : Choisir un pinceau, appliquer et fermer image") +#@gui :_=note("threshold : Appliquer la souris et fermer image") +#@gui :_=note("") +#@gui :_=note("2 successive interactive filters : x_paint et threshold") +#@gui :_=note("x_paint : Choose a brush, apply and close picture") +#@gui :_=note("threshold : Move the mouse and close picture") +#@gui :_=note("") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/03/03.") +#@gui Triangles Lignes - Lines:samj_Triangles_Lignes,samj_Triangles_Lignes(0) +#@gui :_=separator() +#@gui :_=note("Ce filtre est très lent - This filter is very slow") +#@gui :_=separator() +#@gui :1 - Densité/Density=int(2000,10,10000) +#@gui :2 - Variation=float(3,0,100) +#@gui :3 - Graine/Seed=int(1234,0,65536) +#@gui :4 - Degradation=int(0,0,10) +#@gui :_=note("Triangles") +#@gui :5 - Alpha=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Lignes/Lines") +#@gui :6 - Densité/Density=float(1.5,0,100) +#@gui :7 - Alpha LA=float(0,0,1) +#@gui :8 - Alpha LB=float(0.5,0,1) +#@gui :9 - Alpha LC=float(0.5,0,1) +#@gui :10 - Dilate=int(1,1,5) +#@gui :_=separator() +#@gui :_=note("Fond/Background") +#@gui :11 12 13 14 - Fond/Background=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/08/25.") +#@gui ___Rendering +#@gui Disco:disco,disco_preview(1) +#@gui :Red Wavelength=int(10,1,50) +#@gui :Green Wavelength=int(15,1,50) +#@gui :Blue Wavelength=int(20,1,50) +#@gui :Zoom=float(250,0,3000) +#@gui :_=separator() +#@gui :_=note("This is a failed attempt on a conversion of a Mathmap script written by persons unknown") +#@gui :_=note("I prefer this over the filter I was attempting to recreate!!!.") +#@gui :_=note("Create a light effect with the size and aspect ratio of the input image.") +#@gui Kitaoka Spin Illusion:KittyRings,KittyRings_preview(1) +#@gui :Sectors=float(30,10,80) +#@gui :Zoom=float(8,1,30) +#@gui :Inner Radius=float(0,0,2) +#@gui :Outer Radius=float(1,0,2) +#@gui :1st Color=color(#710071) +#@gui :2nd Color=color(#00ff00) +#@gui :_=separator() +#@gui :_=note("This filter is a conversion of the Mathmap script originally written by step7 - 2012") +#@gui :_=note("Renders positional displacement illusion 'Spinning Sectors' based on Akiyoshi Kitaoka's 'Rotating Snakes'") +#@gui _Deformations +#@gui Moon2panorama:moon2panorama,moon2panorama_preview(1) +#@gui :Center Help=bool(0) +#@gui :Center X=float(0,-20,20) +#@gui :Center Y=float(0,-20,20) +#@gui :Span=float(360,0,1450) +#@gui :Shift X=float(0,-200,200) +#@gui :Shift Y=float(0,-200,200) +#@gui :_=separator() +#@gui :Antialiasing=bool(1) +#@gui :Edge Behavior X=choice("Blank","Wrap","Reflect","Rotate") +#@gui :Edge Behavior Y=choice("Blank","Wrap","Reflect","Rotate") +#@gui :_=separator() +#@gui :_=note("This filter is a conversion of the Mathmap script originally written by Edgar Bonet") +#@gui :_=link("Edgar Bonet.","http://edgar-bonet.org/") +#@gui :_=note("Converts partial cylindrical layout to panorama layout") +#@gui _Rendering +#@gui Spiral RGB:spiral_RGB,spiral_RGB_preview(1) +#@gui :Red Rotations=int(1,1,20) +#@gui :Green Rotations=int(3,0,20) +#@gui :Blue Rotations=int(5,0,20) +#@gui :Counter Clockwise=bool(0) +#@gui :_=separator() +#@gui :_=note("This filter is based on a conversion of a Mathmap script originally written by Nevit Dilmen") +#@gui :_=note("Create fun spirals with the size and aspect ratio of the input image.") +#@gui _Testing +#@gui Telperion +#@gui Mc Flou:mc_flou,mc_flou_preview +#@gui :_=separator() +#@gui :Sharp=float(30,10,400) +#@gui :Blur=float(6,3,20) +#@gui :Blend=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Base image adjustement:") +#@gui :Skip=bool(true) +#@gui :Gamma=float(1,0.2,2) +#@gui :Value Min=int(0,0,127) +#@gui :Value Max=int(255,128,255) +#@gui :Gamma R=float(1,0.2,2) +#@gui :Gamma G=float(1,0.2,2) +#@gui :Gamma B=float(1,0.2,2) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Apply a flou effect with edges protection. v.1.1") +#@gui Mc Pendraw:mc_pendraw,mc_pendraw_preview +#@gui :_=separator() +#@gui :Amplitude=float(8,0,30) +#@gui :Blur=float(0.8,0.1,2) +#@gui :Sharp=float(450,100,2000) +#@gui :Color=int(21,4,256) +#@gui :Dithering=float(0.5,0,1) +#@gui :Value=float(1,0,1) +#@gui :Mode 2=bool(false) +#@gui :Color Equal.=bool(false) +#@gui :Equal. Limit=int(255,100,255) +#@gui :_=separator() +#@gui :Lowers Contrast=float(0,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui _Tom Keil +#@gui About:_none_,fx_tk_about +#@gui :_=note{" ( Tom Keil's Filter Set for G'MIC)\n\nis proposed to you by"} +#@gui :_=note("Tom Keil") +#@gui :_=note("\n") +#@gui :_=separator() +#@gui :_=note(" The source code of this set of filters and additional informations and tutorials are available at :") +#@gui :_=separator() +#@gui :_=note("\nThe filters in this folder are still under development and may be subject to changes. Some filters appearing here are also part of the main filter tree of G'MIC. If they appear here too it means there are changes and updates not yet implemented in the main filter tree.") +#@gui Beauty Retouch:fx_tk_retouch,fx_tk_retouch_preview(0) +#@gui :_=separator() +#@gui :Smoothness=float(30,0,100) +#@gui :Details=float(3,0,10) +#@gui :Smoothing Strength=float(1,0,5) +#@gui :Edge Threshold=float(20,0,50) +#@gui :Edge Smoothness=float(1.5,0,10) +#@gui :Sharpening Radius=float(1,0,10) +#@gui :Sharpening Strength=float(2.5,0,5) +#@gui :View Edge Mask=bool(0) +#@gui :Smoothen Skin Tones Only=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil. Latest update: 2011/05/01.") +#@gui :_=link("Filter explained here","http://www.flickr.com/groups/gmic/discuss/72157625538669041/") +#@gui DOF Manipulation:fx_tk_dof,fx_tk_dof_preview(1) +#@gui :_=separator() +#@gui :Focal Point X=float(50,0,100) +#@gui :Focal Point Y=float(50,0,100) +#@gui :DOF 1=int(30,0,255) +#@gui :DOF 2=int(60,0,255) +#@gui :Transition=float(5,0,25) +#@gui :Defocus Strength=float(15,0,200) +#@gui :Defocus Style=choice(2,"Median","Gaussian","Mixed") +#@gui :Depth Estimation Model=choice("Automatic Depth Estimation","Daylight Scene","Individual Focus Field Mask","Individual Depth Map") +#@gui :Bokeh Strength=float(0,0,1) +#@gui :Highlights Threshold=float(200,0,255) +#@gui :Bokeh Size=float(40,2,200) +#@gui :Bokeh Blur=float(2,0,20) +#@gui :Aperture Type=choice("Circular","Octogonal") +#@gui :Remove Blurring Artifacts=bool(0) +#@gui :_=separator() +#@gui :Scheimpflug Effect=choice("None","Vertical Blend","Horizontal Blend","Vertical Only","Horizontal Only") +#@gui :Tilt Plane 1=float(0,0,100) +#@gui :Tilt Plane 2=float(0.01,0,100) +#@gui :_=separator() +#@gui :Output Mode=choice("Image","Layers in Focus/out of Focus","Focus Field Mask Only","Depth Estimation Only") +#@gui :Computation Mode=choice(1,"High Quality","Normal","High Speed") +#@gui :Use Treshold Mask Mode=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil Latest update: 2012/01/21.") +#@gui Infrared Simulation:fx_tk_infrared,fx_tk_infrared_preview(1) +#@gui :Filter Density=float(0.75,0.01,0.99) +#@gui :Wood Effect Saturation=float(0.5,0,1) +#@gui :Wood Effect Color=int(-100,-180,180) +#@gui :Wood Effect Falloff=float(0.75,0,1) +#@gui :Sky Color=int(0,-180,180) +#@gui :Sky Falloff=float(1,0,1) +#@gui :Infrared Defocus=float(0,0,3) +#@gui :Exposure=int(0,-255,255) +#@gui :Contrast=float(1,0,4) +#@gui :Saturation=float(1,0,2) +#@gui :Color / B&W=bool(0) +#@gui :Add Grain=float(50,0,200) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil Latest update: 2012/17/07.") +#@gui _Zonderr +#@gui Demo Mathmap RA:demo_ra,demo_ra +#@gui :_=note("mathmap ra: demo") +#@gui :_=separator() +#@gui :Radius Scale=float(1,0,10) +#@gui :Angle Scale=float(1,0,10) +#@gui Demo Mathmap XY:demo_xy,demo_xy +#@gui :_=note("mathmap xy: demo") +#@gui :_=separator() +#@gui :X Scale=float(1,0,10) +#@gui :Y Scale=float(1,0,10) +#@gui Fourier Picture Watermark:fx_fourier_picture_watermark,_none_ +#@gui :Relative Size=float(0.2,0.1,0.5) +#@gui :_=separator() +#@gui :_=note("Note : To make the watermark visible afterwards, use the 'Fourier Analysis' filter. ") +#@gui Mathmap Flag:mathmap_flag,mathmap_flag +#@gui :Amp=float(0.05,0,1) +#@gui :Len=float(5,0,50) +#@gui :Speed=int(1,1,5) +#@gui :Time=float(5,0,50) +#@gui Rel2ellv3:mathmap_rel2ellv3,mathmap_rel2ellv3 +#@gui __Rendering +#@gui Spiral:mathmap_spiral,mathmap_spiral +#@gui :Rotations=float(5,0,20) +#@gui :Time=float(0,0,1) +#@gui _Various +#@gui Custom Code [Full]:fx_custom_code,fx_custom_code_preview(1)* +#@gui :Code=text(1,"foreach {\n\n to_rgb\n +deform 20\n blend_edges 3\n\n}\n\n\n") +#@gui :_=separator() +#@gui :Channel(s)=choice{"None (Allows Multi-Layers)","All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]"} +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :Display Debug Info on Preview=bool(0) +#@gui :Debug Font Size=choice(2,"Tiny","Small","Normal","Large") +#@gui :_=separator() +#@gui :Preview Type=choice{"Full (Allows Multi-Layers)","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse"} +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Note: This filter can execute any set of instructions understood by the G'MIC language interpreter. Here, you can then test some commands before creating your own G'MIC custom commands and plug-in menu entries.\n\n Please look at the documentation reference web page :") +#@gui :_=link("https://gmic.eu/reference/") +#@gui :_=note(" to learn more about available G'MIC commands. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2022/04/28.") +#@gui Custom Code [Global]:fx_custom_code,fx_custom_code_preview(1) +#@gui :Code=text(1,"foreach {\n\n to_rgb\n +deform 20\n blend_edges 3\n\n}\n\n\n") +#@gui :_=separator() +#@gui :Channel(s)=choice{"None (Allows Multi-Layers)","All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]"} +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :Display Debug Info on Preview=bool(0) +#@gui :Debug Font Size=choice(2,"Tiny","Small","Normal","Large") +#@gui :_=separator() +#@gui :Preview Type=choice{"Full (Allows Multi-Layers)","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse"} +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Note: This filter can execute any set of instructions understood by the G'MIC language interpreter. Here, you can then test some commands before creating your own G'MIC custom commands and plug-in menu entries.\n\n Please look at the documentation reference web page :") +#@gui :_=link("https://gmic.eu/reference/") +#@gui :_=note(" to learn more about available G'MIC commands. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/03/10.") +#@gui Custom Code [Local]:fx_custom_code,fx_custom_code_preview(0) +#@gui :Code=text(1,"foreach {\n\n to_rgb\n +deform 20\n blend_edges 3\n\n}\n\n\n") +#@gui :_=separator() +#@gui :Channel(s)=choice{"None (Allows Multi-Layers)","All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]"} +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :Display Debug Info on Preview=bool(0) +#@gui :Debug Font Size=choice(2,"Tiny","Small","Normal","Large") +#@gui :_=separator() +#@gui :Preview Type=choice{"Full (Allows Multi-Layers)","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse"} +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Note: This filter can execute any set of instructions understood by the G'MIC language interpreter. Here, you can then test some commands before creating your own G'MIC custom commands and plug-in menu entries.\n\n Please look at the documentation reference web page :") +#@gui :_=link("https://gmic.eu/reference/") +#@gui :_=note(" to learn more about available G'MIC commands. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/03/10.") +#@gui Export RGB-565 File:fx_output_565,_none_ +#@gui :Filename=_fileout("out565.rgb") +#@gui :Reverse Endianness=_bool(0) +#@gui :_=separator() +#@gui :_=note("Note: This filter saves your selected layer as a raw RGB-565 file. Keep in mind that you have to remember the image dimension if you want to reload the image file afterwards!") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/05/03.") +#@gui Games & Demos:fx_gmic_demos,fx_gmic_demos_preview +#@gui :Selection=choice("2048","Blobs Editor","Bouncing Balls","Connect-Four","Fire Effect","Fireworks","Fish-Eye Effect","Fourier Filtering","Hanoi Tower","Histogram","Hough Transform","Jawbreaker","Virtual Landscape","The Game of Life","Light Effect","Mandelbrot Explorer","3D Metaballs","Minesweeper","Minimal Path","Pacman","Paint","Plasma Effect","RGB Quantization","3D Reflection","3D Rubber Object","Shadebobs","Spline Editor","3D Starfield","Tetris","Tic-Tac-Toe","3D Waves","Fractal Whirl") +#@gui :_=separator() +#@gui :_=note("Note: This filter proposes a showcase of some interactive demos, all written as G'MIC scripts.") +#@gui :_=note{"On most demos, you can use the keyboard shortcut CTRL+D to double the window size (and CTRL+C to go back to the original size). Also, feel free to use the mouse buttons, as they are often used to perform an action. "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/10/09.") +#@gui Histogram Analysis:_none_,fx_display_histogram(1) +#@gui :Number of Clusters=int(256,2,1024) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/06.") +#@gui Import Data:fx_import_image,gui_no_preview +#@gui :Filename=filein() +#@gui :Normalize=bool(1) +#@gui :_=note{"\nNote: This filter can import any image data read by the G'MIC language interpreter. It includes exotic formats as : Pandore, CImg, Inrimage, AVI/MPEG (requires FFMPEG installed), ... "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Import RGB-565 File:fx_input_565 +#@gui :Filename=filein() +#@gui :Width=text("800") +#@gui :Height=text("600") +#@gui :Reverse Endianness=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/05/03.") +#@gui Intarsia:fx_intarsia,fx_intarsia_preview +#@gui :_=note("Note: Intarsia is a method of Crochet/Knitting with a number of colours, in which a separate ball of yarn is used for each area of colour. This filter creates a HTML version of a graph chart which is solely used for this purpose ") +#@gui :_=separator() +#@gui :Output Directory=_folder("") +#@gui :Output HTML File=_text("intarsia.html") +#@gui :_=separator() +#@gui :Maximum Image Size=int(512,2,1024) +#@gui :Maximum Number of Image Colors=_int(12,2,64) +#@gui :Starting Point=choice(1,"Top Left","Top Right","Bottom Left","Bottom Right") +#@gui :Loop Method=choice("Row by Row","Column by Column") +#@gui :_=separator() +#@gui :Add Comment Area in HTML Page=_bool(1) +#@gui :Preview Progress (%)=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/09/07.") +#@gui Sample Image:fx_image_sample,fx_image_sample_preview +#@gui :Input=choice{"Random","Apples","Balloons","Barbara","Boats","Bottles","Butterfly","Cameraman","Car","Cat","Chick","Cliff","Colorful","David","Dog","Duck","Eagle","Elephant","Earth","Flower","Fruits","Gmicky (Deevad)","Gmicky (Mahvin)","Gmicky & Wilber","Greece","Gummy","House","Inside","Landscape","Leaf","Lena","Leno","Lion","Mandrill","Mona Lisa","Monkey","Parrots","Pencils","Peppers","Portrait0","Portrait1","Portrait2","Portrait3","Portrait4","Portrait5","Portrait6","Portrait7","Portrait8","Portrait9","Roddy","Rooster","Rose","Square","Swan","Teddy","Tiger","Tulips","Wall","Waterfall","Zelda"} +#@gui :_=note("Choosing 0 for parameters Width or Height means Automatic. ") +#@gui :Width=_int(0,0,1024) +#@gui :Height=_int(0,0,1024) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/16/01.") +#@gui Solve Maze:fx_solve_maze,fx_solve_maze_preview(1) +#@gui :Starting Point (%)=point(5,5) +#@gui :Ending Point (%)=point(95,95) +#@gui :Smoothness=float(0.1,0,1) +#@gui :Thickness=int(3,1,10) +#@gui :Color=color(#ff0000) +#@gui :Maze Type=choice("Dark Walls","White Walls") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/01/09.") + +#@gui !>> UPDATE INFORMATION : _none_, _none_ +#@gui : note = note{"A new version of the G'MIC plug-in is available!\n\n +#@gui : You are strongly encouraged to upgrade your version, by visiting our Download page:\n\n"} +#@gui : url = link{"Visit G'MIC Download Page","https://gmic.eu/download.html"} +#@gui : note = note{"\nOf course, your plug-in will continue to work, but please note that we won't be able +#@gui : to provide filter updates anymore for your current plug-in version.\n\n +#@gui : Best regards,\n\n The G'MIC team."} + +#@cli :: Global Options +cli_noarg : +v 0 use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r _cli_noarg=1 version ++e "\n[gmic] No commands, options or data provided." +gmic_help="gmic help" +if !${-is_macos}" && "!${-is_windows} gmic_help.=" | less" if $_vt100 gmic_help.=" -r" fi fi +if {*,u}>0 ++e "[gmic] (type "${c}"'"$gmic_help"'"$n" to print help, "${c}"'gmic demos'"$n" to launch demos)." +else ++e "[gmic] (type "${c}"'"$gmic_help"'"$n" to print help)." +fi +file_update=${_path_rc}update$_version.gmic +if "isfile(['"{/$file_update}"'])" +update_old={"Y = date(0); M = date(1); D = date(2); date_current = Y*365 + M*31 + D; +Y = date(0,'"{/$file_update}"'); M = date(1,'"{/$file_update}"'); +D = date(2,'"{/$file_update}"'); date_file = Y*365 + M*31 + D; +date_current - date_file"} +if $update_old>=14 ++e "[gmic] Command update file is "$update_old" days old, type "$g"'gmic up'"$n" to update it." +fi +else ++e "[gmic] Command update file not found, type "$g"'gmic up'"$n" to get it." +fi ++e "\n" +cli_start : +#@cli debug : (+) +#@cli : Activate debug mode. +#@cli : When activated, the G'MIC interpreter becomes very verbose and outputs additional log +#@cli : messages about its internal state on the standard output (stdout). +#@cli : This option is useful for developers or to report possible bugs of the interpreter. +#@cli h : eq. to 'help'. +h : +help $"*" +#@cli help : command : (no arg) +#@cli : Display help (optionally for specified command only) and exit. +#@cli : (eq. to 'h'). +help : skip ${1=""} +use_vt100 +if $!!=1" || w!=1 || d!=1 || s!=1" rm fi +if ['$1']==0 +_no_examples,_no_default_values,_no_tutorial_link=1 +reference ascii +else +if narg("$1")" && "isfile(['{/$_path_user}']) +l[] { it[] $_path_user onfail } +fi +if narg("$1")" && "narg($_path_commands) l[] { +$_path_commands foreach { l { it[] {n} onfail 0 } k. } +onfail +} fi +if isfile(['{/$_path_rc/update$_version.gmic}']) +l[] { +i cimgz:$_path_rc/update$_version.gmic +onfail l[] { it[] $_path_rc/update$_version.gmic onfail } +} +fi +if !$! return fi +a y +command={`" +s = ['$1']; len = size(s); z = 0; +(p = find(s,_'['))>0?(s[p] = 0; len = p); +isin(s[0],_'-',_'+') && len>1 && !(s[z + 1]=='3' && s[z + 2]=='d')?(copy(s,s[z + 1],len - 1); s[len - 1] = 0); +s"`} +s +,{'"#@cli "$command" :"'} s +,{'"#@cli "$command":"'} s +,{'"#@cli "$command"\n"'} +if $!==1 +l[] { +m "foo : "$command +repeat 16 { um $command } +foo um foo +onfail ('${}') s -,{'"; did you mean "'} if $!>1 s[1] -,39 k[1] misspelling={t} fi rm +} +if narg($misspelling) misspelling="; did you mean '"$_vt100_g$misspelling$_vt100_n"' ?" fi ++e "\n[gmic] No help available for command '"$_vt100_r$command$_vt100_n"'"$misspelling". ""\n Try '"${_vt100_c}"gmic help"$_vt100_n"' for global help." +else +a y +_no_categories=1 ++parse_cli ascii,$command +if narg(${}) parse_cli ascii,${} fi +fi +fi ++e "\n" rm q +reference : skip "${2=}" +m "_section : reference_section_$1 \"$""*\"" +m "_text : reference_text_$1 \"$""*\"" +l { reference_begin_$1 reference_header_$1 onfail } +_section "Usage" +_text "~~~\ngmic [command1 [arg1_1,arg1_2,..]] .. [commandN [argN_1,argN_2,..]]\n~~~"\n\n"`gmic` is the open-source interpreter of the \\\G'MIC language, a script-based programming ""language dedicated to the design of possibly complex image processing pipelines and operators."\n"It can be used to convert, manipulate, filter and visualize image datasets made of one or ""several 1D/2D or 3D multi-spectral images."\n\n"This reference documentation describes all the technical aspects of the G'MIC framework, ""in its current version ___"${-strver}"___."\n\n"As a starting point, you may want to visit our detailed tutorial pages, at: " +_section "Overall Context" +_text "* At any time, \\G'MIC manages one list of numbered (and optionally named) pixel-based images, ""entirely stored in computer memory (uncompressed)."\n"* The first image of the list has index '0' and is denoted by '[0]'. The second image of the ""list is denoted by '[1]', the third by '[2]' and so on."\n"* Negative indices are treated in a periodic way: '[-1]' refers to the last image of the list, '[-2]' to the ""penultimate one, etc. Thus, if the list has 4 images, '[1]' and '[-3]' both designate the second image of the list."\n"* A named image may be also indicated by '[name]', if 'name' uses the character set `[a-zA-Z0-9_]` and does not ""start with a number. Image names can be set or reassigned at any moment during the processing pipeline ""(see command ''name'' for this purpose)."\n"* G'MIC defines a set of various commands and substitution mechanisms to allow the design of complex ""pipelines and operators managing this list of images, in a very flexible way: You can insert or remove images ""in the list, rearrange image order, process images (individually or grouped), merge image data together, ""display and output image files, etc."\n"* Such a pipeline can define a new custom G'MIC command (stored in a user command file), and re-used ""afterwards as a regular command, in a larger pipeline if necessary." +_section "Image Definition and Terminology" +_text "* In \\G'MIC, each image is modeled as a 1D, 2D, 3D or 4D array of scalar values, uniformly ""discretized on a rectangular/parallelepipedic domain."\n"* The four dimensions of this array are respectively denoted by:"\n" - `width`, the number of image columns (size along the `x-axis`)."\n" - `height`, the number of image rows (size along the `y-axis`)."\n" - `depth`, the number of image slices (size along the `z-axis`). ""The depth is equal to '1' for usual color or grayscale 2D images."\n" - `spectrum`, the number of image channels (size along the `c-axis`). ""The spectrum is respectively equal to '3' and '4' for usual `RGB` and `RGBA` color images."\n\n"* There are no hard limitations on the size of the image along each dimension. For instance, the number of image ""slices or channels can be of arbitrary size within the limits of the available memory."\n"* The `width`, `height` and `depth` of an image are considered as _spatial_ dimensions, while the `spectrum` has a ""_multi-spectral_ meaning. Thus, a 4D image in G'MIC should be most often regarded as a 3D dataset of multi-spectral ""voxels. Most of the G'MIC commands will stick with this idea (e.g. command ''blur'' blurs images only along the ""spatial `xyz`-axes)."\n"* G'MIC stores all the image data as buffers of `float` values (32 bits, value range '[-3.4E38,+3.4E38]'. ""It performs all its image processing operations with floating point numbers. Each image pixel takes ""then 32bits/channel (except if double-precision buffers have been enabled during the compilation of the software, ""in which case 64bits/channel can be the default)."\n"* Considering `float`-valued pixels ensure to keep the numerical precision when executing image processing ""pipelines. For image input/output operations, you may want to prescribe the image datatype to be different than ""`float` (like `bool`, `char`, `int`, etc.). This is possible by specifying it as a file option when using ""I/O commands. (see section ''Input/Output Properties'' to learn more about file options)." +_section "Items of a Processing Pipeline" +_text "* In \\G'MIC, an image processing pipeline is described as a sequence of items separated by the ""space character. Such items are interpreted and executed from the left to the right. For instance, the expression:"\n"~~~\nfilename.jpg blur 3,0 sharpen 10 resize 200%,200% output file_out.jpg\n~~~\n""defines a valid pipeline composed of nine G'MIC items."\n\n"* Each G'MIC item is a string that is either a __command__, a list of command __arguments__, ""a __filename__ or a special __input string__."\n"* Escape characters '\\' and double quotes '\"' can be used to define items containing spaces or ""other special characters. For instance, the two strings `single\\ item` and `\"single item\"` ""both define the same single item, with a space in it." +_section "Input Data Items" +_text "* If a specified \\G'MIC item appears to be an existing filename, the corresponding image data ""are loaded and inserted at the end of the image list (which is equivalent to the use of `input filename`). "\n"* Special filenames `-` and `-.ext` stand for the standard input/output streams, optionally ""forced to be in a specific 'ext' file format (e.g. `-.jpg` or `-.png`). "\n"* The following special input strings may be used as G'MIC items to create and insert new ""images with prescribed values, at the end of the image list:"\n" - '[selection]' or '[selection]xN': Insert 1 or N copies of already existing images. ""'selection' may represent one or several images (see section ''Command Items and Selections'' to learn more ""about selections)."\n" - 'width[%],_height[%],_depth[%],_spectrum[%],_values[xN]': Insert one or N images with specified ""size and values (adding '%' to a dimension means __\"percentage of the size along the same axis\"__, ""taken from the last image '[-1]'). Any specified dimension can be also written as ""'[image]', and is then set to the size (along the same axis) of the existing specified image ""'[image]'. 'values' can be either a sequence of numbers separated by commas ',', ""or a mathematical expression, as e.g. in input item '256,256,1,3,[x,y,128]' which ""creates a `256x256` RGB color image with a spatial shading on the red and green channels. ""(see section ''Mathematical Expressions'' to learn more about mathematical expressions). "\n" - '(v1,v2,..)[xN]': Insert one or `N` new images from specified prescribed values. Value separator ""inside parentheses can be ',' (column separator), ';' (row separator), '/' (slice separator) or ""'^' (channel separator). For instance, expression '(1,2,3;4,5,6;7,8,9)' creates a 3x3 matrix (scalar image), ""with values running from 1 to 9. "\n" - '(\\'string\\'[:delimiter])[xN]': Insert one or N new images from specified string, by filling ""the images with the character codes composing the string. When specified, 'delimiter' tells about ""the main orientation of the image. Delimiter can be 'x' (eq. to ',' which is the default), ""'y' (eq. to ';'), 'z' (eq. to '/') or 'c' (eq. to '^'). ""When specified delimiter is ',', ';', '/' or '^', the expression is actually equivalent to ""'({\\'string\\'[:delimiter]})[xN]' (see section ''Substitution Rules'' for more information on the syntax)."\n" - '0[xN]': Insert one or N new `empty` images, containing no pixel data. ""Empty images are used only in rare occasions."\n\n"* Input item 'name=value' declares a new variable 'name', or assign a new string value to an existing variable. ""Variable names must use the character set `[a-zA-Z0-9_]` and cannot start with a number. "\n"* A variable definition is always local to the current command except when it starts by the underscore ""character '_'. In that case, it becomes also accessible by any command invoked outside the current command ""scope (global variable)."\n"* If a variable name starts with two underscores `__`, the global variable is also shared among different threads ""and can be read/set by commands running in parallel (see command ''parallel'' for this purpose). ""Otherwise, it remains local to the thread that defined it."\n"* Numerical variables can be updated with the use of these special operators: ""'+=' (addition), '-=' (subtraction), '*=' (multiplication), '/=' (division), '%=' (modulo), '&=' (bitwise and), ""'|=' (bitwise or), '^=' (power), '<<=' and '>>' (bitwise left and right shifts). For instance, 'foo=1' 'foo+=3'."\n"* Input item 'name.=string' appends specified `string` at the end of variable 'name'."\n"* Input item 'name..=string' prepends specified `string` at the beginning of variable 'name'."\n"* Multiple variable assignments and updates are allowed, with expressions: 'name1,name2,...,nameN=value' or ""'name1,name2,...,nameN=value1,value2,...,valueN' where assignment operator '=' can be replaced by one of the ""allowed operators (e.g. '+=')."\n"* Variables usually store numbers or strings. Use command ''store'' to assign variables from image data ""(and syntax `input $variable` to bring them back on the image list afterwards)." +_section "Command Items and Selections" +_text "* A \\G'MIC item that is not a filename nor a special input string designates a 'command' ""most of the time. Generally, commands perform image processing operations on one or several available images ""of the list."\n"* Reccurent commands have two equivalent names ('regular' and 'short'). For instance, command names ""'resize' and 'r' refer to the same image resizing action."\n"* A G'MIC command may have mandatory or optional __arguments__. Command arguments must be specified ""in the next item on the command line. Commas ',' are used to separate multiple arguments of a single command, ""when required."\n"* The execution of a G'MIC command may be restricted only to a __subset__ of the image list, by ""appending '[selection]' to the command name. Examples of valid syntaxes for 'selection' are: "\n" - 'command[-2]': Apply command only on the penultimate image '[-2]' of the list."\n" - 'command[0,1,3]': Apply command only on images '[0]', '[1]' and '[3]'."\n" - 'command[3-6]': Apply command only on images '[3]' to '[6]' (i.e, '[3]', '[4]', '[5]' and '[6]')."\n" - 'command[50%-100%]': Apply command only on the second half of the image list."\n" - 'command[0,-4--1]': Apply command only on the first image and the last four images."\n" - 'command[0-9:3]': Apply command only on images '[0]' to '[9]', with a step of 3 ""(i.e. on images '[0]', '[3]', '[6]' and '[9]')."\n" - 'command[0--1:2]': Apply command only on images of the list with even indices. "\n" - 'command[0,2-4,50%--1]': Apply command on images '[0]', '[2]', '[3]', '[4]' and on the second half of ""the image list."\n" - 'command[^0,1]': Apply command on all images except the first two."\n" - 'command[name1,name2]': Apply command on named images 'name1' and 'name2'."\n\n"* Indices in selections are always sorted in increasing order, and duplicate indices are ""discarded. For instance, selections '[3-1,1-3]' and '[1,1,1,3,2]' are both equivalent to ""'[1-3]'. If you want to repeat a single command multiple times on an image, use a ""'repeat..done' loop instead. Inverting the order of images for a command is achieved by ""explicitly inverting the order of the images in the list, with command 'reverse[selection]'."\n"* Command selections '[-1]', '[-2]' and '[-3]' are so often used they have their own shortcuts, respectively ""'.', '..' and '...'. For instance, command 'blur..' is equivalent to 'blur[-2]'. ""These shortcuts work also when specifying command arguments."\n"* G'MIC commands invoked without '[selection]' are applied on all images of the list, i.e. the ""default selection is '[0--1]' (except for command ''input'' whose default selection is '[-1]'')."\n"* Prepending a single hyphen '-' to a G'MIC command is allowed. This may be useful to recognize ""command items more easily in a one-liner pipeline (typically invoked from a shell). "\n"* A G'MIC command prepended with a plus sign '+' does not act __in-place__ but inserts its result as one or ""several new images at the end of the image list."\n"* There are two different types of commands that can be run by the G'MIC interpreter:"\n" - __Built-in commands__ are the hard-coded functionalities in the interpreter core. They are thus compiled as ""binary code and run fast, most of the time. Omitting an argument when invoking a built-in command is not permitted, ""except if all following arguments are also omitted. ""For instance, invoking 'plasma 10,,5' is invalid but 'plasma 10' is correct. "\n" - __Custom commands__, are defined as G'MIC pipelines of built-in or other custom commands. ""They are parsed by the G'MIC interpreter, and thus run a bit slower than built-in commands. ""Omitting arguments when invoking a custom command is permitted. For instance, expressions ""`flower ,,,100,,2` or `flower ,` are correct. "\n\n"* Most of the existing commands in G'MIC are actually defined as __custom commands__. "\n"* A user can easily add its own custom commands to the G'MIC interpreter (see section "" ''Adding Custom Commands'' for more details). New built-in commands cannot be added (unless you modify the ""G'MIC interpreter source code and recompile it)." +_section "Input/Output Properties" +_text "* \\G'MIC is able to read/write most of the classical image file formats, including:"\n" - 2D grayscale/color files: `.png`, `.jpeg`, `.gif`, `.pnm`, `.tif`, `.bmp`, ..."\n" - 3D volumetric files: `.dcm`, `.hdr`, `.nii`, `.cube`, `.pan`, `.inr`, `.pnk`, ..."\n" - Video files: `.mpeg`, `.avi`, `.mp4`, `.mov`, `.ogg`, `.flv`, ..."\n" - Generic text or binary data files: `.gmz`, `.cimg`, `.cimgz`, `flo`, `ggr`, `gpl`, `.dlm`, `.asc`, ""`.pfm`, `.raw`, `.txt`, `.h`."\n" - 3D mesh files: `.off`, `.obj`."\n\n"* When dealing with color images, G'MIC generally reads, writes and displays data using the usual ""sRGB color space."\n"* When loading a `.png` and `.tiff` file, the bit-depth of the input image(s) is returned to the status."\n"* G'MIC is able to manage __3D mesh objects__ that may be read from files or generated by G'MIC commands. ""A 3D object is stored as a one-column scalar image containing the object data, in the ""following order: { magic_number; sizes; vertices; primitives; colors; opacities }. ""These 3D representations can be then processed as regular images (see command ''split3d'' for accessing ""each of these 3D object data separately)."\n"* Be aware that usual file formats may be sometimes not adapted to store all the available image ""data, since G'MIC uses float-valued image buffers. For instance, saving an image that was ""initially loaded as a 16bits/channel image, as a `.jpg` file will result in a loss of ""information. Use the G'MIC-specific file extension `.gmz` to ensure that all data ""precision is preserved when saving images."\n"* Sometimes, file options may/must be set for file formats:"\n" - __Video files:__ Only sub-frames of an image sequence may be loaded, using the input expression ""'filename.ext,[first_frame[,last_frame[,step]]]'. Set 'last_frame==-1' to tell it must be ""the last frame of the video. Set 'step' to '0' to force an opened video file to be ""opened/closed. Output framerate and codec can be also set by using the output expression ""'filename.avi,_fps,_codec,_keep_open' where 'keep_open' can be { 0 | 1 }. 'codec' is a 4-char string ""(see ) or '0' for the default codec. 'keep_open' ""tells if the output video file must be kept open for appending new frames afterwards."\n" - `.cimg[z]` __files:__ Only crops and sub-images of .cimg files can be loaded, using the input ""expressions 'filename.cimg,N0,N1', 'filename.cimg,N0,N1,x0,x1', ""'filename.cimg,N0,N1,x0,y0,x1,y1', 'filename.cimg,N0,N1,x0,y0,z0,x1,y1,z1' or ""'filename.cimg,N0,N1,x0,y0,z0,c0,x1,y1,z1,c1'. ""Specifying '-1' for one coordinates stands for the maximum possible value. Output expression ""'filename.cimg[z][,datatype]' can be used to force the output pixel type. 'datatype' can be ""{ auto | bool | uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }. "\n" - `.raw` __binary files:__ Image dimensions and input pixel type may be specified when loading `.raw` ""files with input expression 'filename.raw[,datatype][,width][,height[,depth[,dim[,offset]]]]]'. If no dimensions are ""specified, the resulting image is a one-column vector with maximum possible height. Pixel ""type can also be specified with the output expression 'filename.raw[,datatype]'. ""'datatype' can be the same as for `.cimg[z]` files. "\n" - `.yuv` __files:__ Image dimensions must be specified when loading, and only sub-frames of an image ""sequence may be loaded, using the input expression ""'filename.yuv,width,height[,chroma_subsampling[,first_frame[,last_frame[,step]]]'. ""'chroma_subsampling' can be { 420 | 422 | 444 }. ""When saving, chroma subsampling mode can be specified with output expression ""'filename.yuv[,chroma_subsampling]'. "\n" - `.tiff` __files:__ Only sub-images of multi-pages tiff files can be loaded, using the input ""expression 'filename.tif,_first_frame,_last_frame,_step'. ""Output expression 'filename.tiff,_datatype,_compression,_force_multipage,_use_bigtiff' can be used ""to specify the output pixel type, as well as the compression method. ""'datatype' can be the same as for `.cimg[z]` files. 'compression' can be "" { none (default) | lzw | jpeg }. 'force_multipage' can be { 0=no (default) | 1=yes }. ""'use_bigtiff' can be { 0=no | 1=yes (default) }."\n" - `.pdf` __files:__ When loading a file, the rendering resolution can be specified using the input expression ""'filename.pdf,resolution', where 'resolution' is an unsigned integer value."\n" - `.gif` __files:__ Animated gif files can be saved, using the input expression ""'filename.gif,fps>0,nb_loops'. Specify 'nb_loops=0' to get an infinite number of animation ""loops (this is the default behavior)."\n" - `.jpeg` __files:__ The output quality may be specified (in %), using the output expression ""'filename.jpg,30' (here, to get a 30% quality output). '100' is the default."\n" - `.mnc` __files:__ The output header can set from another file, using the output expression ""'filename.mnc,header_template.mnc'. "\n" - `.pan`, `.cpp`, `.hpp`, `.c` and `.h` __files:__ The output datatype can be selected with output expression ""'filename[,datatype]'. 'datatype' can be the same as for `.cimg[z]` files."\n" - `.gmic` __files:__ These filenames are assumed to be G'MIC custom commands files. Loading such a ""file will add the commands it defines to the interpreter. Debug information can be ""enabled/disabled by the input expression 'filename.gmic[,add_debug_info]' where 'debug_info' can be ""{ 0=false | 1=true }. "\n" - Inserting 'ext:' on the beginning of a filename (e.g. 'jpg:filename') forces G'MIC to ""read/write the file as it would have been done if it had the specified extension `.ext`."\n\n"* Some input/output formats and options may not be supported, depending on the configuration ""flags that have been set during the build of the G'MIC software." +_section "Substitution Rules" +_text "* \\G'MIC items containing '$' or '{}' are substituted before being interpreted. Use these ""substituting expressions to access various data from the interpreter environment."\n"* '$name' and '${name}' are both substituted by the value of the specified named variable ""(set previously by the item 'name=value'). If this variable has not been already set, the ""expression is substituted by the highest positive index of the named image '[name]'. If no ""image has this name, the expression is substituted by the value of the OS environment variable ""with same name (it may be thus an empty string if it is not defined). "\n"* The following reserved variables are predefined by the G'MIC interpreter: "\n" - '$!': The current number of images in the list."\n" - '$>' and '$<': The increasing/decreasing index of the latest (currently running) ""'repeat...done' loop. '$>' goes from `0` (first loop iteration) to `nb_iterations - 1` (last iteration). ""'$<' does the opposite. "\n" - '$/': The current call stack. Stack items are separated by slashes '/'."\n" - '$|': The current value (expressed in seconds) of a millisecond precision timer."\n" - '$^': The current verbosity level."\n" - '$_cpus': The number of computation cores available on your machine."\n" - '$_flags': The list of enabled flags when G'MIC interpreter has been compiled."\n" - '$_host': A string telling about the host running the G'MIC interpreter (e.g. `cli` or `gimp`)."\n" - '$_os': A string describing the running operating system."\n" - '$_path_rc': The path to the G'MIC folder used to store configuration files (its value is OS-dependent)."\n" - '$_path_user': The path to the G'MIC user file `.gmic` or `user.gmic` (its value is OS-dependent)."\n" - '$_path_commands': A list of all imported command files (stored as an image list)."\n" - '$_pid': The current process identifier, as an integer."\n" - '$_pixeltype': The type of image pixels (default: 'float32')."\n" - '$_prerelease': For pre-releases, the date of the pre-release as `yymmdd`. ""For stable releases, this variable is set to `0`."\n" - '$_version': A 3-digits number telling about the current version of the G'MIC interpreter "" (e.g. '"$_version"'). "\n" - '$_vt100': Set to `1` if colored text output is allowed on the console. Otherwise, set to `0`."\n\n"* '$$name' and '$${name}' are both substituted by the G'MIC script code of the specified named ""`custom command`, or by an empty string if no custom command with specified name exists. "\n"* '${\"-pipeline\"}' is substituted by the __status value__ after the execution of the specified ""G'MIC pipeline (see command ''status''). Expression '${}' thus stands for the current status value."\n"* '{``string}' (starting with two backquotes) is substituted by a double-quoted version of the specified string."\n"* '{/string}' is substituted by the escaped version of the specified string."\n"* '{\\'string\\'[:delimiter]}' (between single quotes) is substituted by the sequence of character codes ""that composes the specified string, separated by specified delimiter. Possible delimiters are ""',' (default), ';', '/', '^' or ' '. For instance, item '{'foo'}' is substituted by '102,111,111' and ""'{'foo':;}' by '102;111;111'."\n"* '{image,feature[:delimiter]}' is substituted by a specific feature of the image '[image]'. ""'image' can be either an image number or an image name. It can be also eluded, in which case, ""the last image '[-1]' of the list is considered for the requested feature. ""Specified 'feature' can be one of:"\n" - 'b': The image basename (i.e. filename without the folder path nor extension)."\n" - 'f': The image folder name."\n" - 'n': The image name or filename (if the image has been read from a file)."\n" - 't': The text string from the image values regarded as character codes."\n" - 'x': The image extension (i.e the characters after the last `.` in the image name)."\n" - '^': The sequence of all image values, separated by commas `,`."\n" - '@subset': The sequence of image values corresponding to the specified subset, and separated by commas `,`. "\n" - Any other 'feature' is considered as a __mathematical expression__ associated to the image '[image]' and is ""substituted by the result of its evaluation (float value). For instance, expression '{0,w+h}' is substituted by ""the sum of the width and height of the first image (see section ''Mathematical Expressions'' for more details). ""If a mathematical expression starts with an underscore `_`, the resulting value is truncated to a readable format. ""For instance, item '{_pi}' is substituted by '3.14159' (while '{pi}' is substituted by '3.141592653589793')."\n" - A 'feature' delimited by backquotes is replaced by a string whose character codes correspond to the list of ""values resulting from the evaluation of the specified mathematical expression. For instance, item ""'{`[102,111,111]`}' is substituted by 'foo' and item '{`vector8(65)`}' by 'AAAAAAAA'."\n\n"* '{*}' is substituted by the visibility state of the instant display window '#0' ""(can be { 0=closed | 1=visible }."\n"* '{*[index],feature1,...,featureN[:delimiter]}' is substituted by a specific set of features of the instant display ""window '#0' (or '#index', if specified). Requested 'features' can be:"\n" - 'u': screen width (actually independent on the window size)."\n" - 'v': screen height (actually independent on the window size)."\n" - 'uv': screen width x screen height."\n" - 'd': window width (i.e. width of the window widget)."\n" - 'e': window height (i.e. height of the window widget)."\n" - 'de': window width x window height."\n" - 'w': display width (i.e. width of the display area managed by the window)."\n" - 'h': display height (i.e. height of the display area managed by the window)."\n" - 'wh': display width x display height."\n" - 'i': X-coordinate of the display window."\n" - 'j': Y-coordinate of the display window."\n" - 'f': current fullscreen state of the instant display."\n" - 'n': current normalization type of the instant display."\n" - 't': window title of the instant display."\n" - 'x': X-coordinate of the mouse position (or -1, if outside the display area)."\n" - 'y': Y-coordinate of the mouse position (or -1, if outside the display area)."\n" - 'b': state of the mouse buttons { 1=left-but. | 2=right-but. | 4=middle-but. }."\n" - 'o': state of the mouse wheel."\n" - 'k': decimal code of the pressed key if any, 0 otherwise."\n" - 'c': boolean (0 or 1) telling if the instant display has been closed recently."\n" - 'r': boolean telling if the instant display has been resized recently."\n" - 'm': boolean telling if the instant display has been moved recently."\n" - Any other 'feature' stands for a keycode name (in capital letters), and is substituted ""by a boolean describing the current key state { 0=pressed | 1=released }."\n" - You can also prepend a hyphen '-' to a 'feature' (that supports it) to flush the ""corresponding event immediately after reading its state (works for keys, mouse and window events)."\n\n"* Item substitution is __never__ performed in items between double quotes. One must break the quotes ""to enable substitution if needed, as in '\"3+8 kg = \"{3+8}\" kg\"'. Using double quotes is then ""a convenient way to disable the substitutions mechanism in items, when necessary."\n"* One can also disable the substitution mechanism on items outside double quotes, by escaping the ""`{`, `}` or `$` characters, as in `\\{3+4\\}\\ doesn\47t\\ evaluate`." +_section "Mathematical Expressions" +_text "* \\G'MIC has an embedded __mathematical parser__, used to evaluate (possibly complex) math expressions ""specified inside braces '{}', or formulas in commands that may take one as an argument (e.g. ''fill'' or ''eval'')."\n"* When the context allows it, a formula is evaluated __for each pixel__ of the selected images ""(e.g. ''fill'' or ''eval'')."\n"* A math expression may return a __scalar__ or a __vector-valued__ result (with a fixed number of components)."\n"The mathematical parser understands the following set of functions, operators and variables:"\n"## Usual math operators:"\n"'||' (logical or), '&&' (logical and), '|' (bitwise or), '&' (bitwise and), ""'!=', '==', '<=', '>=', '<', '>', '<<' (left bitwise shift), '>>' (right bitwise shift), '-', '+', '*', '/', ""'%' (modulo), '^' (power), '!' (logical not), '~' (bitwise not), '++', '--', '+=', '-=', '*=', '/=', '%=', ""'&=', '|=', '^=', '>>', '<<=' (in-place operators)."\n"## Usual math functions:"\n"'abs()', 'acos()', 'acosh()', 'arg()', 'arg0()', 'argkth()', 'argmax()', 'argmaxabs()', ""'argmin()', 'argminabs()', 'asin()', 'asinh()', 'atan()', 'atan2()', 'atanh()', 'avg()', 'bool()', 'cbrt()', ""'ceil()', 'cos()', 'cosh()', 'cut()', 'deg2rad()', 'erf()', 'erfinv()', 'exp()', 'fact()', 'fibo()', 'floor()', ""'gamma()', 'gauss()', 'gcd()', 'int()', 'isnan()', 'isnum()', 'isinf()', 'isint()', 'isbool()', 'isexpr()', ""'isfile()', 'isdir()', 'isin()', 'kth()', 'log()', 'log2()', 'log10()', 'max()', 'maxabs()', 'med()', 'min()', ""'minabs()', 'narg()', 'prod()', 'rad2deg()', 'rol()' (left bit rotation), 'ror()' (right bit rotation), 'round()', ""'sign()', 'sin()', 'sinc()', 'sinh()', 'sqrt()', 'std()', 'srand(_seed)', 'sum()', 'tan()', 'tanh()', 'var()', ""'xor()'."\n\n"* 'cov(A,B,_avgA,_avgB)' estimates the covariance between vectors 'A' and 'B' (estimated averages of these vectors ""may be specified as arguments)."\n"* 'mse(A,B)' returns the mean-squared error between vectors 'A' and 'B'."\n"* 'atan2(y,x)' is the version of 'atan()' with two arguments 'y' and 'x' (as in C/C++)."\n"* 'permut(k,n,with_order)' computes the number of permutations of 'k' objects from a set of 'n' objects."\n"* 'gauss(x,_sigma,_is_normalized)' returns `exp(-x^2/(2*s^2))/(is_normalized?sqrt(2*pi*sigma^2):1)`."\n"* 'cut(value,min,max)' returns 'value' if it is in range '[min,max]', or 'min' or 'max' otherwise."\n"* 'narg(a_1,...,a_N)' returns the number of specified arguments (here, 'N')."\n"* 'arg(i,a_1,..,a_N)' returns the `i`-th argument 'a_i'."\n"* 'isnum()', 'isnan()', 'isinf()', 'isint()', 'isbool()' test the type of the given number or expression, ""and return '0' (false) or '1' (true)."\n"* 'isfile(\\'path\\')' (resp. 'isdir('path')') returns '0' (false) or '1' (true) whether its string argument is a ""path to an existing file (resp. to a directory) or not."\n"* 'isvarname(\\'str\\')' returns '0' (false) or '1' (true) whether its string argument would be a valid to name ""a variable or not."\n"* 'isin(v,a_1,...,a_n)' returns '0' (false) or '1' (true) whether the first argument 'v' appears in the set of other ""argument 'a_i'."\n"* 'inrange(value,m,M,include_m,include_M)' returns '0' (false) or '1' (true) whether the specified value lies in ""range '[m,M]' or not ('include_m' and 'includeM' tells how boundaries 'm' and 'M' are considered)."\n"* 'argkth()', 'argmin()', 'argmax()', 'argminabs()', 'argmaxabs()'', 'avg()', 'kth()', 'min()', 'max()', 'minabs()', ""'maxabs()', 'med()', 'prod()', 'std()', 'sum()' and 'var()' can be called with an arbitrary number of scalar/vector ""arguments."\n"* 'vargkth()', 'vargmin()', 'vargmax()', 'vargminabs()', 'vargmaxabs()', 'vavg()', 'vkth()', 'vmin()', ""'vmax()', 'vminabs()', 'vmaxabs()', 'vmed()', 'vprod()', 'vstd()', 'vsum()' and 'vvar()' are the versions of the ""previous function with vector-valued arguments."\n"* 'round(value,rounding_value,direction)' returns a rounded value. 'direction' can be ""{ -1=to-lowest | 0=to-nearest | 1=to-highest }."\n"* 'lerp(a,b,t)' returns 'a*(1-t)+b*t'."\n"* 'swap(a,b)' swaps the values of the given arguments."\n"## Variable names:"\n"Variable names below are pre-defined. They can be overridden."\n"* 'l': length of the associated list of images."\n"* 'k': index of the associated image, in '[0,l-1]'."\n"* 'w': width of the associated image, if any ('0' otherwise)."\n"* 'h': height of the associated image, if any ('0' otherwise)."\n"* 'd': depth of the associated image, if any ('0' otherwise)."\n"* 's': spectrum of the associated image, if any ('0' otherwise)."\n"* 'r': shared state of the associated image, if any ('0' otherwise)."\n"* 'wh': shortcut for width x height."\n"* 'whd': shortcut for width x height x depth."\n"* 'whds': shortcut for width x height x depth x spectrum (i.e. number of image values)."\n"* 'im', 'iM', 'ia', 'iv', 'id', 'is', 'ip', 'ic', 'in': Respectively the minimum, maximum, average, variance, ""standard deviation, sum, product, median value and L2-norm of the associated image, if any ('0' otherwise)."\n"* 'xm', 'ym', 'zm', 'cm': The pixel coordinates of the minimum value in the associated image, ""if any ('0' otherwise)."\n"* 'xM', 'yM', 'zM', 'cM': The pixel coordinates of the maximum value in the associated image, ""if any ('0' otherwise)."\n"* All these variables are considered as __constant values__ by the math parser (for optimization purposes) ""which is indeed the case most of the time. Anyway, this might not be the case, if function 'resize(#ind,..)' ""is used in the math expression. If so, it is safer to invoke functions 'l()', 'w(_#ind)', 'h(_#ind)', ... 's(_#ind)' ""and 'in(_#ind)' instead of the corresponding named variables."\n"* 'i': current processed pixel value (i.e. value located at `(x,y,z,c)`) in the associated image, ""if any ('0' otherwise)."\n"* 'iN': N-th channel value of current processed pixel (i.e. value located at `(x,y,z,N)` in the associated image, ""if any ('0' otherwise). 'N' must be an integer in range '[0,9]'."\n"* 'R', 'G', 'B' and 'A' are equivalent to 'i0', 'i1', 'i2' and 'i3' respectively."\n"* 'I': current vector-valued processed pixel in the associated image, if any ('0' otherwise). ""The number of vector components is equal to the number of image channels (e.g. 'I' = `[ R,G,B ]` for a ""`RGB` image)."\n"* You may add '#ind' to any of the variable name above to retrieve the information for any ""numbered image '[ind]' of the list (when this makes sense). For instance 'ia#0' denotes the average value of the ""first image of the list)."\n"* 'x': current processed column of the associated image, if any ('0' otherwise)."\n"* 'y': current processed row of the associated image, if any ('0' otherwise)."\n"* 'z': current processed slice of the associated image, if any ('0' otherwise)."\n"* 'c': current processed channel of the associated image, if any ('0' otherwise)."\n"* 't': thread id when an expression is evaluated with multiple threads ('0' means __master thread__)."\n"* 'n': maximum number of threads when expression is evaluated in parallel (so that 't' goes from '0' to 'n-1')."\n"* 'e': value of e, i.e. `2.71828...`."\n"* 'pi': value of pi, i.e. `3.1415926...`."\n"* 'u': a random value between '[0,1]', following a uniform distribution."\n"* 'v': a random value between '[-1,1]', following a uniform distribution."\n"* 'g': a random value, following a gaussian distribution of variance 1 (roughly in '[-6,6]')."\n"* 'interpolation': value of the default interpolation mode used when reading pixel values with the pixel access ""operators (i.e. when the interpolation argument is not explicitly specified, see below for more details on pixel ""access operators). Its initial default value is '0'."\n"* 'boundary': value of the default boundary conditions used when reading pixel values with the pixel access ""operators (i.e. when the boundary condition argument is not explicitly specified, see below for more details ""on pixel access operators). Its initial default value is '0'."\n"* The last image of the list is always associated to the evaluations of 'expressions', e.g. G'MIC sequence ""\n~~~\n256,128 fill {w}\n~~~\n will create a 256x128 image filled with value 256."\n"## Vector calculus:"\n"Most operators are also able to work with vector-valued elements."\n"* '[a0,a1,...,aN-1]' defines a 'N'-dimensional vector with scalar coefficients 'ak'."\n"* 'vectorN(a0,a1,,...,aN-1)' does the same, with the 'ak' being repeated periodically if only a few are specified."\n"* 'vector(#N,a0,a1,,...,aN-1)' does the same, and can be used for any constant expression 'N'."\n"* In previous expressions, the 'ak' can be vectors themselves, to be concatenated into a single vector."\n"* The scalar element 'ak' of a vector 'X' is retrieved by 'X[k]'."\n"* The sub-vector '[X[p],X[p+s]...X[p+s*(q-1)]]' (of size 'q') of a vector 'X' is retrieved by 'X[p,q,s]'."\n"* 'expr(formula,_w,_h,_d,_s)' outputs a vector of size 'w*h*d*s' with values generated from ""the specified formula, as if one were filling an image with dimensions '(w,h,d,s)'."\n"* Equality/inequality comparisons between two vectors is done with operators '==' and '!='."\n"* Some vector-specific functions can be used on vector values: ""'cross(X,Y)' (cross product), 'dot(X,Y)' (dot product), 'size(X)' (vector dimension), ""'sort(X,_is_increasing,_nb_elts,_size_elt)' (sorted values), 'reverse(A)' (reverse order of components), ""'map(X,P,_nb_channelsX,_nb_channelsP,_boundary_conditions)', ""'shift(A,_length,_boundary_conditions)' and 'same(A,B,_nb_vals,_is_case_sensitive)' (vector equality test)."\n"* Function 'normP(u1,...,un)' computes the LP-norm of the specified vector ""('P' being a constant or 'inf', as in e.g. 'norm1()')."\n"* Function 'normp(V,_p)' computes the Lp-norm of the specified vector 'V'. Here, 'p' can be variable. ""Default value for 'p' is 2."\n"* Function 'unitnorm(V,_p)' returns a normalized version 'V/normp(V)' of specified vector 'V'. ""Default value for 'p' is 2."\n"* Function 'resize(A,size,_interpolation,_boundary_conditions)' returns a resized version of a vector 'A' with ""specified interpolation mode. 'interpolation' can be ""{ -1=none (memory content) | 0=none | 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }, and ""'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }."\n"* Function 'resize(A,ow,oh,od,os,nw,_nh,_nd,_ns,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac)' is an ""extended version of the previous function. It allows to resize the vector 'A', seen as an image of size ""'ow x oh x od x os' as a new image of size 'nw x nh x nd x ns', with specified resizing options."\n"* Function 'find(A,B,_starting_index,_search_step)' returns the index where sub-vector 'B' appears in vector 'A', ""(or '-1' if 'B' is not contained in 'A'). Argument 'A' can be also replaced by an image index '#ind'."\n"* A `2`-dimensional vector may be seen as a complex number and used in those particular functions/operators: ""'**' (complex multiplication), '//' (complex division), '^^' (complex exponentiation), ""'**=' (complex self-multiplication), '//=' (complex self-division), '^^=' (complex self-exponentiation), ""'cabs()' (complex modulus), 'carg()' (complex argument), 'cconj()' (complex conjugate), ""'cexp()' (complex exponential), 'clog()' (complex logarithm), 'ccos()' (complex cosine), ""'csin()' (complex sine), 'csqrt()' (complex square root), 'ctan()' (complex tangent), 'ccosh()' ""(complex hyperpolic cosine), 'csinh()' (complex hyperbolic sine) and 'ctanh()' (complex hyperbolic tangent)."\n"* A `MN`-dimensional vector may be seen as a `M` x `N` matrix and used in those particular functions/operators: ""'*' (matrix-vector multiplication), 'det(A)' (determinant), 'diag(V)' (diagonal matrix from a vector), ""'eig(A)' (eigenvalues/eigenvectors), 'eye(n)' (n x n identity matrix), 'invert(A,_nb_colsA,_use_LU,_lambda)' ""(matrix inverse), 'mul(A,B,_nb_colsB)' (matrix-matrix multiplication), ""'rot(u,v,w,angle)' (3D rotation matrix), 'rot(angle)' (2D rotation matrix), ""'solve(A,B,_nb_colsB,_use_LU)' (solver of linear system A.X = B), 'svd(A,_nb_colsA)' (singular value decomposition), ""'trace(A)' (matrix trace) and 'transpose(A,nb_colsA)' (matrix transpose). Argument 'nb_colsB' may be omitted if ""it is equal to `1`".\n"* 'mproj(S,nb_colsS,D,nb_colsD,method,max_iter,max_residual)' projects a matrix 'S' onto a dictionary (matrix) ""'D'. Equivalent to command ''mproj'' but inside the math evaluator."\n"* Specifying a vector-valued math expression as an argument of a command that operates on image values ""(e.g. 'fill') modifies the whole spectrum range of the processed image(s), for each spatial coordinates `(x,y,z)`. ""The command does not loop over the `c`-axis in this case."\n"## String manipulation:"\n"Character strings are defined and managed as vectors objects. ""Dedicated functions and initializers to manage strings are:"\n"* `['string']` and `'string'` define a vector whose values are the character codes of the ""specified `character string` (e.g. `'foo'` is equal to `[ 102,111,111 ]`)."\n"* `_'character'` returns the (scalar) byte code of the specified character (e.g. `_'A'` is equal to '65')."\n"* A special case happens for __empty__ strings: Values of both expressions `['']` and `''` are '0'."\n"* Functions 'lowercase()' and 'uppercase()' return string with all string characters lowercased or uppercased."\n"* Function 's2v(str,_starting_index,_is_strict)' parses specified string 'str' and returns the value contained ""in it."\n"* Function 'v2s(expr,_nb_digits,_siz)' returns a vector of size 'siz' which contains the character representation ""of values described by expression 'expr'. ""'nb_digits' can be { <-1=0-padding of integers | -1=auto-reduced | 0=all | >0=max number of digits }."\n"* Function 'echo(str1,str2,...,strN)' prints the concatenation of given string arguments on the console."\n"* Function 'string(_#siz,str1,str2,...,strN)' generates a vector corresponding to the concatenation of given ""string/number arguments."\n"## Dynamic arrays:"\n"A dynamic array is defined as a one-column (or empty) image '[ind]' in the image list. ""It allows elements to be added or removed, each element having the same dimension ""(which is actually the number of channels of image '[ind]'). ""Dynamic arrays adapt their size to the number of elements they contain."\n\n"A dynamic array can be manipulated in a math expression, with the following functions:"\n"* 'da_size(_#ind)': Return the number of elements in dynamic array '[ind]'."\n"* 'da_back(_#ind)': Return the last element of the dynamic array '[ind]'."\n"* 'da_insert(_#ind,pos,elt_1,_elt_2,...,_elt_N)': Insert 'N' new elements 'elt_k' starting from index 'pos' ""in dynamic array '[ind]'."\n"* 'da_push(_#ind,elt1,_elt2,...,_eltN)': Insert 'N' new elements 'elt_k' at the end of dynamic array '[ind]'."\n"* 'da_pop(_#ind)': Same as 'da_back()' but also remove last element from the dynamic array '[ind]'."\n"* 'da_remove(_#ind,_start,_end)': Remove elements located between indices 'start' and 'end' (included) ""in dynamic array '[ind]'."\n"* 'da_freeze(_#ind)': Convert a dynamic array into a 1-column image with height 'da_size(#ind)'."\n"* The value of the k-th element of dynamic array '[ind]' is retrieved with 'i[_#ind,k]' (if the element is a ""scalar value), or 'I[_#ind,k]' (if the element is a vector)."\n\n"In the functions above, argument '#ind' may be omitted in which case it is assumed to be '#-1'."\n"## Special operators:"\n"* ';': expression separator. The returned value is always the last encountered expression. ""For instance expression '1;2;pi' is evaluated as 'pi'."\n"* '=': variable assignment. Variables in mathematical parser can only refer to numerical ""values (vectors or scalars). Variable names are case-sensitive. Use this operator in conjunction with ';' to define ""more complex evaluable expressions, such as \n~~~\nt = cos(x); 3*t^2 + 2*t + 1\n~~~\n""These variables remain __local__ to the mathematical parser and cannot be accessed outside the evaluated ""expression."\n"* Variables defined in math parser may have a __constant__ property, by specifying keyword 'const' before the ""variable name (e.g. 'const foo = pi/4;'). The value set to such a variable must be indeed a __constant scalar__. ""Constant variables allows certain types of optimizations in the math JIT compiler."\n"## Specific functions:"\n"* 'addr(expr)': return the pointer address to the specified expression 'expr'. "\n"* 'o2c(_#ind,offset)' and 'c2o(_#ind,x,_y,_z,_c)': Convert image offset to image coordinates and vice-versa. "\n"* 'fill(target,expr)' or 'fill(target,index_name,expr)' fill the content of the specified target ""(often vector-valued) using a given expression, e.g. `V = vector16(); fill(V,k,k^2 + k + 1);`. ""For a vector-valued target, it is basically equivalent to: ""`for (index_name = 0, index_name=0' (e.g., '46368' for 'N=24'). 'do(expression,condition)' always evaluates the specified ""expression at least once, then check for the loop condition. When done, it returns the last value of 'expression'."\n"* 'for(init,condition,_procedure,body)' first evaluates the expression 'init', then iteratively evaluates 'body' ""(followed by 'procedure' if specified) while 'condition' holds (i.e. not zero). It may happen that no iterations are ""done, in which case the function returns 'nan'. Otherwise, it returns the last value of 'body'. ""For instance, the expression: \n~~~\nif(N<2,N,for(n=N;F0=0;F1=1,n=n-1,F2=F0+F1;F0=F1;F1=F2))\n~~~\n ""returns the 'N'-th value of the Fibonacci sequence, for 'N>=0' (e.g., '46368' for 'N=24')."\n"* 'while(condition,expression)' is exactly the same as 'for(init,condition,expression)' without the specification of ""an initializing expression."\n"* 'repeat(nb_iters,expr)' or 'fill(nb_iters,iter_name,expr)' run 'nb_iters' iterations of the specified expression ""'expr', e.g. `V = vector16(); repeat(16,k,V[k] = k^2 + k + 1);`. ""It is basically equivalent to: ""`for (iter_name = 0, iter_namebegin(foo = 0); ++foo\"')."\n"* 'copy(dest,src,_nb_elts,_inc_d,_inc_s,_opacity)' copies an entire memory block of 'nb_elts' elements starting ""from a source value 'src' to a specified destination 'dest', with increments defined by 'inc_d' and 'inc_s' ""respectively for the destination and source pointers."\n"* 'stats(_#ind)' returns the statistics vector of the running image '[ind]', i.e the vector ""`[ im,iM,ia,iv,xm,ym,zm,cm,xM,yM,zM,cM,is,ip ]` (14 values)."\n"* 'ref(expr,a)' references specified expression 'expr' as variable name 'a'."\n"* 'unref(a,b,...)' destroys references to the named variable given as arguments."\n"* 'breakpoint()' inserts a possible computation breakpoint (useless with the cli interface)."\n"* '_(comment) expr' just returns expression 'expr' (useful for inserting inline comments in math expressions)."\n"* 'run('pipeline')' executes the specified G'MIC pipeline as if it was called outside the currently evaluated ""expression."\n"* 'set(\\'variable_name\\',A)' set the G'MIC variable '$variable_name' with the value of expression 'A'. If 'A' is"" a vector-valued variable, it is assumed to encode a string."\n"* 'store(\\'variable_name\\',A,_w,_h,_d,_s,_is_compressed)' transfers the data of vector 'A' as a ""`w x h x d x s` image to the G'MIC variable '$variable_name'. Thus, the data becomes available outside the math ""expression (that is equivalent to using the regular command ''store'', but directly in the math expression)."\n"* 'get(\\'variable_name\\',_size,_return_as_string)' returns the value of the specified variable, as a vector of ""'size' values, or as a scalar (if 'size' is zero or not specified)."\n"* 'name(_#ind,size)' returns a vector of size 'size', whose values are the characters codes of the name of image ""'[ind]' (or default image selected if 'ind' is not specified)."\n"* 'correlate(I,wI,hI,dI,sI,K,wK,hK,dK,sK,_boundary_conditions,_is_normalized,_channel_mode,_xcenter,_ycenter,""_zcenter,_xstart,_ystart,_zstart,_xend,_yend,_zend,_xstride,_ystride,_zstride,_xdilation,_ydilation,_zdilation,""_interpolation_type)' returns the correlation, unrolled as a vector, of the `wI x hI x dI x sI`-sized image 'I' ""with the `wK x hK x dK x sK`-sized kernel 'K' (the meaning of the other arguments are the same as in command ""'correlate'). Similar function 'convolve(...)' is also defined for computing the convolution between 'I' and 'K'."\n"## User-defined macros:"\n"* Custom macro functions can be defined in a math expression, using the assignment operator ""'=', e.g. \n~~~\nfoo(x,y) = cos(x + y); result = foo(1,2) + foo(2,3)\n~~~\n"\n"* Trying to override a built-in function (e.g. 'abs()') has no effect."\n"* Overloading macros with different number of arguments is possible. Re-defining a previously defined macro with ""the same number of arguments discards its previous definition."\n"* Macro functions are indeed processed as __macros__ by the mathematical evaluator. You should avoid invoking them ""with arguments that are themselves results of assignments or self-operations. ""For instance, \n~~~\nfoo(x) = x + x; z = 0; foo(++z)\n~~~\n returns '4' rather than expected value '2'."\n"* When substituted, macro arguments are placed inside parentheses, except if a number sign ""'#' is located just before or after the argument name. For instance, expression \n""~~~\nfoo(x,y) = x*y; foo(1+2,3)\n~~~\n ""returns '9' (being substituted as '(1+2)*(3)'), while expression \n~~~\nfoo(x,y) = x#*y#; foo(1+2,3)\n~~~\n ""returns '7' (being substituted as '1+2*3')."\n"* Number signs appearing between macro arguments function actually count for __empty__ separators. They may be used ""to force the substitution of macro arguments in unusual places, e.g. as in \n~~~\nstr(N) = ['I like N#'];\n~~~\n""* Macros with variadic arguments can be defined, by specifying a single argument name followed by `...`. ""For instance,\n~~~\nfoo(args...) = sum([ args ]^2);\n~~~\n ""defines a macro that returns the sum of its squared arguments, so `foo(1,2,3)` returns `14` and ""`foo(4,5)` returns `41`.\n""## Multi-threaded and in-place evaluation:"\n"* If your image data are large enough and you have several CPUs available, it is likely that the math expression ""passed to a 'fill', 'eval' or 'input' commands is evaluated in parallel, using multiple computation threads."\n"* Starting an expression with ':' or '*' forces the evaluations required for an image to be run in parallel, ""even if the amount of data to process is small (beware, it may be slower to evaluate in this case!). ""Specify ':' (rather than '*') to avoid possible image copy done before evaluating the expression ""(this saves memory, but do this only if you are sure this step is not required!)"\n"* Expression starting with '+' are evaluated in a single-threaded way, with possible image copy."\n"* If the specified expression starts with '>' or '<', the pixel access operators 'i()', 'i[]', 'j()' and 'j[]' ""return values of the image being currently modified, in forward ('>') or backward ('<') order. ""The multi-threading evaluation of the expression is disabled in this case."\n"* Function 'critical(expr)' forces the execution of the given expression in a single thread at a time."\n"* 'begin_t(expr)' and 'end_t(expr)' evaluates the specified expression once for each running thread ""(so possibly several times) at the beginning and the end of the evaluation procedure."\n"* 'merge(variable,operator)' tells to merge the local variable value computed by threads, with the specified ""operator, when all threads have finished computing."\n"* Expressions 'i(_#ind,x,_y,_z,_c)=value', 'j(_#ind,x,_y,_z,_c)=value', 'i[_#ind,offset]=value' and ""'j[_#ind,offset]=value' set a pixel value at a different location than the running one in the image '[ind]' ""(or in the associated image if argument '#ind' is omitted), either with global coordinates/offsets ""(with 'i(...)' and 'i[...]'), or relatively to the current position `(x,y,z,c)` (with 'j(...)' and 'j[...]'). ""These expressions always return 'value'." +_section "Adding Custom Commands" +_text "* New custom commands can be added by the user, through the use of \\G'MIC __custom commands files__."\n"* A command file is a simple text file, where each line starts either by ""\n~~~\ncommand_name: command_definition\n~~~\n or \n~~~\ncommand_definition (continuation)\n~~~\n"\n"* At startup, G'MIC automatically includes user's command file '$HOME/.gmic' (on __Unix__) or ""'%USERPROFILE%\\user.gmic' (on __Windows__). The CLI tool 'gmic' automatically runs the command ""'cli_start' if defined."\n"* Custom command names must use character set `[a-zA-Z0-9_]` and cannot start with a number."\n"* Any `# comment` expression found in a custom commands file is discarded by the G'MIC parser, ""wherever it is located in a line."\n"* In a custom command, the following '$-expressions' are recognized and substituted:"\n" - '$""\*' is substituted by a verbatim copy of the specified string of arguments ""(do not include arguments set to default values)."\n" - '$\"*\"' is substituted by the sequence of specified arguments, separated by commas ',', ""each being double-quoted (include arguments set to default values)."\n" - '$""#' is substituted by the maximum index of known arguments (either specified by the user or set to a default ""value in the custom command)."\n" - '$""[]' is substituted by the list of selected image indices that have been specified in the command ""invocation."\n" - '$""?' is substituted by a printable version of '$""[]' to be used in command descriptions."\n" - '$i' and '${i}' are both substituted by the `i`-th specified argument. Negative indices such as '${-j}' are ""allowed and refer to the `j`-th latest argument. '$""0' is substituted by the custom command name."\n" - '${i=default}' is substituted by the value of '$i' (if defined) or by its new value set to 'default' otherwise ""('default' may be a `$-expression` as well)."\n" - '${subset}' is substituted by the argument values (separated by commas ',') of a specified argument subset. ""For instance expression '$""{2--2}' is substituted by all specified command arguments except the first and the last ""one. Expression '$""{^0}' is then substituted by all arguments of the invoked command (eq. to '$""*' if all ""arguments have been indeed specified)."\n" - '$""=var' is substituted by the set of instructions that will assign each argument '$i' to the named variable ""'var$i' (for i in '[0...$""#]'. This is particularly useful when a custom command want to manage variable numbers ""of arguments. Variables names must use character set `[a-zA-Z0-9_]` and cannot start with a number."\n\n"* These particular `$-expressions` for custom commands are __always substituted__, even in ""double-quoted items or when the dollar sign '$' is escaped with a backslash '\\$'. To avoid substitution, place an ""empty double quoted string just after the '$' (as in '$\"\"1')."\n"* Specifying arguments may be skipped when invoking a custom command, by replacing them by commas ',' as in ""expression \n~~~\nflower ,,3\n~~~\n Omitted arguments are set to their default values, which must be thus explicitly ""defined in the code of the corresponding custom command (using default argument expressions as '$""{1=default}')."\n"* If one numbered argument required by a custom command misses a value, an error is thrown by the G'MIC ""interpreter."\n"* It is possible to specialize the invocation of a '+command' by defining it as ""\n~~~\n+command_name: command_definition\n~~~\n""* A +-specialization takes priority over the regular command definition when the command is invoked with a ""prepended '+'."\n"* When only a +-specialization of a command is defined, invoking 'command' is actually equivalent to '+command'." +_section "List of Commands" +_text "All available \\G'MIC commands are listed below, by categories. An argument specified between '[]' ""or starting by '_' is optional except when standing for an existing image '[image]', where 'image' ""can be either an index number or an image name. In this case, the '[]' characters are mandatory when writing the ""item. Note that all images that serve as illustrations in this reference documentation are normalized in ""range `[0,255]` before being displayed. You may need to do this explicitly (command `normalize 0,255`) if you want ""to save and view images with the same aspect than those illustrated in the example codes."\n"The examples accompanying this 'List of Commands' illustrate the use of the \\G'MIC language and are written as they ""would appear in a custom command. While some examples may work if entered directly at a shell prompt, there is no ""guarantee. No attempt has been made to escape special characters in these examples, which many shells reserve." +l { reference_list_of_commands_$1 onfail } +xfolder="$2" +if "['$1']=='html' && ['$2']==0" xfolder=$HOME/work/src/gmic-community/reference fi +if ['$xfolder']!=0 +files $xfolder/*.gmd files=${} +repeat narg({/$files}) { +arg0 $>,$files file=${} +l[] { it $file s={b} t={t} rm } +_section {/$s} +_text {/$t} +} +fi +_section "Examples of Use" +_text "`gmic` is a generic image processing tool which can be used in a wide variety of situations. ""The few examples below illustrate possible uses of this tool:"\n"### View a list of images: "\n"\n~~~\n$ gmic file1.bmp file2.jpeg\n~~~"\n\n"### Convert an image file: "\n"\n~~~\n$ gmic input.bmp output output.jpg\n~~~"\n\n"### Create a volumetric image from a movie sequence: "\n"\n~~~\n$ gmic input.mpg append z output output.hdr\n~~~"\n\n"### Compute image gradient norm: "\n"\n~~~\n$ gmic input.bmp gradient_norm\n~~~"\n\n"### Denoise a color image: "\n"\n~~~\n$ gmic image.jpg denoise 30,10 output denoised.jpg\n~~~"\n\n"### Compose two images using overlay layer blending: "\n"\n~~~\n$ gmic image1.jpg image2.jpg blend overlay output blended.jpg\n~~~"\n\n"### Evaluate a mathematical expression: "\n"\n~~~\n$ gmic echo \"cos(pi/4)^2+sin(pi/4)^2={cos(pi/4)^2+sin(pi/4)^2}\"\n~~~"\n\n"### Plot a 2D function: "\n"\n~~~\n$ gmic 1000,1,1,2 fill \"X=3*(x-500)/500;X^2*sin(3*X^2)+if(c==0,u(0,-1),cos(X*10))\" plot\n~~~"\n"===\n![2D Plot](../img/example_plot.png)\n==="\n\n"### Plot a 3D elevated function in random colors: "\n"\n~~~\n$ gmic 128,128,1,3,\"u(0,255)\" plasma 10,3 blur 4 sharpen 10000 n 0,255 ""elevation3d[-1] \"'X=(x-64)/6;Y=(y-64)/6;100*exp(-(X^2+Y^2)/30)*abs(cos(X)*sin(Y))'\"\n~~~"\n\n"===\n![3D Elevation](../img/example_elevation3d.png)\n==="\n\n"### Plot the isosurface of a 3D volume: "\n"\n~~~\n$ gmic mode3d 5 moded3d 5 double3d 0 isosurface3d \"'x^2+y^2+abs(z)^abs(4*cos(x*y*z*3))'\",3\n~~~"\n"===\n![3D Isosurface](../img/example_isosurface3d.png)\n==="\n\n"### Render a G'MIC 3D logo: "\n"\n~~~\n$ gmic 0 text G\\\47MIC,0,0,53,1,1,1,1 expand_xy 10,0 blur 1 normalize 0,100 +plasma 0.4 add blur 1 ""elevation3d -0.1 moded3d 4\n~~~"\n"===\n![3D G'MIC Logo](../img/example_logo.png)\n==="\n\n"### Generate a 3D ring of torii: "\n"\n~~~\n$ gmic repeat 20 torus3d 15,2 color3d[-1] \"{u(60,255)},{u(60,255)},{u(60,255)}\" *3d[-1] 0.5,1 if \"{$>%2}\" ""rotate3d[-1] 0,1,0,90 fi add3d[-1] 70 add3d rotate3d 0,0,1,18 done moded3d 3 mode3d 5 double3d 0\n~~~"\n"===\n![3D Ring](../img/example_torii.png)\n==="\n\n"### Create a vase from a 3D isosurface: "\n"\n~~~\n$ gmic moded3d 4 isosurface3d \"'x^2+2*abs(y/2)*sin(2*y)^2+z^2-3',0\" sphere3d 1.5 sub3d[-1] 0,5 ""plane3d 15,15 rotate3d[-1] 1,0,0,90 center3d[-1] add3d[-1] 0,3.2 color3d[-1] 180,150,255 color3d[-2] 128,255,0 ""color3d[-3] 255,128,0 add3d\n~~~"\n"===\n![3D Vase](../img/example_vase.png)\n==="\n\n"### Launch a set of interactive demos: "\n"\n~~~\n$ gmic demos\n~~~\n" +l { reference_footer_$1 reference_end_$1 onfail } +um _section,_text +rm +reference_begin_ascii : +use_vt100 +if !narg($_shell_cols) _shell_cols={${-shell_cols}-5} fi +_section=0 ++e "" +reference_header_ascii : +str=\n" "${_vt100_b}"gmic: GREYC\'s Magic for Image Computing:"$_vt100_n" command-line interface"\n" "${_vt100_c}${_vt100_b}"Version "${strver" "$_version,$_prerelease}$_vt100_n\n" "$_vt100_g$_vt100_u"(https://gmic.eu)"$_vt100_n\n\n" Copyright (c) Since 2008, David Tschumperlé / GREYC / CNRS."\n" "$_vt100_g$_vt100_u"(https://www.greyc.fr)"$_vt100_n ++e $str +reference_section_ascii : +_section+=1 ++e "" +('$_section." "') ('"$*"') +f.. {'" "'} +f.. {'-'} a[-4,-3] x a[-2,-1] x ++e " "$_vt100_r$_vt100_b{-2,t}$_vt100_n ++e " "$_vt100_r{t}$_vt100_n\n +rm[-2,-1] +reference_text_ascii : +l[] { +('"$*"') +gmd2ascii $_shell_cols,1 +s +,{'\n'} +eval "repeat (l,p, +i(#p)==_'\n'?(h#p==1?resize(#p,0,0,0,0):(resize(#p,1,1,1,1);i(#p) = 0)): +(resize(#p,1,h#p + 2,1,1,0,0,0,1); copy(i[#p,0],_' ',2,1,0)))" +foreach { if w +e {/{t}} fi } +rm +} +reference_list_of_commands_ascii : +l { +if !$! it $_path_rc/update$_version.gmic fi +parse_cli ascii +onfail +rm ++e \n" "$_vt100_r${_vt100_b}"No command descriptions available!"$_vt100_n ++e " "${_vt100_r}"Try updating your command files, with command "$_vt100_b"'update'."$_vt100_n +} +reference_footer_ascii : ++e \n" "$_vt100_r$_vt100_b"** G\47MIC comes with ABSOLUTELY NO WARRANTY; ""for details visit: https://gmic.eu **"$_vt100_n +reference_section_html : +name="$*" +reference_end_section_html +('""\n""\n" "\n" "\n" "\n" G'MIC - GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing ""- "$name""\n" "\n" "\n" "\n\n" "\n" "\n\n"

"\n" "\n""\n\n""\n\n"

"$name"

"\n':y) +=> $name +reference_end_section_html : +if $! +('"
"\n\n""\n\n""\n"
"\n" "\n" "':y) +a[-2,-1] y +fi +reference_text_html : +('"$*"':y) gmd2html. 0 +if $!>1 a[-2,-1] y fi +reference_footer_html : +reference_end_section_html +reference_finalize_html : +html=""\n""\n" "\n" "\n" "\n" G'MIC - GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing ""- Table of Contents"\n" "\n" "\n" "\n\n" "\n" "\n\n"
"\n\n" "\n""\n\n""\n\n"

Preamble

"\n" "\n"

Version

"\n"
"\n" G'MIC: ""GREYC's Magic for Image Computing
"\n" https://gmic.eu
"\n" Version "${strver" "$_version,$_prerelease}"

"\n" Copyright © Since 2008, ""David Tschumperlé / ""GREYC / ""CNRS
"\n" https://www.greyc.fr
"\n"
"\n"

Table of Contents

"\n"
    "\n +ind_loc=${"-nmd 1,\"List of Commands\""} +if narg($ind_loc) +foreach { +name={n} strvar $name url=${}.html +if $>==$ind_loc +html.="
  • "$name"
  • " +else +html.="
  • "$name"
  • " +fi +} +html.="\n
"\n\n""\n\n""\n"
"\n" "\n" " +i[0] ({'$html'}:y) =>[0] "Table of Contents" +ind_loc+=1 +if narg($ind_loc)" && "isfile('list_of_commands.html') +it list_of_commands.html +if find(crop(),'""')<0 l[$ind_loc,-1] { +s[0] -,{'""'} +s. -,{'""'} +i[1] ('""':y) +k[0,1,-1] a y +} else => "List of Commands" rv[$ind_loc,-1] rm. fi +fi +fi +if !0$_pdf_output +repeat $! { +current={$>,n} strvar[] $current url_current=${}.html +if $>>1 previous={{$>-1},n} strvar[] $previous url_previous=${}.html else previous= fi +if $< next={{$>+1},n} strvar[] $next url_next=${}.html else next= fi +html_top="
""Table of Contents" +if $> html_top.="  ▸  "$current"" fi +html_top.="" +if ['$previous']!=0 html_top.="◀  "$previous"" fi +if ['$previous']!=0" && "['$next']!=0 html_top.="    |    " fi +if ['$next']!=0 html_top.=""$next"  ▶" fi +html_top.="
" +html_bottom="
" +if ['$previous']!=0 html_bottom.="◀  "$previous"" fi +if ['$previous']!=0" && "['$next']!=0 html_bottom.="    |    " fi +if ['$next']!=0 html_bottom.=""$next"  ▶" fi +html_bottom.="
" +replace_str[$>] "",$html_top +replace_str[$>] "",$html_bottom +} +fi +reference_end_html : +reference_finalize_html +foreach { strvar {n} ot ${}.html } +if isfile('table_of_contents.html') x "ln -fs table_of_contents.html index.html" fi +rm +reference_begin_man : +_section=0 ++e ".TH G\47MIC 1\n.SH NAME\ngmic \\- Perform image processing operations using the G\47MIC framework.\n\n.SH HELP\n" +reference_header_man : +_vt100_b="\\fB" +_vt100_c="\\fB" +_vt100_g="\\fB" +_vt100_m= +_vt100_n="\\fR" +_vt100_r="\\fB" +_vt100_u="\\fI" +_prerelease= +reference_header_ascii +reference_section_man : +reference_section_ascii "$*" +reference_text_man : +reference_text_ascii "$*" +reference_list_of_commands_man : +_vt100_c= +reference_list_of_commands_ascii +_vt100_m="\\fB" +_vt100_b= +reference_footer_man : +reference_footer_ascii "$*" +reference_begin_pdf : +_pdf_output=1 +reference_section_pdf : +reference_section_html "$*" +reference_text_pdf : +reference_text_html "$*" +reference_footer_pdf : +reference_end_section_html +reference_end_pdf : +1024,4,1,3 o. reference_pdf.png rm. +reference_finalize_html +l[] { +it ../../src/gmic_stdlib.gmic +parse_cli. list loc=${} +parse_cli html +repeat narg($loc) { +command=${"arg "1+$>","$loc} +l[] { if ['$command'][0]!=_'_' it $command.html fi onfail } +} +sort_list +,n +} +s +,{'""'} +s +,{'""'} +k[2--1:5] +i[0] ('""\n""\n" "\n" "\n" "\n" reference_pdf"\n" "\n" "\n\n" "\n"
"\n" "\n"

The Handbook

"\n"

Version "${strver" "$_version,$_prerelease}"

"\n"

© David Tschumperlé / GREYC / CNRS

"\n"

"{date(0)}"/"{date(1)}"/"{date(2)}"

"\n"
"':y) +('""\n"

□ End of document

"\n""':y) a y +ot reference_pdf.html +rm +it ../style.css ot. style.css rm +delete reference_pdf.pdf +v 0 e " > Waiting for file 'reference_pdf.pdf'." +for !isfile('reference_pdf.pdf') { wait 5000 } +e " > Removing links in file 'reference_pdf.pdf'." +x "pdfjam reference_pdf.pdf" +e " > Compressing file 'reference_pdf.pdf' to 'gmic_reference.pdf'." +x "gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=gmic_reference.pdf reference_pdf-pdfjam.pdf" +e " > Clean temporary files." +delete style.css,reference_pdf.html,reference_pdf.png,reference_pdf.pdf,reference_pdf-pdfjam.pdf +e " > Upload file 'gmic_reference.pdf' to G'MIC server." +x "lftp sftp://"$GMIC_LOGIN":@ovh -e \"put -O /home/"$GMIC_LOGIN"/www/gmic/reference gmic_reference.pdf; ""quit\" >/dev/null" +use_vt100 : +if !0$_vt100" || "['$_vt100_n']!=0 return fi +_vt100_b="\33[1m" +_vt100_c="\33[0;36;59m" +_vt100_g="\33[0;32;59m" +_vt100_i="\33[3m" +_vt100_m="\33[0;35;59m" +_vt100_n="\33[0;0;0m" +_vt100_r="\33[0;31;59m" +_vt100_s="\33[9m" +_vt100_u="\33[4m" +#@cli version +#@cli : Display current version number on stdout. +version : +use_vt100 +reference_header_ascii[] +if !0$_cli_noarg +e "\n" fi +#@cli :: Input / Output +#@cli camera : _camera_index>=0,_nb_frames>0,_skip_frames>=0,_capture_width>=0,_capture_height>=0 : (+) +#@cli : Insert one or several frames from specified camera. +#@cli : When 'nb_frames==0', the camera stream is released instead of capturing new images. +#@cli : This command requires features from the OpenCV library (not enabled in G'MIC by default). +#@cli : Default values: 'camera_index=0' (default camera), 'nb_frames=1', 'skip_frames=0' and 'capture_width=capture_height=0' (default size). +clean_cluts : +e[^-1] "Clean CLUT dataset.\n" +round c 0,255 +foreach { +nm={n} +if "str = lowercase(['"$nm"*']); +find(str,'tpf_-_cinematica_')==0" l[] { +if !narg($tpf) tpf=1 fi +('moviz_$tpf') +tpf+=1 +nm={t} rm +} fi +if "str = lowercase(['"$nm"*']); +find(str,'_-_standard-vk')>=0" l[] { +if !narg($tpf) tpf=1 fi +('moviz_$tpf') +tpf+=1 +nm={t} rm +} fi +if "str = lowercase(['"$nm"*']); +find(str,'_-_rec_709*')>=0" l[] { +('$nm') z. 0,{w-11} +nm={t} rm +} fi +if "str = lowercase(['"$nm"']); +find(str,'smallhd_movielook_')==0" l[] { +('$nm') z. 18,100% +replace_str "apocalypsethisverymoment","apocalypse_this_very_moment" +replace_str "bobford","bob_ford" +replace_str "lifegivingtree","life_giving_tree" +replace_str "savingprivatedamon","saving_private_damon" +replace_str "thematrices","the_matrices" +nm={t} rm +} fi +if "str = lowercase(['"$nm"']); +find(str,'fuji_xtrans_iii')==0" l[] { +('$nm') +replace_str "_-_","_" nm={t} rm +} fi +if "str = lowercase(['"$nm"']); +find(str,'kodak')==0 || +find(str,'polaroid')==0 || +find(str,'fuji')==0 || +find(str,'ilford')==0" l[] { +({'$nm'},{'*'}) +replace_str " ","_" +replace_str "xp_2","xp2" +replace_str "hp_5","hp5" +repeat 8 { n:=1+$> +replace_str "_"${n}"_+","_+" +replace_str "_"${n}"_-","_-" +replace_str "_"${n}"_alt","_alt" +replace_str "_"${n}"_Alt","_alt" +replace_str "_"${n}"*","*" +} += 0,0,100% nm={t} rm +} fi +strclut $nm nm=${} +if "str = lowercase(['"$nm"']); +find(str,'technicalfx')==0 || +find(str,'picturefx')==0 || +find(str,'analogfx')==0 || +find(str,'goldfx')==0 || +find(str,'zilverfx')==0" l[] { +('$nm') +replace_str "-","_" nm={t} rm +} fi +l[] { +({'$nm'},{'*'}) +replace_str "_v_2*","*" +replace_str "_v_1*","*" +replace_str "_*","*" +replace_str "_b_w","_bw" +replace_str "&","" +replace_str "rec_709_-_","rec709_" +replace_str "s-log","slog" +replace_str "__","_" +replace_str "action_-_","action_" +replace_str "-version-","" +replace_str "picturefx_","" += 0,0,100% nm={t} rm +} +=>[^] $nm +} +foreach { +if "ref(crop(#0,0,0,0,3,1,h,1,1),R); +ref(crop(#0,0,0,0,4,1,h,1,1),G); +ref(crop(#0,0,0,0,5,1,h,1,1),B); +R==G && G==B?1:0" +channels 0,3 +fi +} +p=0 for $p<$! { +nm0={$p,n} +e "\r- Search duplicates for ["$p"] = '"$nm0"' " +q:=$p+1 for $q<$! { +nm={$q,n} +if ['$nm0']==['$nm'] +e " > Found duplicate ["$q"] -> Original 1x"{$p,h}", new 1x"{$q,h}"\n" +rv[$p,$q] rm[$q] +else q+=1 +fi +} +p+=1 +} +sort_list +,n +doc="#@cli clut : \"clut_name\",_resolution>0,_cut_and_round={ 0=no | 1=yes }\n""#@cli : Insert one of the "$!" pre-defined CLUTs at the end of the image list.\\n\n""#@cli : 'clut_name' can be {" sep="|" +nbc=28 +foreach { +if !$< sep="}" fi +str=" "{n}" "$sep +s_str:=size(['$str']) +nbc+=$s_str +if $nbc<118 +doc=${doc}${str} +else +doc=${doc}" \\\n#"${str} +nbc:=1+$s_str +fi +} +doc=${doc}"\n""#@cli : Default values: 'resolution=33' and 'cut_and_round=1'.\n""#@cli : $ clut summer clut alien_green,17 clut orange_dark4,48\n" +e "\n"$doc +#@cli m : eq. to 'command'. : (+) +#@cli command : _add_debug_info={ 0 | 1 },{ filename | http[s]://URL | "string" } : (+) +#@cli : Import G'MIC custom commands from specified file, URL or string. +#@cli : (eq. to 'm').\n +#@cli : Imported commands are available directly after the 'command' invocation. +#@cli : Specified filename is not allowed to contain colons ':'. +#@cli : Default value: 'add_debug_info=1' (except for a "string" argument, in which case 'add_debug_info=0'). +#@cli : $ image.jpg command "foo : mirror y deform $""1" +foo[0] 5 +foo[0] 15 +compress_gmic : +merge_multiline_comments +merge_multiline +eval " +p = 0; +while (p=0 && l1 +('""\n\n""\n""\n""\n" FilterTextTranslator"\n\n':y) +repeat h#0 { +str={0,`I(0,$>)`} +tr={0,`I(1,$>)`} +if s=['$tr'];s!=0" && norm(s-=_' ')" +({'$str'}) autocrop. {'" "'} _gmd_ascii2html. str={t} rm. +({'$tr'}) autocrop. {'" "'} _gmd_ascii2html. tr={t} rm. +if {0,!i(2,$>)} +('" "\n" "$str""\n" "$tr""\n" "\n\n':y) +else +i=2 +for {0,i($i,$>)} { +path={0,`I($i,$>)`} ({'$path'}) autocrop. {'" "'} _gmd_ascii2html. path={t} rm. +('" "\n" "$str""\n" "$path""\n" "$tr""\n" "\n':y) +i+=1 +} +r. 1,{h+1},1,1,0,1 +fi +fi +} +('"\n"\n':y) +a[^0] y k. +fi +} +#@cli delete : filename1[,filename2,...] : (+) +#@cli : Delete specified filenames on disk. Multiple filenames must be separated by commas. +#@cli d : eq. to 'display'. +d : +_gmic_s="$?" v + _display "",1,$[] ++d : +_gmic_s="$?" v + _display +,{$^>=0},$[] +#@cli display +#@cli : Display selected images in an interactive window. +#@cli : (eq. to 'd'). +#@cli : When invoked with a '+' prefix (i.e. '+display'), the command outputs its log messages on 'stdout' rather than on 'stderr'. +#@cli : Display window \#0 is used as the default window for the display, if already opened. +#@cli : \nAvailable controls are shown below (where 'LMB' = Left mouse button, 'RMB' = Right mouse button, 'MMB' = Middle mouse button and 'MW' = Mouse wheel). +#@cli : \n- **Thumbnail navigation bar:** +#@cli : 'TAB': Hide/show thumbnails - 'LMB': Select thumbnail or shift thumbnail bar - 'ARROWS' (opt. '+SHIFT'),'SPACE','BACKSPACE','B','C','HOME','END', '0'-'9': Navigate and select thumbnails (add 'CTRL' if mouse pointer is over image view). +#@cli : \n- **Image view:** +#@cli : 'LMB' or 'MMB': Image pan - 'RMB' or 'MW': Image zoom - 'ARROWS' (opt. '+SHIFT'),'HOME','END': Shift view - 'A': Switch alpha mode - 'C': Center view - 'ENTER': Reset view - 'G': Toggle grid - 'H': Go upper-left - 'E': Go lower-right - 'M': Run 3D mesh viewer - 'N': Switch normalization mode - 'P': Print info about current image pixel on 'stdout' - 'PAGEUP' or 'PAGEDOWN': Increase/decrease base channel - 'R': Rotate image by 90 deg. - 'Z': Switch zoom factor - '0'-'9': Set zoom factor. +#@cli : \n- **2D images only:** +#@cli : 'CTRL+LMB': Image crop. +#@cli : \n- **3D volumetric images only:** +#@cli : 'CTRL+MW': Pan along orthogonal axis - 'X': Reset area cross position. +#@cli : \n- **Window size, decoration and data I/O:** +#@cli : 'CTRL+C': Decrease window size - 'CTRL+D': Increase window size - 'CTRL+F': Toggle fullscreen mode - 'CTRL+I': Toggle info mode - 'CTRL+O': Save copy of image as .gmz - 'CTRL+L': Save copy of image list as .gmz - 'CTRL+S': Save screenshot - 'CTRL+X': Toggle axis mode. +display : +_gmic_s="$?" v + _$0 "",1,$[] ++display : +_gmic_s="$?" v + _$0 +,{$^>0},$[] +_display : skip ${1=},${3=} +if !$! +if $2 e[0--5] "Display image []." fi +is_change 0 +return +fi +if $!==1" && "${-is_mesh3d.} d3d return fi +check_display "display" +nb_images=$! +normalization_mode:=narg($_display_normalization_mode)?0$_display_normalization_mode:-1 +alpha_mode:=narg($_display_alpha_mode)?0$_display_alpha_mode:0 +canvas_axis_mode:=narg($_display_axis_mode)?0$_display_axis_mode:1 +canvas_is_grid:=narg($_display_is_grid)?0$_display_is_grid:1 +canvas_is_info:=narg($_display_is_info)?0$_display_is_info:1 +thumb_height_factor=0.15 +thumb_min_ratio=0.45 +thumb_is_visible:=$nb_images>1 +(${3--1}:y) => image_indices +if $nb_images<=6 $nb_images,1,1,1,x sel={^} rm. is_ellipsized=0 +else sel=0,1,2,{$nb_images-[3,2,1]} is_ellipsized=1 +fi +log_title,window_title,sep= +repeat narg($sel) { +l_ind:=arg0($>,$sel) +g_ind={image_indices,i[$l_ind]} +basename {``{$l_ind,n}} +basename={`"b = ['"{``${}}"']; size(b)>32?copy(b[32-3],[['...'],0]); b"`} +log_title.=$sep$basename +window_title.=$sep[$g_ind]" "$basename +if $is_ellipsized" && "$>==2 sep=", (...) " else sep=", " fi +} +if $nb_images>1 window_title.=" (#"$nb_images")" else window_title.=" ("{0,[w,h,d,s]}")" fi +if $2 e[0--4] "Display image"$_gmic_s" = '"$log_title"'." fi +window_previous_normalization,windows_previous_fullscreen= +if {*} +window_width,window_height={*,d,e} +window_previous_normalization,windows_previous_fullscreen={*,n,f} +if $normalization_mode<0 normalization_mode:={*,n}?3:0 fi +w[] $window_width,$window_height,0,$window_title +else +window_width,window_height=${"$0_default_window_size[0-"{$nb_images-1}"] "$thumb_height_factor,$thumb_min_ratio} +if $normalization_mode<0 normalization_mode=3 fi +w[] $window_width,$window_height,0,$window_title +fi +window_nonfullscreen_width,window_nonfullscreen_height={*,w,h} +is_fullscreen,mouse_x,mouse_y,mouse_area={*,f,x,y},0 +previous_mouse_x,previous_mouse_y,previous_mouse_area=-1,-1,0 +event_type0,is_clicked0,is_clicked1,is_clicked2,is_released0,is_released1,is_released2,is_drag0,is_drag1,is_drag2=0 +window_wait_mode=0 +thumb_ind0,thumb_ind1=-1 +thumb_mouse_over=-1 +thumb_x= +selected=0 +view_center_x,view_center_y,view_center_z,view_zoom,view_base_channel=0.5,0.5,0.5,1,0 +view_zoom_mode=0 +canvas_crop_x0,canvas_crop_y0,canvas_crop_x1,canvas_crop_y1= +canvas_mouse_x,canvas_mouse_y=-1 +canvas_cross_x,canvas_cross_y= +canvas_label_alignment=1 +area_width,area_height=0 +area_mouse_x,area_mouse_y=-1 +1,${nb_images}x3 => is_printed,is_infnan,is_rotated +f[is_infnan] -1 +0 => canvas_checkerboard +for {*}" && "!{*,ESC} { +window_width,window_height={*,w,h} +is_volumetric={$selected,d>1} +if !$thumb_is_visible +thumb_height,thumb_height2=0 +else +if 0$thumb_base +thumb_x_px={thumb_base,cut($thumb_x*w,-16,$thumb_x_px_max)} +thumb_height={thumb_base,h} +else +rmn thumb_coords,thumb_label,thumb_is_rendered,thumb_shade_left,thumb_shade_right +thumb_height:=max(48,round($window_height*$thumb_height_factor)) +1,$nb_images,1,2," +w = w#y; h = h#y; d = d#y; +d>1?(w+=d + 2; h+=d + 2); +Mwh = max(w,h); +wt = Mwh?max($thumb_min_ratio,w/Mwh):0.5; +ht = Mwh?max($thumb_min_ratio,h/Mwh):0.5; +i[#$is_rotated,y]%2?swap(wt,ht); +[ wt,ht ]" +sh. 100% /.. {iM} rm. *. $thumb_height round. ++f. ">begin(Sw = 0); res = [ Sw, round(($thumb_height - i1)/2) ]; Sw+=i0 + 2; res" +rv[-2,-1] a[-2,-1] c => thumb_coords +1,$nb_images,1,1,0 => thumb_is_rendered +{thumb_coords,max(i(0,h-1,0,0)+i(0,h-1,0,2),$window_width)},$thumb_height,1,3 => thumb_base +thumb_x_px_max={thumb_coords,max(-16,i[h-1]+i(0,h-1,0,2)-$window_width+17)} +if !narg($thumb_x) thumb_x={thumb_base,-16/w} fi +thumb_x_px={thumb_base,cut($thumb_x*w,-16,$thumb_x_px_max)} +100%,1,1,1,-1 eval[thumb_coords] "copy(i[#-1,i0],y,i2 + (y thumb_label +rmn thumb_view +fi +if !0$thumb_view +ind0,ind1={thumb_label,[i[$thumb_x_px],(ind=i[$thumb_x_px+$window_width-1,1])>=0?ind:$nb_images-1]} +if [$ind0,$ind1]!=[$thumb_ind0,$thumb_ind1] +for $ind0<=$ind1 { +if {thumb_is_rendered,!i[$ind0]} +x0,y0,w,h={thumb_coords,I[$ind0]} +if {$ind0,!w} +font_size:=cut($thumb_height/8,16,32) +$w,$h,1,3,100 to. \330,0.42~,0.5~,$font_size,1,1,255 +else +is_alpha={$ind0,$alpha_mode" && "(s==2||s==4)} +sh[$ind0] 0,{$ind0,$is_alpha?s-1:min(2,s-1)} +if d>1 +volumetric2d. 50%,50%,50%,2 rm.. fi +if w>$w" || "h>$h +r. $w,$h else . fi rm.. +if {is_rotated,i[$ind0]} rotate. {is_rotated,-90*i[$ind0]} fi +if !$normalization_mode +and. 255 +elif $normalization_mode==1 +c. 0,255 +else +if {is_infnan,i[$ind0]<0} =[is_infnan] ${_display_is_infnan[$ind0]},0,$ind0 fi +if $normalization_mode==2 +if {is_infnan,i[$ind0]} l. { s c foreach { $0_normalize_infnan } a c } +else l. { s c foreach { n 0,255 } a c } +fi +else +if {is_infnan,i[$ind0]} $0_normalize_infnan. else n. 0,255 fi +fi +fi +r. $w,$h +if $is_alpha +to_rgba. +if $alpha_mode==1 (64,96;96,64) r. 16,16,1,1 r. $w,$h,1,3,0,2 +else $w,$h,1,3,{arg($alpha_mode-1,0,128,255)} +fi +sh.. 100% j.. ...,0,0,0,0,1,.,255 rm[-3,-1] +elif s==1 r. 100%,100%,1,3 +elif s==2 r. 100%,100%,1,3,0 +fi +fi ++store. thumb_$ind0 +j[thumb_base] .,$x0,$y0 rm. +=[thumb_is_rendered] 1,0,$ind0 +fi +ind0+=1 +} +thumb_ind0,thumb_ind1=$ind0,$ind1 +fi +$window_width,$thumb_height,1,3 +ind0,ind1={thumb_coords," +const x0 = $thumb_x_px; +for (ind0 = 0, i[#$thumb_coords,ind0] thumb_view +x0,y0,w,h={thumb_coords,I[$selected]} +x0-=$thumb_x_px +font_size:=cut($thumb_height/6,16,32) +rectangle[thumb_view] $x0,$y0,{[$x0,$y0]+[$w,$h]-1},1,0xFFFFFFFF,255 +rectangle[thumb_view] {[$x0,$y0]+1},{[$x0,$y0]+[$w,$h]-2},1,0xFFFFFFFF,255 +rectangle[thumb_view] {[$x0,$y0]+2},{[$x0,$y0]+[$w,$h]-3},1,0xFFFFFFFF,0 +to[thumb_view] "#"{image_indices,i[$selected]},{[$x0,$y0]+1},$font_size,2 +if $thumb_mouse_over>=0 +x0,y0,w,h={thumb_coords,I[$thumb_mouse_over]} +x0-=$thumb_x_px +rectangle[thumb_view] $x0,$y0,{[$x0,$y0]+[$w,$h]-1},0.25,200 +if $thumb_mouse_over!=$selected +rectangle[thumb_view] $x0,$y0,{[$x0,$y0]+[$w,$h]-1},0.75,0x33333333,0 +rectangle[thumb_view] $x0,$y0,{[$x0,$y0]+[$w,$h]-1},0.75,0xCCCCCCCC,255 +to[thumb_view] "#"{image_indices,i[$thumb_mouse_over]},{[$x0,$y0]+1},$font_size,1,0.75 +fi +fi +if $thumb_x_px>0 +if !0$thumb_shade_left (255,0) r. 33,1,1,1,3 r. 100%,$thumb_height channels. -3,0 => thumb_shade_left fi +sh[thumb_shade_left] 100% +j[thumb_view] [thumb_shade_left],0,0,0,0,{min(1,$thumb_x_px/32)},.,255 rm. +fi +if {thumb_base,$thumb_x_px+$window_width thumb_shade_right fi +sh[thumb_shade_right] 100% +j[thumb_view] [thumb_shade_right],1~,0,0,0,{min(1,(w#$thumb_base-$window_width-$thumb_x_px)/32)},.,255 rm. +fi +rmn window_view +fi +thumb_height2:=$thumb_height+2 +fi +if !0$canvas_base +rmn canvas_label_coords +canvas_width,canvas_height=$window_width,{$window_height-$thumb_height2} +if {is_printed,!i[$selected]} +v + _print[$selected] $1,0,$selected v - +=[is_printed] 1,0,$selected +fi +if $is_volumetric +if !narg($canvas_cross_x) +whd={$selected,`string(w,'_',h,'_',d)`} +if narg(${canvas_cross_x_$whd}) canvas_cross_x,canvas_cross_y=${canvas_cross_x_$whd},${canvas_cross_y_$whd} +else canvas_cross_x,canvas_cross_y={$selected,[min(0.95,w/(w+d)),min(0.95,h/(h+d))]} +fi +fi +canvas_cross_x,canvas_cross_y:="[ +cut("$canvas_cross_x",16/$canvas_width,($canvas_width-17)/$canvas_width), +cut("$canvas_cross_y",16/$canvas_height,($canvas_height-17)/$canvas_height) +]" +area_xy_width,area_xy_height,area_xz_width,area_xz_height,area_zy_width,area_zy_height:=" +const w_ratio = "$canvas_cross_x"; +const h_ratio = "$canvas_cross_y"; +w_xy = round(w_ratio*$canvas_width) - 1; +h_xy = round(h_ratio*$canvas_height) - 1; +w_zy = $canvas_width - w_xy - 1; +h_xz = $canvas_height - h_xy - 1; +[ w_xy,h_xy,w_xy,h_xz,w_zy,h_xy ]" +else +area_xy_width,area_xy_height=$canvas_width,$canvas_height +area_xz_width,area_xz_height,area_zy_width,area_zy_height=0 +fi +if {canvas_checkerboard,[w,h]!=[$canvas_width,$canvas_height]} +rm[canvas_checkerboard] +24,24,1,1,64 +f. 96 a[-2,-1] x +mirror. x a[-2,-1] y +r. $canvas_width,$canvas_height,1,3,0,2 +=> canvas_checkerboard +fi +if {$selected,!w} [canvas_checkerboard] => canvas_base +else +is_alpha={$selected,$alpha_mode" && "(s==2||s==4)} +view_base_channel={$selected,cut($view_base_channel,0,max(0,s-3))} +cmin,cmax={$selected,$is_alpha?[0,s-1]:[$view_base_channel,min($view_base_channel+2,s-1)]} +area_xy_x0,area_xy_y0,area_xy_x1,area_xy_y1,area_xy_dx,area_xy_dy,area_xz_x0,area_xz_z0,area_xz_x1,area_xz_z1,area_xz_dx,area_xz_dz,area_zy_z0,area_zy_y0,area_zy_z1,area_zy_y1,area_zy_dz,area_zy_dy={$selected," +const x = $view_center_x*w; const y = $view_center_y*h; const z = $view_center_z*d; +const w_xy = $area_xy_width; const h_xy = $area_xy_height; +const w_xz = $area_xz_width; const h_xz = $area_xz_height; +const w_zy = $area_zy_width; const h_zy = $area_zy_height; +const mw4 = max(w,4); const mh4 = max(h,4); const md4 = max(d,4); +const f_xy = max(mw4/w_xy,mh4/h_xy); +$is_volumetric?( +const f_xz = max(mw4/w_xz,md4/h_xz); +const f_zy = max(md4/w_zy,mh4/h_zy); +const f = 0.5*min(f_xy,f_xz,f_zy)/$view_zoom; +):(const f = 0.5*f_xy/$view_zoom); +[ x - f*w_xy, y - f*h_xy, x + f*w_xy, y + f*h_xy, 2*f*w_xy, 2*f*h_xy, +x - f*w_xz, z - f*h_xz, x + f*w_xz, z + f*h_xz, 2*f*w_xz, 2*f*h_xz, +z - f*w_zy, y - f*h_zy, z + f*w_zy, y + f*h_zy, 2*f*w_zy, 2*f*h_zy ]"} +if $is_volumetric +if !0$canvas_volumetric_background" || "{0$canvas_volumetric_background,[w,h]!=[$canvas_width,$canvas_height]} +rmn canvas_volumetric_background ++j[canvas_checkerboard] [canvas_checkerboard],{$area_xy_width+2},0 +j. [canvas_checkerboard],0,{$area_xy_height+2} +rectangle. 0,$area_xy_height,100%,{$area_xy_height+1},1,0 +rectangle. $area_xy_width,0,{$area_xy_width+1},100%,1,0 +rectangle. {[$area_xy_width,$area_xy_height]+2},100%,100%,0.25,0 +=> canvas_volumetric_background +fi +[canvas_volumetric_background] => canvas_base +else +[canvas_checkerboard] => canvas_base +fi +repeat $is_volumetric?3:1 { +if !$> +can_x0,can_y0,can_x1,can_y1,can_dx,can_dy,can_width,can_height=$area_xy_x0,$area_xy_y0,$area_xy_x1,$area_xy_y1,$area_xy_dx,$area_xy_dy,$area_xy_width,$area_xy_height +w_sel,h_sel={$selected,[w,h]} +plane={$selected,cut(round($view_center_z*d,1,-1),0,d-1)} +joffx,joffy=0 +elif $>==1 +can_x0,can_y0,can_x1,can_y1,can_dx,can_dy,can_width,can_height=$area_xz_x0,$area_xz_z0,$area_xz_x1,$area_xz_z1,$area_xz_dx,$area_xz_dz,$area_xz_width,$area_xz_height +w_sel,h_sel={$selected,[w,d]} +plane={$selected,cut(round($view_center_y*h,1,-1),0,h-1)} +joffx,joffy=0,{$area_xy_height+2} +else +can_x0,can_y0,can_x1,can_y1,can_dx,can_dy,can_width,can_height=$area_zy_z0,$area_zy_y0,$area_zy_z1,$area_zy_y1,$area_zy_dz,$area_zy_dy,$area_zy_width,$area_zy_height +w_sel,h_sel={$selected,[d,h]} +plane={$selected,cut(round($view_center_x*w,1,-1),0,w-1)} +joffx,joffy={$area_xy_width+2},0 +fi +ix0,iy0,ix1,iy1:=round([$can_x0,$can_y0,$can_x1,$can_y1],1,-1) +ix0,ix1:=cut([$ix0,$ix1],0,$w_sel-1) +iy0,iy1:=cut([$iy0,$iy1],0,$h_sel-1) +dix,diy:=$ix1-$ix0+1,$iy1-$iy0+1 +p0:=round(($ix0-$can_x0)/$can_dx*$can_width,1,1) +q0:=round(($iy0-$can_y0)/$can_dy*$can_height,1,1) +p1:=round(($ix1+1-$can_x0)/$can_dx*$can_width,1,1) +q1:=round(($iy1+1-$can_y0)/$can_dy*$can_height,1,1) +dp,dq:=max(1,$p1-$p0),max(1,$q1-$q0) +fact:=max($can_width/$can_dx,$can_height/$can_dy)*100 +if $fact<100 +sh[$selected] $cmin,$cmax +if !$> if $is_volumetric +z. 0,0,$plane,100%,100%,$plane fi +elif $>==1 +z. 0,$plane,0,100%,$plane,100% permute. xzyc +else +z. $plane,0,0,$plane,100%,100% permute. zyxc +fi +if $is_volumetric r. $fact%,$fact% else +r. $fact%,$fact% fi +rm.. +z. {round($ix0*w/$w_sel,1,-1)},{round($iy0*h/$h_sel,1,-1)},{round($ix1*w/$w_sel,1,1)},{round($iy1*h/$h_sel,1,1)} +else +if !$> ++z[$selected] $ix0,$iy0,$plane,$cmin,$ix1,$iy1,$plane,$cmax +elif $>==1 ++z[$selected] $ix0,$plane,$iy0,$cmin,$ix1,$plane,$iy1,$cmax +permute. xzyc +else ++z[$selected] $plane,$iy0,$ix0,$cmin,$plane,$iy1,$ix1,$cmax +permute. zyxc +fi +fi +if !$normalization_mode +and. 255 +elif $normalization_mode==1 +c. 0,255 +else +if {is_infnan,i[$selected]<0} =[is_infnan] ${$0_is_infnan[$selected]},0,$selected fi +if $normalization_mode==2 +if {is_infnan,i[$selected]} l. { s c foreach { $0_normalize_infnan } a c } +else l. { foreach { n 0,255 } a c } +fi +else +if {is_infnan,i[$selected]} $0_normalize_infnan. else n. 0,255 fi +fi +fi +r. $dp,$dq +dx,dy,dl:=dx=$can_width/$can_dx;dy=$can_height/$can_dy;[dx,dy,max(dx,dy)] +if $canvas_is_grid" && "max($dx,$dy)>8 +opacity,color:=lerp(0,0.5,min(($dl-8)/10,1)^2),ia<64?128:0 +$dix,1,1,1,1 r. $dp,1,1,1,4 +eval. "begin(col = $color); i || x==w - 1?polygon(#-2,2,x,0,x,$dq-1,$opacity,col,col,col,255)" rm. +$diy,1,1,1,1 r. $dq,1,1,1,4 +eval. "begin(col = $color); i || x==w - 1?polygon(#-2,2,0,x,$dp-1,x,$opacity,col,col,col,255)" rm. +fi +if $is_volumetric +if $p0<0 cx0,p0={-$p0},0 else cx0=0 fi +if $q0<0 cy0,q0={-$q0},0 else cy0=0 fi +if $p1>$can_width cx1:=$can_width+w-$p1-1 else cx1=100% fi +if $q1>$can_height cy1:=$can_height+h-$q1-1 else cy1=100% fi +z. $cx0,$cy0,$cx1,$cy1 +fi +if $is_alpha +to_rgba. +if $alpha_mode==1 +sh. 100% j[canvas_base] ..,{[$p0,$q0]+[$joffx,$joffy]},0,0,1,.,255 rm. +else +$dp,$dq,1,3,{arg($alpha_mode-1,0,128,255)} +sh.. 100% j.. ...,0,0,0,0,1,.,255 rm[-3,-1] +j[canvas_base] .,{[$p0,$q0]+[$joffx,$joffy]} +fi +else +if s==1 r. 100%,100%,1,3 +elif s==2 r. 100%,100%,1,3,0 +fi +j[canvas_base] .,{[$p0,$q0]+[$joffx,$joffy]} +fi +rm. +} +if $is_volumetric +w2,h2:=int([$area_xy_width,$area_xy_height]/2) +line[canvas_base] 0,$h2,100%,$h2,0.5,0x55555555,0 +line[canvas_base] 0,$h2,100%,$h2,0.5,0xAAAAAAAA,255 +line[canvas_base] $w2,0,$w2,100%,0.5,0x55555555,0 +line[canvas_base] $w2,0,$w2,100%,0.5,0xAAAAAAAA,255 +w2,h2:=[$area_xy_width,$area_xy_height]+2+int([$area_zy_width,$area_xz_height]/2) +line[canvas_base] 0,$h2,$area_xy_width,$h2,0.5,0x55555555,0 +line[canvas_base] 0,$h2,$area_xy_width,$h2,0.5,0xAAAAAAAA,255 +line[canvas_base] $w2,0,$w2,$area_xy_height,0.5,0x55555555,0 +line[canvas_base] $w2,0,$w2,$area_xy_height,0.5,0xAAAAAAAA,255 +if !narg($canvas_cross_button) +21,21,1,4 circle. 50%,50%,10,1,0,0,0,255 circle. 50%,50%,8,1,200,200,200,255 +=> canvas_cross_button +fi +sh[canvas_cross_button] 100% +j[canvas_base] [canvas_cross_button],{canvas_cross_button,round([$canvas_cross_x*$canvas_width-w/2,$canvas_cross_y*$canvas_height-h/2])},0,0,0.5,.,255 rm. +fi +fi +rmn canvas_view +fi +font_size={canvas_base,cut(round(h/40),16,32)} +if !0$canvas_label_info +0 str= +if $nb_images>1 +if $thumb_mouse_over>=0" && "$thumb_mouse_over!=$selected +basename {``{$thumb_mouse_over,n}} +basename={`"b = ['"{``${}}"']; size(b)>32?copy(b[32-3],[['...'],0]); b"`} +str.="Thumb \#"{image_indices,i[$thumb_mouse_over]}": "$basename" ("{``{$thumb_mouse_over,[w,h,d,s]}}")\n" +fi +basename {``{$selected,n}} +basename={`"b = ['"{``${}}"']; size(b)>32?copy(b[32-3],[['...'],0]); b"`} +str.="Image \#"{image_indices,i[$selected]}": "$basename" ("{``{$selected,[w,h,d,s]}}")" +t. {``$str},0,0,$font_size,1,255 +fi +=> canvas_label_info +rmn canvas_label +fi +if !0$canvas_label_coords" && "{$selected,w} +0 view_coords= str= +if narg($canvas_crop_x0) +x0,y0,x1,y1=$canvas_crop_x0,$canvas_crop_y0,$canvas_crop_x1,$canvas_crop_y1 +if $x0>$x1 x0,x1=$x1,$x0 fi +if $y0>$y1 y0,y1=$y1,$y0 fi +dx,dy:=$x1-$x0,$y1-$y0 +if {is_rotated,i[$selected]} +view_xy0={is_rotated,"const w1 = w#$selected - 1; const h1 = h#$selected - 1; +ang = i[$selected]; ang==1?[ $y0, w1 - $x0 ]:ang==2?[ w1 - $x0, h1 - $y0 ]:[ h1 - $y0, $x0 ]"} +view_xy1={is_rotated,"const w1 = w#$selected - 1; const h1 = h#$selected - 1; +ang = i[$selected]; ang==1?[ $y1, w1 - $x1 ]:ang==2?[ w1 - $x1, h1 - $y1 ]:[ h1 - $y1, $x1 ]"} +view_dxy={is_rotated,(i[$selected]%2?[$dy,$dx]:[$dx,$dy])+1} +else +view_xy0=$x0,$y0 +view_xy1=$x1,$y1 +view_dxy:=[$dx,$dy]+1 +fi +str="Box ( "$view_xy0" ) - ( "$view_xy1" ), Size = ( "$view_dxy" )"\n"Length = "{_norm($dx,$dy)}", Angle = "{_rad2deg(atan2($y1-$y0,$x1-$x0))%360}"\260" +else +x,y,z={$selected,"round( +$mouse_area==2?[ lerp($area_xy_x0,$area_xy_x1,$area_mouse_x/$area_xy_width), +lerp($area_xy_y0,$area_xy_y1,$area_mouse_y/$area_xy_height), +cut($view_center_z*d,0,d - 1) ]: +$mouse_area==3?[ lerp($area_xz_x0,$area_xz_x1,$area_mouse_x/$area_xz_width), +cut($view_center_y*h,0,h - 1), +lerp($area_xz_z0,$area_xz_z1,$area_mouse_y/$area_xz_height) ]: +$mouse_area==4?[ cut($view_center_x*w,0,w - 1), +lerp($area_zy_y0,$area_zy_y1,$area_mouse_y/$area_zy_height), +lerp($area_zy_z0,$area_zy_z1,$area_mouse_x/$area_zy_width) ]: +[ -1,-1,-1 ],1,-1)"} +view_xyz=$x,$y,$z +if {is_rotated,i[$selected]} +view_xyz_disp={is_rotated,"const w1 = w#$selected - 1; const h1 = h#$selected - 1; +ang = i[$selected]; ang==1?[ $y, w1 - $x ]:ang==2?[ w1 - $x, h1 - $y ]:[ h1 - $y, $x ]"} +else +view_xyz_disp=$x,$y +fi +if $is_volumetric view_xyz_disp.=,$z fi +if {$selected,inrange($x,0,w,1,0)" && "inrange($y,0,h,1,0)" && "inrange($z,0,d,1,0)} +s_value={`"val = I(#$selected,$x,$y,$z); +size(val)<=6?v2s(val,-1):( +vals = vale = vector3(); +copy(vals,val,3); copy(vale,val[size(val)-3],3); +string(#256,v2s(vals,-1),', ... ,',v2s(vale,-1)); +)"`} +s_hex= +if {$selected,"s>4?0:(val = I($x,$y,$z); min(isint(val) & inrange(val,0,255)))"} +s_hex=" = \#"{$selected,`" +to_hex(x) = (ref(x,_x); _x<10?_'0'+_x:_'A'+_x-10); +res = vector(#2*s); +off = 0; repeat (s,k, val = i($x,$y,$z,k); res[off++] = to_hex(val>>4); res[off++] = to_hex(val&15)); +res"`} +fi +if $is_volumetric +str="Point ( "$view_xyz_disp" ) = [ "$s_value" ]"$s_hex +else +str="Point ( "$view_xyz_disp" ) = [ "$s_value" ]"$s_hex +fi +fi +fi +t. {``$str},0,0,$font_size,1,255 +=> canvas_label_coords +rmn canvas_label +fi +if !0$canvas_label_notification" && "['$notification']!=0 +0 t. $notification,0,0,$font_size,1,255 +r. {[w,h]+20},1,1,0,0,0.5,0.5 ++n. 150,255 r.. 100%,100%,1,3 a[-2,-1] c +=> canvas_label_notification +notification_opacity,notification=3, +fi +if !0$canvas_label +0 +if $canvas_is_info +if $canvas_label_info a. [canvas_label_info],y fi +if $canvas_label_coords a. [canvas_label_coords],y fi +fi +if w +r. {[w,h]+10},1,1,0,0,0.5,0.5 ++n. 150,255 r.. 100%,100%,1,3 a[-2,-1] c +fi +=> canvas_label +rmn canvas_view +fi +if !0$canvas_view +[canvas_base] => canvas_view +if {$selected,!w}" || "$mouse_area<2 +cursor[0] 1 +else +ix,iy,iz={$selected," +$mouse_area==2?[ lerp($area_xy_x0,$area_xy_x1,$area_mouse_x/$area_width), +lerp($area_xy_y0,$area_xy_y1,$area_mouse_y/$area_height), +cut($view_center_z*d,0,d - 1) ]: +$mouse_area==3?[ lerp($area_xz_x0,$area_xz_x1,$area_mouse_x/$area_width), +cut($view_center_y*h,0,h - 1), +lerp($area_xz_z0,$area_xz_z1,$area_mouse_y/$area_height) ]: +$mouse_area==4?[ cut($view_center_x*w,0,w - 1), +lerp($area_zy_y0,$area_zy_y1,$area_mouse_y/$area_height), +lerp($area_zy_z0,$area_zy_z1,$area_mouse_x/$area_width) ]: +[ -1,-1,-1 ]"} +rix,riy,riz:=round([$ix,$iy,$iz],1,-1); +is_cursor_over_image={$selected,inrange($rix,0,w-1)" && "inrange($riy,0,h-1)" && "inrange($riz,0,d-1)} +if {$selected,!$is_cursor_over_image" || "!$canvas_axis_mode" || "($canvas_axis_mode==1" && "$is_volumetric)} +cursor[0] 1 +else +cursor[0] 0 +wxy2,hxy2:=[$area_xy_width,$area_xy_height]+2 +repeat $is_volumetric?3:1 { +cx,cy:=$>==0?[($ix-$area_xy_x0)/$area_xy_dx*$area_xy_width,($iy-$area_xy_y0)/$area_xy_dy*$area_xy_height]:$>==1?[($ix-$area_xz_x0)/$area_xz_dx*$area_xz_width,($iz-$area_xz_z0)/$area_xz_dz*$area_xz_height]:[($iz-$area_zy_z0)/$area_zy_dz*$area_zy_width,($iy-$area_zy_y0)/$area_zy_dy*$area_zy_height] +if !$> +w1,h1:=[$area_xy_width,$area_xy_height]-1 +line[canvas_view] 0,$cy,$w1,$cy,0.65,0x00FF00FF,0 +line[canvas_view] 0,$cy,$w1,$cy,0.65,0xFF00FF00,255 +line[canvas_view] $cx,0,$cx,$h1,0.65,0x00FF00FF,0 +line[canvas_view] $cx,0,$cx,$h1,0.65,0xFF00FF00,255 +elif $>==1 +w1,h1:=[$area_xz_width,$area_xz_height]-1 +cy+=$hxy2 +if $cy>=$hxy2 +line[canvas_view] 0,$cy,$w1,$cy,0.65,0x00FF00FF,0 +line[canvas_view] 0,$cy,$w1,$cy,0.65,0xFF00FF00,255 +fi +line[canvas_view] $cx,$hxy2,$cx,100%,0.65,0x00FF00FF,0 +line[canvas_view] $cx,$hxy2,$cx,100%,0.65,0xFF00FF00,255 +elif $>==2 +w1,h1:=[$area_zy_width,$area_zy_height]-1 +cx+=$wxy2 +line[canvas_view] $wxy2,$cy,100%,$cy,0.65,0x00FF00FF,0 +line[canvas_view] $wxy2,$cy,100%,$cy,0.65,0xFF00FF00,255 +if $cx>=$wxy2 +line[canvas_view] $cx,0,$cx,$h1,0.65,0x00FF00FF,0 +line[canvas_view] $cx,0,$cx,$h1,0.65,0xFF00FF00,255 +fi +fi +} +fi +if $is_cursor_over_image" && "$mouse_area>=2 +repeat $is_volumetric?3:1 { +dx,dy:=$>==0?[$area_xy_width/$area_xy_dx,$area_xy_height/$area_xy_dy]:$>==1?[$area_xz_width/$area_xz_dx,$area_xz_height/$area_xz_dz]:[$area_zy_width/$area_zy_dz,$area_zy_height/$area_zy_dy] +dl:=max($dx,$dy) +if $dl>8 +opacity:=lerp(0,1,min(($dl-8)/10,1)) +cx,cy:=$>==0?[($rix-$area_xy_x0)/$area_xy_dx*$area_xy_width,($riy-$area_xy_y0)/$area_xy_dy*$area_xy_height]:$>==1?[($rix-$area_xz_x0)/$area_xz_dx*$area_xz_width,($riz-$area_xz_z0)/$area_xz_dz*$area_xz_height]:[($riz-$area_zy_z0)/$area_zy_dz*$area_zy_width,($riy-$area_zy_y0)/$area_zy_dy*$area_zy_height] +ncx,ncy:=$cx+$dx,$cy+$dy +cx,cy,ncx,ncy:=round([$cx,$cy],1,1),round([$ncx,$ncy],1,1)-1 +if $canvas_is_grid cx+=1 cy+=1 fi +if $>==1 cy,ncy+=$area_xy_height+2 elif $>==2 cx,ncx+=$area_xy_width+2 fi +if $is_volumetric ++z[canvas_view] $cx,$cy,$ncx,$ncy +rectangle. 0,0,100%,100%,$opacity,0x33333333,0 +rectangle. 0,0,100%,100%,$opacity,0xCCCCCCCC,255 +if isin($>,0,1)" && "$ncx>=$area_xy_width +x:=w-2-$ncx+$area_xy_width +z. 0,0,$x,100% +fi +if isin($>,0,2)" && "$ncy>=$area_xy_height +y:=h-2-$ncy+$area_xy_height +z. 0,0,100%,$y +fi +if $>==1" && "$cy<$area_xy_height+2 +y,cy:=a=$area_xy_height+2;[a-$cy,a] +if $y==2" && "$cx<$area_xy_width+2 +x,cx:=a=$area_xy_width+2;[a-$cx,a] +if $x$x1 x0,x1=$x1,$x0 fi +if $y0>$y1 y0,y1=$y1,$y0 fi +x0,y0,x1,y1:=round([$x0,$y0,$x1,$y1],1,1) +x1+=$canvas_width/$area_xy_dx-1 +y1+=$canvas_height/$area_xy_dy-1 +if $is_canvas_is_grid x0+=1 x1+=1 fi +rectangle[canvas_view] $x0,$y0,$x1,$y1,0.25,0 +rectangle[canvas_view] $x0,$y0,$x1,$y1,0.75,0x33333333,0 +rectangle[canvas_view] $x0,$y0,$x1,$y1,0.75,0xCCCCCCCC,255 +dx,dy:=0.5*[$canvas_width,$canvas_height]/[$area_xy_dx,$area_xy_dy] +x0,y0,x1,y1+=$dx,$dy,-$dx+1,-$dy+1 +line[canvas_view] $x0,$y0,$x1,$y1,0.75,0xF0F0F0F0,0 +line[canvas_view] $x0,$y0,$x1,$y1,0.75,0x0F0F0F0F,255 +fi +fi +ja[canvas_view] [canvas_label],0,$canvas_label_alignment~ +if $canvas_label_notification +sh[canvas_label_notification] 100% +j[canvas_view] [canvas_label_notification],1~,0,0,0,{min(1,$notification_opacity)},.,255 +rm. +window_wait_mode=1 +fi +rmn window_view +fi +if !0$window_view +$window_width,$window_height,1,3 => window_view +if $thumb_is_visible +j[window_view] [thumb_view] +fi +j[window_view] [canvas_view],0,$thumb_height2 +w[window_view] +fi +if $window_wait_mode wait 40 else wait fi +is_CTRL,is_SHIFT:={*,CTRLLEFT}" || "{*,CTRLRIGHT},{*,SHIFTLEFT}" || "{*,SHIFTRIGHT} +previous_mouse_x,previous_mouse_y,previous_mouse_area=$mouse_x,$mouse_y,$mouse_area +mouse_x,mouse_y,mouse_button={*,x,y,b} +mouse_area,canvas_mouse_x,canvas_mouse_y:=" +const x = $mouse_x; +const y = $mouse_y; +const ht = $thumb_height; +const ht2 = ht + 2; +x<0?[0,-1,-1]: +y=2" && "$thumb_mouse_over>=0 +thumb_mouse_over=-1 +rmn canvas_label_info +fi +is_button0,is_button1,is_button2:=($mouse_button&1),($mouse_button&2),($mouse_button&4) +repeat 3 { +if ${is_button$>}" && "$mouse_area" && "!${is_clicked$>} +is_clicked$>,is_released$>,is_drag$>=$mouse_area,0,0 +drag_start_x$>,drag_start_y$>,drag_end_x$>,drag_end_y$>=$mouse_x,$mouse_y,$mouse_x,$mouse_y +elif ${is_button$>}" && "$mouse_area" && "${is_clicked$>} +drag_end_x$>,drag_end_y$>=$mouse_x,$mouse_y +if !${is_drag$>} +is_drag$>:=norm(${drag_end_x$>}-${drag_start_x$>},${drag_end_y$>}-${drag_start_y$>})>5?$mouse_area:0 +fi +elif !${is_button$>}" && "$mouse_area" && "${is_clicked$>} +is_clicked$>,is_released$>=0,$mouse_area +drag_end_x$>,drag_end_y$>=$mouse_x,$mouse_y +elif $mouse_area" && "!${is_clicked$>} +is_drag$>=0 +fi +} +window_wait_mode:=0$notification_opacity||0$is_crop_scroll?1:0 +previous_selected=$selected +if $thumb_is_visible +if $is_drag0==1" && "$is_clicked0==1 +n_thumb_x={thumb_base,cut($thumb_x-($drag_end_x0-$drag_start_x0)/w,-16/w,$thumb_x_px_max/w)} +if $n_thumb_x!=$thumb_x thumb_x=$n_thumb_x drag_start_x0=$drag_end_x0 rmn thumb_view fi +elif $is_drag0==1" && "($is_released0" || "!$mouse_area) +is_drag0,is_released0=0 +fi +if $mouse_area==1 +canvas_label_alignment=0 +x_ind:=$mouse_x+$thumb_x_px +if {thumb_label,inrange($x_ind,0,w-1)" && "i[$x_ind]>=0} +ind={thumb_label,i[$x_ind]} +if $ind!=$thumb_mouse_over thumb_mouse_over=$ind rmn thumb_view,canvas_label_info fi +if !$is_drag0" && "$is_released0 +if $selected!=$ind selected=$ind rmn thumb_view,canvas_label_info fi +fi +fi +else +if $thumb_mouse_over>=0 rmn thumb_view fi +thumb_mouse_over=-1 +fi +fi +if $nb_images>1 +if (($mouse_area==1" || "$is_CTRL)" && "({*,ARROWLEFT}" || "{*,ARROWRIGHT}" || "{*,ARROWUP}" || "{*,ARROWDOWN}" || "{*,PAGEUP}" || "{*,PAGEDOWN}" || "{*,HOME}" || "{*,END}))" || "{*,SPACE}" || "{*,BACKSPACE}" || "{*,B} +step:={*,-ARROWLEFT}||{*,-ARROWUP}||{*,BACKSPACE}||{*,B}?($is_SHIFT?-4:-1):{*,-ARROWRIGHT}||{*,-ARROWDOWN}||{*,SPACE}?($is_SHIFT?4:1):{*,-PAGEUP}?-max(2,round($nb_images/16))*($is_SHIFT?4:1):{*,-PAGEDOWN}?max(2,round($nb_images/16))*($is_SHIFT?4:1):{*,-HOME}?-$selected:{*,-END}?$nb_images-1-$selected:0 +if {*,-BACKSPACE}" || "{*,-SPACE}" || "{*,-B} selected:=($selected+$step)%$nb_images +else selected:=cut($selected+$step,0,$nb_images-1) +fi +rmn thumb_view,canvas_label_info +elif ($mouse_area==1" || "$is_CTRL)" && "({*,0}" || "{*,1}" || "{*,2}" || "{*,3}" || "{*,4}" || "{*,5}" || "{*,6}" || "{*,7}" || "{*,8}" || "{*,9}" || "{*,PAD0}" || "{*,PAD1}" || "{*,PAD2}" || "{*,PAD3}" || "{*,PAD4}" || "{*,PAD5}" || "{*,PAD6}" || "{*,PAD7}" || "{*,PAD8}" || "{*,PAD9}) +ind=-1 repeat 10 { if {*,$>}" || "{*,PAD$>} ind=$> break fi } +if inrange($ind,0,$nb_images,1,0)" && "$selected!=$ind +selected=$ind +rmn thumb_view,canvas_label_info +skip {*,-PAD$ind},{*,-$ind} +fi +fi +if $mouse_area==1 +if {*,o} +step:={*,-o}*max(1,round($nb_images/32)) +selected:=cut($selected+$step,0,$nb_images-1) +rmn thumb_view +elif {*,-C} +selected:=floor($nb_images/2) +rmn thumb_view +fi +fi +if $selected!=$previous_selected +if $thumb_is_visible +x0,w={thumb_coords,[i(0,$selected,0,0),i(0,$selected,0,2)]} +if $x0<$thumb_x_px thumb_x={thumb_base,($x0-48)/w} +elif $x0+$w>=$thumb_x_px+$window_width thumb_x={thumb_base,($x0+$w-$window_width+48)/w} +fi +fi +if [{$selected,[w,h,d]}]!=[{$previous_selected,[w,h,d]}] +whd={$previous_selected,`string(w,'_',h,'_',d)`} +view_coords_$whd=$view_center_x,$view_center_y,$view_center_z,$view_zoom,$view_base_channel,$canvas_cross_x,$canvas_cross_y +whd={$selected,`string(w,'_',h,'_',d)`} +if narg(${view_coords_$whd}) +view_center_x,view_center_y,view_center_z,view_zoom,view_base_channel,canvas_cross_x,canvas_cross_y=${view_coords_$whd} +else +view_center_x,view_center_y,view_center_z,view_zoom,view_base_channel,canvas_cross_x,canvas_cross_y=0.5,0.5,0.5,1,0,, +fi +fi +rmn canvas_volumetric_background,canvas_base +fi +fi +if w#$selected +zoom_1_1,zoom_min,zoom_max={$selected," +const mw4 = max(w,4); const mh4 = max(h,4); const md4 = max(d,4); +const M = max(mw4/$area_xy_width,mh4/$area_xy_height); +[ M,min(M,0.25),M*max($area_xy_width,$area_xy_height,$area_xz_height,$area_zy_width)/min(max(w,h,d),12) ]"} +pan_x_min,pan_x_max,pan_y_min,pan_y_max,pan_z_min,pan_z_max={$selected," +const mw4 = max(w,4); const mh4 = max(h,4); const md4 = max(d,4); +const delta = 0.5/$view_zoom*min(mw4/$area_xy_width,mh4/$area_xy_height,md4/$area_xz_height,md4/$area_zy_width); +const delta_x = ceil(delta*$area_xy_width/w); +const delta_y = ceil(delta*$area_xy_height/h); +const delta_z = ceil(delta*min($area_xz_height,$area_zy_width)/d); +[ min(0,1 - delta_x), max(1,delta_x), +min(0,1 - delta_y), max(1,delta_y), +min(0,1 - delta_z), max(1,delta_z) ]"} +repeat 2 { +but:=2*$> +if !$but" && "$is_CTRL continue fi +if isin($event_type0,0,1)" && "inrange(${is_drag$but},2,4)" && "inrange(${is_clicked$but},2,4) +drag_dx,drag_dy:=[${drag_end_x$but},${drag_end_y$but}]-[${drag_start_x$but},${drag_start_y$but}] +ar=${is_drag$but} +if $ar==2 +view_center_x-=$drag_dx/$area_width*$area_dx/w#$selected +view_center_y-=$drag_dy/$area_height*$area_dy/h#$selected +elif $ar==3 +view_center_x-=$drag_dx/$area_width*$area_dx/w#$selected +view_center_z-=$drag_dy/$area_height*$area_dy/d#$selected +elif $ar==4 +view_center_z-=$drag_dx/$area_width*$area_dx/d#$selected +view_center_y-=$drag_dy/$area_height*$area_dy/h#$selected +fi +view_center_x,view_center_y,view_center_z:=[cut($view_center_x,$pan_x_min,$pan_x_max),cut($view_center_y,$pan_y_min,$pan_y_max),cut($view_center_z,$pan_z_min,$pan_z_max)] +drag_start_x$but,drag_start_y$but=${drag_end_x$but},${drag_end_y$but} +rmn canvas_base +event_type0=1 +elif $event_type0==1" && "${is_drag$but}==2" && "${is_released$but} +event_type0,is_drag0,is_released0,is_drag2,is_released2=0 +fi +} +if !$is_volumetric" && "$is_CTRL" && "$mouse_x>=0 +if isin($event_type0,0,2)" && "$is_drag0==2" && "$is_clicked0==2 +if !narg($canvas_crop_x0) x,y=$drag_start_x0,$drag_start_y0 else x,y=$drag_end_x0,$drag_end_y0 fi +cx,cy={$selected,[cut(round(lerp($area_xy_x0,$area_xy_x1,$x/$canvas_width),1,-1),0,w-1),cut(round(lerp($area_xy_y0,$area_xy_y1,($y-$thumb_height2)/$canvas_height),1,-1),0,h-1)]} +if !narg($canvas_crop_x0) +canvas_crop_x0,canvas_crop_y0,canvas_crop_x1,canvas_crop_y1=$cx,$cy,$cx,$cy +rmn canvas_view +elif [$cx,$cy]!=[$canvas_crop_x1,$canvas_crop_y1] +canvas_crop_x1,canvas_crop_y1=$cx,$cy +rmn canvas_view +fi +n_view_center_x,n_view_center_y=$view_center_x,$view_center_y +if $canvas_mouse_x<64 +n_view_center_x-={$selected,lerp(128,8,$canvas_mouse_x/64)/$view_zoom/w} +elif $canvas_mouse_x>=$canvas_width-64 +n_view_center_x+={$selected,lerp(128,8,($canvas_width-$canvas_mouse_x)/64)/$view_zoom/w} +fi +if $canvas_mouse_y<64 +n_view_center_y-={$selected,lerp(128,8,$canvas_mouse_y/64)/$view_zoom/h} +elif $canvas_mouse_y>=$canvas_height-64 +n_view_center_y+={$selected,lerp(128,8,($canvas_height-$canvas_mouse_y)/64)/$view_zoom/h} +fi +n_view_center_x,n_view_center_y:=[cut($n_view_center_x,$pan_x_min,$pan_x_max),cut($n_view_center_y,$pan_y_min,$pan_y_max)] +if [$n_view_center_x,$n_view_center_y]!=[$view_center_x,$view_center_y] +view_center_x,view_center_y=$n_view_center_x,$n_view_center_y +is_crop_scroll=1 +rmn canvas_base +else +is_crop_scroll=0 +fi +event_type0=2 +elif $event_type0==2" && "$is_drag0==2" && "$is_released0 +if $canvas_crop_x0>$canvas_crop_x1 canvas_crop_x0,canvas_crop_x1=$canvas_crop_x1,$canvas_crop_x0 fi +if $canvas_crop_y0>$canvas_crop_y1 canvas_crop_y0,canvas_crop_y1=$canvas_crop_y1,$canvas_crop_y0 fi +if max($canvas_crop_x1-$canvas_crop_x0,$canvas_crop_y1-$canvas_crop_y0)>8 +view_center_x,view_center_y,view_zoom={$selected," +const wc = $canvas_width; +const hc = $canvas_height; +const f = 0.5*max(w/wc,h/hc); +[ cut(0.5*($canvas_crop_x0 + $canvas_crop_x1)/w,0,1), +cut(0.5*($canvas_crop_y0 + $canvas_crop_y1)/h,0,1), +2*f*min(wc/max(8,$canvas_crop_x1 - $canvas_crop_x0), +hc/max(8,$canvas_crop_y1 - $canvas_crop_y0)) ]"} +rmn canvas_base +fi +canvas_crop_x0,canvas_crop_y0,canvas_crop_x1,canvas_crop_y1= +event_type0,is_drag0,is_released0=0 +rmn canvas_view +fi +fi +if inrange($is_drag1,2,4)" && "inrange($is_clicked1,2,4) +amount:=" +dx = $drag_end_x1 - $drag_start_x1; +dy = $drag_end_y1 - $drag_start_y1; +sign(dx)*norm(dx,dy)/200" +if !narg($zoom_focus_x) zoom_focus_x,zoom_focus_y=$area_mouse_x,$area_mouse_y fi +n_view_zoom:=cut($view_zoom*(1+$amount),$zoom_min,$zoom_max) +ratio:=$view_zoom/$n_view_zoom +if $n_view_zoom!=$view_zoom +if !$is_volumetric +if $is_drag1==2 +xc:=lerp($area_xy_x0,$area_xy_x1,$zoom_focus_x/$area_width) +yc:=lerp($area_xy_y0,$area_xy_y1,$zoom_focus_y/$area_height) +view_center_x:=cut(lerp($xc,$view_center_x*w#$selected,$ratio)/w#$selected,$pan_x_min,$pan_x_max) +view_center_y:=cut(lerp($yc,$view_center_y*h#$selected,$ratio)/h#$selected,$pan_y_min,$pan_y_max) +elif $is_drag1==3 +xc:=lerp($area_xz_x0,$area_xz_x1,$zoom_focus_x/$area_width) +zc:=lerp($area_xz_z0,$area_xz_z1,$zoom_focus_y/$area_height) +view_center_x:=cut(lerp($xc,$view_center_x*w#$selected,$ratio)/w#$selected,$pan_x_min,$pan_x_max) +view_center_z:=cut(lerp($zc,$view_center_z*d#$selected,$ratio)/d#$selected,$pan_z_min,$pan_z_max) +elif $is_drag1==4 +zc:=lerp($area_zy_z0,$area_zy_z1,$zoom_focus_x/$area_width) +yc:=lerp($area_zy_y0,$area_zy_y1,$zoom_focus_y/$area_height) +view_center_z:=cut(lerp($zc,$view_center_z*d#$selected,$ratio)/d#$selected,$pan_z_min,$pan_z_max) +view_center_y:=cut(lerp($yc,$view_center_y*h#$selected,$ratio)/h#$selected,$pan_y_min,$pan_y_max) +fi +fi +view_zoom=$n_view_zoom +rmn canvas_base +fi +drag_start_x1,drag_start_y1=$drag_end_x1,$drag_end_y1 +elif inrange($is_drag1,2,5)" && "$is_released1 +zoom_focus_x,zoom_focus_y= +is_drag1,is_released1=0 +fi +if $is_volumetric +if $is_clicked0>=2" && "$canvas_mouse_x>=0" && "($event_type0==3" || "(!$event_type0" && "norm($canvas_mouse_x-$canvas_cross_x*$canvas_width,$canvas_mouse_y-$canvas_cross_y*$canvas_height)<16)) +is_drag0=$mouse_area +canvas_cross_x,canvas_cross_y:=cut($canvas_mouse_x/$canvas_width,0,1),cut($canvas_mouse_y/$canvas_height,0,1) +drag_start_x0,drag_start_y0=$drag_end_x0,$drag_end_y0 +event_type0=3 +rmn canvas_volumetric_background,canvas_base +elif $event_type0==3" && "$is_drag0>=2" && "$is_released1 +event_type0,is_drag0,is_released0=0 +fi +fi +if $event_type0" && "!$is_clicked0" && "!$is_released0" && "!$is_drag0 +event_type0=0 +rmn canvas_view +fi +if $mouse_area>=2 +if $mouse_area<5" && "({*,o}" || "({*,PADSUB}" || "{*,PADADD})) +if $is_CTRL" && "$is_volumetric +amount:={*,PADADD}?1:{*,PADSUB}?-1:{*,-o} +view_center_x,view_center_y,view_center_z={$selected," +const cx = $view_center_x; +const cy = $view_center_y; +const cz = $view_center_z; +const amount = $amount; +P = $mouse_area==2?[ cx,cy,cz + amount/d ]: +$mouse_area==3?[ cx,cy + amount/d,cz ]: +[ cx + amount/w,cy,cz ]; +[ cut(P[0],$pan_x_min,$pan_x_max), +cut(P[1],$pan_y_min,$pan_y_max), +cut(P[2],$pan_z_min,$pan_z_max) ]"} +rmn canvas_base +else +amount:={*,PADADD}?0.25:{*,PADSUB}?-0.25:{*,-o}/10 +n_view_zoom:=cut($view_zoom*(1+$amount),$zoom_min,$zoom_max) +ratio:=$view_zoom/$n_view_zoom +if $n_view_zoom!=$view_zoom +xc,yc,zc={$selected,"$is_volumetric?( +$mouse_area==2?[ ($area_xy_x0 + $area_xy_x1)/2, ($area_xy_y0 + $area_xy_y1)/2, $view_center_z*d ]: +$mouse_area==3?[ ($area_xz_x0 + $area_xz_x1)/2, $view_center_y*h, ($area_xz_z0 + $area_xz_z1)/2 ]: +[ $view_center_x*w, ($area_zy_y0 + $area_zy_y1)/2, ($area_zy_z0 + $area_zy_z1)/2 ]): +[ lerp($area_xy_x0,$area_xy_x1,$area_mouse_x/$area_width), +lerp($area_xy_y0,$area_xy_y1,$area_mouse_y/$area_height), 0 ]"} +view_center_x:=cut(lerp($xc,$view_center_x*w#$selected,$ratio)/w#$selected,$pan_x_min,$pan_x_max) +view_center_y:=cut(lerp($yc,$view_center_y*h#$selected,$ratio)/h#$selected,$pan_y_min,$pan_y_max) +view_center_z:=cut(lerp($zc,$view_center_z*d#$selected,$ratio)/d#$selected,$pan_z_min,$pan_z_max) +view_zoom=$n_view_zoom +rmn canvas_base +fi +fi +fi +if !$is_CTRL +if (!$is_drag0" && "inrange($is_released0,2,4)) +view_center_x,view_center_y,view_center_z={$selected," +$mouse_area==2?[ lerp($area_xy_x0,$area_xy_x1,$area_mouse_x/$area_width)/w, +lerp($area_xy_y0,$area_xy_y1,$area_mouse_y/$area_height)/h, +$view_center_z ]: +$mouse_area==3?[ lerp($area_xz_x0,$area_xz_x1,$area_mouse_x/$area_width)/w, +$view_center_y, +lerp($area_xz_z0,$area_xz_z1,$area_mouse_y/$area_height)/d ]: +[ $view_center_x, +lerp($area_zy_y0,$area_zy_y1,$area_mouse_y/$area_height)/h, +lerp($area_zy_z0,$area_zy_z1,$area_mouse_x/$area_width)/d ]"} +rmn canvas_base +elif ({*,0}" || "{*,1}" || "{*,2}" || "{*,3}" || "{*,4}" || "{*,5}" || "{*,6}" || "{*,7}" || "{*,8}" || "{*,9}" || "{*,PAD0}" || "{*,PAD1}" || "{*,PAD2}" || "{*,PAD3}" || "{*,PAD4}" || "{*,PAD5}" || "{*,PAD6}" || "{*,PAD7}" || "{*,PAD8}" || "{*,PAD9}) +ind=-1 repeat 10 { if {*,$>}" || "{*,PAD$>} ind=$> break fi } +if $ind>=0 +view_zoom_mode:=($ind-1)%10 +n_view_zoom:=cut(arg0($view_zoom_mode,$zoom_1_1,2*$zoom_1_1,4*$zoom_1_1,1,2,4,$zoom_max/8,$zoom_max/4,$zoom_max/2,$zoom_max),$zoom_min,$zoom_max) +if $n_view_zoom!=$view_zoom view_zoom=$n_view_zoom rmn canvas_base fi +notification="Zoom: "${"arg0 "$view_zoom_mode,"1:1,2:1,4:1,x1,x2,x4,Max/8,Max/4,Max/2,Max"} +rmn canvas_label_notification +skip {*,-PAD$ind},{*,-$ind} +fi +elif {*,-C} +view_center_x,view_center_y,view_center_z=0.5 +rmn canvas_base +elif {*,-HOME} +view_center_x,view_center_y,view_center_z={$selected,0.5/[w,h,d]} +rmn canvas_base +elif {*,-END} +view_center_x,view_center_y,view_center_z={$selected,1-0.5/[w,h,d]} +rmn canvas_base +elif {*,-P}" && "['$view_xyz']!=0 ++e "Command 'display': I(#"$selected,$view_xyz_disp") = [ "{$selected,I($view_xyz)}" ]" +elif ({*,PAGEUP}" || "{*,PAGEDOWN})" && "{$selected,s>3}" && "!$alpha_mode +n_view_base_channel={$selected,cut($view_base_channel+({*,-PAGEUP}?1:{*,-PAGEDOWN}?-1:0),0,s-3)} +if $n_view_base_channel!=$view_base_channel +view_base_channel=$n_view_base_channel +notification="Base channel: "$view_base_channel +rmn canvas_base,canvas_label_notification +fi +elif $mouse_area<5" && "({*,ARROWLEFT}" || "{*,ARROWRIGHT}" || "{*,ARROWUP}" || "{*,ARROWDOWN}) +step:=$is_volumetric" || "$view_zoom>=$zoom_max/4?1:($area_xy_dx+$area_xy_dy)/40 +dx,dy:={*,ARROWLEFT}?-$step:{*,ARROWRIGHT}?$step:0,{*,ARROWUP}?-$step:{*,ARROWDOWN}?$step:0 +if $is_SHIFT dx,dy*=4 fi +if $mouse_area==2 dx,dy,dz={$selected,[$dx/w,$dy/h,0]} +elif $mouse_area==3 dx,dy,dz={$selected,[$dx/w,0,$dy/d]} +else dx,dy,dz={$selected,[0,$dy/h,$dx/d]} +fi +view_center_x:=cut($view_center_x+$dx,$pan_x_min,$pan_x_max) +view_center_y:=cut($view_center_y+$dy,$pan_y_min,$pan_y_max) +view_center_z:=cut($view_center_z+$dz,$pan_z_min,$pan_z_max) +rmn canvas_base +fi +fi +if [$mouse_x,$mouse_y]!=[$previous_mouse_x,$previous_mouse_y]" && "$mouse_area>=2 +rmn canvas_label_coords +fi +elif $previous_mouse_area>=2 +rmn canvas_label_coords,canvas_view +fi +fi +if {canvas_label,($canvas_mouse_x5*h)} +canvas_label_alignment:=!$canvas_label_alignment +rmn canvas_view +fi +if {*,r} +w[] -1,-1 +rmn thumb_base,canvas_base,canvas_label_info +fi +if {$selected,w} +if {*,-A}" && "{$selected,(s==2||s==4)} +alpha_mode:=($alpha_mode+1)%5 +notification="Alpha: "${"arg0 "$alpha_mode,"Off,On,\"Over black\",\"Over gray\",\"Over white\""} +rmn thumb_base,canvas_base,canvas_label_notification +elif {*,-ENTER} +view_center_x,view_center_y,view_center_z,view_zoom=0.5,0.5,0.5,1 +if {is_rotated,i[$selected]} rotate[$selected] {is_rotated,-90*i[$selected]} =[is_rotated] 0,0,$selected fi +rmn canvas_base +elif {*,-G} +canvas_is_grid:=!$canvas_is_grid +notification="Grid: "${"arg0 "$canvas_is_grid,"Off,On"} +rmn canvas_base,canvas_label_notification +elif {*,-H} +view_center_x,view_center_y,view_center_z={$selected,0.5/[w,h,d]} +rmn canvas_base +elif {*,-E} +view_center_x,view_center_y,view_center_z={$selected,1-0.5/[w,h,d]} +rmn canvas_base +elif {*,-M} +if ${is_mesh3d[$selected]} +d3d[$selected] +rmn thumb_base,canvas_base,canvas_label_info +wait -1 +fi +elif {*,-N} +normalization_mode:=($normalization_mode+1)%4 +notification="Normalization: "${"arg0 "$normalization_mode,"Disabled,Cut,\"Stretch (channel-wise)\",\"Stretch (global)\""} +rmn thumb_base,canvas_base,canvas_label_notification +elif {*,-R} +=[is_rotated] {is_rotated,(i[$selected]+1)%4},0,$selected +rotate[$selected] 90 +notification="Angle: "{is_rotated,90*i[$selected]}\260 +rmn canvas_base,canvas_label_info,canvas_label_notification +elif {*,X}" && "$is_volumetric +canvas_cross_x,canvas_cross_y= +rmn canvas_volumetric_background,canvas_base +skip {*,-X} +elif {*,-Z} +view_zoom_mode:=($view_zoom_mode+1)%10 +n_view_zoom:=cut(arg0($view_zoom_mode,$zoom_1_1,2*$zoom_1_1,4*$zoom_1_1,1,2,4,$zoom_max/8,$zoom_max/4,$zoom_max/2,$zoom_max),$zoom_min,$zoom_max) +if $n_view_zoom!=$view_zoom view_zoom=$n_view_zoom rmn canvas_base fi +notification="Zoom: "${"arg0 "$view_zoom_mode,"1:1,2:1,4:1,x1,x2,x4,Max/8,Max/4,Max/2,Max"} +rmn canvas_label_notification +fi +fi +if $is_CTRL +if {*,-C} +is_fullscreen=0 +w[] {round([max(128,0.87*$window_width),max(128,0.87*$window_height)])},0,0 +rmn thumb_base,canvas_base,canvas_label_info +elif {*,-D} +is_fullscreen=0 +w[] {round([min({*,u},1.15*$window_width),min({*,v},1.15*$window_height)])},0,0 +rmn thumb_base,canvas_base,canvas_label_info +elif {*,-F} +if $is_fullscreen +is_fullscreen=0 +w[] $window_nonfullscreen_width,$window_nonfullscreen_height,0,0 +else +is_fullscreen,window_nonfullscreen_width,window_nonfullscreen_height=1,{*,d,e} +w[] {*,u,v},0,1 +fi +notification="Fullscreen: "${"arg0 "$is_fullscreen,"Off,On"} +rmn thumb_base,canvas_base,canvas_label_info,canvas_label_notification +elif {*,-I} +canvas_is_info:=!$canvas_is_info +notification="Information: "${"arg0 "$canvas_is_info,"Off,On"} +rmn canvas_base,canvas_label_notification +elif {*,-O}" || "{*,-L} +repeat 256 { filename gmic.gmz,$> filename=${} if !isfile('$filename') break fi } +if {*,-L} +o[^$nb_images--1] $filename +notification="Saved list copy: "$filename +else +o[$selected] $filename +notification="Saved image copy: "$filename +fi +rmn canvas_label_notification +elif {*,-S}" && "0$canvas_base +repeat 256 { filename gmic.png,$> filename=${} if !isfile('$filename') break fi } +notification="Save screenshot: "$filename +rmn canvas_label_notification +o[canvas_base] $filename +elif {*,-X} +canvas_axis_mode:=a=($canvas_axis_mode+1)%3;$is_volumetric?(a?2:0):(a==1) +notification="Axis: "${"arg0 "$canvas_axis_mode,"Off,\"On (2D only)\",On"} +rmn canvas_view,canvas_label_notification +fi +fi +if $nb_images>1" && "{*,-TAB} +thumb_is_visible:=!$thumb_is_visible +rmn canvas_base +fi +if $is_released0 is_released0=0 fi +if $canvas_label_notification +notification_opacity-=0.1 +if $notification_opacity<=0 rm[canvas_label_notification] notification_opacity=0 fi +window_wait_mode=1 +rmn canvas_label +fi +} +eval[is_rotated] ">i?run('rotate[',y,'] ',-90*i)" +if narg($window_previous_normalization) +w[] -1,-1,$window_previous_normalization,$window_previous_fullscreen +else +w[] 0 +fi +rm[$nb_images--1] +is_change 0 +_display_default_window_size : +u {"const fmax = 0.65; +const u = min(1280,fmax*"{*,u}"); +const v = min(1280,fmax*"{*,v}"); +Mw = Mh = 0; +repeat (l,k, +w = max(1,w#k); +h = max(1,h#k); +d>1?(w+=d; h+=d); +fact = min(u/w,v/h); +nw = ceil(fact*w); +nh = ceil(fact*h); +nw>Mw?(Mw = nw); +nh>Mh?(Mh = nh); +); +Mwh = max(Mw,Mh); +Mw = Mwh*max($2,Mw/Mwh); +Mh = Mwh*max($2,Mh/Mwh); +l>1?(Mh = (Mh + 2)/(1 - $1)): +!w#0?(Mw/=2; Mh/=2); +round([ Mw,Mh ])"} +_display_is_infnan : +if w sh 0,{min(s-1,2)} u {s=is;isinf(s)||isnan(s)} rm. +else u 0 +fi +_display_minmax_infnan : +eval. " +begin( +val_min = inf; +val_max = -inf +); +val = i; +!isinf(val)?( +valval_max?(val_max = val) +); +end( +merge(val_min,min); merge(val_max,max); +set('{}',v2s([val_min,val_max])); +)" +_display_normalize_infnan : +val_min,val_max=${_display_minmax_infnan.} +f. " +const min = $val_min; const max = $val_max; const delta = max - min; +const epsilon = delta>0?delta:1; +const nmin = min - epsilon; const nmax = max + epsilon; const ndelta = nmax - nmin; +const nfact = 255/(ndelta>0?ndelta:1); +val = i; +isinf(val)?(val<0?0:255):isnan(val)?0:(val - nmin)*nfact" +#@cli d0 : eq. to 'display0'. +d0 : +_gmic_s="$?" +prev_display_normalization_mode=$_display_normalization_mode +prev_display_alpha_mode=$_display_alpha_mode +_display_normalization_mode=0 +_display_alpha_mode=1 +v + _display "",1,$[] v - +_display_normalization_mode=$prev_display_normalization_mode +_display_alpha_mode=$prev_display_alpha_mode ++d0 : +prev_display_normalization_mode=$_display_normalization_mode +prev_display_alpha_mode=$_display_alpha_mode +_display_normalization_mode=0 +_display_alpha_mode=1 +_gmic_s="$?" v + _display +,1,$[] v - +_display_normalization_mode=$prev_display_normalization_mode +_display_alpha_mode=$prev_display_alpha_mode +#@cli display0 +#@cli : Display selected images in an interactive window, without normalization and alpha mode activated. +display0 : +prev_display_normalization_mode=$_display_normalization_mode +prev_display_alpha_mode=$_display_alpha_mode +_display_normalization_mode=0 +_display_alpha_mode=1 +_gmic_s="$?" v + _display "",1,$[] v - +_display_normalization_mode=$prev_display_normalization_mode +_display_alpha_mode=$prev_display_alpha_mode ++display0 : +prev_display_normalization_mode=$_display_normalization_mode +prev_display_alpha_mode=$_display_alpha_mode +_display_normalization_mode=0 +_display_alpha_mode=1 +_gmic_s="$?" v + _display +,1,$[] v - +_display_normalization_mode=$prev_display_normalization_mode +_display_alpha_mode=$prev_display_alpha_mode +#@cli d3d : eq. to 'display3d'. +d3d : skip "${1=},${2=0}" +l[] { is_image_arg=${"is_image_arg $1"} is_arg={$is_image_arg" || isnum($1)"} onfail is_arg=0 } +if $is_arg arg=$is_image_arg,$2 if $is_image_arg pass$1 1 _d3d_wh={[w,h]} store. _d3d_background fi +else arg=0,0 noarg fi +v + _display3d $arg +#@cli display3d : _[background_image],_exit_on_anykey={ 0 | 1 } : _exit_on_anykey={ 0 | 1 } +#@cli : Display selected 3D objects in an interactive viewer (use the instant display window [0] if opened). +#@cli : (eq. to 'd3d'). +#@cli : Default values: '[background_image]=(default)' and 'exit_on_anykey=0'. +display3d : skip "${1=},${2=0}" +l[] { is_image_arg=${"is_image_arg $1"} is_arg={$is_image_arg" || isnum($1)"} onfail is_arg=0 } +if $is_arg arg=$is_image_arg,$2 if $is_image_arg pass$1 1 _d3d_wh={[w,h]} store. _d3d_background fi +else arg=0,0 noarg fi +v + _$0 $arg +_display3d : +is_user_background,exit_on_anykey=$1,$2 +if !$! e[0--3] "Display 3D object []." return fi +foreach { +l. { check3d 1 onfail l[] { ({'${}'}) s +,{'"'check3d': "'} k. msg={t} rm } error[] "Command 'display3d': "$msg } +nm={n} bnm={b} l. { if ['{x}']!=0 bnm.=.{x} fi onfail bnm.=.{x} } +nbv,nbp:=f2ui([i[6],i[7]]) +e[0--4] "Display 3D object ["{arg(1+$>,$[])}"] = '"$nm"' ("$nbv" vertices, "$nbp" primitives)." +if ['$_d3d_title']==0 disp_title=$bnm" ("$nbv" vertices, "$nbp" primitives)" else disp_title=$_d3d_title fi +if !{*} +if narg($_d3d_wh) w[] ${fitscreen\ $_d3d_wh,1,128,1024},0,$disp_title +else w[] ${fitscreen\ {[0.5,0.6]*[{*,u,v}]},1,128,1024},0,$disp_title +fi +else disp_normalization={*,n} w[] -1,-1,0,$disp_title fi +disp_size0={*,w,h} +(1,0,0,0;0,1,0,0;0,0,1,0) store. pose3d +posx,posy,zoom_factor=50,50,1 +is_fullscreen,is_zbuffer,is_axes3d,is_outline,is_boundingbox,is_animate,is_outvideo={*,f},1,1,0,0,0,0 +mode_render:=isint($_mode3d)?$_mode3d:4 +mode_drender:=isint($_moded3d)?$_moded3d:-1 +mode_background={$is_user_background?7:5} +mode_orientation:=!isbool($_double3d)?2:$_double3d==1?2:0; +mode_animate=1 +speed_animate=1 +focale:=isnum($_focale3d)?$_focale3d:800 +mx0,my0,mx1,my1= +notification= fontsize_notif= +wait_event=1 +axes3d 40,40,40,20,X,Y,Z,0 col3d. 0,255,0 l. { s3d a[0-3] y off_axes={0,h} a y } => axes3d +do +is_motion={narg($mx0)} +if $is_animate" || "$is_outvideo rmn render fi +if !narg($background) +if $mode_background<3 {*,w,h},1,3,{arg(1+$mode_background,0,255,128)} +elif $mode_background==3 3,2,1,1,"16,16,48,44,96,76" permute. cyzx r. {*,w,h},1,3,3 round. +elif $mode_background==4 3,2,1,1,"0,0,0,0,64,96" permute. cyzx r. {*,w,h},1,3,3 round. +elif $mode_background==5 3,3,1,1,"0,0,0,0,0,100,100,0,50" permute. cyzx r. {*,w,h},1,3,3 round. +elif $mode_background==6 2,2,1,1,110,90,90,110 r. 64,64,1,3 r. {*,w,h},1,3,0,2,0.5,0.5 +else $_d3d_background r. {*,w,h},1,3,1 +fi +w. => background +rmn object3d +fi +if !narg($object3d) ++c3d[0] n3d. *3d. {background,$zoom_factor*0.65*min(w,h)} +if $mode_orientation==1 rv3d. fi +rmn boundingbox3d +if $is_boundingbox +boundingbox3d. o3d. 0.2 => boundingbox3d +3d.. . rv[-2,-1] fi +=> object3d +rmn render +fi +if !narg($render) +$pose3d +if $is_animate" || "$is_outvideo l. { +da={$speed_animate*($is_animate?20*($|-$time_animate):1)} +if $mode_animate==0 rotation3d 1,0,0,$da rv +elif $mode_animate==1 rotation3d 0,1,0,$da rv +elif $mode_animate==2 rotation3d 0,0,1,$da rv +else +dax,day,daz={[0.75,0.82,0.97]*$da} +rotation3d 0,1,0,$dax rotation3d 1,0,0,$day rotation3d 0,0,1,$daz rv +fi +m* 1,3,1,1 j.. .,3 rm. +store. pose3d +time_animate=$| +} fi +p={^} rm. +m={$is_motion?$mode_drender:$mode_render} +[background] => render +if $m<0 +if !narg($boundingbox3d) +boundingbox3d[object3d] o3d. 0.35 => boundingbox3d fi ++pose3d[boundingbox3d] $p +j3d[render] .,$posx%,$posy%,0,1,1,0,0,$focale rm. +else ++pose3d[object3d] $p +if $is_outline +{render,[w,h]},1,3,-1 +j3d. ..,$posx%,$posy%,0,1,$m,{$mode_orientation==2},$is_zbuffer,$focale ++channels. 0 !=. -1 ++dilate. 5 r. 100%,100%,1,3 j[render] .,0,0,0,0,0.8,. rm. +j[render] ..,0,0,0,0,1,. rm[-2,-1] +else +j3d[render] .,$posx%,$posy%,0,1,$m,{$mode_orientation==2},$is_zbuffer,$focale +fi +rm. +fi +if $is_axes3d ++pose3d[axes3d] $p +eval " +const off = "$off_axes"; +ref([ 255,0,0 ],col); +i[13]>0?copy(i[off],col,3); +i[19]>0?copy(i[off + 3],col,3); +i[25]>0?copy(i[off + 6],col,3); +" +j3d[render] .,50,{-2,h-50},0,0.75,1,0,0,150 rm. +fi +rmn view +if $is_outvideo +o[render] $filename_outvideo,20,0,1 +nb_frames={int(360/$speed_animate)} +if $is_outvideo>=$nb_frames +o[] $filename_outvideo,20,0,0 +is_outvideo=0 +notification="Output Video:\nDone!" +else +is_outvideo+=1 +notification="Output Video:\nFrame "{$is_outvideo-1}/$nb_frames +fi +fi +fi +if narg($notification) +wait_event=0 +if !isnum($notification) +rmn notification_gfx +ofs,fs={narg($fontsize_notif)?0$fontsize_notif:32} +do +0 t. {``$notification},0,0,$fs,1,255 +if narg($fontsize_notif) break +elif {background,"(w#-1>0.7*w || h#-1>0.25*h) && "$fs>13" && "$ofs>=$fs} +ofs,fs=$fs,{max(13,round($fs/1.25))} rm. +elif {background,"w#-1<0.3*w && h#-1<0.25*h && "$fs<64" && "$ofs<=$fs} +ofs,fs=$fs,{min(64,round($fs*1.25))} rm. +else +fontsize_notif=$fs break +fi +while 1 +r. {[w+12,h+8]},1,1,0,0,0.5,0.5 rectangle. 0,0,100%,100%,1,0xFFFFFFFF,255 to_rgb. +=> notification_gfx +notification=$| +else +if $|>$notification+1 rm[notification_gfx] wait_event=1 notification= fi +rmn view +fi +fi +if !narg($view) +if $notification_gfx ++j[render] [notification_gfx],0.99~,5,0,0,{sqrt(max(0,1-($|-$notification)))} +else [render] +fi +=> view w. -1,-1,0,$is_fullscreen,$disp_title +fi +if $is_motion" || "$is_animate wait_event=0 fi +if $wait_event wait elif !$is_outvideo wait 20 fi +if $exit_on_anykey" && "{*,k} break fi +if $is_outvideo continue fi +mx,my,mb={*,x,y,b} +is_CTRL={{*,CTRLLEFT}" || "{*,CTRLRIGHT}} +if {*,-F1} +mode_render,mode_drender={M=0;m=$mode_render;wasbbox=$mode_drender<0;[M,m!=M?(wasbbox?-1:M):(wasbbox?M:-1)]} +notification="Render: Dots" if $mode_drender<0 notification.=" + Box" fi +rmn render +elif {*,-F2} +mode_render,mode_drender={M=1;m=$mode_render;wasbbox=$mode_drender<0;[M,m!=M?(wasbbox?-1:M):(wasbbox?M:-1)]} +notification="Render: Wireframe" if $mode_drender<0 notification.=" + Box" fi +rmn render +elif {*,-F3} +mode_render,mode_drender={M=2;m=$mode_render;wasbbox=$mode_drender<0;[M,m!=M?(wasbbox?-1:M):(wasbbox?M:-1)]} +notification="Render: Flat" if $mode_drender<0 notification.=" + Box" fi +rmn render +elif {*,-F4} +mode_render,mode_drender={M=3;m=$mode_render;wasbbox=$mode_drender<0;[M,m!=M?(wasbbox?-1:M):(wasbbox?M:-1)]} +notification="Render: Flat-Shaded" if $mode_drender<0 notification.=" + Box" fi +rmn render +elif {*,-F5} +mode_render,mode_drender={M=4;m=$mode_render;wasbbox=$mode_drender<0;[M,m!=M?(wasbbox?-1:M):(wasbbox?M:-1)]} +notification="Render: Gouraud-Shaded" if $mode_drender<0 notification.=" + Box" fi +rmn render +elif {*,-F6} +mode_render,mode_drender={M=5;m=$mode_render;wasbbox=$mode_drender<0;[M,m!=M?(wasbbox?-1:M):(wasbbox?M:-1)]} +notification="Render: Phong-Shaded" if $mode_drender<0 notification.=" + Box" fi +rmn render +elif {*,-F7}" && "($focale>100" || "!$focale) +if !$focale focale=2000 else focale-=100 fi +notification="Focale: "$focale +rmn render +elif {*,-F8}" && "$focale +if $focale>=2000 focale=0 notification="Focale: Inf" else focale+=100 notification="Focale: "$focale fi +rmn render +elif {*,-F9} +mode_animate={($mode_animate+1)%4} +n0,n1,n2,n3="X-Axis","Y-Axis","Z-Axis","XYZ-Axes" notification="Animation Mode: "${n$mode_animate} +rmn render +elif {*,-F10} +speed_animate={max(1,($speed_animate+1)%9)} +notification="Animation Speed: X"$speed_animate +elif {*,-SPACE} +is_animate,time_animate={!$is_animate},$| +n0,n1="Off","On" notification="Animation: "${n$is_animate} +rmn render +fi +if $is_CTRL +if {*,-A} +is_axes3d={!$is_axes3d} +n0,n1="Off","On" notification="3D Axes: "${n$is_axes3d} +rmn render +elif {*,-B} +mode_background={($mode_background+1)%($is_user_background?8:7)} +n0,n1,n2,n3,n4,n5,n6,n7="Black","White","Gray","Gradient \#1","Gradient \#2","Gradient \#3","Checkerboard","User-Defined" +notification="Background: "${n$mode_background} +rmn background +elif {*,-C}" && "{*,w}>128" && "{*,h}>128 w[] {0.8*[{*,w,h}]} +notification="Decrease Window Size" fontsize_notif= +rmn background +elif {*,-D}" && "{*,w}<0.8*{*,u}" && "{*,h}<0.8*{*,v} w[] {1.25*[{*,w,h}]} +notification="Increase Window Size" fontsize_notif= +rmn background +elif {*,-F} +is_fullscreen={!$is_fullscreen} +if $is_fullscreen w[] {*,u,v} else w[] {0.75*[{*,u,v}]} fi +n0,n1="Off","On" notification="Fullscreen: "${n$is_fullscreen} fontsize_notif= +rmn background +elif {*,-G} +n=0 do filename gmic.obj,$n n+=1 while isfile(['{/${}}']) +notification="Save Copy:\n"${} +o[0] ${} +elif {*,-L} +is_outline={!$is_outline} +n0,n1="Off","On" notification="Outline: "${n$is_outline} +rmn render +elif {*,-O} +n=0 do filename gmic.gmz,$n n+=1 while isfile(['{/${}}']) +o[0] ${} +notification="Save Copy:\n"${} +elif {*,-P} +$pose3d v 0 e " > 3D Pose = [ "{^}" ]." rm. +elif {*,-R} +w[] $disp_size0 +notification="Reset Window Size" fontsize_notif= +rmn background +elif {*,-S} +n=0 do filename gmic.png,$n n+=1 while isfile(['{/${}}']) +o[render] ${} +notification="Save Screenshot:\n"${} +elif {*,-T} +mode_orientation={($mode_orientation+1)%3} +n0,n1,n2="Forward","Backward","Double-Sided" notification="Orientation: "${n$mode_orientation} +if $mode_orientation rv3d[object3d] fi +rmn render +elif {*,-V} +is_outvideo={!$is_outvideo} +is_animate=0 +n=0 do filename gmic.mp4,$n n+=1 while isfile(['{/${}}']) +filename_outvideo=${} +elif {*,-X} +is_boundingbox={!$is_boundingbox} +n0,n1="Off","On" notification="Bounding Box: "${n$is_boundingbox} +rmn object3d +elif {*,-Z} +is_zbuffer={!$is_zbuffer} +n0,n1="Off","On" notification="Z-Buffer: "${n$is_zbuffer} +rmn render +fi +fi +if {*,-r} rmn background fontsize_notif= fi +if $mx>=0 +if $mb +if !narg($mx0) mx0,my0,mx1,my1=$mx,$my,$mx,$my else mx1,my1=$mx,$my fi +else +if narg($mx0) rmn render fi +mx0,my0,mx1,my1= +fi +fi +if narg($mx1)" && "($mx0!=$mx1" || "$my0!=$my1) +rmn render +if $mb&1" && "!$is_CTRL +rotation3d[] {" +const w2 = "{*,w}"/2; +const h2 = "{*,h}"/2; +const R = 0.375*min("{*,w,h}"); +const u0 = "$mx0" - w2; +const v0 = "$my0" - h2; +const u1 = "$mx1" - w2; +const v1 = "$my1" - h2; +n0 = norm(u0,v0); +nu0 = n0>R?u0*R/n0:u0; +nv0 = n0>R?v0*R/n0:v0; +nw0 = sqrt(max(0,R^2 - nu0^2 - nv0^2)); +n1 = norm(u1,v1); +nu1 = n1>R?u1*R/n1:u1; +nv1 = n1>R?v1*R/n1:v1; +nw1 = sqrt(max(0,R^2 - nu1^2 - nv1^2)); +u = nv0*nw1 - nw0*nv1; +v = nw0*nu1 - nu0*nw1; +w = nv0*nu1 - nu0*nv1; +n = norm(u,v,w); +[ u,v,w,-asin(n/R^2)*180/pi ]"} +$pose3d m*[-2,-1] store. pose3d +mx0,my0=$mx1,$my1 +elif $mb&4" || "($mb&1" && "$is_CTRL) +posx,posy={" +const px = $mx1 - $mx0 + $posx*"{*,w}"%; +const py = $my1 - $my0 + $posy*"{*,h}"%; +[px,py]*100/["{*,w,h}"]"} +mx0,my0=$mx1,$my1 +elif $mb&2 +fact={1+($my0-$my1)/100} +zoom_factor*=$fact +*3d[object3d] $fact if narg($boundingbox3d) *3d[boundingbox3d] $fact fi +mx0,my0=$mx1,$my1 +fi +fi +if {*,o} +fact={1+{*,-o}/10} +zoom_factor*=$fact +*3d[object3d] $fact if narg($boundingbox3d) *3d[boundingbox3d] $fact fi +rmn render +fi +while {*}" && "!{*,ESC}" && "!($is_CTRL" && "{*,W}) +k[0] +} +if narg($disp_normalization) w[] -1,-1,$disp_normalization else w[] 0 fi +v -1 d[] +#@cli da : eq. to 'display_array'. +da : +_gmic_s="$?" v + _display_array $* +#@cli display_array : _width>0,_height>0 +#@cli : Display images in interactive windows where pixel neighborhoods can be explored. +#@cli : Default values: 'width=13' and 'height=width'. +display_array : +_gmic_s="$?" v + _$0 $* +_display_array : check ${1=13}>0" && "${2=$1}>0 +e[0--3] "Display $1x$2 array of pixel values for image"$_gmic_s"." +dxb={round($1/2,1,1)} dxf={$1-1-$dxb} +dyb={round($2/2,1,1)} dyf={$2-1-$dyb} +foreach { +if w<128" && "h<128 r 128,128,100%,100%,0,0,0.5,0.5 fi +x0=0 y0=0 w={w} h={h} +wmax={0.9*{*,u}} hmax={0.9*{*,v}} +do +if w>=$wmax" || "h>=$hmax +n={n} => "Image "'{b}.{x}'" is too large, please select a sub-image." ++select. 2 x0={i[0]} y0={i[1]} w={1+i[3]-i[0]} h={1+i[4]-i[1]} +rm. => $n +fi ++z. $x0,$y0,0,{$x0+$w-1},{$y0+$h-1},0 round. 1 n. 0,255 +while w>=$wmax" || "h>=$hmax +x1=-1 y1=-1 c1=0 ox1=-1 oy1=-1 oc1=-1 +x2=-1 y2=-1 c2=0 ox2=-1 oy2=-1 oc2=-1 +x3=-1 y3=-1 c3=0 ox3=-1 oy3=-1 oc3=-1 +c0=0 oxm=-1 oym=-1 +w. -1,-1,0,0,{-2,b}.{-2,x} +do +wait[0-3] +oc0=$c0 +repeat 4 { +if $>" && "!{*$>}" && "${x$>}>=0 w$> 0 x$>=-1 y$>=-1 c$>=0 fi +if {*$>,o} c$>={(${c$>}+sign({*$>,o}))%s} wait[$>] -1 fi +if {*$>,SPACE}" || "{*$>,ENTER}" || "{*$>,ARROWRIGHT}" || "{*$>,ARROWDOWN} c$>={(${c$>}+1)%s} wait[$>] -1 fi +if {*$>,BACKSPACE}" || "{*$>,ARROWLEFT}" || "{*$>,ARROWUP} c$>={(${c$>}-1)%s} wait[$>] -1 fi +} +if $oc0!=$c0 c1=$c0 c2=$c0 c3=$c0 fi +xm={*,x} ym={*,y} +if $xm>=0" && "{*,b}&1 x1=$xm y1=$ym fi +if $xm>=0" && "{*,b}&2 x2=$xm y2=$ym fi +if $xm>=0" && "{*,b}&4 x3=$xm y3=$ym fi +if $xm>=0" && "($oxm!=$xm" || "$oym!=$ym) w[] -1,-1,{-2,b}.{-2,x}" - ("$xm,$ym")" fi +if $x1!=$ox1" || "$y1!=$oy1" || "$x2!=$ox2" || "$y2!=$oy2" || "$x3!=$ox3" || "$y3!=$oy3 +. +if $x1>=0 +xb={$x1-$dxb} yb={$y1-$dyb} xe={$x1+$dxf} ye={$y1+$dyf} +rectangle. $xb,$yb,$xe,$ye,0.2,0,255,255 +rectangle. $xb,$yb,$xe,$ye,1,0xFFFFFFFF,0,255,255 +fi +if $x2>=0 +xb={$x2-$dxb} yb={$y2-$dyb} xe={$x2+$dxf} ye={$y2+$dyf} +rectangle. $xb,$yb,$xe,$ye,0.2,255,32,255 +rectangle. $xb,$yb,$xe,$ye,1,0xFFFFFFFF,255,32,255 +fi +if $x3>=0 +xb={$x3-$dxb} yb={$y3-$dyb} xe={$x3+$dxf} ye={$y3+$dyf} +rectangle. $xb,$yb,$xe,$ye,0.2,255,255,0 +rectangle. $xb,$yb,$xe,$ye,1,0xFFFFFFFF,255,255,0 +fi +w. {-2,w},{-2,h} rm. oxm=$xm oym=$ym +fi +if $x1>=0" && "($ox1!=$x1" || "$oy1!=$y1" || "$oc1!=$c1) ++z.. {$x1-$dxb},{$y1-$dyb},0,$c1,{$x1+$dxf},{$y1+$dyf},0,$c1 ++z.. {$x1-$dxb},{$y1-$dyb},0,{$x1+$dxf},{$y1+$dyf},0 +__display_array[-2,-1] $1,$2,0,255,255 +w1. {w},{h},0,0,{-3,b}" - ("$x1,$y1,c=$c1")" +rm. ox1=$x1 oy1=$y1 oc1=$c1 +fi +if $x2>=0" && "($ox2!=$x2" || "$oy2!=$y2" || "$oc2!=$c2) ++z.. {$x2-$dxb},{$y2-$dyb},0,$c2,{$x2+$dxf},{$y2+$dyf},0,$c2 ++z.. {$x2-$dxb},{$y2-$dyb},0,{$x2+$dxf},{$y2+$dyf},0 +__display_array[-2,-1] $1,$2,255,32,255 +w2. {w},{h},0,0,{-3,b}" - ("$x2,$y2,c=$c2")" +rm. ox2=$x2 oy2=$y2 oc2=$c2 +fi +if $x3>=0" && "($ox3!=$x3" || "$oy3!=$y3" || "$oc3!=$c3) ++z.. {$x3-$dxb},{$y3-$dyb},0,$c3,{$x3+$dxf},{$y3+$dyf},0,$c3 ++z.. {$x3-$dxb},{$y3-$dyb},0,{$x3+$dxf},{$y3+$dyf},0 +__display_array[-2,-1] $1,$2,255,255,0 +w3. {w},{h},0,0,{-3,b}" - ("$x3,$y3,c=$c3")" +rm. ox3=$x3 oy3=$y3 oc3=$c3 +fi +while {*}" && "!{*,ESC}" && "!{*,Q}" && "!{*1,ESC}" && "!{*1,Q}" && "!{*2,ESC}" && "!{*2,Q}" && "!{*3,ESC}" && "!{*3,Q} +k[0] w 0 w1 0 w2 0 w3 0 +} +__display_array : +round.. 1 c.. 0,999 r. 100%,100%,1,3,{s==1} ++luminance. r.. {$1*24},{$2*24} grid.. {100/$1}%,{100/$2}%,0,0,1,0 +xb={24*int($1/2)} yb={24*int($2/2)} xe={$xb+24} ye={$yb+24} +rectangle.. $xb,$yb,$xe,$ye,1,0xFFFFFFFF,$3,$4,$5 +repeat $2 { yg=$> +repeat $1 { xg=$> +t.. {-3,i($xg,$yg)},{5+$xg*24},{5+$yg*24},13,0.8,{i($xg,$yg)>128?0:255} +} +} +rm[-3,-1] +#@cli dc : eq. to 'display_camera'. +dc : check_opencv $0 +v + _display_camera +#@cli display_camera +#@cli : Open camera viewer. +#@cli : This command requires features from the OpenCV library (not enabled in G'MIC by default). +display_camera : check_opencv $0 +v + _$0 +_display_camera : +e[0--3] "Open camera stream viewer." +l[] { +camera +onfail +use_vt100 +e[0--4] ${_vt100_r}${_vt100_b}"Command 'display_camera': Unable to read camera stream. Exiting."$_vt100_n +return +} +wc,hc={[w,h]} +w ${"fitscreen "$wc,$hc},0,"G'MIC Camera Stream Viewer" +wnfs,hnfs={*,w,h} +angle,fullscreen,brightness,contrast=0 +do +ww,wh={*,w,h} +camera +if $angle rotate. {90*$angle} fi +if $brightness +. {10*$brightness} c. 0,255 fi +if $contrast /. 255 *. {1.2^$contrast} *. 255 c. 0,255 fi +rr2d. $ww,$wh,2,1 w. +rm +wait 30 +if {*,r} w[] {*,d,e} +elif {*,-R}" || "{*,-SPACE} angle={($angle+1)%4} +elif {*,-ARROWUP} brightness={min(5,$brightness+1)} +elif {*,-ARROWDOWN} brightness={max(-5,$brightness-1)} +elif {*,-ARROWRIGHT} contrast={min(5,$contrast+1)} +elif {*,-ARROWLEFT} contrast={max(-5,$contrast-1)} +elif {*,-F}" || "{*,-ENTER}" || "{*,-F5} +fullscreen={1-$fullscreen} +if $fullscreen +wwnfs,whnfs={*,w,h} +w[] {*,u,v},0,1 +else +w[] $wwnfs,$whnfs,0,0 +fi +fi +while {*}" && "!{*,ESC} +camera 0,0 w[] 0 +#@cli dclut : eq. to 'display_clut'. +dclut : check "isint(${1=256}) && $1>0 && isint(${2=33}) && $2>0" +v + _display_clut $* +#@cli display_clut : _image_resolution>0,_clut_resolution>0 +#@cli : Display selected 3D color LUTs. +#@cli : Default values: 'image_resolution=320' and 'clut_resolution=33'. +#@cli : $ clut tealorange clut summer clut 60s display_clut 400 +display_clut : +v + _$0 $* +_display_clut : check "isint(${1=320}) && $1>0 && isint(${2=33}) && $2>0" +e[0--3] "Display selected 3D color LUTs, with image resolution $1x$1 and CLUT resolution $2x$2x$2." +foreach { nm={n} +r3dx $2 pointcloud3d circles3d 1 o3d 0.1 *3d {255/($2-1)} colorcube3d 1 +3d +pose3d 0.815360904,-0.144610703,-0.560602367,0,-0.149177685,0.883129835,-0.444778264,0,0.559404552,0.446283728,0.698496521,0 +c3d n3d *3d. {2.10*$1} +{2*$1},{2*$1},1,3,-1 j3d. ..,47%,46%,0,1,2,0,0,{4*$1} rm.. +to_rgba replace_color 0,0.5%,-1,-1,-1,255,96,96,96,0 r2dx $1 +=> $nm +} +#@cli dfft : eq. to 'display_fft'. +dfft : +v + _display_fft +#@cli display_fft +#@cli : Display fourier transform of selected images, with centered log-module and argument. +#@cli : (eq. to 'dfft'). +#@cli : $ image.jpg +display_fft +display_fft : +v + _$0 +_display_fft : +e[0--3] "Render fourier transform of image$? with centered log-module and argument." +foreach { fftpolar +.. 1 log.. n 0,255 a x } s x,2 +#@cli dg : eq. to 'display_graph'. +dg : check "${1=0}>=0 && ${2=0}>=0" skip ${3=1},${4=0},${5=0},${6=0},${7=0},${8=0},"${9=x-axis}","${10=y-axis}" +_display_graph ${1-8},"$9","$10" +#@cli display_graph : _width>=0,_height>=0,_plot_type,_vertex_type,_xmin,_xmax,_ymin,_ymax,_xlabel,_ylabel +#@cli : Render graph plot from selected image data. +#@cli : 'plot_type' can be { 0=none | 1=lines | 2=splines | 3=bar }. +#@cli : 'vertex_type' can be { 0=none | 1=points | 2,3=crosses | 4,5=circles | 6,7=squares }. +#@cli : 'xmin','xmax','ymin','ymax' set the coordinates of the displayed xy-axes. +#@cli : if specified 'width' or 'height' is '0', then image size is set to half the screen size. +#@cli : Default values: 'width=0', 'height=0', 'plot_type=1', 'vertex_type=1', 'xmin=xmax=ymin=ymax=0 (auto)', 'xlabel="x-axis"' and 'ylabel="y-axis"'. +#@cli : $ 128,1,1,1,'cos(x/10+u)' +display_graph 400,300,3 +display_graph : check "${1=0}>=0 && ${2=0}>=0" +skip ${3=1},${4=0},${5=0},${6=0},${7=0},${8=0},"${9=x-axis}","${10=y-axis}" +_display_graph ${1-8},"$9","$10" +_display_graph : check "${1=0}>=0 && ${2=0}>=0" +skip ${3=1},${4=0},${5=0},${6=0},${7=0},${8=0},"${9=x-axis}","${10=y-axis}" +e[0--3] "Render $1x$2 graph plot from data of image$?." +foreach { +nm={n} +if $1>0" && "$2>0 w,h=$1,$2 else w,h={{*,u}/2},{{*,v}/2} fi +w,h={[max($w,33),max($h,33)]} +one={$3!=3} siz={w*h*d} +if $5==$6 xmin=0 xmax={$siz-$one} else xmin={min($5,$6)} xmax={max($5,$6)} fi +if $7==$8 ymin={im-(iM-im)/20} ymax={iM+(iM-im)/20} else ymin={min($7,$8)} ymax={max($7,$8)} fi +dx={$xmax-$xmin} dy={$ymax-$ymin} +u=${"_axes[] "$xmin,$xmax",{0.3*"$w"/14}"} offx={arg(1,$u)} deltax={arg(2,$u)} +u=${"_axes[] "$ymin,$ymax",{0.3*"$h"/14}"} offy={arg(1,$u)} deltay={arg(2,$u)} +gw={$w-32} gh={$h-32} gg={($gw-$one)/($siz-$one)} +$gw,$gh,1,3,255 +grid. {$deltax*$gw/$dx},{$deltay*$gh/$dy},{($offx-$xmin)*$gw/$dx},{$gh-($offy-$ymin)*$gh/$dy},0.25,0xCCCCCCCC,0 +if s#-2==1 (120,120,200) +elif s#-2<=3 (220,10,10;10,220,10;10,10,220) +else +(0,255) r. 256,1,1,1,3 map. 2 z. 2,100% permute. cxyz r. 3,{-3,max(3,s)},1,1,0,2 +sh. 0,2,0,0 f. 255,0,0,0,255,0,0,0,255 rm. +fi +repeat s#-3 { sh... $> graph... .,$3,$4,$ymax,$ymin,1,{-2,@0-2} rm. shift. 0,-1 } +rm[-3,-1] +line. 0,0,100%,0,1,110 line. 100%,0,100%,100%,1,110 +line. 100%,100%,0,100%,1,255 line. 0,100%,0,0,1,255 +100%,100%,1,1,255 +axes. $xmin,$xmax,$ymax,$ymin,14,1,0 +if $xmin>0 axes. 0,0,$ymax,$ymin,14,1,160 fi +if $xmax<0 axes. {w-1},{w-1},$ymax,$ymin,14,1,160 fi +if $ymin>0 axes. $xmin,$xmax,{h-1},{h-1},14,1,160 fi +if $ymax<0 axes. $xmin,$xmax,0,0,14,1,160 fi ++erode. 3 !=. 255 r.. 100%,100%,1,3 j... ..,0,0,0,0,1,.,1 rm[-2,-1] +frame. 16,16,220 +0 t. "$9",0,0,14,1,-220,-220,-220 j.. .,{({-2,w}-w)/2},{{-2,h}-16},0,0,-1 rm. +0 t. "$10",0,0,14,1,-220,-220,-220 rotate. -90 j.. .,2,{({-2,h}-h)/2},0,0,-1 rm. +=> $nm +} +c 0,255 +#@cli dh : eq. to 'display_histogram'. +dh : +_gmic_s="$?" v + _display_histogram $"*" +#@cli display_histogram : _width>=0,_height>=0,_clusters>0,_min_value[%],_max_value[%],_show_axes={ 0 | 1 },_expression. +#@cli : Render a channel-by-channel histogram. +#@cli : If selected images have several slices, the rendering is performed for all input slices. +#@cli : 'expression' is a mathematical expression used to transform the histogram data for visualization purpose. +#@cli : (eq. to 'dh'). +#@cli : if specified 'width' or 'height' is '0', then image size is set to half the screen size. +#@cli : Default values: 'width=0', 'height=0', 'clusters=256', 'min_value=0%', 'max_value=100%', 'show_axes=1' and 'expression=i'. +#@cli : $ image.jpg +display_histogram 512,300 +display_histogram : +_gmic_s="$?" v + _$0 $"*" +_display_histogram : check "${1=0}>=0 && ${2=0}>=0 && ${3=256}>0" skip ${4=0%},${5=100%},${6=1},"${7=i}" +e[0--3] "Render $1x$2 channel-by-channel histogram of image"$_gmic_s", with $3 clusters, minimum value $4 +and maximum value $5." +foreach { +nm={n} +if ${is_percent\ $4} m={im+(iM-im)*$4} else m=$4 fi +if ${is_percent\ $5} M={im+(iM-im)*$5} else M=$5 fi +s={s} s c +repeat $s { l[{-1-$>}] { s z histogram $3,$m,$M a z } } +a c f '"${7--1}"' vM={iM} s z +foreach { +if $1>0" && "$2>0 wh=$1,$2 else wh={{*,u}/2},{{*,v}/2} fi +$wh,1,{s},-255 +repeat s { sh[-2,-1] $> graph. ..,3,0,$vM,0,1,0 rm[-2,-1] } +rm.. + 255 +if $6 +100%,100% +axes. $m,$M,$vM,0,14,1,255 +if $m>0 axes. 0,0,$vM,0,14,1,200 fi +if $M<0 axes. {w-1},{w-1},$vM,0,14,1,200 fi ++dilate. 3 ri.. ... j... ..,0,0,0,0,1,.,255 rm[-2,-1] +fi +} +a z => $nm +} +#@cli display_parametric : _width>0,_height>0,_outline_opacity,_vertex_radius>=0,_is_antialiased={ 0 | 1 },_is_decorated={ 0 | 1 },_xlabel,_ylabel +#@cli : Render 2D or 3D parametric curve or point clouds from selected image data. +#@cli : Curve points are defined as pixels of a 2 or 3-channel image. +#@cli : If the point image contains more than 3 channels, additional channels define the (R,G,B) color for each vertex. +#@cli : If 'outline_opacity>1', the outline is colored according to the specified vertex colors and +#@cli : 'outline_opacity-1' is used as the actual drawing opacity. +#@cli : Default values: 'width=512', 'height=width', 'outline_opacity=3', 'vertex_radius=0', 'is_antialiased=1','is_decorated=1', 'xlabel="x-axis"' and 'ylabel="y-axis"'. +#@cli : $ 1024,1,1,2,'t=x/40;if(c==0,sin(t),cos(t))*(exp(cos(t))-2*cos(4*t)-sin(t/12)^5)' display_parametric 512,512 +#@cli : $ 1000,1,1,2,u(-100,100) quantize 4,1 noise 12 channels 0,2 +normalize 0,255 append c display_parametric 512,512,0.1,8 +display_parametric : check "${1=512}>0 && ${2=$1}>0 && ${4=0}>=0" skip ${3=3},${5=1},${6=1},"${7=x-axis}","${8=y-axis}" +s0="no " s1="" o0="" o1="colored " +e[^-1] "Render $1x$2 parametric graph plot from data of image$?, with "${o{$3>1}}"outline opacity "{$3>1?$3-1:$3}", vertex radius $4, "${s{$5!=0}}"antialiasing and "${s{$6!=0}}"decoration." +foreach { +nm={n} N={w*h*d} +i[0] ('CImg3d') +[0] 0.5 i[1] ($N;$N) +if s==4 +channels. 3,3 r. 100%,100%,1,2 a[-2,-1] c is_grayscale=1 +else is_grayscale={s<4} channels. 0,5 +fi +sh. 0 xm={im} xM={iM} rm. +sh. 1 ym={im} yM={iM} rm. +sh. 2 zm={im} zM={iM} rm. +permute. cxyz s. x,2 +i.. (1,0;1,{$N-1}) r.. 2,$N,1,1,3 round.. 1,$N,1,1,1 +y a y c3d n3d *3d 1,-1,1 +{if($6,max(1,$1-32),$1)},{if($6,max(1,$2-32),$2)},1,{if($is_grayscale,1,3)},255 +*3d[0] {0.96*min(w,h)} +if $6 L={0.1*max($1,$2)} grid[1] $L,$L,0,0,0.25,0xCCCCCCCC,0 fi +if $5 +r[1] 200%,200%,1,100%,1 *3d[0] 2 +if $4 +circles3d[0] {2*$4} j3d[1] [2],50%,50%,0,1,3,0,0 rm[2] fi +elif $4 ++circles3d[0] $4 j3d[1] [2],50%,50%,0,1,3,0,0 rm[2] +fi +if $3 l[0] { +s3d f[1] 'i-y' rm[3] i[3] (2,0,1;2,{$N-2},{$N-1}) r[3] 3,{$N-1},1,1,3 round[3] +r[5] 1,{h-1},1,1,0 +if $3>1 r[4] 3,{4,h/3},1,1,-1 r[4] 3,{4,h-1},1,1,2 else rm[4] i[4] 3,{$N-1} fi +y a y +} j3d[1] [0],50%,50%,0,{if($3>1,$3-1,$3)},2,0,0 fi +rm[0] +if $5 r. 50%,50%,1,100%,2 fi +if $6 +xc={0.5*($xm+$xM)} yc={0.5*($ym+$yM)} dx={0.5*($xM-$xm)/0.96} dy={0.5*($yM-$ym)/0.96} +xm={$xc-$dx} xM={$xc+$dx} ym={$yc-$dy} yM={$yc+$dy} +100%,100%,1,1,255 axes. $xm,$xM,$yM,$ym,14,1,0 +if $xm>0 axes. 0,0,$yM,$ym,14,1,160 fi +if $xM<0 axes. {w-1},{w-1},$yM,$ym,14,1,160 fi +if $ym>0 axes. $xm,$xM,{h-1},{h-1},14,1,160 fi +if $yM<0 axes. $xm,$xM,0,0,14,1,160 fi ++erode. 3 !=. 255 r.. 100%,100%,1,3 j... ..,0,0,0,0,1,.,1 rm[-2,-1] +frame 1,1,128 frame 15,15,220 +0 t. "$7",0,0,14,1,-220,-220,-220 j.. .,{({-2,w}-w)/2},{{-2,h}-16},0,0,-1 rm. +0 t. "$8",0,0,14,1,-220,-220,-220 rotate. -90 j.. .,2,{({-2,h}-h)/2},0,0,-1 rm. +fi +=> $nm +} +#@cli display_polar : _width>32,_height>32,_outline_type,_fill_R,_fill_G,_fill_B,_theta_start,_theta_end,_xlabel,_ylabel +#@cli : Render polar curve from selected image data. +#@cli : 'outline_type' can be { r<0=dots with radius -r | 0=no outline | r>0=lines+dots with radius r }. +#@cli : 'fill_color' can be { -1=no fill | R,G,B=fill with specified color }. +#@cli : Default values: 'width=500', 'height=width', 'outline_type=1', 'fill_R=fill_G=fill_B=200', 'theta_start=0', 'theta_end=360', 'xlabel="x-axis"' and 'ylabel="y-axis"'. +#@cli : $ 300,1,1,1,'0.3+abs(cos(10*pi*x/w))+u(0.4)' display_polar 512,512,4,200,255,200 +#@cli : $ 3000,1,1,1,'x^3/1e10' display_polar 400,400,1,-1,,,0,{15*360} +display_polar : check "${1=500}>32 && ${2=$1}>32" +skip ${3=1},${4=200},${5=$4},${6=$5},${7=0},${8=360},"${9=x-axis}","${10=y-axis}" +e[^-1] "Render $1x$2 polar graph plot from data of image"$_gmic_s", with outline $4 and fill color ($4,$5,$6)." +foreach { +nm={n} +M:=max(abs(iM),abs(im)) +* {0.48*min($1,$2)/$M} +y ({$7*pi/180};{-$8*pi/180}) r. 1,..,1,1,3 ++sin. cos.. *. ... *[-3,-2] +a[-2,-1] x N:=h +=> coords +if $3 +('CImg3d') +. 0.5 ($N,$N) ++z[coords] 0,2 +1,$N,1,1,2 1,$N,1,1,'y' ++. 1 a[-3--1] x =. 0,2,100% +3,$N,1,1,0 1,$N,1,1,1 y[-6--1] a[-6--1] y +=> _plot_polar_outline +fi +if "$4>=0 && $5>=0 && $6>=0" +('CImg3d') +. 0.5 ({$N+1},$N) ++z[coords] 0,-1,2,100% z. 0,2 +1,$N,1,1,3 1,$N 1,$N,1,1,'1+y' ++. 1 a[-4--1] x =. 1,3,100% +3,$N,1,1,$4,$5,$6 1,$N,1,1,1 +y[-6--1] a[-6--1] y +=> _plot_polar_fill +fi +rm[coords] +{$1-32},{$2-32},1,3,255 +L:=0.1*max($1,$2) grid. $L,$L,0,0,0.25,0xCCCCCCCC,0 +if "$4>=0 && $5>=0 && $6>=0" +j3d. [_plot_polar_fill],50%,50%,0,1,2,1,0 +rm[_plot_polar_fill] +fi +if $3 +if $3>=0 +j3d. [_plot_polar_outline],50%,50%,0,1,1,0,0 +fi +if $3!=0 +if abs($3)>1 circles3d[_plot_polar_outline] {abs($3)} fi +j3d. [_plot_polar_outline],50%,50%,0,0.2,2,0,0 +fi +rm[_plot_polar_outline] +fi +nM:=$M/0.96 +100%,100%,1,1,255 axes. {-$nM},$nM,$nM,{-$nM},14,1,0 ++erode. 3 !=. 255 r.. 100%,100%,1,3 j... ..,0,0,0,0,1,.,1 rm[-2,-1] +frame. 1,1,128 frame. 15,15,220 +0 t. "$9",0,0,13,1,-220,-220,-220 j.. .,{({-2,w}-w)/2},{{-2,h}-16},0,0,-1 rm. +0 t. "$10",0,0,13,1,-220,-220,-220 rotate. -90 j.. .,2,{({-2,h}-h)/2},0,0,-1 rm. => $nm +} +#@cli dq : eq. to 'display_quiver'. +dq : +_gmic_s="$?" v + _display_quiver $* +#@cli display_quiver : _size_factor>0,_arrow_size>=0,_color_mode={ 0=monochrome | 1=grayscale | 2=color } +#@cli : Render selected images of 2D vectors as a field of 2D arrows. +#@cli : (eq. to 'dq'). +#@cli : Default values: 'size_factor=16', 'arrow_size=1.5' and 'color_mode=1'. +#@cli : $ image.jpg +luminance gradient[-1] xy rv[-2,-1] *[-2] -1 a[-2,-1] c crop 60,10,90,30 +display_quiver[1] , +display_quiver : +_gmic_s="$?" v + _$0 $* +_display_quiver : check "${1=16}>0 && ${2=1.5}>=0 && isint(${3=2}) && $3>=0 && $3<=2" +e[0--3] "Render field of 2D arrows from image"$_gmic_s", with size factor $1, arrow size $2 in "${arg0\ $3,monochrome,grayscale,color}" mode." +foreach { ++norm. /.. {max(1e-6,iM)} rm. +{$1*w},{$1*h},1,{"1<[0] {1,n} +sh. {s-1} j[0] [1],0,0,0,0,1,[2],255 k[0] +fi +} +to_rgb u $is_rgb +#@cli dt : eq. to 'display_tensors'. +dt : +_gmic_s="$?" v + _display_tensors $* +#@cli display_tensors : _size_factor>0,_ellipse_size>=0,_color_mode={ 0=monochrome | 1=grayscale | 2=color },_outline>=0 +#@cli : Render selected images of tensors as a field of 2D ellipses. +#@cli : (eq. to 'dt'). +#@cli : Default values: 'size_factor=16', 'ellipse_size=1.5', 'color_mode=2' and 'outline=2'. +#@cli : $ image.jpg +diffusiontensors 0.1,0.9 resize2dx. 64 +display_tensors. 16,2 +#@cli : $$ https://gmic.eu/oldtutorial/_display_tensors +display_tensors : +_gmic_s="$?" v + _$0 $* +_display_tensors : check "${1=16}>0 && ${2=1.5}>=0 && isint(${3=2}) && $3>=0 && $3<=2 && ${4=2}>=0" +e[0--3] "Render field of 2x2 tensors from image"$_gmic_s", with size factor $1, ellipse size $2 in "${arg0\ $3,monochrome,grayscale,color}" mode and outline $4." +foreach { +* {($2*$1/2)/max(abs(im),abs(iM))} +{$1*w},{$1*h},1,{"1<=0, --k, ellipse(#1,X,r1 + k*$4,r2 + k*$4,ang°,1,arg(k + 1,C,Co))); +I" +rm.. +} +#@cli dv3d : eq. to 'display_voxels3d'. +dv3d : +_gmic_s="$?" v + _display_voxels3d +#@cli display_voxels3d +#@cli : Display selected images as set of 3D voxels. +#@cli : (eq. to 'dv3d'). +display_voxels3d : +_gmic_s="$?" v + _$0 +_display_voxels3d : +mode3d,moded3d,double3d=$_mode3d,$_moded3d,$_double3d +m3d 2 md3d 2 db3d 0 ++foreach { +w,h,d:=w,h,d +nm={n} bnm={b} l. { if ['{x}']!=0 bnm.=.{x} fi onfail bnm.=.{x} } +asiz:=max(w,h,d)/5 ++norm1. !=. 0 nbv:=is rm. +e[0--4] "Display image ["{arg(1+$>,$[])}"] = '"$nm"' ("${w}x${h}x${d}", "$nbv" voxels)." +args=0.5,1,0.75 +if s==1 +im,iM:=im,iM +eval. "*begin(is_bin = 1); i!=$im && i!=$iM?(is_bin = 0; break()); end(merge(is_bin,&&); set('is_bin',is_bin))" +if $is_bin +>. {lerp($im,$iM,0.5)} +expand_xyz. 1 b. {min(w,h,d)*2%},0 g. xyz a[-3--1] c orientation. n. 0,220 +shrink_xyz. 1 *. .. k. args=0.9,1.1,1 +fi +fi +surfels3d $args +3d. 0.5,0.5,0.5 box3d $w,$h,$d p3d. 1 o3d. 0.25 +axes3d $asiz,$asiz,$asiz,16 o3d. 0.5 col3d. 255,128,0 +3d +_d3d_title=$bnm" ("${w}x${h}x${d}", "$nbv" voxels)" +d3d 0 +rm _d3d_title= +} +_mode3d,_moded3d,_double3d=$mode3d,$moded3d,$double3d +is_change 0 +#@cli dw : eq. to 'display_warp'. +dw : +_gmic_s="$?" v + _display_warp $* +#@cli display_warp : _cell_size>0 +#@cli : Render selected 2D warping fields. +#@cli : (eq. to 'dw'). +#@cli : Default value: 'cell_size=15'. +#@cli : $ 400,400,1,2,'x=x-w/2;y=y-h/2;r=sqrt(x*x+y*y);a=atan2(y,x);5*sin(r/10)*[cos(a),sin(a)]' +display_warp 10 +display_warp : +_gmic_s="$?" v + _$0 $* +_display_warp : check "${1=15}>0" +e[0--3] "Render 2D warping field"$_gmic_s", with cell size $1." +foreach { +if d!=1" || "s!=2 +error[0--3] "Command 'display_warp': Invalid image ["{$!-$>-1}"]: Dimensions "{w}","{h}","{d}","{s}" +does not represent a 2D field of 2D vectors." +fi +i[0] 100%,100%,1,1,1 grid[0] $1,$1 =>[0] {1,n} +warp[0] [1],1,1,0 rm[1] +} * 255 +#@cli e : eq. to 'echo'. : (+) +#@cli echo : message : (+) +#@cli : Output specified message on the error output. +#@cli : (eq. to 'e').\n +#@cli : Command selection (if any) stands for displayed call stack subset instead of image indices. +#@cli : When invoked with a '+' prefix (i.e. '+echo'), the command output its message on stdout rather than stderr. +#@cli echo_file : filename,message +#@cli : Output specified message, appending it to specified output file. +#@cli : (similar to 'echo' for specified output file stream). +echo_file : skip "${2='\n'}" +l[] { it "$1" onfail 0 } +('"${2--1}\n"':y) a[-2,-1] y ot. $1 rm. +#@cli function1d : 0<=smoothness<=1,x0>=0,y0,x1>=0,y1,...,xn>=0,yn +#@cli : Insert continuous 1D function from specified list of keypoints (xk,yk) +#@cli : in range [0,max(xk)] (xk are positive integers). +#@cli : $ function1d 1,0,0,10,30,40,20,70,30,80,0 +display_graph 400,300 ++function1d : +e[^-1] "Input continuous 1D function, with smoothness $1 and keypoints (${2--1})." +l[] { +smoothness:=max(0,min(1,$1)) +(${2--1}) r 2,{int(w/2)},1,1,-1 +sort +,y s x size={0,iM>=0?1+int(iM):0} +if !$size rm 0 break fi +a x ++f '(j(0,1,0,0,0,1)-j(0,-1,0,0,0,1))/2' s. x max.. 0.01 /. .. rm.. a x +$size,1,1,1,-1 +repeat h#0-1 { +x0={0,i(0,$>)} y0={0,i(1,$>)} x1={0,i(0,$>+1)} y1={0,i(1,$>+1)} +slope:=($y1-$y0)/max(0.01,$x1-$x0) +yp0={0,i(2,$>)*$smoothness+(1-$smoothness)*$slope} +yp1={0,i(2,$>+1)*$smoothness+(1-$smoothness)*$slope} +i:=round($x0,1,1) +j:=round($x1,1,0) +line[1] $i,0,$j,0,1,$> +if $j-$i<=1 +({$y0-$x0*$slope}^{$slope}^0^0) +else +(1,$x0,{($x0)^2},{($x0)^3};1,$x1,{($x1)^2},{($x1)^3};0,1,{2*$x0},{3*($x0)^2};0,1,{2*$x1},{3*($x1)^2}) +($y0;$y1;$yp0;$yp1) +invert.. 1 mmul[-2,-1] y. c +fi +} +a[2--1] x map.. . rm. +100%,1,1,1,1 +(0,{w-1}) r. {-2,w},1,1,1,3 round. ++sqr. +*[-2,-1] a[-4--1] c *[-2,-1] s. c +[-4--1] rm.. +} +#@cli identity : _width>=0,_height>=0,_depth>=0 +#@cli : Insert an identity map of given size at the end of the image list. +#@cli : Default values: 'height=width' and 'depth=1'. +#@cli : $ identity 5,1 identity 8,8 ++identity : check "isint($1) && $1>=0 && isint(${2=$1}) && $2>=0 && isint(${3=1}) && $3>=0" +e[^-1] "Input $1x$2x$3 identity map." +if $3>1 $1,$2,$3,3,[x,y,z] +elif $2>1 $1,$2,1,2,[x,y] +elif $1>0 $1,1,1,1,x +else 0 +fi +#@cli i : eq. to 'input'. : (+) +#@cli input : [type:]filename : [type:]http://URL : [selection]x_nb_copies>0 : { width>0[%] | [image_w] },{ _height>0[%] | [image_h] },{ _depth>0[%] | [image_d] },{ _spectrum>0[%] | [image_s] },_{ value1,_value2,... | 'formula' } : (value1{,|;|/|^}value2{,|;|/|^}...[:{x|y|z|c|,|;|/|^}]) : 0 : (+) +#@cli : Insert a new image taken from a filename or from a copy of an existing image [index], +#@cli : or insert new image with specified dimensions and values. Single quotes may be omitted in +#@cli : 'formula'. Specifying argument '0' inserts an 'empty' image. +#@cli : (eq. to 'i' | (no arg)). +#@cli : Default values: 'nb_copies=1', 'height=depth=spectrum=1' and 'value1=0'. +#@cli : $ input image.jpg +#@cli : $ input (1,2,3;4,5,6;7,8,9^9,8,7;6,5,4;3,2,1) +#@cli : $ image.jpg (1,2,3;4,5,6;7,8,9) (255^128^64) 400,400,1,3,'(x>w/2?x:y)*c' +#@cli : $$ +#@cli input_565 : filename,width>0,height>0,reverse_endianness={ 0 | 1 } +#@cli : Insert image data from a raw RGB-565 file, at the end of the list. +#@cli : Default value: 'reverse_endianness=0'. ++input_565 : check "isint($2) && $2>0 && isint($3) && $3>0 && isbool(${4=0})" +e[^-1] "Input raw RGB-565 file '"{/"$1"}"', with size $2x$3." +l[] { +raw:"$1",uint16 if $4 endian uint16 fi +r $2,$3,1,1,-1 +>> 5 &. 63 +&.. 31 >>... 11 *[-3,-1] 8 *.. 4 a c +} +#@cli ib : eq. to 'input_bytes'. ++ib : +v + _input_bytes "$*" +#@cli input_bytes : filename +#@cli : Input specified filename as a 1D array of bytes. +#@cli : (eq. to 'ib'). ++input_bytes : +v + _$0 "$*" +_input_bytes : +e[0--3] "Input file '"{/"$*"}"' as a 1D array of bytes." +i raw:"$*",uint8 +#@cli input_csv : "filename",_read_data_as={ 0=numbers | 1=strings | _variable_name } +#@cli : Insert number of string array from specified .csv file. +#@cli : If 'variable_name' is provided, the string of each cell is stored in a numbered variable '_variable_name_x_y', where 'x' and 'y' are the indices of the cell column and row respectively (starting from '0'). +#@cli : Otherwise, a 'WxH' image is inserted at the end of the list, with each vector-valued pixel 'I(x,y)' encoding the number or the string of each cell. +#@cli : This command returns the 'W,H' dimension of the read array, as the status. +#@cli : Default value: 'read_data_as=1'. ++input_csv : check "isvarname('${2=1}') || isin($2,0,1,2)" +l[] { +is_var:="s=['$2'];s!='0'&&s!='1'" +if $is_var +e[0--4] "Input string array from file '"{/"$1"}"', in variable '$2'." +it "$1" replace {'" "'},255 s -,{'\n'} +W,H=0,$! +repeat $! { _input_csv_var[] $2,$>,${u\ {$>,t}} W:=max($W,${}) } +rm u $W,$H +else +s0,s1="number","string" +e[0--4] "Input "${s$2}" array from file '"{/"$1"}"'." +it "$1" s -,{'\n'} replace {'" "'},255 +if $2 repeat $! { _input_csv_str[] ${u\ {$>,t}} rv[$>,-1] rm. } a y replace 255,{'" "'} +else repeat $! { _input_csv_val[] ${u\ {$>,t}} rv[$>,-1] rm. } a y +fi +=> "$1" u {[w,h]} +fi +} +_input_csv_var : +$=arg +W:=$#-2 +repeat $W { +arg=${arg{3+$>}} +if ['$arg']!=0 ({'${arg{3+$>}}'}) replace. 255,{'" "'} $1_$>_$2={t} rm. else $1_$>_$2= fi +} +u $W +_input_csv_str : +$=arg +repeat $# { +arg=${arg{1+$>}} +if ['$arg']!=0 ({'$arg'}:c) else (0) fi +} +a x +_input_csv_val : +$=arg +repeat $# { +arg=${arg{1+$>}} +if ['$arg']!=0 ({s2v(['$arg'])}) else (nan) fi +} +a x +#@cli input_cube : "filename",_convert_1d_cluts_to_3d={ 0 | 1 }. +#@cli : Insert CLUT data from a .cube filename (Adobe CLUT file format). +#@cli : Default value: 'convert_1d_cluts_to_3d=1'. ++input_cube : skip ${2=1} +e[^-1] "Input CLUT from file '"{/"$1"}"'" +l[] { +it[] "$1" f "i<_' ' && i!=10?_' ':i" s -,10 +i[0] 0 +range:=" +ref(vector128(),line); +dmin = [ 0,0,0 ]; +dmax = [ 1,1,1 ]; +dim = size = 0; +target = 0; +for (k = 1, k1 && h==1 && d==1 && $2" size:=w s c y.. y. z r $size,$size,$size a c fi +=> "$1" +} +#@cli input_flo : "filename" +#@cli : Insert optical flow data from a .flo filename (vision.middlebury.edu file format). ++input_flo : +e[^-1] "Input optical flow from file '"{/"$1"}"'." +l[] { +i raw:"$1",float32 +if i!=202021.25 endian. fi +if i!=202021.25 error[0--3] "Command 'input_flo': Filename '$1' is not a valid .flo file." return fi ++rows 1,2 cast. float32,uint32 w,h={^} rm. +rows 3,100% r 2,$w,$h,1,-1 permute yzcx +} +#@cli ig : eq. to 'input_glob'. ++ig : +v + _input_glob "$*" +#@cli input_glob : pattern +#@cli : Insert new images from several filenames that match the specified glob pattern. +#@cli : (eq. to 'ig'). ++input_glob : +_input_glob "$*" +_input_glob : +e[0--3] "Input all files that match glob pattern '"{/"$*"}"'." +files 3,"$*" +N=$! +m "_ig : $""=arg repeat $""# { i ${arg{1+$>}} }" +_ig ${} um _ig +if $N==$! error[0--3] "Command 'input_glob': No matching filenames for pattern '$*'." fi +#@cli input_gpl : filename +#@cli : Input specified filename as a .gpl palette data file. ++input_gpl : +e[^-1] "Input palette from file '"{/"$*"}"'." +l[] { +it[] "$*" discard 13 replace 9,32 s -,10 +colors=0 +foreach { +l { +s -,32 +if $!>=3" && "isint({0,t})" && "isint({1,t})" && "isint({2,t}) colors=$colors;{0,t},{1,t},{2,t} fi +rm 0 +onfail rm 0 +} +} +rm ($colors) rows 1,100% => "$1" permute yzcx +} +#@cli input_cached : "basename.ext",_try_downloading_from_gmic_server={ 0 | 1 } +#@cli : Input specified filename, assumed to be stored in one of the G'MIC resource folder. +#@cli : If file not found and 'try_downloading=1', file is downloaded from the G'MIC server and stored +#@cli : in the '${-path_cache}' folder. +#@cli : Default value: 'try_downloading_from_gmic_server=1'. ++input_cached : check "isbool(${2=1})" +basename "$1" basename=${} +e[^-1] "Input cached file '"$basename"'." +if ['$GMIC_SYSTEM_PATH']!=0 g_path_unix=$GMIC_SYSTEM_PATH/ else g_path_unix=/usr/lib/gimp/2.0/plug-ins/ fi +path_test0=${-path_cache} +path_test1=$_path_rc +path_test2=${-path_gimp}plug-ins/ +path_test3=${-path_gimp}plug-ins/gmic_gimp_qt/ +if !${-is_windows} +path_test4=/usr/share/gmic/ +path_test5=$g_path_unix +else +path_test4=$g_path_unix +fi +file_found=0 +repeat inf { +if ['{/${path_test$>}}']==0 break fi +file=${path_test$>}$basename +l[] { i $file file_found=1 onfail } +if $file_found break fi +} +if !$file_found" && $2" +url=https://gmic.eu/"$1" +l[] { i $url o ${-path_cache}$basename file_found=1 is_change 1 onfail } +fi +if !$file_found +error[0--3] "Command 'input_cached': Unknown filename '"{/"$1"}"'." +fi +#@cli input_obj : filename +#@cli : Input specified 3D mesh from a .obj Wavefront file. ++input_obj : +e[^-1] "Input 3D mesh from file '"{/"$*"}"'" +l[] { +it "$1" f "i<=_' ' && i!=_'\n'?_' ':i" +0 => "$1" folder={f} rm. +1 +1 +1 +1 +1,1,1,2 +_input_obj_rgb,_input_obj_alpha= +eval " +next_item() = ( +while (line[q] && line[q]!=_' ' && line[q]!=_'/',++q); +while (line[q] && line[q]==_' ', ++q); +); +push_texture() = ( +s_ind_prim = string('ind_prim',p_img); +ind_prim = get(s_ind_prim); +isnan(ind_prim)?( +da_push(#3,-128,ui2f(p_whs[0]),p_whs[1],p_whs[2]); +dsiz = da_size(#3); isiz = prod(p_whs); +resize(#3,1,h(#3) + isiz,1,1,0); +copy(i[#3,dsiz],i[#p_img,0],isiz); +i[#3,h(#3) - 1] = ui2f(dsiz + isiz); +set(s_ind_prim,nbp); +):( +da_push(#3,-128,ui2f(ind_prim),0,0); +); +); +id_v = 'v '; id_f = 'f '; id_l = 'l '; id_p = 'p '; id_vt = 'vt '; +id_mtllib = 'mtllib '; id_usemtl = 'usemtl '; +line = vector1024(0); +p_rgb = [ 200,200,200 ]; p_alpha = 1; p_img = -1; p_whs = [ 0,0,0 ]; +line_number = 1; +nbv = nbp = p = 0; +while (p0?( +copy(line,line[q],len + 1); +run('_input_obj_parse_mtl \""{/$folder}"\",\"',line,'\"'); +); +):line[0,7]==id_usemtl?( +q = 0; next_item(); +len = find(line,0,q); +len>0?( +copy(line,line[q],len + 1); +run('_input_obj_set_mtl ',line); +p_rgb = get('_input_obj_rgb',3); +p_alpha = get('_input_obj_alpha'); +p_whs = get('_input_obj_whs',3); +p_img = get('_input_obj_img'); +); +); +p = ++np; +++line_number; +); +repeat(5,k,k1 = k + 1; resize(#k1,1,da_size(#k1),1,s#k1,0)); +set('nbp',nbp); +set('nbv',nbv)" +rm[0,5--1] i[0] ({'CImg3d'},{ui2f([$nbv,$nbp])}:y) a y => "$1" +} +_input_obj_parse_mtl : skip "${1=}" +img_ind=$! mtl_filename="$1$2" +if !isfile(['{/$mtl_filename}']) return fi +l[] +it $mtl_filename f "i<=_' ' && i!=_'\n'?_' ':i" +s -,{'\n'} autocrop {'" "'} N:=$!-1 +m=default _input_obj_rgb_$m=200,200,200 _input_obj_alpha_$m=1 _input_obj_whs_$m=0,0,0 +repeat $! { if {$>,i!=_'#'} +if "crop(#$>,0,0,1,7)=='newmtl '" # New material +rows[$>] 7,100% strcasevar {$>,t} m=${} +_input_obj_rgb_$m=200,200,200 _input_obj_alpha_$m=1 _input_obj_whs_$m=0,0,0 +elif "crop(#$>,0,0,1,3)=='Kd '" # Diffuse color +l[$>] { rows 3,100% s -,{'" "'} _input_obj_rgb_$m:="255*["{0,t},{1,t},{2,t}"]" k[0] } +elif "crop(#$>,0,0,1,2)=='d '" # Opacity +rows[$>] 2,100% _input_obj_alpha_$m:={$>,t} +elif "crop(#$>,0,0,1,7)=='map_Kd '" # Diffuse texture +rows[$>] 7,100% img_filename={$>,t} +l[] { +"$1"$img_filename +_input_obj_img_$m:=$img_ind img_ind+=1 +_input_obj_whs_$m:=[w,h,s] +y +onfail _input_obj_img_$m=-1 _input_obj_whs_$m=0,0,0 +} +fi +fi } +rm[0-$N] +} +_input_obj_set_mtl : +strcasevar "{/$1}" m=${} +if ['${_input_obj_img_$m}']!=0 _input_obj_img=${_input_obj_img_$m} _input_obj_whs=${_input_obj_whs_$m} +else _input_obj_img=-1 _input_obj_whs=0,0,0 +fi +if ['${_input_obj_rgb_$m}']!=0 _input_obj_rgb=${_input_obj_rgb_$m} +else _input_obj_rgb=200,200,200 +fi +if ['${_input_obj_alpha_$m}']!=0 _input_obj_alpha=${_input_obj_alpha_$m} +else _input_obj_alpha=1 +fi +#@cli it : eq. to 'input_text'. ++it : +v + _input_text "$*" +#@cli input_text : filename +#@cli : Input specified text-data filename as a new image. +#@cli : (eq. to 'it'). ++input_text : +v + _$0 "$*" +_input_text : +e[0--3] "Input text-data file '"{/"$*"}"'." +i raw:"$*",uint8 +if i[0]==239" && "i[1]==187" && "i[2]==191 rows. 3,100% fi +discard. {'\r'} +#@cli lorem : _width>0,_height>0 +#@cli : Input random image of specified size, retrieved from Internet. +#@cli : Default values: 'width=height=800'. ++lorem : check "isint(${1=800}) && $1>0 && isint(${2=$1}) && $2>0" +e[^-1] "Input random image of size $1x$2." +i jpg:"https://picsum.photos/$1/$2" => lorem +merge_multiline : +eval[^] "*i==_'\\' && j[-1]!=_'\\' && j[+1]==_'\n'?( +for (p = 2, j[p] && j[p]<=_' ' && j[p]!=_'\n', ++p); copy(i(),-1,p,1,0))" +discard -1 +merge_multiline_comments : +eval[^] "*i==_'\\' && j[-1]!=_'\\' && j[+1]==_'\n' && j[+2]==_'#'?( +for (p = 3, j[p] && j[p]<=_' ' && j[p]!=_'\n', ++p); copy(i(),-1,p,1,0))" +discard -1 +#@cli network : mode={ -1=disabled | 0=enabled w/o timeout | >0=enabled w/ specified timeout in seconds } : (+) +#@cli : Enable/disable load-from-network and set corresponding timeout. +#@cli : (Default mode is 'enabled w/o timeout'). +#@cli o : eq. to 'output'. : (+) +#@cli output : [type:]filename,_format_options : (+) +#@cli : Output selected images as one or several numbered file(s). +#@cli : (eq. to 'o'). +#@cli : Default value: 'format_options'=(undefined). +#@cli output_565 : "filename",reverse_endianness={ 0=false | 1=true } +#@cli : Output selected images as raw RGB-565 files. +#@cli : Default value: 'reverse_endianness=0'. +output_565 : check "isbool(${2=0})" +e[^-1] "Output image$? as raw RGB-565 file '"{/"$1"}"'." +N=$! +foreach { +s c c 0,255 /[-3,-1] 8 /.. 4 round +bsl... 11 bsl.. 5 + +if $N>1 fn=${"filename \"$1\",$>"} else fn="$1" fi +if $2 endian uint16 fi +o raw:$fn,uint16 rm +} +is_change 0 +#@cli output_cube : "filename" +#@cli : Output selected CLUTs as a .cube file (Adobe CLUT format). +output_cube : +e[^-1] "Output CLUT$? as file '"{/"$1"}"'." +N=$! +foreach { +to_rgb +l:=round((w*h*d)^(1/3)) +if w*h*d!=$l^3 error "Command '$0': CLUT '"{n}"' has invalid dimensions "({w},{h},{d},{s}). fi +r $l,$l,$l,3,-1 permute cxyz / 255 +if $N>1 fn=${"filename \"$1\",$>"} else fn="$1" fi +o dlm:$fn rm it[] $fn replace {','},32 +0 => $fn basename={b} rm. +header="\# Created by: G'MIC (https://gmic.eu)\n""TITLE \""$basename"\"\n\n""# LUT size\n""LUT_3D_SIZE "$l"\n\n""# Data domain\n""DOMAIN_MIN 0.0 0.0 0.0\n""DOMAIN_MAX 1.0 1.0 1.0\n\n""# LUT data points\n" +i[0] ('$header') +y a y ot $fn rm +} +is_change 0 +#@cli output_flo : "filename" +#@cli : Output selected optical flow as a .flo file (vision.middlebury.edu file format). +output_flo : +e[^-1] "Output optical flow$? as file '"{/"$1"}"'." +N=$! +foreach { +w,h:=[w,h] +channels 0,1 permute cxyz i[0] (202021.25) i[1] ($w,$h) cast[1] uint32,float32 y a y +if $N>1 fn=${"filename \"$1\",$>"} else fn="$1" fi +o raw:$fn,float32 rm +} +is_change 0 +#@cli output_ggr : filename,_gradient_name +#@cli : Output selected images as .ggr gradient files (GIMP). +#@cli : If no gradient name is specified, it is deduced from the filename. +output_ggr : skip "${2=}" +e[^-1] "Output image$? as .ggr gradient file '"{/"$1"}"'." +N=$! +foreach { +r 1,{w*h*d},1,100%,-1 to_rgba / 255 +if narg("$2") name="$2" +else l[] { 1 => "$1" ('{b}') f "if(x==0 && i>=_'a' && i<=_'z',i-_'a'+_'A',i)" name={t} rm } +fi +('"GIMP Gradient\nName: "$name\n{0,h}\n') +repeat h#0 { +start={_$>/{0,h}} +end={_($>+1)/{0,h}} +mid={_0.5*($start+$end)} +rgba={0,I(0,$>)} +r={arg(1,$rgba)} g={arg(2,$rgba)} b={arg(3,$rgba)} a={arg(4,$rgba)} +('$start" "$mid" "$end" "$r" "$g" "$b" "$a" "$r" "$g" "$b" "$a" 0 0\n"') +} +rm[0] a x +if $N>1 ot ${"filename \"$1\",$>"} else ot "$1" fi +rm +} +is_change 0 +#@cli output_gmz : filename,_datatype +#@cli : Output selected images as .gmz files (G'MIC native file format). +#@cli : 'datatype' can be { bool | uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }. +output_gmz : skip ${2=auto} +e[^-1] "Output image$? as gmz file '"{/"$1"}"', with pixel type '$2'." +1,64 +eval " +draw([_'G',_'M',_'Z'],0,0,1,3); +pos = 4; +repeat (l - 1,k, +ref(name(#k,1026),nam); +len = find(nam,0); +len>=0?( +pos + len>=h?resize(#-1,1,2*h + len,1,1,0); +len>0?draw(nam,0,pos,1,len); +pos+=1 + len; +); +); +resize(#-1,1,pos,1,1,0)" +o cimgz:$1,$2 +rm. +#@cli output_obj : filename,_save_materials={ 0=no | 1=yes } +#@cli : Output selected 3D meshes as Wavefront 3D object files. +#@cli : Set 'save_materials' to '1' to produce a corresponding material file (`.mtl`) and eventually texture files. +#@cli : Beware, the export to `.obj` files may be quite slow for large 3D objects. +#@cli : Default value: 'save_materials=1'. +output_obj : check "isbool(${2=1})" check3d +s0,s1=out, +e[^-1] "Output 3D object$? as Wavefront 3D object file '"{/"$1"}"' (with"${s$2}" materials)." +N=$! +foreach { +nm={n} nb_materials,nb_primitives,nb_textures,nb_tcoords=0 +if $N>1 filename=${"filename \"$1\",$>"} else filename="$1" fi +0 => $filename basename={b} folder={f} ext={x} if narg($ext) ext=.$ext fi rm. +fnobj="begin(out = 0; s_rgba = vector8()); +tos(x) = v2s(x,6); +strhex(v,str) = ( +ref(v,_v); +hex(x) = (_x = int(x); _x + (_x<10?_'0':_'A' - 10)); +fill(str,_k,hex(_k%2?_v[(_k-1)/2]%16:_v[_k/2]/16)); +); +write(ind,s) = ( +l_s = find(s,0); +l_s<=0?(l_s = size(s)); +out + l_s>h(#ind)?resize(#ind,1,2*h(#ind) + l_s,1,1,0); +copy(i[#ind,out],s,l_s); +out+=l_s)" +s3d nb_vertices,nbp={1,f2ui([i[0],i[1]])} rm[0,1] +e " > File '"$folder$basename$ext"' ("$nb_vertices" vertices, "$nbp" primitives)." +l[0] { +e " - Export vertices." +r 3,{h/3},1,1,-1 permute zycx +0 => out_obj +eval.. ">"$fnobj"; +!(y%10000)?run('e \"\r - Export vertices: ',round(100*y/h),' % \"'); +ref(string('v ',tos(i0),' ',tos(i1),' ',tos(i2),'\n'),str); +write(#"$out_obj",str); I; +end(resize(#"$out_obj",1,out,1,1,0))" +rm[0] i[0] ('"\n# Vertices.\n"':y) a y => out_obj +e "\r - Export vertices: Done." +} +if $2 l[2,3] { +e " - Export materials." +1,$nbp,1,3 => materials +0 => out_mtl +mv[0] $! +eval $fnobj"; +const nbp = "$nbp"; +off_p = off_o = nb_materials = nb_textures = 0; +rgba = vector4(); +s_opac = vector32(); +repeat (nbp,p, +!(p%10000)?run('e \"\r - Export materials: ',round(100*p/nbp),' % \"'); +s_opac[0] = 0; +opac = i[#0,off_o]; +i[off_p]!=-128?( +ref(cut(round(crop(0,off_p,1,4)),0,255),rgba); +rgba[3] = opac!=-128?round(255*cut(opac,0,1)):255; +strhex(rgba,s_rgba); +vname = string('mat_',s_rgba); +m = get(vname); +isnan(m)?( +++nb_materials; +opac!=-128 && opac<1?copy(s_opac,string('d ',tos(cut(opac,0,1)),'\n')); +ref(string('newmtl m',nb_materials,'\n', +'Kd ',tos(rgba[0]/255),' ',tos(rgba[1]/255),' ',tos(rgba[2]/255),'\n',s_opac),str); +write(#"$out_mtl",str); +set(vname,v2s(m = nb_materials)); +); +i[#"$materials",p] = m; +off_p+=3; +):i[off_p + 2]?( +++nb_materials; ++nb_textures; +wt = i[off_p + 1]; ht = i[off_p + 2]; st = i[off_p + 3]; +opac!=-128 && opac<1?copy(s_opac,string('d ',tos(cut(opac,0,1)),'\n')); +run('+rows. ',off_p + 4,',',off_p + 3 + wt*ht*st,' r. ',wt,',',ht,',1,',st,',-1 tfn=$folder${basename}_t', +nb_textures,'.png o. $tfn rm.'); +tfile = get('tfn',1024,1); +ref(string('newmtl m',nb_materials,'\n', +'map_Kd ',get('tfn',1024,1),'\n',s_opac),str); +write(#"$out_mtl",str); +I[#"$materials",p] = [ nb_materials,wt,ht ]; +off_p+=4 + wt*ht*st; +):( +tind = i[off_p + 1]; +I[#"$materials",p] = I[#"$materials",tind]; +off_p+=4; +); +off_o+=(opac==-128?4 + prod(crop(#0,0,off_o + 1,1,3)):1); +); +resize(#"$out_mtl",1,out,1,1,0); +run('nb_materials,nb_textures=',nb_materials,',',nb_textures)" +e "\r - Export materials: Done." +k[materials,out_mtl] +} fi +e " - Export primitives." +0 => out_prim +mv[1] $! +eval $fnobj"; +const materials = 0"$materials"; +const nbp = "$nbp"; +off = p_material = material = nb_primitives = nb_tcoords = 0; +repeat (nbp,p, +!(p%10000)?run('e \"\r - Export primitives: ',round(100*p/nbp),' % \"'); +type = i[off]; +$2?material = i[#materials,p]; +material!=p_material?ref(string('usemtl m',material,'\n'),str_mtl); +type==1?( +ref(string('p ',f2ui(i[off + 1] + 1),'\n'),str); +write(#"$out_prim",str); +++nb_primitives; +):type==2 || type==6?( +ref(string('l ',f2ui(i[off + 1]) + 1,' ',f2ui(i[off + 2]) + 1,'\n'),str); +write(#"$out_prim",str); +++nb_primitives; +):type==3 || (type==9 && !$2)?( +$2 && material!=p_material?write(#"$out_prim",str_mtl); +ref(string('f ',f2ui(i[off + 1]) + 1,' ',f2ui(i[off + 2]) + 1,' ',f2ui(i[off + 3]) + 1,'\n'),str); +write(#"$out_prim",str); +++nb_primitives; +):type==4 || (type==12 && !$2)?( +$2 && material!=p_material?write(#"$out_prim",str_mtl); +ref(string('f ',f2ui(i[off + 1]) + 1,' ',f2ui(i[off + 2]) + 1,' ', +f2ui(i[off + 3]) + 1,' ',f2ui(i[off + 4]) + 1,'\n'),str); +write(#"$out_prim",str); +++nb_primitives; +):type==9?( +material!=p_material?write(#"$out_prim",str_mtl); +wt = i(#materials,0,p,0,1); ht = i(#materials,0,p,0,2); +ref(string('vt ',tos(i[off + 4]/wt),' ',tos(1 - i[off + 5]/ht),'\n', +'vt ',tos(i[off + 6]/wt),' ',tos(1 - i[off + 7]/ht),'\n', +'vt ',tos(i[off + 8]/wt),' ',tos(1 - i[off + 9]/ht),'\n', +'f ',f2ui(i[off + 1]) + 1,'/',nb_tcoords + 1,' ',f2ui(i[off + 2]) + 1,'/',nb_tcoords + 2, +' ',f2ui(i[off + 3]) + 1,'/',nb_tcoords + 3,'\n'),str); +write(#"$out_prim",str); +nb_tcoords+=3; +++nb_primitives; +):type==12?( +material!=p_material?write(#"$out_prim",str_mtl); +wt = i(#materials,0,p,0,1); ht = i(#materials,0,p,0,2); +ref(string('vt ',tos(i[off + 5]/wt),' ',tos(1 - i[off + 6]/ht),'\n', +'vt ',tos(i[off + 7]/wt),' ',tos(1 - i[off + 8]/ht),'\n', +'vt ',tos(i[off + 9]/wt),' ',tos(1 - i[off + 10]/ht),'\n', +'vt ',tos(i[off + 11]/wt),' ',tos(1 - i[off + 12]/ht),'\n', +'f ',f2ui(i[off + 1]) + 1,'/',nb_tcoords + 1,' ',f2ui(i[off + 2]) + 1,'/',nb_tcoords + 2, +' ',f2ui(i[off + 3]) + 1,'/',nb_tcoords + 3,' ',f2ui(i[off + 4]) + 1,'/',nb_tcoords + 4,'\n'),str); +write(#"$out_prim",str); +nb_tcoords+=4; +++nb_primitives; +):( +run(['warn \"Command 'output_obj': Cannot convert primitive \#'],p,'/',nbp - 1, +' (size ',type,'). Ignoring it.\"'); +); +off+=type + 1; +p_material = material; +); +resize(#"$out_prim",1,out,1,1,0); +run('nb_primitives=',nb_primitives)" +e "\r - Export primitives: Done." +l[out_obj,out_prim] { i[1] ('"\n# Primitives.\n"':y) a y } +if $2 k[out_mtl,out_obj] else k[out_obj] fi +header="# Object name: "$nm\n"# Vertices: "$nb_vertices\n"# Primitives: "$nb_primitives\n"# Materials: "$nb_materials\n"# Textures: "$nb_textures\n{`"d2(x) = (s = date(x); s>9?v2s(s,-1,2):[0,s]+_'0'); +string('# Generated on ',date(0),'/',d2(1),'/',d2(2),' at ',d2(4),':',d2(5),':',d2(6), +' by G\47MIC (https://gmic.eu).\n')"`} +l[out_obj] { +i[0] ('"# File: "$folder$basename$ext\n$header':y) +if $2 i[1] ('"\n# Materials.\nmtllib "$folder$basename".mtl\n"':y) fi +a y +ot $folder$basename$ext +} +if $2 l[out_mtl] { +i[0] ('"# File: "$folder$basename.mtl\n$header\n':y) +a y +ot $folder$basename.mtl +} fi +rm +} +is_change 0 +#@cli ot : eq. to 'output_text'. +ot : +_gmic_s="$?" v + _output_text "$*" +#@cli output_text : filename +#@cli : Output selected images as text-data filenames. +#@cli : (eq. to 'ot'). +output_text : +_gmic_s="$?" v + _$0 "$1" +_output_text : +e[0--3] "Output image"$_gmic_s" as text-data file '"{/"$1"}"'." +o raw:"$1",uint8 +#@cli on : eq. to 'outputn'. +on : +_gmic_s="$?" v + _outputn $* +#@cli outputn : filename,_index +#@cli : Output selected images as automatically numbered filenames in repeat...done loops. +#@cli : (eq. to 'on'). +outputn : +_gmic_s="$?" v + _$0 $* +_outputn : skip "${2=}" +if $#==1 filename=${filename\ "$1",$>} +else filename=${filename\ "$1",$2} +fi +e[0--3] "Output image"$_gmic_s" as file '"{/$filename}"'." +o $filename +#@cli op : eq. to 'outputp'. +op : +_gmic_s="$?" v + _outputp $* +#@cli outputp : prefix +#@cli : Output selected images as prefixed versions of their original filenames. +#@cli : (eq. to 'op'). +#@cli : Default value: 'prefix=_'. +outputp : +_gmic_s="$?" v + _$0 $* +_outputp : skip ${1="_"} +if $!>1 e[0--4] "Output image"$_gmic_s" as their initial locations, prefixed by '$1'." +else e[0--4] "Output image"$_gmic_s" as its initial location, prefixed by '$1'." +fi +repeat $! { o[$>] {$>,f}$1{$>,b}.{$>,x} } +#@cli ow : eq. to 'outputw'. +ow : +_gmic_s="$?" v + _outputw +#@cli outputw +#@cli : Output selected images by overwriting their original location. +#@cli : (eq. to 'ow'). +outputw : +_gmic_s="$?" v + _$0 $* +_outputw : +if $!>1 e[0--4] "Output image"$_gmic_s" as their initial location." +else e[0--4] "Output image"$_gmic_s" as its initial location." +fi +repeat $! { o[$>] {$>,n} } +#@cli ox : eq. to 'outputx'. +ox : +_gmic_s="$?" v + _outputx $* +#@cli outputx : extension1,_extension2,_...,_extensionN,_output_at_same_location={ 0 | 1 } +#@cli : Output selected images with same base filenames but for N different extensions. +#@cli : (eq. to 'ox'). +#@cli : Default value: 'output_at_same_location=0'. +outputx : +_gmic_s="$?" v + _$0 $* +_outputx : +$=arg +is_last_arg=0 is_same_location=0 +if isnum($-1) is_last_arg={isint($-1)" && "$-1>=0" && "$-1<=1} is_same_location=$-1 fi +N={$#-$is_last_arg} s0= s1=s +if !$N e[0--3] "Output image"$_gmic_s" at same location, with same base filename but extension '' +(skipped, no extension provided)." return +fi +if $is_same_location +if $is_last_arg +e[0--4] "Output image"$_gmic_s" at same location, with same base filename but extension"${s{$N>1}}"' ${^-1}'." +else +e[0--4] "Output image"$_gmic_s" at same location, with same base filename but extension"${s{$N>1}}" '$*'." +fi +foreach { +repeat $N { ext=${arg{1+$>}} if ext=lowercase(['$ext']);ext=='jpg'||ext=='jpeg' ext.=,85 fi o {0,f}{0,b}.$ext } +} +else +if $is_last_arg e[0--4] "Output image"$_gmic_s" with same base filename but extension"${s{$N>1}}"' ${^-1}'." +else e[0--4] "Output image"$_gmic_s" with same base filename but extension"${s{$N>1}}" '$*'." +fi +foreach { +repeat $N { ext=${arg{1+$>}} if ext=lowercase(['$ext']);ext=='jpg'||ext=='jpeg' ext.=,85 fi o {0,b}.$ext } +} +fi +#@cli parse_cli : _output_mode,_{ * | command_name } +#@cli : Parse definition of '@cli'-documented commands and output info about them in specified output mode. +#@cli : 'output_mode' can be { ascii | bashcompletion | html | images | print }. +#@cli : Default values: 'output_mode=print' and 'command_name=*'. +parse_cli : skip "${1=print},${2=*}" +e[^-1] "Parse '#@cli' command(s) '$2' and output in '$1' mode." +l[] { +({'$$parse_cli_$1'}) rm +onfail error[0--2] "Command 'parse_cli': Invalid output mode '$1'." +} +if !$! l[] { it ${_path_rc}update$_version.gmic onfail } fi +if !$! return fi +i[0] ('\n') y a y +merge_multiline_comments +eval " +for (p = 0, p=h || i[r]=='\n'?(copy(i[p],0,r - p,1,0); p = r; continue()); +(i[r]==_':' && i[r + 1]==_':')?( +r = find(#0,_'\n',r)%h; +):i[r]!=_':'?do( +r = find(#0,_'\n',r)%h; +crop(0,r,1,6)=='\n#@cli'?( +for (s = r + 6, s +begin( +ref(vector1024(),command); +ref(vector1024(),category); +); +for (p = 5, p=h#x || i[#x,p]==_'\n'?(run('=>[',x,'] __to_discard__'); break()); +i[#x,p]==_':' && i[#x,p + 1]==_':'?( # Category +for (p+=2, i[#x,p]<=_' ', ++p); +for (q = h#x - 1, i[#x,q]<=_' ', --q); +copy(category,i[#x,p],l = min(q - p + 1,size(category) - 1)); +category[l] = 0; +run('=>[',x,'] __to_discard__'); +):( +for (q = p, q_' ', ++q); +copy(command,i[#x,p],l = min(q - p,size(command) - 1)); +command[l] = 0; +run('=>[',x,'] \"',string(command,'@',category),'\"'); +)" +rm. rmn __to_discard__ +l { parse_cli_trigger_$1 $2 onfail } +fi +parse_cli_$1 +parse_cli_is_eqto : +nbl:="n = 1; for (p = 0, (q = find(#-1,_'\n',p))>=0, ++n, p = ++q); n" +u {$nbl"==1 && find(#-1,'eq. to \'')>=0"} +parse_cli_bashcompletion : +v 0 use_vt100 +sort_list +,n ++e "#"\n"# Bash completion rules for 'gmic'."\n"#"\n"# This file has been generated automatically."\n"# Do not edit!"\n"#"\n"# This file should be copied/renamed in '/usr/share/bash-completion/completions/gmic'."\n"#"\n\n"_gmic()"\n"{"\n" local cur prev opts coms"\n" if type -t _init_completion >/dev/null; then"\n" _init_completion -n = || return"\n" else"\n" COMPREPLY=()"\n" cur=\"${COMP_WORDS[COMP_CWORD]}\""\n" prev=\"${COMP_WORDS[COMP_CWORD-1]}\""\n" fi" +coms=" coms=\"" c= +foreach { +if s=['{n}'];s[0]==_'_' continue fi +('{n}') l. { s -,{'@'} name={0,t} rm } => $name +coms.=$c$name c=" " +} ++e $coms"\""\n" opts=$(echo \"$coms\" | sed \"s: \\([^ ]\\+\\): \\1 -\\1 \\+\\1:g\")"\n +repeat $! { +if s=['{$>,n}'];s[0]==_'_' continue fi +name={$>,n} +if ${parse_cli_is_eqto[$>]} ++l[$>] { s -,{'"eq. to "'} k. s -,39 eqto={0,t} rm } +l[$>] { +pass[$eqto] 0 k. => $name +onfail +warn "Warning: Ignoring shortcut '"$_vt100_c$name$_vt100_m$_vt100_b"', ""links to unknown command '"$_vt100_c$eqto$_vt100_m$_vt100_b"'." +=> __to_discard__ +} +fi +} +rmn __to_discard__ ++e " case \"${prev}\" in" +repeat $! { +if s=['{$>,n}'];s[0]==_'_' continue fi +l[$>] { +name={n} +if n=['$name'];"n[0]!=_'_' && find(n,'input')!=0 && find(n,'output')!=0 && ""find(n,'load')<0 && find(n,'save')<0 && ""n!='i' && n!='o' && n!='m' && n!='it' && n!='ot'" +if s=['$name'];s=='help'||s=='h' ++e " \""$name"\" | \"-"$name"\" | \"+"$name"\")" ++e " COMPREPLY=( $(compgen -W \"$coms\" -- \"$cur\") ); return 0;;" +else +s -,{'\n'} k[0] discard {'#@cli'} max {'" "'} autocrop {'" "'} +s -,{':'} autocrop {'" "'} rm[0] replace {'" "'},{'_'} +n_args=0 args,c= repeat $! { if ['{/{$>,t}}']!='(+)' args.=$c{$>,t} c=" " n_args+=1 fi } +if $n_args==1 args="> "$args fi +if ['$args']!=0 ++e " \""$name"\" | \"-"$name"\" | \"+"$name"\")" ++e " COMPREPLY=( $(compgen -W \""{/{/$args}}"\") ); return 0;;" +fi +fi +rm 0 +fi +} +} ++e " esac"\n\n" COMPREPLY=( $(compgen -W \"$opts\" -- \"$cur\") )"\n" if type -t _filedir >/dev/null; then"\n" _filedir"\n" else"\n" comptopt -o filenames 2>/dev/null"\n" COMPREPLY=( $(compgen -f -- ${cur}) )"\n" fi"\n"}"\n"complete -F _gmic -o filenames gmic" +rm +parse_cli_trigger_bashcompletion : +parse_cli_trigger_print $* +parse_cli_ascii : +use_vt100 +if !narg($_shell_cols) _shell_cols={${-shell_cols}-5} fi +category= n_category=0 +if !narg($_section) _section=1 fi +repeat $! { if s=['{$>,n}'];s[0]==_'_' continue fi l[$>] { +if !0$_no_categories +('{n}') l. { s -,{'@'} if $!>1 cat={t} fi rm } +if ['$cat']!=['$category'] +n_category+=1 +category=$cat +('$_section.$n_category." "') ('$category') +f.. {'" "'} +f.. {'-'} a[-4,-3] x a[-2,-1] x ++e \n" "$_vt100_r$_vt100_b{-2,t}$_vt100_n ++e " "$_vt100_r{t}$_vt100_n +rm[-2,-1] +fi +fi +s -,{'\n'} discard {'#@cli'} max {'" "'} autocrop {'" "'} ++l[0] { +s -,{'": "'} autocrop {'" "'} +name={0,t} rm[0] +is_builtin=0 +if $! +is_builtin:="find(#-1,'(+)')>=0" +if $is_builtin rm. fi +fi ++e "\n "$_vt100_m$_vt100_b$name${"s1,s0=\" (+)\", u $s"$is_builtin}:$_vt100_n +foreach { +if ${parse_cli_is_eqto.} +s -,39 eqto={1,t} k[0] ++e " "${_vt100_i}"Shortcut for command '"$_vt100_m$_vt100_b$eqto$_vt100_n"'." +else +eqto= +l. { _gmd2ascii_cut $_shell_cols,8 if $!>1 i[1--2] ('"\\\\\n "':y) a y fi } +str=" "{t}${"if "$<" u \" |\" else u \"\" fi"} ++e ${_vt100_c}$str$_vt100_n +fi +} +rm +} +rm[0] +n_example=0 nl="\n" +repeat $! { if {$>,i==_':'} l[$>] { +if "h==1 || (h==2 && i[-1,2]==_' ')" rm ('": "':y) fi +rows {1+(i[1]==_'" "')},100% +if "find(#0,'(eq. to ')>=0" # Found 'Eq. to' description. ++l { s -,{'\47'} shortcut={1,t} rm onfail shortcut="(unknown)" rm } ++e $nl" ("${_vt100_i}"equivalent to shortcut command '"$_vt100_m$_vt100_b$shortcut$_vt100_n"')." nl="\n" +elif "find(#0,'Default value:')>=0 || find(#0,'Default values:')>=0" # Found 'Default value(s):' description +if !0$_no_default_values +s +,{':'} +if $!>2" && "h#1==1" && "i("#1")==_':' +i[0] ('$_vt100_b':y) i[2] ('$_vt100_n':y) +fi +a y gmd2ascii $_shell_cols,5 +if $!>1 i[1--2] ('"\n "':y) a y fi autocrop {'\n'} ++e "\n "{/{t}} nl= +fi +elif i==_'$'" && "i[1]!=_'$' +if !0$_no_examples +rows 1,100% autocrop {'" "'} +_gmd2ascii_cut {$_shell_cols-8},7 +if $!>1 i[1--2] ('"\\\\\n "':y) a y fi autocrop {'\n'} +example={/{t}} +n_example+=1 +if $n_example==1 example_str=${_vt100_b}"Example:"$_vt100_n"\n "[#$n_example] nl="\n" +else example_str=" "[#$n_example] +fi ++e $nl" "$example_str" "$_vt100_c$example$_vt100_n nl= +fi +elif i==_'$'" && "i[1]==_'$' +if !0$_no_tutorial_link +if h==2 +url=https://gmic.eu/tutorial/$name +else +rows 2,100 autocrop {'" "'} url={t} +fi ++e "\n "${_vt100_b}"Tutorial: "$_vt100_n$_vt100_u$url$_vt100_n nl= +fi +else +parse_cli_text_ascii. +if w +e $nl{/{t}} nl= fi +fi +} fi } +rm 0 +} } rm u $eqto +parse_cli_text_ascii : +if !narg($_shell_cols) _shell_cols={${-shell_cols}-5} fi +replace_str "\\n","\n" gmd2ascii $_shell_cols,0 +if w +s +,{'\n'} +if {i==_'\n'} rm. fi +eval "repeat (l,p, +i(#p)==_'\n'?( +h(#p)>2?resize(#p,1,1,1,1,0) +):( +resize(#p,1,h#p + 4,1,1,0,0,0,1); +copy(i[#p,0],_' ',4,1,0)) +)" +a y +fi +parse_cli_trigger_ascii : +if "['$1']!='*'" +1,$!,1,1," +begin(ref([lowercase(['$1']),_'@'],str)); +ref(lowercase(name(#y)),nm); +!find(nm,str)?y:-1" +discard. -1 if h k[{i}] else rm fi +fi +parse_cli_html : +v 0 use_vt100 e "" +html=""\n""\n" "\n" "\n" "\n" "\n" "\n\n" G'MIC - GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing ""- Reference Documentation"\n" "\n" "\n" "\n\n" "\n" "\n\n"
"\n\n" "\n\n""\n\n""\n +list_categories,c= +category,p_category= n,is_tr,is_table,row=0 +repeat $! { +if s=['{$>,n}'];s[0]==_'_' continue fi +l[$>] { +('{n}') l. { s -,{'@'} name={0,t} if $!>1 category={1,t} else category= fi rm } +if ['$category']!=['$p_category'] +strvar $category category_id=${} +if $is_tr +if $n%5" && "$row>1 html.=" "\n fi +html.=" "\n is_tr=0 +fi +if $is_table html.="
"\n is_table=0 fi +html.="\n

"$category":

"\n" "\n +('$category') replace_str. ",","," lcategory={t} rm. +list_categories.=$c$lcategory c=, +is_table=1 +n,row=0 +fi +if !${parse_cli_is_eqto.} +is_builtin:="find(#-1,'(+)')>=0" +if !($n%5) +if $is_tr html.=" "\n fi +html.=" "\n +is_tr=1 row+=1 +fi +if ['$name']=='index' url_name=_index.html else url_name=$name.html fi +if $is_builtin +html.=" "\n +else +html.=" "\n +fi +n+=1 +fi +p_category=$category +} +} +if $is_tr +if $n%5" && "$row>1 html.=" "\n fi +html.=" "\n +fi +if $is_table html.="
"$name""$name"
"\n fi +html.="\n

Command Shortcuts:

"\n" "\n" "\n +repeat $! { +if s=['{$>,n}'];s[0]==_'_' continue fi +l[$>] { +('{n}') l. { s -,{'@'} name={0,t} if $!>1 category={1,t} else category= fi rm } +if ${parse_cli_is_eqto.} +is_builtin:="find(#-1,'(+)')>=0" ++l { s -,{'"eq. to \47"'} k. s -,{'\47'} k[0] autocrop {'" "'} eqto={t} rm } +('$name') replace_str. ">",">" replace_str. "<","<" html_name={t} rm. +html.=" " +if $is_builtin +html.="" +else +html.="" +fi +html.=""\n +n+=1 +fi +} +} +if $is_table html.="
Shortcut name""Equivalent command name
"$html_name""$eqto""$eqto"
"\n fi +html.=\n""\n\n""\n"
"\n" "\n" " +({'$html'}:y) +toc_html="

Categories:

    "\n +repeat narg({/$list_categories}) { +arg0 $>,{/$list_categories} category=${} +('$category') replace_str. ",","," category={t} rm. +strvar $category category_id=${} +toc_html.="
  • "$category"
  • "\n +} +toc_html.="
  • Command Shortcuts
  • "\n +toc_html.="
" +replace_str. "",$toc_html +ot. list_of_commands.html +if !isfile('index.html') x "ln -fs list_of_commands.html index.html" fi +rm. +repeat $! { +if s=['{$<,n}'];s[0]==_'_' rm[$<] else l[$<] { +('{n}') l. { s -,{'@'} name={0,t} if $!>1 category={1,t} else category= fi rm } +is_eqto=${parse_cli_is_eqto.} +if !$is_eqto _is_$name=1 else rm fi +onfail rm +} fi +} +foreach { +('{n}') l. { s -,{'@'} name={0,t} if $!>1 category={1,t} else category= fi rm } +e "\r > "$_vt100_c[#{1+$>}]$_vt100_n" "{`s=vector48(_'" "');copy(s,['$category" / "$name']);s`} +if !$> previous= else pass[{$>-1}] 1 ('{n}') discard. {'_c1'} previous={t} rm[-2,-1] fi +if !$< next= else pass[{$>+1}] 1 ('{n}') l. { s -,{'@'} next={0,t} rm } rm. fi +if ['$name']=='index' url_name=_index.html else url_name=$name.html fi +if ['$previous']=='index' url_previous=_index.html else url_previous=$previous.html fi +if ['$next']=='index' url_next=_index.html else url_next=$next.html fi +strvar[] $category category_id=${} +html=""\n""\n" "\n" "\n" "\n" "\n" "\n\n" G'MIC - GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing ""- Reference Documentation - "$name""\n" "\n" "\n" "\n" "\n" "\n\n" "\n" "\n\n" ""
"\n\n" "\n\n""\n\n +if !0$_pdf_output +html.=" " +if narg($previous)" || "narg($next) +html.=""\n +fi +html.="
""Table of Contents  ▸  ""List of Commands  ▸  """$category"  ▸  """$name"" +if narg($previous) html.="◀  "$previous"" fi +if narg($previous)" && "narg($next) html.="    |    " fi +if narg($next) html.=""$next"  ▶" fi +html.="
\n" +else +html.=""\n +fi +s -,{'\n'} discard {'#@cli'} max {'" "'} autocrop {'" "'} ++l[0] { +s -,{'": "'} autocrop {'" "'} rm[0] +is_builtin=0 +if $!" && find(#-1,'(+)')>=0" is_builtin=1 rm. fi +if $is_builtin +html.="

"$name"

Built-in command
"\n +else +html.="

"$name"

"\n +fi +if $! +html.="\n

Arguments:

\n
    "\n +if $!>1 or="    or" else or= fi +foreach { +if !$< or= fi +html.="
  • "{t}""$or"
  • "\n +} +html.="
"\n +else +html.="\n

No arguments

"\n +fi +rm +} +rm[0] +html.="\n

Description:

"\n +line=0 +n_example=0 +nb_examples=0 +is_tutorial_tag=0 +tutorial_html= +repeat $! { +if {$>,i==_':'} l[$>] { +if "h==1 || (h==2 && i[-1,2]==_' ')" rm ('": "':y) fi +rows {1+(i[1]==_'" "')},100% +if i==_'$'" && "i[1]!=_'$' nb_examples+=1 fi +} fi +} +foreach { +if "find(#0,'(eq. to ')>=0" ++l { s -,{'\47'} +replace_str[1] "&","&" +replace_str[1] "<","<" +replace_str[1] ">",">" +shortcut={1,t} +rm +onfail shortcut="(unknown)" rm +} +html.="

(equivalent to shortcut command "$shortcut").

"\n +elif "find(#0,'See also:')>=0" +s +,{':'} autocrop {'" "'} +if $!>2" && "h#1==1" && "i("#1")==_':' +html.="\n

See also:

"\n +rm[0,1] +fi +a y +gmd2html 0 +html.=" "{t}\n +elif "find(#0,'Default value:')>=0 || find(#0,'Default values:')>=0" +s +,{':'} autocrop {'" "'} +if $!>2" && "h#1==1" && "i("#1")==_':' +html.="\n

Default values:

"\n +rm[0,1] +fi +a y +gmd2html 0 +html.="

"{t}"

"\n +elif i==_'$'" && "i[1]!=_'$' +rows 1,100% autocrop {'" "'} +if !0$_pdf_output +replace_str "image.jpg","""image.jpg" +fi +example={/{t}} +n_example+=1 +if $n_example>1 basename=${name}_$n_example.jpg else basename=${name}.jpg fi +if $n_example==1 +if !$is_tutorial_tag html.="" is_tutorial_tag=1 fi +html.="\n

Example"${"if "$nb_examples">1 u s else u \"\" fi"}" of use:

"\n fi +if $nb_examples!=1 html.="

• Example \#"$n_example"

"\n fi +html.="
"$example"

"\n +if 0$_pdf_output html.="
"\n fi +if isfile('img/f_$basename') +if !0$_pdf_output +html.=" """"
Command: "$example"
"\n +else +html.=""\n +fi +elif isfile('img/f0_$basename') +i=0 +html.="
" +for isfile('img/f${i}_$basename') { +if !0$_pdf_output +html.=" """"
Command: "$example"
"\n +else +html.=""\n +fi +i+=1 +} +html.="
" +fi +if 0$_pdf_output html.="
"\n fi +elif i==_'$'" && "i[1]==_'$' +if !$is_tutorial_tag html.="" is_tutorial_tag=1 fi +if h==2 +url=https://gmic.eu/tutorial/$name +l[] { it $url if "find(#-1,'404 Not Found')>=0" url=https://gmic.eu/oldtutorial/_$name fi rm } +else +rows 2,100 autocrop {'" "'} url={t} +fi +tutorial_html.="

This command has a ""tutorial page.

" +else ++autocrop {"' '"} is_list:="isin(i,_'*',_'-',_'.')" rm. +('\n') a y +replace_str "\\n","\n" gmd2html 0 +if $line==1" && "!$is_list html.="
"\n fi +html.={t} +if i[-1,2]!=_'\n' html.="\n" fi +line+=1 +fi +} +html.=\n""\n\n""\n"
"\n" "\n" " +rm ({'$html'}:y) +replace_str. "",$tutorial_html +=> $name ot $url_name +} +rm +e "\r > "${_vt100_g}{`s=vector64(_'" "');copy(s,'"Parsing done!"');s`}$_vt100_n +parse_cli_trigger_html : +parse_cli_trigger_print $* +parse_cli_images : +v 0 use_vt100 e "" +old_category,category= n_category,n_example=0 +if !isfile('image.jpg') l[] { sp bottles,640 onfail testimage2d 500 } o. image.jpg rm. fi +n_global=0 +repeat $! { +if s=['{$>,n}'];s[0]==_'_' continue fi +l[$>] { +('{n}') l. { s -,{'@'} name={0,t} if $!>1 category={1,t} else category= fi rm } +if ['$category']!=['$old_category'] +n_category+=1 +e $_vt100_r"\n ** Section \#"$n_category": "$category"."$_vt100_n"\n" +fi +s -,{'\n'} discard {'#@cli'} max {'" "'} autocrop {'" "'} +n_example=0 +foreach { +if "i==_':' && ( +for (p = 1, p1 +basename=${name}_$n_example.jpg +else +basename=${name}.jpg +fi +e $_vt100_c[$n_global]$_vt100_n" Command '"$_vt100_g$name$_vt100_n"': $ "$example +skip_rendering:="['"$name"'][0]==_'_' || ""(isfile(['"{/${_parse_cli_images_path}f_$basename}"']) &&"" isfile(['"{/${_parse_cli_images_path}t_$basename}"'])) || ""(isfile(['"{/${_parse_cli_images_path}f0_$basename}"']) && ""isfile(['"{/${_parse_cli_images_path}t0_$basename}"']))" +if !$skip_rendering +m "run_example : "$example +l[] { +reset etime=$| +run_example +etime="done in "$_vt100_n{_round($|-$etime,0.01)}"s"$_vt100_m +_parse_cli_images 1 +if $! +if $!>1 repeat $! { o[$>] ${_parse_cli_images_path}f$>_$basename,85 } +else o ${_parse_cli_images_path}f_$basename,85 fi +rr2d 480,320,0,2 +if $!>1 repeat $! { o[$>] ${_parse_cli_images_path}t$>_$basename,75 } +else o ${_parse_cli_images_path}t_$basename,75 fi +rm +fi +} +um run_example +else etime="skipped" +fi +e "\r"$_vt100_c[$n_global]$_vt100_n" Command '"$_vt100_g$name$_vt100_n"': $ "$example" "${_vt100_m}"("$etime")."$_vt100_n +fi +} +old_category=$category +rm 0 +} +} +rm +_parse_cli_images : l[] { check "isbool(${1=1})" is_arg=1 arg1=$1 onfail is_arg=0 arg1=1 } +if !$is_arg noarg fi +if !$! rm return fi +W,H=640,480 +foreach { +nm={n} label=[$>]:" "'$nm' +if ${-is_mesh3d} +label2="("{i[6]}" vert., "{i[7]}" prim.)" +r3d 1,1,0,-80 r3d 0,1,0,80 snapshot3d {max($W,$H)} +else +label2="("{w}x{h}x{d}x{s}")" +if s>4 channels 0,2 fi +r 100%,100%,100%,{max(s,3)},{s==1?1:0} +if d>1 ++slices 50% ++z[0] 50%,0,0,50%,100%,100% permute. zyxc ++z[0] 0,50%,0,100%,50%,100% permute. xzyc +rr2d... $W,$H,0,2 +r2dy.. {-3,h},1 +r2dx. {-3,w},1 +s:=min(w#-2,h) +if $s>64 projections3d[0] 50%,50%,50%,1 mv[0] $! r3d. 1,1,0,-80 r3d. 0,1,0,80 snapshot3d. $s +else rm[0] 0 +fi +eW,eH:=[w#0+w#1,h#0+h#2] +if $eW>$W" || "$eH>$H fact:=min($W/$eW,$H/$eH)*100 r $fact%,$fact%,1,100%,2 fi +n 0,255 +fs={0,max(w,h)*7%} +if {0,h>1.5*$fs} to[0] XY,4,2,$fs fi +if {1,h>1.5*$fs} to[1] XZ,4,2,$fs fi +if {2,h>1.5*$fs} to[2] YZ,4,2,$fs fi +if w to[3] 3D,4,2,$fs frame[3] 1,1,200 fi +frame[0-2] 1,1,200 +a[0,1] x a[1,2] x a y +fi +fi +if w>5*h r $W,{$H/3},1,100%,1 +elif h>5*w r {$W/3},$H,1,100%,1 +else rr2d $W,$H,0,{w<$W&&h<$H?1:2} +fi +n 0,255 +if $arg1 +if s>3 drgba fi +r {[w,h]+2},1,100%,0,0,0.5,0.5 +- 245 r {[w+10,h+5]},1,100%,0,0,0.5,0.5 r 100%,{h+1},1,100%,0,0,0,1 + 245 +0 t. $label" "$label2,5,0,32,1,1 +if w>w#0" || "h>h#0 +rm. 0 t. $label\n$label2,5,0,32,1,1 +if w>w#0" || "h>h#0 rr2d. {0,[w,h]},0,2 fi +fi +*. -1 n. 0,255 to_rgb. +- 245 a y,0.5 + 245 +fi +} +c 0,255 +parse_cli_trigger_images : +parse_cli_trigger_print $* +parse_cli_list : +res= +repeat $! { ('{$>,n}') l. { s -,{'@'} res.=$c{0,t} c=, rm } } +rm u $res +parse_cli_print : +v 0 e "" +sort_list +,n +foreach { +is_native:="find(#-1,' : (+)')>0" +('{n}') l. { s -,{'@'} name={0,t} rm } +if $is_native +e $name" (+)" else +e $name fi +} +rm +parse_cli_trigger_print : +if "['$1']!='*'" +1,$!,1,1," +begin(ref(lowercase(['$1']),str)); +ref(lowercase(name(#y)),nm); +arobace = find(nm,_'@'); +inrange(find(nm,str),0,arobace - 1)?y:-1" +discard. -1 k[{^}] +fi +#@cli parse_gmd +#@cli : Parse and tokenize selected images, viewed as text strings formatted with the G'MIC markdown syntax. +parse_gmd : +e[^-1] "Parse and tokenize images$? viewed as text strings formatted with the G\47MIC markdown syntax." +y 1 a[^-1] .,y rm. +eval[^] ">"${-_gmd_tokens}" +begin( +section = subsection = subsubsection = subsubsubsection = anchor = +bullet = subbullet = subsubbullet = center = right = table = blockquote = detail_block = code_block = +shell = bold_italic_a = bold_italic_u = bold_a = bold_u = italic_a = italic_u = strikethrough = underline = +monospace = value_set = word_highlight = url = page_link = text_link1 = text_link2 = img1 = img2 = pipeline = +formula = opening_offset = -1; +blank(c) = isin(c,_' ',_'\n',s_whitespace,s_tab,0); +semiblank(c) = isin(c,_' ',_'\n',_'.',_',',_';',_':',_'!',_'?', +_')',_'(',_'[',_']',_'|',_'-',s_whitespace,s_tab,0); +newline(c) = isin(c,_'\n',0); +reset(c) = (#c = -1); +res = crop(); +); +pc = j[-1]; c = i; nc = j[1]; ac = j[2]; +ym1 = y - 1; y1 = y + 1; y2 = y + 2; +linestart = newline(pc); +is_raw = max(blockquote,code_block,shell,monospace,url,page_link,text_link2,img2,pipeline,formula)>=0; +non_escaped = is_raw || (pc!=_'\\'); +!non_escaped && +isin(c,_'%',_'$',_'\\',_'\'',_'`',_'*',_'_',_'{',_'}',_'[',_']',_'<',_'>',_'(',_')',_'#',_'+',_'-',_'.',_'!')?( +res[ym1] = i[ym1] = 0; +): +linestart && c==_'#' && nc==_' '?( # Opening +section = y; +): +section>=0 && newline(c)?( +opening_offset = section; +res[section++] = s_section; +while (blank(res[section]), res[section++] = 0); +res[y] = e_section; +for (p = opening_offset - 1, p>=0 && res[p]==_'\n', res[p--] = 0); +for (p = ym1, p>opening_offset && blank(res[p]), res[p--] = 0); +for (p = y1, p=0 && newline(c)?( +opening_offset = subsection; +res[subsection++] = s_subsection; res[subsection++] = 0; +while (blank(res[subsection]), res[subsection++] = 0); +res[y] = e_subsection; +for (p = ym1, p>opening_offset && blank(res[p]), res[p--] = 0); +for (p = y1, p=0 && newline(c)?( +opening_offset = subsubsection; +res[subsubsection++] = s_subsubsection; copy(res[subsubsection],0,2,1,0); subsubsection+=2; +while (blank(res[subsubsection]), res[subsubsection++] = 0); +res[y] = e_subsubsection; +for (p = ym1, p>opening_offset && blank(res[p]), res[p--] = 0); +for (p = y1, p=0 && newline(c)?( +opening_offset = subsubsubsection; +res[subsubsubsection++] = s_subsubsubsection; copy(res[subsubsubsection],0,3,1,0); subsubsubsection+=3; +while (blank(res[subsubsubsection]), res[subsubsubsection++] = 0); +res[y] = e_subsubsubsection; +for (p = ym1, p>opening_offset && blank(res[p]), res[p--] = 0); +for (p = y1, p=0 && newline(c)?( +opening_offset = anchor; +res[anchor++] = s_anchor; +while (blank(res[anchor]), res[anchor++] = 0); +res[y] = e_anchor; +res[y1]==_'\n'?(res[y1] = 0); +for (p = ym1, p>opening_offset && blank(res[p]), res[p--] = 0); +): +linestart && isin(c,_'-',_'*',_'+') && nc==_' ' && bullet<0?( +bullet = y; +): +bullet>=0 && newline(c)?( +opening_offset = bullet; +res[bullet++] = s_bullet; res[bullet] = 0; +res[y] = e_bullet; +): +linestart && c==_' ' && nc==_' ' && isin(ac,_'-',_'*',_'+') && j[3]==_' ' && subbullet<0?( +subbullet = y; +): +subbullet>=0 && newline(c)?( +opening_offset = subbullet; +res[subbullet++] = s_subbullet; copy(res[subbullet],0,2,1,0); +res[y] = e_subbullet; +): +linestart && c==_' ' && nc==_' ' && ac==_' ' && j[3]==_' ' && isin(j[4],_'-',_'*',_'+') && j[5]==_' ' && +subsubbullet<0?( +subsubbullet = y; +): +subsubbullet>=0 && newline(c)?( +opening_offset = subsubbullet; +res[subsubbullet++] = s_subsubbullet; copy(res[subsubbullet],0,4,1,0); +res[y] = e_subsubbullet; +): +linestart && c==_'=' && nc==c && ac==c && newline(j[3])?( +center<0?( +center = y; +): +center>=0 && y>center + 3?( +opening_offset = center; +res[center++] = s_center; copy(res[center],0,3,1,0); center+=3; +newline(res[ym1])?(res[ym1] = 0); +res[y] = e_center; copy(res[y + 1],0,3,1,0); +); +): +linestart && c==_'>' && nc==c && ac==c && newline(j[3])?( +right<0?( +right = y; +): +right>=0 && y>right + 3?( +opening_offset = right; +res[right++] = s_right; copy(res[right],0,3,1,0); right+=3; +newline(res[ym1])?(res[ym1] = 0); +res[y] = e_right; copy(res[y + 1],0,3,1,0); +); +): +table<0 && linestart && c==_'|'?( +table = y; +): +table>=0 && newline(c) && nc!=_'|'?( +opening_offset = table; +d = i[table + 1]; +d==_'|'?(res[table++] = s_htable; res[table++] = 0): +d==_'-'?(res[table++] = s_vtable; res[table++] = 0): +d==_'+'?(res[table++] = s_hvtable; res[table++] = 0):(res[table++] = s_table); +i[table]==_' '?(res[table++] = 0); +newline(i[table]) && i[table + 1]==_'|'?(copy(res[table],0,2,1,0); table+=2); +for (p = table, p' && blank(nc)?( +blockquote = y; +): +blockquote>=0 && newline(c) && (nc!=_'>' || !blank(ac))?( +opening_offset = blockquote; +res[blockquote++] = s_blockquote; res[blockquote] = 0; +for (p = blockquote, p'?copy(res[p],0,res[p + 1]==_' '?2:1,1,0)); +res[y] = e_blockquote; +): +linestart && c==_'?' && nc==c && ac==c && blank(j[3])?( +detail_block<0?( +detail_block = y; +): +detail_block>=0 && y>detail_block + 3 && newline(j[3])?( +opening_offset = detail_block; +res[detail_block++] = s_detail_block; copy(res[detail_block],0,2,1,0); +res[ym1] = e_detail_block; copy(res[y],0,4,1,0); +); +): +linestart && isin(c,_'~',_'`') && nc==c && ac==c && newline(j[3])?( +code_block<0?( +code_block = y; +): +code_block>=0 && y>code_block + 3?( +opening_offset = code_block; +res[code_block++] = s_code_block; copy(res[code_block],0,3,1,0); code_block+=3; +copy(res[code_block],i[code_block],y - code_block); +for (p = code_block, p=0 && y>shell + 3?( +opening_offset = shell; +res[shell++] = s_shell; copy(res[shell],0,3,1,0); shell+=3; +copy(res[shell],i[shell],y - shell); +res[ym1] = e_shell; copy(res[y],0,4,1,0); +); +): +linestart && isin(c,_'-','_','*') && nc==c && ac==c && newline(j[3])?( +res[y] = s_hrule; +copy(res[y1],0,3,1,0); +): +non_escaped && c==_'*' && nc==c && ac==c?( +bold_italic_a<0?( +bold_italic_a = y; +): +bold_italic_a>=0 && y>bold_italic_a + 3 && j[3]!=_'*'?( +opening_offset = bold_italic_a; +res[bold_italic_a++] = s_bold_italic_a; res[bold_italic_a++] = 0; res[bold_italic_a] = 0; +res[y] = e_bold_italic_a; res[y1] = res[y2] = 0; +); +): +non_escaped && c==_'_' && nc==c && ac==c?( +bold_italic_u<0 && semiblank(pc)?( +bold_italic_u = y; +): +bold_italic_u>=0 && y>bold_italic_u + 3 && semiblank(j[3])?( +opening_offset = bold_italic_u; +res[bold_italic_u++] = s_bold_italic_u; res[bold_italic_u++] = 0; res[bold_italic_u] = 0; +res[y] = e_bold_italic_u; res[y1] = res[y2] = 0; +); +): +non_escaped && c==_'*' && nc==c?( +bold_a<0?( +bold_a = y; +): +bold_a>=0 && y>bold_a + 2 && ac!=_'*'?( +opening_offset = bold_a; +res[bold_a++] = s_bold_a; res[bold_a] = 0; +res[y] = e_bold_a; res[y1] = 0; +); +): +non_escaped && c==_'_' && nc==c?( +bold_u<0 && semiblank(pc)?( +bold_u = y; +): +bold_u>=0 && y>bold_u + 2 && semiblank(ac)?( +opening_offset = bold_u; +res[bold_u++] = s_bold_u; res[bold_u] = 0; +res[y] = e_bold_u; res[y1] = 0; +); +): +non_escaped && c==_'*' && pc!=c?( +italic_a<0?( +italic_a = y; +): +italic_a>=0 && y>italic_a + 1 && ac!=_'*'?( +opening_offset = italic_a; +res[italic_a] = s_italic_a; +res[y] = e_italic_a; +); +): +non_escaped && c==_'_' && pc!=c?( +italic_u<0 && semiblank(pc)?( +italic_u = y +): +italic_u>=0 && y>italic_u + 1 && semiblank(nc)?( +opening_offset = italic_u; +res[italic_u] = s_italic_u; +res[y] = e_italic_u; +); +): +non_escaped && c==_'~' && nc==c && pc!=c?( +strikethrough<0?( +strikethrough = y; +): +strikethrough>=0 && y>strikethrough + 2?( +opening_offset = strikethrough; +res[strikethrough++] = s_strikethrough; res[strikethrough] = 0; +res[y] = e_strikethrough; res[y1] = 0; +); +): +non_escaped && c==_'=' && nc==c && pc!=c?( +underline<0?( +underline = y; +): +underline>=0 && y>underline + 2?( +opening_offset = underline; +res[underline++] = s_underline; res[underline] = 0; +res[y] = e_underline; res[y1] = 0; +); +): +non_escaped && c==_'`'?( +monospace<0?( +monospace = y; +): +monospace>=0 && y>monospace + 1?( +opening_offset = monospace; +res[monospace++] = s_monospace; +copy(res[monospace],i[monospace],y - monospace); +for (p = monospace, p=0 && y>value_set + 1 && semiblank(nc)?( +opening_offset = value_set; +res[value_set++] = s_value_set; +copy(res[value_set],i[value_set],y - value_set); +res[y] = e_value_set; +): +non_escaped && c=='\'' && nc!=c?( +word_highlight<0 && semiblank(pc)?( +word_highlight = y; +): +word_highlight>=0 && y>word_highlight + 1 && semiblank(nc)?( +opening_offset = word_highlight; +res[word_highlight++] = s_word_highlight; +copy(res[word_highlight],i[word_highlight],y - word_highlight); +res[y] = e_word_highlight; +); +): +non_escaped && c==_'<' && url<0 && +(crop(0,y1,1,8)=='https://' || crop(0,y1,1,7)=='http://' || crop(0,y1,1,6)=='ftp://')?( +url = y; +): +non_escaped && c==_'>' && url>=0 && y>url + 1?( +opening_offset = url; +res[url++] = s_url; +copy(res[url],i[url],y - url); +res[y] = e_url; +): +non_escaped && c==_'\'' && nc==c?( +page_link<0 && semiblank(pc)?( +page_link = y; +): +page_link>=0 && y>page_link + 2 && semiblank(ac)?( +opening_offset = page_link; +res[page_link++] = s_page_link; res[page_link++] = 0; +copy(res[page_link],i[page_link],y - page_link); +res[y] = e_page_link; res[y1] = 0; +); +): +non_escaped && c==_'[' && text_link1<0 && text_link2<0 && img1<0?( +text_link1 = y; +): +non_escaped && c==_']' && nc==_'(' && text_link1>=0 && text_link2<0 && img1<0?( +text_link2 = y; +): +non_escaped && c==_')' && text_link2>=0 && img1<0?( +opening_offset = text_link1; +res[text_link1] = s_text_link; +res[text_link2++] = m_text_link; res[text_link2++] = 0; +copy(res[text_link2],i[text_link2],y - text_link2); +res[y] = e_text_link; +): +non_escaped && c==_'!' && nc==_'[' && img1<0 && img2<0?( +img1 = y; +): +non_escaped && c==_']' && nc==_'(' && img1>=0 && img2<0?( +img2 = y; +): +non_escaped && c==_')' && img2>=0?( +opening_offset = img1; +res[img1++] = s_img; res[img1++] = 0; +res[img2++] = m_img; res[img2++] = 0; +copy(res[img1],i[img1],img2 - img1 - 2); copy(res[img2],i[img2],y - img2); +res[y] = e_img; +): +non_escaped && c==_'%' && nc==c?( +pipeline<0 && semiblank(pc)?( +pipeline = y; +): +pipeline>=0 && y>pipeline + 2 && semiblank(ac)?( +opening_offset = pipeline; +res[pipeline++] = s_pipeline; res[pipeline++] = 0; +copy(res[pipeline],i[pipeline],y - pipeline); +while (blank(i[pipeline]), res[pipeline++] = 0); +for (p = ym1, blank(res[p]), res[p--] = 0); +res[y] = e_pipeline; res[y1] = 0; +); +): +non_escaped && c==_'$' && nc==c?( +formula<0 && semiblank(pc)?( +formula = y; +): +formula>=0 && y>formula + 2 && semiblank(ac)?( +opening_offset = formula; +res[formula++] = s_formula; res[formula++] = 0; +copy(res[formula],i[formula],y - formula); +while (blank(i[formula]), res[formula++] = 0); +for (p = ym1, blank(res[p]), res[p--] = 0); +res[y] = e_formula; res[y1] = 0; +); +): +semiblank(pc) && c==_'\\' && nc==_'G' && ac==_'\'' && j[3]==_'M' && j[4]==_'I' && j[5]==_'C' && semiblank(j[6])?( +res[y] = s_gmic; +copy(res[y1],0,4,1,0); +res[y + 5] = e_gmic; +): +c==_' '?( +c==_' ' && (linestart || pc==c)?( +res[y] = s_whitespace; +); +reset(word_highlight); +reset(url); +text_link2>=0?(reset(text_link1); reset(text_link2)); +img2>=0?(reset(img1); reset(img2)); +): +c==_'\\' && nc==_'n'?( +res[y] = _'\n'; res[y + 1] = 0; +): +c==_'\t'?( +res[y] = s_tab; +): +c==_'\n'?( +reset(bold_italic_a); +reset(bold_italic_u); +reset(bold_u); +reset(bold_a); +reset(italic_a); +reset(italic_u); +reset(strikethrough); +reset(underline); +reset(monospace); +reset(word_highlight); +reset(url); +reset(page_link); +text_link2>=0?(reset(text_link1); reset(text_link2)); +img2>=0?(reset(img1); reset(img2)); +); +opening_offset>=0?( +section>=opening_offset ? reset(section); +subsection>=opening_offset ? reset(subsection); +subsubsection>=opening_offset ? reset(subsubsection); +subsubsubsection>=opening_offset ? reset(subsubsubsection); +anchor>=opening_offset ? reset(anchor); +bullet>=opening_offset ? reset(bullet); +subbullet>=opening_offset ? reset(subbullet); +subsubbullet>=opening_offset ? reset(subsubbullet); +center>=opening_offset ? reset(center); +right>=opening_offset ? reset(right); +table>=opening_offset ? reset(table); +blockquote>=opening_offset ? reset(blockquote); +detail_block>=opening_offset ? reset(detail_block); +code_block>=opening_offset? reset(code_block); +shell>=opening_offset? reset(shell); +bold_italic_a>=opening_offset ? reset(bold_italic_a); +bold_italic_u>=opening_offset ? reset(bold_italic_u); +bold_a>=opening_offset ? reset(bold_a); +bold_u>=opening_offset ? reset(bold_u); +italic_a>=opening_offset ? reset(italic_a); +italic_u>=opening_offset ? reset(italic_u); +strikethrough>=opening_offset ? reset(strikethrough); +underline>=opening_offset ? reset(underline); +monospace>=opening_offset ? reset(monospace); +value_set>=opening_offset ? reset(value_set); +word_highlight>=opening_offset ? reset(word_highlight); +url>=opening_offset ? reset(url); +page_link>=opening_offset ? reset(page_link); +text_link1>=opening_offset || text_link2>=opening_offset ? (reset(text_link1); reset(text_link2)); +img1>=opening_offset || img2>=opening_offset ? (reset(img1); reset(img2)); +pipeline>=opening_offset ? reset(pipeline); +formula>=opening_offset ? reset(formula); +opening_offset = -1; +); +end(copy(i[0],res))" +discard 0 +#@cli gmd2html : _include_default_header_footer={ 0=none | 1=Reference | 2=Tutorial | 3=News } : (no arg) +#@cli : Convert selected gmd-formatted text images to html format. +#@cli : Default values: 'include_default_header_footer=1'. +gmd2html : skip "${1=}" +l[] { is_arg:=isint("$1") onfail is_arg=0 } +if $is_arg embed_html=$1 else embed_html=1 noarg fi +parse_gmd +s_section,e_section={${-_gmd_tokens}"[s_section,e_section]"} +foreach { +nm$>={b} strvar ${nm$>} fnm=${} +if "i=="$s_section" && find(#-1,"$e_section")>0" ++rows 1,{"find(#-1,"$e_section")-1"} title$>={t} rm. +else title$>= +fi +. +eval. "> +begin("${-_gmd_tokens}${-_gmd_write}"); +c = i; +c>0?( +c==_'\n' ? write('
\n'): +c==_'&' ? write('&'): +c==_'\47' ? write('''): +c==_'>' ? write('>'): +c==_'\"' ? write('"'): +c==_'<' ? write('<'): +write(c); +):( +isin(c,e_bold_a,e_bold_u,e_bold_italic_a,e_bold_italic_u,e_italic_a,e_italic_u, +e_monospace,e_strikethrough,e_underline,e_word_highlight) ? write('
'): +isin(c,e_bullet,e_subbullet,e_subsubbullet) ? write('\n'): +isin(c,e_section,e_subsection,e_subsubsection,e_subsubsubsection) ? write('\n'): +c==s_section ? ( +ind_e = find(#1,e_section,y); +run('_gmd2html_section. ',y + 1,',',ind_e - 1); +ref(get('_gmd_name',1024,1),str_nam); +write_nl(); +write('
'); +): +c==s_subsection ? ( +ind_e = find(#1,e_subsection,y); +run('_gmd2html_section. ',y + 1,',',ind_e - 1); +ref(get('_gmd_name',1024,1),str_nam); +write_nl(); +write('
'); +): +c==s_subsubsection ? ( +ind_e = find(#1,e_subsubsection,y); +run('_gmd2html_section. ',y + 1,',',ind_e - 1); +ref(get('_gmd_name',1024,1),str_nam); +write_nl(); +write('
'); +): +c==s_subsubsubsection ? ( +ind_e = find(#1,e_subsubsubsection,y); +run('_gmd2html_section. ',y + 1,',',ind_e - 1); +ref(get('_gmd_name',1024,1),str_nam); +write_nl(); +write('
'); +): +c==s_anchor ? ( +ind_e = find(#1,e_anchor,y); +run('_gmd2html_section. ',y + 1,',',ind_e - 1); +ref(get('_gmd_name',1024,1),str_nam); +write('\n'); +copy(i[y],0,ind_e - y + 1,1,0); +): +c==s_bullet ? write('
'): +c==s_subbullet ? write('
'): +c==s_subsubbullet ? write('
'): +c==s_center ? write('
\n'): +c==e_center ? (write_nl(); write('
')): +c==s_right ? write('
\n'): +c==e_right ? (write_nl(); write('
')): +c==s_table ? (write_nl(); write('\n
')): +c==s_htable ? (write_nl(); write('\n
')): +c==s_vtable ? (write_nl(); write('\n"\n fi +html.=" "\n is_tr=0 +fi +if $is_table html.="
')): +c==s_hvtable ? (write_nl(); write('\n\n\n
')): +c==m_table ? write(''): +c==n_table ? write('
'): +c==e_table ? write('
\n'): +c==s_blockquote ? (write_nl(); write('
\n')): +c==e_blockquote ? (write('\n
\n')): +c==s_detail_block ? ( +write_nl(); +write('
\n'); +ny = y + 1; +nc = j[1]; +nc!=e_detail_block?( +j[1] = 0; +ind_e = find(#1,e_detail_block,ny); +nc==_' '?( +ind_nl = find(#1,_'\n',ny); +ind_nl<0 || ind_nl>ind_e?(ind_nl = ind_e); +write(#1,y + 2,ind_nl - y - 2); +copy(i[ny],0,ind_nl - y - 1,1,0); +i[ind_nl]!=e_detail_block?(i[ind_nl] = 0); +):write('Details:'); +write('\n'); +) +): +c==e_detail_block ? (write_nl(); write('
\n')): +c==s_code_block ? write('
'): +c==e_code_block ? write('
\n'); +c==s_shell ? ( +ind_e = find(#1,e_shell,y); +run('_gmd2html_shell. ',y + 1,',',ind_e - 1); +ref(get('_gmd_command',1024,1),str_com); +write('
$ '); +len = find(str_com,0); +write(str_com,len); +write('

\n'); +write(#-1,0,h(#-1)); +run('rm.'); +write('
\n'); +copy(i[y],0,ind_e - y + 1,1,0); +): +c==s_hrule ? (write_nl(); write('
\n')): +c==s_bold_italic_a ? write(''): +c==s_bold_italic_u ? write(''): +c==s_bold_a ? write(''): +c==s_bold_u ? write(''): +c==s_italic_a ? write(''): +c==s_italic_u ? write(''): +c==s_strikethrough? write(''): +c==s_underline? write(''): +c==s_monospace ? write(''): +c==s_value_set ? write('{'): +c==e_value_set ? write('}'): +c==s_word_highlight ? write(''): +c==s_url ? ( +ind_e = find(#1,e_url,y); +write(''); +): +c==e_url ? write(''): +c==s_page_link ? ( +ind_e = find(#1,e_page_link,y); +run('_gmd2html_page_link. ',y + 1,',',ind_e - 1); +ref(get('_gmd_link',1024,1),str_link); +ref(get('_gmd_text',1024,1),str_text); +write(''); +len = find(str_text,0); +write(str_text,len); +write(''); +copy(i[y],0,ind_e - y + 1,1,0); +): +c==s_text_link ? ( +ind_m = find(#1,m_text_link,y); +ind_e = find(#1,e_text_link,ind_m); +write(''): +write('\" target=\"_blank\">'); +): +c==m_text_link ? ( +ind_e = find(#1,e_text_link,y); +copy(i[y],0,ind_e - y + 1,1,0); +write(''); +): +c==s_img ? ( +ind_m = find(#1,m_img,y); +ind_e = find(#1,e_img,ind_m); +ind_d = find(#1,_'.',ind_e - 1,-1); +is_video = 0; +ind_d>ind_m?( +ref(crop(#1,0,ind_d + 1,1,3),ext3); +ref(crop(#1,0,ind_d + 1,1,4),ext4); +is_video = ext3=='mp4' || ext3=='ogg' || ext4=='webm' +); +is_video?( +write('
" +else td_$cat="" +fi +} +html=""\n""\n" "\n" "\n" "\n" "\n" "\n\n" G'MIC - GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image ""Processing - Gallery"\n" "\n" "\n" "\n" "\n\n" "\n" "\n" "\n\n" "\n" "\n\n"

Image Gallery

"\n\n"

This gallery gives a quick overview of the kind of features and generic filters available in the ""G'MIC open-source image processing framework.

"\n"

All the images below have been processed by the CLI interface ""gmic"" of G'MIC, from a set of initial 2D color images."\n" Click on an image to enlarge it and display the G'MIC command-line ""used for the processing (note: to reproduce this, you may have to escape some characters, ""according to the type of shell you use!).

"\n"

Remember, G'MIC lets you define your own image pipelines through""custom command files."\n" Your custom filters can be easily added afterwards in the plug-in for ""GIMP or Krita.

"\n"

For more details, visit the tutorial pages as well as the ""technical reference to get a full documentation on this ""software.

"\n +html_menu=" \n "$td_arrays"Arrays & Frames"$td_artistic"Artistic"$td_blackandwhite"B&W"$td_colors"Colors"$td_deformations"Deformations"$td_filtering"Filtering"$td_patterns"Patterns"$td_3dmeshes"3D Meshes"$td_stylization"Stylization"$td_codesamples"Code samples"\n"

\n\n" +html=${html}${html_menu}" \n" +repeat $nb_commands { +command=${"arg "1+$>,$commands} +is_stylization:=['$command']=='_gallery_stylization' +e $_vt100_m" - Command '"$_vt100_b$command$_vt100_n"' ["{1+$>}/$nb_commands"]." ++l { +s -,{'"#@cli "$command" :"'} +if $!<2 s -,{'"#@cli "$command"\n"'} i[1] ('\n') a[-2,-1] y fi +if $!<2 warn " ** Command '"$command"' not found! **" +else +k. +eval " +ref(crop(#-1),str); +ind = 0; +while ((ind = find(str,'\n#@cli ',ind))>=0, +++ind; +str[ind+6]!=_':' ? break() : +str[ind+7]==_' ' && str[ind+8]==_'$' && str[ind+9]==_' '?( +beg = ind + 10; +end = find(str,_'\n',beg) - 1; +ref(vector1024(0),com); +run('+rows[0] ',beg,',',end); +); +)"; +rm[0] +nb_examples=$! +repeat $nb_examples { +example$nex={$>,t} +e $_vt100_g" $ "${example$nex}$_vt100_n +sample=${"arg0 "{($nex+8*$ncat)%narg($pics)},$pics} +is_codesample=0 +l[] { +('${example$nex}') y +is_input:="find(#-1,'image.jpg')>=0" +if !$is_input" && find(#-1,'sample ')>=0" +s +,{'"sample "'} +if {0,crop()=='"sample "'" && "$!>1} l[1] { +s +,{'" "'} +if "find(#0,_',')==-1" sample={0,t} is_input=1 fi +a y +} fi +a y +fi +replace_str. "image.jpg",""$sample".png" +replace_str. "_output_mode=1","" +l. { +s +,{'" "'} +repeat $! { +if {$<,crop(0,0,1,5)=='_fps='||crop(0,0,1,7)=='_label='} rm[$<] fi +} +a y +} +l. { +s +,{'" "'} repeat $! { +if {$<,crop(0,0,1,8)=='https://'} l[$<] { +if crop(0,0,1,24)=='https://gmic.eu/samples/' +is_codesample=1 +basename_codesample={`crop(0,24,1,h-24)`} +filename_codesample="../../resources/samples"/$basename_codesample +url_codesample="https://gmic.eu/samples/"$basename_codesample +if $1 +x "lftp sftp://"$GMIC_LOGIN":@ovh -e \"put -O /home/"$GMIC_LOGIN"/www/gmic/samples ""\\\""$filename_codesample"\\\"; quit\" >/dev/null" fi +i[0] ('""') +else i[0] ('""') +fi +('') y a y +} fi +} +a y +} +replaced_example$nex={t} rm +} +('${example$nex}') replace_str. "https://gmic.eu/samples/","../../resources/samples/" example$nex={t} rm. +m "_run : _preview_area_width,_preview_area_height=450,300 "${example$nex} +if $is_input sample_=${sample}_ else sample_= fi +filename_original=img/${category}_${sample_}original_$nex.jpg +filename_thumb_original=img/${category}_${sample_}thumb_original_$nex.jpg +if "find(['"${example$nex}"'],' _fps=')>=0" +filename_full=img/${category}_${sample_}full_$nex.gif +filename_thumb=img/${category}_${sample_}thumb_$nex.gif +_is_animated=1 +else +filename_full=img/${category}_${sample_}full_$nex.jpg +filename_thumb=img/${category}_${sample_}thumb_$nex.jpg +_is_animated=0 +fi +etime= +_label= +if !isfile('{/$filename_thumb}') l[] { +if $is_input sp $sample,600 o image.jpg rm fi +db3d m3d md3d f3d l3d sl3d ss3d 0.8 srand 512 +etime=$| _run etime={_round($|-$etime,0.01)} +if $is_stylization ++l { _gallery o $filename_full,70 rm } k. +_gallery +width,height:=[w,h] +else +_gallery +width,height:=[w,h] +if $_is_animated o $filename_full,$_fps else o $filename_full,70 fi +fi +e "\r"$_vt100_g" $ "${example$nex}" (done in "$_vt100_n${etime}"s"$_vt100_g")."$_vt100_n +crop 5,5,{w-6},{h-6} +frame 3%,3%,255 rr2d 440,440,0,3 drop_shadow 2,2,2 +if $_is_animated rr2d 230,230,0,3 else rr2d 300,300,0,3 fi +100%,100%,1,3,245 blend[^-1] .,alpha,1,1 rm. +if $_is_animated o $filename_thumb,$_fps else o $filename_thumb,60 fi +rm +if $is_input +image.jpg _gallery +rr2d $width,$height,0,5 c 0,255 +to "Input",2%,2%,6% +- 255 r $width,$height,1,3,0,0,0.5,0.5 + 255 +o $filename_original,60 +crop 5,5,{w-6},{h-6} +frame 3%,3%,255 rr2d 440,440,0,3 drop_shadow 2,2,2 +if $_is_animated rr2d 230,230,0,3 else rr2d 300,300,0,3 fi +100%,100%,1,3,245 blend[^-1] .,alpha,1,1 rm. +o $filename_thumb_original,60 +rm +fi +} fi +is_samesize=0 +l[] { +$filename_full +width,height:=round([w,h]*(max(w,h)<300?1.75:1)) +if isfile(['{/${filename}_original}']) $filename_original is_samesize:=w==w#0" && "h==h#0 fi +rm +} +if !$is_samesize filename_original=$filename_full fi +if !($col%$nb_cols) html=${html}" \n" fi +if $nb_examples==1 counter= +else counter=" "[{$>+1}/$nb_examples]"" +fi +html_etime= +if narg($etime) html_etime="
(generated in "${etime}"s)" fi +html_codesample= +if $is_codesample +html_codesample="\n
""\n
\n"
+it[] $url_codesample html_codesample=${html_codesample}{t} rm.
+html_codesample=${html_codesample}"\n
\n""
\n""[ Source code ]

\n" +fi +if ['$_label']==0 _label=$command$counter else ('$_label') replace_str. "~"," " _label={t} rm. fi +if $is_input +html=${html}" \n" +else +html=${html}" \n" +fi +nex+=1 +col:=($col+1)%$nb_cols +if !$col html=${html}" \n" fi +} +fi +rm +} +} +if $col html=${html}" \n" fi +html=${html}"
\n"" \""gallery_$command$nex"\"
"${_label}${html_codesample}"
\n""
\n"" \""gallery_$command$nex"\"\n""
\n""
Command: ""$ gmic "${replaced_example$nex}""${html_etime}"
\n"" \""gallery_$command$nex"\"""
"${_label}${html_codesample}"
\n""
\n"" \""gallery_$command$nex"\"\n""
\n""
Command: ""$ gmic "${replaced_example$nex}""${html_etime}"

\n"${html_menu}"
"\n" "\n" " +('$html') ot. $category.html rm. +} +rm +x "ln -fs artistic.html index.html" +x "ln -fs "$HOME/work/src/gmic/html/header1.html" ." +x "ln -fs "$HOME/work/src/gmic/html/footer.html" ." +if $1 +e "\n * Transfer gallery on G'MIC server.\n" +x "lftp sftp://"$GMIC_LOGIN":@ovh -e \"mirror -eRL . /home/"$GMIC_LOGIN"/www/gmic/gallery ; quit\"" +fi +e " * All done!\n" +_gallery : +foreach { +if ${-_is_mesh3d} +r3d 1,1,0,-80 r3d 0,1,0,30 +animate3d 20,0,5,0,1.5,0 s z +rv[1--2] +else +if w>8192 z 0,8191 elif h>8192 rows 0,8191 fi +n 0,255 +fi +} +if !$_is_animated ++__gallery +if w>1024 r:=round(1024*100/w,0.1) r[^-1] $r%,$r%,1,100%,2 fi rm. +fi +foreach { +if s==1 r {w},{h},1,3 +elif s==4 drgba +else r {w},{h},1,3,0 fi +if w<=h" && "h<256 r2dy 256,2 elif h<=w" && "w<256 r2dx 256,2 fi +if w<=h" && "h>620 r2dy 620,2 elif h<=w" && "w>620 r2dx 620,2 fi +if h<48 r 100%,48 fi +if w<48 r 48,100% fi +if $_is_animated" && "(w>480" || "h>480) rr2d 480,480,0,2 fi +frame 1,1,0 frame 4,4,255 +} +if $_is_animated +- 255 r ${-max_wh},1,3,0,0,0.5,0.5 + 255 +else +- 255 __gallery + 255 +if w<256 - 255 r 256,100%,1,100%,0,0,0.5,0.5 + 255 fi +if h<256 - 255 r 100%,256,1,100%,0,0,0.5,0.5 + 255 fi +fi +__gallery : +if $!==2 if w>h a y else a x fi +else montage A +fi +update_gmicol : +e[^-1] "Generate XML file and thumbnails for the G'MIC Online website." +filename=$_path_rc/update$_version.gmic +if !isfile('$filename') up fi +rm it $filename +m "parse_gui_trigger_gmicol : _update_gmicol $*" +v + +parse_gui. gmicol v - +um parse_gui_trigger_gmicol +ot. gmicol.xml +rm. +m "parse_gui_trigger_thumbnails : _update_gmicol $*" +v + w[] parse_gui thumbnails v - +um parse_gui_trigger_thumbnails +_update_gmicol : +nmd 3,"About/♥ Support Us ! ♥","About/About G'MIC","About/Friends Hall of Fame","Arrays & Tiles/Annular Steiner Chain Round Tile","Arrays & Tiles/Array [Faded]","Arrays & Tiles/Array [Mirrored]","Arrays & Tiles/Array [Random Colors]","Arrays & Tiles/Array [Random]","Arrays & Tiles/Array [Regular]","Arrays & Tiles/Ascii Art","Arrays & Tiles/Chessboard","Arrays & Tiles/Dices","Arrays & Tiles/Grid [Cartesian]","Arrays & Tiles/Grid [Hexagonal]","Arrays & Tiles/Grid [Triangular]","Arrays & Tiles/Ministeck","Arrays & Tiles/Puzzle","Arrays & Tiles/Taquin","Arrays & Tiles/Tiled Isolation","Arrays & Tiles/Tiled Normalization","Arrays & Tiles/Tiled Parameterization","Arrays & Tiles/Tiled Random Shifts","Arrays & Tiles/Tiled Rotation","Artistic/Angoisse Anguish","Artistic/Aurora","Artistic/Blockism","Artistic/Bokeh","Artistic/Cartoon","Artistic/Circle Abstraction","Artistic/Color Abstraction Paint","Artistic/Colored Pencils","Artistic/Comic Book","Artistic/Cubism","Artistic/Cutout","Artistic/Diffusion Tensors","Artistic/Dream Smoothing","Artistic/Ellipsionism","Artistic/Felt Pen","Artistic/Finger Paint","Artistic/Fractalize","Artistic/Ghost","Artistic/Graphic Boost","Artistic/Graphic Novel","Artistic/Hard Sketch","Artistic/Highlight Bloom","Artistic/Hope Poster","Artistic/Hough Sketch","Artistic/Illustration Look","Artistic/Kuwahara","Artistic/Lylejk's Painting","Artistic/Make Squiggly","Artistic/Morphology Painting","Artistic/Paint With Brush","Artistic/Painting","Artistic/Pen Drawing","Artistic/Photoillustration","Artistic/Polygonize [Delaunay]","Artistic/Polygonize [Energy]","Artistic/Poster Edges","Artistic/Posterize","Artistic/Posterized Dithering","Artistic/Quadtree Variations","Artistic/Rodilius","Artistic/Sharp Abstract","Artistic/Simple Noise Canvas","Artistic/Skeletik","Artistic/Sketch","Artistic/Smooth Abstract","Artistic/Stylize","Artistic/Vector Painting","Artistic/Warhol","Artistic/Whirl Drawing","Black & White/B&W Stencil","Black & White/Black & White","Black & White/Charcoal","Black & White/Colorize [with Colormap]","Black & White/Colorize Lineart [Auto-Fill]","Black & White/Colorize Lineart [Smart Coloring]","Black & White/Desaturate Norm","Black & White/Dithering","Black & White/Emboss","Black & White/Engrave","Black & White/Freaky B&W","Black & White/Ink Wash","Black & White/Multi-Layer Etch","Black & White/Pencil","Black & White/Pencil Portrait","Black & White/Stamp","Black & White/Threshold Etch","Colors/Abstraction","Colors/Auto Balance","Colors/Basic Adjustments","Colors/Boost Chromaticity","Colors/Boost-Fade","Colors/Brightness","Colors/Channel Processing","Colors/CMYK Tone","Colors/Color Balance","Colors/Color Blindness","Colors/Color Grading","Colors/Color Presets","Colors/Color Temperature","Colors/Colormap","Colors/Contrast","Colors/Customize CLUT","Colors/Dark Sky","Colors/Equalize HSI-HSL-HSV","Colors/Equalize HSV","Colors/HSL Adjustment","Colors/HSV Select","Colors/Hue Lighten-Darken","Colors/LMS Adjustment","Colors/Local Contrast","Colors/Metallic Look","Colors/Mixer [CMYK]","Colors/Mixer [HSV]","Colors/Mixer [Lab]","Colors/Mixer [PCA]","Colors/Mixer [RGB]","Colors/Mixer [YCbCr]","Colors/Normalize Brightness","Colors/Retinex","Colors/Retro Fade","Colors/RGB Tone","Colors/Saturation EQ","Colors/Select-Replace Color","Colors/Selective Desaturation","Colors/Sepia","Colors/Simulate Film","Colors/Softlight","Colors/Specific Saturation","Colors/Temperature Balance","Colors/Tone Presets","Colors/Tune HSV Colors","Colors/User-Defined","Colors/Vintage Style","Colors/Zone System","Contours/Convolve","Contours/Curvature","Contours/Difference of Gaussians","Contours/Distance Transform","Contours/Edge","Contours/Edges","Contours/Edges Offsets","Contours/Gradient Norm","Contours/Gradient RGB","Contours/Isophotes","Contours/Laplacian","Contours/Local Orientation","Contours/Morphological Filter","Contours/Segmentation","Contours/Skeleton","Contours/Super-Pixels","Contours/Thin Edges","Deformations/Breaks","Deformations/Cartesian Transform","Deformations/Circle Transform","Deformations/Conformal Maps","Deformations/Continuous Droste","Deformations/Crease","Deformations/Distort Lens","Deformations/Drop Water","Deformations/Equirectangular to Nadir-Zenith","Deformations/Euclidean - Polar","Deformations/Fish-Eye","Deformations/Flower","Deformations/Kaleidoscope [Blended]","Deformations/Kaleidoscope [Polar]","Deformations/Kaleidoscope [Reptorian-Polar]","Deformations/Kaleidoscope [Symmetry]","Deformations/Logarithmic Distortion","Deformations/Moon2panorama","Deformations/Perspective","Deformations/Pixel Push","Deformations/Point Warp","Deformations/Polar Transform","Deformations/Quadrangle","Deformations/Raindrops","Deformations/Random","Deformations/Reflection","Deformations/Ripple","Deformations/Seamcarve","Deformations/Sinusoidal Water Distortion","Deformations/Sphere","Deformations/Spherize","Deformations/Square to Circle","Deformations/Stereographic Projection","Deformations/Symmetrize","Deformations/Textured Glass","Deformations/Twirl","Deformations/Water","Deformations/Wave","Deformations/Wind","Deformations/Zoom","Degradations/Add Grain","Degradations/Blur [Angular]","Degradations/Blur [Bloom]","Degradations/Blur [Depth-Of-Field]","Degradations/Blur [Gaussian]","Degradations/Blur [Glow]","Degradations/Blur [Linear]","Degradations/Blur [Multidirectional]","Degradations/Blur [Radial]","Degradations/Blur [Splinter]","Degradations/Chromatic Aberrations","Degradations/CRT Sub-Pixels","Degradations/Dirty","Degradations/Flip & Rotate Blocks","Degradations/Fragment Blur","Degradations/JPEG Artefacts","Degradations/Lomo","Degradations/Mess with Bits","Degradations/Noise [Additive]","Degradations/Noise [Perlin]","Degradations/Noise [Spread]","Degradations/Old-Movie Stripes","Degradations/Oldschool 8bits","Degradations/Pixel Sort","Degradations/Rain & Snow","Degradations/Random Shade Stripes","Degradations/Rebuild From Similar Blocks","Degradations/Scanlines","Degradations/Self Glitching","Degradations/Streak","Degradations/UltraWarp++++","Degradations/Visible Watermark","Degradations/Warp by Intensity","Details/Constrained Sharpen","Details/DCP Dehaze","Details/Details Equalizer","Details/Dynamic Range Increase","Details/Easy Skin Retouch","Details/Emboss-Relief","Details/Equalize Local Histograms","Details/Freaky Details","Details/High Pass","Details/Local Contrast Enhancement","Details/Local Normalization","Details/Local Processing","Details/Local Variance Normalization","Details/Magic Details","Details/Make Up","Details/Mighty Details","Details/Portrait Retouching","Details/Pyramid Processing","Details/Quick Tonemap","Details/Sharpen [Deblur]","Details/Sharpen [Gold-Meinel]","Details/Sharpen [Gradient]","Details/Sharpen [Hessian]","Details/Sharpen [Inverse Diffusion]","Details/Sharpen [Multiscale]","Details/Sharpen [Octave Sharpening]","Details/Sharpen [Richardson-Lucy]","Details/Sharpen [Shock Filters]","Details/Sharpen [Texture]","Details/Sharpen [Tones]","Details/Sharpen [Unsharp Mask]","Details/Sharpen [Whiten]","Details/Simple Local Contrast","Details/Spotify","Details/Texture","Details/Texture Enhance","Details/Tone Enhance","Details/Tone Mapping","Details/Tone Mapping [Fast]","Details/YAG Effect","Frames/Droste","Frames/Frame [Blur]","Frames/Frame [Cube]","Frames/Frame [Fuzzy]","Frames/Frame [Mirror]","Frames/Frame [Painting]","Frames/Frame [Pattern]","Frames/Frame [Regular]","Frames/Frame [Round]","Frames/Frame [Smooth]","Frames/Old Photograph","Frames/Polaroid","Frames/Tunnel","Frames/Vignette","Frequencies/Bandpass","Frequencies/Fourier Analysis","Frequencies/Fourier Transform","Frequencies/Fourier Watermark","Lights & Shadows/Burn","Lights & Shadows/Contrast Swiss Mask","Lights & Shadows/Dodge and Burn","Lights & Shadows/Drop Shadow","Lights & Shadows/Drop Shadow 3D","Lights & Shadows/Equalize Light","Lights & Shadows/Equalize Shadow","Lights & Shadows/Guided Light Rays","Lights & Shadows/Illuminate 2D Shape","Lights & Shadows/Light Glow","Lights & Shadows/Light Leaks","Lights & Shadows/Light Patch","Lights & Shadows/Light Rays","Lights & Shadows/Pop Shadows","Lights & Shadows/Relief Light","Lights & Shadows/Shadow Patch","Patterns/Bayer Filter","Patterns/Box Fitting","Patterns/Camouflage","Patterns/Canvas","Patterns/Canvas Texture","Patterns/Clouds","Patterns/Cracks","Patterns/Crystal","Patterns/Crystal Background","Patterns/Denim Texture","Patterns/Fibers","Patterns/Freqy Pattern","Patterns/Halftone","Patterns/Halftone Shapes","Patterns/Hearts","Patterns/Hedcut (Experimental)","Patterns/Lava","Patterns/Marble","Patterns/Maze","Patterns/Mineral Mosaic","Patterns/Mosaic","Patterns/Op Art","Patterns/Paper Texture","Patterns/Periodic Dots","Patterns/Plaid","Patterns/Polka Dots","Patterns/Random Color Ellipses","Patterns/Random Pattern","Patterns/Rays","Patterns/Reptile","Patterns/Resynthetize Texture [FFT]","Patterns/Resynthetize Texture [Patch-Based]","Patterns/Rorschach","Patterns/Satin","Patterns/Seamless Deco","Patterns/Seamless Turbulence","Patterns/Shock Waves","Patterns/Soft Random Shades","Patterns/Sponge","Patterns/Stained Glass","Patterns/Stars","Patterns/Stencil","Patterns/Strip","Patterns/Tetris","Patterns/Triangular Pattern","Patterns/Truchet","Patterns/Turbulent Halftone","Patterns/Voronoi","Patterns/Weave","Patterns/Whirls","Rendering/3D Blocks","Rendering/3D Colored Object","Rendering/3D Elevation","Rendering/3D Extrusion","Rendering/3D Image Object","Rendering/3D Lathing","Rendering/3D Random Objects","Rendering/Ball","Rendering/Circle Art","Rendering/Construction Material Texture","Rendering/Disco","Rendering/Equation Plot [Parametric]","Rendering/Equation Plot [Y=f(X)]","Rendering/Gradient [Corners]","Rendering/Gradient [Custom Shape]","Rendering/Gradient [from Line]","Rendering/Gradient [Linear]","Rendering/Gradient [Radial]","Rendering/Gradient [Random]","Rendering/Hair Locks","Rendering/Hypotrochoid","Rendering/Kitaoka Spin Illusion","Rendering/Lightning","Rendering/Lissajous","Rendering/Mandelbrot - Julia Sets","Rendering/Nebulous","Rendering/Neon Lightning","Rendering/Newton Fractal","Rendering/Plasma","Rendering/Popcorn Fractal","Rendering/Pseudorandom Noise","Rendering/Pythagoras Tree","Rendering/Quick Copyright","Rendering/Rainbow","Rendering/Shade Bobs","Rendering/Sine Curve","Rendering/Snowflake 2","Rendering/Spiral","Rendering/Spiral RGB","Rendering/Superformula","Rendering/Symmetric 2D Shape","Rendering/Thorn Fractal - Secant Sea","Rendering/Tree","Rendering/Turbulence","Rendering/Twisted Rays","Rendering/Wiremap","Repair/Anti Alias","Repair/Banding Denoise","Repair/Bayer Reconstruction","Repair/Clean Text","Repair/Compression Blur","Repair/Deinterlace","Repair/Deinterlace2x","Repair/Denoise","Repair/Denoise Smooth","Repair/Denoise Smooth Alt","Repair/Descreen","Repair/Despeckle","Repair/Iain Noise Reduction 2019","Repair/Iain's Fast Denoise","Repair/Inpaint [Holes]","Repair/Inpaint [Morphological]","Repair/Inpaint [Multi-Scale]","Repair/Inpaint [Patch-Based]","Repair/Inpaint [Transport-Diffusion]","Repair/JPEG Smooth","Repair/Local Similarity Mask","Repair/Moire Removal","Repair/Pixel Denoise","Repair/Recursive Median","Repair/Red-Eye Attenuation","Repair/Remove Hot Pixels","Repair/Repair Scanned Document","Repair/Smooth [Anisotropic]","Repair/Smooth [Antialias]","Repair/Smooth [Bilateral]","Repair/Smooth [Block PCA]","Repair/Smooth [Diffusion]","Repair/Smooth [Geometric-Median]","Repair/Smooth [Guided]","Repair/Smooth [IUWT]","Repair/Smooth [Mean-Curvature]","Repair/Smooth [Median]","Repair/Smooth [NL-Means]","Repair/Smooth [Patch-Based]","Repair/Smooth [Patch-PCA]","Repair/Smooth [Perona-Malik]","Repair/Smooth [Selective Gaussian]","Repair/Smooth [Skin]","Repair/Smooth [Thin Brush]","Repair/Smooth [Total Variation]","Repair/Smooth [Wavelets]","Repair/Smooth [Wiener]","Repair/Solidify","Repair/Unpurple","Repair/Unquantize [JPEG Smooth]","Repair/Unstrip","Repair/Upscale [DCCI2x]","Repair/Upscale [Diffusion]","Repair/Upscale [Edge]","Repair/Upscale [Scale2x]" +k[${}] +sort_list +,n +update_reference_html : check "isbool(${1=0})" +path_current=${-path_current} path_ok=$HOME/work/src/gmic/html/reference/ +if ['$path_current']!=['$path_ok'] +error[0--3] "Command 'update_reference_html: Command run from wrong path: '"$path_current"', ""should be '"$path_ok"'." +fi +x "rm -f *.pdf" +rm +e[^-1] "Generate reference documentation pages for the G'MIC website." +it $HOME/work/src/gmic/src/gmic_stdlib.gmic +a y +x "mkdir -p img" +_parse_cli_images_path="img/" ++parse_cli images +parse_cli html +rm +x "ln -fs "$HOME/work/src/gmic/html/header1.html" ." +x "ln -fs "$HOME/work/src/gmic/html/footer.html" ." +x "cp -rf "$HOME/work/src/gmic-community/reference/images" ." +reference html,$HOME/work/src/gmic-community/reference +if $1 +e "\n > Transfer reference documentation on G'MIC server.\n" +x "lftp sftp://"$GMIC_LOGIN":@ovh -e \"mirror -RL . /home/"$GMIC_LOGIN"/www/gmic/reference ; quit\"" +fi +e "\n > All done.\n" +update_tutorial_html : check "isbool(${1=0})" +path_current=${-path_current} path_ok=$HOME/work/src/gmic/html/tutorial/ +if ['$path_current']!=['$path_ok'] +error[0--3] "Command 'update_tutorial_html: Command run from wrong path: '"$path_current"', ""should be '"$path_ok"'." +fi +rm +e[^-1] "Generate tutorial pages for the G'MIC website." +path_tutorial=$HOME/work/src/gmic-community/tutorial +use_vt100 +e " > Build directory structure." +x "ln -fs "$HOME/work/src/gmic/html/header1.html" ." +x "ln -fs "$HOME/work/src/gmic/html/footer.html" ." +x "mkdir -p images scripts" +files 5,$path_tutorial/* +l[] { +({'${}'}:y) s -,{','} +for $! { +file={0,t} rm[0] +basename $file basename=${} 0 => $basename ext={`lowercase(['{x}'])`} rm. +if ['$basename']!='img' +if isdir(['$file']) files 5,$file/* ({'${}'}:y) s. -,{','} +elif s=['$ext'];s=='png'||s=='jpg'||s=='jpeg'||s=='gif'||s=='mp4'||s=='svg'||s=='webm' +x "cp -f \""$file"\" images/" +elif s=['$ext'];s=='gmic'||s=='py' +x "cp -f \""$file"\" scripts/" +elif s=['$ext'];s=='gmd' +it[] $file +ot. $basename rm. +fi +fi +} +} +files 0,*.gmd files=${} +repeat narg({/$files}) { +arg0 $>,$files file=${} +e " > Generate '"$_vt100_c$file$_vt100_n"'." +t0=$| +it $file +replace_str. "../listmanip/","" +replace_str. "../images/","images/" +gmd2html 2 +ot {n} rm. +t1=$| +e "\r > Generate '"$_vt100_c$file$_vt100_n"' (done in "$_vt100_g{_round($t1-$t0,0.1)}"s"$_vt100_n")." +} +x "rm -f *.gmd" +if $1 +e "\n > Transfer tutorial pages on G'MIC server.\n" +x "lftp sftp://"$GMIC_LOGIN":@ovh -e \"mirror -RL . /home/"$GMIC_LOGIN"/www/gmic/tutorial ; quit\"" +fi +e "\n > All done.\n" +strings2ts : skip "${1=}" +e[^-1] "Regenerate translation file by merging file '$1' and source/translated strings '$2/$3'." +if narg($1) l[] { +it "$1" +lang={`" +lang = vector256(); +p = find(#-1,'language=\"'); +p>=0?( +p+=10; +q = find(#-1,'\">',p); +q>=0?copy(lang,i[p],q - p); +); lang"`} +e " > File '$1', detected language : "$lang. +s -,10 +N0=0 +foreach { +autocrop {'" "'} +if s=crop();find(s,'')>=0" && "find(s,'')>=0 +discard {''} discard {''} src$N0={t} +elif s=crop();find(s,'')>=0" && "find(s,'')>=0 +discard {''} discard {''} dest$N0={t} +N0+=1 +fi +} +rm +} else N0=0 lang= +fi +if $N0 e " > File '$1' contains "$N0" strings." fi +l[] { it "$2" s -,10 N1=$! repeat $! { nsrc$>={$>,t} } rm } +l[] { it "$3" replace_str " ;",";" s -,10 N2=$! repeat $! { ndest$>={$>,t} } rm } +if $N1!=$N2 error[0--3] "Command 'strings2ts': Number of lines do not match in files '$2' and '$3'." fi +e " > Files '$2' and '$3' contain "$N1" strings." +l[] { repeat $N1 { ({'${ndest$>}'}) => ${nsrc$>} } y } +repeat $N0 { rmn ${src$>} } +if $N0 i[0] 0 l[0] { rm repeat $N0 { i ({'${dest$>}'}) => ${src$>} } y } fi +foreach { +src={n} dest={t} +if lowercase(['$src'])==lowercase(['$dest']) rm fi +} +sort_list +,n +e " > "$!" strings remain after cleaning/merging ("{$!-$N0}" new)." +foreach { +_strings2ts_src {n} src=${} +_strings2ts_dest {t} dest=${} +rm +({'" "\n" "$src""\n" "$dest""\n" "\n\n'}) +} +i[0] ({'""\n""\n""\n" "\n" FilterTextTranslator"\n\n'}) +({'" "\n""\n'}) +y a y +_strings2ts_src : +({'"$*"'}) +replace_str. "°","°" +replace_str. "à","à" +replace_str. "&","&" +replace_str. "<","<" +replace_str. ">",">" +replace_str. "\"",""" +replace_str. "'","'" +u {t} +rm. +_strings2ts_dest : +({'"$*"'}) html2utf8. +replace_str. "°","°" +replace_str. "à","à" +replace_str. "&","&" +replace_str. "<","<" +replace_str. ">",">" +replace_str. "\"",""" +replace_str. "'","'" +u {t} +rm. +parse_gui_parseparams_zart : u 1 +parse_gui_trigger_zart : +foreach { +=> {`s=[['{n}'],0];p=find(s,_'/',size(s)-1,0);p>=0?(p=find(s,_'/',p-1,0);p>0?copy(s,s[p+1],size(s)-p));s`} +} +sort_list +,n +parse_gui_zart : +e " >> Generate output, in 'zart' mode.\n" ++e "" ++e "\n" +current_group= +N:=$_nb_filters-1 +repeat $_nb_filters { f=$> +e "\r >> "$_vt100_c[#$f/$N]$_vt100_n" "{`s=vector48(_'" "');copy(s,['${_f${f}_path}${_f${f}_name}']);s`} +0 => {`s=['${_f${f}_path}'];s[0,size(s)-1]`} path={b} rm. +if ['$current_group']!=['$path'] +if ['$current_group']!=0 +e "\n" fi ++e "" ++e "\n" +current_group=$path +fi +_parse_gui_zart[] ${_f${f}_name} fname=${} ++e "" ++e "" ++e " "${_f${f}_command_preview}" $""*" +repeat ${_f${f}_nb_params} { p=$> +_parse_gui_zart ${_f${f}_p{$p}_name} name=${} +type=${_f${f}_p{$p}_type} +nbargs=${_f${f}_p{$p}_nb_args} +arg0= repeat $nbargs { ('${_f${f}_p${p}_a$>}') autocrop. {'\"'} _parse_gui_zart {t} arg$>=${} rm. } +if ['$type']=='bool' +if lowercase(['$arg0'])=='false' arg0=0 elif lowercase(['$arg0'])=='true' arg0=1 elif !isnum($arg0) arg0=0 fi ++e " " +elif ['$type']=='choice' +default=0 n=0 args= +l[] { if isint($arg0) default=$arg0 n+=1 fi onfail } +c= repeat $nbargs-$n { a=$> args.=${c}"choice"$>"=\""${arg{$n+$a}}"\"" c=" " } ++e " " +elif ['$type']=='color' +if $nbargs==1" && "['$arg0'][0]==_'#' # Convert colors specified as '#RRGGBB[AA]' +l[] { ('$arg0') autocrop. {'#'} s x,-2 nbargs=$! repeat $! { a=$> hex2dec {$>,t} arg$a=${} } rm } +fi +args= c= repeat $nbargs { a=$> args.=$c${arg$a} c="," } ++e " " +elif s=['$type'];s=='int'" || "s=='float' ++e " <"$type" name=\""$name"\" default=\""$arg0"\" min=\""$arg1"\" max=\""$arg2"\" />" +elif ['$type']=='file'" || "['$type']=='filein'" || "['$type']=='fileout' ++e " " +elif ['$type']=='folder' ++e " " +elif ['$type']=='link' +align=-1 name= url= n=0 +l[] { if isnum($arg0) align=$arg0 n+=1 fi onfail } +if $nbargs-$n>1 name=${arg$n} url=${arg{$n+1}} +else url,name=${arg$n} +fi +if $align==0 align=left elif $align==1 align=right else align=center fi ++e " " +elif ['$type']=='note' +text={/$arg0} ++e " " +elif ['$type']=='point' ++e " " +elif ['$type']=='separator' ++e " " +elif ['$type']=='text' ++e " " +elif ['$type']=='value' ++e " " +else ++e " " +fi +} ++e "\n" +} +if narg($current_group) +e "" fi ++e "" +e "\r >> "${_vt100_g}{`s=vector64(_'" "');copy(s,'"Output done!"');s`}$_vt100_n +_parse_gui_zart : +l[] { +('"$*"') +replace_str "&","#amp;" +replace_str. "&","&" +replace_str. "<","<" +replace_str. ">",">" +replace_str. "\"",""" +replace_str "#amp;","&" +u {t} rm. +onfail u "" } +html2utf8 : +if h +eval " +ref(crop(),source); +ref(vector8(),svalue); +p = 0; +while (1, +p = p0 = find(source,'&#',p); +p<0?break(); +p+=2; +p>=size(source)?break(); +q = find(source,';',p); +q>p && q<=p+8 && !isnan(val=s2v(source,p))?( +copy(svalue,source[p],q-p); svalue[q-p] = 0; +val = s2v(svalue,0,1); +!isnan(val) && isint(val) && val>0?( +val<=0x007f?( +i[p0++] = val; +):val<=0x07ff?( +i[p0++] = (val>>6)|0xc0; +i[p0++] = (val&0x3f)|0x80; +):val<=0xffff?( +i[p0++] = (val>>12)|0xe0; +i[p0++] = ((val>>6)&0x3f)|0x80; +i[p0++] = (val&0x3f)|0x80; +):( +i[p0++] = (val>>18)|0xf0; +i[p0++] = ((val>>12)&0x3f)|0x80; +i[p0++] = ((val>>6)&0x3f)|0x80; +i[p0++] = (val&0x3f)|0x80; +); +copy(i[p0],-1,q-p0+1,1,0); +p = q + 1; +); +); +)" +discard. -1 +fi +utf82html : +if h +eval " +write_seq() = ( copy(res[q],'&#'); q+=2; s = v2s(val); l = find(s,0); copy(res[q],s,l); q+=l; res[q++]=_';' ); +ref(vector(#4*wh),res); +q = 0; +repeat (wh,p, +i = i[p]; +!(i&0x80)?( +res[q++] = i; +):(i&0xe0)==0xc0?( +val = (i&0x1f)<<6; i = i[p + 1]; val|= (i&0x3f); +write_seq(); +):(i&0xf0)==0xe0?( +val = (i&0xf)<<12; i = i[p + 1]; val|= (i&0x3f)<<6; i = i[p + 2]; val|= (i&0x3f); +write_seq(); +):(i&0xf8)==0xf0?( +val = (i&0x7)<<18; i = i[p + 1]; val|= (i&0x3f)<<12; i = i[p + 2]; val|= (i&0x3f)<<6; +i = i[p + 3]; val|= (i&0x3f); +write_seq(); +); +); +store('res',res,1,q)" +rm. $res +fi +_upload_filters_move : +m "move_filter : skip \"${""2=}\" nmd 3,\"$""1\" ind=${} +if $ind basename \"$""1\" =>[$ind] \"$""2\"/${} +else v 0 e[0--4] \"Cannot move unknown filter '\"${_vt100_r}\"$""1\"${_vt100_n}\"' +to '\"${_vt100_g}\"$""2\"${_vt100_n}\"'\" fi" +sort_list +,n +move_filter "Testing/Garagecoder/Anti Alias","Repair" +move_filter "Testing/Garagecoder/Auto Balance","Colors" +move_filter "Testing/Garagecoder/LMS Adjustment","Colors" +move_filter "Testing/Garagecoder/Compression Blur","Repair" +move_filter "Testing/Garagecoder/Emboss","Black & White" +move_filter "Testing/Garagecoder/JPEG Smooth","Repair" +move_filter "Testing/Garagecoder/Quick Tonemap","Details" +move_filter "Testing/Garagecoder/Normalize Brightness","Colors" +move_filter "Testing/Garagecoder/Sharpen [Gradient]","Details" +move_filter "Testing/Garagecoder/Sharpen [Tones]","Details" +move_filter "Testing/Garagecoder/Temperature Balance","Colors" +move_filter "Testing/Garagecoder/Unquantize [JPEG Smooth]","Repair" +move_filter "Testing/Garagecoder/Upscale [Edge]","Repair" +move_filter "Testing/Garagecoder/Wiremap","Rendering" +move_filter "Testing/Garagecoder/Smooth [Geometric-Median]","Repair" +move_filter "Testing/Gmic Tutorials/Hedcut (Experimental)","Patterns" +move_filter "Testing/Iain Fergusson/Easy Skin Retouch","Details" +move_filter "Testing/Iain Fergusson/Moire Removal","Repair" +move_filter "Testing/Iain Fergusson/Halftone Shapes","Patterns" +move_filter "Testing/Iain Fergusson/Simple Local Contrast","Details" +move_filter "Testing/Iain Fergusson/Turbulent Halftone","Patterns" +move_filter "Testing/Joan Rake/Deformations/Ultrawarp++++","Degradations" +move_filter "Testing/Naggobot/Blockism","Artistic" +move_filter "Testing/Reptorian/Blur [Splinter]","Degradations" +move_filter "Testing/Reptorian/Construction Material Texture","Rendering" +move_filter "Testing/Reptorian/Emboss-Relief","Details" +move_filter "Testing/Reptorian/Fragment Blur","Degradations" +move_filter "Testing/Reptorian/Kaleidoscope [Reptorian-Polar]","Deformations" +move_filter "Testing/Reptorian/Logarithmic Distortion","Deformations" +move_filter "Testing/Reptorian/Nebulous","Rendering" +move_filter "Testing/Reptorian/Pixel Push","Deformations" +move_filter "Testing/Reptorian/Point Warp","Deformations" +move_filter "Testing/Reptorian/Popcorn Fractal","Rendering" +move_filter "Testing/Reptorian/Pseudorandom Noise","Rendering" +move_filter "Testing/Reptorian/Sinusoidal Water Distortion","Deformations" +move_filter "Testing/Samj/Arrays & Tiles/Annular Steiner Chain Round Tile","Arrays & Tiles" +move_filter "Testing/Samj/Arrays & Tiles/Reptile","Patterns" +move_filter "Testing/Samj/Artistic/Angoisse Anguish","Artistic" +move_filter "Testing/Samj/Artistic/Chalk It Up [Fr]","Artistic" +move_filter "Testing/Samj/Artistic/Barbouillage Paint Daub","Artistic" +move_filter "Testing/Samj/Artistic/Skeletik","Artistic" +move_filter "Testing/Samj/Patterns/Denim Texture","Patterns" +move_filter "Testing/Samj/Patterns/Soft Random Shades","Patterns" +move_filter "Testing/Samj/Rendering/Pythagoras Tree","Rendering" +move_filter "Testing/Samj/Rendering/Snowflake 2","Rendering" +move_filter "Testing/Samj/Rendering/Twisted Rays","Rendering" +move_filter "Testing/Souphead/Disco","Rendering" +move_filter "Testing/Souphead/Moon2panorama","Deformations" +move_filter "Testing/Souphead/Spiral RGB","Rendering" +move_filter "Testing/Souphead/Kitaoka Spin Illusion","Rendering" +move_filter "Testing/Zonderr/Spiral","Rendering" +um move_filter +upload_filters : +e[^-1] "Upload filter definition file on G'MIC server.\n" +rm +x "cd "$HOME"/work/src/gmic && git pull" +x "cd "$HOME"/work/src/gmic-community && git pull" +(320,321,322,323,324,325,326,327,$_version) sort. discard. store. compat +files $HOME/work/src/gmic-community/include/*.gmic +files=${},$HOME/work/src/gmic/src/gmic_stdlib.gmic +repeat narg($files) { l[] { +file=${"arg0 $>,"$files} +it[] $file +basename $file basename=${} +if ['$basename']=='sylvie_alexandre.gmic' +s +,{'"#@gui "'} i[1--2:2] ('"#@gui ________Testing\n#@gui Samj\n"') y a y +elif s=['$basename'];s=='template.gmic' +rm 0 +fi +} } +i[1--2] ('"\n#@gui _________________\n"') y a y ++l. { +e "** Generate filter update file." +m "parse_gui_trigger_update : _upload_filters_move" +v + parse_gui. update v - +um parse_gui_trigger_update +e "** Upload filter update." +ot ${_path_rc}update$_version.gmic +if "d = date(3); h = date(4); h>=7 && d>=1 && d<=5" url=http://bit.ly/2uaBRMB +else url=http://bit.ly/2uaBRMB +fi +replace_str "David Tschumperlé","David Tschumperlé" +o cimgz:/tmp/update$_version.gmic,uint8 +$compat +repeat h { +v:=i[$>] +_upload[] ${_path_rc}update$_version.gmic,plain_update$v.gmic,1 +_upload[] /tmp/update$_version.gmic,update$v.gmic,1 +} +rm +} ++l. { +e "** Generate JSON filters file." +v + parse_gui. json v - +e "** Upload JSON filters." +ot ${_path_rc}/update$_version.json +$compat +repeat h { +v:=i[$>] +_upload[] ${_path_rc}/update$_version.json,update$v.json,1 +} +rm +} ++l. { +e "** Generate filter listing." +v + parse_gui. list v - +ot /tmp/gui_filters.txt +rm +} +rm +_upload : skip "${2=""}","${3=0}" +if narg("$2") out="$2" else basename "$1" out=${} fi +if !narg($GMIC_LOGIN) +GMIC_LOGIN=${"gmic_ftp 0"} +GMIC_PASSWD=${"gmic_ftp 1"} +fi +if narg($GMIC_LOGIN) +x $3,"lftp sftp://"$GMIC_LOGIN":@ovh -e \"put -O /home/"$GMIC_LOGIN"/www/gmic/ ""\\\"$1\\\" -o \\\""$out"\\\"; quit\" >/dev/null" +fi +upload_binaries : check "isbool(${2=1})" +is_pre=${"strcontains $1,_pre"} +N=0 +file$N=gmic_$1_debian10_buster_amd64.deb N+=1 +file$N=gmic_$1_debian11_bullseye_amd64.deb N+=1 +file$N=gmic_$1_debian12_bookworm_amd64.deb N+=1 +file$N=gmic_$1_ubuntu20-04_focal_amd64.deb N+=1 +file$N=gmic_$1_ubuntu21-10_impish_amd64.deb N+=1 +file$N=gmic_$1_ubuntu22-04_jammy_amd64.deb N+=1 +file$N=gmic_$1_gimp2.10_debian10_buster_amd64.zip N+=1 +file$N=gmic_$1_gimp2.10_debian11_bullseye_amd64.zip N+=1 +file$N=gmic_$1_gimp2.10_debian12_bookworm_amd64.zip N+=1 +file$N=gmic_$1_gimp2.10_ubuntu20-04_focal_amd64.zip N+=1 +file$N=gmic_$1_gimp2.10_ubuntu21-10_impish_amd64.zip N+=1 +file$N=gmic_$1_gimp2.10_ubuntu22-04_jammy_amd64.zip N+=1 +file$N=gmic_$1_cli_win64.zip N+=1 +file$N=gmic_$1_lib_win64.zip N+=1 +file$N=gmic_$1_qt_win64.zip N+=1 +file$N=gmic_$1_gimp2.10_win64.zip N+=1 +file$N=gmic_$1_gimp2.10_win64.exe N+=1 +if !$2 +e[0--3] "List URLs of released binaries ($1) from the G'MIC web server.\n" +repeat $N { +file=${file$>} +is_win=${strcontains[]" "$file,win} +if $is_win folder="windows" else folder="linux" fi +e "http://gmic.eu/files/"$folder/$file +} +e "" +else +e[0--3] "Upload released binaries ($1) on the G'MIC web server." +t0=$| n=0 t=0 +e "- Waiting for binary files to be build." +do +repeat $N { +file=${file$>} +if isfile(['{/$file}']) +strreplace $file,_$1_,_ +file_short=${} +is_win=${strcontains[]" "$file,win} +if $is_win folder="windows" else folder="linux" fi +e "- Upload file '"$file"' to 'https://gmic.eu/files/prerelease/"$file_short"'." +_upload[] $file,"files/prerelease/"$file_short +if !$is_pre +e "- Upload file '"$file"' to 'https://gmic.eu/files/"$folder/$file"'." +_upload[] $file,"files/"$folder/$file +fi +file$>= n+=1 +fi +} +if $n<$N +if !($t%4) +remaining= sep= +repeat $N { if narg(${file$>}) remaining.=${sep}${file$>} sep=", " fi } +e "- Waiting for files: "$remaining"." +fi +wait 30000 t+=1 +fi +while $n<$N" && "$|<$t0+60*60*6 +if $n<$N e "- Partial uploads done (timeout reached)." +else e "- All uploads done !" +fi +fi +_update_header_html : check "narg(${1=}) && ${2=0}>0 && isbool(${3=0})" +filename="$1" +l[] { +it[] $filename +s +,{'\n'} +foreach { if h>=64 ++autocrop {'" "'} autocrop. {'\t'} +if "find(#0,['Latest stable version: '])>=0" +is_gmic:="find(#-1,'gmic.eu')>=0" +is_cimg:="find(#-1,'cimg.eu')>=0" +if !$is_gmic" && "!$is_cimg error "Cannot determine CImg or G'MIC header file." fi ++l. { +s -,{'>'} +if {2,"i[0]>=_'0' && i[0]<=_'9' && i[1]==_'.' && i[2]>=_'0' && i[2]<=_'9' && +i[3]==_'.' && i[4]>=_'0' && i[4]<=_'9'"} +sta={2,`crop(0,0,1,5)`} +fi +if $3 +x "date +%y%m%d%H >"${-path_tmp}/gmic_date it ${-path_tmp}/gmic_date discard. 10 date={t} rm. +pre=${strver\ $2}" ("{`s=['$date'];string(s[0,2],'/',s[2,2],'/',s[4,2])`}")" +else +sta=${strver\ $2} +fi +rm +} +rm[0] +if $is_gmic +i[0] ('" Latest stable version: """$sta""') +if $3 +i[1] ('"        ""Current pre-release: "$pre""') +fi +else +i[0] ('" Latest stable version: """$sta""') +if $3 +i[1] ('"        ""Current pre-release: "$pre""') +fi +fi +y +fi +rm. +fi } +a y +ot $filename +rm +} +#@cli v : eq. to 'verbose'. : (+) +#@cli verbose : level : { + | - } : (+) +#@cli : Set or increment/decrement the verbosity level. Default level is 0. +#@cli : (eq. to 'v').\n +#@cli : When 'level>0', G'MIC log messages are displayed on the standard error (stderr). +#@cli : Default value: 'level=1'. +#@cli wait : delay : (no arg) : (+) +#@cli : Wait for a given delay (in ms), optionally since the last call to 'wait'. +#@cli : or wait for a user event occurring on the selected instant display windows. +#@cli : 'delay' can be { <0=delay+flush events | 0=event | >0=delay }. +#@cli : Command selection (if any) stands for instant display window indices instead of image indices. +#@cli : If no window indices are specified and if 'delay' is positive, the command results +#@cli : in a 'hard' sleep during specified delay. +#@cli : Default value: 'delay=0'. +#@cli warn : _force_visible={ 0 | 1 },_message : (+) +#@cli : Print specified warning message, on the standard error (stderr). +#@cli : Command selection (if any) stands for displayed call stack subset instead of image indices. +#@cli w : eq. to 'window'. : (+) +#@cli window : _width[%]>=-1,_height[%]>=-1,_normalization,_fullscreen,_pos_x[%],_pos_y[%],_title : (+) +#@cli : Display selected images into an instant display window with specified size, normalization type, +#@cli : fullscreen mode and title. +#@cli : (eq. to 'w').\n +#@cli : If 'width' or 'height' is set to -1, the corresponding dimension is adjusted to the window +#@cli : or image size. +#@cli : Specify 'pos_x' and 'pos_y' arguments only if the window has to be moved to the specified +#@cli : coordinates. Otherwise, they can be avoided. +#@cli : 'width'=0 or 'height'=0 closes the instant display window. +#@cli : 'normalization' can be { -1=keep same | 0=none | 1=always | 2=1st-time | 3=auto }. +#@cli : 'fullscreen' can be { -1=keep same | 0=no | 1=yes }. +#@cli : You can manage up to 10 different instant display windows by using the numbered variants +#@cli : 'w0' (default, eq. to 'w'),'w1',...,'w9' of the command 'w'. +#@cli : Invoke 'window' with no selection to make the window visible, if it has been closed by the user. +#@cli : Default values: 'width=height=normalization=fullscreen=-1' and 'title=(undefined)'. +#@cli :: List Manipulation +#@cli k : eq. to 'keep'. : (+) +#@cli keep : (+) +#@cli : Keep only selected images. +#@cli : (eq. to 'k'). +#@cli : $ image.jpg split x keep[0-50%:2] append x +#@cli : $ image.jpg split x keep[^30%-70%] append x +#@cli kn : eq. to 'keep_named'. +kn : +e[^-1] "Keep images named '$*'." +nmd $"*" k[${}] +#@cli keep_named : "name1","name2",... +#@cli : Keep all images with specified names from the list of images. +#@cli : Remove all images if no images with those names exist. +#@cli : (eq. to 'kmn'). +keep_named : +e[^-1] "Keep images named '$*'." +nmd $"*" k[${}] +#@cli mv : eq. to 'move'. : (+) +#@cli move : position[%] : (+) +#@cli : Move selected images at specified position. +#@cli : Images are actually inserted between current positions 'position-1' and 'position'. +#@cli : (eq. to 'mv'). +#@cli : $ image.jpg split x,3 move[1] 0 +#@cli : $ image.jpg split x move[50%--1:2] 0 append x +#@cli nm : eq. to 'name'. : (+) +#@cli => : eq. to 'name'. : (+) +#@cli name : "name1","name2",...,"nameN" : (+) +#@cli : Set names of selected images. +#@cli : - If no explicit image selection is given, image selection is assumed to be '[-N--1]', where 'N' is the number of specified arguments. +#@cli : - If 'N' is higher than the number of images in selection, an error is thrown. +#@cli : - If 'N' is lower than the number of images in selection, image names are assigned in a periodic way, i.e. `name(selection[k]) = arg[k%N]`. +#@cli : (eq. to '=>' and 'nm'). +#@cli : $ image.jpg name image blur[image] 2 +#@cli : $$ +#@cli rm : eq. to 'remove'. : (+) +#@cli remove : (+) +#@cli : Remove selected images. +#@cli : (eq. to 'rm'). +#@cli : $ image.jpg split x remove[30%-70%] append x +#@cli : $ image.jpg split x remove[0-50%:2] append x +#@cli remove_duplicates +#@cli : Remove duplicates images in the selected images list. +#@cli : $ (1,2,3,4,2,4,3,1,3,4,2,1) split x remove_duplicates append x +remove_duplicates : +e[^-1] "Remove duplicates images in selected list of image$?." +repeat $! { +base=$> off=0 +repeat $!-$>-1 { +comp:=$base+1+$>-$off +if $comp>=$! break fi ++-[$base,$comp] abs. is_duplicate:=!is rm. +if $is_duplicate rm[$comp] off+=1 fi +} +} +#@cli remove_empty +#@cli : Remove empty images in the selected image list. +remove_empty : +e[^-1] "Remove empty images in selected list of image$?." +$!,1,1,1,"!w#x?x:-1" discard. -1 +if w rm[{^},-1] else rm. fi +#@cli rmn : eq. to 'remove_named'. +rmn : +e[^-1] "Remove images named '$*'." +nmd $"*" rm[${}] +#@cli remove_named : "name1","name2",... +#@cli : Remove all images with specified names from the list of images. +#@cli : Does nothing if no images with those names exist. +#@cli : (eq. to 'rmn'). +remove_named : +e[^-1] "Remove images named '$*'." +nmd $"*" rm[${}] +#@cli rv : eq. to 'reverse'. : (+) +#@cli reverse : (+) +#@cli : Reverse positions of selected images. +#@cli : (eq. to 'rv'). +#@cli : $ image.jpg split x,3 reverse[-2,-1] +#@cli : $ image.jpg split x,-16 reverse[50%-100%] append x +#@cli sort_list : _ordering={ + | - },_criterion +#@cli : Sort list of selected images according to the specified image criterion. +#@cli : Default values: 'ordering=+', 'criterion=i'. +#@cli : $ (1;4;7;3;9;2;4;7;6;3;9;1;0;3;3;2) split y sort_list +,i append y +sort_list : skip ${1=+},${2=i} +s0="descending" s1="ascending" +e[^-1] "Sort list of image$? in "${s{_'+'=='$1'}}" order, according to the image criterion '$2'." +if $! +if isin('$2','n','N') +op={`;'$1'=='-'?_'>':_'<'`} +if '$2'=='n' fn=lowercase else fn= fi +$!,1,1,1,"n = name(#x,1024); find(n,0)%1025" slen:=iM rm. # Largest name length. +eval " +const lm1 = l - 1; +const slen = "$slen"; +strcmp(n0,n1) = (for (k = 0, k0, +range = pop(); +lo = range[0]; +hi = range[1]; +pivot = int((lo + hi)/2); +ref(name(#pivot,slen),npivot); +while (lo,$2}) } a[$i--1] y +f. 'y' a[-2,-1] x sort. $1,y z. 1,1 +repeat h { nm$>={$>,n} =>[$>] sortlist$> } +repeat h { mv[sortlist{i(0,$>)}] -1 } +repeat h { =>[$>] ${nm{i(0,$>)}} } +rm. +fi +fi +#@cli :: Mathematical Operators +#@cli abs : (+) +#@cli : Compute the pointwise absolute values of selected images. +#@cli : $ image.jpg +sub {ia} abs[-1] +#@cli : $ 300,1,1,1,'cos(20*x/w)' +abs display_graph 400,300 +#@cli acos : (+) +#@cli : Compute the pointwise arccosine of selected images. +#@cli : $ image.jpg +normalize -1,1 acos[-1] +#@cli : $ 300,1,1,1,'cut(x/w+0.1*u,0,1)' +acos display_graph 400,300 +#@cli : $$ https://gmic.eu/oldtutorial/trigometric-and-inverse-trigometric-commands +#@cli acosh : (+) +#@cli : Compute the pointwise hyperbolic arccosine of selected images. +#@cli + : eq. to 'add'. : (+) +#@cli add : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Add specified value, image or mathematical expression to selected images, or compute the pointwise sum of selected images. +#@cli : (eq. to '+'). +#@cli : $ image.jpg +add 30% cut 0,255 +#@cli : $ image.jpg +blur 5 normalize 0,255 add[1] [0] +#@cli : $ image.jpg add '80*cos(80*(x/w-0.5)*(y/w-0.5)+c)' cut 0,255 +#@cli : $ image.jpg repeat 9 { +rotate[0] {$>*36},1,0,50%,50% } add div 10 +#@cli & : eq. to 'and'. : (+) +#@cli and : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the bitwise AND of selected images with specified value, image or mathematical expression, or compute the pointwise sequential bitwise AND of selected images. +#@cli : (eq. to '&'). +#@cli : $ image.jpg and {128+64} +#@cli : $ image.jpg +mirror x and +#@cli argmax +#@cli : Compute the argmax of selected images. Returns a single image +#@cli : with each pixel value being the index of the input image with maximal value. +#@cli : $ image.jpg sample lena,lion,square +argmax +argmax : +e[^-1] "Compute argmax of image$?." +if !$! return fi +13,$! eval. "!x?copy(i(),[[',i#'],v2s(y,10,10)])" =. 0 discard. 0 str={t} rm. +${-max_whds},"argmax("$str")" k. => [argmax] +#@cli argmaxabs +#@cli : Compute the argmaxabs of selected images. Returns a single image +#@cli : with each pixel value being the index of the input image with maxabs value. +argmaxabs : +e[^-1] "Compute argmaxabs of image$?." +if !$! return fi +13,$! eval. "!x?copy(i(),[[',i#'],v2s(y,10,10)])" =. 0 discard. 0 str={t} rm. +${-max_whds},"argmaxabs("$str")" k. => [argmaxabs] +#@cli argmin +#@cli : Compute the argmin of selected images. Returns a single image +#@cli : with each pixel value being the index of the input image with minimal value. +#@cli : $ image.jpg sample lena,lion,square +argmin +argmin : +e[^-1] "Compute argmin of image$?." +if !$! return fi +13,$! eval. "!x?copy(i(),[[',i#'],v2s(y,10,10)])" =. 0 discard. 0 str={t} rm. +${-max_whds},"argmin("$str")" k. => [argmin] +#@cli argminabs +#@cli : Compute the argminabs of selected images. Returns a single image +#@cli : with each pixel value being the index of the input image with minabs value. +argminabs : +e[^-1] "Compute argminabs of image$?." +if !$! return fi +13,$! eval. "!x?copy(i(),[[',i#'],v2s(y,10,10)])" =. 0 discard. 0 str={t} rm. +${-max_whds},"argminabs("$str")" k. => [argminabs] +#@cli asin : (+) +#@cli : Compute the pointwise arcsine of selected images. +#@cli : $ image.jpg +normalize -1,1 asin[-1] +#@cli : $ 300,1,1,1,'cut(x/w+0.1*u,0,1)' +asin display_graph 400,300 +#@cli : $$ https://gmic.eu/oldtutorial/trigometric-and-inverse-trigometric-commands +#@cli asinh : (+) +#@cli : Compute the pointwise hyperbolic arcsine of selected images. +#@cli atan : (+) +#@cli : Compute the pointwise arctangent of selected images. +#@cli : $ image.jpg +normalize 0,8 atan[-1] +#@cli : $ 300,1,1,1,'4*x/w+u' +atan display_graph 400,300 +#@cli : $$ https://gmic.eu/oldtutorial/trigometric-and-inverse-trigometric-commands +#@cli atan2 : [x_argument] : (+) +#@cli : Compute the pointwise oriented arctangent of selected images. +#@cli : Each selected image is regarded as the y-argument of the arctangent function, while the +#@cli : specified image gives the corresponding x-argument. +#@cli : $ (-1,1) (-1;1) resize 400,400,1,1,3 atan2[1] [0] keep[1] mod {pi/8} +#@cli : $$ https://gmic.eu/oldtutorial/trigometric-and-inverse-trigometric-commands +#@cli atanh : (+) +#@cli : Compute the pointwise hyperbolic arctangent of selected images. +#@cli << : eq. to 'bsl'. : (+) +#@cli bsl : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the bitwise left shift of selected images with specified value, image or mathematical expression, or compute the pointwise sequential bitwise left shift of selected images. +#@cli : (eq. to '<<'). +#@cli : $ image.jpg bsl 'round(3*x/w,0)' cut 0,255 +#@cli >> : eq. to 'bsr'. : (+) +#@cli bsr : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the bitwise right shift of selected images with specified value, image or mathematical expression, or compute the pointwise sequential bitwise right shift of selected images. +#@cli : (eq. to '>>'). +#@cli : $ image.jpg bsr 'round(3*x/w,0)' cut 0,255 +#@cli cos : (+) +#@cli : Compute the pointwise cosine of selected images. +#@cli : $ image.jpg +normalize 0,{2*pi} cos[-1] +#@cli : $ 300,1,1,1,'20*x/w+u' +cos display_graph 400,300 +#@cli : $$ https://gmic.eu/oldtutorial/trigometric-and-inverse-trigometric-commands +#@cli cosh : (+) +#@cli : Compute the pointwise hyperbolic cosine of selected images. +#@cli : $ image.jpg +normalize -3,3 cosh[-1] +#@cli : $ 300,1,1,1,'4*x/w+u' +cosh display_graph 400,300 +#@cli deg2rad +#@cli : Convert pointwise angle values of selected images, from degrees to radians (apply 'i*pi/180'). +deg2rad : +e[^-1] "Convert pointwise angle values of image$?, from degrees to radians." +* 0.017453292519943295 +#@cli / : eq. to 'div'. : (+) +#@cli div : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Divide selected images by specified value, image or mathematical expression, or compute the pointwise quotient of selected images. +#@cli : (eq. to '/'). +#@cli : $ image.jpg div '1+abs(cos(x/10)*sin(y/10))' +#@cli : $ image.jpg +norm add[-1] 1 +div +#@cli div_complex : [divider_real,divider_imag],_epsilon>=0 +#@cli : Perform division of the selected complex pairs (real1,imag1,...,realN,imagN) of images by +#@cli : specified complex pair of images (divider_real,divider_imag). +#@cli : In complex pairs, the real image must be always located before the imaginary image in the image list. +#@cli : Default value: 'epsilon=1e-8'. +div_complex : check ${3=1e-8}>=0 +e[^-1] "Divide complex pair$? by complex pair "${"pass$1,$2 -1"}" (with epsilon $3)." +repeat int($!/2) { +pass${1,2} 0 l[$>,{$>+1},-2,-1] { ++*[1,2] +*[0,3] -[-2,-1] +*[0] [2] *[1] [3] +[0,1] +sqr[1,2] +[1,2] +[1] $3 +/[2] [1] /[0,1] +} +} +#@cli == : eq. to 'eq'. : (+) +#@cli eq : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the boolean equality of selected images with specified value, image or mathematical expression, or compute the boolean equality of selected images. +#@cli : (eq. to '=='). +#@cli : $ image.jpg round 40 eq {round(ia,40)} +#@cli : $ image.jpg +mirror x eq +#@cli erf : (+) +#@cli : Compute the pointwise error function of selected images. +#@cli : $ image.jpg +normalize 0,2 erf[-1] +#@cli : $ 300,1,1,1,'7*x/w-3.5+u' +erf display_graph 400,300 +#@cli exp : (+) +#@cli : Compute the pointwise exponential of selected images. +#@cli : $ image.jpg +normalize 0,2 exp[-1] +#@cli : $ 300,1,1,1,'7*x/w+u' +exp display_graph 400,300 +#@cli >= : eq. to 'ge'. : (+) +#@cli ge : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the boolean 'greater or equal than' of selected images with specified value, image +#@cli : or mathematical expression, or compute the boolean 'greater or equal than' of selected images. +#@cli : (eq. to '>='). +#@cli : $ image.jpg ge {ia} +#@cli : $ image.jpg +mirror x ge +#@cli > : eq. to 'gt'. : (+) +#@cli gt : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the boolean 'greater than' of selected images with specified value, image or mathematical expression, or compute the boolean 'greater than' of selected images. +#@cli : (eq. to '>'). +#@cli : $ image.jpg gt {ia} +#@cli : $ image.jpg +mirror x gt +#@cli <= : eq. to 'le'. : (+) +#@cli le : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the boolean 'less or equal than' of selected images with specified value, image or mathematical expression, or compute the boolean 'less or equal than' of selected images. +#@cli : (eq. to '<='). +#@cli : $ image.jpg le {ia} +#@cli : $ image.jpg +mirror x le +#@cli < : eq. to 'lt'. : (+) +#@cli lt : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the boolean 'less than' of selected images with specified value, image or mathematical expression, or compute the boolean 'less than' of selected images. +#@cli : (eq. to '<'). +#@cli : $ image.jpg lt {ia} +#@cli : $ image.jpg +mirror x lt +#@cli log : (+) +#@cli : Compute the pointwise base-e logarithm of selected images. +#@cli : $ image.jpg +add 1 log[-1] +#@cli : $ 300,1,1,1,'7*x/w+u' +log display_graph 400,300 +#@cli log10 : (+) +#@cli : Compute the pointwise base-10 logarithm of selected images. +#@cli : $ image.jpg +add 1 log10[-1] +#@cli : $ 300,1,1,1,'7*x/w+u' +log10 display_graph 400,300 +#@cli log2 : (+) +#@cli : Compute the pointwise base-2 logarithm of selected images +#@cli : $ image.jpg +add 1 log2[-1] +#@cli : $ 300,1,1,1,'7*x/w+u' +log2 display_graph 400,300 +#@cli max : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the maximum between selected images and specified value, image or mathematical expression, or compute the pointwise maxima between selected images. +#@cli : $ image.jpg +mirror x max +#@cli : $ image.jpg max 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R' +#@cli maxabs : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the maxabs between selected images and specified value, image or mathematical expression, or compute the pointwise maxabs between selected images. +#@cli m/ : eq. to 'mdiv'. : (+) +#@cli mdiv : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the matrix division of selected matrices/vectors by specified value, image or mathematical expression, or compute the matrix division of selected images. +#@cli : (eq. to 'm/'). +#@cli med +#@cli : Compute the median of selected images. +#@cli : $ image.jpg sample lena,lion,square +med +med : +e[^-1] "Compute median of image$?." +if !$! return fi +13,$! eval. "!x?copy(i(),[[',i#'],v2s(y,10,10)])" =. 0 discard. 0 str={t} rm. +${-max_whds},"med("$str")" k. => [med] +#@cli min : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the minimum between selected images and specified value, image or mathematical expression, or compute the pointwise minima between selected images. +#@cli : $ image.jpg +mirror x min +#@cli : $ image.jpg min 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R' +#@cli minabs : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the minabs between selected images and specified value, image or mathematical expression, or compute the pointwise minabs between selected images. +#@cli % : eq. to 'mod'. : (+) +#@cli mod : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the modulo of selected images with specified value, image or mathematical expression, or compute the pointwise sequential modulo of selected images. +#@cli : (eq. to '%'). +#@cli : $ image.jpg +mirror x n. 1,255 round. mod +#@cli : $ image.jpg mod 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R' +#@cli m* : eq. to 'mmul'. : (+) +#@cli mmul : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the matrix right multiplication of selected matrices/vectors by specified value, image or mathematical expression, or compute the matrix right multiplication of selected images. +#@cli : (eq. to 'm*'). +#@cli : $ (0,1,0;0,0,1;1,0,0) (1;2;3) +mmul +#@cli * : eq. to 'mul'. : (+) +#@cli mul : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Multiply selected images by specified value, image or mathematical expression, or compute the pointwise product of selected images. +#@cli : (eq. to '*'). +#@cli : See also: ''add'', ''sub'', ''div''. +#@cli : $ image.jpg +mul 2 cut 0,255 +#@cli : $ image.jpg (1,2,3,4,5,6,7,8) ri[-1] [0] mul[0] [-1] +#@cli : $ image.jpg mul '1-3*abs(x/w-0.5)' cut 0,255 +#@cli : $ image.jpg +luminance negate[-1] +mul +#@cli mul_channels : value1,_value2,...,_valueN +#@cli : Multiply channels of selected images by specified sequence of values. +#@cli : $ image.jpg +mul_channels 1,0.5,0.8 +mul_channels : +e[^-1] "Multiply channels of image$? by value sequence ($*)." +$=arg repeat $# { i=$> +fact=${arg{1+($>%$#)}} +repeat $! { if {$>,$i] $i *. $fact rm. fi } +} +#@cli mul_complex : [multiplier_real,multiplier_imag] +#@cli : Perform multiplication of the selected complex pairs (real1,imag1,...,realN,imagN) of images by +#@cli : specified complex pair of images (multiplier_real,multiplier_imag). +#@cli : In complex pairs, the real image must be always located before the imaginary image in the image list. +mul_complex : +e[^-1] "Multiply complex pair$? by complex pair "${"pass$1,$2 -1"}"." +repeat int($!/2) { +pass${1,2} 0 l[$>,{$>+1},-2,-1] { ++*[0,3] +*[1,2] +[-2,-1] +*[0,2] *[1,2] -[0,1] +} +} +#@cli != : eq. to 'neq'. : (+) +#@cli neq : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the boolean inequality of selected images with specified value, image or mathematical expression, or compute the boolean inequality of selected images. +#@cli : (eq. to '!='). +#@cli : $ image.jpg round 40 neq {round(ia,40)} +#@cli | : eq. to 'or'. : (+) +#@cli or : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the bitwise OR of selected images with specified value, image or mathematical expression, or compute the pointwise sequential bitwise OR of selected images. +#@cli : (eq. to '|'). +#@cli : $ image.jpg or 128 +#@cli : $ image.jpg +mirror x or +#@cli ^ : eq. to 'pow'. : (+) +#@cli pow : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Raise selected images to the power of specified value, image or mathematical expression, or compute the pointwise sequential powers of selected images. +#@cli : (eq. to '^'). +#@cli : $ image.jpg div 255 +pow 0.5 mul 255 +#@cli : $ image.jpg gradient pow 2 add pow 0.2 +#@cli rad2deg +#@cli : Convert pointwise angle values of selected images, from radians to degrees (apply 'i*180/pi'). +rad2deg : +e[^-1] "Convert pointwise angle values of image$?, from radians to degrees." +* 57.295779513082323 +#@cli rol : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the bitwise left rotation of selected images with specified value, image or mathematical expression, or compute the pointwise sequential bitwise left rotation of selected images. +#@cli : $ image.jpg rol 'round(3*x/w,0)' cut 0,255 +#@cli ror : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the bitwise right rotation of selected images with specified value, image or mathematical expression, or compute the pointwise sequential bitwise right rotation of selected images. +#@cli : $ image.jpg ror 'round(3*x/w,0)' cut 0,255 +#@cli sign : (+) +#@cli : Compute the pointwise sign of selected images. +#@cli : $ image.jpg +sub {ia} sign[-1] +#@cli : $ 300,1,1,1,'cos(20*x/w+u)' +sign display_graph 400,300 +#@cli sin : (+) +#@cli : Compute the pointwise sine of selected images. +#@cli : $ image.jpg +normalize 0,{2*pi} sin[-1] +#@cli : $ 300,1,1,1,'20*x/w+u' +sin display_graph 400,300 +#@cli : $$ https://gmic.eu/oldtutorial/trigometric-and-inverse-trigometric-commands +#@cli sinc : (+) +#@cli : Compute the pointwise sinc function of selected images. +#@cli : $ image.jpg +normalize {-2*pi},{2*pi} sinc[-1] +#@cli : $ 300,1,1,1,'20*x/w+u' +sinc display_graph 400,300 +#@cli sinh : (+) +#@cli : Compute the pointwise hyperbolic sine of selected images. +#@cli : $ image.jpg +normalize -3,3 sinh[-1] +#@cli : $ 300,1,1,1,'4*x/w+u' +sinh display_graph 400,300 +#@cli sqr : (+) +#@cli : Compute the pointwise square function of selected images. +#@cli : $ image.jpg +sqr +#@cli : $ 300,1,1,1,'40*x/w+u' +sqr display_graph 400,300 +#@cli sqrt : (+) +#@cli : Compute the pointwise square root of selected images. +#@cli : $ image.jpg +sqrt +#@cli : $ 300,1,1,1,'40*x/w+u' +sqrt display_graph 400,300 +#@cli - : eq. to 'sub'. : (+) +#@cli sub : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Subtract specified value, image or mathematical expression to selected images, or compute the pointwise difference of selected images. +#@cli : (eq. to '-'). +#@cli : $ image.jpg +sub 30% cut 0,255 +#@cli : $ image.jpg +mirror x sub[-1] [0] +#@cli : $ image.jpg sub 'i(w/2+0.9*(x-w/2),y)' +#@cli : $ image.jpg +mirror x sub +#@cli tan : (+) +#@cli : Compute the pointwise tangent of selected images. +#@cli : $ image.jpg +normalize {-0.47*pi},{0.47*pi} tan[-1] +#@cli : $ 300,1,1,1,'20*x/w+u' +tan display_graph 400,300 +#@cli : $$ https://gmic.eu/oldtutorial/trigometric-and-inverse-trigometric-commands +#@cli tanh : (+) +#@cli : Compute the pointwise hyperbolic tangent of selected images. +#@cli : $ image.jpg +normalize -3,3 tanh[-1] +#@cli : $ 300,1,1,1,'4*x/w+u' +tanh display_graph 400,300 +#@cli xor : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the bitwise XOR of selected images with specified value, image or mathematical expression, or compute the pointwise sequential bitwise XOR of selected images. +#@cli : $ image.jpg xor 128 +#@cli : $ image.jpg +mirror x xor +#@cli :: Values Manipulation +#@cli apply_curve : 0<=smoothness<=1,x0,y0,x1,y1,x2,y2,...,xN,yN +#@cli : Apply curve transformation to image values. +#@cli : Default values: 'smoothness=1', 'x0=0', 'y0=100'. +#@cli : $ image.jpg +apply_curve 1,0,0,128,255,255,0 +apply_curve : check "${1=1}>=0 && $1<=1" skip ${2=0},${3=100} +e[^-1] "Apply intensity curve with smoothness $1 and keypoints (${2--1}) on image$?." +(${^0,1}) r. 2,{w/2},1,1,-1 +z. 0,0 vm,vM:=[im,iM] n. 0,8191 j.. . function1d[] $1,{-2,^} rm[-3,-2] +-[^-1] $vm *[^-1] {8191/($vM-$vm)} map[^-1] .,1 rm. +#@cli apply_gamma : gamma>=0 +#@cli : Apply gamma correction to selected images. +#@cli : $ image.jpg +apply_gamma 2 +apply_gamma : check $1>=0 +e[^-1] "Apply Gamma-correction to image$?, with gamma $1." +if $1==1 return fi +foreach { mM:=[im,iM] n 0,1 ^ {1/$1} n $mM } +#@cli balance_gamma : _ref_color1,... +#@cli : Compute gamma-corrected color balance of selected image, with respect to specified reference color. +#@cli : Default value: 'ref_color1=128'. +#@cli : $ image.jpg +balance_gamma 128,64,64 +balance_gamma : check "isnum(${1=128})" +e[^-1] "Apply gamma-corrected color balance of image$?, with reference color ("${^0}")." +foreach { +(${^0}) r. {-2,s},1,1,1,0,1 s.. c /. 255 +repeat $!-1 { /[$>] 255 ^[$>] {log({@$>})/log({$>,ia})} *[$>] 255 } +rm. a c c 0,255 +} +#@cli cast : datatype_source,datatype_target +#@cli : Cast datatype of image buffer from specified source type to specified target type. +#@cli : 'datatype_source' and 'datatype_target' can be { uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }. +cast : +e[^-1] "Cast datatype of image buffer$? from '$1' to '$2'." +ssize:=s='"$1"';s=='"uint8"'||s=='int8'?1:s=='"uint16"'||s=='int16'?2:s=='"uint32"'||s=='int32'||s=='float32'?4:8 +dsize:=s='"$2"';s=='"uint8"'||s=='int8'?1:s=='"uint16"'||s=='int16'?2:s=='"uint32"'||s=='int32'||s=='float32'?4:8 +foreach { +w,h,d,s:=[w,h,d,s] +serialize $1,0,0 +s -,{'\n$w\ $h\ $d\ $s\n'} +i[1] ('\n1\ {int($w*$h*$d*$s*$ssize/$dsize)}\ 1\ 1\n') y[1] +replace_str[0] "$1","$2" +a y unserialize +} +#@cli complex2polar +#@cli : Compute complex to polar transforms of selected images. +#@cli : $ image.jpg +fft complex2polar[-2,-1] log[-2] shift[-2] 50%,50%,0,0,2 remove[-1] +complex2polar : +e[^-1] "Compute complex to polar transforms of image$?." +repeat int($!/2) { +l[{2*$>},{2*$>+1}] { +ri[1] [0],3 +atan2[1] [0] => {1,n} sqr[-3,-2] +[-3,-2] sqrt.. +} +} +#@cli compress_clut : _max_error>0,_avg_error>0,_max_nbpoints>=8 | 0 (unlimited),_error_metric={ 0=L2-norm | 1=deltaE_1976 | 2=deltaE_2000 },_reconstruction_colorspace={ 0=srgb | 1=rgb | 2=lab },_try_rbf_first={ 0 | 1 } +#@cli : Compress selected color LUTs as sequences of colored keypoints. +#@cli : Default values: 'max_error=1.5', 'avg_error=0.75', 'max_nb_points=2048', 'error_metric=2', 'reconstruction_colorspace=0' and 'try_rbf_first=1'. +compress_clut : check "${1=1.5}>0 && ${2=0.75}>0 && isint(${3=2048}) && (!$3 || $3>=8) && isin(${4=2},0,1,2) && ""isin(${5=0},0,1,2) && isbool(${6=1})" +e[^-1] "Compress color LUT$? as a set of colored keypoints, with maximum error $1, average error $2, ""$3 maximum keypoints, "${"s0,s1,s2=L2-RGB,DeltaE_1976,DeltaE_2000 u $s$4"}" metric and "${"s0,s1,s2=srgb,rgb,lab u $s$5"}" colorspace for reconstruction." +v 0 +max_error,avg_error,max_keypoints,metric,colorspace,try_rbf=${1-6} +if $try_rbf method=rbf else method=pde fi +foreach { +nm={b} +if iM>1024 / 257 fi +if d==1 S:=round(cbrt(wh)) r $S,$S,$S,100%,-1 fi +e "\n* Process CLUT '"$nm"' ("{w}"x"{h}"x"{d}")." +if "s==3 && +crop(0,0,0,0,w,h,d,1)==crop(0,0,0,1,w,h,d,1) && +crop(0,0,0,0,w,h,d,1)==crop(0,0,0,2,w,h,d,1)" +channels 0 +fi +_metric:=s==3?$metric:0 +if $_metric +srgb2lab fi +1,8,1,{s+3} +eval " +coords = [ 0,0,0, 255,0,0, 255,255,0, 0,255,0, 0,0,255, 255,0,255, 255,255,255, 0,255,255 ]; +repeat (size(coords)/3,k, +P = coords[3*k,3]; +I[k] = [ P, I(#0,round(P*([w#0,h#0,d#0]-1)/255)) ] +)" +sep="\n" +do ++decompress_clut_$method. {0,[w,h,d]},$colorspace +if !$_metric -. [0] norm. else srgb2lab. deltaE. [1],{$_metric-1}," " fi +emax,eavg:=[iM,ia] +e "\r"$sep" > Add [#"{-2,h}"] Max_Err = "{_$emax}", Avg_Err = "{_$eavg}" " sep="" +if $emax<=$max_error" && "$eavg<=$avg_error rm. break fi +1,1,1,{0,s+3},{"P = [ xM,yM,zM ]; [ P*255/[max(1,w#0-1),max(1,h#0-1),max(1,d#0-1)], I(#0,P) ]"} rm.. +a[-2,-1] y +if $max_keypoints" && "h>=512" && "'$method'=='rbf' method=pde rows. 0,7 fi +while h<($max_keypoints?$max_keypoints:inf) +if h>8 +if $_metric max_rounding,avg_rounding=0.1,0.025 +else max_rounding,avg_rounding=1,0.25 +fi +if $emax>$max_error" || "$eavg>$avg_error +max_error=round($max_error,$max_rounding,1) +avg_error=round($avg_error,$avg_rounding,1) +fi +index=8 sep="\n" +do ++l. { s y rm[$index] a y } ++decompress_clut_$method. {0,[w,h,d]},$colorspace +if $_metric==0 -. [0] norm. else srgb2lab. deltaE. [1],{$_metric-1}," " fi +emax,eavg:=[iM,ia] rm. +if $emax<=$max_error" && "$eavg<=$avg_error rv[-2,-1] else index+=1 fi +e "\r"$sep" > Rem [#"{min($index,h-1)}"/"{h}"] Max_Err = "{_$emax}", Avg_Err = "{_$eavg}" " +sep="" +rm. +while $index ${} +} +compress_cluts : check "${2=1.5}>0 && ${3=0.75}>0 && isint(${4=2048}) && $4>8" +rm +if isfile(['{/"$1"}']) it[] "$1" s -,{'\n'} +else files "$1" ('${}') s -,{','} +fi +foreach { +filename={t} 0 => $filename ext={x} rm +basename $filename +l[] { ('${}') replace_str .$ext,"" basename={t} rm } +need_compression=1 +cclut=cclut_$basename.gmz +if isfile(['{/$cclut}']) +i $cclut +if "dat = (date(5) + 60*(date(4) + date(2)*24)); +fdat = (date(5,'"{/$cclut}"') + 60*(date(4,'"{/$cclut}"') + date(2,'"{/$cclut}"')*24)); +!h && dat-fdat<30" +e "* Skip file '"$filename"' (CLUT already being compressed)." +need_compression=0 +elif h>0" && "h!=2048 +e "* Skip file '"$filename"' (CLUT already compressed)." +need_compression=0 +fi +rm. +fi +if $need_compression +0 o. $cclut rm. +if lowercase(['$ext'])=='cube' input_cube $filename c. 0,255 +elif lowercase(['$ext'])=='png' i $filename S:=round(cbrt(wh)) r $S,$S,$S,100%,-1 +else e "* Skip file '"$filename"' (unknown CLUT format)." continue +fi +e "* Compress file '"$filename"'." +if w>33 r3dx 33 fi +to_rgb +tic compress_clut $2,$3,$4 toc +o $cclut +fi +rm +} +#@cli compress_huffman : [huffman_tree],_max_leaf_value +#@cli : Compress selected images with Huffman coding. +#@cli : See also: ''decompress_huffman'', ''huffman_tree''. +compress_huffman : check ${"is_image_arg $1"} skip "${2=}" +e[^-1] "Compress image$? with Huffman coding, using tree $1." +pass$1 +if ['$2']==0 +eval. ">begin(Mlv = -inf); i2<0 && i3<0?Mlv = max(Mlv,i0); end(set('Mlv',Mlv)); I" +else +Mlv=$2 +fi +1,{$Mlv+1},1,2 +eval.. ":i2<0?( +ind = y; +code = nb_bits = 0; +while (ind>=0, +par = i(0,ind,0,1); +par>=0?((code<<=1)|=(i(0,par,0,2)!=ind); ++nb_bits); +ind = par; +); +ncode = 0; repeat (nb_bits,(ncode<<=1)|=(code&1); code>>=1); +I[#-1,i0] = [ ncode,nb_bits ]; +); I" +rm.. +foreach[^-1] { +nm={n} pass. 2 +0 eval... ">begin(da_push(w,h,d,s); out_stream = nb_bits = 0); +C = I[#-2,int(i),1]; +(out_stream<<=C[1])|=C[0]; +nb_bits+=C[1]; +while (nb_bits>=8, +da_push(out_stream>>(nb_bits-=8)); +out_stream%=1< $nm +} +rm. +#@cli huffman_tree +#@cli : Generate Huffman coding tree from the statistics of all selected images. +#@cli : Huffman tree is returned as a 1xN image inserted at the end of the image list, representing the 'N' vector-valued leafs/nodes of the tree, encoded as `[ value,parent,child0,child1 ]`. +#@cli : Last row of the returned image corresponds to the tree root. +#@cli : Selected images must contain only positive integer values. +#@cli : Return maximal value of the input data in the status. +#@cli : See also: ''compress_huffman'', ''decompress_huffman''. ++huffman_tree : +e[^-1] "Generate Huffman coding tree from the statistic of image$?." +Mlv:="val=-inf;for(k=0,k=active, --k, +occ = i(0,k,0,1); +occ<=omin1?(oind2 = oind1; omin2 = omin1; oind1 = k; omin1 = occ): +occ<=omin2?(oind2 = k; omin2 = occ); +); +oind1>oind2?swap(oind1,oind2); +i(0,oind1,0,3) = i(0,oind2,0,3) = id; +da_push([ id++,omin1 + omin2,-1,-1,i[oind1],i[oind2] ]); +swap(I[oind1],I[active++]); +swap(I[oind2],I[active++]); +,_(while) active "[Huffman Tree]" +u $Mlv +#@cli compress_rle : _is_binary_data={ 0 | 1 },_maximum_sequence_length>=0 +#@cli : Compress selected images as 2xN data matrices, using RLE algorithm. +#@cli : Set 'maximum_sequence_length=0' to disable maximum length constraint. +#@cli : Default values: 'is_binary_data=0' and 'maximum_sequence_length=0'. +#@cli : $ image.jpg resize2dy 100 quantize 4 round +compress_rle , +decompress_rle[-1] +compress_rle : check "isbool(${1=0}) && isint(${2=0}) && $2>=0" +s0=" for binary data" s1="" +if $2 s=", with maximal sequence length "$2 else s="" fi +e[^-1] "Compress image$? using RLE algorithm"${s{!$1}}$s"." +foreach { +nm={n} im:=im header={w};{h};{d};{s};$im;{$1!=0} +- $im y x ({{0,@-1}+1}) a x r 100%,3 +f '>!y?i:y==1?(i(x,0)==i(x+1,0)?-1:x):(i(x-1,1)==-1?i(x-1,2)+1:1)' +if $2 +transpose mirror x +f. '>x==2?i:!x?(j(0,-1)==$2?1:i!=1?j(0,-1)+1:1):(i==-1&&j(-1)==$2?y:i)' +mirror x transpose +fi +z 0,{w-2} s y,3 y[1] discard[1] -1 warp[0,2] [1],0,0 rm[1] +if $1 +!=[0] 0 *[0] 2 -[0] 1 * +else +*. -1 rv a x y discard -1 f '>i(0,y-1)<0&&i==0&&i(0,y+1)<0?-1:i' discard -1 +fi +i[0] ($header) a y => $nm +} +#@cli cumulate : { x | y | z | c }...{ x | y | z | c } : (no arg) : (+) +#@cli : Compute the cumulative function of specified image data, optionally along the specified axes. +#@cli : $ image.jpg +histogram 256 +cumulate[-1] display_graph[-2,-1] 400,300,3 +#@cli c : eq. to 'cut'. : (+) +#@cli cut : { value0[%] | [image0] },{ value1[%] | [image1] } : [image] : (+) +#@cli : Cut values of selected images in specified range. +#@cli : (eq. to 'c').\n +#@cli : $ image.jpg +add 30% cut[-1] 0,255 +#@cli : $ image.jpg +cut 25%,75% +#@cli decompress_clut : _width>0,_height>0,_depth>0,_reconstruction_colorspace={ 0=srgb | 1=rgb | 2=lab } +#@cli : Decompress selected colored keypoints into 3D CLUTs, using a mixed RBF/PDE approach. +#@cli : Default values: 'width=height=depth=33' and 'reconstruction_colorspace=0'. +decompress_clut : check "isint(${1=33}) && $1>0 && isint(${2=$1}) && $2>0 && isint(${3=$1}) && $3>0 && ""isin(${4=0},0,1,2)" +e[^-1] "Decompress colored keypoint$? into $1x$2x$3 CLUTs, using "${"s0,s1=srgb,rgb u $s$4"}" colorspace for reconstruction." +foreach { +if "h>=512 || (P0 = I[0]; P1 = I[h - 1]; val(P) = (P[0]*65536 + P[1]*256 + P[2]); val(P0)>val(P1))" +decompress_clut_pde. ${1-4} +else +decompress_clut_rbf. ${1-4} +fi +} +#@cli decompress_clut_rbf : _width>0,_height>0,_depth>0,_reconstruction_colorspace={ 0=srgb | 1=rgb | 2=lab } +#@cli : Decompress selected colored keypoints into 3D CLUTs, using RBF thin plate spline interpolation. +#@cli : Default value: 'width=height=depth=33' and 'reconstruction_colorspace=0'. +decompress_clut_rbf : check "isint(${1=33}) && $1>0 && isint(${2=$1}) && $2>0 && isint(${3=$1}) && $3>0 && ""isin(${4=0},0,1,2)" +e[^-1] "Decompress colored keypoint$? into $1x$2x$3 CLUTs (RBF approach), using "${"s0,s1,s2=srgb,rgb,lab u $s$4"}" colorspace for reconstruction." +foreach { +if $4 s c,-3 srgb2${"arg $4,rgb,lab"}. a c fi +rbf $1,$2,$3,0,0,0,255,255,255 +if $4 ${"arg $4,rgb,lab"}2srgb fi +} +#@cli decompress_clut_pde : _width>0,_height>0,_depth>0,_reconstruction_colorspace={ 0=srgb | 1=rgb | 2=lab } +#@cli : Decompress selected colored keypoints into 3D CLUTs, using multiscale diffusion PDE's. +#@cli : Default values: 'width=height=depth=33' and 'reconstruction_colorspace=0'. +decompress_clut_pde : check "isint(${1=33}) && $1>0 && isint(${2=$1}) && $2>0 && isint(${3=$1}) && $3>0 && ""isin(${4=0},0,1,2)" +e[^-1] "Decompress colored keypoint$? into $1x$2x$3 CLUTs (PDE approach), using "${"s0,s1,s2=srgb,rgb,lab u $s$4"}" colorspace for reconstruction." +foreach { +nm={n} +if $4 s c,-3 srgb2${"arg $4,rgb,lab"}. a c fi +2,2,2,{s-3} +do ++f. 0 .,.,.,1 +eval[0] "begin(fact = ([w#1,h#1,d#1] - 1)/255); PC = I; P = PC[0,3]; X = round(P*fact); +I(#2,X)+=PC[3,s-3]; ++i(#3,X); I" +f. "*i?(I(#2)/=i;1):0" +if im rm[-3,-1] +else ++distance. 1 .,.,.,3 +eval.. "* +const boundary = 1; +maxabs(a,b) = (abs(a)>abs(b)?a:b); +I(#-1) = [ maxabs(j(1) - i,i - j(-1)), +maxabs(j(0,1) - i,i - j(0,-1)), +maxabs(j(0,0,1) - i,i - j(0,0,-1)) ]" +orientation. rm.. +repeat 20 { +j[-4] ...,0,0,0,0,1,.. ++warp[-4] .,1,2,1 *.. -1 warp[-5] ..,1,2,1 +[-5,-1] /[-4] 2 +} +j[-4] ...,0,0,0,0,1,.. k[0,1] +fi +if "w<$1 || h<$2 || d<$3" r. {[min($1,2*w),min($2,2*h),min($3,2*d)]},100%,3 else break fi +while 1 +k. +if $4 ${"arg $4,rgb,lab"}2srgb fi +=> $nm +} +um srgb2srgb +#@cli decompress_huffman : [huffman_tree] +#@cli : Decompress selected images with Huffman decoding. +#@cli : See also: ''compress_huffman'', ''huffman_tree''. +#@cli : $ image.jpg huffman_tree compress_huffman.. . +decompress_huffman.. . +decompress_huffman : check ${"is_image_arg $1"} +e[^-1] "Decompress image$? with Huffman decoding, using tree $1." +pass$1 +foreach[^-1] { +nm={n} pass. 2 +0 eval " +hvalues = crop(#-2,0,0,0,0,1,h#-2,1,1); +hparent = crop(#-2,0,0,0,1,1,h#-2,1,1); +hchild0 = crop(#-2,0,0,0,2,1,h#-2,1,1); +hchild1 = crop(#-2,0,0,0,3,1,h#-2,1,1); +const root = size(hvalues) - 1; +siz = prod(crop(#-3,0,0,1,4)); +off = 4; mask = byte = bytes_written = 0; +ind = root; +while (bytes_written>=1; +child = bit?hchild1[ind]:hchild0[ind]; +val = hvalues[child]; +val>=0?( +da_push(val); +ind = root; +++bytes_written; +):(ind = child); +); da_freeze()" +r. {"crop(#-3,0,0,1,4)"},-1 k. => $nm +} +rm. +#@cli decompress_rle +#@cli : Decompress selected data vectors, using RLE algorithm. +decompress_rle : +e[^-1] "Decompress data vector$?, using RLE algorithm." +foreach { +y whds={0,@0-3} im={0,@4} is_binary_data={0,@5} rows 6,100% +if $is_binary_data ++>= 0 abs[0] a x +else ++<. 0 +(0;1;1) +erode.. .,0 rm. -. 1 a x discard -1 ++< 0 (0;1;1) dilate.. . rm. *. -2 +. 1 +rv abs. a x discard -1 +r 2,{h/2},1,1,-1 +fi +s y,-256 +foreach { +i[0] ('CImg3d') +[0] 0.5 +i[1] ({2*h};{h}) +s. x,2 cumulate.. siz={-2,@-1} ++shift.. 0,1 -... 1 rv[-3,-1] z[-3,-1] 0,2 a[-3,-1] x +i[3] (2,0,1;2,{2*h-2},{2*h-1}) r[3] 3,{h},1,1,3 round[3] +r[4] 3 1,100%,1,1,1 y a y +$siz j3d. ..,0,0,0,1,2,0,0 rm.. +} +a x r $whds,-1 + $im +} +#@cli discard : _value1,_value2,... : { x | y | z | c}...{ x | y | z | c},_value1,_value2,... : (no arg) : (+) +#@cli : Discard specified values in selected images or discard neighboring duplicate values, +#@cli : optionally only for the values along the first of a specified axis. +#@cli : If no arguments are specified, neighboring duplicate values are discarded. +#@cli : If all pixels of a selected image are discarded, an empty image is returned. +#@cli : $ (1;2;3;4;3;2;1) +discard 2 +#@cli : $ (1,2,2,3,3,3,4,4,4,4) +discard x +#@cli eigen2tensor +#@cli : Recompose selected pairs of eigenvalues/eigenvectors as 2x2 or 3x3 tensor fields. +#@cli : $$ +eigen2tensor : +e[^-1] "Recompose pairs in eigen field$? as 2x2 or 3x3 tensor fields." +repeat $!/2 { l[$>,{$>+1}] { +nm={0,n} +if s==2 +s. c ++sqr. *.. ... sqr... +sh. +*... -1 +sh[-5] +a[-3--1] c a[-4--2] c +sh... 0 *[-3,-1] +sh... 1 *[-2,-1] +rm... +[-2,-1] +elif s==6 +s. c +l[-6--4] { +sqr.. +*[-2,-3] +sqr... *[-5] [-6] *[-4] [-6] sqr[-6] a c } +l[-3--1] { +sqr.. +*[-2,-3] +sqr... *[-5] [-6] *[-4] [-6] sqr[-6] a c } +s... c +-[-5] ... -[-4] ... *.. [-5] *. [-4] +(1^0^0^1^0^1) ri. ... *. [-4] rm[-6--4] +[-3--1] +else error[0--3] "Command '$0': Invalid image ["{$!-$>-1}"] : Dimensions "{w}","{h}","{d}","{s}" does +not represent a field of 2D or 3D eigenvectors." +fi +=> $nm +} } +#@cli endian : _datatype : (+) +#@cli : Reverse data endianness of selected images, eventually considering the pixel being of the specified datatype. +#@cli : 'datatype' can be { bool | uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }. +#@cli : This command does nothing for 'bool', 'uint8' and 'int8' datatypes. +#@cli equalize : _nb_levels>0[%],_value_min[%],_value_max[%] : (no arg) : (+) +#@cli : Equalize histograms of selected images. +#@cli : If value range is specified, the equalization is done only for pixels in the specified +#@cli : value range. +#@cli : Default values: 'nb_levels=256', 'value_min=0%' and 'value_max=100%'. +#@cli : $ image.jpg +equalize +#@cli : $ image.jpg +equalize 4,0,128 +#@cli f : eq. to 'fill'. : (+) +#@cli fill : value1,_value2,... : [image] : 'formula' : (+) +#@cli : Fill selected images with values read from the specified value list, existing image +#@cli : or mathematical expression. Single quotes may be omitted in 'formula'. +#@cli : (eq. to 'f'). +#@cli : $ 4,4 fill 1,2,3,4,5,6,7 +#@cli : $ 4,4 (1,2,3,4,5,6,7) fill[-2] [-1] +#@cli : $ 400,400,1,3 fill "X=x-w/2; Y=y-h/2; R=sqrt(X^2+Y^2); a=atan2(Y,X); if(R<=180,255*abs(cos(c+200*(x/w-0.5)*(y/h-0.5))),850*(a%(0.1*(c+1))))" +#@cli : $$ +#@cli index : { [palette] | palette_name },0<=_dithering<=1,_map_palette={ 0 | 1 } : (+) +#@cli : Index selected vector-valued images by specified vector-valued palette. +#@cli : 'palette_name' can be { default | hsv | lines | hot | cool | jet | flag | cube | rainbow | algae | amp |balance | curl | deep | delta | dense | diff | haline | ice | matter | oxy | phase | rain | solar | speed | tarn |tempo | thermal | topo | turbid | aurora | hocuspocus | srb2 | uzebox } +#@cli : Default values: 'dithering=0' and 'map_palette=0'. +#@cli : $ image.jpg +index 1,1,1 +#@cli : $ image.jpg (0;255;255^0;128;255^0;0;255) +index[-2] [-1],1,1 +#@cli : $$ https://gmic.eu/tutorial/gindex +index : check "${2=0}>=0 && $2<=1 && isbool(${3=0})" +if ${"is_image_arg $1"} pass$1 e[0--3] "Index values in image$? by LUT $1, with dithering level $2." +else +names=${-_palette_names} N:=narg($names) +l[] { if isint("$1") name=${"arg0 ($1%"$N"),"$names} else name="$1" fi onfail name="$1" } +e[0--3] "Index values in image$? by LUT '"$name"', with dithering level $2." +palette $1 +fi +index[^-1] .,$2,$3 rm. +#@cli ir : eq. to 'inrange'. +ir : check "isbool(${3=1}) && isbool(${4=$3})" +_gmic_s="$?" v + _inrange $* +#@cli inrange : min[%],max[%],_include_min_boundary={ 0=no | 1=yes },_include_max_boundary={ 0=no | 1=yes } +#@cli : Detect pixels whose values are in specified range `[min,max]`, in selected images. +#@cli : (eq. to 'ir'). +#@cli : Default value: 'include_min_boundary=include_max_boundary=1'. +#@cli : $ image.jpg +inrange 25%,75% +inrange : check "isbool(${3=1}) && isbool(${4=$3})" +_gmic_s="$?" v + _$0 $* +_inrange : skip "${3=1},${4=$3}" +v:=$3+2*$4 +s=${"arg0 "$v",out,\" min\",\" max\",\" min and max\""} +if $v%3 b="y" else b="ies" fi +e[0--3] "Extract pixel values in range [$1,$2] in image"$_gmic_s", with"$s" boundar"$b" included." +foreach { +m=$1 M=$2 +if ${is_percent\ $1} m:=im+(iM-im)*$1 fi +if ${is_percent\ $2} M:=im+(iM-im)*$2 fi +f. inrange(i,$m,$M,$3) +} +#@cli map : [palette],_boundary_conditions : palette_name,_boundary_conditions : (+) +#@cli : Map specified vector-valued palette to selected indexed scalar images. +#@cli : 'palette_name' can be { default | hsv | lines | hot | cool | jet | flag | cube | rainbow | algae | amp | balance | curl | deep | delta | dense | diff | gray | haline | ice | matter | oxy | phase | rain | solar | speed | tarn | tempo | thermal | topo | turbid | aurora | hocuspocus | srb2 | uzebox } +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default value: 'boundary_conditions=0'. +#@cli : $ image.jpg +luminance map[-1] 3 +#@cli : $ image.jpg +rgb2ycbcr split[-1] c (0,255,0) resize[-1] 256,1,1,1,3 map[-4] [-1] remove[-1] append[-3--1] c ycbcr2rgb[-1] +#@cli : $$ +map : check "isint(${2=0}) && $2>=0 && $2<=3" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror boundary=${s$2} +names=${-_palette_names} N:=narg($names) +l[] { if isint("$1") name=${"arg0 ($1%"$N"),"$names} else name="$1" fi onfail name="$1" } +e[^-1] "Map color LUT '"$name"' on image$?, with "$boundary" boundary conditions." +palette $1 map[^-1] .,$2 rm. +#@cli mix_channels : (a00,...,aMN) : [matrix] +#@cli : Apply specified matrix to channels of selected images. +#@cli : $ image.jpg +mix_channels (0,1,0;1,0,0;0,0,1) +mix_channels : +e[^-1] "Apply matrix $* to channels of image$?." +if ${"is_image_arg $1"} pass$1 1 else i ${^0} fi +foreach[^-1] { +nm={n} whd:=[w,h,d] r. {[whd,s]},1,1,-1 +pass. 0 mv. 0 m* r $whd,{h},-1 => $nm +} rm. +#@cli negate : base_value : (no arg) +#@cli : Negate image values. +#@cli : Default value: 'base_value=(undefined)'. +#@cli : $ image.jpg +negate +negate : skip "${1=,}" +if isnum("$*") +e[0--3] "Negate values of image$?, according to base value $*." +- {"$*"} * -1 +else +e[0--3] "Negate values of image$?." +repeat $! { -[$>] {$>,iM} } * -1 +if ['"$1"']!=',' noarg fi +fi +#@cli noise : std_deviation>=0[%],_noise_type : (+) +#@cli : Add random noise to selected images. +#@cli : 'noise_type' can be { 0=gaussian | 1=uniform | 2=salt&pepper | 3=poisson | 4=rice }. +#@cli : Default value: 'noise_type=0'. +#@cli : $ image.jpg +noise[0] 50,0 +noise[0] 50,1 +noise[0] 10,2 cut 0,255 +#@cli : $ 300,300,1,3 [0] noise[0] 20,0 noise[1] 20,1 +histogram 100 display_graph[-2,-1] 400,300,3 +#@cli noise_perlin : _scale_x[%]>0,_scale_y[%]>0,_scale_z[%]>0,_seed_x,_seed_y,_seed_z +#@cli : Render 2D or 3D Perlin noise on selected images, from specified coordinates. +#@cli : The Perlin noise is a specific type of smooth noise, +#@cli : described here : . +#@cli : Default values: 'scale_x=scale_y=scale_z=16' and 'seed_x=seed_y=seed_z=0'. +#@cli : $ 500,500,1,3 noise_perlin , +noise_perlin : check "${1=16}>0 && ${2=$1}>0 && ${3=$1}>0 && isnum(${4=0}) && isnum(${5=0}) && isnum(${6=0})" +e[^-1] "Render Perlin noise on image$?, with scales (${1-3}) and seeds (${4-6})." +init="permutation = [ 151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240, +21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88, +237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231, +83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1, +216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198, +173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47, +16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167, +43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251, +34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31, +181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29, +24,72,243,141,128,195,78,66,215,61,156,180 ]; +p = [ permutation,permutation ]; +fade(t) = (t*t*t*(t*(t*6 - 15) + 10)); +_lerp(t,a,b) = lerp(a,b,t); +pcmod255 = vectors(); repeat (s,k,pcmod255[k] = p[k%255]); +sx = ['$1']; is_px = sx[size(sx) - 1]==_'%'; +sy = ['$2']; is_py = sy[size(sy) - 1]==_'%'; +sz = ['$3']; is_pz = sz[size(sz) - 1]==_'%'; +x0 = $4; +y0 = $5; +z0 = $6; +x1 = x0 + (is_px?1/$1:w/$1); +y1 = y0 + (is_py?1/$2:h/$2); +z1 = z0 + (is_pz?1/$3:d/$3); +fw = (x1 - x0)/max(w - 1,1); +fh = (y1 - y0)/max(h - 1,1); +fd = (z1 - z0)/max(d - 1,1);" +repeat $! { if {$>,d>1} +f[$>] "*begin("$init" +grad(hash,x,y,z) = ( gh = hash&15; gu = gh<8?x:y; gv = gh<4?y:gh==12 || gh==14?x:z; +(!(gh&1)?gu:-gu) + (!(gh&2)?gv:-gv)) +); +x = x0 + x*fw + pcmod255[c]; y = y0 + y*fh + pcmod255[c]; z = z0 + z*fd + pcmod255[c]; +ix = floor(x); iy = floor(y); iz = floor(z); +X = ix&255; Y = iy&255; Z = iz&255; +fx = x - ix; fy = y - iy; fz = z - iz; +u = fade(fx); v = fade(fy); w = fade(fz); +A = p[X] + Y; AA = p[A] + Z; AB = p[A + 1] + Z; +B = p[X + 1] + Y; BA = p[B] + Z; BB = p[B + 1] + Z; +fx1 = fx - 1; fy1 = fy - 1; fz1 = fz - 1; +lerp(lerp(lerp(grad(p[AA],fx,fy,fz), +grad(p[BA],fx1,fy,fz),u), +lerp(grad(p[AB],fx,fy1,fz), +grad(p[BB],fx1,fy1,fz),u),v), +lerp(lerp(grad(p[AA + 1],fx,fy,fz1), +grad(p[BA + 1],fx1,fy,fz1,u), +lerp(grad(p[AB + 1],fx,fy1,fz1), +grad(p[BB+1],fx1,fy1,fz1),u),v),w)" +else +f[$>] "*begin("$init" +grad(hash,x,y) = ( gh = hash&15; gu = gh<8?x:y; gv = gh<4?y:gh==12 || gh==14?x:0; +(!(gh&1)?gu:-gu) + (!(gh&2)?gv:-gv)) +); +x = x0 + x*fw + pcmod255[c]; y = y0 + y*fh + pcmod255[c]; +ix = floor(x); iy = floor(y); +X = ix&255; Y = iy&255; +fx = x - ix; fy = y - iy; +u = fade(fx); v = fade(fy); +A = p[X] + Y; B = p[X + 1] + Y; +fx1 = fx - 1; fy1 = fy - 1; +lerp(lerp(grad(p[A],fx,fy), +grad(p[B],fx1,fy),u), +lerp(grad(p[A + 1],fx,fy1), +grad(p[B + 1],fx1,fy1),u),v)" +fi } +#@cli noise_poissondisk : _radius[%]>0,_max_sample_attempts>0,_p_norm>0 +#@cli : Add poisson disk sampling noise to selected images. +#@cli : Implements the algorithm from the article "Fast Poisson Disk Sampling in Arbitrary Dimensions", +#@cli : by Robert Bridson (SIGGRAPH'2007). +#@cli : Default values: 'radius=8', 'max_sample_attempts=30' and 'p_norm=2'. +#@cli : $ 300,300 noise_poissondisk 8 +noise_poissondisk : check "${1=8}>0 && isint(${2=30}) && $2>0 && ${3=2}>0" +e[^-1] "Add poisson disk sampling points to image$?, with radius $1, max sample attempts $2 and p-norm $3." +R0,K,P=${1-3} +foreach { +W,H,D:=[w,h,d] +value:=iM+(im==iM?1:0) +R:=${is_percent\ $R0}?max(w,h,d)*$R0:$R0 +C:=$R/sqrt(sum([$W,$H,$D]>1)) +_poissondisk[] $R,$P,$C +f. "($W<2 && i0) || ($H<2 && i1) || ($D<2 && i2)?[8,8,8]:I" discard. 8 s. y,3 a[-3--1] x +neighbors={^} rm. +{ceil([$W,$H,$D]/$C)},1,-1 => grid +1,32,1,3 => points +1,32,1,1 => active +eval " +insert_active_point(X) = ( +i(#$grid,int(X/$C)) = new_ind = da_size(#$points); +da_push(#$points,X); +da_push(#$active,new_ind); +I(#0,X) = $value; +); +const eps = 1e-8; +neighbors = ["$neighbors"]; +X = int(u([$W,$H,$D] - eps)); +insert_active_point(X); +while (siz = da_size(#$active), +indX = int(u(siz - eps)); +X = I[#$points,i[#$active,indX]]; +for (k = 0, k<$K, ++k, +U = [ $W>1?v:0, $H>1?v:0, $D>1?v:0 ]; +U*=u($R,2*$R)/(norm(U) + eps); +Y = round(X + U); +min(inrange(Y,0,[$W,$H,$D] - 1))?( +P = int(Y/$C); +i(#$grid,P)<0?( +is_sample_ok = 1; +repeat(size(neighbors)/3,n, +ind = i(#$grid,P + neighbors[3*n,3]); +ind>=0?(nY = I[#$points,ind]; norm"$P"(nY - Y)<=$R?(is_sample_ok = 0; break())); # Invalid point +); +is_sample_ok?(insert_active_point(Y); break()); +); +); +); +k>=$K?da_remove(#$active,indX); # Remove point from active list +); +resize(#$points,1,da_size(#$points),1,3,0)" +k[0] +} ++_poissondisk : +R,P,C=${1-3} +0 eval " +dmin(dx,dy,dz,C) = ( +_dx = dx*C; _dy = dy*C; _dz = dz*C; +norm"$P"(min(abs(_dx),abs(_dx + C),abs(_dx - C)), +min(abs(_dy),abs(_dy + C),abs(_dy - C)), +min(abs(_dz),abs(_dz + C),abs(_dz - C))); +); +for (n = 1, n<4, ++n, +is_none_added = 1; +for (k = -n, k<=n, ++k, +for (j = -n, j<=n, ++j, +for (i = -n, i<=n, ++i, +abs(maxabs(i,j,k))==n && dmin(i,j,k,$C)<$R?(da_push([i,j,k]); is_none_added = 0) +) +) +); +is_none_added?break(); +); +resize(#-1,1,da_size(),1,3,0)" +#@cli normp : p>=0 +#@cli : Compute the pointwise Lp-norm norm of vector-valued pixels in selected images. +#@cli : Default value: 'p=2'. +#@cli : $ image.jpg +normp[0] 0 +normp[0] 1 +normp[0] 2 +normp[0] inf +normp : check "isnum(${1==2}) && $1>=0" +e[^-1] "Compute pointwise L"$1"-norm of vectors, in image$?." +if $1==0 != 0 compose_channels + +elif $1==1 abs compose_channels + +elif $1==2 norm +elif $1==inf abs compose_channels max +else ^ $1 compose_channels + ^ {1/$1} +fi +#@cli norm1 +#@cli : Compute the pointwise L1-norm of vector-valued pixels in selected images. +#@cli : $ image.jpg +norm1 +#@cli : $$ +norm1 : +e[^-1] "Compute pointwise L1-norm of vectors, in image$?." +abs compose_channels + +#@cli norm : eq. to 'norm2'. +norm : +_gmic_s="$?" v + _norm2 +#@cli norm2 +#@cli : Compute the pointwise L2-norm (euclidean norm) of vector-valued pixels in selected images. +#@cli : $ image.jpg +norm +#@cli : $$ +norm2 : +_gmic_s="$?" v + _$0 +_norm2 : +e[^-1] "Compute pointwise euclidean norm of vectors, in image"$_gmic_s"." +sqr compose_channels + sqrt +#@cli n : eq. to 'normalize'. : (+) +#@cli normalize : { value0[%] | [image0] },{ value1[%] | [image1] },_constant_case_ratio : [image] : (+) +#@cli : Linearly normalize values of selected images in specified range. +#@cli : (eq. to 'n'). +#@cli : $ image.jpg split x,2 normalize[-1] 64,196 append x +#@cli : $$ +#@cli normalize_l2 +#@cli : Normalize selected images such that they have a unit L2 norm. +normalize_l2 : +e[^-1] "Normalize image$?, s.t they have a unit L2 norm." +repeat $! { /[$>] {norm={$>,in};if(norm!=0,norm,1)} } +#@cli normalize_sum +#@cli : Normalize selected images such that they have a unit sum. +#@cli : $ image.jpg +histogram 256 normalize_sum[-1] display_graph[-1] 400,300 +normalize_sum : +e[^-1] "Normalize image$?, s.t they have a unit sum." +repeat $! { /[$>] {sum={$>,is};if(sum!=0,sum,1)} } +#@cli not +#@cli : Apply boolean not operation on selected images. +#@cli : $ image.jpg +ge 50% +not[-1] +not : +e[^-1] "Apply boolean not operation on image$?." +== 0 +#@cli orientation +#@cli : Compute the pointwise orientation of vector-valued pixels in selected images. +#@cli : $ image.jpg +orientation +norm[-2] negate[-1] mul[-2] [-1] reverse[-2,-1] +#@cli : $$ +orientation : +e[^-1] "Compute pointwise orientation vectors, in image$?." +repeat $! { +norm[$>] replace. 0,1 /[$>,-1] } +#@cli oneminus +#@cli : For each selected image, compute one minus image. +#@cli : $ image.jpg normalize 0,1 +oneminus +oneminus : +e[^-1] "Compute one minus selected images$?." +* -1 + 1 +#@cli otsu : _nb_levels>0 +#@cli : Hard-threshold selected images using Otsu's method. +#@cli : The computed thresholds are returned as a list of values in the status. +#@cli : Default value: 'nb_levels=256'. +#@cli : $ image.jpg luminance +otsu , +otsu : check "isint(${1=256}) && $1>0" +e[^-1] "Hard-threshold image$? using Otsu\47s method, with $1 histogram levels." +foreach { +imM:=[im,iM] +histogram $1,$imM +otsu:=" +sum = sumB = wB = best_variance = best_t = 0; +repeat (w,t,sum+=t*i[t]); +repeat (w,t, +wB+=i[t]; +if (!wB, continue()); +wF = whds#-2 - wB; +if (!wF, break()); +sumB+=t*i[t]; +mB = sumB/wB; +mF = (sum - sumB)/wF; +variance = wB*wF*(mB - mF)^2; +if (variance>best_variance, best_variance = variance; best_t = t); +); +imM = ["$imM"]; +imM[0] + best_t*(imM[1] - imM[0])/(w - 1)" +rm. >=. $otsu +if $> u ${},$otsu else u $otsu fi +} +#@cli polar2complex +#@cli : Compute polar to complex transforms of selected images. +polar2complex : +e[^-1] "Compute polar to complex transforms of image$?." +repeat int($!/2) { +l[{2*$>},{2*$>+1}] { +ri[1] [0],3 +sin. cos.. *. ... *[-3,-2] +} +} +#@cli quantize : nb_levels>=1,_keep_values={ 0 | 1 },_quantization_type={ -1=median-cut | 0=k-means | 1=uniform } +#@cli : Quantize selected images. +#@cli : Default value: 'keep_values=1' and 'quantization_type=0'. +#@cli : $ image.jpg luminance +quantize 3 +#@cli : $ 200,200,1,1,'cos(x/10)*sin(y/10)' +quantize[0] 6 +quantize[0] 4 +quantize[0] 3 +quantize[0] 2 +quantize : check "isint($1) && $1>=1 && isbool(${2=1}) && isint(${3=0}) && $3>=-1 && $3<=1" +e[^-1] "Quantize image$? using $1 levels, "${arg0\ !$2,with,without}" keeping value range." +foreach { +if $3==1 +if s==1 +if $2 mM:=[im,iM] n 0,$1 round 1,-1 min {$1-1} n $mM +else n 0,$1 round 1,-1 min {$1-1} fi +else mM:=[im,iM] uniform_distribution $1,{s} n. $mM index.. .,0,$2 rm. +fi +else +colormap $1,{!$3},1 index.. .,0,$2 rm. +fi +} +#@cli quantize_area : _min_area>0 +#@cli : Quantize selected images such that each flat region has an area greater or equal to 'min_area'. +#@cli : Default value: 'min_area=10'. +#@cli : $ image.jpg quantize 3 +blur 1 round[-1] +quantize_area[-1] 2 +quantize_area : check "${1=10}>0" +e[^-1] "Quantize image$? by regions of areas greater than $1." +if $1==1 return fi +foreach { +if s>1 +f. "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm. round. 0.01 else [0] fi +area. 0,0 <. $1 +do +[0] +f.. "* +begin( +const boundary = 1; +offx = [ -1,1,0,0,0,0 ]; +offy = [ 0,0,-1,1,0,0 ]; +offz = [ 0,0,0,0,-1,1 ]; +nb_offs = d>1?6:h>1?4:2; +); +is_neighbor = j(-1) && j(-1); +if (h>1, is_neighbor&=j(1,0) && j(0,1)); +if (d>1, is_neighbor&=j(0,0,-1) && j(0,0,1)); +is_neighbor = !is_neighbor; +i && is_neighbor?( +col0 = I(#0); +kmin = -1; +distmin = inf; +repeat (nb_offs,k, +p = offx[k]; +q = offy[k]; +r = offz[k]; +if (!j(p,q,r), +col = J(#0,p,q,r); +dist = norm(col-=col0); +if (dist=0, +I(#-1) = J(#0,offx[kmin],offy[kmin],offz[kmin]); +0, +1 +); +):i" +rv[0,-1] rm. +while iM +rm. +} +#@cli rand : { value0[%] | [image0] },_{ value1[%] | [image1] } : [image] : (+) +#@cli : Fill selected images with random values uniformly distributed in the specified range. +#@cli : $ 400,400,1,3 rand -10,10 +blur 10 sign[-1] +#@cli rand_sum : sum>0,_random_function +#@cli : Fill selected images with strictly positive, random, integer values, that sums to 'sum'. +#@cli : For each image, 'sum' must be greater or equal than 'width*height*depth*spectrum'. +#@cli : Default value: 'random_function=u'. +#@cli : $ 100 rand_sum 1000 +rand_sum : check "isint($1) && isexpr(${3=u})" +e[^-1] "Fill image$? with strictly positive, random, integer values that sums to $1, with random function '$3'." +foreach { +if whds>$1 +error[0--4] "Command 'rand_sum': Image ["$>"] = ("{[w,h,d,s]}") has "{whds}" elements (should be <=$1)." +fi +f. "abs($3)" *. {($1-whds)/is} round. +. 1 +eval " +sum = is; +while (sum!=$1, +off = int(u(whds))%whds; +val = i[off]; +delta = $1 - sum; +absdeltap1 = abs(delta) + 1; +dval = sign(delta)*(int(u(1,absdeltap1))%absdeltap1); +val + dval>0?(i[off]+=dval; sum+=dval); +)" +} +#@cli replace : source,target +#@cli : Replace pixel values in selected images. +#@cli : $ (1;2;3;4) +replace 2,3 +replace : +e[^-1] "Replace pixel values $1 with $2 in image$?." +f "i==$1?($2):i" +#@cli replace_inf : _expression +#@cli : Replace all infinite values in selected images by specified expression. +#@cli : $ (0;1;2) log +replace_inf 2 +replace_inf : +e[^-1] "Replace all infinite values in image$? by expression '$1'." +f "isinf(i)?($1):i" +#@cli replace_infnan : _expression +#@cli : Replace all NaN and infinite values in selected images by specified expression. +replace_infnan : +e[^-1] "Replace all +-inf and NaN values in images$? by expression '$1'." +f "isinf(i) || isnan(i)?($1):i" +#@cli replace_nan : _expression +#@cli : Replace all NaN values in selected images by specified expression. +#@cli : $ (-1;0;2) sqrt +replace_nan 2 +replace_nan : +e[^-1] "Replace all NaN values in images$? by expression '$1'." +f "isnan(i)?($1):i" +#@cli replace_seq : "search_seq","replace_seq" +#@cli : Search and replace a sequence of values in selected images. +#@cli : $ (1;2;3;4;5) +replace_seq "2,3,4","7,8" +replace_seq : skip "${2=''}" +e[^-1] "Replace value sequence '$1' by value sequence '${2--1}' in image$?." +y foreach { +nm={n} +1,100% +eval "ref([ $1 ],str1); +ref([ ${2--1} ],str2); +copy_block(pd,src,len) = ( +l = len; +pd + l>=h#1?resize(#1,1,h(#1) + 3*l,1,1,0); +copy(i[pd],src,l); +pd+=l; +); +for (ps = pd = 0, ps=0, +qs>ps?copy_block(pd,i[#0,ps],qs - ps); +copy_block(pd,str2,size(str2)); +ps = qs + size(str1); +); +ps $nm +} +#@cli replace_str : "search_str","replace_str" +#@cli : Search and replace a string in selected images (viewed as strings, i.e. sequences of character codes). +#@cli : $ ('"Hello there, how are you ?"') +replace_str "Hello there","Hi David" +replace_str : skip "${2=}" +e[^-1] "Replace string '"{/"$1"}"' by string '"{/"${2--1}"}"' in image$?." +replace_seq {``{'"$1"'}},{'"${2--1}"'} +#@cli round : rounding_value>=0,_rounding_type : (no arg) : (+) +#@cli : Round values of selected images. +#@cli : 'rounding_type' can be { -1=backward | 0=nearest | 1=forward }. +#@cli : Default value: 'rounding_type=0'. +#@cli : $ image.jpg +round 100 +#@cli : $ image.jpg mul {pi/180} sin +round +#@cli roundify : gamma>=0 +#@cli : Apply roundify transformation on float-valued data, with specified gamma. +#@cli : Default value: 'gamma=0'. +#@cli : $ 1000 fill '4*x/w' repeat 5 { +roundify[0] {$>*0.2} } append c display_graph 400,300 +roundify : check $1>=0 +e[^-1] "Roundify image$?, with gamma $1." +if $1==1 return fi +foreach { +round 1 -.. . +*.. 2 abs. ^. $1 sign... *[-3,-1] *.. 0.5 + } +#@cli = : eq. to 'set'. : (+) +#@cli set : value,_x[%],_y[%],_z[%],_c[%] : (+) +#@cli : Set pixel value in selected images, at specified coordinates. +#@cli : (eq. to '=').\n +#@cli : If specified coordinates are outside the image bounds, no action is performed. +#@cli : Default values: 'x=y=z=c=0'. +#@cli : $ 2,2 set 1,0,0 set 2,1,0 set 3,0,1 set 4,1,1 +#@cli : $ image.jpg repeat 10000 { set 255,{u(100)}%,{u(100)}%,0,{u(100)}% } +#@cli threshold : value[%],_is_soft={ 0 | 1 } : +#@cli : Threshold values of selected images. +#@cli : 'soft' can be { 0=hard-thresholding | 1=soft-thresholding }. +#@cli : Default value: 'is_soft=0'. +#@cli : $ image.jpg +threshold[0] 50% +threshold[0] 50%,1 +#@cli : $$ +threshold : check "isexpr($1) && isbool(${2=0})" +e[^-1] ${"arg0 !$2,Soft,Hard"}"-threshold image$? by $1." +if $2 +f "begin( +str = ['$1']; +value = str[size(str)-1]==_'%'?im + (iM-im)*$1:$1 +); +i>=value?i - value: +i<=-value?i + value:0" +else ge $1 +fi +#@cli vector2tensor +#@cli : Convert selected vector fields to corresponding tensor fields. +vector2tensor : +e[^-1] "Convert vector field$? to tensor field$?." +foreach { +s c +if $!==2 +sqr. *.. ... sqr... +elif $!==3 +sqr.. +*... .. +sqr... *[-5,-4] [-6] sqr[-6] +else error[0--4] "Command '$0': Invalid image ["{$!-$>-1}"] : Dimensions "{w}","{h}","{d}","{s}" does not +represent a field of 2D or 3D vectors." +fi +a c +} +#@cli :: Colors +#@cli adjust_colors : -100<=_brightness<=100,-100<=_contrast<=100,-100<=_gamma<=100,-100<=_hue_shift<=100,-100<=_saturation<=100,_value_min,_value_max +#@cli : Perform a global adjustment of colors on selected images. +#@cli : Range of correct image values are considered to be in [value_min,value_max] (e.g. [0,255]). +#@cli : If 'value_min==value_max==0', value range is estimated from min/max values of selected images. +#@cli : Processed images have pixel values constrained in [value_min,value_max]. +#@cli : Default values: 'brightness=0', 'contrast=0', 'gamma=0', 'hue_shift=0', 'saturation=0', 'value_min=value_max=0'. +#@cli : $ image.jpg +adjust_colors 0,30,0,0,30 +adjust_colors : check "${1=0}>=-100 && $1<=100 && ${2=0}>=-100 && $2<=100 && ${3=0}>=-100 && $3<=100 && +${4=0}>=-100 && $4<=100 && ${5=0}>=-100 && $5<=100" skip ${6=0},${7=0} +e[^-1] "Adjust colors of image$?, with brightness $1, contrast $2, gamma $3, hue shift $4, saturation $5 and +value range [$6,$7]." +foreach { split_opacity l[0] { +range:="$6==$7 && $6==0?[im,iM]:[min($6,$7),max($6,$7)]" +m:=arg(1,$range) M:=arg(2,$range) fact:=255/max(1e-5,$M-$m) +- $m * $fact +if $4" || "$5 +to_rgb[0] rgb2hsv[0] +sh[0] 0 +. {$4*1.8} rm. +sh[0] 1 +. {($5%)^(1+($5>0))} c. 0,1 rm. +hsv2rgb[0] +fi +if $3 +/[0] 255 ^[0] {10^-($3%)} *[0] 255 +fi +if $2 +-[0] 128 *[0] {exp($2/64)} +[0] 128 +fi ++[0] {$1*2} +/[0] $fact +[0] $m c[0] $range +a c +} a c } +#@cli ac : eq. to 'apply_channels'. +ac : +_gmic_s="$?" v + _apply_channels $"*" +#@cli apply_channels : "command",color_channels,_value_action={ 0=none | 1=cut | 2=normalize } +#@cli : Apply specified command on the chosen color channel(s) of each selected images. +#@cli : (eq. to 'ac').\n +#@cli : Argument 'color_channels' refers to a colorspace, and can be basically one of +#@cli : { all | rgba | [s]rgb | ryb | lrgb | ycbcr | lab | lch | hsv | hsi | hsl | cmy | cmyk | yiq }. +#@cli : You can also make the processing focus on a few particular channels of this colorspace, +#@cli : by setting 'color_channels' as 'colorspace_channel' (e.g. 'hsv_h' for the hue). +#@cli : All channel values are considered to be provided in the [0,255] range. +#@cli : Default value: 'value_action=0'. +#@cli : $ image.jpg +apply_channels "equalize blur 2",ycbcr_cbcr +apply_channels : +_gmic_s="$?" v + _$0 $"*" +_apply_channels : check "isint(${3=0}) && $3>=0 && $3<=2" +channels=${"_ac_list \"$2\""} +e[^-1] "Apply command '$1' on channels '"$channels"' of image"$_gmic_s"." +('$/') id:="h=0;for(k=0,k0,0<=_dithering<=1,_method={ 0=median-cut | 1=k-means } +#@cli : Index selected vector-valued images by adapted colormaps. +#@cli : Default values: 'dithering=0' and 'method=1'. +#@cli : $ image.jpg +autoindex[0] 4 +autoindex[0] 8 +autoindex[0] 16 +autoindex : check "isint($1) && $1>0 && ${2=0}>=0" skip ${3=1} +e[^-1] "Index colors in images$? by adapted colormap with $1 entries, dithering level $2 and "${arg0\ !$3,k-means,median-cut}" method." +foreach { +if w>h if w>256 +r2dx 256 else [0] fi +else if h>256 +r2dy 256 else [0] fi +fi +colormap[1] $1,$3,0 +index[0] [1],$2,1 rm[1] +} +#@cli bayer2rgb : _GM_smoothness,_RB_smoothness1,_RB_smoothness2 +#@cli : Transform selected RGB-Bayer sampled images to color images. +#@cli : Default values: 'GM_smoothness=RB_smoothness=1' and 'RB_smoothness2=0.5'. +#@cli : $ image.jpg rgb2bayer 0 +bayer2rgb 1,1,0.5 +bayer2rgb : skip ${1=1},${2=1},${3=0.5} +e[^-1] "Transform RGB-Bayer image$? to color images, with smoothness ($1,$2,$3)." +channels 0 +foreach { +expand_x {"2 + 4*$1"},0 expand_y {"2 + 4*$1"},0 +(-1,1;1,-1) r. ..,..,1,1,0,2 ++*.. . +(0.25,0.5,0.25) convolve.. . transpose. convolve.. . rm. +b. $1 +*.. . +-[-3,-2] +(1,-1) r. ..,..,1,1,0,2 +*. ... +(0.25,0.5,0.25) convolve.. . transpose. convolve.. . rm. +blur_y. $2 blur_x. $3 +(1;-1) r. ..,..,1,1,0,2 +*. [-4] +(0.25,0.5,0.25) convolve.. . transpose. convolve.. . rm. +blur_x. $2 blur_y. $3 ++[-2,-1] /. 2 +(2,0;0,-2) r. ..,..,1,1,0,2 +*. .. +-[-4,-1] +a[-3--1] c +mix_rgb. 1,-1,2,1,1,0,1,-1,-2 +shrink_x {"2 + 4*$1"},0 shrink_y {"2 + 4*$1"},0 +c 0,255 +} +#@cli clut : "clut_name",_resolution>0,_cut_and_round={ 0=no | 1=yes } +#@cli : Insert one of the 1105 pre-defined CLUTs at the end of the image list.\n +#@cli : 'clut_name' can be { 12_years_a_slave | 1917 | 2-strip-process | 60s | 60s_faded | 60s_faded_alt | 7drk_21 | action_magenta_01 | action_red_01 | ad_astra | adventure_1453 | agfa_apx_100 | agfa_apx_25 | agfa_precisa_100 | agfa_ultra_color_100 | agfa_vista_200 | agressive_highligjtes_recovery_5 | aladdin | alberto_street | alien_green | ampio | amstragram | amstragram+ | analog_film_1 | 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 | anime | ant-man | apocalypse_this_very_moment | aqua | aqua_and_orange_dark | aquaman | arabica_12 | asistas | atomic_pink | atusa | autumn | ava_614 | avalanche | avengers_endgame | azrael_93 | baby_driver | bad_boys_for_life | basuco | bboyz_2 | bc_darkum | beach_aqua_orange | beach_faded_analog | beati | beauty_and_the_beast | berlin_sky | bisogno | black_and_white | black_panther | black_star | black_white_01 | black_white_02 | black_white_03 | black_white_04 | black_white_05 | black_white_06 | blade_runner | bleach_bypass | bleachbypass_1 | bleachbypass_2 | bleachbypass_3 | bleachbypass_4 | bleech_bypass_green | bleech_bypass_yellow_01 | blue_cold_fade | blue_dark | blue_house | blue_ice | blue_mono | blue_shadows_01 | bluearchitecture | bluehour | blues | bob_ford | bohemian_rhapsody | bombshell | bourbon_64 | boyado | bright_green_01 | bright_teal_orange | bright_warm | brightgreen | brown_mobster | brownbm | brownish | bw_1 | bw_10 | bw_2 | bw_3 | bw_4 | bw_5 | bw_6 | bw_7 | bw_8 | bw_9 | bw_but_yellow | byers_11 | calidum | candlelight | captain_marvel | caribe | chemical_168 | chrome_01 | cineblue | cinebm_4k | cinema | cinema_2 | cinema_3 | cinema_4 | cinema_5 | cinema_noir | cinematic-1 | cinematic-10 | cinematic-2 | cinematic-3 | cinematic-4 | cinematic-5 | cinematic-6 | cinematic-7 | cinematic-8 | cinematic-9 | cinematic_01 | cinematic_02 | cinematic_03 | cinematic_for_flog | cinematic_forest | cinematic_lady_bird | cinematic_mexico | city | city_7 | city_dust | city_of_god | classic_films_01 | classic_films_02 | classic_films_03 | classic_films_04 | classic_films_05 | classic_teal_and_orange | clayton_33 | clear_teal_fade | clouseau_54 | cobi_3 | coffee_44 | cold_clear_blue | cold_clear_blue_1 | cold_ice | cold_simplicity_2 | coldchrome | color_rich | colore | colorful_0209 | colornegative | conflict_01 | contrail_35 | contrast_with_highlights_protection | contrasty_afternoon | contrasty_green | convold | cosa | creed_2 | crispautumn | crispromance | crispwarm | crispwinter | cross_process_cp_130 | cross_process_cp_14 | cross_process_cp_15 | cross_process_cp_16 | cross_process_cp_18 | cross_process_cp_3 | cross_process_cp_4 | cross_process_cp_6 | crushin | cubicle_99 | culor | d_o_1 | dark_blues_in_sunlight | dark_green_02 | dark_green_1 | dark_man_x | dark_orange_teal | dark_place_01 | darkandsomber | darkness | date_39 | day_4nite | day_for_night | day_to_night_kings_blue | deep | deep_blue | deep_dark_warm | deep_high_contrast | deep_teal_fade | deep_warm_fade | deepskintones_2 | deepskintones_3 | delicatessen | denoiser_simple_40 | desert_gold_37 | dimension | dimmer | directions_23 | django_25 | doctor_strange | domingo_145 | dream_1 | dream_85 | drop_green_tint_14 | dropblues | dunkirk | duotone_blue_red | earth_tone_boost | edgyember | elegance_38 | enchanted | ensaya | eterna_for_flog | expired_69 | expired_fade | expired_polaroid | extreme | fade | fade_to_green | faded | faded_47 | faded_alt | faded_analog | faded_extreme | faded_green | faded_pink-ish | faded_print | faded_retro_01 | faded_retro_02 | faded_vivid | fadedlook | fallcolors | falua | farkling | fatos | faux_infrared | faux_infrared_bw_1 | faux_infrared_color_p_2 | faux_infrared_color_p_3 | faux_infrared_color_r_0a | faux_infrared_color_r_0b | faux_infrared_color_yp_1 | fezzle | fgcinebasic | fgcinebright | fgcinecold | fgcinedrama | fgcinetealorange_1 | fgcinetealorange_2 | fgcinevibrant | fgcinewarm | fight_club | film_0987 | film_9879 | film_gb-19 | film_high_contrast | film_print_01 | film_print_02 | filmic | filo | flat_30 | flat_blue_moon | flavin | foggynight | folger_50 | ford_v_ferrari | foresta | formula_b | french_comedy | frosted | frostedbeachpicnic | fuji_160c | fuji_160c_+ | fuji_160c_++ | fuji_160c_- | fuji_3510_constlclip | fuji_3510_constlmap | fuji_3510_cuspclip | fuji_3513_constlclip | fuji_3513_constlmap | fuji_3513_cuspclip | fuji_400h | fuji_400h_+ | fuji_400h_++ | fuji_400h_- | fuji_800z | fuji_800z_+ | fuji_800z_++ | fuji_800z_- | fuji_astia_100_generic | 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_alt | 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_hdr | fuji_neopan_1600 | fuji_neopan_1600_+ | fuji_neopan_1600_++ | fuji_neopan_1600_- | fuji_neopan_acros_100 | fuji_provia_100_generic | 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_100_generic | fuji_velvia_50 | fuji_xtrans_iii_acros | fuji_xtrans_iii_acros+g | fuji_xtrans_iii_acros+r | fuji_xtrans_iii_acros+ye | fuji_xtrans_iii_astia | fuji_xtrans_iii_classic_chrome | fuji_xtrans_iii_mono | fuji_xtrans_iii_mono+g | fuji_xtrans_iii_mono+r | fuji_xtrans_iii_mono+ye | fuji_xtrans_iii_pro_neg_hi | fuji_xtrans_iii_pro_neg_std | fuji_xtrans_iii_provia | fuji_xtrans_iii_sepia | fuji_xtrans_iii_velvia | fusion_88 | futuristicbleak_1 | futuristicbleak_2 | futuristicbleak_3 | futuristicbleak_4 | going_for_a_walk | golden | golden_bright | golden_fade | golden_mono | golden_night_softner_43 | golden_sony_37 | golden_vibrant | goldengate | goldentime | 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 | good_morning | green_15 | green_2025 | green_action | green_afternoon | green_and_orange | green_blues | green_book | green_conflict | green_day_01 | green_day_02 | green_g_09 | green_indoor | green_light | green_mono | green_yellow | greenish_contrasty | greenish_fade | greenish_fade_1 | gremerta | greyhound | hackmanite | hallowen_dark | happyness_133 | hard_teal_orange | hardboost | harsh_day | harsh_sunset | helios | herderite | heulandite | hiddenite | highlights_protection | hilutite | hitman | hlg_1_1 | honey_light | hong_kong | horrorblue | howlite | huesio | husmes | huyan | hydracore | hyla_68 | hypersthene | hypnosis | hypressen | i_tonya | ideo | ilford_delta_100 | ilford_delta_3200 | ilford_delta_3200_+ | ilford_delta_3200_++ | ilford_delta_3200_- | ilford_delta_400 | ilford_fp_4_plus_125 | ilford_hp_5 | ilford_hp_5_+ | ilford_hp_5_++ | ilford_hp_5_- | ilford_hp_5_plus_400 | ilford_hps_800 | ilford_pan_f_plus_50 | ilford_xp_2 | inception | indoor_blue | industrial_33 | infrared_-_dust_pink | instantc | jarklin | jojo_rabbit | joker | jumanji_the_next_level | jurassic_world_fallen_kingdom | justice_league | justpeachy | jwick_21 | k_tone_vintage_kodachrome | kh_1 | kh_10 | kh_2 | kh_3 | kh_4 | kh_5 | kh_6 | kh_7 | kh_8 | kh_9 | killstreak | kingsman_the_golden_circle | knives_out | kodak_2383_constlclip | kodak_2383_constlmap | kodak_2383_cuspclip | kodak_2393_constlclip | kodak_2393_constlmap | kodak_2393_cuspclip | kodak_bw_400_cn | kodak_e-100_gx_ektachrome_100 | kodak_ektachrome_100_vs | kodak_ektachrome_100_vs_generic | kodak_ektar_100 | 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_kodachrome_64_generic | 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_portra_800_hc | 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_tmax_3200_alt | kodak_tri-x_400 | kodak_tri-x_400_+ | kodak_tri-x_400_++ | kodak_tri-x_400_- | kodak_tri-x_400_alt | korben_214 | la_la_land | landscape_01 | landscape_02 | landscape_03 | landscape_04 | landscape_05 | landscape_1 | landscape_10 | landscape_2 | landscape_3 | landscape_4 | landscape_5 | landscape_6 | landscape_7 | landscape_8 | landscape_9 | lateafternoonwanderlust | latesunset | lavark | lc_1 | lc_10 | lc_2 | lc_3 | lc_4 | lc_5 | lc_6 | lc_7 | lc_8 | lc_9 | lenox_340 | levex | life_giving_tree | light_blown | litore | little_women | logan | lomo | lomography_redscale_100 | lomography_x-pro_slide_200 | london_nights | longbeachmorning | loro | lotta | louetta | low_contrast_blue | low_key_01 | lucky_64 | lushgreen | lushgreensummer | mad_max_fury_road | maesky | magenta_day | magenta_day_01 | magenta_dream | magenta_yellow | magentacoffee | magichour | marriage_story | matrix | mckinnon_75 | memories | mercato | metropolis | milo_5 | minimalistcaffeination | modern_film | modern_films_01 | modern_films_02 | modern_films_03 | modern_films_04 | modern_films_05 | modern_films_06 | modern_films_07 | molti | mono_tinted | monochrome | monochrome_1 | monochrome_2 | moody_1 | moody_10 | moody_2 | moody_3 | moody_4 | moody_5 | moody_6 | moody_7 | moody_8 | moody_9 | moonlight | moonlight_01 | moonlight_2 | moonrise | morning_6 | morroco_16 | mostly_blue | mother! | motus | moviz_1 | moviz_10 | moviz_11 | moviz_12 | moviz_13 | moviz_14 | moviz_15 | moviz_16 | moviz_17 | moviz_18 | moviz_19 | moviz_2 | moviz_20 | moviz_21 | moviz_22 | moviz_23 | moviz_24 | moviz_25 | moviz_26 | moviz_27 | moviz_28 | moviz_29 | moviz_3 | moviz_30 | moviz_31 | moviz_32 | moviz_33 | moviz_34 | moviz_35 | moviz_36 | moviz_37 | moviz_38 | moviz_39 | moviz_4 | moviz_40 | moviz_41 | moviz_42 | moviz_43 | moviz_44 | moviz_45 | moviz_46 | moviz_47 | moviz_48 | moviz_5 | moviz_6 | moviz_7 | moviz_8 | moviz_9 | mucca | mute_shift | muted_01 | muted_fade | mysticpurplesunset | nah | natural_vivid | naturalboost | nemesis | neon_770 | neutral_pump | neutral_teal_orange | neutral_warm_fade | newspaper | night_01 | night_blade_4 | night_king_141 | night_spy | nightfromday | nightlife | nigrum | no_time_to_die | nostalgiahoney | nostalgic | nw-1 | nw-10 | nw-2 | nw-3 | nw-4 | nw-5 | nw-6 | nw-7 | nw-8 | nw-9 | old_west | once_upon_a_time | once_upon_a_time_in_hollywood | onda | only_red | only_red_and_blue | operation_yellow | orange_dark_4 | orange_dark_7 | orange_dark_look | orange_tone | orange_underexposed | orangeandblue | oranges | padre | paladin | paladin_1875 | parasite | partia | pasadena_21 | passing_by | perso | picola | pink_fade | pirates_of_the_caribbean | pitaya_15 | pmcinematic_01 | pmcinematic_02 | pmcinematic_03 | pmcinematic_04 | pmcinematic_05 | pmcinematic_06 | pmcinematic_07 | pmnight_01 | pmnight_02 | pmnight_03 | pmnight_04 | pmnight_05 | 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_--- | portrait_1 | portrait_10 | portrait_2 | portrait_3 | portrait_4 | portrait_5 | portrait_6 | portrait_7 | portrait_8 | portrait_9 | progressen | protect_highlights_01 | prussian_blue | pseudogrey | purple | purple_2 | randas | red_afternoon_01 | red_day_01 | red_dream_01 | redblueyellow | reds | reds_oranges_yellows | reeve_38 | remy_24 | rest_33 | retro | retro_brown_01 | retro_magenta_01 | retro_summer_3 | retro_yellow_01 | rocketman | rollei_ir_400 | rollei_ortho_25 | rollei_retro_100_tonal | rollei_retro_80s | rotate_muted | rotate_vibrant | rotated | rotated_crush | satid | saturated_blue | saving_private_damon | scala | science_fiction | scrittle | sea | seges | selor | sensum | separation | serenity | seringe_4 | serpent | seventies_magazine | sevsuz | shade_kings_ink | shadow_king_39 | shine | sicario | sino | skin_tones | smart_contrast | smokey | smooth_clear | smooth_cromeish | smooth_fade | smooth_green_orange | smooth_sailing | smooth_teal_orange | soft_fade | softblackandwhite | softwarming | solarized_color | solarized_color_2 | soldi | spider-man_far_from_home | spotlight | springmorning | sprocket_231 | spy_29 | star_wars_the_rise_of_skywalker | strano | street | stringa | studio_skin_tone_shaper | subtle_blue | subtle_green | subtle_yellow | sully | summer | summer_alt | sunlightlove | sunny | sunny_alt | sunny_rich | sunny_warm | sunset_aqua_orange | sunset_intense_violet_blue | sunset_violet_mood | super_warm | super_warm_rich | sutro_fx | sweet_bubblegum | sweet_gelatto | taiga | tarraco | teal_fade | teal_moonlight | tealmagentagold | tealorange | tealorange_1 | tealorange_2 | tealorange_3 | technicalfx_backlight_filter | teigen_28 | tenet | tensiongreen_1 | tensiongreen_2 | tensiongreen_3 | tensiongreen_4 | terra_4 | the_dark_knight | the_darkest_hour | the_gentelmen | the_grand_budapest_hotel | the_hurt_locker | the_irishman | the_lighthouse | the_lobster | the_martian | the_matrices | the_revenant | the_shape_of_water | the_social_network | the_two_popes | the_way_back | thor_ragnarok | thriller_2 | tirare | toastedgarden | top_gun_maverick | trent_18 | true_colors_8 | turkiest_42 | tutto | tweed_71 | ultra_water | uncut_gems | undeniable | undeniable_2 | underwater | unknown | upglow | urban_01 | urban_02 | urban_03 | urban_04 | urban_05 | urban_cowboy | uzbek_bukhara | uzbek_marriage | uzbek_samarcande | valize | valsky | velvetia | venom | very_warm_greenish | vfb_21 | vibrant | vibrant_alien | vibrant_contrast | vibrant_cromeish | victory | vintage | vintage_01 | vintage_02 | vintage_03 | vintage_04 | vintage_05 | vintage_163 | vintage_alt | vintage_brighter | vintage_chrome | vintage_mob | vintage_warmth_1 | violet_taste | vireo_37 | vita | vubes | war_for_the_planet_of_the_apes | warm | warm_dark_contrasty | warm_fade | warm_fade_1 | warm_highlight | warm_neutral | warm_sunset_red | warm_teal | warm_vintage | warm_yellow | wavefire | waves | well_see | western | westernlut_2 | whiter_whites | winterlighthouse | wipe | wolf_of_wall_street | wonder_woman | wooden_gold_20 | x-men_dark_phoenix | yellow_55b | yellow_film_01 | yellowstone | you_can_do_it | zed_32 | zeke_39 | zilverfx_bw_solarization | zilverfx_infrared | zilverfx_vintage_bw | zombieland_double_tap } +#@cli : Default values: 'resolution=33' and 'cut_and_round=1'. +#@cli : $ clut summer clut alien_green,17 clut orange_dark4,48 ++clut : check "isnum(${2=33}) && $2>0 && isbool(${3=1})" +strclut "$1" name=${} l[] { +e[^-1] "Input CLUT '"$name"' with resolution $2." +path_clut=${-path_cache} +if isfile(['{/${path_clut}clut_$name.cimgz}']) i ${path_clut}clut_$name.cimgz fi +if $!"!=1 || w<$2 || h<$2 || d<$2" +rm input_cached gmic_cluts.gmz k[${"nmd 1,"$name}] +if $!!=1 +rm i https://gmic.eu/gmic_cluts.gmz o ${path_clut}gmic_cluts.gmz +repeat $! { if ['{$>,n}']==['$name'] k[$>] break fi } +if $!!=1 +error[0--5] "Command '$0': Unknown CLUT name '"$name"'." +fi +fi +decompress_clut $2,$2,$2 +if $3 round c 0,255 to_rgb fi +o. ${path_clut}clut_$name.cimgz +elif "w>$2 || h>$2 || d>$2" r $2,$2,$2,3,2 +fi +k. => $name +} +#@cli cmy2rgb +#@cli : Convert color representation of selected images from CMY to RGB. +cmy2rgb : +e[^-1] "Convert color representation of image$? from CMY to RGB." +rgb2cmy +#@cli cmyk2rgb +#@cli : Convert color representation of selected images from CMYK to RGB. +cmyk2rgb : +e[^-1] "Convert color representation of image$? from CMYK to RGB." +foreach { +s c +/. -255 +. 1 *[0-2] . rm. +[0-2] . rm. +a c cmy2rgb +} +#@cli colorblind : type={ 0=protanopia | 1=protanomaly | 2=deuteranopia | 3=deuteranomaly | 4=tritanopia | 5=tritanomaly | 6=achromatopsia | 7=achromatomaly } +#@cli : Simulate color blindness vision. +#@cli : Simulation method of Vienot, Brettel & Mollon 1999, "Digital video colourmaps for checking the legibility of displays by dichromats". +#@cli : The dichromacy matrices of the paper were adapted to sRGB (RGB->XYZ). +#@cli : Anomalous trichromacy simulated via linear interpolation with the identity and a factor of 0.6. +#@cli : $ image.jpg +colorblind 0 +colorblind : check "isint($1) && $1>=0 && $1<=7" +s0="protanopia" s1="protanomaly" s2="deuteranopia" s3="deuteranomaly" s4="tritanopia" +s5="tritanomaly" s6="achromatopsia" s7="achromatomaly" +e[^-1] "Simulate color blindness of type '"${s$1}"' on image$?." +type0=(0.10889,0.89111,0;0.10889,0.89111,0;0.00447,-0.00447,1.0) +type1=(0.46533,0.53467,0;0.06533,0.93467,0;0.00268,-0.00268,1) +type2=(0.29031,0.70969,0;0.29031,0.70969,0;-0.02197,0.02197,1) +type3=(0.57418,0.42582,0;0.17418,0.82582,0;-0.01318,0.01318,1) +type4=(1,0.15236,-0.15236;0,0.86717,0.13283;0,0.86717,0.13283) +type5=(1,0.09142,-0.09142;0,0.92030,0.07970;0,0.52030,0.47970) +type6=(0.299,0.587,0.114;0.299,0.587,0.114;0.299,0.587,0.114) +type7=(0.618,0.320,0.062;0.163,0.775,0.062;0.163,0.320,0.516) +foreach { split_opacity l[0] { to_rgb srgb2rgb mix_channels ${type$1} rgb2srgb } a c } +#@cli colormap : nb_levels>=0,_method={ 0=median-cut | 1=k-means },_sort_vectors +#@cli : Estimate best-fitting colormap with 'nb_colors' entries, to index selected images. +#@cli : Set 'nb_levels==0' to extract all existing colors of an image. +#@cli : 'sort_vectors' can be { 0=unsorted | 1=by increasing norm | 2=by decreasing occurrence }. +#@cli : Default value: 'method=1' and 'sort_vectors=1'. +#@cli : $ image.jpg +colormap[0] 4 +colormap[0] 8 +colormap[0] 16 +#@cli : $$ https://gmic.eu/oldtutorial/_colormap +colormap : check "isint($1) && $1>=0" skip ${2=1},${3=1} +if $1 e[0--3] "Estimate colormap with $1 entries for image$?, by "${arg0\ !$2,k-means,median-cut}" method." +else e[0--3] "Estimate full colormap for image$?." +fi +foreach { +nm={b} is_half=${-is_half} +if $1 +r {whd},1,1,100%,-1 ++_colormap $1 +if $2 +max_diff:=(iM-im+1)/8192 +do ++index.. . +if $is_half +..,1,1,{1,s} +eval " +csum = vector(#w*s#0); +cocc = vector(#w,0); +repeat (w#2,k, +ind = i[#2,k]; +repeat (s#0,c,csum[ind + c*w]+=i(#0,k,0,0,c)); +++cocc[ind]; +); +off = 0; +repeat (s#0,c, +repeat (w,k,occ = cocc[k]; occ?(csum[off++]/=occ)); +); +draw(#3,csum)" +rm.. +else +..,1,1,{1,s+1} +f.. ">I[#3,i]+=[ I[#0,x],1 ]" rm.. +f. "s = i(x,0,0,s-1); s?I/s:[ I[#1,x], 0 ]" +fi ++-.. . abs. diff:=iM/w rm. +j.. . rm. +while $diff>$max_diff +fi +if $3 index.. .,0,0 histogram.. {[w,0,w-1]} a y sort -,x rows 1 +else rm.. +fi +else ++n. 0,255 f. "ret = vectors(); H = 0; repeat (s,p,(H*=31)+=j(0,0,0,p)); ret[0] = H%2048; ret" +channels. 0 equalize. 2048 n. 0,2047 round. 1 +0x2048 +eval[0] "> +begin(sizes = vector2048(); ret = vectors()); +col_s = I; +H = i#1; indH = H + 2; +sH = sizes[H]; +!sH || find(#indH,col_s,s#0*(sH - 1),-s#0)<0?( # Color not found +sH>=h(#indH)?resize(#indH,s#0,max(8,2*h#indH),1,1,0); +copy(i(#indH,0,sH),col_s); +++sizes[H]; +); +ret; +end(fill(sizes,k,resize(#k + 2,s#0,sizes[k],1,1,0)))" +a[2--1] y permute. yzcx k. +fi +if $3==1 +norm rv a c sort +,x channels 1,100% fi +=> "[colormap of "$nm"]" +} +_colormap : +m "__colormap : repeat s { sh[$""1] $> =.. {iM-im},$""1,0,0,$> rm. }" +1,1,1,{s} __colormap 0 +repeat $1-1 { +b,a:=xM,cM +l[$b] { shift 0,0,0,-$a,2 sort +,x shift 0,0,0,$a,2 xm:=int(w/2) } +if {$b,w>1} +z[$b] $xm,100% z[$b] 0,{$xm-1} else 1,1,1,{$b,s} fi +rv[-2,-1] r. {w+1},1,1,100%,0 +__colormap $b __colormap {$!-2} +} +rm. r 1,1,1,100%,2 a x +um __colormap +#@cli compose_channels +#@cli : Compose all channels of each selected image, using specified arithmetic operator (+,-,or,min,...). +#@cli : Default value: '1=+'. +#@cli : $ image.jpg +compose_channels and +#@cli : $$ +compose_channels : skip ${1="+"} +e[^-1] "Compose all channels of image$?, with operator '$1'." +foreach { +repeat s { sh[0] $> } +$1[^0] r[0] 100%,100%,100%,1,-1 k[0] +} +#@cli deltaE : [image],_metric={ 0=deltaE_1976 | 1=deltaE_2000 },"_to_Lab_command" +#@cli : Compute the CIE DeltaE color difference between selected images and specified [image]. +#@cli : Argument 'to_Lab_command' is a command able to convert colors of [image] into a Lab representation. +#@cli : Default values: 'metric=1' and 'to_Lab_command="srgb2lab"'. +#@cli : $ image.jpg +blur 2 +deltaE[0] [1],1,srgb2lab +deltaE : check ${"is_image_arg $1"}" && isbool(${2=1})" skip "${3=srgb2lab}" +e[^-1] "Compute the CIE DeltaE_"${"s0,s1=1976,2000 u $s$2"}" color difference between image$? and image$1, ""with to_Lab command '$3'." +pass$1 1 +needs_to_lab:="s = ['$3']; s!=0 && s!=' '" +if $needs_to_lab m "_deltaE_to_lab : $3" +_deltaE_to_lab. rm.. fi +repeat $!-1 { l[$>,-1] { +nm={0,n} +if $needs_to_lab _deltaE_to_lab[0] fi +if !$2 -.. . norm.. +else 100%,100%,100%,1,${-math_lib}"deltaE00(I#0,I#1)" rv[0,-1] rm. # DeltaE_2000 +fi +=>[0] $nm +} } +rm. um _deltaE_to_lab +#@cli direction2rgb +#@cli : Compute RGB representation of selected 2D direction fields. +#@cli : $ image.jpg luminance gradient append c blur 2 orientation +direction2rgb +direction2rgb : +e[^-1] "Compute RGB representation of 2D direction field$?." +channels 0,1 +foreach { +nm={n} +s c complex2polar round.. 0.001 +*. {180/pi} %. 360 100%,100%,1,1,1 mv... $! +if im!=iM n. 0,1 else f. 1 fi +a c hsv2rgb => $nm +} +#@cli ditheredbw +#@cli : Create dithered B&W version of selected images. +#@cli : $ image.jpg +equalize ditheredbw[-1] +ditheredbw : +e[^-1] "Create dithered B&W version of image$?." +foreach { split_opacity luminance[0] n[0] 0,255 (0,255) index[0] .,1,1 rm. a c } +#@cli fc : eq. to 'fill_color'. +fc : +_gmic_s="$?" v + _fill_color $* +#@cli fill_color : col1,...,colN +#@cli : Fill selected images with specified color. +#@cli : (eq. to 'fc'). +#@cli : $ image.jpg +fill_color 255,0,255 +#@cli : $$ https://gmic.eu/oldtutorial/_fill_color +fill_color : +_gmic_s="$?" v + _$0 $* +_fill_color : +e[0--3] "Fill image"$_gmic_s" with color (${^0})." +foreach { +repeat s { sh[0] $> f. {arg(1+$>,${^0})} } k[0] +} +#@cli gradient2rgb : _is_orientation={ 0 | 1 } +#@cli : Compute RGB representation of 2D gradient of selected images. +#@cli : Default value: 'is_orientation=0'. +#@cli : $ image.jpg +gradient2rgb 0 equalize[-1] +gradient2rgb : check "isbool(${1=0})" +arg0 !$1,"orientation ","" +e[^-1] "Compute RGB representation of 2D gradient "${}"of image$?." +norm foreach { +if $1 gradient_orientation 2 else g xy fi +a c direction2rgb +} +#@cli hcy2rgb +#@cli : Convert color representation of selected images from HCY to RGB. +hcy2rgb : +e[^-1] "Convert color representation of image$? from HCY to RGB." +to_color f " +H = (R/60)%6; +X = G*(1 - abs(H%2 - 1)); +RGB = arg0(int(H),[G,X,0],[X,G,0],[0,G,X],[0,X,G],[X,0,G],[G,0,X]); +m = B - 0.3*RGB[0] - 0.59*RGB[1] - 0.11*RGB[2]; +cut((RGB+=m)*=255,0,255)" +#@cli hsi2rgb +#@cli : Convert color representation of selected images from HSI to RGB. +hsi2rgb : +e[^-1] "Convert color representation of image$? from HSI to RGB." +to_color +f " +H = (R/60)%6; +S = G; +I = B; +Z = 1 - abs((H%2) - 1); +C = I*S/(1 + Z); +X = C*Z; +m = I*(1 - S)/3; +RGB = arg0(int(H),[C,X,0],[X,C,0],[0,C,X],[0,X,C],[X,0,C],[C,0,X]); +(RGB+=m)*=3*255" +#@cli hsi82rgb +#@cli : Convert color representation of selected images from HSI8 to RGB. +hsi82rgb : +e[^-1] "Convert color representation of image$? from HSI8 to RGB." +_hsx82rgb hsi2rgb +#@cli hsl2rgb +#@cli : Convert color representation of selected images from HSL to RGB. +hsl2rgb : +e[^-1] "Convert color representation of image$? from HSL to RGB." +to_color +f " +H = (R/60)%6; +S = G; +L = B; +C = (1 - abs(2*L - 1))*S; +X = C*(1 - abs(H%2 - 1)); +m = L - C/2; +RGB = arg0(int(H),[C,X,0],[X,C,0],[0,C,X],[0,X,C],[X,0,C],[C,0,X]); +(RGB+=m)*=255" +#@cli hsl82rgb +#@cli : Convert color representation of selected images from HSL8 to RGB. +hsl82rgb : +e[^-1] "Convert color representation of image$? from HSL8 to RGB." +_hsx82rgb hsl2rgb +#@cli hsv2rgb +#@cli : Convert color representation of selected images from HSV to RGB. +#@cli : $ (0,360;0,360^0,0;1,1^1,1;1,1) resize 400,400,1,3,3 hsv2rgb +hsv2rgb : +e[^-1] "Convert color representation of image$? from HSV to RGB." +to_color +f " +H = (R/60)%6; +S = G; +V = B; +C = V*S; +X = C*(1 - abs(H%2 - 1)); +m = V - C; +RGB = arg0(int(H),[C,X,0],[X,C,0],[0,C,X],[0,X,C],[X,0,C],[C,0,X]); +(RGB+=m)*=255" +#@cli hsv82rgb +#@cli : Convert color representation of selected images from HSV8 to RGB. +hsv82rgb : +e[^-1] "Convert color representation of image$? from HSV8 to RGB." +_hsx82rgb hsv2rgb +_hsx82rgb : +repeat $! { +sh[$>] 0 /. 0.708333 rm. +sh[$>] 1,2 /. 255 rm. +} +#@cli int2rgb +#@cli : Convert color representation of selected images from INT24 to RGB. +int2rgb : +e[^-1] "Convert color representation of image$? from INT24 scalars to RGB." +round foreach { +>> 8 &[1] 255 +&[0] 255 >>[0] 16 a c } +#@cli ipremula +#@cli : Convert selected images with premultiplied alpha colors to normal colors. +#@cli : See also: ''premula''. +ipremula : +e[^-1] "Convert image$? with premultiplied alpha colors to normal colors." +to_a foreach { sh. 100% max. 1e-8 sh.. 0,{s#-2-2} /. .. rm[-2,-1] } +#@cli jzazbz2rgb : illuminant={ 0=D50 | 1=D65 | 2=E } : (no arg) +#@cli : Convert color representation of selected images from RGB to Jzazbz. +#@cli : Default value: 'illuminant=2'. +jzazbz2rgb : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0?1:0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from Jzazbz to RGB, using the "${arg0\ $illu,D50,D65,E}" illuminant." +jzazbz2xyz xyz2rgb $illu +#@cli jzazbz2xyz +#@cli : Convert color representation of selected images from RGB to XYZ. +jzazbz2xyz : +e[^-1] "Convert color representation of image$? from Jzazbz to XYZ." +foreach { split_opacity +f[0] ${-_jzazbz_const}" +tmp = i0 + Jzazbz_d0; +Iz = tmp/(1 + Jzazbz_d - Jzazbz_d*tmp); +azz = i1; +bzz = i2; +Lp = Iz + 0.138605043271539*azz + 0.0580473161561189*bzz; +Mp = Iz - 0.138605043271539*azz - 0.0580473161561189*bzz; +Sp = Iz - 0.0960192420263189*azz - 0.811891896056039*bzz; +tmp = Lp^(1/Jzazbz_p); +L = peakLum*((Jzazbz_c1 - tmp)/(Jzazbz_c3*tmp-Jzazbz_c2))^(1/Jzazbz_n); +tmp = Mp^(1/Jzazbz_p); +M = peakLum*((Jzazbz_c1 - tmp)/(Jzazbz_c3*tmp-Jzazbz_c2))^(1/Jzazbz_n); +tmp = Sp^(1/Jzazbz_p); +S = peakLum*((Jzazbz_c1 - tmp)/(Jzazbz_c3*tmp-Jzazbz_c2))^(1/Jzazbz_n); +Xp = 1.92422643578761*L - 1.00479231259537*M + 0.037651404030618*S; +Yp = 0.350316762094999*L + 0.726481193931655*M - 0.065384422948085*S; +Zp = -0.0909828109828476*L - 0.312728290523074*M + 1.52276656130526*S; +X = (Xp + (Jzazbz_b - 1)*Zp)/Jzazbz_b; +Y = (Yp + (Jzazbz_g - 1)*X)/Jzazbz_g; +Z = Zp; +[ X,Y,Z ]/255" +a c } +_jzazbz_const : +u "const Jzazbz_b = 1.15; +const Jzazbz_g = 0.66; +const Jzazbz_c1 = 3424/4096; +const Jzazbz_c2 = 2413/128; +const Jzazbz_c3 = 2392/128; +const Jzazbz_n = 2610/16384; +const Jzazbz_p = 1.7*2523/32; +const Jzazbz_d = -0.56; +const Jzazbz_d0 = 1.6295499532821566e-11; +const peakLum = 10000;" +#@cli lab2lch +#@cli : Convert color representation of selected images from Lab to Lch. +lab2lch : +e[^-1] "Convert color representation of image$? from Lab to Lch." +foreach { to_color s c complex2polar[1,2] a c } +#@cli lab2rgb : illuminant={ 0=D50 | 1=D65 | 2=E } : (no arg) +#@cli : Convert color representation of selected images from Lab to RGB. +#@cli : Default value: 'illuminant=2'. +#@cli : $ (50,50;50,50^-3,3;-3,3^-3,-3;3,3) resize 400,400,1,3,3 lab2rgb +lab2rgb : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0?1:0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from Lab to RGB, using the "${arg0\ $illu,D50,D65,E}" illuminant." +lab2xyz $illu xyz2rgb $illu +#@cli lab2srgb : illuminant={ 0=D50 | 1=D65 | 2=E } : (no arg) +#@cli : Convert color representation of selected images from Lab to sRGB. +#@cli : Default value: 'illuminant=2'. +#@cli : $ (50,50;50,50^-3,3;-3,3^-3,-3;3,3) resize 400,400,1,3,3 lab2rgb +lab2srgb : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0?1:0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from Lab to sRGB, using the "${arg0\ $illu,D50,D65,E}" illuminant." +lab2rgb $illu rgb2srgb +#@cli lab82srgb : illuminant={ 0=D50 | 1=D65 | 2=E } : (no arg) +#@cli : Convert color representation of selected images from Lab8 to sRGB. +#@cli : Default value: 'illuminant=2'. +#@cli : $ (50,50;50,50^-3,3;-3,3^-3,-3;3,3) resize 400,400,1,3,3 lab2rgb +lab82srgb : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0?1:0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from Lab8 to sRGB, using the "${arg0\ $illu,D50,D65,E}" illuminant." +lab82rgb $illu rgb2srgb +#@cli lab2xyz : illuminant={ 0=D50 | 1=D65 | 2=E } : (no arg) +#@cli : Convert color representation of selected images from Lab to XYZ. +#@cli : Default value: 'illuminant=2'. +lab2xyz : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0?1:0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from Lab to XYZ, using the "${arg0\ $illu,D50,D65,E}" illuminant." +to_color +f " +begin( +const epsilon = 216/24389; +const kappa = 24389/27; +D65 = [ 0.4124564, 0.3575761, 0.1804375, +0.2126729, 0.7151522, 0.0721750, +0.0193339, 0.1191920, 0.9503041 ]; +D50 = [ 0.43603516, 0.38511658, 0.14305115, +0.22248840, 0.71690369, 0.06060791, +0.01391602, 0.09706116, 0.71392822 ]; +E = [ 0.488718,0.3106803,0.2006017, +0.1762044,0.8129847,0.0108109, +0,0.0102048,0.9897952 ]; +white = ("$illu"==2?E:"$illu"==1?D65:D50)*[ 1,1,1 ]; +); +fy = (i0 + 16)/116; +fz = fy - i2/200; +fx = i1/500 + fy; +fx3 = fx^3; +fz3 = fz^3; +XYZ = [ fx3>epsilon?fx3:(116*fx - 16)/kappa, +i0>kappa*epsilon?((i0+16)/116)^3:i0/kappa, +fz3>epsilon?fz3:(116*fz - 16)/kappa ]; +XYZ*=white" +#@cli lab82rgb : illuminant={ 0=D50 | 1=D65 | 2=E } : (no arg) +#@cli : Convert color representation of selected images from Lab8 to RGB. +#@cli : Default value: 'illuminant=2'. +lab82rgb : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0?1:0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from Lab8 to RGB, using the "${arg0\ $illu,D50,D65,E}" illuminant." +repeat $! { +sh[$>] 0 /. 2.55 rm. +sh[$>] 1 /. 0.85 -. 127 rm. +sh[$>] 2 /. 0.836 -. 149 rm. +} +lab2rgb $illu c 0,255 +#@cli lch2lab +#@cli : Convert color representation of selected images from Lch to Lab. +lch2lab : +e[^-1] "Convert color representation of image$? from Lch to Lab." +foreach { to_color s c polar2complex[1,2] a c } +#@cli lch2rgb : illuminant={ 0=D50 | 1=D65 | 2=E } : (no arg) +#@cli : Convert color representation of selected images from Lch to RGB. +#@cli : Default value: 'illuminant=2'. +lch2rgb : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0?1:0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from Lch to RGB, using the "${arg0\ $illu,D50,D65,E}" illuminant." +lch2lab lab2rgb $illu +#@cli lch82rgb : illuminant={ 0=D50 | 1=D65 | 2=E } : (no arg) +#@cli : Convert color representation of selected images from Lch8 to RGB. +#@cli : Default value: 'illuminant=2'. +lch82rgb : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0?1:0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from Lch8 to RGB, using the "${arg0\ $illu,D50,D65,E}" illuminant." +pi,facth:=[pi,255/(2*pi)] +repeat $! { +sh[$>] 0 /. 2.55 rm. +sh[$>] 1 /. 1.1086 rm. +sh[$>] 2 /. $facth -. $pi rm. +} +lch2rgb $illu c 0,255 +#@cli luminance +#@cli : Compute luminance of selected sRGB images. +#@cli : $ image.jpg +luminance +#@cli : $$ +luminance : +e[^-1] "Compute luminance of image$?." +remove_opacity srgb2rgb +foreach { +if s==3 sh 0 sh[0] 1 sh[0] 2 *[1] 0.22248840 *[2] 0.71690369 *[3] 0.06060791 +[1-3] rm[1] +elif s!=1 norm n 0,255 +fi +} +channels 0 rgb2srgb +#@cli lightness +#@cli : Compute lightness of selected sRGB images. +#@cli : $ image.jpg +lightness +lightness : +e[^-1] "Compute lightness of image$?." +remove_opacity srgb2rgb +if s==3 srgb2lab channels 0 * {255/100} elif s!=1 norm n 0,255 rgb2srgb fi +#@cli lut_contrast : _nb_colors>1,_min_rgb_value +#@cli : Generate a RGB colormap where consecutive colors have high contrast. +#@cli : This function performs a specific score maximization to generate the result, so +#@cli : it may take some time when 'nb_colors' is high. +#@cli : Default values: 'nb_colors=256' and 'min_rgb_value=64'. ++lut_contrast : check "isint(${1=256}) && $1>=1 && isnum(${2=48})" +e[^-1] "Generate high-contrast RGB colormap with $1 colors and min RGB value $2." +l[] { +64,64,64,1 eval "repeat (8,k, x = !!(k&1); y = !!(k&2); z = !!(k&4); i([x,y,z]*(w-1)) = 1)" +N:=is +e "" +do ++neq. 0 distance. 1 xyzM:=[xM,yM,zM] rm. +col:=round([$xyzM]*255/(w-1)) +if max($col)>=$2 =. 1,$xyzM N+=1 else =. -1,$xyzM fi +e "\r [ Init ] > Colors \#"$N +while $N<$1 +>. 0 {is},1,1,3 +eval.. ">begin(k = 0); i>0?(I[#-1,k++] = round([ x,y,z ]*255/63))" +k. +N0=5 +s x repeat $! { +if {$>,I==[0,0,0]} rv[$>,0] fi +if {$>,I==[255,255,255]} rv[$>,1] fi +if {$>,I==[255,0,0]} rv[$>,2] fi +if {$>,I==[0,255,0]} rv[$>,3] fi +if {$>,I==[0,0,255]} rv[$>,4] fi +} a x +e "" ++srgb2lab a c +energy_max=${-_lut_contrast.} +nb_attempts=1000 +do +e "\r [ Optim ] > Score = "{_$energy_max}", Attempts = "$nb_attempts" " +. eval " +do( +k0 = round(u("$N0",w-1)); +k1 = round(u("$N0",w-1)), +k0==k1); +tmp = I[k0]; I[k0] = I[k1]; I[k1] = tmp" +energy=${-_lut_contrast.} +if $energy>$energy_max energy_max=$energy k. nb_attempts=1000 else rm. nb_attempts-=1 fi +while $nb_attempts>0 +channels 0,2 +} +_lut_contrast : +100%,1,1,1,"> +const N = 10; +dist = 0; sumw = 0; +RGB0 = (I[#0,x])[3,3]; +kmin = max(x-N,0); +kmax = min(x+N,w-1); +for (k = kmin, k<=kmax, ++k, +RGB = (I[#0,k])[3,3]; +w = (1 + N - abs(k-x))^1.5; +dist+= w*norm(RGB - RGB0); +sumw+=w; +); +dist/=sumw" +u {is} rm. +#@cli map_clut : [clut] | "clut_name" +#@cli : Map specified RGB color LUT to selected images. +#@cli : $ image.jpg uniform_distribution {2^6},3 mirror[-1] x +map_clut[0] [1] +map_clut : +e[^-1] "Map color LUT $1 on image$?." +if !$! return fi +to_color +if ${"is_image_arg $1"} pass$1 0 to_rgb. else clut "$1" fi +l:=round((w*h*d)^(1/3)) +if w*h*d!=$l^3 error "Command '$0': Specified CLUT $1 has invalid dimensions "({w},{h},{d},{s}). fi +r. $l,$l,$l,3,-1 +repeat $!-1 { l[$>,-1] { +nm={0,n} split_opacity[0] /[0] {256/$l} ++warp. [0],0,1,1 +rm[0] mv. 0 a[^-1] c =>[0] $nm +} } rm. +#@cli match_histogram : [reference_image],_nb_levels>0,_color_channels +#@cli : Transfer histogram of the specified reference image to selected images. +#@cli : Argument 'color channels' is the same as with command 'apply_channels'. +#@cli : Default value: 'nb_levels=256' and 'color_channels=all'. +#@cli : $ image.jpg 100,100,1,3,"u([256,200,100])" +match_histogram[0] [1] +match_histogram : check ${"is_image_arg $1"}" && ${2=1024}>0" skip "${3=0}" +channels=${"_ac_list \"$3\""} +e[^-1] "Transfer histogram from image ["${"pass$1 -1"}"] to image$?, ""with $2 levels, for channels '"$channels"'." +pass$1 1 sref:=s rm. +to_colormode $sref +if ['$channels']!='all' +pass$1 {$sref==3?2:0} +to_color +ac. "+store _match_histogram_reference",$channels rm. +ac "_match_histogram $2",$channels,1 +else +pass$1 +store. _match_histogram_reference +repeat $! { _match_histogram[$>] $2 } +fi +_match_histogram_reference= +_match_histogram : +$_match_histogram_reference +repeat min(s#0,s#1) { +sh $> ++histogram[-2,-1] $1 cumulate[-2,-1] /.. {-2,i[-1,2]} /. {i[-1,2]} +f.. "* +const w1 = w -1; +val = i; X = x; +val=1, nX = max(0,X - step); val(val - vp)?--X); # Rounding +):( +step = int((w1 - X)/2); +while (X=1, nX = min(w1,X + step); val>i[#-1,nX]?(X = nX):(step = int(step/2))); +X(vn - val)?++X); # Rounding +); +im#-3 + (iM#-3 - im#-3)*X/w1" +n[-4] 0,{w-1} round[-4] map[-4] .. +k[0,1] +} +rm. +#@cli match_icp : [reference_image],_precision>0,_transformation_variable +#@cli : Transform selected set of d-dimensional vectors to match specified set of reference vectors, using ICP (*Iterative Closest Point*) algorithm. +#@cli : A description of ICP is available at . +#@cli : Return the L2 alignment error. +#@cli : Default values: 'precision=1e-2' and 'transformation_variable=(undefined)'. +#@cli : sample lena,earth +match_icp[0] [1] +match_icp : check ${"is_image_arg $1"}" && ${2=1e-2}>0" skip "${3=}" +e[^-1] "Match vector set$? with reference vector set $1, using ICP with precision $2.\n" +pass$1 +foreach[^-1] { +w,h,d,s:=w,h,d,s +pass. mv. 0 +if "['$3']!=0" +store. img fi +match_pca. .. +old_err=inf +repeat inf { +100%,100%,100%,4,"* +P = I(#1); +distmin = pmin = qmin = rmin = inf; +repeat (d#0,r, +repeat (h#0,q, +repeat (w#0,p, +dist = norm(I(#0,p,q,r) - P); +dist Iteration "$>": Error = "{_$err} +if !$err" || "abs($err-$old_err)<1e-3 rm. break fi +old_err=$err ++warp[0] .,0,0 rm.. +_match_icp[-2,-1] +mmul[-2,-1] r. $s,{h/$s},1,1,-1 permute. yzcx r. $w,$h,$d,$s,-1 +} +k. +if "['$3']!=0" $img rv +_match_icp $3={^} rm[0,-2,-1] fi +u $err +} +rm. +_match_icp : +N,s:=whd,s +permute. cxyz y. +l.. { +r 1,{whd},1,100%,-1 permute cyxz 1,100%,1,1,1 a x +r 100%,{$s*$N},1,1 r {($s+1)^2},100%,1,1,0 r {$s*($s+1)},{($s+1)*$N},1,1,-1 +s y rm[$s--1:{$s+1}] a y +} +solve. .. +#@cli match_pca : [reference_image],_color_channels +#@cli : Transfer mean and covariance matrix of specified vector-valued reference image to selected images. +#@cli : Argument 'color channels' is the same as with command 'apply_channels'. +#@cli : Default value: 'color_channels=all'. +#@cli : $ sample lena,earth +match_pca[0] [1] +match_pca : check ${"is_image_arg $1"} skip "${2=all}" +channels=${"_ac_list \"$2\""} +e[^-1] "Transfer mean vector and covariance matrix from image ["${"pass$1 -1"}"] to image$?, ""for channels '"$channels"'." +pass$1 1 sref:=s rm. +if $sref<=4 to_colormode[^-1] $sref fi +if $sref==1 +pass$1 +var_ref,avg_ref:=[iv,ia] rm. +foreach { - {ia} * {sqrt($var_ref/max(1e-8,iv))} + $avg_ref } +elif ['$channels']!='all' +pass$1 {$sref==3?2:0} +to_color +ac. "+store _match_pca_reference",$channels rm. +ac "_match_pca",$channels,1 +else +pass$1 +store. _match_pca_reference +foreach { _match_pca } +fi +_match_pca_reference= +_match_pca : +$_match_pca_reference +f.. "*begin( +cov_ref = [ "${"covariance_vectors[1] _avg_ref"}" ]; +cov = [ "${"covariance_vectors[0] _avg"}" ]; +avg_ref = [ "$_avg_ref" ]; +avg = [ "$_avg" ]; +eig_ref = eig(cov_ref); +eig = eig(cov); +lambda_ref = sqrt(eig_ref[0,s]); +lambda = 1/sqrt(1e-6 + eig[0,s]); +repeat(s,k, +sks = s + k*s; +Uref = eig_ref[sks,s]; +U = eig[sks,s]; +dot(Uref,U)<0?copy(eig[sks],U*=-1); +); +rot_ref = mul(transpose(eig_ref[s,s*s],s),diag(lambda_ref),s); +rot = mul(diag(lambda),eig[s,s*s],s); +M = mul(rot_ref,rot,s); +); +avg_ref + M*(I - avg)" +rm. +#@cli match_rgb : [target],_gamma>=0,_regularization>=0,_luminosity_constraints>=0,_rgb_resolution>=0,_is_constraints={ 0 | 1 } +#@cli : Transfer colors from selected source images to selected reference image (given as argument). +#@cli : 'gamma' determines the importance of color occurrences in the matching process (0=none to 1=huge). +#@cli : 'regularization' determines the number of guided filter iterations to remove quantization effects. +#@cli : 'luminosity_constraints' tells if luminosity constraints must be applied on non-confident matched colors. +#@cli : 'is_constraints' tells if additional hard color constraints must be set (opens an interactive window). +#@cli : Default values: 'gamma=0.3','regularization=8', 'luminosity_constraints=0.1', 'rgb_resolution=64' and 'is_constraints=0'. +#@cli : $ sample pencils,wall +match_rgb[0] [1],0,0.01 +match_rgb : check "${2=0.3}>=0 && ${3=8}>=0 && ${4=0.15}>=0 && ${5=64}>=0 && isint(${6=0})" +e[^-1] "Transfer colors of image $1 to image$?." +sigma=1.5 +repeat $! { pass$1 0 l[$>,-1] { +nm_source={0,b} nm_target={1,b} +=> source,target ++_match_rgb[source,target] $2,$sigma,$5 => fsource,ftarget +n[fsource,ftarget] 0,255 +if $6 +h0:=2*{*,v}/3 ws0={source,max(1,w*$h0/h)} wt0={target,max(1,w*$h0/h)} +w1:=2*{*,u}/3 hs1={source,max(1,h*$w1/w)} ht1={target,max(1,h*$w1/w)} +if abs($ws0+$wt0-$w1)$w1 r2dx[-2,-1] $w1 fi +if h>$h0 r2dy[-2,-1] $h0 fi +=> visu,both +w[visu] -1,-1 +N=0 do +w[] -1,-1,"[G'MIC] Add Color Guide (Constraint ""#"{1+$N}")" ++select[$visu] 1 if i==-1 rm. break fi +line[$visu] {i[0]},{i[1]},{i[3]},{i[4]},1,0xF0F0F0F0,0 +line[$visu] {i[0]},{i[1]},{i[3]},{i[4]},1,0x0F0F0F0F,255 +circle[$visu] {i[0]},{i[1]},5,1,0,0,0 circle[$visu] {i[0]},{i[1]},3,1,255,0,0 +circle[$visu] {i[3]},{i[4]},5,1,0,0,0 circle[$visu] {i[3]},{i[4]},3,1,0,255,0 +s. y,2 rows[-2,-1] 0,1 a[-2,-1] x permute. xczy ++warp[$both] .,0,0,1 rm.. +*. {($5-1)/255} s. x,2 +-. .. *. -1 a[-2,-1] c +N+=1 +while {*} +if $N a[-$N--1] x permute. xczy => constraints fi +rm[$visu,$both] w 0 +fi +if $constraints ++pointcloud. 0 r. ...,...,...,3,0 +compose_channels. + a[-2,-1] c +displacement[fsource] [ftarget],0.001,5,0,10000,1,. rm[ftarget,constraints,-1] +else +displacement[fsource] [ftarget],0.005 rm[ftarget] +fi +=>[fsource] displacement ++_match_rgb[target] 0,$sigma,{displacement,w} +warp. [displacement],1,1,1 c. 0,100% => fconfidence ++map_clut[source] . => confidence +[displacement],[displacement],[displacement],1,x +f. y +f. z a[-3--1] c *. {255/(w-1)} +. 1 ++_match_rgb[target] 0,0,{w} *.. . +warp[-2,-1] [displacement],1,0,1 +distance. 1 *. -1 watershed.. . rm. -. 1 +=> clut +b[clut] $sigma% +if $4>0 +^[fconfidence] {$4/10} *[fconfidence] -1 +[fconfidence] 1 ++f[fconfidence] x +f. y +f. z a[-3--1] c *. {255/(w-1)} +rgb2hsv[clut,-1] channels. 100% +j[clut] .,0,0,0,2,1,[fconfidence] rm. +hsv2rgb[clut] +fi ++map_clut[source] [clut] => res_noregul +if !$3 +=>[res_noregul] res +else +l[source,res_noregul] { +rgb2ycbcr ++-[1] [0] repeat $3 { guided. [0],5,5 } +. [0] c. 0,255 +ycbcr2rgb +} +=> res +j[res] [res_noregul],0,0,0,0,1,[confidence] +rm[res_noregul] +fi +k[res] +} } +_match_rgb : +l[] { +check "${1=0}>=0 && ${2=1.5}>=0 && ${3=128}>0" gamma=$1 smoothness=$2 res=$3 +onfail noarg gamma=0 smoothness=1.5 res=128 +} +e[^-1] "Convert image$? as 3D volumetric scalar functions for color matching, with gamma "$gamma", +smoothness "$smoothness" and resolution "$res"." +to_rgb +foreach { +b 0.3% +r {w*h},3,1,1,-1 * {($res-1)/255} +pointcloud 1,$res,$res,$res f 'if(i,i^$gamma,0)' b $smoothness% n 0,1 +} +#@cli mix_rgb : a11,a12,a13,a21,a22,a23,a31,a32,a33 +#@cli : Apply 3x3 specified matrix to RGB colors of selected images. +#@cli : Default values: 'a11=1', 'a12=a13=a21=0', 'a22=1', 'a23=a31=a32=0' and 'a33=1'. +#@cli : $ image.jpg +mix_rgb 0,1,0,1,0,0,0,0,1 +#@cli : $$ +mix_rgb : skip ${1=1},${2=0},${3=0},${4=0},${5=1},${6=0},${7=0},${8=0},${9=1} +e[^-1] "Apply matrix [ $1 $2 $3 ; $4 $5 $6 ; $7 $8 $9 ] to RGB colors of image$?." +to_color repeat $! { sh[$>] 0,2 mix_channels. (${1-3};${4-6};${7-9}) rm. } +#@cli oklab2rgb +#@cli : Convert color representation of selected images from OKlab to RGB. +#@cli : (see colorspace definition at: ). +#@cli : See also: ''rgb2oklab''. +oklab2rgb : +e[^-1] "Convert color representation of image$? from Oklab to RGB." +foreach { +split_opacity to_rgb[0] +f[0] " +l = (i0 + 0.3963377774*i1 + 0.2158037573*i2)^3; +m = (i0 - 0.1055613458*i1 - 0.0638541728*i2)^3; +s = (i0 - 0.0894841775*i1 - 1.2914855480*i2)^3; +[ 4.0767245293*l - 3.3072168827*m + 0.2307590544*s, +-1.2681437731*l + 2.6093323231*m - 0.3411344290*s, +-0.0041119885*l - 0.7034763098*m + 1.7068625689*s ]" +* 255 a c +} +#@cli palette : palette_name | palette_number +#@cli : Input specified color palette at the end of the image list. +#@cli : 'palette_name' can be { default | hsv | lines | hot | cool | jet | flag | cube | rainbow | parula | spring | summer | autumn | winter | bone | copper | pink | vga | algae | amp | balance | curl | deep | delta | dense | diff | gray | haline | ice | matter | oxy | phase | rain | solar | speed | tarn | tempo | thermal | topo | turbid | aurora | hocuspocus | srb2 | uzebox | amiga7800 | amiga7800mess | fornaxvoid1 } +#@cli : $ palette hsv ++palette : +names=${-_palette_names} N:=narg($names) +l[] { if isint("$1") name=${"arg0 ($1%"$N"),"$names} else name="$1" fi onfail name="$1" } +e[^-1] "Input color palette '"$name"'." +_palette_$name +=> $name +_palette_names : +u default,hsv,lines,hot,cool,jet,flag,cube,rainbow,parula,spring,summer,autumn,winter,bone,copper,pink,vga,algae,amp,balance,curl,deep,delta,dense,diff,gray,haline,ice,matter,oxy,phase,rain,solar,speed,tarn,tempo,thermal,topo,turbid,aurora,hocuspocus,srb2,uzebox,amiga7800,amiga7800mess,fornaxvoid1 +_palette2code : +sort_list +,n +foreach { +r {whd},1,1,100%,-1 +img2base64 0,0 +e "_palette_"{n}" : " +b64=\"${}\" +l[] { ('$b64') s x,-119 ('\\\\\n') a[0--3] .,x rm. a x b64={t} rm } +e " base642img \\\n"$b64"\n" +} +_palette_default : +256,1,1,3,[16+32*int(x>>5),16+32*int((x>>2)&7),32+64*int(x&3)] +_palette_hsv : +256,1,1,3,[x*359/(w-1),1,1] hsv2rgb. round. +_palette_lines : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjU2IDEgMSAzICM2MTcKe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BAwPzgoMDAgwM/P19vT093d1dnJ3trK3NhIX0dDTVUJ5GCgi5VVVIFpSkdXT9/A0AAGQH7U1dXW1gJ5UA2E1NTUNdQ1NDTU1dXUVJQU5WQkxYT4efkFhIQE+Xm5mAHNkQH/" +r. 256,1,1,3,3 round. +_palette_parula : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KNjQgMSAxIDMgIzIwMwp4nAHAAD//NTY2NDAoHAwDAwUJDhETFBQSEAwJBwYGBggLEBYdJS44Qk1ZZXF7hpGbpK22v8fP2N/n7/b8//79+/j29fX2+C0zOT9FTVZeZGlucnZ6foKGio+UmZ2hpKeprK6xs7W3ubu8vb6/v7+/v76+vby8u7q5ubm7vsLHzNLX3OLp8PiMmKWyvsvX3uHh4N7c2tjW1NPS0tHPzcrGwr65tK+ppJ6Yko2HgXx4dHBsaGVhXlpXU09LRj85NDAsKCMfGhUQJK9mpg==" r. 256,1,1,3,3 round. +_palette_jet : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KNzYgMSAxIDMgIzEzMQp4nGNgwA24JFSN7H2i0ksa+2av3Hb4wr3XP/9jgt/vH145tnPN/ImtMH1MvNIapk7+sVnlLRPnrdl57PLDd7+xaPz55t7Fw9tWzulrKkmP8rU3UpXgYoTbPWXh+j0nrz35+BeLxm8vb587sHnZzO76wpRwLxt9JVF2PL5gYAAAc+1twA==" +r. 256,1,1,3,3 round. +_palette_hot : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMTI0IDEgMSAzICMxNDEKeJzjFRKXVdLQNTK3dXb3DY6IS87IK66oa+nsmzJz3pKV67fu2n/k1IWrt+4/ff3+66//1AUMpABGdl5BcRlFdZBTndx9g0BOzS2urGvuADl18cr1W3buP3LyPMipr4BO/UdNu0kEjFxC0kpaRtbO3kHRydnFNS3dk2cvXr1lz5EzV+88efP1LwA796yq" r. 256,1,1,3,3 round. +_palette_cool : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMzIgMSAxIDMgIzc4CnicY+ERkVHRMbFx8QmJSckpqWnpmTJnyZote46cuXLnyZsvf/58efPkzpUzR/ZsWbNkzpSelpqSnJSYEB8XGxMdFRkRHpb/BAAAHuY/4Q==" r. 256,1,1,3,3 round. +_palette_spring : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjggMSAxIDMgIzcxCnic+/8fN2DhFVPQNLJ28Q1LyCyqbumdtmDlpt1Hzl578PLT79+fXj64dvbI7k0rF0zrbakuykwI83WxNtJUEONlAQDKiDfN" r. 256,1,1,3,3 round. +_palette_summer : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjggMSAxIDMgIzcxCnicY+EVU9A0snbxDUvILKpu6Z22YOWm3UfOXnvw8tPvprbuCVNmzl20bPX6LTv2Hjx26vyVm3cfPXv94cvPv2l4AACR+i4M" r. 256,1,1,3,3 round. +_palette_autumn : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjYgMSAxIDMgIzQyCnic+/8fF2Dhk1DSMXPwDI5NL6xu6ZuxaM22Aycv333+8TcDTgAAaHcm2w==" +r. 256,1,1,3,3 round. +_palette_winter : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMzEgMSAxIDMgIzc5CnicY2DAC1h4RGRUdU1t3fzC4tLzyxs6JsxYuHLjzkOnLt16/Prz778/v358+/Lpwzs3rlw4ffzw/t3bN69bvXzxvFnTJvV1tTUBACEGJp4=" r. 256,1,1,3,3 round. +_palette_bone : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KOTkgMSAxIDMgIzI1Mgp4nGNkZuXg4uETFBaVkJKRU1BWVdfU0TMwNjG3tLZzcHJx9/T28w8KCY+MjktISk3PzM4rKCwpq6iqbWhqaevs7p0wccq0GbPnzl+4ZNnKtRu3bN+9/9Cxk2cuXLl+696jpy/ffPj8/dc/RmKsCI2IiU9KzcjJLyqtqK5rbGnv6ps4ZfqsuQsWAw3esHnbzr37Dx09cfrM+YtXrt24fef+w8fPnr968+7j56/ff/35x8TKwcMvJCopLa+koq6lZ2hibmXnCDTZNyA4PDI2ITktE2hwSVlldV1DU2t7Z3cf2N2zwO5esXrtho1btu3YvXf/wSPHcFoBAJTokrQ=" r. 256,1,1,3,3 round. +_palette_copper : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMTE1IDEgMSAzICMzMzkKeJxj4+TmExQWk5SWU1RW09TRNzKxsLK1d3b18PINCA6NiI5LSE7LyM4rKC6rqK5rbGnv7O2fNGX6rLnzFy1dvmrthk1bd+zee+DQ0ROnz164fO3mnXsPnzx7+eb9xy/ff/359x87YGFl5+Dm5RMQFBYVk5CSlpVXVFZRU9fU1tEzMDIxNbe0trG1d3R2dfP08vH1DwwKCY2Iio6NT0hKTk3PyMrJKygsLi2rqKyurW9sam1r7+zu7eufOGXa9Jmz5sybv3DxkmUrVq1Zu37Dpi1bt+/avXffgUOHjx5jYgZZysnFzcPLxy8oJCwiIiYuISklLSMrp6CopKyiqqauoakFdIG+gaGRsYmpmbmFpZWNrZ29g6OTs4ubu4ent4+vn39AYFBwaFh4RGRUdExsXHxCYnJKalp6RmZWdm5uXn5BUXFJaVl5RWVVTW1dPQCk5ZAs" r. 256,1,1,3,3 round. +_palette_pink : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMTIxIDEgMSAzICMzMDUKeJxT1DG1cfbwC46ISUzNzC0sraiub2rr7O6bOGX6zDnzFy5ZtnL1ug2bt27fuXvvgUOHDx85euz4iZOnTp85e+7c+QsXL12+cuXqtes3bt66ffvO3Xv37j94+PDR4ydPnj57/uLFy1evX799++79hw8fP33+8uXr12/ff/z49ev37z9///37zyoso6SurW9sZmVr7+Tq7uXjHxQSFh4ZHRuflJyanpGVnZtfWFRSWl5RWV1b39Ta0d0PddLiZSvXIJx05NiJU2fOXbh89fqNW3fu3X/0BGgzFS1uaGxqaW1r7+zu6e2bMHHS5CnTps+YOWv2nHnzFy5avGTpsuUrVq5avWbtuvUbNm4COmn3vgOHj504fRbonhu3795/+OTZi1dv33/68u3Hrz//AH2168E=" +r. 256,1,1,3,3 round. +_palette_vga : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjU2IDEgMSAzICMxNzgKeJz7/+fn10/vXz9/8uDOjasXzpw4sv/IiTMXrt648+DJ89fvP339+ec/Bvjx8dXj25dOHdi2ZsGU1tIEVwbCwDWhtHXKgjXbDpy6dPvxq48/MM2Q0zF3cPcLiYpPycgtLK2saSAMaipLC3MzUuKjQvzcHcx15IhwB4Yt/zH8v2vr+pWL507r72goz00KdTPEdDthQEYIYbgMw3c0CSEi/E9G7JIRQoT9T0YYEgYAJsphWQ==" +_palette_algae : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KNTAgMSAxIDMgIzE2MQp4nAGWAGn/1M3Hwbq0raegmZKLhH11bWVcU0k+MygeFg8JBwYICg0PEhQVFxgZGRkZGRkYFxYVExL38u7p5ODc19PPy8fEwLy4tbGtqqainpqWko2JhH96dnFtaGRfW1ZRTUlEQDw3My4qJczFvbavqKGak42GgHp0bmhjX1pXVFJRUFBPTk1MS0lIRkRCPz07ODUyLywpJiMgHBkV1p88Lw==" r. 256,1,1,3,3 round. +_palette_amp : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KNjEgMSAxIDMgIzE5NAp4nAG3AEj/8O3r6ejm5OLh397c29nY1tXU0tHPzszLycjGxMPBv728uri1s7CtqqainpqVkIuFgHp0b2lkXlhTTkhDPurm4dzX0s3Iw765tLCrpqGcmJOOiYSAe3ZxbGdiXVhTTklDPTgyLSgjHhkWEhAODg0ODg4ODg4NDQwLCgnq5N7Y0szGwLq0rqihnJWPiYN9eHJsZmBbVU9KRUA7NjIuKygmJCQkJCUmJicoKSkpKCcmJSMhHxwaGBUS64BWpQ==" r. 256,1,1,3,3 round. +_palette_balance : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMTIxIDEgMSAzICMzNzQKeJwBawGU/hgaHB4gIiMlJigoKSkoJyQgGhMNCgoMERYcIictMzg+Q0lOVVthaG51fIKJkJado6mwtrzDyc7V2+Dm7PDu7Oro5+Xj4t/e3dva2NfW1NLR0M7Ny8rIxsXDwcC+vLq4tbOwraqno56alZCLhYB6dG9pY15YU01IQj0dICImKCsuMDM2OTs/QUVJTFFVW19kaGxxdHh8gISHi46SlZmcoKOmqqyvs7a5vL/CxcnMz9PW2t3h5ens6OPe2dTPysXAu7axraijnpmVkIuGgXx3cm1pY15ZVE9KRD45My4oIx8aFhMQDw4NDg4ODg4ODQ0MCwoJREpRWF5lbHN7goqSmqGpsLa7vb69vby8u7u6urm5ubm5ubq6uru8vL2+v8HDxcbIys3P0dXX2t3f4ubp6+fh2tXPyMK9trCqpJ6YkYuGf3l0bWhiXFZQS0ZBPDczLisoJiQkJCQlJSYnKCkpKSgnJiQiIR4cGhcVEqaTs4c=" r. 256,1,1,3,3 round. +_palette_curl : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMTI0IDEgMSAzICMzODEKeJwTFROXkJCUkpKWlpaRARJSkuJiosJCggKCwmLSCup6Znbu/uHx6fnldW29U2YtXLF+6+6DJ85duXn/6euP3/78+fn96+eP79++efXy+bOnjx89uH/3zu2b169duXT+7KkTRw/u271984Y1K5YsmDN9Ul9nS31VaUF2anxUqL+Xi72VqZySmpaekZmVraOrp29gSERMQnJGTkFxeXV9U3tX38SpM2bPW7h0xaq1GzZv27F738Ejx0+dvXDl+q27D5+8ePPhy+d3r57cv3X1wumjB/ds37hm+UKgHb0dTbUVxXmZKQnR4UF+Xq6OtlZmxvraGqpKCrJgn4kIg/wmwMfr4ubh7esfFBIWGR2bkJ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jJCYoKSwtLzEzNDc4Ojw+QEJER0lLTlBSVVhaXWBiZWdqbW9ydXd6fX+ChIaJjI6Rk5WYmp2goqSnqayvsbS2uLu9v8LEx8rLzdDS1NfZ293f4eTm6evt8PL09/n7ExYaHSAkJyouMTU5PEBDR0pOUlZZXWFlaW1xdHh8gISIjI+Tlpmcn6KkpqiqrK6vsLKztLW2t7i5urq7vL2+v8DAwcLDxMXGx8jJysvMzc3P0NDS09PV1tfY2dvc3t/h4+Xn6evt7/L09fj6/ETzn2w=" r. 256,1,1,3,3 round. +_palette_matter : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KNjQgMSAxIDMgIzIwMwp4nAHAAD///fz8+/v6+vn4+Pf29fTz8vHw7+3s6ujn5eLg3drX1NDNycXAvLezrqmkn5qVkIqFgHt1cGplYFpVUEpFQDs2Mevl4NrUz8nEvrmzrqijnZiSjYiCfXdybGdiXVhTTkpGQj46NzMwLSsoJiQiIB8dHBsaGhkYGBcXFhYVFBMSEQ+uqKOemJOPioWBfHh0cGxpZWJfXFpYVlRTUlJSU1NUVVdYWVtcXV5fYGFiYmNjY2NiYWBfXVxaV1VST0xJRkM/PV5d6A==" r. 256,1,1,3,3 round. +_palette_oxy : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjU2IDEgMSAzICM2NTYKeJyzd3RydnP39PL18w8MDg2LiIqJjUtMSknNyMzOyS8oKi4rr6iqqatvaG5pbevo7Oru6e0LDAgMDA4JCQ0Pj4iMigaqj09ISEpOTklLS8/IzMrOyc3LLygsKi4uLSsvr6yqrq6tq2tobGoCGgAzoX/CxEmTp0ydNn3mzFmz586bP3/hosVLli5bvmLV6jVr163fsHHzlq3btu/YuXvP3n0HDh46dOToseMnT50+c+78hYuXr1y9duPmrdt3791/8Ojxk6fPX7x89ebt+w+fPn/5/u3L54/v3719/frVq1cvIeAFEDx//vzZs2dPnz558uTx40ePHj18+ODB/fv37t29e+cOKxCwQQ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25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMTE1IDEgMSAzICMzNDIKeJx7++bVy2dPHz96eP/e3Tu3b928cf3q5Yvnz5w8dmjf7u2b169evmTBnBlTJvZ2tjbWVpYU5makxEeHBfq4O9taGOtpqirIiIsI8nJxsLGyMDMzs7CwcXBy8woIiYhJSEnLyikoKCopq6ioqIIAkFZRVlZSUnzz6vnTRw/u3bl57cqlC2dPnzh25NCBfXt37dyxfduWzZs2rl+3ds2qlSuWL12yeOGC+fPmzJ41Y/q0qZMnTZzQ19Pd1dHW0txYX1tdWVFaXJifm52ZnpqcGB8bFREWEhTg5+Pl7ursaG9rbWluYmSgr6OloaaiKC8r/fHdq+ePH9y9efXimZNHDgA9tm7V0oVzZ06bPLG/p6sTZGZTQ31dbU1VZUV5aWlJcVFhQX5+Xl4uDORBAYidk5OTnZWVmZmenpaanJSYEBcTHRkRGgy23RNovZMD0H4rSwDxo6Ac" r. 256,1,1,3,3 round. +_palette_solar : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMzUgMSAxIDMgIzExNgp4nAFpAJb/N0BJUltkbXZ/h46VnKGnrLG1ur7BxcjMztHU1tja3N3f3+AVGBodHyIlJysvNDpARk5VXGRrc3uDi5OcpK22v8jR2+Xu+RkcHyEjJCQkIiAeHBoYFhQTExITFBUXGh0gJCgsMDU6PkNIm9UqlA==" +r. 256,1,1,3,3 round. +_palette_speed : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KNDkgMSAxIDMgIzE1OAp4nAGTAGz//fn28+/r5+Pf2tXOyMG5samgl46FfHJpYFZNQzoxKCAZEg4LCgwOEBMVFxgZGRkYF/rz7efh29bQy8bCvbm1sq6rqKWinpuYlZKOi4eDf3t3c25pZWBbVlFMSEI9ODMvKSTIvbKnnJCFeW5jWE1COS8nHxgRDAcFBQgLDxQYGx8iJScpKywsLCwrKiknJCIfGxgUF7w7kA==" r. 256,1,1,3,3 round. +_pal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1,3,3 round. +_palette_thermal : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMTA3IDEgMSAzICMzMjUKeJxjYWFhZWVj5+Ti4RcUkZBRUNUyMLWyd/HwCQiJiI5PSsvMyS8qq6ypb2rr7J0wefqseQuXrlizYfP2XfsOHj155vzla7fuPnj07MXrt+8/fv7y7fuPn79+/YaAX79+/vzx/dvXL58/fXz/7s2rF8qq6hpa2jp6+gaGRkbGYACkTMzMLaysbe0dnJxd3T28vH39/AODgkNCwyMio6JjY+MTEpOSU1LTMjKzcnLzC4pKyiqraxua2zp7JkyeNmveoqUr127cumPPgSMnzly4cuPOgycv3nz8+tPE0tbJ3ScwPCYpI6+0urGjb8qM2fPmz58/b+6c2bNmzpg2dcrkSRMn9Pf39fb2dHd1drS3tbY0NzXU11RXlpcWFeRlZ6QmJcREhgUH+nl7uLk6Odrb2dqAgK2tHdSlQIcGBoeGRwIArFub1Q==" r. 256,1,1,3,3 round. +_palette_topo : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjU2IDEgMSAzICM2OTEKeJxT19TS1tXTNzQyNjE1s7C0sraxtbWzt3dwcAQBBwcHe3s7OztbCACy7MFyTk7Ozi6urm7u7h6enl7e3j6+fn7+AYFBwSGhYRGR0TFxCUkp6Zk5+UVllbWNrZ29E6fOmrd4+eoNW3bsPXj05LlL127de/Ts9fvP33/z8vELCAoJC4uIiolLSEpKScvIysopKCqpqGvpGhibWVrbOTq7eXr7BQaHRUbHJSSnZWTnFRSXVVTXNTS3dXT3TZg8bebseQuXLF+5Zv2mrTt27zt46PDRY8dPnDx1+szZc+cvXLp85eq16zdu3rp95979Bw8fPX767PmLV6/fvHv/8dPnr99/SEmDrFNWUVMHB4SBobGJmbmllY2tvaOzq5uHt69/YHBoRBTYR2mZ2bn5hcWl5ZXVtfWNTS1tHV09fRMmTZk2Y9ac+QsXL12+cvXa9Rs3b92+c/fe/QcPHz1+8tSZcxcuXr567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ePbp17jDQA50lCd7muR0Tl+07eenuiw8/QYGPlITe3rt6amlzZe/izUfO33rx/R807YAiCMh6c/P88TWTy2Oi8lvmbDt19ws0Xf6Dxb+vuTo4/hkYGBkZeCSV9Z3D4zOnTZ++ujInJNjTRl+GixEkycDJxcnJwa2gb+vqm1q75OiVGc2FCTGRfi5WBurywhyszABUd6ys" +_palette_fornaxvoid1 : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjU2IDEgMSAzICM1MjkKeJyrKi3ISU+OiwwN8HF3srM01Te3d/MLi03NLalp6Z48exEDO6+IlIK6romVg7tvSFTChwcXDmxYMKGhICHAwUBBgOH/p2e3zh3aunLuxNaKnIQQj8/Pb184snPtwmld9cXpMQGu/6HgwYEFDQlAHTeObJjbWZrkZ6UuzAAC/9/dPbN71cyO8rRQF2MlQQYGVk5eITEpOWV1bX0TCxsHRkYGFIChXkBez9YnOquqc8bybUevPP7/6enNM0AXNoDcp6EgsGzT3hOX77388v/Wtom5HioMjy8f2bpsekdlZpS3ja4cP4Oqlr6xhY2jm5d/cERsYlrWvWvnju3btm7ZvGl9bXVleWlnDu/auGLB9L7WmpLspMgAjw8vH925eu7EwV1b1i5bMHNSD7r/+zqaasoKslLiIoJ83BysTG8cWjMN6HG4+9H9r62hpqKkICcjKS4qLMjPy43u//8fHl46vGXptI7KrGgfWz2FBXNnz5w+dfLEvp6ujraWpgYGTiFpFV0ze4/AqOSc0rq2A2tmthUnGDDgAuj+/48GXn/6icI/c+Hy9Vt3Hz558frdp68///zH8D+RABb//79/ePHw5qVTh3dvWTuxLNrh/7d3T+9eOXN496ZVC2dO6GhgEFQydglNK++YuWr3mbvv/qP7n6B6KHhx4QA4Cfy/v39+fby9PAOXsIyqnjlGeAIAmOWLbw==" +compress_palette : +N:=w +do +N-=1 ++r. $N,1,1,3,2 round. +ri. ..,3 round. +deltaE. .. +dEavg,dEmax="[ia,iM]" rm. +e "N = "$N", dEavg = "$dEavg", dEmax = "$dEmax +while $dEavg<0.75" && "$dEmax<1.25 +N+=1 +r $N,1,1,3,2 round. +e "" +img2base64 0,0 rm +str=\"${}\" +('$str') s. x,-119 ('\\\n') if $!>2 a[0--3] .,x fi rm. +i[0] ('" base642img \\\n"') +('"\n r. 256,1,1,3,3 round.\n"') +a x +ot pal.txt +#@cli premula +#@cli : Convert selected images with normal colors to premultiplied alpha colors. +#@cli : After conversion, alpha channel of resulting images has value in [0,1] range. +#@cli : See also: ''ipremula''. +premula : +e[^-1] "Convert image$? with normal colors to premultiplied alpha colors." +to_a foreach { sh. 100% /. 255 sh.. 0,{s#-2-2} *. .. rm[-2,-1] } +#@cli pseudogray : _max_increment>=0,_JND_threshold>=0,_bits_depth>0 +#@cli : Generate pseudogray colormap with specified increment and perceptual threshold. +#@cli : If 'JND_threshold' is 0, no perceptual constraints are applied. +#@cli : Default values: 'max_increment=5', 'JND_threshold=2.3' and 'bits_depth=8'. +#@cli : $ pseudogray 5 +pseudogray : check "isint(${1=5}) && $1>=0 && ${2=2.3}>=0 && isint(${3=8}) && $3>0" +e[^-1] "Generate pseudogray colormap with increment $1, JND threshold $2 and $3 bits depth." +{round(2^$3)},1,1,3,'x' +if !$1 n. 0,255 return fi +{$1+1},{$1+1},{$1+1},1,'x' +f. 'y' +f. 'z' a[-3--1] c r. {w*h*d},1,1,3,-1 +f. 'R=i(x,0,0,0);G=i(x,0,0,1);B=i(x,0,0,2);if(min(R,G,B),-1,i)' +permute. cxyz discard. -1 r. 3,{h/3},1,1,-1 permute. yzcx +r.. {w*100}% ri. ..,0,2 +[-2,-1] +f. 'R=i(x,0,0,0);G=i(x,0,0,1);B=i(x,0,0,2);if(max(R,G,B)>2^$3-1,-1,i)' +permute. cxyz discard. -1 r. 3,{h/3},1,1,-1 permute. yzcx +n. 0,255 ++srgb2lab. rv[-2,-1] a[-2,-1] y sort. +,x +if !$2 rows. 1 +else +s. y rv[-2,-1] . sh. 1,2 f. 0 rm. -[-2,-1] norm. +<=. $2 *. 'x+1' discard. 0 -. 1 map. .. rm.. +repeat 10000 { ++srgb2lab. +shift. 0,{1-2*($>%2)},0,0,1 -[-2,-1] norm. +<=. $2 +if im rm. break fi +*. 'y+1' discard. 0 -. 1 map. .. rm.. +} +transpose. +fi +=> pseudogray$1 +#@cli random_clut +#@cli : Generate a 33x33x33 random 3D color LUT. +#@cli : $ image.jpg random_clut +map_clut.. . +#@cli random_clut : _seed = { >=0 | -1 } +#@cli : Generate a 33x33x33 random 3D color LUT. +#@cli : If specified 'seed' is positive, it is used as a seed for the random number generator @cli : (so that using the same seed will return the same CLUT). +#@cli : $ image.jpg random_clut +map_clut.. . ++random_clut : l[] { check "isint(${1=-1}) && $1>=-1" seed=$1 onfail seed=-1 noarg } +e[^-1] "Generate a random 3D color LUT." +if $seed>=0 srand $seed fi +1,1,1,3 +1,8,1,1,"u<0.75 || !y?da_push(255*[ y&1, (y>>1)&1, (y>>2)&1 ])" rm. +1,{round(u(2,12))},1,1," +do ( +RGB = u([255,255,255]); +dmin = inf; +for (p = 0, p70?(da_push(RGB); break()); +1)" rm. +da_freeze. +rgb2hsl. mirror. c sort. +,y mirror. c ++f. "begin(Lmax = 0); +H = i0; S = i1; L = i2; +u<0.5?( +do ( +nH = (H + 30*g)%360; +nS = cut(S + g/4,0,1); +nL = cut(L + g/8,0,1), +_(while) nL=0,smoothness[%]>=0,src1,src2,...,dest1,dest2,... +#@cli : Replace pixels from/to specified colors in selected images. +#@cli : $ image.jpg +replace_color 40,3,204,153,110,255,0,0 +replace_color : check "$1>=0 && $2>=0" +l[] { (${3--1}) y c s c,2 col1={0,^} col2={1,^} rm } +e[^-1] "Replace color ("$col1") by color ("$col2") in image$?, with tolerance $1 and smoothness $2." +foreach { +1,1,1,100%,$col1 ri[1] [0] +if $1 -[1] [0] norm[1] <=[1] $1 else ==[1] [0] l[1] { s c & } fi +b[1] $2 +1,1,1,{0,s},$col2 ri[2] [0] j[0] [2],0,0,0,0,1,[1] k[0] +} +#@cli retinex : _value_offset>0,_colorspace={ hsi | hsv | lab | lrgb | rgb | ycbcr },0<=_min_cut<=100,0<=_max_cut<=100,_sigma_low>0,_sigma_mid>0,_sigma_high>0 +#@cli : Apply multi-scale retinex algorithm on selected images to improve color consistency. +#@cli : (as described in the page ). +#@cli : Default values: 'offset=1', 'colorspace=hsv', 'min_cut=1', 'max_cut=1', 'sigma_low=15','sigma_mid=80' and 'sigma_high=250'. +retinex : check "${1=5}>0 && ${3=1}>=0 && $3<=100 && ${4=1}>=0 && $4<=100 && ${5=15}>0 && ${6=80}>0 && ${7=250}>0" +skip "${2=hsv}" +e[^-1] "Apply Retinex color consistency algorithm on image$?, with value offset $1, colorspace '$2', cuts ($3,$4) +and sigmas (${5-7})." +if '$2'=='hsi' mode=hsi_i +elif '$2'=='hsv' mode=hsv_v +elif '$2'=='lab' mode=lab_l +elif '$2'=='rgb' mode=rgb +elif '$2'=='lrgb' mode=lrgb +elif '$2'=='ycbcr' mode=ycbcr_y +else error[0--2] "Command '$0': Invalid colorspace argument '$2'." +fi +ac "_retinex $1,${3--1}",$mode +_retinex : +- {im-$1} {[w,h,d,s]},1 +repeat 3 { +b[0] {arg(1+$>,${4-6})} +/[0,-1] rm.. *[1,-1] } +rm[0] log c $2%,{100-$3}% n 0,255 +#@cli rgb2bayer : _start_pattern=0,_color_grid=0 +#@cli : Transform selected color images to RGB-Bayer sampled images. +#@cli : Default values: 'start_pattern=0' and 'color_grid=0'. +#@cli : $ image.jpg +rgb2bayer 0 +rgb2bayer : skip ${1=0},${2=0} +e[^-1] "Transform image$? to a RGB-Bayer "${arg0\ !$2,color,monochrome}" grid, starting from pattern '$1'." +to_rgb foreach { _rgb2bayer$1 ri[1] [0],0,2 * if !$2 s c + fi } +_rgb2bayer0 : (1,0;0,0^0,1;1,0^0,0;0,1) +_rgb2bayer1 : (0,0;0,1^0,1;1,0^1,0;0,0) +_rgb2bayer2 : (0,1;0,0^1,0;0,1^0,0;1,0) +_rgb2bayer3 : (0,0;1,0^1,0;0,1^0,1;0,0) +#@cli rgb2cmy +#@cli : Convert color representation of selected images from RGB to CMY. +#@cli : $ image.jpg rgb2cmy split c +rgb2cmy : +e[^-1] "Convert color representation of image$? from RGB to CMY." +to_rgb * -1 + 255 c 0,255 +#@cli rgb2cmyk +#@cli : Convert color representation of selected images from RGB to CMYK. +#@cli : $ image.jpg rgb2cmyk split c +#@cli : $ image.jpg rgb2cmyk split c fill[3] 0 append c cmyk2rgb +rgb2cmyk : +e[^-1] "Convert color representation of image$? from RGB to CMYK." +rgb2cmy foreach { s c +min -[0-2] . +/. 255 -. 1 *. -1 +==. 0 +[-2,-1] /[0-2] . rm. a c } +#@cli rgb2hcy +#@cli : Convert color representation of selected images from RGB to HCY. +#@cli : $ image.jpg rgb2hcy split c +rgb2hcy : +e[^-1] "Convert color representation of image$? from RGB to HCY." +to_color f " +M = max(R,G,B); +C = M - min(R,G,B); +H = 60*(C==0?0:M==R?((G-B)/C)%6:M==G?(B-R)/C+2:(R-G)/C+4); +Y = 0.299*R + 0.587*G + 0.114*B; +[ H,C/255,Y/255 ]" +#@cli rgb2hsi +#@cli : Convert color representation of selected images from RGB to HSI. +#@cli : $ image.jpg rgb2hsi split c +rgb2hsi : +e[^-1] "Convert color representation of image$? from RGB to HSI." +to_color +f " +m = min(R,G,B); +M = max(R,G,B); +C = M - m; +sum = R + G + B; +H = 60*(C==0?0:M==R?((G - B)/C)%6:M==G?(B - R)/C + 2:(R - G)/C + 4); +S = sum<=0?0:1 - 3*m/sum; +I = sum/(3*255); +[ H, S, I ]" +#@cli rgb2hsi8 +#@cli : Convert color representation of selected images from RGB to HSI8. +#@cli : $ image.jpg rgb2hsi8 split c +rgb2hsi8 : +e[^-1] "Convert color representation of image$? from RGB to HSI8." +rgb2hsi _rgb2hsx8 +#@cli rgb2hsl +#@cli : Convert color representation of selected images from RGB to HSL. +#@cli : $ image.jpg rgb2hsl split c +#@cli : $ image.jpg rgb2hsl +split c add[-3] 100 mod[-3] 360 append[-3--1] c hsl2rgb +rgb2hsl : +e[^-1] "Convert color representation of image$? from RGB to HSL." +to_color +f " +m = min(R,G,B); +M = max(R,G,B); +C = M - m; +H = 60*(C==0?0:M==R?((G - B)/C)%6:M==G?(B - R)/C + 2:(R - G)/C + 4); +L = 0.5*(m + M)/255; +S = L==1 || L==0?0:C/(1 - abs(2*L - 1))/255; +[ H, S, L ]" +#@cli rgb2hsl8 +#@cli : Convert color representation of selected images from RGB to HSL8. +#@cli : $ image.jpg rgb2hsl8 split c +rgb2hsl8 : +e[^-1] "Convert color representation of image$? from RGB to HSL8." +rgb2hsl _rgb2hsx8 +#@cli rgb2hsv +#@cli : Convert color representation of selected images from RGB to HSV. +#@cli : $ image.jpg rgb2hsv split c +#@cli : $ image.jpg rgb2hsv +split c add[-2] 0.3 cut[-2] 0,1 append[-3--1] c hsv2rgb +rgb2hsv : +e[^-1] "Convert color representation of image$? from RGB to HSV." +to_color +f " +M = max(R,G,B); +C = M - min(R,G,B); +H = 60*(C==0?0:M==R?((G - B)/C)%6:M==G?(B - R)/C + 2:(R - G)/C + 4); +S = M<=0?0:C/M; +[ H, S, M/255 ]" +#@cli rgb2hsv8 +#@cli : Convert color representation of selected images from RGB to HSV8. +#@cli : $ image.jpg rgb2hsv8 split c +rgb2hsv8 : +e[^-1] "Convert color representation of image$? from RGB to HSV8." +rgb2hsv _rgb2hsx8 +_rgb2hsx8 : +repeat $! { +sh[$>] 0 *. 0.708333 rm. +sh[$>] 1,2 *. 255 rm. +} +#@cli rgb2int +#@cli : Convert color representation of selected images from RGB to INT24 scalars. +#@cli : $ image.jpg rgb2int +rgb2int : +e[^-1] "Convert color representation of image$? from RGB to INT24 scalars." +to_rgb round foreach { s c <<[0] 16 <<[1] 8 + } +#@cli rgb2jzazbz : illuminant={ 0=D50 | 1=D65 | 2=E } : (no arg) +#@cli : Convert color representation of selected images from RGB to Jzazbz. +#@cli : Default value: 'illuminant=2'. +rgb2jzazbz : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0?1:0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from RGB to Jzazbz, using the "${arg0\ $illu,D50,D65,E}" illuminant." +rgb2xyz $illu xyz2jzazbz +#@cli rgb2lab : illuminant={ 0=D50 | 1=D65 | 2=E } : (no arg) +#@cli : Convert color representation of selected images from RGB to Lab. +#@cli : Default value: 'illuminant=2'. +rgb2lab : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0?1:0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from RGB to Lab, using the "${arg0\ $illu,D50,D65,E}" illuminant." +rgb2xyz $illu xyz2lab $illu +#@cli rgb2lab8 : illuminant={ 0=D50 | 1=D65 | 2=E } : (no arg) +#@cli : Convert color representation of selected images from RGB to Lab8. +#@cli : Default value: 'illuminant=2'. +#@cli : $ image.jpg rgb2lab8 split c +rgb2lab8 : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0?1:0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from RGB to Lab8, using the "${arg0\ $illu,D50,D65,E}" illuminant." +rgb2lab $illu repeat $! { +sh[$>] 0 *. 2.55 rm. +sh[$>] 1 +. 127 *. 0.85 rm. +sh[$>] 2 +. 149 *. 0.836 rm. +} c 0,255 +#@cli rgb2lch : illuminant={ 0=D50 | 1=D65 | 2=E } : (no arg) +#@cli : Convert color representation of selected images from RGB to Lch. +#@cli : Default value: 'illuminant=2'. +#@cli : $ image.jpg rgb2lch split c +rgb2lch : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0?1:0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from RGB to Lch, using the "${arg0\ $illu,D50,D65,E}" illuminant." +rgb2lab $illu lab2lch +#@cli rgb2lch8 : illuminant={ 0=D50 | 1=D65 | 2=E } : (no arg) +#@cli : Convert color representation of selected images from RGB to Lch8. +#@cli : Default value: 'illuminant=2'. +#@cli : $ image.jpg rgb2lch8 split c +rgb2lch8 : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0?1:0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from RGB to Lch8, using the "${arg0\ $illu,D50,D65,E}" illuminant." +pi,facth:=[pi,255/(2*pi)] +rgb2lch $illu repeat $! { +sh[$>] 0 *. 2.55 rm. +sh[$>] 1 *. 1.1086 rm. +sh[$>] 2 +. $pi *. $facth rm. +} c 0,255 +#@cli rgb2luv +#@cli : Convert color representation of selected images from RGB to LUV. +#@cli : $ image.jpg rgb2luv split c +rgb2luv : +e[^-1] "Convert color representation of image$? from RGB to LUV." +foreach { ++rgb2xyz rgb2lab.. channels.. 0 s. c +*. 3 +*.. 15 +[-2,-1] +. ... +. 1e-8 +*... 4 *.. 9 /[-3,-2] . rm. +-.. 0.2009 -. 0.4610 ++*... 13 *... . *[-2,-1] a c +} +#@cli rgb2oklab +#@cli : Convert color representation of selected images from RGB to Oklab. +#@cli : (see colorspace definition at: ). +#@cli : See also: ''oklab2rgb''. +rgb2oklab : +e[^-1] "Convert color representation of image$? from RGB to Oklab." +foreach { +split_opacity to_rgb[0] /[0] 255 +f[0] " +l = cbrt(0.4121656120*R + 0.5362752080*G + 0.0514575653*B); +m = cbrt(0.2118591070*R + 0.6807189584*G + 0.1074065790*B); +s = cbrt(0.0883097947*R + 0.2818474174*G + 0.6302613616*B); +[ 0.2104542553*l + 0.7936177850*m - 0.0040720468*s, +1.9779984951*l - 2.4285922050*m + 0.4505937099*s, +0.0259040371*l + 0.7827717662*m - 0.8086757660*s ]" +a c +} +#@cli rgb2ryb +#@cli : Convert color representation of selected images from RGB to RYB. +#@cli : $ image.jpg rgb2ryb split c +rgb2ryb : +e[^-1] "Convert color representation of image$? from RGB to RYB." +to_color +f "red = R; +green = G; +blue = B; +white = min(red,green,blue); +red-=white; +green-=white; +blue-=white; +maxgreen = max(red,green,blue); +yellow = min(red,green); +red-=yellow; +green-=yellow; +blue>0 && green>0?(blue/=2; green/=2); +yellow+=green; +blue+=green; +maxyellow = max(red,yellow,blue); +maxyellow>0?( +N = maxgreen/maxyellow; +red*=N; +yellow*=N; +blue*=N; +); +red+=white; +yellow+=white; +blue+=white; +[ red,yellow,blue ]" +#@cli rgb2srgb +#@cli : Convert color representation of selected images from linear RGB to sRGB. +rgb2srgb : +e[^-1] "Convert color representation of image$? from linear RGB to sRGB." +f "val = i/255; sval = val<=0.0031308?val*12.92:1.055*val^0.416667 - 0.055; cut(255*sval,0,255)" +#@cli rgb2xyz : illuminant={ 0=D50 | 1=D65 | 2=E } : (no arg) +#@cli : Convert color representation of selected images from RGB to XYZ. +#@cli : Default value: 'illuminant=2'. +#@cli : $ image.jpg rgb2xyz split c +rgb2xyz : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0?1:0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from RGB to XYZ, using the "${arg0\ $illu,D50,D65,E}" illuminant." +if $illu==2 +mix_rgb {[0.488718,0.3106803,0.2006017,0.1762044,0.8129847,0.0108109,0,0.0102048,0.9897952]/255} +elif $illu==1 +mix_rgb {[0.4124564,0.3575761,0.1804375,0.2126729,0.7151522,0.0721750,0.0193339,0.1191920,0.9503041]/255} +else +mix_rgb {[0.43603516,0.38511658,0.14305115,0.22248840,0.71690369,0.06060791,0.01391602,0.09706116,0.71392822]/255} +fi +#@cli rgb2xyz8 : illuminant={ 0=D50 | 1=D65 | 2=E } : (no arg) +#@cli : Convert color representation of selected images from RGB to XYZ8. +#@cli : Default value: 'illuminant=2'. +#@cli : $ image.jpg rgb2xyz8 split c +rgb2xyz8 : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0?1:0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from RGB to XYZ8, using the "${arg0\ $illu,D50,D65,E}" illuminant." +rgb2xyz $illu repeat $! { +sh[$>] 0 *. 255 rm. +sh[$>] 1 *. 255 rm. +sh[$>] 2 *. 231.8182 rm. +} +#@cli rgb2yiq +#@cli : Convert color representation of selected images from RGB to YIQ. +#@cli : $ image.jpg rgb2yiq split c +rgb2yiq : +e[^-1] "Convert color representation of image$? from RGB to YIQ." +mix_rgb 0.299,0.587,0.114,0.595716,-0.274453,-0.321263,0.211456,-0.522591,0.311135 +#@cli rgb2yiq8 +#@cli : Convert color representation of selected images from RGB to YIQ8. +#@cli : $ image.jpg rgb2yiq8 split c +rgb2yiq8 : +e[^-1] "Convert color representation of image$? from RGB to YIQ." +rgb2yiq +repeat $! { +sh[$>] 1 +. 151.908 *. 0.8393238012481239 rm. +sh[$>] 2 +. 133.261 *. 0.9567690472081104 rm. +} +#@cli rgb2ycbcr +#@cli : Convert color representation of selected images from RGB to YCbCr. +#@cli : $ image.jpg rgb2ycbcr split c +rgb2ycbcr : +e[^-1] "Convert color representation of image$? from RGB to YCbCr." +mix_rgb 66,129,25,-38,-74,112,112,-94,-18 +repeat $! { +sh[$>] 0,2 +. 128 /. 256 rm. +sh[$>] 0 +. 16 rm. +sh[$>] 1,2 +. 128 rm. +} +#@cli rgb2yuv +#@cli : Convert color representation of selected images from RGB to YUV. +#@cli : $ image.jpg rgb2yuv split c +rgb2yuv : +e[^-1] "Convert color representation of image$? from RGB to YUV." +mix_rgb {[0.299,0.587,0.114,-0.14713,-0.28886,0.436,0.615,-0.51498,-0.10001]/255} +#@cli rgb2yuv8 +#@cli : Convert color representation of selected images from RGB to YUV8. +#@cli : $ image.jpg rgb2yuv8 split c +rgb2yuv8 : +e[^-1] "Convert color representation of image$? from RGB to YUV8." +rgb2yuv repeat $! { +sh[$>] 0 *. 255 rm. +sh[$>] 1 +. 0.44 *. 289.773 rm. +sh[$>] 2 +. 0.62 *. 205.645 rm. +} +#@cli remove_opacity +#@cli : Remove opacity channel of selected images. +remove_opacity : +e[^-1] "Remove opacity channel of image$?." +foreach { +if !s||s>4 error[0--5] "Command '$0': Image ["$>"] is not a G,GA,RGB or RGBA image ("{s}" channels)." +elif s==2 channels 0 +elif s==4 channels 0,2 +fi +} +#@cli ryb2rgb +#@cli : Convert color representation of selected images from RYB to RGB. +ryb2rgb : +e[^-1] "Convert color representation of image$? from RYB to RGB." +to_color +f "red = R; +yellow = G; +blue = B; +white = min(red,yellow,blue); +red-=white; +yellow-=white; +blue-=white; +maxyellow = max(red,yellow,blue); +green = min(yellow,blue); +yellow-=green; +blue-=green; +blue>0 && green>0?(blue*=2; green*=2); +red+=yellow; +green+=yellow; +maxgreen = max(red,green,blue); +maxgreen>0?( +N = maxyellow/maxgreen; +red*=N; +green*=N; +blue*=N; +); +red+=white; +green+=white; +blue+=white; +[ red,green,blue ]" +#@cli select_color : tolerance[%]>=0,col1,...,colN +#@cli : Select pixels with specified color in selected images. +#@cli : $ image.jpg +select_color 40,204,153,110 +#@cli : $$ https://gmic.eu/oldtutorial/_select_color +select_color : skip ${1=0} +e[^-1] "Select color (${2--1}) in image$?, with tolerance $1." +foreach { +fc ${2--1} - norm <= $1 } +#@cli sepia +#@cli : Apply sepia tones effect on selected images. +#@cli : $ image.jpg sepia +sepia : +e[^-1] "Apply sepia tones effect on image$?." +(0,44,115,143,196,244^0,20,84,119,184,235^0,5,44,73,144,200) r. 256,1,1,3,3 +foreach[^-1] { pass. split_opacity[0] luminance[0] map[0] . rm. a c } +rm. +#@cli solarize +#@cli : Solarize selected images. +#@cli : $ image.jpg solarize +solarize : +e[^-1] "Solarize image$?." +luminance n 0,128 map 1 +#@cli split_colors : _tolerance>=0,_max_nb_outputs>0,_min_area>0 +#@cli : Split selected images as several image containing a single color. +#@cli : One selected image can be split as at most 'max_nb_outputs' images. +#@cli : Output images are sorted by decreasing area of extracted color regions and have an additional alpha-channel. +#@cli : Default values: 'tolerance=0', 'max_nb_outputs=256' and 'min_area=8'. +#@cli : $ image.jpg quantize 5 +split_colors , display_rgba +split_colors : check "${1=0}>=0 && isint(${2=256}) && $2>0 && ${3=8}>=1" +e[^-1] "Split image$? as single color outputs, with tolerance $1, $2 maximal outputs and minimal color area $3." +foreach { ++label 0,1 norm. area. 0,1 +repeat $2-1 { +coordsM={1,[xM,yM,zM,cM]} +if {1,i($coordsM)<$3} break fi +color={0,I($coordsM)} ++select_color[0] $1,$color +==. 0 *[1] . ==. 0 +} +if iM#1 !=[1] 0 mv[1] $! # Residual mask, if any. +else rm[1] fi +r[^0] [0],[0],[0],{0,s+1} +N:=$!-1 +sh[^0] 0,{s-2} *[-$N--1] [0] rm[-$N--1] +sh[^0] 100% *[-$N--1] 255 rm[0,-$N--1] +} +#@cli split_opacity +#@cli : Split color and opacity parts of selected images. +#@cli : This command returns 1 or 2 images for each selected image, whether it has an opacity channel or not. +split_opacity : +e[^-1] "Split color and opacity parts of image$?." +foreach { s c,{s==4?-3:s==2?-1:-s} } +#@cli srgb2lab : illuminant={ 0=D50 | 1=D65 | 2=E } : (no arg) +#@cli : Convert color representation of selected images from sRGB to Lab. +#@cli : Default value: 'illuminant=2'. +#@cli : $ image.jpg srgb2lab split c +#@cli : $ image.jpg srgb2lab +split c mul[-2,-1] 2.5 append[-3--1] c lab2srgb +srgb2lab : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0?1:0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from sRGB to Lab, using the "${arg0\ $illu,D50,D65,E}" illuminant." +srgb2rgb rgb2lab $illu +#@cli srgb2lab8 : illuminant={ 0=D50 | 1=D65 | 2=E } : (no arg) +#@cli : Convert color representation of selected images from sRGB to Lab8. +#@cli : Default value: 'illuminant=2'. +srgb2lab8 : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0?1:0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from sRGB to Lab8, using the "${arg0\ $illu,D50,D65,E}" illuminant." +srgb2rgb rgb2lab8 $illu +#@cli srgb2rgb +#@cli : Convert color representation of selected images from sRGB to linear RGB. +srgb2rgb : +e[^-1] "Convert color representation of image$? from sRGB to linear RGB." +f "sval = i/255; val = sval<=0.04045?sval/12.92:((sval + 0.055)/(1.055))^2.4; cut(255*val,0,255)" +#@cli to_a +#@cli : Force selected images to have an alpha channel. +to_a : +e[^-1] "Force image$? to have an alpha channel." +foreach { +if !s||s>4 error[0--5] "Command '$0': Image ["$>"] is not a G,GA,RGB or RGBA image ("{s}" channels)." +elif s==1||s==3 channels 0,{s} sh. {s-1} f. 255 rm. fi +} +#@cli to_color +#@cli : Force selected images to be in color mode (RGB or RGBA). +to_color : +e[^-1] "Force image$? to be in color mode." +foreach { +if !s||s>4 error[0--5] "Command '$0': Image ["$>"] is not a G,GA,RGB or RGBA image ("{s}" channels)." +elif s==2 r 100%,100%,1,4,0,1,0,0,0,1 +elif s==1 r 100%,100%,1,3,1 +fi +} +#@cli to_colormode : mode={ 0=adaptive | 1=G | 2=GA | 3=RGB | 4=RGBA } +#@cli : Force selected images to be in a given color mode. +#@cli : Default value: 'mode=0'. +to_colormode : check "isint(${1=0}) && inrange($1,0,4)" +s,err:="$1?[ $1,$1 ]:(rgb = a = e = 0; repeat (l,k,rgb|=s#k>=3; a|=!(s#k%2); e|=!s#k||s#k>4); [ (rgb?3:1) + a,e ])" +if $err foreach { +if !s||s>4 error[0--5] "Command '$0': Image ["$>"] is not a G,GA,RGB or RGBA image ("{s}" channels)." fi +} fi +ss=${"arg "$s",gray,graya,rgb,rgba"} +e[^-1] "Force image$? to be in "{`uppercase(['$ss'])`}" mode." +to_$ss +#@cli to_gray +#@cli : Force selected images to be in GRAY mode. +#@cli : $ image.jpg +to_gray +to_gray : +e[^-1] "Force image$? to be in GRAY mode." +foreach { +if !s||s>4 error[0--5] "Command '$0': Image ["$>"] is not a G,GA,RGB or RGBA image ("{s}" channels)." +elif s>=3 luminance +elif s==2 channels 0 +fi +} +#@cli to_graya +#@cli : Force selected images to be in GRAYA mode. +to_graya : +e[^-1] "Force image$? to be in GRAYA mode." +foreach { +if !s||s>4 error[0--5] "Command '$0': Image ["$>"] is not a G,GA,RGB or RGBA image ("{s}" channels)." +elif s==4 s c,-3 luminance.. a c +elif s==3 luminance channels 0,1 sh. 1 f. 255 rm. +elif s==1 channels 0,1 sh. 1 f. 255 rm. +fi +} +#@cli to_pseudogray : _max_step>=0,_is_perceptual_constraint={ 0 | 1 },_bits_depth>0 +#@cli : Convert selected scalar images ([0-255]-valued) to pseudo-gray color images. +#@cli : Default values: 'max_step=5', 'is_perceptual_constraint=1' and 'bits_depth=8'. +#@cli : The original pseudo-gray technique has been introduced by Rich Franzen . +#@cli : Extension of this technique to arbitrary increments for more tones, has been done by David Tschumperlé. +to_pseudogray : check "isint(${1=5}) && $1>=0 && isint(${3=8}) && $3>0" skip ${2=1} +e[^-1] "Convert scalar image$? to pseudo-gray color images, with steps $1." +channels 0 srgb2rgb pseudogray $1,{2.3*$2},$3 ++srgb2lab. channels. 0 *. {65535/100} round. rows. 0,2 +rv[-2,-1] permute. xcyz +. 1 a[-2,-1] y pointcloud. 0 ++norm. !=. 0 distance. 1 *. -1 watershed.. . rm. -. 1 +repeat $!-1 { +to_rgb[$>] rgb2lab[$>] channels[$>] 0 *[$>] {65535/100} round[$>] c[$>] 0,65535 +map[$>] . +} rm. +#@cli to_rgb +#@cli : Force selected images to be in RGB mode. +to_rgb : +e[^-1] "Force image$? to be in RGB mode." +foreach { +if !s||s>4 error[0--5] "Command '$0': Image ["$>"] is not a G,GA,RGB or RGBA image ("{s}" channels)." +elif s==4 channels 0,2 +elif s==2 channels 0 r 100%,100%,100%,3 +elif s==1 r 100%,100%,100%,3 +fi +} +#@cli to_rgba +#@cli : Force selected images to be in RGBA mode. +to_rgba : +e[^-1] "Force image$? to be in RGBA mode." +foreach { +if !s||s>4 error[0--5] "Command '$0': Image ["$>"] is not a G,GA,RGB or RGBA image ("{s}" channels)." +elif s==3 channels 0,3 sh. 3 f. 255 rm. +elif s==2 r 100%,100%,100%,4,0,1,0,0,0,1 +elif s==1 r 100%,100%,100%,4 sh. 3 f. 255 rm. +fi +} +#@cli to_automode +#@cli : Force selected images to be in the most significant color mode. +#@cli : This commands checks for useless alpha channel (all values equal to 255), as well as +#@cli : detects grayscale images encoded as color images. +to_automode : +e[^-1] "Force image$? to be in most significant color mode." +foreach { +if s==2||s==4 +sh 100% +if im==iM" && "im==255 rm. channels 0,{s-2} else rm. fi +fi +if s==3||s==4 +eval. "begin(is_gray = 1); is_gray && (i0!=i1 || i0!=i2)?(is_gray = 0); +end(merge(is_gray,&&); set('is_gray',is_gray))" +if $is_gray s c,-3 channels[0] 0 a c fi +fi +} +#@cli xyz2jzazbz +#@cli : Convert color representation of selected images from XYZ to RGB. +xyz2jzazbz : +e[^-1] "Convert color representation of image$? from XYZ to Jzazbz." +foreach { split_opacity +f[0] ${-_jzazbz_const}" +X = i0*255; +Y = i1*255; +Z = i2*255; +Xp = Jzazbz_b*X - (Jzazbz_b - 1)*Z; +Yp = Jzazbz_g*Y - (Jzazbz_g - 1)*X; +Zp = Z; +L = 0.41478972*Xp + 0.579999*Yp + 0.0146480*Zp; +M = -0.2015100*Xp + 1.120649*Yp + 0.0531008*Zp; +S = -0.0166008*Xp + 0.264800*Yp + 0.6684799*Zp; +tmp = (L/peakLum)^Jzazbz_n; +Lp = ((Jzazbz_c1 + Jzazbz_c2*tmp)/(1 + Jzazbz_c3*tmp))^Jzazbz_p; +tmp = (M/peakLum)^Jzazbz_n; +Mp = ((Jzazbz_c1 + Jzazbz_c2*tmp)/(1 + Jzazbz_c3*tmp))^Jzazbz_p; +tmp = (S/peakLum)^Jzazbz_n; +Sp = ((Jzazbz_c1 + Jzazbz_c2*tmp)/(1 + Jzazbz_c3*tmp))^Jzazbz_p; +Iz = 0.5*Lp + 0.5*Mp; +az = 3.52400*Lp - 4.066708*Mp + 0.542708*Sp; +bz = 0.199076*Lp + 1.096799*Mp - 1.295875*Sp; +Jz = (1 + Jzazbz_d)*Iz/(1 + Jzazbz_d*Iz) - Jzazbz_d0; +[ Jz,az,bz ]" +a c } +#@cli xyz2lab : illuminant={ 0=D50 | 1=D65 | 2=E } : (no arg) +#@cli : Convert color representation of selected images from XYZ to Lab. +#@cli : Default value: 'illuminant=2'. +xyz2lab : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0?1:0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from XYZ to Lab, using the "${arg0\ $illu,D50,D65,E}" illuminant." +to_color +f " +begin( +const epsilon = 216/24389; +const kappa = 24389/27; +lab(x) = (x>epsilon?cbrt(x):(x*kappa + 16)/116); +D65 = [ 0.4124564, 0.3575761, 0.1804375, +0.2126729, 0.7151522, 0.0721750, +0.0193339, 0.1191920, 0.9503041 ]; +D50 = [ 0.43603516, 0.38511658, 0.14305115, +0.22248840, 0.71690369, 0.06060791, +0.01391602, 0.09706116, 0.71392822 ]; +E = [ 0.488718,0.3106803,0.2006017, +0.1762044,0.8129847,0.0108109, +0,0.0102048,0.9897952 ]; +white = ("$illu"==2?E:"$illu"==1?D65:D50)*[ 1,1,1 ]; +); +xr = i0/white[0]; +yr = i1/white[1]; +zr = i2/white[2]; +fx = lab(xr); +fy = lab(yr); +fz = lab(zr); +[ cut(116*fy - 16,0,100), 500*(fx - fy), 200*(fy - fz) ]" +#@cli xyz2rgb : illuminant={ 0=D50 | 1=D65 | 2=E } : (no arg) +#@cli : Convert color representation of selected images from XYZ to RGB. +#@cli : Default value: 'illuminant=2'. +xyz2rgb : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0?1:0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from XYZ to RGB, using the "${arg0\ $illu,D50,D65,E}" illuminant." +if $illu==2 +mix_rgb {[2.3706743,-0.9000405,-0.4706338,-0.513885,1.4253036,0.0885814,0.0052982,-0.0146949,1.0093968]*255} +elif $illu +mix_rgb {[3.2404542,-1.5371385,-0.4985314,-0.9692660,1.8760108,0.0415560,0.0556434,-0.2040259,1.0572252]*255} +else +mix_rgb {[3.134274799724,-1.617275708956,-0.490724283042,-0.978795575994,1.916161689117,0.033453331711,0.071976988401,-0.228984974402,1.405718224383]*255} +fi +c 0,255 +#@cli xyz82rgb : illuminant={ 0=D50 | 1=D65 | 2=E } : (no arg) +#@cli : Convert color representation of selected images from XYZ8 to RGB. +#@cli : Default value: 'illuminant=2'. +xyz82rgb : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0?1:0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from XYZ8 to RGB, using the "${arg0\ $illu,D50,D65,E}" illuminant." +repeat $! { +sh[$>] 0 /. 255 rm. +sh[$>] 1 /. 255 rm. +sh[$>] 2 /. 231.8182 rm. +} xyz2rgb $illu +#@cli ycbcr2rgb +#@cli : Convert color representation of selected images from YCbCr to RGB. +ycbcr2rgb : +e[^-1] "Convert color representation of image$? from YCbCr to RGB." +repeat $! { +sh[$>] 0 -. 16 rm. +sh[$>] 1,2 -. 128 rm. +sh[$>] 0,2 mix_rgb. 298,0,409,298,-100,-208,298,516,0 ++. 128 /. 256 c. 0,255 rm. +} +#@cli yiq2rgb +#@cli : Convert color representation of selected images from YIQ to RGB. +yiq2rgb : +e[^-1] "Convert color representation of image$? from YIQ to RGB." +mix_rgb 1,0.9563,0.6210,1,-0.2721,-0.6474,1,-1.1070,1.7046 +c 0,255 +#@cli yiq82rgb +#@cli : Convert color representation of selected images from YIQ8 to RGB. +yiq82rgb : +e[^-1] "Convert color representation of image$? from YIQ8 to RGB." +repeat $! { +sh[$>] 1 /. 0.8393238012481239 -. 151.908 rm. +sh[$>] 2 /. 0.9567690472081104 -. 133.261 rm. +} +mix_rgb 1,0.9563,0.6210,1,-0.2721,-0.6474,1,-1.1070,1.7046 +c 0,255 +#@cli yuv2rgb +#@cli : Convert color representation of selected images from YUV to RGB. +yuv2rgb : +e[^-1] "Convert color representation of image$? from YUV to RGB." +mix_rgb {[1,0,1.13983,1,-0.39465,-0.5806,1,2.03211,0]*255} +c 0,255 +#@cli yuv82rgb +#@cli : Convert selected images from YUV8 to RGB color bases. +yuv82rgb : +e[^-1] "Convert color representation of image$? from YUV8 to RGB." +repeat $! { +sh[$>] 0 /. 255 rm. +sh[$>] 1 /. 289.773 -. 0.44 rm. +sh[$>] 2 /. 205.645 -. 0.62 rm. +} yuv2rgb +#@cli :: Geometry Manipulation +#@cli a : eq. to 'append' : (+) +#@cli append : [image],axis,_centering : axis,_centering : (+) +#@cli : Append specified image to selected images, or all selected images together, along specified axis. +#@cli : (eq. to 'a').\n +#@cli : 'axis' can be { x | y | z | c }. +#@cli : Usual 'centering' values are { 0=left-justified | 0.5=centered | 1=right-justified }. +#@cli : Default value: 'centering=0'. +#@cli : $ image.jpg split y,10 reverse append y +#@cli : $ image.jpg repeat 5 { +rows[0] 0,{10+18*$>}% } remove[0] append x,0.5 +#@cli : $ image.jpg append[0] [0],y +#@cli append_tiles : _M>=0,_N>=0,0<=_centering_x<=1,0<=_centering_y<=1 +#@cli : Append MxN selected tiles as new images. +#@cli : If 'N' is set to 0, number of rows is estimated automatically. +#@cli : If 'M' is set to 0, number of columns is estimated automatically. +#@cli : If 'M' and 'N' are both set to '0', auto-mode is used. +#@cli : If 'M' or 'N' is set to 0, only a single image is produced. +#@cli : 'centering_x' and 'centering_y' tells about the centering of tiles when they have different sizes. +#@cli : Default values: 'M=0', 'N=0', 'centering_x=centering_y=0.5'. +#@cli : $ image.jpg split xy,4 append_tiles , +append_tiles : check "isint(${1=0}) && isint(${2=0}) && ${3=0}>=0 && $3<=1 && ${4=$3}>=0 && $4<=1" +if !$! +e[0--3] "Append image$? as a 0x0-tiled image." +return +elif !$1" && "!$2 +N:=int(sqrt($!)) M:=ceil($!/$N) +e[0--3] "Append image$? as a "${M}x${N}"-tiled image (auto-mode)." +elif !$2 +M=$1 N:=round($!/$1,1,1) +e[0--3] "Append image$? as a "${M}x${N}"-tiled image." +elif !$1 +M:=round($!/$2,1,1) N=$2 +e[0--3] "Append image$? as a "${M}x${N}"-tiled image." +else +e[0--3] "Append image$?, as $1x$2-tiled images." +M=$1 N=$2 +fi +W,H=${-max_wh} rr2d $W,$H,2,1 +MN:=$M*$N if $!%$MN 0x{$MN-($!%$MN)} fi +repeat $!/$MN { l[$>-{$>+$MN-1}] { +repeat $!/$M { a[$>-{$>+$M-1}] x,$3 } +a y,$4 +} } +#@cli apply_scales : "command",number_of_scales>0,_min_scale[%]>=0,_max_scale[%]>=0,_scale_gamma>0,_interpolation +#@cli : Apply specified command on different scales of selected images. +#@cli : 'interpolation' can be { 0=none | 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }. +#@cli : Default value: 'min_scale=25%', 'max_scale=100%' and 'interpolation=3'. +#@cli : $ image.jpg apply_scales "blur 5 sharpen 1000",4 +apply_scales : check "isint($2) && $2>0 && ${3=25%}>=0 && ${4=100%}>=0 && ${5=1}>0 && isint(${6=3}) && $6>=0" +skip "${1=}" +s0="no" s1="nearest-neighbor" s2="average" s3="linear" s4="grid" s5="bicubic" s6="lanczos" +e[^-1] "Apply command '$1' on image$? for $2 scales ($3 -> $4) and "${s{min(6,$6)}}" interpolation." +foreach { +nm={n} +scale0:=${"is_percent $3"}?$3*max(w,h,d):$3 +scale1:=${"is_percent $4"}?$4*max(w,h,d):$4 +repeat $2 { +scale:=$scale0+($scale1-$scale0)*($>/max(1,$2-1))^$5 +w={0,w==1?1:max(1,round($scale*w/max(w,h,d)))} +h={0,h==1?1:max(1,round($scale*h/max(w,h,d)))} +d={0,d==1?1:max(1,round($scale*d/max(w,h,d)))} ++r[0] $w,$h,$d,100%,$6 +if narg("$1") l. { $1 } fi +} +rm[0] =>[^] $nm +} +#@cli autocrop : value1,value2,... : (no arg) : (+) +#@cli : Autocrop selected images by specified vector-valued intensity. +#@cli : If no arguments are provided, cropping value is guessed. +#@cli : $ 400,400,1,3 fill_color 64,128,255 ellipse 50%,50%,120,120,0,1,255 +autocrop +#@cli autocrop_components : _threshold[%],_min_area[%]>=0,_is_high_connectivity={ 0 | 1 },_output_type={ 0=crop | 1=segmentation | 2=coordinates } +#@cli : Autocrop and extract connected components in selected images, according to a mask given as the last channel of +#@cli : each of the selected image (e.g. alpha-channel). +#@cli : Default values: 'threshold=0%', 'min_area=0.1%', 'is_high_connectivity=0' and 'output_type=1'. +#@cli : $ 256,256 noise 0.1,2 eq 1 dilate_circ 20 label_fg 0,1 normalize 0,255 +neq 0 *[-1] 255 append c +autocrop_components , +autocrop_components : skip ${1=0%} check "${2=0.1%}>=0 && isbool(${3=0}) && isint(${4=1}) && $4>=0 && $4<=2" +e[^-1] "Autocrop connected components from image$?, with threshold $1, minimal area $2, "${arg0\ $3,low,high}" connectivity ""and output type set to '"${arg0\ $4,crop,segmentation,coordinates}"'.\n" +foreach { +min_area:=max(1,round(if(${is_percent\ $2},$2*w*h,$2))) ++channels 100% >. $1 area_fg. 0,$3 >=. $min_area ++area. 0,1 <. $min_area -|[-2,-1] label_fg. 0,1 +N:=iM repeat iM { +n:=1+$> +e "\r > "$n/$N +rprogress {100*$n/$N} ++==[1] $n +*[0,-1] rm.. +if $4==0 coords=${autocrop_coords.\ auto} rm. +z[0] $coords +elif $4==1 autocrop. +else coords=${autocrop_coords.\ auto} rm. ($coords) y. +fi +} +rm[0,1] +if !$! 0 fi +if $4==2 a x fi +} +#@cli autocrop_seq : value1,value2,... | auto +#@cli : Autocrop selected images using the crop geometry of the last one by specified vector-valued intensity, +#@cli : or by automatic guessing the cropping value. +#@cli : Default value: auto mode. +#@cli : $ image.jpg +fill[-1] 0 ellipse[-1] 50%,50%,30%,20%,0,1,1 autocrop_seq 0 +autocrop_seq : skip ${1=auto} +e[^-1] "Auto-crop image$? using crop geometry of last image by vector '$*'." +if !$! return fi +is_auto:=['"$1"']=='auto' +if $!==1 _autocrop$is_auto ${1--1} return fi +coords=${autocrop_coords.\ ${1--1}} +x0,y0,z0,x1,y1,z1={[$coords][0,6]} +if $x0>$x1" || "$y0>$y1" || "$z0>$z1 i[0--2] 0 rm[1--1:2] +else z $x0,$y0,$z0,$x1,$y1,$z1 +fi +#@cli channels : c0[%],_c1[%] +#@cli : Keep only specified channels of selected images. +#@cli : Dirichlet boundary is used when specified channels are out of range. +#@cli : Default value: 'c1=c0'. +#@cli : $ image.jpg channels 0,1 +#@cli : $ image.jpg luminance channels 0,2 +channels : skip ${2=$1} +e[^-1] "Keep channels $1...$2 of image$?." +z 0,0,0,$1,100%,100%,100%,$2 +#@cli columns : x0[%],_x1[%] +#@cli : Keep only specified columns of selected images. +#@cli : Dirichlet boundary is used when specified columns are out of range. +#@cli : Default value: 'x1=x0'. +#@cli : $ image.jpg columns -25%,50% +columns : skip ${2=$1} +e[^-1] "Keep columns $1...$2 of image?." +z $1,$2 +#@cli z : eq. to 'crop'. : (+) +#@cli crop : x0[%],x1[%],_boundary_conditions : x0[%],y0[%],x1[%],y1[%],_boundary_conditions : x0[%],y0[%],z0[%],x1[%],y1[%],z1[%],_boundary_conditions : x0[%],y0[%],z0[%],c0[%],x1[%],y1[%],z1[%],c1[%],_boundary_conditions : (+) +#@cli : Crop selected images with specified region coordinates. +#@cli : (eq. to 'z').\n +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default value: 'boundary_conditions=0'. +#@cli : $ image.jpg +crop -230,-230,280,280,1 crop[0] -230,-230,280,280,0 +#@cli : $ image.jpg crop 25%,25%,75%,75% +#@cli diagonal +#@cli : Transform selected vectors as diagonal matrices. +#@cli : $ 1,10,1,1,'y' +diagonal +diagonal : +e[^-1] "Transform vector$? as diagonal matrix." +y repeat $! { r[$>] {$>,h+1},100%,1,1,0 r[$>] {$>,h},100%,1,1,-1 } +downsize_aliased : check "${1=50}>=0 && $1<=100" +if $1==100 return elif !$1 r 1,1,1,100%,2 return fi +N:=ceil(1+100/$1) +foreach { +split_opacity +if $!==1 continue fi ++dilate.. $N +==.. 0 +j[0] ..,0,0,0,0,1,. rm[-2,-1] +a c +r $1%,$1%,$1%,100%,2 +} +#@cli edgels : x0,y0 : (no arg) +#@cli : Retrieve list of edgels (and their normals) that go around a 2D binary silhouette. +#@cli : When specified, arguments 'x0,y0' are the 2D coordinates of the starting point (must be located at the edge of the binary silhouette). +#@cli : Output image has 3 channels '[x,y,n]' where 'x' and 'y' are the 2D coordinates of the edgel point, and 'n' is the orientation of its associated canonical normal (can be { 0=[1,0] | 1=[0,1] | 2=[-1,0] | 3=[0,-1] }. +edgels : skip "${1=},${2=}" +l[] { if "isint($1) && $1>=0 && isint($2) && $2>=0" x0,y0=${1,2} else error[] fi onfail x0,y0=-1 noarg } +foreach { +slices. 0 channels. 0 gt. 0 +1,1,1,3 +eval ${-math_lib}" +x0 = $x0<0?xM#-2:$1; +y0 = $y0<0?yM#-2:$2; +P0 = P = [ x0,y0,argmin(i(#-2,x0 + 1,y0),i(#-2,x0,y0 + 1),i(#-2,x0 - 1,y0),i(#-2,x0,y0 - 1)) ]; +do (da_push(P); P = next_edgel4_fg(#-2,P,1), P!=P0); +resize(#-1,1,da_size(),1,3,0)" +k. +} +#@cli elevate : _depth,_is_plain={ 0 | 1 },_is_colored={ 0 | 1 } +#@cli : Elevate selected 2D images into 3D volumes. +#@cli : Default values: 'depth=64', 'is_plain=1' and 'is_colored=1'. +elevate : check "${1=64}>0" skip ${2=1},${3=1} +e[^-1] "Elevate 2D image$? into $1-slices volume(s)." +r 100%,100%,1,100% +foreach { +nm={n} ++norm 100%,100%,$1,{if($3,{0,s},1)} +m={-2,im} d={-2,iM-$m} +repeat $1 { +if $2 +>=[1] {$m+$d*($>+1)/$1} +else +ir[1] {$m+$d*$>/$1},{$m+$d*($>+1)/$1} +fi +r. 100%,100%,1,.. if $3 *. [0] fi +j.. .,0,0,$> rm. +} +rm[0,1] => $nm } +#@cli expand_x : size_x>=0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror } +#@cli : Expand selected images along the x-axis. +#@cli : Default value: 'boundary_conditions=0'. +#@cli : $ image.jpg expand_x 30,0 +expand_x : check "$1>=0 && ${2=0}>=0 && $2<=3" +e[^-1] "Expand image$? along the x-axis with size $1 and "${"arg0 $2,dirichlet,neumann,periodic,mirror"}" +boundary conditions." +repeat $! { r[$>] {$>,w+2*$1},100%,100%,100%,0,$2,0.5,0.5,0.5 } +#@cli expand_xy : size>=0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror } +#@cli : Expand selected images along the xy-axes. +#@cli : Default value: 'boundary_conditions=0'. +#@cli : $ image.jpg expand_xy 30,0 +expand_xy : check "$1>=0 && ${2=0}>=0 && $2<=3" +e[^-1] "Expand image$? along the xy-axes with size $1 and "${"arg0 $2,dirichlet,neumann,periodic,mirror"}" +boundary conditions." +repeat $! { r[$>] {$>,w+2*$1},{$>,h+2*$1},100%,100%,0,$2,0.5,0.5,0.5 } +#@cli expand_xyz : size>=0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror } +#@cli : Expand selected images along the xyz-axes. +#@cli : Default value: 'boundary_conditions=0'. +expand_xyz : check "$1>=0 && ${2=0}>=0 && $2<=3" +e[^-1] "Expand image$? along the xyz-axes with size $1 and "${"arg0 $2,dirichlet,neumann,periodic,mirror"}" +boundary conditions." +repeat $! { r[$>] {$>,w+2*$1},{$>,h+2*$1},{$>,d+2*$1},100%,0,$2,0.5,0.5,0.5 } +#@cli expand_y : size_y>=0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror } +#@cli : Expand selected images along the y-axis. +#@cli : Default value: 'boundary_conditions=0'. +#@cli : $ image.jpg expand_y 30,0 +expand_y : check "$1>=0 && ${2=0}>=0 && $2<=3" +e[^-1] "Expand image$? along the y-axis with size $1 and "${"arg0 $2,dirichlet,neumann,periodic,mirror"}" +boundary conditions." +repeat $! { r[$>] 100%,{$>,h+2*$1},100%,100%,0,$2,0.5,0.5,0.5 } +#@cli expand_z : size_z>=0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror } +#@cli : Expand selected images along the z-axis. +#@cli : Default value: 'boundary_conditions=0'. +expand_z : check "$1>=0 && ${2=0}>=0 && $2<=3" +e[^-1] "Expand image$? along the z-axis with size $1 and "${"arg0 $2,dirichlet,neumann,periodic,mirror"}" +boundary conditions." +repeat $! { r[$>] 100%,100%,{$>,d+2*$1},100%,0,$2,0.5,0.5,0.5 } +#@cli extract : "condition",_output_type={ 0=xyzc-coordinates | 1=xyz-coordinates | 2=scalar-values | 3=vector-values } +#@cli : Extract a list of coordinates or values from selected image, where +#@cli : specified mathematical condition holds. +#@cli : For N coordinates matching, result is a 1xNx1x4 image. +#@cli : Default values: 'output_type=0'. +#@cli : $ sp lena +extract "norm(I)>128",3 +extract : check "isin(${2=0},0,1,2,3)" +s0,s1,s2,s3=xyzc-coordinates,xyz-coordinates,scalar-values,vector-values +e[^-1] "Extract "$s$2" from image$? verifying condition '$1'." +str=">begin(run('1,32,1,',arg(1+$2,4,3,1,s)));($1)?(" +if $2==0 str.="da_push([x,y,z,c]));i" +elif $2==1 str.="da_push([x,y,z]));I" +elif $2==2 str.="da_push(i));i" +else str.="da_push(I));I" +fi +str.=";end(resize(#-1,1,da_size(),1,s(#-1),0))" +repeat $! { nm={$>,n} eval[$>] $str => $nm rv[$>,-1] rm. } +#@cli extract_region : [label_image],_extract_xyz_coordinates={ 0 | 1 },_label_1,...,_label_M +#@cli : Extract all pixels of selected images whose corresponding label in '[label_image]' is equal to 'label_m', +#@cli : and output them as M column images. +#@cli : Default value: 'extract_xyz_coordinates=0'. +#@cli : $ image.jpg +blur 3 quantize. 4,0 +extract_region[0] [1],0,1,3 +extract_region : check ${"is_image_arg $1"}" && isnum(${2=0})" +if $#<3 e[0--3] "Extract pixels of image$? for labels [] in image $1, with"${"arg0 !!$2,out"}" coordinates +-> no labels provided, ignoring." return fi +e[^-1] "Extract pixels of image$? for labels {${3--1}} in image $1, with"${"arg0 !!$2,out"}" coordinates." +pass$1 mv. 0 repeat $!-1 { l[0,{1+$<}] { +nm={n} +1,16,1,{s+($2?3:0)} if $#>3 .x{$#-3} fi +f[0] "> +begin( +const N = iM + 1; +R = [ ${3--1} ]; +hash = vectorN(0); +repeat (size(R),k, hash[R[k]] = k + 2); +); +(ind = hash[i])>0?( +$2?da_push(#ind,[ I(#1),x,y,z ]):da_push(#ind,I(#1)); +); i; +end( +repeat (l - 2,k, resize(#k + 2,1,da_size(#k + 2),1,-100,0)) +)" +rm[1] =>[^] $nm +} } rm[0] +#@cli montage : "_layout_code",_montage_mode={ 0<=centering<=1 | 2<=scale+2<=3 },_output_mode={ 0=single layer | 1=multiple layers },"_processing_command" +#@cli : Create a single image montage from selected images, according to specified layout code : +#@cli : - 'X' to assemble all images using an automatically estimated layout. +#@cli : - 'H' to assemble all images horizontally. +#@cli : - 'V' to assemble all images vertically. +#@cli : - 'A' to assemble all images as an horizontal array. +#@cli : - 'B' to assemble all images as a vertical array. +#@cli : - 'Ha:b' to assemble two blocks 'a' and 'b' horizontally. +#@cli : - 'Va:b' to assemble two blocks 'a' and 'b' vertically. +#@cli : - 'Ra' to rotate a block 'a' by 90 deg. ('RRa' for 180 deg. and 'RRRa' for 270 deg.). +#@cli : - 'Ma' to mirror a block 'a' along the X-axis ('MRRa' for the Y-axis). +#@cli : A block 'a' can be an image index (treated periodically) or a nested layout expression 'Hb:c','Vb:c','Rb' or +#@cli : 'Mb' itself. +#@cli : For example, layout code 'H0:V1:2' creates an image where image [0] is on the left, and images [1] and [2] +#@cli : vertically packed on the right. +#@cli : Default values: 'layout_code=X', 'montage_mode=2', output_mode='0' and 'processing_command=""'. +#@cli : $ image.jpg sample ? +plasma[0] shape_cupid 256 normalize 0,255 frame 3,3,0 frame 10,10,255 to_rgb +montage A +montage[^-1] H1:V0:VH2:1H0:3 +montage : check "isnum(${2=2}) && $2>=0 && $2<=3" skip "${1=X}",${3=0},"${4=}" +if $2<=1 e[0--3] "Create aligned montage from image$?, with layout code '$1' and centering $2." +else e[0--3] "Create scaled montage from image$?, with layout code '$1' and scale "{$2-2}"." +fi +to_colormode 0 +if lowercase('"$1"')=='x' ++l { +repeat $! { =>[$>] $> } +repeat $!-1 { +if {-2,w>h}" && "w>h mode=V +elif {-2,h>w}" && "h>w mode=H +elif {-2,w>h}" && "h>w +if {-2,h/w}<(w/h) mode=V else mode=H fi +else +if {-2,w/h}<(h/w) mode=H else mode=V fi +fi +name=$mode{-2,n}:{n} +montage[-2,-1] $mode,$2 +mv. 0 =>[0] $name +} +layout={0,n} +rm +} +montage $layout,$2,$3,"$4" +else +N=$! +l[] { +_scode="$1" _mode=$2 +if lowercase('"$1"')=='h' if $N>1 {$N-1},1,1,1,-1 $N,1,1,1,x a x y else return fi +elif lowercase('"$1"')=='v' if $N>1 {$N-1},1,1,1,-2 $N,1,1,1,x a x y else return fi +elif s=lowercase('"$1"');s=='a'||s=='b' +if $N<2 return fi +nr:=round(sqrt($N)) nc:=round($N/$nr,1,1) +if lowercase('"$1"')=='b' n=$nr nr=$nc nc=$n fi +$N,1,1,1,x s x,-{round(w/$nr,1,1)} foreach { if w>1 i[0] {w-1},1,1,1,-1 a x fi } a x +if $nr>1 i[0] {$nr-1},1,1,1,-2 a x fi y +else +('"$1"') f "if(i==72 || i==104,-1, +if(i==86 || i==118,-2, +if(i==82 || i==114,-3, +if(i==77 || i==109,-4, +if(i>=48 && i<=57,i-48,-5)))))" +s +,-1 s +,-2 s +,-3 s +,-4 s +,-5 +foreach { if im>=0 ++. 48 =.. {t} rm. rows 0 fi } a y discard -5 +fi +f 'if(i<0,i,i%$N)' +} +if $!==$N rm return fi +=>[^-1] 0 +repeat h { +c:=i[$>] +if $c>=0 if {$c,n} i.. [$c] i:=$!-2 =. $i,0,$> ref$i=$c else =>[$c] 1 ref$c=$c fi fi +} +_code={^} _lcode:=narg($_code) rm. +N=$! repeat $N { ($>,0,0,{$>,w},{$>,h},0,0,0) } +l[$N--1] { +_p=1 k[${-_montage}] w:=i[3] h:=i[4] f 'if(i(0,y)<0,-1,i)' discard -1 y r 8,{h/8},1,1,-1 +onfail error[0--3] "Too many input images." +} +if narg("$4") m "__montage : $4 k[0]" +else m "__montage : if $""7%2 mirror x fi if $""8%2 mirror y fi rotate {90*$""6} +r {max(1,round($""4,1,1))},{max(1,round($""5,1,1))},1,100%,3" +fi +s=${max_s[^-1]} +repeat h { +i,xi,yi,wi,hi,ai,mxi,myi={crop(0,$>,w,1)} +if $3||!$> i.. $w,$h,1,$s fi +__montage[$i] ${ref$i},$xi,$yi,{max(1,$wi)},{max(1,$hi)},$ai,$mxi,$myi +j.. [$i],$xi,$yi +} +um __montage +rm[0-{$N-1},-1] +fi +=> "[Montage '$1']" +_montage : +if $_p>$_lcode error "Command 'montage': Incomplete layout code '"$_scode"'." fi +c:=arg($_p,$_code) +if $c>=0 _p+=1 u $c +elif $c==-4 +_p+=1 l=${-_montage} f[$l] 'a=i(5,y)%2;if((x==7&&a)||(x==6&&!a),!i,if(x==1,i(3,0)-i(3,y)-i,i))' u $l +elif $c==-3 +_p+=1 l=${-_montage} l[$l] { s x +[2] [4] rv[1,2] *[1] -1 +[1] {4,@0} rv[3,4] +[5] 1 a x } u $l +else +_p+=1 +l=${-_montage} lw={$l,@3} lh={$l,@4} +r=${-_montage} rw={$r,@3} rh={$r,@4} +if $c==-1 +if $_mode<2 +h:=max($lh,$rh) ++[$l] '0,0,{($h-$lh)*min(1,$_mode)},0,0,0,0,0' ++[$r] '0,$lw,{($h-$rh)*min(1,$_mode)},0,0,0,0,0' +else +h:=($_mode-2)*max($lh,$rh)+(3-$_mode)*min($lh,$rh) +lf:=$h/$lh rf:=$h/$rh lw:=$lw*$lf rw:=$rw*$rf +*[$l] '1,$lf,$lf,$lf,$lf,1,1,1' *[$r] '1,$rf,$rf,$rf,$rf,1,1,1' +[$r] '0,$lw,0,0,0,0,0,0' +fi +i[$l] (-1,0,0,{$lw+$rw},$h,0,0,0) a[$l,{$l+1}] y a[$l] [$r],y r[$r] 1,1,1,1,0 +else +if $_mode<2 +w:=max($lw,$rw) ++[$l] '0,{($w-$lw)*min(1,$_mode)},0,0,0,0,0,0' ++[$r] '0,{($w-$rw)*min(1,$_mode)},$lh,0,0,0,0,0' +else +w:=($_mode-2)*max($lw,$rw)+(3-$_mode)*min($lw,$rw) +lf:=$w/$lw rf:=$w/$rw lh:=$lh*$lf rh:=$rh*$rf +*[$l] '1,$lf,$lf,$lf,$lf,1,1,1' *[$r] '1,$rf,$rf,$rf,$rf,1,1,1' +[$r] '0,0,$lh,0,0,0,0,0' +fi +i[$l] (-1,0,0,$w,{$lh+$rh},0,0,0) a[$l,{$l+1}] y a[$l] [$r],y r[$r] 1,1,1,1,0 +fi +u $l +fi +#@cli mirror : { x | y | z }...{ x | y | z } : (+) +#@cli : Mirror selected images along specified axes. +#@cli : $ image.jpg +mirror y +mirror[0] c +#@cli : $ image.jpg +mirror x +mirror y append_tiles 2,2 +#@cli permute : permutation_string : (+) +#@cli : Permute selected image axes by specified permutation. +#@cli : 'permutation' is a combination of the character set {x|y|z|c}, +#@cli : e.g. 'xycz', 'cxyz', ... +#@cli : $ image.jpg permute yxzc +#@cli r : eq. to 'resize'. : (+) +#@cli resize : {[image_w] | width>0[%]},_{[image_h] | height>0[%]},_{[image_d] | depth>0[%]},_{[image_s] | spectrum>0[%]},_interpolation,_boundary_conditions,_ax,_ay,_az,_ac : (+) +#@cli : Resize selected images with specified geometry. +#@cli : (eq. to 'r').\n +#@cli : 'interpolation' can be { -1=none (memory content) | 0=none | 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0=none | 1=neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0 or 4' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'interpolation=1', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +#@cli : $ image.jpg +resize[-1] 256,128,1,3,2 +resize[-1] 120%,120%,1,3,0,1,0.5,0.5 +resize[-1] 120%,120%,1,3,0,0,0.2,0.2 +resize[-1] [0],[0],1,3,4 +#@cli ri : eq. to 'resize_as_image'. +ri : skip "${2=1},${3=0},${4=0},${5=0},${6=0},${7=0}" +pass$1 r[^-1] .,.,.,.,${2--1} rm. +#@cli resize_as_image : [reference],_interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images to the geometry of specified [reference] image. +#@cli : (eq. to 'ri'). +#@cli : Default values: 'interpolation=1', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +#@cli : $ image.jpg sample duck +resize_as_image[-1] [-2] +resize_as_image : check ${"is_image_arg $1"}" && isint(${2=1}) && $2>=-1 && $2<=6 && ""isint(${3=0}) && $3>=0 && $3<=3 && isnum(${4=0}) && isnum(${5=0}) && isnum(${6=0}) && isnum(${7=0})" +pass$1 r[^-1] .,.,.,.,${2--1} rm. +#@cli resize_mn : width[%]>=0,_height[%]>=0,_depth[%]>=0,_B_value,_C_value +#@cli : Resize selected images with Mitchell-Netravali filter (cubic). +#@cli : For details about the method, see: . +#@cli : Default values: 'height=100%', 'depth=100%', 'B=0.3333' and 'C=0.3333'. +#@cli : $ image.jpg resize2dx 32 resize_mn 800%,800% +resize_mn : check "${2=100%}>=0 && ${3=100%}>=0" skip "${4=0.333},${5=0.333}" +e[^-1] "Resize image$? to $1x$2x$3 using Mitchell-Netravali filter (B=$4, C=$5)." +lib="const B = $4; const C = $5; const boundary = 1; const interp = 0; +mn(P0,P1,P2,P3,d) = ( ( (-B/6-C)*P0 + (-3*B/2-C+2)*P1 + (3*B/2+C-2)*P2 + (B/6+C)*P3 )*d^3 ++ ( (B/2+2*C)*P0 + (2*B+C-3)*P1 + (-5*B/2-2*C+3)*P2 -C*P3)*d^2 ++ ( (-B/2-C)*P0 + (B/2+C)*P2)*d ++ B/6*P0 + (-B/3+1)*P1 + B/6*P2);" +foreach { +nm={n} +nw:=${"is_percent $1"}?max(1,round($1*w)):round($1) +nh:=${"is_percent $2"}?max(1,round($2*h)):round($2) +nd:=${"is_percent $3"}?max(1,round($3*d)):round($3) +if !$nw" || "!$nh" || "!$nd rm 0 +elif !w rm $nw,$nh,$nd,1 +else +if w==1||$nww +$nw,100%,100%,100%,${lib}"X = x*(w#-1-1)/(w-1); d = X - int(X); P0 = I(#-1,X-1); P1 = I(#-1,X); +P2 = I(#-1,X+1); P3 = I(#-1,X+2); mn(P0,P1,P2,P3,d);" k. +fi +if h==1||$nh $nm +} +#@cli resize_pow2 : _interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images so that each dimension is a power of 2. +#@cli : 'interpolation' can be { -1=none (memory content) | 0=none | 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0=none | 1=neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'interpolation=0', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +#@cli : $ image.jpg +resize_pow2[-1] 0 +resize_pow2 : check "isint(${1=0}) && $1>=-1 && $1<=6" skip ${2=0},${3=0},${4=0},${5=0},${6=0} +e[^-1] "Resize image$? so that each dimension is a power of 2." +repeat $! { +r[$>] {$>,2^(round(log2(w),1,1))},{$>,2^(round(log2(h),1,1))},{$>,2^(round(log2(d),1,1))},100%,${1-6} +} +#@cli rr2d : eq. to 'resize_ratio2d'. +rr2d : +_gmic_s="$?" v + _resize_ratio2d $* +#@cli resize_ratio2d : width>0,height>0,_mode={ 0=inside | 1=outside | 2=padded },0=<_interpolation<=6 +#@cli : Resize selected images while preserving their aspect ratio. +#@cli : (eq. to 'rr2d'). +#@cli : Default values: 'mode=0' and 'interpolation=6'. +resize_ratio2d : +_gmic_s="$?" v + _$0 $* +_resize_ratio2d : check "$1>0 && $2>0 && ${3=0}>=0 && $3<=2 && ${4=6}>=0 && $4<=6" +e[0--3] "Resize 2D image"$_gmic_s" to $1x$2 with ratio-"${arg0\ $3,inside,outside,padded}" mode and interpolation type $4." +repeat $! { +ratio={$>,if($3==1,max($1/w,$2/h),min($1/w,$2/h))} +r[$>] {$>,[max(1,round(w*$ratio)),max(1,round(h*$ratio))]},100%,100%,$4 +} +if $3==2 r $1,$2,100%,100%,0,0,0.5,0.5 fi +#@cli r2din : eq. to 'resize2din' +r2din : +_gmic_s="$?" v + _resize2din $* +#@cli resize2din : width[%]>0,_height[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images so the size is not larger than 'width'x'height' while preserving 2D ratio. +#@cli : (eq. to 'r2din').\n +#@cli : 'interpolation' can be { -1=none (memory content) | 0=none | 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0=none | 1=neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'height=100%', 'interpolation=3', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +#@cli : $ image.jpg +resize2din 100,100 append x +resize2din : +_gmic_s="$?" v + _$0 $* +_resize2din : check "$1>0 && ${2=100%}>0 && ${3=3}>=0 && $3<=6 && ${4=0}>=0 && $4<=3 && ""${5=0}>=0 && $5<=1 && ${6=0}>=0 && $6<=1 && ${7=0}>=0 && $7<=1 && ${8=0}>=0 && $8<=1" +e[0--3] "Resize image"$_gmic_s" so the size is not larger than $1x$2, while preserving 2D ratio." +eval "repeat (l,k, +W = "${"is_percent $1"}"?w#k*$1:$1; +H = "${"is_percent $2"}"?h#k*$2:$2; +dims = round(min(W/w#k,H/h#k)*[w#k,h#k]); +resize(#k,max(1,dims[0]),max(1,dims[1]),d#k,s#k,${3-8}); +)" +#@cli r3din : eq. to 'resize3din' +r3din : +_gmic_s="$?" v + _resize3din $* +#@cli resize3din : width[%]>0,_height[%]>0,_depth[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images so the size is not larger than 'width'x'height'x'depth' while preserving 3D ratio. +#@cli : (eq. to 'r3din').\n +#@cli : 'interpolation' can be { -1=none (memory content) | 0=none | 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0=none | 1=neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'height=100%', 'depth=100%', 'interpolation=3', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +resize3din : +_gmic_s="$?" v + _$0 $* +_resize3din : check "$1>0 && ${2=100%}>0 && ${3=100%}>0 && ${4=3}>=0 && $4<=6 && ${5=0}>=0 && $5<=3 && ""${6=0}>=0 && $6<=1 && ${7=0}>=0 && $7<=1 && ${8=0}>=0 && $8<=1 && ${9=0}>=0 && $9<=1" +e[0--3] "Resize image"$_gmic_s" so the size is not larger than $1x$2x$3, while preserving 3D ratio." +eval "repeat (l,k, +W = "${"is_percent $1"}"?w#k*$1:$1; +H = "${"is_percent $2"}"?h#k*$2:$2; +D = "${"is_percent $3"}"?d#k*$3:$3; +dims = round(min(W/w#k,H/h#k,D/d#k)*[w#k,h#k,d#k]); +resize(#k,max(1,dims[0]),max(1,dims[1]),max(1,dims[2]),s#k,${4-9}); +)" +#@cli r2dout : eq. to 'resize2dout' +r2dout : +_gmic_s="$?" v + _resize2dout $* +#@cli resize2dout : width[%]>0,_height[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images so the size is not smaller than 'width'x'height' while preserving 2D ratio. +#@cli : (eq. to 'r2dout').\n +#@cli : 'interpolation' can be { -1=none (memory content) | 0=none | 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0=none | 1=neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'height=100%', 'interpolation=3', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +#@cli : $ image.jpg +resize2dout 100,100 append x +resize2dout : +_gmic_s="$?" v + _$0 $* +_resize2dout : check "$1>0 && ${2=100%}>0 && ${3=3}>=0 && $3<=6 && ${4=0}>=0 && $4<=3 && ""${5=0}>=0 && $5<=1 && ${6=0}>=0 && $6<=1 && ${7=0}>=0 && $7<=1 && ${8=0}>=0 && $8<=1" +e[0--3] "Resize image"$_gmic_s" so the size is not larger than $1x$2, while preserving 2D ratio." +eval "repeat (l,k, +W = "${"is_percent $1"}"?w#k*$1:$1; +H = "${"is_percent $2"}"?h#k*$2:$2; +dims = round(max(W/w#k,H/h#k)*[w#k,h#k]); +resize(#k,max(1,dims[0]),max(1,dims[1]),d#k,s#k,${3-8}); +)" +#@cli r3dout : eq. to 'resize3dout' +r2dout : +_gmic_s="$?" v + _resize3dout $* +#@cli resize3dout : width[%]>0,_height[%]>0,_depth[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images so the size is not smaller than 'width'x'height'x'depth' while preserving 3D ratio. +#@cli : (eq. to 'r3dout').\n +#@cli : 'interpolation' can be { -1=none (memory content) | 0=none | 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0=none | 1=neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'height=100%', 'depth=100%', 'interpolation=3', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +resize3dout : +_gmic_s="$?" v + _$0 $* +_resize3dout : check "$1>0 && ${2=100%}>0 && ${3=100%}>0 && ${4=3}>=0 && $4<=6 && ${5=0}>=0 && $5<=3 && ""${6=0}>=0 && $6<=1 && ${7=0}>=0 && $7<=1 && ${8=0}>=0 && $8<=1 && ${9=0}>=0 && $9<=1" +e[0--3] "Resize image"$_gmic_s" so the size is not larger than $1x$2x$3, while preserving 3D ratio." +eval "repeat (l,k, +W = "${"is_percent $1"}"?w#k*$1:$1; +H = "${"is_percent $2"}"?h#k*$2:$2; +D = "${"is_percent $3"}"?d#k*$3:$3; +dims = round(max(W/w#k,H/h#k,D/d#k)*[w#k,h#k,d#k]); +resize(#k,max(1,dims[0]),max(1,dims[1]),max(1,dims[2]),s#k,${4-9}); +)" +#@cli r2dx : eq. to 'resize2dx'. +r2dx : +_gmic_s="$?" v + _resize2dx $* +#@cli resize2dx : width[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images along the x-axis, while preserving 2D ratio. +#@cli : (eq. to 'r2dx').\n +#@cli : 'interpolation' can be { -1=none (memory content) | 0=none | 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0=none | 1=neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'interpolation=3', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +#@cli : $ image.jpg +resize2dx 100,2 append x +resize2dx : +_gmic_s="$?" v + _$0 $* +_resize2dx : check "$1>0 && ${2=3}>=0 && $2<=6 && ${3=0}>=0 && $3<=3 && ${4=0}>=0 && $4<=1 && ${5=0}>=0 && $5<=1 && +${6=0}>=0 && $6<=1 && ${7=0}>=0 && $7<=1" +e[0--3] "Resize 2D image"$_gmic_s" to $1 pixels along the x-axis, while preserving 2D ratio." +foreach { +size:=${is_percent\ $1}?$1*w:$1 +r {max(1,$size)},{max(1,h*$size/w)},100%,100%,${2-7} +} +#@cli r2dy : eq. to 'resize2dy'. +r2dy : +_gmic_s="$?" v + _resize2dy $* +#@cli resize2dy : height[%]>=0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images along the y-axis, while preserving 2D ratio. +#@cli : (eq. to 'r2dy').\n +#@cli : 'interpolation' can be { -1=none (memory content) | 0=none | 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0=none | 1=neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'interpolation=3', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +#@cli : $ image.jpg +resize2dy 100,2 append x +resize2dy : +_gmic_s="$?" v + _$0 $* +_resize2dy : check "$1>=0 && ${2=3}>=0 && $2<=6 && ${3=0}>=0 && $3<=3 && ${4=0}>=0 && $4<=1 && ${5=0}>=0 && $5<=1 && +${6=0}>=0 && $6<=1 && ${7=0}>=0 && $7<=1" +e[0--3] "Resize 2D image"$_gmic_s" to $1 pixels along the y-axis, while preserving 2D ratio." +foreach { +size:=${is_percent\ $1}?$1*h:$1 +r {max(1,w*$size/h)},{max(1,$size)},100%,100%,${2-7} +} +#@cli r3dx : eq. to 'resize3dx'. +r3dx : +_gmic_s="$?" v + _resize3dx $* +#@cli resize3dx : width[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images along the x-axis, while preserving 3D ratio. +#@cli : (eq. to 'r3dx').\n +#@cli : 'interpolation' can be { -1=none (memory content) | 0=none | 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0=none | 1=neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'interpolation=3', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +resize3dx : +_gmic_s="$?" v + _$0 $* +_resize3dx : check "$1>0 && ${2=3}>=0 && $2<=6 && ${3=0}>=0 && $3<=3 && ${4=0}>=0 && $4<=1 && ${5=0}>=0 && $5<=1 && +${6=0}>=0 && $6<=1 && ${7=0}>=0 && $7<=1" +e[0--3] "Resize 3D image"$_gmic_s" to $1 pixels along the x-axis, while preserving 3D ratio." +foreach { +size:=${is_percent\ $1}?$1*w:$1 +r {max(1,$size)},{max(1,h*$size/w)},{max(1,d*$size/w)},100%,${2-7} +} +#@cli r3dy : eq. to 'resize3dy'. +r3dy : +_gmic_s="$?" v + _resize3dy $* +#@cli resize3dy : height[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images along the y-axis, while preserving 3D ratio. +#@cli : (eq. to 'r3dy').\n +#@cli : 'interpolation' can be { -1=none (memory content) | 0=none | 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0=none | 1=neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'interpolation=3', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +resize3dy : +_gmic_s="$?" v + _$0 $* +_resize3dy : check "$1>0 && ${2=3}>=0 && $2<=6 && ${3=0}>=0 && $3<=3 && ${4=0}>=0 && $4<=1 && ${5=0}>=0 && $5<=1 && +${6=0}>=0 && $6<=1 && ${7=0}>=0 && $7<=1" +e[0--3] "Resize 3D image"$_gmic_s" to $1 pixels along the y-axis, while preserving 3D ratio." +foreach { +size:=${is_percent\ $1}?$1*h:$1 +r {max(1,w*$size/h)},{max(1,$size)},{max(1,d*$size/h)},100%,${2-7} +} +#@cli r3dz : eq. to 'resize3dz'. +r3dz : +_gmic_s="$?" v + _resize3dz $* +#@cli resize3dz : depth[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images along the z-axis, while preserving 3D ratio. +#@cli : (eq. to 'r3dz').\n +#@cli : 'interpolation' can be { -1=none (memory content) | 0=none | 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0=none | 1=neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'interpolation=3', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +resize3dz : +_gmic_s="$?" v + _$0 $* +_resize3dz : check "$1>0 && ${2=3}>=0 && $2<=6 && ${3=0}>=0 && $3<=3 && ${4=0}>=0 && $4<=1 && ${5=0}>=0 && $5<=1 && +${6=0}>=0 && $6<=1 && ${7=0}>=0 && $7<=1" +e[0--3] "Resize 3D image"$_gmic_s" to $1 pixels along the z-axis, while preserving 3D ratio." +foreach { +size:=${is_percent\ $1}?$1*d:$1 +r[$>] {max(1,w*$size/d)},{max(1,h*$size/d)},{max(1,$size)},100%,${2-7} +} +#@cli rotate : angle,_interpolation,_boundary_conditions,_center_x[%],_center_y[%] : u,v,w,angle,interpolation,boundary_conditions,_center_x[%],_center_y[%],_center_z[%] : (+) +#@cli : Rotate selected images with specified angle (in deg.), and optionally 3D axis (u,v,w). +#@cli : 'interpolation' can be { 0=none | 1=linear | 2=bicubic }. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : When a rotation center (cx,cy,_cz) is specified, the size of the image is preserved. +#@cli : Default values: 'interpolation=1', 'boundary_conditions=0' and 'center_x=center_y=(undefined)'. +#@cli : $ image.jpg +rotate -25,1,2,50%,50% rotate[0] 25 +#@cli rotate_tileable : angle,_max_size_factor>=0 +#@cli : Rotate selected images by specified angle and make them tileable. +#@cli : If resulting size of an image is too big, the image is replaced by a 1x1 image. +#@cli : Default values: 'max_size_factor=8'. +rotate_tileable : check ${2=8}>=0 +e[^-1] "Rotate image$? with angle $1 deg. and make them tileable." +angle:=$1%360 +if $angle>=270 rotate 270 angle-=270 +elif $angle>=180 rotate 180 angle-=180 +elif $angle>=90 rotate 90 angle-=90 +fi +(0,1;1,8;1,7;1,6;1,5;1,4;1,5;1,3;2,5;1,2;2,5;3,5;2,3;3,4;4,5;1,1;5,4;7,5;3,2;8,5;9,5;2,1;3,1;4,1;5,1;6,1;7,1;8,1) +s. x,2 +/[-2,-1] atan. *. {180/pi} +($angle) index. .. rm.. +p={-3,@{^}} q={-2,@{^}} rm[-3--1] +if !$p||!$q return fi +foreach { +theta:=atan2($p,$q) +gcd=${gcd" "{h*$q},{w*$p}} +pw:=h*$q/$gcd +nw:=round($pw*w/cos($theta)) +gcd=${gcd" "{h*$p},{w*$q}} +qh:=w*$q/$gcd +nh:=round($qh*h/cos($theta)) +if !$2" || "($nw<$2*w" && "$nh<$2*h) +r {1.5*$nw},{1.5*$nh},1,100%,0,2 +rotate {$theta*180/pi},1,2,50%,50% +r $nw,$nh,1,100%,0,2,0.5,0.5 +else error[0--4] "Command '$0': Invalid image dimension "({w},{h},{d},{s}). +fi +} +#@cli rows : y0[%],_y1[%] +#@cli : Keep only specified rows of selected images. +#@cli : Dirichlet boundary conditions are used when specified rows are out of range. +#@cli : Default value: 'y1=y0'. +#@cli : $ image.jpg rows -25%,50% +rows : skip ${2=$1} +e[^-1] "Keep rows $1...$2 of image$?." +z 0,$1,100%,$2 +#@cli scale2x +#@cli : Resize selected images using the Scale2x algorithm. +#@cli : $ image.jpg threshold 50% resize 50%,50% +scale2x +scale2x : +e[^-1] "Double xy-dimensions of image$?, using Scale2x algorithm." +foreach { +r 200%,200% +f "dx=x&1;dy=y&1;A=j(0,-2,0,0,0,1);B=j(2,0,0,0,0,1);C=j(-2,0,0,0,0,1);D=j(0,2,0,0,0,1); +!dy*(!dx*if(C==A&&C!=D&&A!=B,A,i) + dx*if(A==B&&A!=C&&B!=D,B,i)) + +dy*(dx*if(B==D&&B!=A&&D!=C,D,i) + !dx*if(D==C&&D!=B&&C!=A,C,i))" +} +#@cli scale3x +#@cli : Resize selected images using the Scale3x algorithm. +#@cli : $ image.jpg threshold 50% resize 33%,33% +scale3x +scale3x : +e[^-1] "Triple xy-dimensions of image$?, using Scale3x algorithm." +foreach { +r 300%,300% +f "dx=x%3;dy=y%3;c0=!dx;c1=(dx==1);c2=(dx==2); +A=j(-3,-3,0,0,0,1);B=j(0,-3,0,0,0,1);C=j(3,-3,0,0,0,1); +D=j(-3,0,0,0,0,1);F=j(3,0,0,0,0,1); +G=j(-3,3,0,0,0,1);H=j(0,3,0,0,0,1);I=j(3,3,0,0,0,1); +!dy*(c0*if(D==B&&D!=H&&B!=F,D,i) + c1*if((D==B&&D!=H&&B!=F&&i!=C)||(B==F&&B!=D&&F!=H&&i!=A),B,i) + +c2*if(B==F&&B!=D&&F!=H,F,i)) + +(dy==1)*(c0*if((H==D&&H!=F&&D!=B&&i!=A)||(D==B&&D!=H&&B!=F&&i!=G),D,i) + c1*i + +c2*if((B==F&&B!=D&&F!=H&&i!=I)||(F==H&&F!=B&&H!=D&&i!=C),F,i)) + +(dy==2)*(c0*if(H==D&&H!=F&&D!=B,D,i) + c1*if((F==H&&F!=B&&H!=D&&i!=G)||(H==D&&H!=F&&D!=B&&i!=I),H,i) + +c2*if(F==H&&F!=B&&H!=D,F,i))" +} +#@cli scale_dcci2x : _edge_threshold>=0,_exponent>0,_extend_1px={ 0=false | 1=true } +#@cli : Double image size using directional cubic convolution interpolation, +#@cli : as described in . +#@cli : Default values: 'edge_threshold=1.15', 'exponent=5' and 'extend_1px=0'. +#@cli : $ image.jpg +scale_dcci2x , +scale_dcci2x : check "${1=1.15}>=0 && ${2=5}>=0" skip ${3=0} +e[^-1] "Double xy-dimensions of image$?, using DCCI2x algorithm." +foreach { +r {2*w-(!$3)},{2*h-(!$3)},1,100%,4 +f "begin( +const threshold = $1; +const exponent = $2; +interpolation = 0; +boundary = 1; +j1(x,y) = P[7*y + x + 24]; +j2(x,y) = P[7*x - y + 24]; +interp(k) = -k#(-3,-3) + 9*k#(-1,-1) + 9*k#(1,1) - k#(3,3); +d(k) = sum(abs([ +k#(-1,-3) - k#(-3,-1), k#(1,-3) - k#(-1,-1), k#(3,-3) - k#(1,-1), +k#(-1,-1) - k#(-3,1), k#(1,-1) - k#(-1,1), k#(3,-1) - k#(1,1), +k#(-1,1) - k#(-3,3), k#(1,1) - k#(-1,3), k#(3,1) - k#(1,3) +])); +); +if (!((x*y)%2),i, +ref(crop(x - 3,y - 3,0,c,7,7,1,1),P); +d1 = d(j1); +d2 = d(j2); +ratio = (1 + d1)/(1 + d2); +value = ratio>threshold ? interp(j1): +ratio<(1/threshold) ? interp(j2): +(w1 = 1/(1 + d1^exponent); w2 = 1/(1 + d2^exponent); +(interp(j1)*w1 + interp(j2)*w2)/(w1 + w2)); +value/=16)" +f "begin( +const threshold = $1; +const exponent = $2; +interpolation = 0; +boundary = 1; +j1(x,y) = P[7*y + x + 24]; +j2(x,y) = P[7*x - y + 24]; +interp(k) = -k#(0,-3) + 9*k#(0,-1) + 9*k#(0,1) - k#(0,3); +d(k) = sum(abs([ +k#(-1,-2) - k#(1,-2), +k#(-2,-1) - k#(0,-1), k#(0,-1) - k#(2,-1), +k#(-3,0) - k#(-1,0), k#(-1,0) - k#(1,0), k#(1,0) - k#(3,0), +k#(-2,1) - k#(0,1), k#(0,1) - k#(2,1), +k#(-1,2) - k#(1,2) +])); +); +if ((x%2) + (y%2)!=1,i, +ref(crop(x - 3,y - 3,0,c,7,7,1,1),P); +d1 = d(j1); +d2 = d(j2); +ratio = (1 + d1)/(1 + d2); +value = ratio>threshold ? interp(j1) : +ratio<(1/threshold) ? interp(j2) : +(w1 = 1/(1 + d1^exponent); w2 = 1/(1 + d2^exponent); +(interp(j1)*w1 + interp(j2)*w2)/(w1 + w2)); +value/=16)" +} +#@cli seamcarve : _width[%]>=0,_height[%]>=0,_is_priority_channel={ 0 | 1 },_is_antialiasing={ 0 | 1 },_maximum_seams[%]>=0 +#@cli : Resize selected images with specified 2D geometry, using the seam-carving algorithm. +#@cli : Default values: 'height=100%', 'is_priority_channel=0', 'is_antialiasing=1' and 'maximum_seams=25%'. +#@cli : $ image.jpg seamcarve 60% +seamcarve : check "${2=100%}>=0 && ${5=25%}>=0" skip ${3=0},${4=1} +e[^-1] "Resize image$? to $1x$2 using seam-carving algorithm, "${arg0\ !$3,with,without}" priority channel, "${arg0\ !$4,with,without}" anti-aliasing and maximum seams $5." +foreach { +nw:=max(1,round(if(${is_percent\ $1},$1*w,$1))) +nh:=max(1,round(if(${is_percent\ $2},$2*h,$2))) +if $nw!=w _seamcarve $nw,$3,$4,$5 fi +if $nh!=h transpose _seamcarve $nh,$3,$4,$5 transpose fi +} +_seamcarve : +do +max_seams:=max(1,round(if(${is_percent\ $4},$4*w,$4))) +ssms:=max(min(round($1-w),w),1-w) +sms:=min($max_seams,abs($ssms)) +if $2 s[0] c,{1-s} /. 256 fi ++gradient[0] a[-2,-1] c abs. compose_channels. + n. 0,1 +if $2 +. .. a[0,1] c fi +if $3 100%,1,1,1,x r. [0],[0] a[0,-1] c fi +. +repeat h { ++rows. {$<+1} erode. 3 +j.. .,0,$<,0,0,-1 rm. +} +100%,100% +rows[1] 0 +=> grad,low,seam,top +repeat h#0-1 { nr:=$>+1 ++rows[low] $nr ++*[4,5] +shift[4] 1 *. [5] +shift[5] 1 *. [4] ++[-2,-1] j[5] [4] a[-3--1] c +f. ">if(c,i,max(j(-1)+j(0,0,0,1),j(-2)+j(0,0,0,2)))" +s. c shift... 1 +.. ... shift... 1 +[-3,-1] +>[-2,-1] f. " +a[-2,-1] c f. "j(i,0,0,-1)" channels. 1 ++rows[grad] $nr +[top,-1] +} +max:=iM*2 repeat $sms { =. $max,{xm} } +j[grad] .,0,100% rm[low,top] a[-2,-1] c +f. "0 +-. 2 s[0] c +repeat $s { if $><($s-1) . fi a[$>,-1] c } +permute cxyz a c discard -1 f "if(i<0,j(0,-1),i)" +r {$w+$sms},$h,1,$s,-1 +fi +if $3 +s c,{1-s} g. x,1 round !=. 1 +(0.5,0.5) +convolve[0] . rm.. +j[0] .,0,0,0,0,1,[1] rm[-2,-1] +fi +rprogress {a=w/$1;if(a<1,a*100,100/a)} +while w!=$1 +#@cli shift : vx[%],_vy[%],_vz[%],_vc[%],_boundary_conditions,_interpolation={ 0=nearest_neighbor | 1=linear } : (+) +#@cli : Shift selected images by specified displacement vector. +#@cli : Displacement vector can be non-integer in which case linear interpolation should be chosen. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default value: 'boundary_conditions=0' and 'interpolation=0'. +#@cli : $ image.jpg +shift[0] 50%,50%,0,0,0 +shift[0] 50%,50%,0,0,1 +shift[0] 50%,50%,0,0,2 +#@cli shrink_x : size_x>=0 +#@cli : Shrink selected images along the x-axis. +#@cli : $ image.jpg shrink_x 30 +shrink_x : check "$1>=0" +e[^-1] "Shrink image$? along the x-axis with size $1." +repeat $! { z[$>] $1,{$>,w-$1-1} } +#@cli shrink_xy : size>=0 +#@cli : Shrink selected images along the xy-axes. +#@cli : $ image.jpg shrink_xy 30 +shrink_xy : check "$1>=0" +e[^-1] "Shrink image$? along the xy-axes with size $1." +repeat $! { z[$>] $1,$1,{$>,w-$1-1},{$>,h-$1-1} } +#@cli shrink_xyz : size>=0 +#@cli : Shrink selected images along the xyz-axes. +shrink_xyz : check "$1>=0" +e[^-1] "Shrink image$? along the xyz-axes with size $1." +repeat $! { z[$>] $1,$1,$1,{$>,w-$1-1},{$>,h-$1-1},{$>,d-$1-1} } +#@cli shrink_y : size_y>=0 +#@cli : Shrink selected images along the y-axis. +#@cli : $ image.jpg shrink_y 30 +shrink_y : check "$1>=0" +e[^-1] "Shrink image$? along the y-axis with size $1." +repeat $! { z[$>] 0,$1,100%,{$>,h-$1-1} } +#@cli shrink_z : size_z>=0 +#@cli : Shrink selected images along the z-axis. +shrink_z : check "$1>=0" +e[^-1] "Shrink image$? along the z-axis with size $1." +repeat $! { z[$>] 0,0,$1,100%,100%,{$>,d-$1-1} } +#@cli slices : z0[%],_z1[%] +#@cli : Keep only specified slices of selected images. +#@cli : Dirichlet boundary conditions are used when specified slices are out of range. +#@cli : Default value: 'z1=z0'. +slices : skip ${2=$1} +e[^-1] "Keep slices $1...$2 of image$?." +z 0,0,$1,100%,100%,$2 +#@cli sort : _ordering={ + | - },_axis={ x | y | z | c } : (+) +#@cli : Sort pixel values of selected images. +#@cli : If 'axis' is specified, the sorting is done according to the data of the first column/row/slice/channel +#@cli : of selected images. +#@cli : Default values: 'ordering=+' and 'axis=(undefined)'. +#@cli : $ 64 rand 0,100 +sort display_graph 400,300,3 +#@cli s : eq. to 'split'. : (+) +#@cli split : { x | y | z | c }...{ x | y | z | c },_split_mode : keep_splitting_values={ + | - },_{ x | y | z | c }...{ x | y | z | c },value1,_value2,... : (no arg) : (+) +#@cli : Split selected images along specified axes, or regarding to a sequence of scalar values +#@cli : (optionally along specified axes too). +#@cli : (eq. to 's').\n +#@cli : 'split_mode' can be { 0=split according to constant values | >0=split in N parts | <0=split in parts of size -N }. +#@cli : Default value: 'split_mode=-1'. +#@cli : $ image.jpg split c +#@cli : $ image.jpg split y,3 +#@cli : $ image.jpg split x,-128 +#@cli : $ 1,20,1,1,"1,2,3,4" +split -,2,3 append[1--1] y +#@cli : $ (1,2,2,3,3,3,4,4,4,4) +split x,0 append[1--1] y +#@cli split_tiles : M!=0,_N!=0,_is_homogeneous={ 0 | 1 } +#@cli : Split selected images as a MxN array of tiles. +#@cli : If M or N is negative, it stands for the tile size instead. +#@cli : Default values: 'N=M' and 'is_homogeneous=0'. +#@cli : $ image.jpg +local split_tiles 5,4 blur 3,0 sharpen 700 append_tiles 4,5 done +split_tiles : skip ${2=$1},${3=0} +if $3 e[^-1] "Split image$? as a $1x$2 array of homogeneous tiles." +else e[^-1] "Split image$? as a $1x$2 array of tiles." +fi +foreach { nm={n} s y,$2 s x,$1 if $3 r [0],[0],100%,100%,0 fi =>[^] $nm } +#@cli undistort : -1<=_amplitude<=1,_aspect_ratio,_zoom,_center_x[%],_center_y[%],_boundary_conditions +#@cli : Correct barrel/pincushion distortions occurring with wide-angle lens. +#@cli : References: +#@cli : [1] Zhang Z. (1999). Flexible camera calibration by viewing a plane from unknown orientation. +#@cli : [2] Andrew W. Fitzgibbon (2001). Simultaneous linear estimation of multiple view geometry and lens distortion. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default values: 'amplitude=0.25', 'aspect_ratio=0', 'zoom=0', 'center_x=center_y=50%' and 'boundary_conditions=0'. +undistort : check "${1=0.1}>=-1 && $1<=1 && ${6=0}>=0 && $6<=3" skip ${2=0},${3=0},${4=50%},${5=50%} +e[^-1] "Undistort barrel/pincushion effect in image$?, with amplitude $1, aspect ratio $2, zoom factor $3, +center ($4,$5) and "${"arg0 $6,dirichlet,neumann,periodic,mirror"}" boundary conditions." +foreach { +center_x:=${"is_percent $4"}?w*$4:$4 +center_y:=${"is_percent $5"}?h*$5:$5 +f " +const interpolation = 1; +const boundary = $6; +const center_x = "$center_x"; +const center_y = "$center_y"; +const alpha = cut($1,-0.999,0.999); +const ratio = $2>=0?1+$2:1/(1-$2); +const zoom = $3>=0?1+$3:1/(1-$3); +const M = max(w,h); +x = 2*(x - center_x)/(zoom*ratio*M); +y = 2*(y - center_y)/(zoom*M); +r = norm(x,y); +nr = r/(1 - alpha*r^2); +if (r>0, +nx = nr/r*x; ny = nr/r*y, +nx = x; ny = y +); +x = 0.5*nx*ratio*M + center_x; +y = 0.5*ny*M + center_y; +I(x,y)" +} +#@cli y : eq. to 'unroll'. : (+) +#@cli unroll : _axis={ x | y | z | c } : (+) +#@cli : Unroll selected images along specified axis. +#@cli : (eq. to 'y'). +#@cli : Default value: 'axis=y'. +#@cli : $ (1,2,3;4,5,6;7,8,9) +unroll y +#@cli upscale_smart : width[%],_height[%],_depth,_smoothness>=0,_anisotropy=[0,1],sharpening>=0 +#@cli : Upscale selected images with an edge-preserving algorithm. +#@cli : Default values: 'height=100%', 'depth=100%', 'smoothness=2', 'anisotropy=0.4' and 'sharpening=10'. +#@cli : $ image.jpg resize2dy 100 +upscale_smart 500%,500% append x +upscale_smart : skip ${2=100%},${3=100%} check "${4=2}>=0 && ${5=0.4}>=0 && $5<=1 && ${6=10}>=0" +e[^-1] "Upscale image$? to $1x$2x$3, with smoothness $4, anisotropy $5 and sharpening $6." +foreach { +w,h:=[w,h] ++r. $1,$2,$3,1,0 +if w<$w" && "h<$h +rm. r. $1,$2,$3,100%,2 +else +rm. +diffusiontensors 0,$5,1.2,1.2 +r[-2,-1] $1,$2,$3,100%,5 +smooth.. .,$4 rm. +ac "sharpen. $6,10",ycbcr_y +fi +} +#@cli volumetric2d : _x[%],_y[%],_z[%],_separator_size>=0 +#@cli : Convert selected 3D volumetric images into a 2D representation. +#@cli : Default values: 'x=y=z=50%' and 'separator_size=0'. +#@cli : $ image.jpg resize2dx 64 animate noise,0,100,50 cut 0,255 append z volumetric2d 50%,50%,50%,1 +volumetric2d : skip ${1=50%},${2=50%},${3=50%} check "isint(${4=0}) && $4>=0" +e[^-1] "Convert 3D volumetric image$? into a 2D representation, with coordinates (${1-3}) and separator size $4." +foreach { nm={n} ++slices. $3 +if $4 1,$4 else 0 fi +rows... $2 permute. xzyc a[-3--1] y +if $4 $4 else 0 fi +columns... $1 permute. zyxc a[-3--1] x +rm.. => $nm +} +#@cli :: Filtering +#@cli bandpass : _min_freq[%],_max_freq[%] +#@cli : Apply bandpass filter to selected images. +#@cli : Default values: 'min_freq=0' and 'max_freq=20%'. +#@cli : $ image.jpg bandpass 1%,3% +#@cli : $$ https://gmic.eu/oldtutorial/_bandpass +bandpass : skip ${1=0},${2=20%} +e[^-1] "Apply bandpass filter [$1,$2] to image$?." +foreach { +100%,100%,100% f. "sqrt((x/w-0.5)^2 + (y/h-0.5)^2 + (z/d-0.5)^2)" +n. 0,1 ir. $1,$2 shift. {int(w/2)},{int(h/2)},{int(d/2)},0,2 +fft.. *... . *[-2,-1] ifft rm. +} +#@cli bilateral : [guide],std_deviation_s[%]>=0,std_deviation_r[%]>=0,_sampling_s>=0,_sampling_r>=0 : std_deviation_s[%]>=0,std_deviation_r[%]>=0,_sampling_s>=0,_sampling_r>=0 : (+) +#@cli : Blur selected images by anisotropic (eventually joint/cross) bilateral filtering. +#@cli : If a guide image is provided, it is used for drive the smoothing filter. +#@cli : A guide image must be of the same xyz-size as the selected images. +#@cli : Set 'sampling' arguments to '0' for automatic adjustment. +#@cli : $ image.jpg repeat 5 { bilateral 10,10 } +#@cli b : eq. to 'blur'. : (+) +#@cli blur : std_deviation>=0[%],_boundary_conditions,_kernel : axes,std_deviation>=0[%],_boundary_conditions,_kernel : (+) +#@cli : Blur selected images by a deriche or gaussian filter (recursive implementation). +#@cli : (eq. to 'b').\n +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : 'kernel' can be { 0=deriche | 1=gaussian }. +#@cli : When specified, argument 'axes' is a sequence of { x | y | z | c }. +#@cli : Specifying one axis multiple times apply also the blur multiple times. +#@cli : Default values: 'boundary_conditions=1' and 'kernel=1'. +#@cli : $ image.jpg +blur 5,0 +blur[0] 5,1 +#@cli : $ image.jpg +blur y,10% +#@cli : $$ https://gmic.eu/oldtutorial/_blur +#@cli blur_angular : amplitude[%],_center_x[%],_center_y[%] +#@cli : Apply angular blur on selected images. +#@cli : Default values: 'center_x=center_y=50%'. +#@cli : $ image.jpg blur_angular 2% +#@cli : $$ https://gmic.eu/oldtutorial/_blur_angular +blur_angular : skip ${2=50%},${3=50%} +e[^-1] "Apply angular blur on image$?, with amplitude $1 and center point ($2,$3)." +euclidean2polar $2,$3,1.3,1 +foreach { 1,100% =. 1,50%,50% b. y,$1 convolve_fft.. . rm. } +polar2euclidean $2,$3,1.3,1 +#@cli blur_bloom : _amplitude>=0,_ratio>=0,_nb_iter>=0,_blend_operator={ + | max | min },_kernel={ 0=deriche | 1=gaussian | 2=box | 3=triangle | 4=quadratic },_normalize_scales={ 0 | 1 },_axes +#@cli : Apply a bloom filter that blend multiple blur filters of different radii, +#@cli : resulting in a larger but sharper glare than a simple blur. +#@cli : When specified, argument 'axes' is a sequence of { x | y | z | c }. +#@cli : Specifying one axis multiple times apply also the blur multiple times. +#@cli : Reference: Masaki Kawase, "Practical Implementation of High Dynamic Range Rendering", GDC 2004. +#@cli : Default values: 'amplitude=1', 'ratio=2', 'nb_iter=5', 'blend_operator=+', 'kernel=1', 'normalize_scales=0' and 'axes=(all)' +#@cli : $ image.jpg blur_bloom , +blur_bloom : check "${1=1}>=0 && ${2=2}>=0 && isint(${3=5}) && $3>=0 && isint(${5=1}) && $5>=0 && $5<=4 && +isnum(${6=0})" skip "${4=+},${7=}" +e[^-1] "Apply bloom effect on image$?, with amplitude $1, ratio $2, $3 iterations, blend operator '$4' and "${"arg0 !$6,\"\",\"no \""}"scale normalization." +if narg("$7") axes=$7, fi +m "_bloom0 : b "$axes"$""1" +m "_bloom1 : b "$axes"$""1,1,1" +m "_bloom2 : boxfilter "$axes"{1+2*$""1},0,1" +m "_bloom3 : boxfilter "$axes"{1+2*$""1},0,1,2" +m "_bloom4 : boxfilter "$axes"{1+2*$""1},0,1,3" +foreach { +nm={n} mM:=[im,iM] +[0] repeat $3 { +sigma:=$1*($2^$>) +_bloom$5[0] $sigma +if $6 n. $mM fi +-$4[1,-1] +} +n. $mM k. => $nm +} +um _bloom0,_bloom1,_bloom2,_bloom3,_bloom4 +#@cli blur_linear : amplitude1[%],_amplitude2[%],_angle,_boundary_conditions={ 0=dirichlet | 1=neumann } +#@cli : Apply linear blur on selected images, with specified angle and amplitudes. +#@cli : Default values: 'amplitude2=0', 'angle=0' and 'boundary_conditions=1'. +#@cli : $ image.jpg blur_linear 10,0,45 +#@cli : $$ https://gmic.eu/oldtutorial/_blur_linear +blur_linear : skip ${2=0},${3=0},${4=1} +e[^-1] "Apply linear blur on image$?, with angle $3 deg. and amplitudes ($1,$2)." +std1:=${is_percent\ $1}?$1*max(w,h):$1 +std2:=${is_percent\ $2}?$2*max(w,h):$2 +stdM:=round(1.25*max($std1,$std2)) +if $stdM<=0 return fi +foreach { +expand_xy $stdM,{$4!=0} +{s=2*$stdM;[s,s]} gaussian. $1,$2,$3 normalize_sum. +convolve_fft[0] [1] rm. shrink_xy $stdM +} +#@cli blur_radial : amplitude[%],_center_x[%],_center_y[%] +#@cli : Apply radial blur on selected images. +#@cli : Default values: 'center_x=center_y=50%'. +#@cli : $ image.jpg blur_radial 2% +#@cli : $$ https://gmic.eu/oldtutorial/_blur_radial +blur_radial : skip ${2=50%},${3=50%} +e[^-1] "Apply radial blur on image$?, with amplitude $1 and center point ($2,$3)." +euclidean2polar $2,$3,5,1 blur_x $1 polar2euclidean $2,$3,5,1 +#@cli blur_selective : sigma>=0,_edges>0,_nb_scales>0 +#@cli : Blur selected images using selective gaussian scales. +#@cli : Default values: 'sigma=5', 'edges=0.5' and 'nb_scales=5'. +#@cli : $ image.jpg noise 20 cut 0,255 +local[-1] repeat 4 { blur_selective , } done +#@cli : $$ https://gmic.eu/oldtutorial/_blur_selective +blur_selective : check "${1=5}>=0 && ${2=0.5}>=0 && isint(${3=5}) && $3>0" +e[^-1] "Blur image$? using $3 selective gaussian scales, with sigma $1 and edges $2." +foreach { +nm={n} ++gradient_norm +. 1 ^. {-max(0.01,$2)} quantize. {$3+1},0,1 min. {$3-1} ri. .. +repeat $3 { +==. $> *. ... +[-2,-1] b.. {$1/($3+1)} } +rm.. => $nm +} +#@cli blur_x : amplitude[%]>=0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror } +#@cli : Blur selected images along the x-axis. +#@cli : Default value: 'boundary_conditions=1'. +#@cli : $ image.jpg +blur_x 6 +#@cli : $$ https://gmic.eu/oldtutorial/_blur_x +blur_x : check "isint(${2=1}) && inrange($2,0,3)" +e[^-1] "Blur image$? along the x-axis, with sigma $1 and "${arg0\ !$2,neumann,dirichlet}" boundary conditions." +deriche $1,0,x,$2 +#@cli blur_xy : amplitude_x[%],amplitude_y[%],_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror } +#@cli : Blur selected images along the X and Y axes. +#@cli : Default value: 'boundary_conditions=1'. +#@cli : $ image.jpg +blur_xy 6 +#@cli : $$ https://gmic.eu/oldtutorial/_blur_y +blur_xy : skip ${2=$1} check "isint(${3=1}) && inrange($3,0,3)" +e[^-1] "Blur image$? along the xy-axes, with sigma $1 and "${arg0\ !$2,neumann,dirichlet}" boundary conditions." +deriche $1,0,x,$3 deriche $2,0,y,$3 +#@cli blur_xyz : amplitude_x[%],amplitude_y[%],amplitude_z,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror } +#@cli : Blur selected images along the X, Y and Z axes. +#@cli : Default value: 'boundary_conditions=1'. +#@cli : $$ https://gmic.eu/oldtutorial/_blur_xyz +blur_xyz : skip ${2=$1},${3=$1} check "isint(${4=1}) && inrange($4,0,3)" +e[^-1] "Blur image$? along the xyz-axes, with sigma $1 and "${arg0\ !$2,neumann,dirichlet}" boundary conditions." +deriche $1,0,x,$4 deriche $2,0,y,$4 deriche $3,0,z,$4 +#@cli blur_y : amplitude[%]>=0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror } +#@cli : Blur selected images along the y-axis. +#@cli : Default value: 'boundary_conditions=1'. +#@cli : $ image.jpg +blur_y 6 +#@cli : $$ https://gmic.eu/oldtutorial/_blur_y +blur_y : check "isint(${2=1}) && inrange($2,0,3)" +e[^-1] "Blur image$? along the y-axis, with sigma $1 and "${arg0\ !$2,neumann,dirichlet}" boundary conditions." +deriche $1,0,y,$2 +#@cli blur_z : amplitude[%]>=0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror } +#@cli : Blur selected images along the z-axis. +#@cli : Default value: 'boundary_conditions=1'. +#@cli : $$ https://gmic.eu/oldtutorial/_blur_z +blur_z : check "isint(${2=1}) && inrange($2,0,3)" +e[^-1] "Blur image$? along the z-axis, with sigma $1 and "${arg0\ !$2,neumann,dirichlet}" boundary conditions." +deriche $1,0,z,$2 +#@cli boxfilter : size>=0[%],_order,_boundary_conditions,_nb_iter>=0 : axes,size>=0[%],_order,_boundary_conditions,_nb_iter>=0 : (+) +#@cli : Blur selected images by a box filter of specified size (fast recursive implementation). +#@cli : 'order' can be { 0=smooth | 1=1st-derivative | 2=2nd-derivative }. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : When specified, argument 'axes' is a sequence of { x | y | z | c }. +#@cli : Specifying one axis multiple times apply also the blur multiple times. +#@cli : Default values: 'order=0', 'boundary_conditions=1' and 'nb_iter=1'. +#@cli : $ image.jpg +boxfilter 5% +#@cli : $ image.jpg +boxfilter y,3,1 +#@cli bump2normal +#@cli : Convert selected bumpmaps to normalmaps. +#@cli : $ 300,300 circle 50%,50%,128,1,1 blur 5% bump2normal +bump2normal : +e[^-1] "Convert bumpmap$? to normalmap." +foreach { +channels 0 g xy,1 +f. 1 a c orientation +* 127 + 128 round c 0,255 +} +#@cli closing : size>=0 : size_x>=0,size_y>=0,_size_z>=0 : [kernel],_boundary_conditions,_is_real={ 0=binary-mode | 1=real-mode } +#@cli : Apply morphological closing to selected images. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default values: 'size_z=1', 'boundary_conditions=1' and 'is_real=0'. +#@cli : $ image.jpg +closing 10 +closing : skip "${2=},${3=}" +boundary,is_kernel,sel=1,0,^ +if "isnum($1)" +if "['$2']==0 && ['$3']==0" +sx,sy,sz=$1 +e[0--4] "Apply morphological closing to image$?, with kernel of size "$sx"." +else +sx=$1 +if ['$2']==0 sy=1 else sy=$2 fi +if ['$3']==0 sz=1 else sz=$3 fi +e[0--4] "Apply morphological closing to image$?, with "${sx}"x"${sy}"x"${sz}" kernel." +fi +elif ${"is_image_arg $1"}" && narg("${"pass$1 -1"}")==1" +pass$1 +sx,sy,sz:=[w,h,d] +is_kernel,sel,r0,r1,b0,b1,b2,b3=1,^-1,binary,real,dirichlet,neumann,periodic,mirror +is_real=0 +if ['$2']!=0 boundary:=cut($2,0,3) fi +if ['$3']!=0 is_real=$3 fi +e[0--3] "Apply morphological closing to image$? with kernel ["${"pass$1 -1"}"] and "${b$boundary}" boundary ""conditions, in "${r$is_real}" mode." +else error[0--3] "Command 'closing': Invalid arguments '$*'." +fi +if $sx>0||$sy>0||$sz>0 +sx1,sx2:="s=int(($sx-1)/2);[s,$sx-s-1]" +sy1,sy2:="s=int(($sy-1)/2);[s,$sy-s-1]" +sz1,sz2:="s=int(($sz-1)/2);[s,$sz-s-1]" +foreach[$sel] { +nm={n} +if d>1 +r {[w+$sx+1,h+$sy+1,d+$sz+1]},100%,0,$boundary,0.5,0.5,0.5 +if $is_kernel pass. dilate.. .,0,$is_real erode.. .,0,$is_real rm. +else dilate $sx,$sy,$sz erode $sx,$sy,$sz +fi +z {$sx1+1},{$sy1+1},{$sz1+1},{w-$sx2-2},{h-$sy2-2},{d-$sz2-2} => $nm +elif h>1 +r {[w+$sx+1,h+$sy+1]},1,100%,0,$boundary,0.5,0.5 +if $is_kernel pass. dilate.. .,0,$is_real erode.. .,0,$is_real rm. +else dilate $sx,$sy erode $sx,$sy +fi +z {$sx1+1},{$sy1+1},{w-$sx2-2},{h-$sy2-2} => $nm +else +r {w+$sx+1},1,1,100%,0,$boundary,0.5 +if $is_kernel pass. dilate.. .,0,$is_real erode.. .,0,$is_real rm. +else dilate $sx,1 erode $sx,1 +fi +z {$sx1+1},{w-$sx2-2} => $nm +fi +} +fi +if $is_kernel rm. fi +#@cli closing_circ : _size>=0,_is_real={ 0 | 1 } +#@cli : Apply circular dilation of selected images by specified size. +#@cli : Default values: 'boundary_conditions=1' and 'is_real=0'. +#@cli : $ image.jpg +closing_circ 7 +closing_circ : check "$1>=0 && isbool(${2=0})" +r0,r1=binary,real +e[^-1] "Apply morphologicel closing of image$? by circular kernel of size $1, in "${r$2}" mode." +if $1<2 return fi +shape_circle $1 closing[^-1] .,$2 rm. +#@cli compose_freq +#@cli : Compose selected low and high frequency parts into new images. +#@cli : $ image.jpg split_freq 2% mirror[-1] x compose_freq +compose_freq : +e[^-1] "Compose low and high frequency part$? into new images." +repeat int($!/2) { +[$>,{$>+1}] } +#@cli convolve : [mask],_boundary_conditions,_is_normalized={ 0 | 1 },_channel_mode,_xcenter,_ycenter,_zcenter,_xstart,_ystart,_zstart,_xend,_yend,_zend,_xstride,_ystride,_zstride,_xdilation,_ydilation,_zdilation,interpolation_type : (+) +#@cli : Convolve selected images by specified mask. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : 'channel_mode' can be { 0=all | 1=one-for-one | 2=partial sum | 3=full sum }. +#@cli : 'interpolation_type' can be { 0=nearest-neighbor | 1=linear }. +#@cli : Default values: 'boundary_conditions=1', 'is_normalized=0', 'channel_mode=1', 'xcenter=ycenter=zcenter=(undefined)', 'xstart=ystart=zstart=0', 'xend=yend=zend=(max-coordinates)', 'xstride=ystride=zstride=1', 'xdilation=ydilation=zdilation=1' and 'interpolation_type=0'. +#@cli : $ image.jpg (0,1,0;1,-4,1;0,1,0) convolve[-2] [-1] keep[-2] +#@cli : $ image.jpg (0,1,0) resize[-1] 130,1,1,1,3 +convolve[0] [1] +#@cli : $$ https://gmic.eu/oldtutorial/_convolve +#@cli convolve_fft : [mask],_boundary_conditions +#@cli : Convolve selected images with specified mask, in the fourier domain. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : $ image.jpg 100%,100% gaussian[-1] 20,1,45 +convolve_fft[0] [1] +convolve_fft : check ${is_image_arg\ $1}" && isin(${2=2},0,1,2,3)" +e[^-1] "Convolve image$? with mask $1, in the fourier domain." +pass$1 store. kernel +foreach { +if w +w0,h0,d0:=[w,h,d] +$kernel +if $2!=2 r[0] {[w#0,h#0,d#0]+2*round([w#1>1?w#1:0,h#1>1?h#1:0,d#1>1?d#1:0]/2)},100%,0,$2,0.5,0.5 fi +r ${-max_whd},100%,0,0,0.5,0.5 r 100%,100%,100%,${-max_s} +fft[1] fft[0] ++*[1,2] +*[0,3] +[-2,-1] *[1,3] *[0,2] -[0,1] +ifft rm. +shift {-int(([w,h,d]-1)/2)},0,2 +r $w0,$h0,$d0,100%,0,0,0.5,0.5 +fi +} +#@cli correlate : [mask],_boundary_conditions,_is_normalized={ 0 | 1 },_channel_mode,_xcenter,_ycenter,_zcenter,_xstart,_ystart,_zstart,_xend,_yend,_zend,_xstride,_ystride,_zstride,_xdilation,_ydilation,_zdilation,interpolation_type : (+) +#@cli : Correlate selected images by specified mask. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : 'channel_mode' can be { 0=all | 1=one-for-one | 2=partial sum | 3=full sum }. +#@cli : 'interpolation_type' can be { 0=nearest-neighbor | 1=linear }. +#@cli : Default values: 'boundary_conditions=1', 'is_normalized=0', 'channel_mode=1', 'xcenter=ycenter=zcenter=-1', 'xstart=ystart=zstart=0', 'xend=yend=zend=(max-coordinates)', 'xstride=ystride=zstride=1', 'xdilation=ydilation=zdilation=1' and 'interpolation_type=0'. +#@cli : $ image.jpg (0,1,0;1,-4,1;0,1,0) correlate[-2] [-1] keep[-2] +#@cli : $ image.jpg +crop 40%,40%,60%,60% +correlate[0] [-1],0,1 +#@cli cross_correlation : [mask] +#@cli : Compute cross-correlation of selected images with specified mask. +#@cli : $ image.jpg +shift -30,-20 +cross_correlation[0] [1] +cross_correlation : check ${is_image_arg\ $1} +e[^-1] "Compute cross-correlation of image$? with mask $1." +repeat $! { +pass$1 0 l[$>,-1] { +norm fft.. fft. [-2,-1] *.. [-5] *. [-6] +-[-2,-1] *[-5,-3] *[-3,-2] +[-3,-2] ifft rm. +} +} +#@cli curvature +#@cli : Compute isophote curvatures on selected images. +#@cli : $ image.jpg blur 10 curvature +curvature : +e[^-1] "Compute isophote curvatures on image$?." +foreach { +if d==1 ++g xy,0 hessian... xxxyyy +*... .. *[-4] . *[-4] -2 ++[-4,-3] *... .. +sqr[-2,-1] *[-4] . +[-4,-3] ++[-2,-1] +. 0.1 ^. 1.5 / +else ++inn +gradient_norm.. laplacian... +-[-3,-2] +. 0.1 /[-2,-1] ++inn. laplacian.. - +fi +} +#@cli dct : _{ x | y | z }...{ x | y | z } : (no arg) +#@cli : Compute the discrete cosine transform of selected images, optionally along the specified axes only. +#@cli : Output images are always evenly sized, so this command may change the size of the selected images. +#@cli : Default values: (no arg) +#@cli : See also: ''idct''. +#@cli : $ image.jpg +dct +idct[-1] abs[-2] +[-2] 1 log[-2] +#@cli : $$ https://gmic.eu/oldtutorial/_dct-and-idct +dct : skip ${1=0} +('"$1"') +is_axes:="im>=_'x' && iM<=_'z'" +if $is_axes +e[0--3] "Compute discrete cosine transform of image$? along axes '$1'." +repeat w { +axis:=i[$>] +if $axis==_'x' foreach[^-1] { if w>1 _dct fi } +elif $axis==_'y' foreach[^-1] { if h>1 permute yxzc _dct permute yxzc fi } +elif $axis==_'z' foreach[^-1] { if d>1 permute zxyc _dct permute yzxc fi } +fi +} +rm. +else +rm. +e[0--3] "Compute discrete cosine transform of image$?." +noarg +foreach { +if w>1 _dct fi +if h>1 permute yxzc _dct permute yxzc fi +if d>1 permute zxyc _dct permute yzxc fi +} +fi +_dct : +if w%2 r {w+1},100%,100%,100%,0,1 fi +s x l[1--1:2] { a x mirror x } mv[1] $! a x +fft x +100%,1,1,1,2*cos(-x*pi/(2*w)) *[0,2] +100%,1,1,1,2*sin(-x*pi/(2*w)) *[1,2] +- ++z[0] 0,0 /. {sqrt(2)} j.. .,0,0,0 rm. * {sqrt(2/w)} +#@cli deblur : amplitude[%]>=0,_nb_iter>=0,_dt>=0,_regul>=0,_regul_type={ 0=Tikhonov | 1=meancurv. | 2=TV } +#@cli : Deblur image using a regularized Jansson-Van Cittert algorithm. +#@cli : Default values: 'nb_iter=10', 'dt=20', 'regul=0.7' and 'regul_type=1'. +#@cli : $ image.jpg blur 3 +deblur 3,40,20,0.01 +deblur : check "${2=10}>=0 && ${3=20}>=0 && ${4=0.7}>=0" skip ${5=1} +e[^-1] "Deblur image$? with a regularized Jansson-Van Cittert algorithm, with sigma $1, $2 iterations, +time step $3 and regularization $4." +foreach { +nm={n} +[0] +repeat $2 { +if $5>=2 +curvature. +elif $5>=1 +iee. +else +laplacian. +fi +*. $4 ++b.. $1 -. [-4] +-[-2,-1] +*. {$3/(0.0001+max(abs(im),abs(iM)))} ++[-2,-1] +} +rm.. +=> $nm } +#@cli deblur_goldmeinel : sigma>=0,_nb_iter>=0,_acceleration>=0,_kernel_type={ 0=deriche | 1=gaussian }. +#@cli : Deblur selected images using Gold-Meinel algorithm +#@cli : Default values: 'nb_iter=8', 'acceleration=1' and 'kernel_type=1'. +#@cli : $ image.jpg +blur 1 +deblur_goldmeinel[-1] 1 +deblur_goldmeinel : check "$1>=0 && ${2=8}>=0 && ${3=1}>=0" skip ${4=1} +e[^-1] "Deblur image$? using Gold-Meinel algorithm, with sigma $1, $2 iterations, acceleration $3 and "${arg0\ !$4,"",quasi-}"gaussian kernel." +foreach { +[0] repeat $2 { ++b. $1,1,$4 +/[0,-1] rm.. ^. $3 *[-1,-2] +} rm[0] +} +#@cli deblur_richardsonlucy : sigma>=0, nb_iter>=0, _kernel_type={ 0=deriche | 1=gaussian }. +#@cli : Deblur selected images using Richardson-Lucy algorithm. +#@cli : Default values: 'nb_iter=50' and 'kernel_type=1'. +#@cli : $ image.jpg +blur 1 +deblur_richardsonlucy[-1] 1 +deblur_richardsonlucy : check "$1>=0 && ${2=50}>=0" skip ${3=1} +e[^-1] "Deblur image$? using Richardson-Lucy algorithm, with sigma $1, $2 iterations and "${arg0\ !$3,"",quasi-}"gaussian kernel." +foreach { +[0] repeat $2 { ++b. $1,1,{$3!=0} max. 1e-6 +/[0,-1] rm.. b. $1,1,{$3!=0} *[-1,-2] +} rm[0] +} +#@cli deconvolve_fft : [kernel],_regularization>=0 +#@cli : Deconvolve selected images by specified mask in the fourier space. +#@cli : Default value: 'regularization>=0'. +#@cli : $ image.jpg +gaussian 5 +convolve_fft[0] [1] +deconvolve_fft[-1] [1] +deconvolve_fft : check ${is_image_arg\ $1}" && ${2=.001}>=0" +e[^-1] "Deconvolve image$? with mask $1 and regularization $2, in the fourier domain." +repeat $! { pass$1 0 l[$>,-1] { +w2,h2,d2={0,int([w,h,d]/2)} +r[1] [0],[0],[0],1,0,0,0.5,0.5,0.5,0.5 shift[1] -$w2,-$h2,-$d2,0,2 +fft[0] fft[2] ++l[-1,-2] { sqr + + $2 } ++*[-4] ... ++*[-6] ... +-[-2,-1] +*[-6,-4] +*[-4,-3] ++[-4,-3] +/. .. /[-3,-2] +ifft rm. +} } +#@cli deinterlace : _method={ 0 | 1 } +#@cli : Deinterlace selected images ('method' can be { 0=standard or 1=motion-compensated }). +#@cli : Default value: 'method=0'. +#@cli : $ image.jpg +rotate 3,1,1,50%,50% resize 100%,50% resize 100%,200%,1,3,4 shift[-1] 0,1 add +deinterlace 1 +deinterlace : skip ${1=0} +e[^-1] "Deinterlace image$? with "${arg0\ !$1,motion-compensated,standard}" method." +foreach { +wh:=[w,h] +s y a[0--1:2] y a[^0] y ri.. .,0 r 100%,200%,1,100%,5 +if $1!=0 +displacement. ..,0.05 warp... .,1,1,1 rm. fi ++ / 2 c 0,255 r $wh +} +#@cli denoise : [guide],std_deviation_s[%]>=0,_std_deviation_r[%]>=0,_patch_size>0,_lookup_size>0,_smoothness,_fast_approx={ 0 | 1 } : std_deviation_s[%]>=0,_std_deviation_r[%]>=0,_patch_size>0,_lookup_size>0,_smoothness,_fast_approx={ 0 | 1 } : (+) +#@cli : Denoise selected images by non-local patch averaging. +#@cli : Default values: 'std_deviation_p=10', 'patch_size=5', 'lookup_size=6' and 'smoothness=1'. +#@cli : $ image.jpg +denoise 5,5,8 +#@cli denoise_haar : _threshold>=0,_nb_scales>=0,_cycle_spinning>0 +#@cli : Denoise selected images using haar-wavelet thresholding with cycle spinning. +#@cli : Set 'nb_scales==0' to automatically determine the optimal number of scales. +#@cli : Default values: 'threshold=1.4', 'nb_scale=0' and 'cycle_spinning=10'. +#@cli : $ image.jpg noise 20 cut 0,255 +denoise_haar[-1] 0.8 +denoise_haar : check "${1=1.4}>=0 && isint(${2=0}) && $2>=0 && isint(${3=10}) && $3>0" +e[^-1] "Denoise image$? using haar-wavelet thresholding, with threshold $1, "${arg0\ ($2>0),auto,$2}" scales and $3 spinning cycles." +foreach { +nm={n} nb_scales:=min(if($2,$2,32),int(log2(min(w,h))-1)) w,h,d:=[w,h,d] sigma=${-std_noise} +r {round(w,2^($nb_scales+1),1)},{round(h,2^($nb_scales+1),1)},{if(d==1,1,round(d,2^($nb_scales+1),1))},100%,0,0 ++f 0 +repeat $3 { +dx:=round(u(0,{4*$nb_scales})) +dy:=round(u(0,{4*$nb_scales})) +dz:=$d==1?0:round(u(0,{4*$nb_scales})) ++shift[0] $dx,$dy,$dz,0,2 +haar. $nb_scales +threshold. {$1*$sigma},1 +ihaar. $nb_scales +shift. {-$dx},{-$dy},{-$dz},0,2 ++[-2,-1] +} +rm[0] / $3 r $w,$h,$d,100%,0 +=> $nm } +#@cli denoise_cnn : _noise_type={ 0=soft | 1=heavy | 2=heavy (faster) | 3=poisson+gaussian | 4=poisson+gaussian2 },_patch_size>0 +#@cli : Denoise selected images using a convolutional neural network (CNN). +#@cli : Input value range should be [0,255]. Output value range is [0,255]. +#@cli : Default value: 'patch_size=64'. +#@cli : $ image.jpg noise 20 cut 0,255 +denoise_cnn +denoise_cnn : skip "${1=0},${2=64}" +N=$! +if isint($1)" && "inrange($1,0,4) check "isint($2) && $2>0" type=$1 else type=0 noarg fi +s0,s1,s2,s3,s4=soft,heavy,heavy,poisson+gaussian,poisson+gaussian2 +e[^-1] "Denoise image$? using a convolutional neural network (for "${s$type}"-noise), with patch size $2." +if 0${_is_denoise_cnn_$type} ${_denoise_cnn_$type} +else l[] { +l[] { +input_cached gmic_denoise_cnn.gmz +onfail error[0--5] "Command 'denoise_cnn': Unable to load network file 'gmic_denoise_cnn.gmz'." +} +k[$type] unserialize +store _denoise_cnn_$type _is_denoise_cnn_$type=1 +} fi +ps=$2 +replace_str. "nn_layer_","nn_" +replace_str. "nn_input X,32,32,1,3","nn_input X,"$ps","$ps",1,3" +if $1==0 +replace_str. "nn_crop OUT,OUT0,2,2,0,29,29,0","nn_crop OUT,OUT0,2,2,0,0,29,29,0,2" +elif inrange($1,1,4) +replace_str. "nn_crop OUT,OUT0,2,2,0,29,29,0","nn_crop OUT,OUT0,2,2,0,0,29,29,0,2" +replace_str. ",1,1,0 ",",1,1,0,1,0 " +replace_str. ",1,1,1 ",",1,1,0,1,1 " +fi +run {t} rm[-2,-1] +repeat $N { l[$>,$N--1] { +w,h:=w#0,h#0 to_color[0] +if $type==3 srgb2rgb[0] +elif $type==4 srgb2rgb[0] /[0] 255 +fi +img2patches[0] $ps,6,3 +1,1,{0,d},1,*${-nn_lib}"X = crop(#0,0,0,z,0,$ps,$ps,1,3);"${_nn_forward}"draw(#0,OUT0,0,0,z,0,$ps,$ps,1,3)" rm. +patches2img[0] $w,$h,6,30% +c[0] 0,255 +if $type==3 rgb2srgb[0] +elif $type==4 *[0] 255 rgb2srgb[0] +fi +} } +rm[$N--1] +#@cli denoise_patchpca : _strength>=0,_patch_size>0,_lookup_size>0,_spatial_sampling>0 +#@cli : Denoise selected images using the patch-pca algorithm. +#@cli : Default values: 'patch_size=7', 'lookup_size=11', 'details=1.8' and 'spatial_sampling=5'. +#@cli : $ image.jpg +noise 20 cut[-1] 0,255 +denoise_patchpca[-1] , +denoise_patchpca : check "${1=1.8} && $1>=0 && isint(${2=7}) && $2>0 && isint(${3=11}) && $3>0 && isint(${4=5}) && $4>0" +e[^-1] "Denoise image$? using patch-pca, with strength $1, patch size $2, lookup size $3 and spatial sampling $4." +foreach { +nm={n} N2:=$2^2 M2:=$3^2 stdnoise=${-std_noise} +100%,100%,1,100% => aggreg +100%,100% => weights +f[0] "* +begin( +n1 = int($2/2); n2 = $2 - n1 - 1; +m1 = int($3/2); m2 = $3 - m1 - 1; +patch(x,y) = crop(x - n1,y - n1,0,c,$2,$2,1,1,1); +ngauss(x) = exp(-x*x/(2*n1*n1)); +ref(vector"$N2"(0),zero); +ref(vector"$N2"(0),mask); +for (l = 0; q = -n1, q<=n2, ++q, +for (p = -n1, p<=n2, ++p, mask[l++] = ngauss(p)*ngauss(q) +) +) +); +if (!(x%$4) && !(y%$4), +ref(patch(x,y),X); +ref(vector"{$N2*$N2}"(0),M); +for (q = -m1, q<=m2, ++q, +for (p = -m1, p<=m2, ++p, +ref(patch(x + p,y + q) - X,Xk); +M += mul(Xk,Xk,"$N2"); +) +); +M/="$M2"; +eig = eig(M); +lambda = sqrt(abs(eig[0,"$N2"])); +for (k = 0, k=$1*"$stdnoise", ++k); +Qt = eig["$N2","{$N2*$N2}"]; +Q = transpose(Qt,"$N2"); +for (q = -m1, q<=m2, ++q, +for (p = -m1, p<=m2, ++p, +pY = Qt*(patch(x + p,y + q) - X); +copy(pY[k],zero[0],size(pY) - k); +(Y = Q*pY)+=X; +draw(#"$aggreg",Y,x + p - n1,y + q - n1,0,c,$2,$2,1,1,-1,mask); +draw(#"$weights",mask,x + p - n1,y + q - n1,0,c,$2,$2,1,1,-1); +) +); +0);0" +max[weights] 0.01 /[aggreg,weights] k[aggreg] => $nm +} +#@cli deriche : std_deviation>=0[%],order={ 0 | 1 | 2 },axis={ x | y | z | c },_boundary_conditions : (+) +#@cli : Apply Deriche recursive filter on selected images, along specified axis and with +#@cli : specified standard deviation, order and boundary conditions. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default value: 'boundary_conditions=1'. +#@cli : $ image.jpg deriche 3,1,x +#@cli : $ image.jpg +deriche 30,0,x deriche[-2] 30,0,y add +#@cli : $$ https://gmic.eu/oldtutorial/_deriche +#@cli dilate : size>=0 : size_x>=0,size_y>=0,size_z>=0 : [kernel],_boundary_conditions,_is_real={ 0=binary-mode | 1=real-mode } : (+) +#@cli : Dilate selected images by a rectangular or the specified structuring element. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default values: 'size_z=1', 'boundary_conditions=1' and 'is_real=0'. +#@cli : $ image.jpg +dilate 10 +#@cli dilate_circ : _size>=0,_boundary_conditions,_is_real={ 0 | 1 } +#@cli : Apply circular dilation of selected images by specified size. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default values: 'boundary_conditions=1' and 'is_real=0'. +#@cli : $ image.jpg +dilate_circ 7 +dilate_circ : check "$1>=0 && isint(${2=1}) && inrange($2,0,3) && isbool(${3=0})" +r0,r1=binary,real +e[^-1] "Apply circular dilation of image$? by size $1, boundary conditions $2, in "${r$3}" mode." +if $1<2 return fi +shape_circle $1 dilate[^-1] .,$2,$3 rm. +#@cli dilate_oct : _size>=0,_boundary_conditions,_is_real={ 0 | 1 } +#@cli : Apply octagonal dilation of selected images by specified size. +#@cli : Default values: 'boundary_conditions=1' and 'is_real=0'. +#@cli : $ image.jpg +dilate_oct 7 +dilate_oct : check "$1>=0 && isint(${2=1}) && inrange($2,0,3) && isbool(${3=0})" +r0,r1=binary,real +e[^-1] "Apply octagonal dilation of image$? by size $1, boundary conditions $2, in "${r$3}" mode." +if $1<2 return fi +if $1&1 ss=$1 else ss:=$1+1 fi +i[0] (0,1,0;1,1,1;0,1,0) i[1] (1,1,1;1,1,1;1,1,1) +repeat $!-2 { +r:=round(($ss-1)*sqrt(2)/(1+sqrt(2))/2) +q:=round(($ss-1)/(1+sqrt(2))/2) +if $r>0 repeat $r { dilate. [0],$2,$3 } fi +if $q>0 repeat $q { dilate. [1],$2,$3 } fi +mv. 2 +} +rm[0,1] +_kr_circle : +if $1%2==0 2,2,1,1,1 else 1,1,1,1,1 fi r. $1,$1,1,1,0,0,0.5,0.5 +distance. 1 round. 0.5 ir. 0,{$1/2} +_jf_circle : +{round($1)},{round($1)} +center:=0.5*(w-1) +f. 'sqrt((x-$center)^2+(y-$center)^2)' +if !(w%2) +round. 0.0001,-1 +t1:=sqrt(((round($1)-1)/2)^2+0.25) +t2:=sqrt(((round($1)+1)/2)^2+0.25) +k:=$1-round($1)+0.5 +t:=$t1+($t2-$t1)*$k +ir. 0,$t +else ir. 0,{$1/2-0.25} +fi +#@cli dilate_threshold : size_x>=1,size_y>=1,size_z>=1,_threshold>=0,_boundary_conditions +#@cli : Dilate selected images in the (X,Y,Z,I) space. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default values: 'size_y=size_x', 'size_z=1', 'threshold=255' and 'boundary_conditions=1'. +dilate_threshold : check "isint($1) && $1>=1 && isint(${2=$1}) && $2>=1 && isint(${3=1}) && $3>=1 && ${4=255}>=0 && +isint(${5=1}) && $5>=0" +e[^-1] "Dilate image$? with mask $1x$2x$3, threshold $4 and "${arg\ $5,dirichlet,neumann}" boundary conditions." +l[] { +dx1:=int($1/2) dx2:=$1-$dx1-1 +dy1:=int($2/2) dy2:=$2-$dy1-1 +dz1:=int($3/2) dz2:=$3-$dz1-1 +(-$dx1,$dx1) (-$dy1;$dy1) (-$dz1/$dz1) r $1,$2,$3,1,3 a c round r {w*h*d},3,1,1,-1 transpose. +i.. 1,100%,1,1,254 1,100%,1,1,255 a x +('{^}') rm.. replace_str "254,","(v=j(" replace_str ",255",",0,0,$5);if(abs(v-i)<=$4,v,-1e20))" list={t} +rm +} +f 'max($list)' +#@cli divergence +#@cli : Compute divergence of selected vector fields. +#@cli : $ image.jpg luminance +gradient append[-2,-1] c divergence[-1] +divergence : +e[^-1] "Compute divergence of vector field$?." +foreach { +if s==1 g x,0 +elif s==2 s c g.. x,0 g. y,0 + +elif s==3 s c g... x,0 g.. y,0 g. z,0 + +else error[] "Command '$0': Cannot compute divergence of image ["$>"] (has "{s}">3 channels)." +fi +} +#@cli dog : _sigma1>=0[%],_sigma2>=0[%] +#@cli : Compute difference of gaussian on selected images. +#@cli : Default values: 'sigma1=2%' and 'sigma2=3%'. +#@cli : $ image.jpg dog 2,3 +dog : check "${1=2%}>=0 && ${2=3%}>=0" +e[^-1] "Compute difference of gaussian on image$?, with standard deviations $1 and $2." +foreach { [0] parallel "b[0] $1","b[1] $2" - abs } +#@cli diffusiontensors : _sharpness>=0,0<=_anisotropy<=1,_alpha[%],_sigma[%],is_sqrt={ 0 | 1 } +#@cli : Compute the diffusion tensors of selected images for edge-preserving smoothing algorithms. +#@cli : Default values: 'sharpness=0.7', 'anisotropy=0.3', 'alpha=0.6', 'sigma=1.1' and 'is_sqrt=0'. +#@cli : $ image.jpg diffusiontensors 0.8 abs pow 0.2 +#@cli : $$ https://gmic.eu/oldtutorial/_diffusiontensors +diffusiontensors : check "${1=0.7}>=0 && ${2=0.3}>=0 && $2<=1" skip ${3=0.6},${4=1.1},${5=0} +e[^-1] "Compute diffusion tensors for image$?, with sharpness $1, anisotropy $2, alpha $3 and sigma $4." +p1:=($5?0.5:1)*max($1,1e-2) +p2:=$p1/(1e-7+1-$2) +b $3 n 0,255 structuretensors 0 b $4 +foreach { +eigen max.. 0 +if s==2 s.. c +[-3,-2] +.. 1 +^.. -$p1 ^... -$p2 a[-3,-1] c +else s.. c +[-4--2] +.. 1 +^.. -$p1 r. 100%,100%,100%,2 ^... -$p2 a[-3,-1] c +fi +eigen2tensor +} +#@cli edges : _threshold[%]>=0 +#@cli : Estimate contours of selected images. +#@cli : Default value: 'edges=15%' +#@cli : $ image.jpg +edges 15% +edges : skip ${1=15%} +e[^-1] "Estimate image contours of image$?, with threshold $1." +gradient_norm b 0.5 >= $1 distance 0 equalize negate c 30%,70% n 0,1 +#@cli erode : size>=0 : size_x>=0,size_y>=0,_size_z>=0 : [kernel],_boundary_conditions,_is_real={ 0=binary-mode | 1=real-mode } : (+) +#@cli : Erode selected images by a rectangular or the specified structuring element. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default values: 'size_z=1', 'boundary_conditions=1' and 'is_real=0'. +#@cli : $ image.jpg +erode 10 +#@cli erode_circ : _size>=0,_boundary_conditions,_is_real={ 0 | 1 } +#@cli : Apply circular erosion of selected images by specified size. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default values: 'boundary_conditions=1' and 'is_real=0'. +#@cli : $ image.jpg +erode_circ 7 +erode_circ : check "$1>=0 && isint(${2=1}) && inrange($2,0,3) && isbool(${3=0})" +r0,r1=binary,real +e[^-1] "Apply circular erosion of image$? by size $1, boundary conditions $2, in "${r$3}" mode." +if $1<2 return fi +shape_circle $1 erode[^-1] .,$2,$3 rm. +#@cli erode_oct : _size>=0,_boundary_conditions,_is_real={ 0 | 1 } +#@cli : Apply octagonal erosion of selected images by specified size. +#@cli : Default values: 'boundary_conditions=1' and 'is_real=0'. +#@cli : $ image.jpg +erode_oct 7 +erode_oct : check "$1>=0 && isint(${2=1}) && inrange($2,0,3) && isbool(${3=0})" +r0,r1=binary,real +e[^-1] "Apply octagonal erosion of image$? by size $1, boundary conditions $2, in "${r$3}" mode." +if $1<2 return fi +if $1&1 ss=$1 else ss:=$1+1 fi +i[0] (0,1,0;1,1,1;0,1,0) i[1] (1,1,1;1,1,1;1,1,1) +repeat $!-2 { +r:=round(($ss-1)*sqrt(2)/(1+sqrt(2))/2) +q:=round(($ss-1)/(1+sqrt(2))/2) +if $r>0 repeat $r { erode. [0],$2,$3 } fi +if $q>0 repeat $q { erode. [1],$2,$3 } fi +mv. 2 +} +rm[0,1] +#@cli erode_threshold : size_x>=1,size_y>=1,size_z>=1,_threshold>=0,_boundary_conditions +#@cli : Erode selected images in the (X,Y,Z,I) space. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default values: 'size_y=size_x', 'size_z=1', 'threshold=255' and 'boundary_conditions=1'. +erode_threshold : check "isint($1) && $1>=1 && isint(${2=$1}) && $2>=1 && isint(${3=1}) && $3>=1 && ${4=255}>=0 && +isint(${5=1}) && $5>=0" +e[^-1] "Erode image$? with mask $1x$2x$3, threshold $4 and "${arg\ $5,dirichlet,neumann}" boundary conditions." +l[] { +dx1:=int($1/2) dx2:=$1-$dx1-1 +dy1:=int($2/2) dy2:=$2-$dy1-1 +dz1:=int($3/2) dz2:=$3-$dz1-1 +(-$dx1,$dx1) (-$dy1;$dy1) (-$dz1/$dz1) r $1,$2,$3,1,3 a c round r {w*h*d},3,1,1,-1 transpose. +i.. 1,100%,1,1,254 1,100%,1,1,255 a x +('{^}') rm.. replace_str "254,","(v=j(" replace_str ",255",",0,0,$5);if(abs(v-i)<=$4,v,1e20))" list={t} +rm +} +f 'min($list)' +#@cli fft : _{ x | y | z }...{ x | y | z } : (+) +#@cli : Compute the direct fourier transform (real and imaginary parts) of selected images, +#@cli : optionally along the specified axes only. +#@cli : See also: ''ifft''. +#@cli : $ image.jpg luminance +fft append[-2,-1] c norm[-1] log[-1] shift[-1] 50%,50%,0,0,2 +#@cli : $ image.jpg w2:=int(w/2) h2:=int(h/2) fft shift $w2,$h2,0,0,2 ellipse $w2,$h2,30,30,0,1,0 shift -$w2,-$h2,0,0,2 ifft remove[-1] +#@cli : $$ https://gmic.eu/oldtutorial/_fft +#@cli g : eq. to 'gradient'. : (+) +g : +_gmic_s="$?" axes,scheme,boundary,is_noarg=${"_gradient_get_args $*"} +v + _gradient $axes,$scheme,$boundary v - +if $is_noarg noarg fi +#@cli gradient : { x | y | z | c }...{ x | y | z | c },_scheme,_boundary_conditions : (no arg) +#@cli : Compute the gradient components (first derivatives) of selected images, along specified axes. +#@cli : (eq. to 'g').\n +#@cli : 'scheme' can be { -1=backward | 0=centered | 1=forward | 2=sobel | 3=rotation-invariant (default) | 4=deriche | 5=vanvliet }. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : (no arg) compute all significant components. +#@cli : Default values: 'scheme=0' and 'boundary_conditions=1'. +#@cli : $ image.jpg gradient +#@cli : $$ https://gmic.eu/oldtutorial/_gradient +gradient : +_gmic_s="$?" axes,scheme,boundary,is_noarg=${"_gradient_get_args $*"} +v + _gradient $axes,$scheme,$boundary v - +if $is_noarg noarg fi +_gradient_get_args : skip "${1=},${2=},${3=}" +is_noarg=0 +l[] { +if ['$1']==0 axes,scheme,boundary=,0,1 is_noarg=1 +else +is_axes:="s=['$1'];fill(s,k,isin(s[k],_'x',_'y',_'z',_'c'));min(s)" +if !$is_axes axes,scheme,boundary=,0,1 is_noarg=1 +elif ['$2']==0 axes,scheme,boundary=$1,0,1 +else +is_scheme:="isint($2) && inrange($2,-1,5)" +if !$is_scheme axes,scheme,boundary=,0,1 is_noarg=1 +elif ['$3']==0 axes,scheme,boundary=$1,$2,1 +else +is_boundary:="isint($3) && inrange($3,0,3)" +if !$is_boundary axes,scheme,boundary=,0,1 is_noarg=1 +else axes,scheme,boundary=${1-3} +fi +fi +fi +fi +onfail axes,scheme,boundary=,0,1 is_noarg=1 +} +u $axes,$scheme,$boundary,$is_noarg +_gradient : +axes,scheme,boundary=${1=},${2=},${3=} +if '$axes'!=0 s_axes=" along axes '"$axes"'" fi +s0,s1,s2,s3,s4,s5,s6=backward,centered,forward,sobel,rotation-invariant,deriche,vanvliet +s_scheme=${s{$scheme+1}} +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +s_boundary=${s$boundary} +e[0--3] "Compute gradient of image"$_gmic_s$s_axes", with "$s_scheme" scheme and "$s_boundary" boundary conditions." +sx,sy,sz,sc=",",;,/,^ +foreach { +nm={n} laxes=$axes if '$laxes'==0 if d>1 laxes=xyz else laxes=xy fi fi +('$laxes') +repeat w { +a={`i[#1,$>]`} s=${s$a} +if 0${gradient_$a}>0 [gradient_$a] +elif $scheme==-1 +(-1${s}1${s}0) +correlate[0] .,$boundary rm.. +elif $scheme==0 +(-0.5${s}0${s}0.5) +correlate[0] .,$boundary rm.. +elif $scheme==1 +(0${s}-1${s}1) +correlate[0] .,$boundary rm.. +elif $scheme==2 +if _'$a'==_'x' (-1,0,1;-2,0,2;-1,0,1) +elif _'$a'==_'y' (-1,-2,-1;0,0,0;1,2,1) +else (-0.5${s}0${s}0.5) +fi ++correlate[0] .,$boundary rm.. +elif $scheme==3 +A,B:=[0.25*(2-sqrt(2)),0.5*(sqrt(2)-1)] +if _'$a'==_'x' (-$A,0,$A;-$B,0,$B;-$A,0,$A) +elif _'$a'==_'y' (-$A,-$B,-$A;0,0,0;$A,$B,$A) +else (-0.5${s}0${s}0.5) +fi ++correlate[0] .,$boundary rm.. +else +s4,s5=deriche,vanvliet com=${s$scheme} +if $boundary<2 +$com[0] 0,1,$a,$boundary +else +if _'$a'==_'x' +r[0] {0,[w+2,h,d,s]},0,$boundary,0.5 $com. 0,1,$a shrink_x. 1 +elif _'$a'==_'y' +r[0] {0,[w,h+2,d,s]},0,$boundary,0,0.5 $com. 0,1,$a shrink_y. 1 +elif _'$a'==_'z' +r[0] {0,[w,h,d+2,s]},0,$boundary,0,0,0.5 $com. 0,1,$a shrink_z. 1 +fi +fi +fi +=> gradient_$a +} +rm[0,1] =>[^] $nm +} +u $is_noaarg +#@cli gradient_norm +#@cli : Compute gradient norm of selected images. +#@cli : $ image.jpg gradient_norm equalize +#@cli : $$ https://gmic.eu/oldtutorial/_gradient_norm +gradient_norm : +e[^-1] "Compute gradient norm of image$?." +foreach { g sqr s c + sqrt } +#@cli gradient_orientation : _dimension={ 1 | 2 | 3 } +#@cli : Compute N-d gradient orientation of selected images. +#@cli : Default value: 'dimension=3'. +#@cli : $ image.jpg +gradient_orientation 2 +gradient_orientation : check "isint(${1=3}) && inrange($1,1,3)" +e[^-1] "Compute $1-d gradient orientation of image$?." +foreach { +if $1==1 g x +abs. +. 1e-8 -/ +elif $1==2 g xy +sqr +[-2,-1] +. 1e-8 sqrt. /... . /[-2,-1] +else g xyz +sqr +[-3--1] +. 1e-8 sqrt. /[-4,-3] . /[-2,-1] +fi +} +#@cli guided : [guide],radius[%]>=0,regularization[%]>=0 : radius[%]>=0,regularization[%]>=0 : (+) +#@cli : Blur selected images by guided image filtering. +#@cli : If a guide image is provided, it is used to drive the smoothing process. +#@cli : A guide image must be of the same xyz-size as the selected images. +#@cli : This command implements the filtering algorithm described in: +#@cli : He, Kaiming; Sun, Jian; Tang, Xiaoou, "Guided Image Filtering", +#@cli : IEEE Transactions on Pattern Analysis and Machine Intelligence, vol.35, no.6, pp.1397,1409, June 2013 +#@cli : $ image.jpg +guided 5,400 +#@cli haar : scale>0 +#@cli : Compute the direct haar multiscale wavelet transform of selected images. +#@cli : See also: ''ihaar''. +#@cli : $$ https://gmic.eu/oldtutorial/_haar +haar : check "isint(${1=1}) && $1>=0" +e[^-1] "Compute haar transform of image$? with $1 scales." +foreach { +_haar +repeat $1-1 { +w,h,d:="vmax(0,round([w,h,d]/2^(1+"$>"))-1)" ++z 0,0,0,$w,$h,$d _haar. j.. . rm. +} +} +_haar : +_haar_x _haar_y _haar_z +_haar_x : +if w<=1 return fi +if w%2 error[0--6] "Command 'haar': Invalid image width="{w}" (is not even)." fi ++shift -1 r 50% +-[1] [0] +[0,1] / {sqrt(2)} a x +_haar_y : +if h<=1 return fi +if h%2 error[0--6] "Command 'haar': Invalid image height="{h}" (is not even)." fi ++shift 0,-1 r 100%,50% +-[1] [0] +[0,1] / {sqrt(2)} a y +_haar_z : +if d<=1 return fi +if d%2 error[0--6] "Command 'haar': Invalid image depth="{h}" (is not even)." fi ++shift 0,0,-1 r 100%,100%,50% +-[1] [0] +[0,1] / {sqrt(2)} a z +#@cli heat_flow : _nb_iter>=0,_dt,_keep_sequence={ 0 | 1 } +#@cli : Apply iterations of the heat flow on selected images. +#@cli : Default values: 'nb_iter=10', 'dt=30' and 'keep_sequence=0'. +#@cli : $ image.jpg +heat_flow 20 +heat_flow : skip ${1=10},${2=30},${3=0} +e[^-1] "Apply $1 iterations of the heat flow on image$?, with time step $2." +pde_flow $1,$2,laplacian,$3 +#@cli hessian : { xx | xy | xz | yy | yz | zz }...{ xx | xy | xz | yy | yz | zz },_boundary_conditions : (no arg) : +#@cli : Compute the hessian components (second derivatives) of selected images along specified axes. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : (no arg) compute all significant components. +#@cli : Default value: 'boundary_conditions=1'. +#@cli : $ image.jpg hessian +hessian : skip "${1=},${2=}" +l[] { +if ['$1']==0 axes,boundary=,1 noarg +else +is_axes:="s=['$1'];fill(s,k,isin(s[k],_'x',_'y',_'z'));min(s)" +if !$is_axes axes,boundary=,1 noarg +elif ['$2']==0 axes,boundary=$1,1 +else +is_boundary:="isint($2) && inrange($2,0,3)" +if !$is_boundary axes,boundary=,1 noarg +else axes,boundary=$1,$2 +fi +fi +fi +onfail axes,boundary=,1 noarg +} +if '$axes'!=0 s_axes=" along axes '"$axes"'" fi +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +s_boundary=${s$boundary} +e[^-1] "Compute hessian of image$?"$s_axes", with "$s_boundary" boundary conditions." +foreach { +nm={n} laxes=$axes if '$laxes'==0 if d>1 laxes=xxxyxzyyyzzz else laxes=xxxyyy fi fi +('$laxes') +repeat int(w/2) { +a1,a2={`i[#1,2*$>]`},{`i[#1,2*$>+1]`} +if _'$a1'>_'$a2' a1,a2=$a2,$a1 fi +if 0${hessian_$a1$a2}>0 [hessian_$a1$a2] +elif _'$a1'==_'x'" && "_'$a2'==_'x' (1,-2,1) +correlate[0] .,$boundary rm.. +elif _'$a1'==_'x'" && "_'$a2'==_'y' (0.25,0,-0.25;0,0,0;-0.25,0,0.25) +correlate[0] .,$boundary rm.. +elif _'$a1'==_'x'" && "_'$a2'==_'z' (0.25,0,-0.25/0,0,0/-0.25,0,0.25) +correlate[0] .,$boundary rm.. +elif _'$a1'==_'y'" && "_'$a2'==_'y' (1;-2;1) +correlate[0] .,$boundary rm.. +elif _'$a1'==_'y'" && "_'$a2'==_'z' (0.25;0;-0.25/0;0;0/-0.25;0;0.25) +correlate[0] .,$boundary rm.. +elif _'$a1'==_'z'" && "_'$a2'==_'z' (1/-2/1) +correlate[0] .,$boundary rm.. +fi +=> hessian_$a1$a2 +} +rm[0,1] =>[^] $nm +} +u $is_noaarg +#@cli idct : _{ x | y | z }...{ x | y | z } : (no arg) +#@cli : Compute the inverse discrete cosine transform of selected images, optionally along the specified axes only. +#@cli : Output images are always evenly sized, so this command may change the size of the selected images. +#@cli : (dct images obtained with the 'dct' command are evenly sized anyway). +#@cli : Default values: (no arg) +#@cli : See also: ''dct''. +#@cli : $$ https://gmic.eu/oldtutorial/_dct-and-idct +idct : skip ${1=0} +('"$1"') +is_axes:="im>=_'x' && iM<=_'z'" +if $is_axes +e[0--3] "Compute inverse discrete cosine transform of image$? along axes '$1'." +repeat w { +axis:=i[$>] +if $axis==_'x' foreach[^-1] { if w>1 _idct fi } +elif $axis==_'y' foreach[^-1] { if h>1 permute yxzc _idct permute yxzc fi } +elif $axis==_'z' foreach[^-1] { if d>1 permute zxyc _idct permute yzxc fi } +fi +} +rm. +else +rm. +e[0--3] "Compute inverse discrete cosine transform of image$?." +noarg +foreach { +if w>1 _idct fi +if h>1 permute yxzc _idct permute yxzc fi +if d>1 permute zxyc _idct permute yzxc fi +} +fi +_idct : +if w%2 r {w+1},100%,100%,100%,0,0 fi +/ {sqrt(2/w)} +z[0] 0,0 *. {sqrt(2)} j.. .,0,0,0 rm. ++mirror x shift. 1 *. -1 +100%,1,1,1,cos(x*pi/(2*w)) +100%,1,1,1,sin(x*pi/(2*w)) ++*[0,3] +*[1,2] +[-2,-1] +*[0,2] *[1,2] -[0,1] +ifft x k[0] / 2 +s x,2 mirror. x +r[0] 200%,100%,100%,100%,4,0,0 +r[1] 200%,100%,100%,100%,4,0,1 ++ +#@cli iee +#@cli : Compute gradient-orthogonal-directed 2nd derivative of image(s). +#@cli : $ image.jpg iee +iee : +e[^-1] "Compute gradient-orthogonal-directed 2nd derivative of image$?." +foreach { +if d==1 ++g xy,0 hessian... xxxyyy +*... .. *[-4] . *[-4] -2 ++[-4,-3] *... .. +sqr[-2,-1] *[-4] . +[-4,-3] ++[-2,-1] +. 1e-8 / +else ++inn laplacian.. - +fi +} +#@cli ifft : _{ x | y | z }...{ x | y | z } : (+) +#@cli : Compute the inverse fourier transform (real and imaginary parts) of selected images. +#@cli : optionally along the specified axes only. +#@cli : See also: ''fft''. +#@cli : $$ https://gmic.eu/oldtutorial/_fft +#@cli ihaar : scale>0 +#@cli : Compute the inverse haar multiscale wavelet transform of selected images. +#@cli : See also: ''haar''. +#@cli : $$ https://gmic.eu/oldtutorial/_haar +ihaar : check "isint(${1=1}) && $1>=0" +e[^-1] "Compute inverse haar transform of image$? with $1 scales." +foreach { +repeat $1-1 { +w,h,d:="vmax(0,round([w,h,d]/2^(1+"$<"))-1)" ++z 0,0,0,$w,$h,$d _ihaar. j.. . rm. +} +_ihaar +} +_ihaar : +_ihaar_x _ihaar_y _ihaar_z +_ihaar_x : +if w<=1 return fi +if w%2 error[0--6] "Command 'ihaar': Invalid image width="{w}" (is not even)." fi +s x,2 r 200% (-1,1) *[-2,-1] + / {sqrt(2)} +_ihaar_y : +if h<=1 return fi +if h%2 error "Command 'ihaar': Invalid image height="{h}" (is not even)." fi +s y,2 r 100%,200% (-1;1) r. {-2,w} *[-2,-1] + / {sqrt(2)} +_ihaar_z : +if d<=1 return fi +if d%2 error "Command 'ihaar': Invalid image depth="{h}" (is not even)." fi +s z,2 r 100%,100%,200% (-1/1) r. {-2,w},{-2,h} *[-2,-1] + / {sqrt(2)} +#@cli ilaplacian : { nb_iterations>0 | 0 },_[initial_estimate] +#@cli : Invert selected Laplacian images. +#@cli : If given 'nb_iterations' is '0', inversion is done in Fourier space (single iteration), +#@cli : otherwise, by applying 'nb_iterations' of a Laplacian-inversion PDE flow. +#@cli : Note that the resulting inversions are just estimation of possible/approximated solutions. +#@cli : Default values: 'nb_iterations=0' and '[initial_estimated]=(undefined)'. +#@cli : $ image.jpg +laplacian +ilaplacian[-1] 0 +ilaplacian : check "${1=0}>=0" skip "${2=}" +is_estimate=${"is_image_arg $2"} nb_iter:=round($1) +if !$nb_iter +if $is_estimate +e[0--4] "Invert Laplacian image$? in Fourier space, with initial estimate $2." +pass$2 1 ia=${-average_vectors} rm. +else +e[0--4] "Invert Laplacian image$? in Fourier space." +ia=0 +fi +foreach { +fft 100%,100%,1,1,"2*(cos(x*2*pi/w) + cos(y*2*pi/h)) - 4" =. 1 +/[-3,-2] . rm. += 0 ifft rm. +} ++ '"begin(S = resize(["$ia"],s,0)); S"' +else +if $is_estimate +e[0--4] "Invert Laplacian image$? using $1 iterations of PDE flow and +initial estimate $2." +repeat $! { pass$2 0 l[$>,-1] { +*[0] 5 i[1] (0,5,0;5,0,5;0,5,0) +repeat $1 { +convolve. [1] -. [0] +[-2,-1] /. 21 } k. +} } +else +e[0--4] "Invert Laplacian image$? using $1 iterations of PDE flow." +foreach { +* 5 (0,5,0;5,0,5;0,5,0) +f.. 0 +repeat $1 { +convolve. [1] -. [0] +[-2,-1] /. 21 } k. +} +fi +fi +#@cli inn +#@cli : Compute gradient-directed 2nd derivative of image(s). +#@cli : $ image.jpg inn +inn : +e[^-1] "Compute gradient-directed 2nd derivative of image$?." +foreach { +if d==1 ++g xy,0 hessian... xxxyyy +*[-5] .. *[-4] . *[-4] 2 ++[-5,-4] *[-4] .. +sqr[-2,-1] *... . +[-4,-3] ++[-2,-1] +. 1e-8 / +else ++g xyz,0 hessian[-4] xxxyxzyyyzzz +*[-9] ... *[-8] .. *[-8] 2 *[-7] . *[-7] 2 ++[-9--7] *[-7] ... +*[-6] .. *[-5] . *[-5] 2 ++[-6,-5] *[-5] .. +[-6,-5] +sqr[-3--1] *[-4] . +[-5,-4] ++[-3--1] +. 1e-8 / +fi +} +#@cli inpaint : [mask] : [mask],0,_fast_method : [mask],_patch_size>=1,_lookup_size>=1,_lookup_factor>=0,_lookup_increment!=0,_blend_size>=0,0<=_blend_threshold<=1,_blend_decay>=0,_blend_scales>=1,_is_blend_outer={ 0 | 1 } : (+) +#@cli : Inpaint selected images by specified mask. +#@cli : If no patch size (or 0) is specified, inpainting is done using a fast average or median algorithm. +#@cli : Otherwise, it used a patch-based reconstruction method, that can be very time consuming. +#@cli : 'fast_method' can be { 0=low-connectivity average | 1=high-connectivity average | 2=low-connectivity median | 3=high-connectivity median }. +#@cli : Default values: 'patch_size=0', 'fast_method=1', 'lookup_size=22', 'lookup_factor=0.5', 'lookup_increment=1', 'blend_size=0', 'blend_threshold=0', 'blend_decay=0.05', 'blend_scales=10' and 'is_blend_outer=1'. +#@cli : $ image.jpg 100%,100% ellipse 50%,50%,30,30,0,1,255 ellipse 20%,20%,30,10,0,1,255 +inpaint[-2] [-1] remove[-2] +#@cli : $ image.jpg 100%,100% circle 30%,30%,30,1,255,0,255 circle 70%,70%,50,1,255,0,255 +inpaint[0] [1],5,15,0.5,1,9,0 remove[1] +#@cli inpaint_pde : [mask],_nb_scales[%]>=0,_diffusion_type={ 0=isotropic | 1=Delaunay-guided | 2=edge-guided | 3=mask-guided },_diffusion_iter>=0 +#@cli : Inpaint selected images by specified mask using a multiscale transport-diffusion algorithm. +#@cli : If 'diffusion type==3', non-zero values of the mask (e.g. a distance function) are used +#@cli : to guide the diffusion process. +#@cli : Default values: 'nb_scales=75%', 'diffusion_type=1' and 'diffusion_iter=20'. +#@cli : $ image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 +inpaint_pde[0] [1] +inpaint_pde : check ${is_image_arg\ $1}" && ${2=75%}>=0 && isint(${3=1}) && $3>=0 && $3<=3 && ${4=20}>=0" +s0="isotropic" s1="Delaunay-guided" s2="edge-guided" s3="mask-guided" +e[^-1] "Inpaint image$? by mask $1, using a multiscale diffusion algorithm with $2 scales +and $4 iterations of "${s$3}" diffusion." +repeat $! { nm={n} pass$1 l[$>,-1] { +nb_scalesM:=ceil(log2(max(w,h,d))) +nb_scales:=round(${"is_percent $2"}?$nb_scalesM*$2:$2) +nb_scales:=max(1,min($nb_scales,$nb_scalesM)) +nb_iter:=max(5,$4) +repeat $nb_scales { +{0,"S = 2^"$<"; round([ max(1,w/S), max(1,h/S), max(1,d/S), s ])"} +100%,100%,100% +eval[1] "const wl1 = w#-1 - 1; const hl1 = h#-1 - 1; const dl1 = d#-1 - 1; +const w1 = max(1,w - 1); const h1 = max(1,h - 1); const d1 = max(1,d - 1); +!i?( +X = round(x*wl1/w1); Y = round(y*hl1/h1); Z = round(z*dl1/d1); +I(#-2,X,Y,Z) += I(#0,x,y,z); +++i(#-1,X,Y,Z) +);I" ++max. 1 /[-3,-1] !=. 0 +if !$> +im={-2,im} +-.. {$im-1} *. .. ++distance.. 1 *. -1 watershed.. . rm. ++. {$im-1} mv. -3 +fi +if $>>0" || "$nb_scales==1 +ri... ..,3 +if $3==0 +repeat $nb_iter { j... ..,0,0,0,0,1,. b... 0.5 } +elif $3==1 ++distance. 1 100%,100%,100%,{d==1?2:3} +eval.. "* +const boundary = 1; +maxabs(a,b) = (abs(a)>abs(b)?a:b); +ix = maxabs(j(1) - i,i - j(-1)); +iy = maxabs(j(0,1) - i,i - j(0,-1)); +d>1?( +iz = maxabs(j(0,0,1) - i,i - j(0,0,-1)); +copy(I(#-1),[ ix,iy,iz ],3,whd); +):copy(I(#-1),[ ix,iy ],2,whd)" +rm.. orientation. +repeat $nb_iter { +j[-4] ...,0,0,0,0,1,.. ++warp[-4] .,1,2,1 *.. -1 warp[-5] ..,1,2,1 +[-5,-1] /[-4] 2 +} +rm. +elif $3==2 +repeat $nb_iter { ++diffusiontensors... 0,1,1.5,0.5 +j[-4] ...,0,0,0,0,1,.. +smooth[-4] .,1,10,0 rm. +} +else ++r[1] .,2 g. a[-{d==1?2:3}--1] c orientation. +repeat $nb_iter { +j[-4] ...,0,0,0,0,1,.. ++warp[-4] .,1,2,1 *.. -1 warp[-5] ..,1,2,1 +[-5,-1] /[-4] 2 +} rm. +fi +j... ..,0,0,0,0,1,. +fi +rm[-2,-1] +} +=> $nm rv[0,-1] rm. +} rm. } +#@cli inpaint_flow : [mask],_nb_global_iter>=0,_nb_local_iter>=0,_dt>0,_alpha>=0,_sigma>=0 +#@cli : Apply iteration of the inpainting flow on selected images. +#@cli : Default values: 'nb_global_iter=10', 'nb_local_iter=100', 'dt=5', 'alpha=1' and 'sigma=3'. +#@cli : $ image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 inpaint_flow[0] [1] +inpaint_flow : check ${is_image_arg\ $1}" && ${2=10}>=0 && ${3=100}>=0 && ${4=5}>0 && ${5=1}>=0 && ${6=3}>=0" +e[^-1] "Apply $2x$3 iterations of the inpainting flow on image$?, with mask $1, time step $4, alpha $5 and sigma $6." +repeat $! { +pass$1 0 l[$>,-1] { +r. [0],[0],[0],1,0 inpaint.. [1] +repeat $2 { +progress {100*$>/($2-1)} ++diffusiontensors.. 0,1,$5,$6,0 *. .. smooth... .,$3,$4,0 rm. +} +progress 100 +} +rm. +} +#@cli inpaint_holes : maximal_area[%]>=0,_tolerance>=0,_is_high_connectivity={ 0 | 1 } +#@cli : Inpaint all connected regions having an area less than specified value. +#@cli : Default values: 'maximal_area=4', 'tolerance=0' and 'is_high_connectivity=0'. +#@cli : $ image.jpg noise 5%,2 +inpaint_holes 8,40 +inpaint_holes : check "${1=4}>=0 && ${2=0}>=0" skip ${3=0} +e[^-1] "Inpaint holes with area less than $1 pixels in image$?, with tolerance $2 and "${arg0\ !$3,high,low}" connectivity." +foreach { +100%,100%,100% +area:=${is_percent\ $1}?$1*w*h*d:$1 +repeat s#0 { sh[0] $> +area. $2,$3 <=. $1 -|[1,-1] rm. } +if im k[0] whd=[w,h,d] r 1,1,1,100%,2 r $whd,100% +else inpaint[0] [1],0,{2*!$2+!!$3} k[0] fi +} +#@cli inpaint_morpho : [mask] +#@cli : Inpaint selected images by specified mask using morphological operators. +#@cli : $ image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 +inpaint_morpho[0] [1] +inpaint_morpho : check ${is_image_arg\ $1} +e[^-1] "Inpaint image$? by mask $1, using morphological operators." +repeat $! { +pass$1 0 l[$>,-1] { +nm={0,n} im={0,im} iM={0,iM} im1:=$im-1 iM1:=$iM+1 +channels. 0 ==. 0 ++f[0] $im1 j. [0],0,0,0,0,1,.. +do ++dilate. 3 +replace.. $im1,$iM1 +erode.. 3 +replace.. $iM1,$im1 ++[-2,-1] /. 2 +j. ...,0,0,0,0,1,.. +while im==$im1 +k. => $nm +} +} +#@cli inpaint_matchpatch : [mask],_nb_scales={ 0=auto | >0 },_patch_size>0,_nb_iterations_per_scale>0,_blend_size>=0,_allow_outer_blending={ 0 | 1 },_is_already_initialized={ 0 | 1 } +#@cli : Inpaint selected images by specified binary mask, using a multi-scale matchpatch algorithm. +#@cli : Default values: 'nb_scales=0', 'patch_size=9', 'nb_iterations_per_scale=10', 'blend_size=5','allow_outer_blending=1' and 'is_already_initialized=0'. +#@cli : $ image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 +inpaint_matchpatch[0] [1] +inpaint_matchpatch : check ${is_image_arg\ $1}"&& ${2=0}>=0 && isint(${3=9}) && $3>0 && isint(${4=10}) && $4>0 && +isint(${5=5}) && $5>=0" skip ${6=1},${7=0} +e[^-1] "Inpaint image$? with mask $1, using a multiscale patch-matching algorithm with "${"if $2 u \"$2 \" else u auto- fi"}"scales, $3x$3 patches, $4 iterations per scale and blending size $5." +repeat $! { pass$1 0 l[$>,-1] { +nm={0,n} +=> img,mask +nb_scales:=max(1,round(if($2,$2,log2(min(w,h)/16)),1,1)) +visu_size=${fitscreen[]" "{0,[w,h,1]},25%,50%} +slices[img] 0 r[mask] [img],[img],1,1,0 !=[mask] 0 +if !$7 inpaint_pde[img] [mask],75% fi +im={img,im} -[img] $im +first_iter=1 iter=0 +repeat $nb_scales { +scale:=100*(0.5^$<) +e "> Process scale "{1+$>}"/"$nb_scales" -> "$scale% +progress {100*$>/max(1,$nb_scales-1)} ++r[img,mask] $scale%,$scale%,1,100%,2 => scaled_img,scaled_mask +>=[scaled_mask] 0.95 +if {scaled_mask,!iM} rm[scaled_img,scaled_mask] continue fi ++f[scaled_img] -4096 +j[scaled_img] .,0,0,0,0,1,[scaled_mask] rm.. => scaled_reference +coef:=0.5^($nb_scales-$iter) +patch_size:="v=round(max(min($3,5),$3*$coef));v+(1-(v%2))" +patch_size:=min(w,h,$patch_size) +blend_size:="v=if($5,round(max(3,$5*$coef)));v+(1-(v%2))" +iter+=1 +==[scaled_mask] 0 +if $first_iter +100%,100%,1,1,x +f. y mv[scaled_mask] $! a[-3--1] c +matchpatch[scaled_img] [scaled_reference],$patch_size,$patch_size,1,4,4,0,0,. +rm[scaled_reference,-1] +=> correspondence +first_iter=0 +else +*[correspondence] 2 r[correspondence] 200%,200%,1,2 r[correspondence] [scaled_img],[scaled_img],1,2,0,1 +100%,100%,1,1,x +f. y a[-2,-1] c +f[scaled_mask] "*if(i,1, +upc = i(#"$correspondence",x-1,y,0,0); vpc = i(#"$correspondence",x-1,y,0,1); +ucp = i(#"$correspondence",x,y-1,0,0); vcp = i(#"$correspondence",x,y-1,0,1); +ucc = i(#"$correspondence",x,y,0,0); vcc = i(#"$correspondence",x,y,0,1); +i(#-1,x,y,0,0) = (ucc==upc && vcc==vpc)?upc + 1:ucc; +i(#-1,x,y,0,1) = (ucc==ucp && vcc==vcp)?vcp + 1:vcc; +0)" +rm[correspondence] => correspondence +a[correspondence] [scaled_mask],c +nbs1:=max(1,$nb_scales-1) +nb_iter:=round(max(1,$4*(($<+1)/$nbs1)^2)) +repeat $nb_iter { +_inpaint_matchpatch[scaled_img] [correspondence],[scaled_mask],$blend_size,$6 ++matchpatch[scaled_img] [scaled_reference],$patch_size,$patch_size,1,4,4,0,0,[correspondence] +j[correspondence] . rm. +if {*1} w1[scaled_img] $visu_size,0 fi +if {*2} w2[correspondence] $visu_size,1 fi +} +rm[scaled_img,scaled_mask,scaled_reference] channels[correspondence] 0,1 +fi +} +progress 100 +if $correspondence +==[mask] 0 +_inpaint_matchpatch[img] [correspondence],[mask],$5,$6 +rm[correspondence] +fi ++[img] $im +=>[0] $nm +} rm[mask] } +_inpaint_matchpatch : +pass$1 1 pass$2 {!$3" || "!$4} +if !$3 +warp[0] [1],0,0,1 +else +if $4 erode. $3 fi +f[0] "*begin( +boundary = 1; +const patch_size = $3; +const p2 = int(patch_size/2); +const p1 = patch_size - p2 - 1; +avg = resize([0],s#0); +wpq = resize([0],patch_size^2); +g = 0; +for (q = -p1, q<=p2, ++q, +for (p = -p1, p<=p2, ++p, +wpq[g++] = exp(-(p^2 + q^2)/(2*(0.3*patch_size)^2)); +); +); +); +if (i#2,I, +g = 0; +avg = 0; +norm = 0; +for (q = -p1, q<=p2, ++q, +for (p = -p1, p<=p2, ++p, +U = I(#1,x + p,y + q); +w = wpq[g++]; +norm+=w; +avg+=w*I(#0,U[0,2] - [p,q]); +); +); +avg/norm)" +fi +k[0] +_inpaint_warping2d : +foreach { +100%,100%,100%,2,"> begin(const S = s#0; zero0 = vectorS(); zero1 = [0,0]; N = 0); I(#-1)==zero0?zero1:[++N,1]" +s. c distance. 1 *. -1 +watershed.. . rm. +repeat 2 { +f.. ">i?I:( +nP = vectors(); +const sP = size(nP); +r = i(#-1); +(P = J(-1,-1))[0] && j(#-1,-1,-1)==r?(nP[0] = ++P[0]; nP[1] = ++P[1]; sP>2?copy(nP[2],P[2],sP-2)): +(P = J(0,-1))[0] && j(#-1,0,-1)==r ?(nP[0] = P[0]; nP[1] = ++P[1]; sP>2?copy(nP[2],P[2],sP-2)): +(P = J(1,-1))[0] && j(#-1,1,-1)==r ?(nP[0] = --P[0]; nP[1] = ++P[1]; sP>2?copy(nP[2],P[2],sP-2)): +(P = J(-1,0))[0] && j(#-1,-1,0)==r ?(nP[0] = ++P[0]; nP[1] = P[1]; sP>2?copy(nP[2],P[2],sP-2)); +nP)" +f.. "2?copy(nP[2],P[2],sP-2)): +(P = J(0,1))[0] && j(#-1,0,1)==r ?(nP[0] = P[0]; nP[1] = --P[1]; sP>2?copy(nP[2],P[2],sP-2)): +(P = J(-1,1))[0] && j(#-1,-1,1)==r?(nP[0] = ++P[0]; nP[1] = --P[1]; sP>2?copy(nP[2],P[2],sP-2)): +(P = J(1,0))[0] && j(#-1,1,0)==r ?(nP[0] = --P[0]; nP[1] = P[1]; sP>2?copy(nP[2],P[2],sP-2)); +nP)" +} +rm. +} +#@cli kuwahara : size>0 +#@cli : Apply Kuwahara filter of specified size on selected images. +#@cli : $ image.jpg kuwahara 9 +kuwahara : check $1>0 +e[^-1] "Apply Kuwahara filter of size $1 on image$?." +foreach { +s:=s ++dilate $1 compose_channels. min ++erode[0] $1 compose_channels. max +-[-2,-1] +$1,1,1,1,{1/$1} convolve[0] . transpose. convolve[0] . rm. +p:=int($1/2) +a[-2,-1] c +f "v1=i(x-"$p",y-"$p",0,"$s",0,1); v2=i(x+"$p",y-"$p",0,"$s",0,1); v3=i(x-"$p",y+"$p",0,"$s",0,1); v4=i(x+"$p",y+"$p",0,"$s",0,1); vm=min(v1,v2,v3,v4); if(c>="$s",i, if(vm==v1,i(x-"$p",y-"$p",0,c,0,1), +if(vm==v2,i(x+"$p",y-"$p",0,c,0,1), +if(vm==v3,i(x-"$p",y+"$p",0,c,0,1), +i(x+"$p",y+"$p",0,c,0,1)))))" +channels 0,{s-2} +} +#@cli laplacian +#@cli : Compute Laplacian of selected images. +#@cli : $ image.jpg laplacian +laplacian : +e[^-1] "Compute Laplacian of image$?." +foreach { hessian ${arg0\ (d==1),xxyyzz,xxyy} + } +#@cli lic : _amplitude>0,_channels>0 +#@cli : Render LIC representation of selected vector fields. +#@cli : Default values: 'amplitude=30' and 'channels=1'. +#@cli : $ 400,400,1,2,'if(c==0,x-w/2,y-h/2)' +lic 200,3 quiver[-2] [-2],10,1,1,1,255 +lic : skip ${1=30},${2=1} +e[^-1] "Render LIC representation of 2D vector field$?, with amplitude $1 and $2 channel(s)." +foreach { +nm={n} +channels 0,1 / {max(abs(im),abs(iM))} vector2tensor +100%,100%,100%,$2 rand. 0,255 smooth. ..,$1 rm.. +equalize => $nm +} +#@cli map_tones : _threshold>=0,_gamma>=0,_smoothness>=0,nb_iter>=0 +#@cli : Apply tone mapping operator on selected images, based on Poisson equation. +#@cli : Default values: 'threshold=0.1', 'gamma=0.8', 'smoothness=0.5' and 'nb_iter=30'. +#@cli : $ image.jpg +map_tones , +map_tones : skip ${1=0.1},${2=0.8},${3=0.5},${4=30} +e[^-1] "Apply tone mapping operator on image$?, with threshold $1, gamma $2, smoothness $3 and $4 iterations." +foreach { ++l { +s c foreach { +g xy,1 a c +norm orientation.. +m,M:=[im,iM] b. $3 n. $m,$M +*. 'alpha=$1*iM;(alpha/(1e-10+i))*(i/(1e-10+alpha))^$2' +* s c g.. x,-1 g. y,-1 + +} +a c * 0.25 +} +repeat $4 { +laplacian.. *. 0.25 +. ... -. .. *. 800 +[-3,-1] /.. 801 c.. 0,255 } rm. +} +#@cli map_tones_fast : _radius[%]>=0,_power>=0 +#@cli : Apply fast tone mapping operator on selected images. +#@cli : Default values: 'radius=3%' and 'power=0.3'. +#@cli : $ image.jpg +map_tones_fast , +map_tones_fast : check "${1=3%}>=0 && ${2=0.3}>=0" +e[^-1] "Apply fast tone mapping operator on image$?, with radius $1 and power $2." +foreach { ++luminance b. $1 n 0,1 ++*. 2 -. 1 abs. *. {$2*log(10)} exp. +<=.. 0.5 ri. ... ++*... -1 +. 1 ^. .. *. -1 +. 1 *. ... +^[-4,-2] ==.. 0 *[-3,-2] + +} +n 0,255 +#@cli meancurvature_flow : _nb_iter>=0,_dt,_keep_sequence={ 0 | 1 } +#@cli : Apply iterations of the mean curvature flow on selected images. +#@cli : Default values: 'nb_iter=10', 'dt=30' and 'keep_sequence=0'. +#@cli : $ image.jpg +meancurvature_flow 20 +meancurvature_flow : skip ${1=10},${2=30},${3=0} +e[^-1] "Apply $1 iterations of the mean curvature flow on image$?, with time step $2." +pde_flow $1,$2,iee,$3 +#@cli median : size>=0,_threshold>0 : (+) +#@cli : Apply (opt. thresholded) median filter on selected images with structuring element size x size. +#@cli : $ image.jpg +median 5 +#@cli nlmeans : [guide],_patch_radius>0,_spatial_bandwidth>0,_tonal_bandwidth>0,_patch_measure_command : _patch_radius>0,_spatial_bandwidth>0,_tonal_bandwidth>0,_patch_measure_command +#@cli : Apply non local means denoising of Buades et al, 2005. on selected images. +#@cli : The patch is a gaussian function of 'std_patch_radius'. +#@cli : The spatial kernel is a rectangle of radius 'spatial_bandwidth'. +#@cli : The tonal kernel is exponential (`exp(-d^2/_tonal_bandwidth^2)`) +#@cli : with `d` the euclidean distance between image patches. +#@cli : Default values: 'patch_radius=4', 'spatial_bandwidth=4', 'tonal_bandwidth=10' and 'patch_measure_command=-norm'. +#@cli : $ image.jpg +noise 10 nlmeans[-1] 4,4,{0.6*${-std_noise}} +nlmeans: +if ${"is_image_arg $1"} +check "${2=4}>0 && ${3=4}>0 && ${4=10}>0" skip "${5=-norm}" +e[^-1] "Apply non-local means denoising on image$?, with guide $1, patch size $2, spatial bandwidth $3, +tonal bandwidth $4 and patch measure command '$5'." +pass$1 0 l. { $5 k[0] } +repeat $!-1 { l[$>,-1] { +100%,100%,100%,100%,{-1.0/($4*$4)} +nlmeans_core[0] [1],[2],$2,$3 rm. +} } +rm. +else +check "${1=4}>0 && ${2=4}>0 && ${3=10}>0" skip "${4=-norm}" +e[^-1] "Apply non-local means denoising on image$?, with patch size $1, spatial bandwidth $2, +tonal bandwidth $3 and patch measure command '$4'." +foreach { ++l { $4 k[0] } +100%,100%,100%,100%,{-1.0/($3*$3)} +nlmeans_core[0] [1],[2],$1,$2 k[0] +} +fi +#@cli nlmeans_core: _reference_image,_scaling_map,_patch_radius>0,_spatial_bandwidth>0 +#@cli : Apply non local means denoising using a image for weight and a map for scaling +nlmeans_core : check ${is_image_arg\ $1}" && "${is_image_arg\ $2}" && $3>0 && $4>0" +e[^-1] "Apply non-local means denoising using weight images $1, scaling map $2, patch size $3 and +spatial bandwidth $4." +pass$1 0 pass$2 0 +repeat $!-2 { l[$>,-1,-2] { +100%,100%,100%,{0,s},0 100%,100%,100%,{1,s},0 100%,100%,100%,{1,s},1e-6 +if d#0==1 +repeat 2*$4+1 { j:=$>-$4 repeat 2*$4+1 { i:=$>-$4 +if $i!=0||$j!=0 ++shift[0,1] $i,$j,0,0,2 -[7] [1] +sqr[7] b[7] $3 *[7] [2] exp[7] +*[6] [7] max[5] [7] +[4,7] +[3,6] +fi +} } +else +repeat 2*$4+1 { k:=$>-$4 repeat 2*$4+1 { j:=$>-$4 repeat 2*$4+1 { i:=$>-$4 +if $i!=0||$j!=0||$k!=0 ++shift[0,1] $i,$j,0,0,2 -[7] [1] +sqr[7] b[7] $3 *[7] [2] exp[7] +*[6] [7] max[5] [7] +[4,7] +[3,6] +fi +} } } +fi +rm[1,2] +*[0] [3] +[1,0] +[1,2] +/ +} } +#@cli normalize_local : _amplitude>=0,_radius>0,_n_smooth>=0[%],_a_smooth>=0[%],_is_cut={ 0 | 1 },_min=0,_max=255 +#@cli : Normalize selected images locally. +#@cli : Default values: 'amplitude=3', 'radius=16', 'n_smooth=4%', 'a_smooth=2%', 'is_cut=1', 'min=0' and 'max=255'. +#@cli : $ image.jpg normalize_local 8,10 +normalize_local : +check "${1=3}>=0 && ${2=16}>0 && isbool(${5=1})" skip ${3=4%},${4=2%},${6=0},${7=255} +e[^-1] "Normalize image$? locally, with amplitude $1, radius $2, neighborhood smoothness $3 and +average smoothness $4." +foreach { ++l { erode {2*$2+1} s c min } ++l.. { dilate {2*$2+1} s c max } ++b... $4 b[-3,-2] $3 ++-.. ... +. 0.01 -[-5] [-4] /[-5,-1] +*[-3,-2] {$1+1} *. -$1 +... . +[-2,-1] +if $5 max.. $6 min. $7 fi +-. .. *[-3,-1] + +if $5 c $6,$7 fi +} +#@cli normalized_cross_correlation : [mask] +#@cli : Compute normalized cross-correlation of selected images with specified mask. +#@cli : $ image.jpg +shift -30,-20 +normalized_cross_correlation[0] [1] +normalized_cross_correlation : check ${is_image_arg\ $1} +e[^-1] "Compute normalized cross-correlation of image$? with mask $1." +pass$1 0 norm repeat $!-1 { . l[$>,-1] { +fft.. fft. [-2,-1] *.. [-5] *. [-6] +-[-2,-1] *[-5,-3] *[-3,-2] +[-3,-2] [-2,-1] a[-2,-1] c norm. +/... . /[-2,-1] ifft rm. +} } rm. +#@cli opening : size>=0 : size_x>=0,size_y>=0,_size_z>=0 : [kernel],_boundary_conditions,_is_real={ 0=binary-mode | 1=real-mode } +#@cli : Apply morphological opening to selected images. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default values: 'size_z=1', 'boundary_conditions=1' and 'is_real=0'. +#@cli : $ image.jpg +opening 10 +opening : skip "${2=},${3=}" +boundary,is_kernel,sel=1,0,^ +if "isnum($1)" +if "['$2']==0 && ['$3']==0" +sx,sy,sz=$1 +e[0--4] "Apply morphological opening to image$?, with kernel of size "$sx"." +else +sx=$1 +if ['$2']==0 sy=1 else sy=$2 fi +if ['$3']==0 sz=1 else sz=$3 fi +e[0--4] "Apply morphological opening to image$?, with "${sx}"x"${sy}"x"${sz}" kernel." +fi +elif ${"is_image_arg $1"}" && narg("${"pass$1 -1"}")==1" +pass$1 +sx,sy,sz:=[w,h,d] +is_kernel,sel,r0,r1,b0,b1,b2,b3=1,^-1,binary,real,dirichlet,neumann,periodic,mirror +is_real=0 +if ['$2']!=0 boundary:=cut($2,0,3) fi +if ['$3']!=0 is_real=$3 fi +e[0--3] "Apply morphological opening to image$? with kernel ["${"pass$1 -1"}"] and "${b$boundary}" boundary ""conditions, in "${r$is_real}" mode." +else error[0--3] "Command 'opening': Invalid arguments '$*'." +fi +if $sx>0||$sy>=0||$sz>=0 +sx1,sx2:="s=int(($sx-1)/2);[s,$sx-s-1]" +sy1,sy2:="s=int(($sy-1)/2);[s,$sy-s-1]" +sz1,sz2:="s=int(($sz-1)/2);[s,$sz-s-1]" +foreach[$sel] { +nm={n} +if d>1 +r {[w+$sx+1,h+$sy+1,d+$sz+1]},100%,0,$boundary,0.5,0.5,0.5 +if $is_kernel pass. erode.. .,0,$is_real dilate.. .,0,$is_real rm. +else erode $sx,$sy,$sz dilate $sx,$sy,$sz +fi +z {$sx1+1},{$sy1+1},{$sz1+1},{w-$sx2-2},{h-$sy2-2},{d-$sz2-2} => $nm +elif h>1 +r {[w+$sx+1,h+$sy+1]},1,100%,0,$boundary,0.5,0.5 +if $is_kernel pass. erode.. .,0,$is_real dilate.. .,0,$is_real rm. +else erode $sx,$sy dilate $sx,$sy +fi +z {$sx1+1},{$sy1+1},{w-$sx2-2},{h-$sy2-2} => $nm +else +r {w+$sx+1},1,1,100%,0,$boundary,0.5 +if $is_kernel pass. erode.. .,0,$is_real dilate.. .,0,$is_real rm. +else erode $sx,1 dilate $sx,1 +fi +z {$sx1+1},{w-$sx2-2} => $nm +fi +} +fi +if $is_kernel rm. fi +#@cli opening_circ : _size>=0,_is_real={ 0 | 1 } +#@cli : Apply circular opening of selected images by specified size. +#@cli : Default values: 'boundary_conditions=1' and 'is_real=0'. +#@cli : $ image.jpg +opening_circ 7 +opening_circ : check "$1>=0 && isbool(${2=0})" +r0,r1=binary,real +e[^-1] "Apply morphological opening of image$? with circular kernel of size $1, in "${r$2}" mode." +if $1<2 return fi +shape_circle $1 opening[^-1] .,$2 rm. +#@cli percentile : [mask],0<=_min_percentile[%]<=100,0<=_max_percentile[%]<=100. +#@cli : Apply percentile averaging filter to selected images. +#@cli : Default values: 'min_percentile=0' and 'max_percentile=100'. +#@cli : $ image.jpg shape_circle 11,11 +percentile[0] [1],25,75 +percentile : check ${"is_image_arg $1"}" && inrange(${2=0},0,100) && inrange(${3=100},0,100) && $2<=$3" +vmin,vmax={_[${"is_percent $2"}?100*$2:$2,${"is_percent $3"}?100*$3:$3]} +e[^-1] "Apply percentile averaging filter to image$?, with mask $1, ""min percentile "$vmin"% and max percentile "$vmax"%." +pass$1 0 !=. 0 N:=is if !$N rm. return fi 128,$N +eval.. "> +begin( +p = 0; +const w2 = int(w/2); +const h2 = int(h/2); +); +i?( +out = string('N[',p,']=j(',x - w2,',',y - h2,');'); +copy(i(#-1,0,p++),out,size(out)); +)" +discard. 0 code={t} rm[-2,-1] +f " +begin( N = vector"$N"() ); +const boundary = 1; +const sS = size(N) - 1; +const s0 = round(sS*"$vmin"%); +const s1 = round(sS*"$vmax"%); +const ds = 1 + s1 - s0; +"$code" +S = sort(N); +res = 0; for (s = s0, s<=s1, ++s, res+=S[s]); res/=ds" +#@cli peronamalik_flow : K_factor>0,_nb_iter>=0,_dt,_keep_sequence={ 0 | 1 } +#@cli : Apply iterations of the Perona-Malik flow on selected images. +#@cli : Default values: 'K_factor=20', 'nb_iter=5', 'dt=5' and 'keep_sequence=0'. +#@cli : $ image.jpg +heat_flow 20 +peronamalik_flow : check "${1=20}>0 && ${2=5}>=0" skip ${3=5},${4=0} +e[^-1] "Apply $2 iterations of the Perona-Malik flow on image$?, with K factor $1 and time step $3." +m "_peronamalik_flow : ++gradient xy,0 a[-2,-1] c norm. b. 0.8 /. $1 sqr. *. -1 exp. a[-2,-1] c +f. '\"s1=s-1; +C=i(x,y,z,s-1); +if(c>=s1,0, +(C+i(x+1,y,z,s-1,0,1))*(j(1,0,0,0,0,1)-i) - +(C+i(x-1,y,z,s-1,0,1))*(i-j(-1,0,0,0,0,1)) + +(C+i(x,y+1,z,s-1,0,1))*(j(0,1,0,0,0,1)-i) - +(C+i(x,y-1,z,s-1,0,1))*(i-j(0,-1,0,0,0,1)))\"'" +pde_flow $2,$3,_peronamalik_flow,$4 +um _peronamalik_flow +#@cli phase_correlation : [destination] +#@cli : Estimate translation vector between selected source images and specified destination. +#@cli : $ image.jpg +shift -30,-20 +phase_correlation[0] [1] unroll[-1] y +phase_correlation : check ${"is_image_arg $1"} +e[^-1] "Estimate shift between source image$? and destination $1." +pass$1 +repeat $!-1 { +normalized_cross_correlation[$>] . +l[$>] { +eval " +store('res', +[xM>=w/2?xM - w:xM, +yM>=h/2?yM - h:yM, +zM>=d/2?zM - d:zM]*=-1,1,1,1,3)" +} +$res => "[phase correlation]" rv[$>,-1] rm. +} rm. +#@cli pde_flow : _nb_iter>=0,_dt,_velocity_command,_keep_sequence={ 0 | 1 } +#@cli : Apply iterations of a generic PDE flow on selected images. +#@cli : Default values: 'nb_iter=10', 'dt=30', 'velocity_command=laplacian' and 'keep_sequence=0'. +#@cli : $ image.jpg +pde_flow 20 +pde_flow : skip ${1=10},${2=30},${3=laplacian},${4=0} +e[^-1] "Apply $1 iterations of the velocity flow '$3' on image$?, with time step $2." +foreach { +repeat $1 { ++$3. *. {$2/(0.01+max(abs(im),abs(iM)))} +if $4 +. .. else +[-2,-1] fi +} +if $4 rm[0] fi +a x +} +if $4 s x,$1 fi +#@cli periodize_poisson +#@cli : Periodize selected images using a Poisson solver in Fourier space. +#@cli : $ image.jpg +periodize_poisson array 2,2,2 +periodize_poisson : +e[^-1] "Periodize image$? using Poisson solver in Fourier space." +foreach { +s c foreach { +mM:=[im,iM] sum={0,ia} +laplacian ilaplacian 0 + $sum c $mM +} +a c +} +#@cli rbf : dx,_x0,_x1,_phi(r) : dx,dy,_x0,_y0,_x1,_y1,_phi(r) : dx,dy,dz,x0,y0,z0,x1,y1,z1,phi(r) +#@cli : Reconstruct 1D/2D or 3D image from selected sets of keypoints, by RBF-interpolation. +#@cli : A set of keypoints is represented by a vector-valued image, where each pixel represents a single keypoint. +#@cli : Vector components of a keypoint have the following meaning: +#@cli : - For 1D reconstruction: [ x_k, f1(k),...fN(k) ]. +#@cli : - For 2D reconstruction: [ x_k,y_k, f1(k),...,fN(k) ]. +#@cli : - For 3D reconstruction: [ x_k,y_k,z_k, f1(k),...,fN(k) ]. +#@cli : Values 'x_k','y_k' and 'z_k' are the spatial coordinates of keypoint 'k'. +#@cli : Values 'f1(k),..,fN(k)' are the 'N' components of the vector value of keypoint 'k'. +#@cli : The command reconstructs an image with specified size 'dx'x'dy'x'dz', with 'N' channels. +#@cli : Default values: 'x0=y0=z0=0', 'x1=dx-1', 'y1=dy-1', 'z1=dz-1', 'phi(r)=r^2*log(1e-5+r)'. +#@cli : $ sp colorful r2dx 400 100%,100% noise_poissondisk. 10 1,{is},1,5 eval[-2] "begin(p=0);i?(I[#-1,p++]=[x,y,I(#0)])" to_rgb[1] mul[0,1] dilate_circ[0] 5 +rbf[-1] {0,[w,h]} c[-1] 0,255 +#@cli : $ 32,1,1,5,u([400,400,255,255,255]) rbf 400,400 c 0,255 +rbf : +$=a +default_phi_r="r^2*log(1 + r)" +if isin($#,1,3,4) # 1D reconstruction +dx,x0,x1=$a1,{$#>1?[$a2,$a3]:[0,$a1-1]} +phi_r={`$#>3?['$a4']:'$default_phi_r'`} +check $dx>0 +e[^-1] "Reconstruct 1D image from keypoint set$?, with size "$dx", ""from ("$x0") to ("$x1") and phi(r) = "$phi_r. +foreach { nm={n} if !w $dx elif whd==1 channels. 1,100% r. $dx,1,1,100% else +r 1,{whd},1,100%,-1 permute. cyzx +$dx,1,1,{w-1},"* +begin( +phi(r) = ("$phi_r"); +ref(crop(#0,0,0,0,0,1,h#0,1,1),X); +ref(crop(#0,1,0,0,0,s,h#0,1,1,1),F); +ref(vector(#h#0^2),M); +repeat (h#0,k, +for (l = 0, l<=k, ++l, +r = abs(X[k] - X[l]); +M[k*h#0 + l] = M[l*h#0 + k] = phi(r); +) +); +ref(solve(M,F,s,1),W); +const fx = ("$x1-$x0")/(w-1); +); +ref(vectors(),res); x = (x - "$x0")*fx; +repeat (h#0,k, r = abs(x - X[k]); res+=W[s*k,s]*phi(r)); +res" +k. => $nm +fi } +elif isin($#,2,6,7) # 2D reconstruction +dx,dy,x0,y0,x1,y1=$a1,$a2,{$#>2?[$a3,$a4,$a5,$a6]:[0,0,[$a1,$a2]-1]} +phi_r={`$#>6?['$a7']:'$default_phi_r'`} +check $dx>0" && "$dy>0 +e[^-1] "Reconstruct 2D image from keypoint set$?, with size "$dx,$dy", ""from ("$x0,$y0") to ("$x1,$y1") and phi(r) = "$phi_r. +foreach { nm={n} if !w $dx,$dy elif whd==1 channels 2,100% r. $dx,$dy,1,100% else +r 1,{whd},1,100%,-1 permute. cyzx +$dx,$dy,1,{w-2},"* +begin( +phi(r) = ("$phi_r"); +ref(crop(#0,0,0,0,0,1,h#0,1,1),X); +ref(crop(#0,1,0,0,0,1,h#0,1,1),Y); +ref(crop(#0,2,0,0,0,s,h#0,1,1,1),F); +ref(vector(#h#0^2),M); +repeat (h#0,k, +for (l = 0, l<=k, ++l, +r = norm(X[k] - X[l],Y[k] - Y[l]); +M[k*h#0 + l] = M[l*h#0 + k] = phi(r); +) +); +ref(solve(M,F,s,1),W); +const fx = ("$x1-$x0")/(w-1); +const fy = ("$y1-$y0")/(h-1); +); +ref(vectors(),res); x = (x - "$x0")*fx; y = (y - "$y0")*fy; +repeat (h#0,k, r = norm(x - X[k], y - Y[k]); res+=W[s*k,s]*phi(r)); +res" +k. => $nm +fi } +elif isin($#,3,9,10) # 3D reconstruction +dx,dy,dz,x0,y0,z0,x1,y1,z1=$a1,$a2,$a3,{$#>3?[$a4,$a5,$a6,$a7,$a8,$a9]:[0,0,0,[$a1,$a2,$a3]-1]} +phi_r={`$#>9?['$arg10']:'$default_phi_r'`} +check $dx>0" && "$dy>0" && "$dz>0 +e[^-1] "Reconstruct 3D image from keypoint set$?, with size "$dx,$dy,$dz", ""from ("$x0,$y0,$z0") to ("$x1,$y1,$z1") and phi(r) = "$phi_r. +foreach { nm={n} if !w $dx,$dy,$dz elif whd==1 channels 3,100% r. $dx,$dy,$dz,100% else +r 1,{whd},1,100%,-1 permute. cyzx +$dx,$dy,$dz,{w-3},"* +begin( +phi(r) = ("$phi_r"); +ref(crop(#0,0,0,0,0,1,h#0,1,1),X); +ref(crop(#0,1,0,0,0,1,h#0,1,1),Y); +ref(crop(#0,2,0,0,0,1,h#0,1,1),Z); +ref(crop(#0,3,0,0,0,s,h#0,1,1,1),F); +ref(vector(#h#0^2),M); +repeat (h#0,k, +for (l = 0, l<=k, ++l, +r = norm(X[k] - X[l],Y[k] - Y[l],Z[k] - Z[l]); +M[k*h#0 + l] = M[l*h#0 + k] = phi(r); +) +); +ref(solve(M,F,s,1),W); +const fx = ("$x1-$x0")/(w - 1); +const fy = ("$y1-$y0")/(h - 1); +const fz = ("$z1-$z0")/(d - 1); +); +ref(vectors(),res); x = (x - "$x0")*fx; y = (y - "$y0")*fy; z = (z - "$z0")*fz; +repeat (h#0,k, r = norm(x - X[k], y - Y[k], z - Z[k]); res+=W[s*k,s]*phi(r)); +res" +k. => $nm +fi } +else error[0--2] "Command 'rbf': invalid arguments '$*'." +fi +#@cli red_eye : 0<=_threshold<=100,_smoothness>=0,0<=attenuation<=1 +#@cli : Attenuate red-eye effect in selected images. +#@cli : Default values: 'threshold=75', 'smoothness=3.5' and 'attenuation=0.1'. +#@cli : $ image.jpg +red_eye , +red_eye : skip ${1=75},${2=3.5},${3=0.1} +e[^-1] "Attenuate red-eye effect in image$?, with threshold $1, smoothness $2 and attenuation $3." +to_rgb rgb2ycbcr +foreach { +s c -. 128 +>=. $1% b. $2 sqrt. *. -1 +. 1 +n. $3,1 *[-2,-1] +. 128 a c ycbcr2rgb +} +#@cli remove_hotpixels : _mask_size>0, _threshold[%]>0 +#@cli : Remove hot pixels in selected images. +#@cli : Default values: 'mask_size=3' and 'threshold=10%'. +#@cli : $ image.jpg noise 10,2 +remove_hotpixels , +remove_hotpixels : check ${1=3}>0 skip ${2=10%} +e[^-1] "Remove hot pixels in image$?, with mask size $1 and threshold $2." +foreach { ++median $1 +- abs. >=. $2 +*.. . ==. 0 *[-3,-1] + +} +#@cli remove_pixels : number_of_pixels[%]>=0 +#@cli : Remove specified number of pixels (i.e. set them to 0) from the set of non-zero pixels in selected images. +#@cli : $ image.jpg +remove_pixels 50% +remove_pixels : check "$1>=0" +e[^-1] "Remove $1 of the non-zero pixels in image$?." +foreach { ++norm !=. 0 +N:=is +n:=round(${"is_percent $1"}?$N*$1:$1) +if $n<=0 rm. +elif $n>=$N rm. f 0 +elif $n>int($N/2) +remove_pixels. {$N-$n} ==. 0 * +else +d:=d r 100%,{d*h},1,100%,-1 +100%,1,1,1,x 1,{-2,h},1,1,y +[-2,-1] 1 r[-2,-1] ..,. +*[-2,-1] ... rm... +y[-2,-1] a[-2,-1] x discard. y,0 +do +1,100%,1,1 rand. 0,{h} <=. {$n*1.25} +if is>=$n break else rm. fi +while 1 +r. 2 *[-2,-1] discard. y,0 +i.. 1,100% rand.. 0,1 a[-2,-1] x sort. +,y +rows. 0,{$n-1} -. 1 z. 1,3 +i.. ({'CImg3d'},{h},{h}) +1,100%,1,1,1 1,100%,1,1,y a[-2,-1] x +3,100% 1,100%,1,1,1 y[-5--1] a[-5--1] y +if s#0<=3 j3d.. .,0,0,0,1,0,0,0,0 +else [0],[0],1,1,1 j3d. ..,0,0,0,1,0,0,0,0 *[0,-1] +fi +rm. +r 100%,{h/$d},$d,100%,-1 +fi +} +#@cli rolling_guidance : std_deviation_s[%]>=0,std_deviation_r[%]>=0,_precision>=0 +#@cli : Apply the rolling guidance filter on selected image. +#@cli : Rolling guidance filter is a fast image abstraction filter, described in: +#@cli : "Rolling Guidance Filter", Qi Zhang Xiaoyong, Shen Li, Xu Jiaya Jia, ECCV'2014. +#@cli : Default values: 'std_deviation_s=4', 'std_deviation_r=10' and 'precision=0.5'. +#@cli : $ image.jpg +rolling_guidance , +- +rolling_guidance : check "${1=4}>=0 && ${2=10}>=0 && ${3=0.5}>=0" +e[^-1] "Apply rolling guidance filter on image$?, with standard deviations ($1,$2) and precision $3." +precision:=2^-$3 +foreach { nm={n} ++b $1 +repeat 100 { +if c>1 +norm. +bilateral... .,$1,$2 rm.. +else +bilateral.. .,$1,$2 +fi +-.. . std={-2,id} rm.. +if $std<$precision break fi +} +k. => $nm +} +#@cli sharpen : amplitude>=0 : amplitude>=0,edge>=0,_alpha[%],_sigma[%] +#@cli : Sharpen selected images by inverse diffusion or shock filters methods. +#@cli : 'edge' must be specified to enable shock-filter method. +#@cli : Default values: 'edge=0', 'alpha=0' and 'sigma=0'. +#@cli : $ image.jpg sharpen 300 +#@cli : $ image.jpg blur 5 sharpen 300,1 +sharpen : check "$1>=0 && ${2=0}>=0 && ${3=0}>=0 && ${4=0}>=0" +if $2>0 +e[0--3] "Sharpen image$? with shock filters, amplitude $1, edge $2, alpha $3 and sigma $4." +foreach { +im,iM:=[im,iM] ++b $3 structuretensors. 0 b. $4 eigen. l.. { max 0 s c + + 1 ^ {-0.5*$2} *. -1 +. 1 } +if {0,d>1} ++f[0] "const boundary = 1; +minmod(a,b) = (a*b<=0?0:minabs(a,b)); +u = i(#-1,x,y,z,0); +v = i(#-1,x,y,z,1); +w = i(#-1,x,y,z,2); +amp = i(#-2,x,y,z,0); +Ippp = j(-1,-1,-1); Icpp = j(0,-1,-1); Inpp = j(1,-1,-1); +Ipcp = j(-1,0,-1); Iccp = j(0,0,-1); Incp = j(1,0,-1); +Ipnp = j(-1,1,-1); Icnp = j(0,1,-1); Innp = j(1,1,-1); +Ippc = j(-1,-1,0); Icpc = j(0,-1,0); Inpc = j(1,-1,0); +Ipcc = j(-1,0,0); Iccc = i; Incc = j(1,0,0); +Ipnc = j(-1,1,0); Icnc = j(0,1,0); Innc = j(1,1,0); +Ippn = j(-1,-1,1); Icpn = j(0,-1,1); Inpn = j(1,-1,1); +Ipcn = j(-1,0,1); Iccn = j(0,0,1); Incn = j(1,0,1); +Ipnn = j(-1,1,1); Icnn = j(0,1,1); Innn = j(1,1,1); +ixx = Incc + Ipcc - 2*Iccc; +ixy = 0.25*(Innc + Ippc - Inpc - Ipnc); +ixz = 0.25*(Incn + Ipcp - Incp - Ipcn); +iyy = Icnc + Icpc - 2*Iccc; +iyz = 0.25*(Icnn + Icpp - Icnp - Icpn); +izz = Iccn + Iccp - 2*Iccc; +ixf = Incc - Iccc; +ixb = Iccc - Ipcc; +iyf = Icnc - Iccc; +iyb = Iccc - Icpc; +izf = Iccn - Iccc; +izb = Iccc - Iccp; +itt = u^2*ixx + v^2*iyy + w^2*izz + 2*u*v*ixy + 2*u*w*ixz + 2*v*w*iyz; +it = u*minmod(ixf,ixb) + v*minmod(iyf,iyb) + w*minmod(izf,izb); +amp*sign(itt)*abs(it)" +else ++f[0] "const boundary = 1; +minmod(a,b) = (a*b<=0?0:minabs(a,b)); +u = i(#-1,x,y,z,0); +v = i(#-1,x,y,z,1); +amp = i(#-2,x,y,z,0); +Ipp = j(-1,-1); Icp = j(0,-1); Inp = j(1,-1); +Ipc = j(-1,0); Icc = i; Inc = j(1,0); +Ipn = j(-1,1); Icn = j(0,1); Inn = j(1,1); +ixx = Inc + Ipc - 2*Icc; +ixy = 0.25*(Ipp + Inn - Ipn - Inp); +iyy = Icn + Icp - 2*Icc; +ixf = Inc - Icc; +iyf = Icn - Icc; +ixb = Icc - Ipc; +iyb = Icc - Icp; +itt = u^2*ixx + v^2*iyy + 2*u*v*ixy; +it = y*minmod(ixf,ixb) + v*minmod(iyf,iyb); +amp*sign(itt)*abs(it)" +fi +*. {$1/abs(maxabs(im,iM))} rm[-3,-2] - c $im,$iM +} +else +e[0--3] "Sharpen image$? with inverse diffusion and amplitude $1." +foreach { +im,iM:=[im,iM] +laplacian *. {$1/abs(maxabs(im,iM))} - c $im,$iM +} +fi +#@cli smooth : amplitude[%]>=0,_sharpness>=0,0<=_anisotropy<=1,_alpha[%],_sigma[%],_dl>0,_da>0,_precision>0,_interpolation,_fast_approx={ 0 | 1 } : nb_iterations>=0,_sharpness>=0,_anisotropy,_alpha,_sigma,_dt>0,0 : [tensor_field],_amplitude>=0,_dl>0,_da>0,_precision>0,_interpolation,_fast_approx={ 0 | 1 } : [tensor_field],_nb_iters>=0,_dt>0,0 : (+) +#@cli : Smooth selected images anisotropically using diffusion PDE's, with specified field of +#@cli : diffusion tensors. +#@cli : 'interpolation' can be { 0=nearest | 1=linear | 2=runge-kutta }. +#@cli : Default values: 'sharpness=0.7', 'anisotropy=0.3', 'alpha=0.6', 'sigma=1.1', 'dl=0.8', 'da=30', 'precision=2', 'interpolation=0' and 'fast_approx=1'. +#@cli : $ image.jpg repeat 3 smooth 40,0,1,1,2 done +#@cli : $ image.jpg 100%,100%,1,2 rand[-1] -100,100 repeat 2 smooth[-1] 100,0.2,1,4,4 done warp[0] [-1],1,1,1 +#@cli : $$ https://gmic.eu/oldtutorial/_smooth +#@cli split_freq : smoothness>0[%] +#@cli : Split selected images into low and high frequency parts. +#@cli : $ image.jpg split_freq 2% +split_freq : +e[^-1] "Split image$? into low and high frequency parts, with smoothness $1." +foreach { +b $1 -[0] [1] rv } +#@cli solve_poisson : "laplacian_command",_nb_iterations>=0,_time_step>0,_nb_scales>=0 +#@cli : Solve Poisson equation so that applying 'laplacian[n]' is close to the result of 'laplacian_command[n]'. +#@cli : Solving is performed using a multi-scale gradient descent algorithm. +#@cli : If 'nb_scales=0', the number of scales is automatically determined. +#@cli : Default values: 'nb_iterations=60', 'dt=5' and 'nb_scales=0'. +#@cli : $ image.jpg command "foo : gradient x" +solve_poisson foo +foo[0] +laplacian[1] +solve_poisson : check "${2=60}>=0 && ${3=5}>0 && ${4=0}>=0" +e[^-1] "Solve Poisson equation for image$?, for laplacian command '$1', with $2 iterations, time step $3 and "${arg0\ ($4==0),$4,auto}" scales." +foreach { +[0] +repeat if($4,$4,int(max(log2(max(w,h))-1,1))) { +f={2^$<} +r[1] {0,max(1,w/$f)},{0,max(1,h/$f)},1,100%,3 ++ri[0] [1],2 l. { $1 k[0] } +repeat $2 { +laplacian.. -. .. *. {$3/max(1e-8,abs(im),abs(iM))} +[-3,-1] } +rm. +} +rm[0] +} +#@cli split_details : _nb_scales>0,_base_scale[%]>=0,_detail_scale[%]>=0 +#@cli : Split selected images into 'nb_scales' detail scales. +#@cli : If 'base_scale'=='detail_scale'==0, the image decomposition is done with 'a trous' wavelets. +#@cli : Otherwise, it uses laplacian pyramids with linear standard deviations. +#@cli : Default values: 'nb_scales=4', 'base_scale=0' and 'detail_scale=0'. +#@cli : $ image.jpg split_details , +split_details : check "isint(${1=4}) && $1>0 && ${2=0}>=0 && ${3=0}>=0" +if ($2)==0" && "($3)==0 +e[^-1] "Split image$? using $1 spatial scales and 'a trous' wavelets." +foreach { +repeat $1-1 { ++f. "begin(interpolation = 0; boundary = 1; d = 2^"$>"; d2 = d*2); +i(x - d2) + i(x + d2) + 4*i(x - d) + 4*i(x + d) + 6*i;" +/. 16 +if h>1 +f. "begin(interpolation = 0; boundary = 1; d = 2^"$>"; d2 = d*2); +i(x,y - d2) + i(x,y + d2) + 4*i(x,y - d) + 4*i(x,y + d) + 6*i;" +/. 16 +fi +if d>1 +f. "begin(interpolation = 0; boundary = 1; d = 2^"$>"; d2 = d*2); +i(x,y,z - d2) + i(x,y,z + d2) + 4*i(x,y,z - d) + 4*i(x,y,z + d) + 6*i;" +/. 16 +fi +-.. . +} +rv +} +else +e[^-1] "Split image$? using $1 spatial scales with base scale $2 and detail scale $3." +foreach { +ss={max(0.3,if(${is_percent\ $2},$2*max(w,h),$2))} +se={max(0.3,if(${is_percent\ $3},$3*max(w,h),$3))} +ds={$se-$ss} +repeat $1-1 { +b. {$ss+$>*$ds/max(1,$1-2)} -.. . rv[-2,-1] } +} +fi +#@cli structuretensors : _scheme={ 0=centered | 1=forward/backward } +#@cli : Compute the structure tensor field of selected images. +#@cli : Default value: 'scheme=0'. +#@cli : $ image.jpg structuretensors abs pow 0.2 +#@cli : $$ https://gmic.eu/oldtutorial/_structuretensors +structuretensors : skip "${1=}" +l[] { if "isbool($1)" scheme=$1 else scheme=0 noarg fi onfail scheme=0 noarg } +s0,s1=centered,forward-backward +e[^-1] "Compute structure tensor field of image$?, with "${s$scheme}" scheme." +foreach { +if d>1 +if $scheme ++g xyz,-1 +g[0] xyz,1 sqr[^0] +[1,4] +[2,4] +[3,4] /[^0] 2 +g[0] xyz,0 [2] *. [1] *[2] [0] *[0,1] compose_channels + mv[2] 0 mv. -2 a c +else +g xyz,0 +*[0,1] +*[0,2] +*[1,2] sqr[0-2] compose_channels + mv[3,4] 1 rv[4,5] a c +fi +else +if $scheme ++g xy,-1 +g[0] xy,1 sqr[^0] +[1,3] +[2,3] /[^0] 2 +g[0] xy,0 *[0,1] compose_channels + mv[0] 2 a c +else +g xy,0 +* sqr[0,1] compose_channels + rv[1,2] a c +fi +fi +} +#@cli solidify : _smoothness[%]>=0,_diffusion_type={ 0=isotropic | 1=Delaunay-guided | 2=edge-oriented },_diffusion_iter>=0 +#@cli : Solidify selected transparent images. +#@cli : Default values: 'smoothness=75%', 'diffusion_type=1' and 'diffusion_iter=20'. +#@cli : $ image.jpg 100%,100% circle[-1] 50%,50%,25%,1,255 append c +solidify , display_rgba +solidify : check "${1=75%}>=0 && isint(${2=1}) && $2>=0 && $2<=2 && ${3=20}>=0" +s0="isotropic" s1="Delaunay-guided" s2="edge-oriented" +e[^-1] "Solidify transparent image$? with smoothness $1 and $3 iterations of "${s$2}" diffusion." +foreach { split_opacity if $!>1 <=. 128 inpaint_pde.. [1],${1-3} rm. c 0,255 fi } +#@cli syntexturize : _width[%]>0,_height[%]>0 +#@cli : Resynthetize 'width'x'height' versions of selected micro-textures by phase randomization. +#@cli : The texture synthesis algorithm is a straightforward implementation of the method described in : +#@cli : . +#@cli : Default values: 'width=height=100%'. +#@cli : $ image.jpg crop 2,282,50,328 +syntexturize 320,320 +syntexturize : check "${1=100%}>0 && ${2=$1}>0" +e[^-1] "Resynthetize $1x$2 versions of texture$? by phase randomization." +foreach { +mM={[im,iM]} repeat s { sh. $> sum$>={is} var$>={iv} rm. } +nw={if(${is_percent\ $1},$1*w,$1)} +nh={if(${is_percent\ $2},$2*h,$2)} +repeat s { sum$>*={$nw*$nh/(w*h)} } +if $nw>w||$nh>h +periodize_poisson +100%,100% rectangle. 5,5,{w-6},{h-6},1,1 b. 2 n. 0,1 +$nw,$nh,1,{-2,s} fc. ${average_vectors...} +j. ...,{(w-{-2,w})/2},{(h-{-2,h})/2},0,0,1,.. +rm[-3,-2] +else +r $nw,$nh,1,100%,0,0,0.5,0.5 +periodize_poisson +fi +fft +100%,100% rand. {-pi},{pi} +=. 0 +if !(w%2) =. {(u<0.5)*pi},{int(w/2)} fi +if !(h%2) =. {(u<0.5)*pi},0,{int(h/2)} fi +if !(h%2)&&!(h%2) =. {(u<0.5)*pi},{int(w/2)},{int(h/2)} fi ++sin. cos.. ++*[-4,-1] +*[-4,-3] +[-2,-1] +*[-5,-3] *[-3,-2] -[-3,-2] +repeat s { =.. ${sum$>},0,0,0,$> =. 0,0,0,0,$> } +ifft rm. +repeat s { sh. $> avg={ia} -. $avg *. {sqrt(${var$>}/if(iv,iv,1))} +. $avg rm. } +c $mM +} +#@cli syntexturize_matchpatch : _width[%]>0,_height[%]>0,_nb_scales>=0,_patch_size>0,_blending_size>=0,_precision>=0 +#@cli : Resynthetize 'width'x'height' versions of selected micro-textures using a patch-matching algorithm. +#@cli : If 'nbscales==0', the number of scales used is estimated from the image size. +#@cli : Default values: 'width=height=100%', 'nb_scales=0', 'patch_size=7', 'blending_size=5' and 'precision=1'. +#@cli : $ image.jpg crop 25%,25%,75%,75% syntexturize_matchpatch 512,512 +syntexturize_matchpatch : check "${1=100%}>0 && ${2=$1}>0 && isint(${3=0}) && $3>=0 && isint(${4=7}) && $4>0 && +${5=5}>=0 && ${6=1}>=0" +e[^-1] "Resynthetize $1x$2 version(s) of texture$? using a patch-matching algorithm with "${"if $3 u \"$3 \" else u auto- fi"}"scales, $4x$4 patches, blending size $5 and precision $6." +foreach { +nb_scales={round(if($3,$3,log2(min(w,h)/16)),1,1)} +width={if(${"is_percent $1"},round(w*$1,1,1),$1)} +height={if(${"is_percent $2"},round(h*$2,1,1),$2)} +repeat $nb_scales { +scale={100*(0.5^$<)} ++r[0] $scale%,$scale%,1,3,2 +if !$> +{1+round(w*$width/{0,w},1,1)},{1+round(h*$height/{0,h},1,1)},1,1 +noise. 0.2,2 ==. 1 +distance. 1 *. -1 +label_fg.. 0 watershed.. . rm. +100%,100%,1,1,x +f. y a[-2,-1] c channels. 0,2 ++blend. ..,shapeaverage -.. . rm. +channels. 0,1 +{-2,iM+1} rand. 0,{-4,w} +rand. 0,{-4,h} a[-2,-1] c +map... . rm. +[-2,-1] round. +s. c %.. {-3,w} %. {-3,h} a[-2,-1] c +else +rv[-2,-1] channels. 0,1 +*. 2 r. 200%,200%,1,2,1 +f. "*upc = i(x - 1,y,0,0); +vpc = i(x - 1,y,0,1); +ucp = i(x,y - 1,0,0); +vcp = i(x,y - 1,0,1); +ucc = i(x,y,0,0); +vcc = i(x,y,0,1); +if (ucc==upc && vcc==vpc && c==0, upc + 1, +if (ucc==ucp && vcc==vcp && c==1, vcp + 1,i))" +fi +psize={-2,min(w,h,$4)} +repeat 1+$6*$< { +psynth={int(max(3,$5*$scale%))} ++warp_patch.. .,$psynth +matchpatch. ...,$psize,$psize,1,4,4,0,0,.. rm.. +} +rm.. +} +warp_patch.. .,$5 +rm. r $width,$height,1,100%,0,0,0.5,0.5 +} +_syntexturize_matchpatch : check ${is_image_arg\ $1}" && isint(${2=3}) && $2>=0" +if $2<=1 pass$1 warp[^-1] .,0 rm. +else repeat $! { pass$1 l[$>,-1] { +[1],[1],1,[0] +f. "*begin( +boundary = 1; +const patch_size = $2; +const p2 = int(patch_size/2); +const p1 = patch_size - p2 - 1; +avg = resize([0],s#0); +wpq = resize([0],patch_size^2); +g = 0; +for (q = -p1, q<=p2, ++q, +for (p = -p1, p<=p2, ++p, +wpq[g++] = exp(-(p^2 + q^2)/(2*(0.3*patch_size)^2)); +); +); +); +g = 0; +avg = 0; +norm = 0; +for (q = -p1, q<=p2, ++q, +for (p = -p1, p<=p2, ++p, +U = I(#1,x + p,y + q); +w = wpq[g++]; +avg+=w*I(#0,U - [p,q]); +norm+=w; +); +); +avg/norm" +k. +} } fi +#@cli tv_flow : _nb_iter>=0,_dt,_keep_sequence={ 0 | 1 } +#@cli : Apply iterations of the total variation flow on selected images. +#@cli : Default values: 'nb_iter=10', 'dt=30' and 'keep_sequence=0'. +#@cli : $ image.jpg +tv_flow 40 +tv_flow : skip ${1=10},${2=30},${3=0} +e[^-1] "Apply $1 iterations of the total variation flow on image$?, with time step $2." +pde_flow $1,$2,curvature,$3 +#@cli unsharp : radius[%]>=0,_amount>=0,_threshold[%]>=0 +#@cli : Apply unsharp mask on selected images. +#@cli : Default values: 'amount=2' and 'threshold=0'. +#@cli : $ image.jpg blur 3 +unsharp 1.5,15 cut 0,255 +unsharp : check "${2=2}>=0" skip ${3=0} +e[^-1] "Apply unsharp mask on image$?, with radius $1, amount $2 and threshold $3." +repeat $! { ++b[$>] $1 -. [$>] +if $3 +norm. >=. $3 *[-2,-1] fi +*. $2 -[$>,-1] +} +#@cli unsharp_octave : _nb_scales>0,_radius[%]>=0,_amount>=0,threshold[%]>=0 +#@cli : Apply octave sharpening on selected images. +#@cli : Default values: 'nb_scales=4', 'radius=1', 'amount=2' and 'threshold=0'. +#@cli : $ image.jpg blur 3 +unsharp_octave 4,5,15 cut 0,255 +unsharp_octave : check "${1=4}>0 && ${3=2}>=0" skip ${2=1},${4=0} +e[^-1] "Apply octave sharpening on image$?, with $1 scales, radius $2, amount $3 and threshold $4." +foreach { +nm={n} ++f 0 weight=0 +repeat $1 { ++unsharp[0] {$2*2^-$<},$3,$4 *. {2^-$>} +weight+={2^-$>} ++[1,-1] +} +rm[0] / $weight => $nm +} +#@cli vanvliet : std_deviation>=0[%],order={ 0 | 1 | 2 | 3 },axis={ x | y | z | c },_boundary_conditions : (+) +#@cli : Apply Vanvliet recursive filter on selected images, along specified axis and with +#@cli : specified standard deviation, order and boundary conditions. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default value: 'boundary_conditions=1'. +#@cli : $ image.jpg +vanvliet 3,1,x +#@cli : $ image.jpg +vanvliet 30,0,x vanvliet[-2] 30,0,y add +#@cli voronoi +#@cli : Compute the discrete Voronoi diagram of non-zero pixels in selected images. +#@cli : $ 400,400 noise 0.2,2 eq 1 +label_fg 0 voronoi[-1] +gradient[-1] xy,1 append[-2,-1] c norm[-1] ==[-1] 0 map[-2] 2,2 mul[-2,-1] normalize[-2] 0,255 dilate_circ[-2] 4 reverse max +voronoi : +e[^-1] "Compute the discrete Voronoi diagram of non-zero pixels in image$?." +foreach { +s c +foreach { ++!=. 0 distance. 1 *. -1 +watershed.. . rm. +} +a c +} +#@cli watermark_fourier : text,_size>0 +#@cli : Add a textual watermark in the frequency domain of selected images. +#@cli : Default value: 'size=33'. +#@cli : $ image.jpg +watermark_fourier "Watermarked!" +display_fft remove[-3,-1] normalize 0,255 append[-4,-2] y append[-2,-1] y +watermark_fourier : check ${2=33}>0 +e[^-1] "Add textual watermark '$1' with size $2 in the frequency domain of image$?." +i[0] 0 t[0] "$1",0,0,$2,1,1 >=[0] 0.5 autocrop[0] 0 +repeat $!-1 { +w2={int(w/2)} h2={int(h/2)} +fft. +shift[-2,-1] $w2,$h2,0,0,2 +[0],[0],1,{s} +j[-3,-2] .,3,3,0,0,1,[0] +mirror[0] x +j[-3,-2] .,{{-2,w}-2-{0,w}},3,0,0,1,[0] +mirror[0] y +j[-3,-2] .,{{-2,w}-2-{0,w}},{{-2,h}-2-{0,h}},0,0,1,[0] +mirror[0] x +j[-3,-2] .,3,{{-2,h}-2-{0,h}},0,0,1,[0] +mirror[0] y +rm. +shift[-2,-1] -$w2,-$h2,0,0,2 +ifft[-2,-1] rm. mv. 1 +} +rm[0] +#@cli watershed : [priority_image],_is_high_connectivity={ 0 | 1 } : (+) +#@cli : Compute the watershed transform of selected images. +#@cli : Default value: 'is_high_connectivity=1'. +#@cli : $ 400,400 noise 0.2,2 eq 1 +distance 1 mul[-1] -1 label[-2] watershed[-2] [-1] mod[-2] 256 map[-2] 0 reverse +#@cli :: Features Extraction +#@cli area : tolerance>=0,is_high_connectivity={ 0 | 1 } +#@cli : Compute area of connected components in selected images. +#@cli : Default values: 'is_high_connectivity=0'. +#@cli : $ image.jpg luminance stencil[-1] 1 +area 0 +#@cli : $$ https://gmic.eu/oldtutorial/_area +area : check "$1>=0" skip ${2=0} +e[^-1] "Compute area of connected components in image$?, with tolerance $1 and "${arg0\ !$2,high,low}" connectivity." +foreach { +s c +foreach { label $1,$2 nb:=iM+1 +histogram $nb,0,{$nb-1} map.. . rm. } +a c +} +#@cli area_fg : tolerance>=0,is_high_connectivity={ 0 | 1 } +#@cli : Compute area of connected components for non-zero values in selected images. +#@cli : Similar to 'area' except that 0-valued pixels are not considered. +#@cli : Default values: 'is_high_connectivity=0'. +#@cli : $ image.jpg luminance stencil[-1] 1 +area_fg 0 +area_fg : check "$1>=0" skip ${2=0} +e[^-1] "Compute area of foreground connected components in image$?, with tolerance $1 and "${arg0\ !$2,high,low}" connectivity." +foreach { +s c +repeat $! { label_fg[$>] $1,$2 nb={$>,1+iM} +histogram[$>] $nb,0,{$nb-1} =. 0 map[$>] . rm. } +a c +} +#@cli at_line : x0[%],y0[%],z0[%],x1[%],y1[%],z1[%] +#@cli : Retrieve pixels of the selected images belonging to the specified line (x0,y0,z0)-(x1,y1,z1). +#@cli : $ image.jpg +at_line 0,0,0,100%,100%,0 line[0] 0,0,100%,100%,1,0xFF00FF00,255,0,0 +at_line : check ${7=100%}>=0 +e[^-1] "Retrieve pixels of image$?, belonging to line ($1,$2,$3)-($4,$5,$6)." +foreach { +x0={if(${is_percent\ $1},(w-1)*$1,$1)} +y0={if(${is_percent\ $2},(h-1)*$2,$2)} +z0={if(${is_percent\ $3},(d-1)*$3,$3)} +x1={if(${is_percent\ $4},(w-1)*$4,$4)} +y1={if(${is_percent\ $5},(h-1)*$5,$5)} +z1={if(${is_percent\ $6},(d-1)*$6,$6)} +($x0,$x1^$y0,$y1^$z0,$z1) +r. {1+max(abs($x1-$x0),abs($y1-$y0),abs($z1-$z0))},1,1,3,3 +round. 1 warp[0] .,0,0,0 rm. +} +#@cli at_quadrangle : x0[%],y0[%],x1[%],y1[%],x2[%],y2[%],x3[%],y3[%],_interpolation,_boundary_conditions : x0[%],y0[%],z0[%],x1[%],y1[%],z1[%],x2[%],y2[%],z2[%],x3[%],y3[%],z3[%],_interpolation,_boundary_conditions +#@cli : Retrieve pixels of the selected images belonging to the specified 2D or 3D quadrangle. +#@cli : 'interpolation' can be { 0=nearest-neighbor | 1=linear | 2=cubic }. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : $ image.jpg params=5%,5%,95%,5%,60%,95%,40%,95% +at_quadrangle $params polygon.. 4,$params,0.5,255 +at_quadrangle : check "$#>=8 && $#<=14 && $#!=11" +_at_quadrangle{$#<12?2:3} $* +_at_quadrangle2 : check "${9=1}>=0 && $9<=2 && ${10=0}>=0 && $10<=3" +foreach { +x0={round(${"is_percent $1"}?(w-1)*$1:$1)} +y0={round(${"is_percent $2"}?(h-1)*$2:$2)} +x1={round(${"is_percent $3"}?(w-1)*$3:$3)} +y1={round(${"is_percent $4"}?(h-1)*$4:$4)} +x2={round(${"is_percent $5"}?(w-1)*$5:$5)} +y2={round(${"is_percent $6"}?(h-1)*$6:$6)} +x3={round(${"is_percent $7"}?(w-1)*$7:$7)} +y3={round(${"is_percent $8"}?(h-1)*$8:$8)} +($x0,$x1;$x3,$x2^$y0,$y1;$y3,$y2) +r. {P0=[$x0,$y0];P1=[$x1,$y1];P2=[$x2,$y2];P3=[$x3,$y3];1+round([max(norm(P1-P0),norm(P3-P2)),max(norm(P3-P0),norm(P2-P1))])},1,2,3 +warp.. .,0,$9,$10 rm. +} +_at_quadrangle3 : check "${13=1}>=0 && $13<=2 && ${14=0}>=0 && $14<=3" +foreach { +x0={round(${"is_percent $1"}?(w-1)*$1:$1)} +y0={round(${"is_percent $2"}?(h-1)*$2:$2)} +z0={round(${"is_percent $3"}?(h-1)*$3:$3)} +x1={round(${"is_percent $4"}?(w-1)*$4:$4)} +y1={round(${"is_percent $5"}?(h-1)*$5:$5)} +z1={round(${"is_percent $6"}?(h-1)*$6:$6)} +x2={round(${"is_percent $7"}?(w-1)*$7:$7)} +y2={round(${"is_percent $8"}?(h-1)*$8:$8)} +z2={round(${"is_percent $9"}?(h-1)*$9:$9)} +x3={round(${"is_percent $10"}?(w-1)*$10:$10)} +y3={round(${"is_percent $11"}?(h-1)*$11:$11)} +z3={round(${"is_percent $12"}?(h-1)*$12:$12)} +($x0,$x1;$x3,$x2^$y0,$y1;$y3,$y2^$z0,$z1;$z3,$z2) +r. {P0=[$x0,$y0,$z0];P1=[$x1,$y1,$z1];P2=[$x2,$y2,$z2];P3=[$x3,$y3,$z2];1+round([max(norm(P1-P0),norm(P3-P2)),max(norm(P3-P0),norm(P2-P1))])},1,3,3 +warp.. .,0,$13,$14 rm. +} +#@cli barycenter +#@cli : Compute the barycenter vector of pixel values. +#@cli : $ 256,256 ellipse 50%,50%,20%,20%,0,1,1 deform 20 +barycenter +ellipse[-2] {@0,1},5,5,0,10 +barycenter : +e[^-1] "Compute the barycenter vector of pixel values of image$?." +norm +foreach { +nm={0,b} +sum={is} +if $sum>0 +if d>1 +* 'z' z={is} rm. else z=0 fi +if h>1 +* 'y' y={is} rm. else y=0 fi +* 'x' x={is} rm. +({$x/$sum};{$y/$sum};{$z/$sum}) +else ({w/2},{h/2},{d/2}) rm.. +fi +=> "[barycenter of '"$nm"']" +} +#@cli betti +#@cli : Compute Betti numbers B0,B1 and B2 from selected 3D binary shapes. +#@cli : Values B0,B1 and B2 are returned in the status. When multiple images are selected, the B0,B1,B2 of each image are concatenated in the status. +#@cli : (see 'https://en.wikipedia.org/wiki/Betti_number' for details about Betti numbers). +betti : +e[^-1] "Compute Betti numbers B0,B1 and B2 from binary shape$?." +res,c= +foreach { +{[2*w+1,2*h+1,2*d+1]} +eval.. "*i?( +X = 2*x; Y = 2*y; Z = 2*z; +X1 = X + 1; Y1 = Y + 1; Z1 = Z + 1; +X2 = X + 2; Y2 = Y + 2; Z2 = Z + 2; +i(#-1,X,Y,Z) = i(#-1,X2,Y,Z) = i(#-1,X2,Y2,Z) = i(#-1,X,Y2,Z) = +i(#-1,X,Y,Z2) = i(#-1,X2,Y,Z2) = i(#-1,X2,Y2,Z2) = i(#-1,X,Y2,Z2) = 1; +i(#-1,X1,Y,Z) = i(#-1,X2,Y1,Z) = i(#-1,X1,Y2,Z) = i(#-1,X,Y1,Z) = +i(#-1,X1,Y,Z2) = i(#-1,X2,Y1,Z2) = i(#-1,X1,Y2,Z2) = i(#-1,X,Y1,Z2) = +i(#-1,X,Y,Z1) = i(#-1,X2,Y,Z1) = i(#-1,X,Y2,Z1) = i(#-1,X2,Y2,Z1) = 2; +i(#-1,X1,Y1,Z) = i(#-1,X1,Y1,Z2) = +i(#-1,X1,Y,Z1) = i(#-1,X1,Y2,Z1) = +i(#-1,X,Y1,Z1) = i(#-1,X2,Y1,Z1) = 3; +i(#-1,X1,Y1,Z1) = 4; +)" +histogram. 4,1,4 Xi:=i[0]-i[1]+i[2]-i[3] rm. +expand_xyz. 1,0 ++label. 0,1 {iM+1} eval.. "*i(#-3)?(i[#-1,i] = 1)" B0:=is rm[-2,-1] # Number of connected components ++label. 0,0 {iM+1} eval.. "*!i(#-3) && i?(i[#-1,i] = 1)" B2:=is rm[-2,-1] # Number of cavities +B1:=$B0+$B2-$Xi +shrink_xyz. 1 +res.=$c$B0,$B1,$B2 c=, +} +u $res +#@cli delaunay : _output_type={ 0=image | 1=coordinates/triangles } +#@cli : Generate discrete 2D Delaunay triangulation of non-zero pixels in selected images. +#@cli : Input images must be scalar. +#@cli : Each pixel of the output image is a triplet (a,b,c) meaning the pixel belongs to +#@cli : the Delaunay triangle 'ABC' where 'a','b','c' are the labels of the pixels 'A','B','C'. +#@cli : $ 400,400 rand 32,255 100%,100% noise. 0.4,2 eq. 1 mul +delaunay +#@cli : $ image.jpg 100%,100% noise. 2,2 eq. 1 delaunay. +blend shapeaverage0 +delaunay : skip "${1=0}" +mode=0 if s=['"$1"'];s=='0'||s=='1' mode=$1 else mode=0 noarg fi +s0,s1=image,coordinates +e[^-1] "Generate discrete 2D Delaunay triangulation of non-zero pixels in image$?, in "${s$mode}" mode." +foreach { +bnm={b} nm={n} +1,64,1,2 =. 1,0,100% +f.. "begin(N = 0); I!=0?(da_push([x,y]);++N):0; end(resize(#-1,1,da_size(),1,2,0))" ++neq.. 0 distance. 1 *. -1 watershed... . rm. +1,64,1,3 +eval... " +V = crop(x,y,2,2); +min(V)?( +V[1]==V[0] && V[2]!=V[0] && V[3]!=V[0] && V[3]!=V[2]?( +da_push([ V[0],V[2],V[3] ]); +):(V[2]==V[0] && V[1]!=V[0] && V[3]!=V[0] && V[3]!=V[1]) || +(V[1]==V[2] && V[0]!=V[1] && V[3]!=V[0] && V[3]!=V[1])?( +da_push([ V[0],V[1],V[3] ]); +):(V[3]==V[0] && V[1]!=V[0] && V[2]!=V[0] && V[2]!=V[1]) || +(V[1]==V[3] && V[0]!=V[1] && V[2]!=V[0] && V[2]!=V[1]) || +(V[2]==V[3] && V[0]!=V[1] && V[0]!=V[2] && V[1]!=V[2]) ?( +da_push([ V[0],V[1],V[2] ]); +):V[0]!=V[1] && V[0]!=V[2] && V[0]!=V[3] && V[1]!=V[2] && V[1]!=V[3] && V[2]!=V[3]?( +da_push([ V[0],V[1],V[2] ]); +da_push([ V[1],V[3],V[2] ]); +); +end(resize(#-1,1,da_size(),1,3,0)); +)" +if $mode k[-2,-1] => ${bnm}_points,${bnm}_faces +else {0,[w,h,1,3]} eval.. "polygon(#-1,3,I[#1,i0],I[#1,i1],I[#1,i2],1,i0,i1,i2)" k. => $nm fi +} +#@cli detect_skin : 0<=tolerance<=1,_skin_x,_skin_y,_skin_radius>=0 +#@cli : Detect skin in selected color images and output an appartenance probability map. +#@cli : Detection is performed using CbCr chromaticity data of skin pixels. +#@cli : If arguments 'skin_x', 'skin_y' and 'skin_radius' are provided, skin pixels are learnt +#@cli : from the sample pixels inside the circle located at ('skin_x','skin_y') with radius 'skin_radius'. +#@cli : Default value: 'tolerance=0.5' and 'skin_x=skiny=radius=-1'. +detect_skin : check "${1=0.5}>=0 && $1<=1" skip ${2=-1},${3=-1},${4=-1} +if $2<0||$3<=0||$4<=0 +e[0--3] "Detect skin in image$?, using tolerance $1." +m0=120.9292108800069 +m1=142.5745272918084 +A=0.09749985486268997 +B=0.06388871371746063 +C=0.05250053107738495 +to_rgb srgb2rgb rgb2ycbcr channels 1,2 +foreach { +whd={w},{h},{d} r {w*h*d},2,1,1,-1 +s y -[0] $m0 -[1] $m1 a y +i[0] ($A,$B;$B,$C) +m* rm[0] +* s y + *. {$1-1} exp. +r $whd,1,-1 +} +else +e[0--3] "Detect skin in image$?, using tolerance $1 and target circle at ($2,$3) with radius $4." +to_rgb srgb2rgb rgb2ycbcr channels 1,2 +foreach { +100%,100% circle[1] $2,$3,$4,1,1 +f[1] 'if(i,y,-1)' f[1] 'if(i,x,-1)' discard[1,2] -1 a[1,2] c ++warp[0] [1],0,0,1 rm[1] +s[1] c +m0={1,ia} -[1] $m0 +m1={2,ia} -[2] $m1 +M={h} a[1,2] x +transpose[1] rv[1,2] m*[1,2] /[1] $M invert[1] +rv whd={w},{h},{d} r[1] {w*h*d},2,1,1,-1 +s[1] y -[1] $m0 -[2] $m1 a[1,2] y +m* rm[0] +* s y + *. {$1-1} exp. +r $whd,1,-1 +} +fi +#@cli displacement : [source_image],_smoothness,_precision>=0,_nb_scales>=0,_iteration_max>=0,is_backward={ 0 | 1 },_[guide] : (+) +#@cli : Estimate displacement field between specified source and selected target images. +#@cli : If 'smoothness>=0', regularization type is set to isotropic, else to anisotropic. +#@cli : If 'nbscales==0', the number of scales used is estimated from the image size. +#@cli : Default values: 'smoothness=0.1', 'precision=5', 'nb_scales=0', 'iteration_max=10000', 'is_backward=1' and '[guide]=(unused)'. +#@cli : $ image.jpg +rotate 3,1,0,50%,50% +displacement[-1] [-2] quiver[-1] [-1],15,1,1,1,{1.5*iM} +#@cli distance : isovalue[%],_metric : isovalue[%],[metric],_method : (+) +#@cli : Compute the unsigned distance function to specified isovalue, opt. according to a custom metric. +#@cli : 'metric' can be { 0=chebyshev | 1=manhattan | 2=euclidean | 3=squared-euclidean }. +#@cli : 'method' can be { 0=fast-marching | 1=low-connectivity dijkstra | 2=high-connectivity dijkstra | 3=1+return path | 4=2+return path }. +#@cli : Default value: 'metric=2' and 'method=0'. +#@cli : $ image.jpg threshold 20% distance 0 pow 0.3 +#@cli : $ 400,400 set 1,50%,50% +distance[0] 1,2 +distance[0] 1,1 distance[0] 1,0 mod 32 threshold 16 append c +#@cli : $$ https://gmic.eu/oldtutorial/_distance +#@cli fftpolar +#@cli : Compute fourier transform of selected images, as centered magnitude/phase images. +#@cli : $ image.jpg fftpolar ellipse 50%,50%,10,10,0,1,0 ifftpolar +fftpolar : +e[^-1] "Compute fourier transform of image$?, as centered magnitude/phase images." +foreach { fft complex2polar shift {-round(w/2)},{-round(h/2)},{-round(d/2)},0,2 } +#@cli histogram : nb_levels>0[%],_min_value[%],_max_value[%] : (+) +#@cli : Compute the histogram of selected images. +#@cli : If value range is set, the histogram is estimated only for pixels in the specified +#@cli : value range. Argument 'max_value' must be specified if 'min_value' is set. +#@cli : Default values: 'min_value=0%' and 'max_value=100%'. +#@cli : $ image.jpg +histogram 64 display_graph[-1] 400,300,3 +#@cli histogram_nd : nb_levels>0[%],_value0[%],_value1[%] +#@cli : Compute the 1D,2D or 3D histogram of selected multi-channels images (having 1,2 or 3 channels). +#@cli : If value range is set, the histogram is estimated only for pixels in the specified +#@cli : value range. +#@cli : Default values: 'value0=0%' and 'value1=100%'. +#@cli : $ image.jpg channels 0,1 +histogram_nd 256 +histogram_nd : check $1>0 skip ${2=0%},${3=100%} +e[^-1] "Compute histogram of multi-channels image$?, using $1 levels in range [$1,$2]." +percent_nblevels=${"is_percent $1"} +percent_min=${"is_percent $2"} +percent_max=${"is_percent $3"} +foreach { +s={s} +r {w*h*d},{min(3,s)},1,1,-1 +vmin=$2 vmax=$3 +if $percent_min||$percent_max +im={im} iM={iM} +vmin={if($percent_min,$im+($iM-$im)*$2,$2)} +vmax={if($percent_max,$im+($iM-$im)*$3,$3)} +fi +dv={$vmax-$vmin} +nb_levels={max(1,round(if($percent_nblevels,$1*(1+$vmax-$vmin),$1)))} +f 'if(i>=$vmin&&i<=$vmax,if(i==$vmax,$nb_levels-1,int((i-$vmin)*$nb_levels/($vmax-$vmin))),-1)' +pointcloud 1,$nb_levels,{if($s>1,$nb_levels,1)},{if($s>2,$nb_levels,1)} +} +#@cli histogram_cumul : _nb_levels>0,_is_normalized={ 0 | 1 },_val0[%],_val1[%] +#@cli : Compute cumulative histogram of selected images. +#@cli : Default values: 'nb_levels=256', 'is_normalized=0', 'val0=0%' and 'val1=100%'. +#@cli : $ image.jpg +histogram_cumul 256 histogram[0] 256 display_graph 400,300,3 +histogram_cumul : check ${1=256}>0 skip ${2=0},${3=0%},${4=100%} +arg0 !$2,"normalized ","" +e[^-1] "Compute "${}"cumulative histogram of image$?, using $1 levels." +histogram $1,$3,$4 cumulate if $2 repeat $! { /[$>] {$>,iM} } fi +#@cli histogram_pointwise : nb_levels>0[%],_value0[%],_value1[%] +#@cli : Compute the histogram of each vector-valued point of selected images. +#@cli : If value range is set, the histogram is estimated only for values in the specified +#@cli : value range. +#@cli : Default values: 'value0=0%' and 'value1=100%'. +histogram_pointwise : skip ${2=0%},${3=100%} +e[^-1] "Compute the pointwise histogram of vector-valued points in image$?, with $1 levels." +foreach { +nm={n} +nb_levels={round(if(${is_percent\ $1},(iM-im)*$1,$1))} +value0={if(${is_percent\ $2},im+(iM-im)*$2,$2)} +value1={if(${is_percent\ $3},im+(iM-im)*$3,$3)} +- $value0 * {$nb_levels/max(1,abs($value1-$value0))} c 0,{$nb_levels-1} round +w={w} h={h} d={d} r {w*h*d},{s},1,1,-1 +i.. (0,{w-1}) r.. .,.,1,1,3 round.. +r[-2,-1] 300%,100%,1,1,4 shift. 1 +[-2,-1] y. +i.. ({'CImg3d'},{h/3},{h/3}) +(1,0;1,{h/3-1}) r. 2,{-2,h/3},1,1,3 round. +3,100%,1,1,1 1,100%,1,1,-1 y[-5,-3,-2] a[-5--1] y +{$w*$h*$d},$nb_levels j3d. ..,0,0,0,1,0,0,0 rm.. +r $w,$h,$d,$nb_levels,-1 => $nm +} +#@cli hough : _width>0,_height>0,gradient_norm_voting={ 0 | 1 } +#@cli : Compute hough transform (theta,rho) of selected images. +#@cli : Default values: 'width=512', 'height=width' and 'gradient_norm_voting=1'. +#@cli : $ image.jpg +blur 1.5 hough[-1] 400,400 blur[-1] 0.5 add[-1] 1 log[-1] +hough : check "${1=512}>0 && ${2=$1}>0" skip ${3=1} +e[^-1] "Compute $1x$2 hough transform of image$?, "${arg0\ !$3,with,without}" gradient norm voting." +slices 50% luminance +foreach { +nm={n} +rhomax={sqrt(w^2+h^2)/2} +g (0,{w-1}) (0;{{-2,h}-1}) r[-2,-1] {-3,w},{-3,h},1,1,3 -.. {w/2} -. {h/2} +complex2polar[-4--1] -. ... polar2complex[-2,-1] rm. ++<. 0 *. {pi} +[-3,-1] abs. %.. {2*pi} +*. {$2/$rhomax} *.. {0.5*$1/pi} +y[-3--1] x {w} mv[-4] $! if !$3 f. 1 fi +a y pointcloud 1 r $1,$2,1,1,0 => $nm +} +#@cli ifftpolar +#@cli : Compute inverse fourier transform of selected images, from centered magnitude/phase images. +ifftpolar : +e[^-1] "Compute inverse fourier transform of image$?, from centered magnitude/phase images." +repeat int($!/2) { l[$>,{$>+1}] { +shift {round(w/2)},{round(h/2)},{round(d/2)},0,2 polar2complex ifft rm. +} } +#@cli img2patches : patch_size>0,_overlap[%]>0,_boundary_conditions +#@cli : Decompose selected 2D images into (possibly overlapping) patches and stack them along the z-axis. +#@cli : 'overlap' must be in range '[0,patch_size-1]'. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default values: 'overlap=0' and 'boundary_conditions=0'. +#@cli : See also: ''patches2img''. +#@cli : $ image.jpg img2patches 64 +img2patches : check "isint($1) && $1>0 && ${2=0}>=0 && isint(${3=0}) && $3>=0 && $3<=3" +e[^-1] "Decompose 2D images$? as $1x$1 patch-image, with overlap $2." +foreach { +if d>1 error[0--4] "Command 'img2patches': Image ["$>"] is not a 2D image (size: "{[w,h,d,s]}")." fi +nm={n} psiz=$1 +if ${"is_percent $2"} overlap:=round(lerp(0,$psiz-1,$2)) else overlap:=int($2) fi +if $overlap<0" || "$overlap>=$psiz +error[0--4] "Command 'img2patches': Specified overlap $2 (value: "$overlap") is larger than ""patch size (value: "$psiz")." +fi +step:=$psiz-$overlap +Nw,Nh:=round([w,h]/$step,1,1) +$1,$1,{$Nw*$Nh},100% +eval.. "* +begin(ret = vector(#s); const boundary = $3); +(x%$step) + (y%$step)==0?( +P = crop(x,y,$psiz,$psiz); +ind = (y*$Nw + x)/$step; +draw(#1,P,0,0,ind,0,$psiz,$psiz,1,s); +); +ret" +k. => $nm +} +#@cli isophotes : _nb_levels>0 +#@cli : Render isophotes of selected images on a transparent background. +#@cli : Default value: 'nb_levels=64' +#@cli : $ image.jpg blur 2 isophotes 6 dilate_circ 5 display_rgba +isophotes : skip ${1=64} +e[^-1] "Render isophote maps from images$?, with $1 levels." +to_rgba +foreach { ++luminance repeat $1 { +isoline3d[1] {$>*255/($1-1)} } rm[1] +3d[^0] col3d. 1 +[0],[0] j3d. ..,0,0,0,1,0,0,0 rm.. * +} +#@cli label : _tolerance>=0,is_high_connectivity={ 0 | 1 },_is_L2_norm={ 0 | 1 } : (+) +#@cli : Label connected components in selected images. +#@cli : Default values: 'tolerance=0', 'is_high_connectivity=0' and 'is_L2_norm=1'. +#@cli : $ image.jpg luminance threshold 60% label normalize 0,255 map 0 +#@cli : $ 400,400 set 1,50%,50% distance 1 mod 16 threshold 8 label mod 255 map 2 +#@cli : $$ https://gmic.eu/oldtutorial/_label +#@cli label_fg : tolerance>=0,is_high_connectivity={ 0 | 1 } +#@cli : Label connected components for non-zero values (foreground) in selected images. +#@cli : Similar to 'label' except that 0-valued pixels are not labeled. +#@cli : Default value: 'is_high_connectivity=0'. +label_fg : check "$1>=0" skip ${2=0} +e[^-1] "Label foreground connected components on image [1], with tolerance $1 and "${arg0\ !$2,high,low}" connectivity." +foreach { +if d>1 +z -1,-1,-1,100%,100%,100% label. $1,$2 z. 1,1,1,100%,100%,100% +else +z -1,-1,100%,100% label. $1,$2 z. 1,1,100%,100% +fi +norm.. !=.. 0 * +histogram {1+iM} =. 0 +>. 0 cumulate. map.. . rm. +} +#@cli laar +#@cli : Extract the largest axis-aligned rectangle in non-zero areas of selected images. +#@cli : Rectangle coordinates are returned in status, as a sequence of numbers x0,y0,x1,y1. +#@cli : $ shape_cupid 256 coords=${-laar} normalize 0,255 to_rgb rectangle $coords,0.5,0,128,0 +laar : +e[^-1] "Extract the largest axis-aligned rectangle in non-zero areas of image$?." +res= sep= +foreach { ++channels 0 gt. 0 => shape ++cumulate[shape] xy => cumul +val={i[-1,2]} +if !$val res.=-1,-1,-1,-1 +elif $val==wh res.=0,0,{[w,h]-1} +else +Rin,Rout=0,{min(w,h)+1} +P0,P= +do +Rmid={int(($Rin+$Rout)/2)} +Q=${_laar\ $Rmid,$Rmid,$P} +if narg($Q) Rin=$Rmid P0=$Q P=$Q else Rout=$Rmid P= fi +while $Rin!=$Rout-1 +if $Rin==1 P=${_laar\ 1,1} fi +maxA,maxW,maxH=0 maxcoords= +P=$P0 W,H=$Rin +for $H>0 { +A={$W*$H} if $A>$maxA maxA,maxW,maxH=$A,$W,$H maxP={[$P][0,2]} fi +nW={$W+1} +Q=${_laar\ $nW,$H,$P} +if narg($Q) W=$nW P=$Q +elif $H>1 +pH={$H-1} +Q=${_laar\ $nW,$pH} +if narg($Q) W,H=$nW,$pH P=$Q +else H-=2 P= +fi +else break +fi +} +P=$P0 W,H=$Rin +for $W>0 { +A={$W*$H} if $A>$maxA maxA,maxW,maxH=$A,$W,$H maxP={[$P][0,2]} fi +nH={$H+1} +Q=${_laar\ $W,$nH,$P} +if narg($Q) H=$nH P=$Q +elif $W>1 +pW={$W-1} +Q=${_laar\ $pW,$nH} +if narg($Q) W,H=$pW,$nH P=$Q +else W-=2 P= +fi +else break +fi +} +res.=$sep$maxP,{[$maxP]+[$maxW,$maxH]-1} sep=, +fi +rm[shape,cumul] +} +u $res +_laar : skip "${3=}" +fn="cumul(x0,y0,x1,y1) = ( +_px0 = x0 - 1; +_py0 = y0 - 1; +i(#"$cumul,"x1,y1) + i(#"$cumul",_px0,_py0) - i(#"$cumul",x1,_py0) - i(#"$cumul",_px0,y1); +);" +res= +if narg($3) +(${3--1}) r. 2,{w/2},1,1,-1 s. x a[-2,-1] c +f. ${fn}"x1 = i0 + $1 - 1; y1 = i1 + $2 - 1; +i(#"$shape",i0,i1) && x1=1 +#@cli : Return locations of maximal values in local patch-based neighborhood of given size for selected images. +#@cli : Default value: 'patch_size=16'. +#@cli : $ image.jpg norm +max_patch 16 +max_patch : check "isint(${1=16}) && $1>=1" +e[^-1] "Return locations of maximal values in local patch neighborhood of size $1, in image$?." +repeat $! { +dilate[$>] $1 ==[$>,-1] } +#@cli min_patch : _patch_size>=1 +#@cli : Return locations of minimal values in local patch-based neighborhood of given size for selected images. +#@cli : Default value: 'patch_size=16'. +#@cli : $ image.jpg norm +min_patch 16 +min_patch : check "isint(${1=16}) && $1>=1" +e[^-1] "Return locations of minimal values in local patch neighborhood of size $1, in image$?." +repeat $! { +erode[$>] $1 ==[$>,-1] } +#@cli minimal_path : x0[%]>=0,y0[%]>=0,z0[%]>=0,x1[%]>=0,y1[%]>=0,z1[%]>=0,_is_high_connectivity={ 0 | 1 } +#@cli : Compute minimal path between two points on selected potential maps. +#@cli : Default value: 'is_high_connectivity=0'. +#@cli : $ image.jpg +gradient_norm fill[-1] 1/(1+i) minimal_path[-1] 0,0,0,100%,100%,0 pointcloud[-1] 0 *[-1] 280 to_rgb[-1] ri[-1] [-2],0 or +minimal_path : check "$1>=0 && $2>=0 && $3>=0" skip ${7=0} +e[^-1] "Compute minimal path between points ($1,$2,$3) and ($4,$5,$6) for potential map$?, with "${arg0\ $7,low,high}" connectivity." +foreach { +nm={n} +- {im} + {iM/100} +100%,100% = 1,${4-6} distance. 1,[0],{if($7,4,3)} k. channels. 1 +i[0] 0 +eval " +is_percent(str) = (unref(_is_pct); _is_pct=['#str']; _is_pct[size(_is_pct) - 1]==_'%'); +x = round(is_percent($1)?$1*(w - 1):$1); +y = round(is_percent($2)?$2*(h - 1):$2); +z = round(is_percent($3)?$3*(d - 1):$3); +da_push(#0,[x,y,z]); +do ( +p = i(x,y,z); +p&1?--x:p&2?++x; +p&4?--y:p&8?++y; +p&16?--z:p&32?++z; +da_push(#0,[x,y,z]), +_(while) p); +resize(#0,1,da_size(#0),1,3,0)" +rm. => $nm +} +#@cli mse : [reference] +#@cli : Return the MSE (Mean-Squared Error) between selected images and specified reference image. +#@cli : This command does not modify the images. It returns a value or a list of values in the status. +mse : +e[^-1] "Compute MSE between image$? and reference image $1." +pass$1 1 +_mse[^-1] . rm. ++mse : +e[^-1] "Compute MSE between image$? and reference image $1." +pass$1 1 +_mse[^-1] . rm. ++_mse : check ${"is_image_arg $1"} +rep,sep= +pass$1 1 ++foreach[^-1] { +pass. 1 +if [w#0,h#0,d#0,s#0]!=[w#1,h#1,d#1,s#1] +error[0--5] "Command 'mse': Image dimensions ("{0,[w,h,d,s]}") and ("{1,[w,h,d,s]}") do not match." +fi +- sqr res.=$sep{ia} sep=, rm +} +rm. u $res +#@cli mse_matrix +#@cli : Compute MSE (Mean-Squared Error) matrix between selected images. +#@cli : $ image.jpg +noise 30 +noise[0] 35 +noise[0] 38 cut. 0,255 +mse_matrix +mse_matrix : +e[^-1] "Compute the "$!x$!" matrix of MSE values, for image$?." ++mse_matrix k. ++mse_matrix : +e[^-1] "Compute the "$!x$!" matrix of MSE values, for images$?." +N=$! $N,$N +repeat $N { i=$> +j:=$i+1 for $j<$N { ++mse[$i] [$j] =. ${},$i,$j =. ${},$j,$i +j+=1 +} +} +#@cli patches2img : width>0,height>0,_overlap[%]>0,_overlap_std[%] +#@cli : Recompose 2D images from their selected patch representations. +#@cli : 'overlap' must be in range '[0,patch_size-1]' where 'patch_size' is the width/height of the selected image. +#@cli : 'overlap_std' is the standard deviation of the gaussian weights used for reconstructing overlapping patches. +#@cli : If 'overlap_std' is set to '-1', uniform weights are used rather than gaussian. +#@cli : Default value: 'overlap=0' and 'overlap_std=-1'. +#@cli : See also: ''img2patches''. +#@cli : $ image.jpg +img2patches 32,0,3 mirror[-1] xy patches2img[-1] {0,[w,h]} +patches2img : check "isint($1) && $1>0 && isint($2) && $2>0 && ${3=0}>=0 && (${4=-1}==-1 || $4>=0)" +e[^-1] "Recompose 2D images from patch-image$?, with size ($1,$2), overlap $3 and overlap_std $4." +foreach { +if w!=h error[0--4] "Command 'patches2img': Image "[$>]" is not a patch-image (size: "{[w,h,d,s]}")." fi +nm={n} psiz:=w W,H:=${1,2} +if ${"is_percent $3"} overlap:=round(lerp(0,$psiz-1,$3)) else overlap:=int($3) fi +if $overlap<0" || "$overlap>=$psiz +error[0--4] "Command 'patches2img': Specified overlap $3 (value: "$overlap") is larger than ""patch size (value: "$psiz")." +fi +step:=$psiz-$overlap +Nw,Nh:=round([$W,$H]/$step,1,1) +$W,$H,1,100% +if $overlap +$psiz,$psiz if $4==-1 f. 1 else gaussian. $4 n. 1e-8,1 fi store. weights +$W,$H,1,1,1e-5 +1,1,[0],1,"> +begin(M = get('weights',$psiz*$psiz)); +P = crop(#0,0,0,z,$psiz,$psiz,1); +X = $step*(z%$Nw); +Y = $step*int(z/$Nw); +draw(#1,P,X,Y,0,0,$psiz,$psiz,1,s#0,-1,M); +draw(#2,M,X,Y,0,0,$psiz,$psiz,1,1,-1)" +/[-3,-2] +else +1,1,[0],1,"* +P = crop(#0,0,0,z,w#0,h#0,1); +X = $step*(z%$Nw); +Y = $step*int(z/$Nw); +draw(#1,P,X,Y,0,0,w#0,h#0,1,s#0)" +fi +k.. => $nm +} +#@cli patches : patch_width>0,patch_height>0,patch_depth>0,x0,y0,z0,_x1,_y1,_z1,...,_xN,_yN,_zN +#@cli : Extract N+1 patches from selected images, centered at specified locations. +#@cli : $ image.jpg +patches 64,64,1,153,124,0,184,240,0,217,126,0,275,38,0 +patches : check "isint($1) && $1>0 && isint($2) && $2>0 && isint($3) && $3>0" +e[^-1] "Extract $1x$2x$3 patches from image$?, at locations (${4--1})." +(${4--1}) r. 3,{w/3},1,1,-1 permute. yzcx N={w} +H={int(sqrt(w))} W={round(w/$H,1,1)} r. {$W*$H},1,1,3,0 r. $W,$H,1,3,-1 +r. {w*$1},{h*$2},{d*$3} +$1,$2,$3,1,x-{int($1/2)} +f. y-{int($2/2)} +f. z-{int($3/2)} a[-3--1] c ri. ..,0,2 +[-2,-1] +repeat $!-1 { warp[$>] .,0,0,0 } rm. +foreach { s y,$H s x,$W k[0-{$N-1}] } +#@cli matchpatch : [patch_image],patch_width>=1,_patch_height>=1,_patch_depth>=1,_nb_iterations>=0,_nb_randoms>=0,_patch_penalization,_output_score={ 0 | 1 },_[guide] : (+) +#@cli : Estimate correspondence map between selected images and specified patch image, using +#@cli : a patch-matching algorithm. +#@cli : Each pixel of the returned correspondence map gives the location (p,q) of the closest patch in +#@cli : the specified patch image. If 'output_score=1', the third channel also gives the corresponding +#@cli : matching score for each patch as well. +#@cli : If 'patch_penalization' is >=0, SSD is penalized with patch occurrences. +#@cli : If 'patch_penalization' is <0, SSD is inf-penalized when distance between patches are less than '-patch_penalization'. +#@cli : Default values: 'patch_height=patch_width', 'patch_depth=1', 'nb_iterations=5', 'nb_randoms=5', 'patch_penalization=0', 'output_score=0' and 'guide=(undefined)'. +#@cli : $ image.jpg sample colorful +matchpatch[0] [1],3 +warp[-2] [-1],0 +#@cli plot2value +#@cli : Retrieve values from selected 2D graph plots. +#@cli : $ 400,300,1,1,'if(y>300*abs(cos(x/10+2*u)),1,0)' +plot2value +display_graph[-1] 400,300 +plot2value : +e[^-1] "Retrieve values from 2D graph plot$?." +foreach { +s c >= 50% +foreach { (1,{w}) ri[1] [0],3 * histogram {w},1,{w} } +a c +} +#@cli pointcloud : _type = { -X=-X-opacity | 0=binary | 1=cumulative | 2=label | 3=retrieve coordinates },_width,_height>0,_depth>0 +#@cli : Render a set of point coordinates, as a point cloud in a 1D/2D or 3D binary image +#@cli : (or do the reverse, i.e. retrieve coordinates of non-zero points from a rendered point cloud). +#@cli : Input point coordinates can be a NxMx1x1, Nx1x1xM or 1xNx1xM image, where 'N' is the number of points, +#@cli : and M the point coordinates. +#@cli : If 'M'>3, the 3-to-M components sets the (M-3)-dimensional color at each point. +#@cli : Parameters 'width','height' and 'depth' are related to the size of the final image : +#@cli : - If set to 0, the size is automatically set along the specified axis. +#@cli : - If set to N>0, the size along the specified axis is N. +#@cli : - If set to N<0, the size along the specified axis is at most N. +#@cli : Points with coordinates that are negative or higher than specified ('width','height','depth') +#@cli : are not plotted. +#@cli : Default values: 'type=0' and 'max_width=max_height=max_depth=0'. +#@cli : $ 3000,2 rand 0,400 +pointcloud 0 dilate[-1] 3 +#@cli : $ 3000,2 rand 0,400 {w} {w},3 rand[-1] 0,255 append y +pointcloud 0 dilate[-1] 3 +pointcloud : check "${1=0}<=3 && ${2=0}>=0 && ${3=0}>=0 && ${4=0}>=0" +e[^-1] "Convert image$? to point clouds, in "${arg\ 2+($1>=0)*$1-($1<0),{-$1}-opacity,binary,cumulative,labeling}" mode, with dimensions $2x$3x$4." +foreach { +nm={n} +if $1!=3 +if "d>1 || (w>1 && h>1 && s>1)" +error "Command '$0': Invalid input image "{w}x{h}x{d}x{s}". Should be NxMx1x1, Nx1x1xM or 1xNx1xM." +fi +if "w>1 && h>1 && s==1" r 100%,1,1,{h},-1 +elif "w==1 && h>1 && s>1" r {h},1,1,{s},-1 +fi +if s<3 channels 0,2 fi +if s<4 100%,1,1,1,1 a[-2,-1] c fi +sh. 0 round. siz_x={!$2?iM+1:$2} +sh.. 1 round. siz_y={!$3?iM+1:$3} +sh... 2 round. siz_z={!$4?iM+1:$4} +rm[-3--1] +$siz_x,$siz_y,$siz_z,{$1!=2?s-3:1} +if $1<0 +f.. ">V = I; P = V[0,3]; C = V[3,size(V) - 3]; I(#-1,P) = (1+$1)*I(#-1,P) - $1*C; V" +elif $1==0 +f.. ">V = I; P = V[0,3]; C = V[3,size(V) - 3]; I(#-1,P) = C; V" +elif $1==1 +f.. ">V = I; P = V[0,3]; C = V[3,size(V) - 3]; I(#-1,P) += C; V" +else +f.. ">begin(l = 0); V = I; P = V[0,3]; C = V[3,size(V) - 3]; I(#-1,P) = ++l; V" +fi +else +16,1,1,{s+3} +f.. "> +begin(N = 0; zero = vectors(0)); +I!=zero?I[#-1,N++] = [ x,y,z,I ]; +N>=w(#-1)?resize(#-1,1.5*w(#-1),1,1,s#-1,0); +end(resize(#-1,N,1,1,s#-1,0)); +I" +fi +k. => $nm +} +#@cli psnr : [reference],_max_value>0 +#@cli : Return PSNR (Peak Signal-to-Noise Ratio) between selected images and specified reference image. +#@cli : This command does not modify the images. It returns a value or a list of values in the status. +#@cli : Default value: 'max_value=255'. +psnr : check ${"is_image_arg $1"}" && ${2=255}>0" +e[^-1] "Compute PSNR between image$? and reference image $1, with max value $2." +pass$1 1 +_psnr[^-1] .,$2 rm. ++psnr : check ${"is_image_arg $1"}" && ${2=255}>0" +e[^-1] "Compute PSNR between image$? and reference image $1, with max value $2." +pass$1 1 +_psnr[^-1] .,$2 rm. ++_psnr : check ${"is_image_arg $1"}" && ${2=255}>0" +rep,sep= +pass$1 1 ++foreach[^-1] { +pass. 1 +if [w#0,h#0,d#0,s#0]!=[w#1,h#1,d#1,s#1] +error[0--5] "Command 'psnr': Image dimensions ("{0,[w,h,d,s]}") and ("{1,[w,h,d,s]}") do not match." +fi +- sqr res.=$sep{"const m2 = ($2)^2; 10*log10(m2/ia)"} sep=, rm +} +rm. u $res +#@cli psnr_matrix : _max_value>0 +#@cli : Compute PSNR (Peak Signal-to-Noise Ratio) matrix between selected images. +#@cli : Default value: 'max_value=255'. +#@cli : $ image.jpg +noise 30 +noise[0] 35 +noise[0] 38 cut. 0,255 +psnr_matrix +psnr_matrix : check "${1=255}>0" +e[^-1] "Compute the "$!x$!" matrix of PSNR values, for image$?, with max value $1." ++psnr_matrix $1 k. ++psnr_matrix : check "${1=255}>0" +e[^-1] "Compute the "$!x$!" matrix of PSNR values, for images$?, with max value $1." +N=$! $N,$N +repeat $N { i=$> +j:=$i+1 for $j<$N { ++psnr[$i] [$j],$1 =. ${},$i,$j =. ${},$j,$i +j+=1 +} +=. inf,$i,$i +} +#@cli segment_watershed : _threshold>=0 +#@cli : Apply watershed segmentation on selected images. +#@cli : Default values: 'threshold=2'. +#@cli : $ image.jpg segment_watershed 2 +segment_watershed : check "${1=2}>=0" +e[^-1] "Apply watershed segmentation on image$?, with edge threshold $1." +foreach { +min={im} ++ {1+$min} +gradient_norm ++f. "i<$1 && i=0,0<=_weight_std_max_avg<=1,_dilation,_smoothness>=0 +#@cli : Estimate bumpmap from binary shape in selected images. +#@cli : Default value: 'resolution=256', 'weight_std_max=0.75', 'dilation=0' and 'smoothness=100'. +shape2bump : check "isint(${1=256}) && $1>=0 && ${2=0.75}>=0 && $2<=1 && isnum(${3=0}) && ${4=100}>=0" +e[^-1] "Estimate bumpmap from binary shape in image$?, using "${"if $1 u \"resolution $1\" else u \"full resolution\" fi"}", avg/max weight $2, dilation $3 +and smoothness $4." +foreach { +slices 0 channels 100% > 0 siz={[w,h]} +distance 0 + $3 ++f. "const boundary = 1; +(i>j(-1)&&i>j(1)) || (i>j(0,-1)&&i>j(0,1)) || (i>j(-1,-1)&&i>j(1,1)) || (i>j(-1,1)&&i>j(1,-1))" +is_resized=0 +if $1" && "max(w,h)>$1 rr2d $1,$1,0,2 gt. 0 thinning. 1 *.. {$1/max([$siz])} is_resized=1 fi +rmax={0,iM} +[0],[0] +if $2>0 +eval[1] ":i?( +r = i(#0,x,y); +ir = floor(r); +r2 = r^2; +for (q = -ir, q<=ir, ++q, +Y = y + q; +for (p = -ir, p<=ir, ++p, +X = x + p; +dist = norm(p,q); +dist=0 && $1<=1)" +if isnum($1) bc=$1 else bc=1 noarg fi +e[^-1] "Compute skeleton of binary image$? with "${"arg0 "$bc",dirichlet,neumann"}" boundary conditions." +foreach { s c foreach { +1,16,1,2 +1,16,1,2 ++distance[0] 0 +f. "const boundary = 1; +(i>j(-1)&&i>j(1)) || (i>j(0,-1)&&i>j(0,1)) || (i>j(-1,-1)&&i>j(1,1)) || (i>j(-1,1)&&i>j(1,-1))" +f[0] ">const boundary = "$bc"; +i && (!j(-1) || !j(1) || !j(0,-1) || !j(0,1))?da_push(#1,[x,y]); i;" +eval " +const boundary = "$bc"; +is_removable = [ 0,0,1,1,0,0,1,1,1,1,0,1,1,1,0,1,1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,1,1,1,0,1,1,1,0, +1,1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,1,1,0,0,1,1,0,0,1,1,0,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,1,1,1,0,1,1, +1,0,1,1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,1,1,1,0,1,1,1,0,1,1,1,0,0,1,1,1,1,0,0,0,0, +0,0,0,1,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,0,0,1,1,0,0,1,1,0, +1,1,1,0,1,1,1,0,0,1,1,1,1,1,1,0,1,1,1,1,0 ]; +dotm = [ 128,64,32,16,0,8,4,2,1 ]; +is_removed = 1; +while (is_removed, +is_removed = 0; +N = da_size(#1); +repeat (N,n, +xc = i(#1,0,n,0,0); +yc = i(#1,0,n,0,1); +icc = i(#0,xc,yc); +(icc && !i(#3,xc,yc))?( +xp = xc - 1; yp = yc - 1; +xn = xc + 1; yn = yc + 1; +ref(crop(#0,xp,yp,3,3),V); +val = dot(dotm,V>0); +is_removable[val]?( +i(#0,xc,yc) = 0; +is_removed = 1; +V[3]==1?(da_push(#2,[xp,yc]); i(#0,xp,yc) = 2); +V[5]==1?(da_push(#2,[xn,yc]); i(#0,xn,yc) = 2); +V[1]==1?(da_push(#2,[xc,yp]); i(#0,xc,yp) = 2); +V[7]==1?(da_push(#2,[xc,yn]); i(#0,xc,yn) = 2); +):(da_push(#2,[xc,yc]); i(#0,xc,yc) = 2); +) +); +resize(#1,1,h(#2),1,2,0); +copy(i(#1),i(#2),2*h(#2)); +i[#2,h(#2)-1] = 0; +);" +k[0] > 0 thinning +} a c } +#@cli slic : size>0,_regularity>=0,_nb_iterations>0 +#@cli : Segment selected 2D images with superpixels, using the SLIC algorithm (Simple Linear Iterative Clustering). +#@cli : Scalar images of increasingly labeled pixels are returned. +#@cli : Reference paper: Achanta, R., Shaji, A., Smith, K., Lucchi, A., Fua, P., & Susstrunk, S. (2010). SLIC Superpixels (No. EPFL-REPORT-149300). +#@cli : Default values: 'size=16', 'regularity=10' and 'nb_iterations=10'. +#@cli : $ image.jpg +srgb2lab slic[-1] 16 +blend shapeaverage f[-2] "j(1,0)==i && j(0,1)==i" *[-1] [-2] +slic : check "${1=16}>0 && ${2=10}>=0 && ${3=10}>0" +e[^-1] "Segment image$? using SLIC superpixels, with size $1, regularity $2 and $3 iterations." +S,m,nb_iter=${1-3} +foreach { +slices 50% +{[max(1,round(w/$S)),max(1,round(h/$S))]},1,2,"round(([x,y]+=0.5)*="$S")" +if $S>=3 ++b[0] 0.7 g. xy,1 a[-2,-1] c norm. +f.. " +const n = round("$S"/3); +const n1 = int(n/2); +pos = argmin(crop(#-1,i0 - n1,i1 - n1,n,n,1)); +dxy = [pos%n,int(pos/n)] - n1; +[ cut(i0 + dxy[0],0,w#0-1), cut(i1 + dxy[1],0,h#0-1) ]" +rm. +fi +r. {wh},1,1,2,-1 +100%,1,1,{0,s},"I(#0,I#1)" a[-2,-1] c # Add superpixels colors +[0],[0],1,2 eval.. "I(#-1,i0,i1) = [ x + 1,1 ]; I" s. c distance. 1 *. -1 watershed.. . rm. channels. 0,1 +repeat $nb_iter { +sh[2] 1 f. inf rm. +eval[1] " +const m = "$m"; +const S = "$S"; +k = x; +xk = i0; +yk = i1; +Ik = (I)[2,s#0]; +x0 = max(xk - S,0); +x1 = min(xk + S,w#0 - 1); +y0 = max(yk - S,0); +y1 = min(yk + S,h#0 - 1); +for (y = y0, y<=y1, ++y, +for (x = x0, x<=x1, ++x, +delta_c = norm(I(#0,x,y) - Ik); +delta_s = norm([x - xk, y - yk]); +delta = delta_c + m/S*delta_s; +if (delta +const boundary = 1; +if (i[#-1,i]>=0, +N = [ j(-1,0),j(0,-1),j(1,0),j(0,1) ]; +repeat (size(N),k, +if (N[k]!=i, +i[#-1,i] = i[#-1,i]==i || i[#-1,i]==N[k]?N[k]:-1 +); +); +); +i" +f. "i<0?0:1" +map[0] . rm.. or[-2,-1] ++[0] 1 100%,100% j[0] .,0,0,0,0,1,.. rm. +distance. 0 *. -1 watershed.. . rm. +label. 0,0 +} +#@cli ssd_patch : [patch],_use_fourier={ 0 | 1 },_boundary_conditions +#@cli : Compute fields of SSD between selected images and specified patch. +#@cli : Argument 'boundary_conditions' is valid only when 'use_fourier=0'. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default value: 'use_fourier=0' and 'boundary_conditions=0'. +#@cli : $ image.jpg +crop 20%,20%,35%,35% +ssd_patch[0] [1],0,0 +ssd_patch : check ${is_image_arg\ $1} skip ${2=0},${3=0} +e[^-1] "Compute field of SSD between image$? and patch $1 using "${arg0\ !$2,fourier,spatial}" mode." +repeat $! { pass$1 0 l[$>,-1] { +r 100%,100%,100%,${-max_s} s c +repeat $!/2 { l[$>,{-1-$<}] { ++sqr[1] val={is} rm. ++sqr[0] +f[1] 1 +if $2 +convolve_fft.. . rm. +mirror[1] xyz convolve_fft[0] [1] rm[1] +else +correlate.. .,$3 rm. +correlate[0] [1],$3 rm[1] +fi +*[0] -2 +[0,1] + $val +} } + +} } +#@cli ssim : [reference],_patch_size>0,_max_value>0 +#@cli : Compute the Structural Similarity Index Measure (SSIM) between selected images and specified reference image. +#@cli : This command does not modify the images, it just returns a value or a list of values in the status. +#@cli : When 'downsampling_factor' is specified with a ending '%', its value is equal to '1+(patch_size-1)*spatial_factor%'. +#@cli : \nSSIM is a measure introduced int the following paper: +#@cli : *Wang, Zhou, et al.*, "Image quality assessment: from error visibility to structural similarity.", +#@cli : in IEEE transactions on image processing 13.4 (2004): 600-612. +#@cli : \nThe implementation of this command is a direct translation of the reference code (in Matlab), found at : +#@cli : https://ece.uwaterloo.ca/~z70wang/research/ssim/ +#@cli : Default values: 'patch_size=11', and 'max_value=255'. ++ssim : check ${"is_image_arg $1"}" && isint(${2=11}) && $2>0 && ${3=255}>0" +e[^-1] "Compute the SSIM between image$? and reference image $1, with patch size $2 and max_value $3." +C1,C2:=([0.01,0.03]*$3)^2 +$2,$2 gaussian. 1.5 /. {is} store. gaussian_weights +res,sep= +pass$1 ++foreach[^-1] { +pass. 0 +if [w#0,h#0,d#0,s#0]!=[w#1,h#1,d#1,s#1] +error[0--4] "Command 'ssim': Image dimensions ("{0,[w,h,d,s]}") and ("{1,[w,h,d,s]}") do not match." +fi +f:=max(1,round(min(w,h)/256)); +if $f>1 r {round([w,h,d]/$f,1,1)},100%,2 fi +=> A,B +$gaussian_weights => W +p0,p1:="p0 = round(w/2,1,-1); [ p0,w-1-p0 ]" ++correlate[A,B] [W],0,0,1,$p0,$p0,0,$p0,$p0,0,{A,[w,h]-1-$p1},0 +mul[-2,-1] sqr[-3,-2] => muA2,muB2,muAB ++mul[A,B] sqr[A,B] =>[A,B,-1] A2,B2,AB +correlate[A2,B2,AB] [W],0,0,1,$p0,$p0,0,$p0,$p0,0,{A2,[w,h]-1-$p1},0 -[A2] [muA2] -[B2] [muB2] -[AB] [muAB] +=>[A2,B2,AB] sigA2,sigB2,sigAB +*[muAB] 2 +[muAB] $C1 *[sigAB] 2 +[sigAB] $C2 *[muAB,sigAB] =>[muAB] num ++[muA2,muB2] +[muA2] $C1 +[sigA2,sigB2] +[sigA2] $C2 *[sigA2,muA2] =>[sigA2] den +/[num] [den] +res.=$sep{ia} sep=, rm +} +rm. u $res +#@cli ssim_matrix : _patch_size>0,_max_value>0 +#@cli : Compute SSIM (Structural Similarity Index Measure) matrix between selected images. +#@cli : Default values: 'patch_size=11', and 'max_value=255'. +#@cli : $ image.jpg +noise 30 +noise[0] 35 +noise[0] 38 cut. 0,255 +ssim_matrix +ssim_matrix : check "isint(${1=11}) && $1>0 && ${2=255}>0" +e[^-1] "Compute the "$!x$!" matrix of SSIM values, for image$?, with patch size $1 and max value $2." ++ssim_matrix ${1,2} k. ++ssim_matrix : check "isint(${1=11}) && $1>0 && ${2=255}>0" +e[^-1] "Compute the "$!x$!" matrix of SSIM values, for image$?, with patch size $1 and max value $2." +N=$! $N,$N +repeat $N { i=$> +j:=$i+1 for $j<$N { ++ssim[$i] [$j],${1,2} =. ${},$i,$j =. ${},$j,$i +j+=1 +} +=. 1,$i,$i +} +#@cli thinning : _boundary_conditions={ 0=dirichlet | 1=neumann } +#@cli : Compute skeleton of binary shapes using morphological thinning +#@cli : (beware, this is a quite slow iterative process) +#@cli : Default value: 'boundary_conditions=1'. +#@cli : $ shape_cupid 320 +thinning +thinning : check "!isnum(${1=1}) || ($1>=0 && $1<=1)" +if isnum($1) bc=$1 else bc=1 noarg fi +e[^-1] "Apply morphological thinning to binary image$? with "${"arg0 "$bc",dirichlet,neumann"}" boundary conditions." +foreach { s c foreach { +1,16,1,2 +1,16,1,2 +1,16,1,2 +f[0] ">const boundary = "$bc"; +i && (!j(-1) || !j(1) || !j(0,-1) || !j(0,1))?da_push(#1,[x,y]); i;" +eval " +const boundary = "$bc"; +hm_and = [ 231,189,231,189,122,91,94,218 ]; +hm_eq = [ 7,148,224,41,18,80,72,10 ]; +dotm = [ 128,64,32,16,0,8,4,2,1 ]; +is_removed = vector8(0); +ind = 1; +nind = 3; +it = 0; +do ( +N = da_size(#ind); +it8 = it%8; +is_removed[it8] = 0; +repeat (N,n, +xc = i(#ind,0,n,0,0); +yc = i(#ind,0,n,0,1); +icc = i(#0,xc,yc); +icc?( +xp = xc - 1; yp = yc - 1; +xn = xc + 1; yn = yc + 1; +ref(crop(#0,xp,yp,3,3),V); +val = dot(dotm,V>0); +(val & hm_and[it8])==hm_eq[it8]?( +da_push(#2,[xc,yc]); +is_removed[it8] = 1; +V[3]==1?(da_push(#nind,[xp,yc]); i(#0,xp,yc) = 2); +V[5]==1?(da_push(#nind,[xn,yc]); i(#0,xn,yc) = 2); +V[1]==1?(da_push(#nind,[xc,yp]); i(#0,xc,yp) = 2); +V[7]==1?(da_push(#nind,[xc,yn]); i(#0,xc,yn) = 2); +):(da_push(#nind,[xc,yc]); i(#0,xc,yc) = 2); +); +); +N = da_size(#nind); +repeat (N,n, i(#0,i[#nind,n],i[#nind,n + h(#nind)]) = 1); +_tmp = ind; ind = nind; nind = _tmp; +i[#nind,h(#nind)-1] = 0; +N = da_size(#2); +repeat (N,n, i(#0,I[#2,n]) = 0); +i[#2,h(#2)-1] = 0; +++it; +_(while), max(is_removed) +);" +k[0] +} a c } +#@cli tones : N>0 +#@cli : Get N tones masks from selected images. +#@cli : $ image.jpg +tones 3 +tones : check $1>0 +e[^-1] "Get $1 tones masks from image$?." +norm n 0,{$1-1} round 1 +foreach { +repeat $1-1 { +==[0] {1+$>} } ==[0] 0 +} +#@cli topographic_map : _nb_levels>0,_smoothness +#@cli : Render selected images as topographic maps. +#@cli : Default values: 'nb_levels=16' and 'smoothness=2'. +#@cli : $ image.jpg topographic_map 10 +topographic_map : check "isint(${1=16}) && $1>0" skip ${2=2} +e[^-1] "Render topographic maps from image$?, with $1 levels and smoothness $2." +foreach { +b $2 isophotes. $1 compose_channels. + ==. 0 blend shapeaverage0 } +#@cli tsp : _precision>=0 +#@cli : Try to solve the 'travelling salesman' problem, using a combination of greedy search and 2-opt algorithms. +#@cli : Selected images must have dimensions Nx1x1xC to represent N cities each with C-dimensional coordinates. +#@cli : This command re-order the selected data along the x-axis so that the point sequence becomes a shortest path. +#@cli : Default values: 'precision=256'. +#@cli : $ 256,1,1,2 rand 0,512 tsp , 512,512,1,3 repeat w#0 circle[-1] {0,I[$>]},2,1,255,255,255 line[-1] {0,boundary=2;[I[$>],I[$>+1]]},1,255,128,0 done keep[-1] +tsp : check "${1=256}>=0" +e[^-1] "Try to solve the 'travelling salesman' problem for pointcloud$?, with precision $1." +foreach { +nm={n} +if h>1" || "d>1 error[0--4] "Selected image '"{n}"' has invalid dimensions ("{[w,h,d,s]}")." fi +eval " +is_used = vectorw(0); +next = vectorw(-1); +n_initial = n_current = round(u(0,w-1)); +do ( +is_used[n_current] = 1; +P_current = I[n_current]; +n_next = -1; dmin = inf; +repeat (w,n, +if (!is_used[n], +d = norm(I[n] - P_current); +if (dbegin(ind = 0); val = I[#0,ind]; ind = val[s]; val" rm.. +eval " +is_improved = 1; +while (is_improved, +is_improved = 0; +nb_try = $1*w; +repeat (nb_try,try, +r = round(max(8,0.5*w*(try/nb_try)^0.25)); +i = round(u(0,w-1)); +ni = (i+1)%w; +pi = (i-1)%w; +do (j = (i + round(u(-r,r)))%w; _(while), j==i || j==ni || j==pi); +nj = (j+1)%w; +P_i = I[i]; +P_ni = I[ni]; +P_j = I[j]; +P_nj = I[nj]; +dist_ini = norm(P_ni - P_i); +dist_jnj = norm(P_nj - P_j); +dist_ij = norm(P_j - P_i); +dist_ninj = norm(P_nj - P_ni); +if (dist_ij + dist_ninj $nm +} +#@cli variance_patch : _patch_size>=1 +#@cli : Compute variance of each images patch centered at (x,y), in selected images. +#@cli : Default value: 'patch_size=16' +#@cli : $ image.jpg +variance_patch +variance_patch : check "isint(${1=16}) && $1>=1" +e[^-1] "Compute variance of image patches in image$?, with patch size $1." +$1,$1,1,1,1 normalize_sum. +repeat $!-1 { l[$>,-1] { ++sqr[0] convolve[0,2] [1] +sqr[0] rv[0,2] -[0,2] max[0] 0 +} } rm. +#@cli :: Image Drawing +#@cli arrow : x0[%],y0[%],x1[%],y1[%],_thickness[%]>=0,_head_length[%]>=0,_head_thickness[%]>=0,_opacity,_pattern,_color1,... +#@cli : Draw specified arrow on selected images. +#@cli : 'pattern' is an hexadecimal number starting with '0x' which can be omitted +#@cli : even if a color is specified. If a pattern is specified, the arrow is +#@cli : drawn outlined instead of filled. +#@cli : Default values: 'thickness=1%', 'head_length=10%', 'head_thickness=3%', 'opacity=1', 'pattern=(undefined)' and 'color1=0'. +#@cli : $ 400,400,1,3 repeat 100 arrow 50%,50%,{u(100)}%,{u(100)}%,3,20,10,0.3,${-rgb} done +arrow : check "${5=1%}>=0 && ${6=10%}>=0 && ${7=3%}" skip ${8=1} +e[^-1] "Draw arrow in image$?, from ($1,$2) to ($3,$4), with thickness $5, head length $6, +head_thickness $7 and opacity $8." +foreach { +polygon. 7,{" +x0 = "${"is_percent $1"}"?(w-1)*$1:$1; +y0 = "${"is_percent $2"}"?(h-1)*$2:$2; +x1 = "${"is_percent $3"}"?(w-1)*$3:$3; +y1 = "${"is_percent $4"}"?(h-1)*$4:$4; +p0 = [x0,y0]; +dp = [x1,y1]-=p0; +l = norm(dp); +t = "${"is_percent $5"}"?l*$5:$5; +hl = "${"is_percent $6"}"?l*$6:$6; +ht = "${"is_percent $7"}"?l*$7:$7; +lmhl = l - hl; +X = mul([0,-t,lmhl,-t,lmhl,-ht,l,0,lmhl,ht,lmhl,t,0,t],rot(-atan2(dp[1],dp[0])),2); +X+=[p0,p0,p0,p0,p0,p0,p0]"},${8--1} +} +#@cli axes : x0,x1,y0,y1,_font_height>=0,_opacity,_pattern,_color1,... +#@cli : Draw xy-axes on selected images. +#@cli : 'pattern' is an hexadecimal number starting with '0x' which can be omitted +#@cli : even if a color is specified. +#@cli : To draw only one x-axis at row Y, set both 'y0' and 'y1' to Y. +#@cli : To draw only one y-axis at column X, set both 'x0' and 'x1' to X. +#@cli : Default values: 'font_height=14', 'opacity=1', 'pattern=(undefined)' and 'color1=0'. +#@cli : $ 400,400,1,3,255 axes -1,1,1,-1 +axes : check "isint(${5=14}) && $5>=0 && ${6=1}>=0" skip ${7=0},${8=0} +if ${"is_pattern \"$7\""} +e[0--3] "Draw xy-axes on image$?, with x-range ($1,$2), y-range ($3,$4), font height $5, opacity $6, +pattern $7 and color (${8--1})." +pattern=$7 color=${8--1} +else +e[0--3] "Draw xy-axes on image$?, with x-range ($1,$2), y-range ($3,$4), font height $5, opacity $6 +and color (${7--1})." +pattern=0xFFFFFFFF color=${7--1} +fi +if !$5" || "!$6 return fi +mx={min($1,$2)} Mx={max($1,$2)} +my={min($3,$4)} My={max($3,$4)} +foreach { +w1={0,w-1} h1={0,h-1} +if $1!=$2 u=${"_axes[] $1,$2,{0.3*w/$5}"} offx={arg(1,$u)} deltax={arg(2,$u)} fi +if $3!=$4 u=${"_axes[] $3,$4,{0.3*h/$5}"} offy={arg(1,$u)} deltay={arg(2,$u)} fi +is_0x=0 +if $3==$4 y0=$3 else y0={v=-($my)*$h1/($My-$my);if($4>=$3,v,$h1-v)} fi +sty={if($y0>$h1-$5,-1,1)} +if $1!=$2" && "$y0>=0" && "$y0<=$h1 +line 0,$y0,$w1,$y0,$6,$pattern,$color +4,4,1,1,x<=y +mirror. y rows. 1,3 a[-2,-1] y .,.,1,[0] fc. $color +if $2>=$1 j[0] .,{$w1-3},{$y0-3},0,0,$6,.. +else mirror.. x j[0] .,0,{$y0-3},0,0,$6,.. +fi +rm[-2,-1] +i=0 do +val={_$offx+$i*$deltax} i+=1 +if $val>=$mx" && "$val<=$Mx +x={v=($val-$mx)*$w1/($Mx-$mx);if($2>=$1,v,$w1-v)} +line $x,{$y0-1},$x,{$y0+1},$6,$pattern,$color +if $val +0 t. $val,0,0,$5,1,1 100%,100%,1,[0] fc. $color +j[0] .,{max(0,min($w1-w,$x-w/2))},{if($sty>0,$y0+3,$y0-h-3)},0,0,$6,.. rm[-2,-1] +else is_0x=1 +fi +fi +while $val<$Mx +fi +is_0y=0 +if $1==$2 x0=$1 else x0={v=-($mx)*$w1/($Mx-$mx);if($2>=$1,v,$w1-v)} fi +stx={if($x0>$w1-$5,-1,1)} +if $3!=$4" && "$x0>=0" && "$x0<=$w1 +line $x0,0,$x0,$h1,$6,$pattern,$color +4,4,1,1,x>=y +mirror. x z. 1,3 a[-2,-1] x .,.,1,[0] fc. $color +if $4>=$3 j[0] .,{$x0-3},{$h1-3},0,0,$6,.. +else mirror.. y j[0] .,{$x0-3},0,0,0,$6,.. +fi +rm[-2,-1] +i=0 do +val={_$offy+$i*$deltay} i+=1 +if $val>=$my" && "$val<=$My +y={v=($val-$my)*$h1/($My-$my);if($4>=$3,v,$h1-v)} +line {$x0-1},$y,{$x0+1},$y,$6,$pattern,$color +if $val +0 t. $val,0,0,$5,1,1 100%,100%,1,[0] fc. $color +j[0] .,{if($stx>0,$x0+6,$x0-w-6)},{max(0,min($h1-h,$y-h/2))},0,0,$6,.. rm[-2,-1] +else is_0y=1 +fi +fi +while $val<$My +fi +if $is_0x" || "$is_0y +0 t. 0,0,0,$5,1,1 100%,100%,1,[0] fc. $color +j[0] .,{if($stx>0,$x0+6,$x0-w-6)},{if($sty>0,$y0+3,$y0-h-3)},0,0,$6,.. rm[-2,-1] +fi +} +_axes : +n={max(1,round($3))} +d={abs($2-$1)/($n-1)} +s={10^round(log10($d))} +m={round(min($1,$2),$s,-1)} +M={round(max($1,$2),$s,1)} +do N={1+round(($M-$m)/$s,1,1)} s={2*$s} while $N>$n +u $m,{$s/2} +#@cli ball : _size>0, _R,_G,_B,0<=_specular_light<=8,0<=_specular_size<=8,_shadow>=0 +#@cli : Input a 2D RGBA colored ball sprite. +#@cli : Default values: 'size=64', 'R=255', 'G=R', 'B=R', 'specular_light=0.8', 'specular_size=1' and 'shading=1.5'. +#@cli : $ repeat 9 { ball {1.5^($>+2)},${-rgb} } append x ++ball : check "${1=64}>0 && ${5=0.8}>=0 && $5<=8 && ${6=1}>=0 && $6<=8 && ${7=1.5}>=0" skip ${2=255},${3=$2},${4=$3} +e[^-1] "Input $1x$1 ball with color (${2-4}), specular light $5, specular size $6 and shadow factor $7." +l[] { +{2*$1},{2*$1} = 1,65%,30% distance 1 * -1 ++n 0,1 ^[1] $7 *[1] 1.4 +*[1] $3 +*[1] $4 *[1] $2 a[^0] c +>=[0] {100-10*$6}% b[0] {3*$6}% n[0] 0,{$5*255} rv + c 0,255 +100%,100% circle[1] 50%,50%,34%,1,1 *[0] [1] *. 255 a c +r $1,$1,1,4,2 +} +chromeball64x64 : +base642img[] "MiB1bnNpZ25lZF9jaGFy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zk/Kh+6t4c1P6wfUlvCF3T8VIKVb4ROe1U+/7N88fu3549CXm64hJv+AeF""6CTeILTmsK0NhN4WYmYq02Y2DmvIQjEHLrH37WBk+1gCMQRCtfHdZq0s4ijkD8tXMj+P2PrODg+JXx6u3kzLpH8C+urU93e69HA9ng2q3TfbwNfIFGO""Fda7sUF0kZP8L8S1K05Ay80hP52g/CqdnzOTa1o6QFqqdb57dlp7bl/A5UFagkxIDQ1IDEgMSAjNTIKeJxz941i0M/Iz03VTykpTs4ozS3Qd0ktzi7J""L9BPzigCiscXF2SkFqXqFeSlMwAAcSYQbQ==" +s. c +apply_gamma.. 0.05 b. 3 n. 0,150 n... 0,1 i[-4] 100%,100%,1,3 fc[-4] ${1-3} *[-4,-3] +[-3,-1] +c.. 0,255 a[-2,-1] c +#@cli chessboard : size1>0,_size2>0,_offset1,_offset2,_angle,_opacity,_color1,...,_color2,... +#@cli : Draw chessboard on selected images. +#@cli : Default values: 'size2=size1', 'offset1=offset2=0', 'angle=0', 'opacity=1', 'color1=0' and 'color2=255'. +#@cli : $ image.jpg chessboard 32,32,0,0,25,0.3,255,128,0,0,128,255 +chessboard : check "$1>0 && ${2=$1}>0" skip ${3=0},${4=0},${5=0},${6=1},${7=0},${8=255} +e[^-1] "Draw chessboard on image$?, with sizes ($1,$2), offsets ($3,$4), angle $5 deg., opacity $6 and +colors (${7--1})." +i[0] (${7--1}) r[0] {{0,w}/2},1,1,2,-1 permute[0] cyzx +repeat $!-1 { +w={w} h={h} theta={$5*pi/180} +($3,{$3+$w-1};$3,{$3+$w-1}^$4,$4;{$4+$h-1},{$4+$h-1}) r. $w,$h,1,2,3 +r. {$w*$h},2,1,1,-1 +i.. ({cos($theta)},{-sin($theta)};{sin($theta)},{cos($theta)}) m*[-2,-1] +r. $w,$h,1,2,-1 +%. {$1+$2} >=. $1 s. c xor[-2,-1] map. [0] r. 100%,100%,1,.. +j.. .,0,0,0,0,$6 rm. mv. 1 +} rm[0] +#@cli cie1931 +#@cli : Draw CIE-1931 chromaticity diagram on selected images. +#@cli : $ 500,400,1,3 cie1931 +cie1931 : +e[^-1] "Draw CIE-1931 chromaticity diagram on image$?." +(67.5;73.5;109.5;103.5;51.5;100.5;37;36) +(280,420,0;171,829,0;158,820,0;153,816,0;147,811,0;140,804,0;132,794,0;121,776,0;106,747,0;88,701,0;\ +65,633,0;42,539,0;20,421,0;5,295,0;0,179,0;4,115,0;10,83,0;16,61,0;25,38,0;35,21,0;47,10,0;58,3,0;71,0,0;92,1,0;111,7,0;151,28,0;189,52,0;226,79,0;262,109,0;298,141,0;334,175,0;370,209,0;405,244,0;441,279,0;475,313,0;509,347,0;731,568,0) +xM=731 yM=829 +2,{h-1},1,1,3,0 1,{h},1,1,'y' ++. 1 %. {h} +[-2,-1] 1 a[-3--1] x +3,{h},1,1,160 1,{h},1,1,1 +y[-4--2] a[-5--1] y mv. 0 +xR=636 yR=504 xG=297 yG=234 xB=147 yB=774 +512,512,1,3 triangle_shade. 0,0,{w-1},0,0,{h-1},""255,0,0,""0,255,0,""0,0,255 rgb2srgb. ++compose_channels. max +. 1e-8 /[-2,-1] *. 255 +i.. (67.5;73.5;109.5;103.5;51.5;100.5;3;1;$xR;$yR;-0.01;$xG;$yG;-0.01;$xB;$yB;-0.01;9;0;1;2;0;0;511;0;0;511;-128;512;512;3) +y. (1) a[-3--1] y mv. 1 +repeat $!-2 { +to_rgb. fc. 255,255,255 grid. 10%,10%,0,0,0.3,0xCCCCCCCC,1,0 +100%,100%,1,3 ++*3d[0,1] {(w-8)/$xM},{(h-32)/$yM} +j3d... .,2,30,0,1,2 ++!=... 0 distance. 1 *. -1 watershed[-4] . rm. /... 1.5 +j3d... .,2,30,0,1,2 +p3d. 1 p3d. 2 col3d. 128 j3d... .,2,30,0,1,1 rm. +{-2,w},{-2,h} j3d. ..,2,30,0,1,2 rm.. ++erode. 4 -. .. ==. 0 *[-3,-1] +a[-2,-1] c blend[-2,-1] alpha +100%,100%,1,1,255 axes. 0,0.75,0.85,0,14,1 +erode. 3 negate. to_rgb.. +j... ..,0,0,0,0,1,.,400 rm[-2,-1] +mv. 2 +} +rm[0,1] +#@cli circle : x[%],y[%],R[%],_opacity,_pattern,_color1,... +#@cli : Draw specified colored circle on selected images. +#@cli : A radius of '100%' stands for 'sqrt(width^2+height^2)'. +#@cli : 'pattern' is an hexadecimal number starting with '0x' which can be omitted +#@cli : even if a color is specified. If a pattern is specified, the circle is +#@cli : drawn outlined instead of filled. +#@cli : Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'. +#@cli : $ image.jpg repeat 300 circle {u(100)}%,{u(100)}%,{u(30)},0.3,${-rgb} done circle 50%,50%,100,0.7,255 +circle : skip ${4=1},${5=0},${6=0} +if ${"is_pattern \"$5\""} +e[0--3] "Draw outlined circle at ($1,$2) with radius $3 on image$?, with opacity $4, pattern $5 and +color (${6--1})." +else +e[0--3] "Draw filled circle at ($1,$2) with radius $3 on image$?, with opacity $4 and color (${5--1})." +fi +ellipse $1,$2,$3,$3,0,${4--1} +#@cli close_binary : 0<=_endpoint_rate<=100,_endpoint_connectivity>=0,_spline_distmax>=0,_segment_distmax>=0,0<=_spline_anglemax<=180,_spline_roundness>=0,_area_min>=0,_allow_self_intersection={ 0 | 1 } +#@cli : Automatically close open shapes in binary images (defining white strokes on black background). +#@cli : Default values: 'endpoint_rate=75', 'endpoint_connectivity=2', 'spline_distmax=80', 'segment_distmax=20', 'spline_anglemax=90', 'spline_roundness=1','area_min=100', 'allow_self_intersection=1'. +close_binary : +check "${1=75}>=0 && $1<=100 && ${2=2}>=0 && ${3=80}>=0 && ${4=20}>=0 && ${5=90}>=0 && $5<=180 && ${6=1}>=0 && +${7=100}>=0 && isnum(${8=1})" +e[^-1] "Close open shapes in binary image$?, with endpoint rate $1, endpoint connectivity $2, spline max distance $3, +segment max distance $4, spline max angle $5, spline roundness $6, area min $7 and self intersections "${"arg0 !$8,allowed,\"not allowed\""}"." +endpoint_threshold={100-$1} +endpoint_connectivity={round($2)} +spline_distmax=$3 +segment_distmax=$4 +spline_anglemax=$5 +spline_roundness=$6 +area_min=$7 +allow_self_intersections={!!$8} +_edgel_lib=" +begin( +pn = [ 0,1,1,1,-1,0,-1,1,0,-1,-1,-1,1,0,1,-1 ]; +pp = [ 0,-1,1,-1,1,0,1,1,0,1,-1,1,-1,0,-1,-1 ]; +); +next(img,p) = ( +p0 = p#[0,2] + pn[4*p#[2],2]; +p1 = p#[0,2] + pn[4*p#[2] + 2,2]; +case = !!i(#img,p0[0],p0[1],0,0) + 2*!!i(#img,p1[0],p1[1],0,0); +!case?[ p[0],p[1],(p[2]+1)%4 ]:case==1?[ p0[0],p0[1],p[2] ]:[ p1[0],p1[1],(p[2]-1)%4 ]; +); +previous(img,p) = ( +p0 = p#[0,2] + pp[4*p#[2],2]; +p1 = p#[0,2] + pp[4*p#[2] + 2,2]; +case = !!i(#img,p0[0],p0[1],0,0) + 2*!!i(#img,p1[0],p1[1],0,0); +!case?[ p[0],p[1],(p[2]-1)%4 ]:case==1?[ p0[0],p0[1],p[2] ]:[ p1[0],p1[1],(p[2]+1)%4 ]; +); +next2(img,p) = ( +p0 = p#[0,2] + pn[4*p#[2],2]; +p1 = p#[0,2] + pn[4*p#[2] + 2,2]; +case = !(i(#img,p0[0],p0[1],0,0)&3) + 2*!(i(#img,p1[0],p1[1],0,0)&3); +case==1?[ p0[0],p0[1],p[2] ]:case==3?[ p1[0],p1[1],(p[2]-1)%4 ]:[ p[0],p[1],(p[2]+1)%4 ]; +); +next3(img,p) = ( +p0 = p#[0,2] + pn[4*p#[2],2]; +p1 = p#[0,2] + pn[4*p#[2] + 2,2]; +val1 = i(#img,p0[0],p0[1],0,0); +val2 = i(#img,p1[0],p1[1],0,0); +case = (val1==1 || val1==2) + 2*(val2==1 || val2==2); +case==1?[ p0[0],p0[1],p[2] ]:case==3?[ p1[0],p1[1],(p[2]-1)%4 ]:[ p[0],p[1],(p[2]+1)%4 ]; +); +vec(p) = ( +ang = i(p[0],p[1],0,p[2])*pi/180; +[ cos(ang), sin(ang) ]; +);" +foreach { +nm={n} +slices 50% channels 0 > 0 +=> strokes +100%,100%,1,4," +ref(crop(#"$strokes",x - 1,y - 1,0,0,3,3,1,1,1),N); +N[4]?[ N[5]?-2:0, N[7]?-2:90, N[3]?-2:180, N[1]?-2:270 ]:[-2,-2,-2,-2]; +" => e_normals +f[e_normals] $_edgel_lib" +const boundary = 1; +i<-1?-2:( +ppos = npos = pos = [ x,y,c ]; +u = vec(pos); +for (t = 1, t<=5, ++t, +ppos = previous(#"$strokes",ppos); +npos = next(#"$strokes",npos); +if (ppos==npos, break()); +w = exp(-t^2/30); +u+=w*vec(ppos); +u+=w*vec(npos); +); +ang = (atan2(u[1],u[0])*180/pi)%360; +)" ++f[e_normals] $_edgel_lib" +const boundary = 1; +i<-1?-2:( +pos = [ x,y,c ]; +ppos = previous(#"$strokes",pos); +npos = next(#"$strokes",pos); +pu = vec(ppos); +nu = vec(npos); +du = (nu - pu)/2; +cr = cross([vec(pos),0],[du,0]); +norm(du)*sign(cr[2]); +)" +=> e_curvatures ++f[e_curvatures] $_edgel_lib" +const boundary = 1; +i<-1?-2:( +ppos = npos = pos = [ x,y,c ]; +val = i; sumw = 1; +for (t = 1, t<=5, ++t, +ppos = previous(#"$strokes",ppos); +npos = next(#"$strokes",npos); +if (ppos==npos, break()); +w = exp(-t^2/30); +val+=w*i(ppos[0],ppos[1],0,ppos[2]); +val+=w*i(npos[0],npos[1],0,npos[2]); +sumw+=2*w; +); +val/sumw; +)" +=> e_smooth_curvatures ++distance[strokes] 0 +f. " +i<1-0.01||i>1+0.01?0:( +p = x; q = y; d = 1; +for (is_better = 1, is_better && d<32, +next_p = p; +next_q = q; +is_better = 0; +pp = p - 1; +np = p + 1; +pq = q - 1; +nq = q + 1; +(nd = i(pp,pq))>d?(d = nd; next_p = pp; next_q = pq; is_better = 1); +(nd = i(p, pq))>d?(d = nd; next_p = p; next_q = pq; is_better = 1); +(nd = i(np,pq))>d?(d = nd; next_p = np; next_q = pq; is_better = 1); +(nd = i(pp,q))>d?(d = nd; next_p = pp; next_q = q; is_better = 1); +(nd = i(np,q))>d?(d = nd; next_p = np; next_q = q; is_better = 1); +(nd = i(pp,nq))>d?(d = nd; next_p = pp; next_q = nq; is_better = 1); +(nd = i(p, nq))>d?(d = nd; next_p = p; next_q = nq; is_better = 1); +(nd = i(np,nq))>d?(d = nd; next_p = np; next_q = nq; is_better = 1); +p = next_p; +q = next_q; +); +d)" +=> stroke_radii +compose_channels[e_smooth_curvatures] max =>[e_smooth_curvatures] smooth_curvatures ++compose_channels[e_curvatures] max => curvatures +f. "i(#"$smooth_curvatures")>=("$endpoint_threshold"%)/(max(1,i(#"$stroke_radii"))) || +i>=max(0.25,"$endpoint_threshold"%)" +label_fg. 0,1 => keypoints +if iM>0 +{iM},1,1,3,-1 => keycoords +f[keypoints] "> +ret = 0; +if (i, +j = i - 1; +old_max = I[#"$keycoords",j]; +kappa = i(#"$smooth_curvatures"); +if (kappa>old_max[2], +I[#"$keycoords",j] = [ x,y,kappa ]; +i(#"$keypoints",old_max[0],old_max[1]) = 0; +ret = 1; +); +); ret" +channels[keycoords] 0,3 +fi +rm[smooth_curvatures,stroke_radii,keypoints] +if !narg($keycoords) +rm[e_normals,e_curvatures] [strokes] => new_strokes +else +f[keycoords] " +P = (I)[0,2]; +angles = I(#"$e_normals",P); +U = [ 0,0 ]; +repeat (size(angles),k, +if (angles[k]>=0, +w = max(1e-8,i(#"$e_curvatures",P[0],P[1],0,k))^2; +ang = angles[k]*pi/180; +U += w*[ cos(ang),sin(ang) ]; +); +); +[ P,0,(atan2(U[1],U[0])*180/pi)%360 ]" +rm[e_normals,e_curvatures] +256,1,1,3 => keypairs +f[keycoords] "> +begin(ind = 0); +for (nx = x + 1, nx0, +if (ind>=w(#"$keypairs"), resize(#"$keypairs",2*ind,1,1,3,0)); +I[#"$keypairs",ind++] = [ quality,x,nx ]; +); +); +end(resize(#"$keypairs",ind,1,1,3,0)); +I" +if {keypairs,w} sort[keypairs] -,x +else rm[keypairs] +fi +[strokes] => new_strokes +ind_strokes={$allow_self_intersections?$strokes:$new_strokes} +if narg($keypairs) +f[keypairs] ">"$_edgel_lib" +for_spline(code) = for (t = 0, t<=1, t+=dt, +t3 = t*(t2 = t*t); +P = round(mul([t3,t2,t,1],C,2)); +code#; +dP = abs(mul([3*t2,2*t,1,0],C,2)) + 1e-8; +dt = min(dtmin,0.75/max(dP)); +); +Ic = I; +indS = Ic[1]; +indT = Ic[2]; +if (i(#"$keycoords",indS,0,0,2)<"$endpoint_connectivity" && +i(#"$keycoords",indT,0,0,2)<"$endpoint_connectivity", +S = I(#"$keycoords",indS)[0,2]; +T = I(#"$keycoords",indT)[0,2]; +angS = i(#"$keycoords",indS,0,0,3)*pi/180; +angT = i(#"$keycoords",indT,0,0,3)*pi/180; +ST = T - S; +dist = "$spline_roundness"*norm(ST); +NS = [ cos(angS),sin(angS) ]; +NT = [ cos(angT),sin(angT) ]; +tmax = max(abs(ST)); +is_cond = 1; +C = mul([ 2,-2,1,1,-3,3,-2,-1,0,0,1,0,1,0,0,0 ],[ S,T,dist*NS,-dist*NT ],2); +dt = dtmin = 1/max(abs(T - S)); +current_val = 1; +nb_switches = 0; +for_spline( +if (i(#"$ind_strokes",P,0,0)!=current_val, ++nb_switches; current_val=!current_val); +if (nb_switches>2, is_cond = 0; break()) +); +if (is_cond, +const area_max_threshold = "$area_min"; +const area_min_threshold = 5; +const max_edgels = 2*(area_max_threshold + 1); +if (area_max_threshold<=0, +for_spline(i(#"$new_strokes",P)=1); +, +for_spline(i(#"$new_strokes",P)|=2); +for_spline( +if (i(#"$new_strokes",P[0] + 1,P[1])==0, +edgels = area = 0; Q0 = Q = [ P[0] + 1,P[1],2 ]; +do ( +i(#"$new_strokes",Q[0],Q[1]) = 4; +area+=(Q[2]&1?0:1-Q[2])*(Q[0]+!Q[2]); +Q = next2(#"$new_strokes",Q), +Q!=Q0 && ++edgels<=max_edgels); +if (edgels<=max_edgels && area>=area_min_threshold && area=area_min_threshold && area=area_min_threshold && area=area_min_threshold && area"$_edgel_lib" +for_segment(code) = for (t = 0, t<=tmax, ++t, +P = round(S + t*ST); +code#; +); +if (i(#"$keycoords",x,0,0,2)<"$endpoint_connectivity", +S = I(#"$keycoords",x)[0,2]; +angS = i(#"$keycoords",x,0,0,3)*pi/180; +NS = [ cos(angS),sin(angS) ]; +ST = round(NS*"$segment_distmax"); +tmax = max(abs(ST)); +ST/=tmax; +is_cond = 0; +current_val = 0; +nb_switches = 0; +for_segment( +if (i(#"$new_strokes",P,0,0)!=current_val, ++nb_switches; current_val=1 - current_val); +if (nb_switches==2,is_cond = 1; break();); +); +tmax = t; +if (is_cond, +const area_max_threshold = "$area_min"; +const area_min_threshold = 5; +const max_edgels = 2*(area_max_threshold + 1); +if (area_max_threshold<=0, +for_segment(i(#"$new_strokes",P)=0); +, +for_segment(i(#"$new_strokes",P)|=4); +for_segment( +if (i(#"$new_strokes",P[0] + 1,P[1])==1, +edgels = area = 0; Q0 = Q = [ P[0] + 1,P[1],2 ]; +do ( +i(#"$new_strokes",Q[0],Q[1]) = 2; +area+=(Q[2]&1?0:1-Q[2])*(Q[0]+!Q[2]); +Q = next3(#"$new_strokes",Q), +Q!=Q0 && ++edgels<=max_edgels); +if (edgels<=max_edgels && area>=area_min_threshold && area=area_min_threshold && area=area_min_threshold && area=area_min_threshold && area[new_strokes] $nm +} +#@cli ellipse : x[%],y[%],R[%],r[%],_angle,_opacity,_pattern,_color1,... : (+) +#@cli : Draw specified colored ellipse on selected images. +#@cli : A radius of '100%' stands for 'sqrt(width^2+height^2)'. +#@cli : 'pattern' is an hexadecimal number starting with '0x' which can be omitted +#@cli : even if a color is specified. If a pattern is specified, the ellipse is +#@cli : drawn outlined instead of filled. +#@cli : Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'. +#@cli : $ image.jpg repeat 300 ellipse {u(100)}%,{u(100)}%,{u(30)},{u(30)},{u(180)},0.3,${-rgb} done ellipse 50%,50%,100,100,0,0.7,255 +#@cli flood : x[%],_y[%],_z[%],_tolerance>=0,_is_high_connectivity={ 0 | 1 },_opacity,_color1,... : (+) +#@cli : Flood-fill selected images using specified value and tolerance. +#@cli : Default values: 'y=z=0', 'tolerance=0', 'is_high_connectivity=0', 'opacity=1' and 'color1=0'. +#@cli : $ image.jpg repeat 1000 flood {u(100)}%,{u(100)}%,0,20,0,1,${-rgb} done +#@cli gaussian : _sigma1[%],_sigma2[%],_angle +#@cli : Draw a centered gaussian on selected images, with specified standard deviations and orientation. +#@cli : Default values: 'sigma1=3', 'sigma2=sigma1' and 'angle=0'. +#@cli : $ 400,400 gaussian 100,30,45 +#@cli : $$ https://gmic.eu/oldtutorial/_gaussian +gaussian : skip ${1=15%},${2=$1},${3=0} +e[^-1] "Draw centered gaussian on image$? with standard deviations ($1,$2) and angle $3 deg." +u={cos($3*pi/180)} +v={sin($3*pi/180)} +dmax={max(w,h)} +if isnum($1) l1=$1 else l1={${1}10000*$dmax/100} fi +if isnum($2) l2=$2 else l2={${2}10000*$dmax/100} fi +l1={1/(2*max(1/3,$l1)^2)} +l2={1/(2*max(1/3,$l2)^2)} +A={$l1*$u*$u+$l2*$v*$v} +B={($l1-$l2)*$u*$v} +C={$l1*$v*$v+$l2*$u*$u} +foreach { +nm={n} w={w} h={h} ds={d},{s} rm +$w,$h,1,1,'X=x-{($w-1)/2};Y=y-{($h-1)/2};$A*X*X+2*$B*X*Y+$C*Y*Y' +* -1 exp r $w,$h,$ds => $nm +} +#@cli graph : [function_image],_plot_type,_vertex_type,_ymin,_ymax,_opacity,_pattern,_color1,... : 'formula',_resolution>=0,_plot_type,_vertex_type,_xmin,xmax,_ymin,_ymax,_opacity,_pattern,_color1,... : (+) +#@cli : Draw specified function graph on selected images. +#@cli : 'plot_type' can be { 0=none | 1=lines | 2=splines | 3=bar }. +#@cli : 'vertex_type' can be { 0=none | 1=points | 2,3=crosses | 4,5=circles | 6,7=squares }. +#@cli : 'pattern' is an hexadecimal number starting with '0x' which can be omitted +#@cli : even if a color is specified. +#@cli : Default values: 'plot_type=1', 'vertex_type=1', 'ymin=ymax=0 (auto)', 'opacity=1', 'pattern=(undefined)' +#@cli : and 'color1=0'. +#@cli : $ image.jpg +rows 50% blur[-1] 3 split[-1] c div[0] 1.5 graph[0] [1],2,0,0,0,1,255,0,0 graph[0] [2],2,0,0,0,1,0,255,0 graph[0] [3],2,0,0,0,1,0,0,255 keep[0] +#@cli grid : size_x[%]>=0,size_y[%]>=0,_offset_x[%],_offset_y[%],_opacity,_pattern,_color1,... +#@cli : Draw xy-grid on selected images. +#@cli : 'pattern' is an hexadecimal number starting with '0x' which can be omitted +#@cli : even if a color is specified. +#@cli : Default values: 'offset_x=offset_y=0', 'opacity=1', 'pattern=(undefined)' and 'color1=0'. +#@cli : $ image.jpg grid 10%,10%,0,0,0.5,255 +#@cli : $ 400,400,1,3,255 grid 10%,10%,0,0,0.3,0xCCCCCCCC,128,32,16 +grid : check "$1>=0 && $2>=0" skip ${3=0},${4=0},${5=1},${6=0},${7=$6} +if ${"is_pattern \"$6\""} +e[0--3] "Draw xy-grid on image$?, with sizes ($1,$2), offsets ($3,$4), opacity $5, pattern $6 and color (${7--1})." +pattern=$6 color=${7--1} +else +e[0--3] "Draw xy-grid on image$?, with sizes ($1,$2), offsets ($3,$4), opacity $5, and color (${6--1})." +pattern=0xFFFFFFFF color=${6--1} +fi +eval " +is_percent(str) = (unref(_is_pct); _is_pct=['#str']; _is_pct[size(_is_pct) - 1]==_'%'); +repeat (l,k, +size = is_percent($1)?max(1,w#k*$1):$1; +size>=1?( +off = (is_percent($3)?size*$3:$3)%size; +for (x = off, x=1?( +off = (is_percent($4)?size*$4:$4)%size; +for (y = off, y] ..,$2,$3,$4,$5,$6,.,255 } rm[-3--1] +else s. c,{1-s} repeat $!-2 { j[$>] ..,$2,$3,$4,$5,$6,.,255 } rm[-2,-1] +fi +#@cli line : x0[%],y0[%],x1[%],y1[%],_opacity,_pattern,_color1,... : (+) +#@cli : Draw specified colored line on selected images. +#@cli : 'pattern' is an hexadecimal number starting with '0x' which can be omitted +#@cli : even if a color is specified. +#@cli : Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'. +#@cli : $ image.jpg repeat 500 line 50%,50%,{u(w)},{u(h)},0.5,${-rgb} done line 0,0,100%,100%,1,0xCCCCCCCC,255 line 100%,0,0,100%,1,0xCCCCCCCC,255 +#@cli line_aa : x0[%],y0[%],x1[%],y1[%],_opacity,_color1,... +#@cli : Draw specified antialiased colored line on selected images. +#@cli : Default values: 'opacity=1' and 'color1=0'. +#@cli : $ 512,512,1,3 repeat 100 line_aa {round(u([w,h,w,h])-1)},1,${-RGB} done +line_aa : check "isnum(${5=1}) && isnum(${6=0})" +e[^-1] "Draw antialiased line ($1,$2) - ($3,$4) on image$?, with opacity $5 and color (${6--1})." +if !$5 return fi +foreach { +x0={${"is_percent $1"}?(w-1)*$1:$1} +y0={${"is_percent $2"}?(h-1)*$2:$2} +x1={${"is_percent $3"}?(w-1)*$3:$3} +y1={${"is_percent $4"}?(h-1)*$4:$4} +if $#>6 eval ${-math_lib}"line_aa($x0,$y0,$x1,$y1,$5,[${6--1}])" +else eval ${-math_lib}"line_aa($x0,$y0,$x1,$y1,$5,$6)" +fi +} +#@cli spline : x0[%],y0[%],u0[%],v0[%],x1[%],y1[%],u1[%],v1[%],_opacity,_color1,... +#@cli : Draw specified colored spline curve on selected images (cubic hermite spline). +#@cli : Default values: 'opacity=1' and 'color1=0'. +#@cli : $ image.jpg repeat 30 { spline {u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},{u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},0.6,255 } +spline : skip ${9=1},${10=0} +e[^-1] "Draw spline from ($1,$2) [$3,$4] to ($5,$6) [$7,$8] on image$?, with opacity $9 and color (${10--1})." +foreach { +x0={if(${"is_percent $1"},$1*(w-1),$1)} +y0={if(${"is_percent $2"},$2*(h-1),$2)} +u0={if(${"is_percent $3"},$3*(w-1),$3)} +v0={if(${"is_percent $4"},$4*(h-1),$4)} +x1={if(${"is_percent $5"},$5*(w-1),$5)} +y1={if(${"is_percent $6"},$6*(h-1),$6)} +u1={if(${"is_percent $7"},$7*(w-1),$7)} +v1={if(${"is_percent $8"},$8*(h-1),$8)} +eval ${-math_lib}"spline(#0,["$x0","$y0"],["$u0","$v0"],["$x1","$y1"],["$u1","$v1"],$9,[${10--1}])" +} +#@cli thickline : x0[%],y0[%],x1[%],y1[%],_thickness,_opacity,_color1 +#@cli : Draw specified colored thick line on selected images. +#@cli : Default values: 'thickness=2', 'opacity=1' and 'color1=0'. +#@cli : $ 400,400,1,3 repeat 100 thickline {u([w,h,w,h,5])},0.5,${-rgb} done +thickline : check "${5=2}>=0 && isnum(${6=1}) && isnum(${7=0})" +e[^-1] "Draw thick line ($1,$2) - ($3,$4) on image$?, with thickness $5, opacity $6 and color (${7--1})." +if !$5 line ${1-4},${6--1} +else foreach { +x0={${"is_percent $1"}?(w-1)*$1:$1} +y0={${"is_percent $2"}?(h-1)*$2:$2} +x1={${"is_percent $3"}?(w-1)*$3:$3} +y1={${"is_percent $4"}?(h-1)*$4:$4} +coords={" +const th = "$5"; +P0 = [ "$x0","$y0" ]; +P1 = [ "$x1","$y1" ]; +dP = P1 - P0; +n = [ -dP[1],dP[0] ]/max(1e-8,norm(dP))*th/2; +round([ P0 - n, P0 + n, P1 + n, P1 - n ]); +"} +polygon 4,$coords,${6--1} +} fi +#@cli thickspline : x0[%],y0[%],u0[%],v0[%],x1[%],y1[%],u1[%],v1[%],_thickness,_opacity,_color1,... +#@cli : Draw specified colored thick spline curve on selected images (cubic hermite spline). +#@cli : Default values: 'thickness=3', 'opacity=1' and 'color1=0'. +#@cli : $ image.jpg repeat 30 { spline {u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},{u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},0.6,255 } +thickspline : skip ${9=3},${10=1},${11=0} +e[^-1] "Draw spline from ($1,$2) [$3,$4] to ($5,$6) [$7,$8] on image$?, ""with thickness $9, opacity $10 and color (${11--1})." +foreach { +x0={if(${"is_percent $1"},$1*(w-1),$1)} +y0={if(${"is_percent $2"},$2*(h-1),$2)} +u0={if(${"is_percent $3"},$3*(w-1),$3)} +v0={if(${"is_percent $4"},$4*(h-1),$4)} +x1={if(${"is_percent $5"},$5*(w-1),$5)} +y1={if(${"is_percent $6"},$6*(h-1),$6)} +u1={if(${"is_percent $7"},$7*(w-1),$7)} +v1={if(${"is_percent $8"},$8*(h-1),$8)} +eval ${-math_lib}"thickspline(#0,["$x0","$y0"],["$u0","$v0"],["$x1","$y1"],["$u1","$v1"],$9,$10,[${11--1}])" +} +#@cli mandelbrot : z0r,z0i,z1r,z1i,_iteration_max>=0,_is_julia={ 0 | 1 },_c0r,_c0i,_opacity : (+) +#@cli : Draw mandelbrot/julia fractal on selected images. +#@cli : Default values: 'iteration_max=100', 'is_julia=0', 'c0r=c0i=0' and 'opacity=1'. +#@cli : $ 400,400 mandelbrot -2.5,-2,2,2,1024 map 0 +blur 2 elevation3d[-1] -0.2 +#@cli marble : _image_weight,_pattern_weight,_angle,_amplitude,_sharpness>=0,_anisotropy>=0,_alpha,_sigma,_cut_low>=0,_cut_high>=0 +#@cli : Render marble like pattern on selected images. +#@cli : Default values: 'image_weight=0.2', 'pattern_weight=0.1', 'angle=45', 'amplitude=0', 'sharpness=0.4' and 'anisotropy=0.8', +#@cli : 'alpha=0.6', 'sigma=1.1' and 'cut_low=cut_high=0'. +#@cli : $ image.jpg +marble , +marble : skip ${1=0.2},${2=0.1},${3=45},${4=0},${5=0.4},${6=0.8},${7=0.6},${8=1.1},${9=0%},${10=100%} +e[^-1] "Render marble like pattern on image$?, with image weight $1, pattern weight $2, angle $3 deg., +amplitude $4, sharpness $5, anisotropy $6, alpha $7, sigma $8, and cut ($9,$10)." +sx={$2*sin($3*pi/180)} sy={$2*cos($3*pi/180)} f sin(x*$sx+y*$sy+i*$1) +if $4 smooth $4,$5,$6,$7,$8 fi +c $9,$10 n 0,255 +#@cli maze : _width>0,_height>0,_cell_size>0 +#@cli : Input maze with specified size. +#@cli : $ maze 30,20 negate normalize 0,255 ++maze : check "isint(${1=15}) && $1>0 && isint(${2=$1}) && $2>0 && isint(${3=24}) && $3>0" +e[^-1] "Input $1x$2 maze." +({round(u($1-1))},{round(u($2-1))}) +$1,$2,1,1,15 +f. 0 a[-2,-1] c +_generate_maze $1,$2 +_render_maze. $3 => [maze] +_generate_maze : +do +x={-2,@-2} y={-2,@-1} +=. 1,$x,$y,0,1 +is_candidate=0 +up=-1 if i($x,$y)&8" && "$y>0" && "!i($x,$y-1,0,1) up=$x,{$y-1},8 is_candidate=1 fi +down=-1 if i($x,$y)&4" && "$y<$2-1" && "!i($x,$y+1,0,1) down=$x,{$y+1},4 is_candidate=1 fi +left=-1 if i($x,$y)&2" && "$x>0" && "!i($x-1,$y,0,1) left={$x-1},$y,2 is_candidate=1 fi +right=-1 if i($x,$y)&1" && "$x<$1-1" && "!i($x+1,$y,0,1) right={$x+1},$y,1 is_candidate=1 fi +if $is_candidate +($up,$down,$left,$right) y. discard. -1 r. 3,{h/3},1,1,-1 shift. 0,{round(u(4))},0,0,2 rows. 0,0 mv. -2 +fi +if $is_candidate +if {-2,@-1}==8 =. {i($x,$y)&7},$x,$y =. {i($x,$y-1)&11},$x,{$y-1} +elif {-2,@-1}==4 =. {i($x,$y)&11},$x,$y =. {i($x,$y+1)&7},$x,{$y+1} +elif {-2,@-1}==2 =. {i($x,$y)&13},$x,$y =. {i($x-1,$y)&14},{$x-1},$y +else =. {i($x,$y)&14},$x,$y =. {i($x+1,$y)&13},{$x+1},$y +fi +z.. 0,1 a[-3,-2] y +else +if h#-2==1 break fi +rows.. 0,{{-2,h}-2} +fi +while 1 +rm.. channels. 0 +_render_maze : +i[0] $1,$1 i[1] [0]x15 +line[8-15] 0,0,100%,0,1,1 +line[4-7,12-15] 0,100%,100%,100%,1,1 +line[2-3,6-7,10-11,14-15] 0,0,0,100%,1,1 +line[1-15:2] 100%,0,100%,100%,1,1 +a[0-15] x r. {w*$1},{h*$1} *. $1 channels. 0,1 +$1,$1,1,1,x $1,$1,1,1,y a[-2,-1] c r. ..,..,1,2,0,2 +[-2,-1] +warp.. .,0,0,0 rm. +#@cli maze_mask : _cellsize>0 +#@cli : Input maze according to size and shape of selected mask images. +#@cli : Mask may contain disconnected shapes. +#@cli : $ 0 text "G'MIC",0,0,53,1,1 dilate 3 autocrop 0 frame 1,1,0 maze_mask 8 dilate 3 negate mul 255 +maze_mask : check "isint(${1=24}) && $1>0" +e[^-1] "Input masked maze from image$? with cell size $1." +compose_channels + >= 50% +foreach { +do ++rand[0] 0,1 *. [0] ({[xM,yM]}) rm.. ++flood[0] {^},0,0,0,1,2 >=. 2 +negate. *.. 15 a[-2,-1] c +flood[0] {-2,^},0,0,0,1,0 +_generate_maze {w},{h} +while iM#0 +rm[0] + _render_maze. $1 => [maze] +} +#@cli newton_fractal : z0r,z0i,z1r,z1i,_angle,0<=_descent_method<=2,_iteration_max>=0,_convergence_precision>0,_expr_p(z),_expr_dp(z),_expr_d2p(z) +#@cli : Draw newton fractal on selected images, for complex numbers in range (z0r,z0i) - (z1r,z1i). +#@cli : Resulting images have 3 channels whose meaning is [ last_zr, last_zi, nb_iter_used_for_convergence ]. +#@cli : 'descent_method' can be { 0=secant | 1=newton | 2=householder }. +#@cli : Default values: 'angle=0', 'descent_method=1', 'iteration_max=200', 'convergence_precision=0.01', 'expr_p(z)=z^^3-1', 'expr_dp(z)=3*z^^2' and 'expr_d2z(z)=6*z'. +#@cli : $ 400,400 newton_fractal -1.5,-1.5,1.5,1.5,0,2,200,0.01,"z^^6 + z^^3 - 1","6*z^^5 + 3*z^^2","30*z^^4 + 6*z" f "[ atan2(i1,i0)*90+20,1,cut(i2/30,0.2,0.7) ]" hsl2rgb +newton_fractal : check "isin(${6=1},0,1,2) && ${7=200}>=0 && ${8=0.01}>0" +skip "${4=0},${9=z^^3-1},${10=3*z^^2},${11=6*z}" +m0,m1,m2=secant,newton,householder +e[^-1] "Draw newton fractal on image$?, for complex range ($1,$2)-($3,$4), with angle $5, $7 max "${m$6}" ""iterations, precision $8, and expressions 'p(z)=$9', 'dp(z)=$10' and 'd2p(z)=$11'." +channels 0,2 +f "* +begin( +const dx = abs($3 - $1); +const dy = abs($4 - $2); +const angle = $5; +const method = $6; +const itermax = $7; +const precision = $8; +zc = [ $1 + $3, $2 + $4 ]/2; +R = rot(-angle°); +); +p(z) = ($9); +dp(z) = ($10); +d2p(z) = ($11); +zn = [ $1 + x*dx/(w-1), $2 + y*dy/(h-1) ]; +angle?(zn = (R*(zn-=zc)+=zc)); +!method?(znm1 = zn + [ precision,0 ]); +repeat (itermax,iter, +pzn = p(zn); +method==0?( +znp1 = zn - pzn**(zn - znm1)//(pzn - p(znm1)); +znm1 = zn; +):method==1?( +dpzn = dp(zn); +znp1 = zn - pzn//dpzn; +):( +dpzn = dp(zn); +d2pzn = d2p(zn); +hn = (pzn**d2pzn)//(2*dpzn^^2); +znp1 = zn - pzn//dpzn**([1,0] + hn); +); +norm(znp1 - zn)=0,0<=_min_scale<=100,_allow_rotation={ 0=0 deg. | 1=180 deg. | 2=90 deg. | 3=any },_spacing,_precision>=0,max_iterations>=0 +#@cli : Try to randomly pack as many sprites as possible onto the 'empty' areas of an image. +#@cli : Sprites can be eventually rotated and scaled during the packing process. +#@cli : First selected image is the canvas that will be filled with the sprites. +#@cli : Its last channel must be a binary mask whose zero values represent potential locations for drawing the sprites. +#@cli : All other selected images represent the sprites considered for packing. +#@cli : Their last channel must be a binary mask that represents the sprite shape (i.e. a 8-connected component). +#@cli : The order of sprite packing follows the order of specified sprites in the image list. +#@cli : Sprite packing is done on random locations and iteratively with decreasing scales. +#@cli : 'nb_scales' sets the number of decreasing scales considered for all specified sprites to be packed. +#@cli : 'min_scale' (in %) sets the minimal size considered for packing (specified as a percentage of the +#@cli : original sprite size). +#@cli : 'spacing' can be positive or negative. +#@cli : 'precision' tells about the desired number of failed trials before ending the filling process. +#@cli : Default values: 'nb_scales=5', 'min_scale=25', 'allow_rotation=3', 'spacing=1', 'precision=7' and 'max_iterations=256'. +#@cli : $ 512,512,1,3,"min(255,y*c/2)" 100%,100% circle 50%,50%,100,1,255 append c image.jpg resize2dy[-1] 24 to_rgba pack_sprites 3,25 +pack_sprites : check "isint(${1=5}) && $1>=0 && ${2=25}>=0 && $2<=100 && isint(${3=3}) && $3>=0 && $3<=3 && +isint(${4=1}) && isint(${5=7}) && $5>=0 && isint(${6=256}) && $6>=0" +e[^-1] "Randomly pack image$? with $1 scales, minimum scale $2%, "${arg0\ $3,no,180\"\ \"deg.,90\"\ \"deg.,any}" rotation, spacing $4, precision $5 and $6 maximum iterations." +N={$!-1} is_first_time=1 +foreach { r 100%,100%,1,{max(2,s)} } +repeat $1 { +rprogress {$>*100/$1} +nb_attempts=0 +ratio={if($1>1,$2+(100-$2)*$}] { +w={w*$ratio} h={h*$ratio} +if $w<1||$h<1 rm +else r $w,$h,1,100%,2 sh. 100% !=. 0 area{1+$>}={is} rm. +fi +} } +l[0,{$N+1}--1] { repeat $6 { +ind={1+($>%$N)} area=${area$ind} +if $3==0 [$ind] +elif $3==1 +rotate[$ind] {round(u)*180} +elif $3==2 +rotate[$ind] {round(u(3))*90} +else +rotate[$ind] {u*360} sh. 100% !=. 0 area={is} rm. +fi ++channels[0] 100% ==. 0 +if $4>1 erode. {2*$4-1} +elif $4<1 dilate. {-2*$4+3} +fi ++rectangle. 0,0,100%,100%,1,0xFFFFFFFF,0 +if $is_first_time noise. 0.1,2 ==. 1 fi +distance. 0 noise. 1,1 +max_patch. {$ind,round(1.5*max(w,h))} +*. .. pointcloud3d. +if $N>1 l. { +s3d /[1] $N round[1] max[1] 1 n={1,@0} +r[2] 3,{{2,h}/3},1,1,-1 +i[2] 1,{2,h} rand[2] 0,1 a[2,3] x sort[2] +,y z[2] 1,3 r[2] 3,$n,1,1 y[2] +r[3] 1,{2*$n},1,1,0 r[4] 1,{3*$n},1,1,0 r[5] 1,$n,1,1,0 a y +} fi +n={@7} +if $n +s3d. rm[-2,-1] +if $3==0 +[-6] i.. (-128;{w};{h};{s}) +if $n>1 4,{$n-1},1,1,-128,0,0,0 fi ++channels.. 100% i.. (-128;{w};{h};{s}) +if $n>1 ... fi +elif $3==1 ++rotate[-6] {round(u(1))*180} i.. (-128;{w};{h};{s}) +if $n>1 +rotate. 180 i.. (-128;{w};{h};{s}) fi +if $n>2 4,{$n-2},1,1,-128,0,0,0 1,100% rand. 0,1 round. 1 j.. .,1 rm. fi ++channels[-4] 100% i.. (-128;{w};{h};{s}) +if $n>1 +channels[-4] 100% i.. (-128;{w};{h};{s}) fi +if $n>2 [-5] fi +else ++rotate[-6] {round(u(3))*90} i.. (-128;{w};{h};{s}) +if $n>1 +rotate. 90 i.. (-128;{w};{h};{s}) fi +if $n>2 +rotate. 90 i.. (-128;{w};{h};{s}) fi +if $n>3 +rotate. 90 i.. (-128;{w};{h};{s}) fi +if $n>4 4,{$n-4},1,1,-128,0,0,0 1,100% rand. 0,3 round. 1 j.. .,1 rm. fi ++channels[-8] 100% i.. (-128;{w};{h};{s}) +if $n>1 +channels[-8] 100% i.. (-128;{w};{h};{s}) fi +if $n>2 +channels[-8] 100% i.. (-128;{w};{h};{s}) fi +if $n>3 +channels[-8] 100% i.. (-128;{w};{h};{s}) fi +if $n>4 [-9] fi +fi +y[{$N+3}--1] a[{$N+3}--1] y +fi +rm... +[0] sh. 100% f. 1 -. [-4] +j3d.. ...,0,0,0,1,2,0,0 rm[-3,-1] +sh. 100% area_fg. 0,1 ==. $area +*. ... rm... sh.. 0,{-2,s-2} *. .. rm. +if iM j[0] ..,0,0,0,0,1,. rm[-2,-1] +else +rm[-2,-1] +nb_attempts+=1 +if $nb_attempts>$5 break else continue fi +fi +} k[0] } +} k[0] +#@cli piechart : label_height>=0,label_R,label_G,label_B,"label1",value1,R1,G1,B1,...,"labelN",valueN,RN,GN,BN +#@cli : Draw pie chart on selected (RGB) images. +#@cli : $ image.jpg piechart 25,0,0,0,"Red",55,255,0,0,"Green",40,0,255,0,"Blue",30,128,128,255,"Other",5,128,128,128 +piechart : check $1>=0 +e[^-1] "Draw pie chart on image$?, with label height $1 and color ($2,$3,$4)." +$=arg +foreach { +ellipse 50%,50%,{w/2-1},{h/2-1},0,1,1 +ellipse 50%,50%,{w/2-1},{h/2-1},0,1,0xFFFFFFFF +(${6--1:5}) normalize_sum. +theta=0 +if w>1 repeat w { +xe={0.5*{-2,w}*(1+cos($theta))} +ye={0.5*{-2,h}*(1+sin($theta))} +line.. 50%,50%,$xe,$ye +theta-={2*pi*i($>)} +} fi +theta=0 +repeat w { if i($>) +ntheta={$theta-2*pi*i($>)} +xc={0.5*{-2,w}*(1+0.5*cos(0.5*($ntheta+$theta)))} +yc={0.5*{-2,h}*(1+0.5*sin(0.5*($ntheta+$theta)))} +xf={0.5*{-2,w}*(1+0.8*cos(0.5*($ntheta+$theta)))} +yf={0.5*{-2,h}*(1+0.8*sin(0.5*($ntheta+$theta)))} +flood.. $xf,$yf,0,0,0,1,${arg{7+5*$>}},${arg{8+5*$>}},${arg{9+5*$>}} +if abs($ntheta-$theta)>0.1 +0 t. ${arg{5+5*$>}},0,0,$1,1,1 +($2^$3^$4) r. ..,..,1,3 *. .. +j[-4] .,{$xc-w/2},{$yc-h/2},0,0,1,.. +rm[-2,-1] +fi +theta=$ntheta +fi } +rm. +} +#@cli plasma : _alpha,_beta,_scale>=0 : (+) +#@cli : Draw a random colored plasma fractal on selected images. +#@cli : This command implements the so-called 'Diamond-Square' algorithm. +#@cli : Default values: 'alpha=1', 'beta=1' and 'scale=8'. +#@cli : $ 400,400,1,3 plasma +#@cli : $$ https://gmic.eu/oldtutorial/_plasma +#@cli point : x[%],_y[%],_z[%],_opacity,_color1,... : (+) +#@cli : Set specified colored pixel on selected images. +#@cli : Default values: 'z=0', 'opacity=1' and 'color1=0'. +#@cli : $ image.jpg repeat 10000 point {u(100)}%,{u(100)}%,0,1,${-rgb} done +#@cli polka_dots : diameter>=0,_density,_offset1,_offset2,_angle,_aliasing,_shading,_opacity,_color,... +#@cli : Draw dots pattern on selected images. +#@cli : Default values: 'density=20', 'offset1=offset2=50', 'angle=0', 'aliasing=10', 'shading=1', 'opacity=1' and 'color=255'. +#@cli : $ image.jpg polka_dots 10,15,0,0,20,10,1,0.5,0,128,255 +polka_dots : check $1>=0 skip ${2=20},${3=50},${4=50},${5=0},${6=10},${7=1},${8=1},${9=255} +e[^-1] "Draw polka dots on image$?, with diameter $1, density $2, angle $3 deg., shift ($4,$5), aliasing $6 and +shading $7." +theta={$5*pi/180} ct={cos($theta)} st={sin($theta)} mid1={$1/2} mid2={$2/2} +i[0] (${9--1}) y[0] c +repeat $!-1 { +WH={max(w,h)} +100%,100%,100%,1,"xn = 100*x/"$WH"-$3; yn = 100*y/"$WH"-$4; xr = xn*"$ct"-yn*"$st"; yr = xn*"$st"+yn*"$ct"; xc = xr%$2-"$mid2"; yc = yr%$2-"$mid2"; "$mid1"-sqrt(xc*xc+yc*yc)" +*. $6 c. 0,$7 n. 0,$8 (${9--1}) y. c r. ..,..,.. +j... .,0,0,0,0,1,.. rm[-2,-1] mv. 1 +} +rm[0] +#@cli polygon : N>=1,x1[%],y1[%],...,xN[%],yN[%],_opacity,_pattern,_color1,... : (+) +#@cli : Draw specified colored N-vertices polygon on selected images. +#@cli : 'pattern' is an hexadecimal number starting with '0x' which can be omitted +#@cli : even if a color is specified. If a pattern is specified, the polygon is +#@cli : drawn outlined instead of filled. +#@cli : Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'. +#@cli : $ image.jpg polygon 4,20%,20%,80%,30%,80%,70%,20%,80%,0.3,0,255,0 polygon 4,20%,20%,80%,30%,80%,70%,20%,80%,1,0xCCCCCCCC,255 +#@cli : $ image.jpg 2,16,1,1,'u(if(x,{h},{w}))' polygon[-2] {h},{^},0.6,255,0,255 remove[-1] +#@cli quiver : [function_image],_sampling[%]>0,_factor>=0,_is_arrow={ 0 | 1 },_opacity,_color1,... +#@cli : Draw specified 2D vector/orientation field on selected images. +#@cli : Default values: 'sampling=5%', 'factor=1', 'is_arrow=1', 'opacity=1', 'pattern=(undefined)' +#@cli : and 'color1=0'. +#@cli : $ 100,100,1,2,'if(c==0,x-w/2,y-h/2)' 500,500,1,3,255 quiver[-1] [-2],10 +#@cli : $ image.jpg +resize2dy 600 luminance[0] gradient[0] mul[1] -1 reverse[0,1] append[0,1] c blur[0] 8 orientation[0] quiver[1] [0],20,1,1,0.8,255 +quiver : check ${"is_image_arg $1"}" && ${2=5%}>0 && ${3=1}>=0 && isbool(${4=1})" skip "${5=1},${6=0}" +e[^-1] "Draw 2D vector field $1 on image$?, with sampling $2, factor $3, arrows "${"arg0 $4,disabled,enabled"}", +opacity $5 and color (${6--1})." +pass$1 repeat $!-1 { l[$>,-1] { +eval ${-math_lib}" +s_sampling = ['$2']; +sampling = s_sampling[size(s_sampling) - 1 ]==_'%'?min(w#0,h#0)*$2:$2; +vmax = max(abs(im),abs(iM)); +vmax = vmax?vmax:1; +fact = $3*sampling/vmax; +for (y = sampling/2, y=0','mirroring={ 0=none | 1=x | 2=y | 3=xy } +#@cli : Render rorschach-like inkblots on selected images. +#@cli : Default values: 'smoothness=5%' and 'mirroring=1'. +#@cli : $ 400,400 rorschach 3% +rorschach : check "${1=5%}>=0 && isint(${2=1}) && $2>=0 && $2<=3" +e[^-1] "Render rorschach-like inkblots on image$?, with smoothness $1 and "${arg0\ $2,no,x,y,xy}"-mirroring." +if $2==0 +rand -1,1 b $1 >= 0 +elif $2==1 +foreach { +w={w} +columns 0,{w/2-1} rand -1,1 b $1 >= 0 ++mirror x if $w%2 columns. 1,100% fi a x +} +elif $2==2 +foreach { +h={h} +rows 0,{h/2-1} rand -1,1 b $1 >= 0 ++mirror y if $h%2 rows. 1,100% fi a y +} +elif $2==3 +foreach { +w={w} h={h} +z 0,0,{w/2-1},{h/2-1} rand -1,1 b $1 >= 0 ++mirror x if $w%2 columns. 1,100% fi a x ++mirror y if $h%2 rows. 1,100% fi a y +} +fi +#@cli sierpinski : recursion_level>=0 +#@cli : Draw Sierpinski triangle on selected images. +#@cli : Default value: 'recursion_level=7'. +#@cli : $ image.jpg sierpinski 7 +sierpinski : check ${1=7}>=0 skip ${2=50},${3=0},${4=0},${5=100},${6=100},${7=100} +e[^-1] "Draw Sierpinski triangle of degree $1 on image$?." +_sierpinski ${2-7},$1 +_sierpinski : +if $7<=0 polygon 3,$1%,$2%,$3%,$4%,$5%,$6%,1,255 return fi +_sierpinski $1,$2,{($1+$3)/2},{($2+$4)/2},{($1+$5)/2},{($2+$6)/2},{$7-1} +_sierpinski {($1+$3)/2},{($2+$4)/2},$3,$4,{($3+$5)/2},{($4+$6)/2},{$7-1} +_sierpinski {($1+$5)/2},{($2+$6)/2},$5,$6,{($3+$5)/2},{($4+$6)/2},{$7-1} +#@cli spiralbw : width>0,_height>0,_is_2dcoords={ 0 | 1 } +#@cli : Input a 2D rectangular spiral image with specified size. +#@cli : Default values: 'height=width' and 'is_2dcoords=0'. +#@cli : $ spiralbw 16 +#@cli : $ image.jpg spiralbw {[w,h]},1 +warp[0] [1],0,1,1 +warp[2] [1],2,1,1 ++spiralbw : check "$1>=1 && ${2=$1}>=1 && isbool(${3=0})" +e[^-1] "Input 2D rectangular spiral image of size $1x$2." +main="alpha = min(x,y,w - 1 - x,h - 1 - y); +t0 = alpha*2*(w + h) - 4*alpha^2; +X = x - alpha; +Y = y - alpha; +W = w - 2*alpha; +H = h - 2*alpha; +t = t0 + (Y==0?X: +X==W - 1?W - 1 + Y: +Y==H - 1?2*W + H - 3 - X: +2*(W + H - 2) - Y);" +if $3 $1,$2,1,2,$main"[ t%w, int(t/w) ]" else $1,$2,1,1,$main fi +#@cli tetraedron_shade : x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3,R0,G0,B0,...,R1,G1,B1,...,R2,G2,B2,...,R3,G3,B3,... +#@cli : Draw tetraedron with interpolated colors on selected (volumetric) images. +tetraedron_shade : +e[^-1] "Draw tetraderon ($1,$2,$3)-($4,$5,$6)-($7,$8,$9)-($10,$11,$12) with interpolated colors in image$?." +xm={round(min($1,$4,$7,$10),1,-1)} xM={round(max($1,$4,$7,$10),1,1)} +ym={round(min($2,$5,$8,$11),1,-1)} yM={round(max($2,$5,$8,$11),1,1)} +zm={round(min($3,$6,$9,$12),1,-1)} zM={round(max($3,$6,$9,$12),1,1)} +l[] { (${1-3},1;${4-6},1;${7-9},1;${10-12},1) (${13--1}) r. {w/4},4,1,1,-1 s. x solve[^0] [0] rm[0] a c } +f[^-1] "* +begin( +x0 = $1; y0 = $2; z0 = $3; +x1 = $4; y1 = $5; z1 = $6; +x2 = $7; y2 = $8; z2 = $9; +x3 = $10; y3 = $11; z3 = $12; +u01 = x1 - x0; v01 = y1 - y0; w01 = z1 - z0; +u02 = x2 - x0; v02 = y2 - y0; w02 = z2 - z0; +u03 = x3 - x0; v03 = y3 - y0; w03 = z3 - z0; +u12 = x2 - x1; v12 = y2 - y1; w12 = z2 - z1; +u13 = x3 - x1; v13 = y3 - y1; w13 = z3 - z1; +u23 = x3 - x2; v23 = y3 - y2; w23 = z3 - z2; +nx012 = v01*w02 - w01*v02; ny012 = w01*u02 - u01*w02; nz012 = u01*v02 - v01*u02; +if (nx012*u03 + ny012*v03 + nz012*w03<0, nx012*=-1; ny012*=-1; nz012*=-1); +nx013 = v01*w03 - w01*v03; ny013 = w01*u03 - u01*w03; nz013 = u01*v03 - v01*u03; +if (nx013*u02 + ny013*v02 + nz013*w02<0, nx013*=-1; ny013*=-1; nz013*=-1); +nx023 = v02*w03 - w02*v03; ny023 = w02*u03 - u02*w03; nz023 = u02*v03 - v02*u03; +if (nx023*u01 + ny023*v01 + nz023*w01<0, nx023*=-1; ny023*=-1; nz023*=-1); +nx123 = v12*w13 - w12*v13; ny123 = w12*u13 - u12*w13; nz123 = u12*v13 - v12*u13; +if (-nx123*u01 - ny123*v01 - nz123*w01<0, nx123*=-1; ny123*=-1; nz123*=-1); +); +if (x<"$xm" || x>"$xM" || y<"$ym" || y>"$yM" || z<"$zm" || z>"$zM",i, +dx0 = x - x0; dy0 = y - y0; dz0 = z - z0; +dx1 = x - x1; dy1 = y - y1; dz1 = z - z1; +is_in = dx0*nx012 + dy0*ny012 + dz0*nz012>=0 && +dx0*nx013 + dy0*ny013 + dz0*nz013>=0 && +dx0*nx023 + dy0*ny023 + dz0*nz023>=0 && +dx1*nx123 + dy1*ny123 + dz1*nz123>=0; +is_in? i(#-1,0,0,0)*x + i(#-1,0,1,0)*y + i(#-1,0,2,0)*z + i(#-1,0,3,0) :i +) +" +rm. +#@cli t : eq. to 'text'. : (+) +#@cli text : text,_x[%|~],_y[%|~],_{ font_height[%]>=0 | custom_font },_opacity,_color1,... : (+) +#@cli : Draw specified colored text string on selected images. +#@cli : (eq. to 't').\n +#@cli : If one of the x or y argument ends with a '~', its value is expected to be a centering ratio (in [0,1]) rather than a position. +#@cli : Usual centering ratio are { 0=left-justified | 0.5=centered | 1=right-justified }. +#@cli : Sizes '13' and '128' are special and correspond to binary fonts (no-antialiasing). Any other font size is rendered with anti-aliasing. +#@cli : Specifying an empty target image resizes it to new dimensions such that the image contains the entire text string. +#@cli : A custom font can be specified as a variable name that stores an image list of 256 or 512 items (512 for 256 character sprites + 256 associated opacities). +#@cli : Default values: 'x=y=0.01~', 'font_height=16', 'opacity=1' and 'color1=0'. +#@cli : $ image.jpg resize2dy 600 y=0 repeat 30 { text {2*$>}" : This is a nice text, isn't it ?",10,$y,{2*$>},0.9,255 y+={2*$>} } +#@cli : $ 0 text "G'MIC",0,0,23,1,255 +#@cli to : eq. to 'text_outline'. +to : skip "${1=}",${2=0.01~},${3=0.01~} check "${4=7.5%}>0 && ${5=2}>=0 && isnum(${6=1}) && isnum(${7=255}) && ""isnum(${8=$7}) && isnum(${9=$7}) && isnum(${10=255})" +_text_outline $"*" +#@cli text_outline : text,_x[%|~],_y[%|~],_font_height[%]>0,_outline>=0,_opacity,_color1,... +#@cli : Draw specified colored and outlined text string on selected images. +#@cli : If one of the x or y argument ends with a '~', its value is expected to be +#@cli : a centering ratio (in [0,1]) rather than a position. +#@cli : Usual centering ratio are { 0=left-justified | 0.5=centered | 1=right-justified }. +#@cli : Default values: 'x=y=0.01~', 'font_height=7.5%', 'outline=2', 'opacity=1', 'color1=color2=color3=255' and 'color4=255'. +#@cli : $ image.jpg text_outline "Hi there!",10,10,63,3 +text_outline : skip "${1=}",${2=0.01~},${3=0.01~} +check "${4=7.5%}>0 && ${5=2}>=0 && isnum(${6=1}) && isnum(${7=255}) && ""isnum(${8=$7}) && isnum(${9=$7}) && isnum(${10=255})" +_text_outline $"*" +_text_outline : skip "${1=}" +e[0--3] "Draw outlined text '$1' at position ($2,$3) on image$?, with font height $4, outline $5, opacity $6 and +color ${7--1}." +if ['"$1"']==0 return fi +sepx,sepy={"sx=['$2']; sy=['$3']; [sx[size(sx)-1], sy[size(sy)-1]]"} +is_fontpercent=${"is_percent $4"} +xpos={`s=['"$2"'];$sepx==_'~'||$sepx==_'%'?s[0,size(s)-1]:s`} +ypos={`s=['"$3"'];$sepy==_'~'||$sepy==_'%'?s[0,size(s)-1]:s`} +foreach { +0 t. "$1",0,0,{-2,$is_fontpercent?h*$4:$4},1,1 expand_xy. {1+$5},0 ++dilate. {2*$5+1} +i[-3] (${7--1}) r... {s#0},1,1,1,0,2 y... c r... .,.,1,100% +if $5 *[-3,-2] else rm.. fi +if w#0 +j... ..,{[($sepx==_'~'?(w#0-1-w):$sepx==_'%'?(w#0-1)%:1)*$xpos,($sepy==_'~'?(h#0-1-h):$sepy==_'%'?(h#0-1)%:1)*$ypos]},0,0,$6,. +k[0] +else k[1] +fi +} +#@cli triangle_shade : x0,y0,x1,y1,x2,y2,R0,G0,B0,...,R1,G1,B1,...,R2,G2,B2,... +#@cli : Draw triangle with interpolated colors on selected images. +#@cli : $ image.jpg triangle_shade 20,20,400,100,120,200,255,0,0,0,255,0,0,0,255 +triangle_shade : +e[^-1] "Draw triangle ($1,$2)-($3,$4)-($5,$6) with interpolated colors on image$?." +l[] { ($1,$2,1;$3,$4,1;$5,$6,1) (${7--1}) r. {w/3},3,1,1,-1 s. x solve[^0] [0] rm[0] a c } +invarea={(-$4*$5+$2*(-$3+$5)+$1*($2-$6)+$3*$6)^-1} +s1={$2*$5-$1*$6} s2={$6-$2} s3={$1-$5} +t1={$1*$4-$2*$3} t2={$2-$4} t3={$3-$1} +repeat $!-1 { +l[$>,-1] { +repeat s#0 { +a={i(0,0,0,$>)} b={i(0,1,0,$>)} c={i(0,2,0,$>)} +sh[0] $> +f. "s = "$invarea"*("$s1" + "$s2"*x + "$s3"*y); +t = "$invarea"*("$t1" + "$t2"*x + "$t3"*y); +s>=0 && t>=0 && t+s<=1 ? "$a"*x+"$b"*y+"$c":i" +rm. +} +} +} +rm. +#@cli truchet : _scale>0,_radius>=0,_pattern_type={ 0=straight | 1=curved } +#@cli : Fill selected images with random truchet patterns. +#@cli : Default values: 'scale=32', 'radius=5' and 'pattern_type=1'. +#@cli : $ 400,300 truchet , +truchet : check "isint(${1=32}) && $1>0 && ${2=3}>=0" skip ${3=1} +e[^-1] "Render "${arg0\ !$3,curved,straight}" truchet patterns in image$?, with scale $1 and radius $2." +foreach { +nm={n} w={w} h={h} s={s} rm +$1,$1 = 1,0,0 = 1,100%,100% distance 1,{1+$3} M={int(iM/2)} +ir {$M-$2/2-($1%2)},{$M+$2/2} +mirror y a x +{round($w/$1,1,1)},{round($h/$1,1,1)} rand. 0,1 >=. 50% r. {w*$1},{h*$1} *. $1 +channels. 0,1 (0,{$1-1}) r. $1,$1,1,1,3 +transpose. a[-2,-1] c ri. ..,0,2 +[-2,-1] +warp.. . rm. >= 50% r $w,$h,1,1,0 r 100%,100%,1,$s => $nm +} +#@cli turbulence : _radius>0,_octaves={1,2,3...,12},_alpha>0,_difference={-10,10},_mode={0,1,2,3} +#@cli : Render fractal noise or turbulence on selected images. +#@cli : Default values: 'radius=32', 'octaves=6', 'alpha=3', 'difference=0' and 'mode=0'. +#@cli : $ 400,400,1,3 turbulence 16 +#@cli : $$ https://gmic.eu/oldtutorial/_turbulence +turbulence : check "${1=32}>0 && ${2=6}>0" skip ${3=3},${4=0},${5=0} +e[^-1] "Render fractal noise or turbulence on image$?, with radius $1, octaves $2, damping per octave $3, +difference $4 and mode $5." +foreach { +nm={n} +if $4 . fi +f. 0 +noise. 10,0 b. $1,0 +if $5==0||$5==1 -. {ia} abs. +elif $5==3||$5==4 ^. 2 +elif $5==5 ^. 3 +fi +repeat $2-1 { ++noise.. 10,0 b. {$1/2^$>},0 +if $5==0 -. {ia} abs. +elif $5==4 ^. 2 +elif $5==5 ^. 3 +fi +*.. $3 +[-2--1] +} +n. 0,255 +rm.. +if $4 *. $4 mv.. 2 - n. 0,255 fi +=> $nm +} +#@cli yinyang +#@cli : Draw a yin-yang symbol on selected images. +#@cli : $ 400,400 yinyang +yinyang : +e[^-1] "Draw yin-yang symbol on image$?." +f 0 +foreach { +s={s} channels 0 +r={round(0.95*min(w,h)/4)} ++line 50%,0,50%,50%,1,2 ellipse. 50%,{h/2-$r},$r,$r,0,1,2 +line. 50%,50%,50%,100%,1,1 ellipse. 50%,{h/2+$r},$r,$r,0,1,1 +flood. {w/2-$r},50%,0,0,0,1,2 +flood. {w/2+$r},50%,0,0,0,1,1 +ellipse.. 50%,50%,{2*$r},{2*$r},0,1,1 +* +ellipse. 50%,{h/2-$r},{$r/3},{$r/3},0,1,1 +ellipse. 50%,{h/2+$r},{$r/3},{$r/3},0,1,2 +r 100%,100%,1,$s +} +#@cli :: Matrix Computation +#@cli dijkstra : starting_node>=0,ending_node>=0 : (+) +#@cli : Compute minimal distances and paths from specified adjacency matrices by the Dijkstra algorithm. +#@cli eigen : (+) +#@cli : Compute the eigenvalues and eigenvectors of selected symmetric matrices or matrix fields. +#@cli : If one selected image has 3 or 6 channels, it is regarded as a field of 2x2 or 3x3 symmetric matrices, +#@cli : whose eigen elements are computed at each point of the field. +#@cli : $ (1,0,0;0,2,0;0,0,3) +eigen +#@cli : $ image.jpg structuretensors blur 2 eigen split[0] c +#@cli : $$ https://gmic.eu/oldtutorial/_eigen +#@cli eye : _size>0 +#@cli : Insert an identity matrix of given size at the end of the image list. +#@cli : $ eye 3 eye 7 eye 10 ++eye : check "isint($1) && $1>=0" +e[^-1] "Input $1x$1 identity matrix." +if $1 $1,$1,1,1,x==y else 0 fi +#@cli invert : _use_LU={ 0=SVD | 1=LU },_lambda>=0 : (+) +#@cli : Inverse selected matrices (or compute Moore-Penrose pseudoinverse for non-square matrices). +#@cli : SVD solver is slower but more precise than LU. +#@cli : 'lambda' is used only in the Moore-Penrose pseudoinverse, by estimating A^t.(A^t.A + lambda.Id)^-1. +#@cli : Default value: 'use_LU=0' and 'lambda=0'. +#@cli : $ (0,1,0;0,0,1;1,0,0) +invert +#@cli orthogonalize : _mode = { 0=orthogonalize | 1=orthonormalize } +#@cli : Orthogonalize or orthonormalize selected matrices, using Modified Gram-Schmidt process. +#@cli : Default value: 'mode=0'. +orthogonalize : +if isbool($1) mode=$1 else mode=0 noarg fi +u0,u1,v0,v1=Orthogonalize,Orthonormalize,x,ce +e[^-1] ${u$mode}" matri"${v{$!!=1}}"$?, using Modified Gram-Schmidt process." +foreach { +eval "> +proj(u,v) = (dot(u,v)/dot(u,u)*u); +for (p = 1, p=1 +#@cli : Compute an approximation of the 'm' largest eigenvalues and eigenvectors of selected symmetric matrices, +#@cli : using the Arnoldi iteration method (https://en.wikipedia.org/wiki/Arnoldi_iteration). +#@cli : A larger 'm' goes with better numerical precision. +#@cli : $ (1,0,0;0,2,0;0,0,3) +meigen 3 +meigen : check "isint($1) && $1>0" +if $!!=1 s="ce" else s="x" fi +e[^-1] "Compute $1 largest eigen-values of matri"$s"$?." +foreach { +nm={n} +if w!=h" || "d!=1" || "s!=1 v 1 error[0--5] "Command 'meigen': Image '"$nm"' is not a square matrix." fi +eval ${-math_lib}" store('val',meig(crop(),$1,h),1,min($1,h))" $val k. => $nm +} +#@cli mproj : [dictionary],_method,_max_iter={ 0=auto | >0 },_max_residual>=0 : (+) +#@cli : Find best matching projection of selected matrices onto the span of an over-complete +#@cli : dictionary D, using the orthogonal projection or Matching Pursuit algorithm. +#@cli : Selected images are 2D-matrices in which each column represent a signal to project. +#@cli : '[dictionary]' is a matrix in which each column is an element of the dictionary D. +#@cli : 'method' tells what projection algorithm must be applied. It can be: +#@cli : \ - 0 = orthogonal projection (least-squares solution using LU-based solver). +#@cli : \ - 1 = matching pursuit. +#@cli : \ - 2 = matching pursuit, with a single orthogonal projection step at the end. +#@cli : \ - >=3 = orthogonal matching pursuit where an orthogonal projection step is performed +#@cli : \ every 'method-2' iterations. +#@cli : 'max_iter' sets the max number of iterations processed for each signal. +#@cli : If set to '0' (default), 'max_iter' is equal to the number of columns in D. +#@cli : (only meaningful for matching pursuit and its variants). +#@cli : 'max_residual' gives a stopping criterion on signal reconstruction accuracy. +#@cli : (only meaningful for matching pursuit and its variants). +#@cli : For each selected image, the result is returned as a matrix W +#@cli : whose columns correspond to the weights associated to each column of D, +#@cli : such that the matrix product D*W is an approximation of the input matrix. +#@cli : Default values: 'method=0', 'max_iter=0' and 'max_residual=1e-6'. +#@cli solve : [image],_use_LU={ 0=SVD | 1=LU } : (+) +#@cli : Solve linear system AX = B for selected B-matrices and specified A-matrix. +#@cli : If the system is under- or over-determined, the least squares solution is returned. +#@cli : Default value: 'use_LU=0'. +#@cli : $ (0,1,0;1,0,0;0,0,1) (1;2;3) +solve[-1] [-2] +#@cli svd : (+) +#@cli : Compute SVD decomposition of selected matrices. +#@cli : $ 10,10,1,1,'if(x==y,x+u(-0.2,0.2),0)' +svd +#@cli transpose +#@cli : Transpose selected matrices. +#@cli : $ image.jpg +transpose +transpose : +e[^-1] "Transpose image$?." +permute yxzc +#@cli trisolve : [image] : (+) +#@cli : Solve tridiagonal system AX = B for selected B-vectors and specified tridiagonal A-matrix. +#@cli : Tridiagonal matrix must be stored as a 3 column vector, where 2nd column contains the +#@cli : diagonal coefficients, while 1st and 3rd columns contain the left and right coefficients. +#@cli : $ (0,0,1;1,0,0;0,1,0) (1;2;3) +trisolve[-1] [-2] +#@cli :: 3D Meshes +#@cli +3d : eq. to 'add3d'. : (+) +#@cli add3d : tx,_ty,_tz : [object3d] : (no arg) : (+) +#@cli : Shift selected 3D objects with specified displacement vector, or merge them with specified +#@cli : 3D object, or merge all selected 3D objects together. +#@cli : (eq. to '+3d'). +#@cli : Default values: 'ty=tz=0'. +#@cli : $ sphere3d 10 repeat 5 { +add3d[-1] 10,{u(-10,10)},0 color3d[-1] ${-rgb} } add3d +#@cli : $ repeat 20 { torus3d 15,2 color3d[-1] ${-rgb} mul3d[-1] 0.5,1 if $>%2 rotate3d[-1] 0,1,0,90 fi add3d[-1] 70 add3d rotate3d[-1] 0,0,1,18 } double3d 0 +#@cli animate3d : nb_frames>0,_step_angle_x,_step_angle_y,_step_angle_z,_zoom_factor,0<=_fake_shadow_level<=100,_[background] +#@cli : Generate 3D animation frames of rotating 3D objects. +#@cli : Frames are stacked along the z-axis (volumetric image). +#@cli : Frame size is the same as the size of the '[background]' image (or 800x800 if no background specified). +#@cli : Default values: 'step_angle_x=0', 'step_angle_y=5', 'step_angle_z=0', 'zoom_factor=1', 'fake_shadow_level=50' and 'background=(undefined)'. +animate3d : check "isint($1) && $1>0 && isnum(${2=0}) && isnum(${3=5}) && isnum(${4=0}) && ${5=1}>0 && ""inrange(${6=50},0,100)" skip "${7=}" +e[^-1] "Generate 3D animation frames from 3D object$?, with $1 frames, angle steps (${2-4}), zoom factor $5 ""and $6% fake shadow." +if ${"is_image_arg $7"} pass$7 +else 3,2,1,1,"32,32,64,64,116,96" permute. cyzx r. 800,800,1,3,3 round. +fi +=> anim3d_bg +repeat {$!-1} { l[$>,-1] { +check ${-is_mesh3d..} nm={0,n} bn={0,b} +e " * Object '"$bn"': 0/$1" +c3d[0] n3d[0] *3d[0] {1,$5*min(w,h)/2} +repeat $1 { +e "\r * Object '"$bn"': "{1+$>}"/$1" ++r3d[0] 0,0,1,{$>*$4} r3d. 0,1,0,{$>*$3} r3d. 1,0,0,{$>*$2} +{1,[w,h,d,4]},-1 j3d. ..,50%,50%,0,1 +sh. 0,{s-2} +l.. { s c max } !=. -1 mul.. . mul. 255 j... .,0,0,0,{-2,s} rm[-2,-1] +if $6 sh. 100% +b. 2% shift. {m=min(w,h)*2%;[m,m]} -. {255-$6*255%} c. 0,255 max[-2,-1] rm. fi ++blend[1,-1] alpha rm[-3,-2] +if {*} w. -1,-1,0 fi +} +a[2--1] z +rv[0,-1] rm. +} =>[$>] $nm } +rm. +#@cli apply_camera3d : pos_x,pos_y,pos_z,target_x,target_y,target_z,up_x,up_y,up_z +#@cli : Apply 3D camera matrix to selected 3D objects. +#@cli : Default values: 'target_x=0', 'target_y=0', 'target_z=0', 'up_x=0', 'up_y=-1' and 'up_z=0'. +apply_camera3d : skip ${4=0},${5=0},${6=0},${7=0},${8=-1},${9=0} +e[^-1] "Apply 3D camera matrix to 3D object$?, with camera position ($1,$2,$3), target position ($4,$5,$6) and +up-vector ($7,$8,$9)." +({$4-$1}^{$5-$2}^{$6-$3}) +($7^$8^$9) +orientation[-2,-1] +_cross3d {-2,^},{^} +_cross3d {^},{-3,^} +rm... y[-3--1] x mv[-2,-1] -3 +a[-3--1] y z. 0,3 +-3d[^-1] $1,$2,$3 pose3d[^-1] {^} rm. -3d 0,0,800 +_cross3d : +({$2*$6-$3*$5}^{$3*$4-$1*$6}^{$1*$5-$2*$4}) orientation. y. +#@cli apply_matrix3d : a11,a12,a13,...,a31,a32,a33 +#@cli : Apply specified 3D rotation matrix to selected 3D objects. +#@cli : $ torus3d 10,1 +apply_matrix3d {mul(rot(1,0,1,-15°),[1,0,0,0,2,0,0,0,8],3)} double3d 0 +apply_matrix3d : +e[^-1] "Apply 3x3 matrix (${1-3};${4-6};${7-9}) to 3D object$?." +foreach { nbp={i[6]} sh 8,{8+3*$nbp-1},0,0 r. 3,$nbp,1,1,-1 3,3,1,1,$* transpose. m*[-2,-1] rm. } +#@cli array3d : size_x>=1,_size_y>=1,_size_z>=1,_offset_x[%],_offset_y[%],_offset_y[%] +#@cli : Duplicate a 3D object along the X,Y and Z axes. +#@cli : Default values: 'size_y=1', 'size_z=1' and 'offset_x=offset_y=offset_z=100%'. +#@cli : $ torus3d 10,1 +array3d 5,5,5,110%,110%,300% +array3d : check "isint($1) && $1>0 && isint(${2=1}) && $2>0 && isint(${3=1}) && $3>0" +skip ${4=100%},${5=100%},${6=100%} +e[^-1] "Duplicate 3D object$? along X,Y,Z axes with factors ($1,$2,$3) and offsets ($4,$5,$6)." +foreach { ++rows 8,{8+3*i[6]} r. 3,{h/3},1,1,-1 s. x,3 +dx={-3,if(${is_percent\ $4},$4*(iM-im),$4)} +dy={-2,if(${is_percent\ $5},$5*(iM-im),$5)} +dz={if(${is_percent\ $6},$6*(iM-im),$6)} +rm[-3--1] +off=0 repeat int(log2($1)) { +++3d. {2^$>*$dx} +3d. .. +if !($1&(2^$>)) rm.. else +3d.. $off off+={2^$>*$dx} fi +} +3d. $off +3d +off=0 repeat int(log2($2)) { +++3d. 0,{2^$>*$dy} +3d. .. +if !($2&(2^$>)) rm.. else +3d.. 0,$off off+={2^$>*$dy} fi +} +3d. 0,$off +3d +off=0 repeat int(log2($3)) { +++3d. 0,0,{2^$>*$dz} +3d. .. +if !($3&(2^$>)) rm.. else +3d.. 0,0,$off off+={2^$>*$dz} fi +} +3d. 0,0,$off +3d +} +#@cli arrow3d : x0,y0,z0,x1,y1,z1,_radius[%]>=0,_head_length[%]>=0,_head_radius[%]>=0 +#@cli : Input 3D arrow with specified starting and ending 3D points. +#@cli : Default values: 'radius=5%', 'head_length=25%' and 'head_radius=15%'. +#@cli : $ repeat 10 { a={$>*2*pi/10} arrow3d 0,0,0,{cos($a)},{sin($a)},-0.5 } +3d ++arrow3d : check "${7=5%}>=0 && ${8=25%}>=0 && ${9=15%}>=0" +e[^-1] "Input 3D arrow, from (${1-3}) to (${4-6}), with radius $7, head length $8 and head radius $9." +L={sqrt(($4-$1)^2+($5-$2)^2+($6-$3)^2)} +R={if(${is_percent\ $7},$7*$L,$7)} +l={if(${is_percent\ $8},$8*$L,$8)} +r={if(${is_percent\ $9},$9*$L,$9)} +L-=$l cylinder3d $R,$L cone3d $r,$l +3d. 0,0,$L +3d[-2,-1] +({$4-$1}^{$5-$2}^{$6-$3}) (0.01^-0.02^0.03) orientation[-2,-1] +_cross3d {-2,^},{^} _cross3d {^},{-3,^} rm... y[-3--1] x mv[-2,-1] -3 +a[-3--1] y +s3d.. r[-5] 3,{-5,h/3},1,1,-1 m*[-5,-1] +y[-4] a[-6--1] y +3d. ${1-3} rv3d. +#@cli axes3d : _size_x,_size_y,_size_z,_font_size>0,_label_x,_label_y,_label_z,_is_origin={ 0=no | 1=yes } +#@cli : Input 3D axes with specified sizes along the x,y and z orientations. +#@cli : Default values: 'size_x=size_y=size_z=1', 'font_size=23', 'label_x=X', 'label_y=Y', 'label_z=Z' and 'is_origin=1' +#@cli : $ axes3d , ++axes3d : check "${4=23}>0 && isbool(${8=1})" skip ${1=1},${2=$1},${3=$2},"${5=X},${6=Y},${7=Z}" +e[^-1] "Input 3D axes with sizes ($1,$2,$3)." +l[] { +m={max(abs($1),abs($2),abs($3))/40} m2={2*$m} m3={1.2*$m2} +if $1 line3d 0,0,0,$1,0,0 fi +if $2 line3d 0,0,0,0,$2,0 fi +if $3 line3d 0,0,0,0,0,$3 fi +if $1 +cone3d $m,{2*$m},16 r3d. 0,1,0,90 +3d. {$1-$m2},0,0 +_axes3d "$5",$4 +3d. {$1+$m3},0,0 +fi +if $2 +cone3d $m,{2*$m},16 r3d. 1,0,0,-90 +3d. 0,{$2-$m2},0 +_axes3d "$6",$4 +3d. 0,{$2+$m3},0 +fi +if $3 +cone3d $m,{2*$m},16 +3d. 0,0,{$3-$m2} +_axes3d "$7",$4 +3d. 0,0,{$3+$m3} +fi +if $8 _axes3d "O",$4 -3d. $m3,$m3,$m3 fi ++3d => [3d\ axes] +} +_axes3d : +0 t. "$1",2,0,$2,1,1 +dilate. 3 *.. 255 r.. 100%,100%,1,3 +i... (67.5;73.5;109.5;103.5;51.5;100.5;1;1;0;0;0;1;0;-128;{w};{h};3) +i.. (-128;{w};{h};1) y[-3,-1] a[-4--1] y +#@cli boundingbox3d +#@cli : Replace selected 3D objects by their 3D bounding boxes. +#@cli : $ torus3d 100,30 +boundingbox3d +3d[-1] [-2] +boundingbox3d : +e[^-1] "Replace 3D object$? by their 3D bounding boxes." +foreach { +s3d nbv,nbp={1,f2ui([i[0],i[1]])} k[2,3] => pts,prims +r[pts] 3,{pts,h/3},1,1,-1 permute[pts] zycx ($nbv) a[pts,-1] y +$nbp eval. ">begin(p = 0); +N = i[#$prims,p++]; +N==5?( +i0 = i[#$prims,p++]; i1 = i[#$prims,p++]; p+=3; +P0 = I[#$pts,i0]; P1 = I[#$pts,i1]; Pc = (P0 + P1)/2; +U = (P1 - P0)/2; +V = rot(-U[1],U[0],U[2],pi/2)*U; +W = cross(U,V)/norm(U); +da_push(#$pts,Pc + V,Pc - V,Pc + W,Pc - W); +):(p+=N); +end(da_freeze(#$pts))" rm[prims,-1] +s c +xm,dx={0,[im,iM-im]} +ym,dy={1,[im,iM-im]} +zm,dz={2,[im,iM-im]} +rm box3d $dx,$dy,$dz +3d $xm,$ym,$zm p3d 1 +} +#@cli box3d : _size_x,_size_y,_size_z +#@cli : Input 3D box at (0,0,0), with specified geometry. +#@cli : Default values: 'size_x=1' and 'size_z=size_y=size_x'. +#@cli : $ box3d 100,40,30 +primitives3d 1 color3d[-2] ${-rgb} ++box3d : skip ${1=1},${2=$1},${3=$2} +e[^-1] "Input 3D box, with size ($1,$2,$3)." +1,86,1,1,67.5,73.5,109.5,103.5,51.5,100.5,8,6,0,0,0,$1,0,0,$1,$2,0,0,$2,0,0,0,$3,$1,0,$3,$1,$2,$3,0,$2,$3,4,0,3,2,1,4,4,5,6,7,4,0,1,5,4,4,3,7,6,2,4,0,4,7,3,4,1,2,6,5,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,1,1,1,1,1,1 +=> [3D\ box] +#@cli c3d : eq. to 'center3d'. +c3d : +_center3d +#@cli center3d +#@cli : Center selected 3D objects at (0,0,0). +#@cli : (eq. to 'c3d'). +#@cli : $ repeat 100 { circle3d {u(100)},{u(100)},{u(100)},2 } add3d color3d[-1] 255,0,0 +center3d color3d[-1] 0,255,0 add3d +center3d : +_$0 +_center3d : +e[0--3] "Center 3D object$?." +check3d foreach { +if i[6] +s3d r[2] 3,{2,h/3},1,1,-1 s[2] x +-[2] {2,(iM+im)/2} -[3] {3,(iM+im)/2} -[4] {4,(iM+im)/2} +a[2-4] x y[2] a y +fi +} +#@cli chainring3d : _nb_links>=3,_x_scale>0,_y_scale>0,_z_scale>0 +#@cli : Input 3D chain ring with specified geometry. +#@cli : 'nb_links' should be preferably even. +#@cli : Default values: 'nb_links=16', 'x_scale=0.5', 'y_scale=1' and 'z_scale=1'. +#@cli : $ chainring3d +chainring3d : check "isint(${1=16}) && $1>=3 && ${2=0.5}>0 && ${3=1}>0 && ${4=1}>0" +e[^-1] "Input 3D chain ring, with $1 links and scales (${2-4})." +l[] { +torus3d 1,0.1 *3d ${2-4} shift:=0.75*$1/pi +repeat $1 { +ang:=$>*360/$1 +($ang^1^0.784) hsv2rgb. +col3d[0] {^} rm.. +if $>%2 r3d. 0,1,0,90 fi ++3d. $shift r3d. 0,0,1,$ang +} +rm[0] +3d /3d $shift +=> [3D\ chainring] +} +#@cli circle3d : _x0,_y0,_z0,_radius>=0 +#@cli : Input 3D circle at specified coordinates. +#@cli : Default values: 'x0=y0=z0=0' and 'radius=1'. +#@cli : $ repeat 500 { a={$>*pi/250} circle3d {cos(3*$a)},{sin(2*$a)},0,{$a/50} color3d[-1] ${-rgb},0.4 } add3d ++circle3d : skip ${1=0},${2=0},${3=0},${4=1} +e[^-1] "Input 3D circle at position ($1,$2,$3) with radius $4." +r={$4/sqrt(3)} +1,24,1,1,67.5,73.5,109.5,103.5,51.5,100.5,2,1,{$1-$r},{$2-$r},{$3-$r},{$1+$r},{$2+$r},{$3+$r},5,0,1,0,0,0,200,200,200,1 +=> [3D\ circle] +#@cli circles3d : _radius>=0,_is_outlined={ 0 | 1 } +#@cli : Convert specified 3D objects to sets of 3D circles with specified radius. +#@cli : Default values: 'radius=1' and 'is_outlined=1'. +#@cli : $ image.jpg luminance resize2dy 40 threshold 50% * 255 pointcloud3d color3d[-1] 255,255,255 circles3d 0.7 +circles3d : check "${1=1}>=0 && isbool(${2=0})" +e[^-1] "Convert 3D object$? to sets of 3D "${arg0\ $2,filled,outlined}" circles with radius $1." +p3d 0 +foreach { +-3d {$1/2},0,0 ++3d $1,0,0 +3d[1] [0] +s3d +rows[7] 0 j[1] [7] +rv[2,8] +rv[3,9] l[3] { r 2,{h/2},1,1,-1 z 1,1 s y,2 i[0] 1,100%,1,1,5 1,100%,1,1,$2 2,100% a x y } +k[0-5] a y +} +#@cli col3d : eq. to 'color3d'. +col3d : +_gmic_s="$?" v + _color3d $* +#@cli color3d : R,_G,_B,_opacity +#@cli : Set color (and optionally opacity) of selected 3D objects. +#@cli : (eq. to 'col3d'). +#@cli : Default value: 'B=G=R' and 'opacity=(undefined)'. +#@cli : $ torus3d 100,10 double3d 0 repeat 7 { +rotate3d[-1] 1,0,0,20 color3d[-1] ${-rgb} } add3d +color3d : +_gmic_s="$?" v + _$0 $* +_color3d : +$=arg col:=$#==1?[$arg1,$arg1,$arg1]:$#==2?[$arg1,$arg2,0]:[$arg1,$arg2,$arg3] +if $#<4 e[0--4] "Set color of 3D object"$_gmic_s" to ("$col")." +else e[0--4] "Set color of 3D object"$_gmic_s" to ("$col"), with opacity "$arg4"." +fi +foreach { +nbv,nbp:=f2ui([i[6],i[7]]) $nbp +eval. ">begin(p = 8 + 3*$nbv); p+=i[#0,p] + 1; end(set('p',p))" # Find beginning of color data +eval. ">begin(p = $p; col = ["$col"]); +i[#0,p]==-128?(p+=prod(crop(#0,0,++p,1,3))):copy(i[#0,p],col); p+=3; +end(set('p',p))" +if $#>3 eval. ">begin(p = $p; const o = $arg4); i[#0,p]==-128?(p+=3 + prod(crop(#0,0,++p,1,3))):(i[#0,p++] = o)" fi +k[0] +} +#@cli colorcube3d : _is_wireframe={ 0 | 1 } +#@cli : Input 3D color cube. +#@cli : Default value: 'is_wireframe=0'. +#@cli : $ colorcube3d mode3d 2 +primitives3d 1 ++colorcube3d : l[] { check "isbool(${1=0})" is_wireframe=$1 onfail is_wireframe=1 noarg } +s0,s1="face","wireframe" +e[^-1] "Input 3D RGB-color "$s$1" cube." +if $is_wireframe l[] { +({'CImg3d'},8,12) +(0,0,0;255,0,0;255,255,0;0,255,0;0,0,255;255,0,255;255,255,255;0,255,255) +(6,0,1,0,0,63,0;6,1,2,0,1,63,1;6,2,3,0,2,63,2;6,3,0,0,3,63,3;\ +6,0,4,0,4,63,4;6,1,5,0,5,63,5;6,2,6,0,6,63,6;6,3,7,0,7,63,7;6,4,5,0,8,63,8;6,5,6,0,9,63,9;6,6,7,0,10,63,10;6,7,4,0,11,63,11) +(-128,64,12,3) (0,0,0;255,0,0/255,0,0;255,255,0/255,255,0;0,255,0/0,255,0;0,0,0/\ +0,0,0;0,0,255/255,0,0;255,0,255/255,255,0;255,255,255/0,255,0;0,255,255/0,0,255;255,0,255/255,0,255;255,255,255/255,255,255;0,255,255/0,255,255;0,0,255) +permute. yzcx r. 64,100%,1,3,3 +(-128,0,0,0)x11 +1,12,1,1,1 +y a y +} else l[] { +({'CImg3d'},8,6) +(0,0,0;255,0,0;255,255,0;0,255,0;0,0,255;255,0,255;255,255,255;0,255,255) +(12,0,3,2,1,0,0,0,63,63,63,63,0;12,1,2,6,5,0,0,0,63,63,63,63,0;\ +12,0,4,7,3,0,0,63,0,63,63,0,63;12,4,5,6,7,0,0,63,0,63,63,0,63;12,0,1,5,4,0,0,63,0,63,63,0,63;12,3,7,6,2,0,0,0,63,63,63,63,0) +(0,255;0,255^0,0;255,255^0,0;0,0) +(255,255;255,255^0,0;255,255^0,255;0,255) +(0,0;0,0^0,0;255,255^0,255;0,255) +(0,255;0,255^0,0;255,255^255,255;255,255) +(0,255;0,255^0,0;0,0^0,0;255,255) +(0,255;0,255^255,255;255,255^0,0;255,255) +r[-6--1] 64,64,1,3,3 round[-6--1] y[-6--1] i[-7--2] (-128;64;64;3) +1,6,1,1,1 +y a y +} fi +=> [3D\ colorcube] +#@cli cone3d : _radius,_height,_nb_subdivisions>0 +#@cli : Input 3D cone at (0,0,0), with specified geometry. +#@cli : Default value: 'radius=1','height=1' and 'nb_subdivisions=24'. +#@cli : $ cone3d 10,40 +primitives3d 1 color3d[-2] ${-rgb} ++cone3d : check ${3=24}>0 skip ${1=1},${2=1} +e[^-1] "Input 3D cone, with radius $1, height $2 and $3 subdivisions." +(67.5;73.5;109.5;103.5;51.5;100.5) +({$3+2};{2*$3}) +(0,0,0;0,0,$2) +(0;{2*pi}) r. 1,{$3+1},1,1,3 rows. 0,{$3-1} +sin. cos.. *[-2,-1] $1 a[-2,-1] x z. 0,2 a[-2,-1] y +1,$3,1,1,'y' +shift. 0,-1 +[-2,-1] 2 +2,$3,1,1,3,0 .. [-4] a[-3--1] x +i[-4] 2,$3,1,1,3,1 a[-4--2] x +a[-2,-1] y +3,{h},1,1,200 +1,{h},1,1,1 +y[-4--2] a[-6--1] y => [3D\ cone] +#@cli cubes3d : _size>=0 +#@cli : Convert specified 3D objects to sets of 3D cubes with specified size. +#@cli : Default value: 'size=1'. +#@cli : $ image.jpg luminance resize2dy 40 threshold 50% * 255 pointcloud3d color3d[-1] 255,255,255 cubes3d 1 +cubes3d : check ${1=1}>=0 +e[^-1] "Convert 3D object$? to sets of 3D cubes with size $1." +p3d 0 +foreach { +nbv={@6} nbp={@7} +if $nbv&&$nbp +s3d +l[1] { = {8*i[0]} = {6*i[1]},0,1 } +l[2] { +r 3,{h/3},1,1,-1 +half={$1/2} +- '$half,0,0' ++ '$1,0,0' a x +- '0,$half,0' ++ '0,$1,0' a x +- '0,0,$half' ++ '0,0,$1' a x +} +l[3] { +r 2,{h/2},1,1,-1 +z 1,1 * 8 r 4,100% i[0] 1,100%,1,1,4 a x [-1]x5 a x ++ '"0,0,2,3,1, 0,4,5,7,6, 0,0,1,5,4, 0,2,6,7,3, 0,0,4,6,2, 0,1,3,7,5"' +} +l[4] { r 3,{h/3},1,1,-1 r 18,100%,1,1,0,2 } r[5] 6,100% +y a y +fi +} +#@cli cup3d : _resolution>0 +#@cli : Input 3D cup object. +#@cli : Default value: 'resolution=128'. +#@cli : $ cup3d , ++cup3d : check ${1=128}>0 +e[^-1] "Input 3D cup, with resolution $1." +100,200 +ellipse. 0%,0%,40%,40%,0,1,1 +ellipse. 0,0,35%,35%,0,1,0 +polygon. 4,0,45%,8%,45%,20%,90%,0,90%,1,1 +ellipse. 0%,100%,30%,10%,0,1,1 b. 0.1% +lathe3d. $1,2 +=> [3D\ cup] +#@cli curve3d : _"x(t)",_"y(t)",_"z(t)",_"r(t)",_resolution>1,_tmin,_tmax,_nb_sides>=0,_is_closed_curve={ 0 | 1 } +#@cli : Input 3D curve with specified parameterization. +#@cli : If 'r(t)==0' or 'nb_sides<3', the generated 3D object is composed of segments only. +#@cli : Default values: 'x(t)=cos(2*pi*t)', 'y(t)=sin(2*pi*t)', 'z(t)=t', 'r(t)=0.025', 'resolution=128', 'tmin=0', 'tmax=1', 'nb_sides=16' and 'is_closed_curve=0'. +#@cli : $ curve3d , ++curve3d : check "isint(${5=128}) && $5>1 && isbool(${9=0}) && isint(${8=16}) && $8>=0" +skip "${1=0.25*cos(4*pi*t)},${2=0.25*sin(4*pi*t)},${3=t},${4=0.025},${6=0},${7=1}" +xt,yt,zt,rt,resolution,tmin,tmax,nb_sides,is_closed=$"*" +nb_sides:="$nb_sides<3 || ['"$rt"']=='0'?1:$nb_sides" +s0,s1="open","closed" +e[^-1] "Input 3D "${s$is_closed}" curve with parameterization ("$xt,$yt,$zt"), radius '"$rt"', ""resolution "$resolution", t-range ["$tmin,$tmax"], radius and "$nb_sides" sides." +('CImg3d') (0,0) +1,$resolution,1,4,"t = lerp($tmin,$tmax,y/(h - ($is_closed?0:1))); [ ("$xt"),("$yt"),("$zt"),("$rt") ]" s. c,-3 +if $nb_sides==1 +rm. 1,{$resolution-1+$is_closed},1,3,"[ 2,y,(y + 1)%$resolution ]" nbv=$resolution nbp:=h permute[-2,-1] cyzx +else ++g.. y,0,{$is_closed?2:1} orientation. +0 $nb_sides,$resolution,1,1," +!x?( +P = I(#-4,0,y); +R = i(#-3,0,y); +W = I(#-2,0,y); +norm(W)==0?(W = [ 0,0,1 ]); +!y?( +P0 = P; +do (ref = [ v,v,v ]; ref/=norm(v); crossWref = cross(W,ref), norm(crossWref)<1e-5); +); +U = cross(W,ref); U/=norm(U); +V = cross(W,U); V/=norm(V); +M = transpose([ U,V,W ],3); +ref = -V; +); +ang = x*2*pi/w; +Q = P + R*mul(M,[ cos(ang),sin(ang),0 ]); +da_push(Q[0],Q[1],Q[2]); +end( +!$is_closed?da_push(P0[0],P0[1],P0[2],P[0],P[1],P[2]); +da_freeze(); +)" rm[-5--3,-1] +nbv:={h/3} +0 $nb_sides,{$resolution-1+$is_closed},1,1,"begin(nbp = 0); +b0 = y*$nb_sides; b1 = ((y + 1)%$resolution)*$nb_sides; nx = (x+1)%$nb_sides; +da_push(4,b0 + x,b0 + nx,b1 + nx,b1 + x); +++nbp; +end( +const indmin = $nb_sides*$resolution; +const indmax = indmin + 1; +const last = indmin - $nb_sides; +!$is_closed?( +repeat($nb_sides,k,da_push(3,indmin,(k + 1)%$nb_sides,k); ++nbp); +repeat($nb_sides,k,da_push(3,indmax,last + k,last + ((k + 1)%$nb_sides)); ++nbp); +); +da_freeze(); +set('nbp',nbp); +)" rm. +fi +eval "i[#-3,0] = ui2f($nbv); i[#-3,1] = ui2f($nbp)" +3,$nbp,1,1,200 1,$nbp,1,1,1 y[-6--1] a[-6--1] y => [3D\ Curve] +#@cli cylinder3d : _radius,_height,_nb_subdivisions>0 +#@cli : Input 3D cylinder at (0,0,0), with specified geometry. +#@cli : Default value: 'radius=1','height=1' and 'nb_subdivisions=24'. +#@cli : $ cylinder3d 10,40 +primitives3d 1 color3d[-2] ${-rgb} ++cylinder3d : check ${3=24}>0 skip ${1=1},${2=1} +e[^-1] "Input 3D cylinder, with radius $1, height $2 and $3 subdivisions." +l[] { +N={round($3)} +nbv,nbp={[2*$N+2,3*$N]} +({0.5+[{'CImg3d'}]}) +($nbv,$nbp) +1,$nbv,1,3,"Z = (y<="$N"?0:$2); ang = ((y%("$N"+1))-1)*2*pi/"$N"; +!(y%("$N"+1))?[0,0,Z]:[$1*cos(ang),$1*sin(ang),Z]" +1,$N,1,13,"i1 = 1 + y; i2 = 1 + (i1%"$N"); const j0 = "$N" + 1; j1 = j0 + i1; j2 = j0 + i2; +[ 3,0,i2,i1, 3,j0,j1,j2, 4,i1,i2,j2,j1 ]" +permute[^0,1] "cyzx" 1,$nbp,1,3,200 1,$nbp,1,1,1 y a y => [3D\ cylinder] +} +#@cli delaunay3d +#@cli : Generate 3D Delaunay triangulations from selected images. +#@cli : One assumes that the selected input images are binary images containing the set of points to mesh. +#@cli : The output 3D object is a mesh composed of non-oriented triangles. +#@cli : $ 500,500 noise 0.05,2 eq 1 * 255 +delaunay3d color3d[1] 255,128,0 dilate_circ[0] 5 to_rgb[0] +object3d[0] [1],0,0,0,1,1 max[-1] [0] +delaunay3d : +e[^-1] "Generate 3D Delaunay triangulation from image$?." +foreach { +channels 0 != 0 +whd={w},{h},{d} +r 1,{w*h*d},1,1,-1 cumulate. *. .. r. $whd,1,-1 ++distance[0] 1 *[2] -1 watershed[1] [2] rm[2] +r[1] 100%,100%,100%,3 +if d>1 ++_delaunay3d[1] 1,0,0,0,0,1 +_delaunay3d[1] -1,0,0,0,0,-1 ++_delaunay3d[1] 0,1,0,0,0,1 +_delaunay3d[1] 0,-1,0,0,0,-1 +fi ++_delaunay3d[1] 1,0,0,0,1,0 _delaunay3d[1] -1,0,0,0,-1,0 +a[^0] x transpose. -. 1 +pointcloud3d[0] +s3d[0] rm[3-5] i.. 1,100%,1,1,3 a[-2,-1] x +3,100%,1,1,200 1,100%,1,1,1 =[1] {h},0,1 y a y +} +_delaunay3d : +f. "A=j($1,$2,$3,0,0,1); B=j($4,$5,$6,0,0,1); +if(i!=A && i!=B && A!=B, kth(1+c,i,A,B),0)" +discard. 0 r. {h/3},3,1,1,-1 +#@cli distribution3d +#@cli : Get 3D color distribution of selected images. +#@cli : $ image.jpg distribution3d colorcube3d primitives3d[-1] 1 add3d +distribution3d : +e[^-1] "Get 3D color distribution of image$?." +to_rgb permute "cxyz" y +foreach { +nbp={round(h/3)} +i.. (67.5;73.5;109.5;103.5;51.5;100.5;\ +$nbp;$nbp) +1,$nbp,1,1,1 +f. y a[-2,-1] x y. +.. +1,$nbp,1,1,1 +a y => [3D\ distribution] +} +#@cli /3d : eq. to 'div3d'. : (+) +#@cli div3d : factor : factor_x,factor_y,_factor_z : (+) +#@cli : Scale selected 3D objects isotropically or anisotropically, with the inverse of specified +#@cli : factors. +#@cli : (eq. to '/3d'). +#@cli : Default value: 'factor_z=1'. +#@cli : $ torus3d 5,2 repeat 5 { +add3d[-1] 12,0,0 div3d[-1] 1.2 color3d[-1] ${-rgb} } add3d +#@cli db3d : eq. to 'double3d'. +db3d : +l[] { check "isbool(${1=1})" mode=$1 onfail noarg mode=1 } +v + _double3d $mode +#@cli double3d : _is_double_sided={ 0 | 1 } +#@cli : Enable/disable double-sided mode for 3D rendering. +#@cli : (eq. to 'db3d'). +#@cli : Default value: 'is_double_sided=1'. +#@cli : $ mode3d 1 repeat 2 { torus3d 100,30 rotate3d[-1] 1,1,0,60 double3d $> snapshot3d[-1] 400 } +double3d : +l[] { check "isbool(${1=1})" mode=$1 onfail noarg mode=1 } +v + _$0 $mode +_double3d : +if $^>=0 +s0,s1=Disable,Enable +e[0--4] ${s$1}" double-sided mode for 3D rendering." +fi +_double3d=$1 +#@cli elevation3d : { z-factor | [elevation_map] | 'formula' },base_height={ -1 | >=0 } : (no arg) +#@cli : Generate 3D elevation of selected images, opt. with a specified elevation map. +#@cli : When invoked with (no arg) or 'z-factor', the elevation map is computed as the pointwise L2 norm of the +#@cli : pixel values. Otherwise, the elevation map is taken from the specified image or formula. +#@cli : $ image.jpg +blur 5 elevation3d. 0.75 +#@cli : $ 128,128,1,3,u(255) plasma 10,3 blur 4 sharpen 10000 n 0,255 elevation3d[-1] 'X=(x-64)/6;Y=(y-64)/6;-100*exp(-(X^2+Y^2)/30)*abs(cos(X)*sin(Y))' +elevation3d : skip "${1=_noarg}" check "${2=-1}==-1 || $2>=0" +if $2>=0 base_str=" and base height $2" else base_str= fi +if isnum($1) +e[^-1] "Generate 3D elevation of image$?, with z-factor $1"$base_str. argtype,zfactor=0,$1 +elif ${"is_image_arg $1"} +e[^-1] "Generate 3D elevation of image$?, from elevation $1"$base_str. argtype=2 +pass$1 0 if s>1 norm. fi store. elevation_img +elif isexpr($1) +e[^-1] "Generate 3D elevation of image$?, with formula '$1'"$base_str. argtype=1 +else +e[^-1] "Generate 3D elevation of image$?." argtype,zfactor=0,1 +fi +is_base={$2>=0} +foreach { +nm={n} M,N={[w,h]} to_rgb +100%,100%,1,2,[x,y] +if !$argtype +norm[0] *. $zfactor +elif $argtype==1 [0],[0],1,1,"$1" +else $elevation_img +fi +a[-2,-1] c +if $is_base . sh. 100% f. {-sign($1)*$2} rm. a[-2,-1] y fi +r. {wh},1,1,3,-1 permute. cxyz nbv={h} +header="const M = "$M"; const N = "$N"; const MN = M*N" +{[$M,$N]-1},1,5,$header"; +i0 = M*y + x; i1 = i0 + MN; +[ 4,ui2f(i0),ui2f(i0 + M),ui2f(i0 + 1 + M),ui2f(i0 + 1) ]" +r. 1,{wh},1,100%,-1 nbp={h} +if $is_base +{[$M,$N]-1},1,5,$header"; +i0 = M*y + x; i1 = i0 + MN; +[ 4,ui2f(i1),ui2f(i1 + 1),ui2f(i1 + 1 + M),ui2f(i1 + M) ]" +r. 1,{wh},1,100%,-1 nbp+={h} +{$M-1},1,1,10,$header" ; +i0 = x; i1 = i0 + MN; i2 = i0 + M*(N - 1); i3 = i2 + MN; +[ 4,ui2f(i0),ui2f(i0 + 1),ui2f(i1 + 1),ui2f(i1), +4,ui2f(i2),ui2f(i3),ui2f(i3 + 1),ui2f(i2 + 1) ]" +r. 1,{wh},1,100%,-1 s. c,2 nbp+={2*h} +{$N-1},1,1,10,$header"; +i0 = M*x; i1 = i0 + MN; i2 = i0 + M - 1; i3 = i2 + MN; +[ 4,ui2f(i0),ui2f(i1),ui2f(i1 + M),ui2f(i0 + M), +4,ui2f(i2),ui2f(i2 + M),ui2f(i3 + M),ui2f(i3) ]" +r. 1,{wh},1,100%,-1 s. c,2 nbp+={2*h} +permute[-6--1] cyxz -a[-6--1] y +else permute. cyxz +fi +mv[0] $! r. {[w,h]-1},1,3,0 r. {wh},1,1,3,-1 permute. cxyz +if $is_base 3,{$nbp-h},1,1,200 fi +1,$nbp,1,1,1 +i[0] ('CImg3d':y) +[0] 0.5 i[1] ({ui2f([$nbv,$nbp]):;}) y a y +=> $nm +} +#@cli empty3d +#@cli : Input empty 3D object. +#@cli : $ empty3d ++empty3d : +e[^-1] "Input empty 3D object." +(67.5;73.5;109.5;103.5;51.5;100.5;0;0) => [3D\ empty] +#@cli extract_textures3d +#@cli : Extract texture data from selected 3D objects. +#@cli : $ image.jpg imagesphere3d 10,10 +extract_textures3d +extract_textures3d : +e[^-1] "Extract textures from 3D object$?." +check3d foreach { +ext={x} if ['$ext']!=0 ext..=. fi +bn={`"s = ['"{b}'"]; e = ['"$ext"']; p = find(s,e,size(s) - size(e),-1); p>0?s[p] = 0; s"`} +s3d nbv,nbp={1,f2ui(crop())} +tmp=$! $nbp eval. ">begin(p = N = 0); +i[#4,p++]==-128?( +W = i[#4,p++]; H = i[#4,p++]; S = i[#4,p++]; WHS = W*H*S; +WHS?(run('+z[4] 0,',p,',0,',p + WHS - 1,' r. ',W,',',H,',1,',S,',-1 => tx',N); p+=WHS); +):(p+=2); +++N" +rm[0-$tmp] foreach { => ${bn}_texture$> } +} +#@cli extrude3d : _depth>0,_resolution>0,_smoothness[%]>=0 +#@cli : Generate extruded 3D object from selected binary XY-profiles. +#@cli : Default values: 'depth=16', 'resolution=1024' and 'smoothness=0.5%'. +#@cli : $ image.jpg threshold 50% extrude3d 16 +extrude3d : check "${1=16}>0 && ${2=1024}>0 && ${3=0.5%}>=0" +e[^-1] "Generate extruded 3D object from XY-profile$?, with depth $1, resolution $2 and smoothness $3." +norm n 0,1 autocrop 0 +foreach { +nm={n} +wr={round(max(1,if(w>h,min($2,w),min($2,h)*w/h)))} +hr={round(max(1,if(w>h,min($2,w)*h/w,min($2,h))))} +fact={$1/max(w/$wr,h/$hr)} +b $3,0 r $wr,$hr,1,1,2 expand_xyz 1,0 +isosurface3d 50% *3d 1,1,$fact rv3d => $nm +} +#@cli f3d : eq. to 'focale3d'. +f3d : +l[] { check "isnum(${1=700})" focale=$1 onfail noarg focale=700 } +v + _focale3d $focale +#@cli focale3d : focale +#@cli : Set 3D focale. +#@cli : (eq. to 'f3d').\n +#@cli : Set 'focale' to 0 to enable parallel projection (instead of perspective). +#@cli : Set negative 'focale' will disable 3D sprite zooming. +#@cli : Default value: 'focale=700'. +#@cli : $ repeat 5 { torus3d 100,30 rotate3d[-1] 1,1,0,60 focale3d {$<*90} snapshot3d[-1] 400 } remove[0] +focale3d : +l[] { check "isnum(${1=700})" focale=$1 onfail noarg focale=700 } +v + _$0 $focale +_focale3d : +e[0--3] "Set 3D focale to $1." +_focale3d=$1 +#@cli fov3d : fov_angle>=0 +#@cli : Set 3D focale to match specified field of vision angle (in degree) for the latest of the selected image. +#@cli : Return corresponding focale in status. +#@cli : Default value: 'fov_angle=30' +fov3d : check "${1=45}>=0 && "$!"==1" +e[^-1] "Set 3D focale to have FOV angle of $1 for image$?." +if !$1 f3d=0 else f3d:=max(w,h)/2/tan($1°/2) fi +f3d $f3d u $f3d +#@cli gaussians3d : _size>0,_opacity +#@cli : Convert selected 3D objects into set of 3D gaussian-shaped sprites. +#@cli : $ image.jpg r2dy 32 distribution3d gaussians3d 20 colorcube3d primitives3d[-1] 1 +3d +gaussians3d : check "${1=32}>0" skip ${2=0.3} +e[^-1] "Convert 3D object$? into sets of gaussian-shaped 3D sprites, with size $1 and opacity $2." +p3d 2 p3d 0 +foreach { +nm={n} s3d nbv={h} rm. (-128;$1;$1;1) +$1,$1 gaussian. 35%,35%,0 c. 30%,100% n. 0,$2 y. a[-2,-1] y +if $nbv>1 4,{$nbv-1},1,1,-128,0,0,0 y[-2,-1] a[-2,-1] y fi +a y => $nm +} +#@cli gmic3d +#@cli : Input a 3D G'MIC logo. +#@cli : $ gmic3d +primitives3d 1 ++gmic3d : +e[^-1] "Input 3D G\47MIC logo." +text3d G,60,20,2 col3d. 16,64,255 +text3d \',60,20,2 +3d. 40 col3d. 64,128,255 +text3d M,60,20,2 +3d. 50 col3d. 96,196,255 +text3d I,60,20,2 +3d. 90 col3d. 64,128,255 +text3d C,60,20,2 +3d. 100 col3d. 16,64,255 +sphere3d 8,-3 +3d. 102,-3,20 col3d. 192,128,255 ++3d[-6--1] c3d. +repeat 30 { +box3d {min(3+$,20+80*$>,10*$>],0,255)},0.5 +r3d. 1,1,1,{$>*12} ++3d. {80*cos(0.5+1.02*$>*12*pi/180)},{30*sin(0.8+$>*12*pi/180)},{2*$>-60} +} ++3d[-30--1] +3d. 0,5,30 +3d[-2--1] => [3d\ gmic] +#@cli gyroid3d : _resolution>0,_zoom +#@cli : Input 3D gyroid at (0,0,0), with specified resolution. +#@cli : Default values: 'resolution=32' and 'zoom=5'. +#@cli : $ gyroid3d 48 +primitives3d 1 ++gyroid3d : check ${1=32}>0 skip ${2=5} +e[^-1] "Input 3D gyroid, with resolution $1 and range $2." +isosurface3d "'0.49*(cos( 2*x + y + z - pi) + cos( 2*x - y + z - pi)+ cos(- 2*x + y - z - pi) + cos(- 2*x - y - z - pi)+ cos( x + 2*y + z - pi) + cos( x + 2*y - z - pi)+ cos(- x - 2*y + z - pi) + cos(- x - 2*y - z - pi)+ cos( x + y + 2*z - pi) + cos(- x + y + 2*z - pi)+ cos( x - y - 2*z - pi) + cos(- x - y - 2*z - pi)+ cos(- 2*x + y + z) + cos( 2*x + y - z)+ cos(- 2*x - y + z) + cos( 2*x - y - z)+ cos(- x + 2*y + z) + cos( x - 2*y + z)+ cos(- x + 2*y - z) + cos( x - 2*y - z)+ cos( x - y + 2*z) + cos( x + y - 2*z)+ cos(- x - y + 2*z) + cos(- x + y - 2*z)) + 0.27*( cos(- 2*x + 2*y - pi) + cos( 2*x - 2*y - pi)+ cos( 2*x + 2*y - pi) + cos(- 2*x - 2*y - pi)+ cos(- 2*y + 2*z - pi) + cos( 2*y - 2*z - pi)+ cos( 2*y + 2*z - pi) + cos(- 2*y - 2*z - pi)+ cos(- 2*z + 2*x - pi) + cos( 2*z - 2*x - pi)+ cos( 2*z + 2*x - pi) + cos(- 2*z - 2*x - pi)) - 0.69'",0,{-$2},{-$2},{-$2},$2,$2,$2,$1,$1,$1 +c3d. n3d. => [3D\ gyroid] +#@cli histogram3d +#@cli : Get 3D color histogram of selected images. +#@cli : $ image.jpg resize2dx 64 histogram3d circles3d 3 opacity3d. 0.75 colorcube3d primitives3d[-1] 1 add3d +histogram3d : +e[^-1] "Get 3D color histogram of image$?." +to_rgb +foreach { +r {wh},3,1,1,-1 pointcloud 1 n 0,255 palette hot point. 0,0,0,1,0 map.. . rm. pointcloud3d => "[3D histogram]" +} +#@cli image6cube3d +#@cli : Generate 3D mapped cubes from 6-sets of selected images. +#@cli : $ image.jpg animate flower,"30,0","30,5",6 image6cube3d +image6cube3d : +e[^-1] "Generate 3D mapped cubes from image$?." +M={max(${-max_wh})} r $M,$M,1,3 imageplane3d n3d c3d +repeat int($!/6) { l[$>-{$>+5}] { ++3d[0] 0,0,-0.5 +r3d[1] 0,1,0,90 +3d[1] -0.5,0,0 +r3d[2] 0,1,0,180 +3d[2] 0,0,0.5 +r3d[3] 0,1,0,270 +3d[3] 0.5,0,0 +r3d[4] 1,0,0,90 +3d[4] 0,0.5,0 +r3d[5] 1,0,0,270 +3d[5] 0,-0.5,0 ++3d => "[3D image cube]" +} } +#@cli imageblocks3d : _maximum_elevation,_smoothness[%]>=0 +#@cli : Generate 3D blocks from selected images. +#@cli : Transparency of selected images is taken into account. +#@cli : Default values: 'maximum_elevation=10' and 'smoothness=0'. +#@cli : $ image.jpg resize2dy 32 imageblocks3d -20 mode3d 3 +imageblocks3d : check ${2=0}>=0 skip ${1=10},${3=0} +e[^-1] "Generate 3D blocks from image$?, with maximum elevation $1 and smoothness $2." +foreach { +w={w} h={h} +split_opacity to_rgb[0] is_opacity={$!==2} +l[] { +box3d 1,1,0 +repeat $w-1 { ++3d. 1,0,0 } +3d +repeat $h-1 { ++3d. 0,1,0 } +3d +} +s3d. ++norm[0] b. $2 +y. n. 0,$1 +r[-5] 24,{-5,round(w*h/24)},1,1,-1 +if $1<0 j[-5] .,2 j[-5] .,5 j[-5] .,8 j[-5] .,11 +else j[-5] .,14 j[-5] .,17 j[-5] .,20 j[-5] .,23 +fi +rm. y[-4] +rm.. r[0] {0,wh},1,1,100%,-1 permute[0] cxyz r[0] 600%,100%,1,1,0,2 y[0] mv[0] -1 +if $is_opacity rm. mv[0] $! /. 255 y. r. 6,100%,1,1 y. fi +a y +} +#@cli imagecube3d +#@cli : Generate 3D mapped cubes from selected images. +#@cli : $ image.jpg imagecube3d +imagecube3d : +e[^-1] "Generate 3D mapped cubes from image$?." +slices 50% to_rgb +foreach { +nm={n} +i.. (67.5;73.5;109.5;103.5;51.5;100.5;\ +8;6;\ +-0.5;-0.5;-0.5;\ +0.5;-0.5;-0.5;0.5;0.5;-0.5;-0.5;0.5;-0.5;-0.5;-0.5;0.5;0.5;-0.5;0.5;0.5;0.5;0.5;-0.5;0.5;0.5;12;0;3;2;1;0;0;0;{h};{w};{h};{w};0;\ +12;1;2;6;5;0;0;0;{h};{w};{h};{w};0;12;5;6;7;4;0;0;0;{h};{w};{h};{w};0;12;4;7;3;0;0;0;0;{h};{w};{h};{w};0;12;4;0;1;5;0;0;0;{h};{w};{h};{w};0;12;3;7;6;2;0;0;0;{h};{w};{h};{w};0;-128;{w};{h};{s}) +y. +(-128;0;0;0;-128;0;0;0;-128;0;0;0;-128;0;0;0;-128;0;0;0;1;1;1;1;1;1) +a y => $nm +} +#@cli imageplane3d +#@cli : Generate 3D mapped planes from selected images. +#@cli : $ image.jpg imageplane3d +imageplane3d : +e[^-1] "Generate 3D mapped planes from image$?." +slices 50% to_color +foreach { +w,h,s,w1,h1:=w,h,s,w-1,h-1 +nm={n} +i.. (67.5;73.5;109.5;103.5;51.5;100.5;\ +4;1;\ +0;0;0;\ +$w;0;0;$w;$h;0;0;$h;0;12;0;3;2;1;0;0;0;$h1;$w1;$h1;$w1;0;\ +-128;$w;$h;$s) +y. +(1) +a y => $nm +} +#@cli imagepyramid3d +#@cli : Generate 3D mapped pyramids from selected images. +#@cli : $ image.jpg imagepyramid3d +imagepyramid3d : +e[^-1] "Generate 3D mapped pyramids from image$?." +to_rgb +foreach { +nm={n} w2={w/2} +i.. (67.5;73.5;109.5;103.5;51.5;100.5;\ +5;5;\ +-0.5;-0.5;-0.5;\ +0.5;-0.5;-0.5;0.5;0.5;-0.5;-0.5;0.5;-0.5;0;0;0.5;12;0;3;2;1;0;0;0;{h};{w};{h};{w};0;\ +9;0;4;3;0;{h};$w2;0;{w};{h};9;1;4;0;0;{h};$w2;0;{w};{h};9;2;4;1;0;{h};$w2;0;{w};{h};9;3;4;2;0;{h};$w2;0;{w};{h};-128;{w};{h};{s}) +y. +(-128;0;0;0;-128;0;0;0;-128;0;0;0;-128;0;0;0;1;1;1;1;1) +a y => $nm +} +#@cli imagerubik3d : _xy_tiles>=1,0<=xy_shift<=100,0<=z_shift<=100 +#@cli : Generate 3D mapped rubik's cubes from selected images. +#@cli : Default values: 'xy_tiles=3', 'xy_shift=5' and 'z_shift=5'. +#@cli : $ image.jpg imagerubik3d , +imagerubik3d : check "${1=3}>=1 && ${2=5}>=0 && $2<=100 && ${3=5}>=0 && $3<=100" +e[^-1] "Generate 3D mapped rubik\47s cubes from image$? with $1 xy-tiles, xy-shift $2 and z-shift $3." +foreach { +nm={n} +('CImg3d') +. 0.5 +(8,5) +(0,0,0;100,0,0;100,100,0;0,100,0;$2,$2,{-$3};{100-$2},$2,{-$3};{100-$2},{100-$2},{-$3};$2,{100-$2},{-$3}) +(4,4,7,6,5;4,0,4,5,1;4,3,2,6,7;4,0,3,7,4;4,1,5,6,2) +3,5,1,1,200 +1,5,1,1,1 +y[-6--1] a[-6--1] y +repeat $1-1 { ++3d. 100 } +3d[-$1--1] +repeat $1-1 { ++3d. 0,100 } +3d[-$1--1] +t3d. .. rm.. +/3d. $1 -3d. 50,50,50 ++r3d. 0,1,0,-90 +r3d. 0,1,0,-90 +r3d. 0,1,0,-90 ++r3d. 0,0,1,-90 +r3d. 0,0,1,180 ++3d => $nm +} +#@cli imagesphere3d : _resolution1>=3,_resolution2>=3 +#@cli : Generate 3D mapped sphere from selected images. +#@cli : Default values: 'resolution1=32' and 'resolutions2=16'. +#@cli : $ image.jpg imagesphere3d 32,16 +imagesphere3d : check "${1=32}>=3 && ${2=16}>=3" +e[^-1] "Generate 3D mapped sphere from image$?, with resolutions ($1,$2)." +to_rgb +foreach { +nm={n} +tw={w-1} th={h-1} +nbv={2+$1*($2-2)} +nbp={$1*($2-1)} +(67.5;73.5;109.5;103.5;51.5;100.5;\ +$nbv;$nbp) +(0;0;1) (0;0;-1) (0,{2*pi};0,{2*pi}^0,0;{pi},{pi}) +r. {$1+1},$2,1,2,3 z. 0,1,{w-2},{h-2} s. c ++sin. +sin... *[-2,-1] +cos.. sin... cos[-4] *[-4,-3] +a[-3--1] c permute. cxyz y. a[-3--1] y +repeat $1 { v=$> +tx0={$v*$tw/$1} tx1={($v+1)*$tw/$1} ty1={$th/($2-1)} +(9;0;{2+$v};{2+($v+1)%$1};{$tw/2};0;$tx0;$ty1;$tx1;$ty1) +repeat $2-3 { u=$> +ty0=$ty1 ty1={($u+2)*$th/($2-1)} i0={2+$u*$1+$v} i1={2+$u*$1+($v+1)%$1} +(12;$i0;{$i0+$1};{$i1+$1};$i1;$tx0;$ty0;$tx0;$ty1;$tx1;$ty1;$tx1;$ty0) +} +(9;1;{2+$1*($2-3)+($v+1)%$1};{2+$1*($2-3)+$v};{$tw/2};$th;$tx1;$ty1;$tx0;$ty1) +} +a[-$nbp--1] y +mv[-4] $! i.. (-128;{w};{h};3) y. 1,{4*($nbp-1)},1,1,-128,0,0,0 1,$nbp,1,1,1 a y => $nm +} +#@cli isoline3d : isovalue[%] : 'formula',value,_x0,_y0,_x1,_y1,_size_x>0[%],_size_y>0[%] : (+) +#@cli : Extract 3D isolines with specified value from selected images or from specified formula. +#@cli : Default values: 'x0=y0=-3', 'x1=y1=3' and 'size_x=size_y=256'. +#@cli : $ image.jpg blur 1 isoline3d 50% +#@cli : $ isoline3d 'X=x-w/2;Y=y-h/2;(X^2+Y^2)%20',10,-10,-10,10,10 +#@cli isosurface3d : isovalue[%] : 'formula',value,_x0,_y0,_z0,_x1,_y1,_z1,_size_x>0[%],_size_y>0[%],_size_z>0[%] : (+) +#@cli : Extract 3D isosurfaces with specified value from selected images or from specified formula. +#@cli : Default values: 'x0=y0=z0=-3', 'x1=y1=z1=3' and 'size_x=size_y=size_z=32'. +#@cli : $ image.jpg resize2dy 128 luminance threshold 50% expand_z 2,0 blur 1 isosurface3d 50% mul3d 1,1,30 +#@cli : $ isosurface3d 'x^2+y^2+abs(z)^abs(4*cos(x*y*z*3))',3 +#@cli label3d : "text",font_height>=0,_opacity,_color1,... +#@cli : Generate 3D text label. +#@cli : Default values: 'font_height=13', 'opacity=1' and 'color=255,255,255'. ++label3d : check ${2=13}>=0 skip ${3=1},${4=255},${5=$4},${6=$5} +e[^-1] "Generate 3D label '$1' with font height $2, opacity $3 and color (${4--1})." +l[] { 0 t "$1",0,0,$2,1,${4--1},255 sprite3d } +#@cli label_points3d : _label_size>0,_opacity +#@cli : Add a numbered label to all vertices of selected 3D objects. +#@cli : Default values: 'label_size=13' and 'opacity=0.8'. +#@cli : $ torus3d 100,40,6,6 label_points3d 23,1 mode3d 1 +label_points3d : check ${1=13}>0 skip ${2=0.8} +e[^-1] "Label vertices of 3D object$?." +repeat $! { ++p3d[$>] 0 l. { +s3d rm[-3--1] +nbp={-2,@0} =.. $nbp,0,1 +(1,0;1,{$nbp-1}) r. 2,$nbp,1,1,3 r. 1,{2*h},1,1,-1 +repeat $nbp { +0 t. $>,0,0,$1,1,255,255,255 autocrop. 0 +i.. (-128;{w};{h};3) y. +} +repeat $nbp { +0 t. $>,0,0,$1,1,$2 autocrop. 0 +i.. (-128;{w};{h};1) y. +} +a y +} ++3d[$>,-1] +} +#@cli lathe3d : _resolution>0,_smoothness[%]>=0,_max_angle>=0 +#@cli : Generate 3D object from selected binary XY-profiles. +#@cli : Default values: 'resolution=128', 'smoothness=0.5%' and 'max_angle=361'. +#@cli : $ 300,300 rand -1,1 blur 40 sign normalize 0,255 lathe3d , +lathe3d : check "${1=128}>0 && ${2=0.5%}>=0 && ${3=361}>=0" +e[^-1] "Generate lathed 3D object from XY-profile$?, with resolution $1, smoothness $2 and maximum angle $3 deg." +tmax={($3-180)*pi/180} round norm n 0,1 autocrop 0 +foreach { +wr={max(1,w2=2*w;if(w2>h,min($1,w2),min($1,h)*w2/h))} +hr={max(1,w2=2*w;if(w2>h,min($1,w2)*h/w2,min($1,h)))} +rmax={sqrt(($wr)^2+($hr)^2)/2} +$wr,1,$wr,1,"xc = x - w/2; zc = z - d/2; t = atan2(zc,xc); if(t>"$tmax","$rmax",sqrt(xc*xc+zc*zc))" +*. {2*({-2,w}-1)/(w-1)} r. $wr,$hr,$wr +(0;{{-2,h}-1}) r. $wr,$hr,$wr,1,3 a[-2--1] c +warp.. .,0,1,0 rm. +expand_xyz 10,0 b $2 isosurface3d 50% rv3d +} +#@cli l3d : eq. to 'light3d'. : (+) +#@cli light3d : position_x,position_y,position_z : [texture] : (no arg) : (+) +#@cli : Set the light coordinates or the light texture for 3D rendering. +#@cli : (eq. to 'l3d').\n +#@cli : (no arg) resets the 3D light to default. +#@cli : $ torus3d 100,30 double3d 0 specs3d 1.2 repeat 5 { light3d {$>*100},0,-300 +snapshot3d[0] 400 } remove[0] +#@cli line3d : x0,y0,z0,x1,y1,z1 +#@cli : Input 3D line at specified coordinates. +#@cli : $ repeat 100 { a={$>*pi/50} line3d 0,0,0,{cos(3*$a)},{sin(2*$a)},0 color3d. ${-rgb} } add3d ++line3d : +e[^-1] "Input 3D line (${1-3})-(${4-6})." +1,21,1,1,67.5,73.5,109.5,103.5,51.5,100.5,2,1,${1-6},2,0,1,200,200,200,1 => [3D\ line] +#@cli lissajous3d : resolution>1,a,A,b,B,c,C +#@cli : Input 3D lissajous curves `x(t)=sin(a*t+A*2*pi)`, `y(t)=sin(b*t+B*2*pi)`, `z(t)=sin(c*t+C*2*pi)`. +#@cli : Default values: 'resolution=1024', 'a=2', 'A=0', 'b=1', 'B=0', 'c=0' and 'C=0'. +#@cli : $ lissajous3d , ++lissajous3d : check "isint(${1=1024}) && $1>1" skip ${2=2},${3=0},${4=1},${5=0},${6=0},${7=0} +e[^-1] "Input 3D lissajous curve, with resolution $1, (a,A)=($2,$3), (b,B)=($4,$5) and (c,C)=($6,$7)." +curve3d[] "const pi2 = 2*pi; sin($2*t + $3*pi2)","sin($4*t + $5*pi2)","sin($6*t + $7*pi2)",0,$1,0,{2*pi} +=> [3D\ lissajou] +#@cli m3d : eq. to 'mode3d'. +m3d : +l[] { check "isint(${1=4}) && inrange($1,-1,5)" mode=$1 onfail noarg mode=4 } +v + _mode3d $mode +#@cli mode3d : _mode +#@cli : Set static 3D rendering mode. +#@cli : (eq. to 'm3d').\n +#@cli : 'mode' can be { -1=bounding-box | 0=dots | 1=wireframe | 2=flat | 3=flat-shaded | 4=gouraud-shaded | 5=phong-shaded }."); +#@cli : Bounding-box mode ('mode==-1') is active only for the interactive 3D viewer. +#@cli : Default value: 'mode=4'. +#@cli : $ (0,1,2,3,4,5) double3d 0 repeat w { torus3d 100,30 rotate3d[-1] 1,1,0,60 mode3d {0,@$>} snapshot3d[-1] 300 } remove[0] +mode3d : +l[] { check "isint(${1=4}) && inrange($1,-1,5)" mode=$1 onfail noarg mode=4 } +v + _$0 $mode +_mode3d : +if $^>=0 +s0,s1,s2,s3,s4,s5,s6=bounding-box,dots,wireframe,flat,flat-shaded,gouraud-shaded,phong-shaded +e[0--4] "Set static 3D rendering mode to "${s{$1+1}}"." +fi +_mode3d=$1 +#@cli md3d : eq. to 'moded3d'. +md3d : +l[] { check "isint(${1=-1}) && inrange($1,-1,5)" mode=$1 onfail noarg mode=-1 } +v + _moded3d $mode +#@cli moded3d : _mode +#@cli : Set dynamic 3D rendering mode for interactive 3D viewer. +#@cli : (eq. to 'md3d').\n +#@cli : 'mode' can be { -1=bounding-box | 0=dots | 1=wireframe | 2=flat | 3=flat-shaded | 4=gouraud-shaded | 5=phong-shaded }. +#@cli : Default value: 'mode=-1'. +moded3d : +l[] { check "isint(${1=-1}) && inrange($1,-1,5)" mode=$1 onfail noarg mode=-1 } +v + _$0 $mode +_moded3d : +if $^>=0 +s0,s1,s2,s3,s4,s5,s6=bounding-box,dots,wireframe,flat,flat-shaded,gouraud-shaded,phong-shaded +e[0--4] "Set dynamic 3D rendering mode to "${s{$1+1}}"." +fi +_moded3d=$1 +#@cli *3d : eq. to 'mul3d'. : (+) +#@cli mul3d : factor : factor_x,factor_y,_factor_z : (+) +#@cli : Scale selected 3D objects isotropically or anisotropically, with specified factors. +#@cli : (eq. to '*3d'). +#@cli : Default value: 'factor_z=1'. +#@cli : $ torus3d 5,2 repeat 5 { +add3d[-1] 10,0,0 mul3d[-1] 1.2 color3d[-1] ${-rgb} } add3d +#@cli n3d : eq. to 'normalize3d'. +n3d : +_normalize3d +#@cli normalize3d +#@cli : Normalize selected 3D objects to unit size. +#@cli : (eq. to 'n3d'). +#@cli : $ repeat 100 { circle3d {u(3)},{u(3)},{u(3)},0.1 } add3d color3d[-1] 255,0,0 +normalize3d[-1] color3d[-1] 0,255,0 add3d +normalize3d : +_$0 +_normalize3d : +e[0--3] "Normalize size of 3D object$?." +check3d foreach { +if i[6] +s3d r[2] 3,{2,h/3},1,1,-1 s[2] x +factor={v=max({2,iM-im},{3,iM-im},{4,iM-im});if(v,v,1)} +a[2-4] x /[2] $factor y[2] a y +fi +} +#@cli o3d : eq. to 'opacity3d'. +o3d : +_gmic_s="$?" v + _opacity3d $* +#@cli opacity3d : opacity +#@cli : Set opacity of selected 3D objects. +#@cli : (eq. to 'o3d'). +#@cli : $ torus3d 100,10 double3d 0 repeat 7 { +rotate3d[-1] 1,0,0,20 opacity3d[-1] {u} } add3d +opacity3d : +_gmic_s="$?" v + _$0 $* +_opacity3d : +e[0--3] "Set opacity of 3D object"$_gmic_s" to $1." +foreach { +nbv,nbp:=f2ui([i[6],i[7]]) $nbp +eval. ">begin(p = 8 + 3*$nbv); p+=i[#0,p] + 1; end(set('p',p))" # Find beginning of color data +eval. ">begin(p = $p); i[#0,p]==-128?(p+=prod(crop(#0,0,++p,1,3))); p+=3; end(set('p',p))" # Skip color data +eval. ">begin(p = $p; const o = $1); i[#0,p]==-128?(p+=3 + prod(crop(#0,0,++p,1,3))):(i[#0,p++] = o)" +k[0] +} +#@cli parametric3d : _x(a,b),_y(a,b),_z(a,b),_amin,_amax,_bmin,_bmax,_res_a>0,_res_b>0,_res_x>0,_res_y>0,_res_z>0,_smoothness>=0,_isovalue>=0 +#@cli : Input 3D object from specified parametric surface `(a,b) ⟶ (x(a,b),y(a,b),z(a,b))`. +#@cli : Default values: 'x=(2+cos(b))*sin(a)', 'y=(2+cos(b))*cos(a)', 'c=sin(b)', 'amin=-pi', 'amax=pi', 'bmin=-pi', 'bmax=pi', 'res_a=512', 'res_b=res_a', 'res_x=64', 'res_y=res_x', 'res_z=res_y', 'smoothness=2%' and 'isovalue=10%'. +#@cli : $ parametric3d , ++parametric3d : skip "${1=(2+cos(b))*sin(a)}","${2=(2+cos(b))*cos(a)}","${3=sin(b)}" +skip ${4={-pi}},${5={pi}},${6={-pi}},${7={pi}} +check "${8=512}>0 && ${9=$8}>0 && ${10=64}>0 && ${11=$10}>0 && ${12=$11}>0 && ${13=2%}>=0 && ${14=10%}>=0" +e[^-1] "Input 3D object from parametric surface ($1,$2,$3)." +($4,$5;$4,$5^$6,$6;$7,$7) r. $8,$9,1,2,3 channels. 0,2 +f. "a=i(x,y,0,0);b=i(x,y,0,1);if(c==0,$1,if(c==1,$2,$3))" +sh. 0 xmin={im} xmax={iM} n. 16,{$10-17} rm. +sh. 1 ymin={im} ymax={iM} n. 16,{$11-17} rm. +sh. 2 zmin={im} zmax={iM} n. 16,{$12-17} rm. +r. {w*h},3,1,1,-1 +pointcloud. 1 r. $10,$11,$12,1,0 b. $13,0 +isosurface3d. $14 +c3d. n3d. *3d. {$xmax-$xmin},{$ymax-$ymin},{$zmax-$zmin} => [3D\ parametric] +#@cli pca_patch3d : _patch_size>0,_M>0,_N>0,_normalize_input={ 0 | 1 },_normalize_output={ 0 | 1 },_lambda_xy +#@cli : Get 3D patch-pca representation of selected images. +#@cli : The 3D patch-pca is estimated from M patches on the input image, and displayed as a cloud of N 3D points. +#@cli : Default values: 'patch_size=7', 'M=1000', 'N=3000', 'normalize_input=1', 'normalize_output=0', and 'lambda_xy=0'. +#@cli : $ image.jpg pca_patch3d 7 +pca_patch3d : check "isint(${1=7}) && $1>0 && isint(${2=1000}) && $2>0 && isint(${3=3000}) && $3>0" +skip ${4=1},${5=0},${6=0} +e[^-1] "Get 3D patch-pca representation"${arg0\ ($!>1),s,""}" of image$?, from $2 $1x$1 input patches, +with $3 output patches, input normalization "${arg0\ !$4,enabled,disabled}", output normalization "${arg0\ !$5,enabled,disabled}" and lambda_xy $6." +P1={int($1/2)} +P2={$1-$P1-1} +n 0,255 round 1 +foreach { +nm={n} s={s} +1,$2 rand. 0,{0,w-1} +rand. 0,{0,h-1} +f. 0 a[-3--1] x round. 1 +patches[0] $1,$1,1,{^} y[2--1] a[2--1] x +z[1] 0,1 transpose[1] *[1] $6 a[1,2] y s[^0] x +++[^0] /. $2 -[1--2] . rm. +a[^0] x +if $4 l. { s y / 'sqrt(1e-8+iv)' a y } fi ++transpose. m*[-2,-1] +eigen. rows.. 0,2 columns. 0,2 transpose. +if $5 sqrt.. /.. {-2,iM} ri.. . /. .. fi +rm.. +repeat $3 { +x={round(u({0,w}))} +y={round(u({0,h}))} +({$6*$x};{$6*$y}) ++z[0] {$x-$P1},{$y-$P1},{$x+$P2},{$y+$P2},1 +y. a[-2,-1] y +} ++a[2--1] x m*[1,-1] transpose[1] +rows[2--1] 2,100% +if $s!=3 +r[2--1] $1,$1,1,{min(3,$s)},-1 +r[2--1] $1,$1,1,3,{if($s!=1,0,1)} +y[2--1] +fi +i[2--2] (-128;$1;$1;3) a[2--1] y +rm[0] +i[0] ('CImg3d') +i[1] ($3;$3) +i[3] 2,$3,1,1,if(x==0,1,y) +1,$3,1,1,1 +y a[-6--1] y +=> $nm +} +#@cli plane3d : _size_x,_size_y,_nb_subdivisions_x>0,_nb_subdisivions_y>0 +#@cli : Input 3D plane at (0,0,0), with specified geometry. +#@cli : Default values: 'size_x=1', 'size_y=size_x' and 'nb_subdivisions_x=nb_subdivisions_y=24'. +#@cli : $ plane3d 50,30 +primitives3d 1 color3d[-2] ${-rgb} ++plane3d : check "${3=24}>0 && ${4=24}>0" skip ${1=1},${2=$1} +e[^-1] "Input 3D plane, with size (${1,2}) and subdivisions (${3,4})." +{$3+1},{$4+1} elevation3d. 0 *3d. {$1/$3},{$2/$4} col3d. 200 => [3D\ plane] +#@cli point3d : x0,y0,z0 +#@cli : Input 3D point at specified coordinates. +#@cli : $ repeat 1000 { a={$>*pi/500} point3d {cos(3*$a)},{sin(2*$a)},0 color3d[-1] ${-rgb} } add3d ++point3d : +e[^-1] "Input 3D point ($1,$2,$3)." +1,17,1,1,67.5,73.5,109.5,103.5,51.5,100.5,1,1,${1-3},1,0,200,200,200,1 => [3D\ point] +#@cli pointcloud3d +#@cli : Convert selected planar or volumetric images to 3D point clouds. +#@cli : $ image.jpg luminance resize2dy 100 threshold 50% mul 255 pointcloud3d color3d[-1] 255,255,255 +pointcloud3d : +e[^-1] "Convert image$? to 3D point cloud." +foreach { +nm={n} s z +foreach { ++norm !=. 0 +i.. (1,{w};1,{w}^1,1;{h},{h}) r.. .,.,1,2,3 *[-2,-1] round. permute. cxyz +l. { s -,0 a y is_points=$! } +if $is_points +-. 1 r. 2,{h/2},1,1,-1 permute. cyzx +warp.. .,0,0,1 rm... +permute.. cyzx i.. 1,{h},1,1,$> a[-3,-2] x +i... ('CImg3d') i... ({h},{h}) +i.. 1,{h},1,1,1 i.. 1,{h},1,1,y a[-3,-2] x +permute. cyzx +if w==1 r. 3,{h},1,1 +elif w>3 i.. 4,{h},1,1,-128,1,1,{w} a[-2,-1] x +else r. 3,{h},1,1,0 +fi +1,{h},1,1,1 +y[-6--1] a[-6--1] y +else rm empty3d +fi +} ++3d => $nm +} +#@cli pose3d : p1,...,p12 +#@cli : Apply 3D pose matrix to selected 3D objects. +#@cli : $ torus3d 100,20 pose3d 0.152437,1.20666,-0.546366,0,-0.535962,0.559129,1.08531,0,1.21132,0.0955431,0.548966,0,0,0,-206,1 snapshot3d 400 +pose3d : +e[^-1] "Apply 3D pose matrix [ $1,$2,$3,$4; $5,$6,$7,$8; $9,$10,$11,$12 ] to 3D object$?." +foreach { +if ${-_is_mesh3d} +if "i[6] && i[7]" +s3d r[2] 3,{2,h/3},1,1,-1 i[3] 1,{2,h},1,1,1 a[2,3] x +i[3] ($1,$5,$9;$2,$6,$10;$3,$7,$11;$4,$8,$12) m*[2,3] +r[2] 1,{2,3*h},1,1,-1 a y +fi +else error "Command '$0': Image ["{$!-$>-1}"] does not represent a 3D object." +fi +} +#@cli p3d : eq. to 'primitives3d'. +p3d : check "isint($1) && inrange($1,0,2)" +_gmic_s="$?" v + _primitives3d $* +#@cli primitives3d : mode +#@cli : Convert primitives of selected 3D objects. +#@cli : (eq. to 'p3d').\n +#@cli : 'mode' can be { 0=points | 1=outlines | 2=non-textured }. +#@cli : $ sphere3d 30 primitives3d 1 torus3d 50,10 color3d[-1] ${-rgb} add3d +primitives3d : check "isint($1) && inrange($1,0,2)" +_gmic_s="$?" v + _$0 $* +_primitives3d : +s0,s1,s2=points,segments,non-textured +e[0--3] "Convert primitives of 3D object"$_gmic_s" to "$s$1"." +check3d foreach { +s3d nbv,nbp={1,f2ui(crop())} +r[2] 3,{2,h/3},1,1,-1 permute[2] zycx ($nbv) a[2,-1] y +tmp=$! $nbp eval. ">begin(p = N = 0); +i[#4,p++]==-128?( +W = i[#4,p++]; H = i[#4,p++]; S = i[#4,p++]; WHS = W*H*S; +WHS?(run('+z[4] 0,',p,',0,',p + WHS - 1,' r. ',W,',',H,',1,',S,',-1 => tx',N); p+=WHS); +):(p+=2); +++N" rm[$tmp] +1x3 => prims,cols,opacs +$nbp eval. "> +begin( +const mode = $1; +pp = pc = po = 0; +M = N = 0; +RGB0 = RGB1 = RGB2 = RGB3 = [ 0,0,0 ]; +refc = vector(#$nbp); # Correspondence old -> new indices for shared textures +add_colored_point(i,R,G,B,O) = ( +vname = string(#24,'pt',i); +isnan(get(vname))?( +da_push(#$prims,1,ui2f(i)); +da_push(#$cols,R,G,B); +da_push(#$opacs,O); +set(vname,1); +++N; +); +); +add_colored_segment(i0,i1,R,G,B,O) = ( +vname = string(#24,'seg',min(i0,i1),'_',max(i0,i1)); +isnan(get(vname))?( +da_push(#$prims,2,ui2f(i0),ui2f(i1)); +da_push(#$cols,R,G,B); +da_push(#$opacs,O); +set(vname,1); +++N; +); +); +add_textured_segment(i0,i1,tx0,ty0,tx1,ty1) = ( +vname = string(#24,'seg',min(i0,i1),'_',max(i0,i1)); +isnan(get(vname))?( +da_push(#$prims,6,ui2f(i0),ui2f(i1),tx0,ty0,tx1,ty1); +!is_shared_texture?( +da_push(#$cols,-128,wc,hc,sc); +off = da_size(#$cols); +resize(#$cols,1,h(#$cols) + whsc,1,1,0); +copy(i[#$cols,off],i[#ind_texture,0],whsc); +i[#$cols,h(#$cols) - 1] = off + whsc; +is_shared_texture = 1; +refc[M] = N; +wc = M; +):da_push(#$cols,-128,ui2f(refc[wc]),0,0); # Shared texture +da_push(#$opacs,O); +set(vname,1); +++N; +); +); +); +n = i[#3,pp++]; # Type of primitive +ind_texture = -1; R = i[#4,pc++]; +R==-128?( +wc = i[#4,pc++]; hc = i[#4,pc++]; sc = i[#4,pc++]; whsc = wc*hc*sc; +is_shared_texture = whsc?0:1; vname = string(#24,'tx',whsc?M:wc); ind_texture = get(vname); pc+=whsc; +wt1 = w#ind_texture - 1; ht1 = h#ind_texture - 1; +R = G = B = 200; +):(G = i[#4,pc++]; B = i[#4,pc++]); +O = i[#5,po++]; +O==-128?( +wo = i[#5,po++]; ho = i[#5,po++]; so = i[#5,po++]; whso = wo*ho*so; po+=whso; +O = 1; +); +n==1?( +i0 = f2ui(i[#3,pp++]); +add_colored_point(i0,R,G,B,O); +):n==2?( +i0 = f2ui(i[#3,pp++]); i1 = f2ui(i[#3,pp++]); +mode==0?(add_colored_point(i0,R,G,B,O); add_colored_point(i1,R,G,B,O)): +add_colored_segment(i0,i1,R,G,B,O); +):n==3?( +i0 = f2ui(i[#3,pp++]); i1 = f2ui(i[#3,pp++]); i2 = f2ui(i[#3,pp++]); +mode==0?(add_colored_point(i0,R,G,B,O); add_colored_point(i1,R,G,B,O); add_colored_point(i2,R,G,B,O)): +mode==1?(add_colored_segment(i0,i1,R,G,B,O); add_colored_segment(i1,i2,R,G,B,O); +add_colored_segment(i2,i0,R,G,B,O)): +(da_push(#$prims,3,ui2f(i0),ui2f(i1),ui2f(i2)); da_push(#$cols,R,G,B); da_push(#$opacs,O); ++N); +):n==4?( +i0 = f2ui(i[#3,pp++]); i1 = f2ui(i[#3,pp++]); i2 = f2ui(i[#3,pp++]); i3 = f2ui(i[#3,pp++]); +mode==0?(add_colored_point(i0,R,G,B,O); add_colored_point(i1,R,G,B,O); +add_colored_point(i2,R,G,B,O); add_colored_point(i3,R,G,B,O)): +mode==1?(add_colored_segment(i0,i1,R,G,B,O); add_colored_segment(i1,i2,R,G,B,O); +add_colored_segment(i2,i3,R,G,B,O); add_colored_segment(i3,i0,R,G,B,O)): +(da_push(#$prims,4,ui2f(i0),ui2f(i1),ui2f(i2),ui2f(i3)); da_push(#$cols,R,G,B); da_push(#$opacs,O); ++N); +):n==5?( +i0 = f2ui(i[#3,pp++]); i1 = f2ui(i[#3,pp++]); is_outlined = i[#3,pp]; pp+=3; +mode==0?( +P0 = I[#2,i0]; P1 = I[#2,i1]; nind = da_size(#2); da_push(#2,(P0 + P1)/2); +add_colored_point(nind,R,G,B,O); +):( +da_push(#$prims,5,ui2f(i0),ui2f(i1),mode==1?1:is_outlined,0,0); da_push(#$cols,R,G,B); da_push(#$opacs,O); +++N; +); +):n==6?( +i0 = f2ui(i[#3,pp++]); i1 = f2ui(i[#3,pp++]); +tx0 = cut(i[#3,pp++],0,wt1); ty0 = cut(i[#3,pp++],0,ht1); +tx1 = cut(i[#3,pp++],0,wt1); ty1 = cut(i[#3,pp++],0,ht1); +mode==0?( +copy(RGB0,i(#ind_texture,tx0,ty0,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB1,i(#ind_texture,tx1,ty1,0,0),min(3,s#ind_texture),1,wh#ind_texture); +add_colored_point(i0,RGB0[0],RGB0[1],RGB0[2],O); +add_colored_point(i1,RGB1[0],RGB1[1],RGB1[2],O); +):mode==1?add_textured_segment(i0,i1,tx0,ty0,tx1,ty1):( +da_push(#$prims,2,ui2f(i0),ui2f(i1)); +copy(RGB0,i(#ind_texture,tx0,ty0,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB1,i(#ind_texture,tx1,ty1,0,0),min(3,s#ind_texture),1,wh#ind_texture); +(RGB0+=RGB1)/=2; +da_push(#$cols,RGB0[0],RGB0[1],RGB0[2]); +da_push(#$opacs,O); +++N; +); +):n==9?( +i0 = f2ui(i[#3,pp++]); i1 = f2ui(i[#3,pp++]); i2 = f2ui(i[#3,pp++]); +tx0 = cut(i[#3,pp++],0,wt1); ty0 = cut(i[#3,pp++],0,ht1); +tx1 = cut(i[#3,pp++],0,wt1); ty1 = cut(i[#3,pp++],0,ht1); +tx2 = cut(i[#3,pp++],0,wt1); ty2 = cut(i[#3,pp++],0,ht1); +mode==0?( +copy(RGB0,i(#ind_texture,tx0,ty0,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB1,i(#ind_texture,tx1,ty1,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB2,i(#ind_texture,tx2,ty2,0,0),min(3,s#ind_texture),1,wh#ind_texture); +add_colored_point(i0,RGB0[0],RGB0[1],RGB0[2],O); +add_colored_point(i1,RGB1[0],RGB1[1],RGB1[2],O); +add_colored_point(i2,RGB2[0],RGB2[1],RGB2[2],O); +):mode==1?( +add_textured_segment(i0,i1,tx0,ty0,tx1,ty1); +add_textured_segment(i1,i2,tx0,ty0,tx2,ty2); +add_textured_segment(i2,i0,tx2,ty2,tx0,ty0); +):( +da_push(#$prims,3,ui2f(i0),ui2f(i1),ui2f(i2)); +copy(RGB0,i(#ind_texture,tx0,ty0,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB1,i(#ind_texture,tx1,ty1,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB2,i(#ind_texture,tx2,ty2,0,0),min(3,s#ind_texture),1,wh#ind_texture); +(RGB0+=RGB1+=RGB2)/=3; +da_push(#$cols,RGB0[0],RGB0[1],RGB0[2]); +da_push(#$opacs,O); +++N; +); +):n==12?( +i0 = f2ui(i[#3,pp++]); i1 = f2ui(i[#3,pp++]); i2 = f2ui(i[#3,pp++]); i3 = f2ui(i[#3,pp++]); +tx0 = cut(i[#3,pp++],0,wt1); ty0 = cut(i[#3,pp++],0,ht1); +tx1 = cut(i[#3,pp++],0,wt1); ty1 = cut(i[#3,pp++],0,ht1); +tx2 = cut(i[#3,pp++],0,wt1); ty2 = cut(i[#3,pp++],0,ht1); +tx3 = cut(i[#3,pp++],0,wt1); ty3 = cut(i[#3,pp++],0,ht1); +mode==0?( +copy(RGB0,i(#ind_texture,tx0,ty0,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB1,i(#ind_texture,tx1,ty1,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB2,i(#ind_texture,tx2,ty2,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB3,i(#ind_texture,tx3,ty3,0,0),min(3,s#ind_texture),1,wh#ind_texture); +add_colored_point(i0,RGB0[0],RGB0[1],RGB0[2],O); +add_colored_point(i1,RGB1[0],RGB1[1],RGB1[2],O); +add_colored_point(i2,RGB2[0],RGB2[1],RGB2[2],O); +add_colored_point(i3,RGB3[0],RGB3[1],RGB3[2],O) +):mode==1?( +add_textured_segment(i0,i1,tx0,ty0,tx1,ty1); +add_textured_segment(i1,i2,tx1,ty1,tx2,ty2); +add_textured_segment(i2,i3,tx2,ty2,tx3,ty3); +add_textured_segment(i3,i0,tx3,ty3,tx0,ty0); +):( +da_push(#$prims,4,ui2f(i0),ui2f(i1),ui2f(i2),ui2f(i3)); +copy(RGB0,i(#ind_texture,tx0,ty0,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB1,i(#ind_texture,tx1,ty1,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB2,i(#ind_texture,tx2,ty2,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB3,i(#ind_texture,tx3,ty3,0,0),min(3,s#ind_texture),1,wh#ind_texture); +(RGB0+=RGB1+=RGB2+=RGB3)/=4; +da_push(#$cols,RGB0[0],RGB0[1],RGB0[2]); +da_push(#$opacs,O); +++N; +); +):(pp+=n); +++M; +end(set('N',N)); +" rm. +da_freeze[2,prims,cols,opacs] +f[1] {2,h},$N +permute[2] cyzx y[2] rv[3,prims] rv[4,cols] rv[5,opacs] k[0-5] a y +} +#@cli projections3d : _x[%],_y[%],_z[%],_is_bounding_box={ 0 | 1 } +#@cli : Generate 3D xy,xz,yz projection planes from specified volumetric images. +projections3d : skip ${1=50%},${2=50%},${3=50%},${4=1} +e[^-1] "Generate 3D xy,xz,yz projection planes from image$?." +n 0,255 +foreach { +w={w} h={h} d={d} +x={if(${is_percent\ $1},$1*w,$1)} +y={if(${is_percent\ $2},$2*h,$2)} +z={if(${is_percent\ $3},$3*d,$3)} ++rows $2,$2 r. {w},{d},1,100%,-1 ++columns.. $1,$1 permute. zyxc +slices... $3,$3 r[-3--1] 100%,100%,1,3 +imageplane3d[-3--1] +r3d. 0,1,0,-90 r3d.. 1,0,0,90 ++3d... 0,0,$z +3d.. 0,$y,0 +3d. $x,0,0 ++3d[-3--1] o3d. 0.8 +if $4 box3d $w,$h,$d p3d. 1 o3d. 0.4 +3d[-2,-1] fi +} +#@cli pyramid3d : width,height +#@cli : Input 3D pyramid at (0,0,0), with specified geometry. +#@cli : $ pyramid3d 100,-100 +primitives3d 1 color3d[-2] ${-rgb} ++pyramid3d : +e[^-1] "Input new 3D pyramid, with width $1 and height $2." +(67.5;73.5;109.5;103.5;51.5;100.5;\ +5;5;\ +{-$1/2};{-$1/2};{-$2/2};\ +{$1/2};{-$1/2};{-$2/2};{$1/2};{$1/2};{-$2/2};{-$1/2};{$1/2};{-$2/2};0;0;{$2/2};4;0;3;2;1;\ +3;0;4;3;3;1;4;0;3;2;4;1;3;3;4;2) +1,15,1,1,200 1,5,1,1,1 a[-3--1] y => [3D\ pyramid] +#@cli quadrangle3d : x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3 +#@cli : Input 3D quadrangle at specified coordinates. +#@cli : $ quadrangle3d -10,-10,10,10,-10,10,10,10,10,-10,10,10 repeat 10 { +rotate3d[-1] 0,1,0,30 color3d[-1] ${-rgb},0.6 } add3d mode3d 2 ++quadrangle3d : +e[^-1] "Input 3D quadrangle ($1,$2,$3)-($4,$5,$6)-($7,$8,$9)-($10,$11,$12)." +1,29,1,1,67.5,73.5,109.5,103.5,51.5,100.5,4,1,${1-12},4,0,1,2,3,200,200,200,1 => [3D\ quadrangle] +#@cli random3d : nb_points>=0 +#@cli : Input random 3D point cloud in [0,1]^3. +#@cli : $ random3d 100 circles3d 0.1 opacity3d 0.5 ++random3d : check "$1>=0" +e[^-1] "Input random 3D point cloud, with $1 points." +if $1<0.5 empty3d +else l[] { +N={round($1)} +({'CImg3d'},$N,$N) +3,$N rand. 0,1 +1,$N,1,1,1 1,$N,1,1,y a[-2,-1] x +3,$N,1,1,200 1,$N,1,1,1 +y a y +} fi +=> [3D\ random\ pointcloud] +#@cli rv3d : eq. to 'reverse3d'. +rv3d : +_gmic_s="$?" v + _reverse3d +#@cli reverse3d +#@cli : Reverse primitive orientations of selected 3D objects. +#@cli : (eq. to 'rv3d'). +#@cli : $ torus3d 100,40 double3d 0 +reverse3d +reverse3d : +_gmic_s="$?" v + _$0 +_reverse3d : +e[0--3] "Reverse primitives orientation of 3D object"$_gmic_s"." +check3d foreach { +{f2ui(i[7])} eval. ">begin(p = 8 + 3*f2ui(i[#0,6])); +n = i[#0,p++]; +n==2?swap(i[#0,p],i[#0,p + 1]): +n==3?swap(i[#0,p + 1],i[#0,p + 2]): +n==4?swap(i[#0,p + 1],i[#0,p + 3]): +n==6?(swap(i[#0,p],i[#0,p + 1]); swap(i[#0,p + 2],i[#0,p + 4]); swap(i[#0,p + 3],i[#0,p + 5])): +n==9?(swap(i[#0,p + 1],i[#0,p + 2]); swap(i[#0,p + 5],i[#0,p + 7]); swap(i[#0,p + 6],i[#0,p + 8])): +n==12?(swap(i[#0,p + 1],i[#0,p + 3]); swap(i[#0,p + 6],i[#0,p + 10]); swap(i[#0,p + 7],i[#0,p + 11])); +p+=n" +rm. +} +#@cli r3d : eq. to 'rotate3d'. : (+) +#@cli rotate3d : u,v,w,angle : (+) +#@cli : Rotate selected 3D objects around specified axis with specified angle (in deg.). +#@cli : (eq. to 'r3d'). +#@cli : $ torus3d 100,10 double3d 0 repeat 7 { +rotate3d[-1] 1,0,0,20 } add3d +#@cli rotation3d : u,v,w,angle +#@cli : Input 3x3 rotation matrix with specified axis and angle (in deg). +#@cli : $ rotation3d 1,0,0,0 rotation3d 1,0,0,90 rotation3d 1,0,0,180 +rotation3d : +e[^-1] "Input 3D rotation matrix around axis ($1,$2,$3) with angle $4 deg." +3,3,1,1,{"rot(${1-4}°)"} => [3D\ rotation] +#@cli sierpinski3d : _recursion_level>=0,_width,_height +#@cli : Input 3D Sierpinski pyramid. +#@cli : $ sierpinski3d 3,100,-100 +primitives3d 1 color3d[-2] ${-rgb} ++sierpinski3d : check ${1=4}>=0 skip ${2=1},${3=1} +-e[^-1] "Input 3D Sierpinski pyramid of degree $1, with width $2 and height $3." +l[] { +_sierpinski3d {-$2/2},{-$2/2},{-$3/2},{$2/2},{-$2/2},{-$3/2},{$2/2},{$2/2},{-$3/2},{-$2/2},{$2/2},{-$3/2},0,0,{$3/2},$1 ++3d +} +=> [3D\ sierpinski] +_sierpinski3d : +if $16<=0 +(67.5;73.5;109.5;103.5;51.5;100.5;5;5;$1;$2;$3;$4;$5;$6;$7;$8;$9;$10;$11;$12;$13;$14;$15;4;0;3;2;1;3;0;4;3;3;1;4;0;3;2;4;1;3;3;4;2) +1,15,1,1,200 1,5,1,1,1 a[-3--1] y +return fi +_sierpinski3d $1,$2,$3,{($1+$4)/2},{($2+$5)/2},{($3+$6)/2},{($1+$4+$7+$10)/4},{($2+$5+$8+$11)/4},{($3+$6+$9+$12)/4},{($1+$10)/2},{($2+$11)/2},{($3+$12)/2},{($1+$13)/2},{($2+$14)/2},{($3+$15)/2},{$16-1} +_sierpinski3d {($1+$4)/2},{($2+$5)/2},{($3+$6)/2},$4,$5,$6,{($4+$7)/2},{($5+$8)/2},{($6+$9)/2},{($1+$4+$7+$10)/4},{($2+$5+$8+$11)/4},{($3+$6+$9+$12)/4},{($4+$13)/2},{($5+$14)/2},{($6+$15)/2},{$16-1} +_sierpinski3d {($1+$4+$7+$10)/4},{($2+$5+$8+$11)/4},{($3+$6+$9+$12)/4},{($4+$7)/2},{($5+$8)/2},{($6+$9)/2},$7,$8,$9,{($7+$10)/2},{($8+$11)/2},{($9+$12)/2},{($7+$13)/2},{($8+$14)/2},{($9+$15)/2},{$16-1} +_sierpinski3d {($1+$10)/2},{($2+$11)/2},{($3+$12)/2},{($1+$4+$7+$10)/4},{($2+$5+$8+$11)/4},{($3+$6+$9+$12)/4},{($7+$10)/2},{($8+$11)/2},{($9+$12)/2},$10,$11,$12,{($10+$13)/2},{($11+$14)/2},{($12+$15)/2},{$16-1} +_sierpinski3d {($1+$13)/2},{($2+$14)/2},{($3+$15)/2},{($4+$13)/2},{($5+$14)/2},{($6+$15)/2},{($7+$13)/2},{($8+$14)/2},{($9+$15)/2},{($10+$13)/2},{($11+$14)/2},{($12+$15)/2},$13,$14,$15,{$16-1} +#@cli size3d +#@cli : Return bounding box size of the last selected 3D object. +size3d : ++rows. 8,{8+3*i[6]} r. 3,{h/3},1,1,-1 s. x,3 +u {-3,iM-im},{-2,iM-im},{iM-im} +rm[-3--1] +#@cli skeleton3d : _metric,_frame_type={ 0=squares | 1=diamonds | 2=circles | 3=auto },_skeleton_opacity,_frame_opacity,_is_frame_wireframe={ 0 | 1 } +#@cli : Build 3D skeletal structure object from 2d binary shapes located in selected images. +#@cli : 'metric' can be { 0=chebyshev | 1=manhattan | 2=euclidean }. +#@cli : Default values: 'metric=2', 'bones_type=3', 'skeleton_opacity=1' and 'frame_opacity=0.1'. +#@cli : $ shape_cupid 480 +skeleton3d , +skeleton3d : check "isint(${1=2}) && $1>=0 && $1<=2 && isint(${2=3}) && $2>=0 && $2<=3" skip ${3=1},${4=0.1},${5=1} +e[^-1] "Build 3D skeletal structure object from image$?, with "${arg0\ $1,chebyshev,manhattan,euclidean}" metric, "${arg0\ $2,squares,diamonds,circles,auto}" bones, skeleton opacity $3 and frame opacity $4 ." +foreach { +channels 0 ++distance 0,$1 ++f. "(i>j(-1)&&i>j(1)) || (i>j(0,-1)&&i>j(0,1)) || (i>j(-1,-1)&&i>j(1,1)) || (i>j(-1,1)&&i>j(1,-1))" +if $3 +slices. -1,0 isosurface3d. 0.5 o3d. $3 col3d. 255,0,0 fi +*[0-2] pointcloud3d[0] +if $4 l[0] { +s3d +n={1,@0} +if $n +r[2] 3,$n,1,1,-1 r[3] 2,$n,1,1,-1 r[4] 3,$n,1,1,-1 +if $2==0" || "($2==3" && "$1==0) +=[1] {4*$n} +i[3] [2]x3 +z.. 0,1 z. 0,2 -[2] . +[4] . +s. x *.. -1 a[-3--1] x +[3] . -[5,-1] a[2-5] x +rm[3] 1,$n,1,1,4 +f. 4*y ++. 1 ++. 1 ++. 1 rv[-3,-1] a[-5--1] x mv. 3 +elif $2==1" || "($2==3" && "$1==1) +=[1] {4*$n} +i[3] [2]x3 +z.. 0,0 z. 0,2 -[2] . +[4] . +shift. 1,0 -[3] . +[5,-1] a[2-5] x +rm[3] 1,$n,1,1,4 +f. 4*y ++. 1 ++. 1 ++. 1 rv[-3,-1] a[-5--1] x mv. 3 +elif $2==2" || "($2==3" && "$1==2) +=[1] {2*$n} ++z[4] 0,0 z. 0,2 ++[2,-1] -[2,-2] a[2,-1] x +rm[3] 1,$n,1,1,5 +f. 2*y ++. 1 3,100% a[-4--1] x mv. 3 +fi +y a y o3d $4 if $5 p3d 1 fi col3d 200 +else rm empty3d fi +} else rm[0] fi ++3d +} +#@cli snapshot3d : _size>0,_zoom>=0,_backgroundR,_backgroundG,_backgroundB,_backgroundA : [background_image],zoom>=0 +#@cli : Take 2D snapshots of selected 3D objects. +#@cli : Set 'zoom' to 0 to disable object auto-scaling. +#@cli : Default values: 'size=512', 'zoom=1' and '[background_image]=(default)'. +#@cli : $ torus3d 100,20 rotate3d 1,1,0,60 snapshot3d 400,1.2,128,64,32 +#@cli : $ torus3d 100,20 rotate3d 1,1,0,60 sample ? +snapshot3d[0] [1],1.2 +snapshot3d : check "${2=1}>=0" skip ${1=512},${3=""} +if ${"is_image_arg $1"} +e[0--3] "Take $1x$1 snapshot$? of 3D object$?, with zoom factor $2 and background image $3." +pass$1 0 to_color. +elif isnum($3) +e[0--3] "Take $1x$1 snapshot$? of 3D object$?, with zoom factor $2 and background color ${3--1}." +(${3--1}) y. c r. $1,$1 to_color. +else +e[0--3] "Take $1x$1 snapshot$? of 3D object$?, with zoom factor $2 and default background." +3,3,1,1,"0,0,0,0,0,100,100,0,50" permute. cyzx r. $1,$1,1,3,3 round. +fi +repeat $!-1 { . l[$>,-1] { +if $2!=0 c3d[0] n3d[0] *3d[0] {3*min(w,h)*$2/4} fi +if s>3 +100%,100%,1,3,-1 j3d. [0],50%,50%,0,1 +to_rgba. replace_color. 0,0,-1,-1,-1,255,0,0,0,0 blend[-2,-1] alpha +else +j3d[1] [0],50%,50%,0,1 +fi +=>[1] {-2,n} rm[0] +} } rm. +#@cli sl3d : eq. to 'specl3d'. +sl3d : +l[] { check "${1=0.15}>=0" value=$1 onfail noarg value=0.15 } +v + _specl3d $value +#@cli specl3d : value>=0 +#@cli : Set lightness of 3D specular light. +#@cli : (eq. to 'sl3d'). +#@cli : Default value: 'value=0.15'. +#@cli : $ (0,0.3,0.6,0.9,1.2) repeat w { torus3d 100,30 rotate3d[-1] 1,1,0,60 color3d[-1] 255,0,0 specl3d {0,@$>} snapshot3d[-1] 400 } remove[0] +specl3d : +l[] { check "${1=0.15}>=0" value=$1 onfail noarg value=0.15 } +v + _$0 $value +_specl3d : +e[0--3] "Set lightness of 3D specular light to $1." +_specl3d=$1 +#@cli ss3d : eq. to 'specs3d'. +ss3d : +l[] { check "${1=0.8}>=0" value=$1 onfail noarg value=0.8 } +v + _specs3d $value +#@cli specs3d : value>=0 +#@cli : Set shininess of 3D specular light. +#@cli : (eq. to 'ss3d'). +#@cli : Default value: 'value=0.8'. +#@cli : $ (0,0.3,0.6,0.9,1.2) repeat w { torus3d 100,30 rotate3d[-1] 1,1,0,60 color3d[-1] 255,0,0 specs3d {0,@$>} snapshot3d[-1] 400 } remove[0] +specs3d : +l[] { check "${1=0.8}>=0" value=$1 onfail noarg value=0.8 } +v + _$0 $value +_specs3d : +e[0--3] "Set shininess of 3D specular light to $1." +_specs3d=$1 +#@cli sphere3d : radius,_nb_recursions!=0 : radius,_nb_phi>=3,_nb_theta>=3 +#@cli : Input 3D sphere at (0,0,0), with specified geometry. +#@cli : - If 2 arguments are specified: +#@cli : - If 'nb_recursions>0', the sphere is generated using recursive subdivisions of an **icosahedron**. +#@cli : - If 'nb_recursions<0', the sphere is generated using recursive subdividions of a **cube**. +#@cli : - If 3 arguments are specified, the sphere is generated using spherical coordinates discretization. +#@cli : Default value: 'nb_recursions=3'. +#@cli : $ sphere3d 100 +primitives3d 1 color3d[-2] ${-rgb} ++sphere3d : check "isnum(${1=1})" skip "${2=3},${3=}" +if !narg($3) +e[0--3] "Input 3D sphere, with radius $1 and $2 subdivision iterations." +l[] { +if $2>=0 +(1;3;1;3;2;2;2;2;4;0;4;0^2;2;2;2;4;4;0;0;3;3;1;1^4;4;0;0;3;1;3;1;2;2;2;2) +(-0.850650808352039932,-0.525731112119133606,0,0.525731112119133606,0.850650808352039932) +map.. . rm. (12) a[-2,-1] y +(0;0;9;4;4;8;8;5;5;2;7;7;7;11;0;6;9;9;9;7^\ +1;4;4;8;1;1;10;8;3;3;3;10;6;6;6;10;11;2;5;11^4;9;5;5;8;10;3;3;2;7;10;6;11;0;1;1;0;11;2;2) (20) a[-2,-1] y +repeat $2 { +0 +1,{1,@{1,h-1}},1,1," +unit(V) = (ref(V,_V); _V/norm(_V)); +p = I[#1,y]; +P0 = I[#0,p[0]]; P1 = I[#0,p[1]]; P2 = I[#0,p[2]]; +ref(string(#48,'p',min(p[0],p[1]),'_',max(p[0],p[1])),varname); p01 = get(varname); +isnan(p01)?(set(varname,p01 = da_size(#0)); da_push(#0,unit((P0 + P1)/2))); +ref(string(#48,'p',min(p[0],p[2]),'_',max(p[0],p[2])),varname); p02 = get(varname); +isnan(p02)?(set(varname,p02 = da_size(#0)); da_push(#0,unit((P0 + P2)/2))); +ref(string(#48,'p',min(p[1],p[2]),'_',max(p[1],p[2])),varname); p12 = get(varname); +isnan(p12)?(set(varname,p12 = da_size(#0)); da_push(#0,unit((P1 + P2)/2))); +da_push([p[0],p01,p02],[p01,p[1],p12],[p02,p12,p[2]],[p01,p12,p02])" +rm[1,-1] +} +else +(-1;1;1;-1;-1;1;1;-1^-1;-1;1;1;-1;-1;1;1^-1;-1;-1;-1;1;1;1;1) /. {sqrt(3)} (8) a[-2,-1] y +(0;4;0;3;0;1^3;5;1;7;4;2^2;6;5;6;7;6^1;7;4;2;3;5) (6) a[-2,-1] y +repeat -$2 { +0 +1,{1,@{1,h-1}},1,1," +unit(V) = (ref(V,_V); _V/norm(_V)); +p = I[#1,y]; +P0 = I[#0,p[0]]; P1 = I[#0,p[1]]; P2 = I[#0,p[2]]; P3 = I[#0,p[3]]; +ref(string(#48,'p',min(p[0],p[1]),'_',max(p[0],p[1])),varname); p01 = get(varname); +isnan(p01)?(set(varname,p01 = da_size(#0)); da_push(#0,unit((P0 + P1)/2))); +ref(string(#48,'p',min(p[1],p[2]),'_',max(p[1],p[2])),varname); p12 = get(varname); +isnan(p12)?(set(varname,p12 = da_size(#0)); da_push(#0,unit((P1 + P2)/2))); +ref(string(#48,'p',min(p[2],p[3]),'_',max(p[2],p[3])),varname); p23 = get(varname); +isnan(p23)?(set(varname,p23 = da_size(#0)); da_push(#0,unit((P2 + P3)/2))); +ref(string(#48,'p',min(p[0],p[3]),'_',max(p[0],p[3])),varname); p03 = get(varname); +isnan(p03)?(set(varname,p03 = da_size(#0)); da_push(#0,unit((P0 + P3)/2))); +pc = da_size(#0); +da_push(#0,unit((P0 + P1 + P2 + P3)/4)); +da_push([p[0],p01,pc,p03],[p01,p[1],p12,pc],[pc,p12,p[2],p23],[p03,pc,p23,p[3]])" +rm[1,-1] +} +fi +da_freeze nbp={1,h} +*[0] $1 permute cyzx i.. 1,100%,1,1,{w} a[-2,-1] x +i[0] ({'CImg3d'},{0,h},$nbp) 3,$nbp,1,1,200 1,$nbp,1,1,1 y a y +} +else +e[0--3] "Input 3D sphere, with radius $1 and angular discretizations ($2,$3)." +l[] { +nb_phi,nb_theta={max(3,$2)},{max(3,$3)} +1 $nb_phi,{$nb_theta-2},1,1," +begin(da_push(#0,0,0,-1)); +theta = lerp(0,pi,(y + 1)/(h + 1)); +phi = lerp(0,2*pi,x/w); +st = sin(theta); +da_push(#0,cos(phi)*st,sin(phi)*st,-cos(theta)); +end(da_push(#0,0,0,1); da_freeze())" rm. +1 $nb_phi,{$nb_theta-1},1,1," +const p = w; const ptm2p1 = p*(h - 1) + 1; +xp1 = x + 1; xp1mpp1 = xp1%p + 1; +yp = (y - 1)*p; yp1p = yp + p; +!y?da_push(3,0,xp1mpp1,xp1): +y "[3D sphere]" +#@cli spherical3d : "radius_function(phi,theta)",_nb_recursions!=0 : "radius_function(phi,theta)",_nb_phi>=3,_nb_theta>=3 +#@cli : Input 3D spherical object at (0,0,0), with specified geometry. +#@cli : Second and third arguments are the same as in command ''sphere3d''. +#@cli : Default values: 'nb_recursions=5'. +#@cli : $ spherical3d "abs(1+0.5*cos(3*phi)*sin(4*theta))" +primitives3d 1 ++spherical3d : check "${2=5}!=0" skip "${3=}" +e[^-1] "Input 3D spherical object, with radius function '$1'." +l[] { +sphere3d 1,${2--1} +s3d +r[2] 3,{2,h/3},1,1,-1 permute[2] zycx +f[2] " +V = [ i0,i1,i2 ]; +V/=norm(V); +theta = -acos(V[2]); +phi = atan2(V[1],V[0]); +R = ($1); +st = sin(theta); +[ R*cos(phi)*st,R*sin(phi)*st,R*cos(theta) ]" +permute[2] cyzx y[2] a y +=> "[3D spherical surface '$1']" +} +#@cli spline3d : x0[%],y0[%],z0[%],u0[%],v0[%],w0[%],x1[%],y1[%],z1[%],u1[%],v1[%],w1[%],_nb_vertices>=2 +#@cli : Input 3D spline with specified geometry. +#@cli : Default values: 'nb_vertices=128'. +#@cli : $ repeat 100 { spline3d {u},{u},{u},{u},{u},{u},{u},{u},{u},{u},{u},{u},128 color3d[-1] ${-rgb} } box3d 1 primitives3d[-1] 1 add3d ++spline3d : check ${13=128}>=2 +e[^-1] "Input new 3D spline from (${1-3}) [${4-6}] to (${7-9}) [${10-12}] with $13 vertices." +('CImg3d') +. 0.5 +($13;{$13-1}) +1,$13,1,1,1 (0;1) r. 1,$13,1,1,3 +sqr. +*[-2,-1] a[-4--1] x ++*. '$2,$5,{3*(($8)-($2))-2*($5)-($11)},{($5)+($11)+2*(($2)-($8))}' l. { s x + } ++*.. '$3,$6,{3*(($9)-($3))-2*($6)-($12)},{($6)+($12)+2*(($3)-($9))}' l. { s x + } +*... '$1,$4,{3*(($7)-($1))-2*($4)-($10)},{($4)+($10)+2*(($1)-($7))}' l... { s x + } +a[-3--1] x +1,{$13-1},1,1,2 (0,1;{$13-2},{$13-1}) r. 2,..,1,1,3 round. a[-2,-1] x +1,{3*($13-1)},1,1,200 1,{$13-1},1,1,1 +y[-3,-4,-6] a[-6--1] y +#@cli s3d : eq. to 'split3d'. +s3d : +_gmic_s="$?" v + _split3d +#@cli split3d +#@cli : Split selected 3D objects into feature vectors : +#@cli : { header, sizes, vertices, primitives, colors, opacities }. +#@cli : (eq. to 's3d').\n +#@cli : To recreate the 3D object, append all produced images along the y-axis (with command `append y`). +#@cli : $ box3d 100 +split3d +split3d : +_gmic_s="$?" v + _$0 +_split3d : +e[0--3] "Split 3D object$? into feature vectors." +check3d foreach { nm={n} ++z. 0,0,0,5 +z.. 0,6,0,7 nbv,nbp:=f2ui(crop()) +indp:=8+3*$nbv +if $nbv +z... 0,8,0,{$indp-1} else 0 fi +if $nbp +$nbp eval. ">begin(p = $indp); p+=i[#0,p] + 1; end(set('indc',p))" rm. ++z[0] 0,$indp,0,{$indc-1} +$nbp eval. ">begin(p = $indc); i[#0,p]==-128?(p+=prod(crop(#0,0,++p,1,3))); p+=3; end(set('indo',p))" rm. ++z[0] 0,$indc,0,{$indo-1} ++z[0] 0,$indo,0,100% +else +0 0 0 +fi +rm[0] +=> $nm,${nm}_c1,${nm}_c2,${nm}_c3,${nm}_c4,${nm}_c5 +} +#@cli sprite3d +#@cli : Convert selected images as 3D sprites. +#@cli : Selected images with alpha channels are managed. +#@cli : $ image.jpg sprite3d +sprite3d : +e[^-1] "Convert image$? as 3D sprites." +foreach { +nm={n} split_opacity +i[0] (67.5;73.5;109.5;103.5;51.5;100.5;1;1;0;0;0;1;0;-128;{w};{h};{0,s}) y[1] +if $!==2 (1) a y +else /. 255 i.. (-128;{w};{h};{s}) y. +fi +a y => $nm +} +#@cli sprites3d : [sprite],_sprite_has_alpha_channel={ 0 | 1 } +#@cli : Convert selected 3D objects as a sprite cloud. +#@cli : Set 'sprite_has_alpha_channel' to 1 to make the last channel of the selected sprite be a transparency mask. +#@cli : Default value: 'mask_has_alpha_channel=0'. +#@cli : $ torus3d 100,20 image.jpg resize2dy[-1] 64 100%,100% gaussian[-1] 30%,30% *[-1] 255 append[-2,-1] c +sprites3d[0] [1],1 display_rgba[-2] +sprites3d : check ${is_image_arg\ $1} skip ${2=0} +e[^-1] "Convert image$? as 3D sprites clouds, using sprite $1 ("${"arg {1+!$2},with,without"}" alpha-channel)." +repeat $! { +if !{$>,i(0,7)} continue fi +pass$1 0 +if !w empty3d rv[$>,-1] =>[$>] {n} rm. continue fi +l[$>,-1] { +s3d[0] N={1,@0} =[1] $N,0,1 +rm[3-5] i[3] (1,0;1,{$N-1}) r[3] 2,$N,1,1,3 round[3] +if $2 +if s==1 +i.. 3,$N,1,1,200 /. 255 +i.. (-128;{w};{h};1) +if $N>1 1,{4*($N-1)},1,1,-128,0,0,0 fi +else +s. c,-{s-1} /. 255 +i... (-128;{w};{h};{-2,s}) +if $N>1 i.. 1,{4*($N-1)},1,1,-128,0,0,0 fi +i.. (-128;{w};{h};1) +if $N>1 1,{4*($N-1)},1,1,-128,0,0,0 fi +fi +else +i.. (-128;{w};{h};{s}) y[-3,-1] +if $N>1 1,{4*($N-1)},1,1,-128,0,0,0 fi +1,$N,1,1,1 +fi +y a y +} +} +#@cli star3d : _nb_branches>0,0<=_thickness<=1 +#@cli : Input 3D star at position `(0,0,0)`, with specified geometry. +#@cli : Default values: 'nb_branches=5' and 'thickness=0.38'. +#@cli : $ star3d , +primitives3d 1 color3d[-2] ${-rgb} ++star3d : check "${1=5}>0 && ${2=0.38}>=0 && $2<=1" +e[^-1] "Input 3D star, with $1 branches and thickness $2." +N={2*$1} ('CImg3d') +. 0.5 ({$N+1};$N) +({-pi/2};{3*pi/2}) r. 1,{$N+1},1,1,3 rows. 0,{h-2} +sin. cos.. a[-2,-1] x +(1,1;$2,$2) *[-2,-1] z. 0,2 r. 3,{h+1},1,1,0 +(3,$N,1,0;3,$N,$N,{$N-1}) r. 4,$N,1,1,3 round. =. 0,2,100% +3,$N,1,1,200 1,$N,1,1,1 y[-6,-4--2] a[-6--1] y => [3D\ star] +#@cli streamline3d : x[%],y[%],z[%],_L>=0,_dl>0,_interpolation,_is_backward={ 0 | 1 },_is_oriented={ 0 | 1 } : 'formula',x,y,z,_L>=0,_dl>0,_interpolation,_is_backward={ 0 | 1 },_is_oriented={ 0 | 1 } : (+) +#@cli : Extract 3D streamlines from selected vector fields or from specified formula. +#@cli : 'interpolation' can be { 0=nearest integer | 1=1st-order | 2=2nd-order | 3=4th-order }. +#@cli : Default values: 'dl=0.1', 'interpolation=2', 'is_backward=0' and 'is_oriented=0'. +#@cli : $ 100,100,100,3 rand -10,10 blur 3 repeat 300 { +streamline3d[0] {u(100)},{u(100)},{u(100)},1000,1,1 color3d[-1] ${-rgb} } remove[0] box3d 100 primitives3d[-1] 1 add3d +#@cli -3d : eq. to 'sub3d'. : (+) +#@cli sub3d : tx,_ty,_tz : (+) +#@cli : Shift selected 3D objects with the opposite of specified displacement vector. +#@cli : (eq. to '3d'). +#@cli : Default values: 'ty=tz=0'. +#@cli : $ sphere3d 10 repeat 5 { +sub3d[-1] 10,{u(-10,10)},0 color3d[-1] ${-rgb} } add3d +#@cli subdivide3d +#@cli : Subdivide primitives of selected 3D objects. +subdivide3d : +e[^-1] "Subdivide primitives of selected 3D objects." +foreach { +s3d nbv,nbp={1,f2ui(crop())} +r[2] 3,{2,h/3},1,1,-1 permute[2] zycx +foreach[2--1] { ({h}) a y } +$nbp eval. ">begin(pp = pc = po = M = N = 0); +n = i[#3,pp++]; # Type of primitive +R = i[#4,pc++]; +R==-128?( +wc = f2ui(i[#4,pc++]); hc = i[#4,pc++]; sc = i[#4,pc++]; whsc = wc*hc*sc; ind_texture = whsc?wc:M; pc+=whsc; +R = G = B = 200; +):(G = i[#4,pc++]; B = i[#4,pc++]); +O = i[#5,po++]; +O==-128?( +wo = f2ui(i[#5,po++]); ho = i[#5,po++]; so = i[#5,po++]; whso = wo*ho*so; po+=whso; +O = 1; +); +n==2 || n==6?( +opp = pp; i0 = f2ui(i[#3,pp++]); i1 = f2ui(i[#3,pp++]); +P0 = I[#2,i0]; P1 = I[#2,i1]; +P01 = (P0 + P1)/2; +i01 = da_size(#2); da_push(#2,P01); +i0 = ui2f(i0); i1 = ui2f(i1); i01 = ui2f(i01); +n==2?( +copy(i[#3,opp],[ i0,i01 ]); +da_push(#3,2,i01,i1); +da_push(#4,R,G,B); +):( +tx0 = i[#3,pp++]; ty0 = i[#3,pp++]; tx1 = i[#3,pp++]; ty1 = i[#3,pp++]; +tx01 = round((tx0 + tx1)/2); ty01 = round((ty0 + ty1)/2); +copy(i[#3,opp],[ i0,i01,tx0,ty0,tx01,ty01 ]); +da_push(#3,6,i01,i1,tx01,ty01,tx1,ty1); +whsc?(ui2fM = ui2f(M); da_push(#4,-128,ui2fM,0,0)): +(ui2fwc = ui2f(wc); da_push(#4,-128,ui2fwc,0,0)); +); +da_push(#5,O); +N+=2): +n==3 || n==9?( +opp = pp; i0 = f2ui(i[#3,pp++]); i1 = f2ui(i[#3,pp++]); i2 = f2ui(i[#3,pp++]); +P0 = I[#2,i0]; P1 = I[#2,i1]; P2 = I[#2,i2]; +P01 = (P0 + P1)/2; P12 = (P1 + P2)/2; P20 = (P2 + P0)/2; +i01 = da_size(#2); i12 = i01 + 1; i20 = i12 + 1; da_push(#2,P01,P12,P20); +i0 = ui2f(i0); i1 = ui2f(i1); i2 = ui2f(i2); i01 = ui2f(i01); i12 = ui2f(i12); i20 = ui2f(i20); +n==3?( +copy(i[#3,opp],[ i01,i12,i20 ]); +da_push(#3,3,i0,i01,i20, +3,i01,i1,i12, +3,i20,i12,i2); +da_push(#4,R,G,B, R,G,B, R,G,B); +):( +tx0 = i[#3,pp++]; ty0 = i[#3,pp++]; tx1 = i[#3,pp++]; ty1 = i[#3,pp++]; tx2 = i[#3,pp++]; ty2 = i[#3,pp++]; +tx01 = round((tx0 + tx1)/2); ty01 = round((ty0 + ty1)/2); +tx12 = round((tx1 + tx2)/2); ty12 = round((ty1 + ty2)/2); +tx20 = round((tx2 + tx0)/2); ty20 = round((ty2 + ty0)/2); +copy(i[#3,opp],[ i01,i12,i20,tx01,ty01,tx12,ty12,tx20,ty20 ]); +da_push(#3,9,i0,i01,i20,tx0,ty0,tx01,ty01,tx20,ty20, +9,i01,i1,i12,tx01,ty01,tx1,ty1,tx12,ty12, +9,i20,i12,i2,tx20,ty20,tx12,ty12,tx2,ty2); +whsc?(ui2fM = ui2f(M); da_push(#4,-128,ui2fM,0,0, -128,ui2fM,0,0, -128,ui2fM,0,0)): +(ui2fwc = ui2f(wc); da_push(#4,-128,ui2fwc,0,0, -128,ui2fwc,0,0, -128,ui2fwc,0,0)); +); +da_push(#5,O,O,O); +N+=4): +n==4 || n==12?( +opp = pp; i0 = f2ui(i[#3,pp++]); i1 = f2ui(i[#3,pp++]); i2 = f2ui(i[#3,pp++]); i3 = f2ui(i[#3,pp++]); +P0 = I[#2,i0]; P1 = I[#2,i1]; P2 = I[#2,i2]; P3 = I[#2,i3]; +P01 = (P0 + P1)/2; P12 = (P1 + P2)/2; P23 = (P2 + P3)/2; P30 = (P3 + P0)/2; Pc = (P0 + P1 + P2 + P3)/4; +i01 = da_size(#2); i12 = i01 + 1; i23 = i12 + 1; i30 = i23 + 1; ic = i30 + 1; da_push(#2,P01,P12,P23,P30,Pc); +i0 = ui2f(i0); i1 = ui2f(i1); i2 = ui2f(i2); i3 = ui2f(i3); +i01 = ui2f(i01); i12 = ui2f(i12); i23 = ui2f(i23); i30 = ui2f(i30); ic = ui2f(ic); +n==4?( +copy(i[#3,opp],[ i0,i01,ic,i30 ]); +da_push(#3,4,i01,i1,i12,ic, +4,ic,i12,i2,i23, +4,i30,ic,i23,i3); +da_push(#4,R,G,B, R,G,B, R,G,B); +):( +tx0 = i[#3,pp++]; ty0 = i[#3,pp++]; tx1 = i[#3,pp++]; ty1 = i[#3,pp++]; +tx2 = i[#3,pp++]; ty2 = i[#3,pp++]; tx3 = i[#3,pp++]; ty3 = i[#3,pp++]; +tx01 = round((tx0 + tx1)/2); ty01 = round((ty0 + ty1)/2); +tx12 = round((tx1 + tx2)/2); ty12 = round((ty1 + ty2)/2); +tx23 = round((tx2 + tx3)/2); ty23 = round((ty2 + ty3)/2); +tx30 = round((tx3 + tx0)/2); ty30 = round((ty3 + ty0)/2); +txc = (tx0 + tx1 + tx2 + tx3)/4; tyc = (ty0 + ty1 + ty2 + ty3)/4; +copy(i[#3,opp],[ i0,i01,ic,i30,tx0,ty0,tx01,ty01,txc,tyc,tx30,ty30 ]); +da_push(#3,12,i01,i1,i12,ic,tx01,ty01,tx1,ty1,tx12,ty12,txc,tyc, +12,ic,i12,i2,i23,txc,tyc,tx12,ty12,tx2,ty2,tx23,ty23, +12,i30,ic,i23,i3,tx30,ty30,txc,tyc,tx23,ty23,tx3,ty3); +whsc?(ui2fM = ui2f(M); da_push(#4,-128,ui2fM,0,0, -128,ui2fM,0,0, -128,ui2fM,0,0)): +(ui2fwc = ui2f(wc); da_push(#4,-128,ui2fwc,0,0, -128,ui2fwc,0,0, -128,ui2fwc,0,0)); +); +da_push(#5,O,O,O); +N+=4): +(pp+=n; ++N); +++M; +end(i[#1,0] = ui2f(da_size(#2)); i[#1,1] = ui2f(N))" rm. +da_freeze[2--1] nbv={2,h} permute[2] cyzx y[2] a y +} +#@cli superformula3d : resolution>1,m>=1,n1,n2,n3 +#@cli : Input 2D superformula curve as a 3D object. +#@cli : Default values: 'resolution=1024', 'm=8', 'n1=1', 'n2=5' and 'n3=8'. +#@cli : $ superformula3d , ++superformula3d : check "${1=1024}>1 && ${2=8}>=1" skip ${3=1},${4=5},${5=8} +e[^-1] "Input 2D superformula curve, with resolution $1, m=$2 and (n1,n2,n3)=($3,$4,$5)." +res={round($1)} +(67.5;73.5;109.5;103.5;51.5;100.5;$res;{$res-1}) +(0,{2*pi}) r. $res,1,1,1,3 . +*. {$2/4} +sin. cos.. abs[-2,-1] +^.. $4 ^. $5 +[-2,-1] ^. {-1/$3} ++sin.. cos... *. .. *[-3,-2] n[-2,-1] -1,1 +a[-2,-1] y rows. 0,2 transpose. r. 1,{w*h},1,1,-1 +1,{$res-1},1,1,2 (0;{$res-2}) r. 1,{$res-1},1,1,3 ++. 1 a[-3--1] x round. 1 r. 1,{w*h},1,1,-1 +1,{3*($res-1)},1,1,200 1,{$res-1},1,1,1 a[-5--1] y => [3D\ superformula] +#@cli surfels3d : 0<=_left_right_attenuation<=1,0<=_top_bottom_attenuation<=1,0<=_closer_further_attenuation<=1 +#@cli : Convert selected images to 3D objects composed of 3D surfels (or 2D edgels for 2D images). +#@cli : The binary shape is composed of all non-zero voxels. +#@cli : The resulting 3D object is colored according to the color of non zero voxels. +#@cli : Default values: 'left_right_attenuation=1', 'top_bottom_attenuation=1' and 'closer_further_attenuation=1'. +#@cli : $ 100,100,100 = 1,40%,40%,40% = 1,60%,60%,60% distance 1 lt 30% blur 3 gt 50% surfels3d 0.5,0.75,1 +surfels3d : check "${1=1}>0 && ${2=1}>0 && ${3=1}>0" +e[^-1] "Generate 3D surfel object from binary shape$? with color attenuations (${1-3})." +foreach { +nm={n} +if d==1 +{[w,h]+1},1,1,-1 1,1,1,2x2 1,1,1,{0,s} => ind,pts,prims,cols +eval[0] ">val = I; norm(val)?( +const ind = $ind; const pts = $pts; const prims = $prims; const cols = $cols; +nx = x + 1; ny = y + 1; +!j(-1)?( +i0 = i(#ind,x,y); i0<0?(i0 = i(#ind,x,y) = da_size(#pts); da_push(#pts,[x - 0.5, y - 0.5])); +i1 = i(#ind,x,ny); i1<0?(i1 = i(#ind,x,ny) = da_size(#pts); da_push(#pts,[x - 0.5, y + 0.5])); +da_push(#prims,[i1,i0]); +da_push(#cols,val*$1); +); +!j(1)?( +i0 = i(#ind,nx,y); i0<0?(i0 = i(#ind,nx,y) = da_size(#pts); da_push(#pts,[x + 0.5, y - 0.5])); +i1 = i(#ind,nx,ny); i1<0?(i1 = i(#ind,nx,ny) = da_size(#pts); da_push(#pts,[x + 0.5, y + 0.5])); +da_push(#prims,[i0,i1]); +da_push(#cols,val*$1); +); +!j(0,-1)?( +i0 = i(#ind,x,y); i0<0?(i0 = i(#ind,x,y) = da_size(#pts); da_push(#pts,[x - 0.5, y - 0.5])); +i1 = i(#ind,nx,y); i1<0?(i1 = i(#ind,nx,y) = da_size(#pts); da_push(#pts,[x + 0.5, y - 0.5])); +da_push(#prims,[i0,i1]); +da_push(#cols,val*$2); +); +!j(0,1)?( +i0 = i(#ind,x,ny); i0<0?(i0 = i(#ind,x,ny) = da_size(#pts); da_push(#pts,[x - 0.5, y + 0.5])); +i1 = i(#ind,nx,ny); i1<0?(i1 = i(#ind,nx,ny) = da_size(#pts); da_push(#pts,[x + 0.5, y + 0.5])); +da_push(#prims,[i1,i0]); +da_push(#cols,val*$2); +); +); I; +end( +resize(#pts,1,da_size(#pts),1,s#pts,0); +resize(#prims,1,da_size(#prims),1,s#prims,0); +resize(#cols,1,da_size(#cols),1,s#cols,0); +)" +if !w rm +else +c[cols] 0,255 to_rgb[cols] +k[pts,prims,cols] permute cyzx i[1] 1,{0,h},1,1,0 a[0,1] x i[1] 1,{1,h},1,1,2 a[1,2] x =>.. prims +fi +else +{[w,h,d]+1},1,-1 1,1,1,3 1,1,1,4 1,1,1,{0,s} => ind,pts,prims,cols +eval[0] ">val = I; norm(val)?( +const ind = $ind; const pts = $pts; const prims = $prims; const cols = $cols; +nx = x + 1; ny = y + 1; nz = z + 1; +!j(-1)?( +i0 = i(#ind,x,y,z); i0<0?(i0 = i(#ind,x,y,z) = da_size(#pts); da_push(#pts,[x-0.5, y-0.5, z-0.5])); +i1 = i(#ind,x,ny,z); i1<0?(i1 = i(#ind,x,ny,z) = da_size(#pts); da_push(#pts,[x-0.5, y+0.5, z-0.5])); +i2 = i(#ind,x,ny,nz); i2<0?(i2 = i(#ind,x,ny,nz) = da_size(#pts); da_push(#pts,[x-0.5, y+0.5, z+0.5])); +i3 = i(#ind,x,y,nz); i3<0?(i3 = i(#ind,x,y,nz) = da_size(#pts); da_push(#pts,[x-0.5, y-0.5, z+0.5])); +da_push(#prims,[i0,i3,i2,i1]); +da_push(#cols,val*$1); +); +!j(1)?( +i0 = i(#ind,nx,y,z); i0<0?(i0 = i(#ind,nx,y,z) = da_size(#pts); da_push(#pts,[x+0.5, y-0.5, z-0.5])); +i1 = i(#ind,nx,ny,z); i1<0?(i1 = i(#ind,nx,ny,z) = da_size(#pts); da_push(#pts,[x+0.5, y+0.5, z-0.5])); +i2 = i(#ind,nx,ny,nz); i2<0?(i2 = i(#ind,nx,ny,nz) = da_size(#pts); da_push(#pts,[x+0.5, y+0.5, z+0.5])); +i3 = i(#ind,nx,y,nz); i3<0?(i3 = i(#ind,nx,y,nz) = da_size(#pts); da_push(#pts,[x+0.5, y-0.5, z+0.5])); +da_push(#prims,[i0,i1,i2,i3]); +da_push(#cols,val*$1); +); +!j(0,-1)?( +i0 = i(#ind,x,y,z); i0<0?(i0 = i(#ind,x,y,z) = da_size(#pts); da_push(#pts,[x-0.5, y-0.5, z-0.5])); +i1 = i(#ind,nx,y,z); i1<0?(i1 = i(#ind,nx,y,z) = da_size(#pts); da_push(#pts,[x+0.5, y-0.5, z-0.5])); +i2 = i(#ind,nx,y,nz); i2<0?(i2 = i(#ind,nx,y,nz) = da_size(#pts); da_push(#pts,[x+0.5, y-0.5, z+0.5])); +i3 = i(#ind,x,y,nz); i3<0?(i3 = i(#ind,x,y,nz) = da_size(#pts); da_push(#pts,[x-0.5, y-0.5, z+0.5])); +da_push(#prims,[i0,i1,i2,i3]); +da_push(#cols,val*$2); +); +!j(0,1)?( +i0 = i(#ind,x,ny,z); i0<0?(i0 = i(#ind,x,ny,z) = da_size(#pts); da_push(#pts,[x-0.5, y+0.5, z-0.5])); +i1 = i(#ind,nx,ny,z); i1<0?(i1 = i(#ind,nx,ny,z) = da_size(#pts); da_push(#pts,[x+0.5, y+0.5, z-0.5])); +i2 = i(#ind,nx,ny,nz); i2<0?(i2 = i(#ind,nx,ny,nz) = da_size(#pts); da_push(#pts,[x+0.5, y+0.5, z+0.5])); +i3 = i(#ind,x,ny,nz); i3<0?(i3 = i(#ind,x,ny,nz) = da_size(#pts); da_push(#pts,[x-0.5, y+0.5, z+0.5])); +da_push(#prims,[i0,i3,i2,i1]); +da_push(#cols,val*$2); +); +!j(0,0,-1)?( +i0 = i(#ind,x,y,z); i0<0?(i0 = i(#ind,x,y,z) = da_size(#pts); da_push(#pts,[x-0.5, y-0.5, z-0.5])); +i1 = i(#ind,nx,y,z); i1<0?(i1 = i(#ind,nx,y,z) = da_size(#pts); da_push(#pts,[x+0.5, y-0.5, z-0.5])); +i2 = i(#ind,nx,ny,z); i2<0?(i2 = i(#ind,nx,ny,z) = da_size(#pts); da_push(#pts,[x+0.5, y+0.5, z-0.5])); +i3 = i(#ind,x,ny,z); i3<0?(i3 = i(#ind,x,ny,z) = da_size(#pts); da_push(#pts,[x-0.5, y+0.5, z-0.5])); +da_push(#prims,[i0,i3,i2,i1]); +da_push(#cols,val*$3); +); +!j(0,0,1)?( +i0 = i(#ind,x,y,nz); i0<0?(i0 = i(#ind,x,y,nz) = da_size(#pts); da_push(#pts,[x-0.5, y-0.5, z+0.5])); +i1 = i(#ind,nx,y,nz); i1<0?(i1 = i(#ind,nx,y,nz) = da_size(#pts); da_push(#pts,[x+0.5, y-0.5, z+0.5])); +i2 = i(#ind,nx,ny,nz); i2<0?(i2 = i(#ind,nx,ny,nz) = da_size(#pts); da_push(#pts,[x+0.5, y+0.5, z+0.5])); +i3 = i(#ind,x,ny,nz); i3<0?(i3 = i(#ind,x,ny,nz) = da_size(#pts); da_push(#pts,[x-0.5, y+0.5, z+0.5])); +da_push(#prims,[i0,i1,i2,i3]); +da_push(#cols,val*$3); +); +); I; +end( +resize(#pts,1,da_size(#pts),1,s#pts,0); +resize(#prims,1,da_size(#prims),1,s#prims,0); +resize(#cols,1,da_size(#cols),1,s#cols,0); +)" +if !w rm +else +c[cols] 0,255 to_rgb[cols] +k[pts,prims,cols] permute cyzx i[1] 1,{1,h},1,1,4 a[1,2] x =>.. prims +fi +fi +if !$! empty3d else i[0] ({'CImg3d'},{pts,h},{prims,h}:y) 1,100%,1,1,1 y a y fi +=> $nm +} +#@cli tensors3d : _radius_factor>=0,_shape={ 0=box | >=N=ellipsoid },_radius_min>=0 +#@cli : Generate 3D tensor fields from selected images. +#@cli : when 'shape'>0, it gives the ellipsoid shape precision. +#@cli : Default values: 'radius_factor=1', 'shape=2' and 'radius_min=0.05'. +#@cli : $ 6,6,6,9,"U = [x,y,z] - [w,h,d]/2; U/=norm(U); mul(U,U,3) + 0.3*eye(3)" tensors3d 0.8 +tensors3d : check "${1=1}>=0 && isint(${2=2}) && $2>=0 && ${3=0.05}>=0" +e[^-1] "Generate 3D tensor field(s) from image$?, with radius factor $1, "${"if $2 u ellipsoid else u box fi"}" shape and radius min $3." +foreach { +if s==1 100%,100%,100%,6,"[i#0,0,0,i#0,0,i#0]" k. +elif s==3 100%,100%,100%,6,"[R#0,G#0,0,B#0,0,0]" k. +elif s==4 100%,100%,100%,6,"[R#0,G#0,0,A#0,0,0]" k. +elif s==9 100%,100%,100%,6,"I=I#0;[I[0],I[1],I[2],I[4],I[5],I[8]]" k. +fi +if s!=6 error[0--4] "Command '$0': Image '"{n}"' has an invalid size (spectrum="{s}")." fi +100%,100%,100%,12," +T = I(#0); +M = [ T[0], T[1], T[2], T[1], T[3], T[4], T[2], T[4], T[5] ]; +eig = eig(M); +if (det(eig[3,9])<0, eig[3]*=-1; eig[4]*=-1; eig[5]*=-1); +eig[0] = max(0,eig[0]); +eig[1] = max(0,eig[1]); +eig[2] = max(0,eig[2]); +eig" +k. +if $2 sphere3d 1,{$2-1} else box3d 1 fi +N,P={[i[6],i[7]]} siz={h} n3d. c3d. .x{0,whd-1} +f[0] " +const N = "$N"; +const P = "$P"; +const siz = "$siz"; +eig = I; +const d = size(eig); +ind = 1 + x + w*y + wh*z; +L = eig[0,3]; +if (max(L)==0, +i[#ind,6] = i[#ind,7] = 0; +resize(#ind,1,8,1,1,0); +_(else), +L*=$1; +L[0] = max($3,L[0]); +L[1] = max($3,L[1]); +L[2] = max($3,L[2]); +R = eig[3,9]; +anisotropy = sqrt(((L[0] - L[1])^2 + (L[1] - L[2])^2 + (L[2] - L[0])^2)/(2*(L[0]^2 + L[1]^2 + L[2]^2))); +ref(crop(#ind,0,8,0,0,1,3*N,1,1),pts); +pts *= resize(L,size(pts),0,2); +pts = mul(pts,R,3); +pts += resize([x,y,z],size(pts),0,2); +draw(#ind,pts,0,8,0,0,1,size(pts),1,1); +col0 = cut(255*anisotropy*abs([ R[0],R[1],R[2] ]) + (1 - anisotropy)*200,0,255); +col = resize(col0,3*P,0,2); +const off = siz - 4*P; +draw(#ind,col,0,off,0,0,1,size(col),1,1); +0); I" +rm[0] +3d +} +#@cli text_pointcloud3d : _"text1",_"text2",_smoothness +#@cli : Input 3D text pointcloud from the two specified strings. +#@cli : Default values: 'text1="text1"', 'text2="text2"' and 'smoothness=1'. +#@cli : $ text_pointcloud3d "G'MIC","Rocks!" ++text_pointcloud3d : skip "${1=text1}","${2=text2}",${3=1} +e[^-1] "Input 3D pointcloud text object from strings '$1' and '$2', with smoothness $3." +0 t. "$1",0,0,53,1,1 +0 t. "$2",0,0,53,1,1 mirror. y +autocrop[-2,-1] 0 +expand_xy[-2,-1] 2,0 dilate[-2,-1] 2 +permute. zyxc r[-2,-1] ${-max_whd} &[-2,-1] +100%,100% rand. 0,{{-2,d}-1} round. ri. .. f. 'if(z==i,1,0)' +distance. 1 +. 1 +f. 1 rv[-2,-1] /[-2,-1] *. .. ++dilate. 0,0,{d} ==[-2,-1] *. .. +1,100%,100% rand. 0,{{-2,w}-1} round. ri. .. f. 'if(x==i,1,0)' +distance. 1 +. 1 +f. 1 rv[-2,-1] /[-2,-1] *. ... ++dilate. 0,0,{d} ==[-2,-1] *[-3,-1] +-|[-2,-1] +b. $3 isosurface3d. 25% +c3d. n3d. => "[3D text pointcloud]" +#@cli text3d : text,_font_height>0,_depth>0,_smoothness +#@cli : Input a 3D text object from specified text. +#@cli : Default values: 'font_height=53', 'depth=10' and 'smoothness=1.5'. +#@cli : $ text3d "G'MIC as a\n3D logo!" ++text3d : skip ${2=53},${3=10},${4=1.5} +e[^-1] "Input 3D text object '$1' with size $2, depth $3 and smoothness $4." +0 t. "$1",0,0,$2,1,1 autocrop. 0 r. 100%,100%,$3 expand_xyz. 10,0 +b. $4 isosurface3d. 40% rv3d. => "[3D text '$1']" +#@cli t3d : eq. to 'texturize3d'. +t3d : check ${"is_image_arg $1"}" && (!narg(${2=}) || "${"is_image_arg $2"}")" +e[^-1] "Texturize 3D object$? with texture $1"${"if narg($2) u \" and texture coordinates $2\" else u \"\" fi"}"." +pass$1 0 slices. 0 if s==1 to_rgb. else channels. 0,2 fi +if narg($2) pass$2 else 0 fi +v + _texturize3d +#@cli texturize3d : [ind_texture],_[ind_coords] +#@cli : Texturize selected 3D objects with specified texture and coordinates. +#@cli : (eq. to 't3d').\n +#@cli : When '[ind_coords]' is omitted, default XY texture projection is performed. +#@cli : Default value: 'ind_coords=(undefined)'. +#@cli : $ image.jpg torus3d 100,30 texturize3d[-1] [-2] keep[-1] +texturize3d : check ${"is_image_arg $1"}" && (!narg(${2=}) || "${"is_image_arg $2"}")" +e[^-1] "Texturize 3D object$? with texture $1"${"if narg($2) u \" and texture coordinates $2\" else u \"\" fi"}"." +pass$1 0 slices. 0 if s==1 to_rgb. else channels. 0,2 fi +if narg($2) pass$2 else 0 fi +v + _$0 +_texturize3d : +repeat $!-2 { l[$>,-2,-1] { +np={f2ui(i[7])} +s3d[0] +if !w ++r[2] 3,{2,round(h/3)},1,1,-1 s. x,3 rm. +n.. 0,{6,w-1} n. 0,{6,h-1} a[-2,-1] x +mv. -2 +fi +1,{5,2*h} +1,{5,3*h} +1,{5,h},1,1,1 +eval " +add_material() = ( +ind_tex>=0?( +copy(i[#-2,qc],[ -128,ind_tex,0,0 ],4); qc+=4 +):( +qc + whds#6 + 4>=h(#-2)?resize(#-2,1,int(1.5*qc + whds#6 + 4),1,1,0,0); +copy(i[#-2,qc],[ -128,w#6,h#6,s#6 ],4); qc+=4; +copy(i[#-2,qc],i(#6),whds#6); qc+=whds#6; +ind_tex = np; +); +); +ind_tex = -1; +for (pp = pc = qp = qc = np = 0, pp=h(#-3)?resize(#-3,1,int(1.5*qp + 13),1,1,0,0); +qc + 3>=h(#-2)?resize(#-2,1,int(1.5*qc + 3),1,1,0,0); +N = i[#3,pp++]; +N==1?( +v0 = f2ui(i[#3,pp++]); tx0 = i(#7,0,v0); ty0 = i(#7,1,v0); +R = i(#6,tx0,ty0,0,0); G = i(#6,tx0,ty0,0,1); B = i(#6,tx0,ty0,0,2); +copy(i[#-3,qp],[ 1,ui2f(v0) ],2); qp+=2; +copy(i[#-2,qc],[ R,G,B ],3); qc+=3; +):(N==2 || N==6)?( +v0 = f2ui(i[#3,pp++]); tx0 = i(#7,0,v0); ty0 = i(#7,1,v0); +v1 = f2ui(i[#3,pp++]); tx1 = i(#7,0,v1); ty1 = i(#7,1,v1); +N==6?(pp+=4); +copy(i[#-3,qp],[ 6,ui2f(v0),ui2f(v1),tx0,ty0,tx1,ty1 ],7); qp+=7; +add_material(); +):(N==3 || N==9)?( +v0 = f2ui(i[#3,pp++]); tx0 = i(#7,0,v0); ty0 = i(#7,1,v0); +v1 = f2ui(i[#3,pp++]); tx1 = i(#7,0,v1); ty1 = i(#7,1,v1); +v2 = f2ui(i[#3,pp++]); tx2 = i(#7,0,v2); ty2 = i(#7,1,v2); +N==9?(pp+=6); +copy(i[#-3,qp],[ 9,ui2f(v0),ui2f(v1),ui2f(v2),tx0,ty0,tx1,ty1,tx2,ty2 ],10); qp+=10; +add_material(); +):(N==4 || N==12)?( +v0 = f2ui(i[#3,pp++]); tx0 = i(#7,0,v0); ty0 = i(#7,1,v0); +v1 = f2ui(i[#3,pp++]); tx1 = i(#7,0,v1); ty1 = i(#7,1,v1); +v2 = f2ui(i[#3,pp++]); tx2 = i(#7,0,v2); ty2 = i(#7,1,v2); +v3 = f2ui(i[#3,pp++]); tx3 = i(#7,0,v3); ty3 = i(#7,1,v3); +N==12?(pp+=8); +copy(i[#-3,qp],[ 12,ui2f(v0),ui2f(v1),ui2f(v2),ui2f(v3),tx0,ty0,tx1,ty1,tx2,ty2,tx3,ty3 ],13); qp+=13; +add_material(); +):N==5?( +v0 = f2ui(i[#3,pp++]); tx0 = i(#7,0,v0); ty0 = i(#7,1,v0); +v1 = f2ui(i[#3,pp++]); tx1 = i(#7,0,v1); ty1 = i(#7,1,v1); +v2 = f2ui(i[#3,pp++]); pp+=2; +(tx0+=tx1)/=2; (ty0+=ty1)/=2; +R = i(#6,tx0,ty0,0,0); G = i(#6,tx0,ty0,0,1); B = i(#6,tx0,ty0,0,2); +copy(i[#-3,qp],[ 5,ui2f(v0),ui2f(v1),ui2f(v2),0,0 ],6); qp+=6; +copy(i[#-2,qc],[ R,G,B ],3); qc+=3; +); +); +resize(#-3,1,qp,1,1,0,0); +resize(#-2,1,qc,1,1,0,0)" +rm[3-5] mv[-3--1] 3 +if !w rm.. fi +a[0-5] y +} } +rm[-2,-1] +#@cli torus3d : _radius1,_radius2,_nb_subdivisions1>2,_nb_subdivisions2>2 +#@cli : Input 3D torus at (0,0,0), with specified geometry. +#@cli : Default values: 'radius1=1', 'radius2=0.3', 'nb_subdivisions1=24' and 'nb_subdivisions2=12'. +#@cli : $ torus3d 10,3 +primitives3d 1 color3d[-2] ${-rgb} ++torus3d : check "${1=1} && ${2=0.3} && ${3=24}>2 && ${4=12}>2" +e[^-1] "Input 3D torus, with radii ($1,$2) and subdivisions ($3,$4)." +nbp={$3*$4} +1,8,1,1,67.5,73.5,109.5,103.5,51.5,100.5,$nbp,{$4*$3} +(0;{2*pi}) +y. x +r.. 1,{$3+1},1,1,3 z.. 0,0,0,{$3-1} +r. {$4+1},1,1,1,3 z. 0,{$4-1} ++sin[-2,-1] cos[-4,-3] r[-4--1] $4,$3 +*... $2 +... $1 *. $2 *[-4] ... *[-3,-2] +y[-3--1] a[-3--1] x +1,$3,1,1,'y' *. $4 +shift. 0,-1 $4,1,1,1,'x' +shift. -1 r[-4--1] $4,$3 +++[-4,-1] +.. [-4] +[-5] ... +[-4,-3] y[-4--1] i[-5] 1,{h},1,1,4 a[-5--1] x +3,{h},1,1,200 1,{h},1,1,1 y[-4--2] a[-5--1] y +=> [3D\ torus] +#@cli triangle3d : x0,y0,z0,x1,y1,z1,x2,y2,z2 +#@cli : Input 3D triangle at specified coordinates. +#@cli : $ repeat 100 { a={$>*pi/50} triangle3d 0,0,0,0,0,3,{cos(3*$a)},{sin(2*$a)},0 color3d[-1] ${-rgb} } add3d ++triangle3d : +e[^-1] "Input 3D triangle ($1,$2,$3)-($4,$5,$6)-($7,$8,$9)." +1,25,1,1,67.5,73.5,109.5,103.5,51.5,100.5,3,1,${1-9},3,0,1,2,200,200,200,1 => [3D\ triangle] +#@cli volume3d +#@cli : Transform selected 3D volumetric images as 3D parallelepipedic objects. +#@cli : $ image.jpg animate blur,0,5,30 append z volume3d +volume3d : +e[^-1] "Transform image$? as 3D parallelepipedic objects." +foreach { +w={w} h={h} d={d} ++slices[0] 0 ++columns[0] 0 permute. zyxc mirror. x ++slices[0] 100% mirror. x ++columns[0] 100% permute. zyxc ++rows[0] 100% permute. xzyc ++rows[0] 0 permute. xzyc mirror. y +rm[0] image6cube3d *3d $w,$h,$d +} +#@cli voxelize3d : _max_resolution>0,_fill_interior={ 0 | 1 },_preserve_colors={ 0 | 1 } +#@cli : Convert selected 3D objects as 3D volumetric images of binary voxels, using 3D mesh rasterization. +#@cli : Default values: 'max_resolution=128', 'fill_interior=1' and 'preserve_colors=0'. +voxelize3d : check "${1=128}>0 && isbool(${2=1}) && isbool(${3=0})" check3d +s0,s1,t0,t1="",", interior filling","scalar","color" +e[^-1] "Voxelize 3D object$?, with max resolution $1"$s$2" and "$t$3" output." +foreach { +nm={n} p3d 2 ++boundingbox3d l. { s3d store[2] bbpts rm } +s3d nbp={1,@1} k[2,3,4] => pts,prims,cols +l[pts] { +$bbpts a y +r 3,{h/3},1,1,-1 s x +w,h,d:="const dx = iM#0 - im#0; +const dy = iM#1 - im#1; +const dz = iM#2 - im#2; +M = max(dx,dy,dz); +S = round([ dx, dy, dz ]*$1/M); +[ max(S[0],1), max(S[1],1), max(S[2],1) ]" +n[0] 0,{$w-1} n[1] 0,{$h-1} n[2] 0,{$d-1} +round a c +} +if $3 l[cols] { r 3,{h/3},1,1,-1 permute zycx +norm1 ==. 0 + } else rm[cols] fi +$w,$h,$d => out +$nbp eval. "> +begin( +p = 0; +label = 2; +P0 = P1 = P2 = P3 = vector3(); +rasterize_point(P) = ( +i(#$out,P#) = label; +); +rasterize_segment(P0,P1) = ( +l01 = max(1,abs(P1# - P0#)); +repeat (l01 + 1,l, +ln = l/l01; +Q = round(lerp(P0#,P1#,ln)); +i(#$out,Q) = label; +); +); +rasterize_triangle(P0,P1,P2) = ( +N = cross(P1# - P0#,P2# - P0#); # Normal vector +rasterize_segment(P0#,P1#); # Hack: Ensure correct jonction between adjacent triangles +rasterize_segment(P0#,P2#); +rasterize_segment(P1#,P2#); +norm(N)?( +S = -dot(N,P0#); # Affine shift +proj_plane = argmax(abs(N)); +proj_plane==0?( +Q0 = [ P0#[1],P0#[2] ]; Q1 = [ P1#[1],P1#[2] ]; Q2 = [ P2#[1],P2#[2] ]; +_rasterize_triangle(Q0,Q1,Q2,round((-N[1]*a - N[2]*b - S)/N[0]),a,b); +):proj_plane==1?( +Q0 = [ P0#[0],P0#[2] ]; Q1 = [ P1#[0],P1#[2] ]; Q2 = [ P2#[0],P2#[2] ]; +_rasterize_triangle(Q0,Q1,Q2,a,round((-N[0]*a - N[2]*b - S)/N[1]),b); +):( +Q0 = [ P0#[0],P0#[1] ]; Q1 = [ P1#[0],P1#[1] ]; Q2 = [ P2#[0],P2#[1] ]; +_rasterize_triangle(Q0,Q1,Q2,a,b,round((-N[0]*a - N[1]*b - S)/N[2])); +); +); +); +_rasterize_triangle(P0,P1,P2,projX,projY,projZ) = ( +P0#[1]>P1#[1]?swap(P0#,P1#); +P0#[1]>P2#[1]?swap(P0#,P2#); +P1#[1]>P2#[1]?swap(P1#,P2#); +db01 = P1#[1] - P0#[1]; m1db01 = max(1,db01); +db02 = P2#[1] - P0#[1]; m1db02 = max(1,db02); +db12 = P2#[1] - P1#[1]; m1db12 = max(1,db12); +repeat (db01,l, +b = P0#[1] + l; +a0 = round(lerp(P0#[0],P1#[0],l/m1db01)); +a1 = round(lerp(P0#[0],P2#[0],l/m1db02)); +a0>a1?swap(a0,a1); +for (a = a0, a<=a1, ++a, i(#$out,projX#,projY#,projZ#) = label); +); +repeat (db12 + 1,l, +b = P1#[1] + l; +a0 = round(lerp(P1#[0],P2#[0],l/m1db12)); +a1 = round(lerp(P0#[0],P2#[0],(db01 + l)/m1db02)); +a0>a1?swap(a0,a1); +for (a = a0, a<=a1, ++a, i(#$out,projX#,projY#,projZ#) = label); +); +); +rasterize_sphere(P0,P1) = ( +P = (P0# + P1#)/2; +R = norm(P1# - P0#)/2; +xm = floor(P[0] - R); xM = ceil(P[0] + R); +ym = floor(P[1] - R); yM = ceil(P[1] + R); +zm = floor(P[2] - R); zM = ceil(P[2] + R); +for (z = zm, z<=zM, ++z, +for (y = ym, y<=yM, ++y, +for (x = xm, x<=xM, ++x, +norm([x,y,z] - P)<=R?(i(#$out,x,y,z) = label); +); +); +); +); +); +n = i[#$prims,p++]; +P0 = I[#$pts,f2ui(i[#$prims,p++])]; +n>1?(P1 = I[#$pts,f2ui(i[#$prims,p++])]); +n>2?(P2 = I[#$pts,f2ui(i[#$prims,p++])]); +n>3?(P3 = I[#$pts,f2ui(i[#$prims,p++])]); +n>4?(p+=n - 4); +n==1?rasterize_point(P0): +n==2 || n==6?rasterize_segment(P0,P1): +n==3 || n==9?rasterize_triangle(P0,P1,P2): +n==4 || n==12?(rasterize_triangle(P0,P1,P2); rasterize_triangle(P0,P2,P3)): +n==5?rasterize_sphere(P0,P1); +$3?++label" rm. +if $2 expand_xyz[out] 1,0 flood[out] 0,0,0,0,0,1,-1 +<[out] 2 +[out,-1] shrink_xyz[out] 1 fi +if $3 r[cols] 1,{cols,h+2},1,100%,0,0,0,1 point[cols] 0,1,0,1,1 map[out] [cols] +else >[out] 0 +fi +k[out] => $nm +} +#@cli weird3d : _resolution>0 +#@cli : Input 3D weird object at (0,0,0), with specified resolution. +#@cli : Default value: 'resolution=32'. +#@cli : $ weird3d 48 +primitives3d 1 color3d[-2] ${-rgb} ++weird3d : skip ${1=32} +e[^-1] "Input 3D weird object, with resolution $1." +isosurface3d '" +T = 1.61803399; +2 - (cos(x + T*y) + cos(x - T*y) + cos(y + T*z) + cos(y - T*z) + cos(z - T*x) + cos(z + T*x))"',0,-4.7,-4.7,-4.7,4.7,4.7,4.7,$1,$1,$1 +c3d. n3d. => [3D\ weird] +#@cli :: Flow Control +#@cli ap : eq. to 'apply_parallel'. +ap : +_gmic_s="$?" v + _apply_parallel "$*" +#@cli apply_parallel : "command" +#@cli : Apply specified command on each of the selected images, by parallelizing it for all image of the list. +#@cli : (eq. to 'ap'). +#@cli : $ image.jpg +mirror x +mirror y apply_parallel "blur 3" +apply_parallel : +_gmic_s="$?" v + _$0 "$*" +_apply_parallel : +e[0--3] "Apply command '$*' on all image"$_gmic_s" in parallel, using "$_cpus" threads." +if $!" && "narg("$*") +m "_ap : foreach { $* if $! k[0] else 0 fi }" +N={min($!,$_cpus)} +commands= sep= repeat $N { commands=$commands${sep}_ap[$>--1:$N] sep=, } +parallel $commands +um _ap +fi +#@cli apc : eq. to 'apply_parallel_channels'. +apc : +_gmic_s="$?" v + _apply_parallel_channels "$*" +#@cli apply_parallel_channels : "command" +#@cli : Apply specified command on each of the selected images, by parallelizing it for all channel +#@cli : of the images independently. +#@cli : (eq. to 'apc'). +#@cli : $ image.jpg apply_parallel_channels "blur 3" +apply_parallel_channels : +_gmic_s="$?" v + _$0 "$*" +_apply_parallel_channels : +e[0--3] "Apply command '$*' on all channels of image"$_gmic_s" in parallel, using "$_cpus" threads." +N=$! repeat $N { s$>={$>,s} } s c +ap "$1" +repeat $N { a[$>-{$>+${s$>}-1}] c } +#@cli apo : eq. to 'apply_parallel_overlap'. +apo : check "${2=0}>=0 && isint(${3=0}) && $3>=0" +_gmic_s="$?" v + _apply_parallel_overlap "$1",${2--1} +#@cli apply_parallel_overlap : "command",overlap[%],nb_threads={ 0=auto | 1 | 2 | 4 | 8 | 16 } +#@cli : Apply specified command on each of the selected images, by parallelizing it on 'nb_threads' +#@cli : overlapped sub-images. +#@cli : (eq. to 'apo').\n +#@cli : 'nb_threads' must be a power of 2. +#@cli : Default values: 'overlap=0','nb_threads=0'. +#@cli : $ image.jpg +apply_parallel_overlap "smooth 500,0,1",1 +apply_parallel_overlap : check "${2=0}>=0 && isint(${3=0}) && $3>=0" +_gmic_s="$?" v + _$0 "$1",${2--1} +_apply_parallel_overlap : check "${2=0}>=0 && isint(${3=0}) && $3>=0" +N={if($3,max(1,round($3)),$_cpus)} N={2^int(log2(min(16,$N)))} +e[0--3] "Apply parallelized command '$1' on image"$_gmic_s", with overlap $2 and "$N" threads." +__apo_exception="" +m "_check1 : if $!!=1 rm 0 __apo_exception=\"Command 'apply_parallel_overlap': Specified command '$1' changes the +size of the image stack.\" fi" +foreach { _apply_parallel_overlap$N "$1",$2 } +um _check1 +_apply_parallel_overlap1 : +$1 +if narg($__apo_exception) error[0--12] $__apo_exception fi +_apply_parallel_overlap2 : +if w>=h +ovx={round(if(${"is_percent $2"},w*$2,$2))} w2={int(w/2)} ++z[0] {$w2-$ovx},100% z[0] 0,{$w2+$ovx-1} +parallel "l[0] { $1 _check1 }","l[1] { $1 _check1 }" +if narg($__apo_exception) error[0--12] $__apo_exception fi +z[0] 0,{0,w-1-$ovx} z[1] $ovx,100% a x +else +ovy={round(if(${"is_percent $2"},h*$2,$2))} h2={int(h/2)} ++rows[0] {$h2-$ovy},100% rows[0] 0,{$h2+$ovy-1} +parallel "l[0] { $1 _check1 }","l[1] { $1 _check1 }" +if narg($__apo_exception) error[0--12] $__apo_exception fi +rows[0] 0,{0,h-1-$ovy} rows[1] $ovy,100% a y +fi +_apply_parallel_overlap4 : +if max(w,h)/min(w,h)>=3 +_apply_parallel_overlap2 "_apply_parallel_overlap2 \"$1\",$2",$2 +else +ovx={round(if(${"is_percent $2"},w*$2,$2))} w2={int(w/2)} +ovy={round(if(${"is_percent $2"},h*$2,$2))} h2={int(h/2)} ++z[0] {$w2-$ovx},0,100%,{$h2+$ovy-1} +z[0] 0,{$h2-$ovy},{$w2+$ovx-1},100% ++z[0] {$w2-$ovx},{$h2-$ovy},100%,100% z[0] 0,0,{$w2+$ovx-1},{$h2+$ovy-1} +parallel "l[0] { $1 _check1 }","l[1] { $1 _check1 }","l[2] { $1 _check1 }","l[3] { $1 _check1 }" +if narg($__apo_exception) error[0--12] $__apo_exception fi +z[0] 0,0,{0,w-1-$ovx},{0,h-1-$ovy} z[1] $ovx,0,100%,{1,h-1-$ovy} +z[2] 0,$ovy,{2,w-1-$ovx},100% z[3] $ovx,$ovy,100%,100% +a[0,1] x a[1,2] x a y +fi +_apply_parallel_overlap8 : +_apply_parallel_overlap2 "_apply_parallel_overlap4 \"$1\",$2",$2 +_apply_parallel_overlap16 : +_apply_parallel_overlap2 "_apply_parallel_overlap8 \"$1\",$2",$2 +#@cli at : eq. to 'apply_tiles'. +at : check "${2=10%}>0 && ${3=10%}>0 && ${4=10%}>0 && ${5=0}>=0 && ${6=0}>=0 && ${7=0}>=0 && +isint(${8=1}) && $8>=0 && $8<=3" +_gmic_s="$?" v + _apply_tiles "$1",${2--1} +#@cli apply_tiles : "command",_tile_width[%]>0,_tile_height[%]>0,_tile_depth[%]>0,_overlap_width[%]>=0,_overlap_height[%]>=0,_overlap_depth[%]>=0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror } +#@cli : Apply specified command on each tile (neighborhood) of the selected images, eventually with overlapping tiles. +#@cli : (eq. to 'at'). +#@cli : Default values: 'tile_width=tile_height=tile_depth=10%','overlap_width=overlap_height=overlap_depth=0' and 'boundary_conditions=1'. +#@cli : $ image.jpg +equalize[0] 256 +apply_tiles[0] "equalize 256",16,16,1,50%,50% +apply_tiles : check "${2=10%}>0 && ${3=10%}>0 && ${4=10%}>0 && ${5=0}>=0 && ${6=0}>=0 && ${7=0}>=0 && +isint(${8=1}) && $8>=0 && $8<=3" +_gmic_s="$?" v + _$0 "$1",${2--1} +_apply_tiles : +e[0--3] "Apply command '$1' on $2x$3x$4 tiles of image$?, with overlaps ($5,$6,$7) and "${"arg0 $8,dirichlet,neumann,periodic,mirror"}" boundary conditions." +foreach { +bw={cut(round(${"is_percent $2"}?w*$2:$2),1,w)} +bh={cut(round(${"is_percent $3"}?h*$3:$3),1,h)} +bd={cut(round(${"is_percent $4"}?d*$4:$4),1,d)} +ow={round(${"is_percent $5"}?$bw*$5:$5)} +oh={round(${"is_percent $6"}?$bh*$6:$6)} +od={round(${"is_percent $7"}?$bd*$7:$7)} +sw={cut($bw-$ow,1,$bw)} +sh={cut($bh-$oh,1,$bh)} +sd={cut($bd-$od,1,$bd)} +100%,100%,100%,{s+1} +if $ow>0" || "$oh>0" || "$od>0 l[] { +$bw,1,1 1,$bh,1 1,1,$bd += 1,50%,50%,50% distance 1 +/[0] {0.3*$bw} /[1] {0.3*$bh} /[2] {0.3*$bd} +sqr * -1 exp r $bw,$bh,$bd,1 * +} else $bw,$bh,$bd,1,1 +fi +$bw,$bh,$bd,[0] +m "__at : $1 k. r "$bw,$bh,$bd,{0,s},0 +eval " +ref(crop(#2),mask); +for (z = 0, z0=with specified timeout (in seconds) } +#@cli : Apply a command with a timeout. +#@cli : Set variable '$_is_timeout' to '1' if timeout occurred, '0' otherwise. +#@cli : Default value: 'timeout=20'. +apply_timeout : check "${2=20}>=0" +if $2<=0 +e[0--3] "Apply command '$1' on image$?, with no timeout." +$1 +_is_timeout=0 +else +e[0--3] "Apply command '$1' on image$?, with a timeout of $2 seconds." +l[] { ('$/') id={is} rm } +l { ++store initial +__done$id=0 __is_timeout$id=0 +parallel "$1 __done"$id"=1","l[] do if $|-"$|">$2 __is_timeout"$id"=1 error \"\" elif $__done"$id" break fi wait 100 while 1 done" +onfail +rm $initial +_is_timeout=0 +if ${__is_timeout$id} _is_timeout=1 error[0--5] "Command '$0': Time out ($2 seconds) for command '$1'." +else error[0--5] "Command '$0': "${} +fi +} +fi +#@cli check : condition : (+) +#@cli : Evaluate specified condition and display an error message if evaluated to false. +#@cli check3d : _is_full_check={ 0 | 1 } : (+) +#@cli : Check validity of selected 3D vector objects, and display an error message +#@cli : if one of the selected images is not a valid 3D vector object. +#@cli : Full 3D object check is slower but more precise. +#@cli : Default value: 'is_full_check=1'. +check_display : skip "${1=check_display}" +if !{*,u} error[0--3] "Command '$1': No display available." fi +check_opencv : skip "${1=check_opencv}" +if find(['$_flags'],'opencv')<0 +error[0--3] "Command '$1': No OpenCV features available. ""Your G'MIC interpreter has not been compiled with OpenCV support." +fi +#@cli continue : (+) +#@cli : Go to end of current 'do...while', 'for...done', 'foreach...done', 'local...done' or 'repeat...done' block. +#@cli : $ image.jpg repeat 10 blur 1 if 1==1 continue fi deform 10 done +#@cli break : (+) +#@cli : Break current 'do...while', 'for...done', 'foreach...done', 'local...done' or 'repeat...done' block. +#@cli : $ image.jpg repeat 10 blur 1 if 1==1 break fi deform 10 done +#@cli do : (+) +#@cli : Start a 'do...while' block. +#@cli : $ image.jpg luminance i={ia+2} do set 255,{u(100)}%,{u(100)}% while ia<$i +#@cli } : (+) +#@cli : Equivalent to 'done' if it ends a 'for { .. }', 'foreach { .. }', 'local { .. }' or a 'repeat { .. }' block. +#@cli : Otherwise, close the corresponding '{ .. }' code block. +#@cli done : (+) +#@cli : End a 'for/foreach/local/repeat...done' block, and go to associated 'for/foreach/repeat' if iterations remain. +#@cli : (eq. to '}'). +#@cli elif : condition : (+) +#@cli : Start a 'elif...[else]...fi' block if previous 'if' was not verified +#@cli : and test if specified condition holds +#@cli : 'condition' is a mathematical expression, whose evaluation is interpreted as { 0=false | other=true }.. +#@cli : $$ https://gmic.eu/tutorial/iffi +#@cli else : (+) +#@cli : Execute following commands if previous 'if' or 'elif' conditions failed. +#@cli : $$ https://gmic.eu/tutorial/iffi +#@cli fi : (+) +#@cli : End a 'if...[elif]...[else]...fi' block. +#@cli : (eq. to 'fi').\n +#@cli : $$ https://gmic.eu/tutorial/iffi +#@cli error : message : (+) +#@cli : Print specified error message on the standard error (stderr) and exit interpreter, except +#@cli : if error is caught by a 'onfail' command. +#@cli : Command selection (if any) stands for displayed call stack subset instead of image indices. +#@cli eval : expression : (+) +#@cli : Evaluate specified math expression. +#@cli : - If no command selection is specified, the expression is evaluated once and its result is set to status. +#@cli : - If command selection is specified, the evaluation is looped over selected images. Status is unchanged. In this case, 'eval' is similar to ''fill'' without assigning the image values. +#@cli x : eq. to 'exec'. : (+) +#@cli exec : _is_verbose={ 0 | 1 },"command" : (+) +#@cli : Execute external command using a system call. +#@cli : The status value is then set to the error code returned by the system call. +#@cli : If 'is_verbose=1', the executed command is allowed to output on stdout/stderr. +#@cli : (eq. to 'x'). +#@cli : Default value: 'is_verbose=1'. +#@cli xo : eq. to 'exec_out'. +xo : +v + _exec_out $"*" +#@cli exec_out : _mode,"command" +#@cli : Execute external command using a system call, and return resulting `stdout` and/or `stderr`. +#@cli : 'mode' can be { 0=stdout | 1=stderr | 2=stdout+stderr }. +exec_out : +v + _exec_out $"*" +_exec_out : +l[] { +if "isint($1) && isin($1,0,1,2)" mode=$1 command="${2--1}" +else mode=0 command="$*" +fi +onfail mode=0 command="$*" +} +s0,s1,s2=stdout,stderr,stdout+stderr +e[0--3] "Execute external command '"$command"', and return "${s$mode}" output." +filename_rand filename=${} +if $mode==0 x $command" > "$filename +elif $mode==1 x $command" 2> "$filename +else x $command" >"$filename" 2>&1" +fi +it $filename u {t} rm. delete $filename +#@cli for : condition : (+) +#@cli : Start a `for...done` block. +#@cli : $ image.jpg resize2dy 32 400,400,1,3 x=0 for $x<400 image[1] [0],$x,$x x+=40 done +#@cli foreach : (+) +#@cli : Start a 'foreach...done' block, that iterates over all images in the selection, with a separate local environment for each one. +#@cli : $ sample colorful,earth,duck,dog foreach[^2] +blur 10 sub normalize 0,255 done +#@cli if : condition : (+) +#@cli : Start a 'if...[elif]...[else]...fi' block and test if specified condition holds. +#@cli : 'condition' is a mathematical expression, whose evaluation is interpreted as { 0=false | other=true }. +#@cli : $ image.jpg if ia<64 add 50% elif ia<128 add 25% elif ia<192 sub 25% else sub 50% fi cut 0,255 +#@cli : $$ https://gmic.eu/tutorial/iffi +#@cli l : eq. to 'local'. : (+) +#@cli local : (+) +#@cli : Start a 'local...[onfail]...done' block, with selected images. +#@cli : (eq. to 'l'). +#@cli : $ image.jpg local[] 300,300,1,3 rand[0] 0,255 blur 4 sharpen 1000 done +#@cli : $ image.jpg +local repeat 3 { deform 20 } done +#@cli : $$ https://gmic.eu/oldtutorial/_local +#@cli mutex : index,_action={ 0=unlock | 1=lock } : (+) +#@cli : Lock or unlock specified mutex for multi-threaded programming. +#@cli : A locked mutex can be unlocked only by the same thread. All mutexes are unlocked by default. +#@cli : 'index' designates the mutex index, in [0,255]. +#@cli : Default value: 'action=1'. +#@cli noarg : (+) +#@cli : Used in a custom command, 'noarg' tells the command that its argument list have not been used +#@cli : finally, and so they must be evaluated next in the G'MIC pipeline, just as if the custom +#@cli : command takes no arguments at all. +#@cli : Use this command to write a custom command which can decide if it takes arguments or not. +#@cli onfail : (+) +#@cli : Execute following commands when an error is encountered in the body of the 'local...done' block. +#@cli : The status value is set with the corresponding error message. +#@cli : $ image.jpg +local blur -3 onfail mirror x done +#@cli parallel : _wait_threads,"command1","command2",... : (+) +#@cli : Execute specified commands in parallel, each in a different thread. +#@cli : Parallel threads share the list of images. +#@cli : 'wait_threads' can be { 0=when current environment ends | 1=immediately }. +#@cli : Default value: 'wait_threads=1'. +#@cli : $ image.jpg [0] parallel "blur[0] 3","mirror[1] c" +parallel : skip "${1=},${2=},${3=},${4=},${5=},${6=},${7=},${8=},${9=},${10=},${11=},${12=},${13=},${14=},${15=}" +if $1==0||$1==1||$1==2 e[0--3] "Execute "{$#-1}" commands '${2--1}' in parallel on image$?." +else e[0--3] "Execute "$#" commands '$*' in parallel on image$?." +fi +parallel $"*" +#@cli progress : 0<=value<=100 : -1 : (+) +#@cli : Set the progress index of the current processing pipeline. +#@cli : This command is useful only when G'MIC is used by an embedding application. +#@cli q : eq. to 'quit'. : (+) +#@cli quit : (+) +#@cli : Quit G'MIC interpreter. +#@cli : (eq. to 'q'). +#@cli repeat : nb_iterations : (+) +#@cli : Start 'nb_iterations' iterations of a `repeat...done` block. +#@cli : 'nb_iterations' is a mathematical expression that will be evaluated. +#@cli : $ image.jpg split y repeat $! n=$> shift[$n] $<,0,0,0,2 done append y +#@cli : $ image.jpg mode3d 2 repeat 4 imagecube3d rotate3d 1,1,0,40 snapshot3d 400,1.4 done +#@cli : $$ https://gmic.eu/oldtutorial/_repeat +#@cli return : (+) +#@cli : Return from current custom command. +#@cli rprogress : 0<=value<=100 | -1 | "command",0<=value_min<=100,0<=value_max<=100 +#@cli : Set the progress index of the current processing pipeline (relatively to +#@cli : previously defined progress bounds), or call the specified command with +#@cli : specified progress bounds. +rprogress : skip ${2=""} +if !narg($_progress_bounds) _progress_bounds=0,100 fi +m={arg(-2,$_progress_bounds)} M={arg(-1,$_progress_bounds)} +if $#==2&&!narg($2) # 1 argument -> Set progress bar. +e[0--3] "Set relative progress index to $1%." +progress {if($1<0,-1,min(100,max(0,$m+($M-$m)*$1%)))} +elif $#==3 # 3 arguments -> Call command with specified bounds. +nm={min($2,$-1)} nM={max($2,$-1)} +e[0--3] "Call command '$1' with progress bounds ["$nm,$nM"]." +progress $m _progress_bounds=$_progress_bounds,{$m+$nm*($M-$m)/100},{$m+$nM*($M-$m)/100} +run "$1" +progress $M ($_progress_bounds) _progress_bounds={@0--3} rm. +else error[0--3] "Command '$0': Invalid argument '$*'." +fi +#@cli run : "G'MIC pipeline" +#@cli : Run specified G'MIC pipeline. +#@cli : This is only useful when used from a shell, e.g. to avoid shell substitutions to happen in argument. +run : +m "__run : $*" v=$^ v {$v+2} __run v $v um __run +#@cli skip : item : (+) +#@cli : Do nothing but skip specified item. +#@cli u : eq. to 'status'. : (+) +#@cli status : status_string : (+) +#@cli : Set the current status. Used to define a returning value from a function. +#@cli : (eq. to 'u'). +#@cli : $ image.jpg command "foo : u0=Dark u1=Bright status ${u{ia>=128}}" text_outline ${-foo},2,2,23,2,1,255 +#@cli while : condition : (+) +#@cli : End a 'do...while' block and go back to associated 'do' if specified condition holds. +#@cli : 'condition' is a mathematical expression, whose evaluation is interpreted as { 0=false | other=true }. +#@cli :: Neural Networks +#@cli nn_lib : +#@cli : Return the list of library functions that has to be included in a math expression,in order to use the neural network library. +nn_lib : +u " +begin( +const nn_nb_threads_max = n; +const nn_is_training = $_nn_is_training!=0; +); +begin_t( +nn_thread_id = t; +nn_nb_threads_used = nn_thread_id + 1; +nn_batch_size = 0; +); +++nn_batch_size; +end( +merge(nn_nb_threads_used,max); +merge(nn_batch_size,+); +); +nn_display(L) = display(L#,L#_width,L#_height,L#_depth,L#_spectrum); +nn_display(L,M) = display(L#,M#_width,M#_height,M#_depth,M#_spectrum); +nn_store(L) = store(['L#'],L#,L#_width,L#_height,L#_depth,L#_spectrum); +nn_store(L,M) = store(['L#'],L#,M#_width,M#_height,M#_depth,M#_spectrum); +nn_activation_elu(z) = (z<0?exp(z) - 1:z); +nn_activation_d_elu(z) = (z<0?exp(z):1); +"{['$_expr']!=0}"?( +begin( +_nn_tab_expr = expr('z = lerp(-32,32,x/(w-1)); "$_expr"',65537); +_nn_tab_d_expr = vector(#size(_nn_tab_expr)); +const _nn_delta_expr = 64/(size(_nn_tab_expr) - 1); +fill(_nn_tab_d_expr,_nn_k, +_nn_pk = _nn_k?_nn_k - 1:_nn_k; +_nn_nk = _nn_k=0.3?( +nn_learning_rate = max(0.25*nn_learning_rate,1e-8); +nn_adaptive_nb_increases = nn_adaptive_nb_decreases = 0; +):nn_adaptive_trend_moment>=0?( +++nn_adaptive_nb_increases; +nn_adaptive_nb_decreases = 0; +nn_adaptive_nb_increases>=2?( +nn_learning_rate = max(0.75*nn_learning_rate,1e-8); +nn_adaptive_nb_increases = 0; +); +):nn_adaptive_trend_moment<0?( +++nn_adaptive_nb_decreases; +nn_adaptive_nb_decreases>=4?( +nn_learning_rate = min(nn_learning_rate*1.15,0.1); +nn_adaptive_nb_decreases = 0; +); +); +); +copy(i(##T#_ind,0,2,0,0),[ nn_adaptive_trend_moment,nn_adaptive_nb_decreases,nn_adaptive_nb_increases ]); +); +nn_optimizer_generic_update_normalize(O,P,learning_mode) = ( +P#_is_channelwise?( # Channel-by-channel normalization +draw(##P#_ind,batch_#P#_avg,2,0,1,h##P#_ind,0.01); +draw(##P#_ind,batch_#P#_var,3,0,1,h##P#_ind,0.01); +learning_mode&1?( +nn_optimizer_#O#_update_weights(P#_alpha); +draw(##P#_ind,P#_alpha,0,0,1,h##P#_ind); +); +learning_mode&2?( +nn_optimizer_#O#_update_weights(P#_beta); +draw(##P#_ind,P#_beta,1,0,1,h##P#_ind); +); +):( +i[##P#_ind,2] = lerp(P#_avg,batch_#P#_avg,0.01); +i[##P#_ind,3] = lerp(P#_var,batch_#P#_var,0.01); +learning_mode&1?( +nn_optimizer_#O#_update_weights(P#_alpha); +i[##P#_ind,0] = P#_alpha; +); +learning_mode&2?( +nn_optimizer_#O#_update_weights(P#_beta); +i[##P#_ind,1] = P#_beta; +); +); +); +nn_optimizer_sgd_init() = 0; +nn_optimizer_sgd_update_weights(W) = ( +W#-=nn_learning_rate*batch_d#W; +); +nn_optimizer_sgd_update_conv_or_fc(P,learning_mode) = ( +learning_mode&1?( +nn_optimizer_sgd_update_weights(P#_weights); +draw(##P#_ind,P#_weights,0,0,w##P#_ind - 1,h##P#_ind); +); +learning_mode&2?( +nn_optimizer_sgd_update_weights(P#_biases); +draw(##P#_ind,P#_biases,w##P#_ind - 1,0,1,h##P#_ind); +); +); +nn_optimizer_sgd_update_conv2d(P,learning_mode) = ( +learning_mode?nn_optimizer_sgd_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_sgd_update_conv3d(P,learning_mode) = ( +learning_mode?nn_optimizer_sgd_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_sgd_update_fc(P,learning_mode) = ( +learning_mode?nn_optimizer_sgd_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_sgd_update_normalize(P,learning_mode) = ( +nn_optimizer_generic_update_normalize(sgd,#P,#learning_mode); +); +nn_optimizer_sgd_update_nlfc(P,learning_mode) = ( +learning_mode&1?( +nn_optimizer_sgd_update_weights(P#_weights); +draw(##P#_ind,P#_weights,0,0,w##P#_ind/2,h##P#_ind); +); +learning_mode&2?( +nn_optimizer_sgd_update_weights(P#_biases); +draw(##P#_ind,P#_biases,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +); +); +nn_optimizer_rmsprop_init() = ( +const nn_optimizer_rmsprop_beta = 0.9; +); +nn_optimizer_rmsprop_update_weights(W) = ( +d#W#_g2 = lerp(batch_d#W^2,d#W#_g2,nn_optimizer_rmsprop_beta); +W#-=nn_learning_rate*batch_d#W/sqrt(1e-8 + d#W#_g2); +); +nn_optimizer_rmsprop_update_conv_or_fc(P,learning_mode) = ( +const P#_ind_g2 = $P#_g2; +learning_mode&1?( +d#P#_weights_g2 = crop(##P#_ind_g2,0,0,w##P#_ind - 1,h##P#_ind); +nn_optimizer_rmsprop_update_weights(P#_weights); +draw(##P#_ind,P#_weights,0,0,w##P#_ind - 1,h##P#_ind); +draw(##P#_ind_g2,d#P#_weights_g2,0,0,w##P#_ind - 1,h##P#_ind); +); +learning_mode&2?( +d#P#_biases_g2 = crop(##P#_ind_g2,w##P#_ind - 1,0,1,h##P#_ind); +nn_optimizer_rmsprop_update_weights(P#_biases); +draw(##P#_ind,P#_biases,w##P#_ind - 1,0,1,h##P#_ind); +draw(##P#_ind_g2,d#P#_biases_g2,w##P#_ind - 1,0,1,h##P#_ind); +); +); +nn_optimizer_rmsprop_update_conv2d(P,learning_mode) = ( +learning_mode?nn_optimizer_rmsprop_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_rmsprop_update_conv3d(P,learning_mode) = ( +learning_mode?nn_optimizer_rmsprop_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_rmsprop_update_fc(P,learning_mode) = ( +learning_mode?nn_optimizer_rmsprop_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_rmsprop_update_normalize(P,learning_mode) = ( +const P#_ind_g2 = $P#_g2; +learning_mode?( +P#_is_channelwise?( # Channel-by-channel normalization +d#P#_alpha_g2 = crop(##P#_ind_g2,0,1); +d#P#_beta_g2 = crop(##P#_ind_g2,1,1); +):( +d#P#_alpha_g2 = i[##P#_ind_g2,0]; +d#P#_beta_g2 = i[##P#_ind_g2,1]; +); +); +nn_optimizer_generic_update_normalize(rmsprop,#P,#learning_mode); +); +nn_optimizer_rmsprop_update_nlfc(P,learning_mode) = ( +const P#_ind_g2 = $P#_g2; +learning_mode&1?( +d#P#_weights_g2 = crop(##P#_ind_g2,0,0,w##P#_ind/2,h##P#_ind); +nn_optimizer_rmsprop_update_weights(P#_weights); +draw(##P#_ind,P#_weights,0,0,w##P#_ind/2,h##P#_ind); +draw(##P#_ind_g2,d#P#_weights_g2,0,0,w##P#_ind/2,h##P#_ind); +); +learning_mode&2?( +d#P#_biases_g2 = crop(##P#_ind_g2,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +nn_optimizer_rmsprop_update_weights(P#_biases); +draw(##P#_ind,P#_biases,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +draw(##P#_ind_g2,d#P#_biases_g2,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +); +); +nn_optimizer_adam_init() = ( +begin( +const nn_optimizer_adam_beta1 = 0.9; +const nn_optimizer_adam_beta2 = 0.999; +nn_optimizer_adam_beta1_t = nn_iteration>200?0:nn_optimizer_adam_beta1^(nn_iteration + 1); +nn_optimizer_adam_beta2_t = nn_iteration>200?0:nn_optimizer_adam_beta2^(nn_iteration + 1); +nn_optimizer_adam_alpha_t = sqrt(1 - nn_optimizer_adam_beta2_t)/(1 - nn_optimizer_adam_beta1_t); +); +); +nn_optimizer_adam_update_weights(W) = ( +d#W#_m = lerp(batch_d#W,d#W#_m,nn_optimizer_adam_beta1); +d#W#_v = lerp(batch_d#W^2,d#W#_v,nn_optimizer_adam_beta2); +W#-=nn_learning_rate*nn_optimizer_adam_alpha_t*d#W#_m/sqrt(1e-8 + d#W#_v); +); +nn_optimizer_adam_update_conv_or_fc(P,learning_mode) = ( +const P#_ind_m = $P#_m; +const P#_ind_v = $P#_v; +learning_mode&1?( +d#P#_weights_m = crop(##P#_ind_m,0,0,w##P#_ind - 1,h##P#_ind); +d#P#_weights_v = crop(##P#_ind_v,0,0,w##P#_ind - 1,h##P#_ind); +nn_optimizer_adam_update_weights(P#_weights); +draw(##P#_ind,P#_weights,0,0,w##P#_ind - 1,h##P#_ind); +draw(##P#_ind_m,d#P#_weights_m,0,0,w##P#_ind - 1,h##P#_ind); +draw(##P#_ind_v,d#P#_weights_v,0,0,w##P#_ind - 1,h##P#_ind); +); +learning_mode&2?( +d#P#_biases_m = crop(##P#_ind_m,w##P#_ind - 1,0,1,h##P#_ind); +d#P#_biases_v = crop(##P#_ind_v,w##P#_ind - 1,0,1,h##P#_ind); +nn_optimizer_adam_update_weights(P#_biases); +draw(##P#_ind,P#_biases,w##P#_ind - 1,0,1,h##P#_ind); +draw(##P#_ind_m,d#P#_biases_m,w##P#_ind - 1,0,1,h##P#_ind); +draw(##P#_ind_v,d#P#_biases_v,w##P#_ind - 1,0,1,h##P#_ind); +); +); +nn_optimizer_adam_update_conv2d(P,learning_mode) = ( +learning_mode?nn_optimizer_adam_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_adam_update_conv3d(P,learning_mode) = ( +learning_mode?nn_optimizer_adam_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_adam_update_fc(P,learning_mode) = ( +learning_mode?nn_optimizer_adam_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_adam_update_normalize(P,learning_mode) = ( +const P#_ind_m = $P#_m; +const P#_ind_v = $P#_v; +learning_mode?( +P#_is_channelwise?( # Channel-by-channel normalization +d#P#_alpha_m = crop(##P#_ind_m,0,1); +d#P#_beta_m = crop(##P#_ind_m,1,1); +d#P#_alpha_v = crop(##P#_ind_v,0,1); +d#P#_beta_v = crop(##P#_ind_v,1,1); +):( +d#P#_alpha_m = i[##P#_ind_m,0]; +d#P#_beta_m = i[##P#_ind_m,1]; +d#P#_alpha_v = i[##P#_ind_v,0]; +d#P#_beta_v = i[##P#_ind_v,1]; +); +); +nn_optimizer_generic_update_normalize(adam,#P,#learning_mode); +); +nn_optimizer_adam_update_nlfc(P,learning_mode) = ( +learning_mode?( +const P#_ind_m = $P#_m; +const P#_ind_v = $P#_v; +learning_mode&1?( +d#P#_weights_m = crop(##P#_ind_m,0,0,w##P#_ind/2,h##P#_ind); +d#P#_weights_v = crop(##P#_ind_v,0,0,w##P#_ind/2,h##P#_ind); +nn_optimizer_adam_update_weights(P#_weights); +draw(##P#_ind,P#_weights,0,0,w##P#_ind/2,h##P#_ind); +draw(##P#_ind_m,d#P#_weights_m,0,0,w##P#_ind/2,h##P#_ind); +draw(##P#_ind_v,d#P#_weights_v,0,0,w##P#_ind/2,h##P#_ind); +); +learning_mode&2?( +d#P#_biases_m = crop(##P#_ind_m,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +d#P#_biases_v = crop(##P#_ind_v,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +nn_optimizer_adam_update_weights(P#_biases); +draw(##P#_ind,P#_biases,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +draw(##P#_ind_m,d#P#_biases_m,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +draw(##P#_ind_v,d#P#_biases_v,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +); +); +); +nn_optimizer_adamax_init() = ( +begin( +const nn_optimizer_adamax_beta1 = 0.9; +const nn_optimizer_adamax_beta2 = 0.999; +nn_optimizer_adamax_ombeta1_t = nn_iteration>200?1:(1 - nn_optimizer_adamax_beta1^(nn_iteration + 1)); +); +); +nn_optimizer_adamax_update_weights(W) = ( +d#W#_m = lerp(batch_d#W,d#W#_m,nn_optimizer_adamax_beta1); +d#W#_v = vmax(abs(batch_d#W),nn_optimizer_adamax_beta2*d#W#_v); +W#-=(nn_learning_rate/nn_optimizer_adamax_ombeta1_t)*d#W#_m/sqrt(1e-8 + d#W#_v); +); +nn_optimizer_adamax_update_conv_or_fc(P,learning_mode) = ( +const P#_ind_m = $P#_m; +const P#_ind_v = $P#_v; +learning_mode&1?( +d#P#_weights_m = crop(##P#_ind_m,0,0,w##P#_ind - 1,h##P#_ind); +d#P#_weights_v = crop(##P#_ind_v,0,0,w##P#_ind - 1,h##P#_ind); +nn_optimizer_adamax_update_weights(P#_weights); +draw(##P#_ind,P#_weights,0,0,w##P#_ind - 1,h##P#_ind); +draw(##P#_ind_m,d#P#_weights_m,0,0,w##P#_ind - 1,h##P#_ind); +draw(##P#_ind_v,d#P#_weights_v,0,0,w##P#_ind - 1,h##P#_ind); +); +learning_mode&2?( +d#P#_biases_m = crop(##P#_ind_m,w##P#_ind - 1,0,1,h##P#_ind); +d#P#_biases_v = crop(##P#_ind_v,w##P#_ind - 1,0,1,h##P#_ind); +nn_optimizer_adamax_update_weights(P#_biases); +draw(##P#_ind,P#_biases,w##P#_ind - 1,0,1,h##P#_ind); +draw(##P#_ind_m,d#P#_biases_m,w##P#_ind - 1,0,1,h##P#_ind); +draw(##P#_ind_v,d#P#_biases_v,w##P#_ind - 1,0,1,h##P#_ind); +); +); +nn_optimizer_adamax_update_conv2d(P,learning_mode) = ( +learning_mode?nn_optimizer_adamax_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_adamax_update_conv3d(P,learning_mode) = ( +learning_mode?nn_optimizer_adamax_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_adamax_update_fc(P,learning_mode) = ( +learning_mode?nn_optimizer_adamax_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_adamax_update_normalize(P,learning_mode) = ( +const P#_ind_m = $P#_m; +const P#_ind_v = $P#_v; +learning_mode?( +P#_is_channelwise?( # Channel-by-channel normalization +d#P#_alpha_m = crop(##P#_ind_m,0,1); +d#P#_beta_m = crop(##P#_ind_m,1,1); +d#P#_alpha_v = crop(##P#_ind_v,0,1); +d#P#_beta_v = crop(##P#_ind_v,1,1); +):( +d#P#_alpha_m = i[##P#_ind_m,0]; +d#P#_beta_m = i[##P#_ind_m,1]; +d#P#_alpha_v = i[##P#_ind_v,0]; +d#P#_beta_v = i[##P#_ind_v,1]; +); +); +nn_optimizer_generic_update_normalize(adamax,#P,#learning_mode); +); +nn_optimizer_adamax_update_nlfc(P,learning_mode) = ( +const P#_ind_m = $P#_m; +const P#_ind_v = $P#_v; +learning_mode&1?( +d#P#_weights_m = crop(##P#_ind_m,0,0,w##P#_ind/2,h##P#_ind); +d#P#_weights_v = crop(##P#_ind_v,0,0,w##P#_ind/2,h##P#_ind); +nn_optimizer_adamax_update_weights(P#_weights); +draw(##P#_ind,P#_weights,0,0,w##P#_ind/2,h##P#_ind); +draw(##P#_ind_m,d#P#_weights_m,0,0,w##P#_ind/2,h##P#_ind); +draw(##P#_ind_v,d#P#_weights_v,0,0,w##P#_ind/2,h##P#_ind); +); +learning_mode&2?( +d#P#_biases_m = crop(##P#_ind_m,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +d#P#_biases_v = crop(##P#_ind_v,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +nn_optimizer_adamax_update_weights(P#_biases); +draw(##P#_ind,P#_biases,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +draw(##P#_ind_m,d#P#_biases_m,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +draw(##P#_ind_v,d#P#_biases_v,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +); +); +nn_add_init_forward(OUT,IN) = ( +const OUT#_width = IN#_width; +const OUT#_height = IN#_height; +const OUT#_depth = IN#_depth; +const OUT#_spectrum = IN#_spectrum; +); +nn_add_forward(OUT,IN0,IN1) = ( +OUT# = IN0# + IN1#; +); +nn_add_backward(OUT,IN0,IN1) = ( +d#IN0 = d#IN1 = d#OUT/2; +); +nn_append_init_forward(OUT,IN0,IN1) = ( +const OUT#_width = IN0#_width; +const OUT#_height = IN0#_height; +const OUT#_depth = IN0#_depth; +const OUT#_spectrum = IN0#_spectrum + IN1#_spectrum; +); +nn_append_forward(OUT,IN0,IN1) = ( +OUT# = vector(#size(IN0#) + size(IN1#)); +copy(OUT#,IN0#,size(IN0#)); +copy(OUT#[size(IN0#)],IN1#,size(IN1#)); +); +nn_append_backward(OUT,IN0,IN1) = ( +d#IN0 = d#OUT[0,size(IN0#)]; +d#IN1 = d#OUT[size(IN0#),size(IN1#)]; +); +nn_avgpool2d_init_forward(OUT,IN,patch_size) = ( +const OUT#_width = int(IN#_width/patch_size); +const OUT#_height = int(IN#_height/patch_size); +const OUT#_depth = IN#_depth; +const OUT#_spectrum = IN#_spectrum; +); +nn_avgpool2d_forward(OUT,IN) = ( +OUT# = resize(IN#, +IN#_width,IN#_height,IN#_depth,IN#_spectrum, +OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +2); +); +nn_avgpool2d_backward(OUT,IN) = ( +d#IN = resize(d#OUT, +OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +IN#_width,IN#_height,IN#_depth,IN#_spectrum, +1); +); +nn_avgpool3d_init_forward(OUT,IN,patch_size) = ( +const OUT#_width = int(IN#_width/patch_size); +const OUT#_height = int(IN#_height/patch_size); +const OUT#_depth = int(IN#_depth/patch_size); +const OUT#_spectrum = IN#_spectrum; +); +nn_avgpool3d_forward(OUT,IN) = nn_avgpool2d_forward(OUT#,IN#); # Same as avgpool2d +nn_avgpool3d_backward(OUT,IN) = nn_avgpool2d_backward(OUT#,IN#); # Same as avgpool2d +nn_clone_init_forward(OUT0,OUT1,IN) = ( +const OUT0#_width = IN#_width; +const OUT0#_height = IN#_height; +const OUT0#_depth = IN#_depth; +const OUT0#_spectrum = IN#_spectrum; +const OUT1#_width = IN#_width; +const OUT1#_height = IN#_height; +const OUT1#_depth = IN#_depth; +const OUT1#_spectrum = IN#_spectrum; +); +nn_clone_forward(OUT0,OUT1,IN) = ( +OUT0# = IN#; +OUT1# = IN#; +); +nn_clone_backward(OUT0,OUT1,IN) = ( +d#IN = d#OUT0 + d#OUT1; +); +nn_conv2d_init_forward(OUT,IN,size,stride,dilation,shrink,boundary_conditions) = ( +const OUT#_ind = $OUT#; +const OUT#_shrink = shrink; +const OUT#_width = int(IN#_width/stride) - 2*OUT#_shrink; +const OUT#_height = int(IN#_height/stride) - 2*OUT#_shrink; +const OUT#_depth = IN#_depth; +const OUT#_spectrum = h##OUT#_ind; +const OUT#_whd = OUT#_width*OUT#_height*OUT#_depth; +const OUT#_kernel_size = size; +const OUT#_kernel_size2 = OUT#_kernel_size^2; +const OUT#_kernel_center = OUT#_kernel_size - 1 - int(OUT#_kernel_size/2); +const OUT#_stride = stride; +const OUT#_dilation = dilation; +const OUT#_boundary_conditions = boundary_conditions; +OUT#_weights = crop(##OUT#_ind,0,0,w##OUT#_ind - 1,OUT#_spectrum); +OUT#_biases = crop(##OUT#_ind,w##OUT#_ind - 1,0,1,OUT#_spectrum); +); +nn_conv2d_forward(OUT,IN) = ( +OUT# = convolve(IN#, +IN#_width,IN#_height,IN#_depth,IN#_spectrum, +OUT#_weights, +OUT#_kernel_size,OUT#_kernel_size,1,IN#_spectrum*OUT#_spectrum, +OUT#_boundary_conditions,0,2, +OUT#_kernel_center,OUT#_kernel_center,0, +OUT#_shrink,OUT#_shrink,0, +OUT#_width - 1 + OUT#_shrink,OUT#_height - 1 + OUT#_shrink,OUT#_depth - 1, +OUT#_stride,OUT#_stride,1, +OUT#_dilation,OUT#_dilation,1); +repeat (OUT#_spectrum,_nn_k,copy(OUT#[_nn_k*OUT#_whd],OUT#_biases[_nn_k],OUT#_whd,1,0,-1)); # Add biases +); +nn_conv2d_init_backward(OUT,IN) = ( +batch_d#OUT#_weights = vector(#size(OUT#_weights)); +batch_d#OUT#_biases = vector(#size(OUT#_biases)); +); +nn_conv2d_backward(OUT,IN) = ( +const OUT#_offset = -int(OUT#_shrink/OUT#_stride); +const OUT#_invstride = 1/OUT#_stride; +const OUT#_dons = OUT#_dilation/OUT#_stride; +d#IN = vector(#size(IN#)); +repeat (IN#_spectrum,_nn_k, +draw(d#IN,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +correlate(d#OUT, +OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +crop(OUT#_weights,w##OUT#_ind - 1,OUT#_spectrum,1,1, +_nn_k*OUT#_kernel_size2,0,OUT#_kernel_size2,OUT#_spectrum), +OUT#_kernel_size,OUT#_kernel_size,1,OUT#_spectrum, +0,0,2, +OUT#_kernel_center,OUT#_kernel_center,0, +OUT#_offset,OUT#_offset,0, +IN#_width - 1 + OUT#_offset,IN#_height - 1 + OUT#_offset,IN#_depth - 1, +OUT#_invstride,OUT#_invstride,1, +OUT#_dons,OUT#_dons,1), +0,0,0,_nn_k,IN#_width,IN#_height,IN#_depth,1); +); +d#OUT#_biases = vector(#size(OUT#_biases)); +fill(d#OUT#_biases,_nn_k,sum(d#OUT[_nn_k*OUT#_whd,OUT#_whd])); +batch_d#OUT#_biases+=d#OUT#_biases; +const OUT#_dcenter = OUT#_dilation*OUT#_kernel_center; +const OUT#_kend = OUT#_kernel_size - 1 + OUT#_offset; +d#OUT#_weights = vector(#size(OUT#_weights)); +repeat (OUT#_spectrum,_nn_k, +draw(d#OUT#_weights, +OUT#_kernel_size,OUT#_kernel_size,1,OUT#_spectrum*IN#_spectrum, +correlate(crop(d#OUT,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +0,0,0,_nn_k,OUT#_width,OUT#_height,OUT#_depth,1), +OUT#_width,OUT#_height,OUT#_depth,1, +IN#, +IN#_width,IN#_height,IN#_depth,IN#_spectrum, +0,0,1, +OUT#_dcenter,OUT#_dcenter,0, +OUT#_offset,OUT#_offset,0, +OUT#_kend,OUT#_kend,0, +OUT#_dons,OUT#_dons,1, +OUT#_invstride,OUT#_invstride,1), +0,0,0,_nn_k*IN#_spectrum, +OUT#_kernel_size,OUT#_kernel_size,1,IN#_spectrum); +); +batch_d#OUT#_weights+=d#OUT#_weights; +); +nn_conv2d_end_backward(OUT) = ( +merge(batch_d#OUT#_weights,+); +merge(batch_d#OUT#_biases,+); +batch_d#OUT#_weights/=nn_batch_size; +batch_d#OUT#_biases/=nn_batch_size; +); +nn_conv3d_init_forward(OUT,IN,size,stride,dilation,shrink,boundary_conditions) = ( +const OUT#_ind = $OUT#; +const OUT#_shrink = shrink; +const OUT#_width = int(IN#_width/stride) - 2*OUT#_shrink; +const OUT#_height = int(IN#_height/stride) - 2*OUT#_shrink; +const OUT#_depth = int(IN#_depth/stride) - 2*OUT#_shrink; +const OUT#_spectrum = h##OUT#_ind; +const OUT#_whd = OUT#_width*OUT#_height*OUT#_depth; +const OUT#_kernel_size = size; +const OUT#_kernel_size3 = OUT#_kernel_size^3; +const OUT#_kernel_center = OUT#_kernel_size - 1 - int(OUT#_kernel_size/2); +const OUT#_stride = stride; +const OUT#_dilation = dilation; +const OUT#_boundary_conditions = boundary_conditions; +OUT#_weights = crop(##OUT#_ind,0,0,w##OUT#_ind - 1,OUT#_spectrum); +OUT#_biases = crop(##OUT#_ind,w##OUT#_ind - 1,0,1,OUT#_spectrum); +); +nn_conv3d_forward(OUT,IN) = ( +OUT# = convolve(IN#, +IN#_width,IN#_height,IN#_depth,IN#_spectrum, +OUT#_weights, +OUT#_kernel_size,OUT#_kernel_size,OUT#_kernel_size,IN#_spectrum*OUT#_spectrum, +OUT#_boundary_conditions,0,2, +OUT#_kernel_center,OUT#_kernel_center,OUT#_kernel_center, +OUT#_shrink,OUT#_shrink,OUT#_shrink, +OUT#_width - 1 + OUT#_shrink,OUT#_height - 1 + OUT#_shrink,OUT#_depth - 1 + OUT#_shrink, +OUT#_stride,OUT#_stride,OUT#_stride, +OUT#_dilation,OUT#_dilation,OUT#_dilation); +repeat (OUT#_spectrum,_nn_k,copy(OUT#[_nn_k*OUT#_whd],OUT#_biases[_nn_k],OUT#_whd,1,0,-1)); # Add biases +); +nn_conv3d_init_backward(OUT,IN) = ( +batch_d#OUT#_weights = vector(#size(OUT#_weights)); +batch_d#OUT#_biases = vector(#size(OUT#_biases)); +); +nn_conv3d_backward(OUT,IN) = ( +const OUT#_offset = -int(OUT#_shrink/OUT#_stride); +const OUT#_invstride = 1/OUT#_stride; +const OUT#_dons = OUT#_dilation/OUT#_stride; +d#IN = vector(#size(IN#)); +repeat (IN#_spectrum,_nn_k, +draw(d#IN,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +correlate(d#OUT, +OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +crop(OUT#_weights,w##OUT#_ind - 1,OUT#_spectrum,1,1, +_nn_k*OUT#_kernel_size3,0,OUT#_kernel_size3,OUT#_spectrum), +OUT#_kernel_size,OUT#_kernel_size,OUT#_kernel_size,OUT#_spectrum, +0,0,2, +OUT#_kernel_center,OUT#_kernel_center,OUT#_kernel_center, +OUT#_offset,OUT#_offset,OUT#_offset, +IN#_width - 1 + OUT#_offset,IN#_height - 1 + OUT#_offset,IN#_depth - 1 + OUT#_offset, +OUT#_invstride,OUT#_invstride,OUT#_invstride, +OUT#_dons,OUT#_dons,OUT#_dons), +0,0,0,_nn_k,IN#_width,IN#_height,IN#_depth,1); +); +d#OUT#_biases = vector(#size(OUT#_biases)); +fill(d#OUT#_biases,_nn_k,sum(d#OUT[_nn_k*OUT#_whd,OUT#_whd])); +batch_d#OUT#_biases+=d#OUT#_biases; +const OUT#_dcenter = OUT#_dilation*OUT#_kernel_center; +const OUT#_kend = OUT#_kernel_size - 1 + OUT#_offset; +d#OUT#_weights = vector(#size(OUT#_weights)); +repeat (OUT#_spectrum,_nn_k, +draw(d#OUT#_weights, +OUT#_kernel_size,OUT#_kernel_size,OUT#_kernel_size,OUT#_spectrum*IN#_spectrum, +correlate(crop(d#OUT,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +0,0,0,_nn_k,OUT#_width,OUT#_height,OUT#_depth,1), +OUT#_width,OUT#_height,OUT#_depth,1, +IN#, +IN#_width,IN#_height,IN#_depth,IN#_spectrum, +0,0,1, +OUT#_dcenter,OUT#_dcenter,OUT#_dcenter, +OUT#_offset,OUT#_offset,OUT#_offset, +OUT#_kend,OUT#_kend,OUT#_kend, +OUT#_dons,OUT#_dons,OUT#_dons, +OUT#_invstride,OUT#_invstride,OUT#_invstride), +0,0,0,_nn_k*IN#_spectrum, +OUT#_kernel_size,OUT#_kernel_size,OUT#_kernel_size,IN#_spectrum); +); +batch_d#OUT#_weights+=d#OUT#_weights; +); +nn_conv3d_end_backward(OUT) = ( +merge(batch_d#OUT#_weights,+); +merge(batch_d#OUT#_biases,+); +batch_d#OUT#_weights/=nn_batch_size; +batch_d#OUT#_biases/=nn_batch_size; +); +nn_crop_init_forward(OUT,IN,x0,y0,z0,c0,x1,y1,z1,c1,boundary_conditions) = ( +const OUT#_x0 = x0; +const OUT#_y0 = y0; +const OUT#_z0 = z0; +const OUT#_c0 = c0; +const OUT#_width = abs(x1 - x0) + 1; +const OUT#_height = abs(y1 - y0) + 1; +const OUT#_depth = abs(z1 - z0) + 1; +const OUT#_spectrum = abs(c1 - c0) + 1; +const OUT#_boundary_conditions = boundary_conditions; +); +nn_crop_forward(OUT,IN) = ( +OUT# = crop(IN#,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +OUT#_x0,OUT#_y0,OUT#_z0,OUT#_c0, +OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +OUT#_boundary_conditions); +); +nn_crop_backward(OUT,IN) = ( +d#IN = crop(d#OUT,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +-OUT#_x0,-OUT#_y0,-OUT#_z0,-OUT#_c0, +IN#_width,IN#_height,IN#_depth,IN#_spectrum, +0); +); +nn_distance_init_forward(OUT,metric) = ( +const OUT#_width = 1; +const OUT#_height = 1; +const OUT#_depth = 1; +const OUT#_spectrum = 1; +const OUT#_metric = metric; +); +nn_distance_forward(OUT,IN0,IN1) = ( +OUT#_diff = IN0# - IN1#; +OUT# = [ OUT#_metric>0?norm#OUT#_metric(OUT#_diff):norm(OUT#_diff)^2 ]; +); +nn_distance_backward(OUT,IN0,IN1) = ( +!OUT_#metric?( # L2-squared +d#IN0 = 2*OUT#_diff; +):OUT#_metric==2?( # L2 +d#IN0 = OUT#_diff/(1e-8 + OUT#[0]); +):( +d#IN0 = (abs(OUT#_diff)/(1e-8 + OUT#[0]))^(OUT#_metric - 1)*sign(OUT#_diff); +); +d#IN1 = -d#IN0; +); +nn_dropout_init_forward(OUT,IN,dropout_rate) = ( +const OUT#_width = IN#_width; +const OUT#_height = IN#_height; +const OUT#_depth = IN#_depth; +const OUT#_spectrum = IN#_spectrum; +const OUT#_dropout_rate = nn_is_training?cut(dropout_rate,0,1):0; +OUT#_dropout_rate?( +OUT#_dropout_channels = vector(##OUT#_spectrum); +fill(OUT#_dropout_channels,u>=OUT#_dropout_rate); +OUT#_dropout_sum = sum(OUT#_dropout_channels); +!OUT#_dropout_sum?(OUT#_dropout_channels = 1; OUT#_dropout_sum = size(OUT#_dropout_channels)); +OUT#_dropout_mask = resize(OUT#_dropout_channels,size(IN#),1); +OUT#_dropout_mask*=size(OUT#_dropout_channels)/OUT#_dropout_sum; +); +); +nn_dropout_forward(OUT,IN) = ( +OUT#_dropout_rate?( +OUT# = IN#*OUT#_dropout_mask; +):( +ref(IN#,OUT#); +); +); +nn_dropout_backward(OUT,IN) = ( +OUT#_dropout_rate?( +d#IN = d#OUT*OUT#_dropout_mask; +):( +ref(d#OUT,d#IN); +); +); +nn_fc_init_forward(OUT,IN) = ( +const OUT#_ind = $OUT#; +const OUT#_width = 1; +const OUT#_height = 1; +const OUT#_depth = 1; +const OUT#_spectrum = h##OUT#_ind; +OUT#_weights = crop(##OUT#_ind,0,0,size(IN#),h##OUT#_ind); +OUT#_biases = crop(##OUT#_ind,size(IN#),0,1,h##OUT#_ind); +); +nn_fc_forward(OUT,IN) = ( +OUT# = mul(OUT#_weights,IN#); +OUT#+=OUT#_biases; +); +nn_fc_init_backward(OUT) = ( +batch_d#OUT#_weights = vector(#size(OUT#_weights)); +batch_d#OUT#_biases = vector(#size(OUT#_biases)); +); +nn_fc_backward(OUT,IN) = ( +d#IN = mul(transpose(OUT#_weights,size(IN#)),d#OUT); +d#OUT#_weights = mul(d#OUT,IN#,size(IN#)); +batch_d#OUT#_weights+=d#OUT#_weights; +batch_d#OUT#_biases+=d#OUT; +); +nn_fc_end_backward(OUT) = ( +merge(batch_d#OUT#_weights,+); +merge(batch_d#OUT#_biases,+); +batch_d#OUT#_weights/=nn_batch_size; +batch_d#OUT#_biases/=nn_batch_size; +); +nn_nlfc_init_forward(OUT,IN) = ( +const OUT#_ind = $OUT#; +const OUT#_width = 1; +const OUT#_height = 1; +const OUT#_depth = 1; +const OUT#_spectrum = h##OUT#_ind; +OUT#_weights = crop(##OUT#_ind,0,0,size(IN#),h##OUT#_ind); +OUT#_biases = crop(##OUT#_ind,size(IN#),0,size(IN#),h##OUT#_ind); +); +nn_nlfc_forward(OUT,IN,activation) = ( +OUT# = vector(##OUT#_spectrum); +repeat(OUT#_spectrum,_nn_i, +_nn_res = 0; +repeat (size(IN#),_nn_j, +_nn_off = _nn_i*size(IN#) + _nn_j; +_nn_res+=nn_activation_#activation(OUT#_weights[_nn_off]*IN#[_nn_j] + OUT#_biases[_nn_off]); +); +OUT#[_nn_i] = _nn_res; +); +); +nn_nlfc_init_backward(OUT) = ( +batch_d#OUT#_weights = vector(#size(OUT#_weights)); +batch_d#OUT#_biases = vector(#size(OUT#_biases)); +); +nn_nlfc_backward(OUT,IN,activation) = ( +d#IN = vector(#size(IN#)); +repeat (size(IN#),_nn_j, +_nn_res = _nn_off = 0; +repeat (OUT#_spectrum,_nn_i, +_nn_off = _nn_i*size(IN#) + _nn_j; +_nn_Wij = OUT#_weights[_nn_off]; +_nn_res+=nn_activation_d_#activation(_nn_Wij*IN#[_nn_j] + OUT#_biases[_nn_off])*_nn_Wij*d#OUT[_nn_i]; +); +d#IN[_nn_j] = _nn_res; +); +d#OUT#_weights = vector(#size(OUT#_weights)); +d#OUT#_biases = vector(#size(OUT#_biases)); +_nn_ptr = 0; +repeat (OUT#_spectrum,_nn_i, +repeat (size(IN#),_nn_j, +_nn_off = _nn_i*size(IN#) + _nn_j; +_nn_Wij = OUT#_weights[_nn_off]; +_nn_sigmad = nn_activation_d_#activation(_nn_Wij*IN#[_nn_j] + OUT#_biases[_nn_off]); +d#OUT#_weights[_nn_ptr] = _nn_sigmad*IN#[_nn_j]*d#OUT[_nn_i]; +d#OUT#_biases[_nn_ptr] = _nn_sigmad*d#OUT#[_nn_i]; +++_nn_ptr; +); +); +batch_d#OUT#_weights+=d#OUT#_weights; +batch_d#OUT#_biases+=d#OUT#_biases; +); +nn_nlfc_end_backward(OUT) = ( +merge(batch_d#OUT#_weights,+); +merge(batch_d#OUT#_biases,+); +batch_d#OUT#_weights/=nn_batch_size; +batch_d#OUT#_biases/=nn_batch_size; +); +nn_input_init_forward(OUT,w,h,d,s) = ( +const OUT#_width = w; +const OUT#_height = h; +const OUT#_depth = d; +const OUT#_spectrum = s; +); +nn_maxpool2d_init_forward(OUT,IN,patch_size) = ( +const OUT#_width = int(IN#_width/patch_size); +const OUT#_height = int(IN#_height/patch_size); +const OUT#_depth = IN#_depth; +const OUT#_spectrum = IN#_spectrum; +const OUT#_patch_size = patch_size; +); +nn_maxpool2d_forward(OUT,IN) = ( +OUT# = vector(##OUT#_width*OUT#_height*OUT#_depth*OUT#_spectrum); +OUT#_from = vector(#size(OUT#)); +_nn_off = 0; +repeat (OUT#_spectrum,_nn_c, +repeat (OUT#_depth,_nn_z, +repeat (OUT#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (OUT#_width,_nn_x, +OUT#_patch = crop(IN#,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +_nn_x*OUT#_patch_size,_nn_yp,_nn_z,_nn_c, +OUT#_patch_size,OUT#_patch_size,1,1); +_nn_argmax = argmax(OUT#_patch); +OUT#[_nn_off] = OUT#_patch[_nn_argmax]; +OUT#_from[_nn_off++] = _nn_argmax; +); +); +); +); +); +nn_maxpool2d_backward(OUT,IN) = ( +d#IN = vector(#size(IN#)); +_nn_offOUT = 0; +repeat (OUT#_spectrum,_nn_c, +repeat (OUT#_depth,_nn_z, +_nn_offIN0 = IN#_width*IN#_height*(_nn_z + IN#_depth*_nn_c); +repeat (OUT#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (OUT#_width,_nn_x, +_nn_from = OUT#_from[_nn_offOUT]; +_nn_from_x = _nn_from%OUT#_patch_size; +_nn_from_y = int(_nn_from/OUT#_patch_size); +_nn_offIN = _nn_offIN0 + _nn_x*OUT#_patch_size + _nn_from_x + IN#_width*(_nn_yp + _nn_from_y); +d#IN[_nn_offIN] = d#OUT[_nn_offOUT++]; +); +); +); +); +); +nn_maxpool3d_init_forward(OUT,IN,patch_size) = ( +const OUT#_width = int(IN#_width/patch_size); +const OUT#_height = int(IN#_height/patch_size); +const OUT#_depth = int(IN#_depth/patch_size); +const OUT#_spectrum = IN#_spectrum; +const OUT#_patch_size = patch_size; +); +nn_maxpool3d_forward(OUT,IN) = ( +OUT# = vector(##OUT#_width*OUT#_height*OUT#_depth*OUT#_spectrum); +OUT#_from = vector(#size(OUT#)); +_nn_off = 0; +repeat (OUT#_spectrum,_nn_c, +repeat (OUT#_depth,_nn_z, +_nn_zp = _nn_z*OUT#_patch_size; +repeat (OUT#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (OUT#_width,_nn_x, +OUT#_patch = crop(IN#,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +_nn_x*OUT#_patch_size,_nn_yp,_nn_zp,_nn_c, +OUT#_patch_size,OUT#_patch_size,OUT#_patch_size,1); +_nn_argmax = argmax(OUT#_patch); +OUT#[_nn_off] = OUT#_patch[_nn_argmax]; +OUT#_from[_nn_off++] = _nn_argmax; +); +); +); +); +); +nn_maxpool3d_backward(OUT,IN) = ( +d#IN = vector(#size(IN#)); +_nn_offOUT = 0; +repeat (OUT#_spectrum,_nn_c, +_nn_offIN0 = IN#_width*IN#_height*IN#_depth*_nn_c; +repeat (OUT#_depth,_nn_z, +_nn_zp = _nn_z*OUT#_patch_size; +repeat (OUT#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (OUT#_width,_nn_x, +_nn_from = OUT#_from[_nn_offOUT]; +_nn_from_x = _nn_from%OUT#_patch_size; +_nn_from_y = int(_nn_from/OUT#_patch_size)%OUT#_patch_size; +_nn_from_z = int(_nn_from/OUT#_patch_size^2); +_nn_offIN = _nn_offIN0 + _nn_x*OUT#_patch_size + _nn_from_x + +IN#_width*(_nn_yp + _nn_from_y + IN#_height*(_nn_zp + _nn_from_z)); +d#IN[_nn_offIN] = d#OUT[_nn_offOUT++]; +); +); +); +); +); +nn_mul_init_forward(OUT,IN) = ( +const OUT#_width = IN#_width; +const OUT#_height = IN#_height; +const OUT#_depth = IN#_depth; +const OUT#_spectrum = IN#_spectrum; +); +nn_mul_forward(OUT,IN0,IN1) = ( +OUT# = IN0#*IN1#; +); +nn_mul_backward(OUT,IN0,IN1) = ( +d#IN0 = IN1#*d#OUT; +d#IN1 = IN0#*d#OUT; +); +nn_nl_init_forward(OUT,IN) = ( +const OUT#_width = IN#_width; +const OUT#_height = IN#_height; +const OUT#_depth = IN#_depth; +const OUT#_spectrum = IN#_spectrum; +); +nn_nl_forward(OUT,IN,activation) = ( +OUT# = vector(#size(IN#)); +fill(OUT#,_nn_k,OUT#[_nn_k] = nn_activation_#activation(IN#[_nn_k])); +); +nn_nl_backward(OUT,IN,activation) = ( +d#IN = vector(#size(IN#)); +fill(d#IN,_nn_k,d#OUT[_nn_k]*nn_activation_d_#activation(IN#[_nn_k])); +); +nn_softmax_forward(OUT,IN) = ( +OUT# = exp(IN# - max(IN#)); +OUT#/=sum(OUT#); +); +nn_softmax_backward(OUT,IN) = ( +d#IN = d#OUT - dot(d#OUT,OUT#); +d#IN*=OUT#; +); +nn_normalize_init_forward(OUT,IN,is_channelwise) = ( +const OUT#_ind = $OUT#; +const OUT#_width = IN#_width; +const OUT#_height = IN#_height; +const OUT#_depth = IN#_depth; +const OUT#_spectrum = IN#_spectrum; +const OUT#_is_channelwise = is_channelwise; +OUT#_is_channelwise?( # Channel-by-channel normalization +OUT#_alpha = crop(##OUT#_ind,0,1); +OUT#_beta = crop(##OUT#_ind,1,1); +OUT#_avg = crop(##OUT#_ind,2,1); +OUT#_var = crop(##OUT#_ind,3,1); +):( +OUT#_alpha = i[##OUT#_ind,0]; +OUT#_beta = i[##OUT#_ind,1]; +OUT#_avg = i[##OUT#_ind,2]; +OUT#_var = i[##OUT#_ind,3]; +); +OUT#_std = sqrt(OUT#_var); +OUT#_std+=1e-8; +); +nn_normalize_forward(OUT,IN) = ( +OUT#_is_channelwise?( # Channel-by-channel normalization +const OUT#_whd = OUT#_width*OUT#_height*OUT#_depth; +OUT#_hat = vector(#size(IN#)); +OUT# = vector(#size(IN#)); +repeat (size(OUT#_avg),_nn_k, +OUT#_tmp = IN#[_nn_k*OUT#_whd,OUT#_whd] - OUT#_avg[_nn_k]; # One channel of IN +OUT#_tmp/=OUT#_std[_nn_k]; +copy(OUT#_hat[_nn_k*OUT#_whd],OUT#_tmp); +OUT#_tmp*=OUT#_alpha[_nn_k]; +OUT#_tmp+=OUT#_beta[_nn_k]; +copy(OUT#[_nn_k*OUT#_whd],OUT#_tmp); +); +):( +OUT#_hat = IN# - OUT#_avg; +OUT#_hat/=OUT#_std; +OUT# = OUT#_hat*OUT#_alpha; +OUT#+=OUT#_beta; +); +); +nn_normalize_init_backward(OUT) = ( +OUT#_is_channelwise?( # Channel-by-channel normalization +batch_d#OUT#_alpha = vector(#size(OUT#_avg)); +batch_d#OUT#_beta = vector(#size(OUT#_avg)); +batch_#OUT#_avg = vector(#size(OUT#_avg)); +batch_#OUT#_var = vector(#size(OUT#_avg)); +):( +batch_d#OUT#_alpha = batch_d#OUT#_beta = batch_#OUT#_avg = batch_#OUT#_var = 0; +); +); +nn_normalize_backward(OUT,IN) = ( +OUT#_is_channelwise?( # Channel-by-channel normalization +d#IN = vector(#size(IN#)); +repeat (size(#OUT#_avg),_nn_k, +OUT#_tmp = d#OUT[_nn_k*OUT#_whd,OUT#_whd]; # One channel of dOUT +copy(d#IN[_nn_k*OUT#_whd],OUT#_tmp*OUT#_alpha[_nn_k]/OUT#_std[_nn_k]); +batch_d#OUT#_alpha[_nn_k]+=dot(OUT#_tmp,OUT#_hat[_nn_k*OUT#_whd,OUT#_whd]); +batch_d#OUT#_beta[_nn_k]+=sum(OUT#_tmp); +OUT#_tmp = IN#[_nn_k*OUT#_whd,OUT#_whd]; # One channel of IN +batch_#OUT#_avg[_nn_k]+=avg(OUT#_tmp); +batch_#OUT#_var[_nn_k]+=var(OUT#_tmp); +); +):( +d#IN = d#OUT*OUT#_alpha/OUT#_std; +batch_d#OUT#_alpha+=dot(d#OUT,OUT#_hat); +batch_d#OUT#_beta+=sum(d#OUT); +batch_#OUT#_avg+=avg(IN#); +batch_#OUT#_var+=var(IN#); +); +); +nn_normalize_end_backward(OUT) = ( +merge(batch_d#OUT#_alpha,+); +merge(batch_d#OUT#_beta,+); +merge(batch_#OUT#_avg,+); +merge(batch_#OUT#_var,+); +batch_d#OUT#_alpha/=nn_batch_size; +batch_d#OUT#_beta/=nn_batch_size; +batch_#OUT#_avg/=nn_batch_size; +batch_#OUT#_var/=nn_batch_size; +); +nn_patchdown2d_init_forward(OUT,IN,patch_size) = ( +const OUT#_width = int(IN#_width/patch_size); +const OUT#_height = int(IN#_height/patch_size); +const OUT#_depth = IN#_depth; +const OUT#_spectrum = IN#_spectrum*patch_size^2; +const OUT#_patch_size = patch_size; +); +nn_patchdown2d_forward(OUT,IN) = ( +OUT# = vector(##OUT#_width*OUT#_height*OUT#_depth*OUT#_spectrum); +repeat (OUT#_depth,_nn_z, +repeat (OUT#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (OUT#_width,_nn_x, +draw(OUT#,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +crop(IN#,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +_nn_x*OUT#_patch_size,_nn_yp,_nn_z, +OUT#_patch_size,OUT#_patch_size,1), +_nn_x,_nn_y,_nn_z,1,1,1); +); +); +); +); +nn_patchdown2d_backward(OUT,IN) = ( +d#IN = vector(#size(IN#)); +repeat (OUT#_depth,_nn_z, +repeat (OUT#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (OUT#_width,_nn_x, +draw(d#IN#,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +crop(d#OUT,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum,_nn_x,_nn_y,_nn_z,1,1,1), +_nn_x*OUT#_patch_size,_nn_yp,_nn_z, +OUT#_patch_size,OUT#_patch_size,1); +); +); +); +); +nn_patchdown3d_init_forward(OUT,IN,patch_size) = ( +const OUT#_width = int(IN#_width/patch_size); +const OUT#_height = int(IN#_height/patch_size); +const OUT#_depth = int(IN#_depth/patch_size); +const OUT#_spectrum = IN#_spectrum*patch_size^3; +const OUT#_patch_size = patch_size; +); +nn_patchdown3d_forward(OUT,IN) = ( +OUT# = vector(##OUT#_width*OUT#_height*OUT#_depth*OUT#_spectrum); +repeat (OUT#_depth,_nn_z, +_nn_zp = _nn_z*OUT#_patch_size; +repeat (OUT#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (OUT#_width,_nn_x, +draw(OUT#,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +crop(IN#,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +_nn_x*OUT#_patch_size,_nn_yp,_nn_zp, +OUT#_patch_size,OUT#_patch_size,OUT#_patch_size), +_nn_x,_nn_y,_nn_z,1,1,1); +); +); +); +); +nn_patchdown3d_backward(OUT,IN) = ( +d#IN = vector(#size(IN#)); +repeat (OUT#_depth,_nn_z, +_nn_zp = _nn_z*OUT#_patch_size; +repeat (OUT#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (OUT#_width,_nn_x, +draw(d#IN#,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +crop(d#OUT,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum,_nn_x,_nn_y,_nn_z,1,1,1), +_nn_x*OUT#_patch_size,_nn_yp,_nn_zp, +OUT#_patch_size,OUT#_patch_size,OUT#_patch_size); +); +); +); +); +nn_patchup2d_init_forward(OUT,IN,patch_size) = ( +const OUT#_width = IN#_width*patch_size; +const OUT#_height = IN#_height*patch_size; +const OUT#_depth = IN#_depth; +const OUT#_spectrum = IN#_spectrum/patch_size^2; +const OUT#_patchsize = patch_size; +); +nn_patchup2d_forward(OUT,IN) = ( +OUT# = vector(##OUT#_width*OUT#_height*OUT#_depth*OUT#_spectrum); +repeat (IN#_depth,_nn_z, +repeat (IN#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (IN#_width,_nn_x, +draw(OUT#,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +crop(#IN,IN#_width,IN#_height,IN#_depth,IN#_spectrum,_nn_x,_nn_y,_nn_z,1,1,1), +_nn_x*OUT#_patch_size,_nn_yp,_nn_z, +OUT#_patch_size,OUT#_patch_size,1); +); +); +); +); +nn_patchup2d_backward(OUT,IN) = ( +d#IN = vector(#size(IN#)); +repeat (IN#_depth,_nn_z, +repeat (IN#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (IN#_width,_nn_x, +draw(d#IN,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +crop(d#OUT,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +_nn_x*OUT#_patch_size,_nn_yp,_nn_z, +OUT#_patch_size,OUT#_patch_size,1), +_nn_x,_nn_y,_nn_z,1,1,1); +); +); +); +); +nn_patchup3d_init_forward(OUT,IN,patch_size) = ( +const OUT#_width = IN#_width*patch_size; +const OUT#_height = IN#_height*patch_size; +const OUT#_depth = IN#_depth*patch_size; +const OUT#_spectrum = IN#_spectrum/patch_size^3; +const OUT#_patch_size = patch_size; +); +nn_patchup3d_forward(OUT,IN) = ( +OUT# = vector(##OUT#_width*OUT#_height*OUT#_depth*OUT#_spectrum); +repeat (IN#_depth,_nn_z, +_nn_zp = _nn_z*OUT#_patch_size; +repeat (IN#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (IN#_width,_nn_x, +draw(OUT#,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +crop(#IN,IN#_width,IN#_height,IN#_depth,IN#_spectrum,_nn_x,_nn_y,_nn_z,1,1,1), +_nn_x*OUT#_patch_size,_nn_yp,_nn_zp, +OUT#_patch_size,OUT#_patch_size,OUT#_patch_size); +); +); +); +); +nn_patchup3d_backward(OUT,IN) = ( +d#IN = vector(#size(IN#)); +repeat (IN#_depth,_nn_z, +_nn_zp = _nn_z*OUT#_patch_size; +repeat (IN#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (IN#_width,_nn_x, +draw(d#IN,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +crop(d#OUT,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +_nn_x*OUT#_patch_size,_nn_yp,_nn_zp, +OUT#_patch_size,OUT#_patch_size,OUT#_patch_size), +_nn_x,_nn_y,_nn_z,1,1,1); +); +); +); +); +nn_rename_init_forward(OUT,IN) = ( +const OUT#_width = IN#_width; +const OUT#_height = IN#_height; +const OUT#_depth = IN#_depth; +const OUT#_spectrum = IN#_spectrum; +ref(IN#,OUT#); +); +nn_rename_backward(OUT,IN) = ( +ref(d#OUT,d#IN); +); +nn_reshape_init_forward(OUT,IN,w,h,d,s) = ( +const OUT#_width = w; +const OUT#_height = h; +const OUT#_depth = d; +const OUT#_spectrum = s; +ref(IN#,OUT#); +); +nn_reshape_init_backward(OUT,IN) = ( +ref(d#OUT,d#IN); +); +nn_resize_init_forward(OUT,IN,w,h,d,s,interpolation) = ( +const OUT#_width = w; +const OUT#_height = h; +const OUT#_depth = d; +const OUT#_spectrum = s; +const OUT#_interpolation = interpolation; +); +nn_resize_forward(OUT,IN) = ( +OUT# = resize(IN#, +IN#_width,IN#_height,IN#_depth,IN#_spectrum, +OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +OUT#_interpolation); +); +nn_resize_backward(OUT,IN) = ( +d#IN = resize(d#OUT, +OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +IN#_width,IN#_height,IN#_depth,IN#_spectrum, +2); +); +nn_run_init_forward(OUT,IN,command,w,h,d,s) = ( +const OUT#_width = w; +const OUT#_height = h; +const OUT#_depth = d; +const OUT#_spectrum = s; +OUT#_varname = 'nn_#OUT'; +OUT#_pipeline = string('l[] { $nn_#IN ',command,' k. r ', +OUT#_width,',',OUT#_height,',',OUT#_depth,',',OUT#_spectrum, +',3 k. store ',OUT#_varname,' }'); +); +nn_run_forward(OUT,IN) = ( +critical( +store('nn_#IN',IN#,IN#_width,IN#_height,IN#_depth,IN#_spectrum); +run(OUT#_pipeline); +OUT# = get(OUT#_varname,OUT#_width*OUT#_height*OUT#_depth*OUT#_spectrum); +); +); +nn_run_backward(OUT,IN) = ( +d#IN = resize(d#OUT, +OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +IN#_width,IN#_height,IN#_depth,IN#_spectrum, +3); +); +nn_split_init_forward(OUT0,OUT1,IN,nb_channels0) = ( +const OUT0#_width = IN#_width; +const OUT0#_height = IN#_height; +const OUT0#_depth = IN#_depth; +const OUT0#_spectrum = nb_channels0; +const OUT1#_width = IN#_width; +const OUT1#_height = IN#_height; +const OUT1#_depth = IN#_depth; +const OUT1#_spectrum = IN#_spectrum - nb_channels0; +); +nn_split_forward(OUT0,OUT1,IN) = ( +const OUT0#_siz0 = OUT0#_width*OUT0#_height*OUT0#_depth*OUT0#_spectrum; +OUT0# = IN#[0,OUT0#_siz0]; +OUT1# = IN#[OUT0#_siz0,OUT1#_width*OUT1#_height*OUT1#_depth*OUT1#_spectrum]; +); +nn_split_backward(OUT0,OUT1,IN) = ( +d#IN = vector(#size(IN#)); +copy(d#IN,d#OUT0,size(OUT0#)); +copy(d#IN[size(OUT0#)],d#OUT1,size(OUT1#)); +); +nn_loss_binary_crossentropy_init_forward(L) = ( +batch_#L = 0; +); +nn_loss_binary_crossentropy_forward(L,IN,TRUTH) = ( +L#_epsiloned = IN# + 1e-5; +L#_epsiloned1 = 1 - IN# + 1e-5; +L# = -sum(TRUTH*log(L#_epsiloned) + (1 - TRUTH)*log(L#_epsiloned1)); +batch_#L+=L#; +); +nn_loss_binary_crossentropy_end_forward(L) = ( +merge(batch_#L,+); +batch_#L/=nn_batch_size; +L# = batch_#L; +); +nn_loss_binary_crossentropy_backward(L,IN,TRUTH) = ( +d#IN = (IN# - TRUTH)/(L#_epsiloned*L#_epsiloned1); +); +nn_loss_crossentropy_init_forward(L) = ( +batch_#L = 0; +); +nn_loss_crossentropy_forward(L,IN,TRUTH) = ( +L#_epsiloned = IN# + 1e-8; +L# = -sum(TRUTH*log(L#_epsiloned)); +batch_#L+=L#; +); +nn_loss_crossentropy_end_forward(L) = ( +merge(batch_#L,+); +batch_#L/=nn_batch_size; +L# = batch_#L; +); +nn_loss_crossentropy_backward(L,IN,TRUTH) = ( +d#IN = -TRUTH/L#_epsiloned; +); +nn_loss_mse_init_forward(L) = ( +batch_#L = 0; +); +nn_loss_mse_forward(L,IN,TRUTH) = ( +d#IN = IN# - TRUTH; +L# = norm(d#IN)^2/size(d#IN); +batch_#L+=L#; +); +nn_loss_mse_end_forward(L) = ( +merge(batch_#L,+); +batch_#L/=nn_batch_size; +L# = batch_#L; +); +nn_loss_mse_backward(L,IN,TRUTH) = ( +d#IN*=2; +); +nn_loss_normp_init_forward(L,metric) = ( +const L#_metric = metric; +batch_#L = 0; +); +nn_loss_normp_forward(L,IN,TRUTH) = ( +d#IN = IN# - TRUTH; +L# = (!L#_metric?norm(d#IN)^2:norm#L#_metric(d#IN))/size(d#IN); +batch_#L+=L#; +); +nn_loss_normp_end_forward(L) = ( +merge(batch_#L,+); +batch_#L/=nn_batch_size; +L# = batch_#L; +); +nn_loss_normp_backward(L,IN,TRUTH) = ( +!L#_metric?( # L2-squared +d#IN*=2; +):L#_metric==2?( # L2 +d#IN/=(1e-8 + L#); +):( +d#IN = (abs(d#IN)/(1e-8 + L#))^(L#_metric - 1)*sign(d#IN); +); +); +nn_loss_softmax_crossentropy_init_forward(L) = ( +batch_#L = 0; +); +nn_loss_softmax_crossentropy_forward(L,IN,TRUTH) = ( +L#_softmax = exp(IN# - max(IN#)); +L#_softmax/=sum(L#_softmax); +L#_softmax+=1e-8; +L# = -sum(TRUTH*log(L#_softmax)); +d#IN = L#_softmax - TRUTH; +batch_#L+=L#; +); +nn_loss_softmax_crossentropy_end_forward(L) = ( +merge(batch_#L,+); +batch_#L/=nn_batch_size; +L# = batch_#L; +); +nn_loss_softmax_crossentropy_backward(L,IN,TRUTH) = ( +L#_softmax = exp(IN# - max(IN#)); +L#_softmax/=sum(L#_softmax); +L#_softmax+=1e-8; +L# = -sum(TRUTH*log(L#_softmax)); +d#IN = L#_softmax - TRUTH; +batch_#L+=L#; +);" +#@cli nn_init +#@cli : Initialize a new network. +nn_init : +e[^-1] "[nn_lib] Initialize new network." +_nn_modules_names,_nn_modules_types,_nn_trainer_data,_nn_forward,_nn_loss,_nn_backward,_nn_update,_nn_latest= +_nn_init="$0 " +#@cli nn_check_layer : name +#@cli : Check that the layer with specified name already exists in the network. +nn_check_layer : +if !isvarname('"$1"') +error[0--3] "Command 'nn_check_layer': Invalid layer name '$1'." +elif narg($_nn_$1_size)!=4 +error[0--3] "Command 'nn_check_layer': Layer with name '$1' does not exist." +fi +#@cli nn_add : out,in0,_in1 +#@cli : Add an 'add' layer to the network. +#@cli : Default value: 'in1=. (previous layer)'. +nn_add : if ['$2']=='.' in0=$_nn_latest else in0=$2 fi nn_check_layer $in0 +if ['${3=.}']=='.' in1=$_nn_latest else in1=$3 fi nn_check_layer $in1 +check "isvarname('$1') && "[${_nn_${in0}_size}]==[${_nn_${in1}_size}] +e[^-1] "[nn_lib] Add 'add' layer '$1', with inputs '"$in0"' and '"$in1"'." +_nn_modules_names.=$1, +_nn_modules_types.=add, +_nn_$1_size=${_nn_${in0}_size} +_nn_$1_input=$in0,$in1 +_nn_forward.="begin(nn_add_init_forward($1,"$in0"));""nn_add_forward($1,"$in0","$in1");" +_nn_backward..="nn_add_backward($1,"$in0","$in1");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_append : out,in0,_in1 +#@cli : Add an 'append' layer to the network. +#@cli : Default value: 'in1=. (previous layer)'. +nn_append : if ['$2']=='.' in0=$_nn_latest else in0=$2 fi nn_check_layer $in0 +if ['${3=.}']=='.' in1=$_nn_latest else in1=$3 fi nn_check_layer $in1 +check "isvarname('$1') && "[${_nn_${in0}_size}][0,3]==[${_nn_${in1}_size}][0,3] +e[^-1] "[nn_lib] Add 'append' layer '$1', with inputs '"$in0"' and '"$in1"'." +_nn_modules_names.=$1, +_nn_modules_types.=append, +_nn_$1_size:=[${_nn_${in0}_size}]+[0,0,0,[${_nn_${in1}_size}][3]] +_nn_$1_input=$in0,$in1 +_nn_forward.="begin(nn_append_init_forward($1,"$in0","$in1"));""nn_append_forward($1,"$in0","$in1");" +_nn_backward..="nn_append_backward($1,"$in0","$in1");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_avgpool2d : out,_in,_patch_size>1 +#@cli : Add a 'avgpool2d' layer (2D average pooling) to the network. +#@cli : Default value: 'in=. (previous layer)'. +nn_avgpool2d : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=2}) && $3>1" +e[^-1] "[nn_lib] Add 'avgpool2d' layer '$1', with input '"$in"' and patch size $3x$3." +_nn_modules_names.=$1, +_nn_modules_types.=avgpool2d, +_nn_$1_size:=s=[${_nn_${in}_size}];[int(s[0,2]/$3),s[2,2]] +_nn_$1_input=$in +_nn_$1_properties="patch_size=$3x$3" +_nn_forward.="begin(nn_avgpool2d_init_forward($1,"$in",$3));""nn_avgpool2d_forward($1,"$in");" +_nn_backward..="nn_avgpool2d_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_avgpool3d : out,_in,_patch_size>1 +#@cli : Add a 'avgpool3d' layer (3D average pooling) to the network. +#@cli : Default value: 'in=. (previous layer)'. +nn_avgpool3d : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=2}) && $3>1" +e[^-1] "[nn_lib] Add 'avgpool3d' layer '$1', with input '"$in"' and patch size $3x$3x$3." +_nn_modules_names.=$1, +_nn_modules_types.=avgpool3d, +_nn_$1_size:=s=[${_nn_${in}_size}];[int(s[0,3]/$3),s[3]] +_nn_$1_input=$in +_nn_$1_properties="patch_size=$3x$3x$3" +_nn_forward.="begin(nn_avgpool3d_init_forward($1,"$in",$3));""nn_avgpool3d_forward($1,"$in");" +_nn_backward..="nn_avgpool3d_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_clone : name0,name1,_in +#@cli : Add a 'clone' layer to the network. +#@cli : Default value: 'in=. (previous layer)'. +nn_clone : if ['${3=.}']=='.' in=$_nn_latest else in=$3 fi nn_check_layer $in +check "isvarname('$1') && isvarname('$2')" +e[^-1] "[nn_lib] Add 'clone' layer with input '"$in"' and outputs '$1' and '$2'." +_nn_modules_names.=$1,$2, +_nn_modules_types.=clone,clone, +_nn_$1_size=${_nn_${in}_size} +_nn_$2_size=${_nn_${in}_size} +_nn_$1_input,_nn_$2_input=$in +_nn_forward.="begin(nn_clone_init_forward($1,$2,"$in"));""nn_clone_forward($1,$2,"$in");" +_nn_backward..="nn_clone_backward($1,$2,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_conv2d : out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation,_border_shrink>=0,_boundary_conditions,0<=_learning_mode<=3 +#@cli : Add a 'conv2d' layer (2D convolutional layer) to the network. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : 'learning_mode' can be { 0=no learning | 1=weights only | 2=biases only | 3=weights+biases }. +#@cli : Default values: 'kernel_size=3', 'stride=1', 'dilation=1', 'border_shrink=0', 'boundary_conditions=1' and 'learning_mode=3'. +nn_conv2d : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint($3) && $3>0 && isint(${4=3}) && $4>0 && ""${5=1}>0 && isint(${7=0}) && $7>=0 && ""isint(${8=1}) && inrange($8,0,3) && isint(${9=3}) && inrange($9,0,3)" skip "${6=1}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'conv2d' layer '$1', with input '"$in"', $3 channels, $4x$4 kernels, stride $5, dilation $6, ""border shrink $7 and "$s$8" boundary conditions." +init=$_nn_init +_nn_conv2d $1_conv2d,$in,${3-9} +nn_rename $1,$1_conv2d +_nn_init=${init}"$0 $* " +_nn_latest=$1 +_nn_conv2d : +_nn_modules_names.=$1, +_nn_modules_types.=conv2d, +_nn_$1_size:=s=[$_nn_$2_size];[int(s[0,2]/$5)-2*$7,s[2],$3] +_nn_$1_learning_mode=$9 +_nn_$1_input=$2 +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +_nn_$1_properties="kernel=$4x$4, stride=$5, dilation=$6, border_shrink=$7, boundary_conditions="$s$8", ""learning_mode=$9" +if !isint($$1) +{[$_nn_$2_size][3]*$4^2+1},$3,1,1,4*g/(w-1) +if $9<2 1,100% j.. .,100% rm. fi +=> $1 +fi +_nn_forward.="begin(nn_conv2d_init_forward($1,$2,${4-8}));""nn_conv2d_forward($1,$2);" +_nn_backward..="begin(nn_conv2d_init_backward($1,$2));""nn_conv2d_backward($1,$2);""end(nn_conv2d_end_backward($1));" +_nn_init.="$0 $* " +#@cli nn_conv2dnl : out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation>0,_border_shrink>=0,_boundary_conditions,_activation,0<=_learning_mode<=3 +#@cli : Add a 'conv2dnl' (2D convolutional layer followed by a non-linearity) to the network. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : 'learning_mode' can be { 0=no learning | 1=weights only | 2=biases only | 3=weights+biases }. +#@cli : Default values: 'kernel_size=3', 'stride=1', 'dilation=1', 'border_shrink=0', 'boundary_conditions=1', 'activation=leakyrelu' and 'learning_mode=3'. +nn_conv2dnl : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint($3) && $3>0 && isint(${4=3}) && $4>0 && ${5=1}>0 && ""isint(${7=0}) && $7>=0 && isint(${8=1}) && inrange($8,0,3) && isint(${10=3}) && inrange($10,0,3)" +skip "${6=1}","${9=leakyrelu}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'conv2d+nl' layer '$1', with input '"$in"', $3 channels, $4x$4 kernels, ""stride $5, dilation $6, border shrink $7, "$s$8" boundary conditions and '$9' activation." +init=$_nn_init +_nn_conv2d $1_conv2d,$in,${3-8},$10 +nn_nl $1,$1_conv2d,$9 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_conv2dnnl : out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation>0,_border_shrink>=0,_boundary_conditions,_activation,0<=_learning_mode<=3 +#@cli : Add a 'conv2dnnl' (2D convolutional layer followed by a normalization layer, then a non-linearity) to the network. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : 'learning_mode' can be { 0=no learning | 1=weights only | 2=biases only | 3=weights+biases }. +#@cli : Default values: 'kernel_size=3', 'stride=1', 'dilation=1', 'border_shrink=0', 'boundary_conditions=1', 'activation=leakyrelu' and 'learning_mode=3'. +nn_conv2dnnl : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint($3) && $3>0 && isint(${4=3}) && $4>0 && ${5=1}>0 && ""isint(${7=0}) && $7>=0 && isint(${8=1}) && inrange($8,0,3) && isint(${10=3}) && inrange($10,0,3)" +skip "${6=1}","${9=leakyrelu}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'conv2d+normalize+nl' layer '$1', with input '"$in"', $3 channels, $4x$4 kernels, ""stride $5, dilation $6, border shrink $7, "$s$8" boundary conditions and '$9' activation." +init=$_nn_init +_nn_conv2d $1_conv2d,$in,${3-8},$10 +_nn_normalize $1_normalize,$1_conv2d,1,3 +nn_nl $1,$1_normalize,$9 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_conv3d : out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation,_border_shrink>=0,_boundary_conditions,0<=_learning_mode<=3 +#@cli : Add a 'conv3d' layer (3D convolutional layer) to the network. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : 'learning_mode' can be { 0=no learning | 1=weights only | 2=biases only | 3=weights+biases }. +#@cli : Default values: 'kernel_size=3', 'stride=1', 'dilation=1', 'border_shrink=0', 'boundary_conditions=1' and 'learning_mode=3'. +nn_conv3d : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint($3) && $3>0 && isint(${4=3}) && $4>0 && ""${5=1}>0 && isint(${7=0}) && $7>=0 && ""isint(${8=1}) && inrange($8,0,3) && isint(${9=3}) && inrange($9,0,3)" skip "${6=1}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'conv3d' layer '$1', with input '"$in"', $3 channels, $4x$4x$4 kernels, stride $5, ""dilation $6, border shrink $7 and "$s$8" boundary conditions." +init=$_nn_init +_nn_conv3d $1_conv3d,$in,${3-9} +nn_rename $1,$1_conv3d +_nn_init=${init}"$0 $* " +_nn_latest=$1 +_nn_conv3d : +_nn_modules_names.=$1, +_nn_modules_types.=conv3d, +_nn_$1_size:=s=[$_nn_$2_size];[int(s[0,3]/$5)-2*$7,$3] +_nn_$1_learning_mode=$9 +_nn_$1_input=$2 +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +_nn_$1_properties="kernel=$4x$4x$4, stride=$5, dilation=$6, border_shrink=$7, boundary_conditions="$s$8", ""learning_mode=$9" +if !isint($$1) +{[$_nn_$2_size][3]*$4^3+1},$3,1,1,4*g/(w-1) +if $9<2 1,100% j.. .,100% rm. fi +=> $1 +fi +_nn_forward.="begin(nn_conv3d_init_forward($1,$2,${4-8}));""nn_conv3d_forward($1,$2);" +_nn_backward..="begin(nn_conv3d_init_backward($1,$2));""nn_conv3d_backward($1,$2);""end(nn_conv3d_end_backward($1));" +_nn_init.="$0 $* " +#@cli nn_conv3dnl : out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation>0,_border_shrink>=0,_boundary_conditions,_activation,0<=_learning_mode<=3 +#@cli : Add a 'conv3dnl' (3D convolutional layer followed by a non-linearity) to the network. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : 'learning_mode' can be { 0=no learning | 1=weights only | 2=biases only | 3=weights+biases }. +#@cli : Default values: 'kernel_size=3', 'stride=1', 'dilation=1', 'border_shrink=0', 'boundary_conditions=1', 'activation=leakyrelu' and 'learning_mode=3'. +nn_conv3dnl : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint($3) && $3>0 && isint(${4=3}) && $4>0 && ${5=1}>0 && ""isint(${7=0}) && $7>=0 && isint(${8=1}) && inrange($8,0,3) && isint(${10=3}) && inrange($10,0,3)" +skip "${6=1}","${9=leakyrelu}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'conv3d+nl' layer '$1', with input '"$in"', $3 channels, $4x$4x$4 kernels, ""stride $5, dilation $6, border shrink $7, "$s$8" boundary conditions and '$9' activation." +init=$_nn_init +_nn_conv3d $1_conv3d,$in,${3-8},$10 +nn_nl $1,$1_conv3d,$9 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_conv3dnnl : out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation>0,_border_shrink>=0,_boundary_conditions,_activation,0<=_learning_mode<=3 +#@cli : Add a 'conv3dnnl' (3D convolutional layer followed by a normalization layer, then a non-linearity) to the network. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : 'learning_mode' can be { 0=no learning | 1=weights only | 2=biases only | 3=weights+biases }. +#@cli : Default values: 'kernel_size=3', 'stride=1', 'dilation=1', 'border_shrink=0', 'boundary_conditions=1', 'activation=leakyrelu' and 'learning_mode=3'. +nn_conv3dnnl : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint($3) && $3>0 && isint(${4=3}) && $4>0 && ${5=1}>0 && ""isint(${7=0}) && $7>=0 && isint(${8=1}) && inrange($8,0,3) && isint(${10=3}) && inrange($10,0,3)" +skip "${6=1}","${9=leakyrelu}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'conv3d+normalize+nl' layer '$1', with input '"$in"', $3 channels, $4x$4x$4 kernels, ""stride $5, dilation $6, border shrink $7, "$s$8" boundary conditions and '$9' activation." +init=$_nn_init +_nn_conv3d $1_conv3d,$in,${3-8},$10 +_nn_normalize $1_normalize,$1_conv3d,1,3 +nn_nl $1,$1_normalize,$9 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_crop : out,in,x0,y0,z0,c0,x1,y1,z1,c1,_boundary_conditions +#@cli : Add a 'crop' layer to the network. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default value: 'boundary_conditions=0'. +nn_crop : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "inrange(${11=0},0,3) && min(isint([${3-11}]))" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^1] "[nn_lin] Add 'crop' layer '$1', with input '"$in"', coordinates (${3-6})-(${7-10}) and "$s$11" boundary conditions." +_nn_modules_names.=$1, +_nn_modules_types.=crop, +cmin={vmin([${3-6}],[${7-10}])} +cmax={vmax([${3-6}],[${7-10}])} +_nn_$1_size={[[$cmax]-[$cmin]+1]} +_nn_$1_input=$in +_nn_$1_properties="coordinates=(${3-6})x(${7-10})" +_nn_forward.="begin(nn_crop_init_forward($1,"$in",${3-11}));""nn_crop_forward($1,"$in");" +_nn_backward..="nn_crop_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_distance : out,in0,_in1,_metric={ 0=squared-L2 | p>0 = Lp-norm } +#@cli : Add a 'distance' layer to the network (distance between two inputs, with specified metric). +#@cli : Default value: 'in=. (previous layer)', +nn_distance : if ['$2']=='.' in0=$_nn_latest else in0=$2 fi nn_check_layer $in0 +if ['${3=.}']=='.' in1=$_nn_latest else in1=$3 fi nn_check_layer $in1 +check "isvarname('$1') && ${4=0}>=0 && "[${_nn_${in0}_size}]==[${_nn_${in1}_size}] +s0,s1="squared-L2 norm","L$4" +e[^-1] "[nn_lib] Add 'distance' layer '$1' ("${s{$4>0}}"), with inputs '"$in0"' and '"$in1"'." +_nn_modules_names.=$1, +_nn_modules_types.=distance, +_nn_$1_size=1,1,1,1 +_nn_$1_input=$in0,$in1 +_nn_$1_properties="metric="${s{$4>0}} +_nn_forward.="begin(nn_distance_init_forward($1,$4));""nn_distance_forward($1,"$in0","$in1");" +_nn_backward..="nn_distance_backward($1,"$in0","$in1");" +_nn_init.="$0 $*" +_nn_latest=$1 +#@cli nn_dropout : out,in,0<=dropout_rate<1 +#@cli : Add a 'dropout' layer to the network. +nn_dropout : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && inrange($3,0,1,1,0)" +e[^-1] "[nn_lib] Add 'dropout' layer '$1', with input '"$in"' and dropout rate $3." +_nn_modules_names.=$1, +_nn_modules_types.=dropout, +_nn_$1_size=${_nn_${in}_size} +_nn_$1_input=$in +_nn_$1_properties="dropout_rate=$3" +_nn_forward.="begin(nn_dropout_init_forward($1,"$in",$3));""nn_dropout_forward($1,"$in");" +_nn_backward..="nn_dropout_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_fc : out,in,nb_channels>0,0<=_learning_mode<=3 +#@cli : Add a 'fc' layer (fully connected layer) to the network. +#@cli : 'learning_mode' can be { 0=no learning | 1=weights only | 2=biases only | 3=weights+biases }. +#@cli : Default value: 'learning_mode=3'. +nn_fc : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint($3) && $3>0 && isint(${4=3}) && inrange($4,0,3)" +e[^-1] "[nn_lib] Add 'fc' layer '$1', with input '"$in"' and $3 channels." +init=$_nn_init +_nn_fc $1_fc,$in,${3-4} +nn_rename $1,$1_fc +_nn_init=${init}"$0 $* " +_nn_latest=$1 +_nn_fc : +_nn_modules_names.=$1, +_nn_modules_types.=fc, +_nn_$1_size=1,1,1,$3 +_nn_$1_learning_mode=$4 +_nn_$1_input=$2 +_nn_$1_properties="learning_mode=$4" +if !isint($$1) +{prod($_nn_$2_size)+1},$3 +f. 4*g/(w-1) +if $4<2 1,100% j.. .,100% rm. fi +=> $1 +fi +_nn_forward.="begin(nn_fc_init_forward($1,$2));""nn_fc_forward($1,$2);" +_nn_backward..="begin(nn_fc_init_backward($1));""nn_fc_backward($1,$2);""end(nn_fc_end_backward($1));" +_nn_init.="$0 $* " +#@cli nn_nlfc : out,in,nb_channels>0,_activation,0<=_learning_mode<=3 +#@cli : Add a 'nlfc' layer (nonlinear fully connected layer) to the network. +#@cli : 'learning_mode' can be { 0=no learning | 1=weights only | 2=biases only | 3=weights+biases }. +#@cli : Default values: 'activation=leakyrelu' and 'learning_mode=3'. +nn_nlfc : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint($3) && $3>0 && isint(${5=3}) && inrange($5,0,3)" +skip ${4=leakyrelu} +e[^-1] "[nn_lib] Add 'nlfc' layer '$1', with input '"$in"', $3 channels and '$4' activation." +init=$_nn_init +_nn_nlfc $1_nlfc,$in,${3-5} +nn_rename $1,$1_nlfc +_nn_init=${init}"$0 $* " +_nn_latest=$1 +_nn_nlfc : +_nn_modules_names.=$1, +_nn_modules_types.=nlfc, +_nn_$1_size=1,1,1,$3 +_nn_$1_learning_mode=$5 +_nn_$1_input=$2 +_nn_$1_properties="activation=$4, learning_mode=$5" +if !isint($$1) +{2*prod($_nn_$2_size)},$3 +f. 4*g/(w-1) +if $5<2 50%,100% j.. .,50% rm. fi +=> $1 +fi +_nn_forward.="begin(nn_nlfc_init_forward($1,$2));""nn_nlfc_forward($1,$2,$4);" +_nn_backward..="begin(nn_nlfc_init_backward($1));""nn_nlfc_backward($1,$2,$4);""end(nn_nlfc_end_backward($1));" +_nn_init.="$0 $* " +#@cli nn_fcnl : out,in,nb_neurons>0,_activation,0<=_learning_mode<=3 +#@cli : Add a 'fcnl' layer (fully connected layer followed by a non-linearity) to the network. +#@cli : 'learning_mode' can be { 0=no learning | 1=weights only | 2=biases only | 3=weights+biases }. +#@cli : Default values: 'activation=leakyrelu' and 'learning_mode=3'. +nn_fcnl : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint($3) && $3>0 && isint(${5=3}) && inrange($5,0,3)" +skip ${4=leakyrelu} +e[^-1] "[nn_lib] Add 'fc+nl' layer '$1' to the network, with input '"$in"', $3 channels and '$4' activation." +init=$_nn_init +_nn_fc $1_fc,$in,$3,$5 +nn_nl $1,$1_fc,$4 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_fcnnl : out,in,nb_neurons>0,_activation,0<=_learning_mode<=3 +#@cli : Add a 'fcnnl' layer (fully connected layer followed by a normalization layer, then a non-linearity) to the network. +#@cli : 'learning_mode' can be { 0=no learning | 1=weights only | 2=biases only | 3=weights+biases }. +#@cli : Default values: 'activation=leakyrelu' and 'learning_mode=3'. +nn_fcnnl : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint($3) && $3>0 && isint(${5=3})" +skip ${4=leakyrelu} +e[^-1] "[nn_lib] Add 'fc+normalize+nl' layer '$1' to the network, with input '"$in"', $3 channels ""and '$4' activation." +init=$_nn_init +_nn_fc $1_fc,$in,$3,$5 +_nn_normalize $1_normalize,$1_fc,0,3 +nn_nl $1,$1_normalize,$4 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_input : name,width,_height,_depth,_spectrum +#@cli : Add a new 'input' to the network. +#@cli : Default values: 'height=1', 'depth=1' and 'spectrum=1'. +nn_input : check "isvarname('$1') && isint($2) && $2>0 && isint(${3=1}) && $3>0 && isint(${4=1}) && $4>0 && ""isint(${5=1}) && $5>0" +e[^-1] "[nn_lib] Add input '$1', with size ($2,$3,$4,$5)." +_nn_modules_names.=$1, +_nn_modules_types.=input, +_nn_$1_size=$2,$3,$4,$5 +_nn_forward.="begin(nn_input_init_forward($1,$2,$3,$4,$5));" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_maxpool2d : out,_in,_patch_size>1 +#@cli : Add a 'maxpool2d' layer (2D max pooling) to the network. +#@cli : Default values: 'in=. (previous layer)' and 'patch_size=2'. +nn_maxpool2d : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=2}) && $3>1" +e[^-1] "[nn_lib] Add 'maxpool2d' layer '$1', with input '"$in"' and patch size $3x$3." +_nn_modules_names.=$1, +_nn_modules_types.=maxpool2d, +_nn_$1_size:=s=[${_nn_${in}_size}];[int(s[0,2]/$3),s[2,2]] +_nn_$1_input=$in +_nn_$1_properties="patch_size=$3x$3" +_nn_forward.="begin(nn_maxpool2d_init_forward($1,"$in",$3));""nn_maxpool2d_forward($1,"$in");" +_nn_backward..="nn_maxpool2d_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_maxpool3d : out,_in,_patch_size>1 +#@cli : Add a 'maxpool3d' layer (3d max pooling) to the network. +#@cli : Default values: 'in=. (previous layer)' and 'patch_size=2'. +nn_maxpool3d : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=2}) && $3>1" +e[^-1] "[nn_lib] Add 'maxpool3d' layer '$1', with input '"$in"' and patch size $3x$3x$3." +_nn_modules_names.=$1, +_nn_modules_types.=maxpool3d, +_nn_$1_size:=s=[${_nn_${in}_size}];[int(s[0,3]/$3),s[3]] +_nn_$1_input=$in +_nn_$1_properties="patch_size=$3x$3x$3" +_nn_forward.="begin(nn_maxpool3d_init_forward($1,"$in",$3));""nn_maxpool3d_forward($1,"$in");" +_nn_backward..="nn_maxpool3d_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_mul : out,in0,_in1 +#@cli : Add an 'mul' layer to the network. +#@cli : Default value: 'in1=. (previous layer)'. +nn_mul : if ['$2']=='.' in0=$_nn_latest else in0=$2 fi nn_check_layer $in0 +if ['${3=.}']=='.' in1=$_nn_latest else in1=$3 fi nn_check_layer $in1 +check "isvarname('$1') && "[${_nn_${in0}_size}]==[${_nn_${in1}_size}] +e[^-1] "[nn_lib] Add 'mul' layer '$1', with inputs '"$in0"' and '"$in1"'." +_nn_modules_names.=$1, +_nn_modules_types.=mul, +_nn_$1_size=${_nn_${in0}_size} +_nn_$1_input=$in0,$in1 +_nn_forward.="begin(nn_mul_init_forward($1,"$in0"));""nn_mul_forward($1,"$in0","$in1");" +_nn_backward..="nn_mul_backward($1,"$in0","$in1");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_nl : out,_in,_activation +#@cli : Add a 'nl' (nonlinearity) layer to the network. +#@cli : 'activation' can be { elu | gelu | leakyrelu | linear | relu | sigmoid | sin | sinc | softmax | sqr | sqrt | swish | tanh }. +#@cli : Default values: 'in=. (previous layer)' and 'activation=leakyrelu'. +nn_nl : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1')" +skip ${3=leakyrelu} +e[^-1] "[nn_lib] Add 'nl' layer '$1', with input '"$in"' and '$3' activation." +_nn_modules_names.=$1, +_nn_modules_types.=nl, +_nn_$1_size=${_nn_${in}_size} +_nn_$1_input=$in +_nn_$1_properties="activation=$3" +_nn_forward.="begin(nn_nl_init_forward($1,"$in"));" +if s=['$3'];s=='softmax' +_nn_forward.="nn_$3_forward($1,"$in");" +_nn_backward..="nn_$3_backward($1,"$in");" +else +_nn_forward.="nn_nl_forward($1,"$in",$3);" +_nn_backward..="nn_nl_backward($1,"$in",$3);" +fi +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_normalize : out,_in,_normalization_mode_,0<=_learning_mode<=3 +#@cli : Add a 'normalize' layer to the network. +#@cli : 'normalization_mode' can be { 0=global parameters | 1=channel-by-channel parameters } +#@cli : 'learning_mode' can be { 0=no learning | 1=alpha only | 2=beta only | 3=alpha+beta } +#@cli : Default values: 'in=. (previous layer)','normalization_mode=0' and 'learning_mode=3'. +nn_normalize : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isbool(${3=0}) && isint(${4=3}) && inrange($4,0,3)" +s0,s1=global,channel-by-channel +e[^-1] "[nn_lib] Add 'normalize' layer '$1', with input '"$in"' and "${s$3}" normalization." +_nn_normalize $1_normalize,$in,${3-4} +nn_rename $1,$1_normalize +_nn_latest=$1 +_nn_normalize : +s0,s1=global,channel-by-channel +_nn_modules_names.=$1, +_nn_modules_types.=normalize, +_nn_$1_size=$_nn_$2_size +_nn_$1_learning_mode=$4 +_nn_$1_input=$2 +_nn_$1_properties="normalization="${s$3}", learning_mode=$4" +if !isint($$1) +(1,0,0,1) +if $3 r. 100%,{[$_nn_$2_size][3]} fi +=> $1 +fi +_nn_forward.="begin(nn_normalize_init_forward($1,$2,$3));""nn_normalize_forward($1,$2);" +_nn_backward..="begin(nn_normalize_init_backward($1));""nn_normalize_backward($1,$2);""end(nn_normalize_end_backward($1));" +_nn_init.="$0 $* " +#@cli nn_patchdown2d : out,_in,_patch_size>1 +#@cli : Add a 'patchdown2d' (2D downscale by patch) layer to the network. +#@cli : Default values: 'in=. (previous layer)' and 'patch_size=2'. +nn_patchdown2d : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=2}) && $3>1" +e[^-1] "[nn_lib] Add 'patchdown2d' layer '$1', with input '"$in"' and patch size $3x$3." +_nn_modules_names.=$1, +_nn_modules_types.=patchdown2d, +_nn_$1_size:=s=[${_nn_${in}_size}];[int(s[0,2]/$3),s[2],s[3]*$3^2] +_nn_$1_input=$in +_nn_$1_properties="patch_size=$3x$3" +if !min($_nn_$1_size) +error[0--3] "Command 'nn_patchdown2d': Specified patch size ($3x$3) is higher than ""input size ("${_nn_${in}_size}")." +fi +_nn_forward.="begin(nn_patchdown2d_init_forward($1,"$in",$3));""nn_patchdown2d_forward($1,"$in");" +_nn_backward..="nn_patchdown2d_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_patchdown3d : out,_in,_patch_size>1 +#@cli : Add a 'patchdown3d' (3D downscale by patch) layer to the network. +#@cli : Default values: 'in=. (previous layer)' and 'patch_size=2'. +nn_patchdown3d : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=2}) && $3>1" +e[^-1] "[nn_lib] Add 'patchdown3d' layer '$1', with input '"$in"' and patch size $3x$3x$3." +_nn_modules_names.=$1, +_nn_modules_types.=patchdown3d, +_nn_$1_size:=s=[${_nn_${in}_size}];[int(s[0,3]/$3),s[3]*$3^3] +_nn_$1_input=$in +_nn_$1_properties="patch_size=$3x$3x$3" +if !min($_nn_$1_size) +error[0--3] "Command 'nn_patchdown3d': Specified patch size ($3x$3x$3) is higher than ""input size ("${_nn_${in}_size}")." +fi +_nn_forward.="begin(nn_patchdown3d_init_forward($1,"$in",$3));""nn_patchdown3d_forward($1,"$in");" +_nn_backward..="nn_patchdown3d_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_patchup2d : out,_in,_patch_size>1 +#@cli : Add a 'patchup2d' (2D upscale by patch) layer to the network. +#@cli : Default values: 'in=. (previous layer)' and 'patch_size=2'. +nn_patchup2d : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=2}) && $3>1" +e[^-1] "[nn_lib] Add 'patchup2d' layer '$1', with input '"$in"' and patch size $3x$3." +_nn_modules_names.=$1, +_nn_modules_types.=patchup2d, +_nn_$1_size:=s=[${_nn_${in}_size}];[int(s[0,2]*$3),s[2],s[3]/$3^2] +_nn_$1_input=$in +_nn_$1_properties="patch_size=$3x$3" +_nn_forward.="begin(nn_patchup2d_init_forward($1,"$in",$3));""nn_patchup2d_forward($1,"$in");" +_nn_backward..="nn_patchup2d_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_patchup3d : out,_in,_patch_size>1 +#@cli : Add a 'patchup3d' (3D upscale by patch) layer to the network. +#@cli : Default values: 'in=. (previous layer)' and 'patch_size=2'. +nn_patchup3d : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=2}) && $3>1" +e[^-1] "[nn_lib] Add 'patchup3d' layer '$1', with input '"$in"' and patch size $3x$3x$3." +_nn_modules_names.=$1, +_nn_modules_types.=patchup3d, +_nn_$1_size:=s=[${_nn_${in}_size}];[int(s[0,3]*$3),s[3]/$3^3] +_nn_$1_input=$in +_nn_$1_properties="patch_size=$3x$3x$3" +_nn_forward.="begin(nn_patchup3d_init_forward($1,"$in",$3));""nn_patchup3d_forward($1,"$in");" +_nn_backward..="nn_patchup3d_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_rename : out,_in +#@cli : Add a 'rename' layer to the network. +#@cli : Default value: 'in=. (previous layer)'. +nn_rename : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1')" +e[^-1] "[nn_lib] Add 'rename' layer '$1', with input '"$in"'." +_nn_modules_names.=$1, +_nn_modules_types.=rename, +_nn_$1_size=${_nn_${in}_size} +_nn_$1_input=$in +_nn_forward.="begin(nn_rename_init_forward($1,"$in"));" +_nn_backward..="nn_rename_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_resconv2d : out,_in,_kernel_size>0,_dilation>0,_boundary_conditions,0<=_learning_mode<=3 +#@cli : Add a 'resconv2d' (residual 2D convolutional layer) to the network. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : 'learning_mode' can be { 0=no learning | 1=weights only | 2=biases only | 3=weights+biases }. +#@cli : Default values: 'in=. (previous layer)', 'kernel_size=3', 'dilation=1', 'boundary_conditions=1' and 'learning_mode=3'. +nn_resconv2d : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=3}) && $3>0 && isint(${5=1}) && inrange($5,0,3) && ""isint(${6=3}) && inrange($6,0,3)" +skip "${4=1}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'resconv2d' layer '$1', with input '"$in"', $3x$3 kernels, dilation $4 and "$s$5" boundary conditions." +init=$_nn_init +nn_clone $1_clone0,$1_clone1,$in +_nn_conv2d $1_conv2d,$1_clone1,{[${_nn_${in}_size}][3]},$3,1,$4,0,$5,$6 +nn_add $1,$1_conv2d,$1_clone0 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_resconv2dnl : out,_in,_kernel_size>0,_dilation>0,_boundary_conditions,_activation,0<=_learning_mode<=3 +#@cli : Add a 'resconv2dnl' (residual 2D convolutional layer followed by a non-linearity) to the network. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : 'learning_mode' can be { 0=no learning | 1=weights only | 2=biases only | 3=weights+biases }. +#@cli : Default values: 'in=. (previous layer)', 'kernel_size=3', 'dilation=1', 'boundary_conditions=1', 'activation=leakyrelu' and 'learning_mode=3'. +nn_resconv2dnl : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=3}) && $3>0 && isint(${5=1}) && inrange($5,0,3) && ""isint(${7=3}) && inrange($7,0,3)" +skip "${4=1}","${6=leakyrelu}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'resconv2dnl' layer '$1', with input '"$in"', $3x$3 kernels, dilation $4, "$s$5" boundary conditions and '$6' activation." +init=$_nn_init +nn_clone $1_clone0,$1_clone1,$in +_nn_conv2d $1_conv2d,$1_clone1,{[${_nn_${in}_size}][3]},$3,1,$4,0,$5,$7 +nn_add $1_add,$1_conv2d,$1_clone0 +nn_nl $1,$1_add,$6 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_resconv2dnnl : out,_in,_kernel_size>0,_dilation>0,_boundary_conditions,_activation,0<=_learning_mode<=3 +#@cli : Add a 'resconv2dnnl' (residual 2D convolutional layer followed by a normalization layer, then a non-linearity)to the network. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : 'learning_mode' can be { 0=no learning | 1=weights only | 2=biases only | 3=weights+biases }. +#@cli : Default values: 'in=. (previous layer)', 'kernel_size=3', 'dilation=1', 'boundary_conditions=1', 'activation=leakyrelu' and 'learning_mode=3'. +nn_resconv2dnnl : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=3}) && $3>0 && isint(${5=1}) && inrange($5,0,3) && ""isint(${7=3}) && inrange($7,0,3)" +skip "${4=1}","${6=leakyrelu}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'resconv2dnnl' layer '$1', with input '"$in"', $3x$3 kernels, dilation $4, "$s$5" boundary conditions and '$6' activation." +init=$_nn_init +nn_clone $1_clone0,$1_clone1,$in +_nn_conv2d $1_conv2d,$1_clone1,{[${_nn_${in}_size}][3]},$3,1,$4,0,$5,$7 +_nn_normalize $1_normalize,$1_conv2d,1,3 +nn_add $1_add,$1_normalize,$1_clone0 +nn_nl $1,$1_add,$6 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_resconv3d : out,_in,_kernel_size>0,_dilation>0,_boundary_conditions,0<=_learning_mode<=3 +#@cli : Add a 'resconv3d' (residual 3D convolutional layer) to the network. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : 'learning_mode' can be { 0=no learning | 1=weights only | 2=biases only | 3=weights+biases }. +#@cli : Default values: 'in=. (previous layer)', 'kernel_size=3', 'dilation=1', 'boundary_conditions=1' and 'learning_mode=3'. +nn_resconv3d : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=3}) && $3>0 && isint(${5=1}) && inrange($5,0,3) && ""isint(${6=3}) && inrange($6,0,3)" +skip "${4=1}" +e[^-1] "[nn_lib] Add 'resconv3d' layer '$1', with input '"$in"', $3x$3x$3 kernels, dilation $4 and "$s$5" boundary conditions." +init=$_nn_init +nn_clone $1_clone0,$1_clone1,$in +_nn_conv3d $1_conv3d,$1_clone1,{[${_nn_${in}_size}][3]},$3,1,$4,0,$5,$6 +nn_add $1,$1_conv3d,$1_clone0 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_resconv3dnl : out,_in,_kernel_size>0,_dilation>0,_boundary_conditions,_activation,0<=_learning_mode<=3 +#@cli : Add a 'resconv3dnl' (residual 3D convolutional layer followed by a non-linearity) to the network. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : 'learning_mode' can be { 0=no learning | 1=weights only | 2=biases only | 3=weights+biases }. +#@cli : Default values: 'in=. (previous layer)', 'kernel_size=3', 'dilation=1', 'boundary_conditions=1', activation='leakyrelu' and 'learning_mode=3'. +nn_resconv3dnl : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=3}) && $3>0 && isint(${5=1}) && inrange($5,0,3) && ""isint(${7=1}) && inrange($7,0,3)" +skip "${4=1}","${6=leakyrelu}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'resconv3dnl' layer '$1', with input '"$in"', $3x$3x$3 kernels, dilation $4, "$s$5" boundary conditions and '$6' activation." +init=$_nn_init +nn_clone $1_clone0,$1_clone1,$in +_nn_conv3d $1_conv3d,$1_clone1,{[${_nn_${in}_size}][3]},$3,1,$4,0,$5,$7 +nn_add $1_add,$1_conv3d,$1_clone0 +nn_nl $1,$1_add,$6 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_resconv3dnnl : out,_in,_kernel_size>0,_dilation>0,_boundary_conditions,_activation,0<=_learning_mode<=3 +#@cli : Add a 'resconv3dnnl' (residual 3D convolutional layer followed by a normalization layer, then a non-linearity)to the network. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : 'learning_mode' can be { 0=no learning | 1=weights only | 2=biases only | 3=weights+biases }. +#@cli : Default values: 'in=. (previous layer)', 'kernel_size=3', 'dilation=1', 'boundary_conditions=1', 'activation=leakyrelu' and 'learning_mode=3'. +nn_resconv3dnnl : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=3}) && $3>0 && isint(${5=1}) && inrange($5,0,3) && ""isint(${7=3}) && inrange($7,0,3)" +skip "${4=1}","${6=leakyrelu}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'resconv3dnnl' layer '$1', with input '"$in"', $3x$3x$3 kernels, dilation $4, "$s$5" boundary conditions and '$6' activation." +init=$_nn_init +nn_clone $1_clone0,$1_clone1,$in +_nn_conv3d $1_conv3d,$1_clone1,{[${_nn_${in}_size}][3]},$3,1,$4,0,$5,$7 +_nn_normalize $1_normalize,$1_conv3d,1,3 +nn_add $1_add,$1_normalize,$1_clone0 +nn_nl $1,$1_add,$6 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_resfc : out,_in,0<=_learning_mode<=3 +#@cli : Add a 'resfc' (residual fully connecter layer) to the network. +#@cli : 'learning_mode' can be { 0=no learning | 1=weights only | 2=biases only | 3=weights+biases }. +#@cli : Default values: 'in=. (previous layer)' and 'learning_mode=3'. +nn_resfc : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=3}) && inrange($3,0,3)" +e[^-1] "[nn_lib] Add 'resfc' layer '$1', with input '"$in"'." +init=$_nn_init +nn_clone $1_clone0,$1_clone1,$in +_nn_fc $1_fc,$1_clone1,{prod(${_nn_${in}_size})},$3 +nn_add $1,$1_fc,$1_clone0 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_resfcnl : out,_in,_activation,0<=_learning_mode<=3 +#@cli : Add a 'resfcnl' (residual fully connecter layer followed by a non-linearity) to the network. +#@cli : 'learning_mode' can be { 0=no learning | 1=weights only | 2=biases only | 3=weights+biases }. +#@cli : Default values: 'in=. (previous layer)', 'activation=leakyrelu' and 'learning_mode=3'. +nn_resfcnl : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${4=3}) && inrange($4,0,3)" +skip ${3=leakyrelu} +e[^-1] "[nn_lib] Add 'resfc+nl' layer '$1' to the network, with input '"$in"' and '$4' activation." +init=$_nn_init +nn_clone $1_clone0,$1_clone1,$in +_nn_fc $1_fc,$1_clone1,{prod(${_nn_${in}_size})},$4 +nn_add $1_add,$1_fc,$1_clone0 +nn_nl $1,$1_add,$3 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_resfcnnl : out,_in,_activation,0<=_learning_mode<=3 +#@cli : Add a 'resfcnnl' (residual fully connecter layer followed by a normalization layer, then a non-linearity) to the network. +#@cli : 'learning_mode' can be { 0=no learning | 1=weights only | 2=biases only | 3=weights+biases }. +#@cli : Default values: 'in=. (previous layer)', 'activation=leakyrelu' and 'learning_mode=3'. +nn_resfcnnl : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${4=3}) && inrange($4,0,3)" +skip ${3=leakyrelu} +e[^-1] "[nn_lib] Add 'resfc+normalize+nl' layer '$1' to the network, with input '"$in"' and '$4' activation." +init=$_nn_init +nn_clone $1_clone0,$1_clone1,$in +_nn_fc $1_fc,$1_clone1,{prod(${_nn_${in}_size})},1 +_nn_normalize $1_normalize,$1_fc,0,3 +nn_add $1_add,$1_normalize,$1_clone0 +nn_nl $1,$1_add,$3 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_reshape : out,in,width>0,height>0,depth>0,spectrum>0 +#@cli : Add a 'reshape' layer to the network. +nn_reshape : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1')" +e[^-1] "[nn_lib] Add 'reshape' layer '$1', with input '"$in"' and size ($3,$4,$5,$6)." +_nn_modules_names.=$1, +_nn_modules_types.=reshape, +_nn_$1_size=$3,$4,$5,$6 +_nn_$1_input=$in +if prod($_nn_$1_size)!=prod(${_nn_${in}_size}) +error[0--3] "Command 'nn_reshape': Cannot reshape input ("${_nn_${in}_size}") to output ("$_nn_$1_size")." +fi +_nn_forward.="begin(nn_reshape_init_forward($1,"$in",${3-6}));" +_nn_backward..="begin(nn_reshape_init_backward($1,"$in"));" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_resize : out,in,width[%]>0,_height[%]>0,_depth[%]>0,_spectrum[%]>0,_interpolation +#@cli : Add a 'resize' layer to the network. +#@cli : Default values: 'height=depth=spectrum=100%' and 'interpolation=3'. +nn_resize : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && $3>0 && ${4=100%}>0 && ${5=100%}>0 && ${6=100%}>0" +skip ${7=3} +if ${"is_percent $3"} w={max(1,round([${_nn_${in}_size}][1]*$3))} else w=$3 fi +if ${"is_percent $4"} h={max(1,round([${_nn_${in}_size}][1]*$4))} else h=$4 fi +if ${"is_percent $5"} d={max(1,round([${_nn_${in}_size}][2]*$5))} else d=$5 fi +if ${"is_percent $6"} s={max(1,round([${_nn_${in}_size}][3]*$6))} else s=$6 fi +e[^-1] "[nn_lib] Add 'resize' layer '$1', with input '"$in"' and output size ("$w","$h","$d","$s")." +_nn_modules_names.=$1, +_nn_modules_types.=resize, +_nn_$1_size=$w,$h,$d,$s +_nn_$1_input=$in +_nn_$1_properties="interpolation=$7" +_nn_forward.="begin(nn_resize_init_forward($1,"$in","$w","$h","$d","$s",$7));""nn_resize_forward($1,"$in");" +_nn_backward..="nn_resize_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_run : out,in,"command",_width[%]>0,_height[%]>0,_depth[%]>0,_spectrum[%]>0 +#@cli : Add a 'run' layer to the network. +#@cli : Default values: 'width=height=depth=spectrum=100%'. +nn_run : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && ${4=100%}>0 && ${5=100%}>0 && ${6=100%}>0 && ${7=100%}>0" +if ${"is_percent $4"} w={max(1,round([${_nn_${in}_size}][0]*$4))} else w=$4 fi +if ${"is_percent $5"} h={max(1,round([${_nn_${in}_size}][1]*$5))} else h=$5 fi +if ${"is_percent $6"} d={max(1,round([${_nn_${in}_size}][2]*$6))} else d=$6 fi +if ${"is_percent $7"} s={max(1,round([${_nn_${in}_size}][3]*$7))} else s=$7 fi +e[^-1] "[nn_lib] Add 'run' layer '$1', with input '"$in"', command '$3' and output size ("$w","$h","$d","$s")." +_nn_modules_names.=$1, +_nn_modules_types.=run, +_nn_$1_size=$w,$h,$d,$s +_nn_$1_input=$in +_nn_$1_properties="command='$3'" +_nn_forward.="begin(nn_run_init_forward($1,"$in",'$3',"$w","$h","$d","$s"));""nn_run_forward($1,"$in");" +_nn_backward..="nn_run_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_split : name0,name1,in,nb_channels0 +#@cli : Add a 'split' layer to the network. +nn_split : if ['$3']=='.' in=$_nn_latest else in=$3 fi nn_check_layer $in +check "isvarname('$1') && isvarname('$2')" +e[^-1] "[nn_lib] Add 'split' layer, with input '"$in"' and outputs '$1' and '$2'." +_nn_modules_names.=$1,$2, +_nn_modules_types.=split,split, +_nn_$1_size={[[${_nn_${in}_size}][0,3],$4]} +_nn_$1_input=$2 +_nn_$2_size={[${_nn_${in}_size}]-[0,0,0,$4]} +_nn_$2_input=$2 +_nn_forward.="begin(nn_split_init_forward($1,$2,"$in",$4));""nn_split_forward($1,$2,"$in");" +_nn_backward..="nn_split_backward($1,$2,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_loss_binary_crossentropy : out,in,ground_truth +#@cli : Add a 'binary_crossentropy' loss to the network (binary cross entropy). +nn_loss_binary_crossentropy : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isvarname('$3')" +e[^-1] "[nn_lib] Add binary cross entropy loss '$1', with input '"$in"' and ground truth '$3'." +_nn_modules_names.=$1, +_nn_modules_types.=loss_binary_crossentropy, +_nn_$1_size=1,1,1,1 +_nn_$1_input=$in +_nn_$1_properties="ground_truth=$3" +_nn_loss.="begin(nn_loss_binary_crossentropy_init_forward($1));""nn_loss_binary_crossentropy_forward($1,"$in",$3);""end(nn_loss_binary_crossentropy_end_forward($1));" +_nn_backward..="nn_loss_binary_crossentropy_backward($1,"$in",$3);" +_nn_latest=$1 +#@cli nn_loss_crossentropy : out,in,ground_truth +#@cli : Add a 'crossentropy' loss to the network (cross entropy). +nn_loss_crossentropy : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isvarname('$3')" +e[^-1] "[nn_lib] Add cross entropy loss '$1', with input '"$in"' and ground truth '$3'." +_nn_modules_names.=$1, +_nn_modules_types.=loss_crossentropy, +_nn_$1_size=1,1,1,1 +_nn_$1_input=$in +_nn_$1_properties="ground_truth=$3" +_nn_loss.="begin(nn_loss_crossentropy_init_forward($1));""nn_loss_crossentropy_forward($1,"$in",$3);""end(nn_loss_crossentropy_end_forward($1));" +_nn_backward..="nn_loss_crossentropy_backward($1,"$in",$3);" +_nn_latest=$1 +#@cli nn_loss_mse : out,in,ground_truth +#@cli : Add a 'mse' loss to the network (mean-squared error). +nn_loss_mse : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isvarname('$3')" +e[^-1] "[nn_lib] Add MSE loss '$1', with input '"$in"' and ground truth '$3'." +_nn_modules_names.=$1, +_nn_modules_types.=loss_mse, +_nn_$1_size=1,1,1,1 +_nn_$1_input=$in +_nn_$1_properties="ground_truth=$3" +_nn_loss.="begin(nn_loss_mse_init_forward($1));""nn_loss_mse_forward($1,"$in",$3);""end(nn_loss_mse_end_forward($1));" +_nn_backward..="nn_loss_mse_backward($1,"$in",$3);" +_nn_latest=$1 +#@cli nn_loss_normp : out,in,ground_truth,_metric={ 0=squared-L2 | p>0 = Lp-norm } +#@cli : Add a 'normp' loss to the network (||out - ground_truth||_p). +#@cli : Default value: 'metric=1'. +nn_loss_normp : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isvarname('$3') && isint(${4=1}) && $4>=0" +e[^-1] "[nn_lib] Add normp loss '$1', with input '"$in"', ground truth '$3' and metric $4." +_nn_modules_names.=$1, +_nn_modules_types.=loss_normp, +_nn_$1_size=1,1,1,1 +_nn_$1_input=$in +_nn_$1_properties="ground_truth=$3, metric=$4" +_nn_loss.="begin(nn_loss_normp_init_forward($1,$4));""nn_loss_normp_forward($1,"$in",$3);""end(nn_loss_normp_end_forward($1));" +_nn_backward..="nn_loss_normp_backward($1,"$in",$3);" +_nn_latest=$1 +#@cli nn_loss_softmax_crossentropy : out,in,ground_truth +#@cli : Add a 'softmax_crossentropy' loss to the network (softmax followed by cross entropy). +nn_loss_softmax_crossentropy : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isvarname('$3')" +e[^-1] "[nn_lib] Add softmax + cross entropy loss '$1', with input '"$in"' and ground truth '$3'." +_nn_modules_names.=$1, +_nn_modules_types.=loss_softmax_crossentropy, +_nn_$1_size=1,1,1,1 +_nn_$1_input=$2 +_nn_$1_properties="ground_truth=$3" +_nn_loss.="begin(nn_loss_softmax_crossentropy_init_forward($1));""nn_loss_softmax_crossentropy_forward($1,"$in",$3);""end(nn_loss_softmax_crossentropy_end_forward($1));" +_nn_backward..="nn_loss_softmax_crossentropy_backward($1,"$in",$3);" +_nn_latest=$1 +#@cli nn_print +#@cli : Print info on current neural network. +nn_print : +e[^-1] "[nn_lib] Print info on current neural network." +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r b=$_vt100_b v 0 +e " * List of modules:" +repeat narg($_nn_modules_names)-1 { +type=${arg0\ $>,$_nn_modules_types} +name=${arg0\ $>,$_nn_modules_names} +learning_mode=${_nn_${name}_learning_mode} +e " - Module: "$b$name$n" (type: "$g$type$n")" +if ['${_nn_${name}_input}']!=0 +s={`find(['${_nn_${name}_input}'],_',')>0?_'s':0`} +e " * Input"$s": "$c${_nn_${name}_input}$n +fi +e " * Output size: "$c${_nn_${name}_size}$n +if ['${_nn_${name}_properties}']!=0 +ies={`find(['${_nn_${name}_properties}'],_',')>0?'ies':[_'y',0,0]`} +e " * Propert"$ies": "$c${_nn_${name}_properties}$n +fi +if ${$name} +e " * Parameters: "$c{$name,whds}$n +fi +} +e "\n * Total: "${b}{narg($_nn_modules_names)-1}$n" modules, "$b${-nn_size}$n" parameters.\n" +#@cli nn_trainer : name,_loss,_learning_rate>0,_optimizer,_scheduler +#@cli : Add a network trainer to the network. +#@cli : 'optimizer' can be { sgd | rmsprop | adam | adamax }. +#@cli : 'scheduler' can be { constant | linear | exponential | adaptive }. +#@cli : Default values: 'loss=. (previous loss)', 'learning_rate=2e-4', 'optimizer=rmsprop' and 'scheduler=constant'. +nn_trainer : if ['${2=.}']=='.' loss=$_nn_latest else loss=$2 fi nn_check_layer $loss +check "isvarname('$1') && ${3=2e-4}>0 && isvarname('${4=rmsprop}') && isvarname('${5=constant}')" +e[^-1] "[nn_lib] Add trainer '$1' for loss '"$loss"', with learning rate '$3', $4 optimizer and $5 scheduler." +_nn_modules_names.=$1, +_nn_modules_types.=trainer, +_nn_$1_size=0,0,0,0 +_nn_$1_properties="loss="$loss", learning_rate=$3, optimizer=$4, scheduler=$5" +if !isint($$1) +l[] { (0,$3,$3,inf,inf) _nn_optimizer_$4 _nn_scheduler_$5 a y => $1 } +else +=[$1] $3,1,0 +=[$1] $3,2,0 +fi +_nn_$1_update="begin(nn_trainer_init_backward($1,"$loss",$4,$5));end(" +repeat narg($_nn_modules_names)-1 { +type=${arg0\ $>,$_nn_modules_types} +name=${arg0\ $>,$_nn_modules_names} +learning_mode=${_nn_${name}_learning_mode} +if isin('$type','conv2d','conv3d','fc','nlfc','normalize') +_nn_$1_update.="nn_optimizer_$4_update_"$type"("$name,$learning_mode");" +if $learning_mode +if '$4'=='rmsprop' +name_g2=${name}_g2 +if !isint(${$name_g2}) +f[$name] 0 => $name_g2 fi +_nn_trainer_data.=$name_g2, +elif isin('$4','adam','adamax') +name_m,name_v=${name}_m,${name}_v +if !isint(${$name_m}) +f[$name] 0 => $name_m fi +if !isint(${$name_v}) +f[$name] 0 => $name_v fi +_nn_trainer_data.=$name_m,$name_v, +fi +fi +fi +} +_nn_$1_update.="nn_trainer_update($1,"$loss",$5));" +_nn_update=$_nn_$1_update +_nn_optimizer_sgd : 1 +_nn_optimizer_rmsprop : 1 +_nn_optimizer_adam : 1 +_nn_optimizer_adamax : 1 +_nn_scheduler_constant : 1 +_nn_scheduler_linear : 1 +_nn_scheduler_exponential : 1 +_nn_scheduler_adaptive : (0,0,0) +#@cli nn_size +#@cli: Return size of the current network (i.e. number of stored parameters). +nn_size : +e[^-1] "[nn_lib] Return size of the current network." +siz=0 +repeat narg($_nn_modules_names)-1 { +type=${arg0\ $>,$_nn_modules_types} +name=${arg0\ $>,$_nn_modules_names} +if isin('$type','conv2d','conv3d','fc','nlfc','normalize') siz+={$name,whds} fi +} +u $siz +#@cli nn_load : 'filename.gmz',_include_trainer_data={ 0=no | 1=yes } +#@cli : Load and initialize network saved as a .gmz file. +#@cli : Neural network files can be only loaded in .gmz format. +#@cli : Default value: 'include_trainer_data=1'. ++nn_load : check "s=['$1']; find(s,'.gmz')==size(s) - 4 && isbool(${2=1})" +e[^-1] "[nn_lib] Load network from file '$1'." +l[] { +"$1" run {t} rm. +if !$2 +nmd $_nn_modules_names k[${}] +fi +} +#@cli nn_save : 'filename.gmz',_include_trainer_data={ 0=no | 1=yes } +#@cli : Save current network as a .gmz file. +#@cli : `.gmz` is mandatory extension, specifying another file extension will throw an error. +#@cli : Default value: 'include_trainer_data=1'. +nn_save : check "s=['$1']; find(s,'.gmz')==size(s) - 4 && isbool(${2=1})" +s0,s1=""," (include trainer data)" +e[^-1] "[nn_lib] Save current network as file '$1'"$s$2"." +if $2 sel=$_nn_trainer_data fi c= +repeat narg($_nn_modules_names)-1 { +type=${arg0\ $>,$_nn_modules_types} +name=${arg0\ $>,$_nn_modules_names} +if isin('$type','conv2d','conv3d','fc','nlfc','normalize','trainer') sel.=$c$name c=, fi +} +('$_nn_init') autocrop. {'" "'} => _nn_init +o[$sel,-1] "$1" +rm. +#@cli nn_store : 'variable_name',_include_trainer_data={ 0=no | 1=yes } +#@cli : Store current network into a variable. +#@cli : Default value: 'include_trainer_data=1'. +nn_store : check "isbool(${2=1})" +s0,s1=""," (include trainer data)" +e[^-1] "[nn_lib] Store current network into variable '$1'"$s$2"." +if $2 sel=$_nn_trainer_data fi c= +repeat narg($_nn_modules_names)-1 { +type=${arg0\ $>,$_nn_modules_types} +name=${arg0\ $>,$_nn_modules_names} +if isin('$type','conv2d','conv3d','fc','nlfc','normalize','trainer') sel.=$c$name c=, fi +} +('$_nn_init') autocrop. {'" "'} => _nn_init ++store[$sel,-1] "$1" +rm. +#@cli :: Arrays, Tiles and Frames +#@cli array : M>0,_N>0,_expand_type={ 0=min | 1=max | 2=all } +#@cli : Create MxN array from selected images. +#@cli : Default values: 'N=M' and 'expand_type=0'. +#@cli : $ image.jpg array 3,2,2 +array : check "isint($1) && $1>0 && isint(${2=$1}) && $2>0" skip ${3=0} +e[^-1] "Create $1x$2 array from image$?, with expand type $3." +r0={100/max($1,$2)} r1={100/min($1,$2)} r2=100 +r ${r$3}%,${r$3}%,1,100%,2 r {$1*100}%,{$2*100}%,1,100%,0,2 +#@cli array_fade : M>0,_N>0,0<=_fade_start<=100,0<=_fade_end<=100,_expand_type={0=min | 1=max | 2=all} +#@cli : Create MxN array from selected images. +#@cli : Default values: 'N=M', 'fade_start=60', 'fade_end=90' and 'expand_type=1'. +#@cli : $ image.jpg array_fade 3,2 +array_fade : skip ${2=$1},${3=60},${4=90},${5=1} +e[^-1] "Create $1x$2 array of ($3%,$4%) faded tiles from image$?, with expand type $5." +foreach { . shift.. {round(w/2)},{round(h/2)},1,1,2 fade_diamond $3,$4 } +array $1,$2,$5 +#@cli array_mirror : N>=0,_dir={ 0=x | 1=y | 2=xy | 3=tri-xy },_expand_type={ 0 | 1 } +#@cli : Create 2^Nx2^N array from selected images. +#@cli : Default values: 'dir=2' and 'expand_type=0'. +#@cli : $ image.jpg array_mirror 2 +array_mirror : skip ${2=2},${3=0} +e[^-1] "Create a 2^$1x2^$1 mirrored-array from image$?, with expand type $2." +repeat $1 { +if $3==0 +if $2>=3 r 33%,33%,100%,100%,2 +else r 50%,50%,100%,100%,2 +fi +fi +foreach { +if $2==0 +mirror x a x +elif $2==1 +mirror y a y +else +mirror x a x +mirror y a y if $2==3 r 150%,150%,1,100%,0,2,1,1 fi +fi +} +} +#@cli array_random : Ms>0,_Ns>0,_Md>0,_Nd>0 +#@cli : Create MdxNd array of tiles from selected MsxNs source arrays. +#@cli : Default values: 'Ns=Ms', 'Md=Ms' and 'Nd=Ns'. +#@cli : $ image.jpg +array_random 8,8,15,10 +array_random : skip ${2=$1},${3=$1},${4=$2} +e[^-1] "Create $3x$4 array of tiles from $1x$2 array$?." +foreach { +nm={n} +split_tiles $1,$2 +repeat $3 { repeat $4 { [{u($1*$2-1)}] } } +rm[0-{$1*$2-1}] append_tiles $3,$4 +=> $nm +} +#@cli frame : eq. to 'frame_xy'. +frame : skip ${2=$1}>=0,${3=255},${4=$3},${5=$4},${6=255} +_gmic_s="$?" v + _frame_xy ${1--1} +#@cli frame_blur : _sharpness>0,_size>=0,_smoothness,_shading,_blur +#@cli : Draw RGBA-colored round frame in selected images. +#@cli : Default values: 'sharpness=10', 'size=30', 'smoothness=0', 'shading=1' and 'blur=3%'. +#@cli : $ image.jpg frame_blur 3,30,8,10% +frame_blur : skip ${1=10},${2=30},${3=0},${4=1},${5=3%} +e[^-1] "Draw round frame on image$?, with sharpness $1, size $2, smoothness $3, shading $4 and blur $5." +to_rgba foreach { +nm={n} +100%,100%,1,1,"-(abs(x/w-0.5)^$1 + abs(y/h-0.5)^$1)^(1/$1)" >=. $2% +if $4 distance. 1 n. 0,1 *. -1 +. 1 ^. {1/$4} fi +b. $3 +b.. $5 mv. -3 blend_fade[0,1] . rm. +=> $nm +} +#@cli frame_cube : _depth>=0,_centering_x,_centering_y,_left_side={0=normal | 1=mirror-x | 2=mirror-y | 3=mirror-xy},_right_side,_lower_side,_upper_side +#@cli : Insert 3D frames in selected images. +#@cli : Default values: 'depth=1', 'centering_x=centering_y=0' and 'left_side=right_side,lower_side=upper_side=0'. +#@cli : $ image.jpg frame_cube , +frame_cube : check "${1=1}>=0" skip ${2=0},${3=0},${4=0},${5=0},${6=0},${7=0} +e[^-1] "Insert 3D frame in image$?, with depth $1, centering point ($2,$3) and orientations (${4--1})." +foreach { +nm={n} split_opacity +if $!==2 frame_cube ${1--1} a c +else +m={max(w,h)} w={w} h={h} s={s} +imageplane3d c3d /3d. $w,$h,1 ++_frame_cube[0] $4 r3d. 0,1,0,-90 +3d. -0.5,0,-0.5 ++_frame_cube[0] $5 r3d. 0,1,0,90 +3d. 0.5,0,-0.5 ++_frame_cube[0] $6 r3d. 1,0,0,-90 +3d. 0,0.5,-0.5 ++_frame_cube[0] $7 r3d. 1,0,0,90 +3d. 0,-0.5,-0.5 ++3d 0,0,1 +3d *3d $w,$h,$m +f=1000 +cx=$2*$w/2*($f+$m*$1)/$f +cy=$3*$h/2*($f+$m*$1)/$f +s3d r[2] 3,{{2,h}/3},1,1,-1 +f[2] "if(i(2,y)<0.5,i,i+if(x==0,"$cx",if(x==1,"$cy",($1-1)*"$m")))" +y[2] a y +*3d 2 {2*$w},{2*$h},1,$s f3d {2*$f} +j3d. ..,50%,50%,0,1,2,0,0 rm.. +r $w,$h,1,100%,2 +fi +=> $nm +} +_frame_cube : +if $1==1 r3d. 0,1,0,180 rv3d. +elif $1==2 r3d. 1,0,0,180 rv3d. +elif $1==3 r3d. 0,0,1,180 +fi +#@cli frame_fuzzy : size_x[%]>=0,_size_y[%]>=0,_fuzzyness>=0,_smoothness[%]>=0,_R,_G,_B,_A +#@cli : Draw RGBA-colored fuzzy frame in selected images. +#@cli : Default values: 'size_y=size_x', 'fuzzyness=5', 'smoothness=1' and 'R=G=B=A=255'. +#@cli : $ image.jpg frame_fuzzy 20 +frame_fuzzy : skip ${2=$1},${3=5},${4=1},${5=255},${6=$5},${7=$6},${8=255} +e[^-1] "Draw $1x$2 fuzzy frame on image$?, with fuzzyness $3, smoothness $4 and RGBA color ($5,$6,$7,$8)." +to_rgba +foreach { +100%,100%,1,1,1 +padx={if(${"is_percent $1"},$1*(w-1)/2,$1)} +pady={if(${"is_percent $2"},$2*(h-1)/2,$2)} +rectangle. $padx,$pady,{w-1-$padx},{h-1-$pady} +spread. $3 b. $4 100%,100%,1,4 fc. ${5-8} +j[0] [2],0,0,0,0,1,[1] k[0] +} +#@cli frame_painting : _size[%]>=0,0<=_contrast<=1,_profile_smoothness[%]>=0,_R,_G,_B,_vignette_size[%]>=0,_vignette_contrast>=0,_defects_contrast>=0,0<=_defects_density<=100,_defects_size>=0,_defects_smoothness[%]>=0,_serial_number +#@cli : Add a painting frame to selected images. +#@cli : Default values: 'size=10%', 'contrast=0.4', 'profile_smoothness=6%', 'R=225', 'G=200', 'B=120', 'vignette_size=2%', 'vignette_contrast=400', 'defects_contrast=50', 'defects_density=10', 'defects_size=1', 'defects_smoothness=0.5%' and 'serial_number=123456789'. +#@cli : $ image.jpg frame_painting , +frame_painting : +check "${1=10%}>=0 && ${2=0.4}>=0 && $2<=1 && ${3=6%}>=0 && ${7=2%}>=0 && ${8=400}>=0 && ${9=50}>=0 && +${10=10}>=0 && $10<=100 && ${11=1}>=0 && ${12=0.5%}>=0" +skip ${4=225},${5=200},${6=120},${13=123456789} +e[^-1] "Add painting frame to image$?, with size $1, contrast $2, profile smoothness $3, color (${4-6}), +vignette size $7, vignette strength $8, defects contrast $9, defects density $10, defects size $11, +defects smoothness $12 and serial number $13." +if !$1 return fi +foreach { +$1,$1 s={max(w,h)} rm. +('${dec2bin\ $13}') -. {'0'} r. $s +transpose. b. $3 n. {1-$2},{1+$2} ++r. {{-2,w}+2*$s},100%,1,1 ++mirror. y +mv... $! transpose. r. 100%,{-4,h+2*$s},1,1 ++mirror. x +...,...,1,1,1 +polygon. 3,0,0,{$s-1},{$s-1},0,{$s-1},1,0 +polygon. 3,100%,0,{w-$s},100%,100%,100%,1,0 +..,..,1,1,1 +polygon. 3,1,0,100%,{$s-2},100%,0 +polygon. 3,1,100%,100%,{h-$s+1},100%,100%,1,0 +_frame_painting[-6--3] ${4-6},${9-12} +{-7,w+2*$s},{-7,h+2*$s},1,3 +j. [-7],0,0,0,0,1,...,1 rm[-7] mirror... y +j. [-6],0,{h-$s},0,0,1,...,1 rm[-6,-3] +j. [-4],0,0,0,0,1,..,1 rm[-4] mirror.. x +j. ...,{w-$s},0,0,0,1,..,1 rm[-3,-2] +..,..,1,1,-255 r. ..,..,1,1,0,0,0.5,0.5 +. 255 +b. $7 n. 0,$8 max[-2,-1] c. 0,255 +a[-2--1] c +r.. .,.,1,100%,0,0,0.5,0.5 blend alpha +} +_frame_painting : +foreach { ++*. $2 +*.. $3 *... $1 a[-3--1] c +100%,100% +i=0 do rand. 0,1 remove_pixels. {100-$5}% b. $6 >=. 50% i+=1 while "m=$5/200;(iam+0.2) && "$i"<10" +b. $7 g. +[-2,-1] n. -$4,$4 ++[-2,-1] c. 0,255 +} +#@cli frame_pattern : M>=3,_constrain_size={ 0 | 1 } : M>=3,_[frame_image],_constrain_size={ 0 | 1 } +#@cli : Insert selected pattern frame in selected images. +#@cli : Default values: 'pattern=0' and 'constrain_size=0'. +#@cli : $ image.jpg frame_pattern 8 +frame_pattern : check $1>=3 skip "${2=0},${3=0}" +to_colormode 0 +if ${"is_image_arg $2"} +e[^-1] "Insert $1x$1 pattern frame on image$?, using frame image$2." +pass$2 0 +foreach[^-1] { pass. +wh={0,w},{0,h} ++r[1] {0,max(1,w/($1-2))},{0,max(1,h/($1-2))},1,100%,2 +r[0] {{0,w}+2*w},{{0,h}+2*h},1,100%,0,0,0.5,0.5 +[-1]x{$1+2} a[{-$1-2}--1] x j[0] .,0,0 j[0] .,0,{{0,h}-1-h} rm. +[-1]x{$1+1} a[{-$1-2}--1] y j[0] .,0,0 j[0] .,{{0,w}-1-w} rm. +if $3 r[0] $wh,1,100%,2 fi +rm. +} rm. +else +e[^-1] "Insert $1x$1 self-pattern frame on image$?." +foreach { +wh={w},{h} ++r {max(1,w/($1-2))},{max(1,h/($1-2))},1,100%,2 r.. {$1*w},{$1*h},1,100%,0,0,0.5,0.5 +[-1]x{$1+2} a[{-$1-2}--1] x j... .,0,0 j... .,0,{{-3,h}-1-h} rm. +[-1]x{$1+1} a[{-$1-2}--1] y j.. .,0,0 j.. .,{{-2,w}-1-w} rm. +if $3 r $wh,1,100%,2 fi +} +fi +#@cli frame_round : frame_size[%]>=0,radius[%]>=0,_smoothness[%]>=0,_col1,...,_colN +#@cli : Insert an inner round frame in selected images. +#@cli : Default values: 'size=1, 'radius=30%', 'smoothness=0' and 'col=0,0,0,255'. +frame_round : check "${1=1}>=0 && ${2=20%}>=0 && ${3=0}>=0" skip "${4=0},${5=$4},${6=$4},${7=255}" +e[^-1] "Insert inner round frame on image$?, with size $1, radius $2, smoothness $3 and color (${4--1})." +if !$1" && "!$2 return fi +foreach { +size_max:=round(min(w,h)/2) +size:=cut(int(${"is_percent $1"}?$1*$size_max:$1),0,$size_max) +radius_max:=round((min(w,h)-2*$size)/2) +radius:=cut(int(${"is_percent $2"}?$2*$radius_max:$2),0,$radius_max) +if $size<1" && "$radius<1 continue fi +{0,[w,h]} +if $size>=1 +siz1:=$size-1 +rectangle. 0,0,100%,$siz1,1,1 +rectangle. 0,0,$siz1,100%,1,1 +rectangle. {w-$size},0,100%,100%,1,1 +rectangle. 0,{h-$size},100%,100%,1,1 +fi +if $radius>=1 +shape_circle[] {1+2*$radius} ==. 0 s. yx,2 +j[1] [-4],$size,$size +j[1] ...,{w#1-w#-3-$size},$size +j[1] ..,$size,{h#1-h#-2-$size} +j[1] .,{[w#1,h#1]-[w#-1,h#-1]-$size} +rm[-4--1] +fi +if $3 b. $3 n. 0,1 fi +100%,100%,1,{0,s} fc. ${4--1} j... .,0,0,0,0,1,.. k[0] +} +#@cli frame_seamless : frame_size>=0,_patch_size>0,_blend_size>=0,_frame_direction={ 0=inner (preserve image size) | 1=outer } +#@cli : Insert frame in selected images, so that tiling the resulting image makes less visible seams. +#@cli : Default values: 'patch_size=7', 'blend_size=5' and 'frame_direction=1'. +#@cli : $ image.jpg +frame_seamless 30 array 2,2 +frame_seamless : check "$1>=0 && isint(${2=7}) && $2>0 && isint(${3=5}) && $3>=0" skip ${4=1} +s0="inner" s1="outer" +e[^-1] "Insert "${s{!!$4}}" seamless frame in image$?, with size $1, patch size $2 and blend size $3." +foreach { +w2={round(w/2)} h2={round(h/2)} +w4={round(w/4)} h4={round(h/4)} +if !$4 r {max(1,w-$1)},{max(1,h-$1)},1,100%,0,0,0.5,0.5 fi +100%,100%,1,1,-1 r[-2,-1] {w+$1},{h+$1},1,100%,0,0,0.5,0.5 n. 0,1 +shift -$w2,-$h2,0,0,2 +inpaint_matchpatch.. [1],0,$2,10,$3 +rectangle. $1,$1,{w-1-$1},{h-1-$1} +shift -$w4,-$h4,0,0,2 +inpaint_matchpatch.. [1],0,$2,10,$3 +rm. +shift {$w4+$w2},{$h4+$h2},0,0,2 +} +#@cli frame_x : size_x[%],_col1,...,_colN +#@cli : Insert outer frame along the x-axis in selected images. +#@cli : Default values: 'col1=col2=col3=255' and 'col4=255'. +#@cli : $ image.jpg frame_x 20,255,0,255 +frame_x : skip ${2=255},${3=$2},${4=$3},${5=255} +e[^-1] "Insert $1 outer frame in image$? along the x-axis, with color (${2--1})." +_frame $1,0,0,${2--1} +#@cli frame_xy : size_x[%],_size_y[%],_col1,...,_colN +#@cli : Insert outer frame along the x-axis in selected images. +#@cli : Default values: 'size_y=size_x', 'col1=col2=col3=255' and 'col4=255'. +#@cli : (eq. to 'frame'). +#@cli : $ image.jpg frame_xy 1,1,0 frame_xy 20,10,255,0,255 +frame_xy : skip ${2=$1},${3=255},${4=$3},${5=$4},${6=255} +_gmic_s="$?" v + _$0 ${1--1} +_frame_xy : +e[0--3] "Insert $1x$2 outer frame in image"$_gmic_s" along the xy-axes, with color (${3--1})." +_frame $1,$2,0,${3--1} +#@cli frame_xyz : size_x[%],_size_y[%],_size_z[%]_col1,...,_colN +#@cli : Insert outer frame along the x-axis in selected images. +#@cli : Default values: 'size_y=size_x=size_z', 'col1=col2=col3=255' and 'col4=255'. +frame_xyz : skip ${2=$1},${3=$2},${4=255},${5=$4},${6=$5},${7=255} +e[^-1] "Insert $1x$2x$3 outer frame in image$? along the xyz-axes, with color (${4--1})." +_frame $1,$2,$3,${4--1} +#@cli frame_y : size_y[%],_col1,...,_colN +#@cli : Insert outer frame along the y-axis in selected images. +#@cli : Default values: 'col1=col2=col3=255' and 'col4=255'. +#@cli : $ image.jpg frame_y 20,255,0,255 +frame_y : skip ${2=255},${3=$2},${4=$3},${5=255} +e[^-1] "Insert $1 outer frame in image$? along the y-axis, with color (${2--1})." +_frame 0,$1,0,${2--1} +_frame : +foreach { +nm={n} +fw,fh,fd:=round($1*if(${is_percent\ $1},w,1)),round($2*if(${is_percent\ $2},h,1)),round($3*if(${is_percent\ $3},d,1)) +{[w,h,d]+2*[$fw,$fh,$fd]},100% fc[1] ${4--1} +j[1] [0],$fw,$fh,$fd rm[0] => $nm +} +#@cli img2ascii : _charset,_analysis_scale>0,_analysis_smoothness[%]>=0,_synthesis_scale>0,_output_ascii_filename +#@cli : Render selected images as binary ascii art. +#@cli : This command returns the corresponding the list of widths and heights (expressed as a number of characters) +#@cli : for each selected image. +#@cli : Default values: 'charset=[ascii charset]', 'analysis_scale=16', 'analysis_smoothness=20%', 'synthesis_scale=16' and '_output_ascii_filename=[undefined]'. +#@cli : $ image.jpg img2ascii , +img2ascii : check "${2=16}>0 && ${3=20%}>=0 && ${4=16}>0" +skip "${1= !\042#$%&\047()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\133\\\135^_\140abcdefghijk""lmnopqrstuvwxyz\173|\174~}","${5=}" +e[^-1] "Render image$? as binary ascii art, with charset '$1', analysis scale $2, analysis smoothness $3, +synthesis scale $4 and output ascii filename '$5'." +is_multi={$!>1} +l[] { +('"$1"') repeat w { +C={`92`}${dec2oct\ {0,@$>}} +0 t. $C,0,0,$2,1,1 +0 t. $C,0,0,$4,1,1 +} rm[0] += -1 = -1,0,100% autocrop = 0 = 0,0,100% +l[0--2:2] { r {${-max_w}+1},100%,1,1,0,0,0.5 b $3 n 0,255 a z } +l[1--1] { r {${-max_w}+1},100%,1,1,0,0,0.5 a z } +} +w={-2,w} h={-2,h} +repeat $!-2 { l[$>,-2,-1] { +luminance[0] n[0] 0,255 +nw={0,round(w/$w,1,1)} +nh={0,round(h/$h,1,1)} +if $> list_wh=$list_wh,$nw,$nh else list_wh=$nw,$nh fi +s[0] y,-$h s[0--3] x,-$w r[0--3] $w,$h,1,1,0,0 +repeat $!-2 { l[$>,-2,-1] { +rprogress {$>*100/($!-2)} +ri[0] [1] -[0] [1] sqr[0] r[0] 1,1,100%,1,2 y[0] +C={0,ym} rm[0] ++slices[1] $C mv. 0 +if narg("$5") +f[0] $C a[0,-1] c fi +} } +append_tiles[0--2] $nw,$nh +if narg("$5") s[0] c l[1] { +r $nw,$nh,1,1,1 +('"$1"') map[0] . k[0] +s y i[1-$!] ('\n') +a x +if $is_multi filename=${filename\ "$5",$>} else filename="$5" fi +ot $filename rm +} fi +} } +rm[-2,-1] u $list_wh +#@cli imagegrid : M>0,_N>0 +#@cli : Create MxN image grid from selected images. +#@cli : Default value: 'N=M'. +#@cli : $ image.jpg imagegrid 16 +imagegrid : skip ${2=$1} +e[^-1] "Create $1x$2 image grid from image$?." +foreach { +({w},{h}) ($1,$2) /[-2,-1] round. 1 r.. {^},..,..,2 rm. +({w},{h}) ($1,$2) *[-2,-1] r.. {^},..,..,2 rm. +$1,$2,1,.,1 shift. 1,1 ri. ..,0,2 * +} +#@cli imagegrid_hexagonal : _resolution>0,0<=_outline<=1 +#@cli : Create hexagonal grids from selected images. +#@cli : Default values: 'resolution=32', 'outline=0.1' and 'is_antialiased=1'. +#@cli : $ image.jpg imagegrid_hexagonal 24 +imagegrid_hexagonal : check "isint(${1=32}) && $1>0 && ${2=0.1}>=0 && $2<=1" +e[^-1] "Create hexagonal grid(s) from image$?, with resolution $1 and outline $2." +foreach { +l[] { +({'CImg3d'},6,6) +(0;{2*pi}) -. {pi/2} r. 1,7,1,1,3 +sin. cos.. a[-2,-1] x rows. 0,5 z. 0,2 +2,6,1,1,3,0 1,100%,1,1,y ++. 1 %. 6 rv[-2,-1] a[-3--1] x +3,100%,1,1,1 1,100%,1,1,1 y a y +*3d. {1-$2} +++3d {sqrt(3)} ++3d {sqrt(3)/2},1.5 +col3d... 2 col3d.. 3 col3d. 4 +3d +/3d 1.5 +} +ny={1+round(0.5*$1,1,1)} +nx={0,1+round($1*w/h*3/(sqrt(3)*4),1,1)} +array3d. $nx,$ny,1,{4*sqrt(3)/3},2 +c3d. *3d. {0,h/$1} +[0],[0] j3d. ..,50%,50%,0,1,2,0,0 rm.. +blend shapeaverage0 +} +#@cli imagegrid_triangular : pattern_width>=1,_pattern_height>=1,_pattern_type,0<=_outline_opacity<=1,_outline_color1,... +#@cli : Create triangular grids from selected images. +#@cli : 'pattern type' can be { 0=horizontal | 1=vertical | 2=crossed | 3=cube | 4=decreasing | 5=increasing }. +#@cli : Default values: 'pattern_width=24', 'pattern_height=pattern_width', 'pattern_type=0', 'outline_opacity=0.1' and 'outline_color1=0'. +#@cli : $ image.jpg imagegrid_triangular 6,10,3,0.5 +imagegrid_triangular : check "$1>=1 && ${2=$1}>=1 && isint(${3=0}) && $3>=0 && $3<=5" skip ${4=0},${5=0} +s0="horizontal" s1="vertical" s2="crossed" s3="cube" +e[^-1] "Create triangular grid(s) from image$?, with pattern width $1, height $2, pattern type '"${s$3}"', ""outline opacity $4 and outline color (${5--1})." +M={max($1,$2)} +if $3==4" || "$3==5 +$M,$M,1,1,x>y ++. 2 a[-2,-1] x ++. 4 a[-2,-1] y +$M,$M,1,1,"!x || !y || x==y" r. 200%,200%,1,1,0,2 +a[-2,-1] c +if $3==5 mirror. y fi +elif $3==3 +$M,$M,1,1,x>y 100%,100%,1,1,w-1-x>=y a[-2,-1] x ++. 2 mirror. y a[-2,-1] y +++. 4 =. 4,50%,50% =.. 2 a[-2,-1] x label. 0,0 +(2,2,2,0,1,2,1,1,3,3,3,1,1,0) map.. . rm. +100%,100%,1,1 +line. 0,0,{$M-1},{$M-1},1,1 line. {$M-1},$M,0,100%,1,1 +line. {$M-1},{$M-1},{3*$M-1},{$M-1},1,1 line. {2*$M},0,0,0,1,1 +line. {2*$M},0,100%,100%,1,1 line. {2*$M},100%,100%,0,1,1 +a[-2,-1] c +elif $3==2 +$M,$M,1,1,x>y ++. 2 mirror. x a[-2,-1] x ++. 4 mirror. y a[-2,-1] y +100%,100%,1,1,"!x || !y || x==int(w/2) || y==int(h/2) || x==y || w-1-x==y" +a[-2,-1] c +elif $3==1 +$M,$M,1,1,x>y 100%,100%,1,1,w-1-x<=y a[-2,-1] y ++. 2 mirror. x a[-2,-1] x +100%,100%,1,1,"!x || x==int(w/2) || x==y || w-1-x==y" +a[-2,-1] c +else +$M,$M,1,1,x>y 100%,100%,1,1,w-1-x>=y a[-2,-1] x ++. 2 mirror. y a[-2,-1] y +100%,100%,1,1,"!y || y==int(h/2) || x==y || w-1-x==y" +a[-2,-1] c +fi +repeat $!-1 { +wh={$>,w},{$>,h} +if $1>$2 r[$>] 100%,{$>,$1*h/$2} elif $1<$2 r[$>] {$>,$2*w/$1} fi ++r. [$>],[$>],1,2,0,2,0.5,0.5 +s. c +blend[$>,-2] shapeaverage ++fc[$>] ${5--1} j[$>] .,0,0,0,0,$4,.. rm[-2,-1] +r[$>] $wh,1,100%,2 +} +rm. +#@cli linearize_tiles : M>0,_N>0 +#@cli : Linearize MxN tiles on selected images. +#@cli : Default value: 'N=M'. +#@cli : $ image.jpg +linearize_tiles 16 +linearize_tiles : check "$1>0 && ${2=$1}>0" +e[^-1] "Linearize $1x$2 tiles on image$?." +foreach { +nm={n} +s={s} split_tiles $1,$2 s c +foreach { +wh={w},{h} ++f x +f. y +f. 1 y a[^0] x solve.. . rm. +$wh,1,1,{@0}"*x + "{@1}"*y + "{@2} rm.. +} +repeat int($!/$s) { a[-$s--1] c mv. 0 } append_tiles $1,$2 => $nm +} +#@cli map_sprites : _nb_sprites>=1,_allow_rotation={ 0=none | 1=90 deg. | 2=180 deg. } +#@cli : Map set of sprites (defined as the 'nb_sprites' latest images of the selection) to other selected images, +#@cli : according to the luminosity of their pixel values. +#@cli : $ image.jpg resize2dy 48 repeat 16 ball {8+2*$>},${-rgb} mul[-1] {(1+$>)/16} done map_sprites 16 +map_sprites : check "isint($1) && $1>0 && isint(${2=0}) && $2>=0 && $2<=2" +e[^-1] "Map set of $1 sprites to image selection$?." +norm[0--{$1+1}] quantize[0--{$1+1}] $1,0,1 +slices[-$1--1] 0 r[-$1--1] ${max_wh[-$1--1]},1,100%,0,0,0.5,0.5 +if $2==1 +N={4*$1} +repeat $!-$1 { *[$>] 4 +rand[$>] 0,3 round. +[$>,-1] } +repeat $1 { l[{1+$<}] { +mirror xy +rotate 90 } } +elif $2==2 +N={2*$1} +repeat $!-$1 { *[$>] 2 +rand[$>] 0,1 round. +[$>,-1] } +repeat $1 { l[{1+$<}] { +mirror xy } } +else N=$1 fi +r[-$N--1] 100%,100%,1,${max_s[-$N--1]} w={w} h={h} a[-$N--1] x +r[^-1] ${w}00%,${h}00%,1,1 *[^-1] $w +(0,{$w-1};0,{$w-1}^0,0;{$h-1},{$h-1}) r. $w,$h,1,2,3 round. +repeat $!-2 { +r. [$>],[$>],1,2,0,2 r[$>] 100%,100%,1,2,0 +[$>,-1] +warp.. [$>],0,0,1 rv[$>,-1] rm. } rm[-2,-1] +#@cli pack : is_ratio_constraint={ 0 | 1 },_sort_criterion +#@cli : Pack selected images into a single image. +#@cli : The returned status contains the list of new (x,y) offsets for each input image. +#@cli : Parameter 'is_ratio_constraint' tells if the resulting image must tend to a square image. +#@cli : Default values: 'is_ratio_constraint=0' and 'sort_criterion=max(w,h)'. +#@cli : $ image.jpg repeat 10 +resize2dx[-1] 75% balance_gamma[-1] ${-rgb} done pack 0 +pack : skip ${1=0},${2=max(w,h)} +e[^-1] "Pack image$? into a single image." +if $!<2 return fi +if ${-max_d}>1 error[0--3] "Command '$0': Selected images contain at least one volumetric image (depth>1). +Should all be 2D." fi +nm={0,n} to_colormode 0 +repeat $! { nm$>={$>,n} =>[$>] ${nm$>}:$> } +m "_pack : ('{n}') l. { s +,{':'} u {t} rm }" +if ['$2']=='n' sort_list +,n else sort_list -,"$2" fi +offsets${-_pack[0]}=0,0 +N=$! +i[0] 0 +do l[0,1,2] { +w1,h1,w2,h2={[w#1,h#1,w#2,h#2]} +slot,min_slot_area=-1,inf +repeat h#0 { +x,y,w,h={0,crop(0,$>,4,1)} +slot_area={$w*$h} +if $w>=$w2" && "$h>=$h2" && "$slot_area<=$min_slot_area +slot,min_slot_area=$>,$slot_area +fi +} +if $slot>=0 +x,y,w,h={0,crop(0,$slot,4,1)} +j[1] [2],$x,$y offsets${-_pack[2]}=$x,$y +l[0] { +s y rm[$slot] +area1={max(($w-$w2)*$h,$w2*($h-$h2))} +area2={max(($w-$w2)*$h2,$w*($h-$h2))} +if $area1>=$area2 +if $w2<$w i[$slot] ({$x+$w2},$y,{$w-$w2},$h) fi +if $h2<$h i[$slot] ($x,{$y+$h2},$w2,{$h-$h2}) fi +else +if $w2<$w i[$slot] ({$x+$w2},$y,{$w-$w2},$h2) fi +if $h2<$h i[$slot] ($x,{$y+$h2},$w,{$h-$h2}) fi +fi +a y if !$! 0 fi +} +rm[2] +else +if $1 +metric_h={abs($w1+$w2-max($h1,$h2))} +metric_v={abs($h1+$h2-max($w1,$w2))} +else +metric_h={if($h2<$h1,$w2*($h1-$h2),$w1*($h2-$h1))} +metric_v={if($w2<$w1,($w1-$w2)*$h2,($w2-$w1)*$h1)} +fi +if $metric_h<=$metric_v +offsets${-_pack[2]}=$w1,0 +a[1,2] x,0 +if $h2<$h1 ($w1,$h2,$w2,{$h1-$h2}) a[0,-1] y +elif $h2>$h1 (0,$h1,$w1,{$h2-$h1}) a[0,-1] y +fi +else +offsets${-_pack[2]}=0,$h1 +a[1,2] y,0 +if $w2<$w1 ($w2,$h1,{$w1-$w2},$h2) a[0,-1] y +elif $w2>$w1 ($w1,0,{$w2-$w1},$h1) a[0,-1] y +fi +fi +fi +} while $!>2 +rm[0] +status= +repeat $N { if narg($status) status=$status,${offsets$>} else status=${offsets$>} fi } +=> $nm u $status +um _pack +#@cli puzzle : _width>0,_height>0,_M>=1,_N>=1,_curvature,_centering,_connectors_variability,_resolution>=1 +#@cli : Input puzzle binary mask with specified size and geometry. +#@cli : Default values: 'width=height=512', 'M=N=5', 'curvature=0.5', 'centering=0.5', 'connectors_variability=0.5' and 'resolution=64'. +#@cli : $ puzzle , +puzzle : check "isint(${1=512}) && $1>0 && isint(${2=$1}) && $2>0 && isint(${3=5}) && $3>0 && +isint(${4=$3}) && $4>0 && isint(${8=64}) && $8>0" +skip ${5=0.5},${6=0.5},${7=0.5} +e[^-1] "Draw $3x$4 puzzle pattern on image$?, with curvature $5, centering $6, connectors variability $7 +and resolution $8." +l[] { +if $4>=2 _puzzle[] $3,{$4-1},${5-8} +3d. 0,1 fi +if $3>=2 _puzzle[] $4,{$3-1},${5-8} r3d. 0,0,1,-90 +3d. 1,$4 fi +*3d {$1/$3},{$2/$4} quadrangle3d 0,0,0,{$1-1},0,0,{$1-1},{$2-1},0,0,{$2-1},0 p3d. 1 +3d col3d 1 +$1,$2 j3d. ..,0,0,0,1,1,0,0 rm.. +} +_puzzle : +R={$6*$1} +repeat $2 { +({'CImg3d'},$R,{$R-1}) +repeat $1 { +sign={if(u<=0.5,-1,1)} +center={$4*u(-0.25,0.25)} +knob={$5*u(-0.05,0.12)} +($>,0;{0.2+$center+$>},{-$sign*$3*0.1};{0.4+$center+$>},0;{0.35+$center+$>},{0.1*$sign};{0.45+$center+$>},{(0.15+$knob)*$sign};{0.55+$center+$>},{(0.15+$knob)*$sign};{0.65+$center+$>},{0.1*$sign};{0.6+$center+$>},0;{0.8+$center+$>},{-$sign*$3*0.1}) +} +($1,0) a[-{$1+1}--1] y r. 2,$R,1,1,5 z. 0,2 +(2,0,1;2,{$R-2},{$R-1}) r. 3,{$R-1},1,1,3 round. +3,{h},1,1,255 1,{h},1,1,255 y[-5--1] y a[-5--1] y +3d. 0,$> +} +3d +#@cli quadratize_tiles : M>0,_N>0 +#@cli : Quadratize MxN tiles on selected images. +#@cli : Default value: 'N=M'. +#@cli : $ image.jpg +quadratize_tiles 16 +quadratize_tiles : check "$1>0 && ${2=$1}>0" +e[^-1] "Quadratize $1x$2 tiles on image$?." +foreach { +nm={n} +s={s} split_tiles $1,$2 s c +foreach { +wh={w},{h} ++f x^2 +f. y^2 +f. x*y +f. x +f. y +f. 1 y a[^0] x +solve.. . rm. +$wh,1,1,{@0}"*x^2 + "{@1}"*y^2 + "{@2}"*x*y +"{@3}"*x + "{@4}"*y + "{@5} rm.. +} +repeat int($!/$s) { a[-$s--1] c mv. 0 } append_tiles $1,$2 +=> $nm +} +#@cli rotate_tiles : angle,_M>0,N>0 +#@cli : Apply MxN tiled-rotation effect on selected images. +#@cli : Default values: 'M=8' and 'N=M'. +#@cli : $ image.jpg to_rgba rotate_tiles 10,8 drop_shadow 10,10 display_rgba +rotate_tiles : skip ${2=8},${3=$2} +e[^-1] "Apply $2x$3 tiled-rotation effect on image$?, with angle $1 deg." +split_tiles $2,$3,1 rotate $1 append_tiles $2,$3 +#@cli shift_tiles : M>0,_N>0,_amplitude +#@cli : Apply MxN tiled-shift effect on selected images. +#@cli : Default values: 'N=M' and 'amplitude=20'. +#@cli : $ image.jpg +shift_tiles 8,8,10 +shift_tiles : check "${2=$1}>=0" skip ${3=20} +e[^-1] "Apply $1x$2 tiled-shift effect on image$?, with amplitude $3." +foreach { $1,$2,1,2 noise. $3 r. ..,..,1,2 warp.. .,1,1,0 rm. } +#@cli taquin : M>0,_N>0,_remove_tile={ 0=none | 1=first | 2=last | 3=random },_relief,_border_thickness[%],_border_outline[%],_outline_color +#@cli : Create MxN taquin puzzle from selected images. +#@cli : Default value: 'N=M', 'relief=50', 'border_thickness=5', 'border_outline=0' and 'remove_tile=0'. +#@cli : $ image.jpg +taquin 8 +taquin : check "isint($1) && $1>0 & isint(${2=$1}) && $2>0" +skip ${3=0},${4=50},${5=5%},${6=0},${7=0},${8=$7},${9=$8},${10=255} +e[^-1] "Create $1x$2 taquin puzzle from image$?, with relief $4, border thickness $5, border outline $6 and +outline color (${7--1})." +foreach { +nm={n} +split_tiles $1,$2 r ${-min_wh},100%,100%,0 +100%,100%,1,1,1 +if ${"is_percent $5"} rectangle. {100*$5/2}%,{100*$5/2}%,{100-50*$5}%,{100-50*$5}%,1,0 +else rectangle. $5,$5,{w-1-$5},{h-1-$5},1,0 fi +*. '1-2*(x/w,-1] { split_opacity[0] +[0] . a[^-1] c } } rm. c 0,255 +frame $6,$6,${7-10} +if $3==3 f. 0 fi +repeat $! { mv[$>] {u($!)} } +if $3==1 f[0] 0 elif $3==2 f. 0 fi +append_tiles $1,$2 => $nm +} +#@cli tunnel : _level>=0,_factor>0,_centering_x,_centering_y,_opacity,_angle +#@cli : Apply tunnel effect on selected images. +#@cli : Default values: 'level=9', 'factor=80%', 'centering_x=centering_y=0.5', 'opacity=1' and 'angle=0' +#@cli : $ image.jpg tunnel 20 +tunnel : check "${1=9}>=0 && ${2=80%}>0" skip ${3=0.5},${4=0.5},${5=0.1},${6=0} +e[^-1] "Apply tunnel effect on image$?, with depth $1, factor $2, centering ($3,$4), opacity $5 and angle $6." +foreach { +repeat $1 { ++r. $2,$2,1,100%,5 +if $6 100%,100%,1,1,1 rotate[-2,-1] $6,1,0 erode. 3 j... ..,{({-3,w}-w)*$3},{({-3,h}-h)*$4},0,0,$5,. rm[-2,-1] +else j.. .,{({-2,w}-w)*$3},{({-2,h}-h)*$4},0,0,$5 rm. fi +} +} +c 0,255 +#@cli :: Artistic +#@cli boxfitting : _min_box_size>=1,_max_box_size>=0,_initial_density>=0,_min_spacing>0 +#@cli : Apply box fitting effect on selected images, as displayed the web page: +#@cli : . +#@cli : Default values: 'min_box_size=1', 'max_box_size=0', 'initial_density=0.25' and 'min_spacing=1'. +#@cli : $ image.jpg boxfitting , +boxfitting : check "isint(${1=3}) && $1>=1 && isint(${2=0}) && $2>=0 && ${3=0.25}>=0 && isint(${4=1}) && $4>0" +e[^-1] "Apply box fitting effect on image$?, with box sizes ($1,$2), initial density $3 and min spacing $4." +min_spacing,min_size={[$4,$1+$4-1]} +foreach { +max_size={$4-1+($2?$2:max(w,h))} +prec=5 +100%,100% +repeat inf { +if $><1 +100%,100% noise. {max(1e-3,$3)},2 ==. 1 +else ++distance. 1 +rand. 0,1 *[-2,-1] max_patch. {round($prec*$min_size)} +prec={max(1,$prec*0.9)} +fi +0 eval.. ">i && !max(crop(#-3,x-1,y-1,3,3))?(da_push([x,y,1]); i(#-3,x,y) = 1)" +if !i[h-1] rm[-2,-1] break fi +r. 1,{i[h-1]},1,3,0 rm.. +do +f. "> +begin(is_new = 0; const boundary = 1); +Xc = i0; Yc = i1; N = i2; +N>0?( +N2 = int(N/2); N1 = N - N2 - 1; +is_odd = N%2; is_new = 0; +X0 = Xc - N1 - 1; X0m1 = X0 - 1; Y0 = Yc - N1 - 1; Y0m1 = Y0 - 1; +X1 = Xc + N2 + 1; X1p1 = X1 + 1; Y1 = Yc + N2 + 1; Y1p1 = Y1 + 1; +is_up = is_down = 1; +for (X = X0, (is_up || is_down) && X<=X1, ++X, +is_up&=!i(#-2,X,Y0) && !i(#-2,X,Y0m1); +is_down&=!i(#-2,X,Y1) && !i(#-2,X,Y1p1); +); +is_left = is_right = 1; +for (Y = Y0, (is_left || is_right) && Y<=Y1, ++Y, +is_left&=!i(#-2,X0,Y) && !i(#-2,X0m1,Y); +is_right&=!i(#-2,X1,Y) && !i(#-2,X1p1,Y); +); +is_left && is_up && !i(#-2,X0m1,Y0m1)?( # Left/Up +polygon(#-2,2,X0,Y0,X1 - 1,Y0,1,1); polygon(#-2,2,X0,Y0,X0,Y1 - 1,1,1); +Xc-=is_odd; Yc-=is_odd; is_new=1; +):is_right && is_up && !i(#-2,X1p1,Y0m1)?( # Right/Up +polygon(#-2,2,X0 + 1,Y0,X1,Y0,1,1); polygon(#-2,2,X1,Y0,X1,Y1 - 1,1,1); +Xc+=!is_odd; Yc-=is_odd; is_new=1; +):is_left && is_down && !i(#-2,X0m1,Y1p1)?( # Left/Bottom +polygon(#-2,2,X0,Y1,X1 - 1,Y1,1,1); polygon(#-2,2,X0,Y1,X0,Y0 + 1,1,1); +Xc-=is_odd; Yc+=!is_odd; is_new=1; +):is_right && is_down && !i(#-2,X1p1,Y1p1)?( # Right/Bottom +polygon(#-2,2,X1,Y0 + 1,X1,Y1,1,1); polygon(#-2,2,X1,Y1,X0 + 1,Y1,1,1); +Xc+=!is_odd; Yc+=!is_odd; is_new=1; +); +is_new?(++N>=$max_size?(N = -N)):(N = -N); +); +[ Xc,Yc,N ]" +sh. 100% is_new={iM>0} rm. +while $is_new +f. " +Xc = i0; Yc = i1; N = abs(i2); +N<$min_size?( +N2 = int(N/2); N1 = N - N2 - 1; +X0 = Xc - N1; Y0 = Yc - N1; +X1 = Xc + N2; Y1 = Yc + N2; +polygon(#-2,4,X0,Y0,X1,Y0,X1,Y1,X0,Y1,1,0); +[ -1,-1,-1 ]; +):[ Xc,Yc,N ]" +discard. -1 +if !h rm. break fi +rm. +} +if $min_spacing>1 r. {[w,h]+2},1,1,0,0,0.5,0.5 erode. {$min_spacing} z. 1,1,{[w,h]-2} fi +blend shapeaverage0 +} +#@cli brushify : [brush],_brush_nb_sizes>=1,0<=_brush_min_size_factor<=1,_brush_nb_orientations>=1,_brush_light_type,0<=_brush_light_strength<=1,_brush_opacity,_painting_density[%]>=0,0<=_painting_contours_coherence<=1,0<=_painting_orientation_coherence<=1,_painting_coherence_alpha[%]>=0,_painting_coherence_sigma[%]>=0,_painting_primary_angle,0<=_painting_angle_dispersion<=1 +#@cli : Apply specified brush to create painterly versions of specified images. +#@cli : 'brush_light_type' can be { 0=none | 1=flat | 2=darken | 3=lighten | 4=full }. +#@cli : Default values: 'brush_nb_sizes=3', 'brush_min_size_factor=0.66', 'brush_nb_orientations=12', 'brush_light_type=0', 'brush_light_strength=0.25', 'brush_opacity=0.8', 'painting_density=20%', 'painting_contours_coherence=0.9', 'painting_orientation_coherence=0.9', 'painting_coherence_alpha=1', 'painting_coherence_sigma=1', 'painting_primary_angle=0', 'painting_angle_dispersion=0.2' +#@cli : $ image.jpg 40,40 gaussian[-1] 10,4 spread[-1] 10,0 brushify[0] [1],1 +brushify : check ${"is_image_arg $1"}" &&"\ +"isint(${2=4}) && $2>=1 &&"\ +"${3=0.25}>=0 && $3<=1 &&"\ +"isint(${4=12}) && $4>=1 &&"\ +"isint(${5=4}) && $5>=0 &&"\ +"${6=0.07}>=0 && $6<=1 &&"\ +"isnum(${7=0.75}) &&"\ +"${8=40%}>=0 && $8>=0 &&"\ +"${9=0.7}>=0 && $9<=1 &&"\ +"${10=1}>=0 && $10<=1 &&"\ +"${11=1}>=0 && ${12=0.5%}>=0 &&"\ +"isnum(${13=45}) &&"\ +"${14=0.2}>=0 && $14<=1" +e[^-1] "Brushify image$?, with brush $1." +pass$1 0 l. { +slices 0 max 1e-8 norm n 0,1 threshold 0.1,1 autocrop. +repeat $4 { +rotate[0] {360*$>/$4} } +rm[0] n 0,1 threshold 0.1,1 +autocrop r ${-max_wh},1,1,0,0,0.5,0.5 +a z => brush +wb={w} hb={h} whb={wh} ls={255*$6} +if $5==0 +f. 0 +elif $5==1 +n. -$ls,0 +elif $5==2 +g xy +[-2,-1] min. 0 n. -$ls,0 +elif $5==3 +g xy +[-2,-1] max. 0 n. 0,$ls +else +g xy +[-2,-1] n. -$ls,$ls +fi +=> brushlight +repeat $2-1 { +ratio={v=(1+$>)/max(1,$2-1);100*((1-v)+$3*v)}% ++r[brush,brushlight] $ratio,$ratio,100%,1,2 +ri[-2,-1] [brush],0,0,0.5,0.5 +} +a[0--1:2] z a[^0] z +} +repeat $!-2 { l[$>,brush,brushlight] { +s={0,s} nm={0,n} to_rgb[0] =>[0] img ++diffusiontensors[img] $9,$10,$11,$12 => geometry ++channels[geometry] 0 sh[geometry] 2 +[-2,-1] ^. 0.3 quantize. $2,0 *. -1 +. $2 -. 1 => contours +1,{img,max(1,${"is_percent $8"}?wh*$8:$8)} rand. 0,{img,w-1} +rand. 0,{img,h-1} a[-2,-1] c => pts ++to_rgba[img] => res +f[pts] "* +begin( +S2 = round(0.5*["$wb","$hb"]); +brush_r = brush_g = brush_b = brush_a = vector"$whb"(255); +ang = $13*pi/180; +cu = [ cos(ang),sin(ang) ]; +cv = [ -cu[1],cu[0] ]; +T = mul(cu,cu,2) + $14*mul(cv,cv,2); +); +P = I; +G = I(#"$geometry",P); +ang = u(pi); +V = [ G[0],G[1],G[1],G[2] ]*(T*[ cos(ang),sin(ang) ]); +amp = i(#"$contours",P); #cut($2-round(5*$2*sqrt(G[0] + G[2])),0,$2-1); +ang = round(((atan2(V[1],V[0])%(2*pi))*$4/(2*pi)))%$4; +col = I(#"$img",P); +ind = amp*$4 + ang; +brush = crop(#"$brush",0,0,ind,0,"$wb","$hb",1,1); +brushlight = crop(#"$brushlight",0,0,ind,0,"$wb","$hb",1,1); +brush_r = cut(col[0] + brushlight,0,255); +brush_g = cut(col[1] + brushlight,0,255); +brush_b = cut(col[2] + brushlight,0,255); +PmS2 = P - S2; +draw(#"$res",[brush_r,brush_g,brush_b,brush_a],PmS2[0],PmS2[1],0,0,"$wb","$hb",1,4,$7,brush,1); +P" +k[res,brush,brushlight] mv[res] 0 =>[0] $nm to_colormode[0] {$s+($s%2)} +} } rm[brush,brushlight] +#@cli cartoon : _smoothness,_sharpening,_threshold>=0,_thickness>=0,_color>=0,quantization>0 +#@cli : Apply cartoon effect on selected images. +#@cli : Default values: 'smoothness=3', 'sharpening=150', 'threshold=20', 'thickness=0.25', 'color=1.5' and 'quantization=8'. +#@cli : $ image.jpg cartoon 3,50,10,0.25,3,16 +cartoon : skip ${1=3},${2=150},${3=15},${4=0.25},${5=1.5},${6=8} +e[^-1] "Apply cartoon effect on image$?, with smoothness $1, sharpening $2, threshold $3, thickness $4, color $5 +and quantization $6." +foreach { +split_opacity +l[0] { +to_rgb +b $1 sharpen $2,1 c 0,255 n 0,255 +if $4 +edges $3 b. $4 >=. 0.9 else 100%,100%,1,1,1 fi +rgb2lab.. s.. c *[-3,-2] $5 a[-4--2] c lab2rgb.. +quantize.. $6,1,-1 +n.. 0,255 * +} +a c +} +#@cli color_ellipses : _count>0,_radius>=0,_opacity>=0 +#@cli : Add random color ellipses to selected images. +#@cli : Default values: 'count=400', 'radius=5' and 'opacity=0.1'. +#@cli : $ image.jpg +color_ellipses ,,0.15 +color_ellipses : skip ${1=1400},${2=5},${3=0.1} +e[^-1] "Add $1 random color ellipses to image$?, with maximum radius $2 and opacity $1." +repeat $1 { +ellipse {u(0,100)}%,{u(0,100)}%,{u(0,$2)}%,{u(0,$2)}%,{u(0,360)},$3,{u(60,255)},{u(60,255)},{u(60,255)},255 +} +#@cli cubism : _density>=0,0<=_thickness<=50,_max_angle,_opacity,_smoothness>=0 +#@cli : Apply cubism effect on selected images. +#@cli : Default values: 'density=50', 'thickness=10', 'max_angle=75', 'opacity=0.7' and 'smoothness=0'. +#@cli : $ image.jpg cubism , +cubism : check "${1=50}>=0 && ${2=10}>=0 && $2<=50 && ${5=0}>=0" skip ${3=75},${4=0.7} +e[^-1] "Apply cubism effect on image$?, with density $1, thickness $2, maximum angle $3 deg., opacity $4 and +smoothness $5." +if "!$1 || !$2 || !$3 || !$4" return fi +foreach { +w={w} h={h} s={s} +P={round($2*max(w,h)/200)} +N={round(1.5*$1*w*h/(4*$P)/100)} +('CImg3d') +. 0.5 ({4*$N};$N) +1,$N rand. $P,{$w-1-$P} +rand. $P,{$h-1-$P} a[-2,-1] x round. +++. '-$P,-$P' ++.. '$P,-$P' ++... '$P,$P' ++[-4] '-$P,$P' +a[-4--1] x i.. (12,0,1,2,3;12,{4*($N-1)},{4*($N-1)+1},{4*($N-1)+2},{4*($N-1)+3}) +r.. 5,$N,1,1,3 round.. 1 a[-2,-1] x +1,$N rand. {225-$3},{225+$3} *. {pi/180} ++sin. cos.. +*. -1 ... a[-4--3] x a[-2,-1] x z[-4,-2,-1] 0,2 +*[-2,-1] -1 a[-4--1] x *. {sqrt(2)*$P} +r... 400%,100%,1,1,0,2 +[-3,-1] +(-128;$w;$h;$s) +b[0] $5 +if $N>1 4,{$N-1},1,1,-128,0,0,0 fi +1,$N,1,1,1 +y[1--1] a[1--1] y rv3d. +if $4>=1 j3d[0] [1],0,0,0,1,2,0,0 rm[1] +else +j3d[0] [1],0,0,0,1,2,0,0 rm[1] blend alpha,$4 +fi +} +#@cli draw_whirl : _amplitude>=0 +#@cli : Apply whirl drawing effect on selected images. +#@cli : Default value: 'amplitude=100'. +#@cli : $ image.jpg draw_whirl , +draw_whirl : skip ${1=100} +e[^-1] "Apply whirl drawing effect on image$? with amplitude $1." +foreach { +100%,100% noise. 70,2 ==. 1 *. 255 ri. .. &[-1,-2] smooth. $1,0,1,2,2 +sqrt. n. 0,255 equalize. +} +#@cli drawing : _amplitude>=0 +#@cli : Apply drawing effect on selected images. +#@cli : Default value: 'amplitude=200'. +#@cli : $ image.jpg +drawing , +drawing : skip ${1=200} +e[^-1] "Apply drawing effect on image$? with amplitude $1." +foreach { +split_opacity +l[0] { +to_rgb +smooth $1,0.2,1,3,3 b 2 sharpen 1000 [0] +r[0] 20,20,1,3,2 equalize[0] index[1] [0],1,1 +=> {0,n} rm[0] +} +a c +} +#@cli drop_shadow : _offset_x[%],_offset_y[%],_smoothness[%]>=0,0<=_curvature<=1,_expand_size={ 0 | 1 } +#@cli : Drop shadow behind selected images. +#@cli : Default values: 'offset_x=20', 'offset_y=offset_x', 'smoothness=5', 'curvature=0' and 'expand_size=1'. +#@cli : $ image.jpg drop_shadow 10,20,5,0.5 expand_xy 20,0 display_rgba +drop_shadow : check "${3=5}>=0 && ${4=0}>=0 && $4<=1" skip ${1=20},${2=$1},${5=1} +e[^-1] "Drop shadow behind image$?, with offsets ($1,$2), smoothness $3 and curvature $4." +to_a +foreach { +nm={n} +dx={if(${is_percent\ $1},w*$1,$1)} +dy={if(${is_percent\ $2},h*$2,$2)} +sigma={if(${is_percent\ $3},min(w,h)*$3,$3)} +w,h,s={[w,h,s]} sh. 100% coords=${autocrop_coords.\ 0} rm. z $coords +r {w+abs($dx)},{h+abs($dy)},1,100%,0,0,{if($dx>0,0,1)},{if($dy>0,0,1)} +r. {w+4*$sigma},{h+4*$sigma},1,100%,0,0,0.5,0.5 ++channels. 100% +if !$4 shift. $dx,$dy +else +(0;{pi}) ri. ..,3 sin. *. -$4 +. 1 *. $dx +(0,{pi}) ri. ..,3 sin. *. -$4 +. 1 *. $dy +a[-2,-1] c warp.. .,1,0,0 rm. +fi +b. $sigma,0 +r. 100%,100%,1,2,0,0,0,0,0,1 mv. 0 blend alpha ++channels. 100% >=. 1 * autocrop 0 +if !$5 $w,$h,1,$s j. ..,{arg(1,$coords)},{arg(2,$coords)} rm.. fi +=> $nm +} +#@cli ellipsionism : _R>0[%],_r>0[%],_smoothness>=0[%],_opacity,_outline>0,_density>0 +#@cli : Apply ellipsionism filter to selected images. +#@cli : Default values: 'R=10', 'r=3', 'smoothness=1%', 'opacity=0.7', 'outline=8' and 'density=0.6'. +#@cli : $ image.jpg ellipsionism , +ellipsionism : check "${1=10}>0 && ${2=3}>0 && ${5=8}>0 && ${6=0.6}>0" skip ${3=1%},${4=0.7} +e[^-1] "Apply ellipsionism filter to image$?, with radii ($1,$2), smoothness $3, opacity $4 and outline $5." +foreach { +to_color ++luminance g. xy a[-2,-1] c b. $3 orientation. +sh. 0 sh.. 1 atan2. .. *. {180/pi} +. 90 rm[-2,-1] channels. 1,1 +100%,100%,1,4 +eval " +const interpolation = 1; +const N = $6*wh/max($1,$2); +repeat (N,n, +x = round(u(w-1)); y = round(u(h-1)); +ellipse(x,y,$1,$2,i(#-2,x,y)°,$4,I(#0,x,y),255); +ellipse(x,y,-$1,-$2,i(#-2,x,y)°,$4,0xFFFFFFFF,I(#0,x,y)/$5,255); +)" +rm.. blend alpha +} +#@cli fire_edges : _edges>=0,0<=_attenuation<=1,_smoothness>=0,_threshold>=0,_nb_frames>0,_starting_frame>=0,frame_skip>=0 +#@cli : Generate fire effect from edges of selected images. +#@cli : Default values: 'edges=0.7', 'attenuation=0.25', 'smoothness=0.5', 'threshold=25', 'nb_frames=1', 'starting_frame=20' and 'frame_skip=0'. +#@cli : $ image.jpg fire_edges , +fire_edges : check "${1=0.7}>=0 && ${2=0.25}>=0 && $2<=1 && ${3=0.5}>=0 && ${4=25}>=0 && ${5=1}>0 && +${6=20}>=0 && ${7=0}>=0" +e[^-1] "Generate fire effect from edges of image$?, with edges $1, attenuation $2, smoothness $3, threshold $4, +$5 frames, starting frame $6 and frame skip $7." +foreach { +nm={n} +norm +gradient_norm n. 0,1 roundify. $1 f[0] 0 +(0,0,0;0,0,0;1,1,1;0,1,0) *. {(1-$2^4)/4} +repeat $5*(1+$7)+$6 { +{0,w},{0,h} rand. 0,255 *. [1] +b. $3 +if $4 >=. $4% else equalize. fi +n. 0,255 +j[0] .,0,0,0,0,1,[1],1 rm. +correlate[0] [2] +if $>>=$6" && "($>-$6)%($7+1)==0 [0] fi +} +rm[0-2] =>[^] $nm +} +(0,255,255,255,255^0,0,255,255,255^0,0,0,128,255) r. 256,1,1,3,3 +map[^-1] . rm. +#@cli fractalize : 0<=detail_level<=1 +#@cli : Randomly fractalize selected images. +#@cli : Default value: 'detail_level=0.8' +#@cli : $ image.jpg fractalize , +fractalize : check "${1=0.8}>=0 && $1<=1" +e[^-1] "Randomly fractalize image$?, with detail level $1." +xc=0.4433 +yc=0.2645 +delta=0.1 +c0r=0.317 +c0i=0.03 +foreach { +nm={n} +luminance equalize 256 b 0.25% n 0,255 +100%,100% +dx={$delta*w/max(w,h)} +dy={$delta*h/max(w,h)} +x0={$xc-$dx/2} +y0={$yc-$dy/2} +x1={$xc+$dx/2} +y1={$yc+$dy/2} +mandelbrot. $x0,$y0,$x1,$y1,256,1,$c0r,$c0i ++==. 0 inpaint.. . rm. +n. 0,256 +16,1,1,3 rand. 0,255 r. 256,1,1,3,3 map.. . rm. +s. c +i[2,3] [0] +s={0.1*(1-$1)} +parallel "register_nonrigid[1] [0],"$s",5","register_nonrigid[3] [2],"$s",5","register_nonrigid[5] [4],"$s",5" +rm[0,2,4] a c => $nm +} +#@cli glow : _amplitude>=0 +#@cli : Add soft glow on selected images. +#@cli : Default value: 'amplitude=1%'. +#@cli : $ image.jpg glow , +glow : skip ${1=1%} +e[^-1] "Add soft glow on image$?, with amplitude $1." +foreach { split_opacity +b[0] $1 n. [0] blend_edges[0,-1] 1 a c } +#@cli halftone : nb_levels>=2,_size_dark>=2,_size_bright>=2,_shape={ 0=square | 1=diamond | 2=circle | 3=inv-square | 4=inv-diamond | 5=inv-circle },_smoothness[%]>=0 +#@cli : Apply halftone dithering to selected images. +#@cli : Default values: 'nb_levels=5', 'size_dark=8', 'size_bright=8', 'shape=5' and 'smoothnesss=0'. +#@cli : $ image.jpg halftone , +halftone : check "${1=5}>=2 && ${2=8}>=2 && ${3=8}>=2 && ${5=0}>=0" skip ${4=5} +s0="square" s1="diamond" s2="circle" s3="inv-square" s4="inv-diamond" s5="inv-circle" +e[^-1] "Apply halftone dithering to image$?, with $1 levels, dark size $3, bright size $4, "${s$4}" shape and smoothness $5." +foreach { +s c +foreach { +(0,255) a y quantize $1,0 rows 0,{h-2} +repeat $1 { +s={round(($2*$<+$3*$>)/($1-1))} +$s,$s =. 1,50%,50% distance. 1,{$4%3} +shift. {round(w/2)},{round(h/2)},0,0,2 min[-2,-1] +if $4>=3 <. {100*$} +else <. {100*$>/($1-1.1)}% *. 255 -. $> +fi +ri. ..,0,2 b. $5 +==.. $> *[-2,-1] +[-2,-1] +} +} +a c +} +#@cli hardsketchbw : _amplitude>=0,_density>=0,_opacity,0<=_edge_threshold<=100,_is_fast={ 0 | 1 } +#@cli : Apply hard B&W sketch effect on selected images. +#@cli : Default values: 'amplitude=1000', 'sampling=3', 'opacity=0.1', 'edge_threshold=20' and 'is_fast=0'. +#@cli : $ image.jpg +hardsketchbw 200,70,0.1,10 median[-1] 2 +local reverse blur[-1] 3 blend[-2,-1] overlay done +hardsketchbw : skip ${1=300},${2=50},${3=0.1},${4=20},${5=0} +e[^-1] "Apply hard B&W sketch effect on image$?, with amplitude $1, density $2, opacity $3 and edge threshold $4." +if !$2 channels 0 f 255 return fi +luminance n 0,1 +if $5 +foreach { +nm={n} +g xy rv *.. -1 a c +if $4 +norm >=. $4% * fi +100%,100%,1,1,255 quiver. ..,{max(1,10-$2/6)},$1,0,$3 rm.. => $nm +} +else +foreach { +nm={n} +w={w} h={h} g xy rv *.. -1 a c * $1 ++norm >=. $4% 100%,100% noise. $2,2 ==. 1 *[-2,-1] +pointcloud3d. +if i[-1,2] +s3d. rm[-6--5,-3--1] r. 3,{h/3},1,1,-1 s. x rm. a[-2,-1] c +warp.. .,0,0,1 +-. .. +[-3,-2] s[-2,-1] c +i... 1,{h} 1,{h} a[-6--1] x +i.. ('CImg3d') i.. ({2*h},{h}) +1,{h},1,1,2 1,{h},1,1,2*y ++. 1 a[-3--1] x +3,{h} 1,{h},1,1,$3 y[-6--1] a[-6--1] y +$w,$h,1,1,255 j3d. ..,0,0,0,1,1,0,0 rm.. +else +rm $w,$h,1,1,255 +fi +=> $nm +} +fi +#@cli hearts : _density>=0 +#@cli : Apply heart effect on selected images. +#@cli : Default value: 'density=10'. +#@cli : $ image.jpg hearts , +hearts : skip ${1=10} +e[^-1] "Apply heart filter on image$?, with density $1." +foreach { +100%,100%,1 noise. $1,2 ==. 1 ri. .. n. 0,1 *[-1,-2] _heart9x7 +dilate.. . rm. +} +_heart9x7 : +(9,7,1,1,0,1,-1,2,-3,2,-1,4,-1,13,-1,7,-3,5,-5,3,-7,1,-4) +decompress_rle. +#@cli houghsketchbw : _density>=0,_radius>0,0<=_threshold<=100,0<=_opacity<=1,_votesize[%]>0 +#@cli : Apply hough B&W sketch effect on selected images. +#@cli : Default values: 'density=100', 'radius=3', 'threshold=100', 'opacity=0.1' and 'votesize=100%'. +#@cli : $ image.jpg +houghsketchbw , +houghsketchbw : check "${1=100}>=0 && ${2=3}>=0 && ${3=100}>=0 && $3<=100 && ${4=0.1}>=0 && $4<=1 && ${5=100%}>0" +e[^-1] "Apply hough B&W sketch effect on image$?, with density $1, radius $2, threshold $3, opacity $4 +and votesize $5." +luminance +foreach { +nm={n} +res={round(if(${is_percent\ $5},$5*max(w,h),$5))} w={w} h={h} rhomax={sqrt(w^2+h^2)/2} +hough $res,$res +normalize_local. $1,$2 >. $3% +if !iM continue fi +pointcloud3d. s3d. rm[-6--5,-3--1] r. 3,{h/3},1,1,-1 columns. 0,1 +s. x,2 +*.. {2*pi/$res} +*. {$rhomax/$res} ++cos.. *. .. +. {$w/2} ++sin... *. ... +. {$h/2} +rm... +i... ... +cos[-4] sin... *[-4,-3] 10000 +++.. ... ++-.. [-5] +-[-4] [-5] ++... [-6] +rm[-6,-5] +i... 1,{h} 1,{h} a[-6--1] x +i.. ('CImg3d') i.. ({2*h},{h}) +1,{h},1,1,2 1,{h},1,1,2*y ++. 1 a[-3--1] x +3,{h},1,1,0 1,{h},1,1,$4 +y[-6--1] a[-6--1] y +$w,$h,1,1,255 j3d. ..,0,0,0,1,1,0,0 rm.. => $nm +} +#@cli lightrays : 100<=_density<=0,_center_x[%],_center_y[%],_ray_length>=0,_ray_attenuation>=0 +#@cli : Generate ray lights from the edges of selected images. +#@cli : Default values: 'density=50%', 'center_x=50%', 'center_y=50%', 'ray_length=0.9' and 'ray_attenuation=0.5'. +#@cli : $ image.jpg +lightrays , + cut 0,255 +lightrays : check "${1=50}>=0 && $1<=100 && ${4=1}>=0 && ${5=1}>=0" skip ${2=50%},${3=50%} +e[^-1] "Generate ray lights from image$?, with density $1, center point ($2,$3), ray length $4 and attenuation $5." +foreach { +gradient_norm >= $1% euclidean2polar $2,$3 +repeat log2(w) { +shift. {2^$>} +[-2,-1] } +function1d 0.5,0,1,{$4*w},1,{1+($4+1-$5)*w},0 r. {-2,w},1,1,1,0 +(1,{w}) r. {-2,w},1,1,1,3 /[-2,-1] +ri. .. *[-2,-1] polar2euclidean $2,$3 n 0,255 +} +#@cli light_relief : _ambient_light,_specular_lightness,_specular_size,_darkness,_light_smoothness,_xl,_yl,_zl,_zscale,_opacity_is_heightmap={ 0 | 1 } +#@cli : Apply relief light to selected images. +#@cli : Default values(s) : 'ambient_light=0.3', 'specular_lightness=0.5', 'specular_size=0.2', 'darkness=0', 'xl=0.2', 'yl=zl=0.5', +#@cli : 'zscale=1', 'opacity=1' and 'opacity_is_heightmap=0'. +#@cli : $ image.jpg blur 2 light_relief 0.3,4,0.1,0 +light_relief : skip ${1=0.3},${2=0.5},${3=0.2},${4=0},${5=0.2},${6=0.5},${7=0.5},${8=1},${9=1},${10=0} +e[^-1] "Apply relief light to image$?." +foreach { +({-$6},{1-$6};{-$6},{1-$6}^{-$7},{-$7};{1-$7},{1-$7}^$8,$8;$8,$8) r. ..,..,1,3,3 +if $10 +channels.. 3 to_rgb... else +to_rgb.. norm. fi +b. $5% g. xy 100%,100%,1,1,$9 a[-3--1] c +orientation[-2,-1] *[-2,-1] s. c +[-3--1] +100%,100% =. 1,{$6*100}%,{$7*100}% distance. 1 sqr. *. -1 +/. {($3*max(w,h))^2} exp. *. $2 +. $1 +*[-2,-1] -. $4 *. {-2,iM} +split_opacity[0] +[0,-1] a c c 0,255 +} +#@cli linify : 0<=_density<=100,_spreading>=0,_resolution[%]>0,_line_opacity>=0,_line_precision>0,_mode={ 0=subtractive | 1=additive } +#@cli : Apply linify effect on selected images. +#@cli : The algorithm is inspired from the one described on the webpage . +#@cli : Default values: 'density=50', 'spreading=2', 'resolution=40%', 'line_opacity=10', 'line_precision=24' and 'mode=0'. +#@cli : $ image.jpg linify 60 +linify : check "${1=40}>=0 && $1<=100 && ${2=2}>=0 && ${3=40%}>0 && ${4=10}>=0 && isint(${5=24}) && $5>0 && +isbool(${6=0})" +e[^-1] "Apply linify effect on image$?, with density $1, spreading $2, resolution $3, line opacity $4, +line precision $5 and "${"arg0 $6,subtractive,additive"}" mode." +foreach { +remove_opacity nm={n} +100%,100%,1,{s},$6?0:255 +if {0,w>h} r2dx[0] {${"-is_percent $3"}?max(1,$3*w):min(w,$3)} +else r2dy[0] {${"-is_percent $3"}?max(1,$3*h):min(h,$3)} +fi +n[0] 0,100 +if narg($_debug)" && "!{*,w} w[] ${-fitscreen[]\ {1,[w,h]}} fi +eval " +is_in(ind,P) = (P[0]>=0 && P[0]=0 && P[1]best_avg):(avgdensity):(ref $nm +} +#@cli mosaic : 0<=_density<=100 +#@cli : Create random mosaic from selected images. +#@cli : Default values: 'density=30'. +#@cli : $ image.jpg mosaic , +fill "I!=J(1) || I!=J(0,1)?[0,0,0]:I" +mosaic : check "${1=30}>=0" +e[^-1] "Apply mosaic effect on image$?, with density $1." +foreach { +100%,100%,1,2,'u<0.25*($1%)^4?[u,1]' s. c +distance. 1 *. -1 watershed.. . rm. +blend shapeaverage +} +#@cli old_photo +#@cli : Apply old photo effect on selected images. +#@cli : $ image.jpg old_photo +old_photo : +e[^-1] "Apply old photo effect on image$?." +noise 20 bilateral 30,60 b 2 sharpen 100 frame_fuzzy 8%,8%,6,3 to_rgb shadow_patch 0.75 n 0,255 sepia +#@cli pencilbw : _size>=0,_amplitude>=0 +#@cli : Apply B&W pencil effect on selected images. +#@cli : Default values: 'size=0.3' and 'amplitude=60'. +#@cli : $ image.jpg pencilbw , +pencilbw : skip ${1=0.3},${2=60} +e[^-1] "Apply B&W pencil effect on image$?, with size $1 and amplitude $2." +foreach { +split_opacity l[0] { norm b $1 sharpen 4000 smooth $2,0,1 equalize sqrt n 0,255 } +a c +} +#@cli pixelsort : _ordering={ + | - },_axis={ x | y | z | xy | yx },_[sorting_criterion],_[mask] +#@cli : Apply a 'pixel sorting' algorithm on selected images, as described in the page : +#@cli : . +#@cli : Default values: 'ordering=+', 'axis=x' and 'sorting_criterion=mask=(undefined)'. +#@cli : $ image.jpg +norm +ge[-1] 30% +pixelsort[0] +,y,[1],[2] +pixelsort : check "(str1='${1=+}'; str1=='+' || str1=='-') && ""(str2='${2=x}'; str2=='x' || str2=='y' || str2=='z' || str2=='xy' || str2=='yx') && ""('${3=}'==0 || "${"is_image_arg $3"}") && ""('${4=}'==0 || "${"is_image_arg $4"}")" +s0="descending" s1="ascending" +if '$3'!=0" && "'$4'!=0 +e[^-1] "Apply 'pixelsort' effect to image$? in "${s{['$1']=='+'}}" order, along axis $2, +with sorting criterion $3 and mask $4." +elif '$3'!=0" && "'$4'==0 +e[^-1] "Apply 'pixelsort' effect to image$? in "${s{['$1']=='+'}}" order, along axis $2, +with sorting criterion $3." +elif '$3'==0" && "'$4'!=0 +e[^-1] "Apply 'pixelsort' effect to image$? in "${s{['$1']=='+'}}" order, along axis $2, +with mask $4." +else +e[^-1] "Apply 'pixelsort' effect to image$? in "${s{['$1']=='+'}}" order, along axis $2." +fi +repeat $! { +if '$3'!=0 pass$3 0 else +compose_channels[$>] + fi +if [w#1,h#1,d#1,s#1]!=[w#0,h#0,d#0,1] +error[0--4] "Command 'pixelsort': Invalid specified sorting criterion (size=("{1,[w,h,d,s]}")) for image ["$>"] ""(size=("{0,[w,h,d,s]}"))." +fi +if '$4'!=0 pass$4 0 else [$>],[$>],[$>],1,1 fi +if [w#2,h#2,d#2,s#2]!=[w#0,h#0,d#0,1] +error[0--4] "Command 'pixelsort': Invalid specified mask (size=("{1,[w,h,d,s]}")) for image ["$>"] ""(size=("{0,[w,h,d,s]}"))." +fi +l[$>,-2,-1] { +nm={0,n} >=. 50% mv.. 0 a c +if '$2'=='x'; +_pixelsort $1 +elif '$2'=='y'; +permute yxzc _pixelsort $1 permute yxzc +elif '$2'=='z'; +permute zxyc _pixelsort $1 permute yzxc +elif '$2'=='xy'; +_pixelsort $1 permute yxzc _pixelsort $1 permute yxzc +elif '$2'=='yx'; +permute yxzc _pixelsort $1 permute yxzc _pixelsort $1 +fi +channels 1,{s-2} => $nm +} +} +_pixelsort : +s. c,-{s-1} N={-2,s} permute.. cxyz r.. {-2,[w*h,d,s,1]},-1 +sort:=;_'$1'==_'+'; +eval. "*begin(ret = 0; V = vector(#w#0); const N = $N); +i && !j(-1)?( +for (xe = x + 1, i(xe,y,z) && xex?(dx = xe - x + 1; Ndx = N*dx; Nx = N*x; copy(V,i(#0,Nx),Ndx); copy(i(#0,Nx),sort(V,$sort,dx,N),Ndx)); +);" +r.. {-2,[$N,w/$N,h,d]},-1 permute.. yzcx a c +#@cli polaroid : _size1>=0,_size2>=0 +#@cli : Create polaroid effect in selected images. +#@cli : Default values: 'size1=10' and 'size2=20'. +#@cli : $ image.jpg to_rgba polaroid 5,30 rotate 20 drop_shadow , drgba +polaroid : check "${1=10}>=0 && ${2=20}>=0" +e[^-1] "Create polaroid effect in image$?, with borders sizes $1 and $2." +- 255 r {100+$1}%,{100+$1}%,1,100%,0,0,0.5,0.5 r 100%,{100+$2}%,1,100%,0,0,0 + 255 +#@cli polygonize : _warp_amplitude>=0,_smoothness[%]>=0,_min_area[%]>=0,_resolution_x[%]>0,_resolution_y[%]>0 +#@cli : Apply polygon effect on selected images. +#@cli : Default values: 'warp_amplitude=300', 'smoothness=2%', 'min_area=0.1%', 'resolution_x=resolution_y=10%'. +#@cli : $ image.jpg image.jpg polygonize 100,10 +fill "I!=J(1) || I!=J(0,1)?[0,0,0]:I" +polygonize : check "${1=300}>=0 && ${2=2%}>=0 && ${3=0.1%}>=0 && ${4=10%}>0 && ${5=$4}>0" +e[^-1] "Polygonize image$? with warp amplitude $1, smoothness $2, minimal area $3 and resolutions ($4,$5)." +foreach { ++b $2 gradient_norm. g. a[-2,-1] c channels. 0,2 *. {1/0.1+max(abs(im),abs(iM))} +resx={max(1,round(if(${is_percent\ $4},w*$4,w/$4)-1))} +resy={max(1,round(if(${is_percent\ $5},h*$5,h/$5)-1))} +plane3d 1,1,$resx,$resy *3d. {0,w-1},{0,h-1},1 +s3d. rm.. i.. (0;{h-1}) r.. 3,{h},1,1,3 round.. y.. +[-4] a[-7--2] y r. 3,{h/3},1,1,-1 z. 0,1 permute. yzcx +repeat $1 { +warp[1] .,0,0,1 +[-2,-1] } +permute. cxyz z. 0,2 y. j[2] .,0,8 rm[-3,-1] +[0],[0] j3d. [1],0,0,0,1,2 rm[1] +if $3>0 +min_area={0,if(${is_percent\ $3},$3*w*h,$3)} ++area. 0,1 >=. $min_area +.. 1 *.. . distance. 1 *. -1 watershed.. . rm. +fi +blend shapeaverage +} +#@cli poster_edges : 0<=_edge_threshold<=100,0<=_edge_shade<=100,_edge_thickness>=0,_edge_antialiasing>=0,0<=_posterization_level<=15,_posterization_antialiasing>=0 +#@cli : Apply poster edges effect on selected images. +#@cli : Default values: 'edge_threshold=40', 'edge_shade=5', 'edge_thickness=0.5', 'edge_antialiasing=10', 'posterization_level=12' and 'posterization_antialiasing=0'. +#@cli : $ image.jpg poster_edges , +poster_edges : check "${1=40}>=0 && $1<=100 && ${2=5}>=0 && $2<=100 && ${3=0.5}>=0 && ${4=10}>=0 && +${5=12}>=0 && $5<=15 && ${6=0}>=0" +e[^-1] "Apply poster edge on image$?, with edge threshold $1, edge shade $2, edge thickness $3, +edge antialiasing $4, $5 level of posterization and posterization antialiasing $6." +foreach { +split_opacity l[0] { ++g xy,1 a[-2,-1] c norm. b. $3 n. 0,255 +apply_curve. 1,0,1,{max(0,(100-($1%)^0.1*100)*255%)},0.99,{min(255,(101-($1%)^0.1*100+$2)*255%)},0.01,255,0 c. 0,1 +if $4 smooth. {min(50,$4)},0,1,{$4/40},{$4/40},0.8,90 fi +if $5 autoindex[0] {round((4-sqrt($5+1))*32+2)} fi +if $6 smooth[0] {min(50,$6)},0,1,{$6/40},{$6/40},0.8,90 fi +* +} +a c +} +#@cli poster_hope : _smoothness>=0 +#@cli : Apply Hope stencil poster effect on selected images. +#@cli : Default value: 'smoothness=3'. +#@cli : $ image.jpg poster_hope , +poster_hope : check "${1=3}>=0" +e[^-1] "Apply Hope stencil poster effect on image$?, with smoothness $1." +foreach { +to_rgb +apc "smooth 200,0,1,$1,1" +quantize 7,0 f 'if(i!=5,i,i+1-2*(y%2))' +(0,32,47;0,32,47;209,1,23;209,1,23;90,141,145;-1,-1,-1;253,221,138) permute. yzcx +map[0] [1] rm[1] +} +#@cli rodilius : 0<=_amplitude<=100,_0<=thickness<=100,_sharpness>=0,_nb_orientations>0,_offset,_color_mode={ 0=darker | 1=brighter } +#@cli : Apply rodilius (fractalius-like) filter on selected images. +#@cli : Default values: 'amplitude=10', 'thickness=10', 'sharpness=400', 'nb_orientations=7', 'offset=0' and 'color_mode=1'. +#@cli : $ image.jpg rodilius 12,10,300,10 normalize_local 10,6 +#@cli : $ image.jpg normalize_local 10,16 rodilius 10,4,400,16 smooth 60,0,1,1,4 normalize_local 10,16 +rodilius : check "${1=10}>=0 && $1<=200 && ${2=10}>=0 && $2<=100 && ${3=400}>=0 && ${4=7}>0" skip ${5=0},${6=1} +e[^-1] "Apply rodilius filter on image$? with amplitude $1, thickness $2, sharpness $3, $4 orientations, +offset $5 and "${arg0\ !$6,brighter,darker}" color mode." +foreach { +split_opacity rv +if !$6 negate. fi ++f. 0 => {-2,n} +repeat round($4) { +angle={$5+$>*180/round($4)} ++blur_linear.. $1%,{$1*$2/100}%,$angle,1 b. 0.7 sharpen. $3 max[-2,-1] +} +rm.. +if !$6 negate. fi +rv a c +} +#@cli sketchbw : _nb_angles>0,_start_angle,_angle_range>=0,_length>=0,_threshold>=0,_opacity,_bgfactor>=0,_density>0,_sharpness>=0,_anisotropy>=0,_smoothness>=0,_coherence>=0,_is_boost={ 0 | 1 },_is_curved={ 0 | 1 } +#@cli : Apply sketch effect to selected images. +#@cli : Default values: 'nb_angles=2', 'start_angle=45', 'angle_range=180', 'length=30', 'threshold=3', 'opacity=0.03', 'bgfactor=0', 'density=0.6', 'sharpness=0.1', 'anisotropy=0.6', 'smoothness=0.25', 'coherence=1', 'is_boost=0' and 'is_curved=1'. +#@cli : $ image.jpg +sketchbw 1 reverse blur[-1] 3 blend[-2,-1] overlay +sketchbw : +check "${1=2}>0 && ${3=180}>=0 && ${4=30}>=0 && ${5=3}>=0 && ${7=0}>=0 && ${8=0.6}>0 && ${9=0.1}>=0 && +${10=0.6}>=0 && ${11=0.25}>=0 && ${12=1}>=0" +skip ${2=45},${6=0.03},${13=0},${14=0} +e[^-1] "Apply B&W sketch effect on image$?." +nb_angles,start_angle,angle_range,length,threshold,opacity,bgfactor,density,sharpness,anisotropy,smoothness,coherence,is_boost,is_curved=${1-14} +length={max($length,1)} +foreach { +{0,[w,h,1,1,0]} ++gradient_norm[0] sqrt. +diffusiontensors[0] $sharpness,$anisotropy,$smoothness,$coherence +a[0,-1] c +1,{$density*wh/sqrt($length)},1,2,round(u([w#0,h#0]-1)) # [2] = set of random points +repeat $nb_angles { +[0],[0],1,2," +const angle = ("$start_angle" + "$>"*"$angle_range"/"$nb_angles")*pi/180; +const ca = cos(angle); +const sa = sin(angle); +T = I(#0); +U = [ T[0]*ca + T[1]*sa, T[1]*ca + T[2]*sa ]; +if ("$is_boost",U/=(1e-8 + norm(U))); +U" +if $is_curved +f[2] "* +oub = ovb = ouf = ovf = 0; +oixb = xb = xf = i0; +oiyb = yb = yf = i1; +oixf = oiyf = -1; +op = "$opacity" * (i(#0,xf,yf,0,3)<"$threshold"?"$bgfactor":1); +omop = 1 - op; +if (op>0, repeat ("$length",dl, +ixf = round(xf); +iyf = round(yf); +if (ixf!=oixf || iyf!=oiyf, (i(#1,ixf,iyf)*=omop)+=op; oixf = ixf; oiyf = iyf); +uf = i(#-1,xf,yf,0,0,1,1); +vf = i(#-1,xf,yf,0,1,1,1); +if (ouf*uf + ovf*vf<0, uf*=-1; vf*=-1); +xf+=uf; +yf+=vf; +ouf = uf; +ovf = vf; +ub = i(#-1,xb,yb,0,0,1,1); +vb = i(#-1,xb,yb,0,1,1,1); +if (oub*ub + ovb*vb<0, ub*=-1; vb*=-1); +xb-=ub; +yb-=vb; +oub = ub; +ovb = vb; +ixb = round(xb); +iyb = round(yb); +if (ixb!=oixb || iyb!=oiyb, (i(#1,ixb,iyb)*=omop)+=op; oixb = ixb; oiyb = iyb); +)); +I" +else +f[2] "* +const l = "$length"; +x = i0; +y = i1; +u = i(#-1,x,y,0,0); +v = i(#-1,x,y,0,1); +op = "$opacity" * (i(#0,x,y,0,3)<"$threshold"?"$bgfactor":1); +omop = 1 - op; +polygon(#1,2,x - l*u,y - l*v,x + l*u,y + l*v,op,1); +I" +fi +rm. +} +k.. * -1 n 0,255 +} +#@cli sponge : _size>0 +#@cli : Apply sponge effect on selected images. +#@cli : Default value: 'size=13'. +#@cli : $ image.jpg sponge , +sponge : skip ${1=13} +e[^-1] "Apply sponge filter on image$?, with brush size $1." +foreach { +100%,100%,1,1 noise. 20,2 ==. 1 ri. .. n. 0,1 *[-1,-2] +_circle $1 dilate.. . rm. +} +_circle : +if $1%2==0 2,2 else 1 fi ++. 1 r. $1,$1,1,1,0,0,0.5,0.5 distance. 1 n. 0,1 sqrt. c. 0.85,0.86 *. -1 n. 0,1 +#@cli stained_glass : _edges[%]>=0, shading>=0, is_thin_separators={ 0 | 1 } +#@cli : Generate stained glass from selected images. +#@cli : Default values: 'edges=40%', 'shading=0.2' and 'is_precise=0'. +#@cli : $ image.jpg stained_glass 20%,1 cut 0,20 +stained_glass : check "${1=40%}>=0 && ${2=0.2}>=0" skip ${3=0} +e[^-1] "Apply stained glass effect on image$?, with edges $1, shading $2 and thin-separators "${arg0\ !$3,enabled,disabled}"." +foreach { +im={im-1} - $im ++gradient_norm >=. $1 *.. . +distance. 1 sharpen. 1e10 !=. 0 +if $3 skeleton. 0 fi +distance. 1 watershed.. . +.. $im +n. 0,1 ^. $2 * +} +#@cli stars : _density[%]>=0,_depth>=0,_size>0,_nb_branches>=1,0<=_thickness<=1,_smoothness[%]>=0,_R,_G,_B,_opacity +#@cli : Add random stars to selected images. +#@cli : Default values: 'density=10%', 'depth=1', 'size=32', 'nb_branches=5', 'thickness=0.38', 'smoothness=0.5', 'R=G=B=200' and 'opacity=1'. +#@cli : $ image.jpg stars , +stars : check "${1=10%}>=0 && ${2=1}>=0 && ${3=32}>0 && ${4=5}>=1 && ${5=0.38}>=0 && $5<=1 && ${6=0.5}>=0" +skip ${7=200},${8=$7},${9=$8},${10=1} +e[^-1] "Add $1 random stars to image$?, with depth $2, size $3, $4 branches, thickness $5, smoothness $6, +color ($7,$8,$9) and opacity $10." +if !$1 return fi +star3d $4,$5 col3d. 255 *3d. $3 +l. { repeat 4 { {round(2*$3)},{round(2*$3)} j3d. [0],50%,50%,0,1,2,0,0 r3d[0] 0,0,1,-90 } rm[0] } +autocrop[-4--1] 0 r2dy[-4--1] $3 b[-4--1] $6,0 r[-4--1] 100%,100%,1,4 +repeat 4 { sh[{-1-$>}] 0,2 fc. $7,$8,$9 rm. } +repeat $!-1 { [-4--1] l[$>,-4--1] { +N={round(if(${is_percent\ $1},w*h*$1,$1)/4,1,1)} +repeat 4 { +2,$N rand. -1,1 1,$N rand. 0,1 a[-2,-1] x +i.. ('CImg3d') +.. 0.5 i.. ($N;$N) +(1,0;1,{$N-1}) r. 2,$N,1,1,3 round. 4,$N,1,1,1 y[-5,-3--1] a[-5--1] y +rv[-2,-1] sprites3d.. .,1 rm. *3d. {0.75*{0,w}},{0.75*{0,h}},{1000*$2} +j3d[0] .,50%,50%,0,$10,0,0,0 rm. +} +} } +rm[-4--1] +#@cli stencil : _radius[%]>=0,_smoothness>=0,_iterations>=0 +#@cli : Apply stencil filter on selected images. +#@cli : Default values: 'radius=3', 'smoothness=1' and 'iterations=8'. +#@cli : $ image.jpg +norm stencil. 2,1,4 +mul rm[0] +stencil : check "${1=3}>=0 && ${2=1}>=0 && ${3=8}>=0" +e[^-1] "Apply stencil filter on image$?, with radius $1, smoothness $2 and $3 iterations." +n 0,1 repeat $3 { b $1 unsharp {$1+$2},1000 c 0,255 } +#@cli stencilbw : _edges>=0,_smoothness>=0 +#@cli : Apply B&W stencil effect on selected images. +#@cli : Default values: 'edges=15' and 'smoothness=10'. +#@cli : $ image.jpg +stencilbw 40,4 +stencilbw : skip ${1=15},${2=10} +e[^-1] "Apply B&W stencil effect on image$?, with edges $1 and smoothness $2." +foreach { +split_opacity luminance[0] n[0] 0,255 ++edges[0] $1 quantize[0] 3,0,1 b[0] $2 +sharpen[0] 1000000 n[0] 0,1 *[0,-1] n[0] 0,255 a c +} +#@cli stylize : [style_image],_fidelity_finest,_fidelity_coarsest,_fidelity_smoothness_finest>=0,_fidelity_smoothnes_coarsest>=0,0<=_fidelity_chroma<=1,_init_type,_init_resolution>=0,init_max_gradient>=0,_patch_size_analysis>0,_patch_size_synthesis>0,_patch_size_synthesis_final>0,_nb_matches_finest>=0,_nb_matches_coarsest>=0,_penalize_repetitions>=0,_matching_precision>=0,_scale_factor>1,_skip_finest_scales>=0,_"image_matching_command" +#@cli : Transfer colors and textures from specified style image to selected images, using a multi-scale patch-mathing algorithm. +#@cli : If instant display window[0] is opened, the steps of the image synthesis are displayed on it. +#@cli : 'init_type' can be { 0=best-match | 1=identity | 2=randomized }. +#@cli : Default values: 'fidelity_finest=0.5', 'fidelity_coarsest=2', 'fidelity_smoothness_finest=3', 'fidelity_smoothness_coarsest=0.5', 'fidelity_chroma=0.1', 'init_type=0', 'init_resolution=16', 'init_max_gradient=0', 'patch_size_analysis=5', 'patch_size_synthesis=5', 'patch_size_synthesis_final=5', 'nb_matches_finest=2', 'nb_matchesc_coarsest=30', 'penalize_repetitions=2', 'matching_precision=2', 'scale_factor=1.85', 'skip_finest_scales=0' and 'image_matching_command'="s c,-3 match_pca[0] [2] b[0,2] xy,0.7 n[0,2] 0,255 n[1,2] 0,200 a[0,1] c a[1,2] c"'. +stylize : +check ${"is_image_arg $1"}" && isnum(${2=0.5}) && isnum(${3=2}) && ${4=3}>=0 && ${5=0.5}>=0 && ${6=0.1}>=0 && ""$6<=1 && isint(${7=0}) && $7>=0 && $7<=3 && isint(${8=16}) && $8>=0 && ${9=0}>=0 && isint(${10=5}) && ""$10>0 && isint(${11=5}) && $11>0 && isint(${12=$11}) && $12>0 && isint(${13=2}) && isint(${14=30}) && ""${15=2}>=0 && ${16=2}>=0 && ${17=1.85}>1 && isint(${18=0})>=0" +skip "${19=s c,-3 match_pca[0] [2] b[0,2] xy,0.7 n[0,2] 0,255 n[1,2] 0,200 a[0,1] c a[1,2] c}" +e[^-1] "Stylize image$? with style image $1." +fidelity_finest,\ +fidelity_coarsest,\ +fidelity_smoothness_finest,\ +fidelity_smoothness_coarsest,\ +fidelity_chroma,\ +init_type,\ +init_resolution,\ +init_max_gradient,\ +patch_size_analysis,\ +patch_size_synthesis,\ +patch_size_synthesis_final,\ +nb_matches_finest,\ +nb_matches_coarsest,\ +penalize_repetitions,\ +matching_precision,\ +scale_factor,\ +skip_finest_scales=${2-18} \ +m "stylize_match : $19" +init_resolution={max(2*$patch_size_analysis,$init_resolution)} +mprec0={round(2+1.5*$matching_precision)} +mprec1={1+round(4*$matching_precision)} +is_window={*} +pass$1 +repeat $!-1 { l[$>,-1] { +to_colormode.. {s} +nb_scales={1+round(log(min(w#0,h#0,w#1,h#1)/$init_resolution)/log($scale_factor),1,-1)} +if {*} wsiz=${"fitscreen "{0,[w,h]}} w[0] $wsiz,0,"[G'MIC Stylize]" fi +repeat $nb_scales { scale=$> +size_factor={100/($scale_factor^$<)} +if !$scale ++r[0,1] $size_factor%,$size_factor%,100%,100%,2 ws,hs={-2,[w,h]} ++to_color[0,1] channels[-2,-1] 0,2 gradient_norm[-2,-1] +r. [-3],[-3],[-3],1,2 r.. [-4],[-4],[-4],1,2 +a[-3,-1] c a[-3,-1] c +stylize_match[-2,-1] +if $init_type==0 ++matchpatch.. .,3,3,1,{2*$mprec0},{2*$mprec1},$penalize_repetitions +else +..,..,1,2,"round([x,y]*([w#-1,h#-1]-1)/([w,h]-1))" # Identity +if d#-2>1 channels. 0,2 fi +if $init_type==2 eval. ">P = u([w,h]-1); tmp = I(P); I(P) = I; I() = tmp" fi +fi +rm[-3,-2] +if $init_max_gradient>0 ++gradient_norm[0] r. ..,..,1,1,2 gt. $init_max_gradient ++.. 1 *[-2,-1] _inpaint_warping2d. --. 1 +fi +if $is_window" && "!{*} break fi +else +factor={1-($scale-1)/max(1,$nb_scales-2)} ++r[0,1] $size_factor%,$size_factor%,100%,100%,2 ++to_color[-2,-1] channels[-2,-1] 0,2 gradient_norm[-2,-1] +a[-3,-1] c a[-3,-1] c +stylize_match[-2,-1] mv[-2,-1] -3 +sh. 0 *. {-3,w/$ws} rm. sh. 1 *. {-3,h/$hs} rm. round. ++. 1 r. ...,...,1,100%,4 -. 1 +do +f. "begin(const boundary = 1; nx = ny = vectors(); nx[0] = ny[1] = 1); +i>=0?I:( +j(-1)>=0?J(-1) + nx: +j(0,-1)>=0?J(0,-1) + ny: +j(1)>0?J(1) - nx: +j(0,1)>0?J(0,1) - ny:I)" +while im<0 +ws,hs={-2,[w,h]} +if $<<$skip_finest_scales rm[-3,-2] continue fi ++warp_patch.. .,$patch_size_synthesis,$patch_size_synthesis,1 +if {*} w. fi +fidelity={max(0,$fidelity_finest+($fidelity_coarsest-$fidelity_finest)*$factor)} +fidelity_smoothness={$fidelity_smoothness_finest+($fidelity_smoothness_coarsest-$fidelity_smoothness_finest)*$factor} +if $fidelity>0.1 +sh. 0,2 sh[-5] 0,2 +gradient_norm[-2,-1] rm[-4,-3] +*. $fidelity argmax[-2,-1] b. xy,$fidelity_smoothness n. 0,{min(1,$fidelity)} +sh[-5,-2] 0,2 srgb2lab[-2,-1] rm[-2,-1] ++*. $fidelity_chroma r. 100%,100%,1,2,1 a[-2,-1] c j.. [-5],0,0,0,0,1,. rm. +sh. 0,2 lab2srgb. rm. +fi +rm[-4] +nb_matches={max(0,round($nb_matches_finest+($nb_matches_coarsest-$nb_matches_finest)*$factor^2))} +nb_scales1={$nb_scales-1} +nb_matches1={$nb_matches-1} +if {*} +r. $wsiz,1,100% to. "Scale "$scale/$nb_scales1": 0%",5,2,24 w. -1,-1,0 rm. fi +repeat $nb_matches { +matchpatch. ...,$patch_size_analysis,$patch_size_analysis,1,$mprec0,$mprec1,$penalize_repetitions,0,.. +-.. . abs.. diff={-2,ia} rm.. ++warp_patch.. .,$patch_size_synthesis,$patch_size_synthesis,1 +if {*}" && "(!($>%5)" || "$nb_matches<=10) ++r. $wsiz,1,100% +to. "Scale "$scale/$nb_scales1": "{round(100*($>+1)/$nb_matches)}%,5,2,24 w. -1,-1,0 rm. +fi +if $is_window" && "!{*} break fi +if $diff<1 break fi +} +rm[-3,-1] +fi +if $is_window" && "!{*} break fi +} +if $is_window" && "!{*} k[0,1] break fi ++warp_patch[1] .,$patch_size_synthesis_final,$patch_size_synthesis_final,1 c. 0,255 +rv[0,-1] rm[-2,-1] +} } rm. +um stylize_match +#@cli tetris : _scale>0 +#@cli : Apply tetris effect on selected images. +#@cli : Default value: 'scale=10'. +#@cli : $ image.jpg +tetris 10 +tetris : skip ${1=10} +e[^-1] "Apply tetris effect on image$?, with scale $1." +foreach { wh={w},{h},1,{s} r $1%,$1%,$1%,100%,2 n 0,255 quantize 10,1,0 r $wh b 2 sharpen 300,1 } +#@cli warhol : _M>0,_N>0,_smoothness>=0,_color>=0 +#@cli : Create MxN Andy Warhol-like artwork from selected images. +#@cli : Default values: 'M=3', 'N=M', 'smoothness=2' and 'color=20'. +#@cli : $ image.jpg warhol 3,3,3,40 +warhol : skip ${1=3},${2=$1},${3=2},${4=20} +e[^-1] "Create $1x$2 Andy Warhol-like artwork from image$?." +r0={100/max($1,$2)} +foreach { +norm b $3 r $r0%,$r0%,1,100%,2 quantize 6 n 0,5 round 1 +repeat $1 { +repeat $2 { (0,1,2,3,4,5) n. 32,224 6,1,1,2,128 noise. $4,0 c. 0,255 a[-2,-1] c ycbcr2rgb. +map[0] . rm.. } +} +append_tiles[^0] $1,$2 =>[1] {0,n} rm[0] +} +#@cli weave : _density>=0,0<=_thickness<=100,0<=_shadow<=100,_shading>=0,_fibers_amplitude>=0,_fibers_smoothness>=0,_angle,-1<=_x_curvature<=1,-1<=_y_curvature<=1 +#@cli : Apply weave effect to the selected images. +#@cli : 'angle' can be { 0=0 deg. | 1=22.5 deg. | 2=45 deg. | 3=67.5 deg. }. +#@cli : Default values: 'density=6', 'thickness=65', 'shadow=40', 'shading=0.5', 'fibers_amplitude=0', _'fibers_smoothness=0', 'angle=0' and 'curvature_x=curvature_y=0' +#@cli : $ image.jpg weave , +weave : check "${1=6}>=0 && ${2=65}>=0 && $2<=100 && ${3=40}>=0 && $3<=100 && ${4=0.5}>=0" +check "${5=0}>=0 && ${6=0}>=0 && ${7=0}>=0 && $7<=3 && ${8=0}>=-1 && $8<=1 && ${9=0}>=-1 && $9<=1" +e[^-1] "Apply weave effect to image$?, with $1 strips, thickness $2, shadow $3, shading $4, ""fibers amplitude $5 and fibers smoothness $6, angle "{$7*22.5}" deg. and curvatures ($8,$9)." +foreach { split_opacity l[0] { +w={round(max(w,h)/$1,1,1)} h=$w s={(100-$3)*255%} p={max(0.01,$4)} +1,$h =. 1,0,50% distance. 1 ^. $p c. 50%,100% r. {max(1,round($2*$w%))},100% +$w,1 =. 1,50% distance. 1 ^. $p c. 50%,100% *. -1 r. 100%,{max(1,round($2*$h%))} ++*. -1 +*... -1 n[-4,-2] 0,$s n[-3,-1] $s,255 +{w},1 1,... rand[-2,-1] 0,1 b[-2,-1] $6% n[-2,-1] -$5,$5 ri. [-4] +[-5] . +[-4,-1] +[-5] . +[-2,-1] ++f... 255 a[-4,-1] c +f. 255 a[-2,-1] c +amp_x={$8*($w-w)/2} amp_y={$9*($w-w)/2} +r[-4--1] $w,$h,1,100%,0,0,0.5,0.5 +f[-4] 'i(x+$amp_x*sin(y/h*pi),y,0,c,1,2)' f. 'i(x-$amp_x*sin(y/h*pi),y,0,c,1,2)' +f... 'i(x,y+$amp_y*sin(x/w*pi),0,c,1,2)' f.. 'i(x,y-$amp_y*sin(x/w*pi),0,c,1,2)' +blend[-4,-3] alpha blend[-2,-1] alpha c[-2,-1] 0,255 +/[-2,-1] 255 . ... a[-4,-2] x a[-2,-1] x a[-2,-1] y rotate_tileable. {$7*22.5} +r. ..,..,1,1,0,2 *[-2,-1] +} a c } +#@cli whirls : _texture>=0,_smoothness>=0,_darkness>=0,_lightness>=0 +#@cli : Add random whirl texture to selected images. +#@cli : Default values: 'texture=3', 'smoothness=6', 'darkness=0.5' and 'lightness=1.8'. +#@cli : $ image.jpg whirls , +whirls : skip ${1=3},${2=6},${3=0.5},${4=1.8} +e[^-1] "Add random whirl texture to image$?, with texture $1, smoothness $2, darkness $3 and lightness $4." +foreach { +100%,100% noise. 0.3,2 ==. 1 repeat $1 { b. $2 +. 0.1 gradient_norm. ^. 0.2 } +n. $3,$4 ri. .. * c 0,255 +} +#@cli :: Warpings +#@cli deform : _amplitude>=0,_interpolation +#@cli : Apply random smooth deformation on selected images. +#@cli : 'interpolation' can be { 0=none | 1=linear | 2=bicubic }. +#@cli : Default value: 'amplitude=10'. +#@cli : $ image.jpg +deform[0] 10 +deform[0] 20 +deform : skip ${1=10},${2=1} +e[^-1] "Apply random smooth deformation on image$?, with amplitude $1." +foreach { 2%,2%,1,2 noise. $1 r. ..,..,1,2,5 warp.. .,1,$2,1 rm. } +#@cli euclidean2polar : _center_x[%],_center_y[%],_stretch_factor>0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror } +#@cli : Apply euclidean to polar transform on selected images. +#@cli : Default values: 'center_x=center_y=50%', 'stretch_factor=1' and 'boundary_conditions=3'. +#@cli : $ image.jpg +euclidean2polar , +euclidean2polar : skip ${1=50%},${2=50%} check "${3=1}>0 && isint(${4=3}) && $4>=0 && $4<=3" +e[^-1] "Apply euclidean to polar transform on image$?, with center point ($1,$2), stretch factor $3 and "${"arg0 $4,dirichlet,neumann,periodic,mirror"}" boundary conditions." +foreach { +cx={if(${is_percent\ $1},$1*(w-1),$1)} +cy={if(${is_percent\ $2},$2*(h-1),$2)} +R={sqrt(max($cx^2,(w-1-$cx)^2)+max($cy^2,(h-1-$cy)^2))} +f 'r=$R*(x/(w-1))^$3;a=y*2*pi/(h-1);i($cx+r*cos(a),$cy+r*sin(a),z,c,1,$4)' +} +#@cli equirectangular2nadirzenith +#@cli : Transform selected equirectangular images to nadir/zenith rectilinear projections. +equirectangular2nadirzenith : +e[^-1] "Transform equirectangular image$? to nadir/zenith rectilinear projections." +foreach { +100%,100%,1,2 +sh. 100% +f. " +X = 2*x/(w-1) - 1; +Y = y/(h-1) - 0.5; +if (X<0, +sinphi1 = 1; X+=0.5, +sinphi1 = -1; X-=0.5 +); +rr = sqrt(X*X + Y*Y); +cc = atan(2*rr); +phi = rr==0?0:asin(cos(cc)*sinphi1); +X = atan2(X,-Y*sinphi1)/pi; +Y = phi/pi; +(++X)*=0.5*w; +(Y+=0.5)*=h; +i(#-2) = X; Y;" +warp[0] [1],0,0,1 k... +} +#@cli fisheye : _center_x,_center_y,0<=_radius<=100,_amplitude>=0 +#@cli : Apply fish-eye deformation on selected images. +#@cli : Default values: 'x=y=50', 'radius=50' and 'amplitude=1.2'. +#@cli : $ image.jpg +fisheye , +fisheye : skip ${1=50},${2=50},${3=50},${4=1.2} +e[^-1] "Apply Fish-eye effect on image$?, centered at ($1%,$2%) with radius $3% and amplitude $4." +if $4==0 return fi +foreach { +100%,100%,1,1 =. 1,$1%,$2% distance. 1 c. 0,$3% *. -1 n. 0,1 ^. {1/$4} +i.. ({-$1/100},{1-$1/100};{-$1/100},{1-$1/100}^{-$2/100},{-$2/100};{1-$2/100},{1-$2/100}) r.. .,.,1,2,3 +n. 0,{max(w,h)} *[-2,-1] +warp.. .,1,1,1 rm. +} +#@cli flower : _amplitude,_frequency,_offset_r[%],_angle,_center_x[%],_center_y[%],_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror} +#@cli : Apply flower deformation on selected images. +#@cli : Default values: 'amplitude=30', 'frequency=6', 'offset_r=0', 'angle=0', 'center_x=center_y=50%' and 'boundary_conditions=3'. +#@cli : $ image.jpg +flower , +flower : skip ${1=30},${2=6},${3=0},${4=0},${5=50%},${6=50%},${7=3} +e[^-1] "Apply flower deformation on image$?, with amplitude $1, frequency $2, offset $3, angle $4 deg. and +center point ($1,$2)." +if ${"is_percent $3"} +transform_polar "r + (R*$3) + R*$1/100*cos(a*$2+$4*pi/180)","a",$5,$6,$7 +else +transform_polar "r + $3 + R*$1/100*cos(a*$2+$4*pi/180)","a",$5,$6,$7 +fi +#@cli kaleidoscope : _center_x[%],_center_y[%],_radius,_angle,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror } +#@cli : Create kaleidoscope effect from selected images. +#@cli : Default values: 'center_x=center_y=50%', 'radius=100', 'angle=30' and 'boundary_conditions=3'. +#@cli : $ image.jpg kaleidoscope , +kaleidoscope : skip ${1=50%},${2=50%},${3=100},${4=30},${5=3} +e[^-1] "Create kaleidoscope effect from image$?, with center point ($1,$2), radius $3, angle $4 deg." +euclidean2polar $1,$2,1,$5 +foreach { +columns 0,$3% rows. 0,$4% ri. ..,0,2 =>[1] {0,n} rm[0] } +polar2euclidean $1,$2,1,$5 +#@cli map_sphere : _width>0,_height>0,_radius,_dilation>0,_fading>=0,_fading_power>=0 +#@cli : Map selected images on a sphere. +#@cli : Default values: 'width=height=512', 'radius=100', 'dilation=0.5', 'fading=0' and 'fading_power=0.5'. +#@cli : $ image.jpg map_sphere , +map_sphere : check "${1=512}>0 && ${2=512}>0 && ${5=0}>=0 && ${6=0.5}>=0" skip ${3=100},${4=0.5} +e[^-1] "Map image$? on spheres in $1x$2 images, with radius $3, dilation $4 and fading $5." +r2={($3*min($1,$2)/200)^2} +foreach { +i.. 100%,1,1,100%,0 =>[0] {1,n} a y +({-$1/2},{$1/2}) ({-$2/2};{$2/2}) r[-2,-1] $1,$2,1,1,3 atan2. .. rm.. +$1,$2 =. 1,50%,50% distance. 1,3 /. $r2 sqrt. c. 0,1 +asin. ++.. {pi} *.. {({-3,w}-1)/(2*pi)} +*. {2/pi} ^. $4 *. {{-3,h}-1} *. -1 +. {{-3,h}-1} +if $5 +>=. 1 distance. 1 c. 0,$5% n. 0,1 ^. $6 c.. 1,100% -[-2,-1] fi +r[-1,-2] 100%,100%,{-3,d} ++f. z a[-3--1] c +warp.. .,0,1,1 rm. +} +#@cli nadirzenith2equirectangular +#@cli : Transform selected nadir/zenith rectilinear projections to equirectangular images. +nadirzenith2equirectangular : +e[^-1] "Transform nadir/zenith rectilinear projection$? to equirectangular images." +foreach { +100%,100%,1,2 +sh. 100% +f. " +X = 2*x/(w-1) - 1; +Y = y/(h-1) - 0.5; +output = 1; +if (Y>0.125, +sinphi1 = 1; xc = -0.5, +if (Y<-0.125, +sinphi1 = -1; xc = 0.5, +output = 0 +)); +cosc = sinphi1*sin(Y*pi); +xx = cos(Y*pi)*sin(X*pi)/cosc; +yy = -sinphi1*cos(Y*pi)*cos(X*pi)/cosc; +if (abs(xx)>1, output=0); +(xx*=0.5)+=xc; +yy*=0.5; +if (!output, xx = yy = -1); +(++xx)*=0.5*w; +(yy+=0.5)*=h; +i(#-2) = xx; yy;" +to_a[0] warp[0] [1],0,0,0 k... +} +#@cli polar2euclidean : _center_x[%],_center_y[%],_stretch_factor>0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror } +#@cli : Apply euclidean to polar transform on selected images. +#@cli : Default values: 'center_x=center_y=50%', 'stretch_factor=1' and 'boundary_conditions=3'. +#@cli : $ image.jpg +euclidean2polar , +polar2euclidean : skip ${1=50%},${2=50%} check "${3=1}>0 && isint(${4=3}) && $4>=0 && $4<=3" +e[^-1] "Apply polar to euclidean transform on image$?, with center point ($1,$2), stretch factor $3 and "${"arg0 $4,dirichlet,neumann,periodic,mirror"}" boundary conditions." +foreach { +cx={if(${is_percent\ $1},$1*(w-1),$1)} +cy={if(${is_percent\ $2},$2*(h-1),$2)} +R={sqrt(max($cx^2,(w-1-$cx)^2)+max($cy^2,(h-1-$cy)^2))} +f "X = sqrt((x-"$cx")^2+(y-"$cy")^2); +tmp = atan2((y-"$cy"),(x-"$cx")); +Y = if(tmp<0,tmp+2*pi,tmp); +i((X/"$R")^(1/$3)*(w-1),Y*(h-1)/(2*pi),z,c,1,$4)" +} +#@cli raindrops : _amplitude,_density>=0,_wavelength>=0,_merging_steps>=0 +#@cli : Apply raindrops deformation on selected images. +#@cli : Default values: 'amplitude=80','density=0.1', 'wavelength=1' and 'merging_steps=0'. +#@cli : $ image.jpg +raindrops , +raindrops : check "${2=0.1}>=0 && ${3=1}>=0 && isint(${4=0}) && $4>=0" skip ${1=80} +e[^-1] "Apply raindrops deformation on image$?, with amplitude $1, density $2, wavelength $3 and $4 merging steps." +foreach { +100%,100% noise. $2,2 ==. 1 distance. 1 f. 'cos(i)/(1+i/(1e-8+$3))' +if $4 +i.. (0,1,0;1,0,1;0,1,0) /.. 2 . +repeat $4 { +convolve. ...,1 -. ... rm... } rm[-3,-2] +fi +g. a[-2,-1] c *. {$1/(1e-5+max(abs(im),abs(iM)))} +warp.. .,1,1,1 rm. +} +#@cli ripple : _amplitude,_bandwidth,_shape={ 0=block | 1=triangle | 2=sine | 3=sine+ | 4=random },_angle,_offset +#@cli : Apply ripple deformation on selected images. +#@cli : Default values: 'amplitude=10', 'bandwidth=10', 'shape=2', 'angle=0' and 'offset=0'. +#@cli : $ image.jpg +ripple , +ripple : skip ${1=10},${2=20},${3=2},${4=0},${5=0} +e[^-1] "Apply ripple deformation on image$?, with amplitude $1, bandwidth $2, shape $3, angle $4 deg. and offset $5." +theta={$4*pi/180} C={cos($theta)} S={-sin($theta)} +foreach { +100%,100%,1,1,"x" -. {w/2} 100%,100%,1,1,'y' +-. {h/2-$5} *.. $S *. $C +[-2,-1] +_ripple$3. $1,$2 ++*. {-$S} *.. $C a[-2,-1] c +warp.. .,1,1,1 rm. +} +_ripple0 : f {$1/2}*"(1-2*(i%"{2*$2}"<$2))" +_ripple1 : f "I=(i%$2)/$2;$1*(2*if(I<0.5,I,1-I)-0.5)" +_ripple2 : f {-$1/2}*"cos(i*"{2*pi/$2}")" +_ripple3 : f {-$1/2}*"abs(cos(i*"{2*pi/$2}"))" +_ripple4 : skip $* n 0,{h-1} 1,{h} rand. {-$1/2},{$1/2} m={im} M={iM} b. {$2/10} n. $m,$M map.. . rm. +#@cli rotoidoscope : _center_x[%],_center_y[%],_tiles>0,_smoothness[%]>=0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror } +#@cli : Create rotational kaleidoscope effect from selected images. +#@cli : Default values: 'center_x=center_y=50%', 'tiles=10', 'smoothness=1' and 'boundary_conditions=3'. +#@cli : $ image.jpg +rotoidoscope , +rotoidoscope : skip ${1=50%},${2=50%},${5=1} check "${3=10}>0 && ${4=3}>=0" +e[^-1] "Create rotational kaleidoscope effect from image$?, with center point ($1,$2), $3 tiles and smoothness $4." +foreach { +repeat $3 { +rotate[0] {360/$3},1,$5,$1,$2 blend_edges $4 } +} +#@cli spherize : _radius[%]>=0,_strength,_smoothness[%]>=0,_center_x[%],_center_y[%],_ratio_x/y>0,_angle,_interpolation +#@cli : Apply spherize effect on selected images. +#@cli : Default values: 'radius=50%', 'strength=1', 'smoothness=0', 'center_x=center_y=50%', 'ratio_x/y=1', 'angle=0' and 'interpolation=1'. +#@cli : $ image.jpg grid 5%,5%,0,0,0.6,255 spherize , +spherize : check "${1=50%}>=0 && ${3=0}>=0 && ${6=1}>0 && isint(${8=1}) && $8>=0 && $8<=2" +skip "${2=1},${4=50%},${5=50%},${7=0}" +e[^-1] "Apply spherize effect on image$?, with radius $1, strength $2, smoothness $3, center ($4,$5), +x/y-ratio $6, angle $7 and "${"arg0 $8,nearest-neighbor,linear,cubic"}" interpolation." +if !$1||!$2 return fi +foreach { +rmax={${"is_percent $1"}?0.5*sqrt((w-1)^2+(h-1)^2)*$1:$1} +centerx={${"is_percent $4"}?(w-1)*$4:$4} +centery={${"is_percent $5"}?(h-1)*$5:$5} +strength={$2>0?$2:1-exp($2/5)} +100%,100%,1,2," +begin( +center = [ "$centerx","$centery" ]; +wh1 = [ w,h ] - 1; +m2wh1 = 0.5*max(wh1); +rmax = "$rmax"/m2wh1; +const f = 1/"$strength"; +const ratio = $6; +rotf = rot($7°); +rotb = rot(-$7°); +); +xy = ([x,y] - center)/m2wh1; +xy = rotf*xy; +ratio>=1?(xy[1]*=ratio):(xy[0]/=ratio); +r = norm(xy); +z = r=1?(xy[1]/=ratio):(xy[0]*=ratio); +xy = rotb*xy; +xy = center + f*xy/(f + z)*m2wh1" +b. $3 +warp.. .,0,$8,1 rm. +} +#@cli symmetrize : _x[%],_y[%],_angle,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror },_is_antisymmetry={ 0 | 1 },_swap_sides={ 0 | 1 } +#@cli : Symmetrize selected images regarding specified axis. +#@cli : Default values: 'x=y=50%', 'angle=90', 'boundary_conditions=3', 'is_antisymmetry=0' and 'swap_sides=0'. +#@cli : $ image.jpg +symmetrize 50%,50%,45 +symmetrize[-1] 50%,50%,-45 +symmetrize : skip ${1=50%},${2=50%},${3=90},${4=3},${5=0},${6=0} +e[^-1] "Symmetrize image$?, regarding axis ($1,$2,$3 deg.)." +theta={$3*pi/180} u={cos($theta)} v={sin($theta)} +if $6 symmetry_cond=A<0 else symmetry_cond=A>0 fi +foreach { +x0={if(${is_percent\ $1},w*$1,$1)} +y0={if(${is_percent\ $2},h*$2,$2)} +if $5 f 'A=($y0-y)*$u-($x0-x)*$v;X=x+2*($x0-x);Y=y+2*($y0-y);if($symmetry_cond,i(X,Y,z,c,1,$4),i)' +else f 'A=($y0-y)*$u-($x0-x)*$v;X=x-2*$v*A;Y=y+2*$u*A;if($symmetry_cond,i(X,Y,z,c,1,$4),i)' +fi +} +#@cli transform_polar : "expr_radius",_"expr_angle",_center_x[%],_center_y[%],_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror } +#@cli : Apply user-defined transform on polar representation of selected images. +#@cli : Default values: 'expr_radius=R-r', 'expr_rangle=a', 'center_x=center_y=50%' and 'boundary_conditions=3'. +#@cli : $ image.jpg +transform_polar[0] R*(r/R)^2,a +transform_polar[0] r,2*a +transform_polar : skip "${1=R-r}","${2=a}",${3=50%},${4=50%},${5=3} +e[^-1] "Apply custom polar transform with 'new_r = $1', 'new_a = $2', center point ($3%,$4%)." +foreach { +cx={if(${is_percent\ $3},$3*(w-1),$3)} +cy={if(${is_percent\ $4},$4*(h-1),$4)} +R={sqrt(max($cx^2,(w-1-$cx)^2)+max($cy^2,(h-1-$cy)^2))} +f "R ="$R"; +r = sqrt((x-"$cx")^2 + (y-"$cy")^2); +a = atan2(y-"$cy",x-"$cx"); +nr = ($1); +na = ($2); +i("$cx" + nr*cos(na), "$cy" + nr*sin(na), z, c,1,$5)" +} +#@cli twirl : _amplitude,_center_x[%],_center_y[%],_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror } +#@cli : Apply twirl deformation on selected images. +#@cli : Default values: 'amplitude=1', 'center_x=center_y=50%' and 'boundary_conditions=3'. +#@cli : $ image.jpg twirl 0.6 +twirl : skip ${1=1},${2=50%},${3=50%},${4=3} +e[^-1] "Apply twirl deformation on image$?, with amplitude $1 and center point at ($2%,$3%)." +euclidean2polar $2,$3,1,$4 +repeat $! { [$>],[$>],1,1,$1*x channels. -1,0 warp[$>] .,1,1,2 rm. } +polar2euclidean $2,$3,1,1 +#@cli warp : [warping_field],_mode,_interpolation,_boundary_conditions,_nb_frames>0 : (+) +#@cli : Warp selected images with specified displacement field. +#@cli : 'mode' can be { 0=backward-absolute | 1=backward-relative | 2=forward-absolute | 3=forward-relative }. +#@cli : 'interpolation' can be { 0=nearest-neighbor | 1=linear | 2=cubic }. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default values: 'mode=0', 'interpolation=1', 'boundary_conditions=0' and 'nb_frames=1'. +#@cli : $ image.jpg 100%,100%,1,2,'X=x/w-0.5;Y=y/h-0.5;R=(X*X+Y*Y)^0.5;A=atan2(Y,X);130*R*if(c==0,cos(4*A),sin(8*A))' warp[-2] [-1],1,1,0 quiver[-1] [-1],10,1,1,1,100 +#@cli : $$ https://gmic.eu/oldtutorial/_warp +#@cli warp_patch : [warping_field],patch_width>=1,_patch_height>=1,_patch_depth>=1,_std_factor>0,_boundary_conditions. +#@cli : Patch-warp selected images, with specified 2D or 3D displacement field (in backward-absolute mode). +#@cli : Argument 'std_factor' sets the std of the gaussian weights for the patch overlap, +#@cli : equal to 'std = std_factor*patch_size'. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default values: 'std_factor=0.3' and 'boundary_conditions=3'. +warp_patch : check ${is_image_arg\ $1}" && isint(${2=3}) && $2>=1 && isint(${3=$2}) && $3>=1 && +isint(${4=1}) && $4>=1 && isnum(${5=0.3}) && $5>0 && isint(${6=3}) && $6>=0 && $6<=3" +e[^-1] "Patch-warp image$? with backward-absolute displacement field $1, using $2x$3x$4 patches, std factor $5 +and "${"arg0 $6,dirichlet,neumann,periodic,mirror"}" boundary conditions." +if $2<=1 pass$1 warp[^-1] .,0 rm. return fi +repeat $! { pass$1 l[$>,-1] { +nm={0,n} +[0],[0],[0],1,1 a[0,-1] c +100%,100%,100%,{0,s} +if s#1>=3 # 3D version +eval[1] "> +begin( +const pw = $2; +const ph = $3; +const pd = $4; +const stdf = $5; +const boundary = $6; +const pw1 = int(pw/2); +const pw2 = pw - pw1 - 1; +const ph1 = int(ph/2); +const ph2 = ph - ph1 - 1; +const pd1 = int(pd/2); +const pd2 = pd - pd1 - 1; +const pwhd = pw*ph*pd; +return = vector(s); +if (stdf<5, +ref(vectorpwhd(),weights); +offw = 0; +for (zw = -pd1, zw<=pd2, ++zw, +for (yw = -ph1, yw<=ph2, ++yw, +for (xw = -pw1, xw<=pw2, ++xw, +weights[offw++] = exp(-xw^2/(2*(stdf*pw)^2) - yw^2/(2*(stdf*ph)^2) - zw^2/(2*(stdf*pd)^2)); +); +); +); +); +); +u = i(x,y,z,0); +v = i(x,y,z,1); +w = i(x,y,z,2); +ref(crop(#0,u - pw1, v - ph1,w - pd1,pw,ph,pd,boundary),patch); +stdf<5? +draw(#2,patch,x - pw1,y - ph1,z - pd1,0,pw,ph,pd,s#0,-1,weights): +draw(#2,patch,x - pw1,y - ph1,z - pd1,0,pw,ph,pd,s#0,-1); +return" +else +eval[1] "> +begin( +const pw = $2; +const ph = $3; +const stdf = $5; +const boundary = $6; +const pw1 = int(pw/2); +const pw2 = pw - pw1 - 1; +const ph1 = int(ph/2); +const ph2 = ph - ph1 - 1; +const pwh = pw*ph; +return = vector(s); +if (stdf<5, +ref(vectorpwh(),weights); +offw = 0; +for (yw = -ph1, yw<=ph2, ++yw, +for (xw = -pw1, xw<=pw2, ++xw, +weights[offw++] = exp(-xw^2/(2*(stdf*pw)^2) - yw^2/(2*(stdf*ph)^2)); +); +); +); +); +u = i(x,y,z,0); +v = i(x,y,z,1); +ref(crop(#0,u - pw1, v - ph1,pw,ph,boundary),patch); +stdf<5? +draw(#2,patch,x - pw1,y - ph1,0,0,pw,ph,1,s#0,-1,weights): +draw(#2,patch,x - pw1,y - ph1,0,0,pw,ph,1,s#0,-1); +return" +fi +s. c,-{0,s-1} /[-2,-1] k. => $nm +} } +#@cli warp_perspective : _x-angle,_y-angle,_zoom>0,_x-center,_y-center,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror } +#@cli : Warp selected images with perspective deformation. +#@cli : Default values: 'x-angle=1.5', 'y-angle=0', 'zoom=1', 'x-center=y-center=50' and 'boundary_conditions=2'. +#@cli : $ image.jpg warp_perspective , +warp_perspective : skip ${1=1.5},${2=0},${3=1},${4=50},${5=50},${6=2} +e[^-1] "Apply perspective warp on image$?, with angles ($1 deg.,$2 deg.), zoom $3 and offsets ($4,$5)." +foreach { +(0,100) -. $4 /. 100 (0;100) -. $5 /. 100 r[-2,-1] ...,...,...,1,3 ++*.. $2 +*.. $1 +[-2,-1] +. $3 /... . /[-2,-1] +*.. 100 +.. $4 /.. 100 *.. {-3,w} +*. 100 +. $5 /. 100 *. {-3,h} +a[-2,-1] c warp.. .,0,1,$6 rm. +} +#@cli warp_rbf : xs0[%],ys0[%],xt0[%],yt0[%],...,xsN[%],ysN[%],xtN[%],ytN[%] +#@cli : Warp selected images using RBF-based interpolation. +#@cli : Each argument (xsk,ysk)-(xtk,ytk) corresponds to the coordinates of a keypoint +#@cli : respectively on the source and target images. The set of all keypoints define the overall image deformation. +#@cli : $ image.jpg +warp_rbf 0,0,0,0,100%,0,100%,0,100%,100%,100%,100%,0,100%,0,100%,50%,50%,70%,50%,25%,25%,25%,75% +warp_rbf : +e[^-1] "Warp image$? using RBF interpolation, with keypoints ($*)." +$=arg N:=$#/4 +if int($N)!=$N error[0--2] "Command 'warp_rbf': Wrong number of arguments ($#)." fi +foreach { +4,$N +repeat wh { a=${arg{1+$>}} isp=${"is_percent "$a} eval i[$>]=$isp?($>%2?w#0:h#0)*$a:$a } +s. x,2 -. .. a[-2,-1] x permute. yzcx +rbf. {0,[w,h]} warp[0] .,1,1,3 rm. +} +#@cli water : _amplitude,_smoothness>=0,_angle +#@cli : Apply water deformation on selected images. +#@cli : Default values: 'amplitude=30', 'smoothness=1.5' and 'angle=45'. +#@cli : $ image.jpg water , +water : check ${2=1.5}>=0 skip ${1=30},${3=1},${4=45} +e[^-1] "Apply water deformation on image$?, with amplitude $1, smoothness $2 and angle $3." +foreach { +25%,25%,25%,1 noise. $1 g. xy *.. {-sin($3*pi/180)} *. {cos($3*pi/180)} +[-2,-1] b. $2 *. 2 +r. ..,..,1,2,3 warp.. .,1,1,1 rm. +} +#@cli wave : _amplitude>=0,_frequency>=0,_center_x,_center_y +#@cli : Apply wave deformation on selected images. +#@cli : Default values: 'amplitude=4', 'frequency=0.4' and 'center_x=center_y=50'. +#@cli : $ image.jpg wave , +wave : skip ${1=4},${2=0.4},${3=50},${4=50} +e[^-1] "Apply wave deformation on image$?, with amplitude $1, frequency $2 and center point at ($3%,$4%)." +foreach { +100%,100% =. 1,$3%,$4% distance. 1 +*. $2 +sin. cos.. a[-2,-1] c *. $1 +warp.. .,1,1,1 rm. +} +#@cli wind : _amplitude>=0,_angle,0<=_attenuation<=1,_threshold +#@cli : Apply wind effect on selected images. +#@cli : Default values: 'amplitude=20', 'angle=0', 'attenuation=0.7' and 'threshold=20'. +#@cli : $ image.jpg +wind , +wind : check "isint(${1=20}) && $1>=0 && ${3=0.7}>=0 && $3<=1" skip "${2=0},${4=20}" +e[^-1] "Apply wind effect on image$?, with amplitude $1, angle $2 deg., attenuation $3 and threshold $4." +if !$1 return fi +dx,dy,fact:=[cexp([0,$2°]),(1-$3)^(1/$1)] +foreach { ++gradient_norm >=. $4% M:=iM +r. 100%,100%,1,.. *. .. +repeat $1 { +shift. {round($>*[$dx,$dy])} max[0,-1] *. $fact remove_pixels. {100/$1}% } +rm. +} +#@cli zoom : _factor,_cx,_cy,_cz,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror } +#@cli : Apply zoom factor to selected images. +#@cli : Default values: 'factor=1', 'cx=cy=cz=0.5' and 'boundary_conditions=0'. +#@cli : $ image.jpg +zoom[0] 0.6 +zoom[0] 1.5 +zoom : skip ${1=2},${2=0.5},${3=0.5},${4=0.5},${5=0} +e[^-1] "Apply zoom effect on image$?, with factor $1 and center ($2,$3)." +foreach { +if d==1 +({(w-1)*$2*(1-1/$1)},{(w-1)*($2+(1-$2)/$1)}) +({({-2,h}-1)*$3*(1-1/$1)};{({-2,h}-1)*($3+(1-$3)/$1)}) +r[-2--1] ...,...,1,1,3 a[-2--1] c warp.. .,0,1,$5 +else +({(w-1)*$2*(1-1/$1)},{(w-1)*($2+(1-$2)/$1)}) +({({-2,h}-1)*$3*(1-1/$1)};{({-2,h}-1)*($3+(1-$3)/$1)}) +({({-3,d}-1)*$4*(1-1/$1)}/{({-3,d}-1)*($4+(1-$4)/$1)}) +r[-3--1] [-4],[-4],[-4],1,3 a[-3--1] c warp.. .,0,1,$5 +fi +rm. +} +#@cli :: Degradations +#@cli cracks : 0<=_density<=100,_is_relief={ 0 | 1 },_opacity,_color1,... +#@cli : Draw random cracks on selected images with specified color. +#@cli : Default values: 'density=25', 'is_relief=0', 'opacity=1' and 'color1=0'. +#@cli : $ image.jpg +cracks , +cracks : check "${1=25}>=0" skip ${2=0},${3=1},${4=0} +e[^-1] "Add random cracks to image$?, with density $1, opacity $3 and color (${4--1})." +foreach { +cut={[im,iM]} +100%,100%,1,2,'u<0.25*($1%)^4?[u,1]:[0,0]' +s. c distance. 1 *. -1 watershed.. . rm. ++dilate. 3 -[-2,-1] !=. 0 +if $2 +f. "i?i:j(1)?2:j(-1)?0.5:i" n. 0,1 ++fc.. ${4--1} *. .. !=.. 0 j... .,0,0,0,0,$3,.. +else ++fc.. ${4--1} j... .,0,0,0,0,$3,.. +fi +k[0] +} +#@cli light_patch : _density>0,_darkness>=0,_lightness>=0 +#@cli : Add light patches to selected images. +#@cli : Default values: 'density=10', 'darkness=0.9' and 'lightness=1.7'. +#@cli : $ image.jpg +light_patch 20,0.9,4 +light_patch : skip ${1=10},${2=0.9},${3=1.7} +e[^-1] "Apply light patches to image$?, with density $1, darkness $2 and lightness $3." +foreach { +n 0,255 $1,$1 noise. 40 ri. ..,5 c. 0,255 +n. $2,$3 * c 0,255 +} +#@cli noise_hurl : _amplitude>=0 +#@cli : Add hurl noise to selected images. +#@cli : Default value: 'amplitude=10'. +#@cli : $ image.jpg +noise_hurl , +noise_hurl : skip ${1=10} +e[^-1] "Add hurl noise to image$?, with amplitude $1%." +foreach { ++f 0 noise. 10 n. {-2,[im,iM]} 100%,100% +noise. $1,2 >. 0 ri. .. +*.. . *. -1 +. 1 *[-3,-1] + +} +#@cli pixelize : _scale_x>0,_scale_y>0,_scale_z>0 +#@cli : Pixelize selected images with specified scales. +#@cli : Default values: 'scale_x=20' and 'scale_y=scale_z=scale_x'. +#@cli : $ image.jpg +pixelize , +pixelize : skip ${1=20},${2=$1},${3=$1} +e[^-1] "Pixelize image$? with scales ($1%,$2%,$3%)." +foreach { whd={w},{h},{d} r $1%,$2%,$3%,100%,2 r $whd } +#@cli scanlines : _amplitude,_bandwidth,_shape={ 0=block | 1=triangle | 2=sine | 3=sine+ | 4=random },_angle,_offset +#@cli : Apply ripple deformation on selected images. +#@cli : Default values: 'amplitude=60', 'bandwidth=2', 'shape=0', 'angle=0' and 'offset=0'. +#@cli : $ image.jpg +scanlines , +scanlines : skip ${1=60},${2=2},${3=0},${4=0},${5=0} +e[^-1] "Apply scanlines effect on image$?, with amplitude $1, bandwidth $2, shape $3, angle $4 deg. and offset $5." +theta={$4*pi/180} C={cos($theta)} S={-sin($theta)} +foreach { +100%,100%,1,1,"x" -. {w/2} 100%,100%,1,1,'y' +-. {h/2-$5} *.. $S *. $C +[-2,-1] +_ripple$3. $1,$2 +n. {-$1},$1 ++ cut 0,255 +} +#@cli shade_stripes : _frequency>=0,_direction={ 0=horizontal | 1=vertical },_darkness>=0,_lightness>=0 +#@cli : Add shade stripes to selected images. +#@cli : Default values: 'frequency=5', 'direction=1', 'darkness=0.8' and 'lightness=2'. +#@cli : $ image.jpg +shade_stripes 30 +shade_stripes : skip ${1=5},${2=1},${3=0.8},${4=2} +e[^-1] "Add "${arg0\ !$2,vertical,horizontal}" shaded stripes to image$?, with frequency $1, darkness $3 and +lightness $4." +n 0,255 foreach { {max(1,w*($2!=0))},{max(1,h*($2==0))} noise. $1,2 ==. 1 distance. 1 ri. .. n. $3,$4 * c 0,255 } +#@cli shadow_patch : _opacity>=0 +#@cli : Add shadow patches to selected images. +#@cli : Default value: 'opacity=0.7'. +#@cli : $ image.jpg +shadow_patch 0.4 +shadow_patch : skip ${1=0.7} +e[^-1] "Apply shadow patches to image$?, with opacity $1." +foreach { +100%,100%,1,1 shift. -2,-2 shift. 1,1 +plasma. 3,0.3,8 abs. b. 1 c. 3%,15% ri. .. +n. $1,1 * +} +#@cli spread : _dx>=0,_dy>=0,_dz>=0 +#@cli : Spread pixel values of selected images randomly along x,y and z. +#@cli : Default values: 'dx=3', 'dy=dx' and 'dz=0'. +#@cli : $ image.jpg +spread 3 +spread : skip ${1=3},${2=$1},${3=0} +e[^-1] "Spread pixel of image$? randomly, with amplitudes ($1,$2,$3)." +foreach { +100%,100%,100%,3 +sh. 0 rand. {-$1},$1 rm. +sh. 1 rand. {-$2},$2 rm. +sh. 2 rand. {-$3},$3 rm. +warp.. .,1,1,1 rm. +} +#@cli stripes_y : _frequency>=0 +#@cli : Add vertical stripes to selected images. +#@cli : Default value: 'frequency=10'. +#@cli : $ image.jpg +stripes_y , +stripes_y : skip ${1=10} +e[^-1] "Add vertical stripes to image$?, with frequency $1." +foreach { 100% noise. $1,2 ==. 1 *. 255 ri. .. *. 0.15 + c 0,255 } +#@cli texturize_canvas : _amplitude>=0,_fibrousness>=0,_emboss_level>=0 +#@cli : Add paint canvas texture to selected images. +#@cli : Default values: 'amplitude=20', 'fibrousness=3' and 'emboss_level=0.6'. +#@cli : $ image.jpg +texturize_canvas , +texturize_canvas : check "${1=20}>=0 && ${2=3}>=0 && ${3=0.6}>=0 && ${4=80}" +e[^-1] "Add canvas texture to image$?, with amplitude $1, fibrousness $2 and emboss level $3." +foreach { +{w},{h} rand. 0,255 +blur_x. $2 blur_y.. $2 +[-2,-1] g. a[-2,-1] c ++compose_channels. + orientation.. compose_channels.. + n.. $3,1 n. 0,255 +sharpen. 80 *[-2,-1] n. -$1,$1 + c 0,255 +} +#@cli texturize_paper +#@cli : Add paper texture to selected images. +#@cli : $ image.jpg +texturize_paper +texturize_paper : +e[^-1] "Add paper texture to image$?." +foreach { +. 30%,30% noise. 1,2 ==. 1 r. ..,..,..,1,0 ifft. +rm. shift. {round(w/2)},{round(h/2)},{round(d/2)},0,2 sharpen. 1 n. 1,1.2 ri. .. +*[-2,-1] c. ..,.. rm.. +} +#@cli vignette : _strength>=0,0<=_radius_min<=100,0<=_radius_max<=100 +#@cli : Add vignette effect to selected images. +#@cli : Default values: 'strength=100', 'radius_min=70' and 'radius_max=90'. +#@cli : $ image.jpg vignette , +vignette : check "${1=100}>=0 && ${2=70}>=0 && $2<=100 && ${3=90}>=0 && $3<=100" +e[^-1] "Add vignette effect to image$?, with strength $1 and size $2." +foreach { +mM={[im,iM]} d={max(w,h)} +$d,$d =. 1,50%,50% distance. 1 ri. ..,2 +c. $2%,$3% n. 0,$1 - c $mM +} +#@cli watermark_visible : _text,0<_opacity<1,_size>0,_angle,_mode={ 0=remove | 1=add },_smoothness>=0 +#@cli : Add or remove a visible watermark on selected images (value range must be [0,255]). +#@cli : Default values: 'text=(c) G'MIC', 'opacity=0.3', 'size=53', 'angle=25', 'mode=1' and 'smoothness=0'. +#@cli : $ image.jpg watermark_visible ,0.7 +watermark_visible : check "${2=0.3}>0 && $2<1 && ${3=53}>0 && ${6=0.5}>=0" +skip "${1=\251\ G\47MIC}",${4=25},${5=1} +e[^-1] ${arg0\ !$5,Add,Remove}" visible watermark '$1' on image$?, with opacity $2, size $3, angle $4 deg." +foreach { +0 t. "$1",0,0,$3,1,255 rotate. $4,0,0 b. $6 n. 0,255 +ri. ..,0,2 +. .. c. 0,255 +if $5 *. $2 *.. {1-$2} + +else *. $2 - / {1-$2} +fi +c 0,255 +} +#@cli :: Blending and Fading +#@cli blend : [layer],blending_mode,_opacity[%],_selection_is={ 0=base-layers | 1=top-layers } : blending_mode,_opacity[%] +#@cli : Blend selected G,GA,RGB or RGBA images by specified layer or blend all selected images together, +#@cli : using specified blending mode. +#@cli : 'blending_mode' can be { add | alpha | and | average | blue | burn | darken | difference | +#@cli : divide | dodge | edges | exclusion | freeze | grainextract | grainmerge | green | hardlight | +#@cli : hardmix | hue | interpolation | lchlightness | lighten | lightness | linearburn | linearlight | luminance | +#@cli : multiply | negation | or | overlay | pinlight | red | reflect | saturation | +#@cli : screen | seamless | seamless_mixed | shapeareamax | shapeareamax0 | shapeareamin | shapeareamin0 | +#@cli : shapeaverage | shapeaverage0 | shapemedian | shapemedian0 | shapemin | shapemin0 | shapemax | shapemax0 | +#@cli : shapeprevalent | softburn | softdodge | softlight | stamp | subtract | value | vividlight | xor }. +#@cli : 'opacity' must be in range '[0,1]' (or '[0%,100%]'). +#@cli : Default values: 'blending_mode=alpha', 'opacity=1' and 'selection_is=0'. +#@cli : $ image.jpg +drop_shadow , resize2dy[-1] 200 rotate[-1] 20 +blend alpha display_rgba[-2] +#@cli : $ image.jpg testimage2d {w},{h} blend overlay +#@cli : $ command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:\" \"${arg{$>+1}},2,2,23,2,1,255 done" image.jpg testimage2d {w},{h} ex add,alpha,and,average,blue,burn,darken +#@cli : $ command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:\" \"${arg{$>+1}},2,2,23,2,1,255 done" image.jpg testimage2d {w},{h} ex difference,divide,dodge,exclusion,freeze,grainextract,grainmerge +#@cli : $ command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:\" \"${arg{$>+1}},2,2,23,2,1,255 done" image.jpg testimage2d {w},{h} ex green,hardlight,hardmix,hue,interpolation,lighten,lightness +#@cli : $ command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:\" \"${arg{$>+1}},2,2,23,2,1,255 done" image.jpg testimage2d {w},{h} ex linearburn,linearlight,luminance,multiply,negation,or,overlay +#@cli : $ command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:\" \"${arg{$>+1}},2,2,23,2,1,255 done" image.jpg testimage2d {w},{h} ex pinlight,red,reflect,saturation,screen,shapeaverage,softburn +#@cli : $ command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:\" \"${arg{$>+1}},2,2,23,2,1,255 done" image.jpg testimage2d {w},{h} ex softdodge,softlight,stamp,subtract,value,vividlight,xor +blend : skip "${1=},${2=},${3=},${4=}" +if !${"is_image_arg $1"} +if ['$1']!=0 mode=$1 else mode=alpha fi +if ['$2']!=0 opacity=$2 else opacity=1 fi +e[0--3] "Blend image$? together, using '"$mode"' mode and opacity "$opacity"." +repeat $!-1 { $0.. .,$mode,$opacity rm. } +return +fi +if ['$2']!=0 mode=$2 else mode=alpha fi +if ['$3']!=0 opacity:=$3 else opacity=1 fi +if ['$4']!=0 selection_mode=$4 else selection_mode=0 fi +if $selection_mode s0,s1=foreground,background else s0,s1=background,foreground fi +e[^-1] "Blend "$s0" image$? with "$s1" image $1, using '"$mode"' mode and opacity "$opacity"." +if !$opacity return fi +pass$1 1 +foreach[^-1] { nm={n} +pass. 0 if $selection_mode rv fi +nb_col_channels,is_alpha_b,is_alpha_f:=max(s#0,s)>=3?3:1,!(s#0%2),!(s%2)||w $nm +} +rm. +_blend_alpha : +_blend_normal : +_blend_and : +&[1] [0] +_blend_add : ++[1] [0] c[1] 0,255 +_blend_average : ++[1] [0] /[1] 2 +_blend_blue : +sh[0] 0,1 j[1] [2] rm[2] +_blend_burn : ++-[0] 255 +[1] 0.1 /[2] [1] rm[1] +[1] 1 *[1] 255 c[1] 0,255 +_blend_darken : +min[1] [0] +_blend_difference : +-[1] [0] abs[1] +_blend_divide : ++[1] 0.1 ^[1] -1 *[1] [0] *[1] 255 c[1] 0,255 +_blend_dodge : +-[1] 255.1 ^[1] -1 *[1] [0] *[1] -255 c[1] 0,255 +_blend_edges : ++blend_edges 0.5 rm[1] +_blend_exclusion : ++*[0,1] /[2] -127.5 +[1,2] +[1] [0] +_blend_freeze : +*[1] -255 -[1] 0.1 +-[0] 255 sqr[2] /[2] [1] rm[1] +[1] 1 *[1] 255 c[1] 0,255 +_blend_grainextract : +-[1] [0] *[1] -1 +[1] 128 c[1] 0,255 +_blend_grainmerge : ++[1] [0] -[1] 128 c[1] 0,255 +_blend_green : +sh[0] 0 sh[0] 2 j[1] [2] j[1] [3],0,0,0,2 rm[2,3] +_blend_hardlight : ++*[0,1] /[2] 127.5 ++[0,1] *[3] 2 -[3] 255 -[3] [2] >[1] 128 +j[2] [3],0,0,0,0,1,[1] rm[1,3] c[1] 0,255 +_blend_hardmix : ++[1] [0] >=[1] 255 *[1] 255 +_blend_hue : +to_color sh 0,2 rgb2hsv[2,3] sh[2] 1,2 j[1] [4],0,0,0,1 rm[4] hsv2rgb[2,3] rm[2,3] +_blend_interpolation : ++*[0] {pi/255} *[1] {pi/255} cos[1,2] +[1,2] -[1] 2 *[1] -63.75 c[1] 0,255 +_blend_lighten : +max[1] [0] +_blend_lightness : +to_color sh 0,2 rgb2lab[2,3] sh[2] 1,2 j[1] [4],0,0,0,1 rm[4] lab2rgb[2,3] rm[2,3] +_blend_lchlightness : +_blend_lightness +_blend_luminance : +to_color sh 0,2 rgb2ycbcr[2,3] sh[2] 1,2 j[1] [4],0,0,0,1 rm[4] ycbcr2rgb[2,3] rm[2,3] +_blend_linearburn : ++[1] [0] -[1] 255 c. 0,255 +_blend_linearlight : +*[1] 2 +[1] [0] -[1] 255 c[1] 0,255 +_blend_multiply : +*[1] [0] /[1] 255 +_blend_negation : ++[1] [0] -[1] 255 abs[1] *[1] -1 +[1] 255 +_blend_or : +-|[1] [0] +_blend_overlay : ++*[0,1] /[2] 127.5 +[1] [0] *[1] 2 -[1] 255 -[1] [2] +<[0] 128 j[1] [2],0,0,0,0,1,[3] rm[2,3] c[1] 0,255 +_blend_pinlight : +*[1] 2 +blend darken -[1] 256 +blend[0,1] lighten >=[1] 0 +j[2] [3],0,0,0,0,1,[1] rm[1,3] +_blend_reflect : +-[1] 255.1 *[1] -1 +sqr[0] /[2] [1] rm[1] c[1] 0,255 +_blend_red : +sh[0] 1,100% j[1] [2],0,0,0,1 rm[2] +_blend_saturation : +to_color sh 0,2 rgb2hsv[2,3] shift[2,3] 0,0,0,-1,2 sh[2] 1,2 j[1] [4],0,0,0,1 rm[4] shift[2,3] 0,0,0,1,2 +hsv2rgb[2,3] rm[2,3] +_blend_screen : ++-[0] 255 -[1] 255 *[1,2] /[1] 255 *[1] -1 +[1] 255 +_blend_shapeareamax : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[1] round[1] 0.01 label[1] 0 ++f[0] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[2] round[2] 0.01 area[2] 0,0 +{1,iM+1},1,1,{0,s+1} +f[1] ">area = i(#2); best = I[#3,i]; if (area>best[size(best) - 1], I[#3,i] = [ I(#0),area ]);i" +rm[2] channels[2] 0,{s-2} map[1] [2] rm[2] +_blend_shapeareamax0 : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I!=0?I+A:I" norm[1] round[1] 0.01 label_fg[1] 0 ++f[0] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[2] round[2] 0.01 area[2] 0,0 +{1,iM+1},1,1,{0,s+1} +f[1] ">area = i(#2); best = I[#3,i]; if (area>best[size(best) - 1], I[#3,i] = [ I(#0),area ]);i" +rm[2] channels[2] 0,{s-2} point[2] 0,0,0,1,0 map[1] [2] rm[2] +_blend_shapeareamin : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[1] round[1] 0.01 label[1] 0 ++f[0] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[2] round[2] 0.01 area[2] 0,0 +{1,iM+1},1,1,{0,s+1},inf +f[1] ">area = i(#2); best = I[#3,i]; if (areaarea = i(#2); best = I[#3,i]; if (areai(#2,i(#1,x,y,z,0),0,0,c)+=i;i" ++histogram[1] {w},0,{w-1} /[-2,-1] map[1] . rm. +_blend_shapeaverage0 : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I!=0?I+A:I" norm[1] round[1] 0.01 label_fg[1] 0 {iM+1},1,1,{0,s} +f[0] ">i(#2,i(#1,x,y,z,0),0,0,c)+=i;i" ++histogram[1] {w},0,{w-1} /[-2,-1] point. 0,0,0,1,0 map[1] . rm. +_blend_shapemedian : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[1] round[1] 0.01 label[1] 0 +N={iM+1} $N,1,1,{s#0} $N,8,1,{s#0} s. x +f[1] "> +begin(siz = vector"$N"()); +k = i; +k3 = k + 3; +hk3 = h(#k3); +copy(i[#k3,siz[k]++],I(#0),s#0,hk3,whd#0); +if (siz[k]>=hk3,resize(#k3,1,round(1.5*hk3+1),1,s#0,0,0)); +end(repeat (size(siz),k, resize(#k+3,1,siz[k],1,s#0,0,0))); +i" +repeat s#0 { sh[3--1] $> $N,1,1,1,"ic(#"$N"+3+x)" j[2] .,0,0,0,$> rm[-{$N+1}--1] } +map[1] [2] k[0,1] +_blend_shapemedian0 : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I!=0?I+A:I" norm[1] round[1] 0.01 label_fg[1] 0 +N={iM} {$N+1},1,1,{s#0} $N,8,1,{s#0} s. x +f[1] "> +begin(siz = vector"$N"()); +k = i; +if (k, +k1 = k - 1; +k2 = k + 2; +hk2 = h(#k2); +copy(i[#k2,siz[k1]++],I(#0),s#0,hk2,whd#0); +if (siz[k1]>=hk2,resize(#k2,1,round(1.5*hk2+1),1,s#0,0,0)); +); +end(repeat (size(siz),k, resize(#k+3,1,siz[k],1,s#0,0,0))); +i" +repeat s#0 { sh[3--1] $> $N,1,1,1,"ic(#"$N"+3+x)" j[2] .,1,0,0,$> rm[-{$N+1}--1] } +map[1] [2] k[0,1] +_blend_shapemin : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[1] round[1] 0.01 label[1] 0 {iM+1},1,1,{0,s},inf +f[0] ">i(#2,i(#1,x,y,z,0),0,0,c) = min(i(#2,i(#1,x,y,z,0),0,0,c),i);i" +map[1] [2] rm. +_blend_shapemin0 : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I!=0?I+A:I" norm[1] round[1] 0.01 label_fg[1] 0 {iM+1},1,1,{0,s},inf +f[0] ">i(#2,i(#1,x,y,z,0),0,0,c) = min(i(#2,i(#1,x,y,z,0),0,0,c),i);i" +point. 0,0,0,1,0 map[1] [2] rm. +_blend_shapemax : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[1] round[1] 0.01 label[1] 0 {iM+1},1,1,{0,s},-inf +f[0] ">i(#2,i(#1,x,y,z,0),0,0,c) = max(i(#2,i(#1,x,y,z,0),0,0,c),i);i" +map[1] [2] rm. +_blend_shapemax0 : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I!=0?I+A:I" norm[1] round[1] 0.01 label_fg[1] 0 {iM+1},1,1,{0,s},-inf +f[0] ">i(#2,i(#1,x,y,z,0),0,0,c) = max(i(#2,i(#1,x,y,z,0),0,0,c),i);i" +point. 0,0,0,1,0 map[1] [2] rm. +_blend_shapeprevalent : +label. 0,0 nb_labels:=iM+1 a c ++n. 0,255 100%,100%,1,1,"H = 0; repeat (s#-1,p,(H*=31)+=j(#-1,0,0,0,p)); int(H)%2048" rm.. # Compute color hashcodes +1,1,1,{0,s+1}x2048 +eval[1] "begin(_color = tmp = vector(#s#0)); +color = I(#0); +ind = i + 2; +whdind = whd(#ind); +found = 0; +repeat (da_size(#ind),k, +copy(_color,i(#ind,0,k,0,1),s#0,1,whdind); +_color==color?( +found = 1; +copy(tmp,i[#ind,0],s#ind,1,whdind); +copy(i[#ind,0],i[#ind,k],s#ind,whdind,whdind); +copy(i[#ind,k],tmp,s#ind,whdind,1); +break(); +); +); +found?++i[#ind,k]:da_push(#ind,[ 1,color ])" +da_freeze[2--1] a[2--1] y rm.. +1,$nb_labels,1,{0,s} +eval.. "P = I; region = P[size(P) - 1]; i[#-1,region][1] 255 +j[2] [3],0,0,0,0,1,[1] rm[1,3] c[1] 0,255 +_blend_softdodge : ++-[1] 255.1 ^[2] -1 *[2] [0] *[2] -127.5 +-[1] 255 ++[0] 0.1 /[3,4] *[3] 127.5 +[3] 255 +[1] [0] >[1] 255 +j[2] [3],0,0,0,0,1,[1] rm[1,3] c[1] 0,255 +_blend_softlight : ++/[0] 255 /[1] 255 +sqr. *[2] [1] *[1] [3] *[1] -2 *[2] 2 +[1-3] *[1] 255 c[1] 0,255 +_blend_stamp : +*[1] 2 +[1] [0] -[1] 255 c[1] 0,255 +_blend_subtract : +-[1] [0] *[1] -1 c[1] 0,255 +_blend_value : +to_color sh 0,2 rgb2hsv[2,3] sh[2] 0,1 j[1] [4] rm[4] hsv2rgb[2,3] rm[2,3] +_blend_vividlight : +*[1] 2 +blend burn -[1] 256 +blend[0,1] dodge >=[1] 0 +j[2] [3],0,0,0,0,1,[1] rm[1,3] +_blend_xor : +xor[1] [0] +#@cli blend_edges : smoothness[%]>=0 +#@cli : Blend selected images togethers using 'edges' mode. +#@cli : $ image.jpg testimage2d {w},{h} +blend_edges 0.8 +blend_edges : check {$1>=0} +e[^-1] "Blend image$? using 'edges' mode, with smoothness $1." +if $!>1 +to_rgb ri[^0] [0],0,0,0.5,0.5 +foreach { +gradient_norm +. 1 b. $1 n. 1,10 sqr. s.. c *[-4--2] . a[-4--1] c } +ri[^0] [0],0,0,0.5,0.5 + s. c /[-4--2] . rm. a[-3--1] c +fi +#@cli blend_fade : [fading_shape] +#@cli : Blend selected images together using specified fading shape. +#@cli : $ image.jpg testimage2d {w},{h} 100%,100%,1,1,'cos(y/10)' normalize[-1] 0,1 +blend_fade[0,1] [2] +blend_fade : +e[^-1] "Blend image$? together using fading pattern $1." +r ${-max_whds},0 +pass$1 0 r. [0],[0],[0],100%,1 max. 0 min. {$!-2} +repeat $!-1 { +-. $> abs. -. 1 *. -1 max. 0 *[$>,-1] } rm. ++ +_fade : +ri.. ...,5 ri. ..,3 c. $1%,$2% n. 0,1 j... ..,0,0,0,0,1,. rm[-2,-1] +#@cli blend_median +#@cli : Blend selected images together using 'median' mode. +#@cli : $ image.jpg testimage2d {w},{h} +mirror[0] y +blend_median +blend_median : +e[^-1] "Blend image$? using 'median' mode." +if $!<2 return fi +to_colormode 0 r ${-max_whd},100%,0,0,0.5,0.5,0.5 +if $!==2 + / 2 +else +whds={w},{h},{d},{s} r 100%,100%,{d*s},1,-1 a c +100%,100%,100%,1,"med(I(#0))" k. r $whds,-1 +fi +#@cli blend_seamless : _is_mixed_mode={ 0 | 1 },_inner_fading[%]>=0,_outer_fading[%]>=0 +#@cli : Blend selected images using a seamless blending mode (Poisson-based). +#@cli : Default values: 'is_mixed=0', 'inner_fading=0' and 'outer_fading=100%'. +blend_seamless : check "${2=0}>=0 && ${3=100%}>=0" skip ${1=0} +s0="non-mixed" s1="mixed" +e[^-1] "Blend image$? using seamless mode (Poisson-based), in "${s{$1!=0}}" mode with inner fading $2 and +outer fading $3." +to_a[^0] +if ['$3']!='100%' +repeat $!-1 { l[0,1] { ++blend_seamless $1,$2,100% channels.. 100% !=.. 0 distance.. 1 +iM={-2,iM} ic={if(${is_percent\ $3},2*$3*$iM,1+$3)} +if $ic<=$iM c.. 0,{max(1,$ic)} n.. 0,1 +else n.. 0,{max(0,2-$ic/$iM)} +fi +*.. -1 +.. 1 +j[0] [2],0,0,0,0,1,[1] rm[1,2] +} } +else +repeat $!-1 { l[0,1] { ++r[0] 1,1,1,100%,2 avg={^} rm. +split_opacity. !=. 0 *.. . erode. 3 +g[0,1] xy,1,2 +*[-3,-2] . +if $1 ++a[0,1] c +a[2,3] c norm[-2,-1] +<[-2,-1] *[-2,-1] +fi +if $2 +distance. 0 +iM={iM} ic={if(${is_percent\ $2},2*$2*$iM,1+$2)} +if $ic<=$iM c. 0,{max(1,$ic)} n. 0,1 +else n. 0,{max(0,2-$ic/$iM)} +fi +fi +j[-5] ...,0,0,0,0,1,. +j[-4] ..,0,0,0,0,1,. +rm[-3--1] +g[0] x,-1,2 g[1] y,-1,2 + +ilaplacian 0 ++fc. $avg ++[-2,-1] +c 0,255 +} } +fi +#@cli fade_diamond : 0<=_start<=100,0<=_end<=100 +#@cli : Create diamond fading from selected images. +#@cli : Default values: 'start=80' and 'end=90'. +#@cli : $ image.jpg testimage2d {w},{h} +fade_diamond 80,85 +fade_diamond : skip ${1=70},${2=90} +e[^-1] "Create ($1%,$2%) diamond-shaped fading from image$?." +repeat int($!/2) { l[$>,{$>+1}] { +(0,1,0;1,1,1;0,1,0) _fade $1,$2 +} } +#@cli fade_linear : _angle,0<=_start<=100,0<=_end<=100 +#@cli : Create linear fading from selected images. +#@cli : Default values: 'angle=45', 'start=30' and 'end=70'. +#@cli : $ image.jpg testimage2d {w},{h} +fade_linear 45,48,52 +fade_linear : skip ${1=45},${2=30},${3=70} +e[^-1] "Create ($2%,$3%) linear fading from image$?, with angle $1 deg." +repeat int($!/2) { l[$>,{$>+1}] { +64,64,1,1,"x*cos($1*pi/180) + y*sin($1*pi/180)" _fade $2,$3 +} } +#@cli fade_radial : 0<=_start<=100,0<=_end<=100 +#@cli : Create radial fading from selected images. +#@cli : Default values: 'start=30' and 'end=70'. +#@cli : $ image.jpg testimage2d {w},{h} +fade_radial 30,70 +fade_radial : skip ${1=30},${2=70} +e[^-1] "Create ($1%,$2%) radial fading from image$?." +repeat int($!/2) { l[$>,{$>+1}] { +100%,100% =. 1,50%,50% distance. 1 _fade $1,$2 +} } +#@cli fade_x : 0<=_start<=100,0<=_end<=100 +#@cli : Create horizontal fading from selected images. +#@cli : Default values: 'start=30' and 'end=70'. +#@cli : $ image.jpg testimage2d {w},{h} +fade_x 30,70 +fade_x : skip ${1=30},${2=70} +e[^-1] "Create ($1%,$2%) horizontal fading from image$?." +repeat int($!/2) { l[$>,{$>+1}] { (0,1) _fade $1,$2 } } +#@cli fade_y : 0<=_start<=100,0<=_end<=100 +#@cli : Create vertical fading from selected images. +#@cli : Default values: 'start=30' and 'end=70'. +#@cli : $ image.jpg testimage2d {w},{h} +fade_y 30,70 +fade_y : skip ${1=30},${2=70} +e[^-1] "Create ($1%,$2%) vertical fading from image$?." +repeat int($!/2) { l[$>,{$>+1}] { (0;1) _fade $1,$2 } } +#@cli fade_z : 0<=_start<=100,0<=_end<=100 +#@cli : Create transversal fading from selected images. +#@cli : Default values: 'start=30' and 'end=70'. +fade_z : skip ${1=30},${2=70} +e[^-1] "Create ($1%,$2%) transversal fading from image$?." +repeat int($!/2) { l[$>,{$>+1}] { (0/1) _fade $1,$2 } } +#@cli sub_alpha : [base_image],_opacity_gain>=1 +#@cli : Compute the minimal alpha-channel difference (opposite of alpha blending) between the selected images +#@cli : and the specified base image. +#@cli : The alpha difference A-B is defined as the image having minimal opacity, such that alpha_blend(B,A-B) = A. +#@cli : Default value: 'opacity_gain=1'. +#@cli : $ image.jpg testimage2d {w},{h} +sub_alpha[0] [1] display_rgba +sub_alpha : check "${2=1}>=1 && "${"is_image_arg $1"} +e[^-1] "Compute minimal alpha-channel difference between image$? and base image $1, with opacity gain $2." +remove_opacity repeat $! { pass$1 0 l[$>,-1] { +to_colormode 0 r ${-max_whd},100%,0,0,0.5,0.5 ++>[0,1] *[2] 255 +-[0,2] [1] replace[2] 0,1 +i[2] [0] /[2,3] +compose_channels[2] max +*[2] $2 c[2] 0,1 ++replace[2] 0,1 /[0,3] +[0,1] *[1] 255 a c +} } +#@cli :: Image Sequences and Videos +#@cli animate : filter_name,"param1_start,...,paramN_start","param1_end,...,paramN_end",nb_frames>=0,_output_frames={ 0 | 1 },_output_filename : delay>0,_back and forth={ 0 | 1 } +#@cli : Animate filter from starting parameters to ending parameters or animate selected images +#@cli : in a display window. +#@cli : Default value: 'delay=30'. +#@cli : $ image.jpg animate flower,"0,3","20,8",9 +animate : skip ${1=30},${2=0},${3=""},${4=10},${5=1},"${6=}" +if "isnum($1)" +e[0--3] "Animate image$?, with a delay of $1 ms"${"if $2 u \", in back-and-forth mode\" else u \"\" fi"}. +if !$! return fi +speed,pause,direction,scale,frame=$1,-1,1,1,0 +is_same_size={"res = 1; s = [ w#0,h#0 ]; for (k = 1, k=0 direction=$pause pause=-1 +else pause=$direction direction=0 fi +wait -1 +fi +while {*}" && "!{*,Q}" && "!{*,ESC} w 0 +else +e[0--3] "Compute animated version of filter '$1', from parameters $2 to $3 with $4 frames." +if !($5||narg("$6")) return fi +($2) ($3) y[-2,-1] x a[-2,-1] y r. 100%,$4,1,1,3 mv. 0 rprogress 0 +repeat $!-1 { +u=$> +e " > Animate image ["$>"]" +repeat $4 { +l[0,1] { +-$1. {0,@{$>*{0,w}}-{($>+1)*{0,w}-1}} rm[0] +if narg("$6") o ${filename\ "$6",$u,$>} fi +if !$5 rm fi +rprogress {100*($>+1)/$4} +e "\r > Animate image ["$u"] : Frame "{$>+1}"/$4 " +} } +rm[1] +} +rm[0] +fi +#@cli apply_camera : _"command",_camera_index>=0,_skip_frames>=0,_output_filename +#@cli : Apply specified command on live camera stream, and display it on display window [0]. +#@cli : This command requires features from the OpenCV library (not enabled in G'MIC by default). +#@cli : Default values: 'command=""', 'camera_index=0' (default camera), 'skip_frames=0' and 'output_filename=""'. +apply_camera : check_opencv $0 skip "${1=},${4=}" check "${2=0}>=0 && ${3=0}>=0" +e[^-1] "Apply command '$1' on camera stream ""#$2, with $3 frames skip and output filename '$4'." +m "_apply_camera_com : $1" +is_ext "$4",avi is_outavi=${} +is_ext "$4",mp4 is_outmp4=${} +is_fs=0 +l[] { +i=0 +do +camera $2,1,$3 +_apply_camera_com. +if !$! 640,480,1,3 else k. fi +if {*}" && "[w,h]!=[{*,d,e}] ++r2din. {*,d,e},1,0,0.5,0.5 r. {*,d,e},1,100%,0,0,0.5,0.5 +else . +fi +w. -1,-1,"[G'MIC] Camera ""#$2 ("{0,w}x{0,h}")" +k[0] +if narg("$4") +if $is_outavi||$is_outmp4 z. 0,{w-(w%8)-1} o. "$4",25,mp4v,1 +else o. ${filename\ "$4",$i} i+=1 +fi +fi +if {*,S} o. gmic_camera.png fi +is_ctrl:={*,CTRLLEFT}" || "{*,CTRLRIGHT} +if !$is_fs" && "$is_ctrl" && "{*,-D} w[] {{*,w}*1.5},{{*,h}*1.5} fi +if !$is_fs" && "$is_ctrl" && "{*,-C} w[] {{*,w}/1.5},{{*,h}/1.5} fi +if $is_ctrl" && "{*,-F} +if !$is_fs fs_wh={*,w,h} w[] {*,u,v},1,1 is_fs=1 +else w[] $fs_wh,1,0 is_fs=0 +fi +fi +if $is_ctrl" && "{*,-R} w[] {0,w},{0,h},1,0 is_fs=0 fi +rm +while {*}" && "!{*,ESC}" && "!{*,Q} +camera $2,0 +} +#@cli apply_files : "filename_pattern",_"command",_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1,_output_filename +#@cli : Apply a G'MIC command on specified input image files, in a streamed way. +#@cli : If a display window is opened, rendered frames are displayed in it during processing. +#@cli : The output filename may have extension '.avi' or '.mp4' (saved as a video), or any other usual image file +#@cli : extension (saved as a sequence of images). +#@cli : Default values: 'command=(undefined)', 'first_frame=0', 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'. +apply_files : check "isint(${3=0}) && $3>=0 && isint(${4=-1}) && ($4>=0 || $4==-1) && ${5=1}>=1" skip "${2=},${6=}" +e[^-1] "Apply command '$2' on input image files '$1', with first frame $3, last frame $4, frame step $5 and +output filename '$6'.\n" +files 3,"$1" _N=/{narg(${})-1} arg2var _file,${} v + _apply_stream[] "${_file{$frame+1}}","$2",${3-5},"$6" +#@cli apply_video : video_filename,_"command",_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1,_output_filename +#@cli : Apply a G'MIC command on all frames of the specified input video file, in a streamed way. +#@cli : If a display window is opened, rendered frames are displayed in it during processing. +#@cli : The output filename may have extension '.avi' or '.mp4' (saved as a video), or any other usual image +#@cli : file extension (saved as a sequence of images). +#@cli : This command requires features from the OpenCV library (not enabled in G'MIC by default). +#@cli : Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'. +apply_video : check_opencv $0 check "isint(${3=0}) && $3>=0 && isint(${4=-1}) && ($4>=0 || $4==-1) && ${5=1}>=1" +skip "${2=},${6=}" +e[^-1] "Apply command '$2' on input video file '$1', with first frame $3, last frame $4, frame step $5 and +output filename '$6'.\n" +_N= v + _apply_stream[] "\"$1\",$frame","$2",${3-5},"$6" +_apply_stream : skip "${2=},${6=}" +is_ext "$6",avi is_outavi=${} +is_ext "$6",mp4 is_outmp4=${} +frame=$3 i=0 go_on=1 +do +l[] { $1 onfail go_on=0 } +if $go_on +e "\r > Frame ""#"$frame$_N" " +frame+=$5 +l { $2 onfail error[0--5] "Command 'apply_stream': Specified command errored: "${} } +if !$! continue fi +if narg("$6") +if $is_outavi||$is_outmp4 z. 0,{w-(w%8)-1} o. "$6",25,mp4v,1 else o. ${filename\ "$6",$i} i+=1 fi +fi +if {*} +title="[G'MIC] Frame ""#"$frame +if !narg($wh) wh=${fitscreen[]\ {[w,h]}} w. $wh,0,$title +else w. -1,-1,0,$title +fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,D} w[] {{*,w}*1.5},{{*,h}*1.5} wait -1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,C} w[] {{*,w}/1.5},{{*,h}/1.5} wait -1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,R} w[] {0,w},{0,h} wait -1 fi +fi +rm. +fi +while $go_on" && "($4==-1" || "$frame<=$4) +if $is_outavi||$is_outmp4 o[] "$6",25,mp4v,0 fi +#@cli average_files : "filename_pattern",_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1,_output_filename +#@cli : Average specified input image files, in a streamed way. +#@cli : If a display window is opened, rendered frames are displayed in it during processing. +#@cli : The output filename may have extension '.avi' or '.mp4' (saved as a video), or any other usual image +#@cli : file extension (saved as a sequence of images). +#@cli : Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'. +average_files : check "isint(${2=0}) && $2>=0 && isint(${3=-1}) && ($3>=0 || $3==-1) && ${4=1}>=1" skip "${5=}" +e[^-1] "Average input image files '$1', with first frame $2, last frame $3, frame step $4 and +output filename '$5'.\n" +files 3,"$1" _N=/{narg(${})-1} arg2var _file,${} v + _average_stream[] "${_file{$frame+1}}",${2-4},"$5" +#@cli average_video : video_filename,_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1,_output_filename +#@cli : Average frames of specified input video file, in a streamed way. +#@cli : If a display window is opened, rendered frames are displayed in it during processing. +#@cli : The output filename may have extension '.avi' or '.mp4' (saved as a video), or any other usual image +#@cli : file extension (saved as a sequence of images). +#@cli : This command requires features from the OpenCV library (not enabled in G'MIC by default). +#@cli : Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'. +average_video : check_opencv $0 check "isint(${2=0}) && $2>=0 && isint(${3=-1}) && ($3>=0 || $3==-1) && ${4=1}>=1" +skip "${5=}" +e[^-1] "Average frames of input video file '$1', with first frame $2, last frame $3, frame step $4 and +output filename '$5'.\n" +_N= v + _average_stream[] "\"$1\",$frame",${2-4},"$5" +_average_stream : skip "${5=}" +is_ext "$5",avi is_outavi=${} +is_ext "$5",mp4 is_outmp4=${} +frame=$2 i=0 go_on=1 N=0 +imM=inf,-inf +do +l[] { $1 onfail go_on=0 } +if $go_on +e "\r > Frame ""#"$frame$_N" " +imM={v=[$imM];[min(im,v[0]),max(iM,v[1])]} +N+=1 +if $!>1 r ${-max_whds} + fi +if narg("$5") ++/. $N c. $imM +if $is_outavi||$is_outmp4 z. 0,{w-(w%8)-1} o. "$5",25,mp4v,1 else o. ${filename\ "$5",$i} i+=1 fi +rm. +fi +if {*} +title="[G'MIC] Frame ""#"$frame ++n 0,255 +if !narg($wh) wh=${fitscreen[]\ {[w,h]}} w. $wh,0,$title +else w. -1,-1,0,$title +fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,D} w[] {{*,w}*1.5},{{*,h}*1.5} wait -1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,C} w[] {{*,w}/1.5},{{*,h}/1.5} wait -1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,R} w[] {0,w},{0,h} wait -1 fi +rm. +fi +frame+=$4 +fi +while $go_on" && "($3==-1" || "$frame<=$3) +/ $N c $imM +if $is_outavi||$is_outmp4 o[] "$5",25,mp4v,0 fi +#@cli fade_files : "filename_pattern",_nb_inner_frames>0,_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1,_output_filename +#@cli : Generate a temporal fading from specified input image files, in a streamed way. +#@cli : If a display window is opened, rendered frames are displayed in it during processing. +#@cli : The output filename may have extension 'avi' or 'mp4' (saved as a video), or any other usual image +#@cli : file extension (saved as a sequence of images). +#@cli : Default values: 'nb_inner_frames=10', 'first_frame=0', 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'. +fade_files : check "isint(${2=10}) && $2>0 && isint(${3=0}) && $3>=0 && +isint(${4=-1}) && ($4>=0 || $4==-1) && ${5=1}>=1" skip "${6=}" +e[^-1] "Fade input image files '$1', with $2 inner frames, first frame $3, last frame $4, frame step $5 and +output filename '$6'.\n" +files 3,"$1" _N=/{narg(${})-1} arg2var _file,${} v + _fade_stream[] "${_file{$frame+1}}",${2-5},"$6" +#@cli fade_video : video_filename,_nb_inner_frames>0,_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1,_output_filename +#@cli : Create a temporal fading sequence from specified input video file, in a streamed way. +#@cli : If a display window is opened, rendered frames are displayed in it during processing. +#@cli : This command requires features from the OpenCV library (not enabled in G'MIC by default). +#@cli : Default values: 'nb_inner_frames=10', 'first_frame=0', 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'. +fade_video : check_opencv $0 check "isint(${2=10}) && $2>0 && isint(${3=0}) && $3>=0 && +isint(${4=-1}) && ($4>=0 || $4==-1) && ${5=1}>=1" skip "${6=}" +e[^-1] "Fade frames of input video file '$1', with $2 inner frames, first frame $3, last frame $4, frame step $5 and +output filename '$6'.\n" +_N= v + _fade_stream[] "\"$1\",$frame",${2-5},"$6" +_fade_stream : skip "${6=}" +is_ext "$6",avi is_outavi=${} +is_ext "$6",mp4 is_outmp4=${} +frame=$3 i=0 go_on=1 +l { $1 onfail go_on=0 } +if !$go_on return fi +w={w} h={h} s={s} +if {*} w. ${fitscreen\ $w,$h},0,"[G'MIC]" fi +pframe=$frame frame+=$5 +do +l[] { $1 onfail go_on=0 } +if !$go_on break fi +to_colormode. $s r. $w,$h +repeat $2+2 { +if $< +title="[G'MIC] Frame ""#"$pframe" -> ""#"$frame$_N" ("{1+$>}/$2")" +e "\r - "$title ++j[0] [1],0,0,0,0,{$>/($2+1)} +if narg("$6") +if $is_outavi||$is_outmp4 z. 0,{w-(w%8)-1} o. "$6",25,mp4v,1 else filename "$6",$i i+=1 o. ${} fi +fi +if {*} +w. -1,-1,0,$title +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,D} w[] {{*,w}*1.5},{{*,h}*1.5} wait -1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,C} w[] {{*,w}/1.5},{{*,h}/1.5} wait -1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,R} w[] {0,w},{0,h} wait -1 fi +fi +rm. +fi +} +rm[0] pframe=$frame frame+=$5 +while $go_on" && "($4==-1" || "$frame<=$4) +if narg("$6") +if $is_outavi||$is_outmp4 z. 0,{w-(w%8)-1} o[] "$6",25,mp4v,0 else filename "$6",$i o. ${} fi +fi +rm +#@cli files2video : "filename_pattern",_output_filename,_fps>0,_codec +#@cli : Convert several files into a single video file. +#@cli : Default values: 'output_filename=output.mp4', 'fps=25' and 'codec=mp4v'. +files2video : check "isint(${3=25}) && $3>0" skip "${2=output.mp4}",${4=mp4v} +files=${"files \"$1\""} arg2var _file,$files nb_files=${} +('$files') if w>128 z. 0,127 s_files={t}... else s_files=$files fi rm. +e[^-1] "Convert image files '"$s_files"' into frames of output video '$2', with $3 fps and $4 codec.\n" +repeat $nb_files { l[] { +file=${_file{$>+1}} +_file=${basename\ $file} +e "\r - Image "{1+$>}/$nb_files" ["$_file"] -> [$2] " +i $file o "$2",$3,$4,1 +rm +onfail e "\n - Error occurred on input file '"$file"'.\n" +} } +o $"$2",0,0,0 +#@cli median_files : "filename_pattern",_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1,_frame_rows[%]>=1,_is_fast_approximation={ 0 | 1 } +#@cli : Compute the median frame of specified input image files, in a streamed way. +#@cli : If a display window is opened, rendered frame is displayed in it during processing. +#@cli : Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1', 'frame_rows=20%' and 'is_fast_approximation=0'. +median_files : check "isint(${2=0}) && $2>=0 && isint(${3=-1}) && ($3>=0 || $3==-1) && +${4=1}>=1 && ${5=20%}>0 && isnum(${6=0})" +s0="fast" s1="precise" +e[^-1] "Compute median of input image files '$1', with first frame $2, last frame $3, frame step $4, +frame rows $5, using "${s{!$6}}" algorithm." +files 3,"$1" _N=/{narg(${})-1} arg2var _file,${} +l[] { +${_file{$frame+1}} => res f. 0 +v + _median_stream "${_file{$frame+1}}",${2-6} v - +} +#@cli median_video : video_filename,_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1,_frame_rows[%]>=1,_is_fast_approximation={ 0 | 1 } +#@cli : Compute the median of all frames of an input video file, in a streamed way. +#@cli : If a display window is opened, rendered frame is displayed in it during processing. +#@cli : This command requires features from the OpenCV library (not enabled in G'MIC by default). +#@cli : Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1', 'frame_rows=100%' and 'is_fast_approximation=1'. +median_video : check_opencv $0 check "isint(${2=0}) && $2>=0 && isint(${3=-1}) && ($3>=0 || $3==-1) && +${4=1}>=1 && ${5=100%}>0 && isnum(${6=1})" +s0="fast" s1="precise" +e[^-1] "Compute median frame of input video file '$1', with first frame $2, last frame $3, frame step $4, +frame rows $5, using "${s{!$6}}" algorithm." +_N= +l[] { +"$1",0 => res f. 0 +v + _median_stream "\"$1\",$frame",${2-6} v - +} +_median_stream : +if $6 +e "- Retrieve min/max values of all frames.\n" +frame=$2 go_on=1 +imM=inf,-inf +do +l[] { $1 onfail go_on=0 } +if $go_on +e "\r > Frame ""#"$frame$_N" " +imM={v=[$imM];[min(im,v[0]),max(iM,v[1])]} +if {*} +title="[G'MIC] Frame ""#"$frame +if !narg($wh) wh=${fitscreen[]\ {[w,h]}} w. $wh,1,$title +else w. -1,-1,1,$title +fi +fi +rm. +frame+=$4 +fi +while $go_on" && "($3==-1" || "$frame<=$3) +_N=/{$frame-$4} +fact={v=[$imM];dv=v[1]-v[0];dv<=0?0:255/dv} +fi +h1={h-1} drows={round(${is_percent\ $5}?$5*h:$5)} +nb_iter={round(h/$drows,1,1)} +repeat $nb_iter { +row0={$drows*$>} row1={0,min(h,$row0+$drows-1)} +e "- Iteration \#"{$>+1}/$nb_iter": Load rows "$row0-$row1/$h1".\n" +frame=$2 go_on=1 +if $6 +N=0 +{w},$drows,256,{s} => hist +do +l[] { $1 => img onfail go_on=0 } +if $img +e "\r > Frame ""#"$frame$_N" " +if {*}" && "!$> +title="[G'MIC] Frame ""#"$frame +if !narg($wh) wh=${fitscreen[]\ {img,[w,h]}} w[img] $wh,1,$title +else w[img] -1,-1,1,$title +fi +fi +rows[img] $row0,$row1 f[img] ":++i(#-2,x,y,round(i*"$fact"),c)" +rm[img] +frame+=$4 N+=1 +fi +while $go_on" && "($3==-1" || "$frame<=$3) +cumulate[hist] z +N2={int($N/2)} +[hist],[hist],1,[hist] +if $N%2 +f. ":go_on = 1; for (z = 0, i(#"$hist",x,y,z,c)<"$N2" && z<256, ++z); z" +else +f. ":begin(N2p = "$N2"; N2n = N2p + 1); +go_on = 1; +for (zp = 0, i(#"$hist",x,y,zp,c) img onfail go_on=0 } +if $go_on +e "\r > Frame ""#"$frame$_N" " +if {*}" && "!$> +title="[G'MIC] Frame ""#"$frame +if !narg($wh) wh=${fitscreen[]\ {[w,h]}} w. $wh,1,$title +else w. -1,-1,1,$title +fi +fi +rows. $row0,$row1 +frame+=$4 +fi +while $go_on" && "($3==-1" || "$frame<=$3) +e "\r > Compute median blending of "$!" frames." +__median_stream +} +fi +_N=/{$frame-$4} +j[res] .,0,$row0 +if {*} w[res] -1,-1,1,"[G'MIC] Iteration ""#"$> fi +rm. +} +e "- Done!" +__median_stream : +if $!<2 return +elif $!==2 + / 2 +else +f. ": +stack = vector"{0,2*$!}"(); +stacksize = 0; +push(elt0,elt1) = (stack[stacksize++] = elt0; stack[stacksize++] = elt1); +pop() = (_s1 = stack[--stacksize]; _s0 = stack[--stacksize]; [_s0,_s1]); +push(0,"$!" - 1); +while (stacksize>0, +range = pop(); +lo = range[0]; +hi = range[1]; +pivot = i(#int((lo + hi)/2)); +while (lo<=hi, +while (i(#lo)=1,_smoothness>=0,_precision>=0 +#@cli : Create morphing sequence between selected images. +#@cli : Default values: 'smoothness=0.1' and 'precision=4'. +#@cli : $ image.jpg +rotate 20,1,1,50%,50% morph 9 +morph : check "$1>=0.5 && ${2=0.1}>=0 && ${3=4}>=0" +nbf={round($1)} +e[^-1] "Create morphing sequence between image$?, with "$nbf" inner frames, smoothness $2 and precision $3.\n" +nchan=${-max_s} if $nchan<=4 to_colormode $nchan else channels 0,{$nchan-1} fi +ri[^0] [0],3 +repeat $!-1 { +nm={$>,n} +l[$<,{$<+1}] { +e "\r > Morph image "$>" to image "{$>+1}". " ++equalize[0,1] n[-2,-1] 0,255 ++displacement[3] [2],$2,$3 +displacement[2] [3],$2,$3 rm[-4,-3] +repeat $nbf+2 { +if $>&&$< +t={$>/($nbf+1)} omt={1-$t} ++*[2] $t +warp[0] .,1,1,1 rm.. *. $omt ++*[3] {1-$t} +warp[1] .,1,1,1 rm.. *. $t ++[-2,-1] +fi +} +rm[2,3] mv[2--1] 1 =>[^] $nm +} +} +#@cli morph_files : "filename_pattern",_nb_inner_frames>0,_smoothness>=0,_precision>=0,_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1,_output_filename +#@cli : Generate a temporal morphing from specified input image files, in a streamed way. +#@cli : If a display window is opened, rendered frames are displayed in it during processing. +#@cli : The output filename may have extension '.avi' or '.mp4' (saved as a video), or any other usual image +#@cli : file extension (saved as a sequence of images). +#@cli : Default values: 'nb_inner_frames=10', 'smoothness=0.1', 'precision=4', 'first_frame=0', 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'. +morph_files : check "isint(${2=10}) && $2>0 && ${3=0.1}>=0 && ${4=4}>=0 && +isint(${5=0}) && $5>=0 && isint(${6=-1}) && ($6>=0 || $6==-1) && ${7=1}>=1" skip "${8=}" +e[^-1] "Morph input image files '$1', with $2 inner frames, smoothness $3, precision $4, first frame $5, +last frame $6, frame step $7 and output filename '$8'.\n" +files 3,"$1" _N=/{narg(${})-1} arg2var _file,${} _morph_stream[] "${_file{$frame+1}}",${2-7},"$8" +#@cli morph_rbf : nb_inner_frames>=1,xs0[%],ys0[%],xt0[%],yt0[%],...,xsN[%],ysN[%],xtN[%],ytN[%] +#@cli : Create morphing sequence between selected images, using RBF-based interpolation. +#@cli : Each argument (xsk,ysk)-(xtk,ytk) corresponds to the coordinates of a keypoint +#@cli : respectively on the source and target images. The set of all keypoints define the overall image deformation. +morph_rbf : check "$1>=0.5" +nbf={round($1)} +e[^-1] "Create morphing sequence between image$? using RBF interpolation, ""with "$nbf" inner frames and keypoints ($*)." +$=arg N={($#-1)/4} +if int($N)!=$N error[0--2] "Command 'morph_rbf': Wrong number of arguments ($#)." fi +ri[^0] [0],3 +repeat $!-1 { nm={$>,n} l[$<,{$<+1}] { +e "\r > Morph image "$>" to image "{$>+1}". " +4,$N +repeat wh { a=${arg{2+$>}} isp=${"is_percent "$a} eval i[$>]=$isp?($>%2?w#0:h#0)*$a:$a } +permute. yzcx ++f. "[i0,i1,i2-i0,i3-i1]" +f.. "[i2,i3,i0-i2,i1-i3]" +rbf[-2,-1] {0,[w,h]} +repeat $nbf+2 { +if $>&&$< +[0],[0],1,[0]," +const interpolation = 1; +const boundary = 3; +const t = "$>"/("$nbf"+1); +const omt = 1 - t; +begin(print([t,omt])); +ub = i(#2,x,y,0,0); +vb = i(#2,x,y,0,1); +uf = i(#3,x,y,0,0); +vf = i(#3,x,y,0,1); +omt*I(#0,x - t*uf,y - t*vf) + t*I(#1,x - omt*ub,y - omt*vb)" +fi +} +rm[2,3] mv[2--1] 1 =>[^] $nm +} } +#@cli morph_video : video_filename,_nb_inner_frames>0,_smoothness>=0,_precision>=0,_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1,_output_filename +#@cli : Generate a temporal morphing from specified input video file, in a streamed way. +#@cli : If a display window is opened, rendered frames are displayed in it during processing. +#@cli : The output filename may have extension '.avi' or '.mp4' (saved as a video), or any other usual image +#@cli : file extension (saved as a sequence of images). +#@cli : This command requires features from the OpenCV library (not enabled in G'MIC by default). +#@cli : Default values: 'nb_inner_frames=10', 'smoothness=0.1', 'precision=4', 'first_frame=0', 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'. +morph_video : check_opencv $0 check "isint(${2=10}) && $2>0 && ${3=0.1}>=0 && ${4=4}>=0 && +isint(${5=0}) && $5>=0 && isint(${6=-1}) && ($6>=0 || $6==-1) && ${7=1}>=1" skip "${8=}" +e[^-1] "Morph frames of input video file '$1', with $2 fading frames, smoothness $3, precision $4, first frame $5, +last frame $6, frame step $7 and output filename '$8'.\n" +_N= v + _morph_stream[] "\"$1\",$frame",${2-7},"$8" +_morph_stream : skip "${8=}" +is_ext "$8",avi is_outavi=${} +is_ext "$8",mp4 is_outmp4=${} +frame=$5 i=0 go_on=1 +l { $1 onfail go_on=0 } +if !$go_on return fi +w={w} h={h} s={s} +if {*} w. ${fitscreen\ $w,$h},0,"[G'MIC]" fi +pframe=$frame frame+=$7 +do +l[] { $1 onfail go_on=0 } +if !$go_on break fi +to_colormode. $s r. $w,$h +cutvals={[min(im#0,im#1),max(iM#0,iM#1)]} +e "\r - Frame ""#"$pframe" -> ""#"$frame" " ++equalize[0,1] n[-2,-1] 0,255 ++displacement[3] [2],$3,$4 +displacement[2] [3],$3,$4 rm[-4,-3] +repeat $2+2 { +if $< +title="Frame ""#"$pframe" -> ""#"$frame" ("$>/$2") " +e "\r - "$title +t={$>/($2+1)} omt={1-$t} ++*[2] $t +warp[0] .,1,1,1 rm.. *. $omt ++*[3] {1-$t} +warp[1] .,1,1,1 rm.. *. $t ++[-2,-1] c. $cutvals +if narg("$8") +if $is_outavi||$is_outmp4 z. 0,{w-(w%8)-1} o. "$8",25,mp4v,1 else filename "$8",$i i+=1 o. ${} fi +fi +if {*} +w. -1,-1,0,$title +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,D} w[] {{*,w}*1.5},{{*,h}*1.5} wait -1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,C} w[] {{*,w}/1.5},{{*,h}/1.5} wait -1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,R} w[] {0,w},{0,h} wait -1 fi +fi +rm. +fi +} +rm[0,-2,-1] pframe=$frame frame+=$7 +while $go_on" && "($6==-1" || "$frame<=$6) +if narg("$8") +if $is_outavi||$is_outmp4 z. 0,{w-(w%8)-1} o[] "$8",25,mp4v,0 else filename "$8",$i o. ${} fi +fi +rm +#@cli register_nonrigid : [destination],_smoothness>=0,_precision>0,_nb_scale>=0 +#@cli : Register selected source images with specified destination image, using non-rigid warp. +#@cli : Default values: 'smoothness=0.2', 'precision=6' and 'nb_scale=0(auto)'. +#@cli : $ image.jpg +rotate 20,1,1,50%,50% +register_nonrigid[0] [1] +register_nonrigid : check ${is_image_arg\ $1}" && ${2=0.2}>=0 && ${3=5}>0 && ${4=0}>=0" +e[^-1] "Register source image$? with destination image $1, using non-rigid warp with smoothness $2, +precision $3 and $4 scale(s)." +pass$1 0 equalize. n. 0,255 +repeat $!-1 { ++equalize[$>] n. 0,255 +displacement.. .,$2,$3,$4 rm.. +warp[$>] .,1,1,1 rm. +} rm. +#@cli register_rigid : [destination],_smoothness>=0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror } +#@cli : Register selected source images with specified destination image, using rigid warp (shift). +#@cli : Default values: 'smoothness=0.1%' and 'boundary_conditions=0'. +#@cli : $ image.jpg +shift 30,20 +register_rigid[0] [1] +register_rigid : check ${is_image_arg\ $1}" && ${2=0.1%}>=0 && isint(${3=0}) && $3>=0 && $3<=3" +e[^-1] "Register source image$? with destination image $1, using rigid warp with smoothness $2." +m "_register_rigid : b $2 equalize 256 n 0,1" +pass$1 0 W,H,D,S={[w,h,d,s]} +f={max(w,h)/1024} +if $f<=1 +_register_rigid. +repeat $!-1 { +if {$>,w!=$W||h!=$H||d!=$D} +error[0--4] "Images have incompatible sizes ("{$>,[w,h,d,s]}") and ("{[$W,$H,$D,$S]}")." +fi ++_register_rigid[$>] phase_correlation. .. shift[$>] {^},0,$3 rm. +} +rm. +else ++r. {[min(w,1024),min(h,1024),min(d,1024)]},100%,0,0,0.5,0.5 +rr2d.. 1024,1024,0,2 +_register_rigid[-2,-1] +repeat $!-2 { +if {$>,w!=$W||h!=$H||d!=$D} +error[0--4] "Images have incompatible sizes ("{$>,[w,h,d,s]}") and ("{[$W,$H,$D,$S]}")." +fi ++rr2d[$>] 1024,1024,0,2 _register_rigid. +phase_correlation. ... +s={$f*crop()} rm. ++shift[$>] $s,0,$3 +r. {[min(w,1024),min(h,1024),min(d,1024)]},100%,0,0,0.5,0.5 _register_rigid. +phase_correlation. .. +s={[$s]+crop()} rm. +shift[$>] $s,0,$3 +} +rm[-2,-1] +fi +um _register_rigid +#@cli transition : [transition_shape],nb_added_frames>=0,100>=shading>=0,_single_frame_only={ -1=disabled | >=0 } +#@cli : Generate a transition sequence between selected images. +#@cli : Default values: 'shading=0' and 'single_frame_only=-1'. +#@cli : $ image.jpg +mirror c 100%,100% plasma[-1] 1,1,6 transition[0,1] [2],5 +transition : check ${is_image_arg\ $1}" && $2>=0 && ${3=0}>=0 && $3<=100" skip ${4=-1} +frame={round($4)} s0=" and shading $3" s1=", shading $3 and single-frame-only "$frame +e[^-1] "Create transition sequence between image$? with $2 added frames, transition shape $1"${s{$4>0}}"." +if $!<2" || "!$2 return fi +to_colormode 0 r ${-max_whd},100%,0,0,0.5,0.5 +pass$1 0 norm. r. [0],[0],[0],1,3 n. 0,1 mv. 0 +repeat $!-2 { l[0,{$<+1},{$<+2}] { +nm0={1,n} +if $3 repeat $2 { if $4<0" || "$>==$frame +val0={($>+0.5)/$2-$3%} +val1={($>+0.5)/$2+$3%} ++f[0] '(i-$val0)/($val1-$val0)' c. 0,1 ++j[2] [1],0,0,0,0,1,. rm.. +=> $nm0\ ""#{1+$>} +fi } else repeat $2 { if $4<0" || "$>==$frame ++>=[0] {($>+0.5)/$2} ++j[2] [1],0,0,0,0,1,. rm.. +=> $nm0\ ""#{1+$>} +fi } fi +mv[2] $! +} } rm[0] +#@cli transition3d : _nb_frames>=2,_nb_xtiles>0,_nb_ytiles>0,_axis_x,_axis_y,_axis_z,_is_antialias={ 0 | 1 } +#@cli : Create 3D transition sequence between selected consecutive images. +#@cli : 'axis_x', 'axis_y' and 'axis_z' can be set as mathematical expressions, depending on 'x' and 'y'. +#@cli : Default values: 'nb_frames=10', 'nb_xtiles=nb_ytiles=3', 'axis_x=1', 'axis_y=1', 'axis_z=0' and 'is_antialias=1'. +#@cli : $ image.jpg +blur 5 transition3d 9 display_rgba +transition3d : check "isint(${1=10}) && $1>=2 && isint(${2=3}) && $2>0 && isint(${3=$2}) && $3>0" +skip ${4=1},${5=1},${6=0},${7=1} +e[^-1] "Create 3D transition sequence between image$?, with $1 frames, $2x$3 tiles and rotation axis ($4,$5,$6).\n" +if $!<2 return fi +slices 0 to_rgb r ${-max_whds},3 +off=0 repeat $!-1 { l[{$>+$off},{$>+$off+1}] { +e "\r > Generate transition from image "$>" to image "{$>+1}". " +$2,$3,1,1,'$4' +$2,$3,1,1,'$5' +$2,$3,1,1,'$6' +a[-3--1] z +permute. zxyc r. 3,{$2*$3},1,1,-1 +repeat h { rot$>={@0-2} shift. 0,-1,0,0 } +rm. ++split_tiles[-2,-1] $2,$3 mv[0,1] $! +N={$2*$3} i=0 y=0 +repeat $3 { +x=0 +repeat $2 { +lw={$i,w} lh={$i,h} +imageplane3d[$i] imageplane3d[$N] r3d[$N] ${rot$i},180 c3d[$i,$N] +3d[$i,$N] +x$i=$x y$i=$y x+=$lw i+=1 +} +y+=$lh +} +repeat $1-2 { +repeat $N { r3d[$>] ${rot$>},{180/(1-$1)} ++3d[$>] ${x$>},${y$>},0 } ++3d[-$N--1] c3d. +if $7 +i... {-2,2*[w,h]},1,3,-1 +*3d. 2 j3d... .,50%,50%,0,1,2,0,0 rm. +to_rgba.. replace_color.. 0,0,-1,-1,-1,255,0,0,0,0 +downsize_aliased.. 50 +else +i... {-2,w},{-2,h},1,3,-1 j3d... .,50%,50%,0,1,2,0,0 rm. +to_rgba.. replace_color.. 0,0,-1,-1,-1,255,0,0,0,0 +fi +} +rm[0-{$N-1}] +=>[1--2] {0,n} +off+={$1-2} +} } +#@cli video2files : input_filename,_output_filename,_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1 +#@cli : Split specified input video file into image files, one for each frame. +#@cli : First and last frames as well as step between frames can be specified. +#@cli : Default values: 'output_filename=frame.png', 'first_frame=0', 'last_frame=-1' and 'frame_step=1'. +video2files : check "isint(${3=0}) && $3>=0 && isint(${4=-1}) && ($4>=0 || $4==-1) && isint(${5=1}) && $5>=1" +skip ${2="frame.png"} +e[^-1] "Split input video file '$1' into image frames '$2', with first frame $3, last frame $4, and frame step $5.\n" +frame=$3 stopflag=0 +do l[] { +i "$1",$frame +if $! +o ${"filename \"$2\","$frame} rm +e "\r > Frame ""#"$frame +frame+=$5 +else stopflag=1 +fi +onfail stopflag=1 +} while !$stopflag" && "($frame<=$4" || "$4==-1) +#@cli :: Convenience Functions +#@cli alert : _title,_message,_label_button1,_label_button2,... +#@cli : Display an alert box and wait for user's choice. +#@cli : If a single image is in the selection, it is used as an icon for the alert box. +#@cli : Default values: 'title=[G'MIC Alert]' and 'message=This is an alert box.'. +alert : skip "${1=[G"{`39`}"MIC Alert]},${2=This is an alert box.},${3=OK}" +if $!==1 +e[0--3] "Display alert box, with image$?, title '$1', message '$2' and buttons '${3--1}'." +else +e[0--3] "Display alert box, with title '$1', message '$2' and buttons '${3--1}'." +fi +if $!==1 logo= else logo=[] fi ++l$logo { +if $!==1 to_rgb +else +64,64 polygon 3,50%,10%,10%,90%,90%,90%,1,1 b 3 >= 50% ++erode. 5 -. .. ==. 0 +polygon. 4,47%,43%,53%,43%,53%,66%,47%,66%,1,0 circle. 50%,76%,2,1,0 ++*[0] 255 . 100%,100% a[-3--1] c -. '3*(y-h/2)' c. 0,255 +*. .. rm.. *[0] 255 rv a c +drop_shadow 3,3,1 i[0] 100%,100%,1,3,200 blend alpha +fi +channels -1,2 +$=arg +repeat $#-2 { label=${arg{$>+3}} 0 t. $label,0,0,16,1,-200 } +r[^0] {min(128,max(64,${max_w[^0]}+12))},{min(48,max(24,${max_h[^0]}+12))},1,1,0,0,0.5,0.5 ++[^0] 200 to_rgb[^0] +mv[0] $! +[0],[0],1,1,'(y-h/2)' *. -2 c. -30,30 +[0--3] . rm. c[^-1] 0,255 +foreach[^-1] { ++rectangle 0,0,100%,100%,1,0xFFFFFFFF,0 +rectangle. 1,1,{w-2},{h-2},1,0xFFFFFFFF,0 +line. 2,{h-3},{w-3},{h-3},1,150 line. {w-3},{h-3},{w-3},2,1,150 +line. 1,1,{w-3},1,1,255 line. 1,1,1,{h-3},1,255 +rectangle. 4,4,{w-5},{h-5},1,0xAAAAAAAA,0 ++shift.. 1,1,0,0,2 +rectangle. 0,0,100%,100%,1,0xFFFFFFFF,0 +rectangle. 1,1,{w-2},{h-2},1,0xFFFFFFFF,150 +rectangle. 4,4,{w-5},{h-5},1,0xAAAAAAAA,0 +rectangle... 0,0,100%,100%,1,0xFFFFFFFF,0 +line... 1,{h-2},{w-2},{h-2},1,150 line... {w-2},{h-2},{w-2},1,1,150 +line... 0,0,{w-2},0,1,255 line... 0,0,0,{h-2},1,255 +i[0] 100%,100% =[0] 1,0,0 +a c +} ++l { +channels 0,3 sh 1,100% -[50%--1] 200 rm[50%--1] frame 8,8,0 +if $!<6 a[^-1] x else append_tiles[^-1] , fi +0 t. "$2",0,0,16,1,0,-200,-200,-200 r. {w+16},{h+8},1,4,0 +a[-2,-1] x,0.5 rv a y,0.5 +sh 1,100% +. 200 rm. +rectangle 0,0,100%,100%,1,0xFFFFFFFF,0 +line 0,0,{w-2},0,1,0,255,255,255 line 0,0,0,{h-2},1,0,255,255,255 +} +rm.. ++channels. 0 +(0,{w-1}) (0;{-2,h-1}) ri[-2,-1] ...,3 a[-2,-1] c round. rv[-2,-1] *[-2,-1] +discard. 0 y. r. {h/2},2,1,1,-1 +channels.. 1,3 rv[-2,-1] +100%,100% repeat w#-3 { x0={-3,i($>,0)} y0={-3,i($>,1)} rectangle. $x0,$y0,{$x0+{0,w}-1},{$y0+{0,h}-1},1,{1+$>} } +a[-2,-1] c +repeat 9 { if !{*$>} disp=$> break fi } +if !narg($disp) error[0--4] "Command '$0': Cannot open display window for alert box." fi +selected={if($#==3,0,-1)} clicked=-1 +do ++channels. 0,2 +if $clicked>=0 +x0={-3,i($clicked,0)} y0={-3,i($clicked,1)} +sh[$clicked] 7,9 +j.. .,$x0,$y0 rm. +elif $selected>=0 +x0={-3,i($selected,0)} y0={-3,i($selected,1)} +sh[$selected] 4,6 +j.. .,$x0,$y0 rm. +fi +w$disp. 100%,100%,0,"$1" rm. wait +xm={*$disp,x} ym={*$disp,y} bm={{*$disp,b}&1} val={i($xm,$ym,0,3)} +if $bm" && "$val clicked={$val-1} +elif $bm" && "!$val" && "$clicked>=0 selected=$clicked clicked=-1 +elif !$bm" && "$clicked>=0" && "$clicked==$val-1 break +fi +if {*$disp,ARROWRIGHT} selected={($selected+1)%{-2,w}} wait -1 +elif {*$disp,ARROWLEFT} selected={($selected-1)%{-2,w}+($selected==-1)} wait -1 +elif $selected>=0" && "{*$disp,ENTER} clicked=$selected break +fi +while {*$disp}" && "!{*$disp,ESC} +w$disp 0 rm u $clicked +} +#@cli arg : n>=1,_arg1,...,_argN +#@cli : Return the n-th argument of the specified argument list. +arg : check "isint($1) && ($1)>0" +$=arg u ${arg{1+($1)}} +#@cli arg0 : n>=0,_arg0,...,_argN +#@cli : Return the n-th argument of the specified argument list (where 'n' starts from '0'). +arg0 : check "isint($1) && ($1)>=0" +$=arg u ${arg{2+($1)}} +#@cli arg2img : argument_1,...,argument_N +#@cli : Split specified list of arguments and return each as a new image (as a null-terminated string). +arg2img : +$=arg repeat $# { arg=${arg{1+$>}} ({'$arg'},0) => $arg } +#@cli arg2var : variable_name,argument_1,...,argument_N +#@cli : For each i in [1...N], set 'variable_name$i=argument_i'. +#@cli : The variable name should be global to make this command useful (i.e. starts by an underscore). +arg2var : +$=arg u {$#-1} repeat ${} { $1{1+$>}=${arg{2+$>}} } +#@cli autocrop_coords : value1,value2,... | auto +#@cli : Return coordinates (x0,y0,z0,x1,y1,z1) of the autocrop that could be performed on the latest +#@cli : of the selected images. +#@cli : Default value: 'auto' +autocrop_coords : skip ${1=auto} +is_auto={['"$1"']=='auto'} +w,h,d,value:=w,h,d,i(w-1,h-1,d-1) ++=. {1+$value},100%,100%,100% _autocrop$is_auto. ${1--1} =. $value,100%,100%,100% +x0,y0,z0:=$w-w,$h-h,$d-d +_autocrop$is_auto. ${1--1} +x1,y1,z1:=$x0+w-1,$y0+h-1,$z0+d-1 rm. +u $x0,$y0,$z0,$x1,$y1,$z1 +_autocrop0 : autocrop $* +_autocrop1 : skip $* autocrop +#@cli average_vectors +#@cli : Return the vector-valued average of the latest of the selected images. +average_vectors : +if !w u "" return fi +repeat s-1 { sh. $> res.={ia}, rm. } +sh. 100% u $res{ia} rm. +#@cli base642img : "base64_string" +#@cli : Decode given base64-encoded string as a newly inserted image at the end of the list. +#@cli : The argument string must have been generated using command 'img2base64'. ++base642img : +base642uint8 "$1" unserialize. +#@cli base642uint8 : "base64_string" +#@cli : Decode given base64-encoded string as a newly inserted 1-column image at the end of the list. +#@cli : The argument string must have been generated using command 'uint82base64'. ++base642uint8 : +0 +eval " +ref(vector256(),hash); +for (k = _'A', k<=_'Z', ++k, hash[k] = k - _'A'); +for (k = _'a', k<=_'z', ++k, hash[k] = k - _'a' + 26); +for (k = _'0', k<=_'9', ++k, hash[k] = k - _'0' + 52); +hash[_'+'] = hash[_'-'] = 62; +hash[_'/'] = hash[_'_'] = 63; +s = ['$1']; +const ss = size(s); +ss>=2?( +resize(#-1,1,ss*3/4 - (s[ss-1]==_'=') - (s[ss-2]==_'='),1,1); +od = 0; +for (os = 0, os>4); +i[#-1,od++] = ((c2&15)<<4) | (c3>>2); +i[#-1,od++] = ((c3&3)<<6) | c4; +) +)" +=> "[unnamed]" +#@cli basename : file_path,_variable_name_for_folder +#@cli : Return the basename of a file path, and opt. its folder location. +#@cli : When specified 'variable_name_for_folder' must starts by an underscore +#@cli : (global variable accessible from calling function). +basename : skip ${2=unused} +l[] { +({"'$1'"}) replace 92,47 s +,47 +if i==47 a y $2={t} u "" +elif $!==1 u {t} $2="" +else a[^-1] y u {t} $2={-2,t} +fi +rm +} +#@cli bin : binary_int1,... +#@cli : Print specified binary integers into their octal, decimal, hexadecimal and string representations. +bin : +dec=${bin2dec\ ${^0}} +e[^-1] "Convert binary integer"${arg0\ ($#>1),"",s}" '${^0}' to octal '"${dec2oct\ $dec}"', +decimal '"$dec"', hexadecimal '"${dec2hex\ $dec}"' and string '"${dec2str\ $dec}"'." +#@cli bin2dec : binary_int1,... +#@cli : Convert specified binary integers into their decimal representations. +bin2dec : +$=arg res,sep= repeat $# { res=$res$sep${_$0\ ${arg{$>+1}}} sep=, } u $res +_bin2dec : +u {"str = v2s(abs($1)); +for (k = val = 0, str[k], ++k, +c = str[k]; +(val<<=1)+=(c==_'0'?0:c==_'1'?1:nan); +isnan(val)?break() +); sign($1)*val"} +#@cli cat : filename,_display_line_numbers={ 0 | 1 },_line_selection, +#@cli : Print specified line selection of given filename on stdout. +#@cli : Default values: 'display_line_numbers=1' and 'line_selection=^'. +cat : skip "${2=},${3=}" +if "isbool($2)" dln=$2 if "['$3']!=0" ls=${3--1} else ls=^ fi +else dln=0 if "['$2']!=0" ls=${2--1} else ls=^ fi +fi +it "$1" +1 eval.. ">i==10?da_push(0,-1):i!=13?da_push(i); end(da_freeze())" +s. -,-1 0 rv[0,-1] rm. +m "_$0 : u $""[]" sel=${"-_$0["$ls"]"} um _$0 k[$ls] +e "" +if $dln ($sel) foreach[^-1] { pass. 1 +e "#"{@$>}:" "{/{0,t}} rm. } else foreach { +e {/{t}} } fi +rm +_check120 : +use_vt100 +it[] "$1" s +,10 +if !$! return fi +1,$!,1,2,">begin(line = 1); is_lines=i[#y,0]==10; line+=is_lines?h#y:0; [is_lines || h#y<=120?-1:y,line]" +lines={{@-1}-1} f. "I = I; if(I[0]<0,I[1]=-1); I" +discard. -1 +if w +r. 1,{h/2},1,2,-1 +repeat h { +l,L={I[$>]} +e $_vt100_c" - [Line "$_vt100_b$L$_vt100_n$_vt100_c", "$_vt100_b{$l,h}$_vt100_n$_vt100_c" chars]: "$_vt100_n{$l,t} +} +fi +rm +_total_lines+=$lines +e " - Scanned : "${lines}" lines" +check120 : +_total_lines=0 +files 0,*.h c={`narg($files)?',':0`} if narg(${}) files=$files$c${} fi +files 0,*.cpp c={`narg($files)?',':0`} if narg(${}) files=$files$c${} fi +files 0,*.c c={`narg($files)?',':0`} if narg(${}) files=$files$c${} fi +files 0,*.gmic c={`narg($files)?',':0`} if narg(${}) files=$files$c${} fi +repeat narg($files) { +arg0 $>,$files file=${} +e " * File '"$file"'." +v + _check120 $file v - +} +e " - Total scanned : "${_total_lines}" lines" +#@cli color2name : R,G,B +#@cli : Return the name (as a string, in English) that most matches the specified color. +color2name : +_color2name ($1^$2^$3) r. {-2,w},1,1,3 -[-2,-1] norm. arg0 {xm},${"u "{n}} +('${}') replace. {'~'},{'" "'} u {t} rm[-2,-1] +_color2name : +if ['$__color2name']==0 +base642img "MiB1aW50OCBsaXR0bGVfZW5kaWFuCjg4MSAxIDEgMyAjMjU4MQp4nCVWeTjViRr+cu/MnZvubSoNDVmqqVSKc6xFWUOLJUSJaDmYQ459zfll38JJuQ7GNvYlxlIiu2ZUv4Mw5OBUllOyVs5kTvjmzHO/f7/leb/3eZ/3+6A6tMZ7abRrMedD+TFk63BorEjhF2D2nZ6pwTVYistbXkdhaOTjHMHhLNRJewY61sdasVClggZyAEDNpzlsjbfQ5gVNPn+JnKoQJHh55Ex8M+MyC+aLTv/cvog41QVpw1h7fp7xtKKGBwc8dn7+oM4n8N4ErywKQ/rTJzlT2UzPRyuJDdzK52zElbgv1/Aw3kIcyxYA2KHgugNYNcD3zSbWCTbIVk6YSdZONDkiCXdtuMJHgAinwrbvap93kz0FizYd0s5LZGuyhXtdOXke0tqJet60uTu61vRMLOTjrqIoWIvOHlz7LSB2BtunYsamYMWpHAaRH8VeRS64lBAtIAN/x5biGwdmTnDxVdkymCKqeanM15zZxpk8Ddsa22qXa/An+5VC1eVmxTNH33Uuxb6lmw/txdLeej6JXaGI5NofiNaVS6mvu4UDKetPEOVjAqqx+34rUHYIeTx3lwb3dBqS+MezPswp+9j25aOT+P8+raFv7PtOovo1a9FYucJxxGekSPjxjA8NJqo+NaZqh4DJbysr6wMbs6bCbicknK0YmS7EOcYOEQ2T6oLjgvQmTMPb8cpsqSfdqDJU+YcQYcdJrfVh74I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NJdeKoqUiAZazykEijTa0Ok/2ZgVaGkfCtEzlqKxxshXWQjeKGWhEEnh1b8HwfxxSs6SqV+sOvELHJWmHR3LoKD1Ls1Lemz29JtuXJvjXWvJ5fv419v1uM10trldvyATC2XsjnroqWE2MQDRC6EAWtoYqUitoYuUEtG5kO3xGg5QhxgZdfHLpaQcw1bReGJN3K/d7Vu4zqQj/9IcQ/YSrSrrFzD27QJVYd4mI+y1xl6wnEGOL7nuyq0dSrl69yfLd5ad/u2MVhtoucDi/E4pCB7x0hdfDfJhtdds3VWKeeVWHKnDNflFXDxI0T5l4vFq+s+h/Hw8fVKhkVNPbxGyIgeJ02wvkMNwjiB/AUHRq81Fub4/0MrutB/pQsiBDV8V6CrR9s7xfJwJmnPfylo+vhO/5OSjurq07nP62KY3gESren/67lB+Coh3iulJcbq19XVva7nO9pu+5M5OJAhQgy1Hp5gA7/7g2vEj3z3tW8t+0CmhtQFhm4m16Z0ZPsJkR1CV6LtfxEn/RZN2UEXAjiFFEIrlMmO+P++ogkVSIffwzX0ZVaMiwHl0nc6EB7PIIQslkrIUReFtpWk2M7e6B8wYn/fvL/od1iXwzM+UnkLUWyR/dWKGzS7ZzwxOUy/weTnio/x3kK9a8AoEtE3mgEVw232h4Yg5/+nXuGBbeEtn1e9BTp4h2d6o9s32dT/utrtOqraI1wc1xQk/XB21qei9NtJhJIWfStJAbhCi8GN1CNwO6fDRioUnk+J3wfRxol06AM1e5+ov3qPzC79X2j246meq5z/QUEYKkStf/sfIaI+Kg==" ++store. __color2name +else $__color2name +fi +#@cli covariance_vectors : _avg_outvarname +#@cli : Return the covariance matrix of the vector-valued colors in the latest of the selected images +#@cli : (for arbitrary number of channels). +#@cli : Parameter 'avg_outvarname' is used as a variable name that takes the value of the average vector-value. +covariance_vectors : skip "${1=avg}" +$1=${-average_vectors} +eval. "*begin(avg = [ "$""$1" ]; C = vector(#s^2,0)); +mI = I - avg; +C+=mul(mI,mI,s); +end(merge(C,+); C/=whd - 1; run('u ',v2s(C)))" +#@cli da_freeze +#@cli : Convert each of the selected dynamic arrays into a 1-column image whose height is the number of array elements. +da_freeze : +e[^-1] "Freeze dynamic array$?." +$! eval. "da_freeze(#x)" rm. +#@cli dec : decimal_int1,... +#@cli : Print specified decimal integers into their binary, octal, hexadecimal and string representations. +dec : +e[^-1] "Convert decimal integer"${arg0\ ($#>1),"",s}" '${^0}' to binary '"${dec2bin\ ${^0}}"',"" octal '"${dec2oct\ ${^0}}"', hexadecimal '"${dec2hex\ ${^0}}"' and string '"${dec2str\ ${^0}}"'." +#@cli dec2str : decimal_int1,... +#@cli : Convert specifial decimal integers into its string representation. +dec2str : +u {`[${^0}]`} +#@cli dec2bin : decimal_int1,... +#@cli : Convert specified decimal integers into their binary representations. +dec2bin : +$=arg res,sep= repeat $# { res=$res$sep${_$0\ ${arg{$>+1}}} sep=, } u $res +_dec2bin : +u {`"const sgn = sign($1); +const N = (isinf($1) || isnan($1)?1:1 + floor(log2(max(1,abs($1))))) + (sgn>=0?0:1); +res = vectorN(); +sgn>=0?0:(res[0] = _'-'); +for (val = abs($1); k = size(res) - 1, k>=(sgn<0?1:0), --k, res[k] = _'0' + (val&1); val>>=1); res"`} +#@cli dec2hex : decimal_int1,... +#@cli : Convert specified decimal integers into their hexadecimal representations. +dec2hex : +$=arg res,sep= repeat $# { res=$res$sep${_$0\ ${arg{$>+1}}} sep=, } u $res +_dec2hex : +u {`"begin(tab = [ _'0',_'1',_'2',_'3',_'4',_'5',_'6',_'7',_'8',_'9',_'a',_'b',_'c',_'d',_'e',_'f' ]); +const sgn = sign($1); +const N = (isinf($1) || isnan($1)?1:1 + floor(log2(max(1,abs($1)))/4)) + (sgn>=0?0:1); +res = vectorN(); +sgn>=0?0:(res[0] = _'-'); +for (val = abs($1); k = size(res) - 1, k>=(sgn<0?1:0), --k, res[k] = tab[val&15]; val>>=4); res"`} +#@cli dec2oct : decimal_int1,... +#@cli : Convert specified decimal integers into their octal representations. +dec2oct : +$=arg res,sep= repeat $# { res=$res$sep${_$0\ ${arg{$>+1}}} sep=, } u $res +_dec2oct : +u {`"const sgn = sign($1); +const N = (isinf($1) || isnan($1)?1:1 + floor(log2(max(1,abs($1)))/3)) + (sgn>=0?0:1); +res = vectorN(); +sgn>=0?0:(res[0] = _'-'); +for (val = abs($1); k = size(res) - 1, k>=(sgn<0?1:0), --k, res[k] = _'0' + (val&7); val>>=3); res"`} +#@cli fibonacci : N>=0 +#@cli : Return the Nth number of the Fibonacci sequence. +#@cli : $ echo ${"fibonacci 10"} +#@cli : \n~~~\n[gmic]-0./ Start G'MIC interpreter.\n[gmic]-0./ 55\n[gmic]-0./ End G'MIC interpreter.\n~~~\n +fibonacci : check "$1>=0" +u {N=$1;if(N<2,N,for(n=N;F0=0;F1=1,n=n-1,F2=F0+F1;F0=F1;F1=F2))} +#@cli file_mv : filename_src,filename_dest +#@cli : Rename or move a file from a location $1 to another location $2. +file_mv : +e[^-1] "Move file '$1' to location '$2'." +if ${-is_windows} x "move "$1" "$2 else x "mv "$1" "$2 fi +#@cli filename : filename,_number1,_number2,...,_numberN +#@cli : Return a filename numbered with specified indices. +filename : skip "${1=default}" +if $#==1 u "$1" +else +(${2--1}) => "$1" u {f}{b} +repeat w { +u ${}_{int(i/100000)%10}{int(i/10000)%10}{int(i/1000)%10}{int(i/100)%10}{int(i/10)%10}{i%10} +shift. -1 +} +if narg({'{x}'}) u ${}.{x} fi +rm. +fi +#@cli filename_rand +#@cli : Return a random filename for storing temporary data. +filename_rand : +do filename=${-path_tmp}gmic$_pid{`round(u(vector6(_'0'),vector6(_'9')))`} +while isfile(['{/$filename}']) +u $filename +#@cli filename_dated : filename +#@cli : Convert specified filename to one stamped with the current date (`filename_YYYYMMDD_HHMMSS.ext`). +filename_dated : +0 => "$1" ext={x} folder={f} basename={b} rm. +if ['$ext']!=0 ext..=. fi +u ${folder}${basename}_{`" +str='00000000_000000'; +copy(str,v2s(date(0)),4); +v = date(1); copy(str[4 + (v<10)],v2s(v),2); +v = date(2); copy(str[6 + (v<10)],v2s(v),2); +v = date(4); copy(str[9 + (v<10)],v2s(v),2); +v = date(5); copy(str[11 + (v<10)],v2s(v),2); +v = date(6); copy(str[13 + (v<10)],v2s(v),v<10?1:2); +str"`}$ext +#@cli files : _mode,path : (+) +#@cli : Return the list of files and/or subfolders from specified path. +#@cli : 'path' can be eventually a matching pattern. +#@cli : 'mode' can be { 0=files only | 1=folders only | 2=files + folders }. +#@cli : Add '3' to 'mode' to return full paths instead of filenames only. +#@cli : Default value: 'mode=5'. +#@cli files2img : _mode,path +#@cli : Insert a new image where each vector-valued pixel is a string encoding the filenames returned by command ''files''. +#@cli : Useful to manage list of filenames containing characters that have a special meaning in the G'MIC language,such as spaces or commas. ++files2img : +if ['$$_$0_f2i']==0 m "_$0_f2i: $""=arg repeat $""# { ({'${arg{1+$>}}'}:^) } a y" fi +files $"*" l[] { _$0_f2i[] ${} if !$! 0 fi } +#@cli fitratio_wh : min_width,min_height,ratio_wh +#@cli : Return a 2D size 'width,height' which is bigger than 'min_width,min_height' and has the specified w/h ratio. +fitratio_wh : +if $3*$2>$1 u {int($3*$2)},$2 else u $1,{int($1/$3)} fi +#@cli fitscreen : width,height,_depth,_minimal_size[%],_maximal_size[%] : [image],_minimal_size[%],_maximal_size[%] +#@cli : Return the 'ideal' size WxH for a window intended to display an image of specified size on screen. +#@cli : Default values: 'depth=1', 'minimal_size=128' and 'maximal_size=85%'. +fitscreen : skip "${2=},${3=},${4=},${5=}" +if ${"is_image_arg $1"} +l$1 { W,H,D={[w,h,d]} } if narg($2) m=$2 else m=25% fi if narg($3) M=$3 else M=85% fi +else +W,H=${1-2} if narg($3) D=$3 else D=1 fi if narg($4) m=$4 else m=25% fi if narg($5) M=$5 else M=85% fi +fi +eval " +is_percent(str) = (unref(_is_pct); _is_pct=['#str']; _is_pct[size(_is_pct) - 1]==_'%'); +const u = "{*,u}"; +const v = "{*,v}"; +ms = round(is_percent("$m")?[ u,v ]*"$m":[ "$m,$m" ]); +Ms = round(is_percent("$M")?[ u,v ]*"$M":[ "$M,$M" ]); +s = [ "$W,$H" ]; +"$D">1?(s+="$D"); +s[0]Ms[0]?(s = [ Ms[0],s[1]*Ms[0]/s[0] ]); +s[1]>Ms[1]?(s = [ s[0]*Ms[1]/s[1],Ms[1] ]); +s[0] = max(1,s[0],ms[0]); +s[1] = max(1,s[1],ms[1]); +round(s)" +#@cli fontchart +#@cli : Insert G'MIC font chart at the end of the image list. +#@cli : $ fontchart ++fontchart : +e[^-1] "Generate G'MIC font chart." +l[] { +repeat 256 { +if $>==92 char=\\ else char={`max(1,(c=$>;c>=23&&c<=28?32:c))`} fi +0 t. {``$char},0,0,50,1,255 +} +a z,0.5 +s z +repeat $! { +t[$>] $>,1,-1,13,1,200 +0 t. \\${dec2oct\ $>},1,-1,13,1,1 +100%,100%,1,1,200 j[$>] .,{$>,[w,h]-[w#-1,h#-1]},0,0,1,.. rm[-2,-1] +} +frame 1,1,128 append_tiles , +} +font2cimgh : +e[^-1] "Encode font image$? as a C-style string for CImg.h." +foreach { +bnm={0,b} W,H={[w/256,h]} +e " > Encode font '"$bnm"'." +if !isint($W) error[0--4] "Font image '"$bnm"' has wrong dimensions ("{[w,h,d,s]}")." fi ++f "i==im || i==iM" is_binary={im==1} rm. +Mm=0 MM=100 +do +M={floor(($Mm+$MM)/2)} ++compress_rle $is_binary,$M rows. 6,100% +. {32-im} iM={iM} +if iM<126 Mm=$M rm. elif iM>126 MM=$M rm. fi +while $iM!=126 +k. nb_chunks={1+int(h/65536)} +e "\r > Encode font '"$bnm"' -> W = "$W", H = "$H", M = "$M", is_binary = "$is_binary", +nb_chunks = "$nb_chunks"." +replace_str "\\","\\\\" +replace_str "\"","\\\"" +s y,-111 +repeat $! { +if {$>,i[h-1]==_'\\'&&i[h-2]!=_'\\'} rows[$>] 0,{$>,h-2} rows[{$>+1}] -1,100% =[{$>+1}] {'\\'} fi +l[$>] { +i[0] ('" \""') ('\"') +if !$< ('" };"') fi +('\n') +y a y +} +} +repeat $nb_chunks-1 { ind={int($!*($>+1)/$nb_chunks)} l[$ind] { = {','},0,100% ('\n') y a y } } +i[0] ('" static const char *const data_font"${W}x${H}"[] = {"\n') +y a y ot $bnm.h +} +#@cli fps +#@cli : Return the number of time this function is called per second, or -1 if this info is not yet available. +#@cli : Useful to display the framerate when displaying animations. +fps : +if narg($_fps_fps) +dt={$|-$_fps_time} +if $dt>1 _fps_fps={round($_fps_nbframes/$dt)} _fps_time=$| _fps_nbframes=0 fi +u $_fps_fps +_fps_nbframes+=1 +else _fps_nbframes=0 _fps_time=$| _fps_fps=-1 u -1 +fi +#@cli gcd : a,b +#@cli : Return the GCD (greatest common divisor) between a and b. +gcd : check "isint($1) && isint($2) && $1*$2!=0" +_gcd {max(abs($1),abs($2))},{min(abs($1),abs($2))} +_gcd : +r={$1%$2} if $r u ${_gcd\ $2,$r} else u $2 fi +#@cli hex : hexadecimal_int1,... +#@cli : Print specified hexadecimal integers into their binary, octal, decimal and string representations. +hex : +dec=${hex2dec\ ${^0}} +e[^-1] "Convert hexadecimal integer"${arg0\ ($#>1),s,""}" '${^0}' to binary '"${dec2bin\ $dec}"', +octal '"${dec2oct\ $dec}"', decimal '"$dec"' and string '"${dec2str\ $dec}"'." +#@cli hex2dec : hexadecimal_int1,... +#@cli : Convert specified hexadecimal integers into their decimal representations. +hex2dec : +$=arg res,sep= repeat $# { res=$res$sep${_$0\ ${arg{$>+1}}} sep=, } u $res +_hex2dec : +u {"str = ['$1']; str[0]==_'-'?-s2v([['0x'],str[1,max(1,size(str)-1)]]):s2v([['0x'],str])"} +#@cli hex2img : "hexadecimal_string" +#@cli : Insert new image 1xN at the end of the list with values specified by the given hexadecimal-encoded string. ++hex2img : +('"$1"') 1,{w/2} +f. "* +from_char(x) = x>=48 && x<=57?x - 48:x-87; +off = 2*y; +from_char(i[#-2,off])*16 + from_char(i[#-2,off + 1])" +rm.. +#@cli hex2str : hexadecimal_string +#@cli : Convert specified hexadecimal string into a string. +#@cli : See also: ''str2hex''. +hex2str : skip ${1=""} +if !narg("$1") u "" return fi +('$*') if w<2 rm. u "" return fi +f. 'v=i-if(i>=97,87,48);if(x%2,v,v*16)' r. 2,{int(w/2)},1,1,-1 cumulate. x z. 1,1 +u {t} rm. +#@cli img2base64 : _encoding={ 0=base64 | 1=base64url },_store_names={ 0 | 1 } +#@cli : Encode selected images as a base64-encoded string. +#@cli : The images can be then decoded using command 'base642img'. +#@cli : Default values: 'encoding=0' and 'store_names=1'. +img2base64 : check "isbool(${1=0}) && isbool(${2=1})" +if isnum("$1") encoding=$1 else encoding=0 noarg fi ++serialize auto,1,$2 u ${uint82base64\ $encoding} rm. +#@cli img2hex +#@cli : Return representation of last image as an hexadecimal-encoded string. +#@cli : Input image must have values that are integers in [0,255]. +img2hex : +whds={w},{h},{d},{s} y. 2,{h} +f.. "* +to_char(x) = x>=0 && x<=9?48 + x:87 + x; +i(#-1,0,y) = to_char(int(i/16)); +i(#-1,1,y) = to_char(i%16); +i" +u {t} rm. r. $whds,-1 +#@cli img2str +#@cli : Return the content of the latest of the selected images as a special G'MIC input string. +img2str : +i[-2] 256 +eval. ">begin(off = 0); +sep = x==w - 1?(y==h - 1?(z==d - 1?(c==s - 1?0:_'^'):_'/'):_';'):_','; +it = v2s(i); +off + size(it) + 1>=w(#-2)?resize(#-2,round(1.5*w(#-2)),1,1,1,0); +for (k = 0, k] 'v=int(i)&15;v+if(v<10,48,87)' +f[$>] 'v=int(i)>>4;v+if(v<10,48,87)' +a[$>,-1] x +} +#@cli hex2img8 +#@cli : Convert selected hexadecimal representations (ascii-encoded) into 8bits-valued vectors. +hex2img8 : +e[^-1] "Convert hexadecimal representation$? (ascii-encoded) into 8bits-valued vectors." +repeat $! { +s. x,2 f[-2,-1] 'if(i>=97,i-87,i-48)' *.. 16 +[-2,-1] mv. 0 +} +#@cli is_mesh3d +#@cli : Return 1 if all of the selected images are 3D meshes, 0 otherwise. +is_mesh3d : +u 1 l { check3d 1 onfail u 0 } +_is_mesh3d : +u {"h>6 && int(i[0])==67 && int(i[1])==73 && int(i[2])==109 && int(i[3])==103 && int(i[4])==51 && int(i[5])==100"} +#@cli is_change : _value={ 0=false | 1=true } +#@cli : Set or unset the 'is_change' flag associated to the image list. +#@cli : This flag tells the interpreter whether or not the image list should be displayed when the pipeline ends. +#@cli : Default value: 'value=1'. +is_change : +l[] { check "isbool(${1=1})" arg=$1 onfail noarg arg=1 } +if $arg 0 rm. elif {*9} w9[] -1,-1 else w9 0 fi +#@cli is_half +#@cli : Return 1 if the type of image pixels is limited to half-float. +is_half : +(2049) u {i==2048} rm. +#@cli is_ext : filename,_extension +#@cli : Return 1 if specified filename has a given extensioin. +is_ext : skip "${1=},${2=}" +0 => "_$1" u {"lowercase(['"{x}"'])==lowercase(['$2'])"} rm. +#@cli is_image_arg : string +#@cli : Return 1 if specified string looks like '[ind]'. +is_image_arg : skip "${1=;}" +u {"str = ['$1']; +s1 = size(str) - 1; +(str[0]==_'[' && str[s1]==_']') || (str[0]=='.' && str[s1]=='.') && min(str)>=45 && max(str)<=122"} +#@cli is_pattern : string +#@cli : Return 1 if specified string looks like a drawing pattern '0x......'. +is_pattern : skip "${1=;}" +u {"str = ['$1']; size(str)>2 && same(str,'0x',2)"} +#@cli is_percent : string +#@cli : Return 1 if specified string ends with a '%', 0 otherwise. +is_percent : +u {"s=['$1'];s[size(s)-1]==_'%'"} +#@cli is_varname : string +#@cli : Return 1 if specified string can be considered as a valid variable name. +is_varname : skip "${1=}" +u {" +S = ['$1']; is_varname = 1; +inrange(S[0],_'0',_'9')?(is_varname = 0): +repeat(size(S),k, c = S[k]; +is_varname&=inrange(c,_'0',_'9') || inrange(c,_'a',_'z') || inrange(c,_'A',_'Z') || c=='_'; +!is_varname?break(); +); +is_varname"} +#@cli is_videofilename : filename +#@cli : Return 1 if extension of specified filename is typical from video files. +is_videofilename : skip "${1=}" +0 => "_$1" u {" +ext = lowercase(['"{x}"']); +ext=='avi' || ext=='mov' || ext=='asf' || ext=='divx' || ext=='flv' || ext=='mpg' || +ext=='m1v' || ext=='m2v' || ext=='m4v' || ext=='mjp' || ext=='mp4' || ext=='mkv' || +ext=='mpe' || ext=='movie' || ext=='ogm' || ext=='ogg' || ext=='ogv' || ext=='qt' || ext=='rm' || +ext=='vob' || ext=='wmv' || ext=='xvid' || ext=='mpeg'"} +rm. +#@cli is_macos +#@cli : Return 1 if current computer OS is Darwin (MacOS), 0 otherwise. +is_macos : +if !narg($_is_macos) _is_macos:=isdir('/Library/Apple/System/Library') fi +u $_is_macos +#@cli is_windows +#@cli : Return 1 if current computer OS is Windows, 0 otherwise. +is_windows : +if !narg($_is_windows) _is_windows={['$OS']!=0" && "['$WINDIR']!=0} fi +u $_is_windows +#@cli lof : feature +#@cli : Return the list of specified features (separated by commas) for each selected images. +lof : +foreach { res.=$c{"$*"} c=, } u $res +#@cli math_lib +#@cli : Return string that defines a set of several useful macros for the embedded math evaluator. +math_lib : +u " +heap_size(ind) = i[#ind,whd(#ind)-1]; +heap_insert(ind,elt) = ( +_heap_siz = heap_size(#ind); +_heap_siz>=h(#ind) - 1?resize(#ind,1,_heap_siz*2 + 2,1,s#ind,0); +hind = h(#ind); +unref(_heap_elt); +_heap_elt = [ elt ]; +_heap_eltsiz = max(1,size(_heap_elt)); +copy(i[#ind,_heap_siz],_heap_elt[0],_heap_eltsiz,hind,1); +for (_heap_pos = _heap_siz, +_heap_pos && (_heap_par = int((_heap_pos + 1)/2) - 1; _heap_elt[0]i[#ind,_heap_right]?( +_heap_swap = i[#ind,_heap_left]i[#ind,_heap_left]?( +_heap_swap = _heap_left; +):break(); +copy(i[#ind,_heap_siz],i[#ind,_heap_swap],_heap_eltsiz,hind,hind); # Use previous last elt as temporary for swap. +copy(i[#ind,_heap_swap],i[#ind,_heap_pos],_heap_eltsiz,hind,hind); +copy(i[#ind,_heap_pos],i[#ind,_heap_siz],_heap_eltsiz,hind,hind); +_heap_pos = _heap_swap; +); +(heap_size(#ind)) = _heap_siz; +); +dar_size(ind) = i[#ind,h(#ind) - 1]; +dar_Back(ind) = I[#ind,dar_size(#ind) - 1]; +dar_back(ind) = i[#ind,dar_size(#ind) - 1]; +dar_insert(ind,elt,pos) = ( +ref(pos,_dar_pos); +ref(elt,_dar_elt); +_dar_siz = dar_size(#ind); +ref(max(1,s(#ind),size(_dar_elt)),_dar_sizelt); +if (_dar_pos<=_dar_siz, +_dar_siz>=h(#ind) - 1?resize(#ind,1,_dar_siz*2 + 2,1,_dar_sizelt,0); +for (_dar_c = 0, _dar_c<_dar_sizelt, ++_dar_c, +copy(i(#ind,_dar_pos + 1,0,0,_dar_c),i(#ind,_dar_pos,0,0,_dar_c),_dar_siz - _dar_pos) +); +copy(i[#ind,_dar_pos],_dar_elt,_dar_sizelt,h(#ind),1); +i[#ind,h(#ind) - 1] = ++_dar_siz; +); +); +dar_insert(ind,elt) = ( +ref(elt,_dar_elt); +_dar_siz = dar_size(#ind); +ref(max(1,s(#ind),size(_dar_elt)),_dar_sizelt); +_dar_siz>=h(#ind) - 1?resize(#ind,1,_dar_siz*2 + 2,1,_dar_sizelt,0); +copy(i[#ind,_dar_siz],_dar_elt,_dar_sizelt,h(#ind),1); +i[#ind,h(#ind) - 1] = ++_dar_siz; +); +dar_remove(ind,pos) = ( +ref(pos,_dar_pos); +_dar_siz = dar_size(#ind); +if (_dar_pos<_dar_siz, +_dar_siz = --dar_size(#ind); +for (_dar_c = 0, _dar_c0?--dar_size(#ind); +); +dist(A,B) = ( +norm(B - A); +); +dist(X,A,B) = ( +AB = B - A; +P = A + dot(X - A,B - A)/max(1e-8,dot(AB,AB))*AB; +dot(P - A,P - B)<=0?norm(P - X):min(norm(A - X),norm(B - X)); +); +dist(A,B,C,D) = ( +min(dist(A,C,D),dist(B,C,D),dist(C,A,B),dist(D,A,B)); +); +meig(A,m,n) = ( +unref(meig_m,meig_n); +const meig_n = n; +const meig_m = min(m,meig_n); +ref(vector(#meig_m*meig_n),meig_V); +ref(vector(#meig_m^2),meig_H); +ref(expr('v',1,meig_n),meig_vj); meig_vj/=norm(meig_vj); +repeat (meig_m,meig_j, +copy(meig_V[meig_j*meig_n],meig_vj,meig_n); +meig_vj = A*meig_vj; +for (meig_i = 0, meig_i<=meig_j, ++meig_i, +ref(meig_V[meig_i*meig_n,meig_n],meig_vi); +meig_d = dot(meig_vj,meig_vi); +meig_H[meig_j*meig_m + meig_i] = meig_d; +meig_vj-=meig_d*meig_vi; +); +meig_nvj = norm(meig_vj); +meig_H[meig_j*meig_m + meig_j + 1] = meig_nvj; +meig_nvj<1e-12?break(); +meig_vj/=meig_nvj; +); +eig(meig_H)[0,m]; +); +search_dichotomic(fn_x,target,epsilon,xmin,xmax) = ( +_dicho_fn(x) = _dicho_sgn*(fn_x); +_dicho_epsilon = epsilon; +_dicho_m = xmin; +_dicho_M = xmax; +_dicho_sgn = 1; +_dicho_autom = isnan(_dicho_m); +_dicho_autoM = isnan(_dicho_M); +if (_dicho_autom, _dicho_m = -1); +if (_dicho_autoM, _dicho_M = 1); +_dicho_sgn = _dicho_fn(_dicho_m)>_dicho_fn(_dicho_M)?-1:1; +_dicho_res = nan; +_dicho_target = _dicho_sgn*target; +_dicho_nb_attempts = 30; +_dicho_autom?do ( +_dicho_fm = _dicho_fn(_dicho_m); +_dicho_fm<_dicho_target?break(); +_dicho_m*=2; +_(while), --_dicho_nb_attempts); +_dicho_nb_attempts?( +_dicho_autoM?do ( +_dicho_fM = _dicho_fn(_dicho_M); +_dicho_fM>_dicho_target?break(); +_dicho_M*=2; +_(while), --_dicho_nb_attempts); +_dicho_nb_attempts?( +_dicho_nb_attempts = 100; +do ( +_dicho_c = (_dicho_m + _dicho_M)/2; +_dicho_fc = _dicho_fn(_dicho_c); +abs(_dicho_fc - _dicho_target)<_dicho_epsilon?(_dicho_res = _dicho_c; break()): +_dicho_fc<_dicho_target?(_dicho_m = _dicho_c): +(_dicho_M = _dicho_c); +_(while), --_dicho_nb_attempts +); +); +); +_dicho_res; +); +search_dichotomic(fn_x,target,epsilon) = search_dichotomic(fn_x,target,1e-3,nan,nan); +search_dichotomic(fn_x,target) = search_dichotomic(fn_x,target,1e-3); +search_dichotomic(fn_x) = search_dichotomic(fn_x,0); +arrow(ind,P0,P1,angle,length,opacity,color) = ( +unref(_da_color); +_opacity = opacity; +_da_color = color; +_P0 = P0; +_P1 = P1; +_P0P1 = _P1; +_P0P1-=_P0; +if (length<0, _P0P1*=-length/100, _P0P1*=length/norm(_P0P1)); +coords = [ _P0,_P1,_P1,_P1 - rot(angle°)*_P0P1,_P1,_P1 - rot(-angle°)*_P0P1 ]; +repeat (3,_k, polygon(#ind,2,coords[4*_k,2],coords[4*_k+2,2],_opacity,_da_color)); +); +spline(ind,P0,T0,P1,T1,opacity,color) = ( +unref(_ds_color); +_P0 = P0; +_P1 = P1; +_opacity = opacity; +_ds_color = resize(color,s#ind)*=abs(_opacity); +_omopacity = 1 - max(_opacity,0); +_C = mul([ 2,-2,1,1,-3,3,-2,-1,0,0,1,0,1,0,0,0 ],[ _P0,P1,T0,T1 ],2); +_dt = _dtmin = 1/max(abs(_P1 - _P0)); +_P0 = inf; +for (_t = 0, _t<=1, _t+=_dt, +_P = round(mul([_t^3,_t^2,_t,1],_C,2)); +_dP = abs(mul([3*_t^2,2*_t,1,0],_C,2)); +_dt = min(_dtmin,0.75/max(_dP)); +if (_P0!=_P, I(#ind,_P) = _ds_color + _omopacity*I(#ind,_P)); +_P0 = _P; +); +nan; +); +thickspline(ind,P0,T0,P1,T1,thickness,opacity,color) = ( +unref(_ds_color); +unref(_ds_mask); +_P0 = P0; +_P1 = P1; +_opacity = opacity; +_radius = thickness/2; +_ds_color = resize(color,s#ind)*=abs(_opacity); +_omopacity = 1 - max(_opacity,0); +_C = mul([ 2,-2,1,1,-3,3,-2,-1,0,0,1,0,1,0,0,0 ],[ _P0,P1,T0,T1 ],2); +_dt = _dtmin = 1/max(abs(_P1 - _P0)); +_P0 = inf; +for (_t = 0, _t<=1, _t+=_dt, +_P = round(mul([_t^3,_t^2,_t,1],_C,2)); +_dP = abs(mul([3*_t^2,2*_t,1,0],_C,2)); +_dt = min(_dtmin,0.75/max(_dP)); +if (_P0!=_P, +ellipse(#ind,_P[0],_P[1],_radius,_radius,0,_opacity,_ds_color); +); +_P0 = _P; +); +nan; +); +triangle(ind,P0,P1,P2,opacity,color0,color1,color2) = ( +unref(_dt_color); +unref(_dt_color0); +unref(_dt_color1); +unref(_dt_color2); +_opacity = opacity; +_dt_color0 = resize(color0,s#ind); +_dt_color1 = resize(color1,s#ind); +_dt_color2 = resize(color2,s#ind); +_A = round(P0); +_B = round(P1); +_C = round(P2); +_xmin = max(0,min(_A[0],_B[0],_C[0])); +_xmax = min(w#ind-1,max(_A[0],_B[0],_C[0])); +_ymin = max(0,min(_A[1],_B[1],_C[1])); +_ymax = min(h#ind-1,max(_A[1],_B[1],_C[1])); +_M = transpose([_A,1,_B,1,_C,1],3); +for (_y = _ymin, _y<_ymax, ++_y, +for (_x = _xmin, _x<_xmax, ++_x, +_L = round(solve(_M,[_x,_y,1]),1e-5); +if (min(_L)>=0, +_dt_color = _L[0]*_dt_color0 + _L[1]*_dt_color1 + _L[2]*_dt_color2; +copy(i(#ind,_x,_y,0,0),_dt_color,size(_dt_color),whd#ind,1,_opacity); +); +); +); +nan; +); +line_aa_plot(ind,x,y,o) = ( +_line_aa_o = o*line_aa_opacity; +(I(#ind,x,y)*=1 - _line_aa_o)+=line_aa_color*_line_aa_o; +); +line_aa_fpart(x) = (x - floor(x)); +line_aa_rfpart(x) = (1 - line_aa_fpart(x)); +line_aa(x0,y0,x1,y1,opacity,color) = line_aa(#-1,#x0,#y0,#x1,#y1,opacity,color); +line_aa(ind,x0,y0,x1,y1,opacity,color) = ( +line_aa_x0 = x0; line_aa_y0 = y0; +line_aa_x1 = x1; line_aa_y1 = y1; +line_aa_color = color; +line_aa_opacity = opacity; +line_aa_steep = abs(line_aa_y1 - line_aa_y0)>abs(line_aa_x1 - line_aa_x0); +line_aa_steep?(swap(line_aa_x0, line_aa_y0); swap(line_aa_x1, line_aa_y1)); +line_aa_x0>line_aa_x1?(swap(line_aa_x0, line_aa_x1); swap(line_aa_y0, line_aa_y1)); +line_aa_dx = line_aa_x1 - line_aa_x0; +line_aa_dy = line_aa_y1 - line_aa_y0; +line_aa_gradient = line_aa_dx?line_aa_dy/line_aa_dx;1; +line_aa_xend = round(line_aa_x0); +line_aa_yend = line_aa_y0 + line_aa_gradient*(line_aa_xend - line_aa_x0); +line_aa_xgap = line_aa_rfpart(line_aa_x0 + 0.5); +line_aa_xpxl1 = line_aa_xend; +line_aa_ypxl1 = floor(line_aa_yend); +line_aa_steep?( +line_aa_plot(#ind,line_aa_ypxl1,line_aa_xpxl1,line_aa_rfpart(line_aa_yend)*line_aa_xgap); +line_aa_plot(#ind,line_aa_ypxl1 + 1,line_aa_xpxl1,line_aa_fpart(line_aa_yend)*line_aa_xgap); +):( +line_aa_plot(#ind,line_aa_xpxl1,line_aa_ypxl1,line_aa_rfpart(line_aa_yend)*line_aa_xgap); +line_aa_plot(#ind,line_aa_xpxl1,line_aa_ypxl1 + 1,line_aa_fpart(line_aa_yend)*line_aa_xgap); +); +line_aa_intery = line_aa_yend + line_aa_gradient; +line_aa_xend = round(line_aa_x1); +line_aa_yend = line_aa_y1 + line_aa_gradient*(line_aa_xend - line_aa_x1); +line_aa_xgap = line_aa_fpart(line_aa_x1 + 0.5); +line_aa_xpxl2 = line_aa_xend; +line_aa_ypxl2 = floor(line_aa_yend); +line_aa_steep?( +line_aa_plot(#ind,line_aa_ypxl2,line_aa_xpxl2,line_aa_rfpart(line_aa_yend)*line_aa_xgap); +line_aa_plot(#ind,line_aa_ypxl2 + 1,line_aa_xpxl2,line_aa_fpart(line_aa_yend)*line_aa_xgap); +):( +line_aa_plot(#ind,line_aa_xpxl2,line_aa_ypxl2,line_aa_rfpart(line_aa_yend)*line_aa_xgap); +line_aa_plot(#ind,line_aa_xpxl2,line_aa_ypxl2 + 1,line_aa_fpart(line_aa_yend)*line_aa_xgap); +); +line_aa_steep?( +for (line_aa_x = line_aa_xpxl1 + 1, line_aa_x<=line_aa_xpxl2 - 1, ++line_aa_x, +line_aa_plot(#ind,floor(line_aa_intery),line_aa_x,line_aa_rfpart(line_aa_intery)); +line_aa_plot(#ind,floor(line_aa_intery) + 1,line_aa_x,line_aa_fpart(line_aa_intery)); +line_aa_intery+=line_aa_gradient; +); +):( +for (line_aa_x = line_aa_xpxl1 + 1, line_aa_x<=line_aa_xpxl2 - 1, ++line_aa_x, +line_aa_plot(#ind,line_aa_x,floor(line_aa_intery),line_aa_rfpart(line_aa_intery)); +line_aa_plot(#ind,line_aa_x,floor(line_aa_intery) + 1,line_aa_fpart(line_aa_intery)); +line_aa_intery+=line_aa_gradient; +); +); +); +hsv2rgb(I...) = ( +ref([I],_I); +_I[0]%=360; +_I[1] = cut(_I[1],0,1); +_I[2] = cut(_I[2],0,1); +_c = _I[2]*_I[1]; +_x = _c*(1-abs((_I[0]/60)%2-1)); +(arg(1 + int(_I[0]/60),[_c,_x,0],[_x,_c,0],[0,_c,_x],[0,_x,_c],[_x,0,_c],[_c,0,_x])+=_I[2] - _c)*=255; +); +rgb2hsv(I...) = ( +ref([I],_I); +_M = max(_I); +_C = _M - min(_I); +[ 60*(_C==0?0:_M==_I[0]?((_I[1] - _I[2])/_C)%6:_M==_I[1]?(_I[2] - _I[0])/_C + 2:(_I[0] - _I[1])/_C + 4), +_M<=0?0:_C/_M, _M/255 ]; +); +is_intriangle(P,A,B,C) = ( +_v0 = C - A; +_v1 = B - A; +_v2 = P - A; +_dot00 = dot(_v0,_v0); +_dot01 = dot(_v0,_v1); +_dot02 = dot(_v0,_v2); +_dot11 = dot(_v1,_v1); +_dot12 = dot(_v1,_v2); +_invDenom = 1/(_dot00*_dot11 - _dot01*_dot01); +_u = (_dot11*_dot02 - _dot01*_dot12)*_invDenom; +_v = (_dot00*_dot12 - _dot01*_dot02)*_invDenom; +_u>=0 && _v>=0 && _u + _v<1); +is_inquadrilateral(P,A,B,C,D) = ( +is_intriangle(P,A,B,D) || is_intriangle(P,B,C,D); +); +do_intersect(p0x,p0y,p1x,p1y,q0x,q0y,q1x,q1y) = ( +_o1 = _doi_orientation(p0x,p0y,p1x,p1y,q0x,q0y); +_o2 = _doi_orientation(p0x,p0y,p1x,p1y,q1x,q1y); +_o3 = _doi_orientation(q0x,q0y,q1x,q1y,p0x,p0y); +_o4 = _doi_orientation(q0x,q0y,q1x,q1y,p1x,p1y); +(_o1!=_o2 && _o3!=_o4) || +(!_o1 && _doi_on_segment(p0x,p0y,q0x,q0y,p1x,p1y)) || +(!_o2 && _doi_on_segment(p0x,p0y,q1x,q1y,p1x,p1y)) || +(!_o3 && _doi_on_segment(q0x,q0y,p0x,p0y,q1x,q1y)) || +(!_o4 && _doi_on_segment(q0x,q0y,p1x,p1y,q1x,q1y)) +); +_doi_on_segment(px,py,qx,qy,rx,ry) = ( +inrange(qx,min(px,rx),max(px,rx)) && inrange(qy,min(py,ry),max(py,ry)); +); +_doi_orientation(px,py,qx,qy,rx,ry) = ( +_doi_orientation_val = (qy - py)*(rx - qx) - (qx - px)*(ry - qy); +_doi_orientation_val==0?0:_doi_orientation_val>0?1:2; +); +is_percent(str) = (unref(_is_pct); _is_pct=['#str']; _is_pct[size(_is_pct) - 1]==_'%'); +length_spline(P0,T0,P1,T1) = ( +_P0 = P0; +_P1 = P1; +_C = mul([ 2,-2,1,1,-3,3,-2,-1,0,0,1,0,1,0,0,0 ],[ _P0,_P1,T0,T1 ],2); +_l = norm(_P1 - _P0); +if (_l, +_nl = _l + 1; +_dt = 1/_l; +while (_nl - _l>=0.01, +_l = _nl; +_nl = 0; +__P0 = _P0; +for (_t = 0, _t<=1, _t+=_dt, +__P = mul([_t^3,_t^2,_t,1],_C,2); +_nl+=norm(__P - __P0); +__P0 = __P; +); +_dt = 1/max(1,_nl); +); +); +_l +); +pexp(x) = ( +_pexp_x = abs(x); +_pexp_x<2?-0.110353*_pexp_x^4 + 0.683221*_pexp_x^3 -1.17282*_pexp_x^2 + 1:0 +); +proj(X,A,B) = ( +_AB = B - A; +P = A + dot(X - A,_AB)/max(1e-8,dot(_AB,_AB))*_AB; +); +deltaE00(lab1,lab2) = ( +_deltaE00_deg2rad(deg) = (deg*pi/180); +unref(_deltaE00_lab1); _deltaE00_lab1 = lab1; +unref(_deltaE00_lab2); _deltaE00_lab2 = lab2; +unref(_deltaE00_k_L); const _deltaE00_k_L = 1; +unref(_deltaE00_k_C); const _deltaE00_k_C = 1; +unref(_deltaE00_k_H); const _deltaE00_k_H = 1; +unref(_deltaE00_deg360inrad); const _deltaE00_deg360inrad = _deltaE00_deg2rad(360); +unref(_deltaE00_deg180inrad); const _deltaE00_deg180inrad = _deltaE00_deg2rad(180); +unref(_deltaE00_pow25to7); const _deltaE00_pow25to7 = 25^7; +_deltaE00_C1 = norm(_deltaE00_lab1[1,2]); +_deltaE00_C2 = norm(_deltaE00_lab2[1,2]); +_deltaE00_barC = (_deltaE00_C1 + _deltaE00_C2)/2; +_deltaE00_G = 0.5*(1 - sqrt(_deltaE00_barC^7/(_deltaE00_barC^7 + _deltaE00_pow25to7))); +_deltaE00_a1prime = (1 + _deltaE00_G)*_deltaE00_lab1[1]; +_deltaE00_a2prime = (1 + _deltaE00_G)*_deltaE00_lab2[1]; +_deltaE00_Cprime1 = norm(_deltaE00_a1prime,_deltaE00_lab1[2]); +_deltaE00_Cprime2 = norm(_deltaE00_a2prime,_deltaE00_lab2[2]); +_deltaE00_lab1[2]==0 && _deltaE00_a1prime==0?( +_deltaE00_hprime1 = 0; +):( +_deltaE00_hprime1 = atan2(_deltaE00_lab1[2],_deltaE00_a1prime); +_deltaE00_hprime1<0?(_deltaE00_hprime1+=_deltaE00_deg360inrad); +_deltaE00_lab2[2]==0 && _deltaE00_a2prime==0?( +_deltaE00_hprime2 = 0; +):( +_deltaE00_hprime2 = atan2(_deltaE00_lab2[2],_deltaE00_a2prime); +_deltaE00_hprime2<0?(_deltaE00_hprime2+=_deltaE00_deg360inrad); +); +); +_deltaE00_deltaLprime = _deltaE00_lab2[0] - _deltaE00_lab1[0]; +_deltaE00_deltaCprime = _deltaE00_Cprime2 - _deltaE00_Cprime1; +_deltaE00_CprimeProduct = _deltaE00_Cprime1*_deltaE00_Cprime2; +_deltaE00_CprimeProduct==0?( +_deltaE00_deltahprime = 0; +):( +_deltaE00_deltahprime = _deltaE00_hprime2 - _deltaE00_hprime1; +_deltaE00_deltahprime<-_deltaE00_deg180inrad?( +_deltaE00_deltahprime += _deltaE00_deg360inrad; +):_deltaE00_deltahprime>_deltaE00_deg180inrad?( +_deltaE00_deltahprime -= _deltaE00_deg360inrad; +); +); +_deltaE00_deltaHprime = 2*sqrt(_deltaE00_CprimeProduct)*sin(_deltaE00_deltahprime/2); +_deltaE00_barLprime = (_deltaE00_lab1[0] + _deltaE00_lab2[0])/2; +_deltaE00_barCprime = (_deltaE00_Cprime1 + _deltaE00_Cprime2)/2; +_deltaE00_hprimeSum = _deltaE00_hprime1 + _deltaE00_hprime2; +_deltaE00_Cprime1*_deltaE00_Cprime2==0?( +_deltaE00_barhprime = _deltaE00_hprimeSum; +):( +abs(_deltaE00_hprime1 - _deltaE00_hprime2)<=_deltaE00_deg180inrad?( +_deltaE00_barhprime = _deltaE00_hprimeSum/2; +):( +_deltaE00_hprimeSum<_deltaE00_deg360inrad?( +_deltaE00_barhprime = (_deltaE00_hprimeSum + _deltaE00_deg360inrad)/2; +):( +_deltaE00_barhprime = (_deltaE00_hprimeSum - _deltaE00_deg360inrad)/2; +); +); +); +_deltaE00_T = 1.0 - (0.17*cos(_deltaE00_barhprime - _deltaE00_deg2rad(30))) + +(0.24*cos(2*_deltaE00_barhprime)) + +(0.32*cos(3*_deltaE00_barhprime + _deltaE00_deg2rad(6))) - +(0.2*cos(4*_deltaE00_barhprime - _deltaE00_deg2rad(63))); +_deltaE00_deltaTheta = _deltaE00_deg2rad(30)* +exp(-((_deltaE00_barhprime - _deltaE00_deg2rad(275)) / _deltaE00_deg2rad(25))^2); +_deltaE00_R_C = 2*sqrt(_deltaE00_barCprime^7/(_deltaE00_barCprime^7 + _deltaE00_pow25to7)); +_deltaE00_S_L = 1 + 0.015*(_deltaE00_barLprime - 50)^2/sqrt(20 + (_deltaE00_barLprime - 50)^2); +_deltaE00_S_C = 1 + 0.045*_deltaE00_barCprime; +_deltaE00_S_H = 1 + 0.015*_deltaE00_barCprime*_deltaE00_T; +_deltaE00_R_T = -sin(2*_deltaE00_deltaTheta)* _deltaE00_R_C; +sqrt((_deltaE00_deltaLprime/(_deltaE00_k_L*_deltaE00_S_L))^2 + +(_deltaE00_deltaCprime/(_deltaE00_k_C*_deltaE00_S_C))^2 + +(_deltaE00_deltaHprime/(_deltaE00_k_H*_deltaE00_S_H))^2 + +_deltaE00_R_T*_deltaE00_deltaCprime/(_deltaE00_k_C*_deltaE00_S_C)* +_deltaE00_deltaHprime/(_deltaE00_k_H*_deltaE00_S_H)); +); +_next_edgel4(k,P,op) = ( +ref(P#[0],_u); ref(P#[1],_v); +P#[2]==0?(i(#k,_u,_nv = _v + 1,0,0)#op?[ _u,_v,1 ]:i(#k,_nu = _u + 1,_nv,0,0)#op?[ _u,_nv,0 ]:[ _nu,_nv,3 ]): +P#[2]==1?(i(#k,_pu = _u - 1,_v,0,0)#op?[ _u,_v,2 ]:i(#k,_pu,_nv = _v + 1,0,0)#op?[ _pu,_v,1 ]:[ _pu,_nv,0 ]): +P#[2]==2?(i(#k,_u,_pv = _v - 1,0,0)#op?[ _u,_v,3 ]:i(#k,_pu = _u - 1,_pv,0,0)#op?[ _u,_pv,2 ]:[ _pu,_pv,1 ]): +(i(#k,_nu = _u + 1,_v,0,0)#op?[ _u,_v,0 ]:i(#k,_nu,_pv = _v - 1,0,0)#op?[ _nu,_v,3 ]:[ _nu,_pv,2 ]); +); +next_edgel4_fg(k,P,fg) = _next_edgel4(#k,#P,!=fg); # Next edgel, 4-connexity (foreground value specified) +next_edgel4_bg(k,P,bg) = _next_edgel4(#k,#P,==bg); # Next edgel, 4-connexity (background value specified) +_previous_edgel4(k,P,op) = ( +ref(P#[0],_u); ref(P#[1],_v); +P#[2]==0?(i(#k,_u,_pv = _v - 1,0,0)#op?[ _u,_v,3 ]:i(#k,_nu = _u + 1,_pv,0,0)#op?[ _u,_pv,0 ]:[ _nu,_pv,1 ]): +P#[2]==1?(i(#k,_nu = _u + 1,_v,0,0)#op?[ _u,_v,0 ]:i(#k,_nu,_nv = _v + 1,0,0)#op?[ _nu,_v,1 ]:[ _nu,_nv,2 ]): +P#[2]==2?(i(#k,_u,_nv = _v + 1,0,0)#op?[ _u,_v,1 ]:i(#k,_pu = _u - 1,_nv,0,0)#op?[ _u,_nv,2 ]:[ _pu,_nv,3 ]): +(i(#k,_pu = _u - 1,_v,0,0)#op?[ _u,_v,2 ]:i(#k,_pu,_pv = _v - 1,0,0)#op?[ _pu,_v,3 ]:[ _pu,_pv,0 ]); +); +previous_edgel4_fg(k,P,fg) = _previous_edgel4(#k,#P,!=fg); # Previous edgel, 4-connexity (foreground value specified) +previous_edgel4_bg(k,P,bg) = _previous_edgel4(#k,#P,==bg); # Previous edgel, 4-connexity (background value specified) +_next_edgel8(k,P,op) = ( +ref(P#[0],_u); ref(P#[1],_v); +P#[2]==0?(i(#k,_nu = _u + 1,_nv = _v + 1,0,0)#op?[ _nu,_nv,3 ]:i(#k,_u,_nv,0,0)#op?[ _u,_nv,0 ]:[ _u,_v,1 ]): +P#[2]==1?(i(#k,_pu = _u - 1,_nv = _v + 1,0,0)#op?[ _pu,_nv,0 ]:i(#k,_pu,_v,0,0)#op?[ _pu,_v,1 ]:[ _u,_v,2 ]): +P#[2]==2?(i(#k,_pu = _u - 1,_pv = _v - 1,0,0)#op?[ _pu,_pv,1 ]:i(#k,_u,_pv,0,0)#op?[ _u,_pv,2 ]:[ _u,_v,3 ]): +(i(#k,_nu = _u + 1,_pv = _v - 1,0,0)#op?[ _nu,_pv,2 ]:i(#k,_nu,_v,0,0)#op?[ _nu,_v,3 ]:[ _u,_v,0 ]); +); +next_edgel8_fg(k,P,fg) = _next_edgel8(#k,#P,==fg); # Next edgel, 8-connexity (foreground value specified) +next_edgel8_bg(k,P,bg) = _next_edgel8(#k,#P,!=bg); # Next edgel, 8-connexity (background value specified) +_previous_edgel8(k,P,op) = ( +ref(P#[0],_u); ref(P#[1],_v); +P#[2]==0?(i(#k,_nu = _u + 1,_pv = _v - 1,0,0)#op?[ _nu,_pv,1 ]:i(#k,_u,_pv,0,0)#op?[ _u,_pv,0 ]:[ _u,_v,3 ]): +P#[2]==1?(i(#k,_nu = _u + 1,_nv = _v + 1,0,0)#op?[ _nu,_nv,2 ]:i(#k,_nu,_v,0,0)#op?[ _nu,_v,1 ]:[ _u,_v,0 ]): +P#[2]==2?(i(#k,_pu = _u - 1,_nv = _v + 1,0,0)#op?[ _pu,_nv,3 ]:i(#k,_u,_nv,0,0)#op?[ _u,_nv,2 ]:[ _u,_v,1 ]): +(i(#k,_pu = _u - 1,_pv = _v - 1,0,0)#op?[ _pu,_pv,0 ]:i(#k,_pu,_v,0,0)#op?[ _pu,_v,3 ]:[ _u,_v,2 ]); +); +previous_edgel8_fg(k,P,fg) = _previous_edgel8(#k,#P,==fg); # Previous edgel, 8-connexity (foreground value specified) +previous_edgel8_bg(k,P,bg) = _previous_edgel8(#k,#P,!=bg); # Previous edgel, 8-connexity (background value specified) +" +#@cli mad +#@cli : Return the MAD (Maximum Absolute Deviation) of the last selected image. +#@cli : The MAD is defined as MAD = med_i|x_i-med_j(x_j)| +mad : +if $! +-. {ic} abs. u {1.4826*ic} rm. else u 0 fi +#@cli max_w +#@cli : Return the maximal width between selected images. +max_w : +_minmax_whds max,0,1 +#@cli max_h +#@cli : Return the maximal height between selected images. +max_h : +_minmax_whds max,1,1 +#@cli max_d +#@cli : Return the maximal depth between selected images. +max_d : +_minmax_whds max,2,1 +#@cli max_s +#@cli : Return the maximal spectrum between selected images. +max_s : +_minmax_whds max,3,1 +#@cli max_wh +#@cli : Return the maximal wxh size of selected images. +max_wh : +_minmax_whds max,0,2 +#@cli max_whd +#@cli : Return the maximal wxhxd size of selected images. +max_whd : +_minmax_whds max,0,3 +#@cli max_whds +#@cli : Return the maximal wxhxdxs size of selected images. +max_whds : +_minmax_whds max,0,4 +#@cli median_vectors +#@cli : Return the median vector value of the last selected image (median computed channel by channel) +median_vectors : +u {"expr('med(crop(#-1,0,0,0,y,w#-1,h#-1,d#-1,1))',1,s#-1)"} +#@cli min_w +#@cli : Return the minimal width between selected images. +min_w : +_minmax_whds min,0,1 +#@cli min_h +#@cli : Return the minimal height between selected images. +min_h : +_minmax_whds min,1,1 +#@cli min_d +#@cli : Return the minimal depth between selected images. +min_d : +_minmax_whds min,2,1 +#@cli min_s +#@cli : Return the minimal s size of selected images. +min_s : +_minmax_whds min,3,1 +#@cli min_wh +#@cli : Return the minimal wxh size of selected images. +min_wh : +_minmax_whds min,0,2 +#@cli min_whd +#@cli : Return the minimal wxhxd size of selected images. +min_whd : +_minmax_whds min,0,3 +#@cli min_whds +#@cli : Return the minimal wxhxdxs size of selected images. +min_whds : +_minmax_whds min,0,4 +_minmax_whds : +u {" +mw = w; mh = h; md = d; ms = s; +repeat (l,k, +mw = $1(mw,w#k); +mh = $1(mh,h#k); +md = $1(md,d#k); +ms = $1(ms,s#k); +); +([mw,mh,md,ms])[$2,$3]"} +#@cli name2color : name +#@cli : Return the R,G,B color that matches the specified color name. +name2color : +strvar "$1" name=${} +_color2name +names={`"s = ['"{n}"']; m = !(s-_'~')*(_'_'-_'~'); s+=m; lowercase(s)"`} +l. { +s x => $names u {$name,^} rm +onfail rm error[0--3] "Command 'name2color': Unknown color '$1'." +} +#@cli nmd : eq. to 'named' : (+) +#@cli named : _mode,"name1","name2",... : (+) +#@cli : Return the set of indices corresponding to images of the selection with specified names. +#@cli : After this command returns, the status contains a list of indices (unsigned integers), +#@cli : separated by commas (or an empty string if no images with those names have been found). +#@cli : (eq. to 'nmd'). +#@cli : 'mode' can be { 0=all indices (default) | 1=lowest index | 2=highest index | 3 = all indices (case insensitive) | 4 = lowest index (case insensitive) | 5 = highest index (case insensitive)} +#@cli narg : arg1,arg2,...,argN +#@cli : Return number of specified arguments. +narg : +u $# +#@cli normalize_filename : filename +#@cli : Return a "normalized" version of the specified filename, without spaces and capital letters. +normalize_filename : +('"$1"') f. 'if(i>=65&&i<=90,i+32,if(i==32,95,i))' u {t} rm. +#@cli oct : octal_int1,... +#@cli : Print specified octal integers into their binary, decimal, hexadecimal and string representations. +oct : +dec=${oct2dec\ ${^0}} +e[^-1] "Convert octal integer"${arg0\ ($#>1),"",s}" '${^0}' to binary '"${dec2bin\ $dec}"', decimal '"$dec"', +hexadecimal '"${dec2hex\ $dec}"' and string '"${dec2str\ $dec}"'." +#@cli oct2dec : octal_int1,... +#@cli : Convert specified octal integers into their decimal representations. +oct2dec : +$=arg res,sep= repeat $# { res=$res$sep${_$0\ ${arg{$>+1}}} sep=, } u $res +_oct2dec : +u {"str = v2s(abs($1)); +for (k = val = 0, str[k], ++k, +c = str[k]; +(val<<=3)+=(c>=_'0' && c<=_'7'?c - _'0':nan); +isnan(val)?break() +); sign($1)*val"} +ovh2stats : skip "${1=gmic.eu-*-*-*.log.gz}" +e[^-1] "Generate statistics on the usage of G'MIC-Qt from OVH server logfiles '$1'." +use_vt100 +files "$1" files=${} +e "* Load log files." +if !narg(${}) error[0--2] "No OVH logfiles matching name '$1' have been found." fi +repeat narg(${}) { +arg0 $>,$files file=${} +day,month,year={"str = ['"$file"']; +t1 = find(str,_'-') + 1; +t2 = find(str,_'-',t1) + 1; +t3 = find(str,_'-',t2) + 1; +t1>0 && t2>t1 && t3>t2?( +day = s2v(str,t1); +month = s2v(str,t2); +year = s2v(str,t3); +[ day,month,year ]; +):[0,0,0]"} +if !$day&&!$month&&!$year day,month,year=n.a fi +e " > "$year/$month/$day:" "$_vt100_g$file$_vt100_n +it $file +=> ${year}_${month}_${day} +} +foreach { +nm={n} +s -,{'\n'} +eval " +str = ['G'MIC-Qt']; +to_keep = vectorl(); +p = 0; +repeat (l,k, find(#k,str)>=0?(to_keep[p++] = k)); +store('to_keep',to_keep,p); +run('$to_keep k[{^}]')" +if $!>1 i[1--2] ('\n') fi +a y => $nm +} +e "\n* Analyze log files (day by day)." ++_ovh2stats +e "\n* Analyze log files (all days)." +a y _ovh2stats +_ovh2stats : +v + N=$! +foreach { +('{n}') replace. {'_'},{'^'} ({t}) +date={`[v2s(i0,0,4),_'/',i1<10?[_'0',i1+_'0']:v2s(i1,0,2),_'/',i2<10?[_'0',i2+_'0']:v2s(i2,0,2)]`} +s -,{'\n'} +eval " +name = vector256(); +repeat (l,k, +p = find(#k,_' '); +copy(name,i[#k,0],p); +name[p] = 0; +run('name[',k,'] ',name); +)" +eval " +const N = "$!"; +ref(vector(#2*N),tab); +repeat (N,k, +ref(name(#k,256),nam); +for (i = j = 0, i=0?++gimp: +find(str,'krita')>=0?++krita: +find(str,'8bf')>=0?++_8bf: +find(str,'paint.net')>=0?++paintdotnet: +find(str,'digikam')>=0?++digikam: +++standalone; +find(str,'windows')>=0?++windows: +find(str,'linux')>=0?++linux: +find(str,'mac os')>=0?++macos: +find(str,'bsd')>=0?++bsd: +++unknown; +(eos = find(str,0))<0?(eos = size(str)); +space = find(str,_' ',eos,-1); +ver = sum(([ str[space + 1],str[space + 3],str[space + 5] ] - _'0')*[ 100,10,1 ]); +++versions[ver]; +find(str,'_pre#')>=0?++prereleases; +++ips; +); +store('features', +[ips,gimp,krita,_8bf,paintdotnet,digikam,standalone,windows,linux,macos,bsd,unknown,prereleases]); +store('versions',versions)" +rm $features +ips,gimp,krita,_8bf,paintdotnet,digikam,standalone,windows,linux,macos,bsd,unknown,prereleases={^} +$versions +a y +if $N>1 +e " > "$date": "${_vt100_b}"Unique IPs"${_vt100_n}" = "$ips" (100%)," +e " "${_vt100_m}${_vt100_b}"GIMP"${_vt100_n}" = "$gimp" ("{_round($gimp/$ips*100,0.1)}"%), "${_vt100_c}${_vt100_b}"Krita"${_vt100_n}" = "$krita" ("{_round($krita/$ips*100,0.1)}"%), "${_vt100_g}${_vt100_b}"8bf"${_vt100_n}" = "$_8bf" ("{_round($_8bf/$ips*100,0.1)}"%), "${_vt100_r}${_vt100_b}"Paint.NET"${_vt100_n}" = "$paintdotnet" ("{_round($paintdotnet/$ips*100,0.1)}"%), "${_vt100_m}${_vt100_b}"Digikam"${_vt100_n}" = "$digikam" ("{_round($digikam/$ips*100,0.1)}"%), "${_vt100_c}${_vt100_b}"Standalone"${_vt100_n}" = "$standalone" ("{_round($standalone/$ips*100,0.1)}"%)." +e " "${_vt100_r}${_vt100_b}"Windows"${_vt100_n}" = "$windows" ("{_round($windows/$ips*100,0.1)}"%), "${_vt100_g}${_vt100_b}"Linux"${_vt100_n}" = "$linux" ("{_round($linux/$ips*100,0.1)}"%), "${_vt100_m}${_vt100_b}"Mac OS"${_vt100_n}" = "$macos" ("{_round($macos/$ips*100,0.1)}"%), "${_vt100_c}${_vt100_b}"BSD"${_vt100_n}" = "$bsd" ("{_round($bsd/$ips*100,0.1)}"%), "${_vt100_c}${_vt100_b}"Unknown"${_vt100_n}" = "$unknown" ("{_round($unknown/$ips*100,0.1)}"%)." +e " "${_vt100_b}"Prereleases"${_vt100_n}" = "$prereleases" ("{_round($prereleases/$ips*100,0.1)}"%)." +_ovh2stats_versions +fi +} ++ / $N round. ++z. 0,0,12,0 ips,gimp,krita,_8bf,paintdotnet,digikam,standalone,windows,linux,macos,bsd,unknown,prereleases={^} rm. +summary0,summary1="Total: ","Average: " +e " > "${summary{$N>1}}${_vt100_b}"Unique IPs"${_vt100_n}" = "$ips" (100%)," +e " "${_vt100_m}${_vt100_b}"GIMP"${_vt100_n}" = "$gimp" ("{_round($gimp/$ips*100,0.1)}"%), "${_vt100_c}${_vt100_b}"Krita"${_vt100_n}" = "$krita" ("{_round($krita/$ips*100,0.1)}"%), "${_vt100_g}${_vt100_b}"8bf"${_vt100_n}" = "$_8bf" ("{_round($_8bf/$ips*100,0.1)}"%), "${_vt100_r}${_vt100_b}"Paint.NET"${_vt100_n}" = "$paintdotnet" ("{_round($paintdotnet/$ips*100,0.1)}"%), "${_vt100_m}${_vt100_b}"Digikam"${_vt100_n}" = "$digikam" ("{_round($digikam/$ips*100,0.1)}"%), "${_vt100_c}${_vt100_b}"Standalone"${_vt100_n}" = "$standalone" ("{_round($standalone/$ips*100,0.1)}"%)." +e " "${_vt100_r}${_vt100_b}"Windows"${_vt100_n}" = "$windows" ("{_round($windows/$ips*100,0.1)}"%), "${_vt100_g}${_vt100_b}"Linux"${_vt100_n}" = "$linux" ("{_round($linux/$ips*100,0.1)}"%), "${_vt100_m}${_vt100_b}"Mac OS"${_vt100_n}" = "$macos" ("{_round($macos/$ips*100,0.1)}"%), "${_vt100_c}${_vt100_b}"BSD"${_vt100_n}" = "$bsd" ("{_round($bsd/$ips*100,0.1)}"%), "${_vt100_c}${_vt100_b}"Unknown"${_vt100_n}" = "$unknown" ("{_round($unknown/$ips*100,0.1)}"%)." +e " "${_vt100_b}"Prereleases"${_vt100_n}" = "$prereleases" ("{_round($prereleases/$ips*100,0.1)}"%)." +_ovh2stats_versions +rm +_ovh2stats_versions : +v + +rows. 100% +l. { +ips={is} ++f x a y sort -,x eo0={min(9,find(crop(),0))} +if $eo0 +str= v=0 c= +for i($v,0)>0" && "$v<9 { +str.=$c${_vt100_b}{i($v,1)}${_vt100_n}" ("{i($v,0)}": "{_round(i($v,0)/$ips*100,0.1)}"%)" +v+=1 c=", " +} +e " "${_vt100_c}${_vt100_b}"Version"${_vt100_n}" = "$str".\n" +fi +rm +} +#@cli padint : number,_size>0 +#@cli : Return a integer with 'size' digits (eventually left-padded with '0'). +padint : check "isint($1)" skip ${2=4} +u "" repeat $2 { u ${}{int($1/10^$<)%10} } +#@cli path_cache +#@cli : Return a path to store G'MIC data files for one user (whose value is OS-dependent). +path_cache : +if !narg({'$_path_cache'}) +_path_cache=$_path_rc +if ['$GMIC_CACHE_PATH']!=0 _patch_cache=$GMIC_CACHE_PATH +elif !${-is_windows} +if isdir(['{/$HOME/.cache}']) _path_cache=$HOME/.cache/gmic/ +elif ['$XDG_CACHE_HOME']!=0 _path_cache=$XDG_CACHE_HOME/gmic/ +fi +if !isdir('{/$_path_cache}') x "mkdir -p "$_path_cache fi +fi +fi +u $_path_cache +#@cli path_current +#@cli : Return current folder from where G'MIC has been run. +path_current : +if !${-is_windows} +filename=${-path_tmp}gmic_pwd +l[] { x "pwd > "$filename it $filename autocrop {'\n'} autocrop {'" "'} u {t}/ rm onfail u "./" } +else u "./" +fi +#@cli path_gimp +#@cli : Return a path to store GIMP configuration files for one user (whose value is OS-dependent). +path_gimp : +if !narg({'$_path_gimp'}) +if narg({'${GIMP2_DIRECTORY}'}) _path_gimp=${GIMP2_DIRECTORY} +elif narg({'${USERPROFILE}'}) _path_gimp=${USERPROFILE} +elif narg({'${HOME}'}) _path_gimp=${HOME} +fi +if ${-is_windows} sep={`92`} else sep=/ fi +if isdir(['{/$_path_gimp${sep}AppData${sep}Roaming${sep}GIMP${sep}2.10}']) +_path_gimp=$_path_gimp${sep}AppData${sep}Roaming${sep}GIMP${sep}2.10${sep} +elif isdir(['{/$_path_gimp${sep}AppData${sep}Roaming${sep}GIMP${sep}2.8}']) +_path_gimp=$_path_gimp${sep}AppData${sep}Roaming${sep}GIMP${sep}2.8${sep} +elif isdir(['{/$_path_gimp${sep}.config${sep}GIMP${sep}2.10}']) +_path_gimp=$_path_gimp${sep}.config${sep}GIMP${sep}2.10${sep} +elif isdir(['{/$_path_gimp${sep}.gimp-2.8}']) +_path_gimp=$_path_gimp${sep}.gimp-2.8${sep} +elif isdir(['{/$_path_gimp${sep}.gimp-2.6}']) +_path_gimp=$_path_gimp${sep}.gimp-2.6${sep} +else +_path_gimp=${-path_tmp} +fi +fi +u $_path_gimp +#@cli path_tmp +#@cli : Return a path to store temporary files (whose value is OS-dependent). +path_tmp : +if !narg({'$_path_tmp'}) +if narg({'${TMP}'}) _path_tmp=${TMP} +elif narg({'${TEMP}'}) _path_tmp=${TEMP} +elif narg({'${TMPDIR}'}) _path_tmp=${TMPDIR} +elif narg({'${HOME}'}) _path_tmp="/tmp" +fi +if ${-is_windows} _path_tmp=$_path_tmp{`92`} else _path_tmp=$_path_tmp/ fi +fi +u $_path_tmp +#@cli remove_copymark +#@cli : Remove copymark suffix in names of selected images. +remove_copymark : +foreach { +=> {`" +nm = ['"{n}'"]; +const siz = size(nm); +i = find(nm,'_c',siz - 1,-1); +inrange(i,0,siz - 3) && inrange(nm[i + 2],_'1',_'9')?( +ext = ['"{x}"']; +size(ext)?copy(nm[i],[_'.',ext,0]):(nm[i] = 0); +); nm;"`} +} +render_donations : skip "${1="$HOME"/work/src/private_tschumperle/gmic_donations.csv}",${2=0} +use_vt100 +nb_months={$2?$2:4} +l[] { +"$1" +eur2usd={1/0.873824} +nb_entries={h} +repeat $nb_entries { e=$> +date_$e={`I(0,$e)`} +name_$e={`I(1,$e)`} +type_$e={`I(2,$e)`} +currency_$e={`lowercase(I(3,$e))`} +donation_$e={{`I(4,$e)`}} +charge_paypal_$e={{`I(5,$e)`}} +charge_lila_$e={{`I(6,$e)`}} +mail_$e={`I(7,$e)`} +message_$e={`I(8,$e)`} +l[] { +('${date_$e}') s -,{'/'} day_$e,month_$e,year_$e={0,t},{1,t},{2,t} rm +edate_$e={${day_$e}+100*(${month_$e}+100*${year_$e})} +} +donation_charged_$e={${donation_$e}+${charge_paypal_$e}+${charge_lila_$e}} +if '${currency_$e}'=='eur' +donation_eur_$e=${donation_$e} +donation_charged_eur_$e=${donation_charged_$e} +donation_usd_$e={${donation_$e}*$eur2usd} +donation_charged_usd_$e={${donation_charged_$e}*$eur2usd} +else +donation_usd_$e=${donation_$e} +donation_charged_usd_$e=${donation_charged_$e} +donation_eur_$e={${donation_$e}/$eur2usd} +donation_charged_eur_$e={${donation_charged_$e}/$eur2usd} +fi +if ${donation_$e}>=10 col=$_vt100_r else col= fi +e "- ["$_vt100_c$_vt100_b"#"$e$_vt100_n" - "$_vt100_c${date_$e}$_vt100_n"] "$col$_vt100_b{_${donation_$e}}" "${currency_$e}$_vt100_n" (paypal: "{_${charge_paypal_$e}}" "${currency_$e}," lila: "{_${charge_lila_$e}}" "${currency_$e}" ->"" "{_${donation_charged_$e}}" "${currency_$e}" ="" "{_${donation_charged_eur_$e}}" eur),"" from "${name_$e}" ("${mail_$e}") : '"$_vt100_b${message_$e}$_vt100_n"'" +} +rm +e "" +all_eur,all_usd,all_charged_eur,all_charged_usd,asep_eur,asep_usd= +repeat $nb_months { +edate={y=date(0);m=date(1)-1-$>;while(m<=0,--y;m+=12);100*y+m} +s_month=${"arg "$edate%100",January,February,March,April,May,June,July,August,September,October,November,December"} +s_year={int($edate/100)} +month_eur,month_charged_eur,month_usd,month_charged_usd,msep_eur,msep_usd= +nb_sponsors=0 +repeat $nb_entries { e=$> +if $edate==int(${edate_$e}/100) +currency=${currency_$e} +val_eur=${donation_eur_$e} +val_charged_eur=${donation_charged_eur_$e} +val_usd=${donation_usd_$e} +val_charged_usd=${donation_charged_usd_$e} +nb_sponsors+=1 +if '${currency_$e}'=='eur' +all_eur.=$asep_eur$val_eur +all_charged_eur.=$asep_eur$val_charged_eur +month_eur.=$msep_eur$val_eur +month_charged_eur.=$msep_eur$val_charged_eur +asep_eur=, msep_eur=, +else +all_usd.=$asep_usd$val_usd +all_charged_usd.=$asep_usd$val_charged_usd +month_usd.=$msep_usd$val_usd +month_charged_usd.=$msep_usd$val_charged_usd +asep_usd=, msep_usd=, +fi +fi +} +month_sum_eur={sum(0$month_eur)+sum(0$month_usd)/$eur2usd} +month_sum_charged_eur={sum(0$month_charged_eur)+sum(0$month_charged_usd)/$eur2usd} +e "* "$_vt100_c$_vt100_b$s_month" "$s_year": "$_vt100_n$_vt100_b{_$month_sum_eur}" eur"$_vt100_n" (charged: "{_$month_sum_charged_eur}" eur)"" = "{_sum(0$month_eur)}" eur"$_vt100_n" (charged: "{_sum(0$month_charged_eur)}" eur)"" + "{_sum(0$month_usd)}" usd (charged: "{_sum(0$month_charged_usd)}" usd)" +600,30,1,3,'x<$month_sum_eur?[139,181,173]+(y>h/2?0:40):[220,230,240]' r. 500,30,1,3 c. 0,255 +shape_circle 24 s. x,2 s[-2,-1] y,2 +ri[-4] [-5],0,1,0,0 ri[-3] [-5],0,1,0,1 ri[-2] [-5],0,1,1,0 ri[-1] [-5],0,1,1,1 min[-4--1] +channels. 0 *.. . *. 255 a[-2,-1] c +r. {[w,h]+4},1,100%,0,0,0.5,0.5 +sh. 100% dilate_circ. 3 b. 1 rm. +t. $s_month" "$s_year,0.02~,0.5~,24,0.5,0,0,0,255 +t. {_round($month_sum_eur)}" \37 = "{_round($month_sum_eur*$eur2usd)}" $",0.5~,0.5~,24,1,0,0,0,255 +t. $nb_sponsors" sponsor"${"if "$nb_sponsors"!=1 u s else u \"\" fi"},0.97~,0.5~,24,0.5,0,0,0,255 +} +rv +all_max={max($all_eur,[$all_usd]/$eur2usd)} +all_min={min($all_eur,[$all_usd]/$eur2usd)} +all_sum_eur={sum($all_eur)} +all_sum_usd={sum($all_usd)} +all_sum_charged_eur={sum($all_charged_eur)} +all_sum_charged_usd={sum($all_charged_usd)} +all_avg={avg($all_eur,[$all_usd]/$eur2usd)} +all_med={med($all_eur,[$all_usd]/$eur2usd)} +0 t. "Avg: "{_max(0.1,round($all_avg,0.1))}"\37 / ""Med: "{_max(0.1,round($all_med,0.1))}"\37 / ""Min: "{_max(0.1,round($all_min,0.1))}"\37 / ""Max: "{_max(0.1,round($all_max,0.1))}"\37",0,0,24,1,1 +*. 200 i[-2] 100%,100%,1,3 a[-2,-1] c +rows -5,100% a y,0.5 r2dx 480 +if $2==0 o $HOME/work/src/gmic/html/img/donations_latest_months.png fi +} +total_eur={$all_sum_eur+$all_sum_usd/$eur2usd} +total_charged_eur={$all_sum_charged_eur+$all_sum_charged_usd/$eur2usd} +e "\n==> "$_vt100_c${_vt100_b}"TOTAL : "$_vt100_n$_vt100_b{_floor($total_eur)}" eur"$_vt100_n" (charged : "{_floor($total_charged_eur)}" eur)"" = "{_floor($all_sum_eur)}" eur (charged: "{_floor($all_sum_charged_eur)}" eur)"" + "{_floor($all_sum_usd)}" usd (charged: "{_floor($all_sum_charged_usd)}" usd)\n" +sp gmicky,{h} +l[-2,-1] { +rgb={I(w-1)} to_rgba rv +frame 10,10,0,0,0,0 +drgba $rgb a x +shape_heart 82 +r. 100%,100%,1,3 hsv2rgb. rv[-2,-1] *. 255 a[-2,-1] c +r. ..,..,1,100%,0,0,0.23,0.15 drop_shadow. 3,3,2,0,0 +blend alpha,0.7 r2dx 500 +if $2==0 o $HOME/Desktop/donations_latest_months.jpg,85 rm return fi +} +l[] { +$HOME/work/src/gmic/html/img/icon_coin.png +N=0 +text$N,r$N,g$N,b$N,file$N="2 \37",32,48,32,"don_2eur.png" N+=1 +text$N,r$N,g$N,b$N,file$N="5 \37",200,200,200,"don_5eur.png" N+=1 +text$N,r$N,g$N,b$N,file$N="10 \37",190,100,100,"don_10eur.png" N+=1 +text$N,r$N,g$N,b$N,file$N="+ \37",255,128,0,"don_moreeur.png" N+=1 +text$N,r$N,g$N,b$N,file$N="2 $",32,48,32,"don_2usd.png" N+=1 +text$N,r$N,g$N,b$N,file$N="5 $",200,200,200,"don_5usd.png" N+=1 +text$N,r$N,g$N,b$N,file$N="10 $",190,100,100,"don_10usd.png" N+=1 +text$N,r$N,g$N,b$N,file$N="+ $",255,128,0,"don_moreusd.png" N+=1 +repeat $N { +l[0] { +frame. 10,10,0,0,0,0 +sh. 0,2 +(${r$>}^${g$>}^${b$>}) rgb2hsl[-2,-1] H,S={[R,G]} rm. +l. { s c -[0] {ia#0-$H} %[0] 360 -[1] {ia#1-$S} +[2] 0.1 /[1] 2 c[1,2] 0,1 a c } +hsl2rgb. rm. +sh. 100% dilate_circ. 10 rm. +100%,100% t. ${text$>},0.5~,0.5~,45%,1,255 dilate_circ. 10 +dilate_circ. 15 to_rgb.. a[-2,-1] c +blend[-2,-1] alpha drop_shadow. 1,1 r2dx. 48 frame 10,5,0,0,0,0 +outfile=$HOME/work/src/gmic/html/img/${file$>} +if !isfile('$outfile') o. $outfile fi +rm. +} } +rm[0] +} +#@cli reset +#@cli : Reset global parameters of the interpreter environment. +reset : +e[^-1] "Reset global parameters of the interpreter environment." +db3d m3d md3d f3d l3d sl3d ss3d +#@cli rgb +#@cli : Return a random int-valued RGB color. +rgb : +u {round(u(255))},{round(u(255))},{round(u(255))} +RGB : rgb +#@cli rgba +#@cli : Return a random int-valued RGBA color. +rgba : +u {round(u(255))},{round(u(255))},{round(u(255))},{round(u(255))} +RGBA : rgba +#@cli shell_cols +#@cli : Return the estimated number of columns of the current shell. +shell_cols : +if ${-is_windows}" || "${-is_macos} u 80 +else +filename_rand filename=${} +l[] { cols=80 x "tput cols > "$filename it $filename if isint({t}) cols={{t}} fi rm onfail cols=80 rm } +delete $filename +u $cols +fi +#@cli size_value +#@cli : Return the size (in bytes) of image values. +size_value : +u {str=['$_pixeltype'];str=='float32'?4:str=='float64'?8:0} +#@cli std_noise +#@cli : Return the estimated noise standard deviation of the last selected image. +std_noise : +if $! +laplacian. -. {ic} abs. u {1.4826*ic/sqrt(d==1?20:42)} rm. else u 0 fi +#@cli str : string +#@cli : Print specified string into its binary, octal, decimal and hexadecimal representations. +str : skip "$1" +dec={'"$*"'} +e[^-1] "Convert string '$*' to binary '"${dec2bin\ $dec}"', octal '"${dec2oct\ $dec}"', decimal '"$dec"' and +hexadecimal '"${dec2hex\ $dec}"'." +#@cli strbuffer : buffer_size +#@cli : Return a string describing a size for the specified buffer size. +strbuffer : +u {`"const limit = 10000; +unit = vector4(); +siz = $1; +siz=0"} +#@cli strclut : "string" +#@cli : Return simplified version of the specified string that can be used as a CLUT name. +strclut : +0 => "$1" nm={b} rm. +u {`"ss = lowercase([['"{/$nm}"'],0]); +const N = 2*size(ss); +sd = vectorN(); +for (ps = pd = 0, ss[ps], ++ps, +ss[ps]<=_' '?(sd[pd++] = _'_'): +(ss[ps]==_'(' || ss[ps]==_')' || +ss[ps]==_'{' || ss[ps]==_'}' || +ss[ps]==_'[' || ss[ps]==_']' || +ss[ps]==_'\'' || ss[ps]==_'\"')?0: +(ps && ss[ps]>=_'0' && ss[ps]<=_'9' && ss[ps-1]>=_'a' && ss[ps-1]<=_'z')?(sd[pd++] = _'_'; sd[pd++] = ss[ps]): +(sd[pd++] = ss[ps]); +); sd[pd] = 0; sd"`} +#@cli strlen : string1 +#@cli : Return the length of specified string argument. +strlen : skip "${1=}" +u {narg({'"$1"'})} +#@cli strreplace : string,search,replace +#@cli : Search and replace substrings in an input string. +strreplace : skip "${3=}" +if narg("$3") +ls=${strlen\ "$2"} +lr={${strlen\ "$3"}-1} +l[] { +('"$1"':y) s +,{'"$2"'} s y,-$ls +repeat $! { if [{$>,^}]==['"$2"'] rows[$>] 0,$lr f[$>] {'"$3"'} fi } +a y u {t} rm +} +else +l[] { ('"$1"') s -,{'"$2"'} a y u {t} rm } +fi +#@cli strlowercase : string +#@cli : Return a lower-case version of the specified string. +strlowercase : +('"$*"') u {`lowercase([{^}])`} rm. +#@cli struppercase : string +#@cli : Return an upper-case version of the specified string. +struppercase : +('"$*"') u {`uppercase([{^}])`} rm. +#@cli strvar : "string" +#@cli : Return a simplified version of the specified string, that can be used as a variable name. +#@cli : (version that creates a lowercase result, no longer than 128 chars). +strvar : +_strvar_fn="lowercase(c)" _strvar "$*" +#@cli strcasevar : "string" +#@cli : Return a simplified version of the specified string, that can be used as a variable name. +#@cli : (version that keeps original case of specified string, no longer than 128 chars). +strcasevar : +_strvar_fn="c" _strvar "$*" +_strvar : +l[] { +('"$*"':y) f. "c = i; inrange(c,_'0',_'9') || inrange(c,_'a',_'z') || +inrange(c,_'A',_'Z') || c==_'_'?"$_strvar_fn":_'_'" +rows. 0,{min(h,128)-1} autocrop. {'_'} +if inrange(i,_'0',_'9') i.. ('_') a[-2,-1] y fi +do h={h} replace_str. "__","_" while h!=$h +u {t} rm +} +#@cli strver : _version,_prerelease +#@cli : Return the specified version number of the G'MIC interpreter, as a string. +#@cli : Default value: 'version=$_version' and 'prerelease='. +strver : skip "${1=},${2=}" +if isnum("$1")" && $1>0" ver="$1" else ver=$_version noarg fi +('$ver') r. {2*w-1} f. 'if(x%2,_'.',i)' u {t} rm. +if s=['$2'];s!=0&&s!='0' u ${}" (pre-release \#"$2")" fi +#@cli tic +#@cli : Initialize tic-toc timer. +#@cli : Use it in conjunction with 'toc'. +tic : +e[^-1] "Initialize timer." +if !narg($_ticpos) _ticpos=0 fi _tic$_ticpos=$| _ticpos+=1 +#@cli toc +#@cli : Display elapsed time of the tic-toc timer since the last call to 'tic'. +#@cli : This command returns the elapsed time in the status value. +#@cli : Use it in conjunction with 'tic'. +toc : +v=$^ _ticpos-=1 u {_$|-${_tic$_ticpos}} +v 0 e[^-1] "Elapsed time: "${}" s". v $v +#@cli uint82base64 : _encoding={ 0=base64 | 1=base64url } +#@cli : Encode the values of the latest of the selected images as a base64-encoded string. +#@cli : The string can be decoded using command 'base642uint8'. +#@cli : Selected images must have values that are integers in [0,255]. +#@cli : Default values: 'encoding=0'. +uint82base64 : skip "${1=0}" +if isnum("$1") encoding=$1 else encoding=0 noarg fi +{ceil(whds*4/3)+([0,2,1])[whds%3]} +eval " +hash = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +"$encoding"?(hash[62] = _'-'; hash[63] = _'_'); +od = ov = n = 0; +for (os = 0, os>2]; ov = v; n = 1): +n==1?(i[#-1,od++] = hash[((ov&3)<<4) | (v>>4)]; ov = v; n = 2): +(i[#-1,od++] = hash[((ov&15)<<2) | (v>>6)]; i[#-1,od++] = hash[v&63]; n = 0); +); +n==1?(i[#-1,od++] = hash[((ov&3)<<4)]; copy(i[#-1,od],_'=',2,1,0); od+=2): +n==2?(i[#-1,od++] = hash[((ov&15)<<2)]; i[#-1,od++] = _'='); +" +u {t} rm. +#@cli :: Other Interactive Commands +#@cli demos : _run_in_parallel={ 0=no | 1=yes | 2=auto } +#@cli : Show a menu to select and view all G'MIC interactive demos. +demos : check "isint(${1=2}) && $1>=0 && $1<=2" check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +strver=${strver" "$_version,$_prerelease} +e "\n +------ "${g}"G\47MIC demos"$n" ------------------\n +----\n +---- "${c}"Mouse button"$n" to select a demo.\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-------------------------------------" +l[] { +entries="2048 game","Blobs Editor","Bouncing Balls","Connect Four","Fire Effect","Fireworks","Fish-Eye Effect","Fourier Filtering","Tower of Hano\357","Histogram Demo","Hough Transform","Jawbreaker","Virtual Landscape","The Game of Life","Light Effect","Mandelbrot Explorer","3D Metaballs","Minesweeper","Minimal Path","Pacman","Paint","Plasma Effect","RGB Quantization","3D Reflection","3D Rubber Object","Shade Bobs","Spline Editor","3D Starfield","Tetris","Tic-Tac-Toe","Image Waves","Fractal Whirls","Color Curves" +commands=x_2048,x_blobs,x_bouncing,x_connect4,x_fire,x_fireworks,x_fisheye,x_fourier,x_hanoi,x_histogram,x_hough,x_jawbreaker,x_landscape,x_life,x_light,x_mandelbrot,x_metaballs3d,x_minesweeper,x_minimal_path,x_pacman,x_paint,x_plasma,x_quantize_rgb,x_reflection3d,x_rubber3d,x_shadebobs,x_spline,x_starfield3d,x_tetris,x_tictactoe,x_waves,x_whirl,_demo_color_curves +nb_entries={narg($entries)} +parallel_mode={1-if($1!=2,$1,$_cpus>=2)} +l[] { +repeat $nb_entries { +arg0 $>,$entries entry=${} +0 t. $entry,0,0,24,1,1 +} +r ${-max_wh},1,1,0,0,0.5,0.5 +frame 12,6,0 a z ++n[0] 0,255 ++shift[0] 1,3,0,0 max[0,-1] ++f[0] z+1 +1,1,100%,3,u(128,255) r. 1,[0],[0],3 *. 'y/(h-1)' r. [0],[0],[0],3,3 +200%,200%,1,1,"x = min(x,w-1-x); y = min(y,h-1-y); (x*y/wh)^0.7>0.01" ++dilate. 3 xor.. . +distance.. 1 c.. 0,2 negate.. distance. 0 c. 0,2 +r2dx[-2,-1] 50% n[-2,-1] 0,1 ++[0] .. +*.. 100 +[1,-2] +*[2,3] . +rm. +frame 4,4,0 +a c s z +append_tiles 3 s c +to_rgb[1] a[3-5] c +0 t. "G\'MIC demos",2,2,32,1,1,1,1 +if $_prerelease 0 t. "Version:\n"$strver,40,1,18,1,1,1,1 rows. 2,100% +else 0 t. "Version: "$strver,40,1,18,1,1,1,1 rows. -2,100% +fi +a[-2,-1] x,0.5 +b. 0.5 n. 0,1 +(255;255^255;16^128;0) r. ..,..,1,3,3 *[-2,-1] round. 1,-1 +!=. 0 channels. 1 +s=8 +r[^-2,-1] 100%,{h+h#0+2*$s+6},1,100%,0,0,0,1 +rectangle[0] 0,$s,100%,{$s+6+h-1},1,0.6 +rectangle[1] 0,$s,100%,{$s+6+h-1},1,120,32,32 +j[0] .,{(w#0-w)/2},{$s+3},0,0,-1 +j[1] ..,{(w#0-w)/2},{$s+3},0,0,1,. rm[-2,-1] +c[0] 0,1 +=> menu_opac,menu_fgcol,menu_ind,menu_bgcol +} +arrow3d 20,20,0,0,0,0,20%,40%,40% col3d. 255,128,0 => cursor3d +l[] { +n=16 +chromeball64x64[] 200,100,64 n. 0,230 s. c,-3 +rgb2hsv.. r.. 100%,100%,$n,3 f.. "[z*360/d,G,B]" hsv2rgb.. +N={6*$n} P={2*$N-1} +i[0] ('CImg3d') i[1] ($N,$P) i[2] 3,$N +i[3] 2,$N,1,1,"x?y:1" i[4] 3,{$N-1},1,1,"x==0?2:x==1?y:y+1" y[3,4] a[3,4] y +l[4] { +s z i[0--2] (-128,{w},{h},3) 4,{$N-$n},1,1,'x==0?-128:x==1?y%$n:0' +3,{$P-$N},1,1,200 y a y +} +l[5] { +n 0,0.5 i[0] (-128,{w},{h},1) 4,{$N-1},1,1,-128,0,0,0 +1,{$P-$N},1,1,0.25 y a y +} +y a y +=> background3d +} +{menu_fgcol,[w,h]},1,3 +plasma. 1,1,5 n. 0,230 water. 100 +(0.1;0.3^0.1;0.2^0.5;0.3) ri. ..,3 *[-2,-1] +(0;1) r. ..,..,1,1,3 ^. 1.5 n. 0.2,1.15 *[-2,-1] n. 0,128 +=> background +w. -1,-1,0,"[G'MIC - "$strver"]" cursor 0 w[] -1,-1,0,0,{([{*,u,v}]-[{*,w,h}])/2} +omb,ind_clicked,cfx,cfy,cfz,alpha=0 +nfx,nfy,nfz={[g,g,g]} time0={$|-4} +do +mx,my,mb={menu_fgcol,x={*,x};y={*,y};[x<0?-1:x*(w-1)/({*,w}-1),y<0?-1:y*(h-1)/({*,h}-1),{*,b}]} +ind={menu_ind,i($mx,$my)} +if $mb" && "!$ind_clicked ind_clicked=$ind fi +[background] +3,$N,1,1,"const t = 0.8*"$|"; const a = "$alpha"; const oma = 1 - a; +x==0?oma*cos("$cfx"*y + t) + a*cos("$nfx"*y + t): +x==1?oma*sin("$cfy"*y + t) + a*sin("$nfy"*y + t): +oma*sin("$cfz"*y + t) + a*sin("$nfz"*y + t)" +y. +j[background3d] .,0,8 rm. ++r3d[background3d] 1,2,3,{20*$|} *3d. {menu_fgcol,[w,h]/2-30},300 +3d. 0,0,300 +j3d.. .,50%,50%,0,1,1,0,0,200 rm. +if $|-$time0>5 alpha+=0.02 fi +if $alpha>1 alpha-=1 cfx,cfy,cfz=$nfx,$nfy,$nfz nfx,nfy,nfz={[g,g,g]} time0={$|-u*3} fi +if $ind>0 +==[menu_ind] +$ind j.. [menu_bgcol],0,0,0,0,{$mb" && "$ind_clicked==$ind?0.6:1},. rm. +fi +j. [menu_fgcol],0,0,0,0,1,[menu_opac] +if $mx>0 ++r3d[cursor3d] 1,1.3,0.6,{50*cos($|)} +j3d.. .,$mx,$my,0,1,4,0,0,800,{-2,[w,h]/2},-1000,0.7 rm. +fi +w. -1,-1,0 +if {*,CTRLLEFT}" && "{*,D} w. 150%,150% elif {*,CTRLLEFT}" && "{*,C} w. 100%,100% fi +rm. +if !$mb" && "$omb" && "$ind_clicked" && "$ind_clicked==$ind +m "com : v 1 "${arg\ $ind,$commands} parallel $parallel_mode,"l[] { com rm }" um com +elif !$mb ind_clicked=0 +fi +omb=$mb +wait 20 +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w 0 } v 0 e "" +_demo_color_curves : +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +if !narg($__demo_color_curve) +e "\n +------ "${g}"Color curves"$n" ----------------------------------------------------------------------------\n +----\n +---- "${c}"Left mouse button"$n" on a curve creates a new control point (or moves an existing one).\n +---- "${c}"Right mouse button"$n" on a control point deletes it.\n +---- "${c}"Left mouse button"$n" on the main image window shows the initial image until button is released.\n +---- "${c}"Right mouse button"$n" on the main image window adds a keypoint to all curves from picked color.\n +---- Key '"${c}"R"$n"' on a curve resets it.\n +---- Keys '"${c}"CTRL+D"$n"' increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' decrease window size.\n +---- Keys '"${c}"CTRL+R"$n"' reset window size.\n +---- Keys '"${c}"ESC"$n"', '"${c}"Q"$n"' or '"${c}"ENTER"$n"' close the current window.\n +----\n +------------------------------------------------------------------------------------------------" +__demo_color_curve=1 l[] { do rm sp ? while s!=3 } x_color_curves rgb __demo_color_curve= +else +e "\n +------ "${g}"Color curves"$n" ----------------------------------------------------------------------------\n +----\n +---- Only "${c}"one session"$n" allowed at the same time !\n +----\n +------------------------------------------------------------------------------------------------" +fi +#@cli tixy : "expression" +#@cli : Animate specified mathematical expression with a 16x16 grid of circles, using the rules described at . +tixy : skip "${1=sin(t-sqrt((x-8)^2+(y-8)^2))}" check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r b=$_vt100_b +if narg("$*") expr="$*" else expr="$1" fi +l[] { +('$expr') +replace_str "%","%25" +replace_str "&","%26" +replace_str "(","%28" +replace_str ")","%29" +replace_str "+","%2B" +replace_str ",","%2C" +replace_str ";","%2C" +replace_str "/","%2F" +replace_str "[","%5B" +replace_str "]","%5D" +replace_str "|","%7C" +replace_str "^","**" +replace_str " ","+" +url=https://tixy.land?code={t} +rm +} +e "\n +------ "${g}"tixy"$n" ------------------------------------------------------------------------------------\n +----\n +---- tixy - creative code golfing: "${g}"https://tixy.land"$n"\n +----\n +---- "$r${b}"Expression:"$n" "$expr"\n +----\n +---- "$r${b}"Corresponding URL:"$n" "$url"\n +----\n +---- "$r${b}"Rules:"$n"\n +---- . Specified expression depends on 4 variables "${g}"(t,i,x,y)"$n" and is rendered as an animation.\n +---- . Variables "${g}"x"$n" and "${g}"y"$n", in range "${c}"[0,15]"$n", are the spatial position of each dot.\n +---- . Variable "${g}"i"$n", in range "${c}"[0,255]"$n", is the dot index, i.e. "${c}"i = x + 16*y"$n".\n +---- . Variable "${g}"t>=0"$n" is the (decimal) number of elapsed seconds.\n +---- . Specified expression "${g}"func(t,i,x,y)"$n" must return a complex value "${c}"c"$n".\n +---- . Variable "${g}"z"$n" can be used as a shortcut for "${g}"[ x,y ]"$n".\n +---- . Variable "${g}"j"$n" is the complex imaginary number "${g}"[ 0,1 ]"$n".\n +---- . "${c}"cabs(c)"$n" in "${g}"[0,1]"$n" determines the radius of each dot at "${c}"(x,y)"$n".\n +---- . "${c}"carg(c)"$n" in "${g}"[-pi,pi]"$n" determine the color of each dot at "${c}"(x,y)"$n".\n +----\n +---- Key '"${c}"SPACE"$n"' starts/stops recording animation as video file '"${c}"out.mp4"$n"'.\n +---- Key '"${c}"ENTER"$n"' takes a screenshot of current image.\n +---- Key '"${c}"A"$n"' enables/disables anti-aliasing.\n +---- Key '"${c}"F"$n"' displays formula on the image.\n +---- Key '"${c}"R"$n"' resets time.\n +---- Keys '"${c}"CTRL+D"$n"' increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' decrease window size.\n +---- Keys '"${c}"CTRL+R"$n"' reset window size.\n +---- Keys '"${c}"ESC"$n"', '"${c}"Q"$n"' or '"${c}"ENTER"$n"' close the current window.\n +------------------------------------------------------------------------------------------------" +w[] 400,400,0,"[G'MIC] tixy: "$expr +t0=$| is_recording=0 is_antialias=1 is_screenshot=0 is_formula=0 nb_frames=0 +360,1,1,3,[x,abs(cos(x/w*pi))^0.5,1] hsv2rgb. shift. -180,0,0,0,2 => cmap +strvar $expr basename=${} +do +is_ctrl={{*,CTRLLEFT}" || "{*,CTRLRIGHT}} +if $is_ctrl" && "{*,-D} w[] {1.25*[{*,w,h}]} rmn formula,mformula +elif $is_ctrl" && "{*,-C} w[] {0.8*[{*,w,h}]} rmn formula,mformula +elif $is_ctrl" && "{*,R} w[] 400,400 rmn formula,mformula +elif {*,-A} is_antialias={!$is_antialias} +elif {*,-F} is_formula={!$is_formula} +elif {*,R} t0=$| +elif {*,-SPACE} +if $is_recording o[] $basename.mp4,15,0,0 nb_frames=0 +else t0=$| fi +is_recording={!$is_recording} +elif {*,-ENTER} is_screenshot=1 +fi +m={min({*,w,h})} _is_antialias={$is_antialias" && "$m<512} +{m=$m*($_is_antialias?2:1);[m,m]},1,3 +16,16,1,1,">begin( +const b = w#-1/16; +const t = "$|-$t0"; +j = [ 0,1 ]; +); +i = x + 16*y; +ref([ x,y ],z); +val = ("$expr"); +n = cabs(val); +r = floor(0.48*b*cut(n,0,1)); +a = (360+carg(val)*180/pi)%360; +c = I[#"$cmap",a]; +r>1?ellipse(#-1,b*(x + 0.5),b*(y + 0.5),r,r,0,1,c): +r>0?ellipse(#-1,b*(x + 0.5),b*(y + 0.5),1,1,0,0.5,c)" +rm. +if $_is_antialias r. 50%,50%,1,3,2 fi +if {*,w}!={*,h} -. 128 r. {*,w,h},1,3,0,0,0.5,0.5 +. 128 fi +if $is_formula +if !narg($formula) +0 t. {``$expr},0,0,48,1,255 frame. 5,5,0 +dilate. 11 max. 128 to_rgb.. +if w>0.75*{*,w} r2dx[-2,-1] {0.75*{*,w}} fi +mv[-2,-1] 0 =>[0,1] formula,mformula +fi +j. [formula],0.5~,1~,0,0,1,[mformula],255 +fi +if $is_screenshot o. $basename.png is_screenshot=0 fi +if $is_recording o. $basename.mp4,15,0,1 nb_frames+=1 to. "Recording video\n[Frame \#"$nb_frames"]",0,0,5% fi +w. rm. wait 40 +while {*}" && "!{*,ESC}" && "!{*,Q} +rmn cmap,formula,mformula +w[] 0 +#@cli x_2048 +#@cli : Launch the 2048 game. +x_2048 : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"2048"$n" -----------------------------------------------\n +----\n +---- Join the numbers and get to the "${g}"2048"$n" tile!\n +----\n +---- Use your "${c}"arrow keys"$n" to move the tiles. When two tiles\n +---- with the same number touch, they merge into one!\n +---- This command is a port of the '"${c}"2048"$n"' game originally\n +---- designed by "${c}"Gabriele Cirulli"$n", and available at:\n +---- "${g}"http://gabrielecirulli.github.io/2048/"$n"\n +----\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------------------------" +l[] { +score=0 f3d 50 m3d 0 +m "_x_2048_setrandom : +==[0] 0 f. 'if(i,4*y+x,-1)' discard. -1 +off={i[round(u(h-1))]} rm. x={$off&3} y={$off>>2} n={if(u<0.75,1,2)} +=[0] $n,$x,$y [{2+$n}] c3d. +repeat 6 { j3d[1] .,{78+$x*121},{190+$y*121},{10*$<},{(1+$>)/6} w[1] wait 20 } +rm." +m "_x_2048_object3d : +f[0] 'if(i,i*16+4*y+x,-1)' discard. -1 +N={h} repeat h { v={-{1+$>},@$>} ++3d[{2+($v>>4)}] {$v&3},{($v>>2)&3} } ++3d[-$N--1] rm.." +i[0] 4,4 +b0=204,192,179 b1=238,228,218 b2=237,224,200 b3=242,177,121 +b4=245,149,99 b5=246,124,95 b6=246,94,59 b7=237,207,114 +c0=119,110,101 c1=249,246,242 s0=" " +520,630,1,3 fc. 250,248,239 +t. "2048",20,10,86,1,$c0 +t. "Join the numbers and get to the 2048 tile!",20,90,20,1,$c0 +rectangle. 422,20,501,75,1,187,173,160 t. "SCORE",439,25,15,1,238,228,218 +repeat 12 { +107,107,1,3 fc. ${b{min($>,7)}} +fc. ${c{$>>2}} +s1={2^$>} 0 t. ${s{$>>0}},0,0,52,1,1 +r. ..,..,1,1,0,0,0.5,0.5 dilate_circ. 3 b. 0.5 +j... ..,0,0,0,0,1,.,1 rm[-2,-1] +} +frame_round[2--1] 0,20%,0.5,187,173,160 frame[2--1] 7,7,187,173,160 +to_rgb[2--1] +r[2] 400%,400%,1,3,0,2 j[1] [2],18,130 +sprite3d[3--1] +w[1] 100%,100%,0,"[G"{`39`}"MIC] 2048" insert_new=1 +repeat 2 { _x_2048_setrandom } +do +if $insert_new +_x_2048_object3d *3d. 121 j[1] [2],18,130 j3d[1] .,78,190 rm. +80,25,1,3 fc. $c1 0 t. $score,0,0,25,1,1,1,1 ri. ..,0,0,0.5,0.8 +rectangle[1] 422,45,501,69,1,187,173,160 j[1] ..,422,45,0,0,1,. rm[-2,-1] +w[1] insert_new=0 +fi +++[0] 1 f. 'j(-1)==i||j(1)==i||j(0,-1)==i||j(1,0)==i||i==1' +if {0,iM==11} +alert "Game Over","\nCongratulations! You got the 2048 title!\n\n Your score: "$score,"OK" +break +elif !iM +alert "Game Over","\nBad luck! You lost the game!\n\n Your score: "$score,"OK" +break +fi +rm. +wait +is_shift=0 um shift2048,ishift2048,vshift2048 +if {*,ARROWLEFT} +m "shift2048:" m "ishift2048:" m "vshift2048:" +is_shift=1 +elif {*,ARROWRIGHT} +m "shift2048: rotate 180" m "ishift2048: rotate 180" +m "vshift2048: s3d l[2] { r 3,{h/3},1,1,-1 s x -[0,1] 3 *[0,1] -1 a x y } a y" +is_shift=1 +elif {*,ARROWUP} +m "shift2048: rotate -90" m "ishift2048: rotate 90" +m "vshift2048: s3d l[2] { r 3,{h/3},1,1,-1 s x rv[0,1] -[0] 3 *[0] -1 a x y } a y" +is_shift=1 +elif {*,ARROWDOWN} +m "shift2048: rotate 90" m "ishift2048: rotate -90" +m "vshift2048: s3d l[2] { r 3,{h/3},1,1,-1 s x rv[0,1] -[1] 3 *[1] -1 a x y } a y" +is_shift=1 +fi +if {*,r} w[1] 100%,100% fi +if $is_shift +wait -1 +shift2048[0] +repeat 2 { +_x_2048_object3d ++s[0] y discard[-4--1] 0 y[-4--1] x r[-4--1] 4,1,1,1,0,0 a[-4--1] y ++==[0,-1] insert_new={$insert_new||!im} rm. ++f[0,-1] 'if(i,x,-1)' discard[-2,-1] -1 rv[-2,-1] -[-2,-1] rv[0,-2] rm.. +if (im||iM)&&!{*,k} +/. 5 z. 0,2 y. +repeat 5 { +j.. .,0,8,0,0,-1 +j[1] [2],18,130 +vshift2048.. *3d. 121 j3d[1] .,78,190 rm. +w[1] wait 20 +} +fi +rm[-2,-1] +if !$> dscore=0 +[0] +f[0] 'if(i,i*16+4*y+x,-1)' discard. -1 +repeat h { +x={i[$>]&3} y={(i[$>]>>2)&3} n={i[$>]>>4} +if $x>0" && "{0,i($x-1,$y)}==$n +=[0] 0,$x,$y =[0] {$n+1},{$x-1},$y =.. 0,$x,$y insert_new=1 dscore+={2^($n+1)} +else =. -1,0,$> +fi +} +score+=$dscore +if iM<0 rm[-2,-1] +else +discard. -1 +rv[0,-2] _x_2048_object3d rv[0,-3] vshift2048. *3d. 121 +j[1] [2],18,130 j3d[1] .,78,190 rm[-3,-1] +N={h} repeat h { v={-{1+$>},@$>} ++3d[{2+($v>>4)}] {$v&3},{($v>>2)&3} } ++3d[-$N--1] rm.. +0 t. +$dscore,0,0,33,1,1 100%,100%,1,3 fc. $c0 +repeat 6 { ++vshift2048... *3d. 121 +j3d[1] .,78,190 +j. ...,440,{40-3*$>},0,0,{min(1,$1 +{0,[w,h]},1,2 +repeat h#1 { +r={1,i[2]*(1+i[3]*cos(i[4]+i[5]*$|*1000))} +ellipse. {1,@0,1},$r,$r,0,1,{1,@6-7} +d={sqrt(($x-{1,@0})^2+($y-{1,@1})^2)} +if $d<$r nearest=$> fi +shift[1] 0,-1,0,0,2 +} +b. 15 ++norm. +>=. 50 <=.. 40 *[-3,-1] ++*[0,-1] rm.. rv[-2,-1] *. 1.6 c. 0,255 +[-2,-1] +if $fps>0 to. $fps" fps",5,{h-29},24,2,0.2 fi +w. +if {*,CTRLLEFT}" && "{*,D} w[] {2*[w,h]} elif {*,CTRLLEFT}" && "{*,C} w[] {[w,h]} fi +rm. +else ++to[0] "G\47MIC Blobs Editor",75,100,35,3,1,200,128,255 +to. "* Left mouse button : Create and move blobs.\n\n* Right mouse button : Remove blob.\n\n* Middle mouse button : Remove all blobs.\n\n* Key 'ESC' or 'Q' : Quit.\n\n* Colors and sizes of appearing blobs are\n chosen randomly",50,180,18,1,1,255 +w. +if {*,CTRLLEFT}" && "{*,D} w[] {1.5*[w,h]} elif {*,CTRLLEFT}" && "{*,C} w[] {[w,h]} fi +rm. +fi +wait 20 +if $x<0||$y<0 continue fi +if $b&1 +if $nearest>=0" || "$moving>=0 +if $moving<0 moving=$nearest fi +=[1] $x,0,$moving =[1] $y,1,$moving +else +($x,$y,{u(20,50)},{u(-0.3,0.3)},{u(0,pi/2)},{u(0,0.009)},{u(64,255)},{u(64,255)}) a[^0] y +moving={h-1} +fi +elif $b&2 +if $nearest>=0 l[1] { s y rm[$nearest] a y } nearest=-1 fi +elif $b&4 +k[0] +else +moving=-1 +fi +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w 0 } +#@cli x_bouncing +#@cli : Launch the bouncing balls demo. +x_bouncing : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Bouncing balls"$n" ------------------------------\n +----\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-----------------------------------------------------" +l[] { +520,320,1,3 plasma 1,1,9 n 0,220 +N=12 +repeat $N { +ball[] {round(u(32,80))},${-rgb} +t$>={u(200)} x$>={0,u(10,w-10)} h$>={u(150,300)} vx$>={if(u<0.5,1,-1)*u(1,8)} +} +mv[0] $! +w. {f=w<0.5*{*,u}?1.5:1;[w,h]*=f},0,"[G"{`39`}"MIC] Bouncing Balls" +(0;0.7;1) r. {-2,w},70,1,1,3 +do +[$N] +repeat $N { +bw={$>,w} bh={$>,h} +y={${h$>}*abs(cos(${t$>}*pi/60))-$bh/2} +dt=1 +if $y<0 d={-$y} y=0 bh-=$d bw+=$d dt={max(0.2,1-($d/$bh)^2)} else dt=1 fi +if ${x$>}+$bw/2>w +d={${x$>}+$bw/2-w} bw-=$d bh+={0.5*$d} +if ${x$>}+$bw/4>w vx$>={-${vx$>}} fi +fi +if ${x$>}-$bw/2<0 +d={$bw/2-${x$>}} bw-=$d bh+={0.5*$d} +if ${x$>}-$bw/4<0 vx$>={-${vx$>}} fi +fi ++r[$>] $bw,$bh,1,4,3 s. c,-3 +j... ..,{max(0,min({$N,w-$bw},${x$>}-$bw/2))},{{$N,h}-{h}-$y-70},0,0,1,.,255 rm[-2,-1] +t$>+=$dt +x$>+={$dt*${vx$>}} +} ++rows. {h-2*70},{h-1-70} mirror. y *. [{$N+1}] +j.. .,0,{-2,h-71},0,0,0.5 rm. +fps=${-fps} if $fps>0 to. $fps" fps",5,{h-29},24,2,0.2 fi +if {*,CTRLLEFT}" && "{*,D} w[] {1.5*w},{1.5*h} elif {*,CTRLLEFT}" && "{*,C} w[] {w},{h} fi +w. rm. wait 20 +while {*}" && "!{*,ESC}" && "!{*,Q} +w 0 rm } +#@cli x_color_curves : _colorspace={ rgb | cmy | cmyk | hsi | hsl | hsv | lab | lch | ycbcr | last } +#@cli : Apply color curves on selected RGB[A] images, using an interactive window. +#@cli : Set 'colorspace' to 'last' to apply last defined color curves without opening interactive windows. +#@cli : Default value: 'colorspace=rgb'. +x_color_curves : skip ${1=rgb} +if ['"$1"']!='last'&&!{*,u} error[0--3] "Command '$0': No display available." return fi +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e[^-1] "Apply color curves of image$?, in the '$1' colorspace." +if ['"$1"']=='last' +if !narg($_xcc_colorbase) return fi +__x_color_curves[] $_xcc_colorbase +else +e "\n +------------------------------------------------------------------------------------------------\n +----\n +---- "${c}"Left mouse button"$n" on a curve creates a new control point (or moves an existing one).\n +---- "${c}"Right mouse button"$n" on a control point deletes it.\n +---- "${c}"Left mouse button"$n" on the main image window shows the initial image until button is released.\n +---- "${c}"Right mouse button"$n" on the main image window adds a keypoint to all curves from picked color.\n +---- Key '"${c}"R"$n"' on a curve resets it.\n +---- Keys '"${c}"CTRL+D"$n"' increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' decrease window size.\n +---- Keys '"${c}"CTRL+R"$n"' reset window size.\n +---- Keys '"${c}"ESC"$n"', '"${c}"Q"$n"' or '"${c}"ENTER"$n"' close the current window.\n +----\n +------------------------------------------------------------------------------------------------" +__x_color_curves[] $1 _xcc_colorbase=$1 +fi +to_color +foreach { +if ['"$1"']!='last' ++r[0] ${fitscreen[]\ {0,[w,h,1]},128,70%},1,100%,3 ++l. { +xcc_goto s c histogram 256,0,255 xcc_info +} +__C0= __C1= __C2= __C3= __C4= +if narg($__xcc_C0) __C0=$__xcc_C0 fi +if narg($__xcc_C1) __C1=$__xcc_C1 fi +if narg($__xcc_C2) __C2=$__xcc_C2 fi +if narg($__xcc_C3) __C3=$__xcc_C3 fi +if narg($__xcc_C4) __C4=$__xcc_C4 fi +x={1,({*,u}-560-w)/2} y={1,({*,v}-h)/2} +if $!==5 +parallel "w[] 256,256,0,0,"$x","$y",\"Curve: "$_title0"\" x_select_function1d... __C0,"$_color0"","w[] 256,256,0,0,"{$x+280}","$y",\"Curve: "$_title1"\" x_select_function1d.. __C1,"$_color1"","w[] 256,256,0,0,"$x","{$y+300}",\"Curve: "$_title2"\" x_select_function1d. __C2,"$_color2"","w. 100%,100%,0,0,"{$x+560}","$y" _x_color_curves[-4]" +elif $!==6 +parallel "w[] 256,256,0,0,"$x","$y",\"Curve: "$_title0"\" x_select_function1d[-4] __C0,"$_color0"","w[] 256,256,0,0,"{$x+280}","$y",\"Curve: "$_title1"\" x_select_function1d... __C1,"$_color1"","w[] 256,256,0,0,"$x","{$y+300}",\"Curve: "$_title2"\" x_select_function1d.. __C2,"$_color2"","w[] 256,256,0,0,"{$x+280}","{$y+300}",\"Curve: "$_title3"\" x_select_function1d. __C3,"$_color3"","w. 100%,100%,0,0,"{$x+560}","$y" _x_color_curves[-5]" +elif $!==7 +parallel "w[] 256,256,0,0,"$x","$y",\"Curve: "$_title0"\" x_select_function1d[-5] __C0,"$_color0"","w[] 256,256,0,0,"{$x+280}","$y",\"Curve: "$_title1"\" x_select_function1d[-4] __C1,"$_color1"","w[] 256,256,0,0,"$x","{$y+300}",\"Curve: "$_title2"\" x_select_function1d... __C2,"$_color2"","w[] 256,256,0,0,"{$x+280}","{$y+300}",\"Curve: "$_title3"\" x_select_function1d.. __C3,"$_color3"","w[] 256,256,0,0,"{$x+280}","{$y+600}",\"Curve: "$_title4"\" x_select_function1d. __C4,"$_color4"","w. 100%,100%,0,0,"{$x+560}","$y" _x_color_curves[-6]" +fi +k[0] +fi +xcc_goto +repeat s { function1d[] 1,${__xcc_C$>} *. {255%} r. 256,1,1,1,5 c. 0,255 sh[0] $> map. .. rm[-2,-1] } +xcc_backto +} +um xcc_goto,xcc_backto,xcc_info +_x_color_curves : +title={0,b} if narg({'{0,x}'}) title=$title.{0,x} fi ('$title') discard. {'~'} title={t} rm. ++drgba. w. 100%,100%,0,"[G"{`39`}"MIC] Image: "$title rm. +xcc_goto. . +oC0= oC1= oC2= oC3= oC4= viewmode=0 +do +wait 100 need_refresh=0 +oviewmode=$viewmode is_ctrl={{*,CTRLLEFT}" || "{*,CTRLRIGHT}} x={*,x} y={*,y} +if {*,r} need_refresh=1 +elif $is_ctrl" && "{*,-D} w[] {{*,w}*125%},{{*,h}*125%} need_refresh=1 +elif $is_ctrl" && "{*,-C} w[] {{*,w}*80%},{{*,h}*80%} need_refresh=1 +elif $is_ctrl" && "{*,-R} w[] {w},{h} need_refresh=1 +elif {*,b}&1 viewmode={x={*,x};if(x=0" && "$y>=0 +xc={$x*w/{*,w}} yc={$y*h/{*,h}} +z[0] $xc,$yc,$xc,$yc +repeat s { (${__C$>},{i[$>]/255%},{i[$>]/255%}) r. 2,{w/2},1,1,-1 sort. +,y __C$>={^} rm. } +rm. wait -1 +else viewmode=0 +fi +need_refresh={$need_refresh||$oviewmode!=$viewmode} +repeat s { if ['_${oC$>}']!=['_${__C$>}'] +function1d[] 1,${__C$>} *. {255%} r. 256,1,1,1,5 c. 0,255 ++channels[0] $> map. .. j[1] .,0,0,0,$> rm[-2,-1] +need_refresh=1 oC$>=${__C$>} +fi } +if $need_refresh +if $viewmode==0 ++xcc_backto[1] +elif $viewmode%2 +w2={0,int(w/2)} b={$viewmode==1} +z[{!$b}] 0,{$w2-1} +z[$b] $w2,100% +xcc_backto.. xcc_backto. a[-2,-1] x line. 50%,0,50%,100%,1,0 +else ++xcc_backto[0] +fi +if s>3 drgba. fi w. rm. refresh=0 +fi +while {*}" && "!{*,ESC}" && "!{*,Q}" && "!{*,SPACE}" && "!{*,ENTER} +w 0 +repeat 5 { if narg(${__C$>}) __xcc_C$>=${__C$>} __C$>=-1 fi } +__x_color_curves : +if ['"$1"']=='rgb' +_color0="255,180,180" _color1="180,255,180" _color2="180,180,255" _color3="220,220,220" +_title0=Red _title1=Green _title2=Blue _title3=Alpha +m "xcc_goto:" m "xcc_backto:" +m "xcc_info: (0,255;0,0;0,0) (0,0;0,255;0,0) (0,0;0,0;0,255) r[-3--1] 256,3,1,1,3 +a[0,-3] y a[1,-2] y a[2,-1] y" +elif ['"$1"']=='cmy' +_color0="180,255,255" _color1="255,180,255" _color2="255,255,100" _color3="220,220,220" +_title0=Cyan _title1=Magenta _title2=Yellow _title3=Alpha +m "xcc_goto: s c,-3 rgb2cmy[0] a c" m "xcc_backto: s c,-3 cmy2rgb[0] a c" +m "xcc_info: (255,0;255,255;255,255) (255,255;255,0;255,255) (255,255;255,255;255,0) r[-3--1] 256,3,1,1,3 +a[0,-3] y a[1,-2] y a[2,-1] y" +elif ['"$1"']=='cmyk' +_color0="180,255,255" _color1="255,180,255" _color2="255,255,100" _color3="180,180,180" _color4="220,220,220" +_title0=Cyan _title1=Magenta _title2=Yellow _title3=Key _title4=Alpha +m "xcc_goto: s c,-3 rgb2cmyk[0] a c" m "xcc_backto: s c,-4 cmyk2rgb[0] a c" +m "xcc_info: (255,0;255,255;255,255) (255,255;255,0;255,255) (255,255;255,255;255,0) (255,0) r[-4--1] 256,3,1,1,3 +a[0,-4] y a[1,-3] y a[2,-2] y a[3,-1] y" +elif ['"$1"']=='hsi' +_color0="255,220,220" _color1="220,220,220" _color2="180,180,180" _color3="220,220,220" +_title0=Hue _title1=Saturation _title2=Intensity _title3=Alpha +m "xcc_goto: s c,-3 rgb2hsi8[0] a c" m "xcc_backto: s c,-3 hsi82rgb[0] a c" +m "xcc_info: 256,1,1,3,if(!c,x,128) 256,1,1,3,if(!c,0,if(c==1,x,128)) 256,1,1,3,if(!c,0,if(c==1,0,x)) +hsi82rgb[-3--1] permute[-3--1] xcyz a[0,-3] y a[1,-2] y a[2,-1] y" +elif ['"$1"']=='hsl' +_color0="255,220,220" _color1="220,220,220" _color2="180,180,180" _color3="220,220,220" +_title0=Hue _title1=Saturation _title2=Lightness _title3=Alpha +m "xcc_goto: s c,-3 rgb2hsl8[0] a c" m "xcc_backto: s c,-3 hsl82rgb[0] a c" +m "xcc_info: 256,1,1,3,if(!c,x,128) 256,1,1,3,if(!c,0,if(c==1,x,128)) 256,1,1,3,if(!c,0,if(c==1,0,x)) +hsl82rgb[-3--1] permute[-3--1] xcyz a[0,-3] y a[1,-2] y a[2,-1] y" +elif ['"$1"']=='hsv' +_color0="255,220,220" _color1="220,220,220" _color2="180,180,180" _color3="220,220,220" +_title0=Hue _title1=Saturation _title2=Value _title3=Alpha +m "xcc_goto: s c,-3 rgb2hsv8[0] a c" m "xcc_backto: s c,-3 hsv82rgb[0] a c" +m "xcc_info: 256,1,1,3,if(!c,x,255) 256,1,1,3,if(!c,0,if(c==1,x,128)) 256,1,1,3,if(!c,0,if(c==1,0,x)) +hsv82rgb[-3--1] permute[-3--1] xcyz a[0,-3] y a[1,-2] y a[2,-1] y" +elif ['"$1"']=='lab' +_color0="180,180,180" _color1="220,180,220" _color2="220,220,180" _color3="220,220,220" +_title0=Lightness _title1=Chroma-A _title2=Chroma-B _title3=Alpha +m "xcc_goto: s c,-3 srgb2rgb[0] apo[0] rgb2lab8,0,4 a c" m "xcc_backto: s c,-3 apo[0] lab82rgb,0,4 rgb2srgb[0] a c" +m "xcc_info: 256,1,1,3,if(!c,x,128) 256,1,1,3,if(!c,240,if(c==1,x,128)) 256,1,1,3,if(!c,240,if(c==1,128,x)) +lab82rgb[-3--1] permute[-3--1] xcyz a[0,-3] y a[1,-2] y a[2,-1] y" +elif ['"$1"']=='lch' +_color0="180,180,180" _color1="220,180,220" _color2="255,220,220" _color3="220,220,220" +_title0=Lightness _title1=Chroma _title2=Hue _title3=Alpha +m "xcc_goto: s c,-3 srgb2rgb[0] apo[0] rgb2lch8[0],0,4 a c" m "xcc_backto: s c,-3 apo[0] lch82rgb[0],0,4 +rgb2srgb[0] a c" +m "xcc_info: 256,1,1,3,if(!c,x,0) 256,1,1,3,if(!c,255,if(c==1,x,128)) 256,1,1,3,if(!c,220,if(c==1,128,x)) +lch82rgb[-3--1] permute[-3--1] xcyz a[0,-3] y a[1,-2] y a[2,-1] y" +elif ['"$1"']=='ycbcr' +_color0="180,180,180" _color1="220,220,255" _color2="255,220,220" _color3="220,220,220" +_title0=Luma _title1=Blue\ chroma _title2=Red\ chroma _title3=Alpha +m "xcc_goto: s c,-3 rgb2ycbcr[0] a c" m "xcc_backto: s c,-3 ycbcr2rgb[0] a c" +m "xcc_info: 256,1,1,3,if(!c,x,128) 256,1,1,3,if(!c,128,if(c==1,x,128)) 256,1,1,3,if(!c,128,if(c==1,128,x)) +ycbcr2rgb[-3--1] permute[-3--1] xcyz a[0,-3] y a[1,-2] y a[2,-1] y" +else error[0--3] "Command 'x_color_curves': Unknown specified color space '$1'." +fi +#@cli x_colorize : _is_lineart={ 0 | 1 },_max_resolution={ 0 | >=128 },_multichannels_output={ 0 | 1 },_[palette1],_[palette2],_[grabber1] +#@cli : Colorized selected B&W images, using an interactive window. +#@cli : When >0, argument 'max_resolution' defines the maximal image resolution used in the interactive window. +#@cli : Default values: 'is_lineart=1', 'max_resolution=1024' and 'multichannels_output=0'. +x_colorize : skip ${1=0},${3=0},${4=0},${5=0},${6=0} check "${2=1024}==0 || $2>=128" check_display $0 +s0="image" s1="lineart" s2="multichannel" s3="merged" use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e[^-1] "Colorize selected B&W "${s{!$1}}"$? interactively, with maximum resolution $2 and "${s{2+!$3}}" output." +e "\n +--------------------------------------------------------------------------------------\n +----\n +---- "${c}"Left mouse button"$n" creates a new colored control point (or moves an existing one).\n +---- "${c}"Right mouse button"$n" or key '"${c}"X"$n"' over a control point deletes it.\n +---- "${c}"Right mouse button"$n" or key '"${c}"P"$n"' anywhere else picks a color from the image.\n +---- "${c}"Mouse wheel"$n", or keys '"${c}"CTRL+arrows UP/DOWN"$n"' zoom view in/out.\n +---- '"${c}"CTRL+mouse wheel"$n"', '"${c}"SHIFT+mouse wheel"$n"' or "${c}"arrow keys"$n" move image in zoomed view.\n +---- Key '"${c}"SPACE"$n"' updates the extrapolated color field.\n +---- Key '"${c}"TAB"$n"' toggles between markers view modes.\n +---- Key '"${c}"BACKSPACE"$n"' deletes the last control point added.\n +---- Key '"${c}"PAGE UP"$n"' increases image contrast.\n +---- Key '"${c}"PAGE DOWN"$n"' decreases image contrast.\n +---- Key '"${c}"R"$n"' toggles color replace mode.\n +---- Keys '"${c}"CTRL+D"$n"' increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' decrease window size.\n +---- Keys '"${c}"CTRL+R"$n"' reset window size.\n +---- Keys '"${c}"ESC"$n"', '"${c}"Q"$n"' or '"${c}"ENTER"$n"' exit the interactive window.\n +----\n +--------------------------------------------------------------------------------------" +N=$! +thread_main="_x_colorize[0] ${1--1}" +thread_color="w[] 400,320,0,\"Palette: main\" x_select_color[] __color,255,255,255" +is_palette1=${"is_image_arg[] $4"} +if $is_palette1 +pass$4 1 ('{b}') discard. {'~'} palette_title1={t} rm. +thread_palette1="w[] 400,400,0,\"Palette: "$palette_title1"\" x_select_palette["{$!-1}"] __color" +fi +is_palette2=${"is_image_arg[] $5"} +if $is_palette2 +pass$5 1 ('{b}') discard. {'~'} palette_title2={t} rm. +thread_palette2="w[] 400,400,0,\"Palette: "$palette_title2"\" x_select_palette["{$!-1}"] __color" +fi +is_grabber=${"is_image_arg[] $6"} +if $is_grabber +pass$6 1 ('{b}') discard. {'~'} palette_grabber={t} rm. +thread_grabber="w[] ${\"fitscreen[] {[w,h,1]},128,50%\"},0,\"Grabber: "$palette_grabber"\" +x_grab_color["{$!-1}"] __color" +fi +__color=255,255,255 +if !$is_palette1" && "!$is_palette2" && "!$is_grabber +foreach[0-{$N-1}] { parallel $thread_main,$thread_color } +else +repeat $N { l[$>,$N--1] { +parallel $thread_main,$thread_color,$thread_palette1,$thread_palette2,$thread_grabber +} } +fi +k[0-{$N-1}] +_x_colorize : +name={n} title={b} if narg({x}) title=$title.{x} fi +w={w} h={h} +if $1 +if s==4 sh. 3 if abs(im-iM)>64 +*. -1 rm.. +. 255 else rm. sh. 0 fi +else sh. 0 +fi +n 0,255 +else +if s==1 sh. 0 +else +luminance. +fi +fi +=> img +fdim=${fitscreen[]\ $w,$h} ww={arg(1,$fdim)} wh={arg(2,$fdim)} x0=0 y0=0 x1={w-1} y1={h-1} +selection=-1 view_markers=2 contrast=9 xpan=-1 ypan=-1 replace_color= current_replace_color= +if narg($_gui_control_points)>=6 +($_gui_control_points) r. {w/6},6,1,1,-1 +else 0 +fi +=> points +if $2>0 if $w>$h +r2dx[img] {min($2,$w)},2 else +r2dy[img] {min($2,$h)},2 fi else [img] fi +__x_colorize. $1 +pw={potential,w} ph={potential,h} +do +if narg($replace_color)" && "{*,x}<0" && "{*,y}<0 wait 200 else wait fi +x={*,x} y={*,y} b={*,b} o={*,-o} +is_ctrl={{*,CTRLLEFT}" || "{*,CTRLRIGHT}} +is_shift={{*,SHIFTLEFT}" || "{*,SHIFTRIGHT}} +is_mouseout={$x<0" || "$y<0} +x={$x0+$x*($x1-$x0+1)/$ww} y={$y0+$y*($y1-$y0+1)/$wh} +oww=$ww owh=$wh ox0=$x0 oy0=$y0 ox1=$x1 oy1=$y1 +if {*,r} +nww={*,d} nwh={*,e} m={min($nww,$nwh)} +cx={($x0+$x1)/2} cy={($y0+$y1)/2} dx={$nww*($x1-$x0+1)/$ww} dy={$nwh*($y1-$y0+1)/$wh} +x0={$cx-$dx/2} x1={$cx+$dx/2} +y0={$cy-$dy/2} y1={$cy+$dy/2} +ww=$nww wh=$nwh +elif $is_ctrl" && "{*,-D} +nww={min({*,u},$ww*1.25)} nwh={min({*,v},$wh*1.25)} m={min($nww,$nwh)} +if $m==$nww ww=$m wh={$h*$m/$w} else ww={$w*$m/$h} wh=$m fi +elif $is_ctrl" && "{*,-C} +nww={$ww/1.25} nwh={$wh/1.25} +if min($nww,$nwh)>=64 ww=$nww wh=$nwh fi +elif $is_ctrl" && "{*,R} +fdim=${fitscreen[]\ $w,$h} ww={arg(1,$fdim)} wh={arg(2,$fdim)} +x0=0 y0=0 x1={$w-1} y1={$h-1} +elif ($is_shift" && "$o<0)" || "{*,ARROWLEFT} +dx={($x1-$x0)/6} x0-=$dx x1-=$dx +elif ($is_shift" && "$o>0)" || "{*,ARROWRIGHT} +dx={($x1-$x0)/6} x0+=$dx x1+=$dx +elif ($is_ctrl" && "$o>0)" || "({*,ARROWUP}" && "!$is_ctrl) +dy={($y1-$y0)/6} y0-=$dy y1-=$dy +elif ($is_ctrl" && "$o<0)" || "({*,ARROWDOWN}" && "!$is_ctrl) +dy={($y1-$y0)/6} y0+=$dy y1+=$dy +elif $o>0" || "($is_ctrl" && "{*,ARROWUP}) +if $x1-$x0>16" && "$y1-$y0>16 +cx={if($x>=0" && "!{*,ARROWUP},$x,($x0+$x1)/2)} +cy={if($y>=0" && "!{*,ARROWUP},$y,($y0+$y1)/2)} +x0={$cx+($x0-$cx)*0.75} y0={$cy+($y0-$cy)*0.75} +x1={$cx+($x1-$cx)*0.75} y1={$cy+($y1-$cy)*0.75} +fi +elif $o<0" || "($is_ctrl" && "{*,ARROWDOWN}) +zfactor={max(($x1-$x0+1)/$w,($y1-$y0+1)/$h)} +if $zfactor<1.3 +cx={if($x>=0" && "!{*,ARROWDOWN},$x,($x0+$x1)/2)} +cy={if($y>=0" && "!{*,ARROWDOWN},$y,($y0+$y1)/2)} +x0={$cx+($x0-$cx)/0.75} y0={$cy+($y0-$cy)/0.75} +x1={$cx+($x1-$cx)/0.75} y1={$cy+($y1-$cy)/0.75} +dx={$zfactor^2*($w-$x0-$x1)/2} dy={$zfactor^2*($h-$y0-$y1)/2} +x0+=$dx x1+=$dx y0+=$dy y1+=$dy +else +dx={($w-$x0-$x1)/2} dy={($h-$y0-$y1)/2} +x0+=$dx x1+=$dx y0+=$dy y1+=$dy +fi +elif $b&4" && "!$is_mouseout +if $panx<0" && "$pany<0 panx=$x pany=$y +else dx={round($panx-$x)} dy={round($pany-$y)} x0+=$dx y0+=$dy x1+=$dx y1+=$dy +fi +else panx=-1 pany=-1 +fi +if $ww!=$oww" || "$wh!=$owh" || "$ox0!=$x0" || "$oy0!=$y0" || "$ox1!=$x1" || "$oy1!=$y1 rm[baseview] fi +N={points,w} +if narg($baseview)" && "($b&3" || "{*,X}" || "{*,P})" && "$x>=0" && "$y>=0" && "$x<$w" && "$y<$h +if $selection==-1" && "$N +($x;$y) r. $N,2 -. [points] *. {max($ww,$wh)/max($x1-$x0,$y1-$y0)} sqr. s. y +[-2,-1] +dmin={im} selection={if($dmin>25,-1,xm)} rm. +fi +if narg($replace_color) +replace_color= wait -1 +elif $selection>=0 +if $b&1" && "$view_markers ++columns[points] $selection ox={i[0]} oy={i[1]} =. $x =. $y,0,1 j[points] .,$selection rm. +rm[view] +elif ($b&2" || "{*,X})" && "$view_markers +if $N>1 +z[points] {$selection+1},100% j[points] .,$selection rm. r[points] {$N-1},100%,1,1,0 +else rm[points] 0 => points fi +wait -1 rm[view] +fi +elif $b&1 +($x;$y;0) ($__color) y. y +. 1 a[-2,-1] y a[points,-1] x selection=$N +if !$view_markers view_markers=2 fi +rm[view] +elif $b&2" || "{*,P} +__color={colors,I($x*$pw/$w,$y*$ph/$h)} +fi +else selection=-1 +if {*,-SPACE}" && "narg($colors) replace_color= rm[colors] +elif {*,-TAB} view_markers={($view_markers-1)%3} rm[view] wait -1 +elif !$is_ctrl" && "{*,-R} +if narg($replace_color) replace_color= else replace_color=$__color fi +rm[baseview] wait -1 +elif {*,PAGEDOWN} contrast={max(0,$contrast-1)} rm[view] wait -1 +elif {*,PAGEUP} contrast={min(9,$contrast+1)} rm[view] wait -1 +elif {*,BACKSPACE}" && "$N +if $N>1 z[points] 0,{$N-2} else i=$points rm[points] i[$i] 0 =>[$i] points fi +rm[view] wait -1 +fi +fi +w2={round(($x1-$x0)/2)} h2={round(($y1-$y0)/2)} +if $x0<-$w2 x1-={$x0+$w2} x0=-$w2 fi +if $y0<-$h2 y1-={$y0+$h2} y0=-$h2 fi +if $x1>=$w+$w2 x0+={$w-1+$w2-$x1} x1={$w-1+$w2} fi +if $y1>=$h+$h2 y0+={$h-1+$h2-$y1} y1={$h-1+$h2} fi +if !narg($colors) +N={points,w} +if narg($view) to[view] "Processing...",5,5,20,2 w[view] fi +if $N +[points] +sh. 0,0,0,0 *. {$pw/$w} rm. +sh. 1,1,0,0 *. {$ph/$h} rm. +pointcloud. -1,$pw,$ph ++compose_channels. max !=. 0 distance. 1 *. 0.02 +. 1 ^. -1 +. [potential] +if !$1 dilate.. 3 fi +watershed.. . rm. -. 1 +else [potential],[potential],1,3,255 +fi +=> colors +if narg($baseview) rm[baseview] fi +fi +if !narg($replace_color)" && "narg($points_replaced) +rm[points,colors,view] =>[colors_replaced] colors =>[points_replaced] points current_replace_color= +elif narg($replace_color)" && "['$__color']!=['$current_replace_color'] +if narg($colors_replaced) rm[colors_replaced,points_replaced] fi +current_replace_color=$__color +if {points,w} ++replace_color[colors] 0,0,$replace_color,$current_replace_color ++rows[points] 3,5 permute. xzcy -. 1 +replace_color. 0,0,$replace_color,$current_replace_color ++. 1 permute. xcyz +j[points] .,0,3 rm.. +else 0 0 +fi +=> colors_replaced,points_replaced +if narg($baseview) rm[baseview] fi +fi +if !narg($baseview) +nx0={$x0*$pw/$w} ny0={$y0*$ph/$h} +nx1={$x1*$pw/$w} ny1={$y1*$ph/$h} ++z[img] $x0,$y0,$x1,$y1 +r. $ww,$wh,1,100%,{if($ww baseview +if narg($view) rm[view] fi +fi +if !narg($view) +[baseview] r. 100%,100%,1,3 +if $contrast<9 /. {10-$contrast} +. {128*(1-1/(10-$contrast))} fi +if $view_markers +if $view_markers==2 rad1=5 rad2=3 else rad1=3 rad2=2 fi +if narg($replace_color)" && "{points,w} ipoints=$points_replaced else ipoints=$points fi +repeat w#$ipoints { ++columns[$ipoints] $> +x={(i[0]-$x0)*$ww/(1+$x1-$x0)} +y={(i[1]-$y0)*$wh/(1+$y1-$y0)} +col={i[3]-1},{i[4]-1},{i[5]-1} +rm. +circle. $x,$y,$rad1,1,0 circle. $x,$y,$rad2,1,$col +} +fi +if narg($replace_color) +to. "Replace by",5,5,20,2 +rectangle. 80,8,111,25,1,0 rectangle. 82,10,109,23,1,$replace_color +rectangle. 150,8,181,25,1,0 rectangle. 152,10,179,23,1,$current_replace_color +fi +=> view +w[view] $ww,$wh,0,$title +fi +while {*}" && "!{*,ESC}" && "!{*,Q}" && "!{*,ENTER} +if narg($view) to[view] "Processing fullres...",5,5,20,2 w[view] fi +k[0,img,points] +N={points,w} status= +if $N +status={points,^} +[img] __x_colorize. $1 +pointcloud[points] -1,$w,$h ++compose_channels[points] max !=. 0 distance. 1 *. 0.02 +. 1 ^. -1 +[potential,-1] +if !$1 zfact={{img,max(w,h)}/{potential,max(w,h)}} dilate[points] {int(3*$zfact)} fi +watershed[points] [potential] -[points] 1 =>[points] colors +else [img],[img],1,3,255 => colors +fi +if $3 +k[0,colors] a c +else +k[0,img,colors] +if $1 +*[img] -1 +. 255 channels. -3,0 blend[colors,-1] alpha rm[0,img] +else rgb2ycbcr[colors] j[colors] [img],0,0,0,0 rm[0,img] ycbcr2rgb[colors] +fi +fi +a c => $name +__color=-1 +u $status +w 0 +__x_colorize : +if $1 +n. 0,1 ^. 5 repeat 4 { +b. 0.5% min } +else +gradient_norm. n. 0,255 normalize_local. 3,3 *. -1 n. 0,255 +b. 0.05% n. 0,1 sqr. +b. 0.5% n[-2,-1] 0,1 min[-2,-1] +fi +=> potential +#@cli x_connect4 +#@cli : Launch the Connect Four game. +x_connect4 : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Connect Four"$n" --------------------------------------------\n +----\n +---- Connect four tokens in a row, column or diagonally\n +---- to win the game.\n +----\n +---- "${c}"Left mouse button"$n" on a column inserts a new token.\n +---- Keys '"${c}"SPACE"$n"' or '"${c}"ENTER"$n"' lets the computer play the turn\n +---- (or restart game when it's over).\n +---- Key '"${c}"ENTER"$n"' also enables autoplay for the current player.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' close the window.\n +----\n +----------------------------------------------------------------" +l[] { +7,6 => board +R={board,u={*,u};v={*,v};int(0.5*min(u/w,v/h))} +{2*$R},{2*$R} circle. 50%,50%,32%,1,1 b. 2% g. xy +[-2,-1] n. 0,1 ++n. -1,0.5 abs. negate. +f. 200 rv[-3--1] a[-3--1] c hsv2rgb. +to_rgba. circle. 50%,50%,27%,1,0 +{4*$R},{4*$R} circle. 50%,50%,20%,1,1 b. 1% g. xy +[-2,-1] n. 0,1 negate. +sqrt. +n. -1,0.8 abs. negate. +f. 10 rv[-3--1] a[-3--1] c +. sh. 0 f. 60 rm. hsv2rgb[-2,-1] +100%,100% circle. 50%,50%,30%,1,255 a[-3,-2] .,c rm. +r2dx[-3--1] $R s[-3--1] c,-3 rm... +n[^0] 0,255 round[^0] =>[^0] cache,cachem,token0,token1,tokenm ++b[cachem] 2% shift. 1%,1%,0,0,2 max[cachem,-1] +r[cache,cachem] 100%,{board,h*100}%,1,100%,0,2 +evalf="const op = 3 - p; +case(dx,dy) = ( +pgood = pbad = 0; +for (k = -2, k<2, ++k, +X = x + k*dx; +Y = y + k*dy; +if (X>=0 && X=0 && Y=0 && val==op, pgood = -1, pgood+=!!val); +if (pbad>=0 && val==p, pbad = -1, pbad+=!!val); +); +); +pgood = arg(2 + pgood,0,1,2,4,100,1e8); +pbad = arg(2 + pbad,0,1,2,4,10000,1e8); +pgood - pbad; +); +case(1,0) + case(0,1) + case(1,1) + case(1,-1)" +do +if !narg($visu) +{board,[w,h]*$R},1,3,64 +repeat h#$board { y=$> +repeat w#$board { x=$> +val={board,i($x,$y)} if $val j. [token{$val-1}],{$x*$R},{$y*$R},0,0,1,[tokenm],255 fi +} +} ++r[cache,cachem] {board,[w,h]*$R},1,100%,0,2 a[-2,-1] c blend[-2,-1] alpha +=> visu w[visu] 100%,100%,0,"[G'MIC] Connect Four" +turn=0 is_falling=0 x=-1 yv=0 dyv=0 winner= +autoplayer0=0 autoplayer1=0 +fi +if !narg($ymax) +{board,w},1,1,1,"y = -1; repeat (h#"$board",k, if(!i(#"$board",x,k),y = k)); y" => ymax +if iM<0 winner=-1,-1,-1 fi +fi +if narg($winner) +[visu] => tmpvisu +x={arg(1,$winner)} y={arg(2,$winner)} c={arg(3,$winner)} +if $x<0 +if !narg($text) +0 t. "Draw game",0,0,57,1,1 r2dx. {tmpvisu,w/2} expand_xy. 3,0 +dilate. 5 n.. 0,255 to_rgb.. +=> text,textm +fi +j[tmpvisu] [text],{tmpvisu,([w,h]-[w#$text,h#$text])/2},0,0,{0.7+0.3*sin(5*$|)},[textm] +else +repeat 4 { +[token$turn] +rgb2hsv. sh. 1,2 +. {0.4*sin(5*$|)} c. 0,1 rm. hsv2rgb. +j. [cache],0,0,0,0,1,[cachem],255 +j[tmpvisu] .,{$R*[$x,$y]},0,0,1 rm. +x+={$c!=2?1:0} y+={$c==1?0:$c==4?-1:1} +} +fi +w[tmpvisu] 100%,100% rm[tmpvisu] wait 20 +if {*,-SPACE}" || "{*,-ENTER} +rm[visu,ymax] f[board] 0 winner= +fi +elif !$is_falling +if !${autoplayer$turn} +x={visu,X={*,x};X<0?X:int(X*w#$board/w)} +yM={i("#"$ymax,$x)} +if {board,$x<0" || "$x>=w} w[visu] 100%,100% +else +[visu] $R,100%,1,3,($yM>=0?1:0)*($turn?[255,255,0]:[255,0,0]) +j.. .,{$x*$R},0,0,0,{$yM>=0?0.15:0.3} rm. +w. 100%,100% rm. +fi +wait +fi +if {*,-b}&1" && "$yM>=0" && "$x>=0 is_falling=1 yv=0 dyv=1 +elif ${autoplayer$turn}" || "{*,-SPACE}" || "{*,ENTER} +if {*,-ENTER} autoplayer$turn=1 fi +max_score=-inf max_col= +repeat w#$board { move1=$> +yM1={i("#"$ymax,$move1)} +if $yM1>=0 ++=[board] {1+$turn},$move1,$yM1 => board1 +{board,w},1,1,1,"y = -1; repeat (h#"$board1",k, if(!i(#"$board1",x,k),y = k)); y" => ymax1 +opp_max_score=-inf opp_max_board={board,^} +opp_turn={($turn+1)%2} +repeat w#$board { move2=$> +yM2={i("#"$ymax1,$move2)} +if $yM2>=0 ++=[board1] {1+$opp_turn},$move2,$yM2 ++f. "const p = 1 + "$opp_turn"; "$evalf score={is+u} rm. +if $score>$opp_max_score opp_max_score=$score opp_max_board={^} fi +rm. +fi +} +rm[board1,ymax1] +{board,[w,h,1,1]},$opp_max_board +f. "const p = 1 + "$turn"; "$evalf score={is+u} rm. +if $score>$max_score max_score=$score max_col=$move1 fi +fi +} +x=$max_col is_falling=1 yv=0 dyv=1 +fi +else +if !narg($column) +$R,{board,h*$R},1,3,64 +repeat h#$board { v={board,i($x,$>)} if $v j. [token{$v-1}],0,{$>*$R},0,0,1,[tokenm],255 fi } +=> column +fi +yM={i("#"$ymax,$x)} +[column] +j. [token$turn],0,$yv,0,0,1,[tokenm],255 +j. [cache],0,0,0,0,1,[cachem],255 +[visu] => tmpvisu +j[tmpvisu] ..,{$R*$x},0,0,0 rm.. w[tmpvisu] 100%,100% +if $yv>=$yM*$R +j[visu] [tmpvisu] is_falling=0 +=[board] {$turn+1},$x,$yM +rm[ymax,column] ++f[board] "if (!i,0, +case_h = i==j(1) && i==j(2) && i==j(3); +case_v = i==j(0,1) && i==j(0,2) && i==j(0,3); +case_d1 = i==j(1,1) && i==j(2,2) && i==j(3,3); +case_d2 = i==j(1,-1) && i==j(2,-2) && i==j(3,-3); +case_h?1:case_v?2:case_d1?3:case_d2?4)" +if iM winner={[xM,yM,i(xM,yM)]} +else turn={($turn+1)%2} +fi +rm. +fi +rm[tmpvisu] +yv={min($yM*$R,$yv+$dyv)} dyv+={visu,h/100} +wait 20 +fi +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w 0 } +#@cli xz : eq. to 'x_crop' +xz : +_gmic_s="$?" v + _x_crop +#@cli x_crop +#@cli : Crop selected images interactively. +#@cli : (eq. to 'xz'). +x_crop : +_gmic_s="$?" v + _$0 +_x_crop : +e[0--3] "Crop image"$_gmic_s" interactively." +foreach { +w ${"fitscreen "{[w,h,d]}},1,"[G'MIC] "{n}" - Interactive crop" ++select 2,{round([w,h,d]/2)},0,1 u={^} z.. $u rm. +w[] 0 is_change +} +u $u +#@cli x_cut +#@cli : Cut selected images interactively. +x_cut : +e[^-1] "Cut image"$_gmic_s" interactively." +foreach { +wsiz0=${"fitscreen ."} +value0,value1=-1,-1 +w[] $wsiz0,0,"[G'MIC] "{n}" - Interactive cut" +0 +for {*}" && "!{*,ESC} { +if [w#1,h#1]!=[{*,w,h}] # Generate image view +rm[1] +slices[0] 50% r. {*,w,h},1,100%,1 w. +fi +mx,my,mb={*,x,y,b} +if $mb" && "$mx>=0" && "$my>=0 +value0,value1={"dw1 = "{*,w}" - 1; value0 = "$mx"*100/dw1; +dh1 = "{*,h}" - 1; value1 = "$my"*100/dh1; +[ value0,value1 ];"} +update_view=1 +fi +if $update_view +if $value0>=0" && "$value1>=0 ++c[1] $value0%,$value1% n. 0,255 +to. "Min: "{_round($value0,0.1)}%"\n""Max: "{_round($value1,0.1)}%,1%,1%,{max(13,3.5*h%)} +w. rm. +else w. +fi +update_view=0 +fi +wait +if {*,r} update_view=1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,D} +w[] {{*,w}*1.5},{{*,h}*1.5} wait -1 update_view=1 +fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,C} +w[] {{*,w}/1.5},{{*,h}/1.5} wait -1 update_view=1 +fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,R} +w[] $wsiz0 wait -1 update_view=1 +fi +} +w[] 0 rm. u $value0%,$value1% c ${} +} +#@cli x_fire +#@cli : Launch the fire effect demo. +x_fire : skip "${1=}" check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Fire effect"$n" ------------------------\n +----\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-------------------------------------------" +if "['$1']==0" label="G\47MIC" is_fps=1 else label="$1" is_fps=0 fi +i[0] 100,32 w[0] {[4.5*w,6.75*h]},0,"[G"{`39`}"MIC] Fire Effect" +if {*,w}<0.5*{*,u} w[] {[{*,w},{*,h}]*1.5} fi +i[1] (0,255,255,255,255^0,0,255,255,255^0,0,0,128,255) r[1] 256,1,1,3,3 +i[2] (0,0,0;0,0,0;1,1,1;0,1,0) *[2] 0.21 +text3d $label,33,3,1 +mv. 3 c3d[3] n3d[3] *3d[3] 320 col3d[3] 255,205,130 db3d 0 f3d 300 +100,100 rand. 0,255 ellipse. 50%,50%,5,5,0,1,300 b. 10 +sharpen. 1000 shrink_xy. 1 n. 0,255 to_rgb. light3d . rm. +angle=0 +do +correlate[0] [2] +{0,w},1 rand. 128,256 j[0] .,0,{{0,h}-1} rm. ++r[0] 400,200,1,1,3 map. [1] ++r3d[3] 0,1,0,$angle j3d.. .,50%,50%,0,1,5,0,0 +*3d. 0.25,0.16,1 j3d[0] .,50%,50%,0,1,3,0,0 +rm. +angle+=3 +if $is_fps +fps=${-fps} if $fps>0 to. $fps" fps",5,{h-22},16,1,0.2 fi +fi +w. +if {*,CTRLLEFT}" && "{*,D} w[] {1.5*[w,h]} elif {*,CTRLLEFT}" && "{*,C} w[] {[w,h]} fi +rm. wait 40 +while {*}" && "!{*,ESC}" && "!{*,Q} +rm[0-3] w 0 +#@cli x_fireworks +#@cli : Launch the fireworks demo. +x_fireworks : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Fireworks"$n" --------------------------\n +----\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------" +l[] { +(16;64^64;32^128;32) r 320,160,1,3,3 +. +w. ${"fitscreen .,35%"},0,"[G"{`39`}"MIC] Fireworks" +time=0 +do +time-=1 +if $!==2\ ||\ $time<0 +i[0] ({u(w)},\ +{h},\ +{u(-3,3)},\ +{u(2)-5},\ +{30+u(20)},\ +1.5,\ +255,255,255) +time={u(20)} +fi +*. 0.99 +j. ..,0,0,0,0,0.2 +i=0 +repeat $!-2 { +to_be_removed=0 +radius={if({$i,@4}>0,{$i,@5}/3,{$i,@5}*(1+2*({$i,@4}+2)/120))} +ellipse. {$i,@0},{$i,@1},{$i,@5},{max(1,$radius)},{atan2({$i,@3},{$i,@2})*180/pi},0.6,{$i,@6-8} +({$i,@2},{$i,@3},0,0.09,-1,0,0,0,0) +[$i,-1] +if {$i,@0}<0\ ||\ {$i,@0}>=w\ ||\ {$i,@1}>=h\ ||\ $radius<0 to_be_removed=1 fi +if {$i,@4}<0\ &&\ {$i,@4}>=-1 +color={min(255,80+u(200))},{min(255,80+u(200))},{min(255,80+u(200))} +radius={u(10)} +N={5+u(10)} +repeat $N { +angle={$>*2*pi/$N} +i... ({$i,@0,1},{2*cos($angle)+{$i,@2}/1.5},{2*sin($angle)+{$i,@3}/1.5},-2,$radius,$color) +} +to_be_removed=1 +fi +if $to_be_removed rm[$i] else i+=1 fi +} +fps=${-fps} if $fps>0 to. $fps" fps",3,{h-20},14,1,0.2 fi +w. wait 20 +if {*,CTRLLEFT}" && "{*,D} w[] {3*w},{3*h} elif {*,CTRLLEFT}" && "{*,C} w[] {1.5*w},{1.5*h} fi +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w 0 } +#@cli x_fisheye +#@cli : Launch the fish-eye effect demo. +x_fisheye : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Fish-eye effect"$n" --------------------\n +----\n +---- "${c}"Mouse pointer"$n" moves fish-eye center.\n +---- "${c}"Mouse buttons"$n" set fish-eye size.\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-------------------------------------------" +if $!>0 a x n 0,255 r2dy 220 else +120,90,1,3 rand. 0,255 plasma. 0.3,3 n 0,255 +t " G\47MIC\nFISH-EYE\n EFFECT",20,13,23,1,255 scale3x b 5 sharpen 1000 +f i+150-3*abs(y-h/2) c. 0,255 frame_fuzzy. 15,10,15,1.5,0 to_rgb. +fi +torus3d 20,6 col3d. {u(30,255)},{u(30,255)},{u(30,255)} +r3d. 1,0,0,90 +col3d. {u(30,255)},{u(30,255)},{u(30,255)} +3d. 15 +3d[-2,-1] *3d. 4 db3d 0 c3d. +R=30 +w.. {1.25*{-2,w}},{1.25*{-2,h}},0,"[G"{`39`}"MIC] Fish-Eye Effect" +do +wait 40 +if {*,b}==1 R={min(80,$R+8)} fi +if {*,b}==2 R={max(3,$R-8)} fi ++j3d.. .,{50+30*cos($|*2.5)}%,{50+30*sin($|*1.6)}%,{80+230*sin($|*2.6)},0.7,3,0,0 r3d.. 1,0.2,0.6,3 +if {*,x}>=0 +fisheye. {{*,x}*100/{*,w}},{{*,y}*100/{*,h}},$R +fi +w. +if {*,CTRLLEFT}" && "{*,D} w[] {3*w},{3*h} elif {*,CTRLLEFT}" && "{*,C} w[] {1.5*w},{1.5*h} fi +rm. +if {*}==0" || "{*,ESC}" || "{*,Q} rm[-2,-1] w 0 return fi +while 1 +#@cli x_fourier +#@cli : Launch the fourier filtering demo. +x_fourier : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Fourier-filtering"$n" ----------------------------------------\n +----\n +---- "${c}"Mouse buttons"$n" on the right image to set min/max frequencies.\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to decrease window size.\n +---- Keys '"${c}"CTRL+R"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-----------------------------------------------------------------" +if !$! sp ? r2dx 400 fi +foreach { +need_update=1 +freqmin=0 +freqmax=100 +if w>3*{*,u}/5 r2dx. {3*{*,u}/10} fi +if h>3*{*,v}/5 r2dy. {3*{*,v}/5} fi ++fft. => real,imag ++sqr[real,imag] +[-2,-1] sqrt. +. 1 log. +n. 0,255 shift. {round(w/2)},{round(h/2)},0,0,2 to_colormode. {-2,s} +=> logmag ++r2dy. 128 frame. 1,1,0 => thumb +w[0,-2] -1,-1,0,"[G"{`39`}"MIC] Fourier Filtering" +l { +if !narg($first_time) +parallel 0,"alert[thumb] \"[G"{`39`}"MIC Fourier Filtering]\",\"The G\47MIC Fourier filtering demo illustrates the effect\nof bandpass frequency filtering on an image. Use your mouse\nbuttons to select low and high bounds for the frequencies\ndisplayed on the Fourier representation of the image\n(right image).\",\"OK\"" +first_time=0 +fi +do +if $need_update +[logmag],[logmag] => mask +r={sqrt(w^2+h^2)*$freqmax/200} ellipse[mask] 50%,50%,$r,$r,0,1,1 +r={max(0,sqrt(w^2+h^2)*$freqmin/200-1)} if $r ellipse[mask] 50%,50%,$r,$r,0,1,0 fi ++*[logmag] [mask] +. [mask] /. 2 n. 0,255 +shift[mask] -{mask,round(w/2)},-{mask,round(h/2)},0,0,2 ++*[real,imag] [mask] +rm[mask] +ifft[-2,-1] rm. n. 0,255 +rv[-2,-1] +if {*} r[-2,-1] {{*,w}/2},{*,h} fi +t. "Freq. Min/Max = "{int($freqmin)}"% / "{int($freqmax)}"%",5,5,13,1,255 +w[-2,-1] rm[-2,-1] +need_update=0 +fi +wait +if {*,b}" && "{*,x}>={*,w}/2 +r={200*sqrt(({*,x}-3*{*,w}/4)^2+({*,y}-{*,h}/2)^2)/\ +sqrt(({*,w}/2)^2+{*,h}^2)} +if {*,b}&1 freqmax=$r +else freqmin={max(0,$r-3)} +fi +if $freqmin>=$freqmax freqmin=$freqmax fi +need_update=1 +fi +if {*,r} need_update=1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,D} w[] {{*,w}*1.5},{{*,h}*1.5} need_update=1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,C} w[] {{*,w}/1.5},{{*,h}/1.5} need_update=1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,R} w[] {2*{0,w}},{0,h} need_update=1 fi +while {*}" && "!{*,ESC}" && "!{*,Q} +w 0 +} +rm[^0] +} rm +#@cli x_grab_color : _variable_name +#@cli : Open a color grabber widget from the first selected image. +#@cli : Argument 'variable_name' specifies the variable that contains the selected color values at any time. +#@cli : Assigning '-1' to it forces the interactive window to close. +#@cli : Default values: 'variable_name=xgc_variable'. +x_grab_color : skip ${1=xgc_variable} check_display $0 +if !$! error[0--3] "Command '$0': Missing specified input image." fi +l[0] { nm={n} => img +e[^-1] "Open "${arg\ {0,s},GRAY,GRAYA,RGB,RGBA}" color grabber widget for image$?, with variable name '$1'." +if !{*} w[] ${fitscreen[]\ {[w,h,1]},128,50%},0,0,-1,-1,"Grab a color" fi +_x_grab_color +dilate. 3 => icon_mask *.. 255 to_rgb.. =>.. icon_sprite +xc=5 yc=5 o$1=$$1 +cursor[0] 0 +do +if !narg($visu0) ++r[img] {*,w},{*,h},1,100%,2 drgba. w. => visu0 +fi +x={*,x} y={*,y} b={*,b} mouse_over={$x>=0" && "$y>=0} +hc={narg($$1)?40:24} +yc={visu0,nhc=h-$hc-8;!$mouse_over?$yc:$y<$hc||$yc+$hc>=h?nhc:$y>=nhc?5:$yc} +if [0$ox,0$oy,0$ob,0$ohc,0$oyc,0$ocolor,0${o$1}]!=[$x,$y,$b,$hc,$yc,0$color,0$$1] +[visu0] => visu +if narg($color) +24,$hc,1,[img] fc. $color +if narg($$1) rectangle. 0,24,100%,100%,1,$$1 line. 0,24,100%,24,1,0 fi +drgba. frame. 1,1,0 frame. 1,1,255 j[visu] .,$xc,$yc rm. +0 +if narg($$1) +t. "Position ("$X","$Y")\nColor ("{``$color}")\nSelected ("{``$$1}")",1,0,15,1,255 +else +t. "Position ("$X","$Y")\nColor ("{``$color}")",1,0,15,1,255 +fi ++dilate. 5 r.. 100%,100%,1,3 +j[visu] ..,{30+$xc},$yc,0,0,0.85,.,255 rm[-2,-1] +fi +if $mouse_over +X={img,round($x*(w-1)/({*,w}-1))} +Y={img,round($y*(h-1)/({*,h}-1))} +color={img,round(I($X,$Y))} +j[visu] [icon_sprite],$x,{icon_sprite,$y-h+1},0,0,1,[icon_mask] +if $b&1 $1=$color fi +fi +w[visu] rm[visu] +ox=$x oy=$y ob=$b ohc=$hc oyc=$yc ocolor=$color o$1=$$1 +fi +if arg(1,{'$1'})==_'_'" && "arg(2,{'$1'})==_'_' wait 50 else wait fi +if {*,r} w[] -1 rm[visu0] yc=5 fi +if ['$$1']=='-1' break fi +while {*}" && "!{*,ESC}" && "!{*,Q} +w 0 k[img] => $nm } +u $color +_x_grab_color : +base642img[] "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMSAzMzcgMSAxICMyNzcKeJyNiNlOwlAYBi9IDDcaY+LGpiJbj7tBKEbglTQE7dcbkZS1gfNXFCx""lK6WE83w+gDaaeG0mmWTm67NSea5s1Pz6Ot80tnrb/d3BnhkYBq3QKDyOTA5nmfqDnW2W5nK77Mj60yLXgZvrqm6Oq47MYWc4ZhnCJE2wrgjmBWFwRm""r/hNQ3ZqivKQIlCN0YQZdeQGgxzXOD1T3XWEMhVWMtz1Wmw4h1QHEOShogqQc67YPOBwpdmgpdWzDSY9DNFJS1wWUH/NZF926FTl4oel48tgui3C6KU""rMo7rWCYCvJg4k/fvp/5/dJq9QyuUy48UXMOZ5H7ah9ND2YRMbhUXgUsoLDgOnxsf++0/TX1zRf1fcNa0iPgw==" +-. 127 decompress_rle. +frame. 10,10,0 +r2dx. 24 +#@cli x_hanoi +#@cli : Launch the Tower of Hanoi game. +x_hanoi : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Tower of Hanoï"$n" ---------------------\n +----\n +---- "${c}"Left button"$n" and "${c}"mouse"$n" to move a disk.\n +---- "${c}"Right button"$n" to rotate 3D view.\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-------------------------------------------" +l[] { +l[] { +cylinder3d 1,10 r3d 1,0,0,90 +++3d 10,0,0 +-3d.. 10,0,0 +box3d 30,1,10 -3d. 15,0,5 ++3d => rods3d +400,400 noise. 1 fftpolar. f.. 'r=sqrt((x-w/2)^2+.01*(y-h/2)^2);i/(1+r)' ifftpolar[-2,-1] n. 0,31 +(86,50,50;132,36,12;218,109,66;231,207,180;255,193,140) permute. yzcx r. 32,1,1,3,3 +map.. . rm. b. 2% b. x,1% sharpen. 100 c. 0,255 +r3d.. 1,0,0,-90 texturize3d.. . r3d.. 1,0,0,90 rm. +} +l[] { +6,1,1,3,'[360*x/w,0.9*(1-(x/w)^0.5),0.9]' hsi2rgb. +ytop0=0 +repeat w#0 { +R,r={3-0.3*$>},{1.6-0.22*$>} +torus3d $R,$r,36,10 +300,300 plasma. 1,1,3 b. 20 sharpen. 300 n. 150,255 1,1,1,3,{0,I[$>]} r. ..,..,1,3 rv[-2,-1] blend[-2,-1] +luminance,0.75 +texturize3d.. . rm. +/3d. 1,1,{0.3+$r} r3d. 1,0,0,90 -3d. 0,0.8,0 +a$>,x$>,y$>,h$>=0,0,$ytop0,{1.8*$r/(0.3+$r)} +ytop0+=${h$>} +=> disk3d$> +} +rm[0] +} +w[] 640,400,0,"[G"{`39`}"MIC] Tower of Hano\357" +1,3,1,3,'y==0?[32,128,100]:y==1?[64,16,0]:[0,0,0]' r. {*,w},{*,h},1,3,3 => background +nb_moves,buttons,motion3d_x,motion3d_y=0 +x,rod,rod_source,rod_target,selected=-1 +fading=$| error=0 +do +repeat 6 { +r3d[disk3d$>] 1,1,1,${a$>} +3d. {10*(${x$>}-1)},-${y$>},0 } +3d[-6--1] +3d. [rods3d] +r3d. 1,0,0,20 +if !($buttons&2) r3d. 0,1,0.3,{5*cos(1.5*$|)} r3d. 0.3,0,1,{3*sin(0.8*$|)} fi +r3d. 1,0,0,$motion3d_y r3d. 0,-1,0,$motion3d_x *3d. 20 +[background] j3d. ..,50%,70%,10,1,5,0,1,800,200,0,-3000,0.15,0.2 +t. "#Moves: "$nb_moves,2%,92%,20,1,255 +if $error (255^0^0) ri. .. j.. .,0,0,0,0,$error error={max(0,$error-0.2)} rm. fi +if $|-$fading<1 *. {$|-$fading} fi +w. wait 40 +if {*,CTRLLEFT}" && "{*,D} w[] {w*1.5},{h*1.5} elif {*,CTRLLEFT}" && "{*,C} w[] {w},{h} fi +rm[-2,-1] +top0,top1,top2,ytop0,ytop1,ytop2=-1 +repeat 6 { +rod={round(${x$>})} +if $selected!=$>" && "${y$>}+${h$>}>${ytop$rod} ytop$rod={${y$>}+${h$>}} top$rod=$> fi +} +prev_buttons=$buttons +mouse_x,mouse_y,buttons={*,x},{*,y},{*,b} +if $mouse_x>=0 x={2.6*($mouse_x/{*,w}-0.5)+1} rod={round($x)} fi +if $mouse_x>=0" && "$buttons&2 +motion3d_x,motion3d_y={([$mouse_x,$mouse_y]/[{*,w},{*,h}]-0.5)*90} +elif $mouse_x>=0" && "$buttons&1 +if $selected<0 +selected=${top$rod} +rod_source={$selected<0?-1:$rod} +fi +if $selected>=0" && "$rod>=0 +if ${y$selected}<11 y$selected={min(11,${y$selected}+3)} +else +x$selected+={d=$rod-${x$selected};sign(d)*min(0.3,abs(d))} +y$selected={x=${x$selected};11+1.5*sin(pi*abs(x-round(x)))} +a$selected={x=${x$selected};45*sin(pi*abs(x-round(x)))} +fi +fi +elif !$buttons +if $rod>=0" && "$selected>=0 +if $rod_target<0 +if ${top$rod}<$selected rod_target=$rod nb_moves+={$rod_target!=$rod_source} +else rod_target=$rod_source error=0.8 +fi +fi +x$selected=$rod_target +a$selected=0 +ytop={max(0,${ytop$rod_target})} +if ${y$selected}>$ytop y$selected={max($ytop,${y$selected}-3)} +else x,rod,rod_source,rod_target,selected=-1 +fi +fi +fi +if !($buttons&2) +motion3d_x-={sign($motion3d_x)*min(1,abs($motion3d_x))} +motion3d_y-={sign($motion3d_y)*min(1,abs($motion3d_y))} +fi +while {*}" && "!{*,ESC}" && "!{*,Q} +w[] 0 rm } +#@cli x_histogram +#@cli : Launch the histogram demo. +x_histogram : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Histogram demo"$n" -------------------------------\n +----\n +---- "${c}"Mouse"$n" to set parameters.\n +---- "${c}"Right button"$n" or key '"${c}"SPACE"$n"' to reset.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-----------------------------------------------------" +if !$! sp ? to_rgb +else k[0] to_rgb r2dy 300,2 if w>800 r 800,100%,1,3,2 fi n 0,255 +fi ++frame. 1,1,0 +300,{h},1,3,220 +t. "Gamma :",5,0,16,1,0 +t. "Contrast :",5,50,16,1,0 +t. "Brightness :",5,100,16,1,0 +t. "Smoothness :",5,150,16,1,0 +t. "Sharpness :",5,200,16,1,0 +t. "Clusters :",5,250,16,1,0 +a[-2,-1] x +{w},200,1,3,255 +grid. 10%,10%,0,0,0.3,0xCCCCCCCC,0 +rectangle. 0,0,100%,100%,1,0xFFFFFFFF,0 +axes. 0,255,1,0,13,1,0 +frame[-2,-1] 5,5,220 +a[-2,-1] y +clusters=64 sharpness=0 smoothness=0 contrast=1 brightness=0 gamma=1 +do +[0] +ia={ia} +if $gamma /. 255 ^. {1/$gamma} *. 255 fi +-. $ia *. $contrast +. $brightness +. $ia +b. $smoothness +sharpen. $sharpness +c. 0,255 ++j.. .,6,6 +sx={{0,w}+12} +_x_histogram. {$gamma*100/4} j.. .,$sx,25 rm. +_x_histogram. {$contrast*100/4} j.. .,$sx,75 rm. +_x_histogram. {($brightness+128)*100/256} j.. .,$sx,125 rm. +_x_histogram. {$smoothness*100/10} j.. .,$sx,175 rm. +_x_histogram. {$sharpness*100/2000} j.. .,$sx,225 rm. +_x_histogram. {$clusters*100/256} j.. .,$sx,275 rm. ++s.. c histogram[-3--1] $clusters,0,255 /[-3--1] {6*{0,wh}/$clusters} rm[-5] ++z[-4] 5,{0,h+16},{{-4,w}-5},{{-4,h}-6} +graph. [-4],3,0,1,0,0.2,255,0,0 +graph. ...,3,0,1,0,0.2,0,255,0 +graph. ..,3,0,1,0,0.2,0,0,255 +rm[-4--2] +j.. .,5,{0,h+16} rm. +if {*,b}&1\ &&\ {*,x}<{0,w}\ &&\ {*,y}<{0,h} +j. [0],6,6 to. Original,10,10,16 +fi +w. {w},{h},0,"[G"{`39`}"MIC] Histogram Demo" rm. +wait +if {*,b}&1\ &&\ {*,x}>={0,w}-10 +if {*,y}>=25\ &&\ {*,y}<=42 +gamma={max(0,min(4,({*,x}-$sx)*4/280))} +elif {*,y}>=75\ &&\ {*,y}<=92 +contrast={max(0,min(4,({*,x}-$sx)*4/280))} +elif {*,y}>=125\ &&\ {*,y}<=142 +brightness={max(-128,min(128,({*,x}-$sx)*256/280-128))} +elif {*,y}>=175\ &&\ {*,y}<=192 +smoothness={max(0,min(10,({*,x}-$sx)*10/280))} +elif {*,y}>=225\ &&\ {*,y}<=242 +sharpness={max(0,min(2000,({*,x}-$sx)*2000/280))} +elif {*,y}>=275\ &&\ {*,y}<=292 +clusters={max(2,min(256,({*,x}-$sx)*256/280))} +fi +fi +if {*,b}&2\ ||\ {*,SPACE} clusters=64 sharpness=0 smoothness=0 contrast=1 brightness=0 gamma=1 fi +while {*}" && "!{*,ESC}" && "!{*,Q} +w 0 rm +_x_histogram : +val={max(0,min(100,$1))} +280,2,1,3,255 line. 0,0,$val%,0,1,0,255,0 line. 0,1,$val%,1,1,240,255,62 r. 100%,16,1,3,3 +0 t. {round($val)}%,0,0,14,1,1 +*. -255 +. 255 r. 100%,100%,1,3 +j... .,{(280-w)/2},{(16-h)/2},0,0,1,.. rm[-2,-1] +r. {w+2},{h+2},1,3,0,0,0.5,0.5 +#@cli x_hough +#@cli : Launch the hough transform demo. +x_hough : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Hough-transform"$n" -----------------------------------------\n +----\n +---- "${c}"Mouse buttons"$n" on the vote image to draw corresponding line.\n +---- "${c}"Mouse buttons"$n" on the image to vote for all lines crossing.\n +---- the clicked point.\n +---- Key '"${c}"SPACE"$n"' to reset the hough window.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-----------------------------------------------------------------" +if !$! l[] { sp greece onfail testimage2d 400 } fi +n 0,255 +foreach { +r. ${fitscreen\ {[w,h]}},1,100%,3 +if !narg($first_time) +parallel 0,"+l[0] { r2dy 128 frame 1,1,0 alert \"[G"{`39`}"MIC Hough Transform]\",\"The G\47MIC Hough transform demo illustrates the application\nof the Hough transform to detect lines in an image. Use your\nmouse buttons to explore the transform image and see how\nlines in images are represented by points in the transform.\",\"OK\" rm }" +first_time=0 +fi +rhomax={sqrt(w^2+h^2)/2} ++b. 1.5 hough. 512,400 b. 0.5 +. 1 log. n. 0,255 +w.. -1,-1,0,"[G"{`39`}"MIC] Image" w1. -1,-1,0,"[G"{`39`}"MIC] Hough Transform" +do +wait +if {*,b} +x0={{*,x}-{*,w}/2} +y0={{*,y}-{*,h}/2} +rho0={sqrt(($x0)^2+($y0)^2)} +theta0={atan2($y0,$x0)} +(0,{2*pi}) ($theta0,{$theta0-2*pi}) +r[-2,-1] {-3,w},1,1,1,3 +cos. *. $rho0 +<. 0 abs.. +*. {pi} +[-3,-1] %.. {2*pi} +*.. {0.5*{-3,w}/pi} *. {{-3,h}/$rhomax} +a[-2,-1] y +repeat w { point.. {i($>,0)},{i($>,1)},0,0.3,255 } +rm. w1. +elif {*1,x}>=0" && "{*1,b} +theta={{*1,x}*2*pi/{*1,w}} +rho={{*1,y}*$rhomax/{*1,h}} +x={{-2,w}/2+$rho*cos($theta)} +y={{-2,h}/2+$rho*sin($theta)} +x0={$x+1000*sin($theta)} +y0={$y-1000*cos($theta)} +x1={$x-1000*sin($theta)} +y1={$y+1000*cos($theta)} +.. +line. $x0,$y0,$x1,$y1,1,0x0F0F0F0F,255 +line. {$x0+1},$y0,$x1,$y1,1,0x0F0F0F0F,255 +line. $x0,{$y0+1},$x1,$y1,1,0x0F0F0F0F,255 +line. $x0,$y0,$x1,$y1,1,0xF0F0F0F0,0 +line. {$x0+1},$y0,$x1,$y1,1,0xF0F0F0F0,0 +line. $x0,{$y0+1},$x1,$y1,1,0xF0F0F0F0,0 +w. rm. +elif {*,SPACE}" || "{*1,SPACE} +rm. +b. 1.5 hough. 512,400 b. 0.5 +. 1 log. n. 0,255 +w1. -1,-1,0,"Hough Transform" +elif {*,r} w.. +elif {*1,r} w1. +fi +while {*}" && "{*1}" && "!{*,ESC}" && "!{*,Q}" && "!{*1,ESC}" && "!{*1,Q} +w 0 w1 0 +rm. +if !{*}" || "!{*1} break fi +} +rm +#@cli x_jawbreaker : 0<_width<20,0<_height<20,0<_balls<=8 +#@cli : Launch the Jawbreaker game. +x_jawbreaker : check "${1=12}>0 && $1<20 && ${2=13}>0 && $2<20 && ${3=5}>0 && $3<=8" check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Jawbreaker"$n" --------------------------------------------\n +----\n +---- The goal of the game is to "${c}"remove the maximum number of\n +---- balls on the board"$n", simply by clicking on them. But a\n +---- colored ball can disappear only if it is grouped with at\n +---- least one ball of the same color. The score is higher if\n +---- you destroy larger sets of connected colored balls.\n +----\n +---- "${c}"Left mouse button"$n" to select/destroy balls on board.\n +---- Key '"${c}"BACKSPACE"$n"' or '"${c}"SPACE"$n"' to undo the last move.\n +---- Key '"${c}"S"$n"' to save snapshot of the current view.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------------------------" +$1,$2 => board rand[board] 1,$3 round[board] 1 +. => undo +40,40,1,4 => balls _x_jawbreaker_ball. +autocrop. 0 expand_xy. 1,0 *. 1.5 c. 0,255 r. {{board,w}*w},{{board,h}*h},1,1,0,2 /. 255 +{w},{h},1,3 => back +l. { +rand 0,255 blur_xy 6,20 equalize 100,0,255 blur_xy 2,4 +sh 0 sh.. 1 sh... 2 /... 4 /.. 8 /. 2 rm[-3--1] +} +[back] => visu +score=0 +undoscore=0 +render_board=1 +shapescorey=0 +shapescore=0 +do +if $render_board ++abs[board] -. 1 *. {360/$3} +>=[board] 0 *. 0.9 +!=[board] 0 +ri[-3--1] [balls] [balls] *[-2,-1] a[-3--1] c hsv2rgb. ++compose_channels. + >. 0 dilate. 3 +j[visu] [back] j[visu] ..,0,0,0,0,1,. rm[-2,-1] +if !$shapescorey w[visu] {back,w},{back,h},0,"[G"{`39`}"MIC] Jawbreaker (Score : "$score")" fi +render_board=0 +fi +if $shapescorey ++t[visu] "+"$shapescore,{*,x},{{*,y}-64+$shapescorey},32,{($shapescorey-1)/31},255 +shapescorey={max(0,$shapescorey-1)} +w. {back,w},{back,h},0,"[G"{`39`}"MIC] Jawbreaker (Score : "$score")" rm. wait 25 +else wait fi ++f[board] "if(i,j(-1)==i || j(1)==i || j(0,1)==i || j(0,-1)==i,0)" +if !is rm. break fi rm. +if {*,r} render_board=1 +elif {*,S} o[visu] gmic_jawbreaker.png +elif {*,BACKSPACE}" || "{*,SPACE} +abs[undo] j[board] [undo] +score=$undoscore +render_board=1 +elif {*,x}>=0" && "{*,b} +wait -1 +x={"int("{*,x}"*"{board,w}"/"{*,w}")"} +y={"int("{*,y}"*"{board,h}"/"{*,h}")"} +if {{board,i($x,$y)}>0} +abs[board] flood[board] $x,$y,0,0,0,1,-{board,i($x,$y)} ++>=[board] 0 -. 1 +shapescore={(is+1)^2} shapescorey={if($shapescore,32,0)} rm. +elif {board,i($x,$y)} ++flood[board] $x,$y,0,0,0,1,-1 ==. -1 +if is>1 +j[undo] [board] +undoscore=$score +flood[board] $x,$y,0,0,0,1,0 +repeat w#$board { ++columns[board] $> mirror. y +h={board,h} +l. { s -,0 a y if $! r 1,$h,1,1,0 mirror y else i 1,$h fi } +j[board] .,$> rm. +} +rows[board] -1,100% f[board] "if(y==0,if(i(x,h-1),x,w),i)" sort[board] +,x rows[board] 1,100% +score+={int((is-1)^2)} +fi +rm. +else abs[board] +fi +render_board=1 +fi +while {*}" && "!{*,Q}" && "!{*,ESC} +if {*}" && "!{*,ESC} +w[] {visu,w},{visu,h},0,"[G"{`39`}"MIC] Jawbreaker (Final Score : "$score")" +260,85 => gameover t. "Game Over!",3,0,53,1,1 t. "Score : "$score,23,53,32,1,1 ++dilate. 5 => "mgameover" *.. 255 r.. 100%,100%,1,3 +repeat 25 { ++r[gameover,mgameover] {400-12*($>+1)}%,{400-12*($>+1)}% ++j[visu] ..,{({visu,w}-w)/2},{({visu,h}-h)/2},0,0,{$>/25},. +w. rm[-3--1] wait 25 +} +do +wait if {*,r} w[] {*,w},{*,h} wait -1 fi +while {*}" && "!{*,Q}" && "!{*,ESC}" && "!{*,b} +rm[gameover,mgameover] +fi +rm[board,undo,balls,back,visu] +w 0 +_x_jawbreaker_ball : +mwh={min(w,h)} +sh 3 f. 0 rm. +ellipse {0.5*$mwh},{0.5*$mwh},{0.5*$mwh-4},{0.5*$mwh-4},0,1,240,240,240,1 +sh 0,2 *. '($mwh+y-x)/(2*w)' rm. +sh 3 *.. . dilate. 5 rm. +sh 0,2 +. 'if(i&&(!j(-1)||!j(1)||!j(0,-1)||!j(0,1)),240/6,0)' rm. +ellipse {$mwh*0.7},{$mwh*0.3},{min(30,$mwh*$mwh/512)},{min(30,$mwh*$mwh/512)},0,{min($mwh/64,1)},255,255,255,1 +#@cli x_landscape +#@cli : Launch the virtual landscape demo. +x_landscape : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Virtual landscape"$n" -------------------------------------\n +----\n +---- Enjoy the view!\n +----\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------------------------" +l[] { +W=150 H=350 +900,900 plasma. 1,1,6 b. 0.07% n. 0,255 => map ++g. *. 0.5 +[-2,-1] n. 0,1 ^. 2 n. -150,330 +equalize[map] 256 n[map] -400,160 c[map] 0,100% +(0,102,51;149,175,124;102,42,0;255,255,255) permute. yzcx srgb2rgb. r. 256,1,1,3,3 rgb2srgb. ++n[map] 0,255 map. .. rm.. ++. .. rm.. c. 0,255 => colors +$W,$H,1,1,'x' y. x => x +$W,$H,1,1,'1+x+y*w' y. x => offsets +$W,$H,1,1,'0.5*y' => gmap Mgmap={iM} +$W,$H,1,3 fc. 60,80,135 => ccolors +$W,$H,1,1,'(y/$H)^2' => mcolors +$W,400,1,1,'b=h-1-$Mgmap;if(y>=b,256+(y-b)*255/(h-1-b),y*255/b)' round. +(96^16^128) (0^200^255) a[-2,-1] x r. 256,1,1,3,3 +(0^32^0) (0^64^128) a[-2,-1] x r. 256,1,1,3,3 +a[-2,-1] x map.. . rm. +=> background +quadrangle3d[] -0.45,0,0,0.45,0,0,0.55,1,0,-0.55,1,0 *3d. {$W/2},{$H/2} => viewrange3d +(64^16^0) r. $W => groundcolor +w[] 600,400,0,"[G"{`39`}"MIC] Virtual Landscape" +do +t={$|*0.03} +xm={map,w/2+(w-$H/2)/2*cos(3.1*$t)} +ym={map,h/2+(h-$H/2)/2*sin(2.8*$t)} +u={map,(w-$H/2)*cos(2.5*$t)} +v={map,(h-$H/2)*sin(9.7*$t)} +a={atan2($v,$u)*180/pi} ++r3d[viewrange3d] 0,0,1,$a y. x +({$xm+i[8]},{$xm+i[11]};{$xm+i[17]},{$xm+i[14]}^{$ym+i[9]},{$ym+i[12]};{$ym+i[18]},{$ym+i[15]}) rm.. +r. $W,$H,1,2,3 +warp[map,colors] .,0,1,0 rm... +=> lmap,lcolors ++!=[lmap] 0 => ground ++[lmap] [gmap] +j[lcolors] [ccolors],0,0,0,0,1,[mcolors] +j[lcolors] [groundcolor] ++round[lmap] f. '>m=abs(j(0,-1));i>m?i:-m' => y0 ++shift. 0,1 abs. +. 1 => y1 +*[y0,y1] [ground] rm[ground] +r[lcolors,y0,y1] {$W*$H},1,1,100%,-1 ++>[y0] 0 *. [offsets] discard. 0 y. +if h +-. 1 +warp[x] .,0,0,0 => lx +warp[lcolors,y0,y1] ..,0,0,0 rm.. +N={h} ({'CImg3d'},{2*$N},$N) ++a[lx] [y0],x rm[y0] +a[lx] [y1],x rm[lx,y1] a[-2,-1] y z. 0,2 +1,$N,1,1,2 +f. y ++. $N a[-3--1] x +mv[lcolors] $! permute. cyzx +1,$N,1,1,1 +y[-5--1] y a[-5--1] y *3d. -1,-1 ++j3d[background] .,{background,w-1},{background,h},0,1,1,0,0,0 rm[-3,-2] +else +rm[-5--1] [background] +fi +r. {*,w},{*,h},1,3 +fps=${-fps} if $fps>0 to. $fps" fps",5,5,24,2,0.2 fi +w. -1,-1,0 rm. +if {*,CTRLLEFT}" && "{*,D} w[] 900,600 elif {*,CTRLLEFT}" && "{*,C} w[] 600,400 fi +wait 20 +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w 0 } +#@cli x_life +#@cli : Launch the game of life. +x_life : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"The game of life"$n" --------------------------------------\n +----\n +---- The goal is to create the "${c}"biggest possible biological\n +---- system"$n". You start with a stock of cells which you can\n +---- spread over the board. For each new cells created\n +---- simultaneously and spontaneously by your system, you\n +---- gain more new cells to scatter.\n +----\n +---- "${c}"Left mouse button"$n" to scatter cells in stock.\n +---- "${c}"Right mouse button"$n" to reset game.\n +---- Key '"${c}"S"$n"' to save snapshot of the current view.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------------------------" +i[0] 90,90,1,1,0 +i[1] [0] f[1] 0 +i[2] 400,400,1,3 +i[3] 1 +iteration=0 +score=0 +bestscore=0 +stock=500 +w[0] 400,400,0,"[G"{`39`}"MIC] The Game of Life" +cursor[0] 0 +do +(1,1,1;1,0,1;1,1,1) +correlate[0] .,0 rm.. ++ir. 2,2 &. [0] ir.. 3,3 -|[-2,-1] +rv[0,-1] +if {*,x}>0" && "{*,b}==1" && "$stock>0 +nb={u*7} +repeat $nb { +x={{*,x}/{*,w}*{0,w}+u(-4,4)} +y={{*,y}/{*,h}*{0,h}+u(-3,3)} +=[0] 1,$x,$y +=[1] $iteration,$x,$y +point[2] {$x*{2,w}/{0,w}},{$y*{2,h}/{0,h}},0,0.8,255 +} +stock={round(max(0,$stock-$nb))} +fi +-. [0] *. -1 +stock-={2*(min(0,int(is/16*$score/150)))} ++[1] [0] +min. 0 +. 1 *[1,-1] +if {*,b}==2 +f[0-2] 0 iteration=0 score=0 bestscore=0 stock=500 rm[3] i[3] 1 +fi +if {3,w}==1 +rm[3] i[3] {u(3,12)},1,1,3,u(100,255) +r[3] {u(100,300)}%,1,1,3,4 +point[3] 0,0,0,1,0 +r[3] {u(100,600)}%,1,1,3,5 c[3] 0,255 +fi ++r[1] {2,w},{2,h} &. 7 b. {1+$score*0.05} +n. 0,{3,w} map. [3] *. 0.1 +[2,-1] /[2] 1.1 +[2] if {*,x}>0 +opac={0.7*min(1,$stock/500)} r={min(500,$stock)*cos($iteration)/100} +ellipse. {*,x},{*,y},{15+$r},{15+$r},0,$opac,0,196,0 +ellipse. {*,x},{*,y},{10+$r},{10+$r},0,$opac,32,64,16 +ellipse. {*,x},{*,y},{5+$r},{5+$r},0,$opac,255,230,0 +fi +t. "Living cells : "$score"\n"\ +"Stock : "$stock"\n""Score : "$bestscore,5,3,22,0.7,255 +w. {*,w},{*,h} +if {*,S} o. gmic_life.png fi +rm. +if !($iteration%10) +score={0,is} bestscore={max($score,$bestscore)} +fi +wait 60 +iteration+=1 +while {*}" && "!{*,ESC}" && "!{*,Q} +rm[0-3] w 0 +#@cli x_light +#@cli : Launch the light effect demo. +x_light : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Light effect"$n" ------------------------\n +----\n +---- Move light position with "${c}"mouse"$n".\n +---- "${c}"Mouse buttons"$n" fade light in/out.\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-------------------------------------------" +0 t. " G\47MIC\nLight effect",0,0,80,1,255 expand_xy. 15,0 b. 3 +. n.. 0,1 r.. 100%,100%,1,3 +sh.. 0 *. 120 rm. +sh.. 1 *. 70 rm. +sh.. 0,50%,0,2 *. 120 rm. +25%,25%,1,1 rand. -20,20 smooth. 10,0,1,1,4 ri. ..,3 b. 3 n. -100,100 ++[-2,-1] g. xy a[-2,-1] c n. -150,150 +w[] {1.5*{-2,w}},{1.5*{-2,h}},0,"[G"{`39`}"MIC] Light Effect" +cursor[0] 0 +light=70 +640,640 gaussian. $light n. 0,255 +t=0 +do +if {*,x}>=0 +X={round((w-{*,x})/2)} +Y={round((h-{*,y})/2)} +else +X={round((w-{-2,w}*(1+cos(2*$t)))/2)} +Y={round((h-{-2,h}*(1+sin(2.5*$t)))/2)} +t+=0.02 +fi +if {*,b}&1 light={min(200,$light+10)} gaussian. $light n. 0,255 fi +if {*,b}&2 light={max(10,$light-10)} gaussian. $light n. 0,255 fi ++z. $X,$Y,{$X+{-2,w}-1},{$Y+{-2,h}-1} +warp. ...,1,0,1 +r. 100%,100%,1,3 +. [-4] c. 0,255 +fps=${-fps} if $fps>0 to. $fps" fps",5,5,16,1,0.2 fi +w. +if {*,CTRLLEFT}" && "{*,D} w[] {3*w},{3*h} elif {*,CTRLLEFT}" && "{*,C} w[] {1.5*w},{1.5*h} fi +rm. if {*,x}>=0" && "!{*,b} wait else wait 20 fi +while {*}" && "!{*,ESC}" && "!{*,Q} +w[] 0 rm[-3--1] +#@cli x_mandelbrot : _julia={ 0 | 1 },_c0r,_c0i +#@cli : Launch Mandelbrot/Julia explorer. +x_mandelbrot : skip ${1=0},${2=0.317},${3=0.03} check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Mandelbrot/Julia explorer"$n" -----------------\n +----\n +---- Select zooming region with "${c}"mouse"$n".\n +---- "${c}"Click once"$n" to reset zoom factor.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +---- Key '"${c}"C"$n"' to print current fractal coordinates.\n +----\n +--------------------------------------------------" +rm w 512,512,0 _x_mandelbrot_coords $1 _x_mandelbrot_palette +do +siz={min({*,w},{*,h})} +$siz,$siz mandelbrot. {0,^},256,$1,{if($1,$2,0)},{if($1,$3,0)} map. [1] +if $1 w. $siz,$siz,0,"[G"{`39`}"MIC] Julia Set c=("{0,@0-1}")-("{0,@2-3}"), c0=($2,$3)" +else w. $siz,$siz,0,"[G"{`39`}"MIC] Mandelbrot Set c=("{0,@0-1}")-("{0,@2-3}")" fi +w={w} h={h} round. select. 2,0,0,0,1 +if i[0]>0 +M={max(i[3]-i[0],i[4]-i[1])} +if $M<5 _x_mandelbrot_coords $1 rm[1] _x_mandelbrot_palette mv. 1 +else ({{0,@0}+{@0}*({0,@2}-{0,@0})/$w};\ +{{0,@1}+{@1}*({0,@3}-{0,@1})/$h};{{0,@0}+({@0}+$M)*({0,@2}-{0,@0})/$w};{{0,@1}+({@1}+$M)*({0,@3}-{0,@1})/$h}) +fi +rm[0] mv. 0 +fi +rm. +if {*,C} +if $1 e "Julia set, at c = ("{0,@0-1}")-("{0,@2-3}"), with c0 = ($2,$3)." +else e "Mandelbrot set, at c = ("{0,@0-1}")-("{0,@2-3}")." +fi +fi +if !{*}" || "{*,ESC}" || "{*,Q} break fi +wait -1 +while 1 rm w 0 +_x_mandelbrot_coords : +if $1 (-2;-2;2;2) else (-2.1;-1.5;1.2;1.5) fi +_x_mandelbrot_palette : +6,1,1,3 rand. 20,255 r. 32,1,1,3,3 r. 1024,1,1,3,0,2 =. 0,0,0,0,0 =. 0,0,0,0,1 =. 0,0,0,0,2 +#@cli x_mask_color : _colorspace={ all | rgb | lrgb | ycbcr | lab | lch | hsv | hsi | hsl | cmy | cmyk | yiq },_spatial_tolerance>=0,_color_tolerance>=0 +#@cli : Interactively select a color, and add an alpha channel containing the corresponding color mask. +#@cli : Argument 'colorspace' refers to the color metric used to compute color similarities, and can be basically +#@cli : one of { rgb | lrgb | ycbcr | lab | lch | hsv | hsi | hsl | cmy | cmyk | yiq }. +#@cli : You can also select one one particular channel of this colorspace, by setting 'colorspace' as +#@cli : 'colorspace_channel' (e.g. 'hsv_h' for the hue). +#@cli : Default values: 'colorspace=all', 'spatial_tolerance=5' and 'color_tolerance=5'. +x_mask_color : check "${2=5}>=0 && ${3=5}>=0" skip ${1=all} check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e[^-1] "Interactively create color mask for image$?, with color space $1, spatial tolerance $2 and +color tolerance $3." +e "\n +----------------------------------------------------------------------------------------------------\n +----\n +---- "${c}"Left mouse button"$n" adds a wanted color to the selection.\n +---- "${c}"Right mouse button"$n" adds an unwanted colors to the selection.\n +---- "${c}"Middle mouse button"$n" or key '"${c}"R"$n"' resets color mask.\n +---- Key '"${c}"SPACE"$n"' or '"${c}"TAB"$n"' toggles view modes (masked RGB or mask).\n +---- Keys '"${c}"CTRL+D"$n"' increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' decrease window size.\n +---- Keys '"${c}"CTRL+R"$n"' reset window size.\n +---- Keys '"${c}"ESC"$n"', '"${c}"Q"$n"' or '"${c}"ENTER"$n"' exit the interactive window.\n +----\n +----------------------------------------------------------------------------------------------------" +l[] { _ac_$1 onfail error[0--3] "Command '$0' : Invalid colorspace '$*'." } +m _ac_forward:$_f +foreach { +slices 0 basename {0,n} nm=${} +wh=${fitscreen\ {[w,h,1]},128,1024} ++r $wh,1,100%,2 ++_ac_forward. channels. $_s +if {1,s>3} channels[1] 0,2 fi to_rgb[1] +w[1] 100%,100%,0,$nm +colors_add=-1 colors_sub=-1 visumode=0 +is_clicked=0 time=0 delay=0.1 +do +time={$is_clicked?$time:$|} +wait +x={2,round({*,x}*(w-1)/({*,w}-1))} +y={2,round({*,y}*(h-1)/({*,h}-1))} +b={*,b} +c=$x,$y,{2,I($x,$y)} +is_add={arg(1,$colors_add)>=0} +is_sub={arg(1,$colors_sub)>=0} +is_ctrl={{*,CTRLLEFT}" || "{*,CTRLRIGHT}} +is_resized=0 +refresh=0 +if $x>=0" && "$b&1 +if $is_add colors_add=$colors_add,$c else colors_add=$c fi +is_clicked=1 +refresh={$|-$time>$delay} +elif $x>=0" && "$b&2 +if $is_sub colors_sub=$colors_sub,$c else colors_sub=$c fi +is_clicked=1 +refresh={$|-$time>$delay} +elif $b&4" || "{*,R} +colors_add=-1 colors_sub=-1 refresh=1 is_clicked=1 +elif !$b +refresh={$is_clicked==1} +is_clicked=0 +fi +if {*,-TAB}" || "{*,-SPACE} visumode={($visumode+1)%3} refresh=1 fi +if {*,r} is_resized=1 +elif $is_ctrl" && "{*,-D} w[] {1,1.25*[w,h]} is_resized=1 +elif $is_ctrl" && "{*,-C} w[] {1,0.8*[w,h]} is_resized=1 +elif $is_ctrl" && "{*,R} w[] ${fitscreen\ {0,[w,h,1]},128,1024} is_resized=1 +fi +if $is_resized rm[1,2] +r {*,d},{*,e},1,3,2 +_ac_forward. channels. $_s refresh=1 fi +if $refresh +_x_mask_color[2] {$2*w#2/w#0},$3,{``$colors_add},{``$colors_sub} delay=${} +if $visumode==0 +. 64 c. 0,255 +a[1,-1] c drgba. w. -1,-1,$nm" [half-masked]" rm. +elif $visumode==1 +a[1,-1] c drgba. w. -1,-1,$nm" [masked]" rm. +else w. -1,-1,$nm" [mask]" +fi +rm. +time=$| +fi +while {*}" && "!{*,ESC}" && "!{*,Q}" && "!{*,ENTER} +if arg(1,$colors_add)>=0 ($colors_add) +r. {2+s#2},{w/(2+s#2)},1,1,-1 +z. 0,1 *. '{(w#0-1)/(w#2-1)},{(h#0-1)/(h#2-1)}' +j.. . colors_add={-2,^} rm[-2,-1] +fi +if arg(1,$colors_sub)>=0 ($colors_sub) +r. {2+s#2},{w/(2+s#2)},1,1,-1 +z. 0,1 *. '{(w#0-1)/(w#2-1)},{(h#0-1)/(h#2-1)}' +j.. . colors_sub={-2,^} rm[-2,-1] +fi +rm[-2,-1] +_ac_forward channels. $_s +_x_mask_color. $2,$3,{``$colors_add},{``$colors_sub} +rm.. a c +} +um _ac_forward +_x_mask_color : +100%,100% +is_add={arg(1,$3)>=0} +is_sub={arg(1,$4)>=0} +t0=$| +if $is_add" || "$is_sub +if $is_add +($3) r. {2+s#0},{w/(2+s#0)},1,1,-1 +N_add={h} M_add={"M = vectorw(); fill(M,k,med(crop(k,1)));M"} rm. +fi +if $is_sub +($4) r. {2+s#0},{w/(2+s#0)},1,1,-1 +N_sub={h} M_sub={"M = vectorw(); fill(M,k,med(crop(k,1)));M"} rm. +fi +f. "begin( +const is_add = "$is_add"; +const is_sub = "$is_sub"; +const ss = sqrt(2)*$1; +const sc = sqrt(2)*$2; +colors_add = [ $3 ]; +colors_sub = [ $4 ]; +M_add = [ 0"$M_add"]; +M_sub = [ 0"$M_sub"]; +const N_add = 0"$N_add"; +const N_sub = 0"$N_sub"; +const siz = 2 + s#0; +const siz2 = sqr(siz); +sigma = vectorsiz(sc); +sigma[0] = sigma[1] = ss; +tensor(op) = ( +T = vectorsiz2(); +if (is_#op, +for (k = 0, k={2*g} fy$>={2*g} fz$>={2*g} } +w[0] -1,-1,0,"[G"{`39`}"MIC] 3D Metaballs" +do +repeat $M { +x$>={w/2+0.5*(w-{2,w}-4)*cos(${fx$>}*$|)} +y$>={h/2+0.5*(h-{2,h}-4)*sin(${fy$>}*$|)} +z$>={d/2+0.5*(d-{2,d}-4)*sin(${fz$>}*$|)} +} +f[3] 0 repeat $M { j[3] [2],{${x$>}-{2,w/2}},{${y$>}-{2,h/2}},{${z$>}-{2,d/2}},0,-1 } ++r[3] 28,28,28,1,2 isosurface3d. 0.4 -3d. 12,12,12 *3d. 13 rv3d. +r3d. 1,2,1,{100*$|} +N={i[7]} (255,255,150;200,96,164;50,150,230) r. 3,$N,1,1,3 y. j.. .,0,{{-2,h}-4*$N} +if !$mode circles3d.. 4 fi +if !{1,w} +0 t. ${s$mode},5,5,23,0.5,255,255,255 r. {w+5},100%,1,3,0 b. 0.7 n. 0,255 ++dilate. 3 +j[0] ..,5,3,0,0,1,.,255 mv. 1 rm[2,-2,-1] +fi ++j3d[1] ..,50%,50%,0,1,{if(!$mode,3,$mode)},0,0,300,0,0,-500,0.1,1.5 +fps=${-fps} if $fps>0 to. $fps" fps",5,{h-22},16,2,0.2 fi +w. +if {*,CTRLLEFT}" && "{*,D} w[] {2*w},{2*h} elif {*,CTRLLEFT}" && "{*,C} w[] {w},{h} fi +rm[-3--1] wait 20 +if {*,b}" || "{*,SPACE} mode={($mode+if({*,b}&2,-1,1))%6} wait -1 rm[1] i[1] 0 fi +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w 0 } +#@cli x_minesweeper : 8<=_width=<20,8<=_height<=20 +#@cli : Launch the Minesweeper game. +x_minesweeper : check "${1=20}>=8 && $1<=30 && ${2=$1}>=8 && $2<=30" check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Minesweeper"$n" -------------------------------------------\n +----\n +---- The goal is to "${c}"clear the minefield"$n" without detonating a\n +---- mine.\n +----\n +---- "${c}"Left mouse button"$n" to try clearing one square.\n +---- "${c}"Right mouse button"$n" to flag or unflag a square.\n +---- "${c}"Middle mouse button"$n" to reset mine field.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------------------------\n" +$1,$2 noise. 30,2 ==. 1 nb_mines={is} (1,1,1;1,0,1;1,1,1) +convolve.. .,0 rm.. +. 1 ==.. 0 *[-2,-1] => field +do x={round(u(w-1))} y={round(u(h-1))} while i($x,$y)!=1 ++f[field] 11 =. 12,$x,$y => board +24,24,1,3,200 fc. 255,180,130 +ellipse. 12,12,4,4 line. 6,12,18,12 line. 12,6,12,18 line. 13,10,14,10,1,255 line. 13,11,14,11,1,255 +z. 1,1,{w-2},{h-2} frame. 1,1,0 ++fc. 230,250,255 ++t. "1",10,5,13,1,0,196,0 +t.. "2",9,5,13,1,0,128,0 +t... "3",9,5,13,1,0,0,255 ++t[-4] "4",9,5,13,1,255,0,0 +t[-5] "5",9,5,13,1,200,0,0 +t[-6] "6",9,5,13,1,150,0,0 ++t[-7] "7",9,5,13,1,128,0,0 +t[-8] "8",9,5,13,1,64,0,0 ++f. 'if(x<=1||y<=1||x>=w-2||y>=h-2,if(x sprites +(0,23;0,23^0,0;23,23) r. 24,24,1,2,3 r. {board,w*24},{board,h*24},1,2,0,2 => offsets +.,.,1,3,255 frame. 1,1,0 frame. 23,23,255 +0 t. "Number of mines : "$nb_mines,0,0,18,1,100,200,255 negate. j.. .,{({-2,w}-w)/2},{{-2,h}-h-2} rm. +=> canvas +failed=0 succeeded=0 nb_flags=0 started=0 +do ++*[board] 24 r. [offsets],[offsets] channels. 0,1 +. [offsets] +warp[sprites] .,0,0,1 rm.. +j[canvas] .,24,24 rm. +wait -1 +if $failed +0 t. "Game\nOver!",3,3,38,1,255 r. 100%,100%,1,4 sh. 3 dilate. 5 /. 2 rm. +drop_shadow. 5,5,1 blend[canvas,-1] alpha +0 t. "Boom! You failed!",0,0,18,1,100,255,255 r. {canvas,w},100%,1,3,0,0,0.5,0.5 negate. j[canvas] .,0,3 rm. +do w[canvas] {w},{h} wait while {*}" && "!{*,ESC}" && "!{*,Q} +elif $succeeded +0 t. "Success!",3,3,38,1,255 r. 100%,100%,1,4 sh. 3 dilate. 5 /. 2 rm. +drop_shadow. 5,5,1 blend[canvas,-1] alpha +0 t. "Congratulations! ("{round($|-$tic)}" s)",0,0,18,1,255,100,255 r. {canvas,w},100%,1,3,0,0,0.5,0.5 +negate. j[canvas] .,0,3 rm. +do w[canvas] {w},{h} wait while {*}" && "!{*,ESC}" && "!{*,Q} +else ++==[board] 10 nb_flags={is} rm. +do +if !$started tic=$| fi +0 t. "Elapsed time : "{round($|-$tic)}" s / Flags : "$nb_flags,0,0,18,1,255,200,0 +r. {canvas,w},100%,1,3,0,0,0.5,0.5 +negate. j[canvas] .,0,3 rm. +wait 50 +x={int(({*,x}-24)/24)} y={int(({*,y}-24)/24)} b={*,b} +w[canvas] {w},{h},0,"[G"{`39`}"MIC] Minesweeper" +while {*}" && "!{*,ESC}" && "!{*,Q}" && "!$b +fi +if $x>=0\ &&\ $y>=0\ &&\ $x<{board,w}\ &&\ $y<{board,h} +if $b&1 +started=1 val={field,i($x,$y)} +if $val==0 +==[field] 0 j[board] [field],0,0,0,0,1,. rm. failed=1 +elif $val==1 ++flood[field] $x,$y,0,0,1,1,-1 ==. -1 dilate. 3 j[board] [field],0,0,0,0,1,. rm. +else =[board] $val,$x,$y +fi +elif n={board,i($x,$y)};$b&2" && "n>=10" && "n<=11 +=[board] {if({board,i($x,$y)}==11,10,11)},$x,$y +elif $b&4 f[board] 10 +fi +fi +if $nb_mines==$nb_flags\ &&\ {board,iM}!=11 succeeded=1 fi +while {*}" && "!{*,ESC}" && "!{*,Q} +w 0 +#@cli x_minimal_path +#@cli : Launch the minimal path demo. +x_minimal_path : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Minimal path"$n" ------------------------------------------\n +----\n +---- "${c}"Click on two points"$n" to compute and display the minimal\n +---- path between those points. The ending point is then\n +---- chosen as the next starting point for another path.\n +---- Key '"${c}"S"$n"' to save snapshot of the current view.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------------------------" +if !$! sp ? fi +n 0,200 round 1 +foreach { +w[0] -1,-1,0,"[G"{`39`}"MIC] Select Starting Point P0" +if !narg($first_time) +parallel 0,"+l[0] { r2dy 128 frame 1,1,0 alert \"[G"{`39`}"MIC Minimal Path]\",\"The G\47MIC minimal path demo illustrates how minimal paths\ncan be computed in images to detect and track edge points.\nUse your mouse to select desired starting and ending points,\nand see what is the minimal path computed between these points.\",\"OK\" rm }" +first_time=0 +fi ++gradient_norm b. 1 f. exp(-i/10) +to_rgb[0] +select[0] 0 P0={^} +ellipse[0] {@0,1},3,3,0,1,255,0,255 +ellipse[0] {@0,1},3,3,0,1,0xFFFFFFFF,255,255,255 +rm. +if min($P0)>=0 +p=1 +do +w[0] -1,-1,0,"[G"{`39`}"MIC] Select Ending Point P"$p ++select[0] 0 +if {*,S} +rm. ++to[0] "Saving snapshot...",5,5,13,1,1,255,255,255 w. rm. +o[0] gmic_minimal_path.png +wait -1 +else +P1={^} +ellipse[0] {@0,1},3,3,0,1,255,0,255 +ellipse[0] {@0,1},3,3,0,1,0xFFFFFFFF,255,255,255 +rm. +if min($P1)>=0 ++to[0] "Processing...",5,5,13,1,1,255,255,255 w. rm. ++minimal_path[1] $P0,$P1,1 transpose. +pointcloud. 0 *. 255 r. 100%,100%,1,[0],0,0,0,0,0,0.5 ri. [0],0 -|[0,-1] +P0=$P1 p+=1 +fi +fi +while {*}" && "!{*,ESC}" && "!{*,Q} +fi +rm[1] w 0 +} +#@cli x_morph : _nb_frames>=2,_preview_fidelity={ 0=coarsest | 1=coarse | 2=normal | 3=fine | 4=finest } +#@cli : Launch the interactive image morpher. +#@cli : Default values: 'nb_frames=16' and 'preview_fidelity=3'. +x_morph : check "isint(${1=16}) && isint(${2=3}) && $2>=0 && $2<=4" check_display $0 +if $!<2 error[0--3] "Command '$0': Requires at least two input images!" return fi +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r b=$_vt100_b +e "\n +------ "${g}"Interactive image morpher"$n" ---------------------------\n +----\n +---- "${b}"Source/target window:"$n"\n +---- "${c}"Left mouse button"$n": Add new keypoint on current image\n +---- and move it on the other one.\n +---- "${c}"Right mouse button"$n": Add/move keypoint on current image.\n +---- Key '"${c}"DELETE"$n"' or "${c}"middle mouse button"$n": Delete keypoint.\n +---- Key '"${c}"SPACE"$n"' or "${c}"mouse wheel"$n": Toggle source/target.\n\n +---- "${b}"In-between window:"$n"\n +---- "${c}"Mouse wheel"$n": Change morphing time, from 0 to 1.\n +---- "${c}"Left mouse button"$n": Reset morphing time to 0.5.\n\n +---- "${b}"Both windows:"$n"\n +---- Key '"${c}"TAB"$n"': Change keypoint radius.\n +---- Key '"${c}"ENTER"$n"': Play/stop in-between animation.\n +---- Key '"${c}"R"$n"': Reset keypoints.\n +---- Key '"${c}"K"$n"': Show/hide keypoints.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"': Process fullres and exit.\n +----\n +-----------------------------------------------------------" +offset=0 +radius_keypoints=3 +repeat $!-1 { l[{[$>,$>+1]+$offset}] { +nm0={0,n} nm1={1,n} +to_colormode 0 +rr2d ${-max_wh},2 +=> img0,img1 +256,1,1,1,"x>=4?x-2:1" map. 2 => colormap +selected_keypoint=-1 +view_keypoints=1 +time_inbetween=0.5 +animate_inbetween=0 +move_other=0 +frame=0 +do +if !narg($keypoints) +if narg($__x_morph_keypoints) ($__x_morph_keypoints) r. 1,{w/5},1,5,-1 +else 1,4,1,5,"p = y%2; q = int(y/2); [ [ p,q,p,q ]*100,y ]" +fi +N0={h} => keypoints +rmn warp0,warp1 +fi +if !narg($imgb0)" || "!narg($imgb1) +if {*} wdims=${"fitscreen "{*,d},{img0,{*,d}*h/w}} +else wdims=${"fitscreen "{img0,[w,h,1]},128,50%} +fi +w[] $wdims,0,"[G'MIC] Interactive Morph" +repeat 2 { +to_color[img$>] r. $wdims,1,100%,2 n. 0,255 => imgb$> } +rmn imgr,warp0,warp1 +fi +if (!narg($warp0)" || "!narg($warp1)) +subsamp:=arg(1+$2,8,6,4,2,1) ++_x_warp_rbf[keypoints] {imgb0,round([w,h]/$subsamp)} ++l[keypoints] { s c,-2 rv[0,1] a c } +_x_warp_rbf. {imgb0,round([w,h]/$subsamp)} rm.. +*[-2,-1] $subsamp +r[-2,-1] {imgb0,[w,h]},1,100%,3 +=> warp0,warp1 +rmn imgm +fi +if !narg($imgr) +[imgb$frame] => imgr +if s==4 drgba. fi +if $view_keypoints +eval[keypoints] "* +begin( +fact = ([ w#"$imgb0",h#"$imgb0" ] - 1)/100; +const radius1 = "$radius_keypoints"; +const radius2 = radius1 + 2; +const opacity = min(1,3/"($radius_keypoints-1)"); +); +X = round((I)[2*"$frame",2]*fact); +y=="$selected_keypoint"?(ellipse(#-1,X,radius2+2,radius2+2,0,1,255)); +ellipse(#-1,X,radius2,radius2,0,opacity,0); +ellipse(#-1,X,radius1,radius1,0,opacity,I[#"$colormap",i4]); I" +fi +w. -1,-1,0,"[G'MIC] Interactive Morph ("${"s0=Source s1=Target u ${s"$frame"}"}")" +fi +if !narg($imgm) +t,onemt={t=$animate_inbetween?0.5*(1+sin(2*($time_inbetween+$|-$animate_inbetween))):$time_inbetween;[t,1-t]} ++*[warp1] $t *. -1 +warp[imgb0] .,1,2,3 rm.. *. $onemt ++*[warp0] $onemt *. -1 +warp[imgb1] .,1,2,3 rm.. *. $t ++[-2,-1] c. 0,255 => imgm +w1. -1,-1,0,"[G'MIC] Interactive Morph (In-between)" +fi +if $animate_inbetween wait 40 else wait fi +mb={*,b} mxy={[{*,x,y}]*100/([{*,w,h}]-1)} mouse_over={{*,x}>=0} +if $mouse_over" && "($mb" || "{*,DELETE})" && "$selected_keypoint<0" && "h#$keypoints>0 +selected_keypoint={keypoints,"dmin = inf; kmin = -1; fact = ([w#"$imgr",h#"$imgr"]-1)%; +repeat (h,k, +dist = norm(((I[k])[2*"$frame",2] - ["$mxy"])*fact); +dist=0 && dmin<"max(8,1.5*$radius_keypoints)"?kmin:-1"} +fi +if {*,-o}" || "{*,-SPACE}" || "{*1,-SPACE} frame={!$frame} rmn imgr fi +if {*,-K}" || "{*1,-K} view_keypoints={!$view_keypoints} rmn imgr fi +if {*,-R}" || "{*1,-R} rmn keypoints,imgr __x_morph_keypoints= fi +if {*,-TAB}" || "{*1,-TAB} +radius_keypoints={max(2,($radius_keypoints+2)%8)} view_keypoints=1 rmn imgr +fi +if {*,-ENTER}" || "{*1,-ENTER} animate_inbetween={$animate_inbetween?0:$|} fi +if {*,r} rmn imgb0,imgb1 fi +if {*1,r} rmn imgm fi +if {*1,o} +time_inbetween={max(0,min(1,$time_inbetween+0.05*{*1,-o}))} animate_inbetween=0 rmn imgm +fi +if {*1,-b} time_inbetween=0.5 animate_inbetween=0 rmn imgm fi +if $mouse_over" && "($mb==1" || "$mb==2)" && "$selected_keypoint<0 +if $mb==1" && "!$move_other frame={!$frame} move_other=1 fi +({keypoints,[$mxy,$mxy,h]}) +permute. zycx a[keypoints,-1] y +selected_keypoint={keypoints,h-1} +rmn imgr +elif $mouse_over" && "($mb==1" || "$mb==2)" && "$selected_keypoint>=0 +if $mb==1" && "!$move_other frame={!$frame} move_other=1 fi +({[$mxy]}) permute. zycx j[keypoints] .,0,$selected_keypoint,0,{2*$frame} rm. +rmn imgr +elif $mouse_over" && "$selected_keypoint>=0" && ("{*,-DELETE}" || "$mb==4") && "h#$keypoints>4 # Delete keypoint +1,1,1,5,-1 j[keypoints] .,0,$selected_keypoint rm. discard[keypoints] -1 r[keypoints] 1,{keypoints,h/5},1,5,-1 +N0-={$selected_keypoint<$N0?1:0} selected_keypoint=-1 +rmn warp0,warp1,imgr +elif !{*,b}" && "$selected_keypoint>=0 +if $move_other frame={!$frame} move_other=0 fi +selected_keypoint=-1 +rmn warp0,warp1,imgr +fi +if $animate_inbetween rmn imgm fi +while {*}" && "!{*,ESC}" && "!{*,Q}" && "{*1}" && "!{*1,ESC}" && "!{*1,Q} +if !$< __x_morph_keypoints={keypoints,^} fi +rmn colormap,imgb0,imgb1,warp0,warp1,imgr,imgm ++_x_warp_rbf[keypoints] {img0,[w,h]} ++l[keypoints] { s c,-2 rv[0,1] a c } +_x_warp_rbf. {img0,[w,h]} rm.. +=> warp0,warp1 +repeat $1 { +t,onemt={t=$>/max(1,$1-1);[t,1-t]} ++*[warp1] $t *. -1 +warp[img0] .,1,2,3 rm.. *. $onemt ++*[warp0] $onemt *. -1 +warp[img1] .,1,2,3 rm.. *. $t ++[-2,-1] c. 0,255 => ${nm0}_$> +if {*}" && "{*1} w1 0 fi +if {*}" || "{*1} +text="Processing frame \#"$>"/"{$1-1}"..." +if {*} +r. {*,d,e},1,100%,2 to. $text,5,5,20,2 w. rm. fi +if {*1} +r. {*1,d,e},1,100%,2 to. $text,5,5,20,2 w1. rm. fi +fi +} +=> $nm1 k[-$1--1] +offset+={$!-2} +} } w0 0 w1 0 +#@cli x_pacman +#@cli : Launch pacman game. +x_pacman : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Pacman"$n" -----------------------------------------------\n +----\n +---- This is a G\47MIC implementation of the "${g}"pacman"$n" game.\n +----\n +---- Move the pacman to eat all pacdots on the different levels.\n +---- Eating a pacgum makes pacman invincible for "${c}"10 seconds"$n",\n +---- which mean pacman can eat ghosts during this time.\n +---- Eating a ghost earns "${c}"100 pts"$n".\n +---- Eating a cherry earns "${c}"10 pts"$n".\n +---- Eating a strawberry earns "${c}"100 pts"$n".\n +---- Eating an orange earns "${c}"1000 pts"$n".\n +---- Eating a banana earns "${c}"5000 pts"$n".\n +----\n +---- "${c}"Arrow keys"$n" to control pacman.\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------------------------" +l[] { +m "_pacman_ghost_base_gfx : 31,19 circle. 15,15,15,1,1 31,12,1,1,'y<4+8*abs(cos(x*0.3+0.25*pi*$""1))' a[-2,-1] y" +repeat 4 { +_pacman_ghost_standard_gfx 255,0,0,$> => ghost0_$> +_pacman_ghost_standard_gfx 0,255,222,$> => ghost1_$> +_pacman_ghost_standard_gfx 255,184,222,$> => ghost2_$> +_pacman_ghost_standard_gfx 255,184,71,$> => ghost3_$> +_pacman_ghost_afraid_gfx $> => ghosta_$> +_pacman_ghost_base_gfx $> r. 16,16,1,1,2 => ghostm_$> +_pacman_ghost_standard_gfx 0,0,0,$> => ghostd_$> +_pacman_pacman_gfx $> => pacman_$>,pacmanm_$> +} ++channels[ghostd_0] 0 !=. 0 => ghostdm +_pacman_cherry_gfx _pacman_strawberry_gfx _pacman_orange_gfx _pacman_banana_gfx => fruit0,fruit1,fruit2,fruit3 +20,2,1,3,200 => gate +score0,score1,score2,score3,score4=10,100,1000,5000,"Argh!" +repeat 5 { +0 t. ${score$>},0,0,13,1,255,255,255 autocrop. 0 expand_xy. 1,0 +dilate. 3 => score$>,scorem$> +} +time4=255,255,255 time3=255,255,32 time2=255,128,32 time1=255,32,32 +repeat 11 { 0 t. $<" s",0,0,23,1,${time{min(4,round(($<+1)/2))}} => time$< } +0 t. "Get Ready!",0,0,32,1,255 autocrop. 0 expand_xy. 4,0 +dilate. 8 r.. 100%,100%,1,3 => get_ready,get_readym +0 t. "Game\nOver!",0,0,53,1,255 autocrop. 0 expand_xy. 4,0 +dilate. 8 r.. 100%,100%,1,3 => game_over,game_overm +score=0 level=-1 lives=3 is_quit=0 +do +if $level<0 +_rlevel=33 _glevel=33 _blevel=255 +_pacman_map_level{((-$level-1)%6)+1} mw={w} mh={h} mw2={int(w/2)} mh2={int(h/2)} +if $level<-6 replace. 3,2 fi +. => map0,map ++shift[map] -1,0 +shift[map] 0,-1 +shift[map] 1,0 +shift[map] 0,1 a[-4--1] z !=. 1 => can_go ++==[map] 1 100%,100% =. 1,$mw2,$mh2 distance. 1,..,3 channels. 100% +f. 'if(i==2,0,if(i==8,1,if(i==1,2,if(i==4,3,i))))' => path ++==[map] 2 pacdots={is} rm. +level={-$level} +fi +f[map] 'if(i>=4,0,i)' +==[map] 1 expand_xy. 1,0 r. 1600%,1600% erode. 9 b. 2 +g. xy abs[-2,-1] +[-2,-1] >=. 80% b. 2 n. 0,1 shrink_xy. 16 ++*. $_glevel +*.. $_blevel *... $_rlevel a[-3--1] c +16,16,1,1,'x' +-[map] 1 max. 0 *. 16 r. 1600%,1600% +16,16,1,1,'y' ri[-3,-1] ..,0,2 +[-2,-1] a[-2,-1] c +16,16,1,3 _pacman_pacdots_gfx _pacman_pacgum_gfx a[-3--1] y +warp. ..,0,0,1 rm.. -|[-2,-1] r. 100%,{h+24},1,3,0,0,0,1 +t. "Lives :",10,0,24,1,255 t. "Score :",{w-140},0,24,1,255 +if $lives +r[pacman_2] 12,12,1,4,2 r. {100*$lives}%,100%,1,4,0,2 j.. .,90,7 rm. fi => visu +w[visu] {visu,f=h<0.5*{*,v}?1.5:1;[w,h]*=f},0,"[G"{`39`}"MIC] Pacman" cursor[0] 0 +0 t. "Level "$level,0,0,64,1,1 autocrop. 0 expand_xy. 4,0 (0,255^0,255^0,0) +map.. . rm.. dilate.. 8 +=> levelm_N,level_N +repeat 4 { xg$>={16*$mw2} yg$>={16*$mh2+4*$>} dg$>=3 mg$>=0 } +xp={16*10} yp={16*21} dp=-1 pacgum_timer=-1 fruit_timer=$| dying_pacman=0 is_get_ready=1 +xscore=0 yscore=0 nscore=0 oscore=0 +do +t={int(6*$|)%4} left={if($pacgum_timer>=0,10-$|+$pacgum_timer,-1)} +[visu] +repeat 4 { +mg=${mg$>} xg=${xg$>} yg={${yg$>}+24} +if $mg==0 j. [ghost$>_$t],$xg,$yg,0,0,1,[ghostm_$t] +elif $mg==1 t2={if($left>7,$t,if($left>3,int(12*$|)%4,int(24*$|)%4))} j. [ghosta_$t2],$xg,$yg,0,0,1,[ghostm_$t] +elif $mg==2 j. [ghostd_$t],$xg,$yg,0,0,0.8,[ghostdm] +else j. [ghost$>_$t],$xg,$yg,0,0,{$mg-2},[ghostm_$t] j. [ghostd_$t],$xg,$yg,0,0,1,[ghostdm] +fi +} +if $dying_pacman +_pacman_pacman_gfx {$dying_pacman/2} rotate[-2,-1] {90*(abs($dp)-1)} j... ..,$xp,{24+$yp},0,0,1,.,255 rm[-2,-1] +dying_pacman+=1 +if $dying_pacman>64 +if $lives!=1 rm. break fi +j. [game_over],{(w-{game_over,w})/2},{12+(h-{game_over,h})/2},0,0,{min(1,($dying_pacman-64)/50)},[game_overm],255 +rectangle. 90,7,101,18,1,0 +fi +else ++rotate[pacman_$t,pacmanm_$t] {90*(abs($dp)-1)} j... ..,$xp,{24+$yp},0,0,1,.,255 rm[-2,-1] +if $left>=0" && "($left>=5" || "$t<=2) j. [time{round($left)}],{(w-{time0,w})/2-10},1 fi +fi +t. $score,{w-60},3,20,1,255 +if $is_get_ready +j. [level_N],{(w-{level_N,w})/2},{12+(h-1.5*{level_N,h})/2},0,0,1,[levelm_N] +if int($|*4)%2 j. [get_ready],{(w-{get_ready,w})/2},{24+(h+{get_ready,h})/2},0,0,1,[get_readym],255 fi +fi +if $oscore>0 j. [score$nscore],$xscore,$yscore,0,0,$oscore,[scorem$nscore],255 oscore-=0.04 yscore-=1 fi +j. [gate],158,223,0,0,0.6 +w. +if {*,CTRLLEFT}" && "{*,D} w[] {2*w},{2*h} +elif {*,CTRLLEFT}" && "{*,C} w[] {f=h<0.5*{*,v}?1.5:1;[w,h]*=f} +fi +rm. +repeat 4 { +xg=${xg$>} yg=${yg$>} dg=${dg$>} mg=${mg$>} +if max(abs($xg-$xp),abs($yg-$yp))<=8 +if $mg==0" && "!$dying_pacman dying_pacman=1 +xscore=$xp yscore={$yp+12} oscore=1 nscore=4 +elif $mg==1 mg=2 mg$>=$mg score+=100 +xscore=$xp yscore={$yp+12} oscore=1 nscore=1 +fi +fi +if $mg>=2" && "($xg>>4)==$mw2" && "($yg>>4)==$mh2 +mg+=0.01 +if $mg>=3 mg=0 xg&=-2 yg&=-2 fi +mg$>=$mg +fi +if !($xg&15)" && "!($yg&15) +({u},{u},{u},{u};0,1,2,3) +if $mg<2 +=. {u(0.6,1)},{if($mg==0,dX0=$xp-$xg;dY0=$yp-$yg;if(abs(dX0)>abs(dY0),if(dX0>0,0,2),if(dY0>0,1,3)),dX1=$xp-$xg;dY1=$yp-$yg;if(abs(dX1)0,2,0),if(dY1>0,3,1)))} +=. 0,{($dg+2)%4} +if $is_get_ready =. 0.8,{path,i({$xg>>4},{$yg>>4})} fi +else =. 1,{path,i({$xg>>4},{$yg>>4})} +fi +sort. -,x +repeat 4 { d={i($>,1)} +if {can_go,i({$xg>>4},{$yg>>4},$d)} dg=$d break fi +} rm. +dg$>=$d +fi +u={D=${dg$>};(D==0)-(D==2)} +v={D=${dg$>};(D==1)-(D==3)} +xg$>={($xg+$u*(1+($mg==0)))%(16*$mw)} +yg$>={($yg+$v*(1+($mg==0)))%(16*$mh)} +} +wait 22 +if !$dying_pacman +d={if({*,ARROWRIGHT},1,if({*,ARROWDOWN},2,if({*,ARROWLEFT},3,if({*,ARROWUP},4,$dp))))} +if !($xp&15)" && "!($yp&15) +i={map,i({$xp>>4},{$yp>>4})} +if $i==2 score+=10 pacdots-=1 +elif $i==3 pacgum_timer=$| repeat 4 { if !${mg$>} mg$>=1 dg$>={(${dg$>}+2)%4} fi } +elif $i>=4 score+={${score{$i-4}}} xscore=$xp yscore={$yp+12} oscore=1 nscore={$i-4} +fi +=[map] 0,{$xp>>4},{$yp>>4} +16,16,1,3 j[visu] .,$xp,{24+$yp} rm. +d={if({can_go,i({$xp>>4},{$yp>>4},{abs($d)-1})},$d,$dp)} +d={if({can_go,i({$xp>>4},{$yp>>4},{abs($d)-1})},$d,-abs($dp))} +dp=$d +else dp={if(abs($d-$dp)==2,$d,$dp)} +fi +is_get_ready={if($dp>0,0,$is_get_ready)} +u={($dp==1)-($dp==3)} +v={($dp==2)-($dp==4)} +xp={($xp+2*$u)%(16*$mw)} +yp={($yp+2*$v)%(16*$mh)} +if $pacgum_timer>=0" && "$|>$pacgum_timer+10 +repeat 4 { xg$>&=-2 yg$>&=-2 mg$>={if(${mg$>}==1,0,${mg$>})} } +pacgum_timer=-1 +fi +if !$is_get_ready" && "($|-$fruit_timer)>=10 +x={round(u(0,{map0,w}))} +y={round(u(0,{map0,h}))} +if !{map,i($x,$y)}" && "{map0,i($x,$y)}==2 +n={min(3,int(abs(g*1.7)))} =[map] {4+$n},$x,$y j[visu] [fruit$n],{16*$x},{16*$y+24} fruit_timer=$| +fi +fi +fi +if !{*}" || "{*,Q}" || "{*,ESC} is_quit=1 fi +while !$is_quit" && "$pacdots +if $is_quit break +elif $pacdots +lives-=1 +else +level={-$level-1} wait[0] -1 +rm[map0,map,can_go,path] +fi +rm[visu,level_N,levelm_N] +while $lives +rm w 0 } +_pacman_ghost_standard_gfx : +_pacman_ghost_base_gfx $4 (0,$1^0,$2^0,$3) map.. . rm. +ellipse. 10,11,3,4,0,1,255 ellipse. 20,11,3,4,0,1,255 +r. 16,16,1,3,2 point. 5,{7-($4>=2)},0,1,1 point. 10,{7-($4>=2)},0,1,1 +_pacman_ghost_afraid_gfx : +_pacman_ghost_base_gfx $1 +if $1<2 col=255,255,255 (0,0^0,0^0,208) else col=255,0,0 (0,248^0,248^0,248) fi +map.. . rm. r. 16,16,1,3,2 +line. 4,4,6,6,1,$col,255 line. 4,6,6,4,1,$col,255 +line. 9,4,11,6,1,$col,255 line. 9,6,11,4,1,$col,255 +f. 'if(y>=9&&y<=10&&x>=2&&x<=13&&((int((x+1)/2)+y)%2),arg(c+1,$col),i)' +_pacman_pacman_gfx : +32,32,1,1,'X=x-15;Y=y-15;A=atan2(Y,X);R=sqrt(X^2+Y^2);R<15.5&&abs(A)>0.8*0.33*$1' +(0,255^0,255^0,0^0,255) map.. . rm. r. 16,16,1,4,2 s. c,-3 +_pacman_pacdots_gfx : +(255^184^151) r. 4,4,1,3 r. 16,16,1,3,0,0,0.5,0.5 +_pacman_pacgum_gfx : +64,64,1,3 circle. 31,31,31,1,255,128,64 r2dx. 16 +_pacman_cherry_gfx : +base642img[] "MSBpbnQ4IGxpdHRsZV9lbmRpYW4KNzYgMSAxIDEgIzU5CnicFYpBCgAxDALVXvv/p5ZtmsgmIMoM7k0Cx/ySYYIXrE5qOgTmE1KGlo""UW1pp1qVUqmkt3Hj9Whx3S" +decompress_rle. (0,0,255,255^0,173,0,255^0,0,0,255) map.. . rm. r2dy. 14 r. 16,16,1,3,0,0,0.5,0.5 +_pacman_strawberry_gfx : +base642img[] "MSBpbnQ4IGxpdHRsZV9lbmRpYW4KNzIgMSAxIDEgIzYwCnicJYlJDoAwEMOyHOH/H+UANJ0RBaRIlp1tJ4HAd9HFaoUtTNWC1yIPWT""5ew5em+lT994guKHgAoIoa8w==" +decompress_rle. (0,0,255,255^0,173,0,255^0,0,0,255) map.. . rm. r2dy. 14 r. 16,16,1,3,0,0,0.5,0.5 +_pacman_orange_gfx : +base642img[] "MSBpbnQ4IGxpdHRsZV9lbmRpYW4KNDQgMSAxIDEgIzQ2CnicBcHBDQAgDAOxXPjC/gsxU4VKi7DnAukKPU6SYjTVptxhbSv8wpVufU""wDEZ4=" +decompress_rle. (0,0,255,255^0,173,173,255^0,0,0,255) map.. . rm. r2dy. 14 r. 16,16,1,3,0,0,0.5,0.5 +_pacman_banana_gfx : +base642img[] "MSBpbnQ4IGxpdHRsZV9lbmRpYW4KNzAgMSAxIDEgIzQ4CnicNcqxDQAgDMTANx0S++8aIC9ShObceC6QQoSJ5Ai5vWW2WTI6xr+bvL""U/BnUW3g==" +decompress_rle. (0,255,255^0,173,255^0,0,255) map.. . rm. r2dy. 14 r. 16,16,1,3,0,0,0.5,0.5 +_pacman_map_level1 : +base642img[] "MSBpbnQ4IGxpdHRsZV9lbmRpYW4KMjAxIDEgMSAxICM5Nwp4nGWOUQ6AMAhDKX56Be9/QnWJArEM9MdsGa9QYOsGiOy4FaZYHAo1aM""ezIJ+QJnszLsq2aRaf9Q9GiaBnGmEZhSe8wLOdVqO+My+cFdJj9OpVQ0vzRm8l/L954AHE9jns" +decompress_rle. +mirror. x z. 1,100% a[-2,-1] x +_rlevel=33 _glevel=33 _blevel=255 +_pacman_map_level2 : +base642img[] "MSBpbnQ4IGxpdHRsZV9lbmRpYW4KMjA4IDEgMSAxICMxMDAKeJxljkEOAzEIAxn32C/0/y+MdlUloAKJemgvjAOG+PkCs8ElHsjRQk""0iycwS+/2jcuJlnhhhf3SxPKWw9DaJmYsbmLOqmyaXn92UsVV9Y+sweOvb7YB1vQPPDnV4a/ABHS45BA==" +decompress_rle. +mirror. x z. 1,100% a[-2,-1] x +_rlevel=200 _glevel=33 _blevel=33 +_pacman_map_level3 : +base642img[] "MSBpbnQ4IGxpdHRsZV9lbmRpYW4KMjA5IDEgMSAxICMxMDEKeJxVTlsOwDAIAve5K+z+N+zStGomeyTdjwIKYT9IoHGAbpOgdQ3n1i""1ZinHdnO+20FuKg3nf4WIO3YolP8QEQ75CEkoKaUIDT3K95w8OZbp4lDcMj1PNUjXyDg+u4LTGC5LiOwA=" +decompress_rle. +mirror. x z. 1,100% a[-2,-1] x +_rlevel=33 _glevel=200 _blevel=255 +_pacman_map_level4 : +base642img[] "MSBpbnQ4IGxpdHRsZV9lbmRpYW4KMjEwIDEgMSAxICM5MAp4nHVPQQ6AMAhr8egX/P8TN+cGGSy6TBMTQgqlUPaDBDINLBJZbMQHqm""wq7e40eahgy8i/jDKB1QhlRWBzcPH09Rnr9ALTrHSOuN5N+IFF9LIY9uOPDitcQvE=" +decompress_rle. +mirror. x z. 1,100% a[-2,-1] x +_rlevel=200 _glevel=200 _blevel=33 +_pacman_map_level5 : +base642img[] "MSBpbnQ4IGxpdHRsZV9lbmRpYW4KMjA3IDEgMSAxICMxMDAKeJxdjlEKxCAMRPOmn3uF3v+ELXRrDE2qwrIgzPB8Mn52MDv4ihBbQy""jQyuRBz96RF8NmSYAb98s65j95Wd0bFqxG1MNV/s1ealMujRHdI5wtf9X0WnWmFWO/7JmJXScPVxI1Cg==" +decompress_rle. +mirror. x z. 1,100% a[-2,-1] x +_rlevel=200 _glevel=255 _blevel=33 +_pacman_map_level6 : +base642img[] "MSBpbnQ4IGxpdHRsZV9lbmRpYW4KMTgzIDEgMSAxICM5Mgp4nGVO0QqAQAhz67Ff6P+/sK66TNqJUBCozDHn5gUwW9EIBnhi2nmBPQ""mHCeMwDbuzBNCH1oZeDBEiPSWiAoXU8Yfhn4PyiNc1X3i99NwUJPMoVyVs3PAASqEr4g==" +decompress_rle. +mirror. x z. 1,100% a[-2,-1] x +_rlevel=255 _glevel=130 _blevel=233 +#@cli x_paint +#@cli : Launch the interactive painter. +x_paint : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Interactive painter"$n" -----------------------\n +----\n +---- Use "${c}"mouse"$n" to select color and brush.\n +---- "${c}"Left button"$n" draws a colored stroke.\n +---- "${c}"Right button"$n" fills a colored region.\n +---- "${c}"Arrow keys"$n" or '"${c}"SPACE"$n"' and '"${c}"BACKSPACE"$n"' to swap\n +---- between available images.\n +---- Key '"${c}"S"$n"' to save snapshot of the current view.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------------" +to_rgb +if !$! i[0] 512,512,1,3,255 =>[0] "[New image]" else k[0] fi +1 +parallel "_x_paint[]","w[] 400,320,0,Palette x_select_color[] __color,0,0,0" k[0] +_x_paint : +pass[-2,-1] 1 ('{-2,n}') discard. {'_c1'} =>[0] {t} rm. +__color={0,if(ia<128,vector3(255),vector3(0))} +brushsize=1 +brushopacity=0 +brushangle=90 +brushthickness=1 +image=0 +refresh_image=1 +refresh_brush=1 +ox1=-1 +oy1=-1 +do +if $refresh_brush +rm. (32,64;64,32) r. 16,16,1,3,1 r. {8*48},{4*48},1,3,0,2 +repeat 4 { y=$> +repeat 8 { +ellipse. {48*$>+24},{48*$y+24},{2*$>+1},{(2*$>+1)*$brushthickness},$brushangle,{1-$y/4},255 +} +} +rectangle. {$brushsize*48},{$brushopacity*48},{$brushsize*48+47},{$brushopacity*48+47},1,0xFFFFFFFF,255,128,128 +{w},16,1,3 line. 0,50%,100%,50%,1,0x55555555,128,64,128 +bx={$brushangle*w/180} +rectangle. {$bx-16},20%,{$bx+16},80%,1,128 +line. {$bx-16},20%,{$bx+16},20%,1,255 line. {$bx+16},20%,{$bx+16},80%,1,255 +line. {$bx-16},80%,{$bx+16},80%,1,64 line. {$bx-16},20%,{$bx-16},80%,1,64 +a[-2,-1] y +16,{h-16},1,3 line. 50%,0,50%,100%,1,0x55555555,128,64,128 +by={$brushthickness*(h-16)} +rectangle. 20%,{$by-16},80%,{$by+16},1,128 +line. 20%,{$by-16},80%,{$by-16},1,255 line. 80%,{$by-16},80%,{$by+16},1,255 +line. 20%,{$by-16},20%,{$by+16},1,64 line. 20%,{$by+16},80%,{$by+16},1,64 +a[-2,-1] x +w3. {w},{h},0,"Brush" +refresh_brush=0 +fi +if $refresh_image +w1[$image] {$image,w},{$image,h},0,"Image "\#$image" : "{$image,b}.{$image,x} +refresh_image=0 +fi +x1={*1,x} y1={*1,y} +x2={*2,x} y2={*2,y} +x3={*3,x} y3={*3,y} +if $x1>=0 +if {*1,b}&1 +ox1={if($ox1<0,$x1,$ox1)} +oy1={if($oy1<0,$y1,$oy1)} +delta={max(abs($x1-$ox1),abs($y1-$oy1))} +r1={2*$brushsize+1} +r2={$r1*$brushthickness} +dx={2*($x1-$ox1)/max(1,$delta)} +dy={2*($y1-$oy1)/max(1,$delta)} +o={1-($brushopacity/4)^0.04} +repeat max(1,($delta+1)/2) { +ellipse[$image] {$ox1+$>*$dx},{$oy1+$>*$dy},$r1,$r2,$brushangle,$o,$__color +} +ox1=$x1 oy1=$y1 +refresh_image=1 +else +ox1=-1 oy1=-1 +if {*1,b}&2 +flood[$image] $x1,$y1,0,10,0,1,$__color +refresh_image=1 +fi +fi +fi +if {*1,ARROWRIGHT}" || "{*2,ARROWRIGHT}" || "{*3,ARROWRIGHT}" || "\ +{*1,ARROWUP}" || "{*2,ARROWUP}" || "{*3,ARROWUP}" || "{*1,SPACE}" || "{*2,SPACE}" || "{*3,SPACE} +image={($image+1)%($!-2)} refresh_image=1 +elif {*1,ARROWLEFT}" || "{*2,ARROWLEFT}" || "{*3,ARROWLEFT}" || "{*1,ARROWDOWN}" || "{*2,ARROWDOWN}" || "{*3,ARROWDOWN}" || "{*1,BACKSPACE}" || "{*2,BACKSPACE}" || "{*3,BACKSPACE} +image={($image-1)%($!-2)} refresh_image=1 +fi +if {*1,S} o[$image] gmic_paint.png fi +if {*3,b}" && "$x3>=0 +if $x3<384" && "$y3>=192 brushangle={$x3*180/(w-16)} +elif $x3>=384" && "$y3<192 brushthickness={$y3/(h-16)} +elif $x3<384" && "$y3<192 brushsize={int($x3*8/(w-16))} brushopacity={int($y3*4/(h-16))} +fi +refresh_brush=1 +fi +wait +while {*1}" && "!{*1,Q}" && "!{*1,ESC} +__color=-1 w1[] 0 w2[] 0 w3[] 0 rm[-2,-1] +#@cli x_plasma +#@cli : Launch the plasma effect demo. +x_plasma : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Plasma effect"$n" ----------------------\n +----\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-------------------------------------------" +l[] { +N=8 +repeat $N { +320,200,1,3 rand. 0,255 plasma. 1,0,7 n. 0,255 +amp={u(-40,40)} freq={round(u(2,6))} dir$>={if(u<0.5,-1,1)*round(u(1,2))} +100%,100%,1,1,'$amp*cos(y*2*pi*$freq/h)' +} +{w+2},100%,1,1,'x' 100%,100%,1,1,'Y=(y-80+15*cos(x/30)+10*sin(x/22));if(Y<0||Y>=50,-1,Y)' a[-2,-1] c +0 t. "** Welcome to G\47MIC, a powerful image processing framework **",0,0,50,1,255 +b. 0.5 n. 0,255 +M={w} +w[] {0,f=1.5*h<0.5*{*,v}?3:1.5;[w,h]*=f},0,"[G"{`39`}"MIC] Plasma Effect" +t=0 tt={-1.5*{0,w}} +do +tic=$| +a={int($t)} a2={2*$a} a21={$a2+1} +b={($a+1)%$N} b2={2*$b} b21={$b2+1} ++warp[$a2] [$a21],1,0,2 ++warp[$b2] [$b21],1,0,2 +j.. .,0,0,0,0,{$t-$a} rm. +shift[$a21] 0,${dir$a},0,0,2 +shift[$b21] 0,${dir$b},0,0,2 +if int($t+0.005)>int($t) dir$a={if(u<0.5,-1,1)*round(u(1,3))} fi +t={($t+max(0.005,($|-$tic)))%$N} ++z.. $tt,{$tt+w-1+2} +warp. [-4],0,0,0 +r. 100%,100%,1,3 ++*. -1 +. 255 +j... .,0,0,0,0,1,..,255 rm. +j.. .,-2,-2,0,0,1,.,255 rm. +tt+={max(2,($|-$tic)*250)} +if $tt>=$M tt={-1.5*{0,w}} fi +fps=${-fps} if $fps>0 to. $fps" fps",5,5,16,1,0.2 fi +w. +if {*,CTRLLEFT}" && "{*,D} w[] {3*w},{3*h} elif {*,CTRLLEFT}" && "{*,C} w[] {1.5*w},{1.5*h} fi +rm. wait 20 +while {*}" && "!{*,ESC}" && "!{*,Q} +rm[{-2*$N-2}--1] w[] 0 } +#@cli x_quantize_rgb : _nbcolors>=2 +#@cli : Launch the RGB color quantization demo. +x_quantize_rgb : check "isint(${1=16}) && $1>1" check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"RGB Quantization"$n" --------------------------------------\n +----\n +---- This demo shows how RGB colors can be quantified using\n +---- the "${c}"k-means algorithm"$n".\n +----\n +---- "${c}"Left mouse button"$n" on 3D view rotates the color cube.\n +---- "${c}"Right mouse button"$n" on 3D view toggles colors/clusters mode.\n +---- "${c}"Left mouse button"$n" on image toggles dithering mode,\n +---- "${c}"Left mouse button"$n" on colormap adds a random color.\n +---- "${c}"Right mouse button"$n" on colormap removes a color.\n +---- Key '"${c}"R"$n"' init colormap with random values.\n +---- Key '"${c}"U"$n"' init colormap with uniform sampling.\n +---- Key '"${c}"M"$n"' init colormap with median-cut algorithm.\n +---- Key '"${c}"SPACE"$n"' does a single iteration of k-means and pauses.\n +---- Key '"${c}"ENTER"$n"' runs k-means algorithm.\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------------------------" +if !$! sp ? fi +k[0] to_rgb if h>300 r2dy 300 round 1 fi => img ++r {w*h},1,1,3,-1 r. {min(w,8192)},1,1,3 => colors +$1,1,1,3 rand. 0,255 round. 1 => centroids +_x_quantize_rgb_3d (1,0,0,0;0,1,0,0;0,0,1,0) => pose3d +_x_quantize_rgb_text "Colors",clustering0 +_x_quantize_rgb_text "Clusters",clustering1 +_x_quantize_rgb_text "Dithering: off",dithering0 +_x_quantize_rgb_text "Dithering: on",dithering1 +if {img,h<300} +r2dy[img] 300,1 else [img] fi +{w+315},365,1,3,255 rm.. +rectangle. 4,4,305,305,1,0xFFFFFFFF,0 +rectangle. 309,4,{w-5},305,1,0xFFFFFFFF,0 +rectangle. 4,309,{w-5},360,1,0xFFFFFFFF,0 +.,. +rectangle. 310,5,{w-6},305,1,1 +rectangle. 5,310,{w-6},360,1,2 +300,300,1,1,'(y<<11)+(x<<2)+3' j.. .,5,5 rm. +a[-2,-1] c => visu +dithering=0 clustering=0 pause=1 s0=off s1=on +do +if !narg($visu_3d) ++-[centroids] 3 ++[centroids] 3 a[-2,-1] x permute. cxyz y. -. 128 +j[obj3d] .,0,8 rm. +[obj3d] +if $clustering +if {colors,iM}<256 ++index[colors] [centroids] *. 256 +[colors,-1] +fi ++channels[colors] 0 >>. 8 map. 2 permute. cxyz y. j.. .,0,{{-2,h}-$_N-h} rm. +fi +pose3d. {pose3d,^} +600,600,1,3 j3d. ..,50%,50%,-150,1,2,0,0,600 *. 1.5 b. 0.75 c. 0,255 rm.. r2dx. 50% +j. [clustering$clustering],2,0,0,0,1,[mclustering$clustering],255 +=> visu_3d j[visu] [visu_3d],5,5 +fi +if !narg($visu_img) ++index[img] [centroids],{0.7*$dithering},1 if h<300 r2dy. 300,1 fi +j. [dithering$dithering],2,0,0,0,1,[mdithering$dithering],255 +=> visu_img j[visu] [visu_img],310,5 +fi +if !narg($visu_centroids) ++luminance[centroids] a. [centroids],y sort. +,x rows. 1 r. {visu,w-10},50,1,3 +0 t. "Colors: "{centroids,w},2,0,16,1,255,255,255 +dilate. 3 j... ..,2,2,0,0,1,.,255 +rm[-2,-1] => visu_centroids j[visu] [visu_centroids],5,310 +fi +l[visu] { +w -1,-1,0,"[G"{`39`}"MIC] RGB Quantization" +if {*,CTRLLEFT}" && "{*,D} w[] {2*w},{2*h} elif {*,CTRLLEFT}" && "{*,C} w[] {w},{h} fi +} +x={int({*,x}*{visu,w}/{*,w})} +y={int({*,y}*{visu,h}/{*,h})} +b={*,b} +i={visu,i($x,$y,0,3)} +if $b&1" && "$i==1 +dithering={!$dithering} rm[visu_img] wait -1 +elif $b&1" && "$i==2 +(${-rgb}) y. c a[centroids,-1] x _x_quantize_rgb_3d rm[visu_3d,visu_img,visu_centroids] &[colors] 255 +pause=1 wait 100 +elif $b&2" && "$i==2" && "{centroids,w}>2 +r[centroids] {centroids,w-1} _x_quantize_rgb_3d rm[visu_3d,visu_img,visu_centroids] &[colors] 255 +pause=1 wait 100 +elif $b&2" && "$i>=3 +clustering={!$clustering} rm[visu_3d] wait -1 +elif {*,M} ++&[colors] 255 colormap. {centroids,w},0,0 rm[centroids] => centroids +_x_quantize_rgb_3d rm[visu_3d,visu_img,visu_centroids] &[colors] 255 +pause=1 wait -1 +elif {*,R} +rand[centroids] 0,255 round[centroids] 1 +_x_quantize_rgb_3d rm[visu_3d,visu_img,visu_centroids] &[colors] 255 +pause=1 wait -1 +elif {*,U} +uniform_distribution {centroids,w},3 *. 255 rm[centroids] => centroids +_x_quantize_rgb_3d rm[visu_3d,visu_img,visu_centroids] &[colors] 255 +pause=1 wait -1 +elif {*,ENTER} +pause=0 +elif $b&1" && "$i>=3 +coords={visu,i($x,$y,0,3)-3} u1={(($coords>>2)&511)-150} v1={($coords>>11)-150} +if !narg($u0) u0=$u1 v0=$v1 fi +if $u0!=$u1" || "$v0!=$v1 +n0={sqrt(($u0)^2+($v0)^2)} +nu0={if($n0>135,$u0*135/$n0,$u0)} nv0={if($n0>135,$v0*135/$n0,$v0)} nw0={sqrt(max(0,18225-($nu0)^2-($nv0)^2))} +n1={sqrt(($u1)^2+($v1)^2)} +nu1={if($n1>135,$u1*135/$n1,$u1)} nv1={if($n1>135,$v1*135/$n1,$v1)} nw1={sqrt(max(0,18225-($nu1)^2-($nv1)^2))} +u={$nv0*$nw1-$nw0*$nv1} v={$nw0*$nu1-$nu0*$nw1} w={$nv0*$nu1-$nu0*$nv1} n={sqrt(($u)^2+($v)^2+($w)^2)} +rotation3d[] $u,$v,$w,{-asin($n/18225)*180/pi} mv[pose3d] $! m*[-2,-1] => pose3d +u0=$u1 v0=$v1 rm[visu_3d] +fi +elif !($b&1) u0= +fi +if !$pause" || "{*,SPACE} +pause={*,-SPACE} +&[colors] 255 +index[colors] [centroids] *. 256 +[colors,-1] +repeat s#$colors { # Recompute centroid positions. +sh[colors] $> +histogram. {centroids,w*256},0,{centroids,w*256-1} rm.. +i.. 256,1,1,1,'x' r.. {w},1,1,1,0,2 *.. . r[-2,-1] {centroids,w},1,1,1,2 max. 0.01 /[-2,-1] +} +a[-{colors,s}--1] c +rm[centroids] => centroids ++>>[colors] 8 channels. 0 histogram. {centroids,w},0,{centroids,w-1} +cmax={xM} +repeat w { +if !i($>) point[centroids] $>,0,0,1,{centroids,I($cmax)} point[centroids] $>,0,0,-0.001,${-rgb} fi +} +rm. c[centroids] 0,255 +if $visu_3d rm[visu_3d] fi +if $visu_img rm[visu_img] fi +if $visu_centroids rm[visu_centroids] fi +wait 20 +else if $visu_img wait fi +fi +while {*}" && "!{*,Q}" && "!{*,ESC} +rm w 0 +_x_quantize_rgb_3d : +if $obj3d rm[obj3d] fi ++distribution3d[centroids] circles3d. 5 col3d. 255 +colorcube3d 1 ++&[colors] 255 distribution3d. circles3d. 5 o3d. 0.2 +3d[-3--1] +-3d. 128,128,128 => obj3d _N={i[7]} +_x_quantize_rgb_text : +0 t. "$1",0,0,16,1,255 r. {w+2},15,1,1,0,0,0.5,0.5 +dilate. 3 to_rgb.. +=> $2,m$2 +#@cli x_reflection3d +#@cli : Launch the 3D reflection demo. +x_reflection3d : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"3D reflection"$n" ----------------------\n +----\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-------------------------------------------" +200,400,1,3 rand. 0,255 plasma. 1,100 blur_xy. 30,2 +sh. 0 n. 0,90 rm. sh. 1 n. 0,60 rm. sh. 2 n. 0,180 rm. ++mirror. x [-2,-1] a[-4--1] x ++luminance. mirror. x b. 2 n. 0,255 +torus3d 45,16 col3d. 255,200,0 +spherical3d "125+32*abs(cos(2*theta))",51,50 s3d. rm.. i.. 3,{h},1,1,150,220,255,200,255,255 y.. a[-6--1] y +spherical3d "150*abs(1+0.6*cos(3*phi)*sin(4*theta))",51,50 +r3d[-2,-1] 0,1,0,90 db3d 0 +xb,xl,anim=0 +w[] ${"fitscreen 400,400,1,35%"},0,"[G"{`39`}"MIC] 3D Reflection" +do +tic=$| ++rows. 8,{8+3*i[6]-1} +j... .,0,8,0,0,{if($anim<250,0,0.5-0.5*cos(($anim-250)/100))} rm.. ++z[-6] $xb,0,{$xb+399},399 j3d. ..,75%,50%,0,1,3,0,0 ++z[-6] $xl,0,{$xl+399},399 +xf={min(30,$anim-70)+20*cos(1.8*$|)} +yf={50+20*sin(2.7*$|)} +j3d. [-6],{20+$xf}%,$yf%,0,1,4,0,0 +l3d . rm. +j3d. ..,75%,50%,0,1,5,0,0 j.. .,0,0,0,0,0.6 rm[-3,-1] +j3d. [-4],$xf%,$yf%,0,1,4,0,0 +fps=${-fps} if $fps>0 to. $fps" fps",5,{h-19},13,1,0.2 fi +w. rm. +if {*,CTRLLEFT}" && "{*,D} w[] 800,800 elif {*,CTRLLEFT}" && "{*,C} w[] 400,400 fi +xb={($xb+6)%400} +xl={($xl-6)%400} +anim+=1 +r3d[-2,-1] {sin(0.5*$|)},{cos($|)},1,{max(0.005,$|-$tic)*33} +r3d... -1,0.3,0.8,{max(0.005,$|-$tic)*100} +wait 20 +while {*}" && "!{*,ESC}" && "!{*,Q} +rm[-5--1] w[] 0 +#@cli x_rubber3d +#@cli : Launch the 3D rubber object demo. +x_rubber3d : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"3D rubber object"$n" -------------------\n +----\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-------------------------------------------" +rm +sphere3d 150,0 torus3d 70,15 cylinder3d 20,40 +col3d... 200,200,200,0.3 col3d.. 128,200,76 col3d. 200,128,76 +c3d[-3--1] r3d. 1,0,0,70 +3d[-3--1] +3d. 10,-8,20 *3d. 1.5 +400,400,64,3 +{w},{h},1,3,'if(c==0,x,if(c==1,y,y*{1,d}/h))' +{w},{h},1,3 +w[] ${"fitscreen .,35%"},0,"[G"{`39`}"MIC] 3D Rubber Object" +frame=0 +do +fps=${-fps} +{w},{h},1,3 fc. 16,32,32 j3d. [0],50%,50%,0,1,3,0,0 j[1] .,0,0,$frame rm. +r3d[0] 0.1,1,0.6,{3*cos($|*1.25)} r3d[0] 1,0.2,0.6,-1 ++warp[1] [2],0,0,1 *[3] 0.8 *. 0.2 +[3] . rm. +if $fps>0 to. $fps" fps",5,{h-29},24,2,0.2 fi +w. +if {*,CTRLLEFT}" && "{*,D} w[] {2*w},{2*h} elif {*,CTRLLEFT}" && "{*,C} w[] {w},{h} fi +wait[0] 20 +sh[2] 2 -. 1 &. {{1,d}-1} rm. +frame={($frame-1)%{1,d}} +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w 0 +#@cli x_segment : _max_resolution={ 0 | >=128 } +#@cli : Segment foreground from background in selected opaque RGB images, interactively. +#@cli : Return RGBA images with binary alpha-channels. +#@cli : Default value: 'max_resolution=1024'. +x_segment : check "${1=1024}==0 || $1>=128" check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e[^-1] "Extract foreground from background in image$? interactively, with maximum resolution $1." +e "\n +----------------------------------------------------------------------------------------------------\n +----\n +---- "${c}"Left mouse button"$n" or key '"${c}"F"$n"' create a new foreground control point +(or move an existing one).\n +---- "${c}"Right mouse button"$n" or key '"${c}"B"$n"' create a new background control point +(or move an existing one).\n +---- "${c}"Mouse wheel"$n", or keys '"${c}"CTRL+arrows UP/DOWN"$n"' zoom view in/out.\n +---- '"${c}"CTRL+mouse wheel"$n"', '"${c}"SHIFT+mouse wheel"$n"' or "${c}"arrow keys"$n" move image in zoomed view.\n +---- Key '"${c}"SPACE"$n"' updates the extraction mask.\n +---- Key '"${c}"TAB"$n"' toggles background view modes.\n +---- Key '"${c}"M"$n"' toggles marker view modes.\n +---- Key '"${c}"BACKSPACE"$n"' deletes the last control point added.\n +---- Key '"${c}"PAGE UP"$n"' increases background opacity.\n +---- Key '"${c}"PAGE DOWN"$n"' decreases background opacity.\n +---- Keys '"${c}"CTRL+D"$n"' increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' decrease window size.\n +---- Keys '"${c}"CTRL+R"$n"' reset window size.\n +---- Keys '"${c}"ESC"$n"', '"${c}"Q"$n"' or '"${c}"ENTER"$n"' exit the interactive window.\n +----\n +----------------------------------------------------------------------------------------------------" +foreach { +name={0,n} title={0,b} if narg({0,x}) title=$title.{0,x} fi +w={w} h={h} fdim=${fitscreen[]\ $w,$h} ww={arg(1,$fdim)} wh={arg(2,$fdim)} x0=0 y0=0 x1={w-1} y1={h-1} +selection=-1 marker_mode=2 xpan=-1 ypan=-1 bg_mode=0 opacity=64 +to_rgb => img +if narg($_gui_control_points)>=4 +($_gui_control_points) r. {w/4},4,1,1,-1 +else 0 +fi +=> points +if $1>0 if $w>$h +r2dx[img] {min($1,$w)},2 else +r2dy[img] {min($1,$h)},2 fi else [img] fi +_x_segment. +pw={potential,w} ph={potential,h} +do +wait +x={*,x} y={*,y} b={*,b} o={*,-o} +is_ctrl={{*,CTRLLEFT}" || "{*,CTRLRIGHT}} +is_shift={{*,SHIFTLEFT}" || "{*,SHIFTRIGHT}} +is_mouseout={$x<0" || "$y<0} +x={$x0+$x*($x1-$x0+1)/$ww} y={$y0+$y*($y1-$y0+1)/$wh} +oww=$ww owh=$wh ox0=$x0 oy0=$y0 ox1=$x1 oy1=$y1 +if {*,r} +nww={*,d} nwh={*,e} m={min($nww,$nwh)} +cx={($x0+$x1)/2} cy={($y0+$y1)/2} dx={$nww*($x1-$x0+1)/$ww} dy={$nwh*($y1-$y0+1)/$wh} +x0={$cx-$dx/2} x1={$cx+$dx/2} +y0={$cy-$dy/2} y1={$cy+$dy/2} +ww=$nww wh=$nwh +elif $is_ctrl" && "{*,-D} +nww={min({*,u},$ww*1.25)} nwh={min({*,v},$wh*1.25)} m={min($nww,$nwh)} +if $m==$nww ww=$m wh={$h*$m/$w} else ww={$w*$m/$h} wh=$m fi +elif $is_ctrl" && "{*,-C} +nww={$ww/1.25} nwh={$wh/1.25} +if min($nww,$nwh)>=64 ww=$nww wh=$nwh fi +elif $is_ctrl" && "{*,-R} +fdim=${fitscreen[]\ $w,$h} ww={arg(1,$fdim)} wh={arg(2,$fdim)} +x0=0 y0=0 x1={$w-1} y1={$h-1} +elif ($is_shift" && "$o<0)" || "{*,ARROWLEFT} +dx={($x1-$x0)/6} x0-=$dx x1-=$dx +elif ($is_shift" && "$o>0)" || "{*,ARROWRIGHT} +dx={($x1-$x0)/6} x0+=$dx x1+=$dx +elif ($is_ctrl" && "$o>0)" || "({*,ARROWUP}" && "!$is_ctrl) +dy={($y1-$y0)/6} y0-=$dy y1-=$dy +elif ($is_ctrl" && "$o<0)" || "({*,ARROWDOWN}" && "!$is_ctrl) +dy={($y1-$y0)/6} y0+=$dy y1+=$dy +elif $o>0" || "($is_ctrl" && "{*,ARROWUP}) +if $x1-$x0>16" && "$y1-$y0>16 +cx={if($x>=0" && "!{*,ARROWUP},$x,($x0+$x1)/2)} +cy={if($y>=0" && "!{*,ARROWUP},$y,($y0+$y1)/2)} +x0={$cx+($x0-$cx)*0.75} y0={$cy+($y0-$cy)*0.75} +x1={$cx+($x1-$cx)*0.75} y1={$cy+($y1-$cy)*0.75} +fi +elif $o<0" || "($is_ctrl" && "{*,ARROWDOWN}) +zfactor={max(($x1-$x0+1)/$w,($y1-$y0+1)/$h)} +if $zfactor<1.3 +cx={if($x>=0" && "!{*,ARROWDOWN},$x,($x0+$x1)/2)} +cy={if($y>=0" && "!{*,ARROWDOWN},$y,($y0+$y1)/2)} +x0={$cx+($x0-$cx)/0.75} y0={$cy+($y0-$cy)/0.75} +x1={$cx+($x1-$cx)/0.75} y1={$cy+($y1-$cy)/0.75} +dx={$zfactor^2*($w-$x0-$x1)/2} dy={$zfactor^2*($h-$y0-$y1)/2} +x0+=$dx x1+=$dx y0+=$dy y1+=$dy +else +dx={($w-$x0-$x1)/2} dy={($h-$y0-$y1)/2} +x0+=$dx x1+=$dx y0+=$dy y1+=$dy +fi +elif $b&4" && "!$is_mouseout +if $panx<0" && "$pany<0 panx=$x pany=$y +else dx={round($panx-$x)} dy={round($pany-$y)} x0+=$dx y0+=$dy x1+=$dx y1+=$dy +fi +else panx=-1 pany=-1 +fi +if $ww!=$oww" || "$wh!=$owh" || "$ox0!=$x0" || "$oy0!=$y0" || "$ox1!=$x1" || "$oy1!=$y1 rm[baseview] fi +N={points,w} +is_left_button={$b&1" || "{*,F}} is_right_button={$b&2" || "{*,B}} +is_button={$is_left_button" || "$is_right_button} +if narg($baseview)" && "$is_button" && "$x>=0" && "$y>=0" && "$x<$w" && "$y<$h +if $selection==-1" && "$N +($x;$y) r. $N,2 -. [points] *. {max($ww,$wh)/max($x1-$x0,$y1-$y0)} sqr. s. y +[-2,-1] +dmin={im} selection={if($dmin>25,-1,xm)} rm. +fi +if $selection>=0 +if $marker_mode ++columns[points] $selection ox={i[0]} oy={i[1]} +=. $x =. $y,0,1 =. {1+$is_left_button},0,3 +j[points] .,$selection rm. rm[view] +fi +else +($x;$y;0;{1+$is_left_button}) a[points,-1] x selection=$N if !$marker_mode marker_mode=2 fi rm[view] +fi +else selection=-1 +if {*,SPACE}" && "narg($labels) rm[labels] +elif {*,TAB}" && "narg($baseview) +bg_mode={($bg_mode+1)%6} rm[baseview] wait -1 +elif {*,M}" && "narg($view) +marker_mode={($marker_mode-1)%3} rm[view] wait -1 +elif {*,PAGEDOWN}" && "narg($baseview) +opacity={max(0,$opacity-32)} rm[baseview] wait -1 +elif {*,PAGEUP}" && "narg($baseview) +opacity={min(255,$opacity+32)} rm[baseview] wait -1 +elif {*,BACKSPACE}" && "$N +if $N>1 z[points] 0,{$N-2} +else i=$points rm[points] i[$i] 0 =>[$i] points +fi rm[view] wait -1 +fi +fi +w2={round(($x1-$x0)/2)} h2={round(($y1-$y0)/2)} +if $x0<-$w2 x1-={$x0+$w2} x0=-$w2 fi +if $y0<-$h2 y1-={$y0+$h2} y0=-$h2 fi +if $x1>=$w+$w2 x0+={$w-1+$w2-$x1} x1={$w-1+$w2} fi +if $y1>=$h+$h2 y0+={$h-1+$h2-$y1} y1={$h-1+$h2} fi +if !narg($labels) +N={points,w} +if narg($view) to[view] "Processing...",5,5,20,2 w[view] fi +if $N +[points] +sh. 0,0,0,0 *. {$pw/$w} rm. +sh. 1,1,0,0 *. {$ph/$h} rm. +pointcloud. -1,$pw,$ph dilate. 3 +watershed. [potential] -. 1 +else [potential],[potential],1,1,1 +fi +=> labels +if narg($baseview) rm[baseview] fi +fi +if !narg($baseview) +nx0={$x0*$pw/$w} ny0={$y0*$ph/$h} +nx1={$x1*$pw/$w} ny1={$y1*$ph/$h} ++z[img] $x0,$y0,$x1,$y1 +r. $ww,$wh,1,100%,{if($ww=3 *. -1 +. 1 fi +*. {255-$opacity} +. $opacity a[-2,-1] c +if $bg_mode%3>=1 i.. 100%,100%,1,3,{(($bg_mode-1)%3)*255} blend[-2,-1] alpha +else drgba. +fi +=> baseview +if narg($view) rm[view] fi +fi +if !narg($view) +[baseview] r. 100%,100%,1,3 +if $marker_mode +if $marker_mode==2 rad1=5 rad2=3 opa=1 else rad1=3 rad2=2 opa=0.8 fi +col0=255,0,0 col1=0,255,0 +repeat w#$points { ++columns[points] $> x={(i[0]-$x0)*$ww/(1+$x1-$x0)} y={(i[1]-$y0)*$wh/(1+$y1-$y0)} l={i[3]-1} rm. +circle. $x,$y,$rad1,1,0 circle. $x,$y,$rad2,$opa,${col$l} +} +fi +=> view +w[view] $ww,$wh,0,$title +fi +while {*}" && "!{*,ESC}" && "!{*,Q}" && "!{*,ENTER} +if narg($view) to[view] "Processing fullres...",5,5,20,2 w[view] fi +k[img,points] +N={points,w} status= +if $N +status={points,^} +[img] _x_segment. pointcloud[points] -1,$w,$h +zfact={{img,max(w,h)}/{potential,max(w,h)}} dilate[points] {int(3*$zfact)} +watershed[points] [potential] -[points] 1 k[img,points] +*. 255 +else k[img] [img],[img],1,1,255 +fi +a c => $name +} +u $status +w 0 +_x_segment : +b. 0.2% gradient_norm. f. '1/(1+i^2)' +=> potential +#@cli x_select_color : _variable_name +#@cli : Display a RGB or RGBA color selector. +#@cli : Argument 'variable_name' specifies the variable that contains the selected color values (as R,G,B,[A]) +#@cli : at any time. +#@cli : Its value specifies the initial selected color. Assigning '-1' to it forces the interactive window to close. +#@cli : Default value: 'variable_name=xsc_variable'. +x_select_color : skip ${1=xsc_variable} check_display $0 +rm +n={narg($$1)} if !$n $1=0,0,0 fi +rgba_mode={$n>=4} R={arg(1,$$1)} G={arg(2,$$1)} B={arg(3,$$1)} A={if($rgba_mode,arg(4,$$1),255)} +e[^-1] "Open "${arg0\ $rgba_mode,RGB,RGBA}" color selector widget, with variable '$1' and starting color "($$1)"." +if !{*} w[] {400+24*$rgba_mode},400,0,"Select a color" fi +update_view=1 is_sv=0 is_h=0 is_a=0 colordb=0 is_thread_variable={arg(1,{'$1'})==_'_'" && "arg(2,{'$1'})==_'_'} +m "add_preset : if !narg($_xsc_preset$""1) _xsc_preset$""1=$""2,$""3,$""4 fi" +add_preset 0,0,0,0,0 add_preset 1,255,255,255 add_preset 2,255,0,0 add_preset 3,0,255,0 +add_preset 4,0,0,255 add_preset 5,255,255,0 add_preset 6,255,0,255 add_preset 7,0,255,255 +add_preset 8,50,50,50 add_preset 9,100,100,100 add_preset 10,150,150,150 add_preset 11,200,200,200 +um add_preset +if !narg($_xsc_preset) _xsc_preset=11 fi +($R^$G^$B) c. 0,255 rgb2hsv. H={i[0]} S={i[1]} V={i[2]} rm. +do +w={*,d} h={*,e} x={*,x} y={*,y} b={*,b} +if !$! +$w,$h,1,3,200 +if $rgba_mode x1={w-89} y1={h-57} x2={w-80} else x1={w-49} y1={h-57} x2={w-40} fi +x0=8 y0=8 x3={$x2+31} x4={w-40} x5={$x4+31} x6={max($x0+232+32*$rgba_mode,w-152)} y6={$y1+7} +rectangle {$x0-1},{$y0-1},{$x1+1},{$y1+1},1,0xFFFFFFFF,232 +line {$x0-1},{$y0-1},{$x1+1},{$y0-1},1,128 +line {$x0-1},{$y0-1},{$x0-1},{$y1+1},1,128 +(1;0) (0,1) r[-2,-1] {$x1-$x0+1},{$y1-$y0+1},1,1,3 i... 100%,100%,1,1,$H a[-3--1] c hsv2rgb. j.. .,$x0,$y0 rm. +rectangle {$x2-1},{$y0-1},{$x3+1},{$y1+1},1,0xFFFFFFFF,232 +line {$x2-1},{$y0-1},{$x3+1},{$y0-1},1,128 +line {$x2-1},{$y0-1},{$x2-1},{$y1+1},1,128 +(359;0^1;1^1;1) r. {$x3-$x2+1},{$y1-$y0+1},1,3,3 hsv2rgb. j.. .,$x2,$y0 rm. +if $rgba_mode +rectangle {$x4-1},{$y0-1},{$x5+1},{$y1+1},1,0xFFFFFFFF,232 +line {$x4-1},{$y0-1},{$x5+1},{$y0-1},1,128 +line {$x4-1},{$y0-1},{$x4-1},{$y1+1},1,128 +(1;0) r. {$x5-$x4+1},{$y1-$y0+1},1,4,3 *. 255 drgba. j.. .,$x4,$y0 rm. +fi +t. "Current",$x0,{$y1+12},14,1,0 +if narg($_xsc_old) +t. "Old",$x0,{$y1+34},14,1,0 +($_xsc_old) y. c r. 48,16 drgba. r. {w+2},{h+2},1,3,0,0,0.5,0.5 j.. .,{$x0+55},{$y1+32} rm. +fi +repeat 12 { +(${_xsc_preset$>}) -. 255 r. 4,1,1,1,0 +. 255 +y. c r. 18,18 drgba. frame. 1,1,{255*($>==$_xsc_preset)} +j.. .,{$x6+($>%6)*25},{$y6+($>>=6)*25} rm. +} +update_view=1 +fi +if $update_view +. +cx={$x0+$V*($x1-$x0)} cy={$y0+(1-$S)*($y1-$y0)} +if $cx>$x0 line. {$cx-1},$y0,{$cx-1},$y1,1,200 fi +if $cx<$x1 line. {$cx+1},$y0,{$cx+1},$y1,1,200 fi +if $cy>$y0 line. $x0,{$cy-1},$x1,{$cy-1},1,200 fi +if $cy<$y1 line. $x0,{$cy+1},$x1,{$cy+1},1,200 fi +line. $x0,$cy,$x1,$cy,1,0 line. $cx,$y0,$cx,$y1,1,0 +cy={$y0+(359-$H)*($y1-$y0)/359} +if $cy>$y0 line. $x2,{$cy-1},$x3,{$cy-1},1,200 fi +if $cy<$y1 line. $x2,{$cy+1},$x3,{$cy+1},1,200 fi +line. $x2,$cy,$x3,$cy,1,0 +if $rgba_mode +cy={$y0+(255-$A)*($y1-$y0)/255} +if $cy>$y0 line. $x4,{$cy-1},$x5,{$cy-1},1,200 fi +if $cy<$y1 line. $x4,{$cy+1},$x5,{$cy+1},1,200 fi +line. $x4,$cy,$x5,$cy,1,0 +fi +($H^$S^$V^$A) sh. 0,2 hsv2rgb. rm. round. R={i[0]} G={i[1]} B={i[2]} +r. 48,16 drgba. r. {w+2},{h+2},1,3,0,0,0.5,0.5 j.. .,{$x0+55},{$y1+10} rm. +t. "HSV ("{round($H)}","{round($S*255)}","{round($V*255)}")",{$x0+115},{$y1+24},14,1,0 +if $rgba_mode t. "RGBA ("$R","$G","$B","{round($A)}")",{$x0+115},{$y1+8},14,1,0 +else t. "RGB ("$R","$G","$B")",{$x0+115},{$y1+8},14,1,0 +fi +('${dec2hex\ {$R*65536+$G*256+$B}}') -. {'0'} r. 6,1,1,1,0,0,1,0 +. {'0'} +f. if(i>=_'a'" && "i<=_'z',i+_'A'-_'a',i) +t.. "html ""#"{t},{$x0+115},{$y1+40},14,1,0 rm. +w. 100%,100%,0 rm. +if $rgba_mode $1=$R,$G,$B,$A else $1=$R,$G,$B fi +update_view=0 +fi +if $is_thread_variable wait 50 else wait fi +ww={*,w} wh={*,h} +is_ctrl={{*,CTRLLEFT}" || "{*,CTRLRIGHT}} +if {*,r} ww={*,d} wh={*,e} +elif $is_ctrl" && "{*,-D} ww={1.25*$ww} wh={1.25*$wh} +elif $is_ctrl" && "{*,-C} ww={0.8*$ww} wh={0.8*$wh} +elif $is_ctrl" && "{*,R} ww={400+24*$rgba_mode} wh=400 +fi +ww={max(200,$ww)} wh={max(200,$wh)} +if $ww!={*,w}" || "$wh!={*,h} w[] $ww,$wh rm fi +if $b&1" && "$x>=0" && "$y>=0 +if !$is_h" && "!$is_a" && "($is_sv" || "($x>=$x0" && "$x<=$x1" && "$y>=$y0" && "$y<=$y1)) +S={max(0,min(1,1-($y-$y0)/($y1-$y0)))} V={max(0,min(1,($x-$x0)/($x1-$x0)))} +update_view=1 colordb=0 is_sv=1 k[0] +elif !$is_sv" && "!$is_a" && "($is_h" || "($x>=$x2" && "$x<=$x3" && "$y>=$y0" && "$y<=$y1)) +H={max(0,min(359,359-($y-$y0)*359/($y1-$y0)))} +colordb=0 is_h=1 rm +elif !$is_sv" && "!$is_h" && "($is_a" || "($x>=$x4" && "$x<=$x5" && "$y>=$y0" && "$y<=$y1)) +A={round(max(0,min(255,255-($y-$y0)*255/($y1-$y0))))} +colordb=0 is_a=1 update_view=1 k[0] +elif !$is_sv" && "!$is_h" && "!$is_a" && "{narg($_xsc_old)}" && "$x>=$x0+55" && "$x<=$x0+102" && "$y>=$y1+32" && "$y<=$y1+47 +($_xsc_old) y. c sh. 0,2 rgb2hsv. rm. H={i[0]} S={i[1]} V={i[2]} A={i[3]} +colordb=0 rm +elif !$is_sv" && "!$is_h" && "!$is_a" && "$x>=$x6" && "$x<=$x5" && "$y>=$y6" && "$y<=$y6+50" && "($x-$x6)%25<=20" && "($y-$y6)%25<=20 +p={int(($x-$x6)/25)+6*int(($y-$y6)/25)} (${_xsc_preset$p}) -. 255 r. 4,1,1,1,0 +. 255 y. c sh. 0,2 rgb2hsv. rm. +H={i[0]} S={i[1]} V={i[2]} A={i[3]} +colordb=0 rm +elif !$is_sv" && "!$is_h" && "!$is_a" && "$x>=$x0+55" && "$x<=$x0+102" && "$y>=$y1+10" && "$y<=$y1+27 +_xsc_old=$R,$G,$B,$A colordb={($colordb+1)%2} +if !$colordb +_xsc_preset$_xsc_preset=$R,$G,$B,$A _xsc_preset={($_xsc_preset-1)%12} +fi +rm wait -1 +else colordb=0 +fi +elif !$b is_sv=0 is_h=0 is_a=0 +fi +if {*,ARROWUP} colordb=0 S={min(1,$S+1/256)} update_view=1 k[0] wait -1 +elif {*,ARROWDOWN} colordb=0 S={max(0,$S-1/256)} update_view=1 k[0] wait -1 +elif {*,ARROWRIGHT} colordb=0 V={min(1,$V+1/256)} update_view=1 k[0] wait -1 +elif {*,ARROWLEFT} colordb=0 V={max(0,$V-1/256)} update_view=1 k[0] wait -1 +elif {*,PAGEUP} colordb=0 H={min(359,$H+1)} rm wait -1 +elif {*,PAGEDOWN} colordb=0 H={max(0,$H-1)} rm wait -1 +fi +if ['$$1']=='-1' break fi +if (($rgba_mode" && "['$$1']!='$R,$G,$B,$A')" || "(!$rgba_mode" && "['$$1']!='$R,$G,$B'))" && "$x<0" && "$y<0" && "!$is_sv" && "!$is_h" && "!$is_a +($$1) y. c -. 255 r. 1,1,1,4,0 +. 255 sh. 0,2 rgb2hsv. rm. +H={i[0]} S={i[1]} V={i[2]} A={i[3]} rm +fi +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w 0 +if $rgba_mode u $R,$G,$B,$A else u $R,$G,$B fi +_xsc_old=${} +#@cli x_select_function1d : _variable_name,_background_curve_R,_background_curve_G,_background_curve_B +#@cli : Open an interactive window, where the user can defined its own 1D function. +#@cli : If an image is selected, it is used to display additional information : +#@cli : - The first row defines the values of a background curve displayed on the window (e.g. an histogram). +#@cli : - The 2nd, 3rd and 4th rows define the R,G,B color components displayed beside the X and Y axes. +#@cli : Argument 'variable_name' specifies the variable that contains the selected function keypoints at any time. +#@cli : Assigning '-1' to it forces the interactive window to close. +#@cli : Default values: 'variable_name=xsf_variable', 'background_curve_R=220', 'background_curve_G=background_curve_B=background_curve_T'. +x_select_function1d : skip ${1=xsf_variable},${2=220},${3=$2},${4=$2} check_display $0 +e[^-1] "Open 1D function widget, with variable name '$1'." +if $! k[0] fi +is_additional_data=$! +if !{*} w[] 400,400,0,"Create a 1D function" fi +reset_w={*,w} reset_h={*,h} +if !narg($$1) $1=0,0,100,100 fi +($$1) => points y. x r. 2,{w/2},1,1,-1 +is_thread_variable={arg(1,{'$1'})==_'_'" && "arg(2,{'$1'})==_'_'} selected=-1 X=-1 Y=-1 +do +if !narg($baseview) +{{*,d}-48},{{*,e}-48},1,3,255 +if $is_additional_data +100%,100% +rows[0] 0 graph.. .,3,0,0,0,1,1 rm. c. 0,1 ++fc.. ${2-4} j... .,0,0,0,0,1,.. rm[-2,-1] +fi +grid. {(w-1)/8},{(h-1)/8},0,0,0.2,0xCCCCCCCC,0 +line. 0,100%,100%,0,0.2,0 +frame. 24,24,200 +rectangle. 23,23,{w-24},{h-24},1,0xFFFFFFFF,232 line. 23,23,23,{h-24},1,128 line. 23,23,{w-24},23,1,128 +if $is_additional_data" && "{0,h}>1 +if {0,h}>2 +rows[0] 1,3 else +rows[0] 1 r. 100%,3 fi +r. {-2,w-48},3,1,1,3 permute. xzcy r. 100%,8 frame. 1,1,0 +j.. .,23,{-2,h-19} rotate. -90 j.. .,{-2,w-19},23 rm. +fi +=> baseview +l { rm[view] onfail } +fi +if !narg($view) ++z[baseview] 24,24,{baseview,w-25},{baseview,h-25} r. 200%,200% +function1d[] 1,{points,^} +l. { +c 0,100 transpose +i[0] ({'CImg3d'},{h},{h-1}) +i.. 1,100%,1,1,y 1,100% a[-3--1] x +1,{h-1},1,1,2 +f. y ++. 1 a[-3--1] x +4,100%,1,1,1 y a y col3d 0 +} +*3d. {-2,(w-1)/100},{-2,(1-h)/100} +j3d.. .,0,100%,0,1,1,0,0 rm. +repeat h#$points { +x={points,i(0,$>)} y={100-{points,i(1,$>)}} +circle. $x%,$y%,6,1,0xFFFFFFFF,0 +} +if $selected>=0 +x={points,i(0,$selected)} y={100-{points,i(1,$selected)}} +circle. $x%,$y%,3,1,0 +fi +r. 50%,50%,1,3,2 ++j[baseview] .,24,24 rm.. +if $X>=0" && "$Y>=0 t. "X: "{min(255,round(255*$X/100))}" Y: "{min(255,round(255*$Y/100))},24,6,12,1 fi +=> view +w[view] +fi +if $is_thread_variable wait 50 else wait fi +x={*,x} y={*,y} b={*,b} is_ctrl={{*,CTRLLEFT}" || "{*,CTRLRIGHT}} +X={($x-24)*100/({*,w}-49)} Y={100-($y-24)*100/({*,h}-49)} +oww={*,w} owh={*,h} ww=$oww wh=$owh +if {*,r} ww={*,d} wh={*,e} +elif $is_ctrl" && "{*,-D} ww={view,w*125%} wh={view,h*125%} +elif $is_ctrl" && "{*,-C} ww={view,w*75%} wh={view,h*75%} +elif $is_ctrl" && "{*,R} ww=$reset_w wh=$reset_h +elif !$is_ctrl" && "{*,R} rm[points] (0,0;100,100) => points $1={points,^} rm[view] +elif $b&3 +is_inside={$X>=0" && "$Y>=0" && "$X<=100" && "$Y<=100} +if $selected<0 +f[points] 'sqrt((i-$X)^2+(j(1)-$Y)^2)*{*,w}%' z. 0,0 selected={if(im>8,-1,ym)} rm. fi +if $x>=0" && "$b&1" && "$selected>=0 +if {*,SHIFTLEFT}" || "{*,SHIFTRIGHT} X={points,i(0,$selected)} fi +if {*,CTRLLEFT}" || "{*,CTRLRIGHT} Y={points,i(1,$selected)} fi +if {points,$selected>0" && "$selected8,-1,ym)} $1={points,^} rm[view,-1] +elif $b&2" && "$selected>0" && "$selected<{points,h-1}" && "$is_inside +l[points] { s y rm[$selected] a y } wait -1 selected=-1 $1={points,^} rm[view] +fi +elif !($b&1) selected=-1 +fi +ww={min(90%*{*,u},max(200,$ww))} +wh={min(90%*{*,v},max(200,$wh))} +if $oww!=$ww" || "$owh!=$wh w[] $ww,$wh rm[baseview,view] fi +if ['$$1']=='-1' break fi +if ['$$1']!=['{points,^}'] +rm[points] ($$1) => points y. x r. 2,{w/2},1,1,-1 l { rm[view] onfail } +fi +while {*}" && "!{*,ESC}" && "!{*,Q} +w[] 0 u {points,^} +if $is_additional_data rm[^0] else rm fi +#@cli x_select_palette : _variable_name,_number_of_columns={ 0=auto | >0 } +#@cli : Open a RGB or RGBA color selector widget from a palette. +#@cli : The palette is given as a selected image. +#@cli : Argument 'variable_name' specifies the variable that contains the selected color values (as R,G,B,[A]) +#@cli : at any time. +#@cli : Assigning '-1' to it forces the interactive window to close. +#@cli : Default values: 'variable_name=xsp_variable' and 'number_of_columns=2'. +x_select_palette : skip ${1=xsp_variable},${2=0} check_display $0 +if !$! error[0--3] "Command '$0': Missing specified palette image." fi +k[0] +r {w*h*d},1,1,{s},-1 to_color. rgba_mode={s==4} to_rgba. => palette +e[^-1] "Open "${arg0\ $rgba_mode,RGB,RGBA}" color selector widget for palette$?, with variable name '$1'." +if w>1024 error[0--3] "Command '$0': Too much colors ("{w}") in selected palette." fi +if !{*} w[] 400,400,0,0,-1,-1,"Palette: "{0,b} fi +selected=-1 oselected=-1 +do +ww={*,w} wh={*,h} +R={palette,round(i($selected,0,0,0))} G={palette,round(i($selected,0,0,1))} +B={palette,round(i($selected,0,0,2))} A={palette,round(i($selected,0,0,3))} +if $selected>=0" && "$oselected!=$selected +if $rgba_mode $1=$R,$G,$B,$A else $1=$R,$G,$B fi +fi +if ['$$1']=='-1' break fi +if !narg($baseview) l[palette] { +{w},1,1,1,x +. 1 +s. x append_tiles[^0] $2 +M={w} N={h} 100%,100%,1,1,1 ++r. {$ww-17},100%,1,1,4 +r.. 100%,{$wh-57},1,1,4 +r[-2,-1] .,.. -|[-2,-1] +line. 100%,0,100%,100%,1,1 +line. 0,100%,100%,100%,1,1 +-. 1 *. -1 +r.. .,.,1,1,1 -.. 1 ++map.. [0],0 drgba. +rv[-2,-1] *[-2,-1] ++!=.. -1 dilate. 3 +mv... $! +. 1 a[-3--1] c +=> baseview +} +if narg($view) rm[view] fi +fi +if !narg($view) +$ww,$wh,1,3,200 +if $selected<0 sh[baseview] 0,2 +else ++channels[baseview] 0,2 +channels[baseview] 4,4 +!=. {$selected+1} rectangle. 0,0,100%,100%,1,0xFFFFFFFF,1 ++dilate. 5 -[-2,-1] *. -1 +dilate. 5 *.. 255 +r.. 100%,100%,1,3 j... ..,0,0,0,0,1,. rm[-2,-1] +if $rgba_mode t.. "RGBA ("$R","$G","$B","$A")",8,{$wh-45},14,1,0 +else t.. "RGB ("$R","$G","$B")",8,{$wh-45},14,1,0 +fi +($R^$G^$B) rgb2hsv. H={round(i[0])} S={round(i[1]*255)} V={round(i[2]*255)} rm. +t.. "HSV ("$H","$S","$V")",8,{$wh-31},14,1,0 +('${dec2hex\ {$R*65536+$G*256+$B}}') -. {'0'} r. 6,1,1,1,0,0,1,0 +. {'0'} +f. if(i>=_'a'" && "i<=_'z',i+_'A'-_'a',i) +t... "html ""#"{t},8,{$wh-17},14,1,0 rm. +fi +sh[baseview] 3 j... ..,8,8,0,0,1,. rm[-2,-1] +=> view w[view] +fi +if arg(1,{'$1'})==_'_'" && "arg(2,{'$1'})==_'_' wait 50 else wait fi +is_ctrl={{*,CTRLLEFT}" || "{*,CTRLRIGHT}} +if {*,r} ww={*,d} wh={*,e} +elif $is_ctrl" && "{*,-D} ww={1.25*$ww} wh={1.25*$wh} +elif $is_ctrl" && "{*,-C} ww={0.8*$ww} wh={0.8*$wh} +elif $is_ctrl" && "{*,R} ww=400 wh=400 +fi +ww={max(200,$ww)} wh={max(200,$wh)} +if ($ww!={*,w}" || "$wh!={*,h})" && "narg($baseview) w[] $ww,$wh rm[baseview] fi +oselected=$selected +if narg($baseview) +x={*,x} y={*,y} b={*,b} +if $b&1" && "$x>=0" && "$y>=0 +if {baseview,i($x-8,$y-8,0,4)} selected={baseview,i($x-8,$y-8,0,4)-1} else selected=-1 fi +rm[view] wait -1 +elif {*,ARROWUP}" && "$selected>=$M selected-=$M rm[view] wait -1 +elif {*,ARROWDOWN}" && "$selected<{0,w-$M} selected+=$M rm[view] wait -1 +elif {*,ARROWRIGHT}" && "$selected<{0,w-1} selected+=1 rm[view] wait -1 +elif {*,ARROWLEFT}" && "$selected>0 selected-=1 rm[view] wait -1 +fi +fi +while {*}" && "!{*,ESC}" && "!{*,Q} +w 0 k[0] +if $selected>=0 if $rgba_mode u $R,$G,$B,$A else u $R,$G,$B fi else u -1 fi +#@cli x_shadebobs +#@cli : Launch the shade bobs demo. +x_shadebobs : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Shade bobs"$n" -------------------------------\n +----\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-------------------------------------------------" +rm t=100 w ${"fitscreen 512,512,1,35%"},0,"[G"{`39`}"MIC] Shade Bobs" +do +t+=0.015 +if $t>4*pi" || "{*,b} +rx={v} ry={v} rz={v} rt={v} rcx={u(-0.6*0.6)} t=0 +N={20+round(u(80))} R={(2+round(u(40)))*min({*,w},{*,h})/300} +if $obj3d rm[colormap,img,obj3d] fi +{4+round(u(12))},1,1,3 noise[0] 255,2 ==. 1 r[0] 256,1,1,3,3 *[0] 255 shift[0] 1 => colormap +(67.5;73.5;109.5;103.5;51.5;100.5;{2*$N};$N) 3,{2*$N},1,1,0 +1,$N,1,1,5 2,$N,1,1,'y+x*$N' a[-2--1] x z. 0,5 +4,$N,1,1,1 y[-3--1] a[-4--1] y => obj3d +{*,w},{*,h} => img +wait -1 +fi +r={$ry+$rx*cos(6*$rz*$t)+(1-$rx)*sin(6*$rt*$t)} +(0;{30*$ry*($N-1)}) ($t;{2*pi*($N-1)/$N+$t}) r[-2,-1] 1,$N,1,1,3 ++.. {360*sin($rz*$t)} *.. {pi/180} ++sin[-2,-1] cos[-4,-3] *[-4,-2] $r *[-3,-1] $rcx +[-4,-3] +[-2,-1] +*.. {{*,w}/2} *. {{*,h}/2} a[-2,-1] x +++. $R -.. $R a[-2,-1] y z. 0,2 y. j[obj3d] .,0,8 rm. +j3d[img] [obj3d],50%,50%,0,-1,2,0,0 +&[img] 255 +map[img] [colormap] w. rm. wait 20 +if {*,CTRLLEFT}" && "{*,D} w[] 1024,1024 elif {*,CTRLLEFT}" && "{*,C} w[] 512,512 fi +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w 0 +#@cli x_spline +#@cli : Launch spline curve editor. +x_spline : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Spline curve editor"$n" --------------------------\n +----\n +---- "${c}"Mouse"$n" to insert/move/delete points.\n +---- Key '"${c}"R"$n"' to reset the curve.\n +---- Key '"${c}"SPACE"$n"' to shows/hide spline curve.\n +---- Key '"${c}"P"$n"' to shows/hide control points.\n +---- Key '"${c}"ENTER"$n"' to shows/hide control polygon.\n +---- Key '"${c}"T"$n"' to shows/hide point tangents.\n +---- Key '"${c}"I"$n"' to shows/hide point indices.\n +---- Key '"${c}"C"$n"' to shows/hide point coordinates.\n +---- Keys '"${c}"+"$n"' and '"${c}"-"$n"' to increase/decrease roundness.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-----------------------------------------------------" +if $! a x n 0,255 to_rgb else (0;0^0;128^0;0) r. 1024,1024,1,3,3 => "[G"{`39`}"MIC] Spline Editor" fi +w[0] {0,[w,h]/2},0,0,{n} +0 +roundness=0.5 +visuflags=23 +nearest=-1 +active=-1 +do +if !{1,whds} +rm[1] roundness=0.5 nearest=-1 active=-1 +i[1] ({0.2*w},{0.2*h};{0.2*w},{0.8*h};{0.8*w},{0.8*h};{0.8*w},{0.2*h}) +fi +[1] ({{*,w}*2/{0,w}},{{*,h}*2/{0,h}}) *[-2,-1] ++shift[2] 0,-1,0,0,2 +shift[2] 0,1,0,0,2 -[-2,-1] *. $roundness ++s. x sqr[-2,-1] +[-2,-1] sqrt. r. 2 +/[-2,-1] rm.. ++r[0] {2*[{*,w},{*,h}]},1,3 +if $visuflags&4 polygon. {2,h},{2,^},0.3,128,200,255 fi +repeat h#1 { +line. {2,@0-3},0.3,255,255,0 +if $visuflags&1 +spline. {2,@0-1},{3,@0-1},{2,@2-3},{3,@2-3},1,255 +fi +if $visuflags&8 +thickline. {{2,@0}-{4,@0}*40},{{2,@1}-{4,@1}*40},{{2,@0}+{4,@0}*40},{{2,@1}+{4,@1}*40},3,1,0,255,0 +fi +if $visuflags&16 +t. $>,{{2,@0}-10},{{2,@1}-42},35,1,255,255,0 +fi +if $visuflags&32 +t. "("{round({1,@0})}","{round({1,@1})}")",{{2,@0}-50},{{2,@1}+16},30,1,100,200,255 +fi +shift[1-4] 0,-1,0,0,2 +} +if $visuflags&2 repeat h#1 { +ellipse. {2,@0-1},10,10,0,1,0,0,0 ellipse. {2,@0-1},8,8,0,1,255,100,155 shift[2] 0,1,0,0,2 +} fi +r2dx. 50% w. rm[3,4,-1] wait +if {*,SPACE} visuflags+={if($visuflags&1,-1,1)} wait -1 fi +if {*,P} visuflags+={if($visuflags&2,-2,2)} wait -1 fi +if {*,ENTER} visuflags+={if($visuflags&4,-4,4)} wait -1 fi +if {*,T} visuflags+={if($visuflags&8,-8,8)} wait -1 fi +if {*,I} visuflags+={if($visuflags&16,-16,16)} wait -1 fi +if {*,C}" && "!{*,CTRLLEFT}" && "!{*,CTRLRIGHT} +visuflags+={if($visuflags&32,-32,32)} wait -1 fi +if {*,PADADD}" && "$roundness<1 roundness*=1.1 wait -1 fi +if {*,PADSUB}" && "$roundness>0.1 roundness*=0.9 wait -1 fi +if {*,R}" && "!{*,CTRLLEFT}" && "!{*,CTRLRIGHT} rm. i[1] 0 wait -1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,D} w[] {{*,w}*1.5},{{*,h}*1.5} fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,C} w[] {{*,w}/1.5},{{*,h}/1.5} fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,R} w[] {0,w},{0,h} fi +if {*,r} w[] fi +if {*,b}==0 active=-1 +elif {*,x}>=0" && "{*,b}" && "$active==-1 +[2] ({2*[{*,x},{*,y}]}) -[-2,-1] sqr. s. x +[-2,-1] +nearest={ym} +if im<256 active=$nearest fi +rm. +fi +rm[2] +if {*,b}&1" && "{*,x}>=0" && "$active!=-1 +=[1] {{*,x}*{0,w}/{*,w}},0,$active +=[1] {{*,y}*{0,h}/{*,h}},1,$active +elif {*,b}&2" && "{*,x}>=0" && "{1,h}>3 +l[1] { s y rm[$nearest] a y } wait -1 +elif {*,b}&1" && "{*,x}>=0 +xy=({{*,x}*{0,w}/{*,w}},{{*,y}*{0,h}/{*,h}}) ++shift[1] 0,-1,0,0,2 +. [1] /. 2 +$xy -[-2,-1] sqr. s. x +[-2,-1] +ns={ym} rm. +l[1] { s y i[{$ns+1}] $xy a y } +active={$ns+1} +fi +while {*}" && "!{*,ESC}" && "!{*,Q} ++shift[1] 0,-1,0,0,2 +shift[1] 0,1,0,0,2 -[-2,-1] *. $roundness +[0],[0],1,1,2 rm[0] +repeat h#1 { spline. {0,@0-1},{1,@0-1},{0,@2-3},{1,@2-3},1,1 shift[0] 0,-1,0,0,2 shift[1] 0,-1,0,0,2 } +flood. 0,0,0,0,0,1,0 +rm[0,1] w 0 +#@cli x_starfield3d +#@cli : Launch the 3D starfield demo. +x_starfield3d : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"3D starfield"$n" ---------------------------------------\n +----\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-----------------------------------------------------------" +l[] { +('G\47MIC') s x +x=0 N=$! repeat $N { 0 t. {$>,t},0,0,48,1,1 x$>=$x y$>=0 z$>={-3200-150*$>} x={$x+w+8} } k[50%--1] +expand_xy 6,0 dilate_circ 5 b 0.5 expand_z 1,0 isosurface3d 10% *3d 1,1,5 rv3d +repeat $N { col3d[$>] ${-rgb} } +0 t. "Version "${-strver},0,0,48,1,1 r2dy. 18 +f. 255 to_rgb. +random3d 2500 col3d. 255 *3d. 320,200,1000 -3d. 160,100 +l3d 0,0,-600 +w[] ${"fitscreen 640,400,1,35%"},0,"[G"{`39`}"MIC] 3D Starfield" +t0=0 t=0 +do +320,200,1,3 +l.. { +s3d +r[2] 3,{2,h/3},1,1,-1 s[2] x %[4] 1000 ++/[4] 1000 *. -1 n. 0,2 c. 0,1 sqr. j.. . rm. +a[2-4] x +y a y +} +j3d. ..,50%,50%,-600,1,0,0,0,240 -3d.. 0,0,{min(12,$t0/10-4)} +torus3d 100,30 col3d. 255,64,255 ++col3d. 64,64,255 r3d. 1,0,0,-90 +3d. 65,0,0 ++3d[-2,-1] c3d. +r3d. 1,1,0,{-6*$t} r3d. 0,0,1,{2*$t} +j3d.. .,{($t-200)*2}%,50%,0,0.25,3,0,0 rm. +repeat $N { ++r3d[$>] 1,{$>%4},1,{-${z$>}/2} +j3d.. .,{90+${x$>}},{60+${y$>}},${z$>},1,4,0,0 rm. +z$>={tl=280+6*$<;if($t}+20),-20*($t-tl))} +} +if $t<280 op={max(0,min(1,($t-200)/20))} +else op={max(0,1-($t-280)/20)} +fi +j. ...,{(w-{-3,w})/2},120,0,0,$op,[-4] +w. wait 30 rm. +t0+=1 t={$t0%350} +if !$t x=0 repeat 5 { z$>={-3200-150*$>} } fi +while {*}" && "!{*,ESC}" && "!{*,Q} +w[] 0 rm +} +#@cli x_tetris +#@cli : Launch tetris game. +x_tetris : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Tetris"$n" --------------------------------------------\n +----\n +---- This is a G\47MIC implementation of the "${g}"Tetris"$n" game.\n +----\n +---- "${c}"Arrow keys"$n" to move/rotate the triominos.\n +---- Key '"${c}"SPACE"$n"' to make the current triomino falling.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +----------------------------------------------------------" +rm +4,1,1,1,1,1,1,1 +3,2,1,1,1,0,0,1,1,1 +3,2,1,1,0,0,1,1,1,1 +2,2,1,1,1,1,1,1 +3,2,1,1,0,1,1,1,1,0 +3,2,1,1,0,1,0,1,1,1 +3,2,1,1,1,1,0,0,1,1 +=> m0,m4,m8,m12,m16,m20,m24 +if u<0.25 +i 2,1,1,1,1,1 +i 2,2,1,1,1,1,0,1 +i 3,1,1,1,1,1,1 +i 1,1,1,1,1 +i 3,2,1,1,1,1,1,1,0,1 +i 3,3,1,1,1,1,1,1,0,1,1,1,1 +=> m28,m32,m36,m40,m44,m48 +fi +repeat $! { i={4*$>} l[m$i] { repeat 3 { +rotate[0] {90*($>+1)} => m{$i+$>+1} } } } +N=$! +3,$N,1,1,'u(16,224)' r. 3,400% => colors +(0,-1,0;1,0,-1;0,1,0) *. 120 => mask +repeat $N { ++r[m$>] 500%,500%,1,3 +correlate. [mask],0 r. 200%,200%,1,1,3 ri.. . *[-2,-1] c. 30%,100% ++r[m$>] .,.,1,3 +replace_color. 0,0,1,1,1,{colors,@{3*$>}-{3*$>+2}} rv[-3,-1] +[-3,-1] c.. 0,255 +channels. 0 *. 255 a[-2,-1] c => s$> +} +rm[colors,mask] +fact={{s0,w}/{m0,w}} +W=12 H=20 +$W,$H . => board,curr_board +{$fact*$W},{$fact*$H},1,3 . => render,curr_render +channels. 0 => curr_render_mask ++rows[render] 0,50% plasma. 1,2 noise. 20 blur_y. 40%,1 +mirror. y a[-2,-1] y ri. [render] +n. 0,64 blur_x. 1 100%,100% noise. 0.5,2 ==. 1 b. 1 *. 300 +[-2,-1] c. 0,255 => background +time=$| score=0 fall_mode=0 gameover=0 n=-1 nn={round(u(0,$N-1))} +do +wait {if($fall_mode,-1,-20)} +if $gameover ++j[background] [curr_render],0,0,0,0,0.7,[curr_render_mask],255 +to. "Game\nOver!",22,30%,32,2,1,255 w. rm. +continue +fi +if $n<0 +l[board] { +s y i=-1 repeat $! { if {$<,im} i=$<,$i fi } +0 rm[$i] a y score+={2^(narg($i)-1)-1} r $W,$H,1,1,0,0,0,1 => board +} +if narg($i)>1 l[render] { s y,$H 0 rm[$i] a y r {$fact*$W},{$fact*$H},1,3,0,0,0,1 => render } fi +n=$nn nn={round(u(0,$N-1))} x={$W/2} y=0 do_render=1 fall_mode=0 +fi +if $do_render +rm[curr_board,curr_render,curr_render_mask] +[board] => curr_board j[curr_board] [m$n],{$x-int({m$n,w}/2)},$y,0,0,1,[m$n] +[render] => curr_render sh[s$n] 3 j[curr_render] [s$n],{$fact*($x-int({m$n,w}/2))},{$fact*$y},0,0,1,.,255 rm. ++*[curr_board] 255 r. [curr_render],[curr_render] => curr_render_mask +0 t. "Score : "$score" Next :",4,0,25,1,200 r. 50%,50%,1,3,2 +!=. 0 *. 255 +j[curr_render] ..,0,0,0,0,1,.,255 j[curr_render_mask] .,0,0,0,0,1,.,255 rm[-2,-1] ++*[m$nn] 196 r. 300%,300%,1,3 j[curr_render,curr_render_mask] .,{{curr_render,w}-w-4},3,0,0,1,.,196 rm. +do_render=0 +fi ++shift[background] 0,{round(-13*$|*1.04^$score)},0,0,2 +j. [curr_render],0,0,0,0,1,[curr_render_mask],255 +w. ${"fitscreen .,20%"},0,"[G"{`39`}"MIC] Tetris" rm. cursor[0] 0 +if {*,SPACE} fall_mode=1 fi +if {*,ARROWUP}" || "{*,ARROWLEFT}" || "{*,ARROWRIGHT} +an={if({*,ARROWUP},n=$n+1;if(n%4,n,n-4),$n)} +nx={w2=int({m$an,w}/2);max(w2,min($x-{*,ARROWLEFT}+{*,ARROWRIGHT},$W-({m$an,w}%2)-w2))} ++j[board] [m$an],{$nx-int({m$an,w}/2)},$y,0,0,-1,[m$an] +if iM==1 x=$nx n=$an fi +rm. +do_render=1 +fi +if {*,ARROWDOWN}" || "$|-$time>0.9^int($score/2)" || "$fall_mode +y+=1 ++j[board] [m$n],{$x-int({m$n,w}/2)},$y,0,0,-1,[m$n] +if iM>1" || "$y+{m$n,h}>$H +if $y<=1 gameover=1 fi +j[board] [curr_board] j[render] [curr_render] n=-1 +fi +rm. +time=$| do_render=1 +fi +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w 0 +#@cli x_threshold +#@cli : Threshold selected images interactively. +x_threshold : +e[^-1] "Threshold image"$_gmic_s" interactively." +foreach { +wsiz0=${"fitscreen ."} +value=-1 +w[] $wsiz0,0,"[G'MIC] "{n}" - Interactive threshold" +0 +for {*}" && "!{*,ESC} { +if [w#1,h#1]!=[{*,w,h}] # Generate image view +rm[1] +slices[0] 50% r. {*,w,h},1,100%,1 w. +fi +mx,my,mb={*,x,y,b} +if $mb" && "$mx>=0" && "$my>=0 +value={"w>h?( dw1 = "{*,w}" - 1; val = (dw1 - "$mx")*100/dw1; ): +( dh1 = "{*,h}" - 1; val = (dh1 - "$my")*100/dh1; )"} +update_view=1 +fi +if $update_view +if $value>=0 ++ge[1] $value% *. 255 +to. "Threshold: "{_round($value,0.1)}%,1%,1%,{max(13,3.5*h%)} +w. rm. +else w. +fi +update_view=0 +fi +wait +if {*,r} update_view=1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,D} +w[] {{*,w}*1.5},{{*,h}*1.5} wait -1 update_view=1 +fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,C} +w[] {{*,w}/1.5},{{*,h}/1.5} wait -1 update_view=1 +fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,R} +w[] $wsiz0 wait -1 update_view=1 +fi +} +w[] 0 rm. u $value% ge ${} +} +#@cli x_tictactoe +#@cli : Launch tic-tac-toe game. +x_tictactoe : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Tic-Tac-Toe game"$n" -----------------\n +----\n +---- Use "${c}"mouse"$n" to select positions of the\n +---- symbols. Close window to exit game.\n +----\n +-----------------------------------------" +message=0 +counter=0 +player=0 +state=0 +tmp3=0 +tmp2=0 +tmp1=0 +_x_tictactoe2 +w. -1,-1,0," " +do +if $player message="Tic-Tac-Toe (O to play)" +else message="Tic-Tac-Toe (X to play)" +fi +do +w[] {w},{h},0,"[G"{`39`}"MIC] "$message wait +if !{*}" || "{*,ESC}" || "{*,Q} w[] 0 rm return fi +if {*,b}&1" && "{*,x}>20" && "{*,y}>20" && "{*,x}<400" && "{*,y}<400 +tmp3={int(({*,x}-15)/130)} +tmp2={int(({*,y}-15)/130)} +tmp1={4^($tmp2*3+$tmp3)} +if int($state/$tmp1)%4 tmp1=-1 fi +else tmp1=-1 fi +while $tmp1<0 +_x_tictactoe{$player%2} +j... ..,{"130*"$tmp3" + 15+u(-5,5)"},\ +{"130*"$tmp2" + 15+u(-5,5)"},0,0,1,. +rm[-2--1] +w. +state+={(1+$player)*$tmp1} +(21,1344,86016,4161,16644,66576,65793,4368;\ +0,0,0,0,1,2,0,0;\ +0,1,2,0,0,0,0,0;\ +3,3,3,4,4,4,5,6) +repeat w { +tmp1={@$>} +if ($state&$tmp1)==$tmp1||($state&(2*$tmp1))==2*$tmp1 +_x_tictactoe{i($>,3)} +j[-4] ..,{130*{-3,i($>,1)}+u(-5,5)},\ +{130*{-3,i($>,2)}+u(-5,5)},0,0,1,. rm[-2--1] +if ($state&$tmp1)==$tmp1 w.. -1,-1,0,"Tic-Tac-Toe (X won!)" +else w.. -1,-1,0,"Tic-Tac-Toe (O won!)" +fi +do wait +if {*} w[] {*,w},{*,h} fi +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w[] 0 return +fi +} +rm. +player={($player+1)%2} +counter+=1 +while $counter<9 +w[] -1,-1,0,0,"Tic-Tac-Toe (Tied game!)" +do wait +if {*} w[] {*,w},{*,h} fi +while {*}" && "!{*,ESC}" && "!{*,Q} +w[] 0 rm +_x_tictactoe : +spread. 4 b. 6,1,0 sharpen. 0.8 n. 0,1 +__x_tictactoe : ++f. 1-i +n.. $2,255 +n... $3,255 n[-4] $1,255 a[-4,-2,-1] c +_x_tictactoe0 : +128,128,1,1,1 line. 15%,15%,85%,85%,1,0 line. 15%,85%,85%,15%,1,0 erode. 12 +_x_tictactoe deform. 4 +__x_tictactoe 40,40,160 +_x_tictactoe1 : +128,128,1,1,1 ellipse. 50%,50%,22%,22%,0,1,0 ellipse. 50%,50%,15%,15%,0,1,1 +_x_tictactoe deform. 4 +__x_tictactoe 160,40,160 +_x_tictactoe2 : +391,391,1,1,"!(x%130) || !(y%130)" r. 421,421,1,1,0,0,0.5,0.5 dilate. 3 _x_tictactoe f. 1-i +100%,100% noise. 10 b. 8,0 sharpen. 1.5 n. 220,255 *[-2,-1] to_rgb. +_x_tictactoe3 : +421,130,1,1,1 line. 10%,60%,90%,60%,1,0 erode. 6 +_x_tictactoe rotate. {u(-6,6)},1,1,50%,50% +__x_tictactoe 180,10,10 +_x_tictactoe4 : +_x_tictactoe3 transpose[-2--1] +_x_tictactoe5 : +421,421,1,1,1 line. 10%,10%,90%,90%,1,0 erode. 6 +_x_tictactoe +__x_tictactoe 180,10,10 +_x_tictactoe6 : +421,421,1,1,1 line. 10%,90%,90%,10%,1,0 erode. 6 _x_tictactoe __x_tictactoe 180,10,10 +#@cli x_warp : _nb_keypoints_xgrid>=2,_nb_keypoints_ygrid>=2,_nb_keypoints_contours>=0,_preview_fidelity={ 0=coarsest | 1=coarse | 2=normal | 3=fine | 4=finest },_[background_image],0<=_background_opacity<=1 +#@cli : Launch the interactive image warper. +#@cli : Default values: 'nb_keypoints_xgrid=nb_keypoints_ygrid=2', 'nb_keypoints_contours=0' and 'preview_fidelity=1'. +x_warp : check "isint(${1=2}) && $1>=2 && isint(${2=$1}) && $2>=2 && isint(${3=0}) && $3>=0 && +isint(${4=1}) && $4>=0 && $4<=4 && ${6=0.5}>=0 && $6<=1" skip "${5=}" check_display $0 +if !$! error[0--3] "Command '$0': Requires at least one input image!" return fi +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Interactive image warper"$n" -----------------------------\n +----\n +---- "${c}"Left mouse button"$n": Add and move keypoint.\n +---- "${c}"Right mouse button"$n": Delete keypoint.\n +---- Key '"${c}"SPACE"$n"' or "${c}"middle mouse button"$n": Show/hide keypoints.\n +---- Key '"${c}"TAB"$n"': Change keypoint radius.\n +---- Key '"${c}"SHIFT"$n"': Toggle to original image.\n +---- Key '"${c}"R"$n"': Reset keypoints.\n +---- Keys '"${c}"ESC"$n"', '"${c}"ENTER"$n"' or '"${c}"Q"$n"': Process fullres and exit.\n +----\n +-------------------------------------------------------------" +if ${"is_image_arg $5"} pass$5 store. background fi +radius_keypoints=4 +foreach { +nm={n} => img +if narg($background) $background rr2d. {-2,[w,h]},2,3 store. rbackground fi +selected_keypoint=-1 +view_keypoints=1 +do +if !narg($imgb) +if {*} wdims=${"fitscreen "{*,d},{img,{*,d}*h/w}} +else wdims=${"fitscreen "{img,[w,h,1]},128,60%} +fi +w[] $wdims,0,"[G'MIC] Interactive Warp" ++to_color[img] r. $wdims,1,100%,2 n. 0,255 => imgb +rmn warp,imgw,imgr +fi +if !narg($keypoints) +if narg($__x_warp_keypoints) ($__x_warp_keypoints) r. 1,{w/4},1,4,-1 +else +nbp,nbq=$1,$2 +1,{$nbp*$nbq},1,4,"const nbp = "$nbp"; const nbq = "$nbq"; +p = y%nbp; +q = int(y/nbp); +x = p*100/(nbp - 1); +y = q*100/(nbq - 1); +[ x,y,x,y ]" +nbc=$3 +if $nbc>0 ++b[imgb] 0.5 gradient_norm. sqrt. {round([w,h]/4)} gaussian. 20% +1,$nbc,1,4,"> +begin(ref(crop(#-1),gauss)); +st = stats(#-2); +iM = st[1]; +xM = st[8]; +yM = st[9]; +img = vector(#w#-1*h#-1,-iM); +draw(#-2,img,xM - w#-1/2,yM - h#-1/2,0,0,w#-1,h#-1,1,1,-1,gauss); +nxyM = [ xM,yM ]*100/([w#-2,h#-2]-1); +[ nxyM,nxyM ]" +rm[-3,-2] +a[-2,-1] y +fi +fi +N0={h} => keypoints +rmn warp,imgw,imgr +fi +if !narg($warp) +subsamp={arg(1+$4,8,6,4,2,1)} ++_x_warp_rbf[keypoints] {imgb,round([w,h]/$subsamp)} *. $subsamp +r. {imgb,[w,h]},1,100%,3 +. '[x,y]' +=> warp +rmn imgw,imgr +fi +if !narg($imgw) ++warp[imgb] [warp],0,1,3 => imgw +rmn imgr +fi +if !narg($imgr) +[imgw] +if narg($rbackground) $rbackground ri. .. j.. .,0,0,0,0,$6 rm. fi +=> imgr +if s==4 drgba. fi +if $view_keypoints +eval[keypoints] "* +begin( +col1 = [ 64,200,255 ]; +col2 = [ 255,255,255 ]; +fact = ([ w#"$imgw",h#"$imgw" ] - 1)/100; +const radius1 = "$radius_keypoints"; +const radius2 = radius1 + 2; +const opacity = min(1,3/"($radius_keypoints-1)"); +); +X = round((I)[0,2]*fact); +ellipse(#-1,X,radius2,radius2,0,opacity,0); +ellipse(#-1,X,radius1,radius1,0,opacity,y<"$N0"?col1:col2); I" +fi +w. +fi +wait +mb={*,b} mxy={[{*,x,y}]*100/([{*,w,h}]-1)} mouse_over={{*,x}>=0} +if $mouse_over" && "$mb" && "$selected_keypoint<0" && "h#$keypoints>0 # Determine selected keypoint +selected_keypoint={keypoints,"dmin = inf; kmin = -1; fact = ([w#"$imgr",h#"$imgr"]-1)%; +repeat (h,k, +dist = norm(((I[k])[0,2] - ["$mxy"])*fact); +dist=0 && dmin<"max(8,1.5*$radius_keypoints)"?kmin:-1"} +fi +if {*,-SPACE}" || "$mb==4 view_keypoints={!$view_keypoints} rmn imgr fi +if {*,-R} rmn keypoints __x_warp_keypoints= fi +if {*,-TAB} +radius_keypoints={max(2,($radius_keypoints+2)%16)} view_keypoints=1 rmn imgr +fi +if {*,SHIFTLEFT}" || "{*,SHIFTRIGHT} +if {imgb,s==4} +drgba[imgb] w. rm. else w[imgb] fi +do wait while {*,SHIFTLEFT}" || "{*,SHIFTRIGHT} rmn imgr +fi +if {*,r} rmn imgb fi +if $mouse_over" && "$mb==1" && "$selected_keypoint<0 +wxy={warp,I([$mxy]*([w,h]-1)/100,1)*100/([w,h]-1)} +({"[ "$mxy,$wxy" ]"}) permute. zycx a[keypoints,-1] y +selected_keypoint={keypoints,h-1} +rmn warp +elif $mouse_over" && "$mb==1" && "$selected_keypoint>=0 +({"[ "$mxy" ]"}) permute. zycx j[keypoints] .,0,$selected_keypoint rm. +rmn warp +elif $mouse_over" && "$mb==2" && "$selected_keypoint>=0" && "h#$keypoints>4 # Remove keypoint +1,1,1,4,-1 j[keypoints] .,0,$selected_keypoint rm. discard[keypoints] -1 r[keypoints] 1,{keypoints,h/4},1,4,-1 +N0-={$selected_keypoint<$N0?1:0} selected_keypoint=-1 +rmn warp +elif !$mb selected_keypoint=-1 +fi +while {*}" && "!{*,ESC}" && "!{*,Q}" && "!{*,ENTER} +if !$< __x_warp_keypoints={keypoints,^} fi ++drgba[imgw] to. "Processing fullres...",5,5,20,2 w. rm. +k[img,keypoints] +_x_warp_rbf[keypoints] {img,[w,h]} +. '[x,y]' +warp[img] .,0,2,3 rm. => $nm +} +c 0,255 w 0 +_x_warp_rbf : +if !h $1,$2,1,2,[x,y] return fi +$1,$2,1,2,"* +begin( +fact = ([w,h] - 1)/100; +xy(p) = (I[#0,p])[0,2]*fact; +const N = h#0; +ref(vector(#N*N),A); +ref(vector(#N*2),B); +repeat (N,p, +repeat (N,q, A[q + N*p] = A[p + N*q] = norm(xy(p) - xy(q))); +copy(B[2*p],(I[#0,p])[2,2]*fact - xy(p),2); +); +W = solve(A,B,2); +); +res = [ 0,0 ]; +repeat (N,p,res += W[2*p,2]*(norm([x,y] - xy(p)))); +res" +k. +#@cli x_waves +#@cli : Launch the image waves demo. +x_waves : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Image waves"$n" --------------------------\n +----\n +---- "${c}"Left mouse button"$n" to drop balls.\n +---- "${c}"Right mouse button"$n" to rotate view.\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"CTRL+F"$n"' to switch fullscreen mode.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +---------------------------------------------" +if !$! l[] { +200,200 x={-1.06-u*0.1} y={-0.26-u*0.1} +mandelbrot $x,$y,{$x+0.1},{$y+0.1},256 +16,1,1,3,u r. 256,1,1,3,3 shift. 1 +map[0] . rm. r2dx 100 ++mirror y +mirror x + n 0,128 +shape_fern {2*w},70%,25 r2dx. {-2,3*w/4} to_rgb. ri. ..,0,0,0.5,0.5 n. 0,196 +[-2,-1] c. 0,255 +} else k[0] r[0] 100,100,1,3,2 fi +i[0] (20;80;0^20;80;0^20;80;0) r[0] 400,300,1,3,3 water[0] 100,2 +w[0] ${"fitscreen [0],35%"},0,"[G"{`39`}"MIC] Image Waves" +w={w} elevation3d. 0 rv3d. +sh. 8,{7+3*i[6]},0,0 r. 3,{h/3},1,1,-1 +(0,1,0;1,0,1;0,1,0) /. 2 +ball[] 20,200,255,128,1,0.7,3.5 +0 $w,$w . +l3d {$w/2},-200,-1000 sl3d 0.4 ss3d 0.8 f3d 500 time0=$| +do ++convolve. [3],1 -. ... rm... b. 0.8 -. {ia} +r. 1,{$w*$w},1,1,-1 j[2] .,2,0 r. $w,$w,1,1,-1 +[1] +if {5,h} +l[5] { +rows 0,2 +nb={w} +i[0] ('CImg3d') i[1] ($nb,$nb) transpose[2] +(1,0;1,{$nb-1}) r. 2,$nb,1,1,3 round. +1,{4*$nb},1,1,1 y a y +} [4] sprites3d.. .,1 rm. +3d[-2,-1] fi +-3d. {$w/2},{$w/2} *3d. {0,0.9*max(w,h)/$w} +r3d. 0,0,1,{if({*,b}&2,{*,x}*360/{*,w},$|*30)} r3d. 1,0,0,120 ++j3d[0] .,50%,65%,30,1,3,0,0 +fps=${-fps} if $fps>0 to. $fps" fps",5,{h-22},16,2,0.2 fi +w. +if {*,CTRLLEFT}" && "{*,D} w[] {2.25*w},{2.25*h} elif {*,CTRLLEFT}" && "{*,C} w[] {1.25*w},{1.25*h} +elif {*,CTRLLEFT}" && "{*,F} +if !narg($is_fs) is_fs={*,w},{*,h} fw={min({*,u}*h/w,{*,v}*w/h)} w[] $fw,{$fw*h/w},0,1 +else w[] $is_fs,0,0 is_fs="" +fi +fi +rm[-2,-1] wait 20 +if {*,b}&1||($|-$time0)>1 ({u*$w};{u*$w};70;0) a[5,-1] x time0={$|-u} fi +if {5,h} l[5,-1] { +sh[0] 2,2,0,0 sh[0] 3,3,0,0 -.. . +. 0.2 rm[-2,-1] +s[0] x repeat $!-1 { coords={$<,@0-1} if {$<,@2}=0 +#@cli : Launch the fractal whirls demo. +#@cli : Default values: 'opacity=0.2'. +x_whirl : check "${1=0.2}>=0" check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Fractal whirls"$n" ----------------------------\n +----\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------------" +5,5,1,3 256,256,1,3 [-1] w. ${"fitscreen 384,384,1,35%"},0,"[G"{`39`}"MIC] Fractal Whirls" +tangle=0 tzoom=0 xc={(w-{-3,w})/2} yc={(h-{-3,h})/2} +do +rand... 0,255 j.. [-3],$xc,$yc,0,0 +f.. "*begin(R = rot(8*sin(-"$tangle")°)/(1.03+0.02*sin("$tzoom")); C=[w,h]/2); I((R*([x,y]-=C))+=C,0,0)" +tangle+=0.001 +tzoom+=0.02 +j. [-2],0,0,0,0,$1 w. +if {*,CTRLLEFT}" && "{*,D} w[] {3*w},{3*h} elif {*,CTRLLEFT}" && "{*,C} w[] {1.5*w},{1.5*h} fi +wait 20 +while {*}" && "!{*,ESC}" && "!{*,Q} +rm[-3,-2] w[] 0 +gui_crop_preview : +if narg($_preview_x0) z 0$_preview_x0,0$_preview_y0,0$_preview_x1,0$_preview_y1 fi +gui_resize_preview : +if narg($_preview_width) r $_preview_width,$_preview_height,100%,100%,2 fi +gui_resize_preview_area : +if narg($_preview_area_width) r $_preview_area_width,$_preview_area_height,100%,100%,2 fi +gui_crop_resize_preview : +gui_crop_preview gui_resize_preview +gui_preview_wh : +u {0$_preview_area_width?[0$_preview_area_width,0$_preview_area_height]:0$_preview_width?[0$_preview_width,0$_preview_height]:min(w,h)>=256?[w,h]:[400,400]} +gui_parallel_overlap : +apo "$1",$3,{if($2,2^($2-1),0)} +gui_preview : +frame 1,1,0,0,0,255 montage B +gui_layer_name : +u ${"_gui_merge_layers[0] name,[unnamed]"} +gui_layer_mode : +u ${"_gui_merge_layers[0] mode,alpha"} +gui_layer_opacity : +u ${"_gui_merge_layers[0] opacity,100"} +gui_layer_pos : +u ${"_gui_merge_layers[0] pos,0,0"} +gui_set_layer_name : +foreach { +opacity=${-gui_layer_opacity} mode=${-gui_layer_mode} pos=${-gui_layer_pos} +=> "name($*),mode("$mode"),opacity("$opacity"),pos("$pos")" +} +gui_set_layer_mode : +foreach { +name=${-gui_layer_name} opacity=${-gui_layer_opacity} pos=${-gui_layer_pos} +=> "name("$name"),mode($1),opacity("$opacity"),pos("$pos")" +} +gui_set_layer_opacity : +foreach { +name=${-gui_layer_name} mode=${-gui_layer_mode} pos=${-gui_layer_pos} +=> "name("$name"),mode("$mode"),opacity($1),pos("$pos")" +} +gui_set_layer_pos : +foreach { +name=${-gui_layer_name} mode=${-gui_layer_mode} opacity=${-gui_layer_opacity} +=> "name("$name"),mode("$mode"),opacity("$opacity"),pos("{round("$1")}","{round("$2")}")" +} +gui_merge_layers : +if !$! return fi +mode0=${"_gui_merge_layers. mode,alpha"} +opacity0=${"_gui_merge_layers. opacity,100"} +pos0=${"_gui_merge_layers. pos,0,0"} +if $opacity0<100" || "['$pos0']!='0,0' 100%,100%,1,4 fi +wh0={w},{h} +wh=${-max_wh} r. $wh,1,100%,0 +repeat $!-1 { l[-2,-1] { +rv +mode=${"_gui_merge_layers[1] mode,alpha"} +opacity=${"_gui_merge_layers[1] opacity,100"} +pos=${"_gui_merge_layers[1] pos,0,0"} +to_a[1] r[1] $wh,1,100%,0 +shift[1] ${u\ $pos},0,0 +to_colormode[0,1] 0 +blend $mode,{max(0,min(1,$opacity/100))} +} } +r $wh0,1,100%,0 +_gui_merge_layers : +u {`" +str = ["{'{n}'}"]; const sstr = size(str); +def = ['${2--1}']; +ker = ['$1(']; const sker = size(ker); +const N = max(size(str),size(def)); +ref(vectorN(0),res); +p = q = find(str,ker); +p>=0?( +q+=sker; +r = find(str,'),',q); +q = r>=0?r:(str[sstr-1]==_')'?sstr-1:-1); +); +q>=0?copy(res,str[p + sker],q - p - sker):(def = ['${2--1}']; copy(res,def,size(def))); +for (p = 0, p=0, res[p=q++] = 26); +res"`} +gui_split_preview : check "isint(${2=0}) && $2>=0 && $2<=12 && ${5=0}>=0" skip "${3=nan},${4=nan}" +__split_preview="$1" m "_split_preview : run $__split_preview k[0]" +is_movable={!isnan($3)" && "!isnan($4)} +posx,posy={$is_movable?cut([$3,$4],0,100):[50,50]} +pw,ph=${-gui_preview_wh} +foreach { +is_failed=0 ++l { +apply_timeout _split_preview,0$_preview_timeout +onfail +if 0$_is_timeout gui_timeout_preview +else gui_error_preview ${} +fi +is_failed=1 +} +if $is_failed" || "!$2 k. +else +drgba rr2d $pw,$ph,0,2 +r {[max(w#0,w#1),max(h#0,h#1)]},1,100%,0,0,0.5,0.5 +posx,posy={round([$posx,$posy]*([w,h]-1)%)} +if $2==1" || "$2==3 +1,[0],1,1,'y>=$posy?($2==1):($2==3)' r. [0],[0],1,1 j[0] [1],0,0,0,0,1,. +elif $2==2" || "$2==4 +[0],1,1,1,'x>=$posx?($2==2):($2==4)' r. [0],[0],1,1 j[0] [1],0,0,0,0,1,. +elif $2==5 +j[0] [1],0,$posy +elif $2==6 +j[0] [1],$posx +elif $2==7 +j[0] [1],0,{$posy-h} +elif $2==8 +j[0] [1],{$posx-w} +elif $2==9 +if !$posy k. elif $posy>=h k.. else r[0] 100%,$posy,1,100%,0,0,0,0.5 r[1] 100%,{h-$posy},1,100%,0,0,0,0.5 a y fi +elif $2==10 +if !$posx k. elif $posx>=h k.. else r[0] $posx,100%,1,100%,0,0,0.5 r[1] {w-$posx},100%,1,100%,0,0,0.5 a x fi +elif $2==11 +1,[0],1,1,'y>=$posy' [0],1,1,1,'x>=$posx' r[-2,-1] [0],[0],1,1 xor[-2,-1] +j[0] [1],0,0,0,0,1,. +elif $2==12 +1,[0],1,1,'y<=$posy' [0],1,1,1,'x>=$posx' r[-2,-1] [0],[0],1,1 xor[-2,-1] +j[0] [1],0,0,0,0,1,. +fi +k[0] +dir=0 +if isin($2,1,3,5,7,9,11,12) +dir+=1 +line 0,$posy,100%,$posy,0.75,0xF0F0F0F0,255 line 0,$posy,100%,$posy,0.75,0x0F0F0F0F,0 +if $is_movable +coords={p=[$posx,$posy];[p+[-10,-1],p+[10,-1],p+[0,-11]]} +polygon 3,$coords,0.7,255 +polygon 3,$coords,0.7,0xFFFFFFFF,0 +coords={p=[$posx,$posy];[p+[-10,1],p+[10,1],p+[0,11]]} +polygon 3,$coords,0.7,255 +polygon 3,$coords,0.7,0xFFFFFFFF,0 +fi +fi +if isin($2,2,4,6,8,10,11,12) +dir+=2 +line $posx,0,$posx,100%,0.75,0xF0F0F0F0,255 line $posx,0,$posx,100%,0.75,0x0F0F0F0F,0 +if $2!=9" && "$is_movable +coords={p=[$posx,$posy];[p+[-1,-10],p+[-1,10],p+[-11,0]]} +polygon 3,$coords,0.7,255 +polygon 3,$coords,0.7,0xFFFFFFFF,0 +coords={p=[$posx,$posy];[p+[1,-10],p+[1,10],p+[11,0]]} +polygon 3,$coords,0.7,255 +polygon 3,$coords,0.7,0xFFFFFFFF,0 +fi +fi +l[] { +0 +t. "After",0,0,20,1,255 t.. "Before",0,0,20,1,255 +autocrop 0 z[0] {0,[-1,-1,w,h]} z[1] {1,[-1,-1,w,h]} +if isin($2,3,4,7,8,12) rv fi ++dilate[-2,-1] 3 /[-2,-1] 255 r[-4,-3] 100%,100%,1,3 +} +if {-4,"const c1 = "$posx">w+2; const c2 = "$posy">h+2; arg("$dir",c2,c1,c1&&c2)"} +j[0] [-4],2,2,0,0,1,.. +fi +if {-3,"const c1 = "$posx"h+2); arg("$dir",c2,c1,c1&&c2)"} +j[0] [-3],{[w#0-3-w,isin($2,11,12)?2:h#0-3-h]},0,0,1,. +fi +k[0] +fi +} +um _split_preview +gui_print_preview : skip "${1=},${3=}" check "${2=32}>=0 && ${4=20}>=0" +if $! k[0] fi +drgba +siz={0$_preview_area_width?[0$_preview_area_width,0$_preview_area_height]:[${fitscreen\ {[max(w,1),max(h,1),1]},400,800}]} +sizw={arg(1,$siz)-8} +if $! rr2d $siz,2,3 drgba else $siz,1,3,128 fi +(1;0.5^1;0.5^0;1) +(0,0.5,0;0.5,1,0.5;0,0.5,0) *. 0.65 +ri[-2,-1] ...,3 * c 0,255 +l[] { +if ['"$1"']!=0 msg="$1" else msg=" " fi +0 t. $msg,0,0,$2,1,255 i.. 100%,100%,1,3 fc.. 255,200,120 a[-2,-1] c r2dx. {min(w,arg(1,$sizw)-8)} +r. 100%,140%,1,100%,0,0 +onfail rm +} +l[] { +if ['"$3"']!=0 msg="$3" else msg=" " fi +0 t. $msg,0,0,$4,1,255 i.. 100%,100%,1,3,255 a c +('$msg') is_err={"crop(0,4)=='*** '"} rm. +if $is_err +x={"ref(crop(0,0,0,3,32,h,1,1),T); +for (c = 32, c$sizw { +x={"const c0 = "$sizw"-1; +const c02 = c0/2; +for (c = c0, c>=c02, --c, max(crop(#-1,c-2,0,0,3,5,h,1,1))<=0?break()); +c=c02, --c, max(crop(#-1,c,0,0,3,1,h,1,1))<=0?break()); +c "mode("$mode"),opacity("$opacity"),pos("{arg(1,$coords)}","{arg(2,$coords)}"),name("$nm")" +} +fx_logo : skip "${1= }" +rm[^0] +w,h=${-gui_preview_wh} +({'"$1"'}) c. 0,127 r. 15,1,1,1,0,2 r. {w/3},1,1,3,-1 n. 0,255 100%,1,1,1,lerp(0,$w-1,x/(w-1)) rv[-2,-1] a[-2,-1] c +rbf. $h transpose. r. $w,$h,1,3,3 +blend alpha,0.5 +to "$1",0.5~,0.5~,10% +fx_support_us : +if $!>0 k[0] fi +gui_print_preview "" +l[] { +filename=${-path_tmp}gmic_donations.png +need_update={"Y = date(0); M = date(1); D = date(2); date_current = Y*365 + M*31 + D; +Y = date(0,'"{/$filename}"'); M = date(1,'"{/$filename}"'); +D = date(2,'"{/$filename}"'); date_file = Y*365 + M*31 + D; +date_current - date_file>=15"} +if $need_update i https://gmic.eu/img/donations_latest_months.png o. $filename +else i $filename +fi +0 t. "Latest donations to the G'MIC project:",0,0,24,1,1 rows. 0,120% *. 255 channels. -3,0 +rv a y,0.5 drgba 200 frame 4,4,200 frame 2,2,0 to_rgba +onfail rm +} +if w>w#0" || "h>h#0 rr2d. {-2,[w,h]},0 fi +j.. .,{([w#0,h#0]-[w,h])/2},0,0,0.85 +rm. +gui_download_all_data : +l[] { clut foo rm onfail rm } +_filenames_grain=${-_fx_simulate_grain} +_url_grain=https://gmic.eu/data_film_presets +_prefix_grain=grain_ +_ext_grain=cimgz +_filenames_lightleak=${-_fx_light_leaks} +_url_lightleak=https://gmic.eu/data_lightleaks +_prefix_lightleak= +_ext_lightleak=cimgz +_filenames_sample=${-__sample} +_url_sample=https://gmic.eu/img +_prefix_sample=sample_ +_ext_sample=png +_filenames_demos=gmic_demos +_url_demos=https://gmic.eu/img +_prefix_demos= +_ext_demos=cimgz +_n=0 +_N={narg($_filenames_grain,$_filenames_lightleak,$_filenames_logo,$_filenames_sample)} +progress 0 +_gui_download_all_data[] grain,$1 +_gui_download_all_data[] lightleak,$1 +_gui_download_all_data[] logo,$1 +_gui_download_all_data[] sample,$1 +_gui_download_all_data[] demos,$1 +progress 100 +_gui_download_all_data : +repeat narg(${_filenames_$1}) { +filename=${_prefix_$1}${arg0\ $>,${_filenames_$1}}.${_ext_$1} +e "Download "$filename +if $2" || "!isfile(['{/${-path_cache}$filename}']) l[] { +${_url_$1}/$filename o ${-path_cache}$filename rm onfail +} fi +progress {100*$_n/$_N} +_n+=1 +} +fx_friends : +if $! ratio={w/h} else ratio=1 fi +rm _heart80x73 scale3x r 150%,150%,1,1,0,0,0.5,0.5 ++*. 70 +*.. 110 +*... 255 *[-4] 255 a c +blur_radial 4 sharpen 300 +i.. ${fitratio_wh\ {w},{h},$ratio},1,3 +rand.. 0,255 sh.. 1,2 /. 2 rm. +blur_radial.. 20 sharpen.. 50 +r. ..,..,1,4,0,0,0.5,0.5 blend alpha +143,80,1,1,0 t. "Greetings to\n all G\47MIC\n friends!",2,-2,27,1,1 ++dilate. 3 *.. 255 to_rgb.. j... ..,{[w#-3-w#-2,h#-3-h#-2]/2},0,0,1,. +rm[-2,-1] +_heart80x73 : +40,73,1,1,0 ellipse 22,22,20,20,0,1,1 polygon 3,7,37,42,72,42,27,1,1 +mirror x a x +fx_logo_ca : +fx_logo "per al GIMP\n [ "${-strver}" ]"," per al GIMP\n[ "${-strver}" pre-release ""#"$_prerelease"]" +fx_gmicky : +rm +if $1==0 sp gmicky => "name(Gmicky)" +elif $1==1 sp gmicky_mahvin => "name(Gmicky)" +elif $1==2 sp gmicky_wilber => "name(Gmicky & Wilber)" +else sp roddy => "name(Roddy)" +fi +fx_gmicky_preview : +fx_gmicky $* rr2d $_preview_area_width,$_preview_area_height,0,2 +fx_whatsnew_preview : skip "$*" +file=${-path_cache}whatsnew.txt +l[] { +parse_gui whatsnew +if isfile(['{/$file}']) it $file date={date([0,1,2],['{/$file}']):/} else 0 date={date([0,1,2]):/} fi +utf82html.. utf82html. +if $4 ot.. $file newfilters,delfilters= is_changes=0 +else +newfilters,delfilters= ++- is_changes={max(abs(im),abs(iM))!=0} rm. +if !w +rm. s -,10 +repeat $! { newfilters.=" - "{$>,t}{`10`} } +elif $is_changes +eval " +ref(vector256(),str0); +ref(vector256(),str1); +for (s0 = s1 = 0, s01 mirror y fi +array_fade $1,$2,$5,$6,$8 +shift -$3%,-$4%,0,0,2 +fx_array_fade_preview : +fx_array_fade $1,$2,$3,$4,$5,$6,$7,0 +fx_array_mirror : skip ${7=0} +if $5==1 mirror x +elif $5==2 mirror y +elif $5==3 rotate 90 +elif $5==4 rotate 180 +elif $5==5 rotate 270 +fi +if $7 +if $4==0 columns 0,{100-$7}% +elif $4==1 rows 0,{100-$7}% +elif $4==2 z 0,0,{100-$7}%,{100-$7}% +elif $4==3 z {$7/2}%,{$7/2}%,{100-$7/2}%,{100-$7/2}% +fi +fi +shift -$2%,-$3%,0,0,2 +array_mirror $1,$4,$6 +fx_array_mirror_preview : +fx_array_mirror $1,$2,$3,$4,$5,0,$7 +fx_array_color : +repeat $! { l. { +$1,$2,1,3 rand. 0,255 to_colormode. {-2,s} ri. .. *. $3 *.. {1-$3} +[-2,-1] +} mv. 0 } +fx_array : +shift -$3%,-$4%,0,0,2 +if $5&1 mirror x fi if $5>1 mirror y fi +array $1,$2,$6 +fx_array_preview : +fx_array $1,$2,$3,$4,$5,0 +fx_asciiart : skip "${10=},${11=},${12=}" +foreach { +to_rgb apply_gamma {10^$7} b $8% n 0,255 +if $1==0 dict="$2" +elif $1==1 +dict=" 01" +elif $1==2 +dict=" 0123456789" +elif $1==3 +dict=" abcdefghijklmnopqrstuvwxyz" +elif $1==4 +dict=" ABCDEFGHIJKLMNOPQRSTUVWXYZ" +elif $1==5 +dict=" !\042#$%&\047()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\133\\\135^_\140abcdefghijklmnopqrstu""vwxyz\173|\174~" +elif $1==6 +dict=" \16\17\20\21" +elif $1==7 +dict=" \200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231" +fi +if $6==1 negate fi +if $-3 +img2ascii $dict,$3,$4%,$5,"$-2"/"$-1" +else +img2ascii $dict,$3,$4%,$5 +fi +wh=${} +if $6==0 k. n 0,255 +elif $6==1 k. negate n 0,255 +elif $6==2" || "$6==3 +r[0] $wh,1,100%,1 +if $9>=7 luminance[0] fi +if $9%7 quantize[0] {arg($9%7,2,3,4,8,12,16)-1},1,0 fi +r[0] [1],[1],1,100% *[0] [1] +if $6==2 rm[1] +else *[1] 255 a c +fi +fi +} +fx_asciiart_preview : +foreach { +w={w} h={h} +fx_asciiart $1,"$2",${3-9},0,foo,foo +r $w,$h,1,100%,0,0,0.5,0.5 +} +fx_chessboard : +to_rgba chessboard ${1-14} +fx_chessboard_preview : +gui_split_preview "fx_chessboard $*",${-3--1} +fx_dices : +repeat 6 { {2*$2},{2*$2} _dice$> } +if $3%2 negate[-6--1] fi +frame_round[-6--1] 0,30%,0.5,128,128,128,0 frame[-6--1] 1,1,128,128,128,0 +r2dy[-6--1] $2 a[-6--1] x +foreach[^-1] { +pass. ++luminance[0] rv[1,2] r[0,1] {100*$1/$2}%,{100*$1/$2}%,1,100%,2 quantize[1] 6,0 +*.. $2 channels.. 0,1 r.. {$2*100}%,{$2*100}% +$2,$2,1,2,'if(c,y,x)' r. ...,...,1,2,0,2 +[-3,-1] +warp. ..,0,0,1 rm... +if $3<2 rm[0] mv. 0 +else r[0] [2],[2],1,100% rv[0,-1] blend[0,-1] multiply +fi +rm. +} +rm. +_dice0 : ellipse. 50%,50%,5.2%,5.2%,0,1,255 +_dice1 : ellipse. 25%,25%,5.2%,5.2%,0,1,255 ellipse. 75%,75%,5.2%,5.2%,0,1,255 +_dice2 : _dice1 _dice0 +_dice3 : _dice1 ellipse. 25%,75%,5.2%,5.2%,0,1,255 ellipse. 75%,25%,5.2%,5.2%,0,1,255 +_dice4 : _dice3 _dice0 +_dice5 : _dice3 ellipse. 25%,50%,5.2%,5.2%,0,1,255 ellipse. 75%,50%,5.2%,5.2%,0,1,255 +_fx_drawn_montage : +nb_layers={min(16,$!-1)} +if !$nb_layers +error="A top layout layer is missing for this filter to make it work properly!" +if $-1 gui_warning_preview $error return +else error $error +fi +fi +pargs,args0,args1,args2,args3,args4,args5,args6,args7,args8,args9,args10,args11,args12,args13,args14,args15=${9-25} +if $1!=$pargs +('${args$1}') replace. {':'},{','} arg_R,arg_G,arg_B,arg_zoom,arg_xcenter,arg_ycenter,arg_angle=${u\ {t}} rm. +else +arg_R,arg_G,arg_B,arg_zoom,arg_xcenter,arg_ycenter,arg_angle=${2-8} +fi +args$1=$arg_R:$arg_G:$arg_B:$arg_zoom:$arg_xcenter:$arg_ycenter:$arg_angle +status=\{$1\}\{$arg_R,$arg_G,$arg_B\}\{$arg_zoom\}\{$arg_xcenter\}\{$arg_ycenter\}\{$arg_angle\}\{$1\}\{$args0\}\{$args1\}\{$args2\}\{$args3\}\{$args4\}\{$args5\}\{$args6\}\{$args7\}\{$args8\}\{$args9\}\{$args10\}\{$args11\}\{$args12\}\{$args13\}\{$args14\}\{$args15\} +c= repeat $nb_layers { +('${args$>}') replace. {':'},{','} R$>,G$>,B$>,zoom$>,xcenter$>,ycenter$>,angle$>=${u\ {t}} +cols=$cols$c${R$>},${G$>},${B$>} c=, rm. rotate[{1+$>}] {90*${angle$>}} +} +to_rgb[0] to_rgba[^0] $nb_layers,1,1,4,[inf,inf,-inf,-inf] [0],[0] +f[0] " +begin(colors = [ "$cols" ]); +repeat ("$nb_layers",l, +I==colors[3*l,3]?( +if (xi(#-2,l,0,0,2), i(#-2,l,0,0,2) = x); +if (y>i(#-2,l,0,0,3), i(#-2,l,0,0,3) = y); +i(#-1,x,y) = l + 1; +); +); I" +thumbnail=0 boundaries=0 +if $-1 +l={1+$1} +if $l<=$nb_layers +if {$l,w>h} +r2dx[$l] {(0$_preview_area_width?0$_preview_area_width:400)/6} +else +r2dy[$l] {(0$_preview_area_height?0$_preview_area_height:400)/6} fi +frame. 1,1,0,0,0,255 drgba. to. "#"$l,0,-2,13 to_rgba. +mv. -3 +thumbnail=1 +fi ++f. "const boundaries = 1; ref(crop(x - 2,y - 2,5,5),V); if (min(V)==max(V),0,i)" +(0,0,0,$cols) r. 3,{$nb_layers+1},1,1,-1 1,100%,1,1,y?255:0 a[-2,-1] x permute. yzcx map.. . rm. +repeat $nb_layers { +xmin,ymin,xmax,ymax={-3,I[$>]} +if !isinf($xmin)" && "!isinf($ymin)" && "!isinf($xmax)" && "!isinf($ymax) +xc$>,yc$>={0,0.5*([$xmin,$ymin]+[$xmax,$ymax]-6)*100/[w,h]} +else xc$>,yc$>=-1024 +fi +} +mv. -3 +boundaries=1 +fi +if iM>0 +repeat $nb_layers { +l={$>+1} xmin,ymin,xmax,ymax={-2,I[$>]} +if !isinf($xmin)" && "!isinf($ymin)" && "!isinf($xmax)" && "!isinf($ymax) +dx={$xmax-$xmin+1} +dy={$ymax-$ymin+1} +nw,nh={$l,round(min(w/$dx,h/$dy)*[$dx,$dy]/(1+3*(${zoom$>}/10)^2))} +r[$l] $nw,$nh,1,100%,0,0,{(100-${xcenter$>})%},{(100-${ycenter$>})%} +r[$l] $dx,$dy,1,100%,6 +else r[$l] 1,1 +fi +} +to_rgba[0] +f[0] " +l = i#-1; +l1 = l - 1; +l<=0?I:( +xmin = i(#-2,l1,0,0,0); +ymin = i(#-2,l1,0,0,1); +rx = x - xmin; +ry = y - ymin; +crop(#l,rx,ry,0,0,1,1,1,4); +)" +fi +rm[-2,-1] +if $boundaries blend[0,-1] alpha fi +if $thumbnail +drgba[0] rr2d[0] ${-gui_preview_wh} +j[0] .,3,3,0,0,0.75 +rm. +fi +if $-1 repeat $nb_layers { to "#"{1+$>},${xc$>}%,${yc$>}%,13,1,0.75 } fi +k[0] c 0,255 +u $status +fx_drawn_montage : +_fx_drawn_montage $*,0 +fx_drawn_montage_preview : +_fx_drawn_montage $*,1 +fx_extract_objects : +if $5 min_area=$5% else min_area=6 fi +foreach { +to_rgba +nm=${-gui_layer_name} +w={w} h={h} +x={$1%*(w-1)} +y={$2%*(h-1)} +color={I($x,$y)} +if $7==0 ++replace_color $3,0,$color,0,0,0,0 autocrop_components. $4%,$min_area,$6,2 +repeat w { ++z[0] {1,i($>,0)},{1,i($>,1)},{1,i($>,3)},{1,i($>,4)} +=> pos({1,i($>,0)}\,{1,i($>,1)})\,name($nm" "[$>]) +} +rm[0,1] +elif $7==1 +replace_color $3,0,$color,0,0,0,0 ++autocrop_components[0] $4%,$min_area,$6,2 +autocrop_components[0] $4%,$min_area,$6,1 +repeat w { =>[$>] pos({i($>,0)}\,{i($>,1)})\,name($nm" "[$>]) } rm. +fi +$w,$h,1,4 fc. $color => name($nm" [background]") +} +fx_extract_objects_preview : +x0,y0=${1,2} +if $5 min_area=$5% else min_area=5 fi +foreach { +to_rgba +x={$x0%*(w-1)} +y={$y0%*(h-1)} +color={I($x,$y)} ++replace_color $3,0,$color,0,0,0,0 +autocrop_components. $4%,$min_area,$6,2 +repeat w { +xycoords={1,i($>,0)},{1,i($>,1)},{1,i($>,3)},{1,i($>,4)} +rectangle[0] $xycoords,0.3,0,0,255,255 +rectangle[0] $xycoords,1,0xFFFFFFFF,0,0,0,255 +} +drgba[0] +to[0] {w}" objects",2,2,13,2,0.3,255,255,255,255 +k[0] +if $8 +line 0,$y0%,100%,$y0%,0.5,0xF0F0F0F0,255 line 0,$y0%,100%,$y0%,0.5,0x0F0F0F0F,0 +line $x0%,0,$x0%,100%,0.5,0xF0F0F0F0,255 line $x0%,0,$x0%,100%,0.5,0x0F0F0F0F,0 +fi +circle $x,$y,3,1,0,255,0 circle $x,$y,3,1,0xFFFFFFFF,0 +} +fx_imagegrid : +imagegrid $1,$2 +fx_imagegrid_hexagonal : +foreach { +if $3 r 200%,200%,1,100% fi +imagegrid_hexagonal $1,$2 +if $3 r 50%,50%,1,100%,2 fi +} +fx_imagegrid_triangular : +foreach { +split_opacity l[0] { to_rgb imagegrid_triangular ${1-3},{$7/255},${4-6} } +a c +} +fx_make_seamless : +foreach { +if $1 +b {20.5-$1/50}% -[0] [1] fc. ${average_vectors.} + fi +} +periodize_poisson c 0,255 +fx_make_seamless_preview : +u={arg($3,2,1,2,3,4)} v={arg($3,1,2,2,3,4)} +gui_split_preview "if !$2 fx_make_seamless $* fi if $3 array "$u","$v" fi",${-3--1} +fx_frame_seamless : +foreach { +if $5 +b {20.5-$5/50}% -[0] [1] fc. ${average_vectors.} + fi +} +frame_seamless ${1-4} c 0,255 +fx_frame_seamless_preview : +u={arg($7,2,1,2,3,4)} v={arg($7,1,2,2,3,4)} +gui_split_preview "if !$6 fx_frame_seamless $* fi if $7 array "$u","$v" fi",${-3--1} +fx_ministeck : +foreach { +if w>h r2dx {min($2,w)} else r2dy {min($2,h)} fi +split_opacity l[0] { ++colormap. $1 index.. . +[0],[0],1,1 rand[2] 0,1 dilate[2] $4 +[0,2] +r[0] $3""00%,$3""00% ++g[0] xy,1 !=[-2,-1] 0 +f[0] 'i(x+1,y+1)-i(x,y)' !=[-3--1] 0 -|[-3--1] +z[0,-1] 0,0,{w-2},{h-2} +if $7 . fi ++shift. 1,1 *.. -1 +[-2,-1] b. {$6*$3/5} n. -$5,$5 +map[0] [1] rm[1] +[0,-1] +if $7 ==[1] 0 * fi +} r. [0],[0],1,100% a c +} +c 0,255 +fx_ministeck_preview : +foreach { +w={w} h={h} +fx_ministeck $* +r $w,$h,1,100%,0,0,0.5,0.5 +} +fx_montage : skip "${2=A}" +if !$! return fi +code0=X code1="$2" code2=H code3=V code4=A code5=B +if $3==1" && "$4<0.5 r {max(10,$4*200)}%,{max(10,$4*200)}%,1,100%,2 fi +to_rgba if $14 rv fi if $13%$! mv[{$13%$!}--1] 0 fi +if $11" || "$12 repeat $! { rotate[$>] {$11+u(-$12,$12)},1,0 } fi +montage ${code$1},{if($3==0,$4,2+max(0,$4-0.5))},$15,"if $""7%2 mirror x fi if $""8%2 mirror y fi ""rotate {90*$""6} ""if $5||$6 ""r {max(1,$""4-2*($5+$6))},{max(1,$""5-2*($5+$6))},1,100%,2 ""frame $6,$6,${7-10} ""r {w+2*$5},{h+2*$5},1,100%,0,0,0.5,0.5 ""else r $""4,$""5,1,100%,2 fi " +if $15 gui_autocrop_layers fi +gui_set_layer_name "[Montage]" +fx_montage_preview : skip "${2=A}" +if !$! return fi +w={w} h={h} +if $3==1" && "$4<0.5 r {max(10,$4*200)}%,{max(10,$4*200)}%,1,100%,2 fi +drgba +code0=X code1="$2" code2=H code3=V code4=A code5=B +to_rgba if $14 rv fi if $13%$! mv[{$13%$!}--1] 0 fi +if $11" || "$12 repeat $! { rotate[$>] {$11+u(-$12,$12)},1,0 } fi +montage ${code$1},{if($3==0,$4,2+max(0,$4-0.5))},0,"if $""7%2 mirror x fi if $""8%2 mirror y fi +rotate {90*$""6} +if $5||$6 +r {max(1,$""4-2*($5+$6))},{max(1,$""5-2*($5+$6))},1,100%,2 fs={min(53,max(w,h)/3)} +frame $6,$6,${7-10} +r {w+2*$5},{h+2*$5},1,100%,0,0,0.5,0.5 +0 t. \\\#$""1,0,0,$fs,1,255 expand_xy. 3,0 [-1]x3 a[-4--2] c +dilate. {3+2*$fs/20} a.. .,c j[0] [1],{5+$5+$6},{$5+$6},0,0,1,[2],255 k[0] +else +r $""4,$""5,1,100%,2 fs={min(53,max(w,h)/3)} +0 t. \\\#$""1,0,0,$fs,1,255 expand_xy. 3,0 [-1]x3 a[-4--2] c +dilate. {3+2*$fs/20} a.. .,c j[0] [1],5,0,0,0,1,[2],255 k[0] +fi " +nw={w} nh={h} +resize_ratio2d $w,{$h-16},2,2 +drgba +i[0] 100%,15,1,3,240 t[0] "Estimated size : "{round(100*$nw/$w)}%" x "{round(100*$nh/$h)}%,2,0,16 r[0] 100%,16,1,3,0 +a y +fx_puzzle : +foreach { +w={w} h={h} to_rgb +puzzle $w,$h,$1,$2,$3,$4,$5 ++b. $6%,0 g. xy +[-2,-1] n. -$7,$7 +[0,-1] ++b. $8%,0 n. 0,1 *. -1 +. 1 n. {(255-$9)/255},1 *[0,-1] c 0,255 +if $10!=100||$11||$12||$13||$14||$15||$16 ++-. 1 label_fg. 0 ++area_fg. 0,0 <. 50% -|... . ==. 0 *[-2,-1] +distance.. 0 *.. -1 watershed. .. rm.. label. 0,0 +repeat iM+1 { ++==[1] $> +coords=${autocrop_coords.\ 0} ++z[0] $coords z.. $coords rv[-2,-1] *.. . *. 255 a[-2,-1] c +x$>={arg(1,$coords)+round(w/2)} y$>={arg(2,$coords)+round(h/2)} +} +rm[0,1] +if $14 sort_list +,u fi +if $16 +foreach { +r2dy {max(0.1,$10+$11*v)}% rotate {$12+$13*v} +if $15 expand_xy 1,0 fi +cx={round(w/2)} cy={round(h/2)} +sh 100% if $15 dilate. 3 fi +i[0] $w,$h,1,4 +j[0] ..,{${x$>}-$cx},{${y$>}-$cy},0,0,1,.,255 rm[-2,-1] +} +else +i[0] $w,$h,1,{s} +repeat $!-1 { +r2dy. {max(0.1,$10+$11*v)}% rotate. {$12+$13*v} +if $15 expand_xy. 1,0 fi +cx={round(w/2)} cy={round(h/2)} +sh. 100% if $15 dilate. 3 fi +j[0] ..,{${x$<}-$cx},{${y$<}-$cy},0,0,1,.,255 rm[-2,-1] +} +fi +else rm. +fi +} +fx_puzzle_preview : +fx_puzzle ${1-15},0 +fx_shuffle_patches_preview : +fx_shuffle_patches $* +gui_crop_resize_preview +fx_shuffle_patches : +mode,recons,patch_size,overlap,overlap_std,seed=${1-6} +foreach { +nm={n} w,h:=w,h +s c foreach { avg$>,std$>:=ia,id } a c +ps:=min(w,h,$patch_size) +if $recons==1 g xy,1 a c +elif $recons==2 laplacian +fi +img2patches $ps,$overlap%,3 +s z srand $seed +if isin($mode,0,2) sort_list +,u fi +if $mode>0 foreach { rotate {90*round(u(3))} } fi +a z +patches2img $w,$h,$overlap%,$overlap_std% +if $recons==1 s c,2 g.. x,-1,2 g. y,-1,2 + ilaplacian 0 +elif $recons==2 ilaplacian 0 +fi +s c foreach { - {ia} / {id} * ${std$>} + ${avg$>} } a c +c 0,255 +} +fx_taquin : +to_a foreach { srand $11 taquin $1,$2,$3,$4,$5%,$6,${7-10} } +fx_rotate_tileable : +if $3 array_mirror 1,{$3-1},1 fi +rotate_tileable $1,{if($3==0,$2,$2/2)} +fx_rotate_tileable_preview : +l { fx_rotate_tileable $* onfail gui_warning_preview "Invalid image size" } +fx_isolate_tiles : +foreach { +to_rgba +if $5 sx={round(min(w,h)*max($1,$2)/100)} sy=$sx else sx={round(w*$1/100)} sy={round(h*$2/100)} fi +if $6 bx={max($3,$4)} by=$bx else bx=$3 by=$4 fi +s x,-$sx +foreach { s y,-$sy r 100%,{100+$by}%,1,100%,0,0,0.5,0.5 a y } +r {100+$bx}%,100%,1,100%,0,0,0.5,0.5 a x +} +_fx_normalize_tiles : +repeat $! { l. { split_tiles $1,$2 n $3,$4 append_tiles $1,$2 } mv. 0 } +fx_normalize_tiles : +ac "_fx_normalize_tiles ${1-4}",$-1 +fx_parameterize_tiles : +if $3 +quadratize_tiles $1,$2 +else +linearize_tiles $1,$2 +fi +c 0,255 +fx_shift_tiles : +to_rgba shift_tiles $1,$2,$3 +if $4<1 repeat $! { s. c *. $4 a[-4--1] c mv. 0 } fi +fx_rotate_tiles : +to_rgba rotate_tiles $3,$1,$2 drop_shadow $4%,$5%,$6% +gcd_aurora : skip ${1=6},${2=1},${3=0} +repeat $! l[$>] +to_rgb +deriche $1%,2,y deriche. $2%,0,x +c. 0,255 n. 0,255 +if $3 blend average else k. fi +done done +fx_crayongraffiti2 : +repeat $! l[$>] split_opacity l[0] ++b $3 hardsketchbw. $1,$2,$4,$5,$6 to_rgb +negate. blur_xy.. $7,$7 reverse +if $8==0 compose_lightness +elif $8==1 compose_value +elif $8==2 fx_compose_colordoping 1,1 fi +done a c done done +fx_crayongraffiti2_preview : +gui_split_preview "fx_crayongraffiti2 ${1--2}",$-1 +fx_bokeh : +_shape=$2 +srand $3 +foreach { +nm=${-gui_layer_name} pos=${-gui_layer_pos} +100%,100%,1,3 +(${4-13};${14-23}) if $1>2 r. 100%,$1,1,1,3 fi +repeat $1 { +rows. $> _fx_bokeh... {^} rm. } +rm. => "name("$nm"),opacity(100),mode(screen),pos("$pos")" +rv +if 0$_output_mode==0 gui_merge_layers +elif 0$_output_mode<2 rm. +fi +} +_fx_bokeh0 : shape_star $1,3 +_fx_bokeh1 : $1,$1,1,1,1 +_fx_bokeh2 : shape_diamond $1 +_fx_bokeh3 : shape_polygon $1,5,45 +_fx_bokeh4 : shape_polygon $1,6,45 +_fx_bokeh5 : shape_polygon $1,8,45 +_fx_bokeh6 : shape_polygon $1,10,45 +_fx_bokeh7 : shape_star $1,5 +_fx_bokeh8 : shape_circle $1 +fx_bokeh_preview : +gui_split_preview "_output_mode=0 fx_bokeh $*",${-3--1} +_fx_bokeh : +radius1={r=max(w,h)*$2%;r+1-(r%2)} +radius2={r=$radius1-($radius1*$3%);r+1-(r%2)} +random3d $1 *3d. {-2,w},{-2,h},0 +_fx_bokeh$_shape $radius1 +if $radius2>=1 _fx_bokeh$_shape $radius2 ri. ..,0,0,0.5,0.5 *. {max(0,min(1,1-$4))} -[-2,-1] fi +sigma={-3,$5%*w} +r. {w+5*$sigma},{h+5*$sigma},1,1,0,0,0.5,0.5 +b. $sigma,0 n. 0,255 +sprites3d[1] [2],1 rm[2] +l. { +s3d r.. 3,{-2,h/3},1,1,-1 s.. x +d={$10*255} +rand[-4] {$6-$d},{$6+$d} +rand... {$7-$d},{$7+$d} +rand.. {$8-$d},{$8+$d} +a[-4--2] x c.. 0,255 y a y +} +j3d[0] [1],0,0,0,{$9/255},1,0,0 rm[1] +fx_brushify : +_fx_brushify $* +s0=0--3 s1=1--2 s2=0--2 +l[${s{$1==0?0:$1==1?1:2}},-1] { brushify[^-1] .,$3,{$5%},$6,$9,$10,$11,$12%,$13,$14,$15,$16,$17,$18 rm. } +_fx_brushify : +N={0.9*$4} +if $1==0 +autocrop. i.. 100%,100%,1,3,1 blend[-2,-1] alpha rr2d. $N,$N,0,3 +elif $1==1 +autocrop[0] i.. 100%,100%,1,3,1 blend[-2,-1] alpha rr2d. $N,$N,0,3 +elif $1==2 $4,$4 rectangle. 10%,10%,90%,90%,1,1 +elif $1==3 shape_diamond. $N +elif $1==4 shape_polygon $N,5 +elif $1==5 shape_polygon $N,6 +elif $1==6 shape_polygon $N,8 +elif $1==7 shape_circle. $N +elif $1==8 $4,$4 gaussian. 30%,30%,0 +elif $1==9 shape_star $N +elif $1==10 shape_heart $N +fi +norm. r. 100%,{max(0.01,100*$2)}%,1,1,2 r. $4,$4,1,1,0,0,0.5,0.5 +spread. $7 b. $8% n. 0,1 +fx_brushify_preview : +if $1<2" && "$!<2 +gui_error_preview "When a custom brush (bottom or top layer) is specified, at least two layers are required +for this filter to work.In this case, don't forget to set the 'Input layers' option!" +return +fi +fx_brushify $* +if $19 +_fx_brushify $* +if $1==0 rm.. elif $1==1 rm[0] fi +rr2d. {0,max(1,w/5)},{0,max(1,h/5)},0,2 n. 0,255 +frame. 3,3,0 frame. 1,1,255 frame. 1,1,0 +to_rgb. to. "Brush",4,2,13,2,1,255,255,0 to_a. +j[^-1] .,2,2 rm. +else +if $1==0 rm. elif $1==1 rm[0] fi +fi +fx_cartoon_preview : +gui_split_preview "cartoon $*",${-3--1} +fx_circle_abstraction : +foreach { +b $4% ++colormap $1 index[0] [1],0,0 +[0],[0],1,4,0 +repeat $1 { +rprogress {$>*100/$1} ++==[0] $> +skeleton3d. 2,2,0,1,0 +if {@7} +s3d. l[-6--1] { +r[2] 3,{2,h/3},1,1,-1 +1,{2,h/2*$2%},1,1,1 r. 1,{2,h/2},1,1,4 r. 3,200% *[2,-1] y +} +a[-6--1] y col3d. {1,I($>)} +[0],[0],1,4,0 +j3d. ..,0,0,0,1,{1+$5},0,0 +sh. 3 col3d... 255 j3d. ...,0,0,0,$3,{1+$5},0,0 rm. +rm.. +blend[2,-1] alpha +fi +} +k[2] +if $6 +channels 3 <. 1 inpaint[0] [1],0,1 rm. channels. 0,2 fi +if $7 n 0,255 fi +rprogress 100 +} +fx_circle_abstraction_preview : +gui_split_preview "fx_circle_abstraction $*",${-3--1} +fx_ColorAbstractionPaint : +to_rgb +pAbstraction=$1 +EllipseRatio=$2 +ValueOpacity=$3 +UseHue=$4 +MultiplyOpacity=$5 +UseSaturation=$6 +GrainMergeOpacity=$7 +NCA=$8 +CubeIt=$9 +KuwaIt=$10 +Soften=$11 +SoftenAll=$12 +DoNotCompose=$13 +ReverseOrder0=1 +ReverseOrder1=1 +ReverseOrder2=1 +eSmoothness=1 +eOpacity=0.8 +eOutline=1 +eDensity={1.5*$eSmoothness/10} +pDetailsScale={$pAbstraction/2} +pColor=1.5 +pSmoothness={10*$pAbstraction} +eSmoothness={10+($pAbstraction-1)*(1-10)/(10-1)} +ePrimaryRadius={0,($pAbstraction/5)*($pAbstraction/5)*sqrt(h)} +eSecondaryRadius={$EllipseRatio/100*$ePrimaryRadius} +cAbstraction={2+($pAbstraction-1)*(10-2)/(10-1)} +CubeSize={4+($pAbstraction-1)*(10-4)/(10-1)} ++fx_ellipsionism[0] $ePrimaryRadius,$eSecondaryRadius,$eSmoothness,$eOpacity,1,$eDensity,0 +if $SoftenAll==1" && "$Soften>0 b. $Soften,0 fi ++fx_painting[0] $pAbstraction,$pDetailsScale,$pColor,$pSmoothness,1,0 +if $KuwaIt==1 fx_kuwahara. 2,$pAbstraction,0,0 fi +if $Soften>0 b. $Soften,0 fi ++fx_color_abstraction[0] $cAbstraction,45,0.35,0 +if $NCA==1 negate. fi +if $CubeIt==1 cubism. 600,$CubeSize,40,0.7,0 fi +if $Soften>0 b. $Soften,0 fi +if $DoNotCompose==0 +blend[0,1] value,$ValueOpacity,$ReverseOrder0 +if $MultiplyOpacity<0 +ReverseOrder1=0 +MultiplyOpacity={-1*$MultiplyOpacity} +fi +if $UseHue==0 +blend[0,1] multiply,$MultiplyOpacity,$ReverseOrder1 +elif $UseHue==1 +blend[0,1] hue,$MultiplyOpacity,$ReverseOrder1 +fi +if $GrainMergeOpacity<0 +ReverseOrder2=0 +GrainMergeOpacity={-1*$GrainMergeOpacity} +fi +if $UseSaturation==0 +blend[0,1] grainmerge,$GrainMergeOpacity,$ReverseOrder2 +elif $UseSaturation==1 +blend[0,1] saturation,$GrainMergeOpacity,$ReverseOrder2 +fi +k[0] +fi +if $DoNotCompose==1 rm[0] fi +fx_ColorAbstractionPaint_Preview : +gui_split_preview "fx_ColorAbstractionPaint ${1--2}",$-1 +fx_cpencil : +repeat $! l[$>] split_opacity l[0] ++pencilbw $1,$2 blur_xy. 0.4,0.4 +quantize.. $3 n 0,255 to_rgb +blur_xy.. $4,$4 +if $5==0 fx_compose_colordoping $6,0 +elif $5==1 fx_compose_darken $6,1 +elif $5==2 fx_compose_hardlight $6,0 +elif $5==3 fx_compose_grainmerge $6,0 +elif $5==4 fx_compose_lightness $6,1 +elif $5==5 fx_compose_multiply $6,0 +elif $5==6 fx_compose_softlight $6,0 +elif $5==7 fx_compose_value $6,1 fi +done a c done done +fx_cpencil_preview : +gui_split_preview "fx_cpencil ${1--2}",$-1 +cl_comic : +_output_mode=0 +foreach { +simplif=$1 +nbBilatBord=$2 +methBord=$3 +methDesat=$4 +lineThick=$5 +forceTrait=$6 +antialias=$7 +addColors=$8 +augmLum=$9 +augmSat=$10 +nbBilatFin=$11 +colorEffect=$12 +flatColorEffect=$13 +bw=$14 +reliefEffect=$15 +specialEffect=$16 +finalAntialias=$17 +if $simplif==2 +fx_smooth_antialias. 100,0,2.5,0,50,50 +elif $simplif==3 +fx_smooth_antialias. 100,0,5,0,50,50 +elif $simplif==4 +fx_smooth_median. 3,255,0,0,50,50 +elif $simplif==5 +jeje_denoise_iuwt. 3,4,2,0 +jeje_denoise_iuwt. 3,4,2,0 +elif $simplif==6 +fx_smooth_anisotropic. 60,0.9,0.64,3.1,1.1,0.8,30,2,0,1,1,0,0,24 +elif $simplif==7 +meancurvature_flow. 20 +fi +curv="0,0,"{50-$augmLum}","{50+$augmLum}",100,100,-1,0,0,"{50-$augmSat}","{50+$augmSat}",100,100,-1,0,0,100,100,-1,0,0,100,100,-1" ++fx_curves_interactive. 7,0,1,"7",$curv +fx_smooth_nlmeans.. 4,4,10,5,0,0,24,0 +fx_smooth_bilateral.. 10,7,$nbBilatBord,0,0 ++cut.. 0,255 +reverse[-2,-1] +if $methBord==0 +blur[-3] {$lineThick} +elif $methBord==1 +boxfilter[-3] xy,{$lineThick+0.01} +elif $methBord==2 +median[-3] {($lineThick+0.01)*2} +fi +sub[-3,-2] +if $methDesat==0 +fill.. "m = min(R,G,B); M = max(R,G,B); L = 0.5*(m + M); [L, L, L]" +elif $methDesat==1 +fill.. "M = max(R,G,B); [M, M, M]" +elif $methDesat==2 +fill.. "M = min(R,G,B); [M, M, M]" +fi +cut.. 0,255 n.. 0,255 +negate.. +threshold.. {$forceTrait+80}% +n.. 0,255 +if $simplif>0 +fx_smooth_antialias.. 100,0,2.5,0,50,50 +fx_curves_interactive.. 7,0,1,"7","0,0,69,0,70,100,100,100,-1,0,0,100,0,-1,0,0,100,100,-1,0,0,100,100,-1" +fi +fx_smooth_antialias.. $antialias,0,1,0,50,50 +if $addColors==1 +mul[-2,-1] +n. 0,255 +fx_smooth_bilateral. 10,7,$nbBilatFin,0,0 +if $colorEffect==1 +fx_custom_transform. "i","if(i<64,0, sqrt((i-64)/(256-64))*256 )","i","i","i","i",0 +elif $colorEffect==2 +fx_LCE. 80,0.5,1,1,0,0 +elif $colorEffect==3 +remove_opacity. +rgb2hsv. split. c =>. val =>.. sat =>... hue ++mul[val] [sat] =>. ref +sqrt[ref] ++sub[ref] 1 =>. subRef +sub[val] 1 *[val] [subRef] negate[val] +sub[sat] 1 *[sat] [subRef] negate[sat] +rm[ref] rm[subRef] +append[-3--1] c +hsv2rgb. +fi +if $flatColorEffect==1 +(255,0,0,0,0,0,0,0,0,0,0,64,128,192,255,255,255,255,255,255,255,255,255,192,128,64^255,0,0,64,128,192,255,255,255,255,255,255,255,255,255,192,128,64,0,0,0,0,0,0,0,0^255,0,255,255,255,255,255,192,128,64,0,0,0,0,0,0,0,0,0,64,128,192,255,255,255,255) +remove_opacity.. +index.. [-1],0,1 +rm. +fx_smooth_antialias. 15,0,1,0,50,50 +elif $flatColorEffect==2 +otsu. 256 n. 0,255 +fx_smooth_antialias. 15,0,1,0,50,50 +elif $flatColorEffect==3 +fx_posterize. 150,30,1,32,0,0,0,0,50,50 +fx_custom_transform. "i","if(i<64,0, sqrt((i-64)/(256-64))*256 )","i","i","i","i",0 +elif $flatColorEffect==4 +if s==4 split_opacity. rm. fi ++colormap. 8 +index.. [-1],0,1 +rm. +rgb2hsl. split. c +n. 0,1 +append c hsl2rgb +fi +remove_opacity. +if $bw==1 +fx_curves_interactive. 7,0,1,"7","0,0,16,100,100,100,-1,0,0,100,0,-1,0,0,100,100,-1,0,0,100,100,-1" +elif $bw==2 +fx_blackandwhite. 0.299,0,0.587,0,0.114,0,0,0,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0,50,50 +threshold. 33% n 0,255 +fx_smooth_antialias. 100,0.5,5,0,50,50 +fx_smooth_antialias. 100,0.5,5,0,50,50 +elif $bw==3 +fx_blackandwhite. 0.299,0,0.587,0,0.114,0,0,0,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0,50,50 +otsu 4 +n 0,255 +fi +else +remove[-1] +fi +if $reliefEffect==1 ++fx_curves_interactive. 7,0,1,"7","0,0,16,100,100,100,-1,0,0,100,0,-1,0,0,100,100,-1,0,0,100,100,-1" +l. +b. 3 +gradient2rgb. 0 n. 0,255 +[-1] +rgb2hsv[-2,-1] split[-2,-1] c +l[-3--1] +[-3] {315} %[-3] 360 done +l[-6--4] +[-3] {135} %[-3] 360 done +l[-3--1] a c hsv2rgb s c done +l[-6--4] a c hsv2rgb s c done +rm[^-6,-3] +negate.. +/ 2 ++. 128 +blend grainmerge,1 +done +to_rgb +blend grainmerge,1 +elif $reliefEffect==2 +fx_frame. 0,100,0,100,0,0,255,255,255,255,2,0,0,0,255 +fx_custom_transform. "i","if(i<64,0, sqrt((i-64)/(256-64))*256 )","i","i","i","i",0 +fx_illuminate_shape2d. 0,0,0,0,0,255,1,1,4,0,0,3,1,1,4,10,75,30,40,40,80,0.2,1,0,0,-2,-2,2,0,0,0 +crop. 2,2,{w-4},{h-4} +fi +if $specialEffect==1 ++blur. 12.5 +add[-2,-1] *. 0.8 add. 40 +cut. 0,255 +fx_smooth_antialias. 100,2,5,0,50,50 +fx_frame_fuzzy. 12,12,30,5,255,255,255,255 +jeje_clouds. 50,0.5 +elif $specialEffect==2 +fx_curves_interactive. 7,0,1,"7","0,0,100,100,-1,0,0,65,35,100,100,-1,0,0,50,50,100,100,-1,0,0,100,100,-1" +fx_stripes_y. 4,0,0,0,50,50 +fx_simulate_grain. 0,1,0.2,100,0,0,0,0,0,0,0,0,0 +fx_dirty. 1,1,0,0,0,50,50 +elif $specialEffect==3 ++fx_smooth_antialias. 100,0,5,0,50,50 +fx_smooth_antialias. 100,0,5,0,50,50 +fx_smooth_antialias. 100,0,5,0,50,50 +fx_hardsketchbw. 80,100,1,0.1,50,0,0,0,50,50 +fx_smooth_antialias. 100,0,5,0,50,50 +fx_smooth_antialias. 100,0,5,0,50,50 +otsu. 4 n. 0,255 +fx_smooth_antialias. 15,0,1,0,50,50 +fx_smooth_antialias. 50,50,2.5,0,50,50 +blur.. 10 +fx_smooth_bilateral.. 10,7,6,0,0 +mul[-2,-1] n. 0,255 +fi +if $finalAntialias==1 +fx_smooth_antialias 50,50,2.5,0,50,50 +elif $finalAntialias==2 +fx_smooth_antialias. 15,0,1,0,50,50 +fx_smooth_antialias 50,50,2.5,0,50,50 +fi +} +cl_comic_preview : +gui_split_preview "cl_comic $*",${-3--1} +fx_cubism : +repeat $1 { cubism ${2--1} } +fx_cubism_preview : +gui_split_preview "fx_cubism $*",${-3--1} +fx_cutout : +foreach { +split_opacity l[0] { +median {10-$3} +quantize $1 ++luminance. round. area. 0,1 med={ic} rm. +inpaint_holes {$med*$2%},0,1 +if $4 n 0,255 fi +} +a c +} +fx_cutout_preview : +gui_split_preview "fx_cutout $*",${-3--1} +fx_diffusiontensors : +foreach { +wh={[w,h]} ++diffusiontensors ${5-8} +r2dx. {max(1,w*$1%)} +dt. {round(125/max(1,$1))},$2,{$3<3?$3:0},$4 +if $3==3 +remove_opacity.. r.. .,.,1,100%,3 blend[0] [1],shapeaverage0 dilate. {1+2*$4} a c +else k. fi +r. $wh,1,100%,2 +} +fx_diffusiontensors_preview : +gui_split_preview "fx_diffusiontensors $*",${-3--1} +fx_doodle : skip "$*" +foreach { +b $2 n 0,255 structuretensors b $3 +100%,100%,1,1,100 +if $7 w. ${"fitscreen ."},"[G'MIC] Doodle" fi +_stopflag=0 +eval " +const dt = 0.5; +nb_strokes = nb_consecutive_fails = 0; +while (nb_consecutive_fails<500*$1%, +run('+store. canvas'); +P0 = u([w,h] - 1); +length = 0; +repeat (2,dir, +P = P0; +oiP = iP = round(P); +C = I(#0,P); E = eig([ C[0], C[1], C[1], C[2] ]); oV = V = (dir?1:-1)*E[4,2]; +while (E[0]>$4^2 && (i(iP)>$5 || oiP==iP), +i(iP) = 0; +oiP = iP; +P+=dt*V; +iP = round(P); +C = I(#0,P,1); E = eig([ C[0], C[1], C[1], C[2] ]); V = E[4,2]; +dot(oV,V)<0?(V*=-1); +oV = V; +iP!=oiP?++length; +); +); +length<$6?(run('rm. $canvas'); ++nb_consecutive_fails):( +!(++nb_strokes%15)?run('distance. 0'); +nb_consecutive_fails = 0; +$7 && !(nb_strokes%30)?( +nb_consecutive_fails = run('if !{*} u inf else +neq. 0 r. {*,w,h},1,1,2 w. rm. u 0 fi') +); +) +)" +k. != 0 * 255 +} +fx_dreamsmooth : +m "MergeChoise : $""=_mode" MergeChoise "add","alpha","and","average","blue","burn","darken","difference","divide","dodge","exclusion","freeze","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor","edges","error" +to_color +Iterations=$1 +Eqa=$2 +MergingOption=$3 +Opacity=$4 +ReverseOrder=$5 +Smoothness=$6 +Threads=$7 +Overlap=$8 +repeat $! l[$>] split_opacity l[0] +repeat $Iterations +IWidth={0,round(w/($<+1))} +IHeight={0,round(h/($<+1))} +if $>!=0 +r. $IWidth,$IHeight,1,3,5,1 +fi ++r[0] $IWidth,$IHeight,1,3,5,1 +fx_smooth_anisotropic. {430/$Iterations*($<+1)},0.4,0.5,0.6,2,0.8,30,2,0,0,1,0,$Threads,$Overlap,0 +fx_smooth_anisotropic. {600/$Iterations*($<+1)},0.4,1,0.6,4,0.8,15,5,0,1,1,0,$Threads,$Overlap,0 +if $>!=0 +if $3!=42 +blend[-1,-2] ${_mode{$MergingOption+1}},$Opacity,$ReverseOrder +fi +if $3==42 +blend_edges[-1,-2] $Opacity,$Smoothness,$ReverseOrder +fi +if $Eqa +equalize. 256 +fi +fi +done +k. +done a c done done +fx_dreamsmooth_preview : +gui_split_preview "fx_dreamsmooth ${1--2}",$-1 +fx_ellipsionism : +ellipsionism ${^0} +fx_ellipsionism_preview : +gui_split_preview "fx_ellipsionism $*",${-3--1} +fx_feltpen : +foreach { +fx_hardsketchbw ${1-5},0,0 blend hardlight erode_oct $6 } +fx_feltpen_preview : +gui_split_preview "fx_feltpen $*",${-3--1} +gtutor_fpaint : +repeat $! +l[$>] +hasalpha={s>3} +if $hasalpha +split_opacity. +rv[-2,-1] +fi +lh={h} ++b. {$1/1.25}% +if $4 ++luminance. +rgb2hsl.. +s.. c +rm[-4,-2] +quantize[-2,-1] {round(5+15*(1-$1))},1,1 +gradient_norm[-2,-1] +n[-2,-1] 0,255 ++[-2,-1] +else +quantize. {round(5+15*(1-$1))},1,1 +gradient_norm. +n. 0,255 +fi +threshold. {80-60*$2}% +dilate_circ. 8 +thinning. +dilate_circ. 3 ++diffusiontensors. 0.1,0.85,0.3,{4+8*$1} +if $2<1 +. +r2dy[-3,-1] {$lh*(0.25+0.75*$2)},5 +repeat 2 +smooth... .,{400*(1-$2)} +done +rm. +r.. ...,...,..,..,5,0 +fi +eigen. +s.. c +fill_color... {1-0.15*$3} +fill_color.. {0.15*$3} +a[-3,-2] c +eigen2tensor[-2,-1] +98%,98%,1,1 noise. {20-10*$3},2 ==. 1 +r. ..,..,.,.,0,0,0.5,0.5,0.5,0.5 +to_rgb. +*. [-4] ++ac[-4] "* 0.6","hsl_s" +ac. "* 0.85","hsl_l" +repeat 2 +smooth[-2,-1] ...,{100*(6-5*$2)} +done ++luminance.. +n. 0,0.7 ++n[-5] 0,1 ++[-2,-1] +n. 0,1 +blend[-3,-2] add +gradient. +a[-2,-1] c +100%,100%,1,2 +if $6 +fill_color. {cos(2*((180+$5)%360)*pi/360)},{sin(2*((180+$5)%360)*pi/360)} ++*[-2,-1] +compose_channels. + +cut. {ia},{iM} +n. 0,1 +to_rgb. +*. [-7] +negate. +n. 0,255 +blend[-4,-1] multiply,$6 +fi +if $7 +fill_color. {cos(2*$5*pi/360)},{sin(2*$5*pi/360)} ++*[-2,-1] +compose_channels. + +cut. {ia},{iM} +n. 0,1 +to_rgb. +*. [-7] +n. 0,255 +blend[-4,-1] screen,$7 +fi +if $8 +fill_color. {cos(2*$5*pi/360)},{sin(2*$5*pi/360)} ++*[-2,-1] +compose_channels. + +cut. {ia},{iM} +to_rgb. +n. 0,255 +blend[-4,-1] screen,$8 +fi +rm[-1,-2,-4,-5,-6] +ac. "apply_curve 1,0,32,127,180,255,255","hsl_s" +apply_gamma. 1.4 +if $hasalpha +rv[-2,-1] +a[-2,-1] c +fi +done +done +gtutor_fpaint_preview : +gui_split_preview "gtutor_fpaint ${^0}",$-1 +fx_ghost : +foreach { +split_opacity l[0] { +diffusiontensors. 1,1,$2,$3 eigen. compose_channels.. + sqrt.. n.. 1,100 ^.. $4 n.. 0,$1 +100%,100% +eval.. "* +ca = i(x,y,0,0); +sa = i(x,y,0,1); +N = i(#-3,x,y); +x0 = x + N*ca; +y0 = y + N*sa; +x1 = x - N*ca; +y1 = y - N*sa; +polygon(#-1,2,x0,y0,x1,y1,-1,1); +I" +k. normalize_local $5,$6 +n 0,255 if $7 negate fi +} +a c +} +fx_ghost_preview : +gui_split_preview "fx_ghost $*",${-3--1} +fx_graphic_boost4 : +repeat $! l[$>] split_opacity l[0] +fx_unsharp 1,$1,30,3,0,$2,0.40,1,0,0,0 +if $3==1 break fi ++fx_pencilbw $4,$5,0,0,0 +if $6==1 k. break fi +if $7==1 fx_smooth_anisotropic[1] 60,$8,$9,$10,1.1,0.8,30,2,0,1,1,0 fi +if $11==1 k. break fi +if $12==1 reverse fi +if $13==0 fx_compose_hardlight $14,0 +elif $13==1 fx_compose_grainmerge $14,0 +elif $13==2 fx_compose_multiply $14,0 +elif $13==3 fx_compose_colorburn $14,0 +elif $13==4 fx_compose_overlay $14,0 +elif $13==5 fx_compose_value $14,1 +elif $13==6 fx_compose_darken $14,0 +elif $13==7 fx_compose_lightness $14,1 +elif $13==8 fx_compose_luminance $14,1 +elif $13==9 fx_compose_colordoping $14,0 +elif $13==10 fx_compose_comix_color $14,0,$15 +elif $13==11 fx_compose_graphicolor $14,0,$15 +elif $13==12 fx_compose_graphixcolor $14,0 +elif $13==13 fx_compose_vividedges $14,0.50,0,$15 +elif $13==14 fx_compose_darkedges $14,0.50,0,$15 +elif $13==15 fx_compose_vividscreen $14,0,$15 +elif $13==16 fx_compose_darkscreen $14,0,$15 +elif $13==17 fx_compose_interpolation $14,0 fi +if $16==1 fx_smooth_anisotropic 60,$17,$18,$19,1.1,0.8,30,2,0,1,1,0 fi +done a c done done +fx_graphic_novelfxl : +repeat $! l[$>] split_opacity l[0] +if $1==0 fx_normalize_local $2,$3,$4,$5,1,3,0 fi +if $6==0 +fx_pencilbw $7,$8,0,0,0 fi +if $9==1 k. break fi +if $10==1 fx_smooth_anisotropic. 60,$11,$12,$13,1.1,0.8,30,2,0,1,1,0 fi +if $14==1 k. break fi +if $15==1 reverse fi +if $16==0 fx_compose_overlay $17,0 +elif $16==1 fx_compose_multiply $17,0 +elif $16==2 fx_compose_softlight $17,0 +elif $16==3 fx_compose_colorburn $17,0 +elif $16==4 fx_compose_darken $17,0 +elif $16==5 fx_compose_stamp $17,0 +elif $16==6 fx_compose_hardlight $17,0 +elif $16==7 fx_compose_value $17,1 +elif $16==8 fx_compose_grainmerge $17,0 +elif $16==9 fx_compose_freeze $17,0 +elif $16==10 fx_compose_lightness $17,1 +elif $16==11 fx_compose_luminance $17,1 +elif $16==12 fx_compose_colordoping $17,0 +elif $16==13 fx_compose_comix_color $17,0,$18 +elif $16==14 fx_compose_graphicolor $17,0,$18 +elif $16==15 fx_compose_graphixcolor $17,0 +elif $16==16 fx_compose_vividedges $17,0.50,0,$18 +elif $16==17 fx_compose_darkedges $17,0.50,0,$18 +elif $16==18 fx_compose_vividscreen $17,0,$18 +elif $16==19 fx_compose_darkscreen $17,0,$18 +elif $16==20 fx_compose_interpolation $17,0 fi +if $19==1 fx_smooth_anisotropic 60,$20,$21,$22,1.1,0.8,30,2,0,1,1,0 fi +done a c done done +fx_hardsketchbw : +b $3 +if $7==4 foreach { +hardsketchbw $1,$2,$4,$5,$6 blend hardlight } return fi +hardsketchbw $1,$2,$4,$5,$6 +if $7&1 negate fi +if $7==2 r 100%,100%,1,4 repeat $! { sh[$>] 3 *. -2 +. {2*255} c. 0,255 rm. } +elif $7==3 r 100%,100%,1,4 repeat $! { sh[$>] 3 *. 2 c. 0,255 rm. } +fi +fx_hardsketchbw_preview : +gui_split_preview "fx_hardsketchbw $*",${-3--1} +fx_highlight_bloom : +foreach { +split_opacity l[0] { ++smooth $2,0.3,0.8,1,2 +-.. . +amp=$3 do smooth. {min(50,$amp)},0.1,1,1,2 amp-=50 while $amp>0 ++retinex. 16,lab,0,15 j.. .,0,0,0,0,{$4%} rm. +ac. "normalize_local {$5%},5",lab_l +*.. {$1%} ++ c 0,255 +} +a c +} +fx_highlight_bloom_preview : +gui_split_preview "fx_highlight_bloom $*",${-3--1} +fx_poster_hope : +foreach { +split_opacity l[0] { apply_gamma {10^$1} poster_hope $2 } a c +} +fx_poster_hope_preview : +gui_split_preview "fx_poster_hope $*",${-3--1} +fx_houghsketchbw : +b $1 n 0,255 +if $6==4 foreach { +houghsketchbw ${2-5} blend hardlight } return fi +houghsketchbw ${2-5} +if $6&1 negate fi +if $6==2 r 100%,100%,1,4 repeat $! { sh[$>] 3 *. -2 +. {2*255} c. 0,255 rm. } +elif $6==3 r 100%,100%,1,4 repeat $! { sh[$>] 3 *. 2 c. 0,255 rm. } +fi +fx_houghsketchbw_preview : +gui_split_preview "fx_houghsketchbw $*",${-3--1} +fx_illustration_look : +repeat $! l[$>] nm=${-gui_layer_name} +to_rgb => base_layer ++fx_smooth_anisotropic[base_layer] 20,0.16,0.63,0.6,2.35,0.8,30,2,0,1,1,0,1,24 => blur_layer ++blend[base_layer,blur_layer] grainextract => detail_layer +if $2 rgb2hsv[blur_layer] sh[blur_layer] 1 -. {$2%} c. 0,1 rm. hsv2rgb[blur_layer] fi +if $3 +fx_mix_rgb[blur_layer] 1,10,0,1,0,0,0.7,-10,0,0,10,0 j[blur_layer] .,0,0,0,0,{$3%} rm. fi +if $1 +fx_map_tones_fast[blur_layer] 20,0.2,11,0 j[blur_layer] .,0,0,0,0,{$1%} rm. fi +simplelocalcontrast_p[blur_layer] 25,1,50,1,1,1,1,1,1,1,1,1 ++fx_graphic_novelfxl[blur_layer] 1,2,6,5,20,0,1.02857,200,0,1,0.0761905,0.0857143,0,0,0,2,1,1,1,1.25714,0.371429,1.04762 => graphicnovel_layer +mv[detail_layer] 0 =>[detail_layer] "name("$nm" [Detail]),mode(grainmerge),opacity(100)" +mv[graphicnovel_layer] 1 =>[graphicnovel_layer] "name("$nm" [Paint]),mode(normal),opacity(50)" +mv[blur_layer] 2 =>[blur_layer] "name("$nm" [Base]),mode(normal),opacity(100)" +rm[base_layer] +if !$4 gui_merge_layers => "name("$nm"),mode(normal),opacity(100)" fi +done done +fx_illustration_look_preview : +gui_split_preview "fx_illustration_look ${1-3},0",$-1 +jl_hsv_to_rgb : +({360*$1}^$2^$3) hsv2rgb. u {^} rm. +levels : +_inplow={int($1)} +_inphigh={int($2)} +_gamma=$3 +_outlow={int($4)} +_outhigh={int($5)} +_tmp2="" +if $_gamma!=1 +_tmp2="-apply_gamma "$_gamma +apply_channels $_tmp2,$6,0 +fi +_curve1="0," +if $_inplow>0 +_tmp1="0," +_curve1=$_curve1$_tmp1$_outlow"," +fi +_curve1=$_curve1$_inplow","$_outlow","$_inphigh","$_outhigh +if $_inphigh<255 +_curve1=$_curve1",255,"$_outhigh +fi +if ['$_curve1']!='0,0,0,255,255' +_tmp2="-apply_curve "$_curve1 +apply_channels $_tmp2,$6,0 +fi +fx_equalize_s : +repeat $! l[$>] split_opacity l[0] to_rgb +rgb2hsv sh 1,1 *. $1 +. $2 c. 0,1 rm. hsv2rgb +done a c done done +fx_kuwahara : +ac "repeat $1 { kuwahara $2 }",$3,$4 +fx_kuwahara_preview : +gui_split_preview "fx_kuwahara $*",${-3--1} +cl_lineart: +locContEnh=$1 +simplif=$2 +nbBilatBord=$3 +lineThick=$4 +forceTrait=$5 +antialias=$6 +addGrays=$7 +augmLum=$8 +nbBilatFin=$9 +type=$10 +finalAntialias=$11 +penDrawing=$12 +effect=$13 +foreach { +if $type==2 +locContEnh=1 +augmLum=40 +fi +if $penDrawing==2 +fx_smooth_anisotropic. 60,0.9,0.64,3.1,1.1,0.8,30,2,0,1,1,0,0,24 +fi +fx_LCE. 80,{$locContEnh/2},1,1,0,0 +if $simplif==1 +fx_smooth_antialias. 100,0,5,0,50,50 +fi +curv="0,0,"{50-$augmLum}","{50+$augmLum}",100,100,-1,0,0,30,70,100,100,-1,0,0,100,100,-1,0,0,100,100,-1" ++fx_curves_interactive. 7,0,1,"7",$curv +fx_smooth_nlmeans.. 4,4,10,5,0,0,24,0 +fx_smooth_bilateral.. 10,7,$nbBilatBord,0,0 ++cut.. 0,255 +reverse[-2,-1] +blur[-3] {$lineThick} +sub[-3,-2] +fill.. "M = max(R,G,B); [M, M, M]" +cut.. 0,255 n.. 0,255 +negate.. +threshold.. {$forceTrait+80}% +n.. 0,255 +fx_smooth_antialias.. $antialias,0,1,0,50,50 +if $addGrays==1 +mul[-2,-1] +n. 0,255 +fx_smooth_bilateral. 10,7,$nbBilatFin,0,0 +if $type==0 +fx_curves_interactive. 7,0,1,"7","0,0,60,0,80,100,100,100,-1,0,0,100,0,-1,0,0,100,100,-1,0,0,100,100,-1" +elif $type==1 +remove_opacity. ++colormap. 8 +index.. [-1],0,1 +rm. +rgb2hsl. split. c +n. 0,1 +append c hsl2rgb +fx_blackandwhite. 0.299,0,0.587,0,0.114,0,0,0,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0,50,50 +fx_curves_interactive. 7,0,1,"7","0,0,20,80,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1" +elif $type>=2 +fx_blackandwhite. 0.299,0,0.587,0,0.114,0,0,0,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0,50,50 +otsu 4 +n 0,255 +fi +else +remove[-1] +fi +if $finalAntialias==1 +fx_smooth_antialias. 15,0,1,0,50,50 +elif $finalAntialias==2 +fx_smooth_antialias. 15,0,1,0,50,50 +fx_smooth_antialias. 50,50,2.5,0,50,50 +elif $finalAntialias==3 +fx_smooth_antialias. 100,0.5,5,0,50,50 +fx_smooth_antialias. 100,0.5,5,0,50,50 +fi +if $penDrawing>=1 +fx_pen_drawing. 10,0,50,50 +n 0,255 +otsu 4 +n 0,255 +fx_smooth_antialias. 15,0,1,0,50,50 +fx_smooth_antialias. 50,50,2.5,0,50,50 +fi +if $effect==1 +fx_spread. 2,2,0,0,0,50,50 +elif $effect==2 ++fx_curves_interactive. 7,0,1,"7","0,0,16,100,100,100,-1,0,0,100,0,-1,0,0,100,100,-1,0,0,100,100,-1" +l. +b. 3 +gradient2rgb. 0 n. 0,255 +[-1] +rgb2hsv[-2,-1] split[-2,-1] c +l[-3--1] +[-3] {315} %[-3] 360 done +l[-6--4] +[-3] {135} %[-3] 360 done +l[-3--1] a c hsv2rgb s c done +l[-6--4] a c hsv2rgb s c done +rm[^-6,-3] +negate.. +/ 2 ++. 128 +blend grainmerge,1 +done +to_rgb +blend grainmerge,1 +fi +} +cl_lineart_preview: +gui_split_preview "cl_lineart $*",${-3--1} +fx_linify : +foreach { +if $7 _debug=1 w ${-fitscreen\ {[w,h]}},0,"[Preview] G'MIC: Linify" fi +linify $1,$2,$3%,$4,$5,$6 +} +fx_linify_preview : +gui_split_preview "fx_linify ${1-6},0",${-3--1} +fx_lylejk_painting : +foreach { +nm={n} ++l { repeat $1 { b 0.75 unsharp 0.75,10.49 c 0,255 mv. 0 } } +smooth. 300,0.26,1,0,7 +. rv[-3--1] +blend[-2,-1] lighten,0.5 +blend[-2,-1] grainmerge,1 +fx_kuwahara. $2,$3,0,0 +texturize_canvas. $4,4 => $nm +} +fx_lylejk_painting_preview : +gui_split_preview "fx_lylejk_painting $*",${-3--1} +fx_Squiggly : +SpreadNoiseAmount=$1 +SEgThrshld=$2 +SegSmooth=$3 +GNSmooth=$4 +GNLin=$5 +InvertLuminance=$6 +EnhanceColors=$7 +ToggleOrg=$8 +Chroma=$9 +ToneTr=$10 +ToneGm=$11 +OrgMergeCh=$12 +OrgOpacity=$13 +OrgReverseorder=$14 +repeat $! l[$>] +if $ToggleOrg==1 +OrgMergeCh=30 +OrgReverseorder=1 +fi +to_rgb ++fx_spread[0] $SpreadNoiseAmount,$SpreadNoiseAmount,0,0 +fx_segment_watershed[1] $SEgThrshld,$SegSmooth,0,0 ++fx_gradient_norm[1] $GNSmooth,$GNLin,0,100,0,0 ++blend[2,1] multiply +if $InvertLuminance==1 +rgb2lab. +s. c +negate... +a[-3--1] c +lab2rgb. +fi +if $EnhanceColors==1 +fx_mix_ycbcr[3] 1,0,0,$Chroma,0,0,$Chroma,0,0,0,2,0 +fx_map_tones[0] $ToneTr,$ToneGm,0.1,30,0,0 +fx_blend[0,3] $OrgMergeCh,0,$OrgOpacity,0,0 +k[0] +fi +k. +done done +fx_Squiggly_Preview : +gui_split_preview "fx_Squiggly ${1--2}",$-1 +fx_MorphoPaint : +to_rgb[0] ++fx_morpho[0] $1,$2,0,2,0,$3,0 ++fx_apply_curve[1] $4,50,$5,200,$6,-1,128,-1,128,-1,128,255,1,3,0,0,0 +fx_spread[1] $7,$7,0,0 +fx_gaussian_blur[2] $8,0,0,1,0,0,0 +fx_segment_watershed[1] $9,$10,0,0 ++fx_painting[0] $11,$12,1.5,$13,1,0 +rm[0] +rv[0,2] +rv[1,2] +if $14 +if $19==0 MorphoStrength={0} elif $19==1 MorphoStrength={$20} fi +*[2] {$MorphoStrength/3} +if $15==0 StrokeStrength={0} elif $15==1 StrokeStrength={$16} fi +*[0] {$StrokeStrength/3} +if $17==0 SegmentStrength={0} elif $17==1 SegmentStrength={$18} fi +*[1] {$SegmentStrength/3} ++[1] [2] ++[1] [0] +if $21 n[1] 0,255 fi +rm[0,2] +fi +fx_MorphoPaint_preview : +gui_split_preview "fx_MorphoPaint ${1--2}",$-1 +fx_paint_with_brush : +predefined_style,previous_style,painting_order,nb_iterations,precision,details_threshold,background_threshold,sharpness,anisotropy,smoothness,coherence,twist_angle,twist_strength,init_canvas,brush_diameter_details,stroke_length_details,hue_randomness_details,saturation_randomness_details,value_randomness_details,opacity_details,brush_diameter_background,stroke_length_background,hue_randomness_background,saturation_randomness_background,value_randomness_background,opacity_background,brush_diameter_dynamics,stroke_length_dynamics,hue_randomness_dynamics,saturation_randomness_dynamics,value_randomness_dynamics,opacity_dynamics,spatial_step,angular_step,preview_progression,preview_type,preview_splitx,preview_splity=${1-38} +style0=1,16,50,100,100,10,80,0.5,3,0,0,6,2,10,0,0,0,60,20,1,0,0,0,30,15,15,15,15,15,15,1,45 +style1=1,16,4,100,100,1,30,0.5,3,0,0,2,3,1,0,0,0,80,10,1,0,0,0,30,8,15,15,15,15,15,1,45 +style2=2,16,30,100,20,10,100,0.5,3,45,0,4,4,10,80,0,0,60,20,1,0,0,0,30,10,15,15,15,15,15,1,45 +style3=1,16,6.6,100,100,0,0,1.7,3,0,0,2,3,1,0,0,50,80,30,1,0,0,50,20,15,15,15,15,15,15,1,45 +style4=1,16,50,100,80,5,80,0.5,1.5,45,0,4,1,20,0,0,0,10,5,1,0,0,0,30,15,15,15,15,15,15,1,45 +style5=0,16,10,100,100,10,80,0.5,3,135,50,6,1,20,0,0,0,90,3,10,0,0,0,30,0,15,15,15,15,15,1,45 +style6=1,16,30,100,100,0,95,0.5,8,-1,-1,2,2,30,0,0,0,100,20,1,0,0,0,30,0,0,0,0,0,0,1,45 +style7=1,16,50,100,100,10,80,0.5,3,0,0,6,1,10,0,0,0,6,20,1,0,0,0,100,17.34,15,15,15,15,20,1,45 +if $predefined_style!=$previous_style" && "$previous_style>=0 +painting_order,nb_iterations,precision,details_threshold,background_threshold,sharpness,anisotropy,smoothness,coherence,twist_angle,twist_strength,init_canvas,brush_diameter_details,stroke_length_details,hue_randomness_details,saturation_randomness_details,value_randomness_details,opacity_details,brush_diameter_background,stroke_length_background,hue_randomness_background,saturation_randomness_background,value_randomness_background,opacity_background,brush_diameter_dynamics,stroke_length_dynamics,hue_randomness_dynamics,saturation_randomness_dynamics,value_randomness_dynamics,opacity_dynamics,spatial_step,angular_step=${style$predefined_style} +fi +foreach { +to_color ++diffusiontensors {[$sharpness,$anisotropy]%},$smoothness,$coherence +if $twist_strength>0 +if $twist_angle>=0 +f. "begin(Id = eye(2)); +T = [ i0,i1,i1,i2 ]; +eig = eig(T); +const ang = $twist_angle°; +U = lerp(eig[2,2],[ cos(ang),sin(ang) ],$twist_strength%); +U/=max(1e-8,norm(U)); +UUt = mul(U,U,2); +T = eig[0]*UUt + eig[1]*(Id - UUt); +[ T[0],T[1],T[3] ]" +else +100%,100%,1,2 rand. -1,1 b. $coherence orientation. +f.. "begin(Id = eye(2)); +T = [ i0,i1,i1,i2 ]; +eig = eig(T); +U = lerp(eig[2,2],I(#-1),$twist_strength%); +UUt = mul(U,U,2); +T = eig[0]*UUt + eig[1]*(Id - UUt); +[ T[0],T[1],T[3] ]" +rm. +fi +elif $twist_strength<0 +if $twist_angle>=0 +f. "R = rot($twist_angle°); +Rt = transpose(R,2); +T = mul(mul(Rt,[ i0,i1,i1,i2 ],2),R,2); +[ T[0],T[1],T[3] ]" +else +100%,100%,1,2 rand. -1,1 b. $coherence orientation. +f.. "ang = atan2(i(#-1,x,y,0,1),i(#-1,x,y,0,0)); +R = rot(ang); +Rt = transpose(R,2); +T = mul(mul(Rt,[ i0,i1,i1,i2 ],2),R,2); +[ T[0],T[1],T[3] ]" +rm. +fi +fi ++gradient_norm.. 100%,100%,1,2,[x,y] a[-2,-1] c r. {wh},1,1,3,-1 sort. +,x +r. {max(0.01,$precision)}%,1,1,3 z. {(100-$background_threshold)*$details_threshold%}%,$details_threshold% +if $painting_order==0 100% rand. 0,100 rv[-2,-1] a[-2,-1] c sort. +,x channels. 1,100% +elif $painting_order==2 mirror. x +fi +arg0 $init_canvas,"+f[0] 0","+f[0] 128","+f[0] 255","[0]","+b[0] 1%","+kuwahara[0] 10","+fx_vector_painting[0] 9" +run ${} +ind=0 +repeat inf { t=$> +progress {$ind*100/w#2} +100%,100%,1,{s#0+1} +nb_strokes={max(1,w#2/$nb_iterations)} +$nb_strokes,1,1,1,:${-math_lib}" +begin(color_random = vector(#s#0)); +lambda(tau) = min(1,edge/(1e-8+tau)); +const brush_diameter_background = $brush_diameter_background; +const brush_diameter_details = $brush_diameter_details; +const brush_diameter_dynamics = $brush_diameter_dynamics; +const stroke_length_background = $stroke_length_background; +const stroke_length_details = $stroke_length_details; +const stroke_length_dynamics = $stroke_length_dynamics; +const opacity_background = 255*$opacity_background%; +const opacity_details = 255*$opacity_details%; +const opacity_dynamics = $opacity_dynamics; +const hue_randomness_background = $hue_randomness_background%; +const hue_randomness_details = $hue_randomness_details%; +const hue_randomness_dynamics = $hue_randomness_dynamics; +const saturation_randomness_background = $saturation_randomness_background%; +const saturation_randomness_details = $saturation_randomness_details%; +const saturation_randomness_dynamics = $saturation_randomness_dynamics; +const value_randomness_background = $value_randomness_background%; +const value_randomness_details = $value_randomness_details%; +const value_randomness_dynamics = $value_randomness_dynamics; +const spatial_step = max($spatial_step,0.1); +const angular_step = max($angular_step,1); +stroke = $ind + x; +stroke=w#2 break fi +} +k. +} +if $predefined_style!=$previous_style +u "{"$predefined_style"}{"$predefined_style"}""{"$painting_order"}{"$nb_iterations"}{"$precision"}{"$details_threshold"}{"$background_threshold"}""{"$sharpness"}{"$anisotropy"}{"$smoothness"}{"$coherence"}{"$twist_angle"}{"$twist_strength"}{"$init_canvas"}""{"$brush_diameter_details"}{"$stroke_length_details"}""{"$hue_randomness_details"}{"$saturation_randomness_details"}{"$value_randomness_details"}{"$opacity_details"}""{"$brush_diameter_background"}{"$stroke_length_background"}""{"$hue_randomness_background"}{"$saturation_randomness_background"}{"$value_randomness_background"}""{"$opacity_background"}""{"$brush_diameter_dynamics"}{"$stroke_length_dynamics"}""{"$hue_randomness_dynamics"}{"$saturation_randomness_dynamics"}{"$value_randomness_dynamics"}""{"$opacity_dynamics"}""{"$spatial_step"}{"$angular_step"}{"$preview_progression"}{"$preview_type"}{"$preview_splitx,$preview_splity"}" +fi +fx_paint_with_brush_preview : +_is_preview=1 +gui_split_preview "fx_paint_with_brush $*",${-3--1} +fx_painting : skip ${4=0},${5=0} +foreach { +to_colormode {max(3,s)} split_opacity rv +repeat $1 { fx_normalize_local. 10,6,5,20,1,11 } +fx_smooth_anisotropic. {100*$2},0.2,1,$2,{2*$2},0.8,90,2,0,1,1,2,1,16 +fx_mix_lab. 1,0,0,$3,0,0.5,$3,0,0.5,0,2,0 +if $5 fx_segment_watershed. 10,1,0 fi +smooth. $4,0,1,1,1 +rv a c +} +fx_painting_preview : +gui_split_preview "fx_painting $*",${-3--1} +fx_pastell : +MasterOpacity=$1 +BgTextured=$2 +ReverseEffect=$3 +RAmplitude=$4 +RThickness=$5 +RSharpness=$6 +ROrientations=$7 +ROffset=$8 +RColormode=$9 +GSmoothness=$10 +GLinearity=$11 +GNegativeColors=$12 +ActivateShakes=$13 +RiAmplitude=$14 +RiSize=$15 +ActivateLizards=$16 +WAmplitude=$17 +WSmoothness=$18 +ActivatePink=$19 +RDeform=$20 +RChannels=0 +GMinThreshold=0 +GMaxThreshold=100 +RiShape=3 +RiAngle=135 +if $ActivatePink==1 deform[0] $RDeform fi ++fx_rodilius[0] $RAmplitude,$RThickness,$RSharpness,$ROrientations,$ROffset,0,$RColormode,$RChannels,0 ++fx_gradient_norm[0] $GSmoothness,$GLinearity,$GMinThreshold,$GMaxThreshold,$GNegativeColors,0 +fx_smooth_bilateral[0] 15,10,3,3,0 +if $ActivateLizards==1 water[0,2] $WAmplitude,$WSmoothness fi +if $ActivateShakes==1 ripple[0,2] $RiAmplitude,$RiSize,$RiShape,$RiAngle,0 fi +if $ReverseEffect==1 rv[0,2] fi ++blend[0,2] divide,1,0 +rv[1,3] +blend[1,3] value,1,0 +if $BgTextured==1 fx_ellipsionism[0] 20,2,10,0.5,1,1,0 fi +blend[0,1] alpha,$MasterOpacity,0 +k[0] +fx_pastell_preview : +gui_split_preview "fx_pastell ${1--2}",$-1 +fx_pen_drawing : +drawing $1 +fx_pen_drawing_preview : +gui_split_preview "fx_pen_drawing $*",${-3--1} +fx_tk_photoillustration : +repeat $! l[$>] +if $26==1 scdo=50 scup=200 fi +if $26==2 scdo=25 scup=400 fi +if $26!=0 r $scdo%,$scdo% else fi +if $21==0 +[^] +negate[1] [0] +negate[0] +fx_gaussian_blur[2] {{{100-$18}/5}+0.5},0,0,1,0,0,0 fx_compose_dodge[1,2] 1 +if $23==1 fx_gaussian_blur[1] {{{100-$18}/10}+0.5},0,0,1,0,0,0 fi +fx_gaussian_blur[3] {{{{{100-$18}/5}+1}*10}+10},0,0,1,0,0,0 +fx_compose_dodge[2,3] 1 +if $23==1 fx_gaussian_blur[2] {{{{100-$18}/10}+0.5}*3},0,0,1,0,0,0 fi +reverse[1,2] fx_compose_multiply[1,2] {1-{$19/10}} +tk_fx_channel_processing[1] {{1-$20}+0.1},1,0,0,0,0,100,256,0,0,0,2,7,0 +elif $21==1 ++fx_laplacian $19,{99.99-$18},$18,1,1,0 +elif $21==2 ++fx_gradient_norm $19,0.5,{99.99-$18},$18,1,0 +elif $21==3 ++fx_highpass {-{$18-100.3}},{{10-$19}*0.7},0,1,0 +elif $21==4 ++fx_pencilbw {100-$18},{$19*20},0,0,0 +elif $21==5 ++fx_hardsketchbw {300+{{$18-50}*15}},{$19*10},$19,1,{50-{$18/2}},0,0,0 +elif $21==6 ++fx_thin_edges $19,{{$18/5}-10},0,0 +elif $21==7 ++fx_edges {$19/3.5},{95-$18},0,0 ++fx_mix_hsv[0] 1,0,0,1,-1,0,1,0,0,0,2,0 +tk_fx_channel_processing[2] 1,1,0,{$19/10},4,{{$18-50}*2},100,256,0,0,0,2,7,0 +reverse[1,2] fx_compose_multiply[1,2] {0.5+{$20/2}} +elif $21==8 ++channels 2 +if $19<=5 fx_unsharp[1] 1,{2-{{$19*0.3}+0.5}},20,{5-$19},0.00,1.00,0.5,1,0,7,0 +else fx_gaussian_blur[1] {$19-5},0,0,1,0,0,0 +fi +fi +if $1!=3 +fi +if $24==0 +if $1==0 +fx_map_tones[0] {$2/2.5},{1-{$2/2.5}},$2,{2+{$2*80}},3,0 +elif $1==1 +fx_map_tones[0] {$2/10},0.5,{10-{$2*2}},300,3,0 +elif $1==2 +fx_map_tones_fast[0] {$2*2},{$2/2.5},3,0 +elif $1==3 +fx_normalize_local[0] {$2*2},{1+{$2*25.2}},{$2*16},{$2*16},0,3,0 +elif $1==4 +fx_unsharp[0] 0,{{w+h}/100},0,$2,0,1,1,1,0,7,0 +elif $1==5 ++negate[0] +if $21!=9 reverse[1,2] fi +fx_gaussian_blur[1] {{{w+h}/5}-{$2*{{w+h}/12.5}}},0,0,1,0,0,0 +to_gray[1] reverse[0,1] fx_compose_softlight[0,1] {$2/2.5} +elif $1==6 +fx_tk_dri[0] {$2/2.5},{$2/5},{$2/2.5},{$2*2},{$2/2.5},1,1,0 +fi +else ++to_rgba[0] +channels[0] 0 +if $21!=9 move[1] 4 fi +negate[2] +tk_fx_channel_processing[2] 1,1,2,0,0,0,100,256,0,0,0,2,7,0 +fx_gaussian_blur[2] {{w+h}/500},0,0,1,0,0,0 +to_gray[2] +if $1==0 +fx_map_tones[1] {$2/2.5},{1-{$2/2.5}},$2,{2+{$2*80}},3,0 +elif $1==1 +fx_map_tones[1] {$2/10},0.5,{10-{$2*2}},300,3,0 +elif $1==2 +fx_map_tones_fast[1] {$2*2},{$2/2.5},3,0 +elif $1==3 +fx_normalize_local[1] {$2*2},{1+{$2*25.2}},{$2*16},{$2*16},0,3,0 +elif $1==4 +fx_unsharp[1] 0,100,0,$2,0,1,1,1,0,7,0 +elif $1==5 +negate[1] fx_gaussian_blur[1] {{{w+h}/5}-{$2*{{w+h}/12.5}}},0,0,1,0,0,0 +to_gray[1] to_rgba[1] +elif $1==6 +fx_tk_dri[1] {$2/2.5},{$2/5},{$2/2.5},{$2*2},{$2/2.5},1,1,0 to_rgba[1] +fi +split[1] c +if $21!=9 reverse[4,5] compose_multiply[4,5] append[-5,-4,-3,-2] c +else reverse[3,4] compose_multiply[3,4] append[-4,-3,-2,-1] c +fi +if $1!=3 compose_rgba[0,1] +else reverse[0,1] fx_compose_softlight[0,1] {$2/2.5} +fi +fi +tk_fx_channel_processing[0] 1,$11,$10,0,0,0,100,256,0,0,0,2,7,0 +if $1==3 +fi +if $3==0 fx_smooth_anisotropic[0] {$5*100},{$4*2},$4,$5,$5,0.80,30.00,2.0,0,1,1,0,1,0 +elif $3==1 fx_smooth_bilateral[0] {100-{$4*100}},{$5*25},1,0,0 +elif $3==2 fx_gaussian_blur[0] {$5*10},0,0,1,8,0,0 +elif $3==3 fx_segment_watershed[0] {$4*5},{$5/2},0,0 +elif $3==4 fx_morpho[0] 3,{$5*2+2},0,2,0,1,0 +elif $3==5 fx_smooth_selective[0] {$5*4},{$4*2},10,10,0,1,0 +elif $3==6 fx_smooth_haar[0] {10-{$4*10}},{round($5*5,1)},0,0,1,0 +elif $3==7 to_rgb[0] fx_kuwahara[0] {6-{$4*5}},{1+{$5*2.9}},0,0 +fi +fx_mix_lab[0] 1,0,0,$17,$15,0,$17,$16,0,0,2,0 +if $25==0 fx_unsharp[0] 1,$6,20,$7,0.00,1.00,0.5,1,0,7,0 +else ++to_rgba[0] +fx_edges[0] $6,{30-{$7*5}},1,0 +if $21!=9 move[1] 4 fi +fx_unsharp[1] 1,$6,20,$7,0.00,1.00,0.5,1,0,7,0 +fx_gaussian_blur[2] {{w+h}/500},0,0,1,0,0,0 +to_gray[2] +split[1] c +if $21!=9 reverse[4,5] compose_multiply[4,5] append[-5,-4,-3,-2] c +else reverse[3,4] compose_multiply[3,4] append[-4,-3,-2,-1] c +fi +compose_rgba[0,1] +fi +if $22==0 +if $21==3 reverse fx_compose_overlay $20 +elif $21==8 reverse fx_compose_hardlight $20 +elif $21!=9 reverse fx_compose_multiply $20 +fi +fi +if $8==1 +fx_glow[0] $9,0,0 +elif $8==2 ++fx_highpass[0] {$9*3},2,1,0,0 +if $22==1" && "$21!=9 reverse[1,2] fi +reverse[0,1] fx_compose_overlay[0,1] {$9/40} +elif $8==3 [0] [0] +if $22==1" && "$21!=9 reverse[1,3] fi +fx_compose_screen[1,2] 1 fx_gaussian_blur[1] {$9*3},0,0,1,0,0,0 +reverse[0,1] fx_compose_softlight[0,1] {$9/20} +elif $8==4 +fx_smooth_anisotropic[0] 0,1.5,0.3,{$9/4},1.10,0.80,30.00,2.0,0,1,1,0,1,0 +elif $8==5 ++fx_mix_hsv[0] 1,0,0,1,-1,0,1,0,0,0,2,0 +if $22==1" && "$21!=9 reverse[1,2] fi +tk_fx_channel_processing[1] 1,1,0,0,4,0,{100-{$9*2.5}},256,0,1,0,2,0,0 +fx_gaussian_blur[1] $9,0,0,1,0,0,0 +tk_fx_channel_processing[1] 1,1,0,0,4,0,{50-{$9*2}},256,0,1,0,2,0,0 +tk_fx_replace_color[1] 1,0,0,0,0,255,0,0,0,0 +fx_gaussian_blur[1] {$9*2},0,0,1,0,0,0 +reverse[0,1] fx_compose_softlight[0,1] {0.25+{$9/150}} +elif $8==6 +fx_smooth_anisotropic[0] 60,0.16,{{$9/50}+0.6},{{$9/9}+0.6},2.35,0.8,30,2,0,1,1,0,1 +fi +if $26!=0 r $scup%,$scup% fi +done done +fx_tk_photoillustration_preview : +gui_split_preview "fx_tk_photoillustration ${1--2}",$-1 +fx_polygonize_delaunay : +foreach { +to_rgba wh={[w,h]} if $11 r 150%,150%,1,100%,3 fi +mM={[im,iM]} b $4 n $mM ++to_rgb. gradient_norm. ge. $2 +f. "!x || !y || x==w-1 || y==h-1?(u^0.25<$3%):(u^0.25<$1%?i:0)" +{is+1},1,1,2 f.. ">begin(p = 0); i?(I[#-1,++p] = [x,y];p):0" +delaunay.. 0 +if $5==4 ++f[0] 0 f... "*i?( +p = I(#1); P0 = I[#2,p[0]]; P1 = I[#2,p[1]]; P2 = I[#2,p[2]]; +W = solve([P0[0],P1[0],P2[0],P0[1],P1[1],P2[1],1,1,1],[x,y,1]); +I(#-1) = cut(W[0]*I(#0,P0) + W[1]*I(#0,P1) + W[2]*I(#0,P2),0,255); +);I" +elif $5==3 ++f[0] 0 f... "*i?( +p = I(#1); P0 = I[#2,p[0]]; P1 = I[#2,p[1]]; P2 = I[#2,p[2]]; +I(#-1) = (I(#0,P0) + I(#0,P1) + I(#0,P2))/3; +);I" +elif $5==2 ++norm[1] label_fg. 0 {iM+1},1,1,3 rand. 0,255 to_rgba. point. 0 map.. . rm. +else ++norm[1] !=. 0 *. 255 channels. -3,0 +if $5 sh. 0,2 f. 255 rm. fi +fi +rm[0,2] +if $6 +norm[0] f[0] "i!=j(1) || i!=j(0,1)" ++fc. ${7-10} j.. .,0,0,0,0,{$6%},... rm. +fi +k. +if $11 r $wh,1,100%,2 fi +} +fx_polygonize_delaunay_preview : +gui_split_preview "fx_polygonize_delaunay $*",${-3--1} +fx_polygonize : +polygonize $1,$2,{$3^2},$4,$5 +if $9 foreach { ++norm g. xy,1 !=[-2,-1] 0 -|[-2,-1] r. 100%,100%,1,4 +replace_color. 0,0,1,1,1,1,$6,$7,$8,$9 +blend alpha +} fi +fx_polygonize_preview : +gui_split_preview "fx_polygonize $*",${-3--1} +fx_poster_edges : +if $1 bilateral 10,$1 fi +poster_edges ${2-7} +fx_poster_edges_preview : +gui_split_preview "fx_poster_edges $*",${-3--1} +fx_posterize : +foreach { +split_opacity l[0] { +. amp=$1 do smooth. {min(50,$amp)},{$2%},1,$3,{2*$3} amp-=50 while $amp>0 +bilateral.. .,5,10 rm. +srgb2rgb +colormap $4,0 rgb2srgb +index.. .,0,0 +if $5 +area.. 0,0 <. $5 inpaint... .,0,3 rm. fi +map.. . rm. +if $6 ++norm (0,1,0;1,1,1;0,1,0) +dilate.. . rm.. -[-2,-1] !=. 0 100%,100%,1,{0,s} j... .,0,0,0,0,{$6%},.. rm[-2,-1] +fi +if $7 n 0,255 fi +} +a c +} +fx_posterize_preview : +gui_split_preview "fx_posterize $*",${-3--1} +fx_pdithered : ++apply_gamma. $1 - 128 * $2 + 128 + $3 b. $4 c. 0,255 ditheredbw. +quantize.. $5 to_rgb blur_xy.. $6,$6 +if $7==0 fx_compose_colordoping $8,0 +elif $7==1 fx_compose_darken $8,0 +elif $7==2 fx_compose_softlight $8,0 +elif $7==3 fx_compose_grainmerge $8,0 +elif $7==4 fx_compose_multiply $8,1 +elif $7==5 fx_compose_value $8,1 fi +fx_pdithered_preview : +gui_split_preview "fx_pdithered ${1--2}",$-1 +fx_quadtree : +mode,precision,homogeneity,outline,radius1,radius2,anisotropy,only_leafs=${1-8} +m "_qt : sh 3 u {w>1&&h>1?iv*(w*h)^"$homogeneity":-0.1} k[0]" +foreach { +to_rgb +keep_only_leafs={$mode!=2" || "$only_leafs} ++norm. a c +_qt ({d=max(w,h);[0,0,d-1,d-1]},0,${}) +repeat $precision { ++columns. 100% n={yM} rm. +x0,y0,x1,y1,level={crop(0,$n,5,1)} +xc={round(($x1+$x0)/2)} yc={round(($y1+$y0)/2)} +xc1,yc1={[$xc,$yc]-1} +level1={$level+1} +B0=$x0,$y0,$xc1,$yc1 +crop[0] $B0,3 _qt. B0.=,$level1,${} rm. +B1=$xc,$y0,$x1,$yc1 +crop[0] $B1,3 _qt. B1.=,$level1,${} rm. +B2=$x0,$yc,$xc1,$y1 +crop[0] $B2,3 _qt. B2.=,$level1,${} rm. +B3=$xc,$yc,$x1,$y1 +crop[0] $B3,3 _qt. B3.=,$level1,${} rm. +if $keep_only_leafs +sh. $n,$n,0,0 f. $B0 rm. +($B1;$B2;$B3) a[-2,-1] y +else +=. -1,5,$n +($B0;$B1;$B2;$B3) a[-2,-1] y +else +fi +} +shift. 2,0,0,0,2 sort. +,y levelmax={i(0,h-1)} shift. -2,0,0,0,2 +channels[0] 0,2 +structuretensors[0] a[0,-1] c +r. {w+6},100%,1,1,0 +repeat h { +x0,y0,x1,y1={crop(0,$>,4,1)} ++crop[0] $x0,$y0,$x1,$y1,3 r. 1,1,1,100%,2 y. x +j.. .,{-2,w-6},$> rm. +} +permute. cyzx +channels[0] 0,3 f[0] 0 +if $mode==0 +f. "> +rectangle(ind,P0,P1,opacity,color) = ( +_P0 = P0; +_P2 = P1; +_P1 = [ _P2[0], _P0[1] ]; +_P3 = [ _P0[0], _P2[1] ]; +polygon(#ind,4,_P0,_P1,_P2,_P3,opacity,color); +); +begin(colo = [ 0,0,0,255 ]); +P = I; +Xpp = P[0,2]; +Xnn = P[2,2]; +col = [ P[6,3],255 ]; +if ("$outline"<=0, +rectangle(#0,Xpp,Xnn,1,col); +_(else), +rectangle(#0,Xpp,Xnn,1,colo); +rectangle(#0,Xpp + "$outline",Xnn - "$outline",1,col); +); +I" +elif $mode==1 +f. "> +P = I; +Xpp = P[0,2]; +Xnn = P[2,2]; +Xnp = [ Xnn[0],Xpp[1] ]; +Xpn = [ Xpp[0],Xnn[1] ]; +col1 = [ P[6,3],255 ]; +col2 = [ P[6,3],64 ]; +T = [ P[9],P[10],P[10],P[11] ]; +eig = eig(T); +angle = atan2(eig[5],eig[4])*180/pi; +if ((angle>=0 && angle<90) || angle<-90, +polygon(#0,3,Xpp,Xnp,Xnn,1,col1); +polygon(#0,3,Xpp,Xnn,Xpn,1,col2); +_(else), +polygon(#0,3,Xnp,Xnn,Xpn,1,col1); +polygon(#0,3,Xnp,Xpp,Xpn,1,col2) +); +I" +else +f. "> +begin(colo = [ 0,0,0,255 ]); +P = I; +Xpp = P[0,2]; +Xnn = P[2,2]; +Xcc = (Xpp + Xnn)/2; +R = (Xnn[0] - Xpp[0])/2; +col = [ P[6,3],255 ]; +r = "$radius2"*R; +R*="$radius1"; +T = [ P[9],P[10],P[10],P[11] ]; +eig = eig(T); +anisotropy = (1 + eig[1])/(1 + eig[0]); +r*=anisotropy^"$anisotropy"; +angle = atan2(eig[5],eig[4])*180/pi; +if ("$outline">0, ellipse(#0,Xcc,R,r,angle°,1,colo)); +ellipse(#0,Xcc,R - "$outline",r - "$outline",angle°,1,col); +I" +if !$outline sh[0] 100% if !im solidify[0] 10% fi fi +fi +k[0] +} +um _qt +fx_quadtree_preview : +gui_split_preview "fx_quadtree $*",${-3--1} +fx_rodilius : +ac "rodilius ${1-5,7} repeat $6 { smooth 10,0,1,1,1,0.8,45 sharpen 30 } c 0,255",$8,$9 +fx_rodilius_preview : +gui_split_preview "fx_rodilius $*",${-3--1} +fx_shapeism : +foreach { +to_rgb ++gradient_norm b. $13% ^. $12 quantize. $6,0,0 +100%,100%,1,2 +repeat $6 { ++channels[2] 100% +>[1] $> !=.. 0 -|[-2,-1] a[2,-1] c +size={if($6<=1,$7,$7+($8-$7)*$>/($6-1))} +if $size<1 break fi +if $5 {2*$size},{2*$size} _fx_shapeism$1. ${2-4} r2dy. $size +else $size,$size _fx_shapeism$1. ${2-4} +fi ++!=. 0 expand_xy[-2,-1] 1,0 n[-2,-1] 0,1 +if $10<1 dilate. 3 fi +. a[-3--1] c +rprogress "pack_sprites[-2,-1] 1,100,$9,$10,$11",{$>*100/$6},{($>+1)*100/$6} +channels. 0,1 +} +rprogress 97 +rm[1] +channels. 0 +!=. 0 blend[0,-1] shapeaverage0 *[1] 255 a c +i[0] 100%,100%,1,4 fc[0] $14,$15,$16,$17 +blend alpha +rprogress 100 +} +fx_shapeism_preview : +gui_print_preview "" +50%,50% _fx_shapeism$1. ${2-4} frame. 1,1,0 >=. 50% n. 0,255 r. 100%,100%,1,4 +ri. [0],0,0,0.5,0.5 -| +_fx_shapeism0 : +f 255 skip $* +_fx_shapeism1 : +polygon 3,50%,0,0,100%,100%,100%,1,1 skip $* +_fx_shapeism2 : +shape_circle {w} rm.. skip $* +_fx_shapeism3 : +shape_diamond {w} rm.. skip $* +_fx_shapeism4 : +star3d 3,1 *3d. {0,min(w,h)/2} j3d[0] .,50%,50%,0,1,2,0 k[0] skip $* +_fx_shapeism5 : +star3d 4,1 *3d. {0,min(w,h)/2} j3d[0] .,50%,50%,0,1,2,0 k[0] skip $* +_fx_shapeism6 : +star3d 5 *3d. {0,min(w,h)/2} j3d[0] .,50%,50%,0,1,2,0 k[0] skip $* +_fx_shapeism7 : +star3d $1,$2 *3d. {0,min(w,h)/2} r3d. 0,0,1,$3 j3d[0] .,50%,50%,0,1,2,0 k[0] +fx_sharp_abstract : +ac "rolling_guidance ${1-3}",$4 +fx_sharp_abstract_preview : +gui_split_preview "fx_sharp_abstract $*",${-3--1} +fx_SimpleNoiseCanvas : +CanvasScale={$1} +NoiseAmplitude=$2 +NoiseType=$3 +ThreadHorizLen=$4 +ThreadVertLen=$5 +OverAllBlur=$6 +HighCut=$7 +LowCut=$8 +CanvasMergeChoice=$9 +InvertCanvasColors=$10 +InvertImageColors=$11 +ReverseChoice=$12 +MergeChoice=$13 +PreserveCanvas=$14 +to_rgb[0] +CanvasScale={1.2-$CanvasScale} +(255^255^255) +ri. [0] +r[1] {100*$CanvasScale}%,{100*$CanvasScale}% +if $NoiseType!=2 NoiseAmplitude={$NoiseAmplitude*10} fi +fx_noise[1] $NoiseAmplitude,$NoiseType,0,1,0 +fx_ditheredbw[1] 1,1,0,0,0,0 ++fx_gaussian_blur[1] 0,$ThreadHorizLen,0,1,0,0,0 ++fx_gaussian_blur[1] 0,0,$ThreadVertLen,1,0,0,0 +n[2] 0,255 +n[3] 0,255 +if $CanvasMergeChoice==0 blend[2,3] average +elif $CanvasMergeChoice==1 blend[2,3] multiply +elif $CanvasMergeChoice==2 blend[2,3] darken +elif $CanvasMergeChoice==3 blend_edges[2,3] 0.9 +fi +fx_gaussian_blur[2] $OverAllBlur,0,0,1,0,0,0 +rm[1] +ri[1] [0] +($15^$16^$17) +ri[2] [0] +blend[1,2] multiply +fx_apply_curve {$LowCut},-1,128,-1,128,-1,128,-1,128,-1,128,{$HighCut},1,3,0,0,0 +if $ReverseChoice==1 rv[0,1] fi +if $InvertCanvasColors==1 negate[1] fi +if $InvertImageColors==1 negate[0] fi +if $MergeChoice==0 +blend[1,0] average +elif $MergeChoice==1 +blend[1,0] multiply +elif $MergeChoice==2 +blend[1,0] screen +elif $MergeChoice==3 +blend[1,0] darken +elif $MergeChoice==4 +blend[1,0] lighten +elif $MergeChoice==5 +blend[1,0] difference +elif $MergeChoice==6 +blend[1,0] negation +elif $MergeChoice==7 +blend[1,0] exclusion +elif $MergeChoice==8 +blend[1,0] overlay +elif $MergeChoice==9 +blend[1,0] hardlight +elif $MergeChoice==10 +blend[1,0] softlight +elif $MergeChoice==11 +blend[1,0] dodge +elif $MergeChoice==12 +blend[1,0] colorburn +elif $MergeChoice==13 +blend[1,0] reflect +elif $MergeChoice==14 +blend[1,0] freeze +elif $MergeChoice==15 +blend[1,0] stamp +elif $MergeChoice==16 +blend[1,0] interpolation +elif $MergeChoice==17 +blend[1,0] grainextract +elif $MergeChoice==18 +blend[1,0] grainmerge +elif $MergeChoice==19 +blend[1,0] xor +elif $MergeChoice==20 +blend_edges[1,0] 0.8 +fi +if $ReverseChoice==1 rv[0,1] fi +if $PreserveCanvas==0 rm[1] fi +if $PreserveCanvas==1" && "$MergeChoice!=21 rv[1,2] fi +if $MergeChoice!=21 rm[0] fi +if $MergeChoice!=21" && "$PreserveCanvas==1 rv[0,1] fi +fx_SimpleNoiseCanvasPreview : +gui_split_preview "fx_SimpleNoiseCanvas ${1--2}",$-1 +fx_sketchbw : skip ${16=0} +srand $16 +if $15==4 foreach { +sketchbw ${1-14} blend hardlight } return fi +sketchbw ${1-14} +if $15&1 negate fi +if $15==2 r 100%,100%,1,4 repeat $! { sh[$>] 3 *. -2 +. {2*255} c. 0,255 rm. } +elif $15==3 r 100%,100%,1,4 repeat $! { sh[$>] 3 *. 2 c. 0,255 rm. } +fi +fx_sketchbw_preview : +gui_split_preview "fx_sketchbw $*",${-3--1} +fx_smooth_abstract : +foreach { +split_opacity l[0] { +srgb2rgb +mM={[im,iM]} +b $4 n. $mM gradient_norm. <=. {50-$5} +inpaint_pde[0] [1],$1%,$2,$3 rm. +rgb2srgb c 0,255 +} +a c +} +fx_smooth_abstract_preview : +gui_split_preview "fx_smooth_abstract $*",${-3--1} +fx_stylize : +init_resolution={arg(1+$16,8,16,32,64,128,256)} +colorspace=${"arg0 $11,all,lrgb,ycbcr,ycbcr,ycbcr_y,ycbcr_cbcr,lab,lab,lab_l,lab_ab"} +match_colors="s c,-3 mv[1] 3 b[-2,-1] 1% negate[-2,-1] n[-2,-1] 0,1" +luma,chroma= +if $11==3" || "$11==7 +luma=_${"arg0 ($11==7),y,l"} +chroma=_${"arg0 ($11==7),cbcr,ab"} +fi +if $10==1 +match_colors=$match_colors" ac[0,1] \"balance_gamma ,\","$colorspace$luma +if narg($chroma) match_colors=$match_colors" ac[0,1] \"balance_gamma ,\","$colorspace$chroma fi +elif $10==2 +match_colors=$match_colors" match_histogram[0] [1],256,"$colorspace$luma +if narg($chroma) match_colors=$match_colors" match_histogram[0] [1],256,"$colorspace$chroma fi +elif $10==3 +match_colors=$match_colors" match_pca[0] [1],"$colorspace$luma" c[0] 0,255" +if narg($chroma) match_colors=$match_colors" match_pca[0] [1],"$colorspace$chroma" c[0] 0,255" fi +fi +if $12==1 match_colors=$match_colors" rgb2ycbcr[0,1] sh[0,1] 1,2 f[-2,-1] 128 rm[-2,-1] ycbcr2rgb[0,1]" +elif $12==2 match_colors=$match_colors" srgb2lab[0,1] sh[0,1] 1,2 f[-2,-1] 0 rm[-2,-1] lab2srgb[0,1]" +elif $12==3 match_colors=$match_colors" rgb2ycbcr[0,1] sh[0,1] 0 f[-2,-1] 128 rm[-2,-1] ycbcr2rgb[0,1]" +elif $12==4 match_colors=$match_colors" srgb2lab[0,1] sh[0,1] 0 f[-2,-1] 50 rm[-2,-1] lab2srgb[0,1]" +fi +match_colors=$match_colors" b[0,1] xy,$13 foreach[0,1] { s c n 0,255 a c } *[-2,-1] {$14*255} a[0,-2] c a[1,-1] c" +patch_penalization=$23 +if $1<2 +if $!<2 error "At least two layers are required in this mode." fi +ind_first={$1==0?1:0} ind_style={$1==0?0:-1} N={$!-1} sh[$ind_style] +else +ind_first=0 N=$! ind_style= _fx_stylize {$1-2} +fi +is_window=0 +repeat $N { l[{$ind_first+$>},-1] { +nm={0,n} +if $2 +rr2d[1] {0,[w,h]*arg($2,0.1,0.2,0.3,0.5,0.75,1,1.5,2,2.5,3)},1,2 fi +if $3==1 . +mirror. x +mirror[-2,-1] y a[-4--1] z +elif $3==2 +l. { r {u={max(w,h)};[u,u]},1,100%,0,3,0.5,0.5 repeat 3 { +rotate[0] {90*$>},1,3,50%,50% } a z } +elif $3==3 +l. { r {u={max(w,h)};[u,u]},1,100%,0,3,0.5,0.5 repeat 7 { +rotate[0] {45*$>},1,3,50%,50% } a z } +fi +if $4 wsiz=${"fitscreen "{0,[w,h]}} w[0] $wsiz is_window={*} fi +stylize[0] .,${5-9},$15,$init_resolution,${17-22},$patch_penalization,${24-26},$match_colors +k[0,1] =>[0] $nm +if $is_window" && "!{*} break fi +} } +rm. +if 0$_output_mode +if narg($ind_style) rm[$ind_style] fi +if $is_window" && "!{*} rm fi +fi +fx_stylize_preview : +if $1<2 +if $!<2 gui_warning_preview "At least two layers are required when specifying a custom style." return fi +ind_first={$1==0?1:0} ind_style={$1==0?0:-1} N={$!-1} sh[$ind_style] +else +ind_first=0 N=$! ind_style= _fx_stylize {$1-2} +fi +repeat $N { l[{$ind_first+$>},-1] { +gui_no_preview[0] , ++rr2d[1] {0,[w,h]*2/3},0,2 frame. 1,1,255 frame. 1,1,0,0,0,255 j[0] .,1%,30 rm. to[0] "Style:",1%,0,24 +} } rm. +if narg($ind_style) rm[$ind_style] fi +_fx_stylize : +if isnum($1) +name=${"arg0 $1","landscapenearantwerp,leviaducalestaque,littlebayatlaciotat,themandola","blackcolourpencil,colourpencilsepia,darkcolouredpencil,pencil,sketchingpastel,willowcharcoal","windowsopensimultaneously,portraitdemetzinger,greatwave,squareswithconcentriccircles,yellowredblue","deathandfire,inthestyleofkairouan,orientalpleasuregardenanagoria,polyphony2,redwaistcoat,thekiss","compositionredyellowblue,redtree,graytree,sangiorgiomaggioreatdusk,waterlilypond,wheatstacksendofsummer","scream,udnie,lesdemoisellesdavignon,seatedwoman,reservoirhortadeebro,convergence,summertime9a","almondblossom,irises,starrynight,wheatfieldwithcrows"} +else name="$1" +fi +input_cached img/style_$name.png +fx_vector_painting : +foreach { +split_opacity l[0] { ++luminance b. {10-$1}%,1,1 +f. "dmax = -1; nmax = 0; +for (n = 0, ++n<=8, +p = arg(n,-1,0,1,-1,1,-1,0,1); +q = arg(n,-1,-1,-1,0,0,1,1,1); +d = (j(p,q,0,0,0,1) - i)^2; +d>dmax?(dmax = d; nmax = n):nmax; +)" +blend shapeaverage +} +a c +} +fx_vector_painting_preview : +gui_split_preview "fx_vector_painting $*",${-3--1} +fx_draw_whirl : +foreach { split_opacity draw_whirl[0] $* a c } +fx_draw_whirl_preview : +gui_split_preview "fx_draw_whirl $*",${-3--1} +fx_stencilbw : +stencilbw $1,$2 +if $3||$4 foreach { +split_opacity /[0] 255 i[0] 100%,100%,1,1,$4 i[0] 100%,100%,1,1,$3 a[0-2] c hsv2rgb[0] a c +} fi +fx_stencilbw_preview : +gui_split_preview "fx_stencilbw $*",${-3--1} +fx_blackandwhite : +repeat $! { l. { +split_opacity rv to_rgb. s. c +*... $1 b... $2% +*.. $3 b.. $4% +*. $5 b. $6% ++[-3--1] /. {$1+$3+$5} c. 0,255 +adjust_colors ${7-11},0,255 +if $12||$13||$14 +100%,100% [-1]x2 +noise... 100,$17 b... $16% n... -$12,$12 +noise.. 100,$17 b.. $16% n.. -$13,$13 +noise. 100,$17 b. $16% n. -$14,$14 ++tones[-4] 3 b[-3--1] $15% +*[-6,-3] *[-4,-2] *[-2,-1] ++[-4--1] c. 0,255 +fi +rv a c } mv. 0 } +if $18 normalize_local $18,$19,$20,2%,1,0,255 fi +if $22 n 0,255 fi +if $21 to_pseudogray $21,1 fi +fx_blackandwhite_preview : +gui_split_preview "fx_blackandwhite $*",${-3--1} +fx_charcoal : +foreach { +split_opacity l[0] { +compose_channels max +w={w} h={h} +if $5 r. 150%,150%,1,1,6 fi +if $4 equalize. n. 0,255 fi +sharpen {$1*3} cut 0,255 +if $6 +ir $7,$8 fi +ir[0] $2,$3 +if !$15 ==[0] 0 fi +-| ++*[0] $10 +*[0] $11 *[0] $9 +a[-3--1] c replace_color 0,0,0,0,0,$12,$13,$14 +r $w,$h,1,100%,2 +} +a c +} +fx_charcoal_preview : +gui_split_preview "fx_charcoal $*",${-3--1} +fx_colorize_interactive : skip "${4=},${5=},${6=}" +N=$! nm={n} +resolution={arg(1+$3,512,1024,2048,0)} +=> "[G"{`39`}"MIC] Colorize" +if [$9][0]==-1" || "[$8]!=[w,h] _gui_control_points= else _gui_control_points=$9 fi +N=$! +arg_palette1=0 l[] { +0 => "$4" ext={x} rm +if same(['$ext'],'gpl',-1,0) input_gpl "$4" arg_palette1=1 fi +onfail rm +} +if $arg_palette1 arg_palette1=[{$!-1}] fi +arg_palette2=0 l[] { +0 => "$5" ext={x} rm +if same(['$ext'],'gpl',-1,0) input_gpl "$5" arg_palette2=1 fi +onfail rm +} +if $arg_palette2 arg_palette2=[{$!-1}] fi +arg_grabber=0 l[] { +0 => "$6" ext={x} rm +i "$6" to_rgb arg_grabber=1 +onfail rm +} +if $arg_grabber arg_grabber=[{$!-1}] fi +repeat $N { +status=${x_colorize[$>]\ $1,$resolution,$2,$arg_palette1,$arg_palette2,$arg_grabber} +} +k[0-{$N-1}] +if $2==1 foreach { channels {s-3},{s-1} } +elif $2>=2 +foreach { +channels {s-3},{s-1} channels.. 0,{0,s-4} } +if $2>=3 split_colors[1] 0,256,8 fi +fi +=>[^] $nm +if !narg($status) status=-1 fi +u \{$1\}\{$2\}\{$3\}\{"$4"\}\{"$5"\}\{"$6"\}\{0\}\{{w},{h}\}\{$status\} +fx_colorize_interactive_preview : skip "${4=},${5=},${6=}" +if $7 +gui_print_preview "No preview\n available",,"(Control points cleared)" +u \{$1\}\{$2\}\{$3\}\{"$4"\}\{"$5"\}\{"$6"\}\{0\}\{{w},{h}\}\{-1\} +else gui_no_preview , +fi +fx_recolorize : +repeat int($!/2) { +if $3 s=$>,{$>+1} else s={2*$>},{2*$>+1} fi +l[$s] rv[0,1] { +channels[0] 0 to_rgb.. +to_rgba. split_opacity. !=. 0 +srgb2rgb[-3,-2] rgb2lab8[-3,-2] channels... 0 channels.. 1,2 ++.. 1 *.. . +gradient_norm... *. -1 watershed... . rm. -.. 1 ++diffusiontensors... $2,1,0.5,0.5 ==.. 0 *. .. rm.. +smooth.. .,{$1*80},0.8,60 rm. +a[-2,-1] c lab82rgb. rgb2srgb. +if $3 rgb2hsv. s. c i[2] 100%,100%,1,1,1 i[3] 100%,100%,1,2,0 a[0-2] c a[^0] c hsv2rgb rv fi +} +} +fx_recolorize_preview : +fx_recolorize $* a x +fx_bwrecolorize : +remove_opacity +if $4 n 0,255 fi +if $5==0 +(${9--2}) r. 4,$8,1,1,-1 permute. yzcx +elif $5==1 +(0,255^0,255^0,255^255,255) +elif $5==2 +(255,0^255,0^255,0^255,255) +elif $5==3 +(0,44,115,143,196,244^0,20,84,119,184,235^0,5,44,73,144,200^255,255,255,255,255,255) +else +(0,359^1,1^1,1^255,255) r. 256,1,1,4,3 sh. 0,2 hsv2rgb. rm. +fi +if $6==0 r. 256,1,1,4,1 +elif $6==1 r. 256,1,1,4,3 +elif $6==2 r. 256,1,1,4,5 c. 0,255 +else r. 256,1,1,4,6 +fi +if $7==1 sh. 0,2 rgb2hsv. sh. 2 f. x/w hsv2rgb.. rm[-2,-1] fi +l[^-1] { luminance adjust_colors ${1-3} } map[^-1] . rm. +fx_bwrecolorize_preview : +gui_split_preview "fx_bwrecolorize ${^0}",${-3--1} +fx_autofill_lineart : +foreach { +nm=${-gui_layer_name} +is_alpha={s==2||s==4} +if $is_alpha sh 100% is_alpha={im<128&&iM>128} rm. fi +if $is_alpha +channels 100% negate. +else +norm fi +n. 0,255 +l. { +repeat 1+$4 { +fact={2^-$<} +nw={0,max(1,round(w*$fact))} +nh={0,max(1,round(h*$fact))} ++r[0] $nw,$nh,1,1,2 if $2 normalize_local. , fi +>=. {min(99.5,$1)}% +if $colors +scale2x[colors] r[colors] .,1 *[colors,-1] rv[-2,-1] +fi +label_fg. 0,1 b.. 0.8 watershed. .. rm.. => colors +} ++area. 0,1 label_maxarea={"P=[xM,yM];i(#-2,P)-1"} +if $3>1 +>. {$3*sqrt($3)} *[-2,-1] +b.. 0.8 watershed. .. +else +rm. +fi +rm.. +N={iM} +if $N +-. 1 +srand 0 {iM+1},1,1,3,">[j(-1) + u(135,225),u(0,0.7),u(0.4,0.9)]" +hsv2rgb. round. point. $label_maxarea,0,0,1,255 +map.. . rm. +fi +} +if !$is_alpha gui_set_layer_mode.. multiply fi +gui_set_layer_name. $nm" [colors]" +} +fx_autofill_lineart_preview : +foreach { +fx_autofill_lineart ${1-4} +if $5 k. else rv blend multiply fi +} +fx_colorize_lineart : +if $!<2 return fi +if $1<2 selection=0,1 else selection=0,1,2 fi +l[$selection] { +if $1==0 +elif $1==1 rv +elif $1==2 rm[1] +elif $1==3 rm[2] rv +fi ++to_rgba[0] split_opacity. +.. 1 !=. 0 *[-2,-1] ++norm[1] n. 0,1 +histogram. 2,0,1 +if i(0)>i(1) *.. -1 +.. 1 fi rm. +b. $4% watershed.. . rm. +-. 1 +if $2==0 rm[0] rv blend[0,1] multiply ind=-1 +elif $2==1 rm[0] rv ind=0 +elif $2==2 rm[0] ind=1 +elif $2==3 rv[1,2] ind=1 +elif $2==4 rv[0,1] ind=2 +fi +if $3" && "$ind>=0 l[$ind] { ++mix_channels (65536,256,1) +if $3==10 do +iM={1,iM} +if $iM>=0 ++==[1] $iM area={is} replace[1] $iM,-1 ++r. 100%,100%,1,3 *. [0] +rv[-2,-1] *. 255 a[-2,-1] c => $area +fi +while $iM>=0 else +label. +if $3<10 %. {$3+1} fi +repeat iM+1 { +==[1] $< area={is} +r. 100%,100%,1,[0] *. [0] rv[-2,-1] *. 255 a[-2,-1] c => $area } +fi +rm[0,1] +sort_list +,n +} fi +} +fx_colorize_lineart_preview : +fx_colorize_lineart $1,0,$3,$4 +fx_colorize_lineart_smart : +_fx_colorize_lineart_smart $*,-1 round +fx_colorize_lineart_smart_preview : +if $1==1" && "$!<2 gui_warning_preview "A top layer with color spots is missing, for this colorization mode." return +elif $1==2" && "$!<2 gui_warning_preview "A bottom color layer is missing, for this colorization mode." return +fi +_fx_colorize_lineart_smart ${1-3},0,${5--1} +_fx_colorize_lineart_smart : +if $1==1" && "$!<2 error "A top layer with color strokes is missing, for this colorization mode." +elif $1==2" && "$!<2 error "A bottom color layer is missing, for this colorization mode." +fi +min_color_area={$15^2} +repeat $1?1:$! { inds=${arg0\ !!$1,$<,0--1} l[$inds] { +ind_lineart={$1==1?1:0} +nm=${gui_layer_name[$ind_lineart]} =>[$ind_lineart] lineart +if $!>1 ind_colors={$1==1?0:1} nmc={$ind_colors,n} =>[$ind_colors] colors fi +if $!>=3 rm[2--1] fi +[lineart] +is_alpha={s==2||s==4} +if $is_alpha sh. 100% is_alpha={iM-im>64} rm. fi +if $is_alpha channels. 100% +else luminance. negate. fi +>. {255*(1-$2%)} +=> strokes +_keep_keycoords={$-1==0} +[strokes] close_binary. ${9-14},$min_color_area,$16 => new_strokes +if $-1==0 ++negate[strokes] *. 255 to_rgb. ++-[new_strokes] [strokes] dilate. 2 +100%,100%,1,3,[0,128,255] j... .,0,0,0,0,1,.. rm[-2,-1] +if narg($keycoords) f[keycoords] "ellipse(#-1,(I)[0,2],3,3,0,1,[255,0,0]);I" rm[keycoords] fi +=> geometry +fi +if $1==1 +to_rgba[$colors] [colors],[colors] +f[colors] "i(#-1) = A<255?0:norm(R,G+0.3,B+0.6);I" +label_fg. 0 {1+iM},1,1,{colors,s+1} +f.. ">I[#-1,i]+=[ I(#"$colors"),1 ];I" +s. c,{-s+1} /[-2,-1] ++l[new_strokes] { * -1 + 1 +b 1% b.. 1 min } +watershed... .,0 rm. map.. . rm. +if !$8 rm[strokes] +else +j[strokes] [new_strokes] distance[strokes] 0 *[strokes] -1 +eq[new_strokes] 0 label_fg[new_strokes] 0,0 +if $min_color_area +area_fg[new_strokes] 0,0 >. $min_color_area *[new_strokes,-1] fi +watershed[new_strokes] [strokes],0 rm[strokes] +srgb2rgb. guided. [new_strokes],{1+$8/5},0 rgb2srgb. +fi +rm[new_strokes] +=> new_colors +elif $1==2 +j[strokes] [new_strokes] distance[strokes] 0 *[strokes] -1 +eq[new_strokes] 0 label_fg[new_strokes] 0,0 +if $min_color_area +area_fg[new_strokes] 0,0 xy_bg={[xM,yM]} >. $min_color_area *[new_strokes,-1] fi +watershed[new_strokes] [strokes],0 rm[strokes] +to_color[colors] sh[colors] 0,2 rgb2hsv8. rm. blend[colors,new_strokes] shapemedian sh[colors] 0,2 hsv82rgb. rm. +=>[colors] new_colors +else +j[strokes] [new_strokes] distance[strokes] 0 *[strokes] -1 +eq[new_strokes] 0 label_fg[new_strokes] 0,0 +if $min_color_area +area_fg[new_strokes] 0,0 xy_bg={[xM,yM]} >. $min_color_area *[new_strokes,-1] fi +watershed[new_strokes] [strokes],0 rm[strokes] +label[new_strokes] 0,0 ++histogram[new_strokes] {new_strokes,[iM+1,0,iM]} equalize. 1024 n. 0,240 +ind_bg={xM} +channels. 0,2 srand 0 +f. "[i,u(1,max(3,$6))/255,u(min(252,$7),255)/255]" +. sh. 0 rand. 0,360 rm. +hsi2rgb[-2,-1] *.. $5 *. {1-$5} +[-2,-1] round. +point. $ind_bg,0,0,1,255 point. 0,0,0,1,255 +map[new_strokes] . rm. +=>[new_strokes] new_colors +fi +ind_lineart=$lineart +ind_colors=$new_colors +if $4 +100%,100%,1,1,"const boundary = 1; +J(#"$new_colors",1)!=I(#"$new_colors") || J(#"$new_colors",0,1)!=I(#"$new_colors")" +*. 255 channels. -3,0 sh. 0,2 fc. 255,0,0 rm. +gui_set_layer_name. $nm" [region delimiters]" +mv. {$lineart+1} +fi +if !narg($nmc) gui_set_layer_name[$ind_colors] $nm" [colors]" fi +gui_set_layer_name[$ind_lineart] $nm +if $-1==-1 +if !$is_alpha gui_set_layer_mode[$ind_lineart] multiply fi +if $3 l[{$1==1?1:0}] { +if $is_alpha +100%,100%,1,3,255 blend. [0],alpha,1 rgb2hsv. channels. 2 *. 255 negate. +channels.. 0,{0,s-2} s={0,s} luminance[0] to_colormode[0] $s a c +else +s={s} to_rgb rgb2hsv channels 2 * 255 to_colormode $s +fi +} fi +elif $-1==0 +if $is_alpha channels[$ind_lineart] 100% negate[$ind_lineart] fi to_rgb[$ind_lineart] +n[$ind_lineart] 180,255 +blend[$ind_lineart,$ind_colors] multiply ++select_color[geometry] 0,255,255,255 ==. 0 j[$ind_lineart] [geometry],0,0,0,0,1,. k[$ind_lineart] +elif $-1==1 +k[$ind_colors] +else +if $is_alpha channels[$ind_lineart] 100% negate[$ind_lineart] fi to_rgb[$ind_lineart] +if $3 l[$ind_lineart] { s={s} to_rgb rgb2hsv channels 2 * 255 to_colormode $s } fi +blend[$ind_lineart,$ind_colors] multiply k[$ind_lineart] +fi +} } +fx_gcd_norm_eq : skip ${1=0.5},${2=0.5},${3=2} +repeat $! l[$>] +split_opacity +l[0] +to_rgb srgb2rgb gcd_gamma $3 +sh 0 sh.. 2 *.. $1 *. $2 k[0] +norm / {sqrt(1+$1^2+$2^2)} +gcd_gamma {1/$3} rgb2srgb +done a c +done done +fx_gcd_norm_eq_preview : +gui_split_preview "fx_gcd_norm_eq ${1--2}",$-1 +fx_ditheredbw : +foreach { +split_opacity l[0] { +luminance adjust_colors ${1-3} b $6 +ditheredbw +if $4" || "$5 / 255 i[0] 100%,100%,1,2 fc[0] $4,{$5%} a c hsv2rgb fi +} +a c +} +fx_ditheredbw_preview : +gui_split_preview "fx_ditheredbw $*",${-3--1} +fx_engrave : +f={arg(1+$14,1,1.5,2,3)} +r={$f*(0.2+$1)} +foreach { +nm=${-gui_layer_name} pos=${-gui_layer_pos} +if $8 [0] fi +l[0] { split_opacity l[0] { +wh={w},{h} +norm +if $14 r {100*$f}%,{100*$f}%,1,1,3 fi +if $7>0 [0] fi +l[0] { +amount={(0.5+$2)^2} +repeat 5 { b $r unsharp $r,{1+$2} c 0,255 } +smooth 100,0.1,1,{$f*$3},{$f*$4} +>= {100-$5}% +} +if $7>0 +gradient_norm[1] b[1] $3 <[1] $7 max[0,1] +fi +if $6<0 area_fg 0,0 > {$f*$6*$6} +elif $6>0 == 0 area_fg 0,0 > {$f*$6*$6} == 0 +fi +* 255 +if $14 r $wh,1,1,2 fi +} a c } +if $!>1 +l[1] { split_opacity l[0] { +f={arg(1+$14,1,1.5,2,3)} +if $14 r {100*$f}%,{100*$f}%,1,100%,3 fi +b {$f*$9} segment_watershed 5 +if $14 r $wh,1,100%,2 fi +repeat $10 { guided 10,{$10*80} } +rgb2hsv s c +... $11 +.. {$12%} +. $13% a c hsv2rgb +} a c } +=>[0] "mode(darken),name("$nm"),pos("$pos")" +=>[1] "name("$nm" [colors]),pos("$pos")" +fi +} +fx_engrave_preview : +foreach { gui_split_preview "=> foo fx_engrave $* gui_merge_layers",${-3--1} } +fx_freaky_bw : +foreach { +split_opacity l[0] { +to_rgb ++expand_xy 1,0 channels. 0,4 +f. ">if (c!=4,i, +Rx = i(x+1,y,0,0) - i(x,y,0,0); +Ry = i(x,y+1,0,0) - i(x,y,0,0); +Rn = Rx^2 + Ry^2; +Gx = i(x+1,y,0,1) - i(x,y,0,1); +Gy = i(x,y+1,0,1) - i(x,y,0,1); +Gn = Gx^2 + Gy^2; +Bx = i(x+1,y,0,2) - i(x,y,0,2); +By = i(x,y+1,0,2) - i(x,y,0,2); +Bn = Bx^2 + By^2; +n = 1e-5 + max(Rn,Gn,Bn)^"{$2%}"; +val = 0; +Rn>=Gn && Rn>=Bn?(i(x,y,0,3) = Rx/n; val=Ry/n): +Gn>=Rn && Gn>=Bn?(i(x,y,0,3) = Gx/n; val=Gy/n): +(i(x,y,0,3) = Bx/n; val=By/n); +val +)" +channels. 3,4 +luminance[0] ia={0,ia} +s. c +f.. "i - i(x-1,y,0,0)" +f. "i - i(x,y-1,0,0)" ++[-2,-1] +ilaplacian. 0 +shrink_xy. 1 +. $ia n. 0,255 +j[0] [1],0,0,0,0,{$1%} rm. +adjust_colors ${3-5} +} +a c +} +fx_freaky_bw_preview : +gui_split_preview "fx_freaky_bw $*",${-3--1} +fx_ink_wash : +foreach { +split_opacity l[0] { +fx_pencilbw. $1,$2,0,0,0 +if $3==1 continue +elif $3==0 fx_smooth_anisotropic. 60,$4,$5,$6,1.1,0.8,30,2,0,1,1,0,1,16 +fi +if $7==1 normalize_local. 2,6,5,24,1,0,255 +elif $7==2 normalize_local. 2,6,5,24,1,0,255 fx_contrast_swm 2,0,0.512 +elif $7==3 fx_normalize_local. $8,$9,$10,$11,1,3,0 +fi +} +a c +} +fx_gcd_layeretch : skip ${1=16},${2=7},${3=14},${4=0.12},${5=100},${6=5},${7=4.65},${8=0},${9=0},${10=3},${11=1},${12=1},${13=0} +repeat $! l[$>] +w={w} h={h} sc=800 ml=$1 wl={min($2,$ml-1)} +nwl={$ml-$wl} nwl={$nwl+($nwl%2==0)} +if !$13 nw=$w nh=$h +elif w>h nw={min($sc,w)} nh={$nw/w*h} +else nh={min($sc,h)} nw={$nh/h*w} fi +to_rgb[0] [0] r[1] $nw,$nh +norm[1] n[1] 0,255 +tones[1] $ml +repeat $ml-1 +[{-$<-1}] [{-$<-2}] done +b[-$ml--1] $4% +repeat $ml +pc={($>+1)/$ml} msk={2+$>} {w},{h},1,1,0 +if $12 ang={$>/$nwl} else ang=$pc fi +if $<>=$wl +noise. {(1-$pc)*$5},2 ==. 1 +blur_linear. {$6+$pc*($7-$6)}%,0,{$ang*360+u(-$9,$9)+$8} +quantize. $3,0 deform. {u*$10+1} +fi +r. $nw,$nh n. 0,255 +*[$msk,-1] progress {$pc*100} +done ++[-$ml--1] c. 0,255 +n. 0,255 negate. apply_gamma. $11 +if $13 r. $w,$h,1,3,5 c. 0,255 fi +k. +done done +fx_pencilbw : +pencilbw $1,$2 +if $3" || "$4 foreach { +split_opacity /[0] 255 i[0] 100%,100%,1,1,$4 i[0] 100%,100%,1,1,$3 a[0-2] c hsv2rgb[0] a c +} fi +fx_pencilbw_preview : +gui_split_preview "fx_pencilbw $*",${-3--1} +fx_pencil_portraitbw : +foreach { +split_opacity l[0] { ++b 2% ++blend divide rm.. luminance. +fx_ink_wash.. 0,167,0,0.5,0.54,2.25,0,2,6,5,20 ++fx_hardsketchbw. 80,32,1.89,0.21,31.46,0,0 ++fx_sketchbw.. 1,$2,180,$1,$3,0.03,0,0.6,0.1,0.6,0.25,1,0,1,0 +blend[0,1] darken +blend[0,1] multiply,0.5 +blend[0,1] lighten,$4 +normalize_local , +to_rgb +fc ${5-7} blend softlight +} +a c +} +fx_pencil_portraitbw_preview : +gui_split_preview "fx_pencil_portraitbw $*",${-3--1} +fx_stamp : +foreach { +split_opacity l[0] { +wh={w},{h} +norm +if $7 r 150%,150%,1,1,3 fi +noise $5 +if $1 otsu 256 else >= $2% fi +b {if($7,1.5,1)*$3},0 sharpen $4 n 0,255 +apply_curve 1,0,0,101,33,170,229,255,255 +if $7 r $wh,1,1,2 fi +if $6 negate fi +} +a c +} +fx_stamp_preview : +gui_split_preview "fx_stamp $*",${-3--1} +fx_gcd_etch : +skip ${1=125},${2=153},${3=171},${4=185},${5=0.1} skip ${6=50},${7=80},${8=50},${9=10} +skip ${10=15},${11=12},${12=20},${13=0} skip ${14=1},${15=0.3},${16=1},${17=0} +repeat $! l[$>] +w={w} h={h} sc=800 ml=4 +if w>h nw={min($sc,w)} nh={$nw/w*h} else nh={min($sc,h)} nw={$nh/h*w} fi +to_rgb[0] [0] if $16 r[1] $nw,$nh fi +b[1] $5% norm[1] negate[1] n[1] 0,255 ++c[1] 0,{255-$4} +c[1] {255-$3},128 +c[1] {255-$2},192 +c[1] {255-$1},255 n[-3--1] 0,255 +{w},{h},1,1,0 noise. $6,2 ==. 1 deriche. $10,0,x,0 +{w},{h},1,1,0 noise. $7,2 ==. 1 {w},{h},1,3,0 fc. 0,-1,0 smooth.. .,30,30,0 rm. +if $13 mirror. x fi +{w},{h},1,1,0 noise. $8,2 ==. 1 deriche. $11,0,y,0 +{w},{h},1,1,0 noise. $9,2 ==. 1 deriche. $12,0,y,0 +quantize[-$ml--1] 2,0 deform[-$ml--1] $14 +repeat $ml *[{2+$>},-1] done ++[-$ml--1] n. 0,255 rm[1] +negate. apply_gamma. $15 +if $16 r. $w,$h,1,3,5 c. 0,255 fi +if $17 blend[0,1] shapeaverage else k. fi +done done +fx_gcd_etch_preview : +gui_split_preview "fx_gcd_etch ${1--2}",$-1 +fx_color_abstraction : +foreach { +split_opacity l[0] { to_rgb b $1 s c quantize $2,1,0 area 0 ^ $3 n 0,255 } +a c +} +fx_color_abstraction_preview : +gui_split_preview "fx_color_abstraction $*",${-3--1} +fx_apply_haldclut : skip "${2=}" +mode=$1 +filename="$2" +strength,brightness,contrast,gamma,hue,saturation,normalize=${3-9} +if $mode<2 +if $!<2 gui_warning_preview "Input layer with HaldCLUT is missing" return fi +ind_clut={$mode?$!-1:0} +else +l { +0 => "$2" ext={x} rm. +if lowercase(['$ext'])=='cube' input_cube "$2" +else i "$2" +fi +ind_clut={$!-1} +onfail gui_warning_preview "Specified HaldCLUT filename not found" return +} +fi +if {$ind_clut,iM>512} /[$ind_clut] 255 fi +if $normalize==1" || "$normalize==3 +foreach { if $>!=$ind_clut split_opacity balance_gamma[0] , a c fi } +fi +repeat $! { if $>!=$ind_clut +map_clut[$>] [$ind_clut] j[$>] .,0,0,0,0,{$strength%} rm. fi } rm[$ind_clut] +adjust_colors $brightness,$contrast,$gamma,$hue,$saturation,0,255 +if $normalize==2" || "$normalize==3 +foreach { split_opacity n[0] 0,255 a c } +fi +fx_apply_haldclut_preview : skip "${2=}" +if $1<2 gui_warning_preview "No preview available in this mode" return fi +gui_split_preview "fx_apply_haldclut $1,\"$2\",${3--2}",${-3--1} +apply_from_clut_set : skip "${1=}" +m "_title : ('\"$""*\"') replace_str. \"_\",\" \" replace_str. \"iii\",\"III\" f. \"(!y || j(0,-1)==32) && +i>=_'a' && i<=_'z'?uppercase(i):i\" u {t} rm." +is_file_error=0 +l[] { +"$1" nb_cluts,ind:=l,($2-1)%l k[$ind] +onfail rm is_file_error=1 +} +if $is_file_error +gui_error_preview "Unable to load specified CLUT set" +else +_title {n} clut_name=${} +decompress_clut. {0$_is_preview?17:33} store. _clut +if 0$_is_preview +foreach { gui_split_preview "_apply_from_clut_set \"$1\",${2--1}",${-3--1} } +to "#"{$ind+1}"/"$nb_cluts":\n"$clut_name,0.01~,1~,5% +else +foreach { _apply_from_clut_set $"*" } +fi +fi +apply_from_clut_set_preview : skip "${1=}" +_is_preview=1 +k[0] apply_from_clut_set $"*" +_apply_from_clut_set : skip "${1=}" +if isin($9,1,3) split_opacity n[0] 0,255 a c fi +$_clut +map_clut.. . rm.. j.. .,0,0,0,0,{$3%} rm. +adjust_colors ${4-8},0,255 +if isin($9,2,3) split_opacity n[0] 0,255 a c fi +fx_adjust_colors : +adjust_colors ${1-5},0,255 +fx_adjust_colors_preview : +gui_split_preview "fx_adjust_colors $*",${-3--1} +fx_boost_chroma : +foreach { +split_opacity l[0] { ++to_rgb +if $2>=2 +srgb2rgb rgb2lab. +if $2==2 sh. 1 sh.. 2 equalize[-2,-1] rm[-2,-1] +else sh. 1,2 equalize. rm. +fi +lab2rgb. rgb2srgb +else +rgb2ycbcr. +if $2==0 sh. 1 sh.. 2 equalize[-2,-1] rm[-2,-1] +else sh. 1,2 equalize. rm. +fi +ycbcr2rgb. +fi +j.. .,0,0,0,0,{$1%} rm. +} +a c +} +fx_boost_chroma_preview : +gui_split_preview "fx_boost_chroma $*",${-3--1} +fx_boost_fade : +foreach { +100%,100%,1,3 rand. 0,1 b. {10-10*($1/10)^0.5} n. 0,255 +to_colormode 0 a z +ac "s z match_histogram.. . rm.",${"arg0 $2,ycbcr_cbcr,lab_ab"} +} +fx_boost_fade_preview : +gui_split_preview "fx_boost_fade $1,$2",${-3--1} +#@cli afre_brightness : -300<=amount<=300,0<=smooth<=50 +#@cli : Enhance luminance brightness. +#@cli : Default values: 'amount=50' and 'smooth=0'. +afre_brightness : check "${1=50}>=-300 && ${2=0}>=0 +&& $1<=300 && $2<=50" +if !$1 return fi e[] "[afre]^_^) brightness: Enhance luminance brightness of image$? using amount=$1 and smooth=$2." +repeat $! l[$>] r={[im,iM]} . if $2>0 +afre_gui0_fast. 1,1e10 ++>.. {100-$2}% blend_fade[1,2] . k[0,1] fi +^.. {$1>0?0.5^($1/300):1} n.. $r afre_orien.. 1 ++n. 0,1 f. "begin(const P=2^($1/100)); 1-(1-i)^P" n. $r ++n.. 0,1 f. "begin(const A=0.5; const P=0.05); if(i<=A, +A-A*(i/A)^P,-A+A*((1-i)/A)^P)" n. 0,1 blend_fade[1,2] . k[0,1] +afre_y50. 1 * c $r done done +afre_brightness_preview : +afre_brightness $* +_fx_channel_processing : +adjust_colors ${1-3} b. $4% +if $5==1 c. $6%,$7% +elif $5==2 c. $6%,$7% n. 0,255 +elif $5==3 n. $6%,$7% +elif $5==4 ir. $6%,$7% *. 255 +fi +if $8!=256 quantize. $8,1,0 fi +if $9 equalize. fi +if $10 negate. fi +fx_channel_processing : +repeat $! { +l. { +split_opacity rv to_rgb. +fx_start_mix $11,$12 +ac. "_fx_channel_processing $1,$2,$3,$4,$5,$6,$7,$8,$9,$10",$13,1 +fx_end_mix $11 +if $!!=3 rv a c fi +} +mv. 0 +} +fx_channel_processing_preview : +gui_split_preview "fx_channel_processing $*",${-3--1} +fx_channels2layers : +foreach { +nm=${-gui_layer_name} to_rgb +if $1==0 +s[0] c +r[0] 100%,100%,1,3,0,0,0,0,0,0 =>[0] "name("$nm" [red]),mode(add)" +r[1] 100%,100%,1,3,0,0,0,0,0,0.5 =>[1] "name("$nm" [green]),mode(add)" +r[2] 100%,100%,1,3,0,0,0,0,0,1 =>[2] "name("$nm" [blue]),mode(add)" +elif $1==1 +rgb2cmy[0] -[0] 255 s[0] c +r[0] 100%,100%,1,3,0,0,0,0,0,0 =>[0] "name("$nm" [cyan]),mode(difference)" +r[1] 100%,100%,1,3,0,0,0,0,0,0.5 =>[1] "name("$nm" [magenta]),mode(difference)" +r[2] 100%,100%,1,3,0,0,0,0,0,1 =>[2] "name("$nm" [yellow]),mode(difference)" ++[0-2] 255 +i[0] 100%,100%,1,3,255 =>[0] "name("$nm" [base]),mode(difference)" +else +rgb2hsv[0] s[0] c,-2 +r[0] 100%,100%,1,3,0,0 sh[0] 2 f. 1 rm. =>[0] "name("$nm" [color]),mode(normal)" +r[1] 100%,100%,1,3,0,0,0,0,0,1 =>[1] "name("$nm" [value]),mode(value)" +hsv2rgb[0,1] rv[0,1] +fi +} +fx_channels2layers_preview : +foreach { +fx_channels2layers $* +foreach { to "#"{1+$>},1,1,43,7,1,255 } +frame 1,1,0 frame 3,3,255 append_tiles , +} +fx_clut_from_ab : skip "${3=},${4=}" +if $!<2 error "At least two input layers are needed to run this filter." fi +repeat $!-1 { l[$<,-1] { +nm=${gui_layer_name..} +i[0] {a=0$_is_preview?32:64;[a,a,a]},4 f[1] ">I(#0,round(I(#2)*(w#0-1)/255))+=[R,G,B,1]; I" +l[0] { +s c,-3 +max. 1 /[-3,-1] ==. 0 inpaint_pde.. .,75%,1 distance. 0 *. {-1/(1+$5)} exp. +f.. "f = i(#-1); f*I + (1-f)*[x,y,z]*255/(w-1)" rm. +S={arg(1+$2,16,25,36,49,64,81,100,121,144,169,225,256)} if $S!=w r. $S,$S,$S,3,3 fi +c 0,255 +} +if $1==2 +is_png={str=lowercase(['"$4"']);find(str,'.png')==size(str)-4} +is_cube={str=lowercase(['"$4"']);find(str,'.cube')==size(str)-5} +if !$is_png" && "!$is_cube $!is_ciube error "Filename extension must be '.cube' or '.png'." fi +if $is_png r[0] {0,r=round(whd^0.5);[r,r]},1,3,-1 o[0] "$3/$4" +else +if {0,w>32} r3dx[0] 32 fi +output_cube[0] "$3/$4" +fi +rm[0] +else +r[0] {0,r=round(whd^0.5);[r,r]},1,3,-1 +if !$1 rm[1] fi +=>[0] "name(CLUT to '"$nm"')" +fi +if 0$_output_mode k[0] fi +} } +fx_clut_from_ab_preview : skip "${3=},${4=}" +if $!<2 gui_warning_preview "At least two input layers are needed to run this filter." return fi +_is_preview,_output_mode=1 fx_clut_from_ab 0,4,0,0,$5 +foreach { +r {a=round(cbrt(wh));[a,a,a]},3,-1 ++r3dx. 24 _fx_clut_from_ab_preview. +S={arg(1+$2,16,25,36,49,64,81,100,121,144,169,225,256)} if $S!=w#0 r[0] $S,$S,$S,3,3 fi +r[0] {0,r=round(whd^0.5);[r,r]},1,3,-1 +rr2d[0] $_preview_area_width,$_preview_area_height,2,1 r2dx. 70% +sh. 100% b. 1% n. 0,255 rm. +blend alpha +} +file_attr={$1==2?2:1} +u "{$1}{$2}{$3}_"$file_attr"{$4}_"$file_attr"{$5}" +_fx_clut_from_ab_preview : +foreach { +fact={256/w} +pointcloud3d +3d 0.5,0.5,0.5 *3d $fact circles3d {1.25*$fact} o3d {0.004*$fact} +colorcube3d[] +l. { s3d l.. { s y,6 repeat $! { sh[$>] 4,100%,0,0 /. 1.25 rm. } } a y } +p3d. 1 +l. { repeat 8 { o={a=$>;0.5*[a&1,(a>>1)&1,(a>>2)&1]} ++3d[0] $o +-3d[0] $o } +3d } +axes3d 64,64,64,24,R,G,B,0 ++3d +pose3d 1.2451,0.120715,-0.893986,-58.3864,-0.572953,1.28275,-0.62477,-11.6557,0.696784,0.839071,1.08374,-333.008,0,0,217,1 +snapshot3d {max(512,0$_preview_area_width,0$_preview_area_height)},1.22,255,255,255 +autocrop frame 10,10,255 +to_rgba flood 0,0,0,20,1,1,255,255,255,0 +} +iain_cmyk_tone_p: +apply_parallel_overlap "iain_cmyk_tone ${1--2}",0,${-1} +iain_cmyk_tone: +repeat $! l[$>] split_opacity l[0] +rgb2cmyk ++split c ++apply_curve[1] 0,0,$1,128,$2,255,$3 ++apply_curve[2] 0,0,$4,128,$5,255,$6 ++apply_curve[3] 0,0,$7,128,$8,255,$9 ++apply_curve[4] 0,0,$10,128,$11,255,$12 +add[-1,-2,-3,-4] ++apply_curve[1] 0,0,$13,128,$14,255,$15 ++apply_curve[2] 0,0,$16,128,$17,255,$18 ++apply_curve[3] 0,0,$19,128,$20,255,$21 ++apply_curve[4] 0,0,$22,128,$23,255,$24 +add[-1,-2,-3,-4] ++apply_curve[1] 0,0,$25,128,$26,255,$27 ++apply_curve[2] 0,0,$28,128,$29,255,$30 ++apply_curve[3] 0,0,$31,128,$32,255,$33 ++apply_curve[4] 0,0,$34,128,$35,255,$36 +add[-1,-2,-3,-4] ++apply_curve[1] 0,0,$37,128,$38,255,$39 ++apply_curve[2] 0,0,$40,128,$41,255,$42 ++apply_curve[3] 0,0,$43,128,$44,255,$45 ++apply_curve[4] 0,0,$46,128,$47,255,$48 +add[-1,-2,-3,-4] +add[1,5] +add[2,5] +add[3,5] +add[4,5] +a[-1,-2,-3,-4] c ++sub[0,1] ++cmyk2rgb[0] rgb2hsv[-1] split[-1] c remove[-1,-3] mul[-1] 255 +apply_curve[-1] 0,0,$49,64,$50,128,$51,192,$52,255,$53 +compose_multiply[-1,-2] ++sub[0,-1] +if $54==0 +cmyk2rgb +luminance[0] ++luminance[-1] +compose_grainextract[-1,-2] +compose_grainmerge[0,-1] +keep[0] +fi +if $54==1 +keep[-1] +c 0,255 +cmyk2rgb +fi +if $54==2 +keep[-1] +cmyk2rgb +c 0,255 +fi +if $54==3 +keep[-1] +n 0,255 +cmyk2rgb +fi +if $54==4 +keep[-1] +cmyk2rgb +n 0,255 +fi +done a c done done +fx_balance_gamma : +foreach { +split_opacity +if $!>1 +!=. 0 *[0,-1] fi +l[0] { balance_gamma ${1-3} if $4 n 0,255 fi } +a c +} +fx_balance_gamma_preview : +gui_split_preview "fx_balance_gamma $*",${-3--1} +fx_colorblind_preview : +gui_split_preview "colorblind $*",${-3--1} +jl_colorgrading : +if $1>0.01 +map_tones_fast 5%,$1 +fi +_ystr="" +if $2>0 +_mymin={$2} +_mymax={255-$2} +apply_channels "-apply_curve 0,0,$_mymin,255,255",ycbcr_cr,0 +apply_channels "-apply_curve 0,0,0,255,$_mymax",ycbcr_cb,0 +fi +if $2<0 +_mymin={-$2} +_mymax={255+$2} +apply_channels "-apply_curve 0,0,$_mymin,255,255",ycbcr_cb,0 +apply_channels "-apply_curve 0,0,0,255,$_mymax",ycbcr_cr,0 +fi +if $3!=1.0 +fx_equalize_s $3,0 +fi +if $4!=1.0 +apply_channels "-apply_gamma $4",hsv_s,0 +fi +if $5!=0 +_p1={64-$5} +_p2={192+$5} +_ystr=$_ystr" apply_curve 1,0,0,64,$_p1,192,$_p2,255,255" +fi +if $6!=0 +_p3={64-$6} +_ystr=$_ystr" apply_curve 1,0,0,64,$_p3,128,128,192,192,255,255" +fi +if $7!=0 +_p4={192+$7} +_ystr=$_ystr" apply_curve 1,0,0,64,64,128,128,192,$_p4,255,255" +fi +if $8>0 +_ystr=$_ystr" apply_curve 1,$8,0,64,64,255,255" +fi +if $9>0 +_p5=0 +_ystr=$_ystr" apply_curve 0,0,$9,255,255" +fi +if $9<0 +_p5={255+$9} +_ystr=$_ystr" apply_curve 0,0,0,255,$_p5" +fi +if $10>0 +_p6=$10 +_p7={255-$10} +_ystr=$_ystr" apply_curve 0,0,0,$_p6,0,$_p7,255,255,255" +fi +if $10<0 +_p6={-$10} +_p7={255+$10} +_ystr=$_ystr" apply_curve 0,0,$_p6,255,$_p7" +fi +if $11!=1.0 +_ystr=$_ystr" apply_gamma $11" +fi +if '$_ystr'!=0 +apply_channels $_ystr,hsv_v,0 +fi +if $12>0 +to_rgb +rgb2hsl s. c rm.. rm.. *. 255 apply_curve. 1,0,0,63,0,127,255,192,0,255,0 +unsharp[0] 5%,$12,0 c. 0,255 c.. 0,255 rv[-1,-2] a[-1,-2] c blend alpha +fi +if $13>0 +unsharp 1%,$13,0 +c. 0,255 +fi +if $14 +if $16+$22>360 +_shh={($16+$22-360)/360} +else +_shh={($16+$22)/360} +fi +_shs={$21/100} +_shlev={$23} +_midh={$19/360} +_mids={$18/100} +_midlev={$20} +_highh={$16/360} +_highs={$15/100} +_highlev={$17} +_satlev={$24} +color_grade $_shh,$_shs,$_shlev,$_midh,$_mids,$_midlev,$_highh,$_highs,$_highlev,$_satlev +fi +if $24!=1.0 +fx_equalize_s $24,0 +fi +if $25>0 +unsharp 0.5,$25 +c 0,255 +fi +if $26>0 +apply_channels "-denoise_haar $26",ycbcr_cb,0 +apply_channels "-denoise_haar $26",ycbcr_cr,0 +fi +color_grade : +_shadownrgb=${-jl_hsv_to_rgb" "$1,1.0,{$2*0.40}} +_midtonesrgb=${-jl_hsv_to_rgb" "$4,1.0,{$5*0.40}} +_highlightsrgb=${-jl_hsv_to_rgb" "$7,1.0,{$8*0.40}} +_crsh=${-arg" 1,"$_shadownrgb} +_mgsh=${-arg" 2,"$_shadownrgb} +_ybsh=${-arg" 3,"$_shadownrgb} +_shlev=$3 +_crmid=${-arg" 1,"$_midtonesrgb} +_mgmid=${-arg" 2,"$_midtonesrgb} +_ybmid=${-arg" 3,"$_midtonesrgb} +_midlev=$6 +_crhigh=${-arg" 1,"$_highlightsrgb} +_mghigh=${-arg" 2,"$_highlightsrgb} +_ybhigh=${-arg" 3,"$_highlightsrgb} +_highlev=$9 +_satlev=$10 +_lowinred=0 +_hiinred=255 +_lowingreen=0 +_hiingreen=255 +_lowinblue=0 +_hiinblue=255 +_gammared=0. +_gammagreen=0. +_gammablue=0. +_lowoutred=0 +_hioutred=255 +_lowoutgreen=0 +_hioutgreen=255 +_lowoutblue=0 +_hioutblue=255 +if $_crmid>0 +_gammared={$_gammared+0.4*$_crmid/100.} +_gammagreen={$_gammagreen-0.3*$_crmid/100.} +_gammablue={$_gammablue-0.3*$_crmid/100.} +fi +if $_crmid<0 +_gammared={$_gammared+0.3*$_crmid/100.} +_gammagreen={$_gammagreen-0.4*$_crmid/100.} +_gammablue={$_gammablue-0.4*$_crmid/100.} +fi +if $_mgmid>0 +_gammared={$_gammared-0.3*$_mgmid/100.} +_gammagreen={$_gammagreen+0.4*$_mgmid/100.} +_gammablue={$_gammablue-0.3*$_mgmid/100.} +fi +if $_mgmid<0 +_gammared={$_gammared-0.4*$_mgmid/100.} +_gammagreen={$_gammagreen+0.3*$_mgmid/100.} +_gammablue={$_gammablue-0.4*$_mgmid/100.} +fi +if $_ybmid>0 +_gammared={$_gammared-0.3*$_ybmid/100.} +_gammagreen={$_gammagreen-0.3*$_ybmid/100.} +_gammablue={$_gammablue+0.4*$_ybmid/100.} +fi +if $_ybmid<0 +_gammared={$_gammared-0.4*$_ybmid/100.} +_gammagreen={$_gammagreen-0.4*$_ybmid/100.} +_gammablue={$_gammablue+0.3*$_ybmid/100.} +fi +_gammared={$_gammared+1.} +_gammagreen={$_gammagreen+1.} +_gammablue={$_gammablue+1.} +if $_midlev>0 +_gammared={$_gammared+0.4*$_midlev/100.} +_gammagreen={$_gammagreen+0.4*$_midlev/100.} +_gammablue={$_gammablue+0.4*$_midlev/100.} +fi +if $_midlev<0 +_gammared={$_gammared+0.3*$_midlev/100.} +_gammagreen={$_gammagreen+0.3*$_midlev/100.} +_gammablue={$_gammablue+0.3*$_midlev/100.} +fi +_crsh={$_crsh*0.3} +_mgsh={$_mgsh*0.3} +_ybsh={$_ybsh*0.3} +if $_crsh>0 +_lowingreen={$_lowingreen+$_crsh} +_lowinblue={$_lowinblue+$_crsh} +_lowoutred={$_lowoutred+$_crsh} +else +_lowinred={$_lowinred-$_crsh} +_lowoutgreen={$_lowoutgreen-$_crsh} +_lowoutblue={$_lowoutblue-$_crsh} +fi +if $_mgsh>0 +_lowinred={$_lowinred+$_mgsh} +_lowinblue={$_lowinblue+$_mgsh} +_lowoutgreen={$_lowoutgreen+$_mgsh} +else +_lowingreen={$_lowingreen-$_mgsh} +_lowoutred={$_lowoutred-$_mgsh} +_lowoutblue={$_lowoutblue-$_mgsh} +fi +if $_ybsh>0 +_lowinred={$_lowinred+$_ybsh} +_lowingreen={$_lowingreen+$_ybsh} +_lowoutblue={$_lowoutblue+$_ybsh} +else +_lowinblue={$_lowinblue-$_ybsh} +_lowoutred={$_lowoutred-$_ybsh} +_lowoutgreen={$_lowoutgreen-$_ybsh} +fi +if $_shlev>0 +_lowoutred={$_lowoutred+$_shlev} +_lowoutgreen={$_lowoutgreen+$_shlev} +_lowoutblue={$_lowoutblue+$_shlev} +fi +if $_shlev<0 +_lowinred={$_lowinred-$_shlev} +_lowingreen={$_lowingreen-$_shlev} +_lowinblue={$_lowinblue-$_shlev} +fi +_crhigh={$_crhigh*0.3} +_mghigh={$_mghigh*0.3} +_ybhigh={$_ybhigh*0.3} +if $_crhigh>0 +_hiinred={$_hiinred-$_crhigh} +_hioutgreen={$_hioutgreen-$_crhigh} +_hioutblue={$_hioutgreen-$_crhigh} +else +_hiingreen={$_hiingreen+$_crhigh} +_hiinblue={$_hiinblue+$_crhigh} +_hioutred={$_hioutred+$_crhigh} +fi +if $_mghigh>0 +_hiingreen={$_hiingreen-$_mghigh} +_hioutred={$_hioutred-$_mghigh} +_hioutblue={$_hioutblue-$_mghigh} +else +_hiinred={$_hiinred+$_mghigh} +_hiinblue={$_hiinblue+$_mghigh} +_hioutgreen={$_hioutgreen+$_mghigh} +fi +if $_ybhigh>0 +_hiinblue={$_hiinblue-$_ybhigh} +_hioutred={$_hioutred-$_ybhigh} +_hioutgreen={$_hioutgreen-$_ybhigh} +else +_hiinred={$_hiinred+$_ybhigh} +_hiingreen={$_hiingreen+$_ybhigh} +_hioutblue={$_hioutblue+$_ybhigh} +fi +if $_highlev>0 +_hiinred={$_hiinred-$_highlev} +_hiingreen={$_hiingreen-$_highlev} +_hiinblue={$_hiinblue-$_highlev} +fi +if $_highlev<0 +_hioutred={$_hioutred+$_highlev} +_hioutgreen={$_hioutgreen+$_highlev} +_hioutblue={$_hioutblue+$_highlev} +fi +levels $_lowinred,$_hiinred,$_gammared,$_lowoutred,$_hioutred,19 +levels $_lowingreen,$_hiingreen,$_gammagreen,$_lowoutgreen,$_hioutgreen,20 +levels $_lowinblue,$_hiinblue,$_gammablue,$_lowoutblue,$_hioutblue,21 +jl_colorgrading_preview : +gui_split_preview "-jl_colorgrading $*",$-1 +fx_mask_color : +cs=rgb,rgb_r,rgb_g,rgb_b,lrgb,lrgb_r,lrgb_g,lrgb_b,ycbcr_y,ycbcr_cbcr,ycbcr_cb,ycbcr_cr,ycbcr_cg,lab,lab_l,lab_ab,lab_a,lab_b,lch,lch_c,lch_h,hsv,hsv_h,hsv_s,hsv_v,hsi,hsi_i,hsl,hsl_l,cmyk_c,cmyk_m,cmyk_y,cmyk_k,yiq_y,yiq_iq +foreach { +to_rgb nm={n} => ${-gui_layer_name} ++x_mask_color ${arg0\ $1,$cs},$2,$3 +if $4==1 channels. 100% fi +=> $nm rv +} +fx_color_presets : +category=${arg0\ $1,abigailgonzalez,alexjordan,berat,cinematic,cinematic_travel,creative,editingcorp,ericellerbrock,filtergrade,hollywood,inavision,jtsemple,kylerholland,lutifyme,michaelezra,moviz,ohadperetz,oliviosarikas,on1,picturefx,pixelmator,pixlsus,purple11,rocketstock,shamoonabbasi,smallhd,toddblankenship,youssefhossam,others} +presets=${-_fx_cluts_$category} +index={arg(1+$1,${2-30})} +thumbsize,strength,brightness,contrast,gamma,hue,saturation,normalize=${31-38} +if $normalize==1" || "$normalize==3 +foreach { split_opacity balance_gamma[0] , a c } +fi +if $index>=2 +path_clut=${-path_cache} +name=${arg0\ $index-2,$presets} +clut $name,{0$_is_preview" && "!isfile(['{/${path_clut}clut_$name.cimgz}'])?17:48} +repeat $!-1 { if $strength<100 +map_clut[$>] . j[$>] .,0,0,0,0,{$strength%} rm. else map_clut[$>] . fi } +rm. +adjust_colors $brightness,$contrast,$gamma,$hue,$saturation,0,255 +if $normalize==2" || "$normalize==3 foreach { split_opacity n[0] 0,255 a c } fi +elif $index==1 +adjust_colors $brightness,$contrast,$gamma,$hue,$saturation,0,255 +if $normalize==2" || "$normalize==3 foreach { split_opacity n[0] 0,255 a c } fi +else +foreach { if max(w,h)>$thumbsize rr2d $thumbsize,$thumbsize,0,2 fi } +N=$! +to "Original",1%,1%,7.5%,2 +Np={narg($presets)} +repeat $Np { +clut_name=${arg0\ $>,$presets} +clut $clut_name mv. $N +repeat $N { +if $strength<100 [$>] +map_clut. [$N] j.. .,0,0,0,0,{$strength%} rm. else +map_clut[$>] [$N] fi +adjust_colors. $brightness,$contrast,$gamma,$hue,$saturation,0,255 +if $normalize==2" || "$normalize==3 l. { split_opacity n[0] 0,255 a c } fi +strcapitalize $clut_name clut_name=${} +to. $clut_name,0.01~,0.01~,7.5%,2 +} +rm[$N] +progress {$>*100/($Np-1)} +} +k[$N--1] frame 1,1,0,0,0,255 - 128 append_tiles {s=floor(sqrt($!));w>h?[s,0]:[0,s]} + 128 +fi +fx_color_presets_preview : +_is_preview=1 +index={arg(1+$1,${2-30})} +if !$index gui_warning_preview "Preview disabled in 'Collage' mode" +else gui_split_preview "fx_color_presets $*",${39-41} +fi +u "{$1}{$2}_"{2*($1==0)}"{$3}_"{2*($1==1)}"{$4}_"{2*($1==2)}"{$5}_"{2*($1==3)}"{$6}_"{2*($1==4)}"{$7}_"{2*($1==5)}"{$8}_"{2*($1==6)}"{$9}_"{2*($1==7)}"{$10}_"{2*($1==8)}"{$11}_"{2*($1==9)}"{$12}_"{2*($1==10)}"{$13}_"{2*($1==11)}"{$14}_"{2*($1==12)}"{$15}_"{2*($1==13)}"{$16}_"{2*($1==14)}"{$17}_"{2*($1==15)}"{$18}_"{2*($1==16)}"{$19}_"{2*($1==17)}"{$20}_"{2*($1==18)}"{$21}_"{2*($1==19)}"{$22}_"{2*($1==20)}"{$23}_"{2*($1==21)}"{$24}_"{2*($1==22)}"{$25}_"{2*($1==23)}"{$26}_"{2*($1==24)}"{$27}_"{2*($1==25)}"{$28}_"{2*($1==26)}"{$29}_"{2*($1==27)}"{$30}_"{2*($1==28)}"{$31}_"{1+!$index}"{$32}{$33}{$34}{$35}{$36}{$37}{$38}{$39}{$40,$41}""{0}_"{2*($1!=28)}"{0}_"{2*($1==0)}"{0}_"{2*($1==1)}"{0}_"{2*($1==2)}"{0}_"{2*($1==3)}"{0}_"{2*($1==4)}"{0}_"{2*($1==5)}"{0}_"{2*($1==6)}"{0}_"{2*($1==7)}"{0}_"{2*($1==8)}"{0}_"{2*($1==9)}"{0}_"{2*($1==10)}"{0}_"{2*($1==11)}"{0}_"{2*($1==12)}"{0}_"{2*($1==13)}"{0}_"{2*($1==14)}"{0}_"{2*($1==15)}"{0}_"{2*($1==16)}"{0}_"{2*($1==17)}"{0}_"{2*($1==18)}"{0}_"{2*($1==19)}"{0}_"{2*($1==20)}"{0}_"{2*($1==21)}"{0}_"{2*($1==22)}"{0}_"{2*($1==23)}"{0}_"{2*($1==24)}"{0}_"{2*($1==25)}"{0}_"{2*($1==26)}"{0}_"{2*($1==27)}"{0}" +_fx_cluts_abigailgonzalez : +u blade_runner,blue_house,blue_ice,caribe,cinema,cinema_2,cinema_3,cinema_4,cinema_5,cinema_noir,cinematic_for_flog,day_4nite,eterna_for_flog,filmic,fuji_hdr,goldengate,matrix,monochrome_1,monochrome_2,old_west,science_fiction +_fx_cluts_alexjordan : +u action_magenta_01,action_red_01,adventure_1453,agressive_highligjtes_recovery_5,bleech_bypass_green,bleech_bypass_yellow_01,blue_dark,blue_shadows_01,bright_green_01,brownish,colorful_0209,conflict_01,contrast_with_highlights_protection,contrasty_afternoon,contrasty_green,cross_process_cp_130,cross_process_cp_14,cross_process_cp_15,cross_process_cp_16,cross_process_cp_18,cross_process_cp_3,cross_process_cp_4,cross_process_cp_6,dark_green_02,dark_green_1,dark_place_01,dream_1,dream_85,faded_retro_01,faded_retro_02,film_0987,film_9879,film_high_contrast,flat_30,green_2025,green_action,green_afternoon,green_conflict,green_day_01,green_day_02,green_g_09,green_indoor,green_light,harsh_day,harsh_sunset,highlights_protection,indoor_blue,low_contrast_blue,low_key_01,magenta_day,magenta_day_01,magenta_dream,memories,moonlight_01,mostly_blue,muted_01,night_01,only_red,only_red_and_blue,operation_yellow,orange_dark_4,orange_dark_7,orange_dark_look,orange_underexposed,protect_highlights_01,red_afternoon_01,red_day_01,red_dream_01,retro_brown_01,retro_magenta_01,retro_yellow_01,saturated_blue,smart_contrast,subtle_blue,subtle_green,yellow_55b,yellow_film_01 +_fx_cluts_berat : +u brownbm,cineblue,cinebm4k,goldentime,green_and_orange,monochrome,sevsuz,sunlightlove,western,westernlut2 +_fx_cluts_cinematic : +u deep,dimension,enchanted,flavin,frosted,shine,ultra_water,wipe +_fx_cluts_cinematic_travel : +u blue_cold_fade,bright_teal_orange,bright_warm,clear_teal_fade,cold_clear_blue,cold_clear_blue_1,deep_blue,deep_dark_warm,deep_high_contrast,deep_teal_fade,deep_warm_fade,faded_green,greenish_contrasty,greenish_fade,greenish_fade_1,hard_teal_orange,neutral_teal_orange,neutral_warm_fade,smooth_clear,smooth_green_orange,smooth_teal_orange,teal_fade,very_warm_greenish,warm_dark_contrasty,warm_fade,warm_fade_1,warm_neutral,warm_sunset_red,warm_teal +_fx_cluts_creative : +u anime,bleachbypass_1,bleachbypass_2,bleachbypass_3,bleachbypass_4,candlelight,colornegative,crispwarm,crispwinter,dropblues,edgyember,fallcolors,foggynight,futuristicbleak_1,futuristicbleak_2,futuristicbleak_3,futuristicbleak_4,horrorblue,latesunset,moonlight,nightfromday,redblueyellow,smokey,softwarming,tealmagentagold,tealorange,tealorange_1,tealorange_2,tealorange_3,tensiongreen_1,tensiongreen_2,tensiongreen_3,tensiongreen_4 +_fx_cluts_editingcorp : +u ampio,asistas,atusa,basuco,beati,bisogno,boyado,calidum,colore,convold,cosa,culor,dimmer,ensaya,falua,farkling,fatos,fezzle,filo,foresta,huesio,husmes,huyan,ideo,jarklin,lavark,levex,litore,loro,lotta,maesky,mercato,molti,motus,mucca,nigrum,onda,padre,partia,perso,picola,randas,satid,scala,scrittle,seges,selor,sensum,sino,soldi,strano,stringa,tirare,tutto,upglow,valize,valsky,vita,vubes,wavefire +_fx_cluts_ericellerbrock : +u avalanche,black_star,helios,hydracore,hypnosis,killstreak,nemesis,night_blade_4,paladin,seringe_4,serpent,terra_4,victory,yellowstone +_fx_cluts_filtergrade : +u fgcinebasic,fgcinebright,fgcinecold,fgcinedrama,fgcinetealorange_1,fgcinetealorange_2,fgcinevibrant,fgcinewarm +_fx_cluts_hollywood : +u 12_years_a_slave,1917,ad_astra,aladdin,ant-man,aquaman,avengers_endgame,baby_driver,bad_boys_for_life,beauty_and_the_beast,black_panther,bohemian_rhapsody,bombshell,captain_marvel,city_of_god,creed_2,doctor_strange,dunkirk,fight_club,ford_v_ferrari,green_book,greyhound,i_tonya,inception,jojo_rabbit,joker,jumanji_the_next_level,jurassic_world_fallen_kingdom,justice_league,kingsman_the_golden_circle,knives_out,la_la_land,little_women,logan,mad_max_fury_road,marriage_story,moonlight_2,mother!,no_time_to_die,once_upon_a_time_in_hollywood,parasite,pirates_of_the_caribbean,rocketman,separation,sicario,spider-man_far_from_home,spotlight,star_wars_the_rise_of_skywalker,sully,tenet,the_dark_knight,the_darkest_hour,the_gentelmen,the_grand_budapest_hotel,the_hurt_locker,the_irishman,the_lighthouse,the_lobster,the_martian,the_revenant,the_shape_of_water,the_social_network,the_two_popes,the_way_back,thor_ragnarok,top_gun_maverick,uncut_gems,underwater,venom,war_for_the_planet_of_the_apes,wolf_of_wall_street,wonder_woman,x-men_dark_phoenix,zombieland_double_tap +_fx_cluts_inavision : +u 7drk_21,bc_darkum,brown_mobster,cold_ice,dark_man_x,film_gb-19,formula_b,gremerta,hitman,jwick_21,london_nights,louetta,nightlife,vfb_21,vintage_mob +_fx_cluts_jtsemple : +u brightgreen,crispromance,crushin,frostedbeachpicnic,justpeachy,lateafternoonwanderlust,lushgreensummer,magentacoffee,minimalistcaffeination,mysticpurplesunset,nostalgiahoney,springmorning,toastedgarden,winterlighthouse +_fx_cluts_kylerholland : +u kh1,kh2,kh3,kh4,kh5,kh6,kh7,kh8,kh9,kh10 +_fx_cluts_lutifyme : +u hackmanite,herderite,heulandite,hiddenite,hilutite,howlite,hypersthene +_fx_cluts_michaelezra : +u deepskintones2,deepskintones3 +_fx_cluts_moviz : +u moviz_1,moviz_2,moviz_3,moviz_4,moviz_5,moviz_6,moviz_7,moviz_8,moviz_9,moviz_10,moviz_11,moviz_12,moviz_13,moviz_14,moviz_15,moviz_16,moviz_17,moviz_18,moviz_19,moviz_20,moviz_21,moviz_22,moviz_23,moviz_24,moviz_25,moviz_26,moviz_27,moviz_28,moviz_29,moviz_30,moviz_31,moviz_32,moviz_33,moviz_34,moviz_35,moviz_36,moviz_37,moviz_38,moviz_39,moviz_40,moviz_41,moviz_42,moviz_43,moviz_44,moviz_45,moviz_46,moviz_47,moviz_48 +_fx_cluts_ohadperetz : +u cold_simplicity_2,d_o_1,retro_summer_3,subtle_yellow,teal_moonlight,true_colors_8,vintage_warmth_1 +_fx_cluts_oliviosarikas : +u analog_film_1,atomic_pink,beach_aqua_orange,beach_faded_analog,bw_but_yellow,city_dust,dark_orange_teal,day_to_night_kings_blue,duotone_blue_red,faded_pink-ish,flat_blue_moon,honey_light,infrared_-_dust_pink,neutral_pump,shade_kings_ink,sunset_aqua_orange,sunset_intense_violet_blue,sunset_violet_mood,violet_taste +_fx_cluts_on1 : +u 2-strip-process,aqua,aqua_and_orange_dark,berlin_sky,blues,bw_1,bw_2,bw_3,bw_4,bw_5,bw_6,bw_7,bw_8,bw_9,bw_10,chrome_01,cinematic-1,cinematic-2,cinematic-3,cinematic-4,cinematic-5,cinematic-6,cinematic-7,cinematic-8,cinematic-9,cinematic-10,classic_teal_and_orange,earth_tone_boost,fade_to_green,film_print_01,film_print_02,french_comedy,green_blues,green_yellow,landscape_1,landscape_2,landscape_3,landscape_4,landscape_5,landscape_6,landscape_7,landscape_8,landscape_9,landscape_10,lc_1,lc_2,lc_3,lc_4,lc_5,lc_6,lc_7,lc_8,lc_9,lc_10,moody_1,moody_2,moody_3,moody_4,moody_5,moody_6,moody_7,moody_8,moody_9,moody_10,nw-1,nw-2,nw-3,nw-4,nw-5,nw-6,nw-7,nw-8,nw-9,nw-10,oranges,portrait_1,portrait_2,portrait_3,portrait_4,portrait_5,portrait_6,portrait_7,portrait_8,portrait_9,portrait_10,purple_2,reds,reds_oranges_yellows,studio_skin_tone_shaper,vintage_chrome +_fx_cluts_picturefx : +u 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,faux_infrared_bw_1,faux_infrared_color_p2,faux_infrared_color_p3,faux_infrared_color_r0a,faux_infrared_color_r0b,faux_infrared_color_yp1,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,technicalfx_backlight_filter,zilverfx_bw_solarization,zilverfx_infrared,zilverfx_vintage_bw +_fx_cluts_pixelmator : +u black_white_01,black_white_02,black_white_03,black_white_04,black_white_05,black_white_06,pmcinematic_01,pmcinematic_02,pmcinematic_03,pmcinematic_04,pmcinematic_05,pmcinematic_06,pmcinematic_07,classic_films_01,classic_films_02,classic_films_03,classic_films_04,classic_films_05,landscape_01,landscape_02,landscape_03,landscape_04,landscape_05,modern_films_01,modern_films_02,modern_films_03,modern_films_04,modern_films_05,modern_films_06,modern_films_07,pmnight_01,pmnight_02,pmnight_03,pmnight_04,pmnight_05,urban_01,urban_02,urban_03,urban_04,urban_05,vintage_01,vintage_02,vintage_03,vintage_04,vintage_05 +_fx_cluts_pixlsus : +u amstragram,amstragram+,autumn,cinematic_lady_bird,cinematic_mexico,dark_blues_in_sunlight,delicatessen,expired_69,fadedlook,faded_print,hypressen,magenta_yellow,metropolis,modern_film,newspaper,night_spy,progressen,prussian_blue,seventies_magazine,street,sweet_bubblegum,sweet_gelatto,taiga,tarraco,unknown,uzbek_bukhara,uzbek_marriage,uzbek_samarcande,velvetia,warm_vintage,whiter_whites +_fx_cluts_purple11 : +u good_morning,going_for_a_walk,nah,once_upon_a_time,serenity,passing_by,smooth_sailing,undeniable,undeniable2,urban_cowboy,well_see,you_can_do_it +_fx_cluts_rocketstock : +u arabica_12,ava_614,azrael_93,bourbon_64,byers_11,chemical_168,clayton_33,clouseau_54,cobi_3,contrail_35,cubicle_99,django_25,domingo_145,faded_47,folger_50,fusion_88,hyla_68,korben_214,lenox_340,lucky_64,mckinnon_75,milo_5,neon_770,paladin_1875,pasadena_21,pitaya_15,reeve_38,remy_24,sprocket_231,teigen_28,trent_18,tweed_71,vireo_37,zed_32,zeke_39 +_fx_cluts_shamoonabbasi : +u city_7,coffee_44,date_39,day_for_night,denoiser_simple_40,desert_gold_37,directions_23,drop_green_tint_14,elegance_38,golden_night_softner_43,golden_sony_37,green_15,happyness_133,hlg_1_1,industrial_33,morning_6,morroco_16,night_king_141,rest_33,shadow_king_39,spy_29,thriller_2,turkiest_42,vintage_163,wooden_gold_20 +_fx_cluts_smallhd : +u apocalypse_this_very_moment,bboyz_2,bob_ford,life_giving_tree,moonrise,saving_private_damon,the_matrices +_fx_cluts_others : +u 60s,60s_faded,60s_faded_alt,alien_green,black_and_white,bleach_bypass,blue_mono,cinematic_01,cinematic_02,cinematic_03,color_rich,faded,faded_alt,faded_analog,faded_extreme,faded_vivid,expired_fade,expired_polaroid,extreme,fade,faux_infrared,golden,golden_bright,golden_fade,golden_mono,golden_vibrant,green_mono,hong_kong,instantc,k_tone_vintage_kodachrome,light_blown,lomo,mono_tinted,muted_fade,mute_shift,natural_vivid,nostalgic,orange_tone,pink_fade,purple,retro,rotate_muted,rotate_vibrant,rotated,rotated_crush,smooth_cromeish,smooth_fade,soft_fade,solarized_color,solarized_color_2,summer,summer_alt,sunny,sunny_alt,sunny_warm,sunny_rich,super_warm,super_warm_rich,sutro_fx,vibrant,vibrant_alien,vibrant_contrast,vibrant_cromeish,vintage,vintage_alt,vintage_brighter,warm,warm_highlight,warm_yellow +_fx_cluts_toddblankenship : +u bluearchitecture,bluehour,coldchrome,crispautumn,darkandsomber,hardboost,longbeachmorning,lushgreen,magichour,naturalboost,orangeandblue,softblackandwhite,waves +_fx_cluts_youssefhossam : +u cinematic_forest,city,darkness,hallowen_dark,sea +fx_tk_colortemp : +repeat $! l[$>] if $2==1 +luminance. to_rgb.. +s.. c avb={-2,127.5-ia} avg={-3,127.5-ia} avr={-4,127.5-ia} ++[-4] $avr +... $avg +.. $avb a[-4,-3,-2] c rv compose_luminance fi +fx_mix_lab 1,0,0,1,{if({$1>=0},{$1/4},{$1*0.75})},0,1,$1,0,0,2,0 done done +fx_tk_colortemp_preview : +gui_split_preview "fx_tk_colortemp ${1--2}",$-1 +fx_colorful_blobs : +N=12 +colorspace,bgR,bgG,bgB,bgA,display_controls,x0,y0,rx0,ry0,R0,G0,B0,p_x0,p_y0,p_rx0,p_ry0,x1,y1,rx1,ry1,R1,G1,B1,p_x1,p_y1,p_rx1,p_ry1,x2,y2,rx2,ry2,R2,G2,B2,p_x2,p_y2,p_rx2,p_ry2,x3,y3,rx3,ry3,R3,G3,B3,p_x3,p_y3,p_rx3,p_ry3,x4,y4,rx4,ry4,R4,G4,B4,p_x4,p_y4,p_rx4,p_ry4,x5,y5,rx5,ry5,R5,G5,B5,p_x5,p_y5,p_rx5,p_ry5,x6,y6,rx6,ry6,R6,G6,B6,p_x6,p_y6,p_rx6,p_ry6,x7,y7,rx7,ry7,R7,G7,B7,p_x7,p_y7,p_rx7,p_ry7,x8,y8,rx8,ry8,R8,G8,B8,p_x8,p_y8,p_rx8,p_ry8,x9,y9,rx9,ry9,R9,G9,B9,p_x9,p_y9,p_rx9,p_ry9,x10,y10,rx10,ry10,R10,G10,B10,p_x10,p_y10,p_rx10,p_ry10,x11,y11,rx11,ry11,R11,G11,B11,p_x11,p_y11,p_rx11,p_ry11=$* +if !0$_is_preview display_controls=0 fi +if $1==1 srgb2cs=srgb2rgb cs2srgb=rgb2srgb +elif $1==2 srgb2cs=srgb2lab cs2srgb=lab2srgb +fi +{0,s=min(w,h);[s,s]},1,4 k. 100%,100%,1,1,1e-8 +repeat $N { +rx$>,ry$>={"P = ["${x$>},${y$>}"]; +R = ["${rx$>},${ry$>}"]; +oP = ["${p_x$>},${p_y$>}"]; +oP==[-1,-1]?P + [10,0]:P!=oP?R + P - oP:R"} +if !isnan(${x$>}) +x,y,rx,ry,R,G,B={"const w1 = (w - 1)%; const h1 = (h -1)%; "round([${x$>}*w1,${y$>}*h1,${rx$>}*w1,${ry$>}*h1,${R$>},${G$>},${B$>}])} +r={max(1,round(norm($x-$rx,$y-$ry)))} +if $1 ($R^$G^$B) $srgb2cs. R,G,B={^} rm. fi +f. "* +pexp(x) = x<2?(res = 1; px = x^2; res+=-1.17282*px; px*=x; res+=0.683221*px; px*=x; res+=-0.110353*px):0; +const r = 1.2*"($r)"; +dist = norm(x-"$x",y-"$y")/r; +w = pexp(dist); +j(#0,0,0,0) += w*"$R"; +j(#0,0,0,0,1) += w*"$G"; +j(#0,0,0,0,2) += w*"$B"; +i + w; +" +fi +} +sh[0] 0,2 /. [1] if $1 $cs2srgb. fi +f[0] "*begin(bg = [ "$bgR,$bgG,$bgB,$bgA" ]); i(#1)<0.5?bg:[R,G,B,255]" k[0] +repeat $N { +if !isnan(${x$>})" && "$display_controls +x,y,rx,ry,R,G,B={"const w1 = (w - 1)%; const h1 = (h -1)%; "round([${x$>}*w1,${y$>}*h1,${rx$>}*w1,${ry$>}*h1,${R$>},${G$>},${B$>}])} +circle $x,$y,3,0.85,0xFFFFFFFF,{v=avg(crop($x-3,$y-3,7,7))>128?0:255;[v,v,v,255]} +rectangle {"const x = "$rx"; const y = "$ry"; [x-2,y-2,x+2,y+2]"},0.85,0xFFFFFFFF,{v=avg(crop($rx-3,$ry-3,7,7))>128?0:255;[v,v,v,255]} +line $x,$y,$rx,$ry,0.5,0xF0F0F0F0,255 line $x,$y,$rx,$ry,0.5,0x0F0F0F0F,0,0,0,255 +fi +} +if 0$_is_preview +u \{$colorspace\}\{$bgR,$bgG,$bgB,$bgA\}\{$display_controls\}\{$x0,$y0\}\{$rx0,$ry0\}\{$R0,$G0,$B0\}\{$x0,$y0,$rx0,$ry0\}\{$x1,$y1\}\{$rx1,$ry1\}\{$R1,$G1,$B1\}\{$x1,$y1,$rx1,$ry1\}\{$x2,$y2\}\{$rx2,$ry2\}\{$R2,$G2,$B2\}\{$x2,$y2,$rx2,$ry2\}\{$x3,$y3\}\{$rx3,$ry3\}\{$R3,$G3,$B3\}\{$x3,$y3,$rx3,$ry3\}\{$x4,$y4\}\{$rx4,$ry4\}\{$R4,$G4,$B4\}\{$x4,$y4,$rx4,$ry4\}\{$x5,$y5\}\{$rx5,$ry5\}\{$R5,$G5,$B5\}\{$x5,$y5,$rx5,$ry5\}\{$x6,$y6\}\{$rx6,$ry6\}\{$R6,$G6,$B6\}\{$x6,$y6,$rx6,$ry6\}\{$x7,$y7\}\{$rx7,$ry7\}\{$R7,$G7,$B7\}\{$x7,$y7,$rx7,$ry7\}\{$x8,$y8\}\{$rx8,$ry8\}\{$R8,$G8,$B8\}\{$x8,$y8,$rx8,$ry8\}\{$x9,$y9\}\{$rx9,$ry9\}\{$R9,$G9,$B9\}\{$x9,$y9,$rx9,$ry9\}\{$x10,$y10\}\{$rx10,$ry10\}\{$R10,$G10,$B10\}\{$x10,$y10,$rx10,$ry10\}\{$x11,$y11\}\{$rx11,$ry11\}\{$R11,$G11,$B11\}\{$x11,$y11,$rx11,$ry11\} +fi +fx_colorful_blobs_preview : +_is_preview=1 +rm {s=min($_preview_area_width,$_preview_area_height)/2;[s,s]},1,1 +fx_colorful_blobs $* +fx_colormap : +foreach { +split_opacity to_rgb[0] +if $1>=2 +index[0] {$1-2},$2,1 +elif $1==1 +(${5-28}) z. 0,{3*$4-1} +r. 3,{w/3},1,1,-1 permute. yzcx r. $3,1,1,3,3 +index[0] .,$2,1 rm. +else +autoindex[0] $3,$2,{if($3<=32,1,0)} +fi +a c +} +fx_colormap_preview : +gui_split_preview "fx_colormap $*",${-3--1} +is_ad,is_cu={2*[$1==0||$1==1,$1==1]} +u "{$1}{$2}""{$3}_"$is_ad"{$4}_"$is_cu"{${5-7}}_"$is_cu"{${8-10}}_"$is_cu"{${11-13}}_"$is_cu"{${14-16}}_"$is_cu"{${17-19}}_"$is_cu"{${20-22}}_"$is_cu"{${23-25}}_"$is_cu"{${26-28}}_"$is_cu"{$29}{$30,$31}" +#@cli afre_contrast : -200<=amount<=200 +#@cli : Enhance luminance contrast. +#@cli : Default value: 'amount=50'. +afre_contrast : check "${1=50}>=-200 && $1<=200" +if !$1 return fi e[] "[afre]^_^) contrast: Enhance luminance contrast of image$? using amount=$1." +repeat $! l[$>] r={[im,iM]} . afre_orien.. 1 +. +n. 0,1 f. "begin(const A=ia; const P=2^($1/100)); +if(i "Color curves" +repeat 4 { __xcc_C$>=0,0,100,100 } +if $4==$1 l[] { ($5) s -,-1 repeat $! { __xcc_C$>={$>,^} } rm } fi +if $3 +_xcc_colorbase=${arg\ {$4+1},rgb,cmy,cmyk,hsi,hsl,hsv,lab,lch,ycbcr} x_color_curves last +else +x_color_curves ${arg\ {$1+1},rgb,cmy,cmyk,hsi,hsl,hsv,lab,lch,ycbcr} +u "{$1}{$2}{$3}{$1}{"$__xcc_C0,-1,$__xcc_C1,-1,$__xcc_C2,-1,$__xcc_C3,-1,$__xcc_C4"}" +fi +if $2 +(0,255) (0;255) (0/255) r[-3--1] 2,2,2 a[-3--1] c +if $2==2 r. 256,256,256,3,3 r. 4096,4096,1,3,-1 +else r. 64,64,64,3,3 r. 512,512,1,3,-1 +fi +x_color_curves. last +fi +fx_curves_interactive_preview : +fx_curves_interactive $1,0,1,$4,"$5" +fx_customize_clut : +if !narg($_N) N=64 else N=$_N fi N1={$N-1} +$N,$N,$N,4 +if $2 +uniform_distribution {(1+$2)^3},3 +repeat w { point.. {round($N1*I[$>])},1,{255*I[$>]},1 } rm. +fi +$=arg +repeat 24 { +mode=${arg{13+7*$<}} +if $mode +sr=${arg{14+7*$<}} sg=${arg{15+7*$<}} sb=${arg{16+7*$<}} +tr=${arg{17+7*$<}} tg=${arg{18+7*$<}} tb=${arg{19+7*$<}} +xyz={round(($N1/255)*[$sr,$sg,$sb])} +point. $xyz,1,{$mode==2?[$tr,$tg,$tb]:[$sr,$sg,$sb]},1 +fi +} +s c,-3 +if $1<100 ++distance. 1 +if $1 ^. {1/(0.05+4*$1%)} else f. 0 fi +n. 0,1 => influence mv. -3 +fi +==. 0 inpaint_pde.. .,100%,1,20 rm. c. 0,255 +if $influence +100%,100%,100%,3,[x,y,z] n. 0,255 +j. ..,0,0,0,0,1,... +rm[-3,-2] +fi +if !$3 map_clut[^-1] . +else repeat $!-1 { ++luminance[$>] +map_clut[$>] .. -. [$>] +repeat $3 { guided. ..,2,50 } +[$>,-1] rm. +} fi +adjust_colors ${4-8},0,255 +if $9 foreach { split_opacity n[0] 0,255 a c } fi +if $10 +if $10==2 r. 256,256,256,3,5 c. 0,255 fi +siz={w^1.5} r. $siz,$siz,1,3,-1 +mv. 0 +else rm. +fi +fx_customize_clut_preview : +if $11<7 gui_split_preview "fx_customize_clut ${1-9},0,0,${12--1}",$11 +elif $11==7 +rm fx_customize_clut ${1-9},1,0,${12--1} +elif $11>=8 +_N={$11>=9?64:32} +k[0] to_rgb w={w} h={h} ++fx_customize_clut ${1-9},1,0,${12--1} mv. 1 +r. $_N,$_N,$_N,3,-1 pointcloud3d. o3d. $12 +l[] { +if $2 +uniform_distribution {(1+$2)^3},3 +repeat w { circle3d {0,round($_N*I[$>])},0.75 col3d. {0,255*I[$>]} } rm[0] +fi +$=arg +repeat 24 { +mode=${arg{13+7*$<}} +if $mode +sr=${arg{14+7*$<}} sg=${arg{15+7*$<}} sb=${arg{16+7*$<}} +tr=${arg{17+7*$<}} tg=${arg{18+7*$<}} tb=${arg{19+7*$<}} +xy={round(($_N/255)*[$sr,$sg])} +z={round(($_N/255)*$sb)-0.1} +circle3d $xy,$z,0.75 col3d. {$mode==2?[$tr,$tg,$tb]:[$sr,$sg,$sb]} +fi +} +colorcube3d *3d. {$_N/255} o3d. 0.5 col3d. 0 p3d. 1 +} ++3d[2--1] +pose3d. 5.10656,2.04904,2.723,-316.115,-0.0815767,4.97762,-3.59262,-41.7094,-3.40685,2.95212,4.16756,-118.811,0,0,203,1 +if $w>$h +r2dx[0,1] {0,round(w/2)} +to[0] "Before",2,0,13,1,0.75 +to[1] "After",2,0,13,1,0.75 +a[0,1] y r[0] 100%,$h,1,3,0 +else +r2dy[0,1] {0,round(h/2)} +to[0] "Before",2,0,13,1,0.75 +to[1] "After",2,0,13,1,0.75 +a[0,1] x r[0] $w,100%,1,3,0 +fi +snapshot3d. {0,1.1*min(w,h)},1.2,64,64,64 +autocrop. -. 64 r. {0,max(w,$w-w)},{0,max(h,$h-h)},1,3,0,0,0.5,0.5 +. 64 +to. "RGB CLUT",2,0,13,1,0.75 +a {`$w>$h?_'x':_'y'`} +fi +#@cli afre_darksky : blend={ 0=softlight | 1=overlay },-100<=_contrast<=100,_smooth_method={ 0=fast_approx | 1=slow_accurate },0<=_smooth_radius<=3 +#@cli : Enhance landscape by darkening the sky. +#@cli : Default values: 'blend=0', 'contrast=0', 'smooth_method=0' and 'smooth_radius=0'. +afre_darksky : check "isbool(${1=0}) && ${2=0}>=-100 && isbool(${3=0}) && ${4=0}>=0 && $2<=100 && $4<=3" +b=${arg\ 1+$1,softlight,overlay} m=${arg\ 1+$3,fast,slow} rd={int($4)} e[] "[afre]^_^) darksky: Darken sky of image$? using blend="$b", contrast=$2, smooth_method="$m" and smooth_radius="$rd"." +repeat $! l[$>] if s<3||s>4 error[] "\n[afre]>_<) darksky: Select RGB images." fi done done +repeat $! l[$>] r0={[im,iM]} n 0,255 +channels 1 +channels.. 2 -[^0] +if $rd&&$3 afre_gui0_fast. $rd,1e0 elif $rd r1={[im,iM]} +median. {$rd*2+1} n. $r1 fi c. 0%,0 +. 127 afre_contrast. {$2} ++afre_y50.. 1 r1={[im,iM]} afre_orien[0] 1 if $1 blend. ..,$b rm.. +else l[-2--1] rv afre_softlight 100 done fi n. $r1 * +n $r0 done done +afre_darksky_preview : +afre_darksky $* +fx_decompose_channels : +if !$2 +if $4 to_rgba else to_rgb fi +foreach { +nm={n} +split_opacity +_s3=A _s4=A +_fx_decompose_channels$1[0] +s[0] c +if !$3 a x => $nm +else nm=${-gui_layer_name} repeat $! { gui_set_layer_name[$>] {``$nm}" ["${_s$>}"]" } +fi +} +else +channels 0 nbc={3+($1==10)} nb={$nbc+$4} +if $3 repeat int($!/$nb) { l[0-{$nb-1}] { +a[0-{$nbc-1}] c _fx_recompose_channels$1[0] a c +} mv. 0 } +else foreach { s x,$nb a[0-{$nbc-1}] c _fx_recompose_channels$1[0] a c } +fi +fi +fx_decompose_channels_preview : +foreach { +_s3=A _s4=A +fx_decompose_channels $1,$2,1,$4 +if !$2 +fs={round(min(w,h)*15%)} +repeat $! { to[$>] ${_s$>},5,3,$fs,{max(2,round($fs/15))} } +to_rgba +fi +} +append_tiles , +_fx_decompose_channels0 : _s0=R _s1=G _s2=B +_fx_decompose_channels1 : rgb2hsv8 _s0=H _s1=S _s2=V +_fx_decompose_channels2 : rgb2hsl8 _s0=H _s1=S _s2=L +_fx_decompose_channels3 : rgb2hsi8 _s0=H _s1=S _s2=I +_fx_decompose_channels4 : rgb2yuv8 _s0=Y _s1=U _s2=V +_fx_decompose_channels5 : rgb2ycbcr _s0=Y _s1=Cb _s2=Cr +_fx_decompose_channels6 : rgb2xyz8 _s0=X _s1=Y _s2=Z +_fx_decompose_channels7 : rgb2lab8 _s0=L _s1=a _s2=b +_fx_decompose_channels8 : rgb2lch8 _s0=L _s1=c _s2=h +_fx_decompose_channels9 : rgb2cmy _s0=C _s1=M _s2=Y +_fx_decompose_channels10 : rgb2cmyk _s0=C _s1=M _s2=Y _s3=K +_fx_decompose_channels11 : rgb2yiq8 _s0=Y _s1=I _s2=Q +_fx_recompose_channels0 : +_fx_recompose_channels1 : hsv82rgb +_fx_recompose_channels2 : hsl82rgb +_fx_recompose_channels3 : hsi82rgb +_fx_recompose_channels4 : yuv82rgb +_fx_recompose_channels5 : ycbcr2rgb +_fx_recompose_channels6 : xyz82rgb +_fx_recompose_channels7 : lab82rgb +_fx_recompose_channels8 : lch82rgb +_fx_recompose_channels9 : cmy2rgb +_fx_recompose_channels10 : cmyk2rgb +_fx_recompose_channels11 : yiq82rgb +fx_detect_skin : +to_rgb +m "_fx_detect_skin : +if $5 balance_gamma 128,128,128 fi +if $1 detect_skin $2 else detect_skin $2,$6%,$7%,$8% fi +M={iM} b $3% * {255*$M/iM} * $4 c 0,255" +foreach { +if $9 ++_fx_detect_skin a c +if $9>1 sh 100% *. -1 +. 255 rm. fi +else _fx_detect_skin +fi +} +um _fx_detect_skin +fx_detect_skin_preview : +gui_split_preview "fx_detect_skin $*",${-3--1} +to_rgba +if !$1 +circle $6%,$7%,$8%,0.3,0,255,0,255 +circle $6%,$7%,$8%,1,0xFFFFFFFF,0,255,0,255 +line {$6-0.25*$8}%,{$7-0.25*$8}%,{$6+0.25*$8}%,{$7+0.25*$8}%,1,255,255,0,255 +line {$6+0.25*$8}%,{$7-0.25*$8}%,{$6-0.25*$8}%,{$7+0.25*$8}%,1,255,255,0,255 +fi +fx_equalize_hsv : +cs=${"arg0 $1,hsi,hsl,hsv"} +foreach { +split_opacity l[0] { +to_rgb +9,1,1,4,{"V = [${6-30:3}]*pi/180; [cos(V),sin(V)]"},${7-31:3},{"V = [${8-32:3}]; +const sV = size(V); +repeat (sV,k, +v0 = k/sV; +v1 = (k+1)/sV; +V[k]*=(V[k]>0?(1 - v0):v1); +); V"} +r. 256,1,1,4,1 +sh. 3 b. $3 rm. +f. "[ atan2(G,R)*180/pi,B,A,0 ]" channels. 0,2 ++rgb2$cs.. +channels. 100% *. 256 round. map. ... ++[-2,-1] rm.. +channels. 100% ${cs}2rgb.. +if $4 +*. 255 bilateral.. .,$4,{2+$4} +rgb2$cs.. /. 255 j.. .,0,0,0,2 ${cs}2rgb.. +fi +rm. +blend alpha,{$2%} +} +a c +} +fx_equalize_hsv_preview : +if $5 +cs=${"arg0 $1,hsi,hsl,hsv"} +rm {0.8*[${-gui_preview_wh}]},1,3,"$5==1? +(H = S = 0; V = y/(h-1)): +(H = x*360/(w-1); S = y/(h-1); V = y/(h-1)); +[H,S,V]" +${cs}2rgb. +fi +gui_split_preview "fx_equalize_hsv $*",${-3--1} +if $5 r. ${-gui_preview_wh},1,3,0,0,0.5,0.5 fi +fx_hsv_equalizer : +foreach { +to_rgb rgb2hsv s c ++f[0] if(abs(i-$2)<$3/2|abs(i-$2-360)<$3/2|abs(i-$2+360)<$3/2,1,0) ++f[0] if(abs(i-$7)<$8/2|abs(i-$7-360)<$8/2|abs(i-$7+360)<$8/2,1,0) ++f[0] if(abs(i-$12)<$13/2|abs(i-$12-360)<$13/2|abs(i-$12+360)<$13/2,1,0) ++threshold[1,2] 0.01 *[-1,-2] [-1]x2 *[-1,3] *[-1,4] *[-1,5] ++*[3] $4 +*[4] $9 +*[5] $14 +[-1,-2,-3] ++[-1,0] %[0] 360 +if $5>=0 +*[3] -$5 else +*[3] {1/(1+$5)-1} fi +. 1 +if $10>=0 +*[4] -$10 else +*[4] {1/(1+$10)-1} fi +. 1 +if $15>=0 +*[5] -$15 else +*[5] {1/(1+$15)-1} fi +. 1 +*[-1,-2,-3] ^[1,-1] +if $6>=0 +*[3] -$6 else +*[3] {1/(1+$6)-1} fi +. 1 +if $11>=0 +*[4] -$11 else +*[4] {1/(1+$11)-1} fi +. 1 +if $16>=0 +*[5] -$16 else +*[5] {1/(1+$16)-1} fi +. 1 +*[-1,-2,-3] ^[2,-1] +rm[3,4,5] a[0,1,2] c hsv2rgb +} +fx_hsv_equalizer_preview : +l. { +if $1==0 fx_hsv_equalizer $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16 +else +to_rgb rgb2hsv s c +(0,359) r. ..,{{0,h}/10},1,1,3 . f. 1 +j[0] [3],0,91% j[1] [4],0,91% j[2] [4],0,91% rm[-1,-2] ++f[0] if(abs(i-$2)<$3/2|abs(i-$2-360)<$3/2|abs(i-$2+360)<$3/2,1,0) ++f[0] if(abs(i-$7)<$8/2|abs(i-$7-360)<$8/2|abs(i-$7+360)<$8/2,1,0) ++f[0] if(abs(i-$12)<$13/2|abs(i-$12-360)<$13/2|abs(i-$12+360)<$13/2,1,0) +-|[-3--1] +. 0.33 /. 1.33 +*[2,-1] a c hsv2rgb +fi +} +gcd_hsl : skip ${1=1},${2=0},${3=0},${4=180},${5=0.2},${6=0},${7=1},${8=1} +repeat $! l[$>] +split_opacity to_rgb[0] rgb2hsv[0] +if $6 ++channels[0] 0 +histogram. 360,0,360 +hue={(xM+180)%360} rm. +else hue=$4 fi +sh[0] 1,1 +if $3 sat={-max(0,ia-0.5)} else sat=$2 fi +-. 0.5 *. $1 +. $sat ++. 0.5 c. 0,1 rm. +hsv2rgb[0] ++channels[0] 0 *. 66 ++channels[0] 1 *. 129 +[-2,-1] ++channels[0] 2 *. 25 +[-2,-1] ++. 128 /. 256 +. 16 +apply_gamma. {max(0.001,$7)} +if $8!=1 -. 128 *. $8 +. 128 fi +c. 0,255 +sh[0] 0,0 sh[0] 1,1 sh[0] 2,2 +($hue^1^1) hsv2rgb. n. {1-$5},1 +*[-4] {@0} *... {@1} *.. {@2} +rm[-4--1] rgb2ycbcr[0] j[0] . rm. +ycbcr2rgb[0] a c +done done +gcd_hsl_preview : +gui_split_preview "gcd_hsl ${1--2}",$-1 +gcd_hsv_select : +skip ${1=0},${2=0.5},${3=1} skip ${4=180},${5=0.5},${6=0.5} +skip ${7=2},${8=2} skip ${9=18},${10=0},${11=0},${12=0} +repeat $! l[$>] +to_rgba[0] remove_opacity[0] +if !$12 [0] fi +l. +gcd_shrink ++rgb2hsv[0] s. c +bh={$1-$4} th={$1+$4} ++ge[1] {360+$bh} +le[1] {$th-360} +ir[1] {max($bh,0)},{min($th,360)} +or[-2,-1] or[1,-1] +ir[2] {$2-$5},{$2+$5} +ir[3] {$3-$6},{$3+$6} +and[-2,-1] and[-2,-1] +meancurvature_flow[0] 3 median[0] 3 ++[0] 1 +gradient_norm[0] +b. 2,1,1 min_patch. $9 +*[0,-1] *. -1 ++*[0] [1] gt[0] 0 negate[1] *[0,1] *[0] 0.5 max[0,-1] ++watershed[0] . k. -. 1 +gcd_unshrink +done +if !$12 +channels. 0 ge. 0 ++area. 0 +le. {($10%*max(w,h))^2} ++negate... *[-2,-1] inpaint... . rm. +le. {($11%*max(w,h))^2} *. .. +inpaint.. . rm. *. 255 +if $7>0 dilate. $7 +elif $7<0 erode. {abs($7)} fi +if $8 b. $8,1,1 fi +a[-2,-1] c +fi +c. 0,255 +done done +iain_hue_light_dark_p: +repeat $! l[$>] +apply_parallel_overlap "iain_hue_light_dark ${1--2}",0,${-1} +done done +iain_hue_light_dark: +repeat $! l[$>] split_opacity l[0] ++l[0] +to_rgb +if $20==0 +rgb2hsv8 +else +rgb2hsl8 +fi +s c ++apply_curve[0] 0,0,{128+$1},16,{128+$2},30,{128+$3},42,{128+$4},60,{128+$5},75,{128+$6},85,{128+$7},105,{128+$8},127,{128+$9},135,{128+$10},150,{128+$11},170,{128+$12},180,{128+$13},195,{128+$14},213,{128+$15},225,{128+$16},240,{128+$17},255,{128+$18} +sub[-1] 128 +add[-1] $19 +add[-1,-2] +a c +if $20==0 +hsv82rgb +else +hsl82rgb +fi +done ++rgb2hsv[0] +s[-1] c +keep[0,1,-1,-2] +mul[-1,-2] 255 +apply_curve[-2] 0,0,0,$22,0,$21,255,255,255 +apply_curve[-1] 0,0,0,$24,0,$23,255,255,255 +mul[-1] [-2] +div[-1] 255 +remove[-2] +c[-1] 0,255 +a[1,2] c +blend[0,1] alpha +if $25==1 +to_gray +fi +done a c done done +#@cli afre_localcontrast : 1<=radius<=10,-100<=_amount<=100 +#@cli : Enhance local contrast. +#@cli : Default values: 'radius=1' and 'amount=50'. +afre_localcontrast : check "${1=1}>=1 && ${2=50}>=-100 && $1<=10 && $2<=100" +if !$2 return fi rd={int($1)} e[] "[afre]^_^) localcontrast: Enhance local contrast of image$? using radius="$rd" and amount=$2." +repeat $! l[$>] r0={[im,iM]} n 0,255 rgb2jzazbz 0 sh 0 r1={[im,iM]} +. +afre_gui0_fast. $1,1e0 n. 0,1 f. "begin(const boundary=1; +const D="$rd"*2+1; const P=4^($2/50)); +ref(crop(x-"$rd",y-"$rd",0,c,D,D,1,1),N); A=avg(i,med(N)); +if(i] +fx_gaussian_blur $2,0,0,1,1,0,0 +luminance +luminance +fx_apply_curve[1] 0,31,111,64,17,110,176,148,75,177,235,186,1,0,0,0,0 +fx_apply_curve[1] 0,31,111,64,17,110,176,148,75,177,235,186,1,0,0,0,0 +rv[0,1] fx_compose_value[0,1] $1,0 +if $3==1 fx_mix_rgb 1,50,0,1,50,0,1,-50,0,0,2,0 +elif $3==2 fx_mix_rgb 1,75,0,1,5,0,1,-25,0,0,2,0 +elif $3==3 fx_mix_rgb 1,70,0,1,40,0,1,-20,0,0,2,0 +elif $3==4 fx_mix_rgb 1,-5,0,1,0,0,1.1,12,0,0,2,0 +fi done done +fx_tk_metallic_preview : +gui_split_preview "fx_tk_metallic ${1--2}",$-1 +fx_mix_cmyk : +foreach { +split_opacity rv to_rgb. +fx_start_mix $13,$14 +rgb2cmyk. s. c +*[-4] $1 +[-4] $2 b[-4] $3% +*... $4 +... $5 b... $6% +*.. $7 +.. $8 b.. $9% +*. $10 +. $11 b. $12% +a[-4--1] c cmyk2rgb. +fx_end_mix $13 +if $!!=3 rv a c fi +} +fx_mix_cmyk_preview : +gui_split_preview "fx_mix_cmyk $*",${-3--1} +fx_mix_hsv : +foreach { +split_opacity rv to_rgb. +fx_start_mix $10,$11 +rgb2hsv. s. c -[-2,-1] 0.5 +*... $1 +... $2 b... $3% +*.. $4 +.. $5 b.. $6% +*. $7 +. $8 b. $9% +%... 360 +[-2,-1] 0.5 c[-2,-1] 0,1 a[-3--1] c hsv2rgb. +fx_end_mix $10 +if $!!=3 rv a c fi +} +fx_mix_hsv_preview : +gui_split_preview "fx_mix_hsv $*",${-3--1} +fx_mix_lab : +foreach { +split_opacity to_rgb[0] +gui_parallel_overlap[0] "_fx_mix_lab $*",0,{3*max($3,$6,$9)} +a c +} +_fx_mix_lab : +fx_start_mix $10,$11 +rgb2lab. s. c +*... $1 +... $2 b... $3% +*.. $4 +.. $5 b.. $6% +*. $7 +. $8 b. $9% +a[-3--1] c lab2rgb. +fx_end_mix $10 +fx_mix_lab_preview : +gui_split_preview "fx_mix_lab $*",${-3--1} +fx_mix_pca : +foreach { split_opacity l[0] { +to_rgb +if [$14]==round(stats()[0,4],0.1) _avg={[$15][0,3]} C={[$15][3,9]} status= +else ++rr2d 256,256,0,2 C=${"covariance_vectors. _avg"} rm. +__status="{$1}{$2}{$3}{$4}""{$5}{$6}{$7}{$8}""{$9}{$10}{$11}{$12}""${13}""{"{round(stats()[0,4],0.1)}"}""{"$_avg,$C"}""{$16}{${17,18}}" +fi +if "$4 || $8 || $12" +l { +f "begin(avg = ["$_avg"]; eig = eig(["$C"]); Pt = eig[3,9]); Pt*(I-avg)" +s c repeat $! { vmax$>={$>,1.1*max(abs(im),abs(iM))} } +rm +} else vmax0,vmax1,vmax2=1 fi +f "begin( +do_gamma(val,vmax,gamma) = (vmax*sign(val)*(abs(val)/vmax)^gamma); +const gamma0 = 10^-($4%); +const gamma1 = 10^-($8%); +const gamma2 = 10^-($12%); +const vmax0 = "$vmax0"; +const vmax1 = "$vmax1"; +const vmax2 = "$vmax2"; +avg = ["$_avg"]; +eig = eig(["$C"]); +for (k = 3, k<12, k+=3, eig[k]<0?copy(eig[k],eig[k,3]*=-1,3)); +Pt = eig[3,9]; +P = transpose(Pt,3); +T = mul(P,diag(10^[$1,$5,$9]),3); +R1 = rot(eig[3,3],$3°); +R2 = rot(eig[6,3],$7°); +R3 = rot(eig[9,3],$11°); +T = mul(R1,mul(R2,mul(R3,T,3),3),3); +avg_shift = avg + $2*eig[3,3] + $6*eig[6,3] + $10*eig[9,3]; +if ("0$_is_preview", +L = [ 2,5,10]*sqrt(1e-5 + eig[0,3]); +run('__cols=',v2s(round([ +avg - L[0]*eig[3,3], +avg + L[0]*eig[3,3], +avg - L[1]*eig[6,3], +avg + L[1]*eig[6,3], +avg - L[2]*eig[9,3], +avg + L[2]*eig[9,3] ]))); +); +); +nI = Pt*(I - avg); +($4 || $8 || $12)?( +nI[0] = do_gamma(nI[0],vmax0,gamma0); +nI[1] = do_gamma(nI[1],vmax1,gamma1); +nI[2] = do_gamma(nI[2],vmax2,gamma2); +); +avg_shift + T*nI" +c 0,255 +} a c } u $__status +fx_mix_pca_preview : +_is_preview=1 +__status= +foreach { +gui_split_preview "fx_mix_pca ${1-13},\"$14\",\"$15\",${16-18}",${-3--1} +if $13 +rr2d ${-gui_preview_wh},0,1 +($__cols) r. 3,6,1,1,-1 permute. yzcx s. x,3 +r[-3--1] {w#0/2},13,1,3,3 c[-3--1] 0,255 +frame[-3--1] 1,1,0 +to[0] Primary,4,2,13,1 j[0] ...,64,4 +to[0] Secondary,4,17,13,1 j[0] ..,64,19 +to[0] Tertiary,4,32,13,1 j[0] .,64,34 +k[0] +fi +} +u $__status +fx_start_mix : +if $1==1 +tones. 3 +[-2,-1] b[-2,-1] $2% ri[-2,-1] ... *. ... mv... $! +elif $1==2 +tones. 3 +[-3,-1] b[-2,-1] $2% ri[-2,-1] ... *.. ... mv... $! +elif $1==3 +tones. 3 +[-3,-2] b[-2,-1] $2% ri[-2,-1] ... *.. ... mv... $! +fi +fx_end_mix : +if $1==1 *[-3,-1] +[-2,-1] +elif $1==2 *[-2,-1] +[-2,-1] +elif $1==3 *[-2,-1] +[-2,-1] +fi +c 0,255 +fx_mix_rgb : +foreach { +split_opacity rv to_rgb. +fx_start_mix $10,$11 +-. 128 s. c +*... $1 +... $2 b... $3% +*.. $4 +.. $5 b.. $6% +*. $7 +. $8 b. $9% +a[-3--1] c +. 128 c. 0,255 +fx_end_mix $10 +if $!!=3 rv a c fi +} +fx_mix_rgb_preview : +gui_split_preview "fx_mix_rgb $*",${-3--1} +fx_mix_ycbcr : +foreach { +split_opacity rv to_rgb. +fx_start_mix $10,$11 +rgb2ycbcr. -. 128 s. c +*... $1 +... $2 b... $3% +*.. $4 +.. $5 b.. $6% +*. $7 +. $8 b. $9% +a[-3--1] c +. 128 c. 0,255 ycbcr2rgb. +fx_end_mix $10 +if $!!=3 rv a c fi +} +fx_mix_ycbcr_preview : +gui_split_preview "fx_mix_ycbcr $*",${-3--1} +fx_random_color_transformation : +if $2" || "$3 srand __seed:=_round(u(100000)) else __seed=$1 fi +random_clut $__seed +amplitude:=$4% +repeat $!-1 { l[$>,-1] { ++map_clut.. . +j... .,0,0,0,0,$amplitude rm. +} } +rm. +adjust_colors ${5-9} +fx_random_color_transformation_preview : +gui_split_preview "fx_random_color_transformation ${1--2}",${-3--1} +to "Seed: \#"$__seed,5,5,5%,2 +u "{"$__seed"}{0}{0}{$4}{$5}{$6}{$7}{$8}{$9}{$10}{$11,$12}" +fx_retinex : +foreach { ++retinex $2,${"arg0 $3,hsi,hsv,lab,lrgb,rgb,ycbcr"},$4,$5,${7--1} +if $6 guided. ..,$6,$6 fi +j[0] .,0,0,0,0,{$1%} rm. +c 0,255 +} +fx_retinex_preview : +gui_split_preview "fx_retinex $*",${-3--1} +fx_retrofade : +foreach { +split_opacity l[0] { ++f 0 +repeat $1 { ++noise[0] $3 c. 0,255 autoindex. $2,0,0 ++[-2,-1] +progress {$>*100/$1} +} +k. n 0,255 +progress 100 +} +a c +} +fx_retrofade_preview : +gui_split_preview "fx_retrofade $*",${-3--1} +iain_rgb_tone: +repeat $! l[$>] split_opacity l[0] +to_rgb ++split c ++apply_curve[1] 0,0,$1,128,$2,255,$3 ++apply_curve[2] 0,0,$4,128,$5,255,$6 ++apply_curve[3] 0,0,$7,128,$8,255,$9 +add[-1,-2,-3] ++apply_curve[1] 0,0,$10,128,$11,255,$12 ++apply_curve[2] 0,0,$13,128,$14,255,$15 ++apply_curve[3] 0,0,$16,128,$17,255,$18 +add[-1,-2,-3] ++apply_curve[1] 0,0,$19,128,$20,255,$21 ++apply_curve[2] 0,0,$22,128,$23,255,$24 ++apply_curve[3] 0,0,$25,128,$26,255,$27 +add[-1,-2,-3] +add[1,4] +add[2,4] +add[3,4] +a[-1,-2,-3] c ++sub[0,1] ++rgb2hsv[0] split[-1] c remove[-1,-3] mul[-1] 255 +apply_curve[-1] 0,0,$28,64,$29,128,$30,192,$31,255,$32 +compose_multiply[-1,-2] ++sub[0,-1] +if $33==0 +luminance[0] ++luminance[-1] +compose_grainextract[-1,-2] +compose_grainmerge[0,-1] +keep[0] +fi +if $33==1 +keep[-1] +c 0,255 +fi +if $33==2 +keep[-1] +n 0,255 +fi +done a c done done +variance_noise : +u {${-std_noise}^2} +Saturation_EQ_p: +repeat $! l[$>] +apply_parallel_overlap "Saturation_EQ ${1-19}", +done done +Saturation_EQ: +repeat $! l[$>] split_opacity l[0] +to_rgb rgb2hsl8 +split[-1] c ++apply_curve[2] .5,0,{128+$1},31,{128+$2},63,{128+$3},95,{128+$4},128,{128+$5},160,{128+$6},192,{128+$7},224,{128+$8},255,{128+$9} +++[0] {((($19/360)*255))*-1} +mod[-1] 255 +apply_curve[-1] .5,0,{128+$10},31,{128+$11},63,{128+$12},95,{128+$13},128,{128+$14},160,{128+$15},192,{128+$16},224,{128+$17},255,{128+$18} +sub[-1,-2] 128 +add[-1,-2] +mul[-1] 2 +add[1,3] +c[1] 0,255 +append c +hsl82rgb +done a c done done +_fx_select_color : +if $1==1 to_rgb +elif $1==2 to_rgb rgb2ycbcr +elif $1==3 channels 0 +elif $1==4 channels 1 +elif $1==5 channels 2 +elif $1==6 to_rgba channels 3 +elif $1==7 to_rgb rgb2ycbcr channels 0 +elif $1==8 to_rgb rgb2ycbcr channels 1,2 +elif $1==9 to_rgb rgb2hsv channels 0 +elif $1==10 to_rgb rgb2hsv channels 1 +fi +fx_select_color : +($5^$6^$7^$8) _fx_select_color. $1 color={^} rm. +foreach { +to_rgba ++_fx_select_color $1 +select_color[1] $2%,$color +if $4 +area. 0,0 <=. {round($4^1.5)} inpaint.. .,0,3 rm. fi +b[1] $3 n[1] 0,255 +if $9==0 sh[0] 100% &. [1] +elif $9==1 rm[0] +elif $9==2 -[1] 255 *[1] -1 sh[0] 100% &. [1] +elif $9==3 rm[0] - 255 * -1 +else +/[1] 255 +*[0,1] +*[1] $11 +*[1] $12 +*[1] $13 *[1] $10 a[1,-3--1] c -[1,2] + +fi +k[0] +} +fx_select_color_preview : +gui_split_preview "fx_select_color $*",${-3--1} +fx_selective_desaturation : +foreach { +to_color split_opacity l[0] { ++fc $1,$2,$3 +-[1] [0] norm[1] /[1] {1e-6+iM} +if $4 *[1] -{max(0.01,$5)} +[1] 1 +else >=[1] {5*$5}% +fi +c[1] 0,1 +rgb2hsl[0] s[0] c +mM={[im,iM]} repeat $6 { guided. [2],1,0.1 } n. $mM +if $7==0 *[1,-1] +elif $7==1 ($1^$2^$3) rgb2hsl. *[1] {i[1]} rm[-2,-1] +else rv[1,-1] rm. +fi +a c hsl2rgb +} +a c +} +fx_selective_desaturation_preview : +gui_split_preview "fx_selective_desaturation $*",${-3--1} +fx_sepia : +sepia adjust_colors ${1-3},0,0,0,255 +fx_sepia_preview : +gui_split_preview "fx_sepia $*",${-3--1} +fx_simulate_film : +category=${arg0\ $1,bw,instant_consumer,instant_pro,fujixtransiii,negative_color,negative_new,negative_old,print,colorslide} +presets=${-_fx_cluts_$category} +index={arg(1+$1,${2-10})} +thumbsize,strength,brightness,contrast,gamma,hue,saturation,normalize=${11-18} +if $normalize==1" || "$normalize==3 +foreach { split_opacity balance_gamma[0] , a c } +fi +if $index>=2 +path_clut=${-path_cache} +name=${arg0\ $index-2,$presets} +clut $name,{0$_is_preview" && "!isfile(['{/${path_clut}clut_$name.cimgz}'])?17:48} +repeat $!-1 { if $strength<100 +map_clut[$>] . j[$>] .,0,0,0,0,{$strength%} rm. else map_clut[$>] . fi } +rm. +adjust_colors $brightness,$contrast,$gamma,$hue,$saturation,0,255 +if $normalize==2" || "$normalize==3 foreach { split_opacity n[0] 0,255 a c } fi +elif $index==1 +adjust_colors $brightness,$contrast,$gamma,$hue,$saturation,0,255 +if $normalize==2" || "$normalize==3 foreach { split_opacity n[0] 0,255 a c } fi +else +foreach { if max(w,h)>$thumbsize rr2d $thumbsize,$thumbsize,0,2 fi } +N=$! +to "Original",1%,1%,7.5%,2,0.5 +Np={narg($presets)} +repeat $Np { +clut_name=${arg0\ $>,$presets} +clut $clut_name mv. $N +repeat $N { +if $strength<100 [$>] +map_clut. [$N] j.. .,0,0,0,0,{$strength%} rm. else +map_clut[$>] [$N] fi +adjust_colors. $brightness,$contrast,$gamma,$hue,$saturation,0,255 +if $normalize==2" || "$normalize==3 l. { split_opacity n[0] 0,255 a c } fi +strcapitalize $clut_name clut_name=${} +to. $clut_name,1%,1%,7.5%,2,0.5 +} +rm[$N] +progress {$>*100/($Np-1)} +} +k[$N--1] frame 1,1,0,0,0,255 - 128 append_tiles {s=floor(sqrt($!));w>h?[s,0]:[0,s]} + 128 +fi +fx_simulate_film_preview : +_is_preview=1 +index={arg(1+$1,${2-10})} +if !$index gui_warning_preview "Preview disabled in 'Collage' mode" +else gui_split_preview "fx_simulate_film $*",${19-21} +fi +u "{$1}{$2}_"{2*($1==0)}"{$3}_"{2*($1==1)}"{$4}_"{2*($1==2)}"{$5}_"{2*($1==3)}"{$6}_"{2*($1==4)}"{$7}_"{2*($1==5)}"{$8}_"{2*($1==6)}"{$9}_"{2*($1==7)}"{$10}_"{2*($1==8)}"{$11}_"{1+!$index}"{$12}{$13}{$14}{$15}{$16}{$17}{$18}{$19}{$20,$21}" +_fx_cluts_bw : +u agfa_apx_100,agfa_apx_25,fuji_neopan_1600,fuji_neopan_acros_100,ilford_delta_100,ilford_delta_3200,ilford_delta_400,ilford_fp_4_plus_125,ilford_hp_5_plus_400,ilford_hps_800,ilford_pan_f_plus_50,ilford_xp_2,kodak_bw_400_cn,kodak_hie_hs_infra,kodak_t-max_100,kodak_t-max_3200,kodak_t-max_400,kodak_tri-x_400,polaroid_664,polaroid_667,polaroid_672,rollei_ir_400,rollei_ortho_25,rollei_retro_100_tonal,rollei_retro_80s +_fx_cluts_instant_consumer : +u 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_+,polaroid_px-680_cold_++,polaroid_px-680_cold_++_alt,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 +_fx_cluts_instant_pro : +u fuji_fp-100c_--,fuji_fp-100c_-,fuji_fp-100c,fuji_fp-100c_alt,fuji_fp-100c_+,fuji_fp-100c_++,fuji_fp-100c_++_alt,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_++,fuji_fp-100c_negative_++_alt,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,polaroid_665_--,polaroid_665_-,polaroid_665,polaroid_665_+,polaroid_665_++,polaroid_665_negative_-,polaroid_665_negative,polaroid_665_negative_+,polaroid_665_negative_hc,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_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_++ +_fx_cluts_fujixtransiii : +u fuji_xtrans_iii_acros,fuji_xtrans_iii_acros+g,fuji_xtrans_iii_acros+r,fuji_xtrans_iii_acros+ye,fuji_xtrans_iii_astia,fuji_xtrans_iii_classic_chrome,fuji_xtrans_iii_mono,fuji_xtrans_iii_mono+g,fuji_xtrans_iii_mono+r,fuji_xtrans_iii_mono+ye,fuji_xtrans_iii_pro_neg_hi,fuji_xtrans_iii_pro_neg_std,fuji_xtrans_iii_provia,fuji_xtrans_iii_sepia,fuji_xtrans_iii_velvia +_fx_cluts_negative_color : +u agfa_ultra_color_100,agfa_vista_200,fuji_superia_200,fuji_superia_hg_1600,fuji_superia_reala_100,fuji_superia_x-tra_800,kodak_ektar_100,kodak_elite_100_xpro,kodak_elite_color_200,kodak_elite_color_400,kodak_portra_160_nc,kodak_portra_160_vc,lomography_redscale_100 +_fx_cluts_negative_new : +u fuji_160c_-,fuji_160c,fuji_160c_+,fuji_160c_++,fuji_400h_-,fuji_400h,fuji_400h_+,fuji_400h_++,fuji_800z_-,fuji_800z,fuji_800z_+,fuji_800z_++,ilford_hp_5_-,ilford_hp_5,ilford_hp_5_+,ilford_hp_5_++,kodak_portra_160_-,kodak_portra_160,kodak_portra_160_+,kodak_portra_160_++,kodak_portra_400_-,kodak_portra_400,kodak_portra_400_+,kodak_portra_400_++,kodak_portra_800_-,kodak_portra_800,kodak_portra_800_+,kodak_portra_800_++,kodak_portra_800_hc,kodak_tmax_3200_-,kodak_tmax_3200,kodak_tmax_3200_+,kodak_tmax_3200_++,kodak_tmax_3200_alt,kodak_tri-x_400_-,kodak_tri-x_400,kodak_tri-x_400_+,kodak_tri-x_400_++,kodak_tri-x_400_alt +_fx_cluts_negative_old : +u ilford_delta_3200_-,ilford_delta_3200,ilford_delta_3200_+,ilford_delta_3200_++,fuji_neopan_1600_-,fuji_neopan_1600,fuji_neopan_1600_+,fuji_neopan_1600_++,fuji_superia_100_-,fuji_superia_100,fuji_superia_100_+,fuji_superia_100_++,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_1600_-,fuji_superia_1600,fuji_superia_1600_+,fuji_superia_1600_++,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_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_++ +_fx_cluts_print : +u fuji_3510_constlclip,fuji_3510_constlmap,fuji_3510_cuspclip,fuji_3513_constlclip,fuji_3513_constlmap,fuji_3513_cuspclip,kodak_2383_constlclip,kodak_2383_constlmap,kodak_2383_cuspclip,kodak_2393_constlclip,kodak_2393_constlmap,kodak_2393_cuspclip +_fx_cluts_colorslide : +u agfa_precisa_100,fuji_astia_100f,fuji_fp_100c,fuji_provia_100f,fuji_provia_400f,fuji_provia_400x,fuji_sensia_100,fuji_superia_200_xpro,fuji_velvia_50,fuji_astia_100_generic,fuji_provia_100_generic,fuji_velvia_100_generic,kodak_kodachrome_64_generic,kodak_ektachrome_100_vs_generic,kodak_e-100_gx_ektachrome_100,kodak_ektachrome_100_vs,kodak_elite_chrome_200,kodak_elite_chrome_400,kodak_elite_extracolor_100,kodak_kodachrome_200,kodak_kodachrome_25,kodak_kodachrome_64,lomography_x-pro_slide_200,polaroid_669,polaroid_690,polaroid_polachrome +#@cli afre_softlight : -100<=amount<=100,_reverse_order={ 0 | 1 } +#@cli : Blend image with itself or another image using softlight. +#@cli : Default values: 'amount=50' and 'reverse_order=0'. +afre_softlight : check "${1=50}>=-100 && isbool(${2=0}) && $1<=100" +if !$1 return fi +if $!>2 error[] "\n[afre]>_<) softlight: Select 1-2 images." +elif $!==2&&$2 rv e0=" in reverse order" +elif $!==1 . e1=" itself and" +elif w#0!=w||h#0!=h||s#0!=s error[] "\n[afre]>_<) softlight: Select images with the same dimensions." fi +if s#0!=1?s#0!=3 error[] "\n[afre]>_<) softlight: Select image(s) with 1 or 3 channels (I or RGB)." fi +if $1<0 negate. fi +e[] "[afre]^_^) softlight: Blend image$?"${e0}" using"${e1}" amount=$1." +iM={0,iM} / $iM f.. "begin(const A=0.5*abs($1)/100+0.5); +i#0^((A*2)^(A*(1-2*i#1)))" *.. $iM rm. +afre_softlight_preview : +afre_softlight $* +gcd_hio_levels : skip ${1=1},${2=1},${3=39},${4=0},${5=1},${6=1},${7=0},${8=0},${9=0},${10=0} +if $8 _gcd_hio_levels[0] ${1--4} else _gcd_hio_levels ${1--4} fi +if $10" && "$!>1 rv blend alpha fi +_gcd_hio_levels : skip ${1=1},${2=1},${3=39},${4=0},${5=1},${6=1},${7=0} +repeat $! l[$>] +split_opacity to_rgb[0] +gcd_srgb2luma[0] +if $4!=0 +sh[0] 0 sh[0] 1 sh[0] 2,2 +({$3%360}^1^1) hsv2rgb. max. 0 *. $4 -. {ia} ++[-4] {@0} +... {@1} +.. {@2} rm[-4--1] max[0] 0 +fi +gcd_hue_chroma[0] $3,$1,$2 +gcd_srgb2jpeg[0] j[0] . rm. +max[0] 0 sh[0] 0 srgb={($5!=1" || "$6!=1)" && "$7} +if $srgb srgb2rgb. fi +gcd_gamma. $5 +if $6!=1 +m={iM/2} -. $m +sign. abs.. +gcd_gamma.. $6,1,$m *[-2,-1] +. $m +fi +if $srgb rgb2srgb. fi +rm. gcd_jpeg2srgb[0] a c c 0,255 +done done +gcd_hio_levels_preview : +if $-2==7 gcd_hio_levels ${1--2},1 +else gui_split_preview "gcd_hio_levels $*",$-2 fi +gcd_hue_chroma : skip ${1=0},${2=1},${3=1} +if $2==1" && "$3==1 return fi +repeat $! l[$>] +h={($1%360)/60} x={1-abs($h%2-1)} y={if($x>0,1/$x,0)} h={int($h)+1} +p={arg($h,0,1,1,2,2,0)} s={arg($h,1,0,2,1,0,2)} z={arg($h,2,2,0,0,1,1)} +[0] sh. $p sh.. $s +*.. $x ++le. .. j... ..,0,0,0,0,1,. rm.. +eq. 0 +*.. $y j[-4] .,0,0,0,0,1,.. +rm[-4--1] sh. $z f. 0 rm. +sh. $p +compose_channels[0] min +eq.. 0 +. ... +if $3!=1 ++/[-2,-1] -. 1 r. 100%,100%,1,3 *. [-5] +[0] . ++compose_channels[0] min -[0] . *[0] $3 +[0,-1] -[0,-1] +fi +if $2!=1 +-[-3,-2] *. $2 +[-3,-1] /[-2,-1] -. 1 *[-3,-1] rm. + +else k[0] fi +done done +iain_tone_presets_p: +repeat $! l[$>] +apply_parallel_overlap "iain_tone_presets ${1--2}",0,${-1} +done done +iain_tone_presets: +repeat $! l[$>] split_opacity l[0] +if $1==0 ++iain_rgb_tone 00,10,00,00,00,00,00,00,00,00,00,00,00,10,00,00,00,00,00,20,00,00,20,00,00,00,00,255,0,0,0,0,0 +fi +if $1==1 ++iain_cmyk_tone 00,00,00,00,00,00,-8,-20,00,00,00,-49,00,00,00,00,00,00,00,-25,00,00,17,0,00,00,00,00,00,00,35,-25,17,8,26,31,00,00,00,00,17,00,-9,-31,29,00,00,-9,188,255,181,133,72,1 +fi +if $1==2 ++iain_cmyk_tone 00,-38,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,-164,88,255,00,00,00,00,00,00,00,00,00,65,33,-15,00,00,00,00,00,00,00,00,00,00,00,-25,128,92,62,45,38,1 +fi +if $1==3 ++iain_cmyk_tone -25,50,00,25,00,00,25,00,00,00,00,00,025,25,00,-50,00,00,25,00,00,00,00,00,025,00,00,25,00,00,-50,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,36,178,255,169,94,2 +fi +if $1==4 ++iain_cmyk_tone 25,-50,00,-25,00,00,-25,00,00,00,00,00,-025,-25,00,50,00,00,-25,00,00,00,00,00,-025,00,00,-25,00,00,50,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,17,120,240,255,255,4 +fi +if $1==5 ++iain_cmyk_tone 000,00,00,00,00,00,00,00,00,00,00,-60,000,00,00,00,00,00,00,00,00,-22,40,161,000,00,00,0,00,00,00,00,28,33,33,16,00,00,00,00,00,00,00,00,00,77,-8,-80,255,255,255,255,255,0 +fi +if $1==6 ++iain_cmyk_tone 000,00,00,00,00,00,00,00,00,00,00,00,000,00,00,00,00,00,00,00,00,07,-20,-33,000,00,00,00,00,00,00,00,00,48,-65,-77,000,00,00,00,00,00,00,00,00,45,45,00,255,255,255,255,255,0,0 +fi +if $1==7 ++iain_cmyk_tone 000,20,00,00,08,00,00,00,00,00,-23,00,000,-13,00,0,17,00,00,00,00,-1,29,00,000,00,00,00,00,-12,00,00,00,19,68,18,000,00,00,00,00,00,00,00,00,-5,55,-15,128,255,255,255,255,0,0 +fi ++sub[0,1] +mul[-1] {{$2/100}*-1} ++[0,-1] +keep[0] +if $3==0 +c 0,255 +else +n 0,255 +fi +done a c done done +fx_transfer_histogram : +to_rgb +ref={$2?0:-1} +match_histogram[^$ref] [$ref],256,$1 +c 0,255 +fx_transfer_histogram_preview : +if $!<2 gui_print_preview "Warning:",,"This filter requires at least two input layers to work properly." return fi +ref={$2?0:-1} ++store[$ref] _fx_trgb_ref +gui_split_preview[^$ref] "$_fx_trgb_ref fx_transfer_histogram $1,0 rm.",${-3--1} +_fx_trgb_ref= +mv[$ref] $! +repeat $!-1 { l[$>,-1] { +rr2d[0] $_preview_area_width,$_preview_area_height,0,3 rr2d. {0,[w,h]/3},0,3 +to. Reference,2,2,13,1,1,255 frame. 2,2,255 frame. 1,1,0 +j[0] .,$3%,$4% +rm. +} } +fx_gcd_transfer_colors_patch : skip ${1=6},${2=3},${3=5},${4=5},${5=0},${6=0} +ref={if($5,$!-1,0)} n=$! ++gcd_extract_clut[$ref] ${1-4} +map_clut[^-1,$ref] . +if $6>0" || "$n==1 +r,s={arg(max($6,1),64,256)},{arg(max($6,1),512,4096)} +r. $r,$r,$r,3,3 r. $s,$s,1,3,-1 +else rm. fi +fx_gcd_transfer_colors_patch_preview : +fx_gcd_transfer_colors_patch $* +if !$5 rm[0] fi +fx_transfer_pca : +to_rgb +ref={$2?0:-1} +match_pca[^$ref] [$ref],$1 +c 0,255 +fx_transfer_pca_preview : +if $!<2 gui_print_preview "Warning:",,"This filter requires at least two input layers to work properly." return fi +ref={$2?0:-1} ++store[$ref] _fx_trgb_ref +gui_split_preview[^$ref] "$_fx_trgb_ref fx_transfer_pca $1,0 rm.",${-3--1} +_fx_trgb_ref= +mv[$ref] $! +repeat $!-1 { l[$>,-1] { +rr2d[0] $_preview_area_width,$_preview_area_height,0,3 rr2d. {0,[w,h]/3},0,3 +to. Reference,2,2,13,1,1,255 frame. 2,2,255 frame. 1,1,0 +j[0] .,$3%,$4% +rm. +} } +fx_transfer_rgb : +to_rgb +ref={$4?0:-1} +match_rgb[^$ref] [$ref],0.25,$1,$2,{2^(4+$3)},$5,0 +c 0,255 +fx_transfer_rgb_preview : +if $!<2 gui_print_preview "Warning:",,"This filter requires at least two input layers to work properly." return fi +ref={$4?0:-1} ++store[$ref] _fx_trgb_ref +gui_split_preview[^$ref] "$_fx_trgb_ref fx_transfer_rgb $1,$2,0,0,0 rm.",${-3--1} +_fx_trgb_ref= +mv[$ref] $! +repeat $!-1 { l[$>,-1] { +rr2d[0] $_preview_area_width,$_preview_area_height,0,3 rr2d. {0,[w,h]/3},0,3 +to. Reference,2,2,13,1,1,255 frame. 2,2,255 frame. 1,1,0 +j[0] .,$6%,$7% +rm. +} } +_fx_tune_hsv : +mode_dark,Rdark,Gdark,Bdark,Hdark,Sdark,Vdark,mode_light,Rlight,Glight,Blight,Hlight,Slight,Vlight,mode_avg,Ravg,Gavg,Bavg,Havg,Savg,Vavg,mode_red,Rred,Gred,Bred,Hred,Sred,Vred,mode_yellow,Ryellow,Gyellow,Byellow,Hyellow,Syellow,Vyellow,mode_green,Rgreen,Ggreen,Bgreen,Hgreen,Sgreen,Vgreen,mode_cyan,Rcyan,Gcyan,Bcyan,Hcyan,Scyan,Vcyan,mode_blue,Rblue,Gblue,Bblue,Hblue,Sblue,Vblue,mode_magenta,Rmagenta,Gmagenta,Bmagenta,Hmagenta,Smagenta,Vmagenta,preview_mapping=${1-64} +all_colors=dark,light,avg,red,yellow,green,cyan,blue,magenta +foreach { split_opacity l[0] { +to_rgb +colors,sep= +repeat narg($all_colors) { color=${arg0\ $>,$all_colors} if ${mode_$color} colors.=$sep$color sep=, fi } ++srgb2lab channels. 0 darklight={"[I(#-2,xm,ym),I(#-2,xM,yM)]"} rm. +dark={[$darklight][0,3]} light={[$darklight][3,3]} ++r. 1,1,1,3,2 avg={^} rm. +eval. "> +begin( +red = yellow = green = cyan = blue = magenta = [0,0,0]; +best_red = best_yellow = best_green = best_cyan = best_blue = best_magenta = inf; +test_color(color,tR,tG,tB) = ( +val = norm([tR,tG,tB]-[R,G,B]); +val] +to_rgb[0] +luminance[0] +luminance[0] +luminance[0] +fx_mix_lab[0] $2,{$1*10},0,$3,0,0,$3,0,0,0,2,0 +tk_fx_channel_processing. 1,1,0,0,4,{$4/2.55},100,256,0,1,0,2,0,0 +tk_fx_channel_processing.. 1,1,0,0,4,{$4/2.55},{$5/2.55},256,0,0,0,2,0,0 +tk_fx_channel_processing... 1,1,0,0,4,0,{$5/2.55},256,0,1,0,2,0,0 +to_gray[-1,-2,-3] fx_gaussian_blur[-1,-2,-3] $6,0,0,1,0,0,0 ++fc[0] $7,$8,$9 +fc[0] $11,$12,$13 +fc[0] $15,$16,$17 to_rgba[-1,-2,-3] +s. c rv[-1,-9] compose_multiply[-1,-9] mv[-8] 9 a[-4,-3,-2,-1] c +s.. c rv[-2,-8] compose_multiply[-2,-8] mv[-7] 7 a[-5,-4,-3,-2] c +s... c rv[-3,-7] compose_multiply[-3,-7] mv[-6] 5 a[-6,-5,-4,-3] c ++fc[0] $19,$20,$21 rv[-1,-5] +if $22==0 fx_compose_exclusion[-1,-5] $23 +elif $22==1 fx_compose_overlay[-1,-5] $23 +elif $22==2 fx_compose_softlight[-1,-5] $23 +elif $22==3 fx_compose_multiply[-1,-5] $23 +elif $22==4 fx_compose_screen[-1,-5] $23 +fi +rv[-3,-4] fx_compose_lighten[-3,-4] $10 +rv[-2,-3] fx_compose_overlay[-2,-3] $14 +rv[-1,-2] fx_compose_darken[-1,-2] $18 +if $25!=0 ++fc[0] 255,255,255 fx_frame_round_old. 2,$24,0,0,0,0,0,255,100,0.1,3 +fx_gaussian_blur. {$6*5},0,0,1,0,0,0 +rv[-1,-2] fx_compose_multiply[-1,-2] $25 fi +done done +fx_tk_vintage_preview : +gui_split_preview "fx_tk_vintage ${1--2}",$-1 +fx_zonesystem : +repeat $! l[$>] to_rgb rgb2lab s c n[0] {{$1-1}*10}%,{$2*10}% +a c lab2rgb tk_fx_channel_processing $3,$4,0,0,0,0,100,256,0,0,0,2,7,0 +fx_apply_curve 0,$5,0,$6,255,-1,128,-1,128,-1,128,255,1,7,0,0,0 +done done +fx_zonesystem_preview : +gui_split_preview "fx_zonesystem ${1--2}",$-1 +fx_convolve : skip "${3=1}" +ac "_fx_convolve $1,$2,\"$3\",${4--5}",$-4 +_fx_convolve : +if $1 _fx_convolve$1[] else ($3) fi +if !$4 *. $5 fi +convolve[0--2] .,$2 +if $4 n 0,255 else c 0,255 fi +rm. +_fx_convolve1 : 3,3 f 1 normalize_sum +_fx_convolve2 : 5,5 f 1 normalize_sum +_fx_convolve3 : 7,7 f 1 normalize_sum +_fx_convolve4 : 9,9 f 1 normalize_sum +_fx_convolve5 : (1,0,-1;1,0,-1;1,0,-1) +_fx_convolve6 : (1,1,1;0,0,0;-1,-1,-1) +_fx_convolve7 : (1,0,-1;2,0,-2;1,0,-1) +_fx_convolve8 : (1,2,1;0,0,0;-1,-2,-1) +_fx_convolve9 : a={0.25*(2-sqrt(2))} b={0.5*(sqrt(2)-1)} ($a,0,-$a;$b,0,-$b;$a,0,-$a) +_fx_convolve10 : a={0.25*(2-sqrt(2))} b={0.5*(sqrt(2)-1)} ($a,$b,$a;0,0,0;-$a,-$b,-$a) +_fx_convolve11 : (0,1,0;1,-4,1;0,1,0) +_fx_convolve12 : (1,0;0,-1) +_fx_convolve13 : (0,1;-1,0) +_fx_convolve14 : 3,3 f 1 r 7,7,1,1,4,0,0.5,0.5 autocrop normalize_sum +_fx_convolve15 : 3,3 f 1 r 9,9,1,1,4,0,0.5,0.5 autocrop normalize_sum +_fx_convolve16 : 3,3 f 1 r 11,11,1,1,4,0,0.5,0.5 autocrop normalize_sum +fx_convolve_preview : skip "${3=1}" +gui_split_preview "fx_convolve $1,$2,\"$3\",${4--1}",${-3--1} +fx_curvature : +foreach { +split_opacity l[0] { +b $1 iee +if $4 abs fi +c $2%,$3% +if $5 negate fi +n 0,255 +} +a c +} +fx_curvature_preview : +gui_split_preview "fx_curvature ${^0}",${-3--1} +fx_dog : +dog $1%,$2% +if $5 norm fi +c $3%,{100-$3}% +if $4 negate fi +n 0,255 +fx_dog_preview : +gui_split_preview "gui_crop_preview fx_dog ${^0} gui_resize_preview",${-3--1} +fx_distance : +foreach { +split_opacity l[0] { +distance $1,$2 +if $3==0 c 0,255 +elif $3==1 n 0,255 +else % $4 n 0,255 +fi +} +a c +} +fx_distance_preview : +gui_split_preview "fx_distance ${^0}",${-3--1} +#@cli afre_edge : method={ 0=gradient | 1=standard_deviation },1<=thinning<=10,0.5<=_recovery<=4,0.5<=_brightness<=4,0.5<=_details<=4 +#@cli : Compute edge of selected images. +#@cli : Default values: 'method=0', 'thinning=1', 'recovery=1', 'brightness=1' and 'details=1'. +afre_edge : check "${2=1}>=1 && ${3=1}>=0.5 && ${4=1}>=0.5 && ${5=1}>=0.5 && +$2<=10 && $3<=4 && $4<=4 && $5<=4" +e[] "[afre]^_^) edge: Compute edge of image$? using method=$1, thinning=$2, recovery=$3, brightness=$4 and details=$5." +repeat $! l[$>] if $1 m "method : afre_sdpatch 1" else m "method : afre_gnorm" fi +method im,ic,iM={[im,ic,iM]} ^ {1/$5} n $im,$iM +repeat $2 +afre_box 1 method. r={[im,iM]} ^. $3 n. $r - done +c $ic,$iM ^ {1/$4} n 0,$iM +done done um method +afre_edge_preview : +afre_edge $* +fx_edges : +to_rgb b $1% edges $2% +if $3 negate fi +n 0,255 +fx_edges_preview : +gui_split_preview "fx_edges ${^0}",${-3--1} +fx_edge_offsets : +repeat $! { +os={s} +b. $1% gradient_norm. >=. $2% skeleton. 0 distance. 1 round. 1 %. $3 >=. {max(1,$3-$4)} +if !$5 negate. fi +n. 0,255 to_colormode. $os +mv. 0 } +fx_edge_offsets_preview : +gui_split_preview "fx_edge_offsets ${^0}",${-3--1} +fx_extract_foreground : +if !$! return fi +resolution={arg(1+$3,512,1024,2048,0)} +foreach { +nm=${-gui_layer_name} +initial_pos=${-gui_layer_pos} +=> "[G"{`39`}"MIC] Interactive Foreground Extraction" +if [$6][0]==-1" || "[$5]!=[w,h] _gui_control_points= else _gui_control_points=$6 fi +status=${x_segment\ $resolution} +sh 3 b. $1% if $2>0 dilate. {1+2*$2} elif $2<0 erode. {1-2*$2} fi +rm. +if $3==1 sh 3 max. 1 rm. +elif $3==2 s c,-3 r. 100%,100%,1,4 rv =>[0] "name(Mask)" =>[1] "name("$nm")" +elif $3==3 +. +sh.. 0,2 +channels... 3,3 >=. 3 *[-2,-1] rm. +sh. 0,2 +channels.. 3,3 <=. {255-3} *[-2,-1] rm. +sh. 3 *. -1 +. 255 rm. +gui_autocrop_layers[0] +pos0=${gui_layer_pos[0]} pos1=${gui_layer_pos[1]} +=>[0] "name("$nm" [foreground]),pos("{``{[$pos0]+[$initial_pos]}}")" +=>[1] "name("$nm" [background]),pos("{``{[$pos1]+[$initial_pos]}}")" +fi +} +if narg($status)>=4 u \{$1\}\{$2\}\{$3\}\{$4\}\{{w},{h}\}\{$status\} else u "" fi +fx_gradient_norm : +b $1 gradient_norm ^ $2 +c $3%,$4% +if $5 negate fi +n 0,255 +fx_gradient_norm_preview : +gui_split_preview "fx_gradient_norm ${^0}",${-3--1} +fx_gradient2rgb : +b $1 gradient2rgb $4 +c $2%,$3% +if $5 negate fi +n 0,255 +fx_gradient2rgb_preview : +gui_split_preview "fx_gradient2rgb ${^0}",${-3--1} +fx_isophotes : +if $3 +topographic_map $1,$2 +else +b $2 isophotes $1 +fi +fx_isophotes_preview : +gui_split_preview "fx_isophotes ${^0}",${-3--1} +fx_laplacian : +b $1 laplacian +if $4 abs fi +c $2%,$3% +if $5 negate fi +n 0,255 +fx_laplacian_preview : +gui_split_preview "fx_laplacian ${^0}",${-3--1} +_fx_local_orientation : +foreach { +split_opacity l[0] { +b $1% gradient_orientation 2 complex2polar rm[0--1:2] +c $2%,$3% +if $4 negate fi +n 0,255 +} +a c +} +fx_local_orientation : +ac "_fx_local_orientation $1,$2,$3,$4",$5,2 +fx_local_orientation_preview : +gui_split_preview "fx_local_orientation ${^0}",${-3--1} +fx_morphological : +ac "_fx_morphological ${1-3},\"$4\",${5-6}",$7,$8 +fx_morphological_preview : +gui_split_preview "fx_morphological ${1-3},\"$4\",${5--1}",${-3--1} +if $2==3 +('"$4"') f. "(i>=_'0' && i<=_'9') || i==_',' || i==_';'?i:-1" +discard. -1 ({t}) rr2d. {0,max(24,w/6)},{0,max(24,h/6)},0,1 >. 0 *. 255 +to_rgba. frame. 1,1,0,0,0,0,255 frame. 1,1,255 frame. 1,1,0,0,0,0,255 +j[^-1] .,2,2,0,0,0.75 rm. +else +fi +_fx_morphological : +('"$4"') f. "(i>=_'0' && i<=_'9') || i==_',' || i==_';'?i:-1" discard. -1 ckernel={t} rm. +if $2==0 +m "my_erode: erode $""1" +m "my_dilate: dilate $""1" +m "my_opening : opening $""1" +m "my_closing : closing $""1" +elif $2==1 +m "my_erode: erode_oct $""1" +m "my_dilate: dilate_oct $""1" +m "my_opening : opening_circ $""1" +m "my_closing : closing_circ $""1" +elif $2==2 +m "my_erode: erode_circ $""1" +m "my_dilate: dilate_circ $""1" +m "my_opening : opening_circ $""1" +m "my_closing : closing_circ $""1" +else +m "my_erode : skip $""1 ("$ckernel") erode[^-1] . rm." +m "my_dilate : skip $""1 ("$ckernel") dilate[^-1] . rm." +m "my_opening : skip $""1 ("$ckernel") opening[^-1] . rm." +m "my_closing : skip $""1 ("$ckernel") closing[^-1] . rm." +fi +if $1==0 m "my_action : my_erode $3" +elif $1==1 m "my_action : my_dilate $3" +elif $1==2 m "my_action : my_opening $3" +elif $1==3 m "my_action : my_closing $3" +elif $1==4 m "my_action : +my_erode $3 -" +elif $1==5 m "my_action : +my_dilate $3 rv -" +elif $1==6 m "my_action : +my_opening $3 -" +elif $1==7 m "my_action : +my_closing $3 rv -" +elif $1==8 m "my_action : +my_opening $3 +my_closing.. $3 +[-2,-1] /. 2 -" +else m "my_action : +my_opening $3 my_closing.. $3 -" +fi +foreach { +if !$6 split_opacity fi +my_action[0] +a c +} +if $5 foreach { split_opacity negate[0] a c } fi +um my_erode,my_dilate,my_action +fx_segment_watershed : skip ${4=1} +ac "b $2 segment_watershed $1",$3,$4 +fx_segment_watershed_preview : +gui_split_preview "fx_segment_watershed ${^0}",${-3--1} +fx_skeleton : +remove_opacity +b $2% >= 50% +if $1 thinning 1 +else +distance 0 sharpen 1e10 >= 100% +repeat $! { +erode[$>] 2 -[$>,-1] } +fi +* 255 +fx_skeleton_preview : +gui_split_preview "fx_skeleton ${^0}",${-3--1} +fx_superpixels : +foreach { ++srgb2lab slic. ${1-3} +if $4 +blend shapeaverage else +map. 2,2 fi +if $5 f[1] "i!=j(1,0) || i!=j(0,1)" [0],[0],1,4 fc. ${6-9} to_rgba.. j.. .,0,0,0,0,$5,... k.. +else k. +fi +} +fx_superpixels_preview : +gui_split_preview "fx_superpixels ${^0}",${-3--1} +fx_thin_edges : +b $1% gradient_norm >= $2% thinning 1 +if !$3 negate fi +n 0,255 +fx_thin_edges_preview : +gui_split_preview "fx_thin_edges ${^0}",${-3--1} +fx_breaks : +foreach { +if !$5 to_a fi +100%,100%,1,1,"u<($3%)^6" +if $1 +distance. 1 sharpen. 100000 neq. 0 distance. 1 b. $4 g. xy a[-2,-1] c +else +delaunay. 0 label_fg. 0,1 {1+iM},1,1,2 rand. -30,30 point. 0 map.. . rm. +fi +n. -$2,$2 warp[0] .,1,1,$5 rm. +} +fx_custom_deformation : +if !$5 to_a fi +repeat $! { ++norm. . f.. "$1" f. "$2" +a[-2,-1] c warp.. .,$3,$4,$5,1 rm. +mv. 0 } +fx_circle_transform : +foreach { +to_rgba r={dx=($3-$1)*(w-1)%;dy=($4-$2)*(h-1)%;norm(dx,dy)} +if $7==0 cond="i(X,Y,z,c,$8,$9)" +elif $7==1 cond="if(N<"$r",i(X,Y,z,c,$8,$9),i)" +else cond="if(N>"$r",i(X,Y,z,c,$8,$9),i)" +fi +f "U = x - w*$1%; +V = y - h*$2%; +N = sqrt(U*U + V*V); +Nr = N - "$r"; +X = x + $5*Nr*U/N; +Y = y + $6*Nr*V/N; +"$cond +} +fx_circle_transform_preview : +fx_circle_transform $* +if $10 +rr2d ${-gui_preview_wh},0,1 +foreach { +x0,y0={[$1,$2]*([w,h]-1)%} +r={dx=($3-$1)*(w-1)%;dy=($4-$2)*(h-1)%;norm(dx,dy)} +circle $x0,$y0,{$r-1},1,0xFFFFFFFF,0,0,0,255 +circle $x0,$y0,{$r+1},1,0xFFFFFFFF,0,0,0,255 +circle $x0,$y0,$r,1,0xFFFFFFFF,0,255,0,255 +} +fi +fx_conformal_maps : +to_a +expr0="$4" +expr1="z" +expr2="(z+1)/(z-1)" +expr3="cos(z)" +expr4="sin(z)" +expr5="tan(z)" +expr6="exp(z)" +expr7="log(z)" +expr8="1/(4*z^2-1)" +expr9="-5*(z^3/3-z/4)/2" +('${expr$1}') +replace_str. "*","**" +replace_str. "/","//" +replace_str. "^","^^" +replace_str. "exp(","cexp(" +replace_str. "log(","clog(" +replace_str. "cos(","ccos(" +replace_str. "sin(","csin(" +replace_str. "tan(","ctan(" +expr={t} +rm. +foreach { +wh={$12?[$13,$14]:[w,h]} +{(1+$11)*[$wh]},1,100% +f. "begin( +ccos(z) = (iz = [ -z[1],z[0] ]; (cexp(iz) + cexp(-iz)/2)); +csin(z) = (iz = [ -z[1],z[0] ]; (cexp(iz) - cexp(-iz)/2)); +ctan(z) = csin(z)//ccos(z); +boundary = $10; +interpolation = 1; +const f = max(w,h); +const f0 = max(w#0,h#0); +i = [0,1]; +); +z = (2*[ x,y ] - [ w,h ])/f; +z = rot(-$6°)*z; +z-= [ $8, $9 ]; +z/=[ 10^($5 + $7), 10^$5 ]; +z = ("$expr"); +if ($1, z = z^^[$2,$3]); +z = rot($6°)*z; +z = 0.5*(f0*z + [w#0,h#0]); +I(#0,z)" +r. $wh,1,100%,2 +rm.. +} +fx_conformal_maps_preview : +fx_conformal_maps ${1-3},"$4",${5-11},0,0,0 +souphead_droste10 : +_souphead_droste10 ${1-26},0,${28-31} +souphead_droste10_preview : +_souphead_droste10 ${1--1} +_souphead_droste10 : +repeat $! l[$>] +to_a ++f. 0 +sh. 0 +f. "* +begin(InnerRadius = $1; +OuterRadius = $2; +Periodicity = $3; +Strands = $4; +Zoom = $5; +Rotate = $6; +XShift = $7; +YShift = $8; +XCenterShift = $9; +YCenterShift = $10; +StartingLevel = $11; +NumberOfLevels = $12; +LevelFrequency = $13; +ShowBothPoles = $14; +PoleRotation = $15; +PoleLong = $16; +PoleLat = $17; +TilePoles = $18; +HyperDroste = $19; +FractalPoints = $20; +AutoSetPeriodicity = $21; +NoTransparency = $22; +ExternalTransparency = $23; +MirrorEffect = $24; +Untwist = $25; +DoNotFlattenTransparency = $26; +ShowGrid = $27; +ShowFrame = $28; +Antialias = $29; +XEdgeType = $30; +YEdgeType = $31; +r1 = InnerRadius/100; +r2 = OuterRadius/100; +p1 = Periodicity; +p2 = Strands; +xCenterShift = XCenterShift/100; +yCenterShift = YCenterShift/100; +W = (w-1)/2; +H = (h-1)/2; +xShift = (XShift*w/W)/100; +yShift = (YShift*h/H)/100; +tileBasedOnTransparency=!(NoTransparency); +transparentPointsIn=!(ExternalTransparency); +levelsToLookOut=StartingLevel; +levelToShow=LevelFrequency; +retwist=!(Untwist); +if (AutoSetPeriodicity,p1=p2/2*(1+sqrt(1-(log(r2/r1)/pi)^2))); +if (p1>0,rotate=-(pi/180)*Rotate,rotate=(pi/180)*Rotate); +zoom=(Zoom+InnerRadius-1)/100; +epsilon=0.01; +if(retwist,xbounds0=-r2;xbounds1=r2;ybounds0=-r2;ybounds1=r2,ybounds0=0;ybounds1=2.1*pi;xbounds0=-log(r2/r1);xbounds1=-xbounds0); +minDimension=min(w,h); +xymiddle=0.5*(xbounds0+xbounds1); +xymiddlei=0.5*(ybounds0+ybounds1); +xyrangex=xbounds1-xbounds0; +xyrangey=ybounds1-ybounds0; +aspectRatio=w/h; +xyrangex=xyrangey*aspectRatio; +xbounds0=xymiddle-0.5*xyrangex; +xbounds1=xymiddle+0.5*xyrangex; +pLat = (PoleLat*w/W)/100; +pLon = (PoleLong*w/W)/100; +alpha=atan(p2/p1*log(r2/r1)/(2*pi)); +f=cos(alpha); +beta=f*cos(alpha); +betai=f*sin(alpha); +if(p2>0,angle=2*pi*p1,angle=-2*pi*p1); +if(MirrorEffect,angle=angle/Strands); +); +X=x-((w-1)/2); +Y=((h-1)/2)-y; +z=xbounds0+(xbounds1-xbounds0)*(X+w/2)/w; +zi=ybounds0+(ybounds1-ybounds0)*(Y+h/2)/h; +if(retwist, +zinitial=z; +zinitiali=zi; +z=z-xShift; +zi=zi-yShift; +expo=cos(rotate); +expoi=sin(rotate); +zmid=(z-xymiddle)/zoom; +zmidi=(zi-xymiddlei)/zoom; +zx=(zmid*expo+zmidi*expoi); +zy=(zmidi*expo-zmid*expoi); +z=xymiddle+zx; +zi=xymiddlei+zy, +zinitial=r1*exp(z)*cos(zi); +zinitiali=r1*exp(z)*sin(zi); +expo=cos(rotate)*zoom; +expoi=sin(rotate)*zoom; +zx=zinitial*expo-zinitiali*expoi; +zy=zinitial*expoi+zinitiali*expo; +zinitial=zx; +zinitiali=zy +); +if(ShowBothPoles, +theta=(pi/180)*PoleRotation; +xx=z; +yy=zi; +div=0.5*(1+xx^2+yy^2+((1-xx^2-yy^2)*cos(theta))-(2*xx*sin(theta))); +xx=xx*cos(theta)+(0.5*(1-xx^2-yy^2)*sin(theta)); +z=xx/div; +zi=yy/div, +if(HyperDroste, +zx=sin(z)*cosh(zi); +zy=cos(z)*sinh(zi); +z=zx; +zi=zy +); +if(TilePoles, +p=sqrt(z*z + zi*zi)^FractalPoints; +frac=FractalPoints*atan2(zi,z); +z=p*cos(frac); +zi=p*sin(frac); +z=2*z; +zi=2*zi; +p=cos(2*z)+cosh(2*zi); +zx=sin(2*z)/p; +zy=sinh(2*zi)/p; +z=zx; +zi=zy +); +); +z=z+pLat; +zi=zi+pLon; +if(retwist, +za=z/r1; +zb=zi/r1; +zx=0.5*log(za*za+zb*zb); +zy=atan2(zb,za); +z2=zx; +z2i=zy, +z2=z; +z2i=zi +); +p=beta*beta+betai*betai; +z=p1*(z2*beta+z2i*betai)/p; +zi=p1*(z2i*beta-z2*betai)/p; +rotatedscaledlogz=z; +rotatedscaledlogzi=zi; +logz=z2; +logzi=z2i; +zx=r1*exp(z)*cos(zi); +zy=r1*exp(z)*sin(zi); +z=zx; +zi=zy; +if(tileBasedOnTransparency && levelsToLookOut>0, +if(!transparentPointsIn, +ratio=r2/r1*cos(angle); +ratioi=r2/r1*sin(angle), +ratio=r1/r2*cos(angle); +ratioi=-r1/r2*sin(angle) +); +p=sqrt(ratio*ratio+ratioi*ratioi)^levelsToLookOut; +q=atan(ratioi/ratio); +rp=p*cos(levelsToLookOut*q); +rpi=p*sin(levelsToLookOut*q); +zx=z*rp-zi*rpi; +zy=z*rpi+zi*rp; +z=zx; +zi=zy; +); +colorSoFarR=0; +colorSoFarG=0; +colorSoFarB=0; +colorSoFarA=0; +alphaRemaining=1; +ix=minDimension/2*(z+xCenterShift); +iy=minDimension/2*(zi+yCenterShift); +realx=ix+((w-1)/2); +realy=((h-1)/2)-iy; +if(realx<0 || realx>=w, +if(XEdgeType==1, +realx=realx%w; +if(realx<0,realx=w+realx) +); +if(XEdgeType==2, +realx=abs(realx%w); +if(realx=h, +if(YEdgeType==1, +realy=realy%h; +if(realy<0,realy=h+realy) +); +if(YEdgeType==2, +realy=abs(realy%h); +if(realyepsilon,sign=-1); +if(!transparentPointsIn && alphaRemaining>epsilon,sign=1), +radius=sqrt(z*z+zi*zi); +if(radiusr2,sign=1) +); +if(sign<0, +ratio=r2/r1*cos(angle); +ratioi=r2/r1*sin(angle) +); +if(sign>0, +ratio=r1/r2*cos(angle); +ratioi=-r1/r2*sin(angle) +); +if(levelToShow>1, +lograt=levelToShow*0.5*log(ratio*ratio+ratioi*ratioi); +lograti=levelToShow*atan2(ratioi,ratio); +ratio=exp(lograt)*cos(lograti); +ratioi=exp(lograt)*sin(lograti) +); +iteration=StartingLevel; +maxiteration=NumberOfLevels+StartingLevel-1; +while(sign!=0 && iteration=w, +if(XEdgeType==1, +realx=realx%w; +if(realx<0,realx=w+realx) +); +if(XEdgeType==2, +realx=abs(realx%w); +if(realx=h, +if(YEdgeType==1, +realy=realy%h; +if(realy<0,realy=h+realy) +); +if(YEdgeType==2, +realy=abs(realy%h); +if(realyepsilon,sign=-1); +if(!transparentPointsIn && alphaRemaining>epsilon,sign=1), +radius=sqrt(z*z+zi*zi); +colorSoFarR=ColorOutR; +colorSoFarG=ColorOutG; +colorSoFarB=ColorOutB; +colorSoFarA=ColorOutA; +if(radiusr2,sign=1) +); +iteration=iteration+1; +); +ColorOutR=colorSoFarR; +ColorOutG=colorSoFarG; +ColorOutB=colorSoFarB; +ColorOutA=colorSoFarA; +if(ShowGrid, +gridzx=(logz+10*log(r2/r1))%log(r2/r1); +gridzy=(logzi+10*2*pi)%(2*pi); +if(gridzx(log(r2/r1)-epsilon) || gridzy(2*pi-epsilon), +ColorOutR=0; +ColorOutG=1; +ColorOutB=0; +ColorOutA=1; +); +gridzx=(rotatedscaledlogz+10*log(r2/r1))%log(r2/r1); +gridzy=(rotatedscaledlogzi+10*2*pi)%(2*pi); +if(gridzx(log(r2/r1)-epsilon) || gridzy(2*pi-epsilon), +ColorOutR=0; +ColorOutG=0; +ColorOutB=1; +ColorOutA=1; +); +); +if(ShowFrame, +gridzx=zinitial; +gridzy=zinitiali; +if(gridzx<(aspectRatio*r2) && gridzx>-(aspectRatio*r2) && gridzy-r2, +dx=min((aspectRatio*r2)-gridzx,gridzx+(aspectRatio*r2)); +dy=min(r2-gridzy,gridzy+r2); +if(dx<(4*epsilon) || dy<(4*epsilon), +ColorOutR=1; +ColorOutG=1; +ColorOutB=1; +ColorOutA=1 +); +if(dx<(2*epsilon) || dy<(2*epsilon), +ColorOutR=0; +ColorOutG=0; +ColorOutB=0; +ColorOutA=1 +), +ColorOutR=0.75*ColorOutR; +ColorOutG=0.75*ColorOutG; +ColorOutB=0.75*ColorOutB; +ColorOutA=1 +); +); +if(!DoNotFlattenTransparency,ColorOutA=1); +i(#1,x,y,0,1)=ColorOutG*255; +i(#1,x,y,0,2)=ColorOutB*255; +i(#1,x,y,0,3)=ColorOutA*255; +ColorOutR*255" +k.. +done done +fx_crease : +foreach { +if !$3 to_a fi +2,2,1,2,{"const w1 = w#-1-1; const h1 = h#-1 - 1; [ 0,w1,0,w1,0,0,h1,h1 ];"} +r. {0,D=$2*[w,h]%;[max(D[0],1),max(D[1],1)]},1,2,3 noise. $1,1 +r. ..,..,1,2,3 warp.. .,0,1,$3 rm. +} +fx_distort_lens : +if !$6 to_a fi +undistort ${1-3},$4%,$5%,$6 +fx_drop_water : +N={$!-$1} +if $N<=0 error "At least two layers are required in this mode." fi +repeat $N { l[{$!-$>-1}] { +nm0={n} nm=${-gui_layer_name} +=> img +srand $5 +if $1 +pass[0] 0 to_a. channels. 100% >=. 50% +r. [0],[0],1,1,0,0,0.5,0.5 +else +100%,100% +rmin={max(0.1,$3*(1-$4%))} rmax={max(0.1,$3)} +repeat 10 { +100%,100% +random3d {max(1,$2)} *3d. {-2,w},{-2,h},0 +j3d.. .,0,0,0,1,1,0,0 rm. +b. {$rmin+($rmax-$rmin)*$>/9}%,0,1 +j.. .,0,0,0,0,0.5 rm. +} +>=. 10% +fi +=> shape ++b[shape] 1% n. 0,30 +=> elevation +g[elevation] xy a[-2,-1] c => grad ++*[grad] {grad,$6*max(w,h)/100} *. [shape] b. $15% ++warp[img] .,1,1,1 rm.. => refraction ++*[grad] -1 100%,100%,1,1,1 a[-2,-1] c orientation. +a={$7*pi/180} ca={-cos($a)} sa={-sin($a)} +mix_channels. ({(1-$10)*$ca},{(1-$10)*$sa},1) c. {100-$8}%,100% n. 0,1 +*. [shape] => spots +mix_channels[grad] ($ca,$sa) +n[grad] 0,1 *[grad] [shape] ++shift[shape] {-$11*$ca}%,{-$11*$sa}%,0,0,1 +-. [shape] >=. 1 b. $13% n. 0,1 +=> shadow +b[shape] $14% n. 0,1 +=>[img] name($nm) +*[shadow] 255 channels[shadow] -1,0 mv[shadow] 1 +=>[shadow] "name("$nm" [shadow]),mode(alpha),opacity("{$12*100}")" +to_a[refraction] sh[refraction] 100% +b[shape] $15% *[-2,-1] rm. +mv[refraction] 2 +=>[refraction] "name("$nm" [refraction]),mode(alpha)" +channels[spots] -1,0 sh[spots] 0 f. 1 rm. *[spots] 255 +=>[spots] "name("$nm" [specular spots]),mode(alpha),opacity("{$9*100}")" +rv[shape,grad] a[grad,shape] c *[grad] 255 b[grad] $15% +=>[grad] "name("$nm" [gradient]),mode(grainmerge)" +rv +if !$16 gui_merge_layers => $nm0 fi +} } +if $1 rm[0] fi +fx_drop_water_preview : +N={$!-$1} +if $N<=0 gui_warning_preview "At least two layers are required in this mode." return fi +if $1 +repeat $N { l[{$!-$>-1}] { +pass[0] 0 mv. 0 +fx_drop_water $* gui_merge_layers +} } +rm[0] +else foreach { fx_drop_water $* gui_merge_layers } +fi +fx_equirectangular2nadirzenith : +if $1 nadirzenith2equirectangular else equirectangular2nadirzenith fi +fx_euclidean2polar : +if !$4 to_a fi +if $5 polar2euclidean $1%,$2%,$3,$4 else euclidean2polar $1%,$2%,$3,$4 fi +fx_flower : +if !$7 to_a fi +amplitude,angle={dx=$3-$1;dy=$4-$2;[norm(dx,dy),-atan2(dy,dx)*180/pi]} +flower $amplitude,$5,$6%,$angle,$1%,$2%,$7 +fx_flower_preview : +fx_flower $* +line $1%,$2%,$3%,$4%,1,0xF0F0F0F0,0 +line $1%,$2%,$3%,$4%,1,0x0F0F0F0F,255 +fx_rotoidoscope : +if !$5 to_a fi +rotoidoscope $1%,$2%,$3,$4%,$5 +fx_kaleidoscope : +if !$7 to_a fi +shift $3%,$4%,0,0,2 kaleidoscope $1%,$2%,$5,$6,$7 +fx_symmetrizoscope : +if !$3 to_a fi +repeat $1 { +ang={$2+180*$>/max(1,$1-1)} +symmetrize 50%,50%,$ang,$3,0,{if($4!=2,$4,$>%2)} +} +fx_morph_interactive : +if [$3][0]!=-1 __x_morph_keypoints=$3 fi +rv +x_morph $1,$2 +repeat $! { gui_set_layer_name[$>] "Morphing ""#"$> gui_set_layer_pos[$>] 0,0 } +rv +u "{$1}{$2}{"$__x_morph_keypoints"}" +fx_morph_interactive_preview : +if $!<2 gui_warning_preview "This filter requires at least two input layers!" return fi +rr2d ${-max_wh},0,3 + n 0,255 +if [$3][0]!=-1 gui_warning_preview "No preview available\n\nKeypoints from previous\nrun have been saved" +else gui_warning_preview "No preview available" +fi +fx_warp_perspective : +if !$8 to_a fi +shift $6%,$7%,0,0,2 warp_perspective $1,$2,$3,$4,$5,$8 +fx_transform_polar : +if !$6 to_a fi +if $1==0 +transform_polar "$4","$5",$2%,$3%,$6 +elif $1==1 +transform_polar R-r,a,$2%,$3%,$6 +else +transform_polar a*R/(2*pi),r*2*pi/R,$2%,$3%,$6 +fi +fx_quadrangle : +at_quadrangle $1%,$2%,$3%,$4%,$5%,$6%,$7%,$8%,${9-10} +fx_quadrangle_preview : +foreach { +if !$10 to_a fi +if $11 +fx_quadrangle $* rr2d. {0,[w,h]},2,3 fi +polygon[{$11==1?1:0}] 4,$1%,$2%,$3%,$4%,$5%,$6%,$7%,$8%,0.25,255 +if $11>=2 +circle[0] $1%,$2%,4,1,0 circle[0] $1%,$2%,3,1,255,0,0 +circle[0] $3%,$4%,4,1,0 circle[0] $3%,$4%,3,1,0,255,0 +circle[0] $5%,$6%,4,1,0 circle[0] $5%,$6%,3,1,64,128,255 +circle[0] $7%,$8%,4,1,0 circle[0] $7%,$8%,3,1,255,255,0 +elif $11>0 +rm[0] +fi +if $!==2 +drgba to[0] Quadrangle to[1] Result frame 1,1,0 ++a x a[0,1] y rr2d ${-gui_preview_wh},0,3 +k[{max(w#0,h#0)>max(w#1,h#1)?0:1}] +fi +} +fx_reflect : +repeat $! { +to_rgba. +rows. {100-$1}%,100% mirror. y water. $7,$8 +s. c +f[-4] "(i*(255-$6) + $6*$3)/255" +f... "(i*(255-$6) + $6*$4)/255" +f.. "(i*(255-$6) + $6*$5)/255" a[-4--1] c +*. '(h^$2-y^$2)/h^$2' a[-2,-1] y +100%,100%,100%,1,$11*$12*(x/w-0.5) +100%,100%,100%,1,$11*$12*(y/h-0.5) +100%,100%,100%,1,"$10*(x/w-0.5) + $9*(y/h-0.5) + $11" +/... . +... 0.5 *... {-3,w} +/[-2,-1] +. 0.5 *. {h} +a[-2,-1] c warp.. .,0,1,0 rm. +mv. 0 } +autocrop 0,0,0,0 +fx_seamcarve : +if $4 +if $!<2 error "Priority mask (top layer) is missing!" fi +_fx_seamcarve +fi +seamcarve $1%,$2%,$4,$5,$3% +if $4 repeat $! { channels[$>] 0,{$>,s-2} } fi +c 0,255 +fx_seamcarve_preview : +if $4 +if $!<2 to_rgb to "Priority mask (top layer) is missing!",5,5,18,2 return fi +_fx_seamcarve +fi +foreach { +w={w} h={h} +seamcarve $1%,$2%,$4,$5,{max($3,10)}% +if $4 channels 0,{s-2} fi +to_rgba r $w,$h,1,100%,0,0,0.5,0.5 +} +c 0,255 +_fx_seamcarve : +mv[0] $! +l. { s c k[0,1] >[1] [0] !=[0] 0 -[0] [1] *[0] -1 + * 256 } +repeat $!-1 { a[$>] .,c } rm. +fx_map_sphere : +rotate {$8*90} +if $6 +repeat $! { +shift. {round(w/2)},0,0,0,2 +columns. {(1-$7/100)*w/2},{(1+$7/100)*w/2} +100% gaussian. {0.1*w},{h},0 100% 100% a[-3--1] c r. ..,..,1,3 +smooth.. .,$6,5,0 rm. +j.. .,{(1-$7/100)*{-2,w}/2} rm. shift. -{round(w/2)},0,0,0,2 +mv. 0 } +fi +shift $5%,0,0,0,2 to_rgba +if $9 +repeat $! { ++rows[$>] 0 r. 1,1,1,4,2 RGBA$>={^} +r. [$>],[$>],1,4 -[$>,-1] +} +fi +map_sphere $1,$2,$3,$4,$10,$11 +if $9 +repeat $! { +(${RGBA$>}) y. c r. [$>],[$>],1,4 +[$>,-1] +} +fi +fx_map_sphere_preview : +fx_map_sphere {w},{h},${3--1} +fx_spherize : +ratio={10^$6} +spherize $1%,$2,$3%,$4%,$5%,$ratio,$7,$8 +cut 0,255 +fx_spherize_preview : +cx,cy=${4,5} +if $9 grid 5%,5%,50%,50%,0.6,255 fi +fx_spherize ${1-3},$cx,$cy,${6--1} +fx_square_circle : +mode,interp,boundary,factx,facty,offx,offy=${1-7} +if !$boundary to_a fi +base="const interpolation = "$interp"; +const boundary = "$boundary"; +const offx = "$offx"%; +const offy = "$offy"%; +const factx = 10^-("$factx"%); +const facty = 10^-("$facty"%); +const w2 = int(w/2); +const h2 = int(h/2);" +if !$mode +f $base" +const tst = 2*sqrt(2); +U = (2*x/(w-1) - 1)*factx + offx; +V = (2*y/(h-1) - 1)*facty + offy; +U2 = U^2; +V2 = V^2; +U2mV2 = U2 - V2; +X = 0.5*(sqrt(max(0,2 + tst*U + U2mV2)) - sqrt(max(0,2 - tst*U + U2mV2))); +Y = 0.5*(sqrt(max(0,2 + tst*V - U2mV2)) - sqrt(max(0,2 - tst*V - U2mV2))); +(X+=1)*=w2 - 0.5; +(Y+=1)*=h2 - 0.5; +I(X,Y)" +else +f $base" +X = (2*x/(w-1) - 1)*factx + offx; +Y = (2*y/(h-1) - 1)*facty + offy; +U = X*sqrt(abs(1 - 0.5*Y^2)); +V = Y*sqrt(abs(1 - 0.5*X^2)); +(U+=1)*=w2 - 0.5; +(V+=1)*=h2 - 0.5; +I(U,V)" +fi +fx_project_stereographic : +is_inverse,centerx,centery,radangx,radangy,rechor,lrblur,dilation,mirror,boundary,ocenterx,ocentery=${1-11} +if $centerx!=$ocenterx" || "$centery!=$ocentery +deltax,deltay={[$radangx,$radangy]-[$ocenterx,$ocentery]} +radangx,radangy={[$centerx,$centery]+[$deltax,$deltay]} +fi +status=\{$is_inverse\}\{$centerx,$centery\}\{$radangx,$radangy\}\{$rechor\}\{$lrblur\}\{$dilation\}\{$mirror\}\{$boundary\}\{$centerx,$centery\} +nradangx,nradangy={[$centerx,$centery]+rot(-90°)*([$radangx,$radangy]-[$centerx,$centery])} +init="const boundary = "$is_inverse?$boundary:2"; +const interpolation = 1; +const dilation = 2^"$dilation"; +const centerx = "$centerx"%*(W-1); +const centery = "$centery"%*(H-1); +const radangx = "$nradangx"%*(W-1) - centerx; +const radangy = "$nradangy"%*(H-1) - centery; +const R = sqrt(radangx^2 + radangy^2); +const theta0 = atan2(radangy,radangx); +const pi2 = 2*pi;" +m "_fx_project_stereographic_mirror : if !$""1 mirror y elif $""1==1 mirror xy elif $""1==3 mirror x fi" +foreach { +if !$boundary to_a fi +if $rechor rotate $rechor,1,3 fi +if $lrblur +100%,1,1,1,!x||x==w-1 shift {round(w/2)},0,0,0,2 b. x,$lrblur% n. 0,1 +b.. x,$lrblur% +r.. .,.,1,1 j... .,0,0,0,0,1,.. k[0] shift {-round(w/2)},0,0,0,2 +fi +if $is_inverse +100%,50%,1,100%,"* +const W = w#0; +const H = h#0; +"$init" +theta = theta0 + x*pi2/w; +phi = (y/h - 0.5)*pi; +z = R*sin(phi); +rho = ((R + z)/(R - z))^(0.5/dilation)*R; +X = centerx + rho*cos(theta); +Y = centery + rho*sin(theta); +I(#0,X,Y)" +_fx_project_stereographic_mirror $mirror +else +_fx_project_stereographic_mirror $mirror +{u=0$_is_preview?min(w,h):max(w,h);[u,u,1,s]},"* +const W = w; +const H = h; +"$init" +X = x - centerx; +Y = y - centery; +theta = atan2(Y,X); +beta = ((X^2 + Y^2)/R^2)^dilation; +z = R*(beta - 1)/(beta + 1); +phi = asin(z/R); +theta = ((theta - theta0)*w#0/pi2)%w#0; +phi = (h#0*(phi/pi + 0.5))%h#0; +I(#0,theta,phi)" +fi +k. } um _fx_project_stereographic +if 0$_is_preview +line $centerx%,$centery%,$radangx%,$radangy%,0.75,0xF0F0F0F0,255,255,255,255 +line $centerx%,$centery%,$radangx%,$radangy%,0.75,0x0F0F0F0F,0,0,0,255 +fi +u $status +fx_project_stereographic_preview : +_is_preview=1 +fx_project_stereographic $"*" +fx_symmetrize : +if !$6 to_a fi +angle={isnan($3)?$5:atan2($4-$2,$3-$1)*180/pi} +symmetrize $1%,$2%,$angle,${6-8} +fx_symmetrize_preview : +fx_symmetrize $* +rr2d ${-gui_preview_wh},0,1 +u,v={angle=isnan($3)?$5*pi/180:atan2($4-$2,$3-$1);[cos(angle),sin(angle)]} +foreach { +x0,y0,x1,y1={V=[$u,$v];([${1,2},${1,2}]+10000*[V,-V])*([w,h,w,h]-1)%} +line $x0,$y0,$x1,$y1,1,0x0F0F0F0F,0,0,0,255 +line $x0,$y0,$x1,$y1,1,0xF0F0F0F0,255 +} +fx_textured_glass : +foreach { +100%,100%,1,1 +if $7 plasma. 1,1,$7 else rand. 0,1 fi +g. xy +if $5 ++gradient_norm... +. 1 b. $6 ^. -$5 +*... . *[-2,-1] +fi +blur_xy[-2,-1] $3,$4 +*.. {-2,$1/max(abs(im),abs(iM))} +*. {$2/max(abs(im),abs(iM))} +a[-2,-1] c +warp.. .,1,1,1 rm. +} +fx_textured_glass_preview : +gui_split_preview "fx_textured_glass $*",${-3--1} +fx_twirl : +if !$4 to_a fi +twirl $1,$2%,$3%,$4 +fx_warp_interactive : +if [$4][0]!=-1 __x_warp_keypoints=$4 fi +x_warp $2,$2,$3,$1 +u "{$1}{$2}{$3}{"$__x_warp_keypoints"}" +fx_warp_interactive_preview : +if [$4][0]!=-1 __x_warp_keypoints=$4 fi +foreach { +rr2d $_preview_area_width,$_preview_area_height,0,3 to_color drgba +if narg($__x_warp_keypoints) ($__x_warp_keypoints) r. 1,{w/4},1,4,-1 +else +nbp,nbq=$2,$2 +1,{$nbp*$nbq},1,4,"const nbp = "$nbp"; const nbq = "$nbq"; +p = y%nbp; +q = int(y/nbp); +x = p*100/(nbp - 1); +y = q*100/(nbq - 1); +[ x,y,x,y ]" +nbc=$3 +if $nbc>0 ++b[0] 0.5 gradient_norm. sqrt. {round([w,h]/4)} gaussian. 20% +1,$nbc,1,4,"> +begin(ref(crop(#-1),gauss)); +st = stats(#-2); +iM = st[1]; +xM = st[8]; +yM = st[9]; +img = vector(#w#-1*h#-1,-iM); +draw(#-2,img,xM - w#-1/2,yM - h#-1/2,0,0,w#-1,h#-1,1,1,-1,gauss); +nxyM = [ xM,yM ]*100/([w#-2,h#-2]-1); +[ nxyM,nxyM ]" +rm[-3,-2] +a[-2,-1] y +fi +fi ++_x_warp_rbf. {0,round([w,h]/4)} *. 4 r. [0],[0],1,100%,3 +. '[x,y]' warp[0] .,0,1,3 rm. +eval. "* +begin( +col1 = [ 64,200,255 ]; +const radius1 = 3; +const radius2 = radius1 + 2; +fact = ([ w#0,h#0 ] - 1)% +); +X = (I)[0,2]*fact; +ellipse(#0,X,radius2,radius2,0,1,0); +ellipse(#0,X,radius1,radius1,0,1,col1); I" +rm. +if narg($__x_warp_keypoints) +0 t. "Keypoints from previous\nrun have been saved",0,0,24,1,255 +frame. 5,5,0 +dilate_circ. 5 a[-2,-1] c blend alpha +fi +} +fx_wind : +if !$5 negate fi +ac "wind ${1-4}",$6,$7 +if !$5 negate fi +fx_wind_preview : +gui_split_preview "fx_wind $*",${-3--1} +fx_zoom : +if !$4" && "$1<1 to_a fi +zoom $1,{$2%},{$3%},0,$4 +fx_simulate_grain : +__fx_simulate_grain ${arg\ {1+$1},${-_fx_simulate_grain}},${2-11},0,0 +_fx_simulate_grain : +u orwo_np20,kodak_tmax400,kodak_tmax3200,kodak_trix1600,unknown +fx_simulate_grain_preview : +gui_split_preview "_fx_simulate_grain_preview $*",$-2 +_fx_simulate_grain_preview : +__fx_simulate_grain ${arg\ {1+$1},${-_fx_simulate_grain}},${2-13} +__fx_simulate_grain : +bm0=alpha bm1=grainmerge bm2=hardlight bm3=overlay bm4=softlight bm5=alpha +input_cached data_film_presets/grain_$1.cimgz +r. $4%,$4%,1,1,6 +if $4>100 b. 1 fi +sharpen. $5 c. 0,255 +repeat $!-1 { l[$>,-1] { +split_opacity[0] ++syntexturize. {0,[w,h]} +if $6 +syntexturize.. {w},{h} +syntexturize... {w},{h} a[-3--1] c fi +c. 0,255 +adjust_colors. ${7-11} +if $13 k[0,-1] rv +else blend[0,-1] ${bm$2},{if($2<=4,$3,1)} +fi +a[^-1] c +} } rm. +fx_blur_angular : +ac "blur_angular $1%,$2%,$3% sharpen $4",$6,$7 +fx_blur_angular_preview : +fx_blur_angular $* +if $5 +line 0,$3%,100%,$3%,0.5,0xF0F0F0F0,255 line 0,$3%,100%,$3%,0.5,0x0F0F0F0F,0 +line $2%,0,$2%,100%,0.5,0xF0F0F0F0,255 line $2%,0,$2%,100%,0.5,0x0F0F0F0F,0 +fi +fx_blur_bloom : +op=${"arg0 $4,+,max,min"} +if !$7 ac "blur_bloom ${1-3},"$op",${5-6},xy",$9 +else +wh={[w,h]} +rotate $8,2,1 +ac "blur_bloom ${1-3},"$op",${5-6},x blur_bloom {$1*(1-$7)},${2-3},"$op",${5-6},y",$9 +rotate {-$8},2,1 +r $wh,1,100%,0,0,0.5,0.5 c 0,255 +fi +fx_blur_bloom_preview : +gui_split_preview "fx_blur_bloom $*",${-3--1} +fx_blur_dof : +_$0 ${1-10},0,$12 +fx_blur_dof_preview : +_fx_blur_dof $* +_fx_blur_dof : +if !$3 +foreach { +if $11 drgba fi +split_opacity l[0] { +rmax={(w*w+h*h)^0.5} R={$7*$rmax/100} r={$8*$rmax/100} +t={$9*pi/180} u={cos($t)} v={sin($t)} +l1={($rmax/(1e-8+$R))^2} l2={($rmax/(1e-8+$r))^2} +a={$l1*($u)^2+$l2*($v)^2} b={$u*$v*($l1-$l2)} c={$l1*($v)^2+$l2*($u)^2} +100%,100%,1,1,'X=(x-$5*w/100)/max(w,h);Y=(y-$6*h/100)/max(w,h);f=$a*X*X+2*$b*X*Y+$c*Y*Y;exp(-f^$10/2.5)' +-[1] 1 *[1] -$1 ms={im} Ms={iM} +if $11 ++isoline3d[1] {0.1*$1} col3d. 255,255,0 ++isoline3d[1] {0.5*$1} col3d. 255,128,0 ++3d[-2--1] +__fx_dof_blur[0,1] $2,$ms,$Ms,$4 +[0],[0],1,3 j3d. ..,0,0,0,1,1,0,0 rm.. +circle. $5%,$6%,3,1,255,255,255 ++compose_channels. + !=. 0 dilate. 3 +j[0] ..,0,0,0,0,0.5,.,1 rm[-2,-1] +else __fx_dof_blur[0,1] $2,$ms,$Ms,$4 +fi +} +if $11 k[0] fi a c +} +elif $!>1 +luminance. n. 0,1 ^. {10^$12} +repeat $!-1 { +r. {$>,w},{$>,h},1,1,3 l[$>,-1] { +split_opacity[0] __fx_dof_blur[0,-1] $2,0,$1,$4 a c +} } rm. +else drgba to "Depth-of-field (bottom layer) is missing !",2,2,13,2,1,255 +fi +__fx_dof_blur : +n[1] 0,{$1-1} round[1] +[0],[0],1,{0,s+1} +s=0 +repeat $1 { ++==[1] {if($4,$<,$>)} b. 2% +j.. [0],0,0,0,0,-1,.,1 +j.. .,0,0,0,100%,-1 +rm. +ns={$2+($3-$2)*($>+1)/($1-1)} +b[0] {sqrt($ns^2-$s^2)}% +s=$ns +} +s. c,{-s+1} /[-2,-1] rm[0,1] +_fx_gaussian_blur : +b $1,$4 +if $2>0 repeat $! { l. { s y b $2,$4 a y } mv. 0 } fi +if $3>0 repeat $! { l. { s x b $3,$4 a x } mv. 0 } fi +fx_gaussian_blur : +ac "_fx_gaussian_blur $1,$2,$3,$4",$5,$6 +fx_gaussian_blur_preview : +gui_split_preview "fx_gaussian_blur $*",${-3--1} +fx_glow : +ac "glow $1",$2,$3 +fx_glow_preview : +gui_split_preview "fx_glow $*",${-3--1} +fx_blur_linear : +ac "blur_linear $1%,$2%,$3,$5 sharpen $4",$6,$7 +fx_blur_linear_preview : +gui_split_preview "fx_blur_linear $*",${-3--1} +_fx_blur_multidirectional : +nb_orientations,angle_ref,angle_range,smoothness,kernel,boundary_conditions,sharpness,blend_mode,contrast=${1-9} +foreach { +if $blend_mode<3 +f {$blend_mode?0:inf} fi +repeat $nb_orientations { +angle={$angle_ref+$angle_range*($>/$nb_orientations-0.5)} +$smoothness,1 gaussian. 20%,0.1 +if !$kernel f. "x>w/2?i:0" fi +rotate. $angle,1 ++convolve_fft[0] .,$boundary_conditions rm.. n. 0,255 sharpen. $sharpness +if $blend_mode<3 ${arg0\ $blend_mode,min,max,+}[1,-1] fi +} +rm[0] +if $blend_mode==6 blend_median +elif $blend_mode>2 blend_edges {arg($blend_mode-2,0.5,1,2)} +fi +n 0,255 ac "normalize_local "$contrast,hsl_l +} +fx_blur_multidirectional : +ac "_fx_blur_multidirectional ${1-9}",$10 +fx_blur_multidirectional_preview : +gui_split_preview "fx_blur_multidirectional $*",${-3--1} +fx_blur_radial : +ac "blur_radial $1%,$2%,$3% sharpen $4",$6,$7 +fx_blur_radial_preview : +fx_blur_radial $* +if $5 +line 0,$3%,100%,$3%,0.5,0xF0F0F0F0,255 line 0,$3%,100%,$3%,0.5,0x0F0F0F0F,0 +line $2%,0,$2%,100%,0.5,0xF0F0F0F0,255 line $2%,0,$2%,100%,0.5,0x0F0F0F0F,0 +fi +fx_chromatic_aberrations : +U1={u=[${1-3}];u/max(1e-8,norm(u))} +U2={u=[${10-12}];u/max(1e-8,norm(u))} +foreach { +to_color split_opacity l[0] { +100%,100%,1,2,"*begin(U1 = ["$U1"]; U2 = ["$U2"]); +V = I(#0); +d1 = dot(V,U1); V-=d1*U1; +d2 = dot(V,U2); V-=d2*U2; +I(#0) = V; +[ d1,d2 ]" +s. c +_fx_chromatic_aberrations.. ${4-9} +_fx_chromatic_aberrations. ${13-18} +a[-2,-1] c ++[0] '"*begin(U1 = ["$U1"]; U2 = ["$U2"]); i(#1,x,y,0,0)*U1 + i(#1,x,y,0,1)*U2"' +rm. +} +a c +} +_fx_chromatic_aberrations : +if $1==0 +100%,100%,1,2,[$2,$3] +elif $1==1 +100%,100%,1,2," +ang = atan2(y - h/2, x - w/2); +U = [ $2*cos(ang), $3*sin(ang) ]" +elif $1==2 +100%,100%,1,2," +ang = atan2(x - w/2, -y + h/2); +U = [ $2*cos(ang), $3*sin(ang) ]" +else +100%,100%,1,2,g s. c n.. 0,$1 n. 0,$2 a[-2,-1] c +fi +if $4 +s. c +m,M={-2,[im,iM]} b.. $4 n.. $m,$M +m,M={[im,iM]} b. $4 n. $m,$M +a[-2,-1] c +fi +if $5 +100%,100% =. 1,50%,50% distance. 1 n. 0,1.4142 c. 0,1 +if $5>0 ^. {0.1+$6} n. {1-$5%},1 +else negate. 1 ^. $6 n. {1+$5%},1 +fi +*[-2,-1] +fi +warp.. .,1,1,1 rm. +fx_chromatic_aberrations_preview : +gui_split_preview "fx_chromatic_aberrations $*",${-3--1} +fx_gcd_crt : skip ${1=1.8},${2=1.8},${3=0},${4=0} +repeat $! l[$>] +to_rgb[0] +expand_xy 12,0 24,14,1,3,0 +f. "if((x-c*4)%12<4,255,0)" +f. "if(x%4==0,0,i)" +f. "if((y%14==0)&&(x%24<12),0,i)" +f. "if(((y-7)%14==0)&&((x+12)%24<12),0,i)" +array. {0,round(w/24)},{0,round(h/14)},2 +z. 0,0,{0,w-1},{0,h-1} +s c repeat 3 blend[-4,-1] shapeaverage0 done a c +n. 0,255 meancurvature_flow. 4 +if $3 +{w},{h},1,1,0 +rectangle. 5%,5%,95%,95%,1,1 +b. 10% *[0,1] +fi +deriche. $1,0,x deriche. $2,0,y +shrink_xy. 12 n. 0,255 +if $4 equalize. 256 fi +done done +fx_dirty : +ac "_fx_dirty ${1-2}",$3,$4 +fx_dirty_preview : +gui_split_preview "fx_dirty ${1--2}",${-3--1} +_fx_dirty : +foreach { +dct 100%,100%,1,{if($2,1,s)} noise. $1,2 +==. 0 point. 0,0,0,1,1 +* idct c 0,255 +} +fx_flip_blocks : +foreach { +if $5 ac "_fx_flip_blocks ${1-4}",$5 +else _fx_flip_blocks ${1-4} +fi +} +_fx_flip_blocks : +if ($3%2)" && "$1>1 s x,-$1 mirror x a x fi +if ($3>1)" && "$2>1 s y,-$2 mirror y a y fi +if $4!=1" && "$1>1" && "$2>1 +s y,-$2 N=$! +s x,-$1 M={$!/$N} +ap "rotate {($4-1)*90}" +append_tiles $M,$N +fi +fx_flip_blocks_preview : +gui_split_preview "fx_flip_blocks $*",${-3--1} +fx_huffman_glitches : +noise_level,split_mode,split_size,patch_overlap,colorspace,quantization,seed=${1-7} +foreach { +W,H,siz:=w,h,whds +cspace=${"arg0 "$colorspace",rgb,cmyk,hcy,hsi,hsl,hsv,jzazbz,lab,lch,oklab,ycbcr,yiq"} +if $colorspace rgb2$cspace fi +s c foreach { im$>,iM$>:=im,iM } n 0,255 a c round +if $quantization +colormap $quantization,0,0 index.. .,0,0 store. colormap fi +huffman_tree mv. 0 +bloc_size:=max(1,round($split_size*max(w,h)%)) +if $split_mode==1 s. y,{-$bloc_size} +elif $split_mode==2 s. x,{-$bloc_size} +elif $split_mode==3 img2patches. $bloc_size,$patch_overlap%,2 s. z +fi +compress_huffman[^0] [0] +eval "srand($seed); +repeat($siz*($noise_level/100)^6, +k = round(u(1,l - 1)); +off = round(u(4,whds#k - 1)); +bit = round(u(0,7)); +val = i[#k,off]; +mask = 1<<(int(u(8))%8); +i[#k,off] = xor(val,mask); +)" +store[0] _tree ap "$_tree decompress_huffman[^-1] . rm." +if $split_mode==1 a y +elif $split_mode==2 a x +elif $split_mode==3 a z patches2img. $W,$H,$patch_overlap% +fi +k. +if $quantization $colormap map.. . rm. fi +s c foreach { n ${im$>},${iM$>} } a c +if $colorspace ${cspace}2rgb c 0,255 fi +} +fx_huffman_glitches_preview : +gui_split_preview "fx_huffman_glitches $*",${-3--1} +u "{$1}{$2}{$3}_"{$2?2:1}"{$4}_"{$2==3?2:1}"{$5}{$6}{$7}{$8}{$9,$10}" +fx_jpeg_artefacts : +base642img[] "MSBmbG9hdCBsaXR0bGVfZW5kaWFuCjggOCA2NCAxICMyMjIyCnic5Vs9q51FEC60kKtWMYpaCirYKCoI767iR6UoSangtdM/EAM2Fgab2FhaWdgIUXO""qVO8sXEHBVDFia6kgCBaCQSyu+5w8c3nv5p55Bg+3uSmGs19nP2Z2Zt752P39/bJ/G8PHF5+qD1y4v77+yNWyeulegPWy9bbW+9pJ7z9XH6s/f3KxdL""BeRr2hjDb0nfR+4OZyxwlw8UbHS4f1nehtBTg66f3kAyOU261OfDTiA/ehEV91ga8T208+cDlg5JNKPiknvR8ykfKwLuRlo7y0k96PegS8MxsB80RAn""ROBRYC9R0AZtxF45o1w+cXz9fHvztTnP7y7nv7z5dLBern1NvTht37/75P17Qt/lOsPPQqwXrbeth6D/6Hv3F2fl2/++WXqMPfyegzmwZz439e9755f""HwbMvT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7tv/f0+0j/j/YHovojml8kfv/nzs+""z/feefh/p/9H+QFR/RPOLxO//3Pl5tv/e0+8j/T/aH4jqj2h+kfj9nzs/z/bfe/p9pP9H+wNR/RHNLxK//3Pn59n+e0+/j/T/aH8gqj+i+UXi93/u/D""zbf+/p95H+H+0PRPVHNL/4DgTd2gQ=" +=> dct,idct +(16,11,10,16,24,40,51,61;12,12,14,19,26,58,60,55;14,13,16,24,40,57,69,56;14,17,22,29,51,87,80,62;18,22,37,56,68,109,103,77;24,35,55,64,81,104,113,92;49,64,78,87,103,121,120,101;72,92,95,98,112,100,103,99) +f. "const S = $1<50?5000/$1:200-2*$1; max(1,round((S*i+50)/100,1,-1))" +=> Q +repeat $!-3 { l[$>,-3--1] { +l[0] { w,h={[w,h]} r {w+(-w%16)},{h+(-h%16)},1,100%,0,3 rgb2ycbcr s c r[-2,-1] 50%,50%,1,1,2 round. } +repeat 3 { +[$>] +f[$>] "begin(boundary = 2; ref(vector64(),res)); +if (!(x%8) && !(y%8), +ref(crop(x,y,8,8),src); +repeat (8,l, repeat (8,k, off = k + 8*l; res[off] = sum(src*crop(#"$dct",0,0,off,8,8,1)))); +draw(#-1,res,x,y,8,8); +); i" +round. ++r[Q] {$>,w},100%,1,1,0,2 /.. . round.. *[-2,-1] +f. "begin(boundary = 2; ref(vector64(),res)); +if (!(x%8) && !(y%8), +ref(crop(x,y,8,8),src); +repeat (8,l, repeat (8,k, off = k + 8*l; res[off] = sum(src*crop(#"$idct",0,0,off,8,8,1)))); +draw(#"$>",res,x,y,8,8); +); i" +rm. +round[$>] +} +l[^3--1] { r ${-max_wh},1,1,1 a c ycbcr2rgb round. r $w,$h,1,3,0 } +} } +rm[dct,idct,Q] +fx_jpeg_artefacts_preview : +gui_split_preview "fx_jpeg_artefacts $*",${-3--1} +fx_lomo : +remove_opacity +foreach { +to_rgb +gaussian {100-$1}%,{100-$1}% n. 0,1 * +s c +f[0] '255*atan((i-128)/128)' +f[1] '255*tan((i-128)/128)' +f[2] '255*atan((i-128)/255)' +a c +sharpen 1 +normalize 0,255 +} +fx_lomo_preview : +gui_split_preview "fx_lomo $*",${-3--1} +fx_mess_with_bits : +ac "_fx_mess_with_bits ${1-7}",$8 +_fx_mess_with_bits : +foreach { ++l { +b {($2/100)^2*100}% if $1 n 0,255 fi * $3 round +if $4==1 f "for (k = res = 0, k<15, ++k, res|=((i>>k)&1)<<(15-k))" +elif $4==2 f "res = ((i>>8)&255) | ((i&255)<<8)" +fi +f "begin( mask = (65535>>(15-max($5,$6))) & (65535<>8,$1&255]} +foreach { +if $2 .,.,1,. noise_perlin. {r=2^$4;s=max(w,h)*$3%;[max(1,s/r),max(1,s*r)]},1,$seedx,$seedy *. $2 + fi +if $5 .,.,1,. noise_perlin. {r=2^$7;s=max(w,h)*$6%;[max(1,s/r),max(1,s*r)]},1,$seedx,$seedy *. $5 + fi +if $8 .,.,1,. noise_perlin. {r=2^$10;s=max(w,h)*$9%;[max(1,s/r),max(1,s*r)]},1,$seedx,$seedy *. $8 + fi +if $11 .,.,1,. noise_perlin. {r=2^$13;s=max(w,h)*$12%;[max(1,s/r),max(1,s*r)]},1,$seedx,$seedy *. $11 + fi +} +fx_noise_perlin : +ac "_fx_noise_perlin $*",$-4,1 +fx_noise_perlin_preview : +gui_split_preview "fx_noise_perlin $*",${-3--1} +fx_spread : +ac "spread $1,$2",$3,$4 +fx_spread_preview : +gui_split_preview "fx_spread $*",${-3--1} +fx_stripes_y : +ac "stripes_y $1",$2,$3 +fx_stripes_y_preview : +gui_split_preview "fx_stripes_y $*",${-3--1} +fx_8bits : +remove_opacity +foreach { +w={w} h={h} +r $1%,$1%,1,100%,2 ++luminance sharpen. $2 otsu. 256 blend[-2,-1] shapeaverage0 +l. { s c quantize $3,1,1 a c } +r. $w,$h,1,100%,1 +} +fx_8bits_preview : +gui_split_preview "fx_8bits $*",${-3--1} +fx_pixelsort : +_fx_pixelsort ${1-8},0 +_fx_pixelsort : +foreach[0-{$4==0?-2:-1}] { +if $3==0 +to_rgb channels. 0 +elif $3==1 +to_rgb channels. 1 +elif $3==2 +to_rgb channels. 2 +elif $3==3 +compose_channels + +elif $3==4 +luminance +elif $3==5 +to_rgb rgb2hsl. channels. 2 +elif $3==6 +to_rgb rgb2hsl. channels. 0 +elif $3==7 +to_rgb rgb2hsl. channels. 1 +elif $3==8 +compose_channels min +elif $3==9 +compose_channels max +else 100%,100%,1,1 rand. 0,100 +fi +if $4==0 pass. 0 norm. +elif $4==1 . +elif $4==2 +gradient_norm[0] +else +rand. 0,100 +fi +b. $7% ir. $5%,{$6+0.01}% +if $8 ==. 0 fi +if $9 k. * 255 +else pixelsort[0] {`$1?_'+':_'-'`},{`$2==0?'x':$2==1?'y':$2==2?'xy':'yx'`},[1],[2] k[0] +fi +} +fx_pixelsort_preview : +_fx_pixelsort $* +fx_rain : +foreach { +nm=${-gui_layer_name} +100%,100% l. { +noise 300 c 0,255 b 1,0 +c {100-$3}%,100% ++>= 40% blend shapeaverage0 +blur_linear $2,$4,$1 +max n 0,255 apply_gamma $5 +=> "name("$nm"),mode(screen),opacity("{$6*100}")" +} +rv +} +fx_rain_preview : +gui_split_preview "foreach { fx_rain $* rv blend screen,$6 }",${-3--1} +fx_shade_stripes : +ac "shade_stripes $1,$2,$3,$4",$5,$6 +fx_shade_stripes_preview : +gui_split_preview "fx_shade_stripes $*",${-3--1} +fx_rebuild_from_similar_blocks : +foreach { +split_opacity l[0] { +to_rgb w0,h0,S={[w,h,round(min(w,h)*$1%)]} +r {ceil([w,h]/$S)*$S},1,100%,0,3,0.5,0.5 +M,N={[w,h]/$S} +s yx,-$S a z ++l { b xy,$2% rgb2ycbcr sh. 0 *. $3 rm. } +$M,$N,1,1,-1 +f. ": +i<0?( +ind = x + y*w; +ref(crop(#1,0,0,ind,w#1,h#1,1),S); +kmin = 0; +dmin = inf; +repeat (wh,k, k!=ind?( +d = norm"{1+$4}"(S - crop(#1,0,0,k,w#1,h#1,1)); +d0&&$ang!=360 rotate $ang,0,3 fi +if $ax==0 spins,dir,sli={w/$wid},x,y else spins,dir,sli={h/$wid},y,x fi +if $__mir==0 __mir=x else __mir=y fi +repeat $it ++s. $dir,$spins +if $rang_f||$rang_b +repeat $spins { rotate[{$>+1}] {u($rang_f,$rang_b)},0,$bound,$cx%,$cy% } +fi +l[^0] { +sel=0--1 +if $inv==1 sel..=^ fi +if $inter>1 +ap[$sel:$inter] "mirror $__mir" +elif $inter==-1 +repeat 2 { +step:=floor(u(1,20)) +ap[$sel:$step] "mirror $__mir" +} +fi +} +a[^0] $dir ++gradient_norm. +negate. +deform[^0] $def +blend[^0] edges,0.6 +blend $blending_mode,$str% +done +if $ang>0&&$ang!=360 +rotate. -$ang,0,3 +vx,vy:=floor((w-$wi)/2),floor((h-$he)/2) +vxb,vyb:=$vx+$wi-1,$vy+$he-1 +crop. $vx,$vy,$vxb,$vyb +fi +equalize +n 0,255 +} +fx_sloppymess_preview : +fx_sloppymess $* +fx_streak : +foreach { +to_rgba +if !$4 R,G,B,A=0 else R,G,B,A=${1-4} fi +select_color 0,$R,$G,$B,$A +if $7==3 srgb2rgb.. fi +f.. " +const step = max(1,$5%*min(w,h)); +const angle = $6*pi/180; +const dx = step*cos(angle); +const dy = step*sin(angle); +if (!i(#-1),I, +ixf = xf = x; iyf = yf = y; lf = 0; +if ($7>=1, while (i(#-1,ixf=round(xf),iyf=round(yf)), ++lf; xf-=dx; yf-=dy)); # Forward +ixb = xb = x; iyb = yb = y; lb = 0; +if ($7!=1, while (i(#-1,ixb=round(xb),iyb=round(yb)), ++lb; xb+=dx; yb+=dy)); # Backward +$7==0?I(ixb,iyb): +$7==1?I(ixf,iyf): +$7==2?(lf] +nm=${-gui_layer_name} +sharp_radius=$1 +amount=$2 +threshold=$3 +constrant_radius=$4 +overshoot=$5 +channels=$6 +value_action=$7 +apply_channels " +sharp_radius=$1 +amount=$2 +threshold=$3 +constrant_radius=$4 +overshoot=$5 ++dilate_oct[0] $constrant_radius ++erode_oct[0] $constrant_radius +unsharp[0] $sharp_radius,$amount,$threshold +add[1] $overshoot +sub[2] $overshoot +blend[0,1] darken,1,0 +blend[0,1] lighten,1,0 +blend alpha,1,0",$channels,$value_action +nm name($nm) +done done +jeje_dehaze : +apply_channels "dehaze {2*$1+1},$2,$3,$4,$5,$6,$7 if $8 k[1] n 0,255 to_rgb else k[0] fi",rgb,1 +jeje_dehaze_preview : +gui_split_preview "jeje_dehaze $1,$2,$3,$4,$5,$6,$7,$8",$9 +_fx_equalize_details : +foreach { +split_details 5,{max(0.1,$1)},{max(0.1,$2)} +__fx_equalize_details[1] ${3-6},8 +__fx_equalize_details[2] ${7-10},4 +__fx_equalize_details[3] ${11-14},2 +__fx_equalize_details[4] ${15-18},1 ++ c 0,255 +} +__fx_equalize_details : +threshold $1,1 +if $3==0 b {$2*$5/2} +elif $3==1 +if $2>0 +m={im} M={iM} n. 0,255 +repeat int($2/5) { bilateral 15,{5*$5} } +bilateral 15,{($2%5)*$5} +*. {($M-$m)/255} +. $m +fi +else smooth {$2*50},0.2,0.8,$5,$5 fi +* {10^$4} +fx_equalize_details : +ac "gui_parallel_overlap \"_fx_equalize_details ${1-18}\",$21,$22",$19,$20 +fx_equalize_details_preview : +gui_split_preview "fx_equalize_details $*",${-3--1} +fx_tk_dri : +repeat $! l[$>] +if $6==1 ++negate +to_rgba[0] +luminance[0] +to_rgba[0] +luminance[0] +fx_gaussian_blur[1] {{{w+h}/20}*{1.1-$1}},0,0,1,0,0,0 to_gray[1] +rv[0,1] fx_compose_softlight[0,1] $1 +fx_gaussian_blur[2] {{w+h}/200},0,0,1,1,0,0 negate[2] to_gray[2] +s[1] c rv[4,5] compose_multiply[4,5] a[1,2,3,4] c rv[0,1] +fx_compose_dodge[0,1] $2 +fx_gaussian_blur[2] {{w+h}/200},0,0,1,1,0,0 to_gray[2] s[1] c +rv[4,5] compose_multiply[4,5] a[1,2,3,4] c rv[0,1] +fx_compose_colorburn[0,1] $3 fi +if $7==1 +map_tones[0] 0.50,0.70,$4,50 ++normalize_local[0] $4,6.00,5.00,1.00 +rv[0,1] fx_compose_value[0,1] $5,0 +rv[0,1] fx_compose_value[0,1] $5,0 fi +done done +fx_tk_dri_preview : +gui_split_preview "fx_tk_dri ${1--2}",$-1 +fx_equalize_local_histograms : +b0="normal" b1="overlay" b2="softlight" +foreach { ++ac "_fx_equalize_local_histograms ${1-6}",$7,1 +blend ${b$2},{$1%} +} +_fx_equalize_local_histograms : ++n 0,511 round. +f. " +begin( +const boundary = 1; +const N = $3; +const sigma = ($6?1:-1)*(0.1+$4); +ref(vector512(),weights); +repeat (size(weights),k, +weights[k] = sigma>=0?exp(-sqr(k/sigma)):1 - exp(-sqr(k/sigma)) +); +); +ref(vector512(0),bins); +repeat (s,c, +ref(crop(x - N,y - N,0,c,2*N + 1,2*N + 1,1,1),V); +repeat (size(V),k, +val = V[k]; +diff = abs(val - V[size(V)/2]); +bins[val]+=weights[diff]; +); +); +sum = 0; +repeat (size(bins),k, +sum+=bins[k]; +bins[k] = sum; +); +bins/=max(1e-5,sum); +P = I; +size(P)==1?(P = bins[P[0]]; 0): +size(P)==2?(P = [ bins[P[0]], bins[P[1]] ]; 0): +size(P)==3?(P = [ bins[P[0]], bins[P[1]], bins[P[2]] ]; 0): +size(P)==4?(P = [ bins[P[0]], bins[P[1]], bins[P[2]], bins[P[3]] ]; 0); +P" +n. 0,255 +if $5 norm.. bilateral. ..,$5,{2+$5} fi +k. +fx_equalize_local_histograms_preview : +gui_split_preview "fx_equalize_local_histograms $*",${-3--1} +fx_freaky_details : +foreach { +split_opacity l[0] { +repeat $3 { +. +-. 255 *. -1 +repeat $1 { bilateral. $2,{1.5*$2} } +blend[-2,-1] vividlight blend overlay +} +} +a c +} +n 0,255 +fx_freaky_details_preview : +gui_split_preview "fx_freaky_details $*",${-3--1} +fx_highpass : +repeat $! l[$>] +to_rgb +negate +if $4==1 to_gray fi +fx_gaussian_blur[1] $1,0,0,1,0,0,0 +compose_interpolation +tk_fx_channel_processing 1,$2,0,0,0,0,100,256,0,0,0,2,0,0 +if $2>=4 tk_fx_channel_processing 1,{$2-3},0,0,0,0,100,256,0,0,0,2,0,0 fi +tk_fx_channel_processing 1,1,0,0,1,50,100,256,0,0,0,2,0,0 +if $3==1 negate fi done done +fx_highpass_preview : +gui_split_preview "fx_highpass ${1--2}",$-1 +_fx_LCE : +SpatialRadius=$1 +Amount=$2 +DarknessLevel=$3 +LightnessLevel=$4 +Threshold=0 ++b. $SpatialRadius +-. .. *. -$Amount ++norm. ge. $Threshold% ri. .. *[-2,-1] ++c. 0,100% c.. -100%,0 *.. $DarknessLevel *. $LightnessLevel +[-2,-1] ++[-2,-1] c. 0,255 +fx_LCE : +ac "_fx_LCE $1,$2,$3,$4",$5,0 +fx_LCE_preview : +gui_split_preview "fx_LCE ${1--2}",$-1 +fx_normalize_local : +ac "normalize_local $1,$2,$3,$4,$5,0,255",$6 +fx_normalize_local_preview : +gui_split_preview "fx_normalize_local $*",${-3--1} +fx_local_processing : +com0="n 0,255" +com1="equalize 256,0,255 n 0,255" +com=${com$1} +if $6 com="s c "$com" a c" fi +foreach { +size={round(max(8,max(w,h)*$3%))} ++ac "at \""$com"\","$size","$size",1,$4%,$4%",$7 +if $5 +norm[0] bilateral[1] .,{$5/20}%,{2+$5/4} rm. fi +blend alpha,{$2%} +} +fx_local_processing_preview : +gui_split_preview "fx_local_processing $*",${-3--1} +jeje_normalize_local_variance : +apply_channels "normalize_local_variance $1,$2,$3,$4",$5,0 +c 0,255 +jeje_normalize_local_variance_preview : +gui_split_preview "jeje_normalize_local_variance $1,$2,$3,$4,$5",$-1 +fx_magic_details : +ac "_fx_magic_details ${1-5}",$6,1 +_fx_magic_details : +foreach { ++bilateral $2,$3 ++gradient_norm.. +. 1 +^. {$4>=0?3.1-$4:-3.1-$4} +b. $5 n. 1,{1+$1} +-... .. *[-3,-1] + c 0,255 +} +fx_magic_details_preview : +gui_split_preview "fx_magic_details $*",${-3--1} +makeup_full: +to_rgb +sub[-1] 128 *[-1] .5 +[-1] 128 +split c +name[0] red +name[1] green +name[2] blue +sub[green] [red] +bilateral[green] $1,$2 +add[green] [red] +sub[blue] [red] +bilateral[blue] $1,$2 +add[blue] [red] +append[0,1,2] c +-[-1] 128 *[-1] 2 +[-1] 128 +c 0,255 +make_up: +to_rgb +cropwidth={w} +cropheight={h} +resize[0] {w+(2-w%2)},{h+(2-h%2)},1,{s},0,1 +width={w} +height={h} +if $3==1 ++resize 50%,50%,1,3,5 ++makeup_full[1] {$1/2},$2 ++resize[1] 200%,200%,1,3,5 ++compose_grainextract[0,3] +resize[2] {w},{h},1,3,5 ++compose_grainmerge[2,4] +keep[0,-1] +else +if $4==1 ++makeup_full[0] $1,$2 +else +makeup_full[0] $1,$2 +fi +fi +if $4==1 ++rgb2hsl8[1] +split[-1] c remove[-1,-2] ++[-1] 128 +mod[-1] 255 +apply_curve[-1] 0,0,0,130,0,136,255,155,255,160,0,255,0 +median[-1] 3 ++edges[1] 10% n[-1] 0,1 +mul[-1,-2] +a[1,2] c +blend[0,1] alpha +else +keep[-1] +fi +crop 0,0,{$cropwidth-1},{$cropheight-1} +make_up_preview: +gui_split_preview "make_up ${1--2}",$-1 +fx_tk_mask : +repeat $! l[$>] +if $8==1 +to_rgba. rv[-1,-2] fi to_rgb. +if $2==1 channels. 0 +elif $2==2 channels. 1 +elif $2==3 channels. 2 +elif $2==4 rgb2cmy channels. 2 +elif $2==4 rgb2cmy channels. 1 +elif $2==4 rgb2cmy channels. 0 +elif $2==5 rgb2lab channels. 1 +elif $2==6 rgb2lab channels. 2 +fi to_rgb. +if $1==0 luminance. +luminance. +elif $1==1 rgb2hsv. channels. 1 +n. 0,255 . +elif $1==2 rgb2hsv. channels. 0 +n. 0,255 . +elif $1==3 rgb2lab. channels. 0 +n. 0,255 . +fi +c. $3,255 n. 0,255 +f.. "if(i<$4,if(c==0,i,i),0)" +fx_gaussian_blur[-1,-2] $5,0,0,1,0,0,0 +compose_darken +if $8==1 rv[-1,-2] fi +tk_fx_channel_processing. 1,$6,0,0,0,0,100,256,0,0,0,2,0,0 +if $7==1 negate. fi +if $8==1 s.. c rv[-1,-2] +fx_compose_multiply[-1,-2] $9 +a[-4,-3,-2,-1] c +fi done done +fx_tk_mask_preview : +gui_split_preview "fx_tk_mask ${1--2}",$-1 +_fx_mighty_details : ++smooth $3,0,1,0.5,0.5 -[1] [0] ++abs. sign.. M={iM} ^. {2-$2} *. {$M/iM} *[-2,-1] ++diffusiontensors[0] 0,1,0.5,0.5 +repeat $4 { smooth[1] [2],20 } +*[1] {-$1/5} + +fx_mighty_details : +ac "_fx_mighty_details ${1-4}",$5,1 +n 0,255 +fx_mighty_details_preview : +gui_split_preview "fx_mighty_details $*",${-3--1} +fx_tk_portrait : +repeat $! l[$>] to_rgb +if narg($_previewflag)==0 _previewflag=0 fi +if $1==3" || "$1==4 +luminance[0] elif $1==2 +channels[0] 2 fx_unsharp. 0,$21,30,$22,0.00,1.00,0.5,1,0,0,0 fi ++fx_edges[0] $24,$23,0,0 if $23==0 fc. 0 fi +fx_unsharp[0] 0,$21,30,$22,0.00,1.00,0.5,1,0,7,0 +if $_previewflag==4" && "$29==5 +tk_fx_select_color[0] ${12-18},0,0 else +tk_fx_select_color[0] ${12-18},1,0 fi ++fx_split_freq[0] $6 if $19==1 fc. 128,128,128 noise. {$6*2},0 luminance. fi ++fx_split_freq[0] $7 +rm[-2,-4] ++fx_tk_dri[0] {$8/100},{$8/200},{$8/200},0,0,1,0,0 +if $9==0 b. $5 rv[-1,-2] b. $4 b... $3 +elif $9==1 bilateral. $7,$5 rv[-1,-2] bilateral. $6,$4 bilateral... {$3/5},$3 +elif $9==2 smooth. $5 rv[-1,-2] smooth. $4 smooth... $3 +elif $9==3 median. $5 rv[-1,-2] median. $4 median... $3 +fi +if ($_previewflag!=0" && "$_previewflag<=3)" || "($10<=1" && "$_previewflag==0) +fx_compose_freq[-1,-2] rv[-1,-2] fx_compose_freq[-1,-2] +if $11==1 to_rgba. b.. $14 s. c negate. +. [-5] a[-1,-2,-3,-4] c fi rm.. mv. 1 +to_rgba. s. c negate[-1,-5] +. [-5] a[-1,-2,-3,-4] c rm.. if $23==50 fc. 0,0,0,0 fi +if $_previewflag==1" || "$_previewflag==2" || "($10==0" && "$_previewflag==0) +if $1!=0" && "$1!=1 mv.. 0 fi +if $20==1 fx_mix_lab.. $27,$26,0,$28,{if({$25>=0},{$25/4},{$25*0.75})},0,$28,$25,0,0,2,0 +elif $20==2 fx_mix_lab. $27,$26,0,$28,{if({$25>=0},{$25/4},{$25*0.75})},0,$28,$25,0,0,2,0 +elif $20==3 fx_mix_lab[-1,-2] $27,$26,0,$28,{if({$25>=0},{$25/4},{$25*0.75})},0,$28,$25,0,0,2,0 +fi +fx_compose_alpha[-2,-3] {if({$1==0},{$2/100},1)},0 fx_compose_alpha[-1,-2] {if({$1==0},{$2/100},1)},0 +if $23==50 fx_unsharp[0] 0,$21,30,$22,0.00,1.00,0.5,1,0,0,0 fi +if $_previewflag<=1 +if $1==1 fx_glow[0] {$2/10},0,0 +elif $1==2 fx_compose_hardlight[0,1] {$2/100} +elif $1==3 fx_compose_screen[0,1] {$2/100} +elif $1==4 fx_compose_multiply[0,1] {$2/100} +fi +if $20==0 fx_mix_lab[0] $27,$26,0,$28,{if({$25>=0},{$25/4},{$25*0.75})},0,$28,$25,0,0,2,0 fi +fi fi fi done done +fx_tk_portrait_preview : +_previewflag=1 +if $29==1 _previewflag=2 elif $29==2" || "$29==3 _previewflag=3 elif $29>=4 _previewflag=4 fi +if $29>=2 gui_split_preview "fx_tk_portrait ${1--2}",0 +else gui_split_preview "fx_tk_portrait ${1--2}",$-1 fi +if $29==1 k[0] elif $29==2 k[2] elif $29==3 k[0] elif $29==4 k... elif $29==5 k... +elif $29==6 k[-5] negate elif $29==7 k.. elif $29==8 k[0] elif $29==9 k. fi +_previewflag=0 +iain_pyramid_processing: +repeat $! l[$>] +remove_opacity +if $5==0 +colorspace="lab_l" +elif $5==1 +colorspace="ycbcr_y" +elif $5==2 +colorspace="rgb" +fi +ac[0] " ++l +dilate=1 +blur=1 +mix=$3 +noise=$2 +levels=$1 +size={3^$levels} +cropwidth={w} +cropheight={h} +resize {w+($size-w%$size)},{h+($size-h%$size)},{d},{s},0,1 +repeat $levels +l[-1] ++resize[0] 33.33333%,33.33333%,{d},{s},2 ++iain_resize_x3[-1] +blur[-1] 1 +sub[0,-1] +done +done +repeat $!-1 +l[{$>}] ++abs +max={iM} +dilate[-1] $dilate +blur[-1] $blur +max[-1] 0.00000000000000001 ++fill[-1] $max +div[-1] [-2] +cut[-1] -1000000000,$noise +mul[0,-1] +k[0] +done +done +to_rgb +repeat $!-1 +iain_resize_x3[-1] +blur[-1] 1 +add[-1,-2] +done +crop 0,0,{$cropwidth-1},{$cropheight-1} +replace_nan 0 +replace_inf 255 +n 0,255 +done +if $4 +sub[-1] {-1,ia} +mul[-1] $mix +add +c 0,255 +else +mul[0] {1-$mix} +mul[1] $mix +add +fi +c 0,255",$colorspace +done done +fx_deblur : +ac "gui_parallel_overlap \"deblur ${1-5} c 0,255\",$7,$8",$6,1 +fx_deblur_preview : +gui_split_preview "fx_deblur $*",${-3--1} +fx_unsharp_goldmeinel: +ac "gui_parallel_overlap \"_fx_unsharp_goldmeinel $*\",$7,$8",$6,1 +_fx_unsharp_goldmeinel : +deblur_goldmeinel $* +if $5 c 0,255 else n 0,255 fi +fx_unsharp_goldmeinel_preview: +gui_split_preview "fx_unsharp_goldmeinel $*",${-3--1} +jeje_hessian_sharpen : +repeat $! l[$>] +split_opacity l[0] repeat $3 hessian_sharpen $1,$2 done done a c +if $4 c 0,255 n 0,255 else n 0,255 fi +done done +jeje_hessian_sharpen_preview : +gui_split_preview "jeje_hessian_sharpen $1,$2,$3,$4",$-1 +fx_sharpen_inversediff : +ac "repeat $2 { sharpen $1 c 0,255 }",$3,1 +fx_sharpen_inversediff_preview : +gui_split_preview "fx_sharpen_inversediff $*",${-3--1} +fx_sharpen_multiscale : +ac "_fx_sharpen_multiscale $1,$2",$3 +fx_sharpen_multiscale_preview : +gui_split_preview "fx_sharpen_multiscale $*",${-3--1} +_fx_sharpen_multiscale : +foreach { +N={max(1,int(log2(min(w,h))-2))} ++l { repeat $N { +r. 50%,50%,1,100%,2 +r. ..,..,1,100%,5 -[-3,-1] } } +guided[0] 4,100 +repeat $!-1 { l[0,{$>+1}] { ++ri[0] [1],2 ++equalize.. 1024 +bilateral. ..,{2*$2%},100 +j[1] .,0,0,0,0,{$1%} +k[0,1] +} } +rm[0] +repeat $!-1 { r. ..,..,1,100%,5 +[-2,-1] } +c 0,255 +} +fx_unsharp_octave : +ac "gui_parallel_overlap \"unsharp_octave $1,$2,$3,$4\",$6,$7",$5,1 +fx_unsharp_octave_preview : +gui_split_preview "fx_unsharp_octave $*",${-3--1} +fx_unsharp_richardsonlucy : +deblur_richardsonlucy $* +if $4 c 0,255 else n 0,255 fi +fx_unsharp_richardsonlucy_preview : +gui_split_preview "fx_unsharp_richardsonlucy $*",${-3--1} +fx_sharpen_shock : +ac "repeat $5 { sharpen $1,$2,$3,$4 c 0,255 }",$6,1 +fx_sharpen_shock_preview : +gui_split_preview "fx_sharpen_shock $*",${-3--1} +fx_sharpen_texture : +ac "_fx_sharpen_texture ${1-2}",$3,1 +_fx_sharpen_texture : +foreach { ++rolling_guidance $2,5,0.5 -. [0] *. $1 - c 0,255 +} +fx_sharpen_texture_preview : +gui_split_preview "fx_sharpen_texture $*",${-3--1} +_fx_unsharp : +repeat $! { repeat $8 { +if $1==0 +b. $2 else +bilateral. $2,$3 fi +-. .. *. -$4 ++norm. >=. $5% ri. .. *[-2,-1] +if $9 *. -1 fi ++c. 0,100% c.. -100%,0 *.. $6 *. $7 +[-2,-1] ++[-2,-1] c. 0,255 +} mv. 0 } +fx_unsharp : +ac "_fx_unsharp $1,$2,$3,$4,$5,$6,$7,$8,$9",$10,1 +fx_unsharp_preview : +gui_split_preview "fx_unsharp $*",${-3--1} +jeje_whiten_frequency : +repeat $! l[$>] split_opacity l[0] +whiten_frequency {exp($1/100)-1} +if $2 c 0,255 n 0,255 else n 0,255 fi +done a c done done +jeje_whiten_frequency_preview : +gui_split_preview "jeje_whiten_frequency $1,$2",$-1 +fx_split_details_alpha : +remove_opacity +foreach { +repeat $1-1 { +s={$3+($2-$3)*$>/if($1-2>0,$1-2,1)} ++_fx_split_details_alpha_blur. $s +sub_alpha.. .,$4 +} +} +_fx_split_details_alpha_blur : +if $1>=0.1 b. $1 +else +if $1>=0.05 (1,4,7,4,1;4,16,26,16,4;7,26,41,26,7;4,16,26,16,4;1,4,7,4,1) +else (1,2,1;2,4,2;1,2,1) fi +normalize_sum. convolve.. . rm. +fi +fx_split_details_alpha_preview : +foreach { +fx_split_details_alpha ${1-4} +if $5 remove_opacity[^-1] else to_rgba. fi +N={int(sqrt($!))} N={round($!/$N,1,1)} r2dy {100/$N}% +foreach { 0 text. "#"{1+$>}" ",1,1,24,1,255 +dilate. 5 to_rgba[1] j[0] [1],2,0,0,0,1,[2],255 k[0] } +to_rgba frame 1,1,0 frame 3,3,255 append_tiles , +} +fx_split_details_gaussian : +remove_opacity +foreach { +nm=${-gui_layer_name} +pos=${-gui_layer_pos} +split_details $1,$2,$3 ++[^0] 128 c[^0] 0,255 round +repeat $!-1 { =>[{1+$>}] "mode(grainmerge), name"($nm" [scale ""#"{1+$>}"]), pos("$pos")" } +=>[0] "name"($nm" [residual]), pos("$pos")" +rv +} +fx_split_details_gaussian_preview : +foreach { +fx_split_details_gaussian $* +if $4 equalize[^-1] 256 fi n[^-1] 0,255 +N={int(sqrt($!))} N={round($!/$N,1,1)} r2dy {100/$N}% +foreach { 0 text. "#"{1+$>}" ",1,1,24,1,255 +dilate. 5 to_rgba[1] j[0] [1],2,0,0,0,1,[2],255 k[0] } +to_rgba frame 1,1,0 frame 3,3,255 append_tiles , +} +fx_split_details_wavelets : +remove_opacity +foreach { +nm=${-gui_layer_name} +pos=${-gui_layer_pos} +split_details $1,0,0 rv +[^-1] 128 c[^-1] 0,255 round +if $2 to_a[^-1] fi +repeat $!-1 { =>[$>] "mode(grainmerge), name"($nm" [scale ""#"{1+$>}"]), pos("$pos")" } +=> "name"($nm" [residual]), pos("$pos")" +} +fx_split_details_wavelets_preview : +foreach { +fx_split_details_wavelets $1,0 +if $3 equalize[^-1] 256 fi n[^-1] 0,255 +N={int(sqrt($!))} N={round($!/$N,1,1)} r2dy {100/$N}% +foreach { 0 text. "#"{1+$>}" ",1,1,24,1,255 +dilate. 5 to_rgba[1] j[0] [1],2,0,0,0,1,[2],255 k[0] } +to_rgba frame 1,1,0 frame 3,3,255 append_tiles , +} +jeje_spotify : +apply_channels "spotify $1,$2 apply_gamma $3 if $4 c 0,255 else n 0,255 fi",$5 +jeje_spotify_preview : +gui_split_preview "jeje_spotify $1,$2,$3,$4,$5",$6 +#@cli afre_texture : -100<=coarse<=100,-100<=_medium<=100,-100<=_fine<=100 +#@cli : Enhance texture with detail scales. +#@cli : Default values: 'coarse=0', 'medium=0' and 'fine=0'. +afre_texture : check "${1=0}>=-100 && ${2=0}>=-100 && ${3=0}>=-100 +&& $1<=100 && $2<=100 && $3<=100" +if !$1&&!$2&&!$3 return fi e[] "[afre]^_^) texture: Enhance texture of image$? using coarse=$1, medium=$2 and fine=$3 detail scales." +repeat $! l[$>] r={[im,iM]} +afre_orien 1 +afre_y50.. 1 to_rgb. +afre_details. 4 w1={20^($1/130)} w2={20^($2/100)} w3={20^($3/140)} +if $1>0 *[3] $w1 elif $1<0 f[3] 0 median[2] {abs($1)/100*5} fi +if $2>0 *[4] $w2 elif $2<0 f[4] 0 median[2] {abs($2)/100*9} fi +if $3>0 *[5] $w3 elif $3<0 f[5] 0 median[2] {abs($3)/100*13} fi ++[2--1] c. $r *[^0] c. $r ++n.. 0,1 f. "begin(const M=0.5; const G=0.05); +ref(if(i<=M,M-M*(i/M)^G,-M+M*((1-i)/M)^G),A)" n. 0,1 +blend_fade[0,1] . k[0] +n $r done done +afre_texture_preview : +afre_texture $* +iain_texture_enhance_p: +apply_parallel_overlap "iain_texture_enhance ${1--2}",{$1*2},$-2 +iain_texture_enhance_p_preview : +gui_split_preview "iain_texture_enhance_p ${1--2}",$-1 +iain_texture_enhance: +tic +ac " +if $1%2!=0 ++erode_circ[0] $1 dilate_circ[-1] $1 ++dilate_circ[0] $1 erode_circ[-1] $1 +else ++erode_oct[0] $1 dilate_oct[-1] $1 ++dilate_oct[0] $1 erode_oct[-1] $1 +fi +sub[1] [0] +sub[2] [0] +add[1] [2] +remove[2] +mul[1] $2 ++abs[1] +pt1={min(0,($4-10))} +apply_curve[-1] 0,0,0,$pt1,0,{$4+1},1,255,1 +(0.0579710145,0.1304347826,0.0579710145;0.1304347826,0.2463768116,0.1304347826;0.0579710145,0.1304347826,0.0579710145) +convolve[-2] [-1] +remove[-1] +mul[1] [2] +c[1] {$3*-1},$3 +sub[0] [1] +keep[0]",$5 +c 0,255 +toc +iain_texture_enhance_preview : +gui_split_preview "iain_texture_enhance ${1--2}",$-1 +gcd_tone_enhance : +skip ${1=0},${2=1},${3=0},${4=1},${5=128},${6=0},${7=1} +skip ${8=0.5},${9=0},${10=0},${11=4},${12=0},${13=0} +if $13 repeat $! l[$>] +gcd_srgb2jpeg sh 1,2 median. 5,20 rm. gcd_jpeg2srgb c 0,255 +done done fi +mode=${arg\ 1+$11,hsi_i,hsv_v,lab_l,lrgb,rgb,ycbcr_y} +ac "_gcd_tone_enhance ${1-10}",$mode,{$12+1} +_gcd_tone_enhance : +repeat $! l[$>] +if $9>0 bilateral 1%,$9 c 0,255 fi ++norm +bilateral.. 2%,30 norm. -[-2,-1] ++gradient_norm.. n. 0,1 oneminus. *[-2,-1] +if $10 b. {0.025*$10}% fi ++n.. 0,255 median. 3 bilateral. 2%,30 +gcd_srgb2luma. -. $5 +abs. negate. ++max.. 0 min... 0 abs... +if $8!=0.5 ++n[{$8>0.5?-3:-1}] 0,1 +gcd_ibezier[0] {1-$8} +j[0] .,0,0,0,0,1,.. rm[-2,-1] +fi ++/... {if(iM#-3>0,iM#-3/(1/$2-1),1)} +. 1 ++/... {if(iM#-3>0,iM#-3/(1/$7-1),1)} +. 1 *[-2,-1] ++/.. {if(iM#-2>0,iM#-2/(1/$4-1),1)} +. 1 *[-2,-1] +m={0,iM} /[0] $m ^[0,-1] *[0] $m +n... 0,$1 n.. 0,$6 n. 0,$3 *[-3--1] [-4] rm[-4] + +done done +fx_map_tones : +ac "map_tones ${1-4}",$5,1 +n 0,255 +fx_map_tones_preview : +gui_split_preview "fx_map_tones $*",${-3--1} +fx_map_tones_fast : +ac "map_tones_fast $1,$2",$3,2 +fx_map_tones_fast_preview : +gui_split_preview "fx_map_tones_fast ${^0}",${-3--1} +fx_yag_soften : +Darken=$1 +Soften=$2 ++fx_laplacian[0] 0,0,100,0,0,0 +if $Soften>0 +fx_gaussian_blur[1] {$Soften/10},0,0,1,0,0,0 +fi ++fx_mix_lab[0] 0.5,50,0.2,1,2,1,1,2,1,0,10,0 +if $Darken>0 ++blend[0,2] softlight +blend[0,3] multiply,{$Darken/100} +fi +blend[0,2] hardlight +if $Soften!=100 +blend[0,1] grainextract +elif $Soften==100 +rm[1] +fi +fx_yag_soften_preview : +gui_split_preview "fx_yag_soften ${1--2}",$-1 +fx_droste : +repeat $! { +if $16==1 100%,100%,1,1,'x' 100%,100%,1,1,'y' a[-2,-1] c fi +repeat $9 { +x0={round($1*w/100)} y0={round($2*h/100)} x1={round($3*w/100)} y1={round($4*h/100)} +x2={round($5*w/100)} y2={round($6*h/100)} x3={round($7*w/100)} y3={round($8*h/100)} +100%,100%,1,2,-32767 polygon. 4,$x0,$y0,$x1,$y1,$x2,$y2,$x3,$y3,1,-65535 +sh. 0 +f. "if(i==-65535, +x03 = "$x0"+(y-"$y0")/("$y3"-"$y0")*("$x3"-"$x0"); +x12 = "$x1"+(y-"$y1")/("$y2"-"$y1")*("$x2"-"$x1"); +(x-x03)/(x12-x03)*(w-1),i)" +rm. +sh. 1 +f. "if(i==-65535, +y01 = "$y0"+(x-"$x0")/("$x1"-"$x0")*("$y1"-"$y0"); +y32 = "$y3"+(x-"$x3")/("$x2"-"$x3")*("$y2"-"$y3"); +(y-y01)/(y32-y01)*(h-1),i)" +rm. +xshift={w*$10/100} yshift={h*$11/100} alpha={-$12*pi/180} +ca={cos($alpha)/$13} sa={sin($alpha)/$13} w2={w/2} h2={h/2} +f. 'if(i==-32767,i,X=i(x,y,0,0)-$w2;Y=i(x,y,0,1)-$h2;if(c==0,$w2-$xshift+X*$ca-Y*$sa,$h2-$yshift+X*$sa+Y*$ca))' +if $14==0 sh. 0 f. 'if(i==-32767,x,i)' rm. sh. 1 f. 'if(i==-32767,y,i)' rm. +elif $14==1 sh. 0 f. 'if(i==-32767,x,w-1-i)' rm. sh. 1 f. 'if(i==-32767,y,i)' rm. +elif $14==2 sh. 0 f. 'if(i==-32767,x,i)' rm. sh. 1 f. 'if(i==-32767,y,h-1-i)' rm. +else sh. 0 f. 'if(i==-32767,x,w-1-i)' rm. sh. 1 f. 'if(i==-32767,y,h-1-i)' rm. +fi +if $16<2 warp.. .,0,{$16==0},$15 rm. +else ++warp.. .,0,1,$15 rm.. +if $16==3 rv[-2,-1] fi +blend[-2,-1] alpha +fi +} +if $16==1 warp.. .,0,1,1 rm. fi +mv. 0 +} +fx_droste_preview : +if !$17 fx_droste $* else polygon 4,$1%,$2%,$3%,$4%,$5%,$6%,$7%,$8%,0.3,0,0,0,255 fi +polygon 4,$1%,$2%,$3%,$4%,$5%,$6%,$7%,$8%,1,0xFFFFFFFF,0,0,0,255 +fx_frame_blur : +foreach { +to_rgb sx={$1%*max(w,h)} sy={$2%*max(w,h)} ++r {w+$sx},{h+$sy},1,100%,3 b[1] $4% +if $6 balance_gamma[1] ${7-9} fi +if $10==1 n[1] 0,255 elif $10==2 n[1] 0,255 equalize[1] 256 fi +rv +z[1] {$3/2}%,{$3/2}%,{100-$3/2}%,{100-$3/2}% +to_rgba[1] +if $5 r={1+1/$5} sh[1] 100% f. '1-(abs(x/w-0.5)^$r+abs(y/h-0.5)^$r)^(1/$r)' +v={min(i(w/2,0),i(w-1,h/2),i(w/2,h-1),i(0,h/2))} +c. $v,{$v+0.5/max(w,h)} n. 0,255 rm. fi +s={$11%*max(w,h)} +r[1] {w+$s},{h+$s},1,4,0,0,0.5,0.5 +i[1] 100%,100%,1,3 fc[1] ${12-14} blend[1,2] alpha to_a. +if $5 sh[1] 100% f. '1-(abs(x/w-0.5)^$r+abs(y/h-0.5)^$r)^(1/$r)' +v={min(i(w/2,0),i(w-1,h/2),i(w/2,h-1),i(0,h/2))} +c. $v,{$v+0.5/max(w,h)} n. 0,255 rm. fi +rotate[1] $21,1,0 +r[1] [0],[0],1,4,0,0,$19,$20 ++channels[1] 100% b. $17%,0 c. 0,{max(1,100-$18)}% n. 0,255 +shift. {round(w*$15%)},{round(h*$16%)},0,0,0 /. -255 +. 1 *[0,-1] +blend alpha +} +fx_frame_fuzzy : +foreach { +sx={$1%*max(w,h)/2} sy={$2%*max(w,h)/2} +frame_fuzzy $sx,$sy,${3-8} +} +fx_frame_mirror : +foreach { +{100+2*$1}%,{100+2*$2}%,1,100%," +const boundary = 3; +const offx = (w - w#-1)*$3%; +const offy = (h - h#-1)*$4%; +const f_left = 2^$5; +const f_right = 2^$6; +const f_up = 2^$7; +const f_bottom = 2^$8; +x = x - offx; +y = y - offy; +x<0?(x*=-f_left): +x>=w#-1?(x = w#-1 - 1 - f_right*(x - w#-1)); +y<0?(y*=-f_up): +y>=h#-1?(y = h#-1 - 1 - f_bottom*(y - h#-1)); +I(#-1,x,y)" k. +} +fx_frame_mirror_preview : +foreach { +ws,hs={[w,h]} fx_frame_mirror $* wd,hd={[w,h]} +rr2d $_preview_area_width,$_preview_area_height wp,hp={[w,h]} +ws,hs={[$ws,$hs]*[$wp,$hp]/[$wd,$hd]} +coords={off=([$wp,$hp]-[$ws,$hs])*[$3,$4]%;[off,off+[$ws,$hs]-1]} +split_opacity 100%,100%,1,1,$9 rectangle. $coords,1,1 *[0,-1] a c +rectangle $coords,0.75,0xF0F0F0F0,255 +rectangle $coords,0.75,0x0F0F0F0F,0,0,0,255 +} +fx_frame_painting : +if $14 +repeat $! { +100%,100%,1,4 frame_painting. $1%,$2,$3%,${4-6},$7%,${8-13} +rv[-2,-1] to_a. r. ..,..,1,4,0,0,0.5,0.5 mv[-2,-1] 0 +} +else frame_painting $1%,$2,$3%,${4-6},$7%,${8-13} +fi +fx_frame_painting_preview : +frame_painting $1%,$2,$3%,${4-6},$7%,${8-13} +fx_frame_pattern : +if $2" || "$!==1 repeat $3 { frame_pattern $1,$4 } +else repeat $3 { frame_pattern[^0] $1,[0],$4 } +fi +fx_frame_pattern_preview : +fx_frame_pattern ${1-3},1 +fx_frame : +to_rgba repeat $! { +z. $1%,$3%,$2%,$4% +frame. $11,$11,${12-15} +sx={$5%*max(w,h)} sy={$6%*max(w,h)} +frame. $sx,$sy,${7-10} +mv. 0 } +cl_reliefFrame: +frameType,frameSize,reliefWidth,reliefAmount,kaleido,frameBlur,frameHue,frameSat,frameLum,unifColor,colorR,colorG,colorB,grainType,grainAmount,grainFrameOn=$* +if $grainType==2 +grainType=3 +fi +foreach { +remove_opacity. +[-1] +if $unifColor==0 +if $kaleido +fx_kaleidoscope. 50,50,0,0,100,10,2 +fi +b. $frameBlur +l. +rgb2hsl split c ++. $frameLum c. 0,1 ++.. $frameSat c.. 0,1 ++... $frameHue %... 360 +a c hsl2rgb +done +elif $unifColor==1 +fill. [$colorR,$colorG,$colorB] +fi +if $grainFrameOn==0 +fx_noise. $grainAmount,$grainType,16,1,0,50,50 +elif $grainFrameOn==1 +fx_noise.. $grainAmount,$grainType,16,1,0,50,50 +fi +100%,100%,1,1,0 +fx_frame_round. $frameSize,20,1,255,255,255,255,0,0,3 +remove_opacity. +n. 0,255 +[-1] +if $frameType>=1 +negate. +fi +if $frameType>=2 +gradient_norm. +fi +if $frameType==3 +negate. +fi +fx_smooth_antialias. 100,10,5,0,50,50 +negate. +l. +b. $reliefWidth +fill. if(abs(i)<1e-10,0,i) +gradient2rgb. 0 n. 0,255 +[-1] +rgb2hsv[-2,-1] split[-2,-1] c +l[-3--1] +[-3] {315} %[-3] 360 done +l[-6--4] +[-3] {135} %[-3] 360 done +l[-3--1] a c hsv2rgb s c done +l[-6--4] a c hsv2rgb s c done +rm[^-6,-3] +negate.. +/ 2 ++. 128 +blend grainmerge,1 +done +to_rgb. +apply_curve. 1,0,{127-$reliefAmount},255,{128+$reliefAmount} +fill[0] i#2*i#1+(255-i#2)*i n[0] 0,255 +rm.. rm.. +blend grainmerge,1 +if $grainFrameOn==2 +fx_noise. $grainAmount,$grainType,16,1,0,50,50 +fi +} +cl_circ : +fill. stroke(d)=cut($4-abs(d/2),0,1);stroke(sqrt((x-$1)^2+(y-$2)^2)-$3) +n. 0,255 +cl_innerCirc : +xC=$1 +yC=$2 +radi=$3 +wid=$4 +nb=$5 +lvl=$6 +if $lvl>0 +angl={pi/$nb} +sinu={sin($angl)} +ra={$radi/(1+1/$sinu)} +ray={$radi/(1+$sinu)} ++fill. 0 +[-1]x{$nb-1} +foreach[1--1] { +num=$> +xA={$ray*cos(2*$num*$angl)} +yA={$ray*sin(2*$num*$angl)} +cl_circ {$xC+$xA},{$yC+$yA},$ra,$wid +cl_innerCirc {$xC+$xA},{$yC+$yA},$ra,$wid,$nb,{$lvl-1} +} +fi +fx_frame_round : +to_rgba frame_round $1%,$2%,${3-7} +fx_frame_smooth : +foreach { +sx={$1%*max(w,h)} sy={$2%*max(w,h)} +100%,100%,1,1,0 +if $3 r={1+1/$3} f. '1-(abs(x/w-0.5)^$r+abs(y/h-0.5)^$r)^(1/$r)' +v={min(i(w/2,0),i(w-1,h/2),i(w/2,h-1),i(0,h/2))} <=. $v +fi +frame $sx,$sy,1 +inpaint_pde[0] [1],100%,1,15 +rm. +} +c 0,255 +fx_old_photo : +vignette ${1-3} old_photo +fx_polaroid : +vignette ${8-10} polaroid $1,$2 drop_shadow $3%,$4%,$5%,$6 rotate $7,1,0 +fx_tunnel : +tunnel $1,$2%,{[${3,4}]%},${5-6} +fx_vignette : +foreach { +to_rgb +to_rgba split_opacity +=. 0 vignette. ${1-3} a c +fc ${4-7} rv blend alpha +} +fx_bandpass : +foreach { split_opacity ac[0] "bandpass $1%,$2%",$3,$4 a c } +fx_bandpass_preview : +gui_split_preview "fx_bandpass $*",${-3--1} +fx_display_fft : +to_rgb display_fft +fx_fourier_transform : +if $1 remove_opacity fi +ind=0 +_preview_error=0 +for $ind<$! { +gui_layer_name[$ind] nm=${} +p:="s=['"$nm"'];find(s,' [FFT Magnitude] | ',size(s)-1,-1)" +if $p>=0 +if $ind+1>=$! +gui_resize_preview_area[$ind] +gui_error_preview[$ind] "Two input layers are required. Please set 'Input Layers' mode accordingly." +ind=$! +_preview_error=1 +else l[$ind,{$ind+1}] { +('$nm') +z. {$p+19},100% a0,b0=${u\ {t}} rm. z. 0,{$p-1} nm={t} rm. +/.. $a0 +.. $b0 +/. {255/(2*pi)} -. {pi} +exp.. -.. 1 ifftpolar +c 0,255 +gui_set_layer_name $nm +ind+=1 +} fi +else l[$ind] { +fftpolar +.. 1 log.. +a0,b0={0,_[255/(iM-im),im]} +-.. $b0 *.. $a0 ++. {pi} *. {255/(2*pi)} +c 0,255 +gui_set_layer_name.. $nm" [FFT Magnitude] | "$a0,$b0 +gui_set_layer_name. $nm" [FFT Phase]" +ind+=2 +} fi +} +fx_fourier_transform_preview : +fx_fourier_transform $* k[0] +if !$_preview_error gui_resize_preview fi +fx_fourier_old : skip ${2=0} +if $2 remove_opacity fi +magic="GMICFFT" i=0 +for $i<$! { +ni={$i+1} nm={$i,n} is_ifft=0 ++columns[$i] 100% +l. { +mag,m0,M0,m1,M1=${u\ {t}} +if ['$mag']=='$magic' is_ifft=1 fi +onfail +} +rm. +if !$is_ifft +rows[$i] 100% l. { mag,m0,M0,m1,M1=${u\ {t}} if ['$mag']=='$magic' is_ifft=2 fi onfail } rm. fi +if !$is_ifft ++rows[$i] 100% l. { mag,m0,M0=${u\ {t}} if ['$mag']=='$magic' is_ifft=3 fi onfail } rm. +if $is_ifft==3 +is_ifft=0 +rows[$ni] 100% +l. { mag,m1,M1=${u\ {t}} if ['$mag']=='$magic' is_ifft=3 fi onfail } rm. +fi +fi +if !$is_ifft +l[$i] { +fftpolar +.. 1 log.. m0,M0,m1,M1={[im#0,iM#0,im#1,iM#1]} n[-2,-1] 0,255 +if $1==0 ({'$magic,$m0,$M0,$m1,$M1'},0) y. a x +elif $1==1 ({'$magic,$m0,$M0,$m1,$M1'},0) a y +else ({'$magic,$m0,$M0'},0) a[-3,-1] y ({'$magic,$m1,$M1'},0) a[-2,-1] y +fi +=> $nm +} +else +if $is_ifft==1 columns[$i] 0,{$i,w-2} s[$i] x,2 +elif $is_ifft==2 rows[$i] 0,{$i,h-2} s[$i] y,2 +else rows[$i,$ni] 0,{$i,h-2} +fi +l[$i,{$i+1}] { n[0] $m0,$M0 n[1] $m1,$M1 exp[0] -[0] 1 ifftpolar c 0,255 } +fi +i+={$1<2" || "$is_ifft>2?1:2} +} +fx_fourier_old_preview : +if $2 remove_opacity fi +dfft +fx_watermark_fourier : +watermark_fourier "$1",$2 c 0,255 +fx_align_layers : +to_colormode 0 +r ${-max_wh},1,100%,0,0,0.5,0.5 +if ${4=0} _fx_revert_layers fi +remove_opacity +if $1 register_nonrigid[^-1] .,$2,0.1,$3 +else register_rigid[^-1] .,$2 +fi +fx_align_layers_preview : +fx_align_layers $1,$2,0 blend_edges 0.1 +_fx_revert_layers : +repeat int($!/2) { rv[{2*$>},{2*$>+1}] } +fx_blend_average_all : +if $! to_rgba +N=$! r ${-max_wh},1,100%,0,0,0.5,0.5 +_gb_fwd $1 ++ / $N +_gb_bwd $1 +fi +_gb_fwd : +to_color +if $1==1 foreach { sh 0,2 srgb2rgb. rm. } +elif $1==2 foreach { sh 0,2 srgb2rgb. rgb2lab. rm. } +fi +_gb_bwd : +to_color +if $1==1 foreach { sh 0,2 rgb2srgb. rm. } +elif $1==2 foreach { sh 0,2 lab2rgb. rgb2srgb. rm. } +fi +fx_blend_edges : +repeat int($!/2) { l[$>,{$>+1}] { if $3 rv fi +blend_edges[-2,-1] $2 rm... blend[-2,-1] alpha,$1 } } +fx_blend_fade : +if $!==1 return fi +to_colormode 4 +_gb_fwd $7 +if $1==0 [0],[0],1,1,"$11" +else _fx_blend_fade$1 $8,$9,$10 r. [0],[0],1,1,3 +fi +n. {-($!-2)*$3},{($!-2)*(1+$3)} +-. {$2*(1+$3)*($!-2)} +c. 0,{$!-2} +if $6 rv[^-1] fi +if $5 round. 1 +else roundify. $4 +fi +blend_fade[^-1] . rm. +_gb_bwd $7 +c 0,255 +_fx_blend_fade1 : [0],[0],1,1,"a=$1*pi/2; x*cos(a) + y*sin(a)" +_fx_blend_fade2 : [0],[0],1,1,0 =. 1,{($1+1)*50}%,{($2+1)*50}% distance. 1 +_fx_blend_fade3 : [0],[0],1,1,0 =. 1,{($1+1)*50}%,{($2+1)*50}% distance. 1 *. {0.01+$3/2} cos. +_fx_blend_fade4 : [0],[0],1,1,"((x-w*($1+0.5))*(y-h*($2+0.5)))%(0.2*w*h*(1.001+$3))" +fx_blend_median : +_gb_fwd $1 +blend_median +_gb_bwd $1 +fx_blend_seamless : +rv +_gb_fwd $4 +to_a[^0] r[^0] [0],[0],1,100%,0 +repeat $! { pos=${gui_layer_pos[$>]} shift[$>] ${u\ $pos},0,0 } +if $5 ++blend_seamless $1,$2%,$3% +remove_opacity[0,-1] k[0,-1] rv sub_alpha[0] [1],1 +else +blend_seamless $1,$2%,$3% +fi +_gb_bwd $4 +fx_blend_seamless_preview : +fx_blend_seamless ${1-4},0 +fx_blend : +mode=${arg0\ $1,add,alpha,and,average,blue,burn,custom_formula,darken,difference,divide,dodge,edges,exclusion,freeze,grainextract,grainmerge,green,hardlight,hardmix,hue,interpolation,lighten,lightness,linearburn,linearlight,luminance,multiply,negation,or,overlay,pinlight,red,reflect,saturation,shapeareamax,shapeareamax0,shapeareamin,shapeareamin0,shapeaverage,shapeaverage0,shapemedian,shapemedian0,shapemin,shapemin0,shapemax,shapemax0,shapeprevalent,softburn,softdodge,softlight,screen,stamp,subtract,value,vividlight,xor} +m "_blend_custom_formula : f. \"a = i#0/255; b = i#1/255; 255*cut(($5),0,1)\"" +if $2==0 repeat int($!/2) { l[$>,{$>+1}] { rv blend $mode,{$3%} } } +elif $2==1" && "$!>1 blend[^0] [0],$mode,{$3%},0 rm[0] +elif $2==2" && "$!>1 blend[^-1] .,$mode,{$3%},1 rm. +fi +um _blend_custom_formula +fx_blend_preview : +fx_blend $"*" +if $4 append_tiles , fi +fx_split_colors : skip ${2=0} +to_rgb +foreach { +nm=${-gui_layer_name} +pos=${-gui_layer_pos} +min_area={max(1,w*h*$3%)} +split_colors $1,$2,$min_area +=>[^] "name("$nm"),pos("$pos")" +if $4 gui_autocrop_layers fi +} +fx_split_colors_preview : +foreach { ++fx_split_colors ${1-4} drgba +foreach { to ${arg\ {1+!!$>},"Original","#"$>},1,1,43,7,1,255 } +frame 1,1,0 frame 3,3,255 to_rgba append_tiles , +} +fx_fade_layers : +if $!<2 return fi +to_colormode 0 +r ${-max_wh},1,100%,0,0,0.5,0.5 +a z r 100%,100%,{(d-1)*$1+1},100%,3 s z +fx_fade_layers_preview : +if $!<2 return fi +to_colormode 0 +r ${-max_wh},1,100%,0,0,0.5,0.5 +k[0,1] + / 2 +fx_append_tiles_preview : +frame 1,1,0,0,0,255 append_tiles $1,$2 +fx_morph_layers : +if ${4=0} _fx_revert_layers fi +to_rgb morph $1,$2,$3 +fx_apply_multiscale : skip "${13=}" +foreach { +w0={w} h0={h} +apply_scales "$13",$1,$2%,$3%,{10^$4},{arg(1+$5,1,3,5,6)} +if $8" || "($9" && "$8!=$12) to_a N=$! repeat $! { +angle={$9?$8+($12-$8)*$>/max($N-1,1):$8} +rotate[$>] $angle +} fi +if $14 +if $15 siz=$w0,$h0 else siz=${-max_wh} fi +r $siz,1,100%,{arg($14,1,3,5,6)} +c 0,255 +fi +w=${-max_w} h=${-max_h} N=$! +repeat $! { +cx={$9?$6+($10-$6)*$>/max($N-1,1):$6} +cy={$9?$7+($11-$7)*$>/max($N-1,1):$7} +gui_set_layer_pos[$>] {$>,($w-w)*$cx},{$>,($h-h)*$cy} +} +} +fx_apply_multiscale_preview : +foreach { +fx_apply_multiscale $"*" +N={int(sqrt($!))} N={round($!/$N,1,1)} r2dy {100/$N}% +to_rgba +max_wh=${-max_wh} +N=$! foreach { +cx={$9?$6+($10-$6)*$>/max($N-1,1):$6} +cy={$9?$7+($11-$7)*$>/max($N-1,1):$7} +r $max_wh,1,100%,0,0,$cx,$cy +0 text. "#"{1+$>}" ",1,1,24,1,255 +dilate. 5 to_rgba[1] j[0] [1],2,0,0,0,1,[2],255 k[0] +} +frame 1,1,0 frame 3,3,255 append_tiles , +} +fx_pack : skip "${8=}" +if $4 to_rgba foreach { +nm0={n} gui_layer_name nm=${} +0 t. {``$nm},3,0,$5,1,1 frame. 1,1,0 +if $6 *. -1 fi +n. 0,255 to_rgba. r. {[w+2,h+1,1,4]},0,0,0,1 +rv a y,{w#0>w?0.5:0} => $nm0 +} fi +if $3 to_a fi +repeat $! { gui_layer_name[$>] nm$>=${} =>[$>] {`lowercase(['${nm$>}'])`} } +c0="w" c1="h" c2="max(w,h)" c3="w*h" c4="n" +pack $2,${c$1} coords=${} +if $7 +repeat 256 { filename "$8/gmic_pack.txt",$> filename=${} if isfile(['{/$filename}']) else break fi } +if !narg($filename) filename="$8/gmic_pack.txt" fi +l[] { repeat narg($coords)/2 { +x={arg(1+2*$>,$coords)} y={arg(2+2*$>,$coords)} +('"Image ""#"{1+$>}" ("${nm$>}"): "$x,$y\n') +} a x ot $filename rm } +fi +=> "name(G'MIC packing),pos(0,0),mode(normal)" +if $4 autocrop fi +fx_pack_preview : skip "${8=}" +if !$! return fi +w={w} h={h} +filled=0 repeat $! { filled={$>,$filled+w*h} } +fx_pack $1,$2,$3,$4,$5,$6,0 +area={w*h} +to_rgba rr2d $w,$h,0 +i[0] $w,16,1,4,255 t[0] "Filled: "{round(100*$filled/$area)}%,3,1,14,1,0,0,0,255 +a y,0.5 +u "{$1}{$2}{$3}{$4}""{$5}_"{2*$4}"{$6}_"{2*$4}"{$7}{$8}" +fx_stroke : +to_a +foreach { +nm={n} +if !$26" && "$5 expand_xy $1,0 is_frame1=0 else expand_xy 1,0 is_frame1=1 fi +split_opacity +l. { +b $3 +if $6>=100 +shift $7,$8 +if $6!=100 wh={w},{h} r $6%,$6%,1,1,3 r $wh,1,1,0,0,0.5,0.5 fi +else +if $6!=100 wh={w},{h} r $6%,$6%,1,1,3 r $wh,1,1,0,0,0.5,0.5 fi +shift $7,$8 +fi +> {99.99-min(99.99,$2)}% +distance $5,$4 +($9^$10^$11^$12) +if $1>1 ($13^$14^$15^$16) a[-2,-1] x r. $1,1,1,4,3 c. 0,255 fi +i.. ($21^$22^$23^$24) ($17^$18^$19^$20) if $5 rv[-3,-1] fi +a[-3--1] x map.. .,1 rm. +} +a[0,1] c +if $is_frame1 shrink_xy 1 fi +if $25 rv fi +=>[^] $nm +} +fx_stroke_preview : +foreach { fx_stroke $* => foo gui_merge_layers } +fx_tiles2layers : +split_tiles $1,$2,$3 +fx_tiles2layers_preview : +split_tiles $1,$2,$3 to_rgba frame 1,1,0,0,0,255 frame 3,3,0,0,0,0 append_tiles , +fx_tones2layers : +sval=$2 eval={max($2,$3)} +remove_opacity +foreach { +nm={n} ++luminance rv +repeat $1-1 { +[1] +val0={$sval+($eval-$sval)*$>/($1-2)} +val1={$sval+($eval-$sval)*($>+1)/($1-2)-1} ++ir[0] $val0,$val1 +if $5 *. [0] b. $4% n. 0,255 +else b. $4% n. 0,255 +fi +a[-2,-1] c +} +rm[0] rv =>[^] $nm +} +fx_tones2layers_preview : +fx_tones2layers $* rv +r {100/$!}%,{100/$!}%,1,100%,2 +to_rgba frame 1,1,0,0,0,255 frame 3,3,0,0,0,0 append_tiles , +_fx_burn : +foreach { +w,h={[w,h]} ++norm +fx_fourier_old. 2 ++rows. 0,{$h-1} r. $2%,$2%,1,100%,0,0,0.5,0.5 b. $3% +j.. .,{($w-w)/2},{($h-h)/2} rm. +fx_fourier_old[-2,-1] 2 +blend overlay,$1 +} +fx_burn : +ac "_fx_burn ${1-3}",$4,$5 +fx_burn_preview : +gui_split_preview "fx_burn ${^0}",${-3--1} +fx_contrast_swm : +foreach { +split_opacity l[0] { ++luminance to_rgb +blur_xy[1] $1,$1 +if $2==0 negate[1] fi +rv blend hardlight,$3 +} +a c +} +fx_dodgeburn : +repeat $! l[$>] +luminance if $9==1 +fc[0] 128,128,128,255 fi +tk_fx_channel_processing[1] 1,1,0,$2,4,0,{100-$1},256,0,1,0,2,0,0 +tk_fx_channel_processing[1] 1,1,{-{256-$3}},0,0,0,100,256,0,0,0,2,0,0 +fx_gaussian_blur[1] $4,0,0,1,0,0,0 +luminance[0] +if $9==0 compose_dodge[0,1] else rv[1,2] compose_dodge[1,2] fi +tk_fx_channel_processing. 1,1,0,$6,4,$5,100,256,0,0,0,2,0,0 +tk_fx_channel_processing. 1,1,{256-$7},0,0,0,100,256,0,0,0,2,0,0 +fx_gaussian_blur. $8,0,0,1,0,0,0 +if $9==0 compose_colorburn[0,1] else compose_colorburn[-1,-2] fi +if $9==1 fx_gaussian_blur. $11,0,0,1,0,0,0 fi +if $10==0 if $9==1 rm[0] fi fi done done +fx_dodgeburn_preview : +gui_split_preview "fx_dodgeburn ${1--2}",$-1 +fx_split_freq : +repeat $! ++b. $1 -.. . /.. 2 +.. 128 rv[-2,-1] +mv[-2,-1] 0 done +fx_compose_freq : +repeat int($!/2) +-. 128 *. 2 +[-2,-1] c. 0,255 +mv. 0 done +compose_alpha : +e[^-1] "Compose image$? two-by-two, using alpha blending." +repeat int($!/2) l[$>,{$>+1}] +r. ..,..,..,100%,0,0,0.5,0.5 +to_colormode.. {a1=!({-2,s}%2);a2=!(s%2);max({-2,s}-a1,s-a2)+a1} +to_colormode. {a=max({-2,s},s);a+(a%2)} +if {-2,s==2" || "s==4} +_compose_alpha.. _compose_alpha. +sh. {s-1},{s-1} +*[-3,-1] rm.. +[-3,-2] -[-2,-1] +sh. 0,{s-2} sh.. {-2,s-1},{-2,s-1} +max. 1e-10 /.. . *. 255 rm[-2,-1] +else +sh. 0,{s-2} sh.. {-2,s-1},{-2,s-1} -.. [-4] *[-2,-1] /. 255 rm. +[-2,-1] +fi +done done c 0,255 +_compose_alpha : +sh. 0,{s-2} sh.. {-2,s-1},{-2,s-1} max. 1e-10 /. 255 *[-2,-1] rm. +fx_compose_alpha : +if ${2=0} _fx_revert_layers fi +repeat int($!/2) +to_rgba. sh. 3,3 *. $1 rm. +blend[-2,-1] alpha +mv. 0 done +fx_drop_shadow : +* -1 + 255 vignette {255*$5},80,95 * -1 + 255 +drop_shadow $1%,$2%,$3%,$4,{!$7} rotate $6,1,0 +fx_drop_shadow3d : +foreach { +_fx_drop_shadow3d $* } +fx_drop_shadow3d_preview : +foreach { +if $13 _fx_drop_shadow3d $* +else +_fx_drop_shadow3d $* rv blend alpha +fi +} +_fx_drop_shadow3d : +point3d 0,0,1 r3d. 1,0,0,$1 r3d. 0,1,0,$2 r3d. 0,0,1,$3 +u={i(0,8)} v={i(0,9)} w={i(0,10)} rm. +to_a channels 100% if im==iM return fi ++f 'X=x/w-0.5;Y=y/h-0.5;A=($7-$4*$7/100)*$w/(X*$u+Y*$v+$7*$w);if(A<0,1e8,A)' ++*. 'y/h-0.5' *.. 'x/w-0.5' +.. {0.5-$5/100} +. {0.5-$6/100} *.. {w} *. {h} +a[-2,-1] c warp[0] .,0,1,0 rm. +b $8% n 0,$12 i.. ($9^$10^$11) r.. .,.,1,3 a[-2,-1] c +fx_equalize_light : +ac "_fx_equalize_light $1,$2",$3,1 +_fx_equalize_light : +foreach { +split_opacity l[0] { +. +b. {max(0.1,100-$1)}% -[-2,-1] +if $2 match_pca. .. else n. ..,.. fi +rm.. +} +a c +} +fx_equalize_light_preview : +gui_split_preview "fx_equalize_light $*",${-3--1} +fx_equalize_shadow : +foreach { +negate blend softlight,$1 } +fx_equalize_shadow_preview : +gui_split_preview "fx_equalize_shadow $1",${-3--1} +fx_guided_lightrays : +bmode=${"arg0 $12,add,alpha,grainmerge,hardlight,lighten,lchlightness,luminance,overlay,softlight,value"} +if $3 cond="i" else cond="i && !(j(-1) && j(1) && j(0,-1) && j(0,1))" fi +if 0$_is_preview" && "$14 i[1] [0] gui_set_layer_opacity[1] 50 fi +l[0] { +if s==2" || "s==4 channels 100% else compose_channels max fi +ge $6% +100%,100% +eval.. "* +const L = $2<1?$2:$2^5; +const Xl = $7<0?3*$7:$7>100?100+3*($7-100):$7; +const Yl = $8<0?3*$8:$8>100?100+3*($8-100):$8; +const xl = Xl*(w - 1)/100; +const yl = Yl*(h - 1)/100; +"$cond" && u<=$4%?( +u = x - xl; v = y - yl; +polygon(#-1,2,xl,yl,xl + L*u,yl + L*v,-1,255); +)" +equalize. 65536,1,{iM} n. 0,1 power={10^(-$1%)} ^. {max(1e-2,$power)} b. $5% n. 0,255 +i[-2] (${9-11}:cyzx) r.. .,.,1,3 a[-2,-1] c +k. gui_set_layer_mode $bmode gui_set_layer_opacity $13 +} +if 0$_is_preview gui_merge_layers +elif 0$_output_mode k[0] +fi +fx_guided_lightrays_preview : +_is_preview=1 +fx_guided_lightrays $* +fx_illuminate_shape2d : +input_type,output_type,keep_input_bg,preview_shapes,blending_mode,opacity=$1,$2,$7,$10,$16,$17 +blending_mode=${arg0\ $blending_mode,normal,lighten,screen,dodge,add,darken,multiply,burn,overlay,softlight,hardlight,grainmerge} +keep_input_bg&={$!>1} +if $output_type +repeat $!-$keep_input_bg { _fx_illuminate_shape2d[$>] $* } +else +repeat $!-$keep_input_bg { if $keep_input_bg sel=$>,-1 else sel=$> fi l[$sel] { +if !$keep_input_bg" && "$input_type>=2 +_fx_illuminate_shape2d $* +elif $keep_input_bg" && "$input_type>=2 +_fx_illuminate_shape2d[0] $* +elif !$keep_input_bg" && "$input_type<=1 ++_fx_illuminate_shape2d $* rv +else +_fx_illuminate_shape2d[0] $* +fi +if !$preview_shapes" || "0$_is_preview!=1 +gui_set_layer_mode[0] $blending_mode +gui_set_layer_opacity[0] $opacity +if $!>1" && "(0$_output_mode==0" || "0$_is_preview==1) +if $keep_input_bg" && "!0$_is_preview . fi +gui_merge_layers[0,1] +else k[0] fi +fi +} } +fi +fx_illuminate_shape2d_preview : +_is_preview=1 +input_type,keep_input_bg,preview_interactive=$1,$7,$-2 +keep_input_bg&={$!>1} +if $preview_interactive fx_illuminate_shape2d_preview_interactive $* fi +if $keep_input_bg +repeat $!-1 { l[$>,-1] { +fx_illuminate_shape2d $* +rv to_colormode 0 a z +gui_split_preview "slices 50%,100%",$-1 +} } +else +gui_split_preview "fx_illuminate_shape2d $*",$-1 +fi +fx_illuminate_shape2d_preview_interactive : +_output_mode=0 +input_type,keep_input_bg=$1,$7 +keep_input_bg&={$!>1} +repeat $!-$keep_input_bg { if $keep_input_bg sel=$>,-1 else sel=$> fi +l[$sel] { +to_rgba ++_fx_illuminate_shape2d[0] $1,2,${3-6},0,1,""$9,0,${11-15},""${16-29},""0,0 +if $!>2 rm[0] elif $input_type>=2 sh[0] 0,2 f. 128 rm. fi +siz=${fitscreen\ {[w,h,1]},256,640} +wsiz0=${fitscreen\ $siz,1,30%,100%} +wsiz=$wsiz0 +r $siz,1,100%,3 +s. c,-3 !=. 0 l.. { - 128 / 127 s c,-2 / } a[-2,-1] c +rv s. c,-3 +(160,128;128,160) r. 16,16 r. ..,..,1,3,0,2 +30,30,1,1 circle. 50%,50%,15%,1,1 b. 4 n. 0,1 +100%,100%,1,3,[255,255,0] +=> normal,rgb,alpha,background,light_alpha,light_rgb +w[] $wsiz,0,0,{rgb,([{*,u},{*,v}]-[$wsiz])/2},"[G'MIC] Illuminate 2D Shape" +cursor 0 +x0,y0,ox,oy,ob,olightz=-1 +lightz=2 clicked=0 +do +x,y,b,mw={rgb,[{*,x},{*,y}]*[w,h]/[{*,w},{*,h}]},{*,b},{*,-o} +lightz={cut($lightz-0.3*sign($mw)+($y0>=0?3*($y-$y0)/h),0.1,4)} +if $x<0 x,y={rgb,ang=$|;(1+[cos(1.4*ang),sin(0.85*ang)])*[w,h]/2} fi +if !$b" || "($b&1) +if $b" && "!$clicked x0,y0=$x,$y +elif !$b x0,y0=-1 +fi +lightx,lighty={rgb,3.5*(2*[$x/w,$y/h]-1)} +if [$ox,$oy,$ob,$olightz]!=[$x,$y,$b,$lightz] ++fx_illuminate_shape2d[normal,rgb] 4,0,${3-6},1,1,""$9,0,${11-15},""${16-25},$lightx,$lighty,$lightz,$29,""0,0 ++j[background] .,0,0,0,0,1,[alpha],255 rm.. ++r2dx[light_alpha,light_rgb] {light_rgb,8+$lightz*(w-8)} j... .,{[$x,$y]-[w,h]/2},0,0,1,.. rm[-2,-1] +r. $wsiz,1,100% to. "Light: ("{``{_round([$lightx,$lighty,$lightz],0.1)}}")",2,2,16 +w. rm. wait 20 +else wait +fi +clicked=$b +elif $b&2 ++j[background] [rgb],0,0,0,0,1,[alpha],255 ++r2dx[light_alpha,light_rgb] {light_rgb,8+$lightz*(w-8)} j... .,{[$x,$y]-[w,h]/2},0,0,1,.. rm[-2,-1] +w. rm. wait +fi +if {*,CTRLLEFT}" && "{*,-D} w[] {1.5*[{*,w},{*,h}]} wsiz={*,w},{*,h} +elif {*,CTRLLEFT}" && "{*,-C} w[] {0.75*[{*,w},{*,h}]} wsiz={*,w},{*,h} +elif {*,CTRLLEFT}" && "{*,-R} w[] $wsiz0 +fi +ox,oy,ob=$x,$y,$b +while {*}" && "!{*,ESC}" && "!{*,Q} +w 0 rm +} } +_fx_illuminate_shape2d : +input_type,output_type,gR,gG,gB,gA,keep_input_bg,keep_output_transparency,min_shape_area,preview_shapes,dilation,shape_smoothness,bump_factor,weight_avg_max,resolution,blending_mode,opacity,ambient,diffuse,specular,shininess,light_smoothness,flatness,linearity,levels,lightx,lighty,lightz,normalize_illumination,preview_interactive,preview_mode=${1-31} +nm={n} +if $input_type==0 +to_rgba ++channels. 100% >. 0 . +select_color... 0,$gR,$gG,$gB,$gA +mv... $! -[-2,-1] +elif $input_type==1 +to_rgba ++channels. 100% >. 0 *[-2,-1] +if $min_shape_area>1 +quantize_area. {$min_shape_area^2} fi +s. c,-{s-1} >. 0 rv[-2,-1] +if s>1 f. "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm. round. 0.01 fi +label. 0,0 f. "j(1)!=i || j(0,1)!=i" thinning. 1 ==. 0 *. .. +select_color... 0,$gR,$gG,$gB,$gA +mv... $! -[-2,-1] +elif $input_type==2 +to_a +s c,-{s-1} >. 0 *.. . rv s. c S={$!-1} +[^0] /. $S +elif $input_type==3 ++channels 100% >. 0 *.. . rv +f. "I==vector4(0)?[128,128,255,255]:I" +channels. 0,2 +else ++channels 100% rv +fi +if 0$_is_preview" && "$preview_shapes +if $input_type==3 k[0] else k. fi ++dilate. 3 +label_fg.. 0 srand 0 {-2,iM+1},1,1,3,'x==0?[0,0,0]:x==1?[255,255,255]:u([255,255,255])' map... . rm. +*. 255 a c +return +fi +if $input_type<=1 +shape2bump. {arg($resolution,2048,1024,512,256,128,64)},$weight_avg_max,{$dilation%*max(w,h)},$shape_smoothness +fi +if $input_type<=2 +if $input_type==2" && "$shape_smoothness mM={[im,iM]} guided. ..,$shape_smoothness%,100 n. $mM fi +*. $bump_factor +fi +if $output_type==1 +if $input_type<=2 +if $keep_output_transparency k[-2,-1] n 0,255 rv a c +else k. n 0,255 +fi +else +rm gui_error_preview "Cannot convert a normal map to a bump map." return +fi +elif $output_type==2 +if $input_type<=2 round 0.0001 bump2normal. f. "i(#-2)?I:[128,128,255]" fi +if $keep_output_transparency k[-2,-1] rv *. 255 a c +else k. +fi +else +if $input_type<=2 g. xy a[-2,-1] c +elif $input_type==3 -. 128 /. 127 s. c,-2 /[-2,-1] +fi +f. "* +begin( +const flatness = "$flatness"; +const ka = "$ambient"%; +const kd = "$diffuse"%; +const ks = "$specular"%; +const alpha = "$shininess"; +const m1 = max(1,"$lightz"); +const mwh1 = max(w,h) - 1; +light = [ "m1*$lightx,m1*$lighty,-$lightz" ]; +camera = [ 0,0,-"$lightz" ]; +); +res = i#0?( +P = [ 2*x/mwh1 - 1,2*y/mwh1 - 1,0 ]; +L = light - P; +L/=norm(L); +V = camera - P; +V/=norm(V); +N = -[ i0,i1,flatness ]; +N/=norm(N); +R = 2*dot(N,L)*N - L; +res = ka + kd*dot(L,N) + ks*max(dot(R,V),0)^alpha; +):0; +[ res,0 ]" +channels. 0 *. 255 c. 0,255 +if $light_smoothness" || "$linearity +mM={[im,iM]} +if $light_smoothness b. $light_smoothness% fi +if $linearity n. 0,1 ^. {10^-($linearity%)} fi +n. $mM +fi +if $levels quantize. $levels,1,1 fi +if $normalize_illumination n. 0,255 fi +rv[-2,-1] *. 255 a[-2,-1] c +=>[^] $nm +if !$keep_output_transparency remove_opacity. fi +fi +=>[^] $nm +_fx_lightglow : +mode=${arg0\ $3,burn,dodge,freeze,grainmerge,hardlight,interpolation,lighten,multiply,overlay,reflect,softlight,stamp,value} +repeat $! { ++gradient_norm. >=. {100-$1}% distance. 1 ^. $2 *. -1 n. 0,255 blend $mode,$4 +mv. 0 } +fx_lightglow : +ac "_fx_lightglow ${1-4}",$5 +fx_lightglow_preview : +gui_split_preview "fx_lightglow $*",${-3--1} +fx_light_leaks : +filename=lightleak_${"padint $1",6}.cimgz +input_cached data_lightleaks/$filename +mode=${arg0\ $7,normal,lighten,screen,dodge,add,darken,multiply,burn,overlay,softlight,hardlight,difference,subtract,grainextract,grainmerge,divide,hue,saturation,value} +mv. 0 +repeat $!-1 { l[0,{1+$<}] { ++r[0] {1,w},{1,h},1,3,5 +rotate. $2,1,1,50%,50% +if $3>1" || "$4>1 f. 'w2=w/2;h2=h/2;X=x-w2;Y=y-h2;i(w2+X/$3,h2+Y/$4,0,c,1,0)' fi +c. 0,255 +if $5 rgb2hsv. sh. 0 +. $5 rm. hsv2rgb. fi +if $8 +nm=${gui_layer_name[1]} +=> name($nm),opacity({$6*100}),mode($mode) rv[-2,-1] +else blend[1,-1] $mode,$6 fi +} } +rm[0] +fx_light_leaks_preview : +gui_split_preview "fx_light_leaks ${1--5},0",${-3--1} +_fx_light_leaks : +u="" repeat 71 { if narg($u) u=$u, fi u=${u}lightleak_${"padint "$>,6} } +u $u +fx_light_patch : +foreach { split_opacity ac[0] "light_patch $1,$2,$3",$4 a c } +fx_lightrays : +lightrays $1,$2%,$3%,$4,$5 +if $6 repeat $! { r[$>] 100%,100%,1,{{$>,s}+({$>,s}%2)} } fi +fx_pop_shadows : +foreach { +split_opacity l[0] { +.x2 +luminance.. negate.. imM={-2,[im,iM]} b.. $2% n.. $imM +blend[0,1] overlay,$1 +max +if $3 n 0,255 fi +} +a c +} +fx_pop_shadows_preview : +gui_split_preview "fx_pop_shadows $*",${-3--1} +fx_light_relief : +b $11% light_relief ${1-5},{[$6,$7]%},${8-10} +fx_shadow_patch : +foreach { split_opacity ac[0] "shadow_patch $1",$2 a c } +fx_slice_luminosity : +remove_opacity +foreach { +to_rgb +_fx_slice_luminosity $* +if $2 i[0] [0] a[-2,-1] c fi +rv +} +fx_slice_luminosity_preview : +remove_opacity +foreach { +to_rgb +_fx_slice_luminosity $* +if $3==0 rm[0] channels {s-1} +elif $3==1 100%,100%,1,1,128 a[0,-1] c r. 100%,100%,1,4 blend alpha +elif $3==2 a c +else +. 96 c. 0,255 a c +fi +} +_fx_slice_luminosity : +if $1==0 +compose_channels + /. 3 +elif $1==1 +luminance +elif $1==2 +srgb2lab8. channels. 0 +else +compose_channels max +fi +if $4 +apply_curve[1] 0,{$5-$7-0.1},0,$5,255,$6,255,{$6+$8+0.1},0,512,0 fi +if $9 +apply_curve[1] 0,{$10-$12-0.1},0,$10,255,$9,255,{$11+$13+0.1},0,512,0 fi +if $14 +apply_curve[1] 0,{$15-$17-0.1},0,$15,255,$16,255,{$16+$18+0.1},0,512,0 fi +if $19 +apply_curve[1] 0,{$20-$22-0.1},0,$20,255,$21,255,{$21+$23+0.1},0,512,0 fi +rm[1] max[^0] +fx_boxfitting : +boxfitting ${1-4} +if $5 to_rgba replace_color 0,0,0,0,0,255,0,0,0,0 fi +fx_camouflage : +foreach { +split_opacity l[0] { +channels 0 r {w+16},{h+16},1,1,0 rand 0,16 +amp=$3 do smooth {min(50,$amp)},0,1 amp-=50 while $amp>0 +shrink_xy. 8 n 1,$2 round +repeat $1 { +area 0,0 <. {1+2^$>} inpaint[0] [1],0,3 rm. } ++colormap 0 n.. 0,{w-1} +4,1,1,3,"col=[${4-15}];col[3*x,3]" +r. ..,..,1,3,3 rm.. map.. . rm. +} +a c +} +fx_canvas : +repeat $! { l. { +if $4 +({cos($2*pi/180)}^{sin($2*pi/180)}) vector2tensor. r. ..,.. +smooth.. .,$1 rm.. sharpen. $3 c. 0,255 +({cos($6*pi/180)}^{sin($6*pi/180)}) vector2tensor. r. ..,.. smooth... .,$5 rm. sharpen.. $7 c.. 0,255 ++[-2,-1] /. 2 +else +({cos($2*pi/180)}^{sin($2*pi/180)}) vector2tensor. r. ..,.. smooth.. .,$1 rm. sharpen. $3 c. 0,255 +fi +} mv. 0 } +fx_canvas_preview : +gui_split_preview "fx_canvas $*",${-3--1} +jeje_clouds : ++clouds $1%,1,$2 blend alpha +jeje_clouds_preview : +jeje_clouds $1,$2 +fx_cracks : +ac "cracks $1,$2,{$6/255},${3-5},255",$7 +fx_cracks_preview : +gui_split_preview "fx_cracks $*",${-3--1} +fx_crystal : +foreach { +split_opacity l[0] { +s={s} ++gradient_norm >=. {(100-$3)/5} remove_pixels. {100-max(0.1,$1*$3%)}%,{is} * ++norm !=. 0 a c +sigma=0.5 +do ++b. $sigma sigma*={(1+$2)} +sh[0,-1] $s max. .. rm[-2,-1] +f. 'W=i(x,y,z,$s);if(W<0.001||W>=1,0,if(c<$s,i/W,1))' +if !iM rm[1] break fi +sh. $s +j[0] [1],0,0,0,0,1,[2] k[0] +while 1 +channels 0,{$s-1} +} +a c +} +fx_crystal_preview : +gui_split_preview "fx_crystal $*",${-3--1} +fx_crystal_background : +foreach { +split_opacity l[0] { +N={2*max(3,round((${"is_percent $2"}?4*wh*$2:$2)))} +if $5 col="u([255,255,255])" else col="u(255)" fi +srand $3 M={max(w,h)} 2,$N +repeat $1 { rand. {-$M/2},{3*$M/2} polygon.. $N,{^},{-$4%},{$col} } +rm. n 0,255 +} +a c +} +jeje_fibers : +100%,100%,1,1,0 +l. +fibers $1,$2%,$3 +gt 0 +n 0,255 +done +r. [0] +max +jeje_fibers_preview : +gui_split_preview "jeje_fibers $1,$2,$3",$-1 +jeje_freqy_pattern : +noise {$1*4} +freqy_pattern {50/$2}%,{$3*2} n 0,255 +jeje_freqy_pattern_preview : +gui_split_preview "jeje_freqy_pattern $1,$2,$3",$4 +fx_halftone : +adjust_colors ${1-3},0,0,0,255 b $4 +foreach { split_opacity halftone[0] ${5-9} a c } +fx_halftone_preview : +gui_split_preview "fx_halftone $*",${-3--1} +fx_generic_halftone : +background,base_shape,max_radius,smoothness,antialiasing,bw_only,shape,shape_layout,shape_density,shape_smoothness,shape_angle=${1-11} +afact:=arg0($antialiasing,1,1.25,1.5,2,2.5) +if $shape sel=^ else sel=^0 fi +foreach[$sel] { +b {$smoothness/50}% +if $bw_only luminance n 0,1 else n 0,1 s c fi +ws,hs:=round([w,h]*$afact) +delta:=max(2,round($afact*(100-$shape_density))) +if $shape==0 +pass[0] 0 +if {s==2||s==4} channels. 100% else l. { s c + } fi +r. {0,[w,h]},1,1,0,0 r. $ws,$hs,1,1,3 +b. $shape_smoothness ge. 0.5 +(0,1,0;1,1,1;0,1,0) +dilate.. . rm.. rv[-2,-1] -[-2,-1] +if $shape_density distance. 1 round. mod. $delta ==. 0 fi +elif $shape==1 +if $shape_layout==0 +{round([$ws,$hs]/$delta)},1,1,1 r. $ws,$hs,1,1,4,0,0.5,0.5 +elif $shape_layout==1 +$ws,$hs noise_poissondisk $delta +else +$ws,$hs,1,1,u<0.5*($shape_density%)^4 +fi +elif $shape==2 +$ws,$hs,1,1,"const ang = $shape_angle°; +const ca = cos(ang); +const sa = sin(ang); +!(round(sa*x-ca*y)%$delta)" +elif $shape==3 +++ b. {$shape_smoothness/50}% r. $ws,$hs,1,1,3 otsu. 256 (0,1,0;1,1,1;0,1,0) +dilate.. . rm.. rv[-2,-1] -[-2,-1] +distance. 1 round. mod. $delta ==. 0 +elif $shape==4 +$ws,$hs +eval " +const w2 = w/2; +const h2 = h/2; +const dt = 0.1°; +const A = max(6,$delta)/(2*pi); +const tmax = sqrt(w^2+h^2)/2/A; +for (t = 0, t<=tmax, t+=dt, +tdt = t + dt; +ct = cos(t); +st = sin(t); +ctdt = cos(tdt); +stdt = sin(tdt); +r = A*t; +xt0 = w2 + r*cos(t); +yt0 = h2 + r*sin(t); +xt1 = w2 + r*cos(tdt); +yt1 = h2 + r*sin(tdt); +polygon(2,xt0,yt0,xt1,yt1,1,1); +)" +fi ++distance. 1,0 max_patch. 5 +==.. 0 mul[-2,-1] distance. 1,0 *[-2,-1] +foreach[^-1] { +pass. 1 100%,100%,1,1,{$background?255:0} +eval.. "* +const col = $background?0:1; +i?( +lum = i(#0,round(x*w#0/w),round(y*h#0/h)); +$background?(lum = 1 - lum); +R = round(i*lum*$max_radius%); +$base_shape==1?( +ellipse(#-1,x,y,R,R,0,1,col); +):( +x0 = x - R; y0 = y - R; x1 = x + R; y1 = y + R; +polygon(#-1,4,x0,y0,x1,y0,x1,y1,x0,y1,1,col); +) +)" +r. {0,[w,h]},1,1,2 k. +} +rm. a c +if $antialiasing sqr fi +n 0,255 +} +fx_generic_halftone_preview : +background,base_shape,max_radius,smoothness,antialiasing,bw_only,shape,shape_layout,shape_density,shape_smoothness,shape_angle=${1-11} +if !$shape" && "$!<2 gui_error_preview "Missing top layer with halftoning shape." _persistent= return fi +if "['${1--2}']==['$-1'] && "narg($_persistent) +rm $_persistent +else +fx_generic_halftone $* +if !$shape rm[0] fi ++store _persistent +fi +gui_crop_resize_preview +u "{$1}{$2}{$3}{$4}{$5}{$6}{$7}""{"$shape_layout"}"_{$shape==1?2:0}"{"$shape_density"}""{"$shape_smoothness"}"_{isin($shape,0,3)?2:0}"{"$shape_angle"}"_{isin($shape,2)?2:0}"{${1--2}}" +fx_hearts : +ac "hearts $1",$2 +fx_hearts_preview : +gui_split_preview "fx_hearts $*",${-3--1} +fx_lava : +foreach { +split_opacity l[0] { +norm +100%,100% plasma. 1,1,{16-$1} smooth. $2,0,1,$3,$3,0.8,90 * +gradient_norm n 0,255 +equalize map 3 +sharpen $4 +} +a c +} +fx_lava_preview : +gui_split_preview "fx_lava $*",${-3--1} +fx_marble : +foreach { split_opacity marble[0] {$1/10},{$2/10},$3,$4,$5,$6,$7,$8,$9%,$10% a c } +fx_maze : +foreach { +w={w} h={h} +r. {100/$1}%,{100/$1}%,1,100%,2 +if $3==0 f. 1 +elif $3==1 negate. +fi +maze_mask. $1 dilate. $2 *. 255 +if !$5 negate. fi +if $4 r. $w,$h,100%,100% fi +} +fx_mineral_mosaic : +foreach { +to_rgb ++b $3 segment_watershed. $1 +norm. +area. 0 +<=. {$2^2} inpaint.. . rm. label. ++f[0] 'if(c==0,x,y)' rv[-2,-1] +blend[-2,-1] shapeaverage,1,1 +-[-3,-1] rm[0,-2] channels. 0,1 +alpha={$5*pi/180} sh. 0 *. {cos($alpha)} rm. sh. 1 *. {sin($alpha)} rm. compose_channels. + +normalize_local. 1000 n. -$4,$4 ++ c 0,255 +} +fx_mosaic : +ac "foreach { split_opacity mosaic[0] $1 a c }",$2 +fx_mosaic_preview : +gui_split_preview "fx_mosaic $*",${-3--1} +fx_shapes : +if $1 +remove_opacity +foreach { +if !$7 _fx_shapes $* * 255 +elif $7==1 split_opacity to_rgb[0] s[0] c repeat 3 { _fx_shapes[$>] $* } *[0-2] 255 a[0-2] c a c +else +_fx_shapes $* r[0] $3%,$3% r[0] [1],[1] * +fi +} +else +if $!<=$2 +error[] "Command '$0': Some layers are missing in 'Custom layers' mode ("{$2+1}" expected at least, "$!" provided)." fi +to_colormode[0-{$2-1}] ${max_s[0-{$2-1}]} remove_opacity[$2--1] +repeat $!-$2 { l[0-{$2-1},{$2+$>}] { +norm. w={w} h={h} r. $3%,$3%,1,1,2 +s={$4*max(round($w/w),round($h/h))} +r0={$s*$5%} r1={$s*$6%} +repeat $2 { r={round($r0+$>*($r1-$r0)/($2-1))} if $r +r[$>] $r,$r,1,100%,3 else 1,1 fi } +r[-$2--1] $s,$s,1,100%,0,0,0.5,0.5 +map_sprites[$2--1] $2,$8 +} } rm[0-{$2-1}] +fi +fx_shapes_preview : +if $1 foreach { +w={w} h={h} +gui_split_preview "fx_shapes ${1-3},1,${5--2}",$-1 +r $w,$h,1,100%,0,0,0.5,0.5 +} else +if $!>$2 repeat $!-$2 { l[0-{$2-1},{$2+$>}] { +w={w} h={h} ++fx_shapes ${1-3},1,${5--2} rm.. +r. $w,$h,1,100%,0,0,0.5,0.5 +} } rm[0-{$2-1}] +else gui_warning_preview "Missing input layers!" +fi +fi +_fx_shapes : +norm w={w} h={h} r $3%,$3%,1,1,2 +s={(1+$10)*$4*max(round($w/w),round($h/h))} +r0={$s*$5%} r1={$s*$6%} +repeat $2 { r={round($r0+$>*($r1-$r0)/($2-1))} if $r _fx_shapes{$1-1}[] $r,$s else 1,1 fi } +r[-$2--1] $s,$s,1,1,0,0,0.5,0.5 +if $9 rv[-$2--1] *[-$2--1] -1 +[-$2--1] 1 fi +map_sprites $2,$8 +if $10 r 50%,50%,1,1,2 fi +_fx_shapes0 : +shape_circle $1 +_fx_shapes1 : +$1,$1,1,1,1 +_fx_shapes2 : +$1,$1,1,1 = 1,50%,50% distance 1,1 < {$1/2} +_fx_shapes3 : +$2,$2,1,1,'x+y<=2*$1-1' +_fx_shapes4 : +$2,$1,1,1,1 +_fx_shapes5 : +$1,$2,1,1,1 +_fx_shapes6 : +ball $1,200 n 0,1 +_fx_shapes7 : +shape_heart 65 r $1,$1,1,1,2 >= 50% +_fx_shapes8 : +shape_star $1 +_fx_shapes9 : +arrow3d 0,0,0,1,0,0,15%,40%,30% col3d 1 *3d $1 c3d +$2,$2 j3d. ..,50%,50%,0,1,2,0,0 +rm.. +mirror y max +_fx_shapes10 : +S={$2+1-($2%2)} +$S,$S,1,1,"X=x/(w-1);Y=y/(h-1);r=abs(0.5-sqrt(X^2+Y^2));a=atan2(y,x);r<0.1-0.17*(0.5-$1/$2)*sin(2*a)" ++mirror xy max +_fx_shapes11 : +_fx_shapes0 $* expand_xy 1,0 +erode 3 - +_fx_shapes12 : +_fx_shapes1 $* expand_xy 1,0 +erode 3 - +_fx_shapes13 : +_fx_shapes2 $* expand_xy 1,0 +erode 3 - +_fx_shapes14 : +_fx_shapes3 $* expand_xy 1,0 +erode 3 - +_fx_shapes15 : +_fx_shapes7 $* expand_xy 1,0 +erode 3 - +_fx_shapes16 : +_fx_shapes8 $* expand_xy 1,0 +erode 3 - +_fx_shapes17 : +_fx_shapes9 $* expand_xy 1,0 +erode 3 - +fx_pack_ellipses : +radius_min,radius_max,radius_dilation,isotropy_min,isotropy_max,isotropy_levels,orientation_ellipse,region_analysis,bgR,bgG,bgB,bgA,render_factor,preserve_size=$* +isotropy_min,isotropy_max:="sort([ $isotropy_min,$isotropy_max ])/100" +radius_min,radius_max:="sort([ $radius_min,$radius_max ])" +render_factor+=1 +foreach { +progress -1 +to_rgb +nm={n} => img +1,1,1,3 => set ++structuretensors[img] 1 b. 1% eigen. +f.. "l0 = sqrt(i0); l1 = sqrt(i1); [1 - (l1 - l0)/l1,0]" channels.. 0 +if $isotropy_levels quantize.. $isotropy_levels,0,-1 fi +n.. $isotropy_min,$isotropy_max =>.. isotropy +if $orientation_ellipse==0 f[isotropy] 1 . +elif $orientation_ellipse==1 +f. "[ atan2(-i0,i1),0 ]" +else +f. "[ atan2(i1,i0),0 ]" +fi +channels. 0 => angles +if $region_analysis +norm[img] b. 0.5% slic. {30*$region_analysis},0 g. xy,1 a[-2,-1] c norm. ge. 5% +else 100%,100% +fi +=> contours ++==[contours] 0 => mask +nb_attempts=0 +repeat inf { +x0,y0,x1,y1:=" +const N = 4*$radius_max; +wm1 = w#$mask - 1; +hm1 = h#$mask - 1; +Pc = round(u([wm1,hm1])); P0 = Pc - N/2; P1 = Pc + N/2; +[ cut(P0[0],0,wm1), cut(P0[1],0,hm1), cut(P1[0],0,wm1), cut(P1[1],0,hm1) ]" ++z[mask] $x0,$y0,$x1,$y1 r. {[w,h]+2},1,1,0,0,0.5,0.5 distance. 0 +x,y,r:=$x0+xM-1,$y0+yM-1,min($radius_max,iM-1.25) rm. +if $r>$radius_min +r2={isotropy,max(1,$r*i($x,$y))} +ellipse[mask] $x,$y,$r,$r2,{angles,rad2deg(i($x,$y))},1,0 +eval "da_push(#$set,[$x,$y,$r])" +nb_attempts=0 +else +if narg($contours) +[mask] [contours] rm[contours] +else nb_attempts+=1 if $nb_attempts>10 break fi +fi +fi +if !($>%100) progress {mask,cut(400*(1-ia)^3,0$progress,100)} fi +} +rm[mask] +da_freeze[set] +W,H={img,[w,h]} +{img,round($render_factor*[w,h])} => mask +eval[set] " +const fact = $render_factor; +r1 = fact*(i2 + $radius_dilation); +r2 = max(1,r1*i(#$isotropy,i0,i1)); +ellipse(#$mask,round(fact*i0),round(fact*i1),r1,r2,i(#$angles,i0,i1),1,y + 1); +I" +r[img] {mask,[w,h]},1,100%,3 +blend[img] [mask],shapeaverage0 +!=[mask] 0 *[mask] 255 +a[img,mask] c +if $preserve_size r[img] $W,$H,1,100%,2 fi +k[img] +100%,100%,100%,4 fc. $bgR,$bgG,$bgB,$bgA rv blend alpha => $nm +progress 100 +} +fx_pack_ellipses_preview : +gui_split_preview "fx_pack_ellipses ${1-12},1,0" +fx_pack_sprites : +if $6 +if $!<2 error[] "Command '$0': Masking requires at least two input layers ! +(please check that 'Input Layers' is correctly set)." fi +foreach[^-1] { to_rgba split_opacity +!=[1] 0 *[0] . a c autocrop 0 } +remove_empty[0--2] +channels. 100% channels. -4,0 mv. 0 +pack_sprites[0--2] ${1-5} +else +foreach { to_rgba split_opacity +!=[1] 0 *[0] . a c autocrop 0 } +remove_empty i[0] $7,$8,1,5 pack_sprites ${1-5} +fi +channels[0] 0,{0,s-2} +fx_paper : +ac "texturize_paper",$1 +fx_paper_preview : +gui_split_preview "fx_paper $*",${-3--1} +jeje_periodic_dots : +tW={max(w,h)/$4} +$tW,$tW +periodic_dots. $* +repeat $4*$4-1 +i . +done +append_tiles[1--1] $4,$4 k. +if $5>0 n 0,255 map {$5-1} fi +jeje_periodic_dots_preview : +jeje_periodic_dots $* +fx_pills : +$=arg n:=$1?4:2 +foreach { +w,h:=w,h rm +repeat $1?3:1 { +$w,$h,1,1,"begin( +const cyc = "${arg$n}"*pi; +const ang = "${arg{1+$n}}"°; +const M = max(w,h); +R = rot(ang); +); +x0 = lerp(-cyc,cyc,x/M); +y0 = lerp(-cyc,cyc,y/M); +x = x0*R[0] + y0*R[1]; +y = x0*R[2] + y0*R[3]; +sqrt(abs(sin(x + cos(y + sin(x + cos(y)))) * sin(y + cos(x + sin(y + cos(x))))))" +n+=2 +} +n 0,255 +a c +} +fx_pills_preview : +fx_pills $* +u "{$1}""{$2}_"{$1?0:2}"{$3}_"{$1?0:2}"{$4}_"{$1?2:0}"{$5}_"{$1?2:0}"{$6}_"{$1?2:0}"{$7}_"{$1?2:0}"{$8}_"{$1?2:0}"{$9}_"{$1?2:0} +fx_plaid_texture : +foreach { +w={w} h={h} s={s} +rows $1% +b $5% sharpen $6 +r $w,$h,1,$s,2 ++rotate[0] $3,1,2,50%,50% +repeat $2-1 { +rotate[0] {$3+$4*($>+1)/($2-1)},1,2,50%,50% +[-2,-1] } rm[0] +/ $2 +} +fx_polka_dots : +to_rgba polka_dots {$1*$2/100},${2--1} +fx_color_ellipses : +color_ellipses $1,$2,$3 +_fx_random_pattern : +if $4 srand _seed={_round(u(100000))} else _seed=$3 fi +srand $_seed +random_pattern $1,$1,$2 +adjust_colors. ${5-9} +mv. 0 +fx_random_pattern : +if 0$_output_mode rm fi +_fx_random_pattern $* +fx_random_pattern_preview : +_fx_random_pattern {max($_preview_area_width,$_preview_area_height)},${2--1} +k[0] rr2d $_preview_area_width,$_preview_area_height,2,2 +to "Seed: \#"$_seed,5,5,5%,2 +u "{$1}{$2}{"{$4?$_seed:$3}"}{0}{$5}{$6}{$7}{$8}{$9}" +jeje_rays : +foreach { +100%,100% rays. {[w*$1,h*$2]%},$3,$4 gt. {$5*100}% +($6,$9^$7,$10^$8,$11) map.. . rm[0,-1] +} +jeje_rays_preview : +gui_split_preview "jeje_rays $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11",$-1 +fx_syntexturize : +foreach { +if $3 +b {20.5-$3/50}% -[0] [1] fc. ${average_vectors.} + c 0,255 fi +syntexturize $1,$2 +} +fx_syntexturize_preview : +gui_split_preview "fx_syntexturize 100%,100%,$3",${-3--1} +_fx_syntexturize_matchpatch_preview : +foreach { +if $7 +b {20.5-$7/50}% -[0] [1] fc. ${average_vectors.} + c 0,255 fi +w={w} h={h} +syntexturize_matchpatch 100%,100%,${3--1} +to_rgba r $w,$h,1,4,0,0,0.5,0.5 +} +fx_syntexturize_matchpatch_preview : +gui_split_preview "_fx_syntexturize_matchpatch_preview ${1--2}",${-3--1} +fx_rorschach : +foreach { +remove_opacity +if $3==0 norm rorschach $1%,$2 * 255 +elif $3==1 to_rgb rorschach $1%,$2 * 255 +else +norm rorschach. $1%,$2 blend shapeaverage0 +fi +} +fx_satin : +($4,$8^$5,$9^$6,$10^$7,$11) srgb2rgb. r. 256,1,1,4,3 rgb2srgb. +foreach[^-1] { +srand $3 channels 0 f 0 +repeat $1 { +100%,100%,1,1,"begin( +A = u([0,0],[w,h]-1); +B = u([0,0],[w,h]-1); +N = [0,-1,1,0]*(B - A); +D = A + N; +C = B + N; +abc = solve([A,1,B,1,C,1,D,1],[0,255,255,0]); +); +dot(abc,[x,y,1])" +c. 0,255 -- abs +} +b $2% gradient_norm negate n 0,255 +if $12 normalize_local , fi +pass. 1 map.. . rm. +sh. 0,2 adjust_colors. ${13-17} rm. +} +rm. +fx_mad_rorscharchp : +fx_rorschach $1,1,1 ++mirror y +if $2==0 fx_compose_average 1,0 +elif $2==1 fx_compose_grainextract 1,0 +elif $2==1 fx_compose_vividedges 1,1,0.5,1 fi ++fx_plaid_texture $3,2,0,90,$4,$5 +if $6==0 fx_compose_vividedges 1,1,0.5,1 +elif $6==1 fx_compose_average 1,0 +elif $6==2 fx_compose_difference 1,0 +elif $6==3 fx_compose_negation 1,0 +elif $6==4 fx_compose_negation 1,0 +elif $6==5 fx_compose_darkedges 1,1,0.8,1 fi +if $7==0 fx_graphic_novelfxl 0,2,6,5,20,0,0.62,14,0,1,0.5,0.78,1.92,0,0,12,1,1,1,0.5,0.8,1.28,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $7==1 fx_graphic_novelfxl 0,7.2,14.65,5,20,0,1.06,36.14,0,1,0.5,0.85,1.93,0,0,8,1,1,1,0.5,0.95,2.89,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $7==2 fx_graphic_novelfxl 0,7.22892,14.6506,5,20,0,1.6,36.1,0,1,0.5,0.6,3.6,0,0,11,1,1,1,0.5,0.8,2.16,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,7,1,1,1,0.5,0.45,1 +elif $7==3 fx_graphic_novelfxl 0,7.22892,14.6506,5,20,0,1.59036,36.1446,0,1,0.5,0.590361,3.61446,0,1,17,1,1,1,0.5,0.795181,2.16867,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,7,1,1,1,0.5,0.45,1 +elif $7==4 fx_graphic_novelfxl 0,7.22892,14.6506,5,20,0,1.59036,36.1446,0,1,0.5,0.855422,1.92771,0,0,8,1,1,1,0.5,0.373494,2.89157,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $7==5 fx_graphic_novelfxl 1,7.22892,14.6506,5,20,0,1.06024,14,0,1,0.5,0.855422,1.3253,0,0,12,1,1,1,0.5,0.8,1.28,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $7==6 fx_graphic_novelfxl 1,7.22892,14.6506,5,20,0,1.06024,36.1446,0,1,0.5,0.855422,1.92771,0,0,7,1,1,1,0.5,0.951807,1.92771,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $7==7 fx_graphic_novelfxl 1,7.22892,14.6506,5,20,0,1.59036,36.1446,0,1,0.5,0.590361,3.61446,0,1,18,1,1,1,0.5,0.795181,2.16867,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 fi +if $8==1 fx_array_mirror 1,0,0,2,0,$9 +elif $8==2 fx_array_mirror 1,0,0,3,0,$9 fi +fx_seamless_turbulence : +foreach { +wh={w},{h} rm +$wh,1,{if($6,3,1)} rand. 0,255 +$wh rand. {$3*pi/180-$4*10*pi},{$3*pi/180+$4*10*pi} +sin. cos.. a[-2,-1] c +r[-2,-1] 130%,130%,1,100%,0,2,0.5,0.5 b. $2 orientation. +vector2tensor. +smooth.. .,$1,0.5,20 rm. +r. $wh,1,100%,0,0,0.5,0.5 +if $5!=1 ia={ia} - $ia * $5 + $ia fi +} +c 0,255 n 0,255 +_fx_shockwaves : +dct +100%,100%,1,1,1 circle. 0,0,{$2+$3}%,1,{$1+1} circle. 0,0,$2%,1,1 +* idct c 0,255 +fx_shockwaves : +ac "_fx_shockwaves ${1-3}",$4 +fx_shockwaves_preview : +gui_split_preview "fx_shockwaves $*",${-3--1} +fx_sponge : +ac "sponge $1",$2 +fx_sponge_preview : +gui_split_preview "fx_sponge $*",${-3--1} +fx_stained_glass : +foreach { +split_opacity l[0] { +to_rgb +stained_glass $1,$2,$3 +n 0,255 +if $4 equalize. fi +rgb2lab. sh. 1,2 *. $5 rm. lab2rgb. +adjust_colors. ${6-8} +} +a c +} +fx_stained_glass_preview : +gui_split_preview "fx_stained_glass $*",${-3--1} +fx_stars : +foreach { split_opacity stars[0] $1%,$2,$3,$4,$5,$6%,${7-9},{$10/255} a c } +fx_stencil : +if $5==0 norm stencil $1,$2,$3 +elif $5==1 stencil $1,$2,$3 +else repeat $! { ++norm. stencil. $1,$2,$3 >=. 50% blend[-2,-1] shapeaverage0 +mv. 0 } fi +if $6 to_rgba replace_color 0,0,0,0,0,255,0,0,0,0 fi +if $4 smooth {30*$4},0,1,1 fi +fx_stencil_preview : +gui_split_preview "fx_stencil $*",${-3--1} +jeje_strip : +theta={pi*$1/180} +f '0.5*i*(1+$4*sin(2*pi*$2*(cos($theta)*x/w+sin($theta)*y/h)+2*pi*$3/180))' +c 0,255 +jeje_strip_preview : +gui_split_preview "jeje_strip $*",$-1 +fx_tetris : +tetris $1 +fx_triangular_pattern : +if !$! 1024,1024,1,3 fi +W,H={0,[w,h]} f={arg0($14,1,1.5,2,3,4)*100} r[0] $f%,$f%,1,100% +1,1,1,6 +eval " +srand($1); +const pn1 = $3; +const pn2 = $4 + pn1; +const pn3 = $5 + pn2; +const pn4 = $6 + pn3; +const pn5 = $7 + pn4; +C = [ w#0,h#0 ]/2; +da_push([ C,0,h#0-1,0,0 ], +[ C,w#0-1,0,0,0 ], +[ C,w#0-1,0,w#0-1,h#0-1 ], +[ C,0,h#0-1,w#0-1,h#0-1 ]); +repeat($2, +n = int(u(pn5))%pn5; +n = n. $t +f. "u<($4%)^4?i:0" +label_fg. 0,1 voronoi. +if $5<3 +1,1,1,4,"$5==0?[0,0,0,255]:$5==1?[255,255,255,255]:$5==2?[128,128,128,0]" +r. [0],[0],1,4 rv[0,-1] rm. +else +blend[0] .,shapeaverage +fi +if $6" && "$10 ++f. "const boundary=1; i!=j(1) || i!=j(0,1)" +dilate. $6 +1,1,1,4,"[${7-9},255]" r. [0],[0],1,4 +j[0] .,0,0,0,0,{$10/255},.. rm[-2,-1] +fi +if $11" && "$15 +1,{iM+1},1,3 eval.. "I[#-1,i]+=[x,y,1]" s. c,-2 /[-2,-1] rm.. +eval. "const r = ($11-1)*arg(1+$16,1,1.5,2,2.5); ellipse(#0,i0,i1,r,r,0,$15/255,[${12-14},255])" +fi +rm. +r $wh,1,100%,2 +} +fx_voronoi_preview : +fx_voronoi ${1-15},{min(1,$16)} +fx_whirls : +ac "whirls $1,$2,$3,$4",$5 +fx_whirls_preview : +gui_split_preview "fx_whirls ${1-5}",${-3--1} +fx_blocks3d : +foreach { +nm=${"-gui_layer_name"} +W={w} H={h} M={max(w,h)} +if w>h r2dx $1 else r2dy $1 fi +w={w} h={h} m={max(w,h)} +if $3>0 mirror y fi +imageblocks3d $3,$2% +-3d. {$w/2},{$h/2} f={$4*$M/($m*(2-$16))} *3d $f,$f,{$f*abs($3*$1/100)} +if $3>0 r3d 1,0,0,180 fi +r3d 0,0,1,$5 r3d 1,0,0,-$6 +if $16 {2*$M},{2*$M},1,4,-1 else $M,$M,1,4,-1 fi +f3d={0.5*w/tan($7*pi/360)} f3d $f3d +l3d {$10*$f3d},{$11*$f3d},{$12*$f3d} sl3d $13 ss3d $14 +j3d. [0],$8%,$9%,0,1,{if($15,3,2)},0,1 +sh. 100% +. 1 *. 255 rm. +if $20 +.,.,1,3,-1 +j3d. [0],$8%,$9%,0,1,3,0,1 rm[0] +g. xy,1 +[-2,-1] norm. !=. 0 ++r. 100%,100%,1,3 +sh. 0 *. $17 rm. +sh. 1 *. $18 rm. +sh. 2 *. $19 rm. +j[0] .,0,0,0,0,{$20/255},.. rm[-2,-1] +else rm[0] +fi +replace_color 0,0,-1,-1,-1,0,0,0,0,0 +if $16 r 50%,50%,1,4,2 fi +c 0,255 => "name("$nm")" +} +_fx_coloredobject3d : +to_rgb _fx_coloredobject3d$1$2 ${6-8} col3d. ${3-5} +db3d 0 +fx_coloredobject3d : +_fx_coloredobject3d "_",${1-4,6-8} +repeat $!-1 { ++fx_render3d. {$>,w},{$>,h},$6,${9--1} +sh. 3 *. {$5/255} rm. +blend[$>,-1] alpha +} +rm. +fx_coloredobject3d_preview : +_fx_coloredobject3d "_preview_",${1-4,6-8} +repeat $!-1 { ++fx_render3d. {$>,w},{$>,h},$6,${9--1} +sh. 3 *. {$5/255} rm. +blend[$>,-1] alpha +} rm. +_fx_coloredobject3d_0 : plane3d 1 *3d. $1,$2,1 +_fx_coloredobject3d_1 : box3d 1 *3d. $1,$2,$3 +_fx_coloredobject3d_2 : pyramid3d 1,1 *3d. $1,$2,$3 +_fx_coloredobject3d_3 : sphere3d 1 *3d. 1,{2*$2},{2*$3} +_fx_coloredobject3d_4 : torus3d $1,{$2/2},100,50 *3d. $3,0.5,0.5 +_fx_coloredobject3d_5 : gyroid3d 24 *3d. $1,$2,$3 +_fx_coloredobject3d_6 : weird3d 32 *3d. $1,$2,$3 +_fx_coloredobject3d_7 : cup3d 128 *3d. $1,$2,$3 +_fx_coloredobject3d_preview_0 : plane3d 1 *3d. $1,$2,1 +_fx_coloredobject3d_preview_1 : box3d 1 *3d. $1,$2,$3 +_fx_coloredobject3d_preview_2 : pyramid3d 1,1 *3d. $1,$2,$3 +_fx_coloredobject3d_preview_3 : sphere3d 1 *3d. 1,{2*$2},{2*$3} +_fx_coloredobject3d_preview_4 : torus3d $1,{$2/2},100,50 *3d. $3,0.5,0.5 +_fx_coloredobject3d_preview_5 : gyroid3d 8 *3d. $1,$2,$3 +_fx_coloredobject3d_preview_6 : weird3d 12 *3d. $1,$2,$3 +_fx_coloredobject3d_preview_7 : cup3d 64 *3d. $1,$2,$3 +_fx_elevation3d : +if $3" && "$!>1 +repeat $!-1 { l[0,{1+$>}] { ++ri.. .,3 +n. 0,{abs($1)} *. {sign($1)} b. $2 +elevation3d.. . rm. +} } +else foreach { +norm n. 0,{abs($1)} *. {sign($1)} b. $2 elevation3d.. . rm. } +fi +db3d +fx_elevation3d : +_fx_elevation3d ${1-2},$17 +s0,s1=^,^0 fx_render3d[${s$17}] ${3--1} +fx_elevation3d_preview : +fx_elevation3d ${1-2},{w},{h},${5--1} +if $17 rm[0] fi +_fx_extrude3d : +if $4" && "$!>1 repeat $!-1 { l[0,{$>+1}] { extrude3d. $1,$2,$3% t3d. .. } } +else extrude3d $1,$2,$3% +fi +db3d 0 +fx_extrude3d : +_fx_extrude3d ${1-3},$18 +s0,s1=^,^0 fx_render3d[${s$18}] ${4--1} +fx_extrude3d_preview : +fx_extrude3d ${1-3},{w},{h},${6--1} +if $18 rm[0] fi +_fx_imageobject3d : +to_rgb foreach { _fx_imageobject3d$1$2 } +db3d 0 +fx_imageobject3d : +_fx_imageobject3d "_",$1 fx_render3d ${2--1} +fx_imageobject3d_preview : +w={w} h={h} _fx_imageobject3d "_preview_",$1 fx_render3d $w,$h,${4--1} +_fx_imageobject3d_0 : imageplane3d +_fx_imageobject3d_1 : imagecube3d +_fx_imageobject3d_2 : imagepyramid3d +_fx_imageobject3d_3 : imagesphere3d 128,64 +_fx_imageobject3d_4 : torus3d 100,30,100,50 t3d. .. rm.. +_fx_imageobject3d_5 : gyroid3d 24 t3d. .. rm.. +_fx_imageobject3d_6 : weird3d 32 t3d. .. rm.. +_fx_imageobject3d_7 : cup3d 128 t3d. .. rm.. +_fx_imageobject3d_8 : imagerubik3d 5,5 +_fx_imageobject3d_preview_0 : imageplane3d +_fx_imageobject3d_preview_1 : imagecube3d +_fx_imageobject3d_preview_2 : imagepyramid3d +_fx_imageobject3d_preview_3 : imagesphere3d 64,32 +_fx_imageobject3d_preview_4 : torus3d 100,30,100,50 t3d. .. rm.. +_fx_imageobject3d_preview_5 : gyroid3d 8 c3d. n3d. t3d. .. rm.. +_fx_imageobject3d_preview_6 : weird3d 12 t3d. .. rm.. +_fx_imageobject3d_preview_7 : cup3d 64 t3d. .. rm.. +_fx_imageobject3d_preview_8 : imagerubik3d 3,3,5,5 +_fx_lathing3d : +if $4" && "$!>1 repeat $!-1 { l[0,{$>+1}] { lathe3d. $1,$2%,$3 t3d. .. } } +else lathe3d $1,$2%,$3 +fi +db3d 0 +fx_lathing3d : +_fx_lathing3d ${1-3},$18 +s0,s1=^,^0 fx_render3d[${s$18}] ${4--1} +=> "pos(0,0),mode(alpha)" +fx_lathing3d_preview : +fx_lathing3d ${1-3},{w},{h},${6--1} +if $18 rm[0] fi +fx_mesh3d : skip "${1=},${2=}" +filename="$1" +old_filename="$2" +xx,xy,yx,yy,sx,sy,cx,cy,ocx,ocy,rotx,roty,rotz,rendering_mode,face_orientation,materials,recR,recG,recB,focale,antialias,lx,ly,reset_pos=${3-26} +R=30 +show_bb:=!$rendering_mode +if $reset_pos xx,xy,yx,yy,sx,sy,cx,cy,ocx,ocy:=50+$R,50,50,50+$R,60,60,50,50,-1,-1 fi +if $! W,H=${-max_wh} else W,H=1024,1024 fi +0 => $filename ext={x} rm. +if e=['$ext'];['$filename']!=0" && "e!='obj'" && "e!='off'" && "e!='gmz' +gui_error_preview "Specified filename '"$filename"' is invalid\n(extension '"$ext"' is not supported)." +return +fi +if $ocx>0" && "[$cx,$cy]!=[$ocx,$ocy] ncx,ncy=$ocx,$ocy else ncx,ncy=$cx,$cy fi +ux,uy,vx,vy,sx,sy:="C = [$ncx,$ncy]; [ [$xx,$xy] - C,[$yx,$yy] - C,[$sx,$sy] - C ]" +Ux,Uy,Uz,Vx,Vy,Vz,Wx,Wy,Wz:=" +const R = $R; +const R2 = 2*R; +coords3d(x,y) = ( +_t = atan2(y,x); _n = norm(x,y); +_s = int(_n/R)%2?1:-1; _mn = _n%R2; _n = _mn0?_U/_nU:[ 0,0,-1 ]; +); +U = coords3d($ux,$uy); +V = coords3d($vx,$vy); +W = cross(U,V); W/=norm(W); +nV = cross(W,U); nV/=norm(nV); +dot(nV,V)<0?(nV*=1); +[ U,nV,W ]" +vx,vy:="($Vz<0?1:2/norm($Vx,$Vy) - 1)*$R*[$Vx,$Vy]" +l[] { +if ['$filename']==['$old_filename']" && "narg($_persistent) $_persistent +elif ['$filename']!=0 $filename +boundingbox3d. +store _persistent +else +torus3d 100,40,32,17 s3d r.. 3,{h#2/3},1,1,-1 f.. y%2?160-20*x:128+50*x y a y +=> "Default Torus" +boundingbox3d. +store _persistent +fi +if $show_bb k. else rm. fi +} +nbv,nbp:=i[6],i[7] +obj_name={b} +fact:=min($W,$H)*norm($sx,$sy)/$R +n3d. c3d. *3d. $fact +if $rotx r3d. 1,0,0,{45*$rotx} fi +if $roty r3d. 0,1,0,{45*$roty} fi +if $rotz r3d. 0,0,1,{45*$rotz} fi +pose3d. $Ux,$Vx,$Wx,0,$Uy,$Vy,$Wy,0,$Uz,$Vz,$Wz,0 +is_double:=$face_orientation==2 +if $face_orientation==1 rv3d. fi +foc:=$fact*$focale% +if $materials<2 p3d. 2 if !$materials col3d. $recR,$recG,$recB fi fi +nlx,nly,nlz:=isnan($lx)?[$W*$cx%,$H*$cy%,-5e8]:[$W*($cx+4*($lx-$cx))%,$H*($cy+4*($ly-$cy))%,-10*$foc] +if 0$_is_preview +j3d[0] .,$cx%,$cy%,0,1,{$rendering_mode>0?$rendering_mode-1:1},$is_double,1,$foc,$nlx,$nly,$nlz rm. +else +afact:=arg0($antialias,1,1.5,2,3,4) +if $afact>1 foc*=$afact *3d. $afact fi +{[$W,$H]*$afact},1,3,-0.1 +j3d. ..,$cx%,$cy%,0,1,{$rendering_mode>0?$rendering_mode-1:1},$is_double,1,$foc,$nlx,$nly,$nlz rm.. +to_rgba. replace_color. 0,0,-0.1,-0.1,-0.1,255,0,0,0,0 r. $W,$H,1,4,2 +if 0$_output_mode>0 k. else blend alpha fi +fi +if 0$_is_preview +line[0] $cx%,$cy%,{$cx+$ux}%,{$cy+$uy}%,1,255,0,0 +line[0] $cx%,$cy%,{$cx+$vx}%,{$cy+$vy}%,1,0,255,0 +line[0] $cx%,$cy%,{$cx+$sx}%,{$cy+$sy}%,1,0xF0F0F0F0,255,128,64 +line[0] $cx%,$cy%,{$cx+$sx}%,{$cy+$sy}%,1,0x0F0F0F0F,128,64,255 +to[0] "[ "$obj_name" ]\nVertices: "$nbv"\nPrimitives: "$nbp,0,0,4% +fi +=>[0] "name("$obj_name"),pos(0,0)" +u "{"$filename"}{"$filename"}""{"{[$cx+$ux,$cy+$uy]}"}{"{[$cx+$vx,$cy+$vy]}"}{"{[$cx+$sx,$cy+$sy]}"}{"$cx,$cy"}{"$cx"}{"$cy"}""{"$rotx"}{"$roty"}{"$rotz"}{"$rendering_mode"}{"$face_orientation"}{"$materials"}""{"$recR,$recG,$recB"}{"$focale"}{"$antialias"}{"$lx,$ly"}{"$reset_pos"}" +fx_mesh3d_preview : skip "${1=},${2=}" +if !$! $_preview_area_width,$_preview_area_height,1,4 +else gui_merge_layers fi +drgba +_is_preview=1 +fx_mesh3d $"*" +fx_random3d : +foreach { +f3d={0.5*max(w,h)/tan($5*pi/360)} f3d $f3d l3d {$6*$f3d},{$7*$f3d},{$8*$f3d} sl3d $9 ss3d $10 +to_rgb ({w},{h},{d},{s}) /. 2 +repeat $2 { +({1,@0}) +. {1,@1} *. $3 /. 100 _fx_random3d$1 {^} rm.. +r3d. 1,1,0,{u(0,360)} +({v}) *. {1,@0} ({v}) *. {1,@1} ++3d... {-2,^},{^},{u(-$4,$4)} rm[-2,-1] +col3d. {u(255)},{u(255)},{u(255)} +} ++3d[2--1] j3d[0] .,50%,50%,0,$12,$11,0,1 k[0] +} +_fx_random3d0 : box3d $1 +_fx_random3d1 : ($1) /. 2 cone3d {^},$1 rm.. +_fx_random3d2 : ($1) /. 2 cylinder3d {^},$1 rm.. +_fx_random3d3 : sphere3d $1,2 +_fx_random3d4 : ($1) /. 3 torus3d $1,{^} rm.. +fx_memoakten_algorithm_a_preview : +fx_memoakten_algorithm_a $* +gui_crop_resize_preview +fx_memoakten_algorithm_a : +seed,point_density,rate_ps,rate_ss,max_occ,centering,msl,Msl,angt,thickness,color_density,antialias,Rf,Gf,Bf,Rb,Gb,Bb,R0,G0,B0,R1,G1,B1,R2,G2,B2,R3,G3,B3=${1-30} +fa:=arg0($antialias,1,1.5,2) +foreach { +nm={n} W,H:=w,h rm srand $seed +$W,$H noise_poissondisk. {max(8,min(w,h)/max(2,$point_density))} +1,1,1,2 eval.. "begin(da_push(#1,[0,0],[$W - 1,0],[$W - 1,$H - 1],[0,$H - 1])); i?da_push(#1,[x,y])" rm.. +1,1,1,2 +1,{"max(1,round($rate_ps*da_size(#0)%))"},1,1,">"${-math_lib}" +begin( +const mwh = min($W,$H); +da_push(#1,[0,1],[1,2],[2,3],[3,0]); +nb_pts = da_size(#0) +); +do ( +do (p0 = round(u(nb_pts - 1)); p1 = round(u(nb_pts - 1)), p0==p1); +P0 = I[#0,p0]; P1 = I[#0,p1], +!inrange(norm(P0 - P1),mwh*$msl%,mwh*$Msl%) +); +is_valid = 1; +repeat (da_size(#1),k, +S = I[#1,k]; q0 = S[0]; q1 = S[1]; +Q0 = I[#0,q0]; Q1 = I[#0,q1]; +is_valid&=!do_intersect(P0[0],P0[1],P1[0],P1[1],Q0[0],Q0[1],Q1[0],Q1[1]); +!is_valid?break(); +); +is_valid?(da_push(#1,[p0,p1])); +" rm. +channels. 0,2 +1,{"max(1,round($rate_ss*da_size(#1)))*100"},1,1,">"${-math_lib}" +const cmin = lerp(0,0.5,$centering%); +const cmax = lerp(1,0.5,$centering%); +const mwh = min($W,$H); +const angt = 1 - $angt%; +nb_seg = da_size(#1); +do (s0 = round(u(nb_seg - 1)); s1 = round(u(nb_seg - 1)), +s0==s1 || i(#1,0,s0,0,2)>$max_occ || i(#1,0,s1,0,2)>$max_occ); +S0 = I[#1,s0]; S1 = I[#1,s1]; +P0 = I[#0,S0[0]]; P1 = I[#0,S0[1]]; dP = P1 - P0; nP = norm(dP); ndP = dP/nP; +Q0 = I[#0,S1[0]]; Q1 = I[#0,S1[1]]; dQ = Q1 - Q0; nQ = norm(dQ); ndQ = dQ/nQ; +R0 = round(lerp(P0,P1,u(cmin,cmax))); +R1 = round(lerp(Q0,Q1,u(cmin,cmax))); +dR = R1 - R0; nR = norm(dR); ndR = dR/nR; +inrange(nR,mwh*$msl%,mwh*$Msl%) && abs(dot(ndR,ndP))y>=4?(S = I; polygon(#-1,2,$fa*I[#0,S[0]],$fa*I[#0,S[1]],1,0))" +k. +srand $seed ++label_fg. 0,0 +1,{iM+1},1,6,[0,0,y,0,0,0] eval.. ">++i[#-1,i]" sh. 0 area_max:=iM rm. +f. "[ i0*u(0.25,1),i0,y,0,0,0 ]" sort. +,y channels. 1,100% +f. "begin(N = max(1,h*$color_density%)); +y>N || i0<8 || i0>=$area_max?[i0,i1,$Rb,$Gb,$Bb]:( +rand = u; +rand<0.25?[i0,i1,$R0,$G0,$B0]: +rand<0.5?[i0,i1,$R1,$G1,$B1]: +rand<0.75?[i0,i1,$R2,$G2,$B2]: +[i0,i1,$R3,$G3,$B3] +)" +channels. 1,100% sort. +,y channels. 1,100% +point. 0,0,0,1,$Rf,$Gf,$Bf +map.. . rm. +==.. 0 +if $thickness<=3 dilate[0] $thickness else dilate_circ[0] $thickness fi +f. "i(#0)?[$Rf,$Gf,$Bf]:I" rm.. +r $W,$H,1,3,2 => $nm +} +fx_ball : +ball $1,${5-7},${2-4} +if $!>1 mv. 0 =>[0] "name(Ball),pos("{``{0,0.5*([${-max_wh}]-[w,h])}}")" else =>[0] "name(Ball)" fi +fx_ball_preview : +fx_ball $* +if $!>1 rv[-2,-1] blend[-2,-1] alpha fi +fx_circle_art : +if !$2 f 0 return fi +if $1==0 +{round(2*($2^1.5))} +rand. -1,1 +rand. -1,1 +rand. -$3,$3 a[-3--1] y +else +{max(1,round($2*$7))} +t0={$8*2*pi/180} +rows. 0,2 +f. "r = x/(w-1); +t = 2*pi*x/$2; +if(y==0,(r^$11)*cos("$t0"+$13*t), +if(y==1,(r^$12)*sin("$t0"+$14*t), +max(0,$3*($9+($10-$9)*r))))" +fi +l. { +transpose s x,-1 h={h} +i[0] ({'CImg3d'},{2*$h},$h) +++... . -[-4,-2] i .. i[-3,-1] 1,100% a[-6--1] x +1,$h,1,1,5 1,$h,1,1,2*y ++. 1 a[-3--1] x z. 0,5 +3,$h,1,1,1 1,$h,1,1,-1 y a y +} +repeat $!-1 { l[$>,-1] { +s={0,max(w,h)} rm[0] +if $5 {2*$s},{2*$s} +*3d[0] $s +else $s,$s +*3d[0] {$s/2} +fi +j3d[1] [2],50%,50%,0,1,2,0,0 rm[2] +%. $4 +if $6 i.. 100%,100%,1,3 rand.. 0,255 plasma.. 1,1 equalize.. 256 n.. 0,255 blend[-2,-1] shapeaverage fi +rv +} } +rm. +n 0,255 +if $5 r 50%,50%,1,100%,2 fi +fx_equation_parametric : +foreach { +w={w} h={h} rm +$5,1,1,2,"t=$3+x*($4-$3)/($5-1);if(c==0,$1,$2)" +channels. 0,2 +($8,$11^$9,$12^$10,$13) r. {-2,w},1,1,3,3 a c +display_parametric $w,$h,{$6+$14*1.001},$7,$15,$16 +} +fx_equation_plot : +foreach { +w={w} h={h} rm +$4,1,1,$5,"X=$2+($3-$2)*x/($4-1);$1" +dg $w,$h,$6,$7,$2,$3 +} +fx_corner_gradient : skip ${17=0} +foreach { +wh={w},{h} rm +($1,$5;$9,$13^$2,$6;$10,$14^$3,$7;$11,$15^$4,$8;$12,$16) +_gb_fwd $17 +r. $wh,1,100%,3 +_gb_bwd $17 +} +fx_custom_gradient_preview : skip "${15=}" +foreach { +if $4 ++_fx_custom_gradient1 ${1-14},"$15",${16--1} +erode. 3 -[-2,-1] +dilate. 5 a[-2,-1] c n. 0,255 +fx_custom_gradient[0] ${1-14},"$15",${16--1},-1 blend alpha +else fx_custom_gradient ${1-14},"$15",${16--1},-1 +fi +if $14 ++_fx_custom_gradient0[] ${1-14},"$15",${16--1} r. {{0,w}-16},16,1,4 frame. 1,1,0 j[0] .,8,{0,h-25} rm. +fi +} +fx_custom_gradient : skip "${15=}" +_fx_custom_gradient0 ${1-14},"$15",${16--1} +if $-1>=0" && "narg("$15") +dir_ggr=${-path_gimp}gradients +0 => ${"normalize_filename \"$15\""} name_ggr={b} rm. output_ggr. $dir_ggr/$name_ggr.ggr,"$15" +fi +i.. (0^0^0^0) a[-2,-1] x +repeat $!-1 { l[$>,-1] { +_fx_custom_gradient1[0] ${1-14},"$15",${16--1} ++distance[0] 1,$11 +distance[0] 0,$11 *. -1 +[0] 1 +[0,-2,-1] +m={$9%*{0,im}} M={$10%*{0,iM}} +-[0] $m *[0] {1,(w-2)/($M-$m)} +[0] 1 +round[0] map[0] . +} } +rm. +_fx_custom_gradient0 : +if $16 4,8,1,1,${18-56} permute. yzcx +else 8,1,1,3 srand $17 rand. 0,255 to_rgba. +fi +z. 0,{$5-1} +if $13 +r. {200*$6}%,1,1,4,0,2 +__fx_custom_gradient0. $12,$8 +shift. {-round(w*0.5*$7%)},0,0,0,2 z. 0,{w/2-1} +else +__fx_custom_gradient0. $12,$8 +r. {100*$6}%,1,1,4,0,2 shift. {-round(w*$7%)},0,0,0,2 +fi +__fx_custom_gradient0 : +if $1==1 sh. 0,2 rgb2hsv. rm. +elif $1==2 sh. 0,2 srgb2rgb. rgb2lab. rm. +fi +r. {$2*w},1,1,4,3 +if $1==1 sh. 0,2 hsv2rgb. rm. +elif $1==2 sh. 0,2 lab2rgb. rgb2srgb. rm. +fi +_fx_custom_gradient1 : +b $2% +if $1==0 +to_a split_opacity +if iM>im+32 +rm.. >=[0] {100-$3}% +else +rm. norm n 0,1 +if ia>0.5 <=[0] $3% else >=[0] {100-$3}% fi +fi +elif $1==1 +remove_opacity norm <= $3% +elif $1==2 +remove_opacity norm >= {100-$3}% +else +to_a channels 100% >= {100-$3}% +fi +fx_line_gradient : skip "${10=}" +_fx_line_gradient $* +if narg("$10") +dir_ggr=${-path_gimp}gradients +0 => ${"normalize_filename \"$10\""} name_ggr={b} rm. output_ggr. $dir_ggr/$name_ggr.ggr,"$10" +fi +r 100%,64,1,100% +fx_line_gradient_preview : +foreach { +to_rgba +if $9 +_fx_line_gradient $* fi +l[0] { +line $1%,$2%,$3%,$4%,1,0xF0F0F0F0,255,255,255,255 +line $1%,$2%,$3%,$4%,1,0x0F0F0F0F,0,0,0,255 +} +if $!>1 r. {{0,w}-32},32,1,4,1 frame. 1,1,0,0,0,255 j[0] [1],16,{{0,h}-48} rm. fi +} +_fx_line_gradient : +at_line $1%,$2%,0,$3%,$4%,0 r {max(0.1,$5)}%,1,1,100%,1 +m "feature1 : channels 0" +m "feature2 : channels 1" +m "feature3 : channels 2" +m "feature4 : to_rgb luminance" +m "feature5 : to_rgb rgb2ycbcr channels 1" +m "feature6 : to_rgb rgb2ycbcr channels 2" +m "feature7 : to_rgb srgb2rgb rgb2lab channels 0" +if $7 foreach { +feature$7 rv a y sort +,x rows 1 } fi +if $6 r $6,1,1,100%,3 fi +if $8 mirror x fi +fx_linear_gradient : skip ${13=0} +foreach { +wh={w},{h} rm +($1^$2^$3^$4) ($5^$6^$7^$8) +if $9 rv[-2,-1] fi +r $wh +_gb_fwd $13 +fade_linear $10,$11,$12 +_gb_bwd $13 +} +fx_radial_gradient : skip ${14=0} +foreach { +wh={w},{h} rm +($1^$2^$3^$4) ($5^$6^$7^$8) +if $9 rv[-2,-1] fi +r $wh +_gb_fwd $14 +100%,100% =. 1,$12%,$13% distance. 1 _fade $10,$11 +_gb_bwd $14 +} +fx_random_gradient : +foreach { +to_rgba 100%,100% srand $2 +eval "repeat ($1,n, +x = round(u(w-1)); +y = round(u(h-1)); +i(x,y) = 1; +i(#0,x,y,0,0) = round(u(255)); +i(#0,x,y,0,1) = round(u(255)); +i(#0,x,y,0,2) = round(u(255)); +i(#0,x,y,0,3) = $7*255 + (1-$7)*round(u(255)); +)" +if $7!=1 sh.. 100% n. 0,255 rm. fi +==. 0 +sh.. 0,2 srgb2rgb. rm. +inpaint_pde.. [1],100%,1 rm. +b $3% n 0,255 +sh 0,2 rgb2srgb. balance_gamma. ${4-6} rm. +} +gtutor_hairlock : +($4^$5^$6) +rgb2hsl. +hue={i[0]} +sat={0.97*i[1]} +light={i[2]} +opac={$7/255} +var={0.1*$8} +rm. +repeat $! +l[$>] ++diffusiontensors. 1,0,0.1,{8*$1},0 +diffusiontensors.. 0,1,0.1,{20*$1},0 +eigen[-2,-1] +rm. +s. c +rm. +*. -1 ++. +n. 0,1 +mv. 0 +s.. c +rm... +*.. -1 ++.. 1 ++*.. 0 +rv[-1,-2] +a[-3,-2] c +eigen2tensor[-2,-1] +100%,100%,1,3 +_hcolor. $hue,$sat,$light,$var,{0.05+0.5*$2},0.98,1 +dilate_circ. {2+2*$2} ++luminance. +gt. 0.01 +*[-4,-1] +n. 0,255 +replace_color. 0,0,0,0,0,$4,$5,$6 +rv[-2,-1] +repeat 3 +smooth[-3,-2] .,{5+595*$3} +done +rm. +rv[-2,-1] +sharpen. {1.2*(1-$2)} +n. 0,1 ++_hlight. $9,$10,1 +*. ... ++[-3,-1] ++_hlight. $9,$10,$11 +...,...,...,...,255,255,255 +image[-4] .,0,0,0,0,1,.. +k[-4,-3] +n. 0,{51*(1+4*$opac)} +a[-2,-1] c +n. 0,255 +done +done +gtutor_hairlock_preview : +gui_split_preview "gtutor_hairlock ${^0}",$-1 +_hlight : check "${1=45}<=360 && $1>=0 && ${2=0.5}>=0 && ${3=0.5}>=0" +if $2>0 +r2dx. 400%,5 +b. 2,1 +gradient_orientation. 2 +a[-2,-1] c +({cos(2*$1*pi/360)}^{sin(2*$1*pi/360)}) +r. ..,..,.,.,1 +*[-2,-1] +compose_channels. + +cut. {ia},{iM} +n. {195*$3-200},0 +exp. +r2dx. 25%,5 +n. 0,{$2} +else +fill_color. 0 +fi +to_rgb. +#@cli _hcolor : h_mean,s_mean,l_mean,var,density,coverage,is_mod +#@cli : Plot in selected images impulses centered around h,s,l means +/- var +#@cli : at relative 0<=density<=1 wrt 1/2 image area: related to density=1 +#@cli : coverage: wrt image area, relative coverage 0<=coverage<=1 smaller +#@cli : values give rise to unplotted regions around edges equal 1.0-coverage. +#@cli : is_mod, boolean, if true, wraps negative values around to one. +#@cli : Default values: mean=40,var=0,density=0.5,coverage=1,is_mod=True +_hcolor : skip ${1=40},${2=0.5},${3=0.5},${4=0},${5=0.5},${6=1},${7=1} +repeat $! +l[$>] +pcnt={0.5*w*h*$5} +{$pcnt},1,1,1,({0,w}*(1-$6)/2)+{0,w}*$6*u +{$pcnt},1,1,1,({0,h}*(1-$6)/2)+{0,h}*$6*u +{$pcnt},1,1,1 +ra={$1/360.0} +if $7 +{$pcnt},{s},1,1,360.0*($ra+$4*(2*g-1))%1 +{$pcnt},{s},1,1,($2+$4*(2*g-1))%1 +{$pcnt},{s},1,1,($3+$4*(2*g-1))%1 +else +{$pcnt},{s},1,1,360.0*($ra+$4*(2*g-1)) +{$pcnt},{s},1,1,$2+$4*(2*g-1) +{$pcnt},{s},1,1,$3+$4*(2*g-1) +fi +a[^0] y +pointcloud. 0,{-2,w},{-2,h},1,{-2,s} +rm.. +hsl2rgb. +done +done +fx_hypotrochoid : +{0,[w,h]*($10?1.5:1)} +eval " +const M = min(w,h)/2; +const A = M*$2%; +const B = A*$3%; +const H = B*$4%; +const S = M*$5%; +const F = (A - B)/max(1e-5,B); +const AmB = A - B; +hypotrochoid(t) = (_t = t; round([ w/2 + AmB*cos(_t) + H*cos(F*_t), h/2 + AmB*sin(_t) - H*sin(F*_t) ])); +oX = hypotrochoid(t); +dt = 1; +for (t = 0, t<$1*2*pi, +do ( +X = hypotrochoid(t + dt); +dist = abs(X[0] - oX[0]) | abs(X[1] - oX[1]); +!dist?(dt*=2): +dist>1?(dt/=1.25): +(t+=dt), +dist!=1; +); +S<1?(I(X) = $9):ellipse(X,S,S,0,1,$9); +oX = X; +)" +r. [0],[0],1,1,2 +channels. -3,0 sh. 0,2 fc. ${6-8} rm. +blend[0,-1] alpha +fx_lightning : +foreach { +100%,100% +l. { +fact={max(w,h)/$3*$2%} srand $11 +repeat $1 { +if $!<=1 +i=0 +new_level=1 +new_length=$3 +new_x=0 +new_y=0 +new_angle=$14 +else +i={round(u(1,max(1,($!-1)*$6)))} +level={$i,@-2} +angle={$i,@-1} +nb_points={$i,i[6]} +p={round(($nb_points-2)*u($17%,$18%))} +new_level={$level+1} +new_length={max(2,round(($nb_points-$p)*u($19%,$20%)))} +new_x={$i,i[8+3*$p]} +new_y={$i,i[9+3*$p]} +new_angle={$angle+u($21,$22)*if(u>0.5,1,-1)} +fi +_fx_lightning $new_length,$4,$5 +r3d. 0,0,1,$new_angle ++3d. $new_x,$new_y ++*3d. $fact [0],[0] j3d. ..,$12%,$13%,0,1,1,0,0 rm.. +dilation={$15*(if($23>0,1.5,10)^($23*($new_level-1)))} +blur={max(0,-1+(1+$16)*(if($24>0,2,5)^($24*($new_level-1))))} +opacity={min(1,$10/255*(2^($25*($new_level-1))))} +dilate. $dilation b. $blur% n. 0,1 *. $opacity max[0,-1] +($new_level;$new_angle) a[-2,-1] y +progress {($>*100)/($1-1)} +} +k[0] * 255 i[0] 100%,100%,1,3 fc[0] ${7-9} a c +} +rv +} +fx_lightning_preview : +foreach { fx_lightning $* rv blend alpha } +_fx_lightning : +l[] { +({'CImg3d'},$1,{$1-1}) +1,$1 noise. $2,1 cumulate. b. $3 shift. 0,1 1,100%,1,1,y 1,100% a[-3--1] x +1,{h-1},1,1,2 +f. y ++. 1 a[-3--1] x +4,100%,1,1,1 +y a y +} +fx_lissajous : +foreach { +to_rgba +{w},{h} +f3d {0.5*max(w,h)/tan($4*pi/360)} +lissajous3d $1,$5,$8,$6,$9,$7,$10 +r3d. 0,0,1,$13 r3d. 0,1,0,$12 r3d. 1,0,0,$11 +*3d. {0.5*$2*{-2,w}},{0.5*$3*{-2,h}},{0.5*$4*max({-2,w},{-2,h})} +col3d. 1 j3d.. .,50%,50%,0,1,1,0,0 rm. +distance. 1 >. $14% *.. . ==. 0 +r. 100%,100%,1,4 +sh. 0 *. $15 rm. +sh. 1 *. $16 rm. +sh. 2 *. $17 rm. +sh. 3 *. $18 rm. ++[-2,-1] +} +fx_mandelbrot : +if !narg($_size) _size={max(w,h)} fi +rm $_size,$_size +mandelbrot ${1-4},$6,{$5?[1,$7,$8]:[0,0,0]} +srand $11 $9,1,1,3 rand. 0,255 r. {$9*$10},1,1,3,3 point. 0 map.. .,3 rm. +fx_mandelbrot_preview : +_size={min(${-gui_preview_wh})} +if "$15 || $16 || $17" +x0,y0,x1,y1={"P0 = [${1,2}]; +dP = [${3,4}] - P0; +C = P0 + [${12,13}]%*dP; +zfact = $14*($15?1:$16?0:-2); +dC = 0.5*dP*(1 - 0.98*zfact); +[C - dC,C + dC]"} +status=\{$x0\}\{$y0\}\{$x1\}\{$y1\}\{$5\}\{$6\}\{$7\}\{$8\}\{$9\}\{$10\}\{$11\}\{50,50\}\{$14\}\{0\}\{0\}\{0\}\{$18\} +px,py=50 +else +x0,y0,x1,y1=${1-4} +status= +px,py=${12,13} +fi +fx_mandelbrot $x0,$y0,$x1,$y1,${5--1} +x0r,y0r,x1r,y1r={"C = ["$px,$py"]%*w; dC = 0.5*w*(1 - 0.98*$14); round([C - dC, C + dC - 1])"} +rectangle $x0r,$y0r,$x1r,$y1r,0.7,0xF0F0F0F0,255,255,255,255 +rectangle $x0r,$y0r,$x1r,$y1r,0.7,0x0F0F0F0F,0,0,0,255 +if $18 to "Z0 = ( "{_$x0}" , "{_$y0}" )\nZ1 = ( "{_$x1}" , "{_$y1}" )",2,2,16 fi +u $status +fx_neon_lightning : +d={$13*255} +foreach { +100%,100%,1,4 rm[0] +repeat $7 { +x0={max(0,min(w,$1+u(-$3,$3)))} y0={max(0,min(h,$2+u(-$3,$3)))} +x1={max(0,min(w,$4+u(-$6,$6)))} y1={max(0,min(h,$5+u(-$6,$6)))} +u0={u(0,100)} v0={u(0,100)} u1={u(0,100)} v1={u(0,100)} +R={max(0,min(255,u($10-$d,$10+$d)))} +G={max(0,min(255,u($11-$d,$11+$d)))} +B={max(0,min(255,u($12-$d,$12+$d)))} +spline $x0%,$y0%,$u0%,$v0%,$x1%,$y1%,$u1%,$v1%,1,$R,$G,$B,1 +} +s c,-3 +b[0] 3% +distance. 1 *. -1 c. -{$9+1e-5},0 n. 0,1 sqrt. ++b. $8%,1 n. 0,1 sqrt. n[-2,-1] 0,255 max[-2,-1] +. blend[0,1] value +smooth 5,0,1,0.5,2,10,0 +/. 255 ^. $14 *. 255 +a c c 0,255 +} +fx_newton_fractal : skip "${6=},${7=},${8=},${22=},${25=},${28=}" +foreach { +if !narg($_size) _size={max(w,h)} fi +rm +antialias={arg(1+$33,1,1.5,2,2.5,3,3.5,4)} +{$antialias*[$_size,$_size]} +if $5==1 +pz="z^^2 - 1" dpz="2*zn" d2pz="2" +elif $5==2 +pz="z^^3 - 1" dpz="3*z^^2" d2pz="6*z" +elif $5==3 +pz="z^^5 - 1" dpz="5*z^^4" d2pz="20*z^^3" +elif $5==4 +pz="z^^6 + z^^3 - 1" dpz="6*z^^5 + 3*z^^2" d2pz="30*z^^4 + 6*z" +elif $5==5 +pz="z^^8 + 15*z^^4 - 1" dpz="8*z^^7 + 60*z^^3" d2pz="56*z^^6 + 180*z^^2"; +else +pz="$6" dpz="$7" d2pz="$8" +fi +if !narg($pz) pz="[1,0]" fi +if !narg($dpz) dpz="[1,0]" fi +if !narg($d2pz) d2pz="[1,0]" fi +newton_fractal ${1-4},$38,$9,$10,{10^-$11},$pz,$dpz,$d2pz +if $12==1 +channels 100% +srand $15 $13,1,1,3 rand. 0,255 r. {$13*$14},1,1,3,3 point. 0 map.. .,3 rm. +elif $12==2 +f "[ atan2(i1,i0),1,i2 ]" s c n... {[$17,$18]*360%} n. {[$19,$20]%} c. 0,1 a c +${"arg0 $16,hsi,hsl,hsv"}2rgb +else +if $22 +s c,-2 +if $22&1 equalize 1024 fi +if $22&2 /[-2] {-2,max(1e-5,abs(im),abs(iM))} n. 0,1 fi +a c +fi +f "*begin( +p(z) = ("$pz"); +dp(z) = ("$dpz"); +d2p(z) = ("$d2pz"); +); +z = [ i0,i1 ]; +[ (0;$23),(0;$24),(0;$25) ]" +if $26 +s c +if $26&1 equalize 1024 fi +if $26&2 normalize 0,1 fi +a c +fi +* 255 mod 256 +if $21 ${"arg $21,hsi8,hsl8,hsv8,lab8"}2rgb fi +fi +r2dx $_size +if $32 ac "+equalize 1024 j.. .,0,0,0,0,{$32%} rm.",ycbcr_y fi +adjust_colors ${27-31},0,0,0,255 +} +fx_newton_fractal_preview : skip "${6=},${7=},${8=},${22=},${25=},${28=}" +is_custom_expression={$5==0?2:1} +is_color_by_custom={$12==0?2:0} +is_color_by_iter={$12==1?2:0} +is_color_by_value={$12==2?2:0} +_size0={min(${-gui_preview_wh})} +_size={$_size0/arg(1+$44,1,1.5,2,2.5,3,3.5,4)} +angle=$38 +if "$39 || $40 || $41" +x0,y0,x1,y1={"P0 = [${1,2}]; +dP = [${3,4}] - P0; +M = P0 + 0.5*dP; +C = P0 + [${35,36}]%*dP; +C = M + rot(-$38°)*(C - M); +zfact = $37*($39?1:$40?0:-2); +dC = 0.5*dP*(1 - 0.98*zfact); +[ C - dC, C + dC ]"} +px,py=50 +elif $42 +x0,y0,x1,y1=-2,-2,2,2 +px,py=50 +angle=0 +else +x0,y0,x1,y1=${1-4} +px,py=${35,36} +fi +fx_newton_fractal $x0,$y0,$x1,$y1,$5,"$6","$7","$8",${9-22},"$23","$24","$25",${26-32},0,${34-37},$angle,${39--1} +foreach { +r2dx $_size0,1 +x0r,y0r,x1r,y1r={"C = [ "$px,$py" ]%*w; dC = 0.5*w*(1 - 0.98*$37); round([ C - dC, C + dC - 1 ])"} +rectangle $x0r,$y0r,$x1r,$y1r,0.7,0xF0F0F0F0,255,255,255,255 +rectangle $x0r,$y0r,$x1r,$y1r,0.7,0x0F0F0F0F,0,0,0,255 +if $43 to "Z0 = ( "{_$x0}" , "{_$y0}" )\nZ1 = ( "{_$x1}" , "{_$y1}" )",2,2,16 fi +} +u "{"$x0"}{"$y0"}{"$x1"}{"$y1"}{$5}""{$6}_"$is_custom_expression"{$7}_"$is_custom_expression"{$8}_"$is_custom_expression"{$9}{$10}{$11}{$12}""{$13}_"$is_color_by_iter"{$14}_"$is_color_by_iter"{$15}_"$is_color_by_iter"{$16}_"$is_color_by_value"{$17}_"$is_color_by_value"{$18}_"$is_color_by_value"{$19}_"$is_color_by_value"{$20}_"$is_color_by_value"{$21}_"$is_color_by_custom"{$22}_"$is_color_by_custom"{$23}_"$is_color_by_custom"{$24}_"$is_color_by_custom"{$25}_"$is_color_by_custom"{$26}_"$is_color_by_custom"{$27}{$28}{$29}{$30}{$31}{$32}{$33}""{$34}"_{$33==0?0:2}"{"$px,$py"}{$37}{"$angle"}{0}{0}{0}{0}{$43}{$44}" +fx_plasma : skip ${4=0},${5=0} +if $5 to_rgba else to_rgb fi +if $4 rand 0,255 fi +plasma $1,$2,$3 n 0,255 +balance_gamma ${6-8} +fx_quick_copyright : +i[0] 0 t[0] "$1",0,0,$2,1,$3,$4,$5 autocrop[0] 0 r[0] {{0,w}+2*$7},{{0,h}+2*$7},1,3,0,0,0.5,0.5 +i[1] 0 t[1] "$1",0,0,$2,1,1 autocrop[1] 0 r[1] {{1,w}+2*$7},{{1,h}+2*$7},1,1,0,0,0.5,0.5 dilate[1] {1+2*$7} +rotate[0,1] {90*($10-1)} +repeat $!-2 { +if $8==0 j. [0],$9,$9,0,0,{$6/255},[1] +elif $8==1 j. [0],{w-1-{0,w}-$9},$9,0,0,{$6/255},[1] +elif $8==2 j. [0],$9,{h-1-{0,h}-$9},0,0,{$6/255},[1] +else j. [0],{w-1-{0,w}-$9},{h-1-{0,h}-$9},0,0,{$6/255},[1] +fi +mv. 2 +} +rm[0,1] +fx_rainbow : +foreach { +100%,100% spline. 0,$1%,100,{-$3}%,100%,$2%,100,$4%,1,1 +flood. 0,0,0,0,0,1,1 flood. {w-1},0,0,0,0,1,1 +distance. 0 c. 0,255 n. 0,{$5*255} +palette rainbow +luminance. c. 0,{min(100,200-$6)}% n. 0,255 a[-2,-1] c +map.. . rm. +if $6<100 sh. 3 *. {$6/100} rm. fi +blend alpha +} +fx_shadebobs : +channels 0 f 0 +foreach { +t=0 +repeat $3 { +repeat $1 { +r={$6+$5*cos(6*$7*$t)+(1-$5)*sin(6*$8*$t)} +a={(360*sin($7*$t)+30*$6*$>)*pi/180} +ax={2*$>*pi/$1+$t} +cx={(1+$9*cos($ax)+$r*cos($a))*w/2} +cy={(1+$9*sin($ax)+$r*sin($a))*h/2} +ellipse. $cx,$cy,$2%,$2%,0,-1,1 +} +t+={$4%} +} +} +& 255 if $10 map {$10-1} fi +fx_sine_curve : +preset,previous_preset,resolution,periods,dp,ratx,raty,ratz,mxa,mya,mza,mxb,myb,mzb,oxa,oya,oza,oxb,oyb,ozb,pxa,pya,pza,pxb,pyb,pzb,sxa,sya,sza,sxb,syb,szb,rotx,roty,rotz,zoom,focale,xc,yc,prev_xc,prev_yc,xr,yr,xa,ya,prev_xa,prev_ya,radius1,radius2,opacity,colR,colG,colB,antialiasing,preview_background=$* +if !narg($_is_preview) _is_preview=0 fi +if [$prev_xc,$prev_yc]!=[$xc,$yc] +xr,yr,xa,ya,prev_xa,prev_ya+={d=[$xc,$yc]-[$prev_xc,$prev_yc];[d,d,d]} +fi +if [$prev_xa,$prev_ya]!=[$xa,$ya] +delta_a={" +a = [ "$xa" - "$xc", "$ya" - "$yc" ]; +b = [ "$prev_xa" - "$xc", "$prev_ya" - "$yc" ]; +(atan2(a[1],a[0]) - atan2(b[1],b[0]))*180/pi; +"} +xr,yr={[$xc,$yc]+rot($delta_a°)*[$xr-$xc,$yr-$yc]} +else delta_a=0 fi +if [$colR,$colG,$colB]==[0,0,0]" && "$preview_background==1 colR,colG,colB=255 +elif [$colR,$colG,$colB]==[255,255,255]" && "$preview_background==2 colR,colG,colB=0 +fi +update_params=0 +if $preset!=$previous_preset +periods=1 +ratx,raty,ratz=0.5,0.5,0 +mxa,mxb,mya,myb,mza,mzb=1,1,1,1,0,1 +oxa,oxb,oya,oyb,oza,ozb=90,90,0,0,0,0 +pxa,pxb,pya,pyb,pza,pzb=1 +sxa,sxb,sya,syb,sza,szb=0 +rotx,roty,rotz,zoom,focale=0,0,0,2,8 +if $preset==0 +ratx,raty,ratz=0 zoom=1 +elif $preset==1 +mxa,mxb,mya,myb=1,800,1,800 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 oxa,oxb,oya,oyb=90,90,0,60 +elif $preset==2 +mxa,mxb,mya,myb=1,200,1,150 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +elif $preset==3 +mxa,mxb,mya,myb=9,512,1024,9 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +elif $preset==4 +mxa,mxb,mya,myb=80,1,80,1 pxa,pxb,pya,pyb=1,3,1,3 +elif $preset==5 +ratz=0.8 mza,mzb=7,1024 pza,pzb=1.6,2 rotz=45 zoom=1 focale=4 +elif $preset==6 +mxa,mxb,mya,myb=80,1,1,80 pxa,pxb,pya,pyb=1,3,1,3 +elif $preset==7 +mxa,mxb,mya,myb=150,1,1,100 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +elif $preset==8 +mxa,mxb,mya,myb=1,80,80,80 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +elif $preset==9 +mxa,mxb,mya,myb=2,200,200,1 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +elif $preset==10 +mxa,mxb,mya,myb=1,800,1,800 pxa,pxb,pya,pyb=1,3,1,3 +elif $preset==11 +mxa,mxb,mya,myb=1,10,1,10 +elif $preset==12 +mxa,mxb,mya,myb=1,400,1,200 pxa,pxb,pya,pyb=1,3,1,3 sxa,sxb,sya,syb=1,1,0,0 +elif $preset==13 +mxa,mxb,mya,myb=1,800,800,2 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +elif $preset==14 +mxa,mxb,mya,myb=1,30,1,60 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +elif $preset==15 +mxa,mxb,mya,myb=500,1,1,500 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +elif $preset==16 +mxa,mxb,mya,myb=1,80,80,1 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +elif $preset==17 +mxa,mxb,mya,myb=1,80,1,40 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +elif $preset==18 +ratx=0.6 mxa,mxb,mya,myb=9,400,200,9 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +fi +fi +W,H:=w#0?[w#0,h#0]:0$_is_preview" && "0$_preview_area_width?[0$_preview_area_width,0$_preview_area_height]:[1024,1024] +nresolution={max(1,round($periods*1000000*($resolution%)^2))} +nfocale={arg($focale,0.05,0.1,0.2,0.3,0.4,0.5,0.75,1,1.25,1.5,1.75,2,3,4,8,16,32,128,1024,16384)} +noxa,noxb,noya,noyb,noza,nozb={[$oxa,$oxb,$oya,$oyb,$oza,$ozb]*pi/180} +nantialiasing={arg0($antialiasing,1,1.25,1.5,2,3)} +rW,rH={[$W,$H]*$nantialiasing} +l[] { +$nresolution,1,1,2,"* +begin( +const is_rot = "$rotx" || "$roty" || "$rotz"; +ref(rot(1,0,0,"$rotx"°),Rx); +ref(rot(0,1,0,"$roty"°),Ry); +ref(rot(0,0,1,"$rotz"°),Rz); +R = mul(Rz,mul(Ry,Rx,3),3); +const ang = atan2("$ya" - "$yc","$xa" - "$xc"); +const cosa = cos(ang); +const sina = sin(ang); +const c = 35; +const dxr0 = "$xr" - "$xc"; +const dyr0 = "$yr" - "$yc"; +const dxr = cosa*dxr0 + sina*dyr0; +const dyr = -sina*dxr0 + cosa*dyr0; +const _dx = abs(dxr)/c; const dx = 2.5*c*(_dx<1?_dx:_dx^3); +const _dy = abs(dyr)/c; const dy = 2.5*c*(_dy<1?_dy:_dy^3); +); +cpow(x,p,s) = ( +ref(x,_x); +(!s?sign(_x):s==1?-sign(_x):s==2?-1:1)*abs(_x)^p +); +t = x/w*2*pi*"$periods"; +X = lerp(cpow(sin("$mxa"*t + "$noxa"),"$pxa","$sxa"), +cpow(sin("$mxb"*t + "$noxb"),"$pxb","$sxb"), +"$ratx"); +Y = lerp(cpow(sin("$mya"*t + "$noya"),"$pya","$sya"), +cpow(sin("$myb"*t + "$noyb"),"$pyb","$syb"), +"$raty"); +Z = lerp(cpow(sin("$mza"*t + "$noza"),"$pza","$sza"), +cpow(sin("$mzb"*t + "$nozb"),"$pzb","$szb"), +"$ratz"); +X*=dx%; +Y*=dy%; +is_rot?(P = R*[ X,Y,Z ]; X = P[0]; Y = P[1]; Z = P[2]); +X*="$nfocale"; +Y*="$nfocale"; +Z = max(1e-5,Z + 1 + "$nfocale"); +pX = X/Z; +pY = -Y/Z; +ang?(X = cosa*pX - sina*pY; pY = sina*pX + cosa*pY; pX = X); +const ax = "$zoom*$rW"; const bx = "$xc*$rW"%; +const ay = "$zoom*$rH"; const by = "$yc*$rH"%; +[ ax*pX + bx, ay*pY + by ]" +$rW,$rH +eval.. "* +const mwh = min(w#-1,h#-1)*5%; +const r1 = max(0.01,mwh*"$radius1"%); +const r2 = max(0.01,mwh*"$radius2"%); +const Mr = max(r1,r2); +const opacity = ("$opacity"%)^3; +X = R; Y = G; +Mr<0?( +i(#-1,X,Y) = lerp(i(#-1,X,Y),1,opacity); +):( +pX = i(x - 1,0,0,0); +pY = i(x - 1,0,0,1); +dX = X - pX; +dY = Y - pY; +ang = atan2(dY,dX)*180/pi; +ellipse(#-1,X,Y,r1,r2,ang°,opacity,255); +); +I" +rm.. +r. $W,$H,1,1,2 n 0,255 +i[0] 100%,100%,1,3 fc[0] $colR,$colG,$colB +a[-2,-1] c +} +if 0$_is_preview +if $!==1 i[0] $W,$H,1,3 fi +if $preview_background [0],[0] f. {$preview_background==1?0:255} to_rgb. rv[0,-1] rm. fi +blend[0,-1] alpha +line. $xc%,$yc%,$xr%,$yr%,0.75,0xF0F0F0F0,238,0,85 +line. $xc%,$yc%,$xr%,$yr%,0.75,0x0F0F0F0F,255 +line. $xc%,$yc%,$xa%,$ya%,0.75,0xF0F0F0F0,238,85,0 +line. $xc%,$yc%,$xa%,$ya%,0.75,0x0F0F0F0F,0 +fi +mv. 0 +if 0$_output_mode k[0] fi +r,m,o,p,s,a={d=$dp;[d==0?2:0,d==1?2:0,d==2?2:0,d==3?2:0,d==4?2:0,d==5?2:0]} +u "{"$preset"}{"$preset"}{"$resolution"}{"$periods"}{"$dp"}""{"$ratx"}_"$r"{"$raty"}_"$r"{"$ratz"}_"$r"{"$mxa"}_"$m"{"$mya"}_"$m"{"$mza"}_"$m"{"$mxb"}_"$m"{"$myb"}_"$m"{"$mzb"}_"$m"{"$oxa"}_"$o"{"$oya"}_"$o"{"$oza"}_"$o"{"$oxb"}_"$o"{"$oyb"}_"$o"{"$ozb"}_"$o"{"$pxa"}_"$p"{"$pya"}_"$p"{"$pza"}_"$p"{"$pxb"}_"$p"{"$pyb"}_"$p"{"$pzb"}_"$p"{"$sxa"}_"$s"{"$sya"}_"$s"{"$sza"}_"$s"{"$sxb"}_"$s"{"$syb"}_"$s"{"$szb"}_"$s"{"$rotx"}_"$a"{"$roty"}_"$a"{"$rotz"}_"$a"{"$zoom"}_"$a"{"$focale"}_"$a"{"$xc,$yc"}{"$xc"}{"$yc"}{"$xr,$yr"}{"$xa,$ya"}{"$xa"}{"$ya"}{"$radius1"}{"$radius2"}{"$opacity"}""{"$colR,$colG,$colB"}{"$antialiasing"}""{"$preview_background"}" +fx_sine_curve_preview : +_is_preview=1 +fx_sine_curve $* +k[0] +fx_superformula : +foreach { +to_rgba +{w},{h} +f3d {0.5*max(w,h)/tan($4*pi/360)} +superformula3d $1,${4-7} +r3d. 0,0,1,$10 r3d. 0,1,0,$9 r3d. 1,0,0,$8 +*3d. {0.5*$2*{-2,w}},{0.5*$3*{-2,h}} +col3d. 1 j3d.. .,50%,50%,0,1,1,0,0 rm. +distance. 1 >. $11% *.. . ==. 0 +r. 100%,100%,1,4 +sh. 0 *. $12 rm. +sh. 1 *. $13 rm. +sh. 2 *. $14 rm. +sh. 3 *. $15 rm. ++[-2,-1] +} +fx_symmetric_shape2d : +if !narg($_is_preview) _is_preview=0 fi +foreach { +100%,100%,1,4 _fx_symmetric_shape2d. $* rv +if !0$_is_preview" && "0$_output_mode rm. fi +} +_fx_symmetric_shape2d : +(${10-21}) f. "isnan(i)?-1024:i" discard. -1024 r. 2,{h/2},1,1,-1 permute. cyzx +f. "x = R - $2; y = G - $3; [ atan2(y,x), norm(x,y) ]" +l. { n={h} .x{$1-1} a y f "const pi2 = 2*pi; [ (R + int(y/"$n")*pi2/$1)%pi2, G ]" sort +,y } +f. "[ $2*w#-2,$3*h#-2 ]/100 + [ G*cos(R), G*sin(R) ]*(min(w#-2,h#-2)-1)%" permute. cyzx +coords={^} rm. +if $22 polygon {narg($coords)/2},$coords,1,${23-25},{$26*255%} +else polygon {narg($coords)/2},$coords,1,0xFFFFFFFF,${23-25},{$26*255%} +fi +fx_symmetric_shape2d_preview : +_fx_symmetric_shape2d_preview $* +_fx_symmetric_shape2d_preview : +_is_preview=1 +cx1,cy1,cx2,cy2,cx3,cy3,cx4,cy4,cx5,cy5,cx6,cy6=${10-21} +angx,angy=$6,$7 +if [$2,$3]!=[$4,$5]" || "[$angx,$angy]!=[$8,$9] +dx,dy={[$2-$4,$3-$5]} +repeat 6 { i={1+$>} +cx$i,cy$i={" +const cx = "${cx$i}"; +const cy = "${cy$i}"; +dang = atan2($7 - $3,$6 - $2) - atan2($9 - $3,$8 - $2); +dsca = norm($6 - $2,$7 - $3)/norm($9 - $3,$8 - $2); +[ $2,$3 ] + dsca*rot(dang)*[ cx - $4, cy - $5 ]"} +} +angx,angy={[$6+$2-$4,$7+$3-$5]} +fi +foreach { +r {s=min(w,h);[s,s]},1,100%,0,0,0.5,0.5 +fx_symmetric_shape2d ${1-9},$cx1,$cy1,$cx2,$cy2,$cx3,$cy3,$cx4,$cy4,$cx5,$cy5,$cx6,$cy6,${22-26} +rv blend alpha +eval " +t0 = atan2($7 - $3,$6 - $2); +repeat ($1,k, +const pi2 = 2*pi; +const xc = $2*(w-1)%; +const yc = $3*(h-1)%; +x = xc + (w+h)*cos(t0 + 2*pi*k/$1); +y = yc + (w+h)*sin(t0 + 2*pi*k/$1); +polygon(-2,xc,yc,x,y,0.35,0xF0F0F0F0,255); +polygon(-2,xc,yc,x,y,0.35,0x0F0F0F0F,0); +)" +} +u "{$1}"\ +"{$2,$3}"\ +"{$2,$3}"\ +"{"$angx,$angy"}"\ +"{"$angx,$angy"}"\ +"{"$cx1,$cy1"}"\ +"{"$cx2,$cy2"}"\ +"{"$cx3,$cy3"}"\ +"{"$cx4,$cy4"}"\ +"{"$cx5,$cy5"}"\ +"{"$cx6,$cy6"}"\ +"{$22}"\ +"{$23,$24,$25}"\ +"{$26}" +cl_tangentialCircle: +showBig,radi,dime,wid,nb,lvl,backR,backG,backB,foreR,foreG,foreB,effect=$* +grow=3 +dimens={$radi*$grow} +rectWid={if($dime==1||$dime==2,w,$dimens)} +rectHei={if($dime==1||$dime==2,h,$dimens)} +chanNumb={if($effect,4,3)} +$rectWid,$rectHei,1,$chanNumb,255 +radius={if($dime==2,$radi/300*min(w,h),$radi)} +local. +xC={w/2} +yC={h/2} +if $effect==1 +backR,backG,backB=$foreR,$foreG,$foreB +elif $effect>=7 +backR,backG,backB=255,255,255 +foreR,foreG,foreB=0,0,0 +fi +foreA=255 +backA={if($effect==1,0,255)} +if $showBig==1 +cl_circ. $xC,$yC,$radius,$wid +else +n. 0,255 +fi +cl_innerCirc. $xC,$yC,$radius,$wid,$nb,$lvl +blend screen,1 +n. 0,1 +if $effect<=1 +fill. [i*$foreR+(1-i)*$backR,i*$foreG+(1-i)*$backG,i*$foreB+(1-i)*$backB,i*$foreA+(1-i)*$backA] +elif $effect==2 +fx_rodilius. 15,1,0,$nb,90,0,1,0,0 +n. 0,1 +fill. [i*$foreR+(1-i)*$backR,i*$foreG+(1-i)*$backG,i*$foreB+(1-i)*$backB,i*$foreA+(1-i)*$backA] +n. 0,255 +elif $effect==3 +fx_curvature 10,0,100,0,0 +fx_gradient2rgb 0,0,100,0,0 +apply_curve 1,0,0,16,240,255,255 +fx_smooth_antialias. 15,0,1,0,50,50 +fx_smooth_antialias. 50,50,2.5,0,50,50 +elif $effect==4 +fx_dog 1.4,1.5,0,0,0 +fx_gradient2rgb 0,0,100,0,0 +apply_curve 1,0,0,64,192,255,255 +fx_smooth_antialias. 15,0,1,0,50,50 +fx_smooth_antialias. 50,50,2.5,0,50,50 +elif $effect==5 +dog. 1.4,1.5 +remove_opacity. +n. 0,255 +elif $effect==6 +fx_dog. 1.4,1.5,0,0,0 +apply_curve. 1,0,0,16,0,255,255 +cut. 0,255 +fx_distance. 0,2,1,0 +negate. [-1] [-1] +fx_decompose_channels 8,1,1,0 +l. ++apply_curve. 1,0,0,240,16,255,255 +l. +b. 2.5 +gradient2rgb. 0 n. 0,255 +[-1] +rgb2hsv[-2,-1] split[-2,-1] c +l[-3--1] +[-3] {315} %[-3] 360 done +l[-6--4] +[-3] {135} %[-3] 360 done +l[-3--1] a c hsv2rgb s c done +l[-6--4] a c hsv2rgb s c done +rm[^-6,-3] +negate.. +/ 2 ++. 128 +blend grainmerge,1 +done +to_rgb +blend grainmerge,1 +done +fx_smooth_antialias. 15,0,1,0,50,50 +fx_smooth_antialias. 50,50,2.5,0,50,50 +sharpen 300 +elif $effect>=7 +fill. [i*$foreR+(1-i)*$backR,i*$foreG+(1-i)*$backG,i*$foreB+(1-i)*$backB,i*$foreA+(1-i)*$backA] +remove_opacity. +split. c rm. rm.. ++fx_morphological. 0,2,10,"1,0,1; 0,1,0; 1,0,1",0,0,0,0 ++fx_morphological. 0,2,20,"1,0,1; 0,1,0; 1,0,1",0,0,0,0 +if $effect==8 reverse[-3,-1] fi +a c +fi +done +mv[-1] 0 +if $dime==3 resize[0] {min(w,h)/3}%,{min(w,h)/3}%,1,$chanNumb,5 fi +average_colors : average_vectors +covariance_colors : covariance_vectors +median_color : +u {"expr('med(crop(#-1,0,0,0,y,w#-1,h#-1,d#-1,1))',1,3)"} +gui_rep_tfrac: +srand $35 +if !$2 rep_thorn_fractal $1,${3-14} +else +if $2==1 formulas="$15","$16" +elif $2==2 formulas="$15","$16","$17","$18" +elif $2==3 formulas="$15","$16","$17","$18","$19","$20" +elif $2==4 formulas="$15","$16","$17","$18","$19","$20","$21","$22" +elif $2==5 formulas="$15","$16","$17","$18","$19","$20","$21","$22","$23","$24" +fi +if $25 +if $26 rep_thorn_fractal {-1*$2},${3-14},$formulas,"$27","$28","$29","$30",{$31*($32?-1:1)} +else rep_thorn_fractal {-1*$2},${3-14},$formulas,"$27","$28",{$31*($32?-1:1)} +fi +else rep_thorn_fractal {-1*$2},${3-14},$formulas +fi +fi +if $33==0 n 0,255 +elif $33==1 n 0,360 r 100%,100%,100%,3 f [i0,1,1] hsv2rgb +else n 0,1 $34,1,1,1 f. u(x/w#-1,(x+1)/w#-1) n. 0,16777215 r. 100%,100%,1,3 f. [i0-256*floor(i0/256),floor(i0/256)-256*floor(floor(i0/256)/256),i0/(256^2)] r. 4096,1,100%,100%,5 r[^-1] 100%,100%,100%,3 f[^-1] i(#-1,i0*w#-1,0,z,c,2) rm. +fi +gui_rep_tfrac_preview: +gui_rep_tfrac ${1-14},"$15","$16","$17","$18","$19","$20","$21","$22","$23","$24",$25,$26,"$27","$28","$29","$30",${31-35} +set_a={$2>=1?2:0} +set_b={$2>=2?2:0} +set_c={$2>=3?2:0} +set_d={$2>=4?2:0} +set_e={$2>=5?2:0} +set_f={$2?($25&&abs($31)?2:1)} +set_g={$2?($26&&abs($31)?($25?2:1):1)} +set_h={$2?($25?2:1)} +set_i={$33==2?2:0} +u "{$1}_"{!$2?2:1}"{$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}""{$9}""{$10}""{$11}""{$12}""{$13}""{$14}""{$15}_"$set_a"{$16}_"$set_a"{$17}_"$set_b"{$18}_"$set_b"{$19}_"$set_c"{$20}_"$set_c"{$21}_"$set_d"{$22}_"$set_d"{$23}_"$set_e"{$24}_"$set_e"{$25}_"{$2?2}"{$26}_"$set_f"{$27}_"$set_f"{$28}_"$set_f"{$29}_"$set_g"{$30}_"$set_g"{$31}_"$set_h"{$32}_"$set_h"{$33}""{$34}_"$set_i"{$35}_"$set_i +rep_generate_thorn_fractal_expression_generator: +v1,v2,started=0 +previous_r_choice=-1 +if u<.5 status a symbol,mode=a,0 +else status b symbol,mode=b,1 +fi +do +v2+=1 +if u<$v1||$v2>6 +if $started break fi +else +v1:=$v1+u(-.2,.2) +r:=u(13.1) +r_choice:=int(u(0,4,1,0)) +if $r_choice==$previous_r_choice +if u<.5 r_choice=($r_choice+1)%4 +else r_choice=($r_choice-1)%4 +fi +fi +if $mode symbol,mode=a,0 +else symbol,mode=b,1 +fi +if $r<1 status cos(${}) +elif $r<2 status sin(${}) +elif $r<3 status tan(${}) +elif $r<4 status logabs(${}) +elif $r<5 status norm(${},$symbol) +elif $r<6 status sqr(${}) +elif $r<7 status ${}/${arg\ 1+$r_choice,cos($symbol),sin($symbol),tan($symbol),logabs($symbol)} +elif $r<8 status ${}*${arg\ 1+$r_choice,cos($symbol),sin($symbol),tan($symbol),logabs($symbol)} +elif $r<9 status ${}+${arg\ 1+$r_choice,cos($symbol),sin($symbol),tan($symbol),logabs($symbol)} +elif $r<10 status ${}-${arg\ 1+$r_choice,cos($symbol),sin($symbol),tan($symbol),logabs($symbol)} +elif $r<11 status ${arg\ 1+$r_choice,cos($symbol),sin($symbol),tan($symbol),logabs($symbol)}/${} +elif $r<12 status abs(${}) +elif $r<13 status avg($symbol,${}) +else status (${}) +fi +previous_r_choice=$r_choice +started=1 +fi +while !((u<$v1&&$v2>1)||$v2>6) +('${}') +fill[-1] >"begin( +const _a=_'a'; +const _b=_'b'; +separators='(,)'; +mode=0; +old_char=0; +previous_a_b_char=0; +); +if(isin(i,_a,_b), +back_char=j(-1); +front_char=j(1); +if((back_char==separators[0]||back_char==separators[1])&&(front_char==separators[1]||front_char==separators[2]), +mode?( +check_with_previous_a_b_char=i==previous_a_b_char; +if(check_with_previous_a_b_char, +if(i==_a +,previous_a_b_char=_b;_b; +,previous_a_b_char=_a;_a; +); +,previous_a_b_char=i;i; +); +):( +mode=1; +previous_a_b_char=i; +i; +); +,i); +,i); +" +out={t} +remove[-1] +status $out +_fx_tree: +recursion_depth,random_seed,xratio,yratio,trunk_thickness,base_thickness,trunk_angle,avg_branching,std_branching,avg_leftangle,avg_rightangle,std_angle,avg_length,std_length,avg_thickness,std_thickness,Rt,Gt,Bt,At,Ot,Rl,Gl,Bl,Al,Ol,gammaRGBA,gammaO=${1-28} +W,H,S={[w,h,min(w,h)]} +l[] { +if $2 srand $2 fi +1,1,1,9," +const h_thickness = "$trunk_thickness"%/2; +const hb_thickness = h_thickness*"$base_thickness"%; +R = rot("$trunk_angle"°); +C = [ 0.5,0 ]; +P0 = C + R*[ -hb_thickness,0 ]; +P1 = C + R*[ hb_thickness,0 ]; +P2 = C + R*[ h_thickness,0.5 ]; +P3 = C + R*[ -h_thickness,0.5 ]; +[ P0,P1,P2,P3,0 ]" +repeat $recursion_depth { +1,8,1,9 +eval.. "> +const dangle = "$avg_rightangle" - "$avg_leftangle"; +ref(I,val); +ref(val[0,2],P0); +ref(val[2,2],P1); +ref(val[4,2],P2); +ref(val[6,2],P3); +ndepth = val[8] + 1; +A = (P0 + P1)/2; +B = (P2 + P3)/2; +AB = B - A; +thickness = norm(B - P2); +N = round(cut("$avg_branching" + v*"$std_branching",1,6)); +Nm1 = N<=1?1:N - 1; +repeat (N,n, +ang = cut("$avg_leftangle" + dangle*n/Nm1 + v*"$std_angle",-90,90); +len = cut("$avg_length" + u(-1,-1)*"$std_length",0,200); +rot = rot(ang°); +nB = B + len%*rot*AB; +orth = (nB - B); +orth/=norm(orth); +orth = [ -orth[1],orth[0] ]; +nthickness = thickness*("$avg_thickness" + v*"$std_thickness")%; +Q0 = nB + nthickness*orth; +Q1 = nB - nthickness*orth; +da_push([ P3,P2,Q1,Q0,ndepth ]); +); +end(resize(#-1,1,da_size(),1,s#-1,0)); val" +} +a y +1,100%,1,4,"[ i0#-1,i2#-1,i4#-1,i6#-1 ]" +1,100%,1,4,"[ i1#-2,i3#-2,i5#-2,i7#-2 ]" +sx,sy={10^[$xratio,$yratio]} +-.. 0.5 *.. {-2,$S*$sx/(2.1*max(abs(iM),abs(im)))} +.. {$W/2} *. {$S*$sy/(1.05*max(iM))} +f... "round([ i0#-2,i0#-1,i1#-2,i1#-1,i2#-2,i2#-1,i3#-2,i3#-1,i8 ])" +rm[-2,-1] +eval "ref(I,T); P0 = T[0,2]; P1 = T[2,2]; P2 = T[4,2]; P3 = T[6,2]; +I[0] = [ lerp(P0,P2,-2),lerp(P1,P2,-2),P2,P3,0 ]" +$W,$H,1,4 +eval.. "> +begin( +RGBAt = [ "$Rt,$Gt,$Bt,$At" ]; +RGBAl = [ "$Rl,$Gl,$Bl,$Al" ]; +const gRGBA = 10^"$gammaRGBA"; +const gO = 10^"$gammaO"; +); +ref(I,val); +t = val[8]/"$recursion_depth"; +RGBA = lerp(RGBAt,RGBAl,t^gRGBA); +O = lerp("$Ot,$Ol",t^gO)%; +polygon(#-1,4,val[0,8],O,RGBA); +(i0==i2 && i1==i3) || (i4==i6 && i5==i7)?polygon(#-1,2,i0,i1,i4,i5,O,RGBA); +val" +mirror xy +rm.. +} +fx_tree : +_fx_tree. $* mv. 0 +if 0$_output_mode k[0] fi +fx_tree_preview : +foreach { _fx_tree $* blend alpha } +fx_turbulence : +remove_opacity turbulence ${^0} +fx_animate_preview : skip ${4=1},${5=0},${6=$5} +repeat $! { +if $5 width=$5 else width={w} fi +if $6 height=$6 else height={h} fi +if $4 s. x,2 else . fi +-$1.. $2 -$1. $3 +r[-2,-1] {max(w,{-2,w})},{max(h,{-2,h})},1,100%,3 +if !$4 columns.. 0,50% columns. 50%,100% fi +a[-2,-1] x r. $width,$height,1,100%,2 drgba. +line. 50%,0,50%,100%,1,0,0,0,255 +to. "Start",3,-1,13,2,1,255 to. "End",{w-24},{h-18},13,2,1,255 +mv. 0 } +banding_denoise_v2 : +if !$5 _banding_denoise_v2 $* +else +ts:=arg($5,64,128,256,512,1024,2048) +apply_tiles "_banding_denoise_v2 $*",$ts,$ts,1,20%,20%,1,3 +fi +_banding_denoise_v2 : +foreach { split_opacity l[0] { ++bilateral $3,$4 bilateral. $3,$4 -.. . +fftpolar.. +polygon... 4,0,{(h/2)+1},{50-$1}%,{(h/2)+1},{50-$1}%,{(h/2)-1},0,{(h/2)-1} +polygon... 4,{50+$1}%,{(h/2)+1},{w},{(h/2)+1},{w},{(h/2)-1},{50+$1}%,{(h/2)-1} +polygon... 4,{(w/2)+1},0,{(w/2)+1},{50-$2}%,{(w/2)-1},{50-$2}%,{(w/2)-1},0 +polygon... 4,{(w/2)-1},{h},{(w/2)+1},{h},{(w/2)+1},{50+$2}%,{(w/2)-1},{50+$2}% +ifftpolar[-3,-2] ++ c 0,255 +} a c } +banding_denoise_v2_preview : +if $6==0 gui_split_preview "banding_denoise_v2 $*",${-3--1} +else foreach { remove_opacity +banding_denoise_v2 ${1--1} - * 6 + 128 c 0,255 } +fi +banding_denoise: +repeat 2 +bilateral[-1] $3,$4 keep[0,-1] done ++compose_grainextract[0,1] +fftpolar[-1] +polygon[-2] 4,0,{(h/2)+1},{50-$1}%,{(h/2)+1},{50-$1}%,{(h/2)-1},0,{(h/2)-1} +polygon[-2] 4,{50+$1}%,{(h/2)+1},{w},{(h/2)+1},{w},{(h/2)-1},{50+$1}%,{(h/2)-1} +polygon[-2] 4,{(w/2)+1},0,{(w/2)+1},{50-$2}%,{(w/2)-1},{50-$2}%,{(w/2)-1},0 +polygon[-2] 4,{(w/2)-1},{h},{(w/2)+1},{h},{(w/2)+1},{50+$2}%,{(w/2)-1},{50+$2}% +ifftpolar[-1,-2] +compose_grainmerge[1,2] +keep[-1] +banding_denoise_preview: +if $5==0 +banding_denoise ${1--1} +else ++banding_denoise ${1--1} +compose_grainextract[0,1] +-[-1] 128 *[-1] 5 +[-1] 128 +fi +#@cli afre_cleantext : 0<=clean<=10,0.2<=_range<=1,0<=_black<=100,0<=_white<=100 +#@cli : Clean scanned text. +#@cli : Default values: 'clean=8', 'range=1', 'black=80' and 'white=95'. +afre_cleantext : check "${1=8}>=0 && ${2=1}>=0.2 && ${3=80}>=0 && ${4=95}>=0 && +$1<=10 && $2<=1 && $3<=100 && $4<=100" +e[] "[afre]^_^) cleantext: Clean scanned text using clean=$1, range=$2, black=$3 and white=$4." +c={int(11-$1)*2+1} +dilate $c erode. $c - n 0,255 +retinex , norm n 0,1 f 1-gauss(i,$2) +if $3!=$4 c $3%,$4% else c $3%,{$4+0.5}% fi n 0,255 round +afre_cleantext_preview : +afre_cleantext $* +fx_deinterlace : +deinterlace 0 skip ${^0} +fx_deinterlace_preview : +gui_split_preview "fx_deinterlace $*",${-3--1} +gcd_deinterlace2x : skip ${1=40},${2=0},${3=0},${4=2},${5=0},${6=1} +if $3 +ca={if($5,1,h/w)} na={arg($3,1,{4/3},{5/4},{16/9},{1.6},{2.35},{1.85})} +r {$ca*$na*w},100%,1,3,{arg($4+1,3,5,6)} c 0,255 +fi if $2==3 return fi +repeat $! l[$>] +w={w} h={h} d={d} hh={int($h/2)} rgb2yuv s c +l[0] +shift 0,-1 r $w,$hh,$d,1,4 done +l[-2,-1] r $w,2,$d,$hh,-1 +shift 0,0,0,-1 r $w,2,$d,50%,4 r $w,$hh,$d,1,-1 done +a[0,2,3] c a[^0] c yuv2rgb +if $2==0 scale_dcci2x ,,1 r 50%,100%,1,3,4 +elif $2==1 gcd_upscale_edge 2 r 50%,100%,1,3,4 +else +a={2/3} b={-1/12} ($b,$a,$b;$b,$a,$b;0,0,0) +convolve[^-1] . rm... +r 100%,200%,1,3,4 shift[-2,-1] 0,1 +[-3,-1] +[-3,-1] +fi +c 0,255 shift. 0,1 +- +norm. a={-192^-.5/$1} ($a,$a,$a;$a,0,$a;$a,$a,$a) +convolve.. . rm. max. -1 +. 1 *[-2,-1] -[0,-1] rm. +done done +gcd_deinterlace2x_preview : +gcd_deinterlace2x ${1},{if($6,max(2,$2),$2)},${3--1} +fx_denoise : +if $3 delete ${-path_cache}gmic_denoise_cnn.gmz fi +repeat $2 { denoise_cnn $1,64 progress {round(($>+1)/$2*100)} } +fx_denoise_preview : +r2din 280,280,0,0,0.5,0.5 +gui_split_preview "fx_denoise $*",${-3--1} +#@cli afre_denoisesmooth : radius>=1,_amount>=1 +#@cli : Denoise noisy image, or smooth low noise image. +#@cli : \ \ Command is slow when the 'radius' and 'amount' are high. +#@cli : \ \ Start small and increase as appropriate.\n +#@cli : Default values: 'radius=3 and amount=25'. +afre_denoisesmooth : check "${1=3}>=1 && ${2=25}>=1" +e[] "[afre]^_^) denoisesmooth: Denoise noisy image, or smooth low noise image$? using radius=$1 and amount=$2.\n\ * Command is slow when the 'radius' and 'amount' are high.\n\ \ \ Start small and increase as appropriate." +repeat $! l[$>] r={[im,iM]} +. repeat $1 +normp. 1 afre_gui1_fast.. .,{$>+1} rm. done +repeat $2 afre_gui1_fast.. . done rm. +c $r done done +afre_denoisesmooth_preview : +afre_denoisesmooth $* +#@cli afre_denoisesmooth_alt : radius>=1,_amount>=1 +#@cli : Denoise noisy image, or smooth low noise image. +#@cli : \ \ Command is slow when the 'radius' and 'amount' are high. +#@cli : \ \ Start small and increase as appropriate.\n +#@cli : Default values: 'radius=3 and amount=25'. +afre_denoisesmooth_alt : check "${1=3}>=1 && ${2=25}>=1" +e[] "[afre]^_^) denoisesmooth_alt: Denoise noisy image, or smooth low noise image$? using radius=$1 and amount=$2.\n\ * Command is slow when the 'radius' and 'amount' are high.\n\ \ \ Start small and increase as appropriate." +repeat $! l[$>] r={[im,iM]} +. repeat $1 +normp. 1 afre_gui1_fast.. .,{$>+1},,0 rm. done +repeat $2 afre_gui1_fast.. .,,,0 done rm. +c $r done done +afre_denoisesmooth_alt_preview : +afre_denoisesmooth_alt $* +fx_pahlsson_descreen : skip $* +pahlsson_descreen +fx_pahlsson_descreen_preview : +gui_split_preview "fx_pahlsson_descreen 0",$-1 +pahlsson_descreen : +repeat $! l[$>] split_opacity l[0] to_rgb +rgb2cmyk +split c +name[-4] C +pahlsson_descreen_channel[-4] +name... M +pahlsson_descreen_channel... +name.. Y +pahlsson_descreen_channel.. +name. K +pahlsson_descreen_channel. +append c +cmyk2rgb +done a c done done +pahlsson_descreen_channel : +basename={0,b} +name[0] original +crop1=0,0,{original,w-1},{original,h-1},0 +crop2=0,{original,h},100%,100%,0 +float2fft8[original] +name[original] fft +i [fft] +name.. real +name. imaginary +crop[real] $crop1 +crop[imaginary] $crop2 +i [real] +name. mask +dog[mask] 0.5%,0.8% +normalize[mask] 0,255 +threshold[mask] 64 +normalize[mask] 0,255 +negate[mask] +ellipse[mask] 50%,50%,7%,7%,255,255,255,255 +i [mask] +name. blurmask +blur[blurmask] 1.6% +normalize[blurmask] 0,255 +mul[mask,blurmask] +div[mask] 256 +mul[mask,real] +div[real] 256 +append[real] [imaginary],y +name[real] fft +remove[imaginary] +fft82float[fft] +#@cli float2int8 +#@cli : Convert selected float-valued images to 8bits integer representations. +float2int8 : +e[^-1] "Convert float-valued image$? to 8bits integer representations." +repeat $! l[$>] +s c repeat $! l[$>] +m={im} M={iM} quantize 16777216,0,1 ++>> 8 &. 255 +&.. 255 >>... 16 +({'$m,$M'}) a y +done done a c +done done +#@cli int82float +#@cli : Convert selected 8bits integer representations to float-valued images. +int82float : +e[^-1] "Convert 8bits integer representation$? to float-valued image$?." +repeat $! l[$>] +s c repeat $! l[$>] +sh. {h-1},{h-1},0,0 m={t} rm. +rows 0,{h-2} s y,3 *... 65536 *.. 256 -| +skip ${n\ $m} +done done a c +done done +#@cli float2fft8 +#@cli : Convert selected float-valued images to 8bits fourier representations. +float2fft8 : +e[^-1] "Convert float-valued image$? to 8bits fourier representations." +repeat $! l[$>] +fftpolar +.. 1 log.. float2int8[-2,-1] a y +done done +#@cli fft82float +#@cli : Convert selected 8bits fourier representations to float-valued images. +fft82float : +e[^-1] "Convert float-valued image$? to 8bits fourier representations." +repeat $! l[$>] +s y,2 int82float exp.. -.. 1 ifftpolar +done done +gcd_despeckle : skip ${1=15},${2=30} +repeat $! l[$>] +ma={if(!$2,w*h,$2)} ++label. $1,1 nb={1+iM} ++histogram. $nb,0,{$nb-1} +map.. . rm. +le. $ma *. 255 +inpaint.. . rm. +done done +iain_nr_2019_preview: +remove_opacity +images={$!} +gamma=$1 +shadows=$2 +light=$3 +mid_offset=$4 +desaturate=$5 +guide_mix=$6 +soften_guide=$7 +fine=$8 +mid=$9 +large=$10 +lookup=$11 +recovery_choice=$12 +recovery_amount=$13 +preview_shows=$14 +preview_tones_map=$15 +if $images>2 +gui_warning_preview "Too many input images detected. This filter requires 1 or 2 images as input." +quit +fi +if $12==3" && "$images==1 +gui_warning_preview "No guide image detected. Guided Recovery requires two images, please set 'input layers' to 'active and below' or equivilent. The top layer should be the noisy version of the image and the bottom layer should be a denoised version" +quit +fi +if $images==1 +[0] +fi +if $preview_tones_map ++l[-1] +mid_tone_offset={$mid_offset/-5} +luminance +add {$mid_tone_offset*255} +resize 25%,25%,100%,100%,2 +median 5 +line 0,0,0,100%,1,128 +line 0,0,100%,0,1,128 +line 0,100%,100%,100%,1,128 +line 100%,0,100%,100%,1,128 ++gt[0] 85 ++gt[0] 170 +laplacian[1,2] +l[1] ++gt[0] 0 +lt[0] 0 +replace[0] 1,100 +replace[1] 1,1 +max[0,1] +done +l[2] ++gt[0] 0 +lt[0] 0 +replace[0] 1,255 +replace[1] 1,150 +max[0,1] +done +max[-1,-2] ++neq[-1] 0 +replace[-1] 1,255 +append[-1,-2] c +scale2x[-1] +scale2x[-1] +k[-1] +done +fi +l[0,1] +if $preview_shows==0 +fine=$fine +mid=$mid +large=$large ++iain_nr_2019 $gamma,$shadows,$light,$mid_offset,$desaturate,$guide_mix,$soften_guide,$fine,$mid,$large,$lookup,$recovery_choice,$recovery_amount,$preview_shows,$preview_tones_map +k[0,-1] +sub +noise_amp={_round((128/(max(abs(im),iM))),0.1)} +mul $noise_amp +add 128 +c 0,255 +elif $preview_shows==1 +fine=$fine +mid=0 +large=0 ++iain_nr_2019 $gamma,$shadows,$light,$mid_offset,$desaturate,$guide_mix,$soften_guide,$fine,$mid,$large,$lookup,$recovery_choice,$recovery_amount,$preview_shows,$preview_tones_map +k[0,-1] +sub +noise_amp={_round((128/(max(abs(im),iM))),0.1)} +mul $noise_amp +add 128 +c 0,255 +elif $preview_shows==2 +fine=0 +mid=$mid +large=0 ++iain_nr_2019 $gamma,$shadows,$light,$mid_offset,$desaturate,$guide_mix,$soften_guide,$fine,$mid,$large,$lookup,$recovery_choice,$recovery_amount,$preview_shows,$preview_tones_map +k[0,-1] +sub +noise_amp={_round((128/(max(abs(im),iM))),0.1)} +mul $noise_amp +add 128 +c 0,255 +elif $preview_shows==3 +fine=0 +mid=0 +large=$large ++iain_nr_2019 $gamma,$shadows,$light,$mid_offset,$desaturate,$guide_mix,$soften_guide,$fine,$mid,$large,$lookup,$recovery_choice,$recovery_amount,$preview_shows,$preview_tones_map +k[0,-1] +sub +noise_amp={_round((128/(max(abs(im),iM))),0.1)} +mul $noise_amp +add 128 +c 0,255 +elif $preview_shows==4 +iain_nr_2019 $gamma,$shadows,$light,$mid_offset,$desaturate,$guide_mix,$soften_guide,$fine,$mid,$large,$lookup,$recovery_choice,$recovery_amount,$preview_shows,$preview_tones_map +fi +done +blend alpha +text_size=13 +if $images==1 +guide="Internal Guide" +bg_colour=255 +text_colour=0 +else +guide="External Guide" +bg_colour=0 +text_colour=255 +fi +box_size=100% +rectangle 0,0,$box_size,20,0.5,$bg_colour +text $guide,0.1~,4,$text_size,1,$text_colour +if $14!=4 +rectangle {(w/2)-127*($noise_amp/2)},{h-20},{(w/2)+127*($noise_amp/2)},100%,0.5,$bg_colour +text Noise\ amplified\ $noise_amp\ times,0.5~,{h-16},$text_size,1,$text_colour +fi +guide_recovery=0 +if $recovery_choice==0 +do_recovery=0 +elif $recovery_choice==1 +do_recovery=1 +slow=0 +recover_text="Fast Recovery" +elif $recovery_choice==2 +do_recovery=1 +slow=1 +recover_text="Slow Recovery" +elif $recovery_choice==3 +do_recovery=1 +slow=1 +guide_recovery=1 +recover_text="Guide Recovery" +fi +if $recovery_choice!=0 +text $recover_text,0.9~,4,$text_size,1,$text_colour +fi +iain_nr_2019: +images={$!} +if $images>2 +quit +fi +gamma=$1 +shadow=$2 +light=$3 +mid_tone_offset={$4/5} +chroma=$5 +external_guide_strength=$6 +soften_guide=$7 +fine=$8 +mid={$9/3} +large={$10/9} +patch_size=3 +patch_size_b=3 +lookup_size={($11*2)+1} +mid_lookup_size={($11*2)+1} +large_lookup_size={($11*2)+1} +smoothness_fine=0 +smoothness=0 +fast_approx=0 +std_deviation_s=10 +recovery_choice=$12 +recover=$13 +guide_recovery=0 +slow=0 +if $recovery_choice==0 +do_recovery=0 +elif $recovery_choice==1 +do_recovery=1 +elif $recovery_choice==2 +do_recovery=1 +slow=1 +elif $recovery_choice==3 +do_recovery=1 +slow=1 +guide_recovery=1 +fi +remove_opacity +colours={s} +external_guide=1 +if $!==1 +[0] +external_guide=0 +fi +if $guide_recovery==0 +if $external_guide_strength<1 +[0] +mul[1] $external_guide_strength +mul[2] {1-$external_guide_strength} +add[1,2] +fi +l[-1] +if $colours!=1 +if $chroma>0 +redmul=.299 +greenmul=.587 +bluemul=.114 ++split[0] c +mul[1] $redmul mul[2] $greenmul mul[3] $bluemul +add[1-3] +if $chroma==1 +keep[1] +else +split[0] c name[0] red name[1] green name[2] blue name[3] luma ++sub[blue] [luma] name[-1] cb ++sub[red] [luma] name[-1] cr +keep[luma,cb,cr] +mul[cb,cr] {1-$chroma} ++add[cb] [luma] name[-1] blueout ++add[cr] [luma] name[-1] redout +remove[1,2] ++mul[redout] $redmul +mul[blueout] $bluemul +sub[luma] [-1] sub[luma] [-2] +div[luma] $greenmul +remove[-1,-2] +move[2] 0 +append c +fi +fi +fi +sub 127 +div 128 +if $gamma!=1 +add 1 +pow $gamma +sub 1 +fi +sub $mid_tone_offset ++c[0] 0,100 +c[0] -100,0 +l[0] +if $shadow>0 +fill i+($shadow*abs(i)*0.75)^2 +elif $shadow<0 +fill i-(abs(i)^3)*(abs($shadow)) +fi +done +l[1] +if $light>0 +div[0] {(2^$gamma)-1} +fill i-($light*abs(i)*0.75)^2 +mul[0] {(2^$gamma)-1} +elif $light<0 +div[0] {(2^$gamma)-1} +fill i+(abs(i)^3)*(abs($light)) +mul[0] {(2^$gamma)-1} +fi +done +add +add $mid_tone_offset +mul 128 +add 127 +if $soften_guide +l[0] +(0,0.2,0;0.2,0.2,0.2;0,0.2,0) +convolve[0] [1] +rm[1] +done +fi +done ++l[0,1] +levels=2 +size={3^$levels} +cropwidth={w} +cropheight={h} +if $colours>1 to_rgb fi +resize {w+($size-w%$size)},{h+($size-h%$size)},{d},{s},0,1 +if $fine>0 +denoise[0] [1],$std_deviation_s,$fine,$patch_size,$lookup_size,$smoothness_fine,$fast_approx +fi ++resize[0,1] 33.33333%,33.33333%,{d},{s},2 +rm[1] ++iain_resize_x3[-2] +blur[-1] 1 +sub[0,-1] +if $mid>0 +denoise[1] [2],$std_deviation_s,$mid,$patch_size,$mid_lookup_size,$smoothness_fine,$fast_approx +fi +l[1,2] ++resize[0,1] 33.33333%,33.33333%,{-1,d},{-1,s},2 +rm[1] ++iain_resize_x3[-2] +blur[-1] 1 +sub[0,-1] +if $large>0 +denoise[1] [2],$std_deviation_s,$large,$patch_size,$large_lookup_size,$smoothness_fine,$fast_approx +fi +done +rm[-1] +repeat 2 +iain_resize_x3[-1] +blur[-1] 1 +add[-1,-2] +done +crop 0,0,{$cropwidth-1},{$cropheight-1} +c 0,255 +done +rm[1] +fi +if $do_recovery +sub[0] [1] +if $colours!=1 +l[0] split c mul[0] 0.2126 mul[1] 0.7125 mul[2] 0.0722 add done +fi ++blur[0] 10 +sub[0] [-1] +rm[-1] ++abs[0] +noise={-1,ia} +blur[-1] 3 +bilateral[-1] [1],20,$noise +blur[-1] 2 +fill[-1] 5/i +mul[0] [-1] +l[0] +add 128 +resize[0] {w+256},{h+256},1,1,0,2,0.5,0.5 +if $slow +iain_fft_denoise_stack[0] {2-$recover},0.5 +else +iain_fft_denoise[0] {2-$recover},0.5 +fi +crop[0] 128,128,{w-129},{h-129} +sub 128 ++blur 10 +sub +done +div[0] [-1] +rm[-1] +if $colours>1 to_rgb[0] fi +add +else +k[-1] +fi +c 0,255 +iain_fft_denoise_stack: +resize {w+128},{h+128},1,1,0,2,0.5,0.5 +offset1x=24 +offset1y=4 +offset2x=-10 +offset2y=21 +offset3x=27 +offset3y=27 +offset4x=6 +offset4y=38 ++shift[0] $offset1x,$offset1y,0,0 ++shift[0] $offset2x,$offset2y,0,0 ++shift[0] $offset3x,$offset3y,0,0 ++shift[0] $offset4x,$offset4y,0,0 +iain_fft_denoise[0] $1,$2 +iain_fft_denoise[1] $1,$2 +iain_fft_denoise[2] $1,$2 +iain_fft_denoise[3] $1,$2 +iain_fft_denoise[4] $1,$2 +shift[1] {$offset1x*-1},{$offset1y*-1},0,0 +shift[2] {$offset2x*-1},{$offset2y*-1},0,0 +shift[3] {$offset3x*-1},{$offset3y*-1},0,0 +shift[4] {$offset4x*-1},{$offset4y*-1},0,0 +blend_median +crop 64,64,{w-65},{h-65} +iain_fft_denoise: +luminance +cropwidth={w} +cropheight={h} +size={64} +resize {w+($size-w%$size)},{h+($size-h%$size)},{d},{s},0,1 +tilew={w/64} +tileh={h/64} +split_tiles $tilew,$tileh +foreach { fftpolar a z } ++blend_median +mul[-1] $1 +repeat $!-1 +l[$>,-1] +split z ++circle[0] 50%,50%,1,1,0 +blur[-1] 1 +mul[-1] {$1*$2} +lt[-1] [2] +circle[-1] 50%,50%,1,1,0 +mul[-1] [2] +sub[0] [-1] +c[0] 0,1e31 +k[0,1,2,3] +append[0,1] z +append[1,2] z +done +done +rm[-1] +foreach { s z ifftpolar } +append_tiles $tilew,$tileh +c 0,255 +crop 0,0,{$cropwidth-1},{$cropheight-1} +iain_fast_denoise_p: +tic +if $7 +apply_parallel_overlap "iain_fast_denoise ${1--1}",128,0 +else +iain_fast_denoise ${1--1} +fi +toc +iain_fast_denoise: +repeat $! l[$>] nm={0,n} split_opacity l[0] +fastluma1={$1*5000} +fastluma2={$fastluma1*.9} +fastluma3={$fastluma1*.65} +fastluma4={$fastluma1*.44} +fastchroma1={$2*5000} +fastchroma2=$fastchroma1 +fastchroma3={$fastchroma2/2} +fastchroma4={$fastchroma3/2} +despeckle_threshold={($4/25)*100000} +if $3!=1 +scale={255*1000} +ex={$3} +pt1x={$scale*0.025} +pt2x={$scale*0.05} +pt3x={$scale*0.075} +pt4x={$scale*0.1} +pt5x={$scale*0.125} +pt6x={$scale*0.15} +pt7x={$scale*0.175} +pt8x={$scale*0.2} +pt9x={$scale*0.225} +pt10x={$scale*0.25} +pt11x={$scale*0.275} +pt12x={$scale*0.3} +pt13x={$scale*0.325} +pt14x={$scale*0.35} +pt15x={$scale*0.375} +pt16x={$scale*0.4} +pt17x={$scale*0.425} +pt18x={$scale*0.45} +pt19x={$scale*0.475} +pt20x={$scale*0.5} +pt21x={$scale*0.525} +pt22x={$scale*0.55} +pt23x={$scale*0.575} +pt24x={$scale*0.6} +pt25x={$scale*0.625} +pt26x={$scale*0.65} +pt27x={$scale*0.675} +pt28x={$scale*0.7} +pt29x={$scale*0.725} +pt30x={$scale*0.75} +pt31x={$scale*0.775} +pt32x={$scale*0.8} +pt33x={$scale*0.825} +pt34x={$scale*0.85} +pt35x={$scale*0.875} +pt36x={$scale*0.9} +pt37x={$scale*0.925} +pt38x={$scale*0.95} +pt39x={$scale*0.975} +pt40x={$scale*1} +pt1y={(0.025^$ex)*$scale} +pt2y={(0.05^$ex)*$scale} +pt3y={(0.075^$ex)*$scale} +pt4y={(0.1^$ex)*$scale} +pt5y={(0.125^$ex)*$scale} +pt6y={(0.15^$ex)*$scale} +pt7y={(0.175^$ex)*$scale} +pt8y={(0.2^$ex)*$scale} +pt9y={(0.225^$ex)*$scale} +pt10y={(0.25^$ex)*$scale} +pt11y={(0.275^$ex)*$scale} +pt12y={(0.3^$ex)*$scale} +pt13y={(0.325^$ex)*$scale} +pt14y={(0.35^$ex)*$scale} +pt15y={(0.375^$ex)*$scale} +pt16y={(0.4^$ex)*$scale} +pt17y={(0.425^$ex)*$scale} +pt18y={(0.45^$ex)*$scale} +pt19y={(0.475^$ex)*$scale} +pt20y={(0.5^$ex)*$scale} +pt21y={(0.525^$ex)*$scale} +pt22y={(0.55^$ex)*$scale} +pt23y={(0.575^$ex)*$scale} +pt24y={(0.6^$ex)*$scale} +pt25y={(0.625^$ex)*$scale} +pt26y={(0.65^$ex)*$scale} +pt27y={(0.675^$ex)*$scale} +pt28y={(0.7^$ex)*$scale} +pt29y={(0.725^$ex)*$scale} +pt30y={(0.75^$ex)*$scale} +pt31y={(0.775^$ex)*$scale} +pt32y={(0.8^$ex)*$scale} +pt33y={(0.825^$ex)*$scale} +pt34y={(0.85^$ex)*$scale} +pt35y={(0.875^$ex)*$scale} +pt36y={(0.9^$ex)*$scale} +pt37y={(0.925^$ex)*$scale} +pt38y={(0.95^$ex)*$scale} +pt39y={(0.975^$ex)*$scale} +pt40y={(1^$ex)*$scale} +fi +interpolation=1 +tic +to_rgb +mul[0] 1000 +if $3!=1 +apply_curve[0] 0,0,0,$pt1x,$pt1y,$pt2x,$pt2y,$pt3x,$pt3y,$pt4x,$pt4y,$pt5x,$pt5y,$pt6x,$pt6y,$pt7x,$pt7y,$pt8x,$pt8y,$pt9x,$pt9y,$pt10x,$pt10y,$pt11x,$pt11y,$pt12x,$pt12y,$pt13x,$pt13y,$pt14x,$pt14y,$pt15x,$pt15y,$pt16x,$pt16y,$pt17x,$pt17y,$pt18x,$pt18y,$pt19x,$pt19y,$pt20x,$pt20y,$pt21x,$pt21y,$pt22x,$pt22y,$pt23x,$pt23y,$pt24x,$pt24y,$pt25x,$pt25y,$pt26x,$pt26y,$pt27x,$pt27y,$pt28x,$pt28y,$pt29x,$pt29y,$pt30x,$pt30y,$pt31x,$pt31y,$pt32x,$pt32y,$pt33x,$pt33y,$pt34x,$pt34y,$pt35x,$pt35y,$pt36x,$pt36y,$pt37x,$pt37y,$pt38x,$pt38y,$pt39x,$pt39y,$pt40x,$pt40y +fi +redmul=.299 +greenmul=.587 +bluemul=.114 +to_rgb[0] ++split[0] c +mul[1] $redmul +mul[2] $greenmul +mul[3] $bluemul +add[1-3] +split[0] c +name[0] red +name[1] green +name[2] blue +name[3] luma ++sub[blue] [luma] +name[-1] cb ++sub[red] [luma] +name[-1] cr +keep[luma,cb,cr] +if $despeckle_threshold>0 +iain_fast_despeckle[0] {1-$despeckle_threshold} +fi +if $1>0 +iain_fast_denoise_main[0] {$fastluma1},{$fastluma2},{$fastluma3},{$fastluma4},$interpolation +fi +if $2>0 +iain_fast_denoise_main[1] {$fastchroma1},{$fastchroma2},{$fastchroma3},{$fastchroma4},$interpolation +iain_fast_denoise_main[2] {$fastchroma1},{$fastchroma2},{$fastchroma3},{$fastchroma4},$interpolation +fi +name[0] luma +name[1] cb +name[2] cr ++add[cb] [luma] +name[-1] blueout ++add[cr] [luma] +name[-1] redout +remove[1,2] ++mul[redout] $redmul ++mul[blueout] $bluemul +sub[luma] [-1] +sub[luma] [-2] +div[luma] $greenmul +remove[-1,-2] +move[2] 0 +append c +if $5==1 +100%,100%,1,1,0 +noise[-1] 0.7,0 ++laplacian[0] +threshold[-1] 4 +dilate[-1] 3 +mul[-1] -1 +add[-1] 1 +mul[-2] [-1] +remove[-1] +add +fi +if $3!=1 +scale={255*1000} +ex={1/$3} +pt1y={(0.025^$ex)*$scale} +pt2y={(0.05^$ex)*$scale} +pt3y={(0.075^$ex)*$scale} +pt4y={(0.1^$ex)*$scale} +pt5y={(0.125^$ex)*$scale} +pt6y={(0.15^$ex)*$scale} +pt7y={(0.175^$ex)*$scale} +pt8y={(0.2^$ex)*$scale} +pt9y={(0.225^$ex)*$scale} +pt10y={(0.25^$ex)*$scale} +pt11y={(0.275^$ex)*$scale} +pt12y={(0.3^$ex)*$scale} +pt13y={(0.325^$ex)*$scale} +pt14y={(0.35^$ex)*$scale} +pt15y={(0.375^$ex)*$scale} +pt16y={(0.4^$ex)*$scale} +pt17y={(0.425^$ex)*$scale} +pt18y={(0.45^$ex)*$scale} +pt19y={(0.475^$ex)*$scale} +pt20y={(0.5^$ex)*$scale} +pt21y={(0.525^$ex)*$scale} +pt22y={(0.55^$ex)*$scale} +pt23y={(0.575^$ex)*$scale} +pt24y={(0.6^$ex)*$scale} +pt25y={(0.625^$ex)*$scale} +pt26y={(0.65^$ex)*$scale} +pt27y={(0.675^$ex)*$scale} +pt28y={(0.7^$ex)*$scale} +pt29y={(0.725^$ex)*$scale} +pt30y={(0.75^$ex)*$scale} +pt31y={(0.775^$ex)*$scale} +pt32y={(0.8^$ex)*$scale} +pt33y={(0.825^$ex)*$scale} +pt34y={(0.85^$ex)*$scale} +pt35y={(0.875^$ex)*$scale} +pt36y={(0.9^$ex)*$scale} +pt37y={(0.925^$ex)*$scale} +pt38y={(0.95^$ex)*$scale} +pt39y={(0.975^$ex)*$scale} +pt40y={(1^$ex)*$scale} +apply_curve[0] 0,0,0,$pt1x,$pt1y,$pt2x,$pt2y,$pt3x,$pt3y,$pt4x,$pt4y,$pt5x,$pt5y,$pt6x,$pt6y,$pt7x,$pt7y,$pt8x,$pt8y,$pt9x,$pt9y,$pt10x,$pt10y,$pt11x,$pt11y,$pt12x,$pt12y,$pt13x,$pt13y,$pt14x,$pt14y,$pt15x,$pt15y,$pt16x,$pt16y,$pt17x,$pt17y,$pt18x,$pt18y,$pt19x,$pt19y,$pt20x,$pt20y,$pt21x,$pt21y,$pt22x,$pt22y,$pt23x,$pt23y,$pt24x,$pt24y,$pt25x,$pt25y,$pt26x,$pt26y,$pt27x,$pt27y,$pt28x,$pt28y,$pt29x,$pt29y,$pt30x,$pt30y,$pt31x,$pt31y,$pt32x,$pt32y,$pt33x,$pt33y,$pt34x,$pt34y,$pt35x,$pt35y,$pt36x,$pt36y,$pt37x,$pt37y,$pt38x,$pt38y,$pt39x,$pt39y,$pt40x,$pt40y +fi +mul[0] 0.001 +c 0,255 +toc +done a c nm $nm done done +fastblur: +repeat $! +l[$<] +(0.0579710145,0.1304347826,0.0579710145;0.1304347826,0.2463768116,0.1304347826;0.0579710145,0.1304347826,0.0579710145) +convolve[0] [1] +remove[-1] +done +done +iain_fast_despeckle: +(0,0.2,0;0.2,0.2,0.2;0,0.2,0) ++convolve[0] [1] ++sub[-1] [0] +abs[-1] ++convolve[-1] [1] +sub[-1] [-2] +abs[-1] +keep[0,2,-1] +threshold[-1] $1 +mul[-1] 255 +append[1,2] c +blend alpha +iain_fast_denoise_main: +cropwidth={w} +cropheight={h} +resize[0] {w+(8-w%8)},{h+(8-h%8)},1,{s},0,1 +width={w} +height={h} ++resize[0] 50%,50%,{d},{s},2 ++resize[1] $width,$height,{d},{s},$5 +fastblur[-1] +sub[0] [2] +remove[2] ++resize[1] 50%,50%,{d},{s},2 ++resize[2] {$width/2},{$height/2},{d},{s},$5 +fastblur[-1] +sub[1] [3] +remove[3] ++resize[2] 50%,50%,{d},{s},2 ++resize[3] {$width/4},{$height/4},{d},{s},$5 +fastblur[-1] +sub[2] [4] +remove[4] ++resize[3] 50%,50%,{d},{s},2 ++resize[4] {$width/8},{$height/8},{d},{s},$5 +fastblur[-1] +sub[3] [5] +remove[5] +rmsthresh[0] $1 +rmsthresh[1] $2 +rmsthresh[2] $3 +rmsthresh[3] $4 +resize[-1] {3,w},{3,h},{d},{s},$5 +fastblur[-1] +add[-2] [-1] +remove[-1] +resize[-1] {2,w},{2,h},{d},{s},$5 +fastblur[-1] +add[-2] [-1] +remove[-1] +resize[-1] {1,w},{1,h},{d},{s},$5 +fastblur[-1] +add[-2] [-1] +remove[-1] +resize[-1] {0,w},{0,h},{d},{s},$5 +fastblur[-1] +add[-2] [-1] +remove[-1] +crop 0,0,{$cropwidth-1},{$cropheight-1} +rmsthresh: ++abs[0] +fastblur[1] +threshold[1] {$1} +fastblur[1] +mul[0] [1] +keep[0] +iain_fast_denoise_p_preview: +if $-2==0 +iain_fast_denoise ${1--3} +fi +if $-2==1 ++iain_fast_denoise_p $1,0,1,$4,0,0,$7 +compose_grainextract +sub 128 +mul 3 +add 128 +fi +if $-2==2 ++iain_fast_denoise_p 0,$2,1,$4,0,0,$7 +compose_grainextract +sub 128 +mul 3 +add 128 +fi +fx_inpaint_holes : +inpaint_holes {$1^1.5},$2,$3 +fx_inpaint_morpho : +foreach { +R=$1 G=$2 B=$3 A=$4 +if !$A" && "(s==2" || "s==4) split_opacity +!=. 0 *[0,-1] a c R=0 G=0 B=0 fi ++round select_color. 0,{round([$R,$G,$B,$A])} +if $5 dilate. {1+2*$5} fi +inpaint_morpho.. [1] +rm. +} +fx_inpaint_morpho_preview : +fx_inpaint_morpho ${1-4},{1+$5} +fx_inpaint_matchpatch : +foreach { +nm={n} R=$6 G=$7 B=$8 A=$9 +if !$A" && "(s==2" || "s==4) split_opacity +!=. 0 *[0,-1] a c R=0 G=0 B=0 fi ++round select_color. 0,{round([$R,$G,$B,$A])} +if $10 dilate. {1+2*$10} fi +if $11 +visu_size=${fitscreen[]" "{0,[w,h,1]},25%,50%} +w1.. $visu_size,0,"[Preview] G'MIC: Inpaint [multi-scale]" +fi +srand 0 inpaint_matchpatch.. [1],${1-5} +rm. => $nm +} +fx_inpaint_matchpatch_preview : +fx_inpaint_matchpatch ${1-9},{1+$10},0 +_fx_inpaint_patch : +foreach { +R=$9 G=$10 B=$11 A=$12 +if !$A" && "(s==2" || "s==4) split_opacity +!=. 0 *[0,-1] a c R=0 G=0 B=0 fi ++round select_color. 0,{round([$R,$G,$B,$A])} +if $13 dilate. {1+2*$13} fi +inpaint.. [1],$1,{$1*$2},$3,1,{$4*$1},${5-8} +rm. +} +fx_inpaint_patch : +foreach { +if $14 +bs={max(16,min(w,h)*arg(1+$14,100,75,50,25,10,5,2,1)%)} +at "_fx_inpaint_patch $*",$bs,$bs,1,25%,25%,0,2 +else _fx_inpaint_patch $* +fi +} +fx_inpaint_patch_preview : +fx_inpaint_patch ${1-12},{1+$13},0 +fx_inpaint_pde : +foreach { +R=$4 G=$5 B=$6 A=$7 +if !$A" && "(s==2" || "s==4) split_opacity +!=. 0 *[0,-1] a c R=0 G=0 B=0 fi ++select_color 0,$R,$G,$B,$A +if $8 dilate. {1+2*$8} fi +inpaint_pde.. [1],$1%,$2,$3 +rm. +} +c 0,255 +fx_inpaint_pde_preview : +fx_inpaint_pde ${1-7},{1+$8} +local_similarity_mask: +repeat $! l[$>] +nm=${-gui_layer_name} +x_location=$1 +y_location=$2 +keep=$3 +reject=$4 +colour_channel=$5 +if $6==0 +steps=100 +elif $6==1 +steps=25 +elif $6>1 +steps={min($6,($reject-$keep))} +fi +to_rgb +if $colour_channel!=0 +if $colour_channel==1 channels 0 fi +if $colour_channel==2 channels 1 fi +if $colour_channel==3 channels 2 fi +if $colour_channel==4 luminance fi +if $colour_channel==5 rgb2lab[0] channels 1 fi +if $colour_channel==6 rgb2lab[0] channels 2 fi +if $colour_channel==7 rgb2hsv[0] channels 0 fi +if $colour_channel==8 rgb2hsv[0] channels 1 fi +if $colour_channel==9 rgb2hsv[0] channels 2 fi +if $colour_channel==10 rgb2hsl[0] channels 2 fi +if $colour_channel==11 rgb2cmyk[0] channels 0 fi +if $colour_channel==12 rgb2cmyk[0] channels 1 fi +if $colour_channel==13 rgb2cmyk[0] channels 2 fi +if $colour_channel==14 rgb2cmyk[0] channels 3 fi +fi +n 0,255 +mul[0] 0.9 +{w},{h},1,1,0 +step_size={($reject-$keep)/$steps} +repeat $steps ++flood[0] $x_location%,$y_location%,0,{$keep+($>*$step_size)},0,1,255 threshold[-1] 99% +add[-1,-2] +done +keep[-1] +n 0,255 +nm name($nm) +done done +createbc: +(0.5,0.5,0;0,0,0;0,0,0) +(0.5,0,0.5;0,0,0;0,0,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbd: +(0.5,0,0;0,0,0.5;0,0,0) +(0.5,0,0;0,0,0;0,0,0.5) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbe: +(0.5,0,0;0,0,0;0,0.5,0) +(0.5,0,0;0,0,0;0.5,0,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbf: +(0.5,0,0;0.5,0,0;0,0,0) +(0,0.5,0.5;0,0,0;0,0,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbg: +(0,0.5,0;0,0,0.5;0,0,0) +(0,0.5,0;0,0,0;0,0,0.5) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbh: +(0,0.5,0;0,0,0;0,0.5,0) +(0,0.5,0;0,0,0;0.5,0,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbi: +(0,0.5,0;0.5,0,0;0,0,0) +(0,0,0.5;0,0,0.5;0,0,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbj: +(0,0,0.5;0,0,0;0,0,0.5) +(0,0,0.5;0,0,0;0,0.5,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbk: +(0,0,0.5;0,0,0;0.5,0,0) +(0,0,0.5;0.5,0,0;0,0,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbl: +(0,0,0;0,0,0.5;0,0,0.5) +(0,0,0;0,0,0.5;0,0.5,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbm: +(0,0,0;0,0,0.5;0.5,0,0) +(0,0,0;0.5,0,0.5;0,0,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbn: +(0,0,0;0,0,0;0,0.5,0.5) +(0,0,0;0,0,0;0.5,0,0.5) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbo: +(0,0,0;0.5,0,0;0,0,0.5) +(0,0,0;0,0,0;0.5,0.5,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbp: +(0,0,0;0.5,0,0;0,0.5,0) +(0,0,0;0.5,0,0;0.5,0,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbq: ++createbc[0] ++createbd[0] +iain_median_3_stack[0,1,2] +keep[-1] +createbr: ++createbe[0] ++createbf[0] +iain_median_3_stack[0,1,2] +keep[-1] +createbs: ++createbg[0] ++createbh[0] +iain_median_3_stack[0,1,2] +keep[-1] +createbt: ++createbi[0] ++createbj[0] +iain_median_3_stack[0,1,2] +keep[-1] +createbu: ++createbk[0] ++createbl[0] +iain_median_3_stack[0,1,2] +keep[-1] +createbv: ++createbm[0] ++createbn[0] +iain_median_3_stack[0,1,2] +keep[-1] +createbw: ++createbo[0] ++createbp[0] +iain_median_3_stack[0,1,2] +keep[-1] +createbx: ++createbq[0] ++createbr[0] +iain_median_3_stack[0,1,2] +keep[-1] +createby: ++createbs[0] ++createbt[0] +iain_median_3_stack[0,1,2] +keep[-1] +createbz: ++createbu[0] ++createbv[0] +iain_median_3_stack[0,1,2] +keep[-1] +createca: ++createbx[0] ++createby[0] +iain_median_3_stack[0,1,2] +keep[-1] +createcb: ++createbz[0] ++createbw[0] +iain_median_3_stack[0,1,2] +keep[-1] +megaclean: ++createca[0] ++createcb[0] +iain_median_3_stack[0,1,2] +keep[-1] +cross: ++shift[0] 0,1,0,0,2 ++shift[0] 0,-1,0,0,2 ++shift[0] 1,0,0,0,2 ++shift[0] -1,0,0,0,2 +iain_median_5_stack +ex: ++shift[0] 1,1,0,0,2 ++shift[0] 1,-1,0,0,2 ++shift[0] -1,-1,0,0,2 ++shift[0] -1,1,0,0,2 +iain_median_5_stack +hybrid_median: +ac " +repeat $1 ++cross[0] ++ex[0] +iain_median_3_stack[0,1,2] +done +",$2 +iain_hybrid_median: +repeat $1 ++cross[0] ++ex[0] +iain_median_3_stack[0,1,2] +done +iain_pixel_denoise: +if $1==0 +ac " +repeat $2 +megaclean +done +",$3 +elif $1==1 +hybrid_median[0] $2,$3 +elif $2==1 ++l[0] +(1,1,1;1,0,1;1,1,1) +dilate[0] [1] +rm[1] +done ++l[0] +(1,1,1;1,0,1;1,1,1) +erode[0] [1] +rm[1] +done +min[0,1] +max[0,1] +fi +iain_pixel_denoise_p: +if $5 +if $1==0 +ac " +repeat $2 +apply_parallel_overlap \"megaclean \",4,0 +done +",$3 +elif $1==1 +ac " +apply_parallel_overlap \"iain_hybrid_median[0] $2\",4,0 +",$3 +elif $1==2 +ac " +apply_parallel_overlap \" ++l[0] +(1,1,1;1,0,1;1,1,1) +dilate[0] [1] +rm[1] +done ++l[0] +(1,1,1;1,0,1;1,1,1) +erode[0] [1] +rm[1] +done +min[0,1] +max[0,1] +\",4,0 +",$3 +fi +else +if $1==0 +ac " +repeat $2 +megaclean +done +",$3 +elif $1==1 +ac " +iain_hybrid_median_p[0] $2 +",$3 +elif $1==2 +ac " ++l[0] +(1,1,1;1,0,1;1,1,1) +dilate[0] [1] +rm[1] +done ++l[0] +(1,1,1;1,0,1;1,1,1) +erode[0] [1] +rm[1] +done +min[0,1] +max[0,1] +",$3 +fi +fi +time=$| +iain_pixel_denoise_p_preview: +if $4==0 +iain_pixel_denoise_p ${1--1} +fi +if $4==1 ++iain_pixel_denoise_p ${1--1} +sub[0] [1] +keep[0] +n 0,255 +fi +iain_recursive_median_p: +if $5 +ac " +apply_parallel_overlap \" +repeat $2 median $1 done +\",{$1*2},0 +",$3,0 +else +ac " +repeat $2 median $1 done +",$3,0 +fi +recursive_median: +ac "repeat $3 median $1 done",$2,0 +iain_recursive_median_p_preview: +if $-2==0 +iain_recursive_median_p $1,$2,$3,$4,$5 +fi +if $-2==1 +remove_opacity ++iain_recursive_median_p $1,$2,$3,$4,$5 +sub[0] [1] +keep[0] +mul 2 +add 128 +fi +fx_remove_hotpixels : +remove_hotpixels $1,$2 +fx_remove_hotpixels_preview : +gui_split_preview "fx_remove_hotpixels $*",${-3--1} +jeje_scandoc : +scandoc $1,$2%,$3%,$4% +jeje_scandoc_preview : +gui_split_preview "jeje_scandoc $1,$2,$3,$4",$-1 +fx_smooth_anisotropic : +ac "repeat $11 { smooth $1,$2,$3,$4,$5,$6,$7,$8,$9,$10 }",$12 c 0,255 +fx_smooth_anisotropic_preview : +gui_split_preview "fx_smooth_anisotropic $*",${-3--1} +fx_smooth_antialias : +foreach { ++diffusiontensors 0,1,1,$3,$3 ++gradient_norm.. >=. $2% *[-2,-1] +smooth.. .,{$1^1/3},0.5,120,2,1 rm. +} +fx_smooth_antialias_preview : +gui_split_preview "fx_smooth_antialias $*",${-3--1} +fx_smooth_bilateral : skip ${5=0},${6=0} +ac "repeat $3 { bilateral $1,$2 }",$4 +fx_smooth_bilateral_preview : +gui_split_preview "fx_smooth_bilateral $*",${-3--1} +jeje_denoise_patch_dict : ++denoise_patch_dict {2^($1+2)},$2,$3,$4 +*[0] $5 *[1] {1-$5} + c 0,255 +jeje_denoise_patch_dict_preview : +gui_split_preview "jeje_denoise_patch_dict ${1--2}",$-1 +fx_smooth_diffusion : +ac "gui_parallel_overlap \"smooth $6,$1,$2,$3,$4,$5,0 c 0,255\",$8,$9",$7 +fx_smooth_diffusion_preview : +gui_split_preview "fx_smooth_diffusion $*",${-3--1} +fx_smooth_guided : skip ${6=0},${7=0} +if $1" && "!narg($_guide) +if $!<2 gui_warning_preview "Missing guide layer" return fi +store[{$1==1?0:-1}] _guide +fi +if $1==0 +ac "repeat $4 { guided $2,$3 }",$5 +elif $1==1 +ac "$_guide r. ..,..,1,100%,0,0,0.5,0.5 repeat $4 { guided[0] [1],$2,$3 } rm.",$5 +if !narg($_is_preview) $_guide mv. 0 fi +else +ac "$_guide r. ..,..,1,100%,0,0,0.5,0.5 repeat $4 { guided[0] [1],$2,$3 } rm.",$5 +if !narg($_is_preview) $_guide fi +fi +fx_smooth_guided_preview : +if $1" && "!narg($_guide) +if $!<2 gui_warning_preview "Missing guide layer" return fi +store[{$1==1?0:-1}] _guide +fi +_is_preview=1 +gui_split_preview "fx_smooth_guided $*",${-3--1} +jeje_denoise_iuwt : +denoise_iuwt $1,$2,{$3+1} +jeje_denoise_iuwt_preview : +gui_split_preview "jeje_denoise_iuwt $1,$2,$3",$-1 +fx_smooth_meancurvature : +ac "gui_parallel_overlap \"meancurvature_flow $2,$1,$3 c 0,255\",$5,$6",$4 +fx_smooth_meancurvature_preview : +gui_split_preview "fx_smooth_meancurvature $*",${-3--1} +fx_smooth_median : +ac "median $1,$2",$3 +fx_smooth_median_preview : +gui_split_preview "fx_smooth_median $*",${-3--1} +fx_smooth_nlmeans: +foreach { +if s==1 nlmeans $1,$2,$3,-_fx_smooth_nlmeans$4 +else ac "gui_parallel_overlap \"nlmeans $1,$2,$3,-_fx_smooth_nlmeans$4\",$6,$7",$5 +fi +} +_fx_smooth_nlmeans0 : s c abs max +_fx_smooth_nlmeans1 : s c abs + +_fx_smooth_nlmeans2 : norm +_fx_smooth_nlmeans3 : if s>=3 channels 0,2 luminance else norm fi +_fx_smooth_nlmeans4 : if s>=3 channels 0,2 srgb2rgb rgb2lab channels 0 else norm fi +_fx_smooth_nlmeans5 : +fx_smooth_nlmeans_preview: +gui_split_preview "fx_smooth_nlmeans $*",${-3--1} +fx_smooth_patch : +ac "gui_parallel_overlap \"repeat $7 { denoise $1,$2,$3,$4,$5,$6 } c 0,255\",$9,$10",$8 +fx_smooth_patch_preview : +gui_split_preview "fx_smooth_patch $*",${-3--1} +fx_smooth_patchpca : +ac "denoise_patchpca ${1-4} c 0,255",$5 +fx_smooth_patchpca_preview : +gui_split_preview "fx_smooth_patchpca $*",${-3--1} +fx_smooth_peronamalik : +ac "gui_parallel_overlap \"peronamalik_flow $1,$3,$2,$4 c 0,255\",$6,$7",$5 +fx_smooth_peronamalik_preview : +gui_split_preview "fx_smooth_peronamalik $*",${-3--1} +fx_smooth_selective : +ac "gui_parallel_overlap \"repeat $4 { blur_selective $1,$2,$3 } c 0,255\",$6,$7",$5 +fx_smooth_selective_preview : +gui_split_preview "fx_smooth_selective $*",${-3--1} +fx_smooth_skin : +foreach { +split_opacity l[0] { +to_rgb +if $5 +balance_gamma 128,128,128 else [0] fi +if $1==0 channels. 0 f. 1 elif $1==2 detect_skin. $2 else detect_skin. $2,$6%,$7%,$8% fi +M={iM} b. $3% *. {$M/iM} *. $4 c. 0,1 +split_details[0] 4,$9%,$10% ++_fx_smooth_skin[2] $12,$11 +j[2] .,0,0,0,0,1,.. rm[-2,-1] +*. {10^$13} + c 0,255 +} +a c +} +_fx_smooth_skin : +if $1==0 b {$2/8}% +else +if $2>0 +m={im} M={iM} n 0,255 +repeat int($2/5) { bilateral 3%,{5*3} } +bilateral 3%,{($2%5)*3} +* {($M-$m)/255} + $m +fi +fi +fx_smooth_skin_preview : +if $14==0 +gui_split_preview "if $5 balance_gamma 128,128,128 fi if $1==0 f 1 elif $1==2 detect_skin $2 ""else detect_skin $2,$6%,$7%,$8% fi M={iM} b $3% * {255*$M/iM} * $4 c 0,255",${-3--1} +elif $14==1 +gui_split_preview "b $9%",${-3--1} +elif $14==2 +gui_split_preview "split_details 4,$9%,$10% k.. n 0,255",${-3--1} +elif $14==3 +gui_split_preview "split_details 4,$9%,$10% k.. _fx_smooth_skin $12,$11 n 0,255",${-3--1} +elif $14==4 +gui_split_preview "split_details 4,$9%,$10% k. n 0,255",${-3--1} +else +gui_split_preview "fx_smooth_skin $*",${-3--1} +fi +if $1==1 +to_rgb +circle $6%,$7%,$8%,0.2,0,255,0 +circle $6%,$7%,$8%,0.4,0xFFFFFFFF,0,255,0 +line {$6-0.25*$8}%,{$7-0.25*$8}%,{$6+0.25*$8}%,{$7+0.25*$8}%,0.8,255,255,0 +line {$6+0.25*$8}%,{$7-0.25*$8}%,{$6-0.25*$8}%,{$7+0.25*$8}%,0.8,255,255,0 +fi +fx_smooth_tv : +ac "gui_parallel_overlap \"tv_flow $2,$1,$3 c 0,255\",$5,$6",$4 +fx_smooth_tv_preview : +gui_split_preview "fx_smooth_tv $*",${-3--1} +fx_smooth_haar : +remove_opacity +ac "gui_parallel_overlap \"denoise_haar $1,$3,$2 c 0,255\",$5,$6",$4 +fx_smooth_haar_preview : +gui_split_preview "fx_smooth_haar $*",${-3--1} +jeje_local_wiener : +ac "local_wiener $1",$2,$3 +jeje_local_wiener_preview : +gui_split_preview "jeje_local_wiener $*",$-1 +fx_solidify_td : +foreach { +to_rgba sh 0,{s-2} if $5 srgb2rgb. fi rm. +if $4 +. sh. 100% if $4>0 erode. {1+2*$4} else dilate. {1-2*$4} fi rm. +solidify. $1%,$2,$3 +rv blend alpha +else +solidify $1%,$2,$3 +fi +if $5 rgb2srgb. fi +} +fx_solidify_td_preview : +gui_split_preview "fx_solidify_td $*",${-3--1} +unpurple : skip ${1=1},${2=0},${3=0},${4=0.33},${5=5},${6=0},${7=0} +intensity=$1 +min_brightness=$2 +min_red_to_blue_ratio=$3 +max_red_to_blue_ratio=$4 +blur_std_variation=$5 +gentle=$6 +precision=$7 +if $gentle +min_brightness=0.8 +min_red_to_blue_ratio=0.15 +fi +repeat $! +local[$>] +if s==3 +has_alpha=0 +elif s==4 +has_alpha=1 +else +error "Unsupported number of image channels "{s} +fi +split c +if $has_alpha +move. 0 +fi +if $precision +max_blue={(1<<$precision)-1} +else +max_blue.={iM} +fi ++fill. "blue=i/"$max_blue"; +threshold="$min_brightness"; +grey_level=max(0,(blue-threshold))*1/(1-threshold); +"$intensity"*grey_level" +blur. $blur_std_variation,0,0 +append[-4,-3,-2,-1] c +fill. "bl=min("$max_blue",("$max_blue"*i3)); +db=max((i2-i1), 0); +dr=max((i0-i1), 0); +mb=min(bl,db); +r_diff=min(dr,mb*"$max_red_to_blue_ratio"); +b_diff=if("$min_red_to_blue_ratio">0,min(mb,r_diff/"$min_red_to_blue_ratio"),mb); +bl=round(bl,0,-1); +r_diff=round(r_diff,0,-1); +b_diff=round(b_diff,0,-1); +[i0-r_diff,i1,i2-b_diff]" +split. c +remove. +if $has_alpha +move[0] 4 +fi +append c +done +done +return +unpurple_preview : +gui_split_preview "unpurple $*",${-3--1} +vis_min_brightness=2 +vis_min_red_to_blue=2 +gentle={$6} +if $gentle +vis_min_brightness=0 +vis_min_red_to_blue=0 +fi +status "{$1}""{$2}"_$vis_min_brightness"{$3}"_$vis_min_red_to_blue"{$4}""{$5}""{$6}""{$7}""{$8}""{$9}" +jeje_unstrip : +unstrip $1,$2,$3 +if $5 tape powerspectrum +else +if -$4 n 0,255 else c 0,255 fi +fi +jeje_unstrip_preview : +gui_split_preview "jeje_unstrip $1,$2,$3,$4,$5",$-1 +fx_scale_dcci2x : skip ${1=1.15},${2=5},${3=0} +foreach { split_opacity scale_dcci2x ${1-3} a c c 0,255 } +fx_scale_dcci2x_preview : +z 25%,25%,75%,75% fx_scale_dcci2x $* +fx_render3d : skip ${14=1} +width={(1+$14)*$1} height={(1+$14)*$2} +n3d c3d m3d {round($13)} f3d={0.5*max($width,$height)/tan($7*pi/360)} +f3d $f3d l3d {$8*$f3d},{$9*$f3d},{$10*$f3d} sl3d $11 ss3d $12 +foreach { +*3d {$3*max($width,$height)} r3d 0,0,1,{-$6} r3d 0,1,0,{-$5} r3d 1,0,0,{-$4} +$width,$height,1,3,-1 +j3d. ..,50%,50% rm.. +to_rgba replace_color 0,0,-1,-1,-1,255,0,0,0,0 +if $14 +r $1,$2,1,100%,2 s c,-3 +. 1e-5 /[0] [1] *[0] 255 a c +fi +} +fx_upscale_smart : +to_rgb upscale_smart $1,$2,1,$3,$4,$5 c 0,255 +fx_upscale_smart_preview : +repeat $! { ++r. $1,$2,1,1,0 +if w<{-2,w}" || "h<{-2,h} +rm. /. 4 +0 t. "Downscaling is\nnot allowed!",5,5,20,1,255 r. ..,..,1,1,0,0,0.5,0.5 +-|[-2,-1] +else +z.. {50-50*{-2,w}/w}%,{50-50*{-2,h}/h}%,{50+50*{-2,w}/w}%,{50+50*{-2,h}/h}% +rm. fx_upscale_smart. $1,$2,$3,$4,$5 c. 0,255 +fi +mv. 0 } +fx_scalenx : +foreach { +split_opacity +if $2==1 rgb2ycbcr[0] round[0] +elif $2==2 rgb2lab8[0] round[0] +fi +if $1==0 scale2x +elif $1==1 scale3x +elif $1==2 scale2x scale2x +elif $1==3 scale3x scale2x +elif $1==4 scale2x scale2x scale2x +elif $1==5 scale3x scale3x +elif $1==6 scale3x scale2x scale2x +elif $1==7 scale2x scale2x scale2x scale2x +elif $1==8 scale3x scale3x scale2x +elif $1==9 scale3x scale3x scale3x +fi +if $2==1 ycbcr2rgb[0] +elif $2==2 lab82rgb[0] +fi +a c +} +fx_scalenx_preview : +z 40%,40%,60%,60% +fx_scalenx $1,$2 +fx_animate_elevation3d : skip "${4=}" +if $3 filename="$4/gmic_elevation3d.png" else filename="" fi +_fx_elevation3d ${5-6},0 +animate fx_render3d,"${7-8},${10-19},$9","${7-8},${20-29},$9",$1,$2,{``$filename} +fx_animate_elevation3d_preview : skip "${4=}" +w={w} h={h} +_fx_elevation3d ${5-6},0 +fx_animate_preview fx_render3d,$w","$h",${10-19},$9",$w","$h",${20-29},$9",0,$w,$h +fx_animate_extrude3d : skip "${4=}" +if $3 filename="$4/gmic_extrude3d.png" else filename="" fi +_fx_extrude3d ${5-7},0 +animate fx_render3d,"${8-9},${11-20},$10","${8-9},${21-30},$10",$1,$2,{``$filename} +fx_animate_extrude3d_preview : skip "${4=}" +w={w} h={h} +_fx_extrude3d ${5-7},0 +fx_animate_preview fx_render3d,$w","$h",${11-20},$10",$w","$h",${21-30},$10",0,$w,$h +fx_animate_imageobject3d : skip "${4=}" +if $3 filename="$4/gmic_imageobject3d.png" else filename="" fi +_fx_imageobject3d "_",$5 +animate fx_render3d,"${6-7},${9-18},$8","${6-7},${19-28},$8",$1,$2,{``$filename} +fx_animate_imageobject3d_preview : skip "${4=}" +w={w} h={h} +_fx_imageobject3d "_preview_",$5 +fx_animate_preview fx_render3d,$w","$h",${9-18},$8",$w","$h",${19-28},$8",0,$w,$h +fx_text_pointcloud3d : +W={w} H={h} M={round(1.5*max(w,h))} rm +text_pointcloud3d "$2","$3",$4 +col3d. ${5-7} *3d. {0.7*$M} +f3d 4000 db3d 0 m3d +repeat $1 { +rprogress {60*$>/$1} +angle={$>*360/$1} ++r3d[0] 1,0,1,$angle +$M,$M,1,3,-1 j3d. ..,50%,50%,0,1 rm.. +} +rm[0] a z autocrop -1 to_rgba s z replace_color 0,0,-1,-1,-1,255,0,0,0,0 +if $11 N=$! foreach { +rprogress {60+40*$>/$N} +i[0] 100%,100%,1,4 fc[0] ${8-11} +channels. 3,3 +negate. b[-2,-1] $14% to_rgba. +j[0] .,$12%,$13%,0,0,1,..,255 rm[-2,-1] blend alpha +} fi +if $W>$H r2dx $W else r2dy $H fi +if $15>1 +i[{int($1/2)}] [{int($1/2)}]x{$15-1} +i[0] [0]x{$15-1} +fi +fx_text_pointcloud3d_preview : +fx_text_pointcloud3d 4,"$2","$3",$4,${5-7},${8-11},${12-14},1 drgba +frame 1,1,0 append_tiles 2,2 +fx_transition3d : +f3d $7 +transition3d $1,$2,$3,"$4","$5","$6",$8 +fx_transition3d_preview : +if $!==1 gui_warning_preview "Missing input layer" return fi +f3d $7 +k[0,1] transition3d 4,$2,$3,"$4","$5","$6",$8 +k[1,2] +r[0] 50%,100%,1,100%,0 +r[1] 50%,100%,1,100%,0,0,1 +a x +line 50%,0,50%,100%,1,0,0,0,255 +fx_animate_pencilbw : skip "${4=}" +if $3 filename="$4/gmic_pencilbw.png" else filename="" fi +animate pencilbw,"${5-6}","${7-8}",$1,$2,{``$filename} +fx_animate_pencilbw_preview : skip "${4=}" +fx_animate_preview pencilbw,"${5-6}","${7-8}" +fx_animate_stencilbw : skip "${4=}" +if $3 filename="$4/gmic_stencilbw.png" else filename="" fi +animate stencilbw,"${5-6}","${7-8}",$1,$2,{``$filename} +fx_animate_stencilbw_preview : skip "${4=}" +fx_animate_preview stencilbw,"${5-6}","${7-8}" +fx_animate_cartoon : skip "${4=}" +if $3 filename="$4/gmic_cartoon.png" else filename="" fi +animate cartoon,"${6-10},$5","${11-15},$5",$1,$2,{``$filename} +fx_animate_cartoon_preview : skip "${4=}" +fx_animate_preview cartoon,"${6-10},$5","${11-15},$5" +fx_animate_edges : skip "${4=}" +if $3 filename="$4/gmic_edges.png" else filename="" fi +animate fx_edges,"${6-7},$5","${8-9},$5",$1,$2,{``$filename} +fx_animate_edges_preview : skip "${4=}" +fx_animate_preview fx_edges,"${6-7},$5","${8-9},$5" +fx_fire_edges : +fire_edges ${1-7} rv +fx_fire_edges_preview : +gui_split_preview "fire_edges $1,$2,$3,$4,1,$6,0",${-3--1} +fx_lavalampbw : +if !$! (255;100^64;16^128;0) r. 512,512,1,3,3 fi +foreach { +remove_opacity +w={w} h={h} ++r $4%,$4%,1,1,0 [-1]x{$1-1} rand[^0] 0,1 stencil[^0] $5,0 +if $3 [1] fi +morph[^0] $2,$6,0 +stencil[^0] $5,0 +r[^0] $w,$h,1,1,3 b[^0] 10 >=[^0] 50% *[^0] 255 +r[^0] 100%,100%,1,4 j[^0] [0] rm[0] +if $3 rm. fi +} +if !$7 foreach { split_opacity n. 0,1 *[^-1] . rm. } fi +fx_lavalampbw_preview : +fx_lavalampbw 2,2,1,$4,$5,$6,$7 k[0] +fx_animate_lissajous : skip "${4=}" +if $3 filename="$4/gmic_lissajous.png" else filename="" fi +animate fx_lissajous,"${5-22}","${23-40}",$1,$2,{``$filename} +fx_animate_lissajous_preview : skip "${4=}" +fx_animate_preview fx_lissajous,"${5-22}","${23-40}",0 +fx_moire : +if 0$_is_preview" && "!narg($_preview_area_width) _preview_area_width,_preview_area_height=512 fi +if $2 repeat $! { if $>" && "{$<,s==2||s==4} blend[$<] [{$<+1}],alpha,1,1 fi } fi +if $4 +skip={" +l<=6?1:( +const l5 = int(l/5); +const l4 = int(l/4); +const l6 = int(l/6); +5*l5==l?l5: +6*l6==l?l6: +4*l4==l?l4:( +const r6 = abs(6*l6 - l); +const r5 = abs(5*l5 - l); +const r4 = abs(4*l4 - l); +r5<=r4 && r5<=r6?l5: +r6<=r4 && r6<=r5?l6: +l4 +) +)"} +k[0--1:$skip] +if $!>6 rm[6--1] fi +fi +N=$! +foreach { if s==2||s==4 drgba 255 fi } +if 0$_is_preview +W,H=$_preview_area_width,$_preview_area_height +if $3 +if $W>$H W={$H/sqrt(2)} else H={$W*sqrt(2)} fi +fW,fH=$W,$H +W,H/={arg($3,4,3,2,1)} +fi +elif $3 +W,H,fW,fH={"$3==1?[620,877]:$3==2?[827,1169]:$3==3?[1240,1754]:[2480,3508]"},2480,3508 +W,H,fW,fH={round([$W,$H,$fW,$fH]*0.95)} +else +W,H=${-max_wh} +fi +if $3" && "$5 +W,H=$H,$W fW,fH=$fH,$fW +fi +if !narg($fW) fW,fH=$W,$H fi +foreach { +if [w,h]!=[$W,$H] +- 255 +rr2d {(100-$6)%*[$W,$H]},2,2 +r $W,$H,1,100%,0,0,0.5,0.5 ++ 255 +fi +} +if $1 +100%,100%,1,100%,"i(#x%"$N",x,y,z,c)" rm[^-1] +100%,100%,1,1,"x%"$N"?0:255" +else +100%,100%,1,100%,"i(#y%"$N",x,y,z,c)" rm[^-1] +100%,100%,1,1,"y%"$N"?0:255" +fi +if $3 +ir={round(max($fW/$W,$fH/$H))*100} +r $ir%,$ir%,1,100%,1 +r $fW,$fH,1,100%,0,1,0.5,0.5 +fi +if $7" && "$8 +ax,ay={a=$7-1;[a%2?0.95:0.05,int(a/2)?0.95:0.05]} +0 t. "#"$N,0,0,{0,h*$8%},1,255 autocrop. frame. 5%,15%,0 negate. to_rgb. j[^-1] .,$ax~,$ay~ rm. +fi +=> "name(Merged Frames),pos(0,0),opacity(100),mode(alpha)","name(Mask),pos(0,0),opacity(100),mode(alpha)" +u $N +fx_moire_preview : +_is_preview=1 +fx_moire $* +fx_tk_animateobject : +if $!<=1 return fi +if $15==0 +to_rgb if $9==0 +r {w*{$6/max(w,h)}},{h*{$6/max(w,h)}},1,{s},6 c 0,255 +if $14==0 +[-1,-2] [0] rv[0,1] +blur_xy[0] $11 ir[0] $13,256 n[0] 0,255 +tk_fx_replace_color[0] 1,0,0,0,0,255,0,0,0,0 +blur_xy[0] $12 inpaint[1] [0] +rm[0] rv[-1,-2] +else [0] rv[0,1] rv[-1,-2] +[0] [0] +... . +to_gray[-1,-2] ir[-1,-2] 128,256 n[-1,-2] 0,255 +s[1] c a[1,2,3,-1] c +s[2] c a[2,3,4,-1] c +rv[1,-1] compose_rgba[1,-1] +rv[2,-1] compose_rgba[2,-1] +to_rgb[1,2] +fi +dx={$1/$7} dy={$2/$7} dz=1 repeat $7 +shift[-1,-2] $dx%,$dy% +if $3>=0 dz={$dz+{{$3}/$7}} +else dz={$dz-{{{1-{10.01+$3}/10}}/$7}} fi ++fx_zoom[-1,-2] $dz,$4,$5,0 +to_gray. ir. 128,256 n. 0,255 to_rgb.. +s.. c a[-4,-3,-2,-1] c +if $10!=0 unsharp. {$10/5},{$10/2},0 cut. 0,255 fi +mv. -3 done rm[-1,-2] rv rv[-1,-2] +index={-3} repeat $7 +.. rv[-1,-2] index={$index-1} +rv[-3,$index] compose_rgba[-3,$index] +done rm.. if $8==1 rv fi +else +if $14==0 frames={$!-1} counter={-5} +[-1,-2] ++blur_xy. $11 ir. $13,256 n. 0,255 +tk_fx_replace_color. 1,0,0,0,0,255,0,0,0,0 +blur_xy. $12 +repeat $frames inpaint[$counter] . +counter={$counter-1} done rm[-1,-4] +[-1,-2] +else frames={$!-2} +to_gray. +s... c a[-5,-4,-3,-1] c ++to_gray. +fc. 0,0,0 +rv[-1,-4] compose_rgba[-1,-4] mv. -3 +fi +counter={-6} dx=0 dy=0 dz=1 repeat $frames +[-1,-2] +shift[-1,-2] $dx%,$dy% +if $3>=0 dz={$dz+{{$3}/$frames}} +else dz={$dz-{{{1-{10.01+$3}/10}}/$frames}} fi ++fx_zoom[-1,-2] $dz,$4,$5,0 +to_gray. ir. 128,256 n. 0,255 to_rgb.. +s.. c a[-4,-3,-2,-1] c +if $10!=0 unsharp. {$10/5},{$10/2},0 cut. 0,255 fi +mv. $counter +compose_rgba[$counter,{$counter-1}] +dx={$dx+{$1/$frames}} dy={$dy+{$2/$frames}} +counter={$counter-1} +rm[-1,-2] +done rm[-1,-2,-3,0] +fi +else +to_rgb if $9==0 +r {w*{$6/max(w,h)}},{h*{$6/max(w,h)}},1,{s},6 c 0,255 fi +dx=0 dy=0 dz=1 if $9==0 counter=$7 else counter={$!-1} fi +index={-2} repeat $counter +if $9==0 . mv. $index fi +dx={$dx+{$1/$7}} dy={$dy+{$2/$7}} +shift[$index] $dx%,$dy% +if $3>=0 dz={$dz+{{$3}/$7}} +else dz={$dz-{{{1-{10.01+$3}/10}}/$7}} fi +fx_zoom[$index] $16,$4,$5,0 +fx_zoom[$index] $dz,$4,$5,0 +if $10!=0 unsharp[$index] {$10/5},{$10/2},0 cut[$index] 0,255 fi +index={$index-1} done +if $16!=1 rm. fi fi +fx_tk_animateobject_preview: +if $15==0 start_x={{xM/w}*100} start_y={{yM/h}*100} else start_x=50 start_y=50 fi +fx_tk_animateobject ${1-6},1,${8--1} k[0] +line[0] {$1+$start_x}%,{$2+$start_y-10}%,{$1+$start_x}%,{$2+$start_y+10}%,1,255,0,0 +line[0] {$1+$start_x-10}%,{$2+$start_y}%,{$1+$start_x+10}%,{$2+$start_y}%,1,255,0,0 +line[0] {$4*100}%,0%,{$4*100}%,{{$5*100}-5}%,1,255,255,0 +line[0] {$4*100}%,{{$5*100}+5}%,{$4*100}%,100%,1,255,255,0 +line[0] 0%,{$5*100}%,{{$4*100}-5}%,{$5*100}%,1,255,255,0 +line[0] {{$4*100}+5}%,{$5*100}%,100%,{$5*100}%,1,255,255,0 +fx_animate_rodilius : skip "${4=}" +if $3 filename="$4/gmic_rodilius.png" else filename="" fi +animate rodilius,"${6-10},$5","${11-15},$5",$1,$2,{``$filename} +fx_animate_rodilius_preview : skip "${4=}" +fx_animate_preview rodilius,"${6-10},$5","${11-15},$5" +fx_animate_glow : skip "${4=}" +if $3 filename="$4/gmic_glow.png" else filename="" fi +animate glow,"$5","$6",$1,$2,{``$filename} +fx_animate_glow_preview : skip "${4=}" +fx_animate_preview glow,"$5","$6" +fx_spatial_transition : +to_rgba r ${-max_wh},1,100%,0,0,0.5,0.5 +shape=-1 formula= +if $3==0 +elif $3==1 shape=0 +elif $3==2 formula="$4" +elif $3==3 formula="sin(x*0.5*pi/w*(1+100*A))" +elif $3==4 formula="sin(y*0.5*pi/h*(1+100*A))" +elif $3==5 formula="atan2(y-h/2,x-w/2)%((1-A)*2*pi+0.001)" +elif $3==6 formula="R=0.5*sqrt(w*w+h*h);sqrt((y-h/2)^2+(x-w/2)^2)%(0.001+R*(1-A))" +elif $3==7 100%,100% plasma. 1,1,{8/(1+$5)} equalize. 1024 +fi +if narg($formula) +{w},{h},1,1,"A=$5;"$formula fi +if $-1 +if $6==0 k[$shape] norm n 0,255 +elif $6==1" && "$7==0 rm[$shape] rm. +elif $6==1" && "$7==1 rm[$shape] rm[0] +elif $6==1 +transition[^$shape] [$shape],$1,$2,$7*($1-1) rm[$shape] rm[0--1:2] +else +transition[^$shape] [$shape],{$6*2},$2 rm[$shape] to_rgba +fi +if $!>1 to_rgba frame 2%,2%,0,0,0,0 append_tiles , fi +else +transition[^$shape] [$shape],$1,$2 +rm. +fi +=>[^] "name(transition),pos(0,0)" +if narg($formula) u "{$1}{$2}{$3}{"$formula"}_"{$3==2?2:1}"{$5}{$6}{$7}{0}" fi +fx_spatial_transition_preview : +if ($3<=1" && "$!<3)" || "($3>1" && "$!<2) +gui_print_preview "Warning:",,"This filter requires more input layers to work properly." +return +fi +fx_spatial_transition ${1-3},"$4",${5-7},1 +mc_dragonfly : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_dragonfly {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Dragonfly" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_dragonfly_preview : +mc_dragonfly $* blend[^0] [0],alpha rm[0] +#@cli shape_kookaburra : _size>=0 +#@cli : Input a 2d kookaburra binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_kookaburra , +shape_kookaburra : check "${1=512}>=0" +e[^-1] "Input a $1x$1 kookaburra binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgOTU5IDEgMSAjMTEwNwp4nI2VeWyVRRTFz3TfH6Eo7qLFSDSKgFBKSyGARSgICCggdYni0gaDiSHRhESjiYZocMEqFCioiNWispQlRNPUQsUCLbZQS21tKd33je7net+88nwvmugfv5z55r2Z755778wHH/gYGEDpTXVgHO/DJE7BNEZjOVdgHQ36JAnJTMEGvoKN3IjX+Do2cRPe4Jt4i2/jHb6LzdyM9/g+tnALPuCH+Jhb8QlT8Rm3YTu3I82Shh3cgZ2WnZZdll1IZzp2cw/2KJ/zC3zJvdirfMV92MevkcEM5Rt8y0xkcj/28zt8zwM4wIM4xEPKYRweIYtZyhEcsRzFMR5TjuMET+BH/oRsZiOHOcjlSeQxD6d5GvnMxzkW4jcW4QIv4neWooxlqGAFKlmJy7yMGtaino1oZiva2YFu9qCXfRjgIEgCYoyv+Bp/8TeBEmRCJMSESbhxiMOMktEmUpZgQLJxvSSiS/UGSUCz1XjUSA4i5X6UqYbLTTgnP2uMuTbGXJ7CKY0zT+P8VePM51mNtQAFPG/jLeIFG3OJxlzKSxp3Oco17gqNu5JVGns1qllj469lvXpoQAOb0MRm9dKCFrahje3WUwe70MVu662HvdZfH/st/epzkEMY4jCG1S8pFqExRnyMj3r3FT/jp/79JdAEKM48BEmwCdZchEioCZUwmxMn4RKheI4jTIRbHR5j77n/r97rw+17wkfeH+bW0JG4nOqKMdTWLtgS7NYg9eLy41SnvwD1GTCi/urbz9bfx+bCR3NiDARGbJ6oORvW3A1ZBjWXAxzQnDpz26d57sVVzXm35r5La9DJTkuH1qTd0q41akOrrZVLW7UPWywtto7NWs8mS5NbGy2NWu8GW/d6rX+dpU57oW5Ea21v1GiPXLFcsVRbqm3/VGkflWtflfEPey4uaZ85z0gJS3BRe69Ye7CYxdqLRTivfVloKdQeLcBZ7dczPKN968CwHNfzFoZ+OaoagquShV8YrOfhoPZ3INrlB5ykH5okU/veF/WSYe+CdO7WeyLd4rw30vQOcd4n2/gqKOPxKTdgUKKQypd17ztV16NX7tD59eiRcaop6JTb9T5K0XfcppqMVrlV1yfrGbxF9SU0ys16V72IOrlRn1/QMzlW//c8quU61XWokjG6z3P4U0br/s+iXBzYymdQKmFWSyQYH/FpPMUnkcQkrOVaPME1WKOs5mqs4io8zsewkiuxQu/W5XwUy7gMS7kUS/gIFnMxFnEREpmIhVyIBVygPIz5nI8EJuAhZR7nYS7nYo5lDmZzNmZZZiGe8ZipuHSme+w97/otjnGIVVwaa8feGosZbp2BGMWlMXbs0hhMd+v0/xx7rru2n+feLmK9xrHuZ++x99y/6z89xXn87unfqa6c/K3X1nh6jUa0Mo1TMdXyIKbot9LJZE62TOIDmMiJuJf3YAIn4G7ehfGMQhTHQiRIv69jEMlRiGAossr/As3XmqgxIDI2IDEgMSAjNTMKeJxzZ/BliGJgYIhmMGJIYVBgyGbIB8JshkSGJIZShiIgTASKFjNkAOkChlSGWKBaAORKCL8=" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d kookaburra shape]" v + +mc_kookaburra : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_kookaburra {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Kookaburra" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_kookaburra_preview : +mc_kookaburra $* blend[^0] [0],alpha rm[0] +#@cli shape_rooster : _size>=0 +#@cli : Input a 2d rooster binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_rooster , +shape_rooster : check "${1=512}>=0" +e[^-1] "Input a $1x$1 rooster binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgMTkyOSAxIDEgIzIzODEKeJyFl3l0lsUZxe9k+bInJAJhlUWBIJvSqGjV4gYiaEUxIKvIYgC1Lsj2IftioaKIIjsIiKAUq2VRrFBbq4IisgkIBBISEpZEZAsEmOud+T4CnJ6e/jHn99yZeWeemXlmeRGBCAMDKLU7Y1BMg0o2AiWMQOVyRuIXRiK9nFE4zihUKWc0fhXTxROM9jrEAE4xgCZqp5iX7Ci1EYPTSmXqK9N/e0lH4GYbg5OMxRmvI8M65godq3ZiUep1lHScymJxVsnpTOlSxuFcuY5X2WXd2o8pXjoe55Xv8i7Ij3bejwTpBOk4lQVwUf600xhOMlE6QdqVXcp3fiTKTgI9Y3x+W+9Pw3L9oPovZQas+r8o/9vaBPnTXDpKZYnqr7m+j0Ybm6Ty28Q2eMA+4FNr29qnVvZBfK72ptu2+A8rYY5tJ9bCStsZ/2YdrLVd8U/xX7Yn1rEuvrF9sJ7XY6O4jvXwvfgF62Oz7Yt/sAG2eGZgm31a7TbETzYba8Wd4me8AbvFT8WfbT+xEfbZ/lgj5oir2RgH7ADPPPsMVooHrZvDXvg7m2CvfQqfsKm+cWyG/eLHYq7thb+J+fLlI7FQfa8QD6uvv/JGFKvt5eIvans5b8Kvanu55uaUfc7ztPghf4ez9nkxE2X2Bc8L9iWV3wIrfshbAQ6UbgHDl9Xu7YgUV/BOBDhY/bdErPgJ70MCh2IVWyOJQY2lD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7/Rk70+rO+yFbcHZBfJ7id7v/fF2dW97fy4ZDsf+oftfKWQHev7GhC282Q/q/29X3Pi2n1e+8TZ7psX7HUqj9Z+i8NA7dcCrcEeffOybSJfIvGz7EE6h9z/207N2WDbQmOPCNsBjethjSFG/bbX2B0f09zFyD/HgNhBc+T4kOoFNLY7/L+OW99s7bcicbP6ydbeWqF2n1asL/esoDeIY4reHBGa8yS9N4zWIlFvHscEJCjF6xyKK0+xiNG9ESPGhlNIh1LgCjukA1flhXTgv+r9r3SpfpT+UyL1/xdxRbqs9Res1PL0b3UXFlsxIDE1IDEgMSAjMzMKeJxzZ/BliGJgYChhyAdjPYZkhkyGXIZ0hiqgKABOuAT9" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d rooster shape]" v + +mc_paw : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_paw {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Paw" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_paw_preview : +mc_paw $* blend[^0] [0],alpha rm[0] +#@cli shape_mapleleaf : _size>=0 +#@cli : Input a 2d maple_leaf binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_mapleleaf , +shape_mapleleaf : check "${1=512}>=0" +e[^-1] "Input a $1x$1 maple leaf binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgMTczNyAxIDEgIzE4ODkKeJyVl3lwldUZh383yb1JCIssCdBCKiVEQRGwWgLD4gaYUIpCkipLKyFkIQGxLe3UWurCUhEFREXEaWVsKzJBnWmt49qqrZVKHUQsLbYqRRBZpEDYcnPP2+eceyUk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x1upW+o1rpavUv9P2uRv/Er8K/j3+A+A6er3ITSH1P7h7/rIS89eBOimmFG0POunOHRbXMjSZXeYw5qiV8l8e5s0/wfbGNcj9gHRv59ng3cB9y1JX7MAr3JhdduS+jms83936+Yd6mzHzXlXuhkzbD8/gP2MV30CbKlMB/Cj7G3ej/GZIW5Zs76lp0MtZa+/+LtjrznLGkbom16GSstU7+v2R9QbfEWnQy1lr7f5+2OvucsaRuif1vnd2mbiZz6rfrv+okDzMxIDE1IDEgMSAjMzMKeJxzZ/BliGJgYChhyAdjPYZkhkyGXIZ0hiqgKABOuAT9" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d maple leaf shape]" v + +mc_rooster : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_rooster {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Rooster" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_rooster_preview : +mc_rooster $* blend[^0] [0],alpha rm[0] +#@cli shape_paw : _size>=0 +#@cli : Input a 2d paw binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_paw , +shape_paw : check "${1=512}>=0" +e[^-1] "Input a $1x$1 paw binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgMjAyNyAxIDEgIzIzNTcKeJyNl3d8V0UWxU8SCKQRFNBFEFFxQaXIhiQ0IbFQlC6gIl1IAkiRdXEtuytiYV1dWURUWBZEioiU0MsCClIMBBJaooAgnYCVppS5ft/7PX6CZssf8zlnkt97b+6Ze8/cUaQiIxQhMRqfjVSUK6GSLlqlXGnFuBh/xLpYRpziXbw/ElyCxliUngXftJ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4afdriDX3Q+Fl4KzwjxDdRU6NZx0b7M7wZfhPiOezla6xpoz3H8030N58P570N9DLr22TPs6Z6GkHu5toLrLWOngv4aquhZ8jxXHsJvapqGOv2+GL/DOrK90dSd13420iVJ47N9gr4UIAPgq+CncHXwI7g36nbB8DXwfbgKF1NTW+x0dR3a+ajVZaYttgY8D7mY/CBFuBYfOFevvMWeA/zt/GNdObvgE3BcYrFNzfZePylPvFNUGnOmhwwmrMoxybiT7WI/11F4bHrbTL+dTOxvkdvdz1xTqEnLMeZM407wnTuBzO4G8zUTPehZrnZ3AvmcCfIVrabp/luAfeARVrkFmuJW8odYBn9/wqtdKvo9z+i119Nn7+GHn8t/f16rXcb6Otz6OU3aZPL1Wa3hf49n959K337du1wO+nTC+jRP6M/30Vvvpt+fI++cHvpw/fRg++n7z5Iz31Qh9xheu0j9NlH6bGL6K+P01OfYHxFL/0N/fO3jO/om79nnKRPPsU4TX98Fp8/qx/cD/j8OWI9h89fwOMv4O8ODRz+bgxFRFiEPyItkhEVUcJK+KOklWRER5SyUuFR2kr7I8ZiwiPWYn814izuv4xf/z6W91x6d2hc+mZ0sA5vlIiIYn1R/jojWTMXaH8Y8VwkrovEd544zxHzD8R/Bh1Oo8dJtPmOO8a33Du+5i5ygvtJEXoeQdtD6LwfzYdy1rZmD7riDWnsSxvOqCT2qTk1+Vv2Lo0+4Br2tJEacGesx32yNnfOGq6abnAVtfLMTxH5r/cxIDE1IDEgMSAjMzMKeJxzZ/BliGJgYChhyAdjPYZkhkyGXIZ0hiqgKABOuAT9" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d paw shape]" v + +mc_flip : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_flip {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Flip" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_flip_preview : +mc_flip $* blend[^0] [0],alpha rm[0] +mc_information : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_information {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Information" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_information_preview : +mc_information $* blend[^0] [0],alpha rm[0] +#@cli shape_flip : _size>=0 +#@cli : Input a 2d flip binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_flip , +shape_flip : check "${1=512}>=0" +e[^-1] "Input a $1x$1 flip binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgMTM3NSAxIDEgIzE3NzgKeJxdlnl0VdUVxr8bKWEqMgoOCIQkICQMFnPfe8l7CSGkSlAxGMQAUWODVFLKAkqRwYYGWUKtVsWpdaFVsOhCRERFREWlCghI0VIZa0WpUgeotra2nt3fOSqL+sdZv+z7Xu67dw/f/pSlrEiRxOm8Ik8DXUKlrlJVbrRqXK3qXL2ucVM01U3XT9x1mu+a1OwWabG7Sbe427TU3al73L1a5u7Xg+4hrXSPaJVbrTVurda5p7TebdBG97w2uZe02b2iLW6btrudet3t0m73pva4t7TP7dcBd0hvu3d02L2rI+59feCO6kP3sT5xx/R396k+c//U5+5f+sL9V186J3OKsuyUqIW1jLKtVdTa2kRtrV3U3jpEHa1T1Nm6RF3ttKibdY9Ot8X6ty3RmTZPB22+zrafaqfNUi+boc02XTn2Y22wqcq1Rq21Kcq3a7WKc45do+WcAdagZfYDFdjVutvqVWhXaSmn0CbqZrs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TdDHZeQ5QV9n6O8kcZp+TxKX0P9+HlLMQzLMw32BMfOSZG7OY348hwbucucyX0nmbDDzliIexPz5uJB5TMGCwJ2uv+6EO1w/5tfHfZlnH+cx38Uwl3lPMfc5zH8KXeiFHhQT90QffNwDvSiGZwVuc2egJ57d0RfPbuhNCeyK/hSjQ11gCeyEPpWgXx3QKx+fin6lYXv0zF9vh76lYRv0Lo3utUL/fJyNHvq4Jfro2QK9zMAsXWdeRzPf0tbSk3T3//W47Ft6PexrHS8/ofHDT/r7K/2voG7+jKCO/vRDs3uiL/3R7F7slAI023MgWu05hB3Tmx00lJ3jWYRGeybYSTnoUIod5VmCNuegR2Voch92XTma7FmBJntWsvP6oFMj2YG56NQodmIuO3O05QdWo72eNTaAfXUJe7YQVrN3BwfWobV56Fg9GpvHjm6gNz0nU8N89KyRXOaz06ehpfno2kwbDi9nJ/m9WEvOL4DjqckoOAGfcDGso9Zj4BX4iLHQ+4pa9qr3GROh9x1XQe9DGqD3JT/ke96nNPL7X/mW3uiY9zE90S3va3rgcQ5xzrRf6D/4ntPxQN3wQl3xRJ3xRh3xSO3xSm3xTK3xTtl4qBaWFUWmyPBWX+KxvsBrfY7n+gfe6zge7BO82Id4sg/wZkfwaIfxam/j2Q7i3fbi4fbg5Xbj6V7H223H423B623G823C+23EA67HC67DE67BG67CI650K/QAnnEZ3vEePORSd6tuxlMuRh+b0cB5eM1ZaNhU9GkS2lOHrtSgFVX0TobZHchcdVrxPzrt8oExIDE1IDEgMSAjMzMKeJxzZ/BliGJgYChhyAdjPYZkhkyGXIZ0hiqgKABOuAT9" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d flip shape]" v + +mc_mail : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_mail {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Mail" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_mail_preview : +mc_mail $* blend[^0] [0],alpha rm[0] +#@cli shape_information : _size>=0 +#@cli : Input a 2d information binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_information , +shape_information : check "${1=512}>=0" +e[^-1] "Input a $1x$1 information binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgMTYzOSAxIDEgIzE5MDMKeJxtl3lY1lUWx7+3yXEac0pnbDInH80Ze5pqZlrGabWy0txTJEIy19xN0ywXXFhcEcEFFRAVF0RUEFGUANnk5VVEQVFDRQXXtGemnGrKns6Z7+++P5DMP87zOef78v7ee8/v3HMPuAt3GRiA9usrjdBUWqClPIw20g7t5TE8Lk/iH/I0npUOeE5ewIvyMl6R1/C6vInO0gVdpTt6SE/0lj7oK37wlwC8K4HoL0EYIAMxSAZjiAzFMBmOETISo2UMxso4fCjjMUEmYpJ8jMnyCT6VKZgq0zBdgjFDZmKWzEaIhCJMwjFH5mKezMcCWYgIWYRIWYwoicYSWYqlsgzLJQYrZCVWSSziJB6rJQFrZC3WyjokSiLWywZslE1Iks3YLMnYIinYKtuwXVKRJmm0HUiXnciQXdgtmciUPdgre5ElnyFbcpAjudgneciXfBRIIQqlCPulGB7x0ErglQM4KKU4JGUoox2WIyiXClTIURyTY6iU4zguJ3BSPkeVVNFO4bScQbVU087inJxHjdTQanFBLuKiXMJluYwrchVX5Qtck3m4of64zlxcVz98KSG4pH3wb+aoRnuTs3BWe+Er5u2U9sQNmYGT2oMMxnHyG/Kodse3Mh3l2g3fkYfJ78lD5A/Meyl5kzxA/ihTUUL+xNijXSFkMWMl95NGp6GQutGpKGD8K8b5jO8m8xg3suyOxjod+xg3ZpzL+B7GuVzPb8kcxk3IbMb3umyqwWRP3Kcz8Bl5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XMX4TlxJXq1nttUdOvEXd+AKnl8fi/VaA8ZQ/yVzyKI7cjl53WV7KGva57fDj6zzHPa5Qm2Lm1Z3/Da8L+r81viefjb7a4E+jP/V+63wHc+Az38I39b7Lel76C9hb/wjvuF58PkP0Pdy79H0W7Dv1/m/52xzgH4Ue2pz62dZvxn9g65/P/1S5n0x/fvwtfUj2ZOb4iueF59/L/0y129i/UzeKbl6D/3Drt+Y9+ER6+doI/rlrJUI9vwKy2QyQxdiC8+IwxSekZ2867eS6eQ2no0dvFu280w4TCVTOSOk8WxsJ9N5FhzuJLdyhtjF2k/hHbSb3MJ4D2s+mfFeMon3cZae5j0UzrWcYS8I4/qq2RvCuMdq9pAw5rKaPSaU7+kce1CorfF40suajtUQzmo17G0hnB1q2ftCONPVsjeGcGa4wN4ZgmNkFO++E6zZSManWKsRZDVrdT5Zw5qcy+ddYg2G8/eusVZCuL6v9UveLTNNsE43U3WK+VQnm0k60UzQ8WacjjGjdKQZrsPMUB1iBvEeD+IdH8B730/7ciboZbpzbujCWaITZ4yO+pJ5XjuYZ/Qp8zd9wvxVHzXttK1pra3Mg9rCNNPfmSb6G3O3GvOT3ORseoPz7DXOvxdwlrNypZSjlHN2vmRzLk9HimxEAmf9KM7EM/l/w1gZgn78P+QJaY6WV/4PhbIE3DEgMTUgMSAxICMzMwp4nHNn8GWIYmBgKGHIB2M9hmSGTIZchnSGKqAoAE64BP0=" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d information shape]" v + +mc_phone : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_phone {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Phone" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_phone_preview : +mc_phone $* blend[^0] [0],alpha rm[0] +#@cli shape_shopping_cart : _size>=0 +#@cli : Input a 2d shopping_cart binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_shopping_cart , +shape_shopping_cart : check "${1=512}>=0" +e[^-1] "Input a $1x$1 shopping_cart binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgMTM0NSAxIDEgIzEzNDIKeJytlWlQlXUUxp9jWippabmmuEI5jjlFkFcREC/34kbCVYlAQYGATAkHF1RwQZFFzS1TUzNX3PdtmpxmaiZrpj6UzdQH/aRT5mRZpq3/03Pf+/JyL5Cf+vDM7z3/dz/nOeePVmglEICadj0Ro00qUo0PPmqSzQcd+0xa0PF/XZcWcn2aEz/4OM3E4p62w0QzDMNMDGJMtKVoWzH2WmPc8rnm1zU9F4M8zZW9ulcu6AXqvJy3dU7PUWflrKMzciZEp+W0o1NyKkQn5aStE3qCOi7HHR2TYyE6KkcdHZEjQTqsh+SQo4NyMET1Uh+iA3LA1n7dJ/sceXBD3RYvajf+qwdr9Bb8zNFLFl/Q9dhDttNXLX5n3KQXN02STTd2kz8wfo/nG+nGLvIW4+b04kfy3SDeNp4mTMJO8ifGDdzB+38mtzv04o7NX4zXpgfvkL8yDqUH28i7jBuZjHsm2aYXW7jewPtcD9CLt8nfGQfzDzPGZjI28/4/bf7F9WD+TW7idQ38x4y1OQYbeV4ZBxM6zuZYbAiicD3AsVhPtmK8jnzIZmsdb3Mc3iTbMG6JD5Nr+Yy2FifhCZ1AZuEpxmtY40jGq3U2hlpcAJfF5XCTdVqHCRY3I0NTyF3IZVyrh1HMuFbPoszih1hh8TO+MwXVeoU59vMaPeXnTZwgV+ldvG9R8Ym+RLaXLy12katcr9I+8j3jKh0sdy1WSZWulBW6wlalVIZouSx3tEyW6tIgLZEljiqkXMtlvs6XEi2Rmfqa5Gu+ZGu2ZGiG+DRNxut48ahHEjReXOqS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.2% fi >=. 40% +fi +nm "[2d shopping_cart shape]" v + +mc_shopping_cart : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_shopping_cart {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Shopping Cart" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_shopping_cart_preview : +mc_shopping_cart $* blend[^0] [0],alpha rm[0] +#@cli shape_mail : _size>=0 +#@cli : Input a 2d mail binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_mail , +shape_mail : check "${1=512}>=0" +e[^-1] "Input a $1x$1 mail binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBpbnQgbGl0dGxlX2VuZGlhbgoxIDE5MzkgMSAxICMyMDIyCnic7ZlpjBVVGoaPxBA1REfHuiHqOC5xQhwNcYkaxyUagriM24i7McZoXGJc47jNqLgjgigCgmyyL80utIA2IrIJooOACAjYgi2INKuIWHe+d85T3Sffvf/0j8n8IC/f+1Sdc6rqVp33nA4tQgj2b58Q/wV0xynlcoP9p6H86/Wf1l5LVPUjpvuhqh81PQBV/ZhpK1T146YHmT5BLT3Y9F/U/zY9FFX9pGkJVf2UaWtU9dOmh5t2opb+yfQZaumfTZ+llh5t+hy19FjT56mlx5m+QC1tY/oStfSvpp2ppSeavkwtbWvahVp6kukr1FJ7HOWu1NLTTF+l7mZ6hml3avlnmr5GLf8s09eppeea9qCWnm/ak/oN03amvajltzftTS2/g+mb1PIvMu1DLf8S077U8i8z7Uct/wrT/tTyrzIdQC3/atOB1PKvNR1ELf8G08HU8m8yHUL9tunNpkOpddwtpsOoddytpsOpddxtpiOoddwdpqOo5d9tOpp6pOk9pmOoddy9pjXUOu5+07HUOu4h0/HU7Uy3md5g+r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RzEgMTUgMSAxICMzOAp4nHNnYGDwBeIoBggoAeJ8JFoPiJOBOBOIc4E4HYiroGoBnXAE/Q==" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d mail shape]" v + +mc_barbed_wire : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_barbedwire {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Barbed Wire" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_barbed_wire_preview : +mc_barbed_wire $* blend[^0] [0],alpha rm[0] +#@cli shape_crosshair : _size>=0 +#@cli : Input a 2d crosshair binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_crosshair , +shape_crosshair : check "${1=512}>=0" +e[^-1] "Input a $1x$1 crosshair binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgMjg5OSAxIDEgIzIyNDMKeJyVmGt0VcUZhj/2hJBAAiQhHBVBFCwolirWglisl4p4AS14oSAEBOQiJCigEQxIFEQuVoF6ARFEUUQF1CjFe0ELCFakSGmlbWxptaVClz9cq13tnj4z+8yZySGB+ONd37MnJ8k5++yZ73tfiSRqIk1EUMGhE6RzfLb0ii+Sy+P+MjAeLMPiUvmXTskRXSpj42L5Ev5CF0lF3Eo+h2t1K6mMW8oB+DNdKDPjFrIP3qcLZC68B/5EN5eFcXP5NfwRvCTOlw/hD+HH4W3wr3S+rIzzZCu8RefJGvg9+F3dTJ6Pm8nb8FvwBvgNeDNcE+fKJvh1nSubWX8NrmH9HdZfgV9mfUvcVDbAG+BtrL8Ev6ibyk7W18HrWN8Nr4XXwnvhZ+E1vGY//Az8NHwAXg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7L5LsxOQoLlPpo13Wouzz6jKYntpnM+dpn9mYveSynHN0kvHcYfeu+c6S7MfseZcJmfPCZEXT7XmTk8mQzHnnsiVzbrrMqb32WZTpByajmm37TE4muzJ91GVaJUHW1Ur7DKwQuWzM5GQL0plZrk6yNPO8q0zGZvI2xT5Jsrf/BZncv4Os7psgw/s6yPaOBJnfIdaXa5MFmlwwR1boJCM8CK/USXZYCz+lk0zxQJA17g8yyL3pbPI5eHeQWe7KZJm5sh02Ged6XrM1bpbJPk0OWgO/Cr/BustKa4IMdSP8lk6y1XWZzDXJX10WuyrOp98kGe2yuLnNbnfAJsf9SCeZ7qJM1tvC5r4mA/4UnhUX4vVS9P9CmxPX6iQznhwXMW+lmKGKZFxcKkfgw5xZZfEQuS4eIP3iS6R33EO6xO2k8Mj/Ae4IPV8xIDE1IDEgMSAjMzMKeJxzZ/BliGJgYChhyAdjPYZkhkyGXIZ0hiqgKABOuAT9" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d crosshair shape]" v + +mc_crosshair : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_crosshair {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Crosshair" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_crosshair_preview : +mc_crosshair $* blend[^0] [0],alpha rm[0] +#@cli shape_phone : _size>=0 +#@cli : Input a 2d phone binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_phone , +shape_phone : check "${1=512}>=0" +e[^-1] "Input a $1x$1 phone binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgMTU2OSAxIDEgIzEzMz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7nfHyCWs6wPuOPIg9mEn1vsh7EvjYTdZurAHjmHfdoLHsZ+7sDdOYp8bz2Dfd2G/nHdzyHY3D1wknThXjL/g3OnSJfIrzi3jbzjfunSp/E42yR/kMvmTXCF/kWvkb3KD/EO28vzrBO187NSW/+ktPIeN1n9Jt1yXG6/tHrkY9Iu6OaJ3gJG8Qzf1cWO7buR9wt0YyX/W5gjuwfdupl/APEby86D5eV0f0c+B5ud0XdDX8T5G6z+ra+lG85/w3SK50fyMrqYbzU/rKo57OsxPgeandCX9JGh+EuvD/ARofkKX93Hjj1hPTpDmx/VJutH8B6w7J0jz77EenSDNj+kTHPcoaH4U69b8CGh+RBfTD4Pmh7HOzb8DLZ+/RaaYH2LeeOQb5k+JfM1cKpGDzKkS+Yq5VSxfMseK5QBzrUi+YO4VyX7mYKF8zlwslM+YkwWyj7lZIJ8yV/NlL/M2Xz5h/uYit3298rqN+Z2NXC5nXu9m3mcgh60emIb6xuqDdOSw1Q1TUS9ZHZGK/LV6YzLqLqs/kuV5nQufiNy1+iQReWv1ywTkrNU38bKB9c4Y5KvVP6NQl1p9dAfq11nwWFnMuuo25KrVWbciQ60OG4KzfwZ8EHLIA49GPW513QCZw7qvv8xGPZiLmjELdWQGas001J+pqFGT9S5J1AT8f3C7VF3+F5FZ+PIxIDE1IDEgMSAjMzMKeJxzZ/BliGJgYChhyAdjPYZkhkyGXIZ0hiqgKABOuAT9" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d phone shape]" v + +fx_cupid : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] { +shape_cupid {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Heart" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +} +mv. 0 +fx_cupid_preview : +fx_cupid $* blend[^0] [0],alpha rm[0] +fx_gear : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] { +shape_gear {($11?2:1)*min($w,$h)},${2-5} +if $11 r2dx 50% fi +frame {2.5*$6}%,{2.5*$6}%,0 b $6% * $10 round c 0,255 autocrop +100%,100%,1,3 fc. ${7-9} rv[-2,-1] a c +gui_set_layer_name "Gear" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +} +mv. 0 +fx_gear_preview : +fx_gear $* blend[^0] [0],alpha rm[0] +fx_heart : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] { +shape_heart {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Heart" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +} +mv. 0 +fx_heart_preview : +fx_heart $* blend[^0] [0],alpha rm[0] +mc_paint_splat : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_paint_splat {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Paint Splat" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_paint_splat_preview : +mc_paint_splat $* blend[^0] [0],alpha rm[0] +#@cli shape_barbedwire : _size>=0 +#@cli : Input a 2d barbed wire binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_barbedwire , +shape_barbedwire : check "${1=512}>=0" +e[^-1] "Input a $1x$1 barbed wire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INbCPPJs5vkafPuLdu9N5Uu/T32I9PuvR72g3avCov3uqv4Dwy41PUX0X/X3rx0fcu15uX5N5F86K8bF5pEH7fOqKTLPQdzYvD9uZNYb9f5N/GOVd5cTH0Xkx8jnc/WhkvJc7e2SJv3e/os4S42+gnWieaH/lvsc80xt9Yp5R1XojVQfp72+LS/5NsbO/SMvpo4wmefTnnZ+NiF77z9ei80rNnodcadGj7F4i11JnDeDDnmeCexb2+FaDnVvTfwH5R/+27av4ixvb97eONX6VCnRVRd1Mq/G5H/kb+90T+ev5HjCH/vMqU+w2wUyNRMSAxNSAxIDEgIzM4Cnicc2dgYPAF4igGCCgB4nwkWg+Ik4E4E4hzgTgdiKugagGdcAT9" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d barbed wire shape]" v + +fx_sierpinski : +foreach { +split_opacity l[0] { +100%,100% sierpinski. ${1-7} ++fc.. $8,$9,$10 j[0] .,0,0,0,0,$11,..,255 rm[-2,-1] +} +a c +} +mc_australia : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_australia {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Australia" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_australia_preview : +mc_australia $* blend[^0] [0],alpha rm[0] +#@cli shape_paint_splat : _size>=0 +#@cli : Input a 2d paint_splat binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_paint_splat , +shape_paint_splat : check "${1=512}>=0" +e[^-1] "Input a $1x$1 paint_splat binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgMTYxNyAxIDEgIzIwNDEKeJx1lnlw1dUVx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nZovqzhzW7V+fJT3vBmnSPP8a436kz5Ie9+nU6VZ8n/VZ0iq62Xg8nyPeutcxJxh8ku661nHPs1DImU3/Fn+4IzYTUb20julWh5l3/J56yxkzutEr2Rda3Bt3enVbDeJvTnmaMdm9NIM/lex1yt9JU7PY6Yo7CLcnlrcbrnO1xOkF9Pf4Hx9eSwzOl++RX+P+aOb0V/kT+Lx732Lp7o2jeyTo977b/hL/qRs4mX3zre1f4SOeni8fIyefLsvf/ZK/w/Pftm2l8N8ib4a/APwUbvTJHfgPsbxBOrX97gr1rCmjrc2Y2TN53uQ/eR3zjqlEyd45x+BdzidD96DPmOo67J7IkE9Gj2Vhy17tLb2FMXsNtBXUuJr5i+Hfy3TvB2FNO+0/Fk5oqnXv/Nu8H9spt/8v/n3V0cd3kJ/v8XLybuLp4Cj3W8jPYA8e4K8iLycZcfpX474aXMdZi/9zbi8fgi1nE8iCXEehfzWW8xa8onb4EgFrHeJ8nzMdazkNwfBRdQs8PEO586FhLTPOp8iHjmWu//Fy2zuBf2kLOZgf8A3He64TEgMTUgMSAxICMzMwp4nHNn8GWIYmBgKGHIB2M9hmSGTIZchnSGKqAoAE64BP0=" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d paint_splat shape]" v + +fx_barnsley_fern : +foreach { +shape_fern {min(w,h)},$2%,$3,{$4%},$1 *. 255 +100%,100%,1,3,[${5-7}] +rv[-2,-1] a[-2,-1] c +if !$9 blend alpha,{$8/255} +else => "name(Barnsley Fern),opacity("{round($8*100/255)})")" rv[-2,-1] +fi +} +fx_barnsley_fern_preview : +fx_barnsley_fern ${1-8},0 +mc_gum_leaf : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_gumleaf {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Gum Leaf" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_gum_leaf_preview : +mc_gum_leaf $* blend[^0] [0],alpha rm[0] +#@cli shape_australia : _size>=0 +#@cli : Input a 2d australia binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_australia , +shape_australia : check "${1=512}>=0" +e[^-1] "Input a $1x$1 australia binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgMTUxMSAxIDEgIzE5MTQKeJx1Vnlw1tUVPTcJJEBCCBTZF8MyCooga0AQBKt1LFgRpAUBywyDiEV2EJCKYoGmQEcKUgIhbAYISwoiSysYBNl3CVuEIG0KoiJlyZflnZ7fyxeMnekfZ8657/2+t9z7vnsvIhBhMEB4Z0cEIl0UlroIhBiNScI6F4kCcWBPZgwyXALypaewIja6qrjHWEz3OgE/aDzQm6Rv6tt3va6C76RnsJJ0PL4VFzICc71dGTdY1etM7XmXhuusjg+05hxXCws910eKeK5rqG+jsJVxWOEM37Ox1onS/uXwiR+LRRFb6mwx2Ml4rHI9NF8Bf2cC1rpnNVcB/9BeGa6vxgLu43mde0nfV8V6P14NG8Q7+TPdpw926CyZsreLt7h+ZfgBfOxexjbPwXxNjb+Aj1lL3BObWVvjJbzV9fK83f0KfxPvcC/+D/eWb6Owi3WwU2cJ6T67y+jPWBdfKwYX+JLiUN7bV1055DCYL7Ur4Gv29THaw3qyK+FffFl2DD73dizyNB/4Zo++v+6q4d/so3gZsjR/w1WX3/sgU/o7V1O6NzZ5XUv6xbCuLf0CNrI+bjqtwZ7YIH3XNVZcSnSIkYhgM8W+xC7U+aLYSnEN7IelZ+v3D6Mck7VmM8+ZbC7+k3z0KKI5B1vYAjGcpzg/hljOV2xbIo5/ka9boTIXyNePI54LFaPWqMYlimlrVOcy+a8NanCFfFeW07HX81rsZ1vxOhwQP8D1OOx5I456zsTx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Lp6aqtd6TTOAi/V20OdCoHYhqreL2Ur+Bt1e/byuFLOEB9RpzXKeyv/iMW/+Fy3e83eEs9wy35+a/spj0rYJS3l+m+nTFA9g9MxYfKs/2UQ2+qDhXL3x+qFvSWHfQpxaopC1VTemkumC/kB9rD5J9W6PmTsbZ4XjH7XnaBYrRYazyn777VfzsUttt5PU9naYNOys2BXqQ61VHnyOdc7dtSOTgmrB9Ba+0f6IWqfY0U7wXixuL5WrdYcQnG5jDR8x8Vg0TxLPk5qCsh/W6m+owWWi/k884MxaC66kaczvyu/J6g2hKn806Xf6O0bqzO+g5SXUXVi2lIUZ91lVMx1U3BFDcZk4W33CRMchMx0U3ABDce44VxbizGeozBmDACPdqNDmMU3nRveox0Iz1+597ACDfC43X3Ooa74cJrGOaGYagbilfdYAxyA/GKG4D+6huKVbv7qZcr1Lspkr96qfco1H07qh8p0H3bqo8Maa6Vi9P7qY0W6nNu6y01V/9zU+/oIf32G903Xn1knHqcSi4a5XW/WrfU1KpnilIv+1NEqr+NxFn5McLrkvEfuWQ+Qus2LVJX7O1yWjMGMfJfRe1xTXmvifYL+oGm6m1DerdNXVOhCRrrTqVo5BrdR6JLFB5EQ/WwARq4BkJ91Peoh3rqp+p61EGdMGqr96ol1JRParoaqKFeO0H7VRHi1UeX3jlW56ogv0S78kg+9F/vDNGsMSAxNSAxIDEgIzMzCnicc2fwZYhiYGAoYcgHYz2GZIZMhlyGdIYqoCgATrgE/Q==" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d australia shape]" v + +mc_maple_leaf : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_mapleleaf {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Maple Leaf" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_maple_leaf_preview : +mc_maple_leaf $* blend[^0] [0],alpha rm[0] +#@cli shape_gumleaf : _size>=0 +#@cli : Input a 2d gum leaf binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_gumleaf , +shape_gumleaf : check "${1=512}>=0" +e[^-1] "Input a $1x$1 gum leaf binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgOTY5IDEgMSAjNTk2CnichdXnVuMwEAXgiUMNvXdC76GFQICE3kkoSahPuu+xr7HPcM/OjGxFArP74zszNgdbVqQrCihIUIKIdf7mCiOBgEXVCJAM1fukrQ3au7UBjczURjQxU5tUs63NaKEW1UqtzNQUpdBGbWindtVBHaqTOtHFTO1S3dSNHupRvdSr+lSf6qd+DNCAGqRBDNGQGlbDaoRGMEqjaozGME7jzNQJmlCTNKnSlGZRTWOKptR0WE0/bc3QjDVLs9YczVnzNG8teP2CWqRFa4mWPMu07FmhlVirtIa1/8hQxrGO9R9s0EZoE5sxtmgrtI3tGFnKsh3sxMjRLna/2cNerDzynn3sf3OAg28OcRgqUIEVUfQc4chzjGPrBCfWKU6tM5xZ5zi3LnBhXeJSXeGKXdM1u8GN5xa3se5w96N73LOv993/c5914/X1d/9rLPFj88fwdTxGCSVVtrWsHvBgPXr9o+cJT+rZ1mergoqqosrc3lzX+yrVUFMveFGveA3V+ze8We94tz7wYX16/WfI7b9e+33ccz7sO6J3umOIxhSNsT5u8y3ud9XC76x6c1KxcxXN3VM4r4/O3Jftb1TS381dU9EauOZ1K2tY1rOsb1nvsv5lP0R7RPZMUfdVQfdYtO9kP+Z530b7Okc53fNZzgTJC8kOyRXJmAznkeSWZJrknGSfZKHkpeSn5KlkrWSw5LNktWS3ZLnk+yCT7JfzoIvPCDk/UnymtPD5ImdPA59HST6fjCSfa4Z77fdJPft+vh+Ez3BrwOdoEPN39370jF9//gJSgJz1MSAxNSAxIDEgIzMzCnicc2fwZYhiYGAoYcgHYz2GZIZMhlyGdIYqoCgATrgE/Q==" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d gum leaf shape]" v + +fx_snowflake : +foreach { +to_color split_opacity +l[0] { +shape_snowflake {min(w,h)},$1 100%,100%,1,3,[${3-5}] +j[0] .,{([w#0,h#0]-[w#1,h#1])/2},0,0,$2,.. k[0] +} +a c +} +fx_dragoncurve : +foreach { +to_color split_opacity +l[0] { +shape_dragon {min(w,h)},$1,$2 100%,100%,1,3,[${4-6}] +j[0] .,{([w#0,h#0]-[w#1,h#1])/2},0,0,$3,.. k[0] +} +a c +} +fx_tk_make3D : +sh={-$2} sw={-$sh-$3} size1={w} size2={h} to_rgb[0] r[0] $size1,$size2 [0] +if $11==0 ++fx_tk_depthmap. $1,$4,$5,$6,$7,$8,$9,0,0,0 r. $size1,$size2 +fx_gaussian_blur. 0,{{w+h}/700},{{w+h}/350},1,0,0,0 +else if $!!=3 +error[] "For individual depth map select input mode ACTIVE AND BELOW" fi +rv[1,-1] to_rgb. luminance. +if $11==1 +if $9!=0 ++fc[0] 128,128,128 +channels[0] 2 negate. c. 0,90 +n. 0,128 rv[-1,-2] compose_darken[-1,-2] ++channels[0] 0 negate. c. 165,255 n. 128,255 rv[-1,-2] +compose_hardlight[-1,-2] rv[-1,-2] +if $11==0 if $1!=20 fx_compose_average[-1,-2] {$9/5} +else fx_compose_value[-1,-2] {$9/5},0 +tk_fx_channel_processing. 1,{$4/25},0,0,0,0,100,256,0,0,0,2,0,0 +fi +else fx_compose_value[-1,-2] {$9/5},0 fi fi +if $8!=0 +fx_highpass[0] 2,2,0,0,0 +tk_fx_replace_color. 5,0,128,128,128,255,0,0,0,255 +fx_morpho. 3,70,0,0,0,1,0 to_gray. av={ia} +ir. $av,255 n. 0,255 blur_xy. 25 +rv[-1,-2] fx_compose_overlay[-1,-2] {$8/5} fi +if $5!=0 +fx_isophotes[0] {{$5*3}+2},0,0,0 +fx_morpho. 3,{5-{$5/2}},0,0,0,1,0 +tk_fx_channel_processing. 1,1,255,0,0,0,100,256,0,0,0,2,0,0 +rv[-1,-2] fx_compose_overlay[-1,-2] {$5/10} ++fx_gradient_norm[0] {$6*2},{1.5-{0.1+{$5/3.6}}},0,100,0,0 +rv[-1,-2] compose_lighten[-1,-2] fx_segment_watershed. $5,$6,0,0 +fi +if $7!=0 +luminance[0] fx_map_tones. 1,{0.25-{$7/20}},0,30,3,0 +rv[-1,-2] fx_compose_overlay[-1,-2] {$7/10} fi +n. 0,255 +fi fi +if $20==1 r {w*{$23/max(w,h)}},{h*{$23/max(w,h)}},1,3,6 c 0,255 fi +if $20==0 +if $13!=15 if $19==0 +if $sw<=0 negate. fi +r. $size1,$size2,1,2 s. c f. 0 n.. 0,$sw a[-1,-2] c +warp.. .,1 shift.. $sh,0 rm. +else +. r[-1,-2] 100%,100%,1,2 +s. c f. 0 n.. 0,{abs($sw/2)} a[-1,-2] c +negate.. s.. c f.. 0 n... 0,{-abs($sw/2)} a[-2,-3] c +warp[-4] ..,1 warp... .,1 +shift... $sh,0 rm[-1,-2] +fi fi +else +if $19==0 +count={$22} dev=0 repeat $count dev={$dev+{$sw/$22}} +[0] rv[-1,-2] +if $sw<=0 negate. fi +r. 100%,100%,1,2 s. c f. 0 +if $21==0 n.. 0,$dev else n.. {-$dev},$dev fi +a[-1,-2] c warp.. .,1 to_gray. n. 0,255 +if $sw<=0 negate. fi +done rm[-1,0] rv +else +count={abs($22/2)} dev=0 +repeat $count dev={$dev+{$sw/$count}} +.. rv[-1,-2] +.. rv[-1,-2] +. r[-1,-2] 100%,100%,1,2 +s. c f. 0 +if $21==0 n.. 0,{abs($dev/2)} +else n.. {-abs($dev/2)},{abs($dev/2)} fi +a[-1,-2] c +negate.. s.. c f.. 0 +if $21==0 n... 0,{-abs($dev/2)} +else n... {-abs($dev/2)},{abs($dev/2)} fi +a[-2,-3] c +warp[-4] ..,1 warp... .,1 rm.. to_gray. n. 0,255 +mv[-4] -1 done rm[-1,-2] mv[0--1:2] -1 rv[0-50%] mv[0] 50% +fi fi +if $20==0 if $18==1 if $13!=15 +if $sh>=0 z[-1,-2] $sh,0,{w},{h} else z[-1,-2] 0,0,{w+$sh},{h} fi +if $19==0 +if $sw>=0 z[-1,-2] $sw,0,{w},{h} else z[-1,-2] 0,0,{w+$sw},{h} fi +else z[-1,-2] {abs($sw/2)},0,{w-abs($sw/2)},{h} +fi fi fi fi +if $12==1 fx_blackandwhite 0.299,0,0.587,0,0.114,0,1,1,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0 fi +if $20==0 +if $13!=14&&$13!=15 +fx_tk_stereoimage[0,1] $13,$10,$14,$15,$16,$17 +elif $13==14 k[0,1] +elif $13==15 k. +fi +fi +if $13==14 apply_gamma $14 tk_fx_channel_processing 1,1,$15,0,0,0,100,256,0,0,1,10,7,0 +fx_mix_lab 1,0,0,$16,0,0,$16,0,0,0,2,0 fi +fx_tk_make3D_preview : +if $20==0 shpre={$2/3} swpre={$3/3} else shpre={$2*{400/$23}} swpre={$3*{400/$23}} fi +if $11==1&&$!!=2 fc[0] 255,0,128,255 k[0] text "For individual depth map",10,80%,20,1,0,0,0,255 +text "select input mode ACTIVE AND BELOW.",10,90%,20,1,0,0,0,255 +else +fx_tk_make3D $1,$shpre,$swpre,${4-12},{if({$20==1},14,$13)},${14-19},0,${21-23} if $13==14||$20==1 k[1] fi +fi +fx_tk_video3D : skip "${15=},${27=}" +sh={-$2} sw={-$sh-$3} size1={w} size2={h} +if narg($_previewflag)==0 _previewflag=0 fi +if $_previewflag!=0 sh={$sh*{400/$22}} sw={$sw*{400/$22}} fi +if $26==0 +if $34!=0||$35!=0 +if $34>=$!-$35" || "$35>=$!-$34 error[] "Fade out of frame range." +fi fi +if $13!=14 channels 0,2 fi +if $_previewflag!=2 frames={$!} else frames=1 fi +counter={$!} index=0 +if $_previewflag!=0 r 400,328 fi +flag3d=0 if $41!=2 +if !($2==0" && "$3==0" && "$1==24" && "$13==14" && "$32!=0) flag3d=1 +repeat $frames +[$index] +if $40==0" || "$40==1 ++fx_tk_depthmap[$index] $1,$4,$5,$6,$7,$8,$9,$38,$39,{w*{$37/1000}} +r. $size1,$size2 fi +if $40==1 +infilec="correction.png" inpathc="$27/"$infilec"" +input. $inpathc +to_rgba[-1,-2] compose_rgba[-1,-2] to_rgb. +elif $40==2 +infilec="depthmap.png" inpathc="$27/"$infilec"" +input. $inpathc +elif $40==3 +if $_previewflag==2 +infilec="depthmap_"$_mapin".png" inpathc="$27/depthmaps/"$infilec"" +else +infilec="depthmap_"{$frames-$index}".png" inpathc="$27/depthmaps/"$infilec"" +fi +input. $inpathc +rv[$index,-2] +fi +if $_previewflag!=0 r 400,328 fi +if $10!=0 +if $_previewflag==2 [0] mv[-4] -1 +compose_difference[-1,-2] luminance. n. 0,255 +ir. 0,{{$37/2}+1} negate. n. 0,255 +else +[$index] [{$index+1}] +compose_difference[-1,-2] luminance. n. 0,255 +ir. 0,{{$37/2}+1} +negate. n. 0,255 +if $index<=$frames-2 +negate. fi +fi +fi +index={$index+1} done +if $10!=0 +if $_previewflag==2 +if $42==0 infile={$29} elif $42==1 infile={$30} elif $42==2 infile={$43} fi +if $infile==2 rv[-1,-2] else if $infile>=$29+2 +compose_difference[-4,-5] luminance[-4] n[-4] 0,255 +ir[-4] 0,1 negate[-4] n[-4] 0,255 +negate[-4] compose_darken[-1,-4] +mv... -1 fi fi +blur_xy.. {w*{$37/1000}} +if $infile!=$29 if $10>=0 fx_compose_lighten[-1,-2] {abs($10)/5} +else negate.. fx_compose_darken[-1,-2] {abs($10)/5} fi fi +else +rm. rm[{$counter+3}] +repeat $frames-2 +mv[{$counter+6}] {$counter+2} +compose_darken[{$counter+2},{$counter+3}] +rv[{$counter+1},{$counter+2}] +blur_xy[{$counter+1}] {w*{$37/1000}} +if $10>=0 +fx_compose_lighten[{$counter+1},{$counter+2}] {abs($10)/5} +else negate[{$counter+1}] +fx_compose_darken[{$counter+1},{$counter+2}] {abs($10)/5} +fi +counter={$counter+2} done +rv[-3,-4] blur_xy[-4] {w*{$37/1000}} +if $10>=0 fx_compose_lighten[-3,-4] {abs($10)/5} +else negate[-4] fx_compose_darken[-3,-4] {abs($10)/5} fi +fi +fi +if $_previewflag==2 if $24!=0 rm.. fi fi +index={-1} repeat $frames +if $13!=15 +if $41==0 if $sw<=0 negate[$index] fi fi +if $_previewflag!=2 +if $34!=0 if -$index<=$34 sw={{{-$index}/$34}*$sw} sh={{{-$index}/$34}*$sh} +fi fi +if $35!=0 if -($index+1)>=$frames-$35 sw={$sw*{{$frames-{-{$index+1}}}/$35}} +sh={$sh*{{$frames-{-{$index+1}}}/$35}} fi fi fi +if $41==0 +r[$index] 100%,100%,1,2 s[$index] c f[$index] 0 n[{$index-1}] 0,$sw +a[$index,{$index-1}] c warp[{$index-1}] [$index],1 +shift[{$index-1}] $sh,0 rm[$index] +else +[$index] +mv. {$frames+{$index+1}} +r[$index,{$frames+{$index+1}}] 100%,100%,1,2 +s[$index] c f[$index] 0 n[{$index-1}] 0,{abs($sw/2)} a[$index,{$index-1}] c +negate[{$frames+{$index+1}}] s[{$frames+{$index+1}}] c +f[{$frames+{$index+2}}] 0 n[{$frames+{$index+1}}] 0,{-abs($sw/2)} +a[{$frames+{$index+1}},{$frames+{$index+2}}] c +warp[{$frames+{$index+0}}] [{$frames+{$index+1}}],1 +warp[{$index-1}] [$index],1 +shift[{$index-1}] $sh,0 +rm[$index,{$frames+{$index+1}}] +fi +fi +sh={-$2} sw={-$sh-$3} +if $_previewflag!=0 sh={$sh*{400/$22}} sw={$sw*{400/$22}} fi +index={$index-1} done +if $13!=15 if $_previewflag!=2 +if $24>=0 repeat $24 rm. [$frames] +mv. $frames done +else counter={1} repeat abs($24) rm[$frames] +[{-$counter}] mv. {-$counter-1} counter={$counter+1} done fi +fi fi +if $20==1 if $13!=15 +if $sh>=0 z $sh,0,{w},{h} else z 0,0,{w+$sh},{h} fi +if $sw>=0 z $sw,0,{w},{h} else z 0,0,{w+$sw},{h} fi +fi fi +fi fi +if $_previewflag!=2 +if $32!=0 if $13!=15 repeat $! l[$>] fx_custom_code "$33",0,0,0 done done fi fi +else +if $32==1 if $13!=15 fx_custom_code[0,1] "$33",0,0,0 fi +elif $32==2 if $13!=15 l[0] fx_custom_code "$33",0,0,0 done fi +elif $32==3 if $13!=15 l[1] fx_custom_code "$33",0,0,0 done fi +fi fi +if $41==2 if $13==14" || "$13==15 error[] "Output format not allowed for image stream alignment" fi fi +if $12==1 ac "fx_blackandwhite 0.3,0,0.6,0,0.1,0,1,1,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0",rgb fi +counter={$frames-1} index={-2} +repeat $frames +if $13!=14" && "$13!=15 +fx_tk_stereoimage[-1,$counter] $13,$11,$16,$17,$18,$19 +elif $13==15 rm[0,$index] +fi counter={$counter-1} index={$index-1} done +if $13==14 apply_gamma $16 tk_fx_channel_processing 1,1,$17,0,0,0,100,256,0,0,1,10,7,0 +fx_mix_lab 1,0,0,$18,0,0,$18,0,0,0,2,0 fi +if $21==1 if $13!=13 +if $23==0 r $22,{$22*0.75},1,{s},6 +elif $23==1 r $22,{{$22*9}/16},1,{s},6 +elif $23==2 r $22,{{$22*2}/3},1,{s},6 +elif $23==3 r $22,{$22*0.5},1,{s},6 +elif $23==4 r $22,{{$22*9}/21},1,{s},6 +elif $23==5 r $22,{$22*{h/w}},1,{s},6 fi +fi fi c 0,255 +if $25==1 rv fi +if $14==1 +if $31==0" || "$13==15 end=".png" else end=".bmp" fi +rv +index={0} name=0 +if $13==14" && "$flag3d==1 +fileleft="$15/frame_left_"{$name+1}$end fileright="$15/frame_right_"{$name+1}$end +else if $13!=15 filename="$15/frame_"{$index+1}$end +else filename="$15/depthmap_"{$index+1}$end fi fi +repeat $frames +if $13==14" && "$flag3d==1 +output[$index] $fileright +output[{$index+$frames}] $fileleft +index={$index+1} name={$name+1} +fileleft="$15/frame_left_"{$name+1}$end fileright="$15/frame_right_"{$name+1}$end +else +output[$index] $filename +index={$index+1} if $13!=15 filename="$15/frame_"{$index+1}$end else filename="$15/depthmap_"{$index+1}$end fi +fi +done rv +fi +else +if $31==0 end=".png" else end=".bmp" fi +infile={$29} inpath="$27/$28"$infile""$end"" outfile={$29} +frames={{$30-$29}+1} counter=1 +if $34!=0" || "$35!=0 +if $34>=$frames-$35" || "$35>=$frames-$34 error[] "Fade out of frame range" +fi fi +if $41==2 +inpathleft="$27/$28""left_"$infile$end inpathright="$27/$28""right_"$infile$end +fi +av=1 var=1 avprev=1 varprev=1 +repeat $frames +if $41!=2 +rm input[0] $inpath +if $24==0 [0] +else infile2={$infile+$24} +if $infile2<=$29 infile2={$29} fi +if $infile2>=$30 infile2={$30} fi +inpath2="$27/$28"$infile2""$end"" +input[1] $inpath2 fi +else +rm input[0] $inpathleft +input[1] $inpathright +fi +size1={w} size2={h} +flag3d=0 if $41==3 flag3d=1 fi if $41!=2" && "$41!=3 +if !($2==0" && "$3==0" && "$1==24" && "$13==14" && "$32!=0) flag3d=1 +if $13!=14 channels[0,1] 0,2 fi +if $40==0" || "$40==1 +av={0,ia} var={0,iv} diffav={{$av-$avprev}/$avprev*100} diffvar={{$var-$varprev}/$varprev*100} +if abs($diffav)>=10" || "abs($diffvar)>=10 scenechange=1 else scenechange=0 fi +if $counter==1" || "$scenechange==1" || "$counter/$36==round($counter/$36,1) ++fx_tk_depthmap[0] $1,$4,$5,$6,$7,$8,$9,$38,$39,{w*{$37/1000}} r. $size1,$size2 +if $av!=0 avprev=$av fi if $var!=0 varprev=$var fi +if $36!=1 filename="$15/depthmap_temp.png" +output. $filename fi +else +filename="$15/depthmap_temp.png" +input. $filename +fi +fi +if $40==1 +infilec="correction.png" inpathc="$27/"$infilec"" +input. $inpathc +compose_rgba[-1,-2] +elif $40==2 +infilec="depthmap.png" inpathc="$27/"$infilec"" +input. $inpathc +elif $40==3 +infilec="depthmap_"$infile".png" inpathc="$27/depthmaps/"$infilec"" +input. $inpathc +fi +if $10!=0 if $infile!=$29 +[0] +infilemov={$infile-1} inpathmov="$27/$28"$infilemov""$end"" +input. $inpathmov +compose_difference[-1,-2] luminance. n. 0,255 +ir. 0,{{$37/2}+1} negate. n. 0,255 +if $infile>=$29+2 +infilemov2={$infile-2} inpathmov2="$27/$28"$infilemov2""$end"" +input. $inpathmov2 +infilemov3={$infile-1} inpathmov3="$27/$28"$infilemov3""$end"" +input. $inpathmov3 +compose_difference[-1,-2] luminance. n. 0,255 +ir. 0,1 n. 0,255 compose_darken[-1,-2] +fi blur_xy. {w*{$37/1000}} rv[-1,-2] +if $10>=0 +fx_compose_lighten[-1,-2] {abs($10)/5} +else +negate.. +fx_compose_darken[-1,-2] {abs($10)/5} +fi +fi fi +if $13!=15 +if $41==0 +if $sw<=0 negate[2] fi +if $34!=0 if $counter<=$34 sw={{$counter/$34}*$sw} sh={{$counter/$34}*$sh} fi fi +if $35!=0 if $counter>=$frames-$35 sw={$sw*{{{$frames-$counter}+1}/$35}} +sh={$sh*{{{$frames-$counter}+1}/$35}} fi fi +r. 100%,100%,1,2 s. c f. 0 n.. 0,$sw a[-1,-2] c +warp.. .,1 shift.. $sh,0 rm. +else +. r[-1,-2] 100%,100%,1,2 +s. c f. 0 n.. 0,{abs($sw/2)} a[-1,-2] c +negate.. s.. c f.. 0 n... 0,{-abs($sw/2)} a[-2,-3] c +warp[-4] ..,1 warp... .,1 +shift... $sh,0 rm[-1,-2] +fi +fi +sh={-$2} sw={-$sh-$3} +if $20==1 if $13!=15 +if $sh>=0 z $sh,0,{w},{h} else z 0,0,{w+$sh},{h} fi +if $sw>=0 z $sw,0,{w},{h} else z 0,0,{w+$sw},{h} fi +fi fi +fi fi +if $41==3 fx_tk_deana[0] $37,{{$38*2}+0.1} to_rgb fi +if $32==1 if $13!=15 fx_custom_code[0,1] "$33",0,0,0 fi +elif $32==2 if $13!=15 l[0] fx_custom_code "$33",0,0,0 done fi +elif $32==3 if $13!=15 l[1] fx_custom_code "$33",0,0,0 done fi +fi +if $12==1 ac[0,1] "fx_blackandwhite 0.3,0,0.6,0,0.1,0,1,1,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0",rgb fi +if $41==2" && "$13==14 error[] "Output format not allowed for image stream alignment" +elif $41==3" && "$13==15 error[] "Output format not allowed for anaglyph video reconstruction" +elif $41==2" && "$13==15 +fx_tk_depth_obtain[0,1] $11,{$37/100},{100-{$38*20}},{$39*20} +if $32!=0 fx_custom_code[0,1,-1] "$33",0,0,0 fi k. +elif $41!=2" && "$13==15 k. +elif $41==3" && "$13==14 k[0,1] +else fx_tk_stereoimage[0,1] $13,$11,$16,$17,$18,$19 fi +if $13==14 apply_gamma $16 tk_fx_channel_processing 1,1,$17,0,0,0,100,256,0,0,1,10,7,0 +fx_mix_lab 1,0,0,$18,0,0,$18,0,0,0,2,0 fi +if $21==1 if $13!=13 +if $23==0 r $22,{$22*0.75},1,{s},6 +elif $23==1 r $22,{{$22*9}/16},1,{s},6 +elif $23==2 r $22,{{$22*2}/3},1,{s},6 +elif $23==3 r $22,{$22*0.5},1,{s},6 +elif $23==4 r $22,{{$22*9}/21},1,{s},6 +elif $23==5 r $22,{$22*{h/w}},1,{s},6 +fi fi fi c 0,255 +if $13==14" && "$flag3d==1 +fileleft="$15/frame_left_"$outfile$end fileright="$15/frame_right_"$outfile$end +else if $13!=15 filename="$15/frame_"$outfile$end +else filename="$15/depthmap_"$outfile$end fi fi +if $13==14" && "$flag3d==1 +output[0] $fileleft output[1] $fileright +else output[0] $filename +fi +outfile={$outfile+1} +infile={$infile+1} inpath="$27/$28"$infile""$end"" +if $41==2 inpathleft="$27/$28""left_"$infile$end inpathright="$27/$28""right_"$infile$end fi +counter={$counter+1} done fi +if $_previewflag==0" && "$26==1 if $36!=1 +if ${-is_windows} path="$15" path=${path}{`92`} +x "cd \""$path"\" && del depthmap_temp.png" +else file="$15/depthmap_temp.png" x "rm -f \"$file\"" fi +fi fi +fx_tk_video3D_preview : skip "${15=},${27=}" +shpre={$2*{400/$22}} swpre={$3*{400/$22}} +if $26==0 +if $!==1 fc[0] 255,0,128,255 k[0] text "Select multiple layer",10,80%,24,1,0,0,0,255 +text "input mode ALL.",10,90%,24,1,0,0,0,255 +elif $41==2 fc[0] 255,0,128,255 k[0] text "Alignment of image streams",10,80%,24,1,0,0,0,255 +text "in BATCH processing mode only!",10,90%,24,1,0,0,0,255 +elif $41==3 fc[0] 255,0,128,255 k[0] text "Anaglyph video reconstruction",10,80%,24,1,0,0,0,255 +text "in BATCH processing mode only!",10,90%,24,1,0,0,0,255 +else +_previewflag=1 +if $40==3 if $42==0 _mapin=1 elif $42==1 _mapin={$!} elif $42==2 _mapin=$43 fi fi +if $42==0 nr=1 pv={-1} elif $42==1 nr={$!} pv={-$!} elif $42==2" || "$42==3 nr=$43 pv={-$43} fi +if $42==2" || "$42==3 if $43>=$! nr={$!} pv={-$!} _mapin={$!} fi fi +if $42!=3 +fx_tk_video3D[$pv] $1,$shpre,$swpre,${4-9},0,${11-13},0,"$15",${16-23},0,${25-26},"$27","$28",${29-32},"$33",0,0,${36-39},0,${41-43} k[$pv] +text[0] "layer "{``$nr},20,75%,{h*0.1},1,255,{if({{$13==2}||{$13==3}||{$13==15}},0,255)},0,255 +if $24!=0 text "For preview with frames offset ",20,70%,{h*0.05},1,255,{if({$13==15},0,255)},{if({$13==15},0,255)},255 +text "use full layer stack preview mode!",20,85%,{h*0.05},1,255,{if({$13==15},0,255)},{if({$13==15},0,255)},255 fi +if $34!=0" || "$35!=0 text "For fade in/out effect preview",20,65%,{h*0.05},1,255,{if({$13==15},0,255)},{if({$13==15},0,255)},255 +text "use full layer stack preview mode!",20,85%,{h*0.05},1,255,{if({$13==15},0,255)},{if({$13==15},0,255)},255 fi +if $40!=0 text "For preview with custom depth correction ",20,60%,{h*0.05},1,255,{if({$13==15},0,255)},{if({$13==15},0,255)},255 +text "use full layer stack preview mode!",20,85%,{h*0.05},1,255,{if({$13==15},0,255)},{if({$13==15},0,255)},255 fi +if $10!=0 text "For preview with motion analyzer ",20,55%,{h*0.05},1,255,{if({$13==15},0,255)},{if({$13==15},0,255)},255 +text "use full layer stack preview mode!",20,85%,{h*0.05},1,255,{if({$13==15},0,255)},{if({$13==15},0,255)},255 fi +if $32==2" || "$32==3 text[0] "Separate stream filtering ignored in layer mode",20,50%,{h*0.05},1,255,255,0,255 fi +else +fx_tk_video3D $1,$shpre,$swpre,${4-13},0,"$15",${16-26},"$27","$28",${29-32},"$33",${34-43} k[$pv] +fi +text[0] "layer "{``$nr},20,75%,{h*0.1},1,255,{if({{$13==2}||{$13==3}||{$13==15}},0,255)},0,255 +if $2==0" && "$3==0" && "$1==24" && "$13==14" && "$32!=0 text[0] "2D filter mode on!",50%,75%,{h*0.075},1,255,255,0,255 fi +if $36!=1 text "Key frame settings ignored in layer processing mode. ",20,50%,{h*0.05},1,255,255,0,255 fi +_previewflag=0 +fi +else +_previewflag=2 +if $42==3 ++fc[0] 255,0,128,255 k. +text "No preview available",20,50,28,1,0,0,0,255 +text "for batch input stack!",20,80,28,1,0,0,0,255 +text "Please select frame to adjust settings.",20,150,16,1,0,0,0,255 +elif $42==2" && "($43<=$29-1" || "$43>=$30+1) fc[0] 255,0,128,255 k[0] +text[0] "Selected frame out of range! ",10,80%,24,1,0,0,0,255 +elif $41==2" && "$13==14 fc[0] 255,0,128,255 k[0] +text[0] "Output format not allowed!",10,80%,24,1,0,0,0,255 +elif $41==3" && "$13==15 fc[0] 255,0,128,255 k[0] +text[0] "Output format not allowed!",10,80%,24,1,0,0,0,255 +else +rm +if $31==0 end=".png" else end=".bmp" fi +if $42==0 infile={$29} +if $34!=0 swpre={{1/$34}*$swpre} shpre={{1/$34}*$shpre} fi +elif $42==1 infile={$30} +if $35!=0 swpre={{1-{1/$35}}*$swpre} shpre={{1-{1/$35}}*$shpre} fi +elif $42==2 infile={$43} +if $34!=0" || "$35!=0} +if $43<=$29+$34 swpre={{$43/$34}*$swpre} shpre={{$43/$34}*$shpre} fi +if $43>=$30-$35 swpre={{$30-$43}*{$swpre/$35}} shpre={{$30-$43}*{$shpre/$35}} fi +fi +fi +if $41!=2 +inpath1="$27/$28"$infile""$end"" +input[0] $inpath1 +if $24!=0 infileoff={$infile+$24} +if $infileoff<=$29 infileoff={$29} fi +if $infileoff>=$30 infileoff={$30} fi +inpathoff="$27/$28"$infileoff""$end"" +input[1] $inpathoff +fi +if $infile!=$29 if $10!=0 +infilemov={$infile-1} inpathmov="$27/$28"$infilemov""$end"" +input. $inpathmov +if $infile>=$29+2 +infilemov2={$infile-2} inpathmov2="$27/$28"$infilemov2""$end"" +input. $inpathmov2 +infilemov3={$infile-1} inpathmov3="$27/$28"$infilemov3""$end"" +input. $inpathmov3 +fi fi fi +else +inpathleft="$27/$28""left_"$infile$end inpathright="$27/$28""right_"$infile$end +rm input[0] $inpathleft +input[1] $inpathright +fi +if $42==0 _mapin=$29 elif $42==1 _mapin=$30 elif $42==2 _mapin=$43 fi +framesn={{$30-$29}+1} +if ($34!=0" || "$35!=0)" && "($34>=$framesn-$35" || "$35>=$framesn-$34) fc[0] 255,0,128,255 k[0] +text "Fade out of frame range! ",10,80%,{h*0.1},1,0,0,0,255 +else +if $41==2" && "$13==15 +fx_tk_depth_obtain[0,1] $11,{$37/100},{100-{$38*20}},{$39*20} +if $32!=0 fx_custom_code[0,1,-1] "$33",0,0,0 fi k. +else +fx_tk_video3D $1,$shpre,$swpre,${4-9},{if({$infile==$29},0,$10)},${11-13},0,"$15",${16-25},0,"$27","$28",${29-31},{if({{$2==0}&&{$3==0}&&{$1==24}&&{$13==14}&&{$32!=0}},2,$32)},"$33",0,0,1,${37-43} +fi to_rgb if $13==14 k. fi +text[0] "frame "{``$infile},20,75%,{h*0.1},1,255,{if({{$13==2}||{$13==3}||{$13==15}},0,255)},0,255 +if $41!=2 if $36!=1 if $40==0" || "$40==1 text[0] "Preview always forced to key frame. ",20,50%,{h*0.05},1,255,255,0,255 else +text[0] "No keyframe computation for individual maps. ",20,64%,{h*0.05},1,255,255,0,255 fi fi fi +if $2==0" && "$3==0" && "$1==24" && "$13==14" && "$32!=0 text[0] "2D filter mode on!",50%,75%,{h*0.075},1,255,255,0,255 fi +fi fi fi +_previewflag=0 +fx_tk_autodepth : +repeat $! l[$>] to_rgb sizew={w} sizeh={h} resize2dx 400,2 +whpos=128 blpos=128 rpos=255 gpos=200 blupos=200 crga=1.5 crmix1=0.5 crmix2=0.5 geocomp1=75 geocomp2=30 +geostr=0.3 focstr=0.3 featsize=60 featpos=128 feattr=35 tr=30 rtr=90 gtr=90 blutr=90 contstr=0.9 +featinfl=1 foctol=5 focmorph=70 focavt=85 focavt2=140 focvart=2000 latinhib=0.5 ++fx_map_tones_fast. 10,0.5,0,0 luminance. +fx_segment_watershed. 0.5,1,0 label. 5,0 ++fx_gradient_norm[0] 0,0.5,0,100,0,0 compose_lighten[-1,-2] +fx_segment_watershed. 0.5,1,0 label. 5,0 n. 0,255 ++luminance[0] ++channels[0] 1 ir. $gtr%,100% +fx_morpho. 2,2,0,0,0,1,0 n. 0,$gpos +tk_fx_replace_color. 1,0,0,0,0,255,0,0,0,0 blend[-1,-2] alpha ++channels[0] 0 ir. $rtr%,100% +fx_morpho. 2,2,0,0,0,1,0 n. 0,$rpos +tk_fx_replace_color. 1,0,0,0,0,255,0,0,0,0 blend[-1,-2] alpha ++channels[0] 2 ir. $blutr%,100% n. 0,$blupos +fx_morpho. 2,2,0,0,0,1,0 +tk_fx_replace_color. 1,0,0,0,0,255,0,0,0,0 +to_rgba. +fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,0,100 +s.. c rv[-1,-2] compose_multiply[-1,-2] to_gray. a[-4,-3,-2,-1] c +blend[-1,-2] alpha ++channels[0] 0 +luminance[0] compose_average[-1,-2] ir. 80%,95% +fx_morpho. 2,2,0,0,0,1,0 n. 0,$whpos +tk_fx_replace_color. 1,0,0,0,0,255,0,0,0,0 blend[-1,-2] alpha ++channels[0] 0 +luminance[0] compose_average[-1,-2] ir. 5%,20% +fx_morpho. 2,2,0,0,0,1,0 n. 0,$blpos +tk_fx_replace_color. 1,0,0,0,0,255,0,0,0,0 blend[-1,-2] alpha ++fx_gradient_norm[0] 0,0.5,0,50,0,0 +. +fx_morpho. 2,$featsize,0,0,0,1,0 +ir. $feattr%,100% +n. 0,$featpos +blur_xy. 2 +fx_compose_lighten[-1,-2] $contstr +blur_xy. 2 +to_rgb[0] rgb2ycbcr[0] +channels[0] 2 ycbcr2rgb[0] +n. 0,255 c. 25%,100% apply_gamma. $crga ++channels[0] 2 negate. c. 0,128 +to_rgba. +fx_linear_gradient. 0,0,0,255,255,255,255,255,0,270,0,100 +s.. c rv[-1,-2] compose_multiply[-1,-2] to_gray. +a[-4,-3,-2,-1] c rv[-1,-2] fx_compose_darken[-1,-2] $crmix1 ++luminance[0] fx_houghsketchbw. 10,5,15,$tr,1,1,0 complex={ia} +if $complex>=$geocomp1 +do tr={$tr+10} rm. +luminance[0] fx_houghsketchbw. 10,5,15,$tr,1,1,0 complex={ia} +while $complex>=$geocomp2" && "$tr<=90 fi +fx_morpho. 3,5,0,0,0,1,0 blur_xy. 1 fx_distance. 255,0,1,1,0 +complex={ia} ++fx_highpass[0] 2,2,0,0,0 +tk_fx_replace_color. $foctol,0,128,128,128,255,0,0,0,255 +fx_morpho. 3,$focmorph,0,0,0,1,0 to_gray. +av={ia} var={iv} +if $av<=$focavt" || "($av>=$focavt" && "$av<=$focavt2" && "$var<=$focvart) +ir. $av,255 n. 0,255 blur_xy. 10 else fc. 128,128,128 fi ++fx_gradient_norm[0] 0,0.5,0,50,0,0 +rm[0] +fx_compose_overlay[-7,-6] 0.5 +fx_compose_overlay[-6,-5] $featinfl +fx_compose_value[-5,-4] $crmix2 +rv[-4,-3] +if $complex!=0 fx_compose_overlay[-4,-3] $geostr else rm... fi +rv[-3,-2] +fx_compose_overlay[-3,-2] $focstr +rv[-2,-1] +fx_compose_lighten[-1,-2] $latinhib +blur_xy. 2 fx_morpho. 3,20,0,0,0,1,0 +fx_segment_watershed. 15,0,0 n. 0,255 +blur_y. 2 blur_x. 1 +resize $sizew,$sizeh,2 +done done +fx_tk_deana : +repeat $! l[$>] to_rgb +s c rm. +to_rgb[-1,-2] rgb2lab[-1,-2] channels[-1,-2] 0 +rgb2lab[0] s[0] c blur_x[1,2] $1 +c[-1,-2] {0,im},{0,iM} +apply_gamma. {($2^({0,ia}/ia)-$2)*$2+1} +apply_gamma.. {($2^({0,ia}/{-2,ia})-$2)*$2+1} +[1,2] rm[0] mv[2] 0 +a[0,1,2] c a[1,2,3] c lab2rgb[0,1] +done done +fx_tk_depthmap : +repeat $! l[$>] to_rgb size1={w} resize2dx 400,2 +if $8!=0 fx_map_tones_fast {$8*4},{$9/5},3,0 fi +if $1==0 +fx_tk_autodepth. ++luminance[0] fx_map_tones. 1,0.25,0,30,3,0 +rv[-1,-2] fx_compose_value[-1,-2] 0.15 +tk_fx_channel_processing. 1,{$2/20},0,0,0,0,100,256,0,0,0,2,0,0 +elif $1==1 +channels[0] 2 +tk_fx_channel_processing. 1,{{$2/25}+0.1},0,0,0,0,100,256,0,1,0,2,0,0 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,0,{100-{$2/1.5}} +rv[-1,-2] fx_compose_lighten[-1,-2] {0.5+{$2/200}} +elif $1==2 +s. c fx_dog. 0.4,0,0,0,0 +negate.. fx_dog... 0.4,0,0,0,0 +fx_compose_alpha[-1,-2] 0.44,0 +fx_compose_alpha[-1,-2] 0.44,0 +tk_fx_channel_processing. 1,{$2/20},0,0,0,0,100,256,0,0,0,2,0,0 +elif $1==3 +luminance. +tk_fx_channel_processing. 1,{$2/25},0,0,0,0,100,256,0,0,0,2,0,0 +elif $1==4 +luminance. negate. +tk_fx_channel_processing. 1,{$2/25},0,0,0,0,100,256,0,0,0,2,0,0 +elif $1==5 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,0,{100-$2} +elif $1==6 ++fx_radial_gradient. 0,0,0,255,255,255,255,255,1,$2,100,50,50 +elif $1==7 ++fx_radial_gradient. 0,0,0,255,255,255,255,255,0,0,{100-$2},50,50 +elif $1==8 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,1,0,$2,100 +elif $1==9 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,1,315,$2,100 +elif $1==10 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,0,0,{100-$2} +elif $1==11 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,45,0,{100-$2} +elif $1==12 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,0,50,{100-{$2/2}} ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,180,50,{100-{$2/2}} +compose_lighten[-1,-2] +elif $1==13 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,1,180,100,{50+{$2/2}} ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,180,{50-{$2/2}},0 +compose_darken[-1,-2] +elif $1==14 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,50,{100-{$2/2}} ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,270,50,{100-{$2/2}} +compose_lighten[-1,-2] +elif $1==15 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,180,50,{100-{$2/2}} ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,50,{100-{$2/2}} +compose_lighten[-1,-2] +elif $1==16 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,0,50,{100-{$2/2}} ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,50,{100-{$2/2}} +compose_lighten[-1,-2] +elif $1==17 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,0,50,{100-{$2/4}} ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,180,50,{100-{$2/4}} +compose_lighten[-1,-2] ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,0,{100-{$2/2}} +compose_lighten[-1,-2] +elif $1==18 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,0,50,{100-{$2/4}} ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,180,50,{100-{$2/4}} +compose_lighten[-1,-2] ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,0,{100-{$2/4}} +compose_lighten[-1,-2] ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,270,50,{100-{$2/4}} +compose_lighten[-1,-2] +elif $1==19 +channels. 0 +tk_fx_channel_processing. 1,{$2/25},0,0,0,0,100,256,0,0,0,2,0,0 ++fx_radial_gradient. 0,0,0,255,255,255,255,255,1,$2,100,50,50 +rv[-1,-2] compose_multiply[-1,-2] +elif $1==20 ++fx_gaussian_blur. $6,0,0,1,0,0,0 +fx_edges. {$4/2},{50-{$2/2}},1,0 ++fx_gradient_norm[0] {$4/2},{1.5-{$2/67}},0,{100-$2},0,0 +rv[-1,-2] compose_lighten[-1,-2] +channels[0] 0 +tk_fx_channel_processing. 1,{{$2/25}+1},0,0,0,0,100,256,0,0,0,2,0,0 +rv[-1,-2] compose_lighten[-1,-2] ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,0,50,{100-{$2/4}} ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,180,50,{100-{$2/4}} +compose_lighten[-1,-2] ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,0,{100-{$2/2}} +compose_lighten[-1,-2] rv[-1,-2] compose_lighten[-1,-2] +elif $1==21 +fx_gaussian_blur. $4,0,0,1,0,0,0 +fx_edges. {$4/2},{50-{$2/2}},1,0 ++fx_gradient_norm[0] {$4/2},{1.5-{$2/67}},0,{100-$2},0,0 +rv[-1,-2] compose_lighten[-1,-2] +channels[0] 0 +tk_fx_channel_processing. 1,{{$2/25}+0.5},0,0,0,0,100,256,0,0,0,2,0,0 +rv[-1,-2] compose_lighten[-1,-2] ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,0,0,{100-$2} ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,180,0,{100-$2} +compose_darken[-1,-2] rv[-1,-2] compose_darken[-1,-2] ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,75,{100-{$2/4}} +rv[-1,-2] fx_compose_lighten[-1,-2] 0.5 +elif $1==22 +fx_gaussian_blur. $4,0,0,1,0,0,0 +fx_edges. {$4/2},{50-{$2/2}},1,0 ++fx_gradient_norm[0] {$4/2},{1.5-{$2/67}},0,{100-$2},0,0 +rv[-1,-2] compose_lighten[-1,-2] +channels[0] 0 +tk_fx_channel_processing. 1,{{$2/25}+0.5},0,0,0,0,100,256,0,0,0,2,0,0 +rv[-1,-2] compose_lighten[-1,-2] +elif $1==23 +channels. 0 +tk_fx_channel_processing. 1,{$2/25},0,0,0,0,100,256,0,0,0,2,0,0 +elif $1==24 +fc. 0,0,0 +fi +if $7!=0 ++fc[0] 128,128,128 +channels[0] 2 negate. c. 0,90 +n. 0,128 rv[-1,-2] compose_darken[-1,-2] ++channels[0] 0 negate. c. 165,255 n. 128,255 rv[-1,-2] +compose_hardlight[-1,-2] rv[-1,-2] +if $1!=19 fx_compose_average[-1,-2] {$7/5} +else fx_compose_value[-1,-2] {$7/5},0 +tk_fx_channel_processing. 1,{$2/25},0,0,0,0,100,256,0,0,0,2,0,0 +fi fi +if $6!=0 +fx_highpass[0] 2,2,0,0,0 +tk_fx_replace_color. 5,0,128,128,128,255,0,0,0,255 +fx_morpho. 3,70,0,0,0,1,0 to_gray. av={ia} +ir. $av,255 n. 0,255 blur_xy. 25 +rv[-1,-2] fx_compose_overlay[-1,-2] {$6/5} fi +if $3!=0 +fx_isophotes[0] {{$3*3}+2},0,0,0 +fx_morpho. 3,{5-{$3/2}},0,0,0,1,0 +tk_fx_channel_processing. 1,1,255,0,0,0,100,256,0,0,0,2,0,0 +rv[-1,-2] fx_compose_overlay[-1,-2] {$3/10} ++fx_gradient_norm[0] {$4*2},{1.5-{0.1+{$3/3.6}}},0,100,0,0 +rv[-1,-2] compose_lighten[-1,-2] fx_segment_watershed. $3,$4,0,0 +fi +blur_y. $10 blur_x. {$10/2} +if $5!=0 +luminance[0] fx_map_tones. 1,{0.25-{$5/20}},0,30,3,0 +rv[-1,-2] fx_compose_overlay[-1,-2] {$5/10} fi +n. 0,255 rm[0] resize2dx $size1,2 done done +fx_tk_depth_obtain : +if $!<=1 return fi +l +to_rgb size1={w} size2={h} resize2dx 400,2 +if $1==1 rv fi +if $3!=100 +fx_frame_round_old 10,{100-$3},$4,0,255,255,255,255,0,0.1,3 +fi +displacement[0] [1],$2 +rm[1] +channels 0 +n 0,255 +r $size1,$size2 done +fx_tk_lenticular : +if $!<=1 return fi +frames={$!} index=0 if $4==0 length=$3 else length={$3/2.54} fi +lenses={$length*$1} lensewidth={w/$lenses} +picstripe={$lensewidth/$frames} x=0 y=0 end={$picstripe} +step={$lensewidth-$picstripe} +if $6==1 +if $picstripe!=int($picstripe) scale={{int($picstripe)+1}/$picstripe} +r {w*$scale},{h*$scale} lensewidth={w/$lenses} picstripe={$lensewidth/$frames} +end={$picstripe} step={$lensewidth-$picstripe} fi fi +to_rgb +fc. 255,255,255 repeat $lenses +if $2==0 +fill. if(x>=$end,0,i) x={$x+$step} end={$end+$step} +fill. if(x>=$end,255,i) x={$x+$picstripe} end={$end+$picstripe} +else +fill. if(y>=$end,0,i) y={$y+$step} end={$end+$step} +fill. if(y>=$end,255,i) y={$y+$picstripe} end={$end+$picstripe} +fi done +repeat $frames-1 +to_gray. ir. 128,256 n. 0,255 +if $2==0 shift. {{$picstripe}*{$frames-{$index+1}}} +else shift. 0,{{$picstripe}*{$frames-{$index+1}}} fi +s[$index] c a[$index,{$index+1},{$index+2},-1] c +index={$index+1} done +repeat $frames-1 rv[0,-2] compose_rgba[0,-2] rv[0,-2] done +if $5==1 to_rgba[0] +if $2==0 shift[0] 0,5 else shift[0] 5,0 fi +negate. rv compose_rgba else rm. fi +fx_tk_stereogram : +repeat $! l[$>] to_gray +fc. 255,255,255 +fx_plasma. $2,$3,8,0,0,128,128,128 +fx_array. 10,10,0,0,0,0 +fx_array_fade. {$5/10},{$5/10},0,0,80,90,3,0 +r. [0],[0] +fx_noise. {w/30},0,3,0,0 ++fx_rorschach. $4,1,0 rv[-1,-2] fx_compose_multiply[-1,-2] 0.5 ++fx_corner_gradient. $6,$7,$8,255,$9,$10,$11,255,$12,$13,$14,255,$15,$16,$17,255 +rv[-1,-2] fx_compose_hardlight[-1,-2] $18 +rv[-1,-2] +r. 100%,100%,1,2 +s. c f. 0 n.. 0,$1 a[-1,-2] c +warp.. .,1 +rm. done done +fx_tk_stereogram_preview : +gui_split_preview "fx_tk_stereogram ${1--2}",$-1 +gcd_stereo_img : skip ${1=0},${2=2},${3=1.2},${4=1},${5=0.25},${6=2},${7=4},${8=1},${9=0} +repeat $! l[$>] +to_rgb[0] b={abs($3%*w*$4)} ++gcd_depth[0] $5,$6,$7,$8 +gcd_stereo[0,1] $1,$2,$3%,$4 +if !$1" && "$9 z. $b,{w-1-$b} fi +done done +gcd_depth : skip ${1=0.25},${2=2},${3=4},${4=1} +repeat $! l[$>] +if w>h if w>700 +r. 700,{h*700/w} else [0] fi +elif {0,h>700} +r. {0,w*700/h},700 else [0] fi +median. 7 gcd_segment_ch0. 1 +if $4 gcd_label. $3 else label. $3,1 fi +c. 0,255 b. 0.45% n. 0,$2 r. [0],[0] +norm[0] n[0] 0,1 +[-2,-1] b. $1% n. 0,255 +done done +gcd_segment_ch0 : check "${1=1}>=0" +repeat $! l[$>] +min={im} + {1+$min} +gradient_norm channels[0] 0 ++f. "if(i<$1 && i0 gcd_balance_anaglyph[0] {2-$2} fi +i[1] [0] warp[0] .,1 *. -1 warp[1] .,1 rm. +if $1 rv[0,1] append[0,1] x else shift[0] {round(-$wfac*$4)} shift[1] {round($wfac*$4)} +channels[0] 0 channels[1] 1,2 append[0,1] c +fi +done +gcd_balance_anaglyph : skip ${1=1},${2=0.43},${3=0.45} +l. sh 0,0 sh[0] 1,1 sh[0] 2,2 +-[2] [1] inv={255^(1-$1)*$2} +if $1>1 +sign. abs.. ^.. $1 *.. $inv *[-2,-1] else *. $2 fi +-[2,3] . *. {1/$2-1} +[1,-1] +*[3] 0.65 -. [1] max. 0 *. $3 +-[3] . *. {1/$3-1} +[1,-1] apply_gamma[1] 1.15 rm[1-3] c 0,255 +done +fx_tk_stereoimage : +if $!<=1 return fi +local to_rgb +if $1==0" || "$1==1" || "$1==2" || "$1==3" || "$1==4" || "$1==5 apply_gamma $3 fi +if $1==0 if $2==0 rv[-1,-2] fi s c +rm[-3,-4,-5] a[-1,-2,-3] c +elif $1==1 if $2==1 rv[-1,-2] fi +apply_gamma. 1.15 apply_gamma.. 1.0 s c +rlr=456 rlg=500 rlb=176 rrr={-43} rrg={-88} rrb={-2} +glr={-40} glg={-38} glb={-16} grr=378 grg=734 grb={-18} +blr={-15} blg={-21} blb={-5} brr={-72} brg={-113} brb=1226 +[0-5] +*... $rlr *.. $rlg *. $rlb *[-6] $rrr *[-5] $rrg *[-4] $rrb ++[-6] [-5] +[-6] [-4] +[-6] ... +[-6] .. +[-6] . rm[-1--5] +/. 1000 n. 0,255 to_gray. +[0-5] +*... $glr *.. $glg *. $glb *[-6] $grr *[-5] $grg *[-4] $grb ++[-6] [-5] +[-6] [-4] +[-6] ... +[-6] .. +[-6] . rm[-1--5] +/. 1000 n. 0,255 to_gray. +[0-5] +*... $blr *.. $blg *. $blb *[-6] $brr *[-5] $brg *[-4] $brb ++[-6] [-5] +[-6] [-4] +[-6] ... +[-6] .. +[-6] . rm[-1--5] +/. 1000 n. 0,255 to_gray. +k[-1--3] a[-1,-2,-3] c +elif $1==2 if $2==0 rv[-1,-2] fi s c +rm[-6,-5,-1] mv[0] 3 a[-1,-2,-3] c +elif $1==3 if $2==1 rv[-1,-2] fi +apply_gamma. 0.9 apply_gamma.. 1.25 s c +rrr=1062 rrg={-205} rrb=299 rlr={-16} rlg={-123} rlb={-17} +grr={-26} grg=908 grb=68 glr=6 glg=62 glb={-17} +brr={-38} brg={-173} brb=22 blr=94 blg=185 blb=911 +[0-5] +*... $rlr *.. $rlg *. $rlb *[-6] $rrr *[-5] $rrg *[-4] $rrb ++[-6] [-5] +[-6] [-4] +[-6] ... +[-6] .. +[-6] . rm[-1--5] +/. 1000 n. 0,255 to_gray. +[0-5] +*... $glr *.. $glg *. $glb *[-6] $grr *[-5] $grg *[-4] $grb ++[-6] [-5] +[-6] [-4] +[-6] ... +[-6] .. +[-6] . rm[-1--5] +/. 1000 n. 0,255 to_gray. +[0-5] +*... $blr *.. $blg *. $blb *[-6] $brr *[-5] $brg *[-4] $brb ++[-6] [-5] +[-6] [-4] +[-6] ... +[-6] .. +[-6] . rm[-1--5] +/. 1000 n. 0,255 to_gray. +k[-1--3] a[-3,-2,-1] c +elif $1==4 if $2==0 rv[-1,-2] fi s c +rm[-1,-3,-5] mv. -2 a[-3,-2,-1] c +elif $1==5 if $2==1 rv[-1,-2] fi s c +apply_gamma. 1 apply_gamma.. 1.15 s c +rrr={-62} rrg={-158} rrb={-39} rlr={529} rlg={705} rlb={24} +grr={284} grg=668 grb=143 glr={-16} glg={-15} glb={-65} +brr={-15} brg={-27} brb=21 blr=9 blg=75 blb=937 +[0-5] +*... $rlr *.. $rlg *. $rlb *[-6] $rrr *[-5] $rrg *[-4] $rrb ++[-6] [-5] +[-6] [-4] +[-6] ... +[-6] .. +[-6] . rm[-1--5] +/. 1000 n. 0,255 to_gray. +[0-5] +*... $glr *.. $glg *. $glb *[-6] $grr *[-5] $grg *[-4] $grb ++[-6] [-5] +[-6] [-4] +[-6] ... +[-6] .. +[-6] . rm[-1--5] +/. 1000 n. 0,255 to_gray. +[0-5] +*... $blr *.. $blg *. $blb *[-6] $brr *[-5] $brg *[-4] $brb ++[-6] [-5] +[-6] [-4] +[-6] ... +[-6] .. +[-6] . rm[-1--5] +/. 1000 n. 0,255 to_gray. +k[-1--3] a[-3,-2,-1] c +elif $1==6 if $2==1 rv[-1,-2] fi +r[-1,-2] 50%,50%,1,3,6 a[-1,-2] x +elif $1==7 if $2==1 rv[-1,-2] fi a[-1,-2] x +elif $1==8 if $2==1 rv[-1,-2] fi a[-1,-2] y +elif $1==9 if $2==1 rv[0,1] fi +r[0,1] 50%,100%,1,3,6 a[0,1] x +elif $1==10 if $2==1 rv[0,1] fi +r[0,1] 100%,50%,1,3,6 a[0,1] y +elif $1==11 to_rgba[0,1] +if $2==1 rv[0,1] fi +fill[0] if(y%2==0,0,i) rv[0,1] compose_rgba[0,1] to_rgb +elif $1==12 to_rgba[0,1] +if $2==1 rv[0,1] fi +fill[0] if(x%2==0,0,i) rv[0,1] compose_rgba[0,1] to_rgb +elif $1==13 +if $2==1 rv[0,1] fi +r[0,1] 1920,1080,1,3,6 +fc. 0,0,0 r. 1920,45 +rv[-1,-2] a[-1,-2] y a[-1,-2] y +fi c 0,255 +if $1==6" || "$1==7" || "$1==8" || "$1==9" || "$1==10" || "$1==11" || "$1==12" || "$1==13 +apply_gamma $3 fi +fx_mix_lab 1,0,0,$5,0,0,$5,0,0,0,2,0 +if $1==0" || "$1==1 fx_mix_rgb 1,$6,0,1,0,0,1,0,0,0,2,0 fi +if $1==2" || "$1==3 fx_mix_rgb 1,0,0,1,0,0,1,$6,0,0,2,0 fi +if $1==4 fx_mix_rgb 1,0,0,1,$6,0,1,0,0,0,2,0 fi +if $1==5 fx_mix_rgb 1,0,0,1,$6,0,1,{if({$6>=0},$6,0)},0,0,2,0 fi +done +gcd_unstereo : skip ${1=5},${2=0.1},${3=0},${4=1},${5=1},${6=1},${7=0},${8=0} +repeat $! l[$>] +if $4" && "$8 pr=1 else pr=$1 fi +to_rgb[0] split_tiles[0] $5,$6 +repeat $! l[$>] +s[0] c +equalize[0,1] 256 ++displacement.. .,$2,$pr +if $3 sh. 1,1 f. 0 rm. fi +/. 2 warp[1,2] .,1 *. -1 warp[0] .,1 +k[0-2] a c c[0] 0,255 +done done +append_tiles $5,$6 +done done +gcd_unstereo_preview : +gui_split_preview "gcd_unstereo ${1--1},1",$-1 +#@cli afre_contrastfft : 1<=strength<=100,0<=_amount<=100,1<=_iterations<=10 +#@cli : Enhance contrast for selected images with Fourier transform. +#@cli : Default values: 'strength=75', 'amount=50' and 'iterations=1'. +afre_contrastfft : check "${1=75}>=1 && ${2=50}>=0 && ${3=1}>=1 && +$1<=100 && $2<=100 && $3<=10" +e[] "[afre]^_^) contrastfft: Enhance contrast for image$? with Fourier transform using strength=$1, amount=$2 and iterations=$3." +repeat $! l[$>] repeat $3 ++fftpolar ^.. {($1-0.5)/100} ifftpolar[^0] afre_softlight $2 +done done done +afre_contrastfft_preview : +afre_contrastfft $* +#@cli afre_denoise : radius>=1 +#@cli : Denoise selected images. +#@cli : Default value: 'radius=1'. +afre_denoise : check ${1=1}>=1 +e[] "[afre]^_^) denoise: Denoise image$? using radius=$1." +repeat $! l[$>] r={[im,iM]} +. repeat 4 +. repeat $1 afre_gui0_fast. {$>+1},1e0 done n. {0,[im,iM]} ++laplacian.. abs. n. 0,1 +^. {.2+.2*($>+1)} blend_fade[1,2] . k[0,1] +done +afre_gui1_fast. ..,1,0 rm.. +c $r done done +afre_denoise_preview : +afre_denoise $* +#@cli ::Features +#@cli afre_norm : _keep_channels={ 0 | 1 } +#@cli : Compute normalized norms of selected images. +#@cli : Default value: 'keep_channels=1'. +afre_norm : skip ${1=1} +l[] if isnum("$1") k={$1?1} elif ["'$1'"]!=',' noarg k=1 fi done +s1="s" e[] "[afre]^_^) norm: Compute normalized norm"${s{$!>1}}" of image$? using keep_channels="$k"." +repeat $! l[$>] s={s} if $s>1 +sqr s c + sqrt / {sqrt($s)} if $k r 100%,100%,100%,$s fi +fi done done +#@cli afre_y50 : colour_space={ 0=Rec.709 | 1=Rec.2020 } +#@cli : Compute luminance (D50) of selected images. +#@cli : Default value: 'colour_space=1'. +afre_y50 : check isbool(${1=1}) +if $1 Y="Rec.2020" else Y="Rec.709" fi +e[] "[afre]^_^) y50: Compute luminance (D50 "$Y") of image$?." +repeat $! l[$>] +if s==3 sh 0 sh[0] 1 sh[0] 2 +if $1 *[1] 0.2790177 *[2] 0.6753402 *[3] 0.0456377 +else *[1] 0.22248840 *[2] 0.71690369 *[3] 0.06060791 +fi +[1-3] rm[1] channels 0 +elif s!=1 r={[im,iM]} norm n $r fi +done done +#@cli afre_orien : _mode={ 0=norm | 1=Rec.709 | 2=Rec.2020 } +#@cli : Compute orientation of selected images. +#@cli : Default value: 'mode=0'. +afre_orien : skip ${1=0} +l[] if isnum("$1") m={inrange($1,0,2)?int($1):0} elif ["'$1'"]!=',' noarg m=0 fi done +s0,s$m="norm" s1="luminance Rec.709 D50" s2="luminance Rec.2020 D50" e[] "[afre]^_^) orien: Compute orientation of image$? using "${s$m}"." +repeat $! if $m +afre_y50[$>] {$m-1} else +afre_norm[$>] fi +replace. 0,1 /[$>,-1] done +#@cli afre_gradientnorm : _keep_channels={ 0 | 1 },_keep_range={ 0 | 1 } +#@cli : Compute normalized gradient norms of selected images. +#@cli : Default values: 'keep_channels=1' and 'keep_range=0'. +afre_gradientnorm : skip ${1=1},${2=0} +l[] if isnum("$1")&&isnum("$2") k={$1?1} r={$2?1} elif ["'$1'"]!=',' noarg k,r=1,0 fi done +s1="s" e[] "[afre]^_^) gradientnorm: Compute normalized gradient norm"${s{$!>1}}" of image$? using keep_channels="$k" and keep_range="$r"." +repeat $! l[$>] iM,s={[iM,s]} +g sqr s c + sqrt / {iM/($r?$iM:1)} if $k r 100%,100%,100%,$s fi +done done +#@cli afre_hessiannorm : _keep_channels={ 0 | 1 },_keep_range={ 0 | 1 } +#@cli : Compute normalized hessian norms of selected images. +#@cli : Default values: 'keep_channels=1' and 'keep_range=0'. +afre_hessiannorm : skip ${1=1},${2=0} +l[] if isnum("$1")&&isnum("$2") k={$1?1} r={$2?1} elif ["'$1'"]!=',' noarg k,r=1,0 fi done +s1="s" e[] "[afre]^_^) hessiannorm: Compute normalized hessian norm"${s{$!>1}}" of image$? using keep_channels="$k" and keep_range="$r"." +repeat $! l[$>] iM,s={[iM,s]} +hessian sqr s c + sqrt / {iM/($r?$iM:1)} if $k r 100%,100%,100%,$s fi +done done +#@cli afre_gnorm +#@cli : Compute custom gradient norm of selected images. +afre_gnorm : +e[] "[afre]^_^) gnorm: Compute custom gradient norm of image$?." +repeat $! l[$>] nm={b} ++gradient_norm r={[im,iM]} +afre_hnorm[0] afre_gui1_fast[2] [0] rm[0] +c. 20%,100% n 0,1 *. 0.75 max n $r +nm $nm done done +#@cli afre_hnorm +#@cli : Compute Hessian norm of selected images. +afre_hnorm : +e[] "[afre]^_^) hnorm: Compute Hessian norm of image$?." +repeat $! l[$>] hessian sqr s c + sqrt done done +#@cli afre_sdpatch : radius>=1 +#@cli : Compute local standard deviation of selected images. +#@cli : Default value: 'radius=1'. +afre_sdpatch : skip ${1=1} +rd={int($1)} e[] "[afre]^_^) sdpatch: Compute local standard deviation of image$? using radius="$rd"." +repeat $! l[$>] +gradient_norm r={[im,iM]} rm. ++sqr afre_box_fast $rd sqr.. rv - max 0 sqrt +n $r done done +#@cli afre_jchz +#@cli : Convert selected images from RGB to JzCzhz. +afre_jchz : +e[] "[afre]^_^) jchz: Convert image$? from RGB to JzCzhz." +rgb2jzazbz 0 r 100%,100%,100%,3 repeat $! l[$>] +s c complex2polar[-2,-1] a c +done done +#@cli afre_ijchz +#@cli : Convert selected images from JzCzhz to RGB. +afre_ijchz : +e[] "[afre]^_^) ijchz: Convert image$? from JzCzhz to RGB." +r 100%,100%,100%,3 repeat $! l[$>] +s c polar2complex[-2,-1] a c +done done jzazbz2rgb 0 +#@cli ::Filtering +#@cli afre_conv : [kernel] +#@cli : Convolve selected images with a custom kernel. +afre_conv : check ${is_image_arg\ $1} +repeat $! pass$1 0 +e[] "[afre]^_^) conv: Convolve image$? using ["${"-pass$1 -1"}"]." +l[$>,-1] +f[0] 1 mv. 1 ++rows. 50% columns.. 50% +convolve[1] [2] convolve[4] [3] +convolve[0] [2] convolve[0] [3] k[0,4] / done +done +#@cli afre_box : radius>=1,_gaussian={ 0 | 1 } +#@cli : Blur selected images with a soft box filter. +#@cli : Default values: 'radius=1' and 'gaussian=1'. +afre_box : check "${1=1}>=1 && isbool(${2=1})" +rd={int($1)} if $2 g="soft box" else g="box" fi w={$rd*2+1} +e[] "[afre]^_^) box: Blur image$? with a "${w}"x"${w}" "$g" filter." +repeat $! l[$>] +$w,$w f. 1 if $2 gaussian. {100/3}% fi afre_conv.. . rm. +done done +#@cli afre_box_fast : radius>=1 +#@cli : Blur selected images with a soft box filter. Faster version. +#@cli : Default value: 'radius=1'. +afre_box_fast : check ${1=1}>=1 +rd={int($1)} w={$rd*2+1} e[] "[afre]^_^) box: Blur image$? with a "${w}"x"${w}" soft box filter." +repeat $! l[$>] boxfilter $w,0,1,3 done done +#@cli afre_gui0 : radius>=1,_smoothing>=0,0<=_structure<=10 +#@cli : Blur selected images with a custom self-guided filter. +#@cli : Default values: 'radius=1', 'smoothing=1e-2' and 'structure=10'.\n +#@cli : - Use orders of magnitude for 'smoothing'. +#@cli : - Reduce 'structure' to soften edges and artifacts. +#@cli : * Improvement of "K He, J Sun, X Tang. Guided image filtering. TPAMI, 35(6):1397-1409, 2013". +afre_gui0 : check "${1=1}>=1 && ${2=1e-2}>=0 && ${3=10}>=0 && $3<=10" +rd={int($1)} kwh={sqr($rd*2+1)} str={1e{-$3+2}} +e[] "[afre]^_^) gui0: Blur image$? with a custom self-guided filter using radius="$rd", smoothing=$2 and structure=$3." +repeat $! l[$>] nm={b} iM={iM} / $iM +. +sqr. afre_box[^0] $rd nm I,mI,mII ++sqr[mI] *. -1 +. [mII] rm[mII] => vI ++l[vI] abs s c + done *. $kwh +. $str ^. -1 *. $str => W +++[vI] {vI,$2*ia+1e-6} /[vI] . rm. =>[vI] a ++*[a] [mI] *. -1 +. [mI] rm[mI] => b +*[a,b] [W] afre_box[^0] $rd =>[^0] ma,mW,mb +*[I] [ma] +[I] [mb] /[I] [mW] k[I] +* $iM nm $nm done done +#@cli afre_gui1 : [guide],_radius>=1,_smoothing>=0,0<=_structure<=10 +#@cli : Blur selected images with a custom guided filter. +#@cli : Default values: 'radius=1', 'smoothing=0' and 'structure=5'.\n +#@cli : - Use orders of magnitude for 'smoothing'. +#@cli : - Reduce 'structure' to soften edges and artifacts. +#@cli : * Improvement of "K He, J Sun, X Tang. Guided image filtering. TPAMI, 35(6):1397-1409, 2013". +afre_gui1 : check ${is_image_arg\ $1}" && ${2=1}>=1 && ${3=0}>=0 && ${4=5}>=0 && $4<=10" +rd={int($2)} kwh={sqr($rd*2+1)} str={1e{-$4+2}} +e[] "[afre]^_^) gui1: Blur image$? with a custom guided filter using guide=["${"-pass$1 -1"}"], radius="$rd", smoothing=$3 and structure=$4." +pass$1 0 to_colormode 0 +repeat $! if $>!=$! nm$>={$>,b} fi iM$>={$>,iM} /[$>] ${iM$>} done +repeat $!-1 l[$>,-1] +if w#0!=w#1||h#0!=h#1||d#0!=d#1 error[] "\n[afre]>_<) gui1: Image$? and guide ["${"-pass$1 -1"}"] must have the same width, height and depth." fi +. rv +*[1] [2] +sqr[1] afre_box[^0] $rd nm I,mI,mp,mIp,mII ++*[mI] [mp] *. -1 +. [mIp] rm[mIp] => cIp ++sqr[mI] *. -1 +. [mII] rm[mII] => vI ++normp[vI] 1 *. $kwh +. $str ^. -1 *. $str => W +++[vI] {vI,$3*ia+1e-6} /[cIp] . rm[vI,-1] =>[cIp] a ++*[a] [mI] *. -1 +. [mp] rm[mI,mp] => b +*[a,b] [W] afre_box[^0] $rd =>[^0] ma,mW,mb +*[ma] [I] +[ma] [mb] /[ma] [mW] k[I,ma] +=>[ma] ${nm$>} rv +done done rm. +repeat $! *[$>] ${iM$>} done +#@cli afre_gui0c : [kernel],_smoothing>=0,0<=_structure<=10 +#@cli : Convolve selected images with a custom self-guided filter. +#@cli : Default values: 'smoothing=1e-2' and 'structure=10'.\n +#@cli : - Use orders of magnitude for 'smoothing'. +#@cli : - Reduce 'structure' to soften edges and artifacts. +#@cli : * Improvement of "K He, J Sun, X Tang. Guided image filtering. TPAMI, 35(6):1397-1409, 2013". +afre_gui0c : check ${is_image_arg\ $1}" && ${2=1e-2}>=0 && ${3=10}>=0 && $3<=10" +e[] "[afre]^_^) gui0c: Convolve image$? with a custom self-guided filter using kernel=["${"-pass$1 -1"}"], smoothing=$2 and structure=$3." +str={1e{-$3+2}} +repeat $! pass$1 0 kwh={wh} l[$>,-1] nm={0,b} iM={0,iM} /[0] $iM +[0] +sqr. afre_conv[^0-1] [1] nm I,k,mI,mII ++sqr[mI] *. -1 +. [mII] rm[mII] => vI ++l[vI] abs s c + done *. $kwh +. $str ^. -1 *. $str => W +++[vI] {vI,$2*ia+1e-6} /[vI] . rm. =>[vI] a ++*[a] [mI] *. -1 +. [mI] rm[mI] => b +*[a,b] [W] afre_conv[^0-1] [k] =>[^0-1] ma,mW,mb +*[I] [ma] +[I] [mb] /[I] [mW] k[I] +* $iM nm $nm done done +#@cli afre_gui1c : [guide],[kernel],_smoothing>=0,0<=_structure<=10 +#@cli : Convolve selected images with a custom guided filter. +#@cli : Default values: 'smoothing=0' and 'structure=5'.\n +#@cli : - Use orders of magnitude for 'smoothing'. +#@cli : - Reduce 'structure' to soften edges and artifacts. +#@cli : * Improvement of "K He, J Sun, X Tang. Guided image filtering. TPAMI, 35(6):1397-1409, 2013". +afre_gui1c : check ${is_image_arg\ $1}" && "${is_image_arg\ $2}" && ${3=0}>=0 && ${4=5}>=0 && $4<=10" +e[] "[afre]^_^) gui1c: Convolve image$? with a custom guided filter using guide=["${"-pass$1 -1"}"], kernel=["${"-pass$2 -1"}"], smoothing=$3 and structure=$4." +pass$1 0 to_colormode 0 str={1e{-$4+2}} +repeat $! if $>!=$! nm$>={$>,b} fi iM$>={$>,iM} /[$>] ${iM$>} done +repeat $!-1 pass$2 0 kwh={wh} l[$>,-2--1] +if w#0!=w#1||h#0!=h#1||d#0!=d#1 error[] "\n[afre]>_<) gui1c: Image$? and guide ["${"-pass$1 -1"}"] must have the same width, height and depth." fi +[1] rv +*[2] [3] +sqr[2] afre_conv[^0-1] [1] nm I,k,mI,mp,mIp,mII ++*[mI] [mp] *. -1 +. [mIp] rm[mIp] => cIp ++sqr[mI] *. -1 +. [mII] rm[mII] => vI ++normp[vI] 1 *. $kwh +. $str ^. -1 *. $str => W +++[vI] {vI,$3*ia+1e-6} /[cIp] . rm[vI,-1] =>[cIp] a ++*[a] [mI] *. -1 +. [mp] rm[mI,mp] => b +*[a,b] [W] afre_conv[^0-1] [k] =>[^0-1] ma,mW,mb +*[ma] [I] +[ma] [mb] /[ma] [mW] k[I,ma] +=>[ma] ${nm$>} rv +done done rm. +repeat $! *[$>] ${iM$>} done +#@cli afre_gui0_fast : radius>=1,_smoothing>=0,0<=_structure<=10 +#@cli : Blur selected images with a custom self-guided filter. Faster version. +#@cli : Default values: 'radius=1', 'smoothing=1e-2' and 'structure=10'.\n +#@cli : - Use orders of magnitude for 'smoothing'. +#@cli : - Reduce 'structure' to soften edges and artifacts. +#@cli : * Improvement of "K He, J Sun, X Tang. Guided image filtering. TPAMI, 35(6):1397-1409, 2013". +afre_gui0_fast : check "${1=1}>=1 && ${2=1e-2}>=0 && ${3=10}>=0 && $3<=10" +rd={int($1)} kwh={sqr($rd*2+1)} str={1e{-$3+2}} +e[] "[afre]^_^) gui0_fast: Blur image$? with a custom self-guided filter using radius="$rd", smoothing=$2 and structure=$3. Faster version." +repeat $! l[$>] nm={b} iM={iM} / $iM +. +sqr. afre_box_fast[^0] $rd nm I,mI,mII ++sqr[mI] *. -1 +. [mII] rm[mII] => vI ++l[vI] abs s c + done *. $kwh +. $str ^. -1 *. $str => W +++[vI] {vI,$2*ia+1e-6} /[vI] . rm. =>[vI] a ++*[a] [mI] *. -1 +. [mI] rm[mI] => b +*[a,b] [W] afre_box_fast[^0] $rd =>[^0] ma,mW,mb +*[I] [ma] +[I] [mb] /[I] [mW] k[I] +* $iM nm $nm done done +#@cli afre_gui1_fast : [guide],_radius>=1,_smoothing>=0,0<=_structure<=10 +#@cli : Blur selected images with a custom guided filter. Faster version. +#@cli : Default values: 'radius=1', 'smoothing=0' and 'structure=5'.\n +#@cli : - Use orders of magnitude for 'smoothing'. +#@cli : - Reduce 'structure' to soften edges and artifacts. +#@cli : * Improvement of "K He, J Sun, X Tang. Guided image filtering. TPAMI, 35(6):1397-1409, 2013". +afre_gui1_fast : check ${is_image_arg\ $1}" && ${2=1}>=1 && ${3=0}>=0 && ${4=5}>=0 && $4<=10" +rd={int($2)} kwh={sqr($rd*2+1)} str={1e{-$4+2}} +e[] "[afre]^_^) gui1_fast: Blur image$? with a custom guided filter using guide=["${"-pass$1 -1"}"], radius="$rd", smoothing=$3 and structure=$4. Faster version." +pass$1 0 to_colormode 0 +repeat $! if $>!=$! nm$>={$>,b} fi iM$>={$>,iM} /[$>] ${iM$>} done +repeat $!-1 l[$>,-1] +if w#0!=w#1||h#0!=h#1||d#0!=d#1 error[] "\n[afre]>_<) gui1_fast: Image$? and guide ["${"-pass$1 -1"}"] must have the same width, height and depth." fi +. rv +*[1] [2] +sqr[1] afre_box_fast[^0] $rd nm I,mI,mp,mIp,mII ++*[mI] [mp] *. -1 +. [mIp] rm[mIp] => cIp ++sqr[mI] *. -1 +. [mII] rm[mII] => vI ++normp[vI] 1 *. $kwh +. $str ^. -1 *. $str => W +++[vI] {vI,$3*ia+1e-6} /[cIp] . rm[vI,-1] =>[cIp] a ++*[a] [mI] *. -1 +. [mp] rm[mI,mp] => b +*[a,b] [W] afre_box_fast[^0] $rd =>[^0] ma,mW,mb +*[ma] [I] +[ma] [mb] /[ma] [mW] k[I,ma] +=>[ma] ${nm$>} rv +done done rm. +repeat $! *[$>] ${iM$>} done +#@cli afre_dilateg : [mask],size>=2 +#@cli : Compute geodesic dilation of selected images. +#@cli : Default value: 'size=3'. +afre_dilateg : check ${is_image_arg\ $1}" && ${2=3}>=2" +e[] "[afre]^_^) dilateg: Compute geodesic dilation of image$? using mask=["${"pass$1\ -1"}"] and size=$2." +pass$1 0 repeat $!-1 l[$>,-1] repeat 1000 +ia={ia} +dilate. $2 +min[0,-1] rm[2--2] if $ia==ia break fi +done rm[0] rv done done rm. +#@cli afre_erodeg : [mask],size>=2 +#@cli : Compute geodesic erosion of selected images. +#@cli : Default value: 'size=3'. +afre_erodeg : check ${is_image_arg\ $1}" && ${2=3}>=2" +e[] "[afre]^_^) erodeg: Compute geodesic erosion of image$? using mask=["${"pass$1\ -1"}"] and size=$2." +pass$1 0 repeat $!-1 l[$>,-1] repeat 1000 +ia={ia} +erode. $2 +max[0,-1] rm[2--2] if $ia==ia break fi +done rm[0] rv done done rm. +#@cli afre_openg : size>=2 +#@cli : Compute geodesic opening of selected images. +#@cli : Default value: 'size=3'. +afre_openg : check ${1=3}>=2 +e[] "[afre]^_^) openg: Compute geodesic opening of image$? using size=$1." ++erode $1 repeat 1000 +ia={ia} dilate. $1 +min rm.. if $ia==ia break fi +done k. +#@cli afre_closeg : size>=2 +#@cli : Compute geodesic closing of selected images. +#@cli : Default value: 'size=3'. +afre_closeg : check ${1=3}>=2 +e[] "[afre]^_^) closeg: Compute geodesic closing of image$? using size=$1." ++dilate $1 repeat 1000 +ia={ia} erode. $1 +max rm.. if $ia==ia break fi +done k. +#@cli ::Utilities +#@cli afre_maxmin +#@cli : Return the maximum of channel minimums. +afre_maxmin : +repeat s sh. $> im.={`$>?','`}{im} rm. done u {max($im)} +#@cli afre_minmax +#@cli : Return the minimum of channel maximums. +afre_minmax : +repeat s sh. $> iM.={`$>?','`}{iM} rm. done u {min($iM)} +#@cli afre_compare : crop={ 1=once | 2=twice },_layout={ x | y | z | tile },_normalize={ 0 | 1 } +#@cli : Crop then compare selected images interactively. +#@cli : Default values: 'crop=1', 'layout=x' and 'normalize=1'.\n +#@cli : 1. Interactive Crop +#@cli : \ - Click and drag to select crop. +#@cli : \ - Use scroll button to browse images. +#@cli : \ * Click once or close window to exit command.\n +#@cli : 2. Comparison Window +#@cli : \ - Regular display behaviour. +#@cli : \ - Close window to make another comparison. +afre_compare : check "${1=1}>=1 && $1<=2 && (s='${2=x}';s=='x'||s=='y'||s=='z'||s=='tile') && "isbool(${3=1}) +n={$!-1} if $n<1 error[] "\n[afre]>_<) compare: Please select 2 or more images." fi +repeat $!-1 if w#0!=w#{$>+1}||h#0!=h#{$>+1} error[] "\n[afre]>_<) compare: Please select images with the same width and height." fi done +repeat $! if d#$>!=1 e[] "[afre]>_<) compare: *Slices in image ["$>"] will be considered separate images." fi done +e[] "[afre]^_^) compare: Crop then compare image$? interactively." +e[] "\n 1. Interactive Crop\n +\ - Click and drag to select crop.\n +\ - Use scroll button to browse images.\n +\ * Click once or close window to exit command.\n\n +2. Comparison Window\n +\ - Regular display behaviour.\n +\ - Close window to make another comparison.\n" +to_colormode 0 if $3 n 0,255 fi +do +l =>[0] Compare +a z repeat $1 xz b={w} if $b==1 break fi done +b={w} if '$2'!='z' s z if '$2'!='tile' a $2 else append_tiles 0 fi fi +if $b==1 break else v - d v + fi +done k[0-$n] while $b!=1 v - d[] +#@cli afre_reorder : order,_order2,... +#@cli : Reposition images according to a list of values of any length. +afre_reorder : +e[] "[afre]^_^) reorder: Reposition images according to list $*." +z 0,0,0,100%,100%,1 mirror z f z==0?1e6:i +l ($*) onfail error[] "\n[afre]>_<) reorder: Parameter must be a list of numbers; e.g. 0,2,4,1,3." done +repeat min(w,$!-1) f[$>] z==0?{i($>)}:i done +sort_list[0-{min(w,$!-1)-1}] + rm. z 0,0,1,100%,100%,1 +#@cli afre_log2 : direction={ 0=inverse | 1=forward } +#@cli : Transform selected images into or back from log2 space. +#@cli : Default value: 'direction=1'. +afre_log2 : check isbool(${1=1}) +if $1 d="into" else d="back from" fi +e[] "[afre]^_^) log2: Transform image$? "$d" log2 space." +if $1 + 1 log2 else f exp(i*log(2)) - 1 fi +#@cli afre_section : 1<=xy_sections<=50 +#@cli : Section selected images into numbered regions. +#@cli : Default value: 'xy_sections=20'. +afre_section : check "${1=20}>=1 && $1<=50" +m=min(w,h) err=int($m/25) if $err<$1 error[] "\n[afre]>_<) section: Section image$? into no more than "{max(sqr($err),1)}" ("{max($err,1)}"x"{max($err,1)}") regions." fi +e[] "[afre]^_^) section: Section image$? into "{sqr($1)}" ($1x$1) numbered regions." +repeat $! l[$>] +im,iM={[im,iM]} s yx,$1 repeat $! +t[$>] {$>+1},0.5~,0.5~,{$m*0.55},0.9,$im t[$>] {$>+1},0.5~,0.5~,{$m*0.56},0.9,$iM +done append_tiles $1 +grid {100/$1}%,{100/$1}%,,,0.2,$im +grid {100/$1}%,{100/$1}%,-1,-1,0.2,$iM +done done +#@cli afre_cleanphoto : 2<=size<=10,1<=_recovery<=100,-50<=_xy_sections<=50,_maskN>=1,... +#@cli : Clean dust and scratches from photos. +#@cli : Default values: 'size=3', 'recovery=10', 'xy_sections=1' and 'maskN=1'.\n +#@cli : - 'xy_sections' sections image into MxM labeled regions. +#@cli : \ \ \ For global processing, set 'xy_sections' to 1. +#@cli : \ \ \ To visualize these regions with labels, use a negative number. +#@cli : - 'maskN' is a comma separated list of regions to be processed. +afre_cleanphoto : check "${1=3}>=2 && ${2=10}>=1 && ${3=1}>=-50 && +$1<=10 && $2<=100 && $3<=50" skip ${4=1} +m=min(w,h) err=int($m/25) if $err<$3 error[] "\n[afre]>_<) cleanphoto: Section image$? into no more than "{max(sqr($err),1)}" ("{max($err,1)}"x"{max($err,1)}") regions." fi +m "ip : p=$1,,,{iM} ++erode_threshold $p dilate_threshold. $p afre_gui1_fast. .. c. 0,100% ++afre_edge.. 1,1,4,4 afre_box. 1 c. 0,$2% n. 0,1 +blend_fade[0,1] . k[0,-1] ++gaussian. {[w,h]*0.3} c. 0,50% n. 0,1 blend_fade[0,1] . k[0]" +e[] "[afre]^_^) cleanphoto: Clean dust and scratches from image$? using size=$1, recovery=$2, xy_sections=$3 and masks=${4--1}." +repeat $! l[$>] if $3>1 +iM={iM} w0,h0={[w,h]} w,h={[w,h]/$3} 100%,100%,1,3 l. (${4--1}) +c. 1,{sqr($3)} round. sort. discard. unroll. x +repeat w v={i($>)} i={$v%$3?$v%$3:$3} j={($v+$3-$i)/$3} +r={[$w*$i-$w,$h*$j-$h,$w*$i-1,$h*$j-1]} rectangle[0] $r,1,$iM +done rm. label_fg 0 r {[$w0,$h0]+2},1,3,0,0,0.5,0.5 +repeat iM +==[0] {$>+1} coord=${" +w={w} h={h} val={i(w-1,h-1)} +=. {1+$val},100%,100%,100% +autocrop. =. $val,100%,100%,100% x0={$w-w} y0={$h-h} rm. ++autocrop. x1={$x0+w-1} y1={$y0+h-1} rm. u $x0,$y0,$x1,$y1 +"} rm. ($coord) done +a[^0] y done r[0] {[$w0,$h0]+2},1,3,0,0,0.5,0.5 +repeat h x0,y0,x1,y1={@{[0,1,2,3]+4*$>}} +z[0,1] $x0,$y0,$x1,$y1 ++ip.. f. i#4?i#5:i#3 j[0] .,$x0,$y0 rm[-3--1] +done k[0] r {[$w0,$h0]},1,3,0,0,0.5,0.5 +else ip +fi done done um ip +#@cli afre_cleanphoto1 : 1<=radius<=10,1<=_xy_sections<=50,_maskN>=1,... +#@cli : Clean dust and scratches from photos. +#@cli : Default values: 'radius=3', 'xy_sections=1' and 'maskN=1'.\n +#@cli : - 'xy_sections' sections image into MxM labeled regions. +#@cli : \ \ For global processing, set 'xy_sections' to 1. +#@cli : - 'maskN' is a comma separated list of regions to be processed. +#@cli : \ \ Use 'afre_section' to determine region labels. +afre_cleanphoto1 : check "${1=3}>=1 && ${2=1}>=1 && +$1<=10 && $2<=50" skip ${3=1} +rd={int($1)} m=min(w,h) err=int($m/25) if $err<$2 error[] "\n[afre]>_<) cleanphoto: Section image$? into no more than "{max(sqr($err),1)}" ("{max($err,1)}"x"{max($err,1)}") regions." fi +m "ip : s={"$rd"*2+1} +l +erode_oct $s dilate_oct. $s - c 0,100% ^ 2 +c 5%,10% dilate_oct 3 n 0,1 done +inpaint_pde.. . rm.. ++gaussian. {[w,h]*0.3} c. 0,50% n. 0,1 blend_fade[0,1] . k[0]" +e[] "[afre]^_^) cleanphoto: Clean dust and scratches from image$? using radius="$rd", xy_sections=$2 and maskN=${3--1}." +repeat $! l[$>] if $2>1 +iM={iM} w0,h0={[w,h]} w,h={[w,h]/$2} 100%,100%,1,3 l. (${3--1}) +c. 1,{sqr($2)} round. sort. discard. unroll. x +repeat w v={i($>)} i={$v%$2?$v%$2:$2} j={($v+$2-$i)/$2} +r={[$w*$i-$w,$h*$j-$h,$w*$i-1,$h*$j-1]} rectangle[0] $r,1,$iM +done rm. label_fg 0 r {[$w0,$h0]+2},1,3,0,0,0.5,0.5 +repeat iM +==[0] {$>+1} coord=${" +w={w} h={h} val={i(w-1,h-1)} +=. {1+$val},100%,100%,100% +autocrop. =. $val,100%,100%,100% x0={$w-w} y0={$h-h} rm. ++autocrop. x1={$x0+w-1} y1={$y0+h-1} rm. u $x0,$y0,$x1,$y1 +"} rm. ($coord) done +a[^0] y done r[0] {[$w0,$h0]+2},1,3,0,0,0.5,0.5 +repeat h x0,y0,x1,y1={@{[0,1,2,3]+4*$>}} +z[0,1] $x0,$y0,$x1,$y1 ++ip.. f. i#4?i#5:i#3 j[0] .,$x0,$y0 rm[-3--1] +done k[0] r {[$w0,$h0]},1,3,0,0,0.5,0.5 +else ip +fi done done um ip +#@cli search_dichotomic : "increasing_fn",target_y,_precision>0 +#@cli : Find parameter for function such that 'target_y' is met in image. +#@cli : Default value: 'precision=1e-3'.\n +#@cli : - Return 'nan' if search fails. +#@cli : * Credit: David Tschumperle. +search_dichotomic : check ${3=1e-3}>0 +m "_sdc : $1" target_value,epsilon=$2,$3 mpos,nb_attempts=-1,20 +do mvalue=${_sdc\ $mpos} if $mvalue<$target_value break fi mpos*=2 +nb_attempts-=1 while $nb_attempts if !$nb_attempts u nan return fi +Mpos,nb_attempts=1,20 +do Mvalue=${_sdc\ $Mpos} if $Mvalue>$target_value break fi Mpos*=2 +nb_attempts-=1 while $nb_attempts if !$nb_attempts u nan return fi +nb_attempts=100 +do +cpos={($mpos+$Mpos)/2} cvalue=${_sdc\ $cpos} +if abs($cvalue-$target_value)<$epsilon u $cpos return +elif $cvalue<$target_value mpos=$cpos else Mpos=$cpos fi +nb_attempts-=1 +while $nb_attempts u {$nb_attempts?$cpos:nan} +#@cli afre_details : n_scales>=2 +#@cli : Split image into detail scales. +#@cli : Default value: 'n_scales=2'. +afre_details : check ${1=2}>=2 +e[] "[afre]^_^) details: Split image$? into $1 detail scales." +repeat $! l[$<] +repeat $1-1 +afre_gui0_fast. 1,1e10 -.. . rv[-2,-1] done +done done +afre_details_preview : +afre_details $* +n 0,255 append_tiles 0 +fx_gamify : +if $3 n 0,255 fi +afre_jchz +s c n... $1,100 *.. $2 a c +afre_ijchz +split_details 2 +l.. adjust_colors 0,{-$4/1.5*20} done +*. $4 ++ c 0,255 +fx_gamify_preview : +gui_split_preview "fx_gamify $*",$-1 +#@cli afre_gleam : 2<=smooth<=100,10<=_threshold<=90 +#@cli : Add gleam effect to selected images. +#@cli : Default values: 'smooth=3' and 'threshold=50'. +afre_gleam : check "${1=3}>=2 && ${2=50}>=10 && $1<=100 && $2<=90" +e[] "[afre]^_^) gleam: Add gleam effect to image$? using smooth=$1 and threshold=$2." +repeat $! l[$>] ++afre_y50 1 >. {100-$2}% b. $1% sqrt. +afre_softlight 100 rm.. max +done done +afre_gleam_preview : +afre_gleam $* +#@cli afre_halfhalf : match_size={ 0 | 1 } +#@cli : Stitch left and right halves of 2 images, respectively. +#@cli : Default value: 'match_size=0'. +afre_halfhalf : check isbool(${1=0}) +if $!!=2 error[] "\n[afre]>_<) halfhalf: Please select 2 images." fi +e[] "[afre]^_^) halfhalf: Stitch left and right halves of 2 images using match_size=$1." ++f[{w#0>w#1?0:1}] 0 mv. 0 s[1,2] x,2 rm[2,3] +if w#1=1,_spacing>=0,0<=_matte_colour={[R,G,B]}<=255 +#@cli : Generate montage without resizing. +#@cli : Default values: 'max_per_row=5', 'spacing=1', 'matte_colour=230,255,230'. +afre_montagex : check "${1=5}>=1 && ${2=1}>=0 && inrange(${3=230},0,255) && inrange(${4=255},0,255) && inrange(${5=230},0,255)" +e[] "[afre]^_^) montagex: Generate montage without resizing image$? using max_per_row=$1, spacing=$2 and matte_colour=(${3-5})." +to_colormode 0 a=$1 b,c=int($!/$a),{$!%$a} ++ 1 frame {[$2,$2]*min(${-max_w},${-max_h})*0.01},0 +repeat $b a[{$a*$<}-{$a*$<+($a-1)}] x,0.5 done +if $c a[-$c--1] x,0.5 fi a y,0.5 +- 1 replace_color 0,0,-1,-1,-1,$3,$4,$5 +afre_montagex_preview : +afre_montagex $* +#@cli afre_portraitmontage : size={ 0=small | 1=large },_spacing>=1,_matte_shape={ 0=none | 1=circle | 2=polygon | 3=star },0<=_matte_colour={[R,G,B]}<=255 +#@cli : Generate portrait montage with resizing. +#@cli : Default values: 'size=1','spacing=1', 'matte_shape=0', 'matte_colour=230,255,230'.\n +#@cli : \- Centre subjects for best results. +afre_portraitmontage : check "isbool(${1=1}) && ${2=1}>=1 && inrange(${3=0},0,3) && inrange(${4=230},0,255) && inrange(${5=255},0,255) && inrange(${6=230},0,255)" +if $3==0 s=none elif $3<2 s=circle elif $3<3 s=polygon t=8 +elif $3<4 s=star t=24,0.9 fi +e[] "[afre]^_^) portraitmontage: Generate portrait montage of resized image$? using size=$1, spacing=$2, matte_shape="$s" and matte_colour=(${4-6})." +rr2d {`$1?'${-max_w},${-max_h},':'${-min_w},${-min_h},1'`},2 to_rgb +repeat $! l[$>] if $3 +f. -1 shape_$s {min(w,h)},$t to_rgb. +ri. ..,0,0,0.5,0.5 negate. j... ..,0,0,0,0,1,. k... autocrop fi ++ 1 done done f=min(${-max_w},${-max_h}) frame {[$2,$2]*$f*0.01},0 +append_tiles 0 frame {[$2,$2]*$f*0.01},0 - 1 replace_color 0,0,-1,-1,-1,$4,$5,$6 +afre_portraitmontage_preview : +afre_portraitmontage $* +#@cli afre_queryprimary : mode={ 0=min | 1=max | 2=med },_skip_last_channel={ 0 | 1 } +#@cli : Query pixel minima, maxima or medians of selected images. +#@cli : Default values: 'mode=1' and 'skip_last_channel=0'. +afre_queryprimary : check "inrange(${1=1},0,2) && isbool(${2=0})" +mode,s={`$1>1?'med,medians':$1>0?'max,maxima':'min,minima'`} if $2 skip=", skipping the last channel" fi e[] "[afre]^_^) queryprimary: Query pixel "$s" of image$?"$skip"." +repeat $! l[$>] if $2 sh 0,{s-2} fi l. ++s c $mode[^0] +== rm.. * +done if $2 rm. fi done done +afre_queryprimary_preview : +afre_queryprimary $* +#@cli afre_sharpenfft : 1<=strength<=50,1<=_size<=10 +#@cli : Sharpen selected images with Fourier transform. +#@cli : Default values: 'strength=15' and 'size=1'. +afre_sharpenfft : check "${1=15}>=1 && ${2=1}>=1 && $1<=50 && $2<=10" +e[] "[afre]^_^) sharpenfft: Sharpen image$? with Fourier transform using strength=$1 and size=$2." +repeat $! l[$>] iM={iM} +periodize_poisson -.. . l. +l +fftpolar +gaussian.. {100/$2}% negate. *[^1] ifftpolar * $1 +done + c 0,$iM done + c 0,$iM done done +afre_sharpenfft_preview : +afre_sharpenfft $* +#@cli afre_vigcirc : 50<=size<=150,-500<=_strength<=500,0<=_position_x<=100,0<=_position_y<=100 +#@cli : Add circular vignette of selected images. Negative strength will brighten periphery. +#@cli : Default values: 'size=90', 'strength=75', 'position_x=50' and 'position_y=50'. +afre_vigcirc : check "${1=90}>=50 && ${2=75}>=-500 && ${3=50}>=0 && ${4=50}>=0 && +$1<=150 && $2<=500 && $3<=100 && $4<=100" +e[] "[afre]^_^) vigcirc: Add circular vignette of image$? using size=$1, strength=$2, position_x=$3 and position_y=$4." +repeat $! l[$>] iM={iM} min={min(w,h)} ++f 1 circle. $3%,$4%,{($min/2-2)/100*$1} +distance. 0 b. 1 -. {im} *. {$2/100} - +c 0,$iM done done +afre_vigcirc_preview : +afre_vigcirc $* +#@cli afre_vigrect : 1<=size<=100,-500<=_strength<=500,1<=_blur<=50,0<=_position_x<=100,0<=_position_y<=100 +#@cli : Add rectangular vignette of selected images. Negative strength will brighten periphery. +#@cli : Default values: 'size=50', 'strength=75', 'blur=10', 'position_x=50' and 'position_y=50'. +afre_vigrect : check "${1=50}>=1 && ${2=75}>=-500 && ${3=10}>=1 && ${4=50}>=0 && ${5=50}>=0 && +$1<=100 && $2<=500 && $3<=50 && $4<=100 && $5<=100" +e[] "[afre]^_^) vigrect: Add rectangular vignette of image$? using size=$1, strength=$2, blur=$3, position_x=$4 and position_y=$5." +repeat $! l[$>] iM={iM} min={min(w,h)} s={$min/100*(50.5-$1/2)} +tx={$min/100*($4-50)} ty={$min/100*($5-50)} ++f x<$s+$tx||x>w-$s+$tx||y<$s+$ty||y>h-$s+$ty +distance. 0 b. {$min/100*$3} -. {im} *. {$2/100} - +c 0,$iM done done +afre_vigrect_preview : +afre_vigrect $* +_fx_remove_scratches : +repeat $! l[$>] to_rgba +sh 0,2 +sh.. 3 +<. {$1*255%} +if $4>=1 erode. $2 fi +if $4>=2 dilate. $3 fi +if $4<3 k... channels 3 * 255 +else inpaint_matchpatch.. . k... channels 0,2 +fi +done done +fx_remove_scratches : +_fx_remove_scratches ${1-3},3 +fx_remove_scratches_preview : +gui_split_preview "_fx_remove_scratches $*",$-1 +fx_corvo_painting_5 : ++polygonize $1,$2,$3,10,10 ++blend[0,1] alpha,$4 +-texturize_canvas[2] $5,0.5,0.6 +-smooth[2] $7,0.4,0.7,$8,$9 ++plasma[2] 0.7,100,8 n 0,255 +-blend[3,2] grainmerge,$6 +-bilateral[0,2] 10,7 +-blend[0,2] alpha,$10 +rm. +fx_morpho : +ac "__fx_morpho ${^0}",$5,$6 +fx_morpho_preview : +gui_split_preview "fx_morpho ${^0}",$-1 +__fx_morpho : +if $4==1 suf="_oct" elif $4==0 suf="" else suf="_circ" fi +if $1==0 erode$suf $2 +elif $1==1 dilate$suf $2 +elif $1==2 erode$suf $2 dilate$suf $2 +elif $1==3 dilate$suf $2 erode$suf $2 +elif $1==4 repeat $! +erode$suf $2 -[-2,-1] mv. 0 done +elif $1==5 repeat $! +dilate$suf $2 rv[-2,-1] -[-2,-1] mv. 0 done +elif $1==6 repeat $! +erode$suf $2 dilate$suf. $2 -[-2,-1] mv. 0 done +else repeat $! +dilate$suf $2 erode$suf. $2 rv[-2,-1] -[-2,-1] mv. 0 done +fi +if $3 repeat $! l[$>] split_opacity negate[0] a c done done fi +gcd_anti_alias : skip ${1=10},${2=0.3},${3=10} +foreach { split_opacity l[0] { ++smooth[0] $1,0,1,1.6,1.1,0.8,30,0.6 ++gradient_norm[0] +n. 0,$3 +[0,-1] +^. $2 n. 0,255 ++gradient_norm. ^. $2 n. 0,255 +blend[-2,-1] overlay append[-2,-1] c +blend[0,1] alpha c 0,255 +} a c } +gcd_anti_alias_preview : +gui_split_preview "gcd_anti_alias ${1--2}",$-1 +gcd_srgb2jpeg : +repeat $! l[$>] +if s<3 continue fi +if s==4 split_opacity fi +mix_rgb[0] 0.299,0.587,0.114,-0.1687,-0.3313,0.5,0.5,-0.4187,-0.0813 +sh[0] 1,2 +. 128 rm. a c +done done +gcd_jpeg2srgb : +repeat $! l[$>] +if s<3 continue fi +if s==4 split_opacity fi +sh[0] 1,2 -. 128 rm. +mix_rgb[0] 1,0,1.402,1,-0.34414,-0.71414,1,1.772,0 a c +done done +gcd_srgb2luma : +repeat $! l[$>] +remove_opacity +if s!=3 continue fi +sh[0] 0,0 sh[0] 1,1 sh[0] 2,2 +*[1] 0.299 *[2] 0.587 *[3] 0.114 ++[1-3] rm[1] channels[0] 0 +done done +gcd_srgb2luminance : +repeat $! l[$>] +remove_opacity +if s!=3 continue fi +srgb2rgb[0] sh[0] 0,0 sh[0] 1,1 sh[0] 2,2 +*[1] 0.2126 *[2] 0.7152 *[3] 0.0722 ++[1-3] rm[1] channels[0] 0 +done done +gcd_gamma : skip ${1=1},${2=0},${3=255} +if $1==1 return fi +repeat $! l[$>] +if !$2 g={1/max($1,0.001)} -^ $g * {$3^(1-$g)} +else * -1 + $3 max 0 -^ $1 * {-$3^(1-$1)} + $3 fi +done done +gcd_sbezier : skip ${1=0.5},${2=255} +repeat $! l. / $2 +sqr *. {1-2*$1} *.. {2*$1} + * $2 done done +gcd_ibezier : skip ${1=0.5},${2=255} +if $1==0.5 return fi +repeat $! l. +d={1-2*$1} e={$1/$d} / {$2*$d} + {$e*$e} +sqrt. * {$1>0.5?-1:1} - $e * $2 +done done +gcd_label : skip ${1=4},${2=0.067} +repeat $! l[$>] +label. $1,1 nb={1+iM} ++histogram. $nb,0,{$nb-1} ++map.. . rm.. +le. {$2%*w*h} *. 255 +inpaint.. . rm. +done done +gcd_shrink : +_gcd_w={0,w} _gcd_h={0,h} +repeat $! l[$>] if max(w,h)>700 rr2d. 700,700,0,1 fi done done +gcd_unshrink : +repeat $! l[$>] r $_gcd_w,$_gcd_h done done +gcd_fix_alpha : +repeat $! l[$>] if s==2||s==4 +sh 0,{s-2} sh[0] 100%,100% max. 1 +neq. 1 *[-3,-1] -k[0] +fi done done +#@cli gcd_noalpha +#@cli : Remove any gimp alpha channel and zero transparencies +gcd_noalpha : +e[^-1] "Remove gimp alpha channel from image$?." +repeat $! l[$>] if s==2||s==4 +m={s-2} sh 0,$m sh.. 100% neq. 0 *.. . -k[0] channels 0,$m +fi done done +#@cli gcd_splitalpha +#@cli : Split any gimp alpha channel and zero transparencies +gcd_splitalpha : +e[^-1] "Split gimp alpha channel from image$?." +repeat $! l[$>] if s==2||s==4 +m={s-2} sh 0,$m sh.. 100% . neq.. 0 *[1,2] -k[^1] channels.. 0,$m +fi done done +#@cli gcd_force_rgb +#@cli : Force selected gimp images to be in RGB mode. +gcd_force_rgb : +e[^-1] "Force gimp image$? to be in RGB mode." +repeat $! l[$>] +if s>4 error[] "Command 'gcd_force_rgb': Image ["$>"] is not a G,GA,RGB or RGBA image ("{s}" channels)." +elif s==4 sh 0,2 sh.. 3 neq. 0 *.. . -k[0] channels 0,2 +elif s==2 sh 0 sh.. 1 neq. 0 *.. . -k[0] channels 0 r 100%,100%,100%,3 +elif s==1 r 100%,100%,100%,3 +fi +done done +#@cli gcd_force_rgba +#@cli : Force selected gimp images to be in RGBA mode. +gcd_force_rgba : +e[^-1] "Force gimp image$? to be in RGBA mode." +repeat $! l[$>] +if s>4 error[] "Command 'gcd_force_rgba': Image ["$>"] is not a G,GA,RGB or RGBA image ("{s}" channels)." +elif s==4 +channels 3 neq. 0 * +elif s==3 channels 0,3 sh. 3 f. 255 rm. +elif s==2 +channels 1 neq. 0 * r 100%,100%,100%,4 sh. 2 f. .. rm. +elif s==1 r 100%,100%,100%,4 sh. 3 f. 255 rm. +fi +done done +#@cli gcd_force_a +#@cli : Force selected gimp images to have an alpha channel. +gcd_force_a : +e[^-1] "Force gimp image$? to have an alpha channel." +repeat $! l[$>] +if s==1||s==3 channels 0,{s} sh. {s-1} f. 255 rm. +elif s==2||s==4 +channels 100% neq. 0 * fi +done done +#@cli gcd_srgb2rgb +#@cli : Convert from sRGB gamma to RGB by fast approximate. +gcd_srgb2rgb : +e[^-1] "Convert image$? from sRGB gamma to RGB by fast approximate." +c 0,255 * 257 round 1 (0,255) r. 65536,1,1,1,3 srgb2rgb. map[^-1] . rm. +#@cli gcd_rgb2srgb +#@cli : Convert from RGB to sRGB gamma by fast approximate. +gcd_rgb2srgb : +e[^-1] "Convert image$? from RGB to sRGB gamma by fast approximate." +c 0,255 * 257 round 1 (0,255) r. 65536,1,1,1,3 rgb2srgb. map[^-1] . rm. +#@cli gcd_extract_clut : _resolution_root,_smoothness,_nb_iterations>=0,_nb_randoms>=0 +#@cli : Extract color LUT from selected images. +gcd_extract_clut : skip ${1=8},${2=3},${3=5},${4=5} +e[^-1] "Extract color LUT from image$?." +to_rgb b={int($1)^2} s={$b^1.5} +(0,1;0,1/0,1;0,1^0,0;1,1/0,0;1,1^0,0;0,0/1,1;1,1) +*. 255 r. $b,$b,$b,3,3 r. $s,$s,1,3,-1 +repeat $!-1 l[$>,-1] nm="[CLUT: "{0,n}"]" ++matchpatch. ..,1,1,1,$3,$4 warp[0] .,0 +rm. r.. $b,$b,$b,3,-1 b.. $2 =>.. $nm +done done rm. +#@cli gcd_geometric_median : size>=0,_nb_iter>=0 +#@cli : Apply geometric median filter on vector-valued images. +#@cli : Default values: 'size=3' and 'nb_iter=12'. +#@cli : $ image.jpg +gcd_geometric_median 3 +gcd_geometric_median : skip ${1=3},${2=12} +e[^-1] "Apply geometric median filter of size $1, on image$?." +repeat $! l[$>] +[0] +boxfilter. {$1+1-$1%2} sh. 0 +f. "* +begin( +const boundary = 1; +const N = int($1/2); +const W = N+1; +weightedSum = I(#1); +totalDist = weightedSum; +); +Y = I(#2,x,y); # centroid +for (iters = 0, iters<$2, ++iters, +weightedSum = 0; +totalDist = 0; +distSum = 0; +flag = 0; +for (j = -N, j0,_value,_max_iters>0 +#@cli : Add poisson disk sampling noise to selected images. +#@cli : Default values: 'radius=8', 'value=1' and 'max_iters=30'. +gcd_poisson_disk : check "${1=8}>0 && ${3=30}>0" skip ${2=1} +e[^-1] "Add noise points to image$?, with specified minimum distance." +repeat $! l[$>] +R={${"is_percent $1"}?max(w,h,d)*$1:$1} +dim={d>1?3:h>1?2:1} cw={0.999*$R/sqrt($dim)} +({[w,h,d,1]}) y. c +{[ceil(I/$cw)]} +r[1] 1,1,1,$dim,-1 +1,1,1,$dim 1,1,1,1 +{vector$dim(2*ceil(sqrt($dim))+1)} r. 100%,100%,100%,2 +f. "P=[x,y,z]-int([w/2,h/2,d/2]);[sum(sqr(P)),dot(P,[1,w#2,w#2*h#2])]" +r. {[whd,s,1,1,-1]} sort. +,x z. 0,1,100%,100% y. c +=>[1] dims =>[2] grid =>[3] samples =>[4] active =>[5] prox +eval ${-math_lib}" +const N = "$dim"; +const radius = "$R"; +const grid_cw = "$cw"; +const max_sample_attempts = $3; +mag2(vec) = (sum(sqr(vec))); +prox = I#5; +lim = I#1; +dar_insert(#3,I#1,0); # dummy sample to simplify bounds checks +dar_insert(#3,u(I#1),1); # add initial sample to list +dar_insert(#4,1,0); # add its index to active list +I(#2,int(I[#3,1]/grid_cw)) = 1; # add its index to grid cell +I(#0,I[#3,1]) = $2; # draw the point +while (dar_size(#4)>0, +R = int(u(dar_size(#4)-1e-4)); # choose a random active list index +P = i[#4,R]; # get the index of that sample +T = I[#3,P]; # position vector of that sample +for (attempts=0, attempts < max_sample_attempts, ++attempts, +do (S=4*(u(vectorN(1))-0.5); M=mag2(S), M <= 1 || M > 4); +X = T + radius * S; +if (min(X)<0 || min(lim-X)<0, continue()); +G = int(X/grid_cw); +GI = dot(G,[1,w#2,w#2*h#2]); # grid cell direct buffer index +for (K=0;rejected=0, K0 && mag2(I[#3,V]-X)=0[%],_boundary_conditions,_kernel +#@cli : Blur selected images using a binary inclusion mask. +#@cli : See 'help blur' for full parameters description. +#@cli : $ image.jpg to_rgb +to_a circle 50%,50%,80,1,0 gcd_blur_masked 2% +gcd_blur_masked : +e[^-1] "Blur image$? with binary inclusion masking." +repeat $! l[$>] +to_a split_opacity mo={iM} +ge. 1 *[0] . +eq. 0 b[0,-1] $* *. .. *. -1 +. 1 /[0,-1] *[0] . +*. $mo a c +done done +#@cli gcd_boxfilter_local : [reference_image] +#@cli : Blur selected images by a per-pixel box filter (2D SAT implementation). +#@cli : Local window sizes are specified by the reference image. +#@cli : $ sample +gaussian 20%,20% n. 0,50 gcd_boxfilter_local.. . +gcd_boxfilter_local : check ${"is_image_arg $1"} +pass$1 0 max. 1 +repeat $!-1 l[$>,-1] +av={ia#0} sub.. $av cumulate.. xy # bias to improve precision +f.. " +begin( +const boundary=1; +const interpolation=1; +const W=w-1; const H=h-1; +T(X,Y)=Y>1?i(X,Y-1):Y*i(X,0); +B(X,Y)=Y1?T(X-1,Y):X*T(0,Y); +E(X,Y)=X1?B(X-1,Y):X*B(0,Y); +G(X,Y)=X,-1] +av={ia#0} sub.. $av # bias to improve precision +f.. " +begin( +const boundary=1; +ref(crop(#0),img); # 64bit buffer +const W=w-1; const H=h-1; +px(x,y) = (img[x + y*w#0 + c*wh#0]); +qx(x,y) = ( +xA=floor(x); +xB=ceil(x); +yA=floor(y); +yB=ceil(y); +lx=x-xA; +lerp( +lerp(px(xA,yA),px(xB,yA),lx), +lerp(px(xA,yB),px(xB,yB),lx), +y-yA +) +); +T(X,Y)=Y>1?qx(X,Y-1):Y*qx(X,0); +B(X,Y)=Y1?T(X-1,Y):X*T(0,Y); +E(X,Y)=X1?B(X-1,Y):X*B(0,Y); +G(X,Y)=X=1 +#@cli : Compute the 2D cumulative inverse function of specified image data. +#@cli : $ sample cumulate xy gcd_decumulate 1 +gcd_decumulate : check "${1=1}>=1" +f "begin( +const boundary=1; +const interpolation=1; +const W=w-1; const H=h-1; +T(X,Y)=Y>1?i(X,Y-1):Y*i(X,0); +B(X,Y)=Y1?T(X-1,Y):X*T(0,Y); +E(X,Y)=X1?B(X-1,Y):X*B(0,Y); +G(X,Y)=X] +i $msk mul.. . +distance. 1 mul. 2 +gcd_boxfilter_local_hp[0,1] . rm. ++eq. 0 add[-2,-1] div +done done +#@cli gcd_inpaint_pyramid : [mask] +#@cli : Inpaint selected images by specified mask. +#@cli : $ image.jpg 100%,100% circle. 50%,50%,50,1,1 gcd_inpaint_pyramid.. . +gcd_inpaint_pyramid : check ${"is_image_arg $1"} +pass$1 0 ge. 1 store. msk +repeat $! l[$>] +L,D,X,Y,W,H={L=ceil(log(max(w,h))/log(2));D=2^L;X=ceil((D-w)/2);Y=ceil((D-h)/2);[L,2^L,X,Y,w,h]} +i $msk z {[-$X,-$Y,$D-$X-1,$D-$Y-1]},1 +eq. 0 mul.. . +repeat $L ++r[-2,-1] 50%,50%,100%,100%,2 ++eq. 0 add. .. div[-3,-1] gt. 0 +done +i[0] (0.0625,0.125,0.0625;0.125,0.25,0.125;0.0625,0.125,0.0625) +repeat $L +l[0,-4--1] rm. +r. [1],[1],[1],[1],1 convolve. [0] +eq[2] 0 j[1] .,0,0,0,0,1,[2] rm. +done +done +rm[0,-1] z {[$X,$Y,$X+$W-1,$Y+$H-1]},1 +done done +#@cli gcd_dither_srgb : _nb_levels>=2 +#@cli : Dither selected sRGB images. +#@cli : Default values: 'nb_levels=2'. +#@cli : $ image.jpg gcd_dither_srgb 6 round +gcd_dither_srgb : check "isint(${1=2}) && $1>=2" +repeat $! l[$>] +s c (0,255) r. $1,1,1,1,3 +srgb2rgb index[^-1] .,1,1 rm. a c rgb2srgb +done done +#@cli gcd_shuffle +#@cli : Shuffle vectors of selected images with Fisher-Yates algorithm. +#@cli : $ uniform_distribution 8,3 gcd_shuffle +gcd_shuffle : f "=2 +#@cli : Return all primes not greater than the specified limit as a 1xN image. +#@cli : Default values: 'limit=97'. +#@cli : $ gcd_primes 1000 +gcd_primes : check "isint(${1=97}) && $1>1" +e[^-1] "Compute prime numbers not greater than $1." +1,{$1+1},1,1,y +eval "i[1]=0;for(N=2,N<=sqrt($1),++N,i[N]?for(P=N*N,P<=$1,P+=N,i[P]=0))" +discard. 0 +#@cli gcd_mean_transfer_curve : +#@cli : Calculate mean transfer curve between selected pair of images. +#@cli : Image values will be indexes to an output map per channel. +#@cli : Each map contains original and mapped values. +#@cli : $ image.jpg +negate noise. 50% gcd_mean_transfer_curve dg[^0] +gcd_mean_transfer_curve : +e[0] "Index and calculate mean transfer curve for image$?." +if $!!=2 error "Two images are required for $0" fi +l[-2,-1] +s0={s#0} r. 100%,100%,100%,$s0 s c +repeat $s0 l[{[$<,$<+$s0]}] +dims={0,[w,h,d]} +$dims,3,[x,y,z] r. 1,{0,whd},1,3,-1 +y[0,1] a c sort +,y $dims,1 1,1,1,2 +eval " +col=I[#0,0]; +V=col[0]; S=col[1]; N=1; +i(#-2,col[2,3])=0; +for(P=1;Q=0,P=1,_[mask],_boundary_conditions +#@cli : Solve for 2D [kernel] in 'convolve[selection] [kernel] = [target]'. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default values: 'size=1' and 'boundary_conditions=1'. +#@cli : $ image.jpg +laplacian +gcd_solve_kernel.. . +gcd_solve_kernel : skip ${3=1},${4=1} check ${"is_image_arg $1"}" && isint(${2=1})" +e[^-1] "Solve kernel for image$? with convolution target $1 +and "${"arg 1+$4,dirichlet,neumann,periodic,mirror"}" boundary conditions." +pass$1 K:=$2*2+1 => target +if ${"is_image_arg $3"} +pass$3 0 => mask +repeat $!-2 { +l[$>,target,mask] { +nm={0,n}"_kernel" 0 => patches 0 => points +eval[mask] "begin(const boundary=$4;const K=$K); +if(i>=1, +da_push(#-2,crop(#0,x-$2,y-$2,z,c,K,K,1,1)); +da_push(#-1,i(#1,x,y)); +); +end(set('H',da_size()-1));" +if h==0 error[0] "Command 'gcd_solve_kernel': mask image is empty." fi +permute[patches] cyxz +z[patches,points] 0,0,100%,$H +invert[patches] 1,1e-6 =>[patches] inv mmul[inv,points] +mirror[inv] y r[inv] $K,$K,1,1,-1 rm[0] mv[inv] 0 +=>[inv] $nm +} +} rm[mask] +else +repeat $!-1 { +l[$>,target] { +nm={0,n}"_kernel" 0 => patches 0 => points +eval[0] "begin(const boundary=$4;const K=$K); +da_push(#-2,crop(#0,x-$2,y-$2,z,c,K,K,1,1)); +da_push(#-1,i(#1,x,y)); +end(set('H',da_size()-1));" +permute[patches] cyxz +z[patches,points] 0,0,100%,$H +invert[patches] 1,1e-6 =>[patches] inv mmul[inv,points] +mirror[inv] y r[inv] $K,$K,1,1,-1 rm[0] mv[inv] 0 +=>[inv] $nm +} +} +fi +rm[target] +#@cli gcd_browse : "commands",_width,_height +#@cli : Navigate and display images from local storage. +#@cli : Specified "commands" can be applied while viewing. +#@cli : All arguments are optional. +#@cli : +#@cli : Controls: +#@cli : * `ESC or Q` : Exit. +#@cli : * `Arrow Keys` : Navigate directories. +#@cli : * `Page Up/Down` : Navigate images within current directory. +#@cli : * `Home/End` : View first/last image in current directory. +#@cli : * `SPACE` : Enable/disable specified commands. +#@cli : * `i` : Toggle information display. +#@cli : * `f` : Toggle fullscreen mode. +#@cli : * `e` : Toggle edge filtering. +#@cli : * `w` : Toggle wide mode. +#@cli : * `a or z` : Move up or down in wide mode. +gcd_browse : check "isnum(${2=-1}) && isnum(${3=-1})" skip "${1=,}" +if same(["'$1'"],',') +m "_gcd_tmp_cmd : +gcd_std_score_patch 3 compose_channels. add orientation.. mul.. 2 add n 0,255" +else m "_gcd_tmp_cmd : $1" +fi +if ${-is_windows}" || "${-is_macos} +filespec={/"*.jpg","*.jpeg","*.png","*.tif","*.tiff"} +else filespec={/"*.jpg","*.JPG","*.jpeg","*.png","*.tif","*.TIF","*.tiff"} +fi +w,h={[$2>0?$2:{*,u}-1,$3>0?$3:{*,v}]} +cursor[0] 0 font={max(13,sqrt($w*$h)/48)} +info,hq,fs,cmdon,refresh,pid,wide,start={[1,0,1,0,1,0,0,0.5]} +path_current path=${} +gcd_parentdir {``$path} files2img 1,${} => dirs +gcd_currentdir {``$path} gcd_argnum[dirs] ${} +dlim,dpos={dirs,[h,${}]} 0 => imgfiles 0 => vwimg +$w,$h,1,3 => screen +1 store. cid +1 store. pid +do +if $refresh +rm[imgfiles] +gcd_filelist {``$path},$filespec +=> imgfiles lim,pos={imgfiles,[h,1]} +refresh={!$refresh} +fi +if $lim>0 +rm[vwimg] gcd_imgarg[imgfiles] $pos i ${} +dim={`string(w,'x',h,'x',s)`} +details="dim: "$dim" "{x}": "{b} => vwimg +else +rm[vwimg] 1,1,1,3 => vwimg details="no images" +fi +if $cmdon +l[vwimg] _gcd_tmp_cmd +if 1!=$! error "Exactly one image must be returned by custom commands" fi +nm vwimg +done +fi +to_rgb[vwimg] gcd_resize_for_fs[vwimg] $w,$h,$hq,$wide +f[screen] 0 j[screen] [vwimg],0.5~,$start~ +if $info +if $hq fe="edge " else fe="" fi if $cmdon fe.="cmd " fi +0 t. $path,0,0,$font,1,255,255,255 j[screen] . +0 t. $dpos"/"$dlim,0,0,{$font*2},1,255,0,255 j[screen] .,0,{h#-2} rm[-2,-1] +0 t. $details,0,0,$font,1,255,255,255 j[screen] .,0,{{screen,h}-h} rm. +0 t. $fe$pos"/"$lim,0,0,{$font*2},1,0,255,0 j[screen] .,{{screen,w}-w} rm. +fi +w[screen] 100%,100%,0,$fs,"Image Browser" cursor[0] 0 wait +if {*,PAGEUP}" && "$pos>1 pos-=1 wait -1 fi +if {*,PAGEDOWN}" && "$pos<$lim pos+=1 wait -1 fi +if {*,HOME} pos=1 wait -1 elif {*,END} pos=$lim wait -1 fi +if {*,E} hq={!$hq} wait -1 elif {*,SPACE} cmdon={!$cmdon} wait -1 fi +if {*,F} fs={!$fs} if $fs w[] 100%,100%,0,1 fi wait -1 fi +if {*,I} info={!$info} wait -1 fi +if {*,W} wide={!$wide} wait -1 fi +if {*,Z} start={min($start+0.25,1)} wait -1 fi +if {*,A} start={max($start-0.25,0)} wait -1 fi +if {*,ARROWLEFT} +i $cid eval "da_push("$dpos")" store. cid +i $pid eval "S=da_size();V=i[S-1]; S>0?da_remove(); V" nxt=${} store. pid +gcd_parentdir {``$path} path=${} +rm[dirs] gcd_parentdir {``$path} files2img 1,${} => dirs +if $nxt==0 gcd_currentdir {``$path} gcd_argnum[dirs] ${} nxt=${} fi +dlim,dpos={dirs,[h,max($nxt,1)]} +refresh=1 wait -1 +fi +if {*,ARROWRIGHT}" && "$dlim>0 +files2img 1,{``$path} => subdirs +if h>0 +i $pid eval "da_push("$dpos")" store. pid +i $cid eval "S=da_size();V=i[S-1]; S>0?da_remove(); V" nxt=${} store. cid +rm[dirs] =>[subdirs] dirs +dlim,dpos={dirs,[h,max($nxt,1)]} +gcd_imgarg[dirs] $dpos path.=${}"/" +refresh=1 wait -1 +else rm[subdirs] fi +fi +if {*,ARROWUP}" && "$dpos>1 +1 store. cid +dpos-=1 gcd_parentdir {``$path} path=${} +gcd_imgarg[dirs] $dpos path.=${}"/" +refresh=1 wait -1 +fi +if {*,ARROWDOWN}" && "$dpos<$dlim +1 store. cid +dpos+=1 gcd_parentdir {``$path} path=${} +gcd_imgarg[dirs] $dpos path.=${}"/" +refresh=1 wait -1 +fi +while {*}" && "!{*,Q}" && "!{*,ESC} +um _gcd_tmp_cmd cursor[0] 1 w 0 +e $path e $details rm[dirs,imgfiles,vwimg,screen] +#@cli gcd_imgarg : n>=1 +#@cli : Return the n-th argument of the specified string list image. +gcd_imgarg : skip ${1=1} u {``{`I[$1-1]`}} +#@cli gcd_argnum : "search_str" +#@cli : Return the index of the first matching argument in the specified string list image. +gcd_argnum : +num,sz={[0,s]} ++l. +s y ({'"$1"'}:y) r. 1,$sz,1,1,0 neq[^-1] . rm. discard 0 +repeat $! if {$>,whds}==0 num={$>+1} break fi done rm +done u $num +#@cli gcd_parentdir : "path" +#@cli : Return the parent directory path of the specified directory path. +gcd_parentdir : +if size(['"$1"'])<3 u "$1" return fi +('"$1"') replace_str. "\\","/" +l. +if i[#-1,h-1]!='/' ('/') a[-2,-1] y fi +s +,y,47 rm[-2,-1] a y +done u {t} rm. +#@cli gcd_currentdir : "path" +#@cli : Return the last directory name of the specified directory path. +gcd_currentdir : +if size(['"$1"'])<2 u "/" return fi +('"$1"') replace_str. "\\","/" +l. s -,y,47 k. done u {t} rm. +#@cli gcd_filelist : "path",_arg1,...,_argN +#@cli : Return the list of files within the specified directory path. +gcd_filelist : +path="$1" globs=${2--1} num={$#-1} +repeat $num +arg {$>+1},$globs glob=${} +files2img 3,{``$path}$glob +done a[-$num--1] y +#@cli gcd_resize_for_fs : width,_height,_is_filtered_edge +#@cli : Resize image for fullscreen display. +gcd_resize_for_fs : skip ${1=1920},${2=1080},${3=0},${4=0} +repeat $! l[$>] +w,h={[w,h]} mx={[im,iM]} +if $4 +if $w>=$1" || "$3==0 r2dx $1,3 else gcd_upscale_edge {$1/$w},1 fi +else +if $h>=$2" || "$3==0 r2dy $2,3 else gcd_upscale_edge {$2/$h},1 fi +fi +gcd_noalpha c $mx +done done +gcd_auto_balance : skip ${1=30},${2=0},${3=0},${4=1},${5=0} +mode=${arg\ 1+$3,hsi_i,hsv_v,lab_l,lrgb,rgb,ycbcr_y} +if $2>0 bilateral 1%,$2 c 0,255 fi +if $4!=0 ac "gcd_rgb_balance",rgb fi +if $5 ac "gcd_tonemap_inplace $1",$mode,2 +else ac "gcd_tonemap $1",$mode,2 fi +gcd_tonemap : skip ${1=100},${2=255} +repeat $! l[$>] +/ $2 +boxfilter $1% ++-. 0.5 sign. *. -1 ++*.. -2 +. 1 /[1] . ++eq. 0 +[-2,-1] /[0,-1] ++sqr.. +[0,-1] max[0] 0 +sqrt[0] *[0,-1] - * $2 +done done +gcd_tonemap_inplace : skip ${1=100},${2=255} +repeat $! l[$>] +/ $2 +boxfilter $1% +f[0] "*A=i(#-1,x,y,z,c);B=1-2*A;Bx=A/B;-sign(A-0.5)*sqrt(i/B+Bx^2)-Bx;" +rm. * $2 +done done +gcd_rgb_balance : +repeat $! l[$>] +m={iM} s c n 0,$m a c [0] +r. 1,1,1,100%,2 +repeat s#1 sh[1] $> -. {2,i[$>]+$m/2} rm. done +rm. n. 0,$m +/[0] $m +^. 3 compose_channels. + /. -3 +. 1 +compose_channels.. max *[-2,-1] j[0] ..,0,0,0,0,1,. k[0] +done done +gcd_blend_feather : skip ${1=100},${2=0.5},${3=2},${4=0},${5=0} +r[^-1] .,.,1,100%,0,0,0.5,0.5 +if $5 ++gcd_blend_maxdelta ${1-4} +to_a[0] split_opacity[0] rv[1,-1] a[1,-1] c rm[0] +else gcd_blend_maxdelta ${1-4} fi +gcd_blend_maxdelta : skip ${1=100},${2=0.5},${3=2},${4=0} +if $!>1 repeat $!-1 l[0,1] +to_a split_opacity /[1,3] 255 +=>[0] upper =>[1] alpha =>[2] lower =>[3] mask ++r[lower] 1,1,1,100%,2 +++[upper] 0.1 *. [alpha] +s. c discard[-3--1] 0 a[-3--1] c +r. 1,1,1,100%,2 r[-2,-1] [upper] +*[-2,-1] $2 -[upper,-1] +[upper,-1] c[upper] 0,255 ++distance[alpha] 0 => dist +eq[mask] 0 *[mask] {dist,iM} max[dist] [mask] +if $4>0 +[upper] [alpha] a[-2,-1] c +gcd_fgmask. {20-$4} b. 3 *[alpha,-1] +fi ++n[dist] 0,$3 c. 0,1 *. [alpha] +gcd_srgb2jpeg[upper,lower] sh[upper,lower] 1,2 +j. ..,0,0,0,0,1,... rm[-3--1] +gcd_jpeg2srgb[upper,lower] +n[dist] 0,{255*$1%} ++-[upper] [lower] *. [alpha] ++sign. abs.. min[dist,-2] *[dist,-1] ++[lower] [dist] k[lower] c 0,255 +done done fi +gcd_fgmask : skip ${1=0} +repeat $! l[$>] +to_a expand_xy 20,0 split_opacity gt. 0 ++distance. 0 max_patch. 3 *. 2 ++erode[1] 20 *[-2,-1] dilate. $1 ++gradient_norm.. gt. 0 +gradient_norm[0] +eq. 0 *[0,-1] +max[-2,-1] *[0,1] *[0] -1 +watershed. .. rm.. +shrink_xy 20 - 1 +done done +fx_gcd_blend_multiscale : skip ${1=5} +if 2!=$! error "This filter requires two input layers to function" fi +l[-2,-1] { name={0,n} +to_a[0] remove_opacity[1] +split_opacity[0] n[1] 0,1 mv[1] 0 ++oneminus[0] gcd_inpaint_pyramid[1] . rm. +K=3 A=1 B=2 +repeat $1 { +K:=2^($>+2)+1 +boxfilter[0] $K n[0] 0,1 ++boxfilter[$A,$B] $K +sub[$A] .. sub[$B] . +mul[$A] [0] negate[0] mul[$B] [0] negate[0] +if ($>)>0 add[1,3] add[2,3] else A+=2 B+=2 fi +} +mul[$A] [0] negate[0] mul[$B] [0] +add[1,3] add[2,3] add[1,2] k. nm $name +} +fx_gcd_signum_color : skip ${1=0.1},${2=5},${3=2},${4=0} +foreach { +split_opacity l[0] { +m:=[im,iM] axesA=${arg\ 1+$3,xy,x,y} axesB=${arg\ 1+$4,xy,x,y} ++sqr compose_channels. + /. {-1,s} sqrt. +eq. 0 +[-2,-1] /.. . +b. $axesA,$1% +b. $axesB,$2% -[-2,-1] sign. +. 1 * n $m +} a c +} +gcd_comp_blur : skip ${1=2},${2=3},${3=1},${4=100},${5=1},${6=0} +gsz={2^(5-$1)} +repeat $! l[$>] +remove_opacity. ++to_gray[0] edges. 14.5% n. {100-$4}%,100% +if {0,s>1" && "$5} ++ac[0] "median 5",ycbcr_cbcr +image[0] .,0,0,0,0,1,.. rm. +fi +if $1==0 {w},{h},1,1,255 *[-2,-1] else +{w},{h},1,1,0 +grid. $gsz,$gsz,0,0,1,255 +if $2>=2 grid. $gsz,$gsz,1,1,1,255 fi +if $2==3 grid. $gsz,$gsz,-1,-1,1,255 fi +b. $3,0 *[-2,-1] +fi +i.. [0] append[-2,-1] c +smooth[1] {100*$6+100},0.6,0.3 +blend[0,1] alpha +if !$6 sharpen. 20 fi +done done +gcd_comp_blur_preview : +gui_split_preview "gcd_comp_blur ${1--2}",$-1 +fx_gcd_crmt_tile : +to_a +m "_crmt_tile_C : [$""1]" +m "_crmt_tile_R : rotate. $""1 autocrop." +m "_crmt_tile_Fo : mirror. x" +m "_crmt_tile_Fi : mirror. y" +macros="sind(A)=sin(A/180*pi);cosd(A)=cos(A/180*pi);tand(A)=tan(A/180*pi);" +('"_crmt_tiling_command : $1 {``$2},1,4 => _crmt_render $3"') +replace_str. "C","_crmt_tile_C " +replace_str. "Fo","_crmt_tile_Fo " +replace_str. "Fi","_crmt_tile_Fi " +replace_str. "R","_crmt_tile_R " +replace_str. "T","_crmt_tile_T " +replace_str. "[","{"$macros"[" +replace_str. "]","]}" +m {t} +rm. +_crmt_tiling_command k[_crmt_render] +if $4 ++channels[0] 100% negate. dilate. 3 +inpaint[0] .,0,0 rm. +fi +uncommand _crmt_tiling_command +_crmt_tile_T : skip ${1=0},${2=0} +f. ":i3>0?I(#"{``${_crmt_render}}",$1+x,$2+y)=I;i" rm. +fx_gcd_cumul_math : skip ${1=0},${2=1},${3=1},${4=0} +op=${arg\ 1+$1,"add","or","xor","and","mod"} +ac "gcd_cumul_math $2,$3,"$op",$4",rgb replace_nan 255 +gcd_cumul_math : skip ${1=1},${2=1},${3="add"},${4=0} +repeat $! l[$>] +100%,100%,100%,1,1 (0,$2) if $4 z. 1,1 fi ++*. $1 shift[1] {^} rm. m={^} rm. [0] +repeat $1 +shift. $m +*. [1] $3[0,-1] rm.. done k[0] mod 256 +done done +fx_gcd_cumul_math_preview : +gui_split_preview "fx_gcd_cumul_math ${1--2}",$-1 +fx_gcd_blur_deblur_texture : skip ${1=4},${2=1},${3=0.5},${4=0},${5=2},${6=0} +repeat $! l[$>] +mode=${arg\ 1+$5,rgb,lrgb,ycbcr_y,ycbcr_cbcr} +if $6 r=$2% else r=$2 fi +if $4 ac "repeat $1 gcd_blur_texture "$r",$3 done",$mode,1 +else ac "repeat $1 +l +gcd_blur_texture "$r",$3 norm - done + done",$mode,1 fi +done done +fx_gcd_blur_deblur_texture_preview : +gui_split_preview "fx_gcd_blur_deblur_texture $*",${-3--1} +#@cli gcd_blur_texture : std_deviation>=0[%],0<=edge_exponent<=1 +#@cli : Edge preserving smooth. +#@cli : Default values: 'std_deviation=1' and 'edge_exponent=1'. +#@cli : $ image.jpg gcd_blur_texture 1 +gcd_blur_texture : skip ${1=1},${2=1} +e[^-1] "Apply blur texture filter of size $1, on image$?." +repeat $! l[$>] +[0] +sqr. b[-2,-1] $1 +sqr.. -[-2,-1] +max. 0 +eq. 0 +[-2,-1] sqrt. ^. -$2 +j[0] ..,0,0,0,0,1,. k[0] +done done +gcd_depth_blur : skip ${1=0},${2=15},${3=0.25},${4=2},${5=4},${6=0},${7=1} +repeat $! l[$>] +sa={$2*max(w,h)/1000} +to_rgb[0] ++gcd_depth[0] $3,$4,$5 +if $7 negate. fi +threshold. $1%,1 n. 0,255 +if $6 k. else +{w},{h},1,1,0 .. a[-3--1] c +smooth.. .,$sa,30,0 rm. +c. 0,255 +fi +done done +fx_gcd_dither_srgb : skip ${1=2},${2=1} +repeat $! l[$>] +split_opacity +if $2 gcd_srgb2luma[0] fi +gcd_dither_srgb[0] $1 round[0] a c +done done +gcd_emboss : skip ${1=128} +repeat $! l[$>] ++norm +bilateral[0] 2%,30 norm. -[-2,-1] ++n[0] 0,255 median. 3 bilateral. 2%,30 +gcd_srgb2luma. -. $1 ++abs. negate. ++max.. 0 min... 0 abs... +pde_flow[1] 20,7,iee ++n... 0,2 *. [1] +[0,-1] ++n. 0,2 *. [1] +[0,-1] ++n.. 0,2 *. [1] +[0,-1] ++[0,2] -[0,3] k[0] +gcd_srgb2luminance c 0,255 +done done +gcd_emboss_preview : +gui_split_preview "gcd_emboss ${1--2}",$-1 +gcd_geometric_balance : skip ${1=0} +repeat $! l[$>] +split_opacity +l[0] to_rgb +s c n 0,255 a c +srgb2rgb rgb2xyz +m={[im,iM]} n 0.002,0.998 log +r 1,1,1,100%,2 +gm={$1>0?log(min(max($1,0.002),0.998)):i[#1,1]} +repeat s#1 sh[0] $> *. {$gm/i[#1,$>]} rm. done rm. exp n $m +xyz2rgb rgb2srgb +s c n 0,255 a c +done a c +done done +fx_gcd_gradient_exponent : skip ${1=0.5},${2=0} +mode=${arg\ 1+$2,rgb,hsi_i,hsv_v,ycbcr_y,lab_l} +foreach { ac "gcd_gradient_exponent $1",$mode } +#@cli gcd_gradient_exponent : exponent +#@cli : Adjust gradient ratios via laplacian inversion. +#@cli : Default values: 'exponent=0.5'. +#@cli : $ image.jpg gcd_gradient_exponent 0.5 +gcd_gradient_exponent : skip ${1=0.5} +e[^-1] "Adjust gradient ratios for image$?, with exponent $1." +foreach { +repeat s { sh $> l. { +m={[im,iM]} g xy,1,2 +foreach { +abs ^. $1 sign.. * } +g.. x,-1,2 g. y,-1,2 + ilaplacian 0 n $m +} rm. } +} +gcd_infomap : +repeat $! l[$>] to_rgb +if $1>3 gcd_std_score_patch 3 n 0,255 +elif $1>2 ++dilate 3 +erode.. 3 eq[-2,-1] compose_channels. min +orientation.. * n 0,255 +elif $1>1 gcd_srgb2jpeg channels 1,2 equalize 256 gcd_detail +elif $1 gcd_detail else gcd_spectral fi +done done +gcd_detail : +repeat $! l[$>] +bilateral 2%,30 norm - n 0,255 done done +gcd_spectral : +repeat $! l[$>] +to_rgb gcd_srgb2luma - 128 ++max 0 +min[0] 0 abs[^-2] negate[0] a c n 0,255 +done done +gcd_std_score_patch : skip ${1=3} +repeat $! l[$>] ++gcd_variance_patch $1 sqrt. ++boxfilter.. $1 -[0,-1] +eq. 0 +[-2,-1] / +done done +gcd_variance_patch : skip ${1=3} +repeat $! l[$>] +sqr boxfilter $1 sqr.. rv - max 0 done done +fx_gcd_clone_inpaint : skip ${1=0},${2=1},${3=10},${4=1} +foreach { +S:=max(3,round(0.25*max(w,h)*$3%)) +if $1 transpose fi +to_rgba sh 100% eq. 100% mul +_gcd_clone_patch_sources $S,{arg0($2,1,0.5,0)} ++_gcd_clone_draw_inpaint_patches.. .,$S +split_opacity[0] +if $4 +neq[1] 0 rv[1,-1] _gcd_clone_inner_blend[0,1,-1] k[0] c 0,255 +else +eq[1] 0 j[0] .,0,0,0,0,1,[1] k[0] +fi +if $1 transpose fi +} +_gcd_clone_patch_sources : skip ${1=20},${2=0.5},${3=2} +sh 100% => alpha +4,1,1,1 1,[0],1,1 1,[0],1,1 +eval[alpha] " +begin(xmin=w#0; xmax=-1; ymin=h#0; ymax=-1); +if(x==0, L=w#0; R=-1); +if(i==0, +xxmax?xmax=R; +); +i[#-2,y]=L; i[#-1,y]=R; +end(i[#-3,0]=xmin;i[#-3,1]=xmax;i[#-3,2]=ymin;i[#-3,3]=ymax;) +" +rm[alpha] +K:=$1*2+1 erode.. $K dilate. $K -.. 1 +. 1 +ymin,ymax:=[i[#-3,2],i[#-3,3]] +xtopL,xtopR:=[i[#-2,$ymin],i[#-1,$ymin]] +xbotL,xbotR:=[i[#-2,$ymax],i[#-1,$ymax]] +f.. "y<$ymin?$xtopL:y>$ymax?$xbotL:i" +f. "y<$ymin?$xtopR:y>$ymax?$xbotR:i" +rm[-3] D:=round($1/$3)*2 +{ceil([w#0/$D,h#0/$D,d#0])},1," +begin( +const S=$1; const K=$1*2+1; +const EL=K-1; const ER=w#0-2-K; +const D=$D; +); +X=x*D; Y=y*D; +L=i[#1,Y]; +R=i[#2,Y]; +LX=X-L; RX=R-X; +L>EL&&(LX/(LX+RX)<$2||R>ER)?-LX-S:RX+S; +" +rm[1,2] +_gcd_clone_draw_inpaint_patches : skip ${2=8},${3=2} +pass$1 0 => points +repeat $!-1 l[$>,-1] { +split_opacity[0] +P:=$2 Q:=round($2/$3) J:=$P*2+1 K:=$Q*2+1 C:=$P-$Q +$J,$J,1,1 $K,$K,1,1,1 j.. .,$C,$C rm. +distance. 1 n. 0,1 *. -1 +. 1 f. "i*i*i*(i*(i*6-15)+10)" +[0] f[0] 0 +eval[points] " +begin(const S=$2; const K=S*2+1; const D=$Q*2; ref(crop(#-2),M)); +X=x*D; Y=y*D; +U=i-S+X; V=Y-S; +ref(crop(#-1,U,V,K,K),patch); +ref(crop(#1,U,V,K,K),W); +draw(#0,patch,X-S,Y-S,0,0,K,K,1,s#0,1,M*W); +" +rm[1,-2,-1] +} done rm. +_gcd_clone_inner_blend : +dim:=max(w,h) +[0],[0],[0],[0] +[1],[1],[1],[1] +[2],[2],[2],[2] +repeat 12 { +K:=round($dim/2^$>) +if $K<=1 break fi +j[-3] [0] j[-2] [1] j[-1] [2] +l[-3] { +neq 0 boxfilter $K +eq. 0 +[-2,-1] /[0,-1] } +l[-2] { +neq 0 boxfilter $K +eq. 0 +[-2,-1] /[0,-1] } +dilate. $K neq. [2] *.. -1 +.. [1] +.. ... +j[0] ..,0,0,0,0,1,. +} +gcd_ebwarp : skip ${1=0.5},${2=1} +repeat $! l[$>] +b={w*$1*$2} c={w*$2} d={2*$c-4*$b} +e={(4*$b-$c)/(2*$d)} se={sqr($e)} +{w},{h},1,1,x +if $1==0.5 *. {1/$c} else +/. $d +. $se +if $1>1 abs. fi +sqrt. +if $1>0.5 *. -1 fi +-. $e +fi +*. {w} {w},{h},1,1,y a[^0] c +warp[0] .,0,2,0 rm. c 0,255 +done done +gcd_jpeg_smooth : skip ${1=1},${2=1},${3=0} +repeat $! l[$>] +if $1 gcd_comp_blur. 2,3,1,100,1 fi +if $3 r. 140%,140%,1,3,5 c. 0,255 fi +if $2 gcd_anti_alias. 10,0.3,10 fi +done done +gcd_jpeg_smooth_preview : +gui_split_preview "gcd_jpeg_smooth ${1--2}",$-1 +gcd_layers : skip ${1=100},${2=0},${3=1},${4=50},${5=50},${6=0},${7=0},${8=0},${9=1},${10=1},${11=0},${12=0},${13=0} +one={$!<2} +l[${arg\ 1+$one,0-1,0}] +if $3" && "!$one" && "$1>100 r2dx. {w/$1%},{if($-1,2,6)} c. 0,255 fi +w={w} h={h} gcd_force_a[0] +l[0] +if $11 mirror ${arg\ $11,x,y,xy} fi +if !$3" || "$one" || "$1<100 r2dx {w*$1%},{if($-1,2,6)} c 0,255 fi +if $2 split_opacity rotate. $2,{2-($-1)} rotate.. $2,{2-($-1)},1 a c c 0,255 fi +if $6" || "$7 +sh 100% +gt. 1 expand_xy. 1,0 distance. 0 gt. {1+$6}% shrink_xy. 1 +*. .. if $8" && "$7 pde_flow. $7,30,iee,0 max. 0 fi min[-2,-1] rm. +fi +if !$8" && "$7 sh 100% b. {$7/10}%,1,{!$-1} rm. fi +done +pos={round(($w-w#0)/2+$w*$4%)},{round(($h-h#0)/2-$h*$5%)} # ** POSITION +if $-1" || "$12 i[0] $w,$h,1,{0,s} j[0] [1],$pos rm[1] pos=,pos(0,0) +else pos=,pos($pos) fi +mode=${arg\ 1+$10,alpha,add,burn,darken,difference,divide,dodge,grainextract,grainmerge,hardlight,hue,lighten,multiply,overlay,saturation,softlight,screen,subtract,value} +if $-1 if $!>1 rv blend $mode,$9 else sh 100% *. $9 rm. fi +else =>[0] mode($mode),opacity({$9*100})$pos fi +done +gcd_layers_preview : +gcd_layers $*,1 +gcd_balance_lms : skip ${1=1},${2=1},${3=1},${4=0},${5=0},${6=0} +repeat $! l[$>] split_opacity l[0] +if $5 s c n 0,255 a c fi srgb2rgb rgb2xyz 1 +mix_channels (0.7328,0.4296,-0.1624;-0.7036,1.6975,0.0061;0.0030,0.0136,0.9834) +if $6 +m={[im,iM]} +r 1,1,1,100%,2 +n.. 0.002,0.998 log. gm={ia} +r. 1,1,1,100%,2 +repeat s#2 sh[2] $> *. {$gm/i[#3,$>]} rm. done +rm. exp. n. $m r. 1,1,1,100%,2 /[-2,-1] +else (1^1^1) fi +($1^$2^$3) n={L=$4?[0.454369,0.473533,0.072098]:[1,1,1];dot(L,I#1)/dot(L,I#2)} +repeat s#1 sh[0] $> *. {$n*i[#2,$>]/i[#1,$>]} rm. done k[0] +mix_channels (1.096124,-0.278869,0.182745;0.454369,0.473533,0.072098;-0.009628,-0.005698,1.015326) +xyz2rgb 1 rgb2srgb +done a c done done +gcd_fx_local_fmean : skip ${1=15},${2=0},${3=0},${4=5},${5=0} +mode=${arg\ 1+$4,hsi_i,hsv_v,lab_l,lrgb,rgb,gcd_luminance,ycbcr_y} +if $5 ac "r={[im,iM]} n 0.002,0.998 gcd_fmean_local $1%,{$3-1},$2 n $r",$mode,2 +else ac "/ 255 gcd_fmean_local $1%,{$3-1},$2 * 255",$mode,1 +fi u "{$1}{$2}_"{2-($3>1" && "$5==1)}"{$3}{$4}{$5}" +#@cli gcd_fmean_local : std_deviation>=0[%],-1<=_mean_type<=2,_target>=0 +#@cli : Map local f-mean to match global or target. +#@cli : Value range is assumed to be 0 <= input <= 1. +#@cli : When target is zero, it will be set to the global f-mean. +#@cli : Default values: 'std_deviation=1', '_mean_type=0' and '_target=0'. +#@cli : $ image.jpg n 0,1 gcd_fmean_local 1% +gcd_fmean_local : check "${1=1}>=0 && isint(${2=0}) && $2>=-1 && $2<=2 && ${3=0}>=0" +e[^-1] "Map local f-mean of image$?." +func=${arg\ 2+$2,hmean,gmean,mean,qmean} +_gcd_$func m _gcd_func:$_gcd_f m _gcd_finv:$_gcd_i +repeat $! l[$>] ++neq. 0 +eq. 0 +[0] . zs={is} b. $1 *. .. *. -1 +. 1 ($3) +_gcd_func[0,-1] *[0] [1] +d={0,$3==0?is/(whds-$zs):i#-1} rm. # d = global(f(X)) ++b[0] $1 +eq. 0 +[-2,-1] /[-2,-1] +*[0] $d *[0,-1] +_gcd_finv[0] * +done done +uncommand _gcd_func,_gcd_finv +_gcd_qmean : _gcd_f="sqr" _gcd_i="sqrt" +_gcd_mean : _gcd_f="skip 0" _gcd_i="skip 0" +_gcd_gmean : _gcd_f="log" _gcd_i="exp" +_gcd_hmean : _gcd_f="^ -1 - 1" _gcd_i="+ 1 ^ -1" +_ac_gcd_luminance : +_p="to_color" +_f="srgb2rgb rgb2xyz8 sh 1 a c" +_b="s c,{1-s} sh.. 1 +eq. 0 +[-2,-1] /[-2,-1] * xyz82rgb rgb2srgb" +_s=3 +tran_multi_threshold : skip ${1=50},${2=100},${3=150},${4=200} +repeat $! l[$>] +split_opacity +rgb2ycbcr[0] channels. 0 fc[0] ${5-7} ++fc[0] ${8-10} +ge.. $1 j[0] ..,0,0,0,0,1,. rm[-2,-1] ++fc[0] ${11-13} +ge.. $2 j[0] ..,0,0,0,0,1,. rm[-2,-1] ++fc[0] ${14-16} +ge.. $3 j[0] ..,0,0,0,0,1,. rm[-2,-1] ++fc[0] ${17-19} +ge.. $4 j[0] ..,0,0,0,0,1,. rm[-2,-1] +rm. a c +done done +gcd_normalize_brightness : skip ${1=0},${2=10},${3=0},${4=3},${5=0},${6=0} +mode=${arg\ 1+$4,hsi_i,hsv_v,lab_l,ycbcr_y,rgb} +if $3>0 bilateral 1%,$3 c 0,255 fi +if $5==0 ac "gcd_tonemap_area $2,$1,$6",$mode,2 +else +ac "gcd_tonemap_area $2,$1,$6",$mode,2 blend ${arg\ $5,darken,lighten} fi +gcd_tonemap_area : skip ${1=100},${2=0},${3=0} +repeat $! l[$>] ++ 0.5 m={iM+1} / $m +if $3 a={$2/4.001+0.5} else +^. $2 a={is} rm. +^. {$2-1} a={$a/is} rm. fi +H={1/$a-1} +oneminus /. .. b. $1% ^. -1 *. $H ++oneminus. *. [0] +[-2,-1] / * $m - 0.5 +done done +gcd_pqct : +repeat $! l[$>] +({w*.1},{h*.2};{w*.2},{h*.6};{w*.2},{h*.9};{w*.5},{h*.1};{w*.6},{h*.8};{w*.9},0;{w*.85},{h*.4};{w},{h*.75}) +transpose. 9,2,1,1 +repeat 2 +sh[2] $>,$>,0,0 sh[1] $>,$>,0,0 +k={"k=(i[1]+i[3]+i[4]+i[6])/4; i(#-2,0)=k; +i(#-2,1)=(i[6]-i[1])/2; i(#-2,2)=(i[3]-i[4])/2; +i(#-2,3)=(i[6]+i[1])/2-k; i(#-2,4)=(i[3]+i[4])/2-k; +i(#-2,5)=(i[2]+i[5]-i[0]-i[7])/4; +i(#-2,6)=(i[0]+i[5]-i[2]-i[7])/4+(i[4]-i[3])/2; +i(#-2,7)=(i[5]+i[7]-i[0]-i[2])/4+(i[1]-i[6])/2; +i(#-2,8)=(i[0]+i[2]+i[5]+i[7])/4-k;0"} +rm[-2,-1] +done ++f[0] 0 r. 100%,100%,1,2,-1 sh[0] 0 +f. "begin(cx0=i(#2,0);cx1=i(#2,1);cx2=i(#2,2);cx3=i(#2,3); +cx4=i(#2,4);cx5=i(#2,5);cx6=i(#2,6);cx7=i(#2,7);cx8=i(#2,8); +cy0=i(#2,0,1);cy1=i(#2,1,1);cy2=i(#2,2,1);cy3=i(#2,3,1); +cy4=i(#2,4,1);cy5=i(#2,5,1);cy6=i(#2,6,1);cy7=i(#2,7,1);cy8=i(#2,8,1)); +s=(2*x/w-1); t=-(2*y/h-1); s2=s*s; t2=t*t; +i(#3,x,y,0,0)=cx8*s2*t2+cx7*s*t2+cx6*s2*t+cx5*s*t+cx4*t2+cx3*s2+cx2*t+cx1*s+cx0; +i(#3,x,y,0,1)=cy8*s2*t2+cy7*s*t2+cy6*s2*t+cy5*s*t+cy4*t2+cy3*s2+cy2*t+cy1*s+cy0; i" +rm[-4,-3,-1] round. [0],[0],[0],[0] sh[0] 0 px="" +repeat {0,s} px=$px;i(#2,a,b,0,$>)=i$>#0 done +f. 'a=i#1;b=i1#1$px' rm. j[0] . k[0] +done done +fx_gcd_quicktone : skip ${1=1},${2=4},${3=20},${4=0},${5=3},${6=1} +mode=${arg\ 1+$5,hsi_i,hsv_v,lab_l,ycbcr_y} +if $4>0 r={[im,iM]} bilateral 1%,$4 c $r fi +ac "+gcd_tonemap_gamma $2% +bilateral. $2%,{(iM#0-im#0)*$3/100} -[-2,-1] *. $1 +",$mode,{$6+1} +#@cli gcd_tonemap_gamma +#@cli : Map tones by local adjustment of geometric mean. +gcd_tonemap_gamma : skip ${1=100} +repeat $! l[$>] m={[im,iM]} n 0.002,0.998 log +b $1 *.. {0,is/whds} / exp n $m done done +gcd_recol : +repeat int($!/2) l[$>,{$>+1}] +rv[-2,-1] +channels.. 0 to_rgb.. +to_rgba. split_opacity. neq. 0 +srgb2rgb[-3,-2] rgb2lab8[-3,-2] channels... 0 channels.. 1,2 ++.. 1 *.. . ++meancurvature_flow... 3 median. 3 +gradient_norm. *. -1 watershed... . rm. -.. 1 +rm. a[-2,-1] c lab82rgb. rgb2srgb. +rgb2hsv. s c +equalize[2] 512 n. $1,$2 +[0,-1] %[0] 360 a c hsv2rgb. +done done +gcd_sharpen_gradient : skip ${1=0.5},${2=2},${3=0} +repeat $! l[$>] +split_opacity ++norm[0] +bilateral[0] $2%,30 norm. -[-2,-1] ++gradient_norm[0] negate. n. 0,$1 *[-2,-1] +[0,-1] +if $3 ac[0] "n 0,255",ycbcr_y else c[0] 0,255 fi +a c +done done +gcd_sharpen_gradient_preview : +gui_split_preview "gcd_sharpen_gradient ${1--2}",$-1 +gcd_sharpen_tones : skip ${1=1},${2=128},${3=0} +repeat $! l[$>] +split_opacity ++norm[0] +bilateral[0] 2%,30 norm. -[-2,-1] ++gradient_norm[0] n. 0,1 oneminus. *[-2,-1] ++n[0] 0,255 median. 3 bilateral. 2%,30 +gcd_srgb2luma. -. $2 ++max. 0 min.. 0 abs.. +n[-2,-1] 0,$1 *[-2,-1] ... rm... +[0,-2,-1] +if $3 ac[0] "n 0,255",ycbcr_y else c[0] 0,255 fi +a c +done done +gcd_sharpen_tones_preview : +gui_split_preview "gcd_sharpen_tones ${1--2}",$-1 +gcd_simple_dehaze : skip ${1=0.75},${2=1},${3=0.75} +foreach { +split_opacity +l[0] { +srgb2rgb div 255 ++gcd_erode_vw $3% compose_channels. min => msk ++mul[msk] $1 sub[0,-1] max[0] 0 mul[0] $2 +mul[msk] -$2 add[msk] 1 max[msk] 0 ++eq[msk] 0 add[msk,-1] ++compose_channels[0] max +max[msk,-1] div[0,msk] +mul 255 rgb2srgb +} +a c +} +#@cli gcd_erode_vw : size>=0[%],_tolerance>=0 +#@cli : Filter selected images by variance weighted erosion of specified size. +#@cli : Default values: 'size=3' and 'tolerance=1e-6'. +#@cli : $ image.jpg gcd_erode_vw 5 +gcd_erode_vw : skip ${1=3},${2=1e-6} +foreach { +C,R:=H=iM-im;[H/2+im,H] - $C / $R ++sqr boxfilter $1 +sqr.. -[-2,-1] +++. $2 sqrt. -[0,-1] r. 100%,100%,100%,1,2 +max. $2 ^. -1 *[0] . boxfilter $1 +eq. 0 +[-2,-1] / +c -0.5,0.5 * $R + $C +} +#@cli gcd_dilate_vw : size>=0[%],_tolerance>=0 +#@cli : Filter selected images by variance weighted dilation of specified size. +#@cli : Default values: 'size=3' and 'tolerance=1e-6'. +#@cli : $ image.jpg gcd_dilate_vw 5 +gcd_dilate_vw : skip ${1=3},${2=1e-6} +foreach { +C,R:=H=iM-im;[H/2+im,H] - $C / $R ++sqr boxfilter $1 +sqr.. -[-2,-1] +++. $2 sqrt. +[0,-1] r. 100%,100%,100%,1,2 +max. $2 ^. -1 *[0] . boxfilter $1 +eq. 0 +[-2,-1] / +c -0.5,0.5 * $R + $C +} +gcd_srotate : skip ${1=0},${2=50},${3=50},${4=1},${5=1},${6=6},${7=0.6},${8=0} +repeat $! l[$>] +rotate $1,{$4+1},1,$2%,$3% c 0,255 split_opacity +l[0] +{w},{h},1,1,1 rotate. $1,0,0,$2%,$3% +eq. 0 +area. 0 *. .. +ps={max(round(iM^0.5/6),4)} rm. +if $8 ++inpaint[0] .,$ps,{$ps*$6},$7,{9-$5*2},{$ps*1.2},0,0.08 +rv[-2,-1] a[-2,-1] c blend_seamless 0,0,25% +else +inpaint[0] .,$ps,{$ps*$6},$7,{9-$5*2},{$ps*1.2},0,0.08 rm. +fi +done a c +done done +fx_gcd_geometric_median : +ac "gcd_geometric_median $1,$2",$3 +fx_gcd_geometric_median_preview : +gui_split_preview "fx_gcd_geometric_median $*",${-3--1} +gcd_splitobj : skip ${1=50},${2=3},${3=3},${4=0},${5=0},${6=0},${7=40},${8=0},${9=0} +if $!<2 return fi +repeat int($!/2) l[$>,{$>+1}] +if w!={0,w}" || "h!={0,h} continue fi +to_rgba . s[1] c,-3 ge[2] $1% luminance[1] +meancurvature_flow[1] $2 median[1] $3 *[1,2] +channels[0] 0,1 s[0] c gt[0,1] 50% *[{$4!=0}] 2 +[0,1] +gradient_norm[1] *[1] -1 watershed[0] [1] -[0] 1 rm[1] +if $5>0 erode[0] $5 elif $5<0 dilate[0] {abs($5)} fi +if $6 b[0] $6,1,1 c[0] 0,1 fi +[1] sh. 3,3 *. [0] rm. oneminus[0] +if $8>0 +le[0] 80% +area[0] 0 *. [0] +ps={max(round(iM^0.5/6),4)} rm. n[0] 0,255 +inpaint[1] [0],$ps,{$ps*6},1,{9-$8*2},{$ps*1.2},0,0.08,10,1 +else sh[1] 3,3 *. [0] rm. fi +rm[0] gcd_fix_alpha =>[1] opacity($7) +if $9 blend alpha,{$7/100} fi +done done +gcd_splitobj_preview : +gcd_splitobj ${1--2},1 +gcd_stereo_vid : +1 l. +i "$1" st_folder={f} st_file={b} st_ext={x} ({'$st_file'}) cpx={w} +do cpx={$cpx-1} dgt={i($cpx)} isnum={($dgt>47)&&($dgt<58)} while ($isnum)&&($cpx>0) +if $cpx>0 +z. 0,$cpx fsname={t} rm. else fsname="" fi +z. {$cpx+{!$isnum}},100% dgts={w} fsnum={{t}} rm. +1 => "$2" en_file={b} ({'$en_file'}) cpx={w} +do cpx={$cpx-1} dgt={i($cpx)} isnum={($dgt>47)&&($dgt<58)} while ($isnum)&&($cpx>0) +z. {$cpx+{!$isnum}},100% fenum={{t}} rm[-2,-1] +bufsz=$11 ttlbuf={$bufsz*2} ttlimg={$fenum-$fsnum+1} +scene=1 scframe=0 ov={iv} oa={ia} +repeat $ttlimg +if $scene" && "$>==$scframe +k. scene=0 +repeat min($ttlbuf,$ttlimg-$scframe-1) +curnum={$fsnum+$scframe+$>+1} curnum=${gcd_add0\ $curnum,$dgts} +i ""${st_folder}${fsname}${curnum}.${st_ext}"" +vr={iv} av={ia} pvr={abs($vr-$ov)/$vr} pav={abs($av-$oa)/$av} +ov=$vr oa=$av +if $12&&($pvr>0.1" || "$pav>0.1) scene=1 scframe={$scframe+$>+1} break +fi +done ++l[0--{1+$scene}] ap "gcd_depth $7,$8,$9,$10" ++[0--1] a[0--2] z done +mv. 0 mv. 1 a[2--{1+$scene}] z +fi ++slices[2] 0 +/[0] {1,d} gcd_stereo[-2,-1] $4,$5,$6% +curnum={$fsnum+$>} curnum=${gcd_add0\ $curnum,$dgts} +if ${-is_windows} o. "$3"""{`92`}${fsname}${curnum}.${st_ext}"" +else o. "$3"""{`47`}${fsname}${curnum}.${st_ext}"" fi +progress {($>+1)/$ttlimg*100} +rm. slices[2] 1,100% +if !$scene" && "($>>=($scframe+$bufsz))" && "($><($ttlimg-$bufsz-1)) +curnum={$fsnum+$>+$bufsz+1} curnum=${gcd_add0\ $curnum,$dgts} +i ""${st_folder}${fsname}${curnum}.${st_ext}"" +vr={iv} av={ia} pvr={abs($vr-$ov)/$vr} pav={abs($av-$oa)/$av} +ov=$vr oa=$av +if $12&&($pvr>0.1" || "$pav>0.1) scene=1 scframe={$>+$bufsz+1} +else ++gcd_depth. $7,$8,$9,$10 +[0] . a[1,-1] z a[2,-1] z ++slices[1] 0 -[0,-1] slices[1] 1,100% +fi +fi +done +rm +done +gcd_stereo_vid_preview : skip "${1=}","${2=}" +l i "$1" onfail 100,100,1,3,0 t. "Select\nStart\nImage ",0,0,32,1,255 done +l i "$2" onfail 100,100,1,3,0 t. "Select\nEnd\nImage ",0,0,32,1,255 done +k[-2,-1] a[0,1] x to_rgb[0] +gcd_depth. $7,$8,$9,$10 gcd_stereo $4,$5,$6% +gcd_add0 : +({'"$1"'}) if w<$2 {$2-w},1,1,1,48 rv[-2,-1] a[-2,-1] x fi u {t} rm. +fx_gcd_color_target : +foreach { +split_opacity +src:=I(#0,$1/100*w#0,$2/100*h#0) ++gcd_srgb_curve_target[0] $3,$4,$5,$src +if $6 ++_gcd_chromacity_distance[0] $src *. -1 +. 1 +if $6>1 pow. 3 fi +j[0] ..,0,0,0,0,1,. rm[-2,-1] +else j[0] . rm. fi +a c +} +_gcd_chromacity_distance : +if ${"is_image_arg $1"} pass$1 1 else i 1,1,1,3,${^0} fi ++mix_channels. (0,0.5,0.5;0.5,0,0.5;0.5,0.5,0) -[-2,-1] store. cmp +foreach { ++mix_channels (0,0.5,0.5;0.5,0,0.5;0.5,0.5,0) +- i $cmp repeat {0,s} { sh[0] $> -. {-2,i[$>]} rm. } rm. +sqr r 100%,100%,100%,1,2 sqrt n 0,1 +} +#@cli gcd_srgb_curve_target : colRt,colGt,colBt,colRs,colGs,colBs +#@cli : Make source sRGB values match target using color curves. +#@cli : Default values: 'colN=128'. +#@cli : $ image.jpg gcd_srgb_curve_target 100,130,160 +gcd_srgb_curve_target : skip ${1=128},${2=128},${3=128},${4=128},${5=128},${6=128} +e[^-1] "Apply curves changing ($4,$5,$6) to ($1,$2,$3) for image$?." +foreach { +m={iM} repeat {0,s} { sh $> n. 0,$m rm. } +($4^$5^$6) ($1^$2^$3) +mix_channels (0,0.5,0.5;0.5,0,0.5;0.5,0.5,0) +srgb2rgb / $m +*[1,2] -[1,2] . rm. /[1,2] +repeat {0,s} { A:=i[$>] sh[0] $> +*. {1-$A} +. $A /[-2,-1] rm. } +k[0] * $m rgb2srgb +mix_channels (-1,1,1;1,-1,1;1,1,-1) c 0,$m +} +gcd_temp_balance : skip ${1=0},${2=0},${3=1},${4=0} +repeat $! l[$>] +split_opacity to_rgb[0] +gcd_srgb2luma[0] +if $4<2 +m={if($4,360,90)} $m,1,1,1 +r[0] 32,32,100%,100%,2 +repeat $m +gcd_hue_level. $> =... {ia},$> rm. done +rm. h={xM} rm. +else h=39 fi +if $2!=0 ++l[0] sh[0] 0 sh[0] 1 sh[0] 2 +({$h%360}^1^1) hsv2rgb. max. 0 *. $2 -. {ia} ++[-4] {@0} +... {@1} +.. {@2} rm[-4--1] max[0] 0 +done ++compose_channels[0] max n. 0,1 +j[0] ..,0,0,0,0,1,. rm[-2,-1] +fi +gcd_hue_chroma[0] $h,{($1+1)*$3},$3 +gcd_srgb2jpeg[0] j[0] . rm. +gcd_jpeg2srgb[0] round 1 a c c 0,255 +done done +gcd_hue_level : skip ${1=0} +repeat $! l[$>] +h={($1%360)/60} x={1-abs($h%2-1)} y={if($x>0,1/$x,0)} h={int($h)+1} +p={arg($h,0,1,1,2,2,0)} s={arg($h,1,0,2,1,0,2)} z={arg($h,2,2,0,0,1,1)} +sh. $p sh.. $s +*.. $x ++le. .. j... ..,0,0,0,0,1,. rm.. +eq. 0 +*.. $y j[-4] .,0,0,0,0,1,.. +rm[-4--1] sh. $z f. 0 rm. +done done +fx_gcd_color_spot_matching : skip ${1=50},${2=50},${3=50},${4=60},${5=1},${6=0},${7=0} +if 2!=$! error "This filter requires two input layers to function" fi +if $7 rv fi +l[0,1] { +if $6>1 +x0:=$3/100*w#0 y0:=$4/100*h#0 +x1:=$1/100*w#1 y1:=$2/100*h#1 +elif $6>0 +p:=(w#0+w#1) q:=max(h#0,h#1) +x0:=min($3/100*$p,w#0) y0:=min($4/100*$q,h#0) +x1:=max($1/100*$p-w#0,0) y1:=min($2/100*$q,h#1) +else +p:=max(w#0,w#1) q:=(h#0+h#1) +x0:=min($3/100*$p,w#0) y0:=min($4/100*$q,h#0) +x1:=min($1/100*$p,w#1) y1:=max($2/100*$q-h#0,0) +fi +to_a =>[0] T =>[1] S split_opacity +l[T,S] { +trg:=I(#0,$x0,$y0) src:=I(#1,$x1,$y1) ++gcd_srgb_curve_target[0] $src,$trg +if $5 ++_gcd_chromacity_distance[0] $trg *. -1 +. 1 +if $5>1 pow. 3 fi +j[0] ..,0,0,0,0,1,. rm[-2,-1] +else j[0] . rm. fi +} +a[0,1] c a[-2,-1] c +} +fx_gcd_color_spot_matching_preview : +fx_gcd_color_spot_matching $* +if $6>1 rv blend alpha elif $6>0 a x else a y fi +fx_gcd_undo_unsharp : skip ${1=3},${2=0.5},${3=1} +repeat $! l[$>] +split_opacity gcd_reverse_unsharp[0] ${1-3} a c +done done +fx_gcd_undo_unsharp_preview : +gui_split_preview "fx_gcd_undo_unsharp ${1-3}",${-3--1} +#@cli gcd_reverse_unsharp : std_deviation>=0[%],_amount>0,_type +#@cli : Apply a reverse unsharp mask to selected images. +#@cli : Values will be restricted to input image range. +#@cli : 'type' can be { 0=boxfilter | 1=gaussian }. +#@cli : Default values: 'std_deviation=3', 'amount=1' and 'type=1'. +#@cli : $ image.jpg unsharp 2,3 c 0,255 +gcd_reverse_unsharp 2,3 c 0,255 +gcd_reverse_unsharp : skip ${1=3},${2=1},${3=1} +e[^-1] "Apply reverse unsharp on image$?, with std_deviation $1." +repeat $! l[$>] +if $3 cmd=b else cmd=boxfilter fi +m={[im,iM]} +$cmd $1 mul. $2 add div {1+$2} c $m +done done +gcd_unquantize : skip ${1=6},${2=1},${3=1},${4=5},${5=15} +repeat $! l[$>] +gcd_srgb2jpeg s c +if $1>0 ++edges[0] 14.5% n. {1-$2},1 +if $3" && "$!>2 +a[1,2] c +apo[1] "median 5",3 +j[1] .,0,0,0,0,1,.. rm. +fi +{w},{h},1,1,0 grid. 8,8,0,0,1,1 grid. 8,8,-1,-1,1,1 +b. 1,0 *[-2,-1] n. 0,1 +pde_flow[0] $1,30,iee,0 +j[0] .,0,0,0,0,1,.. rm[-2,-1] +fi +if $4>0 ++median[0] 3 -. [0] +abs. ge. $5 +dilate. 3 n. 0,1 ++apo[0] "pde_flow "$4",7,iee,0",8 +j[0] .,0,0,0,0,1,.. rm[-2,-1] +fi +a c gcd_jpeg2srgb c 0,255 +done done +fx_gcd_upscale_edge : skip ${1=1},${2=1},${3=1},${4=1} +mx={[im,iM]} +gcd_upscale_edge {$1==0?$2:$1+1},$3 +if $4==1 c $mx elif $4==2 n $mx fi +u "{$1}{$2}_"{2*($1==0)}"{$3}{$4}" +fx_gcd_upscale_edge_preview : +A,B={P=0.5/($1==0?$2:$1+1);[-P,P]*100+50} +z $A%,$A%,$B%,$B% fx_gcd_upscale_edge $* +#@cli gcd_upscale_edge : factor>=1,_interpolation={ 0=linear | 1=bicubic } +#@cli : Upscale selected images with an edge-sharpening algorithm. +#@cli : Default values: 'factor=2' and 'interpolation=0'. +#@cli : $ image.jpg gcd_upscale_edge 2 +gcd_upscale_edge : skip ${1=2},${2=0} +e[^-1] "Upscale image$? by a factor of $1." +t={arg0($2,3,5)} +repeat $! l[$>] +nw,nh,ms,bs={[w,h,1.75,1.5]*$1} ++r $nw,$nh,100%,100%,$t +gcd_smooth_variance. $ms ++ri. [0],2 -[0,-1] ri[0] . +boxfilter.. $bs + +done done +#@cli gcd_resize_vw : width[%],_height[%],_depth[%] +#@cli : Resize selected images with variance weighted bilinear interpolation. +#@cli : Default values: 'height=100%' and 'depth=100%'. +#@cli : $ image.jpg r2dx 25%,2 +gcd_resize_vw 400%,400% +gcd_resize_vw : skip ${2=100%},${3=100%} +e[^-1] "Resize image$? to $1x$2x$3, with variance weighted bilinear interpolation." +repeat $! l[$>] +if d==1 +(0.0625,0.125,0.0625;0.125,0.25,0.125;0.0625,0.125,0.0625) +else +(0.015625,0.03125,0.015625;0.03125,0.0625,0.03125;0.015625,0.03125,0.015625/0.03125,0.0625,0.03125;0.0625,0.125,0.0625;0.03125,0.0625,0.03125/0.015625,0.03125,0.015625;0.03125,0.0625,0.03125;0.015625,0.03125,0.015625) +fi +[0]x2 sqr.. convolve[-2,-1] [1] rm[1] sqr. -[-2,-1] max. 0 +compose_channels. + /. 3 +. 1e-6 ^. -1 +*.. . r $1,$2,$3,100%,3 / +done done +#@cli gcd_resize_vw_aligned : width[%],_height[%],_depth[%] +#@cli : Resize selected images with pixel aligned variance weighted bilinear interpolation. +#@cli : Default values: 'height=100%' and 'depth=100%'. +#@cli : $ image.jpg r2dx 25%,2 +gcd_resize_vw_aligned 400%,400% +gcd_resize_vw_aligned : skip ${2=100%},${3=100%} +e[^-1] "Resize image$? to $1x$2x$3, with variance weighted bilinear interpolation." +repeat $! l[$>] +if d==1 +(0.0625,0.125,0.0625;0.125,0.25,0.125;0.0625,0.125,0.0625) +else +(0.015625,0.03125,0.015625;0.03125,0.0625,0.03125;0.015625,0.03125,0.015625/0.03125,0.0625,0.03125;0.0625,0.125,0.0625;0.03125,0.0625,0.03125/0.015625,0.03125,0.015625;0.03125,0.0625,0.03125;0.015625,0.03125,0.015625) +fi +[0]x2 sqr.. convolve[-2,-1] [1] rm[1] sqr. -[-2,-1] max. 0 +compose_channels. + /. 3 +. 1e-6 ^. -1 +*.. . gcd_resize_aligned $1,$2,$3 / +done done +#@cli gcd_resize_aligned : width[%],_height[%],_depth[%] +#@cli : Resize selected images with pixel aligned bilinear interpolation. +#@cli : Default values: 'height=100%' and 'depth=100%'. +#@cli : $ image.jpg +gcd_resize_aligned 400%,400% r2dx 25%,2 +gcd_resize_aligned : skip ${2=100%},${3=100%} +e[^-1] "Resize image$? to $1x$2x$3, with bilinear interpolation." +foreach { +$1,$2,$3,3,"[w#0*(x+0.5)/w-0.5,h#0*(y+0.5)/h-0.5,d#0*(z+0.5)/d-0.5]" +warp.. .,0 rm. +} +#@cli gcd_smooth_variance : size>=0[%],_tolerance>=0 +#@cli : Filter selected images by variance smoothing of specified size. +#@cli : Default values: 'size=3' and 'tolerance=1e-6'. +#@cli : $ image.jpg gcd_smooth_variance 5 +gcd_smooth_variance : skip ${1=3},${2=1e-6} +e[^-1] "Apply variance smoothing to image$?." +foreach { +C,R:=H=iM-im;[H/2+im,H] - $C / $R +[0]x2 sqr.. boxfilter[1,2] $1 +sqr. sub[-2,-1] r. 100%,100%,100%,1,2 +max. $2 ^. -1 *[0] . +boxfilter $1 +eq. 0 +[-2,-1] / +c -0.5,0.5 * $R + $C +} +gcd_upscale_noise : skip ${1=16},${2=2} +gcd_scale_noise $1,$2 c 0,255 +gcd_upscale_noise_preview : +z 25%,25%,75%,75% gcd_upscale_noise $* +gcd_scale_noise : skip ${1=16},${2=2} +repeat $! l[$>] +200%,200%,100%,100% gcd_random. $1 +repeat $2 +ri. ..,2 -. [0] ri. .. boxfilter. 3 -[1,2] done rm.. +done done +gcd_random : skip ${1=1},"${2=?}" +f u if isnum("$2") n $1,$2 else n 0,$1 fi +fx_gcd_upscale_recursive2x : skip ${1=4},${2=0.05},${3=0.01} +foreach { +split_opacity +gcd_upscale_recursive2x[0] {[$1,1-$2,0.25,round(1/log(1+$3))]} +if $!>1 +(0.0625,0.125,0.0625;0.125,0.25,0.125;0.0625,0.125,0.0625) +r[1] 200%,200%,100%,100%,1 convolve[1] . rm. a c +fi +} +fx_gcd_upscale_recursive2x_preview : +fx_gcd_upscale_recursive2x 1,${2--1} +#@cli gcd_upscale_recursive2x : search_size>0,0<=_sharpening<=1,0<=_smoothing<=1,_noise_divisor>0 +#@cli : Double image size using processed recursive expansion. +#@cli : Default values: 'search_size=4', 'sharpening=0.9', 'smoothing=0.25' and 'noise_divisor=100'. +#@cli : $ image.jpg gcd_upscale_recursive2x 4 +gcd_upscale_recursive2x : skip ${1=4},${2=0.95},${3=0.25},${4=100} +e[^-1] "Double xy-dimensions of image$?, using Recursive2x algorithm." +foreach { +m={0,[im,iM]} =>[0] small +wh:=[w,h]*2 r {[w+w%2,h+h%2]},100%,100%,0,1 +gcd_midrange_exponent $2 c $m ++gcd_proximity_ssu2x[0] $1 => large +gcd_box_texture[large] 2,$3 ++gcd_random[large] {X=iM-im;[-X,X]/$4} +[large,-1] ++ri[large] [small],2 sub. [small] ri. [large] +(0.0625,0.125,0.0625;0.125,0.25,0.125;0.0625,0.125,0.0625) +convolve.. . rm. sub[large,-1] +rm[small] c[large] $m mv[large] 0 +r $wh,100%,100%,0 +} +#@cli gcd_proximity_ssu2x : search_size>0 +#@cli : Double image size using self-similar upscaling. +#@cli : Default values: 'search_size=4'. +#@cli : $ image.jpg gcd_proximity_ssu2x 4 +gcd_proximity_ssu2x : skip ${1=4} +e[^-1] "Double xy-dimensions of image$?, using ssu2x algorithm." +foreach { +[0],[0],[0],2 ++r2dx[0] 50%,2 +if $1>0 +K:=$1*2+1 +$K,$K,1,2,"X=[x,y]-$1;sign(X)*X*X" +s. c y[-2,-1] x +eval[0] ": +begin( +const boundary=0; +const interpolation=0; +L=crop(#-2); +M=crop(#-1); +const S=w#-1; +); +X=floor(x/2); +Y=floor(y/2); +V=X; W=Y; D=inf; +P=crop(x-1,y-1,3,3); +for(K=0,K=0[%],0<=edge_exponent<=1 +#@cli : Edge preserving smooth. +#@cli : Default values: 'size=3' and 'edge_exponent=0.5'. +#@cli : $ image.jpg gcd_box_texture 3 +gcd_box_texture : skip ${1=3},${2=0.5} +e[^-1] "Apply box texture filter of size $1, on image$?." +foreach { +[0] +sqr. boxfilter[-2,-1] $1 +sqr.. -[-2,-1] +max. 0 +eq. 0 +[-2,-1] sqrt. ^. -$2 +j[0] ..,0,0,0,0,1,. k[0] +} +fx_gcd_upscale_solver2x : skip ${1=4},${2=0},${3=1},${4=1} +foreach { +split_opacity +if $2 gcd_reverse_unsharp[0] $3,$4 fi +gcd_upscale_solver2x[0] $1 +if $!>1 +(0.0625,0.125,0.0625;0.125,0.25,0.125;0.0625,0.125,0.0625) +r[1] 200%,200%,100%,100%,1 convolve[1] . rm. a c +fi +} +fx_gcd_upscale_solver2x_preview : +fx_gcd_upscale_solver2x 1,${2--1} +#@cli gcd_upscale_solver2x : _size>=1,_kernels_only={ 0 | 1 } +#@cli : Double image size using anisotropic kernel solver interpolation. +#@cli : Default values: 'size=4' and 'kernels_only=0'. +#@cli : $ image.jpg +gcd_upscale_solver2x 3 +gcd_upscale_solver2x : skip ${1=4},${2=0} +foreach { +nm:=n m:=[im,iM] ++z[0] 0,0,{floor([w,h]/2)*2-1} => crop ++r. 50%,50%,100%,100%,2 ri. .. => dnup +rv[-2,-1] ++r[0] 100%,100%,100%,1,2 +(0,-0.25,-0.25;0.25,0,-0.25;0.25,0.25,0) ++convolve.. . mirror.. x convolve... .. +rm.. atan2.. . rm. +/. {pi/2} round. 1 mod. 4 -. {im} D:=iM+1 => dirs ++r[dirs] [crop],[crop],[crop],100%,0 => cdirs +r[dnup,crop] 100%,100%,100%,1,2 +repeat $D { +progress {100*$>/$D} ++eq[cdirs] $> ++gcd_solve_kernel[dnup] [crop],$1,[-1] +rm.. +} +rm[dnup,crop,cdirs] +if $2 k[-$D--1] return fi +i[1] [0] =>[1] small +r[0,dirs] 200%,200%,100%,100%,1 +i[1] [0] =>[1] target +repeat $D { ++convolve[0] [-{$<+1}] ++eq[dirs] $> +j[target] ..,0,0,0,0,1,. +rm[-2,-1] +} +k[small,target] ++ri[target] [small],2 sub. [small] +ri. [target] sub[target,-1] rm[small] +k[target] c $m => $nm +} +gcd_warpmap : skip ${1=5},${2=0},${3=0},${4=0},${5=0} +repeat int($!/2) l[$>,{$>+1}] +if $5 rv fi +if $4==3 bm=0 i[0] . else bm=$4 fi +if $2 +gcd_warp[-2,-1] $1,$3 rm... rv[-2,-1] gcd_warp[-2,-1] $2,0,$bm +else gcd_warp[-2,-1] $1,$3,$bm fi +if $4==3 rv fi +done done +gcd_warp : skip ${1=5},${2=0},${3=0} +repeat int($!/2) l[$>,{$>+1}] +wfac={$1%*w} to_rgba[-2,-1] +norm. +blur_xy. $2%,$2% n. 0,255 g. xy a[-2,-1] c +*. -1 n. -$wfac,$wfac warp[0] .,1 rm. +if $3==0 rm. break fi +if $3==1 blend multiply,1,1 else blend softlight,1,1 fi +done done +gcd_wiremap : skip ${1=100},${2=100},${3=0.5},${4=0.5},${5=0} +dm={$!>1" && "$5%2} +l[${arg\ 1+$dm,0,0-1}] +if $dm op=0 +if s==2||s==4 split_opacity. rv[^0] op=1 remove_opacity[0] +elif {0,s==2||s==4} split_opacity[0] op=1 fi +else split_opacity op={$!>1} fi ++norm[0] b. $3% n. 0,$2 *. -1 w={w/2} h={h/2} +r. $1,{round(h/w*$1)},1,3,2 v={w*h} p={(w-1)*h+(h-1)*w} ln={h} +sh. 0 f. x n. -$w,$w rm. +sh. 1 f. y n. -$h,$h rm. permute. cxyz y. +(67.5;73.5;109.5;103.5;51.5;100.5) +($v;$p) +{($1-1)*2},$ln,1,1,if(x%2,-1,2) {($1-1)*2},$ln,1,1,"y*$1+round(x/2)" +a[-2,-1] c permute. cxyz discard. -1 +{($ln-1)*2},$1,1,1,if(x%2,-1,2) {($ln-1)*2},$1,1,1,"round(x/2)*$1+y" +a[-2,-1] c permute. cxyz discard. -1 a[-2,-1] y +if $5%2 ++r[{$dm?$dm+$op:0}] $1,{0,round(h/w*$1)},1,3,3 +z. 0,0,100%,{h-2} +permute. cyxz z.. 0,0,{-2,w-2},100% permute.. cxyz y[-2,-1] a[-2,-1] y +else 1,{$p*3},1,1,255 fi +if $op ++r[1] $1,{0,round(h/w*$1)},1,1,3 gt. 1 +z. 0,0,100%,{h-2} permute. cyxz +z.. 0,0,{-2,w-2},100% permute.. cxyz y[-2,-1] a[-2,-1] y rm[1] +else 1,$p,1,1,1 fi +mv[-6] -3 a[-6--1] y +if $5>1 +f[0] 0 to_a[0] sh[0] 100% f. 255 +j3d[0] ..,50%,50%,{$2*$4},1,1,1,0 negate. rm[-2,-1] +else f[0] 0 j3d[0] .,50%,50%,{$2*$4},1,1,1,0 rm. fi +done +gcd_xbr2x : +repeat $! l[$>] to_rgb[0] +(-1,-1;0,-1;1,-1;-1,0;0,0;1,0;-1,1;0,1;1,1;-1,-2;0,-2;1,-2;-2,-1;-2,0;-2,1;2,-1;2,0;2,1;-1,2;0,2;1,2) +pa_=0 pb_=1 pc_=2 pd_=3 pe_=4 pf_=5 pg_=6 ph_=7 pi_=8 +a1_=9 b1_=10 c1_=11 a0_=12 d0_=13 g0_=14 +c4_=15 f4_=16 i4_=17 g5_=18 h5_=19 i5_=20 +e0=21 e1=22 e2=23 e3=24 +($pe_,$pi_,$ph_,$pf_,$pg_,$pc_,$pd_,$pb_,$f4_,$i4_,$h5_,$i5_,$e1,$e2,$e3;$pe_,$pc_,$pf_,$pb_,$pi_,$pa_,$ph_,$pd_,$b1_,$c1_,$f4_,$c4_,$e0,$e3,$e1;$pe_,$pa_,$pb_,$pd_,$pc_,$pg_,$pf_,$ph_,$d0_,$a0_,$b1_,$a1_,$e2,$e1,$e0;$pe_,$pg_,$pd_,$ph_,$pa_,$pi_,$pb_,$pf_,$h5_,$g5_,$d0_,$g0_,$e3,$e0,$e2) +*[1] -1 +repeat 21 +shift[0] {1,round(i(0,$>))},{1,round(i(1,$>))},0,0,1 done +[0] [0] [0] [0] +=>[0] orig mv[0] $! rm[0] =>[0] kern mv[0] $! +repeat 4 +pe={kern,i(0,$>)} pi={kern,i(1,$>)} ph={kern,i(2,$>)} +pf={kern,i(3,$>)} pg={kern,i(4,$>)} pc={kern,i(5,$>)} +pd={kern,i(6,$>)} pb={kern,i(7,$>)} f4={kern,i(8,$>)} +i4={kern,i(9,$>)} h5={kern,i(10,$>)} i5={kern,i(11,$>)} +n1={kern,i(12,$>)} n2={kern,i(13,$>)} n3={kern,i(14,$>)} ++gcd_eq[$pe,$pf] +gcd_eq[$pe,$ph] or[-2,-1] eq. 0 => lvl1 ++gcd_yuv[$pe,$pc] +gcd_yuv[$pe,$pg] +[-2,-1] ++gcd_yuv[$pi,$h5] +[-2,-1] +gcd_yuv[$pi,$f4] +[-2,-1] ++gcd_yuv[$ph,$pf] *. 4 +[-2,-1] +=> red ++gcd_yuv[$ph,$pd] +gcd_yuv[$ph,$i5] +[-2,-1] ++gcd_yuv[$pf,$i4] +[-2,-1] +gcd_yuv[$pf,$pb] +[-2,-1] ++gcd_yuv[$pe,$pi] *. 4 +[-2,-1] +=> blue ++gcd_yuv[$pe,$pf] +gcd_yuv[$pe,$ph] le[-2,-1] ++image[$ph] [$pf],0,0,0,0,1,. => px rm.. ++lt[red,blue] ++gcd_neq[$pf,$i4] +gcd_neq[$ph,$i5] and[-2,-1] +gcd_eq[$pe,$pi] and[-2,-1] ++gcd_neq[$pf,$pb] +gcd_neq[$ph,$pd] and[-2,-1] or[-2,-1] ++gcd_eq[$pe,$pg] or[-2,-1] +gcd_eq[$pe,$pc] or[-2,-1] +and[-2,-1] => lvl2 ++gcd_yuv[$pf,$pg] => lver ++gcd_yuv[$ph,$pc] => uver ++*[lver] 2 le. [uver] ++gcd_neq[$pg,$pe] +gcd_neq[$pg,$pd] and[-2,-1] +and[-2,-1] and. [lvl2] image[$n3] [px],0,0,0,0,1,. ++*[uver] 2 lt. [lver] ++gcd_neq[$pc,$pe] +gcd_neq[$pc,$pb] and[-2,-1] +and[-2,-1] and. [lvl2] image[$n3] [px],0,0,0,0,1,. +rm[-2,-1,lver,uver] +rm[red,blue,lvl1,lvl2,px] +done +{orig,w},{orig,h},1,1,1 r2dx. {orig,w*2},4 => msk +r2dx[orig,$e0,$e1,$e2,$e3] {orig,w*2},1 +image[orig] [$e0],0,0,0,0,1,[msk] shift[msk] 1 +image[orig] [$e1],0,0,0,0,1,[msk] shift[msk] -1,1 +image[orig] [$e2],0,0,0,0,1,[msk] shift[msk] 1 +image[orig] [$e3],0,0,0,0,1,[msk] +k[orig] +done done +gcd_eq : l[-2,-1] -[-2,-1] norm. eq. 0 done +gcd_neq : l[-2,-1] -[-2,-1] norm. neq. 0 done +gcd_yuv : l[-2,-1] -[-2,-1] abs. rgb2yuv. abs. s. c *... 48 *.. 7 *. 6 +[-3--1] done +fx_gb_cfx : +if $5==1 +noise[0] {$1/1},4 ++fx_bwrecolorize 1,1,0,0,0,1,0,5,0,0,0,255,47,106,121,255,209,136,49,255,228,207,191,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 +fx_compose_edges 0.9,0.5 +else +if $4==1 +fx_bwrecolorize 1,1,0,0,0,1,0,6,0,0,0,255,27,25,55,255,137,152,189,255,191,217,228,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 ++noise[0] {$1/1},4 +compose_interpolation +else +if $3==1 +sepia ++fc[0] 0,65,00 to_rgba[0] +compose_interpolation +noise[0] {$1/1},4 +compose_grainmerge +else +if $2==0 +sepia ++noise[0] $1,4 +compose_grainmerge +else +sepia ++fc[0] 0,0,255 to_rgba[0] +compose_interpolation +noise[0] {$1/2},4 +compose_grainmerge +fi +fi +fi +fi +fx_gb_cfx_preview : +gui_split_preview "fx_gb_cfx ${1--2}",$-1 +gui_gb_about : +fx_logo "GB\'s Filters" +fx_gb_lb : +spread 3 +heat_flow $1 +dilate_circ $2 +compose_lighten +fx_gb_lb_preview : +gui_split_preview "fx_gb_lb ${1--2}",$-1 +fx_gb_pp : +rv +gtutor_blur_img : +l[-2,-1] +if s>3 +remove_opacity. +fi +range={700*$1+700} +rgb2hsl. +s. c +*. $2 +rv[-2,-1] +negate. +*. .. +rv[-3,-1] +/. 360 +*. {2*pi} ++sin. +cos.. +a[-4,-3] c +a[-2,-1] c +eigen2tensor[-2,-1] +repeat 3 +smooth.. .,$range +done +rm. +done +gtutor_blur_img_preview : +gtutor_blur_img ${^0} +#@cli colorwheel : _size>0,_cclock={ 0 | 1 },_angle +#@cli : Generates a square colorwheel in clockface orientation, with zero +#@cli : degrees on top, corresponding to red, and colors transitioning +#@cli : clockwise through green (120 degrees) and blue (240 degrees). size: +#@cli : colorwheel edges, in pixels. cclock, boolean, if true generates a +#@cli : counterclockwise colorwheel, and angle, degrees, rotates the wheel +#@cli : clockwise (negative: counterclockwise) from its reference orientation. +#@cli : Default values: _size=512, _cclock=0, _angle=0 +colorwheel : check ${1=512}>=1 skip ${2=0},${3=0} +e[^-1] "Input colorwheel $1 pixels square; cclockwise=$2; oriented $3 degrees" +$1,$1,1,1,'x=x-w/2;y=y-h/2;((1-2*!!$2)*(atan2(y,x)*180/pi+90-$3))%360' +100%,100%,1,2,1 a[-2,-1] c hsv2rgb. => [colorwheel] +gtutor_hedcut_preview : +gui_split_preview "hedcut ${^0}",$-1 +#@cli hedcut : _contrast=0.5, _lumlevel=0.5, _patsmooth=0.5, _patsize=0.0, _patstep=0.5, _patquality=0 (low=0,high=1), _forcegray=1 (no=0,yes=1) +#@cli : Make a hedcut with a faux intaglio etch pattern. Unless noted, all +#@cli : arguments are floats that range from 0.0 to 1.0. contrast: larger +#@cli : values increase contrast. lumlevel: larger values increases +#@cli : brightness. patsmooth: larger values forces pattern to follow +#@cli : geometry; lower induces turbulence. patsize: larger values increases +#@cli : pattern size. patstep: values alter pattern geometry. Adjust to +#@cli : taste. patquality: Boolean flag. 1=True/On/Yes. Renders oversize for +#@cli : quality. Longer rendering time and more memory will be required (2 +#@cli : GiB minimum for 3000x3000). forcegray: Boolean +#@cli : flag. 1=True/On/Yes. RGB input will be forced to single channel +#@cli : grayscale before processing and returned to RGB after. Output: image +#@cli : in 0-255 range. Channels match input. +hedcut : check "${1=0.5}<=1 && $1>=0 && ${2=0.5}<=1 && $2>=0 && ${3=0.5}<=1 && $3>=0 && ${4=0.0}<=1 && $4>=0 && ${5=0.5}<=1 && $5>=0 && isbool(${6=0}) && isbool(${7=1})" +e[^-1] "Applying faux intaglio etch to selected images. Contrast: "{$1}". Lumenance Level: "$2". Pattern smoothing: "$3". Pattern size: "$4". Pattern stepping: "$5". Quality (low=0,1=high): "$6". Force gray (0=no,1=yes):"$7"." +con={(9.0^$1)} +llv={round(20000*(0.5-$2))/100} +smt={(round((100*(10^$3)/2))/100)+4*$4} +psz={0.0001*(1+99*(1-$4))} +del={$psz+round(1000*(10^(-$4-2)))/1000} +stp={round(2+10*$5)} +qfc={$6} +gry={$7} +tol=30 +spn=0 +repeat $! +l[$>] +remove_opacity. +if $gry +luminance. +fi +s. c +repeat $! +l[$>] +if $qfc ++r2dx. 400%,5 +else +. +fi +spn={(iM-im)/2} +mv. 0 +_multigrad. $stp,$tol,$smt +bandpass. {$psz},{$del} +orientation. +if $qfc +r. ..,..,.,.,5,1 +b. {$con},1,1 +else +b. {$con/4},1,1 +fi +n[-2,-1] {-$spn},{$spn} ++. .. +n. -{(iM-im)/2},{(iM-im)/2} +rm.. +threshold. {$llv} +if $qfc +r2dx. 25%,5 +fi +n. 0,255 +done +done +a c +if $gry +to_rgb +fi +done +done +#@cli _multigrad : _stepsize=5 _tolerance=10 _smooth=5 +_multigrad : skip ${1=50},${2=10},${3=5} +smt=$3 +stp=$1 +tol=$2 +repeat $! +l[$>] +b {$smt} +normalize_local 3,32,4%,2%,1,0,255 +gradient_norm. +ld={log(iM)} ++. 1e-10 +log. +/. {$ld} +cut. 0,1 ++ge. $tol% +if round($smt) +erode_circ. {round(1.5*$smt)} +dilate_circ. {round(1.5*$smt)} +fi +negate.. +n.. 0,1 ++distance. 1,..,0 +rm... +round. 2 +mod. {1+$stp} +threshold 90% ++[-2,-1] +*. -1 ++. 1 +done +done +#@cli tiletex : _texscale=8 autoangle=-1 _keepimag=0 +#@cli : Renders a tilable texture on selected images, taking polar formatted +#@cli : (magnitude, phase angle) seed values from pairs of selected, +#@cli : alternating "Magnitude" and "Angle" images or, if these are constant +#@cli : black, then from internally generated random values. Unless +#@cli : 'autoangle' is positive, input images must form "Magnitude" and +#@cli : "Angle" pairs and each pair must have an equal number of +#@cli : channels. Produces "real" and "imaginary" output images (But note +#@cli : _keepimag, below). 'texscale' sets the size of a square window around +#@cli : the spectral origin where random seeds are set. Larger 'texscales' +#@cli : settings admit higher frequency coefficients, giving rise to finer +#@cli : output details. 'texscale' ranges from 1 upward and defaults to 8. It +#@cli : is ignored if the user has preset coefficients within the input +#@cli : images. Setting 'autoangle' to a positive value in the range [0, 255] +#@cli : eliminates the need for providing "Angle" input images. The provided +#@cli : argument is applied as a default phase angle to all "Magnitude" data +#@cli : and input images are taken to be "Magnitude" data only. 'keepimag' is +#@cli : a trivalued flag: 0, 1 or 2. '0' requests both "Real" and "Imaginary" +#@cli : output pairs and is the default. '1' requests the "Real" output image +#@cli : only; '2' requests the "Imaginary" output image only. +#@cli : Output images are unnormalized and range from negative to positive +#@cli : values, Normalize data accordingly for use with bitmap editors. +tiletex : check "${1=8}>0 && isnum(${2=-1.0}) && ${3=0}>=0 && ${3}<3" +if $2>=0 +addenda2="Common default angle: $2." +else +addenda2="Explicit angles from provided images." +fi +addenda3="Real and imaginary" +if $3!=0 +if $3==1 +addenda3="Real" +else +addenda3="Imaginary" +fi +fi +e[^-1] "Rendering tilable texture on $? at window size $1 "$addenda2". "$addenda3" output to be provided." +rsz={$1} +impla={2*pi*$2/255.0} +all={$3} +iszed=1 +ccc={0,s} +badccc="Selected images have different number of channels. Have you accidently included alpha channels in some (but not all) images?" +repeat $! +if {$>,round(ia)!=0" || "round(iM-im)!=0} +iszed=0 +break +fi +done +if $iszed +repeat $! +l[$<] +if {$<,$ccc!=s} +error $badccc +fi +. +a[-2,-1] c +{2*$rsz+1},{2*$rsz+1},1,{s},(2*u-1)*{wh} +image.. .,{({-2,w}-w)/2},{({-2,h}-h)/2},0,0,1 +rm. +done +done +else +if $impla<0 +if $!%2!=0 +error "Selected images contain data, but selection count is odd. Cannot determine angles for some coefficients. Consider setting an implied angle or providing an even number of images." +fi +repeat $!/2 +l[{2*$<},{2*$<+1}] +if $ccc!={$<,s}" || "$ccc!={{$<+1},s} +error $badccc +fi +s[-2,-1] c +repeat $!/2 +l[{$>},{$!/2+$>}] +/[0,1] 255 +*[1] {2*pi} +polar2complex[0,1] +done +done +a[0--1] c +done +done +else +repeat $! +l[$<] +if $ccc!={$<,s} +error $badccc +fi +[0] +s[-2,-1] c +repeat $!/2 +l[{$>},{$!/2+$>}] +/[0,1] 255 +*[0] {cos($impla)} +*[1] {sin($impla)} +done +done +a[0--1] c +done +done +fi +fi +repeat $! +l[$<] +shift. {-round(w/2)},{-round(h/2)},0,0,2 +s. c,2 +ifft[-2,-1] +if $all!=0 +if $all==1 +rm. +else +rm.. +fi +fi +done +done +gtutor_rectangular_tiling_preview : +gui_split_preview "gtutor_tileit ${2},${1},${3},${8},${4},${7},${5},${6}",0 +is_fc={2*(1-$6)} +u "{$1}{$2}{$3}{$4}{$5}{$6}""{$7}_"$is_fc"{$8}_"$is_fc +_rec_tileit: +gtutor_tileit ${2},${1},${3},${8},${4},${7},${5},${6} +#@cli gtutor_tileit : 0<=_disrupt<=10,0.05<_tsize,0.25<=_spread,0<=_soft,_fillholes:True,-180<=_lightangle<=180,2<=_ccount<=32,_fcolor:False +#@cli : Generate a mosaic from an image. Works best with line art cartoons with flat color. +#@cli : disrupt=5 Rotates, scales and displaces tiles. Suggest 0-10. +#@cli : tsize=1.0 Tile size relative to image. 1.0 → tile diagonal is 2.5% of the image diagonal. +#@cli : spread=1.5 Increasing promotes dropped tiles, gaps at junctions and runs. Suggest 0-3. +#@cli : soft=0.5 Soften and dull shadows and highlights. Suggest 0-5. +#@cli : fillholes=1 True: Fill gaps and holes. No alpha channel. +#@cli : False: Leave gaps and holes. Image has alpha channel. +#@cli : lightangle=45° Degrees: -180° – 180°. Lighting angle. +#@cli : 45°: Light appears to stream from viewer's upper left. +#@cli : ccount=4 Set number of dominant colors, taken from those most frequently occuring in source. +#@cli : fcolor=0 True: Flat color tiling without lighting and shading. +#@cli : False: Do tile lighting and shading. +gtutor_tileit : -check "${1=5}>=0 && $1<=10 && ${2=1.0}>=0.05 && ${3=1.5}>=0.25 && ${4=0.5}>=0 && isbool(${5=1}) && ${6=45}>=-180 && ${6}<=180 && ${7=4}>=2 && ${7}<=32 && isbool(${8=0})" +-echo[^-1] "Applying faux tiling to selected images. Disruption: "${1}". Tile size: "${2}". Tile spread: "${3}". Highlight softening: "${4}". Holes: "${arg\ 1+!$5,filling,leaving}". Light angle: "${6}"°. Color count: "${7}", and "${arg\ 1+!$8,unshaded,shaded}" color." +disrupt=$1 +tsize=$2*0.025*sqrt(w^2+h^2) +spread=$3 +soft=$4 +fillholes=$5 +lightangle=$6 +ccount=$7 +fcolor=$8 +-repeat $! +-local[$>] +-remove_opacity. ++colormap. ${ccount},1,2 +-index.. .,0,1 +-round 1 +1 +-append[-2,-1] x +-name. pallette +-move[pallette] 0 +-name. qcolor ++luminance[qcolor] +-name. qlumin +-normalize[qlumin] 0.6,1 +-input 100%,100%,1,1,'I(#-2,x,y)==I(#-3,0,0)?1:0' +-fill. ">abs( +i-j(1,1,0,0,0,1) +)>iv? +1: +abs( +i-j(1,0,0,0,0,1) +)>iv? +1:0" +-name[-1] outline +-input 100%,100%,1,1 +-name[-1] cost +-plasma[cost] 4,4,{$disrupt} +-normalize[cost] 0,{$disrupt/4.0} ++distance[outline] 1,[cost],1 +-name. distvar ++distance[outline] 1 ++add[-1,-2] +-remove[-3,-2] +[-1] +-name[-1] truedistance +-name[-2] orienter +-gradient[cost] xy +-append[-4,-3] c +-blur[-3] 1,1,1 +-normalize... {-1.5*$disrupt},{1.5*$disrupt} +-name... warper +-round[truedistance] {$spread*$tsize} +-fill[truedistance] "> +abs(i-j(1,1,0,0,0,1))>"{0.5*$spread*$tsize}"? +1: +abs(i-j(1,0,0,0,0,1))>"{0.5*$spread*$tsize}"? +1:0 +" +-gradient[orienter] xy +-append[-3,-2] c +-orientation[orienter] +[-1],[-1],1,4,'[-1,-1,-1,0]' +-name. plottingfield +-fill[plottingfield] ">if( +0=127?255:0' +-fill. 'i>0.05?1:0' +-fill. 'i#-2==0?0:i' +-if $fcolor +-if $fillholes +-fill[plottingfield] 'i#-2==0?I#-5*i#-4:I' +-remove[-2] +-else +-append[-3,-2] c +-fi +-keep[plottingfield] +-else +-distance[heightmap] 1 +-normalize[heightmap] 0,1 +-pow. 0.25 +-blur. 0.875,1,1 +-normalize[heightmap] 0,1 +-if {$fillholes==0} +-fill[heightmap] 'i#-2==0?0:i' +-else +-fill[plottingfield] 'i#-2==0?I#-5*i#-4:I' +-fi +-remove[qcolor,qlumin] +-normalize[plottingfield] 0,1 ++gradient[heightmap] xy +-append[-2,-1] c +({cos($lightangle*pi/180)}^{sin($lightangle*pi/180)}) +-resize. [-2],[-2],[-1],[-1],1 ++mul[-2,-1] +-compose_channels. add +-name. light +-cut. {ia},{iM} +-normalize. 0,1 +-pow. 0.5 +if $soft>0 +-blur. {$soft},1,1 +fi +-mul.. -1 +-mul[-3,-2] +-compose_channels.. add +-name.. shadow +-cut.. {ia#-2},{iM#-2} +-normalize.. 0,1 +-oneminus.. +-pow.. 2 +-mul[plottingfield,shadow] +-mul[light] '{iM#0}' +-add[plottingfield,light] +-normalize[plottingfield] 0,255 +-if {$fillholes==0} +-append[-3,-2] c +-else +-remove.. +-fi +-keep[0] +-fi +-done +-done +iain_2d_scopes: +repeat $! l[$>] +remove_opacity +y_axis=$1 +x_axis=$2 +plot_type=$3 +resolution=$4 +plot_size=$5 +max_samples=$6 +chart_type=$7 +test_pattern=$8 +mirror_y=$9 +mirror_x=$10 +rotate_deg={$11*90} +if $plot_type==3 +remove_duplicates=0 +else +remove_duplicates=1 +fi +luma_sort=1 +if $test_pattern +rm +cube_d={2^$resolution} +$cube_d,$cube_d,$cube_d +to_rgb +split c +fill[0] x +fill[1] y +fill[2] z +n 0,255 +append c +split z +append_tiles 0,0 +split y +append x +fi +split y +append x +if w>$max_samples +resize $max_samples,1 +fi +bsr[0] {8-$resolution} +if $remove_duplicates ++to_rgb[-1] +l[-1] +split c +bsl[1] 8 +bsl[2] 16 +add +done +reverse +append y +sort +,x +discard x +rows 1 +fi +if $luma_sort ++luminance[-1] +reverse +append y +sort +,x +rows 1 +fi +bsl {8-$resolution} ++l[0] +if $x_axis==0 +rgb2yuv8[0] +channels[0] 0 +elif $x_axis==1 +rgb2yuv8[0] +channels[0] 1 +elif $x_axis==2 +rgb2yuv8[0] +channels[0] 2 +elif $x_axis==3 +rgb2hsv8[0] +channels[0] 0 +elif $x_axis==4 +rgb2hsv8[0] +channels[0] 1 +elif $x_axis==5 +rgb2hsv8[0] +channels[0] 2 +elif $x_axis==6 +rgb2lab8[0] +channels[0] 0 +elif $x_axis==7 +rgb2lab8[0] +channels[0] 1 +elif $x_axis==8 +rgb2lab8[0] +channels[0] 2 +elif $x_axis==9 +rgb2lch8[0] +channels[0] 1 +elif $x_axis==10 +rgb2lch8[0] +channels[0] 2 +elif $x_axis==11 +rgb2cmyk[0] +channels[0] 0 +elif $x_axis==12 +rgb2cmyk[0] +channels[0] 1 +elif $x_axis==13 +rgb2cmyk[0] +channels[0] 2 +elif $x_axis==14 +rgb2cmyk[0] +channels[0] 3 +elif $x_axis==15 +channels[0] 0 +elif $x_axis==16 +channels[0] 1 +elif $x_axis==17 +channels[0] 2 +fi +done ++l[0] +if $y_axis==0 +rgb2yuv8[0] +channels[0] 0 +elif $y_axis==1 +rgb2yuv8[0] +channels[0] 1 +elif $y_axis==2 +rgb2yuv8[0] +channels[0] 2 +elif $y_axis==3 +rgb2hsv8[0] +channels[0] 0 +elif $y_axis==4 +rgb2hsv8[0] +channels[0] 1 +elif $y_axis==5 +rgb2hsv8[0] +channels[0] 2 +elif $y_axis==6 +rgb2lab8[0] +channels[0] 0 +elif $y_axis==7 +rgb2lab8[0] +channels[0] 1 +elif $y_axis==8 +rgb2lab8[0] +channels[0] 2 +elif $y_axis==9 +rgb2lch8[0] +channels[0] 1 +elif $y_axis==10 +rgb2lch8[0] +channels[0] 2 +elif $y_axis==11 +rgb2cmyk[0] +channels[0] 0 +elif $y_axis==12 +rgb2cmyk[0] +channels[0] 1 +elif $y_axis==13 +rgb2cmyk[0] +channels[0] 2 +elif $y_axis==14 +rgb2cmyk[0] +channels[0] 3 +elif $y_axis==15 +channels[0] 0 +elif $y_axis==16 +channels[0] 1 +elif $y_axis==17 +channels[0] 2 +fi +done +mul[-1,-2] {$plot_size/256} +$plot_size,$plot_size,1,1,0 +to_rgb[-1] +fill[-1] -1 +repeat {0,w} +if $plot_type==0 +point[-1] {1,i($>)},{2,i($>)},0,1,{0,i($>,0,0,0)},{0,i($>,0,0,1)},{0,i($>,0,0,2)} +elif $plot_type==1 +circle[-1] {1,i($>)},{2,i($>)},0.3%,1,{0,i($>,0,0,0)},{0,i($>,0,0,1)},{0,i($>,0,0,2)} +elif $plot_type==2 +circle_size={max({$<*(1/{0,w})},0.15)} +circle[-1] {1,i($>)},{2,i($>)},$circle_size%,1,{0,i($>,0,0,0)},{0,i($>,0,0,1)},{0,i($>,0,0,2)} +elif $plot_type==3 +l[0] +rgb2hsv split c fill[-1] 1 append c hsv2rgb +done +circle_size={1} +circle[-1] {1,i($>)},{2,i($>)},$circle_size%,0.1,{0,i($>,0,0,0)},{0,i($>,0,0,1)},{0,i($>,0,0,2)} +fi +done +k[-1] +if $chart_type!=0 +100%,100%,1,1 +fill[-1] x +n[-1] 0,255 +l[-1] +if $x_axis==0 ++fill[0] {255/2} ++fill[0] {255/2} +append c +yuv82rgb +elif $x_axis==1 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 2 +append c +yuv82rgb +elif $x_axis==2 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 3 +append c +yuv82rgb +elif $x_axis==3 ++fill[0] {255} ++fill[0] {255} +append c +hsv82rgb +elif $x_axis==4 ++fill[0] {255} ++fill[0] {255} +move[0] 2 +append c +hsv82rgb +elif $x_axis==5 ++fill[0] {0} ++fill[0] {0} +move[0] 3 +append c +hsv82rgb +elif $x_axis==6 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 1 +append c +lab82rgb +elif $x_axis==7 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 2 +append c +lab82rgb +elif $x_axis==8 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 3 +append c +lab82rgb +elif $x_axis==9 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 2 +append c +lch82rgb +elif $x_axis==10 ++fill[0] 180 ++fill[0] 128 +move[0] 3 +append c +lch82rgb +elif $x_axis==11 ++fill[0] {0} ++fill[0] {0} ++fill[0] {0} +move[0] 1 +append c +cmyk2rgb +elif $x_axis==12 ++fill[0] {0} ++fill[0] {0} ++fill[0] {0} +move[0] 2 +append c +cmyk2rgb +elif $x_axis==13 ++fill[0] {0} ++fill[0] {0} ++fill[0] {0} +move[0] 3 +append c +cmyk2rgb +elif $x_axis==14 ++fill[0] {0} ++fill[0] {0} ++fill[0] {0} +move[0] 4 +append c +cmyk2rgb +elif $x_axis==15 ++fill[0] {0} ++fill[0] {0} +move[0] 1 +append c +elif $x_axis==16 ++fill[0] {0} ++fill[0] {0} +move[0] 2 +append c +elif $x_axis==17 ++fill[0] {0} ++fill[0] {0} +move[0] 3 +append c +fi +done +100%,100%,1,1 +fill[-1] y +n[-1] 0,255 +l[-1] +if $y_axis==0 ++fill[0] {255/2} ++fill[0] {255/2} +append c +yuv82rgb +elif $y_axis==1 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 2 +append c +yuv82rgb +elif $y_axis==2 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 3 +append c +yuv82rgb +elif $y_axis==3 ++fill[0] {255} ++fill[0] {255} +append c +hsv82rgb +elif $y_axis==4 ++fill[0] {255} ++fill[0] {255} +move[0] 2 +append c +hsv82rgb +elif $y_axis==5 ++fill[0] {0} ++fill[0] {0} +move[0] 3 +append c +hsv82rgb +elif $y_axis==6 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 1 +append c +lab82rgb +elif $y_axis==7 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 2 +append c +lab82rgb +elif $y_axis==8 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 3 +append c +lab82rgb +elif $y_axis==9 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 2 +append c +lch82rgb +elif $y_axis==10 ++fill[0] 180 ++fill[0] 128 +move[0] 3 +append c +lch82rgb +elif $y_axis==11 ++fill[0] {0} ++fill[0] {0} ++fill[0] {0} +move[0] 1 +append c +cmyk2rgb +elif $y_axis==12 ++fill[0] {0} ++fill[0] {0} ++fill[0] {0} +move[0] 2 +append c +cmyk2rgb +elif $y_axis==13 ++fill[0] {0} ++fill[0] {0} ++fill[0] {0} +move[0] 3 +append c +cmyk2rgb +elif $y_axis==14 ++fill[0] {0} ++fill[0] {0} ++fill[0] {0} +move[0] 4 +append c +cmyk2rgb +elif $y_axis==15 ++fill[0] {0} ++fill[0] {0} +move[0] 1 +append c +elif $y_axis==16 ++fill[0] {0} ++fill[0] {0} +move[0] 2 +append c +elif $y_axis==17 ++fill[0] {0} ++fill[0] {0} +move[0] 3 +append c +fi +done +if $chart_type==1 +100%,100% +100%,100% +linethick[-1] 50%,0,50%,100%,{$plot_size*.01},1,1 +linethick[-2] 0%,50%,100%,50%,{$plot_size*.01},1,1 +mul[1,3] +mul[2,3] +fi +blend[-1,-2] average +if $chart_type==1 +l[-1] ++l[0] split c max done +gt[-1] 0 +replace[-1] 1,128 +laplacian[-1] +abs +max +done +fi ++eq[0] -1 +l[-1] split c min erode_circ {round($plot_size*.1)} blur {$plot_size*.025} done +mul[-1,-2] +fi +max +if $mirror_y +mirror y +fi +if $mirror_x +mirror x +fi +rotate $rotate_deg +done done +iain_smooth_tutorial: +amplitude=$1 +sharpness=$2 +anisotropy=$3 +gradient_smoothness=$4 +tensor_smoothness=$5 +quiver=$6 +remove_opacity ++l[0] +p1={if(0,0.5,1)*max($sharpness,1e-2)} +p2={$p1/(1e-7+1-$anisotropy)} +b $gradient_smoothness n 0,255 structuretensors 0 b $tensor_smoothness +eigen max.. 0 +if s==2 s.. c +[-3,-2] +.. 1 +^.. -$p1 ^... -$p2 a[-3,-1] c +else s.. c +[-4--2] +.. 1 +^.. -$p1 r. 100%,100%,100%,2 ^... -$p2 a[-3,-1] c +fi ++l +l[-1] +split[-1] c ++abs[0] +fill[0] acos(i) +add[0] {pi/2} +mod[0] {pi} +fill[0] cos(i) +rm[1] ++fill[0] 0 +append c +done +l[-2] +split c +add +pow $sharpness +done +to_rgb +mul +resize[0] 400%,400% +100%,100%,1,1,255 ++quiver[1] [0],24,3,0,1 +k[-1] +resize 25%,25%,100%,100%,2 +done +l[-3] +split[0] c +fill[0] 0 +c[1] 1,10 +append[0,1] c +done +l[-2,-3] +eigen2tensor +done +smooth[-1] [-2],5 +rm[-2] +luminance +negate +[0] +blur[-1] 3 +max[-1] 0.1 +fill[-1] 10/i +mul[0] [1] +negate +n 0,255 +c 120,255 +n 0,255 +k[0] +done +if $7 +blur[0] $gradient_smoothness +n[0] 0,255 +else +smooth[0] $amplitude,$sharpness,$anisotropy,$gradient_smoothness,$tensor_smoothness +fi +if $quiver==1 +ac[0] " sub 128 mul 0.5 add 128",ycbcr_y +n[1] 0,1 +mul +elif $quiver==2 +k[1] +else +k[0] +fi +c 0,255 +iain_auto_wb_preview: +iain_auto_wb[0] $1,$2,$3,$4,$5,$6 +rectangle[0] $1%,$2%,$3%,$4%,1,0xffff,255 +iain_auto_wb: +repeat $! l[$>] +remove_opacity +norm_out=$5 +repeats=15 +display_text=0 +rm_outliers=1 +max_pixels={2^16} +lower_limit=5 +upper_limit=200 ++l[0] +target_pixel_number={2^16} +crop $1%,$2%,$3%,$4% ++l[0] split c max done +fill[-1] if(i<$lower_limit||i>$upper_limit,0,1) +good_pixels={-1,is} +pixel_retention_ratio={$good_pixels/{wh}} +scale_factor={sqrt((($target_pixel_number/$pixel_retention_ratio)/{wh}))} +if $scale_factor<1 +resize {w*$scale_factor},{h*$scale_factor},100%,100%,2 +fi +gt[-1] 0 +add[0] 1 +mul[0] [-1] +sub[0] 1 +rm[-1] +split c +unroll[0] x +unroll[1] x +unroll[2] x +discard[0,1,2] x,-1 +append[0,1,2] c ++to_rgb[-1] +l[-1] +split c +bsl[1] 8 +bsl[2] 16 +add +done +reverse +append y +sort +,x +discard x +rows 1 +append c +done ++l[1] +rgb2hsv channels 0 +add[-1] 180 mod[-1] 360 +hv_old={min({0,iv},{1,iv})} +rm +done +hv_old_b=$hv_old +hv_new_A_plus_B_plus=0 +hv_new_A_plus_B_minus=0 +hv_new_A_minus_B_plus=0 +hv_new_A_minus_B_minus=0 +shift_a=0 +shift_b=0 +step_size=3 +repeat $repeats +shift_a_top=$shift_a ++l[1] +iain_rgb_mix_wb[0] {$shift_a+$step_size},{$shift_b+$step_size} +rgb2hsv channels 0 +add[-1] 180 mod[-1] 360 +hv_new_A_plus_B_plus={min({0,iv},{1,iv})} +rm +done ++l[1] +iain_rgb_mix_wb[0] {$shift_a+$step_size},{$shift_b-$step_size} +rgb2hsv channels 0 +add[-1] 180 mod[-1] 360 +hv_new_A_plus_B_minus={min({0,iv},{1,iv})} +rm +done ++l[1] +iain_rgb_mix_wb[0] {$shift_a-$step_size},{$shift_b+$step_size} +rgb2hsv channels 0 +add[-1] 180 mod[-1] 360 +hv_new_A_minus_B_plus={min({0,iv},{1,iv})} +rm +done ++l[1] +iain_rgb_mix_wb[0] {$shift_a-$step_size},{$shift_b-$step_size} +rgb2hsv channels 0 +add[-1] 180 mod[-1] 360 +hv_new_A_minus_B_minus={min({0,iv},{1,iv})} +rm +done +hv_max={max($hv_old,$hv_new_A_plus_B_plus,$hv_new_A_plus_B_minus,$hv_new_A_minus_B_plus,$hv_new_A_minus_B_minus)} +if $hv_old==$hv_max +elif $hv_new_A_plus_B_plus==$hv_max +shift_a={$shift_a+$step_size} +shift_b={$shift_b+$step_size} +hv_old=$hv_new_A_plus_B_plus +elif $hv_new_A_plus_B_minus==$hv_max +shift_a={$shift_a+$step_size} +shift_b={$shift_b-$step_size} +hv_old=$hv_new_A_plus_B_minus +elif $hv_new_A_minus_B_plus==$hv_max +shift_a={$shift_a-$step_size} +shift_b={$shift_b+$step_size} +hv_old=$hv_new_A_minus_B_plus +elif $hv_new_A_minus_B_minus==$hv_max +shift_a={$shift_a-$step_size} +shift_b={$shift_b-$step_size} +hv_old=$hv_new_A_minus_B_minus +fi +step_size={$step_size/2} +red_mul={round((2^$shift_a),0.1,0)} +blue_mul={round((2^$shift_b),0.1,0)} +done +iain_rgb_mix_wb[0] $shift_a,$shift_b +k[0] +if $norm_out +n 0,255 +fi +c 0,255 +if $6 +negate +fi +done +done +iain_rgb_mix_wb: +remove_opacity +split c +mul[0] {2^$1} +mul[2] {2^$2} +append c +automixer: +to_rgb ++split[-1] c +if $2==1 +crop[-1,-2,-3] 40%,40%,60%,60% +fi +bluenoise=${-variance_noise} +remove[-1] +greennoise=${-variance_noise} +remove[-1] +rednoise=${-variance_noise} +remove[-1] +greennoise={$greennoise*0.5} +redadjust={$greennoise/$rednoise} +blueadjust={$greennoise/$bluenoise} +to_rgb ++split[0] c +mul[1] {$redadjust/($redadjust+1+$blueadjust)} +mul[2] {1/($redadjust+1+$blueadjust)} +mul[3] {$blueadjust/($redadjust+1+$blueadjust)} +add[1-3] +if $1==0 +keep[-1] +else ++compose_grainextract +remove[0] +fi +med3stack16: +blend_median +med5stack16: +blend_median +cross16: ++shift[0] 0,1,0,0,2 ++shift[0] 0,-1,0,0,2 ++shift[0] 1,0,0,0,2 ++shift[0] -1,0,0,0,2 +blend_median +ex16: ++shift[0] 1,1,0,0,2 ++shift[0] 1,-1,0,0,2 ++shift[0] -1,-1,0,0,2 ++shift[0] -1,1,0,0,2 +blend_median +hybrid16: ++cross16[0] ++ex16[0] +blend_median +autonr2: ++crop 30%,30%,70%,70% +noise0=${-variance_noise} +remove[-1] +cropwidth={w} +cropheight={h} +resize[0] {w+(64-w%64)},{h+(64-h%64)},1,{s},0,1 +width={w} +height={h} +if $noise0>$2 +denoise[-1] 10,{$noise0*$1},3,5,0,1 +denoise[-1] 10,{$noise0*$1},3,5,0,1 +fi ++resize[0] {$width/2},{$height/2},1,{s},2,1 ++resize[-1] $width,$height,1,{s},3,1 +sub[0] [-1] +remove[-1] +noise1=${-variance_noise} +if $noise1>$2 +denoise[-1] 10,{$noise1*$1},3,5,0,0 +fi ++resize[-1] {$width/4},{$height/4},1,{s},2,1 ++resize[-1] {$width/2},{$height/2},1,{s},3,1 +sub[1] [-1] +remove[-1] +noise2=${-variance_noise} +if $noise2>$2 +denoise[-1] 10,{$noise2*$1},3,5,0,1 +fi ++resize[-1] {$width/8},{$height/8},1,{s},2,1 ++resize[-1] {$width/4},{$height/4},1,{s},3,1 +sub[2] [-1] +remove[-1] +noise3=${-variance_noise} +if $noise3>$2 +denoise[-1] 10,{$noise3*$1},3,5,0,1 +fi +resize[-1] {$width/4},{$height/4},1,{s},3,1 +add[-2] [-1] +remove[-1] +resize[-1] {$width/2},{$height/2},1,{s},3,1 +add[-2] [-1] +remove[-1] +resize[-1] {$width/1},{$height/1},1,{s},3,1 +add[-2] [-1] +remove[-1] +crop 0,0,{$cropwidth-1},{$cropheight-1} +fft_tile3_fft: ++fftpolar[0] +100%,100%,1,1,1 +ellipse[-1] 50%,50%,50%,50%,0,1,$4 +ellipse[-1] 50%,50%,15%,15%,0,1,$5 +ellipse[-1] 50%,50%,5%,5%,0,1,$6 ++add[1] [-1] +threshold[-1] $1 +set[-1] 1,50%,50% +mul[1] [-1] ++ifftpolar[1,2] +remove[0,1,2] +keep[-1] +fft_tile3_clean: +tc={round(w/$2)} tr={round(h/$2)} +split_tiles $tc,$tr +repeat $! local[$>] +fft_tile3_fft[0--1] $1,$2,$3,$4,$5,$6 +done done +append_tiles $tc,$tr +c 0,255 +fft_tile3: ++resize[0] {w+$2},{h+$2},1,1,0,1,1,1 +resize[-1] {w+$2},{h+$2},1,1,0,1,0,0 +fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] $2,$2,{w-$2-1},{h-$2-1} +push={round($2*1.5)} +pull={$2-$push} ++resize[0] {w+$push},{h+$2},1,1,0,1,1,1 +resize[-1] {w+$pull},{h+$2},1,1,0,1,0,0 +fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$push},{$2},{w-$pull-1},{h-($2)-1} ++resize[0] {w+$2},{h+$push},1,1,0,1,1,1 +resize[-1] {w+$2},{h+$pull},1,1,0,1,0,0 +fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] $2,{$push},{w-$2-1},{h-$pull-1} +dia1={round($2/3)} +dia2={$2-$dia1} ++resize[0] {w+$dia1},{h+$dia1},1,1,0,1,1,1 +resize[-1] {w+$dia2},{h+$dia2},1,1,0,1,0,0 +fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$dia1},{$dia1},{w-$dia2-1},{h-$dia2-1} ++resize[0] {w+$dia2},{h+$dia2},1,1,0,1,1,1 +resize[-1] {w+$dia1},{h+$dia1},1,1,0,1,0,0 +fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$dia2},{$dia2},{w-$dia1-1},{h-$dia1-1} +remove[0] +blend_median +nr3: +mul 256 +radius={0.05*(min(h,w))} +[0] +rectangle[-1] 0,0,100%,$radius,1,{ia} +rectangle[-1] 0,0,$radius,100%,1,{ia} +rectangle[-1] 0,100%,100%,{h-$radius},1,{ia} +rectangle[-1] {w-$radius},100%,100%,0,1,{ia} +blur[-1] {$radius/2} +xmin={xm} +ymin={ym} +remove[-1] ++crop[0] {$xmin-$radius},{$ymin-$radius},{$xmin+$radius},{$ymin+$radius} +minnoise=${-variance_noise} +remove[-1] ++sub[0] {250*256} +abs[-1] +rectangle[-1] 0,0,100%,$radius,1,{ia} +rectangle[-1] 0,0,$radius,100%,1,{ia} +rectangle[-1] 0,100%,100%,{h-$radius},1,{ia} +rectangle[-1] {w-$radius},100%,100%,0,1,{ia} +blur[-1] {$radius/2} +xmax={xm} +ymax={ym} ++crop[0] {$xmax-$radius},{$ymax-$radius},{$xmax+$radius},{$ymax+$radius} +maxnoise=${-variance_noise} +remove[-1] ++sub[0] {128*256} +abs[-1] +rectangle[-1] 0,0,100%,$radius,1,{ia} +rectangle[-1] 0,0,$radius,100%,1,{ia} +rectangle[-1] 0,100%,100%,{h-$radius},1,{ia} +rectangle[-1] {w-$radius},100%,100%,0,1,{ia} +blur[-1] {$radius/2} +xave={xm} +yave={ym} +remove[-1] ++crop[0] {$xave-$radius},{$yave-$radius},{$xave+$radius},{$yave+$radius} +midnoise=${-variance_noise} +text[-1] $midnoise,0,0,25,1,{iM} ++sub[0] {64*256} +abs[-1] +rectangle[-1] 0,0,100%,$radius,1,{ia} +rectangle[-1] 0,0,$radius,100%,1,{ia} +rectangle[-1] 0,100%,100%,{h-$radius},1,{ia} +rectangle[-1] {w-$radius},100%,100%,0,1,{ia} +blur[-1] {$radius/2} +xshadow={xm} +yshadow={ym} +remove[-1] ++crop[0] {$xshadow-$radius},{$yshadow-$radius},{$xshadow+$radius},{$yshadow+$radius} +shadownoise=${-variance_noise} ++sub[0] {192*256} +abs[-1] +rectangle[-1] 0,0,100%,$radius,1,{ia} +rectangle[-1] 0,0,$radius,100%,1,{ia} +rectangle[-1] 0,100%,100%,{h-$radius},1,{ia} +rectangle[-1] {w-$radius},100%,100%,0,1,{ia} +blur[-1] {$radius/2} +xbright={xm} +ybright={ym} +remove[-1] ++crop[0] {$xbright-$radius},{$ybright-$radius},{$xbright+$radius},{$ybright+$radius} +brightnoise=${-variance_noise} +shadows={(($minnoise/$shadownoise)*64)} +mids={(($minnoise/$midnoise)*64)} +brights={(($minnoise/$brightnoise)*64)} +whites={(($minnoise/$maxnoise)*64)} +point1={$shadows+32} +point2={$mids+$shadows+32} +point3={$brights+$mids+$shadows+32} +point4={$whites+$brights+$mids+$shadows+32} +keep[0] +cropwidth={w} +cropheight={h} +resize[0] {w+(64-w%64)},{h+(64-h%64)},1,{s},0,1 +width={w} +height={h} +apply_curve[0] 0,0,0,{32*256},{32*256},{96*256},{$point1*256},{160*256},{$point2*256},{223*256},{$point3*256},{287*256},{$point4*256} +sub {128*256} mul .5 add {128*256} ++hybrid16[0] +autonr2[-1] $1,$2 +autonr2[-1] $1,$2 ++sub[0] [1] +add[-1] {128*256} +remove[0] +div[-1] 256 +fft_tile3[-1] {2000-$3},48,0,$4,$5,$6,1 +mul[-1] 256 +sub[-1] {128*256} mul[-1] $7 add[-1] {128*256} +unsharp[0] $8,$9,$10 +unsharp[1] $11,$12,$13 +sub[1] {128*256} +add[0] [1] +remove[1] +sub {128*256} mul 2 add {128*256} +apply_curve[0] 0,0,0,{32*256},{32*256},{$point1*256},{96*256},{$point2*256},{160*256},{$point3*256},{223*256},{$point4*256},{287*256} +div 256 +c 0,255 +crop 0,0,{$cropwidth-1},{$cropheight-1} +iain_brown_spot_clean: +red_radius={($1*2)+1} +green_radius={($1*2)+1} +blue_radius={($2*2)+1} +to_rgb ++l +split c +l[0] +median $red_radius +median $red_radius +median $red_radius +done +l[1] +median $green_radius +median $green_radius +median $green_radius +done +l[2] +median $blue_radius +median $blue_radius +median $blue_radius +done +append c +done +sub[0] [1] +add[0] 128 ++l[0] +rgb2hsv8 +split c +keep[0] +apply_curve 0,0,0,11,0,13,255,65,255,67,0,255,0 +lt 1 +done +sub[0] 128 +mul[0,2] +add +c 0,255 +nozip: +remove_opacity ++l[0] +(1;-1) +convolve[0] [1] +rm[1] +abs +split c +max +done ++l[1] +(1,-1) +convolve[0] [1] +rm[1] +abs +split c +max +done ++l[0] ++l +split c +add +div 3 +done +sub +abs +split c +max +done ++l[1] ++l +split c +add +div 3 +done +sub +abs +split c +max +done +mul[-1,-2] $1 +add[2,4] +add[3,4] +l[-1,-2] +blur 2 +sub +gt 0 +mul 255 +done +append[1,2] c +blend alpha,1,0 +iain_CA_correction: +to_rgb +longest_side={max(w,h)} +split c +l[0] +$longest_side,$longest_side +50%,1 +fill[-1] 1-(x/w) ++mirror[-1] x +mul[-2] -1 +append[-1,-2] x +resize[-1] {1,w},{1,h},1,1,1 +[-1] +rotate[-1] 90 +append[-1,-2] c +rm[1] +resize[1] {0,w},{0,h},{d},{s},0,0,0.5,0.5 +mul[-1] $2 +warp[0] [1],1,$3,1 +keep[0] +done +l[2] +$longest_side,$longest_side +50%,1 +fill[-1] 1-(x/w) ++mirror[-1] x +mul[-2] -1 +append[-1,-2] x +resize[-1] {1,w},{1,h},1,1,1 +[-1] +rotate[-1] 90 +append[-1,-2] c +rm[1] +resize[1] {0,w},{0,h},{d},{s},0,0,0.5,0.5 +mul[-1] $1 +warp[0] [1],1,$3,1 +keep[0] +done +append c +c 0,255 +iain_CA_correction_pr: +to_rgb +x_mul={w/max(w,h)} +y_mul={h/max(w,h)} +if $-1==0 +rx_shift={$2*-1*$x_mul} +ry_shift={$2*-1*$y_mul} +bx_shift={$1*-1*$x_mul} +by_shift={$1*-1*$y_mul} +elif $-1==1 +rx_shift={$2*$x_mul} +ry_shift={$2*-1*$y_mul} +bx_shift={$1*$x_mul} +by_shift={$1*-1*$y_mul} +elif $-1==2 +rx_shift={$2*$x_mul} +ry_shift={$2*$y_mul} +bx_shift={$1*$x_mul} +by_shift={$1*$y_mul} +elif $-1==3 +rx_shift={$2*-1*$x_mul} +ry_shift={$2*$y_mul} +bx_shift={$1*-1*$x_mul} +by_shift={$1*$y_mul} +fi +split c +l[0] +[0] +[0] +fill[1] $rx_shift +fill[2] $ry_shift +append[1,2] c +warp[0] [1],1,$3,1 +keep[0] +done +l[2] +[0] +[0] +fill[1] $bx_shift +fill[2] $by_shift +append[1,2] c +warp[0] [1],1,$3,1 +keep[0] +done +append c +if $-2 +rgb2hsv +split c +fill[-1] .5 +append c +hsv2rgb +sub 128 +mul 2 +add 128 +c 0,255 +fi +iain_detect_moire_preview: ++moire_2018_2[0] $1,$2,$3 +laplacian[-1] +abs[-1] +l[0] +split c +l[1] +(0,1) +resize[-1] [0],0,2 ++mul[0] [1] +eq[1] 0 ++mul[0] [1] +k[2,3] +done +(0.25,0.5,0.25;0.5,1,0.5;0.25,0.5,0.25) +convolve[0,1,2,3] [-1] +rm[-1] +add[1,2] +mul[1] 0.5 +append c +adjust_colors 0,0,0,0,$4,0,255 +done +remove_opacity +add +c 0,255 +iain_detect_moire: +skip $1,$2,$3 +channels 1 ++l[0] +(1,0,1;0,-4,0;1,0,1) +convolve[0] [1] +rm[1] +abs +done ++l[0] +(1,0,-2,0,1) +convolve[0] [1] +rm[1] +abs +done ++l[0] +(1;0;-2;0;1) +convolve[0] [1] +rm[1] +abs +done +add[-1,-2] +rm[0] +sub[0] [1] +k[0] +c 0,255 +l[0] ++l[0] +(1,0,1;1,0,1;1,0,1) +dilate[0] [1] +rm[1] +done ++l[0] +(1,0,1;1,0,1;1,0,1) +erode[0] [1] +rm[1] +done +min[0,1] +max[0,1] +done +mul 10 +c 0,255 +thickness=5 +linethick 0%,0%,100%,0%,$thickness,1,0 +linethick 0%,0%,0%,100%,$thickness,1,0 +linethick 100%,0%,100%,100%,$thickness,1,0 +linethick 0%,100%,100%,100%,$thickness,1,0 +blur $2 +gt $1 +mul 255 +if $3>0 +dilate $3 +fi +if $3<0 +erode {$3*-1} +fi +iain_easy_skin_retouch: +repeat $! l[$>] split_opacity l[0] +str1=$1 +str2={$str1*$3} +str3={$str2*$3} +str4={$str3*$3} +str5={$str4*$3} +str6={$str5*$3} +str7={$str6*$3} +str8={$str7*$3} ++l[0] +repeat $2 +cropwidth={w} +cropheight={h} +resize[0] {w+(256-w%256)},{h+(256-h%256)},1,{s},0,1 +width={w} +height={h} +if $str1!=0 +denoise[0] 10,$str1,3,5,0,1 +fi ++resize[0] {$width/2},{$height/2},1,{s},2,1 ++resize[-1] $width,$height,1,{s},3,1 +blur[-1] .5 +compose_grainextract[0,-1] +if $str2!=0 +denoise[-1] 10,$str2,3,5,0,1 +fi ++resize[-1] {$width/4},{$height/4},1,{s},2,1 ++resize[-1] {$width/2},{$height/2},1,{s},3,1 +blur[-1] .5 +compose_grainextract[1,-1] +if $str3!=0 +denoise[-1] 10,$str3,3,5,0,1 +fi ++resize[-1] {$width/8},{$height/8},1,{s},2,1 ++resize[-1] {$width/4},{$height/4},1,{s},3,1 +blur[-1] .5 +compose_grainextract[2,-1] +if $str4!=0 +denoise[-1] 10,$str4,3,5,0,1 +fi ++resize[-1] {$width/16},{$height/16},1,{s},2,1 ++resize[-1] {$width/8},{$height/8},1,{s},3,1 +blur[-1] .5 +compose_grainextract[3,-1] +if $str5!=0 +denoise[-1] 10,$str5,3,5,0,1 +fi ++resize[-1] {$width/32},{$height/32},1,{s},2,1 ++resize[-1] {$width/16},{$height/16},1,{s},3,1 +blur[-1] .5 +compose_grainextract[4,-1] +if $str6!=0 +denoise[-1] 10,$str6,3,5,0,1 +fi ++resize[-1] {$width/64},{$height/64},1,{s},2,1 ++resize[-1] {$width/32},{$height/32},1,{s},3,1 +blur[-1] .5 +compose_grainextract[5,-1] +if $str7!=0 +denoise[-1] 10,$str7,3,5,0,1 +fi ++resize[-1] {$width/128},{$height/128},1,{s},2,1 ++resize[-1] {$width/64},{$height/64},1,{s},3,1 +blur[-1] .5 +compose_grainextract[6,-1] +if $str8!=0 +denoise[-1] 10,$str8,3,5,0,1 +fi ++resize[-1] {$width/256},{$height/256},1,{s},2,1 ++resize[-1] {$width/128},{$height/128},1,{s},3,1 +blur[-1] .5 +compose_grainextract[7,-1] +resize[-1] {$width/128},{$height/128},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/64},{$height/64},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/32},{$height/32},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/16},{$height/16},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/8},{$height/8},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/4},{$height/4},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/2},{$height/2},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/1},{$height/1},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +crop 0,0,{$cropwidth-1},{$cropheight-1} +done +done +if $4==1 ++compose_grainextract[0,-1] ++rgb2hsv8[-1] +split[-1] c +remove[-1,-2] +add[-1] 30 +mod[-1] 255 +ge[-1] 40 +n[-1] 0,255 +negate[-1] +blur[-1] 4 ++split[-2] c +remove[-1,-2] +move[-1] -2 +append[-2,-1] c ++blend[-1,-2] alpha +remove[-2] +mul[-1] {$10} +mul[-2] {1-$10} +add[-1] [-2] +remove[-2] +l[-1] ++fftpolar[0] +100%,100%,1,1,1 +ellipse[-1] 50%,50%,50%,50%,0,1,$5 +ellipse[-1] 50%,50%,25%,25%,0,1,$6 +ellipse[-1] 50%,50%,12%,12%,0,1,$7 +ellipse[-1] 50%,50%,6%,6%,0,1,$8 +ellipse[-1] 50%,50%,3%,3%,0,1,$9 +ellipse[-1] 50%,50%,0.1%,0.1%,0,1,1 +set[-1] 1,50%,50% +mul[1] [-1] +ifftpolar[1,2] +keep[1] +c 0,255 +done +remove[0] +if $11==0 +compose_grainmerge[-1,-2] +fi +else +keep[-1] +fi +done a c done done +iain_easy_skin_retouch_preview: +iain_easy_skin_retouch ${1--1} +exfuse: +cropwidth={w} +cropheight={h} ++mul[0] {2*$1} ++mul[0] {4*$1} +c 0,255 ++fx_ExposureWeightMap[0] $2,$3,$4,$5,0 ++fx_ExposureWeightMap[1] $2,$3,$4,$5,0 ++fx_ExposureWeightMap[2] $2,$3,$4,$5,0 +parallel " +freq_pyramid[0]"," +freq_pyramid[1]"," +freq_pyramid[2]"," +dumb_pyramid[3]"," +dumb_pyramid[4]"," +dumb_pyramid[5]" +parallel "blur[-1] $6","blur[-2] $6","blur[-3] $6" +replace[-1,-2,-3] 0,0.000000001 ++add[-1,-2,-3] +div[-2] [-1] +div[-3] [-1] +div[-4] [-1] +rm[-1] +parallel " +mul[0] [3]"," +mul[1] [4]"," +mul[2] [5]" +add[0,1,2] +keep[0] +ifreq_pyramid[0] +crop 0,0,{$cropwidth-1},{$cropheight-1} +c 0,255 +dumb_pyramid: +cropwidth={w} +cropheight={h} +resize {w+(1024-w%1024)},{h+(1024-h%1024)},1,3,0,1 +newwidth={w} ++resize[-1] 50%,50%,{d},{s},2 ++resize[-1] 50%,50%,{d},{s},2 ++resize[-1] 50%,50%,{d},{s},2 ++resize[-1] 50%,50%,{d},{s},2 ++resize[-1] 50%,50%,{d},{s},2 +append x +resize {$newwidth*2},100%,1,3,0,0 +ifreq_pyramid: +split x,2 +split[1] x,2 +split[2] x,2 +split[3] x,2 +split[4] x,2 +crop[1] 0,0,100%,{0,h/2-1} +crop[2] 0,0,100%,{0,h/4-1} +crop[3] 0,0,100%,{0,h/8-1} +crop[4] 0,0,100%,{0,h/16-1} +crop[5] 0,0,{4,w/2-1},{0,h/32-1} +resize[-1] {-2,w},{-2,h},{d},{s},3 +add[-1,-2] +resize[-1] {-2,w},{-2,h},{d},{s},3 +add[-1,-2] +resize[-1] {-2,w},{-2,h},{d},{s},3 +add[-1,-2] +resize[-1] {-2,w},{-2,h},{d},{s},3 +add[-1,-2] +resize[-1] {-2,w},{-2,h},{d},{s},3 +add[-1,-2] +freq_pyramid: +cropwidth={w} +cropheight={h} +resize {w+(1024-w%1024)},{h+(1024-h%1024)},1,3,0,1 +newwidth={w} ++resize[-1] 50%,50%,{d},{s},2 ++resize[-1] {-2,w},{-2,h},{d},{s},3 +sub[-3,-1] ++resize[-1] 50%,50%,{d},{s},2 ++resize[-1] {-2,w},{-2,h},{d},{s},3 +sub[-3,-1] ++resize[-1] 50%,50%,{d},{s},2 ++resize[-1] {-2,w},{-2,h},{d},{s},3 +sub[-3,-1] ++resize[-1] 50%,50%,{d},{s},2 ++resize[-1] {-2,w},{-2,h},{d},{s},3 +sub[-3,-1] ++resize[-1] 50%,50%,{d},{s},2 ++resize[-1] {-2,w},{-2,h},{d},{s},3 +sub[-3,-1] +append x +resize {$newwidth*2},100%,1,3,0,0 +exfusion: +cropwidth={w} +cropheight={h} +resize {w+(1024-w%1024)},{h+(1024-h%1024)},1,3,0,1 +repeat 10 +l[-1--4] ++l[0,1,2,3] ++resize[0] 50%,50%,1,3,2 ++resize[-1] 200%,200%,1,3,3 +sub[0,-1] ++resize[1] 50%,50%,1,3,2 ++resize[-1] 200%,200%,1,3,3 +sub[1,-1] ++resize[2] 50%,50%,1,3,2 ++resize[-1] 200%,200%,1,3,3 +sub[2,-1] ++resize[3] 50%,50%,1,3,2 ++resize[-1] 200%,200%,1,3,3 +sub[3,-1] +done ++iain_weightmap[0] 1,$1 ++iain_weightmap[1] 1,$1 ++iain_weightmap[2] 1,$1 ++iain_weightmap[3] 1,$1 ++add[-1,-2,-3,-4] +replace[-1,-2,-3,-4,-5] 0,0.0000000000001 +div[-2] [-1] +div[-3] [-1] +div[-4] [-1] +div[-5] [-1] +rm[-1] +mul[4,12] +mul[5,12] +mul[6,12] +mul[7,12] +add[4,5,6,7] +rm[0,1,2,3] +done +done +l[-1,-2,-3,-4] +parallel " ++iain_weightmap[0] 4,$1"," ++iain_weightmap[1] 4,$1"," ++iain_weightmap[2] 4,$1"," ++iain_weightmap[3] 4,$1" ++add[-1,-2,-3,-4] +replace[-1,-2,-3,-4,-5] 0,0.00000000000001 +div[-2] [-1] +div[-3] [-1] +div[-4] [-1] +div[-5] [-1] +rm[-1] +mul[0,4] +mul[1,4] +mul[2,4] +mul[3,4] +add +done +repeat $!-1 +resize[-1] {-2,w},{-2,h},1,3,3 +add[-1,-2] +done +crop 0,0,{$cropwidth-1},{$cropheight-1} ++l[0] +resize 5%,5%,1,3,2 +done +min={1,im} +max={1,iM} +c[0] $min,$max +keep[0] +n 0,255 +exfusion3: +cropwidth={w} +cropheight={h} +maxlevels={round(log2(min(w,h))+0.5)+$5} +size={2^$maxlevels} +resize {w+($size-w%$size)},{h+($size-h%$size)},1,3,0,1 +repeat $maxlevels +l[-1--3] ++l[0,1,2] ++resize[0] 50%,50%,1,3,2 ++resize[-1] 200%,200%,1,3,5 +sub[0,-1] ++resize[1] 50%,50%,1,3,2 ++resize[-1] 200%,200%,1,3,5 +sub[1,-1] ++resize[2] 50%,50%,1,3,2 ++resize[-1] 200%,200%,1,3,5 +sub[2,-1] +done +[0] +fx_ExposureWeightMap[-1] $1,$2,$3,$4,0 +[1] +fx_ExposureWeightMap[-1] $1,$2,$3,$4,0 +[2] +fx_ExposureWeightMap[-1] $1,$2,$3,$4,0 +rm[0,1,2] ++add[-1,-2,-3] +replace[-1,-2,-3,-4] 0,0.0000000000001 +div[-2] [-1] +div[-3] [-1] +div[-4] [-1] +rm[-1] +mul[0,6] +mul[1,6] +mul[2,6] +add[0,1,2] +done +done +l[-1,-2,-3] +if $6 +iain_fast_median_stack +else +[0] +[1] +[2] +parallel " +fx_ExposureWeightMap[-1] $1,$2,$3,$4,0"," +fx_ExposureWeightMap[-2] $1,$2,$3,$4,0"," +fx_ExposureWeightMap[-3] $1,$2,$3,$4,0" ++add[-1,-2,-3] +replace[-1,-2,-3,-4] 0,0.0000000000001 +div[-2] [-1] +div[-3] [-1] +div[-4] [-1] +rm[-1] +mul[0,3] +mul[1,3] +mul[2,3] +add +fi +done +repeat $!-1 +resize[-1] {-2,w},{-2,h},1,3,5 +add[-1,-2] +done +crop 0,0,{$cropwidth-1},{$cropheight-1} ++l[0] +resize 5%,5%,1,3,2 +done +min={1,im} +max={1,iM} +c[0] $min,$max +keep[0] +n 0,255 +exfusion5: +images=$! +cropwidth={w} +cropheight={h} +maxlevels={round(log2(min(w,h))+0.5)+0} +size={2^$maxlevels} +remove_opacity +resize {w+($size-w%$size)},{h+($size-h%$size)},1,3,0,1,0.5,0.5 ++l[0-{$images-1}] +repeat $! local[$>] +fx_ExposureWeightMap[0] $1,$2,$3,$4,0 +done done +done +l[-1--$images] ++add +replace 0,0.0000000000001 +repeat $!-1 +div[$<] [-1] +done +rm[-1] +done +repeat $maxlevels +l[-1--{$images*2}] ++l[0-{$images-1}] +repeat $! local[$>] ++resize[0] 50%,50%,1,3,2 +resize[-1] 200%,200%,1,3,5,0 +sub[0,-1] +done done +done +l[-1--{$images*2}] +repeat $images local[$>,{$>+$images}] +mul[-1] [-2] +done done +done +l[-1--$images] +add +done +move[-1] 0 +l[-1--{$images*2}] +repeat $! local[$>] +resize[0] 50%,50%,1,3,2 +done done +done +done +done +l[-1--{$images*2}] +if 1 +repeat $images local[$>,{$>+$images}] +mul[-1] [-2] +done done +keep[-1--$images] +add +else +keep[0--{$images-1}] +add +div $images +fi +done +repeat $!-1 +resize[-1] {-2,w},{-2,h},1,3,5,0 +add[-1,-2] +done +resize $cropwidth,$cropheight,1,3,0,1,0.5,0.5 +n 0,255 +mul 1000 +apply_curve 1,0,0,128000,{($6*1000)+128000},255000,255000 +mul 0.001 ++iain_fast_denoise $5,$5,1,{$5/100},0 +sub[1] [0] +mul[1] -1 ++add +c 0,255 +rm[1] +reverse +rgb2lch +split c +keep[0,4,5] +append c +lch2rgb +iain_fast_formula: +256,1 +fill[-1] x +local[1] +$1 +done +crv0={1,[0]} +crv1={1,[1]} +crv2={1,[2]} +crv3={1,[3]} +crv4={1,[4]} +crv5={1,[5]} +crv6={1,[6]} +crv7={1,[7]} +crv8={1,[8]} +crv9={1,[9]} +crv10={1,[10]} +crv11={1,[11]} +crv12={1,[12]} +crv13={1,[13]} +crv14={1,[14]} +crv15={1,[15]} +crv16={1,[16]} +crv17={1,[17]} +crv18={1,[18]} +crv19={1,[19]} +crv20={1,[20]} +crv21={1,[21]} +crv22={1,[22]} +crv23={1,[23]} +crv24={1,[24]} +crv25={1,[25]} +crv26={1,[26]} +crv27={1,[27]} +crv28={1,[28]} +crv29={1,[29]} +crv30={1,[30]} +crv31={1,[31]} +crv32={1,[32]} +crv33={1,[33]} +crv34={1,[34]} +crv35={1,[35]} +crv36={1,[36]} +crv37={1,[37]} +crv38={1,[38]} +crv39={1,[39]} +crv40={1,[40]} +crv41={1,[41]} +crv42={1,[42]} +crv43={1,[43]} +crv44={1,[44]} +crv45={1,[45]} +crv46={1,[46]} +crv47={1,[47]} +crv48={1,[48]} +crv49={1,[49]} +crv50={1,[50]} +crv51={1,[51]} +crv52={1,[52]} +crv53={1,[53]} +crv54={1,[54]} +crv55={1,[55]} +crv56={1,[56]} +crv57={1,[57]} +crv58={1,[58]} +crv59={1,[59]} +crv60={1,[60]} +crv61={1,[61]} +crv62={1,[62]} +crv63={1,[63]} +crv64={1,[64]} +crv65={1,[65]} +crv66={1,[66]} +crv67={1,[67]} +crv68={1,[68]} +crv69={1,[69]} +crv70={1,[70]} +crv71={1,[71]} +crv72={1,[72]} +crv73={1,[73]} +crv74={1,[74]} +crv75={1,[75]} +crv76={1,[76]} +crv77={1,[77]} +crv78={1,[78]} +crv79={1,[79]} +crv80={1,[80]} +crv81={1,[81]} +crv82={1,[82]} +crv83={1,[83]} +crv84={1,[84]} +crv85={1,[85]} +crv86={1,[86]} +crv87={1,[87]} +crv88={1,[88]} +crv89={1,[89]} +crv90={1,[90]} +crv91={1,[91]} +crv92={1,[92]} +crv93={1,[93]} +crv94={1,[94]} +crv95={1,[95]} +crv96={1,[96]} +crv97={1,[97]} +crv98={1,[98]} +crv99={1,[99]} +crv100={1,[100]} +crv101={1,[101]} +crv102={1,[102]} +crv103={1,[103]} +crv104={1,[104]} +crv105={1,[105]} +crv106={1,[106]} +crv107={1,[107]} +crv108={1,[108]} +crv109={1,[109]} +crv110={1,[110]} +crv111={1,[111]} +crv112={1,[112]} +crv113={1,[113]} +crv114={1,[114]} +crv115={1,[115]} +crv116={1,[116]} +crv117={1,[117]} +crv118={1,[118]} +crv119={1,[119]} +crv120={1,[120]} +crv121={1,[121]} +crv122={1,[122]} +crv123={1,[123]} +crv124={1,[124]} +crv125={1,[125]} +crv126={1,[126]} +crv127={1,[127]} +crv128={1,[128]} +crv129={1,[129]} +crv130={1,[130]} +crv131={1,[131]} +crv132={1,[132]} +crv133={1,[133]} +crv134={1,[134]} +crv135={1,[135]} +crv136={1,[136]} +crv137={1,[137]} +crv138={1,[138]} +crv139={1,[139]} +crv140={1,[140]} +crv141={1,[141]} +crv142={1,[142]} +crv143={1,[143]} +crv144={1,[144]} +crv145={1,[145]} +crv146={1,[146]} +crv147={1,[147]} +crv148={1,[148]} +crv149={1,[149]} +crv150={1,[150]} +crv151={1,[151]} +crv152={1,[152]} +crv153={1,[153]} +crv154={1,[154]} +crv155={1,[155]} +crv156={1,[156]} +crv157={1,[157]} +crv158={1,[158]} +crv159={1,[159]} +crv160={1,[160]} +crv161={1,[161]} +crv162={1,[162]} +crv163={1,[163]} +crv164={1,[164]} +crv165={1,[165]} +crv166={1,[166]} +crv167={1,[167]} +crv168={1,[168]} +crv169={1,[169]} +crv170={1,[170]} +crv171={1,[171]} +crv172={1,[172]} +crv173={1,[173]} +crv174={1,[174]} +crv175={1,[175]} +crv176={1,[176]} +crv177={1,[177]} +crv178={1,[178]} +crv179={1,[179]} +crv180={1,[180]} +crv181={1,[181]} +crv182={1,[182]} +crv183={1,[183]} +crv184={1,[184]} +crv185={1,[185]} +crv186={1,[186]} +crv187={1,[187]} +crv188={1,[188]} +crv189={1,[189]} +crv190={1,[190]} +crv191={1,[191]} +crv192={1,[192]} +crv193={1,[193]} +crv194={1,[194]} +crv195={1,[195]} +crv196={1,[196]} +crv197={1,[197]} +crv198={1,[198]} +crv199={1,[199]} +crv200={1,[200]} +crv201={1,[201]} +crv202={1,[202]} +crv203={1,[203]} +crv204={1,[204]} +crv205={1,[205]} +crv206={1,[206]} +crv207={1,[207]} +crv208={1,[208]} +crv209={1,[209]} +crv210={1,[210]} +crv211={1,[211]} +crv212={1,[212]} +crv213={1,[213]} +crv214={1,[214]} +crv215={1,[215]} +crv216={1,[216]} +crv217={1,[217]} +crv218={1,[218]} +crv219={1,[219]} +crv220={1,[220]} +crv221={1,[221]} +crv222={1,[222]} +crv223={1,[223]} +crv224={1,[224]} +crv225={1,[225]} +crv226={1,[226]} +crv227={1,[227]} +crv228={1,[228]} +crv229={1,[229]} +crv230={1,[230]} +crv231={1,[231]} +crv232={1,[232]} +crv233={1,[233]} +crv234={1,[234]} +crv235={1,[235]} +crv236={1,[236]} +crv237={1,[237]} +crv238={1,[238]} +crv239={1,[239]} +crv240={1,[240]} +crv241={1,[241]} +crv242={1,[242]} +crv243={1,[243]} +crv244={1,[244]} +crv245={1,[245]} +crv246={1,[246]} +crv247={1,[247]} +crv248={1,[248]} +crv249={1,[249]} +crv250={1,[250]} +crv251={1,[251]} +crv252={1,[252]} +crv253={1,[253]} +crv254={1,[254]} +crv255={1,[255]} +apply_curve[0] 0,0,$crv0,1,$crv1,2,$crv2,3,$crv3,4,$crv4,5,$crv5,6,$crv6,7,$crv7,8,$crv8,9,$crv9,10,$crv10,11,$crv11,12,$crv12,13,$crv13,14,$crv14,15,$crv15,16,$crv16,17,$crv17,18,$crv18,19,$crv19,20,$crv20,21,$crv21,22,$crv22,23,$crv23,24,$crv24,25,$crv25,26,$crv26,27,$crv27,28,$crv28,29,$crv29,30,$crv30,31,$crv31,32,$crv32,33,$crv33,34,$crv34,35,$crv35,36,$crv36,37,$crv37,38,$crv38,39,$crv39,40,$crv40,41,$crv41,42,$crv42,43,$crv43,44,$crv44,45,$crv45,46,$crv46,47,$crv47,48,$crv48,49,$crv49,50,$crv50,51,$crv51,52,$crv52,53,$crv53,54,$crv54,55,$crv55,56,$crv56,57,$crv57,58,$crv58,59,$crv59,60,$crv60,61,$crv61,62,$crv62,63,$crv63,64,$crv64,65,$crv65,66,$crv66,67,$crv67,68,$crv68,69,$crv69,70,$crv70,71,$crv71,72,$crv72,73,$crv73,74,$crv74,75,$crv75,76,$crv76,77,$crv77,78,$crv78,79,$crv79,80,$crv80,81,$crv81,82,$crv82,83,$crv83,84,$crv84,85,$crv85,86,$crv86,87,$crv87,88,$crv88,89,$crv89,90,$crv90,91,$crv91,92,$crv92,93,$crv93,94,$crv94,95,$crv95,96,$crv96,97,$crv97,98,$crv98,99,$crv99,100,$crv100,101,$crv101,102,$crv102,103,$crv103,104,$crv104,105,$crv105,106,$crv106,107,$crv107,108,$crv108,109,$crv109,110,$crv110,111,$crv111,112,$crv112,113,$crv113,114,$crv114,115,$crv115,116,$crv116,117,$crv117,118,$crv118,119,$crv119,120,$crv120,121,$crv121,122,$crv122,123,$crv123,124,$crv124,125,$crv125,126,$crv126,127,$crv127,128,$crv128,129,$crv129,130,$crv130,131,$crv131,132,$crv132,133,$crv133,134,$crv134,135,$crv135,136,$crv136,137,$crv137,138,$crv138,139,$crv139,140,$crv140,141,$crv141,142,$crv142,143,$crv143,144,$crv144,145,$crv145,146,$crv146,147,$crv147,148,$crv148,149,$crv149,150,$crv150,151,$crv151,152,$crv152,153,$crv153,154,$crv154,155,$crv155,156,$crv156,157,$crv157,158,$crv158,159,$crv159,160,$crv160,161,$crv161,162,$crv162,163,$crv163,164,$crv164,165,$crv165,166,$crv166,167,$crv167,168,$crv168,169,$crv169,170,$crv170,171,$crv171,172,$crv172,173,$crv173,174,$crv174,175,$crv175,176,$crv176,177,$crv177,178,$crv178,179,$crv179,180,$crv180,181,$crv181,182,$crv182,183,$crv183,184,$crv184,185,$crv185,186,$crv186,187,$crv187,188,$crv188,189,$crv189,190,$crv190,191,$crv191,192,$crv192,193,$crv193,194,$crv194,195,$crv195,196,$crv196,197,$crv197,198,$crv198,199,$crv199,200,$crv200,201,$crv201,202,$crv202,203,$crv203,204,$crv204,205,$crv205,206,$crv206,207,$crv207,208,$crv208,209,$crv209,210,$crv210,211,$crv211,212,$crv212,213,$crv213,214,$crv214,215,$crv215,216,$crv216,217,$crv217,218,$crv218,219,$crv219,220,$crv220,221,$crv221,222,$crv222,223,$crv223,224,$crv224,225,$crv225,226,$crv226,227,$crv227,228,$crv228,229,$crv229,230,$crv230,231,$crv231,232,$crv232,233,$crv233,234,$crv234,235,$crv235,236,$crv236,237,$crv237,238,$crv238,239,$crv239,240,$crv240,241,$crv241,242,$crv242,243,$crv243,244,$crv244,245,$crv245,246,$crv246,247,$crv247,248,$crv248,249,$crv249,250,$crv250,251,$crv251,252,$crv252,253,$crv253,254,$crv254,255,$crv255 +keep[0] +iain_fast_median_stack: +if $!>2 +if $!%2!=0 +repeat $!/2 +repeat $!-1 +l[$>,{$>+1}] ++max[0,1] +min[0,1] +done +done +progress {($>/$!)*200} +done +keep[{round(($!/2)-.5)}] +else +repeat ($!/2)+1 +repeat $!-1 +l[$>,{$>+1}] ++max[0,1] +min[0,1] +done +done +progress {($>/$!)*200} +done +keep[{round(($!/2)-.5)},{round({$!/2}-.5)-1}] +add +mul .5 +fi +elif $!==2 +add +mul .5 +elif $!==1 +fi +iain_median_3_stack: +iain_fast_median_stack +iain_median_4_stack: +iain_fast_median_stack +iain_median_5_stack: +iain_fast_median_stack +fft_tile_fft: ++fftpolar[0] ++threshold[1] $1 +set[-1] 1,50%,50% +mul[1] [-1] ++ifftpolar[1,2] +keep[-1] +fft_tile_clean: +tc={round(w/$2)} tr={round(h/$2)} +split_tiles $tc,$tr +repeat $! local[$>] +fft_tile_fft[0--1] $1 +done done +append_tiles $tc,$tr +c 0,255 +fft_tile: ++resize[0] {w+$2},{h+$2},1,1,0,1,1,1 +resize[-1] {w+$2},{h+$2},1,1,0,1,0,0 +fft_tile_clean[-1] $1,$2 +crop[-1] $2,$2,{w-$2-1},{h-$2-1} +if $3==0 +push={round($2*1.5)} +pull={$2-$push} ++resize[0] {w+$push},{h+$2},1,1,0,1,1,1 +resize[-1] {w+$pull},{h+$2},1,1,0,1,0,0 +fft_tile_clean[-1] $1,$2 +crop[-1] {$push},{$2},{w-$pull-1},{h-($2)-1} ++resize[0] {w+$2},{h+$push},1,1,0,1,1,1 +resize[-1] {w+$2},{h+$pull},1,1,0,1,0,0 +fft_tile_clean[-1] $1,$2 +crop[-1] $2,{$push},{w-$2-1},{h-$pull-1} +dia1={round($2/3)} +dia2={$2-$dia1} ++resize[0] {w+$dia1},{h+$dia1},1,1,0,1,1,1 +resize[-1] {w+$dia2},{h+$dia2},1,1,0,1,0,0 +fft_tile_clean[-1] $1,$2 +crop[-1] {$dia1},{$dia1},{w-$dia2-1},{h-$dia2-1} ++resize[0] {w+$dia2},{h+$dia2},1,1,0,1,1,1 +resize[-1] {w+$dia1},{h+$dia1},1,1,0,1,0,0 +fft_tile_clean[-1] $1,$2 +crop[-1] {$dia2},{$dia2},{w-$dia1-1},{h-$dia1-1} +fi +remove[0] +if $3==0 +blend_median +fi +fft_tile_preview: +fft_tile $1,$2,$3 +n 0,255 +fill_holes: +ac " +if $5==0 +if $6==1 ++dilate[-1] $1 +erode[-1] $2 +compose_lighten +dilate[-1] $3 +erode[-1] $3 +fi +if $6==0 ++dilate_circ[-1] $1 +erode_circ[-1] $2 +compose_lighten +dilate_circ[-1] $3 +erode_circ[-1] $3 +fi +fi +c 0,255 +if $5==1 +if $6==1 ++erode[-1] $1 +dilate[-1] $2 +compose_darken +erode[-1] $3 +dilate[-1] $3 +fi +if $6==0 ++erode_circ[-1] $1 +dilate_circ[-1] $2 +compose_darken +erode_circ[-1] $3 +dilate_circ[-1] $3 +fi +fi +c 0,255 +",$4 +fill_holes_preview: +fill_holes $1,$2,$3,$4,$5,$6 +iain_descreen2: +channels 0 +fftpolar ++blur[0] $1% +sub[-1] [0] +gt[-1] $2 +circle[-1] 50%,50%,$3%,1,1 +mul[0] [-1] +keep[0,1] +ifftpolar +c 0,255 +iain_halftone_shapes: +warp_it=$7 +remove_opacity +scale=$1 +luminance +if $4==1 +resize 400%,400%,1,1,3 +scale={$scale*4} +fi +if $3==0 +sx1=353 +sx2=515 +sx3=677 +sx4=1000 +sx5=1323 +sx6=1485 +sx7=1647 +sx8=1485 +sx9=1323 +sx10=1000 +sx11=677 +sx12=515 +sy1=1000 +sy2=1280 +sy3=1560 +sy4=1560 +sy5=1560 +sy6=1280 +sy7=1000 +sy8=720 +sy9=440 +sy10=440 +sy11=440 +sy12=720 +level=19 +luminance ++l +rm +2000,2000,1,1,0 +repeat 19 +polygon 12,$sx1,$sy1,$sx2,$sy2,$sx3,$sy3,$sx4,$sy4,$sx5,$sy5,$sx6,$sy6,$sx7,$sy7,$sx8,$sy8,$sx9,$sy9,$sx10,$sy10,$sx11,$sy11,$sx12,$sy12,1,$level +sy3={$sy3-(78/16)} +sy5={$sy5-(78/16)} +sy9={$sy9+(78/16)} +sy11={$sy11+(78/16)} +sx1={$sx1+(90/16)} +sx3={$sx3+(45/16)} +sx5={$sx5-(45/16)} +sx7={$sx7-(90/16)} +sx9={$sx9-(45/16)} +sx11={$sx11+(45/16)} +level={$level+10} +done +radius={560} +level=209 +repeat 57 +circle 50%,50%,$radius,1,$level +radius={$radius-10} +level={$level+10} +done +n 0,255 ++shift[0] 972,560,0,0 ++shift[0] 972,-560,0,0 ++shift[0] -972,560,0,0 ++shift[0] -972,-560,0,0 +add +crop 29,440,1972,1560 +done +resize[1] 194,112,1,1,2 +equalize[1] 65555 +resize[1] $scale%,$scale%,1,1,3 +if $2==1 +negate[1] +fi +fi +if $3==1 +sx1=50 +sx2=194 +sx3=281 +sx4=511 +sx5=742 +sx6=829 +sx7=972 +sx8=829 +sx9=742 +sx10=511 +sx11=281 +sx12=192 +sy1=450 +sy2=633 +sy3=849 +sy4=817 +sy5=849 +sy6=633 +sy7=450 +sy8=267 +sy9=50 +sy10=83 +sy11=50 +sy12=267 +level=10 +luminance ++l +rm +2000,2000,1,1,0 +repeat 128 +polygon 12,$sx1,$sy1,$sx2,$sy2,$sx3,$sy3,$sx4,$sy4,$sx5,$sy5,$sx6,$sy6,$sx7,$sy7,$sx8,$sy8,$sx9,$sy9,$sx10,$sy10,$sx11,$sy11,$sx12,$sy12,1,$level +sx2={$sx2+(40/16)} +sx6={$sx6-(40/16)} +sx8={$sx8-(40/16)} +sx12={$sx12+(40/16)} +sy2={$sy2-(23/16)} +sy4={$sy4-(47/16)} +sy6={$sy6-(23/16)} +sy8={$sy8+(23/16)} +sy10={$sy10+(47/16)} +sy12={$sy12+(23/16)} +level={$level+12} +done +n 0,255 +resize 200,200,1,1,3 ++shift[0] -69,-40,0,0 ++shift[0] -69,40,0,0 ++shift[0] 69,-40,0,0 ++shift[0] 69,40,0,0 +add +crop 5,5,142,84 +done +resize[1] 194,112,1,1,2 +equalize[1] 65555 +resize[1] $scale%,$scale%,1,1,3 +if $2==1 +negate[1] +fi +fi +if $3==2 +sx1=161 +sx2=1000 +sx3=1839 +sy1=273 +sy2=1727 +sy3=273 +level=10 +luminance ++l +rm +2000,2000,1,1,0 +repeat 375 +polygon 3,$sx1,$sy1,$sx2,$sy2,$sx3,$sy3,1,$level +sx1={$sx1+2.21} +sx3={$sx3-2.21} +sy1={$sy1+1.28} +sy2={$sy2-2.56} +sy3={$sy3+1.28} +level={$level+1} +done ++rotate[0] 180 ++shift[1] {840+2} +shift[1] -840 +add +crop 160,{216+56},1842,1727 +n 0,255 +done +equalize[1] 256 +resize[1] 168,145,1,1,2 +resize[1] $scale%,$scale%,1,1,3 +if $2==1 +negate[1] +fi +fi +if $3==3 +luminance ++l +rm +l +190,190,1,1,0 +circle 50,50,50,1,10 +circle 140,50,50,1,10 +polygon 5,10,80,50,50,140,50,180,80,95,190,1,10 +resize[-1] {0,w+2},{0,h+2},1,1,0,0,0.5,0.5 ++resize[0] 95%,95%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 90%,90%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 85%,85%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 75%,75%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 65%,65%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 55%,55%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 50%,50%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 45%,45%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 40%,40%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 35%,35%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 30%,30%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 25%,25%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 20%,20%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 15%,15%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 10%,10%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 5%,5%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 +add +done +[0] +append y +resize 200%,100%,1,1,0,0,0.5,0.5 ++shift[0] 160,100,0,0 ++shift[0] -160,100,0,0 +add +crop 30,190,350,100% +n 0,255 +done +resize[-1] $scale,$scale,1,1,2 +if $2==1 +negate[1] +fi +fi +width={w} +height={h} +w_tiles={round({0,w}/$width)} +h_tiles={round({0,h}/$height)} +total_tiles=$h_tiles*$w_tiles +[-1]x{$total_tiles-1} +append_tiles[1--1] $w_tiles,$h_tiles +equalize[-1] 256 +if $warp_it +rotate[-1] $5,1,2,50%,50% +twirl[-1] $6,.5,.5,2 +fi +blend alpha,0.5,1 +gt 128 +mul 255 +if $4==1 +resize 25%,25%,1,1,3 +fi +iain_hearttone: +if $2>0 ++iain_fast_denoise[0] $2,0,1,0,0 +sub[1] [0] +mul[1] -1 +add +n 0,255 +fi +luminance ++l +rm +l +190,190,1,1,0 +circle 50,50,50,1,10 +circle 140,50,50,1,10 +polygon 5,10,80,50,50,140,50,180,80,95,190,1,10 +resize[-1] {0,w+2},{0,h+2},1,1,0,0,0.5,0.5 ++resize[0] 95%,95%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 90%,90%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 85%,85%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 75%,75%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 65%,65%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 55%,55%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 50%,50%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 45%,45%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 40%,40%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 35%,35%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 30%,30%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 25%,25%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 20%,20%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 15%,15%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 10%,10%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 5%,5%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 +add +done +[0] +append y +resize 200%,100%,1,1,0,0,0.5,0.5 ++shift[0] 160,100,0,0 ++shift[0] -160,100,0,0 +add +crop 30,190,350,100% +n 0,255 +done +resize[-1] $1,$1,1,1,2 +width={w} +height={h} +w_tiles={0,round(w/$width)} +h_tiles={0,round(h/$height)} +total_tiles=$h_tiles*$w_tiles +[-1]x{$total_tiles-1} +append_tiles[1--1] $w_tiles,$h_tiles +equalize[-1] 256 +blend alpha,0.5,1 +gt 128 +mul 255 +iain_2x: +repeat $! local[$>] +resize[0] 200%,200%,1,3,4 +split c +repeat $! local[$>] ++l[0] +(0,0,0.5;0,1,0;0.5,0,0) +convolve[0] [1] +remove[1] +done ++l[0] +(0.5,0,0;0,1,0;0,0,0.5) +convolve[0] [1] +remove[1] +done +remove[0] ++l[0] +(0,0,0.5;0,-1,0;0.5,0,0) +convolve[0] [1] +remove[1] +abs +done ++l[1] +(0.5,0,0;0,-1,0;0,0,0.5) +convolve[0] [1] +remove[1] +abs +done +dilate[-1,-2] 3 +sub[-2] [-1] +remove[-1] +l[-1] ++lt[0] 0 ++gt[0] 0 +fill[0] 0 +sub[0] [1] +add[0] [-1] +keep[0] +add[0] 1 +mul[0] 127.5 +done +append[1,2] c +blend alpha,1,0 ++l[0] +(0.5,1,0.5) +convolve[0] [1] +remove[1] +done ++l[0] +(0.5;1;0.5) +convolve[0] [1] +remove[1] +done +remove[0] ++l[0] +(0.5,-1,0.5) +convolve[0] [1] +remove[1] +abs +done ++l[1] +(0.5;-1;0.5) +convolve[0] [1] +remove[1] +abs +done +blur[-1,-2] 3 +sub[-2] [-1] +remove[-1] +l[-1] ++lt[0] 0 ++gt[0] 0 +fill[0] 0 +sub[0] [1] +add[0] [-1] +keep[0] +add[0] 1 +mul[0] 127.5 +done +append[1,2] c +blend alpha,1,0 +done done +append c +done done +iain_demosiac: +to_rgb +add 1000 +rgb2bayer $1,1 +replace 0,0.0000000001 ++l[0] +replace 0,0.000000001 ++l[0] +to_rgb ++split[0] c +split[0] c +name[0] red +name[1] green +name[2] blue +name[-3] redblur +name[-2] greenblur +name[-1] blueblur +(0.25,.5,0.5,.5,0.25) +convolve[redblur] [-1] +convolve[blueblur] [-1] +remove[-1] +(1;1) +convolve[redblur] [-1] +convolve[blueblur] [-1] +remove[-1] +(0.5,1,0.5) +convolve[greenblur] [-1] +remove[-1] ++div[greenblur] [redblur] ++div[greenblur] [blueblur] +name[-1] bluemul +name[-2] redmul +remove[redblur,greenblur,blueblur] +mul[red] [redmul] +mul[blue] [bluemul] +keep[red,green,blue] +add +c -100000000,100000000 +done +l[0] +to_rgb ++split[0] c +split[0] c +name[0] red +name[1] green +name[2] blue +name[-3] redblur +name[-2] greenblur +name[-1] blueblur +(0.25;.5;0.5;.5;0.25) +convolve[redblur] [-1] +convolve[blueblur] [-1] +remove[-1] +(1,1) +convolve[redblur] [-1] +convolve[blueblur] [-1] +remove[-1] +(0.5;1;0.5) +convolve[greenblur] [-1] +remove[-1] ++div[greenblur] [redblur] ++div[greenblur] [blueblur] +name[-1] bluemul +name[-2] redmul +remove[redblur,greenblur,blueblur] +mul[red] [redmul] +mul[blue] [bluemul] +keep[red,green,blue] +add +c -100000000,100000000 +done +(1,-2,1) ++convolve[1] [-1] +abs[-1] +remove[-2] +(1;-2;1) ++convolve[0] [-1] +abs[-1] +remove[-2] ++add[-2] [-1] +div[-2] [-1] +remove[-1,-3] +lt[-1] 0.5 +mul[-1] 255 +blur[-1] 1 +append[0,-1] c +blend alpha,1,1 +done +split[0] c +remove[1] +reverse[1,2] +(0.25,0.5,0.25;0.5,1,0.5;0.25,0.5,0.25) +convolve[0] [-1] +convolve[2] [-1] +remove[-1] ++resize 50%,50%,{d},{s},2 +sub[-1] [-2] +sub[-3] [-2] +remove[-2] +resize[-1,-2] {0,w},{0,h},{d},{s},3 +remove[0,2] +add[1] [0] +add[2] [0] +reverse[0,1] +append c +sub 1000 +c 0,255 +iain_denoise_2019_beta3_preview: +images={$!} +if $images>2 +k[0] +fill 128 +text "too many input images",12,12,50,1,0 +text "too many input images",10,10,50,1,255 +quit +fi +if $images==1 +[0] +fi +if $15 ++l[-1] +mid_tone_offset={$4/-5} +luminance +add {$mid_tone_offset*255} +resize 25%,25%,100%,100%,2 +median 5 +line 0,0,0,100%,1,128 +line 0,0,100%,0,1,128 +line 0,100%,100%,100%,1,128 +line 100%,0,100%,100%,1,128 ++gt[0] 85 ++gt[0] 170 +laplacian[1,2] +l[1] ++gt[0] 0 +lt[0] 0 +replace[0] 1,100 +replace[1] 1,1 +max[0,1] +done +l[2] ++gt[0] 0 +lt[0] 0 +replace[0] 1,255 +replace[1] 1,150 +max[0,1] +done +max[-1,-2] ++neq[-1] 0 +replace[-1] 1,255 +append[-1,-2] c +scale2x[-1] +scale2x[-1] +k[-1] +done +fi +l[0,1] +if $14==0 +fine=$8 +mid=$9 +large=$10 ++iain_denoise_2019_beta3 $1,$2,$3,$4,$5,$6,$7,$fine,$mid,$large,$11,$12,$13,$14,$15 +k[0,-1] +sub +noise_amp={_round((128/(max(abs(im),iM))),0.1)} +mul $noise_amp +add 128 +c 0,255 +elif $14==1 +fine=$8 +mid=0 +large=0 ++iain_denoise_2019_beta3 $1,$2,$3,$4,$5,$6,$7,$fine,$mid,$large,$11,$12,$13,$14,$15$15 +k[0,-1] +sub +noise_amp={_round((128/(max(abs(im),iM))),0.1)} +mul $noise_amp +add 128 +c 0,255 +elif $14==2 +fine=0 +mid=$9 +large=0 ++iain_denoise_2019_beta3 $1,$2,$3,$4,$5,$6,$7,$fine,$mid,$large,$11,$12,$13,$14,$15 +k[0,-1] +sub +noise_amp={_round((128/(max(abs(im),iM))),0.1)} +mul $noise_amp +add 128 +c 0,255 +elif $14==3 +fine=0 +mid=0 +large=$10 ++iain_denoise_2019_beta3 $1,$2,$3,$4,$5,$6,$7,$fine,$mid,$large,$11,$12,$13,$14,$15 +k[0,-1] +sub +noise_amp={_round((128/(max(abs(im),iM))),0.1)} +mul $noise_amp +add 128 +c 0,255 +elif $14==4 +iain_denoise_2019_beta3 $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15 +fi +done +blend alpha +text_size=13 +if $images==1 +guide="Internal Guide" +bg_colour=255 +text_colour=0 +else +guide="External Guide" +bg_colour=0 +text_colour=255 +fi +if $14!=4 +box_size=100% +else +box_size=100% +fi +rectangle 0,0,$box_size,20,0.5,$bg_colour +text $guide,0.1~,4,$text_size,1,$text_colour +if $14!=4 +rectangle {(w/2)-127*($noise_amp/2)},{h-20},{(w/2)+127*($noise_amp/2)},100%,0.5,$bg_colour +text Noise\ amplified\ $noise_amp\ times,0.5~,{h-16},$text_size,1,$text_colour +fi +guide_recovery=0 +if $12==0 +do_recovery=0 +elif $12==1 +do_recovery=1 +slow=0 +recover_text="Fast Recovery" +elif $12==2 +do_recovery=1 +slow=1 +recover_text="Slow Recovery" +elif $12==3 +do_recovery=1 +slow=1 +guide_recovery=1 +recover_text="Guide Recovery" +fi +if $12!=0 +text $recover_text,0.9~,4,$text_size,1,$text_colour +fi +iain_denoise_2019_beta3: +images={$!} +if $images>2 +quit +fi +gamma=$1 +shadow=$2 +light=$3 +mid_tone_offset={$4/5} +chroma=$5 +external_guide_strength=$6 +soften_guide=$7 +fine=$8 +mid={$9/3} +large={$10/9} +patch_size=3 +patch_size_b=3 +lookup_size={($11*2)+1} +mid_lookup_size=$11 +large_lookup_size=$11 +smoothness_fine=0 +smoothness=0 +fast_approx=0 +std_deviation_s=10 +recover=$13 +guide_recovery=0 +slow=0 +if $12==0 +do_recovery=0 +elif $12==1 +do_recovery=1 +elif $12==2 +do_recovery=1 +slow=1 +elif $12==3 +do_recovery=1 +slow=1 +guide_recovery=1 +fi +remove_opacity +external_guide=1 +if $!==1 +[0] +external_guide=0 +fi +if $guide_recovery==0 +if $external_guide_strength<1 +[0] +mul[1] $external_guide_strength +mul[2] {1-$external_guide_strength} +add[1,2] +fi +l[-1] +if $chroma>0 +redmul=.299 +greenmul=.587 +bluemul=.114 ++split[0] c +mul[1] $redmul mul[2] $greenmul mul[3] $bluemul +add[1-3] +if $chroma==1 +keep[1] +else +split[0] c name[0] red name[1] green name[2] blue name[3] luma ++sub[blue] [luma] name[-1] cb ++sub[red] [luma] name[-1] cr +keep[luma,cb,cr] +mul[cb,cr] {1-$chroma} ++add[cb] [luma] name[-1] blueout ++add[cr] [luma] name[-1] redout +remove[1,2] ++mul[redout] $redmul +mul[blueout] $bluemul +sub[luma] [-1] sub[luma] [-2] +div[luma] $greenmul +remove[-1,-2] +move[2] 0 +append c +fi +fi +sub 127 +div 128 +if $gamma!=1 +add 1 +pow $gamma +sub 1 +fi +sub $mid_tone_offset ++c[0] 0,100 +c[0] -100,0 +l[0] +if $shadow>0 +fill i+($shadow*abs(i)*0.75)^2 +elif $shadow<0 +fill i-(abs(i)^3)*(abs($shadow)) +fi +done +l[1] +if $light>0 +div[0] {(2^$gamma)-1} +fill i-($light*abs(i)*0.75)^2 +mul[0] {(2^$gamma)-1} +elif $light<0 +div[0] {(2^$gamma)-1} +fill i+(abs(i)^3)*(abs($light)) +mul[0] {(2^$gamma)-1} +fi +done +add +add $mid_tone_offset +mul 128 +add 127 +if $soften_guide +l[0] +(0,0.2,0;0.2,0.2,0.2;0,0.2,0) +convolve[0] [1] +rm[1] +done +fi +done ++l[0,1] +levels=2 +size={3^$levels} +cropwidth={w} +cropheight={h} +to_rgb +resize {w+($size-w%$size)},{h+($size-h%$size)},{d},{s},0,1 +if $fine>0 +denoise[0] [1],$std_deviation_s,$fine,$patch_size,$lookup_size,$smoothness_fine,$fast_approx +fi ++resize[0,1] 33.33333%,33.33333%,{d},{s},2 +rm[1] ++iain_resize_x3[-2] +blur[-1] 1 +sub[0,-1] +if $mid>0 +denoise[1] [2],$std_deviation_s,$mid,$patch_size,$mid_lookup_size,$smoothness_fine,$fast_approx +fi +l[1,2] ++resize[0,1] 33.33333%,33.33333%,{-1,d},{-1,s},2 +rm[1] ++iain_resize_x3[-2] +blur[-1] 1 +sub[0,-1] +if $large>0 +denoise[1] [2],$std_deviation_s,$large,$patch_size,$large_lookup_size,$smoothness_fine,$fast_approx +fi +done +rm[-1] +repeat 2 +iain_resize_x3[-1] +blur[-1] 1 +add[-1,-2] +done +crop 0,0,{$cropwidth-1},{$cropheight-1} +c 0,255 +done +rm[1] +fi +if $do_recovery +sub[0] [1] +l[0] split c mul[0] 0.2126 mul[1] 0.7125 mul[2] 0.0722 add done ++blur[0] 10 +sub[0] [-1] +rm[-1] ++abs[0] +noise={-1,ia} +blur[-1] 3 +bilateral[-1] [1],20,$noise +blur[-1] 2 +fill[-1] 5/i +mul[0] [-1] +l[0] +add 128 +resize[0] {w+256},{h+256},1,1,0,2,0.5,0.5 +if $slow +iain_tiletest4_stack[0] {2-$recover},0.5 +else +iain_tiletest4[0] {2-$recover},0.5 +fi +crop[0] 128,128,{w-129},{h-129} +sub 128 ++blur 10 +sub +done +div[0] [-1] +rm[-1] +to_rgb[0] +add +else +k[-1] +fi +c 0,255 +time=$| +name name($time) +iain_resize_x3: +resize[0] {(w*3)-2},{(h*3)-2},{d},{s},5,0 +resize[0] {w+2},{h+2},{d},{s},0,1,0.5,0.5 +iain_tiletest4_stack: +resize {w+128},{h+128},1,1,0,2,0.5,0.5 +offset1x=24 +offset1y=4 +offset2x=-10 +offset2y=21 +offset3x=27 +offset3y=27 +offset4x=6 +offset4y=38 ++shift[0] $offset1x,$offset1y,0,0 ++shift[0] $offset2x,$offset2y,0,0 ++shift[0] $offset3x,$offset3y,0,0 ++shift[0] $offset4x,$offset4y,0,0 +iain_tiletest4[0] $1,$2 +iain_tiletest4[1] $1,$2 +iain_tiletest4[2] $1,$2 +iain_tiletest4[3] $1,$2 +iain_tiletest4[4] $1,$2 +shift[1] {$offset1x*-1},{$offset1y*-1},0,0 +shift[2] {$offset2x*-1},{$offset2y*-1},0,0 +shift[3] {$offset3x*-1},{$offset3y*-1},0,0 +shift[4] {$offset4x*-1},{$offset4y*-1},0,0 +blend_median +crop 64,64,{w-65},{h-65} +iain_tiletest4: +remove_opacity +luminance +cropwidth={w} +cropheight={h} +size={64} +resize {w+($size-w%$size)},{h+($size-h%$size)},{d},{s},0,1 +tilew={w/64} +tileh={h/64} +split_tiles $tilew,$tileh +apply_parallel " +fftpolar +append z +k[0] +" ++blend_median +mul[-1] $1 +repeat $!-1 +l[$>,-1] +split z ++circle[0] 50%,50%,1,1,0 +blur[-1] 1 +mul[-1] {$1*$2} +lt[-1] [2] +circle[-1] 50%,50%,1,1,0 +mul[-1] [2] +sub[0] [-1] +c[0] 0,999999999999999 +k[0,1,2,3] +append[0,1] z +append[1,2] z +done +done +rm[-1] +apply_parallel " +split z +ifftpolar +" +append_tiles $tilew,$tileh +c 0,255 +crop 0,0,{$cropwidth-1},{$cropheight-1} +iain_remove_pattern: +remove_opacity ++l ++blur[0] $1 +guided[0] [1],$2,$3 +k[0] +done +if $4 +sub[0] [1] +add[0] 128 +iain_remove_pattern_tiles_stack[0] $5,$5,$6,1,$7 +sub[0] 128 +to_rgb +add +else +k[-1] +fi +c 0,255 +iain_remove_pattern_preview: +if $8==0 +iain_remove_pattern[0] $1,$2,$3,$4,$5,$6,$7 +elif $8==1 +to_rgb display_fft +elif $8==2 +iain_remove_pattern[0] $1,$2,$3,$4,$5,$6,$7 +to_rgb display_fft +elif $8==3 ++iain_remove_pattern[0] $1,$2,$3,$4,$5,$6,$7 +sub +to_rgb display_fft +fi +iain_remove_pattern_tiles_stack: +offset={round($3/3)} +remove_opacity +luminance ++l +if $5>0 ++shift[0] $offset,$offset,0,0 +iain_remove_pattern_tiles[-1] $1,$2,$3 +shift[-1] {$offset*-1},{$offset*-1},0,0,1 ++shift[0] {$offset*-1},{$offset*-1},0,0 +iain_remove_pattern_tiles[-1] $1,$2,$3 +shift[-1] $offset,$offset,0,0,1 +fi +if $5>1 ++shift[0] $offset,0,0,0 +iain_remove_pattern_tiles[-1] $1,$2,$3 +shift[-1] {$offset*-1},0,0,0,1 ++shift[0] 0,$offset,0,0 +iain_remove_pattern_tiles[-1] $1,$2,$3 +shift[-1] 0,{$offset*-1},0,0,1 +fi +if $5>2 ++shift[0] {$offset*-1},0,0,0 +iain_remove_pattern_tiles[-1] $1,$2,$3 +shift[-1] $offset,0,0,0,1 ++shift[0] 0,{$offset*-1},0,0 +iain_remove_pattern_tiles[-1] $1,$2,$3 +shift[-1] 0,$offset,0,0,1 +fi +iain_remove_pattern_tiles[0] $1,$2,$3 +blend_median +done +if $4 +sub +add 128 +else +k[1] +fi +iain_remove_pattern_tiles: +l[0] +size=$3 +offset={$size/3} +cropwidth1={w} +cropheight1={h} +resize[0] {w+($size-w%$size)},{h+($size-h%$size)},{d},{s},0,0 +tc={round(w/$size)} tr={round(h/$size)} +split_tiles $tc,$tr +apply_parallel "iain_remove_pattern_fft $1,$2,$3" +append_tiles $tc,$tr +crop 0,0,{$cropwidth1-1},{$cropheight1-1} +done +iain_remove_pattern_fft: +luminance +fftpolar ++log[0] +blur[-1] 10 +exp[-1] ++l[-1] +fill[0] $1 +circle[-1] 50%,50%,14%,1,$2 +done +mul[-2,-1] ++lt[-1] [0] +circle[-1] 50%,50%,{w*.005},1,1 +mul[0] [-1] +k[0,1] +ifftpolar +c 0,255 +iain_star_burst: +repeat $! l[$>] split_opacity l[0] +width={w} +height={h} +resize {w+($2*2)},{h+($2*2)},1,3,0,0,0.5,0.5 ++gt[0] $1 +mul[1] 255 +skeleton[1] 0 +if $6 +rgb2hsl +split c +[0] +reverse[3,-1] +rm[-1] +append[0,1,2] c +append[1,2,3] c +hsl2rgb +fi +mul[1] 255 +l[1] +{$2*5},{$2*5},1,1,0 +set[-1] 1,50%,50% +l[-1] +repeat $5 ++blur_linear[0] $2,.5,{$4+((180/$5)*($>+1))} +done +rm[0] +add +done +convolve_fft[0] [1] +done +mul[1] {1/$5} +mul[1] {$3*10} +if $7 +keep[1] +else +max +fi +c 0,255 +crop {$2},{$2},{$width+$2-1},{$height+$2-1} +done a c done done +iain_unindex: +amplitude=$1 +sharpness=.3 +anisotropy=1 +gradient_smoothness=.6 +tensor_smoothness=1 +spatial_precision=0.8 +angular_precision=30 +value_precision=2 +interpolation=0 +fast_approx=1 +to_rgb ++smooth[0] $amplitude,$sharpness,$anisotropy,$gradient_smoothness,$tensor_smoothness,$spatial_precision,$angular_precision,$value_precision,$interpolation,$fast_approx ++luminance[-1] +laplacian[-1] +abs[-1] +blur[-1] .5 +threshold[-1] $2 +mul[-1] -1 +add[-1] 1 +mul[-1] 255 +append[1,2] c +blend alpha,1,0 +keep[-1] +iain_unindex_preview: +iain_unindex $1,$2 +if $3==1 +topleftx={$4-25} +toplefty={$5-25} +botleftx={$4+25} +botlefty={$5+25} +crop $topleftx%,$toplefty%,$botleftx%,$botlefty% +fi +iain_weightmap: +split c +max +255,1 +set[-1] 255,128,0 +blur[-1] $2 +n[-1] 0,255 ++map[0] [1] +rm[1] +laplacian[0] +mul[0] $1 +abs[0] +add +iain_iains_nr: +repeat $! l[$>] nm={0,n} split_opacity l[0] +lnr=$1 +cnr=$2 +despek=$3 +highs=$4 +shadow=$5 +recovery_choice=$6 +detail_recovery={5000-($7*500)} +fast=1 +fine_det=$8 +med_det=$9 +large_det=$10 +det_emphasis=$11 +sharp=$12 +to_rgb +apply_gamma {1/1.3} +mul 900 +apply_curve 1,0,0,32000,{32000-$shadow},160000,{160000-$shadow},256000,{256000-$highs-$shadow} +div 2000 +iain_rgb2ycbcr +split c +if $lnr>0 +if $recovery_choice==0 +iains_nr_patchb[0] 10,$lnr,3,3,0,$fast,1,$despek,.5,.4,.2,0,1,1,2,0 +unsharp[0] .7,$sharp,0 +fi +if $recovery_choice==1 ++iains_nr_patchb[0] 10,$lnr,3,3,0,$fast,1,$despek,.5,.4,.2,0,1,1,2,0 ++sub[0] [-1] +add[-1] {128} +remove[0] +unsharp[2] .7,$sharp,0 +resize[-1] {w+48},{h+48},{d},{s},0,0,0,0 +resize[-1] {w+48},{h+48},{d},{s},0,0,1,1 +rectangle[-1] 0,0,100%,48,1,128 +rectangle[-1] 0,0,48,100%,1,128 +rectangle[-1] 0,100%,100%,{h-48},1,128 +rectangle[-1] {w-48},100%,100%,0,1,128 +iains_nr_fft_tile3[-1] {$detail_recovery},48,0,$fine_det,$med_det,$large_det,1,3 +crop[-1] 48,48,{w-49},{h-49} +sub[-1] {128} +mul[-1] $det_emphasis +add[2] [-1] +remove[-1] +move[-1] 0 +fi +if $recovery_choice==2 ++iains_nr_patchb[0] 10,$lnr,3,3,0,$fast,1,$despek,.5,.4,.2,0,1,1,2,0 ++sub[0] [-1] +add[-1] {128} +remove[0] +unsharp[2] .7,$sharp,0 +resize[-1] {w+48},{h+48},{d},{s},0,0,0,0 +resize[-1] {w+48},{h+48},{d},{s},0,0,1,1 +rectangle[-1] 0,0,100%,48,1,128 +rectangle[-1] 0,0,48,100%,1,128 +rectangle[-1] 0,100%,100%,{h-48},1,128 +rectangle[-1] {w-48},100%,100%,0,1,128 +iains_nr_fft_tile3[-1] {$detail_recovery},48,0,$fine_det,$med_det,$large_det,1,3 +crop[-1] 48,48,{w-49},{h-49} +sub[-1] 128 +mul[-1] $det_emphasis +add[-1] 128 +move[-2] 0 +fi +fi +if $cnr>0 +add[1,2] 300 +iains_nr_patchb[1] 10,$cnr,3,3,0,1,1,4,.5,.4,.2,0,1,1,2,0 +iains_nr_patchb[2] 10,$cnr,3,3,0,1,1,4,.5,.4,.2,0,1,1,2,0 +sub[1,2] 300 +fi +append[0,1,2] c +iain_ycbcr2rgb[0] +mul[0] 2000 +apply_curve[0] 1,0,0,{32000-$shadow},32000,{160000-$shadow},160000,{256000-$highs-$shadow},256000 +div[0] 900 +apply_gamma[0] 1.3 +c 0,255 +done a c nm $nm done done +iains_nr_med3stack16: +blend_median +iains_nr_med5stack16: +blend_median +iains_nr_fft_tile3_fft: ++fftpolar[0] +100%,100%,1,1,1 +ellipse[-1] 50%,50%,50%,50%,0,1,$4 +ellipse[-1] 50%,50%,15%,15%,0,1,$5 +ellipse[-1] 50%,50%,5%,5%,0,1,$6 ++add[1] [-1] +threshold[-1] $1 +set[-1] 1,50%,50% +mul[1] [-1] ++ifftpolar[1,2] +remove[0,1,2] +keep[-1] +iains_nr_fft_tile3_clean: +tc={round(w/$2)} tr={round(h/$2)} +split_tiles $tc,$tr +repeat $! local[$>] +iains_nr_fft_tile3_fft[0--1] $1,$2,$3,$4,$5,$6 +done done +append_tiles $tc,$tr +c 0,255 +iains_nr_fft_tile3: ++resize[0] {w+$2},{h+$2},1,1,0,1,1,1 +resize[-1] {w+$2},{h+$2},1,1,0,1,0,0 +iains_nr_fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] $2,$2,{w-$2-1},{h-$2-1} +if $8>2 +push={round($2*1.5)} +pull={$2-$push} ++resize[0] {w+$push},{h+$2},1,1,0,1,1,1 +resize[-1] {w+$pull},{h+$2},1,1,0,1,0,0 +iains_nr_fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$push},{$2},{w-$pull-1},{h-($2)-1} ++resize[0] {w+$2},{h+$push},1,1,0,1,1,1 +resize[-1] {w+$2},{h+$pull},1,1,0,1,0,0 +iains_nr_fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] $2,{$push},{w-$2-1},{h-$pull-1} +fi +if $8>1 +dia1={round($2/3)} +dia2={$2-$dia1} ++resize[0] {w+$dia1},{h+$dia1},1,1,0,1,1,1 +resize[-1] {w+$dia2},{h+$dia2},1,1,0,1,0,0 +iains_nr_fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$dia1},{$dia1},{w-$dia2-1},{h-$dia2-1} ++resize[0] {w+$dia2},{h+$dia2},1,1,0,1,1,1 +resize[-1] {w+$dia1},{h+$dia1},1,1,0,1,0,0 +iains_nr_fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$dia2},{$dia2},{w-$dia1-1},{h-$dia1-1} +fi +remove[0] +if $8==3 +blend_median +fi +if $8==2 +blend_median +fi +iains_nr_patchb_smoothing: +repeat $7 denoise $1,$2,$3,$4,$5,$6 done +iains_nr_patchb_2: ++resize[0] 50%,50%,1,{s},2 ++iains_nr_patchb_smoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 ++resize[1] {0,w},{0,h},1,{s},5 ++sub[0] [3] +resize[2] {0,w},{0,h},1,{s},5 ++add[2] [4] +keep[-1] +iains_nr_patchb_3: ++resize[0] 25%,25%,1,{s},2 ++iains_nr_patchb_smoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 ++resize[1] {0,w},{0,h},1,{s},5 ++sub[0] [3] +resize[2] {0,w},{0,h},1,{s},5 ++add[2] [4] +keep[-1] +iains_nr_patchb_4: ++resize[0] 12.5%,12.5%,1,{s},2 ++iains_nr_patchb_smoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 ++resize[1] {0,w},{0,h},1,{s},5 ++sub[0] [3] +resize[2] {0,w},{0,h},1,{s},5 ++add[2] [4] +keep[-1] +iains_nr_patchb_5: ++resize[0] 6.125%,6.125%,1,{s},2 ++iains_nr_patchb_smoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 ++resize[1] {0,w},{0,h},1,{s},5 ++sub[0] [3] +resize[2] {0,w},{0,h},1,{s},5 ++add[2] [4] +keep[-1] +iains_nr_patchb: +apply_gamma {1/$14} +if $8==1 +hybrid_median[-1] 1,0,0 +fi +if $8==2 +hybrid_median[-1] 3,0,0 +fi +if $8==3 +median[-1] 3 +fi +if $8==4 +median[-1] 3 +median[-1] 3 +median[-1] 3 +fi +repeat $15 +if $8<4 +if $13==1 +iains_nr_patchb_smoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 +fi +fi +iains_nr_patchb_2 $1,{$2*$9},$3,$4,$5,$6,$7,$8 +iains_nr_patchb_3 $1,{$2*$10},$3,$4,$5,$6,$7,$8 +iains_nr_patchb_4 $1,{$2*$11},$3,$4,$5,$6,$7,$8 +iains_nr_patchb_5 $1,{$2*$12},$3,$4,$5,$6,$7,$8 +done +apply_gamma $14 +iain_rgb2ycbcr: +redmul=.299 +greenmul=.587 +bluemul=.114 +to_rgb[0] ++split[0] c +mul[1] $redmul +mul[2] $greenmul +mul[3] $bluemul +add[1-3] +split[0] c +name[0] red +name[1] green +name[2] blue +name[3] luma ++sub[blue] [luma] +name[-1] cb ++sub[red] [luma] +name[-1] cr +keep[luma,cb,cr] +append[luma,cb,cr] c +iain_ycbcr2rgb: +redmul=.299 +greenmul=.587 +bluemul=.114 +split c +name[0] luma +name[1] cb +name[2] cr ++add[cb] [luma] +name[-1] blueout ++add[cr] [luma] +name[-1] redout +remove[1,2] ++mul[redout] $redmul ++mul[blueout] $bluemul +sub[luma] [-1] +sub[luma] [-2] +div[luma] $greenmul +remove[-1,-2] +move[2] 0 +append c +iain_iains_nr_preview: +if $-1==0 +iain_iains_nr ${1--2} +fi +if $-1==1 ++iain_iains_nr $1,0,$3,$4,$5,$6,$7,$8,$9,$10,1.3,0 +compose_grainextract +sub 128 +mul 3 +add 128 +fi +if $-1==2 ++iain_iains_nr 0,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,0 +compose_grainextract +sub 128 +mul 3 +add 128 +fi +if $-1==3 +iain_iains_nr $1,$2,$3,$4,$5,2,$7,$8,$9,$10,$11,0 +keep[-1] +sub 128 +mul 3 +add 128 +fi +iain_highlight_synthesis: +red_wb={$1/max($1,$2,$3)} +green_wb={$2/max($1,$2,$3)} +blue_wb={$3/max($1,$2,$3)} +srgb=$4 +smoothness=2 +smoothness2=2 +smoothness3=2 +-remove_opacity ++crop 0,0,500,500 +sum={is} ++rgb2bayer[1] 0,1 b_sum0={is} -rm[-1] +rgb2bayer[1] 1,1 b_sum1={is} -rm[-1] +rgb2bayer[1] 2,1 b_sum2={is} -rm[-1] +rgb2bayer[1] 3,1 b_sum3={is} -rm[-1] +-if {$sum==$b_sum0} b_pat=0 -elif {$sum==$b_sum1} b_pat=1 -elif {$sum==$b_sum2} b_pat=2 -elif {$sum==$b_sum3} b_pat=3 -fi +-k[0] +rgb2bayer $b_pat,1 +-split c +-l[1] +(1,0,0;0,-1,0;0,0,0) +(0,1,0;-1,0,0;0,0,0) ++convolve[0] [1] ++convolve[0] [2] +-rm[1,2] +(0.25,0.5,0.25;0.5,1,0.5;0.25,0.5,0.25) +-convolve[1,2] [-1] +-rm[-1] +-complex2polar[-1,-2] +-rm[-2] +-mod[1] {pi} +-median[-1] 3 +-inrange[-1] 0,{pi/2} +(0.5,1,0.5) +(0.5;1;0.5) ++convolve[0] [2] ++convolve[0] [3] +-rm[0,2,3] +-mul[1] [0] +-negate[0] +-mul[2] [0] +-add[1,2] +-k[1] +-done +-l[0] +(0.25,0.5,0.25;0.5,1,0.5;0.25,0.5,0.25) +-convolve[0] [-1] +-rm[-1] +-done +-l[2] +(0.25,0.5,0.25;0.5,1,0.5;0.25,0.5,0.25) +-convolve[0] [-1] +-rm[-1] +-done +-append c +-cut 0,255 +-split c ++local ++min[0,1,2] ++blend_median[0,1,2] ++max[0,1,2] +-rm[0,1,2] +-l[0] +-repeat 4 ++fill[0] >" +far = j(-1)+(j(-1)-j(-2))*0.99; +near = 255+(255-j(-1))*0.99; +predict = if(far<255,near,far); +if(i>254,predict,i) +" +-rotate[0] 90 +-done +-rotate[2] -90 +-rotate[3] -180 +-rotate[4] 90 +-min[-1,-2,-3,-4] ++gt[0] 254 +-distance[-1] 0 +-cut[-1] 0,50 +-repeat $smoothness +-gcd_boxfilter_local[1] [2] +-sub[2] 0.25 +-cut[2] 0,50 +-done +-cut[1] 0,{255*(2^2)} +-keep[1] +-done ++blur[0] 0.5 -laplacian[-1] -abs[-1] +-line[-1] 0,0,100%,0,1,500 +-line[-1] 0,0,0,100%,1,500 +-line[-1] 100%,0,100%,100%,1,500 +-line[-1] 0,100%,100%,100%,1,500 +-negate[-1] +-blur[-1] 0.5 ++lt[1] 254 +-erode[-1] 3 +-sub[1] [0] ++mul[1] [-1] +-watershed[-1] [3] ++distance[-2] 1 +-erode[-1] 3 +-c[-1] 0,20 +-repeat $smoothness2 +-gcd_boxfilter_local[-2] [-1] +-done +-rm[-1] +-mul[1] [-2] +-negate[-2] +-mul[-1,-2] +-add[1,-1] +-add[1] [0] +-add[0,1] +-mul[0] 0.5 ++lt[1] 254 +-erode[-1] 3 +-sub[1] [0] ++mul[1] [-1] +-watershed[-1] [2] ++distance[-2] 1 +-erode[-1] 3 +-c[-1] 0,20 +-repeat $smoothness2 +-gcd_boxfilter_local[-2] [-1] +-done +-rm[-1] +-mul[1] [-2] +-negate[-2] +-mul[-1,-2] +-add[1,-1] +-add[1] [0] +-mul[1] 0.5 +-add[0,1] +-mul[0] {1/1.5} +-remove[-1] +-done ++blur[-1] 0.5 -laplacian[-1] -abs[-1] +-line[-1] 0,0,100%,0,1,500 +-line[-1] 0,0,0,100%,1,500 +-line[-1] 100%,0,100%,100%,1,500 +-line[-1] 0,100%,100%,100%,1,500 +-negate[-1] +-blur[-1] 0.5 ++lt[0] 254 +-erode[-1] 3 +-mul[0] $red_wb +-sub[0] [3] ++add[0] 1000 +-mul[-1] [-2] +-watershed[-1] [4] ++distance[-2] 1 +-erode[-1] 3 +-c[-1] 0,20 +-repeat $smoothness2 +-gcd_boxfilter_local[-2] [-1] +-done +-rm[-1] +-sub[-1] 1000 +-mul[0] [-2] +-negate[-2] +-mul[-1,-2] +-add[0,-1] +-add[0] [3] ++lt[1] 254 +-erode[-1] 3 +-mul[1] $green_wb +-sub[1] [3] ++add[1] 1000 +-mul[-1] [-2] +-watershed[-1] [4] ++distance[-2] 1 +-erode[-1] 3 +-c[-1] 0,20 +-repeat $smoothness2 +-gcd_boxfilter_local[-2] [-1] +-done +-rm[-1] +-sub[-1] 1000 +-mul[1] [-2] +-negate[-2] +-mul[-1,-2] +-add[1,-1] +-add[1] [3] ++lt[2] 254 +-erode[-1] 3 +-mul[2] $blue_wb +-sub[2] [3] ++add[2] 1000 +-mul[-1] [-2] +-watershed[-1] [4] ++distance[-2] 1 +-erode[-1] 3 +-c[-1] 0,20 +-repeat $smoothness2 +-gcd_boxfilter_local[-2] [-1] +-done +-rm[-1] +-sub[-1] 1000 +-mul[2] [-2] +-negate[-2] +-mul[-1,-2] +-add[2,-1] +-add[2,3] +-append[0,1,2] c +-keep[0] +-cut[0] 0,1000000 +-n 0,255 +-if $srgb -rgb2srgb -fi +iain_iid_demosaic: +pattern=$1 +chroma_diff=1.5 +chroma_radius=5 +clamp_radius1=$2 +repeat $! l[$>] +if $5 apply_gamma 2 fi ++l +l +to_rgb ++iain_iid_demosaic_vertical[0] $pattern,$clamp_radius1 +iain_iid_demosaic_horizontal[0] $pattern,$clamp_radius1 ++l ++l[0] +(1,-1) +convolve[0] [1] +k[0] +abs +blur 1 +split c +add +done ++l[1] +(1;-1) +convolve[0] [1] +k[0] +abs +blur 1 +split c +add +done +sub[-1,-2] ++l[0] ++split c +add[-1,-2,-3] +mul[-1] {1/3} +sub ++blur $chroma_radius +sub +abs +blur 1 +split c +add +done ++l[1] ++split c +add[-1,-2,-3] +mul[-1] {1/3} +sub ++blur $chroma_radius +sub +abs +blur 1 +split c +add +done +sub[-1,-2] +mul[-1] $chroma_diff +add[-1,-2] +gt[-1] 0 +line[-1] 0,0,100%,0%,1,0 +line[-1] 0,100%,100%,100%,1,0 +line[-1] 0,0,0%,100%,1,1 +line[-1] 100%,0%,100%,100%,1,1 ++eq[-1] 0 +mul[0,-1] +mul[1,-1] +max +done +done +done +l[0,-1] +if $3>0 +iain_luma_guided_demosaic $1,$3,$2 +else +k[1] +fi +done +if $4 +l[-1,-2] +l[0] +rgb2yuv +split c +fill[0] 0.5 +append c +yuv2rgb +done +l[1] +rgb2yuv +split c +fill[0] 0.5 +append c +yuv2rgb +done +iain_min_fft3_1 128 +done +rgb2yuv +split c +k[0,-1,-2] +append c +yuv2rgb +else +k[0] +fi +if $5 apply_gamma 0.5 fi +done done +iain_min_fft3_1: ++l[0,1] +append z +size=$1 +cropwidth={w} +cropheight={h} +resize {w+($size-w%$size)},{h+($size-h%$size)},{d},{s},0,0 +h_tile={h/$1} +v_tile={w/$1} +split_tiles $v_tile,$h_tile +apply_parallel " +l[0] +split z +rgb2yuv +fftpolar +min[0,2] +min[1,2] +ifftpolar +yuv2rgb +done +" +append_tiles $v_tile,$h_tile +crop 0,0,{$cropwidth-1},{$cropheight-1} +c 0,255 +done +k[-1] +iain_iid_demosaic_vertical: +resize {w+8},{h+8},{d},{s},0,0,0.5,0.5 ++l +rgb2bayer $1,1 ++l[0] +to_rgb +channels 1 +(-0.1;0;0.6;1;0.6;0;-0.1) +convolve[0] [1] +remove[-1] +done ++iain_demosaic_clamp[0] $2 +rm[2] +min[1,2] +max[1,2] ++to_rgb[1] +rgb2bayer[-1] $1,1 +split[0] c +split[-1] c +sub[0] [4] +sub[2] [6] +append[0,1,2] c +add[0] 128 +rgb2bayer[0] $1,1 +split[0] c +k[0,2,3] +reverse[1,2] ++l[0,1] +reverse +iain_guided_fillgrid +done ++l[1,2] +iain_guided_fillgrid +done +rm[0,2] +reverse[0,1] +sub[0,2] 128 +add[0] [1] +add[2] [1] +append c +c 0,255 +done +k[1] +crop 4,4,{w-5},{h-5} +iain_iid_demosaic_horizontal: +resize {w+8},{h+8},{d},{s},0,0,0.5,0.5 ++l +rgb2bayer $1,1 ++l[0] +to_rgb +channels 1 +(-0.1,0,0.6,1,0.6,0,-0.1) +convolve[0] [1] +remove[-1] +done ++iain_demosaic_clamp[0] $2 +rm[2] +min[1,2] +max[1,2] ++to_rgb[1] +rgb2bayer[-1] $1,1 +split[0] c +split[-1] c +sub[0] [4] +sub[2] [6] +append[0,1,2] c +add[0] 128 +rgb2bayer[0] $1,1 +split[0] c +k[0,2,3] +reverse[1,2] ++l[0,1] +reverse +iain_guided_fillgrid +done ++l[1,2] +iain_guided_fillgrid +done +rm[0,2] +reverse[0,1] +sub[0,2] 128 +add[0] [1] +add[2] [1] +append c +c 0,255 +done +k[1] +crop 4,4,{w-5},{h-5} +iain_demosaic_clamp: +channels 1 ++l +if $1>2 ++shift[0] 3,-2,0,0 ++shift[0] -3,-2,0,0 ++shift[0] -2,3,0,0 ++shift[0] -2,-3,0,0 ++shift[0] 3,0,0,0 ++shift[0] -3,0,0,0 ++shift[0] 0,3,0,0 ++shift[0] 0,-3,0,0 +fi +if $1>1 ++shift[0] 1,2,0,0 ++shift[0] -1,2,0,0 ++shift[0] 2,1,0,0 ++shift[0] 2,-1,0,0 ++shift[0] 1,-2,0,0 ++shift[0] -1,-2,0,0 ++shift[0] -2,1,0,0 ++shift[0] -2,-1,0,0 +fi ++shift[0] 1,0,0,0 ++shift[0] -1,0,0,0 ++shift[0] 0,1,0,0 +shift[0] 0,-1,0,0 ++min[0--1] +max[0--2] +done +add[1] [0] +add[2] [0] +iain_luma_guided_demosaic: +resize {w+8},{h+8},{d},{s},0,0,0.5,0.5 +remove_opacity +repeat $2 ++l ++split[1] c +add[-1,-2,-3] +mul[-1] .33333333333333333 +rm[1] +sub[0] [1] +add[0] 255 +rgb2bayer[0] $1,1 +reverse +split[1] c ++iain_guided_diagonal_interpolation[0,1] ++iain_guided_diagonal_interpolation[0,3] +rm[1,3] +reverse[1,2] ++iain_guided_straight_interpolation[0,1] ++iain_guided_straight_interpolation[0,2] ++iain_guided_straight_interpolation[0,3] +rm[1,2,3] +sub[1,2,3] 255 +append[1,2,3] c +to_rgb +add +c 0,255 +done +rm[1] +if $3>0 +fi +done +k[1] +crop 4,4,{w-5},{h-5} +fft_tile2_fft: ++fftpolar[0] +100%,100%,1,1,1 +ellipse[-1] 50%,50%,50%,50%,0,1,$4 +ellipse[-1] 50%,50%,15%,15%,0,1,$5 +ellipse[-1] 50%,50%,5%,5%,0,1,$6 +box_blur[-1] {$2*0.01} ++add[1] [-1] +threshold[-1] {$1/(128/$2)} +set[-1] 1,50%,50% +mul[1] [-1] ++ifftpolar[1,2] +keep[-1] +fft_tile2_clean: +tc={round(w/$2)} tr={round(h/$2)} +split_tiles $tc,$tr +repeat $! local[$>] +fft_tile2_fft[0--1] $1,$2,$3,$4,$5,$6 +done done +append_tiles $tc,$tr +c 0,255 +fft_tile2: ++resize[0] {w+$2},{h+$2},1,1,0,1,1,1 +resize[-1] {w+$2},{h+$2},1,1,0,1,0,0 +fft_tile2_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] $2,$2,{w-$2-1},{h-$2-1} +if $3==0 +push={round($2*1.5)} +pull={$2-$push} ++resize[0] {w+$push},{h+$2},1,1,0,1,1,1 +resize[-1] {w+$pull},{h+$2},1,1,0,1,0,0 +fft_tile2_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$push},{$2},{w-$pull-1},{h-($2)-1} ++resize[0] {w+$2},{h+$push},1,1,0,1,1,1 +resize[-1] {w+$2},{h+$pull},1,1,0,1,0,0 +fft_tile2_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] $2,{$push},{w-$2-1},{h-$pull-1} +dia1={round($2/3)} +dia2={$2-$dia1} ++resize[0] {w+$dia1},{h+$dia1},1,1,0,1,1,1 +resize[-1] {w+$dia2},{h+$dia2},1,1,0,1,0,0 +fft_tile2_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$dia1},{$dia1},{w-$dia2-1},{h-$dia2-1} ++resize[0] {w+$dia2},{h+$dia2},1,1,0,1,1,1 +resize[-1] {w+$dia1},{h+$dia1},1,1,0,1,0,0 +fft_tile2_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$dia2},{$dia2},{w-$dia1-1},{h-$dia1-1} +fi +remove[0] +if $3==0 +iain_median_5_stack +fi +luminance_nr_two: +ac " +mul 9.99 +apply_curve 0,0,0,510,{510-$17},1020,{1020-$17-$18},1530,{1530-$17-$18-$19},2040,{2040-$17-$18-$19-$20},2550,{2550-$17-$18-$19-$20-$21},2550,2550 +mul 0.1 +if $22==1 ++median[0] 3 +ms_patch_smooth[-1] 10,$1,3,3,0,$2,$3,0,{$1*$4},{$1*$5},{$1*$6},{$1*$7},{$1*$8},{$1*$9},1 +fi +if $22==0 ++ms_patch_smooth[0] 10,$1,3,3,0,$2,$3,0,{$1*$4},{$1*$5},{$1*$6},{$1*$7},{$1*$8},{$1*$9},1 +fi +if $16==1 ++compose_grainextract +fft_tile2[-1] $10,$11,3,$13,$14,$15 +compose_grainmerge[1,2] +fi +keep[-1] +mul 9.99 +apply_curve 0,0,0,{510-$17},510,{1020-$17-$18},1020,{1530-$17-$18-$19},1530,{2040-$17-$18-$19-$20},2040,{2550-$17-$18-$19-$20-$21},2550,2550,2550 +mul 0.1 +",7 +c 0,255 +iain_minimum_chroma_demosaic: +rgb2bayer $1,1 +cropwidth={w} +cropheight={h} +resize {w+16},{h+16},{d},{s},0,0,0.5,0.5 ++l +if $3==0 ++iain_horizontal_interpolate[0] $1,1 +iain_vertical_interpolate[0] $1,1 +elif $3==1 ++iain_tuned_horizontal[0] $1 +iain_tuned_vertical[0] $1 +fi +l[0] +rgb2yuv +split c +fill[0] .5 +append c +yuv2rgb +done +l[1] +rgb2yuv +split c +fill[0] .5 +append c +yuv2rgb +done +append z +levels={$2+1} +size={3^$levels} +cropwidth2={w} +cropheight2={h} +resize {w+($size-w%$size)},{h+($size-h%$size)},{d},{s},0,1 +repeat $levels +l[-1] ++resize[0] 33.33333%,33.33333%,{d},{s},2 ++iain_resize_x3[-1] +sub[0,-1] +done +done +repeat $!-1 l[{$<}] +split z ++abs +gt[-1] [-2] +rm[-2] ++eq[-1] 0 +mul[0,2] +mul[1,2] +add +done done +l[-1] +split z +k[1] +done +repeat $!-1 +iain_resize_x3[-1] +add[-1,-2] +done +crop 0,0,{$cropwidth2-1},{$cropheight2-1} +c 0,255 +done +iain_chroma_guide $1,1 +crop 8,8,{$cropwidth+7},{$cropheight+7} +iain_chroma_guide: +to_rgb +rgb2bayer[0] $1,1 ++l[0,1] +split[-1] c +split[0] c +name[0] red name[1] green name[2] blue +name[-3] redblur name[-2] greenblur name[-1] blueblur ++sub[greenblur] [redblur] ++sub[greenblur] [blueblur] +name[-1] bluemul name[-2] redmul +remove[redblur,greenblur,blueblur] +add[red] [redmul] +add[blue] [bluemul] +keep[red,green,blue] +append c +rgb2bayer $1,1 +split c +add +done +rm[1] ++to_rgb[1] +rgb2bayer[-1] $1,1 +split[0] c +split[-1] c +sub[0] [4] +sub[2] [6] +append[0,1,2] c +add[0] 128 +rgb2bayer[0] $1,1 +split[0] c +rm[1,-1,-2,-3] ++l[0,2] +reverse +iain_guided_fillgrid +done +rm[0] ++l[0,1] +reverse +iain_guided_fillgrid +done +rm[0] +reverse[0,1] +sub[0,2] 128 +add[0] [1] +add[2] [1] +append c +c 0,255 +iain_resize_x3: +resize[0] {(w*3)-2},{(h*3)-2},{d},{s},5,0 +resize[0] {w+2},{h+2},{d},{s},0,1,0.5,0.5 +iain_vertical_interpolate: +rgb2bayer[0] $1,1 ++l[0] +channels 1 +(-0.1;0;0.6;1;0.6;0;-0.1) +convolve[0] [-1] +rm[-1] +done +c 0,255 ++to_rgb[1] +rgb2bayer[-1] $1,1 +split[0] c +split[-1] c +sub[0] [4] +sub[2] [6] +append[0,1,2] c +add[0] 128 +rgb2bayer[0] $1,1 +split[0] c +rm[1,-1,-2,-3] ++l[0,2] +reverse +iain_guided_fillgrid +done +rm[0] ++l[0,1] +reverse +iain_guided_fillgrid +done +rm[0] +reverse[0,1] +sub[0,2] 128 +add[0] [1] +add[2] [1] +append c +c 0,255 +iain_horizontal_interpolate: +rgb2bayer[0] $1,1 ++l[0] +channels 1 +(-0.1,0,0.6,1,0.6,0,-0.1) +convolve[0] [-1] +rm[-1] +done +c 0,255 ++to_rgb[1] +rgb2bayer[-1] $1,1 +split[0] c +split[-1] c +sub[0] [4] +sub[2] [6] +append[0,1,2] c +add[0] 128 +rgb2bayer[0] $1,1 +split[0] c +rm[1,-1,-2,-3] ++l[0,2] +reverse +iain_guided_fillgrid +done +rm[0] ++l[0,1] +reverse +iain_guided_fillgrid +done +rm[0] +reverse[0,1] +sub[0,2] 128 +add[0] [1] +add[2] [1] +append c +c 0,255 +iain_guided_fillgrid: +channels 0 +l[0] +(1,0;0,-1) ++convolve[0] [1] +rm[1] +(0,1;-1,0) ++convolve[0] [2] +rm[2] +l[-1,-2] +abs +blur 1 ++max +eq[0] [-1] +keep[0] +mul 255 +done +done ++l[2] ++l[0] +(0,0,0.5;0,1,0;0.5,0,0) +convolve[0] [1] +remove[1] +done +l[0] +(0.5,0,0;0,1,0;0,0,0.5) +convolve[0] [1] +remove[1] +done +done +move[1] 5 +append[-1,-2] c +blend[-1,-2] alpha,1,0 +rm[1] +l[0] +(1,-1) ++convolve[0] [1] +rm[1] +(1;-1) ++convolve[0] [2] +rm[2] +l[-1,-2] +abs +blur 1 ++max +eq[0] [-1] +keep[0] +mul 255 +done +done ++l[2] ++l[0] +(0.5;1;0.5) +convolve[0] [1] +remove[1] +done +l[0] +(0.5,1,0.5) +convolve[0] [1] +remove[1] +done +done +move[1] 5 +append[-1,-2] c +blend[-1,-2] alpha,1,0 +k[-1] +iain_tuned_horizontal: +remove_opacity +l[0] ++fill[0] 1 +rgb2bayer[1] $1,1 ++l[0] +split c +add +(-0.025,0.1,-0.225,0.4,0.5,0.4,-0.225,0.1,-0.025) +convolve[0] [1] +rm[1] +done ++l[1,2] +shift[0] 1,0,0,0,2 +mul +done +add[-1] [0] +channels[-1] 1 +k[0,-1] +to_rgb +iain_luma_guide $1,1,0 +done +iain_tuned_vertical: +remove_opacity +l[0] ++fill[0] 1 +rgb2bayer[1] $1,1 ++l[0] +split c +add +(-0.025;0.1;-0.225;0.4;0.5;0.4;-0.225;0.1;-0.025) +convolve[0] [1] +rm[1] +done ++l[1,2] +shift[0] 1,0,0,0,2 +mul +done +add[-1] [0] +channels[-1] 1 +k[0,-1] +to_rgb +iain_luma_guide $1,1,0 +done +iain_luma_guide: +remove_opacity +if $3 +mul {1/255} +pow 2.2 +mul 255 +fi +repeat $2 ++l ++split[1] c +add[-1,-2,-3] +mul[-1] .33333333333333333 +rm[1] +sub[0] [1] +add[0] 255 +rgb2bayer[0] $1,1 +reverse +split[1] c ++iain_guided_diagonal_interpolation[0,1] ++iain_guided_diagonal_interpolation[0,3] +rm[1,3] +reverse[1,2] ++iain_guided_straight_interpolation[0,1] ++iain_guided_straight_interpolation[0,2] ++iain_guided_straight_interpolation[0,3] +rm[1,2,3] +sub[1,2,3] 255 +append[1,2,3] c +to_rgb +add +c 0,255 +done +rm[1] +done +keep[1] +if $3 +mul {1/255} +pow {1/2.2} +mul 255 +fi +iain_guided_diagonal_interpolation: ++l[0] +(1,0;0,-1) ++convolve[0] [1] +rm[1] +(0,1;-1,0) ++convolve[0] [2] +rm[2] +l[-1,-2] +abs +blur 1.5 ++min +eq[0] [-1] +keep[0] +done +rm[-2] +done +l[1] ++l[0] +(0,0,0.5;0,1,0;0.5,0,0) +convolve[0] [1] +remove[1] +done +l[0] +(0.5,0,0;0,1,0;0,0,0.5) +convolve[0] [1] +remove[1] +done +done +rm[0] ++eq[-1] 0 +mul[0,2] +mul[1,2] +add +iain_guided_straight_interpolation : ++l[0] +(1,-1) ++convolve[0] [1] +rm[1] +(1;-1) ++convolve[0] [2] +rm[2] +l[-1,-2] +abs +blur 1.5 ++min +eq[0] [-1] +keep[0] +done +rm[-2] +done +l[1] ++l[0] +(0.5;1;0.5) +convolve[0] [1] +remove[1] +done +l[0] +(0.5,1,0.5) +convolve[0] [1] +remove[1] +done +done ++eq[-1] 0 +mul[1,3] +mul[2,3] +add[1,2] +keep[1] +iain_moire_removal: +tile_size=256 +overlap=16 +cropwidth={w} +cropheight={h} +if $cropwidth%$tile_size>0 +resize[0] {w+($tile_size-w%$tile_size)},100%,1,{s},0,1 +fi +if $cropheight%$tile_size>0 +resize[0] 100%,{h+($tile_size-h%$tile_size)},1,{s},0,1 +fi +h_tiles={w/$tile_size} +v_tiles={h/$tile_size} +repeat $v_tiles v_count=$> +repeat $h_tiles h_count=$> ++crop[0] {($h_count*$tile_size)-$overlap},{($v_count*$tile_size)-$overlap},{($h_count*$tile_size)+($tile_size+$overlap-1)},{($v_count*$tile_size)+($tile_size+$overlap-1)},1 +done +done +rm[0] +repeat $! l[$>] +if iM!=im +[0] +apply_parallel_channels[1] " +l[0] +repeat 3 +l[-1] +repeat 2 +denoise[0] 10,{$1/($>+1)},5,5,0,{min($>,1)} +done ++resize[0] 50%,50%,{d},{s},2 ++resize[-1] 200%,200%,{d},{s},3 +sub[0,-1] +done +done +repeat $!-1 +resize[-1] {-2,w},{-2,h},{d},{s},3 +add[-1,-2] +done +done +" +if $3<2 +sub[0] [1] +l[0] +fftpolar[0] +if $3==1 +append[0,1] x +split[0] c +min +split[0] x,2 +elif $3==0 +fill[1] if(max(i(x,y,z,0),i(x,y,z,1),i(x,y,z,2))-min(i(x,y,z,0),i(x,y,z,1),i(x,y,z,2))<$2,min(i(x,y,z,0),i(x,y,z,1),i(x,y,z,2)),(i(x,y,z,c))) +fi +ifftpolar[0,1] +keep[0] +done +to_rgb +add +else +keep[1] +fi +c 0,255 +fi +done +progress {($>/$!)*100} +done +repeat $! l[$>] +crop $overlap,$overlap,{$tile_size+$overlap-1},{$tile_size+$overlap-1} +done +done +append_tiles $h_tiles,$v_tiles +crop 0,0,{$cropwidth-1},{$cropheight-1} +iain_moire_removal_NP: +tile_size=256 +overlap=16 +cropwidth={w} +cropheight={h} +if $cropwidth%$tile_size>0 +resize[0] {w+($tile_size-w%$tile_size)},100%,1,{s},0,1 +fi +if $cropheight%$tile_size>0 +resize[0] 100%,{h+($tile_size-h%$tile_size)},1,{s},0,1 +fi +h_tiles={w/$tile_size} +v_tiles={h/$tile_size} +repeat $v_tiles v_count=$> +repeat $h_tiles h_count=$> ++crop[0] {($h_count*$tile_size)-$overlap},{($v_count*$tile_size)-$overlap},{($h_count*$tile_size)+($tile_size+$overlap-1)},{($v_count*$tile_size)+($tile_size+$overlap-1)},1 +done +done +rm[0] +repeat $! l[$>] +if iM!=im +[0] +l[1] +l[0] +repeat 3 +l[-1] +repeat 2 +denoise[0] 10,{$1/($>+1)},5,5,0,{min($>,1)} +done ++resize[0] 50%,50%,{d},{s},2 ++resize[-1] 200%,200%,{d},{s},3 +sub[0,-1] +done +done +repeat $!-1 +resize[-1] {-2,w},{-2,h},{d},{s},3 +add[-1,-2] +done +done +done +if $3<2 +sub[0] [1] +l[0] +fftpolar[0] +if $3==1 +append[0,1] x +split[0] c +min +split[0] x,2 +elif $3==0 +fill[1] if(max(i(x,y,z,0),i(x,y,z,1),i(x,y,z,2))-min(i(x,y,z,0),i(x,y,z,1),i(x,y,z,2))<$2,min(i(x,y,z,0),i(x,y,z,1),i(x,y,z,2)),(i(x,y,z,c))) +fi +ifftpolar[0,1] +keep[0] +done +to_rgb +add +else +keep[1] +fi +c 0,255 +fi +done +progress {($>/$!)*100} +done +repeat $! l[$>] +crop $overlap,$overlap,{$tile_size+$overlap-1},{$tile_size+$overlap-1} +done +done +append_tiles $h_tiles,$v_tiles +crop 0,0,{$cropwidth-1},{$cropheight-1} +ms_nlmeans_c_noise2_p_preview: +if $16 +remove_opacity ++ms_nlmeans_c_noise2[0] ${1--1} +sub +mul 2 +add 128 +c 0,255 +else +ms_nlmeans_c_noise2[0] ${1--1} +fi +ms_nlmeans_c_noise2_p: +ms_nlmeans_c_noise2[0] ${1--1} +ms_nlmeans_c_noise2: +remove_opacity +hf_strength={2^$1} +lf_strength={2^$2} +hf_patch=$9 +hf_search=$10 +lf_patch=$11 +lf_search=$12 +sc_rb=$13 +sc_g=$14 +blacks={2^$3} +shadows={2^$4} +midtones={2^$5} +highlights={2^$6} +whites={2^$7} +smooth=$8 +shadow={2^$3} +highlight={2^$4} +levels=1 +size={3^$levels} +cropwidth={w} +cropheight={h} +resize {w+($size-w%$size)},{h+($size-h%$size)},{d},{s},0,1 ++l[0] +split c +if $sc_rb +median[0,2] 4 +fi +if $sc_g +l[1] ++l[0] +(1,1,1;1,0,1;1,1,1) +dilate[0] [1] +rm[1] +done ++l[0] +(1,1,1;1,0,1;1,1,1) +erode[0] [1] +rm[1] +done +min[0,1] +max[0,1] +done +fi +append c +luminance +done +if $11 ++c_noise[0] 1.6 +else +[1] +to_rgb[-1] +negate[-1] +add[-1] .1 +mul[-1] .1 +blur[-1] 2 +fi ++l[1] +255,1,1,1,1 +line[-1] 0,0,50,0,1,$blacks +line[-1] 51,0,100,0,1,$shadows +line[-1] 101,0,152,0,1,$midtones +line[-1] 153,0,204,0,1,$highlights +line[-1] 205,0,255,0,1,$whites +blur[-1] $smooth +map[0] [1] +keep[0] +done +mul[2,-1] ++l[0,1,2] +mul[-1] $hf_strength +f[-1] '-3.0/i' nlmeans_core[0] [1],[2],$hf_patch,$hf_search +keep[0] +done +reverse[0,-1] +rm[-1] ++l[0,1,2] +resize[0,1,2] 33.33333%,33.33333%,{d},{s},2 +mul[-1] $lf_strength +f[-1] '-3.0/i' nlmeans_core[0] [1],[2],$lf_patch,$lf_search +keep[0] +done +rm[1,2] ++resize[0] 33.33333%,33.33333%,{d},{s},2 +linear_x3[-1] +sub[0,-1] +linear_x3[-1] +add +c 0,255 +crop 0,0,{$cropwidth-1},{$cropheight-1} +c 0,255 +c_noise: +width={w} +height={h} ++l[0] ++shift[0] 0,1,0,0,2 ++shift[0] 0,-1,0,0,2 +blend_median +done +sub +abs +add .1 +pow $1 +resize 25%,25%,1,3,2 +median 3 +resize $width,$height,1,3,3 +create_luma_mix: ++split[0] c +mul[1] {$1/($1+$2+$3)} +mul[2] {$2/($1+$2+$3)} +mul[3] {$3/($1+$2+$3)} +add[1-3] +keep[-1] +to_gray[-1] +ms_patch_c: +to_rgb ++create_luma_mix[0] $11,$12,$13 +name[-1] luma +if $2==1 +median[0] 3 +median[0] 3 +fi +repeat $3 +ms_patch_smooth[0] 10,$1,3,5,0,1,1,0,$4,$5,$6,$7,$8,$9,$10 +done ++create_luma_mix[0] $11,$12,$13 +sub[0] [-1] +add[0] [1] +keep[0] +c 0,255 +ms_patch_c_preview: +if $-1==0 +ms_patch_c ${1--2} +fi +if $-1==1 ++ms_patch_c ${1--2} +sub[0] [1] +keep[0] +mul 2 +add 128 +fi +linear_x3: +resize 300%,300%,{d},{s},4,1,.5,.5,0 +(.11111,.22222,.33333,.22222,.11111;.22222,.44444,.66666,.44444,.22222;.33333,.66666,1,.66666,.33333;.22222,.44444,.66666,.44444,.22222;.11111,.22222,.33333,.22222,.11111) +convolve[0] [1],0 +rm[1] +MS_Patch_NR: +if $1!=1 +apply_parallel_overlap "div 255 pow $1 mul 255" +fi +cropwidth={w} +cropheight={h} +resize[0] {w+(90-w%90)},{h+(90-h%90)},1,{s},0,1 +l[0] +width={w} +height={h} +if $2>0 +apply_parallel_overlap[-1] "denoise 10,{$2/10},$5,$6,0,0",16 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +if $3>0 +apply_parallel_overlap[-1] "denoise 10,{$3/10},$5,$6,0,0",16 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +if $4>0 +apply_parallel_overlap[-1] "denoise 10,{$4/10},$5,$6,0,0",16 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +linear_x3[-1] +add[-1,-2] +linear_x3[-1] +add[-1,-2] +linear_x3[-1] +add[-1,-2] +done +crop 0,0,{$cropwidth-1},{$cropheight-1} +if $1!=1 +apply_parallel_overlap "div 255 pow {1/$1} mul 255" +fi +c 0,255 +MS_Patch_NR3_p: +to_rgb +MS_Patch_NR3[0] $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12 +n 0,255 +linear_x3: +resize 300%,300%,{d},{s},4,1,.5,.5,0 +(.11111,.22222,.33333,.22222,.11111;.22222,.44444,.66666,.44444,.22222;.33333,.66666,1,.66666,.33333;.22222,.44444,.66666,.44444,.22222;.11111,.22222,.33333,.22222,.11111) +convolve[0] [1],0 +rm[1] +MS_Patch_NR3: +apply_parallel_overlap[-1] " +if $1!=1 +div 255 pow $1 mul 255 +fi +if $8==1 +iain_pixel_denoise_p 1,1,0,0,1 +elif $8==2 +iain_pixel_denoise_p 2,1,0,0,1 +elif $8==3 +hybrid16 hybrid16 hybrid16 +fi +cropwidth={w} +cropheight={h} +resize[0] {w+(90-w%90)},{h+(90-h%90)},1,{s},0,1 +rgb2yuv8 +split c +l[0] +width={w} +height={h} +if $2>0 +denoise 10,{$2/10},$5,$6,0,$7 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +if $3>0 +denoise 10,{$3/10},$5,$6,0,$7 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +if $4>0 +denoise 10,{$4/10},$5,$6,0,$7 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +linear_x3[-1] +add[-1,-2] +linear_x3[-1] +add[-1,-2] +linear_x3[-1] +add[-1,-2] +done +l[1] +width={w} +height={h} +if $10>0 +denoise 10,{$10/10},$5,$6,0,$7 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +if $11>0 +denoise 10,{$11/10},$5,$6,0,$7 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +if $12>0 +denoise 10,{$12/10},$5,$6,0,$7 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +linear_x3[-1] +add[-1,-2] +linear_x3[-1] +add[-1,-2] +linear_x3[-1] +add[-1,-2] +done +l[2] +width={w} +height={h} +if $10>0 +denoise 10,{$10/10},$5,$6,0,$7 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +if $11>0 +denoise 10,{$11/10},$5,$6,0,$7 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +if $12>0 +denoise 10,{$12/10},$5,$6,0,$7 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +linear_x3[-1] +add[-1,-2] +linear_x3[-1] +add[-1,-2] +linear_x3[-1] +add[-1,-2] +done +append c +yuv82rgb +crop 0,0,{$cropwidth-1},{$cropheight-1} +if $1!=1 +div 255 pow {1/$1} mul 255 +fi +if $9==1 +iain_pixel_denoise_p 1,1,0,0,1 +elif $9==2 +iain_pixel_denoise_p 2,1,0,0,1 +elif $9==3 +hybrid16 hybrid16 hybrid16 +fi +c 0,255 +",64 +ms_patch_smoothsmoothing: +ac "repeat $7 denoise $1,$2,$3,$4,$5,$6 done",$8 c 0,255 +ms_patch_smooth: +lvl2=2 +lvl3=3 +lvl4=4 +lvl5=5 +lvl6=6 +lvl7=8 +apply_gamma {1/$15} +ms_patch_smoothsmoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 +name[0] full ++resize[full] {full,w/$lvl2},{full,h/$lvl2},1,{s},2 name[1] level2 ++ms_patch_smoothsmoothing[level2] $1,$9,$3,$4,$5,$6,$7,$8 name[2] level2clean ++resize[level2] {0,w},{0,h},1,{s},5 name[3] low2 ++sub[full] [low2] name[4] level2high +remove[level2,low2] ++resize[level2clean] {full,w/$lvl3},{full,h/$lvl3},1,{s},2 name[3] level3 ++ms_patch_smoothsmoothing[level3] $1,$10,$3,$4,$5,$6,$7,$8 name[4] level3clean ++resize[level3] {level2clean,w},{level2clean,h},1,{s},5 name[5] low3 ++sub[level2clean] [low3] name[6] level3high +remove[level3,low3] ++resize[level3clean] {full,w/$lvl4},{full,h/$lvl4},1,{s},2 name[5] level4 ++ms_patch_smoothsmoothing[level4] $1,$11,$3,$4,$5,$6,$7,$8 name[6] level4clean ++resize[level4] {level3clean,w},{level3clean,h},1,{s},5 name[7] low4 ++sub[level3clean] [low4] name[8] level4high +remove[level4,low4] ++resize[level4clean] {full,w/$lvl5},{full,h/$lvl5},1,{s},2 name[-1] level5 ++ms_patch_smoothsmoothing[level5] $1,$12,$3,$4,$5,$6,$7,$8 name[-1] level5clean ++resize[level5] {level4clean,w},{level4clean,h},1,{s},5 name[-1] low5 ++sub[level4clean] [low5] name[-1] level5high +remove[level5,low5] ++resize[level5clean] {full,w/$lvl6},{full,h/$lvl6},1,{s},2 name[-1] level6 ++ms_patch_smoothsmoothing[level6] $1,$13,$3,$4,$5,$6,$7,$8 name[-1] level6clean ++resize[level6] {level5clean,w},{level5clean,h},1,{s},5 name[-1] low6 ++sub[level5clean] [low6] name[-1] level6high +remove[level6,low6] +name[-2] base +resize[base] {level6high,w},{level6high,h},1,{s},5 +add[base] [level6high] +remove[level6high] +resize[base] {level5high,w},{level5high,h},1,{s},5 +add[base] [level5high] +remove[level5high] +resize[base] {level4high,w},{level4high,h},1,{s},5 +add[base] [level4high] +remove[level4high] +resize[base] {level3high,w},{level3high,h},1,{s},5 +add[base] [level3high] +remove[level3high] +resize[base] {level2high,w},{level2high,h},1,{s},5 +add[base] [level2high] +remove[level2high] +keep[-1] +c 0,255 +apply_gamma {$15} +c 0,255 +ms_patch_smooth_preview: +if $-1==0 +ms_patch_smooth ${1--2} +fi +if $-1==1 ++ms_patch_smooth ${1--2} +sub[0] [1] +keep[0] +mul 2 +add 128 +fi +luminance_nr: +apply_gamma {1/$12} +ac" ++ms_patch_smooth[0] 10,$1,3,3,0,$2,$3,0,$4,$5,$6,$7,$8,$9,1 ++compose_grainextract +fft_tile[-1] $10,$11,0 +compose_grainmerge[1,2] +keep[-1] +",7 +apply_gamma $12 +ms_smoothsmoothing: +smooth {$1*5},0.7,0.7,0.6,$2,0.8,30,2,0,1 +ms_smooth: +if $8==0 +lvl2=2 +lvl3=3 +lvl4=4 +lvl5=5 +lvl6=6 +fi +if $8==1 +lvl2=2 +lvl3=4 +lvl4=8 +lvl5=16 +lvl6=32 +fi +repeat $9 +if $1>0 +ms_smoothsmoothing[-1] $1,$7 +fi +name[0] full ++resize[full] {full,w/$lvl2},{full,h/$lvl2},1,{s},2 name[1] level2 +if $2>0 ++ms_smoothsmoothing[level2] $2,$7 +else [level2] +fi +name[2] level2clean ++resize[level2] {0,w},{0,h},1,{s},5 name[3] low2 ++sub[full] [low2] name[4] level2high +remove[level2,low2] ++resize[level2clean] {full,w/$lvl3},{full,h/$lvl3},1,{s},2 name[3] level3 +if $3>0 ++ms_smoothsmoothing[level3] $3,$7 +else [level3] +fi +name[4] level3clean ++resize[level3] {level2clean,w},{level2clean,h},1,{s},5 name[5] low3 ++sub[level2clean] [low3] name[6] level3high +remove[level3,low3] ++resize[level3clean] {full,w/$lvl4},{full,h/$lvl4},1,{s},2 name[5] level4 +if $4>0 ++ms_smoothsmoothing[level4] $4,$7 +else [level4] +fi +name[6] level4clean ++resize[level4] {level3clean,w},{level3clean,h},1,{s},5 name[7] low4 ++sub[level3clean] [low4] name[8] level4high +remove[level4,low4] ++resize[level4clean] {full,w/$lvl5},{full,h/$lvl5},1,{s},2 name[-1] level5 +if $5>0 ++ms_smoothsmoothing[level5] $5,$7 +else [level5] +fi +name[-1] level5clean ++resize[level5] {level4clean,w},{level4clean,h},1,{s},5 name[-1] low5 ++sub[level4clean] [low5] name[-1] level5high +remove[level5,low5] ++resize[level5clean] {full,w/$lvl6},{full,h/$lvl6},1,{s},2 name[-1] level6 +if $6>0 ++ms_smoothsmoothing[level6] $6,$7 +else [level6] +fi +name[-1] level6clean ++resize[level6] {level5clean,w},{level5clean,h},1,{s},5 name[-1] low6 ++sub[level5clean] [low6] name[-1] level6high +remove[level6,low6] +name[-2] base +resize[base] {level6high,w},{level6high,h},1,{s},5 +add[base] [level6high] +remove[level6high] +resize[base] {level5high,w},{level5high,h},1,{s},5 +add[base] [level5high] +remove[level5high] +resize[base] {level4high,w},{level4high,h},1,{s},5 +add[base] [level4high] +remove[level4high] +resize[base] {level3high,w},{level3high,h},1,{s},5 +add[base] [level3high] +remove[level3high] +resize[base] {level2high,w},{level2high,h},1,{s},5 +add[base] [level2high] +remove[level2high] +keep[-1] +c 0,255 +c 0,255 +done +ms_smooth_preview: +if $-1==0 +ms_smooth $1,$2,$3,$4,$5,$6,$7,$8,$9 +fi +if $-1==1 ++ms_smooth $1,$2,$3,$4,$5,$6,$7,$8,$9 +sub[0] [1] +keep[0] +mul 2 +add 128 +fi +med3stack16: +blend_median +med5stack16: +blend_median +fft_tile3_fft: ++fftpolar[0] +100%,100%,1,1,1 +ellipse[-1] 50%,50%,50%,50%,0,1,$4 +ellipse[-1] 50%,50%,15%,15%,0,1,$5 +ellipse[-1] 50%,50%,5%,5%,0,1,$6 ++add[1] [-1] +threshold[-1] $1 +set[-1] 1,50%,50% +mul[1] [-1] ++ifftpolar[1,2] +remove[0,1,2] +keep[-1] +fft_tile3_clean: +tc={round(w/$2)} tr={round(h/$2)} +split_tiles $tc,$tr +repeat $! local[$>] +fft_tile3_fft[0--1] $1,$2,$3,$4,$5,$6 +done done +append_tiles $tc,$tr +c 0,255 +fft_tile3: ++resize[0] {w+$2},{h+$2},1,1,0,1,1,1 +resize[-1] {w+$2},{h+$2},1,1,0,1,0,0 +fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] $2,$2,{w-$2-1},{h-$2-1} +if $8>2 +push={round($2*1.5)} +pull={$2-$push} ++resize[0] {w+$push},{h+$2},1,1,0,1,1,1 +resize[-1] {w+$pull},{h+$2},1,1,0,1,0,0 +fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$push},{$2},{w-$pull-1},{h-($2)-1} ++resize[0] {w+$2},{h+$push},1,1,0,1,1,1 +resize[-1] {w+$2},{h+$pull},1,1,0,1,0,0 +fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] $2,{$push},{w-$2-1},{h-$pull-1} +fi +if $8>1 +dia1={round($2/3)} +dia2={$2-$dia1} ++resize[0] {w+$dia1},{h+$dia1},1,1,0,1,1,1 +resize[-1] {w+$dia2},{h+$dia2},1,1,0,1,0,0 +fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$dia1},{$dia1},{w-$dia2-1},{h-$dia2-1} ++resize[0] {w+$dia2},{h+$dia2},1,1,0,1,1,1 +resize[-1] {w+$dia1},{h+$dia1},1,1,0,1,0,0 +fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$dia2},{$dia2},{w-$dia1-1},{h-$dia1-1} +fi +remove[0] +if $8==3 +blend_median +fi +if $8==2 +blend_median +fi +nr5: +luma_strength=$1 +colour_strength=$2 +recovery=$3 +detail_recovery={5000-($4*500)} +fine_detials=$13 +medium_detials=$14 +large_details=$15 +detail_radius=$5 +detail_amount=$6 +detail_threshold=$7 +edge_radius=$8 +edge_amount=$9 +edge_threshold=$10 +quality=3 +if $16==1 +mul[0] 256 +radius={0.05*(min(h,w))} +[0] +rectangle[-1] 0,0,100%,$radius,1,{ia} +rectangle[-1] 0,0,$radius,100%,1,{ia} +rectangle[-1] 0,100%,100%,{h-$radius},1,{ia} +rectangle[-1] {w-$radius},100%,100%,0,1,{ia} +blur[-1] {$radius/2} +xmin={xm} +ymin={ym} +remove[-1] ++crop[0] {$xmin-$radius},{$ymin-$radius},{$xmin+$radius},{$ymin+$radius} +minnoise=${-variance_noise} +remove[-1] ++sub[0] {250*256} +abs[-1] +rectangle[-1] 0,0,100%,$radius,1,{ia} +rectangle[-1] 0,0,$radius,100%,1,{ia} +rectangle[-1] 0,100%,100%,{h-$radius},1,{ia} +rectangle[-1] {w-$radius},100%,100%,0,1,{ia} +blur[-1] {$radius/2} +xmax={xm} +ymax={ym} ++crop[0] {$xmax-$radius},{$ymax-$radius},{$xmax+$radius},{$ymax+$radius} +maxnoise=${-variance_noise} +remove[-1] ++sub[0] {128*256} +abs[-1] +rectangle[-1] 0,0,100%,$radius,1,{ia} +rectangle[-1] 0,0,$radius,100%,1,{ia} +rectangle[-1] 0,100%,100%,{h-$radius},1,{ia} +rectangle[-1] {w-$radius},100%,100%,0,1,{ia} +blur[-1] {$radius/2} +xave={xm} +yave={ym} +remove[-1] ++crop[0] {$xave-$radius},{$yave-$radius},{$xave+$radius},{$yave+$radius} +midnoise=${-variance_noise} +text[-1] $midnoise,0,0,25,1,{iM} ++sub[0] {64*256} +abs[-1] +rectangle[-1] 0,0,100%,$radius,1,{ia} +rectangle[-1] 0,0,$radius,100%,1,{ia} +rectangle[-1] 0,100%,100%,{h-$radius},1,{ia} +rectangle[-1] {w-$radius},100%,100%,0,1,{ia} +blur[-1] {$radius/2} +xshadow={xm} +yshadow={ym} +remove[-1] ++crop[0] {$xshadow-$radius},{$yshadow-$radius},{$xshadow+$radius},{$yshadow+$radius} +shadownoise=${-variance_noise} ++sub[0] {192*256} +abs[-1] +rectangle[-1] 0,0,100%,$radius,1,{ia} +rectangle[-1] 0,0,$radius,100%,1,{ia} +rectangle[-1] 0,100%,100%,{h-$radius},1,{ia} +rectangle[-1] {w-$radius},100%,100%,0,1,{ia} +blur[-1] {$radius/2} +xbright={xm} +ybright={ym} +remove[-1] ++crop[0] {$xbright-$radius},{$ybright-$radius},{$xbright+$radius},{$ybright+$radius} +brightnoise=${-variance_noise} +shadows={(($minnoise/$shadownoise)*64)} +mids={(($minnoise/$midnoise)*64)} +brights={(($minnoise/$brightnoise)*64)} +whites={(($minnoise/$maxnoise)*64)} +point1={$shadows+32} +point2={$mids+$shadows+32} +point3={$brights+$mids+$shadows+32} +point4={$whites+$brights+$mids+$shadows+32} +keep[0] +apply_curve[0] 0,0,0,{32*256},{32*256},{96*256},{$point1*256},{160*256},{$point2*256},{223*256},{$point3*256},{287*256},{$point4*256} +div[0] 256 +else +apply_gamma {1/$17} +fi +rgb2ycbcr +split c +if $1>0 +if $11==0 ++denoise_haar[0] $luma_strength,0,{$quality*10} +fi +if $11==1 ++ms_patch[0] 10,{$luma_strength*2.5},3,5,0,1,1,0,{$luma_strength*.75},{$luma_strength*.5},{$luma_strength*0},{$luma_strength*0},1,1,1,0 +fi +if $11==2 ++autonr2[0] $luma_strength,1 +fi +if $11==3 ++median[0] 3 +ms_patch[-1] 10,{$luma_strength*2.5},3,5,0,1,1,0,{$luma_strength*.75},{$luma_strength*.5},{$luma_strength*0},{$luma_strength*0},1,1,1,0 +fi +if $11==4 ++msmed2[0] 3 +repeat $1 +msmed2[-1] 3 +done +fi ++sub[0] [-1] +add[-1] {128} +remove[0] +if $recovery==1 +resize[-1] {w+48},{h+48},{d},{s},0,0,0,0 +resize[-1] {w+48},{h+48},{d},{s},0,0,1,1 +rectangle[-1] 0,0,100%,48,1,128 +rectangle[-1] 0,0,48,100%,1,128 +rectangle[-1] 0,100%,100%,{h-48},1,128 +rectangle[-1] {w-48},100%,100%,0,1,128 +fft_tile3[-1] {$detail_recovery},48,0,$fine_detials,$medium_detials,$large_details,1,$quality +crop[-1] 48,48,{w-49},{h-49} +else +fill[-1] 128 +fi +unsharp[-1] $detail_radius,$detail_amount,$detail_threshold +unsharp[2] $edge_radius,$edge_amount,$edge_threshold +sub[-1] {128} +add[2] [-1] +remove[-1] +else +move[0] 3 +fi +if $2>0 +median[0,1] 3 +median[0,1] 3 +if $12==1 +ms_patch[0] 10,1,3,5,0,1,1,0,{$colour_strength*1},{$colour_strength*.5},{$colour_strength*.25},{$colour_strength*0},0,1,1,0 +ms_patch[1] 10,1,3,5,0,1,1,0,{$colour_strength*1},{$colour_strength*.5},{$colour_strength*.25},{$colour_strength*0},0,1,1,0 +fi +if $12==0 +denoise_haar[0] $colour_strength,0,{$quality*3} +denoise_haar[1] $colour_strength,0,{$quality*3} +fi +fi +move[-1] 0 +append c +ycbcr2rgb +if 16==1 +mul[0] 256 +apply_curve[0] 0,0,0,{32*256},{32*256},{$point1*256},{96*256},{$point2*256},{160*256},{$point3*256},{223*256},{$point4*256},{287*256} +div[0] 256 +else +apply_gamma $17 +fi +c 0,255 +ms_patch_smoothing: +ac "repeat $7 denoise $1,$2,$3,$4,$5,$6 done",$8,0 c 0,255 +ms_patch_2: ++resize[0] 50%,50%,1,{s},2 ++ms_patch_smoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 ++resize[1] {0,w},{0,h},1,{s},5 ++sub[0] [3] +resize[2] {0,w},{0,h},1,{s},5 ++add[2] [4] +keep[-1] +c 0,255 +ms_patch_3: ++resize[0] 25%,25%,1,{s},2 ++ms_patch_smoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 ++resize[1] {0,w},{0,h},1,{s},5 ++sub[0] [3] +resize[2] {0,w},{0,h},1,{s},5 ++add[2] [4] +keep[-1] +c 0,255 +ms_patch_4: ++resize[0] 12.5%,12.5%,1,{s},2 ++ms_patch_smoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 ++resize[1] {0,w},{0,h},1,{s},5 ++sub[0] [3] +resize[2] {0,w},{0,h},1,{s},5 ++add[2] [4] +keep[-1] +c 0,255 +ms_patch_5: ++resize[0] 6.125%,6.125%,1,{s},2 ++ms_patch_smoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 ++resize[1] {0,w},{0,h},1,{s},5 ++sub[0] [3] +resize[2] {0,w},{0,h},1,{s},5 ++add[2] [4] +keep[-1] +c 0,255 +ms_patch: +apply_gamma {1/$14} +repeat $15 +if $13==1 +ms_patch_smoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 +fi +if $9>0.1 +ms_patch_2 $1,$9,$3,$4,$5,$6,$7,$8 +fi +if $10>0.1 +ms_patch_3 $1,$10,$3,$4,$5,$6,$7,$8 +fi +if $11>0.1 +ms_patch_4 $1,$11,$3,$4,$5,$6,$7,$8 +fi +if $12>0.1 +ms_patch_5 $1,$12,$3,$4,$5,$6,$7,$8 +fi +done +apply_gamma $14 +c 0,255 +msmed2: +medlvl2=2 +medlvl3=3 +medlvl4=4 +medlvl5=6 +medlvl6=6 +medlvl7=7 +median $1 +median $1 +name[0] full ++resize[full] {full,w/$medlvl2},{full,h/$medlvl2},1,{s},2 +name[-1] level2 ++resize[level2] {0,w},{0,h},1,{s},3,1 +name[-1] low2 ++compose_grainextract[full,low2] +name[-1] level2high +remove[low2] +median[level2] $1 +median[level2] $1 +name[1] level2 ++resize[level2] {full,w/$medlvl3},{full,h/$medlvl3},1,{s},2 +name[-1] level3 ++resize[level3] {level2,w},{level2,h},1,{s},3,1 +name[-1] low3 ++compose_grainextract[level2,low3] +name[-1] level3high +remove[1,low3] +median[2] $1 +median[2] $1 +name[2] level3 ++resize[level3] {full,w/$medlvl4},{full,h/$medlvl4},1,{s},2 +name[-1] level4 ++resize[level4] {level3,w},{level3,h},1,{s},3,1 +name[-1] low4 ++compose_grainextract[level3,low4] +name[-1] level4high +remove[2,low4] +median[-2] $1 +median[-2] $1 +name[-2] base +resize[base] {level4high,w},{level4high,h},1,{s},3,1 +compose_grainmerge[-1,-2] +name[-1] base +resize[base] {level3high,w},{level3high,h},1,{s},3,1 +compose_grainmerge[-1,-2] +resize[-1] {full,w},{full,h},1,{s},3,1 +compose_grainmerge[-1,-2] +keep[-1] +nr5_preview: +if $-1==0 +nr5 $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17 +fi +if $-1==1 ++nr5 $1,$2,$3,$4,$5,0,$7,$8,0,$10,$11,$12,$13,$14,$15,$16,$17 +sub[0] [1] +keep[0] +mul 2 +add 128 +fi +iain_png_processing: +repeat $! l[$>] +nm=${-gui_layer_name} +dither_pattern=$3 +do_smooth=$4 +smooth_radius=$5 +smooth_amount=$6 +do_sharp=$7 +sharp_radius=$8 +sharp_amount=$9 +sharp_threshold=$10 +constrant_radius=$11 +overshoot=$12 +do_median=$13 +median_radius=$14 +median_repeat=$15 +remove_opacity +if $do_smooth +bilateral[0] $smooth_radius,$smooth_amount +fi +if $do_sharp +iain_constrained_sharpen[0] $sharp_radius,$sharp_amount,$sharp_threshold,$constrant_radius,$overshoot,0,1 +fi ++colormap $1,$2,1 +if $dither_pattern==2 ++index[0] [1],1,0 +elif $dither_pattern!=2 ++index[0] [1],0,0 +fi ++map[-1] [-2] +if $dither_pattern<=1 ++sub[0] [-1] +abs[-1] ++add[0] [4] ++sub[0] [4] +index[-1] [1],0,0 +index[-2] [1],0,0 +l[-1,-2] +if $dither_pattern==1 +(0,255;255,0) +elif $dither_pattern==0 +(0;255) +fi +resize_as_image[-1] [0],0,2 +channels[-1] 0 +append[-1,-2] c +blend alpha +done +if $do_median +repeat $median_repeat +l[-1] +repeat ($median_radius*2)+1 +amount={$>-$median_radius} +if $amount!=0 ++shift[0] $amount,0,0,0,0 +fi +done +blend_median +done +done +fi ++map[-1] [1] +k[-1] +else +rm[-1] +if $do_median +repeat $median_repeat +horiz_median[-1] $median_radius +done +fi ++map[-1] [1] +k[-1] +fi +nm name($nm) +done done +iain_savenoiseprint_p: +if $1==0 +text "creating noiseprint",0,0,50,1,255 +elif $1==1 +iain_savenoiseprint[0,1] $1,$2,$3 +fi +iain_savenoiseprint: +remove_opacity +rgb2yuv8 +split c +remove[-1,-2] +l[0,3] +apply_parallel_overlap[0] "mul {1/255} pow $3 mul 255 ",0,0 +apply_parallel_overlap[1] "mul {1/255} pow $3 mul 255 ",0,0 ++sub[1] [0] +add[-1] 128 +l[-1] +if $1==0 ++l +size=48 +cropwidth={w} +cropheight={h} +resize[0] {w+($size-w%$size)},{h+($size-h%$size)},1,{s},0,1 +tc={round(w/$size)} tr={round(h/$size)} +l[0] +split_tiles $tc,$tr +repeat $! local[$>] +fftpolar[0] +append[0,1] z +done done +median_median +done +o noiseprint.cimg +rm +done +elif $1==1 +size=48 +cropwidth={w} +cropheight={h} +resize[0] {w+($size-w%$size)},{h+($size-h%$size)},1,{s},0,1 +tc={round(w/$size)} tr={round(h/$size)} +i noiseprint.cimg +mul[-1] $2 ++l[0,1] +split_tiles[0] $tc,$tr +repeat $!-1 +l[$>,-1] +[-1] +l[0,1] +fftpolar[0] +l[0,-1] +split[1] z +rm[-1] ++gt[0] [1] +circle[-1] 50%,50%,1%,1,1 +mul[0] [-1] +keep[0] +done +ifftpolar +done +done +done +rm[-1] +append_tiles $tc,$tr +done ++l[0,1] +shift[0] 16,16,0,0 +split_tiles[0] $tc,$tr +repeat $!-1 +l[$>,-1] +[-1] +l[0,1] +fftpolar[0] +l[0,-1] +split[1] z +rm[-1] ++gt[0] [1] +circle[-1] 50%,50%,1%,1,1 +mul[0] [-1] +keep[0] +done +ifftpolar +done +done +done +rm[-1] +append_tiles $tc,$tr +shift[0] -16,-16,0,0 +done +l[0,1] +shift[0] 32,32,0,0 +split_tiles[0] $tc,$tr +repeat $!-1 +l[$>,-1] +[-1] +l[0,1] +fftpolar[0] +l[0,-1] +split[1] z +rm[-1] ++gt[0] [1] +circle[-1] 50%,50%,1%,1,1 +mul[0] [-1] +keep[0] +done +ifftpolar +done +done +done +rm[-1] +append_tiles $tc,$tr +shift[0] -32,-32,0,0 +done +iain_fast_median_stack +crop 0,0,{$cropwidth-1},{$cropheight-1} +c 0,255 +fi +done +sub[-1] 128 +add[0] [-1] +keep[0] +apply_parallel_overlap[0] "mul {1/255} pow {1/$3} mul 255 ",0,0 +done +append c +yuv82rgb +c 0,255 +if $1==0 +rm +fi +median_median: +repeat $!/3-($!%3) +l[$>,{$>+1},{$>+2}] +iain_fast_median_stack +done +done +repeat $!/3-($!%3) +l[$>,{$>+1},{$>+2}] +iain_fast_median_stack +done +done +repeat $!/3-($!%3) +l[$>,{$>+1},{$>+2}] +iain_fast_median_stack +done +done +num=$! +add +div $num +simplelocalcontrast_p: +to_rgb +[0] +apply_parallel_overlap[1] " +simplelocalcontrast[0] ${1-6}",{30+$3},$12 ++luminance[-1] +apply_curve[-1] 0,0,$7,64,$8,128,$9,196,$10,255,$11 +mul[-1] 255 +append[1,2] c +blend alpha,1,0 +simplelocalcontrast: +str1=$1 +str2={$str1*0.7} +str3={$str2*0.7} +str4={$str3*0.7} +str5={$str4*0.7} +str6={$str5*0.7} +str7={$str6*0.7} +str8={$str7*0.7} +apply_gamma $5 +conttest4 $4,$str1,$str2,$str3,$str4,$str5,$str6,$str7,$str8,$2,$3,$3,$3,$3,$3,$3,2,1 +apply_gamma $6 +n 0,255 +conttest4: +to_rgb +if $1==1 ++luminance ++smoothbase4[-1] $2,$3,$4,$5,$6,$7,$8,$9,$10 ++compose_grainextract[-1,-2] +ms_smooth[-1] $11,$12,$13,$14,$15,$16,$17,$18,1 +remove[1,2] +sub[-1] 128 mul[-1] 2 add[-1] 128 ++compose_grainmerge +remove[0,1] +else ++smoothbase4 $2,$3,$4,$5,$6,$7,$8,$9,$10 ++compose_grainextract +ms_smooth[-1] $11,$12,$13,$14,$15,$16,$17,$18,1 +remove[1] +sub[-1] 128 mul[-1] 2 add[-1] 128 ++compose_grainmerge +remove[1] +rgb2hsv +split c +remove[1,2,3] +append c +hsv2rgb +fi +smoothbase4: +repeat $9 +cropwidth={w} +cropheight={h} +resize[0] {w+(256-w%256)},{h+(256-h%256)},1,{s},0,1 +width={w} +height={h} +if $1!=0 +denoise[0] 10,$1,3,5,0,1 +fi ++resize[0] {$width/2},{$height/2},1,{s},2,1 ++resize[-1] $width,$height,1,{s},3,1 +blur[-1] .5 +compose_grainextract[0,-1] +if $2!=0 +denoise[-1] 10,$2,3,5,0,1 +fi ++resize[-1] {$width/4},{$height/4},1,{s},2,1 ++resize[-1] {$width/2},{$height/2},1,{s},3,1 +blur[-1] .5 +compose_grainextract[1,-1] +if $3!=0 +denoise[-1] 10,$3,3,5,0,1 +fi ++resize[-1] {$width/8},{$height/8},1,{s},2,1 ++resize[-1] {$width/4},{$height/4},1,{s},3,1 +blur[-1] .5 +compose_grainextract[2,-1] +if $4!=0 +denoise[-1] 10,$4,3,5,0,1 +fi ++resize[-1] {$width/16},{$height/16},1,{s},2,1 ++resize[-1] {$width/8},{$height/8},1,{s},3,1 +blur[-1] .5 +compose_grainextract[3,-1] +if $5!=0 +denoise[-1] 10,$5,3,5,0,1 +fi ++resize[-1] {$width/32},{$height/32},1,{s},2,1 ++resize[-1] {$width/16},{$height/16},1,{s},3,1 +blur[-1] .5 +compose_grainextract[4,-1] +if $6!=0 +denoise[-1] 10,$6,3,5,0,1 +fi ++resize[-1] {$width/64},{$height/64},1,{s},2,1 ++resize[-1] {$width/32},{$height/32},1,{s},3,1 +blur[-1] .5 +compose_grainextract[5,-1] +if $7!=0 +denoise[-1] 10,$7,3,5,0,1 +fi ++resize[-1] {$width/128},{$height/128},1,{s},2,1 ++resize[-1] {$width/64},{$height/64},1,{s},3,1 +blur[-1] .5 +compose_grainextract[6,-1] +if $8!=0 +denoise[-1] 10,$8,3,5,0,1 +fi ++resize[-1] {$width/256},{$height/256},1,{s},2,1 ++resize[-1] {$width/128},{$height/128},1,{s},3,1 +blur[-1] .5 +compose_grainextract[7,-1] +resize[-1] {$width/128},{$height/128},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/64},{$height/64},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/32},{$height/32},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/16},{$height/16},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/8},{$height/8},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/4},{$height/4},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/2},{$height/2},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/1},{$height/1},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +crop 0,0,{$cropwidth-1},{$cropheight-1} +done +iain_fx_skin_mask_pr: +if $6==0 +iain_skin_mask $1,$2,$3,$4,$5 +elif $6==1 ++iain_skin_mask $1,$2,$3,$4,1 +n[-1] 0.6,1 +mul +fi +iain_fx_skin_mask: +tic +apply_parallel_overlap[0] "iain_skin_mask[0] ${1--1}",0,0 +toc +iain_skin_mask: +dark={$1} +pale={255-$2} +red={255-$3} +yellow={255-$4} +to_rgb +[0] +[0] +[0] +l[1] +if $3>0 +red={255-$3} +fill if(i(x,y,z,0)-i(x,y,z,1)<{$red},i,0) +gt 0 +else +fill 1 +fi +done +l[2] +rgb2cmyk +dark={$1} +pale={255-$2} +fill if(i(x,y,z,2)>i(x,y,z,1),if(i(x,y,z,2)-i(x,y,z,1)<{$dark},if((i(x,y,z,0)+{$pale})0 +yellow={255-$4} +rgb2hsv +split c +keep[0] +add[0] 180 +mod[0] 360 +lt[0] $yellow +else +fill 1 +fi +done +mul[1,2,3] +mul[1] 255 +channels[1] 0 +if $5 +keep[1] +else +append c +fi +iain_smartdemos: +cropwidth={w} +cropheight={h} +resize[0] {w+(64-w%64)},{h+(64-h%64)},{d},{s},0,2 +apply_parallel_overlap " +to_rgb +add 1000 +rgb2bayer[0] $1,1 ++l[0] ++l[0] +split c +l[0,2] +(0,0,.5;0,1,0;0.5,0,0) +convolve[0] [-1] +convolve[1] [-1] +rm[-1] +(0,0,.25;0,.5,0;0.25,0,0) +convolve[0] [-1] +convolve[1] [-1] +rm[-1] +done +done +split[0] c +name[0] red name[1] green name[2] blue +name[3] redblur name[4] greenblur name[5] blueblur ++div[redblur] [blueblur] +replace_nan 0 ++mul[blue] [-1] +add[-1] [red] ++div[blueblur] [redblur] +replace_nan 0 ++mul[red] [-1] +add[-1] [blue] +keep[1,-1,-3] +reverse[0,1] +append c +done +l[0] ++l[0] +split c +l[0,2] +(0.5,0,0;0,1,0;0,0,0.5) +convolve[0] [-1] +convolve[1] [-1] +rm[-1] +(0.25,0,0;0,.5,0;0,0,0.25) +convolve[0] [-1] +convolve[1] [-1] +rm[-1] +done +done +split[0] c +name[0] red name[1] green name[2] blue +name[3] redblur name[4] greenblur name[5] blueblur ++div[redblur] [blueblur] +replace_nan 0 ++mul[blue] [-1] +add[-1] [red] ++div[blueblur] [redblur] +replace_nan 0 ++mul[red] [-1] +add[-1] [blue] +keep[1,-1,-3] +reverse[0,1] +append c +done ++l[0] +(.33,0,0,0,0;0,.66,0,0,0;0,0,-2,0,0;0,0,0,.66,0;0,0,0,0,.33) +convolve[0] [1] +rm[1] +abs +split c +rm[1] +max +done ++l[1] +(0,0,0,0,.33;0,0,0,.66,0;0,0,-2,0,0;0,.66,0,0,0;.33,0,0,0,0) +convolve[0] [1] +rm[1] +abs +split c +rm[1] +max +done +blur[-1,-2] 2 +sub[-1,-2] +gt[-1] 0 +mul[-1] 255 +append[1,2] c +blend alpha,1,0 ++l[0] +split[0] c +add[0,2] +mul[0] 0.5 +reverse +=>[0] green =>[1] magenta +[0] [1] +=>[-2] greenblur =>[-1] mblur +(0.25;.5;0.5;.5;0.25) +convolve[mblur] [-1] rm[-1] +(0.5;1;0.5) +convolve[greenblur] [-1] +rm[-1] ++div[greenblur] [mblur] +replace_nan 0 +=>[-1] mmul +rm[greenblur,mblur] +mul[magenta] [mmul] +keep[green,magenta] +add +done ++l[0] +split[0] c +add[0,2] +mul[0] 0.5 +reverse +=>[0] green =>[1] magenta +[0] [1] +=>[-2] greenblur =>[-1] mblur +(0.25,.5,0.5,.5,0.25) +convolve[mblur] [-1] rm[-1] +(0.5,1,0.5) +convolve[greenblur] [-1] +rm[-1] ++div[greenblur] [mblur] +replace_nan 0 +=>[-1] mmul +rm[greenblur,mblur] +mul[magenta] [mmul] +keep[green,magenta] +add +done +sub 1000 +c 0,255 ++l[0,1] +rgb2bayer[0] $1,1 ++to_rgb[1] +rgb2bayer[-1] $1,1 +split[0] c +split[-1] c +sub[0] [4] +sub[2] [6] +(0.25,0.5,0.25;0.5,1,0.5;0.25,0.5,0.25) +convolve[0] [-1] +convolve[2] [-1] +remove[-1] +add[0] [3] +add[2] [3] +remove[1,4,5,6] +reverse[1,2] +append c +done +l[0,2] +rgb2bayer[0] $1,1 ++to_rgb[1] +rgb2bayer[-1] $1,1 +split[0] c +split[-1] c +sub[0] [4] +sub[2] [6] +(0.25,0.5,0.25;0.5,1,0.5;0.25,0.5,0.25) +convolve[0] [-1] +convolve[2] [-1] +remove[-1] +add[0] [3] +add[2] [3] +remove[1,4,5,6] +reverse[1,2] +append c +done +rm[1] +replace_inf 255 +replace_nan 0 +reverse +l[0] ++blur $2 +sub[0] [1] +add[0] 128 +done +l[2] ++blur $2 +sub[0] [1] +add[0] 128 +done +l[0,2] +nozip $3 +done +l[-1,-2] ++l[0] ++l +split c +add +div 3 +done +sub ++blur 3 +sub +abs +split c +max +done ++l[1] ++l +split c +add +div 3 +done +sub ++blur 3 +sub +abs +split c +max +done +l[-1,-2] +blur 2 +sub +gt 0 +mul 255 +done +append[1,2] c +blend alpha,1,0 +done +sub[0] 128 +add +c 0,255 +",16,0 +crop 0,0,{$cropwidth-1},{$cropheight-1} +time=$| +iain_split_orientation_preview: +if $7 +iain_draw_angle $1,$2,$5 +else +iain_split_orientation $1,$2,$3,$4,$5,$6,$7,$8,$9 +iain_draw_angle $1,$2,$5 +fi +iain_split_orientation: +residual=$4 +snap=$5 +cutoff_steepness=$6 +x_point={($1-50)/100} +y_point={($2-50)/100} +angle_rad={-1*(atan($x_point/$y_point))} +if $8 +angle_rad={$angle_rad+(pi/2)} +fi +angle_deg={$angle_rad/pi*180} +angle_deg_snap={round(($angle_deg+180),$snap)-180} +angle_rad_snap={$angle_deg_snap/180*pi} +radians={$angle_rad_snap+(pi/2)} +width={($3/180)*pi} +if $8 +width={((180-$3)/180)*pi} +fi +remove_opacity ++blur[0] $residual +sub[0] [-1] +100%,100% +fill[-1] ($radians+atan((0.5-(x/w))/(0.5-(y/h)))-$width/2)%pi +low_angle={pi-$width} +high_angle={pi+$width} +fill[-1] if($high_angle>i&&i>$low_angle,1,0) +radians=$radians+($width) ++fftpolar[0] +blur_angular[2] $cutoff_steepness +c[2] 0,1 +mul[3] [2] +rm[2] +ifftpolar[-1,-2] +sub[0] [-1] +add[0,1] +reverse +if $9==0 +k[0] +add[0] 128 +elif $9==1 +add[0] 128 +=>[0] "mode(grainmerge), name" +elif $9==2 +k[1] +fi +iain_draw_angle: +repeat $! +l[$<] +snap=$3 ++l[0] +remove_opacity +fill 0 +x_point={($1-50)/100} +y_point={($2-50)/100} +angle_rad={-1*(atan($x_point/$y_point))} +angle_deg={$angle_rad/pi*180} +angle_deg_snap={round(($angle_deg+180),$snap)-180} +angle_rad_snap={$angle_deg_snap/180*pi} +if (sin($angle_rad))==0 angle_rad=0$angle_rad+.0001 fi +if (cos($angle_rad))==0 angle_rad=0$angle_rad+.0001 fi +hypotenuse_x={$x_point/(sin($angle_rad))} +hypotenuse_y={$y_point/(cos($angle_rad))} +line_x={((sin($angle_rad)*$hypotenuse_x)+0.5)*w} +line_y={((cos($angle_rad)*$hypotenuse_y)+0.5)*h} +line_x_snap={((sin($angle_rad_snap)*($hypotenuse_x))+0.5)*w} +line_y_snap={((cos($angle_rad_snap)*($hypotenuse_y))+0.5)*h} +text_hyp_x={$hypotenuse_x+(sign($hypotenuse_x)*0.05)} +text_hyp_y={$hypotenuse_y+(sign($hypotenuse_y)*0.05)} +text_x={((sin($angle_rad_snap)*($text_hyp_x))+0.5)*w} +text_y={((cos($angle_rad_snap)*($text_hyp_y))+0.5)*h} +poly_hyp_x={sign($hypotenuse_x)} +poly_hyp_y={sign($hypotenuse_y)} +poly_x1={((sin($angle_rad_snap)*($poly_hyp_x))+0.5)*w} +poly_y1={((cos($angle_rad_snap)*($poly_hyp_y))+0.5)*h} +poly_x2={((sin($angle_rad)*($poly_hyp_x))+0.5)*w} +poly_y2={((cos($angle_rad)*($poly_hyp_y))+0.5)*h} +100%,100%,1,1,0 +rm[0] +circle[-1] 50%,50%,{abs($hypotenuse_x)*w},1,255,255,255,255 +circle[-1] 50%,50%,{(abs($hypotenuse_x)*w)-2},1,0,0,0,255 +100%,100%,1,1,0 +polygon[-1] 3,50%,50%,$poly_x1,$poly_y1,$poly_x2,$poly_y2,1,1 +mul[-1] [-2] +rm[-2] +[-1] ++iain_draw_conical_lines[-1] 6,3 +mul[-1,-3] +mul[-1] {80/255} +to_rgb[-2] +append[-1,-2] c +100%,100%,1,1,0 +linethick[-1] 50%,50%,$line_x,$line_y,2,1,255 +linethick[-1] 50%,50%,$line_x_snap,$line_y_snap,2,1,255 ++iain_draw_radial_lines[-1] 8,4 +mul[-1,-2] +100%,100%,1,1,0 +linethick[-1] 50%,50%,$line_x,$line_y,2,1,80 +linethick[-1] 50%,50%,$line_x_snap,$line_y_snap,2,1,160 +to_rgb[-2] +append[-1,-2] c +max +text[-1] {round($angle_deg_snap,1)},$text_x,$text_y,17,1,255 +done +blend alpha +done +done +iain_draw_conical_lines: +100%,100%,1,1 +rm[0] +radians=0 +width=0 +fill[0] ($radians+atan((0.5-(x/w))/(0.5-(y/h)))-$width/2)/pi*360 +mod $1 +lt $2 +iain_draw_radial_lines: +100%,100%,1,1 +rm[0] +set 1,50%,50% +distance 1 +mod $1 +lt $2 +star_tone: +sx1=50 +sx2=194 +sx3=281 +sx4=511 +sx5=742 +sx6=829 +sx7=972 +sx8=829 +sx9=742 +sx10=511 +sx11=281 +sx12=192 +sy1=450 +sy2=633 +sy3=849 +sy4=817 +sy5=849 +sy6=633 +sy7=450 +sy8=267 +sy9=50 +sy10=83 +sy11=50 +sy12=267 +level=10 +luminance ++l +rm +2000,2000,1,1,0 +repeat 8 +polygon 12,$sx1,$sy1,$sx2,$sy2,$sx3,$sy3,$sx4,$sy4,$sx5,$sy5,$sx6,$sy6,$sx7,$sy7,$sx8,$sy8,$sx9,$sy9,$sx10,$sy10,$sx11,$sy11,$sx12,$sy12,1,$level +sx2={$sx2+40} +sx6={$sx6-40} +sx8={$sx8-40} +sx12={$sx12+40} +sy2={$sy2-23} +sy4={$sy4-47} +sy6={$sy6-23} +sy8={$sy8+23} +sy10={$sy10+47} +sy12={$sy12+23} +level={$level+25} +done +n 0,255 +resize 200,200,1,1,3 ++shift[0] -69,-40,0,0 ++shift[0] -69,40,0,0 ++shift[0] 69,-40,0,0 ++shift[0] 69,40,0,0 +add +crop 5,5,142,84 +done +resize[-1] $1,$1,1,1,2 +width={w} +height={h} +w_tiles={0,round(w/$width)} +h_tiles={0,round(h/$height)} +total_tiles=$h_tiles*$w_tiles +[-1]x{$total_tiles-1} +append_tiles[1--1] $w_tiles,$h_tiles +equalize[-1] 256 +blend alpha,0.5,1 +gt 128 +mul 255 +iain_sub_cast: +repeat $! l[$>] +srgb2rgb ++median[0] 3 +bilateral[0] [1],10,$1 +rm[1] ++resize[0] 10%,10%,100%,100%,2 +dilate[1] 21 +split[1] c +fill[1] {1,ia} +fill[2] {2,ia} +fill[3] {3,ia} +append[1,2,3] c +resize[1] [0] +sub[0] [1] +k[0] +n[0] 0,255 +c[0] $2,$3 +n 0,255 +rgb2srgb +nm name($nm) +done done +iain_turbulent_halftone: +repeat $! local[$>] +if $8>0 ++iain_fast_denoise $8,0,1,0,0 +sub[1] [0] +mul[1] -1 +add +fi +if $7==1 +rgb2cmyk +elif $7==2 +luminance +fi +split c +repeat $! local[$>] ++l[0] +channels 0 +tsize={min($5,w,h)} +xtile={(round(w/$tsize))+1} +ytile={(round(h/$tsize))+1} +$tsize,$tsize +fx_seamless_turbulence[-1] $1,$2,$3,$4,.25,0 +[-1]x{$xtile*$ytile} +append_tiles[1--1] $xtile,$ytile +remove[-1] +crop[-1] 0,0,{0,w},{0,h} +keep[-1] +done +blur[-1] $6 +l[-1] +blur 10 sub done +n[-1] 0,255 +equalize[-1] 256 +if $9 +resize 400%,400%,100%,100%,3 +fi +blend alpha,0.5,1 +gt 128 +mul 255 +done done +append c +if $7==1 +cmyk2rgb +fi +if $9 +resize 25%,25%,100%,100%,3 +fi +done done +iain_turbulent_halftone_preview: +iain_turbulent_halftone $1,$2,$3,$4,{0,w},$6,$7,$8,$9 +jeje_render3d : +W={0,w} +1,2,1,4 f. $9,$13,$10,$14,$11,$15,$12,$16 r. {0,w},{0,h},1,4,5 +blend alpha +i "$1" a[1--1] z +l. +if $17 display_volume $2,$3,$4 else jeje_boundingbox3d 20 fi +r3d 0,0,1,$7 +r3d 0,1,0,$6 +r3d 1,0,0,$5 +c3d n3d *3d {3*$W*$8/4} +done +object3d[0] [1],50%,50%,0,1 +n 0,255 +rm[1] +jeje_render3d_preview : +jeje_render3d $"*" +jeje_deconvolve : +if $2==1 +deconvolve_goldmeinel[0] [1],$1 n[0] 0,255 +else +deconvolve_richardsonlucy[0] [1],$1 n[0] 0,255 +fi +jeje_deconvolve_preview : +gui_split_preview "jeje_deconvolve $1,$2,$3",$4 +jeje_zernike : +zernike {$1*w/100},{$2*h/100},{$3*w/100},${4-18} +n 0,255 +if $19 f '100*((i/$20)%1)<$21' n 0,255 fi +jeje_zernike_preview : +gui_split_preview "jeje_zernike $*",$-1 +jpr_about : fx_logo "@jayprich filters" +#@cli jpr_colourillusion : +#@cli : Use -d0 ( or -w -1,-1,0 -d ) to avoid normalisation of colours +#@cli : optical illusion involving color spirals +#@cli : visual "green arm" and "blue arm" contain the same color +jpr_colourillusion : +arm={$1*1.5-1} +{w},{h},1,1,A=10+atan2(x-{w/2},y-{h/2})*$arm/pi;R=sqrt((x-{w/2})^2+(y-{h/2})^2)/$2+A;(int(A+R/$arm)+int(R*6-A/$arm)%2)%3 +(250,200,0^20,200,190^160,100,150) +map.. . +k.. +#@cli jpr_coltexindex : +#@cli : Enrich colour with local analysis of luminance and index the image. +#@cli : $ sp swan jpr_coltexindex 8,250,250,15,150,1,0,0,0,10,20,3,1,3,0.25 +jpr_coltexindex : skip ${7=1} +e[^-1] "Index colour and texture of image$? with $1 types ($2,$3) v ($4,$5) x $6 and Smoothness $8 Black $9 Mid $10 White $11" +repeat $! +l[$<] +rgb2yuv s c ++b... $8 ++ge. $10 ++le.. $11 +ge... $9 +b[-5,-4] $12 +if $13 +gradient[-6] xy,4 +a[-7,-6] c +norm[-6] +b[-6] $14 +else ++b[-6] {$14*0.5} +-[-7,-1] +sqr[-6] +b[-6] {$14} +sqrt[-6] +fi +n[-6] 0,1 +*[-6] $15 ++-[-6] {-6,i(0.01*w*$2,0.01*h*$3)} +*. {i(0.01*w*$4,0.01*h*$5)} ++-[-6] {-6,i(0.01*w*$2,0.01*h*$3)} +*. {i(0.01*w*$4,0.01*h*$5)} ++[-2,-1] ++-[-5] {-5,i(0.01*w*$2,0.01*h*$3)} +*. {i(0.01*w*$4,0.01*h*$5)} ++[-2,-1] +/. {i(0.01*w*$4,0.01*h*$5)+0.00001} +c. 0,1 +*. $6 +a[-7--5,-1] c +-[-4] 2 +*[-4,-1] ++... 2 +*[-3,-2] ++colormap.. $1,1,1 +index... . +rm. +*.. 2 ++[-2,-1] +n 0,255 +to_rgb +if $7 +circle $2%,$3%,1%,1,,64,128,255 +circle $4%,$5%,1%,1,,255,64,128 +fi +done +done +#@cli jpr_decimate : +#@cli : Rescale in linear RGB space by cropping the frequency domain weighted +#@cli : to decrease high frequency akin to Lanczos window on Sinc lobes +#@cli : This filter discards the alpha channel +#@cli : High sharpness just crops frequency and gives bad halo +#@cli : $ sp swan > 185 * 255 +jpr_decimate 0.6,1.3 jpr_decimate.. 0.6,1.9 - + 128 +jpr_decimate : skip ${1=0.375},${2=5} +e[^-1] "Decimate scale $1 sharpness $2" +srgb2rgb +repeat $! +l[$<] +nw={round($1*w/2)} +nh={round($1*h/2)} +sc={4*$nw/w*$nh/h} +mid={round(0.5/$1-0.5)} +shift -$mid,-$mid +fft +shift $nw,$nh,0,0,2 +z 0,0,{2*$nw-1},{2*$nh-1} +shift -$nw,-$nh,0,0,2 +f i*min(1,abs(2*x/w-1)*$2)*min(1,abs(2*y/h-1)*$2) +ifft +rm. +* $sc +done +done +rgb2srgb +#@cli :: Input / Output +#@cli tiff3d +#@cli : Input a 3D tif as a 3D image +#@cli : Note: This is useful for loading several 3D image stack +tiff3d : e[^-1] "Load the file $1 as a 3D image." +n=$! +i $1 a[{$n}--1] z +#@cli toff3d +#@cli : Output a 3D tif as a 3D image +toff3d : e[^-1] "Save the 3D image as a tiff file." +repeat $! +o[$>] ${"filename \"$1\","$>} +done +#@cli :: 3D Rendering +#@cli jeje_boundingbox3d : _separation +#@cli : Bounding box of a 3D volume +#@cli : $ 100,100,100 jeje_boundingbox3d +jeje_boundingbox3d : skip ${1=10} +e[^-1] "3D Bounding box." +repeat $! l[$>] +box3d {0,w},{0,h},{0,d} p3d. 1 o3d. 1 +if $1>0 +plane3d {0,w},{0,h},$1,{round({0,h}/{0,w}*$1)} p3d. 1 o3d. .1 +fi +rm[0] +3d +done done +#@cli render_volume : _size,_quality,_opacity +#@cli : Pseudo volumic rendering +#@cli : $ 100,100,100 noise 1 b 10,0 max 0 r 100%,100%,100%,3,0 n 0,100 f 'if(c==0,z*i(x,y,z,0),if(c==1,i(x,y,z,0)*(100-z),0))' render_volume +render_volume : check "${1=8}>3&${2=5}>2&${3=.1}>0" +repeat $! l[$>] +mirror x ++tones {$2+1} rm[1,2] r[1--1] 100%,100%,100%,{0,s} *[1--1] [0] rm[0] +rv +repeat $! i=$< l[$<] +if im!=iM +pointcloud3d gaussians3d $1,{$3*($i+1)/$2} +else +rm +fi +done done ++3d md3d -1 +3d .5,.5,.5 +done done +#@cli display_volume : _size,_quality,_opacity +#@cli : Display the volume with black background, a bounding box +#@cli : and a volumic rendering of the data. +#@cli : $ 100,100,100 noise 1 b 10,0 max 0 r 100%,100%,100%,3,0 n 0,100 f 'if(c==0,z*i(x,y,z,0),if(c==1,i(x,y,z,0)*(100-z),0))' display_volume 8,5,.1 +display_volume : check "${1=8}>3&${2=5}>2&${3=.1}>0" +e[^-1] "Display_volume with size $1 quality $2 and opactiy $3." +repeat $! l[$>] ++jeje_boundingbox3d 20 +render_volume[0] $1,$2,$3 ++3d +done done +d3d_black : 1 d3d[0--2] . rm. +#@cli view3d : _angle1,_angle2 +#@cli : Apply a 3D view defined by two angles +#@cli : $ 50,50,50,3 noise 10 b 5 max 0 n 0,255 display_volume 32,5,1 view3d +view3d : skip ${1=25},${2=-120} +e[^-1] "Apply 3D view." +repeat $! l[$>] +r3d 0,0,1,$1 r3d 1,0,0,$2 +done done +#@cli colordepth +#@cli : Color depth coding +#@cli : $ 100,100,100 noise 1 b 10,0 max 0 colordepth 5 +colordepth : skip ${1=5} +e[^-1] "Colordepth coding with LUT $1." +repeat $! l[$>] +colordepth_volume $1 s z + +done done +#@cli colordepth_volume +#@cli : Make a 3D volume of the same size, color it, resize orignal in color and multiply +colordepth_volume : skip ${1=5} +repeat $! l[$>] +i [0] f. 'z/(d-1)*255' map. $1 r[0] 100%,100%,100%,3 * +done done +colordepth_scale : skip ${1=5} +10,{0,h-10} f. '(h-y)/(h-1)*255' map. $1 frame. 5,5,0,0,0 +#@cli make_axis : _xmin,_xmax,_ymin,_ymax +#@cli : Display an axis around an image +#@cli : $ image.jpg make_axis 0,1,0,1 +make_axis : +e[^-1] "Add axis." +repeat $! l[$>] +frame 1,1,0 +100%,24,1,3,255 axes. $1,$2,{-1},{-1} +24,{0,h},1,3,255 axes. {w},{w},$4,$3 24,24,1,3,255 a[-1,-2] y +a[0,1] y rv a[0,1] x +frame 12,12,255 100%,5,1,3,255,255,255 rv a y +done done +#@cli xlabel : _label +#@cli : Add a label to the x-axis (see make_axis) +#@cli : $ image.jpg make_axis 0,1,0,1 xlabel "x-axis" +xlabel : +e[^-1] "Add a x label." +repeat $! l[$>] +0 t. "$1",0,0,18,1,255,255,255 negate. +lt. 90% +j[0] ..,{{0,w}/2+12-{1,w}/2},{{0,h}-{1,h}},0,0,1,. k[0] +done done +#@cli ylabel : _label +#@cli : Add a label to the y-axis (see make_axis) +#@cli : $ image.jpg make_axis 0,1,0,1 ylabel "y-axis" +ylabel : +e[^-1] "Add a y label." +repeat $! l[$>] +0 t. "$1",0,0,18,1,255,255,255 negate. +rotate. -90 +lt. 90% +j[0] ..,0,{{0,h}/2-12-{1,h/2}},0,0,1,. k[0] +done done +#@cli title : _label +#@cli : Add a title (see make_axis) +#@cli : $ image.jpg make_axis 0,1,0,1 title "title" +title : +e[^-1] "Add a title." +repeat $! l[$>] +0 t. "$1",0,0,18,1,255,255,255 negate. +lt. 90% +j[0] ..,{{0,w}/2-{1,w}/2},0,0,0,1,. k[0] +done done +#@cli :: Feature detections +#@cli jeje_dog : scale1, scale2 +#@cli : Difference of Gaussian filter +#@cli : $ sp 1 jeje_dog +jeje_dog : skip ${1=1},${2=2} +e[^-1] "Difference of Gaussian." +repeat $! l[$>] +b $2 b.. $1 - done done +#@cli quiver2d +#@cli : Display a sequence 2D vector field on a 2D image sequence +#@cli : both being represented az a 3D stack +quiver2d : +e[^-1] "Cumulative sum along z-axis." +s z repeat $!/2 l[$>,{$>+$!/2}] quiver[0] [1],10,1,1,1,255 done done rm[{$!/2}--1] a z +#@cli warp2d : [field] +#@cli : Warp a 2D image stack using a vector field +warp2d : +e[^-1] "Warp a 3d stack using a displacement field." +pass$1 0 repeat $!-1 l[$>,-1] +s z repeat $!/2 l[$>,{$>+$!/2}] +warp[0] [1],1,1,1 +done done rm[{$!/2}--1] a z +done done +#@cli lucas_kanade: scale,smoothing +#@cli : Motion estimation using lucas and kanade approach +#@cli : Works on 2D+t image stacks/ has side effect +#@cli : [vx vy] = [Ixx Ixy; Ixy Iyy]^-1 [Ixt Iyt] +#@cli : $ image.jpg repeat 20 +shift. 1,0,0,0,2 done a z +lucas_kanade 2 n 0,255 frame 2 a x +#@cli : $ image.jpg repeat 20 +shift. 1,1,0,0,2 done a z +lucas_kanade 2 s z repeat $!/2 l[$>,{$>+$!/2}] quiver[0] [1] done done rm[{$!/2}--1] a z +lucas_kanade : skip ${1=2},${2=1} +e[^-1] "Motion estimation with Lucas et Kanade algorithm." +repeat $! l[$>] +blur_xy $2 structuretensors 0 blur_xy $1,$1,0 ++l s c rm[0,-1] *[1,2] *[0,2] rv - done ++l[0] s c rm[3,5] *[0,3] *[1,2] - done +l[0] s c rm[2,4,5] *[0,2] sqr[1] - done +/[1,2] [0] rm[0] a c +done done +#@cli unwarp2d : iteration,scales,smoothness,keep_field +#@cli : Unwarp a 2D+T volume +#@cli : $ image.jpg repeat 20 +shift. 1,0,0,0,2 done a z unwarp2d 10,20 +unwarp2d : skip ${1=5},${2=5},${3=1},${4=0} +e[^-1] "Unwarp a 2D+t volume with $1 iterations, $2 scales and smoothing $3." +repeat $! l[$>] +[0] 100%,100%,100%,2,0 +repeat $1 +k=$> +repeat $2 +if $>==($2-1) s=1 else s={($>+1)/$2} fi scale={$s*100}% ++e $k" "$>" "$s" "$scale" "{1/$s}" "{$3*$s} ++l[1] +norm +r $scale,$scale,100%,1 +lucas_kanade {max(.75,$3*$s)} +* {1/$s} cumulate z +done +r. ..,5 +[-1,-2] ++warp2d[0] [2] rm[1] rv[-1,-2] +done +done +if $4==0 rm[0,2] else rm[0,1] fi +done done +#@cli estimate_shift_core [image] +#@cli : Estimate a translation with a reference images with sub-pixel accuray +#@cli : image.jpg luminance +shift {u},{u},0,0,2 estimate_shift[1] [0] +estimate_shift_core : +e[^-1] "Translation estimation with Lucas et Kanade algorithm." +pass$1 0 repeat $!-1 l[$>,-1] +blur_xy 1 +g[0] xy,0 -[0,1] +sqr[1,2] +*[1,2] [0] *[1,2] rm[0] +Ixy={0,ia} Ixx={1,ia} Iyy={2,ia} Ixt={3,ia} Iyt={4,ia} +vx={-($Iyy*$Ixt-$Ixy*$Iyt)/max(1e-6,$Ixx*$Iyy-$Ixy*$Ixy)} +vy={-($Ixx*$Iyt-$Ixy*$Ixt)/max(1e-6,$Ixx*$Iyy-$Ixy*$Ixy)} +rm 1,2,1,1,$vx,$vy +done done +#@cli multi_resolution_pyramide : _number_of_scales +#@cli : Build a multi-resolution pyramid +multi_resolution_pyramide : +repeat $! l[$<] +repeat $1-1 +r. 50%,50%,50%,100%,2 done rv +done done +#@cli shift_subpixel : [image] +#@cli : Shift an image with subpixel translation +#@cli : $ image.jpg 1,2,1,1,5,10.1 +shift_subpixel[0] [1] +shift_subpixel : +pass$1 0 repeat $!-1 l[$>,-1] +{0,w},{0,h},1,2 f. 'if(c==0,{1,i(0)},{1,i(0,1)})' +warp[0] [2],1,2,1 rm[1,2] +done done +#@cli estimate_shift [image] +#@cli : Estimate a translations between image and ref image [image] +#@cli : using a multi-resolution scheme +#@cli : $ image.jpg luminance +shift 2,3 crop 5%,5%,95%,95% estimate_shift[1] [0],3 +estimate_shift : +e[^-1] "Estimate translation between images and image [$1]." +pass$1 0 repeat $!-1 l[$>,-1] +N={round(log2(min({0,w},{0,h}))-2,1,-1)} +multi_resolution_pyramide $N +1,2 +repeat 3 repeat $N ++*. {-2.0^(-($N-$>-1))} +shift_subpixel[{$N+$>}] . rm.. +estimate_shift_core. [$>] +*. {2.0^($N-$>-1)} ++[-1,-2] +done done +k. *. -1 +done done +#@cli unshift : iterations,number_of_scales +#@cli : Correct drift along Z in a 3D volume (video stabilization) +#@cli : $ image.jpg luminance repeat 10 +shift. {2*u},{2*u},0,0,2 done a z +unshift 1 a x +unshift : skip ${1=1} +e[^-1] "Unshift image stack." +repeat $! l[$>] +repeat $1 +s z repeat $!-1 l[$>,{$>+1}] ++estimate_shift[1] [0] *. -1 +shift_subpixel[1] . rm. +done done +a z +done +done done +#@cli register_lucas_kanade : _iterations, _scale +#@cli : Register images using lucas kanade motion estimation +register_lucas_kanade : skip ${1=10},${2=10} ++lucas_kanade $2 cumulate. z +warp2d +repeat $1 +lucas_kanade. $2 cumulate. z +[-1,-2] +warp2d +done +#@cli detect_events : _scale_xy,_scale_t,_threshold +#@cli : Detect space time events using space time interest points +#@cli : $ 100,100,100 noise 1 b 2 +detect_events , pointscoordinates. r[0] 100%,100%,100%,3,1 n[0] 0,255 circles[0] [1] k[0] +detect_events : skip ${1=1},${2=1},${3=9} +e[^-1] "Detect events with scale_xy $1 scale_z $2 and threshold $3." +repeat $! l[$>] +blur_xy $1 blur_z $2 structuretensors blur_xy $1 blur_z $2 +s z apply_parallel "eigen k[0] s c k[2]" a z +sqrt +thres={{0,ia}+$3*sqrt({0,iv})} ++max_patch[0] 8 threshold[0] $thres * +done done +#@cli detect_spots : _scale,_threshold +#@cli : Detect spots in the image +#@cli : $ 100,100 noise .2,2 b 1 n 0,255 noise 5 +detect_spots , pointscoordinates. r[0] 100%,100%,1,3,1 circles[0] [1] k[0] +detect_spots : skip ${1=1},${2=4} +e[^-1] "Detect events with scale $1 and threshold $2." +repeat $! l[$>] +b $1 +b $1 - thres={$2*${-mad[0]}} ++max_patch[0] 3 +threshold[0] $thres * +done done +#@cli measure_colocalization: +#@cli : Colocalization analysis +#@cli : Overlap RG/R RG/G RG/R+G MOC M1 and M2 +#@cli : $ 256,256,1,2 noise 3 b 5 measure_colocalization +measure_colocalization : +repeat $! l[$>] +if {0,s==2} +s c +gt 0 +sqr[0,1] +*[0] [1] +*[2] [3] +or[2] [3] +O1={{7,is}/{2,is}} +O2={{7,is}/{3,is}} +O={{7,is}/{8,is}} +*[2] [1] *[3] [0] +MOC={{6,is}/sqrt({4,is}*{5,is})} +M1={{3,is}/{0,is}} +M2={{2,is}/{1,is}} +rm 1,6,1,1,$O1,$O2,$O,$MOC,$M1,$M2 +else +e "Needs images with two channels" +1,6,1,1,0,0 +fi +done done +#@cli measure_colocalization_object: +#@cli : Compute the number of intersecting objects +#@cli : in each channels versus the number of objects +#@cli : $ 256,256,1,2 noise 3 b 5 gt 0 measure_object_colocalization +measure_object_colocalization : +repeat $! l[$>] +if {0,s==2} +gt 0 s c label_fg .1 +n1=0 repeat {0,iM} ++eq[0] {$>+1} *. [1] +if iM>0 n1={$n1+1} fi +rm. +done +n1={0,100*$n1/iM} +n2=0 repeat {1,iM} ++eq[1] {$>+1} *. [0] +if iM>0 n2={$n2+1} fi +rm. +done +n2={1,100*$n2/iM} +rm +1,2,1,1,$n1,$n2 +else +e "Needs images with two channels" +1,6,1,1,0,0 +fi +done done +#@cli local_moments : _scale +#@cli : Compute local second order moments tensor +#@cli : http://en.wikipedia.org/wiki/Image_moment +#@cli : $ image.jpg +local_moments 1 +local_moments : skip ${1=1} +repeat $! l[$>] +norm +if d==1 ++*[0] 'x' +*[0] 'y' +*[0] 'x*x' ++*[0] 'x*y' +*[0] 'y*y' b $1 ++sqr[1] /. [0] -[3,-1] /[3] [0] ++*[1,2] /. [0] -[4,-1] /[4] [0] ++sqr[2] /. [0] -[5,-1] /[5] [0] +k[3-5] a c +else ++*[0] 'x' +*[0] 'y' +*[0] 'z' +*[0] 'x*x' ++*[0] 'x*y' +*[0] 'x*z' +*[0] 'y*y' +*[0] 'y*z' ++*[0] 'z*z' b $1 ++sqr[1] /. [0] -[4,-1] /[4] [0] ++*[1,2] /. [0] -[5,-1] /[5] [0] ++*[1,3] /. [0] -[6,-1] /[6] [0] ++sqr[2] /. [0] -[7,-1] /[7] [0] ++*[2,3] /. [0] -[8,-1] /[8] [0] ++sqr[3] /. [0] -[9,-1] /[9] [0] +k[4-9] a c +fi +done done +#@cli smooth_moments : _scale,_iterations,_dt +#@cli : Anisotropic diffusion using local moment tensors +#@cli : $ image.jpg +noise 10 +smooth_moments. 1,10,1 print_psnr +smooth_moments : check "${1=1}>0&${2=100}>0&${3=1}>0" +repeat $! l[$>] ++local_moments. $1 smooth[0] [1],$2,$3,0 k[0] +done done +#@cli pointscoordinates +#@cli : Return the list of points in the image as 3xN or 2xN columns vector +#@cli : $ 100,100 noise .1,2 ==. 1 +pointscoordinates +pointscoordinates : +e[^-1] "Return the list of points in the image." +repeat $! l[$>] +if d>1 +if iM>0 pointcloud3d s3d k[2] s y,{h/3} a x else 0 fi +else +if iM>0 pointcloud3d s3d k[2] s y,{h/3} a x else 0 fi +rows 0,1 +fi +done done +#@cli circles : [x,y,radius,opacity,color,..] || [x,y,z,radius,opacity,color,..] +#@cli : Draw circles on an image +#@cli : $ 512,512,1,3 10,7 noise. 1 n. 0,512 circles[0] [1] k[0] +circles : skip ${2=3},${3=1} +e[^-1] "Draw circles on the image." +pass$1 0 repeat $!-1 l[$>,-1] +if {0,d>1} +if {1,h<4} r[1] 100%,{5+{0,s}},1,1,0 l[1] s y f[3] $2 f[4] $3 f[5--1] 255 a y done fi +repeat {1,w} +x={1,i($>,0)} y={1,i($>,1)} z={1,i($>,2)} r={1,i($>,3)} o={1,i($>,4)} i=$> +repeat {0,s} +if $z>=0&$z<{0,d}-1 +sh[0] $z,$z,$> ellipse. $x,$y,$r,$r,0,$o,0xFFFFFF,{1,i($i,5+$>)} +rm. +fi +done +done +else +if {1,h<3} r[1] 100%,{4+{0,s}},1,1,0 l[1] s y f[2] $2 f[3] $3 f[4--1] 255 a y done fi +repeat {1,w} +x={1,i($>,0)} y={1,i($>,1)} r={1,i($>,2)} o={1,i($>,3)} i=$> col={1,i($>,4)} +repeat {0,s} +sh[0] 0,0,$> ellipse. $x,$y,$r,$r,0,$o,0xFFFFFF,{1,i($i,{4+$>})} +rm. +done +done +fi +done done rm. +#@cli labels : [image] +#@cli : Draw labels on the image +#@cli : The labels are defined by image as +#@cli : in 2D [x,y,label,font_size,opacity,color] +#@cli : in 3D [x,y,z,label,font_size,opacity,color] +#@cli : $ 512,512,1,3 10,2 noise. 1 n. 0,512 labels[0] [1] +labels : +e[^-1] "Draw labels on the image." +pass$1 0 repeat $!-1 l[$>,-1] +if {0,d>1} +if {1,h<4} +r[1] 100%,{6+{0,s}},1,1,0 +l[1] s y f[3] 'x' f[4] 13 f[5] 1 f[6--1] 255 a y done +fi +repeat {1,w} +x={1,i($>,0)} y={1,i($>,1)} z={1,i($>,2)} r={1,i($>,3)} f={1,i($>,4)} o={1,i($>,5)} i=$> +repeat {0,s} +if $z>=0&$z<{0,d} +sh[0] $z,$z,$> t. $r,$x,$y,$f,$o,{1,i($i,6+$>)} +rm. +fi +done +done +else +if {1,h<3} +r[1] 100%,{5+{0,s}},1,1,0 l[1] s y f[2] 'x' f[3] 13 f[4] 1 f[5--1] 255 a y done +fi +repeat {1,w} +x={1,i($>,0)} y={1,i($>,1)} r={1,i($>,2)} f={1,i($>,3)} o={1,i($>,4)} i=$> +repeat {0,s} +sh[0] 0,0,$> t. $r,$x,$y,$f,$o,{1,i($i,5+$>)} +rm. +done +done +fi +rm. +done done +#@cli croparound : [x,y,dx,dy] || [x,y,z,dx,dy,dz] +#@cli : Draw circles on an image +#@cli : $ 512,512,1,3 10,7 noise. 1 n. 0,512 circles[0] [1] k[0] +croparound : skip ${2=3},${3=3},${4=3} +e[^-1] "Crop image at coordinates." +pass$1 0 repeat $!-1 l[$>,-1] +if {0,d>1} +if {1,h<6} +r[1] 100%,6,1,1,0 +l[1] s y f[3] $2 f[4] $3 f[5] $4 a y done +fi +repeat {1,w} +x={1,i($>,0)} y={1,i($>,1)} z={1,i($>,2)} dx={1,i($>,3)} dy={1,i($>,4)} dz={1,i($>,5)} i=$> ++crop[0] {$x-$dx},{$y-$dy},{$z-$dz},{$x+$dx},{$y+$dy},{$z+$dz} +done +else +if {1,h<4} r[1] 100%,4,1,1,0 l[1] s y f[2] $2 f[3] $3 a y done fi +repeat {1,w} +x={1,i($>,0)} y={1,i($>,1)} dx={1,i($>,2)} dy={1,i($>,3)} i=$> ++crop[0] {$x-$dx},{$y-$dy},{$x+$dx},{$y+$dy} +done +fi +done done rm[0,1] +#@cli random_walks : width,height,length,number,speed +#@cli : Generate random walks tracks (list of coordinates x,y,t as a Nx3 image.) +#@cli : $ 100,100,20 random_walks 100,100,20,5,1 circles[0] [1] k[0] blur_xy 1 s z max +#@cli : $ 100,100,20 random_walks 100,100,20,10,1 circles[0] [1] k[0] b 1 n 0,255 display_volume 8,10,1 r3d 0,0,1,25 r3d 1,0,0,-120 snapshot3d 600,1,0,0,0 autocrop +random_walks : +number=$4 width=$1 height=$2 length=$3 speed=$5 +$number,3 +l. +noise 1,1 +sh 0,0,0,0 n. 1,{$width-1} rm. +sh 1,1,0,0 n. 1,{$height-1} rm. +sh 2,2,0,0 f. 0 rm. +repeat $length-1 +l. +noise 1 +sh 0,0,0,0 c. 1,{$width-2} rm. +sh 1,1,0,0 c. 1,{$height-2} rm. +sh 2,2,0,0 f. '$>+1' rm. +done done a x +done +#@cli fibers: number,length,curvature +#@cli : Draw a serie of fibers in 2D or 3D +#@cli : $ 600,400 fibers 10,200,10 +fibers : +repeat $! l[$>] +$2,$1,1,{if(d>1,3,2)} +l. noise. 10 blur_x. $3 +norm / done +if {0,d>1} s. c *[3] {0,2*d/(w+h)} a[1--1] c fi +cumulate. x s. y +repeat $!-1 +l[0,{$>+1}] +s c ++[1] {0,w/2} ++[2] {0,h/2} +if $!>3 +[3] {0,d/2} fi +a[1--1] y +circles[0] [1],0,-1 +done +done +k[0] +done done +#@cli :: Filtering and deconvolution +#@cli movavg : _size>=1 +#@cli : moving average of image list with a box filter of size _size +#@cli : $ 11 f 'x>w/2' +l. s x movavg 9 a x done +b[0] 1.2 a c display_graph +movavg : check "$1>=1" +e[^-1] "Moving average with size $1." +n={$1-1} +repeat $n +repeat $!-1 ++[{$>},{$>+1}] *. .5 rm[$>] mv. $> done +rv +done +if $n%2!=0 rv fi +#@cli zmean +#@cli : average along z-axis +zmean : +repeat $! l[$>] +n={0,d} s z + / $n +done done +#@cli zstd +#@cli : standard deviation along z-axis +zstd : +repeat $! l[$>] ++zmean sqr. +l[0] sqr zmean done +-- sqrt +done done +#@cli zmax +#@cli : maximum along z-axis +zmax : +repeat $! l[$>] s z max done done +#@cli zmin +#@cli : maximum along z-axis +zmin : +repeat $! l[$>] s z min done done +#@cli kymoline +#@cli : interactively select a line and extract a line profile +kymoline : ++select 1 +x1={i(0,0)} y1={i(0,1)} x2={i(0,3)} y2={i(0,4)} +d={sqrt(($x2-$x1)^2+($y2-$y1)^2)} +u={($x2-$x1)/$d} v={($y2-$y1)/$d} +rm. +f 'if(x<=$d&&y==0,i($x1+x*$u,$y1+x*$v,z,c,1),5)' +crop 0,0,{int($d-1)},0 +#@cli fftshift +#@cli : Shift a image so that the fft has it center in the middle +#@cli : $ image.jpg fftshift +fftshift : +repeat $! l[$>] +shift {-int(w/2)},{-int(h/2)},{-int(d/2)},0,2 +done done +#@cli whiten_frequency : _alpha +#@cli : Whitening filter (equalize the frequency of the image; nothing todo with color) +#@cli : $ image.jpg whiten_frequency +whiten_frequency : check "${1=.25}>=0" +e[^-1] "Whiten the frequency with parameter $1." +repeat $! l[$>] +fft +a c norm. pow. $1 max. 1e-12 /. {ia} /[0-1] [2] rm[2] ifft k[0] +done done +#@cli deblur_upscale_goldmeinel : sigma>=0, _nb_iter>=0, _acceleration>=0, _kernel_type={ 0=quasi-gaussian (faster) | 1=gaussian },zoom=2 +#@cli : Deblur and zoom x2 selected images using Gold-Meinel algorithm +#@cli : Default values: 'nb_iter=8', 'acceleration=1' and 'kernel_type=1'. +deblur_upscale_goldmeinel : check "$1>=0 && ${2=8}>=0 && ${3=1}>=0" skip ${4=1} skip ${5=1} skip ${6=2} skip ${7=0} +e[^-1] "Deblur image$? using Gold-Meinel algorithm, with sigma $1, $2 iterations, acceleration $3 and "${arg\ 1+!$4,"",quasi-}"gaussian kernel, zoom $5 and regularization $6." +repeat $! l[$>] +ux={if(w>1,round($5*w),1)} uy={if(h>1,round($5*h),1)} uz={if(d>1,round($5*d),1)} ++r. $ux,$uy,$uz,100%,6 max 0 +repeat $2 ++b. {$1*$5},1,{$4!=0} r. [0] +/[0,-1] rm.. -^. $3 r. $ux,$uy,$uz,100%,6 *[-1,-2] max 0 +done rm[0] +done done +#@cli deblur_upscale_richardsonlucy : sigma>=0, nb_iter>=0, _kernel_type={ 0=quasi-gaussian (faster) | 1=gaussian }, zoom=2 +#@cli : Deblur and zoom selected images using Richardson-Lucy algorithm. +#@cli : Default values: 'nb_iter=50' and 'kernel_type=1'. +deblur_upscale_richardsonlucy : check "$1>=0 && ${2=50}>=0" skip ${3=1} skip ${4=1} +e[^-1] "Deblur image$? using Richardson-Lucy algorithm, with sigma $1, $2 iterations and "${arg\ 1+!$3,"",quasi-}"gaussian kernel, zoom=$4." +repeat $! l[$>] +ux={if(w>1,round($4*w),1)} uy={if(h>1,round($4*h),1)} uz={if(d>1,round($4*d),1)} ++r $ux,$uy,$uz,100%,6 +repeat $2 ++b. {$1*$5},1,{$3!=0} r. [0] +/[0,-1] rm.. r. $ux,$uy,$uz,100%,6 b. $1,1,{$3!=0} *[-1,-2] max 0 +done rm[0] +done done +#@cli correlate_fft +#@cli : Convolve selected images with image [$1] +#@cli : $ image.jpg 100%,100% gaussian. 20,1,45 +correlate_fft[0] [1] +correlate_fft : +e[^-1] "Correlate image with image [$1]." +pass$1 0 repeat $!-1 l[$>,-1] +w2={int({0,w}/2)} h2={int({0,h}/2)} d2={int({0,d}/2)} +r[1] [0],[0],[0],1,0,0,0.5,0.5,0.5,0.5 shift[1] -$w2,-$h2,-$d2,0,2 +fft[0] fft[2] *[3] -1 ++*[-4] . +*[-4] ... +[-2,-1] +*[-5,-3] *[-3,-2] -[-3,-2] +ifft rm. +done done +#@cli deconvolve_richardsonlucy : filter,nb_iter>=1, acceletation>=0 +#@cli : Deconvolve images using the first one as a blur operator (PSF) +#@cli : $ image.jpg 16,16 gaussian. 2,1,45 +convolve_fft[0] [1] deconvolve_richardsonlucy. [1],100 +deconvolve_richardsonlucy : check ${is_image_arg\ $1}" && ${2=5}>=1" +e[^-1] "Deblur image using Richardson-Lucy algorithm with filter [$1]." +pass$1 0 +repeat $!-1 l[$>,-1] +r[1] {0,w},{0,h},{0,d},100%,0,0,.5,.5,.5 normalize_sum[1] [0] +repeat $2 ++convolve_fft. [1] max. 1e-6 +/[0] . rm.. +correlate_fft. [1] *[-1,-2] +done rm[0,1] +done done +#@cli deconvolve_goldmeinel : filter,nb_iter>=1,acceleration>=0 +#@cli : Deblur and zoom selected images using Gold-Meinel algorithm +#@cli : Default values: 'nb_iter=8', 'acceleration=1' and 'kernel_type=1'. +#@cli : $ image.jpg 100%,100% gaussian. 5,1,45 +convolve_fft[0] [1] +deconvolve_goldmeinel. [2],5 +deconvolve_goldmeinel : check ${is_image_arg\ $1}" && ${2=5}>=1 && ${3=1}>=1" +e[^-1] "Deblur image using Gold-Meinel algorithm with filter $1, $2 iterationsand acceleration $3." +pass$1 0 +repeat $!-1 l[$>,-1] +r[1] {0,w},{0,h},{0,d},100%,0,0,.5,.5,.5 normalize_sum[1] ++b[0] 0.75 +repeat $2 ++convolve_fft. [1] max. 1e-6 +/[0] . rm.. +-^. $3 *[-1,-2] +done rm[0,1] +done done +#@cli deconvolve_richardsonlucy_blind : nb_iter>=1,acceleration>=0 +#@cli : Deblur and zoom selected images using Gold-Meinel algorithm +#@cli : Default values: 'nb_iter=8', 'acceleration=1' and 'kernel_type=1'. +deconvolve_richardsonlucy_blind : check "${1=5}>=1" +e[^-1] "Deblur image using richardsonlucy algorithm with $1 iterations." +repeat $! l[$>] +- {im-1} +avg={0,ia} ++b 0.75 ++l.. autocorrelate threshold 10%,1 normalize_sum done +repeat $1 ++convolve_fft[1] [2] max. 1e-6 +/[0] . rm.. +correlate_fft. [2] +*[1,3] +*[1] {1,$avg/ia} +l[1] +iee *. 0.01 + done ++convolve_fft[2] [1] max. 1e-6 +/[0] . rm.. +correlate_fft. [1] +*[2,3] +normalize_sum[2] ++l +powerspectrum n 0,255 append_tiles , t $> w rm done +done rm[0] +done done +#@cli blend_sharpness +#@cli : Blend images in the list according to their sharpness +blend_sharpness : +e[^-1] "Blend images according to their sharpness (gradient norm)." +N=$! +gradient_norm +++[$N--1] max[$N--1] .01 /[$N--2] . rm. a[$N--1] z d. s. z +a[0-{$N-1}] x a[1--1] x * s x,$N + +#@cli reconstruct_laplacian : param +#@cli : Reconstruct an image from its laplacian +#@cli : $ image.jpg +laplacian reconstruct_laplacian. , +reconstruct_laplacian : skip ${1=0} +e[^-1] "Reconstruct an image from its laplacian." +repeat $! l[$>] +s c repeat $! l[$>] +fft a={0,i(0,0)} b={1,i(0,0)} +100%,100%,1,1,'-(4-2*cos(2*x*pi/w)-2*cos(2*y*pi/h))' +=. 1 +. $1 +/[0,1] . k[0,1] =[0] $a =[1] $b ifft k[0] +done done a c +done done +#@cli local_variance : _radius,_robust +#@cli : Local variance filter +#@cli : $ image.jpg +local_variance +local_variance : skip ${1=2},${2=0} +e[^-1] "Estimate local variance with scale "$1" and robustness $2." +repeat $! l[$>] +if $2==0 ++b $1,1,1 - sqr b $1,1,1 +else ++median {2*$1+1} - abs median {2*$1+1} * 1.4826 sqr +fi +done done +#@cli local_noise_variance : _radius,_robust +#@cli : Local noise variance filter +#@cli : $ image.jpg +local_variance +local_noise_variance : skip ${1=2},${2=0} +e[^-1] "Estimate local variance with scale $1 and robustness $2." +repeat $! l[$>] +laplacian if d==1 * {1/sqrt(20)} else * {1/sqrt(42)} fi local_variance $1,$2 +done done +#@cli normalize_local_variance : _amplitude,_radius,_threshold,_repeat +#@cli : Local variance normalization +#@cli : $ image.jpg +normalize_local_variance +normalize_local_variance : skip ${1=50},${2=2},${3=25},${4=1} +e[^-1] "Normalize local variance with amplitude $1, scale $2, threshold $3 (x$4 times)." +repeat $! l[$>] +repeat $4 ++local_variance $2 sqrt. max. $3 ++b[0] $2,1,1 +-[0,-1] /. [1] *. $1 +[-2,-1] k. +done +done done +#@cli local_wiener : _radius +#@cli : Local Wiener filtering +#@cli : http://en.wikipedia.org/wiki/Wiener_filter +#@cli : $ image.jpg +noise 10 +local_wiener. 1 print_psnr +local_wiener : skip ${1=2} +e[^-1] "Local Wiener filtering." +repeat $! l[$>] +sigma=${-noise_std} ++b $1 ++local_variance[0] $1 +-. {$sigma*$sigma} rv[-1,-2] /[-1,-2] ++-[0,1] +*[-1,-2] +[-1,-2] k. +done done +#@cli periodize +#@cli : Periodization of the image +#@cli : $ image.jpg periodize +periodize : +e[^-1] "Periodize." +repeat $! l[$>] +if w>1 +mirror x a x fi +if h>1 +mirror y a y fi +if d>1 +mirror z a z fi +done done +#@cli tape +#@cli : Apply a Hann window (e.g. to compute a power spectrum) +#@cli : $ image.jpg tape +tape : +e[^-1] "Apply a Hann tapering window." +repeat $! l[$>] +if w>1 f 'i*sin(pi*x/(w-1))^2' fi +if h>1 f 'i*sin(pi*y/(h-1))^2' fi +if d>1 f 'i*sin(pi*z/(d-1))^2' fi +done done +#@cli powerspectrum : +#@cli : Compute power spectrum +#@cli : $ image.jpg powerspectrum +powerspectrum : +e[^-1] "Compute power spectrum." +repeat $! l[$>] display_fft k[0] done done +#@cli fouriermix : [image],_cut_of_frequency +#@cli : Mix two images using their respectives low and high frequencies +fouriermix : skip ${2=10%} +e[^-1] "Fourier mix images." +pass$1 0 repeat $!-1 l[$>,-1] +fft[0] fft[2] fftshift +100%,100% circle. 50%,50%,$2,1,1 b. 1,1,1 n. 0,1 d +*[0,1] . negate. *[2,3] . rm. +[0,2] +[1,2] fftshift +ifft +done done rm. +#@cli blend_fft : [image] +#@cli : blend images using strongest frequencies +blend_fft : skip ${2=2} +pass$1 0 ++l. +tape powerspectrum b 1 +b 2 - +max '{ia+$2*sqrt(iv)}' circle 50%,50%,20,1,@{0,im} n 0,1 d +fftshift +done fft.. *[-2,-3] . negate. +repeat $!-3 l[$>,-1,-2,-3] +fft[0] *[0,1] . +[0] [2] +[1] [3] ifft[0,1] rm[1] +done done rm[-1,-2,-3] +#@cli denoise_fft : _threshold +#@cli : Illustrate the thresholding of Fourier coefficients +#@cli : $ 256,256 f '128+128*sin(x+y)' +noise 50 +denoise_fft. 70% +denoise_fft : skip ${1=1} +e[^-1] "Threshold Fourier coefficients with threshold $1." +repeat $! l[$>] ++l. tape powerspectrum threshold $1 fftshift done +fft[0] *[0] . *[1] . rm. ifft k[0] +n 0,255 +done done +#@cli unstrip : _smoothness,_scale,_threshold +#@cli : Remove stripes in an image +#@cli : $ image.jpg f '.5*i*(1+.25*sin(x))' +unstrip +unstrip : skip ${1=25},${2=20},${3=4} +e[^-1] "Remove stripes." +repeat $! l[$>] ++l. +tape powerspectrum norm detect_spots 1,$3 dilate_circ $2 gt 0 +n 0,1 negate circle 50%,50%,$2,1,1 +if im<.9 +active=1 b $1 n 0,1 fftshift if iM==0 f 1 fi +else +active=0 +fi +done +if $active==1 +fft[0] *[0] . *[1] . rm. ifft +fi +k[0] +done done +#@cli autocorrelate +#@cli : Autocorrelation using fourier transform +#@cli : $ image.jpg autocorrelate +autocorrelate : +e[^-1] "Compute autocorrelation." +repeat $! l[$>] fft sqr + sqrt ifft k[0] fftshift done done +#@cli spotify : _scale>0,_nb_iter>0, +#@cli : Make everything look like a spot +#@cli : Default values '_nb_iter=1, _scale=1' +#@cli : $ image.jpg +spotify 1,10 +#@cli : $ image.jpg +spotify 1,20 norm. gt. 5% b 1 * +spotify : check "${1=1}>0 && ${2=1}>0" +e[^-1] "Spotify with scale $1 with $2 iterations." +repeat $! l[$>] +if {0,im!=iM} +s={0,ia} +repeat $2 +b $1 +b {2*$1} - max 0 * '{0,$s/ia}' +done +fi +done done +#@cli mapblur : _levels +#@cli : Blur the image with a map +#@cli : $ image.jpg +f '10*x/w' mapblur +mapblur : check "${1=10}>0" +e[^-1] "Blur images using a blur map (works using pairs of images)." +repeat $!/2 l[{2*$>},{2*$>+1}] +smin={1,im} smax={1,iM} +l[0] repeat $1 +b[0] {$smin+$>*($smax-$smin)/($1)} done rm[0] a z done +l[1] tones $1 gt 0 b 1 a z done +* s z + +done done +#@cli vesselness : _scale>0,coefA,coefB,coefC +#@cli : Frangi's vesselness filter based on the eigen value of the Hessian +#@cli : Reference: +#@cli : A. F. Frangi, W. J. Niessen, K. . L. Vincken, M. A. Viergever, +#@cli : "Multiscale vessel enhancement filtering" +#@cli : Medical Image Computing and Computer Assisted Intervention MICCAI'98, +#@cli : vol. 1496, pp. 130 137, 1998. +vesselness : skip ${1=1},${2=1},${3=1},${4=1} +e[^-1] "Tubeness with scale $1." +repeat $! l[$>] +b $1 +s c repeat $! l[$>] +hessian a c eigen k[0] +sign abs.. sort.. +,c * +norm a c +if d>1 +f 'if(i(x,y,z,1)<0&&i(x,y,z,2)<0,exp(-0.5/$2^2*(i(x,y,z,1)/i(x,y,z,2))^2)*exp(-0.5/$3^2*(i(x,y,z,0)^2/abs(i(x,y,z,1)*i(x,y,z,2))))*(1-exp(-0.5/$4^2*i(x,y,z,3)^2)),0)' +else +f 'if(i(x,y,z,1)<0,exp(-0.5/($2)^2*(i(x,y,z,0)/i(x,y,z,1))^2)*(1-exp(-0.5/($3)^2*i(x,y,z,2)^2)),0)' +fi +done done a c +done done +#@cli _hessian_eigen_min : scale +#@cli : Compute the min eigen value of the Hessian matrix +_hessian_eigen_min : skip ${1==1} +e[^-1] "Compute Hessian min eigen value." +repeat $! l[$>] b $1 s c repeat $! l[$>] +hessian a c eigen k[0] channels {s-1} +done done a c done done +#@cli hessian_sharpen : nscales,strength +#@cli : Sharpen the image +hessian_sharpen : +e[^-1] "Sharpen the image using its Hessian with $1 scales and strength $2." +repeat $! l[$>] +repeat $1 +_hessian_eigen_min[0] {2^$>} * {2^$>/($1-1)} done +[1--1] *. {-$2} + +done done +#@cli smurf : zoom,iter,scale,strength +#@cli : enhance linear structures +#@cli : $ 1024,1024 fibers 20,2000,50 gt 0 dilate_circ 3 +dilate_circ 3 - n 0,255 negate +b 3 r. 50%,50% +smurf. 2,8,0.25,5 r[0,1] [2] +#@cli : sp duck +smurf. 1,1,1,10 c 0,255 +smurf : +e[^-1] "Smurf." +repeat $! l[$>] factor={exp(log($1)/($2*$3))} sigma=$3 avg={ia} +repeat $2*$3 ++l _hessian_eigen_min $sigma +_hessian_eigen_min {3*$sigma} - +threshold {0.1*sqrt(iv)},1 * {-$4} done + +r. {round(w*$factor)},{round(h*$factor)},100%,100%,6 max 0 * {$avg/ia} +sigma={$sigma*$factor} +done +done done +#@cli bgsubstract : _length>0 +#@cli : Substract the background using a temporal top-hat filter +#@cli : $ 100,100,100 noise 1 b 1 +bgsubstract 10 +bgsubstract : check "${1=5}>0" +e[^-1] "Temporal background substraction with length $1." +repeat $! l[$>] +1,1,$1 f. 1 +erode[0] [1] -[0] . rm[1,-1] +done done +#@cli schizo : _amplitude,_amplitude_normal,_nb_iterations,_strength +#@cli : Schizo filter gives either a furry image or a smoothed image +#@cli : Default values '_amplitude=100,amplitude_normal=-50 _nb_iter=5,_strength=.75' +#@cli : $ image.jpg +schizo 100,-50 +schizo[0] -50,100 max 0 +schizo : skip ${1=100},${2=-50},${3=5},${4=.75} +e[^-1] "Schizo filter smoothing with // $1 and T $2 and $3 iterations." +repeat $! l[$>] +[0] +repeat $3 +l. ++iee *. {$1/(0.0001+max(abs(im),abs(iM)))} ++inn[0] *. {$2/(0.0001+max(abs(im),abs(iM)))} ++ +done +*. $4 +*[0] {1-$4} +[-1,-2] +done rm[0] +done done +#@cli scandoc : _smooth,_background,_black,_white +#@cli : improve scanned document +#@cli : $ image.jpg scandoc +scandoc : skip ${1=3},${2=100},${3=10%},${4=90%} +repeat $! l[$>] split_opacity l[0] +median $1 +b $2 - min 0 +s c n 0,1 a c c $3,$4 n 0,255 +done a c done done +#@cli warp_affine [3x3 affine matrix] +#@cli : Warp the image [0] using an 2D affine field defined by a 3x3 matrix +#@cli : $ image.jpg 3,1,1,1,1 diagonal. noise. .1 +warp_affine[0] [1] +warp_affine : +e[^-1] "Warp image using affine transform defined by 3x3 image [$1]." +pass$1 0 repeat $!-1 l[$>,-1] +params=({1,i(0,0)},{1,i(1,0)},{1,i(2,0)};{1,i(0,1)},{1,i(1,1)},{1,i(2,1)};{1,i(0,2)},{1,i(1,2)},{1,i(2,2)}) +{0,w},{0,h},1,1,1 +f. x +f. y a[-3--1] c +mix_channels. $params +channels. 1,2 +warp[0] .,0,2,0 rm. +done done rm. +#@cli solve_least_square: X +#@cli : Solves $|Ax-b|^2$ +#@cli : $ (1,1,1,1;1,2,1,2;1,1,2,2) (-1,1,0;-2,0,1) m*[1] [0] solve_least_square[0] [1] +solve_least_square : +e[^-1] "Solves least square." +pass$1 0 repeat $!-1 l[$>,-1] ++transpose +m*[0,2] +m*[0,3] +k[-1,-2] invert[0] m* transpose +done done +#@cli calibrate_affine_transform : image +calibrate_affine_transform : +e[] "Interactive affine transformation calibration between image and image $1" +e[] "- Use mouse button 1 to select matching points on the two images." +e[] "- Use mouse button 2 to remove points in the list" +e[] "- Press Space to re-init the list of points" +e[] "- Close the window to finish\n" +pass$1 0 repeat $!-1 l[$>,-1] rv +0 0 (1,0,0;0,1,0;0,0,1) Z=0 +do +x1={*1,x} y1={*1,y} +x2={*2,x} y2={*2,y} +if $x1>=0 +if {*1,b}&1 +(1;{$x1/{*1,w}*{0,w}};{$y1/{*1,h}*{0,h}}) +if {2,h>1} a[2,-1] x else rm[2] mv. 2 fi +else +if {*1,b}&2 +if {2,w>1} columns[2] 0,{2,w-2} else rm[2] 0 mv. 2 fi +fi +fi +fi +if $x2>=0 +if {*2,b}&1 +(1;{$x2/{*2,w}*{1,w}};{$y2/{*2,h}*{1,h}}) +if {3,h>1} a[3,-1] x else rm[3] mv. 3 fi +else +if {*2,b}&2 +if {3,w>1} columns[3] 0,{3,w-2} else rm[3] 0 mv. 3 fi +fi +fi +fi +if {*0,SPACE}" || "{*1,SPACE}" || "{*2,SPACE} rm[2,3,4] 0 0 (1,0,0;0,1,0;0,0,1) fi +if {*1,o} Z={max(0,min({0,d}-1,$Z+{*1,o}))} wait -1 fi +if {*2,o} Z={max(0,min({0,d}-1,$Z+{*2,o}))} wait -1 fi +if {*3,o} Z={max(0,min({0,d}-1,$Z+{*3,o}))} wait -1 fi +N={min({2,w},{3,w})} +if {2,h}>1" && "{3,h}>1 +if $N<=3 +rm[4] +l[2,3] +rows 1,2 columns 0,{$N-1} - s x + / $N +(1,0,0;{-i(0,0)},1,0;{-i(0,1)},0,1) rm.. +done +else +rm[4] +l[2,3] columns 0,{$N-1} solve_least_square[0] [1] rm[1] done +fi +fi ++l[0,2] +if {0,d>1} slices[0] $Z fi +r[0] 200%,200%,1,1,5 +r[0] 100%,100%,1,3,0 grid[0] 10%,10%,0,0,.3,0xCCCCCCCC,255,128,32 +if {1,h>1} rows[1] 1,2 *[1] 2 +1,5,1,1,2,1,255,0,0 r. {0,w},100%,1,1,1 circles[0] [1] +labels[0] [1] +fi +w1[0] -1,-1,-1,-1,"First image (n="{1,w}")" rm +done ++l[1,3] +if {0,d>1} slices[0] $Z fi +r[0] 200%,200%,1,1,5 +r[0] 100%,100%,1,3,0 shift[0] 0,0,0,1 grid[0] 10%,10%,0,0,.3,0xCCCCCCCC,255,128,32 +if {1,h>1} rows[1] 1,2 *[1] 2 +1,5,1,1,2,1,255,0,0 r. {0,w},100%,1,1,1 circles[0] [1] +labels[0] [1] +fi +w2[0] -1,-1,-1,-1,"Second image (n="{1,w}")" rm +done ++l[0,1,4] +if {0,d>1} slices[0,1] $Z fi +warp_affine[1] [2] rm[2] a c +r[0] 200%,200%,1,100%,5 +grid[0] 10%,10%,0,0,.3,0xCCCCCCCC,255,128,32 +w3 -1,-1,-1,-1,"merge "$N" Z="$Z rm +done +wait +while {*1}" && "!{*1,Q}" && "!{*1,ESC}" && "{*2} +w1[] 0 w2[] 0 w3[] 0 +k. +done done +#@cli vobs : _scale +#@cli : Motion quantity (Normal motion) h * (|Ixy|^2 |It|/|Ixy|) / h * Ixy^2 +#@cli : Irani, Michal and Rousso, Benny and Peleg, Shmuel, Detecting and tracking multiple moving objects using temporal integration, ECCV'92. +#@cli : $ 100,100,10 noise 1 b 1 +vobs +vobs : check "${1=1}>0 && ${2=3}>0" +e[^-1] "Motion quantity with scale $1." +repeat $! l[$>] +g a[0,1] c norm[0] abs[1] *[1] [0] sqr[0] b $1,1,1 rv max[1] 5% / +done done +#@cli display_vobs +#@cli : Display local diffusion coefficient +#@cli : $ 200,100 noise .7,2 ==. 1 b 2,1,1 repeat 20 +l. +laplacian *. .05 + done done a z display_vobs +display_vobs : ++vobs 1 A={round(im,0.001)} B={round(iM,0.001)} *. '{128/max(im,iM)}' +. 128 map. 5 +r[0] 100%,100%,100%,3,1 apply_gamma[0] 1.5 n[0] 0,255 +l[0] s z frame 5,12,64 shift 0,5,0,0,2 t "Original sequence",5,0,13,1,255 a z done +l[1] s z repeat $! l[$>] 1,100% f. 'h-y' n 0,255 map. 5 r. 5,{0,h},1,3,5 frame. 3,0,64 r. 100%,{0,h},1,3,5 a x +frame 5,12,64 shift 0,5,0,0,2 +t "Vobs ["$A":"$B"]",5,0,13,1,255 done done a z done +a x +#@cli display_pseudocolor : predefined_palette +#@cli : Display an indexed image in pseudocolors using a palette +#@cli : $ image.jpg luminance display_pseudocolor +display_pseudocolor : skip ${1=5} +e[^-1] "Display an indexed image in pseudocolors using map $1." +repeat $! l[$>] +A={round(im,0.0001)} B={round(iM,0.0001)} +n. 0,255 map. $1 +rectangle {w-50-5},{h/4-5},{w-5},{h-h/4+5},.5,0,0,0 +add_colorbar. {w-50},{h/4},{w-40},{h-h/4},$A,$B,6,255 +done done +#@cli display_colordepth : _dz +display_colordepth : +e[^-1] "Display the 3D image with a depth color coded." +repeat $! l[$>] +H={d*$1} colordepth , a z min {ia+10*sqrt(iv)} n 0,255 s z +rectangle {w-50-5},{h/4-5},{w-5},{h-h/4+5},.5,0,0,0 +add_colorbar. {w-50},{h/4},{w-40},{h-h/4},0,$H,6,255 +done done +#@cli map_hilo +#@cli : Map a grascale image to a RGB with maw in red and min in blue +#@cli : This help to check if images are saturated +map_hilo : +repeat $! l[$>] +round m={0,im} - $m +1,1,1,3,0,0,{0,iM} {0,iM-1},1,1,3,'x+1' 1,1,1,3,{0,iM},0,0 a[1,2,3] x +map[0] [1] ++ $m rm[1] +done done +#@cli add_colorbar : x0,y0,x1,y1,_min,_max,_ntics,color,colormap +#@cli : Add a colorbar +#@cli : $ image.jpg luminance map 5 add_colorbar {w-40},20,{w-30},{h-20},0,255,6,255,5 +add_colorbar : skip ${5=0},${6=255},${7=6},${8=255},${9=""},${10=5} +e[^-1] "Add a colorbar." +repeat $! l[$>] +{$3-$1},{$4-$2} l. f 'h-y' n 0,255 map $10 done +frame[1] 1,1,$8 j[0] [1],$1,$2,0,0,1 k[0] +repeat $7 +val={round($5+$>/($7-1)*($6-$5),.001)} +t "- "$val" "$9,{$3+1},{$4-$>*($4-$2-5)/($7-1)-10},13,1,$8 +done +done done +#@cli local_diffusion_coefficient : _scale,_threshold +#@cli : Estimate local diffusion coefficient It - D (Ixx+Iyy)=0 using D=It/(Ixx+Iyy) +#@cli : $ 100,100 noise .7,2 ==. 1 b 2,1,1 repeat 20 +l. +laplacian *. .05 + done done a z local_diffusion_coefficient 2,.5 +local_diffusion_coefficient : check "${1=2}>0 && ${2=.5}>=0" +e[^-1] "Local diffusion coefficient estimation using scale $1 and threshold $2." +repeat $! l[$>] ++l[0] s z laplacian a z done ++l[0] s z gradient_norm a z sqr done +g[0] z,1 +l[0,1] +R={1,ia+$2*sqrt(iv)} +a c f 'b=i(x,y,z,0);a=i(x,y,z,1);if(abs(a)>abs(b),b/a,if(abs(b)>$R,1/(b/a),0))' +channels 0 +done +*[0] [1] b $1,1,1 max[1] {1,ia+$2*sqrt(iv)} / +channels 0 +done done +ldc : +local_diffusion_coefficient $* +ldc_residuals : ++l[0] s z laplacian a z done +g[0] z,1 +*[1,2] +-- abs b 1 +#@cli display_ldc : +#@cli : Display local diffusion coefficient +#@cli : $ 200,100 noise .7,2 ==. 1 b 2,1,1 repeat 20 +l. +laplacian *. .05 + done done a z display_ldc +display_ldc : ++ldc 2,3 A={round(im,0.001)} B={round(iM,0.001)} *. '{128/max(im,iM)}' +. 128 map. 5 +r[0] 100%,100%,100%,3,1 apply_gamma[0] 1.5 n[0] 0,255 +l[0] s z frame 5,12,64 shift 0,5,0,0,2 t "Original sequence",5,0,13,1,255 a z done +l[1] s z repeat $! l[$>] 1,100% f. 'h-y' n 0,255 map. 5 r. 5,{0,h},1,3,5 frame. 3,0,64 +r. 100%,{0,h},1,3,5 a x +frame 5,12,64 shift 0,5,0,0,2 +t "Local diffusion coefficient ["$A":"$B"]",5,0,13,1,255 done done a z done +a x +#@cli print_psnr : _max_value +#@cli : Display the psnr on the image list taking the first one as a reference +#@cli : $ image.jpg +noise 20 +b. 1 print_psnr +print_psnr : skip ${1=255} +e[^-1] "Compute PSNR with image 0 and print it on the other images." ++psnr $1 +repeat $!-2 to[{$>+1}] "PSNR:"{round(i(0,$>+1),.01)}"dB",5,5,30,1 done +rm. +#@cli noise_std +#@cli : Estimate the noise variance +#@cli : $ image.jpg noise 10 sigma={round(${-noise_std},.1)} to "Noise std:"$sigma,5,5,30,1 +noise_std : +e[^-1] "Compute noise std." ++laplacian if {0,d==1} u {${-mad.}/sqrt(20.0)} else u {${-mad.}/sqrt(42.0)} fi rm. +#@cli pca +#@cli : Principal component analysis +#@cli : $ image.jpg +l split_tiles 64,64 y y a x pca k. s x r 8,8,1,1,-1 n 0,255 frame 1,1,255 append_tiles , r. 400%,400% frame 0,20 title dictionary done +pca : +e[^-1] "Principal component analysis." +repeat $! l[$>] +n={w} - {ia} +transpose. m*[-2,-1] / $n eigen +done done +spca : skip ${2=20} +repeat $! l[$>] +repeat $2 +p={sqrt(h)} ++l +pca k[0,-1] rv transpose[0] +m* threshold. $1,1 rm[1] transpose[0] m* done +*[0] .25 *[1] .75 + +done +pca +done done +#@cli denoise_karmuen_loeve : _number_of_components +#@cli : Denoise with a bloc Karumen-Loeve transform +#@cli : http://en.wikipedia.org/wiki/Karhunen%E2%80%93Lo%C3%A8ve_theorem +denoise_karmuen_loeve : +repeat $! l[$>] +split_tiles 64,64 oW={0,w} oH={0,h} oS={0,s} +y y a x +pca k[0,-1] rv crop[0] 0,$1 +transpose[0] +m* rm[1] transpose[0] m* s x +r $oW,$oH,1,$oS,-1 append_tiles , +done done +#@cli denoise_patch_dict : _patch_size,_nb_of_shifts,_thres_comp,_thres_coef +#@cli : Denoising using a dictionnary of patches learned on the image +#@cli : $ image.jpg +noise 10 +denoise_patch_dict[1] , print_psnr +denoise_patch_dict : skip ${1=8},${2=8},${3=1.1},${4=1.1} +e[^-1] "Denoising using a dictionnary of "$1"x"$1" patches with "$2" shifts, threshold $3x(noise std) for components and $4x(std) for coefficients." +repeat $! l[$>] +Sigma=${-noise_std[0]} ++crop 0,0,$1,100% mirror. x rv +crop. {w-$1-1},0,100%,100% mirror. x a x ++crop 0,0,100%,$1 mirror. y rv +crop. 0,{h-$1-1},100%,100% mirror. y a y +oW={0,w} oH={0,h} oS={0,s} nW={$1*round($oW/$1,1,1)} nH={$1*round($oH/$1,1,1)} ++crop {2*$oW-$nW},0,100%,100% mirror. x a x ++crop 0,{2*$oH-$nH},100%,100% mirror. y a y +NtileX={round($nW/$1)} NtileY={round($nH/$1)} ++l. +repeat $2 +if $2>1 dx={round(u(0,$1))} dy={round(u(0,$1))} else dx=0 dy=0 fi ++shift[0] $dx,$dy,0,0,2 +split_tiles. $NtileX,$NtileY pW={1,w} pH={1,h} +done rm[0] +y y a x n={w} - 'ia' +transpose. m*[-2,-1] / $n eigen +l.. unroll x sqrt gt {$3*$Sigma} f 'abs(i(x+1)-i(x))' T={[xM,yM,zM,cM]} 4 f. $T T={i(0)} done +if $T==0 T=100% fi k. columns 0,$T +done +repeat $2 +if $2>1 dx={round(u(0,$1))} dy={round(u(0,$1))} else dx=0 dy=0 fi ++shift[0] $dx,$dy,0,0,2 +l[1,-1] +l[1] split_tiles $NtileX,$NtileY unroll y a x done +transpose[0] +m* +t=${-mad.} +f. 'if(abs(i)<$4*$t,0,i)' +rm[1] transpose[0] +m* rm.. +done +l. +s x r $pW,$pH,1,$oS,-1 +append_tiles $NtileX,$NtileY +shift {-$dx},{-$dy},0,0,2 +done +done +rm[0,1] ++ / $2 +crop {$1+1},{$1+1},{$oW-$1-2},{$oH-$1-2} +done done +std_noise : ++laplacian. u {${-mad.}/sqrt(if(d==1,20,42))} rm. +#@cli iuwt : _nlevels>2,_spline>1 +#@cli : Compute the "isotropic undecimated wavelet transform" using +#@cli : a trou algorithm for the B3-Spline wavelet. +#@cli : The inverse is obtained as the sum of all coefficients +#@cli : $ image.jpg iuwt 4,1 n 0,255 append_tiles +#@cli : $ image.jpg iuwt 3,1 + +iuwt : skip ${1=3},${2=3} +e[^-1] "Compute isotropic undecimated wavelet transform." +repeat $! l[$<] +50 +l. +f 'if(x==w/2|x==w/2-1,1,0)' i [0] +repeat $2 convolve. [0] done +k. autocrop 0 / {ia*w} +done +repeat $1-1 +l[-1,-2] ++convolve[0] [1] +y[1] y convolve. [1] ++-[0] . rm[0] rv +done +l. y y 100% a x s y s x rm. a x done +done +rm. rv +done done +#@cli iuwt_std : _nlevels>2,_spline>1 +#@cli : Compute noise at each level of the iuwt +#@cli : $ image.jpg iuwt_std 10,10 +iuwt_std : +repeat $! l[$>] +sigma=${-noise_std} +if 1 +f 1 noise $sigma iuwt $1,$2 +repeat $! l[$>] +x={sqrt(iv)} rm 1 f $x +done done a x +else rm +50 +l. +f 'if(x==w/2|x==w/2-1,1,0)' i [0] +repeat $2 convolve. [0] done +k. autocrop 0 / {ia*w} +done +sqr +alpha={is} rm +$1,1,1,1,'$sigma*sqrt((1+$alpha)*$alpha^(w-x-1))' +fi +done done +#@cli denoise_iuwt :_threshold>0,_nlevels>2,_spline>1 +#@cli : Denoising by thresholding the coefficients of the +#@cli : "isotropic undecimated wavelet transform" +#@cli : $ image.jpg +noise 10 +denoise_iuwt. , print_psnr +denoise_iuwt : check "${1=1.4}>0&&${2=4}>1&&${3=1}>0" +e[^-1] "Denoise using the isotropic undecimated B$3 spline wavelet transform." +repeat $! l[$>] ++iuwt_std[0] $2,$3 rv +iuwt. $2,$3 +repeat $!-2 threshold[{$>+2}] {0,$1*i($>+1)},1 done ++[1--1] +rm[0] +done done +#@cli noise_poisson_gaussian : gain,offset,noise_std +camera_noise : +repeat $! l[$>] +noise 0,3 * $1 + $2 noise $3 +done done +#@cli analyze_camera_noise : +analyze_camera_noise : +repeat $! l[$>] ++local_noise_variance $1 b[0] $1 y a c +display_parametric 800,600,.0,1,1,0,signal,noise +done done +#@cli dehaze : scale,gamma1,min_va,max_val,gamma2 +#@cli : Dehaze an image using Dark Channel Prior appraoch +#@cli : return the dehazed image and a transmittance image +dehaze : skip ${1=5},${2=1},${3=.2},${4=1},${5=0},${6=0},${7=0} +repeat $! l[$>] ++l ++l s c min b 10 erode_circ $1 dilate_circ $1 done +gt. 80% * +s c aR={0,iM} aG={1,iM} aB={2,iM} rm +done ++l +s c /[0] $aR /[1] $aG /[2] $aB +repeat 10 median 3 erode_circ $1 dilate_circ $1 done +min f 'max($3,min($4,1-0.95*i))' +done +pow[1] $2 +s[0] c -[0] $aR -[1] $aG -[2] $aB +/[0-2] [3] ++[0] $aR +[1] $aG +[2] $aB a[0-2] c +c[0] 0,255 +adjust_colors[0] $5,$6,$7 +done done +#@cli :: Segmentation +#@cli contour2d : _tolerance +#@cli : Draw a 2D contour of regions with tolerance _tolerance +#@cli : Default value _tolerance=.1 +#@cli : $ image.jpg norm b 1 gt 50% +contour2d +contour2d : skip ${1=.1} +f 'if(abs(i-j(1,1))>$1||abs(i-j(1,0))>$1,1,0)' +#@cli segment_snake : _nb_iter,_time_step,_lambda,_threshold,_smoothness +#@cli : Segment an image using an adaptation of Chan and Vese's method. +#@cli : Default values _nb_iter=10,_time_step=1,_smoothness=100,_threshold=50% +#@cli : Reference Chan and L. Vese,Active contours without edges, IEEE transactions on image processing 10(2) (2001), pp. 266-277 +#@cli : $ 256,128 t "GMIC",40,10,100,1,255 b 1 noise 20 +segment_snake , contour2d. , r. 100%,100%,1,3,0 n 0,255 + +segment_snake : skip ${1=100},${2=1},${3=.1},${4=.1},${5=10},${6=0} +e[^-1] "Segment the image using active contours without edges using $1 iterations and time step $2, smoothness $3 and initialize with threshold of $4." +repeat $! l[$>] +if s>1 luminance fi ++b $5 gt. {ia+$4*sqrt(iv)} +l. +distance 0 negate[0] distance[0] 0 *[0] -1 + done +repeat $1 ++lt. 0 b. 1 +*[0,-1] swx={ia} sw={-2,ia} M1={$swx/$sw} +sqr. swx2={ia} S1={max(1e-3,$swx2/$sw^2-$M1^2)} rm[-1,-2] ++gt. 0 b. 1 +*[0,-1] swx={ia} sw={-2,ia} M2={$swx/$sw} +sqr. swx2={ia} S2={max(1e-3,$swx2/$sw^2-$M2^2)} rm[-1,-2] ++iee. ++f[0] '(1.0/$3)*(((i(x,y)-$M1)^2)/$S1-((i(x,y)-$M2)^2)/$S2)' ++[-2,-1] +*. {$2/(0.0001+max(abs(im),abs(iM)))} ++[-2,-1] +if $6==1 ++l gt[1] 0 contour2d[1] , n 0,1 -a c t $>,0,0,13,1,{iM} w wait 10 rm done +fi +done +b. 1 gt. 0 rm[0] +done done +#@cli segment_cells : scale1,scale2,threshold,size_threshold +#@cli : Cell segmentation using watershed +#@cli : $ 256,256 noise .05,2 ==. 1 b 10,1,1 min 80% noise 5% +segment_cells 2,10% contour2d. , r. 100%,100%,1,3,0 n 0,255 + +segment_cells : skip ${1=3},${2=10},${3=1},${4=3} +e[^-1] "Cell segmentation using difference of Gaussians and watershed." +repeat $! l[$>] +jeje_dog $1,$2 +gt {ia+$3*${-mad}} area_fg 0 gt $4 +distance[1] 0 +max_patch[0] {round($4,1,1)} *[0] [1] label[0] 0 watershed[0] [2] rm. * +done done +#@cli zernike : +zernike : +skip ${4=0},${5=0},${6=0},${7=0},${8=0},${9=0},${10=0},${11=0},${12=0},${13=0},${14=0},${15=0},${16=0},${17=0},${18=0} +f 'r=sqrt((x-$1)^2+(y-$2)^2);if(r<$3,a=atan2(y-$2,x-$1);$4+$5*2*r*sin(a)+$6*r*cos(a)+$7*sqrt(6)*r^2*sin(2*a)+$8*sqrt(3)*(2*r^2-1)+$9*sqrt(6)*r^2*cos(2*a)+$10*sqrt(8)*r^3*sin(3*a)+$11*sqrt(8)*(3*r^3-2*r)*sin(a)+$12*sqrt(8)*(3*r^3-2*r)*cos(a)+$13*sqrt(8)*r^3*cos(3*a)+$14*sqrt(10)*r^4*sin(4*a)+$15*sqrt(10)*(4*r^4-3*r^2)*sin(2*a)+$16*sqrt(5)*(6*r^4-3*r^2)*cos(2*a)+$17*sqrt(10)*(4*r^4-3*r^2)*cos(2*a)+$18*sqrt(10)*r^4*cos(4*a),0)' +#@cli :: Patterns +_challenge : +108,86,1,3 l. fractional_brownian_motion .25 n 0,128 +norm gt. 60% * r 1080,860,1,3,1 +l. b 10 shift. 10,10 done max crop 10,10,100%,100% negate done n 0,255 +#@cli periodic_dots : _nb_angles,_scale,_start_angle +#@cli : Generate a peridic dot pattern with 'nb angles', 'scale' and 'start angle'. +#@cli : Default values 'nb angle=6', 'scale=4' and 'start_angle=0' +periodic_dots : skip ${1=6},${2=4},${3=.5} +e[^-1] "Generate a periodic dot pattern with $1 angles, scale $2, and orientation $3." +repeat $! l[$>] +s c repeat $! l[$>] ++r {max(w,h)},{max(w,h)},100%,100%,0 +l. +f 0 +repeat $1 +circle {w*(.5+.5/$2*cos(2*pi*($>+$3/180*pi)/$1))},{w*(.5+.5/$2*sin(2*pi*($>+$3/180*pi)/$1))},0,1,255 +done +fft a c norm fftshift n 0,255 +done +ri. [0],0 +k. +done done a c +done done +#@cli turing_pattern : iter,dt,a,b,q,r,D +#@cli : Generate Turing pattern using a rection-diffusion equation +#@cli : du/dt = au(1-qv²) + v(1-ru) +#@cli : dv/dt = v(b-aquv) + u(-a+rv) +#@cli : the two parameters q and r are dictating the pattern final shape +#@cli : the diffusivity parameter influcences the scale +#@cli : http://www.dna.caltech.edu/courses/cs191/paperscs191/turing.pdf +#@cli : http://eprints.maths.ox.ac.uk/430/1/102.pdf +turing_pattern : skip ${1=2000},${2=.1},${3=0.855},${4=-0.95},${5=2},${6=.1},${7=.5},${8=0} +repeat $! l[$>] +r 100%,100%,100%,2 b 1 n 0,1 +repeat $1 +progress {$>/$1*100} ++laplacian[0] mix_channels. ($7,0;0,1) ++f[0] 'u=i(x,y,z,0);v=i(x,y,z,1);a=$3;b=$4;q=$5;r=$6;if(c==0,a*u*(1-q*v*v)+v*(1-r*u),v*(b+a*q*u*v)+u*(-a+r*v))' ++[-1,-2] +*. {$2/(1+max(abs(im),abs(iM)))} ++ +if $8==1 +l s c n 0,1 a c t $> w rm done fi +done +s c n 0,1 a c +done done +#@cli rays : _center_x,_center_y,_scale,_phase +#@cli : Generate rays patterns +#@cli : $ image.jpg +rays 155,127,10,10 n. 0,1 * +rays : +e[^-1] "Generate a ray pattern centered in ($1,$2)." +f 't=atan2(y-$2,x-$1);sin($3*t+$4)' +#@cli fractional_brownian_motion : 0<=_hurst_index<=1,_epsilon>0 +#@cli : Generate fractional brownian motion nd signal +#@cli : Using a power low of the form (eps+|f|)^(-2^H-1) +#@cli : where f is the module of the frequency, H the husrt index and eps _epsilon. +#@cli : (see also 'clouds') +#@cli : $ 400,300 fractional_brownian_motion +fractional_brownian_motion : skip ${1=.5},${2=1} check "$1>=0&&$1<=1" check "$2>0" +e[^-1] "Generate pseudo fractional brownian motion." +repeat $! l[$>] +f 0 noise 1 +fft fftshift +if {0,d==1} +f 'rx=x-w/2;ry=y-h/2;i*($2+sqrt(rx*rx+ry*ry))^(-2*$1-1)' +else +f 'rx=x-w/2;ry=y-h/2;rz=z-d/2;i*($2+sqrt(rx*rx+ry*ry+rz*rz))^(-2*$1-1)' +fi +fftshift ifft +k[0] +done done +#@cli clouds : _density_of_blue_sky>0,_amplitude,0<=_hurst_index<=1,_epsilon>0 +#@cli : Generate clouds on the image (see also 'fractional_brownian_motion') +#@cli : $ 64,64 repeat 3 +clouds {10+20*$>}% done rm[0] +clouds : skip ${1=50%},${2=1},${3=.5},${4=1} +e[^-1] "Generate a cloud." +repeat $! l[$>] +channels 0 +fractional_brownian_motion $3,$4 negate min $1 negate r 100%,100%,1,4 +n 0,255 s c n[0-2] 190,255 n[3] 0,255 a c +done done +#@cli clearbluesky : +#@cli : Generate a Clear Blue Sky +#@cli : $ 400,300,1,3 clearbluesky +clouds 50% blend alpha +clearbluesky : +e[^-1] "Generate a blue sky." +repeat $! l[$>] +1,2,1,3 f. '63,70,120,144,190,215' r. [0],5 k. +done done +#@cli mm_mozaic : size +#@cli : Create a mozaic image from the selected image +#@cli : sp ? mm_mozaic +mm_mozaic : skip ${1=1} +repeat $! l[$>] ++gradient_norm negate. ++l. b. .75 +ge $1 max_patch.. 3 d * done to_rgb. *[0,2] d +watershed.. . rm. +done done +segment_watershed2 : check "${1=2}>=0" +e[^-1] "Apply watershed segmentation on image$?, with edge threshold $1." +repeat $! l[$>] +min={im} ++ {1+$min} +gradient_norm +if d>1 +f. "if(i<$1 && i] +fftpolar +gaussian $1 *[0] [2] rm. ifftpolar rm. n 0,{$2*pi} sin +done done +#@cli :: Colors +#@cli wavelength_color : _wavelength +#@cli : Convert a wavelength [380,780] to RGB color +#@cli : from http://scienceprimer.com +#@cli : $ 1,1,1,1,1 repeat 100 +wavelength_color[0] {380+3*$>} done rm[0] a x +wavelength_color : +if $1>=380&$1<440 +R={-1*($1-440)/(440-380)} +G=0 +B=1 +elif $1>=440&$1<490 +R=0 +G={($1-440)/(490-440)} +B=1 +elif $1>=490&$1<510 +R=0 +G=1 +B={-1*($1-510)/(510-490)} +elif $1>=510&$1<580 +R={($1-510)/(580-510)} +G=1 +B=0 +elif $1>=580&$1<645 +R=1 +G={-1*($1-645)/(645-580)} +B=0 +elif $1>=645&$1<780 +R=1 +G=0 +B=0 +else +R=0 +G=0 +B=0 +fi +repeat $! l[$>] +mix_channels ($R;$G;$B) +done done +#@cli :: GIMP +#@cli jpr_gradient_smooth : +#@cli : image and its gradient in x y are treated as solid angles +#@cli : and locally smoothed on the surface of a sphere +#@cli : which can retain bright/dark/bright sequences +jpr_gradient_smooth: +repeat $! +l[$>] +norm ++g xy,0 +n[0] {$1-1},{$1+1} +a c +repeat 25 ++norm +/[0,1] +b {w*$2/500} +done +f atan2(i,abs(i(x,y,0,0))) +channels 1,2 +done +r 100%,100%,1,3,0,1 +n 0,255 +done +#@cli jpr_line_edges : Angles,Blurring,AntiAlias +#@cli : Similar in concept to a Hough Transform and voting +#@cli : here multiple orientations are blurred a little +#@cli : this augments line segments along the blur and suppresses +#@cli : noise improving edge detection by finding +#@cli : max gradient orthogonal to each linear blur +#@cli : $ image.jpg jpr_line_edges 5,5,1 +jpr_line_edges : skip ${1=5},${2=5},${3=1},${4=1} +e[^-1] "Find edges in image$? using $1 angles per quadrant with $2 blurring and $3 anti-alias" +repeat $! l[$>] +norm +fft +100%,100%,1,1,x-w/2 +100%,100%,1,1,y-h/2 +shift[2,3] {-round(w/2)},{-round(h/2)},0,0,2 +100%,100%,1,1 +repeat $1 +ac={3*cos(($>+0.5)*pi/$1/2)/sqrt(pi)*$2/w} +as={3*sin(($>+0.5)*pi/$1/2)/sqrt(pi)*$2/w} ++*[2] $ac ++*[3] $as ++[-2,-1] ++sqr. +*. -1 +exp. +*[-2,-1] ++mirror. x +*. -1 +[1]x1 +*. -1 +[0]x1 +*[-2,-1] [-4] +rm[-4] +ifft[-2,-1] +rm. +[1]x1 +*. -1 +[0]x1 +*[-2,-1] [-4] +rm[-4] +ifft[-2,-1] +rm. +abs[-2,-1] +max[-2,-1] $3 +ac={round(1.45*cos(($>+0.5)*pi/$1/2))} +as={round(1.45*sin(($>+0.5)*pi/$1/2))} ++shift.. {-$ac},{-$as} ++shift... {$ac},{$as} ++shift... {$ac},{-$as} ++shift[-4] {-$ac},{$as} +if $4 ++max[-6,-4,-3] ++min[-7,-5,-4] +-[-2,-1] ++[-5,-4] +*[-4] 0.5 +-[-6,-4] +/[-5,-1] +-[-4] 0.1 +max[-4] 0 +*[-4] 2 +-[4,-4] ++max[-3,-2,-1] ++min[-4,-3,-2] +-[-2,-1] ++[-3,-2] +*.. 0.5 +-[-3,-2] +/[-2,-1] +-. 0.1 +max. 0 +*. 2 +-[4,-1] +else +max[-4,-3] +gt[-5,-3] +-[4,-4] +max[-2,-1] +gt[-2,-1] +-[4,-1] +fi +done +rm[0,1,2,3] +n 0,255 +done done +#@cli jpr_orientedthinning: +#@cli : Skeleton of a shape against a zero-value (pure-black) background using locally oriented local maxima to find only relevant ridges - not micro ridges from a noisy boundary. +#@cli : $ sp swan +b 22 < jpr_orientedthinning 0.5,1.5,3.5,0,2 +jpr_orientedthinning : +e[^-1] "Oriented Thinning image$? with Pre-Smooth $1, Propagate Direction $2, Threshold Width $3" +repeat $! +l[$<] +norm ++b $1 +structuretensors. 0 +mix_channels. (1,0,-1) +b. $2 +le. 0 +if $4 +rm.. +* 255 +else +(1.1,0^0,1.1) +map.. . +rm. +distance.. 0,$5 +max.. $3 ++warp.. .,1 +*.. -1 ++warp... ..,1 +rm... +max[-2,-1] +gt[-2,-1] +* 255 +fi +done +done +#@cli jpr_phasecongruence : +#@cli : Edge detection via Phase Congruence method relies on low noise source and uses FFT to compute local energy along a vector. +#@cli : Multipe orientations are applied to a grayscale version of the image and combined. +#@cli : $ sp swan jpr_phasecongruence 7,17,130,1 +jpr_phasecongruence : +e[^-1] "Phase Congruence image$? with StartAngle $1, Directions $2, Threshold $3, IsLines $4" +repeat $! +l[$<] +norm +100%,100%,1,1,0 +repeat $2 +[0]x1 +t={($1/180+$w/2,x-w,x);sy=if(y>h/2,y-h,y);if(abs($a*sx+$b*sy)>0.7,sign($a*sx+$b*sy),0) +*[3] -1 +*[2,3] [4] +rm[4] +ifft[2,3] +rm[3] +c={max(abs($a),abs($b))*.8} +abs[2] +max[2] $3 +if $4 +a={$a/$c} +b={$b/$c} +f[2] i>i(x+$a,y+$b)&i>i(x-$a,y-$b) +fi ++[1,2] +done +rm[0] +n 0,255 +done +done +#@cli jpr_remove_blocks1 : _spatial,_amplitude,_strength +#@cli : remove block artefacts from smooth areas +#@cli : spatial drives the size of blocks to try and fit +#@cli : amplitude set to a minimum to catch only noise blocks +#@cli : strength expect 70 but fine tune up or down +jpr_remove_blocks1 : +repeat $! l[$<] +k[0] +spatial=$1 +amplitude=$2 +strength=$3 ++b[0] {$spatial*1.2} +b[0] {$spatial*0.8} -[1,2] [0] +c[1,2] {-$amplitude},{$amplitude} ++==[1,2] {-$amplitude} ++==[1,2] {$amplitude} or[3,4,5,6] +wh={w},{h} +shift[1] 2,2 +r[1,2] {w/$spatial},{h/$spatial},1,3,2 +r[1,2] $wh +shift[1] -2,-2 +c[1,2] {-$amplitude/2},{$amplitude/2} ++==[1,2] {-$amplitude/2} ++==[1,2] {$amplitude/2} or[3,4,5,6,7] +compose_channels[3] or +blur[3] {2*$spatial} threshold[3] 0.1 +blur[3] {2*$spatial} +-[3] 1 ++[1] [2] rm[2] +*[1] [2] rm[2] +*[1] {0.01*$strength} +-[0] [1] rm[1] +done done +#@cli jpr_shapes_gradient : +#@cli : convert an image to local patches with some gradient +#@cli : patch shape is via watershed algorithm +#@cli : pre-blur,threshold,grad-flatten,grad-cap +#@cli : e.g. 2,0.5,0.01,100 +jpr_shapes_gradient: +repeat $! l[$<] +100%,100%,1,1,0.1*(x-w/2) ++norm[0] +b. $1 +segment_watershed. $2,0 ++blend[1,-1] shapeaverage0 +-[1,-1] ++sqr[1] +..x1 +blend[-2,-1] shapeaverage0 ++. $3 +sqrt. +/[1,-1] ++blend[0,-1] shapeaverage0 +*[0] ... +blend[0,-2] shapeaverage0 +c[0] -$4,$4 +*[0,1] ++[0,1] +c 0,255 +done done +#@cli jpr_specularbumps : +#@cli : Specular highlights as if the image has bumps based on luminance. Ignores and deletes alpha channel. +#@cli : $ sp swan jpr_specularbumps 145,1,25,26,15,0.07,0.17,0 +jpr_specularbumps : +e[^-1] "Specular highlights image$? with GradientAngle $1, Pre-Smooth $2, GradientRange $3, AdjustAngle $4, IlluminationOffset $5, HighlightSize $6, Roughness $7, OutputType $8" +t={$1*pi/180} +a={cos($t)} +b={sin($t)} +repeat $! +l[$<] +to_rgb ++b $2 +l. +norm +gradient xy +a c +mix_channels ($a,$b;{-$b},$a) +div $3 +c 0,1 ++norm +f. "0.1/(0.1+i)" +a c ++norm +div[-2,-1] +b 2 ++norm +div[-2,-1] +wh={w},{h},1,3 +({cos((45+$4)*pi/180)*sin($5*pi/180)}^{sin((45+$4)*pi/180)*sin($5*pi/180)}^{cos($5*pi/180)}) +r $wh +- +norm +c $6,{$6+$7} +* -1 +n 0,255 +done +if $8==0 +rm.. +else +if $8==1 +rm.. +100%,100%,1,3,255 +mv. -2 +a[-2,-1] c +else +blend dodge +fi +fi +done +done +#@cli jpr_warpfromthreshold : +#@cli : test trying to create a patch local warp effect +jpr_warpfromthreshold: +repeat $! +l[$>] +norm ++g xy +a[1,2] c +ge[0] $1 +b[0] $2 +ge[0] 0.5 +f[0] i!=i(x+1,y)|i!=i(x,y+1) +repeat $3 ++norm[1] +*[2] [0] +a[1,2] c +f[1] if(i(x,y,0,2)==0,i,i/i(x,y,0,2)) +channels[1] 0,1 +b[1] $4 +done +rm[0] +s c +n 0,100 +a c +100,100,1,3,((x/2)%4)==0|(c==2&((y/2)%4)==0) +warp[1] [0] +rm[0] +n 0,255 +done +done +fx_charred_plastic: +if $4 ++dog $2%,$3% +else ++dog $2,$3 +fi +*. $1 ++.. . +rm. +ac "_fx_noise $5,$6",$7 +c 0,255 +normalize_local ${8-13} +fx_charred_plastic_preview: +fx_charred_plastic $* +fx_dreamy_abstraction : +-m "MergeChoice : $""=_mode" -MergeChoice "add","alpha","and","average","blue","burn","darken","difference","divide","dodge","exclusion","freeze","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor","edges","error" +MergingOption1=$3 +Opacity1=$4 +MergingOption2=$8 +Opacity2=$9 +if $4>=0 ++fx_segment_watershed $1,$2,1,1 blend ${_mode{$MergingOption1+1}},$Opacity1 +fi +if $5>=0 ++fc 0,0,0 -to_rgb +if $6==5 +ac. "spread {([$5,$5]/100)*max(w,h)}",$7,1 +else +ac. "_jr_fx_noise {255*$5/100},$6",$7,1 +fi +blend ${_mode{$MergingOption2+1}},$Opacity2 +if $10>=0 +_fx_gaussian_blur $10,0,0,1 +fi +fi +radius={$10*$11*2} +amount={$10*$12*2} +cradius={$10*$14*2} +overshoot={$10*$15/10} +iain_constrained_sharpen $radius,$amount,$13,$cradius,$overshoot,$16,$17 +if $18>=0 +fx_smooth_antialias {$18+(5*$10)},0,{($18+(5*$10))/20} +fi +fx_dreamy_abstraction_preview: +gui_split_preview "-fx_dreamy_abstraction $*",${-3--1} +fx_dreamy_watercolour : +repeat $! l[$>] +to_rgb +if $6 ++b $1 +l[1] gradient_norm c 0,255 ^ $2 +c $3%,$4% +if $5 negate fi +n 0,255 +if $9!=0||$10!=100 +fx_smooth_antialias ${7-9} +fi +done +fi +fx_jr_deform[0] 0,${28-34} +fx_dreamy_abstraction[0] ${10-27} +if $6 n[1] 0,255 negate[1] blend[0,1] multiply,$6 fi +-m "MergeChoice : $""=_mode" -MergeChoice "add","alpha","and","average","blue","burn","darken","difference","divide","dodge","exclusion","freeze","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor","edges","error" +100%,100%,1,3 +CF={$37*20*$38} +l[1] if $43 z {-$CF},{-$CF},{w+$CF},{h+$CF} fi fx_plasma ${35-42} if $43 z {$CF},{$CF},{w-$CF},{h-$CF} fi done +if $44 fx_transfer_rgb ${45-49} fi +if $52 rv fi +blend ${_mode{$50+1}},$51 +fx_normalize_local ${53-58} +if $59 +100%,100%,1,3 fc[1] 127,127,127 jr_fx_noise[1] {(2^($59*0.2))*($59*20)},${60-62} +blend ${_mode{$63+1}},$64 +fi +done done +fx_dreamy_watercolour_preview : +fx_dreamy_watercolour $* +fx_hard_painting : skip ${4=0},${5=0} +repeat $! l[$>] +to_colormode {max(3,s)} split_opacity +l[0] +repeat $1 fx_normalize_local 10,6,5,20,1,11 done +fx_smooth_anisotropic {100*$2},0.2,1,$2,{2*$2},0.8,90,2,0,1,1,2,1,16 +fx_mix_lab 1,0,0,$3,0,0.5,$3,0,0.5,0,2,0 +if $5 fx_segment_watershed 10,1,0 fi +smooth. $4,0,1,1,1 +split_opacity l[0] +repeat max(0,$6) +if $7==0 fx_normalize_local $8,$9,$10,$11,1,3,0 fi +if $12==0 +fx_pencilbw $13,$14,0,0,0 fi +if $15==1 k[-1] break fi +if $16==1 fx_smooth_anisotropic[-1] 60,$17,$18,$19,1.1,0.8,30,2,0,1,1,0 fi +if $20==1 k[-1] break fi +if $21==1 rv fi +if $22==0 fx_compose_overlay $23,0 +elif $22==1 fx_compose_multiply $23,0 +elif $22==2 fx_compose_softlight $23,0 +elif $22==3 fx_compose_colorburn $23,0 +elif $22==4 fx_compose_darken $23,0 +elif $22==5 fx_compose_stamp $23,0 +elif $22==6 fx_compose_hardlight $23,0 +elif $22==7 fx_compose_value $23,1 +elif $22==8 fx_compose_grainmerge $23,0 +elif $22==9 fx_compose_freeze $23,0 +elif $22==10 fx_compose_lightness $23,1 +elif $22==11 fx_compose_luminance $23,1 +elif $22==12 fx_compose_colordoping $23,0 +elif $22==13 fx_compose_comix_color $23,0,$24 +elif $22==14 fx_compose_graphicolor $23,0,$24 +elif $22==15 fx_compose_graphixcolor $23,0 +elif $22==16 fx_compose_vividedges $23,0.50,0,$24 +elif $22==17 fx_compose_darkedges $23,0.50,0,$24 +elif $22==18 fx_compose_vividscreen $23,0,$24 +elif $22==19 fx_compose_darkscreen $23,0,$24 +elif $22==20 fx_compose_interpolation $23,0 fi +if $25==1 fx_smooth_anisotropic 60,$26,$27,$28,1.1,0.8,30,2,0,1,1,0 fi +done +done +done +a c +done +done +fx_hard_painting_preview : +gui_split_preview "fx_hard_painting $*",${-3--1} +fx_neon : +repeat $! l[$>] ++fc 0,0,0 rv blend alpha +to_rgb rgb2hsl8 s c +*.. {$12^2.5} c 0,255 +a[0-2] c hsl82rgb +if $11 +[0] l[1] +b $6 +if $1==1 ++hessian xx sqr. ++hessian.. yy sqr. +[-2,-1] +hessian.. zz sqr.. +[-2,-1] +s={s} s. c +[-$s--1] sqrt. +elif $1==2 +laplacian abs to_gray to_rgb +elif $1==3 +gradient xyz abs blend add to_gray to_rgb +elif $1==4 +afre_edge ${2-5} * 4 +else +gradient_norm replace_inf 1 replace_nan 0 +fi +c 0,255 +^ $7 +c $8%,$9% +if $10 negate fi +n 0,255 +if $14!=0||$15!=100 +fx_smooth_antialias ${14-16} +fi +done +if $13 +b[0] {$13}% +fi +blend multiply,$11 +fi ++b[0] {$17%*100},1 *[1] {$18*sqrt($17%)*10} -[1] {(($18*sqrt($17%)*128)-1)^(sqrt($19))} ++b[0] {$21%*100},1 *[2] {$22*sqrt($21%)*10} -[2] {(($22*sqrt($21%)*128)-1)^(sqrt($19))} ++b[0] $25,1 *[3] {($18+$22)*$25*($26^2.5)} +rgb2hsl[1-3] s[1-3] c +*[2] {$20^2.5} +*[5] {$24^2.5} +*[8] 0 +a[1-3] c a[2-4] c a[3-5] c hsl2rgb[1-3] +replace_inf 1 replace_nan 0 +blend add +if $27 +rgb2ycbcr s c b[1,2] {$27%*100} a c ycbcr2rgb +fi +if $28 +rgb2hsv8 100%,100%,1,1 f[1] "((j(#0,0,0,0,2)/255)^(1/$25))*255*$30" f[0] "[i0,i1,255]" hsv82rgb[0] a c +fi +done done +fx_neon_preview : +gui_split_preview "fx_neon ${1-30}",${-3--1} +u "{$1}""{$2}"_{$1==4?2:0}"{$3}"_{$1==4?2:0}"{$4}"_{$1==4?2:0}"{$5}"_{$1==4?2:0}"{$6}""{$7}""{$8}""{$9}""{$10}""{$11}""{$12}""{$13}""{$14}""{$15}""{$16}""{$17}""{$18}""{$19}""{$20}""{$21}""{$22}""{$23}""{$24}""{$25}""{$26}""{$27}""{$28}""{$29}""{$30}""{$31,$32}""{$33}" +fx_neon_alpha : +repeat $! l[$>] +to_rgba ++split_opacity +rm[1] +fx_solidify_td[0] 100,0,10,2,0 +invert_rgb[0] +blend[1,2] difference +fx_gradient_norm[1] ${1-4},0 +if $7!=1 +l[0] to_rgb[0] rgb2hsl[0] s[0] c +*[1] {$7^2.5} +a[0-2] c hsl2rgb[0] +done fi +if $6 +b[0] $6 +fi +[0] [1] a[2,3] c b[2] $8,1 *[2] {$9*sqrt($8)} -[2] {(($9*sqrt($8)*128)-1)^(sqrt($10))} +[0] [1] a[3,4] c b[3] $12,1 *[3] {$13*sqrt($12)} -[3] {(($13*sqrt($12)*128)-1)^(sqrt($14))} +split_opacity[2,3] +l[2] to_rgb[0] rgb2hsv[0] s[0] c +*[1] {$11^2.5} ++[2] 1 +a[0-2] c hsv2rgb[0] done +l[4] to_rgb[0] rgb2hsv[0] s[0] c +*[1] {$15^2.5} ++[2] 1 +a[0-2] c hsv2rgb[0] done +blend[3,5] average +blend[2,4] add +b[2] {$9*13} ++blend[0,2] add rm[0] mv[3] 0 +[1] +a[0,1] c a[1,2] c [1] mv[3] 0 +blend[0,1] alpha blend[0,1] add +done done +fx_neon_alpha_preview : +fx_neon_alpha $* +fx_otsu_hessian_blend : +-m "MergeChoice : $""=_mode" -MergeChoice "add","alpha","and","average","blue","burn","darken","difference","divide","dodge","exclusion","freeze","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor","edges","error" +MergingOption=$4 +Opacity=$5 +ReverseOrder={!$6} ++l otsu $1 afre_hnorm n $2,$3 done +* blend ${_mode{$MergingOption+1}},$Opacity,$ReverseOrder +fx_otsu_hessian_blend_preview : +repeat max(0,l) +fx_otsu_hessian_blend[$>] $* +done +fx_whirling_lines : +b $1 f "round(i,$2)" +if $3==1 +b $4 ++hessian xx sqr. ++hessian.. yy sqr. +[-2,-1] +hessian.. zz sqr.. +[-2,-1] b $4 +s={s} s. c +[-$s--1] sqrt. +elif $3==2 +b $4 laplacian abs to_gray to_rgb +elif $3==3 +b $4 gradient xyz abs blend add to_gray to_rgb +else +b $4 gradient_norm +fi +c 0,255 +^ $5 +c $6%,$7% +n 0,255 +if $8>=0 +dilate_circ $8 +elif $8<=0 +erode {-$8} +fi +if $9 negate fi +if $10!=0||$11!=100 +fx_smooth_antialias ${10-12} +fi +if $13==1 c 0,255 elif $13==2 n 0,255 elif $13==3 c 0,255 n 0,255 fi +fx_whirling_lines_preview : +fx_whirling_lines $* +csswap: +scfrom=$1 +csto=$2 +if ('$scfrom'!='$csto') +list=srgb,cmy,ryb,ohta8,ohta,yes8,yes,k18,k1,lab8,lab,oklab,luv,jzazbz,yiq8,yiq,yuv8,yuv,ycbcr,ycbcrglic,ycbcrjpeg,ydbdr,xyz8,xyz,hsv8,hsv,hsl8,hsl,hsi8,hsi,lch8,lch,jzczhz,hcy +repeat $! l[$>] split_opacity l[0] to_rgb +if ('$scfrom'!='rgb')&&('$scfrom'!='0') +if isnum($scfrom) +scfrom=${arg\ $scfrom,$list} +else +strlowercase $scfrom +scfrom=${} +fi +m "sc: comm="$scfrom" u $comm{/2rgb}" +${"-sc"} +um sc +fi +if ('$csto'!='rgb')&&('$csto'!='0') +if isnum($csto) +csto=${arg\ $csto,$list} +else +strlowercase $csto +csto=${} +fi +m "cs: comm="$csto" u {/rgb2}$comm" +${"-cs"} +um cs +fi +to_rgb done a c done done +fi +csswap_preview : +gui_split_preview "csswap $*",${-3--1} +fx_cubehelix : +sh=((1-$11)/3)+1 +ramp=$21*-1.7889532707703687 +rang={0.083166763586+($22/180)*pi} +gamp=$23*-0.952442057555209 +gang={2.8296965485317932+($24/180)*pi} +bamp=$25*1.97294 +bang={(0.5+$26/180)*pi} +gs=$18^2 +ge=$19^2 +scv=-$20 +rotb={2^($13^2)} +satb={2^($14^2)} +gamb={2^($17^2)} +repeat $! l[$>] +to_rgba split_opacity l[0] +if $1==1 luminance[0] to_rgb elif $1==2 f "(i0+i1+i2)/3" fi +abs c 0,255 c $2%,$3% if $4 n 0,255 fi *. {1/255} +f "begin(scale=([${8-10}]-[${5-7}])/255; +colstart=([${5-7}])/255; +const sh="$sh"; +const gs="$gs";const ge="$ge"; const scv="$scv"; +rotb="$rotb";satb="$satb";gamb="$gamb"; +const ramp="$ramp";const rang="$rang"; +const gamp="$gamp";const gang="$gang"; +const bamp="$bamp";const bang="$bang"); +angle=(2*pi*(sh+$12*(I^(rotb))));fract=gs+(I^(gamb))*(ge-gs);amp=(($15+($16-$15)*I^(satb))*fract*(1-fract)*0.5); +helix=(amp*[ramp*sin(rang-angle[0]),gamp*sin(gang-angle[1]),bamp*sin(bang-angle[2])]); +(colstart)-scv*(fract*scale+helix)+(1+scv)*(fract+(helix*sign(scale)))*scale" +c 0,1 +*. 255 +done a c +done done +fx_cubehelix_preview : +if $27 +rm 256,256,1,3,"x" +fx_cubehelix $* +else +gui_split_preview "fx_cubehelix $*",${-3--1} +fi +fx_frequency_representation: +repeat $! l[$>] +to_rgba split_opacity rv +csswap[^0] 0,$5 +if $3 s. c fi +repeat $!-1 l[{$>+1}] +s z +repeat $! l[$>] +repeat $1 ++histogram $2 b. {($4/100)^2*100}% +f[^-1] "i(#-1,i,y,z,c,1,2)" +k[^-1] +n 0,{$2-1} +done +done done +a z +done done +n[^0] 0,255 +a[^0] c csswap[^0] $5,0 rv a c +done done +fx_frequency_representation_preview: +fx_frequency_representation $* +jr_desaturate : +repeat $! l[$>] split_opacity l[0] to_rgb if $1 srgb2rgb fi +f "avg(i0*$2,i1*$3,i2*$4)" if $5 n 0,255 fi c 0,255 +done a c done done +jr_desaturate_preview : +gui_split_preview "jr_desaturate $*",${-3--1} +#@cli rgb2ycbcrglic : convert from rgb to ycbcrglic +rgb2ycbcrglic : +split_opacity l[0] to_rgb +f "R=i0;G=i1;B=i2; +[0.2988390*R+0.5868110*G+0.1143500*B,-0.168736*R-0.3312640*G+0.5000000*B+127.5,0.5000000*R-0.4186880*G-0.0813120*B+127.5]" +done a c +#@cli ycbcrglic2rgb : convert from ycbcrglic to rgb +ycbcrglic2rgb : +split_opacity l[0] to_rgb +f "Y=i0;Cb=i1-127.5;Cr=i2-127.5; +[Y+1.402*Cr,Y-0.344136*Cb-0.714136*Cr,Y+1.772000*Cb]" +done a c +fx_satellite : +c 0,255 +luminance +f "255*((i/255)^(2^($2^2)))" +cut {$3}%,{$4}% if $5 n $6,$7 fi +to_rgb +255,1,1,3 f. "x" +l. +if $1==0 +f "((i>=0)&&(i<48))?[0,0,0]+(i-0)*[0,0,0]/47: +((i>=48)&&(i<52))?[8,8,8]+(i-48)*[0,0,0]/3: +((i>=52)&&(i<56))?[20,20,20]+(i-52)*[0,0,0]/3: +((i>=56)&&(i<60))?[28,28,28]+(i-56)*[0,0,0]/3: +((i>=60)&&(i<64))?[40,40,40]+(i-60)*[0,0,0]/3: +((i>=64)&&(i<68))?[52,52,52]+(i-64)*[0,0,0]/3: +((i>=68)&&(i<72))?[60,60,60]+(i-68)*[0,0,0]/3: +((i>=72)&&(i<76))?[72,72,72]+(i-72)*[0,0,0]/3: +((i>=76)&&(i<80))?[84,84,84]+(i-76)*[0,0,0]/3: +((i>=80)&&(i<84))?[92,92,92]+(i-80)*[0,0,0]/3: +((i>=84)&&(i<88))?[104,104,104]+(i-84)*[0,0,0]/3: +((i>=88)&&(i<92))?[112,112,112]+(i-88)*[0,0,0]/3: +((i>=92)&&(i<96))?[124,124,124]+(i-92)*[0,0,0]/3: +((i>=96)&&(i<100))?[136,136,136]+(i-96)*[0,0,0]/3: +((i>=100)&&(i<104))?[144,144,144]+(i-100)*[0,0,0]/3: +((i>=104)&&(i<108))?[156,156,156]+(i-104)*[0,0,0]/3: +((i>=108)&&(i<112))?[168,168,168]+(i-108)*[0,0,0]/3: +((i>=112)&&(i<116))?[176,176,176]+(i-112)*[0,0,0]/3: +((i>=116)&&(i<120))?[188,188,188]+(i-116)*[0,0,0]/3: +((i>=120)&&(i<124))?[196,196,196]+(i-120)*[0,0,0]/3: +((i>=124)&&(i<128))?[208,208,208]+(i-124)*[0,0,0]/3: +((i>=128)&&(i<132))?[220,220,220]+(i-128)*[0,0,0]/3: +((i>=132)&&(i<136))?[228,228,228]+(i-132)*[0,0,0]/3: +((i>=136)&&(i<140))?[240,240,240]+(i-136)*[0,0,0]/3: +((i>=140)&&(i<144))?[252,252,252]+(i-140)*[0,0,0]/3: +((i>=144)&&(i<148))?[0,156,244]+(i-144)*[0,0,0]/3: +((i>=148)&&(i<152))?[0,152,236]+(i-148)*[0,0,0]/3: +((i>=152)&&(i<156))?[0,148,228]+(i-152)*[0,0,0]/3: +((i>=156)&&(i<160))?[0,144,220]+(i-156)*[0,0,0]/3: +((i>=160)&&(i<164))?[0,140,212]+(i-160)*[0,0,0]/3: +((i>=164)&&(i<168))?[0,136,208]+(i-164)*[0,0,0]/3: +((i>=168)&&(i<172))?[0,132,200]+(i-168)*[0,0,0]/3: +((i>=172)&&(i<176))?[0,128,192]+(i-172)*[0,0,0]/3: +((i>=176)&&(i<180))?[0,124,184]+(i-176)*[0,0,0]/3: +((i>=180)&&(i<184))?[0,120,176]+(i-180)*[0,0,0]/3: +((i>=184)&&(i<188))?[160,160,0]+(i-184)*[0,0,0]/3: +((i>=188)&&(i<192))?[188,188,0]+(i-188)*[0,0,0]/3: +((i>=192)&&(i<196))?[220,220,0]+(i-192)*[0,0,0]/3: +((i>=196)&&(i<200))?[248,248,0]+(i-196)*[0,0,0]/3: +((i>=200)&&(i<204))?[252,180,0]+(i-200)*[0,0,0]/3: +((i>=204)&&(i<208))?[232,160,0]+(i-204)*[0,0,0]/3: +((i>=208)&&(i<212))?[216,140,0]+(i-208)*[0,0,0]/3: +((i>=212)&&(i<216))?[196,120,0]+(i-212)*[0,0,0]/3: +((i>=216)&&(i<220))?[232,0,0]+(i-216)*[0,0,0]/3: +((i>=220)&&(i<224))?[248,0,0]+(i-220)*[0,0,0]/3: +((i>=224)&&(i<250))?[88,88,88]+(i-224)*[0,0,0]/25: +((i>=250)&&(i<256))?[255,255,255]+(i-250)*[0,0,0]/5" +elif $1==1 +f "((i>=0)&&(i<59))?[0,0,0]+(i-0)*[0,0,0]/58: +((i>=59)&&(i<68))?[6,6,6]+(i-59)*[56,56,56]/8: +((i>=68)&&(i<97))?[75,75,75]+(i-68)*[180,180,180]/28: +((i>=97)&&(i<175))?[112,112,112]+(i-97)*[92,92,92]/77: +((i>=175)&&(i<188))?[64,64,64]+(i-175)*[0,0,0]/12: +((i>=188)&&(i<199))?[112,112,112]+(i-188)*[0,0,0]/10: +((i>=199)&&(i<209))?[160,160,160]+(i-199)*[0,0,0]/9: +((i>=209)&&(i<215))?[0,0,0]+(i-209)*[0,0,0]/5: +((i>=215)&&(i<221))?[255,255,255]+(i-215)*[0,0,0]/5: +((i>=221)&&(i<226))?[136,136,136]+(i-221)*[0,0,0]/4: +((i>=226)&&(i<256))?[88,88,88]+(i-226)*[0,0,0]/29" +elif $1==2 +f "((i>=0)&&(i<44))?[0,0,0]+(i-0)*[0,0,0]/43: +((i>=44)&&(i<152))?[20,20,20]+(i-44)*[196,196,196]/107: +((i>=152)&&(i<184))?[100,100,0]+(i-152)*[148,148,0]/31: +((i>=184)&&(i<204))?[0,0,120]+(i-184)*[0,252,132]/19: +((i>=204)&&(i<216))?[84,0,0]+(i-204)*[168,0,0]/11: +((i>=216)&&(i<224))?[252,80,80]+(i-216)*[0,60,60]/7: +((i>=224)&&(i<237))?[0,252,0]+(i-224)*[252,0,252]/12: +((i>=237)&&(i<253))?[252,252,252]+(i-237)*[0,0,0]/15: +((i>=253)&&(i<256))?[255,255,255]+(i-253)*[0,0,0]/2" +elif $1==3 +f "((i>=0)&&(i<4))?[0,0,0]+(i-0)*[0,0,0]/3: +((i>=4)&&(i<8))?[28,0,28]+(i-4)*[0,0,0]/3: +((i>=8)&&(i<12))?[60,0,60]+(i-8)*[0,0,0]/3: +((i>=12)&&(i<16))?[92,0,92]+(i-12)*[0,0,0]/3: +((i>=16)&&(i<20))?[124,0,124]+(i-16)*[0,0,0]/3: +((i>=20)&&(i<24))?[156,0,156]+(i-20)*[0,0,0]/3: +((i>=24)&&(i<28))?[188,0,188]+(i-24)*[0,0,0]/3: +((i>=28)&&(i<32))?[220,0,220]+(i-28)*[0,0,0]/3: +((i>=32)&&(i<36))?[252,0,252]+(i-32)*[0,0,0]/3: +((i>=36)&&(i<40))?[224,0,236]+(i-36)*[0,0,0]/3: +((i>=40)&&(i<44))?[196,0,220]+(i-40)*[0,0,0]/3: +((i>=44)&&(i<48))?[168,0,208]+(i-44)*[0,0,0]/3: +((i>=48)&&(i<52))?[140,0,192]+(i-48)*[0,0,0]/3: +((i>=52)&&(i<56))?[112,0,180]+(i-52)*[0,0,0]/3: +((i>=56)&&(i<60))?[84,0,164]+(i-56)*[0,0,0]/3: +((i>=60)&&(i<64))?[56,0,152]+(i-60)*[0,0,0]/3: +((i>=64)&&(i<68))?[28,0,136]+(i-64)*[0,0,0]/3: +((i>=68)&&(i<72))?[0,0,124]+(i-68)*[0,0,0]/3: +((i>=72)&&(i<76))?[0,28,136]+(i-72)*[0,0,0]/3: +((i>=76)&&(i<80))?[0,56,152]+(i-76)*[0,0,0]/3: +((i>=80)&&(i<84))?[0,84,164]+(i-80)*[0,0,0]/3: +((i>=84)&&(i<88))?[0,112,180]+(i-84)*[0,0,0]/3: +((i>=88)&&(i<92))?[0,140,192]+(i-88)*[0,0,0]/3: +((i>=92)&&(i<96))?[0,168,208]+(i-92)*[0,0,0]/3: +((i>=96)&&(i<100))?[0,196,220]+(i-96)*[0,0,0]/3: +((i>=100)&&(i<104))?[0,224,236]+(i-100)*[0,0,0]/3: +((i>=104)&&(i<108))?[0,252,252]+(i-104)*[0,0,0]/3: +((i>=108)&&(i<112))?[0,236,224]+(i-108)*[0,0,0]/3: +((i>=112)&&(i<116))?[0,220,196]+(i-112)*[0,0,0]/3: +((i>=116)&&(i<132))?[92,92,92]+(i-116)*[12,12,12]/15: +((i>=132)&&(i<144))?[112,112,112]+(i-132)*[8,8,8]/11: +((i>=144)&&(i<156))?[128,128,128]+(i-144)*[8,8,8]/11: +((i>=156)&&(i<168))?[144,144,144]+(i-156)*[8,8,8]/11: +((i>=168)&&(i<180))?[160,160,160]+(i-168)*[8,8,8]/11: +((i>=180)&&(i<184))?[176,176,176]+(i-180)*[0,0,0]/3: +((i>=184)&&(i<188))?[184,184,184]+(i-184)*[0,0,0]/3: +((i>=188)&&(i<192))?[192,192,192]+(i-188)*[0,0,0]/3: +((i>=192)&&(i<196))?[200,200,200]+(i-192)*[0,0,0]/3: +((i>=196)&&(i<200))?[208,208,208]+(i-196)*[0,0,0]/3: +((i>=200)&&(i<202))?[216,216,216]+(i-200)*[0,0,0]/1: +((i>=202)&&(i<215))?[60,0,0]+(i-202)*[195,60,60]/12: +((i>=215)&&(i<226))?[255,71,71]+(i-215)*[0,119,119]/10: +((i>=226)&&(i<246))?[101,0,101]+(i-226)*[121,201,121]/19: +((i>=246)&&(i<256))?[0,0,0]+(i-246)*[0,0,0]/9" +elif $1==4 +f "((i>=0)&&(i<2))?[0,0,0]+(i-0)*[0,0,0]/1: +((i>=2)&&(i<26))?[235,0,0]+(i-2)*[-235,0,0]/23: +((i>=26)&&(i<51))?[0,0,0]+(i-26)*[0,0,0]/24: +((i>=51)&&(i<62))?[12,12,12]+(i-51)*[3,3,3]/10: +((i>=62)&&(i<68))?[23,23,23]+(i-62)*[38,38,38]/5: +((i>=68)&&(i<69))?[75,75,75]+(i-68)*[0,0,0]/0: +((i>=69)&&(i<81))?[76,76,76]+(i-69)*[84,84,84]/11: +((i>=81)&&(i<111))?[161,161,161]+(i-81)*[79,79,79]/29: +((i>=111)&&(i<131))?[226,226,226]+(i-111)*[14,14,14]/19: +((i>=131)&&(i<171))?[160,255,255]+(i-131)*[-40,-135,-135]/39: +((i>=171)&&(i<256))?[50,50,150]+(i-171)*[50,50,70]/84" +elif $1==5 +f "((i>=0)&&(i<151))?[255,255,255]+(i-0)*[-255,-255,-255]/150: +((i>=151)&&(i<256))?[0,0,0]+(i-151)*[0,0,0]/104" +elif $1==6 +f "((i>=0)&&(i<13))?[255,255,255]+(i-0)*[-24,-24,-24]/12: +((i>=13)&&(i<126))?[228,228,228]+(i-13)*[-228,-228,-228]/112: +((i>=126)&&(i<256))?[0,0,0]+(i-126)*[0,0,0]/129" +elif $1==7 +f "((i>=0)&&(i<42))?[255,255,255]+(i-0)*[0,0,0]/41: +((i>=42)&&(i<191))?[253,253,253]+(i-42)*[-253,-253,-253]/148: +((i>=191)&&(i<256))?[0,0,0]+(i-191)*[0,0,0]/64" +elif $1==8 +f "((i>=0)&&(i<4))?[0,0,0]+(i-0)*[0,0,0]/3: +((i>=4)&&(i<8))?[28,0,28]+(i-4)*[0,0,0]/3: +((i>=8)&&(i<12))?[60,0,60]+(i-8)*[0,0,0]/3: +((i>=12)&&(i<16))?[92,0,92]+(i-12)*[0,0,0]/3: +((i>=16)&&(i<20))?[124,0,124]+(i-16)*[0,0,0]/3: +((i>=20)&&(i<24))?[156,0,156]+(i-20)*[0,0,0]/3: +((i>=24)&&(i<28))?[188,0,188]+(i-24)*[0,0,0]/3: +((i>=28)&&(i<32))?[220,0,220]+(i-28)*[0,0,0]/3: +((i>=32)&&(i<36))?[252,0,252]+(i-32)*[0,0,0]/3: +((i>=36)&&(i<40))?[224,0,236]+(i-36)*[0,0,0]/3: +((i>=40)&&(i<44))?[196,0,220]+(i-40)*[0,0,0]/3: +((i>=44)&&(i<48))?[168,0,208]+(i-44)*[0,0,0]/3: +((i>=48)&&(i<52))?[140,0,192]+(i-48)*[0,0,0]/3: +((i>=52)&&(i<56))?[112,0,180]+(i-52)*[0,0,0]/3: +((i>=56)&&(i<60))?[84,0,164]+(i-56)*[0,0,0]/3: +((i>=60)&&(i<64))?[56,0,152]+(i-60)*[0,0,0]/3: +((i>=64)&&(i<68))?[28,0,136]+(i-64)*[0,0,0]/3: +((i>=68)&&(i<72))?[0,0,124]+(i-68)*[0,0,0]/3: +((i>=72)&&(i<76))?[0,28,136]+(i-72)*[0,0,0]/3: +((i>=76)&&(i<80))?[0,56,152]+(i-76)*[0,0,0]/3: +((i>=80)&&(i<84))?[0,84,164]+(i-80)*[0,0,0]/3: +((i>=84)&&(i<88))?[0,112,180]+(i-84)*[0,0,0]/3: +((i>=88)&&(i<92))?[0,140,192]+(i-88)*[0,0,0]/3: +((i>=92)&&(i<96))?[0,168,208]+(i-92)*[0,0,0]/3: +((i>=96)&&(i<100))?[0,196,220]+(i-96)*[0,0,0]/3: +((i>=100)&&(i<104))?[0,224,236]+(i-100)*[0,0,0]/3: +((i>=104)&&(i<108))?[0,252,252]+(i-104)*[0,0,0]/3: +((i>=108)&&(i<112))?[0,236,224]+(i-108)*[0,0,0]/3: +((i>=112)&&(i<116))?[0,220,196]+(i-112)*[0,0,0]/3: +((i>=116)&&(i<120))?[0,208,168]+(i-116)*[0,0,0]/3: +((i>=120)&&(i<124))?[0,192,140]+(i-120)*[0,0,0]/3: +((i>=124)&&(i<128))?[0,180,112]+(i-124)*[0,0,0]/3: +((i>=128)&&(i<132))?[0,164,84]+(i-128)*[0,0,0]/3: +((i>=132)&&(i<136))?[0,152,56]+(i-132)*[0,0,0]/3: +((i>=136)&&(i<140))?[0,136,28]+(i-136)*[0,0,0]/3: +((i>=140)&&(i<144))?[0,124,0]+(i-140)*[0,0,0]/3: +((i>=144)&&(i<148))?[28,136,0]+(i-144)*[0,0,0]/3: +((i>=148)&&(i<152))?[56,152,0]+(i-148)*[0,0,0]/3: +((i>=152)&&(i<156))?[84,164,0]+(i-152)*[0,0,0]/3: +((i>=156)&&(i<160))?[112,180,0]+(i-156)*[0,0,0]/3: +((i>=160)&&(i<164))?[140,192,0]+(i-160)*[0,0,0]/3: +((i>=164)&&(i<168))?[168,208,0]+(i-164)*[0,0,0]/3: +((i>=168)&&(i<172))?[196,220,0]+(i-168)*[0,0,0]/3: +((i>=172)&&(i<176))?[224,236,0]+(i-172)*[0,0,0]/3: +((i>=176)&&(i<180))?[252,252,0]+(i-176)*[0,0,0]/3: +((i>=180)&&(i<184))?[236,224,0]+(i-180)*[0,0,0]/3: +((i>=184)&&(i<188))?[220,196,0]+(i-184)*[0,0,0]/3: +((i>=188)&&(i<192))?[208,168,0]+(i-188)*[0,0,0]/3: +((i>=192)&&(i<196))?[192,140,0]+(i-192)*[0,0,0]/3: +((i>=196)&&(i<200))?[180,112,0]+(i-196)*[0,0,0]/3: +((i>=200)&&(i<204))?[164,84,0]+(i-200)*[0,0,0]/3: +((i>=204)&&(i<208))?[152,56,0]+(i-204)*[0,0,0]/3: +((i>=208)&&(i<212))?[136,28,0]+(i-208)*[0,0,0]/3: +((i>=212)&&(i<216))?[124,0,0]+(i-212)*[0,0,0]/3: +((i>=216)&&(i<220))?[160,0,0]+(i-216)*[0,0,0]/3: +((i>=220)&&(i<224))?[192,0,0]+(i-220)*[0,0,0]/3: +((i>=224)&&(i<228))?[216,0,0]+(i-224)*[0,0,0]/3: +((i>=228)&&(i<232))?[252,0,0]+(i-228)*[0,0,0]/3: +((i>=232)&&(i<236))?[252,252,252]+(i-232)*[0,0,0]/3: +((i>=236)&&(i<256))?[0,0,0]+(i-236)*[255,255,255]/19" +elif $1==9 +f "((i>=0)&&(i<61))?[0,0,0]+(i-0)*[120,120,120]/60: +((i>=61)&&(i<91))?[3,3,3]+(i-61)*[87,87,87]/29: +((i>=91)&&(i<101))?[91,91,91]+(i-91)*[9,9,9]/9: +((i>=101)&&(i<145))?[103,103,103]+(i-101)*[145,145,145]/43: +((i>=145)&&(i<155))?[250,250,250]+(i-145)*[-59,-250,5]/9: +((i>=155)&&(i<171))?[191,0,255]+(i-155)*[-191,0,0]/15: +((i>=171)&&(i<191))?[0,12,242]+(i-171)*[0,243,-242]/19: +((i>=191)&&(i<201))?[25,255,0]+(i-191)*[230,0,0]/9: +((i>=201)&&(i<211))?[255,229,0]+(i-201)*[0,-229,0]/9: +((i>=211)&&(i<221))?[229,0,0]+(i-211)*[-229,0,0]/9: +((i>=221)&&(i<246))?[20,20,20]+(i-221)*[235,235,235]/24: +((i>=246)&&(i<256))?[255,255,255]+(i-246)*[0,0,0]/9" +elif $1==10 +f "((i>=0)&&(i<130))?[0,0,0]+(i-0)*[0,0,0]/129: +((i>=130)&&(i<165))?[255,160,90]+(i-130)*[-255,-160,-90]/34: +((i>=165)&&(i<183))?[0,0,0]+(i-165)*[255,255,255]/17: +((i>=183)&&(i<198))?[255,255,255]+(i-183)*[-255,-175,-125]/14: +((i>=198)&&(i<206))?[0,80,130]+(i-198)*[0,70,20]/7: +((i>=206)&&(i<214))?[160,150,0]+(i-206)*[90,-100,0]/7: +((i>=214)&&(i<222))?[150,0,220]+(i-214)*[100,0,0]/7: +((i>=222)&&(i<230))?[0,0,226]+(i-222)*[0,0,-92]/7: +((i>=230)&&(i<256))?[255,255,255]+(i-230)*[0,0,0]/25" +elif $1==11 +f "((i>=0)&&(i<110))?[0,0,0]+(i-0)*[0,0,0]/109: +((i>=110)&&(i<142))?[255,0,0]+(i-110)*[0,251,3]/31: +((i>=142)&&(i<172))?[247,243,8]+(i-142)*[-244,-243,158]/29: +((i>=172)&&(i<192))?[15,12,170]+(i-172)*[240,243,85]/19: +((i>=192)&&(i<219))?[246,250,246]+(i-192)*[-245,-143,-245]/26: +((i>=219)&&(i<255))?[1,110,7]+(i-219)*[3,137,241]/35: +((i>=255)&&(i<256))?[255,255,255]" +elif $1==12 +f "((i>=0)&&(i<154))?[0,0,0]+(i-0)*[255,255,255]/153: +((i>=154)&&(i<174))?[0,255,255]+(i-154)*[0,-255,-140]/19: +((i>=174)&&(i<187))?[0,0,115]+(i-174)*[0,255,-115]/12: +((i>=187)&&(i<197))?[0,255,0]+(i-187)*[255,0,0]/9: +((i>=197)&&(i<207))?[255,255,0]+(i-197)*[0,-255,0]/9: +((i>=207)&&(i<216))?[255,0,0]+(i-207)*[-255,0,0]/8: +((i>=216)&&(i<225))?[0,0,0]+(i-216)*[230,230,230]/8: +((i>=225)&&(i<237))?[242,114,195]+(i-225)*[-115,-114,-68]/11: +((i>=237)&&(i<256))?[255,255,0]+(i-237)*[0,0,255]/18" +elif $1==13 +f "((i>=0)&&(i<154))?[0,0,0]+(i-0)*[255,255,255]/153: +((i>=154)&&(i<174))?[0,255,255]+(i-154)*[0,-255,-140]/19: +((i>=174)&&(i<187))?[0,0,115]+(i-174)*[0,255,-115]/12: +((i>=187)&&(i<197))?[0,255,0]+(i-187)*[255,0,0]/9: +((i>=197)&&(i<207))?[255,255,0]+(i-197)*[0,-255,0]/9: +((i>=207)&&(i<216))?[255,0,0]+(i-207)*[-255,0,0]/8: +((i>=216)&&(i<225))?[0,0,0]+(i-216)*[230,230,230]/8: +((i>=225)&&(i<237))?[242,114,195]+(i-225)*[-115,-114,-68]/11: +((i>=237)&&(i<255))?[255,255,0]+(i-237)*[-128,-220,35]/17: +((i>=255)&&(i<256))?[255,255,255]" +elif $1==14 +f "((i>=0)&&(i<154))?[0,0,0]+(i-0)*[255,255,255]/153: +((i>=154)&&(i<174))?[0,255,255]+(i-154)*[0,-255,-140]/19: +((i>=174)&&(i<187))?[0,0,115]+(i-174)*[0,255,-115]/12: +((i>=187)&&(i<197))?[0,255,0]+(i-187)*[255,0,0]/9: +((i>=197)&&(i<207))?[255,255,0]+(i-197)*[0,-255,0]/9: +((i>=207)&&(i<216))?[255,0,0]+(i-207)*[-255,0,0]/8: +((i>=216)&&(i<225))?[0,0,0]+(i-216)*[230,230,230]/8: +((i>=225)&&(i<237))?[242,114,195]+(i-225)*[-115,-114,-68]/11: +((i>=237)&&(i<255))?[255,255,0]+(i-237)*[-255,-255,0]/17: +((i>=255)&&(i<256))?[255,255,255]" +elif $1==15 +f "((i>=0)&&(i<154))?[0,0,0]+(i-0)*[0,255,255]/153: +((i>=154)&&(i<174))?[0,255,255]+(i-154)*[0,-255,-140]/19: +((i>=174)&&(i<187))?[0,0,115]+(i-174)*[0,255,-115]/12: +((i>=187)&&(i<197))?[0,255,0]+(i-187)*[255,0,0]/9: +((i>=197)&&(i<207))?[255,255,0]+(i-197)*[0,-255,0]/9: +((i>=207)&&(i<216))?[255,0,0]+(i-207)*[-255,0,0]/8: +((i>=216)&&(i<225))?[0,0,0]+(i-216)*[230,230,230]/8: +((i>=225)&&(i<237))?[242,114,195]+(i-225)*[-115,-114,-68]/11: +((i>=237)&&(i<256))?[255,255,0]+(i-237)*[0,0,255]/18" +elif $1==16 +f "((i>=0)&&(i<154))?[0,0,0]+(i-0)*[0,255,255]/153: +((i>=154)&&(i<174))?[0,255,255]+(i-154)*[0,-255,-140]/19: +((i>=174)&&(i<187))?[0,0,115]+(i-174)*[0,255,-115]/12: +((i>=187)&&(i<197))?[0,255,0]+(i-187)*[255,0,0]/9: +((i>=197)&&(i<207))?[255,255,0]+(i-197)*[0,-255,0]/9: +((i>=207)&&(i<216))?[255,0,0]+(i-207)*[-255,0,0]/8: +((i>=216)&&(i<225))?[0,0,0]+(i-216)*[230,230,230]/8: +((i>=225)&&(i<237))?[242,114,195]+(i-225)*[-115,-114,-68]/11: +((i>=237)&&(i<255))?[255,255,0]+(i-237)*[-128,-220,35]/17: +((i>=255)&&(i<256))?[255,255,255]" +elif $1==17 +f "((i>=0)&&(i<154))?[0,0,0]+(i-0)*[0,255,255]/153: +((i>=154)&&(i<174))?[0,255,255]+(i-154)*[0,-255,-140]/19: +((i>=174)&&(i<187))?[0,0,115]+(i-174)*[0,255,-115]/12: +((i>=187)&&(i<197))?[0,255,0]+(i-187)*[255,0,0]/9: +((i>=197)&&(i<207))?[255,255,0]+(i-197)*[0,-255,0]/9: +((i>=207)&&(i<216))?[255,0,0]+(i-207)*[-255,0,0]/8: +((i>=216)&&(i<225))?[0,0,0]+(i-216)*[230,230,230]/8: +((i>=225)&&(i<237))?[242,114,195]+(i-225)*[-115,-114,-68]/11: +((i>=237)&&(i<255))?[255,255,0]+(i-237)*[-255,-255,0]/17: +((i>=255)&&(i<256))?[255,255,255]" +fi +if $8 rgb2srgb fi +done +f[^-1] "I[#-1,i]" +rm. +fx_satellite_preview : +if $9 +rm 256,256,1,1,"x" fx_satellite $* +else +gui_split_preview "fx_satellite $*",${-3--1} +fi +jr_dir2rgb : +v - channels 0,1 repeat $! l[$>] nm={0,n} +s c complex2polar round.. 0.001 +*. {180/pi} %. 360 100%,100%,1,1,1 mv... $! +c 0,360 if im!=iM n. 0,1 else f. 1 fi +a c hsv2rgb +nm $nm done done v + +jr_gradient_norm : +b $1 gradient_norm replace_inf 1 replace_nan 0 ^ $2 +c $3%,$4% +if $5 negate fi +n 0,255 +fx_jr_gradient_norm : +repeat $! l[$>] +if $9==3 +inter=5 +else +inter={1+$9} +fi +if $7!=1||$8!=1 +ww={w} +hh={h} +shift -0.5,-0.5,0,0,1 +r {max(1,$7*w)},{max(1,$8*h)},100%,100%,$inter +fi +if $6 ++l luminance gradient append c +blur $1 orientation +jr_dir2rgb +done rm[1] +if $5 +l[1] +rgb2hsv8 100%,100%,1,1 f[1] "j(#0,0,0,0,2)" f[0] "[i0,i1,255]" hsv82rgb[0] a c +if $6==2 +fx_solidify_td 100,0,10,2,0 +fi +rgb2hsv8 f "[i0,i1,255]" hsv82rgb +done +fi +fi +jr_gradient_norm[0] ${1-5} +if $7!=1||$8!=1 +r $ww,$hh,100%,100%,$inter +fi +if $6 blend multiply fi +if $6==1 c 0,255 f "I==[255,255,255]?[0,0,0]:I" fi +if $10 rgb2hsv8 100%,100%,1,1 if $6 [1] f[2] "j(#0,0,0,0,1)" f[0] "[i0,255,i2]" fi f[1] "j(#0,0,0,0,2)" f[0] "[i0,i1,255]" hsv82rgb[0] if $6 blend[1,2] multiply fi a c fi +done done +fx_jr_gradient_norm_preview : +gui_split_preview "fx_jr_gradient_norm $*",${-3--1} +fx_auto_gnarl: +repeat $! l[$>] ++fx_jr_gradient_norm ${1-5},0,${6-8},0 +100%,100%,1,2 f. "u(-1,1)" +b. $14 +normalize_local. ${9-13},-1,1 +n. -1,1 +*. .. rm.. *. {1/255} round. {$15^4} +*. {$16^3} +warp.. .,1,$17,$18 +rm. +done done +fx_auto_gnarl_preview: +fx_auto_gnarl $* +#@cli symmetrize_jr : _x[%],_y[%],_angle,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror },_is_antisymmetry={ 0 | 1 },_swap_sides={ 0 | 1 },_interpolation={ 0=none | 1=linear | 2=bicubic } +#@cli : Symmetrize selected images regarding specified axis. +#@cli : Default values: 'x=y=50%', 'angle=90', 'boundary_conditions=3', 'is_antisymmetry=0', 'swap_sides=0' and 'interpolation=1'. +#@cli : $ image.jpg +symmetrize 50%,50%,45 +symmetrize[-1] 50%,50%,-45 +symmetrize_jr : skip ${1=50%},${2=50%},${3=90},${4=3},${5=0},${6=0},${7=1} +e[^-1] "Symmetrize image$?, regarding axis ($1,$2,$3 deg.)." +v - +theta={$3*pi/180} u={cos($theta)} v={sin($theta)} +if $6 symmetry_cond=A<0 else symmetry_cond=A>0 fi +repeat $! l[$>] +x0={if(${is_percent\ $1},w*$1,$1)} +y0={if(${is_percent\ $2},h*$2,$2)} +if $5 f 'A=($y0-y)*$u-($x0-x)*$v;X=x+2*($x0-x);Y=y+2*($y0-y);if($symmetry_cond,i(X,Y,z,c,$7,$4),i)' +else f 'A=($y0-y)*$u-($x0-x)*$v;X=x-2*$v*A;Y=y+2*$u*A;if($symmetry_cond,i(X,Y,z,c,$7,$4),i)' +fi +done done +#@cli jr_deform : _amplitude>=0,_interpolation,_matrix_density[%]>=0,_matrix_interpolation,_mode,-100<=_character<=100,_boundary +#@cli : Apply random smooth deformation on selected images. An upgrade to the existing deform command. +#@cli : 'interpolation' can be { 0=none | 1=linear | 2=bicubic }. +#@cli : 'matrix_interpolation' can be { 0=linear | 1=bicubic }. +#@cli : 'mode' can be { 0=noise | 1=spread_noise }. +#@cli : 'boundary' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default value: 'amplitude=10'. +#@cli : $ image.jpg +deform[0] 10 +deform[0] 20 +jr_deform : skip ${1=10},${2=1},${3=2%},${4=1},${5=0},${6=0},${7=1} +e[^-1] "Apply random smooth deformation on image$?, with amplitude $1." +v - repeat $! l[$>] +R={max(1,${"is_percent $3"}?$3*max(w,h):$3)} +P={$4==0?3:5} +if $5==1 +r. {$R},{$R},1,4 spread. {max(w,h)*($6+100)/200},{max(w,h)*($6+100)/200} +else {$R},{$R},1,4 noise. $1 +fi +ac. "adjust_colors 0,$6,0,0,0",rgba r. ..,..,1,4,$P warp.. .,1,$2,$7 rm. +done done v + +_fx_buffer_destroyer : +repeat $! l[$>] +to_rgba split_opacity +if $1 a c fi +l[0] +ow={w} +oh={h} +dimx1={int($2/100*w)} +dimy1={int($3/100*h)} +cs1={$4/100*wh} +cl1={$5/100*wh} +shift1={$6/100*$cl1} +bound1=$7 +crit={1+$16} +_fx_virtual_buffer_resize {$dimx1*$dimy1},1,$cs1,$cl1,$shift1,$bound1 +_fx_shredder $8,$9,$1,${10-12},0,0,0,0,0 +$dimx1,$dimy1,100%,100% +f. ">begin(index=-1);index+=1;I[#0,index]" +k. +_fx_pixelsort ${13-15},{$crit},${17-21} +_fx_shifter $22,$1,{(($23/10)^3)*10},$24,{(($25/10)^3)*10},${26-29} +if $30 +_fx_virtual_buffer_resize $ow,$oh,0,{wh},{-$shift1},$bound1 +else +dimx2={int($31/100*w)} +dimy2={int($32/100*h)} +cs2={$33/100*wh} +cl2={$34/100*wh} +shift2={$35/100*$cl2} +bound2=$36 +_fx_virtual_buffer_resize $dimx2,$dimy2,$cs2,$cl2,$shift2,$bound2 +fi +done a c +done done +fx_buffer_destroyer: +_fx_buffer_destroyer ${2-37} +fx_buffer_destroyer_preview : +gui_split_preview "fx_buffer_destroyer $*",${-3--1} +_fx_virtual_buffer : +r {wh},1,100%,100%,-1,0 +_fx_virtual_buffer_resize : +owh={int(wh)} +dimx={max(1,int($1))} +dimy={max(1,int($2))} +cs={int($3)} +cl={int($4)} +shift={int($5)} +bound=$6 +_fx_virtual_buffer shift {-$cs},0,0,0,2 crop 0,$cl,2 shift {$shift},0,0,0,2 if $bound resize {$dimx*$dimy},1,100%,100%,0,2 fi +$dimx,$dimy,100%,100% +f. ">begin(index=-1);index+=1;I[#0,index]" +k. +fx_buffer_error : +repeat $! l[$>] +dimx={int($1/100*w)} +dimy={int($2/100*h)} +cs={$3/100*wh} +cl={$4/100*wh} +shift={$5/100*$cl} +bound=$6 +_fx_virtual_buffer_resize $dimx,$dimy,$cs,$cl,$shift,$bound +done done +fx_buffer_error_preview : +gui_split_preview "fx_buffer_error $*",${-3--1} +fx_jr_klc: +num=$1 +mrot={$2/180*pi} +rrot={$4/180*pi} +if $5 rrot/={max($num,1)} fi +if !$3 rrot-=$mrot fi +symm=$10 +lcd=$11 +lcmode=$13 +if $lcmode==1 +lcang={$12/(180*$lcd)*pi} +elif $lcmode==2 +lcang={$12/(180*(max($num,1)))*pi} +elif $lcmode==3 +lcang={$12/(180*$lcd*(max($num,1)))*pi} +else +lcang={$12/180*pi} +fi +scale=$14*0.01 +aa=$15*0.25 +inter=$16 +bound=$17 +repeat $! l[$>] +ox=$6*w*0.01 +oy=$7*h*0.01 +cx=$8*w*0.01 +cy=$9*h*0.01 +f "begin(const num="$num";const cx="$cx";const cy="$cy";const ox="$ox";const oy="$oy";const aa="$aa";const rrot="$rrot"; +num==0?(const awidth=8*pi;const mrot=0;const symm=1):(const awidth=pi/num;const mrot="$mrot";const symm="$symm");const interpolation="$inter";const boundary="$bound";const scale="$scale";const lcd="$lcd"; +lcd==0?(const ilcang="$lcang"):(const ilcang="$lcang");const diag=sqrt(w^2+h^2)); +vx=x-cx;vy=y-cy; +iang=atan2(vy,vx)-rrot-mrot; +irad=norm(vx,vy); +lnum=max((irad/diag*2-(4*aa/diag))*lcd*scale,0); +lnumint=floor(lnum); +ang=iang-(((lcd==0?(irad/diag*2-(4*aa/diag))*scale:(lnumint))+[0,1])*ilcang); +mult=ang/awidth - 1; +multint=floor(mult); +multintaa = floor(mult+min((aa*0.5*num)/(irad),irad*0.5/(pi*num))); +kfunc=[min(((mult[0]-multintaa[0])*irad/(aa*num)+0.5),1),min(((mult[1]-multintaa[1])*irad/(aa*num)+0.5),1)]; +lcfunc=min((lnumint+1-lnum)/(aa*(lcd==0?(abs(ilcang)):(lcd))*scale)*diag*0.125,1); +angle0=ang-multintaa*awidth; +angle1=ang-(multintaa+1)*awidth; +for(i=0,i<2,i++, +symm==1?(angle1[i]=angle1[i]):symm==2?(angle0[i]=awidth-angle0[i];angle1[i]=awidth-angle1[i]): +((multint[i]%2==1)?(multintaa[i]>multint[i]?(angle1[i]=awidth-angle1[i]):(angle0[i]=awidth-angle0[i])):(multintaa[i]>multint[i]?(angle0[i]=awidth-angle0[i]):(angle1[i]=awidth-angle1[i]))); +isnan(kfunc[i])?kfunc[i]=1); +angle0+=mrot; +angle1+=mrot; +frad=irad*scale; +xwarp00=frad*cos(angle0[0])+ox; +ywarp00=frad*sin(angle0[0])+oy; +xwarp01=frad*cos(angle1[0])+ox; +ywarp01=frad*sin(angle1[0])+oy; +xwarp10=frad*cos(angle0[1])+ox; +ywarp10=frad*sin(angle0[1])+oy; +xwarp11=frad*cos(angle1[1])+ox; +ywarp11=frad*sin(angle1[1])+oy; +(I(xwarp00,ywarp00)*(1-kfunc[0])+I(xwarp01,ywarp01)*(kfunc[0]))*(lcfunc)+(I(xwarp10,ywarp10)*(1-kfunc[1])+I(xwarp11,ywarp11)*(kfunc[1]))*(1-lcfunc)" +done done +fx_jr_klc_preview: +fx_jr_klc $* +c 0,255 +fx_layer_cake : +repeat $! l[$>] +iter=$1 +angle=$2 +if $3 angle*=$iter fi +size=$4/2 +to_rgba split_opacity to_rgb +repeat 2 +part={1-$>} +l[$part] +repeat $iter +[0] rotate[-1] {$angle/$iter*($>+1)},$8,$7,$5%,$6% +100%,100%,1,1 ellipse. $5%,$6%,{$size/$iter*($iter-$>)}%,{$size/$iter*($iter-$>)}%,0,1,255 +if $13!=2 ellipse. $5%,$6%,{$size/$iter*($iter-1-$>)}%,{$size/$iter*($iter-1-$>)}%,0,1,1 fi +blur. {$9/$iter} +fx_smooth_antialias. ${10-12} +blend[-1,-2] multiply +done +if !$13 blend[^0] add fi +if $13!=2 100%,100%,1,1 fc. 255,255,255 ellipse. $5%,$6%,{$size}%,{$size}%,0,1,0 +blur. {$9/$iter} +fx_smooth_antialias. ${9-11} +blend[-1,0] multiply fi +if !$13 blend add fi +if $part to_gray fi +done +done +list={int($!/2)} +repeat $list a[$>,$list] c done +skip {$13==0} +if $13 rv fi +done +done +fx_layer_cake_preview: +if !$13 gui_split_preview "fx_layer_cake $*",${-3--1} else fx_layer_cake ${1-12},0 fi +fx_layer_cake_2 : +num=$1 +inter=$6 +bound=$7 +if $3 +ang={$2*2*pi/360} +else +ang={$2*2*pi/(($num)*360)} +fi +repeat $! l[$>] +xc=$4% +yc=$5% +if $9 +aa={$8*norm(w,h)/100} +else +aa={$8/25*$num} +fi +if $10 +to_rgba +100%,100%,100%,100%,(0) +repeat ceil($num*(1+max(norm(w/2-$xc,h/2-$yc)/norm(w,h)*2,1))) +[1] +done +inuma=0 +inumb=0 +eval[0] "begin(ang=("$ang");xoff=w*"$xc";yoff=h*"$yc";num="$num";aa="$aa";inter="$inter";bound="$bound"); +vx=x-xoff+0.5;vy=y-yoff+0.5; +lnum=max((norm(vx,vy))/norm(w,h)*2*num-(0.5*aa/norm(w,h)),0); +lnumint=floor(lnum); +run("inuma=lnumint+1 +inumb=lnumint+2"); +angle=((ang*lnumint)%(2*pi)); +pa=I(#0,vx*cos(angle)+vy*sin(angle)+xoff-0.5,vy*cos(angle)-vx*sin(angle)+yoff-0.5,z,inter,bound); +pb=I(#0,vx*cos(angle+ang)+vy*sin(angle+ang)+xoff-0.5,vy*cos(angle+ang)-vx*sin(angle+ang)+yoff-0.5,z,inter,bound); +func=min((lnumint+1-lnum)*norm(w,h)/aa,1); +I(#"$3")=(pb*(1-func)); +I(#"{$3+2}")=(pa*(func)) +" +else +f "begin(ang=("$ang");xoff=w*"$xc";yoff=h*"$yc";num="$num";aa="$aa";inter="$inter";bound="$bound"); +vx=x-xoff+0.5;vy=y-yoff+0.5; +lnum=max((norm(vx,vy))/norm(w,h)*2*num-(0.5*aa/norm(w,h)),0); +lnumint=floor(lnum); +angle=((ang*lnumint)%(2*pi)); +pa=I(vx*cos(angle)+vy*sin(angle)+xoff-0.5,vy*cos(angle)-vx*sin(angle)+yoff-0.5,z,inter,bound); +angle+=ang; +pb=I(vx*cos(angle)+vy*sin(angle)+xoff-0.5,vy*cos(angle)-vx*sin(angle)+yoff-0.5,z,inter,bound); +func=min((lnumint+1-lnum)*norm(w,h)/aa,1); +I=(pa*(func)+pb*(1-func))" +fi +done done +fx_layer_cake_2_preview : +fx_layer_cake_2 $* +fx_powertwirl: +if $8 +f "begin(amp=$1;offset=$2;xoff=$3*w/100;yoff=$4*h/100;power=$5;interpolation=$6;boundary=$7); +vx=x-xoff+0.5;vy=y-yoff+0.5; +ang=(2*pi*((offset/360)+(amp*((norm(vx,vy)/(norm(w,h)/2))^power))))%(2*pi); +I=I(vx*cos(ang)+vy*sin(ang)+xoff-0.5,vy*cos(ang)-vx*sin(ang)+yoff-0.5,z,interpolation,boundary)" +else +euclidean2polar $3%,$4%,$6,$7 repeat $! +[$>],[$>],1,1,$1*0.75*(((x/w)^$5))*w channels. -1,0 warp[$>] .,1,1,2 rm. +done polar2euclidean $3%,$4%,$6,$7 +fi +fx_powertwirl_preview: +fx_powertwirl $* +fx_jr_deform : +repeat $! l[$>] +jr_deform ${2-8} +done done +fx_jr_deform_preview : +gui_split_preview "fx_jr_deform $*",${-3--1} +rays_from_image: +fx_transform_polar 0,$2,$3,"(R-a)*(4^(($1)-5))*$1/5","a",3 +fx_rays_from_image: +repeat max(0,l) +ac[$>] "rays_from_image $*",$-2,$-1 +done +_fx_shifter: +repeat $! l[$>] +to_rgba split_opacity +if $2 a c fi +l[0] +if $1 +csswap 0,{$1-1} s c +fi +repeat $! l[$>] +100%,100%,1,3 [1] fc[1,2] 0 +rectexture[1] $4,0,$7,$8,2,0 +rectexture[2] $6,0,$7,$8,2,0 +to_gray[^0] +f[1] "$3*510*(0.25-abs(0.5-i/255))" +f[2] "$5*510*(0.25-abs(0.5-i/255))" +a[^0] c +if $9==0 +f={u(0,3)} +elif $9==1 +f={u(0,2)+1} +else +f={($9)-2} +fi +warp.. .,1,0,{int($f)} +rm. +done done +done +a c +if $1 +csswap {$1-1},0 +fi +done done +fx_shifter: +_fx_shifter ${2-10} +fx_shifter_preview: +gui_split_preview "fx_shifter $*",${-3--1} +fx_jr_spiral_transform: +repeat $! l[$>] +if $4 permute yxzc fi +spiralbw {[w,h]},0 +if $2 mirror[1] x fi +if $3 mirror[1] y fi +if $5 f[1] "iM-i" fi +[0] +if $1 +f[2] "I(#0,i0#1%w,floor(i0#1/w),0)=I" +else +f[0] "I(i#1%w,floor(i#1/w))" +fi +k[0] +if $4 permute yxzc fi +done done +fx_jr_spiral_transform_preview: +fx_jr_spiral_transform $* +ultrawarptwo : +repeat $! l[$>] to_rgba split_opacity +iter=$1 +sc=$2 +xfc=$3 +xfr=$4 +yfc=$5 +yfr=$6 +xoffc=$7 +xoffr=$8 +yoffc=$9 +yoffr=$10 +corr=$11 +inter=$12 +bound=$13 +chann=$14 +alpha=$15 +cs=$16 +rn=$17 +rpo=$18 +vil=$19 +hfc=$20 +hfr=$21 +sfc=$22 +sfr=$23 +vilfc=$24 +vilfr=$25 +afc=$26 +afr=$27 +hoffc=$28 +hoffr=$29 +soffc=$30 +soffr=$31 +viloffc=$32 +viloffr=$33 +aoffc=$34 +aoffr=$35 +repeat $iter +if $alpha +opacity=2 +else +opacity=1 +fi +repeat $opacity +if $sc==0 +frgbt={floor(u(0,25))} +else +frgbt={$sc-1} +fi +if $cs==0 +trgbf={floor(u(0,25))} +else +trgbf={$cs-1} +fi +if $>==0 +csswap[$>] 0,$frgbt +fi +if $>==1||$chann!=0 +if $chann==1 +channel={floor(u(2,37))} +else +channel=$chann +fi +if $channel==0 +channels=0 +elif $channel>=2 +channels={$channel-1} +elif $channel>=6 +channels=$channel +else +channels={$channel-2} +fi +if $corr==2 +correl=round(u) +else +correl=$corr +fi +if $inter==2 +interp=round(u) +else +interp=$inter +fi +if $bound==4 +bounds={floor(u(4))} +elif $bound==5 +bounds={floor(u(3))+1} +else +bounds=$bound +fi +xf={($xfc+u(-$xfr,$xfr))} +yf={($yfc+u(-$yfr,$yfr))} +xoff={($xoffc+u(-$xoffr,$xoffr))} +yoff={($yoffc+u(-$yoffr,$yoffr))} +xff={sign($xf)*w*0.00002*(abs($xf)^2)} +yff={sign($yf)*h*0.00002*(abs($yf)^2)} +xofff={sign($xoff)*w*0.00002*(abs($xoff)^2)} +yofff={sign($yoff)*w*0.00002*(abs($yoff)^2)} +fx_warp_by_intensity[$>] $xff,$yff,$xofff,$yofff,$correl,$interp,$bounds,$channels,0 +fi +if $>==0 +csswap[$>] $trgbf,0 +fi +if $rn +if round(u) +negate[$>] +fi +fi +done +if $>==($iter-1)||$rpo +hf={$hfc+u(-$hfr,$hfr)} +sf={$sfc+u(-$sfr,$sfr)} +vilf={$vilfc+u(-$vilfr,$vilfr)} +af={$afc+u(-$afr,$afr)} +hoff={$hoffc+u(-$hoffr,$hoffr)} +soff={$soffc+u(-$soffr,$soffr)} +viloff={$viloffc+u(-$viloffr,$viloffr)} +aoff={$aoffc+u(-$aoffr,$aoffr)} +l[0] if $vil==1 rgb2hsi8 elif $vil==2 rgb2hsl8 else rgb2hsv8 fi +s c +*[0] $hf +[0] {$hoff*max(1,abs($hf))} %[0] 255 +*[1] $sf +[1] {$soff*max(1,abs($sf))} +*[2] $vilf +[2] {$viloff*max(1,abs($vilf))} +a c +if $vil==1 hsi82rgb elif $vil==2 hsl82rgb else hsv82rgb fi +done +*[1] $af +[1] {$aoff*max(1,abs($af))} +fi +done +to_rgb[0] +to_gray[1] +a c +done +done +fx_ultrawarptwo : +ultrawarptwo ${2--1} +fx_ultrawarptwo_preview: +fx_ultrawarptwo $* +ultrawarp4plus: +hue_min={$30} +hue_max={$31} +sat_min={$32} +sat_max={$33} +val_min={$34} +val_max={$35} +j={min($hue_min,$hue_max)+(u*(max($hue_min,$hue_max)-min($hue_min,$hue_max)))} +k={min($sat_min,$sat_max)+(u*(max($sat_min,$sat_max)-min($sat_min,$sat_max)))} +l={min($val_min,$val_max)+(u*(max($val_min,$val_max)-min($val_min,$val_max)))} +if $1 +if $2 ch=0 else ch=2 fi +ac "rr={round(u*255)} +gg={round(u*255)} +bb={round(u*255)} +fx_plasma 0.5,0,{$2},1,1,{$rr},{$gg},{$bb} +if $3 to_rgba else ch=2 to_rgb fi",{$ch} fi +fx_gaussian_blur {$7},0,0,1,2,0,0 +n_min=$14 +n_max=$15 +if $n_min>$n_max +n_min=$n_min + $n_max +n_max=$n_min - $n_max +n_min=$n_min - $n_max +fi +noise_exp={max(0,$n_min+(u*($n_max-$n_min)))} +n_amt={(2^($noise_exp-3))*$noise_exp} +if $4 fx_segment_watershed {$5},{$6},0,2,0 fi +if $8 +p_min={$9} +p_max={$10} +h_min={$11} +h_max={$12} +if $p_min>$p_max +p_min=$p_min + $p_max +p_max=$p_min - $p_max +p_min=$p_min - $p_max +fi +if $h_min>$h_max +h_min=$h_min + $h_max +h_max=$h_min - $h_max +h_min=$h_min - $h_max +fi +ac "noise "$n_amt",$13",$16,1 +fx_quadtree 0,{max(2,round($p_min+(u*($p_max-$p_min))))},{max(0,round($h_min+(u*($h_max-$h_min))))},0,3,1.5,1,1,0 +fi +ac "noise "$n_amt",$13",$16,1 +f={$17} +i={$18} +m={$19} +s={$27} +v={$28} +repeat max(0,$f) +if $20 +scale_x=w/10 +a={((2^($18-5))*$18)*(u-0.5)*$scale_x*0.025} +else +scale_x=1 +a={((2^($18-5))*$18)*(u-0.5)} +fi +if $22 +scale_y=h/10 +b={((2^($18-5))*$18)*(u-0.5)*$scale_y*0.025} +else +scale_y=1 +b={((2^($18-5))*$18)*(u-0.5)} +fi +c=(u-0.5)*$m*sign($m)*$scale_x +d=(u-0.5)*$m*sign($m)*$scale_y +g={round((u*33.98)-0.49)} +h={u(-100,100)} +o={u(-100,100)} +if $22==1 +e=0 +elif $22==2 +e=1 +else +e={round(u)} +fi +if $23==0 +f={round((u*2.98)-0.49)} +elif $23==1 +f={round((u*2.98)+0.51)} +else +f={($23)-2} +fi +ac "_fx_warp_by_intensity "{$a}","{$b}","{$c}","{$d}","{$e}",0,"{$f}"",{$24},0 +if $25 +nn={round(u)} +if $nn +if $26==0 +nch={round((u*33.98)-0.49)} +ac "negate",{$nch} +else +ac "negate",{$26} +fi +fi +fi +fx_adjust_colors 0,0,{$h},{$o},0,0 +if $29 +ac "n 0,255",3 +fi +done +if $36==-180 +hh=((u-0.5)*360) +else +hh={$36} +fi +if $37==-8.01 +ss=((u-0.5)*2) +else +ss={$37} +fi +if $38==-20.01 +vv=((u-0.5)*2) +else +vv={$38} +fi +fx_mix_hsv {$j},{$hh},0,{$k},{$ss},0,{$l},{$vv},0,0,2,0 +if $-2 +ac "n 0,255",{$-1} +fi +fx_ultrawarp4plus: +repeat $! l[$>] +ac "ultrawarp4plus ${2--3}",$-2,$-1 +fx_adjust_colors 0,0,0,{(u-0.5)*200},0,0 +done done +fx_ultrawarp4plus_preview: +variablelist=${1--1} +fx_ultrawarp4plus $variablelist +fx_blur_bloom_glare : +op=${"arg 1+$4,+,max,min"} +if !$7 +ac "blur_bloom ${1-3},"$op",${5-6},xy",$11 +else +wh={[w,h]} +repeat $9 +ang={(180/$9)*($>)+$8} ++rotate[0] $ang,2,1 +ac. "blur_bloom ${1-3},"$op",${5-6},x",$11 +rotate. {-$ang},2,1 +r. $wh,1,100%,0,0,0.5,0.5 +c. 0,255 +done +repeat $9 +blend[0,-1] screen,$10 +done +fi +fx_blur_bloom_glare_preview : +gui_split_preview "fx_blur_bloom_glare $*",$-1 +_blend_bomb : +to_rgba +$1,$2,1,4 noise. 255 +if $8 ac. "noise 255",rgba_a fi +r. 256,256 n. 0,255 blur. {$3^2}% +l. if $4==0 +f "val = i/255; (val-0.5+(atan((val-0.5)*($5/10)^3)/pi)+0.5)*255" n 0,255 +elif $4==1 +c {($5-1/255)/2}%,{100-($5-1/255)/2}% n 0,255 +elif $4==2 +f "val = (2*i/255)-1; (val*(abs(val)^(0-($5/100)))+1)*255/2" +fi done +rv +fx_mesh_blend 0,1,$6,$7,$8,$10 +if $9 ac "n 0,255",rgba fi +blend_bomb : +if $1==0 repeat int($!/2) l[$>,{$>+1}] _blend_bomb ${2--1} done done +elif $1==1 repeat $! l[$>] [0] _blend_bomb ${2--1} done done fi +fx_blend_bomb : +blend_bomb ${2--1} +fx_blend_bomb_preview : +fx_blend_bomb $* +fx_texture_afre_broken: +repeat $! l[$>] +n 0,255 +if $3 +l fi ++l ++l +if $1 gradient_orientation 2 n 0,1 + y50_afre 0 gradient_norm +else gradient_norm fi +b 1,1,1 +done +*. {255*$2/iM} + +n 0,255 +done ++l.. n 0,1 f gauss(i-.5) n 0,1 done +blend_fade[0,1] . k[0] +if $3 blend difference fi +done done +fx_texture_afre_broken_preview : +fx_texture_afre_broken $* +_bwbp_prepare : +f. "begin(scale=max(w,h,d);ol=$2^3;oh=$5^3;ql=(2-2/(($3+1)^2));qh=(2-2/(($6+1)^2));rsl=scale*log2(scale)/(2^$1);rsh=scale*log2(scale)/(2^$4)); +vx=(x-w/2)/scale;vy=(y-h/2)/scale;vz=(z-d/2)/scale;rad=(vx^2+vy^2+vz^2)^0.5; +fl=rad*rsl; +fh=(rad*rsh)^-1; +ol=$2^3; +oh=$5^3; +func=(1/((1-ql*(fl)^(ol/2)+(fl)^(ol))^0.5)); +func*=(1/((1-qh*(fh)^(oh/2)+(fh)^(oh))^0.5));func" +_butterworth_bp : +v - +100%,100%,100% +_bwbp_prepare ${1-6} +shift. {int(w/2)},{int(h/2)},{int(d/2)},0,2 +fft.. *... . *[-2,-1] ifft rm[-1] +v + +fx_butterworth_bp: +repeat $! l[$>] +if !$8 split_opacity fi +l[0] +gain={iM} csswap 0,$7 +_butterworth_bp ${1-6} +csswap $7,0 if $9 abs fi if $10 * {$gain/iM} fi +done +if !$8 a c fi +done done +fx_butterworth_bp_preview : +if $11 +rm +4000,1,1 _bwbp_prepare ${1-6} +columns 50%,100% +1000,500,1,1 +f. "cut((i(#-2,2^(x*log2(w)/w-1),0,0,0,2,1)*(255)-y)*127.5,0,255)" +mirror y +r. 50%,100% +k[-1] +else +fx_butterworth_bp ${1-10} +fi +fx_self_glitching_cascade : +skip "${25=skip ,}","${26=skip ,}" +shift {$4-50}%,{$5-50}%,0,0,$6,0 +repeat $! l[$>] if !$3 split_opacity fi l[0] to_rgb +if $2 +if $1==0 rgb2srgb +elif $1==1 rgb2cmy +elif $1==2 rgb2hsv8 +elif $1==3 rgb2hsl8 +elif $1==4 rgb2hsi8 +elif $1==5 rgb2lch8 +elif $1==6 rgb2lab8 +elif $1==7 rgb2ycbcrglic +elif $1==8 rgb2yiq8 +elif $1==9 rgb2yuv8 +elif $1==10 rgb2hcy +elif $1==11 rgb2xyz8 +fi else +if $1==1 rgb2cmyk +elif $1==2 rgb2hsv +elif $1==3 rgb2hsl +elif $1==4 rgb2hsi +elif $1==5 rgb2lch +elif $1==6 rgb2lab +elif $1==7 rgb2ycbcr +elif $1==8 rgb2yiq +elif $1==9 rgb2yuv +elif $1==10 rgb2bayer 0 +elif $1==11 rgb2xyz +fi fi +if $11 stype=$7 else stype=1 fi +repeat $7 ++shift[0] {((([w,h]-1)*([$12,$13]-[$9,$10]+[u(-1,1),u(-1,1)]*sqrt((($12-$9)^2)+(($13-$10)^2))*($14^3)))/$stype)/100},0,0,$15 +f.. "begin( +const sign = $18?-1:1; +); +operate(mode,s1,s2,mult,power) = +(mode==0?(s1 + s2): +mode==1?(s1 * s2): +mode==2?(s1 & s2): +mode==3?(s1 | s2): +mode==4?xor(s1,s2): +mode==5?(s1^(s2*0.01)): +mode==6?(s2^(s1*0.01)): +mode==7?(s1%s2): +mode==8?(s2%s1): +mode==9?(s1 / s2): +mode==10?(s2 / s1): +mode==11?(s2 - s1): +mode==12?(s1 - s2): +mode==13?(s1 << s2): +mode==14?(s2 << s1): +mode==15?(s1 >> s2): +mode==16?(s2 >> s1): +mode==17?for(n=0,n<(s2%32),n++,rol(s1)): +mode==18?for(n=0,n<(s1%32),n++,rol(s2)): +mode==19?for(n=0,n<(s2%32),n++,ror(s1)): +mode==20?for(n=0,n<(s1%32),n++,ror(s2)): +mode==21?avg(s2,s1): +mode==22?round(s1,s2,0): +mode==23?round(s2,s1,0): +mode==24?s2*sin(s1*2*pi/mult): +mode==25?s1*sin(s2*2*pi/mult): +mode==26?sign*s2*cos(s1*2*pi/mult): +mode==27?sign*s1*cos(s2*2*pi/mult): +mode==28?s2*tan(s1*pi/mult): +mode==29?s1*tan(s2*pi/mult): +mode==30?s2*sin(mult/(s1*2*pi)): +mode==31?s1*sin(mult/(s2*2*pi)): +mode==32?sign*s2*cos(mult/(s1*2*pi)): +mode==33?sign*s1*cos(mult/(s2*2*pi)): +mode==34?s2*tan(mult/(s1*pi)): +mode==35?s1*tan(mult/(s2*pi)): +mode==36?mult*var(s1,s2): +mode==37?abs(s2 - s1): +mode==38?min(s2,s1): +mode==39?max(s2,s1): +mode==40?0.005*s2*(((j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power))+s1): +mode==41?0.005*s1*((j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)+s2): +mode==42?0.1*s2*(j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)*s1: +mode==43?0.1*s2*(j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)/s1: +mode==44?0.1*s1*(j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)/s2: +mode==45?0.001*s2*((j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)-s1): +mode==46?0.001*s1*((j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)-s2): +mode==47?0.001*s2*(s1-(j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)): +mode==48?0.001*s1*(s2-(j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)): +mode==49?0.001*s2*abs((j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)-s1): +mode==50?0.001*s1*abs((j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)-s2): +mode==51?0.00001*mult*var(s1,s2,(j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)): +mode==52?(255-((255-s1)*(255-s2))): +mode==53?(s1/(255-s2)): +mode==54?(s2/(255-s1)): +mode==55?((255-s2)/s1*255): +mode==56?((255-s1)/s2*255): +mode==57?((((s1)/255)^2)^(2*(0.5-(s2/255))))*255: +mode==58?((((s2)/255)^2)^(2*(0.5-(s1/255))))*255: +mode==59?sqrt(abs(s1*s2)): +mode==60?(if((s1+s2)>=255,255,0)): +(if((s1+s2)<=255,0,255))); +val = sign*((2^$16)*j(#-1) + $17);operate($19,val,i,$20,$16); +" rm. +if $8 +*. $20 +. $21 if $22==2 if $23 %. $23 fi else if $23 modf $22,$23,100%,0 fi fi *. $24 +. $25 +fi +done +if !$8 +*. $20 +. $21 if $22==2 if $23 %. $23 fi else if $23 modf $22,$23,100%,0 fi fi *. $24 +. $25 +fi +if $2 +if $1==0 srgb2rgb +elif $1==1 cmy2rgb +elif $1==2 hsv82rgb +elif $1==3 hsl82rgb +elif $1==4 hsi82rgb +elif $1==5 lch82rgb +elif $1==6 lab82rgb +elif $1==7 ycbcrglic2rgb +elif $1==8 yiq82rgb +elif $1==9 yuv82rgb +elif $1==10 hcy2rgb +elif $1==11 xyz82rgb +fi else +if $1==1 cmyk2rgb +elif $1==2 hsv2rgb +elif $1==3 hsl2rgb +elif $1==4 hsi2rgb +elif $1==5 lch2rgb +elif $1==6 lab2rgb +elif $1==7 ycbcr2rgb +elif $1==8 yiq2rgb +elif $1==9 yuv2rgb +elif $1==10 bayer2rgb 0,0,0 +elif $1==11 xyz2rgb +fi fi +done a c done done +fx_self_glitching_cascade_preview : +repeat max(0,l) +ac[$>] "-fx_self_glitching_cascade $*",$26 +done +fx_dct_fsu: +repeat $! l[$>] +if !$11 split_opacity fi +l[0] +csswap $10,0 dct +shift $4%,$5%,0,0,2 +f " +begin(op="$1"; ox=round("$2"*w/100); oy=round("$3"*h/100)); +(op==0)?(((x<=ox)&&(y<=oy))?i:0): +(op==1)?(((x<=ox)||(y<=oy))?i:0): +(op==2)?(((x<=ox)||(y<=oy))?0:i): +(op==3)?(((x<=ox)&&(y<=oy))?0:i): +(op==4)?(((x==ox)&&(y==oy))?i:0): +(op==5)?(((x==ox)||(y==oy))?i:0): +(op==6)?((((x==ox)||(y==oy))&&((x<=ox)&&(y<=oy)))?i:0): +(op==7)?((((x==ox)||(y==oy))&&((x>=ox)&&(y>=oy)))?i:0): +(op==8)?(j(round(ox*u(-1,1)^45),round(oy*u(-1,1)^45),0,0,0,2)): +(op==9)?(j(round(ox*u(-1,1)^5),round(oy*u(-1,1)^5),0,0,0,2)) +" +shift $6%,$7%,0,0,2 +idct +csswap 0,$10 +if $8 abs fi +if $9 n 0,255 fi +done +if !$11 a c fi +done done +fx_dct_fsu_preview: +gui_split_preview "fx_dct_fsu $*",${-3--1} +fx_jfif_fake : +glitch=(0.25^(10-$3))*$3/4 +cd=$4 +te=$5 +ste=$6 +base642img "MSBmbG9hdCBsaXR0bGVfZW5kaWFuCjggOCA2NCAxICMyMjIyCnic5Vs9q51FEC60kKtWMYpaCirYKCoI767iR6UoSangtdM/EAM2Fgab2FhaWdgIUXOqVO8sXEHBVDFia6kgCBaCQSyu+5w8c3nv5p55Bg+3uSmGs19nP2Z2Zt752P39/bJ/G8PHF5+qD1y4v77+yNWyeulegPWy9bbW+9pJ7z9XH6s/f3KxdLBeRr2hjDb0nfR+4OZyxwlw8UbHS4f1nehtBTg66f3kAyOU261OfDTiA/ehEV91ga8T208+cDlg5JNKPiknvR8ykfKwLuRlo7y0k96PegS8MxsB80RAnROBRYC9R0AZtxF45o1w+cXz9fHvztTnP7y7nv7z5dLBern1NvTht37/75P17Qt/lOsPPQqwXrbeth6D/6Hv3F2fl2/++WXqMPfyegzmwZz439e9755fHwbMvTxjHqwFQBlt6MMYjMV/8F/MgbkwJ+bGGlgLa2Jt7AF7wRjMg/+hD3vG3nmGxr0Y5/S+euPGe/XVJ/ZKB+vlBkAZbeh77ctX6re/f1E6WC83AMpoQ9+Zd++oV6+8WTpYLzcAymhD30+fPlee/e2zqcPcywZAGW3oO6J+aPw437jeuJ9xv+N5xvMCD/d1vABPL3QcdVjjpbcV4rb+2PGK8jsdxx3QjrZCvJevOl2A3/c7jTqs8dvbJtKkgK7A/eU+rsMEGoDOpJehjDb0YQzG4j+kpWEuzIm5sQbWwpqkc8NesCfsDXvEXrFn3oGGs+BMOBvOiLPizPgP+fzgW3Gsu87wb4mxTj53fixjfeDxo+qb2suC/2+Z1+ub9uX1TefyOundSG/HlxFfjfRupHclvo34dno30tvpNZNeRnob6V1I75n0nknvQnr7fZl4XybSu5Lexvs28b45vSvp7fe18L4W0ruS3n7fC+97JV808oWRLyr5ppCvGvnKyFeVfFfIl418aeTLSr4t5GsjX8/ka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OPyb9m/uHp/+7+QEL/b5x/HNQPxB/2/9H8PKH/T/7l/Ktx/lXN/MvT/939gYT+3zj/mvUD519N51+B/u/OzxP6/+Rfzj+nHm7mn57+7+4PJPR/9bdcmPqB+S+c/0fz84T+P+cdnH8f8G9C/3f3BxL6/5x32PqB/Bf2/xF/Wr7b2f9z5/eJ/T+3fsjoD97+QmL/z+XPy3j/z53fJ/b/3Pohqz/s7S8k9v9c/ryM9//c+X1i/8+tH7L6w97+QmL/z+XPy3j/z53fJ/b/3Pohoz94+wuJ/T+XPy/j/T93fp/Y/3Prh4z+4O0vJPb/XP68jPf/3Pl9Yv/PrR+y+sPe/kJi/8/lT+Pvvf0/d36f2P9z64es/rC3v5DY/3P509Y7O/t/7vw+sf/n1g8Z/cHbX4j4P5qfZ/vvPf0+0v+j/YGo/ojmF4nf/7nz82z/vaffR/p/tD8Q1R/R/CLx+z93fp7tv/f0+0j/j/YHovojml8kfv/nzs+z/feefh/p/9H+QFR/RPOLxO//3Pl5tv/e0+8j/T/aH4jqj2h+kfj9nzs/z/bfe/p9pP9H+wNR/RHNLxK//3Pn59n+e0+/j/T/aH8gqj+i+UXi93/u/Dzbf+/p95H+H+0PRPVHNL/4DgTd2gQ=" +=>[-2,-1] dct,idct +(16,11,10,16,24,40,51,61;12,12,14,19,26,58,60,55;14,13,16,24,40,57,69,56;14,17,22,29,51,87,80,62;18,22,37,56,68,109,103,77;24,35,55,64,81,104,113,92;49,64,78,87,103,121,120,101;72,92,95,98,112,100,103,99) => Q +f. "const S = $1<50?5000/$1:200-2*$1; max(1,round((S*i+50)/100,1,-1))" +repeat $!-3 l[$>,-3--1] +l[0] w,h={[w,h]} r {w+(-w%16)},{h+(-h%16)},1,100%,0,3 rgb2ycbcr s c +if $2==1 r[-2,-1] 100%,50%,1,1,2 elif $2==2 r[-2,-1] 50%,100%,1,1,2 elif $2==3 r[-2,-1] 50%,50%,1,1,2 fi round. done +repeat 3 +[$>] +f[$>] "begin(boundary = 2; res = vector64(); chance = "$glitch"; val = 1; errtile = 0; tt=-1; const tlen = "$te"; const sticky = "$ste"; stuck = 0; cold = "$cd"); +if (!(x%8) && !(y%8), +src = crop(x,y,8,8); +for (l = 0, l<8, ++l, for (k = 0, k<8, ++k, off = k + 8*l; u<=chance?(val+=(u(-cold,cold)/10);tt=u(1,tlen);(u<=sticky?stuck=1:stuck=0)); stuck==0?errtile=0; tt>=1?(errtile=u(0,64)); res[off] = sum(val*src*crop(#"$dct",0,0,(off+errtile)%64,8,8,1)))); +draw(#-1,res,x,y,8,8); tt-=1; +); i" +round. ++r[Q] {$>,w},100%,1,1,0,2 /.. . round.. *[-2,-1] +f. "begin(boundary = 2; res = vector64(); chance = "$glitch"; val = 0; errtile = 0; tt=-1; const tlen = "$te"; const sticky = "$ste"; stuck = 0; cold = "$cd"); +if (!(x%8) && !(y%8), +src = crop(x,y,8,8); +for (l = 0, l<8, ++l, for (k = 0, k<8, ++k, off = k + 8*l; u<=chance?(val+=(u(-cold,cold)/10);tt=u(1,tlen);(u<=sticky?stuck=1:stuck=0)); stuck==0?errtile=0; tt>=1?(errtile=u(0,64)); res[off] = sum(val+src*crop(#"$idct",0,0,(off+errtile)%64,8,8,1)))); +draw(#"$>",res,x,y,8,8); tt-=1; +); i" +rm. +round[$>] +done +l[^3--1] r ${-max_wh},1,1,1 a c ycbcr2rgb round. r $w,$h,1,3,0 done +done done +rm[dct,idct,Q] +rm. +fx_jfif_fake_preview : +gui_split_preview "fx_jfif_fake $*",${-3--1} +_scanlines : skip ${1=60},${2=2},${3=0},${4=0},${5=0} +v - +theta={$4*pi/180} C={cos($theta)} S={-sin($theta)} +repeat $! l[$>] +100%,100%,1,1,"x" -. {w/2-$5} 100%,100%,1,1,'y' +-. {h/2-$5} *.. $S *. $C +[-2,-1] +_ripple$3. $1,$2 +n. {-$1},$1 ++ cut 0,255 +done done v + +_qam_glitch : +100%,100%,1,1 _scanlines. ${7-9},{(90+$4+$10)},$11 b. $12 +*. 2 -. $7 +f.. "line=i(#-1\,x\,y\,z\,0);ang=(90+$4)*pi/180;(i+(((1+line*5*$13/255)*($1*i/255+$5))*(i*sin(((x-w/2)*cos(ang)+(y-h/2)*sin(ang))/$2+($3+(line*$2*$14/10)/255*360)*pi/180))+($6*($1)-($1*i/2)))-i/255)%255" +rm. +fx_qam_glitch : +repeat $! l[$>] +to_rgba +cs=$7 +if $12 negate fi +csswap 0,$cs +counter=0 +if $8 sh[0] 0 fi +if $9 sh[0] 1 fi +if $10 sh[0] 2 fi +if $11 sh[0] 3 fi +repeat $!-1 l[{$>+1}] +_qam_glitch ${1-6},${13-20} +done done +k[0] +csswap $cs,0 +if $12 negate fi +done done +fx_qam_glitch_preview : +gui_split_preview "fx_qam_glitch $*",${-3--1} +_fx_jfif_bomb : +repeat $! l[$>] +if $12 ++fx_solidify_td ${13-17} +negate. rv blend alpha +fi +ww={w} +hh={h} +r {$7*100}%,{$8*100}%,100%,100%,$9 +fx_jpeg_artefacts $1 +blend_bomb 1,${2-6},0,0,0,${10-11} +r $ww,$hh,100%,100%,$9 +done done +fx_jfif_bomb: +_fx_jfif_bomb ${2--1} +fx_jfif_bomb_preview : +fx_jfif_bomb $* +jr_fx_noise : +ac "_fx_noise $1,$2",$3,$4 +_jr_fx_noise : +repeat $! l[$>] split_opacity l[0] noise $1,$2 done a c done done +jr_fx_noise_preview : +gui_split_preview "jr_fx_noise $*",${-3--1} +fx_jfif : +cd={$4^2.5} +gl=$5 +ve=$6 +es=$7 +ste=$8 +bias={2^(6-($9*12))} +ts={$10^2} +base642img "MSBmbG9hdCBsaXR0bGVfZW5kaWFuCjggOCA2NCAxICMyMjIyCnic5Vs9q51FEC60kKtWMYpaCirYKCoI767iR6UoSangtdM/EAM2Fgab2FhaWdgIUXOqVO8sXEHBVDFia6kgCBaCQSyu+5w8c3nv5p55Bg+3uSmGs19nP2Z2Zt752P39/bJ/G8PHF5+qD1y4v77+yNWyeulegPWy9bbW+9pJ7z9XH6s/f3KxdLBeRr2hjDb0nfR+4OZ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+sPe/kJi/8/lT+Pvvf0/d36f2P9z64es/rC3v5DY/3P509Y7O/t/7vw+sf/n1g8Z/cHbX4j4P5qfZ/vvPf0+0v+j/YGo/ojmF4nf/7nz82z/vaffR/p/tD8Q1R/R/CLx+z93fp7tv/f0+0j/j/YHovojml8kfv/nzs+z/feefh/p/9H+QFR/RPOLxO//3Pl5tv/e0+8j/T/aH4jqj2h+kfj9nzs/z/bfe/p9pP9H+wNR/RHNLxK//3Pn59n+e0+/j/T/aH8gqj+i+UXi93/u/Dzbf+/p95H+H+0PRPVHNL/4DgTd2gQ=" +=>[-2,-1] dct,idct +(16,11,10,16,24,40,51,61;12,12,14,19,26,58,60,55;14,13,16,24,40,57,69,56;14,17,22,29,51,87,80,62;18,22,37,56,68,109,103,77;24,35,55,64,81,104,113,92;49,64,78,87,103,121,120,101;72,92,95,98,112,100,103,99) => Q +f. "const S = $1<50?5000/$1:200-2*$1; max(1,round((S*i+50)/100,1,-1))" +repeat $!-3 l[$>,-3--1] +gp={(0.25^((10-$3)*log(wh(#0))/30))*$3/10} +ww={w(#0)} +hh={h(#0)} +if $11==1 +mirror[0] x +elif $11==2 +mirror[0] y +elif $11==3 +mirror[0] xy +fi +if $12 +rotate[0] {$12*90},0 +fi +if $13 +www={w(#0)} +hhh={h(#0)} +r[0] {$www*$19},{$hhh*$20},100%,100%,$21 +fi +{w(#0)},{h(#0)},1,1 => G +f[$G] ">begin(chance = "$gp"; tlmax="$gl"; tt=-1; val=0; sticky="$ste"); +if (!(x%16) && !(y%16),for (l = 0, l<2, ++l, for (k = 0, k<2, ++k, (u<=chance?((val=1);tt=round(u(1,tlmax))):tt>=0?(val=0;--tt):(u<=sticky?(val=-2):val=-1)); j(k*8,l*8)=val)),0)" +l[0] w,h={[w,h]} r {w+(-w%16)},{h+(-h%16)},1,100%,0,3 rgb2srgb gcd_srgb2jpeg s c +if $2==1 r[-2,-1] 100%,50%,1,1,2 elif $2==2 r[-2,-1] 50%,100%,1,1,2 elif $2==3 r[-2,-1] 50%,50%,1,1,2 fi round. done +bw,bh=8 +repeat 3 +if $>==1 +if $2==1 bh=16 elif $2==2 bw=16 elif $2==3 bh,bw=16 fi +fi +[$>] +f[$>] ">begin(boundary = 2; res = vector64(); gres = vector64(); const cbw="$bw"; const cbh="$bh"; const cbwh=cbw*cbh; glitch=0; const cold="$cd"; gval=1; const errval="$ve"; const bias = "$bias"; const strength="$es"); +if (!(x%(128/cbw)) && !(y%(128/cbh)),for (ll = 0, ll<(16/cbw), ++ll, for (kk = 0, kk<(16/cbh), ++kk, +src = crop(x+(ll*8),y+(kk*8),8,8); +gpunch=crop(#"$G",cbw/8*(x+(ll*8)),cbh/8*(y+(ll*8)),cbw,cbh); +max(gpunch)==1?(glitch=1); +glitch==1?(gval=cut(gval+(u(-cold,cold)/15),-1,5);errnum=u(1,errval);for (ve=0,ve,w},100%,1,1,0,2 /.. . round.. *[-2,-1] +dispw={w(#1)} +f. ">begin(boundary = 2; res = vector64(); const cbw="$bw"; const cbh="$bh"; const cbwh=cbw*cbh; glitch=0; const cold="$cd"; gval=0; const dispwidth="$dispw";disp=0;shift="$ts"); +if (!(x%(128/cbw)) && !(y%(128/cbh)),for (ll = 0, ll<(16/cbw), ++ll, for (kk = 0, kk<(16/cbh), ++kk, +src = crop((x+(ll*8+cbw*disp))%(dispwidth/cbw*16),y+(kk*8)+cbh*floor((x+cbw*disp)/(dispwidth/cbw*16)),8,8); +gpunch=crop(#"$G",cbw/8*(x+(ll*8)),cbh/8*(y+(ll*8)),cbw,cbh); +max(gpunch)==1?(glitch=1); +glitch==1?((u<=shift?++disp);gval=cut(gval+(u(-cold,cold)/5),-1,5)); +for (l = 0, l<8, ++l, for (k = 0, k<8, ++k, off = k + 8*l; res[off] = int(sum(gval+src*crop(#"$idct",0,0,off,8,8,1))))); +draw(#"$>",res,x+(ll*8),y+(kk*8),8,8); +min(gpunch)<=-1?(glitch=0;errnum=0;min(gpunch)==-1?gres=vector64(0))))); i" +rm. +l[$>] r {w*($bw/8)},{h*($bh/8)},1,1,1 done +round[$>] +done +rm[$G] +l[^4--1] a c gcd_jpeg2srgb srgb2rgb round. r $w,$h,1,3,0 +if $13 blend_bomb 1,${14-18},0,0,0,${22-23} +r $www,$hhh,100%,100%,$21 fi +if $12 +rotate[0] {-$12*90},0 +fi +if $11==1 +mirror[0] x +elif $11==2 +mirror[0] y +elif $11==3 +mirror[0] xy +fi +done +done done +rm[$dct,$idct,$Q] +fx_jfif_preview : +gui_split_preview "fx_jfif $*",${-3--1} +fx_jfif_xt: +ww={w} +hh={h} +qu=$1/100 +sx=$2 +sy=$3 +to_rgb +csswap rgb,ycbcrjpeg +minl=0.05*wh +maxl=0.1*wh +diffx={-w%$sx} +diffy={-h%$sy} +w,h={[w,h]} r {w+$diffx},{h+$diffy},1,100%,0,3 +www={w} +hhh={h} +split_tiles -$sx,-$sy +dct f "I*cut(1+(("$sx"+"$sy")*"$qu"-(x+y)),0,1)" +append_tiles {$www/$sx} +f ">begin(const minl="$minl";const maxl="$maxl";cd=round(u(minl,maxl))); +cd-=1; +(cd<=0)?(cd=round(u(minl,maxl));J[0]=[u*50000,u*50000,u*50000]):(J[0])" +split_tiles -$sx,-$sy +idct +append_tiles {$www/$sx} +r {w-$diffx},{h-$diffy},1,100%,0,3 +csswap ycbcrjpeg,rgb +fx_jfif_xt_preview: +fx_jfif_xt $* +fx_jpeg : +to_rgb +inum=$! +q=$1 +cs=$2 +($3,$5,$7;$4,$6,$8;0,0,0;$9,$11,$13;$10,$12,$14) +nm. params +eval. "begin(index=0;list=transpose(crop(0,0,3,2),3);foundlist=vector6(0)); +for(n=0,n<3,++n, +pos=n*2; +cp=list[pos,2]; +(find(foundlist,cp,0,2)==-1)?( +index=find(foundlist,[0,0],0,2); +foundlist[index]=cp[0]; +foundlist[index+1]=cp[1]); +i(n,2)=find(foundlist,cp,0,2)*0.5 +);" +tcount=0 +repeat 3 +tnum={i(#$params,$>,2)} +if $tnum==$tcount +tw={i(#$params,$>,0)} +th={i(#$params,$>,1)} +dct_tileset $tw,$th +idct_tileset $tw,$th +tcount+=1 +fi +done +repeat $inum l[$>,{(-2*$tcount)-1}--1] +csswap[0] 0,$cs s[0] c +repeat 3 +cw={w(#0)} +ch={h(#0)} +tw={i(#$params,$>,0)} +th={i(#$params,$>,1)} +tn={i(#$params,$>,2)} +ox={-i(#$params,$>,3)%$tw} +oy={-i(#$params,$>,4)%$th} +imax=0 +imin=0 +l[$>] +imax={iM} +imin={im} +if $imax!=$imin +- $imin * {1/($imax-$imin)} +else ++ {1-$imax} +fi +done +z[$>] {-$ox},{-$oy},{$cw+((-$cw)%$tw)-1-$ox},{$ch+((-$ch)%$th)-1-$oy},3 +[$>] +f[$>] :" +begin(const tw="$tw";const th="$th";const twh=tw*th;const tn="$tn";const tileset=(tn-"$tcount")*2-1); +if (!(x%tw) && !(y%th), +res=vector(#twh,0); +ref(crop(x,y,tw,th),src); +for (l = 0, l",res,x,y,tw,th); +); i" +rm. +l[$>] +if $imax!=$imin +* {($imax-$imin)} + $imin +else ++ {$imax-1} +fi +done +z[$>] $ox,$oy,{$cw-1+$ox},{$ch-1+$oy},3 +done +a[0-2] c csswap[0] $cs,0 +done done +rm[{(-2*$tcount)-1}--1] +fx_jpeg_preview: +if $9 +o0,o1,o2,o3,o4,o5=${10-15} +else +repeat 6 +o$>=0 +done +fi +fx_jpeg ${1-8},$o0,$o1,$o2,$o3,$o4,$o5 +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}""{$9}""{"$o0"}_"{$9?2:0}"{"$o1"}_"{$9?2:0}"{"$o2"}_"{$9?2:0}"{"$o3"}_"{$9?2:0}"{"$o4"}_"{$9?2:0}"{"$o5"}_"{$9?2:0}##################### +#@cli :: User Karo's PINK-library operators +#@cli _xpink : pink_cmd, p1, ... , pn +#@cli : Packs the list of parameters to a string with spaces, generates the pink input image in tmp, executes the pink executable pink_cmd and loads the result image. The pink_cmd parameter can have options separated by ':' from the pink_cmd, actually only 'if' to specify, force the input file format of the executable. E.g. 'asf:if-uint8' would force the generated input pnk file to be of unsigned character type. Only 'uint8' 'uint' 'float' are allowed. Other options will possibly follow. +#@cli : To examine the parameters and to control existence of the program, type in a system shell 'pink_cmd', e.g. $ asf rspw. $ pink.asf ! +#@cli : If $GMIC_PINK_VERBOSE is true the command and sysout is printed +#@cli : If $GMIC_PINK_NO_RM is true temporary files are not removed +#@cli : Outfiles with 'P'(==80) as first char are considerd as images, everything else is considered as list +_xpink : +na={-1,n} +filename=${-filename_rand} +x_filename={/$filename} +if 0$GMIC_PINK_VERBOSE verb=" 2>&1" +else if ${-is_windows} verb=" >nul 2>&1" else verb=" >/dev/null 2>&1" fi fi +if 0$GMIC_PINK_NO_RM no_rm=1 else no_rm=0 fi +('$1') replace_str. ":","," replace_str. "-","," pc={t} rm. pink_cmd=${arg\ 1,$pc} +if ['${arg\ 2,$pc}']==['if'] ifo=,${arg\ 3,$pc} else ifo="" fi +if ${-kr_is_exec\ pink.${pink_cmd}}==0 fpin_cmd=pink.$pink_cmd +elif ${-kr_is_exec\ ${pink_cmd}}==0 fpin_cmd=$pink_cmd +elif ${-kr_is_exec\ ${pink_cmd}.exe}==0 fpin_cmd=${pink_cmd}.exe +else error "Executable (pink.)"$pink_cmd"(.exe) not found in PATH, status = "${}"!! Returning!!" fi +if 0$GMIC_PINK_VERBOSE +e "\n"$fpin_cmd" "${x_filename}".pnk $2 "${x_filename}"_o.pnk" fi +o ${x_filename}.pnk$ifo x ${fpin_cmd}\ ${x_filename}".pnk $2 "${x_filename}"_o.pnk"$verb +_status=${} +if !$no_rm delete ${x_filename}.pnk fi +if {"$_status!=0 && same(['$pink_cmd'],['seuilauto'],9)!=0"} error "Exec status is "$_status"." +elif isfile(['{/${filename}_o.pnk}']) +input_pinktest ${filename}_o.pnk +if ${}==80 i ${filename}_o.pnk else input_pinklist ${filename}_o.pnk fi +k. => $na +if !$no_rm delete ${x_filename}_o.pnk fi +else error "Exec error "$_status"!!" +fi +#@cli _xpinks : pink_cmd,parameter_string(with spaces!!) +#@cli : Splits c channel if necessary and executes "_xpink pink_cmd,parameter_string". +_xpinks : +foreach { +s:=s s. c +foreach { _xpink $1,"$2" k. } +if $s>1 a c fi +} +#@cli pink : eq. to 'pink_new'. +pink : pink_new $* +#@cli pink_new : pink_cmd,p1,...,pn +#@cli : Pink wrapper (requires the PINK library to be installed), see https://perso.esiee.fr/~coupriem/pinktutorial/ (in French) and https://perso.esiee.fr/~coupriem/Pink/doc/html/index.html (in English) +#@cli : Shortcut: pink +#@cli : - Prepares input, calls external "pink_cmd input p1...pn output" and reads output (/tmp) and replaces positional IMAGE parameters bei temp. files. These images are not splitted and merged. They have to have the necessary format for the respectice pink executable. Only Pink routines with input file(s) and ONE output file can be called. Images with spectral channels (s>1) are splitted, processed one by one and merged. +#@cli : - ATTENTION positional image parameter are never spitted and merged in contrast to selected (input) and output images. Positional image parameter should already have the needed format for the selected pink binary! +#@cli : - pink_new prepares selected images and image parameter as pnk files in auto mode and creates a command string. File format of generated input pnk file can be forced by an option attached to the "pink_cmd" by "pink_cmd:if-", e.g. "asf:if-uint8", overwriting auto mode. Images (splitted if spectrum s > 1) are processed one by one and are written as pnk files to temporary space, outfile is a pnk file name pointing to temporary space too. The executed call looks like\n"pink_cmd infile p1 ... (px)imagefile ... pn outfile". +#@cli : - For help of pink executable "pink_new help,pink_cmd" calls the executive command\n"open https://perso.esiee.fr/~coupriem/pinktutorial/_8c.html" instead of a pink binary. +#@cli : OS variables: +#@cli : GMIC_PINK_NO_RM == true: created files in temporary space are not removed +#@cli : GMIC_PINK_VERBOSE == true: created cmd string and pink messages are printed +#@cli : $ sp tiger +pink_new. asfr,5 pink_new.. asf,5 +#@cli : $ sp tiger +blur 2 round. pink_new maxima,4 +#@cli : $ sp to_gray ir. 0,50% +pink_new. distc,3 +negate.. +pink_new... dist,3 pink_new[1] bisector,[0] pink_new[3] bisector,[2] k[1,3] a c +#@cli : $ sp 2 +pink_new. dilatballnum,5 +- +#@cli : $ sp 2 +pink_new. asf,5 - +#@cli : $ sp boats ir. 0,50% +pink_new. dilatballnum,10 +pink_new.. distgeo,.,4 +#@cli : $ sp barbara +pink_new. seuilauto,128,max,3 +#@cli : $ sp 1,512,512 colorwheel 512 +pink_new. average,.. +pink_new : +$=pp +if $#>1 +np="" +repeat $#-1 { +if ${is_image_arg\ ${pp{$>+2}}} +pass${pp{$>+2}} +filename$>=${-filename_rand} +o. ${filename$>}.pnk rm. +np=${np}\ ${filename$>}.pnk +else np=${np}\ ${pp{$>+2}} fi +} +else np=" " fi +if ${-strcontains\ $1,help} x "open https://perso.esiee.fr/~coupriem/Pink/doc/html/"${pp2}"_8c.html" +else +v + e[^-1] "Call pink package on image$? with execute cmd: \"$1 [imgin]"$np" [imgout]\"." v - +_xpinks $1,$np +if !0$GMIC_PINK_NO_RM +repeat $#-1 { +if ${strlen\ ${filename$>}}>0 delete ${filename$>}.pnk fi +} +fi +fi +#@cli pink_grayskel : _connectivity(4), _lambda(0) +#@cli : () +#@cli : Grayscale homotopic skeleton (requires the PINK library to be installed). +#@cli : Default values: 'connectivity=4' and 'lambda=0' (actually only connex=4 implemented). +#@cli : $ sp tiger +pink_grayskel , +pink_grayskel[0] ,10 +pink_grayskel[0] ,100 append_tiles 2 +pink_grayskel : skip "${1=4},${2=0}" +e[^-1] "Call pink package on image$? with execute cmd: grayskel [imgin] 4 $2 [imgout]" +check "${1=4}==4" +pink grayskel:if-uint8,null,$1,$2 +#@cli pink_heightmaxima : _connectivity={ 4 | 8 | 6 | 26 },_height=1 +#@cli : () +#@cli : Heightmaxima filtering (requires the PINK library to be installed). +#@cli : Default values: 'connectivity=4' and 'height=1'. +#@cli : $ sp car +blur 2 round +pink_heightminima ,15 round[0,1] +pink_heightmaxima[0,1] ,15 -[-3,-1] -[-3,-1] k[-1,-2] +pink_heightmaxima : check "isin(${1=4},4,8,6,26)" skip ${2=1} +e[^-1] "Call pink package on image$? with execute cmd: heightmaxima [imgin] $1 $2 [imgout]" +pink heightmaxima:if-uint8,$1,$2 +#@cli pink_heightminima : _connectivity={ 4 | 8 | 6 | 26 },_height=1 +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/heightminima_8c.html) +#@cli : Heightminima filtering (requires the PINK library to be installed). +#@cli : Default values: 'connectivity=4' and 'height=1'. +#@cli : $ sp car +blur 2 round +pink_heightminima ,15 round[0,1] +pink_heightmaxima[0,1] ,15 -[-3,-1] -[-3,-1] k[-1,-2] +pink_heightminima : check "isin(${1=4},4,8,6,26)" skip ${2=1} +e[^-1] "Call pink package on image$? with execute cmd: heightminima [imgin] $1 $2 [imgout]" +pink heightminima:if-uint8,$1,$2 +#@cli pink_htkern : _connectivity={ 4 | 8 | 6 | 26 }, _type={"" | u} +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/htkern_8c.html) +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/htkernu_8c.html) +#@cli : Grayscale ultimate homotopic thinning/thickening without condition (requires the PINK library to be installed). +#@cli : Default values: 'connectivity=4' and 'type=""'. +#@cli : $ sp tiger +pink_htkern ,u +pink_htkern[0] , +-[-1,-2] remove[0] +pink_htkern : check "isin(${1=4},4,8,6,26) && isin(_'${2=}',0,117)" +e[^1] "Call pink package on image$? with execute cmd: htkern$2 [imgin] null $1 [imgout]" +pink htkern${2}:if-uint8,null,$1 +#@cli pink_lvkern : _connectivity={ 4 | 8 | 6 | 26 }, _type={"" | u} +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/lvkern_8c.html) +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/lvkernu_8c.html) +#@cli : Grayscale ultimate leveling thinning/thickening without condition (requires the PINK library to be installed). +#@cli : Default values: 'connectivity=4' and 'type=""'. +#@cli : $ sp tiger pink_lvkern ,u +pink_lvkern : check "isin(${1=4},4,8,6,26) && isin(_'${2=}',0,117)" +e[^1] "Call pink package on image$? with execute cmd: lvkern$2 [imgin] null $1 [imgout]" +pink lvkern${2}:if-uint8,null,$1 +#@cli pink_reg_minima : _connectivity={ 0 | 4 | 8 | 6 | 18 | 26 | 14} +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/minima_8c.html) +#@cli : Regional minima (requires the PINK library to be installed). +#@cli : Default values: 'connectivity=4'. +#@cli : $ sp tiger +blur 2 round. pink_reg_minima , +pink_reg_minima : check "isin(${1=4},0,4,8,6,18,26,14)" +e[^1] "Call pink package on image$? with execute cmd: minima [img] $1 [img]" +foreach { +if iM<256 tt=uint8 else tt=uint32 fi +pink minima:if-$tt,$1 +} +#@cli pink_reg_maxima : _connectivity={ 0 | 4 | 8 | 6 | 18 | 26 | 14} +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/maxima_8c.html) +#@cli : Regional maxima (requires the PINK library to be installed). +#@cli : Default values: 'connectivity=4'. +#@cli : $ sp tiger +blur 2 round. pink_reg_maxima , +pink_reg_maxima : check "isin(${1=4},0,4,8,6,18,26,14)" +e[^1] "Call pink package on image$? with execute cmd: maxima [imgin] $1 [imgout]" +foreach { +if iM<256 tt=uint8 else tt=uint32 fi +pink maxima:if-$tt,$1 +} +#@cli pink_skelcurv : _prio={prio image|0|1|2|3|4|8|6|18|26|5},_connectivity={ 4 | 8 | 6 | 26 },_inhibit={""|inhibit image} +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/skelcurv_8c.html) +#@cli : Curvilinear binary skeleton guided by a priority function or image (requires the PINK library to be installed). +#@cli : Default values: 'prio=0', 'connectivity=4' and 'inhibit=""'. +#@cli : $ sp tiger threshold 50% {w},{h} fill. 'if(x>w/2,255,0)' tp=${-path_tmp} output. ${tp}/inhibit.pgm remove. +pink_skelcurv[0] , +pink_skelcurv[0] ,,${tp}/inhibit.pgm exec "rm "${tp}"/inhibit.pgm" +#@cli : $ sp tiger threshold 50% +pink_skelcurv , +pink_skelcurv.. ,8 +pink_skelcurv : check ${is_image_arg\ ${1=0}}" || isin($1,0,1,2,3,4,8,6,18,26,5) && isin(${2=4},4,8,6,26)" skip "${3=}" +e[^1] "Call pink package on image$? with execute cmd: skelcurv [img] $1 $2 $3 [img]" +if ${is_image_arg\ $3} pink skelcurv:if-uint8,$1,$2,$3 else pink skelcurv:if-uint8,$1,$2 fi +#@cli pink_skelend : _connectivity={ 4 | 8 | 6 | 26 },_n=0 +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/skelend_8c.html) +#@cli : Homotopic skeleton of a 2d or 3d binary image with dynamic detection of end points (requires the PINK library to be installed). +#@cli : Default values: 'connectivity=4' and 'n=0'. +#@cli : $ sp tiger threshold 50% +pink_skelend , +pink_skelend.. ,-1 +pink_skelend : check "isin(${1=4},4,8,6,26)" skip "${2=0}" +e[^1] "Call pink package on image$? with execute cmd: skelend [imgin] $1 $2 [imgout]" +if $2==0 pink skelend:if-uint8,$1 else pink skelend:if-uint8,$1,$2 fi +#@cli pink_skeleton : _prio={0|1|2|3|4|8|6|26},_connectivity={ 4 | 8 | 6 | 26 },_inhibit="" +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/skeleton_8c.html) +#@cli : Ultimate binary skeleton guided by a priority image (requires the PINK library to be installed). +#@cli : Default values: 'prio=0', 'connectivity=4' and 'inhibit=-1'. +#@cli : $ sp tiger threshold 50% +pink_skeleton. , +pink_skeleton : check ${is_image_arg\ ${1=0}}" || isin($1,0,1,2,3,4,8,6,26) && isin(${2=4},4,8,6,26)" skip "${3=-1}" +e[^1] "Call pink package on image$? with execute cmd: skeleton [imgin] $1 $2 [$3] [imgout]" +pink skeleton:if-uint8,$1,$2,$3 +#@cli pink_skelpar : _algorithm={0...31},_nsteps=_1,_inhibit="" +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/skelpar_8c.html) +#@cli : Parallel binary skeleton (requires the PINK library to be installed). +#@cli : Default values: 'algorithm=4', 'nsteps=-1' and 'inhibit=""'. +#@cli : For most of the implemented algorithsm an inhibit image is not implemented! +#@cli : $ sp tiger threshold 50% +pink_skelpar. 0 +pink_skelpar. 2 +pink_skelpar : check "${1=4}>=0 && $1<=31" skip "${2=-1} ${3=''}" +e[^1] "Call pink package on image$? with execute cmd: skelpar [imgin] $1 $2 $3 [imgout]" +karo_frame 2 if ${-is_image_arg\ $3} pink skelpar:if-uint8,$1,$2,$3 else pink skelpar:if-uint8,$1,$2 fi +#@cli pink_wshed : _connectivity={ 4 | 8 | 6 | 26 },_inverse={ 0 | 1 },_height=0 +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/wshedtopo_8c.html) +#@cli : Watershed (requires the PINK library to be installed). +#@cli : Default values: 'connectivity=4', 'inverse=0' and 'height=0'. +#@cli : $ sp car +pink_wshed ,1,5 pink_wshed[0] ,,5 +pink_wshed : check "isin(${1=4},4,8,6,26)" skip "${2=0},${3=0}" +if $3==0 e[^-1] "Call from Pink package: wshedtopo $1 "${"arg 1+!$2,inverted.,."} +else e[^-1] "Call from Pink package: heightminima $1 $3 wshedtopo $1 "${"arg 1+!$2,inverted.,."} fi +foreach { +s:=s if $s>1 s. c fi +if d==1 +check "$1==4 || $1==8" +foreach { +f max(min(i,255),0) +if $2!=0 negate 255 fi +if $3>0 pink heightminima:if-uint8,$1,$3 fi +pink wshedtopo:if-uint8,$1 +if $2!=0 negate 255 fi +} +else +check "$1==6 || $1==26" +foreach { +f max(min(i,255),0) +if $2!=0 negate 255 fi +if $3>0 pink heightminima:if-uint8,$1,$3 fi +pink wshedtopo:if-uint8,$1 +if $2!=0 negate 255 fi +} +fi +if $s>1 a[-$s--1] c fi +} +#@cli output_pinklist : filename, _type +#@cli : write an (c,n) image with c=1..4 colums and n lines to a pink list file +#@cli : Automatic type: c==1 => e, c==2 => b c==3 => B, c==4 => N +#@cli : Manual type possible: c==2 => s, c==3 => n +#@cli : Default value: 'type=" "' (space) +#@cli : List formats according PINK format description +#@cli : ~~~ +#@cli : e s b n B N +#@cli : x1 x1 v1 x1 y1 x1 y1 v1 x1 y1 z1 x1 y1 z1 v1 +#@cli : x2 or x2 v2 or x2 y2 or x2 y2 v2 or x2 y2 z2 or z2 x2 y2 v2 +#@cli : ... ... ... ... ... ... +#@cli : xn xn vn xn yn xn yn vn xn yn z3 z3 xn yn vn +#@cli : ~~~ +output_pinklist : +skip "${2=\ }" +itp={'$2'} +ltyp={'ebBN'} +if w>4 error "Image wrong colums" fi +typ={typ=vector4($ltyp);typ[w-1]} +if $typ==_'b'&&$itp==_'s' typ=$itp +elif $typ==_'B'&&$itp==_'n' typ=$itp fi +e[^-1] "Write pinklist typ "{`$typ`}" with "{h}" lines to "{``$1} +($typ,32,{'{h}'}) +o.. asc:$1 rm.. +i raw:$1,uint8 s. +,{'\n'} y rm[1] a y +o raw:$1,uint8 rm +u $typ +#@cli pink_delaunay : _mode +#@cli : Prepare the delaunay triangulation from a list of coordimates (vertices) +#@cli : using the external program pink.delaunay, no test for external delaunay +#@cli : mode == 0 a 3d object or +#@cli : mode != 0 the vertice, hull, edge lists and the adjacency matrix +#@cli : Default value: 'mode=0' +#@cli : $ 2,50,1,1 rand 0,512 pink_delaunay. 0 +pink_delaunay : skip ${1=0} +e[^-1] "Prepare Delaunay triangulation from$? to 3d object or set of lists ($1)" +filename_rand nn=${} +output_pinklist. $nn".tmp" +x 0,"pink.delaunay "$nn".tmp "$nn".del" +input_pinklist[] $nn".del",$1 +delete $nn.tmp +delete $nn.del +#@cli pink_asflin : _dir(x|y|z), _rad(5), _radmax(0) +#@cli : 'asflin' filter workaround for 2D images! +#@cli : 'asflin' works only in 3D images (d>1) +#@cli : 'asflin' is called with dir,rad or if radmax>rad with dir,rad,radmax +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/asflin_8c.html) +#@cli : pink_asflin (requires the PINK library to be installed). +#@cli : $ sp tiger +pink_asflin. , +pink_asflin.. y,5 +pink_asflin : +check "isin(_'${1=x}',['xyz']) && ${2=5}>0 && ${3=0}>=0" +foreach { d_alt=0 +if d==1 . a z d_alt=1 fi +if $3<=$2 pink asflin,$1,$2 else pink asflin,$1,$2,$3 fi +if $d_alt==1 s z k. fi +} +#@cli pink_karo_zerleg : eq. to 'karo_zerleg'. +pink_karo_zerleg : karo_zerleg $* +#@cli karo_zerleg : +#@cli : Partition of binary image zero areas +#@cli : using pink watershed (https://perso.esiee.fr/~coupriem/Pink/doc/html/wshedtopo_8c.html) +#@cli : Author : KaRo. Latest update : 2017/11/30. +#@cli : $ follic pink seuilauto,254,min,5 n 0,1 karo_open 3 +not karo_zerleg. not. a c +#@cli : $ sp 6 to_gray +threshold 140 +karo_zerleg. a[-1,-2] c +karo_zerleg : +e[^1] "Partition of binary image"$?" with pink watershed" +foreach { ++distance. 1 round. pink_wshed. 8,1 f. "j(0,0)!=j(1,1) || j(1,0)!=j(0,1)" skeleton. , or[0,-1] +} +#@cli :: User KaRo's CLI I/O functions +#@cli osteo : +#@cli : Load osteoblast cell image (transmitted light) +#@cli : $ osteo ++osteo : +e[^-1] "Load osteoblast nucleus example image" +l[] { base642img "MiB1aW50OCBsaXR0bGVfZW5kaWFuCjEyOCAxMjggMSAxICMxMTA1MAp4nC17V5Mk15ndv1NsSLGUQlotKIoUl7vcBUguQRgCg3E""9076895VZlWWybJdrOzM9GO8w3V2V3nYDUoRCD3pQhB71pnNuAYOZ6KquynvvZ853PnPt0Hds2zYc07dsWzccx7QMy7Mc3zEs/O""eYju+armm7jusYrmVb+LxpXweG43q6Y1lBGPBjtm+5vuE616Hj+Y7j2rYVup7lXoe2xXd+9Fzbc50b18eCvu3gY17o2x6+Z2B5m""18wLVO3sbSHnw3ftd3QsFzDdV0by+q+7zq25jgOnmRdO7rpBwa27HM/lhuEnu/buou94gMhPoPVsaEwcG3fc6wA33Zv7MCxQ89z""AscPsR3XvrE9nNDULId79i3dCk3DNXFW39E8l3vD+67PHToUjovX+Jjr6Lbzk6fbboA3LBv7Dn3X903Ldl0hAQ1bCiG8MHRDLOn""5oeXiyIFtX984ThD4NxST53DTODZk4Jq+h2UsXfM8CzI2LaiAp9YgNNPAFkPL0sQ2LdMzfMvHMV1Xd8Mbx9Y9C295OB/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wNuHBY9bEFTWaPVPHEXGxYWrEc0RJXS1ERY4mkobm""G7hHRWedfgxm0LVoNwzQ3QYzVH3CcSDUdOAYpZN96TETM/zDJE94ESB2nXeJXJ5KHZiOEuDPIVU1TQXOvj0v35cgnHBqgjj5wXf""5313WThixy3gw2ytEXjNMmCxEU+HCPQEIyXwsBsjl8irJEAAEUN3j1lycZnoQRBT0xk+WRxrIpA6je+tgIK0IJ/ZtaOSNPWICaM""lJkmnQNAZ3PCjBHbIeFYp1ZAB+xbzF+vr6+TkS9pV0xBgFSsxLngwpxBJQkjY2Zl2BSXH5ieIIaZAgbW2EyW6noam9m8/sdb4yz""p65z04G50MfgoOi+ccxJf5yUOQLb3/wEmr00PMSAxMCAxIDEgIzE4Cnicc/eNYsgvLknNZwAAEQsDGQ==" +} +#@cli osteo_ : +#@cli : Load osteoblast cell image and cell mask (transmitted light) +#@cli : $ osteo_ ++osteo_ : +e[^-1] "Load osteoblast nucleus example image and mask" +l[] { osteo base642img "MiBpbnQxNiBsaXR0bGVfZW5kaWFuCjEgMTYzIDEgMSAjMjIzCnicVdDLSoJRGIXh5cCxgyYJCgUFlVigRZGZpuXhrrwCRzYpqEF""QUVFUUqkdsCztbpo0flv+RSibBzZ78H1r7ZpqCvnIel8hQUQNJrVHTAdM6YgZHTOnUzsnqUsWdUVKt6TVZEV3rOqBNbVYV4eMHt""nQE5t6thfy6lLQq71RDPTY1jsl9SkHBlQCn1T/jN6rY++DMeX/Gb9K+mDHs0cVvXu4t+AcW5Z3ppwN82WdNaO2c7ec/95dmiy7V""0o3ds2SuyZ1QUJnLNi8Tpj1f0zrkLj2iWqXCdUJK/v9A/ovmeIxIDExIDEgMSAjMjcKeJxzZ/BliGJgYMhnKGYoYUgF0vFAHgAp""xAN4" +decompress_rle. => osteo_ +} +#@cli follic : +#@cli : Load follicle cells sample image from thyroid (transmitted light) from internet or local storage. +#@cli : For frequent usage do "gmic follic o ${_path_rc}follic.pgm" to store the image locally, follic looks there first! +#@cli : $ follic ++follic : +if isfile(['{/${_path_rc}follic.pgm}']) +e[^-1] "Load thyroid follicle nuclei example image from local storage" +i ${_path_rc}follic.pgm +else e[^-1] "Load thyroid follicle nuclei example image from http://karo03.bplaced.net/gmic/Repo/follic.pgm" +i http://karo03.bplaced.net/gmic/Repo/follic.pgm fi => follic +#@cli follic_ : +#@cli : Load follicle cells image and masks from thyroid (transmitted light) from internet or local storage. +#@cli : $ follic_ ++follic_ : +e[^-1] "Load thyroid follicle nuclei and mask example image" +l[] { follic +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgMTMwMyAxIDEgIzE0NDkKeJx1lttP3FUQx4eqvclNYBeW3eW3Ny7+E+qTlydj4oOJ""11Yf9dEnL21Nm4q2RaS0NlqVmGgtjZaAtUUqrYkWUFsuC1SslFYbtRcFCuyyy/6OnzO7lCWNyf5yZr7nnO/MmZkzZ6VACviJ8""LVMrZciUyplplwGzV2SNgXyqPHKGNhjpkomjEceN9XyG98Txi8XTY08aYJyyTjyFPJlE5Kn+X7PG58xEbkJz03GZ/nmTLG4Ji""zPmajMw+uyxsoLpgzZUTlhKsSAb0JOYtPim0xMUqYS3JHNKletkl3s2/VpfDP4ZHmW8PF2OYIcYH0gJwfBA/gWlgwcWTkEnpW""bicNITnfheNdskFHkJTCDrRZTiB7AblZv5UxjrFvW93GuceOTRXQXP/dxnvOcI4k9g5406+RTYjwOnlCskr2lcoS5GeJmsH/d""3EOswuz3YrdMvoBvDrvXzUb5V/d4wD1yFHsLxPequUOu6foKvkrpwJ+EKZFhzuvClWF/J+dehGtEsRKNRxdYij1x4uXCY+P1F""WdNwzGq64o0zseIewb/RrGxZO7WHH6tmA8sxPoNmuPjemY/mAPveviicgLZhdfGLKN1kcUMvHFzp/zFN29qpVsxh3UFmqME2A""nNiYPPYeKWr0c4S74exd6yHoIjpvpxzXWI/NTBWbdKTzOfwu8f8Ct/TYY49ClmfakHi+F/mfRrPTmsawCLaqwH8rB0Ll8DWo8""17G3QmrA1MECcsti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nkzv9p9Aw5X2DubdWDnLOAdSF6mUP8AvIHa3Yi38Cvy+g70K08RRy3s/4a/k3i0xv48je5uoA/25j/k7xPUBO""vM39F/6cUyyvMXcJ+nPf6ZbBJ3vf7wM9zZ7aO/QedweGnMSAxNyAxIDEgIzM5Cnicc2fwZYhiYGBIY8hnyAHCTIZkhniGXAY9""hgKGdCDNwAAAZYIFpg==" +decompress_rle. => follic_ +} +#@cli sincos : _w(512), _h(512), _new(0) +#@cli : Generation of a simple sine cosine testimage +#@cli : Default value: 'w=h=512', 'new=1' +#@cli : $ sincos , +shift. 50%,0,0,0,2 +shift.. 0,50%,0,0,2 a c +#@cli : $ sincos , sincos ,,1 +- f. 'if(i<-1,0,i)' ++sincos : +skip "${1=512},${2=$1},${3=1}" +e[^-1] "Sine/cosine testimage ${1-3}!" +l[] { +if {"!(!$3 && $_version>=298)"} $1,$2,1,1,'begin(a=pi*w;b=pi*h);i=sin(a/(x+1))*cos(b/(y+1));if(i<=0,i+=1,i);i*255' +else +$1,$2,1,1,'begin(a=pi*w;b=pi*h);sin(a/(x+1))*cos(b/(y+1))' ++f. 'sign(i)' eq. 1 +neq. 1 *[1] ... *. ... n[-1,-2] 0,255 +f[-1,-2] 'if(i==255,0,i)' +[-1,-2] rm.. +fi +=> sincos } +#@cli kr_spect : _size=512, _force_native(=0) +#@cli : Generate example spectrum image prepared with 'distance' or if existant external pink executable 'dist' and not forced! +#@cli : $ kr_spect ,1 ++kr_spect : skip "${1=512},${2=0}" +l[] { +$1,$1 = 255,{{w}/2},{{h}/2} +if ((${-kr_is_exec\ pink.dist}==0)||(${-kr_is_exec\ dist}==0)||(${-kr_is_exec\ dist.exe}==0))&&(!$2) +e[^-1] "Generate spectrum example using external PINK 'dist'" +pink. dist,0 +else +e[^-1] "Generate spectrum example using native 'distance'" +not. distance. 0 fi +f. (iM-i)/iM*100 [-1] +f. x +f. (i/$1-0.5)*200 ++transpose. +*. -1 +a[-1--3] c +lab2rgb. +} +#@cli kr_testimage : _sizex(256),_sizey(_sizex) +#@cli : Another simple spectrum image for tests +#@cli : $ kr_testimage , ++kr_testimage : skip "${1=256},${2=$1}" +l[] { $1,$2,1,3 fill. "if(c==0,x/w*255,if(c==1,y/h*255,if(c==2,(((x/w*255+y/h*255)-256)^2)^0.5,0)))" } +#@cli karo_read_bd : name,_verbosity(=0),_append_type(=z) {z|c|x|y},_no_delete(=0) +#@cli : Read biodata with external bfconvert from OME +#@cli : bftools directory has to be in the PATH +#@cli : http://www.openmicroscopy.org/site/support/bio-formats5/users/comlinetools/conversion.html +#@cli : Default values: 'verbosity=0', 'append_type=z', 'no_delete=0' ++karo_read_bd : skip "${2=0},${3=z},${4=0}" ina=$1 +e[^-1] "Read biodata with OME bftool bfconvert (name=\""$ina"\", verbosity=$2, append_type=$3, no_delete=$4)." +ona=${-path_tmp}${-file_slash}gmic_bd_$_pid.tif +if $2<2 postf=" >/dev/null 2>&1" else postf="" fi +cmd="bfconvert merge overwrite -no-upgrade "${ina}" "${ona} +if ${-is_windows}==0 cmd=${cmd}${postf} else +e $(cmd) fi +if isfile(['{/$ina}']) +if $2!=0 +e $cmd fi x $cmd if $2!=0 fi +if isfile(['{/$ona}']) l[] { +i ${ona} if $!>0 if '"$3"'=='z' a z elif '"$3"'=='c' a c elif '"$3"'=='x' a x elif '"$3"'=='y' a y fi fi +if $4==0 delete $ona else e "File "$ona" not deleted!" fi } +else e "File "$ona" not found!" fi +else e "File "$ina" not found!" fi +#@cli gwyddionread : _filename +#@cli : Read gwyddion ASCII file and produce image. +#@cli : For gwyddion files see http://gwyddion.net . +#@cli : Data beginning after "Start of Data:" are imported +#@cli : [x-length, y-length, x-offset, y-offset, header lines] are returned in ${} +#@cli : gwyddion Example header +#@cli : |# File Format = ASCII +#@cli : |# Created by Gwyddion 2.48 +#@cli : |# Original file: gwyddion_Example.asc +#@cli : |# x-pixels = 640 +#@cli : |# y-pixels = 480 +#@cli : |# x-length = 313789.96127244376 +#@cli : |# y-length = 235219.70492879587 +#@cli : |# x-offset = 0 +#@cli : |# y-offset = 0 +#@cli : |# Bit2nm = 1.0 +#@cli : |# Start of Data: ++gwyddionread : skip "${1=gwyddion_Example.asc}" +e[^-1] "Read gwyddion ASCII text data: "$1 +l[] { +i raw:"$1",uint8 nm={b} +s +,{'\n'} +size_x,size_y,len_x,len_y,offs_x,offs_y,bit2nm,hend=-1 +foreach { +if same(['{$>,t}'],'"# x-pixels ="',12) rows[$>] 12,100% size_x={{$>,t}} +elif same(['{$>,t}'],'"# y-pixels ="',12) rows[$>] 12,100% size_y={{$>,t}} +elif same(['{$>,t}'],'"# x-length ="',12) rows[$>] 12,100% len_x={{$>,t}} +elif same(['{$>,t}'],'"# y-length ="',12) rows[$>] 12,100% len_y={{$>,t}} +elif same(['{$>,t}'],'"# x-offset ="',12) rows[$>] 12,100% offs_x={{$>,t}} +elif same(['{$>,t}'],'"# y-offset ="',12) rows[$>] 12,100% offs_y={{$>,t}} +elif same(['{$>,t}'],'"# Bit2nm ="',10) rows[$>] 10,100% bit2nm={{$>,t}} +elif same(['{$>,t}'],'"# Start of Data:"',16) hend=$> break +fi +} +if $hend>0 +rm[0-{$hend+1}] a y +discard 13 +file_tmp=${-filename_rand} +if $!>1 o.. raw:$file_tmp,uint8 rm.. i dlm:$file_tmp => $nm +o.. raw:${file_tmp}_,uint8 rm.. i dlm:${file_tmp}_ => ${nm}_ delete ${file_tmp}_ +else o raw:$file_tmp,uint8 rm i dlm:$file_tmp => $nm fi +delete $file_tmp +else rm fi +u [$len_x,$len_y,$offs_x,$offs_y,$bit2nm] +} +#@cli wykoread : _filename +#@cli : Read Wyko/Bruker/Vision ASCII file and produce image(s) +#@cli : For Wyko files see also under http://gwyddion.net . +#@cli : Data preceded by "RAW_DATA" and/or "Intensity" are imported +#@cli : Wyko Example header +#@cli : |Wyko ASCII Data File Format 0 1 1 +#@cli : |X Size 640 +#@cli : |Y Size 480 +#@cli : |Block Name Type Length Value +#@cli : |Wavelength 7 4 71.992500 +#@cli : |Aspect 7 4 1.000000 +#@cli : |Pixel_size 7 4 0.000985 +#@cli : |Magnification 8 8 10.050000 +#@cli : |ScannerSpeed 7 4 2.315832 +#@cli : |RAW_DATA 3 1228800 +#@cli : Default value: 'filename=Wyko_Example.ASC' ++wykoread : skip "${1=Wyko_Example.ASC}" +e[^-1] "Read Vision surface profilometry OPD text data: "$1 +l[] { +i raw:"$1",uint8 nm={b} +s +,{'\n'} +size_x,size_y,hend,rend=-1 +foreach { +if same(['{$>,t}'],'"X Size"',6) rows[$>] 6,100% size_x={{$>,t}} +elif same(['{$>,t}'],'"Y Size"',6) rows[$>] 6,100% size_y={{$>,t}} +elif same(['{$>,t}'],'"RAW_DATA"',8) hend=$> +elif same(['{$>,t}'],'"Intensity"',9) rend=$> break +fi +} +if $hend>0 +rm[0-{$hend+1}] +if $rend>$hend a[0-{$rend-$hend-3}] y rm[1,2] a[1--1] y else a y fi +replace_str "Bad","nan" +discard 13 +file_tmp=${-filename_rand} +if $!>1 o.. raw:$file_tmp,uint8 rm.. i dlm:$file_tmp => $nm +o.. raw:${file_tmp}_,uint8 rm.. i dlm:${file_tmp}_ => ${nm}_ delete ${file_tmp}_ +else o raw:$file_tmp,uint8 rm i dlm:$file_tmp => $nm +fi +delete $file_tmp +rotate -90,0 +else rm fi +} +#@cli karo_dtpread : filename,_bit0 +#@cli : Read dtp image file format +#@cli : (512 byte header, col[22-24] x row[25-27] byte image) +#@cli : with _bit0 != 0 bit level 1 is extracted as binary mask +#@cli : and bit level 1 in the gray image is randomized. +#@cli : Default value: 'bit0=0' +#@cli : Ex.: karo_dtpread Images/Beispiele/tra005.cel,1 ++karo_dtpread : check isfile(['{/$1}']) check "${2=0}>=0" +e[^-1] "Read dtp image file from "$1"." +i raw:$1,uint8 +({@22-24}) x={t} rm. +({@25-27}) y={t} rm. +({@0-79}) _dtph={t} rm. +crop. 0,512,0,{h} +resize. $x,$y,1,1,-1 +if $2 +and. 1 and.. 254 f.. "i+(u>0.5)" fi +_wrbytepnk : +output_pink3d ${1}.pnk +#@cli output_pink3d : filename,_type +#@cli : Save selected images as type-coded (P5,P8,P9) PNK files (PINK extension for 3d volumetric images). +#@cli : +#@cli : Other file types are listed for info only! +#@cli : +#@cli : Pink file formats (from PINK source) +#@cli : P4: raw binary ; P1: ascii binary (2D: standard ; 3D: extension Pink) NOT YET SUPPORTED +#@cli : P5: raw byte ; P2: ascii gray (2D: standard ; 3D: extension Pink) +#@cli : P6: raw byte rgb ; P3: ascii rgb (2D: standard ; 3D: NOT YET SUPPORTED) +#@cli : P8: raw long 2d-3d (extension Pink) +#@cli : P9: raw float 2d-3d (extension Pink) +#@cli : PA: ascii float 2d-3d (extension Pink) +#@cli : PB: ascii long 2d-3d (extension Pink) +#@cli : PC: raw double 2d-3d (extension Pink) +#@cli : PD: ascii double 2d-3d (extension Pink) +#@cli : PE: raw single precision complex 2d-3d (extension Pink) +#@cli : PF: ascii single precision complex 2d-3d (extension Pink) +#@cli : +#@cli : Images +#@cli : +#@cli : FILE ::= 'P2' \\* \ \ \\* FILE ::= 'P5' \\* \ \ \\* +#@cli : COMMENT ::= '#' char\* newline COMMENT ::= '#' char\* newline +#@cli : DIMENSIONS ::= \ \ | \ \ \ DIMENSIONS ::= \ \ | \ \ \ +#@cli : RS ::= ascii_coded_integer RS ::= ascii_coded_integer +#@cli : CS ::= ascii_coded_integer CS ::= ascii_coded_integer +#@cli : DS ::= ascii_coded_integer DS ::= ascii_coded_integer +#@cli : VALMAX ::= ascii_coded_integer VALMAX ::= ascii_coded_integer +#@cli : PIXEL ::= ascii_coded_integer8 PIXEL ::= binary_coded_integer8 +#@cli : +#@cli : FILE ::= 'P8' \\* \ \ \\* FILE ::= 'P9' \\* \ \ \\* +#@cli : COMMENT ::= '#' char\* newline COMMENT ::= '#' char\* newline +#@cli : DIMENSIONS ::= \ \ | \ \ \ DIMENSIONS ::= \ \ | \ \ \ +#@cli : RS ::= ascii_coded_integer RS ::= ascii_coded_integer +#@cli : CS ::= ascii_coded_integer CS ::= ascii_coded_integer +#@cli : DS ::= ascii_coded_integer DS ::= ascii_coded_integer +#@cli : VALMAX ::= ascii_coded_integer [unused] VALMAX ::= ascii_coded_integer [unused] +#@cli : PIXEL ::= binary_coded_integer32 PIXEL ::= binary_coded_float +#@cli : +#@cli : FILE ::= 'PA' \\* \ \ \\* FILE ::= PB \\* \ \ \\* +#@cli : COMMENT ::= '#' char\* newline COMMENT ::= '#' char\* newline +#@cli : DIMENSIONS ::= \ \ | \ \ \ DIMENSIONS ::= \ \ | \ \ \ +#@cli : RS ::= ascii_coded_integer RS ::= ascii_coded_integer +#@cli : CS ::= ascii_coded_integer CS ::= ascii_coded_integer +#@cli : DS ::= ascii_coded_integer DS ::= ascii_coded_integer +#@cli : VALMAX ::= ascii_coded_integer [unused] VALMAX ::= ascii_coded_integer [unused] +#@cli : PIXEL ::= ascii_coded_float PIXEL ::= ascii_coded_integer32 +#@cli : +#@cli : FILE ::= 'PC' \\* \ \ \\* FILE ::= 'PD' \\* \ \ \\* +#@cli : COMMENT ::= '#' char\* newline COMMENT ::= '#' char\* newline +#@cli : DIMENSIONS ::= \ \ | \ \ \ DIMENSIONS ::= \ \ | \ \ \ +#@cli : RS ::= ascii_coded_integer RS ::= ascii_coded_integer +#@cli : CS ::= ascii_coded_integer CS ::= ascii_coded_integer +#@cli : DS ::= ascii_coded_integer DS ::= ascii_coded_integer +#@cli : VALMAX ::= ascii_coded_integer [unused] VALMAX ::= ascii_coded_integer [unused] +#@cli : PIXEL ::= binary_coded_double PIXEL ::= ascii_coded_double +#@cli : +#@cli : FILE ::= 'PE' \\* \ \ (\ \)\* FILE ::= 'PF' \\* \ \ (\ \)\* +#@cli : COMMENT ::= '#' char\* newline COMMENT ::= '#' char\* newline +#@cli : DIMENSIONS ::= \ \ | \ \ \ DIMENSIONS ::= \ \ | \ \ \ +#@cli : RS ::= ascii_coded_integer RS ::= ascii_coded_integer +#@cli : CS ::= ascii_coded_integer CS ::= ascii_coded_integer +#@cli : DS ::= ascii_coded_integer DS ::= ascii_coded_integer +#@cli : VALMAX ::= ascii_coded_integer [unused] VALMAX ::= ascii_coded_integer [unused] +#@cli : RE ::= binary_coded_float RE ::= ascii_coded_float +#@cli : IM ::= binary_coded_float IM ::= ascii_coded_float +#@cli : +#@cli : Default value: 'type=P5' +output_pink3d : skip ${2=P5} +e[^-1] "Output image$? as file '$1' (in 3d pink extension of "$2"-coded PNK format)." +if $!==1 filename0="$1" +else foreach { filename$>=${filename\ "\"$1\"",$>} } fi +tp="$2" +foreach { +if ['$tp']=='P5'&&iM>=256 tp="P8" fi +if ['$tp']=='P5' o. pnk:${filename$>},uint8 +elif ['$tp']=='P8' o. pnk:${filename$>},uint +elif ['$tp']=='P9' o. pnk:${filename$>},float +else error "Type $tp not implemented!" fi +} +#@cli input_pinktest : file_name +#@cli : Test file type for pnk (pink) and pnm (portable anymap) file type. +#@cli : Routine returns the first character from the first non comment line in status. If status == 'P'( == 80) a pnk/pnm file is expected! For pink everything else is considered as pink list or non-pink-file. +input_pinktest : +i[0] raw:"$1",uint8 s[0] -,{'\n'} i=0 +do u {$i,@0} i={$i+1} while ${}==35&&$i<$! +rm +#@cli pink_setorigin : pink_file, _orig_x, _orig_y, _orig_z +#@cli : Call of pink routine setorigin to make an image file as structuring element usable +#@cli : Default values: 'orig_x=orig_y=orig_z=0' +pink_setorigin : skip "${2=0},${3=0},${4=0}" +input_pinktest $1 if ${}!=80 error "Not a pnk file: "$1 fi +if ${-is_windows} x "setorigin $1 $2 $3 $4" +else +x 0,"type setorigin" +if ${}==0 x "setorigin $1 $2 $3 $4" +else +x 0,"type pink.setorigin" +if ${}==0 x "pink.setorigin $1 $2 $3 $4" +else error "setorigin not found!" fi +fi +fi +#@cli input_pinklist : file_name, _mode +#@cli : Read a pink list file +#@cli : spec. type G from pink.delaunay) at file_name and prepare +#@cli : _mode == 0 a 3d object or +#@cli : _mode != 0 the vertice, hull, edge list images and the adjacency matrix +#@cli : _mode only valid for graph lists type G, all other list types return only an image. All list (image) sizes are returned in status! +#@cli : Default value: 'mode=0' +#@cli : +#@cli : Summary of Pink list formats read: +#@cli : ~~~ +#@cli : Type e s b n B N \nvalues x1 x1 v1 x1 y1 x1 y1 v1 x1 y1 z1 x1 y1 z1 v1 \n... x2 x2 v2 x2 y2 x2 y2 v2 x2 y2 z2 z2 x2 y2 v2 \n... ... ... ... ... ... ... \n... xn xn vn xn yn xn yn vn xn yn z3 z3 xn yn vn \n\nType G \nvalues x1 y1[ v1] ec1 ns1 s11 s12 ... s1ns1 \n... x2 y2[ v2] ec2 ns2 s21 s22 ... s1ns2 \n... ... \n... xn yn[ vn] ecn nsn sn1 sn2 ... s1nsn \n\nSplines \n2D case: \nType c n+1 (where n+1 denotes the number of control points) \nx1 y1 \n... \nxn+1 yn+1 \nC0X1 C0Y1 C1X1 C1Y1 C2X1 C2Y1 C3X1 C3Y1 \n... \nC0Xn C0Yn C1Xn C1Yn C2Xn C2Yn C3Xn C3Yn \n\n3D case: \nType C n+1 (where n+1 denotes the number of control points) \nx1 y1 z1 \n... \nxn+1 yn+1 zn+1 \nC0X1 C0Y1 C0Z1 C1X1 C1Y1 C1Z1 C2X1 C2Y1 C2Z1 C3X1 C3Y1 C3Z1 \n... \nC0Xn C0Yn C0Zn C1Xn C1Yn C1Zn C2Xn C2Yn C2Zn C3Xn C3Yn C3Zn \n\nThe xi yi zi are the coordinates of the control points. \nThe C?Xi C?Yi C?Zi are the coefficient of the polynoms of the ith cubic spline. \nThe ith segment (starting with i=0) of the parametric curve P is then defined by: \nx(t) = C3Xi * t^3 + C2Xi * t^2 + C1Xi * t + C0Xi \ny(t) = C3Yi * t^3 + C2Yi * t^2 + C1Yi * t + C0Yi \nz(t) = C3Zi * t^3 + C2Zi * t^2 + C1Zi * t + C0Zi \nwith t in [i,i+1] +#@cli : ~~~ +#@cli : where _xi, yi_ are the coordinates of the _i_ -th vertex, _vi_ is the associated value (if given in the input file), _eci_ is a int which indicates whether the vertex _i_ belongs to the convex hull, _nsi_ denotes the number of adjacent vertices, and _si1 si2 ... sins1_ is the list of the indexes of the adjacent vertices (counted from 0) (see ). ++input_pinklist : +skip ${2=0} +e[^-1] "Read pinklist $1" +l[] { +i[0] raw:"$1",uint8 s[0] -,{'\n'} +if i(#0,0)=='G' e[^1] "Delaunay graph list file mode "{0,t}" vertices" +rows[0] 2,100% n={0,t} rm[0] +3,$n,1,1 => vertices +1,$n,1,1 => vhull +0 => edges +repeat $!-3 { l[{$>},vertices,vhull,edges] { +s[0] -,{'\ '} +=[vertices] {0,t},0,$> =[vertices] {1,t},1,$> =[vertices] {2,t},2,$> +=[vhull] {3,t},0,$> {{4,t}*3},1,1,1 p=$> +repeat {4,t} { =. 2,{$>*3} =. $p,{$>*3+1} =. {{$>+5},t},{$>*3+2} } +a[edges] .,x rm[1-4,-1] +} } +k[vhull,vertices,edges] mv[vhull] 0 +ver={vertices,h} +edg={edges,{w/3}} +nhull={vhull,is} +if $2==0 +if {vhull,is} repeat {vertices,h} { +if {vhull,@{$>}} (1,$>) a[edges] .,x rm. edg+=1 fi +} fi +({'CImg3d'}) mv. -3 +($ver,$edg) mv. -3 +(255^255^255) r. {$edg-$nhull} +(0,0,255) .x{$nhull-1} a[-1--$nhull] x +(0.6) r. {$edg-$nhull} +(1) .x{$nhull-1} a[-1--$nhull] x +unroll y a[-1--8] y rm.. +else +$ver,$ver +repeat {edges,w/3} { +=. 1,{edges,@{$>*3+1}},{edges,@{$>*3+2}} +} +fi +u $ver,$edg,$nhull +elif i(#0,0)=='e' e[^1] "1d list file mode e "{0,t} +s -,{'\ '} n={{1,t}} rm[0,1] +1,$n,1,1 => vertices +if $!-1<$n s[0] -,{'\ '} fi +repeat $!-1 { l[{$>},vertices] { +=[vertices] {0,t},0,$> +} } +k[vertices] +ver={vertices,h} +u $ver +elif i(#0,0)=='s' e "1d list file mode s "{0,t} +rows[0] 2,100% n={{0,t}} rm[0] +1,$n,1,1 => vertices +1,$n,1,1 => vhull +repeat $!-2 { l[{$>},vertices,vhull] { +s[0] -,{'\ '} +=[vertices] {0,t},0,$> +=[vhull] {1,t},0,$> +} } +k[vertices,vhull] a x +ver={vertices,h} +u $ver +elif i(#0,0)=='b' e "2d list file mode b "{0,t} +rows[0] 2,100% n={{0,t}} rm[0] +2,$n,1,1 => vertices +repeat $!-1 { l[{$>},vertices] { +s[0] -,{'\ '} +=[vertices] {0,t},0,$> =[vertices] {1,t},1,$> +} } +k[vertices] +ver={vertices,h} +u $ver +elif i(#0,0)=='n' e "2d vertice list file mode n "{0,t} +rows[0] 2,100% n={{0,t}} rm[0] +2,$n,1,1 => vertices +1,$n,1,1 => vhull +repeat $!-2 { l[{$>},vertices,vhull] { +s[0] -,{'\ '} +=[vertices] {0,t},0,$> =[vertices] {1,t},1,$> +=[vhull] {2,t},0,$> +} } +k[vertices,vhull] a x +ver={vertices,h} +u $ver +elif i(#0,0)=='B' e "3d list file mode B "{0,t} +rows[0] 2,100% n={{0,t}} rm[0] +3,$n,1,1 => vertices +repeat $!-1 { l[{$>},vertices] { +s[0] -,{'\ '} +=[vertices] {0,t},0,$> =[vertices] {1,t},1,$> =[vertices] {2,t},2,$> +} } +k[vertices] +ver={vertices,h} +u $ver +elif i(#0,0)=='N' e "3d vertice list file mode N "{0,t} +rows[0] 2,100% n={{0,t}} rm[0] +3,$n,1,1 => vertices +1,$n,1,1 => vhull +repeat $!-2 { l[{$>},vertices,vhull] { +s[0] -,{'\ '} +=[vertices] {0,t},0,$> =[vertices] {1,t},1,$> =[vertices] {2,t},2,$> +=[vhull] {3,t},0,$> +} } +k[vertices,vhull] a x +ver={vertices,h} +u $ver +elif i(#0,0)=='c' e "2d spline list file mode c "{0,t} +rows[0] 2,100% n={{0,t}} rm[0] +2,$n,1,1 => controlp +8,{$n-1},1,1 => coeff +repeat $n { l[{$>},controlp] { +s[0] -,{'\ '} +=[controlp] {0,t},0,$> =[controlp] {1,t},1,$> +} } +repeat $n-1 { ii=$> l[{$>+$n},coeff] { ++s[0] -,{'\ '} +repeat 8 { =[coeff] {{-8+$>},t},$>,$ii } +rm[-1--8] +} } +k[controlp,coeff] a y +ver={controlp,h} +u $ver +elif i(#0,0)=='C' e "3d spline list file mode C "{0,t} +rows[0] 2,100% n={{0,t}} rm[0] +3,$n,1,1 => controlp +12,{$n-1},1,1 => coeff +repeat $n { l[{$>},controlp] { +s[0] -,{'\ '} +=[controlp] {0,t},0,$> =[controlp] {1,t},1,$> =[controlp] {2,t},2,$> +} } +repeat $n-1 { ii=$> l[{$>+$n},coeff] { ++s[0] -,{'\ '} +repeat 12 { =[coeff] {{-12+$>},t},$>,$ii } +rm[-1--12] +} } +k[controlp,coeff] a y +ver={controlp,h} +u $ver +else error "File type "{i(#0,0)}"/'"{`i(#0,0)`}"' not implemented! "{0,t} fi +} +#@cli pink_input_pnk: filename +#@cli : Read pgm P2 extended (pink) ascii files via pink exec pgm2list anything else with pink type in 'esbnBNcCdDG' with input_pinklist and the rest with standard gmic input function. ++pink_input_pnk : skip "${1=}" +l[] { tres=${-pink_input_test\ $1} +if $tres"==_'Q'" +fn=${-filename_rand} +if ${-kr_is_exec\ pink.pgm2list}==0 x "pink.pgm2list $1 N "$fn +elif ${-kr_is_exec\ pgm2list}==0 x "pgm2list $1 N "$fn +else "error pink exec pgm2list not found!" fi ++input_pinklist $fn +delete $fn ++s x,4 {iM#-4+1},{iM#-3+1},{iM#-2+1} rm[-2--5] +eval "repeat(h#0,ni,i(#-1,i(#0,0,ni),i(#0,1,ni),i(#0,2,ni))=i(#0,3,ni))" +rm[0] +elif "isin("$tres",['esbnBNcCdDG'])" +input_pinklist $1 +else i $1 fi u $tres +} +#@cli pink_input_test : file_name +#@cli : Test file type of file_name for pnk (pink) and pnm (portable anymap) file type. +#@cli : Routine returns the first character from the first non comment line in status. Only ['PQesSbnBNcCdDG#'] are allowed, +#@cli : 'P'=80 is returned for pgm files with type <> P1/P2/P3/PA/PB/PD/PF (not ascii pgm), \n'Q'=81 is returned for pgm files with type == P1/P2/P3/PA/PB/PD/PF. \n['esbnBNcCdDG'] is returned for PINK list files where the second char is ' '. \n'#'=35 is returned otherwise. +pink_input_test : +l[] { +i raw:"$1",uint8 s -,{'\n'} i=0 +do z1={$i,@0} z2={$i,@1} i={$i+1} while $z1==35&&$i<$! +rm +if $z1"==_'P'" if "isin("$z2",['123ABDF'])" z1={_'Q'} fi +elif "isin("$z1",['esbnBNcCdDG']) && "$z2"==_' '" +else z1={_'#'} fi +u $z1 +} +#@cli cimg2tiff : filenamein, _pathout(=pathin), _type(=integer) +#@cli : File Converter gmic cimg* to tiff e.g. for ImageJ with <_pathout>.tif. Type can be _type='integer'(size dep. uint8(<256)|uint16(<65536)|uint32(4294967296)|float32) or any other numrical gmic types. Usage is thought for multipage tiff files of 2/3/4d multi-channel data. In case of tiff float files, value ranges other than [0,1] deliver often problems. Best to use (not only in ImageJ) bio-formats package (https://www.openmicroscopy.org/bio-formats/) +#@cli : Default values: 'pathout={f}' (file path from input file), 'type=integer' +#@cli : Ex.: gmic cimg2tiff Step\ 3/_wt_Time_0.cimgz +#@cli : Ex.: gmic cimg2tiff \"Step 3/_wt_Time_0.cimgz\",\"./\" +cimg2tiff : +i "${1=}" +skip "${2={f}},${3=integer}" +if ['$3']=='integer' +if iM<256 ty=uint8 +elif iM<65536 ty=uint16 +elif iM<4294967296 ty=uint32 +else ty=float32 fi +else ty=$3 fi v + +o ${2}{b}".tif",$ty +rm +#@cli :: User Karo's CLI Utilities +#@cli karos_about +#@cli : Logo for gui and errors +#@cli : $ karos_about +karos_about : +if $_version<270 osteo gui_print_preview "G'MIC version "$_version,32,"KaRo's tests",22 +else +if $!==0 osteo fi r. 600,600,1,3 +[0] *. 0 +text. "g'mic",0.5~,0.15~,36,1,255,255,0 +text. "\n\nversion "$_version,0.5~,0.2~,18,1,255,255,0 +text. "KaRo's",0.5~,0.4~,57,1,255,0,255 +text. "Tests",0.5~,0.55~,57,1,200,0,200 ++to_gray. skeleton. , n[-1--2] 0,255 dilate.. 2 -[-1--2] + n 0,255 +text. "http://karo03.bplaced.net/gmic/html/",0.5~,0.7~,37,1,200,0,200 +fi +#@cli karos_error : "message" +#@cli : Message in karos_about image for gui +#@cli : $ karos_error Test +karos_error : +karos_about +text. "${1=Error}",0.5~,0.8~,36,1,200,0,200 +#@cli kr_is_exec : executable_name +#@cli : Look for 'executable_name' with 'type' (unix/MacOS) or 'where' (windows) +#@cli : Return unix/Macos/Windows status==0 found! +kr_is_exec : +if ${-is_windows} if !($^<=1) x "where $1" else x "where $1 >nul 2>&1" fi +else if !($^<=1) x "type $1" else x "type $1 >/dev/null 2>&1" fi fi +#@cli kr_draw_vars : _type(0) +#@cli : If _type==0 Draw with text several variable and function values Else Draw PATH variable into an image +#@cli : Default value; 'type=0' +#@cli : $ 0 kr_draw_vars +kr_draw_vars : skip ${1=0} +if !$1 text " $_host os: "$_host" "$_os"\n"" $_pid: "$_pid"\n"" $_cpus: "$_cpus"\n"" $_path_rc: "{/$_path_rc}"\n"" $_path_user: "{/$_path_user}"\n"" is_macos: "${-is_macos}"\n"" is_windows: "${-is_windows}"\n"" path_cache: "{/${-path_cache}}"\n"" path_tmp: "{/${-path_tmp}}"\n"" path_gimp: "{/${-path_gimp}},0.2~,0.1~,14,1,255 +else text " PATH:\n"${-_kr_path},0.2~,0.1~,14,1,255 +fi +#@cli kr_help : _command, _gmic_file(=$_path_rc/update$_version.gmic) +#@cli : Display help (parse_cli ascii,command) optionally from _gmic_file (e. g. external files). +#@cli : Default _command="" _gmic_file=$_path_rc/update$_version.gmic +kr_help : skip "${1=''},${2=$_path_rc/update$_version.gmic}" +if isfile(['$2']) +l[] { cimgz:$2 k[0] +onfail l[] { raw:$2,uint8 k[0] onfail } +} +if $! k. fi +fi +if !$! return fi +y a y +parse_cli ascii,$1 +rm v 0 q +#@cli _xframe : +#@cli : Set 1 bit border to 0 (e.g. for pink skeleton) +_xframe : +f "i=y==0?0:x==0?0:y==h-1?0:x==w-1?0:i" +#@cli karo_frame : _width, _border +#@cli : Delete a border of width or delete the inner part +#@cli : _width : thickness of border +#@cli : _border ==false : border is set 0, inner region copied +#@cli : _border ==true : border is copied, inner region is set 0 +#@cli : Default values: 'width=1', 'border=0' +#@cli : $ osteo +negate karo_frame 5,0 +karo_frame : +skip "${1=1},${2=0}" +if $2 e[^2] "Copy border/Delete inner: width $1." +else e[^2] "Delete border/Copy inner: width $1." fi +foreach { ni=$> s={s} s c +repeat $s { nis=$> l[$nis] { +if $2 f 'begin(bb=$1);i=y=h-bb?i:x>=w-bb?i:0' +else f 'begin(bb=$1);i=y=h-bb?0:x>=w-bb?0:i' fi +} } +a c } +_kr_path : ('{/{/$PATH}}') +if ${-is_windows} ss=";" else ss=":" fi +fill "i=="{'$ss'}"?"{'\n'}":i" +u {t} rm. +#@cli karo_li2st : p1,p2,...,pn +#@cli : Convert comma separated list to space separated string. +karo_li2st : +u "" if $#>=1 ({"'${1--1}'"}) replace. {','},{"' '"} u {t} rm. fi +#@cli _kr_ac_list : number (actually 38 in gmic_stdlib, fully 64) +#@cli : return alpha channel mode string from number in status. +#@cli : Ex. repeat 64 { _kr_ac_list \$\> +e \$\>,\${} } +#@cli : Ex. sp 0 repeat 38 { +ac[0] \"karo_morpho 2,1,10\",$>,2 _ac_list $> text. ${},0,0,56,1,255 } append_tiles 5 r 25%,25%,1,100% +_kr_ac_list : +if isnum($1) +arg 1+round($1),all,rgba,rgb,rgb_r,rgb_g,rgb_b,rgba_a,lrgb,lrgb_r,lrgb_g,lrgb_b,ycbcr_y,ycbcr_cbcr,ycbcr_cb,ycbcr_cr,ycbcr_cg,lab_l,lab_ab,lab_a,lab_b,lch_ch,lch_c,lch_h,hsv_h,hsv_s,hsv_v,hsi_i,hsl_l,cmyk_c,cmyk_m,cmyk_y,cmyk_k,yiq_y,yiq_iq,ryb,ryb_r,ryb_y,ryb_b,rgba_r,rgba_g,rgba_b,srgb,srgb_r,srgb_g,srgb_b,ycbcr,ycbcr_y,lab,lch,lch_l,hsv,hsi,hsi_h,hsi_s,hsl,hsl_h,hsl_s,cmy,cmy_c,cmy_m,cmy_y,cmyk,yiq,yiq_i,yiq_q +else u "$1" fi +#@cli karo_xcimg : programname, parameterlist : +#@cli : Call external CImg Example 'programname' +#@cli : which has to be found in PATH by external call by +#@cli : 'programname' image_in 'parameterlist' image_out +#@cli : with writing image_in and reading after execution image_out +#@cli : $ sp lena karo_xcimg pde_TschumperleDeriche2d,-iter\ 50\ -visu\ 0\ -ns +- +karo_xcimg : +filename=${-filename_rand} +if ${-kr_is_exec\ $1}!=0 +error "executable $1 not found in PATH, status = "${}"!! Returning!!\n" +{w},{h} karos_error "exec Error !!" return +fi +o ${filename}.cimg +x "$1 -i "${filename}".cimg $2 -o "${filename}".cimg" +if ${} v + e "Status is "${}"." v - {w},{h} karos_error "exec Error !!" +else i ${filename}.cimg fi +delete ${filename}.cimg +#@cli karo_skeleton : _p1,..,p2n : (-median,0,-inv,0|1,-t,-0.3,-curve,0|1,-corr,0|1,-dlt,1) +#@cli : Execute use_skeleton (CImg demo) external. +#@cli : For help execute in terminal shell "use_skeleton -help" +#@cli : ~~~ +#@cli : use_skeleton: Compute the skeleton of a shape, using Hamilton-Jacobi equations (Aug 11 2021, 20:46:01) +#@cli : +#@cli : Input/Output options +#@cli : -------------------- +#@cli : -i img/milla.bmp Input (black&white) image +#@cli : -median 0 Apply median filter +#@cli : -inv false Invert image values +#@cli : -o 0 Output skeleton image +#@cli : -visu true Display results +#@cli : Skeleton computation parameters +#@cli : ------------------------------- +#@cli : -t -0.3 Threshold +#@cli : -curve false Create medial curve +#@cli : Torsello correction parameters +#@cli : ------------------------------ +#@cli : -corr false Torsello correction +#@cli : -dlt 1 Discrete step +#@cli : ~~~ +#@cli : $ sp car otsu 256 +karo_skeleton "-median,5,-inv,1" +karo_skeleton : if $#>0 karo_li2st ${1--1} p=${} else p="" fi +e[^1] "Compute \"use_skeleton\" exec with options \'"$p"\' on"$? +foreach { +s={s} if $s>1 s. c fi +foreach { karo_xcimg use_skeleton,${p}" -visu 0" mv. 0 k[0] } +if $s>1 a[-$s--1] c fi +} +#@cli karo_nlmeans : _p1,..,pn=-zoom,1,-ng,0|1,-nu,0|1,-ns,0|1,-p,1,-lambda,-1,-sigma,-1,-alpha,3,-sampling,1 +#@cli : Execute use_nlmeans (CImg demo) external. (see also q-nlmeans p=4,lambda=4,sigma=10) +#@cli : For help execute in terminal shell "use_nlmeans -help" +#@cli :~~~ +#@cli : use_nlmeans: Non-local means denoising algorithm. +#@cli : [1] Buades, A. Coll, B. and Morel, J.: A review of image denoising algorithms, with a new one. Multiscale Modeling and Simulation: A SIAM Interdisciplinary Journal 4 (2004) 490-530 +#@cli : [2] Gasser, T. Sroka,L. Jennen Steinmetz,C. Residual variance and residual pattern nonlinear regression. Biometrika 73 (1986) 625-659 +#@cli : Build : (Aug 11 2021, 20:45:21) +#@cli : +#@cli : -i img/milla.bmp Input image +#@cli : -o 0 Output file +#@cli : -zoom 1 Image magnification +#@cli : -ng 0 Add gauss noise before aplying the algorithm +#@cli : -nu 0 Add uniform noise before applying the algorithm +#@cli : -ns 0 Add salt&pepper noise before applying the algorithm +#@cli : -visu 1 Visualization step (0=no visualization) +#@cli : -p 1 Half size of the patch (2p+1)x(2p+1) +#@cli : -lambda -1 Bandwidth as defined in [1] (-1 : automatic bandwidth) +#@cli : -sigma -1 Noise standard deviation (-1 : robust estimation) +#@cli : -alpha 3 Neighborhood size (3) +#@cli : -sampling 1 Sampling of the patch (1: slow, 2: fast) +#@cli :~~~ +#@cli : $ osteo +karo_nlmeans -p,2 +- +karo_nlmeans : if $#>0 karo_li2st ${1--1} p=${} else p="" fi +e[^1] "Compute \"use_nlmeans\" exec with options "${p}" on"$? +foreach { +s={s} if $s>1 s. c fi +foreach { karo_xcimg use_nlmeans,${p}" -visu 0" mv. 0 k[0] } +if $s>1 a[-$s--1] c fi +} +#@cli :: User KaRo's CLI functions +#@cli karo_rndbit0 : +#@cli : Randomize in [0..255] (byte) image$? bit level 0. wow randomize numbers to even and odd" +#@cli : $ osteo +karo_rndbit0 +- +karo_rndbit0 : +e[^-1] "Randomize in [0..255] (byte) image$? bit level 0." +foreach { and 254 f "i+(u>0.5)" } +#@cli kr_circular_mean : +#@cli : Calculation of the mean (and SD) for angles (radian), especially for mean and sd of hue angles. Returned in status and a global variabale _kr_circular_mean +kr_circular_mean : ++sin. +cos.. +_kr_circular_mean={[atan2(ia#-2,ia#-1),sqrt(-2*log(sqrt(ia#-2^2+ia#-1^2)))]} +rm[-1,-2] +u $_kr_circular_mean +#@cli pseudo_c : +#@cli : Pseudo coloring of greyscale images +#@cli : $ follic_ k. label 0 +pseudo_c +pseudo_c : +if s!=1 to_gray. fi {iM},1,1,3,u(255) round. map.. . rm. +#@cli karo_luminance : _type = [itur1990 | itur1990-2 | gmic | gmic-2] +#@cli : Compute luminance of selected RGB images according +#@cli : itur1990 | itur1990-2 sqr/sqrt | gmic luminance | sqr/sqrt gmic luminance. +#@cli : sRGB to RGB and back only with gmic and gmic-2! +#@cli : Default value: 'type=itur1990' +#@cli : $ sp tiger +karo_luminance , +karo_luminance : skip ${1=itur1990} +e[^-1] "Compute luminance $1 of image$?." +remove_opacity +foreach { +if s==3 +if ['$1']=='gmic' luminance +elif ['$1']=='gmic-2' srgb2rgb sh 0 sh[0] 1 sh[0] 2 +sqr *[1] 0.22248840 *[2] 0.71690369 *[3] 0.06060791 +[1-3] sqrt rm[1] rgb2srgb +elif ['$1']=='itur1990-2' sh 0 sh[0] 1 sh[0] 2 +sqr *[1] 0.212655 *[2] 0.715158 *[3] 0.072187 +[1-3] sqrt rm[1] +else sh 0 sh[0] 1 sh[0] 2 *[1] 0.212655 *[2] 0.715158 *[3] 0.072187 +[1-3] rm[1] fi +elif s!=1 norm n 0,255 +fi } +channels 0 +#@cli karo_close : _size>0, _shape={0|1|2} (square|octagon|circle),_invert={0|1}, scale={0|1|2}, Value action none | cut | normalize, channel=>0 see color_channels in apply_channels +#@cli : Morphological closing (dilate and erode) of given size (only 2d) +#@cli : with fx_morpho_v2 and implicitly apply_channels! +#@cli : Default values: 'size=5', 'shape=invert=scale=channel=0' +#@cli : $ sp tiger,400 +karo_close 21 +karo_close[0] 21,1 +karo_close[0] 21,2 rm[0] +karo_close : +e[^1] "Compute closing image"$?", with size "$1" (only 2d)." +skip "${1=5},${2=0},${3=0},${4=0},${5=0}" check $2<3 +if $4 negate fi +ac "karo_morpho 3,$2,$1",$5,$4 +if $4 negate fi +#@cli karo_open : _size>0,_shape=0|1|2 (square|octagon|circle), _invert=0|1, +#@cli : '_scale=0|1|2','_channel' see value action, color_channels in 'apply_channels' +#@cli : Morphological opening (erode and dilate) of given size (only 2d) +#@cli : with fx_morpho_v2 and implicitly apply_channels! +#@cli : Default values: 'size=5', 'shape=invert=scale=channel=0' +#@cli : $ sp tiger,400 +karo_open 15 +karo_open[0] 15,1 +karo_open[0] 15,2 rm[0] +karo_open : +e[^1] "Compute opening image"$?", with size "$1" (only 2d)." +skip "${1=5},${2=0},${3=0},${4=0},${5=0}" check $2<3 +if $4 negate fi +ac "karo_morpho 2,$2,$1",$5,$4 +if $4 negate fi +#@cli karo_doc : _size>0,_shape=0|1|2 (square|octagonal|circular), +#@cli : _channel see color_channels in 'apply_channels' +#@cli : compute difference of open+close and original (only 2d) +#@cli : Default values: 'size=5', 'shape=1', 'channel=0' +#@cli : $ sp tiger +karo_doc 15,2,5 replace. 0,{im} +karo_doc : +e[^1] "Compute difference of open/close and original image"$?", with window size "$1" (only 2d)." +skip "${1=5},${2=1},${3=0}" +foreach { ++karo_open[0] $1,$2,0,0,$3 +karo_close[0] $1,$2,0,0,$3 ++[-2,-1] /. 2 - +} +#@cli karo_doo : _size1>0,_size2>0,_type=0..3 (ero/dil/open/close),_shape=0|1|2 (sqaure|octagon|circle),_scale=0|1,_scale,_channel see value action, color_channels in apply_channels +#@cli : Compute difference of math. morph operation type on selected images (only 2d). +#@cli : Default values: 'size1=5', 'size2=7', 'type=2', 'shape=1', 'scale=channel=0' +#@cli : $ sp tiger +karo_doo 10,15,2,2,0,0 +karo_doo : skip "${1=5},${2=7},${3=2},${4=1},${5=0},${6=0}" +e[^-1] "Compute difference of math. morph. operator \'"${arg\ {$3+1},Erosion,Dilation,Opening,Closing}"\' on image"$?", with sizes "$1" and "$2" (only 2d)." +foreach { ++ac. "karo_morpho $3,$4,$1",$6,0 +ac.. "karo_morpho $3,$4,$2",$6,0 +if (${3}&1)==0 rv[-2,-1] fi +-[-2,-1] +if $5 n. 0,255 fi +} +#@cli karo_label_sort : +#@cli : Rearrange a label image (the selected image) according to region size +#@cli : $ 400,400 srand 12345 rand 0,1 b 3 ge 50% label_fg 0,1 +karo_label_sort dh 400,200,{iM-1},1,{iM} +#@cli : Author : KaRo and David Tsch.. Latest update : 2013/04/07. +karo_label_sort : +e[^-1] "Sort labelled image"$?" by region size." +foreach { if im=0,is_high_connectivity={ 0 | 1 }, _sort={ 0 | 1} +#@cli : Label connected components in selected images and possibly sort by region size. +#@cli : Default values: 'is_high_connectivity=sort=0' +#@cli : $ follic_ k. +karo_label 0,,1 +dh. {w},{h},{iM},1 +#@cli : Author : KaRo and David Tsch.. Latest update : 2013/04/07. +karo_label : check "$1>=0" skip "${2=0},${3=0}" +e[^-1] "Label connected components on image"$?", with tolerance "$1", "${arg\ 1+!$2,high,low}" connectivity and "${arg\ 1+!$3,sorted,unsorted}" by size" +foreach { +label. $1,$2 +if $3 +nb={1+iM} +histogram. $nb,0,{iM} +100%,1,1,1,x a[-2,-1] y sort. -,x rows. 1 +100%,1,1,1,x a[-2,-1] y sort. +,x rows. 1 +map.. . rm. +fi +} +#@cli karo_bin_fill : +#@cli : Fill holes in binary pattern. A 1-bit border is deleted to ensure background detection. +#@cli : $ follic otsu 256 +karo_bin_fill. +karo_bin_fill : foreach { if iM>0 +neq 0 f "x==0||x==(w-1)||y==0||y==(h-1)?0:i" ++eq 0 label_fg. 0 +f. "x==0||x==(w-1)||y==0||y==(h-1)?i:0" histogram. {iM#-2},1,{iM#-2} +repeat w { if i($>)!=0 +neq.. {$>+1} *... . rm. fi } rm. neq. 0 or fi +} +#@cli karo_bin_rand_del : _thickness(=1) _typ={0=all | 1=top/right | 2=bottom/left} +#@cli : Delete border (defined by _thickness) touching 4-connected objects/regions in binary pattern either around, at top/right or at bottom/left borders. The latter two serve for unbiased sampling/counting of object sets in limited test areas, the "forbidden line algorithm". +#@cli : $ follic threshold 18.6% negate[-1] +karo_bin_rand_del[-1] , +karo_bin_rand_del[-2] ,1 +karo_bin_rand_del[-3] ,2 a[-1--3] c +karo_bin_rand_del : skip "${1=1},${2=0}" check "$1>0 && $2>=0 && $2<3" +foreach { if iM>0 +neq 0 +label_fg. 0 +if $2==1 +f. "x>=(w-$1)||y<$1?i:0" +elif $2==2 +f. "x<$1||y>=(h-$1)?i:0" +else +f. "x<$1||x>=(w-$1)||y<$1||y>=(h-$1)?i:0" fi +histogram. {iM#-2},1,{iM#-2} +repeat w { +if i($>)!=0 +neq.. {$>+1} *... . rm. fi +} +rm. neq. 0 and +fi } +#@cli karo_bin_max : +#@cli : Select maximum 4-connected region in binary +#@cli : $ follic_ k. +karo_bin_max a c +karo_bin_max : foreach { if iM>0 +label_fg 0 +karo_label_sort +eq 1 +fi } +#@cli karo_segmentarea : low +#@cli : Get all 4-connected non-zero (foreground) regions of area>=low +#@cli : Delete small regions +#@cli : Number of remaining objects in status +#@cli : $ 400,400 srand 12345 rand 0,1 b 3 ge 50% +karo_segmentarea 50 a c +karo_segmentarea : +check "$1>0" +foreach { +neq. 0 label_fg. 0,0 +histogram. {iM+1} =. 0,0 ge. $1 +map.. . u {is} rm. +} +#@cli karo_threshold : _method={ triangle | yen | otsu | _otsu | bgt | intermeans | intera | rats | fixnnn | huang | huang2 | li | moments | minerrori | maxentropy | mean | renyientropy | shanbhag | bgt2 },_delclass>0,_smooth>0 +#@cli : Calculate threshold (methods derived from ImageJ) in range [0,255] using histogram evaluation, evtl. normalization necessary. Methods 'otsu','_otsu' and 'rats' base on image evaluation in contrast to the other methods. For help do 'gmic help otsu' or '... _karo__otsu' or '... rats'. Method 'fixnnn' allows to apply a fixed threshold 'nnn' calling '_karo_fix nnn'. Method 'intera' calls the internal function 'x_threshold' in interactive mode +#@cli : For each method the user function _karo_'method' is called! +#@cli : If {_delclass > 0} delete cluster {_delclass-1}. +#@cli : If {_smooth > 0} blur_x histogram with amplitude _smooth. +#@cli : No histogram processing for otsu, rats and intera! +#@cli : No test for existence of method! +#@cli : Default values: 'method=triangle', 'delclass=smooth=0' +#@cli : $ sp tiger luminance. +karo_threshold. otsu karo_threshold.. triangle +karo_threshold : skip ${1="triangle"} skip "${2=0},${3=0}" +e[^-1] "Calculate \'"$1"\' thresholded mask from images"$?" with histogram in range [0,255] and binsize 1." +if ${strcontains\ $1,fix} meth=fix +else meth=$1 fi +if ['$meth']=='otsu' otsu 256 +elif ['$meth']=='rats' karo_rats , +elif ['$meth']=='intera' st={[im,iM]} x_threshold u {st=[$st];round(${}*(st[1]-st[0])+st[0])} +else foreach { +if ['$meth']=='fix' _karo_fix ,,$1 +else +histogram. 256,0,255 +if $2>0 =. 0,{$2-1} fi +if $3!=0 tot={is} /. $tot blur_x. $3 /. {is} *. $tot round. fi ++_karo_$meth. 0,1 rm. +fi +th=${} +threshold[0] $th +if $>==0 sres=$th else sres=$sres,$th fi +} u $sres fi +#@cli karo_threshold_demo : +#@cli : Display 4x4 different threshold methods applied to selected image +#@cli : $ follic karo_threshold_demo , negate. +#@cli : $ sp to_gray karo_threshold_demo +karo_threshold_demo : skip ${1=0} +if !$! error "No image selected!" fi +e[^1] "Display several threshold methods" +repeat 16 { i=$> +arg {$i+1},bgt,huang,huang2,intermeans,li,maxentropy,mean,minerrori,bgt2,moments,otsu,rats,renyientropy,shanbhag,triangle,yen +meth=${} ++karo_threshold[0] $meth,,$1 thresh=${} +text_outline. \ $meth:\ {round($thresh)},0,0,9%,3,1,1,1,1 +e[^1] {$i+1},$meth,$thresh +} append_tiles[1-16] 4 +#@cli karo_rats : _pow(0.5) +#@cli : 'R'obust 'a'utomatic 't'hreshold 's'election (Kittler et al. 1985) +#@cli : Input image (not histogram similar otsu!) +#@cli : Default value: 'pow=0.5' +#@cli : $ osteo +karo_rats +karo_rats : +check ${1=0.5}>0 +e[^-1] "Calculate rats threshold from image$? with power "$1"." +foreach { ++gradient_norm. pow. $1 gr={is} *. .. gri={is} res={$gri/$gr} rm. +threshold. $res +if $>==0 sres=$res else sres=$sres\,$res fi +} +u $sres +#@cli _karo_triangle : _minval,_bins +#@cli : Calculate triangle threshold (from ImageJ auto thresholder) +#@cli : tested only with 256 classes from 0 to 255 +#@cli : $ sp tiger luminance +histogram 256,0,255 _karo_triangle. , +threshold[0] ${} +_karo_triangle : skip "${1=0},${2=1}" +e[^-1] "Calculate triangle threshold from 1d histogram"$?" in range ["$1","{$1+(w-1)*$2}"]." +foreach { +ac=${-autocrop_coords.} wd={w} +min={${arg\ 1,$ac}} if $min==1" && "{@0}!=0 min=0 fi +if $min>0 min={$min-1} fi +min2={${arg\ 4,$ac}} if $min2<$wd-1 min2={$min2+1} fi +dmax={iM} max={xM} +if $max-$min<$min2-$max +inverted=1 mirror[0] x min={$wd-1-$min2} max={$wd-1-$max} +else inverted=0 fi +if $min==$max split=$min else +nx={i($max)} ny={$min-$max} +d={sqrt($nx*$nx+$ny*$ny)} +nx={$nx/$d} ny={$ny/$d} +d={$nx*$min+$ny*i($min)} ++f. x *. $nx *.. $ny +[-1,-2] -. $d +crop. {$min+1},$max +if $inverted split={$wd-(xM+$min)} else split={xM+$min+1} fi +fi +res={$1+$split*$2} +if $>==0 sres=$res else sres=$sres\,$res fi +rm[0] +} u $sres +#@cli _karo_yen : _minval,_bins +#@cli : Calculate yen threshold (from ImageJ auto thresholder) +_karo_yen : skip "${1=0},${2=1}" +foreach { +if $> r_yen=${} fi +autocrop_coords. 0 range=${} mn=${arg\ 1,$range} mx=${arg\ 4,$range} +/. {is} ++cumulate. ++sqr.. cumulate. ++mirror... x sqr. cumulate. mirror[-1,-4] x +*[-1,-2] log. replace_inf. {iM} *. -1 ++*.. -1.0 +. 1.0 *[-1,-3] log.. replace_inf.. {iM} *.. 2.0 ++[-1,-2] k. +if $mn>0 repeat $mn { =. 0,$> } fi +if $mx<(w-1) repeat w-$mx { =. 0,{$mx+$>} } fi +res={xM*$2+$1} +rm. +if $> u $r_yen,$res else u $res fi +} +#@cli _karo__otsu : _minval(0) _bins(1) +#@cli : Calculate otsu threshold from a histogram +#@cli : with class o = _minval and bin size = _bins +#@cli : Threshold is stored in status +#@cli : $ sp tiger to_gray +histogram 256,0,255 _karo__otsu , threshold ${} +_karo__otsu : skip "${1=0},${2=1}" +l. { +/. {is} ++cumulate. x +++. -1. negate. ++f. "x" +*[0] . rm.. cumulate. x +++. {-iM} negate. +/.. [-4] +/. ... +-[-2,-1] sqr. +*[-1--3] replace_nan. 0.0 +u {xM*$2+$1} +rm +} +#@cli _karo_bgt : _minval,_bins +#@cli : Autothreshold using SD from whole image starting from the mode of the histogram (image range 0,255) +_karo_bgt : skip "${1=0},${2=1}" fact=1.5 +l. { +hft=${-hist_feature\ -2} mn=${arg\ 5,$hft} mx=${arg\ 6,$hft} sd=${arg\ 4,$hft} md=${arg\ 1,$hft} +if $mx-$md<=$md-$mn res={$md-$fact*$sd} +else res={$md+$fact*$sd} fi +u {$res*$2+$1} rm +} +#@cli _karo_bgt2 : _minval,_bins +#@cli : Threshold using SD from mode left or right distribution mirrored of the histogram (image range 0,255) +#@cli : Estimate from mirrored estimated background peak, derived from mode to left or to right +_karo_bgt2 : skip "${1=0},${2=1},${3=2.5}" fact=$3 +l. { +hft=${-hist_feature\ -2} +mn=${arg\ 5,$hft} mx=${arg\ 6,$hft} mean=${arg\ 3,$hft} sd=${arg\ 4,$hft} md=${arg\ 1,$hft} +if $md>$mean +. eval. "md=$md;for(ih=0,ih1" || "d>1" || "s>1 u "?" else +split={" +min=0; while(i(min)==0,min++); +max=w; while(i(max)==0,max--); +if(min>=max,res=w/2, +mvI=min; +do(sum1=sum2=sum3=sum4=0.0; +for(id=min,id<=mvI,id++,sum1+=id*i(id);sum2+=i(id)); +for(id=mvI+1,id<=max,id++,sum3+=id*i(id);sum4+=i(id)); +res=(sum1/sum2+sum3/sum4)/2.0;mvI++, +(mvI+1)<=res && mvI<(max-1))); +round(res)"} rm +u {$1+$split*$2} fi +} +_karo_huang : skip "${1=0},${2=1}" +huang={" +threshold=-1; +first_bin=0; +for(ih=0,ih=first_bin,if(i(ih)!=0,last_bin=ih;break());ih--); +term = 1.0 / ( last_bin - first_bin ); +mu_0=["{^}"]; +sum_pix = num_pix = 0; +for ( ih = first_bin, ih < w, sum_pix += ih * i(ih); num_pix += i(ih); +mu_0[ih] = sum_pix / num_pix; ih++ ); +mu_1 = mu_0; +sum_pix = num_pix = 0; +for (ih = last_bin, ih > 0, sum_pix+=ih*i(ih); +num_pix += i(ih); +mu_1[ih-1] = sum_pix / num_pix; ih-- ); +min_ent = 1e31; +for (it = 0, it < w, +ent = 0.0; +for (ih = 0,ih<=it, +mu_x = 1.0 / ( 1.0 + term * abs(ih - mu_0[it])); +if (!((mu_x < 1e-06) || (mu_x > 0.999999)), +ent += i(ih) * ( -mu_x * log ( mu_x ) - ( 1.0 - mu_x ) * log ( 1.0 - mu_x ))); +ih++); +for (ih = it + 1, ih < w, +mu_x = 1.0 / ( 1.0 + term * abs (ih - mu_1[it])); +if (!((mu_x < 1e-06) || (mu_x > 0.999999)), +ent += i(ih) * ( -mu_x * log ( mu_x ) - ( 1.0 - mu_x ) * log ( 1.0 - mu_x ))); +ih++); +if (ent < min_ent, min_ent = ent; threshold = it; _(print(min_ent,threshold))); +it++ ); +threshold"} +u {$huang*$2+$1} rm +_karo_huang2 : skip "${1=0},${2=1}" +huang2={" +for(first=0,firstfirst && i(last)==0,last--); +if(first==last,break()); +S=["{^}"]; W=S; +S[0]=i(0); +for(ii=max(1,first),ii<=last,S[ii]=S[ii-1]+i(ii);W[ii]=W[ii-1]+ii*i(ii);ii++); +C=last-first; +Smu=S; +for(ii=1,ii<(C+1),mu=1/(1+ii/C);Smu[ii]=-mu*log(mu)-(1-mu)*log(1-mu);ii++); +bestThreshold = 0; +bestEntropy = 1e31; +for(threshold=first,threshold<=last, +entropy=0; mu=round(W[threshold]/S[threshold]); +for(ii=first,ii<=threshold,entropy+=Smu[abs(ii-mu)]*i(ii);ii++); +mu=round((W[last] - W[threshold]) / (S[last] - S[threshold])); +for(ii=threshold+1,ii<=last,entropy+=Smu[abs(ii-mu)]*i(ii);ii++); +if(bestEntropy>entropy,bestEntropy=entropy;bestThreshold=threshold); +threshold++); +bestThreshold"} +u {$huang2*$2+$1} rm +_karo_li : skip "${1=0},${2=1}" +li={" +tolerance=0.5; +num_pixels=0; +mean = 0.0; +for (ih = 0, ih < w, ih++, num_pixels += i(ih);mean += ih * i(ih)); +mean /= num_pixels; +new_thresh = mean; +do( +old_thresh = new_thresh; +threshold = int(old_thresh+0.5); +sum_back = 0; +num_back = 0; +for ( ih = 0, ih<=threshold, ih++, +sum_back += ih * i(ih); +num_back += i(ih)); +if(num_back == 0,mean_back=0.0,mean_back=(sum_back/num_back)); +sum_obj = 0; +num_obj = 0; +for ( ih = threshold + 1, ih < w, ih++, +sum_obj += ih * i(ih); +num_obj += i(ih)); +if(num_obj == 0,mean_obj=0.0,mean_obj=(sum_obj/num_obj)); +temp = ( mean_back - mean_obj ) / ( log ( mean_back ) - log ( mean_obj ) ); +if (temp < -2.220446049250313e-16, new_thresh=int(temp - 0.5),new_thresh=int(temp + 0.5)), +abs(new_thresh-old_thresh)>tolerance); +threshold"} +u {$li*$2+$1} rm +_karo_moments : skip "${1=0},${2=1}" +/ {is} moments={" +m0=1.0; m1=0.0; m2 =0.0; m3 =0.0; sum =0.0; p0=0.0; +threshold = -1; +for(ih=0, ihp0, threshold = ih; break()) ); +threshold"} +u {$moments*$2+$1} rm +_karo_mean : skip "${1=0},${2=1}" +m0={is} +cumulate +f.. "x*i(x)" cumulate. m1={iM} +u {int($m1/$m0)*$2+$1} rm +_karo_minerrori : skip "${1=0},${2=1}" +m0={is} +cumulate +f.. "x*i(x)" cumulate. m1={iM} +f... "x*x*i(x)" cumulate. a y +minerrori={" +threshold=int($m1/$m0); +Tprev=-2; +ll=0; +while(threshold!=Tprev&&ll++<1000, +mu=i(threshold,2)/i(threshold,1); +nu=(i(w-1,2)-i(threshold,2))/(i(w-1,1)-i(threshold,1)); +p=i(threshold,1)/i(w-1,1); +q=(i(w-1,1)-i(threshold,1))/i(w-1,1); +sigma2=i(threshold,3)/i(threshold,1)-(mu*mu); +tau2=(i(w-1,3)-i(threshold,3))/(i(w-1,1)-i(threshold,1))-(nu*nu); +w0 = 1.0/sigma2-1.0/tau2; +w1 = mu/sigma2-nu/tau2; +w2 = (mu*mu)/sigma2 - (nu*nu)/tau2 + log10((sigma2*(q*q))/(tau2*(p*p))); +sqterm = (w1*w1)-w0*w2; +if(sqterm<0,echo('MinError(I):not converging.');break()); +Tprev = threshold; +temp = (w1+sqrt(sqterm))/w0; +if(isnan(temp),echo('MinError(I):NaN,not converging.');threshold=Tprev,threshold=floor(temp)); +); +threshold"} +u {$minerrori*$2+$1} rm +_karo_maxentropy : skip "${1=0},${2=1}" ++/. {is} +cumulate. +*. -1 +. 1.0 a y +maxentropy={" +first_bin=0; for(ih=0,ih=first_bin,ih--,if(!(abs(i(ih,3))<2.220446049250313e-16),last_bin=ih;break())); +max_ent=-1.E16; +for(it=first_bin,it<=last_bin,it++, +ent_back=0.0; for(ih=0,ih<=it,ih++,if(i(ih,0)!=0,ent_back-=(i(ih,1)/i(it,2)) * log(i(ih,1)/i(it,2)))); +ent_obj=0.0; for(ih=it+1,ih=first_bin,ih--,if(!(abs(i(ih,3))<2.220446049250313e-16),last_bin=ih;break())); +threshold=0; +max_ent = 0.0; +for(it=first_bin,it<=last_bin,it++, +ent_back = 0.0; +for(ih=0,ih<=it,ih++,if(i(ih,0)!=0,ent_back-=(i(ih,1)/i(it,2)) * log(i(ih,1)/i(it,2)))); +ent_obj = 0.0; +for(ih=it+1,ih 0.0 ? log ( ent_back * ent_obj ) : 0.0); +if(tot_ent>max_ent,max_ent=tot_ent;threshold=it); +); +t_star1 = threshold; +threshold = 0; +max_ent = 0.0; +alpha = 2.0; +term = 1.0 / ( 1.0 - alpha ); +for(it=first_bin,it<=last_bin,it++, +ent_back = 0.0; +for(ih=0,ih<=it,ih++,ent_back+=(i(ih,1)*i(ih,1))/(i(it,2)*i(it,2))); +ent_obj = 0.0; +for(ih=it+1,ih 0.0 ? log(ent_back * ent_obj ): 0.0 ); +if(tot_ent>max_ent,max_ent=tot_ent;threshold=it); +); +t_star3 = threshold; +if(t_star2=first_bin,ih--,if(!(abs(i(ih,3))<2.220446049250313e-16),last_bin=ih;break())); +threshold =-1; +min_ent = 4503599627370496.0; +for(it=first_bin,it<=last_bin,it++, +ent_back = 0.0; +term = 0.5 / i(it,2); +for(ih=1,ih<=it,ih++,ent_back-=i(ih,1)*log(1.0-term*i(ih-1,2))); +ent_back *= term; +ent_obj = 0.0; +term = 0.5 / i(it,3); +for(ih=it+1,ih0[%],_value0[%],_value1[%] +#@cli : Computes the histogram and returns in status the value of first class +#@cli : and the bin size per image. +#@cli : Default values: 'nb_levels=256', '_value0=0%', '_value1=100%' +#@cli : $ sp barbara /. 2 +. 32 _kr_histogram , e ${} dg 600,300,3 +_kr_histogram : skip "${1=256},${2=0%},${3=100%}" +e[^-1] "Calculate histgram with $1 classes in range [${2-3}] from image$?." +foreach { +if ${-is_percent\ $2} mn={im+(iM-im)*$2} else mn=$2 fi +if ${-is_percent\ $3} mx={im+(iM-im)*$3} else mx=$3 fi +if $>==0 st=$mn,{($mx-$mn)/($1-1)} else st=$st,$mn,{($mx-$mn)/($1-1)} fi +histogram. $1,$mn,$mx +} u $st +#@cli _kr_histogram8 : _nb_levels>0[%],_value0[%],_value1[%] +#@cli : same as _kr_histogram, still defaults to byte data (256,0,255) instead of (256,0%,100%) +#@cli : $ sp dog _kr_histogram8 {iM-im+1},{im},{iM} e ${} dg 600,300,3 +_kr_histogram8 : skip "${1=256},${2=0},${3=255}" +e[^-1] "Calculate histgram with $1 classes in range [${2-3}] from image$?." +foreach { _kr_histogram. ${1-3} } +#@cli hist_percentile : _nth[%],_zero={0|1},_min0,_stepw +#@cli : Estimation of _nth percentiles (lower & upper) from histogram and returning value(s) in status (${}) +#@cli : _zero Class 0 is zeroed if !=0 +#@cli : _min0 value of class 0 +#@cli : _stepw value of class width (bin size) +#@cli : Default values: 'nth=25%', '_zero=0', '_min0=0', '_stepw=1' +#@cli : $ sp tiger luminance +dh ,,256,0,255 histogram.. 256,0,255 hist_percentile.. , rm.. t=${} to_rgb text $t,40,5,23,1,255,0,0 +hist_percentile : +check "${1=25%}>=0" +skip ${2=0},${3=0},${4=1} +e[^-1] "Calculate $1 percentile from 1d histogram$?." +foreach { +if h>1" || "d>1" || "s>1 v + e[^-1] "Image "$>" seemingly not 1d!" v - continue fi +if $2!=0 set. 0,0 fi +m0={is} +N={if(${"-is_percent $1"},$m0*$1,$1)} +if ($m0*$1)==0 N=1 O=$m0 else O={$m0-$N} fi ++cumulate. ++ge. $N mn={${arg\ 1,{[xM,yM,zM,cM]}}*$4+$3} rm. ++ge. $O mx={${arg\ 1,{[xM,yM,zM,cM]}}*$4+$3} rm[-1,-2] +res=$mn\,$mx +if $>==0 sres=$res else sres=$sres\,$res fi +} u $sres +#@cli karo_morpho : action, _kernel(0), _size(5), _ckernel("1,0,1; 0,1,0; 1,0,1") +#@cli : Mathematical morphology filter +#@cli : action={0=Ero | 1=Dil | 2=Open | 3=Close | 4=Ori-Ero | 5=Dil-Ori | 6=Ori-Open | 7=Close-Ori | 8=(Ori*2-(Open+Close))*0.5 | 9=Close-Open} +#@cli : _kernel={0=Square | 1=Octogon | 2=Circle | 3=Custom} +#@cli : _size>=2(5) +#@cli : _ckernel (custom kernel only if _kernel==3) +#@cli : Default values: 'kernel=0', 'size=5','ckernel=1,0,1;0,1,0;1,0,1' +#@cli : Derived from D. Tschumperle's older fx_morpho (formerly gmic_stdlib) and extended by action 4..9 +#@cli : $ osteo +karo_morpho 4,3,,"0\,1\,0\;1\,1\,1\;0\,1\,0" +karo_morpho : +skip "${2=0},${3=5},${4='1,0,1;0,1,0;1,0,1'}" +ac=Ero,Dil,Open,Close,"Ori-Ero","Dil-Ori","Ori-Open","Close-Ori","(Ori*2-(Open+Close))*0.5","Close-Open" +ke=Square,Octagon,Circle,Custom +e[^-1] "Math. morph. filter "${arg\ {$1+1},$ac}" with kernel "${arg\ {$2+1},$ke}" and size "$3 +({'"$4"'}) f. "(i>=_'0' && i<=_'9') || i==_',' || i==_';'?i:-1" discard. -1 ckernel={t} rm. +if $2==0 m "my_erode: erode $""1" m "my_dilate: dilate $""1" +elif $2==1 m "my_erode: erode_oct $""1" m "my_dilate: dilate_oct $""1" +elif $2==2 m "my_erode: erode_circ $""1" m "my_dilate: dilate_circ $""1" +else +m "my_erode : ("$ckernel") erode[^-1] . skip $""1"" rm." +m "my_dilate : ("$ckernel") dilate[^-1] . skip $""1"" rm." +fi +if $1==0 m "my_action : my_erode $3" +elif $1==1 m "my_action : my_dilate $3" +elif $1==2 m "my_action : my_erode $3 my_dilate $3" +elif $1==3 m "my_action : my_dilate $3 my_erode $3" +elif $1==4 m "my_action : +my_erode $3 -" +elif $1==5 m "my_action : +my_dilate $3 rv -" +elif $1==6 m "my_action : +my_erode $3 my_dilate. $3 -" +elif $1==7 m "my_action : +my_dilate $3 my_erode. $3 rv -" +elif $1==8 m "my_action : +my_erode $3 my_dilate. $3 +- rm.. +my_dilate.. $3 my_erode. $3 rv[-1,-3] -[-1,-3] rv - / 2" +elif $1==9 m "my_action : +my_erode $3 my_dilate. $3 my_dilate.. $3 my_erode.. $3 -" +else m "my_action : +my_dilate $3 my_erode. $3 rv -" +fi +foreach { +my_action[0] +} +um my_erode,my_dilate,my_action +#@cli hist_feature : _nofeature>=-2,_nth>0,_zero={0|1},_min0,_stepw,_percent[%]>0 +#@cli : Estimation from histogram (frequency dist, 1d image) the features +#@cli : 'mode','sum' (m0),'mean' (m1),'SD' (m2),'min','max','median','iqr' (hiq-loq+1),'loq','hiq' returned in status (${}). +#@cli : nofeature=-2 mode,m0,m1,m2,min,max,med,iqr,loq,hiq, +#@cli : -1 mode,0 sum,1 mean,2 SD,3 min,4 max,5 median, +#@cli : 6 iqr (interquantile range),7 loq (lower quantile),8 hiq (higer qunatile) +#@cli : nth extreme value (nth+1 occurence!) +#@cli : zero Class 0 is zeroed if !=0 +#@cli : min0 value of class 0 +#@cli : stepw value of class width (bin size) +#@cli : percent quantile +#@cli : Default valalues: '_nofeature=-2', '_nth=1', '_zero=0', '_min0=0', '_stepw=1', '_percent=25%' +#@cli : Updated 140314 (smoothing replaced by nth selection) +#@cli : Updated 100817 (percent parameter and iqr,loq,hiq feature added) +#@cli : $ sp tiger luminance +histogram 256,0,255 dh.. ,,256,0,255 hist_feature , repeat 8 { t={_arg($>+1${})} text $t,40,{$>*25+5},23,1,128 } rm. +hist_feature : +check ${1=-2}>=-2" && "$1<=8" && "isint($1)" && "isint(${2=1})" && "$2>0 +skip ${3=0},${4=0},${5=1},${6=25%} +e[^-1] "Calculate md,m0,m1,m2,$2.min,$2.max,med,iqr,loq,hiq from 1d histogram$?." +foreach { +if h>1" || "d>1" || "s>1 v + e[^-1] "Data["$>"] seemingly not 1d!" v - continue fi +if $3!=0 =. 0,0 fi +md={xM*$5+$4} +m0={is} ++*. 'x*$5+$4' m1={is/$m0} rm. ++*. '(x*$5+$4)^2' m2={sqrt(is/$m0-$m1^2)} rm. +mn={"l=0; su=i(0); while(su<$2 && l=0,l--; su+=i(l)); l*$5+$4"} +med1={"l=0; su=0; while(su<=(is/2) && l=0, l--; su+=i(l)); l"} +med={($med1+$med2)/2*$5+$4} +hist_percentile. $6,$3,$4,$5 qu=${} +hiq=${arg\ 2,$qu} +loq=${arg\ 1,$qu} +iqr={${arg\ 2,$qu}-${arg\ 1,$qu}+1} +if $iqr<-1 iqr-=2 fi +res=$md\,$m0\,$m1\,$m2\,$mn\,$mx\,$med\,$iqr\,$loq\,$hiq +if $1>-2 res=${arg\ {$1+2},$res} fi +if $>==0 sres=$res else sres=$sres\,$res fi +} u $sres +#@cli hist_feature_demo : Parameters like in hist_feature +#@cli : (Plot) of features in blue into the histogram with Gaussian in green +#@cli : $ sp 0 luminance +threshold 40 * histogram 256,0,255 = 0,0 hist_feature_demo , dg 600,300,3 +hist_feature_demo : +check ${1=-2}>=-2" && "$1<=8" && "isint($1)" && "isint(${2=1})" && "$2>0 +skip ${3=0},${4=0},${5=1},${6=25%} +e[^-1] "Plot features from hist_feature into 1d histogram$?." +l. { +hist_feature. -2,${2-6} vv=${} +md=${arg\ 1,$vv} m0=${arg\ 2,$vv} m1=${arg\ 3,$vv} m2=${arg\ 4,$vv} +mn=${arg\ 5,$vv} mx=${arg\ 6,$vv} med=${arg\ 7,$vv} +lo=${arg\ 9,$vv} hi=${arg\ 10,$vv} ++gaussian. $m2,0,0 shift. {-w/2+$m1} *. {$m0/is} round. 1 +v={iM#-2} ++*. 0 +=. $v,$md =. $v,$m1 =. {$v*0.25},$mn =. {$v*0.25},$mx =. $v,$med +=. {$v*(1-$6)},$lo =. {$v*(1-$6)},$hi +a c +u $vv +} +#@cli karo_nth_max : _n(1),_ind(=0) +#@cli : Return in the status the _n-th max or the index of the n-th max of an image +#@cli : Possibility to fetch the index instead of the value (_ind=1) +#@cli : Default values: 'n=1', 'ind=0' +karo_nth_max : check isint(${1=1})" && "$1>0 skip ${2=0} +e[^-1] "Return in the status the $1-th max of image$?." +foreach { +if $2 eval argkth(-$1,{^}) u {${}-1} else eval kth(-$1,{^}) fi mx=${} +if $>==0 mx1=$mx else mx1=$mx1,$mx fi +} u $mx1 +#@cli karo_nth_min : _n(1),_ind(=0) +#@cli : Return in the status the _n-th min of an image or the index of the _n-th min of an image +#@cli : Possibility to fetch the index instead of the value (_ind!=1) +#@cli : Default values: 'n=1', 'ind=0' +karo_nth_min : check isint(${1=1})" && "$1>0 skip ${2=0} +e[^-1] "Return in the status the $1-th min of image$?." +foreach { +if $2 eval argkth($1,{^}) u {${}-1} else eval kth($1,{^}) fi mn=${} +if $>==0 mn1=$mn else mn1=$mn1,$mn fi +} u $mn1 +#@cli karo_VST : _inverse(=0) +#@cli : Variance Stabilizing Transformation +#@cli : following http://hal.archives-ouvertes.fr/docs/00/51/08/66/PDF/Burst_Hal.pdf +#@cli : $ sp tiger v1=${-std_noise},2,2 +karo_VST. 0 v2=${-std_noise},2,2 +karo_VST. 1 text... $v1 text.. $v2 +#@cli : Default values: 'inverse=0' +karo_VST : +skip ${1=0} if $1 inv=" (inverse)." else inv="." fi +e[^-1] "Variance Stabilizing Transformation"$inv +foreach { +if $1 /[0] 2 sqr[0] -[0] {3/8} else +[0] {3/8} sqrt[0] *[0] 2 fi +} +#@cli pearson_correlation : +#@cli : Compute pearson-correlation using two-by-two selected images. +#@cli : $ sp tiger +shift -30,-20 pearson_correlation text. {_${}},0,0,20%,1,255,255,255 +pearson_correlation : +e[^-1] "Compute pearson-correlation using two-by-two image"$?"." +repeat int($!/2) { l[{$>*2},{$>*2+1}] { ++-[0] {0,ia} +-[1] {1,ia} +*[2,3] +sqr[2,3] +r={ia/sqrt({2,ia}*{3,ia})} +if $>==0 u $r else u ${},$r fi +rm[2-4] +} } +#@cli karo_extinction : _whitevalue[%] +#@cli : Convert (integer) transmission image into extinction with _whitevalue. +#@cli : Default value: 'whitevalue=100%' +#@cli : $ osteo +karo_extinction +karo_extinction : check "${1=100%}>0" +e[^-1] "Convert transmission image"$?" into extinction with white value "$1"." +foreach { +if ${-is_percent\ $1} WW={iM*$1} else WW=$1 fi +c. 1,{iM} /. $WW log10. *. -1 +} +#@cli region_feature : [labelimage],_region_label(1),_feature({wh}) +#@cli : Return feature for a specified region in status. Selected image is unchanged, only one is evaluated. Argument '_feature' is a string that corresponds to the way the feature would be requested for the entire image in math. processor syntax without \{\}. +#@cli : $ 200,256 follic +threshold. 18.6% negate. label_fg. 0,1 repeat 10 { region_feature.. .,{$>+1},"ia,h" text[0] {``$>\ ${}},5,{$>*14+14},13,1,255 } +region_feature : check ${-is_image_arg\ $1} skip "${2=1},${3="wh"},${4=0}" +e[^-1] "Calculate region feature(s) \"$3\" for label==$2 in "$1" from data$?." +pass$1 l[-2,-1] { ++extract_region[0] [1],0,$2 rm[1] +u {[$3]} rm. +} +#@cli region_feature_example : _sample={follic | sample name/number},_number +#@cli : Illustrate region_feature +#@cli : $ region_feature_example 40,15 f. if(i,i*2+100,0) +region_feature_example : skip "${1=follic},${2=-1}" +if ['$1']==['follic'] $1 +threshold. 18.6% +else sp "$1" luminance. +otsu. 256 karo_open. 3 fi +negate. i[0] 200,{h} +karo_bin_rand_del. , +to_rgb.. +karo_label. 0,0,1 +repeat $2==-1?(iM>20?20:iM):(iM>$2?$2:iM) { +region_feature.. .,{$>+1},"h,ia" rf=${} +text[0] ${-padint\ {$>+1},3}\ {``$rf},5,{$>*14+14},13,1,255 ++eq. {$>+1} +karo_shape_moments. +_sm=${} +text.. {"sm=["$_sm"];["$>"+1,sm[1]+0.5,sm[2]+0.5,10,1,255,0,0]"} +draw={"sm=["$_sm"]; +ellipse(#-2,sm[1]+0.5,sm[2]+0.5,1,1,0,1,0,255,0,0); +if("$_version"<298,ellipse(#-2,sm[1]+0.5,sm[2]+0.5,-sm[13]/2,-sm[14]/2,sm[3]*180/pi+90,1,0xf0f0f0f0,255,255,0), +ellipse(#-2,sm[1]+0.5,sm[2]+0.5,-sm[13]/2,-sm[14]/2,sm[3]+pi/2,1,0xf0f0f0f0,255,255,0))"} +} +#@cli karo_feat_eval_n : [maskimage],_high_connectivity,_oneo +#@cli : Compute features from selected transmission (grey) image and multi-component maskimage. +#@cli : if _oneo is true, mask is considered as one-component maskimage +#@cli : Features: centroid (x,y), area, mean extincton, sd extinction. +#@cli : follic_ loads an example image and mask +#@cli : $ follic_ karo_feat_eval_n.. . run "repeat h#-2 { =. 2,{i(#-2,0,$>)},{i(#-2,1,$>)} }" +ge. 2 delaunay3d. n.. 0,255 j3d.. .,0,0,0,0.5,1 rm. +karo_feat_eval_n : check ${-is_image_arg\ $1} check "${2=1}>=0" skip ${3=0} +e[^-1] "Compute features from transmission image$? and multi-component mask image "$1"." +repeat $! { pass$1 0 l[$>,-1] { +if !$3 +label_fg. 0,$2 else +neq. 0 fi +mode=${"_karo_mode... ,"} if $mode<=160 mode={iM#-3} fi ++karo_extinction... $mode +l[-1,-2] { o={iM#0} 6,$o +repeat iM#0 { ++eq[0] {$>+1} nn={is} ++barycenter. cc0={@0} cc1={@1} rm. ++*[1,-1] su={is/$nn} ++. $su -sqr. *. .. su2={sqrt(is/($nn-1))} +rm[-1--2] +=. $cc0,0,$> +=. $cc1,1,$> +=. $nn,2,$> +=. $su,3,$> +=. $su2,4,$> +=. $mode,5,$> +} +} k. +} } +#@cli _karo_mode : _blur(=3), low(=-1), hig(=-1), _binsize(=1), _nodel(=0) +#@cli : Estimate mode (most frequent value) of image histogram from selected image after evtl. histogram smoothing between _low and _hig with _low==-1 min and hig=-1 max from the image. +#@cli : If _binsize<0 it represents neg. number of cluster (classes) +#@cli : If _nodel==true the histogram is kept +_karo_mode : +check ${1=3}>=0 skip "${2=-1},${3=-1},${4=1},${5=0}" +if $2==-1 low={im} else low=$2 fi +if $3==-1 hig={iM} else hig=$3 fi +if $4<0 clust={abs($4)} binsize={($hig-$low+1)/$clust} +else clust={round(($hig-$low+$4)/$4)} binsize=$4 fi +if $1>0 e[^-1] "Extract mode of image$? after smoothing $1 between "{_$low}" and "{_$hig}" binsize "$binsize" cluster "$clust +else e[^-1] "Extract mode of image$? between "{_$low}" and "{_$hig}" binsize "$binsize" cluster "$clust fi ++histogram. $clust,$low,$hig +if $1>0 b. $1 fi +u {xM*$binsize+$low} +if !$5 rm. fi +#@cli descriptive_feature : +#@cli : Estimation of features number(sum,m0),mean(m1),SD(m2),skewness(m3),kurtosis(m4),min,max,median +#@cli : from skalar images. +#@cli : See custom function example_descriptive_feature +descriptive_feature : +e[^-1] "Calculate m0,m1,m2,m3,m4,min,max,med from data$?." +foreach { +if s>1 e[^-1] "Data ["$>"] seemingly not skalar! Break!" continue fi +if $_version>=216 res={" +ff=stats(); ff[3]=sqrt(ff[3]); _(print(ff)); +m3=0;m4=0;for(ip=0,ip==0 sres=$res else sres=$sres\,$res fi +} u $sres +#@cli example_descriptive_feature : [region],_all(false),_background(false),_verbose_draw(true),_verbose_text(false) +#@cli : Example for feature extraction from a selected grey image and a [region] mask or label image using 'extract_region' and 'descriptive_feature'. More than 9 regions are truncated if _all == false. Background region (label == 0) is only calculated if _background == true. Graphical display of feature with _verbose_draw ==true and textual display only with _verbose_text == true. +#@cli : The list of features is returned in status, label,area,mean,SD,curtosis,excess,min,max,median for each region. +#@cli : 'osteo_' and 'follic_' in the examples are transmission image examples from microscopic cells with region masks +#@cli : $ osteo_ example_descriptive_feature.. . e ${} +#@cli : $ follic_ karo_extinction.. , label_fg. 0 example_descriptive_feature.. . +example_descriptive_feature : +check ${"is_image_arg $1"}" && isbool(${2=0}) && isbool(${3=0}) && isbool(${4=1}) && isbool(${5=0})" +pass$1 => Region +im={im} +if $3==0&&$im==0 im+=1 fi +num={iM-$im+1} +fe="Area","Mean","SD","Curtosis","Excess","Min","Max","Median" +m "_MC : $""=_M" +st_ff="" +nmax={$2?$num:9} +if $num>9&&$2==0 warn[0--3] "More than 9 regions! Not processed!" fi +repeat $num { ii=$> ++extract_region[0] [1],0,{$im+$ii} +if h==0 rm. warn[0--3] "Empty region "{$im+$ii}"! Not processed!" continue fi +descriptive_feature. rm. temp_ff=${} _MC ${} +u {$im+$ii},$temp_ff temp_ff=${} +if $4 128,128,1,3 text. "Features label: "{$im+$ii},0,0,12,1,255,255,0 fi +if $5 +e[] "Features label: "{$im+$ii} fi +repeat 8 { +ff=${arg\ {$>+1},$fe}\ =\ {_${_M{$>+1}}} +if $5 +e[] $ff fi +if $4 text. $ff,0,{($>+2)*12},12,1,255,255,0 fi +} +if ${strlen\ $st_ff}>0 st_ff=$st_ff,$temp_ff else st_ff=$temp_ff fi +nmax-=1 if !$nmax break fi +} rm[Region] uncommand _MC +if $4 if $num>3 append_tiles[1--1] 3 fi fi +u $st_ff +#@cli kr_mean_lch : _mode(0..4) +#@cli : Calculate LCH color features from selected RGB image after application of rgb2lch [ mean l(uminance), c(hromaticity), h(hue), sd l, c, h ] returned in status and global variable _kr_mean_lch. Mean and sd of h is the circular mean and sd of hue (angles)! There is no test of image mode RGB! +#@cli : mode==0 return original (default) +#@cli : mode==1 return original and image generated from original l(uminance) and mean c, mean h +#@cli : mode==2 return original and const. image generated from mean l(uminance), mean c, mean h +#@cli : mode==3 return original and image generated from l(uminance), c, mean h +#@cli : mode==4 return original and image generated from l(uminance), mean c, h +#@cli : Default value: 'mode=0' +#@cli : $ sp wall kr_mean_lch. 1 (${}) s. x,2 rm. +#@cli : $ sp +luminance threshold. 50% karo_close. 15,1 +extract_region.. .,0,1 kr_mean_lch. 0 (${}) rm.. +rgb2lch... s. c f.. {-4,@1} f. {-4,@2} a[-1--3] c lch2rgb. rm.. f. I=i#-2?I:I#-3 # Replace region with mean chromaticity amd mean hue +kr_mean_lch : +check "isnum(${1=0}) && $1>=0 && $1<5" ++rgb2lch. s. c +hmsd=${-kr_circular_mean.} hm=${-arg\ 1,$hmsd} hsd=${-arg\ 2,$hmsd} +_kr_mean_lch={[ia#-3,ia#-2,$hm,sqrt(iv#-3),sqrt(iv#-2),$hsd]} +lm={ia#-3} cm={ia#-2} +if $1==1 f.. i=$cm f. i=$hm +elif $1==2 f... i=$lm f.. i=$cm f. i=$hm +elif $1==3 f. i=$hm +elif $1==4 f.. i=$cm +else k[0] fi +if $1>0&&$1<=4 a[-1--3] c lch2rgb. round. fi +u $_kr_mean_lch +#@cli karo_shape_moments +#@cli : selected image considered as binary or skalar pattern with pixle values==0 outside the pattern or region and either ==1 (for binary) or !=0 for skalar pattern. Calculation of shape moments and other features returned in status. With mean==1 input was binary otherwise skalar! Moments m00=sum, m10,m01 centroid, orientation=theta, mean, h1-h7 Hu's moment invariants, with length. +#@cli : Result in status: +#@cli : sum centroid_x,y theta eccenticity mean Hu_moments_1-7 main_axis_lengths +#@cli : 0-14 m00 m10 m01 theta excent mean h1 h2 h3 h4 h5 h6 h7 width length +#@cli : Result in global variable _karo_shape_moments: moments, centered and normalized moments m, my, eta, Hu's moment invariants h1-h7, orientation, eigenvalues, eccentricity and extension: +#@cli : 0-15 [[$m00,$m01,$my02,$my03],[$m10,$my11,$my12,0],[$my20,$my21,0,0],[$my30,0,0,0]], +#@cli : 16-31 [[$eta00,$eta01,$eta02,$eta03],[$eta10,$eta11,$eta12,0],[$eta20,$eta21,0,0],[$eta30,0,0,0]], +#@cli : 32-39 [$h1,$h2,$h3,$h4,$h5,$h6,$h7,0], +#@cli : 40-47 [$theta,$lambda1,$lambda2,$excent,0,0,0,0] +#@cli : $ osteo_ k. +karo_shape_moments _sm=${} to_rgb n 0,255 circle ${arg\ 2,$_sm},${arg\ 3,$_sm},1%,1,255,0,0 +#@cli : $ osteo_ * +karo_shape_moments _sm=${} to_rgb n 0,255 circle ${arg\ 2,$_sm},${arg\ 3,$_sm},1%,1,255,0,0 +karo_shape_moments : +l. { ++extract[0] "i!=0",1 extract[0] "i!=0",2 +s[1] c rm[3] +*[1,2] [0] +m00,m10,m01={[is#0,is#3/is#0,is#4/is#0]} rm[3,4] ++[1] {-$m10} ++[2] {-$m01} ++sqr[1,2] ++*[3,4] [1] ++*[3,4] [2] ++*[1,2] +*[1-9] [0] +my11,my20,my02,my21,my12,my30,my03={[is#9,is#3,is#4,is#7,is#6,is#5,is#8]} +eta00,eta10,eta11,eta01,eta20,eta21,eta02,eta12,eta30,eta03={[$m00/h#1,0,$my11/$m00^2,0,$my20/$m00^2,$my21/$m00^2.5,$my02/$m00^2,$my12/$m00^2.5,$my30/$m00^2.5,$my03/$m00^2.5]} +h1,h2,h3,h4,h5,h6,h7={[$eta20+$eta02,sqr($eta20-$eta02)+4*sqr($eta11),sqr($eta30-3*$eta12)+sqr(3*$eta21-$eta03),sqr($eta30+$eta12)+sqr($eta21+$eta03),($eta30-3*$eta12)*($eta30+$eta12)*(sqr($eta30+$eta12)-3*sqr($eta21+$eta03))+(3*$eta21-$eta03)*($eta21+$eta03)*(3*sqr($eta30+$eta12)-sqr($eta21+$eta03)),($eta20-$eta02)*(sqr($eta30+$eta12)-sqr($eta21+$eta03))+4*$eta11*($eta30+$eta12)*($eta21+$eta03),(3*$eta21-$eta03)*($eta30+$eta12)*(sqr($eta30+$eta12)-3*sqr($eta21+$eta03))-($eta30-3*$eta12)*($eta21+$eta03)*(3*sqr($eta30+$eta12)-sqr($eta21+$eta03)^2)]} +theta,lambda1,lambda2={[0.5*atan2(2*$my11,$my20-$my02),0.5*($my20+$my02)/$m00+0.5*sqrt(4*($my11/$m00)^2+($my20/$m00-$my02/$m00)^2),0.5*($my20+$my02)/$m00-0.5*sqrt(4*($my11/$m00)^2+($my20/$m00-$my02/$m00)^2)]} +excent={sqrt(1-$lambda2/$lambda1)} +_karo_shape_moments={[[[$m00,$m10,$my20,$my30],[$m01,$my11,$my21,0],[$my02,$my12,0,0],[$my03,0,0,0]],[[$eta00,$eta10,$eta20,$eta30],[$eta01,$eta11,$eta21,0],[$eta02,$eta12,0,0],[$eta03,0,0,0]],[$h1,$h2,$h3,$h4,$h5,$h6,$h7,0],[$theta,$lambda1,$lambda2,$excent,0,0,0,0]]} +rm +} +l. { +rotate. {-$theta/pi*180},1,0,$m10,$m01 +extract. "i!=0",1 s c +min10,max10,min01,max01={[im#-3,iM#-3,im#-2,iM#-2]} +wid,len={[min($max10-$min10,$max01-$min01),max($max10-$min10,$max01-$min01)]} +rm +} +u $m00,$m10,$m01,$theta,$excent,$eta00,$h1,$h2,$h3,$h4,$h5,$h6,$h7,$wid,$len +#@cli karo_shape_moments_example : +#@cli : Any selected skalar image is evaluated for all pixels != 0 +#@cli : $ osteo_ k. karo_shape_moments_example +karo_shape_moments_example : ++karo_shape_moments. +_sm=${} to_rgb. n. 0,255 +ellipse. {sm=[$_sm];[sm[1]+0.5,sm[2]+0.5,sm[13]/2,sm[14]/2,(sm[3]<0?sm[3]+pi/2:sm[3])/pi*180]},1,0xf0f0f0f0,255,0,0 +circle. {sm=[$_sm];[sm[1]+0.5,sm[2]+0.5]},1%,1,255,0,0 +e[^1] {sm=[$_karo_shape_moments];sm[40]=(sm[40]<0?sm[40]+pi/2:sm[40])/pi*180;sm[40,4]} +#@cli :: User Karo's GIMP/gui Custom functions +#@cli fx_karo_mm_diff : _size,_size2,_operation,_shape,_channel,_scale +#@cli : Compute difference of math. morph. operation with two sizes on selected images. +#@cli : _size = int(5,1,25) +#@cli : _size2 = int(7,1,25) +#@cli : _operation = choice(2,"Erosion","Dilation","Open","Close") +#@cli : _shape = choice(1,"Square","Octagon","Circle") +#@cli : _channel = choice(0,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]", +#@cli : "Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]", +#@cli : "YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]", +#@cli : "YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]", +#@cli : "Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]", +#@cli : "HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]", +#@cli : "CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@cli : _scale = bool(true) +#@cli : Arithmetical difference of a morphological operation of size and size2. +#@cli : Author : KaRo. Latest update : 2019/09/03. +fx_karo_mm_diff : +skip "${1=5},${2=7},${3=2},${4=1},${5=0},${6=1}" +if $2<=$1 s2={$1+2} else s2=$2 fi +e[^-1] "Compute difference of math. morph. operation with two sizes "$1","$2" on selected images$?." +karo_doo $1,${s2},$3,$4,$6,$5 +to_rgb +fx_karo_mm_diff_preview : +gui_split_preview "fx_karo_mm_diff ${1-6}",${-3--1} +#@cli fx_karo_cimg_nlmeans : add_Gauss_noise(0),add_uniform_noise(0),add_salt_pepper(0),patch_size(0),lambda(-1),noise_sd(-1),alpha(3),steps(2) +#@cli : Execute use_nlmeans (CImg demo) external. +fx_karo_cimg_nlmeans : +skip "${1=0},${2=0},${3=0},${4=1},${5=-1},${6=-1},${7=3},${8=2}" +e[^-1] "Compute non-local means on selected images$?. CImg example \"use_nlmeans\" " +e[^-1] "with -ng "$1" -nu "$2" -ns "$3" -p "$4" -lambda "$5" -sigma "$6" -alpha "$7" -sampling "$8" -visu 03" +karo_nlmeans -ng,$1,-nu,$2,-ns,$3,-p,$4,-lambda,$5,-sigma,$6,-alpha,$7,-sampling,$8 +fx_karo_cimg_nlmeans_preview : +gui_split_preview "fx_karo_cimg_nlmeans ${1-8}",${-3--1} +#@cli fx_karo_cimg_skel : auto_thresh(1),thresh(50%),median(0),invert(0),thresh_flux(-0.3),medial_curve(0),Torsello corr(0),steps(1) +#@cli : Execute use_skeleton (CImg demo) external. +fx_karo_cimg_skel : +skip "${1=1},${2=50},${3=0},${4=0},${5=-0.3},${6=0},${7=0},${8=1}" +if $1 e[^-1] "Compute skeleton on selected images$? binarized with \"otsu 256\"" +else e[^-1] "Compute skeleton on selected images$? binarized with \"threshold "$2"%\"" fi +e[^-1] "CImg example \"use_skeleton\" with -median "$3" -inv "$4" -t "$5" -curve "$6" -corr "$7" -dlt "$8" -visu 0" +if $1 otsu 256 else threshold ${2}% fi +karo_skeleton median,$3,-inv,$4,-t,$5,-curve,$6,-corr,$7,-dlt,$8 n 0,255 +fx_karo_cimg_skel_preview : +gui_split_preview "fx_karo_cimg_skel ${1-8}",${-3--1} +#@cli fx_karo_oc_diff : _size,_shape,_channel,_scale +#@cli : Compute difference of math. morph opening and closing on selected images. +#@cli : _size = int(5,1,25) +#@cli : _shape = choice(1,"Square","Octagon","Circle") +#@cli : _channel = choice(0,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]", +#@cli : "Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]", +#@cli : "YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]", +#@cli : "YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]", +#@cli : "Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]", +#@cli : "HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]", +#@cli : "CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@cli : _scale = bool(true) +#@cli : Arithmetical difference of a morphological operation of size and size2. +#@cli : Author : KaRo. Latest update : 2019/09/03. +fx_karo_oc_diff : +skip "${1=5},${2=1},${3=0},${4=1}" +apply_channels "karo_doc $1,$2,0",$3,$4 +to_rgb +fx_karo_oc_diff_preview : +gui_split_preview "fx_karo_oc_diff ${1-4}",${-3--1} +#@cli fx_karo_pink : _operator(=11), _connect(=0), _smooth(=0), _param(=5), _channel(=0) +#@cli : _operator = 0..19 ("wshedtopo","wshedtopo inv","minima","maxima","heightminima","heightmaxima","grayskel","htkern","htkernu","lvkern","lvkernu","saliency","asf","asflin","asfr","asft","asftmed","asftndg","dilatballnum","erosballnum","lintophat") +#@cli : _connect = 0..1 ("Four/x","Eight/y") +#@cli : _smooth = 0.. +#@cli : _param = 0..25 +#@cli : _channel = choice(0,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@cli : $ sp tiger +fx_karo_pink , +- +#@cli : $ sp tiger +fx_karo_pink. 12,1,0.582524,10,0,0 +fx_karo_pink.. 12,0,0.582524,10,0,0 +[-1,-2] # asflin in x and y +fx_karo_pink : +skip "${1=12},${2=0},${3=0},${4=5},${5=0}" +coms="pink heightminima,{($2+1)*4},$4 pink wshedtopo,{($2+1)*4}","pink heightmaxima,{($2+1)*4},$4 pink wshedtopo,{($2+1)*4},i","pink minima,{($2+1)*4}","pink maxima,{($2+1)*4}","pink heightminima,{($2+1)*4},$4","pink heightmaxima,{($2+1)*4},$4","pink grayskel,null,4,$4","pink htkern,null,{($2+1)*4}","pink htkernu,null,{($2+1)*4}","pink lvkern,null,{($2+1)*4}","pink lvkernu,null,{($2+1)*4}","pink saliency,6b","pink asf,$4","[0]x2 a z if $2==0 pink asflin,x,$4 else pink asflin,y,$4 fi s z k.","pink asfr,$4","pink asft,null,null,{($2+1)*4},$4","pink asftmed,{($2+1)*4},$4","pink asftndg,null,null,{($2+1)*4},$4","pink dilatballnum,$4","pink erosballnum,$4","pink lintophat,$4" +if $1>=0&&$1<20 arg {$1+1},$coms else arg 1,$coms} fi com=${} +if $3>0 apply_channels "b $3 round "$com,$5,0 else apply_channels "round "$com,$5,0 fi +fx_karo_pink_preview : +gui_split_preview "fx_karo_pink ${^0}",${-3--1} +fx_karo_pink_bin : +skip "${1=1},${2=50},${3=3},${4=0},${5=5},${6=4},${7=0}" +coms="karo_frame 2 pink skelpar,$6,$5","karo_frame 2 pink skelend,{$4?8:4},$5","pink skelcurv,$6,{$4?8:4}","karo_frame 2 pink_skeleton $6,{$4?8:4}","pink barycentre,{$4?8:4}","pink border,{$4?8:4}","pink closeball,$5,$6","pink openball,$5,$6","pink convexhull,3","pink dist,$6","pink distc,$6","pink label,{($4+1)*4},pla","pink lantuejoul,$6" +if $3>=0&&$3<13 arg {$3+1},$coms else arg 1,$coms} fi com=${} +apply_channels "if $1 otsu 256 else threshold ${2}% fi "$com" n 0,255",$7,0 +fx_karo_pink_bin_preview : +gui_split_preview "fx_karo_pink_bin ${^0}",${-3--1} +#@cli fx_karo_pink_bianca : Pink test operator bianca +#@cli : ASF smooth size = int(5,1,10) +#@cli : Threshold (%) = int(60,0,100) +#@cli : Watershed height min = int(5,0,20) +#@cli : Opening radius = int(1,0,10) +#@cli : Invert = bool(0) +#@cli : Use G instead of B = bool(0) +#@cli : Pink test operator Bianca for RGB image; only B used. +#@cli : Pink executables in search PATH or C:\\Pink\\bin\\ for Windows +#@cli : Author : KaRo. Latest update : 2012/11/18 +#@cli : note = link("https://perso.esiee.fr/~coupriem/Pink/doc/html/files.html") +fx_karo_pink_bianca : +skip "${1=5},${2=60},${3=5},${4=1},${5=0},${6=0}" +if !${-is_windows} exe="label" else exe="C:\Pink\bin\label" fi +if $5 negate fi +s c if $6 k.. else k. fi ++round +pink. asf,$1 +- k[-1,-3] threshold. $2% ++round.. +pink_wshed. ,1,$3 +pink. $exe,4,max threshold. 1 +erode_oct.. {$4*2+1} dilate_oct.. {$4*2+1} ++*[-1,-2] negate.. n[-1,-2] 0,255 a[-1,-2,-4] c k[0] +fx_karo_pink_bianca_preview : +gui_split_preview "fx_karo_pink_bianca ${^0}",${-3--1} +fx_jr_multi_mosaic: +to_rgba +repeat $! l[$>] +repeat $1 +l[0] ++gradient_norm n. 0,1 b. $5 +100%,100%,100%,2,'u/max(1,($1-1))))*0.01))^4?[u,1]' s. c +distance. 1 *. -1 watershed.. . rm[1,3] +blend shapeaverage +1,1,1,3,([$6,$7,$8]) rgb2lch8. f. "I+[u(-255,255)*$9%,u(-255,255)*$10%,u(-255,255)*$11%]" lch82rgb. fx_balance_gamma.. {I(#-1,0,0,0)},0 rm. ++to_rgb. +fx_gradient_norm. ${13-16},0 dilate_circ $17 to_rgba. 1,1,1,3,([$18,$19,$20]) rgb2lch8. f. "I+[u(-255,255)*$21%,u(-255,255)*$22%,u(-255,255)*$23%]" lch82rgb. f.. "[I(#-1,0,0,0),($12<0?255-i0:i0)*abs($12)]" rm. +blend alpha +done done +rm[0] +if $24 blend_edges $25 fi +smooth ${26-31},0 +done done +fx_normalize_local ${32-37} +fx_jr_multi_mosaic_preview : +fx_jr_multi_mosaic ${2-38} +rgb2lms : +wx=95.047 +wy=100 +wz=108.883 +wrx=95.047 +wry=100 +wrz=108.883 +sr=0.2 +la=(10^2) +yb=1 +factor={min((0.8+$sr),1)} +adapt=($factor*(1-(exp(-($la+42)/92))/3.6)) +kmm=(1/((5*$la)+1)) +flmm=($kmm^4*$la+0.1*(1-$kmm^4)^2*(5*$la)^1/3) +1,1,1,3,"["$wx","$wy","$wz"]*0.01" +1,1,1,3,"["$wrx","$wry","$wrz"]*0.01" +(0.7328,0.4296,-0.1624;-0.7036,1.6975,0.0061;0.003,0.0136,0.9384) +invert. ++mix_channels[-4,-3] [-1] +lumcorr={i(#-6,0,0,0,1)/i(#-5,0,0,0,1)} +lmult={i(#-1,0,0,0,0)/i(#-2,0,0,0,0)} +mmult={i(#-1,0,0,0,1)/i(#-2,0,0,0,1)} +smult={i(#-1,0,0,0,2)/i(#-2,0,0,0,2)} +rm[-2,-1] +to_rgb[0] rgb2xyz[0] 1 f[0] "I/[0.95047,1,1.08883]" +mix_channels[0] [-2] +f[0] "begin(n=("$lumcorr"*["$lmult","$mmult","$smult"]*"$adapt")+1-"$adapt");n*I" +mix_channels[0] [-1] +(0.38971,0.68898,-0.07868;-0.22981,1.1834,0.04641;0,0,1) +mix_channels[0] [-1] +rm. +f[0] "temp=("$flmm"*abs(I))^0.42; +sign(I)*400*(temp/(temp+27.13))+0.1" +rm[^0] +lms2rgb : +wx=95.047 +wy=100 +wz=108.883 +wrx=95.047 +wry=100 +wrz=108.883 +sr=0.2 +la=(10^2) +yb=1 +factor={min((0.8+$sr),1)} +adapt=($factor*(1-(exp(-($la+42)/92))/3.6)) +kmm=(1/((5*$la)+1)) +flmm=($kmm^4*$la+0.1*(1-$kmm^4)^2*(5*$la)^1/3) +1,1,1,3,"["$wx","$wy","$wz"]*0.01" +1,1,1,3,"["$wrx","$wry","$wrz"]*0.01" +(0.7328,0.4296,-0.1624;-0.7036,1.6975,0.0061;0.003,0.0136,0.9384) +invert. ++mix_channels[-4,-3] [-1] +lumcorr={i(#-6,0,0,0,1)/i(#-5,0,0,0,1)} +lmult={i(#-1,0,0,0,0)/i(#-2,0,0,0,0)} +mmult={i(#-1,0,0,0,1)/i(#-2,0,0,0,1)} +smult={i(#-1,0,0,0,2)/i(#-2,0,0,0,2)} +rm[-2,-1] +f[0] "(sign(I-0.1)*(1/"$flmm")*((27.13*abs(I-0.1))/(400-abs(I-0.1)))^(1/0.42))" +(0.38971,0.68898,-0.07868;-0.22981,1.1834,0.04641;0,0,1) invert. +mix_channels[0] [-1] +rm. +mix_channels[0] [-2] +f[0] "begin(n=("$lumcorr"*["$lmult","$mmult","$smult"]*"$adapt")+1-"$adapt");I/n" +mix_channels[0] [-1] +f[0] "I*[0.95047,1,1.08883]" xyz2rgb[0] 1 +rm[^0] +dct_tileset: +{$1^2},{$2^2},1,1 +f. :"begin(const tw=$1;const th=$2;const stw=sqrt(tw);const sth=sqrt(th);const itw=1/tw;const ith=1/th;const istw=sqrt(itw);const isth=sqrt(ith);const s2=sqrt(2)); +px=x%tw; +py=y%th; +tx=(x-(px))*itw; +ty=(y-(py))*ith; +cx=cos((tx*0.5+((tx+0.5)*x*itw))*pi)*istw; +cy=cos((ty*0.5+((ty+0.5)*y*ith))*pi)*isth; +px!=0?(cx*=s2); +py!=0?(cy*=s2); +val=cx*cy; +val; +" +idct_tileset: +{$1^2},{$2^2},1,1 +f. :"begin(const tw=$1;const th=$2;const stw=sqrt(tw);const sth=sqrt(th);const itw=1/tw;const ith=1/th;const istw=sqrt(itw);const isth=sqrt(ith);const s2=sqrt(2)); +px=x%tw; +py=y%th; +tx=(x-(px))*itw; +ty=(y-(py))*ith; +cx=cos((x+0.5)*tx*pi*itw)*istw; +cy=cos((y+0.5)*ty*pi*ith)*isth; +tx!=0?(cx*=s2); +ty!=0?(cy*=s2); +val=-cx*cy*(((tx+ty)%2)*2-1); +val; +" +rgb2ycbcrjpeg : +rgb2srgb gcd_srgb2jpeg +ycbcrjpeg2rgb : +gcd_jpeg2srgb srgb2rgb +rgb2jzczhz : +afre_jchz +jzczhz2rgb : +afre_ijchz +pseudo_ecb: +ww={w+4} +hh={h+4} +total_image_minus_one={$!-1} +if $total_image_minus_one&&$30 expand_xy 4,$31 a x _pseudo_ecb ${1-29} s x,{$total_image_minus_one+1} shrink_xy 4 rv +else _pseudo_ecb ${1-29} fi +_pseudo_ecb: +csswap $1,0 +repeat $! l[$>] +repeat $20+1 +pseudo_ecb_generate ${2-19},${21-29} +done +done +csswap 0,$1 +done +pseudo_ecb_generate: +-m "MergeChoice : $""=_mode" -MergeChoice "add","alpha","and","average","blue","burn","darken","difference","divide","dodge","exclusion","freeze","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor","edges","error" ++ac "ecb_gradient_base[0] $6,$7,$8",rgb +if $2==1 _pseudo_c[1] fi +local[1] +if $5==1 +ac "ecb_gradient_base[0] $9,$10,$11",rgb +_pseudo_c[1] +blend ${_mode{$12+1}},$13 if $1==1 equalize fi fi +done +local[0] +sharpen $14 +if $2==1 +_pseudo_c[0] +elif $2==1 [0] fi ++fx_blend_bomb[0] 0,1,$15,$15,0,0,$16,0,0,0,1,0 +blend ${_mode{$19+1}},$20 +done +fx_blend_bomb[1] 0,1,$17,$17,0,0,$18,0,0,0,0,0 +if $1==1 equalize[1] fi +blend ${_mode{$21+1}},$22 +if $1==1 +equalize blend ${_mode{$3+1}},$4 fi +if $1==0 [0] blend ${_mode{$3+1}},$4 fi +if $23==1 [0] if $24==1 equalize[1] fi if $25==1 _pseudo_c[1] fi blend ${_mode{$26+1}},$27 +fi +ecb_gradient_base: +f "ang=pi*$2/180;G=x*cos(ang)+y*sin(ang);G%$1" n 0,255 +if $3==1 mul -1 abs fi +_pseudo_c : v - if s!=1 to_gray. fi {max(1,round(iM,1,1))},1,1,3,u(255) round. map.. . rm. v + +_pseudo_ecb_preview : +gui_split_preview "pseudo_ecb $*",${-3--1} +fx_row_shift : +repeat $! l[$>] +z 0,0,{w+1},{h+1},2 +inv={($7*-2)+1} +opt={int(($1-1)*$inv)} +if $opt==-1 +f "j((y-h*$3)*$2*"$inv",0,0,0,$6,2)" +f "j(0,(x-w*$5)*$4*"$inv",0,0,$6,2)" +elif $opt==1 +f "j(0,(x-w*$5)*$4*"$inv",0,0,$6,2)" +f "j((y-h*$3)*$2*"$inv",0,0,0,$6,2)" +else +if $inv==1 +f "j((y-h*$3)*$2*"$inv",(x-w*$5)*$4*"$inv",0,0,$6,2)" +elif $inv==-1 +f "j((y-h*$3)*$2*"$inv",(x-w*$5)*$4*"$inv",0,0,$6,2)" +fi +fi +z 0,0,{w-1},{h-1} +done done +fx_row_shift_preview : +fx_row_shift $* +sawtoother_cmy_k : +repeat $! l. split_opacity rv to_rgb. +fx_start_mix $26,$27 +if $19 rgb2cmyk. else rgb2cmy. fi s. c +index=0 +if $19 index=-1 if $23 b[-1] $22% +[-1] $25 %[-1] {256/$20} *[-1] $20 %[-1] 256 *[-1] $24 +[-1] $21 else *[-1] $20 +[-1] {$21*$20} b[-1] $22% fi fi +if $4 b[{$index-3}] $3% +[{$index-3}] $6 %[{$index-3}] {256/$1} *[{$index-3}] $1 %[{$index-3}] 256 *[{$index-3}] $5 +[{$index-3}] $2 else *[{$index-3}] $1 +[{$index-3}] {$2*$1} b[{$index-3}] $3% fi +if $10 b[{$index-2}] $9% +[{$index-2}] $12 %[{$index-2}] {256/$7} *[{$index-2}] $7 %[{$index-2}] 256 *[{$index-2}] $11 +[{$index-2}] $8 else *[{$index-2}] $7 +[{$index-2}] {$8*$7} b[{$index-2}] $9% fi +if $16 b[{$index-1}] $15% +[{$index-1}] $18 %[{$index-1}] {256/$13} *[{$index-1}] $13 %[{$index-1}] 256 *[{$index-1}] $17 +[{$index-1}] $14 else *[{$index-1}] $13 +[{$index-1}] {$14*$13} b[{$index-1}] $15% fi +c 0,255 a[{$index-3}--1] c +if $19 cmyk2rgb. else cmy2rgb. fi +fx_end_mix $26 +if $!!=3 rv a c fi done mv. 0 done +sawtoother_cmy_k_preview : +sawtoother_cmy_k $* +sawtoother_hsx : +repeat $! l. split_opacity rv to_rgb. +fx_start_mix $20,$21 +if $13==1 rgb2hsi. elif $13==2 rgb2hsl. else rgb2hsv. fi +s. c +if $4 +[-3] $6 %[-3] {360/($1)^2} *[-3] $1 %[-3] 360 *[-3] {$5*$1} +[-3] {$2} else *[-3] $1 +[-3] {$2*$1} fi %[-3] 360 +if $10 b[-2] $9% +[-2] $12 %[-2] {(1+(1/255))/$7} *[-2] {$7} %[-2] {(1+(1/255))} *[-2] $11 +[-2] {$8} else *[-2] $7 +[-2] {$8*$7} b[-2] $9% fi +if $17 b[-1] $16% +[-1] $19 %[-1] {(1+(1/255))/$14} *[-1] {$14} %[-1] {(1+(1/255))} *[-1] $18 +[-1] {$15} else *[-1] $14 +[-1] {$15*$14} b[-1] $16% fi +c[-2,-1] 0,1 a[-3--1] c +if $13==1 hsi2rgb. elif $13==2 hsl2rgb. else hsv2rgb. fi +if $3 l[-1] +b $3% rgb2hsv[0,1] f.. "[i0(#1),i1,i2]" rm. hsv2rgb done fi +fx_end_mix $20 +if $!!=3 rv a c fi done mv. 0 done +sawtoother_hsx_preview : +gui_split_preview "sawtoother_hsx $*",$-1 +sawtoother_lab8 : +repeat $! l. split_opacity rv to_rgb. +fx_start_mix $19,$20 +rgb2lab8. s. c +if $4 b[-3] $3% +[-3] $6 %[-3] {256/$1} *[-3] $1 %[-3] 256 *[-3] $5 +[-3] $2 else *[-3] $1 +[-3] {$2*$1} b[-3] $3% fi +if $10 b[-2] $9% +[-2] $12 %[-2] {256/$7} *[-2] $7 %[-2] 256 *[-2] $11 +[-2] $8 else *[-2] $7 +[-2] {$8*$7} b[-2] $9% fi +if $16 b[-1] $15% +[-1] $18 %[-1] {256/$13} *[-1] $13 %[-1] 256 *[-1] $17 +[-1] $14 else *[-1] $13 +[-1] {$14*$13} b[-1] $15% fi +a[-3--1] c lab82rgb. +fx_end_mix $19 +if $!!=3 rv a c fi done mv. 0 done +sawtoother_lab8_preview : +sawtoother_lab8 $* +sawtoother_lch8 : +repeat $! l. split_opacity rv to_rgb. +fx_start_mix $19,$20 +rgb2lch8. +s. c +if $4 +[-3] $6 %[-3] {256/$1} *[-3] $1 %[-3] 256 *[-3] $5 +[-3] $2 else *[-3] $1 +[-3] {$2*$1} b[-3] $3% fi +if $10 b[-2] $9% +[-2] $12 %[-2] {256/$7} *[-2] $7 %[-2] 256 *[-2] $11 +[-2] $8 else *[-2] $7 +[-2] {$8*$7} b[-2] $9% fi +if $16 b[-1] $15% +[-1] $18 %[-1] {256/($13)^2} *[-1] $13 %[-1] 256 *[-1] {$17*$13} +[-1] {$14} else *[-1] $13 +[-1] {$14*$13} b[-1] $15% fi %[-1] 256 +a[-3--1] c c. 0,255 lch82rgb. +if $3 l[-1] +b $3% rgb2lch8[0,1] f.. "[i0,i1,i2(#1)]" rm. lch82rgb done fi +fx_end_mix $19 +if $!!=3 rv a c fi done mv. 0 done +sawtoother_lch8_preview : +sawtoother_lch8 $* +sawtoother_rgb : +repeat $! l. split_opacity rv to_rgb. +fx_start_mix $19,$20 +s. c ++[-2,-1] 0.5 +if $4 b[-3] $3% +[-3] $6 %[-3] {256/$1} *[-3] $1 %[-3] 256 *[-3] $5 +[-3] $2 else *[-3] $1 +[-3] {$2*$1} b[-3] $3% fi +if $10 b[-2] $9% +[-2] $12 %[-2] {256/$7} *[-2] $7 %[-2] 256 *[-2] $11 +[-2] $8 else *[-2] $7 +[-2] {$8*$7} b[-2] $9% fi +if $16 b[-1] $15% +[-1] $18 %[-1] {256/$13} *[-1] $13 %[-1] 256 *[-1] $17 +[-1] $14 else *[-1] $13 +[-1] {$14*$13} b[-1] $15% fi +a[-3--1] c c. 0,255 +fx_end_mix $19 +if $!!=3 rv a c fi done mv. 0 done +sawtoother_rgb_preview : +gui_split_preview "sawtoother_rgb $*",$-1 +sawtoother_srgb : +repeat $! l. split_opacity rv to_rgb. +fx_start_mix $19,$20 +rgb2srgb. s. c ++[-2,-1] 0.5 +if $4 b[-3] $3% +[-3] $6 %[-3] {256/$1} *[-3] $1 %[-3] 256 *[-3] $5 +[-3] $2 else *[-3] $1 +[-3] {$2*$1} b[-3] $3% fi +if $10 b[-2] $9% +[-2] $12 %[-2] {256/$7} *[-2] $7 %[-2] 256 *[-2] $11 +[-2] $8 else *[-2] $7 +[-2] {$8*$7} b[-2] $9% fi +if $16 b[-1] $15% +[-1] $18 %[-1] {256/$13} *[-1] $13 %[-1] 256 *[-1] $17 +[-1] $14 else *[-1] $13 +[-1] {$14*$13} b[-1] $15% fi +a[-3--1] c c. 0,255 srgb2rgb. +fx_end_mix $19 +if $!!=3 rv a c fi done mv. 0 done +sawtoother_srgb_preview : +sawtoother_srgb $* +sawtoother_xyz8 : +repeat $! l. split_opacity rv to_rgb. +fx_start_mix $19,$20 +rgb2xyz8. s. c ++[-2,-1] 0.5 +if $4 b[-3] $3% +[-3] $6 %[-3] {256/$1} *[-3] $1 %[-3] 256 *[-3] $5 +[-3] $2 else *[-3] $1 +[-3] {$2*$1} b[-3] $3% fi +if $10 b[-2] $9% +[-2] $12 %[-2] {256/$7} *[-2] $7 %[-2] 256 *[-2] $11 +[-2] $8 else *[-2] $7 +[-2] {$8*$7} b[-2] $9% fi +if $16 b[-1] $15% +[-1] $18 %[-1] {256/$13} *[-1] $13 %[-1] 256 *[-1] $17 +[-1] $14 else *[-1] $13 +[-1] {$14*$13} b[-1] $15% fi +a[-3--1] c c. 0,255 xyz82rgb. +fx_end_mix $19 +if $!!=3 rv a c fi done mv. 0 done +sawtoother_xyz8_preview : +gui_split_preview "sawtoother_xyz8 $*",$-1 +sawtoother_ycbcr : +repeat $! l. split_opacity rv to_rgb. +fx_start_mix $20,$21 +if $1==1 rgb2ycbcrglic. elif $1==2 rgb2srgb. gcd_srgb2jpeg. else rgb2ycbcr. fi s. c ++[-2,-1] 0.5 +if $5 b[-3] $4% +[-3] $7 %[-3] {256/$2} *[-3] $2 %[-3] 256 *[-3] $6 +[-3] $3 else *[-3] $2 +[-3] {$3*$2} b[-3] $4% fi +if $11 b[-2] $10% +[-2] $13 %[-2] {256/$8} *[-2] $8 %[-2] 256 *[-2] $12 +[-2] $9 else *[-2] $8 +[-2] {$9*$8} b[-2] $10% fi +if $17 b[-1] $16% +[-1] $19 %[-1] {256/$14} *[-1] $14 %[-1] 256 *[-1] $18 +[-1] $15 else *[-1] $14 +[-1] {$15*$14} b[-1] $16% fi +a[-3--1] c c. 0,255 if $1==1 ycbcrglic2rgb. elif $1==2 gcd_jpeg2srgb. srgb2rgb. else ycbcr2rgb. fi +fx_end_mix $20 +if $!!=3 rv a c fi done mv. 0 done +sawtoother_ycbcr_preview : +gui_split_preview "sawtoother_ycbcr $*",$-1 +sawtoother_yiq8 : +repeat $! l. split_opacity rv to_rgb. +fx_start_mix $19,$20 +rgb2yiq8. s. c ++[-2,-1] 0.5 +if $4 b[-3] $3% +[-3] $6 %[-3] {256/$1} *[-3] $1 %[-3] 256 *[-3] $5 +[-3] $2 else *[-3] $1 +[-3] {$2*$1} b[-3] $3% fi +if $10 b[-2] $9% +[-2] $12 %[-2] {256/$7} *[-2] $7 %[-2] 256 *[-2] $11 +[-2] $8 else *[-2] $7 +[-2] {$8*$7} b[-2] $9% fi +if $16 b[-1] $15% +[-1] $18 %[-1] {256/$13} *[-1] $13 %[-1] 256 *[-1] $17 +[-1] $14 else *[-1] $13 +[-1] {$14*$13} b[-1] $15% fi +a[-3--1] c c. 0,255 yiq82rgb. +fx_end_mix $19 +if $!!=3 rv a c fi done mv. 0 done +sawtoother_yiq8_preview : +gui_split_preview "sawtoother_yiq8 $*",$-1 +sawtoother_yuv8 : +repeat $! l. split_opacity rv to_rgb. +fx_start_mix $19,$20 +rgb2yuv8. s. c ++[-2,-1] 0.5 +if $4 b[-3] $3% +[-3] $6 %[-3] {256/$1} *[-3] $1 %[-3] 256 *[-3] $5 +[-3] $2 else *[-3] $1 +[-3] {$2*$1} b[-3] $3% fi +if $10 b[-2] $9% +[-2] $12 %[-2] {256/$7} *[-2] $7 %[-2] 256 *[-2] $11 +[-2] $8 else *[-2] $7 +[-2] {$8*$7} b[-2] $9% fi +if $16 b[-1] $15% +[-1] $18 %[-1] {256/$13} *[-1] $13 %[-1] 256 *[-1] $17 +[-1] $14 else *[-1] $13 +[-1] {$14*$13} b[-1] $15% fi +a[-3--1] c c. 0,255 yuv82rgb. +fx_end_mix $19 +if $!!=3 rv a c fi done mv. 0 done +sawtoother_yuv8_preview : +gui_split_preview "sawtoother_yuv8 $*",$-1 +_fx_shredder : +repeat $! l[$>] +xming={$4/100} +xmaxg={$5/100} +strengthx={($6^4)} +yming={$7/100} +ymaxg={$8/100} +strengthy={($9^4)} +to_rgba split_opacity to_rgb.. to_gray. +l[0] +if $2 +csswap 0,{($2)-1} +fi +done +if $3 a c fi +l[0] +if $10==1 +mirror[0] x +elif $10==2 +mirror[0] y +elif $10==3 +mirror[0] xy +fi +if $11 +rotate[0] {$11*90},0 +fi +[0] +f[0] ">begin((!$1)?(col=0;row=0):(col=u*w^2;row=u*h^2);countx=(u("$xming","$xmaxg")^3)*wh+1;county=(u("$yming","$ymaxg")^3)*wh+1); +countx-=1; +county-=1; +countx<=0?(col=(u*w);countx=(u("$xming","$xmaxg")^3)*wh+1); +county<=0?(row=(u*h);county=(u("$yming","$ymaxg")^3)*wh+1); +(!$2)?J(#-1,"$strengthx"*col,"$strengthy"*row,0,0,2) +:j(#-1,"$strengthx"*col,"$strengthy"*row,0,0,0,2)" +rm[1] +if $11 +rotate[0] {-$11*90},0 +fi +if $10==1 +mirror[0] x +elif $10==2 +mirror[0] y +elif $10==3 +mirror[0] xy +fi +if $2>=1 +s[0] c +if $3 a[^-1] c else a c fi +l[0] +if $2 +csswap {($2)-1},0 +fi +done +fi +done +a c +done done +fx_shredder : +_fx_shredder ${2--1} +fx_shredder_preview : +fx_shredder $* +_jr_smooth_eq_prepare : +f. "begin(scale=((w^2+h^2+d^2)^0.5)/2;ol=$2^3;oh=$25^3;ql=(2-2/(($3+1)^2));qh=(2-2/(($26+1)^2));rsl=1/(2^$1);rsh=1/(2^$24);ol=$2^3;oh=$25^3; +order1=$5^3;band1=$6^2;gain1=$7; +order2=$9^3;band2=$10^2;gain2=$11; +order3=$13^3;band3=$14^2;gain3=$15; +order4=$17^3;band4=$18^2;gain4=$19; +order5=$21^3;band5=$22^2;gain5=$23); +vx=(x-w/2);vy=(y-h/2);vz=(z-d/2);rad=((vx^2+vy^2+vz^2)^0.5)*scale/16; +fl=rad*rsl; +fh=(rad*rsh)^-1; +func=(1/((1-ql*(fl)^(ol/2)+(fl)^(ol))^0.5)); +func*=2^(gain1/sqrt(1+2*abs(log2(rad/(2^"$4"))/(band1))^order1)); +func*=2^(gain2/sqrt(1+2*abs(log2(rad/(2^"$8"))/(band2))^order2)); +func*=2^(gain3/sqrt(1+2*abs(log2(rad/(2^"$12"))/(band3))^order3)); +func*=2^(gain4/sqrt(1+2*abs(log2(rad/(2^"$16"))/(band4))^order4)); +func*=2^(gain5/sqrt(1+2*abs(log2(rad/(2^"$20"))/(band5))^order5)); +func*=(1/((1-qh*(fh)^(oh/2)+(fh)^(oh))^0.5)); +func" +_jr_smooth_eq : +v - +100%,100%,100% +_jr_smooth_eq_prepare ${1-26} +shift. {int(w/2)},{int(h/2)},{int(d/2)},0,2 +fft.. *... . *[-2,-1] ifft rm[-1] +v + +fx_jr_smooth_eq : +repeat $! l[$>] +if !$28 split_opacity fi +l[0] +gain={iM} csswap 0,$27 +_jr_smooth_eq ${1-26} +csswap $27,0 if $29 abs fi if $30 * {$gain/iM} fi +done +if !$28 a c fi +done done +fx_jr_smooth_eq_preview : +if $31 +rm +4000,1,1 _jr_smooth_eq_prepare ${1-26} +columns 50%,100% +1000,500,1,1 +f. "cut((i(#-2,2^(x*log2(w)/w-1),0,0,0,2,1)*(255)-y)*127.5,0,255)" +mirror y +r. 50%,100% +k[-1] +else +fx_jr_smooth_eq ${1-30} +fi +_superstreak : +repeat $! l[$>] +to_rgba +if !$5 T,R,G,B,A=0 else T,R,G,B,A=${1-5} fi +select_color $T,$R,$G,$B,$A +f.. " +const step = max(1,$6%*min(w,h)); +const angle = $7*pi/180; +const dx = step*cos(angle); +const dy = step*sin(angle); +if (!i(#-1),I, +ixf = xf = x; iyf = yf = y; lf = 0; if ($8>=1, while (i(#-1,ixf=round(xf),iyf=round(yf)), ++lf; xf-=dx; yf-=dy)); +ixb = xb = x; iyb = yb = y; lb = 0; if ($8!=1, while (i(#-1,ixb=round(xb),iyb=round(yb)), ++lb; xb+=dx; yb+=dy)); +$8==0?I(ixb%w,iyb%h): +$8==1?I(ixf%w,iyf%h): +$8==2?(lf] +srand {int(u*65535)} +repeat $2 +a=((u($4,$5)^2)*512) +b={round(u(0,255))} +c={round(u(0,255))} +d={round(u(0,255))} +e={round(u(0,255))} +f={u($6,$7)} +g={u(0,360)} +_superstreak {$a},{$b},{$c},{$d},{$e},{$f},{$g},$3 +done +done done +fx_superstreak_preview : +fx_superstreak $* +_fx_uw3: +[0] +if $5 f.. "ni = norm(R,G,B); I(#0) = J(#1,(ni)*$1-$3,(ni)*$2-$4,0,2,3)" +else f.. "i(#0)=j(#1,(i)*$1-$3,(i)*$2-$4,0,0,2,3)" +fi +rm[1] +fx_ultrawarp3: +if $1!=-1 srand $1 fi +num=$2 +wm=$3 +wmr=$4 +wa={$5*pi/180} +war={$6*pi/180} +om=$7 +omr=$8 +oa={$9*pi/180} +oar={$10*pi/180} +cc=$11 +inter=$12 +bound=$13 +cs=$14 +channels=$15 +csswap 0,$14 +repeat $! l[$>] +om*={norm(w,h)*0.001} +omr*={norm(w,h)*0.001} +srand {int(u*65535)} +repeat $2 +wmag={((($wm+(u-0.5)*$wmr)*0.1)^2)*10} +omag={((($om+(u-0.5)*$omr)*0.1)^2)*10} +wangle={$wa+(u-0.5)*$war} +oangle={$oa+(u-0.5)*$oar} +wx={$wmag*sin(-$wangle%(2*pi))} +wy={$wmag*cos(-$wangle%(2*pi))} +ox={$omag*sin(-$oangle%(2*pi))} +oy={$omag*cos(-$oangle%(2*pi))} +ac " +_fx_uw3 "$wx","$wy","$ox","$oy","$cc","$inter","$bound"",$channels +done +csswap $14,0 +done done +fx_ultrawarp3_preview : +fx_ultrawarp3 ${2-16} +fx_jr_rep_cubism: +to_gray +rotac=$9 +rotar=$10 +rotxxc=$11 +rotxxr=$12 +rotxyc=$13 +rotxyr=$14 +rotxzc=$15 +rotxzr=$16 +aa=$17 +repeat $! l[$>] +ww={w} +hh={h} +dd={d} +xoffc=$3*0.01*$ww +xoffr=$4*0.01*$hh +yoffc=$5*0.01*$dd +yoffr=$6*0.01*$ww +zoffc=$7*0.01*$hh +zoffr=$8*0.01*$dd ++gradient_norm +100%,100%,100%,2,'begin(n=-1);ubegin(randm=u(100,200);randa=u(1,3));srand((x+(randa)+(u))*(randm+y));u(-1,1)" +eval. "begin(multvec=["$xoffr","$yoffr","$zoffr","$rotar","$rotxxr","$rotxyr","$rotxzr"]; +addvec=["$xoffc","$yoffc","$zoffc","$rotac","$rotxxc","$rotxyc","$rotxzc"]); +for(n=0,n0))?( +dist=i(#3,x,y,z,0); +xdist=i(#3,x,y,z,1)*dist; +ydist=i(#3,x,y,z,2)*dist; +zdist=i(#3,x,y,z,3)*dist; +idlist=vector(#8,-1); +freqlist=vector(#8,0); +idnum=0; +xint=floor(xdist);yint=floor(ydist);zint=floor(zdist); +xo=xdist-xdist;yo=ydist-ydist;zo=zdist-zdist; +gridmult=[(1-xo)*(1-yo)*(1-zo),xo*(1-yo)*(1-zo),(1-xo)*yo*(1-zo),xo*yo*(1-zo),(1-xo)*(1-yo)*zo,xo*(1-yo)*zo,(1-xo)*yo*zo,xo*yo*zo]; +for(pz=0,pz<2,pz++, +for(py=0,py<2,py++, +for(px=0,px<2,px++, +curr=i(#1,x+xint+px,y+yint+py,z+zint+pz,0,1,0); +pos=find(idlist,curr); +pos==-1?(idnum+=1;pos=find(idlist,-1);idlist[pos]=curr); +freqlist[pos]+=gridmult[(pz*4)+(py*2)+px]; +); +); +); +val=0; +for(n=0,n-{$>+7}] +repeat 8 +iter=$> +l[$>] +if $3==0 +/ {2^$iter} cut 0,1 round 0,1 * {2^$iter} +elif $3==1 +cut 0,1 round 0,1 * {2^$iter} +elif $3==2 +/ 255 cut 0,1 round 0,1 * {2^$iter} +fi +done done ++ +done done +else +repeat 8 +[0] +&[-1] {2^$>} +if $3==1 +/[-1] {2^$>} +elif $3==2 +/[-1] {2^$>/255} +fi +if !$2 a[^0] z fi +done +rm[0] +fi +fx_bitplane8_preview : +fx_bitplane8 $* +fx_jr_bilinear: +repeat $! l[$>] +to_rgba +ac " +repeat $1 +. +repeat $2 bilateral.. $3,$4 done +-. .. +*. {2^($5*0.5)} ++. .. +rm.. +done +",$6 +done done +fx_jr_bilinear_preview: +gui_split_preview "fx_jr_bilinear $*",${-3--1} +bitplane8 : +100%,100%,8,100%,"(i(#-1,x,y,0,c)>>z)&1" rm[0] +debitplane8 : +f "a=0;for(k=0,k<8,++k,a+=i(x,y,k)*2^k)" +_fx_mesh_blend : +r. 256,256,100%,100%,$1 +if $4 to_rgba else to_rgb fi +if $2 rv[0,1] fi +f[$3] "i(#2,i(#0),256-i(#1))" +if !$5 rm[2] fi +if $3 rm[0] else rm[1] fi +fx_mesh_blend : +if $1==0 repeat int($!/3) l[$>-{$>+2}] rv _fx_mesh_blend ${2-6} done done +elif $1==1 repeat $! l[$>] [0]x2 _fx_mesh_blend ${2-6} done done fi +fx_mesh_blend_preview : +fx_mesh_blend $* +_crazy_texture : +to_rgb fc 0,0,0 +ms1=0 if $10==1 ms1={0.125*max(w,h)/($2^0.375)} else ms1=$10 fi +ms2=0 if $15==1 ms2={0.625*max(w,h)/($2^0.25)} else ms2=$15 fi +CF={$8*$13*$19} +if $18 expand_xy {$CF} fi +noise_poissondisk $1,$2 +fx_edge_offsets ${3-7} +jr_deform $8,$9,$ms1,$11,0,$12,1 +jr_deform $13,$14,$ms2,$16,0,$17,1 +if $18 shrink_xy {$CF} fi +fx_crazy_texture: +_crazy_texture ${2-20} +fx_crazy_texture_preview : +fx_crazy_texture $* +rectexture: +split_opacity l[0] +if $2==0 +fill_color[-1] ${-RGB} +elif $2==1 +fill_color[-1] ${-RGB} +elif $2==2 +fill_color[-1] ${-RGB} +else +rr={255*round(u)} +fill_color[-1] $rr,$rr,$rr +fi +repeat max(0,$1) ++fill_color 0,0,0 +if $2==0 +rectangle[-1] {u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,1,${-RGB} +blend[-1,-2] difference +elif $2==1 +rectangle[-1] {u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,1,${-RGB} +blend[-1,-2] difference +elif $2==2 +rectangle[-1] {u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,1,${-RGB} +blend[-1,-2] difference +else +rectangle[-1] {u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,1,255,255,255 +blend[-1,-2] difference +fi +done +if $4==0 +f={u(0,3)} +elif $4==1 +f={u(0,2)+1} +else +f={($4)-2} +fi +fx_warp_by_intensity {$3*(u(2)-1)},{$3*(u(2)-1)},{w*$3*(u(2)-1)},{h*$3*(u(2)-1)},0,0,{$f},0,0 +if $2==1 +normalize 0,{u(5,20)*pi} sin[-1] -n 0,255 +fi +if $2==2 +normalize 0,{u(5,20)*pi} sin[-1] -n 0,255 +mults=u(0,2.5) +multv=u(0,2.5) +fx_mix_hsv {(2^u(0,2.5))-1},{u(-180,180)},0,{(2^$mults)-1},{max(0,2-(2^$mults))*u(-1,1)},0,{(2^$multv)-1},{max(0,2-(2^$multv))*u(-1,1)},0,0,2,0 +fi +done a c +fx_rectexture: +repeat $! l[$>] +ac "rectexture ${2-5}",$-2,$-1 +done done +fx_blend_shapeaverage : +if ${3=0} _fx_revert_layers fi +to_rgb +repeat int($!/2) +rv[-2,-1] +if $1 i[0] . fi +blend[-2,-1] shapeaverage0 +if $1 *[0,-1] /[0] 255 mv[0] $! fi +if $2 to_rgba. replace_color. 0,0,0,0,0,255,0,0,0,0 fi +mv. 0 done +Lylejk_Luma_Invert : +fx_decompose_channels[-1] 5,0,1,0 +negate[-3] +if $1==1 +fx_decompose_channels[-1,-2,-3] 5,1,1,0 +else +pow[-3] $1 +n[-3] 0,255 +fx_decompose_channels[-1,-2,-3] 5,1,1,0 +fi +Lylejk_Luma_Invert_preview : +gui_split_preview "Lylejk_Luma_Invert $*",$-1 +Lylejk_Quantize_Wicker : +quantize $1,1,1 +if $4==1 shift $2%,$3%,0,0,2,1 fi +fx_superpixels $5,$6,$7,$8,$9,$10,$11,$12,$13 +dilate $14 +if $4==1 shift {-$2}%,{-$3}%,0,0,2,1 fi +resize {w/2},{h/2} +c 0,255 +Lylejk_Wicker $15,$16,$17,150,0.42,0.85,0.6,7.83,0.68,19,2.64,0,1,1,0,0.5,10.5,100,0,0,0.5,10.5,100,0,1.15,5,1,0.68,0.5,10.5,100,0,1,1,10,1,0,0 +if $18==1 deblur ${19-23} c 0,255 fi +Lylejk_Quantize_Wicker_preview : +gui_split_preview "Lylejk_Quantize_Wicker $*",$-1 +Lylejk_Ribbon: +Largeur_Origine={w} +Hauteur_Origine={h} +if $36==1||$36==2 +split_opacity +scale_dcci2x ${37-39} +append c +cut 0,255 +fi +repeat $11 +smooth $1,$2,$3,$4,$5,$6,$7,$8,$9,$10 +done +fx_diffusiontensors $12,$13,$14,$15,$16,$17,$18,$19 +repeat $30 +smooth $20,$21,$22,$23,$24,$25,$26,$27,$28,$29 +done +blur $31 +gradient_norm ^ $32 +cut $33%,$34% +if $35 +negate +fi +normalize 0,255 +if $36==2 +resize $Largeur_Origine,$Hauteur_Origine +c 0,255 +fi +Lylejk_Ribbon_preview : +gui_split_preview "Lylejk_Ribbon $*",$-1 +lylejk_test_TRW : +if $3==0 shift $1%,$2%,0,0,2,1 fi +fx_superpixels $4,$5,$6,$7,$8,$9,$10,$11,$12 +if $3==1 shift $1%,$2%,0,0,2,1 fi +if !$16 to_a fi +euclidean2polar $13%,$14%,$15,$16 +fx_superpixels $4,$5,$6,$7,$8,$9,$10,$11,$12 +if !$16 to_a fi +polar2euclidean $13%,$14%,$15,$16 +shift {-$1}%,{-$2}%,0,0,2,1 +resize {w/2},{h/2} +c 0,255 +Lylejk_Wicker $17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$53 +lylejk_test_TRW_preview : +gui_split_preview "lylejk_test_TRW $*",$-1 +Lylejk_Wicker : skip ${33=0},${34=1},${35=10},${36=1},${37=0} +if $33 +apply_channels "repeat $34 b $36 unsharp $36,$35 c 0,255 mv[-1] 0 done",$37,0 +fi +rodilius $1,$2,$3,5,30,1 +smooth 10,0,1,1,1,0.8,45 +sharpen 30 +cut 0,255 +repeat $14 +smooth $4,$5,$6,$7,$8,$9,$10,$11,$12,$13 +done +blur $15 +gradient_norm ^ $16 +cut $17%,$18% +if $19 +negate +fi +normalize 0,255 +blur $20 +gradient_norm ^ $21 +cut $22%,$23% +if $24 +negate +fi +normalize 0,255 +split_opacity +scale_dcci2x ${25-27} +append c +cut 0,255 +blur $28 +gradient_norm ^ $29 +cut $30%,$31% +if $32 +negate +fi +normalize 0,255 +Lylejk_Wicker_preview : skip ${33=0},${34=1},${35=10},${36=1},${37=0} +gui_split_preview "Lylejk_Wicker $*",$-1 +Lylejk_Woven : +if $48==1 quantize $49,1,1 fi +if $46 blur $47 fi +ripple $1,$2,$3,$4,$5 +ripple $6,$7,$8,$9,$10 +fx_superpixels $11,$12,$13,$14,$15,$16,$17,$18,$19 +mirror x +ripple $20,$21,$22,$23,$24 +mirror x +mirror x +ripple $25,$26,$27,$28,$29 +mirror x +repeat $40 +smooth $30,$31,$32,$33,$34,$35,$36,$37,$38,$39 +done +blur $41 +gradient_norm ^ $42 +cut $43%,$44% +if $45 +negate +fi +normalize 0,255 +Lylejk_Woven_preview : +gui_split_preview "Lylejk_Woven $*",$-1 +fx_lylejk_stencil : +apply_channels "repeat $1 b $3 unsharp $3,$2 c 0,255 mv. 0 done",$4,0 +Lylejk_Wicker_2 : +if $33==2 i [-1] i [-1] fi +if $54==1 quantize[-1] $55,1,1 fi +if $3==1 +shift[-1] $1%,$2%,0,0,2,1 +if $56==1 if !$7 to_a[-1] fi euclidean2polar[-1] $4%,$5%,$6,$7 fi +fx_superpixels[-1] $8,$9,$10,$11,$12,$13,$14,$15,$16 +fi +if $3==0 +if $56==1 if !$7 to_a[-1] fi euclidean2polar[-1] $4%,$5%,$6,$7 fi +fx_superpixels[-1] $8,$9,$10,$11,$12,$13,$14,$15,$16 +fi +if $56==1 if !$7 to_a[-1] fi polar2euclidean[-1] $4%,$5%,$6,$7 fi +if $3==1 shift[-1] {-$1}%,{-$2}%,0,0,2,1 fi +repeat $27 +smooth[-1] $17,$18,$19,$20,$21,$22,$23,$24,$25,$26 +done +blur[-1] $28 +gradient_norm[-1] ^[-1] $29 +cut[-1] $30%,$31% +if $32 +negate[-1] +fi +normalize[-1] 0,255 +if $33==1 +deblur[-1] ${34-38} c[-1] 0,255 +elif $33==2 +repeat $41 bilateral[-2] $39,$40 done +samj_blend_20220419[-2,-3] grainextract +repeat $52 +smooth[-2] $42,$43,$44,$45,$46,$47,$48,$49,$50,$51 +done +samj_blend_20220419[-1,-2] grainmerge,$53,1 +fi +Lylejk_Wicker_2_preview : +gui_split_preview "Lylejk_Wicker_2 $*",$-1 +garagecoder_lylejk_samj_points_outlines : +Choice_Filter=$1 +Less_Than_Staroutline=$2 +Shapecloud_Staroutline=$3 +Less_Than_Pointoutline=$4 +Determination_Contours=$5 +Type_Rendu=$6 +Dilatation={2+$7} +if $Choice_Filter==0 +normalize[-1] 0,255 +blur[-1] 2 +isophotes[-1] 6 +100%,100%,1,1 +noise[-1] 0.5,1 +lt[-1] {$Less_Than_Staroutline-0.5} +mul[-1,-2] +shape_star , +garagecoder_example_shapecloud[-2] [-1],$Shapecloud_Staroutline +rm[-1] +elif $Choice_Filter==1 +normalize[-1] 0,255 +blur[-1] 2 +isophotes[-1] 6 +100%,100%,1,1 +noise[-1] 0.5,1 +lt. {$Less_Than_Pointoutline-0.5} +mul[-1,-2] +_circle 5 +dilate[-2] [-1] +rm. +elif $Choice_Filter==2 +if $Determination_Contours==0 +blur[-1] 2 +isophotes[-1] 6 +elif $Determination_Contours==1 +n[-1] 128,255 +to_pseudogray[-1] 5,1,8 +blur[-1] 2 +isophotes[-1] 6 +elif $Determination_Contours==2 +tones[-1] 3 +isophotes[-1,-2] 3 +samj_blend_20220419[-1,-2] alpha +samj_blend_20220419[-1,-2] alpha +mul[-1] 255 +isophotes[-1] 3 +fi +{w},{h},1,4 +repeat (w+h)/1.5 +line[-2] 50%,50%,{u(100)}%,{u(100)}%,1,0,0,0,0 +done +repeat (w+h)/2 +line[-1] {u(100)}%,{u(100)}%,{u(100)}%,{u(100)}%,1,255,255,255,255 +done +repeat (w+h)/5 +point {u(100)}%,{u(100)}%,0,1,255,255,255,255 +done +and[-1,-2] +if $Type_Rendu==0 +dilate_circ[-1] $Dilatation +elif $Type_Rendu==1 +i [-1] +i [-1] +dilate_circ[-3] $Dilatation +dilate[-2] 6,1 +dilate[-1] 1,6 +samj_blend_20220419[-1,-2,-3] alpha +elif $Type_Rendu==2 +dilate_circ[-1] $Dilatation +sponge[-1] 5 +fi +fi +garagecoder_lylejk_samj_points_outlines_preview : +gui_split_preview "garagecoder_lylejk_samj_points_outlines $*",$-1 +garagecoder_example_shapecloud : check ${"is_image_arg $1"}" && isnum(${2=9})" +repeat $! pass$1 0 l[$>,-1] +kw={$2+1-$2%2} r. $kw,$kw,1,1,5 n. 0,1 ++gt[0,1] 0 convolve[-2] [-1] rm. +convolve[0] [1] rm[1] +eq. 0 +[-2,-1] / +done done +mc_film_grain : +__mc_film_grain 0,{max(w,h)},{min(w,h)},$"*" + +mc_film_grain_preview : +long_side={max(w,h)} +short_side={min(w,h)} +gui_crop_preview +__mc_film_grain 1,$long_side,$short_side,$"*" +__mc_film_grain_usage : +msg.="1.Load a grain pattern file with sample grain to be added to an image\n" +msg.="2.A grain file can be either a crop (usually 1000x1000 px) of a digitised 24Mp\n" +msg.=" 35mm film frame, or the whole full 35mm frame digitised at any resolution\n" +msg.=" if the file is at least 6Mp (3000x2000 px).\n" +msg.="3.Select desired blend options (tip: grain merge usually gives better results).\n" +msg.="4.Select grain size options:\n" +msg.="- \"Film Format\" may shrink or enlarge the grain to better emulate the look of\n" +msg.=" film grain at the chosen format\n" +msg.="- \"Scale\" allows further tuning of grain size on top of the selected Film Format.\n" +msg.="- \"Micrograin\" attempts to add a little bit of small-sized grain to the mix for\n" +msg.=" better-looking texture at larger grain sizes.\n" +msg.="5.Change grain appearance to taste by altering the grain sharpness, contrast \n" +msg.=" and gamma.\n" +msg.="6.Normalisation will fit the grain pixel values between a range of low and high\n" +msg.=" values. This affects the grain blending result, and can be used to bring more\n" +msg.=" grain into the highlights, change the overal blending effect, etc.\n" +msg.="7.Adjust a couple of properties of the input image:\n" +msg.="- \"Blur/Sharpen\" can affect the interplay of image details and the applied grain.\n" +msg.=" Film grain may sometimes look more natural when applied to a softer image.\n" +msg.="- \"Highlight Compression\" will bring down the highlights, including blown-out\n" +msg.=" areas, making some more grain visible in the highlights.\n" +msg.="8.You can enable the preview of the grain alone to better assess the effect of\n" +msg.=" the above filter parameters on the grain.\n" +msg.="\n" + +msg.="$1" + +gui_print_preview "Usage:",,$msg + +__mc_film_grain : + +is_preview,img_long_side,img_short_side,grain_file_path,texture_type,blend_mode_opt,blend_opacity,film_fmt_opt,\ +scale_pct,micrograin,gr_sharpness,gr_contrast,gr_gamma,gr_norm_opt,gr_norm_low,gr_norm_high,img_sharpness,img_highl_compress,\ +preview_opt,show_usage=$"*" + +print_debug={$preview_opt>1} +preview_grain={{$preview_opt==1}||{$preview_opt==3}} + +blend_modes=alpha,grainmerge,overlay,softlight,hardlight,alpha + +local { +input $grain_file_path +normalize. 0,255 +onfail +if $is_preview +__mc_film_grain_usage "(Error loading grain pattern file)" +fi +return +} +if "$is_preview && $show_usage" +__mc_film_grain_usage "(Click anywhere to dismiss usage tips...)" +return +fi + +debug_msg.="Image size: "{$img_long_side}"x"{$img_short_side}" ("{f2ui($img_long_side*$img_short_side/1000000)}"Mp)\n" +debug_msg.="Preview size: "{$_preview_width}"x"{$_preview_height}"\n" +debug_msg.="Grain sample file: "$grain_file_path"\n" + +aspect={$img_long_side/$img_short_side} +if $film_fmt_opt==1 scale_pct/=0.75 +elif $film_fmt_opt==2 scale_pct/=0.54 +elif $film_fmt_opt==3 +if "$aspect<1.355 && $aspect>1.34" +scale_pct/=1.77 +else +scale_pct/=2.33 +fi +elif $film_fmt_opt==4 +if $aspect>=3 +scale_pct/=0.3958 +else +scale_pct/=0.6958 +fi +fi +ref_frame_long=6000 +ref_frame_short=4000 +if "max(w,h) > 3000 && min(w,h) > 2000" +ref_frame_long={max(w,h)} +ref_frame_short={min(w,h)} +debug_msg.="Grain file as: Full-Frame\n" +crop. {w/2-500},{h/2-500},{w/2+499},{h/2+499} +else +debug_msg.="Grain file as: Crop\n" +fi +debug_msg.="Grain full-frame size: "{$ref_frame_long}"x"{$ref_frame_short}" ("{f2ui($ref_frame_long*$ref_frame_short/1000000)}"Mp)\n" +debug_msg.="Grain patch size: "{-1,w}"x"{-1,h}"\n" + +foreach[^-1] { +split_opacity +pass. 0 +total_scale_pct={_$scale_pct*$img_short_side/$ref_frame_short} +resize2dx. {w*$total_scale_pct/100.0},5 +debug_msg.="Total grain scaling: "{f2ui($total_scale_pct)}"%\n" +debug_msg.="Scaled grain patch size: "{-1,w}"x"{-1,h}"\n" +if "$total_scale_pct>66 && $micrograin" +debug_msg.="Micrograin: enabled (intensity="{$micrograin}")" ++resize2dx. {w/3},5 +syntexturize. {-2,w},{-2,h} +blend[-1,-2] overlay,{0.2+0.8*$micrograin/10} +fi +if $texture_type==0 ++syntexturize. {0,max(10,w)},{0,max(10,h)} +else ++syntexturize_matchpatch. {0,max(10,w)},{0,max(10,h)} +fi +if $gr_sharpness>0 +sharpen. {$gr_sharpness*10},1 +elif $gr_sharpness<0 +blur. {-1*$gr_sharpness/4} +fi +adjust_colors. 0,$gr_contrast,$gr_gamma,0,0 c. 0,255 +if $gr_norm_opt==1 +normalize. $gr_norm_low,$gr_norm_high +elif $gr_norm_opt==2 +cut. $gr_norm_low,$gr_norm_high +fi +resize {0,w},{0,h},1,100%,5 c. 0,255 +if "$preview_grain && $is_preview" +keep[0,-1] +reverse +else +if $img_sharpness>0 +sharpen[0] {$img_sharpness*10} +elif $img_sharpness<0 +blur[0] {-1*$img_sharpness/5} +fi +if $img_highl_compress +apply_curve[0] 0.4,0,0,192,{192-3*$img_highl_compress/4},255,{255-3*$img_highl_compress} +fi + +blend[0,-1] ${arg\ {$blend_mode_opt+1},$blend_modes},{if($blend_mode_opt>0,$blend_opacity/100,1)} +if $img_highl_compress +apply_curve[0] 0.4,0,0,192,{192+2*$img_highl_compress/4},255,{255+2*$img_highl_compress} +fi +fi +if "$is_preview && $print_debug" +text_outline $debug_msg,2,2,20,2,1,255,255,0 +fi + +append[^-1] c +remove. +} +remove. +fx_hue_overlay_masks : +100%,100%,1,1,"R#0/2-(G#0+B#0)/4+128" +100%,100%,1,1,"G#0/2-(R#0+B#0)/4+128" +100%,100%,1,1,"B#0/2-(R#0+G#0)/4+128" +=>... "name(Red), mode(overlay)" +=>.. "name(Green),mode(overlay)" +=>. "name(Blue),mode(overlay)" +if $1==1 +if iM#1-128>128-im#1 +f[1] '(i-128)/abs(iM-128)*128+128' +else +f[1] '(i-128)/abs(im-128)*128+128' +fi +if iM#2-128>128-im#2 +f[2] '(i-128)/abs(iM-128)*128+128' +else +f[2] '(i-128)/abs(im-128)*128+128' +fi +if iM#3-128>128-im#3 +f[3] '(i-128)/abs(iM-128)*128+128' +else +f[3] '(i-128)/abs(im-128)*128+128' +fi +fi +move[1] 0 +move[2] 1 +move[3] 2 +fx_hue_overlay_masks_preview : +fx_hue_overlay_masks $* +r2dx 50% to[0] "Red" to[1] "Green" to[2] "Blue" to[3] "Original" +to_rgba frame 1,1,0,0,0,255 frame 3,3,255 append_tiles , +fx_AbstractFlood : +Prep=$1 +SpatialVariance=$2 +ValueVariance=$3 +Iterations=$4 +ActivateFlood=$5 +Repeats=$6 +Tolerance=$7 +FloodBaseStep=$8 +CanvasR=$9 +CanvasG=$10 +CanvasB=$11 +Opacity=$12 +ActivateCubism=$13 +CubismIterations=$14 +Blocsize=$15 +Angle=$16 +CubismOpacity=$17 +Smoothness=$18 +StepThreshold={$19+0.1} +Step=$FloodBaseStep +Delta=1 +DeltaOrg=$Delta +to_rgba[0] +if $Prep==1 +fx_smooth_bilateral[0] $SpatialVariance,$ValueVariance,$Iterations,0,0 +fi +({$CanvasR}^{$CanvasG}^{$CanvasB}^0) +to_rgba[1] +ri[1] [0] +X={(w)/2} +Y={(h)/2} +ImageH={(h)} +ImageW={(w)} +DoLoop=0 +IsGood=0 +if $ActivateFlood==1 +repeat $Repeats +flood[0] {100*$X/w}%,{100*$Y/h}%,0,$Tolerance,0,1,{0,i($X,$Y,0,0)},{0,i($X,$Y,0,1)},{0,i($X,$Y,0,2)},{0,i($X,$Y,0,3)} ++fx_select_color[0] 0,1,0,{0,i($X,$Y,0,0)},{0,i($X,$Y,0,1)},{0,i($X,$Y,0,2)},{0,i($X,$Y,0,3)},0,0 +if $ActivateCubism==1 +cubism[2] $CubismIterations,$Blocsize,$Angle,$CubismOpacity,$Smoothness +fi +blend[1,2] alpha +do +Rstep={$Step+$Delta} +theta={u(360)} +Xnew={int($X+$Rstep*cos($theta))} +Ynew={int($Y+$Rstep*sin($theta))} +if $Xnew>0" && "$Xnew<$ImageW" && "$Ynew>0" && "$Ynew<$ImageH +X=$Xnew +Y=$Ynew +if {1,i($X,$Y,0,3)>$StepThreshold} +Delta={min({$Delta+$Delta*2},{max($ImageW,$ImageH)/5})} +fi +if {1,i($X,$Y,0,3)<$StepThreshold} +IsGood=10 +fi +if $DoLoop>100 +IsGood=10 +fi +fi +DoLoop=$DoLoop+1 +while $IsGood<1 +IsGood=0 +DoLoop=0 +Delta=$DeltaOrg +done +fi +({$CanvasR}^{$CanvasG}^{$CanvasB}^{$Opacity}) +ri[2] [0] +rv[1,2] +blend[1,2] alpha +if $ActivateFlood==1 +k[1] +elif $ActivateFlood==0 +k[0] +fi +fx_AbstractFlood_Preview : +gui_split_preview "fx_AbstractFlood ${1--2}",$-1 +fx_bwfilmsimulate : +Choice=$1 +P1=$2 +P2=$3 +P3=$4 +P4=$5 +P5=$6 +P6=$7 +P7=$8 +P8=$9 +P9=$10 +P10=$11 +P11=$12 +P12=$13 +P13=$14 +P14=$15 +P15=$16 +P16=$17 +P17=$18 +P18=$19 +P19=$20 +P20=$21 +if $Choice==1 P1={18/255} P3={41/255} P5={41/255} fi +if $Choice==2 P1={25/255} P3={39/255} P5={36/255} fi +if $Choice==3 P1={21/255} P3={40/255} P5={39/255} fi +if $Choice==4 P1={20/255} P3={41/255} P5={39/255} fi +if $Choice==5 P1={21/255} P3={42/255} P5={37/255} fi +if $Choice==6 P1={22/255} P3={42/255} P5={36/255} fi +if $Choice==7 P1={31/255} P3={36/255} P5={33/255} fi +if $Choice==8 P1={28/255} P3={41/255} P5={31/255} fi +if $Choice==9 P1={23/255} P3={37/255} P5={40/255} fi +if $Choice==10 P1={33/255} P3={36/255} P5={31/255} fi +if $Choice==11 P1={36/255} P3={31/255} P5={33/255} fi +if $Choice==12 P1={21/255} P3={42/255} P5={37/255} fi +if $Choice==13 P1={24/255} P3={37/255} P5={39/255} fi +if $Choice==14 P1={37/255} P3={36/255} P5={37/255} fi +if $Choice==15 P1={25/255} P3={35/255} P5={40/255} fi +repeat $! +l. split_opacity rv to_rgb. s. c +*... $P1 b... $P2% +*.. $P3 b.. $P4% +*. $P5 b. $P6% ++[-3--1] /. {$P1+$P3+$P5} c. 0,255 +apply_gamma. $P7 +-. 128 *. $P8 +. 128 +. $P9 c. 0,255 +100%,100% .x2 +noise... 100,$P17 b... $P16% n... -$P12,$P12 +noise.. 100,$P17 b.. $P16% n.. -$P13,$P13 +noise. 100,$P17 b. $P16% n. -$P14,$P14 ++tones[-4] 3 b[-3--1] $P15% +*[-6,-3] *[-4,-2] *[-2,-1] ++[-4--1] c. 0,255 +if $P10" || "$P11 +/. 255 +i.. 100%,100%,1,1,$P11 +i... 100%,100%,1,1,$P10 +a[-3--1] c hsv2rgb. +fi +rv a c done mv. 0 done +normalize_local $P18,$P19,$P20,2%,1,0,255 +fx_bwfilmsimulate_preview : +gui_split_preview "fx_bwfilmsimulate ${1--2}",$-1 +fx_blockism: +XSize={int($1/100*w)} +if $XSize==0 XSize=1 fi +Ratio=$2 +Variance={int($3*$XSize)} +Randomness=-1,1 +Repeats={int($4/100*max(w,h))} +Opacity=$5 +FlipTol=$6 +ReverseFlip=$7 +LAB=1-$8 +YSize={int($Ratio*$XSize)} +MaxXSize={int($XSize+$Variance)} +MaxYSize={int($MaxXSize*$Ratio)} +to_rgb[0] +if $LAB +rgb2lab[0] +s[0] c +fi +repeat $! +. +repeat $Repeats +X={int(u(-1,w))} +Y={int(u(-1,h))} +if $ReverseFlip==0 +if i($X,$Y,0,0)>$FlipTol +BW={int(abs($XSize+($MaxXSize-$XSize)*(u($Randomness))))} +BH={int(abs($YSize+($MaxYSize-$YSize)*(u($Randomness))))} +fi +if i($X,$Y,0,0)<=$FlipTol +BH={int(abs($XSize+($MaxXSize-$XSize)*(u($Randomness))))} +BW={int(abs($YSize+($MaxYSize-$YSize)*(u($Randomness))))} +fi +fi +if $ReverseFlip==1 +if i($X,$Y,0,0)<$FlipTol +BW={int(abs($XSize+($MaxXSize-$XSize)*(u($Randomness))))} +BH={int(abs($YSize+($MaxYSize-$YSize)*(u($Randomness))))} +fi +if i($X,$Y,0,0)>=$FlipTol +BH={int(abs($XSize+($MaxXSize-$XSize)*(u($Randomness))))} +BW={int(abs($YSize+($MaxYSize-$YSize)*(u($Randomness))))} +fi +fi +x0={int($X-$BW/2)} +y0={int($Y-$BH/2)} +x1={int($x0+$BW)} +y1={int($y0+$BH)} +rectangle.. $x0,$y0,$x1,$y1,$Opacity,{i($X,$Y,0,0)},{i($X,$Y,0,1)},{i($X,$Y,0,2)},{i($X,$Y,0,3)} +done +rm. +mv. 0 +done +if $LAB +a[-3,-2,-1] c +lab2rgb. +fi +fx_blockism_preview : +gui_split_preview "fx_blockism $1,$2,$3,{$4*10},$5,$6,$7,$8",$-1 +sub_thumbnailabstraction : +to_rgb[0] +IWidth={0,w} +IHeight={0,w} +if $IWidth>=$IHeight +ScaleByWidth=1 +fi +if $ScaleByWidth==1 ++resize2dx[0] 200,5 +b. 2 +resize2dx. 1024,5 +fx_segment_watershed. 0.5,5,0,0 +elif ++resize2dy[0] 200,5 +b. 2 +resize2dy. 1024,5 +fx_segment_watershed. 0.5,5,0,0 +fi +resize. [0] ++rgb2lab[0] +s. c +rm[-1,-2] +b. 10% +n. 0,255 +blend[-1,-2] hardlight,1,1 +k. +sub_colors_and_lines : +image_width={0,w} +image_height={0,h} +resize2dx 1024 +luminance[0] +n 0,255 +to_rgb[0] +fx_smooth_bilateral[0] 2,15,2,0,0,24,0 +fx_colormap[0] 0,0,3,3,0,0,0,255,255,255,255,0,0,0,255,0,0,0,255,255,255,0,255,0,255,0,255,255,0 ++fx_smooth_anisotropic[0] 300,0.1,1,0,10,1,1,1,0,1,1,0,0,24,0 +fx_gradient_norm. 0,0.5,0,100,1,0 +blend[0,1] multiply,1 +resize. $image_width,$image_height,1,3,5,1 +fx_CompositionAnalysis : +method=$1 +if $method==0 sub_thumbnailabstraction fi +if $method==1 sub_colors_and_lines fi +fx_dodgesketch: +to_rgb[0] +Power=$1 +SpatialVariance=$2 +ValueVariance=$3 +Iterations=$4 +Colored=$5 ++fx_mix_hsv[0] 1,0,0,0,-1,0,1,0,0,0,2,0 ++fx_smooth_bilateral. $SpatialVariance,$ValueVariance,$Iterations,0,0 +negate. +blend[-1,-2] alpha,0.5,0 +. ++blend[-1,-2] dodge,1,0 +k[0,-1] +repeat $Power +. +blend[-1,-2] multiply +done +if $Colored==1 ++blend[-1,-2] hardlight +rm.. +fx_transfer_colors[-1,-2] 0,0 +fi +k. +fx_dodgesketchpreview : +gui_split_preview "fx_dodgesketch ${1--2}",$-1 +Sub_Contrast_Bias: +/. 255 +to_gray. +laplacian. +abs. +Sub_Saturation_Bias: +/. 255 ++s[0] c +blend[-1,-2,-3] average +s[0] c ++-[0] [1] +rm[1] ++-[0] [1] +rm[1] ++-[0] [1] +rm[1] +rm[0] +^[0] 2 +^[1] 2 +^[2] 2 ++[1] [2] +rm[2] ++[0] [1] +rm[1] +/[0] 3 +sqrt[0] +Sub_Exposure_Bias : +/[0] 255 +-[0] 0.5 +^[0] 2 +/[0] {2*$1*$1} +*[0] -1 +exp[0] +s[0] c +*[0] [2] +rm[2] +*[0] [1] +rm[1] +Sub_BlurPyramid : +size={0,min(w,h)} +levels={round(log($size)/log(5))} +Deviation=1 +b[0] $Deviation,1,1 +repeat $levels-1 ++resize. 50%,50%,5,1 +b. $Deviation,1,1 +done +blndalpha=0.5 +repeat $levels-1 +index={-($<+1)} +resize[$index] [0],5,1 +blend[0,$index] alpha,$blndalpha,0 +blndalpha={$blndalpha/2} +done +fx_ExposureWeightMap : +wc=$1 +ws=$2 +sigma=$3 +we=$4 +BlurMap=$5 +to_rgb[0] ++Sub_Contrast_Bias[0] ++Sub_Saturation_Bias[0] ++Sub_Exposure_Bias[0] $sigma +rm[0] +^[0] $wc +^[1] $ws +^[2] $we ++[0] [1] ++[0] [2] +k[0] +n[0] 0,255 +if $BlurMap==1 +sub_BlurPyramid[0] +fi +fx_ExposureWeightMapPreview : +gui_split_preview "fx_ExposureWeightMap ${1--2}",$-1 +fx_StructureTensors: +structuretensors abs ^ $1 +n 0,255 +fx_StructureTensorsPreview : +gui_split_preview "fx_StructureTensors ${1--2}",$-1 +fx_import_image_16 : +ProcessTo=$2 +Gamma=$3 +Brightness=$4 +Contrast=$5 +Equalize=$6 +AB=$7 +A=$8 +B=$9 +CutHigh=$10 +CutLow=$11 +rm i +"$1" +to_rgb +if $ProcessTo!=3 +resize2dx 520,1 +fi +apply_gamma $Gamma +if {0,iM>256} +if $Equalize ++equalize 65535 +blend alpha,{$Equalize/2} +fi +/ 65535 +rgb2lab +s c +if $Brightness ++... $Brightness +fi +if $Contrast!=1 +*... $Contrast +fi +if $AB +*.. $AB +*. $AB +fi +if $A +*.. {1+$A} +fi +if $B +*. {1+$B} +fi +a c +lab2rgb +if $CutHigh!=100" || "$CutLow!=0 +Range=1 +HighValue={$CutHigh/100*$Range} +LowValue={$CutLow/100*$HighValue} +c $LowValue,$HighValue +n 0,1 +fi +* 255 +c 0,255 +if $ProcessTo==1 ++display_histogram {0,w},{0,h},255,0,254,0 +blend lighten,0.7 +fi +if $ProcessTo==2 ++display_histogram {0,w},{0,h},255,0,254,0,log(1+i)-1 +blend lighten,0.7 +fi +fi +intersect_images: ++lt[0] [1] +*. 255 ++lt[1] [0] +*. 255 +-[0] . +-[1] .. +rm[-1,-2] +c[0] 0,255 +c[1] 0,255 ++[0] [1] +rm[1] +create_base_levels: +Levels=$1 +repeat $Levels-1 ++*[2] {$>+1} ++-[1] . +rm.. +c. 0,255 +done +repeat $Levels-1 ++*[1] {$>+1} ++-[2] . +rm.. +c. 0,255 +done +reorder_stack : +Levels=$1 +mv[3] 1 +if $Levels>1 +rv[2,3] +mv[2] {-$Levels+1} +fi +reduce_overlap : +Levels=$1 +repeat $Levels-1 +-[{2+$>}] [{3+$>}] +c[{2+$>}] 0,255 +done +repeat $Levels-1 +-[{-$Levels+$>}] [{-$Levels+$>+1}] +c[{-$Levels+$>}] 0,255 +done +-[1] [{-$Levels-1}] +-[1] . +c[1] 0,255 +fx_split_luminance: +Levels=$1 +AlphaOutput=$2 +ReduceOverlap=$3 +KeepCustom=$4 +KeepText=$5 +to_rgb ++rgb2lab +s. c +rm[-1,-2] +n. 0,255 ++negate. ++intersect_images[-1,-2] +if $ReduceOverlap==0 +n. 0,255 +fi +create_base_levels $Levels +reorder_stack $Levels +if $ReduceOverlap==1" && "$Levels>1 +reduce_overlap $Levels +fi +repeat $!-1 ++[{$>+1}] 1 +c[$>] 0,255 +done +if $AlphaOutput +repeat $!-1 ++a[0,1] c +rm[1] +done +fi +if $ReduceOverlap==1" && "$Levels>1 +rm[2] +fi +rm[0] +if $KeepCustom +$KeepText +fi +fx_OldSquiggly : ++fx_spread[0] $1,$1,0,0 +fx_segment_watershed[1] $2,$3,0,0 ++fx_gradient_norm[1] $4,$5,0,100,0,0 ++blend[2,1] multiply +fx_mix_ycbcr[3] 1,0,0,$6,0,0,$6,0,0,0,2,0 +fx_map_tones[0] $7,$8,0.1,30,0,0 +blend[0,3] darken +rm[1,2] ++fx_plasma 0.5,10,8,0 +fx_blackandwhite[1] 0.299,0,0.587,0,0.114,0,1,1,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0 +fx_apply_curve[1] $9,-1,128,-1,128,-1,128,-1,128,-1,128,$10,1,3,0,0,0 +fx_apply_curve[0] 0,$11,128,-1,128,-1,128,-1,128,-1,128,255,1,3,0,0,0 +*[0] {0.5*(1+$12)} +*[1] {0.5*(1-$12)} +++[0] [1] ++blend[0,2] softlight +rm[0,1,2] +fx_MappedSmooth : +MapType=$1 +fi={$2*3.1415/180} +ZeroOffset=$3 +Amplitude=$4 +LMult=$5 +ShowQuiver=$6 +if $MapType==0 ++fx_local_orientation 0.5,0,100,0,4,0 +fi +cosfi={cos($fi)} +sinfi={sin($fi)} +to_rgb[-2,-1] +-. {128+$ZeroOffset} +s. c +*[3] 0 ++*[1] $cosfi ++*[2] $sinfi +-[4] [5] +rm[5] ++*[1] $sinfi ++*[2] $cosfi ++[5] [6] +rm[6] +rm[1,2] +rm[1] +100%,100%,100%,1,0 +a[1,2,3] c +/. {128/$LMult} +channels. 0,1 +if $ShowQuiver==0 +vector2tensor. +smooth.. .,$Amplitude +fi +if $ShowQuiver==1 +quiver.. .,10,{$Amplitude/20},1,0.8,255 +fi +rm. +fx_fix_HDR_black: +to_rgb[0] +X1=$1 +Y1=$2 +X2=$3 +Y2=$4 +ShowMask=$5 ++fx_smooth_bilateral. 4,8,6,4,0 +fx_smooth_haar. 0.6,5,2,3,1,24 ++rgb2lab. +s. c +rm[-1,-2] +fx_apply_curve. 0,$X1,$Y1,$X2,$Y2,-1,128,-1,128,-1,128,255,1,0,0,21,0 +if $ShowMask==0 +negate. +a[-2,-1] c +to_rgba. +blend[0,-1] alpha +k[0] +fi +fx_fix_HDR_black_preview : +gui_split_preview "fx_fix_HDR_black ${1--2}",$-1 +fx_noisepainting : +DegrLarge=$1 +DegrSmall=$2 +Channel=$3 +Abstr=$4 +Details=$5 +Color=$6 +Smooth=$7 +Sharp=$8 +to_rgb[0] +if $Channel Channel=3 else Channel=0 fi +if $PreProcess fx_segment_watershed $EdgeThresh,$WaterSmooth,0,0 fi +if $DegrLarge!=0 fx_spread $DegrLarge,$DegrLarge,0,0 fi +if $DegrSmall!=0 fx_noise $DegrSmall,2,$Channel,0,0 fi +fx_painting $Abstr,$Details,$Color,$Smooth,$Sharp,0 +fx_noisepainting_preview : +gui_split_preview "fx_noisepainting ${1--2}",$-1 +fx_SmoothSketch : +UsmRadius=5 +CreateSketch=$1 +UsmAmount=$1 +Sharpness=$2 +Anisotropy=$3 +SmScale=$4 +SmAccuracy={$5} +Amplitude=$6 +fi=$7 +Density=$8 +BlurLength=$9 +Style=$10 +BgOpacity=$11 +PostGamma=$12 +OptimizedResult=$13 +if $OptimizedResult +OriginalWidth={0,w} +resize2dx 1024 +fx_smooth_selective. 5,0.5,5,1,0,0,24,0 +fi +if $CreateSketch==1 +fx_unsharp. 0,$UsmRadius,30,$UsmAmount,0,1,1,1,0,0,0 ++gradient_norm. +negate. +n. 0,255 +fi +(255;255;255) +ri. .. +fx_noise. $Density,0,3,0,0 +if $Style==0 +fx_blur_linear. $BlurLength,0,135,500,1,3,0,0 +fi +if $Style==1 +fx_blur_angular. $BlurLength,1.2,1.2,0,0,0 +fi +if $Style==2 +fx_blur_linear. $BlurLength,0,135,500,1,3,0,0 +deform. {$Density/5} +fi +if $Style==3 +fx_blur_angular. $BlurLength,1.2,1.2,0,0,0 +deform. {$Density/5} +fi +blend[-1,-2] multiply,$BgOpacity,0 +n. 0,255 ++diffusiontensors[0] $Sharpness,$Anisotropy,0.6,1.1,0 +rotation3d 0,0,1,{$fi} +mix_channels.. ({@0-2};{@3-5};{@6-8}) +rm. +*. {$SmScale/max(abs(iM),abs(im))} +noise. {$SmAccuracy*max(abs(iM),abs(im))} +rv[-1,-2] +smooth. ..,$Amplitude +k. +apply_gamma. $PostGamma +if $OptimizedResult +resize2dx $OriginalWidth +fi +fx_SmoothSketch_preview : +gui_split_preview "fx_SmoothSketch ${1--2}",$-1 +fx_DemoVecRot : +angle=$1 +to_rgb[0] +[0] +to_rgb. +s. c +-.. 128 +-... 128 +a[-3,-2,-1] c +channels. 0,1 +/. 128 +rotation3d 0,0,1,$angle +z. 0,0,1,1 +mix_channels.. ({@0-1};{@2-3}) +rm. +quiver.. .,10,10,1,0.8,255 +k.. +fx_WarpTest : +MapType=$1 +fi={$2*3.1415/180} +ZeroOffset=$3 +LMult=$4 +ShowQuiver=$5 +if $MapType==0 ++fx_local_orientation 0.5,0,100,0,4,0 +fi +cosfi={cos($fi)} +sinfi={sin($fi)} +to_rgb[-2,-1] +-. {128+$ZeroOffset} +s. c +*[3] 0 ++*[1] $cosfi ++*[2] $sinfi +-[4] [5] +rm[5] ++*[1] $sinfi ++*[2] $cosfi ++[5] [6] +rm[6] +rm[1,2] +rm[1] +100%,100%,100%,1,0 +a[1,2,3] c +/. {128/$LMult} +channels. 0,1 +if $ShowQuiver==0 +warp.. .,1,1,0 +fi +if $ShowQuiver==1 +quiver.. .,10,{$LMult/100},1,0.8,255 +fi +rm. +fx_jobs_colors : +n 0,255 if $2 equalize 256 fi +luminance apply_gamma {10^$1} n 0,9 round +(22,187,20,36,235,240,245,243,247,209^18,97,147,157,79,110,121,142,170,200^19,158,192,60,67,65,64,64,64,185) +map[^-1] . rm. +fx_jobs_colors_preview : +gui_split_preview "fx_jobs_colors $*",$-1 +fx_steampen : +repeat $! l[$>] split_opacity l[0] +fx_pencilbw $1,$2,0,0,0 +fx_kuwahara $3,$4,0,0 +blur_xy $5 +if $6==1 fx_normalize_local 4.8,22,6.89,20,1,3,0 +elif $6==2 fx_contrast_swm 2,0,1 +elif $6==3 fx_contrast_swm 2,1,1 +elif $6==4 fx_map_tones_fast 3,0.5,3, fi +if $7==1 equalize 255 fi +if $8==1 fx_smooth_anisotropic 60,$9,$10,$11,1.1,0.8,30,2,0,1,1,0 fi +done a c done done +fx_steampen_preview : +gui_split_preview "fx_steampen ${1--2}",$-1 +fx_compose_boostscreen : +repeat $! l[$>] +fx_compose_screen $1,$2 . fx_compose_grainmerge $3,0 +done done +fx_compose_colordoping : +reverse fx_compose_lightness 1,$2 [^] fx_compose_multiply $1,0 +fx_colorsketchbw : ++b $3 hardsketchbw. $1,$2,$4,$5,$6 +if $7 negate. fi +quantize.. $8 to_rgb blur_xy.. $9,$9 +if $10==0 fx_compose_colordoping $11,0 +elif $10==1 fx_compose_darken $11,0 +elif $10==2 fx_compose_hardlight $11,1 +elif $10==3 fx_compose_grainmerge $11,1 +elif $10==4 fx_compose_lightness $11,1 +elif $10==5 fx_compose_multiply $11,0 +elif $10==6 fx_compose_value $11,1 fi +fx_colorsketchbw_preview : +gui_split_preview "fx_colorsketchbw ${1--2}",$-1 +fx_colorstamp : +repeat $! l[$>] split_opacity l[0] ++norm +if $1 otsu. 256 else threshold. $2% fi +n. 0,255 +apply_curve. 1,0,0,101,33,170,229,255,255 +if $3==1 quantize.. $4 to_rgb blur_xy.. $5 +fx_compose_darken 1,0 fi +done a c done done +fx_colorstamp_preview : +gui_split_preview "fx_colorstamp ${1--2}",$-1 +fx_compose_comix_color : +rv fx_compose_lightness $1,$2 [^] fx_compose_grainmerge $3,0 +fx_compose_darkedges : +fx_compose_edges $1,$2,$3 [^] fx_compose_multiply $4,0 +fx_compose_darkscreen : +repeat $! l[$>] +fx_compose_screen $1,$2 . fx_compose_multiply $3,0 +done done +fx_graphic_boost : +repeat $! l[$>] split_opacity l[0] +fx_unsharp 1,$1,30,3,0,$2,0.40,1,0,0,0 +if $3==1 break fi ++fx_pencilbw $4,$5,0,0,0 +if $6==1 k. break fi +if $7==1 fx_smooth_anisotropic[1] 60,$8,$9,$10,1.1,0.8,30,2,0,1,1,0 fi +if $11==1 k. break fi +if $12==1 reverse fi +if $13==0 fx_compose_hardlight $14 +elif $13==1 fx_compose_grainmerge $14 +elif $13==2 fx_compose_multiply $14 +elif $13==3 fx_compose_colorburn $14 +elif $13==4 fx_compose_overlay $14 +elif $13==5 fx_compose_value $14,0 +elif $13==6 fx_compose_darken $14 +elif $13==7 fx_compose_stamp $14 fi +if $15==1 fx_smooth_anisotropic 60,$16,$17,$18,1.1,0.8,30,2,0,1,1,0 fi +done a c done done +fx_graphic_boost_preview : +gui_split_preview "fx_graphic_boost ${1--2}",$-1 +fx_compose_graphicolor : +reverse +fx_compose_luminance $1,$2, rm.. fx_compose_softlight $3,0 +fx_novelfx : +repeat $! l[$>] split_opacity l[0] +if $1==0 fx_normalize_local $2,$3,$4,$5,1,3,0 fi +if $6==0 +fx_pencilbw $7,$8,0,0,0 fi +if $9==1 k. break fi +if $10==1 fx_smooth_anisotropic. 60,$11,$12,$13,1.1,0.8,30,2,0,1,1,0 fi +if $14==1 k. break fi +if $15==1 reverse fi +if $16==0 fx_compose_overlay[-1,0] $17 +elif $16==1 fx_compose_multiply[-1,0] $17 +elif $16==2 fx_compose_softlight[-1,0] $17 +elif $16==3 fx_compose_colorburn[-1,0] $17 +elif $16==4 fx_compose_darken[-1,0] $17 +elif $16==5 fx_compose_stamp[-1,0] $17 +elif $16==6 fx_compose_hardlight[-1,0] $17 +elif $16==7 reverse[1,0] fx_compose_value[-1,0] $17,0 +elif $16==8 fx_compose_grainmerge[-1,0] $17 +elif $16==8 fx_compose_freeze[-1,0] $17 fi +if $18==1 fx_smooth_anisotropic 60,$19,$20,$21,1.1,0.8,30,2,0,1,1,0 fi +done a c done done +fx_novelfx_preview : +gui_split_preview "fx_novelfx ${1--2}",$-1 +fx_compose_graphixcolor : +reverse +fx_compose_value 1,$2 k[-1,-3] fx_compose_grainmerge $1,0 +fx_compose_heavyscreen : +repeat $! l[$>] +fx_compose_screen $1,$2 . fx_compose_colorburn $3,0 +done done +fx_metalgrain : ++Couleurs_Metalliques 1,1,19.86,0,0,0,7.4,11,3.96,20,1,0,0,1,1.9,10.2,1,0,0 +fx_compose_overlay $1,$2 +fx_metalgrain_preview : +gui_split_preview "fx_metalgrain ${1--2}",$-1 +fx_metallicstencils : ++Couleurs_Metalliques 0,1,22,0,0,1,7.8,9,7.6,16.6,1,0,0,1,2.4,8.2,1,0 ++fx_lylejk_stencil[0] 4,26.7045,2.41477,0 +rm[0] +if $1==0 fx_compose_darken 1,0 +elif $1==1 fx_compose_lighten 1,0 +elif $1==2 fx_compose_overlay 1,0 fi +fx_metallicstencils_preview : +gui_split_preview "fx_metallicstencils ${1--2}",$-1 +compose_average : +e[^-1] "Compose image$? two-by-two, using average mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 + +done done / 2 +compose_colorburn : +e[^-1] "Compose image$? two-by-two, using colorburn mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 -.. 255 +. 0.1 / +done done * 256 + 255 c 0,255 +compose_darken : +e[^-1] "Compose image$? two-by-two, using darken mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 min +done done +compose_difference : +e[^-1] "Compose image$? two-by-two, using difference mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 - +done done abs +compose_divide : +e[^-1] "Compose image$? two-by-two, using divide mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 *.. 256 +. 1 / +done done c 0,255 +compose_dodge : +e[^-1] "Compose image$? two-by-two, using dodge mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 -. 255.1 / +done done * -256 c 0,255 +compose_edges : check {$1>=0} +e[^-1] "Compose image$? using edge mode, with smoothness $1." +if $!>1 - to_rgb r[^0] {0,[w,h,d,s]},0,0,0.5,0.5 repeat $! l[$>] ++gradient_norm +. 1 b. $1 n. 1,10 sqr. s.. c *[-4--2] . a[-4--1] c +done done r[^0] {0,[w,h,d,s]},0,0,0.5,0.5 + s. c /[-4--2] . rm. a[-3--1] c fi +compose_exclusion : +e[^-1] "Compose image$? two-by-two, using exclusion mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 +*.. . /. -128 + +done done +compose_fade : +e[^-1] "Compose image$? using fading mode." +r[^0] ${-max_whd},100%,3 +r[1--2] 100%,100%,100%,${-max_s} channels. 0 +repeat $!-1 +-. $> abs. -. 1 *. -1 max. 0 *[$>,-1] done +rm. + +compose_freeze : +e[^-1] "Compose image$? two-by-two, using freeze mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 -.. 255 sqr.. +. 0.1 / +done done - 255 * -1 c 0,255 +compose_grainextract : +e[^-1] "Compose image$? two-by-two, using grain extract mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 - +done done + 128 c 0,255 +compose_grainmerge : +e[^-1] "Compose image$? two-by-two, using grain merge mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 + +done done - 128 c 0,255 +compose_hardlight : +e[^-1] "Compose image$? two-by-two, using hard light mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 ++ge. 128 +*... .. /. 128 +-[-4,-3] 255 *[-4,-3] /... 128 -... 255 *... -1 +*... .. *.. -1 +.. 1 *[-2,-1] + +done done +compose_hue : +e[^-1] "Compose image$? two-by-two, using hue mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 to_rgba sh 0,2 +rgb2hsv[-2,-1] sh.. 0,0 j.. . rm[-5,-3,-1] hsv2rgb. rm. +done done +compose_interpolation : +e[^-1] "Compose image$? two-by-two, using interpolation mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 * 0.012271846 cos / -4 + +done done + 0.5 * 256 +compose_lighten : +e[^-1] "Compose image$? two-by-two, using lighten mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 max +done done +compose_lightness : +e[^-1] "Compose image$? two-by-two, using lightness mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 to_rgba sh 0,2 +rgb2lab[-2,-1] sh.. 0,0 j.. .,0,0,0,0 rm[-5,-3,-1] lab2rgb. rm. +done done +compose_luminance : +e[^-1] "Compose image$? two-by-two, using luminance mode." +repeat int($!/2) +to_colormode[-2,-1] 0 ri. ..,0,0,0.5,0.5 to_rgba[-2,-1] sh[-2,-1] 0,2 +rgb2ycbcr[-2,-1] sh.. 0,0 j.. .,0,0,0,0 rm[-5,-3,-1] ycbcr2rgb. rm. +mv. 0 done +compose_median : +e[^-1] "Compose image$? using median mode." +if $!==1 return fi +r[^0] [0],0,0,0.5,0.5 a z permute zxyc s y,-64 +repeat $! l[$>] +r 100%,{w*100}% +s z median {w} w={w} columns {int(w/2)} r 1,{h/$w} a z +done done a y permute yzxc +compose_multiply : +e[^-1] "Compose image$? two-by-two, using multiply mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 * +done done / 255 +compose_negation : +e[^-1] "Compose image$? two-by-two, using negation mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 + +done done - 255 abs - 255 * -1 +compose_overlay : +e[^-1] "Compose image$? two-by-two, using overlay mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 ++ge.. 128 ++*... .. /. 128 +-[-4,-3] 255 *[-4,-3] /... 128 -... 255 *... -1 +*... .. *.. -1 +.. 1 *[-2,-1] + +done done +compose_reflect : +e[^-1] "Compose image$? two-by-two, using reflect mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 sqr.. -. 255.1 / +done done * -1 c 0,255 +compose_rgba : +e[^-1] "Compose image$? two-by-two, using alpha blending." +to_rgb[0--1:2] compose_alpha +compose_saturation : +e[^-1] "Compose image$? two-by-two, using saturation mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 to_rgba sh 0,2 +rgb2hsv[-2,-1] sh.. 1,1 j.. .,0,0,0,1 rm[-5,-3,-1] hsv2rgb. rm. +done done +compose_screen : +e[^-1] "Compose image$? two-by-two, using screen mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 - 255 * +done done / 256 - 255 * -1 +compose_shapeaverage : +e[^-1] "Compose image$? two-by-two, using shape average mode." +repeat int($!/2) l[-2,-1] nm={0,n} +channels. 0 ge. 50% label_fg. 0 nb={iM+1} *. 256 +rv[-2,-1] m={im} M={iM} n. 0,255 s. c +[^0] [0] +repeat $!-1 +histogram. {$nb*256},0,{$nb*256-1} +i.. 256,1,1,1,'x' r.. {w},1,1,1,0,2 *.. . r[-2,-1] $nb,1,1,1,2 max. 1 /[-2,-1] +mv. 1 done +/[0] 256 a[^0] c *. {($M-$m)/256} +. $m point. 0,0,0,1,0 map[0] . rm. +nm $nm,1 done mv. 0 done +compose_softlight : +e[^-1] "Compose image$? two-by-two, using soft light mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 / 256 +*.. . *. 2 sqr... *.. ... *.. -2 + +done done * 256 +compose_stamp : +e[^-1] "Compose image$? two-by-two, using stamp mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 *. 2 + +done done - 255 c 0,255 +compose_value : +e[^-1] "Compose image$? two-by-two, using value mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 to_rgba sh 0,2 +rgb2hsv[-2,-1] sh.. 2,2 j.. .,0,0,0,2 rm[-5,-3,-1] hsv2rgb. rm. +done done +compose_xor : +e[^-1] "Compose image$? two-by-two, using xor mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 xor +done done +_fx_compose : +repeat int($!/2) +compose_$1[-2,-1] rm... to_rgba. sh. 3,3 *. $2 rm. compose_alpha[-2,-1] mv. 0 done +_fx_revert_layers : +repeat int($!/2) rv[{2*$>},{2*$>+1}] done +fx_compose_average : +if ${2=0} _fx_revert_layers fi +_fx_compose average,$1 +fx_compose_colorburn : +if ${2=0} _fx_revert_layers fi +_fx_compose colorburn,$1 +fx_compose_darken : +if ${2=0} _fx_revert_layers fi +_fx_compose darken,$1 +fx_compose_difference : +if ${2=0} _fx_revert_layers fi +to_rgb _fx_compose difference,$1 +fx_compose_divide : +if ${2=0} _fx_revert_layers fi +_fx_compose divide,$1 +fx_compose_dodge : +if ${2=0} _fx_revert_layers fi +_fx_compose dodge,$1 +fx_compose_edges : +if ${3=0} _fx_revert_layers fi +repeat int($!/2) +compose_edges[-2,-1] $2 rm... to_rgba. sh. 3,3 *. $1 rm. compose_alpha[-2,-1] mv. 0 done +fx_compose_exclusion : +if ${2=0} _fx_revert_layers fi +to_rgb _fx_compose exclusion,$1 +fx_compose_fade : +if $!==1 return fi +to_colormode 4 +if $1==0 [0],[0],1,1,"$10" +else _fx_compose_fade$1 $7,$8,$9 r. [0],[0],1,1,3 +fi +n. {-($!-2)*$3},{($!-2)*(1+$3)} +-. {$2*(1+$3)*($!-2)} +c. 0,{$!-2} +if $6 rv[^-1] fi +if $5 round. 1 +else roundify. $4 +fi +compose_fade +c 0,255 +_fx_compose_fade1 : [0],[0],1,1,"a=$1*pi/2; x*cos(a) + y*sin(a)" +_fx_compose_fade2 : [0],[0],1,1,0 -=. 1,{($1+1)*50}%,{($2+1)*50}% distance. 1 +_fx_compose_fade3 : [0],[0],1,1,0 -=. 1,{($1+1)*50}%,{($2+1)*50}% distance. 1 *. {0.01+$3/2} cos. +_fx_compose_fade4 : [0],[0],1,1,"((x-w*($1+0.5))*(y-h*($2+0.5)))%(0.2*w*h*(1.001+$3))" +fx_compose_freeze : +if ${2=0} _fx_revert_layers fi +_fx_compose freeze,$1 +fx_compose_grainextract : +if ${2=0} _fx_revert_layers fi +_fx_compose grainextract,$1 +fx_compose_grainmerge : +if ${2=0} _fx_revert_layers fi +_fx_compose grainmerge,$1 +fx_compose_hardlight : +if ${2=0} _fx_revert_layers fi +_fx_compose hardlight,$1 +fx_compose_hue : skip ${2=0} +if ${2=0} _fx_revert_layers fi +_fx_compose hue,$1 +fx_compose_interpolation : +if ${2=0} _fx_revert_layers fi +_fx_compose interpolation,$1 +fx_compose_lighten : +if ${2=0} _fx_revert_layers fi +_fx_compose lighten,$1 +fx_compose_lightness : skip ${2=0} +if ${2=0} _fx_revert_layers fi +_fx_compose lightness,$1 +fx_compose_luminance : skip ${2=0} +if ${2=0} _fx_revert_layers fi +_fx_compose luminance,$1 +fx_compose_multiply : +if ${2=0} _fx_revert_layers fi +_fx_compose multiply,$1 +fx_compose_negation : +if ${2=0} _fx_revert_layers fi +to_rgb _fx_compose negation,$1 +fx_compose_overlay : +if ${2=0} _fx_revert_layers fi +_fx_compose overlay,$1 +fx_compose_reflect : +if ${2=0} _fx_revert_layers fi +_fx_compose reflect,$1 +fx_compose_saturation : skip ${2=0} +if ${2=0} _fx_revert_layers fi +_fx_compose saturation,$1 +fx_compose_screen : +if ${2=0} _fx_revert_layers fi +_fx_compose screen,$1 +fx_compose_shapeaverage : +if ${3=0} _fx_revert_layers fi +to_rgb +repeat int($!/2) +rv[-2,-1] +if $1 i[0] . fi +compose_shapeaverage[-2,-1] +if $1 *[0,-1] /[0] 255 mv[0] $! fi +if $2 to_rgba. replace_color. 0,0,0,0,0,255,0,0,0,0 fi +mv. 0 done +fx_compose_softlight : +if ${2=0} _fx_revert_layers fi +_fx_compose softlight,$1 +fx_compose_stamp : +if ${2=0} _fx_revert_layers fi +_fx_compose stamp,$1 +fx_compose_value : skip ${2=0} +if ${2=0} _fx_revert_layers fi +_fx_compose value,$1 +fx_compose_xor : +if ${2=0} _fx_revert_layers fi +to_rgb _fx_compose xor,$1 +fx_phoenix : ++fx_pencilbw $1,$2,0,0,0 +fx_kuwahara[1] $3,$4,0,0 +to_rgb. blur_xy[1] $5 +if $6==0 remove[0] return fi +if $8==0 reverse fx_compose_value $9,$7 +elif $8==1 reverse fx_compose_lightness $9,$7 +elif $8==2 reverse fx_compose_luminance $9,$7 +elif $8==3 fx_compose_colordoping $9,$7 +elif $8==4 fx_compose_comix_color $9,$7,$10 +elif $8==5 fx_compose_graphicolor $9,0,$7 +elif $8==6 fx_compose_graphixcolor $9,$7 +elif $8==7 fx_compose_vividedges $9,0.50,$7,$10 +elif $8==8 fx_compose_darkedges $9,0.50,$7,$10 +elif $8==6 fx_compose_multiply $9,$7 +elif $8==7 fx_compose_colorburn $9,$7 +elif $8==8 fx_compose_darken $9,$7 +elif $8==9 fx_compose_lighten $9,$7 +elif $8==10 fx_compose_screen $9,$7 +elif $8==11 fx_compose_hardlight $9,$7 +elif $8==12 fx_compose_softlight $9,$7 +elif $8==13 fx_compose_overlay $9,$7 +elif $8==14 fx_compose_grainmerge $9,$7 +elif $8==15 fx_compose_edges $9,0.80,$7 +elif $8==16 fx_compose_interpolation $9,$7 fi +fx_phoenix_preview : +gui_split_preview "fx_phoenix ${1--2}",$-1 +fx_psyglass : +repeat $! l[$>] split_opacity l[0] +if $1==0 +b 0.1 stained_glass $2,$3,$4 n 0,255 +elif $1==1 +negate b 0.1 stained_glass $2,$3,$4 n 0,255 negate +fi +if $5 equalize 256 fi ++b 0.9 +if $6==0 fx_compose_grainmerge $7 +elif $6==1 fx_compose_hardlight $7 +elif $6==2 fx_compose_softlight $7 +elif $6==3 fx_compose_overlay $7 +elif $6==4 fx_compose_colorburn $7 +elif $6==5 fx_compose_multiply $7 +fi +if $8==1 fx_contrast_swm 2,0,1,0 fi +if $9==1 fx_normalize_local 2,6,5,20,1,3,0 fi +if $10 +if $15==1 mirror x +elif $15==2 mirror y +elif $15==3 rotate 90 +elif $15==4 rotate 180 +elif $15==5 rotate 270 +fi +array_mirror $11,$14,$16 +shift -$12%,-$13%,0,0,2 +fi +done a c done done +fx_psyglass_preview : +gui_split_preview "fx_psyglass ${1--2}",$-1 +fx_scaledown3 : +if $1==0" && "$4==0 blur_xy {w/$5},{h/$6} +elif $1==0" && "$4==1 blur_xy {w/$5},{w/$6} +elif $1==0" && "$4==2 blur_xy {h/$5},{w/$6} +elif $1==1" && "$4==0 blur_xy $2 ,$3 +elif $1==1" && "$4==1 blur_xy $2 ,$3 +elif $1==1" && "$4==2 blur_xy $2 ,$3 +fi +if $4==0 +r $5,$6,2 +elif $4==1 +r2dx $5,2 +elif $4==2 +r2dy $6,2 +fi +if $7==0 +fx_unsharp 0,1.25,30,$8,0,$9,{$9/3},1,0,$10 +fi +fx_scaledown3_preview : +gui_split_preview "fx_scaledown3 ${1--2}",$-1 +fx_viral : +fx_rorschach $1,1,1 ++mirror y +if $2==0 blend average +elif $2==1 blend grainextract +elif $2==2 blend vividlight,0.5 +elif $2==3 blend difference +elif $2==4 blend exclusion +elif $2==5 blend negation fi ++fx_array_mirror 1,0,0,2,0,0 +if $3==0 blend vividlight,0.5 +elif $3==1 fx_compose_average 1,0 +elif $3==2 fx_compose_difference 1,0 +elif $3==3 fx_compose_negation 1,0 +elif $3==4 blend darken,0.8 fi +if $4==0 fx_graphic_novelfxl 0,2,6,5,20,0,0.62,14,0,1,0.5,0.78,1.92,0,0,12,1,1,1,0.5,0.8,1.28,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $4==1 fx_graphic_novelfxl 0,7.2,14.65,5,20,0,1.06,36.14,0,1,0.5,0.85,1.93,0,0,8,1,1,1,0.5,0.95,2.89,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $4==2 fx_graphic_novelfxl 0,7.22892,14.6506,5,20,0,1.6,36.1,0,1,0.5,0.6,3.6,0,0,11,1,1,1,0.5,0.8,2.16,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,7,1,1,1,0.5,0.45,1 +elif $4==3 fx_graphic_novelfxl 0,7.22892,14.6506,5,20,0,1.59036,36.1446,0,1,0.5,0.590361,3.61446,0,0,8,1,1,1,0.5,0.373494,2.89157,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $4==4 fx_graphic_novelfxl 0,7.22892,14.6506,5,20,0,1.59036,36.1446,0,1,0.5,0.855422,1.92771,0,0,8,1,1,1,0.5,0.373494,2.89157,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $4==5 fx_graphic_novelfxl 1,7.22892,14.6506,5,20,0,1.06024,14,0,1,0.5,0.855422,1.3253,0,0,12,1,1,1,0.5,0.8,1.28,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $4==6 fx_graphic_novelfxl 1,7.22892,14.6506,5,20,0,1.06024,36.1446,0,1,0.5,0.855422,1.92771,0,0,7,1,1,1,0.5,0.951807,1.92771,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $4==7 fx_graphic_novelfxl 1,7.22892,14.6506,5,20,0,1.59036,36.1446,0,1,0.5,0.590361,3.61446,0,1,18,1,1,1,0.5,0.795181,2.16867,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 fi +if $5==1 fx_array_mirror 1,0,0,2,0,$6 +elif $5==2 fx_array_mirror 1,0,0,3,0,$6 fi +fx_compose_vivid_color : +reverse fx_compose_lightness $1,$2 [^] fx_compose_softlight $3,0 +fx_compose_vividedges : +fx_compose_edges $1,$2,$3 [^] fx_compose_overlay $4,0 +fx_compose_vividscreen : +repeat $! l[$>] +fx_compose_screen $1,$2 . fx_compose_overlay $3,0 +done done +fx_m_l_unsharp2 : ++unsharp $1,$2,0 +unsharp $3,$4,0 [1] reverse fx_compose_darken $5 ++unsharp $3,$4,0 reverse fx_compose_lighten $6 +if $7==1 fx_smooth_anisotropic 60,$8,$9,$10,1.1,0.8,30,2,0,1,1,0 fi +blend overlay +fx_m_l_unsharp2_preview : +gui_split_preview "fx_m_l_unsharp2 ${1--2}",$-1 +fx_chanshuff: skip "${1=100},${2=0},${3=0},${4=1},${5=0},${6=10},${7=101},${8=100},${9=0},${10=0}" +foreach { +fac=$1 +arg0 $3,"x","y" axis=${} +arg0 $4,"rv","u","xm","ym","zm","cm","xM","yM","zM","cM","R","G","B","A","im","iM","ia","iv","id","is","ip","ic","in","w","h","z" +sort=${} +arg0 $5,"+","-" order=${} +wi,he:=w,h +if $3 +if $1>$he fac=$he fi sli={0,floor(h/$fac)} +else +if $1>$wi fac=$wi fi sli={0,floor(w/$fac)} +fi +if $2>0&&$2!=360 rotate $2,0,0 fi ++s c +cc:=$!-1 +if $1 +s[^0] $axis,$sli +if $4>0 sort_list[^0] $order,$sort else rv[^0] fi +repeat $cc { a[{$>+1}-{$sli+$>}] $axis } +else +N:=floor(u(2,50)) +repeat $cc { l[{$>+1}] { +fx_rnd_split $N,$3 +if $4>0 sort_list[^0] $order,$sort else rv[^0] fi +a $axis +} +} +fi +a[^0] c keep. +if $2>0&&$2!=360 +rotate. -$2,0,0 +vx,vy:=floor([w-$wi,h-$he]*0.5) +vxb,vyb:=$vx+$wi-1,$vy+$he-1 +crop. $vx,$vy,$vxb,$vyb +fi +} +fx_chanshuff_preview: +fx_chanshuff $* +fx_rnd_split: skip "${1=10},${2=0}" +foreach { +N=$1 +l. { +if $2 D=h else D=w fi +{$N+1},1,1,1,>u+j(-1) n. 0,{-2,$D} round. discard. +repeat h-1 { +param=1,[i[$>],i[$>+1]-1] +if $2 +rows[0] {$param} else +columns[0] {$param} fi +} +rm[0,1] +} +} +fx_linespam: skip "${1=30},${2=3},${3=1.02},${4=0.8},${5=-1},${6=10},${7=101},${8=100},${9=0},${10=0},${11=255,85,0,255},${12=0},${13=0},${14=0},${15=5},${16=10},${17=0.8},${18=1},${19=0}" +foreach { +if ${-1} to_rgba fc 0,0,0,0 else [0] to_rgba. fc. 0,0,0,0 fi +l. { +bthick=$2 +repeat 4 { +repeat $-2 { +iter,thick,tscale,opac,sx,sy,ex,ey,def,style,colr,colg,colb,cola,cvar,rcol,aa,amp,edg,smoo,spam=${1--2} +c={$>+1} +repeat $iter { +if $rcol==1 +col:={floor([u($colr-50,$colr+50),u($colg-50,$colg+50),u($colb-50,$colb+50)])},255 +else +col=$colr,$colg,$colb,255 +fi +if $style==0 A,B=$>,$< elif $style==1 A,B:=[$<,$>]*[2,.5] elif $style==2 A,B=$< else A,B:=$>/2 fi +thickline. {$sx*$c+$bthick}%,{$A*$sy}%,{$B+$ex}%,{$ey-$A*$B}%,$thick,$opac,$col +thick*=$tscale +if inrange($colr+$cvar,0,255,0,0) colr+=$cvar fi +if inrange($colg+$cvar,0,255,0,0) colg+=$cvar fi +if inrange($colb+$cvar,0,255,0,0) colb+=$cvar fi +} +} +if $def deform $def fi +rotate. 90,0,0 +} +if $aa fx_smooth_antialias $amp,$edg,$smoo fi +n 0,255 +} +if $!>1 blend alpha,1 fi +} +fx_linespam_preview: +fx_linespam $* +fx_papercuts : +foreach { +simp,ln,lay,col,cr,cg,cb,cvar,sort,order,shb,sho,sx,ang,mulay,ind,def,cvs,cstr,down=$* +arg0 $9,"none","rv","u","xm","ym","zm","cm","xM","yM","zM","cM","R","G","B","A","im","iM","ia","iv","id","is","ip","ic","in","w","h","z" +sort=${} +arg0 $10,"+","-" order=${} +wi,he:=w,h +if $down<100 r $down%,$down%,100%,100%,3 coeff:=$down/100 simp,ln,shb,def*=$coeff else coeff=1 fi +to_rgb n 0,255 +if $ln normalize_local $ln,$ln fi +if $simp +b {$simp/5} +bilateral {[$simp*2,$simp*2]},0,0 +fi +autoindex $lay,$ind,0 +split_colors 20,$lay,32 np=$! +if $def deform $def fi +sh 3 b[$np--1] {0.8*$coeff} rm[$np--1] +sh 0,2 +if $col==0&&$cvar ap[$np--1] "adjust_colors ,,,{[u(-$8,$8),u(-$8)]},0,255" fi +if $col==1 ap[$np--1] "fc $5,$6,$7,255 adjust_colors ,,,{[u(-$8,$8),u(-$8)]},0,255" fi +if $col==2 ap[$np--1] "fc ${-rgb},255" fi +dilate 1.5 +rm[$np--1] +if $9>1 sort_list $order,$sort fi +if $9==1 rv fi +if $col==1 foreach { mul {0.97^$<} } fi +if $shb&&$sho +wes,hes:=w,h +repeat $np { ++b[$<] $shb spread. {$shb/4} +sh. 0,2 fc. 0,0,0 rm. +if $sho<1 sh. 3 *. $sho rm. fi +[$<] mul. 0.3 +if $sx +shift.. {$sx*[cos($ang),sin($ang)]} +fi +blend[-2,-1] multiply,1 +shrink_xy[$<] {$<*$coeff} +mv. $< +blend[$<,{$<+1}] alpha +} +fi +if $down<100 r $wi,$he,100%,100%,1 fi +$wi,$he,1,3 fc. 255,255,255 +if $cvs +repeat $! { +if $cstr fx_prawn_canvas[$<] $cstr,{u(20,30)},0 fi +} +rep_emboss_relief 5,{$ang+180},1,2,1,0,1 +normalize_local 0.3,0.3,0,0,1 +fi +to_rgb. negate. +mv. 0 if $mulay +blend alpha rv n 0,255 else blend alpha n 0,255 fi +} +fx_papercuts_preview: +tic +if $-1<100&&$-1!=50 fx_papercuts $* else fx_papercuts ${1--2},50 fi +toc to ${} +#@cli pr_thickspline : x0[%],y0[%],u0[%],v0[%],x1[%],y1[%],u1[%],v1[%],_lines_count,_spacing,_opacity,_color1,... +#@cli : Draw a number of specified colored spline curves on selected images (cubic hermite spline). +#@cli : Default values: 'lines_count=3' 'spacing=2', 'opacity=1' and 'color1=0'. +#@cli : $ 400,400,1,3 repeat 30 { pr_thickspline {u([w,h,1000,1000,w,h,1000,1000,10,10])},0.5,${-rgb} } +e[^-1] "Draw a number $9 of splines ($1,$2) - ($5,$6) on image$?, with spacing $10, opacity $11 and color (${12--1})." +pr_thickspline : skip ${9=3},${10=2},${11=1},${12=0} +if $10<=1 spline ${1-8},${11--1} +else foreach { +x0={if(${"is_percent $1"},$1*(w-1),$1)} +y0={if(${"is_percent $2"},$2*(h-1),$2)} +u0={if(${"is_percent $3"},$3*(w-1),$3)} +v0={if(${"is_percent $4"},$4*(h-1),$4)} +x1={if(${"is_percent $5"},$5*(w-1),$5)} +y1={if(${"is_percent $6"},$6*(h-1),$6)} +u1={if(${"is_percent $7"},$7*(w-1),$7)} +v1={if(${"is_percent $8"},$8*(h-1),$8)} +th=$10 +eval +it=0;${-math_lib}"repeat ( $9,spline(#0,["$x0-it","$y0-it"],["$u0-it*10","$v0+it*10"],["$x1-it","$y1-it"],["$u1-it*10","$v1+it*10"],$11,[${12--1}]);it+=$th )" +} fi +fx_prawn_canvas : skip "${1=1},${2=0.5},${3=0},${4=255},${5=255},${6=255},${7=255}" +foreach { +nm REND +to_a ++fc 255,255,255 noise. 50,2 to_gray. . . +if $2 +__wat,__watb=water.,water.. +__watv=$2,1,45 +else +__wat,__watb,__watv=b.,b..,0 +fi +blur_x. 30 $__wat $__watv sharpen. 50 spread. 1.7 +blur_y.. 30 $__watb $__watv sharpen.. 50 spread.. 1.7 +*. .. keep[0,-1] +n. 0,255 +gradient. xy,1 -a[-2,-1] c *. {$1/100} +if $3 +warp[REND] .,3,1,3,1 ++fc[REND] $4,$5,$6,$7 +move[-1] 0 blend[0,REND] alpha +nm[0] REND +else +sh[REND] 0,2 warp. ..,3,1,3,1 rm. +fi +keep[REND] +} +fx_prawn_canvas_preview: +fx_prawn_canvas $* +fx_sickpaint: +foreach { +div:=h/$4 +Rstep,Gstep,Bstep:=sqrt(([${13-15}]-[${10-12}])^2)/$div +repeat $1 { +sx,sy,ex,ey:=u($2),u($3),u($2),u($3) +Rs,Gs,Bs=$10,$11,$12 +if $8<1 o:=u($8,$7) else o=1 fi +do +ls,d:=$6/($>+1),u($9) +ex,ey+=u($4),u($5) +thickline $sx,$sy,$ex,$ey,$ls,$o,$Rs,$Gs,$Bs +circle $sx,$sy,{$ls},$o,$Rs,$Gs,$Bs +cx,cy:=u($>*100),u($>*100) +thickline $sx,$sy,{[$ex+$cx,$ey+$cy]},$ls,$o,$Rs,$Gs,$Bs +circle {[$sx+$cx,$sy+$cy,$ls*0.5]},$o,$Rs,$Gs,$Bs +circle {[$sx+u($>)*2,$sy+u($>)*2,u(3),u(0.5)]},0,0,0 +thickline {[u($sx),u($sy),$ex+u($>*200),$ey+u($>*200),u($ls)]},$o,$Rs,$Gs,$Bs +pr_thickspline {[$sx+$>,$sy+$>,$d,0,$ex+$>,$ey+$>,$d,0,u(2,10),u(3,10),$o,$Rs,$Gs,$Bs]} +pr_thickspline {[$sx+$>,$sy+$>,0,$d,$ex+$>,$ey+$>,0,$d,u(2,10),u(3,10),$o,0,0,0]} +if $10>$13 Rs-=$Rstep else Rs+=$Rstep fi +if $11>$14 Gs-=$Gstep else Gs+=$Gstep fi +if $12>$15 Bs-=$Bstep else Bs+=$Bstep fi +sx,sy=$ex,$ey +while $ey<=h||$ex<=w +if $ey>=h||$ex>=w +repeat 2 { +rotate {[g,0,0,u(150)%,u(150)%]} +s x,$16 nm[0,1,2] A,B,C sort_list -,u +mirror[0] x +mirror[2] y +shift[1] {[floor([u(-10,10),u(-10,10)]),0,0,floor(u(3.9))]},0 +spread[1] {u(0.3)} deform[1] {u(0.8)},0 +sort_list -,n +a x +} +fi +} +sharpen 1800 +smooth 40,0,1,1,2 +rep_emboss_relief 5,0,0.5,1,1,0,1 +} +fx_sickpaint_preview: +tic fx_sickpaint $* toc to ${} +#@cli calispline : x0[%],y0[%],u0[%],v0[%],x1[%],y1[%],u1[%],v1[%],_rad0,rad1,_ang,_opacity,_color1,... +#@cli : Draw specified colored calligraphic line, tracing an underlying cubic +#@cli : hermite spline, on selected images. Default values: 'rad0=rad1=3', +#@cli : 'ang=0', 'opacity=1' and 'color1=0'. +#@cli : $ image.jpg repeat 30 { calispline {u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},{u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},0.6,255 } +calispline : skip ${9=3},${10=3},${11=0},${12=1},${13=0} +e[^-1] "Draw a calligraphic spline from ($1,$2) tangent: [$3,$4] to ($5,$6) tangent: [$7,$8] on image$?, ""with pen shape: $9-$10, angle $11, opacity: $12 and color (${13--1})." +foreach { +x0={if(${"is_percent $1"},$1*(w-1),$1)} +y0={if(${"is_percent $2"},$2*(h-1),$2)} +u0={if(${"is_percent $3"},$3*(w-1),$3)} +v0={if(${"is_percent $4"},$4*(h-1),$4)} +x1={if(${"is_percent $5"},$5*(w-1),$5)} +y1={if(${"is_percent $6"},$6*(h-1),$6)} +u1={if(${"is_percent $7"},$7*(w-1),$7)} +v1={if(${"is_percent $8"},$8*(h-1),$8)} +r0,r1,ang,opac=${9-12} +eval ${-mysplines}"calispline(#0,["$x0","$y0"],["$u0","$v0"],["$x1","$y1"],["$u1","$v1"],$r0,$r1,$ang,$opac,[${13--1}])" +} +mysplines : +status " +calispline(ind,P0,T0,P1,T1,rad0,rad1,ang,opacity,color) = ( +unref(_ds_color); +unref(_ds_mask); +_P0 = P0; +_P1 = P1; +_rad0 = rad0; +_rad1 = rad1; +_ang = ang; +_opacity = opacity; +_ds_color = resize(color,s#ind)*=abs(_opacity); +_omopacity = 1 - max(_opacity,0); +_C = hermite_coef(_P0,T0,P1,T1); +_dt = _dtmin = 1/max(abs(_P1 - _P0)); +_P0 = inf; +for (_t = 0, _t<=1, _t+=_dt, +_P = round(mul([_t^3,_t^2,_t,1],_C,2)); +_dP = abs(mul([3*_t^2,2*_t,1,0],_C,2)); +_dt = min(_dtmin,0.75/max(_dP)); +if (_P0!=_P, +ellipse(#ind,_P[0],_P[1],_rad0,_rad1,ang,_opacity,_ds_color); +); +_P0 = _P; +); +nan; +); +hermite_coef(P0,T0,P1,T1) = ( +C=mul([ 2,-2,1,1,-3,3,-2,-1,0,0,1,0,1,0,0,0 ],[ P0,P1,T0,T1 ],2); +); +" +#@cli splinefun : [palette],curve_plot_count,complexity_level,thickness,pen_width,pen_angle +splinefun: -check ${"is_image_arg $1"} +-check "${2=64}>0 && ${3=3}>0 && ${3}<12 && ${4=4}>2 && ${5=45} && ${6=0.25}>=0 && ${6}<=1" +-pass$1 1 +-name. palette +foreach[^palette] { +nm={0,n} +-name. canvas +-pass$1 +-name. palette +crvcnt={w#$palette} +res=$2 +lvl={2^$3} +thick=$4 +ang={deg2rad($5)} +opacity=$6 +-input $lvl,1,1,4,[u($crvcnt),u($res),u(-1,1),u(-1,1)] +-rbf. $crvcnt,$res +-name. plotcoords +-sub[plotcoords] {ia} +-mul[plotcoords] {1.75/(iM-im)} +-fill[plotcoords] "begin( +sw=min(w#$canvas,h#$canvas)/2; +id=eye(3); +id[0]=sw; +id[2]=sw; +id[4]=-sw; +id[5]=sw +); +(id*[I(x,y),1])[0,2]" +-permute[plotcoords] cyzx +-split[plotcoords] c +lc=0 +-name[^canvas,palette] plot +-foreach[plot] { +-name. plots ++mirror[plots] y +-permute. cyzx +-fill. begin(OFS=cexp([log($thick),$ang]));I(#-1,x,y)+OFS +-permute. cyzx +-append[-2,-1] y +-pass[canvas] 1 +-pass[palette] 1 +-eval "PV=crop(#$plots); +polygon(#$canvas,size(PV)/2,PV,$opacity,I(#$palette,$lc,0))" +-rm +lc+=1 +} +-keep[canvas] +-name[canvas] $nm +} +-rm[palette] +#@cli :: Reptorian's CLI Commands +#@cli rep_python_insert_integer_value: +#@cli : Allows user to insert integer values from the cli interface. Then, return the integer value. +rep_python_insert_integer_value: +exec 1,"python -c \"import sys; sys.exit(int(input('\\n[gmic][python]-"$^"./ Input Integer Value: ')))\"" +#@cli rep_closest_number_in_ordered_list_of_numbers: number_to_search,number_a,number_b.... +#@cli : Find closest number in list of number +rep_closest_number_in_ordered_list_of_numbers: +eval " +const number_to_search=$1; +vn=sort([${2--1}]); +const size_vn=size(vn); +const last_index=size_vn-1; +diff(a,b)=abs(a-b); +number_to_search==inf?( +last_index; +): +number_to_search==-inf?( +0; +): +number_to_search>vn[last_index]?( +vn[last_index]; +): +number_to_searchnumber_to_search, +if(p, +a=diff(number_to_search,value); +b=diff(number_to_search,old_value); +return_number=a0 +#@cli : For use in images with large color blobs, this simplifies a image. +rep_color_region: +skip ${1=25%},${2=0%},${3=6} +check "inrange($1,0,1,0,1)&&inrange($2,0,1,1,1)&&$3>=0" +area_threshold,stray_threshold,color_distance_threshold=${1-3} +foreach { ++round ++colormap. 0,,1 ++index[-2] [-1],0,0 ++area. 0,0 +ge. {ia*$area_threshold} +*.. . +negate. +-.. . +rm. +colormap. 0,,1 +if xM discard. -1 +else crop. 1,100% +fi +map. .. +if $color_distance_threshold +if h>1 dimensions=1,100% +else 100%,1 +fi +$dimensions,1,1,">begin( +const color_distance_threshold=$color_distance_threshold; +position=0; +test_color=vector(#s#-1,-inf); +); +distance=norm(I#-1-test_color); +if(distance>color_distance_threshold&&distance!=inf, +++position; +); +test_color=I#-1; +position;" +blend[-2,-1] shapeaverage colormap. 0 +fi +rm.. +index.. .,0,1 +rm. rv +if $2 +100%,100%,100%,1 +1,1,1,2 +eval[0] >" +begin( +off_place=[-1,1]; +); +pixel_in_place=0; +repeat(4,position, +xp=off_place[position&1]; +yp=off_place[position>>1]; +pixel_in_place=(I==J(xp,0,0,0,1))&&(I==J(0,yp,0,0,1)); +if(pixel_in_place,break();); +); +if(!pixel_in_place, +pixel_position=[x,y]; +i(#-2,pixel_position)=1; +da_push(#-1,pixel_position); +); +I;" +if !iM#-2 keep[0] continue fi ++label[0] 0,0 +area. 0,0 +le. {$stray_threshold*iM} +*[-3,-1] +if !iM#-2 keep[0] continue fi +eval " +size_da=da_size(#-1); +point=size_da-1; +repeat(size_da, +if(!i(#-2,I[#-1,point],0,1),da_remove(#-1,point);); +--point; +); +da_freeze(#-1); +" +eval. :"begin( +a_coordinates=[-1,0,1,-1,1,-1,0,1]; +b_coordinates=[-1,-1,-1,0,0,1,1,1]; +); +number_of_valid_pixels=0; +difference_vector=vector(#4,inf); +repeat(8,position, +offset_a=a_coordinates[position]; +offset_b=b_coordinates[position]; +offset=[offset_a,offset_b]; +test_pixel_position=I+offset; +if(!i(#3,test_pixel_position,1), +difference_vector[position]=norm(I(#0,I,0,1),I(#1,test_pixel_position,0,1)); +++number_of_valid_pixels; +); +); +if(number_of_valid_pixels, +position=argmin(difference_vector); +offset_a=a_coordinates[position]; +offset_b=b_coordinates[position]; +offset=[offset_a,offset_b]; +pixel_position=I+offset; +I(#0,I)=I(#0,pixel_position,0,1); +);" +fi +keep[0] +} +#@cli rep_two_dimension_set_indices: +#@cli : Return images containing indexes +rep_two_dimension_set_indices: +num_of_imgs:=$! +repeat $num_of_imgs { +width:=w#$> +height:=h#$> +if narg(${image_dimension_${width}_${height}}) +eval da_push(#${image_dimension_${width}_${height}},$>) +else +1 => image_dimension_${width}_${height} +eval da_push(#-1,$>) +fi +} +foreach[$num_of_imgs--1] { eval da_freeze(#-1) } +#@cli rep_sort_images_by_images_name_order: name_a,name_b +#@cli Sort images accordingly to images name. Duplicates images name are not accepted! +#@cli : $ sample portrait2,duck,fruits,portrait1,portrait2,duck,duck,fruits rep_sort_images_by_images_name_order duck,portrait2,fruits,portrait1 +rep_sort_images_by_images_name_order: +imgs_moved=0 +$=arg +for $imgs_moved<$! { +named[$imgs_moved--1] 0,${arg{$>+1}} +t_arg:=narg(${}) +if $t_arg +move[${}] $imgs_moved +imgs_moved+=$t_arg +else error missing_image_name +fi +} +#@cli rep_sort_images_by_order: number_a,number_b,.... +#@cli : Sort images accordingly to numerical arguments. The number of numerical arguments has to be equal to the number of images, and they have to be positive integer number starting from 0 until number that is equal to number of arguments minus one. +#@cli : $ sample cat,dog,lena,david,house,flower,waterfall,tiger name {expr('x',$!)} rep_sort_images_by_order 5,1,7,0,4,2,3,6 +rep_sort_images_by_order: +if $#!=$! error invalid_image_count fi +input_v=[{[$*]%$#}] +sorted_v=[{expr('x',$#)}] +if $input_v==$sorted_v return +elif $input_v==reverse($sorted_v) reverse +else +$#,1,1,1 +$#,1,1,1,>"begin( +const max_index=w-1; +index_counter=vector(#w,0); +order=[$*]; +); +value_index=order[x]%w; +if(++index_counter[value_index]>1,run('error dup_ind_inp');); +off_position=value_index-i(#-1,value_index); +polygon(#-1,2,value_index,0,max_index,0,-1,1); +off_position+x; +" +remove[-2] +repeat $# { +move[{i(#-1,$>)}] $> +} +remove[-1] +fi +#@cli rep_num2base_float_max: number +#@cli : Create a image which represent a positive integer number in base 16777216. Used for emulating BIGINT process. ++rep_num2base_float_max: +user_number,base_float=$1,{"1<<24"} +('$1') fill[-1] inrange(i,_'0',_'9',1,1) if !im error inv_char_det fi rm. +1 +for $user_number>9007199254740992 +eval " +const _0=_'0'; +dividend='"$user_number"'; +res=0; +repeat(size(dividend),p, +res=(res*10+(dividend[p]-_0))%$base_float; +); +da_push(#-1,res); +" +1 +eval " +number='"$user_number"'; +const divisor=$base_float; +const n_size=size(number); +const _0=_'0'; +index=0; +dividend=number[index]-_0; +while(dividendindex, +da_push(#-1,int(dividend/divisor)+_0); +dividend=(dividend%divisor)*10+(number[++index]-_0); +); +da_freeze(#-1); +" +user_number={t} +remove[-1] +done +eval " +const base_float=$base_float; +user_number=$user_number; +do( +da_push(#-1,user_number%base_float); +user_number=int(user_number/base_float); +,user_number); +resize(#-1,da_size(#-1),1,1,1,-1);" +#@cli rep_tuppers_self_K: apply_pre_negation={ 0=false | 1=true } +#@cli : Generate K values from images. Also, threshold image for users to check what it would look like. +#@cli : Default values: 'apply_pre_negation=1' +rep_tuppers_self_K: +skip ${1=1} +n0={'0'} +foreach +if !(s&1) to_graya s c /. 255 * +else to_gray +fi +if !iv +if $> out.=,0 +else out=0 +fi +fi +height={h} +if $height<2 error inv_dimension_[$>] fi +gt {(im+iM)/2} ++store. image +if $1 negate fi +rotate 90 +unroll x +crop {xM+1},100% +1 +eval[-2] >"begin( +da_push(#-1,1); +); +max_index=da_size(#-1)-1; +carry_over=0; +repeat(da_size(#-1),pos, +dec_digit_pos=max_index-pos; +new_number=(i[#-1,dec_digit_pos]<<1)+carry_over; +carry_over=int(new_number/10); +i[#-1,dec_digit_pos]=new_number%10; +); +if(carry_over,da_insert(#-1,0,1);); +if(i,++i[#-1,da_size(#-1)-1]); +end( +resize(#-1,da_size(#-1),1,1,1,-1); +); +" +remove[-2] +fill <"begin( +const height=$height; +carry_over=0; +); +n=carry_over+i*height; +carry_over=int(n/10); +n%10; +end( +if(carry_over, +set('carry_over',carry_over); +); +);" ++ $n0 +if $carry_over +('{$carry_over}') +reverse +append x +fi +if $> out.=,{t} +else out={t} +fi +rm $image +done +status $out +#@cli rep_tuppers_self: _K>=h,_apply_negate={ 0=false | 1=true } +#@cli : Generates output of K onto a single image. +#@cli : Note: _K must be a integer number equal or greater to the height of image. +#@cli : Default values: '_K=96093937991.....','apply_negate=1' +rep_tuppers_self: +skip ${1=960939379918958884971672962127852754715004339660129306651505519271702802395266424689642842174350718121267153782770623355993237280874144307891325963941337723487857735749823926629715517173716995165232890538221612403238855866184013235585136048828693337902491454229288667081096184496091705183454067827731551705405381627380967602565625016981482083418783163849115590225610003652351370343874461848378737238198224849863465033159410054974700593138339226497249461751545728366702369745461014655997933798537483143786841806593422227898388722980000748404719},${2=1} +if $!!=1 error n_imgs_inv fi +if d>1 error imgs_dims_inv fi +if $1_'9' error inv_text_\$1 fi +if w#-1index, +da_push(#-1,int(dividend/divisor)+_0); +dividend=(dividend%divisor)*10+(number[++index]-_0); +); +da_freeze(#-1); +" ++rep_num2base_float_max {t} remove[-2] +{24*(w-1)+int(log2(i(#-1,w-1)))+1} +eval[-2] " +point=x*24; +digit=i; +while(digit, +i(#-1,point++)=digit&1; +digit>>=1; +); +" +map[-3] [-1] +remove[-2,-1] +if $2 negate fi +#@cli rep_nearest_ratio: value_a>0,value_b>0,_maximum_proposition_number>0,_output_whether_true_ratio={ 0=False | 1=True } +#@cli : Return nearest ratio from 2 different values +#@cli : Default value: '_maximum_divisor=0' +rep_nearest_ratio: +skip ${3=0},${4=0} +check "!(find([${1-2}]>0,0,0,1)+1)&&isint($3)&&$3>=0" +eval " +const nv=2+($4&1); +const max_prop_num=$3; +v=[${1-2}]; +a=min(v); +b=max(v); +common_number=gcd(a,b); +c=b/common_number; +true_ratio=0; +!max_prop_num||cv[1]?[b,a]:[a,b]; +):( +ratio=a/b; +proposition_number=round(ratio*max_prop_num); +common_number=gcd(proposition_number,max_prop_num); +b=max_prop_num/common_number; +proposition_number/=common_number; +a=proposition_number; +ans=v[0]>v[1]?[b,a]:[a,b]; +); +vectornv(ans,true_ratio); +" +#@cli rep_red_acrylic_filter: [source_image],_luminosity_blend_factor>=0%,_green_cut>=0%,_green_visibility>=0% +#@cli : Alter a image so that target image would be visible using a red acrylic plastic sheet as cover. +rep_red_acrylic_filter: +skip ${1=},${2=0%},${3=0%},${4=100%} +n_imgs,blend_factor,boost,green_chroma={$!},{cut($2,0,1)},{cut(abs($3),0,1)*255},{cut($4,0,1)} +import_img=${is_image_arg\ $1} +if $import_img||($n_imgs&1) +eval " +start_vector=[w#0,h#0,d#0]; +same_dim=1; +repeat($n_imgs-1,p, +q=p+1; +if([w#q,h#q,d#q]!=start_vector,same_dim=0;break();); +); +same_dim;" +eq_dims=${} +if $import_img +pass$1 0 +fi +if s&1 +to_gray[-1] +else +to_graya[-1] +split[-1] c +/. 255 +*[-2,-1] +fi +if $!-$n_imgs>1 error inv_imp_count fi +if $eq_dims +target_dim={[w#0,h#0]} +rep_aspect_crop_2d[-1] $target_dim +resize[-1] $target_dim,100%,100%,3 +name[-1] channel +repeat $!-1 { +local[$>,channel] { +if s#0&1 to_gray.. +else +to_graya.. +split.. c +fi +100%,100%,100%,100% ++negate[0] 255 +a[0,-2,-1] c +image[0] [channel],0,0,0,1 +if $!==3 append[0,1] c fi +shared[0] 0 shared[0] 1 +if $blend_factor +image[-1] [-2],0,0,0,0,$blend_factor +fi +if $boost +cut[-1] $boost,255 +fi +if $green_chroma<1 +*[-1] $green_chroma +fi +rm[-2,-1] +} +} +rm[channel] +else +store. channel +foreach { +contain_alpha=0 +target_dim={[w,h]} +if s&1 +to_gray +else +to_graya +split c +contain_alpha=1 +fi +$channel +rep_aspect_crop_2d. $target_dim +resize. $target_dim,100%,100%,3 ++negate[0] 255 +if $blend_factor +image.. [0],0,0,0,0,$blend_factor +fi +if $boost +cut.. $boost,255 +fi +if $green_chroma<1 +mul.. $green_chroma +fi +if $contain_alpha +append[0,2,3] c +fi +append c +} +fi +else +source_pos,target_pos={[1,0]} +repeat $!>>1 { +contain_alpha,current_source_pos=0,$source_pos +target_dim={[w#$target_pos,h#$target_pos]} +if s#$source_pos&1 +to_gray[$source_pos] +else +to_graya[$source_pos] +split[$source_pos] c +/. 255 +*[$source_pos,{$source_pos+1}] +fi +if s#$target_pos&1 +to_gray[$target_pos] +else +to_graya[$target_pos] +split[$target_pos] c +contain_alpha,current_source_pos+=1 +fi +rep_aspect_crop_2d[$current_source_pos] $target_dim +resize[$current_source_pos] $target_dim,100%,100%,3 ++negate[$target_pos] 255 +if $blend_factor +image[$current_source_pos] [$target_pos],0,0,0,0,$blend_factor +fi +if $boost +cut[$current_source_pos] $boost,255 +fi +if $green_chroma<1 +*[$current_source_pos] $green_chroma +fi +append[$target_pos,$current_source_pos] c +append[$target_pos,-1] c +if $contain_alpha +append[$target_pos,{$target_pos+1}] c +fi +source_pos,target_pos+=1 +} +fi +#@cli rep_lavander_binary_map: _size_of_arr_by_power_of_two>0,_mode={ -1=custom | 0=and | 1=or | 2=xor },_bin_a,_bin_b,_shift>0,custom_expression +#@cli : Create a texture that does the following steps: +#@cli : 1) Create an array of integer that matches index with size of 2^n. +#@cli : 2) Create another array which is the count of 'bin_a' in binary representation of the previous array. +#@cli : 3) Count sort the array of integer with the count of binary number array. +#@cli : 4) Delete all other array other than the sorted array. +#@cli : 5) Generate a surface with row and column the same size as the primary array, and use formula which takes values from the sorted value, and then find the count of 'bin_b' in binary representation of the found value. +#@cli : - Built-in Macros - +#@cli : flip(v) - Flips the bitwise values of number +#@cli : and(a,b) - a & b +#@cli : or(a,b) - a | b +#@cli : - End of Built-in Macros - +#@cli : Note : The idea comes from Lavander at discord/generative. Based on a Python code. +#@cli : Default values: '_size_of_arr_by_power_of_two=11','_mode=2','_bin_a=01','_bin_b','_shift=0', ++rep_lavander_binary_map: +skip ${1=11},${2=2},${3=01},${4=10},${5=0},${6=} +check "$1>0&&($1==int($1))&&(isint($2)||('-'=='$2'))" +a6={size('$6')} +shift,length,mode,str_code={int(abs($5))},{2^$1},{v='$2'=='-';n=isint($2)?$2:0;v?0:(n>=0?n%3+1:-((abs(n)-1)%3+1));},0 +size_of_arr={int(log2($length+$shift-1))+1} +str_code_2=n=init_num() +act_arr_sortclass={$mode>-1} +if !$mode&&!$a6 error custom_formula_required fi +if $act_arr_sortclass +$length,1,1,1,x +if v='$3';max(v)>49||min(v)<48 error inv_char_arg_3 fi ++f. :"begin( +const size_binary_arr=$size_of_arr; +init_bin_arr=vector(#size_binary_arr,-1); +bin_search_arr='$3'-47; +const bin_search_arr_size=size(bin_search_arr); +const max_pos=size_binary_arr-bin_search_arr_size+1; +); +count=p=0; +n=i+$shift; +bin_arr=init_bin_arr; +rf=int(log2(n))+1; +mk=rf-1; +repeat(rf,k, +bin_arr[mk-k]=(n>>k)&1; +); +++bin_arr; +while(bin_arr[p]&&pbegin(n=0;);i?(v=n;n+=i;v;); +f.. >v=i(#-1,i);++i(#-1,i);v; +{w#-2},1,1,1 +eval... i(#-1,i)=i(#-4,x); +rm[-4--2] +fi +if $act_arr_sortclass?(v='$4';):(v='$3';);max(v)>49||min(v)<48 error inv_char_arg_4 fi +if !$mode +str_code=ix=max_index-x;iy=max_index-y;int($6) +str_code_2..=ix=max_index-x;iy=max_index-y; +$length,$length,1,1,:" +begin( +const max_index=w-1; +flip(v)=xor((1<<(int(log2(v))+1))-1,v); +and(a,b)=a&b; +or(a,b)=a|b; +x()=i(#-1,x,0,0,0,0,2); +y()=i(#-1,y,0,0,0,0,2); +ix()=i(#-1,max_index-x,0,0,0,0,2); +iy()=i(#-1,max_index-y,0,0,0,0,2); +); +"$str_code"; +" +size_of_arr={int(log2(iM#-1))+1} +rm. +fi +if $act_arr_sortclass bin_search_arr={'$4'-47} +else bin_search_arr={'$3'-47} +fi +$length,$length,1,1,:"begin( +const shift_factor=$shift; +const max_index=w-1; +const size_binary_arr=$size_of_arr; +init_bin_arr=vector(#size_binary_arr,-1); +bin_search_arr=["$bin_search_arr"]; +const bin_search_arr_size=size(bin_search_arr); +const mode=$mode; +flip(v)=xor((1<<(int(log2(v))+1))-1,v); +and(a,b)=a&b; +or(a,b)=a|b; +x()=i(#-1,x,0,0,0,0,2); +y()=i(#-1,y,0,0,0,0,2); +ix()=i(#-1,max_index-x,0,0,0,0,2); +iy()=i(#-1,max_index-y,0,0,0,0,2); +mode==3?( +init_num()=xor(i(#-1,x,0,0),i(#-1,y,0,0)); +): +mode==2?( +init_num()=i(#-1,x,0,0)|i(#-1,y,0,0); +): +mode==1?( +init_num()=i(#-1,x,0,0)&i(#-1,y,0,0); +): +mode==-1?( +shift_factor?( +init_num()=(x+shift_factor)&(y+shift_factor); +):( +init_num()=x&y; +); +): +mode==-2?( +shift_factor?( +init_num()=(x+shift_factor)|(y+shift_factor); +):( +init_num()=x|y; +); +): +mode==-3?( +shift_factor?( +init_num()=xor(x+shift_factor,y+shift_factor); +):( +init_num()=xor(x,y); +); +):( +init_num()=int("$6"); +); +const max_pos=size_binary_arr-bin_search_arr_size+1; +); +count=p=0; +"$str_code_2"; +bin_arr=init_bin_arr; +rf=int(log2(n))+1; +mk=rf-1; +repeat(rf,k, +bin_arr[mk-k]=(n>>k)&1; +); +++bin_arr; +while(bin_arr[p]&&p0 +command "vibrance_ych_adj : +f \"begin( +const vibrance_factor=$_vibrance_factor_ych; +); +v=vibrance_factor*(0.63235455751419067^vibrance_factor-i^vibrance_factor); +chroma_factor=max(0,1+v); +i*chroma_factor; +\" +" +else +_abs_vibrance_factor_adj={1-abs($_vibrance_factor_ych)} +command "vibrance_ych_adj : * $_abs_vibrance_factor_adj" +fi +foreach { +if s<3||s>4 continue fi +if s==4 sh. 0,2 fi +f. 255*((I/255)^1.5) +rgb2yuv. +sh. 1,2 +f. " +V=I; +[norm(V),atan2(V[1],V[0])];" +sh. 0 +vibrance_ych_adj. +f.. " +polar_coordinates=I; +r=polar_coordinates[0]; +ang=polar_coordinates[1]; +[r*cos(ang),r*sin(ang)]; +" +rm[-2,-1] +yuv2rgb. +f. 255*((I/255)^0.66666666666666666) +rm. +} +uncommand vibrance_ych_adj +#@cli rep_import_pdn_txt: file_a...file_z...,_discard_alpha={ 0=keep | 1=discard_alpha | 2=auto } +#@cli : Import PDN Palette (.txt) +#@cli : There can be as many files. This import file relative to your current directory. +#@cli : Default values: '_discard_alpha=2' ++rep_import_pdn_txt: +if narg($-1)&&$#>1 alpha_mode={$-1%3} +else alpha_mode=2 +fi +0 +newline,commentary={'\n'},{';'} +local[-1] { +if $#>1 it ${1--2} else it $1 fi +rm[0] +foreach { +split -,$newline +foreach { +if i==$commentary +rm +else +if h<8 rm continue fi +eval " +const commentary=$commentary; +o=-1; +is_hex_character(character)= +inrange(character,_'0',_'9',1,1)|| +inrange(character,_'a',_'f',1,1)|| +inrange(character,_'A',_'F',1,1); +repeat(w#-1,p, +char=i(#-1,0,p); +if(char==commentary,break();); +if(is_hex_character(char), +o=p; +break(); +); +); +o;" +if ${}==-1 +rm +else +crop 0,${},0,{${}+7} +(${rep_hex2int8\ {t}}) +permute. cyzx +rm.. +fi +fi +} +remove_duplicates +a x +shift 0,0,0,-1,2,0 +if $alpha_mode +if $alpha_mode==2 +sh. 3 +if !iv#-1 +rm. +channels 0,2 +s x remove_duplicates a x +else rm. +fi +else channels 0,2 +fi +fi +} +} +#@cli rep_correct_exp_ne: string +#@cli : Return corrected file name for exporting files. +#@cli : Note: Every single arguments applied to this command counts as a single string. +rep_correct_exp_ne: +str_inp="$*" +str_stoi=[{'$str_inp'}] +str_length:=size($str_stoi) +if $str_length>255 error str_length<256==F fi +if $str_length==3 +if find('AUXCONNULPRN',$str_stoi,0,3)+1 +error "Cannot use Windows reserved filename" +fi +elif $str_length==4 +if (find('COMLPT',($str_stoi)[0,3],0,3)+1)&&inrange(($str_stoi)[3],_'0',_'9',1,1) +error "Cannot use Windows reserved filename" +fi +fi +(0) => temporary_string_image +eval " +const string_to_process=$temporary_string_image; +inv_chars='#<>:/?*\"'; +da_push(#string_to_process,"{'$str_inp'}"); +end_ind=da_size(#string_to_process)-1; +for(p=end_ind,p>-1,--p, +v=i[#string_to_process,p]; +find(inv_chars,v,0,1)+1?( +da_remove(#string_to_process,p); +); +v=='~'?( +I[#string_to_process,p]='-'; +): +v=='.'?( +I[#string_to_process,p]='_'; +); +); +end(da_freeze(#string_to_process););" +if h==3 +if find('AUXCONNULPRN',crop(#$temporary_string_image),0,3)+1 +error "Cannot use Windows reserved filename" +fi +elif h==4 +if (find('COMLPT',(crop(#$temporary_string_image))[0,3],0,3)+1)&&inrange(i(#$temporary_string_image,0,3),_'0',_'9',1,1) +error "Cannot use Windows reserved filename" +fi +fi +u {t} +rm. +#@cli rep_find_factors_of: num_0... +#@cli : Return the factors found in all numbers at once. +#@cli : +#@cli : Author : Reptorian. +#@cli : $ echo ${rep_find_factors_of\ 256} +#@cli : $ echo ${rep_find_factors_of\ 256,100} +#@cli : $ echo ${rep_find_factors_of\ 256,100,50} +rep_find_factors_of: +if !$# error ("\$\#">0)==F fi +if $#==1 +v=$1 +if $v<0 error inv_inp +elif $v>5000000000000000 error exc_lim +elif $v!=int($v) error inv_inp +elif $v<2 u $v return +fi +else +if $#>2 v=${rep_gcd_multiple_numbers\ $*} +else v={gcd(${1-2})} +fi +if $v<2 u $v return fi +fi +1,1,1,3 +eval " +start_v=v=$v; +square=int(sqrt(v)); +for(n=2,n<=square&&n<=v,++n, +isPrime=1; +for(p=0,pn, +break(); +); +if(!(n%prime), +isPrime=0; +break(); +); +); +if(isPrime, +count=0; +while(!(v%n), +++count; +v/=n; +); +if(count, +da_push(#-1,[n,count,0]); +diff=(da_back(#-1))[0]-n; +if(diff,I[#-1,da_size(#-1)-1]=[n,count,diff]); +square=int(sqrt(v)); +); +); +); +if(v!=1, +da_push(#-1,[v,1,0]); +diff=(da_back(#-1))[0]-v; +if(diff,I[#-1,da_size(#-1)-1]=[v,1,diff]); +); +output=da_size(#-1)==1&&v==start_v?v:0; +da_freeze(#-1); +if(output, +set('pv',v); +); +output; +" +if ${} +remove. +status 1,$pv +else +{prod(crop(0,0,0,1,1,h,1,1)+1)},1,1,1,"begin( +const num_of_primes=h#-1; +primes_freq_choices=crop(#-1,0,0,0,1,1,num_of_primes,1,1)+1; +primes_list=crop(#-1,0,0,0,0,1,num_of_primes,1,1)-crop(#-1,0,0,0,2,1,num_of_primes,1,1); +modulo_list=vector(#num_of_primes,0); +modulo_list[0]=tv=1; +repeat(num_of_primes-1,p, +tv*=primes_freq_choices[p]; +modulo_list[p+1]=tv; +); +result=vector(#w,0); +); +m=int(x/modulo_list)%primes_freq_choices; +result[x]=prod(primes_list^m); +end( +merge(result,+); +set('{}',v2s(sort(result))); +);" +remove[-2,-1] +fi +rep_gcd_multiple_numbers: +eval >" +arr=[$*]; +const size_arr=size(arr); +v=arr[0]; +for(n=1,n1,num_of_repeats>1,_muldiv_coeff_a,_muldiv_coeff_b,_muldiv_oper_a={ 0=mul | 1=div},muldiv_oper_b={ 0=mul | 1=mul},use_old_x={ 0=false | 1=true },_sublevel>=0,_seed,auto_norm,_sym_mode={0=mode_0 | 1=mode_1} +#@cli : Generates Circle Fractal. Serendipitous Circle was originally written in 6800 assembly by William F. Galway in December 1976. +#@cli : Note: The output of this command is 2 channel. The first channel is value from the Serendipitous Circle, and the second channel is the alpha value ranging from 0-1. +#@cli : Default values: '_sublevel=0','_seed=n/a' +rep_serendipitous_circle: +skip ${3=2},${4=2},${5=1},${6=1},${7=0},${8=0},${9=},${10=0},${11=1} +pts,num_of_repeats,muldiv_coeff_a,muldiv_coeff_b,muldiv_oper_a,muldiv_oper_b,use_old_x,sublevel,seed,auto_norm,sym_mode=${1-4},{$5%2},{$6%2},{$7%2},{abs($8)+1},$9,{int(abs($10))},{($11%2)*3} +command "rep_sercirc_autonorm: auto_norm=$""1 +erode. $auto_norm +dilate.. $auto_norm cut[-3] {iM#-2},{im#-1} rm[-2,-1]" +pts*=$sublevel +if $muldiv_coeff_a!=0 +if $muldiv_oper_a +if $muldiv_coeff_a<0 +calc_xn_part=+yi/{abs($muldiv_coeff_a)} +else +calc_xn_part=-yi/$muldiv_coeff_a +fi +else +if $muldiv_coeff_a<0 +calc_xn_part=+yi*{abs($muldiv_coeff_a)} +else +calc_xn_part=-yi*$muldiv_coeff_a +fi +fi +else +if ('$muldiv_coeff_a')[0]==45 +calc_xn_part=+yi +else +calc_xn_part=-yi +fi +fi +if $use_old_x +old_x_expr=xo=xi; +yn_part=xo +else +yn_part=xn +fi +if $muldiv_coeff_b!=0 +if $muldiv_oper_b +if $muldiv_coeff_b<0 +calc_yn_part=-$yn_part/{abs($muldiv_coeff_b)} +else +calc_yn_part=+$yn_part/$muldiv_coeff_b +fi +else +if $muldiv_coeff_b<0 +calc_yn_part=-$yn_part*{abs($muldiv_coeff_b)} +else +calc_yn_part=+$yn_part*$muldiv_coeff_b +fi +fi +else +if ('$muldiv_coeff_b')[0]==45 +calc_yn_part=-$yn_part +else +calc_yn_part=+$yn_part +fi +fi +{ceil((w+1)/2)*$sublevel},{ceil((h+1)/2)*$sublevel},1,2 rm.. +ratio={max(w,h)/min(w,h)} +$pts,1,1,1,:"begin_t( +if(narg($seed),srand($seed+t);); +const ratio=$ratio; +const sqr_ratio=sqr(ratio); +const inv_ratio=1/ratio; +const max_dimension=max(w#-1,h#-1)*ratio; +); +point=[int(u(0,max_dimension,1,0)),int(u(0,max_dimension,1,0))]; +xi=point[0]; +yi=point[1]; +repeat($num_of_repeats, +i(#-1,int(xi/sqr_ratio),int(yi/sqr_ratio),0,0)++; +i(#-1,int(xi/sqr_ratio),int(yi/sqr_ratio),0,1)=1; +"$old_x_expr" +xn=(xi"$calc_xn_part")%max_dimension; +yn=(yi"$calc_yn_part")%max_dimension; +xi=xn; +yi=yn; +);" +rm. s. c +r.. {ceil(w/$sublevel)},{ceil(h/$sublevel)},1,1,2 +r. {w#-2},{h#-2},1,1,5 +f.. i/(i#-1?i#-1:1) +if $auto_norm +rep_sercirc_autonorm.. $auto_norm +fi +a[-2,-1] c +rep_symmetrize_xy. $sym_mode +#@cli rep_mitchell_concatenation: startnum_a,startnum_b,_base,_base_2,_method_a={ 0=sub | 1=add | 2=mul},_method_b={ 0=sub | 1=add | 2=mul},_pixel_size,[palette],[palette],_auto_resize_pal,_shape_id,_shape_ratio,_shape_angle,shape_dir,shape_repeat_mode,shape_fit,_shape_sub,_shape_option_1..._shape_option_n +#@cli : Generates Kerry Mitchell Concatenation Art. Detailed explanation can be found at - http://www.kerrymitchell.art/spacefilling-blog/2013/11/concatenations.html +#@cli : Default values: '_int_base=10','_method_a=0','_method_b=1','_palette=n/a','hex_bg_col=n/a','_shape=n/a' +rep_mitchell_concatenation: +skip ${1=},${2=},${3=},${4=},${5=},${6=},${7=1},${8=},${9=},${10=1},${11=},${12=1},${13=0},${14=0},${15=0},${16=1},${17=1},${18=} +if narg($1)&&narg($2) +startnum_a,startnum_b={max(1,int(abs($1)))},{max(1,int(abs($2)))} +elif narg($1)||narg($2) +if narg($1) +startnum_a,startnum_b={max(1,int(abs($1)))},{max(1,int(abs($1)))} +else +startnum_a,startnum_b={max(1,int(abs($2)))},{max(1,int(abs($2)))} +fi +else +startnum_a,startnum_b=1,1 +fi +if narg($3)&&narg($4) +base_a,base_b={max(2,int(abs($3)))},{max(2,int(abs($4)))} +elif narg($3)||narg($4) +if narg($3) +base_a,base_b={max(2,int(abs($3)))} +else +base_b,base_b={max(2,int(abs($4)))} +fi +else base_a,base_b=10 fi +if narg($5)&&narg($6) +method_a,method_b={abs(int($5))},{abs(int($6))} +elif narg($5)||narg($6) +if narg($5) +method_a,method_b={abs(int($5))} +else +method_a,method_b={abs(int($6))} +fi +else method_a,method_b=1,1 fi +startnum_diff,base_diff,method_diff,shape_size={$startnum_a!=$startnum_b},{$base_a!=$base_b},{$method_a!=$method_b},{max(1,int(abs($7)))} +use_shape,double_concatenation_mode,use_different_dimensions,num_of_images={narg($11)?($shape_size>=4?1:0):0},{$startnum_diff||$base_diff||$method_diff},{$!>1?(use_diff=0;start_dim=[w#0,h#0];repeat($!-1,p,q=p+1;if([w#q,h#q]!=start_dim,use_diff=1;break();););use_diff;):0},{$!} +if $use_different_dimensions +dim_list=[{expr('p=int(x/2);x%2?ceil(h#p/$shape_size)*$shape_size:ceil(w#p/$shape_size)*$shape_size',$!*2,1,1,1)}] +fi +width,height=${-max_w},${-max_h} +rm +{ceil($width/$shape_size)},{ceil($height/$shape_size)},1,2,vector(#2,-1) +if $use_shape +ratio:=cut(abs($12),0,1) +if $ratio +shape_ang,mirror,tile_boundary,fit_size=$13,{$14%3},{$15%4},$17 +if ${is_image_arg\ $11} +pass$11 0 +if s<=4&&s>1 +if s==3 to_gray. +else +s. c,{arg(int(s/2,-3,-1)} +fi +elif s==5 +s. c,-4 cmyk2rgb.. to_gray.. *[-2,-1] +elif s>5 error inv_chans_count +fi +else +shape_sub:=abs($16)+1 +sid="$11" +if isnum($11) if isint($11) +sid=${"-arg "1+$sid"","australia,barbedwire,circle,crosshair,cupid,diamond,dragon,dragonfly,fern,flip,gear,gumleaf,heart,information,kookaburra,mail,mapleleaf,paint_splat,paw,phone,polygon,rooster,shopping_cart,snowflake,star"} +fi fi +if $#>17 shape_$sid {$shape_size*$shape_sub},${18--1} +else shape_$sid {$shape_size*$shape_sub} +fi +r. {ceil(w/$shape_size)*$shape_size},{ceil(h/$shape_size)*$shape_size},100%,100%,0,0,.5,.5 +fi +if $shape_ang-360*floor($shape_ang/360) rotate. $shape_ang fi +if $mirror==1 mirror. x +elif $mirror==2 mirror. y +fi +n. 0,1 autocrop. 0 +shape_dimensions_length={round($shape_size*$ratio)} +if $fit_size +resize2din. $shape_dimensions_length,$shape_dimensions_length,5 +else +resize. $shape_dimensions_length,$shape_dimensions_length,100%,100%,5 +fi +resize. $shape_size,$shape_size,100%,100%,0,0,.5,.5 +cut. 0,1 n. 0,1 +avgc={ia#-1} +if $tile_boundary +if $tile_boundary==1 ++mirror. x +a[-2,-1] z +elif $tile_boundary==2 ++mirror. y +a[-2,-1] z +else ++mirror. x ++mirror.. y ++mirror. x +a[-4--1] z +fi +fi +store. shape +fi +fi +if $double_concatenation_mode +if $base_b!=10 rep_concat_conset_fill_alt_base $startnum_b,$base_b +else rep_concat_conset_fill $startnum_b +fi +if $base_a!=10 +rep_concat_conset_fill_alt_base. $startnum_a,$base_a +else +rep_concat_conset_fill $startnum_a +fi +out_method_a=${arg\ $method_a+1,sub_concat_conset,add_concat_conset,mul_concat_conset} +out_method_b=${arg\ $method_b+1,sub_concat_conset,add_concat_conset,mul_concat_conset} +rep_index_based_$out_method_a[-2] $startnum_a,$base_a +rep_index_based_$out_method_b[-1] $startnum_b,$base_b +a[-2,-1] z +if ${is_image_arg\ $8} +pass$8 0 +if h#-1>1||d#-1>1 +num_of_chans={s#-1} +permute. cxyz +unroll. x +{w#-1/$num_of_chans},1,1,$num_of_chans,crop(#-1,x*$num_of_chans,0,0,0,$num_of_chans,1,1,1) +rm.. +elif w#-1==1 error inv_dims +fi +if $10 r. $base_a,1,1,100%,5 fi +fi +if ${is_image_arg\ $9} +pass$9 0 +if h#-1>1||d#-1>1 +num_of_chans={s#-1} +permute. cxyz +unroll. x +{w#-1/$num_of_chans},1,1,$num_of_chans,crop(#-1,x*$num_of_chans,0,0,0,$num_of_chans,1,1,1) +rm.. +elif w#-1==1 error inv_dims +fi +if $10 r. $base_b,1,1,100%,5 fi +fi +if $use_shape +$shape +{w#0*$shape_size},{h#0*$shape_size},1,{s#-2+1} +img_count={$!} +{w#0},{h#0},1,1,:"begin( +const shape_size=$shape_size; +const tile_boundary=$tile_boundary; +const num_chan=s#1; +const tchan=num_chan+1; +const alpha_size=sqr(shape_size); +const tile_size=alpha_size*num_chan; +empty_vec=[-1,-1]; +filled_alpha=vector(#alpha_size,255); +find_tile_mode()=(sv[0]>-1)&&(sv[1]>-1); +$img_count==5?( +generate_color_a()=I(#1,i(#0,x,y,0,0),0,0,0,2); +generate_color_b()=I(#2,i(#0,x,y,1,0),0,0,0,2); +): +$img_count==4?( +generate_color_a()=I(#1,i(#0,x,y,0,0),0,0,0,2); +generate_color_b()=I(#1,i(#0,x,y,1,0),0,0,0,2); +):( +generate_color_a()=[sv[0]]; +generate_color_b()=[sv[1]]; +); +tile_boundary==3?( +shape_0=crop(#-2,0,0,0,0,shape_size,shape_size,1,1); +shape_1=crop(#-2,0,0,1,0,shape_size,shape_size,1,1); +shape_2=crop(#-2,0,0,2,0,shape_size,shape_size,1,1); +shape_3=crop(#-2,0,0,3,0,shape_size,shape_size,1,1); +tile_v0=resize(shape_0,tile_size,0,2); +tile_v1=resize(shape_1,tile_size,0,2); +tile_v2=resize(shape_2,tile_size,0,2); +tile_v3=resize(shape_3,tile_size,0,2); +const mx=w-1; +const my=h-1; +const startnum=$startnum_a; +find_pos()=1+sum((mx-x)%2,2*((my-y+startnum)%2)); +generate_tile_b()=( +shape_tile=arg(find_pos(),tile_v0,tile_v1,tile_v2,tile_v3); +color_tile=vc_0+vc_1*shape_tile; +tile=[color_tile,filled_alpha]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +); +generate_tile_a()=( +shape_alp=arg(find_pos(),shape_0,shape_1,shape_2,shape_3); +sv[0]>=0?( +color=generate_color_a(); +color_tile=resize(color,tile_size,1,0); +tile=[color_tile,shape_alp*255]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +):( +color=generate_color_b(); +color_tile=resize(color,tile_size,1,0); +tile=[color_tile,(1-shape_alp)*255]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +); +); +): +tile_boundary?( +shape_0=crop(#-2,0,0,0,0,shape_size,shape_size,1,1); +shape_1=crop(#-2,0,0,1,0,shape_size,shape_size,1,1); +tile_v0=resize(shape_0,tile_size,0,2); +tile_v1=resize(shape_1,tile_size,0,2); +const max_index=(tile_boundary%2)?w-1:h-1; +tile_boundary%2?( +find_pos()=(max_index-x)%2; +):( +const startnum=$startnum_a; +find_pos()=(max_index-y+startnum)%2; +); +generate_tile_b()=( +shape_tile=find_pos()?tile_v1:tile_v0; +color_tile=vc_0+vc_1*shape_tile; +tile=[color_tile,filled_alpha]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +); +generate_tile_a()=( +shape_alp=find_pos()?shape_1:shape_0; +sv[0]>=0?( +color=generate_color_a(); +color_tile=resize(color,tile_size,1,0); +tile=[color_tile,shape_alp*255]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +):( +color=generate_color_b(); +color_tile=resize(color,tile_size,1,0); +tile=[color_tile,(1-shape_alp)*255]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +); +); +):( +shape_alp=crop(#-2,0,0,0,0,shape_size,shape_size,1,1); +alp_tile=resize(shape_alp,tile_size,0,2); +generate_tile_b()=( +color_tile=vc_0+vc_1*alp_tile; +tile=[color_tile,filled_alpha]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +); +generate_tile_a()=( +sv[0]>=0?( +color=generate_color_a(); +color_tile=resize(color,tile_size,1,0); +tile=[color_tile,shape_alp*255]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +):( +color=generate_color_b(); +color_tile=resize(color,tile_size,1,0); +tile=[color_tile,(1-shape_alp)*255]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +); +); +); +); +sv=[i(#0,x,y,0,0),i(#0,x,y,1,0)]; +if(sv!=empty_vec, +find_tile_mode()?( +c0=generate_color_b(); +c1=generate_color_a(); +diff=c1-c0; +vc_0=resize(c0,tile_size,1,0); +vc_1=resize(diff,tile_size,1,0); +generate_tile_b(); +):( +generate_tile_a(); +); +); +" +k.. +if $num_of_images>1 +r. 100%,100%,$num_of_digits,100%,1 +fi +if $num_of_images>1 s. z fi +if $use_different_dimensions +repeat $num_of_images { +new_width_height:=($dim_list)[$>*2,2] +r[$>] $new_width_height,1,100%,0,0,1,1 +} +fi +else +if $!==2 +{w#-2},{h#-2},2,{s#-1+1},"v=i(#-2,x,y,z,0); +v>=0?[I(#-1,v,0,0,2,1),255]:vector(#s,0);" +rm[-3,-2] +elif $!==3 +{w#-3},{h#-3},2,{s#-1+1},"v=i(#-3,x,y,z,0); +z?(v>=0?[I(#-2,v,0,0,2,1),255]:vector(#s,0);): +(v>=0?[I(#-1,v,0,0,2,1),255]:vector(#s,0););" +rm[0,-3,-2] +display +elif $!>3 error only_one_pal +fi +if ($shape_size>1)||($num_of_images>1) +r. {w#-1*$shape_size},{h#-1*$shape_size},{2*$num_of_images},100%,1 +fi +if $num_of_images s. z,-2 fi +if $use_different_dimensions +repeat $num_of_images { +new_width_height:=($dim_list)[$>*2,2] +r[$>] $new_width_height,2,100%,0,0,1,1 +} +fi +fi +else +if $base_a!=10 rep_concat_conset_fill_alt_base $startnum_a,$base_a +else rep_concat_conset_fill $startnum_a +fi +out_method=${arg\ $method_a+1,sub_concat_conset,add_concat_conset,mul_concat_conset} +rep_index_based_$out_method $startnum_a,$base_a +if ${is_image_arg\ $8} +pass$8 0 +if h#-1>1||d#-1>1 +num_of_chans={s#-1} +permute. cxyz +unroll. x +{w#-1/$num_of_chans},1,1,$num_of_chans,crop(#-1,x*$num_of_chans,0,0,0,$num_of_chans,1,1,1) +rm.. +elif w#-1==1 error inv_dims +fi +if $10 r. $base_a,1,1,100%,5 fi +fi +if ${is_image_arg\ $9} +pass$9 0 +if h#-1>1||d#-1>1 +num_of_chans={s#-1} +permute. cxyz +unroll. x +{w#-1/$num_of_chans},1,1,$num_of_chans,crop(#-1,x*$num_of_chans,0,0,0,$num_of_chans,1,1,1) +rm.. +elif w#-1==1 error inv_dims +fi +if $10 r. $base_a,1,1,100%,5 fi +fi +if $use_shape +$shape +if $!>3 error only_one_pal +else +{w#0*$shape_size},{h#0*$shape_size},1,{s#-2+1} +img_count={$!} +eval[0] :"begin( +const shape_size=$shape_size; +const tile_boundary=$tile_boundary; +const num_chan=s#1; +const tchan=num_chan+1; +const tile_size=sqr(shape_size)*num_chan; +$img_count==4?( +generate_color()=I(#-3,i,0,0,0,2); +):( +generate_color()=[i]; +); +tile_boundary==3?( +alpha_0=crop(#-2,0,0,0,0,shape_size,shape_size,1,1)*255; +alpha_1=crop(#-2,0,0,1,0,shape_size,shape_size,1,1)*255; +alpha_2=crop(#-2,0,0,2,0,shape_size,shape_size,1,1)*255; +alpha_3=crop(#-2,0,0,3,0,shape_size,shape_size,1,1)*255; +const mx=w-1; +const my=h-1; +const startnum=$startnum_a; +find_pos()=1+sum((mx-x)%2,2*((my-y+startnum)%2)); +generate_tile()=( +alpha=arg(find_pos(),alpha_0,alpha_1,alpha_2,alpha_3); +color=generate_color(); +color_tile=resize(color,tile_size,1); +tile=[color_tile,alpha]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +); +): +tile_boundary?( +alpha_0=crop(#-2,0,0,0,0,shape_size,shape_size,1,1)*255; +alpha_1=crop(#-2,0,0,1,0,shape_size,shape_size,1,1)*255; +const max_index=(tile_boundary%2)?w-1:h-1; +tile_boundary%2?( +find_pos()=(max_index-x)%2; +):( +const startnum=$startnum_a; +find_pos()=(max_index-y+startnum)%2; +); +generate_tile()=( +alpha=find_pos()?alpha_1:alpha_0; +color=generate_color(); +color_tile=resize(color,tile_size,1); +tile=[color_tile,alpha]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +); +):( +alpha=crop(#-2,0,0,0,0,shape_size,shape_size,1,1)*255; +generate_tile()=( +color=generate_color(); +color_tile=resize(color,tile_size,1); +tile=[color_tile,alpha]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +); +); +); +if(i>=0,generate_tile(););" +fi +k. +else +if $!==2 +{w#-2},{h#-2},1,{s#-1+1},"v=i(#-2,x,y,z,0); +v>=0?[I(#-1,v,0,0,2,1),255]:vector(#s,0);" +rm[-3,-2] +elif $!>2 error only_one_pal +fi +if ($shape_size>1)||($num_of_images>1) +r. {w#-1*$shape_size},{h#-1*$shape_size},$num_of_images,100%,1 +fi +fi +if $num_of_images>1 s. z fi +if $use_different_dimensions +repeat $num_of_images { +new_width_height:=($dim_list)[$>*2,2] +r[$>] $new_width_height,1,100%,0,0,1,1 +} +fi +fi +rep_index_based_mul_concat_conset: +skip ${2=10} ++channels 0 +1,{h},1,1,:"begin( +const length=w#-1; +const hh=h#-1-1; +const startnum=int(abs($1)); +const start_x=length-1; +const start_pos=start_x-1; +const base=int(abs($2)); +logb(n)=log(n)/log(base); +concat_consec_digits_count(n)=n>=base?(t=floor(logb(n));n+(n+1)*t+(base*(1-base^t))/(base-1)):n; +); +N=hh-y+startnum; +num_of_digits=concat_consec_digits_count(N); +tx=max(0,length-num_of_digits); +for(p=start_pos,p>=tx,--p, +multiplier=i(#-2,p,y,0,1); +off=0; +carry_over=0; +secondary_carry_over=0; +multiplier?( +for(q=start_x,q>=tx,--q, +partial_result=multiplier*i(#-2,q,y,0,0)+carry_over; +remainder=partial_result%base; +carry_over=int(partial_result/base); +new_num=max(0,i(#-1,p-off,y,0,0))+remainder+secondary_carry_over; +secondary_remainder=new_num%base; +secondary_carry_over=int(new_num/base); +i(#-1,p-off,y,0,0)=secondary_remainder; +++off; +if((p-off)<0,continue();); +); +):(continue();); +if(secondary_carry_over&&(q!=0), +new_num=max(0,i(#-1,p-off,y,0,0))+secondary_remainder+secondary_carry_over; +secondary_carry_over=int(new_num/base); +secondary_remainder=new_num%base; +i(#-1,p-off,y,0,0)=secondary_remainder; +); +if(p==tx&&(partial_result>base)&&(tx!=0),i(#-1,p-off,y,0,0)=int(partial_result/base);); +);" +rm[-3,-1] +rep_index_based_sub_concat_conset: +skip ${2=10} +{w},{h},1,1,-1 +1,{h},1,1,:"begin( +const length=w#-1; +const hh=h#-1-1; +const startnum=int(abs($1)); +const start_x=length-1; +const base=int(abs($2)); +logb(n)=log(n)/log(base); +concat_consec_digits_count(n)=n>=base?(t=floor(logb(n));n+(n+1)*t+(base*(1-base^t))/(base-1)):n; +zero_fill=vector(#length,0); +); +N=hh-y+startnum; +num_of_digits=concat_consec_digits_count(N); +tx=max(0,length-num_of_digits); +minuend=-1; +if(num_of_digits>1, +ux=tx; +repeat(length, +vd=I(#-2,ux,y); +if(vd[1]>vd[0],minuend=1;break();); +if(vd[0]>vd[1],minuend=0;break();); +++ux; +); +if(minuend!=-1, +subtrahend=1-minuend; +ix=start_x; +repeat(num_of_digits, +vd=I(#-2,ix,y); +if(ix==tx,if(vd[minuend]==vd[subtrahend],break(););); +if(vd[minuend]=base?(t=floor(logb(n));n+(n+1)*t+(base*(1-base^t))/(base-1)):n; +); +ix=start_x; +carry_over=0; +loop_break=0; +N=hh-y+startnum; +num_of_digits=concat_consec_digits_count(N); +tx=max(0,length-num_of_digits); +repeat(min(length,num_of_digits+ds_size), +init_num_vec=I(#-2,ix,y); +if(ix=w#0 +startnum,string_a={max($maxnum_a,1)},"" +break +fi +} +repeat inf { +string_a..=$maxnum_b +({size('$maxnum_b')}) +if $> a[-2,-1] x fi +maxnum_b-=1 +if $maxnum_b<$startnum break fi +} +ts,digits={is#-1},0 +repeat inf { +string_b..={$>+1} +digits+={size('{$>+1}')} +if $digits>=$ts||$digits>w#0 break fi +} +('$string_a') ('$string_b') -[-2,-1] 48 +repeat h#0 { +ns={w#-2-i(#-3,$>)} +if w#-2>w#-1 +j[0] [-2],1~,$>,0,0 +j[0] [-1],1~,$>,0,1 +else +r. {w#-2},100%,100%,100%,0,0,1 +j[0] [-2],1~,$>,0,0 +j[0] [-1],1~,$>,0,1 +fi +if $ns r.. $ns,100%,100%,100%,-1 +else break +fi +} +rm[-3--1] +rep_concat_conset_fill_alt_base: +check $!==1 +startnum={max(abs($1),1)} +maxnum_a,maxnum_b=$startnum,{$startnum+(h-1)} +repeat inf { ++rep_num2altbase $maxnum_a,$2 +if $> a[-2,-1] x fi +maxnum_a-=1 +if $maxnum_a<=1||w#-1>=w#0 +startnum={max($maxnum_a,1)} +rm. +break +fi +} +repeat inf { ++rep_num2altbase $maxnum_b,$2 +nv={w#-1} +if $> rv[-3,-1] a[-3,-1] x fi +($nv) +if $> a[-2,-1] x fi +maxnum_b-=1 +if $maxnum_b<$startnum break fi +} +ts={is#-1} +repeat inf { ++rep_num2altbase {$>+1},$2 +if $> rv[-2,-1] a[-2,-1] x fi +if w#-1>=$ts||w#-1>w#0 break fi +} +repeat h#0 { +ns={w#-3-i(#-2,$>)} +if w#-3>w#-1 +j[0] [-3],1~,$>,0,0 +j[0] [-1],1~,$>,0,1 +else +r. {w#-3},100%,100%,100%,0,0,1 +j[0] [-3],1~,$>,0,0 +j[0] [-1],1~,$>,0,1 +fi +if $ns r... $ns,100%,100%,100%,-1 +else break +fi +} +rm[-3--1] +#@cli rep_num2altbase: abs_num,base +#@cli : Insert number in bases other than 10. Each numbers are represented as digits by themselves. ++rep_num2altbase: +number,base={int(abs([$1,$2]))} +{1+int(log($number)/log($base))},1,1,1,<" +begin( +const base=$base; +n=$number; +); +remainder=n%base; +n=int(n/base); +remainder; +" +#@cli rep_int2roman: 1<=num<=3999 +#@cli : Return integer number as Roman Numberal +rep_int2roman: +check "($1>=1&&$1<=3999)&&($1==int($1))" +thousands:=int($1/1000) +hundreds:=int($1%1000/100) +tens:=int($1%100/10) +ones:=int($1%10) +u ${arg\ $thousands+1,,M,MM,MMM}${arg\ $hundreds+1,,C,CC,CCC,CD,D,DC,DCC,DCCC,CM}${arg\ $tens+1,,X,XX,XXX,XL,L,LX,LXX,LXXX,XC}${arg\ $ones+1,,I,II,III,IV,V,VI,VII,VIII,IX} +#@cli rep_roman2int: roman_numeral_string,is_strict={ 0=false | 1= true } +#@cli : Return Roman Numeral as integer number. +rep_roman2int: +skip ${2=1} +struppercase $1 +roman_num=${} +eval " +started=char_changed=old_char=old_pos=ans=num=0; +const is_strict=$2?1; +roman_chars=['IVXLCDM']; +const chars_count=size(roman_chars); +num_vals=expr('(x&1?5:1)*10^(x>>1)',chars_count); +char_freq_list=vector(#chars_count,0); +roman_num='"${}"'; +const roman_num_length=size(roman_num); +const dec_roman_num_length=roman_num_length-1; +last_char=roman_num[dec_roman_num_length]; +repeat(roman_num_length,p, +char=roman_num[dec_roman_num_length-p]; +if(started&&!char_changed,char_changed=char!=old_char;); +old_char=char; +pos=find(roman_chars,char,0,1); +if(is_strict, +if(pos-old_pos<-2, +run('error inv_char_gap'); +); +); +old_pos=pos; +if(pos==-1,run('error inv_char')); +encounters=++char_freq_list[pos]; +if(encounters>(3+char_changed), +run('error excess_char'); +); +num=num_vals[pos]; +if(num<<23999,run('error exc_val');); +if(is_strict, +thousands=int(ans/1000); +hundreds=int(ans%1000/100); +tens=int(ans%100/10); +ones=ans%10; +place=0; +test_vector=vector(#roman_num_length,0); +if(thousands, +copy(test_vector[0],'MMM',thousands); +place+=thousands; +); +if(hundreds, +hundreds==9||hundreds==4?( +copy(test_vector[place],(hundreds>5?'CM':'CD'),2); +place+=2; +): +hundreds>4?( +num_of_char=hundreds-4; +copy(test_vector[place],'DCCC',num_of_char); +place+=num_of_char; +):( +num_of_char=hundreds; +copy(test_vector[place],'CCC',num_of_char); +place+=num_of_char; +); +); +if(tens, +tens==9||tens==4?( +copy(test_vector[place],(tens>5?'XC':'XL'),2); +place+=2; +): +tens>4?( +num_of_char=tens-4; +copy(test_vector[place],'LXXX',num_of_char); +place+=num_of_char; +):( +num_of_char=tens; +copy(test_vector[place],'XXX',num_of_char); +place+=num_of_char; +); +); +if(ones, +ones==9||ones==4?( +copy(test_vector[place],(ones>5?'IX':'IV'),2); +place+=2; +): +ones>4?( +num_of_char=ones-4; +copy(test_vector[place],'VIII',num_of_char); +place+=num_of_char; +):( +num_of_char=ones; +copy(test_vector[place],'III',num_of_char); +place+=num_of_char; +); +); +if(roman_num!=test_vector,run('error inv_char_set');); +); +ans;" +#@cli rep_output_jasc: filename +#@cli : Output selected image JASC-PAL files(s).(.pal) +rep_output_jasc: +e[^-1] "Output palettes$? as JASC-PAL palette files(s).(.pal)" +header=JASC-PAL\n0100\n +repeat $! { +if $!>1 filename=${"filename \"$1\",$>"} +else filename="$1" fi +0 => $filename folder,basename,num_of_cols={f},{b},{whd#0} +rm. +output=$num_of_cols\n +to_rgb[0] +permute[0] cxyz +unroll[0] x +repeat $num_of_cols { +r={i(#0,$>*3,0,0)} +g={i(#0,$>*3+1,0,0)} +b={i(#0,$>*3+2,0,0)} +output.=$r" "$g" "$b\n +} +('$header$output') +ot. $folder$basename.pal +rm[0,-1] +} +#@cli rep_output_pdn_pal: filename +#@cli : Output selected images as Paint.NET palette file(s).(.txt) +rep_output_pdn_pal: +e[^-1] "Attempting to output palettes$? as Paint.NET palette file(s).(.txt)" +header="; paint.net Palette File: " +repeat $! { +if $!>1 filename=${"filename \"$1\",$>"} else filename="$1" fi +0 => $filename folder,basename,num_of_cols,palname={f},{b},{whd#0},{0,n} rm. +if $num_of_cols>96 continue e[^-1] "Palette Limit Exceeded!Skipping!" fi +start_header=$header$palname +start_header.=\n"; Color Format - AARRGGBB"\n"; Colors: "$num_of_cols +pal_info="\n" +mp={$num_of_cols-1} +to_rgba[0] +permute[0] cxyz +unroll[0] x +visited=0 +repeat 96 { +p=$> +if $p<$num_of_cols +rgba={crop(#0,$>*4,0,0,0,4,1,1,1)} +rgb={([$rgba])[0,3]} +alp={([$rgba])[3]} +rgba=$alp,$rgb +hex_rgba=${rep_int82hex\ $rgba} +struppercase $hex_rgba +pal_info.=${} +else +if !$visited pal_info.="; End of Palette List"\n visited=1 fi +pal_info.=00808080 +fi +if $p<95 pal_info.="\n" fi +} +('$start_header$pal_info') +e[^-1] "Output palette"[$>]" as Paint.NET palette file(s).(.txt)" +header="; paint.net Palette File: " +ot. $folder$basename.txt +rm[0,-1] +} +rm +#@cli rep_output_gpl: filename +#@cli : Output selected images as GIMP palette file(s).(.gpl) +rep_output_gpl: +e[^-1] "Output palettes$? as GIMP palette file(s).(.gpl)" +init_header="GIMP Palette\n\#Palette Name: " +init_colors_info="\n#Colors: " +repeat $! { +if $!>1 filename=${"filename \"$1\",$>"} else filename="$1" fi +0 => $filename folder,basename,num_of_cols,palname,ss={f},{b},{whd#0},{0,n},{s#0} rm. +header_info=$init_header$palname +colors_info=$init_colors_info$num_of_cols +start_header=$header_info$colors_info +pal_info="\n" +mp={$num_of_cols-1} +permute[0] cxyz unroll[0] x +if $ss==3||$ss==4 +repeat $num_of_cols { +p=$> +rgb={(crop(#0,$>*$ss,0,0,0,$ss,1,1,1))[0,3]} +hex_rgb=${rep_int82hex\ $rgb} +r={([$rgb])[0]} +g={([$rgb])[1]} +b={([$rgb])[2]} +pal_info.=$r" "$g" "$b" "$hex_rgb +if $p<$mp pal_info.="\n" fi +} +elif s#0<3 +repeat $num_of_col { +p=$> +gray={(crop(#0,$>*$ss,0,0,0,$ss,1,1,1))[0]} +hex_rgb=${rep_int82hex\ vector3($gray)} +r,g,b=$gray +pal_info.=$r" "$g" "$b" "$hex_rgb +if $p<$mp pal_info.="\n" fi +} +else +e[^-1] "Invalid channels, skipping!" +rm[0] continue +fi +('$start_header$pal_info') +ot. $folder$basename.gpl +rm[0,-1] +} +#@cli +rep_split_gradient : number_of_colors,splits,colors_per_split,_axis,_seed,_reverse_internal,_reverse_all,min_value_a...,maxvalue_a... +#@cli : Create split gradients +#@cli : Author : Reptorian. +#@cli : Default values: '_axis=x','_seed=n/a','_reverse_internal=0','_reverse_all=0' ++rep_split_gradient: +skip ${4=0},${5=},${6=0},${7=0} +$=p +if isnum($4) axis={$4%3} +else axis={_'$4'-_'x'} +fi +dir_axis=${arg\ $axis+1,x,y,z} +len_axis=${arg\ $axis+1,w,h,d} +ncol,u_string={narg(${8--1})/2},"" +if $ncol>1 u_string.=[ fi +repeat $ncol { +k=$> +u_string.=u(${p{8+$k}}, +u_string.=${p{8+$k+1}}) +if $k<($ncol-1) u_string.=, fi +} +if $ncol>1 u_string.=] fi +{arg($axis+1,[$1,1,1],[1,$1,1],[1,1,$1])},1 +s. $dir_axis,$2 +f[-$2--1] "begin(const scale=("$len_axis"#"-$2"-1)/($3-1););"$dir_axis"/scale" +$3,1,1,$ncol +repeat $2 { +q=$> +f. begin(if(narg($5),srand($5+$q);););[$u_string] +if $6 mirror. $dir_axis fi +rep_cubic_map[-{2+$q}] [-1],2 +} +rm. +a[-$2--1] $dir_axis +if $7 mirror. $dir_axis fi +#@cli rep_hitomezashi : "str_a","str_b",_upscale_pixel>=1,[colors_a palette],[colors_b stray_palette],_shift_color,_boundary={ 0=Periodic | 1=Continuous },0<=_symmetry_mode<=3,_stray_color_seed,stray_col_a,...stray_col_n,border_size,border_col_a,...,border_col_n,frames : "str_a","str_b",upscale_pixel>=1,colors_a={ hex | value~ },colors_b={ hex | value~ },0<=_symmetry_mode<=3,border_size,border_col_a,...border_col_n +#@cli : Create Hitomezashi Stitch Pattern. +#@cli : +#@cli : Note: The number of stray_color and number of border color depends on the number of channels to be used. For example, in the case of palette, it depends on number of channels per palette. In case of hex, then it depends on number of characters divided by two. Finally, if you insert wave at the end, there is only one. +#@cli : +#@cli : Author : Reptorian. +#@cli : Default value : '_upscale_pixel=1','colors_a=n/a','colors_b=n/a','_shift_color=0','_boundary=0','_stray_color_seed=n/a','_symmetry_mode=n/a' ++rep_hitomezashi: +skip ${3=1},"${4=}","${5=}","${6=}","${7=}","${8=}","${9=}" +$=argpos +pixel_size,colors_a,colors_b,use_remove_image={max(int($3)*100,100)}%,${4-5},1 +use_rescale={$pixel_size!=1} +command "generate_border : +if narg($""*)>1 out_color=[$""*] +else out_color=$""1 +fi +eval.. :\"begin( +const pixel_size="$pixel_size"; +const border_size=$_border_size; +const ip=floor(border_size/2); +const iq=ceil(border_size/2); +color=\"$out_color\"; +const iex=w#-1-1; +const iey=h#-1-1; +const bpe=max(0,(border_size-1)); +const xbpe=w#-1-1-bpe; +const ybpe=h#-1-1-bpe; +); +ix=x*pixel_size-ip; +iy=y*pixel_size-ip; +sx=(x+1)*pixel_size-ip; +sy=(y+1)*pixel_size-ip; +ex=(x+1)*pixel_size+max(iq-1,0); +ey=(y+1)*pixel_size+max(iq-1,0); +if(i!=j(1,0,0,0,0,1), +polygon(#-1,4, +sx,iy, +ex,iy, +ex,ey, +sx,ey, +1,color); +); +if(i!=j(0,1,0,0,0,1), +polygon(#-1,4, +ix,sy, +ex,sy, +ex,ey, +ix,ey, +1,color); +); +\"" +command "generate_border_depth : +if narg($""*)>1 out_color=[$""*] +else out_color=$""1 +fi +eval.. :\"begin( +const pixel_size="$pixel_size"; +const border_size=$_border_size; +const l_length=(pixel_size+border_size); +const depth=d#-1; +const length=l_length*border_size*depth*s#-1; +const edge_x_length=w#-1*border_size*depth*s#-1; +const edge_y_length=h#-1*border_size*depth*s#-1; +const ip=floor(border_size/2); +const iq=ceil(border_size/2); +color=\"$out_color\"; +const iex=w#-1-1; +const iey=h#-1-1; +const bpe=max(0,(border_size-1)); +const xbpe=w#-1-1-bpe; +const ybpe=h#-1-1-bpe; +vcol=resize(color,length,1,0); +edge_x=resize(color,edge_x_length,1,0); +edge_y=resize(color,edge_y_length,1,0); +); +ix=x*pixel_size-ip; +iy=y*pixel_size-ip; +sx=(x+1)*pixel_size-ip; +sy=(y+1)*pixel_size-ip; +if(i!=j(1,0,0,0,0,1),draw(#-1,vcol,sx,iy,0,0,border_size,l_length,depth,s#-1,1)); +if(i!=j(0,1,0,0,0,1),draw(#-1,vcol,ix,sy,0,0,l_length,border_size,depth,s#-1,1)); +\"" ++rep_binary_hitomezashi "$1","$2" +if ${is_image_arg\ $colors_a}||${is_image_arg\ $colors_b} +shift_colors,boundary,sym_mode,seed=${6-9} +np=0 +if narg($colors_a) pass$colors_a 1 np+=1 fi +if narg($colors_b) pass$colors_b 1 np+=1 fi +if narg(${argpos{10+s#-1}}) _border_size={($pixel_size)>1?min(max(0,($pixel_size)-1),abs(${argpos{10+s#-1}})):0} +else _border_size=0 +fi +if narg(${argpos{11+s#-1*2}}) depth=${argpos{11+s#-1*2}} +else depth=1 +fi +stray_color="" +border_color="" +sid={s#-1-1} +repeat s#-1 { +n=$> +stray_color.=${argpos{10+$>}} +border_color.=${argpos{11+s#-1+$>}} +if $n<$sid +stray_color.=, +border_color.=, +fi +} +if $np==2 ++_rep_colorize_binary_hitomezashi... [-2],[-1],$shift_colors,$boundary,$seed,$depth +rm[-3,-2] +if narg($sym_mode) rep_symmetrize_xy[-2,-1] $sym_mode fi +r. {w#-1*$pixel_size},{h#-1*$pixel_size},{d#-1},{s#-1},1 +if $_border_size +if $depth>1 generate_border_depth $border_color +else generate_border $border_color +fi +fi +else ++_rep_colorize_binary_hitomezashi.. [-1],,$shift_colors,$boundary,$seed,$stray_color,$depth +rm.. +if narg($sym_mode) rep_symmetrize_xy[-2,-1] $sym_mode fi +r. {w#-1*$pixel_size},{h#-1*$pixel_size},{d#-1},{s#-1},1 +if $_border_size +if $depth>1 generate_border_depth $border_color +else generate_border $border_color +fi +fi +fi +elif narg($colors_a)||narg($colors_b) +sym_mode,_border_size=$6,{($pixel_size)>1?min(max(0,($pixel_size)-1),(narg($7)?abs($7))):0} +if narg($sym_mode) rep_symmetrize_xy. $sym_mode fi +wave_check_a={narg($colors_a)?${rep_contains_wave_at_end\ $colors_a}:0} +wave_check_b={narg($colors_b)?${rep_contains_wave_at_end\ $colors_b}:0} +wave_mode={$wave_check_a+$wave_check_b} +if $wave_mode==2 +('$colors_a') r. {w#-1-1} a={t} +('$colors_b') r. {w#-1-1} b={t} +rm[-2,-1] ++f. i?$b:$a +if $use_rescale resize2dx. $pixel_size,1 fi +if $_border_size +v=$8 +generate_border $v +fi +elif $wave_mode==1 +if $wave_check_a ('$colors_a') r. {w#-1-1} a={t} fi +if $wave_check_b ('$colors_b') r. {w#-1-1} a={t} fi +rm. +if $use_rescale {w*$pixel_size},{h*$pixel_size},1,1,$a fi +if $_border_size +v=$8 +generate_border $v +fi +else +na={narg($colors_a)+narg($colors_b)} +if $na==2 +rgb_a=${rep_hex2int8\ $colors_a} +rgb_b=${rep_hex2int8\ $colors_b} +check narg($rgb_a)==narg($rgb_b) +{w},{h},1,{narg($rgb_a)},i#-1?[$rgb_b]:[$rgb_a] +if $use_rescale resize2dx. $pixel_size,1 fi +if $_border_size +vc=${8--1} +generate_border $vc +fi +else +if narg($colors_a) rgb=${rep_hex2int8\ $colors_a} fi +if narg($colors_b) rgb=${rep_hex2int8\ $colors_b} fi +{w*$pixel_size},{h*$pixel_size},1,{narg($rgb)},[$rgb] +if !$_border_size error no_border fi +if $_border_size +vc=${8--1} +generate_border $vc +fi +fi +fi +else +sym_mode=$6 +use_remove_image=0 +if narg($sym_mode) rep_symmetrize_xy. $sym_mode fi +if $use_rescale resize2dx. $pixel_size,1 fi +fi +if $use_remove_image rm.. fi +uncommand generate_border,generate_border_depth ++_rep_colorize_binary_hitomezashi: +skip "${1=}","${2=}","${3=0}","${4=0}","${5=}","${6=}" +if $!>1 error inv_img_cnt fi +ml={norm(w,h)} ++label. +{iM#-1+1},1,1,3,[x,0,0] sh. 1,2 +{w#-2},1,1,1,$ml +eval[-4] >" +i(#-2,i,0,0,0)=i(#-1,i,0,0)=min(norm(x,y),i(#-1,i,0,0)); +++i(#-2,i,0,0,1);" +rm[-2,-1] +sh. 1 pixelsort.. +,x,[-1] rm. +=> ref_ind +sh. 1,2 +ni=0 +if ${is_image_arg\ $1} +pass$1 1 +ni+=1 +else no_pal_available fi +if ${is_image_arg\ $2} +pass$2 1 +ni+=1 +fi +if $ni==2 +if s#-2!=s#-1 error inv_chnl_cnt fi +frame_count={narg($6)?$6:1} +eval " +if(narg($5),srand($5);); +const length=w#-3; +const nc=w#-1; +pos=0; +t=-1; +tv=inf; +ind=-1; +while(pos0),$tf_max_id-z,z} +{w#1},{h#1},$tf,{s#-1},I(#-1,i(#1,x,y,0,0),0,$direction) +rm[1--2] +fi +#@cli rep_binary_hitomezashi : string_a,string_b,[_rules] +#@cli : Create a hitomezashi image. Strings inserted as argument are treated as unicode converted to binary based on rules. Rules has been pre-defined already. +#@cli : +#@cli : Note : Original Source Code is at found at the spreadsheet link within this link - https://aperiodical.com/2020/12/mobile-numbers-hitomezashi-stitching/ +#@cli : +#@cli : Author: Reptorian. ++rep_binary_hitomezashi: +skip "${3=}" +(1,0,0,0,0,0,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,0,0,1,0,0,1,0,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1) +('"$1"') +('"$2"') +map[-2,-1] [-3] +{w#-1},1,1,1,>begin(v=0;);v=x?(j(#-1,-1)+v)%2:0; rm.. # Process first column. Creates auxilatory surface and then remove reference surface. +{w#-2},{w#-1},1,1 # Create a 2D surface to write on +eval.. " +v=i(#-1,0,x)=i; +row=x+1; +repeat(w#-3-1,p, +v=i(#-1,p+1,x)=sum(v,i(#-3,p,0),row,1)%2; +);" +rm[-4--2] +#@cli rep_contains_wave_at_end : "str" +#@cli : Return whether it contains a wave at end. +#@cli : Author: Reptorian. +rep_contains_wave_at_end: skip "${1=}" if narg($1) u {a=['$1'];(a)[size(a)-1]==_'~'} else u 0 fi +#@cli rep_random_binary: num_of_chars +#@cli : Return randomly generated binary number based on number of characters. +#@cli : +#@cli : Author : Reptorian. +rep_random_binary: {max(2,abs($1))},1,1,1,int(u(0,2,1,0))+_'0' u {t} rm. +#@cli rep_sym_xy: eq. to 'rep_symmetrize_xy'. +rep_sym_xy: rep_symmetrize_xy $1 +#@cli rep_symmetrize_xy: 0<=mode<=3 +#@cli : Create copies and then append images to generate symmetry alongside xy-axis. +#@cli : +#@cli : Author: Reptorian. +rep_symmetrize_xy: +mode={int($1)%4} +resize_end={([0,0,1,1,0,1,1,0])[$mode*2,2]} +if $mode==3 +crop_a_0,crop_a_1,crop_a_2,crop_a_3=1,0,1,2 +image_a=,1~,1~ +image_b=,0~,1~ +crop_b=1,h#0-1,w#0-1,h#0-1 +crop_c=0,0,0,h#0-2 +elif $mode==2 +crop_a_0,crop_a_1,crop_a_2,crop_a_3=0,1,2,1 +image_b=,1~ +image_c=,1~,1~ +crop_b=0,0,w#0-2,0 +crop_c=w#0-1,1,w#0-1,h#0-1 +elif $mode==1 +crop_a_0,crop_a_1,crop_a_2,crop_a_3=1,1,1,1 +image_a=,0~,1~ +image_c=,1~ +crop_b=1,0,w#0-1,0 +crop_c=0,1,0,h#0-1 +else +crop_a_0,crop_a_1,crop_a_2,crop_a_3=0,0,2,2 +image_a=,1~ +image_b=,1~,1~ +image_c=,0~,1~ +crop_b=0,h#0-1,w#0-2,h#0-1 +crop_c=w#0-1,0,w#0-1,h#0-2 +fi +if $mode<2 +mirror_a,mirror_b,mirror_c=x,y,x +else +mirror_a,mirror_b,mirror_c=y,x,y +fi +if $mode&1 +image_d=0 +else +image_d=1~ +fi +if !($mode%3) +image_e=,1~ +fi +foreach { ++crop[0] $crop_a_0,$crop_a_1,{w-$crop_a_2},{h-$crop_a_3} ++resize[0] {w#0+w#-1},{h#0+h#-1},100%,100%,0,0,$resize_end +mirror[-2] $mirror_a +image[-1] [-2]$image_a +mirror[-2] $mirror_b +image[-1] [-2]$image_b +mirror[-2] $mirror_c +image[-1] [-2]$image_c +rm[-2] ++crop[0] {[$crop_b]} +mirror[-1] x +image[-2] [-1],$image_d,.5~ +rm[-1] +crop[0] {[$crop_c]} +mirror[-2] y +image[-1] [-2],.5~$image_e +rm[-2] +} +#@cli rep_cellular_automata : int_rule,_min_arr_size +#@cli : Default values: '_min_arr_size=n/a' +rep_cellular_automata: +skip ${2=} +channels 0 +rule_decimal,min_arr_size=${1-2} +dec2bin $1 ('${}') -. 48 +=> rules +if narg($min_arr_size) +if w<$min_arr_size +r. $2,1,1,1,0,0,1 +fi +fi +repeat $!-1 { +local[$>,-1] { +ow,oh={w#0},{h#0} +unroll[0] x +iter={ceil(w#0/w#-1)} +$ow,1,1,1,int(u(0,2,1,0)) +repeat $iter { +p=$> +pos={$p*w} +if !iv#-1 f. int(u(0,2,1,0)) fi +{w},1,1,1,"begin( +state(n)=i(#-1,n,0,0,0); +); +k=4*state((x-1+w)%w)+2*state(x)+state((x+1)%w); +i(#-2,k,0,0,0);" +j[0] [-1],$pos,0 +rm.. +} +r[0] $ow,$oh,1,1,-1 +rm. +} +} +rm. +#@cli rep_er : eq. to 'rep_emboss_relief' +rep_er : rep_emboss_relief $* +#@cli rep_emboss_relief : int_radius>=4,-360>=_ang>=360,_sigma>0,_scale>0,_output={ 0=emboss | 1=relief },_color_out={ 0=gray | 1=color },_bias>0,_use_cmyka={ 0=non_cmyka_mode | 1=cmyka_mode } +#@cli : Generates effect of embossing onto image via convolution. +#@cli : Default values: '_ang=45','_sigma=.5','_scale=2','_output=1','_bias=128','_color_out=1','_use_cmyka=0' +rep_emboss_relief: +skip ${2=45},${3=.5},${4=2},${5=1},${6=1},${7=128},${8=0} +radius,angle,sigma,scale,relief_mode,gray_mode,bias,max_alp_ind=${1-5},{!$6},$7,{$8?4:3} +convolution_main_setting=$radius,$angle,$sigma,$scale,$gray_mode +if $gray_mode +command "process_emboss_alpha_case : split_opacity process_emboss_filter.. a c" +command "end_relief : +.. . rm." +else +command "process_emboss_alpha_case : sh 0,{s-2} process_emboss_filter. rm." +command "end_relief : add" +fi +if $relief_mode +command "process_emboss_filter : +_rep_steerable_gaussian_convolve "$convolution_main_setting" end_relief" +else +command "process_emboss_filter : +_rep_steerable_gaussian_convolve "$convolution_main_setting" +. "$bias" k." +fi +foreach { +if s==2||s>$max_alp_ind process_emboss_alpha_case +else process_emboss_filter +fi +} +uncommand process_emboss_alpha_case,process_emboss_filter,end_relief ++_rep_steerable_gaussian_convolve: +sg,theta,sigma,M={max(5,int(abs($1)))},{deg2rad($2)},$3,{3*$3} +$sg,1,1,2,"begin( +const center_index=(w-1)/2; +const sigma_exp=2*$sigma^2; +const sqrsig=$sigma*sqrt(2*pi); +); +nx=(x-center_index)/center_index*$M; +g=exp(-(nx^2)/sigma_exp)/sqrsig; +gp=(nx/$sigma^2)*g; +[g,gp];" +sh. 0 ts={is#-1/$4} rm. /. $ts ++rotate. 90 +s[-2,-1] c ++convolve[0] [-4] +convolve. [-2] ++convolve[0] [-3] +convolve. [-5] +*. {cos($theta)} +*.. {sin($theta)} +add.. . +k[0,-2] +if $5 ss={s} compose_channels. + /. $ss fi +#@cli rep_hsl2ryb2rgb +#@cli : Convert color representation of selected image from HSL to RYB to RGB +rep_hsl2ryb2rgb: +e[^-1] "Convert color representation of image$? from HSL to RYB to RGB." +f "H=(i0/60)%6;C=(1-abs(2*i2-1))*i1;X=C*(1-abs(H%2-1)); +m=i2-C/2; +RYB=arg(1+int(H),[C,X,0],[X,C,0],[0,C,X],[0,X,C],[X,0,C],[C,0,X]); +RYB+=m*=255; +red=RYB[0]; +yellow=RYB[1]; +blue=RYB[2]; +white=min(RYB); +red-=white; +yellow-=white; +blue-=white; +maxyellow=max(red,yellow,blue); +green=min(yellow,blue); +yellow-=green; +blue-=green; +blue>0&&green>0?( +blue*=2; +green*=2 +); +red+=yellow; +green+=yellow; +maxgreen = max(red,green,blue); +maxgreen>0?( +N=maxyellow/maxgreen; +red*=N; +green*=N; +blue*=N; +); +red+=white; +green+=white; +blue+=white; +[red,green,blue];" +#@cli +rep_color_harmony_palette: -360<=ang<=360,0<=_saturation<=1,-100[%]<=shade_tint<=100[%],0<=choice<=10,ryb_mode={ 0=rgb | 1=ryb | 2=hsl+rgb | 3=hsl+ryb } +#@cli : Create a harmony palette. In other word, create a palette based on the color wheel. ++rep_color_harmony_palette: +ang,saturation,shade_tint,choice,ryb_mode=${1-5} +{arg(1+$choice%11,6,6,6,2,3,3,4,3,4,5,6)},1,1,3,">begin( +fmod(a)=a-360*floor(a/360); +const start_ang=fmod($ang); +const saturation=cut($saturation,0,1); +const shade_tint=cut((1+$shade_tint)/2,0,1); +const choice=$choice%11; +ang=start_ang; +choice<3?( +const add_ang=arg(choice+1,8,15,30); +new_ang()=x?(ang+=add_ang;ang=fmod(ang);); +): +choice==3?( +new_ang()=x?ang=fmod(ang+180); +): +choice==4?( +new_ang()=x==2?(ang+=60;ang=fmod(ang);):x==1?(ang+=150;ang=fmod(ang);); +): +choice==5?( +new_ang()=x?ang=fmod(ang+120); +): +choice==6?( +new_ang()=x?ang=fmod(ang+90); +): +choice==7?( +new_ang()=x?(ang=fmod(start_ang+(x%2?90:-90))); +): +choice==8?( +new_ang()=x?(ang=fmod(ang+arg(x%2+1,120,60));); +): +choice==9?( +new_ang()=x?(x==1?(ang=fmod(ang+120);):(ang=fmod(ang+arg(x%2+1,30,60)));); +):( +new_ang()=x?(ang=fmod(ang+(x%2?30:90));); +); +); +new_ang(); +[ang,saturation,shade_tint];" +if $ryb_mode>1 +if $ryb_mode%2 +rep_hsl2ryb2rgb. else +hsl2rgb. fi +else +if $ryb_mode rep_hsl2ryb2rgb. else hsl2rgb. fi +fi +round. +#@cli rep_cubic_map: [image],_mode={ 0=neumann | 1=periodic | 2=periodic_smooth | 3=continuous } +#@cli : Map palette into image with cubic interpolation. +#@cli : Argument for mode can also use string. The valid strings are next to equal sign. +#@cli : Source for base of code - https://www.paulinternet.nl/?page=bicubic +#@cli : Author: Reptorian. +#@cli : Default values: '_mode=2' +rep_cubic_map: +skip ${2=2} +init_imgs={$!} +pass$1 1 +if $!>$init_imgs+1 error inv_img_arg fi +length,threading_threshold={[whd,sqr(256)]} +if isint($2) mode={int($2)%4} +else +neumann,periodic,periodic_smooth,continuous=0,1,2,3 +mode=$$2 if !narg($mode) error invalid_arg fi +fi +repeat $!-1 { +if !s#$> continue fi +reference_spectrum_size={s#$>} +if whd#$>>$threading_threshold ps_mode=: +else ps_mode=> +fi +{w#$>},{h#$>},{d#$>},{s*$reference_spectrum_size},$ps_mode" +begin( +const reference_spectrum_size=$reference_spectrum_size; +const img_pos=$>; +const length=$length; +const mi=length-1; +const smi=mi-1; +const mode=$mode; +cubic_interpolation(p0,p1,p2,p3,v)=( +(-.5*p0+1.5*p1-1.5*p2+.5*p3)*v^3 ++(p0-2.5*p1+2*p2-.5*p3)*v^2 ++(-.5*p0+.5*p2)*v ++p1 +); +cubic_map()=cubic_interpolation( +I[#-1,p_s], +I[#-1,p_0], +I[#-1,p_1], +I[#-1,p_e], +interp +); +mode?( +calc()=cubic_map(); +):( +calc()=( +inrange(pref,0,smi,1,1)?( +cubic_map(); +):( +pref>0?I[#-1,mi]:I[#-1,0]; +); +); +); +mode==3?( +const double_length=mi*2; +calc_ps()=( +a=[pref-1,pref,pref+1,pref+2]%double_length; +mi-abs(mi-a); +); +): +mode>1?( +calc_ps()=[pref-1,pref,pref+1,pref+2]%length; +):( +calc_ps()=[pref-1,pref,pref+1,pref+2]; +); +reference_spectrum_size>1?( +const pal_spectrum_size=s#-1; +const new_spectrum_size=pal_spectrum_size*reference_spectrum_size; +mode==1?( +calc_vp()=( +v=i(#img_pos,x,y,z,channel_position); +mv=v%mi; +vp=!mv?v>0?mi:mv; +); +):( +calc_vp()=i(#img_pos,x,y,z,channel_position); +); +output()=( +color_output=vector(#new_spectrum_size,0); +repeat(reference_spectrum_size,channel_position, +vp=calc_vp(); +pref=floor(vp); +interp=vp-pref; +ps=calc_ps(); +p_s=ps[0]; +p_0=ps[1]; +p_1=ps[2]; +p_e=ps[3]; +copy(color_output[channel_position*pal_spectrum_size],calc(),s); +); +color_output; +); +):( +mode==1?( +calc_vp()=( +v=i(#img_pos,x,y,z,0); +mv=v%mi; +vp=!mv?v>0?mi:mv; +); +):( +calc_vp()=i(#img_pos,x,y,z,0); +); +output()=( +vp=calc_vp(); +pref=floor(vp); +interp=vp-pref; +ps=calc_ps(); +p_s=ps[0]; +p_0=ps[1]; +p_1=ps[2]; +p_e=ps[3]; +calc(); +); +); +); +output();" +reverse[$>,-1] +remove[-1] +} +remove[-1] +#@cli rep_tco_anim: eq. to 'rep_three_coupled_oscillators_animation' +rep_tco_anim: rep_three_coupled_oscillators_animation $* +#@cli rep_three_coupled_oscillators_animation: _max_iter>0,-2pi<=_k_a_1<=2pi,-2pi<=_k_b_1<=2pi,-2pi<=_k_a_2<=2pi,-2pi<=_k_b_2<=2pi,_sublevel>=0,-360<=_ang_a<=360,-360<=_ang_b<=360,_ox_a,_oy_a,_ox_b,_oy_b,_axis_scale_a>0,_axis_scale_b>0 +#@cli : Animation-based version of Bifurcation diagram for two-parameters of torus-map or three-coupled oscillators. [1] +#@cli : +#@cli : --- Citation --- +#@cli : 1) C. Baesens, J. Guckenheimer, S. Kim, R.S. MacKay +#@cli : Three coupled oscillators: mode-locking, global bifurcations and toroidal chaos +#@cli : Physica D: Nonlinear Phenomena, Volume 49, Issue 3, 1991, Pages 387-475, ISSN 0167-2789 +#@cli : ------ +#@cli : +#@cli : _max_iter is the number of iterations within the bifurcation diagram. +#@cli : _k_a_1 is the a-variable that influence the output for first frame. +#@cli : _k_b_1 is the b-variable that influence the output for first frame. +#@cli : _k_a_2 is the a-variable that influence the output for last frame. +#@cli : _k_b_2 is the b-variable that influence the output for last frame. +#@cli : _sublevel defines the degree of subpixel processing. 0 means no subpixel sampling. Negative number in here means it will not be resized (Useful for mapping before downsizing to original image size.). +#@cli : _ang_a defines the angle of function for first frame. +#@cli : _ang_b defines the angle of function for last frame. +#@cli : _ox_a defines the x-offset of function for first frame. +#@cli : _oy_a defines the y-offset of function for first fraime. +#@cli : _ox_b defines the x-offset of function for last frame. +#@cli : _oy_b defines the y-offset of function for last frame. +#@cli : _axis_scale_a defines the scale of each axis for first frame. +#@cli : _axis_scale_b defines the scale of each axis for last frame. +#@cli : +#@cli : Author: Reptorian. +#@cli : Default values: '_max_iter=50','_k_a_1=u(-2*pi,2*pi)','_k_b_1=u(-2*pi,2*pi)','_k_a_2=u(-2*pi,2*pi)','_k_b_2=u(-2*pi,2*pi)','_sublevel=1','_ang_a=0','_ang_b=0','_ox_a=0','_oy_a=0','_ox_b=0','_oy_b=1','_axis_scale_a=1','_axis_scale_b=1' +rep_three_coupled_oscillators_animation: +skip ${1=50},${2=},${3=},${4=},${5=},${6=1},${7=0},${8=180},{$9=0},${10=0},${11=0},${12=0},${13=1},${14=1} +check ${-max_d}>1 +_rep_three_coupled_oscillators ${1-14} +#@cli rep_tco: eq. to 'rep_three_coupled_oscillators' +rep_tco: rep_three_coupled_oscillators $* +#@cli rep_three_coupled_oscillators: _max_iter>0,-2pi<=_k_a<=2pi,-2pi<=_k_b<=2pi,_sublevel>=0,-360<=_ang<=360,_ox,_oy,_axis_scale>0 +#@cli : Bifurcation diagram for two-parameters of torus-map or three-coupled oscillators. [1] +#@cli : +#@cli : --- Citation --- +#@cli : 1) C. Baesens, J. Guckenheimer, S. Kim, R.S. MacKay +#@cli : Three coupled oscillators: mode-locking, global bifurcations and toroidal chaos +#@cli : Physica D: Nonlinear Phenomena, Volume 49, Issue 3, 1991, Pages 387-475, ISSN 0167-2789 +#@cli : ------ +#@cli : +#@cli : _max_iter is the number of iterations within the bifurcation diagram. +#@cli : _k_a is a variable that influence the output. +#@cli : _k_b is a variable that influence the output. +#@cli : _sublevel defines the degree of subpixel processing. 0 means no subpixel sampling. Negative number in here means it will not be resized (Useful for mapping before downsizing to original image size.). +#@cli : _ang defines the angle of function. +#@cli : _ox defines the x-offset of function. +#@cli : _oy defines the y-offset of function. +#@cli : _axis_scale defines the scale of each axis. +#@cli : +#@cli : Author: Reptorian. +#@cli : Default values: '_max_iter=50','_k_a=u(-2*pi,2*pi)','_k_b=u(-2*pi,2*pi)','_sublevel=1','_ang=0','_ox=0','_oy=0','_axis_scale=1' +rep_three_coupled_oscillators: +skip ${1=50},${2=},${3=},${4=1},${5=0},${6=0},${7=0},${8=1} +check ${-max_d}==1 +_rep_three_coupled_oscillators ${1-8} +_rep_three_coupled_oscillators: +skip ${1=50},${2=},${3=},${4=},${5=} +check "abs($1)!=0&&$8!=0" +animation_mode=0 +if ${-max_d}>1 animation_mode=1 if $!>1 error "One image only for animation mode!" fi fi +tau={pi*2} +if $animation_mode +if narg($2) __k_a_1=$2 +else __k_a_1={u(-$tau,$tau)} +fi +if narg($3) __k_a_2=$3 +else __k_b_1={u(-$tau,$tau)} +fi +if narg($4) __k_b_1=$4 +else __k_a_2={u(-$tau,$tau)} +fi +if narg($5) __k_b_2=$5 +else __k_b_2={u(-$tau,$tau)} +fi +rescale_back={$6>0} +__sub={abs($6)+1} +command "generate_three_coupled: +_rep_three_coupled_oscillators_animation $1,$__k_a_1,$__k_b_1,$__k_a_2,$__k_b_2,$__sub,${7-14}" +else +if narg($2) __k_a=$2 +else __k_a={u(-$tau,$tau)} +fi +if narg($3) __k_b=$3 +else __k_b={u(-$tau,$tau)} +fi +rescale_back={$4>0} +__sub={abs($4)+1} +command "generate_three_coupled: +_rep_three_coupled_oscillators_static_out $1,$__k_a,$__k_b,$__sub,${5-8}" +fi +foreach { +generate_three_coupled +if $rescale_back r. {w#0},{h#0},100%,100%,6 fi +rm.. +} +uncommand generate_three_coupled ++_rep_three_coupled_oscillators_animation: +check "$13!=0&&$14!=0" +{w*$6},{h*$6},{d},1,"*begin( +const max_iter=abs($1); +const ww=w-1; +const hh=h-1; +const dd=d-1; +const sd=max(ww,hh)/min(ww,hh); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +const cx=ww/2; +const cy=hh/2; +const ox_a=($9+1)*cx; +const oy_a=($10+1)*cx; +const ox_b=(($11*-1)+1)*cy; +const oy_b=(($12*-1)+1)*cy; +const axis_scale_a=$13; +const axis_scale_b=$14; +const cxsx=cx/sx; +const cysy=cy/sy; +const cxsx_a=cxsx/axis_scale_a; +const cxsx_b=cxsx/axis_scale_b; +const cysy_a=cysy/axis_scale_a; +const cysy_b=cysy/axis_scale_b; +const ang_a=-$7; +const ang_b=-$8; +set_cos_ang=vectord(); +set_sin_ang=set_cos_ang; +fill(set_cos_ang,p,cos(deg2rad(lerp(ang_a,ang_b,p/dd)))); +fill(set_sin_ang,p,sin(deg2rad(lerp(ang_a,ang_b,p/dd)))); +const tau=2*pi; +const k_a_1=$2; +const k_b_1=$3; +const k_a_2=$4; +const k_b_2=$5; +const tc=.7/tau; +rot_x(a,b,c)=a*set_cos_ang[c]-b*set_sin_ang[c]; +rot_y(a,b,c)=a*set_sin_ang[c]+b*set_cos_ang[c]; +oscil_a(a,b,c)=a+c-tc*sin(tau*b); +oscil_b(a,b,c)=a+c-tc*sin(tau*b); +); +zp=z/dd; +ix=(x-lerp(ox_a,ox_b,zp))/lerp(cxsx_a,cxsx_b,zp); +iy=(y-lerp(oy_a,oy_b,zp))/lerp(cysy_a,cysy_b,zp); +xp=rot_x(ix,iy,z); +yp=rot_y(ix,iy,z); +k_a=lerp(k_a_1,k_b_1,zp); +k_b=lerp(k_a_2,k_b_2,zp); +repeat(max_iter, +txp=xp; +xp=oscil_a(xp,yp,k_a); +yp=oscil_b(yp,txp,k_b); +); +norm(xp,yp);" ++_rep_three_coupled_oscillators_static_out: +check "$8!=0" +{w*$4},{h*$4},1,1,*"begin( +const max_iter=abs($1); +const ww=w-1; +const hh=h-1; +const sd=max(ww,hh)/min(ww,hh); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +const cx=ww/2; +const cy=hh/2; +const ox=($6+1)*cx; +const oy=(($7*-1)+1)*cy; +const axis_scale=abs($8); +const cxsx=cx/sx/axis_scale; +const cysy=cy/sy/axis_scale; +const ang=-($5/180)*pi; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +const tau=2*pi; +const k_a=$2; +const k_b=$3; +const tc=.7/tau; +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +oscil_a(a,b)=a+k_a-tc*sin(tau*b); +oscil_b(a,b)=a+k_b-tc*sin(tau*b); +); +ix=(x-ox)/cxsx; +iy=(y-oy)/cysy; +xp=rot_x(ix,iy); +yp=rot_y(ix,iy); +repeat(max_iter, +txp=xp; +xp=oscil_a(xp,yp); +yp=oscil_b(yp,txp); +); +norm(xp,yp);" +#@cli rep_inverse_permutation: number_list +#@cli : Return the inverse permutation. +#@cli : +#@cli : number_list must be in the form of 0,1,2,3.... , but can be in any order. +rep_inverse_permutation: +if $#>1 +ordered={expr('x',$#)} +if sort([$*])==[$ordered] +if [$*]==[$ordered] u $ordered +else +($*) +{$#} +eval.. i(#-1,i)=x +u {crop(#-1)} +rm[-2,-1] +fi +else error inv_args +fi +else u 0 +fi +#@cli rep_inverse_permute_str: permutation_string +#@cli : Return the inverse permutation_string for command permute +#@cli : 'permutation_string' is a combination of the character set {x|y|z|c}, +#@cli : e.g. 'xycz', 'cxyz', ... +rep_inverse_permute_str: +check "sort('$*')=='cxyz'" +x={'x'} +axis_list=xyzc +if '$*'=='$axis_list' return fi +('$axis_list') => axis_list +({'$*'}) => user_axis_list_permutation +set[user_axis_list_permutation] {$x+3},{xm} +-[user_axis_list_permutation] $x +(${rep_inverse_permutation\ {crop(#-1)}}) => inverse_permute_map +map[inverse_permute_map] [axis_list] +u {t} +rm[-3--1] +#@cli rep_generate_all_images_combinations:[images] +#@cli : Generates all combinations of images. +rep_find_all_images_combinations: +if $!==1 return +elif !$! error no_imgs +else timg={$!} +fi +if ${-max_d}>1 error inv_dim_d fi +eval " +valid_dim=1; +refer_dim=[w#-1,h#-1]; +repeat($timg-1,p, +[w#p,h#p]!=refer_dim?(valid_dim=0;break();); +); +valid_dim;" +if !${} error inv_dims fi +a z ++rep_r_permutations $timg,$timg,z +permute. cyzx +{w#0*d#0},{h#0},{d#-1},{s#0} +eval.. " +const img_w=w#0; +const img_h=h#0; +const img_s=s#0; +crop_image=crop(#0,0,0,i,0,img_w,img_h,1,img_s); +draw(#-1,crop_image,img_w*x,0,z,0,img_w,img_h,1,img_s,1); +" +k[-1] s z +#@cli rep_permutations: init_num,_axis={x,y,z} +#@cli : Return all the permutations of set of numbers as a image. +#@cli : +#@cli : Finding the next permutation has been adapted from this link -> https://www.techiedelight.com/find-permutations-string-cpp-java-iterative/ +#@cli : Finding the permutation at point index within this code is of the author. +#@cli : Author : Reptorian. +#@cli : Default values: '_axis=x' ++rep_permutations: +skip ${2=x} +check "inrange($1,0,10,1,1)&&$1==int($1)&&inrange(('$2')[0],120,122,1,1)" +if $1==1 1 return fi +axis,fact_size={_'$2'-_'x'},{fact($1)} +out_dim={v=vector(#3,1);v[$axis]=$fact_size;v} +if $fact_size>(768*$_cpus) mode=: fi +$out_dim,$1,$mode" +begin_t( +const max_index=s-1; +const dec_max_index=max_index-1; +const axis=$axis; +axis==2?(index()=z;): +axis==1?(index()=y;): +index()=x; +reverse_array_starting_from(a)=( +start=a; +end=max_index; +while(start=permutation[fn],--fn;if(!fn,break(););); +while(b>fn&&permutation[b]<=permutation[fn-1],--b;); +swap(permutation[fn-1],permutation[b]); +reverse_array_starting_from(fn); +):( +index=index(); +if(index, +fn=max_index; +init_array_size=s; +init_permutation=permutation; +repeat(fn,iter, +division_number=fact(fn); +pos=int(index/division_number); +permutation[iter]=init_permutation[pos]; +copy(init_permutation[pos],init_permutation[pos+1],init_array_size-pos); +index=index%division_number; +--init_array_size; +--fn; +); +permutation[iter]=init_permutation[0]; +); +started=1; +); +permutation;" +#@cli rep_permutation_index2list: number_of_item,permutation_number +#@cli : Return permutation order at index permutation_number. +rep_permutation_index2list: +num_of_items={max(1,int(abs($1)))} +if $num_of_items==1 u 0 +else +permutation_number={$2%fact($num_of_items)} +1,{$num_of_items+1},1,1,y +eval " +const num_of_items=$num_of_items; +new_arr=vector(#num_of_items,0); +fn=num_of_items-1; +permutation_position=$permutation_number; +repeat(fn,iter, +division_number=fact(fn); +pos=int(permutation_position/division_number); +new_arr_num=i[#-1,pos]; +new_arr[iter]=new_arr_num; +da_remove(#-1,pos); +permutation_position%=division_number; +--fn; +); +new_arr[iter]=i[#-1,0]; +new_arr;" +rm. +fi +#@cli rep_permutation_list2index: number_list +#@cli : Return the lexicographic index in which this permutation is found within a list of all possible permutation. +#@cli : +#@cli : number_list must be in the form of 0,1,2,3.... , but can be in any order. +#@cli : +#@cli : Note: Not the derived source code, but really close to the original one and can be inferred to be operating on the same logic. Arguably the same after inspection. - https://www.geeksforgeeks.org/lexicographic-rank-of-a-string/ . Derived source code author is unknown. +rep_permutation_list2index: +if $#>1 +if sort([$*])==expr('x',$#) +if [$*]==expr('x',$#) u 0 +else +eval " +const fn=$#-1; +iv=[$*]; +p=0; +repeat(fn,k, +v=iv[k]; +repeat(k,m, +if(iv[m]=$2&&$1>0&&isint($1))&&($2>0&&isint($2))&&inrange(_'$3',_'x',_'z',1,1)" +if [${1-2}]==[1,1] 1 return fi +num_of_combinations,axis={permut($2,$1,1)},{_'$3'-_'x'} +if $axis==2 out_dim=1,1,$num_of_combinations +elif $axis==1 out_dim=1,$num_of_combinations,1 +else out_dim=$num_of_combinations,1,1 +fi +if $2==1 $out_dim,1,${arg\ $axis+1,x,y,z} return fi +$out_dim,$2,>"begin( +const edge=s-1; +const n=$1; +const dec_n=n-1; +const axis=$axis; +axis==2?( +axis()=z; +): +axis==1?( +axis()=y; +):( +axis()=x; +); +output=expr('x',n); +reverse_array_starting_from(a)=( +start=a; +end=dec_n; +while(start=output[j]),++j;); +j=0 && output[i]>=output[i+1],--i;); +j=dec_n; +while(j>i && (output[i]>=output[j]),--j;); +swap(output[i],output[j]); +reverse_array_starting_from(i+1); +); +); +(output)[0,s]; +" +#@cli rep_npr_permutation_index2list: number_of_item,selected_items_count,permutation_number +#@cli : Return permutation order at index permutation_number. +rep_npr_permutation_index2list: +check "$2<=$1&&$1>0&&$2>0" +if $1==1 status 0 +elif $2==1 status {$3%$1} +else +permutation_number={$3%permut($2,$1,1)} +1,{$1+1},1,1,y +{1+($1==$2?$1-2:min($1-1,$2-1))},1,1,1,>"begin( +const m=($1==$2?1:$1-$2)+1; +v=m; +); +x>1?v=v*(m+x-1):(x?v:1);" +eval " +new_arr=vector(#$2,0); +divisor_position=w#-1-1; +permutation_number=$permutation_number; +repeat(w#-1,iter, +division_number=i[#-1,divisor_position]; +pos=int(permutation_number/division_number); +new_arr_num=i[#-2,pos]; +new_arr[iter]=new_arr_num; +da_remove(#-2,pos); +permutation_number%=division_number; +--divisor_position; +); +new_arr[iter]=i[#-2,0]; +new_arr; +" +remove[-2--1] +fi +#@cli rep_npr_permutation_list2index: number_of_items,number_list +#@cli : Return the lexicographic index in which this permutation is found within a list of all possible permutations. +#@cli : +#@cli : number_list must be in the form of 0,1,2,3.... , but can be in any order. However, the size of it must be less than or equal to number_of_items. That means you can exclude some numbers. +rep_npr_permutation_list2index: +check "$1>0&&($#-1)<=$1" +n_items,n_list_size={[$1>1,$#-1]} +if $#==2&&$n_items status {$2%#1} +elif $#>2&&$n_items +eval " +const limit=$1-1; +counters=vector(#$1,0); +test_vector=[${2--1}]; +repeat(size(test_vector),p, +v=test_vector[p]; +if(!isint(v),run('error all_todo_ints==F');); +if(!inrange(v,0,limit,1,1),run('error int_lim_exc');); +if(++counters[v]>1,run('error dups_found');); +); +" +{1+($1==$n_list_size?$1-2:min($1-1,$n_list_size-1))},1,1,1,>"begin( +const m=($1==$n_list_size?1:$1-$n_list_size)+1; +v=m; +); +x>1?v=v*(m+x-1):(x?v:1);" +eval " +const n_list_size=min($n_list_size,$1-1); +iv=[${2--1}]; +p=0; +repeat(n_list_size,k, +v=iv[k]; +repeat(k,m, +if(iv[m]0, occurance_per_items,_axis={ x|y|z} +#@cli : Create image representing permutations with repeating numbers. ++rep_r_permutations: +skip ${3=x} +check "($1&&isint($1))&&isint($2)>0&&inrange(_'$3',_'x',_'z',1,1)" +mode,ss,num_of_permutations,axis={pm=$1>0;[pm,pm?[$2,$1^$2]:[abs($1),$2^abs($1)],_'$3'-_'x']} +if $num_of_permutations>(768*$_cpus) p_mode=: fi +out_dim={v=[1,1,1];v[$axis]=$num_of_permutations;v;} +$out_dim,$ss,$p_mode" +begin( +const axis=$axis; +const mode=$mode; +mode?( +const mod_factor=$1; +div_list=reverse(expr('$1^x',$2)); +):( +const mod_factor=$2; +div_list=reverse(expr('$2^x',abs($1))); +); +axis==2?(index()=z;): +axis==1?(index()=y;): +index()=x; +); +int(index()/div_list)%mod_factor;" +#@cli rep_r_permutation_index2list: times_items_can_repeat, repetition, position : -number_of_items, occurance_per_items, position +#@cli : Return the list of numbers which correspond to the index provided based on permutations with repetition. +rep_r_permutation_index2list: +check "v=[$*];size(v)==$#&&sum(isint(v))==3&&min((v)[0,2])&&$2>0;" +eval " +const mode=$1>0; +mode?( +const mod_factor=$1; +const size_of_list=$1^$2; +div_list=reverse(expr('$1^x',$2)); +):( +const mod_factor=$2; +const size_of_list=$2^abs($1); +div_list=reverse(expr('$2^x',abs($1))); +); +const position=$3%size_of_list; +int(position/div_list)%mod_factor;" +#@cli rep_r_permutation_list2index: number_of_items/occurance, item_index_a,item_index_b +#@cli : Return the lexicographic index in which the list of numbers corresponds to the lexicographically-ordered list of permutations with repetitions. Note that number_of_items and occurance is exchangeable. +rep_r_permutation_list2index: +check "sum(isint([$*]))==$#&&sum([$*]>=0)==$#" +eval " +inp_v=[${2--1}]; +const mod_factor=$1; +mul_list=reverse(expr('$1^x',size(inp_v))); +sum(mul_list*([${2--1}]%mod_factor));" +#@cli rep_ncr_combinations: number_of_items>0,choices>0,_axis={x,y,z} : choices>0, number_of_items>0,_axis={x,y,z} +#@cli : Generates all combinations that fits nCr. The algorithm used for this is based on Algorithm 515 (Buckles and Lybanon 1977) which allows index-based generation of combinations. +#@cli : +#@cli : Code has been adapted from sleeepjack's Python 2 code executing Algorithm 515 - https://github.com/sleeepyjack/alg515/blob/master/python/alg515.py +#@cli : +#@cli : Note: If $2 is greater than $1, then $2 is number of items and $1 is choices. Only positive integer numbers are accepted! +#@cli : Default values: '_axis=x' ++rep_ncr_combinations: +skip ${3=x} +check "($1>0&&$2>0)&&(isint($1)&&isint($2))&&inrange(_'$3',_'x',_'z',1,1)" +if $1==$2 1,1,1,$1,c return fi +if $1>$2 n_items,choices=$1,$2 +else n_items,choices=$2,$1 +fi +if $choices==1 $n_items,1,1,1,x return fi +num_combs,axis={permut($choices,$n_items,0)},{_'$3'-_'x'} +if $num_combs>33554432 error excess_combs fi +if $axis==2 out_dim=1,1,$num_combs +elif $axis==1 out_dim=1,$num_combs,1 +else out_dim=$num_combs,1,1 +fi +if $num_combs>(768*$_cpus) mode=: fi +$out_dim,$choices,$mode" +begin( +const n_items=$n_items; +const max_value=n_items-1; +const dec_max_value=max_value-1; +const axis=$axis; +const max_index=s-1; +const dec_max_index=max_index-1; +const IR=permut(max_index,n_items-1,0); +axis==2?(index()=z;): +axis==1?(index()=y;): +index()=x; +started=0; +comb=vector(#s,0); +ref_comb=expr('x+1',n_items-1); +copy(comb[1],ref_comb[0],s-1); +); +started?( +comb[max_index]==max_value?( +K=dec_max_value; +for(R=dec_max_index,comb[R]==K,K--;--R;); +copy(comb[R],ref_comb[comb[R]],s-R); +):(++comb[max_index];); +):( +index=index(); +if(index, +V=1; +R=IR; +K=R; +while(K<=index, +++V; +R=permut(max_index,n_items-V,0); +K+=R; +); +K-=R; +comb[0]=V-1; +for(p=2,p0&&$2>0)&&(isint($1)&&isint($2))" +if $1==$2 u {expr('x',$1)} return fi +if $1>$2 n_items,choices=$1,$2 +else n_items,choices=$2,$1 +fi +num_combs={permut($choices,$n_items,0)} +index={$3%$num_combs} +eval " +const n_items=$n_items; +const choices=$choices; +const index=$index; +comb=vector(#choices,0); +V=1; +R=permut(choices-1,n_items-V,0); +K=R; +while(K<=index, +++V; +R=permut(choices-1,n_items-V,0); +K+=R; +); +K-=R; +comb[0]=V-1; +for(p=2,p0,choices>0,_axis={x,y,z} +rep_r_combinations: +skip ${3=x} +check "($1>0&&$2>0)&&(isint($1)&&isint($2))&&inrange(_'$3',_'x',_'z',1,1)" +n_items,choices=$1,$2 +num_combs,axis={permut($choices,$n_items+$choices-1,0)},{_'$3'-_'x'} +if $axis==2 out_dim=1,1,$num_combs +elif $axis==1 out_dim=1,$num_combs,1 +else out_dim=$num_combs,1,1 +fi +$out_dim,$choices,>" +begin( +const n_items=$n_items; +const max_ind=s-1; +const axis=$axis; +axis==2?(index()=z;): +axis==1?(index()=y;): +index()=x; +comb=vector(#s,0); +val=0; +); +if(index(), +if(++comb[max_ind]==n_items, +for(p=max_ind-1,p>-1,--p, +if(++comb[p]1&&$2>0&&$#==3" +eval " +const n=$1; +const k=$2; +const d_k=k-1; +const num_of_combs=permut($2,$1+$2-1,0); +const max_comb_ind=num_of_combs-1; +index=$3%$num_of_combs; +Tc=n-1; +calc_approximate_n(v,r)=max(r,int((v*fact(r)-r)^(1/r))); +if((max_comb_ind*fact(Tc)-Tc)>200287698057897074364579839981, +run('error exec_comb_limit'); +); +output_list=vector(#k,0); +!index?( +output_list; +): +index==max_comb_ind?( +output_list=vector(#k,n-1); +):( +index-1&&(sum(inrange([${2--1}],0,$1,1,0))==v-1)" +if !$1 +status nan return +elif $#-1==1 +status {$2%$1} return +elif !sum(${2--1}) +status 0 return +fi +eval " +const n_items=$1; +const max_ind=n_items-1; +const kv=$#-1; +series_of_indexes=sort([${2--1}]); +Tc=kv; +index=0; +a=permut(kv,n_items+kv-1,0); +repeat(kv-1,p, +v_ind_p=series_of_indexes[p]; +diff=kv-v_ind_p; +sum_nd=n_items+diff-p; +b=permut(Tc,sum_nd-1,0); +index+=a-b; +if(v_ind_p==max_ind,break();); +a=b-permut(Tc,sum_nd-2,0); +--Tc; +); +index+=series_of_indexes[kv-1]-series_of_indexes[kv-2]; +index;" +#@cli rep_cartesian_product: number_of_items_a,number_of_items_b,...,_axis : -number_of_items,occurance_per_items,_axis : number_of_items,_axis +#@cli : Output image representing cartesian product based on input. +#@cli : Default values: '_axis=x' ++rep_cartesian_product: +skip ${2=x} +if isnum($-1)&&isint($-1) +axis,user_xyz=0 +elif inrange(_'$-1',_'x',_'z',1,1) +axis,user_xyz={_'$-1'-_'x'},1 +else +error invalid_char +fi +vars2chk={$#-$user_xyz} +v_list={abs(([$*])[0,$vars2chk])} +n_vars_isint,all_valid={v=[$v_list];[sum(isint(v)),min(v)]} +if !$all_valid error var_0_error fi +if $n_vars_isint!=$vars2chk invalid_var_inp fi +dims,s_size={v=[$v_list];[prod(v),size(v)];} +if $dims>33554432 error dims_lim_exc fi +if $dims>(768*$_cpus) p_mode=: fi +dims={v=vector(#3,1);v[$axis]=$dims;v;} +if max($v_list)==1 1,1,1,$s_size return +elif $s_size==1 $dims,1,${arg\ $axis+1,x,y,z} return +fi +$dims,$s_size,$p_mode" +begin( +const axis=$axis; +const mode=$mode; +const d_s=s-1; +const dec_d_s=d_s-1; +items_list=["$v_list"]; +div_list=vector(#s,1); +tv=1; +repeat(d_s,p, +div_list[dec_d_s-p]=tv*=items_list[d_s-p]; +); +axis==2?(index()=z;): +axis==1?(index()=y;): +index()=x; +); +int(index()/div_list)%items_list;" +#@cli rep_cartesian_product_index2list: number_of_items_a,number_of_items_b,...,index +#@cli : Return the list of numbers which correspond to the index provided. Every arguments must be a integer. +rep_cartesian_product_index2list: +check "sum(isint([$*]))==$#" +max_int={max(abs([${1--2}]))} +if $max_int==1 +status {vector(#($#-1),0)} return +elif !$max_int +error var_0_error +fi +eval " +const size_of_array=$#-1; +const d_s=size_of_array-1; +const dec_d_s=d_s-1; +items_list=abs([${1--2}]); +position=$-1%prod(items_list); +div_list=vector(#size_of_array,1); +tv=1; +repeat(d_s,p, +div_list[dec_d_s-p]=tv*=items_list[d_s-p]; +); +int(position/div_list)%items_list;" +#@cli rep_cartesian_product_list2index: number_of_items_a,number_of_items_b,...,coordinate_a,coordinate_b,... +#@cli : Return the index in which the coordinates is seen in a box of size number_of_items_a*number_of_items_b.... +rep_cartesian_product_list2index: +if $#&1 error inv_args_count fi +eval " +const half_list_size=$#>>1; +const dec_half_list_size=half_list_size-1; +mul_items=int(abs(([${1--1}])[0,half_list_size])); +position=int(abs(([${1--1}])[half_list_size,half_list_size])); +position%=mul_items; +mul_items=shift(mul_items,-1,0); +++mul_items[dec_half_list_size]; +tv=1; +repeat(half_list_size,p, +tv=mul_items[dec_half_list_size-p]*=tv; +); +sum(mul_items*position);" +#@cli rep_rrd: eq. to 'rep_random_rectangular_division' +rep_rrd: rep_random_rectangular_division $* +#@cli rep_random_rectangular_division: split>1,_additional_thickness>=0,_max_iter>=2,_probability[%]>0,_loop_limit>1,0<=_border[%]>=100%,_seed,_normalize,border_color,palette_mode +#@cli : Generate random division of rectangle as in random number of division and varying thickness within rectangle. +#@cli : _additional_thickness refers to the excess pixel thickness. +#@cli : _max_iter limits the number of iterations per rectangle. +#@cli : _probability determines the probability that a rectangle will be permitted to be utilized for further iteration. +#@cli : _loop_limit limits the number of time the process of subdivision is done. +#@cli : _seed generates the output based on defined parameter. +#@cli : Default values: '_gen_thick=0','_max_iter=5','_probability[%]=95%','_loop_limit=5000','_border=0%','_seed=n/a' +rep_random_rectangular_division: +skip ${2=0},${3=5},${4=95%},${5=5000},${6=0},${7=},${8=0},${9=},${10=},${11=},${12=},${13=} +check "$4>0" +foreach { _rep_random_rectangular_division $* } +_rep_random_rectangular_division: +skip ${2=0},${3=5},${4=95%},${5=5000},${6=0},${7=},${8=0},${9=},${10=},${11=},${12=},${13=} +border_size={max(0,round(abs($2)*cut($6,0,1)))} +contain_palette=0 +dims={w},{h} +ns=1 +col=0 +activate_code_block=1 +if narg($10) +ms=3 +contain_palette=1 +if '$10'=='pal' +elif ${is_image_arg\ $10} pass$10 0 ms={s#-1} rm. +else contain_palette=0 +fi +fi +if narg($10) +ms=3 +contain_palette=1 +if '$10'=='pal' +elif ${is_image_arg\ $10} pass$10 0 ms={s#-1} rm. +else +contain_palette=0 +if !narg($11)||(narg($11)?abs($11)==0) +activate_code_block=0 +if narg($9)&&$border_size +col=${rep_hex2int8\ $9} +ns={narg($col)} +col=vector(#$ns,$col) +else +ns=3 +fi +fi +fi +else +if narg($9)&&$border_size +col=${rep_hex2int8\ $9} +ns={narg($col)} +col=vector(#$ns,$col) +fi +fi +rm. +$dims,1,$ns,$col +1,1,1,5 +1,1,1,5 +eval " +if(narg($7),srand($7);); +const ww=w#-3-1; +const hh=h#-3-1; +const max_split=max(1,int(abs($1))); +const internal_space=int(abs($2)); +const test_boundary=internal_space?(internal_space+1); +const max_iter=max(2,round(abs($3))); +const odd=cut($4,0,1); +const arr_limit=round(abs($5)); +diff_check(a)=( +mri=max_split; +ds=a/mri; +if(mri>1&&ds<1, +while(mri>1&&ds<1, +--mri; +ds=a/mri; +); +); +ds>1; +); +width_check=diff_check(ww-internal_space*2); +height_check=diff_check(hh-internal_space*2); +!(width_check||height_check)?run('error inv_dim'); +da_push(#-2,[0,ww,0,hh,0]); +sub_column(v,point)=( +ri=int(u(1,max_split,1,0))+1; +mri=ri-1; +sx=v[0]+test_boundary; +ex=v[1]-test_boundary; +diff=ex-sx; +bound_check=diff>test_boundary; +skip=0; +da_remove(#-2,point); +if(bound_check, +ds=diff/mri; +if(mri>1&&ds<=test_boundary, +while(mri>1&&ds<=test_boundary, +--ri; +--mri; +ds=diff/mri; +); +); +if(test_boundary||diff?(ds>test_boundary):1, +py=[v[2],v[3]]; +iter=v[4]+1; +p=v[0]; +repeat(ri,ri_ind, +rb=odd<1?u(0,1)>odd; +ri_ind==mri?( +if(p>v[1], +p=v[1]; +if(!(v[3]-v[2]),rb=1;); +); +(rb||(iter==max_iter))?( +da_push(#-1,[p,v[1],py,iter]); +):( +da_push(#-2,[p,v[1],py,iter]); +); +): +!ri_ind?( +mx=sx+ds; +np=min(max(sx,round(u(p,mx))),ex); +vp=[p,np]; +(rb||(iter==max_iter))?( +da_push(#-1,[vp,py,iter]); +):( +da_push(#-2,[vp,py,iter]); +); +p=np+1; +if(p>=ex,skip=1;); +):( +if(skip,continue();); +mx+=ds; +np=min(max(p+internal_space,round(u(p,mx))),ex); +vp=[min(p,ex),np]; +(rb||(iter==max_iter))?( +da_push(#-1,[vp,py,iter]); +):( +da_push(#-2,[vp,py,iter]); +); +p=np+1; +); +); +,da_push(#-1,v); +); +,da_push(#-1,v); +); +); +sub_row(v,point)=( +ri=int(u(1,max_split,1,0))+1; +mri=ri-1; +sy=v[2]+test_boundary; +ey=v[3]-test_boundary; +diff=ey-sy; +bound_check=diff>test_boundary; +skip=0; +da_remove(#-2,point); +if(bound_check, +ds=diff/mri; +if(mri>1&&ds<=test_boundary, +while(mri>1&&ds<=test_boundary, +--ri; +--mri; +ds=diff/mri; +); +); +if(test_boundary||diff?(ds>test_boundary):1, +px=[v[0],v[1]]; +iter=v[4]+1; +p=v[2]; +repeat(ri,ri_ind, +rb=odd<1?u(0,1)>odd; +ri_ind==mri?( +if(p>v[3], +p=v[3]; +if(!(v[1]-v[0]),rb=1;); +); +(rb||(iter==max_iter))?( +da_push(#-1,[px,p,v[3],iter]); +):( +da_push(#-2,[px,p,v[3],iter]); +); +): +!ri_ind?( +my=sy+ds; +np=min(max(sy,round(u(p,my))),ey); +vp=[p,np]; +(rb||(iter==max_iter))?( +da_push(#-1,[px,vp,iter]); +):( +da_push(#-2,[px,vp,iter]); +); +p=np+1; +if(p>=ey,skip=1;); +):( +if(skip,continue();); +my+=ds; +np=min(max(p+internal_space,round(u(p,my))),ey); +vp=[min(p,ey),np]; +(rb||(iter==max_iter))?( +da_push(#-1,[px,vp,iter]); +):( +da_push(#-2,[px,vp,iter]); +); +p=np+1; +); +); +,da_push(#-1,v); +); +,da_push(#-1,v); +); +); +v=I[#-2,0]; +width_check&&height_check?( +u(0,1)<=.5?( +sub_row(v,0); +):( +sub_column(v,0); +); +): +width_check?( +sub_column(v,0); +): +height_check?( +sub_row(v,0); +); +arr_point=0; +while(da_size(#-2), +p_ind=int(u(da_size(#-2))); +cv=I[#-2,p_ind]; +u(0,1)<.5?( +sub_row(cv,p_ind); +):( +sub_column(cv,p_ind); +); +++arr_point; +if(arr_point>=arr_limit,break()); +); +da_freeze(#-2); +da_freeze(#-1);" +a[-2,-1] y +eval. :"begin_t( +const ww=w#-2-1; +const hh=h#-2-1; +const border_size=$border_size; +const b_a=floor(border_size/2); +const b_b=ceil(border_size/2); +const contain_border=$border_size?1; +hsv2rgb(I)=( +ref(I,_I); +_I[0]%=360; +_I[1]=cut(_I[1],0,1); +_I[2]=cut(_I[2],0,1); +_c=_I[2]*_I[1]; +_x=_c*(1-abs((_I[0]/60)%2-1)); +(arg(1 + int(_I[0]/60),[_c,_x,0],[_x,_c,0],[0,_c,_x],[0,_x,_c],[_x,0,_c],[_c,0,_x])+=_I[2] - _c)*=255; +); +$8&&!narg($10)?( +$ns>1?( +const rescale_factor=(h-1)/255; +calc_out()=vector(#$ns,y/rescale_factor); +):( +const rescale_factor=(h-1+contain_border)/255; +calc_out()=vector(#$ns,(y+contain_border)/rescale_factor); +); +):( +$activate_code_block?( +calc_out=calc_out()=y+contain_border; +):( +if(narg($12),srand($12+t);); +$10==1?( +calc_out()=hsv2rgb(vector(#3,u(360),u(1),u(1))); +):( +calc_out()=vector(#3,u(255),u(255),u(255)); +); +); +); +convert2coords(c)=( +sx=c[0]+(!(c[0]==0)?b_a); +sy=c[2]+(!(c[2]==0)?b_a); +ex=c[1]-(!(c[1]==ww)?b_b); +ey=c[3]-(!(c[3]==hh)?b_b); +tl=[sx,sy]; +tr=[ex,sy]; +bl=[sx,ey]; +br=[ex,ey]; +[tl,tr,br,bl]; +); +); +polygon(#-2,4,convert2coords(I),1,calc_out()); +end( +if(contain_border, +const sub_border=border_size-1; +const bh=hh-sub_border; +const bw=ww-sub_border; +col="$col"; +polygon(#-2,4,[0,0, ww,0, ww,sub_border, 0,sub_border],1,col); +polygon(#-2,4,[0,border_size,sub_border,border_size,sub_border,hh,0,hh],1,col); +polygon(#-2,4,[bw,border_size,ww,border_size,ww,hh,bw,hh],1,col); +polygon(#-2,4,[border_size,bh,bw,bh,bw,hh,border_size,hh],1,col); +); +);" +rm. +if narg($10)&&$activate_code_block +if $contain_palette +orientation=0 +if $border_size +col=${rep_hex2int8\ $9} +1,1,1,$ms,vector(#3,$col); +if '$10'=='pal' ++pal $11 +if narg($12) +{w},1,1,1,begin(srand($12););u +pixelsort.. +,x,[-1] +rm. +fi +elif ${is_image_arg\ $10} +pass$10 1 +if h>w orientation=1 fi +if narg($11) +if $orientation +{h},1,1,1,begin(srand($11););u +pixelsort.. +,y,[-1] +rm. +else +{w},1,1,1,begin(srand($11););u +pixelsort.. +,x,[-1] +rm. +fi +fi +fi +r. {iM#-3-1},1,1,3,0,2 +if $orientation +r. 1,{iM#-3-1},1,3,0,2 +a[-2,-1] y +else +r. {iM#-3-1},1,1,3,0,2 +a[-2,-1] x +fi +else +if '$10'=='pal' ++pal $11 +if narg($12) +{w},1,1,1,begin(srand($12););u +pixelsort.. +,x,[-1] +rm. +fi +elif ${is_image_arg\ $10} +pass$10 1 +if h>w orientation=1 fi +if narg($11) +if $orientation +{h},1,1,1,begin(srand($11););u +pixelsort.. +,y,[-1] +rm. +else +{w},1,1,1,begin(srand($11););u +pixelsort.. +,x,[-1] +rm. +fi +fi +fi +if $orientation +r. 1,{iM#-2-1},1,3,0,2 +else +r. {iM#-2-1},1,1,3,0,2 +fi +fi +else +if $border_size +col=${rep_hex2int8\ $9} +1,1,1,3,vector(#3,$col); +if $10==1 +{narg($11)?max(abs($11),2):iM#-2-1},1,1,3,${-math_lib}begin(if(narg($12),srand($12);););hsv2rgb(vector(#3,u(360),u(1),u(1))); +else +{narg($11)?max(abs($11),2):iM#-2-1},1,1,3,begin(if(narg($12),srand($12);););vector(#3,u(255),u(255),u(255)); +fi +if narg($11) r. {iM#-3-1},100%,100%,100%,0,2 fi +a[-2,-1] x +else +if $10==1 +{narg($11)?max(abs($11),2):iM#-1-1},1,1,3,${-math_lib}begin(if(narg($12),srand($12);););hsv2rgb(vector(#3,u(360),u(1),u(1))); +else +{narg($11)?max(abs($11),2):iM#-1-1},1,1,3,begin(if(narg($12),srand($12);););vector(#3,u(255),u(255),u(255)); +fi +if narg($11) r. {iM#-2-1},100%,100%,100%,0,2 fi +fi +fi +map.. . +rm. +fi +#@cli rep_custom_map: _shift_value>0,_negate={ 0=no_negation | 1=negate },_[palette],_seed_a... +#@cli : Custom mapping function with more options than default map. +#@cli : _shift_value defines the shift of base values used for mapping of color. This can be either percentage of integer. +#@cli : _[palette] is used to map into image. +#@cli : _seed defines the seed per image. Note: If you had inserted no argument, but a comma before, then it will pick random. If there is no argument and no comma, then it will use default map method. If this is your only argument, then the seed will defines the output. Sequentive arguments will also be used as seed for output for each images. +#@cli : Default values: '_shift_value=n/a','_[palette]','_seed=n/a' +#@cli : +#@cli : Author: Reptorian. +rep_custom_map: +skip "${1=}","${2=0}","${3=}","${4=}" +check narg($1)||(narg(${2--1})>1) +if narg($1) +if ${is_percent\ $1} +f "begin( +const num_val=iM+1; +const shift_val=round(iM*$1); +nv=expr('x',num_val); +shift(nv,-shift_val,2); +); +nv[i];" +else +f "begin( +const num_val=iM+1; +nv=expr('x',num_val); +shift(nv,-$1,2); +); +nv[i];" +fi +fi +if $2 negate fi +if narg($3) +if ${is_image_arg\ $3} +pass$3 0 +check "w#-1==1||h#-1==1" +store. ordered +if narg($*)==4 +if narg($4) +$ordered +if w>h +{w#-1},1,1,1,begin(if(narg($4),srand($4)));u +pixelsort.. +,x,[-1] +else +1,{h#-1},1,1,begin(if(narg($4),srand($4)));u +pixelsort.. +,y,[-1] +fi +map[0--3] [-2],2 +rm[-2,-1] +else +repeat $! { +$ordered +if w>h +{w#-1},1,1,1,u +pixelsort.. +,x,[-1] +else +1,{h#-1},1,1,u +pixelsort.. +,y,[-1] +fi +map[$>] [-2],2 +rm[-2,-1] +} +fi +elif narg($*)>4 +$=seed +repeat $! { +$ordered +if w>h +{w#-1},1,1,1,begin(srand(${seed{4+$>}}));u +pixelsort.. +,x,[-1] +else +1,{h#-1},1,1,begin(srand(${seed{4+$>}}));u +pixelsort.. +,y,[-1] +fi +map[$>] [-2],2 +rm[-2,-1] +} +else +$ordered map[^-1] [-1] rm. +fi +else error \$\2!=[img] +fi +fi +#@cli rep_exp_sig_adj : eq. to 'rep_exponential_sigmoid_adjustment' +rep_exp_sig_adj: rep_exponential_sigmoid_adjustment $* +#@cli rep_exponential_sigmoid_adjustment: -1>=midpoint_shift>=1,sigmoid_level>=0,_sigmoid_shift,_endval +#@cli : Assign exponential-sigmoid function into image. +#@cli : +#@cli : midpoint_shift defines the center value point. If it at .5, then the center value point will between the largest value and the middle value. +#@cli : sigmoid_level influence how much S-Curve will be applied. If 0, then there is no sigmoid function. +#@cli : _sigmoid_shift shifts value +#@cli : _endval determines the maximum value of output. Negative value will return a image where the maximum image is the positive value of the negative input. Positive value will return a image where the maximum value is the maximum value multiplied by it input. +#@cli : +#@cli : Default values: '_sigmoid_shift=0','_endval=1' +#@cli : +#@cli : Author: Reptorian. +rep_exponential_sigmoid_adjustment: +skip ${2=0},${3=0},${4=1} +check {abs($4)!=0} +sig_scale={abs($2)} +check_sig_scale={$sig_scale==0} +if ($1!=0)||($2!=0)||($3!=0) +f ":begin( +const sig_scale=$sig_scale; +const midpoint_shift=min(1-abs($1),1); +const maxval_mul_by_factor=$4>0?iM*$4:abs($4); +$1>=0?( +calc_exp_shift(n)=n^midpoint_shift; +):( +calc_exp_shift(n)=1-((1-n)^midpoint_shift); +); +$check_sig_scale?( +calc(n)=calc_exp_shift(n); +):( +sigmoid_curve(a)=(ne=e^a;ne/(ne+1)); +$3==0?( +change_slope(a)=(a-.5)*sig_scale; +const start_point=change_slope(0); +const val_ref=(e^start_point)/(e^start_point+1); +const min_height=abs(val_ref); +const max_height=1-2*min_height; +):( +const shift_point=-.5+$3; +change_slope(a)=(a+shift_point)*sig_scale; +const start_point=change_slope(0); +const start_ref=(e^start_point)/(e^start_point+1); +const end_point=change_slope(1); +const end_ref=(e^end_point)/(e^end_point+1); +const min_height=abs(start_ref); +const max_height=end_ref-start_ref; +); +calc(n)=( +new_curve=calc_exp_shift(n); +(sigmoid_curve(change_slope(new_curve))-min_height)/max_height; +); +); +); +start_slope=I/iM; +calc(start_slope)*maxval_mul_by_factor;" +fi +#@cli rep_ekb: eq. to 'rep_ellsworth_board' +rep_ekb: rep_ellsworth_kelly_board $* +#@cli rep_ellsworth_board: sqr_size,_border_size[%],_border_value[%],_distribution,_{pal_id,[image]},_background_hex,fit_mode,_color_space,_exterior_border_color... +#@cli : Outputs a color board based on colored square tiles art made by Ellsworth Kelly with transparent areas. +#@cli : +#@cli : (eq. to 'rep_ekb') +#@cli : sqr_size defines the painted square size. +#@cli : _border_size defines the size of border. Negative number will take away areas from the painted squares. Positive number will separate painted areas by this amount. +#@cli : _border_value defines the gray level of border. +#@cli : _distribution defines the probability of a square to be painted. +#@cli : _{pal_id,[image]} defines the color. If you choose a name of a existing palette, then this will be the base of the colors of the square. Otherwise, it will be based off the palette. +#@cli : _background_hex defines the background color. This is based on RGB-Hex value. +#@cli : _fit_mode defines whether the resulting board should exceed the size of the original image. +#@cli : _color_space defines the color space of the board. +#@cli : _border_color defines the color of the border. Dependent on color space. +#@cli : Default values: '_border_size=10%','_border_value=50%','_distribution=50%','{pal_id,[image]}=120','_background_hex=n/a',_fit_mode=0,'_color_space=0','_exterior_border_color=n/a' +#@cli : +#@cli : Author: Reptorian +rep_ellsworth_kelly_board: +skip "${2=10%},${3=50%},${4=50%},${5=120},${6=},${7=0},${8=0},${9=}" +check "($1==int(abs($1)))&&(int(abs($1))>=1)&&$4>0" +cs={$8%17} +convert_colors_fwd=${arg\ $cs+1,error,rgb2ryb,rgb2cmy,rgb2cmyk,rgb2hcy,rgb2hsi,rgb2hsl,rgb2hsv,rgb2lab,rgb2lch,rgb2ycbcr,rgb2ycbcrglic,rgb2yiq,rgb2yuv,rgb2xyz,rgb2yes} +convert_colors_bwd=${arg\ $cs+1,error,ryb2rgb,cmy2rgb,cmyk2rgb,hcy2rgb,hsi2rgb,hsl2rgb,hsv2rgb,lab2rgb,lch2rgb,ycbcr2rgb,ycbcrglic2rgb,yiq2rgb,yuv2rgb,xyz2rgb,yes2rgb} +ref_sqr_size={abs($1)} +mode=1 +border_direction={$2>=0} +('$2') +if i(#-1,w-1)==37 use_percent=1 else use_percent=0 fi +rm. +if $border_direction&&$ref_sqr_size>1 +if $use_percent border_size={round(($ref_sqr_size)*abs($2))} +else border_size={round(abs($2))} +fi +if $border_size>0 +sqr_size={$ref_sqr_size+$border_size} +else +sqr_size=$ref_sqr_size +fi +elif !$border_direction||$ref_sqr_size==1 +if $use_percent border_size={round(($ref_sqr_size-1)*abs($2))} +else border_size={min(round(abs($2)),$ref_sqr_size-1)} +fi +sqr_size=$ref_sqr_size +else +border_size=0 +sqr_size=$ref_sqr_size +fi +border_value={cut($3,0,1)} +if ${is_image_arg\ $5} +pass$5 0 +if !((w>1&&h==1)||(w==1&&h>1)) error dim_inv fi +local[-1] { +if w>h +s x +else +s y +fi +remove_duplicates +a x +} +else ++pal $5 +cs=0 +fi +if w#-1<5 error min_cols>=5==F fi +if narg($6) +test_color=${rep_hex2int8\ $6} +1,1,1,{s},"vectors("$test_color")" +if $8 $convert_colors_fwd. fi +eval.. "begin(test_color=I(#-1,0,0,0););if(I==test_color,run('error inval_bant'));" +empty_color=[{[crop(#-1),255]}] +rm. +else +empty_color=vector(#s,0) +fi +if $border_size +condition_text=condition=(nx>=border_size)&&(ny>=border_size); +result=condition?color:border_color +else +result=color +fi +mode={$7%2} +border_value={cut($3,0,1)} +if ${is_image_arg\ $5} +1,1,1,3,[{vector3($border_value*255)}] +if $cs $convert_colors_fwd. fi +init_border_color={crop(#-1)} +rm. +else init_border_color={vector3($border_value*255)} +fi +use_bg_color=0 +if narg($9)&&!$mode bg_color=${9--1},255 use_bg_color=1 fi +repeat $!-1 l[$>,-1] +if $mode +mini_w={ceil(w#0/$sqr_size)} +mini_h={ceil(h#0/$sqr_size)} +else +mini_w={int(w#0/$sqr_size)} +mini_h={int(h#0/$sqr_size)} +fi +large_w={$mini_w*$sqr_size+$border_size} +large_h={$mini_h*$sqr_size+$border_size} +if $mode +if ($large_w-$sqr_size)>w#0 +large_w-=$sqr_size +mini_w-=1 +fi +if ($large_h-$sqr_size)>h#0 +large_h-=$sqr_size +mini_h-=1 +fi +else +if $large_w>w#0 +large_w-=$sqr_size +mini_w-=1 +fi +if $large_h>h#0 +large_h-=$sqr_size +mini_h-=1 +fi +fi +$mini_w,$mini_h,1,1,"begin( +const probability=cut($4,0,1); +if(probability==1, +calc_result()=int(u(w#-1));, +calc_result()=u(1)"begin( +const num_of_colors=w#-2; +const mx=w-1; +const my=h-1; +find_new_color()=( +new_col_id=int(u(num_of_colors)); +do(++new_col_id;,cols[new_col_id%num_of_colors]); +new_col_id%num_of_colors; +); +); +cols=vector(#num_of_colors,0); +(i+1)?( +(x==0&&y==0)?( +(j(1,0)+1)?cols[j(1,0)]=1; +(j(0,1)+1)?cols[j(0,1)]=1; +find_new_color(); +): +(x==mx&&y==0)?( +(j(-1,0)+1)?cols[j(-1,0)]=1; +(j(0,1)+1)?cols[j(0,1)]=1; +find_new_color(); +): +(x==0&&y==my)?( +(j(1,0)+1)?cols[j(1,0)]=1; +(j(0,-1)+1)?cols[j(0,-1)]=1; +find_new_color(); +): +(x==mx&&y==my)?( +(j(-1,0)+1)?cols[j(-1,0)]=1; +(j(0,-1)+1)?cols[j(0,-1)]=1; +find_new_color(); +): +(x==0)?( +(j(1,0)+1)?cols[j(1,0)]=1; +(j(0,1)+1)?cols[j(0,1)]=1; +(j(0,-1)+1)?cols[j(0,-1)]=1; +find_new_color(); +): +(x==mx)?( +(j(-1,0)+1)?cols[j(-1,0)]=1; +(j(0,1)+1)?cols[j(0,1)]=1; +(j(0,-1)+1)?cols[j(0,-1)]=1; +find_new_color(); +): +(y==0)?( +(j(0,1)+1)?cols[j(0,1)]=1; +(j(1,0)+1)?cols[j(1,0)]=1; +(j(-1,0)+1)?cols[j(-1,0)]=1; +find_new_color(); +): +(y==my)?( +(j(0,-1)+1)?cols[j(0,-1)]=1; +(j(1,0)+1)?cols[j(1,0)]=1; +(j(-1,0)+1)?cols[j(-1,0)]=1; +find_new_color(); +):( +(j(1,0)+1)?cols[j(1,0)]=1; +(j(-1,0)+1)?cols[j(-1,0)]=1; +(j(0,1)+1)?cols[j(0,1)]=1; +(j(0,-1)+1)?cols[j(0,-1)]=1; +find_new_color(); +); +):-1" +$large_w,$large_h,1,{s#-2+1},*"begin( +const col_s=s#-2; +const border_size=$border_size; +modv(a)=a-int(a/$sqr_size)*$sqr_size; +mini(a)=int(a/$sqr_size); +border_color=["$init_border_color",255]; +empty_color="$empty_color"; +); +nx=modv(x); +ny=modv(y); +mx=mini(x); +my=mini(y); +"$condition_text" +color_pos=i(#-1,mx,my,0,0); +color=(color_pos+1)?[I(#-2,color_pos,0,0),255]:empty_color; +"$result";" +if $use_bg_color +{w#0},{h#0},1,{s#-3+1},"["$bg_color"]" +j[-1] [-2],.5~,.5~ +rv[0,-1] +rm[-3--1] +else +if !$mode +r. {w#0},{h#0},1,100%,0,0,.5,.5 +fi +rv[0,-1] +rm[-2--1] +fi +if $cs +if $cs!=3 +$convert_colors_bwd[0] +else +if s#0==5 +s[0] c,-4 cmyk2rgb[0] a[0,1] c +else +cmyk2rgb[0] +fi +fi +fi +done done +rm. +#@cli rep_compb : eq. to 'rep_complexion_burst' +rep_compb: rep_complexion_burst $* +#@cli rep_complexion_burst: _points>0,_density>0,_H,_K,_zoom,_rotation_angle,_origin_x,_origin_y,_numbers_extraction_mode={ 0=Individual | 1=Additive },_mode={ 0=C-4 | C=C-6},_f1={ 0=csin | 1=ccos | 2=ctan | 3=clog},... +#@cli : Complex-Plane adaptation of the Pickover Popcorn Fractal. Discovered By Reptorian.\n +#@cli : _points defines the maximum number of points to be added on image based on pixel location. +#@cli : _density defines the frequency of points to be added along row and height of image. A value of one implies n points to be added per pixel. +#@cli : _H is the function multiplier used to subtract from the new found values from each iteration. Use "[H_A,H_B]" and replace +#@cli : _K is the inner multiplier for the inside function. Use "[K_A,K_B]" and replace each K_ with a number. See popcorn_x(a,b), and popcorn_y(a,b) embedded within the code of rep_popcorn_fractal for more information. +#@cli : _zoom defines the magnification of image. A negative value will "shrink" the structure of generated fractal. +#@cli : _rotation_angle defines the function angle of fractal. +#@cli : _origin_x defines the position of fractal. Center of image row will be treated as zero, and the ranges for image row are treated as -1,1. +#@cli : _origin_y defines the position of fractal. Center of image column will be treated as zero, and the ranges for image column are treated as -1,1. +#@cli : _mode defines whether to use 4 trigonometric functions or 6 complex-plane trigonometric functions. Each halves of functions are used on 2 functions used by different axis. +#@cli : _fn defines individual function used for the popcorn fractal.\n +#@cli : Author: Reptorian. +#@cli : Default values: '_points=50','density=1','H=[.05,1]','_K=[3,1]','_rotation_angle=0','_origin_x=0','_origin_y=0','_mode=0',...\n +#@cli : \ \ \ \ If _mode=0: ... = '_f1=_f3=0','_f2=_f4=2' +#@cli : \ \ \ \ If _mode=1: ... = '_f1=_f4=0','_f2=_f5=1','_f3=_f6=2'\n +rep_complexion_burst: +skip ${1=50},${2=1},${3=[.05,1]},${4=[3,1]},${5=.25},${6=0},${7=0},${8=0},${9=0},${10=1},${11=0},${12=},${13=},${14=},${15=},${16=},${17=} +if $9 +xnew_text=(plane_a+plane_b)[0] +ynew_text=(plane_a+plane_b)[1] +else +xnew_text=(plane_a)[0] +ynew_text=(plane_b)[1] +fi +if ($6-360*floor($6/360))?1 +fvx=((rot_x($xnew_text,$ynew_text)-osx)*icx_zoom+cxsx)/sx +fvy=((rot_y($xnew_text,$ynew_text)-osy)*icy_zoom+cysy)/sy +else +fvx=(($xnew_text-osx)*icx_zoom+cxsx)/sx +fvy=(($ynew_text-osy)*icy_zoom+cysy)/sy +fi +tmx={w-1} +tmy={h-1} +channels. 0 f. 0 +{int(w*abs($2))},{int(h*abs($2))},1,1,":begin_t( +const max_x=w-1; +const max_y=h-1; +const target_max_x=$tmx; +const target_max_y=$tmy; +const icx=target_max_x/2; +const icy=target_max_y/2; +const pts=$1; +H=$3; +K=$4; +const zoom=1/$5; +const ang=($6/180)*pi; +const origin_x=$7*-1*zoom; +const origin_y=$8*zoom; +const sd=max(w,h)/min(w,h); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +const sx_zoom=sx*zoom; +const sy_zoom=sy*zoom; +const cx=(max_x-1)/2; +const cy=(max_y-1)/2; +const osx=origin_x*sx; +const osy=origin_y*sy; +const icx_zoom=icx/zoom; +const icy_zoom=icy/zoom; +const cxsx=icx*sx; +const cysy=icy*sy; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +$10?( +if(narg($11), +const argpos10=$11%4; +argpos10==0?func_a(a)=csin(a): +argpos10==1?func_a(a)=ccos(a): +argpos10==2?func_a(a)=ctan(a): +argpos10==3?func_a(a)=clog(a); +,func_a(a)=csin(a); +); +if(narg($12), +const argpos11=$12%4; +argpos11==0?func_b(a)=csin(a): +argpos11==1?func_b(a)=ccos(a): +argpos11==2?func_b(a)=ctan(a): +argpos11==3?func_b(a)=clog(a); +,func_b(a)=ccos(a); +); +if(narg($13), +const argpos12=$13%4; +argpos12==0?func_c(a)=csin(a): +argpos12==1?func_c(a)=ccos(a): +argpos12==2?func_c(a)=ctan(a): +argpos12==3?func_c(a)=clog(a); +,func_c(a)=ctan(a); +); +if(!narg($14), +if(narg($11), +argpos10==0?func_d(a)=csin(a): +argpos10==1?func_d(a)=ccos(a): +argpos10==2?func_d(a)=ctan(a): +argpos10==3?func_d(a)=clog(a); +,func_d(a)=csin(a); +);, +const argpos13=$14%4; +argpos13==0?func_d(a)=csin(a): +argpos13==1?func_d(a)=ccos(a): +argpos13==2?func_d(a)=ctan(a): +argpos13==3?func_d(a)=clog(a); +); +if(!narg($15), +if(narg($12), +argpos11==0?func_e(a)=csin(a): +argpos11==1?func_e(a)=ccos(a): +argpos11==2?func_e(a)=ctan(a): +argpos11==3?func_e(a)=clog(a); +,func_e(a)=ccos(a); +);, +const argpos14=$15%4; +argpos14==0?func_e(a)=csin(a): +argpos14==1?func_e(a)=ccos(a): +argpos14==2?func_e(a)=ctan(a): +argpos14==3?func_e(a)=clog(a); +); +if(!narg($16), +if(narg($13), +argpos12==0?func_f(a)=csin(a): +argpos12==1?func_f(a)=ccos(a): +argpos12==2?func_f(a)=ctan(a): +argpos12==3?func_f(a)=clog(a); +,func_f(a)=ctan(a); +);, +const argpos15=$16%4; +argpos15==0?func_f(a)=csin(a): +argpos15==1?func_f(a)=ccos(a): +argpos15==2?func_f(a)=ctan(a): +argpos15==3?func_f(a)=clog(a); +); +popcorn_x(a,b)=(Kb=K**b;a-H**func_a(b+func_b(Kb+func_c(Kb)))); +popcorn_y(a,b)=(Ka=K**a;b-H**func_d(a+func_e(Ka+func_f(Ka)))); +):( +if(narg($11), +const argpos10=$11%4; +argpos10==0?func_a(a)=csin(a): +argpos10==1?func_a(a)=ccos(a): +argpos10==2?func_a(a)=ctan(a): +argpos10==3?func_a(a)=clog(a); +,func_a(a)=csin(a); +); +if(narg($12), +const argpos11=$12%4; +argpos11==0?func_b(a)=csin(a): +argpos11==1?func_b(a)=ccos(a): +argpos11==2?func_b(a)=ctan(a): +argpos11==3?func_b(a)=clog(a); +,func_b(a)=ctan(a); +); +if(!narg($13), +if(narg($11), +argpos10==0?func_c(a)=csin(a): +argpos10==1?func_c(a)=ccos(a): +argpos10==2?func_c(a)=ctan(a): +argpos10==3?func_c(a)=clog(a); +,func_c(a)=csin(a); +);, +const argpos12=$13%4; +argpos12==0?func_c(a)=csin(a): +argpos12==1?func_c(a)=ccos(a): +argpos12==2?func_c(a)=ctan(a): +argpos12==3?func_c(a)=clog(a); +); +if(!narg($14), +if(narg($12), +argpos11==0?func_d(a)=csin(a): +argpos11==1?func_d(a)=ccos(a): +argpos11==2?func_d(a)=ctan(a): +argpos11==3?func_d(a)=clog(a); +,func_d(a)=ctan(a); +);, +const argpos13=$14%4; +argpos13==0?func_d(a)=csin(a): +argpos13==1?func_d(a)=ccos(a): +argpos13==2?func_d(a)=ctan(a): +argpos13==3?func_d(a)=clog(a); +); +popcorn_x(a,b)=a-H**func_a(b+func_b(K**b)); +popcorn_y(a,b)=b-H**func_c(a+func_d(K**a)); +); +); +real=sx_zoom*(x-cx)/cx; +imag=sy_zoom*(y-cy)/cy; +real+=origin_x; +imag+=origin_y; +z_plane_a=[real,0]; +z_plane_b=[0,imag]; +repeat(pts, +plane_a=popcorn_x(z_plane_a,z_plane_b); +plane_b=popcorn_y(z_plane_a,z_plane_b); +zn=sum(sqr((plane_a)[0]),sqr((plane_b)[1])); +plane_a/=zn; +plane_b/=zn; +real_val="$fvx"; +imag_val="$fvy"; +rpos=round(real_val); +ipos=round(imag_val); +i(#-1,rpos,ipos)++; +z_plane_a=plane_a; +z_plane_b=plane_b; +);" +rm. +#@cli rep_rainbowify: -360<_hue_shift<360,-360<_gradient_angle<360,_gradient_scale[%]>0 +#@cli : Apply rainbowify effect into image. Inspired by Rainbowify effect made by Jonathan Frech. The original source of the Rainbowify effect is found in the following URL - https://blog.jfrech.com/180/. +#@cli : Default values: '_hue_shift=0','_gradient_angle=0','_gradient_angle=100%' +#@cli : Author: Reptorian. +rep_rainbowify: +skip ${1=0},${2=0},${3=100%} +foreach { +if s>4 continue fi +if s==4 sh 0,2 fi +if s<3 +command "rainbowify : {w},{h},100%,{s==2?4:3},\"$""1\"" +command "end_out : k." +calc_v="i(#0,x,y,z,0)" +else +command "rainbowify : fill. \"$""1\"" +command "end_out : k[0]" +calc_v=avg(I) +fi +if s==2 calc_rainbow="[hue2rgb(fmod(v+pos+shift_hue)),i(#0,x,y,z,1)]" +else calc_rainbow=hue2rgb(fmod(v+pos+shift_hue)) +fi +rainbowify. "begin( +const shift_hue=$1+180; +const ang=($2/180)*pi; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +rot_y(a,b)=a*sin_ang+b*cos_ang; +const sd=max(w,h)/min(w,h); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +const ww=w-1; +const hh=h-1; +const cx=ww/2; +const cy=hh/2; +const cxsx=cx/sx; +const cysy=cy/sy; +const m=360/255; +const rescale_pos=180*$3; +fmod(a)=a-360*floor(a/360); +hue2rgb(h)=( +H=(h/60)%6; +K=(1-abs(H%2-1))*255; +arg(1+int(H),[255,K,0],[K,255,0],[0,255,K],[0,K,255],[K,0,255],[255,0,K]); +); +); +px=(x-cx)/cxsx; +py=(y-cy)/cysy; +pos=rot_y(px,py)*rescale_pos; +v="$calc_v"*m; +"$calc_rainbow"; +" +end_out +uncommand rainbowify,end_out +} +#@cli rep_w_rgb82gray: eq. to 'rep_weighted_rgb82gray' +rep_w_rgb82gray: rep_weighted_rgb82gray $* +#@cli rep_weighted_rgb82gray: 0%<=red_weight<=100%,0%<=green_weight<=100%,0%<=blue_weight<=100%,_use_weighted_ratio={ 0=no | 1= yes },0<=_minval_weight[%]<=100%,,0<=_maxval_weight[%]<=100%,,0<=_balance_minmax<=1,0<=_endvaladj<=255,-1<=_midgrayadj<=1 +#@cli : Convert images to grayscale image based on different weights, the usage of min/max val, and post-process value adjustment. +#@cli : Default values: '_use_weighted_ratio=1','_minval_weight=0%','_maxval_weight=0%','_balance_minmax=50%','_endvaladj=0','_midgrayadj=0' +#@cli : Author: Reptorian. +#@cli : $ sp car rep_weighted_rgb82gray 10%,50%,70%,,,,,,-.25 +rep_weighted_rgb82gray: +skip ${4=1},${5=0%},${6=0%},${7=50%},${8=0},${9=0} +use_merge_back=0 +single_channel_mode=0 +foreach { +if s==4 +split_opacity +store. alpha_image +use_merge_back=1 +elif s==2 +split_opacity +store. alpha_image +use_merge_back=1 +elif s>4 continue +fi +if s==1 +command "calc_gray_image : fill. \"$""1\"" +single_channel_mode=1 +else +command "calc_gray_image : {w},{h},100%,1,\"$""1\"" +fi +calc_gray_image " +begin( +const red_weight_init=$1; +const green_weight_init=$2; +const blue_weight_init=$3; +const total_weight=red_weight_init+green_weight_init+blue_weight_init; +if($4, +const red_weight=red_weight_init/total_weight; +const green_weight=green_weight_init/total_weight; +const blue_weight=blue_weight_init/total_weight; +, +const red_weight=red_weight_init; +const green_weight=green_weight_init; +const blue_weight=blue_weight_init; +); +rescale_color=[red_weight,green_weight,blue_weight]; +(!$5&&!$6)?( +calc_gray()=sum(I#-1*rescale_color); +): +$5&&$6?( +calc_gray()=( +col_ref=I#-1; +start_col_ref=col_ref*rescale_color; +minval=cut(lerp(sum(start_col_ref),min(col_ref),$5),0,255); +maxval=cut(lerp(sum(start_col_ref),max(col_ref),$6),0,255); +balval=lerp(minval,maxval,$7); +); +):( +$6?( +calc_gray()=( +col_ref=I#-1; +start_col_ref=col_ref*rescale_color; +maxval=cut(lerp(sum(start_col_ref),max(col_ref),$6),0,255); +); +):( +calc_gray()=( +col_ref=I#-1; +start_col_ref=I#-1*rescale_color; +minval=cut(lerp(sum(start_col_ref),min(col_ref),$5),0,255); +); +); +); +abs($9)?( +calc_gray_output()=cut(calc_gray(),0,255); +):( +calc_gray_output()=cut(calc_gray()+$8,0,255); +); +); +calc_gray_output();" +if abs($9) +if $9>0 +f. "begin( +const expf=cut(1-abs($9),0,1); +); +cut(((i/255)^expf)*255+$8,0,255)" +else +f. "begin( +const expf=cut(1-abs($9),0,1); +); +cut(255-(((255-i)/255)^expf)*255+$8,0,255)" +fi +fi +if !$single_channel_mode +k. +if $use_merge_back +$alpha_image a c +fi +fi +use_merge_back=0 +uncommand calc_gray_image +} +#@cli rep_int8args2hexargs: num_of_hexadecimal_numbers_per_values,value_1,value_2,.... +#@cli : Return the hexadecimal representations of numberical arguments. +#@cli : +#@cli : Author: Reptorian. +#@cli : $ echo ${rep_int8args2hexargs\ 3,250,100,220,255,85,110} +#@cli : $ echo ${rep_int8args2hexargs\ 2,250,100,220,255,85,110} +#@cli : $ echo ${rep_int8args2hexargs\ 1,250,100,220,255,85,110} +rep_int8args2hexargs: +check "$#>2&&isint($1)&&$1>0" +number_of_int_args={$#-1} +if $number_of_int_args%$1 error !(narg(\$\{2--1\})%"$"1)==F fi +{($number_of_int_args<<1)+int($number_of_int_args/$1)-1},1,1,1,"begin( +const color_size=$1; +const separator_position=color_size<<1; +const section_size=separator_position+1; +const comma=_','; +const _0=_'0'; +const char_ref_val=_'a'-10; +vints=[${2--1}]; +if(min(vints)<0||max(vints)>0xff,run('error inval_num');); +to_char(v)=if(inrange(v,0,9,1,1),_0+v,char_ref_val+v); +); +color_section=int(x/section_size); +val_pos=x%section_size; +val_pos!=separator_position?( +num_arg_pos=(val_pos>>1)+color_section*color_size; +decimal_number=vints[num_arg_pos]; +val_pos&1?to_char(decimal_number%16):to_char(decimal_number>>4); +):comma; +" +status {t} rm. +#@cli rep_hex2int8: hexadecimal_string +#@cli : Convert a hexadecimal argument into 8-bit representation, and then return the converted value. +#@cli : +#@cli : Author: Reptorian. +rep_hex2int8: +strlowercase $1 +('${}') +if (w&1) error is_even(str_size)==F fi +{w>>1},1,1,1,"begin( +const _0=_'0'; +const _9=_'9'; +const char_ref_val=_'a'-10; +from_char(v)=if(inrange(v,_0,_9,1,1),v-_0,v-char_ref_val); +); +p=x*2; +from_char(i(#-1,p))*16+from_char(i(#-1,p+1));" +u {crop(#-1)} rm[-2,-1] +#@cli rep_int82hex: 0<=8-bit_value<=255... +#@cli : Convert 8-bit numberical argument(s) into hexadecimal representation. +#@cli : +#@cli : Author: Reptorian. +rep_int82hex: +{narg($*)<<1},1,1,1,"begin( +const _0=_'0'; +const char_ref_val=_'a'-10; +vchar=[$*]; +if(min(vchar)<0||max(vchar)>255,run('error invalid_number');); +to_char(v)=if(inrange(v,0,9,1,1),_0+v,char_ref_val+v); +); +p=x>>1; +x&1?( +to_char(vchar[p]%16); +):( +to_char(vchar[p]>>4); +);" +u {t} rm. +#@cli rep_mlfrac_anim: eq. to 'rep_markus_lyapunov_fractal_animation +rep_mlfrac_anim: rep_markus_lyapunov_fractal_animation $* +#@cli rep_markus_lyapunov_fractal_animation: abc_string,abc_string_repeats,_sublevel>=0,0%<_view_size[%]<=100%,0%<=_pos_x[%]<=100%,0%<=_pos_y[%]<=100%,0%<=_pos_z_a[%]<=100%,0%<=_pos_z_b[%]<=100%,additional_arguments(see below) +#@cli : Generate an animation of Markus-Lyapunov Fractal or in other words, creates an animation demonstrating mapping of Lyapunov exponent within three values. Each frame represent a cross-section of a 3D Markus-Lyapunov Fractal. +#@cli : +#@cli : [1] http://charles.vassallo.pagesperso-orange.fr/en/lyap_art/lyapdoc.html +#@cli : +#@cli : (eq. to 'rep_mlfrac_anim') +#@cli : Note: Input for abc_string is case-insensitive. Only valid characters are A,a,B,b,C,c. +#@cli : Additional note: Depth of target image defines number of frames. +#@cli : +#@cli : --- Information on 'additional_arguments' --- +#@cli : The following set of arguments are accepted as additional arguments for the command: +#@cli : +#@cli : 1 - use_inversion={ 0=do_not_use_inversion | 1=use_inversion } +#@cli : 2* - hex_color_a,hex_color_b +#@cli : 3** - 'u',color_count>0,color_space={ 0=hsl | 1=lab | 2=lch } +#@cli : 4** - 'u','u',n_colors_a>0,n_colors_b>0,cs={ 0=hsl | 1=lab | 2=lch } +#@cli : 5*** - [image],order={ 0=default | 1=random | 2=mirrored },color_count +#@cli : 6*** - [image],[image],order_a={ 0=default | 1=random | 2=mirrored },use_randomize_b={ 0=default | 1=random | 2=mirrored },color_count_a,color_count_b +#@cli : +#@cli : * = No special characters or space! Only 0-9 and a-f case-insensitive. +#@cli : ** = 'u' means that the input you assigned is exactly 'u'. +#@cli : *** = If you assign a image with width and height both larger than 1, then you need to assign color_count in the respective place. use_randomize is used to randomize the colors in palette. +#@cli : +#@cli : Notes: See examples for usage of these additional variables. +#@cli : +#@cli : --- End of Information on 'additional_arguments' --- +#@cli : Default values: '_sublevel=1','_view_size=100%','_pos_x=50%','_pos_y=50%' +#@cli : +#@cli : Author: Reptorian. +#@cli : $ 50,50,50 rep_markus_lyapunov_fractal_animation abc,50,.5,100%,50%,50%,0%,100%,1 +#@cli : $ 50,50,50 rep_markus_lyapunov_fractal_animation abc,50,.5,100%,50%,50%,0%,100%,0000ff,ffff00 +#@cli : $ 50,50,50 rep_markus_lyapunov_fractal_animation abc,50,.5,100%,50%,50%,0%,100%,u,8,1 +#@cli : $ 50,50,50 rep_markus_lyapunov_fractal_animation abc,50,.5,100%,50%,50%,0%,100%,u,u,5,8,2 +#@cli : $ 50,50,50 +pal 71 rep_markus_lyapunov_fractal_animation[0] abc,50,.5,100%,50%,50%,0%,100%,[1],0 rm. +#@cli : $ 50,50,50 +pal 20 +pal 50 rep_markus_lyapunov_fractal_animation[0] abc,50,.5,100%,50%,50%,0%,100%,[1],[2],0,0 rm[-2,-1] +#@cli : $ 50,50,50 sp cat rep_markus_lyapunov_fractal_animation[0] abc,50,.5,100%,50%,50%,0%,100%,[1],0,9 rm. +#@cli : $ 50,50,50 sp cat sp lena rep_markus_lyapunov_fractal_animation[0] abc,50,.5,100%,50%,50%,0%,100%,[-2],[-1],1,1,8,8 rm[-2,-1] +rep_markus_lyapunov_fractal_animation: +skip "${3=1}","${4=100%}","${5=50%}","${6=50%}","${7=0%}","${8=100%}","${9=0}","${10=}","${11=}","${12=}","${13=}","${14=}" +check (abs($4)!=0)&&($!==1)&&(w#-1>1&&h#-1>1&&d#-1>1) +strlowercase $1 +ab_string=${} +a:=_'a' +('$ab_string') -. $a +include_a,include_b,include_c={[im==0,find(crop(#-1),1,0,1)!=-1,iM==2]} +if im#-1<0||iM#-1>2 error invalid_char_found! fi +if !($include_a&&$include_b&&$include_c) error invalid_string fi +ab_string={crop(#-1)} +rm. +mode,use_double_u,use_hex_mode,sub=0,{abs($3)+1} +ow,oh,od,nw,nh={[w,h,d,round([w,h]*$sub)]} +if narg($9)||narg($10) +if ${is_image_arg\ $9} mode+=1 +pass$9 0 +fi +if ${is_image_arg\ $10} mode+=1 +pass$10 0 +fi +if $mode==2 +if w#-2>1&&h#-2>1 +colormap.. $13 +if ($11%3)==1 +{w#-2},1,1,1,u(0,1) +pixelsort... +,x,[-1] +rm. +elif ($11%3)==2 +mirror.. x +fi +find_color_a=I(#-1,lyapunov_surface/minv*v_length_b,0,0,1); +else +if w#-2>1 +if ($11%3)==1 +{w#-2},1,1,1,u(0,1) +pixelsort... +,x,[-1] +rm. +elif ($11%3)==2 +mirror.. x +fi +find_color_a=I(#-1,lyapunov_surface/minv*v_length_b,0,0,1); +else +if ($11%3)==1 +1,{h#-2},1,1,u(0,1) +pixelsort... +,y,[-1] +rm. +elif ($11%3)==2 +mirror.. y +fi +find_color_a=I(#-1,0,lyapunov_surface/minv*v_length_b,0,1); +fi +fi +if w#-1>1&&h#-1>1 +colormap. $14 +if ($12%3)==1 +{w},1,1,1,u(0,1) +pixelsort.. +,x,[-1] +rm. +elif ($12%3)==2 +mirror. x +fi +find_color_b=I(#-2,lyapunov_surface/maxv*v_length_a,0,0,1); +else +if w#-1>1 +if ($12%3)==1 +{w},1,1,1,u(0,1) +pixelsort.. +,x,[-1] +rm. +elif ($12%3)==2 +mirror. x +fi +find_color_b=I(#-2,lyapunov_surface/maxv*v_length_a,0,0,1); +else +if ($12%3)==1 +1,{h},1,1,u(0,1) +pixelsort.. +,y,[-1] +rm. +elif ($12%3)==2 +mirror. y +fi +find_color_b=I(#-2,0,lyapunov_surface/maxv*v_length_a,0,1); +fi +fi +store. ref_colors_b +store. ref_colors_a +elif $mode==1 +if w>1&&h>1 +colormap. $11 +if ($10%3)==1 +{w},1,1,1,u(0,1) +pixelsort.. +,x,[-1] +rm. +elif ($10%3)==2 +mirror. x +fi +find_color_a=I(#-1,lyapunov_surface,0,0,1) +else +if w>1 +if ($10%3)==1 +{w},1,1,1,u(0,1) +pixelsort.. +,x,[-1] +rm. +elif ($10%3)==2 +mirror. x +fi +find_color_a=I(#-1,lyapunov_surface,0,0,1) +else +if ($10%3)==1 +1,{h},1,1,u(0,1) +pixelsort.. +,y,[-1] +rm. +elif ($10%3)==2 +mirror. y +fi +find_color_a=I(#-1,0,lyapunov_surface,0,1) +fi +fi +store. ref_gradient +else +if ('$9'=='u')&&('$10'=='u') +mode=3 +use_double_u=1 +if narg($11)&&narg($12) +if narg($13) +if ($13%3)==2 command "cs_out: lch82rgb" +elif ($13%3)==1 command "cs_out: lab82rgb" +else command "cs_out: hsl82rgb" +fi +else command "cs_out: hsl82rgb" +fi +$11,1,1,3,u(0,255) +$12,1,1,3,u(0,255) +store. ref_rand_col_a +store. ref_rand_col_b +else error needs size_arg +fi +else +if ('$9'=='u')||('$10'=='u') +mode=3 +if narg($11) +if ($11%3)==2 command "cs_out: lch82rgb" +elif ($11%3)==1 command "cs_out: lab82rgb" +else command "cs_out: hsl82rgb" +fi +else command "cs_out: hsl82rgb" +fi +if narg($12) srand $12 fi +if '$9'=='u' +$10,1,1,3,u(0,255) +store. ref_colors +else +$9,1,1,3,u(0,255) +store. ref_colors +fi +else +if (!(size('$9')%2))&&(!(size('$10')%2)) +use_hex_mode=1 +hex_color_a=${rep_hex2int8\ $9} +hex_color_b=${rep_hex2int8\ $10} +fi +fi +fi +fi +fi +out_lyapunov=limit +if !$mode&&!$use_hex_mode if $9 out_lyapunov=-limit fi fi +$nw,$nh,100%,1,":begin( +const sqr_size=cut(abs($4),0,1); +const gap=1-sqr_size; +const px=cut($5,0,1)*gap; +const py=cut($6,0,1)*gap; +const pz_a_init=cut($7,0,1); +const pz_b_init=cut($8,0,1); +const pz_a=min(pz_a_init,pz_b_init)*2+2; +const pz_b=max(pz_a_init,pz_b_init)*2+2; +const lx=px*2+2; +const ly=py*2+2; +const rx=(px+sqr_size)*2+2; +const ry=(py+sqr_size)*2+2; +const inc_w=w+1; +const inc_h=h+1; +const inc_d=d+1; +v_sequence=["$ab_string"]; +const seqsize=size(v_sequence); +const vsize=round(max(1,abs($2))*seqsize); +); +ix=lerp(lx,rx,(x+1)/inc_w); +iy=lerp(ry,ly,(y+1)/inc_h); +iz=lerp(pz_a,pz_b,(z+1)/inc_d); +vn=0.5; +limit=0; +repeat(vsize,n, +sp = n % seqsize; +rn=arg(v_sequence[sp]+1,ix,iy,iz); +vn=rn*vn*(1-vn); +limit+=log(abs(rn*(1-2*vn))); +); +"$out_lyapunov"; +" +if $mode==3 +if $use_double_u +$ref_rand_col_a +$ref_rand_col_b +$nw,$nh,$od,3,"begin_t( +const minv=im#-3; +const maxv=iM#-3; +const ww_a=w#-2-1; +const ww_b=w#-1-1; +); +lyapunov_surface=i0#-3; +use_b=lyapunov_surface>=0; +use_b?(I(#-1,lyapunov_surface/maxv*ww_b,0,0,1);) +:(I(#-2,lyapunov_surface/minv*ww_a,0,0,1););" +cs_out. +else +$ref_colors +$nw,$nh,$od,3,"begin( +const minv=im#-2; +const maxv=iM#-2; +const vs=w#-1-1; +const diff=(maxv-minv)/vs; +); +lyapunov_surface=(i0#-2-minv)/diff; +I(#-1,lyapunov_surface,0,0,1);" +cs_out. +fi +elif $mode==2 +$ref_colors_a +$ref_colors_b +$nw,$nh,$od,{max(s#-2,s#-1)},"begin_t( +const minv=im#-3; +const maxv=iM#-3; +const v_length_a=max(w#-2-1,h#-2-1); +const v_length_b=max(w#-1-1,h#-2,-1); +); +lyapunov_surface=i0#-3; +use_b=lyapunov_surface>=0; +use_b?("$find_color_b") +:("$find_color_a");" +elif $mode==1 +$ref_gradient +$nw,$nh,$od,{s#-1},"begin_t( +const minv=im#-2; +const maxv=iM#-2; +const v_length=max(w#-1-1,h#-1-1); +const diff=(maxv-minv)/v_length; +); +lyapunov_surface=(i0#-2-minv)/diff; +"$find_color_a";" +elif $use_hex_mode +$nw,$nh,$od,3,"begin_t( +hex_a=["$hex_color_a"]; +hex_b=["$hex_color_b"]; +const minv=im#-1; +const maxv=iM#-1; +const hpi=pi/2; +contrast(a)=( +b=a*pi-hpi; +.5*a^2+.5*(sin(b)+1)/2; +); +); +v=i0#-1; +shade=v>=0?v/maxv:contrast((1-(v/minv)^(1/2)))^2; +col=v>=0?hex_a:hex_b; +col*shade;" +fi +k. +s z r $ow,$oh,1,100%,6 +uncommand cs_out +#@cli rep_mlfrac: eq. to 'rep_markus_lyapunov_fractal +rep_mlfrac: rep_markus_lyapunov_fractal $* +#@cli rep_markus_lyapunov_fractal: abc_string,abc_string_repeats,_sublevel>=0,0%<_view_size[%]<=100%,0%<=_pos_x[%]<=100%,0%<=_pos_y[%]<=100%,0%<=_pos_z[%]<=100%,additional_arguments(see below) +#@cli : Generate Markus-Lyapunov Fractal or in other words, creates a mapping of Lyapunov exponent within two or three values.[1] Discovered by Mario Markus of the Max Planck Institute for Nutrition. Alexander Lyapunov was the one that discovered Lyapunov exponent. +#@cli : +#@cli : [1] http://charles.vassallo.pagesperso-orange.fr/en/lyap_art/lyapdoc.html +#@cli : +#@cli : (eq. to 'rep_mlfrac') +#@cli : Note: Input for abc_string is case-insensitive. Only valid characters are A,a,B,b,C,c. +#@cli : +#@cli : --- Information on 'additional_arguments' --- +#@cli : The following set of arguments are accepted as additional arguments for the command: +#@cli : +#@cli : 1 - use_inversion={ 0=do_not_use_inversion | 1=use_inversion } +#@cli : 2* - hex_color_a,hex_color_b +#@cli : 3** - 'u',color_count>0,color_space={ 0=hsl | 1=lab | 2=lch } +#@cli : 4** - 'u','u',n_colors_a>0,n_colors_b>0,cs={ 0=hsl | 1=lab | 2=lch } +#@cli : 5*** - [image],order={ 0=default | 1=random | 2=mirrored },color_count +#@cli : 6*** - [image],[image],order_a={ 0=default | 1=random | 2=mirrored },use_randomize_b={ 0=default | 1=random | 2=mirrored },color_count_a,color_count_b +#@cli : +#@cli : * = No special characters or space! Only 0-9 and a-f case-insensitive. +#@cli : ** = 'u' means that the input you assigned is exactly 'u'. +#@cli : *** = If you assign a image with width and height both larger than 1, then you need to assign color_count in the respective place. use_randomize is used to randomize the colors in palette. +#@cli : +#@cli : Notes: See examples for usage of these additional variables. +#@cli : +#@cli : --- End of Information on 'additional_arguments' --- +#@cli : Default values: '_sublevel=1','_view_size=100%','_pos_x=50%','_pos_y=50%' +#@cli : +#@cli : Author: Reptorian. +#@cli : $ 500,500 rep_markus_lyapunov_fractal ab,50,3,100%,50%,50%,50%,1 +#@cli : $ 500,500 rep_markus_lyapunov_fractal ab,50,3,100%,50%,50%,50%,0000ff,ffff00 +#@cli : $ 500,500 rep_markus_lyapunov_fractal ab,50,3,100%,50%,50%,50%,u,8,1 +#@cli : $ 500,500 rep_markus_lyapunov_fractal ab,50,3,100%,50%,50%,50%,u,u,5,8,2 +#@cli : $ 500,500 +pal 71 rep_markus_lyapunov_fractal[0] ab,50,3,100%,50%,50%,50%,[1],0 rm. +#@cli : $ 500,500 +pal 20 +pal 50 rep_markus_lyapunov_fractal[0] ab,50,3,100%,50%,50%,50%,[1],[2],0,0 rm[-2,-1] +#@cli : $ 500,500 sp cat rep_markus_lyapunov_fractal[0] ab,50,3,100%,50%,50%,50%,[1],0,9 rm. +#@cli : $ 500,500 sp cat sp lena rep_markus_lyapunov_fractal[0] ab,50,3,100%,50%,50%,50%,[-2],[-1],1,1,8,8 rm[-2,-1] +rep_markus_lyapunov_fractal: +skip "${3=1}","${4=100%}","${5=50%}","${6=50%}","${7=50%}","${8=0}","${9=}","${10=}","${11=}","${12=}","${13=}" +check "abs($4)!=0" +strlowercase $1 +ab_string=${} +a:=_'a' +('$ab_string') -. $a +if im#<0||iM#>2 error invalid_char_found! fi +include_a,include_b,include_c={[im==0,find(crop(#-1),1,0,1)!=-1,iM==2]} +case_d1,case_dn={[!($include_a&&$include_b),!(!$case_d1&&$include_c)]} +ab_string={crop(#-1)} +rm. +mode,use_double_u,use_hex_mode,sub=0,{abs($3)+1} +if narg($8)||narg($9) +if ${is_image_arg\ $8} mode+=1 +pass$8 0 +fi +if ${is_image_arg\ $9} mode+=1 +pass$9 0 +fi +if $mode==2 +if w#-2>1&&h#-2>1 +colormap.. $12 +if ($10%3)==1 +{w#-2},1,1,1,u(0,1) +pixelsort... +,x,[-1] +rm. +elif ($10%3)==2 +mirror.. x +fi +find_color_a=I(#-1,lyapunov_surface/minv*v_length_b,0,0,1); +else +if w#-2>1 +if ($10%3)==1 +{w#-2},1,1,1,u(0,1) +pixelsort... +,x,[-1] +rm. +elif ($10%3)==2 +mirror.. x +fi +find_color_a=I(#-1,lyapunov_surface/minv*v_length_b,0,0,1); +else +if ($10%3)==1 +1,{h#-2},1,1,u(0,1) +pixelsort... +,y,[-1] +rm. +elif ($10%3)==2 +mirror.. y +fi +find_color_a=I(#-1,0,lyapunov_surface/minv*v_length_b,0,1); +fi +fi +if w#-1>1&&h#-1>1 +colormap. $13 +if ($11%3)==1 +{w},1,1,1,u(0,1) +pixelsort.. +,x,[-1] +rm. +elif ($11%3)==2 +mirror. x +fi +find_color_b=I(#-2,lyapunov_surface/maxv*v_length_a,0,0,1); +else +if w#-1>1 +if ($11%3)==1 +{w},1,1,1,u(0,1) +pixelsort.. +,x,[-1] +rm. +elif ($11%3)==2 +mirror. x +fi +find_color_b=I(#-2,lyapunov_surface/maxv*v_length_a,0,0,1); +else +if ($11%3)==1 +1,{h},1,1,u(0,1) +pixelsort.. +,y,[-1] +rm. +elif ($11%3)==2 +mirror. y +fi +find_color_b=I(#-2,0,lyapunov_surface/maxv*v_length_a,0,1); +fi +fi +store. ref_colors_b +store. ref_colors_a +elif $mode==1 +if w>1&&h>1 +colormap. $10 +if ($9%3)==1 +{w},1,1,1,u(0,1) +pixelsort.. +,x,[-1] +rm. +elif ($9%3)==2 +mirror. x +fi +find_color_a=I(#-1,lyapunov_surface,0,0,1) +else +if w>1 +if ($9%3)==1 +{w},1,1,1,u(0,1) +pixelsort.. +,x,[-1] +rm. +elif ($9%3)==2 +mirror. x +fi +find_color_a=I(#-1,lyapunov_surface,0,0,1) +else +if ($9%3)==1 +1,{h},1,1,u(0,1) +pixelsort.. +,y,[-1] +rm. +elif ($9%3)==2 +mirror. y +fi +find_color_a=I(#-1,0,lyapunov_surface,0,1) +fi +fi +store. ref_gradient +else +if ('$8'=='u')&&('$9'=='u') +mode=3 +use_double_u=1 +if narg($10)&&narg($11) +if narg($12) +if ($12%3)==2 command "cs_out: lch82rgb" +elif ($12%3)==1 command "cs_out: lab82rgb" +else command "cs_out: hsl82rgb" +fi +else command "cs_out: hsl82rgb" +fi +$10,1,1,3,u(0,255) +$11,1,1,3,u(0,255) +store. ref_rand_col_a +store. ref_rand_col_b +else error needs size_arg +fi +else +if ('$8'=='u')||('$9'=='u') +mode=3 +if narg($10) +if ($10%3)==2 command "cs_out: lch82rgb" +elif ($10%3)==1 command "cs_out: lab82rgb" +else command "cs_out: hsl82rgb" +fi +else command "cs_out: hsl82rgb" +fi +if narg($11) srand $11 fi +if '$8'=='u' +$9,1,1,3,u(0,255) +store. ref_colors +else +$8,1,1,3,u(0,255) +store. ref_colors +fi +else +if (!(size('$8')%2))&&(!(size('$9')%2)) +use_hex_mode=1 +hex_color_a=${rep_hex2int8\ $8} +hex_color_b=${rep_hex2int8\ $9} +fi +fi +fi +fi +fi +out_lyapunov=limit +if !$mode&&!$use_hex_mode if $8 out_lyapunov=-limit fi fi +foreach { +ow,oh,od={[w,h,d]} +nw,nh={round([w,h]*$sub)} +nd={d>1?d*$sub:1} +if d>1 +if $case_dn error "At least one of the abc character is not found!" fi +pz_text="const pz=cut($7,0,1)*gap;" +lz_text="const lz=pz*2+2;" +rz_text="const rz=(pz+sqr_size)*2+2;" +inc_d="const inc_d=d+1;" +calc_iz_text="iz=lerp(lz,rz,(z+1)/inc_d);" +else +if $case_d1 error "At least one of the ab character is not found!" fi +const_iz_text="const iz=lerp(2+1/(max(w,h,d)+1),2+max(w,h,d)/(max(w,h,d)+1)*2,$7);" +fi +$nw,$nh,$nd,1,":begin_t( +const sqr_size=cut(abs($4),0,1); +const gap=1-sqr_size; +const px=cut($5,0,1)*gap; +const py=cut($6,0,1)*gap; +"$pz_text" +const lx=px*2+2; +const ly=py*2+2; +"$lz_text" +const rx=(px+sqr_size)*2+2; +const ry=(py+sqr_size)*2+2; +"$rz_text" +const inc_w=w+1; +const inc_h=h+1; +"$inc_d" +"$const_iz_text" +v_sequence=["$ab_string"]; +const seqsize=size(v_sequence); +const vsize=round(max(1,abs($2))*seqsize); +); +ix=lerp(lx,rx,(x+1)/inc_w); +iy=lerp(ry,ly,(y+1)/inc_h); +"$calc_iz_text" +vn=0.5; +limit=0; +repeat(vsize,n, +sp = n % seqsize; +rn=arg(v_sequence[sp]+1,ix,iy,iz); +vn=rn*vn*(1-vn); +limit+=log(abs(rn*(1-2*vn))); +); +"$out_lyapunov"; +" +if $mode==3 +if $use_double_u +$ref_rand_col_a +$ref_rand_col_b +$nw,$nh,$nd,3,"begin_t( +const minv=im#-3; +const maxv=iM#-3; +const ww_a=w#-2-1; +const ww_b=w#-1-1; +); +lyapunov_surface=i0#-3; +use_b=lyapunov_surface>=0; +use_b?(I(#-1,lyapunov_surface/maxv*ww_b,0,0,1);) +:(I(#-2,lyapunov_surface/minv*ww_a,0,0,1);); +" +cs_out. +else +$ref_colors +$nw,$nh,$nd,3,"begin( +const minv=im#-2; +const maxv=iM#-2; +const vs=w#-1-1; +const diff=(maxv-minv)/vs; +); +lyapunov_surface=(i0#-2-minv)/diff; +I(#-1,lyapunov_surface,0,0,1); +" +cs_out. +fi +elif $mode==2 +$ref_colors_a +$ref_colors_b +$nw,$nh,$nd,{max(s#-2,s#-1)},"begin_t( +const minv=im#-3; +const maxv=iM#-3; +const v_length_a=max(w#-2-1,h#-2-1); +const v_length_b=max(w#-1-1,h#-2,-1); +); +lyapunov_surface=i0#-3; +use_b=lyapunov_surface>=0; +use_b?("$find_color_b") +:("$find_color_a"); +" +elif $mode==1 +$ref_gradient +$nw,$nh,$nd,{s#-1},"begin_t( +const minv=im#-2; +const maxv=iM#-2; +const v_length=max(w#-1-1,h#-1-1); +const diff=(maxv-minv)/v_length; +); +lyapunov_surface=(i0#-2-minv)/diff; +"$find_color_a"; +" +elif $use_hex_mode +$nw,$nh,$nd,3,"begin_t( +hex_a=["$hex_color_a"]; +hex_b=["$hex_color_b"]; +const minv=im#-1; +const maxv=iM#-1; +const hpi=pi/2; +contrast(a)=( +b=a*pi-hpi; +.5*a^2+.5*(sin(b)+1)/2; +); +); +v=i0#-1; +shade=v>=0?v/maxv:contrast((1-(v/minv)^(1/2)))^2; +col=v>=0?hex_a:hex_b; +col*shade; +" +fi +r. $ow,$oh,$od,100%,6 +k. +pz_text="" +lz_text="" +rz_text="" +inc_d="" +calc_iz_text="" +const_iz_text="" +} +uncommand cs_out +status {$include_c+1} +#@cli rep_randgradbar : eq. to 'rep_random_gradient_bars' +rep_randgradbar:rep_random_gradient_bars $* +#@cli rep_random_gradient_bars: width>0,spacing>0,-360<=_angle<=360,-90<_skew_angle<90,-1<=_pos_x<=1,-1<=_pos_y<=1,_sublevel>=0,_gradient_shift,_gradient_mul_a,gradient_mul_b,_bar_modulo={ -1=random | 0=cut | 1=periodic | 2=continuous },_random_modulo_out={ 0=cut_and_periodic | 1=cut_and_continuous | 2=periodic_and_continuous },_gradient_color={ 0=B&W | 1=Duotone | 2=Rand-RGB | 3=Rand-HSV },_space_color={ 0=Alpha | 1=Binary Duotone | 2=Gradient Duotone },_symmetry_mode={ 0=none | 1=sym_a | 2=sym_b },_inversion_mode={ 0=n/a | 1=random-inverse | 2=complete-inverse},_bar_hex_rgb_color_a,_bar_hex_rgb_color_b : width>0,spacing>0,-360<=_angle<=360,-90<_skew_angle<90,-1<=_pos_x<=1,-1<=_pos_y<=1,_sublevel>=0,_gradient_shift,_gradient_mul_a,gradient_mul_b,_bar_modulo={ -1=random | 0=cut | 1=periodic | 2=continuous },_random_modulo_out={ 0=cut_and_periodic | 1=cut_and_continuous | 2=periodic_and_continuous },_gradient_color={ 0=B&W | 1=Duotone | 2=Rand-RGB | 3=Rand-HSV },_space_color={ 0=Alpha | 1=Binary Duotone | 2=Gradient Duotone },_symmetry_mode={ 0=none | 1=sym_a | 2=sym_b },_inversion_mode={ 0=n/a | 1=random-inverse | 2=complete-inverse},red_1,green_1,blue_1,red_2,green_2,blue_3 +#@cli : Create image filled with random bars. +#@cli : +#@cli : (eq. to 'rep_randgradbar') +rep_random_gradient_bars: +skip ${3=0},${4=0},${5=0},${6=0},${7=1},${8=0},${9=1},${10=100},${11=-1},${12=},${13=0},${14=0},${15=0},${16=0},${17=000000},${18=ffffff} +check "(abs($4)<90)&&((narg($*)==22)||(narg($*)==18))" +sub={abs($7)+1} +if narg(${17--1})==2 +color_a=${rep_hex2int8\ $17} +color_b=${rep_hex2int8\ $18} +else +color_a=${17-19} +color_b=${20-22} +fi +foreach { +ow,oh={[w,h]} +{w*$sub},{h*$sub},1,{$13?4:2},"*begin( +const ww=w-1; +const hh=h-1; +const sd=max(ww,hh)/min(ww,hh); +const sx=ww>hh?sd:1; +const sy=ww>hh?1:sd; +eucl_norm(a,b)=sqrt(a^2+b^2); +const diag_img=eucl_norm(ww,hh); +const ww_div_sx=ww/sx; +const hh_div_sy=hh/sy; +const cx=ww/2; +const cy=hh/2; +const ox=cx-(ww*-$5); +const oy=cy-(hh*$6); +const skew_ang=-($4/180)*pi; +const mdist=tan(skew_ang)*diag_img; +const ang=-($3/180)*pi; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +const cut_ang=atan2(cy,cx); +const cut_ang2=pi-cut_ang; +const symmetry_mode=$15%3; +const inversion_mode=($16+2)%3; +"${is_percent\ $1}"?( +const bar_width=max($sub,round((abs($1)*diag_img/4))); +):( +const bar_width=max($sub,round(abs($1)*$sub)); +); +"${is_percent\ $2}"?( +const space_width=abs($2)>0?max($sub,round((abs($2)*diag_img/4))); +):( +const space_width=round(abs($2)*$sub); +); +const total_width=bar_width+space_width; +const half_total_width=total_width>1?int(total_width/2); +(bar_width==1&&space_width<2)?( +const spacing=space_width>0?.5:0; +abs(space_width)?(calc_spacing()=int(point_x)%2?1;):(calc_spacing()=1;); +):( +const spacing=1-(space_width/(total_width-1)); +calc_spacing()=abs(1-fmod(point_x,total_width)/total_width-.5)*2<=spacing; +); +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +fmod(a,b)=a-b*floor(a/b); +fmod_cont(a,b)=floor(a/b)%2?b-fmod(a,b):fmod(a,b); +fcut(a,b)=(cut(a,-b,b)+b)/2; +const number_of_bars=ceil(eucl_norm(ww,hh)/total_width); +const shift_bars=int(number_of_bars/2); +symmetry_mode==1?(calc_bar()=(-1*abs(floor(point_x/total_width))+shift_bars)%number_of_bars;): +symmetry_mode==2?(calc_bar()=(abs(floor(point_x/total_width))+shift_bars)%number_of_bars;): +(calc_bar()=(floor(point_x/total_width)+shift_bars)%number_of_bars;); +v_mult=expr('u($9,$10)',number_of_bars,1,1,1); +$8!=0?v_shift=expr('u(-$8,$8)',number_of_bars,1,1,1):v_shift=vectornumber_of_bars(0); +v_use_invert=expr('round(u(0,1))',number_of_bars,1,1,1); +inversion_mode==1?(v_use_invert=vectornumber_of_bars(0);):( +inversion_mode==2?(v_use_invert=vectornumber_of_bars(1););); +const use_only_one_mode=$11>=0; +use_only_one_mode?( +const modulo_out=$11%3; +v_modulo_mode=vectornumber_of_bars(modulo_out); +):( +narg($12)?( +const modulo_out=$12%3; +modulo_out==0?(v_modulo_mode=expr('round(u(0,1))',number_of_bars,1,1,1);): +modulo_out==1?(v_modulo_mode=expr('round(u(0,1))*2',number_of_bars,1,1,1);): +(v_modulo_mode=expr('round(u(0,1))+1',number_of_bars,1,1,1);); +):( +v_modulo_mode=expr('round(u(0,2))',number_of_bars,1,1,1); +); +); +rgb2hsv(a)=( +R=a[0]; +G=a[1]; +B=a[2]; +M = max(R,G,B); +C = M - min(R,G,B); +H = 60*(C==0?0:M==R?((G - B)/C)%6:M==G?(B - R)/C + 2:(R - G)/C + 4); +S = M<=0?0:C/M; +[H,S,M/255]; +); +($14||$13==1)?( +color_a=["$color_a"]; +color_b=["$color_b"]; +$13==3?( +color_a=rgb2hsv(color_a); +color_b=rgb2hsv(color_b); +); +); +const bc=$13%4; +const sc=$14%3; +bc==3?( +v_hue=expr('u(0,360,1,0)',number_of_bars,1,1,1); +sc==2?( +calc_gradient()=spaces?[v_hue[bar],1,final_gradient,255]:[lerp(color_b,color_a,cut(gradient*2+.5,0,1)),255]; +): +sc==1?( +calc_gradient()=spaces?[v_hue[bar],1,final_gradient,255]:[gradient>=0?color_a:color_b,255]; +):( +calc_gradient()=[v_hue[bar],1,final_gradient,255*spaces]; +); +): +bc==2?( +v_rgb_r=expr('u(0,255)',number_of_bars,1,1,1); +v_rgb_g=expr('u(0,255)',number_of_bars,1,1,1); +v_rgb_b=expr('u(0,255)',number_of_bars,1,1,1); +sc==2?( +calc_gradient()=spaces?[final_gradient*v_rgb_r[bar],final_gradient*v_rgb_g[bar],final_gradient*v_rgb_b[bar],255]:[lerp(color_b,color_a,cut(gradient*2+.5,0,1)),255]; +): +sc==1?( +calc_gradient()=spaces?[final_gradient*v_rgb_r[bar],final_gradient*v_rgb_g[bar],final_gradient*v_rgb_b[bar],255]:[gradient>=0?color_a:color_b,255]; +):( +calc_gradient()=[final_gradient*v_rgb_r[bar],final_gradient*v_rgb_g[bar],final_gradient*v_rgb_b[bar],255*spaces]; +); +): +bc==1?( +sc==2?( +calc_gradient()=spaces?[lerp(color_a,color_b,final_gradient),255]:[lerp(color_b,color_a,cut(gradient*2+.5,0,1)),255]; +): +sc==1?( +calc_gradient()=spaces?[lerp(color_a,color_b,final_gradient),255]:[gradient>=0?color_a:color_b,255]; +):( +calc_gradient()=[lerp(color_a,color_b,final_gradient),255*spaces]; +); +):( +sc==2?( +calc_gradient()=spaces?[final_gradient,255]:[cut(gradient*2+.5,0,1),255]; +): +sc==1?( +calc_gradient()=spaces?[final_gradient,255]:[gradient>=0,255] +):( +calc_gradient()=[final_gradient,255*spaces]; +); +); +); +initial_x=(x-ox)/ww*sx; +initial_y=(y-oy)/hh*sy; +gradient=-rot_y(initial_x,initial_y)*hh_div_sy/diag_img; +point_x=rot_x(initial_x,initial_y)*ww_div_sx+gradient*mdist+half_total_width; +bar=calc_bar(); +spaces=calc_spacing(); +new_gradient=gradient*v_mult[bar]+v_shift[bar]; +use_modulo_out=v_modulo_mode[bar]; +use_modulo_out==2?(final_gradient=v_use_invert[bar]?1-fmod_cont(new_gradient,1):fmod_cont(new_gradient,1);): +use_modulo_out==1?(final_gradient=v_use_invert[bar]?1-fmod(new_gradient,1):fmod(new_gradient,1);): +(final_gradient=v_use_invert[bar]?1-fcut(new_gradient,1):fcut(new_gradient,1);); +calc_gradient();" +rm.. +if $13==3 hsv2rgb. fi +if $sub!=1 r. $ow,$oh,100%,100%,5 fi +} +#@cli rep_skew: angle,-100%<=_position_skew[%]<=100%,_axis={x|y|z},_boundary={0= 0=dirichlet | 1=neummann | 2=periodic | 3=mirror},_interpolation={ 0=nearest | 1=linear | 2=cubic },_enlarged_mode={ 0=preserve | 1=enlarge } +#@cli : Skew Image Based on angle. Note that axis==z condition has not been tested! +#@cli : Default values: _position_skew[%]=0%,_axis=0 +rep_skew: +skip ${2=0},${3=0},${4=3},${5=1},${6=1} +check (abs($1)<90)&&(abs($2)<=1)&&((($3==0)||($3==1)||($3==2))||(('$3'=='x')||('$3'=='y')||('$3'=='z'))) +if $1==0 return fi +if $6 +ang={($1/180)*pi} +tang={tan($ang)} +foreach { +if '$3'=='z'||$3==2 +echo[] "TODO: Add depth. Possible TODO: zx,zy,xz,zy" return +elif '$3'=='y'||$3==1 +dist={abs(w*$tang)} +new_height={h+$dist} +100%,$new_height,100%,100%,"begin( +const ang=$ang*-1; +const offpos=(h-h#-1)/2; +const ww=w-1; +const half_w=(w-1)/2; +const dist=ww*tan(ang); +); +ypos=(x-half_w)/ww*dist-offpos; +I(#-1,x,y+ypos,z,$5,$4);" +elif '$3'=='x'||$3==0 +dist={abs(h*$tang)} +new_width={w+$dist} +$new_width,100%,100%,100%,"begin( +const ang=$ang; +const offpos=(w-w#-1)/2; +const hh=h-1; +const half_h=(h-1)/2; +const dist=hh*tan(ang); +); +xpos=(y-half_h)/hh*dist-offpos; +I(#-1,x+xpos,y,z,$5,$4);" +else +error "Invalid input!" +fi +k. +} +else +if '$3'=='z'||$3==2 +echo[] "Untested! Possible TODO: zx,zy,xz,zy" +f "begin( +const ang=($1/180)*pi; +const dd=d-1; +const pz=dd*($2*.5+.5); +const dist=dd*tan(ang); +); +zpos=(z-pz)/dd; +J(0,0,lerp(0,dist,zpos),$5,$4);" +elif '$3'=='y'||$3==1 +f "begin( +const ang=($1/180)*pi*-1; +const ww=w-1; +const px=ww*($2*.5+.5); +const dist=ww*tan(ang); +); +xpos=(x-px)/ww; +J(0,lerp(0,dist,xpos),0,$5,$4);" +elif '$3'=='x'||$3==0 +f "begin( +const ang=($1/180)*pi; +const hh=h-1; +const py=hh*(-$2*.5+.5); +const dist=hh*tan(ang); +); +ypos=(y-py)/hh; +J(lerp(0,dist,ypos),0,0,$5,$4);" +else +error "Invalid input!" +fi +fi +#@cli rep_hpd: eq. to 'rep_henon_phase_diagram' +rep_hpd:rep_henon_phase_diagram $* +#@cli rep_henon_phase_diagram: a,_scale>0,-180>=_rotation>=180,_posx,_posy,_lines>0,1<_pts_per_line<=500,_start_x0,_end_x0,_steps_x0,_multiple_map +#@cli : Creates Henon Phase Diagram on existing image. Multiple Map option is used to make it easier to create more interesting image via coding. +#@cli : +#@cli : (eq. to 'rep_hpd')\n +#@cli : TODO: Add more description here. +rep_henon_phase_diagram: +skip ${2=1},${3=0},${4=50%},${5=50%}${6=600},${7=1750},${8=-.5},${9=.5},${10=8},${11=0} +if $2==0 error "$"2!=0==F fi +output_mode={$11%4} +if $1!=0 +if s#-1!=1&&d#-1!=1 100%,100%,1,1,-1 +else +if !iv#-1&&iM#-1!=-1 f. -1 fi +fi +if ($3-360*floor($3/360))?1 +out_xi=rot_x(xi,yi) +out_yi=rot_y(xi,yi) +else +out_xi=xi +out_yi=yi +fi +steps={round((max(1,abs($10))-1))} +lines={max(1,round(abs($6)))} +if $output_mode==3 calc_out=i(#-1,cx,cy)=1 +else calc_out=cv=i(#-1,cx,cy);i(#-1,cx,cy)=max(cv,y) +fi +$steps,$lines,1,1,":begin_t( +const a=$1; +const c=cos(a); +const s=sin(a); +const pts=max(1,round(abs($7))); +const ex=w#-1-1; +const ey=h#-1-1; +const posx=ex*$4; +const posy=ey*$5; +const hex=ex/2; +const hey=ey/2; +const dist=min(hex,hey)*abs($2); +const tau=2*pi; +const start_x0=$8; +const end_x0=$9; +const ang=($3/180)*pi*-1; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +if(abs($10) +,const end_step=w-1; +,const end_step=1; +); +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +); +t=lerp(start_x0,end_x0,x/end_step); +xi=t; +yi=y/h*tau; +repeat(pts, +m=xi; +n=yi-sqr(xi); +xn=xi*c-n*s; +yn=xi*s+n*c; +if(xn==inf||yn==inf||xn==-inf||yn==-inf,break()); +xi=xn;yi=yn; +if(m!=t, +cx=round(posx+"$out_xi"/2*dist); +cy=round(posy-"$out_yi"/2*dist); +"$calc_out"; +); +); +" +rm. +if $output_mode==2 ++eq. -1 ++negate. +elif $output_mode==1 ++gt. -1 +fi +else +f. 0 +fi +#@cli rep_mode_color: _outmode={ 0=blend | 1=mode_per_layer },_color_position +#@cli : Fill image with mode of colors. +#@cli : +#@cli : 'outmode' determines whether to blend images or fill images with mode of itself. If images are to be blended, then it is possible nan values will occur due to the absence of mode or more than one mode. +#@cli : '_color_position' determines the mode to use if it is 0 or over +#@cli : +#@cli : Author: Reptorian. +#@cli : Default values: '_outmode=0','_color_position=-1' +rep_mode_color: +skip ${1=0},${2=-1} +if $!>2&&!$1 ++a z colormap. 0 +a[^-1] c +{w#0},{h#0},{d#0},{s#1},"begin( +const vs=w#1; +const ss=s#1; +const css=s#0/ss; +endnan=vectors(nan); +); +nmaxfreq=0; +vfreq=vectorvs(-1); +vp=I#0; +repeat(css,pos, +curcol=vp[pos*ss,ss]; +repeat(vs,posfreq, +coltestpos=I(#1,posfreq,0,0); +if(curcol==coltestpos,++vfreq[posfreq];); +); +); +maxfreqcount=max(vfreq); +if(maxfreqcount+1, +posmaxfreqcol=find(vfreq,maxfreqcount,0,1); +repeat(vs,fs,if(vfreq[fs]==maxfreqcount,++nmaxfreq;);); +if(nmaxfreq==1,I(#1,posmaxfreqcol,0,0);,endnan); +,endnan; +);" +k. +elif $!==2&&!$1 +f. "begin(endnan=vectors(nan););I==I#0?I:endnan;" rm.. +else +foreach { +if s>4 error "Unsupported number of channels" fi +ls={s} +minv={im} +- $minv +repeat s { +sh. $> +bsize$>={iM+1} +rm. +} +if s==1 +$bsize0,1,1,1 eval.. ++i(#-1,i,0,0,0) {w},1,1,1,x +u {"freq=0; +repeat(w#-2,n, +if(i(#-2,n)==iM#-2,++freq;); +); +(freq)"} +maxfreq={${}} +echo $maxfreq ++.. $minv +pixelsort. -,x,[-2] +if $1<0 +if $maxfreq==1 +f... i(#-1,0,0,0) +fi +k... +else +pos={$1%$maxfreq} +f... i(#-1,$pos,0,0) +k... +fi +else +if s==2 $bsize0,$bsize1,1,1 eval.. ++i(#-1,[I,0]) dins=[x,y] +elif s==3 $bsize0,$bsize1,$bsize2,1 eval.. ++i(#-1,I) dins=[x,y,z] +elif s==4 $bsize0,$bsize1,$bsize2,$bsize3 eval.. ++i(#-1,I) dins=[x,y,z,c] +fi +1,1,1,$ls 1,1,1,1 +eval... :${-math_lib}"begin( +const ls=$ls; +); +if(i, +dar_insert(#-2,"$dins"); +dar_insert(#-1,i-1); +); +end( +resize(#-2,1,dar_size(#-2),1,s(#-2),0); +resize(#-1,1,dar_size(#-1),1,s(#-1),0); +); +" ++.. $minv +pixelsort.. -,y,[-1] +sort. - +u {"freq=0; +repeat(h#-1,n, +if(i(#-1,0,n)==iM,++freq,break();); +); +(freq)"} +maxfreq={${}} +if $2<0 +if $maxfreq==1 +f[-4] I(#-2,0,0,0) +fi +else +pos={int($2)%$maxfreq} +f[-4] I(#-2,0,$posfreq,0) +fi +k[-4] +fi +} +fi +#@cli rep_dynamic_contrast: -64<=amount<=64,0<=_threshold<=255,0<=_intensity<=255 +#@cli : Apply dynamic contrast using formula found by Remake at forums.getpaint.net. Original source code - https://forums.getpaint.net/topic/117538-dynamic-contrast/?tab=comments#comment-578867 . It is similar to Photoshop's Dynamic Contrast. +#@cli : +#@cli : Author: Reptorian. +#@cli : Default values: '_threshold=128','_intensity=255' +rep_dynamic_contrast: +skip ${2=128},${3=255} +repeat $! { +sh[$>] {s#$>>=3?[0,2]:0} +if s>=3 calcval=v=I;lum=0.296875*v[0]+0.5859375*v[1]+0.11328125*v[2];(I-sqrt(abs(threshold-lum))*(lum>threshold?na:a))*fi+I*ifi; +else calcval=(i-sqrt(abs(threshold-i))*(i>threshold?na:a))*fi+i*ifi +fi +f. "begin( +const a=$1; +const threshold=$2; +const intensity=$3; +const na=1-a; +const fi=intensity/255; +const ifi=1-fi; +); +"$calcval" +" +cut. 0,255 +rm. +} +#@cli rep_cstdmap: eq. to 'rep_chirikov_taylor' +rep_cstdmap:rep_chirikov_taylor $* +#@cli rep_chirikov_taylor: size!=0,_lines>0,_pts_per_line>0,_k,_chirikov_mode={ 0=standard | 1=chirikov_karimov },_offmode={ 0=default | 1=center },_orientation={ 0=xy | 1=yx },_use_parallel={ 0=serial | 1=parallel } +#@cli : Creates Chirikov discrete map. Chirikov map can be the standard version which is created by Boris Chirikov or modification done by Artur I. Karimov.\n +#@cli : (eq. to 'rep_cstdmap')\n +#@cli : 'size' can be either in percent or integer. It can be negative or positive. Percentage mode is always based on the size of image. Positive values will lead to square value regardless of initial image. Negative value will create a new image based on whether the width or height is smaller, and scale based on the ratio of max dim vs min dim. +#@cli : '_lines' defines the number of lines created within image. It defaults to 1 if the user inputs a value in which the absolute of value is less than 1. +#@cli : '_pts_per_line' defines how much points is generated per lines. +#@cli : '_k' can be considered distortion factor. It can be negative. +#@cli : '_chirikov_mode' defines whether to apply a symmetric modification to the original version of chirikov standard map. The symmetric modification is based on the paper 'The Study of the Modified Chirikov Map' by Artur I.Karimov, Denis N. Butusov,Vyacheslav G. Rybin, Timur I.Karimov within Department of Computer Aided Design at Saint Petersburg Electrotechnical University. +#@cli : '_offmode' defines whether the main rotor will be centered. +#@cli : '_orientation' defines whether to switch axis for generation of chirikov map. +#@cli : +#@cli : Author: Reptorian. +#@cli : Default values: '_lines=500','_pts_per_line=5000','_k=1','_chirikov_mode=0','_offmode=0','_orientation=0','_use_parallel=1' +rep_chirikov_taylor: +skip ${2=500},${3=5000},${4=1},${5=0},${6=0},${7=0},${8=1} +if ${is_percent\ $1} +if $! +if $1>0 +mw=${-max_w} +mh=${-max_h} +md={max($mw,$mh)} +chirikov_w,chirikov_h={$md*$1} +else +mw=${-max_w} +mh=${-max_h} +sd={max($mw,$mh)/min($mw,$mh)} +if $mh>$mw +chirikov_w={$mw*abs($1)} +chirikov_h={$sd*$chirikov_w} +else +chirikov_h={$mh*abs($1)} +chirikov_w={$sd*$chirikov_h} +fi +fi +else error \$\!>0==F +fi +else +if $1>0 +chirikov_w,chirikov_h=$1 +elif $1<0 +if $! +mw=${-max_w} +mh=${-max_h} +sd={max($mw,$mh)/min($mw,$mh)} +if $mh>$mw +chirikov_w={abs($1)} +chirikov_h={$sd*$chirikov_w} +else +chirikov_h={abs($1)} +chirikov_w={$sd*$chirikov_h} +fi +else error \$\!>0==F +fi +else error \$\1!=0==F +fi +fi +if $5 +chirikov_mode=txi=fmod(xi+.5*yi);yi=fmod(yi-k*sin(txi));xi=fmod(txi+.5*yi) +else +chirikov_mode=yi=fmod(yi+k*sin(xi));xi=fmod(xi+yi) +fi +if $7 +coordinates=[round(yi/tau*width),round(xi/tau*height)] +else +coordinates=[round(xi/tau*width),round(yi/tau*height)] +fi +lines={min(100*$chirikov_h,abs($2))+1} +$chirikov_w,$chirikov_h,1,1 +$lines,1,1,1,"begin(const ww=w-1;const tau=2*pi;);x/w*tau;" +if $8 start_char=: +else start_char=> +fi +f. $start_char" +begin( +const width=w#-2; +const height=h#-2; +const pts=max(1,abs(round($3))); +const k=$4; +const tau=2*pi; +fmod(a)=a-tau*floor(a/tau); +xi=0; +); +yi=i; +px=x+1; +repeat(pts, +"$chirikov_mode"; +coordinates="$coordinates"; +cv=i(#-2,coordinates[0],coordinates[1]); +i(#-2,coordinates[0],coordinates[1])=max(cv,px); +);" +rm. +if $6 +if $7 +if $5 +s. y,2 rv[-2,-1] a[-2,-1] y a[-2,-1] x +else s. x,2 rv[-2,-1] a[-2,-1] x +fi +else +if $5 +s. x,2 rv[-2,-1] a[-2,-1] x a[-2,-1] y +else s. y,2 rv[-2,-1] a[-2,-1] y +fi +fi +fi +#@cli rep_rd : eq. to 'rep_reverse_digits' +rep_rd: rep_reverse_digits ${1-3} +#@cli rep_reverse_digits: base>0,number_bounary_mode={ 0=regular | 1=periodic | 2=mirror },max_number_boundary>0 +#@cli : Reverse digits of image. +#@cli : (eq. to 'rep_rd') +#@cli : Default values: 'base=10','number_boundary_mode=0','max_number_boundary=255' +rep_reverse_digits: +skip ${1=10},${2=0},${3=255} +check "(isint($1)&&$1>1)&&(isint($3)&&$3>0)" +num_of_imgs={$!} +$num_of_imgs,1,1,2,min_val=im#x;[min_val,min_val<0?x:-1]; s. c +abs_min_img_val={min_img_val=im#-2;min_img_val<0?abs(min_img_val)} +if $abs_min_img_val +discard[-1] -1 +neg_img_list_pos,inc_neg_img_list_pos,number_of_negatives={neg_img_pos=$!-1;[neg_img_pos,neg_img_pos+1,h#-1]} +neg_img_list={crop(#-1)} ++lt[$neg_img_list] 0 ++store[$inc_neg_img_list_pos--1] negative_images +repeat $number_of_negatives { +img_pos={i(#$neg_img_list_pos,0,$>)} +-[$img_pos] [$inc_neg_img_list_pos] +remove[$inc_neg_img_list_pos] +} +store[-1] neg_img_list +else +remove[-1] +fi +$num_of_imgs,1,1,2,"begin( +const abs_min_img_val=$abs_min_img_val; +); +min_img_val=i(#-1); +max_img_val=iM#x; +if(abs(min_img_val)>max_img_val +,[0,abs_min_img_val] +,[max(0,min_img_val),max_img_val] +);" +diff={ceil(iM-im+1)} +rm[-2] +$diff,1,1,1,"begin( +const min_val=int(im#-1); +const base=$1; +const number_boundary_choice=int($2)%3; +number_boundary_choice?( +const boundary_number=$3; +number_boundary_choice==2?( +const m2_boundary_number=boundary_number<<1; +output(v)=( +va=v%m2_boundary_number; +boundary_number-abs(boundary_number-va); +); +):( +output(v)=v%boundary_number; +); +):( +output(v)=v; +); +); +rv=0; +n=x+min_val; +while(n, +rv=int(rv)*base+n%base; +n=int(n/base); +); +output(int(rv)); +" +-[^-2,-1] {im#-2} +remove[-2] +map[^-1] [-1],3 +remove[-1] +if $abs_min_img_val +$neg_img_list +neg_img_list_pos,inc_neg_img_list_pos={[$neg_img_list_pos,$inc_neg_img_list_pos]-1} +$negative_images +(1,-1) +map[$inc_neg_img_list_pos--2] [-1] +rm[-1] +repeat $number_of_negatives { +img_pos={i(#$neg_img_list_pos,0,$>)} +*[$img_pos] [$inc_neg_img_list_pos] +remove[$inc_neg_img_list_pos] +} +remove[-1] +fi +#@cli rep_tz: eq. to 'rep_tiled_zoom' +rep_tz:rep_tiled_zoom $* +#@cli rep_tiled_zoom: sqr_w>=0,_sqr_h>=0,_scale>=1,_boundary={ 0=none | 1=neumann | 2=periodic | 3=mirror } +#@cli : Zoom per tiles using information that exists.\n +#@cli : (eq. to 'rep_tz')\n +#@cli : Author: Reptorian\n +#@cli : Default values: '_sqr_h=sqr_w','_scale=2','_boundary=3' +rep_tiled_zoom: +skip ${2=$1},${3=2},${4=3} +sqr_w={max(round(abs($1)),1)} +sqr_h={max(round(abs($2)),1)} +sd={max(1,abs($3))} +if $sd!=1 +foreach { +columns={ceil(w/$sqr_w)} +rows={ceil(h/$sqr_h)} +offx={($sqr_w*$columns)-w} +offy={($sqr_h*$rows)-h} +offx/=2 +offy/=2 +offx=int($offx) +offy=int($offy) +f "begin( +px=expr('begin(const cen=(w-1)/2;);cv=x-cen;nv=cv*$sd;nv-cv;',$sqr_w); +py=expr('begin(const cen=(w-1)/2;);cv=x-cen;nv=cv*$sd;nv-cv;',$sqr_h); +const boundary=abs($4)%4; +); +coords=[px[(x+$offx)%$sqr_w],py[(y+$offy)%$sqr_h]]; +J(coords[0],coords[1],0,2,boundary);" +} +fi +#@cli rep_hsx_p_i: eq. to 'rep_hsx_poster_index' +rep_hsx_p_i:rep_hsx_poster_index $* +#@cli rep_hsx_poster_index: if $4<0 <=hue_bands<=360,saturation_bands,luminosity_bands,n/a,_colorspace={ 0=hsi | 1=hsl | 2=hsv | 3=hcy } : else 0<=hue_bands<=360,saturation_bands,luminosity_bands,0<=_dithering<=1,0<=start_hue<360,_colorspace={ 0=hsi | 1=hsl | 2=hsv | 3=hcy } +#@cli : Posterize images using indexing and several variants of hsx models.\n +#@cli : (eq. to 'rep_hsx_p_i')\n +#@cli : Author: Reptorian\n +#@cli : Default values: '_dithering=50%','start_hue=0','_colorspace=3' +rep_hsx_poster_index: +skip ${4=50%},${5=0},${6=2} +check "last_args=[${2-3}];inrange($1,2,360,1,1)&&!isin(0,(isint(last_args)&last_args>1))" +hue_scale,sat_scale,lum_scale,dithering,start_hue,cs_mode={[360/$1,[${2-3}]-1,cut($4,0,1),$5%360,int($6)%4+1]} +convert_colors_fwd=${arg\ $cs_mode,rgb2hsi,rgb2hsl,rgb2hsv,rgb2hcy} +convert_colors_bwd=${arg\ $cs_mode,hsi2rgb,hsl2rgb,hsv2rgb,hcy2rgb} +if $4 +fs_1R0D,fs_1L1D,fs_M01D,fs_1R1D={([7,3,5,1]/16)*$dithering} +foreach { +if !(s==3||s==4) continue fi +$convert_colors_fwd +if $start_hue +shared. 0 +-. $start_hue +%. 360 +rm. +fi +if s==4 shared 0,2 fi +fill. >"begin( +const width=w; +const height=h; +const hue_scale=$hue_scale; +const sat_scale=$sat_scale; +const lum_scale=$lum_scale; +const fs_1R0D=$fs_1R0D; +const fs_1L1D=$fs_1L1D; +const fs_M01D=$fs_M01D; +const fs_1R1D=$fs_1R1D; +); +old_color=I; +new_hue=round(old_color[0]/hue_scale)*hue_scale; +new_sat=round((old_color[1]*sat_scale))/sat_scale; +new_lum=round((old_color[2]*lum_scale))/lum_scale; +new_color=[new_hue,new_sat,new_lum]; +diff_color=old_color-new_color; +J(#-1, 1,0)+=diff_color*fs_1R0D; +J(#-1,-1,1)+=diff_color*fs_1L1D; +J(#-1, 0,1)+=diff_color*fs_M01D; +J(#-1, 1,1)+=diff_color*fs_1R1D; +new_color; +" +keep[0] +if $start_hue +shared 0 ++. $start_hue +%. 360 +rm. +fi +$convert_colors_bwd +} +else +360,1,1,1,x +if $1!=360 +/. $hue_scale +round. +*. $hue_scale +fi +store. hue_bands +foreach { +if !(s==3||s==4) continue fi +$convert_colors_fwd +repeat 3 { +if $> +scale_val=${arg\ $>,$sat_scale,$lum_scale} +shared $> +*. $scale_val +round. +/. $scale_val +rm. +else +shared 0 +$hue_bands +if $start_hue +-.. $start_hue +%.. 360 +fi +map.. . +if $start_hue ++.. $start_hue +%.. 360 +fi +rm[-2,-1] +fi +} +$convert_colors_bwd +} +fi +#@cli rep_mj_prn : eq. to 'rep_mj_pseudorandom_noise' +rep_mj_prn:rep_mj_pseudorandom_noise $* +#@cli rep_mj_pseudorandom_noise : _k1,_k2,_internal_shift,_ang,_px_size,_cx,_cy,_color_output,_kmode,_grid,_gridcol,_axis_thickness +#@cli : Render regular noise. Filter is a extended version of MadJik's Regular Noise PDN plugin and based off MadJik's code. The G'MIC version has been extended.\n +#@cli : (eq. to 'rep_mj_prn').\n +#@cli : '_k1' defines value for k-1 +#@cli : '_k2' defines value for k-2 +#@cli : '_internal_shift' shift rows based on this value. The more, the more distortion there will be. +#@cli : '_ang' defines the color/shade angle. +#@cli : '_px_size' defines how big the pixels are. +#@cli : '_cx' refers to the x-position of center based on world coordinate of -1,1 +#@cli : '_cy' refers to the y-position of center based on world coordinate of -1,1 +#@cli : '_color_output' is the function used to color the output. +#@cli : '_kmode' defines how the noise will be processed. +#@cli : '_grid' option is used to whether to output a grid. +#@cli : '_gridcol' defines the value of grid. Only gray color is supported. +#@cli : '_axis_thickness' defines whether the axis has 2 pixel instead of 1.\n +#@cli : Default values: '_k1=8','_k2=2','_internal_shift=1','_ang=0','_px_size=1','_cx=0','_cy=0','_coloroutput=1','_grid=0','_gridcol=0','_axis_thickness=0'\n +#@cli : Author: Reptorian. +#@cli : $ 512,512 rep_mj_pseudorandom_noise 8,2,1,95,4,0,0,1,0,,,0 +#@cli : $ 1024,1024 rep_mj_pseudorandom_noise 34,2,30,95,4,0,0,2 +rep_mj_pseudorandom_noise: +skip ${1=8},${2=2},${3=1},${4=0},${5=1},${6=0},${7=0},${8=1},${9=0},${10=0},${11=0},${12=0} +r 100%,100%,1,{$8?3:1} +3000,100,1,1,round((1-(x*(x^2*15731+789221)+1376312589&2147483647)/1073741824)*100000)/100000; +if $8%4==2 +outmode=i(#-1,num+($4/180*3000),0,0,0,0,2) +formulachoice=DoubleToColorRGB(noise_gen) +else +outmode=i(#-1,num%3000,0,0,0,0,2) +if $8%4==3 formulachoice=DoubleToColorTan(noise_gen)%256 +elif $8%4==1 formulachoice=formulachoice=DoubleToColorSin(noise_gen) +else formulachoice=(((ang/pi*256)+noise_gen)/3000*256)%256 +fi +fi +if $10 +tempval={abs($5)+1} +if $8 gridcol=[$11,$11,$11] +else gridcol=$11 +fi +temp_formulachoice=((x%$tempval)&&(y%$tempval))? +temp_formulachoice.=$formulachoice:$gridcol +formulachoice=$temp_formulachoice +fi +f[0--2] " +begin( +const ww=w/2; +const halfh=h/2; +const zoom=1/round(abs(abs($5)+($10?1:0))); +if($9 +,const k_one=$1/2; +,const k_one=$1/10; +); +if($9 +,const k_two=$2/4; +,const k_two=($2*-1)/10; +); +noise2d(nx,ny)=( +a=int(nx);b=int(ny); +num=abs(a+b*$3)%3000; +"$outmode"; +); +const ang=$4/180*pi; +smoothnoise(nx,ny)=( +a=int(nx);b=int(ny); +num=(noise2d(a-1,b-1)*4)/$1; +num2=(noise2d(a-1,b)*4)/k_one; +num3=noise2d(a,b)/k_two; +num4=num+num2+num3; +num4*256; +); +DoubleToColorSin(v)=( +num=ceil((v*1/pi*10^3))/10^3; +num2=int(128+127*sin(num+ang)); +num3=int(128+127*sin(pi/2+num+ang)); +num4=int(128+127*sin(pi+num+ang)); +[num4,num3,num2]; +); +DoubleToColorRGB(t)=( +num=int(t*65536.0); +num2=(num&16711680)>>16; +num3=(num&65280)>>8; +num4=num&255; +[num4,num3,num2]; +); +DoubleToColorTan(w)=( +num=ceil((w*1/pi)*10^3)/10^3; +num2=int(128+127*tan(num+ang)); +num3=int(128+127*tan(num+pi/2+ang)); +num4=int(128+127*tan(num+pi+ang)); +[num4,num3,num2]; +); +); +xx=abs(int(zoom*(x+0.5))); +yy=abs(int(zoom*(y+0.5))); +noise_gen=smoothnoise(xx,yy); +"$formulachoice";" +if $12&&(($6!=-1)||($7!=-1)) +if $10 +f[0--2] "begin( +const sfx=int(($6*.5+.5)*w)+($10?1:0); +const sfy=int(($7*.5+.5)*h)+($10?1:0); +); +psfx=x-sfx; +psfy=y-sfy; +i( +psfx>=0?x-sfx:x-sfx-1, +psfy>=0?y-sfy:y-sfy-1,z,c,0,3 +);" +else +f[0--2] "begin( +const sfx=($6*.5+.5)*w+($10?1:0); +const sfy=($7*.5+.5)*h+($10?1:0); +); +i(x-sfx,y-sfy,z,c,0,3);" +fi +elif $6!=-1||$7!=-1 +f[0--2] "begin( +const gridfix=($10?1:0); +const pxlsize=abs($5)+gridfix; +const errfix=abs($5)==1?!(pxlsize%2):1-gridfix; +const sw=int(w-pxlsize); +const sfx=int(($6*.5+.5)*sw); +const sh=int(h-pxlsize); +const sfy=int(($7*.5+.5)*sh); +const errfix2=abs($5)==1; +); +psfx=x-sfx; +psfy=y-sfy; +i( +psfx>=0?psfx+errfix2:psfx*-1+pxlsize-errfix, +psfy>=0?psfy+errfix2:psfy*-1+pxlsize-errfix, +z,c, +0,2 +);" +fi +rm. +#@cli rep_dla : eq. to 'rep_diffusion_limited_aggregation' +rep_dla: rep_diffusion_limited_aggregation $* +#@cli rep_diffusion_limited_aggregation: _attempts>1,_mode,0<=_spread_factor<=1,_stem_color={ 0=dark | 1=light },_border,_initial_point_mode={ 0=less_dense | 1=more_dense },_preserve_silhouette={ 0=maskless | 1=mask } +#@cli : Generate Diffusion Limited Aggregation +#@cli : (eq. to 'rep_dla'). +#@cli : +#@cli : '_attempts' defines how much attempts on filling the aggregation form before finishing. +#@cli : '_mode' defines how particles aggregate on the aggregation form. +#@cli : '_spread_factor' defines how much times a particle will be created upon appending. The algorithm for this may not be the correct implementation, but it works for what it describes. +#@cli : '_stem_color' defines where the aggregation form will fill on. +#@cli : '_border' is only applicable if there is a planting seed map. It is used to limit particles based on proximity away from existing structure. +#@cli : '_initial_point_mode' defines whether to use less dense or more dense point coordinates map. +#@cli : '_preserve_silhouette' is only applicable on images with variance. +#@cli : +#@cli : Author: Reptorian. +#@cli : Default values: '_attempts=100','_mode=0','_spread_factor=0','_stem_color=0','_border=0','_initial_point_mode=0','_preserve_silhouette=1' +rep_diffusion_limited_aggregation: +skip ${1=100},${2=0},${3=0},${4=0},${5=0},${6=0},${7=1} +maximum_iterations,pixel_detection_mode,spread_factor,stem_color,border_size,initial_coordinates_map_mode,preserve_silhouette_mode={[abs($1),int($2)%4,cut(abs($3),0,1),!$4,round(abs($5)),$6?1,$7?1]} +inv_stem_color,use_altern_text,n_threads={[!$stem_color,$pixel_detection_mode==3]},$_cpus +command "dla_target_1s: +ge {avg(iM,im)} +" +command "dla_target_2s: +normalize 0,1 +split[-1] c * +ge {avg(iM,im)} +" +command "dla_target_3s: +normalize 0,1 +split c +add / 3 +ge {avg(iM,im)} +" +command "dla_target_4s: +normalize 0,1 +ts={s-1} +split c +add[^-1] +/[-1] $ts * +ge {avg(iM,im)} +" +command "dla_target: +if s==1 dla_target_1s +elif s==2 dla_target_2s +elif s==3 dla_target_3s +else dla_target_4s +fi +" +command "dla_check_variance: +tv=0 +repeat s { +shared $> +tv+={iv#-1} +rm. +if $tv +break +fi +} +status {$tv?1:0} +" +command "dla_clear_image: +{w#0},{h#0},1,1,"$stem_color" +rv[-1,0] +rm. +" +if $use_altern_text +altern_text_a=altern=int(u(0,2,1,0)) +altern_text_b=altern=++altern%2 +fi +foreach { +if s>4||d#0>1 continue fi ++dla_create_coordinate_map $initial_coordinates_map_mode +gcd_shuffle. +use_dla_map=${dla_check_variance[0]} +if $use_dla_map +dla_target[0] +if $border_size ++distance.. $inv_stem_color,2 +1,{h#-2},1,1,v=i(#-1,I(#-2));v?(v<=$border_size?y:-1):-1 +discard. -1 +map. ... +1,100%,1,1,i(#2,I(#-1)) +rm[-4,-3] +pixelsort.. +,y,. +rm. +1,100%,1,1,:"begin_t(const n_threads=$n_threads;n=t;);v=n;n+=n_threads;v;" +map. .. +rm.. +if !$preserve_silhouette_mode +if $stem_color +replace[0] 0,.999 +else +*[0] .001 +fi +fi +else +if $stem_color val_check=>.999 +else val_check=<.001 +fi +1,{h},1,1,y +eval.. :if(!(i(#0,I)$val_check),i(#-1,0,y)=-1;);I; +discard. -1 +map. .. +rm.. ++distance[-2] $inv_stem_color,2 +1,{h#-2},1,1,i(#-1,I(#-2)) +rm[-2] +pixelsort[-2] +,y,[-1] +rm[-1] +1,100%,1,1,:"begin_t(const n_threads=$n_threads;n=t;);v=n;n+=n_threads;v;" +map. .. +rm.. +if !$preserve_silhouette_mode +if $stem_color +replace[0] 0,.999 +else +*[0] .001 +fi +fi +fi +else +center_x,center_y={[(w#0-1)>>1,(h#0-1)>>1]} +minimum_circle_radius={norm($center_x,$center_y)} +1,{h},1,2,"begin( +const sqrt_of_two=sqrt(2); +const minimum_circle_radius=$minimum_circle_radius; +const center_x=$center_x; +const center_y=$center_y; +); +distance_from_center=norm(I#-1-[$center_x,$center_y]); +distance_from_center<=minimum_circle_radius?( +relative_position=distance_from_center/minimum_circle_radius; +valid_point=lerp(1,u^.625,relative_position)>=relative_position?y:-1; +):( +valid_point=-1; +); +[distance_from_center,valid_point]; +" +split[-1] c +discard[-1] -1 +[-1] +repeat 2 { map[{$>-2}] [{$>-4}] } +remove[-4,-3] +pixelsort[-2] +,y,[-1] +remove[-1] +1,100%,1,1,:"begin_t(const n_threads=$n_threads;n=t;);v=n;n+=n_threads;v;" +map[-1] [-2] +remove[-2] +dla_clear_image +set[0] $inv_stem_color,50%,50% +fi +a[^0] y +eval[1] :"begin_t( +const width=w#0; +const height=h#0; +const spread_factor=$spread_factor; +const use_spread=spread_factor?1; +const limit_of_attempts=$maximum_iterations; +const pixel_detection_mode=$pixel_detection_mode; +const target_mode=$inv_stem_color; +new_pos_x=[-1, 0, 1, +-1, 1, +-1, 0, 1]; +new_pos_y=[-1,-1,-1, +0, 0, +1, 1, 1]; +if(!target_mode +,det_px(pixel)=pixel<1; +,det_px(pixel)=pixel; +); +pixel_detection_mode==3?( +pixel_detected(xp,yp)= +altern?( +det_px(i(#0,xp-1,yp-1,0,0,0,2))|| +det_px(i(#0,xp-1,yp+1,0,0,0,2))|| +det_px(i(#0,xp+1,yp-1,0,0,0,2))|| +det_px(i(#0,xp+1,yp+1,0,0,0,2)) +):( +det_px(i(#0,xp-1,yp,0,0,0,2))|| +det_px(i(#0,xp+1,yp,0,0,0,2))|| +det_px(i(#0,xp,yp-1,0,0,0,2))|| +det_px(i(#0,xp,yp+1,0,0,0,2)) +); +): +pixel_detection_mode==2?( +pixel_detected(xp,yp)= +det_px(i(#0,xp-1,yp-1,0,0,0,2))|| +det_px(i(#0,xp-1,yp+1,0,0,0,2))|| +det_px(i(#0,xp+1,yp-1,0,0,0,2))|| +det_px(i(#0,xp+1,yp+1,0,0,0,2))|| +det_px(i(#0,xp-1,yp,0,0,0,2))|| +det_px(i(#0,xp+1,yp,0,0,0,2))|| +det_px(i(#0,xp,yp-1,0,0,0,2))|| +det_px(i(#0,xp,yp+1,0,0,0,2)); +): +pixel_detection_mode==1?( +pixel_detected(xp,yp)= +det_px(i(#0,xp-1,yp,0,0,0,2))|| +det_px(i(#0,xp+1,yp,0,0,0,2))|| +det_px(i(#0,xp,yp-1,0,0,0,2))|| +det_px(i(#0,xp,yp+1,0,0,0,2)); +):( +pixel_detected(xp,yp)= +det_px(i(#0,xp-1,yp-1,0,0,0,2))|| +det_px(i(#0,xp-1,yp+1,0,0,0,2))|| +det_px(i(#0,xp+1,yp-1,0,0,0,2))|| +det_px(i(#0,xp+1,yp+1,0,0,0,2)); +); +"$altern_text_a" +); +temp_vec=I; +xp=temp_vec[0]; +yp=temp_vec[1]; +repeat(limit_of_attempts, +pv=int(u(0,8,1,0)); +xp+=new_pos_x[pv]; +yp+=new_pos_y[pv]; +if(pixel_detected(xp,yp), +i(#0,xp%width,yp%height)=target_mode; +if(use_spread, +txp=xp; +typ=yp; +if(u>1} +1,{$row_a*$counts_per_row_a+$row_b*$counts_per_row_b},1,2,:"begin( +const row_length=w#-1; +const half_row_length=row_length>>1; +); +pos_y=int(y/half_row_length); +ny=y<<1; +pos_x=pos_y&1?(ny%row_length):((ny+1)%row_length); +[pos_x,pos_y]; +" +else +1,{(w>>1)*(ceil(h/2))},1,2,:"begin( +const row_length=w#-1; +const half_row_length=row_length>>1; +); +y_pos=int(y/half_row_length)<<1; +[(y<<1)%row_length,y_pos]; +" +fi +#@cli rep_blur_splinter: _length,_duplicates,_angle,_thickness,-1<=_balance<=1,_contrast,_boundary={ 0=None | 1=Neumann | 2=Periodic | 3=Mirror },_bisided={ 0=one-line | two-line } +#@cli : Apply Splinter Blur to Image. Based off observation from using Splinter Blur plugin within Paint.NET made by Ed Harvey, and it is inspired by this filter. Note that convolution result is different. +#@cli : Default values: '_length=10%','_duplicates=5','_angle=0','_thickness=0','_balance=0','_contrastr=0','_boundary=1','_bisided=0' +rep_blur_splinter: +skip ${1=10%},${2=5},${3=0},${4=0},${5=0},${6=0},${7=2},${8=0} +if $2<3 error \$\2>2==F fi +start_ang={$3} +angs_per_dups={360/$2} +command "average_output: ti=$! add / $ti" +if $5==-1 command "output_splinter : min" +elif $5<0&&$5>-1 command "output_splinter : +average_output +min[^-1] f. lerp(i#-2,i,abs($5)) k." +elif $5==0 command "output_splinter : average_output" +elif $5>0&&$5<1 command "output_splinter : +average_output +max[^-1] f. lerp(i#-2,i,$5) k." +elif $5==1 command "output_splinter : max" +else error (-1<=\$\6<=1)=F +fi +foreach { +half_img_diag={norm(w,h)/2} +if ${is_percent\ $1} length={round(abs($1)*$half_img_diag)} +else length={round(abs($1))} +fi +if ${is_percent\ $4} thickness={round(abs($4)*$half_img_diag)} +else thickness={round(abs($4))} +fi +img_dims={w},{h} +repeat $2 { +ang={$start_ang+$angs_per_dups*$>} +rep_splinter_blur_convolve_map[^0--1] $length,$thickness,$ang,$6,$8,$img_dims ++convolve_fft[0] [-1],$7 +rm.. +} +rm[0] +output_splinter +} +uncommand output_splinter +#@cli rep_splinter_blur_convolve_map: _length,_thickness,_angle,_contrast,_bisided={ 0=one-line | two-line } +#@cli : Create a convolve map for directional blur. This enables one to create a convolve map for one-direction motion blur. +#@cli : Default values: '_length=10%','_thickness=5%','_angle=0','_bisided=1' +rep_splinter_blur_convolve_map : skip ${1=10%},${2=5%},${3=0},${4=0},${5=1},${6=w},${7=h} +ang={($3/180)*pi*-1} +cos_ang={cos($ang)}; +sin_ang={sin($ang)}; +diag={norm($6,$7)/2} +if ${is_percent\ $1} length={round($1*$diag)} else length={round($1)} fi +if ${is_percent\ $2} thickness={max(round($2*$diag),1)} else thickness={max(round($2),1)} fi +point_b_x=0 +point_b_y={$length/2} +point_c_x={$thickness/2} +max_dim={max($point_b_y,$point_c_x)} +min_dim={min($point_b_y,$point_c_x)} +point_c_y={sqrt(sqr($max_dim)-sqr($min_dim))} +point_a_x=-$point_c_x +point_a_y=$point_c_y +n_pax={abs($point_a_x*$cos_ang+$point_a_y*$sin_ang)} +n_pay={abs($point_a_x*$sin_ang+$point_a_y*$cos_ang)} +n_pbx={abs($point_b_x*$cos_ang+$point_b_y*$sin_ang)} +n_pby={abs($point_b_x*$sin_ang+$point_b_y*$cos_ang)} +n_pcx={abs($point_c_x*$cos_ang+$point_c_y*$sin_ang)} +n_pcy={abs($point_c_x*$sin_ang+$point_c_y*$cos_ang)} +rect_width={ceil(max($n_pax,$n_pbx,$n_pcx)*2)} +rect_height={ceil(max($n_pay,$n_pby,$n_pcy)*2)} +{max(1,$rect_width)},{max(1,$rect_height)},1,1," +begin( +const strokelength=$length; +const sx=w/strokelength; +const sy=h/strokelength; +const sides=$5; +const thickness=$thickness; +const hw=(w-1)/2; +const hh=(h-1)/2; +const ang=($3/180)*pi*-1; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +cutval(v)=v<0?0:v; +maxcutval(v)=v>1?1:v; +); +xx=(x/w-.5)*sx; +yy=(y/h-.5)*sy; +lx=x-hw; +ly=y-hh; +radial_grad=1-norm(xx,yy)*2; +radial_grad=cutval(radial_grad); +line=1-maxcutval(abs(rot_x(lx,ly))/thickness); +sides?(line?radial_grad*line):(rot_y(lx,ly)<=0?(line?radial_grad*line)); +" +/. {is} +if $4 +avgstat={ia} ++*. 2 -. $avgstat +f.. lerp(i,i#1,min(1,min(abs($4),1))) +rm. +fi +#@cli rep_bgfill: eq. to 'rep_fill_background' +rep_bgfill: rep_fill_background $* +#@cli rep_fill_background: color,alpha,max_alp +#@cli : Fill image with values.\n +#@cli : (eq. to 'rep_bgfill')\n +#@cli : For RGBA images, 3 values are used in place of color. That means 5 values are to be inserted. +#@cli : For GA Image, only 1 value are used in place of color. That means 3 values are to be used. +rep_fill_background: +if $-2>0 +$!,1,1,1,s#x +val_test={iv#-1} +rm. +if !$val_test +foreach { +if s==2||s>3 +sh 0,{s-2} +sh.. {s} +f.. I*(i0#-1/$-1)*($-2/$-1)+I*(1-($-2/255))+[${1--3}]*(1-i0#-1/$-1) +f. $-1*(i/$-1*$-2/$-1)+i*(1-$-2/$-1)+$-2*(1-i/$-1) +rm[-2,-1] +fi +} +else error !var(chans)==F +fi +fi +#@cli rep_pfrac_t_rs : eq. to 'rep_popcorn_fractal_transformative_regular_and_swirling' +rep_pfrac_t_rs: rep_popcorn_fractal_transformative_regular_and_swirling $* +#@cli rep_popcorn_fractal_transformative: _points>0,_density>0,_H,_K,_zoom,_rotation_angle,_origin_x,_origin_y,_trig_mode={ 0=Trig-4 | 1=Trig-6 },set_arg_a,set_arg_b +#@cli : Generates Swirling Hall which is forked from Transformative Pickover Popcorn Fractal. Discovered by T.Gangopadhyay at XLRI in C.H.Area(E),Jamshedpur,India in 2012. +#@cli : +#@cli : Source: International Journal of Computer Applications(0975-8887) Volume 50-No.8, July 2012. +#@cli : +#@cli : _points defines the maximum number of points to be added on image based on pixel location. Negative Mode +#@cli : _density defines the frequency of points to be added along row and height of image. A value of one implies n points to be added per pixel. +#@cli : _H is the function multiplier used to subtract from the new found values from each iteration. +#@cli : _K is the inner multiplier for the inside function. See popcorn_x(a,b), and popcorn_y(a,b) embedded within the code of rep_popcorn_fractal for more information. +#@cli : _zoom defines the magnification of image. A negative value will "shrink" the structure of generated fractal. +#@cli : _rotation_angle defines the function angle of fractal. +#@cli : _origin_x defines the position of fractal. Center of image row will be treated as zero, and the ranges for image row are treated as -1,1. +#@cli : _origin_y defines the position of fractal. Center of image column will be treated as zero, and the ranges for image column are treated as -1,1. +#@cli : _set_arg defines complex trigometric functions to utilize to define the complex popcorn fractal. +#@cli : +#@cli : Note: See below note for more details on _set_arg +#@cli : +#@cli : ---- Set of arguments for each _set_arg ----- +#@cli : +#@cli : There can be up to 6 set of arguments. If any of first two set of arguments are specified, then the default arguments for the first two set of arguments are overrided with the first two set of arguments. If any of the last two arguments are not specified, then it will take the last two set of arguments before it, otherwise, it will override it with the specified arguments. +#@cli : +#@cli : Note: Use the examples provided to make it easier to generate. See examples for clarification on what is meant by set of arguments. +#@cli : +#@cli : if _set_arg_n_1==0: 0,_function +#@cli : +#@cli : Output - func_a(v) +#@cli : _function={0=sin|1=sinh|2=cos|3=cosh|4=tan|5=tanh} +#@cli : +#@cli : elif _set_arg_n_1==1: 1,_function_a,_function_b +#@cli : +#@cli : Output - func_a(v)+func_b(v) +#@cli : _function_a={0=v|1=sin|2=sinh|3=cos|4=cosh|5=tan|6=tanh} +#@cli : _function_b={0=v|1=sin|2=sinh|3=cos|4=cosh|5=tan|6=tanh} +#@cli : +#@cli : elif _set_arg_n_1==2: 2,_function_a,_function_b,_include_v +#@cli : +#@cli : Output - func_a((include_v?v:0)+func_b(v)) +#@cli : _function_a={0=sin|1=sinh|2=cos|3=cosh|4=tan|5=tanh} +#@cli : _function_b={0=sin|1=sinh|2=cos|3=cosh|4=tan|5=tanh} +#@cli : _include_v={0=FALSE|1=TRUE} +#@cli : +#@cli : fi +#@cli : +#@cli : ---- End ---- +#@cli : +#@cli : Author: Reptorian. +#@cli : Default values: '_points=50','density=1','H=.05','_K=3','zoom=.5','_rotation_angle=45','_origin_x=0','_origin_y=0' +#@cli : $ set_arg_a=0,0 set_arg_b=0,4 512,512 rep_popcorn_fractal_transformative_regular_and_swirling 50,2,.05,3,.5,45,0,0,0,$set_arg_a,$set_arg_b cut 0,1000 +#@cli : $ set_arg_a=2,1,4,1 set_arg_b=1,4,2 set_arg_c=0,4 512,512 rep_popcorn_fractal_transformative_regular_and_swirling 50,2,.05,3,.5,45,0,0,1,$set_arg_a,$set_arg_b,$set_arg_c cut 0,1000 +rep_popcorn_fractal_transformative_regular_and_swirling: +skip ${1=50},${2=1},${3=.05},${4=3},${5=.5},${6=45},${7=0},${8=0},${9=0},${10=},${11=},${12=},${13=},${14=},${15=},${16=},${17=},${18=},${19=},${20=},${21=},${22=},${23=},${24=},${25=} +use_default={!(narg($10)&&narg(${11-1}))} +if ($6-360*floor($6/360))?1 +fvx=((rot_x(ix,iy)-osx)*icx_zoom+cxsx)/sx +fvy=((rot_y(ix,iy)-osy)*icy_zoom+cysy)/sy +else +fvx=((ix-osx)*icx_zoom+cxsx)/sx +fvy=((iy-osy)*icy_zoom+cysy)/sy +fi +if !$use_default +$=funarg +fp,argval=10,{$10%3} +if $argval==0 +fp+=2 +fun_a=${rep_pfrac_t_and_swrlhall_str_a\ $11} +elif $argval==1 +fp+=3 +fun_a=${rep_pfrac_t_and_swrlhall_str_b\ $11,$12} +else +fp+=4 +fun_a=${rep_pfrac_t_and_swrlhall_str_c\ ${11-13}} +fi +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_2={$tv%3} +if $mode_2==0 +fun_b=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_2==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_b=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_b=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +elif !$use_default +mode_2={$10%3} +if $mode_2==0 +fun_b=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_2==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_b=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_b=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +echo $fun_b +fi +if $9 +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_3={$tv%3} +if $mode_3==0 +fun_c=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_3==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_c=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_c=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +mode_3={$10%3} +if $mode_3==0 +fun_c=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_3==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_c=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_c=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +fi +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_4={$tv%3} +if $mode_4==0 +fun_d=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_4==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_d=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_d=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +fp+={arg($mode_3+1,2,3,4)} +fun_d=$fun_a +fi +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_5={$tv%3} +if $mode_5==0 +fun_e=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_5==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_e=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_e=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +fp+={arg($mode_4+1,2,3,4)} +fun_e=$fun_b +fi +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_6={$tv%3} +if $mode_5==0 +fun_f=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +elif $mode_6==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_f=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_f=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +fun_f=$fun_c +fi +all_func=fun_a(v)=$fun_a;fun_b(v)=$fun_b;fun_c(v)=$fun_c;fun_d(v)=$fun_d;fun_e(v)=$fun_e;fun_f(v)=$fun_f +else +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_3={$tv%3} +if $mode_3==0 +fun_c=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_3==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_c=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_c=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +fp+={arg($mode_2+1,2,3,4)} +fun_c=$fun_a +fi +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_4={$tv%3} +if $mode_4==0 +fun_d=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +elif $mode_4==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_d=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_d=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +fun_d=$fun_b +fi +all_func=fun_a(v)=$fun_a;fun_b(v)=$fun_b;fun_c(v)=$fun_c;fun_d(v)=$fun_d +fi +else +all_func=fun_a(v)=sin(v);fun_b(v)=tan(v);fun_c(v)=sin(v);fun_d(v)=tan(v) +fi +iw,ih={w-1},{h-1} +channels. 0 f. 0 +if $1>0 +output=ix=nx/zn;iy=ny/zn +else +output=nx/=zn;ny/=zn;r=norm(nx,ny);t=2*atan(ny/nx);ix=r*cos(t);iy=r*sin(t) +fi +{int(w*abs($2))},{int(h*abs($2))},1,1,":begin_t( +const nw=w-1; +const nh=h-1; +const ww=$iw; +const hh=$ih; +const icx=ww/2; +const icy=hh/2; +const sd=max(w,h)/min(w,h); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +const cx=(nw-1)/2; +const cy=(nh-1)/2; +const cxsx=icx*sx; +const cysy=icy*sy; +const pts=abs($1); +const H=$3; +const K=$4; +const zoom=1/$5; +const ang=($6/180)*pi; +const origin_x=$7*-1*zoom; +const origin_y=$8*zoom; +const sx_zoom=sx*zoom; +const sy_zoom=sy*zoom; +const osx=origin_x*sx; +const osy=origin_y*sy; +const icx_zoom=icx/zoom; +const icy_zoom=icy/zoom; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +cnorm(a,b)=sum(sqr(a),sqr(b)); +"$all_func"; +$9?( +out_x(a,b)=(Kb=K*b;a-H*fun_a(b+fun_b(Kb+fun_c(Kb)))); +out_y(a,b)=(Ka=K*a;b-H*fun_d(a+fun_e(Ka+fun_f(Ka)))); +):( +out_x(a,b)=a-H*fun_a(b+fun_b(K*b)); +out_y(a,b)=b-H*fun_c(a+fun_d(K*a)); +); +); +ix=sx_zoom*(x-cx)/cx; +iy=sy_zoom*(y-cy)/cy; +ix+=origin_x; +iy+=origin_y; +repeat(pts, +nx=out_x(ix,iy); +ny=out_y(ix,iy); +zn=cnorm(nx,ny); +"$output"; +xval="$fvx"; +yval="$fvy"; +xpos=round(xval); +ypos=round(yval); +i(#-1,xpos,ypos)++; +);" +rm. +rep_popcorn_fractal_transformative_regular_and_swirling_animated: +fvx=((rot_x(ix,iy)-osx)*icx_zoom+cxsx)/sx +fvy=((rot_y(ix,iy)-osy)*icy_zoom+cysy)/sy +$=funarg +fp=16 +argval={$16%3} +if $argval==0 +fp+=2 +fun_a=${rep_pfrac_t_and_swrlhall_str_a\ $17} +elif $argval==1 +fp+=3 +fun_a=${rep_pfrac_t_and_swrlhall_str_b\ $17,$18} +else +fp+=4 +fun_a=${rep_pfrac_t_and_swrlhall_str_c\ ${17-19}} +fi +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_2={$tv%3} +if $mode_2==0 +fun_b=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_2==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_b=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_b=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +mode_2={$16%3} +if $mode_2==0 +fun_b=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_2==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_b=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_b=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +fi +if $15 +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_3={$tv%3} +if $mode_3==0 +fun_c=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_3==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_c=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_c=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +mode_3={$16%3} +if $mode_3==0 +fun_c=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_3==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_c=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_c=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +fi +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_4={$tv%3} +if $mode_4==0 +fun_d=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_4==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_d=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_d=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +fp+={arg($mode_3+1,2,3,4)} +fun_d=$fun_a +fi +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_5={$tv%3} +if $mode_5==0 +fun_e=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_5==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_e=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_e=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +fp+={arg($mode_4+1,2,3,4)} +fun_e=$fun_b +fi +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_6={$tv%3} +if $mode_5==0 +fun_f=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +elif $mode_6==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_f=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_d=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +fun_f=$fun_c +fi +all_func=fun_a(v)=$fun_a;fun_b(v)=$fun_b;fun_c(v)=$fun_c;fun_d(v)=$fun_d;fun_e(v)=$fun_e;fun_f(v)=$fun_f +else +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_3={$tv%3} +if $mode_3==0 +fun_c=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_3==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_c=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_c=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +fp+={arg($mode_2+1,2,3,4)} +fun_c=$fun_a +fi +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_4={$tv%3} +if $mode_4==0 +fun_d=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +elif $mode_4==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_d=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_d=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +fun_d=$fun_b +fi +all_func=fun_a(v)=$fun_a;fun_b(v)=$fun_b;fun_c(v)=$fun_c;fun_d(v)=$fun_d +fi +iw,ih={w-1},{h-1} +channels. 0 f. 0 +if $1>0 +output=ix=nx/zn;iy=ny/zn +else +output=nx/=zn;ny/=zn;r=norm(nx,ny);t=2*atan(ny/nx);ix=r*cos(t);iy=r*sin(t) +fi +{int(w*abs($2))},{int(h*abs($2))},{d},1,":begin_t( +const nw=w-1; +const nh=h-1; +const ww=$iw; +const hh=$ih; +const icx=ww/2; +const icy=hh/2; +const sd=max(w,h)/min(w,h); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +const cx=(nw-1)/2; +const cy=(nh-1)/2; +const cxsx=icx*sx; +const cysy=icy*sy; +const zz=d-1; +const pts=abs($1); +const H_a=$3; +const H_b=$4; +const K_a=$5; +const K_b=$6; +const zoom_a=1/$7; +const zoom_b=1/$8; +const ang_a=($9/180)*pi; +const ang_b=($10/180)*pi; +const origin_x_a=$11*-1*zoom_a; +const origin_y_a=$12*zoom_a; +const origin_x_b=$13*-1*zoom_b; +const origin_y_b=$14*zoom_b; +const sx_zoom_a=sx*zoom_a; +const sy_zoom_a=sy*zoom_a; +const sx_zoom_b=sx*zoom_b; +const sy_zoom_b=sy*zoom_b; +const osx_a=origin_x_a*sx; +const osy_a=origin_y_a*sy; +const osx_b=origin_x_b*sx; +const osy_b=origin_y_b*sy; +const icx_zoom_a=icx/zoom_a; +const icy_zoom_a=icy/zoom_a; +const icx_zoom_b=icx/zoom_b; +const icy_zoom_b=icy/zoom_b; +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +cnorm(a,b)=sum(sqr(a),sqr(b)); +"$all_func"; +$15?( +out_x(a,b)=(Kb=K*b;a-H*fun_a(b+fun_b(Kb+fun_c(Kb)))); +out_y(a,b)=(Ka=K*a;b-H*fun_d(a+fun_e(Ka+fun_f(Ka)))); +):( +out_x(a,b)=a-H*fun_a(b+fun_b(K*b)); +out_y(a,b)=b-H*fun_c(a+fun_d(K*a)); +); +); +pz=z/zz; +H=lerp(H_a,H_b,pz); +K=lerp(K_a,K_b,pz); +zoom=lerp(zoom_a,zoom_b,pz); +origin_x=lerp(origin_x_a,origin_x_b,pz); +origin_y=lerp(origin_y_a,origin_y_b,pz); +sx_zoom=lerp(sx_zoom_a,sx_zoom_b,pz); +sy_zoom=lerp(sy_zoom_a,sy_zoom_b,pz); +osx=lerp(osx_a,osx_b,pz); +osy=lerp(osy_a,osy_b,pz); +icx_zoom=lerp(icx_zoom_a,icx_zoom_b,pz); +icy_zoom=lerp(icy_zoom_a,icy_zoom_b,pz); +ang=lerp(ang_a,ang_b,pz); +cos_ang=cos(ang); +sin_ang=sin(ang); +ix=sx_zoom*(x-cx)/cx; +iy=sy_zoom*(y-cy)/cy; +ix+=origin_x; +iy+=origin_y; +repeat(pts, +nx=out_x(ix,iy); +ny=out_y(ix,iy); +zn=cnorm(nx,ny); +"$output"; +xval="$fvx"; +yval="$fvy"; +xpos=round(xval); +ypos=round(yval); +i(#-1,xpos,ypos,z)++; +);" +rm. +rep_pfrac_t_and_swrlhall_str_a: +skip ${1=0} +mode={str='$1';str[0]==45} +argval={abs($1)%6} +str_out=${arg\ $argval+1,sin(v),sinh(v),cos(v),cosh(v),tan(v),tanh(v)} +if $mode str_out..=- fi +u $str_out +rep_pfrac_t_and_swrlhall_str_b: +skip ${1=1},${2=3} +modes=[{str_a='$1';str_b='$2';[str_a[0]==45,str_b[0]==45]}] +argval={abs($1)%7} +str_out=${arg\ $argval+1,v,sin(v),sinh(v),cos(v),cosh(v),tan(v),tanh(v)} +if ($modes)[0] str_out..=- fi +argval={abs($2)%7} +add_str_out=${arg\ $argval+1,v,sin(v),sinh(v),cos(v),cosh(v),tan(v),tanh(v)} +if ($modes)[1] +add_str_out..=- +else +add_str_out..=+ +fi +str_out.=$add_str_out +u $str_out +rep_pfrac_t_and_swrlhall_str_c: +skip ${1=1},${2=0},${3=1} +modes=[{str_a='$1';str_b='$2';str_c='$3';[str_a[0]==45,str_b[0]==45,str_c[0]==45]}] +argval={abs($1)%6} +str_out=${arg\ $argval+1,sin(,sinh(,cos(,cosh(,tan(,tanh(} +if ($modes)[0] str_out..=- fi +if $3 +add_str_out=v +if ($modes)[2] add_str_out..=- fi +argval={abs($2)%6} +add_str_out_2=${arg\ $argval+1,sin(v)),sinh(v)),cos(v)),cosh(v)),tan(v)),tanh(v))} +if ($modes)[1] add_str_out_2..=- else add_str_out_2..=+ fi +add_str_out.=$add_str_out_2 +else +argval={abs($2)%6} +add_str_out=${arg\ $argval+1,sin(v)),sinh(v)),cos(v)),cosh(v)),tan(v)),tanh(v))} +if ($modes)[1] add_str_out..=- fi +fi +str_out.=$add_str_out +u $str_out +#@cli rep_pfrac : eq. to 'rep_popcorn_fractal' +rep_pfrac: rep_popcorn_fractal $* +#@cli rep_popcorn_fractal: _points>0,_density>0,_H,_K,_zoom,_rotation_angle,_origin_x,_origin_y,_mode,_f1={ 0=sin | 1=cos | 2=tan | 3=atan},... +#@cli : Generates Pickover Popcorn Fractal. Code was adapted from Paul Bourke's c code, and extended for more possibilities. Fractal is attributed to Clifford Pickover.\n +#@cli : _points defines the maximum number of points to be added on image based on pixel location. +#@cli : _density defines the frequency of points to be added along row and height of image. A value of one implies n points to be added per pixel. +#@cli : _H is the function multiplier used to subtract from the new found values from each iteration. +#@cli : _K is the inner multiplier for the inside function. See popcorn_x(a,b), and popcorn_y(a,b) embedded within the code of rep_popcorn_fractal for more information. +#@cli : _zoom defines the magnification of image. A negative value will "shrink" the structure of generated fractal. +#@cli : _rotation_angle defines the function angle of fractal. +#@cli : _origin_x defines the position of fractal. Center of image row will be treated as zero, and the ranges for image row are treated as -1,1. +#@cli : _origin_y defines the position of fractal. Center of image column will be treated as zero, and the ranges for image column are treated as -1,1. +#@cli : _mode defines whether to use 4 trigonometric functions or 6 trigonometric functions. Each halves of functions are used on 2 functions used by different axis. +#@cli : _fn defines individual function used for the popcorn fractal.\n +#@cli : Author: Reptorian. +#@cli : Default values: '_points=50','density=1','H=.05','_K=3','zoom=1','_rotation_angle=0','_origin_x=0','_origin_y=0','_mode=0',...\n +#@cli : \ \ \ \ If _mode=0: ... = '_f1=_f3=0','_f2=_f4=2' +#@cli : \ \ \ \ If _mode=1: ... = '_f1=_f4=0','_f2=_f5=1','_f3=_f6=2'\n +rep_popcorn_fractal: +skip ${1=50},${2=1},${3=.05},${4=3},${5=1},${6=0},${7=0},${8=0},${9=0},${10=},${11=},${12=},${13=},${14=},${15=} +if ($6-360*floor($6/360))?1 +fvx=((rot_x(xnew,ynew)-osx)*icx_zoom+cxsx)/sx +fvy=((rot_y(xnew,ynew)-osy)*icy_zoom+cysy)/sy +else +fvx=((xnew-osx)*icx_zoom+cxsx)/sx +fvy=((ynew-osy)*icy_zoom+cysy)/sy +fi +iw={w-1} +ih={h-1} +channels. 0 f. 0 +{int(w*abs($2))},{int(h*abs($2))},1,1,":begin_t( +const nw=w-1; +const nh=h-1; +const ww=$iw; +const hh=$ih; +const icx=ww/2; +const icy=hh/2; +const pts=$1; +const H=$3; +const K=$4; +const zoom=1/$5; +const ang=($6/180)*pi; +const origin_x=$7*-1*zoom; +const origin_y=$8*zoom; +const sd=max(w,h)/min(w,h); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +const sx_zoom=sx*zoom; +const sy_zoom=sy*zoom; +const cx=(nw-1)/2; +const cy=(nh-1)/2; +const osx=origin_x*sx; +const osy=origin_y*sy; +const icx_zoom=icx/zoom; +const icy_zoom=icy/zoom; +const cxsx=icx*sx; +const cysy=icy*sy; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +$9?( +if(narg($10), +const argpos10=$10%4; +argpos10==0?func_a(a)=sin(a): +argpos10==1?func_a(a)=cos(a): +argpos10==2?func_a(a)=tan(a): +argpos10==3?func_a(a)=atan(a); +,func_a(a)=sin(a); +); +if(narg($11), +const argpos11=$11%4; +argpos11==0?func_b(a)=sin(a): +argpos11==1?func_b(a)=cos(a): +argpos11==2?func_b(a)=tan(a): +argpos11==3?func_b(a)=atan(a); +,func_b(a)=cos(a); +); +if(narg($12), +const argpos12=$12%4; +argpos12==0?func_c(a)=sin(a): +argpos12==1?func_c(a)=cos(a): +argpos12==2?func_c(a)=tan(a): +argpos12==3?func_c(a)=atan(a); +,func_c(a)=tan(a); +); +if(!narg($13), +if(narg($10), +argpos10==0?func_d(a)=sin(a): +argpos10==1?func_d(a)=cos(a): +argpos10==2?func_d(a)=tan(a): +argpos10==3?func_d(a)=atan(a); +,func_d(a)=sin(a); +);, +const argpos13=$13%4; +argpos13==0?func_d(a)=sin(a): +argpos13==1?func_d(a)=cos(a): +argpos13==2?func_d(a)=tan(a): +argpos13==3?func_d(a)=atan(a); +); +if(!narg($14), +if(narg($11), +argpos11==0?func_e(a)=sin(a): +argpos11==1?func_e(a)=cos(a): +argpos11==2?func_e(a)=tan(a): +argpos11==3?func_e(a)=atan(a); +,func_e(a)=cos(a); +);, +const argpos14=$14%4; +argpos14==0?func_e(a)=sin(a): +argpos14==1?func_e(a)=cos(a): +argpos14==2?func_e(a)=tan(a): +argpos14==3?func_e(a)=atan(a); +); +if(!narg($15), +if(narg($12), +argpos12==0?func_f(a)=sin(a): +argpos12==1?func_f(a)=cos(a): +argpos12==2?func_f(a)=tan(a): +argpos12==3?func_f(a)=atan(a); +,func_f(a)=tan(a); +);, +const argpos15=$15%4; +argpos15==0?func_f(a)=sin(a): +argpos15==1?func_f(a)=cos(a): +argpos15==2?func_f(a)=tan(a): +argpos15==3?func_f(a)=atan(a); +); +popcorn_x(a,b)=(Kb=K*b;a-H*func_a(b+func_b(Kb+func_c(Kb)))); +popcorn_y(a,b)=(Ka=K*a;b-H*func_d(a+func_e(Ka+func_f(Ka)))); +):( +if(narg($10), +const argpos10=$10%4; +argpos10==0?func_a(a)=sin(a): +argpos10==1?func_a(a)=cos(a): +argpos10==2?func_a(a)=tan(a): +argpos10==3?func_a(a)=atan(a); +,func_a(a)=sin(a); +); +if(narg($11), +const argpos11=$11%4; +argpos11==0?func_b(a)=sin(a): +argpos11==1?func_b(a)=cos(a): +argpos11==2?func_b(a)=tan(a): +argpos11==3?func_b(a)=atan(a); +,func_b(a)=tan(a); +); +if(!narg($12), +if(narg($10), +argpos10==0?func_c(a)=sin(a): +argpos10==1?func_c(a)=cos(a): +argpos10==2?func_c(a)=tan(a): +argpos10==3?func_c(a)=atan(a); +,func_c(a)=sin(a); +);, +const argpos12=$12%4; +argpos12==0?func_c(a)=sin(a): +argpos12==1?func_c(a)=cos(a): +argpos12==2?func_c(a)=tan(a): +argpos12==3?func_c(a)=atan(a); +); +if(!narg($13), +if(narg($11), +argpos11==0?func_d(a)=sin(a): +argpos11==1?func_d(a)=cos(a): +argpos11==2?func_d(a)=tan(a): +argpos11==3?func_d(a)=atan(a); +,func_d(a)=tan(a); +);, +const argpos13=$13%4; +argpos13==0?func_d(a)=sin(a): +argpos13==1?func_d(a)=cos(a): +argpos13==2?func_d(a)=tan(a): +argpos13==3?func_d(a)=atan(a); +); +popcorn_x(a,b)=a-H*func_a(b+func_b(K*b)); +popcorn_y(a,b)=b-H*func_c(a+func_d(K*a)); +); +); +xx=sx_zoom*(x-cx)/cx; +yy=sy_zoom*(y-cy)/cy; +xx+=origin_x; +yy+=origin_y; +repeat(pts, +xnew=popcorn_x(xx,yy); +ynew=popcorn_y(xx,yy); +xval="$fvx"; +yval="$fvy"; +++i(#-1,xval,yval); +xx=xnew; +yy=ynew; +);" +rm. +#@cli rep_x_graphical_tiling: [Images],_insertion_rate,_back_r,_back_g,_back_b +#@cli : Launch the interactive graphical tiling window.\n +#@cli : Details: The main purpose of this filter is to stimulate graphical tiling glitch observed in older operating system and computers. However, you can also use it to tile images by hand to artistic purpose.\n +#@cli : '[Images]' are images to be assigned to be tiled. +#@cli : '_insertion_rate' defines the rate of insertion per milliseconds. +#@cli : '_back_' defines the background color in the one of the preview mode. +#@cli : Default values: '_insertion_rate=0','_back_r=0','_back_g=0','_back_b=0' +rep_x_graphical_tiling: +skip ${2=0},${3=0},${4=0},${5=0} +is_windows_tileset=${"is_image_arg $1"} +e[] "\n Instruction on how to work with interactive windows.\n +\ ---------------------------------------------------------\n\n +\ - All Modes -\n\n +\ * O: Change Preview Mode\n +\ * SPACE: Switch Mode\n +\ * ESC: End Interactive Window\n\n +\ Important Note: Check the message in the title bar.\n\n +\ - Image Placement Mode -\n\n +\ * D: Display Overlay Image\n +\ * H: Flip Image Horizontally\n +\ * V: Flip Image Vertically\n +\ * Mouse Click: Move/Place Image\n +\ * ARROW UP/DOWN:Change Tiling Image\n +\ * ARROW LEFT/RIGHT:Rotate Image\n +\ - Tiling Mode - \n\n +\ * Mouse Move: Place Tile at Insertion Rate\n +\ * ARROW UP/DOWN: Add/Subtract Insertion Rate by 100 ms\n +\ * ARROW LEFT/RIGHT: Add/Subtract Insertion Rate by 10 ms\n\n +\ Additional Note: Type in 'h rep_x_graphical_tiling' for more information.\n\n +\ ---------------------------------------------------------" +insertion_rate={max(0,$2)} +__r_back={max(0,abs($3))} +__g_back={max(0,abs($4))} +__b_back={max(0,abs($5))} +if $!!=1 error imgs!=1 fi +if !$is_windows_tileset error tile_imgs>0==F fi +pass$1 0 +timg={$!} +ms=${-max_s} +if $ms>=3&&$ms<5 to_rgba +elif $ms==1&&$ms<3 to_graya +else error max_chan<5==F +fi +tnimg={$timg-1} +u {expr('w#(x+1)',$tnimg-1)} vec_w=[${}] +u {expr('h#(x+1)',$tnimg-1)} vec_h=[${}] +r {w#0},{h#0},100%,100%,0 +{w},{h},1,{s},0 +__w={w#0} +__h={h#0} +cx={w#0/2} +cy={h#0/2} +px=$cx +py=$cy +cpx=$cx +cpy=$cy +nx=0 +ny=0 +__display_mode=0 +display_overlay_image=1 +util_insertion=0 +__ci=1 +command "pass2endimage : pass[{$__ci}] 0 shift. $""1,$""2 blend alpha" +paint_mode=0 +insert_duplicate_start=1 +move_window=0 +old_window=0 +start_move=0 +current_image=0 +start=0 +ex=-1 +ey=-1 +do +if {*,SPACE} +if $paint_mode paint_mode=0 +else paint_mode=1 +fi +wait 50 +fi +activate_preview=0 +if {*,O} __display_mode+=1 __display_mode={$__display_mode%3} activate_preview=1 wait 200 fi +if !$start activate_preview=1 fi +x,y,b,ww,wh={*,x,y,b,w,h} +window_title="" +if $paint_mode +window_title.="Painting Mode [ Press SPACE TO Escape Painting Mode]" +window_title.="- Insertion Rate - " +window_title.=$insertion_rate +window_title.=" ms" +if {*,ARROWUP}" || "{*,ARROWRIGHT} +if {*,ARROWUP} insertion_rate+=100 +else insertion_rate+=10 +fi +elif {*,ARROWDOWN}" || "{*,ARROWLEFT} +if {*,ARROWDOWN} insertion_rate-=100 +else insertion_rate-=10 +fi +insertion_rate={max(0,$insertion_rate)} +fi +else +if $display_overlay_image +window_title.="Window Overlay Mode [ON]" +else +window_title.="Window Overlay Mode [OFF]" +fi +if {*,D} display_overlay_image+=1 display_overlay_image={$display_overlay_image%2} fi +if {*,ARROWUP}" || "{*,ARROWDOWN} +if {*,ARROWUP} current_image+=1 +else current_image-=1 +fi +current_image={$current_image%($timg-1)} +__ci={$current_image+1} +wait 50 +activate_preview=1 +elif {*,ARROWLEFT}" || "{*,ARROWRIGHT} +activate_preview=1 +r[$__ci] {($vec_w)[$__ci-1]},{($vec_h)[$__ci-1]},100%,100%,0 +if {*,ARROWRIGHT} +rotate[$__ci] 90 +else +rotate[$__ci] -90 +fi +temp1={($vec_w)[$__ci-1]} +temp2={($vec_h)[$__ci-1]} +vec_w=[{"v=["$vec_w"];v["$__ci"-1]="$temp2";v"}] +vec_h=[{"v=["$vec_h"];v["$__ci"-1]="$temp1";v"}] +r[$__ci] {w#0},{h#0},100%,100%,0 +elif {*,H}" || "{*,V} +r[$__ci] {($vec_w)[$__ci-1]},{($vec_h)[$__ci-1]},100%,100%,0 +if {*,H} mirror[$__ci] x +elif {*,V} mirror[$__ci] y +fi +r[$__ci] {w#0},{h#0},100%,100%,0 +fi +fi +if {*,b} +move_window+=1 move_window={$move_window%2} +wait 50 +if !$start_move ox={$x} oy={$y} start_move=1 tpx=$px tpy=$py fi +fi +if !$paint_mode +if $move_window +if {*,C} tpx=$cx tpy=$cy ox={$x} oy={$y} fi +else +if {*,C} cpx=$cx cpy=$cy px=$cx py=$py fi +fi +fi +if $move_window +cpx={$tpx+$x-$ox} +cpy={$tpy+$y-$oy} +activate_preview=1 +fi +if !$move_window&&$old_window +px=$cpx +py=$cpy +start_move=0 +paint_mode=0 +fi +old_window=$move_window +if $paint_mode +if ($ex!=$x)||($ey!=$y) +spx={$cpx-(($vec_w)[$__ci-1]/2)} +spy={$cpy-(($vec_h)[$__ci-1]/2)} +pass2endimage[-1] $spx,$spy +activate_preview=1 +wait $insertion_rate +fi +if $activate_preview +if $__display_mode==0 ++blend[0,-1] alpha drgba. +elif $__display_mode==1 ++drgba. $__r_back,$__g_back,$__b_back +else ++drgba. +fi +w[-1] {w#0},{h#0},0,$window_title +k[0-$timg] +fi +ex=$x +ey=$y +else +if $activate_preview +spx={$cpx-(($vec_w)[$__ci-1]/2)} +spy={$cpy-(($vec_h)[$__ci-1]/2)} +if $display_overlay_image ++shift[{$__ci}] $spx,$spy +if $__display_mode==0 ++blend[0,-2,-1] alpha drgba. +elif $__display_mode==1 ++blend[-2,-1] alpha drgba. $__r_back,$__g_back,$__b_back +else ++blend[-2,-1] alpha drgba. +fi +else +if $__display_mode==0 ++blend[0,-1] alpha drgba. +elif $__display_mode==1 ++drgba. $__r_back,$__g_back,$__b_back +else ++drgba. +fi +fi +w[-1] {w#0},{h#0},0,$window_title +k[0-$timg] +fi +fi +insert_duplicate_start=1 +start=1 +activate_preview=0 +wait +while {*}" && "!{*,ESC} +uncommand pass2endimage k[-1] +#@cli rep_bitplane_shuffle: direction={ 0=backward | 1=forward },color_channel_only={ 0=all_channels | 1=color_channel_only },index_0...index_inf +#@cli : Shuffle Bit Planes according to the order of index specified by user. +rep_bitplane_shuffle: +skip ${2=0} +number_of_images={$!} +if !$number_of_images error no_imgs fi +num_of_ind,direction,all_channels={$#-2},{$1&1},{!$2} +size_of_map={2^$num_of_ind} +whole_numbers=[{expr('x',$num_of_ind)}] +order=[${3--1}] +if $#<=3 error insuf_args fi +if sort($order)!=$whole_numbers error inv_ind_args fi +if $order==$whole_numbers return fi +if !$direction order=[${rep_inverse_permutation\ ${3--1}}] fi +eval " +const size_of_map=$size_of_map; +const nimg=$number_of_images; +if(nimg==1, +use_map=whds>size_of_map; +, +use_map=sum=0; +repeat(nimg,img_index, +sum+=whds#img_index; +if(sum>size_of_map, +use_map=1; +break(); +); +); +); +set('use_map',use_map); +" +if $use_map +$size_of_map,1,1,1,sum((x>>$whole_numbers&1)<<$order); +if $all_channels +map[^-1] [-1] +rm. +else +store. bin_map +foreach { +if !(s&1) sh 0,{s-2} fi +$bin_map +map[-2] [-1] +k[0] +} +fi +else +if $all_channels f sum((i>>$whole_numbers&1)<<$order); +else +foreach { +if !(s&1) sh 0,{s-2} fi +f. sum((i>>$whole_numbers&1)<<$order); +k[0] +} +fi +fi +#@cli rep_edgefade: radius>0,_exponential_factor>0 : radius>0,_exponential_factor>0,_nl_amplitude>0,0<_n_smooth<=1,0<_a_smooth<=1 +#@cli : Fade edges on alpha. Only applicable for images with 2 channels or 4+ channels. The last channel is the alpha channel.\n +#@cli : Note: Execute 'gmic h normalize_local' for more information on '_nl_amplitude','_n_smooth', and '_a_smooth'. nl is short for normalize_local.\n +#@cli : Default values: '_exponential_factor=0','_nl_amplitude=0','_n_smooth=4%','_a_smooth=5%' +rep_edgefade: +skip ${2=1},${3=0},${4=4%},${5=2%} +percent_mode=0 if ${is_percent\ $1} percent_mode=1 fi +foreach { +if s==2||s>=4 +sh. {s-1} Mval={iM#-1} +n. 0,1 +rm. ++channels {s-1} +r2dx. 200%,3 +local[-1] { +if $3 ++normalize_local. $3,{$1*200%},$4,$5,1,0,1 +n. 0,1 +fi ++f. i?1 ++distance[{$3?1:0}] 0,2 +if $percent_mode +f. "begin(const valcheck=min(abs($1),1)*iM#-1;);i>=valcheck?1" +else +f. "begin(const valcheck=min(abs($1)*2,iM#-1););i>=valcheck?1" +fi ++f[{$3?1:0}] i#0!=0?(i#-2!=i#-1?1):0 +inpaint_pde.. [-1] +f.. i^$2 +replace_nan.. 0 +f[0] i*i#-2 +k[0] +r2dx 50%,3 +} +sh[0] {s#0-1} +*. .. *. $Mval rm[-2,-1] +fi +} +#@cli rep_kodl: eq. to 'rep_keep_original_dimension_and_or_layer' +rep_kodl: +_gmic_s="$?" v + _rep_keep_original_dimension_and_or_layer $"*" +#@cli rep_keep_original_dimension_and_or_layer: "command",_mode={ 0=old_dim | 1=old_dim_and_layer | 2=new_dim_and_layer},_interpolation, _boundary_conditions, _ax, _ay, _az +#@cli : Apply command to image(s), then have the option to preserve dimensions and/or resized layer. +#@cli : (eq. to 'rep_kodl').\n +#@cli : Default values: _preserve_resized_layer=0,_interpolation=0,_boundary_conditions=3,_ax=0.5,_ay=0.5,_az=0\n +#@cli : Author: Reptorian. +rep_keep_original_dimension_and_or_layer: +_gmic_s="$?" v + _$0 $"*" +_rep_keep_original_dimension_and_or_layer: +skip ${2=0},${3=0},${4=3},${5=.5},${6=.5},${7=0} +if $2==0||$2==1 +image_count={$!*3} +dimensions_info=[{expr('p=int(x/3);arg(x%3+1,w#p,h#p,d#p);',$image_count);}] +fi +command "apply_filter:$1" +if abs($2)>=0&&abs($2)<=2 +foreach { +if abs($2)>=1 ++apply_filter +r[0] {w#-1},{h#-1},{d#-1},100%,${3-7} +fi +if abs($2)==1||!$2 +if !$2 apply_filter fi +r {($dimensions_info)[$<*3+0]},{($dimensions_info)[$<*3+1]},{($dimensions_info)[$<*3+2]},100%,${3-7} +fi +} +fi +uncommand apply_filter +#@cli rep_lpasc_ordith: 'eq to. rep_loupasc_ordered_dither' +rep_lpasc_ordith: rep_loupasc_ordered_dither $* +#@cli rep_loupasc_ordered_dither : _dither_method={ 0=checkerboard | 1=dispersed | 2=arcade | 3=ordered | 4=lines | 5=custom | 6=random }, _palette={ 0=Binary | 1= EGA | 2= Web-safe | 3=12-bit } +#@cli: Color reduction with dithering using algorithm provided by Pascal Ollive. +rep_loupasc_ordered_dither: +f "begin( +color_count=[2,4,6,16]; +custom_matrix=[34,14,3,22,6,27,21,8,26,13,30,1,29,18,33,5,20,12,9,0,19,28,10,32,16,31,7,17,2,25,4,24,15,35,23,11]; +line_matrix=[8,9,6,7,1,0,3,2,4,5,9,8,2,3,0,1,4,5,7,6,1,0,3,2,4,5,8,9,6,7,0,1,4,5,7,6,9,8,2,3,4,5,8,9,6,7,1,0,3,2,7,6,9,8,2,3,0,1,4,5,6,7,1,0,3,2,4,5,8,9,2,3,0,1,4,5,7,6,9,8,3,2,4,5,8,9,6,7,1,0,4,5,7,6,9,8,2,3,0,1]; +mat_rev(n)=( +v = (n & 0x55555555) << 1 | (n >> 1) & 0x55555555; +v = (v & 0x33333333) << 2 | (v >> 2) & 0x33333333; +v = (v & 0x0f0f0f0f) << 4 | (v >> 4) & 0x0f0f0f0f; +v = (v << 24) | ((v & 0xff00) << 8) | ((v >> 8) & 0xff00) | (v >> 24); +v; +); +orddith(ipx,cc,coefcount,ditherpattern)=int((((cc-1)*coefcount+1)*ipx+255*ditherpattern-1)/(255*coefcount)); +randdit(ipx,cc,nx,ny)=( +sd=(mat_rev(ny)>>23)<<22|mat_rev(nx)>>10; +ditp=(48271*sd)%2147483647; +int(((cc - 1) * ipx + (ditp / 8421506)) / 255); +); +$1==0?appdit(ipx,cc,nx,ny)=orddith(ipx,cc,2,xor(nx,ny)&0x1): +$1==1?appdit(ipx,cc,nx,ny)=orddith(ipx,cc,4,((xor(nx,ny)&0x1)<<1)|(ny&0x1)): +$1==2?appdit(ipx,cc,nx,ny)=orddith(ipx,cc,8,2+(ny&0x3)): +$1==3?appdit(ipx,cc,nx,ny)=orddith(ipx,cc,5,line_matrix[20*(ny%5)+2*(nx%5)]>>1): +$1==4?appdit(ipx,cc,nx,ny)=orddith(ipx,cc,10,line_matrix[10*(ny%10)+(nx%10)]): +$1==5?appdit(ipx,cc,nx,ny)=orddith(ipx,cc,36,custom_matrix[6*(ny%6)+(nx%6)]): +appdit(ipx,cc,nx,ny)=randdit(ipx,cc,nx,ny); +cc=color_count[$2]; +cs=255/(cc-1); +); +appdit(i,cc,x,y)*cs; +" +#@cli rep_sptbwgp_recpoltrans: eq. to 'rep_shift_pixel_to_boundary_with_group_pixels_with_rectangular_polar_transformation' +rep_sptbwgp_recpoltrans: rep_shift_pixel_to_boundary_with_group_pixels_with_rectangular_polar_transformation $* +#@cli rep_shift_pixel_to_boundary_with_group_pixels_with_rectangular_polar_transformation: -1<=_fxy_position<=1,0<=_influence_factor<=1, _threshold>=0,-1>=_ptxy_xpos<=1,-1>=_ptxy_ypos<=1,'_channel_mode=' +#@cli : Apply 'rep_shift_pixel_to_boundary_with_group_pixels' effect with 'rep_rectangular_polar_transformation'\n +#@cli : (eq. to 'rep_sptbwgp_recpoltrans').\n +#@cli : '_fx_position' determines the location of pixel relative to ptxy points. +#@cli : '_influence_factor' determines how much influence the effect have on pixels. +#@cli : '_threshold' is used to eliminate alpha below the value. +#@cli : '_ptxy_xpos' assigns the location on point of influence +#@cli : '_ptxy_ypos' assigns the location on point of influence +#@cli : '_channel_mode' is a special variable. See 'gmic h rep_sptbwgp' for more information.\n +#@cli : Default values: '_fxy_position=-1','_influence_factor=1','_threshold=0','_ptxy_xpos=0','_ptxy_ypos=0','_channel_mode=N/A'\n +#@cli : Author: Reptorian. +rep_shift_pixel_to_boundary_with_group_pixels_with_rectangular_polar_transformation: +skip ${1=-1},${2=1},${3=0},${4=0},${5=0},${6=} +point,tcr={[$4,$5,3]} +if narg($6) +if $6>=0 +tcr+=1 +else +any_channels=1 +fi +fi +foreach { +if h>w orientation=1 +else orientation=0 +fi +if s==2||s>$tcr sh. {s-1} mina={im#-1} maxa={iM#-1} rm. fi +rep_recpoltrans $point,-3 +if s==2||s>$tcr sh. {s-1} n. $mina,$maxa rm. fi +rep_sptbwgp {$1*-1},1,$2,$3,$6 +rep_recpoltrans $point,2,$orientation +} +#@cli rep_tiler_n: eq. to 'rep_tiler_nonisometric' +rep_tiler_n: +skip ${4=16},${5=16},${6=},${7=0},${8=},${9=},${10=},${11=0},${12=50} +include_tileset_image=${"is_image_arg $1"} +include_tile_img=${"is_image_arg $6"} +if $include_tile_img&&$include_tileset_image pass$1 0 pass$6 0 rep_tiler_nonisometric[0] [-2],${2-5},[-1],${7--1} rm[-2,-1] +elif $include_tileset_image pass$1 0 rep_tiler_nonisometric[0] [-1],${2--1} rm. +elif $include_tile_img pass$6 0 rep_tiler_nonisometric[0] ${1-5},[-1],${7--1} rm. +else rep_tiler_nonisometric $* +fi +#@cli rep_tiler_nonisometric: { filename | [tileset] },min_tile>=3,increment>=0,_tileset_iw_width>=1,_tileset_ih_width>=1,{ _filename | [placed_tiles] },_preserve_bgout={ 0=eliminate_bg | 1=preserve_bg },_drgba_r>=0,_drgba_g>=0,_drgba_b>=0,_gridcol>=0,_trackpadcol>=0 +#@cli : Launch the interactive non-isometric tiling toolkit. Mandatory variables are the first 3 ones! +#@cli : More info: The interactive non-isometric tiling toolkit is a near final version. Final version will have tiledata import and export. Perhaps with a master developer editor to make overworld art.\n +#@cli : (eq. to 'rep_tiler_n').\n +#@cli : Note: This is meant to enable artists to make artwork based on non-isometric RPG games or even world. It is not meant to be a tool to aid into making RPG games. If you want that, then you need to look into other solutions. Of course, there might be the off-chance that this tool is suitable for you.\n +#@cli : '{ filename | [tileset] }' can be either location of the tileset in text form, or as a image argument. If using image argument, you must do rep_tiler_nonisometric[target] [tile] to make it work. +#@cli : '__min_tile' defines the size of tiles. +#@cli : 'increment' defines the maximum possible selection length by number of tiles added by 1. 0 means maximum possible selection length by tile within axis is exactly 1. +#@cli : '_tileset_iw_width' defines the width of tileset visible within interactive window. +#@cli : '_tileset_ih_width' defines the width of tileset visible within interactive window. +#@cli : '_preserve_bgout' can be used to keep or erase image after painting tiles. +#@cli : '{ filename | [placed_tiles] }' can be either location of the tile in text form, or as a image argument. If using image argument, you must do rep_tiler_nonisometric[target] [tile] to make it work. +#@cli : '_dbrga_r' is the color of transparent background. If a value is assigned to this, then transparent areas are replaced with colored background instead of a checkerboard. +#@cli : '_dbrga_g' is the color of transparent background. If a value is assigned to this, then transparent areas are replaced with colored background instead of a checkerboard. +#@cli : '_dbrga_b' is the color of transparent background. If a value is assigned to this, then transparent areas are replaced with colored background instead of a checkerboard. +#@cli : '_gridcol' defines the color of grid within interactive window. Only grayscale value. +#@cli : '_trackpadcol' defines the color of tracker pad within interactive window. Only grayscale value.\n +#@cli : Default values: '_tileset_iw_width=16','_tileset_ih_width=16','_filename=""','_preserve_bgout=0','_drgba_r=','_drgba_g=','_drgba_b=','_gridcol=0','_trackpadcol=0'\n +#@cli : Author: Reptorian +rep_tiler_nonisometric: +skip ${4=16},${5=16},${6=},${7=0},${8=},${9=},${10=},${11=0},${12=50} +include_tileset_image=${"is_image_arg $1"} +include_tile_img=${"is_image_arg $6"} +__min_tile={abs($2)} +if $__min_tile<3 error "$"2>=3==F"" fi +max_increment={abs($3)} +tile_width=$__min_tile +tile_height=$__min_tile +gridcol={abs($11)} +trackpadcol={abs($12)} +__trackpadcol_alt=$trackpadcol +if narg($8)||narg($9)||narg($10) +if narg($8) __r_col={min(abs($8),255)} else __r_col=0 fi +if narg($9) __g_col={min(abs($9),255)} else __g_col=0 fi +if narg($10) __b_col={min(abs($10),255)} else __b_col=0 fi +command "xalp : drgba $__r_col,$__g_col,$__b_col" +else +command "xalp : drgba" +fi +command "xalpa: xalp to_a" +command "out2display : skip ${""1=},${""2=},${""3=},${""4=1},${""5=1},${""6=},${""7=},${""8=},${""9=},${""10=} if narg($""1) if $""1 $__bg rv blend alpha fi fi xalp if narg($""6) if narg($""2)&&narg($""3)&&narg($""4)&&narg($""5) {$""4},{$""5},1,{s#0},i(#-1,$""2+x,$""3+y) f. begin(ww=w-1;hh=h-1;);(x<(2+narg($""7))||x>ww-2)||(y<(2+narg($""7))||y>hh-2)?(xor($""6,i)>128?0:255):i j[0] [-1],$""2,$""3 rm. if narg($""8)&&narg($""9)&&narg($""10) if $""8==0||$""8>2 {$""4},{$""5},1,{s#0},i(#0,$__nw+($__min_tile*$""9)-$""2+x-$""4,$""3+y) f. begin(ww=w-1;hh=h-1;);(x<(2+narg($""7))||x>ww-2)||(y<(2+narg($""7))||y>hh-2)?(xor($""6,i)>128?0:255):i j[0] [-1],{$__nw+($__min_tile*$""9)-$""2-$""4},$""3 rm. fi if $""8==1||$""8>2 {$""4},{$""5},1,{s#0},i(#0,$""2+x,$__nh+($__min_tile*$""10)-$""3+y-$""5) f. begin(ww=w-1;hh=h-1;);(x<(2+narg($""7))||x>ww-2)||(y<(2+narg($""7))||y>hh-2)?(xor($""6,i)>128?0:255):i j[0] [-1],$""2,{$__nh+($__min_tile*$""10)-$""3-$""5} rm. fi if $""8==2||$""8>2 {$""4},{$""5},1,{s#0},i(#0,$__nw+($__min_tile*$""9)-$""2+x-$""4,$__nh+($__min_tile*$""10)-$""3+y-$""5) f. begin(ww=w-1;hh=h-1;);(x<(2+narg($""7))||x>ww-2)||(y<(2+narg($""7))||y>hh-2)?(xor($""6,i)>128?0:255):i j[0] [-1],{$__nw+($__min_tile*$""9)-$""2-$""4},{$__nh+($__min_tile*$""10)-$""3-$""5} rm. fi fi fi fi if narg($""7) f[0] begin(ww=w-1;hh=h-1;);(x%$__min_tile==0||y%$__min_tile==0)||(x==ww||y==hh)?$""7:i fi" +command "pass2tile : skip ${""4=2} pass$""1 $""4 f[0] i(#-1,$""2+x,$""3+y) rm." +command "tile2canvas : skip ${""4=0} pass$""1 0 +f. i(#0,$""2+x,$""3+y) if !$""4 rv[-2,-1] fi blend[-2,-1] alpha j[0] [-1],$""2,$""3 rm." +command "tile2canvas_r : +f. 0 j[0] [-1],$""1,$""2 rm. tile2canvas[0] [-1],$""1,$""2,$""3" +if $!==1 +ttw={ceil(w#0/$__min_tile)} +tth={ceil(h#0/$__min_tile)} +isw={$ttw} +ish={$tth} +$ttw,1,1,1 iscl={$ttw-1} store. __isc +$tth,1,1,1 isrl={$tth-1} store. __isr +__nw={$ttw*$__min_tile} +__nh={$tth*$__min_tile} +ttw-=2 +tth-=2 +to_a r $__nw,$__nh,100%,100%,0,0,.5,.5 ++store[0] obg +xalpa +cs={s#-1} ++store[0] __bg +if narg($6) +if $include_tile_img pass$6 0 +else i $6 +fi +if ((w#-1!=w#-2)||(h#-1!=h#-2)) error "Invalid Tile Image!" fi +rm[0] +to_a. +start=1 +else +f 0 +start=0 +fi ++store[0] current_image ++store[0] undo_image +else +error "$!==1=F" +fi +command "tile2canvas_sym : pass$""1 0 +f. i(#0,$""2+x,$""3+y) if $""8==0||$""8==3 [1] if $""7 mirror. x fi +f. i(#0,$__nw+($__min_tile*$""9)-$""4-$""2+x,$""3+y) fi if $""8==1||$""8==3 [1] if $""7 mirror. y fi +f. i(#0,$""2+x,$__nh+($__min_tile*$""10)-$""5-$""3+y) fi if $""8==2||$""8==3 [1] if $""7 rotate. 180 fi +f. i(#0,$__nw+($__min_tile*$""9)-$""4-$""2+x,$__nh+($__min_tile*$""10)-$""5-$""3+y) fi if $""8==3 if !$""6 rv[-8,-7] rv[-6,-5] fi blend[-8,-7] alpha blend[-6,-5] alpha fi if !$""6 rv[-4,-3] rv[-2,-1] fi blend[-4,-3] alpha blend[-2,-1] alpha if $""8==3 j[0] [-4],$""2,$""3 j[0] [-3],{$__nw+($__min_tile*$""9)-$""4-$""2},$""3 j[0] [-2],$""2,{$__nh+($__min_tile*$""10)-$""5-$""3} j[0] [-1],{$__nw+($__min_tile*$""9)-$""4-$""2},{$__nh+($__min_tile*$""10)-$""5-$""3} k[0] else j[0] [-2],$""2,$""3 if $""8==0 j[0] [-1],{$__nw+($__min_tile*$""9)-$""4-$""2},$""3 elif $""8==1 j[0] [-1],$""2,{$__nh+($__min_tile*$""10)-$""5-$""3} elif $""8==2 j[0] [-1],{$__nw+($__min_tile*$""9)-$""4-$""2},{$__nh+($__min_tile*$""10)-$""5-$""3} fi rm[-2,-1] fi" +command "tile2canvas_r_sym : +f. 0 j[0] [-1],$""1,$""2 if $""6==3||$""6==0 j[0] [-1],{$__nw+($__min_tile*$""7)-$""3-$""1},$""2 fi if $""6==3||$""6==1 j[0] [-1],$""1,{$__nh+($__min_tile*$""8)-$""4-$""2} fi if $""6==3||$""6==2 j[0] [-1],{$__nw+($__min_tile*$""7)-$""3-$""1},{$__nh+($__min_tile*$""8)-$""4-$""2} fi rm. if $""5&&($""6==3||$""6==0) +mirror[1] x fi if $""5&&($""6==3||$""6==1) +mirror[1] y fi if $""5&&($""6==3||$""6==2) +rotate[1] 180 fi if $""6==3 tile2canvas[0] [{$""5?-4:1}],$""1,$""2 tile2canvas[0] [{$""5?-3:1}],{$__nw+($__min_tile*$""7)-$""3-$""1},$""2 tile2canvas[0] [{$""5?-2:1}],$""1,{$__nh+($__min_tile*$""8)-$""4-$""2} tile2canvas[0] [{$""5?-1:1}],{$__nw+($__min_tile*$""7)-$""3-$""1},{$__nh+($__min_tile*$""8)-$""4-$""2} k[0,1] else tile2canvas[0] [1],$""1,$""2 if $""6==0 tile2canvas[0] [{$""5?2:1}],{$__nw+($__min_tile*$""7)-$""3-$""1},$""2 elif $""6==1 tile2canvas[0] [{$""5?2:1}],$""1,{$__nh+($__min_tile*$""8)-$""4-$""2} elif $""6==2 tile2canvas[0] [{$""5?2:1}],{$__nw+($__min_tile*$""7)-$""3-$""1},{$__nh+($__min_tile*$""8)-$""4-$""2} fi k[0,1] fi" +command "addsym2display : tlx={w#0/2+($""2/2)*$""3-2} tly={h#0/2+($""2/2)*$""4-2} if $""1<2 if $""1==0 4,{h#0},1,{s#0},begin(ww=w-1;dp=$""1<2?0:1;lp=dp+1;);x==0||x==ww?dp:lp elif $""1==1 {w#0},4,1,{s#0},begin(hh=h-1;dp=$""1<2?0:1;lp=dp+1;);y==0||y==hh?dp:lp fi *. 255 if $""1==0 j[0] [-1],$tlx,0 else j[0] [-1],0,$tly fi k[0] else ntlx={$tlx+3} ntly={$tly+3} f[0] ((x>=$tlx&&x<=$ntlx)||(y>=$tly&&y<=$tly+3))?((x==$tlx||x==$ntlx)||(y==$tly||y==$ntly)?0:255):i fi" +command "filter_to_selected_row_column: if $__altmode_orientation $__isr f[0] i(#-1,floor((y+$__pmin*$__min_tile)/$__min_tile),0,0,0)?i:0 else $__isc f[0] i(#-1,floor((x+$__pmin*$__min_tile)/$__min_tile),0,0,0)?i:0 fi k[0]" +command "out2display_alt : skip ${""1=},${""2=},${""3=},${""4=},${""5=} if $__altmode_orientation?$__vmax_y:$__vmax_x sh {s-1} if $__altmode_orientation $__isr f.. i(#-1,floor(y/$__min_tile),0,0,0)?i:i*.625 else $__isc f.. i(#-1,floor(x/$__min_tile),0,0,0)?i:i*.625 fi rm[-2,-1] fi if narg($""1) if $""1 $__bg rv blend alpha fi fi xalp if narg($""2) if $__altmode_orientation $__isr {w#0},{h#0},1,1,i(#-1,floor(y/$__min_tile),0,0,0)?1:0 else $__isc {w#0},{h#0},1,1,i(#-1,floor(x/$__min_tile),0,0,0)?1:0 fi f. ($__altmode_orientation?i(#-2,floor(y/$__min_tile),0,0,0):i(#-2,floor(x/$__min_tile),0,0,0))?!(i&&(j(-2,-2,0,0)&&j(-2,-1,0,0)&&j(-2,0,0,0)&&j(-2,1,0,0)&&j(-2,2,0,0)&&j(-1,-2,0,0)&&j(-1,-1,0,0)&&j(-1,0,0,0)&&j(-1,1,0,0)&&j(-1,2,0,0)&&j(1,-2,0,0)&&j(1,-1,0,0)&&j(1,0,0,0)&&j(1,1,0,0)&&j(1,2,0,0)&&j(2,-2,0,0)&&j(2,-1,0,0)&&j(2,0,0,0)&&j(2,1,0,0)&&j(2,2,0,0)&&j(0,-2,0,0)&&j(0,-1,0,0)&&j(0,1,0,0)&&j(0,2,0,0))) if narg($""3) f. !($__altmode_orientation?i(#-2,floor(x/$__min_tile),0,0,0):i(#-2,floor(y/$__min_tile),0,0,0))?(i?(j(-1,0)||j(0,-1))):i fi rm.. f[0] i(#-1,x,y,z,0)?(xor(i(#-1,x,y,z,0)*$__trackpadcol_alt,i)>128?0:255):i rm. fi if narg($""4)||narg($""5) if $__altsymmetry_mode if $__altmode_orientation {w#0},{$__min_tile},1,{s#0},i(#0,x,$""5+y) {w#0},{$__min_tile},1,{s#0},i(#0,x,$__nh+($__altsymmetry_posy-1)*$__min_tile-$""5+y) f[-2,-1] begin(ww=w-1;hh=h-1;);(x<(2+narg($""3))||x>ww-2)||(y<(2+narg($""3))||y>hh-2)?(xor($__trackpadcol_alt,i)>128?0:255):i j... [-2],0,$""5 j... [-1],0,{h#0+($__altsymmetry_posy-1)*$__min_tile-$""5} else {$__min_tile},{h#0},1,{s#0},i(#0,$""4+x,y) {$__min_tile},{h#0},1,{s#0},i(#0,$__nw+($__altsymmetry_posx-1)*$__min_tile-$""4+x,y) f[-2,-1] begin(ww=w-1;hh=h-1;);(x<(2+narg($""3))||x>ww-2)||(y<(2+narg($""3))||y>hh-2)?(xor($__trackpadcol_alt,i)>128?0:255):i j... [-2],$""4,0 j... [-1],{w#0+($__altsymmetry_posx-1)*$__min_tile-$""4},0 fi rm[-2,-1] else if $__altmode_orientation {w#0},{$__min_tile},1,{s#0},i(#0,x,$""5+y) f. begin(ww=w-1;hh=h-1;);(x<(2+narg($""3))||x>ww-2)||(y<(2+narg($""3))||y>hh-2)?(xor($__trackpadcol_alt,i)>128?0:255):i j.. [-1],0,$""5 else {$__min_tile},{h#0},1,{s#0},i(#0,$""4+x,y) f. begin(ww=w-1;hh=h-1;);(x<(2+narg($""3))||x>ww-2)||(y<(2+narg($""3))||y>hh-2)?(xor($__trackpadcol_alt,i)>128?0:255):i j.. [-1],$""4,0 fi rm. fi fi if narg($""3) f. begin(ww=w-1;hh=h-1;);(x%$__min_tile==0||y%$__min_tile==0)||(x==ww||y==hh)?$""3:i fi" +command "out2display_alt_perp : skip ${""3=},${""4=} if narg($""3) if $""3 $__bg rv blend alpha fi fi xalp if $__altmode_orientation $__isr {w#0},{$__pdiff*$__min_tile},1,{s#0},i(#-1,floor(y/$__min_tile)+$__pmin,0,0,0) f. i?(!(j(-2,-2)&&j(-2,-1)&&j(-2,0)&&j(-2,1)&&j(-2,2)&&j(-1,-2)&&j(-1,-1)&&j(-1,0)&&j(-1,1)&&j(-1,2)&&j(0,-2)&&j(0,-1)&&j(0,1)&&j(0,2)&&j(1,-2)&&j(1,-1)&&j(1,0)&&j(1,1)&&j(1,2)&&j(2,-2)&&j(2,-1)&&j(2,0)&&j(2,1)&&j(2,2))?(xor($__trackpadcol_alt,i(#0,x,$""2+y))>128?0:255):i(#0,x,$""2+y)):i(#0,x,$""2+y); j[0] [-1],0,$""2 else $__isc {$__pdiff*$__min_tile},{h#0},1,{s#0},i(#-1,floor(x/$__min_tile)+$__pmin,0,0,0) f. i?(!(j(-2,-2)&&j(-2,-1)&&j(-2,0)&&j(-2,1)&&j(-2,2)&&j(-1,-2)&&j(-1,-1)&&j(-1,0)&&j(-1,1)&&j(-1,2)&&j(0,-2)&&j(0,-1)&&j(0,1)&&j(0,2)&&j(1,-2)&&j(1,-1)&&j(1,0)&&j(1,1)&&j(1,2)&&j(2,-2)&&j(2,-1)&&j(2,0)&&j(2,1)&&j(2,2))?(xor($__trackpadcol_alt,i(#0,$""1+x,y))>128?0:255):i(#0,$""1+x,y)):i(#0,$""1+x,y); j[0] [-1],$""1,0 fi rm[-2,-1] if narg($""4) f. begin(ww=w-1;hh=h-1;);(x%$__min_tile==0||y%$__min_tile==0)||(x==ww||y==hh)?$""4:i fi" +command "keeperase_rowcolumn : if $__altmode_orientation $__isr if $""1 f.. i(#-1,floor(y/$__min_tile),0,0,0)?i:0 else f.. i(#-1,floor(y/$__min_tile),0,0,0)?0:i fi else $__isc if $""1 f.. i(#-1,floor(x/$__min_tile),0,0,0)?i:0 else f.. i(#-1,floor(x/$__min_tile),0,0,0)?0:i fi fi rm." +command "shift_rowcolumn : if $__altmode_orientation $__isr if !($__shiftboundary>0&&$__shiftboundary<4) f[0] i(#-1,floor(y/$__min_tile),0,0,0)?j(-$""1,0,0,0,0,$__shiftboundary-($__shiftboundary?2)):i; else f[0] begin(ww=w-1;);i(#-1,floor(y/$__min_tile),0,0,0)?i(x-$""1>ww?((w-$__min_tile)+($__shiftboundary==3?(floor((x-$""1-w)/$__min_tile)%2?(x-w)%$__min_tile:$__min_tile-(x-w)%$__min_tile-1):(($__shiftboundary-1)?($__min_tile-(x-w)%$__min_tile-1):(x-w)%$__min_tile))):(x-$""1>=0?x-$""1:($__shiftboundary==3?(floor((x-$""1)/$__min_tile)%2?($__min_tile-x%$__min_tile):x%$__min_tile):(($__shiftboundary-1)?($__min_tile-x%$__min_tile):x%$__min_tile))),y):i; fi else $__isc if !($__shiftboundary>0&&$__shiftboundary<4) f[0] i(#-1,floor(x/$__min_tile),0,0,0)?j(0,-$""2,0,0,0,$__shiftboundary-($__shiftboundary?2)):i; else f[0] begin(hh=h-1;);i(#-1,floor(x/$__min_tile),0,0,0)?i(x,y-$""2>hh?((h-$__min_tile)+($__shiftboundary==3?(floor((y-$""2-h)/$__min_tile)%2?(y-h)%$__min_tile:$__min_tile-(y-h)%$__min_tile-1):(($__shiftboundary-1)?($__min_tile-(y-h)%$__min_tile-1):(y-h)%$__min_tile))):(y-$""2>=0?y-$""2:($__shiftboundary==3?(floor((y-$""2)/$__min_tile)%2?($__min_tile-y%$__min_tile):y%$__min_tile):(($__shiftboundary-1)?($__min_tile-y%$__min_tile):y%$__min_tile)))):i; fi fi rm." +command "place_rowcolumn : if $__altmode_orientation if $__altplace_replacemode $__isr pass$""1 0 {w#-1},{h#-1},1,1,i(#-2,floor(y/$__min_tile)+$__pmin,0,0,0) j[0] [-2],0,$""3,0,0,1,[-1],1 else pass$""1 0 {w#0},{h#0},1,{s#0},j(#-1,0,-$""3) rm.. if $__altplacebackmode rv fi blend alpha fi else if $__altplace_replacemode $__isc pass$""1 0 {w#-1},{h#-1},1,1,i(#-2,floor(x/$__min_tile)+$__pmin,0,0,0) j[0] [-2],$""2,0,0,0,1,[-1],1 else pass$""1 0 {w#0},{h#0},1,{s#0},j(#-1,-$""2,0) rm.. if $__altplacebackmode rv fi blend alpha fi fi k[0]" +command "fill_tiles2canvas : if $__fill_boundary==0 f[0] i(#-1,x%w#-1,y%h#-1) elif $__fill_boundary==1 f[0] i(#-1,int(x/w#-1)%2?w#-1-1-x%w#-1:x%w#-1,int(y/h#-1)%2?h#-1-1-y%h#-1:y%h#-1) elif $__fill_boundary==2 f[0] i(#-1,int(x/w#-1)%2?w#-1-1-x%w#-1:x%w#-1,y%h#-1) elif $__fill_boundary==3 f[0] i(#-1,x%w#-1,int(y/h#-1)%2?h#-1-1-y%h#-1:y%h#-1) fi" +v + +e[] "\n Instruction on how to work with interactive windows.\n +\ ---------------------------------------------------------\n\n +\ Press Escape on Canvas Window to exit!\n\n +\ *** MAIN EDITING MODE ***\n\n +\ - On any window - \n +\ * D: Switch between Place/Eraser Mode\n +\ * R: Activate Replace Mode\n +\ * W: Restore All Windows\n +\ * SPACEBAR: Switch Mode\n\n +\ - On Canvas window - \n +\ * C: Activate Copy Mode On/Off\n +\ * X: Activate Cut Mode On/Off\n +\ * Z: Undo Canvas Changes\n +\ * F: Activate/Deactivate Background Tile Layering Mode\n +\ * G: Activate Canvas Grid Mode On/Off\n +\ * Q: Remove/Restore Background\n +\ * A: Enable/Disable Tracker\n +\ * S: Activate Symmetry Mode\n\n +\ -- On Canvas [Symmetry Mode] --\n +\ * 1: Switch Symmetry Axis to X-Axis\n +\ * 2: Switch Symmetry Axis to Y-Axis\n +\ * 3: Switch Symmetry Axis to Cross XY-Axis\n +\ * 4: Switch Symmetry Axis to Mirror XY-Axis\n +\ * ARROWKEY: Move Symmetry Line\n +\ * B: Switch Axis in Symmetry Mode\n +\ * M: Switch between Periodic/Mirror boundary mode in Symmetry Mode\n +\ * J: Symmetry Line(s) to Center\n +\ * S: Deactivate Symmetry Mode\n\n +\ - On Tileset window - \n +\ * G: Activate Tileset Grid Mode On/Off\n +\ * CTRL+ARROWKEY: Resize Tile Selection Box\n +\ * ARROWKEY: Scroll through tileset\n\n +\ - On Tile window - \n +\ * CTRL+ARROWKEY: Mirror alongside axis\n +\ * ARROWKEY: Rotate Tile\n +\ * MOUSE BUTTON: Switch between Place/Eraser Mode\n\n +\ -- On Tile [No Symmetry Mode] --\n +\ * 1: Switch Fill Boundary to Periodic\n +\ * 2: Switch Fill Boundary to Mirror\n +\ * 3: Switch Fill Boundary to Mirror X\n +\ * 4: Switch Fill Boundary to Mirror Y\n +\ * B: Increment Fill Boundary Mode\n\n +\ *** ROW/COLUMN EDITING MODE ***\n\n +\ - On any window - \n +\ * W: Restore All Windows\n +\ * SPACEBAR: Switch Mode\n\n +\ - On Canvas window - \n +\ * Z: Undo Canvas Changes\n +\ * T: Enable Row/Column Shifting Mode\n +\ * E: Activate Place Mode\n +\ * G: Activate Canvas Grid Mode On/Off\n +\ * Q: Remove/Restore Background\n +\ * A: Enable/Disable Tracker\n +\ * S: Activate Symmetrical Selection Mode\n\n +\ -- On Canvas [Selection Mode] --\n +\ * C: Keep Selected Row/Column\n +\ * X: Delete Selected Row/Column\n +\ * D: Select/Deselect Row/Column\n +\ * R: Clear Selection\n +\ * V: View Selection Box/Hide Selection Box\n +\ * Mouse Button: Select or Deselect\n +\ * ARROWKEY: Switch between Row/Column Selection Mode\n\n +\ -- On Canvas [Selection Mode](Symmetry Mode)--\n +\ * J: Symmetry Line to Center\n +\ * ARROWKEY: Move Symmetry Line\n +\ * S: Deactivate Symmetrical Selection Mode\n\n +\ -- On Canvas [Row/Column Shifting Mode] --\n +\ * Mouse Button (First Click): Activate Shifting\n +\ * Mouse Button (Second Click): Finalize Shifting\n +\ * 0: Shift Boundary Mode - None\n +\ * 1: Shift Boundary Mode - Neumann (Periodic)\n +\ * 2: Shift Boundary Mode - Neumann (Mirror)\n +\ * 3: Shift Boundary Mode - Neumann (Alternating)\n +\ * 4: Shift Boundary Mode - Periodic\n +\ * 5: Shift Boundary Mode - Mirror\n +\ * ARROWKEY: Switch between row/column\n +\ * T: Disable Row/Column Shifting Mode\n\n +\ -- On Canvas [Place Mode] --\n +\ * Mouse Button: Place Row/Column\n +\ * B: Switch between Replacement/Placement Mode\n +\ * F: In Placement Mode, switch between background/foreground placement mode\n +\ * E: Deactivate Place Mode\n\n +\ -- On Tile window - \n +\ * ARROWKEY: Flip Row/Column\n +\ ---------------------------------------------------------\n" +v - +if $include_tileset_image +pass$1 0 +else +i $1 +fi +local[-1] { +xr={ceil(w#-1/(abs($4)*$__min_tile))} +yr={ceil(h#-1/(abs($5)*$__min_tile))} +split_tiles. {-abs($4)*$__min_tile},{-abs($5)*$__min_tile} +mw=${-max_w} +mh=${-max_h} +tsw={$mw-$__min_tile} +tsh={$mh-$__min_tile} +ti={$!} +} +$__min_tile,$__min_tile,1,4,0 +fti={$!} +$__bg ++xalp. +dw0c={w#0} +dh0c={h#0} +dwm0=0 +dwm1=0 +dwm2=0 +d2rw=196 +w[-1] {w#0},{h#0},0,"Canvas" +rm[-2,-1] ++xalp[1] +w1[-1] {w#1},{h#1},0,"Tileset" rm. +w2[-1] $d2rw,$d2rw,0,"Tile" ++store. switchmode_tile +fti={$!} +mode=0 +icx=0 +icy=0 +ci=0 +lr=0 +tb=0 +tbc=0 +ni=1 +cutcopymode=0 +erasemode=0 +replacemode=0 +editmode=0 +symmetrymode=0 +symmetryaxis=0 +symmetrybound=0 +symmetry_posx=0 +symmetry_posy=0 +canvas_background=1 +canvas_gridmode=0 +canvas_tracker=1 +tileset_gridmode=0 +temp_tileset_gridmode=0 +select_from_tileset=0 +resize_tile_from_tileset=0 +resize_tile_from_canvas=0 +transform_tile=0 +switch_tile_set=0 +tile_placement_mode=0 +current_csx=-1 +current_csy=-1 +optinsert=1 +__fill_boundary=0 +__corner_fill=0 +activated_switched_twice=0 +modeswitched=0 +mainaltmode=1 +viewselectionbox=1 +selectionboxmode=0 +deselectmode=0 +activate_deselect_select=0 +movemode=0 +delmode=0 +transfermode=0 +rowcolumnshiftmode=0 +shiftplacecount=0 +__shiftboundary=1 +altrcx1=-1 +altrcy1=-1 +altrcx2=-1 +altrcx2=-1 +current_acsx=-1 +current_acsy=-1 +altx=-1 +alty=-1 +tempaltx=-1 +tempalty=-1 +activate_altpreview=0 +activate_altpass2tile=0 +__altsymmetry_mode=0 +__altsymmetry_posx=0 +__altsymmetry_posy=0 +__altmode_orientation=0 +__vmax_x=0 +__vmax_y=0 +pmax=0 +__pmin=0 +__pdiff=0 +place_rowcolumn_mode=0 +__altplacebackmode=0 +__altplace_replacemode=1 +do +main_w_title="Canvas" +if $start +if $mode main_w_title.=" [Row/Column Editing Mode]" +else main_w_title.=" [Main Editing Mode] -" fi +fi +modeswitched=0 +if {*,SPACE}" || "{*1,SPACE}" || "{*2,SPACE}" && "$start mode+=1 mode={$mode%2} modeswitched=1 wait 100 fi +if $modeswitched ++store. temp_switch_tile +$switchmode_tile +rv[-2,-1] +rm. +$temp_switch_tile +store. switchmode_tile +if $mode ++out2display. , w2[-1] {w#-1},{h#-1},-1,-1,"Tile" rm. +w1[] 0 +else ++out2display. , w2[-1] {$d2rw+($d2rw*$icx)},{$d2rw+($d2rw*$icy)} rm. ++out2display[$ni] , w1[-1] {w#$ni+$dwm1*w#$ni},{h#$ni+$dwm1*h#$ni} rm. +fi +fi +if $start&&$mode +if {*,G} canvas_gridmode+=1 canvas_gridmode={$canvas_gridmode%2} wait 100 activate_altpreview=1 fi +if {*,Q} canvas_background+=1 canvas_background={$canvas_background%2} wait 100 activate_altpreview=1 fi +if {*,A} canvas_tracker+=1 canvas_tracker={$canvas_tracker%2} wait 100 activate_altpreview=1 fi +if {*,S} __altsymmetry_mode+=1 __altsymmetry_mode={$__altsymmetry_mode%2} wait 200 activate_altpreview=1 fi +if {*,E} mainaltmode+=1 mainaltmode={$mainaltmode%2} wait 200 activate_altpreview=1 fi +if {*,V} viewselectionbox+=1 viewselectionbox={$viewselectionbox%2} wait 200 activate_altpreview=1 fi +if $mainaltmode if {*,D} deselectmode+=1 deselectmode={$deselectmode%2} wait 200 activate_altpreview=1 activate_deselect_select=1 fi fi +undo_state=0 +if {*,Z} undo_state=1 fi +if $undo_state ++store[0] temp_undo +$undo_image +rv[0,-1] +rm. +activate_altpreview=1 +$temp_undo +store. undo_image +fi +if {*,T} rowcolumnshiftmode+=1 rowcolumnshiftmode={$rowcolumnshiftmode%2} wait 200 activate_altpreview=1 if $shiftplacecount shiftplacecount=0 fi fi +if $rowcolumnshiftmode +if {*,0} __shiftboundary=0 wait 200 activate_altpreview=1 fi +if {*,1} __shiftboundary=1 wait 200 activate_altpreview=1 fi +if {*,2} __shiftboundary=2 wait 200 activate_altpreview=1 fi +if {*,3} __shiftboundary=3 wait 200 activate_altpreview=1 fi +if {*,4} __shiftboundary=4 wait 200 activate_altpreview=1 fi +if {*,5} __shiftboundary=5 wait 200 activate_altpreview=1 fi +if {*,M} __shiftboundary+=1 __shiftboundary={$__shiftboundary%6} wait 200 activate_altpreview=1 fi +fi +if {*,W} w[] 1 w2[] 1 fi +if {*2,ARROWLEFT}" || "{*2,ARROWRIGHT} mirror. x transform_tile=1 wait 100 +elif {*2,ARROWUP}" || "{*2,ARROWDOWN} mirror. y transform_tile=1 wait 100 +fi +if $transform_tile ++out2display. , w2[-1] rm. +transform_tile=0 +fi +if !$mainaltmode +if {*,B} __altplace_replacemode+=1 __altplace_replacemode={$__altplace_replacemode%2} wait 200 activate_altpreview=1 fi +if !$__altplace_replacemode&&{*,F} __altplacebackmode+=1 __altplacebackmode={$__altplacebackmode%2} wait 200 activate_altpreview=1 fi +fi +if {*,R} +if $__altmode_orientation +$__isr f. 0 store. __isr __vmax_y=0 +else +$__isc f. 0 store. __isc __vmax_x=0 +fi +activate_altpreview=1 +fi +if $mainaltmode&&!$rowcolumnshiftmode +if $__altsymmetry_mode +if $__altmode_orientation +if {*,ARROWUP} __altsymmetry_posy-=1 __altsymmetry_posy={max(-$tth,$__altsymmetry_posy)} activate_altpreview=1 wait 200 fi +if {*,ARROWDOWN} __altsymmetry_posy+=1 __altsymmetry_posy={min($tth,$__altsymmetry_posy)} activate_altpreview=1 wait 200 fi +if {*,ARROWLEFT}||{*,ARROWRIGHT} __altmode_orientation=0 activate_altpreview=1 wait 200 fi +if {*,J} __altsymmetry_posy=0 activate_altpreview=1 wait 200 fi +else +if {*,ARROWLEFT} __altsymmetry_posx-=1 __altsymmetry_posx={max(-$ttw,$__altsymmetry_posx)} activate_altpreview=1 wait 200 fi +if {*,ARROWRIGHT} __altsymmetry_posx+=1 __altsymmetry_posx={min($ttw,$__altsymmetry_posx)} activate_altpreview=1 wait 200 fi +if {*,ARROWUP}||{*,ARROWDOWN} __altmode_orientation=1 activate_altpreview=1 wait 200 fi +if {*,J} __altsymmetry_posx=0 activate_altpreview=1 wait 200 fi +fi +else +if {*,ARROWLEFT}||{*,ARROWRIGHT}||{*,ARROWUP}||{*,ARROWDOWN} __altmode_orientation+=1 __altmode_orientation={$__altmode_orientation%2} activate_altpreview=1 wait 200 fi +fi +elif $mainaltmode&&$rowcolumnshiftmode +if {*,ARROWLEFT}||{*,ARROWRIGHT} __altmode_orientation+=1 __altmode_orientation={$__altmode_orientation%2} activate_altpreview=1 wait 200 fi +fi +if $mainaltmode&&!$rowcolumnshiftmode +if $deselectmode main_w_title.=" - [Deselection]" +else main_w_title.=" - [Selection]" +fi +elif $mainaltmode&&$rowcolumnshiftmode +main_w_title.=" - [Shift] (Boundary Condition - " +if $__shiftboundary==0 main_w_title.="None)" +elif $__shiftboundary==1 main_w_title.="Neumann (Periodic))" +elif $__shiftboundary==2 main_w_title.="Neumann (Mirror))" +elif $__shiftboundary==3 main_w_title.="Neumann (Alternating))" +elif $__shiftboundary==4 main_w_title.="Periodic)" +else main_w_title.="Mirror)" +fi +else +main_w_title.=" - [Place] " +if $__altplace_replacemode +main_w_title.="(Replacement Mode)" +else +if $__altplacebackmode main_w_title.="(Background)" +else main_w_title.="(Foreground)" +fi +fi +fi +if $viewselectionbox&&$canvas_gridmode +canvas_set=$canvas_background,$viewselectionbox,$gridcol, +elif $viewselectionbox +canvas_set=$canvas_background,$viewselectionbox,, +elif $canvas_gridmode +canvas_set=$canvas_background,,$gridcol, +fi +x,y,b,ww,wh={*,x,y,b,w,h} +if $b" && "$x>=0" && "$y>=0" && "$x0:$__vmax_x>0 +if $activate_altpass2tile +if !$__altmode_orientation +r. {$__pdiff*$__min_tile},{h#0} +pass2tile. [0],{$__pmin*$__min_tile},0 +else +r. {w#0},{$__pdiff*$__min_tile} +pass2tile. [0],0,{$__pmin*$__min_tile} +fi +filter_to_selected_row_column. ++out2display. , w2[-1] {w#-1},{h#-1},-1,-1,"Tile" rm. +fi +activate_altpass2tile=0 +if {*,K}||{*,C} ++store[0] undo_image +keeperase_rowcolumn[0] 1 +wait 200 +activate_altpreview=1 +fi +if {*,X} ++store[0] undo_image +keeperase_rowcolumn[0] 0 +wait 200 +activate_altpreview=1 +fi +else +r. 1,1 +f. 0 ++out2display. , w2[-1] {$d2rw},{$d2rw},-1,-1,"Tile" rm. +mainaltmode=1 +rowcolumnshiftmode=0 +deselectmode=0 +fi +if $mainaltmode +if !$rowcolumnshiftmode +if $x>=0" && "$y>=0" && "$x=0" && "$y>=0" && "$x=0" && "$y>=0" && "$x=0?min($ttw,$symmetry_posx):max(-$ttw,$symmetry_posx)} +symmetry_posy={$symmetry_posy>=0?min($tth,$symmetry_posy):max(-$tth,$symmetry_posy)} +else +if {*2,1} __fill_boundary=0 wait 200 +elif {*2,2} __fill_boundary=1 wait 200 +elif {*2,3} __fill_boundary=2 wait 200 +elif {*2,4} __fill_boundary=3 wait 200 +fi +if {*2,B} __fill_boundary={($__fill_boundary+1)%4} wait 200 fi +fi +if $canvas_gridmode +if $canvas_tracker canvas_endset=,$trackpadcol,$gridcol, +else canvas_endset=,,$gridcol, +fi +else +if $canvas_tracker canvas_endset=,$trackpadcol, +else canvas_endset=",," +fi +fi +if {*,C}" || "{*,X} +if {*,X} cutcopymode=1 +else cutcopymode=2 +fi +fi +if {*,D}" || "{*1,D}" || "{*2,D} +erasemode+=1 +erasemode={$erasemode%2} +if $erasemode +f. 0 w2[-1] {$d2rw+($d2rw*$icx)},{$d2rw+($d2rw*$icy)} rm. +else +out2display. , w2[-1] {$d2rw+($d2rw*$icx)},{$d2rw+($d2rw*$icy)} rm. +fi +optinsert=1 +fi +if {*1,G} tileset_gridmode+=1 tileset_gridmode={$tileset_gridmode%2} wait 200 temp_tileset_gridmode=1 fi +x,y,b,ww,wh={*,x,y,b,w,h} +x1,y1,b1,ww1,wh1={*1,x,y,b,w,h} +x2,y2,b2,ww2,wh2={*2,x,y,b,w,h} +if $start +if $undo_state ++store[0] temp_undo +$undo_image +rv[0,-1] +rm. +$temp_undo +store. undo_image +fi +if {{*2,CTRLLEFT}" || "{*2,CTRLRIGHT}}" && "{{*2,ARROWLEFT}" || "{*2,ARROWRIGHT}} +mirror. x transform_tile=1 +wait 100 +elif {{*2,CTRLLEFT}" || "{*2,CTRLRIGHT}}" && "{{*2,ARROWUP}" || "{*2,ARROWDOWN}} +mirror. y transform_tile=1 +wait 100 +elif {*2,ARROWLEFT}||{*2,ARROWRIGHT} +temp_tile_width=$tile_width +temp_tile_height=$tile_height +temp_icx=$icx +temp_icy=$icy +icx=$temp_icy +icy=$temp_icx +tile_width=$temp_tile_height +tile_height=$temp_tile_width +if {*2,ARROWRIGHT} rotate. 90 else rotate. -90 fi +transform_tile=1 +wait 100 +fi +if {*2,O}" && "!$symmetrymode ++store[0] undo_image +fill_tiles2canvas +wait 100 +fi +if $transform_tile ++out2display. , w2[-1] {$d2rw+($d2rw*$icx)},{$d2rw+($d2rw*$icy)} rm. +transform_tile=0 +optinsert=1 +fi +if {{{*1,CTRLLEFT}" || "{*1,CTRLRIGHT}}" && "{*1,ARROWRIGHT}} +if $select_from_tileset +icx+=1 +icx={min($icx,$max_increment)} +tile_width={$__min_tile+($icx*$__min_tile)} +fi +if $select_from_tileset resize_tile_from_tileset=1 fi +wait 500 +elif {{{*1,CTRLLEFT}" || "{*1,CTRLRIGHT}}" && "{*1,ARROWLEFT}} +if $select_from_tileset +icx-=1 +icx={max($icx,0)} +tile_width={$__min_tile+($icx*$__min_tile)} +fi +if $select_from_tileset resize_tile_from_tileset=1 fi +wait 500 +elif {{{*1,CTRLLEFT}" || "{*1,CTRLRIGHT}}" && "{*1,ARROWDOWN}} +if $select_from_tileset +icy+=1 +icy={min($icy,$max_increment)} +tile_height={$__min_tile+($icy*$__min_tile)} +fi +if $select_from_tileset resize_tile_from_tileset=1 fi +wait 500 +elif {{{*1,CTRLLEFT}" || "{*1,CTRLRIGHT}}" && "{*1,ARROWUP}} +if $select_from_tileset +icy-=1 +icy={max($icy,0)} +tile_height={$__min_tile+($icy*$__min_tile)} +fi +if $select_from_tileset resize_tile_from_tileset=1 fi +wait 500 +elif {*1,ARROWRIGHT} +select_from_tileset=0 +lr+=1 +lr={$lr%$xr} +ci={($lr+$tb)%$ti} +ni={$ci+1} +switch_tile_set=1 +tsw={w#$ni-$__min_tile} +tsh={h#$ni-$__min_tile} +wait 625 +elif {*1,ARROWLEFT} +select_from_tileset=0 +lr-=1 +lr={$lr%$xr} +ci={($lr+$tb)%$ti} +ni={$ci+1} +tsw={w#$ni-$__min_tile} +tsh={h#$ni-$__min_tile} +switch_tile_set=1 +wait 625 +elif {*1,ARROWDOWN} +select_from_tileset=0 +tbc+=1 +tbc={$tbc%$yr} +tb={$tbc*$xr} +ci={($lr+$tb)%$ti} +ni={$ci+1} +tsw={w#$ni-$__min_tile} +tsh={h#$ni-$__min_tile} +switch_tile_set=1 +wait 625 +elif {*1,ARROWUP} +select_from_tileset=0 +tbc-=1 +tbc={$tbc%$yr} +tb={$tbc*$xr} +ci={($lr+$tb)%$ti} +ni={$ci+1} +tsw={w#$ni-$__min_tile} +tsh={h#$ni-$__min_tile} +switch_tile_set=1 +wait 625 +fi +if $switch_tile_set ++out2display[$ni] , w1[-1] {w#$ni+$dwm1*w#$ni},{h#$ni+$dwm1*h#$ni} rm. +switch_tile_set=0 +fi +if $resize_tile_from_tileset +r. $tile_width,$tile_height,100%,100%,0 +tsx={min($tsx,$tsw-($icx*$__min_tile))} tsy={min($tsy,$tsh-($icy*$__min_tile))} +pass2tile. [$ni],$tsx,$tsy ++out2display. , w2[-1] {$d2rw+($d2rw*$icx)},{$d2rw+($d2rw*$icy)} rm. +if $tileset_gridmode ++out2display[$ni] 0,$tsx,$tsy,$tile_width,$tile_height,$trackpadcol,$gridcol +else ++out2display[$ni] 0,$tsx,$tsy,$tile_width,$tile_height,$trackpadcol +fi +w1[-1] rm. +resize_tile_from_tileset=0 +fi +if $b" && "$x>=0" && "$y>=0" && "$x=0" && "$y1>=0" && "$x1=0" && "$y>=0" && "$x12 error narg(\$"13")<13==F fi fi +max_width=${-max_w} +max_height=${-max_h} +if $!>1 $max_width,$max_height,1,1 else channels 0 f 0 fi +cv_0={narg($4)?$4:u(0,1)} +cv_1={narg($5)?$5:u(0,1)} +cv_2={narg($6)?$6:u(0,1)} +cv_3={narg($7)?$7:u(0,1)} +cv_4={narg($8)?$8:u(0,1)} +cv_5={narg($9)?$9:u(0,1)} +cv_6={narg($10)?$10:u(0,1)} +cv_7={narg($11)?$11:u(0,1)} +cv_8={narg($12)?$12:u(0,1)} +1,1,1,1 +eval ${-math_lib}" +interpolate(a,b)=a*-b+(1-a)*b; +eucl_norm(a,b)=sqrt(a^2+b^2); +const use_run=$13; +const mw=w#-2; +const mh=h#-2; +const cenx=mw/2; +const ceny=mh/2; +const cenf=(eucl_norm(cenx,ceny)/2.5)*$3; +xc=yc=zc=0; +const cv_0=$cv_0; +const cv_1=$cv_1; +const cv_2=$cv_2; +const cv_3=$cv_3; +const cv_4=$cv_4; +const cv_5=$cv_5; +const cv_6=$cv_6; +const cv_7=$cv_7; +const cv_8=$cv_8; +if($1<=4, +const a=interpolate(cv_0,3); +const b=interpolate(cv_1,3); +if($1!=3&&$1<4, +const c=interpolate(cv_2,3); +const d=interpolate(cv_3,3); +, +const c=interpolate(cv_2,3); +const d=interpolate(cv_3,3); +const e=interpolate(cv_4,3); +const f=interpolate(cv_5,3); +); +if($1<2,xc=-.5;yc=-.5;, +if($1==2,xc=-1; +); +); +, +if($1==5, +const a=interpolate(cv_0,2); +const b=interpolate(cv_1,2); +const c=interpolate(cv_2,2); +const d=interpolate(cv_3,2); +const e=interpolate(cv_4,2); +const f=interpolate(cv_5,2); +const l=interpolate(cv_6,2); +const h=interpolate(cv_7,2); +const j=interpolate(cv_8,2); +, +const a=interpolate(cv_0,3); +const b=interpolate(cv_1,3); +const c=interpolate(cv_2,3); +const d=interpolate(cv_3,3); +const e=interpolate(cv_4,3); +const f=interpolate(cv_5,3); +); +); +if($1==0, +xnf(cx,cy)=sin(cy*b)+c*sin(b*cx); +ynf(cx,cy)=sin(a*cx)+d*sin(a*cy);, +if($1==1, +xnf(cx,cy)=sin(cy*a)+cos(c*cx); +ynf(cx,cy)=sin(c*cx)-cos(d*cy);, +if($1==2, +xnf(cx,cy)=abs(sin(cy*a)^3)+cos(c*cx); +ynf(cx,cy)=abs(sin(c*cx)^2)-cos(d*cy)^2;, +if($1==3, +xnf(cx,cy)=sin(cy*a)+cos(a*cx); +ynf(cx,cy)=sin(b*cx)-cos(b*cy);, +if($1==4, +xnf_3d(cx,cy,cz)=cy*sin(a*cx)+sin(b*cy); +ynf_3d(cx,cy,cz)=cz*cos(c*cy)-cos(d*cz); +znf_3d(cx,cy,cz)=cx*sin(e*cz)+cos(f*cx);, +if($1==5, +xnf_3d(cx,cy,cz)=cy*sin(a*cx)+cos(b*cy)+sin(c*cz); +ynf_3d(cx,cy,cz)=cz*sin(d*cx)+cos(e*cy)+sin(f*cz); +znf_3d(cx,cy,cz)=cx*sin(l*cx)+cos(h*cy)+sin(j*cz);, +xnf_3d(cx,cy,cz)=cz*sin(a*cx)+cos(b*cy); +ynf_3d(cx,cy,cz)=cx*sin(c*cy)+cos(d*cz); +znf_3d(cx,cy,cz)=cy*sin(e*cz)+cos(f*cx); +); +); +); +); +); +); +const td=abs($2)*10^6; +pixcount=0; +if($1<4, +repeat(td,n, +xn=xnf(xc,yc); +yn=ynf(xc,yc); +xc=xn; +yc=yn; +nx=xn*cenf*.75; +ny=yn*cenf*.75; +fnx=nx>=0?nx:mw+nx; +fny=ny>=0?ny:mh+ny; +if(!i(#-2,fnx,fny),++pixcount;); +i(#-2,fnx,fny)+=1; +if(use_run,if(!(n%200000),run('progress ',100*(n/td)));); +); +, +repeat(td,n, +xn=xnf_3d(xc,yc,zc); +yn=ynf_3d(xc,yc,zc); +zn=znf_3d(xc,yc,zc); +xc=xn; +yc=yn; +zc=zn; +nx=xn*cenf*1; +ny=yn*cenf*1; +fnx=nx>=0?nx:mw+nx; +fny=ny>=0?ny:mh+ny; +if(!i(#-2,fnx,fny),++pixcount;); +i(#-2,fnx,fny)+=1; +if(use_run,if(!(n%200000),run('progress ',100*(n/td)));); +); +); +pixcount; +" +shift.. 50%,50%,0,0,2 rm. +#@cli rep_tg3: eq. to 'rep_trigonometry_three_channel_gradient' +rep_tg3: rep_trigonometry_three_channel_gradient $* +#@cli rep_trigonometry_three_channel_gradient: _resolution,_chan_order={ 0=0,1,2 | 1=0,2,1 | 2=1,0,2 | 3=1,2,0 | 4=2,0,1 | 5=2,1,0 },_chan_form_a={ 0=sinusoidal | 1=cosinusoidal | 2=cubic-sinusoidal | 3=cubic-cosinusoidal | 4=cubic-sinusoidal-cosinusoidal },_multiplier_a>0,_valueshift_a,0>=_midgray_expf_a>=1,_lightness_merge_factor_a>=1,_lightness_end_expf_a>0,0>=_gray2col_end_a>=1,_chan_form_b={ 0=sinusoidal | 1=cosinusoidal | 2=cubic-sinusoidal | 3=cubic-cosinusoidal | 4=cubic-sinusoidal-cosinusoidal },_multiplier_b>0,_valueshift_b,0>=_midgray_expf_b>=1,_lightness_merge_factor_b>=1,_lightness_end_expf_b>0,0>=_gray2col_end_b>=1,_chan_form_c={ 0=sinusoidal | 1=cosinusoidal | 2=cubic-sinusoidal | 3=cubic-cosinusoidal | 4=cubic-sinusoidal-cosinusoidal },_multiplier_c>0,_valueshift_c,0>=_midgray_expf_c>=1,_lightness_merge_factor_c>=1,_lightness_end_expf_c>0,0>=_gray2col_end_c>=1 +#@cli : Creates trigonometry gradients or map images with trigonometry coloring. +#@cli : (eq. to 'rep_tg3').\n +#@cli : '_resolution' defines the length of gradient or the way it is going to be mapped. See below for more information on _resolution. +#@cli : '_chan_order' defines the order of channel of gradient +#@cli : '_chan_form' refers to the formula each channels use +#@cli : '_multiplier' defines the multiplication of base gradient used to map formula based on trigonometry. +#@cli : '_valueshift' refers to the value shift of base gradient +#@cli : '_midgray_expf' refers to the middle-point of base gradient used to map formula based on trigonometry relative to middle. +#@cli : '_lightness_merge_factor' refers to the merging of lightness gradient with color gradient. Used to add white and black to gradient ends. +#@cli : '_lightness_end_expf' defines the magnitude of shades and tind of each end of end gradient +#@cli : '_gray2col_end' defines how much the end gradient overrides the base gradient\n +#@cli : '_resolution' values and processing info +#@cli : ----- +#@cli : Info #1: If '_resolution' is a number: If _resolution is negative, create a 3-channel trigonometry vertical gradient, else create 3-channel trigonometry horizontal gradient. +#@cli : Info #2: If '_resolution' is "8i", then map trigonometry function by first dividing by 255, then perform trigonometry function, finally multiply by 255. +#@cli : Info #3: If '_resolution' is "8il", then image will be converted into RGBA luminosity format, then perform trigonometry function, finally multiply by 255. +#@cli : Info #4: If '_resolution' is empty, then directly map trigonometry function. +#@cli : -----\n +#@cli : Default values: 'resolution=256','_chan_order=0','_chan_form_a=0','_multiplier_a=1','_valueshift_a=0','_midgray_expf_a=1','_lightness_merge_factor_a=1','_lightness_end_expf_a=0','_gray2col_end_a=1','_chan_form_b=_chan_form_a','_multiplier_b=_multiplier_a','_valueshift_b=_valueshift_a','_midgray_expf_b=_midgray_expf_a','_lightness_merge_factor_b=_lightness_merge_factor_a','_lightness_end_expf_b=_lightness_end_expf_a','_gray2col_end_b=_gray2col_end_a','_chan_form_c=_chan_form_b','_multiplier_c=_multiplier_b','_valueshift_c=_valueshift_b','_midgray_expf_c=_midgray_expf_b','_lightness_merge_factor_c=_lightness_merge_factor_b','_lightness_end_expf_c=_lightness_end_expf_b','_gray2col_end_c=_gray2col_end_b'\n +#@cli : Author: Reptorian. +rep_trigonometry_three_channel_gradient: +echo "Map trigonometry function within image"("s")"" +skip ${1=},${2=0},${3=},${4=},${5=},${6=},${7=},${8=},${9=},${10=},${11=},${12=},${13=},${14=},${15=},${16=},${17=},${18=},${19=},${20=},${21=},${22=},${23=} +v + e "\nMap trigonometry function within image"("s")"" v - +if narg($3) channel_formula_a=$3 else channel_formula_a=0 fi +if narg($4) multiplier_a=$4 else multiplier_a=1 fi +if narg($5) valueshift_a=$5 else valueshift_a=0 fi +if narg($6) midgray_expf_a=$6 else midgray_expf_a=1 fi +if narg($7) lightness_merge_factor_a=$7 else lightness_merge_factor_a=1 fi +if narg($8) lightness_end_expf_a=$8 else lightness_end_expf_a=0 fi +if narg($9) gray2col_end_a=$9 else gray2col_end_a=1 fi +if narg($10) channel_formula_b=$10 else channel_formula_b=$channel_formula_a fi +if narg($11) multiplier_b=$11 else multiplier_b=$multiplier_a fi +if narg($12) valueshift_b=$12 else valueshift_b=$valueshift_a fi +if narg($13) midgray_expf_b=$13 else midgray_expf_b=$midgray_expf_a fi +if narg($14) lightness_merge_factor_b=$14 else lightness_merge_factor_b=$lightness_merge_factor_a fi +if narg($15) lightness_end_expf_b=$15 else lightness_end_expf_b=$lightness_end_expf_a fi +if narg($16) gray2col_end_b=$16 else gray2col_end_b=$gray2col_end_a fi +if narg($17) channel_formula_c=$17 else channel_formula_c=$channel_formula_b fi +if narg($18) multiplier_c=$18 else multiplier_c=$multiplier_b fi +if narg($19) valueshift_c=$19 else valueshift_c=$valueshift_b fi +if narg($20) midgray_expf_c=$20 else midgray_expf_c=$midgray_expf_b fi +if narg($21) lightness_merge_factor_c=$21 else lightness_merge_factor_c=$lightness_merge_factor_b fi +if narg($22) lightness_end_expf_c=$22 else lightness_end_expf_c=$lightness_end_expf_b fi +if narg($23) gray2col_end_c=$23 else gray2col_end_c=$gray2col_end_b fi +channel_formula=[$channel_formula_a,$channel_formula_b,$channel_formula_c] +multiplier=[$multiplier_a,$multiplier_b,$multiplier_c] +valueshift=[$valueshift_a,$valueshift_b,$valueshift_c] +midgray_expf=[$midgray_expf_a,$midgray_expf_b,$midgray_expf_c] +lightness_merge_factor=[$lightness_merge_factor_a,$lightness_merge_factor_b,$lightness_merge_factor_c] +lightness_end_expf=[$lightness_end_expf_a,$lightness_end_expf_b,$lightness_end_expf_c] +gray2col_end=[$gray2col_end_a,$gray2col_end_b,$gray2col_end_c] +channel_order=${arg\ $2+1,\"[0,1,2]\",\"[0,2,1]\",\"[1,0,2]\",\"[1,2,0]\",\"[2,0,1]\",\"[2,1,0]\"} +repeat $! { +img_id=$> +if s#$img_id<3||s#$img_id>4 error s#$img_id>2&&s#$img_id<4==F fi +} +if isnum($1) +if $1>0 $1,1,1,3,"begin(ww=w-1;);x/ww" +elif $1<0 1,abs($1),1,3,"begin(hh=h-1;);y/hh" +else error _$1!=0==F +fi +repeat 3 { +sh. {($channel_order)[$>]} +rep_trigmap. ,{($channel_formula)[$>]+5*$>},{($multiplier)[$>]},{($valueshift)[$>]},{($midgray_expf)[$>]},{($lightness_merge_factor)[$>]},{($lightness_end_expf)[$>]},{($gray2col_end)[$>]} +rm. +} +else +if narg($1) +if '$1'=='8i' +foreach { +repeat 3 { +sh. {($channel_order)[$>]} +rep_trigmap_8i. {($channel_formula)[$>]+5*$>},{($multiplier)[$>]},{($valueshift)[$>]},{($midgray_expf)[$>]},{($lightness_merge_factor)[$>]},{($lightness_end_expf)[$>]},{($gray2col_end)[$>]} +rm. +} +} +elif '$1'=='8il' +foreach { +if s==3 to_gray to_rgb +else to_graya to_rgba +fi +repeat 3 { +sh. {($channel_order)[$>]} +rep_trigmap_8i. {($channel_formula)[$>]+5*$>},{($multiplier)[$>]},{($valueshift)[$>]},{($midgray_expf)[$>]},{($lightness_merge_factor)[$>]},{($lightness_end_expf)[$>]},{($gray2col_end)[$>]} +rm. +} +} +else error ""(""$"1==8i")"||"(""$"1==8il")"==F" +fi +else +foreach { +repeat 3 { +sh. {($channel_order)[$>]} +rep_trigmap. ,{($channel_formula)[$>]+5*$>},{($multiplier)[$>]},{($valueshift)[$>]},{($midgray_expf)[$>]},{($lightness_merge_factor)[$>]},{($lightness_end_expf)[$>]},{($gray2col_end)[$>]} +rm. +} +} +fi +fi +#@cli rep_trigmap: eq. to 'rep_trigonometry_map' +rep_trigmap: rep_trigonometry_map $* +#@cli rep_trigonometry_map: _image_value_divide,_chan_form={ 0=sinusoidal | 1=cosinusoidal | 2=cubic-sinusoidal | 3=cubic-cosinusoidal | 4=cubic-sinusoidal-cosinusoidal },_multiplier>0,_valueshift,0>=_midgray_expf>=1,_lightness_merge_factor>=1,_lightness_end_expf>0,0>=_gray2col_end>=1 +#@cli : Map trigonometry function into image. +#@cli : +#@cli : (eq. to 'rep_trigmap'). +#@cli : +#@cli : '_image_value_divide' defines how much the image should be divided by. Of course, 0 is not valid. +#@cli : '_chan_form' refers to the formula each channels use. Number higher than 4 will use a slight different formula, but still follow the pattern of formulas named above. +#@cli : '_multiplier' defines the multiplication of base gradient used to map formula based on trigonometry. +#@cli : '_valueshift' refers to the value shift of base gradient +#@cli : '_midgray_expf' refers to the middle-point of base gradient used to map formula based on trigonometry relative to middle. +#@cli : '_lightness_merge_factor' refers to the merging of lightness gradient with color gradient. Used to add white and black to gradient ends. +#@cli : '_lightness_end_expf' defines the magnitude of shades and tind of each end of end gradient +#@cli : '_gray2col_end' defines how much the end gradient overrides the base gradient +#@cli : +#@cli : Note: Add 5 or 10 to '_chan_form' for another variation of the specified formula. +#@cli : Default values: '_image_value_divide=1','_multiplier_mode=1','_valueshift=0','_midgray_expf=1','_lightness_merge_factor=1','_lightness_end_expf=0','_gray2col_end=1'\n +#@cli : Author: Reptorian. +rep_trigonometry_map: +skip ${1=1},${2=0},${3=1},${4=0},${5=1},${6=1},${7=0},${8=1} +if $1==0 error ""$"1!=0==f" fi +f "begin( +const trigmode=$2%15; +trigmode==0? chan_form(a)=(sin(a*pi)+1)/2: +trigmode==1? chan_form(a)=(cos(a*pi)+1)/2: +trigmode==2? chan_form(a)=(sin(a*pi+pi)^3+1)/2: +trigmode==3? chan_form(a)=(cos(a*pi+pi)^3+1)/2: +trigmode==4? chan_form(a)=((cos(a*pi+pi/2)*sin(a*pi+pi/2))^3+.125)*4: +trigmode==5? chan_form(a)=(sin(a*pi+pi/2)+1)/2: +trigmode==6? chan_form(a)=(cos(a*pi+pi/2)+1)/2: +trigmode==7? chan_form(a)=(sin(a*pi+pi/2)^3+1)/2: +trigmode==8? chan_form(a)=(cos(a*pi+pi/2)^3+1)/2: +trigmode==9? chan_form(a)=((cos(a*pi+pi/4)*sin(a*pi+pi/4))^3+.125)*4: +trigmode==10?chan_form(a)=(sin(a*pi+pi)+1)/2: +trigmode==11?chan_form(a)=(cos(a*pi+pi)+1)/2: +trigmode==12?chan_form(a)=(sin(a*pi)^3+1)/2: +trigmode==13?chan_form(a)=(cos(a*pi)^3+1)/2: +trigmode==14?chan_form(a)=((cos(a*pi)*sin(a*pi))^3+.125)*4; +); +slope=i/$1; +midslope=(max(1-slope,slope)-.5)*2; +col_chan_zero=chan_form($3*(slope^$5+$4)); +mul_chan_zero=lerp(col_chan_zero,lerp(slope*col_chan_zero,slope,midslope^(abs($7+1))),midslope^(abs($7+1))*$6); +lerp(slope,mul_chan_zero,$8)*$1;" +#@cli rep_trigmap_8i: eq. to 'rep_trigonometry_map_8bit_integer' +rep_trigmap_8i: rep_trigonometry_map 255,${1-7} +#@cli rep_trigonometry_map_8bit_integer: _level_formula={ 0=sinusoidal | 1=cosinusoidal | 2=cubic-sinusoidal | 3=cubic-cosinusoidal | 4=cubic-sinusoidal-cosinusoidal },_multiplier>0,_valueshift,0>=_midgray_expf>=1,_lightness_merge_factor>=1,_lightness_end_expf>0,0>=_gray2col_end>=1 +#@cli : Map trigonometry function using 8-bit values. Remove _8i for non-8 bit values. +#@cli : (eq. to rep_trigmap_8i).\n +#@cli : Note: Add 5 or 10 to '_level_formula' for another variation of the specified formula. +#@cli : Default values: '_multiplier_a=1','_valueshift_a=0','_midgray_expf_a=1','_lightness_merge_factor_a=1','_lightness_end_expf_a=0','_gray2col_end_a=1' +rep_trigonometry_map_8bit_integer: rep_trigonometry_map 255,${1-7} +#@cli rep_lerp_rgb_gray: eq. to rep_linear_interpolation_rgb_gray +rep_lerp_rgb_gray: rep_linear_interpolation_rgb_gray $* +#@cli rep_linear_interpolation_rgb_gray: 0%>=_red_factor(%)<=100%,0%>=_green_factor(%)<=100%,0%>=_blue_factor(%)<=100%,_gray_mode={ 0=luminosity | 1=luminosity_alternative | 2=lightness | 3=minimum_channel | 4=maximum_channel | 5=average } : 0%>=_red_factor(%)<=100%,0%>=_green_factor(%)<=100%,0%>=_blue_factor(%)<=100%,_red_weight,green_weight,blue_weight\n +#@cli : Author: Reptorian. +rep_linear_interpolation_rgb_gray: +skip ${4=0},${5=},${6=} +total_arg=0 +if isnum($1) total_arg+=1 fi +if isnum($2) total_arg+=1 fi +if isnum($3) total_arg+=1 fi +if isnum($4) total_arg+=1 fi +if isnum($5) total_arg+=1 fi +if isnum($6) total_arg+=1 fi +if $total_arg==5 error "valid_args!=5=F" fi +if abs($1)>2 error "|"$"1|<=2=F" fi +if abs($2)>2 error "|"$"2|<=2=F" fi +if abs($3)>2 error "|"$"3|<=2=F" fi +f "begin( +const rlvl=abs($1); +const glvl=abs($2); +const blvl=abs($3); +if(narg($*)>5, +const tw=abs($4)+abs($5)+abs($6); +const c1f=abs($4)/tw; +const c2f=abs($5)/tw; +const c3f=abs($6)/tw; +graymode(a,b,c)=a*c1f+b*c2f+c*c3f; +, +$4==0?graymode(a,b,c)=a*0.22248840+b*0.71690369+c*0.06060791: +$4==1?graymode(a,b,c)=a*0.2990+b*0.5870+c*0.1140: +$4==2?graymode(a,b,c)=(max(a,b,c)+min(a,b,c))/2: +$4==3?graymode(a,b,c)=min(a,b,c): +$4==4?graymode(a,b,c)=max(a,b,c): +graymode(a,b,c)=avg(a,b,c); +); +); +gl=graymode(i0,i1,i2); +[lerp(gl,i0,rlvl),lerp(gl,i1,glvl),lerp(gl,i2,blvl)];" +#@cli rgb2ohta8 +#@cli : Convert color representation of selected images from RGB to Ohta8. +#@cli : Source: https://hbfs.wordpress.com/2018/04/24/ohta-colorspaces-iii/#more-6335 +#@cli : $ image.jpg rgb2ohta split c +rgb2ohta8: +e[^-1] "Convert color representation of image$? from RGB to Ohta8." +f [avg(i0,i1,i2),(i0-i2+255)/2,(-i0+i1-i2+255)/3] +#@cli ohta82rgb +#@cli : Convert color representation of selected images from Ohta8 to RGB. +#@cli : Source: https://hbfs.wordpress.com/2018/04/24/ohta-colorspaces-iii/#more-6335 +#@cli : $ image.jpg ohta82rgb split c +ohta82rgb: +e[^-1] "Convert color representation of image$? from Ohta8 to RGB." +f c0=i0*3;c1=i1*2-255;c2=i2*3-255;[.25*c0+.5*c1-.25*c2,.5*c0+.5*c2,.25*c0-.5*c1-.25*c2] +#@cli rgb2ohta +#@cli : Convert color representation of selected images from RGB to Ohta. +#@cli : Source: https://hbfs.wordpress.com/2018/04/24/ohta-colorspaces-iii/#more-6335 +#@cli : $ image.jpg rgb2ohta split c +rgb2ohta: +e[^-1] "Convert color representation of image$? from RGB to Ohta." +f [i0+i1+i2,i0-i2,-i0+i1-i2] +#@cli ohta2rgb +#@cli : Convert color representation of selected images from Ohta to RGB. +#@cli : Source: https://hbfs.wordpress.com/2018/04/24/ohta-colorspaces-iii/#more-6335 +#@cli : $ image.jpg ohta2rgb split c +ohta2rgb: +e[^-1] "Convert color representation of image$? from Ohta to RGB." +f [.25*i0+.5*i1-.25*i2,.5*i0+.5*i2,.25*i0-.5*i1-.25*i2] +#@cli rgb2ydbdr +#@cli : Convert color representation of selected images from RGB to YDbDr. +#@cli : Source: https://hbfs.wordpress.com/2018/05/15/ydbdr-colorspaces-vi/#more-6355 +#@cli : $ image.jpg rgb2ydbdr split c +rgb2ydbdr: +e[^-1] "Convert color representation of image$? from RGB to YDbDr." +f [.299*i0+.587*i1+.114*i2,-.45*i0-.883*i1+1.333*i2,1.333*i0-1.109*i1-.217*i2] +#@cli rgb2ydbdr +#@cli : Convert color representation of selected images from YDbDr to RGB. +#@cli : Source: https://hbfs.wordpress.com/2018/05/15/ydbdr-colorspaces-vi/#more-6355 +#@cli : $ image.jpg rgb2ydbdr split c +ydbdr2rgb: +e[^-1] "Convert color representation of image$? from YDbDr to RGB." +f [1*i0+.525*i2,1*i0-.129*i1-.268*i2,1*i0+.665*i1] +#@cli rgb2k1 +#@cli : Convert color representation of selected images from RGB to Kodak 1. +#@cli : Source: https://hbfs.wordpress.com/2018/04/10/kodak-1-colorspaces-i/ +#@cli : $ image.jpg rgb2k1 split c +rgb2k1: +e[^-1] "Convert color representation of image$? from RGB to Kodak 1." +f begin(third=1/3;);r=third*i0;g=third*i1;b=third*i2;[r+g+b,b-r-g,r-g-b] +#@cli k12rgb +#@cli : Convert color representation of selected images from Kodak 1 to RGB. +#@cli : Source: https://hbfs.wordpress.com/2018/04/10/kodak-1-colorspaces-i/ +#@cli : $ image.jpg k12rgb split c +k12rgb: +e[^-1] "Convert color representation of image$? from Kodak 1 to RGB." +f [1.5*i0+1.5*i2,-1.5*i1-1.5*i2,1.5*i0+1.5*i1]; +#@cli rgb2k18 +#@cli : Convert color representation of selected images from RGB to Kodak 1 in 8I. +#@cli : Source: https://hbfs.wordpress.com/2018/04/10/kodak-1-colorspaces-i/ +#@cli : $ image.jpg rgb2k18 split c +rgb2k18: +e[^-1] "Convert color representation of image$? from RGB to Kodak 1 - 8I." +f begin(third=1/3;);r=third*i0;g=third*i1;b=third*i2;[r+g+b,(b-r-g)+170,(r-g-b)+170] +#@cli k182rgb +#@cli : Convert color representation of selected images from Kodak 1 in 8I to RGB. +#@cli : Source: https://hbfs.wordpress.com/2018/04/10/kodak-1-colorspaces-i/ +#@cli : $ image.jpg k182rgb split c +k182rgb: +e[^-1] "Convert color representation of image$? from Kodak 1 - 8I to RGB." +f c1=i1-170;c2=i2-170;[1.5*i0+1.5*c2,-1.5*c1-1.5*c2,1.5*i0+1.5*c1]; +#@cli rgb2yes +#@cli : Convert color representation of selected images from RGB to YES. +#@cli : Source: Xerox Color Encoding Standard, (tech rep?) XNSS 289005 (1989?) ; https://hbfs.wordpress.com/2018/05/01/xerox-yes-colorspaces-iv/ +#@cli : $ image.jpg rgb2yes split c +rgb2yes: +e[^-1] "Convert color representation of image$? from RGB to YES." +f [.253*i0+.684*i1+.063*i2,.5*i0-.5*i1,.25*i0+.25*i1-.5*i2] +#@cli yes2rgb +#@cli : Convert color representation of selected images from RGB to YES. +#@cli : Source: Xerox Color Encoding Standard, (tech rep?) XNSS 289005 (1989?) ; https://hbfs.wordpress.com/2018/05/01/xerox-yes-colorspaces-iv/ +#@cli : $ image.jpg yes2rgb split c +yes2rgb: +e[^-1] "Convert color representation of image$? from YES to RGB." +f [i0+1.431*i1+.126*i2,i0-.569*i1+.126*i2,i0+.431*i1-1.874*i2] +#@cli rgb2yes8 +#@cli : Convert color representation of selected images from RGB to Yes8. +#@cli : Source: Xerox Color Encoding Standard, (tech rep?) XNSS 289005 (1989?) ; https://hbfs.wordpress.com/2018/05/01/xerox-yes-colorspaces-iv/ +#@cli : $ image.jpg rgb2yes8 split c +rgb2yes8: +e[^-1] "Convert color representation of image$? from RGB to Yes8." +f [.253*i0+.684*i1+.063*i2,(.5*i0-.5*i1)+127.5,(.25*i0+.25*i1-.5*i2)+127.5] +#@cli yes82rgb +#@cli : Convert color representation of selected images from Yes8 to RGB. +#@cli : Source: Xerox Color Encoding Standard, (tech rep?) XNSS 289005 (1989?) ; https://hbfs.wordpress.com/2018/05/01/xerox-yes-colorspaces-iv/ +#@cli : $ image.jpg yes82rgb split c +yes82rgb: +e[^-1] "Convert color representation of image$? from Yes8 to RGB." +f [i0+1.431*(i1-127.5)+.126*(i2-127.5),i0-.569*(i1-127.5)+.126*(i2-127.5),i0+.431*(i1-127.5)-1.874*(i2-127.5)] +#@cli rgb2ycocgr: +#@cli : Convert color representation of selected images from RGB to YCoCg-R. +#@cli : Source: https://en.wikipedia.org/wiki/YCoCg +#@cli : $ image.jpg rgb2ohta split c +rgb2ycocgr: +e[^-1] "Convert color representation of image$? from RGB to YCoCg-R." +f " +Co=i0-i2; +tmp=B+Co/2; +Cg=i1-tmp; +Y=tmp+Cg/2; +[Y,Co,Cg]; +" +#@cli ycocgr2rgb: +#@cli : Convert color representation of selected images from YCoCg-R to RGB. +#@cli : Source: https://en.wikipedia.org/wiki/YCoCg +#@cli : $ image.jpg rgb2ohta split c +ycocgr2rgb: +e[^-1] "Convert color representation of image$? from YCoCg-R To RGB." +f " +tmp=i0-i2/2; +G=i2+tmp; +B=tmp-i1/2; +[B+i1,G,B]; +" +#@cli rgb2ycocg: +#@cli : Convert color representation of selected images from RGB to YCoCg. +#@cli : Source: https://en.wikipedia.org/wiki/YCoCg +#@cli : $ image.jpg rgb2ohta split c +rgb2ycocg: +e[^-1] "Convert color representation of image$? from RGB to YCoCg." +f [i0/4+i1/2+i2/4,i0/2-i2/2,-i0/4+i1/2-i2/4] +#@cli ycocg2rgb: +#@cli : Convert color representation of selected images from YCoCg to RGB. +#@cli : Source: https://en.wikipedia.org/wiki/YCoCg +#@cli : $ image.jpg rgb2ohta split c +ycocg2rgb: +e[^-1] "Convert color representation of image$? from YCoCg To RGB." +f [i0+i1-i2,i0+i2,i0-i1-i2] +#@cli rep_rbtt: eq. to 'rep_rotate_by_torus_top' +rep_rbtt: rep_rotate_by_torus_top $* +#@cli rep_rotate_by_torus_top: 0<=_torus_circu_min_dimension_percent_1(%)<=100,0<=_torus_circu_min_dimension_percent_2(%)<=100,_distort_ang,_mode_1={ 0=softmode | 1=midmode | 2=hardmode | 3=hardmode_alt | 4=distroymode | 5=invdistroymode | 6=quadextrudemode | 7=hexextrudemode },_mode_2={ 0=softmode | 1=midmode | 2=hardmode | 3=hardmode_alt | 4=distroymode | 5=invdistroymode | 6=quadextrudemode | 7=hexextrudemode },0<=_mode_percent_comb(%)<=100,_offx(%),_offy(%),_off_dup={ 0=no_duplicate_dist | 1=duplicate_dist },_bgremove={ 0=keep_background | 1=remove_background },_cent_isolat_torus_mode={ 0=do_not_center | 1=center },_interpolation={ 0=nearest | 1=linear },_boundary={ 0=none | 1=neumann | 2=periodic | 3=mirror } +#@cli : Inspired by the Donut Distortion plugin made by MadJik for Paint.NET, this version of donut distortion adds new features such as more modes, mode blending, isolated torus mode. +#@cli : (eq. to 'rep_rbtt')\n +#@cli : _torus_circu_min_dimension_percent_1 refers to the primary circumference of circle relative to the minimum image dimension. +#@cli : _torus_circu_min_dimension_percent_2 refers to the secondary circumference of circle relative to the minimum image dimension. +#@cli : _distort_ang refers to the maximum angle of distortion. +#@cli : _mode_1 refers to the first mode of donut distortion. +#@cli : _mode_1 refers to the second mode of donut distortion. +#@cli : _mode_percent_comb refers to the weighed average of combination of modes. This only works if and only if _mode_1 and _mode_2 are specified! +#@cli : _offx refers to the offset of donut distortion relative to the center in -1,1 x-coordinates. 100% means the center will be located in 1. +#@cli : _offy refers to the offset of donut distortion relative to the center in -1,1 y-coordinates. 100% means the center will be located in 1. +#@cli : _off_dup option defines whether distortion will wrap around when it reach out of bound. +#@cli : _bgremove defines whether the background is removed. +#@cli : _cent_isolat_torus_mode is a special mode used to aid into creating torus from image. This only works if _bgremove is active. +#@cli : _interpolation defines the smoothness of the image. +#@cli : _boundary defines how out-of-range values are wrapped as. +#@cli : Default values: '_torus_circu_min_dimension_percent_1=1','_torus_circu_min_dimension_percent_2=.5','_distort_ang=45','_mode_1=0','_mode_2=','_mode_percent_comb=50%','_offx=0%','_offy=0%','_off_dup=1','_bgremove=0','_cent_isolat_torus_mode=0','_interpolation=1','_boundary=2' +rep_rotate_by_torus_top: +skip ${1=1},${2=0},${3=45},${4=0},${5=},${6=.5},${7=0},${8=0},${9=1},${10=1},${11=0}${12=1},${13=2} +if $1==$2 error ""$"1!="$"2=F" fi +if ($1>1||$1<0)||($2>1||$2<0) error "(0>="$"1<=1)||(0>="$"2<=1)=F" fi +if $4<0||$4>7 error "0<="$"4<=7=F" fi +if narg($5) if $5<0||$5>7 error "0<="$"5<=7=F" fi fi +if $6<0||$6>1 error "0<="$"6<=1=f" fi +mode_1=${arg\ $4+1,(cos(v*(2*pi)-pi)+1)/2,abs(cos(v*pi+pi/2)),sqrt(1-(abs(v-.5)*2)^2),(1-(abs(v-.5)*2)^2)^(1/(2+(1-v))),cos(v*pi)*boundary,(cos(v*pi)*-1)*boundary,1-abs(v-.5)*2,(r=(1-abs(v-.5)*2)*2;r>1?1:r)} +if narg($5) +mode_2=${arg\ $5+1,(cos(v*(2*pi)-pi)+1)/2,abs(cos(v*pi+pi/2)),sqrt(1-(abs(v-.5)*2)^2),(1-(abs(v-.5)*2)^2)^(1/(2+(1-v))),cos(v*pi)*boundary,(cos(v*pi)*-1)*boundary,1-abs(v-.5)*2,(r=(1-abs(v-.5)*2)*2;r>1?1:r)} +fi +include_alp_cut={$10&&(s==2||s>3)} +if $include_alp_cut +vnull=[vectors(0)] +outcolor=vnull +else outcolor=I +fi +if $12>0 +boundary=avg(bndcut(radial_gradient_v[0]),bndcut(radial_gradient_v[1]),bndcut(radial_gradient_v[2]),bndcut(radial_gradient_v[3])) +calc_antialias=ox=sur_x(start_x(x+.5));oy=sur_y(start_y(y+.5));radial_gradient_v=[nm(norm(xx,yy)),nm(norm(ox,yy)),nm(norm(xx,oy)),nm(norm(ox,oy))]; +else +boundary=bndcut(radial_gradient) +fi +f " +begin( +boundary=0; +const s_id=s-1; +const sd=max(w,h)/min(w,h); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +const ww=w-1; +const hh=h-1; +const cx=ww/2; +const cy=hh/2; +const offx=cx*$7*-1; +const offy=cy*$8; +const eps=10^-10; +const interpolation=abs($12)?2:0; +const outboundary=$13; +vallim_x(v)=v-ww*floor(v/(ww+eps)); +vallim_y(v)=v-hh*floor(v/(hh+eps)); +if($9, +start_x(v)=vallim_x(v+offx); +start_y(v)=vallim_y(v+offy); +, +start_x(v)=v+offx; +start_y(v)=v+offy; +); +const torus_val_1=$1; +const torus_val_2=$2; +const new_min=min(torus_val_1,torus_val_2); +const new_max=max(torus_val_1,torus_val_2); +const end_diff=(1/(new_max-new_min)); +nm(v)=(v-new_min)*end_diff; +limcut(v)=max(min(1,v),0); +bndcut(v)=v>1||v<0?0:1; +const iang=$3*-1; +ang2rad(v)=pi*(v/180); +const maxang=ang2rad(iang); +rot_x(a,b,c)=a*cos(c)-b*sin(c); +rot_y(a,b,c)=a*sin(c)+b*cos(c); +sur_x(v)=(v/ww-.5)*2*sx; +sur_y(v)=(v/hh-.5)*2*sy; +unsur_x(v)=(v/(2*sx)+.5)*ww; +unsur_y(v)=(v/(2*sy)+.5)*hh; +if(narg($5), +if($6==0||$6==1 +,if($6,mode(v)="$mode_2";,mode(v)="$mode_1";); +,mode(v)=lerp("$mode_1","$mode_2",$6); +); +, +mode(v)="$mode_1"; +); +if($include_alp_cut +,out(a,b)=[vectors_id(J(a,b,z,interpolation,$13)),j(a,b,z,s_id,0,outboundary)*boundary];vnull="$vnull"; +,out(a,b)=lerp(I,J(a,b,z,interpolation,outboundary),boundary); +); +); +nxx=start_x(x); +nyy=start_y(y); +xx=sur_x(nxx); +yy=sur_y(nyy); +"$calc_antialias" +radial_gradient=nm(norm(xx,yy)); +norm_gradient=limcut(radial_gradient); +boundary="$boundary"; +z_depth=mode(norm_gradient)*maxang; +XX=rot_x(xx,yy,z_depth); +YY=rot_y(xx,yy,z_depth); +XX=unsur_x(XX); +YY=unsur_y(YY); +diff_x=XX-nxx; +diff_y=YY-nyy; +out(diff_x,diff_y);" +if $11&&$10 +offx={($7/2)*100*-1} +offy={($8/2)*100} +foreach { +if s==2||s>3 +shift $offx%,$offy%,0,0,2,0 +fi +} +fi +#@cli rep_pxpush: eq. to 'rep_pixel_push' +rep_pxpush: rep_pixel_push $* +#@cli rep_pixel_push: -1<=_push_x<=1,-1<=_push_y<=1 +#@cli : Pushes pixel relative to coordinate from the center. CLI filter is recreated from source code to TR's Pixel Push plugin for Paint.NET. Currently only Bezier option is supported until the secondary option is figured out. +#@cli : (eq. to 'rep_pxpush')\n +#@cli : Default values: '_push_x=0','_push_y=0'\n +#@cli : Author: Reptorian. +rep_pixel_push: +f "begin( +const ww=w-1; +const hh=h-1; +cx=cut( ($1+1)/2 ,0,1); +cy=cut( ($2+1)/2 ,0,1); +); +spanx=x/ww; +spany=y/hh; +nx=(1-((cx*(1-spanx))*spanx+(1-spanx)*(cx*spanx+(1-spanx))))*ww; +ny=(1-((cy*(1-spany))*spany+(1-spany)*(cy*spany+(1-spany))))*hh; +I(nx,ny,z,2);" +#@cli rep_pw: eq. to 'rep_point_warp' +rep_pw: rep_point_warp $* +#@cli rep_point_warp: 0%<=_pointwidth(%)<=100%,0%<=_distance(%)<=100%,0%,_radialInfluence<=100%,-1>=_distortion_center_x>=1,-1>=_distortion_center_y>=1,-360>=_distortion_angle>=360,_boundary={ 0=none | 1=neumann | 2=periodic | 3=mirror } +#@cli : Distorts image around a point. If you're using large radius, radialInfluence is not recommended to be set to 100%. +#@cli : (eq. to 'rep_pw')\n +#@cli : Default values: '_pointwidth=10%','_distance=10%','_radialInfluence=0%','_distortion_center_x=0','_distortion_center_y=0','_distortion_angle=0','_boundary=3' +rep_point_warp: +skip ${1=10},${2=10},${3=0},${4=0},${5=0},${6=0},${7=3} +f "begin( +eucl_norm(a,b)=sqrt(a^2+b^2); +const scaled_img_diagonal=eucl_norm(w,h)*$2; +const radius=log2((10^(abs($3)*300))*1000)*e; +const lograd=log(radius^($1*(.25*min(w,h)))); +const hw=w/2; +const hh=h/2; +const angle=($6/180)*pi+pi; +const ox=cos(angle)*scaled_img_diagonal; +const oy=sin(angle)*scaled_img_diagonal; +const dx=$4*hw; +const dy=$5*hh; +); +xd=x-dx; +yd=y+dy; +radinf=radius^(-(((xd-hw)/lograd)^2+((yd-hh)/lograd)^2)^2); +rx=(ox*radinf)+x; +ry=(oy*radinf)+y; +I(rx,ry,z,2,$7);" +#@cli rep_rand_sqrrecfill: eq. to 'rep_random_square_rectangle_fill' +rep_rand_sqrrecfill: rep_random_square_rectangle_fill $* +#@cli rep_random_square_rectangle_fill: _palette,square_dimension>0,_rectangle_max_length_1>0,_rectangle_max_length_2>0,_erode,_output={ 0=none | 1=line },_reduce_nonrectangles={ 0=do_not_reduce_nonrectagles | 1=reduce_nonrectangles },_remove_black_from_palette={ 0=preserve | 1=remove },_seed,_colourspace, +#@cli : Create texture with aligned rectangle and squares with colors being optional. +#@cli : (eq. to 'rep_rand_sqrrecfill') +#@cli : Default values: '_palette=0','_rectangle_length_2=1','_frequency_of_rectangle=1','_erode=0','_output=1','_reduce_nonrectangles=1','_remove_black_from_palette=1','_seed=','_colourspace=6', +#@cli : Author: Reptorian. +rep_random_square_rectangle_fill: +skip ${1=0},${3=2},${4=1},${5=1},${6=0},${7=1},${8=1},${9=1},${10=},${11=0} +cs2rgb=${arg\ 1+$11,,ryb2rgb,hsi82rgb,hsl82rgb,hsv82rgb,lab82rgb,lch82rgb,yiq82rgb,yuv82rgb} +bool_state_pal=0 +rand_pal=0 +if narg($1) +if isint($1)&&isnum($1) +if $1>0||$1<0 +bool_state_pal=1 +text_mode=0 +fi +else +if narg($1) +bool_state_pal=1 +text_mode=1 +fi +fi +fi +rep_rand_sqrrectex ${2-6},{$bool_state_pal?(($1>0||$1<0)&&abs($7)?3:1):2},$8,$10 +if $bool_state_pal +if narg($10) srand $10 fi +r. 100%,100%,100%,3 +if $text_mode ++pal $1 +else +if $1<0 {iM},1,1,3,u(0,255) +if $11 $cs2rgb fi +rand_pal=1 +else +pal $1 +fi +fi +if $9 +local[-1] { +s x +foreach { if !{ia} rm fi } +a x +} +fi +if !$rand_pal +{w#-1},1,1,1,u(0,1) +pixelsort.. +,x,. +rm. +fi +if !$7 +.. 1 fi +f.. i0?i(#-1,i0-1,y,0,c,0,2) +rm. +fi +#@cli rep_rand_sqrrecart: eq. to 'rep_random_square_rectangle_texture' +rep_rand_sqrrecart: rep_random_square_rectangle_artistic $* +#@cli rep_random_square_rectangle_artistic: square_dimension>0,_rectangle_max_length_1>0,_rectangle_max_length_2>0,_frequency_of_rectangle>0,_erode,_output={ 0=none | 1=line },_reduce_nonrectangles={ 0=do_not_reduce_nonrectagles | 1=reduce_nonrectangles },_distance_mode={ 0=regular_output | 1=distance_output },_seed,_output_resized={ 0=do_not_output_resized_original | 1=output_resized },_colourspace +#@cli : Create artistic rendering of image with aligned rectangle and squares. +#@cli : (eq. to 'rep_rand_sqrrecart') +#@cli : Default values: '_rectangle_max_length_1=2','_rectangle_length_2=1','_frequency_of_rectangle=1','_erode=0','_output=2','_reduce_nonrectangles=0','_seed=','_output_resized=0',_colourspace=0' +#@cli : Author: Reptorian. +rep_random_square_rectangle_artistic: +skip ${2=2},${3=1},${4=1},${5=0},${6=1},${7=1},${8=0},${9=},${10=0},${11=0} +convert_back=0 +tcr=3 +different_dimension=0 +converts_colors_fwd=${arg\ $11,rgb2ryb,error,rgb2hcy,rgb2hsl,rgb2hsv,rgb2lab,rgb2lch,rgb2ycbcr,rgb2ycbcrglic,rgb2yiq,rgb2yuv,rgb2xyz} +if $!>1 +cw={w#1} +ch={h#1} +iter=1 +do +iter-=1 +if (w#$iter!=$cw)||(h#$iter!=$ch) different_dimension=1 fi +iter+=2 +cw={w#$iter} +ch={h#$iter} +while !$different_dimension&&$iter<$! +fi +if $different_dimension +foreach { rep_rand_sqrrectex ${1-5},{$6?2:1},$7,$9 } +else +rep_rand_sqrrectex ${1-5},{$6?2:1},$7,$9 +rep_aspect_crop_2d[^-1] {w#-1},{h#-1} +r[^.] {w#-1},{h#-1},100%,100%,2,2,.5,.5 +if $8 ++distance.. 0 ++blend[-2,-1] shapemax0 +/.. . +rm. +store. distance +fi +store. art_shape +repeat $! { +local [$<] { +if (s==3||s==4)&&$11 +convert_back=1 +if $11!=2 +sh 0,2 +$convert_colors_fwd. +rm. +else +if s==3 rgb2cmyk tcr+=1 +elif s==4 s c,-3 rgb2cmyk.. a c +fi +fi +fi +if $10 +store output_resized fi +$art_shape +} +} +fi +#@cli rep_rand_sqrrectex: eq. to 'rep_random_square_rectangle_texture' +rep_rand_sqrrectex: rep_random_square_rectangle_texture $* +#@cli rep_random_square_rectangle_texture: square_dimension>0,_rectangle_max_length_1>0,_rectangle_max_length_2>0,_frequency_of_rectangle>0,_erode,_output={ 0=none | 1=filled_gray | 2=filled_line | 3=labeled_filled_line },_reduce_nonrectangles={ 0=do_not_reduce_nonrectagles | 1=reduce_nonrectangles },_seed +#@cli : Create a texture with aligned rectangle and squares. +#@cli : (eq. to 'rep_rand_sqrrectex') +#@cli : Note: '_reduce_nonrectangles' cannot be used to completely clear vectors of nonrectangle due to the algorithm provided, and no solution in context of vector exist as of now. +#@cli : Default values: '_rectangle_max_length=1','_rectangle_max_length=2','_frequency_of_rectangle=1','_erode=0','_output=2','_reduce_nonrectangles','_seed=' +#@cli : Author: Reptorian. +rep_random_square_rectangle_texture: +skip ${2=2},${3=1},${4=1},${5=0},${6=2},${7=1},${8=} +if narg($8) srand $8 fi +square_size=$1 +rf=0 +if abs($5) +if $5>0 square_size+={abs($5)} +else square_size+=1 +fi +fi +if $1<2 error ""$"1>1==F" fi +mw=${-max_w} +mh=${-max_h} +nvw={ceil($mw/$square_size)} +nvh={ceil($mh/$square_size)} +$nvw,$nvh,1,1,"x+y*w" +if abs(round($2))==1&&abs(round($3))==1 error ""$"2>1||"$"3>1==F" fi +msize={abs($2)+sqr(round(abs($3)))} +if $1<2 error ""$"2>1==F" fi +freq={int(avg(1/$msize,$4,.5)*(iM+1))} +val={iM+1} +repeat round($freq) { +orientation={round(u(0,1))} +nsl_1={round(u(1,abs($2)))} +nsl_2={round(u(1,abs($3)))} +min_nsl={min($nsl_1,$nsl_2)} +max_nsl={max($nsl_1,$nsl_2)} +if $min_nsl==1&&$max_nsl==1 max_nsl={round(u(2,abs(max($2,$3))))} fi +px={round(u(0,w#-1-1))} +py={round(u(0,h#-1-1))} +if $orientation $min_nsl,$max_nsl,1,1,$val j.. .,$px,$py rm. +else $max_nsl,$min_nsl,1,1,$val j.. .,$px,$py rm. +fi +val+=1 +} +label. 0,0 +if $7&&($2>1&&$3>1) +if max($2,$3)>2 +rf={max($2,$3)-2} +fi +repeat 2+$rf { +mirror. x +f. " +topleft = j(-1,-1); +topmiddle = j(0,-1); +topright = j(1,-1); +middleleft = j(-1,0); +middle = i; +middleright = j(1,0); +bottomleft = j(-1,1); +bottommiddle = j(0,1); +bottomright = j(1,1); +F=i; +if( +( (avg(topmiddle,middleleft)==middle) +|| (avg(topmiddle,middleright)==middle) +|| (avg(bottommiddle,middleleft)==middle) +|| (avg(bottommiddle,middleright)==middle) +) +|| +( (avg(middleleft,topmiddle,middleright)==middle) +|| (avg(middleleft,bottommiddle,middleright)==middle) +|| (avg(bottommiddle,middleleft,topmiddle)==middle) +|| (avg(bottommiddle,middleright,topmiddle)==middle) +) +|| +( (avg(bottommiddle,bottomright,middleright)==middle) +|| (avg(bottommiddle,bottomleft,middleleft)==middle) +|| (avg(topmiddle,topright,middleright)==middle) +|| (avg(topmiddle,topleft,middleleft)==middle) +) +,F*=-1; +); +F;" +label. 0,0 +} +fi +if $6 +{$nvw*$square_size+2},{$nvh*$square_size+2},1,1,i(#-1,floor(x/$square_size),floor(y/$square_size),z,0,0,1) rm.. r. {w-1},{h-1} +if $6>1 r2dx {(($1+1)/$1)*100}%,1 fi +if $6>1 f. "(x!=0&&x!=w-1&&y!=0&&y!=h-1)?(i(x-1,y-1,z,c,0,1)==i(x,y))*((i(x-1,y,z,c,0,1)==i(x,y))&&(i(x,y-1,z,c,0,1)==i(x,y))):0" +if $5 erode. {$5<0?(abs($5)>$1?$1:abs($5)):abs($5)} expand_xy. {int(abs($5)/2)},1 if !($5%2) r. {w-1},{h-1} fi fi +fi +if $6>2 label_fg. 0,0 fi +if $6<2 r. {w-1},{h-1} fi +fi +#@cli rep_gradf: eq. to 'rep_graduated_filter' +rep_gradf: rep_graduated_filter $* +#@cli rep_graduated_filter: 00,_xpan,_ypan,_colrange>0,_factor_a,_factor_b,_factor_c,_factor_d,_expf>0,_depth>0,_bgfreq>0,-360<=_colang<360,_alternate_colfunc={ 0=Regular | 1=Alternate },_symmetry={ 0=Regular | 1=Symmetrical },_alternate_channels +#@cli : Near direct conversion of MadJik's Newton Fractal Paint.NET plugin. This is a early beta filter. Unlike Paint.NET version, every variables are float-based except for last two. +#@cli : (eq. to 'rep_mj_newf') +#@cli : Default values: '_zoom=16','_xpan=0','_ypan=0','_colrange=128','_factor_a=9','_factor_b=0','_factor_c=75','_factor_d=5','_expf=10','_depth=50','_bgfreq=50','_colang=45','_alternate_colfunc=0','_symmetry=0' +rep_madjik_newton_fractal: +skip ${1=16},${2=0},${3=0},${4=128},${5=9},${6=0},${7=75},${8=5},${9=10},${10=50},${11=50},${12=45},${13=0},${14=0},${15=0} +foreach { +ww,hh={[w,h]} +r {max(w,h)*2},{max(w,h)*2},1,3 +f " +begin( +const zoom=$1/100; +const fvar_b=8/9+$6/1000; +const fvar_c=$7/10; +const fvar_d=$8/10; +const afc=fvar_c*$5; +const afd=afc*fvar_d; +const bgfreq=$11/100; +const ang=$12/180*pi; +const fexp=10^-$9; +funcb(w,t)=128+$4*sin(($15?(2-c)/2:c/2)*pi+(bgfreq*(ang+t+w*pi/180))); +func(w,t)=128+$4*sin(($15?(2-c)/2:c/2)*pi+(bgfreq*(ang+(t+w)*pi/180))); +); +ex=sqr((x-w/2)-$2/100); +ey=sqr((y-h/2)-$3/100); +ix=(x-w/2)*100/(zoom*w)-$2/100; +iy=(y-h/2)*100/(zoom*h)-$3/100; +for(k=1,k<$10,++k, +ix_2=ix*ix; +ix_3=ix_2*ix; +ix_4=ix_3*ix; +ix_5=ix_4*ix; +ix_6=ix_5*ix; +ix_7=ix_6*ix; +ix_8=ix_7*ix; +iy_2=iy*iy; +iy_3=iy_2*iy; +iy_4=iy_3*iy; +iy_5=iy_4*iy; +iy_6=iy_5*iy; +iy_7=iy_6*iy; +iy_8=iy_7*iy; +endval=(ix_2+iy_2)/2; +repeat(3,m,endval*=endval;); +ny=fvar_b*iy-($5*ix_7*iy-afc*ix_5*iy_3+afc*ix_3*iy_5-$5*ix*iy_7)/endval; +nx=fvar_b*ix+(ix_8-afd*ix_6*iy_2+2.5*afd*ix_4*iy_4-afd*ix_2*iy_6+iy_8)/endval; +if((abs(nx-ix)1,_mode={ 0=soft_regular | 1=soft_average_channels | 2=hard_regular | 3=hard_average_channels },_colourspace,_alpha +#@cli : Calculate whether to erode or dilate pixels using average. +#@cli : (eq. to 'rep_major_t').\n +#@cli : Custom Colour Space values can be specified with negative number for $3\n +#@cli : Primary Source: https://web.archive.org/web/20080214191501/http://interstices.info/display.jsp?id=c_27035 +#@cli : Secondary Source: https://forums.getpaint.net/topic/3978-majority-color-effect-ymd100726/\n +#@cli : Default values: '_mode=0','_colourspace=0','_alpha=0' +#@cli : Author: Reptorian. +rep_majority: +skip ${2=0},${3=0},${4=0} +if ($3>=0&&$3<=4)||($3==13||$3==14) colour="0,255" +elif $3>=5||$3<=8 colour="0,360,0,1,0,1" +elif $3==9 colour="0,100,-100,100,-100,100" +elif $3==10 colour="0,100,0,100,-pi,pi" +elif $3==11 colour="0,255,-100,100,-100,100" +elif $3==12 colour="0,1,-1,1,-1,1" +elif $3==15 colour="0,1,0,1,0,1" +elif $3==16 colour="0,255,-127.5,127.5,-127.5,127.5" +elif $3==17 colour="0,255,-170,85,-170,85" +elif $3==18 colour="0,765,-255,255,-510,255" +elif $colour<0 colour=${5--1} +fi +tcr=3 +mergeback=0 +convert_colors_fwd=${arg\ 1+$3,rgb,rgb2srgb,rgb2ryb,rgb2cmy,rgb2cmyk,rgb2hcy,rgb2hsi,rgb2hsl,rgb2hsv,rgb2lab,rgb2lch,rgb2yiq,rgb2yuv,rgb2ycbcr,rgb2xyz,rgb2yes,rgb2k1,rgb2ohta} +convert_colors_bwd=${arg\ 1+$3,rgb,srgb2rgb,ryb2rgb,cmy2rgb,cmyk2rgb,hcy2rgb,hsi2rgb,hsl2rgb,hsv2rgb,lab2rgb,lch2rgb,yiq2rgb,yuv2rgb,ycbcr2rgb,xyz2rgb,yes2rgb,k12rgb,ohta2rgb} +foreach { +ss={s} +if (s==3||s==4)&&$3 +convert_back=1 +if $3!=4 +$convert_colors_fwd. +else +if s==3 rgb2cmyk tcr+=1 +elif s==4 s c,-3 rgb2cmyk.. a c +fi +fi +fi +if $4&&(s>$tcr||s==2) s c,-{s-1} mergeback=1 fi +l[0] { ++boxfilter[0] $1 +if $2==1||$2==3 compose_channels. add /. $ss fi ++erode[0] $1 ++dilate[0] $1 +if $2==3 f[0] "begin(const ts=s*2;if("$4",mm=vectorts("$colour",0,255);,mm=vectorts("$colour");););i=2,0<=tolerance[%]<=100,_booldir={ 0=less_than | 1=greater_than },_alpha,_mode={ 0=soft | 1=hard },_colorspace +#@cli : Calculate whether to erode or dilate based on specified threshold. +#@cli : (eq. to 'rep_major_t').\n +#@cli : Custom Colour Space values can be specified with negative number for $6\n +#@cli : Primary Source: https://web.archive.org/web/20080214191501/http://interstices.info/display.jsp?id=c_27035 +#@cli : Secondary Source: https://forums.getpaint.net/topic/3978-majority-color-effect-ymd100726/\n +#@cli : Default values: '_booldir=0','_mode=1','_alpha','_colourspace', +rep_majority_threshold: +skip ${3=0},${4=1},${5=0},${6=0} +remove_image=0 +if $1<2 error ""$1">2==F" fi +if ($5>=0&&$5<=4)||($5==13||$5==14) colour="0,255" +elif $5>=5||$5<=8 colour="0,360,0,1,0,1" +elif $5==9 colour="0,100,-100,100,-100,100" +elif $5==10 colour="0,100,0,100,-pi,pi" +elif $5==11 colour="0,255,-100,100,-100,100" +elif $5==12 colour="0,1,-1,1,-1,1" +elif $5==15 colour="0,1,0,1,0,1" +elif $5==16 colour="0,255,-127.5,127.5,-127.5,127.5" +elif $5==16 colour="0,255,-127.5,127.5,-127.5,127.5" +elif $5==17 colour="0,255,-170,85,-170,85" +elif $5==18 colour="0,765,-255,255,-510,255" +elif $5<0 colour=${7--1} +fi +if $5<0 if $#<6 error ""$#">6==F" fi fi +tcr=3 +if $5 +convert_colors_fwd=${arg\ $5,rgb2srgb,rgb2ryb,rgb2cmy,error,rgb2hcy,rgb2hsi,rgb2hsl,rgb2hsv,rgb2lab,rgb2lch,rgb2yiq,rgb2yuv,rgb2ycbcr,rgb2ycbcrglic,rgb2xyz,rgb2yes,rgb2k1,rgb2ohta} +convert_colors_bwd=${arg\ $5,srgb2rgb,ryb2rgb,cmy2rgb,error,hcy2rgb,hsi2rgb,hsl2rgb,hsv2rgb,lab2rgb,lch2rgb,yiq2rgb,yuv2rgb,ycbcr2rgb,ycbcrglic2rgb,xyz2rgb,yes2rgb,k12rgb,ohta2rgb} +fi +foreach { +if (s==3||s==4)&&$5 +convert_back=1 +if $5!=4 +$convert_colors_fwd. +else +if s==3 rgb2cmyk tcr+=1 +elif s==4 s c,-3 rgb2cmyk.. a c +fi +fi +fi +if !$6&&(s>$tcr||s==2) sh. 0,{s-2} remove_image=1 fi +f. "begin( +const dc=($1-1)/2; +const kern=dc*2+1; +const ts=s*2; +NEW_COL=vectors(0); +if($6,mm=vectorts("$colour",0,255);,mm=vectorts("$colour");); +skip=1; +); +repeat(s,ss, +N=crop(x-dc,y-dc,0,ss,kern,kern,1,1,1); +min_val=min(mm[ss*2],mm[ss*2+1]); +max_val=max(mm[ss*2],mm[ss*2+1]); +tolerance=$2*(max_val-min_val)+min_val; +if(skip, +if($3, +if($4 +,calc_newcol()=i(x,y,z,ss)tolerance?min_val:max_val; +,calc_newcol()=i(x,y,z,ss)>tolerance?min(N):max(N); +); +); +--skip; +); +NEW_COL[ss]=calc_newcol(); +); +NEW_COL; +end(if(!skip, +if($3, +if($4 +,calc_newcol()=i(x,y,z,ss)tolerance?min_val:max_val; +,calc_newcol()=i(x,y,z,ss)>tolerance?min(N):max(N); +); +); +); +);" +if $remove_image rm. fi +if $convert_back +if $5!=4 +$convert_colors_bwd. +else +if s==4 cmyk2rgb tcr-=1 +elif s==5 s c,-4 cmyk2rgb.. a c +fi +fi +fi +} +#@cli rep_pstrk: eq. to 'rep_perspective_streak' +rep_pstrk: rep_perspective_streak $* +#@cli rep_perspective_streak: -1<=_xpos<=1,-1<=_ypos<=1,-1<=_alpha_exponential_factor,0<_distance_threshold<=1,0<_distance_start<=1,_direction={ 0=in | 1=out },_streak_mode={ 0=color | 1=gray | 2=binary | 3=gray+binary },_preserve_edges={ 0=do_not_preserve_edges | 1=preserve_edges },_alpval +#@cli : Create perspective streak effect. _preserve_details only is applicable on non-binary mode. +#@cli : (eq. to 'rep_pstrk').\n +#@cli : Default values: '_xpos=0','_ypos=0','_alpha_exponential_factor=1','_distance_threshold=1','_distance_start=0','_direction=0','_streak_mode=0','_preserve_edges=1','_alpval'\n +#@cli : Author: Reptorian. +rep_perspective_streak: +skip ${1=0},${2=0},${3=0},${4=1},${5=0},${6=0},${7=0},${8=1},${9=} +point={[$1,$2]} +if !$4 error "$4|"$"4>0" fi +foreach +if s!=3 +echo "Applying perspective streak at coordinate point $point!" +if h>w orientation=1 +else orientation=0 +fi +if s>1 +sh. 0,{s-2} +sh.. {s} +f. ":begin( +const cols=s#-2; +); +targ=0; +!i?( +v=vectorcols(0); +vb=J(#-2,0,-1); +vd=J(#-2,-1,0); +vf=J(#-2,1,0); +vh=J(#-2,0,1); +j(0,-1)?(++targ;v+=vb;); +j(-1,0)?(++targ;v+=vd;); +j(1,0)?(++targ;v+=vf;); +j(0,1)?(++targ;v+=vh;); +targ?(v/=targ;I(#-2)=v;); +0; +):i;" +rm[-2,-1] +fi +rep_recpoltrans $point,-3 +if $5>0&&$5<1 f begin(sy=1/(((1-$5)*h)/h););i(x,y*sy,z,c,2); fi +if $7||s==1 +channels {s-1} +if $8 +if $7==3||$7==1 . n. 0,1 l. +f 1 rv a c done store. details +else echo "Details cannot be preserved using binary mode!" +fi +fi +rep_axis_streak 1,!$6,$3,$9 +if $4>0&&$4<1 +f i>(1-$4)?i:(1-$4) +n 0,1 +fi +if $7==2 f i>0?1:0 +elif $7==3 +f i>0?1:0 a c fi +if $8 +if $7==3||$7==1 +$details +s. c,-{s-1} +j[-3] [-2],0,0,0,0,1,[-1],1 +rm[-2,-1] +fi +fi +else +if $8 +store details fi +if $4>0&&$4<1 ++channels {s-1} +rep_axis_streak. 1,!$6,$3,$9 +f. i>(1-$4)?i:(1-$4) +f. i>im#-1?1:0 +fi +rep_axis_streak[0] 1,!$6,$3,$9 +if $4>0&&$4<1 +sh[0] {s#0-1} +f. i0#-2*i +k[0] +fi +if $8 +$details +s. c,-{s-1} +j[-3] [-2],0,0,0,0,1,[-1],{iM#-1} +rm[-2,-1] +fi +fi +rep_recpoltrans $point,2,$orientation +else echo "Not applicable to images with 3 channels!" +fi +done +#@cli rep_axis_streak: orientation,direction,_alpha_exponential_factor,_maxval>0_cmykmode={ 0=non-cmyk | 1=cmyka_mode } +#@cli : Streaks pixels based on distance away from center and placement of visible objects. +#@cli : '_alpha_exponential_factor' is used to manipulate the alpha mixing within pixels. The more power that is assigned to the alpha, the more mixing there would be. +#@cli : '_maxval' divides the alpha channel internally to normalize ranges to 0-1. A error will appear if not normalized. By default, it used the max alpha channel value. +#@cli : '_cmykmode' is only used in case of using only cmyk images. Not needed in normal cases at all. +#@cli : Default values: '_alpha_exponential_factor=0','_maxalp=n/a','_cmykmode=0' +#@cli : +#@cli : Author: Reptorian. +rep_axis_streak: +skip ${3=0},${4=},${5=0} +foreach { +if s==1 rep_axis_streak_distance $* +else rep_axis_streak_color $* +fi +} +#@cli rep_axis_streak_distance: orientation,direction,_alpha_exponential_factor,_maxval +#@cli : Extract the alpha, then streaks pixels based on distance away from center and placement of visible objects. +#@cli : '_alpha_exponential_factor' is used to manipulate the alpha mixing within pixels. The more power that is assigned to the alpha, the more mixing there would be. +#@cli : '_maxval' divides the alpha channel internally to normalize ranges to 0-1. A error will appear if not normalized. By default, it used the max alpha channel value. +#@cli : Default values: '_alpha_exponential_factor=0','_maxalp=n/a' +#@cli : +#@cli : Author: Reptorian. +rep_axis_streak_distance: +skip ${3=0},${4=} +foreach { +sh {s-1} +if !iv#-1 rm. break else rm. fi +if s>1 channels {s-1} fi +if narg($4) alp={abs($4)} +else alp={iM#-1} +fi +/ $alp +if iM>1||im<0 error alpval(valid)==F fi +if $3<=-1 exp_f=-{1-10^-8} else exp_f=$3 fi +f i^(1+$exp_f) +if $1 +outdata_dim={w},1,{d},1 +outdata_coords=x,yy,z +outdata_dimref=hh +outdata_pos=yy +if $2 +direction=yy=hh,yy>0,--yy +end_level=yy +else +direction=yy=0,yy0,--xx +end_level=xx +fi +fi +$outdata_dim,":begin( +const ww=w#0-1; +const hh=h#0-1; +); +mode=0; +for("$direction", +imgval=i(#-1,"$outdata_coords"); +!mode?(imgval?mode=1;); +mode==1?(z_level="$outdata_dimref";mode=2;alp=imgval;); +mode==2?( +alp=alp+(1-alp)*imgval; +z_level="$end_level"*imgval+(1-imgval)*z_level; +i(#-1,"$outdata_coords")="$end_level"/z_level*alp; +); +);" +rm. +} +#@cli rep_axis_streak_color: orientation,direction,_alpha_exponential_factor,_maxval>0,_add2new={ 0=add2old | 1=add2new },_cmykmode={ 0=non-cmyk | 1=cmyka_mode } +#@cli : Streaks colored pixels taking into account of opacity. +#@cli : '_alpha_exponential_factor' is used to manipulate the alpha mixing within pixels. The more power that is assigned to the alpha, the more mixing there would be. +#@cli : '_maxval' divides the alpha channel internally to normalize ranges to 0-1. A error will appear if not normalized. By default, it used the max alpha channel value. +#@cli : '_add2new' defines whether to streak data on old image or to streak pixel data onto a new image. Used for Perspective Streak. +#@cli : '_cmykmode' is only used in case of using only cmyk images. Not needed in normal cases at all. +#@cli : Default values: '_alpha_exponential_factor=0','_maxalp=n/a','_cmykmode=0' +#@cli : +#@cli : Author: Reptorian. +rep_axis_streak_color: +skip ${3=0},${4=},${5=0},${6=0} +tcr=3 +if $6 tcr+=1 fi +if narg($4) if $4==0 return fi fi +foreach { +if s==1||s==$tcr break fi +vv=0 +repeat s { +sh $> +vv+={iv#-1} +rm. +} +if !$vv break fi +sh. 0,{s-2} +sh.. {s} +f.. i#-1?I +if narg($4) alp={abs($4)} +else alp={iM#-1} +fi +/. $alp +if iM#-1>1||im#-1<0 error alpval(valid)==F fi +if $3<=-1 exp_f=-{1-10^-8} else exp_f=$3 fi +f. i^(1+$exp_f) +if $1 +outdata_dim={w},1,{d},{s#0} +outdata_coords=x,yy +if $2 direction=yy=hh-1,yy>=0,--yy +else direction=yy=0,yy=0,--xx +fi +fi +if $5 {w#0},{h#0},{d#0},{s#0} +col_info=-3 +alp_info=-2 +targ_info=#-1 +outdata_gen_1=I($targ_info,$outdata_coords,z)=temp; +else +col_info=-2 +alp_info=-1 +targ_info=#0 +outdata_gen_0=I($targ_info,$outdata_coords,z)=temp; +fi +$outdata_dim,":begin( +const ww=w#0; +const hh=h#0; +); +start_val=1; +for("$direction", +start_val?( +start_val=0; +col=I(#"$col_info","$outdata_coords",z); +alp=i(#"$alp_info","$outdata_coords",z,0); +temp=[col,alp]; +):( +newcol=I(#"$col_info","$outdata_coords",z); +newalp=i(#"$alp_info","$outdata_coords",z,0); +newinfo=[newcol,newalp]; +!newalp?(I("$targ_info","$outdata_coords",z)=temp;): +newalp==1?(temp=newinfo; +):( +"$outdata_gen_1" +col=newcol*newalp+(1-newalp)*col; +alp=alp+newalp*(1-alp); +temp=[col,alp]; +"$outdata_gen_0" +); +); +);" +if $5 rm[^-2] +else rm[1-3] +fi +sh. {s-1} +*. $alp +rm. +} +#@cli rep_mn: eq. to 'rep_multinormalize' +rep_mn: rep_multinormalize $* +#@cli rep_multinormalize: values +#@cli : Normalize based on channels using values. +#@cli : (eq. to 'rep_mn').\n +#@cli : Author: Reptorian. +rep_multinormalize: +$=a +foreach { +repeat s { +val_a=${a{$>*2+1}} +val_b=${a{$>*2+2}} +sh $> +normalize. $val_a,$val_b +rm. +} +} +#@cli rep_mc: eq. to 'rep_multicut' +rep_mc: rep_multicut $* +#@cli rep_multicut: values +#@cli : Cut based on channels using values. +#@cli : (eq. to 'rep_mc').\n +#@cli : Author: Reptorian. +rep_multicut: +$=a +foreach { +repeat s { +val_a=${a{$>*2+1}} +val_b=${a{$>*2+2}} +sh $> +cut. $val_a,$val_b +rm. +} +} +#@cli rep_cr: eq. to 'rep_cr'. +rep_cr: rep_channels_range +#@cli rep_channels_range: +#@cli : Return the minimal and maximum values per channels in a image.\n +#@cli : Author: Reptorian. +rep_channels_range: +if $!>1 error "Cannot be used on more than 1 images!" fi +num_chans={s} +repeat $num_chans { shared[0] $> } +u {expr('p=1+(x>>1);x&1?iM#p:im#p;',$num_chans<<1)} +rm[-$num_chans--1] +#@cli rep_ol: eq. to 'rep_orientation_list'. +#@cli : Return dimensions of selected images. +rep_ol: rep_orientation_list +#@cli rep_orientation_list: +#@cli : Return orientation of selected images. +#@cli : (eq. to rep_ol). +rep_orientation_list: u {expr('h#x>w#x',$!)} +#@cli rep_recpoltrans: eq. to 'rep_rectangular_polar_transformation'. +rep_recpoltrans: rep_rectangular_polar_transformation $* +#@cli rep_rectangular_polar_transformation : -1>=_xpos<=1,-1>=_ypos<=1,_from_to={ -3=to_inverted_rectangular_polar_preserved_details | -2=from_rectangular_polar_preserved_details_to_cartesian | -1=to_inverted_rectangular_polar | 0=to_rectangular_polar | 1=to_rectangular_polar_preserved_details| 2=from_preserved_details_inverted_rectangular_polar },orientation_0={ 0=landscape | 1=portrait },...,orientation_n +#@cli : Converts images to inversion of rectangular polar format or to rectangular polar format. Adapted for development of perspective filters. The first two variables defines the coordinates of revolution based on -1,1 ranges. 1,1 means the point of revolution is on top-right part of the image. +#@cli : (eq. to rep_recpoltrans).\n +#@cli : Note: When using 2 for $3, you need to define the orientation of every images. For every images, insert one argument per image after $3. +#@cli : Default values: '_xpos=0','_ypos=0','_from_to=0' +#@cli : +#@cli : Author: Reptorian. +rep_rectangular_polar_transformation: +skip ${1=0},${2=0},${3=0} +if $1<-1||$1>1 error "($1>=-1&&$1<=1)=0" fi +if $2<-1||$2>1 error "($2>=-1&&$2<=1)=0" fi +foreach { +ov=${-rep_cr} +if $3==-3 +maxlength={max(w,h)} +perimeter={(w+h)*2} +{$perimeter*2},{$maxlength*2},{d},{s},":begin( +const ww=w#0; +const hh=h#0; +const point_x=(($1*-1)*.5+.5)*ww; +const point_y=($2*.5+.5)*hh; +const inv_point_x=ww-point_x; +const inv_point_y=hh-point_y; +const cut_ang_s0=abs(atan2(inv_point_y,inv_point_x)*180/pi); +const cut_ang_s1=180-abs(atan2(inv_point_y,point_x)*180/pi); +const cut_ang_s2=180+abs(atan2(point_y,point_x)*180/pi); +const cut_ang_s3=360-abs(atan2(point_y,inv_point_x)*180/pi); +distanceaway(value)=( +value==0?ww-point_x: +value==1?hh-point_y: +value==2?point_x: +point_y; +); +); +surface_angle=(x/w)*360; +surface_angle>cut_ang_s0&&surface_angle<=cut_ang_s1?side=1: +surface_angle>cut_ang_s1&&surface_angle<=cut_ang_s2?side=2: +surface_angle>cut_ang_s2&&surface_angle<=cut_ang_s3?side=3: +side=0; +mdist=abs(side%2?1/sin((surface_angle/180)*pi):1/cos((surface_angle/180)*pi)); +dix=(point_x+cos((surface_angle/180)*pi)*distanceaway(side)*mdist*y/h)*((ww-1)/ww); +diy=(point_y+sin((surface_angle/180)*pi)*distanceaway(side)*mdist*y/h)*((hh-1)/hh); +I(#0,ww-(dix+1),hh-(diy+1),z,2); +" +k. +elif $3==-1||$3==-2 +f ":begin( +const point_x=(($1*-1)*.5+.5)*w; +const point_y=($2*.5+.5)*h; +const inv_point_x=w-point_x; +const inv_point_y=h-point_y; +const cut_ang_s0=abs(atan2(inv_point_y,inv_point_x)*180/pi); +const cut_ang_s1=180-abs(atan2(inv_point_y,point_x)*180/pi); +const cut_ang_s2=180+abs(atan2(point_y,point_x)*180/pi); +const cut_ang_s3=360-abs(atan2(point_y,inv_point_x)*180/pi); +distanceaway(value)=( +value==0?ww-point_x: +value==1?hh-point_y: +value==2?point_x: +point_y; +); +); +surface_angle=(x/w)*360; +surface_angle>cut_ang_s0&&surface_angle<=cut_ang_s1?side=1: +surface_angle>cut_ang_s1&&surface_angle<=cut_ang_s2?side=2: +surface_angle>cut_ang_s2&&surface_angle<=cut_ang_s3?side=3: +side=0; +mdist=abs(side%2?1/sin((surface_angle/180)*pi):1/cos((surface_angle/180)*pi)); +dix=(point_x+cos((surface_angle/180)*pi)*distanceaway(side)*mdist*y/h)*((w-1)/w); +diy=(point_y+sin((surface_angle/180)*pi)*distanceaway(side)*mdist*y/h)*((h-1)/h); +I(w-(dix+1),h-(diy+1),z,2); +" +if $3<-1 r2dx 50%,6 fi +elif $3==0||$3==1 +if $3>0 r2dx 200%,6 fi +f ":begin( +const ww=w-1; +const hh=h-1; +const sd=max(w,h)/min(w,h); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +const cx=.5+$1*.5; +const cy=.5+$2*.5; +const px=cx*w; +const py=(1-cy)*h; +const sxl=(w/2)/px; +const sxr=(w/2)/(w-px); +const syt=(h/2)/py; +const syb=(h/2)/(h-py); +); +atx=(x/ww-cx)*sx; +aty=(y/hh-(1-cy))*sy; +sur_atan=(atan2(aty,atx)+pi)/(2*pi); +xl=-1+(x/ww)*2*sxl; +xr=1-(1-x/ww)*2*sxr; +yt=-1+(y/hh)*2*syt; +yb=1-(1-y/hh)*2*syb; +xx=x>=px?xr:xl; +yy=y>=py?yb:yt; +sur_max=max(abs(xx),abs(yy)); +I(sur_atan*w,sur_max*h,z,2,2); +" +if $3>0 sharpen 2 fi +elif $3==2 +$=val +orientation=${val{$>+4}} +half_perimeter={w/2} +length_1={$half_perimeter-h} +length_2={$half_perimeter-$length_1} +if $orientation +width={min($length_1,$length_2)} +height={max($length_1,$length_2)} +else +width={max($length_1,$length_2)} +height={min($length_1,$length_2)} +fi +$width,$height,{d},{s},":begin( +const ww=w#0; +const hh=h#0; +const ox=$width; +const oy=$height; +const sd=max(ox,oy)/min(ox,oy); +if(w>h, +const sxf=ox>oy?sd:1; +const syf=ox>oy?1:sd; +, +const sxf=oxpx?xr:xl; +nyy=yy>py?yb:yt; +ay=max(abs(nxx),abs(nyy)); +ax=(atan2((yy/hh-(1-cy))*syf,(xx/ww-cx)*sxf)+pi)/(2*pi); +I(#0,abs(ax*ww),abs(ay*hh),z,2,1); +" +r2dx. 50%,6 +k. +else error "$3|"$"3!=intnum[-3,2]" +fi +rep_multicut $ov +} +#@cli rep_sd: eq. to 'rep_spiral_distort'. +rep_sd: rep_spiral_distort $* +#@cli rep_spiral_distort: _revolution!=0,_height!=0,_refraction>0,_direction={ 0=clockwise | 1=counterclockwise },_angle,_continuous_spiral={ 0=periodic | 1=continuous },-1<=_preshift_x<=1,-1<=_preshift_y<=1,_preshift_boundary={ 0=periodic | 1=mirror },_skew_x,_skew_y,_skew_m,_scale_coord_x,_scale_coord_y,_offx,_offy,_spiral_boundary={ 0=none | 1=neumann | 2=periodic | 3=mirror },_interpolation={ 0=nearest | 1=average | 2=linear | 3=bicubic | 4=lanczos } +#@cli : Transform images into spiral by using spiral gradient for x coordinate, and radial gradient for y coordinate. +#@cli : (eq. to 'rep_sd').\n +#@cli : '_revolution' defines the number of revolution within the spiral assuming coordinates range of [-1,1]. +#@cli : '_height' is the height of spiral. The higher the height of the spiral, the more duplicates will repeat within one revolution. +#@cli : '_refraction' refers to the logarithmic distortion within spiral. +#@cli : '_direction' determines if it clockwise or counter-clockwise. +#@cli : '_angle' determines the function angle. +#@cli : '_continuous_spiral' determines whether the spiral distortion is continuous or not. +#@cli : '_preshift_x' shifts the images before the spiral distortion along the x-axis. +#@cli : '_preshift_y' shifts the image before the spiral distortion along the y-axis. +#@cli : '_preshift_boundary' determines the boundary within the preliminary shift. +#@cli : '_skew_x' skews the distortion alongside the x-axis. It is recommended to keep ranges to -100% to 100%. +#@cli : '_skew_y' skews the distortion alongside the y-axis. It is recommended to keep ranges to -100% to 100%. +#@cli : '_skew_m' is the multiplier for skewing. +#@cli : '_scale_x' scales the coordinates alongside the x-axis. +#@cli : '_scale_y' scales the coordinates alongside the y-axis. +#@cli : '_offx' determines the offset-placement of the distortion alongside the x-axis. It is recommended to keep ranges to -100% to 100%. +#@cli : '_offy' determines the offset-placement of the distortion alongside the y-axis. It is recommended to keep ranges to -100% to 100%. +#@cli : '_spiral_boundary' determines how the out-of-bound values is to be evaluated. +#@cli : '_interpolation' determines the interpolation of the spiral distortion.\n +#@cli : Default values: '_frequency=1','_height=1','_refraction=0','_direction=0','_angle=0','_continuous_spiral=0','_preshift_x=0','_preshift_y=0','_preshift_boundary=0','_skew_x=0','_skew_y=0','_skew_m=1','_scale_x=1','_scale_y=1','_offx=0','_offy=0','_spiral_boundary=3','_interpolation=4'\n +#@cli : Author: Reptorian. +#@cli : $ sp car rep_spiral_distort 1,2,2,1,30,1,50%,50%,1,1,.25 +rep_spiral_distort: +skip ${1=1},${2=1},${3=0},${4=0},${5=0},${6=0},${7=0},${8=0},${9=0},${10=0},${11=0},${12=1},${13=1},${14=1},${15=0},${16=0},${17=3},${18=4} +if !$! v + error "No images to perform spiral distortion on" v - fi +if $1==0 v + error ""$"1/_revolution cannot be 0!" v - fi +if $2==0 v + error ""$"2/_height cannot be 0!" v - fi +if $3==-1 v + error ""$"3/_refraction cannot be -1!" v - fi +if !$13||!$14 v + error ""$"13/_scale_x and "$"14/_scale_y cannot be 0!" v - fi +v - +skew_m={abs(2*$12)} +direction=${arg\ $4+1,counterclockwise,clockwise} +spiral_mode=${arg\ $6+1,continuous,periodic} +periodic_boundary=${arg\ (abs($9)?1)+1,mirror,periodic} +spiral_boundary=${arg\ abs($17)+1,none,neumann,periodic,mirror} +interpolation=${arg\ abs($18)+1,nearest,average,linear,bicubic,lanczos} +if abs($7)||abs($8) preshift="Preshift of {$7*100}% alongside the x-axis, and {$8*100}% alongside the y-axis has been applied before the distortion using "$preshift_boundary" boundary condition." +else preshift="" +fi +v + +e[] "Apply spiral distortion at coordinates $15,$16 with scale factor of $13 within x-axis and $14 within y-axis and skew-"$skew_m" distortion utilizing factor of $10 within x-axis and factor of $11 within y-axis to images using "$direction" "$spiral_mode" spiral with revolution of $1, height of $2, refraction factor of $3 using "$spiral_boundary" boundary condition and "$interpolation" interpolation. "$preshift"" +v + +if abs($18)>1 r2dx 200%,{abs($18)>2?abs($18)+2:abs($18)+1} fi +if abs($7)||abs($8) +e[] "Apply of {$7*100}% alongside the x-axis, and {$8*100}% alongside the y-axis" +f "begin( +const offx=(w/2)*$7*-1; +const offy=(h/2)*$8; +const interpolation=abs($18)>2?2:abs($18); +const boundary=(abs($9)+2); +); +J(offx,offy,z,interpolation,boundary);" +fi +if $4 mirror x fi +f "begin( +const sd=max(w,h)/min(w,h); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +const ang=pi*($5*-1/180); +const skew_x=($10*-1)/abs($13); +const skew_y=$11/abs($14); +const skew_m=abs(2*$12); +const offx=-.5+($15*-1/2); +const offy=-.5+($16*-1/2); +const nw=abs(w*sin(ang))+abs(h*cos(ang)); +const nh=abs(w*cos(ang))+abs(h*sin(ang)); +const cos_ang=cos(ang); +const sin_ang=sin(ang); +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +const interpolation=abs($18)>2?2:abs($18); +const boundary=abs($17); +); +XX=(x/w+offx)*sx*$13; +YY=(y/h+offy)*sy*$14; +xx=(rot_x(XX,YY)*(skew_m^(rot_x(XX,YY)*skew_x)))*2; +yy=(rot_y(XX,YY)*(skew_m^(rot_y(XX,YY)*skew_y)))*2; +radial=norm(xx,yy); +if($4,sur_atan=1-(atan2(xx,yy)+pi)/(2*pi);,sur_atan=(atan2(xx,yy)+pi)/(2*pi);); +es=sur_atan+radial*$1; +es=es-floor(es); +if($6,es=(es>.5?1-es:es)*2;); +I((es^(1+$3))*w*$2,radial*h,z,interpolation,boundary);" +if abs($18)>1 r2dx 50%,{abs($18)>2?abs($18)+2:abs($18)+1} fi +v - +#@cli rep_fibo_fill: eq. to 'rep_fibonacci_fill' +rep_fibo_fill: rep_fibonacci_fill $* +#@cli rep_fibonacci_fill: stack={ 0= top-left | 1= top-right | 2= bottom-left | 3= bottom-right },output_mode={ 0=corner | 1=spiral }, _initial_orientation={ 0=landscape | 1=portrait },_iteration>=0,_int_scale>0,{ boundary={0=periodic | 1=mirror} | -1<=spiral_location_x<=1 },{ append_mode={ 0=x | 1=y } | -1<=spiral_location_y<=1 },_palette_cycle,negate,_[palette],_seed_a... +#@cli : Generated filled image of fibonacci. If you need a complete fibonacci to use as a base, then execute 'gmic h +rep_fibonacci' for more information. +#@cli : +#@cli : (eq. to 'rep_fibo_fill') +#@cli : 1) stack defines the stacking of the fibonacci spiral. The options that are provided represent initial vector or orientation of the fibonacci spiral. +#@cli : 2) output_mode defines the style of stacking of the fibonacci base. If it is 1, then it's a spiral, otherwise, corner stacking. +#@cli : 3) _initial_orientation defines the initial stacking of the first two iteration of the fibonacci. +#@cli : 4) _iteration defines the number of iteration. 0 will automatically find the number of iterations requires for the maximum 2 dimensions to fit in. +#@cli : 5) If _iteration==0, and _output_mode==1, this option would be spiral_location_x. Otherwise, it would become boundary which is only applicable for _iteration>0. +#@cli : 6) If _iteration==0, and _output_mode==1, this option would be spiral_location_y. Otherwise, it would become append_mode which is only applicable for _iteration>0. +#@cli : 7) _palette_cycle* defines the shift of palette. +#@cli : 8) _negate defines whether to invert the order of palette. +#@cli : 9) _[palette]* defines the palette to be used for filling the fibonacci. +#@cli : 10) _seed* would define the seed to be used for generating order. +#@cli : +#@cli : *=See rep_custom_map for more details on how these options would work. +#@cli : Default values: '_initial_orientation=0','_iteration=0','{ boundary={0=periodic | 1=mirror} | -1<=spiral_location_x<=1 }=0','{ append_mode={ 0=x | 1=y } | -1<=spiral_location_y<=1 }}=0','_palette_cycle=n/a','_[palette]=n/a','seed=n/a' +#@cli : +#@cli : Author: Reptorian +rep_fibonacci_fill: +skip ${3=1},${4=0},${5=1},${6=0},${7=0},${8=},${9=0},${10=} +check $!>0 +r 100%,100%,100%,1,-1 +timg={$!} +mw=${-max_w} +mh=${-max_h} ++rep_fibonacci ${1-5} +fibo_id={$!-1} +if $4 +if narg(${10--1})>1 +. +pass$10 0 +rep_custom_map[-3,-2] ${8--1} +rm. +else ++negate. +if $7<0 rv[-2,-1] fi +if narg($8,$9) rep_custom_map[-2,-1] $8,$9 fi +fi +if $6 +r.. 200%,200%,1,100%,0,3,1,1 +r. 200%,200%,1,100%,0,3,1,0 +fi +if ($7+($7<0))%2 a[-2,-1] x +else a[-2,-1] y +fi +nw={ceil($mw/w#-1)*w#-1} +nh={ceil($mh/h#-1)*h#01} +r. $nw,$nh,100%,100%,0,2,.5,.5 +repeat $!-1 { ++r. {w#$>},{h#$>},100%,100%,0,0,.5,.5 +rv[$>,-1] +rm. +} +else +if $2 +f[^-1] "begin( +const ww=w-1; +const hh=h-1; +const ox=(1+cut($6,-1,1))/2; +const oy=(1+cut($7,-1,1))/2; +const center_point=int($5/2); +const px=int(xm#-1+center_point-ww*ox); +const py=int(ym#-1+center_point-hh*oy); +); +i(#-1,px+x,py+y,z,0);" +else +if $1==0 j[^-1] [-1],0~,0~ +elif $1==1 j[^-1] [-1],1~,0~ +elif $1==2 j[^-1] [-1],0~,1~ +else j[^-1] [-1],1~,1~ +fi +fi +if narg(${8--1}) +if narg($10) +pass$10 0 +rep_custom_map[0--3] $8,$9,[-1],${11--1} +rm. +else +rep_custom_map[^-1] $8,$9 +fi +fi +fi +rm. +#@cli +rep_fibonacci: stack={ 0= top left | 1= top right | 2= bottom left | 3= bottom right }, output_mode={ 0=corner | 1=spiral }, _start_orientation={ 0=landscape | 1=portrait },_iteration>=0,int_scale>0 +#@cli : stack defines the way that the fibonacci generator will stack within iterations. +#@cli : output_mode defines the style of stacking. +#@cli : _start_orientation defines the orientation of the first two iteration. +#@cli : _iteration defines the number of iteration. 0 means it will auto-find the number of generation. +#@cli : +#@cli : Author: Reptorian ++rep_fibonacci: +skip ${3=0},${4=0},${5=1} +check "$5&&($5==int($5))" +dir={$1%4} +if $4==1 1 return fi +use_dim_lim={!$4} +if $4 +iter_lim=$4 +else +iter_lim=inf +mw=${-max_w} +mh=${-max_h} +fi +__size_n=2 +size_1=1 +size_2=2 +__iter=2 +command "swap: rv[-2,-1]" +command "join: a[-2,-1] $""1" +center_point={$5>1?int($5/2)} +if $5>1 +command "ins_north: ns={$__size_n*$5} $ns,$ns,1,1,$__iter swap join y" +command "ins_south: ns={$__size_n*$5} $ns,$ns,1,1,$__iter join y" +command "ins_west: ns={$__size_n*$5} $ns,$ns,1,1,$__iter swap join x" +command "ins_east: ns={$__size_n*$5} $ns,$ns,1,1,$__iter join x" +else +command "ins_north: $__size_n,$__size_n,1,1,$__iter swap join y" +command "ins_south: $__size_n,$__size_n,1,1,$__iter join y" +command "ins_west: $__size_n,$__size_n,1,1,$__iter swap join x" +command "ins_east: $__size_n,$__size_n,1,1,$__iter join x" +fi +na={$2?4:2} +if $3 +if $2 +if $1%2 1,2,1,1,1-y +else 1,2,1,1,y +fi +if $5>1 r2dx. {$5*100}%,1 fi +if $dir==0 ins_arg=ins_west,ins_south,ins_east,ins_north +elif $dir==1 ins_arg=ins_west,ins_north,ins_east,ins_south +elif $dir==2 ins_arg=ins_east,ins_south,ins_west,ins_north +else ins_arg=ins_east,ins_north,ins_west,ins_south +fi +else +if $dir<2 1,2,1,1,y +else 1,2,1,1,1-y +fi +if $5>1 r2dx. {$5*100}%,1 fi +if $dir==0 ins_arg=ins_east,ins_south +elif $dir==1 ins_arg=ins_west,ins_south +elif $dir==2 ins_arg=ins_east,ins_north +else ins_arg=ins_west,ins_north +fi +fi +else +if $2 +if $1%2 2,1,1,1,x +else 2,1,1,1,1-x +fi +if $5>1 r2dx. {$5*100}%,1 fi +if $dir==0 ins_arg=ins_north,ins_west,ins_south,ins_east +elif $dir==1 ins_arg=ins_north,ins_east,ins_south,ins_west +elif $dir==2 ins_arg=ins_south,ins_west,ins_north,ins_east +else ins_arg=ins_south,ins_east,ins_north,ins_west +fi +else +if $1%2 2,1,1,1,1-x +else 2,1,1,1,x +fi +if $5>1 r2dx. {$5*100}%,1 fi +if $dir==0 ins_arg=ins_south,ins_east +elif $dir==1 ins_arg=ins_south,ins_west +elif $dir==2 ins_arg=ins_north,ins_east +else ins_arg=ins_north,ins_west +fi +fi +fi +do +if $__iter==$iter_lim break fi +if $use_dim_lim +if w#-1>$mw&&h#-1>$mh +if $2 +if {" +center_point=$center_point; +mw=$mw; +mh=$mh; +xp=xm#-1+center_point; +yp=ym#-1+center_point; +lxp=xp-mw; +rxp=xp+mw; +typ=yp-mh; +byp=yp+mh; +cond_a=i(#-1,lxp,typ,0,0,0,0); +cond_b=i(#-1,rxp,typ,0,0,0,0); +cond_c=i(#-1,lxp,byp,0,0,0,0); +cond_d=i(#-1,rxp,byp,0,0,0,0); +cond_a&&cond_b&&cond_c&&cond_d; +"} break fi +else break +fi +fi +fi +${arg\ ($__iter%$na)+1,$ins_arg} +__size_n={$size_1+$size_2} +size_1=$size_2 +size_2=$__size_n +__iter+=1 +while $__iter<$iter_lim +uncommand swap,join,ins_north,ins_south,ins_west,ins_east +#@cli rep_gv: eq. to 'rep_glass_vignette'. +rep_gv: rep_glass_vignette $* +#@cli rep_glass_vignette: refraction,_refraction_power,_len_size=1,_chromatic_aberration,-100%<=_preliminary_shift_x<=100%,-100%<=_preliminary_shift_y<=100%,_image_additional_zoom>0,-360<=_image_angle<=360,_distortion_scale_x,_distortion_scale_y,_distortion_scale_xy>0,-360<=_distortion_angle<=360,_distortion_offset_x,_distortion_offset_y,_subpixel>0,0<=_colorspace<=1,_boundary={ 0=none | 1=neumann | 2=periodic | 3=mirror },_interpolation={ 0=nearest | 1=average | 2=linear | 3=grid | 4=bicubic | 5=lanczos } +#@cli : Distorts images as if it is based from the view of a bulged car mirror or camera len. This G'MIC filter is a heavily extended version of TR's Glass Vignette plugin made for Paint.NET by TechnoRobbo. It can also be used for generating abstract art as well. +#@cli : (eq. to 'rep_gv'). +#@cli : +#@cli : 'refraction' defines the strength of distortion. The farther the values from 0, the greater the distortion is. It is recommended to use percentage alongside a number. +#@cli : '_refraction_power' defines the distortion factor within the refraction. The farther the values from 0, the greater the distortion is. It is recommended to use percentage alongside a number. +#@cli : '_len_size' is the size of distortion accordingly to the terminal ends of the lens distortion. +#@cli : '_chromatic_aberration' is the degree of aberration within channels. The farther the values from 0, the greater the distortion per channels would be. It is recommended to use percentage alongside a number. +#@cli : '_preliminary_shift_x' is the preshift of images before the distortion effect. This is used in the original plugin. It is recommended to use percentage alongside a number. +#@cli : '_preliminary_shift_y' is the preshift of images before the distortion effect. This is used in the original plugin. It is recommended to use percentage alongside a number. +#@cli : '_image_additional_zoom' defines the scaling based on scaling of coordinates of image within the distortion effect. 0 starts with scaling of 1x, and 1 means scaling of 2x. +#@cli : '_image_angle' defines the angle of image within the distortion. +#@cli : '_distortion_scale_x' is the scaling of distortion within the x-axis. When this is set to 0, the ratio of image is used instead. 0 starts with scaling of 1x, and 1 means scaling of 2x. +#@cli : '_distortion_scale_y' is the scaling of distortion within the y-axis. When this is set to 0, the ratio of image is used instead. 0 starts with scaling of 1x, and 1 means scaling of 2x. +#@cli : '_distortion_scale_xy' is the scaling of distortion within the x and y axis at the same time. +#@cli : '_distortion_angle' is the angle of distortion effect. 0 starts with scaling of 1x, and 1 means scaling of 2x. +#@cli : '_distortion_offset_x' is the displacement of distortion within the x-axis. It is recommended to use percentage alongside a number. +#@cli : '_distortion_offset_y' is the displacement of distortion within the y-axis. It is recommended to use percentage alongside a number. +#@cli : '_subpixel' is the level of subpixel sampling to be used. +#@cli : '_colorspace' defines the color space of the image to process distortion on. +#@cli : '_boundary' defines how the out-of-bound areas is to be behave. +#@cli : '_interpolation' defines the interpolation within distortion. +#@cli : Default values: '_refraction_power=0','_lensize=1','_chromatic_aberration=0','_preliminary_shift_x=0','_preliminary_shift_y=0','_image_zoom=0','_image_angle=0','_distortion_scale_x=1','_distortion_scale_y=1','_distortion_scale_xy=1','_distortion_angle=0','_distortion_offset_x=0','_distortion_offset_y=0','_subpixel=1','_colorspace=0','_boundary=3','_interpolation=5', +#@cli : +#@cli : Author: Reptorian. +rep_glass_vignette: +skip ${1=100%},${2=0%},${3=100%},${4=0%},${5=0},${6=0},${7=0},${8=0},${9=100%},${10=100%},${11=100%},${12=0},${13=100%},${14=100%},,${15=1}${16=0},${17=3},${18=2} +convert_colors_fwd=${arg\ 1+$16,,rgb2srgb,rgb2ryb,rgb2cmy,,rgb2hcy,rgb2hsi,rgb2hsl,rgb2hsv,rgb2lab,rgb2lch,rgb2yiq,rgb2yuv,rgb2ycbcr,rgb2ycbcrglic,rgb2xyz,rgb2yes,rgb2k1} +convert_colors_bwd=${arg\ 1+$16,,srgb2rgb,ryb2rgb,cmy2rgb,,hcy2rgb,hsi2rgb,hsl2rgb,hsv2rgb,lab2rgb,lch2rgb,yiq2rgb,yuv2rgb,ycbcr2rgb,ycbcrglic2rgb,xyz2rgb,yes2rgb,k12rgb} +convert_back=0 +sub={1+abs($15)} +foreach { +v + +e[^-1] "Distorts image at angle of $12 with refraction factor of $1, chromatic aberration of $4, zoom factor of $7, preliminary shift of $5, preliminary shift of $6, scale x-axis distortion by $9 multiplied by $11, scale y-axis distortion by $10 multiplied by $11, refraction index by power of $2 placed at $13,$14 at angle of $8." +v - +if (s==3||s==4)&&$16 +convert_back=1 +if $16!=4 +$convert_colors_fwd. +else +if s==3 rgb2cmyk +elif s==4 s c,-3 rgb2cmyk.. a c +fi +fi +fi +shift $5,$6,0,0,$17 +r2dx {$sub*100}%,1 +f "*begin( +const abr=((1-$1)-.001)/.999; +const aberate=sqr(1*abr+(1-$4)*(1-abr)); +const offset_x=w/2*(1-$13); +const offset_y=h/2*(1-$14); +$9&&$10?( +const mx=1/($9*(1/$11)); +const my=1/($10*(1/$11)); +):( +w>h?( +const mx=1/(1*(1/$11)); +const my=1/((h/w)*(1/$11)); +):( +const mx=1/((w/h)*(1/$11)); +const my=1/(1*(1/$11)); +); +); +const ang=pi*($8/180); +const dang=pi*($12/180); +const distrad=1*10^($2/10); +const cos_ang=cos(ang); +const sin_ang=sin(ang); +const cos_dang=cos(dang); +const sin_dang=sin(dang); +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +dist_rot_x(a,b)=a*cos_dang-b*sin_dang; +dist_rot_y(a,b)=a*sin_dang+b*cos_dang; +const sd=max(w,h)/min(w,h); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +rx(a)=((a/2+.5*sx)/sx)*w; +ry(a)=((a/2+.5*sy)/sy)*h; +eucl_norm(a,b)=sqrt(a^2+b^2); +const cv=(eucl_norm(rot_x(sx,sy)/2,rot_y(sx,sy)/2))*(pi/2)*(max(w,h)/min(w,h))*$3; +off_x_primary(a,b)=cos(a)*b*(abs($7)+1); +off_y_primary(a,b)=sin(a)*b*(abs($7)+1); +off_secondary(a,b,c)=a*(1-c)+b*c; +const interpolation=min(abs($18),2); +const mxsx=mx*sx; +const mysy=my*sy; +const expf=1-$1; +s==1?result()=vectors(i(avg_fax_fbx,avg_fay_fby,z,1,interpolation,$17)): +s==2?result()=vectors(i(fbx,fby,z,0,interpolation,$17),i(avg_fax_fbx,avg_fay_fby,z,1,interpolation,$17)): +s==3?result()=vectors(i(fbx,fby,z,0,interpolation,$17),i(avg_fax_fbx,avg_fay_fby,z,1,interpolation,$17),i(fax,fay,0,2,interpolation,$17)): +s==4?result()=vectors(i(fbx,fby,z,0,interpolation,$17),i(avg_fax_fbx,avg_fay_fby,z,1,interpolation,$17),i(fax,fay,0,2,interpolation,$17),i(avg_fax_fbx,avg_fay_fby,z,3,interpolation,$17)): +result()=vectors(i(fbx,fby,z,0,interpolation,$17),i(avg_fax_fbx,avg_fay_fby,z,1,interpolation,$17),i(fax,fay,0,2,interpolation,$17),i(avg_fax_fbx,avg_fay_fby,z,3,interpolation,$17),i(avg_fax_fbx,avg_fay_fby,z,4,interpolation,$17)); +); +XX=((x+offset_x)/w-.5)*2; +YY=((y+offset_y)/h-.5)*2; +xx=dist_rot_x(XX,YY); +yy=dist_rot_y(XX,YY); +xx*=mxsx; +yy*=mysy; +XX=rot_x(xx,yy); +YY=rot_y(xx,yy); +far=norm(XX,YY); +rad=atan2(YY*distrad,XX); +eff=far/cv; +RB=far^expf; +RA=RB*aberate; +off_xS=off_x_primary(rad,far); +off_xA=off_x_primary(rad,RA); +off_xB=off_x_primary(rad,RB); +off_yS=off_y_primary(rad,far); +off_yA=off_y_primary(rad,RA); +off_yB=off_y_primary(rad,RB); +offxA=off_secondary(off_xS,off_xA,eff); +offyA=off_secondary(off_yS,off_yA,eff); +offxB=off_secondary(off_xS,off_xB,eff); +offyB=off_secondary(off_yS,off_yB,eff); +fax=rx(offxA); +fay=ry(offyA); +fbx=rx(offxB); +fby=ry(offyB); +avg_fax_fbx=avg(fax,fbx); +avg_fay_fby=avg(fay,fby); +result();" +r2dx {(1/$sub)*100}%,{abs($18%6)+1} +if $convert_back +if $16!=4 +$convert_colors_bwd. +else +if s==4 cmyk2rgb +elif s==5 s c,-4 cmyk2rgb.. a c +fi +fi +fi +} +#@cli rep_cube2equi: eq. to 'rep_cube_map_to_equirectangular_panorama'. +rep_cube2equi: rep_cube_map_to_equirectangular_panorama $* +#@cli rep_cube_map_to_equirectangular_panorama: 0<=_top_face_placement<=3,0<=_bottom_face_placement<=3 +#@cli : An extension of a code provided by 'Bartosz' at stackoverflow to solve conversion from cube map to equirectangular panorama. Source: https://stackoverflow.com/questions/34250742/converting-a-cubemap-into-equirectangular-panorama +#@cli : (eq. to 'rep_cube2equi').\n +#@cli : Default values: '_top_face_placement=1','_bottom_face_placement=_top_face_placement'\n +#@cli : Author: Reptorian. +rep_cube_map_to_equirectangular_panorama: +skip ${1=1} +if $#>2 error narg(\$\*)<3==F fi +if $1<0||$-1<0||$1>3||$-1>3||!isint($1)||!isint($-1) error intargs(\$\*)==F\ ||\ (\ (\$"1"<3==F||\$"2"<3==F)\ ||\ absargs(\$\*)==F\ ) fi +foreach { +v + e[^-1] "Convert cube map to equirectangular panorama using face $1 for top placement and face $-1 for bottom placement!" v - +ratio={h/w} +if $ratio<1.5 r {w},{.75*w},100%,100%,5 +else r {1.5*h},{h},100%,100%,5 +fi +f "begin( +const a1=$1; +const a2=$1+1; +const b1=$-1; +const b2=$-1+1; +const edge=h/3; +const tl_edge=edge*a1; +const tr_edge=edge*a2; +const bl_edge=edge*b1; +const br_edge=edge*b2; +const bottom_edge=edge*2; +); +(y>=edge&&y=tl_edge&&x=bl_edge&&x2 error narg(\$\*)<3==F fi +if $1<0||$-1<0||$1>3||$-1>3||!isint($1)||!isint($-1) error intargs(\$\*)==F\ ||\ (\ (\$"1"<3==F||\$"2"<3==F)\ ||\ absargs(\$\*)==F\ ) fi +v + e[^-1] "Convert equirectangular panorama to cube map using face $1 for top placement and face $-1 for bottom placement!" v - +foreach { +ratio={w/h} +if $ratio<2 r {w},{.5*w},100%,100%,5 +else r {2*h},{h},100%,100%,5 +fi +{w},{.75*w},100%,100%,"begin( +edge=w/4; +outImgToXYZ(xc,yc,face,edge)=( +a=2*xc/edge;b=2*yc/edge; +if(face==0,ret=[-1,1-a,3-b];); +if(face==1,ret=[a-3,-1,3-b];); +if(face==2,ret=[1,a-5,3-b];); +if(face==3,ret=[7-a,1,3-b];); +if($1==0,if(face==4,ret=[1-b,1-a,1];); +,if($1==1,if(face==4,ret=[a-3,1-b,1];); +,if($1==2,if(face==4,ret=[b-1,a-5,1];); +,if($1==3,if(face==4,ret=[7-a,b-1,1];); +); +); +); +); +if($-1==0,if(face==5,ret=[b-5,1-a,-1;]); +,if($-1==1,if(face==5,ret=[a-3,b-5,-1;]); +,if($-1==2,if(face==5,ret=[5-b,a-5,-1;]); +,if($-1==3,if(face==5,ret=[7-a,5-b,-1;]); +); +); +); +); +ret; +); +); +face2=int(x/edge); +if(yedge*2,face2=5;); +coord3=outImgToXYZ(x,y,face2,edge); +theta=atan2(coord3[1],coord3[0]); +r=norm(coords3[0],coords3[1]); +phi=atan2(coord3[2],r); +uf=((theta+pi)/pi)*edge*2; +vf=((pi/2-phi)/pi)*edge*2; +if($1==$-1,if((x>=edge*$1&&x=edge&&y=edge*$1&&x=edge&&y=edge*$-1&&x=edge&&y=0,_type= { 0=Photo | 1= Horizontal | 2= Vertical | 3= One-Axis Angle | 4= Two-Axis Angle | 5= Two-Axis Disconnected},-360<=_sharpening_angle_a<=360,-360<=_sharpening_angle_b<=360 +#@cli : Extended version of the original TR's Pixel Sharpener for Paint.NET. Some code were changed to make more sense or is more practical. Negative values are enabled for first variable in the G'MIC version. The original code this was based on was created by TechnoRobbo. Source code - https://forums.getpaint.net/topic/26783-trs-pixel-sharpener-plugin-v20-dec-21-2014/ +#@cli : (eq. to 'rep_trps').\n +#@cli : Default values: '_internal_blur=0','_blur_type=0','_sharpening_angle=0'\n +#@cli : Author: Reptorian. +rep_tr_pixel_sharpener: +skip ${2=0},${3=0},${4=0},${5=0} +f "begin( +const ang=pi*($4/180); +const ang2=pi*($5/180); +const cos_ang=cos(ang); +const sin_ang=sin(ang); +const cos_ang2=cos(ang2); +const sin_ang2=sin(ang2); +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +rot_y_alt(a,b)=a*sin_ang2+b*cos_ang2; +const blur=(round(abs($2)+1)-1)*2+3; +const qblur=sqr(blur); +const eblur=floor(blur/2); +const sblur=floor(blur/-2); +const coeff=$1/100; +const mult=qblur*coeff+eblur/round(abs($2)+1); +const choice=abs($3)<=2?abs($3):0; +$3==5?( +fnx()=x+rot_x(j,k); +fny()=y+rot_y_alt(j,k); +): +$3==4?( +fnx()=x+rot_x(j,k); +fny()=y+rot_y(j,k); +): +$3==3?( +fnx()=x+rot_x(j,0); +fny()=y+rot_y(j,0); +): +$3==2?( +fnx()=x; +fny()=y+k; +): +$3==1?( +fnx()=x+j; +fny()=y; +):( +fnx()=x+j; +fny()=y+k; +); +); +sum=i*mult; +for(k=int(sblur),k<=eblur,++k, +for(j=int(sblur),j<=eblur,++j, +if(k!=0&j!=0, +nx=fnx(); +ny=fny(); +nfcalc=i(nx,ny,z,c,0,1); +sum-=nfcalc*coeff; +); +); +); +sum;" +#@cli rep_trif: eq. to 'rep_technorobbo_intense_filtration'. +rep_trif: rep_technorobbo_intense_filtration $* +#@cli rep_technorobbo_intense_filtration: 0<=hue<=360,_gain,_mix,_style_based_on={ 0=Original | 1=Grayscale | 2=Hue },_use_255={ 0=1 | 1=255 } +#@cli : This command is a color filter and augmenter. The code is based from TechnoRobbo's Intense Filtration source code - https://forums.getpaint.net/topic/30148-trs-intense-filtration-v-13-oct-092014/ +#@cli : (eq. to 'rep_trif').\n +#@cli : Warning: This command only works on images with 3 or 4 channel image. It doesn't discriminate between CMYK and RGBA image! So, make sure they're all RGB/RGBA images before using this command!\n +#@cli : 'hue' defines the color to augment. +#@cli : '_gain' defines the coefficient of image or number to multiple on data based on original image. +#@cli : '_mix' defines the strength of the filter. +#@cli : '_style_based_on' defines the style output of the filter based on corresponding name for number defined by filter. +#@cli : '_use_255' defines the maximum value for RGB image. If using float values from 0-1 range, then set to 0, else set to 1.\n +#@cli : Default values: '_gain=2','_mix=1','_style_based_on=0','_use_255=1'\n +#@cli : Author: Reptorian. +rep_technorobbo_intense_filtration: +skip ${2=2},${3=1},${4=0},${5=1} +hue={abs($1)-floor(abs($1)/360)*360} +($hue^1^1) +hsv2rgb. /. 255 +repeat $!-1 { +if s#$>==3||s#$>==4 +sh[$>] 0,2 +f. "begin( +endval(a,b)=(a*mix+(b-b*mix)); +const mv=$5?255:1; +const mixval=abs($3)>1?1:abs($3); +const mix=1-mixval; +const thresh=abs($2)>1?mv/2:mv; +const himax=mv*abs($2)-thresh; +$4==2?result()=endval(gv,tmpv): +$4==1?result()=endval(gray,tmpv): +result()=endval(cv,tmpv); +); +tmpv=i*abs($2)*i(#-2,0,0); +tmpv=tmpv>mv?mv:tmpv; +gray=((i0+i1+i2)/3)*abs($2); +gray=gray>mv?mv:gray; +cv=i*abs($2); +cv=cv>thresh?(cv-thresh)*(mv-thresh)/himax+thresh:cv; +graymix=gray/mv; +gv=i(#-2,0,0)*graymix*mv*abs($2); +gv>mv?mv:gv; +result()" +rm. +else v + error "Image \["$>"\] contains "{s#$>}" channels which does not meet the requirement of 3 or 4 channels!" v - +fi +} +rm. +#@cli rep_colmt: eq. to 'rep_color_modulo_texture'. +rep_colmt: rep_color_modulo_texture $* +#@cli rep_color_modulo_texture: colorspace={ 0=rgb | 1=ryb | 2=cmy | 3=cmyk | 4=hsi | 5=hsl | 6=hsv | 7=lab | 8=lch | 9=yiq | 10=yuv | 11=ycbcr | 12=ycbcrglic | 13=xyz | 14=yes },_include_alpha={ 0=no_alpha | 1=alpha},0<=_channel_order<{ 6 | 24 },_flip_diagonal={ 0=do_not_flip | 1=flip },sublevel>=0,interpolation>=0,_modulo_method_1= { 0=Mod | 1=Reflected Mod | 2=Divmod | 3=Reflected Divmod },_modulo_value_a_1>0,_modulo_value_b_1>0,_angle_1<=360,_value_shift_1>0,_centered_1= { 0=Not centered | 1=Centered },_negate_mod_1= { 0=Not Negated | 1=Negated },_normalize_bool_1= { 0=Do not Normalize | 1=Normalize }..._negate_mod_3 +#@cli : Inspired by MadJik's Color Modulo Texture for Paint.NET, this is a extension of that filter converted into G'MIC form. New features is being able to change color space, allow alpha, and anti-aliasing. +#@cli : (eq. to 'rep_colmt').\n +#@cli : '_modulo_method' defines what method of modulo operation would be applied to each channel. +#@cli : '_modulo_value_a' and 'modulo_value_b' is value used for calculation of modulo of function per channel. +#@cli : '_angle' defines the function angle. +#@cli : '_centered' defines if the function are centered. +#@cli : '_value_shift' adds value to function before modulo calculation. +#@cli : '_centered' is used to define whether the modulo is center. +#@cli : '_negate_mod' negates the end modulo value. +#@cli : '_normalize_bool' is used to normalize values. Note - This can be used to make the filter behave similar to Madjik's Color Modulo Texture filter. +#@cli : '_diagonal_flip' is used to flip diagonal function. +#@cli : '_colorspacemode' defines the color space of modulo. +#@cli : '_contain_alpha' adds alpha value to modulo. In the case of CMYK, this option is nullified, and K is used to replace alpha instead. +#@cli : '_subpixel_processing_level' defines the subpixel processing level. +#@cli : '_interpolation' defines the method of interpolation. +#@cli : '_channel_num' defines the order of channel. +#@cli : Default values: '_include_alpha=0','_channel_order=0','_flip_diagonal=0','_sublevel=1','_interpolation=1','_modulo_method_n=3','_modulo_value_a_n=196','_modulo_value_b_n=255','_angle_n=0','_value_shift_n=0','_center_n=0','_negate_n=0','_normalize_n=0' +rep_color_modulo_texture: +skip ${2=0},${3=0},${4=0},${5=1},${6=5},${7=},${8=},${9=},${10=},${11=},${12=},${13=},${14=},${15=},${16=},${17=},${18=},${19=},${20=},${21=},${22=},${23=},${24=},${25=},${26=},${27=},${28=},${29=},${30=},${31=},${32=},${33=},${34=},${35=},${36=},${37=},${38=} +if narg($7) modulo_method_0={$7%4} else modulo_method_0=3 fi +if narg($8) modvalue_a_0={abs($8)} else modvalue_a_0=196 fi +if narg($9) modvalue_b_0={abs($9)} else modvalue_b_0=255 fi +if narg($10) angle_0=$10 else angle_0=0 fi +if narg($11) value_shift_0=$11 else value_shift_0=0 fi +if narg($12) center_0=$12 else center_0=1 fi +if narg($13) negate_0=$13 else negate_0=0 fi +if narg($14) normalize_0=$14 else normalize_0=0 fi +if narg($15) modulo_method_1={$15%4} else modulo_method_1=$modulo_method_0 fi +if narg($16) modvalue_a_1={abs($16)} else modvalue_a_1=$modvalue_a_0 fi +if narg($17) modvalue_b_1={abs($17)} else modvalue_b_1=$modvalue_b_0 fi +if narg($18) angle_1=$18 else angle_1=$angle_0 fi +if narg($19) value_shift_1=$19 else value_shift_1=$value_shift_0 fi +if narg($20) center_1=$20 else center_1=$center_0 fi +if narg($21) negate_1=$21 else negate_1=$negate_0 fi +if narg($22) normalize_1=$22 else normalize_1=$normalize_0 fi +if narg($23) modulo_method_2={$23%4} else modulo_method_2=$modulo_method_1 fi +if narg($24) modvalue_a_2={abs($24)} else modvalue_a_2=$modvalue_a_1 fi +if narg($25) modvalue_b_2={abs($25)} else modvalue_b_2=$modvalue_b_1 fi +if narg($26) angle_2=$26 else angle_2=$angle_1 fi +if narg($27) value_shift_2=$27 else value_shift_2=$value_shift_1 fi +if narg($28) center_2=$28 else center_2=$center_1 fi +if narg($29) negate_2=$29 else negate_2=$negate_1 fi +if narg($30) normalize_2=$30 else normalize_2=$normalize_1 fi +if narg($31) modulo_method_3={$31%4} else modulo_method_3=$modulo_method_2 fi +if narg($32) modvalue_a_3={abs($32)} else modvalue_a_3=$modvalue_a_2 fi +if narg($33) modvalue_b_3={abs($33)} else modvalue_b_3=$modvalue_b_2 fi +if narg($34) angle_3=$34 else angle_3=$angle_2 fi +if narg($35) value_shift_3=$35 else value_shift_3=$value_shift_2 fi +if narg($36) center_3=$36 else center_3=$center_2 fi +if narg($37) negate_3=$37 else negate_3=$negate_2 fi +if narg($38) normalize_3=$38 else normalize_3=$normalize_2 fi +modnum_0={min($modvalue_a_0,$modvalue_b_0)} +modnum_1={min($modvalue_a_1,$modvalue_b_1)} +modnum_2={min($modvalue_a_2,$modvalue_b_2)} +modnum_3={min($modvalue_a_3,$modvalue_b_3)} +maxmodnum_0={max($modvalue_a_0,$modvalue_b_0)} +maxmodnum_1={max($modvalue_a_1,$modvalue_b_1)} +maxmodnum_2={max($modvalue_a_2,$modvalue_b_2)} +maxmodnum_3={max($modvalue_a_3,$modvalue_b_3)} +check "$maxmodnum_0>1||$maxmodnum_1>1||$maxmodnum_2>1||$maxmodnum_3>1" +flip_diag={$4%2} +sublevel={abs($5)+1} +interpolation={max(1,abs($6)+(abs($6)>3?1))} +cs={$1%15} +kalp={$2||$cs==3} +if $cs bwd_cs=${arg\ $cs,ryb2rgb,cmy2rgb,cmyk2rgb,hsi82rgb,hsl82rgb,hsv82rgb,lab82rgb,lch82rgb,yiq82rgb,yuv82rgb,ycbcr2rgb,ycbcrglic2rgb,xyz82rgb,yes82rgb} fi +if $flip_diag d_a=2 d_b=3 +else d_b=3 d_a=2 +fi +if $kalp +channel_ord=[{([0,1,2,3,0,1,3,2,0,2,1,3,0,2,3,1,0,3,1,2,0,3,2,1,1,0,2,3,1,0,3,2,1,2,0,3,1,2,3,0,1,3,0,2,1,3,2,0,2,0,1,3,2,0,3,1,2,1,0,3,2,1,3,0,2,3,0,1,2,3,1,0,3,0,1,2,3,0,2,1,3,1,0,2,3,1,2,0,3,2,0,1,3,2,1,0])[($3%24)*4,4]}] +else +channel_ord=[{([0,1,2,0,2,1,1,0,2,1,2,0,2,0,1,2,1,0])[($3%6)*3,3]}] +fi +ts={size($channel_ord)} +command "axis_func: f \"begin( +const ww=w-1; +const hh=h-1; +const cx=ww/2; +const cy=hh/2; +const ang=$""1°; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +const axis_mode=$""2; +const sublevel=$""3; +const value_shift=$""5*($""6?1:-1); +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +$""4?( +calc_ix(a)=($""6?ww-a:a)-cx+value_shift; +calc_iy(a)=($""6?hh-a:a)-cy+value_shift; +):( +calc_ix(a)=x+value_shift; +calc_iy(a)=y+value_shift; +); +axis_mode?( +surface()=rot_x(ix,iy); +):( +surface()=rot_y(ix,iy); +); +); +ix=calc_ix(x); +iy=calc_iy(y); +surface=surface()/sublevel;\"" +command "diagonal_func: f \"begin( +const ww=w-1; +const hh=h-1; +const cx=ww/2; +const cy=hh/2; +const ang=$""1°; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +const diag_mode=$""2; +const sublevel=$""3; +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +$""4?( +calc_ix(a)=a-cx; +calc_iy(a)=a-cy; +):( +calc_ix(a)=x; +calc_iy(a)=y; +); +diag_mode?( +mod_base(a,b)=abs(abs(a)-abs(b)); +):( +mod_base(a,b)=abs(abs(a)+abs(b)); +); +); +ix=calc_ix(x); +iy=calc_iy(y); +xx=rot_x(ix,iy); +yy=rot_y(ix,iy); +mod_base(xx,yy)/sublevel;\" ++. $""5" +foreach { +ow,oh={[w,h]} +{w*$sublevel},{h*$sublevel},1,$ts rm.. +repeat $ts { +pos={($channel_ord)[$>]} +sh. $pos +if !($>>=2) +axis_func. ${angle_$>},$>,$sublevel,${center_$>},${value_shift_$>},${negate_$>} +else +if $flip_diag diagonal_func. ${angle_$>},{$>%2},$sublevel,${center_$>},${value_shift_$>} +else diagonal_func. ${angle_$>},{$>%2+1},$sublevel,${center_$>},${value_shift_$>} +fi +fi +modf. ${modulo_method_$>},${maxmodnum_$>},{(${maxmodnum_$>}-${modnum_$>})} +if ${normalize_$>} /. {${maxmodnum_$>}/255} fi +if ${negate_$>} f. max(iM#-1,255)-i fi +rm. +} +if $cs $bwd_cs fi +if $sublevel r $ow,$oh,1,100%,$interpolation fi +} +uncommand diagonal_func,axis_func +#@cli rep_shape_brick: brick_width>0,brick_height>0,_mortar_width>0,_mortar_height>0,_outline>=0,_bevel>=0,_bevel_style= { 0=round | 1=inverse_round | 2=diamond },-1>=_shift_val>=1,_shift_direction= { 0=horizontal | 1=vertical },_flip_offset= { 0= Do Not Flip | 1= Flip },_subpixel_processing_level>=0 +#@cli : 'brick_width' - Width of brick(s) +#@cli : 'brick_height' - Height of brick(s) +#@cli : '_mortar_width' - Filling width between brick(s) +#@cli : '_mortar_height' - Filling height between brick(s) +#@cli : '_outline' - Thickness of outline of brick(s) +#@cli : '_bevel' - Beveling of corners of brick(s) +#@cli : '_bevel_style' - Form of beveling of brick(s) +#@cli : '_shift_val' - Shift of bricks +#@cli : '_shift_direction' - Direction of shift +#@cli : '_flip_offset' - Determines which order the offset from original, to original. +#@cli : '_subpixel_level' - Degree of antialiasing of brick(s)\n +#@cli : Default values: '_mortar_width','_mortar_height','_outline'\n +#@cli : Author: Reptorian. +rep_shape_brick: +skip ${3=10},${4=10},${5=0},${6=0},${7=0},${8=1},${9=0},${10=0},${11=0} +v - +sublevel={abs($11)} +sublevel+=1 +brick_width={abs($1)*$sublevel} +brick_height={abs($2)*$sublevel} +mortar_width={abs($3)*$sublevel} +mortar_height={abs($4)*$sublevel} +outline={abs($5)*$sublevel} +bevel={abs($6)*$sublevel} +bevel_style={abs($7)>2?2:abs($7)} +shift_val=$8 +shift_direction=$9 +flip_offset=$10 +if $bevel_style==2 brick_bevel_style="Diamond" +elif $bevel_style==1 brick_bevel_style="Inverse-Round" +else brick_bevel_style="Round" +fi +if $shift_direction dir="Every two column has displacement of" +else dir="Every two row has displacement of" +fi +if abs($shift_val) no={$shift_val*100} offset=""$dir" "$no""%" from original point." +else offset="" +fi +if $outline linethick={abs($5)} linethick=" with outline of "$linethick" px" +else linethick="" +fi +v + +e[] "Generate brick of "$brick_width" px and "$brick_height" px with mortar width of "$mortar_width" px and mortar height "$mortar_height" px"$linethick". "$offset"" +v + +if !(($brick_width&&$brick_height)||$bevel) v + error "Brick Area must be greater than 0!" v - fi +if $bevel +if $bevel_style==0||$bevel_style==1 shape_circle {$bevel*2} +else shape_diamond {$bevel*2} fi +*. 2 +if $outline +if $bevel_style==0||$bevel_style==1 shape_circle {($bevel+$outline)*2} +else shape_diamond {floor($bevel+($outline*(cos(45/180*pi)+sin(45/180*pi))))*2} r. {($bevel+$outline)*2},{($bevel+$outline)*2},100%,100%,0,0,.5,.5 fi +j[-1] [-2],.5~,.5~,0,0,.5,[-2] +rm.. +fi +s. x,2 +s[-2,-1] y,2 +fi +{$brick_width<$bevel*2?$bevel*2:$brick_width},{$brick_height<$bevel*2?$bevel*2:$brick_height},1,1,1 +if $outline expand_xy. $outline,0 fi +. 1 +if $bevel if $bevel_style==1 negate[-5--2] +f[-5--2] i==2?0:1 fi fi +if $bevel +if $bevel_style==1 +j[-5] [-9],1~,1~,0,0,1,[-4] +j[-5] [-8],1~,0~,0,0,1,[-3] +j[-5] [-7],0~,1~,0,0,1,[-2] +j[-5] [-6],0~,0~,0,0,1,[-1] +rm[-4--1] +else +j[-1] [-5],0~,0~ +j[-1] [-4],0~,1~ +j[-1] [-3],1~,0~ +j[-1] [-2],1~,1~ +fi +rm[-5--2] +fi +r. {w+$mortar_width},{h+$mortar_height},100%,100%,0,0,{!$flip_offset},{!$flip_offset} +if $shift_val +if $shift_direction +shift. 0,{($shift_val/2)*100}%,0,0,2 a[-2,-1] x if $flip_offset mirror. x fi +else +shift. {($shift_val/2)*100}%,0,0,0,2 a[-2,-1] y if $flip_offset mirror. y fi +fi +fi +if $sublevel-1 r2dx. {(1/$sublevel)*100}%,5 fi +v - +#@cli rep_z_render: _reverse_z_layer={ 0=first_layer | last_layer },_z_depth_value>0,_mirror_order={ 0=do_not_mirror | 1=mirror },_color_z_render={ 0=image_z_per_luminosity | 1=image_z_per_channel } +#@cli : Generates the resulting image based on z-map layer.\n +#@cli : '_reverse_z_layer' determines whether the first or last layer should be used to determine the "frame" to use. +#@cli : '_z_depth_value' can be described as how smooth the transition between images should be +#@cli : '_mirror_order' can be used to reorder the image transition +#@cli : '_color_z_render' sets whether the transition are separated by channels or not. +#@cli : Note: Try to use gradient as the z-layer.\n +#@cli : Default values: '_reverse_layer=0','_z_depth_value=255','_mirror_order=0','_color_z_render=0'\n +#@cli : Author: Reptorian. +rep_z_render: +skip ${1=0},${2=255},${3=0},${4=0} +if $!<3 v + error "You need at least 3 images!" v - fi +if $1 rv[0,-1] rv[0,-2] fi +if !$4 to_gray[0] fi +a[^0] z +n[0] 0,$2 +r[^0] 100%,100%,$2,100%,3 +if $3 negate[0] fi +r[0] 100%,100%,100%,{s#-1} +f[0] i(#-1,x,y,i,c,3,1) +k[0] +#@cli rep_acb: (eq. to rep_autofill_coloring_book) +rep_acb: rep_autofill_coloring_book $* +#@cli rep_autofill_coloring_book: 0=0,_color_mode={ 0=hard | 1= soft },0<=_alpha_threshold<1,_seed +#@cli : rep_autofill_coloring_book is used for automatically coloring pictures with lines.\n +#@cli : _threshold defines the value that is to be split into binary values. If it over _threshold, then it becomes 1. +#@cli : _dilate_erode defines the increase/decrease in line. Values over 0 implies increase in thickness while values less than 1 implies decrease in thickness. +#@cli : _color_mode defines whether the black line is going to be black or smooth. +#@cli : _alpha threshold defines the value of alpha to be cutoff by percentage +#@cli : _seed can be seen as premade random result.\n +#@cli : Default values: '_threshold=128','_dilate_erode=0','_color_mode=1','_alpha_threshold=0','_seed=' +rep_autofill_coloring_book: +skip ${2=0},${3=1},${4=0},${5=} +if narg($5) srand $5 fi +foreach { +sh 0,2 +if s#0==4 sh.. {s} vv={iv#-1} fi +rep_acb_color[1] ${1-3} +if s#0==4 +if ($4>0&&$4<1)&&$vv f. i>(iM*$4)?255:0 fi +fi +k[0] +} +rep_acb_color: +if $1<=0 v + error "threshold must be greater than 0" v - fi +if $1>=1 v + error "threshold must be less than 1" v - fi +to_gray n 0,1 +if !iv#-1 v + error "Invalid Image!" v - fi +if $3 +store line fi +f i>=$1?1:0 +if abs($2) +if $2<0 dilate {abs($2)} +else erode {abs($2)} +fi +fi +label_fg 0,1 +cv={iM} +min_t=1 +max_t={round(16777215/$cv)} +nt={$min_t} +ntt={$max_t} +1 +repeat $cv { +1,1,1,1,round(u($nt,$ntt)) +nt={iM#-1+1} +ntt={$nt+$max_t} +a[-2,-1] x +} +repeat $cv { +temp_1={i(round(u(1,$cv)))} +temp_2={i(round(u(1,$cv)))} +if $temp_1!=$temp_2 +f. i==$temp_1?$temp_2:(i==$temp_2?$temp_1:i) +fi +} +{w},1,1,3,[i0#-1%256,floor(i0#-1/256)%256,floor(i0#-1/(256^2))] +map... . rm[-2,-1] +if $3 ++select_color 0,0,0 +inpaint_pde [1],0,0,0 +rm. +$line +f.. i*i0#-1 +rm. +fi +#@cli rep_recc: eq. to 'rep_reverse_engineer_color_curves'. +rep_recc: rep_reverse_engineer_color_curves $* +#@cli rep_reverse_engineer_color_curves: _array_size>0 +#@cli : Automatically reverse engineer color curves. All images after [0] will be converted into color curve map while [0] is the reference image. +#@cli : (eq. to 'rep_recc'). +#@cli : '_array_size' is used to define the depth of gradient map, if you're using float, then you need to scale image to something higher than 256. If array size is not inserted, then this filter will automatically find the array size. +#@cli : Default values: '_array_size=n/a' +#@cli : +#@cli : Author: Reptorian. +rep_reverse_engineer_color_curves: +skip ${1=} +if !$!>1 error n(imgs)>2==F fi +ww={w#0} +hh={h#0} +dd={d#0} +ss={s#0} +if narg($1) +if im#0<0 mv={abs(im#0)+abs($1)} -[0] {im#0} +else mv={abs($1)} fi +else +if im#0<0 -[0] {im#0} fi +mv={iM#0} +fi +store[0] refimg +repeat $! { +img_id=$> +pos={$img_id+1} +if w#$img_id!=$ww||h#$img_id!=$hh||d#$img_id!=$dd||s#$img_id!=$ss error dims(#$pos)!=dims(ref) fi +} +foreach { +$refimg +_rep_recc[0,-1] $mv +} +_rep_recc: +rv +$1,1,1,100% . +repeat s { +sh $> +rm[-4--1] +f[-4] i(#-2,i,0,0)+=i#-3-i#-4;i(#-1,i,0,0)+=1;i +} ++eq. 0 ++.. . +/... .. +rm.. +repeat s { +sh.. $> +sh.. $> +inpaint_pde.. . +rm[-2,-1] +} +f.. i+x +cut.. 0,{$1-1} +k.. +#@cli rep_regm: eq. to 'rep_reverse_engineer_gradient_map'. +rep_regm: rep_reverse_engineer_gradient_map $* +#@cli rep_reverse_engineer_gradient_map: _array_size>0,_norm={ 0=do_not_norm | 1=norm } +#@cli : Automatically reverse engineer gradient map. All images after [0] will be converted into gradient map while [0] is the gray reference. +#@cli : (eq. to 'rep_regm'). +#@cli : '_array_size' is used to define the depth of gradient map, if you're using float, then you need to scale image to something higher than 256. If array size is not inserted, then this filter will automatically find the array size. +#@cli : '_normalize' is used to normalize image to max array id number. Useful when using float as reference. +#@cli : Default values: '_array_size=n/a','_normalize=0' +#@cli : +#@cli : Author: Reptorian, Garagecoder. +rep_reverse_engineer_gradient_map: +skip ${1=},${2=0} +if !$!>1 error n(imgs)>2==F fi +ww={w#0} +hh={h#0} +dd={d#0} +if s#0==2 s[0] c rm[1] +elif s#0==3 to_rgb[0] rgb2hsl8[0] channels[0] 2 +elif s#0==4 s[0] c,-3 to_rgb[0] rm[1] rgb2hsl8[0] channels[0] 2 +fi +if narg($1) +if im#0<0 mv={abs(im#0)+abs($1)} -[0] {im#0} +else mv={abs($1)} fi +else +if im#0<0 -[0] {im#0} fi +mv={iM#0} +fi +if $2&&narg($1) n[0] 0,{$mv-1} fi +store[0] refimg +repeat $! { +pos={$>+1} +if w#$>!=$ww||h#$>!=$hh||d#$>!=$dd error dims(#$pos)!=dims(ref) fi +} +foreach { +$refimg +gcd_regm[0,-1] $mv +} +gcd_regm: +rv +round.. 1 +$1,1,1,{s#-1} +f[0] "I[#-1,i]+=I(#1,x,y,z);i" ++histogram[0] $1,0,$1 ++eq. 0 +add[-2] [-1] +div[-3,-2] +inpaint_pde.. . +rm[-4,-3,-1] +#@cli rep_primelist: +#@cli : Return vector of boolean values up to the maximum image value rounded. Values are found by whether the argument number within vector is a prime. +rep_primelist: +maxn=0 +repeat $! maxn={ceil(max($maxn,max(abs(im#$>),iM#$>)))} done +u {" +const mv="$maxn"; +prime=vectormv(1); +prime[0]=prime[1]=0; +for(p=2,sqr(p)<=mv,++p, +if(prime[p], +for(v=sqr(p),v<=mv,v+=p, +prime[v]=0; +); +); +); +(prime)"} +#@cli rep_isprime: +#@cli : Values of image are changed to either 1 or 0 depending on the value is a prime number. +rep_isprime: +f "begin(prime=["${-rep_primelist}"];); +prime[round(abs(i))];" +#@cli rep_prime_surface: _width,_height,_negate= { 0=do_not_negate | 1=negate },_mirror +#@cli : Creates a simple prime surface by combining rep_primelist and spiralbw. +#@cli : Default values: '_width=last_image_width','_height=last_image_height' +rep_prime_surface: +skip ${1=w},${2=h},${3=1},${4=0} +spiralbw {abs($1)},{abs($2)} +local[-1] { +if $3 negate. fi +if abs($4)==1 mirror. x +elif abs($4)==2 mirror. y +fi +f "begin(prime=["${-rep_primelist}"];); +prime[round(abs(i))];" +} +#@cli rep_ced8: eq. to 'rep_color_existence_distribution_rgb8'. +rep_ced8: rep_color_existence_distribution_rgb8 $* +#@cli rep_color_existence_distribution_rgb8: _bool_found= { 0=colour_nonexistence | colour_existence } +#@cli : This cli command is used to find which colors exist within the color lookup table generated from 8-bit positive-only colors that ranges from 0-255. Millions of colors that does not exist within a image can be picked from a image generated with this command. +#@cli : (eq. to 'rep_ced8').\n +#@cli : Author: Reptorian. +rep_color_existence_distribution_rgb8: +nk=$1 +nk_1={$nk?255:0} +nk_2={$nk?0:255} +foreach { +256,256,256 eval.. "++i(#-1,R,G,B)" k. +4096,4096,1,4,[x%256,y%256,floor(x/256)+(floor(y/256)*16),i(#-1,x%256,y%256,floor(x/256)+(floor(y/256)*16))?$nk_1:$nk_2] +k. +} +#@cli rep_sdaxy: eq. to 'rep_shift_distance_angle_xy'. +rep_sdaxy: rep_shift_distance_angle_xy $* +#@cli rep_shift_distance_angle_xy: _offset>0,_angle,_boundary_condition={ 0=None | 1=Neumann | 2=Periodic | 3=Mirror },_interpolation={ 0=nearest_neighbor | 1=linear } +#@cli : Offset images at angle and distance. +#@cli : (eq. to 'rep_sdaxy').\n +#@cli : _offset refers to the displacement of image.\n +#@cli : Default value: 'boundary_condition=3','interpolation=1'\n +#@cli : Author: Reptorian. +rep_shift_distance_angle_xy: +skip ${3=3},${4=1} +rad_ang={$2/180*pi} +shift {cos($rad_ang)*$1},{sin($rad_ang)*$1},0,0,$3,$4 +#@cli rep_dupsdaxy: eq. to 'rep_duplicate_by_shift_distance_angle_xy'. +rep_dupsdaxy: rep_duplicate_by_shift_distance_angle_xy $* +#@cli rep_duplicate_by_shift_distance_angle_xy: duplicates_count>=2,_radius_offset>0,_offset_angle,_keep_original={ 0=remove_original | 1=keep_original },_boundary_condition={ 0=None | 1=Neumann | 2=Periodic | 3=Mirror },_interpolation={ 0=nearest_neighbor | 1=linear } +#@cli : Creates copies of image at a distance from original point. +#@cli : (eq. to 'rep_dupsdaxy').\n +#@cli : _radius_offset refers to the distance the duplicates are from the original image. Each circular duplicates are of the same distance. radius_offset can be in percentage form, or in integer form. When it is in percentage form, the length of each duplicates offset is equal to the percentage of diagonal of image. +#@cli : _offset_angle refers to the starting angle the original duplicate is at. The primary duplicate starts from the right.\n +#@cli : Default value: '_radius_offset={sqrt(w^2+h^2)*.05}','_offset_angle=0','_keep_original=0','_boundary_condition=0','_interpolation=1'\n +#@cli : Author: Reptorian. +rep_duplicate_by_shift_distance_angle_xy: +skip ${2={norm(w,h)*.05}},${3=0},${4=0},${5=1},${6=1} +if $1<2 v + error "Invalid duplicate numbers!" fi +aang={360/$1} +repeat $1 { +rep_shift_distance_angle_xy[0] $2,{$>*$aang+$3},$5,$6 } +if !$4 rm[0] fi +#@cli rep_frblur: eq. to 'rep_fragment_blur'. +rep_frblur: rep_fragment_blur $* +#@cli rep_fragment_blur: duplicates_count>=2,_radius_offset>0,_offset_angle,_keep_original={ 0=remove_original | 1=keep_original },_boundary_condition={ 0=None | 1=Neumann | 2=Periodic | 3=Mirror },_interpolation={ 0=nearest_neighbor | 1=linear },_color_space={ 0=RGB | 1=SRGB | 2=RYB | 3=CMYK | 4=HCY | 5=HSI | 6=HSL | 7=HSV | 8=LAB | 9=LCH } +#@cli : Fragment Blur is a effect that originated from the Windows software named Paint.NET. Copies or "fragments" of images are superimposed over their respective images. Copies are redrawn at a distance, and starting copy starts from the right at 0. +#@cli : (eq. to 'rep_frblur').\n +#@cli : _radius_offset refers to the distance the duplicates are from the original image. Each circular duplicates are of the same distance. radius_offset can be in percentage form, or in integer form. When it is in percentage form, the length of each duplicates offset is equal to the percentage of diagonal of image. +#@cli : _offset_angle refers to the starting angle the original duplicate is at. The primary duplicate starts from the right. +#@cli : _keep_original options is to keep the original image as a duplicate without offsetting it.\n +#@cli : Default values: '_radius_offset=5%','_offset_angle=0','_keep_original=0','_boundary_condition=1','_interpolation=1','_color_space=0'\n +#@cli : Author: Reptorian. +rep_fragment_blur: +skip ${2=5%},${3=0},${4=0},${5=1},${6=0},${7=0} +convert_colors_fwd=${arg\ 1+$7,,rgb2srgb,rgb2ryb,,rgb2hcy,rgb2hsi,rgb2hsl,rgb2hsv,rgb2lab,rgb2lch} +convert_colors_bwd=${arg\ 1+$7,,srgb2rgb,ryb2rgb,,hcy2rgb,hsi2rgb,hsl2rgb,hsv2rgb,lab2rgb,lch2rgb} +_frblur_iter_ang,_frblur_shift_ang,_ti,_frblur_dist={(2*pi)/$1},{deg2rad($3)},{abs($1)+($4?1)},1 +if $6 +command "rep_frblur_sdaxy_add : +100%,100%,100%,100% . +$1,1,1,2,\"begin( +const iter_ang=$_frblur_iter_ang; +const shift_ang=$_frblur_shift_ang; +); +[cos(x*iter_ang+shift_ang)*$""1,sin(x*iter_ang+shift_ang)*$""1];\" +repeat $1 { +j.. [0] +shift.. {I(#-1,$>)},0,0,$5,1 +add... .. +} +if $4 k[0,-3] add else k... fi +" +else +if $5 +command "rep_frblur_sdaxy_add : +dist={ceil($""1)} +100%,100%,100%,100% ++expand_xy[0] $dist,$5 +$1,1,1,2,\"begin( +const offset=$dist; +const iter_ang=$_frblur_iter_ang; +const shift_ang=$_frblur_shift_ang; +); +[round(cos(x*iter_ang+shift_ang)*$""1-offset),round(sin(x*iter_ang+shift_ang)*$""1-offset)];\" +repeat $1 { j[1] [-2],{I(#-1,$>)},0,0,-1 } +if $4 +k[0,1] +add +else +k[1] +fi +" +else +command "rep_frblur_sdaxy_add : +100%,100%,100%,100% +$1,1,1,2,\"begin( +const iter_ang=$_frblur_iter_ang; +const shift_ang=$_frblur_shift_ang; +); +[round(cos(x*iter_ang+shift_ang)*$""1),round(sin(x*iter_ang+shift_ang)*$""1)];\" +repeat $1 { j[1] [0],{I(#-1,$>)},0,0,-1 } +if $4 k[0,1] add else k[1] fi" +fi +fi +command "rep_frblur_alp : +sh 0,{s-2} +sh.. {s} +maxa={iM#-1} +/. $maxa +*.. . +rm[-2,-1] +rep_frblur_sdaxy_add $""1 +sh 0,{s-2} sh.. {s} f.. I/(i0#-1?i0#-1:1) *. {$maxa/iM#-1} rm[-2,-1]" +command "rep_frblur_nalp : rep_frblur_sdaxy_add $""1 / $_ti" +foreach { +if ${is_percent\ $2} dist={abs($2)*norm(w,h)/2} +else dist={abs($2)} fi +tcr,convert_back=3,0 +if (s==3||s==4)&&$7 +convert_back=1 +if $7!=3 +$convert_colors_fwd. +else +if s==3 tcr+=1 rgb2cmyk +elif s==4 s c,-3 rgb2cmyk.. a c +fi +fi +fi +if !(s==1||s==$tcr) +rep_frblur_alp $dist +else +rep_frblur_nalp $dist +fi +if $convert_back +if $7!=3 +$convert_colors_bwd. +else +if s==4 cmyk2rgb +elif s==5 s c,-4 cmyk2rgb.. a c +fi +fi +fi +} +uncommand rep_frblur_sdaxy_add,rep_frblur_alp,rep_frblur_nalp +#@cli rep_ncee: _distance>0,0<=_angle<=360,boundary_condition={ 0=none | 1=neumann | 2=periodic | 3=mirror },_interpolation={ 0=nearest_neighbor | 1=linear },_contrast>=0,_process_alpha={ 0=do_not_process_alpha | 1=process_alpha },_color_space,_blend_mode,0<=_blend_opacity[%]<=1 +#@cli : Default value: 'boundary_condition=3','interpolation=1','contrast=1','process_alpha=1','color_space=0','blend_mode=1','blend_opacity=100%'\n +#@cli : Author: Reptorian. +rep_ncee: +skip ${3=3},${4=1},${5=1},${6=1},${7=0},${8=1},${9=1} +convert_colors_fwd=${arg\ $7+1,,rgb2ryb,rgb2cmy,rgb2cmyk,rgb2hsi8,rgb2hsl8,rgb2hsv8,rgb2lab8,rgb2lch8,rgb2yiq8,rgb2yuv8,rgb2xyz8,rgb2yes8,rgb2k18,rgb2ohta8} +convert_colors_bwd=${arg\ $7+1,,ryb2rgb,cmy2rgb,cmyk2rgb,hsi82rgb,hsl82rgb,hsv82rgb,lab82rgb,lch82rgb,yiq82rgb,yuv82rgb,xyz82rgb,yes82rgb,k182rgb,ohta82rgb} +-command "MergeChoice : $""=_mode" -MergeChoice "add","alpha","and","average","blue","burn","darken","difference","divide","dodge","exclusion","freeze","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor","edges","error" +to_a +split_opacity +local[0] { +$convert_colors_fwd +[0] +local[1] { +rep_dupsdaxy 2,$1,$2,0,$3,$4 +tci={$!} +f. "255-i" +add / $tci +- 127.5 +* {2*$5} ++ 127.5 +cut 0,255 +} +if $7!=3 +blend ${_mode{$8+1}},$9 +$convert_colors_bwd +elif $7==3 +s c +repeat 4 { +local[$>,{$!-1}] { +to_rgb +blend ${_mode{$8+1}},$9 +} +} +a c +cmyk2rgb +fi +} +local[1] { +if $6 rep_dupsdaxy 0,2,$1,$2,$3,$4 tai={$!} add / $tai fi +} +a c +#@cli pal: 0<="palette_id"<=378 +#@cli : Inserts pre-made user-made palette or palette that are based off older consoles or software. +#@cli : +#@cli : \- The following list contains valid inputs directly next to their name, but anything after dashes is only for information purpose. Equal sign means that the commands are identical. - +#@cli : +#@cli : +pal 0 = +pal bw -- Black & White +#@cli : +pal 1 = +pal rgb -- Red-Green-Blue +#@cli : +pal 2 = +pal b_rgb -- Black with Red-Green-Blue +#@cli : +pal 3 = +pal bw_rgb -- Black & White with Red-Green-Blue +#@cli : +pal 4 = +pal cmy -- Cyan-Magenta-Yellow +#@cli : +pal 5 = +pal cmyk -- Cyan-Magenta-Yellow-Black +#@cli : +pal 6 = +pal wcmyk -- White-Cyan-Magenta-Yellow-Black +#@cli : +pal 7 = +pal rgbcmy -- Red-Green-Blue with Cyan-Magenta-Yellow +#@cli : +pal 8 = +pal 1bitrgb -- 1-Bit RGB +#@cli : +pal 9 = +pal aurora -- Aurora by GrafxKid +#@cli : +pal 10 = +pal zenit_241 -- Zenit-241 by Zenit40 +#@cli : +pal 11 = +pal gbg -- Game Builder Garage: Texture-Sprite Editor Palette +#@cli : +pal 12 = +pal duel -- Duel by Arilyn +#@cli : +pal 13 = +pal hocuspocus -- Hocus Pocus Palette by Apogee Software,Ltd. +#@cli : +pal 14 = +pal playpal -- PLAYPAL by id Tech 1 | DOOM Engine +#@cli : +pal 15 = +pal srb2 -- Sonic Robo Blast 2 +#@cli : +pal 16 = +pal uzebox -- Uzebox from Uzebox console +#@cli : +pal 17 = +pal kens16 -- Andrew Kensler - 16 by Andrew Kensler +#@cli : +pal 18 = +pal kens32 -- Andrew Kensler - 32 by Andrew Kensler +#@cli : +pal 19 = +pal kens54 -- Andrew Kensler - 54 by Andrew Kensler +#@cli : +pal 20 = +pal aap12 -- AAP-Micro 12 by Adigun A. Polack +#@cli : +pal 21 = +pal aap16 -- AAP-16 by Adigun A. Polack +#@cli : +pal 22 = +pal aap64 -- AAP-64 by Adigun A. Polack +#@cli : +pal 23 = +pal aap96 -- AAP-RadiantPLUS by Adigun A. Polack +#@cli : +pal 24 = +pal aap128 -- AAP-SPLENDOR128 by Adigun A. Polack +#@cli : +pal 25 = +pal aap_dga16 -- AAP-DGA16 by Adigun A. Polack +#@cli : +pal 26 = +pal cheerful32 -- Cheerful-32 by SoundsDotZip +#@cli : +pal 27 = +pal db8 -- DB8 by DawnBringer +#@cli : +pal 28 = +pal db16 -- DB16 by DawnBringer +#@cli : +pal 29 = +pal db32 -- DB32 by DawnBringer +#@cli : +pal 30 = +pal db_iso22 -- DB-ISO22 by DawnBringer +#@cli : +pal 31 = +pal dimwid17 -- DimWiddy 17 by DimWiddy +#@cli : +pal 32 = +pal dimwid23 -- DimWiddy 23 by DimWiddy +#@cli : +pal 33 = +pal edg4 -- Endesga-4 by Endesga +#@cli : +pal 34 = +pal edg8 -- Endesga-8 by Endesga +#@cli : +pal 35 = +pal edg16 -- Endesga-16 by Endesga +#@cli : +pal 36 = +pal edg32 -- Endesga-32 by Endesga +#@cli : +pal 37 = +pal edg36 -- Endesga-36 by Endesga +#@cli : +pal 38 = +pal edg64 -- Endesga-64 by Endesga +#@cli : +pal 39 = +pal famicube -- Famicube by Arne +#@cli : +pal 40 = +pal juicy32 -- Juicy-32 by Real Juice +#@cli : +pal 41 = +pal juicy56 -- Juicy-56 by Real Juice +#@cli : +pal 42 = +pal xaiue -- XAIUE-22 by xaiue +#@cli : +pal 43 = +pal 15pdx -- 15P-DX by GrafxKid +#@cli : +pal 44 = +pal 20pdx -- 20P-DX by GrafxKid +#@cli : +pal 45 = +pal 24pdx -- 24P-DX by GrafxKid +#@cli : +pal 46 = +pal cabana64 -- Cabana-64 by Crabby +#@cli : +pal 47 = +pal fant16 -- Fantasy 16 by Brettybooop +#@cli : +pal 48 = +pal fant24 -- Fantasy 24 by Gabriel C. +#@cli : +pal 49 = +pal tf23 -- Tranquil Fantasy 23 by windfall.apples +#@cli : +pal 50 = +pal tfp39 -- Tranquility Plus 39 by windfall.apples +#@cli : +pal 51 = +pal faraway48 -- Faraway 48 by Igor Ferreira. +#@cli : +pal 52 = +pal fleja_m -- Fleja Master Palette by Fleja +#@cli : +pal 53 = +pal koni32 -- Koni32 by Konic +#@cli : +pal 54 = +pal linearbasic -- Linear Color Palette Basic by GrafxKid +#@cli : +pal 55 = +pal lego -- LEGO colors from LEGO wiki +#@cli : +pal 56 = +pal lego2021 -- Lego Colours 2021 by Six Pies +#@cli : +pal 57 = +pal vinelinear -- Vines Flexible Linear Ramps by Vine 2D +#@cli : +pal 58 = +pal arcade29 -- Arcade Standard 29 by GrafxKid +#@cli : +pal 59 = +pal arq16 -- ARQ16 by Endesga +#@cli : +pal 60 = +pal atom8 -- Atom-8 by polyphrog +#@cli : +pal 61 = +pal blk36 -- BLK 36 by BlackedIRL. +#@cli : +pal 62 = +pal blkneo -- BLK-NEO by BlackedIRL. +#@cli : +pal 63 = +pal brokefac -- Broken Facility by telepathic-melon +#@cli : +pal 64 = +pal bubblegum -- Bubblegum-16 by PineTreePizza +#@cli : +pal 65 = +pal cpcboy -- CPC BOY by Arne Niklas Jansson +#@cli : +pal 66 = +pal cade15 -- Cade 15 by MonstersGoBoom +#@cli : +pal 67 = +pal calder8 -- Calder 8 by Philip Dodderige +#@cli : +pal 68 = +pal cdbac -- CD-BAC by DimWiddy +#@cli : +pal 69 = +pal cgarne -- CG Arne by Arne Niklas Jansson +#@cli : +pal 70 = +pal dino -- Dinoknight 16 by Retrospec +#@cli : +pal 71 = +pal 4l -- ||||-22 by |||| +#@cli : +pal 72 = +pal fzteth16 -- FZT Ethereal 16 by Fusionnist +#@cli : +pal 73 = +pal indc -- Indecision by Nelson SMG +#@cli : +pal 74 = +pal island16 -- Island Joy 16 by Kerrie Lake +#@cli : +pal 75 = +pal journey -- Journey by PineTreePizza +#@cli : +pal 76 = +pal shallowmarsh26 -- Shallowmarsh26 by archer +#@cli : +pal 77 = +pal lago_nenufar -- Lago Nenufar (Lake Water Lily) by Popxel Art +#@cli : +pal 78 = +pal juicy -- Juicy 17 by JerryPie +#@cli : +pal 79 = +pal chocolateganache -- ChocolateGanache by Ladybug +#@cli : +pal 80 = +pal brightwinter1 -- Bright Winter 1 by Nai +#@cli : +pal 81 = +pal brightwinter2 -- Bright Winter 2 by Nai +#@cli : +pal 82 = +pal kawaii -- Kawaii16 by Arisuki +#@cli : +pal 83 = +pal xdb_01 -- 0xdb-01 by 0xDB +#@cli : +pal 84 = +pal gzxp -- GZXP by GrafxKid +#@cli : +pal 85 = +pal chrom16 -- Chromatic16 by DragonDePlatino +#@cli : +pal 86 = +pal piet -- Piet by P-Tux7 +#@cli : +pal 87 = +pal boltbait_matrix -- Matrix by BoltBait +#@cli : +pal 88 = +pal material_design -- Material Design by Ruchir L. Sharma +#@cli : +pal 89 = +pal thehamster_rainbow -- Rainbow by thehamster +#@cli : +pal 90 = +pal boltbait_rainbow -- Rainbow by BoltBait +#@cli : +pal 91 = +pal scrj36 -- SCRJ-XXXVI by StudioCRJ +#@cli : +pal 92 = +pal pxls_default -- Pxls Default from pxls.space +#@cli : +pal 93 = +pal moderna -- Moderna by yedamameday +#@cli : +pal 94 = +pal oak -- Oak21 by Dan Oak +#@cli : +pal 95 = +pal nature55 -- Nature's Embrace 55 by GrafxKid +#@cli : +pal 96 = +pal rbypgo -- RBYPGO by Marilynx +#@cli : +pal 97 = +pal new_worlds -- New Worlds 46 by Count Moriarty +#@cli : +pal 98 = +pal nauris16 -- Nauris-16 by Nauris +#@cli : +pal 99 = +pal dynamite -- Dynamite by Pixi +#@cli : +pal 100 = +pal interstate_28 -- Interstate 28 by maine +#@cli : +pal 101 = +pal downgraded_32 -- Downgraded 32 by daniel +#@cli : +pal 102 = +pal pear36 -- Pear 36 by PineTreePizza +#@cli : +pal 103 = +pal pineapple32 -- Pineapple 32 by PineTreePizza +#@cli : +pal 104 = +pal peach -- Peachy Pop 16 by Kerrie Lake +#@cli : +pal 105 = +pal resurrect -- Resurrect 32 by Kerrie Lake +#@cli : +pal 106 = +pal rosy42 -- Rosy 42 by PineTreePizza +#@cli : +pal 107 = +pal slso -- SLSO-CLR17 by Luis Miguel Maldonado +#@cli : +pal 108 = +pal softy15 -- Softy 15 by Eggy +#@cli : +pal 109 = +pal spec12 -- SPEC12 by Smalls +#@cli : +pal 110 = +pal roarin80s -- The Roarin 80's by Malo +#@cli : +pal 111 = +pal starmancer -- Starmancer by Ominux Games +#@cli : +pal 112 = +pal superfuture -- SuperFuture25 by Endesga +#@cli : +pal 113 = +pal sunshine_35 -- SUNSHINE 35 by mysunnyrose +#@cli : +pal 114 = +pal sweetie16 -- Sweetie 16 by GrafxKid +#@cli : +pal 115 = +pal calm48 -- Calm 48 by Xina +#@cli : +pal 116 = +pal optimism -- Optimism by mingapur +#@cli : +pal 117 = +pal taffy16 -- Taffy 16 by PineTreePizza +#@cli : +pal 118 = +pal todayland -- Todayland Palette V2 by GrafxKid +#@cli : +pal 119 = +pal trirampo -- TriRampo by ANoob +#@cli : +pal 120 = +pal reddit_place_2022 -- r\place 2022 +#@cli : +pal 121 = +pal tropical_cone_24 -- Tropical Cone 24 by yedamameday +#@cli : +pal 122 = +pal vivid17 -- Vivid-17 by Irenaart +#@cli : +pal 123 = +pal shido76 -- SHIDO50+ by Shidoengie +#@cli : +pal 124 = +pal intacto -- Intacto14 by Anoob +#@cli : +pal 125 = +pal itatsi -- Itatsi by SoundsDotZip +#@cli : +pal 126 = +pal enos16 -- ENOS16 by Endesga +#@cli : +pal 127 = +pal grixel_grotto -- Grixel Grotto by Northernite +#@cli : +pal 128 = +pal sup8 -- Superb 8 by BigPotato +#@cli : +pal 129 = +pal undertones -- Undertones-17 by Irenaart +#@cli : +pal 130 = +pal tango -- Tango by Duck +#@cli : +pal 131 = +pal cheese -- Cheese Palette by Gors +#@cli : +pal 132 = +pal equpix15 -- Equpix 15 by Night +#@cli : +pal 133 = +pal zu32 -- Zughy 32 by Zughy +#@cli : +pal 134 = +pal voodo -- Voodo34 by Shamaboy +#@cli : +pal 135 = +pal franzston_30 -- Franzston 30 by Virus610 +#@cli : +pal 136 = +pal night16 -- Night 16 by Night +#@cli : +pal 137 = +pal star29 -- Star 29 by Starlane +#@cli : +pal 138 = +pal star34 -- Star 34 by Starlane +#@cli : +pal 139 = +pal stilllife -- Still-Life by cure +#@cli : +pal 140 = +pal simjpc16 -- SimpleJPC-16 by Adigun A. Polack +#@cli : +pal 141 = +pal acid15 -- Acid 15 by pyrometal +#@cli : +pal 142 = +pal battery24 -- Battery 24 by Battery Jellyfish +#@cli : +pal 143 = +pal clump18 -- Clumpy 18 by windfall.apples +#@cli : +pal 144 = +pal cthul -- Cthulhu by Starlane +#@cli : +pal 145 = +pal crimso11 -- Crimso 11 by Crimso +#@cli : +pal 146 = +pal coptec -- Copper-Tech by Arne Niklas Jansson +#@cli : +pal 147 = +pal drz15 -- DRZ15A by Drazille +#@cli : +pal 148 = +pal eggy15 -- Eggy 15 by Eggy +#@cli : +pal 149 = +pal europa -- Europa 16 by Starlane +#@cli : +pal 150 = +pal greyt -- GreyT-bit by Sam Keddy +#@cli : +pal 151 = +pal jewel -- Jewel by AprilSundae +#@cli : +pal 152 = +pal polar11 -- Polar 11 by Smalls +#@cli : +pal 153 = +pal sheltzy -- Sheltzy 32 by Please Check - NatTorpedia +#@cli : +pal 154 = +pal wyrm -- Wyrm 24 by FrogWyrm +#@cli : +pal 155 = +pal yume_nikki -- Yume Nikki by Space Sandwich +#@cli : +pal 156 = +pal rube_goldberg -- Rube-Goldberg +#@cli : +pal 157 = +pal boomboom -- BoomBoom by Salman_Shh +#@cli : +pal 158 = +pal g8 -- Generic-8 by GrafxKid +#@cli : +pal 159 = +pal crayola -- Crayola Blind +#@cli : +pal 160 = +pal matriax8c -- Matriax8c by Davit Masia +#@cli : +pal 161 = +pal nt1h -- NT1H by NatTorpedia +#@cli : +pal 162 = +pal jerrypie22 -- JerryPie 22 by JerryPie +#@cli : +pal 163 = +pal nineties_nine -- Nineties Nine by Cubby Crazes +#@cli : +pal 164 = +pal on70 -- On70 by By8Bits +#@cli : +pal 165 = +pal anb16 -- ANB16 by Anoob +#@cli : +pal 166 = +pal retrocal -- Retrocal-8 by polyphrog +#@cli : +pal 167 = +pal punolit -- Punolit by Punoli +#@cli : +pal 168 = +pal luap_40 -- Luap 40 by Luap +#@cli : +pal 169 = +pal autumvil6 -- Autum Villan 6 by Chase Stemel +#@cli : +pal 170 = +pal au15 -- Autum 15 by jok +#@cli : +pal 171 = +pal au15y -- Autum 15 [Yellow] by jok +#@cli : +pal 172 = +pal galaxy_flame -- Galaxy Flame by Rhoq +#@cli : +pal 173 = +pal antiquity16 -- Antiquity16 by ILTA +#@cli : +pal 174 = +pal mushroom -- Mushroom by Jimison3 +#@cli : +pal 175 = +pal aerugo -- Aerugo by Lizalot +#@cli : +pal 176 = +pal hotel_paintings -- Hotel Paintings 6 by Chase Stemel +#@cli : +pal 177 = +pal nopal -- Nopal-12 by BlackedIRL. +#@cli : +pal 178 = +pal gpy -- Brightness GPY by rickthepalette +#@cli : +pal 179 = +pal blessing -- Blessing by Maruki +#@cli : +pal 180 = +pal fairydust_8 -- Fairydust 8 by Yousurname +#@cli : +pal 181 = +pal fuzz4 -- Fuzzy Four by P-Tux7 +#@cli : +pal 182 = +pal fairy -- Fairy Tales by lollige +#@cli : +pal 183 = +pal naji16 -- Naji 16 by Naji +#@cli : +pal 184 = +pal easter -- Easter Island by skamocore +#@cli : +pal 185 = +pal pastel_and_darks58 -- Pastel and Darks 58 Palette by Glxss +#@cli : +pal 186 = +pal pastel17 -- 17 Pastels by Irenaart +#@cli : +pal 187 = +pal nostalgia15 -- NOSTALGIA15 by Arisuki +#@cli : +pal 188 = +pal ocaso -- Ocaso by Minord +#@cli : +pal 189 = +pal pastel -- Oh Hell, Pastel by StarlitSunset +#@cli : +pal 190 = +pal pollen8 -- Pollen-8 by Conker +#@cli : +pal 191 = +pal kule -- KULE-16 by Cuymacu +#@cli : +pal 192 = +pal hydrangea -- Hydrangea 11 by Dinchen's Art +#@cli : +pal 193 = +pal fluffy8 -- Fluffy8 by vee +#@cli : +pal 194 = +pal st8rb -- ST 8 R&B Remake by Skiller Thomson +#@cli : +pal 195 = +pal neon_space -- Neon Space by Jimison3 +#@cli : +pal 196 = +pal cyclope6 -- Cyclope6 by Royal_Naym +#@cli : +pal 197 = +pal sy17 -- Sy17 by xaiue +#@cli : +pal 198 = +pal syz15 -- Syz15 by Fusionnist +#@cli : +pal 199 = +pal tui15 -- TUI-15 by Jeremy +#@cli : +pal 200 = +pal cave -- Cave by PineTreePizza +#@cli : +pal 201 = +pal psygnosia -- Psygnosia by Arne Niklas Jansson +#@cli : +pal 202 = +pal marshmellow32 -- MarshMellow32 by FormalPrejudice +#@cli : +pal 203 = +pal lost_century -- Lost Century 24 by CalmRadish +#@cli : +pal 204 = +pal finlal11 -- Finlal 11 by Finlal +#@cli : +pal 205 = +pal industrial_factory -- TY - Industrial... by Toby_Yasha +#@cli : +pal 206 = +pal murder_mystery -- TY - Murder Mystery 16 by Toby_Yasha +#@cli : +pal 207 = +pal fatedestiny -- TY - Fate & Destiny 12 by Toby_Yasha +#@cli : +pal 208 = +pal vinik24 -- Vinik 24 by Vinik +#@cli : +pal 209 = +pal ykb22 -- YKB-22 by yahkehbu +#@cli : +pal 210 = +pal halloween -- Halloween by Mememellow +#@cli : +pal 211 = +pal graveyard -- Graveyard-21 by AprilSundae +#@cli : +pal 212 = +pal steamlords -- Steam Lords by Slynyrd +#@cli : +pal 213 = +pal frostical -- Frostical by yedamameday +#@cli : +pal 214 = +pal deuterospill -- DeuteroSpill by Royal_Naym +#@cli : +pal 215 = +pal cool_bone_7 -- Cool Bone 7 by Chase Stemel +#@cli : +pal 216 = +pal muted_ally_6 -- Muted Ally 6 by Chase Stemel +#@cli : +pal 217 = +pal ephemera -- EPHEMERA by K C +#@cli : +pal 218 = +pal ink -- Ink by AprilSundae +#@cli : +pal 219 = +pal violet_dreams -- Violet Dreams by Solitaire +#@cli : +pal 220 = +pal tinyfolks -- Tinyfolks by Pierr Vandermaesan +#@cli : +pal 221 = +pal old_gold_7 -- Old Gold 7 by Chase Stemel +#@cli : +pal 222 = +pal rosemoss -- Rosemoss-8 by polyphrog +#@cli : +pal 223 = +pal aaprad -- AAP-RadiantXV by Adigun A. Polack +#@cli : +pal 224 = +pal aapmaj -- AAP-Majesty XVII by Adigun A. Polack +#@cli : +pal 225 = +pal dead_weight_8 -- Dead Weight-8 by polyphrog +#@cli : +pal 226 = +pal mojave -- Mojave20 by magodellepercussioni +#@cli : +pal 227 = +pal pet8 -- Petite-8 by Adigun A. Polack +#@cli : +pal 228 = +pal pet8d -- Petite-8 Afterdark by Adigun A. Polack +#@cli : +pal 229 = +pal xaiue_rad -- XAIUE-Radiant by xaiue +#@cli : +pal 230 = +pal daruda -- Daruda 22 by daruda +#@cli : +pal 231 = +pal firestorm -- Firestorm by theartistjulian +#@cli : +pal 232 = +pal borkfest -- Borkfest by まるき +#@cli : +pal 233 = +pal spicy_07 -- Spicy 07 by green guy +#@cli : +pal 234 = +pal rust6 -- Rust-6 by Blue Phoenix +#@cli : +pal 235 = +pal apricot -- Apricot by Chase Stemel +#@cli : +pal 236 = +pal supernova7 -- SuperNova 7 by Blue Phoenix +#@cli : +pal 237 = +pal pastry -- Pastry by MirruTatep +#@cli : +pal 238 = +pal sandy_06 -- Sandy 06 by green guy +#@cli : +pal 239 = +pal illumination -- Illumination by MirruTatep +#@cli : +pal 240 = +pal nyx8 -- NYX8 by Javier Guerrero +#@cli : +pal 241 = +pal dreamhaze -- Dream Haze 8 by Klafooty +#@cli : +pal 242 = +pal oil6 -- OIL6 by GrafxKid +#@cli : +pal 243 = +pal regal -- Regal10 by JRiggles +#@cli : +pal 244 = +pal softdemon -- Soft Demon 7 by Chase Stemel +#@cli : +pal 245 = +pal sgm -- SGM-Palette 2 by s.g.m +#@cli : +pal 246 = +pal midnight_ablaze -- Midnight ablaze by Inkpendude +#@cli : +pal 247 = +pal black_cherry -- Black Cherry by MirruTatep +#@cli : +pal 248 = +pal sunset_red -- Sunset Red by Cabezinu +#@cli : +pal 249 = +pal inkpink -- INKPINK by Inkpendude +#@cli : +pal 250 = +pal brash_pink -- Brash Pink by ItzFred +#@cli : +pal 251 = +pal pink_neon_sign_6 -- Pink Neon Sign 6 by Chase Stemel +#@cli : +pal 252 = +pal enchanted_purple -- Enchanted Purple by Kaiburn +#@cli : +pal 253 = +pal arch -- Arch by Poltergasm +#@cli : +pal 254 = +pal spaceyeaster -- Spacey Easter by Spark Norris +#@cli : +pal 255 = +pal fornaxvoid1 -- Fornax Void I by Fornax Void +#@cli : +pal 256 = +pal fornaxvoid2 -- Fornax Void II by Fornax Void +#@cli : +pal 257 = +pal pixelwave -- Pixelwave by Reptorian +#@cli : +pal 258 = +pal s1_6 -- S1-6 by Blyzz +#@cli : +pal 259 = +pal berry_nebula -- Berry Nebula by LostInIndigo +#@cli : +pal 260 = +pal abyss9 -- ABYSS-9 by Jusiv +#@cli : +pal 261 = +pal moonlight -- Moonlight 15 by Tofu +#@cli : +pal 262 = +pal moon39 -- Moonlit-39 by theartistjulian +#@cli : +pal 263 = +pal h2o -- H2O by maine +#@cli : +pal 264 = +pal magic_waters_9 -- Magic Waters 9 by Chase Stemel +#@cli : +pal 265 = +pal bluemold -- Bluem0ld by warpixel +#@cli : +pal 266 = +pal moss -- Moss by Zetomis +#@cli : +pal 267 = +pal deep_maze -- DEEP MAZE by Ryosuke +#@cli : +pal 268 = +pal toxic_slime -- Toxic Slime by MirruTatep +#@cli : +pal 269 = +pal lush_green -- Lush Green by EerieJam +#@cli : +pal 270 = +pal tsunami -- Tsunami by MirruTatep +#@cli : +pal 271 = +pal cryptic_ocean -- Cryptic Ocean by Klafooty +#@cli : +pal 272 = +pal marsh_madness -- Marsh Madness by MirruTatep +#@cli : +pal 273 = +pal oxyd -- OXYD by ItzFred +#@cli : +pal 274 = +pal pinkgreen -- Pink&Green by q1 +#@cli : +pal 275 = +pal walking_in_the_woods -- Walking ... 8 by Chase Stemel +#@cli : +pal 276 = +pal paper_8 -- Paper 8 by Frosty Rabbid +#@cli : +pal 277 = +pal sahara_pastell -- Sahara Pastell by wermz +#@cli : +pal 278 = +pal sunflower_painting_7 -- Sunflower ... by Chase Stemel +#@cli : +pal 279 = +pal arthoe7 -- Art Hoe Aesthetic 7 by Chase Stemel +#@cli : +pal 280 = +pal sky5 -- Sky5 by MiniTe +#@cli : +pal 281 = +pal ocean_glass -- Ocean Glass by Solitaire +#@cli : +pal 282 = +pal royalguard -- RoyalGuard by Royal_Naym +#@cli : +pal 283 = +pal eulbink -- Eulbink by Inkpendude +#@cli : +pal 284 = +pal winter_wonderland -- Winter Wonderland by Jimison3 +#@cli : +pal 285 = +pal moon_squid -- Moon Squid 7 by Chase Stemel +#@cli : +pal 286 = +pal stratus -- Stratus by MirruTatep +#@cli : +pal 287 = +pal arctic_dust -- Arctic Dust by MirruTatep +#@cli : +pal 288 = +pal clouds_sunset -- CL8UDS by _Nicola +#@cli : +pal 289 = +pal lilac_skies -- Lilac Skies 5 by Chase Stemel +#@cli : +pal 290 = +pal sea_of_fire -- Sea of Fire by TATA-PIXEL +#@cli : +pal 291 = +pal autochrome3 -- Autochrome 3 by Reptorian +#@cli : +pal 292 = +pal autochrome5 -- Autochrome 5 by Reptorian +#@cli : +pal 293 = +pal gb_d_1 -- GB Default 1 +#@cli : +pal 294 = +pal gb_d_2 -- GB Default 2 +#@cli : +pal 295 = +pal gb_andrade -- GB Andrade by Andrade +#@cli : +pal 296 = +pal gb_blue -- GB Blue Seni by WildLeoKnight +#@cli : +pal 297 = +pal gb_bz -- GB Blackzone +#@cli : +pal 298 = +pal gb_suburb -- GB Suburb by Poppysalmon +#@cli : +pal 299 = +pal gb_crimson -- GB Crimson by WildLeoKnight +#@cli : +pal 300 = +pal gb_didi -- GB Didi by DidiGameboy +#@cli : +pal 301 = +pal gb_dirty -- GB Dirty by WildLeoKnight +#@cli : +pal 302 = +pal gb_arne -- GB Arne by Arne +#@cli : +pal 303 = +pal gb_easy -- GB Easy by GrafxKid +#@cli : +pal 304 = +pal gb_forest -- GB Forest +#@cli : +pal 305 = +pal gb_hg -- GB Harsh Green by WildLeoKnight +#@cli : +pal 306 = +pal gb_lg -- GB Light Green by WildLeoKnight +#@cli : +pal 307 = +pal gb_nostalgia -- GB Nostalgia by WildLeoKnight +#@cli : +pal 308 = +pal gb_platinum -- GB Platinum by WildLeoKnight +#@cli : +pal 309 = +pal gb_kirokaze -- GB Kirokaze by Kirokaze +#@cli : +pal 310 = +pal gb_cyber -- GB Cyber +#@cli : +pal 311 = +pal gb_wish -- GB Wish by Kerrie Lake +#@cli : +pal 312 = +pal gb_grapefruit -- GB Grapefruit by GrafxKid +#@cli : +pal 313 = +pal gb_ice_cream -- GB Ice Cream by Kerrie Lake +#@cli : +pal 314 = +pal gb_rb -- GB Red_Blue +#@cli : +pal 315 = +pal gb_gold -- Gold GB by Isa +#@cli : +pal 316 = +pal gb_choco -- GB Chocolate by GrafxKid +#@cli : +pal 317 = +pal gb_gray -- GB Gray by GrafxKid +#@cli : +pal 318 = +pal gb_space -- GB Spacehaze by WildLeoKnight +#@cli : +pal 319 = +pal gb_purpdawn -- GB Purple Dawn by WildLeoKnight +#@cli : +pal 320 = +pal moon_crystal -- Moon Crystal by Doph +#@cli : +pal 321 = +pal arne4 -- ARNE4 by Arne +#@cli : +pal 322 = +pal autumn_chill -- Autumn Chill by Doph +#@cli : +pal 323 = +pal cherrymelon -- CherryMelon by WildLeoKnight +#@cli : +pal 324 = +pal hal4 -- HallowPumpkin by WildLeoKnight +#@cli : +pal 325 = +pal hollow -- Hollow by Poltergasm +#@cli : +pal 326 = +pal lavender4 -- Lavender4 by Solitaire +#@cli : +pal 327 = +pal maw -- MAW by bloo +#@cli : +pal 328 = +pal voltage_warning -- Voltage Warning by Wuchta +#@cli : +pal 329 = +pal tritanopia -- Tritanopia by Allappini +#@cli : +pal 330 = +pal rabbit7 -- Rabbit 7 by GrafxKid +#@cli : +pal 331 = +pal amiga2600ntsc -- Amiga 2600 NTSC +#@cli : +pal 332 = +pal amiga2600pal -- Amiga 2600 PAL +#@cli : +pal 333 = +pal amiga2600secam -- Amiga 2600 SECAM +#@cli : +pal 334 = +pal amiga7800mess -- Amiga 7800 M.E.S.S by Nabuko78 +#@cli : +pal 335 = +pal amiga7800 -- Amiga 7800 +#@cli : +pal 336 = +pal amstrad_cpc -- Amstrad CPC +#@cli : +pal 337 = +pal apple2 -- Apple II +#@cli : +pal 338 = +pal atari8bit -- Atari 8-Bit Series - GTIA by PixelCrunch +#@cli : +pal 339 = +pal cga -- CGA +#@cli : +pal 340 = +pal cga00 -- CGA Mode 0 [Low] +#@cli : +pal 341 = +pal cga01 -- CGA Mode 0 [High] +#@cli : +pal 342 = +pal cga10 -- CGA Mode 1 [Low] +#@cli : +pal 343 = +pal cga11 -- CGA Mode 1 [High] +#@cli : +pal 344 = +pal cga20 -- CGA Mode 2 [Low] +#@cli : +pal 345 = +pal cga21 -- CGA Mode 2 [High] +#@cli : +pal 346 = +pal c64_pepto -- C64[Pepto] - pepto.de/projects/colorvic/2001/ +#@cli : +pal 347 = +pal c64_colodore -- C64[Colodore] - https://www.pepto.de/projects/colorvic/ +#@cli : +pal 348 = +pal com_vic_20 -- Commodore VIC-20 +#@cli : +pal 349 = +pal colecovision -- Colecovision +#@cli : +pal 350 = +pal jmp -- Japanese Machine Palette by Arne Niklas Jansson +#@cli : +pal 351 = +pal mac2 -- Macintosh II +#@cli : +pal 352 = +pal mac8 -- Macintosh 8-Bit System Palette +#@cli : +pal 353 = +pal msx -- MSX +#@cli : +pal 354 = +pal nes -- NES +#@cli : +pal 355 = +pal pico_8 -- PICO-8 by Lexaloffle Games +#@cli : +pal 356 = +pal risc -- RISC OS +#@cli : +pal 357 = +pal samcoupe -- SAM Coupe +#@cli : +pal 358 = +pal mo5 -- Thomson MO5 +#@cli : +pal 359 = +pal trs80 -- TRS-80 Color Computer Palette +#@cli : +pal 360 = +pal virtualboy -- Virtual Boy interpreted by Bruno Weinberger +#@cli : +pal 361 = +pal vga -- VGA +#@cli : +pal 362 = +pal win95 -- Win 95-256 +#@cli : +pal 363 = +pal zx -- ZX Spectrum +#@cli : +pal 364 = +pal gnome32 -- GNOME 32 +#@cli : +pal 365 = +pal elc22 -- Electronic Crayon 22 +#@cli : +pal 366 = +pal chip16 -- Chip16 +#@cli : +pal 367 = +pal deluxepaint -- Deluxe Paint +#@cli : +pal 368 = +pal flat_ui -- FlatUI from flat ui colors website +#@cli : +pal 369 = +pal makecode_arcade -- MakeCode Arcade Palette +#@cli : +pal 370 = +pal oekaki -- Oekaki from Oekaki.nl +#@cli : +pal 371 = +pal lms -- Legacy Paint +#@cli : +pal 372 = +pal msxp -- XP Paint +#@cli : +pal 373 = +pal vis -- Vista Paint +#@cli : +pal 374 = +pal humanfaces -- Human Faces by Romney57 +#@cli : +pal 375 = +pal madjikhsv -- HSV Palette by MadJik +#@cli : +pal 376 = +pal st24_christmas -- ST24 Christmas by Skiller Thomson +#@cli : +pal 377 = +pal ladybugreds -- Reds by Ladybug +#@cli : +pal 378 = +pal pastel_rainbow -- Pastel Rainbow by Jayden Bowman +#@cli : +#@cli : Author: Reptorian. ++pal: +v - _gmic_s=$? v + +_$0 $* ++_pal: +$=var +repeat $# { +mode=${var{$>+1}} +if isnum($mode) +if isint($mode) +mode=${arg\ 1+$mode,bw,rgb,b_rgb,bw_rgb,cmy,cmyk,wcmyk,rgbcmy,1bitrgb,aurora,zenit_241,gbg,duel,hocuspocus,playpal,srb2,uzebox,kens16,kens32,kens54,aap12,aap16,aap64,aap96,aap128,aap_dga16,cheerful32,db8,db16,db32,db_iso22,dimwid17,dimwid23,edg4,edg8,edg16,edg32,edg36,edg64,famicube,juicy32,juicy56,xaiue,15pdx,20pdx,24pdx,cabana64,fant16,fant24,tf23,tfp39,faraway48,fleja_m,koni32,linearbasic,lego,lego2021,vinelinear,arcade29,arq16,atom8,blk36,blkneo,brokefac,bubblegum,cpcboy,cade15,calder8,cdbac,cgarne,dino,4l,fzteth16,indc,island16,journey,shallowmarsh26,lago_nenufar,juicy,chocolateganache,brightwinter1,brightwinter2,kawaii,xdb_01,gzxp,chrom16,piet,boltbait_matrix,material_design,thehamster_rainbow,boltbait_rainbow,scrj36,pxls_default,moderna,oak,nature55,rbypgo,new_worlds,nauris16,dynamite,interstate_28,downgraded_32,pear36,pineapple32,peach,resurrect,rosy42,slso,softy15,spec12,roarin80s,starmancer,superfuture,sunshine_35,sweetie16,calm48,optimism,taffy16,todayland,trirampo,reddit_place_2022,tropical_cone_24,vivid17,shido76,intacto,itatsi,enos16,grixel_grotto,sup8,undertones,tango,cheese,equpix15,zu32,voodo,franzston_30,night16,star29,star34,stilllife,simjpc16,acid15,battery24,clump18,cthul,crimso11,coptec,drz15,eggy15,europa,greyt,jewel,polar11,sheltzy,wyrm,yume_nikki,rube_goldberg,boomboom,g8,crayola,matriax8c,nt1h,jerrypie22,nineties_nine,on70,anb16,retrocal,punolit,luap_40,autumvil6,au15,au15y,galaxy_flame,antiquity16,mushroom,aerugo,hotel_paintings,nopal,gpy,blessing,fairydust_8,fuzz4,fairy,naji16,easter,pastel_and_darks58,pastel17,nostalgia15,ocaso,pastel,pollen8,kule,hydrangea,fluffy8,st8rb,neon_space,cyclope6,sy17,syz15,tui15,cave,psygnosia,marshmellow32,lost_century,finlal11,industrial_factory,murder_mystery,fatedestiny,vinik24,ykb22,halloween,graveyard,steamlords,frostical,deuterospill,cool_bone_7,muted_ally_6,ephemera,ink,violet_dreams,tinyfolks,old_gold_7,rosemoss,aaprad,aapmaj,dead_weight_8,mojave,pet8,pet8d,xaiue_rad,daruda,firestorm,borkfest,spicy_07,rust6,apricot,supernova7,pastry,sandy_06,illumination,nyx8,dreamhaze,oil6,regal,softdemon,sgm,midnight_ablaze,black_cherry,sunset_red,inkpink,brash_pink,pink_neon_sign_6,enchanted_purple,arch,spaceyeaster,fornaxvoid1,fornaxvoid2,pixelwave,s1_6,berry_nebula,abyss9,moonlight,moon39,h2o,magic_waters_9,bluemold,moss,deep_maze,toxic_slime,lush_green,tsunami,cryptic_ocean,marsh_madness,oxyd,pinkgreen,walking_in_the_woods,paper_8,sahara_pastell,sunflower_painting_7,arthoe7,sky5,ocean_glass,royalguard,eulbink,winter_wonderland,moon_squid,stratus,arctic_dust,clouds_sunset,lilac_skies,sea_of_fire,autochrome3,autochrome5,gb_d_1,gb_d_2,gb_andrade,gb_blue,gb_bz,gb_suburb,gb_crimson,gb_didi,gb_dirty,gb_arne,gb_easy,gb_forest,gb_hg,gb_lg,gb_nostalgia,gb_platinum,gb_kirokaze,gb_cyber,gb_wish,gb_grapefruit,gb_ice_cream,gb_rb,gb_gold,gb_choco,gb_gray,gb_space,gb_purpdawn,moon_crystal,arne4,autumn_chill,cherrymelon,hal4,hollow,lavender4,maw,voltage_warning,tritanopia,rabbit7,amiga2600ntsc,amiga2600pal,amiga2600secam,amiga7800mess,amiga7800,amstrad_cpc,apple2,atari8bit,cga,cga00,cga01,cga10,cga11,cga20,cga21,c64_pepto,c64_colodore,com_vic_20,colecovision,jmp,mac2,mac8,msx,nes,pico_8,risc,samcoupe,mo5,trs80,virtualboy,vga,win95,zx,gnome32,elc22,chip16,deluxepaint,flat_ui,makecode_arcade,oekaki,lms,msxp,vis,humanfaces,madjikhsv,st24_christmas,ladybugreds,pastel_rainbow} +fi +fi +pal_$mode=1 +if $pal_bw (0,255^0,255^0,255) => "Black & White" +elif $pal_rgb (255,0,0^0,255,0^0,0,255) => "Red-Green-Blue" +elif $pal_b_rgb (0,255,0,0^0,0,255,0^0,0,0,255) => "Black with Red-Green-Blue" +elif $pal_bw_rgb (0,255,255,0,0^0,255,0,255,0^0,255,0,0,255) => "Black & White with Red-Green-Blue" +elif $pal_cmy (0,255,255^255,0,255^255,255,0) => "Cyan-Magenta-Yellow" +elif $pal_cmyk (0,255,255,0^255,0,255,0^255,255,0,0) => "Cyan-Magenta-Yellow-Black" +elif $pal_wcmyk (255,0,255,255,0^255,255,0,255,0^255,255,255,0,0) => "White-Cyan-Magenta-Yellow-Black" +elif $pal_rgbcmy (255,0,0,0,255,255^0,255,0,255,0,255^0,0,255,255,255,0) => "Red-Green-Blue with Cyan-Magenta-Yellow" +elif $pal_1bitrgb (255,0,255,0,0,0,255,255^255,0,0,255,0,255,0,255^255,0,0,0,255,255,255,0) => "1-Bit RGB" +elif $pal_aurora (0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,0,63,0,191,129,0,63,0,15,127,191,245,253,255,255,255,191,127,85,127,191,255,255,255,255,191,127,0,63,0,175,0,0,75,188,203,166,126,110,126,160,192,208,225,235,245,246,245,127,87,115,142,171,199,227,248,227,196,143,115,59,65,115,143,162,181,199,218,237,199,171,142,115,88,70,25,35,59,80,59,87,115,100,143,162,225,180,171,135,80,15,30,35,59,100,143,171,199,190,171,168,143,87,87,59,15,31,59,73,87,115,118,143,171,208,227,171,143,115,87,60,70,114,143,171,171,235,255,227,225,215,199,200,195,75,50,40,64,98,165,218,213,255,245,255,246,255,215,218,180,160,95,83,98,140,172,177,230,255,255,200,155,150,115,106,60,40,32,12,20,10,20,125,75,0,5,28,18,18,6,0,45,60,106,145,85,125,8,16,5,22,15,0,50,0,24,35,105,74,144,90,190,120,74,98,60,16,0,35,12,80,96,135,156,189,185,215,215,248,230,255,218,189,189,140,90,100,65,50,85,160,200,255,255,250,252,230,189,152,145^0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,127,191,255,255,129,0,63,0,15,0,63,0,129,192,129,0,63,0,20,63,127,127,191,255,255,191,127,127,191,255,255,191,127,125,175,170,160,148,130,110,105,120,138,155,170,185,200,225,0,59,65,85,115,143,171,210,199,158,115,87,45,65,115,143,162,181,199,218,237,227,199,190,143,125,80,30,80,87,100,115,143,171,192,199,216,248,238,227,180,125,105,45,65,115,171,199,227,241,210,199,185,171,143,115,87,25,31,59,73,87,110,118,143,171,218,227,143,87,87,59,35,50,64,87,87,115,172,220,199,185,160,143,125,90,40,22,10,24,24,20,32,82,60,90,98,189,165,155,110,90,75,50,80,98,128,148,177,213,213,234,255,240,220,200,168,110,52,70,92,150,215,230,255,240,197,180,140,56,152,196,222,235,254,255,235,230,215,222,156,90,44,55,74,100,82,106,120,157,164,176,197,185,110,90,65,60,28,16,16,33,16,16,50,65,98,145,165,195,198,115,82,32,41,16,20,24,20,0,10,25,25,0,80,106,160,58,30,16,52,20^0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,127,191,255,255,255,255,191,127,80,127,191,245,255,203,129,0,63,0,20,0,63,0,129,191,0,63,0,0,63,0,175,255,255,200,192,137,144,148,135,96,95,114,116,125,140,155,175,210,255,59,60,85,115,143,171,218,171,115,87,59,31,35,59,87,85,114,143,171,199,171,143,85,87,62,50,15,55,59,80,73,87,115,130,143,162,250,202,197,142,95,70,35,70,115,171,199,227,241,240,227,220,199,199,143,115,45,59,87,115,143,170,202,199,227,248,255,199,199,143,115,60,70,114,143,171,171,225,245,227,210,190,185,160,145,55,35,30,17,0,10,16,74,10,50,98,49,60,15,10,0,5,20,10,0,90,0,10,90,16,74,65,70,25,5,5,20,5,8,12,5,10,10,115,90,20,80,78,50,128,145,106,168,165,205,255,255,240,213,222,92,82,125,156,150,246,189,220,195,255,255,255,250,240,255,246,245,218,189,148,72,176,208,210,255,255,255,255,250,252,255,255,224,255,197,190,123,100,98,70,55,130,120,191,197,185,140,120,57,77,55) => "Aurora by GrafxKid" +elif $pal_zenit_241 (18,49,80,114,154,194,226,201,168,132,95,66,37,66,99,130,176,209,238,224,202,159,118,86,54,84,125,169,202,225,248,234,194,147,111,79,46,84,126,181,219,245,251,255,242,197,138,87,51,87,138,189,255,255,240,242,240,204,150,101,58,101,149,196,226,255,255,227,181,142,109,74,43,72,100,135,174,209,240,225,204,171,143,102,61,97,140,181,225,255,255,225,185,153,123,90,61,106,150,193,233,249,250,232,206,170,130,89,53,78,105,134,170,207,225,194,155,123,94,67,46,69,107,143,179,210,235,196,145,104,73,45,23,39,59,86,124,166,210,161,85,46,27,15,10,17,24,37,50,117,190,135,98,63,47,27,13,17,23,33,45,98,182,101,18,22,19,9,7,32,48,74,106,140,186,130,81,39,36,23,16,32,53,73,106,147,199,161,112,79,60,40,25,38,60,88,118,166,217,171,132,92,63,42,24,56,89,124,165,205,228,191,158,120,88,62,35,54,80,109,147,189,225,182,134,98,65,41,19,39,57,87,120,166,204,167,130,92,64,37,18^14,43,67,99,135,177,211,173,125,85,58,38,20,31,50,75,107,148,194,155,115,83,61,33,16,35,53,78,113,151,188,140,93,55,39,22,9,19,31,38,74,120,172,125,72,37,15,15,11,27,36,47,99,153,197,151,98,47,32,20,12,14,31,50,89,141,191,144,105,75,50,31,18,40,66,97,134,171,211,177,127,87,54,40,27,37,62,92,136,187,228,194,149,115,81,55,31,43,66,102,149,199,239,189,146,105,73,47,33,56,85,113,150,192,224,193,150,116,86,60,39,58,88,126,167,217,255,224,184,148,115,74,43,66,99,128,166,207,244,230,214,171,125,77,43,69,107,148,201,255,255,199,161,117,84,54,31,55,92,138,191,249,254,241,209,147,94,57,27,62,95,132,176,219,243,220,176,132,86,50,22,46,75,105,150,198,235,203,148,98,60,37,15,35,59,91,126,162,202,153,114,79,56,34,14,27,40,53,91,136,183,149,116,87,64,44,23,47,71,103,139,181,222,184,141,103,71,47,22,47,70,104,141,185,225,194,156,119,87,58,31^20,48,71,97,126,169,207,163,123,94,73,57,39,63,87,108,135,156,191,152,123,102,78,55,49,74,100,128,159,198,237,245,212,184,138,97,49,89,137,177,208,211,205,193,170,137,98,74,47,68,87,104,133,153,179,128,96,65,55,43,27,24,28,38,65,112,153,111,91,66,50,30,16,26,47,65,89,120,153,106,63,44,34,28,20,20,25,33,47,85,136,102,74,51,34,20,12,9,10,11,7,47,107,62,45,40,30,21,19,35,52,72,96,120,164,135,98,72,55,37,20,17,26,33,46,87,142,83,46,37,31,24,16,32,50,66,93,120,164,115,41,39,27,31,28,51,71,81,98,136,174,135,111,82,67,48,36,61,91,115,148,185,220,214,200,160,113,79,37,70,105,138,173,203,234,227,213,182,153,111,51,64,89,117,158,202,243,255,255,189,153,92,41,66,102,138,184,219,255,207,173,125,94,71,41,88,138,189,232,242,238,179,152,128,102,75,45,60,88,120,158,200,231,199,155,115,82,56,28,48,70,99,130,170,187,150,114,89,65,45,23) => "Zenit-241 by Zenit40" +elif $pal_gbg (0,48,72,108,144,181,217,237,255,255,255,255,255,204,128,77,128,216,254,255,254,254,204,128,77,127,217,255,255,255,254,204,127,77,128,190,246,230,214,170,143,84,61,137,196,204,153,102,0,0,0,31,88,134,230,179,134,0,5,0,31,107,152,230,205,133,0,5,1,55,91,152,230,180,132,14,0,0,32,64,152,233,208,161,20,38,7,59,101,178,244,220,199,136,82,42,91,132,187,254,251,249,242,194,122,75,125,214,255,255,255,255,204,128,77,127,216^0,48,72,108,144,181,217,237,255,230,179,133,0,2,0,32,64,87,241,211,184,106,84,52,50,92,179,253,250,246,238,189,119,75,125,187,255,255,255,255,217,128,77,153,217,255,255,255,217,154,89,51,129,190,255,255,255,254,204,128,77,153,217,251,247,234,213,170,106,71,122,205,242,214,190,128,95,60,52,94,182,229,204,153,0,31,0,58,98,174,229,180,133,1,0,0,81,109,151,230,179,133,0,0,1,30,64,152,230,179,132,1,1,0,32,83,153^0,48,72,108,144,181,217,237,255,229,179,133,0,18,0,31,64,87,230,179,133,0,0,0,31,64,152,230,179,133,0,3,0,50,90,134,230,179,133,3,0,0,31,108,152,210,170,127,36,25,13,35,96,144,250,240,231,207,163,102,67,144,204,255,255,255,255,204,128,77,128,217,255,255,255,255,204,127,77,128,217,255,255,255,255,180,78,78,130,217,255,255,255,255,153,77,103,153,217,255,255,255,255,204,127,77,128,217,245,223,204,149,119,75,58,109,190) => "Game Builder Garage: Texture-Sprite Editor Palette" +elif $pal_duel (0,34,67,98,130,166,205,245,98,133,158,174,187,204,234,255,88,115,136,154,173,213,251,255,0,0,0,11,0,50,36,136,102,148,182,205,227,249,255,255,40,58,97,122,134,150,199,198,0,0,23,34,47,81,125,166,24,35,37,54,49,65,82,116,26,47,56,50,65,73,85,145,94,130,182,228,255,255,255,255,45,72,91,115,132,171,186,235,59,90,138,174,199,216,236,255,49,74,94,114,126,158,192,221,46,73,102,151,185,193,219,248,0,0,0,0,0,0,0,0,69,97,126,153,178,204,232,251,95,110,144,167,189,206,237,237,50,74,100,120,142,156,184,220,67,113,159,217,248,255,255,255,73,99,124,152,172,193,210,229,32,47,73,97,124,150,180,208,98,117,133,158,186,209,232,255,38,59,86,117,145,179,207,254,29,46,57,76,88,107,120,127,55,83,120,148,169,191,215,244,45,71,91,113,135,138,169,224,0,3,7,16,20,64,85,109,85,118,151,185,213,235,255,253,29,60,88,121,149,169,186,209,38,40,45,61,81,82,108,131,73,94,119,145,173,181,212,255,114,156,191,233,255,255,255,247^0,35,69,104,139,174,210,247,93,117,140,161,175,195,219,243,49,61,80,98,110,141,170,206,39,56,77,102,111,140,174,214,43,54,77,94,120,155,188,233,43,69,95,119,144,178,214,236,34,50,74,89,105,136,164,204,31,50,70,107,142,178,210,245,51,63,81,92,116,137,182,218,7,33,60,92,118,155,187,219,49,71,92,115,135,174,199,240,48,60,82,107,130,159,197,250,34,53,70,90,108,138,165,191,16,40,54,84,109,120,153,198,46,64,81,107,130,160,191,222,49,74,97,121,144,169,203,234,9,36,70,96,125,151,182,212,53,82,101,119,140,155,174,212,23,43,59,74,93,125,166,205,37,52,75,89,111,126,141,154,41,79,93,115,131,154,170,204,42,59,79,101,136,170,210,246,35,56,80,104,122,151,175,223,44,61,77,95,113,132,158,189,36,57,76,93,109,126,147,163,75,101,123,149,174,193,209,250,27,49,72,93,118,151,177,204,71,93,116,140,163,189,213,247,29,49,74,100,133,150,171,189,36,51,61,80,101,116,130,147,33,65,83,96,121,139,174,226,28,51,90,134,177,207,240,244^0,35,73,113,152,186,218,250,84,101,121,137,164,177,201,214,38,59,65,76,81,107,132,127,53,80,94,127,137,167,214,255,41,58,70,70,64,78,78,73,74,104,132,153,178,217,255,255,25,33,27,24,12,34,45,52,47,77,107,138,184,227,255,253,44,56,64,64,85,96,125,161,17,29,53,95,118,168,199,255,54,77,105,127,149,190,219,246,60,69,88,96,108,117,129,171,42,60,70,81,84,110,136,154,38,61,89,117,145,170,191,218,73,81,98,109,121,135,163,218,37,60,68,81,98,110,130,163,38,52,71,87,100,112,124,147,88,128,157,193,226,239,255,255,41,59,82,105,128,175,197,255,28,50,71,90,110,122,122,124,0,8,0,8,30,38,51,50,0,9,18,32,46,57,75,79,61,85,111,110,123,131,142,177,67,71,60,51,44,45,36,57,35,58,73,79,88,99,116,128,71,90,105,125,142,150,193,235,64,95,124,162,192,234,241,255,105,115,136,147,154,157,155,134,33,81,127,186,241,236,247,254,80,93,114,131,174,197,196,195,41,74,91,106,132,148,170,207,3,39,62,39,8,5,43,191) => "Duel by Arilyn" +elif $pal_hocuspocus (6,25,233,206,181,158,132,120,210,187,164,141,118,94,72,54,75,67,58,50,41,33,24,29,130,114,101,86,73,57,45,34,162,149,133,120,104,91,75,71,162,146,130,114,98,82,66,55,202,179,158,138,114,94,73,62,141,123,109,94,79,65,50,37,232,209,186,164,142,119,97,76,21,18,15,13,10,7,5,2,56,41,31,21,14,8,3,22,249,214,182,151,119,88,56,28,237,195,157,122,91,63,36,37,250,222,194,170,142,118,90,68,228,203,181,156,133,108,86,80,228,203,178,155,130,108,82,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,20,19,18,17,16,15,14,13,12,11,10,10,9,8,7,229,215,204,193,182,171,160,151,163,150,137,128,118,106,96,88,0,0,0,0,0,0,0,21,250,226,202,178,154,130,106,87,21,21,21,21,21,21,21,41,250,222,198,174,150,126,102,80,231,232,233,235,236,238,239,241,240,216,195,175,154,134,113,95,1,13,30,49,65,81,98,117,133,149,166,185,201,217,234,252^0,20,227,187,143,102,59,37,121,106,93,81,65,53,40,29,9,8,7,6,6,5,4,16,149,133,117,102,86,70,55,40,111,98,86,78,69,57,48,47,127,115,103,91,78,66,54,43,151,134,118,102,86,71,55,49,136,121,104,90,74,57,44,32,152,132,115,98,82,69,53,56,199,187,157,129,104,76,48,27,179,150,121,96,75,55,35,42,241,196,152,115,83,55,28,11,216,176,140,107,78,53,28,31,244,187,137,95,61,34,11,3,0,0,0,0,0,0,0,16,192,163,137,112,90,71,50,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,20,19,18,17,16,15,14,13,12,11,10,10,9,8,7,229,215,204,193,182,171,160,149,142,131,120,113,105,95,87,81,21,19,17,14,12,10,8,7,21,19,17,15,13,11,9,7,246,220,196,169,146,119,96,88,228,203,181,159,137,115,93,73,193,179,166,153,143,130,117,100,11,13,14,16,17,18,20,21,1,13,30,49,65,81,98,117,133,149,166,185,201,217,234,252^19,29,150,108,70,40,17,15,126,110,98,82,69,53,41,29,212,189,166,144,121,98,76,68,168,148,132,112,96,76,60,46,112,99,87,79,69,57,48,53,184,164,148,131,111,95,78,63,163,144,128,112,92,76,57,55,188,167,148,127,108,86,68,51,140,121,105,92,76,63,50,37,20,17,13,10,7,5,3,1,250,229,208,187,166,145,124,115,220,180,140,107,78,53,28,11,228,195,166,137,107,78,49,20,0,0,0,0,0,0,0,0,2,21,21,20,20,20,19,19,19,18,18,18,17,17,17,16,35,246,242,234,230,226,222,218,214,210,206,202,198,194,190,186,182,178,173,166,162,158,154,150,146,142,138,134,130,126,122,118,131,126,119,115,111,107,103,99,95,91,87,83,79,75,71,67,251,242,236,231,225,220,214,208,197,190,186,183,179,175,172,168,229,207,185,163,145,123,101,79,21,19,17,15,13,11,9,7,0,0,0,0,0,0,0,21,250,222,198,174,150,126,102,80,0,1,3,4,6,7,8,30,240,216,195,175,154,134,113,95,1,13,30,49,65,81,98,117,133,149,166,185,201,217,234,252) => "Hocus Pocus Palette by Apogee Software,Ltd." +elif $pal_playpal (0,31,23,75,255,27,19,11,7,47,35,23,15,79,71,63,255,247,243,235,231,223,219,211,203,199,191,187,179,175,167,163,155,151,143,139,131,127,119,115,107,103,95,91,83,79,71,67,255,255,255,255,255,255,255,255,255,247,239,231,223,215,207,203,191,179,171,163,155,143,135,127,119,107,95,83,75,63,51,43,239,231,223,219,211,203,199,191,183,179,171,167,159,151,147,139,131,127,119,111,107,99,91,87,79,71,67,59,55,47,39,35,119,111,103,95,91,83,75,67,63,55,47,39,31,23,19,11,191,183,175,167,159,155,147,139,131,123,119,111,103,95,87,83,159,143,131,119,103,91,79,67,123,111,103,91,83,71,63,55,255,235,215,195,175,155,135,115,255,255,255,255,255,255,255,255,239,227,215,203,191,179,167,155,139,127,115,103,91,231,199,171,143,115,83,55,27,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,243,235,223,215,203,195,183,175,255,255,255,255,255,255,255,167,159,147,135,79,67,55,47,0,0,0,0,0,0,255,255,255,255,207,159,111,167^0,23,15,75,255,27,19,11,7,55,43,31,23,59,51,43,183,171,163,151,143,135,123,115,107,99,91,87,79,71,63,59,51,47,43,35,31,27,23,19,15,11,7,7,7,0,0,0,235,227,219,211,207,199,191,187,179,171,163,155,147,139,131,127,123,115,111,107,99,95,87,83,79,71,67,63,55,47,43,35,239,231,223,219,211,203,199,191,183,179,171,167,159,151,147,139,131,127,119,111,107,99,91,87,79,71,67,59,55,47,39,35,255,239,223,207,191,175,159,147,131,115,99,83,67,51,35,23,167,159,151,143,135,127,123,115,107,99,95,87,83,75,67,63,131,119,107,95,83,71,59,51,127,115,107,99,87,79,71,63,255,219,187,155,123,91,67,43,219,187,155,123,95,63,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,231,199,171,143,115,83,55,27,0,0,0,0,0,0,0,0,235,215,199,179,163,143,127,115,111,103,95,87,79,71,67,255,255,255,255,255,255,255,63,55,47,35,59,47,35,27,0,0,0,0,0,0,159,231,123,0,0,0,0,107^0,11,7,75,255,27,19,11,7,31,15,7,0,43,35,27,183,171,163,151,143,135,123,115,107,99,91,87,79,71,63,59,51,47,43,35,31,27,23,19,15,11,7,7,7,0,0,0,223,211,199,187,179,167,155,147,131,123,115,107,99,91,83,79,75,71,67,63,59,55,51,47,43,39,35,31,27,23,19,15,239,231,223,219,211,203,199,191,183,179,171,167,159,151,147,139,131,127,119,111,107,99,91,87,79,71,67,59,55,47,39,35,111,103,95,87,79,71,63,55,47,43,35,27,23,15,11,7,143,135,127,119,111,107,99,91,87,79,75,67,63,55,51,47,99,83,75,63,51,43,35,27,99,87,79,71,59,51,43,39,115,87,67,47,31,19,7,0,219,187,155,123,95,63,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,227,203,179,155,131,107,83,219,187,155,123,91,59,27,23,15,15,11,7,0,0,0,215,179,143,107,71,35,0,0,0,0,0,39,27,19,11,71,59,47,35,23,11,67,75,255,255,207,155,107,107) => "PLAYPAL by id Tech 1 | DOOM Engine" +elif $pal_srb2 (255,247,239,231,223,215,207,199,191,183,175,167,159,151,143,135,127,119,111,103,95,87,79,71,63,55,47,39,31,23,15,7,0,191,183,175,167,159,150,142,134,126,117,109,101,93,84,76,67,191,179,171,163,155,143,135,127,119,107,95,83,75,63,51,43,255,255,255,255,255,255,255,255,255,247,239,231,223,215,207,203,255,255,255,255,255,255,255,255,243,229,216,203,190,177,164,151,255,255,255,255,255,255,255,255,255,207,175,143,111,79,47,15,255,235,215,195,175,155,135,115,255,255,255,255,255,255,255,255,239,223,207,191,175,159,143,127,111,95,79,63,47,31,15,255,243,231,219,203,191,179,167,142,134,126,117,109,101,93,85,119,112,105,97,90,82,75,67,60,53,45,38,30,23,15,7,222,199,173,149,124,100,74,50,0,0,0,0,0,0,0,0,255,255,223,191,159,127,95,63,233,196,157,119,84,65,46,27,213,191,170,149,128,106,85,63,55,47,39,31,0,0,0,0,231,198,173,140,115,82,49,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,207,183,159,135,111,87,63,39^255,247,239,231,223,215,207,199,191,183,175,167,159,151,143,135,127,119,111,103,95,87,79,71,63,55,47,39,31,23,15,7,0,167,160,152,144,137,129,121,114,106,98,90,83,75,67,60,51,123,115,111,107,99,95,87,83,79,71,67,63,55,47,43,35,235,227,219,211,207,199,191,187,179,171,163,155,147,139,131,127,238,220,203,185,168,151,134,117,109,101,93,85,77,69,61,54,255,255,255,255,255,255,255,255,255,207,175,143,111,79,47,15,255,219,187,155,123,91,67,43,223,191,159,127,95,63,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,183,163,143,123,107,91,79,63,46,39,32,25,18,11,5,0,255,240,224,208,192,176,160,144,128,112,96,80,64,48,32,15,255,228,200,173,146,119,90,63,255,223,191,159,127,95,63,31,111,0,0,0,0,0,0,0,233,196,157,119,84,65,46,27,241,235,227,221,214,207,200,191,157,143,119,95,191,127,95,63,231,198,173,140,115,82,49,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,127,111,95,79,63,47,31,15^255,247,239,231,223,215,207,199,191,183,175,167,159,151,143,135,127,119,111,103,95,87,79,71,63,55,47,39,31,23,15,7,0,143,136,128,120,113,105,97,90,82,74,66,59,51,43,36,27,75,71,67,63,59,55,51,47,43,39,35,31,27,23,19,15,223,211,199,187,179,167,155,147,131,123,115,107,99,91,83,79,220,185,151,117,85,54,25,0,0,0,0,0,0,0,0,0,239,207,175,143,111,79,47,15,0,0,0,0,0,0,0,0,115,87,67,47,31,19,7,0,223,191,159,127,95,63,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,183,163,143,123,107,91,79,63,0,0,0,0,0,0,0,0,79,75,70,65,60,55,50,45,40,35,30,25,20,15,10,4,168,148,128,107,88,68,48,29,0,0,0,0,0,0,0,0,255,255,223,191,159,127,95,63,243,225,206,187,167,131,92,52,255,255,255,255,255,255,255,255,223,191,159,127,191,127,95,63,255,255,255,255,255,255,255,255,255,231,206,181,156,132,107,82,79,63,55,39,31,15,7,255,207,183,159,135,111,87,63,39) => "Sonic Robo Blast 2" +elif $pal_uzebox (0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255^0,0,0,0,0,0,0,0,36,36,36,36,36,36,36,36,72,72,72,72,72,72,72,72,109,109,109,109,109,109,109,109,145,145,145,145,145,145,145,145,182,182,182,182,182,182,182,182,218,218,218,218,218,218,218,218,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,36,36,36,36,36,36,36,36,72,72,72,72,72,72,72,72,109,109,109,109,109,109,109,109,145,145,145,145,145,145,145,145,182,182,182,182,182,182,182,182,218,218,218,218,218,218,218,218,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,36,36,36,36,36,36,36,36,72,72,72,72,72,72,72,72,109,109,109,109,109,109,109,109,145,145,145,145,145,145,145,145,182,182,182,182,182,182,182,182,218,218,218,218,218,218,218,218,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,36,36,36,36,36,36,36,36,72,72,72,72,72,72,72,72,109,109,109,109,109,109,109,109,145,145,145,145,145,145,145,145,182,182,182,182,182,182,182,182,218,218,218,218,218,218,218,218,255,255,255,255,255,255,255,255^0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255) => "Uzebox from Uzebox console" +elif $pal_kens16 (0,255,201,110,232,239,106,25,22,50,5,63,186,255,227,122^0,255,143,78,2,227,137,86,237,193,127,50,170,148,14,36^0,255,76,35,0,5,39,72,117,195,193,174,255,157,194,61) => "Andrew Kensler - 16 by Andrew Kensler" +elif $pal_kens32 (214,254,161,250,251,230,153,71,5,79,45,0,111,8,42,6,0,74,142,183,255,172,130,90,174,247,244,155,86,17,81,8^160,59,44,47,159,28,47,1,17,2,105,166,235,162,102,54,0,73,123,192,255,190,124,59,101,170,234,149,98,150,225,253^144,30,50,122,218,247,124,31,85,236,203,238,255,154,106,25,0,87,164,255,255,156,112,28,7,48,92,0,4,59,19,204) => "Andrew Kensler - 32 by Andrew Kensler" +elif $pal_kens54 (5,50,56,0,28,42,45,0,80,162,132,170,205,5,73,47,56,120,187,142,31,37,114,164,245,223,168,54,36,127,71,147,151,229,213,221,242,238,158,78,91,94,126,162,224,255,255,223,171,238,193,248,234,161^254,175,114,0,51,82,132,183,254,209,146,186,255,220,159,109,148,206,198,140,100,71,98,141,184,111,49,16,18,35,26,39,104,126,48,56,128,41,40,33,80,77,117,175,245,251,255,185,140,193,144,203,121,94^193,135,97,0,42,25,48,22,52,142,108,179,241,221,170,130,215,248,236,253,244,126,159,181,244,241,238,227,103,135,58,78,119,163,157,90,113,17,31,26,88,40,26,34,63,198,255,186,118,145,41,26,36,48) => "Andrew Kensler - 54 by Andrew Kensler" +elif $pal_aap12 (4,28,71,108,227,216,161,78,154,240,249,138^3,22,65,140,210,128,61,40,64,212,245,143^3,24,107,80,69,56,59,46,126,114,239,196) => "AAP-Micro 12 by Adigun A. Polack" +elif $pal_aap16 (7,51,119,204,153,221,255,255,85,17,68,51,85,85,170,255^7,34,68,136,51,119,221,255,170,85,238,136,68,85,187,255^8,34,51,85,17,17,85,51,68,34,187,221,170,119,187,255) => "AAP-16 by Adigun A. Polack" +elif $pal_aap64 (6,20,59,115,180,223,250,249,255,255,214,156,89,20,26,36,18,20,40,36,32,166,255,254,250,245,232,188,121,64,36,34,50,113,187,219,244,218,179,139,109,74,51,66,91,142,186,233,227,185,132,88,71,35,50,93,146,205,228,199,160,121,90,66^6,16,23,23,32,62,106,163,213,252,242,219,193,160,122,82,32,52,92,159,214,252,255,243,214,160,106,74,58,51,34,28,43,65,117,164,210,224,185,147,117,84,57,36,49,82,117,181,230,191,155,141,125,103,132,175,220,247,210,176,134,103,78,57^8,19,37,45,42,35,10,27,65,64,100,67,53,46,62,59,32,100,196,222,199,219,255,192,184,151,115,155,128,83,52,26,40,59,71,99,156,234,209,175,141,98,65,51,56,82,106,163,255,251,228,190,133,78,100,141,186,226,170,139,98,85,68,52) => "AAP-64 by Adigun A. Polack" +elif $pal_aap96 (1,12,39,85,137,195,241,255,255,241,191,131,72,36,9,18,43,84,144,206,251,253,221,152,100,60,33,18,28,23,17,16,146,255,234,178,108,53,31,41,83,140,200,236,255,255,255,255,242,229,255,255,255,255,244,225,169,108,63,29,25,57,107,169,233,255,255,255,252,215,140,73,124,181,231,254,255,255,254,235,204,140,81,33,24,42,69,104,157,208,240,255,246,213,140,82^1,6,13,28,58,95,147,197,240,199,143,92,48,24,8,27,54,94,152,208,240,255,252,225,161,96,51,21,45,99,163,229,252,255,254,237,195,138,81,29,38,60,105,174,225,247,232,187,133,63,107,171,210,174,115,45,9,12,13,11,15,22,32,41,63,111,242,219,145,93,54,32,66,117,178,236,251,236,205,162,108,61,32,15,22,39,70,118,179,226,248,250,226,179,109,64^1,6,11,19,27,29,25,57,7,5,13,17,16,10,9,13,14,20,22,22,69,225,98,7,13,14,11,62,130,139,151,146,148,254,254,254,250,243,207,117,184,238,255,254,255,233,209,157,104,149,124,109,131,79,0,3,9,26,27,17,37,68,110,119,71,41,169,109,86,55,34,19,28,33,51,131,191,171,142,109,66,46,31,17,22,48,91,146,191,226,240,229,190,145,98,80) => "AAP-RadiantPLUS by Adigun A. Polack" +elif $pal_aap128 (5,14,45,97,185,241,252,255,255,255,248,232,176,103,39,76,133,211,248,213,173,127,88,51,24,41,71,97,143,196,208,151,89,66,61,39,20,27,43,39,66,115,241,201,138,69,73,120,156,206,250,238,212,144,23,55,105,178,226,246,252,236,203,166,128,89,50,79,140,198,214,180,114,69,97,147,198,239,181,134,93,72,44,23,44,70,100,138,175,220,184,136,94,72,40,70,105,154,197,230,238,227,191,135,86,50,54,101,150,192,212,234,241,221,189,136,89,51,178,225,248,255,253,246,226,178,100,42^4,12,27,39,69,100,165,224,255,240,197,138,91,57,31,61,95,151,246,220,184,142,99,60,28,63,114,165,208,241,255,237,207,164,111,65,18,36,78,137,191,239,242,212,161,114,65,100,139,170,214,181,128,82,21,51,91,139,178,216,247,235,198,158,123,87,50,52,91,133,168,117,75,42,104,148,184,221,231,198,155,104,59,24,52,84,135,196,233,234,204,163,113,82,44,71,102,151,199,231,230,205,165,115,79,47,40,73,104,144,184,224,235,206,164,110,77,39,148,191,227,233,201,162,114,82,54,30^3,12,30,33,29,31,112,183,255,137,58,54,44,49,27,46,57,65,68,29,52,68,53,36,25,33,56,63,50,41,234,202,147,89,67,45,29,71,149,205,232,232,255,253,246,227,130,198,219,237,255,156,187,188,22,52,89,120,126,150,190,231,193,154,122,87,50,47,62,86,81,56,44,27,58,70,88,145,203,154,121,89,57,25,56,86,140,195,223,238,216,188,142,98,60,98,130,185,221,240,234,223,201,143,91,53,43,86,136,169,184,221,219,191,153,106,77,42,118,137,152,227,201,168,133,102,75,35) => "AAP-SPLENDOR128 by Adigun A. Polack" +elif $pal_aap_dga16 (1,3,16,23,114,108,178,184,74,11,155,115,232,255,254,255^1,27,140,187,12,28,81,176,72,99,206,245,158,123,242,255^1,117,0,211,10,158,22,168,66,196,0,213,0,219,85,254) => "AAP-DGA16 by Adigun A. Polack" +elif $pal_cheerful32 (14,43,76,138,194,255,102,46,31,23,15,15,22,140,255,255,242,230,179,128,89,51,102,191,255,255,255,230,179,107,64,43^17,45,80,147,201,249,204,138,71,32,77,153,217,255,255,213,121,34,0,13,9,10,10,0,51,128,187,138,83,43,21,15^18,51,89,153,204,242,255,230,153,77,56,50,22,25,77,0,0,0,30,32,36,51,71,112,153,149,153,92,36,21,13,15) => "Cheerful-32 by SoundsDotZip" +elif $pal_db8 (0,85,100,215,80,100,230,220^0,65,105,115,140,185,200,245^0,95,100,85,215,100,110,255) => "DB8 by DawnBringer" +elif $pal_db16 (20,68,48,78,133,52,208,117,89,210,133,109,210,109,218,222^12,36,52,74,76,101,70,113,125,125,149,170,170,194,212,238^28,52,109,78,48,36,72,97,206,44,161,44,153,202,94,214) => "DB16 by DawnBringer" +elif $pal_db32 (0,34,69,102,143,223,217,238,251,153,106,55,75,82,50,63,48,91,99,95,203,255,155,132,105,89,118,172,217,215,143,138^0,32,40,57,86,113,160,195,242,229,190,148,105,75,60,63,96,110,155,205,219,255,173,126,106,86,66,50,87,123,151,111^0,52,60,49,59,38,102,154,54,80,48,110,47,36,57,116,130,225,255,228,252,255,183,135,106,82,138,50,99,186,74,48) => "DB32 by DawnBringer" +elif $pal_db_iso22 (12,76,112,188,206,228,144,105,77,38,44,60,85,116,240,207,182,132,85,116,107,147^8,65,80,95,145,218,196,142,97,50,75,115,141,186,250,182,124,90,84,102,123,147^22,56,58,78,72,108,70,52,60,60,115,115,222,234,255,144,116,120,97,88,137,136) => "DB-ISO22 by DawnBringer" +elif $pal_dimwid17 (20,103,117,135,139,119,14,41,87,240,177,179,221,248,254,242,173^4,16,75,123,157,202,103,48,125,121,111,60,128,204,201,254,211^21,16,55,86,83,115,63,101,172,163,185,111,34,1,175,255,254) => "DimWiddy 17 by DimWiddy" +elif $pal_dimwid23 (0,250,224,226,186,185,235,195,228,187,113,81,137,203,166,58,56,158,171,24,93,30,7^0,232,205,225,183,171,167,190,114,102,137,154,127,70,72,109,102,31,44,55,32,22,6^0,233,242,92,169,250,80,33,81,227,229,75,127,103,135,105,44,113,41,118,62,71,13) => "DimWiddy 23 by DimWiddy" +elif $pal_edg4 (251,229,66,32^247,176,110,40^243,131,93,61) => "Endesga-4 by Endesga" +elif $pal_edg8 (253,211,218,230,40,45,123,27^253,39,125,218,198,147,83,28^248,52,34,41,65,221,173,51) => "Endesga-8 by Endesga" +elif $pal_edg16 (228,184,116,63,158,229,251,255,99,50,25,79,175,255,44,4^166,111,63,40,40,59,146,231,198,115,61,103,191,255,232,132^114,80,57,50,53,68,43,98,77,69,63,129,210,255,244,209) => "Endesga-16 by Endesga" +elif $pal_edg32 (190,215,234,228,184,115,62,162,228,247,254,254,99,62,38,25,18,0,44,255,192,139,90,58,38,24,255,104,181,246,232,194^74,118,212,166,111,62,39,38,59,118,174,231,199,137,92,60,78,153,232,255,203,155,105,68,43,20,0,56,80,117,183,133^47,67,170,114,80,57,49,51,68,34,52,97,77,72,66,62,137,219,245,255,220,180,136,102,68,37,68,108,136,122,150,105) => "Endesga-32 by Endesga" +elif $pal_edg36 (219,163,103,78,57,38,20,123,80,46,26,15,13,15,14,19,65,240,229,197,148,98,70,151,229,247,251,254,237,196,120,53,77,127,180,227^224,172,112,83,58,36,16,207,155,106,69,39,47,77,130,178,243,210,174,129,85,53,33,67,112,172,223,151,82,44,31,20,35,59,94,141^231,190,139,113,86,58,32,92,75,66,59,56,109,163,206,242,252,175,120,88,66,48,31,42,40,55,107,155,89,54,44,40,82,134,179,214) => "Endesga-36 by Endesga" +elif $pal_edg64 (255,19,27,39,61,93,133,180,255,199,146,101,66,42,26,14,28,57,93,138,191,230,246,249,237,224,198,142,255,237,255,255,255,211,153,90,51,30,19,12,0,0,0,0,12,148,253,243,219,122,48,12,3,59,98,147,202,200,246,245,234,196,137,87^0,19,27,39,61,93,133,180,255,207,161,115,76,47,25,7,18,31,44,72,111,156,202,230,171,116,69,37,80,118,162,200,235,252,230,197,152,111,76,46,57,105,152,205,241,253,210,137,63,9,3,2,25,20,36,56,82,80,129,85,50,36,30,28^64,19,27,39,61,93,133,180,255,221,185,146,110,78,50,27,28,33,40,54,74,105,159,207,80,56,36,29,0,20,20,37,87,126,95,79,75,80,76,68,109,170,220,249,255,255,237,245,253,250,217,147,63,67,97,143,201,134,135,93,60,48,43,39) => "Endesga-64 by Endesga" +elif $pal_famicube (0,224,255,215,168,123,52,21,13,65,113,189,37,10,0,0,32,88,19,0,23,55,106,140,190,238,182,147,204,255,255,246,173,35,92,174,197,226,79,130,218,225,245,255,255,207,135,163,204,213,254,226,166,106,90,33,61,98,155,152,91,10,2,0^0,60,255,215,168,123,52,21,32,93,166,255,226,152,82,96,181,211,157,78,40,109,180,214,235,255,193,151,143,187,231,143,78,23,60,108,151,215,21,60,101,130,183,233,130,60,22,40,105,156,201,201,117,49,25,22,52,100,160,220,168,137,74,23^0,40,255,215,168,123,52,21,48,102,161,202,205,172,128,75,98,50,8,0,8,3,23,18,113,169,33,23,21,49,55,55,26,18,13,55,130,181,7,61,94,137,132,197,206,113,70,179,228,252,237,255,254,202,145,64,165,220,239,255,255,255,202,125) => "Famicube by Arne" +elif $pal_juicy32 (51,102,153,204,255,229,178,127,61,7,79,135,216,255,255,178,80,37,16,10,18,56,107,184,255,145,53,62,25,91,165,211^14,36,76,137,204,114,53,24,6,0,31,77,157,199,235,214,178,124,84,57,29,71,122,197,255,224,130,106,40,53,82,116^34,53,76,124,181,57,53,75,61,14,27,54,97,89,140,96,71,73,72,71,53,102,153,216,242,204,130,178,102,130,139,132) => "Juicy-32 by Real Juice" +elif $pal_juicy56 (0,255,200,165,120,85,55,25,20,15,15,65,115,220,178,140,90,55,255,245,230,195,140,65,125,170,215,240,255,255,190,100,35,15,15,130,65,20,20,15,15,60,100,160,230,255,75,130,180,230,255,255,230,190,150,110^0,255,225,190,145,100,65,30,70,115,165,205,255,155,98,60,20,10,210,165,110,65,35,0,0,20,45,105,170,230,215,165,125,85,50,255,215,160,105,55,15,30,45,65,90,140,20,10,35,80,140,205,155,105,70,40^5,255,235,205,165,125,90,60,90,115,105,115,115,120,71,50,35,20,165,110,70,45,35,65,65,60,45,35,50,90,45,30,20,25,35,225,215,205,195,155,105,140,180,215,230,200,60,100,110,120,140,180,150,115,95,80) => "Juicy-56 by Real Juice" +elif $pal_xaiue (252,135,8,55,91,159,107,179,175,77,75,181,229,224,112,61,43,29,109,182,206,243^250,116,6,46,77,126,205,214,176,140,76,69,139,218,176,127,64,24,67,102,152,215^228,105,11,35,33,43,99,239,233,211,183,55,55,44,60,79,75,62,105,166,155,189) => "XAIUE-22 by xaiue" +elif $pal_15pdx (110,187,223,236,131,39,23,4,23,129,253,199,135,70,32^50,87,146,210,168,114,59,104,161,219,249,178,113,63,23^50,53,69,116,22,36,71,148,169,205,241,149,91,60,8) => "15P-DX by GrafxKid" +elif $pal_20pdx (23,71,120,177,235,104,169,217,235,82,129,188,235,14,4,1,85,23,90,177^13,71,120,185,255,41,68,126,208,60,96,139,205,76,110,163,222,121,178,227^32,87,118,166,218,62,0,0,0,20,49,87,147,88,146,195,183,71,23,41) => "20P-DX by GrafxKid" +elif $pal_24pdx (23,72,137,201,252,111,192,238,255,76,142,204,247,13,32,102,201,0,0,111,99,183,255,255^15,69,122,183,245,36,70,131,196,44,83,140,199,65,121,182,226,113,171,221,44,70,121,189^7,66,108,156,232,29,14,0,45,53,64,88,139,87,73,50,81,157,196,213,83,108,134,169) => "24P-DX by GrafxKid" +elif $pal_cabana64 (0,167,103,71,48,58,90,195,241,253,255,255,240,224,178,130,255,255,169,109,69,104,149,218,242,255,255,255,221,192,144,96,74,210,163,97,51,63,97,143,210,242,218,150,57,34,52,34,16,105,162,113,67,44,8,27,91,182,209,170,76,28,13,10^0,154,84,53,32,22,38,104,110,164,226,216,157,105,78,51,255,252,128,71,45,11,28,72,118,175,245,118,57,34,12,1,74,204,146,84,47,13,24,75,145,237,255,218,174,116,58,20,16,132,188,159,86,50,67,116,190,255,255,255,212,131,57,37^0,95,31,19,26,3,11,10,3,20,44,135,81,38,44,20,255,219,90,52,37,118,188,221,255,252,246,147,57,20,71,25,74,243,212,118,58,118,148,236,255,255,254,255,255,255,241,120,16,156,197,147,85,51,57,74,97,140,204,216,148,147,111,99) => "Cabana-64 by Crabby" +elif $pal_fant16 (142,81,51,20,70,166,211,231,238,217,117,20,4,28,67,96^109,58,39,19,24,60,123,188,238,213,115,33,4,27,80,161^52,24,16,12,32,30,30,79,250,91,32,15,5,47,99,143) => "Fantasy 16 by Brettybooop" +elif $pal_fant24 (31,57,165,239,239,171,24,239,239,165,119,114,42,57,104,146,39,239,69,60,155,54,85,48^36,87,140,172,216,92,63,105,183,98,52,65,29,42,76,126,100,58,35,159,26,23,15,15^10,28,39,40,161,28,57,47,117,67,33,19,13,28,60,106,104,12,13,156,10,12,10,10) => "Fantasy 24 by Gabriel C." +elif $pal_tf23 (165,201,209,162,131,99,65,40,58,95,134,172,212,151,101,58,34,80,133,223,172,124,76^45,109,202,157,107,73,51,34,59,99,149,194,237,181,132,89,58,59,91,185,220,168,110^39,69,128,107,63,44,37,31,61,103,152,195,237,138,92,65,48,104,105,202,241,213,173) => "Tranquil Fantasy 23 by windfall.apples" +elif $pal_tfp39 (82,120,165,201,204,207,227,247,217,199,141,87,40,65,99,131,162,151,101,58,32,32,58,95,134,172,212,172,124,76,62,55,51,88,114,133,177,223,234^30,24,45,109,165,194,231,225,182,151,91,50,34,51,73,107,157,181,132,89,55,44,59,99,149,194,237,220,168,110,61,42,20,38,64,91,139,185,220^46,38,39,69,98,129,171,188,145,125,87,34,31,37,44,63,107,138,92,65,45,17,61,103,152,195,237,241,213,173,138,94,77,79,74,105,154,202,230) => "Tranquility Plus 39 by windfall.apples" +elif $pal_faraway48 (13,34,61,173,217,255,255,214,143,22,28,13,13,0,0,0,0,8,89,170,69,37,2,25,16,9,21,46,86,160,200,237,247,247,241,231,209,158,115,77,36,28,16,32,88,169,210,241^7,9,5,24,79,152,249,246,250,158,93,56,29,25,49,100,141,196,223,232,197,149,89,58,20,13,21,38,46,58,101,175,200,243,228,204,158,109,50,38,23,18,17,34,97,176,214,242^9,21,24,24,12,14,89,104,55,38,42,34,31,31,56,87,109,159,176,202,217,207,153,145,56,25,56,77,115,158,143,185,217,206,175,147,113,79,46,48,32,22,18,35,98,176,215,241) => "Faraway 48 by Igor Ferreira." +elif $pal_fleja_m (31,43,65,104,144,182,255,252,181,138,92,201,222,255,255,252,180,81,48,35,38,35,65,76,99,148,184,60,70,130,247,194,133^24,46,72,113,161,203,255,191,128,80,58,48,106,173,229,249,214,196,156,109,79,54,114,147,194,210,253,41,39,100,164,113,45^51,66,89,122,168,207,255,138,87,62,65,56,56,59,150,96,69,63,99,122,110,99,145,173,201,212,255,64,92,129,139,130,102) => "Fleja Master Palette by Fleja" +elif $pal_koni32 (0,11,22,34,43,48,52,73,164,255,242,204,245,166,153,115,77,70,140,242,255,179,112,64,31,33,39,65,109,137,187,255^0,10,21,38,64,101,168,242,255,242,165,122,64,58,83,55,42,52,46,97,168,223,165,124,80,62,47,69,112,139,189,255^0,13,36,64,87,102,112,90,99,64,63,71,37,58,72,88,73,106,184,218,212,255,250,255,204,166,102,88,120,140,191,255) => "Koni32 by Konic" +elif $pal_linearbasic (14,95,153,220,247,159,98,143,197,238,252,218,250,151,75,61,49,65,73,114,86,89,71,129,194,240,253,211,170,119,72^12,45,57,74,134,41,35,64,96,142,203,78,203,218,167,115,65,112,167,214,152,86,53,86,120,179,247,191,141,92,59^12,86,112,123,151,78,47,41,37,46,163,56,62,63,71,79,82,137,144,206,204,189,121,170,208,221,237,169,122,85,58) => "Linear Color Palette Basic by GrafxKid" +elif $pal_lego (255,217,214,255,0,255,0,0,0,168,71,255,5,149,153,94,141,0,0,95,128,244,91,156,76,228,135,222,238,255,44,245,48,170,70,104,211,160,205,226,245,119,150^255,187,114,0,0,255,0,153,204,61,140,102,157,185,0,116,116,37,51,130,8,155,28,146,81,228,192,55,157,255,21,193,15,125,155,195,242,110,164,249,243,119,185^255,123,64,0,255,0,0,0,0,21,198,0,158,11,102,140,82,65,0,101,27,0,12,145,86,218,234,139,195,153,119,137,6,85,195,226,234,185,222,154,215,78,59) => "LEGO colors from LEGO wiki" +elif $pal_lego2021 (255,175,89,33,106,255,137,51,144,222,124,166,223,243,247,247,255,179,227,255,46,0,16,118,0,204,20,0,51,66,179,255,200,181,177,136,95,90,159,97^255,181,93,33,14,99,53,0,116,198,144,202,238,224,209,186,126,84,160,175,85,100,203,162,138,255,48,87,153,192,0,187,112,41,140,94,38,113,195,175^255,199,96,33,21,71,29,0,80,156,81,85,165,85,23,48,20,8,91,125,67,46,49,144,128,255,68,166,255,251,6,255,128,82,191,158,131,132,233,255) => "Lego Colours 2021 by Six Pies" +elif $pal_vinelinear (21,40,54,104,180,244,244,255,12,3,9,17,87,185,26,41,94,143,244,254,14,27,34,70,42,125,34,47,67,116,175,248,25,36,37,58,86,151^10,11,16,24,35,104,192,253,19,40,73,131,197,237,17,25,28,23,93,181,9,24,45,91,192,242,12,19,30,52,93,153,16,30,49,92,161,219^31,38,39,36,19,11,71,240,39,43,63,55,43,94,46,69,90,103,146,139,47,83,129,231,242,207,39,22,30,26,35,58,46,68,94,133,191,210) => "Vines Flexible Linear Ramps by Vine 2D" +elif $pal_arcade29 (241,255,159,255,240,241,201,151,87,114,35,10,48,47,105,51,50,40,201,108,255,229,23,150,88,42,185,126,65^240,77,30,196,108,194,126,63,20,203,133,75,197,126,222,165,89,35,92,52,170,93,25,165,108,55,165,99,47^238,77,49,56,0,132,79,63,46,37,49,77,173,131,255,255,226,123,209,157,188,172,27,171,121,71,136,82,47) => "Arcade Standard 29 by GrafxKid" +elif $pal_arq16 (255,255,174,77,233,16,81,5,241,130,255,90,255,125,235,30^255,209,181,128,56,8,30,68,137,62,169,225,233,62,108,138^255,157,189,201,65,32,67,148,45,44,169,80,71,191,130,76) => "ARQ16 by Endesga" +elif $pal_atom8 (179,255,255,108,0,0,64,136^0,128,255,217,128,0,64,136^0,0,170,0,0,0,128,136) => "Atom-8 by polyphrog" +elif $pal_blk36 (0,18,41,70,107,144,193,255,255,229,193,140,102,63,41,65,100,140,185,165,90,65,53,54,10,15,20,34,66,140,255,255,204,135,216,255^0,23,50,75,116,158,217,255,204,149,106,75,51,35,23,40,52,81,145,230,185,133,74,39,42,74,102,137,188,255,224,150,82,42,56,104^0,61,104,140,178,221,242,255,208,159,125,99,75,60,76,102,153,204,242,255,229,216,178,127,51,76,91,110,127,155,145,95,80,56,67,102) => "BLK 36 by BlackedIRL." +elif $pal_blkneo (0,18,41,70,107,144,193,255,255,242,195,153,114,63,178,229,255,255,140,66,34,20,15,10,29,50,53,62,80,140,180,133,93,67,255,255,255,178,114,165,221,255,120,39,0,0^0,23,50,75,116,158,217,255,204,159,114,76,51,31,46,66,110,165,255,188,137,102,74,42,26,45,74,131,185,218,131,76,47,30,224,170,105,60,28,38,55,102,250,211,170,135^0,61,104,140,178,221,242,255,208,170,137,105,82,60,105,134,175,213,155,127,110,91,76,51,89,137,178,209,235,255,239,191,140,102,145,110,90,64,47,57,69,117,230,203,165,130) => "BLK-NEO by BlackedIRL." +elif $pal_brokefac (36,137,173,204,249,86,131,163,181,202,77,152,209,221,243,200,216,232,242,248,23,72,122,164,205,80,94,127,157,202,32,63,119,185,203,237,243,219,233,213^33,131,169,202,248,55,87,114,150,184,28,25,36,75,121,104,153,192,219,241,96,140,189,207,222,68,156,198,226,241,44,45,38,40,81,167,190,235,221,196^30,119,158,196,247,53,72,84,105,128,45,30,36,99,226,38,63,79,137,198,31,54,64,65,94,186,204,206,223,234,86,109,115,79,53,216,221,235,232,223) => "Broken Facility by telepathic-melon" +elif $pal_bubblegum (22,127,214,255,255,250,255,255,148,67,35,104,191,16,0,0^23,6,36,132,209,253,128,38,33,0,73,174,255,210,120,40^26,34,17,38,0,255,164,116,106,103,117,212,60,117,153,89) => "Bubblegum-16 by PineTreePizza" +elif $pal_cpcboy (0,27,53,102,85,127,188,192,223,27,27,30,121,128,145,201,227,248,53,53,53,127,173,141,225,228,255,238,172,118,63,36^0,27,53,30,51,53,53,70,109,101,110,121,95,128,148,127,155,120,175,183,193,201,200,225,198,221,255,234,181,132,80,49^0,101,201,37,97,201,53,110,155,27,131,229,27,128,223,53,141,248,53,143,215,53,170,199,67,154,255,224,107,72,63,55) => "CPC BOY by Arne Niklas Jansson" +elif $pal_cade15 (16,53,68,76,4,28,92,124,56,142,188,250,212,255,226^15,22,98,186,85,153,74,142,16,2,70,125,146,215,241^12,92,188,255,36,36,108,141,0,50,4,97,12,80,210) => "Cade 15 by MonstersGoBoom" +elif $pal_calder8 (213,12,4,226,235,0,8,33,253,117,128^4,37,121,201,73,95,164,67,170,29,123^7,165,55,6,29,168,132,203,29,107,115) => "Calder 8 by Philip Dodderige" +elif $pal_cdbac (0,218,127,196,244,199,119,49,55,142,214,245,253,206,93,48^0,131,55,196,251,240,226,152,54,100,151,206,245,63,9,20^0,92,16,102,74,220,142,63,141,227,255,230,249,80,41,33) => "CD-BAC by DimWiddy" +elif $pal_cgarne (0,94,34,76,12,108,68,123,138,235,92,226,170,255,181,255^0,96,52,129,126,217,170,226,54,138,46,61,92,217,181,255^0,110,209,251,69,71,204,249,34,96,120,105,61,63,181,255) => "CG Arne by Arne Niklas Jansson" +elif $pal_dino (15,41,83,149,241,197,141,81,236,234,205,124,48,0,71,31^21,39,88,146,241,141,82,61,213,119,61,63,66,131,164,97^27,50,103,143,234,101,66,61,109,48,61,140,113,200,77,67) => "Dinoknight 16 by Retrospec" +elif $pal_4l (250,70,92,87,97,107,153,181,135,166,180,13,18,78,113,76,22,173,227,235,255,248^249,59,87,98,115,151,11,97,135,164,180,13,22,64,96,126,156,101,102,148,193,226^249,82,90,122,81,85,45,114,116,156,180,13,130,166,186,216,120,95,37,136,146,0) => "||||-22 by ||||" +elif $pal_fzteth16 (243,249,184,94,162,194,143,193,108,0,0,221,0,7,0,5^243,194,112,13,158,89,39,0,96,71,168,180,73,134,195,28^243,164,14,36,180,223,184,43,111,237,243,17,82,92,125,37) => "FZT Ethereal 16 by Fusionnist" +elif $pal_indc (255,143,68,40,47,75,69,242,212,227,148,87,156,209,180,109,44^244,204,148,87,43,59,124,182,110,66,53,37,101,180,186,140,27^224,203,137,99,92,156,214,61,51,98,61,59,108,140,71,50,46) => "Indecision by Nelson SMG" +elif $pal_island16 (13,79,130,197,240,251,255,190,123,116,65,50,42,125,193,232^8,43,91,145,189,223,249,187,178,173,128,83,35,56,108,153^13,36,49,84,119,155,228,178,78,187,160,95,73,64,91,115) => "Island Joy 16 by Kerrie Lake" +elif $pal_journey (5,17,59,105,156,212,245,255,255,255,214,148,66,34,16,37,61,115,189,237,255,255,198,119,66,44,21,5,14,12,3,20,72,120,176,250,199,146,91,57,36,14,19,26,16,40,61,248,240,207,143,82,15,53,100,155,212,237,255,212,156,105,69,45^9,5,6,23,50,100,161,207,122,65,26,0,0,0,7,8,17,38,64,123,184,245,216,176,144,100,60,33,4,11,39,68,139,215,255,255,212,143,83,41,20,15,34,70,144,192,255,255,194,150,87,41,2,0,0,14,30,76,151,102,52,27,12,0^20,36,58,73,71,83,93,142,125,125,136,122,78,41,38,44,50,61,53,57,74,64,49,42,88,94,74,55,33,66,105,145,212,255,241,255,225,184,125,70,44,44,67,107,142,116,110,184,151,140,101,75,46,59,76,62,60,64,87,47,26,34,40,46) => "Journey by PineTreePizza" +elif $pal_shallowmarsh26 (16,41,61,77,100,94,140,203,154,131,84,77,79,80,255,255,255,247,219,178,121,81,139,210,251,255^15,41,61,89,105,142,198,219,172,128,87,104,135,177,252,238,213,156,112,75,79,58,86,107,162,214^16,45,61,74,95,110,118,196,182,138,93,138,166,182,246,199,108,63,85,86,74,64,146,181,180,203) => "Shallowmarsh26 by archer" +elif $pal_lago_nenufar (244,231,154,255,208,143,202,98,50,25,255,1,54,26,63,59,112,33,68^163,120,63,211,171,99,219,154,132,90,243,92,178,208,126,37,45,31,40^20,48,27,180,152,88,251,255,146,122,235,15,32,107,105,122,151,52,59) => "Lago Nenufar (Lake Water Lily) by Popxel Art" +elif $pal_juicy (225,37,84,55,60,99,215,160,163,130,114,198,209,233,215,117,72^246,34,180,79,114,228,233,113,172,132,89,148,198,157,80,78,216^210,44,60,122,82,116,91,77,166,132,151,168,170,70,60,59,206) => "Juicy 17 by JerryPie" +elif $pal_chocolateganache (0,222,255,255,247,74,90,247,206,247,107,99,58,49,173,123,90,33,115,74,181,90,107,173,140,107,115,99,247,148,123,58,132,115,107,99,123,74,189,58,115,99,74,90,107,90,115,239,206,239,222,41,214,197,255,197,74,247,255,222,255,197,206,206,115,206,66,132,82,33,41,33,115,41,33,132,115,206,58,222,214,99,206,222,247,255,247,247,247,230,255,247,247,255,247,247^0,222,255,230,156,33,33,90,49,74,41,41,16,8,140,66,33,8,66,25,115,49,41,132,99,66,58,41,230,115,90,41,82,66,58,58,66,49,165,33,82,66,41,58,66,49,66,230,197,222,206,25,197,132,247,189,66,247,255,222,255,197,206,222,181,214,90,173,90,181,197,197,197,99,25,107,25,58,41,140,66,41,173,58,189,66,173,90,165,140,140,123,107,82,74,58^0,222,255,230,156,33,33,90,49,66,33,33,8,0,132,49,16,0,49,8,90,33,16,115,82,49,33,16,222,99,74,33,58,41,33,33,33,33,148,16,58,41,16,33,33,16,25,222,189,206,189,8,173,33,230,165,41,239,247,206,230,173,132,41,33,197,41,115,82,33,115,206,206,181,189,156,189,222,58,189,148,58,181,99,197,90,181,107,173,148,148,132,115,90,82,66) => "ChocolateGanache by Ladybug" +elif $pal_brightwinter1 (0,64,63,255,255,182,76,0,0,0,0,0,72,178,255,255,0,128,112,255,127,91,38,0,0,0,0,0,33,87,127,127,160,226,239,86,234,218,165,127,127,127,127,127,161,214,255,255,192,255,255,68,183,109,82,63,63,63,63,63,80,107,127,127,99,76,112,244,142,112,100,196,255,160^132,64,39,173,251,255,255,255,255,255,148,38,0,0,0,0,163,128,81,123,106,127,127,127,127,127,74,19,0,0,0,0,160,59,203,175,190,255,255,255,255,255,201,146,127,127,127,127,192,66,219,50,148,127,127,127,127,127,100,73,63,63,63,63,99,50,211,85,114,112,69,235,251,130^0,64,39,73,221,0,0,33,144,255,255,255,255,255,220,110,0,128,81,0,0,0,0,14,70,127,127,127,127,127,110,55,160,59,162,247,107,127,127,142,197,255,255,255,255,255,237,182,192,66,172,15,84,63,63,71,98,127,127,127,127,127,118,91,99,18,211,112,65,112,31,239,181,73) => "Bright Winter 1 by Nai" +elif $pal_brightwinter2 (0,64,255,255,255,182,76,0,0,0,0,0,72,178,255,255,255,128,127,127,127,91,38,0,0,0,0,0,33,87,127,127,30,17,224,239,255,0,0,255,249,247,91,255,225,255,78,61,127,127,127,109,82,63,63,63,63,63,80,107,127,28,107,0,255,0,0,160,25,10,206,226,255,88,249,255,255,15,255,255,99,0,0^0,64,0,106,216,255,255,255,255,255,148,38,0,0,0,0,255,128,0,51,106,127,127,127,127,127,74,19,0,0,0,0,30,17,224,239,250,28,18,228,217,247,42,234,222,245,0,33,63,89,116,127,127,127,127,127,100,73,63,63,63,28,83,61,253,74,89,32,25,10,47,226,245,61,243,213,206,15,246,245,61,51,40^0,64,0,0,0,0,0,33,144,255,255,255,255,255,220,110,255,128,0,0,0,0,0,14,70,127,127,127,127,127,110,55,30,17,224,239,229,20,13,96,72,201,0,181,219,236,0,0,63,63,63,63,63,71,98,127,127,127,127,127,118,28,37,6,247,0,84,32,25,10,47,226,198,17,167,159,147,15,147,209,27,4,3) => "Bright Winter 2 by Nai" +elif $pal_kawaii (101,181,220,248,184,255,252,236,255,249,123,142,89,215,116,29^71,112,171,216,170,245,165,70,163,250,193,211,137,147,81,23^30,117,128,171,170,245,194,70,34,147,136,248,163,250,142,60) => "Kawaii16 by Arisuki" +elif $pal_xdb_01 (32,64,150,220,255,156,217,242,247,82,195,48,99,157,74,153,255^32,64,150,220,255,31,122,187,237,202,217,153,226,182,82,54,89^64,96,150,192,230,46,70,104,124,100,76,156,212,255,194,151,136) => "0xdb-01 by 0xDB" +elif $pal_gzxp (0,173,243,159,218,170,232,0,14,31,68^0,155,234,37,98,124,202,106,175,29,88^0,168,215,63,82,20,0,20,3,175,214) => "GZXP by GrafxKid" +elif $pal_chrom16 (0,144,255,128,255,160,255,255,255,32,64,0,48,0,160,255^0,176,255,0,0,80,128,192,255,172,255,48,112,208,0,96^0,176,255,24,0,0,0,128,0,0,0,112,176,255,224,255) => "Chromatic16 by DragonDePlatino" +elif $pal_piet (255,0,255,255,192,255,255,192,192,0,0,192,0,0,192,0,0,255,255,192^255,0,192,0,0,255,255,192,255,255,192,255,255,192,192,0,0,192,0,0^255,0,192,0,0,192,0,0,192,0,0,255,255,192,255,255,192,255,255,192) => "Piet by P-Tux7" +elif $pal_boltbait_matrix (18,18,18,43,107,108,108,107,107,44,18,18,30,153,53,170,0,0,0,49,176,176,176,175,175,52,0,0,51,173,73,197,0,0,0,66,234,233,234,233,234,69,0,0,71,193,94,208,0,0,0,66,255,255,255,255,255,76,0,0,91,214,114,235,88,87,86,134,255,255,255,255,255,135,86,86,112,234,135,237,145,145,145,176,255,255,255,254,255,178,145,146,132,255,158,240^106,92,50,18,18,18,18,52,105,107,108,108,30,153,34,109,173,147,64,0,0,0,0,67,172,176,176,176,51,173,47,136,229,194,85,0,0,0,0,88,229,233,234,233,71,193,61,147,248,212,93,0,0,0,0,93,246,255,255,255,91,214,74,185,251,226,148,87,86,87,87,150,251,254,255,255,112,234,87,199,252,236,185,145,145,144,145,185,252,255,255,255,132,255,100,212^108,107,108,107,107,53,22,18,18,18,50,92,30,153,32,100,176,177,176,176,176,70,8,0,0,0,64,146,51,173,44,125,234,234,233,233,234,93,11,0,0,0,85,194,71,193,56,133,252,255,255,249,255,106,12,0,0,0,85,208,91,214,68,175,255,255,255,255,255,154,94,86,87,85,148,226,112,234,81,189,255,255,255,255,255,188,150,144,144,145,185,236,132,255,93,197) => "Matrix by BoltBait" +elif $pal_material_design (244,233,156,103,63,33,3,0,0,76,139,205,255,255,255,121,255,245,213,101,61,41,0,0,29,0,118,198,255,255,255,109,183,136,74,49,26,13,1,0,0,27,51,130,245,255,230,62,211,194,123,81,48,25,2,0,0,56,104,175,251,255,245,93,229,240,186,149,121,100,79,77,77,129,174,220,255,255,255,161,255,248,225,209,197,187,179,178,178,200,220,240,255,255,255,215^67,30,39,58,81,150,169,188,150,175,195,220,235,193,152,85,23,0,0,31,90,121,176,229,233,230,255,255,234,196,145,76,28,14,20,27,35,71,87,96,77,94,105,119,127,111,81,39,47,24,31,45,63,118,136,151,121,142,159,180,192,160,124,64,115,98,104,117,134,181,195,208,182,199,213,231,241,213,183,136,205,187,190,196,202,222,229,235,223,230,237,244,249,236,224,204^54,99,176,183,181,243,244,212,136,80,74,57,59,7,0,72,68,87,249,255,254,255,255,255,182,118,3,0,0,0,0,65,28,79,140,146,126,161,155,100,64,32,30,23,23,0,0,35,47,91,162,168,159,210,209,167,107,60,56,43,45,0,0,55,115,146,200,205,203,246,247,225,172,132,129,117,118,79,77,127,210,208,231,233,233,251,252,242,219,201,200,195,196,179,178,200) => "Material Design by Ruchir L. Sharma (@aguynamedruchir)" +elif $pal_thehamster_rainbow (0,127,127,127,127,91,38,0,0,0,0,0,33,87,127,127,51,204,255,255,255,187,76,0,0,0,0,0,63,174,255,255,102,153,255,255,255,200,112,50,50,50,50,50,98,187,255,255,255,255,255,214,150,102,102,102,102,102,204,255,255,255,255,255,227,185,153,153,153,153,153,221,255,255,255,255,255,255,241,220,204,204,204,204,204,238,255,255^0,127,0,51,106,127,127,127,127,127,74,19,0,0,0,0,51,204,0,102,212,255,255,255,255,255,148,38,0,0,0,0,102,153,50,132,221,255,255,255,255,255,170,81,50,50,50,50,102,160,229,255,255,255,255,255,191,127,102,102,102,153,192,238,255,255,255,255,255,212,169,153,153,153,255,204,223,246,255,255,255,255,255,233,212,204,204,204^0,127,0,0,0,0,0,14,70,127,127,127,127,127,110,55,51,204,0,0,0,0,0,25,140,255,255,255,255,255,220,110,102,153,50,50,50,50,50,68,159,255,255,255,255,255,227,139,102,102,102,102,102,114,181,255,255,255,255,234,170,153,153,153,153,153,159,204,255,255,255,255,241,198,255,204,204,204,204,204,206,229,255,255,255,255,248,226) => "Rainbow by thehamster" +elif $pal_boltbait_rainbow (255,255,255,255,255,193,137,76,255,255,255,255,255,188,132,79,216,168,119,58,0,0,0,0,216,168,119,58,0,0,0,0,247,237,227,215,204,150,106,63,216,168,119,58,0,0,0,0,255,255,255,255,255,188,132,79,216,168,119,58,0,0,0,0,255,255,255,255,255,224,183,135,250,246,240,237,235,208,197,170,255,255,255,255,255,191,127,73,224,192,160,128,96,64,32,0^216,168,119,58,0,0,0,0,216,168,119,58,0,0,0,0,255,255,255,255,255,191,135,81,216,168,119,58,0,0,0,0,255,255,255,255,255,188,132,79,241,224,207,186,165,119,82,47,255,255,255,255,255,188,132,79,255,255,255,255,255,186,130,68,243,232,219,206,195,172,140,103,243,224,212,199,185,147,136,109,226,208,182,157,119,89,59,33,224,192,160,128,96,64,32,0^216,168,119,58,0,0,0,0,255,255,255,255,255,188,132,79,223,184,144,94,0,35,24,14,255,255,255,255,255,191,135,81,216,168,119,58,0,0,0,0,255,255,255,255,255,183,127,71,216,168,119,58,0,0,0,0,255,255,255,255,255,186,130,68,204,158,102,48,0,0,0,0,236,218,197,189,175,133,125,100,204,168,119,71,0,0,0,0,224,192,160,128,96,64,32,0) => "Rainbow by BoltBait" +elif $pal_scrj36 (15,54,119,185,237,58,132,208,233,237,77,142,203,226,237,26,29,52,151,197,23,32,44,57,143,24,31,50,101,161,55,106,170,226,139,217^16,60,134,202,243,21,35,69,153,211,43,75,138,195,226,68,131,195,230,235,51,91,152,209,235,29,46,100,165,208,24,42,100,165,42,93^26,87,172,231,255,55,80,90,148,209,36,39,60,93,158,76,83,62,114,193,93,143,187,218,234,77,139,205,239,247,96,192,235,247,174,234) => "SCRJ-XXXVI by StudioCRJ" +elif $pal_pxls_default (0,34,85,136,205,255,255,255,182,119,252,252,253,255,190,112,49,11,39,50,136,36,18,38,139,210,255,255,255,240,177,116^0,34,85,136,205,255,213,183,109,67,117,168,232,244,255,221,161,95,126,182,255,181,92,41,47,76,89,169,100,37,18,12^0,34,85,136,205,255,188,131,61,31,16,14,23,145,64,19,23,53,108,159,243,254,199,96,168,233,239,217,116,35,6,0) => "Pxls Default from pxls.space" +elif $pal_moderna (130,179,255,255,255,239,125,32,15,18,32,60,126,216,168,118,69,38,32,83,168,204,242,255^6,8,49,144,207,255,255,217,166,103,156,230,255,255,199,140,82,42,15,21,79,125,200,242^108,91,81,88,108,164,114,126,141,192,223,255,248,250,195,137,80,42,115,166,230,229,155,203) => "Moderna by yedamameday" +elif $pal_oak (248,179,98,174,238,255,177,82,24,32,37,116,86,62,56,129,163,69,110,175,255^135,73,26,57,141,244,211,127,40,67,118,241,149,76,18,74,119,75,120,188,255^61,91,142,172,255,159,110,85,58,74,119,235,217,146,50,84,95,78,128,197,255) => "Oak21 by Dan Oak" +elif $pal_nature55 (27,254,226,168,105,255,231,190,122,208,151,90,255,235,205,104,37,27,123,56,41,37,94,32,38,48,163,120,84,239,182,116,67,255,234,175,117,235,177,227,177,116,62,223,156,97,42,184,117,82,253,204,145,93,56^20,147,83,36,27,191,130,83,50,128,78,48,201,138,224,178,125,78,236,170,119,68,215,150,98,51,204,141,88,161,108,68,47,178,109,64,34,113,65,196,142,100,63,221,170,123,78,216,157,106,245,193,134,91,56^30,90,34,36,40,137,90,64,28,88,73,63,92,6,66,41,44,68,191,145,126,108,239,205,171,134,255,222,192,206,190,141,101,178,157,127,74,113,92,176,142,127,100,154,116,71,50,209,169,152,241,190,146,110,76) => "Nature's Embrace 55 by GrafxKid" +elif $pal_rbypgo (255,255,255,255,255,255,255,255,255,229,203,177,151,125,99,73,255,255,255,255,255,255,255,255,255,229,203,177,151,125,99,73,255,255,255,255,255,255,255,255,255,229,203,177,151,125,99,73,208,182,156,130,78,52,26,0,0,0,0,0,0,0,0,208,182,156,130,104,78,52,0,26,0,0,0,0,0,0,232,219,206,193,180,167,154,141,128,115,102,89,76,63,50,37^255,208,182,156,130,78,52,26,0,0,0,0,0,0,0,0,226,211,196,181,166,151,136,121,106,95,84,73,62,51,40,29,255,255,255,255,255,255,255,255,255,229,203,177,151,125,99,73,232,219,206,193,167,154,141,128,115,102,89,76,63,50,37,214,192,170,148,126,104,82,38,60,34,30,26,22,18,14,208,182,156,130,104,78,52,26,0,0,0,0,0,0,0,0^255,208,182,156,130,78,52,26,0,0,0,0,0,0,0,0,208,182,156,130,104,78,52,26,0,0,0,0,0,0,0,0,208,182,156,130,104,78,52,26,0,0,0,0,0,0,0,0,208,182,156,130,78,52,26,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,229,203,177,151,125,99,232,219,206,193,180,167,154,141,128,115,102,89,76,63,50,37) => "RBYPGO by Marilynx" +elif $pal_new_worlds (110,150,205,226,230,244,248,219,200,171,130,91,51,38,0,18,33,51,76,119,157,203,226,255,249,253,243,155,89,53,42,70,64,52,65,143,79,53,38,29,27,51,102,199,226,238^39,38,36,93,129,170,205,174,144,111,80,55,33,25,0,16,33,52,80,126,161,203,226,255,255,255,246,210,179,130,86,101,137,197,238,200,153,119,90,53,37,26,42,86,132,190^39,38,36,38,39,65,124,101,80,59,46,40,28,24,0,23,44,67,91,134,164,203,226,255,183,144,71,77,65,58,65,115,142,163,149,214,186,163,134,94,78,59,113,190,208,209) => "New Worlds 46 by Count Moriarty" +elif $pal_nauris16 (140,88,62,154,215,245,192,100,228,157,210,112,126,52,23,31^143,69,33,99,155,237,199,125,148,48,100,55,196,133,67,14^174,99,55,72,125,186,65,52,58,59,113,127,193,157,75,28) => "Nauris-16 by Nauris" +elif $pal_dynamite (249,243,232,157,107,110,163,244,249,252,253,251,249,166,111,74,89,96,174,215,191,126,0,39,48,49,40,2,127,192,222,188,123,102,80,110,163,244,249,252^189,121,9,39,43,66,84,96,165,210,226,197,159,116,81,86,125,177,206,230,230,205,175,124,85,84,122,170,202,229,191,125,17,43,45,67,87,101,167,211^180,102,74,76,67,50,42,6,68,163,164,70,10,44,51,79,100,118,124,190,199,142,151,116,87,101,145,207,170,213,196,136,139,110,84,88,118,154,144,200) => "Dynamite by Pixi" +elif $pal_interstate_28 (254,244,244,237,187,144,111,161,218,242,232,193,148,99,35,52,70,90,120,87,58,39,31,71,85,137,161,182^254,234,213,176,94,58,21,25,69,132,103,65,42,22,25,46,83,128,204,163,113,66,42,66,99,149,185,227^223,163,101,72,37,37,25,32,60,108,106,102,94,73,45,76,116,144,185,134,108,75,44,20,46,76,116,179) => "Interstate 28 by maine" +elif $pal_downgraded_32 (123,161,199,227,242,211,175,128,91,65,92,136,184,220,255,182,137,114,92,78,70,68,61,98,148,199,224,242,252,177,128,101^51,77,115,160,203,123,93,64,51,32,72,125,180,218,255,245,217,182,139,102,73,53,0,23,44,66,107,165,239,212,184,141^76,85,105,132,155,134,139,133,116,81,106,141,178,201,224,219,217,207,168,121,105,93,61,72,75,79,81,97,141,128,120,120) => "Downgraded 32 by daniel" +elif $pal_pear36 (94,140,186,242,255,207,143,60,61,50,50,71,75,77,102,255,194,126,96,67,39,62,87,150,227,255,255,235,176,115,66,90,128,189,255,255^49,63,97,166,228,255,222,163,110,62,41,59,91,166,255,255,194,126,96,67,39,35,41,66,105,181,145,86,48,39,36,38,54,72,107,181^91,93,86,94,120,112,93,112,112,79,71,120,171,255,227,235,209,143,112,79,54,71,75,83,86,112,102,75,92,92,69,94,107,130,151,181) => "Pear 36 by PineTreePizza" +elif $pal_pineapple32 (67,137,217,255,255,199,115,52,3,39,69,156,255,255,209,124,49,131,235,255,255,191,109,41,4,3,28,119,255,255,192,96^0,0,36,97,183,110,57,17,7,59,130,185,216,130,64,25,12,63,156,218,255,195,138,59,21,62,146,214,224,136,59,23^42,39,60,87,98,70,46,31,16,45,57,59,50,59,31,26,27,52,110,172,228,198,141,73,40,94,167,193,220,169,148,97) => "Pineapple 32 by PineTreePizza" +elif $pal_peach (253,255,251,206,143,83,173,159,86,10,39,12,172,255,255,255^255,134,71,24,11,3,109,185,127,84,140,231,252,236,167,64^255,134,113,106,95,75,234,255,235,123,127,167,173,109,99,64) => "Peachy Pop 16 by Kerrie Lake" +elif $pal_resurrect (255,251,232,131,195,240,246,252,227,171,150,98,62,11,11,30,145,251,251,205,158,122,107,144,168,234,143,77,77,72,48,143^255,107,59,28,36,79,129,167,200,148,108,85,53,94,138,188,219,255,185,104,69,48,62,94,132,173,211,155,101,74,225,248^255,29,59,93,84,120,129,144,150,122,108,101,70,101,143,115,105,134,84,61,57,69,117,169,243,237,255,230,180,119,185,226) => "Resurrect 32 by Kerrie Lake" +elif $pal_rosy42 (33,59,125,171,207,240,255,200,99,59,47,40,27,43,58,76,79,146,245,223,163,104,64,44,20,75,105,156,204,255,255,255,230,173,120,79,41,61,82,143,189,255^24,32,56,81,117,181,238,212,171,125,87,53,31,43,63,104,164,232,255,224,167,111,73,53,24,29,36,42,47,82,194,137,69,47,29,29,29,41,51,77,106,174^27,39,51,48,43,65,131,93,63,79,83,64,33,69,94,133,184,192,232,232,194,153,115,77,46,82,100,112,123,119,161,51,57,69,79,76,43,54,63,87,98,112) => "Rosy 42 by PineTreePizza" +elif $pal_slso (46,62,85,116,65,42,59,36,86,198,243,196,181,97,143,234,193^44,65,96,125,222,164,119,147,190,222,194,101,65,64,61,97,229^59,95,125,136,149,170,166,55,68,120,32,28,49,122,167,157,234) => "SLSO-CLR17 by Luis Miguel Maldonado" +elif $pal_softy15 (217,241,34,62,190,208,156,14,159,189,101,153,21,64,92^246,218,23,201,211,168,179,168,184,102,113,17,96,19,52^234,4,44,238,220,65,26,74,174,102,64,156,144,109,17) => "Softy 15 by Eggy" +elif $pal_spec12 (15,145,214,217,219,168,120,142,50,47,48,217^8,140,217,209,110,45,28,217,186,99,24,190^8,137,208,93,59,45,38,89,59,189,143,147) => "SPEC12 by Smalls" +elif $pal_roarin80s (164,212,223,78,9,51,1,245^0,62,137,112,23,0,0,193^56,31,46,38,126,67,14,197) => "The Roarin 80's by Malo" +elif $pal_starmancer (27,41,31,37,42,46,50,29,43,71,105,136,170,222,52,81,120,162,190,233,250,77,128,186,228,234,255,255,10,13,7,10,14,8,8,16,21,18,14,12,18,33,38,64,101,132,168,200,221,9,25,83^32,51,68,97,129,162,187,24,32,45,60,70,86,115,19,25,32,40,53,69,106,36,66,95,137,178,227,245,35,64,97,128,158,200,231,32,50,76,112,157,203,233,41,65,106,141,176,205,227,7,26,85^55,98,125,165,203,235,248,38,55,88,129,160,185,223,26,34,41,40,34,37,57,22,39,28,20,8,69,108,31,53,70,87,94,116,123,48,66,93,121,148,175,193,51,76,115,144,179,207,227,17,35,94) => "Starmancer by Ominux Games" +elif $pal_superfuture (16,24,96,183,255,44,150,219,248,192,28,54,112,255,77,97,210,255,228,255,0,0,69,156,255^8,30,111,217,255,25,80,147,218,192,51,105,195,255,77,27,53,128,187,0,255,128,16,9,0^32,51,171,238,255,35,57,87,172,192,45,67,59,0,77,50,47,0,64,64,225,255,126,204,255) => "SuperFuture25 by Endesga" +elif $pal_sunshine_35 (57,88,70,138,235,113,184,207,255,95,164,23,143,66,179,47,9,87,63,204,255,130,236,186,238,169,247,239,251,224,252,131,214,250,255^12,27,85,156,218,68,153,152,221,82,165,92,172,187,240,73,180,60,160,101,176,44,83,48,93,52,93,101,167,109,142,57,133,203,255^20,31,68,115,141,28,61,31,61,26,30,69,43,92,182,131,172,143,211,184,168,123,161,58,131,38,100,68,78,52,38,29,51,103,255) => "SUNSHINE 35 by mysunnyrose" +elif $pal_sweetie16 (26,87,177,238,255,160,56,39,41,64,79,134,244,147,85,50^28,41,65,123,208,240,184,110,54,91,164,236,244,182,113,64^44,86,86,88,121,114,110,123,111,208,247,248,244,193,133,86) => "Sweetie 16 by GrafxKid" +elif $pal_calm48 (201,158,99,64,28,66,125,189,235,250,181,108,49,28,21,14,27,45,108,42,55,81,127,85,53,44,30,39,65,117,161,207,252,232,199,122,255,247,235,222,171,204,250,209,158,104,50,16^52,35,27,22,14,28,46,75,126,177,189,168,131,77,52,34,107,150,189,108,158,213,240,198,143,97,58,28,26,30,32,60,134,86,46,32,217,182,134,91,60,91,239,188,139,96,50,16^38,47,51,42,18,27,30,30,23,60,43,35,47,63,54,41,78,86,42,108,128,152,217,198,176,153,112,64,74,109,122,138,142,137,104,74,173,116,87,71,60,53,230,184,146,107,56,18) => "Calm 48 by Xina" +elif $pal_optimism (255,255,245,242,230,245,237,123,88,171,104,70,37,217,184,99,66,34,193,91,3,21,0,45,60,24,68,146,196,165,112,143^249,228,170,191,141,96,57,53,15,108,76,50,23,139,72,51,47,32,214,202,131,63,161,112,84,63,105,158,190,140,93,119^201,130,33,133,79,55,21,38,11,92,60,32,11,144,105,95,74,56,214,217,191,148,147,116,87,57,39,10,18,39,31,89) => "Optimism by mingapur" +elif $pal_taffy16 (34,98,163,250,255,255,220,63,68,43,167,255,245,219,166,54^37,117,192,255,171,108,67,72,141,219,245,235,137,75,61,53^51,186,230,252,123,122,91,194,231,114,71,51,49,61,87,77) => "Taffy 16 by PineTreePizza" +elif $pal_todayland (20,49,90,148,237,94,174,227,244,69,126,198,240,27,33,52,152,33,38,30,108,68,142,228,242^20,56,103,168,239,22,36,112,191,35,66,119,183,56,103,176,232,35,75,143,213,28,48,98,180^20,61,108,170,239,50,50,23,66,35,58,66,132,69,95,111,138,99,164,222,228,92,127,154,183) => "Todayland Palette V2 by GrafxKid" +elif $pal_trirampo (112,204,232,255,218,93,37,75,47,44,122,174^48,49,125,206,240,212,162,86,50,32,135,194^117,132,67,107,209,119,168,235,143,61,153,194) => "TriRampo by ANoob" +elif $pal_reddit_place_2022 (109,190,255,255,255,255,0,0,126,0,0,0,36,54,81,73,106,148,129,180,228,222,255,255,109,156,255,0,81,137,212,255^0,0,69,168,214,248,163,204,237,117,158,204,80,144,233,58,92,179,30,74,171,16,56,153,72,105,180,0,82,141,215,255^26,57,0,0,53,184,104,120,86,111,170,192,164,234,244,193,255,255,159,192,255,127,129,170,47,38,112,0,82,144,217,255) => "r|place 2022" +elif $pal_tropical_cone_24 (13,46,112,158,242,255,82,135,207,255,255,133,39,20,8,7,21,10,14,16,255,145,91,47^1,2,3,5,66,134,17,65,138,189,255,199,173,120,72,36,4,42,151,206,253,161,106,52^3,19,45,58,27,28,4,7,10,74,115,58,29,67,77,66,56,148,196,227,227,159,115,64) => "Tropical Cone 24 by yedamameday" +elif $pal_vivid17 (7,45,60,74,129,49,85,247,226,255,200,149,241,120,83,98,170^8,39,73,74,97,145,246,255,190,223,107,39,89,85,111,149,231^24,71,101,168,197,231,255,224,87,49,54,74,169,55,97,60,93) => "Vivid-17 by Irenaart" +elif $pal_shido76 (0,1,11,15,92,191,3,2,23,50,109,172,72,105,134,172,215,255,139,176,210,238,176,219,255,72,112,169,222,255,255,146,182,224,255,53,93,134,178,217,255,185,220,20,19,32,44,65,121,51,90,117,181,255,224,183,148,114,75,40,1,31,61,90,127,166,209,166,127,90,55,21^43,77,114,158,208,255,43,76,114,156,205,250,25,42,65,95,138,189,67,101,142,193,105,156,218,0,10,18,87,152,198,28,52,105,165,21,26,45,76,123,188,82,128,24,54,87,137,191,250,97,150,197,250,255,212,168,134,101,64,31,0,31,63,97,135,178,219,179,141,105,66,33^35,60,64,52,66,101,52,75,98,112,151,193,38,48,65,95,127,164,59,80,109,155,62,67,55,39,58,48,50,47,104,61,66,92,127,80,107,120,144,166,205,117,142,80,125,153,179,208,235,153,179,208,242,255,206,165,135,105,70,38,1,49,73,105,141,179,218,167,131,97,64,32) => "SHIDO50+ by Shidoengie" +elif $pal_intacto (34,75,135,203,98,86,91,214,242,237,171,82,55,140^21,85,155,245,180,96,41,69,115,187,99,33,173,222^41,97,163,239,222,214,166,98,92,142,117,82,162,140) => "Intacto14 by Anoob" +elif $pal_itatsi (0,30,65,133,190,255,160,105,76,48,110,194,230,255,255,196,143,99,51,57,72,132,196^0,30,69,124,194,249,222,160,81,34,47,78,136,171,216,148,91,60,40,71,115,158,196^0,36,67,123,184,240,218,199,133,64,77,78,85,172,158,124,76,44,31,46,85,92,135) => "Itatsi by SoundsDotZip" +elif $pal_enos16 (250,212,157,75,249,234,249,231,154,88,141,68,195,149,186,148^250,212,157,75,211,175,147,89,209,174,237,197,167,105,181,142^250,212,157,75,129,77,138,82,249,238,167,91,225,200,170,130) => "ENOS16 by Endesga" +elif $pal_grixel_grotto (9,59,29,121,69,94,115,158,49,50,126,224,168,184,232,255^87,140,171,194,73,113,138,174,114,151,168,243,145,167,218,246^18,80,62,103,156,235,255,255,212,214,230,255,13,59,127,189) => "Grixel Grotto by Northernite" +elif $pal_sup8 (246,238,237,61,8,119,230,0^250,234,196,156,145,107,40,8^255,24,149,9,205,125,0,0) => "Superb 8 by BigPotato" +elif $pal_undertones (20,65,58,53,143,94,69,220,255,255,204,161,164,244,194,129,188^25,65,127,227,217,187,131,211,254,208,146,92,47,91,73,88,176^35,104,167,227,112,73,82,123,229,53,69,62,59,122,152,141,194) => "Undertones-17 by Irenaart" +elif $pal_tango (252,237,196,252,245,206,233,193,143,138,115,78,114,50,32,255,173,117,92,239,204,164,238,211,186,136,85,46^233,212,160,175,121,92,185,125,89,226,210,154,159,101,74,255,127,80,53,41,0,0,238,215,189,138,87,52^79,0,0,62,0,0,110,17,2,52,22,6,207,164,135,255,168,123,102,41,0,0,236,207,182,133,83,54) => "Tango by Duck" +elif $pal_cheese (57,247,255,255,168,221,255,255,192,214,254,64,111,117,145,178,197,223,33,42,103,136,108,240,239,12,62,91^21,178,216,245,34,73,119,150,82,139,192,91,120,70,117,148,188,214,62,102,145,172,14,27,70,49,98,138^19,59,96,148,0,0,0,20,54,103,125,62,68,36,53,92,160,202,72,113,133,151,0,15,46,2,0,44) => "Cheese Palette by Gors" +elif $pal_equpix15 (82,42,62,132,56,92,16,178,212,85,128,236,139,255,255^60,42,84,84,96,122,16,126,78,168,172,138,208,204,248^78,58,66,92,124,86,36,86,82,148,64,75,186,104,192) => "Equpix 15 by Night" +elif $pal_zu32 (71,94,122,160,191,238,244,182,113,57,60,48,90,125,160,207,223,138,40,57,57,57,86,142,205,255,244,244,230,169,130,79^45,54,68,91,121,161,204,213,170,123,89,44,83,112,147,198,246,235,204,120,71,49,64,71,96,174,180,126,72,59,112,84^60,67,74,83,88,96,161,60,52,68,86,46,83,113,142,184,245,241,223,168,120,75,100,140,147,182,27,27,46,59,148,107) => "Zughy 32 by Zughy" +elif $pal_voodo (17,55,98,131,189,28,45,90,141,51,106,164,236,41,20,85,160,58,128,244,107,198,248,254,199,225,232,242,58,101,134,122,185,248^20,61,103,142,208,33,66,119,201,39,68,103,152,72,157,191,231,195,243,251,24,34,66,149,45,93,147,216,34,50,82,98,137,208^38,95,137,168,239,83,128,185,242,93,138,195,247,74,99,65,114,144,181,248,48,78,132,205,30,44,31,51,34,35,52,64,104,148) => "Voodo34 by Shamaboy" +elif $pal_franzston_30 (243,174,154,90,49,254,214,186,125,73,250,186,125,80,36,204,126,86,56,32,130,102,68,71,45,223,147,51,55,43^232,141,86,56,29,241,179,134,83,44,251,194,118,81,36,231,178,154,90,49,190,180,162,114,69,243,170,104,84,58^237,153,118,69,35,223,147,98,36,2,222,142,68,56,19,208,144,117,58,29,216,210,190,120,73,254,214,178,125,89) => "Franzston 30 by Virus610" +elif $pal_night16 (15,255,12,72,121,176,101,63,185,255,221,154,100,51,118,197^15,248,33,88,160,206,127,69,157,221,148,81,75,48,112,163^30,188,51,109,176,157,73,54,106,145,91,66,72,51,136,179) => "Night 16 by Night" +elif $pal_star29 (142,241,83,44,13,27,37,45,54,92,255,179,116,68,32,186,236,123,81,50,108,211,63,33,96,175,53,34,17^36,34,31,18,18,29,49,71,109,196,255,179,122,76,40,93,129,57,37,22,50,60,38,24,163,239,109,68,31^54,60,40,29,25,70,105,141,192,249,255,225,165,108,56,47,47,42,32,21,150,242,104,57,61,73,50,43,25) => "Star 29 by Starlane" +elif $pal_star34 (13,27,63,108,211,240,255,241,142,83,44,37,45,54,92,179,116,68,32,50,81,123,170,217,238,255,245,236,186,17,34,53,96,175^18,29,38,50,60,104,255,34,36,31,18,49,71,109,196,179,122,76,40,22,37,57,100,153,202,206,158,129,93,31,68,109,163,239^25,70,104,150,242,125,255,60,54,40,29,105,141,192,249,225,165,108,56,21,32,42,57,90,146,95,63,47,47,25,43,50,61,73) => "Star 34 by Starlane" +elif $pal_stilllife (63,122,209,224,93,104,179,18,81,40,155,168,204,199^40,34,59,127,133,193,232,38,49,111,139,228,130,181^17,34,39,138,58,39,104,21,85,184,255,212,24,129) => "Still-Life by cure" +elif $pal_simjpc16 (5,34,84,155,225,245,254,139,124,103,49,64,161,165,154,234^4,31,53,110,176,238,254,225,194,143,111,74,77,104,147,145^3,49,22,45,71,155,254,224,100,203,35,104,63,212,183,130) => "SimpleJPC-16 by Adigun A. Polack" +elif $pal_acid15 (23,64,143,211,128,55,227,244,28,9,28,33,201,181,192^3,7,30,96,128,190,218,249,13,68,81,151,130,215,248^38,61,64,54,128,161,120,210,89,64,130,59,155,55,175) => "Acid 15 by pyrometal" +elif $pal_battery24 (248,51,87,120,143,166,217,224,230,232,232,226,252,118,58,201,181,65,70,76,73,70,66,48^255,36,55,68,71,76,87,70,99,152,203,237,255,232,224,250,242,196,179,144,119,98,74,48^186,49,82,101,106,108,124,70,76,81,88,130,222,86,86,117,107,124,142,161,145,135,112,66) => "Battery 24 by Battery Jellyfish" +elif $pal_clump18 (112,178,224,236,236,179,123,96,73,38,70,86,120,181,231,219,184,153^26,42,132,188,229,203,130,26,17,24,32,76,127,197,232,192,131,78^106,121,172,210,255,255,254,188,115,29,27,56,83,155,183,158,71,46) => "Clumpy 18 by windfall.apples" +elif $pal_cthul (29,165,240,82,43,30,59,82,125,199,184,126,143,229,206,133^37,229,250,165,98,48,66,123,193,255,203,141,169,222,160,71^49,197,253,147,103,58,81,146,193,243,216,161,144,187,97,49) => "Cthulhu by Starlane" +elif $pal_crimso11 (255,243,191,118,203,142,122,94,142,134,69,61,53,35,65,17^255,215,150,154,94,57,73,69,195,118,110,98,61,46,41,11^227,98,81,85,49,61,98,49,207,150,81,134,90,50,45,17) => "Crimso 11 by Crimso" +elif $pal_coptec (0,38,53,96,137,90,145,255,244,191,197,158,95,220,110,22^0,33,82,116,137,168,217,255,205,181,136,91,67,57,169,81^0,68,120,138,137,178,243,255,114,136,67,71,81,45,44,221) => "Copper-Tech by Arne Niklas Jansson" +elif $pal_drz15 (20,57,102,165,216,242,255,255,81,83,128,133,164,255,207^20,47,72,93,114,154,227,255,90,127,130,171,219,191,238^25,71,81,82,114,128,91,238,142,59,126,221,114,252,247) => "DRZ15A by Drazille" +elif $pal_eggy15 (46,14,70,73,240,202,60,196,158,246,43,234,175,221,249^64,12,9,82,242,30,155,27,126,52,207,157,216,212,217^61,27,161,102,208,15,135,227,116,104,242,24,126,203,85) => "Eggy 15 by Eggy" +elif $pal_europa (255,117,49,40,26,46,79,164,236,148,59,32,81,164,220,240^255,206,122,55,27,53,102,188,248,212,120,50,32,62,125,204^255,234,215,133,53,78,120,194,96,70,80,46,49,75,94,144) => "Europa 16 by Starlane" +elif $pal_greyt (87,132,207,248,141,105,209,255^67,136,211,200,219,207,179,142^104,211,193,104,52,239,255,101) => "GreyT-bit by Sam Keddy" +elif $pal_jewel (50,102,184,210,242,240,223,188,121,86,74,77,115,116,156^30,36,40,106,197,232,183,123,65,96,143,193,227,130,172^45,49,28,18,60,156,127,98,107,148,169,179,123,161,186) => "Jewel by AprilSundae" +elif $pal_polar11 (10,171,209,245,245,135,153,95,51,45,47^10,41,105,202,241,140,194,148,157,98,43^10,41,31,47,237,129,78,72,181,150,107) => "Polar 11 by Smalls" +elif $pal_sheltzy (140,69,131,201,70,21,44,34,86,139,204,255,204,163,104,0,56,102,139,156,94,57,128,195,255,189,236,255,255,255,244,255^255,184,151,236,198,137,91,42,106,171,226,219,172,109,60,0,0,59,114,216,150,83,12,75,148,31,97,164,246,218,176,255^222,179,64,133,87,104,109,92,137,191,225,165,104,62,52,0,44,147,222,252,221,192,83,145,179,63,74,104,174,112,60,255) => "Sheltzy 32 by Please Check - NatTorpedia" +elif $pal_wyrm (27,64,131,188,209,233,255,81,104,110,151,216,246,31,51,73,127,195,121,186,86,162,209,251^2,47,63,110,96,145,220,48,71,30,29,53,165,44,64,90,130,198,101,168,73,142,198,245^3,50,57,90,63,78,148,76,99,62,40,44,122,55,89,111,133,187,70,98,82,141,183,220) => "Wyrm 24 by FrogWyrm" +elif $pal_yume_nikki (255,232,0,89,185,236,240,255,187,132,68,19,27,58,108,174,236,135,104,62,11,47,86,98^255,22,0,40,69,104,163,201,162,103,53,21,21,49,80,151,208,97,54,17,54,66,116,209^255,35,0,62,98,124,210,197,211,166,85,35,22,51,80,99,95,33,43,28,11,64,44,220) => "Yume Nikki by Space Sandwich" +elif $pal_rube_goldberg (225,243,203,240,206,240,4,84,35^225,215,190,189,108,52,176,160,39^223,84,173,138,55,40,216,79,34) => "Rube-Goldberg" +elif $pal_boomboom (0,36,255,190,68,49,27^0,36,255,38,137,162,38^0,35,255,51,26,242,50) => "BoomBoom by Salman_Shh" +elif $pal_g8 (28,237,161,243,238,45,64,37^17,236,59,127,150,83,169,166^33,233,59,154,26,101,51,197) => "Generic-8 by GrafxKid" +elif $pal_crayola (142,202,255,252,147,181,2,0,255^49,52,145,214,223,179,164,70,255^121,53,164,103,184,92,211,140,255) => "Crayola Blind" +elif $pal_matriax8c (240,250,16,0,210,160,115,16^240,200,200,160,64,105,100,24^220,0,64,200,64,75,100,32) => "Matriax8c by Davit Masia" +elif $pal_nt1h (255,172,70,21,34,66,101,143,189,171,139,86,56,255,237,222,194,75,138,188,228,255,156,94,57,25^255,246,198,137,47,93,144,185,223,209,171,106,58,241,198,153,94,0,0,19,54,154,216,150,83,21^255,147,87,104,70,105,139,172,204,210,191,137,99,141,96,60,34,59,71,52,54,112,252,221,192,127) => "NT1H by NatTorpedia" +elif $pal_jerrypie22 (30,36,55,156,220,196,147,121,82,157,118,41,52,64,114,83,207,224,210,53,25,85^36,81,150,198,239,215,121,65,60,125,68,71,119,213,178,137,190,110,57,41,23,46^49,104,155,217,248,164,70,34,32,174,110,45,80,142,69,71,91,54,28,29,22,65) => "JerryPie 22 by JerryPie" +elif $pal_nineties_nine (30,111,175,161,99,44,18,201,192^28,112,179,136,67,44,133,125,34^33,120,184,192,141,201,35,44,81) => "Nineties Nine by Cubby Crazes" +elif $pal_on70 (105,125,143,163,179,194,210,99,112,125,140,153,166,179,87,102,117,133,150,163,176,29,42,47,61,75,96,117,45,50,57,61,83,94,114^6,16,29,44,61,79,100,33,45,57,73,89,104,121,33,50,73,98,125,142,165,30,50,63,91,114,142,169,97,112,130,143,163,168,184^83,89,88,92,96,100,113,33,45,57,73,89,104,121,15,23,36,50,69,85,104,97,112,117,133,150,168,186,26,38,49,64,95,110,135) => "On70 by By8Bits" +elif $pal_anb16 (10,105,223,247,212,120,232,242,255,136,63,55,72,113,158,77^8,117,233,170,104,44,53,130,199,196,158,52,84,153,82,37^13,148,245,168,154,150,98,92,110,77,89,97,168,217,82,54) => "ANB16 by Anoob" +elif $pal_retrocal (110,42,116,252,198,47,119,238^184,88,163,255,80,20,68,156^168,79,63,192,90,47,72,93) => "Retrocal-8 by polyphrog" +elif $pal_punolit (202,114,68,46,30,20,7,9,18,47,75,145,230,220,183,153,107,49,58,110,151^235,154,96,56,24,8,1,24,55,107,151,185,226,205,131,81,44,14,33,63,87^224,161,119,80,46,26,9,32,53,78,79,91,158,147,107,84,64,37,64,95,108) => "Punolit by Punoli" +elif $pal_luap_40 (89,109,134,181,224,240,230,217,196,189,140,115,102,51,67,70,84,102,130,161,194,245,218,191,163,136,109,81,54,26,51,64,87,115,179,217,230,217,201,191^112,161,191,217,230,235,204,159,115,85,63,52,41,26,48,74,103,153,181,213,242,245,218,191,163,136,109,81,54,26,41,51,70,95,147,184,212,184,143,105^128,138,143,163,195,192,161,130,108,95,82,83,76,51,87,115,153,204,217,230,242,245,218,191,163,136,109,81,54,26,31,38,57,75,116,152,195,173,143,121) => "Luap 40 by Luap" +elif $pal_autumvil6 (73,137,242,169,94,35^17,88,244,146,80,32^28,97,243,125,63,26) => "Autum Villan 6 by Chase Stemel" +elif $pal_au15 (102,0,51,85,136,170,187,255,255,85,153,102,187,68,17^102,17,17,0,34,102,153,221,255,85,153,119,221,51,34^119,34,17,0,17,34,119,187,238,51,68,170,255,68,68) => "Autum 15 by jok" +elif $pal_au15y (85,136,204,221,255,221,153,85,255,187,102,102,68,34,17^0,34,136,187,221,204,153,85,255,221,119,102,51,51,17^0,17,68,153,187,119,68,51,238,255,170,119,68,85,34) => "Autum 15 [Yellow] by jok" +elif $pal_galaxy_flame (105,58,43,17,21,29,49,79,154,237,245,232,182,112,64,21^159,112,69,18,29,50,78,93,159,230,216,178,131,77,35,16^173,142,79,21,26,48,63,66,135,203,147,111,76,43,30,21) => "Galaxy Flame by Rhoq" +elif $pal_antiquity16 (32,45,69,109,177,232,232,93,142,112,138,229,241,210,222,232^32,33,41,61,107,159,190,117,146,123,167,93,134,103,154,216^32,30,35,41,74,110,130,87,87,136,172,77,108,48,40,165) => "Antiquity16 by ILTA" +elif $pal_mushroom (46,69,122,153,205,251,242,176,153,102,68,87,120,169^34,41,48,61,104,185,236,169,127,89,56,96,138,178^47,63,69,65,61,84,139,135,115,100,70,105,135,162) => "Mushroom by Jimison3" +elif $pal_aerugo (47,79,114,149,199,231,147,162,200,245,107,129,170,255,209,186,137,104,85,60,52,135,100,70,47,36,27,170,145,134,113,94^30,51,54,57,85,109,78,102,125,169,139,163,195,255,208,183,138,100,77,61,50,209,161,100,72,46,32,156,127,98,91,72^26,34,39,44,51,70,40,60,64,91,140,142,158,255,206,178,138,97,75,59,48,239,194,128,92,53,38,138,109,74,72,53) => "Aerugo by Lizalot" +elif $pal_hotel_paintings (246,247,245,242,132,60^189,237,202,132,165,55^96,226,195,130,157,68) => "Hotel Paintings 6 by Chase Stemel" +elif $pal_nopal (226,197,168,146,255,251,241,204,241,228,202,171^228,207,181,146,236,212,180,163,234,219,193,164^223,196,174,156,237,210,180,163,182,160,138,123) => "Nopal-12 by BlackedIRL." +elif $pal_gpy (170,237,235^212,168,224^179,162,133) => "Brightness GPY by rickthepalette" +elif $pal_blessing (116,150,247,255,216^86,251,255,179,191^155,199,174,203,216) => "Blessing by Maruki" +elif $pal_fairydust_8 (240,227,196,99,100,43,147,240^218,154,93,75,97,169,212,246^177,172,159,125,194,180,181,232) => "Fairydust 8 by Yousurname" +elif $pal_fuzz4 (48,255,0,255^35,55,250,253^135,150,172,175) => "Fuzzy Four by P-Tux7" +elif $pal_fairy (14,210,77,255,75,131,112,173^48,0,217,230,49,96,143,184^166,0,40,0,89,111,77,112) => "Fairy Tales by lollige" +elif $pal_naji16 (16,61,100,72,63,106,116,89,183,141,100,192,200,220,242,230^26,14,17,46,66,52,67,85,62,109,150,113,146,162,201,209^58,38,61,105,90,101,74,121,98,156,124,159,108,134,102,213) => "Naji 16 by Naji" +elif $pal_easter (246,230,134,121,245,237,204,202,57,141,129,104,157,126,86,5^246,209,134,71,225,195,141,101,212,188,132,96,192,167,120,22^191,209,145,101,122,141,134,126,185,210,171,134,133,136,100,37) => "Easter Island by skamocore" +elif $pal_pastel_and_darks58 (248,231,165,119,76,44,247,234,165,119,77,234,166,121,76,44,33,243,225,156,110,69,39,29,196,127,58,28,4,0,130,46,22,148,101,66,48,24,5,121,74,24,9,0,3,130,74,54,28,190,159,95,64,237,217,152,109,36^183,134,71,34,17,3,197,165,89,62,35,212,141,97,60,34,26,247,234,165,120,78,44,33,247,235,167,119,77,43,235,165,121,225,204,144,105,65,36,179,147,88,59,35,0,118,64,46,22,163,123,61,38,193,148,97,58,7^181,130,66,30,14,0,165,121,39,27,9,134,53,15,4,0,0,217,160,90,35,15,0,0,213,163,94,58,29,15,221,150,108,246,233,166,121,77,33,247,234,165,119,77,43,234,165,120,76,248,234,167,121,248,234,166,121,42) => "Pastel and Darks 58 Palette by Glxss" +elif $pal_pastel17 (55,104,94,37,17,105,239,248,163,109,161,249,200,247,155,28,89^50,53,107,113,171,246,240,229,231,68,101,139,76,145,156,134,177^84,111,130,140,190,191,215,116,92,66,87,183,102,82,130,109,94) => "17 Pastels by Irenaart" +elif $pal_nostalgia15 (239,246,248,239,199,80,113,151,117,128,196,116,24,70,136^208,217,161,99,85,23,50,94,91,143,187,168,111,164,175^174,55,83,97,94,51,60,94,108,170,184,162,94,95,146) => "NOSTALGIA15 by Arisuki" +elif $pal_ocaso (75,126,207,243,250,185,126,82,76,118,98,203,254,255,191,152,146^65,89,104,147,218,199,182,166,119,109,87,129,142,249,240,184,153^74,86,90,106,109,115,120,126,104,109,96,119,143,187,240,209,173) => "Ocaso by Minord" +elif $pal_pastel (252,252,250,255,247,163,128,87,81,112,109,88,132,190,222^153,189,230,247,246,217,217,207,192,165,116,68,89,87,118^119,144,170,213,166,106,155,201,219,212,207,120,201,194,165) => "Oh Hell, Pastel by StarlitSunset" +elif $pal_pollen8 (115,171,238,255,255,255,114,52^70,86,106,167,224,231,220,172^76,117,124,165,126,214,187,186) => "Pollen-8 by Conker" +elif $pal_kule (41,117,174,229,233,255,255,255,242,124,56,62,101,198,248,176^20,51,95,105,142,159,185,205,241,227,217,161,98,119,167,156^13,85,80,78,112,43,134,44,213,252,137,216,189,234,212,184) => "KULE-16 by Cuymacu" +elif $pal_hydrangea (65,111,152,192,212,234,201,144,111,98,87^54,87,111,144,190,228,212,192,145,119,95^82,126,156,167,184,221,184,160,156,140,126) => "Hydrangea 11 by Dinchen's Art" +elif $pal_fluffy8 (147,255,255,255,212,150,118,68^58,149,196,236,213,179,121,56^99,177,207,240,246,253,219,122) => "Fluffy8 by vee" +elif $pal_st8rb (26,77,179,242,133,51,20,10^9,19,36,97,177,92,31,10^8,19,45,116,242,204,102,26) => "ST 8 R&B Remake by Skiller Thomson" +elif $pal_neon_space (223,254,255,255,255,11,1,1,62,53^7,84,158,208,253,255,203,136,50,42^114,111,125,128,255,230,207,165,100,85) => "Neon Space by Jimison3" +elif $pal_cyclope6 (65,99,50,11,14,48^29,27,83,138,175,225^49,52,95,143,155,185) => "Cyclope6 by Royal_Naym" +elif $pal_sy17 (253,37,128,187,111,57,62,76,153,218,193,179,102,2,68,144,198^253,42,128,191,160,114,93,143,191,213,162,112,64,2,64,95,141^248,140,128,221,192,190,88,73,105,115,167,182,150,7,34,63,65) => "Sy17 by xaiue" +elif $pal_syz15 (14,157,242,176,201,216,82,14,104,141,18,83,34,18,34^12,31,140,86,173,225,180,79,6,90,111,38,20,47,52^25,47,140,33,35,169,102,56,47,136,126,154,82,112,33) => "Syz15 by Fusionnist" +elif $pal_tui15 (29,19,23,70,120,16,21,162,43,240,178,197,240,124,226^13,34,55,58,77,66,112,109,161,176,162,180,194,219,231^13,66,39,49,48,172,155,61,195,63,131,208,152,207,249) => "TUI-15 by Jeremy" +elif $pal_cave (0,16,54,68,143,199,156,245^0,0,29,63,86,144,228,245^0,41,35,79,179,101,199,245) => "Cave by PineTreePizza" +elif $pal_psygnosia (0,27,54,68,82,100,115,119,158,203,224,162,0,8,84,81^0,30,39,63,82,100,97,120,164,232,139,50,51,74,106,108^0,41,71,65,76,124,80,91,167,247,121,78,8,60,0,191) => "Psygnosia by Arne Niklas Jansson" +elif $pal_marshmellow32 (43,58,87,140,63,85,118,164,89,115,140,184,193,175,144,113,60,84,161,182,226,178,124,75,60,78,110,143,32,35,45,94^63,83,121,166,62,87,127,171,50,65,80,122,188,164,123,85,60,74,98,130,181,178,124,80,58,60,77,97,65,91,128,179^65,86,125,151,32,53,69,121,52,65,77,102,172,145,103,74,60,68,59,65,95,178,124,83,63,92,126,154,91,124,166,188) => "MarshMellow32 by FormalPrejudice" +elif $pal_lost_century (182,210,198,188,184,147,105,81,73,91,113,136,154,97,141,170,175,138,102,81,75,171,132,108^92,201,164,133,99,78,67,62,52,69,98,131,155,92,121,143,179,153,132,108,90,155,120,89^95,165,130,99,67,72,67,69,61,95,125,152,167,80,78,104,129,109,95,94,87,142,117,92) => "Lost Century 24 by CalmRadish" +elif $pal_finlal11 (23,83,34,175,59,35,159,136,189,203,228^20,12,53,52,102,132,132,158,160,201,229^25,30,85,81,136,51,116,183,188,144,241) => "Finlal 11 by Finlal" +elif $pal_industrial_factory (222,151,103,182,177,151,144,94,129,95,129,104,83,61,47,0^206,182,135,168,134,119,84,74,135,93,144,101,74,68,44,0^180,193,130,123,82,96,77,72,101,79,77,68,59,59,39,0) => "TY - Industrial Factory 16 by Toby_Yasha" +elif $pal_murder_mystery (222,156,128,83,224,161,120,62,187,122,75,187,141,94,121,99^206,171,128,74,155,125,92,43,143,98,65,100,62,41,146,96^180,177,120,59,77,55,59,34,107,96,88,58,41,47,64,46) => "TY - Murder Mystery 16 by Toby_Yasha" +elif $pal_fatedestiny (223,139,114,65,166,74,94,213,191,120,74,0^216,195,133,67,170,151,109,169,106,61,65,0^192,202,130,90,98,92,44,58,50,53,38,0) => "TY - Fate & Destiny 12 by Toby_Yasha" +elif $pal_vinik24 (0,111,154,197,139,195,165,102,154,194,124,65,141,190,104,56,110,147,110,85,157,126,93,67^0,103,154,204,85,136,147,96,79,141,161,106,98,149,172,112,105,161,170,112,159,158,104,52^0,118,151,184,128,144,165,146,80,117,192,163,104,92,169,128,98,103,120,100,127,153,114,85) => "Vinik 24 by Vinik" +elif $pal_ykb22 (207,156,40,72,128,184,210,210,231,128,116,104,74,83,165,141,71,64,174,207,138,169^207,156,37,46,74,146,183,194,229,120,91,74,104,161,199,169,126,72,134,157,95,119^201,151,42,43,62,134,174,174,209,104,65,69,93,112,135,174,136,89,178,185,103,119) => "YKB-22 by yahkehbu" +elif $pal_halloween (23,41,59,88,89,153,162^19,27,29,54,88,139,163^24,23,54,57,77,116,220) => "Halloween by Mememellow" +elif $pal_graveyard (133,163,190,138,118,27,48,69,91,117,143,166,141,118,101,79,108,123,131,159,189^122,138,181,105,91,26,45,60,77,99,122,147,127,116,104,85,111,132,135,168,201^104,121,144,102,98,31,51,73,94,118,141,160,152,136,111,79,101,122,152,179,206) => "Graveyard-21 by AprilSundae" +elif $pal_steamlords (33,58,79,161,119,119,96,59,23,47,67,79,101,124,160,192^59,96,119,159,116,92,59,33,14,33,58,82,115,148,185,209^37,74,84,124,79,79,58,55,25,59,96,119,140,161,186,204) => "Steam Lords by Slynyrd" +elif $pal_frostical (88,56,35,16,2,47,104,136,176,215,70,96,130,152,33,66,135,168^132,85,53,25,1,50,120,159,192,221,70,105,146,176,21,44,96,133^132,96,67,41,7,98,156,179,201,223,84,123,165,193,56,91,144,168) => "Frostical by yedamameday" +elif $pal_deuterospill (21,24,29,69,109,127,150,172,203^52,60,73,88,110,128,153,178,213^87,92,97,93,70,104,142,177,252) => "DeuteroSpill by Royal_Naym" +elif $pal_cool_bone_7 (44,139,196,75,34,18,42^73,151,196,79,39,17,19^88,156,196,77,37,19,30) => "Cool Bone 7 by Chase Stemel" +elif $pal_muted_ally_6 (44,122,150,127,217,235^44,122,176,106,199,231^57,147,179,98,180,229) => "Muted Ally 6 by Chase Stemel" +elif $pal_ephemera (57,74,90,98,115,131,131,164,197,213,222,230^44,60,85,105,129,137,145,157,178,190,214,234^49,74,90,106,123,139,139,164,189,205,222,238) => "EPHEMERA by K C" +elif $pal_ink (31,65,89,150,234^31,58,96,162,240^41,66,112,179,216) => "Ink by AprilSundae" +elif $pal_violet_dreams (237,212,168,94,35,19,1,0^233,191,113,64,27,37,28,0^213,186,131,94,69,51,28,0) => "Violet Dreams by Solitaire" +elif $pal_tinyfolks (255,139,77,48,31^255,149,83,51,31^255,109,60,41,31) => "Tinyfolks by Pierr Vandermaesan" +elif $pal_old_gold_7 (52,74,133,168,185,88,62^52,74,127,159,170,54,20^50,72,92,104,148,68,55) => "Old Gold 7 by Chase Stemel" +elif $pal_rosemoss (10,85,171,177,200,100,88,45^13,40,59,116,172,108,74,41^17,4,30,61,147,94,23,28) => "Rosemoss-8 by polyphrog" +elif $pal_aaprad (7,33,82,138,193,234,160,83,66,89,107,184,121,87,148^5,25,58,107,156,219,179,124,60,111,185,170,112,98,91^5,25,42,62,77,116,53,68,86,175,182,176,126,122,40) => "AAP-RadiantXV by Adigun A. Polack" +elif $pal_aapmaj (244,177,109,49,15,118,173,212,234,151,88,43,56,44,108,118,196^243,137,83,35,12,38,80,147,207,171,120,64,78,153,220,56,84^222,97,79,44,15,38,35,34,90,57,42,36,150,204,213,88,113) => "AAP-Majesty XVII by Adigun A. Polack" +elif $pal_dead_weight_8 (73,138,222,164,144,36,93,144^84,142,191,101,46,23,69,124^53,72,137,62,41,27,62,104) => "Dead Weight-8 by polyphrog" +elif $pal_mojave (220,200,174,145,96,64,56,75,121,158,190,164,113,69,63,46,23,84,208,251^209,180,176,150,96,63,53,68,98,134,150,104,90,62,41,21,9,30,60,166^184,150,178,160,106,74,62,76,93,118,104,72,59,42,38,21,12,19,50,76) => "Mojave20 by magodellepercussioni" +elif $pal_pet8 (10,24,39,71,123,197,239,248^10,27,47,83,128,175,217,244^16,34,59,78,70,99,141,228) => "Petite-8 by Adigun A. Polack" +elif $pal_pet8d (7,13,22,39,75,119,160,187^8,15,28,43,74,97,124,154^16,17,32,41,39,49,67,103) => "Petite-8 Afterdark by Adigun A. Polack" +elif $pal_xaiue_rad (241,222,199,140,124,108,69,44,106,173,222,163,204,123,73,22,45,62,118,169,161,95^239,215,164,123,90,71,56,30,103,139,213,121,188,108,71,18,47,79,130,172,148,102^183,92,57,38,38,43,29,18,58,69,170,99,142,92,63,18,59,128,158,183,143,121) => "XAIUE-Radiant by xaiue" +elif $pal_daruda (222,15,35,64,86,112,109,129,146,159,176,185,191,207,213,224,232,232,231,231,232,231^229,14,10,0,0,13,41,50,61,74,83,105,129,146,166,188,207,227,232,160,169,181^217,19,41,45,44,26,28,33,19,20,2,21,9,19,39,37,80,111,141,121,163,198) => "Daruda 22 by daruda" +elif $pal_firestorm (27,70,249,253,236,255,255,253,255^32,52,94,75,103,132,161,222,236^50,74,62,53,86,95,95,133,179) => "Firestorm by theartistjulian" +elif $pal_borkfest (223,235,243,255,202,150,58,32^215,194,153,120,90,60,40,34^133,117,73,49,46,60,2,21) => "Borkfest by まるき" +elif $pal_spicy_07 (237,222,210,192,165,123,78^205,146,91,55,32,14,12^110,61,26,22,23,16,22) => "Spicy 07 by green guy" +elif $pal_rust6 (35,113,165,225,240,255^0,47,73,136,187,226^0,48,50,102,156,198) => "Rust-6 by Blue Phoenix" +elif $pal_apricot (59,115,183,228,255,255^37,80,107,131,159,255^36,68,83,98,114,213) => "Apricot by Chase Stemel" +elif $pal_supernova7 (26,61,84,119,167,207,255^8,32,50,58,82,120,206^14,59,70,77,82,98,156) => "SuperNova 7 by Blue Phoenix" +elif $pal_pastry (249,231,208,160,91^241,196,147,94,49^195,126,62,44,37) => "Pastry by MirruTatep" +elif $pal_sandy_06 (231,227,206,101,52,14^217,186,129,48,20,7^156,102,44,25,14,5) => "Sandy 06 by green guy" +elif $pal_illumination (240,231,128,84,32^242,196,114,65,23^202,136,131,88,43) => "Illumination by MirruTatep" +elif $pal_nyx8 (8,15,32,246,195,153,129,78^20,42,57,214,163,117,98,73^30,63,79,189,138,119,113,95) => "NYX8 by Javier Guerrero" +elif $pal_dreamhaze (60,110,160,206,214,221,234,244^66,81,101,121,143,162,196,223^196,200,205,210,184,163,174,190) => "Dream Haze 8 by Klafooty" +elif $pal_oil6 (39,73,139,198,242,251^39,77,109,159,211,245^68,126,156,165,171,239) => "OIL6 by GrafxKid" +elif $pal_regal (232,222,190,136,96,223,198,162,122,43^193,158,119,75,44,132,81,62,54,32^112,65,43,43,44,165,151,140,123,66) => "Regal10 by JRiggles" +elif $pal_softdemon (244,229,212,169,126,47,54^208,220,160,92,24,36,57^111,222,167,92,17,44,59) => "Soft Demon 7 by Chase Stemel" +elif $pal_sgm (17,51,68,102,102,119,187,221,255,255,255,255,255,187,119,170,221^17,17,34,68,85,136,187,221,238,238,204,136,51,68,68,102,153^17,51,85,119,187,255,255,255,255,153,102,119,136,102,85,102,136) => "SGM-Palette 2 by s.g.m" +elif $pal_midnight_ablaze (255,213,124,70,49,31,19^130,60,24,14,5,5,2^116,106,60,43,30,16,8) => "Midnight ablaze by Inkpendude" +elif $pal_black_cherry (217,177,122,82,43^93,47,31,25,18^69,58,58,53,37) => "Black Cherry by MirruTatep" +elif $pal_sunset_red (13,40,107,175,238^16,26,35,39,36^27,45,65,71,61) => "Sunset Red by Cabezinu" +elif $pal_inkpink (255,254,208,135,69,38^255,108,55,40,36,13^255,144,145,106,89,52) => "INKPINK by Inkpendude" +elif $pal_brash_pink (63,104,223,246,255^7,0,60,106,148^55,117,179,159,241) => "Brash Pink by ItzFred" +elif $pal_pink_neon_sign_6 (49,81,112,158,204,239^61,73,86,102,119,135^89,107,123,149,175,195) => "Pink Neon Sign 6 by Chase Stemel" +elif $pal_enchanted_purple (22,58,77,96,116,128,145,152,197,225,245,252^37,66,78,90,111,113,122,119,148,168,193,207^74,120,143,158,179,181,194,197,230,250,255,255) => "Enchanted Purple by Kaiburn" +elif $pal_arch (50,63,76,97,117,146,160,217,253,254,253^51,72,87,111,122,136,151,183,197,231,253^72,115,151,174,178,189,196,216,198,213,255) => "Arch by Poltergasm" +elif $pal_spaceyeaster (32,79,207,101,127,225,125,54,154,78,171,229,182,66,53,132,65^28,75,42,54,123,77,72,48,26,43,162,109,133,25,24,201,132^52,88,131,125,141,157,152,66,95,97,191,174,207,47,68,245,175) => "Spacey Easter by Spark Norris" +elif $pal_fornaxvoid1 (122,117,112,108,103,99,94,89,85,80,76,71,66,62,57,53,47,55,63,70,78,86,93,101,109,116,124,132,139,147,155,162,0,7,13,20,26,32,39,45,52,58,64,71,77,84,90,96,240,224,208,192,176,160,144,128,112,96,80,64,48,32,16,0,255,242,230,218,206,194,181,169,157,145,133,120,108,96,84,72,243,231,219,208,196,185,173,161,150,138,127,115,103,92,80,69,255,255,255,255,255,255,255,255,224,192,160,128,96,64,48,32,216,196,176,157,137,117,98,78,58,39,19,0,0,0,0,0,255,238,221,204,187,170,153,136,119,102,85,68,51,34,17,0,0,5,9,13,18,22,26,30,35,39,43,47,52,56,60,64,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,238,221,204,187,170,153,136,119,102,85,68,51,34,17,0,0,16,31,46,61,76,91,106,122,137,152,167,182,197,212,227,255,242,229,217,204,192,176,160,128,96,80,64,48,40,32,16,166,178,189,200,211,222,233,244,255,218,182,145,109,72,36,0,227,211,196,181,166,151,136,121,105,90,75,60,45,30,15,0^37,42,47,51,56,60,65,70,74,79,83,88,93,97,102,106,222,214,206,198,190,182,174,166,158,150,142,134,126,118,110,102,204,195,186,177,168,160,151,142,133,124,116,107,98,89,80,72,240,233,226,220,213,206,200,193,186,180,173,166,160,153,146,140,255,242,230,218,206,194,181,169,157,145,133,120,108,96,84,72,142,136,130,124,118,112,106,100,94,88,82,76,70,64,58,53,216,194,172,150,128,96,64,0,0,0,0,0,0,0,0,0,216,196,176,157,137,117,98,78,58,39,19,0,0,0,0,0,43,40,38,36,34,32,30,28,25,23,21,19,17,15,13,11,0,5,9,13,18,22,26,30,35,39,43,47,52,56,60,64,255,240,225,210,195,180,165,150,136,121,106,91,76,61,46,32,160,157,155,153,151,149,147,145,142,140,138,136,134,132,130,128,0,9,18,27,36,45,54,63,72,81,90,99,108,117,126,134,192,172,153,134,115,96,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,211,196,181,166,151,136,121,105,90,75,60,45,30,15,0^255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,235,242,249,255,255,255,255,255,255,255,255,255,255,255,255,255,204,208,211,215,218,221,225,228,232,235,238,242,245,249,252,255,240,233,226,220,213,206,200,193,186,180,173,166,160,153,146,140,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,224,192,160,128,96,64,48,32,255,247,240,232,225,217,210,202,195,187,180,173,145,118,91,64,255,246,238,229,221,212,204,195,187,178,170,161,153,144,136,128,0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,255,240,225,210,195,180,165,150,136,121,106,91,76,61,46,32,255,246,238,229,221,212,204,195,187,178,170,161,153,144,136,128,0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,255,255,255,255,255,255,255,255,232,208,192,128,96,80,64,48,255,223,191,159,127,95,63,31,0,10,19,28,37,46,55,64,255,240,225,210,195,180,165,150,136,121,106,91,76,61,46,32) => "Fornax Void I by Fornax Void" +elif $pal_fornaxvoid2 (32,48,64,96,128,160,192,224,255,255,255,255,255,255,255,255,16,32,40,48,64,80,96,128,160,176,192,204,217,229,242,255,69,80,92,103,115,127,138,150,161,173,185,196,208,219,231,243,255,238,221,204,187,170,153,136,119,102,85,68,51,34,17,0,32,64,128,192,255,255,255,255,0,0,0,0,1,128,192,232,0,0,0,0,32,64,128,160,192,216,36,72,109,145,182,218,0,0,0,0,0,1,32,64,128,192,224,255,0,0,0,0,0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255^0,0,0,0,0,0,0,0,0,64,96,128,150,172,194,216,0,0,0,0,0,0,0,0,0,48,96,115,134,153,172,192,53,58,64,70,76,82,88,94,100,106,112,118,124,130,136,142,154,155,156,158,159,161,162,163,165,166,168,169,170,172,173,175,0,0,0,0,0,128,192,232,32,64,128,192,255,255,255,255,0,0,0,0,32,64,128,160,192,216,0,0,0,0,0,0,32,64,128,192,224,255,32,64,128,192,224,255,25,51,76,102,0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255^32,48,64,96,128,160,192,224,255,255,255,255,255,255,255,255,48,64,80,96,128,192,208,232,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,244,238,233,227,221,216,210,204,199,193,187,182,176,170,0,0,0,0,0,128,192,232,0,0,0,0,0,128,192,232,64,128,192,255,255,255,255,255,255,255,219,183,146,110,73,37,32,64,128,192,224,255,0,0,0,0,0,0,230,205,179,154,0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255) => "Fornax Void II by Fornax Void" +elif $pal_pixelwave (28,82,136,166,145,117,90,82,123,171,213,255^5,14,23,37,59,82,105,131,163,196,225,255^41,117,194,249,255,255,255,255,255,255,255,255) => "Pixelwave by Reptorian" +elif $pal_s1_6 (255,55,0,89,0,46^255,255,169,22,10,0^255,255,228,255,236,161) => "S1-6 by Blyzz" +elif $pal_berry_nebula (108,108,109,110,111,79,46,13^237,185,133,81,29,20,10,0^237,201,165,129,92,70,48,26) => "Berry Nebula by LostInIndigo" +elif $pal_abyss9 (0,31,58,84,84,98,127,160,221^0,18,30,41,99,170,227,245,248^0,58,126,194,217,221,220,198,208) => "ABYSS-9 by Jusiv" +elif $pal_moonlight (3,7,9,9,8,13,10,38,54,58,131,99,61,46,31^2,9,15,30,50,47,76,132,181,255,193,164,130,103,75^6,24,51,77,83,135,160,206,245,251,111,96,78,73,67) => "Moonlight 15 by Tofu" +elif $pal_moon39 (126,159,188,42,42,44,38,131,52,36,54,33,40,26,54,32,71,125,88,76,61,56,63,21,113,112,104,127,101,53,128,103,66,40,36,17,104,137,39^177,211,221,129,106,90,103,204,166,75,105,65,79,51,61,63,71,219,110,103,104,96,112,84,184,181,172,205,169,119,209,178,129,98,84,54,179,221,72^213,249,244,152,152,122,103,194,196,103,73,89,107,70,84,86,76,206,103,108,110,98,122,80,161,157,156,173,154,105,174,155,124,107,103,82,156,181,97) => "Moonlit-39 by theartistjulian" +elif $pal_h2o (9,24,41,36,49,59,81,146,130,239^9,23,51,68,92,130,154,176,204,215^9,60,41,87,61,113,89,168,146,230) => "H2O by maine" +elif $pal_magic_waters_9 (93,79,79,114,112,109,146,148,162^81,94,117,140,160,179,201,226,250^121,133,155,145,148,156,177,165,163) => "Magic Waters 9 by Chase Stemel" +elif $pal_bluemold (25,41,87,153^27,66,156,201^26,87,154,179) => "Bluem0ld by warpixel" +elif $pal_moss (16,27,36,89,141^64,68,102,179,217^64,89,102,156,185) => "Moss by Zetomis" +elif $pal_deep_maze (242,154,56,0,0,8,0^255,240,216,190,154,85,29^102,137,142,145,152,98,42) => "DEEP MAZE by Ryosuke" +elif $pal_toxic_slime (165,91,48,37,27^238,220,171,116,75^167,112,87,80,74) => "Toxic Slime by MirruTatep" +elif $pal_lush_green (70,58,65,63,60,57^156,135,112,91,76,66^88,94,112,105,99,92) => "Lush Green by EerieJam" +elif $pal_tsunami (157,106,54,39,22^236,185,134,71,30^207,185,150,104,60) => "Tsunami by MirruTatep" +elif $pal_cryptic_ocean (42,63,68,76,105,149^23,44,63,92,128,197^59,95,123,135,158,172) => "Cryptic Ocean by Klafooty" +elif $pal_marsh_madness (183,154,117,54,28^169,147,126,89,49^138,106,78,64,44) => "Marsh Madness by MirruTatep" +elif $pal_oxyd (157,159,59,55,50,37,41,50^157,114,110,87,62,48,37,25^107,73,100,105,89,81,67,55) => "OXYD by ItzFred" +elif $pal_pinkgreen (218,197,157,117,58,28,17,3^192,154,129,119,98,64,48,24^192,139,99,69,72,75,47,30) => "Pink&Green by q1" +elif $pal_walking_in_the_woods (186,203,209,219,207,174,129,82^194,212,221,235,207,150,83,50^177,194,194,192,173,133,85,73) => "Walking in the Woods 8 by Chase Stemel" +elif $pal_paper_8 (31,101,168,209,246,182,96,60^36,64,96,166,231,207,174,107^75,83,93,126,156,142,123,100) => "Paper 8 by Frosty Rabbid" +elif $pal_sahara_pastell (26,28,161,218,255,255,200^18,89,102,232,254,255,187^54,140,102,160,227,255,112) => "Sahara Pastell by wermz" +elif $pal_sunflower_painting_7 (44,26,8,169,251,249,247^53,92,131,229,245,212,179^60,107,155,187,177,110,44) => "Sunflower Painting 7 by Chase Stemel" +elif $pal_arthoe7 (40,84,223,255,206,127,47^42,77,208,243,253,163,72^42,70,118,153,255,172,88) => "Art Hoe Aesthetic 7 by Chase Stemel" +elif $pal_sky5 (199,219,223,236,142,118,98^172,216,213,236,179,143,112^91,121,158,210,175,163,135) => "Sky5 by MiniTe" +elif $pal_ocean_glass (193,136,104,69,67,30,29,4^208,181,145,109,107,68,53,0^193,162,125,90,109,79,80,64) => "Ocean Glass by Solitaire" +elif $pal_royalguard (66,59,54,0,111,192^48,63,82,114,152,197^48,63,82,129,155,201) => "RoyalGuard by Royal_Naym" +elif $pal_eulbink (255,12,0,30,32,37,32^255,230,152,87,53,36,21^255,242,219,156,98,70,51) => "Eulbink by Inkpendude" +elif $pal_winter_wonderland (32,44,56,139,255,214,167,115^40,74,117,202,255,225,188,141^78,120,161,221,255,233,201,157) => "Winter Wonderland by Jimison3" +elif $pal_moon_squid (129,109,78,47,113,200,234^178,152,112,72,111,175,205^197,186,137,88,113,167,194) => "Moon Squid 7 by Chase Stemel" +elif $pal_stratus (231,200,168,125,103^244,228,205,152,101^231,233,230,191,154) => "Stratus by MirruTatep" +elif $pal_arctic_dust (233,177,158,141,107^247,226,189,148,115^217,212,187,150,123) => "Arctic Dust by MirruTatep" +elif $pal_clouds_sunset (252,239,214,180,165,143,154,165^176,157,147,141,151,160,171,183^140,127,138,146,161,191,201,212) => "CL8UDS by _Nicola " +elif $pal_lilac_skies (196,215,228,155,168^158,177,197,141,153^188,198,213,186,194) => "Lilac Skies 5 by Chase Stemel" +elif $pal_sea_of_fire (164,109,54,163,133,71^222,181,132,61,34,9^215,173,123,54,27,5) => "Sea of Fire by TATA-PIXEL" +elif $pal_autochrome3 (88,31,223^66,106,85^147,56,41) => "Autochrome 3 by Reptorian" +elif $pal_autochrome5 (88,31,223,126,13^66,106,85,141,203^147,56,41,227,163) => "Autochrome 5 by Reptorian" +elif $pal_gb_d_1 (51,166,214,247^30,55,142,231^80,37,73,198) => "GB Default 1" +elif $pal_gb_d_2 (8,52,136,224^24,104,192,248^32,86,112,208) => "GB Default 2" +elif $pal_gb_andrade (32,94,174,227^32,103,186,238^32,69,137,192) => "GB Andrade by Andrade" +elif $pal_gb_blue (208,112,60,28^244,176,52,8^248,192,104,32) => "GB Blue Seni by WildLeoKnight" +elif $pal_gb_bz (46,56,87,126^70,93,123,132^61,73,70,22) => "GB Blackzone" +elif $pal_gb_suburb (69,123,255,255^39,150,190,246^83,232,179,229) => "GB Suburb by Poppysalmon" +elif $pal_gb_crimson (27,122,186,239^3,28,80,249^38,75,68,214) => "GB Crimson by WildLeoKnight" +elif $pal_gb_didi (33,58,119,220^11,101,175,254^46,90,104,207) => "GB Didi by DidiGameboy" +elif $pal_gb_dirty (196,139,77,31^207,149,83,31^161,109,60,31) => "GB Dirty by WildLeoKnight" +elif $pal_gb_arne (36,63,118,172^49,80,132,181^55,63,72,107) => "GB Arne by Arne" +elif $pal_gb_easy (0,13,161,235^67,136,188,221^51,51,0,119) => "GB Easy by GrafxKid" +elif $pal_gb_forest (90,107,123,255^57,140,198,255^33,66,123,181) => "GB Forest" +elif $pal_gb_hg (23,55,106,190^40,109,180,235^8,3,23,113) => "GB Harsh Green by WildLeoKnight" +elif $pal_gb_lg (244,104,30,5^251,207,145,36^208,104,120,31) => "GB Light Green by WildLeoKnight" +elif $pal_gb_nostalgia (208,160,112,64^208,168,128,80^88,64,40,16) => "GB Nostalgia by WildLeoKnight" +elif $pal_gb_platinum (24,80,168,224^48,120,192,240^48,104,176,232) => "GB Platinum by WildLeoKnight" +elif $pal_gb_kirokaze (51,70,148,226^44,135,227,243^80,143,68,228) => "GB Kirokaze by Kirokaze" +elif $pal_gb_cyber (16,66,111,206^37,103,158,206^51,142,223,206) => "GB Cyber" +elif $pal_gb_wish (98,117,96,139^46,80,143,229^76,232,207,255) => "GB Wish by Kerrie Lake" +elif $pal_gb_grapefruit (101,183,244,255^41,101,178,245^108,145,107,221) => "GB Grapefruit by GrafxKid" +elif $pal_gb_ice_cream (124,235,249,255^63,107,168,246^88,111,117,211) => "GB Ice Cream by Kerrie Lake" +elif $pal_gb_rb (24,132,247,255^16,115,181,239^16,156,140,255) => "GB Red_Blue" +elif $pal_gb_gold (33,77,157,207^11,34,101,171^27,44,76,81) => "Gold GB by Isa" +elif $pal_gb_choco (255,220,169,66^228,164,96,41^194,86,76,54) => "GB Chocolate by GrafxKid" +elif $pal_gb_gray (43,112,168,224^43,107,159,219^38,102,148,205) => "GB Gray by GrafxKid" +elif $pal_gb_space (11,107,204,248^6,31,52,227^48,177,149,196) => "GB Spacehaze by WildLeoKnight" +elif $pal_gb_purpdawn (0,45,154,238^27,117,123,253^46,126,188,237) => "GB Purple Dawn by WildLeoKnight" +elif $pal_moon_crystal (255,217,141,117^226,167,137,95^219,198,199,156) => "Moon Crystal by Doph" +elif $pal_arne4 (0,0,184,175^0,81,75,216^0,156,18,79) => "ARNE4 by Arne" +elif $pal_autumn_chill (218,213,194,44^211,136,58,30^175,99,115,116) => "Autumn Chill by Doph" +elif $pal_cherrymelon (252,255,38,1^222,77,89,40^234,109,53,36) => "CherryMelon by WildLeoKnight" +elif $pal_hal4 (48,96,248,248^0,40,144,240^48,120,32,136) => "HallowPumpkin by WildLeoKnight" +elif $pal_hollow (15,86,198,250^15,90,183,251^27,117,190,246) => "Hollow by Poltergasm" +elif $pal_lavender4 (84,127,187,205^43,98,173,221^96,163,106,147) => "Lavender4 by Solitaire" +elif $pal_maw (42,0,203,235^0,82,183,235^42,60,50,235) => "MAW by bloo" +elif $pal_voltage_warning (28,99,211,212^20,86,174,201^18,80,33,195) => "Voltage Warning by Wuchta" +elif $pal_tritanopia (221,244,255,45,25^68,128,220,103,75^68,128,220,111,79) => "Tritanopia by Allappini" +elif $pal_rabbit7 (212,232,236,79,170,59,92^117,196,236,164,211,50,97^100,152,224,165,149,74,130) => "Rabbit 7 by GrafxKid" +elif $pal_amiga2600ntsc (252,232,208,184,160,132,100,68,44,76,104,132,156,180,204,224,200,180,156,132,108,80,52,20,0,32,64,92,116,140,164,184,164,144,124,104,80,56,28,0,0,28,56,80,104,124,144,164,164,144,124,104,80,56,28,0,0,28,56,80,104,124,144,164,188,168,148,124,104,76,48,20,72,96,120,140,160,180,196,212,236,220,208,192,176,160,140,120,136,156,176,192,208,224,236,252,252,236,224,208,192,172,152,132,112,132,152,172,188,204,220,232,252,232,208,184,160,132,100,68,0,64,108,144,176,200,220,236^224,204,180,156,132,104,72,40,48,80,112,140,168,192,212,236,252,228,204,180,152,124,92,56,60,92,124,156,180,208,228,252,252,228,208,180,156,124,92,64,44,76,104,132,156,180,204,224,200,180,156,136,112,84,56,24,0,32,64,92,116,140,164,184,180,160,136,112,88,60,32,0,0,32,60,88,112,132,156,176,176,156,132,112,88,60,32,0,0,32,60,88,112,136,160,180,188,168,148,128,104,80,52,24,40,68,92,120,140,160,180,204,252,232,208,184,160,132,100,68,0,64,108,144,176,200,220,236^140,124,108,88,68,48,24,0,0,28,52,76,100,120,136,156,164,144,124,104,80,56,28,0,0,32,64,92,116,140,164,184,212,192,172,148,128,100,72,44,92,120,144,172,192,212,232,252,252,236,220,204,188,168,144,124,136,156,176,192,208,224,236,252,252,236,224,208,192,172,152,132,120,144,164,184,204,220,236,252,224,208,192,176,156,136,116,92,0,32,60,88,112,136,160,180,148,128,112,92,72,48,24,0,0,20,40,60,76,92,104,124,104,92,80,64,52,36,16,0,0,64,108,144,176,200,220,236) => "Amiga 2600 NTSC" +elif $pal_amiga2600pal (112,136,160,180,200,220,236,252,224,208,196,180,168,148,132,112,88,108,128,148,164,180,196,212,200,184,168,148,128,108,84,60,0,32,60,88,112,132,156,176,164,144,124,104,80,56,28,0,0,28,56,80,104,124,144,164,176,156,132,112,88,60,32,0,0,32,60,88,112,132,156,176,212,192,176,160,140,116,92,68,128,148,168,188,204,220,236,252,252,236,220,200,180,160,136,112,0,64,108,144,176,200,220,236^0,32,60,88,112,132,156,176,176,156,132,112,88,60,32,0,0,32,60,88,112,132,156,176,176,156,132,112,88,60,32,0,0,32,60,88,112,132,156,176,200,180,160,136,116,88,60,32,60,88,116,140,164,184,204,224,236,220,200,184,164,140,116,92,100,128,152,176,196,216,232,252,252,232,212,192,172,144,120,92,88,112,132,156,172,192,208,224,212,192,172,152,132,104,80,52,0,64,108,144,176,200,220,236^20,52,80,108,132,156,180,200,224,208,192,176,156,136,116,92,112,136,160,180,200,220,236,252,252,236,220,204,188,168,148,128,136,156,176,192,208,224,236,252,252,236,220,200,180,160,136,112,112,136,160,180,200,220,236,252,236,220,200,184,164,140,116,92,20,52,80,108,132,156,180,200,176,156,132,112,88,60,32,0,0,32,60,88,112,132,156,176,176,156,132,112,88,60,32,0,0,64,108,144,176,200,220,236) => "Amiga 2600 PAL" +elif $pal_amiga2600secam (0,33,240,255,127,127,255,255^0,33,60,80,255,255,255,255^0,255,121,255,0,255,63,255) => "Amiga 2600 SECAM" +elif $pal_amiga7800mess (1,46,61,89,119,132,160,183,205,216,221,224,234,240,246,255,255,254,255,254,255,255,255,255,255,255,216,187,153,119,84,65,71,114,160,179,200,228,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,243,231,212,191,176,157,122,95,75,127,179,200,223,237,251,252,254,255,255,255,255,255,255,255,254,255,255,255,255,251,239,228,215,202,187,170,149,129,103,74,73,92,101,122,146,157,166,177,188,196,206,213,218,222,225,230,205,192,176,159,152,144,128,113,101,90,79,68,37,9,6,5,12,32,54,70,87,97,109,123,137,145,157,167,178,187,195,211,208,195,175,155,147,141,112,86,77,73,51,29,29,30,29,29,2,2,1,2,2,2,1,1,27,62,101,118,138,155,177,199,208,200,182,162,134,125,115,82,78,55,40,25,15,4,0,0,22,28,35,40,46,58,71,81,93,113,133,141,151,165,184,185,242,232,219,206,194,184,171,158,139,121,108,96,72,69,57,44,70,76,85,109,144,172,194,209,223,231,238,247,253,255,255,255,254,254,254,254,252,249,237,225,208,191,181,171,141,113,88,65^1,46,61,89,119,132,160,183,205,216,221,224,234,240,246,255,255,255,249,244,230,216,208,197,171,145,128,104,79,55,40,32,25,30,37,57,81,106,130,140,153,174,196,197,198,214,228,231,218,209,194,178,164,152,138,121,110,98,78,54,47,43,36,31,23,26,29,33,37,60,82,96,112,127,144,158,170,185,200,202,184,175,165,157,141,126,114,103,90,77,61,45,24,3,1,1,3,4,14,35,59,69,79,90,101,109,118,131,144,156,170,182,211,203,190,178,170,160,146,131,117,104,90,76,61,48,38,30,8,28,49,66,83,93,105,119,133,141,152,164,175,184,193,209,237,233,228,223,220,216,198,182,169,154,134,113,92,73,56,41,76,93,112,132,153,171,188,207,220,225,231,234,237,240,243,246,255,255,255,255,236,227,217,205,186,164,147,127,117,107,84,72,64,83,102,120,140,152,165,175,187,207,227,235,245,255,255,255,255,252,239,225,214,204,191,178,159,141,127,113,86,82,68,53,58,63,70,88,118,140,161,176,190,198,205,218,230,242,249,249,212,203,198,193,183,173,160,147,133,119,100,81,58,37,31,26^1,46,61,89,119,132,160,183,205,216,221,224,234,240,246,255,172,153,120,86,81,77,60,29,29,30,23,24,16,6,1,0,4,17,30,33,34,32,31,37,45,56,84,89,109,136,162,171,209,196,179,158,139,125,105,85,75,63,43,36,15,16,13,14,4,13,23,25,28,57,85,97,99,126,143,159,173,190,206,222,236,234,232,230,226,218,206,195,182,169,154,137,116,96,75,55,109,136,145,166,190,201,210,221,232,240,249,255,255,254,254,255,255,255,255,255,255,255,255,255,255,255,237,222,213,202,165,131,121,141,163,179,196,207,218,232,247,254,255,255,254,255,255,255,255,254,254,254,254,255,254,255,236,217,207,199,172,147,119,92,90,111,132,156,182,202,221,244,255,254,255,254,255,255,255,254,208,200,182,162,134,125,115,82,77,55,39,25,15,4,0,0,0,0,1,1,0,12,25,35,47,67,87,95,105,150,151,151,171,121,108,84,83,73,60,47,28,10,1,0,0,0,0,0,9,10,9,9,8,11,32,47,61,69,77,101,125,164,197,212,152,131,113,96,92,89,78,68,58,48,39,31,19,8,5,3) => "Amiga 7800 M.E.S.S by Nabuko78" +elif $pal_amiga7800 (0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,255,255,247,230,213,196,179,162,145,128,111,94,77,60,43,26,49,66,83,100,117,134,151,168,185,202,219,236,253,255,255,255,255,255,255,255,249,232,215,198,181,164,147,130,113,96,79,62,63,80,97,114,131,148,165,182,199,216,233,250,255,255,255,255,255,255,255,255,238,221,204,187,170,153,136,119,102,85,68,51,29,46,64,81,98,115,132,149,166,183,200,217,233,251,255,255,255,240,223,206,189,172,155,138,121,104,87,70,53,36,19,2,0,0,8,25,42,59,76,93,110,127,144,161,178,195,212,229,206,189,172,155,138,121,104,87,70,53,36,19,2,0,0,0,0,0,0,0,6,23,40,57,74,91,108,125,142,159,176,193,192,175,158,141,124,107,90,73,56,39,22,5,0,0,0,0,0,0,0,0,16,33,50,67,84,101,118,135,152,169,186,203,225,208,191,174,157,140,123,106,89,72,55,38,21,4,0,0,0,14,31,48,65,82,99,116,133,150,167,184,201,218,235,252,255,255,246,229,212,195,178,161,144,127,110,93,76,59,42,25^0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,247,245,228,211,194,177,160,143,126,109,92,75,58,41,24,7,0,6,23,40,57,74,91,108,125,142,159,176,193,210,227,244,229,212,195,178,161,144,127,110,93,76,59,42,25,8,0,0,0,0,0,15,32,49,66,83,100,117,134,151,168,185,202,219,216,199,182,165,148,131,114,97,80,63,46,29,12,0,0,0,0,0,0,16,33,50,67,84,101,118,135,152,169,186,203,220,232,215,198,181,164,147,130,113,96,79,62,45,28,11,0,0,0,10,27,44,61,78,95,112,129,146,163,180,197,214,231,248,255,248,231,214,197,180,163,146,129,112,95,78,61,44,27,10,26,43,60,77,94,111,128,145,162,179,196,213,230,247,255,255,255,255,255,240,223,206,189,172,155,138,121,104,87,70,53,36,39,56,73,90,107,124,141,158,175,192,209,226,243,255,255,255,255,255,255,239,222,205,188,171,154,137,120,103,86,69,52,35,23,40,57,74,91,108,125,142,159,176,193,210,227,244,255,255,255,245,228,211,194,177,160,143,126,109,92,75,58,41,24,7^0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,151,131,111,94,77,60,43,26,9,0,0,0,0,0,0,0,0,0,0,0,0,0,10,27,44,61,78,95,112,133,156,178,218,196,174,152,131,115,98,81,64,47,30,13,0,0,0,0,3,15,27,43,60,77,94,111,128,145,162,179,200,222,239,244,243,238,233,228,228,211,194,177,160,143,126,109,92,76,65,53,92,104,116,132,149,166,183,200,217,234,235,235,236,235,239,244,248,247,247,247,247,247,247,242,225,208,191,174,157,140,125,113,104,124,144,161,178,195,212,229,246,255,255,255,255,255,255,255,255,255,255,255,255,255,245,228,211,194,177,160,143,121,99,77,38,60,82,104,124,141,158,175,192,209,226,243,255,255,255,255,253,241,229,213,196,179,162,145,128,111,94,77,56,34,16,11,12,17,22,27,27,44,61,78,95,112,129,146,163,179,191,203,163,151,139,122,105,88,71,54,37,20,19,19,19,19,16,10,7,8,8,8,8,8,8,13,30,47,64,81,98,115,130,142,150,130,111,94,77,60,43,26,9,0,0,0,0,0,0,0) => "Amiga 7800" +elif $pal_amstrad_cpc (0,128,255,128,255,255,255,255,255,128,0,0,128,128,0,0,0,128,0,0,128,128,255,255,255,128,0^0,128,255,0,0,128,128,255,255,128,128,255,255,255,255,128,255,255,128,0,0,128,128,0,0,0,0^0,128,255,0,0,128,0,128,0,0,0,0,0,128,128,128,255,255,255,128,255,255,255,255,128,128,255) => "Amstrad CPC" +elif $pal_apple2 (0,81,132,234,81,232,245,0,0,145,201,0,152,200,255^0,92,61,125,72,93,183,103,200,145,209,166,219,193,255^0,22,82,39,136,239,201,82,44,145,153,240,201,247,255) => "Apple II" +elif $pal_atari8bit (0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,9,25,41,58,74,90,107,123,140,156,172,189,205,222,238,255,48,61,75,89,103,117,130,144,158,172,186,199,213,227,241,255,75,87,99,111,122,135,147,159,171,182,195,207,219,230,243,255,85,96,107,119,130,141,153,164,175,187,198,209,221,232,243,255,76,87,99,111,123,135,147,159,171,183,195,207,219,231,243,255,48,59,73,87,101,114,128,142,156,169,183,197,211,224,238,252,10,26,42,59,75,91,108,124,140,156,173,189,206,222,238,255,0,12,27,42,57,72,87,102,116,131,146,161,176,191,206,221,0,12,25,38,50,63,76,88,101,114,126,139,152,164,177,190,0,9,21,32,44,55,66,78,89,101,112,124,135,146,158,169,0,11,22,34,45,57,68,80,91,103,114,126,137,149,160,172,0,12,25,38,51,64,76,89,102,115,128,140,153,166,179,192,0,15,30,45,60,75,90,105,121,136,151,166,181,196,211,227,13,29,45,61,77,93,109,125,142,158,174,190,206,222,238,255,51,64,78,91,105,119,132,146,159,173,187,200,214,227,241,255^0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,25,40,55,71,86,101,117,132,147,163,178,193,209,224,239,255,0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,0,15,30,46,61,77,92,107,123,138,154,169,184,200,215,231,0,14,28,42,56,70,84,98,113,127,141,155,169,183,197,212,0,13,27,40,54,67,81,94,108,121,135,148,162,175,189,203,0,11,25,39,52,66,80,93,107,121,134,148,162,175,189,203,0,14,29,44,58,73,88,103,117,132,147,162,176,191,206,221,0,13,30,46,62,78,94,110,126,143,159,175,191,207,223,239,14,30,46,62,78,94,110,126,142,158,174,190,206,222,238,255,36,48,63,77,92,106,121,135,150,164,179,193,208,223,237,252,50,63,77,91,104,118,132,145,159,173,186,200,214,227,241,255,52,65,79,92,106,119,133,146,160,173,187,200,214,227,241,255,42,56,70,84,98,113,127,141,155,169,184,198,212,226,240,255,23,38,53,69,84,100,115,131,146,162,177,193,208,224,239,255,0,16,33,50,67,84,101,118,134,151,168,185,202,219,236,253^0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,0,6,13,20,27,34,41,48,54,61,68,75,82,89,96,103,0,8,17,25,34,42,51,59,68,76,85,93,102,110,119,128,0,12,24,36,48,60,73,85,97,109,121,134,146,158,170,183,0,16,33,50,67,84,101,118,135,152,169,186,203,220,237,254,71,83,95,107,120,132,144,156,169,181,193,205,218,230,242,255,126,133,141,150,159,167,176,184,193,201,210,219,227,236,244,253,151,157,164,171,178,185,192,199,206,213,220,227,234,241,248,255,142,148,156,163,171,178,186,193,201,208,216,223,230,238,245,253,100,110,120,131,141,151,162,172,182,193,203,213,224,234,244,255,34,46,61,76,90,105,120,134,149,164,178,193,208,222,237,252,0,14,28,43,57,72,86,100,115,129,144,158,172,187,201,216,0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,151,0,7,14,22,29,36,44,51,59,66,73,81,88,96,103,111,0,6,13,20,27,34,41,48,55,62,69,76,83,90,97,104,0,8,17,26,35,44,53,62,70,79,88,97,106,115,124,133) => "Atari 8-Bit Series - GTIA by PixelCrunch" +elif $pal_cga (0,85,170,255,0,85,0,85,0,85,170,255,170,255,170,255^0,85,170,255,0,85,170,255,170,255,0,85,0,85,85,255^0,85,170,255,170,255,0,85,170,255,0,85,170,255,0,85) => "CGA" +elif $pal_cga00 (0,0,170,170^0,170,0,85^0,0,0,0) => "CGA Mode 0 [Low]" +elif $pal_cga01 (0,85,255,255^0,255,85,255^0,85,85,85) => "CGA Mode 0 [High]" +elif $pal_cga10 (0,170,0,170^0,0,170,170^0,170,170,170) => "CGA Mode 1 [Low]" +elif $pal_cga11 (0,255,85,255^0,85,255,255^0,255,255,255) => "CGA Mode 1 [High]" +elif $pal_cga20 (0,170,0,170^0,0,170,170^0,0,170,170) => "CGA Mode 2 [Low]" +elif $pal_cga21 (0,255,85,255^0,85,255,255^0,85,255,255) => "CGA Mode 2 [High]" +elif $pal_c64_pepto (0,98,137,173,255,159,203,109,161,201,154,92,106,136,80,160^0,98,137,173,255,78,126,84,104,212,226,171,191,126,69,87^0,98,137,173,255,68,117,18,60,135,155,94,198,203,155,163) => "Commodore 64 - Pepto" +elif $pal_c64_colodore (0,74,123,178,255,129,196,85,142,237,169,86,117,112,46,142^0,74,123,178,255,51,108,56,80,241,255,172,206,109,44,60^0,74,123,178,255,56,113,0,41,113,159,77,200,235,155,151) => "Commodore 64 - Colodore" +elif $pal_com_vic_20 (0,255,168,233,119,182,133,197,168,233,85,146,66,126,189,255^0,255,115,178,45,104,212,255,95,157,158,223,52,112,204,255^0,255,74,135,38,98,220,255,180,245,74,135,139,202,113,176) => "Commodore VIC-20" +elif $pal_colecovision (0,33,66,41,90,156,57,214,255,222,214,24,214,206,255^0,173,214,49,115,41,231,57,115,231,214,123,49,206,255^0,24,90,214,255,24,247,33,90,41,123,16,231,206,255) => "Colecovision" +elif $pal_jmp (0,25,70,161,69,118,131,158,220,225,214,233,33,211,175,245^0,16,175,214,62,100,49,194,83,141,185,216,108,101,170,244^0,40,69,133,120,254,41,232,75,121,123,161,75,200,185,235) => "Japanese Machine Palette by Arne Niklas Jansson" +elif $pal_mac2 (255,255,255,220,255,54,0,0,0,0,101,151,185,134,69,0^255,255,101,0,0,0,0,151,168,101,54,101,185,134,69,0^255,0,0,0,151,151,202,255,0,0,0,54,185,134,69,0) => "Macintosh II" +elif $pal_mac8 (0,11,34,68,85,119,136,170,187,221,238,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,34,68,85,119,136,170,187,221,238,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255^0,11,34,68,85,119,136,170,187,221,238,0,0,0,0,0,0,0,0,0,0,11,34,68,85,119,136,170,187,221,238,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,51,51,51,51,51,102,102,102,102,102,102,153,153,153,153,153,153,204,204,204,204,204,204,255,255,255,255,255,255,0,0,0,0,0,0,51,51,51,51,51,51,102,102,102,102,102,102,153,153,153,153,153,153,204,204,204,204,204,204,255,255,255,255,255,255,0,0,0,0,0,0,51,51,51,51,51,51,102,102,102,102,102,102,153,153,153,153,153,153,204,204,204,204,204,204,255,255,255,255,255,255,0,0,0,0,0,0,51,51,51,51,51,51,102,102,102,102,102,102,153,153,153,153,153,153,204,204,204,204,204,204,255,255,255,255,255,255,0,0,0,0,0,0,51,51,51,51,51,51,102,102,102,102,102,102,153,153,153,153,153,153,204,204,204,204,204,204,255,255,255,255,255,255,0,0,0,0,0,0,51,51,51,51,51,51,102,102,102,102,102,102,153,153,153,153,153,153,204,204,204,204,204,204,255,255,255,255,255,255^0,11,34,68,85,119,136,170,187,221,238,11,34,68,85,119,136,170,187,221,238,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255) => "Macintosh 8-Bit System Palette" +elif $pal_msx (0,202,255,183,217,254,202,221,60,64,115,89,126,100,181^0,202,255,94,100,135,193,206,160,182,206,85,117,218,101^0,202,255,81,89,124,94,133,66,74,124,223,240,238,179) => "MSX" +elif $pal_nes (0,252,248,188,124,164,60,0,0,184,104,0,0,216,152,104,68,248,248,216,148,248,248,228,168,240,248,248,168,252,252,228,136,248,248,172,80,216,184,0,0,184,88,0,0,184,88,0,0,0,0,0,0,248,120^0,252,248,188,124,228,188,120,0,184,136,88,0,184,120,68,40,184,120,0,0,164,88,0,0,208,120,56,16,224,160,92,20,216,184,124,48,248,248,184,120,248,216,168,104,248,248,168,88,252,232,136,64,216,120^0,252,248,188,124,252,252,248,252,248,252,248,188,248,248,252,188,248,248,204,132,192,152,88,32,176,88,0,0,168,68,16,0,120,0,0,0,120,24,0,0,184,84,0,0,216,152,68,0,252,216,136,88,248,120) => "NES" +elif $pal_pico_8 (0,95,194,255,255,255,255,171,255,255,131,126,41,29,0,0^0,87,195,241,236,163,204,82,119,0,118,37,173,43,135,228^0,79,199,232,39,0,170,54,168,77,156,83,255,83,81,54) => "PICO-8 by Lexaloffle Games" +elif $pal_risc (255,220,185,151,118,85,54,0,0,237,5,220,237,85,255,4^255,220,185,151,118,85,54,0,69,237,202,0,237,134,185,185^255,220,185,151,118,85,54,0,151,4,0,0,185,0,0,255) => "RISC OS" +elif $pal_samcoupe (0,0,73,73,0,0,73,73,36,36,109,109,36,36,109,109,0,0,73,73,0,0,73,73,36,36,109,109,36,36,109,109,146,146,219,219,146,146,219,219,182,182,255,255,182,182,255,255,146,146,219,219,146,146,219,219,182,182,255,255,182,182,255,255,0,0,73,73,0,0,73,73,36,36,109,109,36,36,109,109,0,0,73,73,0,0,73,73,36,36,109,109,36,36,109,109,146,146,219,219,146,146,219,219,182,182,255,255,182,182,255,255,146,146,219,219,146,146,219,219,182,182,255,255,182,182,255,255^0,0,0,0,73,73,73,73,36,36,36,36,109,109,109,109,0,0,0,0,73,73,73,73,36,36,36,36,109,109,109,109,0,0,0,0,73,73,73,73,36,36,36,36,109,109,109,109,0,0,0,0,73,73,73,73,36,36,36,36,109,109,109,109,146,146,146,146,219,219,219,219,182,182,182,182,255,255,255,255,146,146,146,146,219,219,219,219,182,182,182,182,255,255,255,255,146,146,146,146,219,219,219,219,182,182,182,182,255,255,255,255,146,146,146,146,219,219,219,219,182,182,182,182,255,255,255,255^0,73,0,73,0,73,0,73,36,109,36,109,36,109,36,109,146,219,146,219,146,219,146,219,182,255,182,255,182,255,182,255,0,73,0,73,0,73,0,73,36,109,36,109,36,109,36,109,146,219,146,219,146,219,146,219,182,255,182,255,182,255,182,255,0,73,0,73,0,73,0,73,36,109,36,109,36,109,36,109,146,219,146,219,146,219,146,219,182,255,182,255,182,255,182,255,0,73,0,73,0,73,0,73,36,109,36,109,36,109,36,109,146,219,146,219,146,219,146,219,182,255,182,255,182,255,182,255) => "SAM Coupe" +elif $pal_mo5 (0,187,255,221,238,255,221,0,119,0,187,255,255,221,0,119^0,187,0,119,187,255,221,255,221,255,255,255,0,119,0,119^0,187,0,119,0,0,119,0,119,255,255,255,255,238,255,221) => "Thomson MO5" +elif $pal_trs80 (0,0,255,255^0,128,128,255^0,255,0,255) => "TRS-80 Color Computer Palette" +elif $pal_virtualboy (255,120,45,0^0,0,0,0^0,0,0,0) => "Virtual Boy interpreted by Bruno Weinberger" +elif $pal_vga (0,0,0,0,170,170,170,170,85,85,85,85,255,255,255,255,16,32,53,69,101,117,138,154,186,202,223,239,0,65,130,190,255,255,255,255,255,255,255,255,255,190,130,65,1,1,1,1,1,0,0,0,130,158,190,223,255,255,255,255,255,255,255,255,255,223,190,158,130,130,130,130,130,130,130,130,186,202,223,239,255,255,255,255,255,255,255,255,255,239,223,202,186,186,186,186,186,186,186,186,0,28,57,85,113,113,113,113,113,113,113,113,113,85,57,28,0,0,0,0,0,0,0,0,57,69,85,97,113,113,113,113,113,113,113,113,113,97,85,69,57,57,57,57,57,57,57,57,81,89,97,105,113,113,113,113,113,113,113,113,113,105,97,89,81,81,81,81,81,81,81,81,0,16,32,49,65,65,65,65,65,65,65,65,65,49,32,16,0,0,0,0,0,0,0,0,32,40,49,57,65,65,65,65,65,65,65,65,65,57,49,40,32,32,32,32,32,32,32,32,45,49,53,61,65,65,65,65,65,65,65,65,65,61,53,49,45,45,45,45,45,45,45,45^0,0,170,170,0,0,85,170,85,85,255,255,85,85,255,255,16,32,53,69,101,117,138,154,186,202,223,239,0,0,0,0,0,0,0,0,0,65,130,190,255,255,255,255,255,255,255,255,255,190,130,65,130,130,130,130,130,130,130,130,130,158,190,223,255,255,255,255,255,255,255,255,255,223,190,158,186,186,186,186,186,186,186,186,186,202,223,239,255,255,255,255,255,255,255,255,255,239,223,202,0,0,0,0,0,0,0,0,0,28,57,85,113,113,113,113,113,113,113,113,113,85,57,28,57,57,57,57,57,57,57,57,57,69,85,97,113,113,113,113,113,113,113,113,113,97,85,69,81,81,81,81,81,81,81,81,81,89,97,105,113,113,113,113,113,113,113,113,113,105,97,89,0,0,0,0,0,0,0,0,0,16,32,49,65,65,65,65,65,65,65,65,65,49,32,16,32,32,32,32,32,32,32,32,32,40,49,57,65,65,65,65,65,65,65,65,65,57,49,40,45,45,45,45,45,45,45,45,45,49,53,61,65,65,65,65,65,65,65,65,65,61,53,49^0,170,0,170,0,170,0,170,85,255,85,255,85,255,85,255,16,32,53,69,101,117,138,154,186,202,223,239,255,255,255,255,255,190,130,65,0,0,0,0,0,0,0,0,0,65,130,190,255,255,255,255,255,255,255,255,255,223,190,158,130,130,130,130,130,130,130,130,130,158,190,223,255,255,255,255,255,255,255,255,255,239,223,202,186,186,186,186,186,186,186,186,186,202,223,239,255,255,255,255,113,113,113,113,113,85,57,28,0,0,0,0,0,0,0,0,0,28,57,85,113,113,113,113,113,113,113,113,113,97,85,69,57,57,57,57,57,57,57,57,57,69,85,97,113,113,113,113,113,113,113,113,113,105,97,89,81,81,81,81,81,81,81,81,81,89,97,105,113,113,113,113,65,65,65,65,65,49,32,16,0,0,0,0,0,0,0,0,0,16,32,49,65,65,65,65,65,65,65,65,65,57,49,40,32,32,32,32,32,32,32,32,32,40,49,57,65,65,65,65,65,65,65,65,65,61,53,49,45,45,45,45,45,45,45,45,45,49,53,61,65,65,65,65) => "VGA" +elif $pal_win95 (0,128,0,128,0,128,0,192,192,166,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,204,255,51,102,153,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,42,42,42,42,42,42,42,42,42,255,160,128,255,0,255,0,255,0,255^0,0,128,128,0,0,128,192,220,202,63,63,95,95,95,95,127,127,127,127,159,159,159,159,191,191,191,191,223,223,223,223,255,255,255,255,0,0,0,0,31,31,31,31,63,63,63,63,95,95,95,95,127,127,127,127,159,159,159,159,191,191,191,191,223,223,223,223,255,255,255,255,0,0,0,0,31,31,31,31,63,63,63,63,95,95,95,95,127,127,127,127,159,159,159,159,191,191,191,191,223,223,223,223,255,255,255,255,0,0,0,0,31,31,31,31,63,63,63,63,95,95,95,95,127,127,127,127,159,159,159,159,191,191,191,191,223,223,223,223,255,255,255,255,0,0,0,0,31,31,31,31,63,63,63,63,95,95,95,95,127,127,127,127,159,159,159,159,191,191,191,191,223,223,223,223,255,255,255,255,0,0,31,31,31,31,63,63,63,63,95,95,95,95,127,127,127,127,159,159,159,159,191,191,191,191,223,223,223,223,255,255,204,204,255,255,255,255,127,127,127,127,159,159,159,159,191,191,191,191,223,223,223,223,255,255,0,0,0,0,31,31,31,31,63,63,251,160,128,0,255,255,0,0,255,255^0,0,0,0,128,128,128,192,192,240,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,85,170,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,85,170,255,255,255,255,255,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,85,170,0,85,170,255,0,85,170,255,0,85,240,164,128,0,0,0,255,255,255,255) => "Win 95-256" +elif $pal_zx (0,255,255,0,0,255,255,0,192,0,0,192,192,0,192^0,255,0,255,0,255,0,255,0,192,0,192,0,192,192^0,255,0,0,255,0,255,255,0,0,192,0,192,192,192) => "ZX Spectrum" +elif $pal_gnome32 (234,186,128,86,197,131,93,68,224,193,136,102,173,136,98,73,157,117,75,49,239,224,179,130,223,153,238,209,70,38,255,0^232,181,125,82,210,166,117,86,182,102,70,56,167,127,91,64,184,144,105,78,224,195,145,102,66,0,214,148,160,119,255,0^227,171,116,72,200,127,85,50,175,90,49,34,200,163,129,102,210,174,131,108,205,158,105,71,30,0,128,12,70,38,255,0) => "GNOME 32" +elif $pal_elc22 (0,85,168,255,168,254,168,254,254,168,255,4,6,4,6,0,0,0,118,168,254,254^0,69,168,255,0,0,85,118,168,168,255,168,255,168,255,118,0,0,0,0,0,0^0,85,168,255,0,0,0,0,118,0,4,0,4,168,255,255,168,255,255,168,255,118) => "Electronic Crayon 22" +elif $pal_chip16 (214,58,0,83,112,6,99,142,89,124,86,234,196,111,229,216^75,35,0,140,198,62,114,55,142,182,83,200,133,26,229,162^97,51,20,193,229,76,114,55,51,73,73,121,78,113,229,162) => "Chip16" +elif $pal_deluxepaint (0,170,101,223,207,223,207,138,81,65,32,0,0,0,0,0,48,69,69,48,138,69,207,223,211,178,146,113,81,65,32,0,227,195,178,146,130,0,0,0,0,0,113,81,65,48,32,0,0,0,0,0,0,243,227,211,195,178,162,243,227,211,211,195,178,178,162,146,130,113,97,81,65,146,130,113,97,81,65,48,32,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,227,195,178,146,227,195,178,146,130,97,81,65,243,243,243,243,243,243,243,243,243,243,227,227,211,211,195,227,195,178,146,130,113,81,65,178,178,162,162,146,211,195,178,162,146,130,113,97,130,130,113,113,97,97,81,211,178,146,130,97,65,32,1,65,48,32,1,0,0,0,0,243,243,130,130,130,178,243,0,0,0,0,0,0,195,195,195,195,195,146,113,65,211,178,146,113,81,65,32,1,32,32,32,32,32,32,32,32,1,0,0,0,0,0,0,0,81,130,178,195,195,195,243^0,170,101,223,48,138,223,138,178,178,162,146,130,113,97,81,138,223,223,138,138,48,48,138,211,178,146,130,97,65,32,0,227,195,178,146,130,0,0,0,0,0,113,81,65,48,32,0,0,0,0,0,0,0,0,0,0,0,0,211,178,146,113,81,65,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,211,178,146,113,81,65,32,178,146,113,81,65,32,0,162,146,130,113,97,97,81,65,0,0,0,0,0,0,0,0,243,243,243,243,243,243,243,243,227,211,195,178,178,162,146,211,195,162,146,130,97,81,65,130,113,113,97,81,243,243,243,243,227,195,178,146,65,48,48,32,32,16,16,243,243,243,243,243,243,243,243,16,0,0,227,211,195,178,162,178,243,243,243,130,130,130,146,130,113,97,81,65,32,65,113,146,195,195,195,195,243,243,243,243,243,243,243,243,195,195,195,195,162,113,81,32,227,195,178,146,130,113,81,65,32,32,32,32,32,32,243^0,170,101,223,69,69,69,48,243,243,243,243,227,195,178,146,69,69,207,207,223,207,207,207,243,243,243,243,243,243,243,243,227,195,178,146,130,227,211,195,178,162,113,81,65,48,32,146,130,113,97,81,65,0,0,0,0,0,0,243,243,243,243,243,243,243,243,0,0,0,0,0,0,227,195,178,146,130,113,81,65,211,178,146,113,81,65,32,243,243,243,243,243,243,243,81,65,32,0,0,0,0,0,227,195,178,146,130,113,81,65,211,178,146,113,81,65,32,0,211,195,178,162,146,146,130,0,0,0,0,0,0,0,0,113,97,97,81,65,81,65,32,0,0,0,0,0,48,48,32,32,16,16,16,211,178,146,113,81,65,32,0,0,0,0,0,0,0,0,0,130,130,130,243,243,243,243,0,0,0,0,0,0,32,32,32,32,32,32,32,32,243,243,243,243,243,243,243,243,48,81,130,178,195,195,195,195,227,195,178,146,130,113,81,65,195,195,195,162,130,81,243) => "Deluxe Paint" +elif $pal_flat_ui (26,22,46,39,52,41,155,142,52,44,241,243,230,211,231,192,236,189,149,127^188,160,204,174,152,128,89,68,73,62,196,156,126,84,76,57,240,195,165,140^156,133,113,96,219,185,182,173,94,80,15,18,34,0,60,43,241,199,166,141) => "FlatUI from flat ui colors website" +elif $pal_makecode_arcade (255,255,255,255,255,36,120,0,135,142,164,92,229,145,0^255,33,147,129,246,156,220,63,242,46,131,64,205,70,0^255,33,196,53,9,163,82,173,255,196,159,108,196,61,0) => "MakeCode Arcade Palette" +elif $pal_oekaki (0,144,230,255,154,60,56,36,56,77,143,240,255,217,144,76,107,164,201,241^0,144,228,255,195,142,66,49,77,125,179,203,220,125,100,67,11,49,108,168^0,144,213,255,224,231,161,61,81,35,50,105,199,60,45,52,72,63,127,202) => "Oekaki from Oekaki.nl" +elif $pal_lms (0,126,190,255,126,254,4,6,255,126,0,0,126,254,4,6^0,126,190,255,0,0,126,255,255,126,0,0,0,0,126,255^0,126,190,255,0,0,0,4,4,0,126,255,126,255,126,255) => "Legacy Paint" +elif $pal_msxp (0,128,192,255,128,255,128,255,0,0,0,0,0,0,128,255,128,255,0,0,0,128,0,128,128,255,128,255^0,128,192,255,0,0,128,255,128,255,128,255,0,0,0,0,128,255,64,255,128,255,64,128,0,0,64,128^0,128,192,255,0,0,0,0,0,0,128,255,128,255,128,255,64,128,64,128,255,255,128,255,255,128,0,64) => "XP Paint" +elif $pal_vis (0,70,120,180,220,255,153,156,237,255,255,229,255,245,255,255,168,211,34,157,0,153,77,112,47,84,111,181^0,70,120,180,220,255,0,90,28,163,126,170,194,228,242,249,230,249,177,187,183,217,109,154,54,109,49,165^0,70,120,180,220,255,48,60,36,177,0,122,14,156,0,189,29,188,76,97,239,234,243,209,153,142,152,213) => "Vista Paint" +elif $pal_humanfaces (227,187,144,100,33,25,13,241,220,200,129,76,178,118,100,0,230,212,192,158,249,255,255,255,255,255,255,255,255,255,255,255,251,255,255,255,255,239,229,255,255,244,240,236,237,209,179,149,255,239,215,188,161,141,121,109,93,78,62,50,38,27,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,255,255,255,236,207,176,144,120,96,84,69,55,38,44,33,12,0^242,222,202,181,150,118,71,248,237,230,199,175,255,255,221,200,238,225,202,157,251,249,245,236,241,224,213,243,224,204,183,167,233,204,171,138,205,154,115,82,23,143,98,64,231,196,157,117,255,235,204,170,136,110,85,76,64,52,39,25,14,0,34,46,57,69,80,92,103,114,126,138,149,161,172,184,195,206,218,229,239,216,190,164,144,125,110,90,71,50,44,33,12,0^253,251,249,246,243,210,161,233,200,201,132,80,89,3,23,83,156,87,51,36,231,196,157,179,118,130,79,224,178,128,77,38,231,188,145,101,210,154,115,82,68,177,146,122,246,233,219,205,255,233,200,164,127,99,72,65,55,46,35,17,4,0,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200,241,220,197,174,156,139,122,100,79,56,44,33,12,0) => "Human Faces by Romney57" +elif $pal_madjikhsv (255,255,255,255,255,255,255,255,255,255,255,255,248,235,223,211,199,187,175,163,150,138,126,114,102,90,77,65,53,41,29,17,4,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7,19,31,43,55,68,80,92,104,117,129,141,154,166,178,190,203,215,227,240,252,255^5,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,13,26,38,50,62,74,86,98,111,123,135,147,159,171,184,196,208,220,232,244,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,245^116,129,141,153,165,177,189,201,213,225,237,249,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,252,240,228,216,203,191,179,167,154,142,130,118,105,93,81,69,56,44,32,19,7,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) => "HSV Palette by MadJik" +elif $pal_st24_christmas (26,51,77,115,140,166,204,229,242,242,242,255,216,184,152,122,93,80,58,47,35,31,27,22^13,20,23,32,42,50,71,101,136,170,206,255,242,242,217,204,179,153,128,102,77,64,51,38^15,22,23,29,35,41,51,69,97,133,182,255,194,145,119,92,71,61,45,36,27,26,23,19) => "ST24 Christmas by Skiller Thomson" +elif $pal_ladybugreds (255,250,255,124,237,205,194,234,178,150,128,164,234,126,255,180,210,202,191,66,184,94,141,147^255,138,36,10,41,92,24,17,34,0,0,90,60,25,168,55,31,52,10,13,15,25,2,58^255,114,170,2,57,92,7,95,34,24,0,82,83,27,170,87,60,51,48,9,10,20,41,22) => "Reds by Ladybug" +elif $pal_pastel_rainbow (238,243,253,123,3,132^64,119,244,192,146,9^53,54,152,67,207,218) => "Pastel Rainbow by Jayden Bowman" +else error "palette $mode no-exist" +fi +if $> out.=,$mode +else out=$mode +fi +pal_$mode= +} +v + e[^-1] "Create palette(s) '"$out"'." v - +status $out +#@cli rep_transfer_color_reduced: [palette],0<=_dither<=1,_pixel_ratio_w>=0,_pixel_ratio_h>=0,_windows_width>=0,_window_height>=0,_color_restriction_per_window>=0,_color_restriction_per_whole>=0,_number_of_alpha>=0,_alpha_dithering>=0,_alpha_mode={ 0=index | 1=window-index | 2=ordered },_alpha_restrict>=0 : { bit_depth | bit_a:...:bit_z | :[palette] },0<=_dither<=1,_pixel_ratio_w>=0,_pixel_ratio_h>=0,_color_restriction_per_whole>=0,_number_of_alpha>=0,_alpha_dithering>=0,_alpha_mode={ 0=index | 1=ordered } +#@cli : Change images to look as if it was reduced. Can be used to emulate old hardware. +rep_transfer_color_reduced: +skip ${3=1},${4=1},${5=1},${6=},${7=},${8=},${9=},${10=},${11=},${12=},${13=},${14=},${15=} +if ${is_image_arg\ $1} mode=0 +else mode={(find('$1',':',0,1)!=-1)||isint($1)} +fi +if $mode +location_of_bracket={find('$1','[',0,1)} +if $location_of_bracket!=-1 +('$1') +crop. $location_of_bracket,{w#-1-1} +img_arg={t} +rm. +pass$img_arg 0 +_rep_transfer_color_reduced[^-1] $mode,[-1],${2-10} +rm. +else _rep_transfer_color_reduced $mode,${1-10} +fi +else +pass$1 0 +_rep_transfer_color_reduced[^-1] $mode,[-1],${2-14} +rm. +fi +_rep_transfer_color_reduced: +skip ${3=1},${4=1},${5=1},${6=},${7=},${8=},${9=},${10=},${11=},${12=},${13=},${14=},${15=} +num_of_images,mode,special_effect={$!},$1,0 +if isnum($3)||${is_percent\ $3} +dither={cut($3,0,1)} +else +dither,special_effect={[$mode?.25,1]} +('$3') +split_point=-{w#-1-2} +split. x,$split_point +eff_factor={{-2,t}} +dither*=$eff_factor +ov={I(#-1,0)=='c'?4+(I(#-1,1)=='l'):(2*(I(#-1,0)=='l')+(I(#-1,1)=='v'))} +rm[-2,-1] +fi +pixel_ratio_w,pixel_ratio_h,rescale_back_w,rescale_back_h={pixel_ratio=vmax([1,1],int(abs([$4,$5])));[pixel_ratio,pixel_ratio*100]} +return_index_values={$mode?(narg($11)?$11%3:0):(narg($15)?$15%3:0)} +out_color={!$return_index_values} +number_of_alpha,alpha_dithering={$mode?(narg($8)?int(abs($8))):(narg($10)?int(abs($10)))},{$mode?(narg($9)?cut($9,0,1)):(narg($11)?cut($11,0,1))} +alpha_mode={$number_of_alpha?($mode?($10&1)*2+1:$12%3+1)} +color_restriction_per_window,color_restriction_whole={!$mode?(narg($8)?$8:0)},{$mode?(narg($7)?int(abs($7))):(narg($9)?int(abs($9)))} +if !$mode&&($color_restriction_whole?($color_restriction_whole<=$color_restriction_per_window)) color_restriction_per_window=0 fi +decrement_color_restriction_whole={$color_restriction_whole-1} +pixel_ratio_gcd={gcd($pixel_ratio_w,$pixel_ratio_h)} +if $pixel_ratio_gcd>1 pixel_ratio_w,pixel_ratio_h/=$pixel_ratio_gcd fi +if $pixel_ratio_w==1||$pixel_ratio_h==1 +initial_rescale_w,initial_rescale_h={bd=max($pixel_ratio_w,$pixel_ratio_h);100*($pixel_ratio_w>$pixel_ratio_h?vector(#2,1)/[bd,1]:vector(#2,1)/[1,bd])} +else +min_dimension,max_dimension={min($pixel_ratio_w,$pixel_ratio_h)},{max($pixel_ratio_w,$pixel_ratio_h)} +recip_rd={1/($max_dimension/$min_dimension)} +initial_rescale_w,initial_rescale_h={100*($pixel_ratio_w>$pixel_ratio_h?[$recip_rd,1]:[1,$recip_rd])} +fi +if $mode +threshold_map_level,alpha_threshold_map={narg($6)?$6:3} +alpha_restrict=$number_of_alpha +else +window_width,window_height,alpha_restrict,alpha_threshold_map={int(abs([narg($6)?int(abs($6)),narg($7)?int(abs($7))]))},{narg($13)?int(abs($13))},{narg($14)?$14:3} +if $window_width==1&&$window_height==1 color_restriction_per_window=0 fi +if $window_width&&!$window_height window_height+=1 fi +if $window_height&&!$window_width window_width+=1 fi +fi +use_images=0 +if ${is_image_arg\ $2} +pass$2 0 => palette +if !(s%2) error pal_cont_alp fi +if h#-1>1&&d#-1==1 rotate. -90 +elif h#-1>1&&d#-1>1 colormap. 0,,0 +fi +if $color_restriction_whole>=w#-1 color_restriction_whole=0 fi +if !$color_restriction_per_window color_restriction_per_window={w#-1} fi +store. img_palette +use_images+=1 +fi +if $alpha_mode?($alpha_mode<($mode?2:3)) +$number_of_alpha,1,1,1,"begin( +const dividier=(w-1)/255; +); +x/dividier;" +=> alpha +use_images+=1 +fi +if $use_images==2 +images="$>",-1 +v_col_info,v_alpha=[palette],[alpha] +elif $use_images==1 +images="$>",-1 +if ${is_image_arg\ $2} +v_col_info,v_alpha=[palette],$number_of_alpha +else +v_col_info,v_alpha=$2,[alpha] +fi +else +images="$>" +v_col_info,v_alpha=$2,$number_of_alpha +fi +contain_pal=${is_image_arg\ $v_col_info} +repeat $num_of_images { +local[{[$images]}] { +if s#0>4||!s#0 continue fi +targ_img_alp,con_img_palette={!(s#0%2)},0 +resize[0] $initial_rescale_w%,$initial_rescale_h%,100%,100%,3 +if $contain_pal +$img_palette +con_img_palette=1 +use_color_space_conversion,min_col_pos={s0=s#0;s0-=!(s0%2);csc=s0!=s#-1;s#-1>s0?[csc,-1]:[csc,0];} +if $use_color_space_conversion +if $min_col_pos==-1 to_gray[-1] +else +cs_convert=${arg\ s#0-1,to_gray,to_graya,to_rgb} +$cs_convert[0] +fi +fi +fi +if $targ_img_alp?$out_color +sh[0] 0,{s#0-2} +if $color_restriction_whole&&$con_img_palette ++index[-1] [palette],1,0 +histogram. 100% +{w},1,1,1,x +pixelsort. -,x,.. +crop. 0,0,$decrement_color_restriction_whole,0 +map. [palette] +if $special_effect _rep_transfer_color_reduced_special_effect[-3] $ov,$eff_factor fi +if $mode rep_ordered_dithering[-3] [-1],$dither,$threshold_map_level,$out_color,1 +else rep_index_by_window_and_color_restriction[-3] [-1],$dither,$color_restriction_per_window,$window_width,$window_height,1,$out_color +fi +rm[-2,-1] +else +if $special_effect _rep_transfer_color_reduced_special_effect[-1] $ov,$eff_factor fi +if $mode rep_ordered_dithering[-1] $v_col_info,$dither,$threshold_map_level,$out_color,1 +else rep_index_by_window_and_color_restriction[-1] $v_col_info,$dither,$color_restriction_per_window,$window_width,$window_height,1,$out_color +fi +fi +rm. +if $alpha_mode +sh[0] {s#0-1} +if $alpha_mode==3 rep_ordered_dithering[-1] $v_alpha,$alpha_dithering,$alpha_threshold_map,$out_color,1 +elif $alpha_mode==2 rep_index_by_window_and_color_restriction[-1] $v_alpha,$alpha_dithering,$alpha_restrict,$window_width,$window_height,1,$out_color +else index[-1] $v_alpha,$alpha_dithering,1 +fi +rm. +fi +else +if $targ_img_alp split_opacity[0] fi +if $color_restriction_whole&&$con_img_palette ++index[0] [palette],1,0 +histogram. 100% +{w},1,1,1,x +pixelsort. -,x,.. +crop. 0,0,$decrement_color_restriction_whole,0 +map. [palette] +if $mode rep_ordered_dithering[0] [-1],$dither,$threshold_map_level,$out_color,1 +else rep_index_by_window_and_color_restriction[0] [-1],$dither,$color_restriction_per_window,$window_width,$window_height,1,$out_color +fi +rm[-2,-1] +else +if $mode rep_ordered_dithering[0] $v_col_info,$dither,$threshold_map_level,$out_color,1 +else rep_index_by_window_and_color_restriction[0] $v_col_info,$dither,$color_restriction_per_window,$window_width,$window_height,1,$out_color +fi +fi +if $targ_img_alp +if $return_index_values +if $alpha_mode==3 rep_ordered_dithering[1] $v_alpha,$alpha_dithering,$alpha_threshold_map,$out_color,1 +elif $alpha_mode==2 rep_index_by_window_and_color_restriction[1] $v_alpha,$alpha_dithering,$alpha_restrict,$window_width,$window_height,1,$out_color +else index[1] $v_alpha,$alpha_dithering,$out_color +fi +a[0,1] c +else rm[1] +fi +fi +fi +if $con_img_palette rm[palette] fi +if $return_index_values!=2 resize[0] $rescale_back_w%,$rescale_back_h%,100%,100%,1 fi +} +} +remove_named alpha +_rep_transfer_color_reduced_special_effect: +if $1>3 +f ":begin( +const eff_factor=cut($2,0,1)/4; +const overlay_value=($1&1)*255; +arr_overlay=vector(#s,overlay_value); +); +((x+y)&1)?lerp(I,arr_overlay,eff_factor):I;" +else +f ":begin( +const overlay_value=(int($1/2)%2)*255; +const eff_factor=cut($2,0,1)/4; +const direction=$1%2; +arr_overlay=vector(#s,overlay_value); +direction?( +eff_app()=x%2?(lerp(I,arr_overlay,eff_factor);):I; +):( +eff_app()=y%2?(lerp(I,arr_overlay,eff_factor);):I; +); +); +eff_app();" +fi +#@cli rep_index_by_window_and_color_restriction:[palette],0<=_dithering<=1,_color_restriction>2,_window_width,_window_height,_window_depth,_map_palette={ 0 | 1 } +#@cli : Index images per window +rep_index_by_window_and_color_restriction: +skip ${2=1},${3=},${4=1},${5=1},${6=1},${7=1} +dithering,wi_w,wi_h,wi_d,map_palette,timg={cut($2,0,1)},{vmax(vector(#3,1),int(abs([${4-6}])))},{$7%2},{$!} +pass$1 1 +if h#-1>1&&d#-1==1 +rm. pass$1 0 +rotate. -90 +elif h#-1>1&&d#-1>1 +rm. pass$1 0 +colormap. 0,,0 +fi +col_res={narg($3)?cut(int(abs($3)),2,w#-1):w#-1} +dec_col_res={$col_res-1} +if $dithering +jjn_1R0D,jjn_2R0D,jjn_2L1D,jjn_1L1D,jjn_M01D,jjn_1R1D,jjn_2R1D,jjn_2L2D,jjn_1L2D,jjn_M02D,jjn_1R2D,jjn_2R2D={([7,5,3,5,7,5,3,1,3,5,3,1]/48)*$dithering} +fi +eval " +const spectrum_size=s#-1; +const rf=$timg; +valid_spec=1; +repeat(rf,id, +if(s#id!=spectrum_size,valid_spec=0;break();); +); +valid_spec; +" +if !${} error incompatible_img_pal fi +if $col_res>=w#-1 +index[^-1] [-1],$dithering,$map_palette +rm. +return +fi +repeat $timg { +local[$>,-1] { +ow,oh,od,tw,th,td,nw,nh,nd={od=[w#0,h#0,d#0];wd=vmin([w#0,h#0,d#0],[$wi_w,$wi_h,$wi_d]);td=ceil(od/wd);nd=td*wd;[od,td,nd]} +if [$tw,$th,$td]==vector(#3,1) ++index[0] [1],1,0 +histogram. 100% +{w},1,1,1,x +pixelsort. -,x,.. +crop. 0,0,$dec_col_res,0 +map. ... +index[0] .,$dithering,$map_palette +else +r[0] $nw,$nh,$nd,100%,0,3,.5,.5,.5 ++index[0] [1],{$dithering?.75},0 +$tw,$th,$td,1,*"begin( +const nb_cols=w#1; +const spectrum_size=s#1; +const inc_spectrum_size=spectrum_size+1; +const nb_restrict=$col_res; +const dec_nb_restrict=nb_restrict-1; +const res_y_spec=nb_restrict*spectrum_size; +const wi_w=$wi_w; +const wi_h=$wi_h; +const wi_d=$wi_d; +const dec_wi_w=wi_w-1; +const dec_wi_h=wi_h-1; +const dec_wi_d=wi_d-1; +const box_dim=wi_w*wi_h*wi_d; +init_freq_y_ind=expr('(x%2)?int(x/2);',nb_cols*2); +init_sel_res_pal_dist_arr=vector(#nb_restrict,0); +const dithering_mode=$dithering; +const map_palette=$map_palette; +dithering_mode?( +const jjn_1R0D=$jjn_1R0D; +const jjn_2R0D=$jjn_2R0D; +const jjn_2L1D=$jjn_2L1D; +const jjn_1L1D=$jjn_1L1D; +const jjn_M01D=$jjn_M01D; +const jjn_1R1D=$jjn_1R1D; +const jjn_2R1D=$jjn_2R1D; +const jjn_2L2D=$jjn_2L2D; +const jjn_1L2D=$jjn_1L2D; +const jjn_M02D=$jjn_M02D; +const jjn_1R2D=$jjn_1R2D; +const jjn_2R2D=$jjn_2R2D; +v_col()=I(#2,pos_x,pos_y,pos_z); +map_palette?( +result_img_part()=( +old_color=I(#0,pos_x,pos_y,pos_z); +new_color=I(#1,res_col_id[argmin(sqrt(res_color_sum))],0,0); +I(#0,pos_x,pos_y,pos_z)=new_color; +); +):( +result_img_part()=( +old_color=I(#0,pos_x,pos_y,pos_z); +new_color_pos=res_col_id[argmin(sqrt(res_color_sum))]; +new_color=I(#1,new_color_pos,0,0); +i(#0,pos_x,pos_y,pos_z,0)=new_color_pos; +); +); +result_img()=( +result_img_part(); +diff_color=old_color-new_color; +use_strip_1D=(pos_y+1)min_out_of_boundary_offset_pos[0]?( +use_strip_1D?( +I(#0,pos_x-2,pos_y+1,pos_z)+=diff_color*jjn_2L1D; +); +use_strip_2D?( +I(#0,pos_x-2,pos_y+2,pos_z)+=diff_color*jjn_2L2D; +); +); +(pos_x-1)>min_out_of_boundary_offset_pos[0]?( +use_strip_1D?( +I(#0,pos_x-1,pos_y+1,pos_z)+=diff_color*jjn_1L1D; +); +use_strip_2D?( +I(#0,pos_x-1,pos_y+2,pos_z)+=diff_color*jjn_1L2D; +); +); +(pos_x+1)0,0<=dither<=1,threshold_map_iter>0,map_pal={ 0 | 1 },_use_previous_threshold_map={ 0 | 1 } : +#@cli : level_a>0:.:level_z>0,0<=dither<=1,threshold_map_iter>0,map_pal={ 0 | 1 },_use_previous_threshold_map={ 0 | 1 } : +#@cli : [palette],0<=dither<=1,threshold_map_iter>0,map_pal={ 0 | 1 },_use_previous_threshold_map={ 0 | 1 } : +#@cli : level<0,0<=dither<=1,threshold_map_iter>0,spread,_use_previous_threshold_map={ 0 | 1 } +#@cli : +#@cli : Apply ordered dithering effect onto image. +#@cli : +#@cli : Note A: depth_a:.:depth_z implies that the first argument is a set of arguments joined by the ':' char. This is used for separating bit depth channels. +#@cli : Note B: Negative value is used to alter values of images without indexing, and that is useful for generating windows-based ordered-dithering with the use of rep_index_by_window_and_color_restriction command. +rep_ordered_dithering: +skip ${4=1},${5=0} +check "($2?($2>=0&&$3>0):1)" +dithering,iteration={cut(abs($2),0,1)},{int(abs($3))} +if ${is_image_arg\ $1} use_pal_image=1 +else use_pal_image=0 +fi +command "convert_first_arg_to_mul_args : +('$1') +local[-1] { +split. -,{':'} +foreach[^-1] { +(',') +a y +} +a y +} +_bit_depths={t} rm. +u $_bit_depths" +command "index_from_bitmaps : +t_bit_depths:=[$_bit_depths]+1 +foreach { +if s>$_narg_bit_depths +sh. 0,{$_narg_bit_depths-1} +fi +if s==3 +dims:=vector3($t_bit_depths,1,1) +$dims,{s},:\"begin( +const mxi=w-1; +const myi=h-1; +const mzi=d-1 +); +[x/mxi,y/myi,z/mzi]*255;\" +elif s==2 +dims:=vector3(vector2($t_bit_depths),1,1) +$dims,{s},:\"begin( +const mxi=w-1; +const myi=h-1; +); +[x/mxi,y/myi]*255;\" +else +dims:=vector1(vector2($t_bit_depths),1,1) +$dims,{s},\"begin( +const mxi=w-1; +); +x/mxi*255;\" +fi +index[-2] [-1],0,1 +k[0] +}" +if isnum($1) +if $1<0 +if $#!=4 error inv_arg_cnt fi +if $-1==0 error inv_spr fi ++rep_bayer_threshold_map $iteration,,$5 +f[^-1] "begin( +const n=w#-1-1; +const dithering=$dithering*abs($-1); +); +thres_x=x&n; +thres_y=y&n; +threshold_map=i(#-1,thres_x,thres_y,0,0); +new_color=(I+threshold_map*dithering);" +rm. +return +fi +fi +if $use_pal_image +pass$1 0 ++rep_bayer_threshold_map $iteration,,$5 +repeat $!-2 { +local[$>,-2,-1] { +{w#0},{h#0},100%,1," +v_col=I#0; +color_sum=vector(#w#-2,0); +repeat(s#-2,k, +color_sum+=sqr(crop(#-2,0,0,0,k,w#-2,1,1,1)-v_col[k]); +); +color_sum=sqrt(color_sum); +p=argmin(color_sum); +color_sum[p]; +" +spread:=ic#-1*2 +rm. +if $spread +f[0] "begin( +const n=w#-1-1; +const scale=$dithering*$spread; +); +thres_x=x&n; +thres_y=y&n; +threshold_map=i(#-1,thres_x,thres_y,0,0); +v_col=cut((I+threshold_map*scale),0,255);" +index[0] [1],0,$4 +fi +} +} +rm[-2,-1] +else +if $dithering +_bit_depths=${-convert_first_arg_to_mul_args} +var_bit_depths:=var($_bit_depths) +if !$var_bit_depths&&narg($_bit_depths)>0 +_bit_depths:=([$_bit_depths])[0] +fi +if isint($_bit_depths) ++rep_bayer_threshold_map $iteration,,$5 +f[^-1] "begin( +const n=w#-1-1; +const bit_depth=max(1,int(abs($_bit_depths))); +const scale=255/bit_depth; +const end_scale=$4?scale:1; +const dithering=$dithering; +const internal_scale=scale*dithering; +const power_level=s>1?2^(1/(bit_depth+.5)):1; +); +thres_x=x&n; +thres_y=y&n; +threshold_map=i(#-1,thres_x,thres_y,0,0); +new_color=(I+internal_scale*threshold_map)/scale; +inew_color=int(new_color); +exp_dist_from_inew_color=abs(new_color-inew_color)^power_level; +cut(round(lerp(new_color,exp_dist_from_inew_color+inew_color,dithering))*end_scale,0,255);" +rm. +else +_narg_bit_depths:=narg($_bit_depths) +if $_narg_bit_depths>3 error excess_args fi ++rep_bayer_threshold_map $iteration +f[^-1] "begin( +const n=w#-1-1; +const dithering=$dithering; +_bit_depths=vector(#s,"$_bit_depths"); +scale=255/_bit_depths; +internal_scale=scale*dithering; +power_level=2^(1/_bit_depths); +); +thres_x=x&n; +thres_y=y&n; +threshold_map=i(#-1,thres_x,thres_y,0,0); +new_color=(I+internal_scale*threshold_map*dithering);" +rm. +index_from_bitmaps +fi +else +if isint($1) +f "begin( +const bit_depth=max(1,int(abs($1))); +const scale=255/bit_depth; +); +round(I/scale)*scale;" +else +_bit_depths=${-convert_first_arg_to_mul_args} +_narg_bit_depths:=narg($_bit_depths) +if $_narg_bit_depths>3 error excess_args fi +index_from_bitmaps +fi +fi +fi +uncommand convert_first_arg_to_mul_args,index_from_bitmaps +#@cli +rep_bayer_threshold_map: iteration,_normalize,_load_preserved_map +#@cli : Create Bayer Threshold Map ++rep_bayer_threshold_map: +skip ${2=1},${3=0} +if narg($_bayer_threshold_map)&&$3 +$_bayer_threshold_map +else +ws=2 +(0,2;3,1) ++store. initial_map +repeat $1 { +ws*=2 +$initial_map +$ws,$ws +eval[-2] "begin( +const ws=$ws; +const half_ws=ws>>1; +initial=crop(#-3); +); +M_Surface=initial*4; +M_Surface+=i; +draw(#-1,M_Surface,x*half_ws,y*half_ws,0,0,half_ws,half_ws,1,1); +" +rm[-3,-2] +} +if $2 ++. 1 +/. {4^($1+1)} +-. {ia#-1} +fi ++store. _bayer_threshold_map +fi +#@cli modf: eq. to 'modular_formula'. +modf: +skip ${2=255},${3=100%} +max_img_ind={$!-1} +modf_arg2,modf_arg3=${2-3} +if ${is_image_arg\ $2} +pass$2 1 +name[-1] max_channel_image +modf_arg2=[$max_channel_image] +fi +if ${is_image_arg\ $3} +pass$3 1 +name[-1] channel_values_image +modf_arg3=[$channel_values_image] +fi +modular_formula[0-$max_img_ind] $1,$modf_arg2,$modf_arg3 +keep[0-$max_img_ind] +#@cli modular_formula : operation,max_channel_value={ float_value | [image] },_channel_values={ float_value(%) | [image] } +#@cli : Apply modular formulas into selected images. 'channel_value' can be values outside the channel ranges of image. +#@cli : When using a image argument to max_channel_value, the dimension should be equal to the spectrum of target images. +#@cli : When using a image argument to channel_value, it can be single spectrum or equal to the spectrum of target images. +#@cli : (eq. to 'modf'). +#@cli : operation can be { 0=modulo | 1=modulo_continuous | 2=divisive | 3=divisive_continuous | 4=additive | 5=additive_continuous} +#@cli : In addition, the operation variable can be the corresponding string as argument. +#@cli : Author: Reptorian. +#@cli : Default value: '_channel_value=100%' +modular_formula: +skip ${2=255},${3=100%} +if isint($1) +modular_mode={int($1)%6} +else +modulo,modulo_continuous,divisive,divisive_continuous,additive,additive_continuous=0,1,2,3,4,5 +modular_mode=$$1 +if !narg($modular_mode) error invalid_input fi +fi +max_images_index,utilize_max_channel_image,utilize_channel_values_image={$!-1},0,0 +if ${is_image_arg\ $2} +pass$2 1 +name[-1] max_channel_image +if find(crop(#-1),0,0,1)+1 error invalid_max_chan_val_set fi +utilize_max_channel_image=1 +if s==1 max_channel={i} fi +else +if !$2 error invalid_max_chan_val fi +fi +if ${is_image_arg\ $3} +pass$3 1 +name[-1] channel_values_image +utilize_channel_values_image=1 +else +use_percent_mode=${is_percent\ $3} +if !$3 +if $modular_mode==2||$modular_mode>3 return +else +foreach { 100%,100%,100%,100% rm.. } return +fi +fi +fi +fill[0-$max_images_index] "begin( +const modular_mode=$modular_mode; +const epsilon=1E-13; +const utilize_max_channel_image=$utilize_max_channel_image; +if(utilize_max_channel_image, +const max_channel_reference=$max_channel_image; +whds#max_channel_reference==1?( +const max_channel=$max_channel; +const max_channel_mod=max_channel+epsilon; +const double_max_channel=max_channel*2; +const use_max_channel_array=0; +):( +max_channel=crop(#max_channel_reference); +max_channel_mod=max_channel+epsilon; +double_max_channel=max_channel*2; +const use_max_channel_array=1; +); +, +const max_channel=$2; +const max_channel_mod=max_channel+epsilon; +const double_max_channel=max_channel*2; +const use_max_channel_array=0; +); +if($utilize_channel_values_image, +const channel_values_reference=$channel_values_image; +const spectrum_size_of_channel_values_reference=s#channel_values_reference; +const multispectrum_mode=spectrum_size_of_channel_values_reference>1; +multispectrum_mode?( +multiplier()=( +channels_values=I#channel_values_reference; +nonzero_values=!!channels_values; +zero_values=!channels_values; +channels_values+=zero_values; +result_multiplier(); +);0; +):( +multiplier()=( +channel_value=i(#channel_values_reference,x,y,z,0); +channel_value?max_channel/channels_values; +);0; +); +modular_mode==0?( +multispectrum_mode?( +modular_output()=( +channels_values=abs(I#channel_values_reference); +multiplier=!!channels_values; +(I%(channels_values+epsilon)*multiplier)%max_channel_mod; +); +):( +modular_output()=( +channel_value=i(#channel_values_reference,x,y,z,0); +channel_value?I%(channel_value+epsilon)%max_channel_mod; +); +); +): +modular_mode==1?( +multispectrum_mode?( +modular_output()=( +channels_values=I#channel_values_reference; +multiplier=!!channels_values; +channels_values+=epsilon*(1-multiplier); +a=I%(channels_values*2)%max_channel_mod; +multiplier*(channels_values-abs(channels_values-a)); +); +):( +modular_output()=( +channel_value=i(#channel_values_reference,x,y,z,0); +channel_value?( +double_channel_value=channel_value*2; +a=I%double_channel_value; +channel_value-abs(channel_value-a); +); +); +); +): +modular_mode==2?( +multispectrum_mode?( +result_multiplier()=nonzero_values*(max_channel/channels_values)+zero_values; +modular_output()=(I*multiplier())%max_channel_mod; +):( +modular_output()=( +channel_value=i(#channel_values_reference,x,y,z,0); +channel_value?( +(I*(max_channel/channel_value))%max_channel_mod; +):I; +); +); +): +modular_mode==3?( +multispectrum_mode?( +result_multiplier()=nonzero_values*(max_channel/channels_values); +modular_output()=( +a=(I*multiplier())%double_max_channel; +max_channel-abs(max_channel-a); +); +):( +modular_output()=( +channel_value=i(#channel_values_reference,x,y,z,0); +channel_value?( +a=(I*(max_channel/channel_value))%double_max_channel; +max_channel-abs(max_channel-a); +); +); +); +): +modular_mode==4?( +multispectrum_mode?( +modular_output()=(I+I#channel_values_reference)%max_channel_mod; +):( +modular_output()=(I+i(#channel_values_reference,x,y,z,0))%max_channel_mod; +); +):( +multispectrum_mode?( +modular_output()=( +a=(I+I#channel_values_reference)%double_max_channel; +max_channel-abs(max_channel-a); +); +):( +modular_output()=( +a=(I+i(#channel_values_reference,x,y,z,0))%double_max_channel; +max_channel-abs(max_channel-a); +); +); +); +, +const use_percent_mode=$use_percent_mode; +const divisive_mode=inrange(modular_mode,2,3,1,1); +if(divisive_mode, +use_percent_mode?( +const multiplier=1/$3; +):( +utilize_max_channel_image?( +multiplier=max_channel/$3; +):( +const multiplier=max_channel/$3; +); +); +, +use_percent_mode?( +use_max_channel_array?( +channels_values=max_channel*$3; +if(modular_mode&1, +double_channels_values=channels_values*2; +); +sum_channels_values_eps=channels_values+epsilon; +):( +const channels_values=max_channel*$3; +if(modular_mode&1, +const double_channels_values=channels_values; +); +const sum_channels_values_eps=channels_values+epsilon; +); +):( +use_max_channel_array?( +channels_values=vector(#s,$3); +if(modular_mode&1, +double_channels_values=channel_values*2; +); +sum_channels_values_eps=channels_values+epsilon; +):( +const channels_values=$3; +if(modular_mode&1, +const double_channels_values=channels_values*2; +); +const sum_channels_values_eps=channels_values+epsilon; +); +); +); +modular_mode==0?( +modular_output()=I%sum_channels_values_eps%max_channel_mod; +): +modular_mode==1?( +modular_output()=( +a=I%double_channels_values; +channels_values-abs(channels_values-a); +); +): +modular_mode==2?( +modular_output()=(I*multiplier)%max_channel_mod; +): +modular_mode==3?( +modular_output()=( +a=(I*multiplier)%double_max_channel; +max_channel-abs(max_channel-a); +); +): +modular_mode==4?( +modular_output()=(I+channels_values)%max_channel_mod; +):( +modular_output()=( +a=(I+channels_values)%double_max_channel; +max_channel-abs(max_channel-a); +); +); +); +); +modular_output(); +" +keep[0-$max_images_index] +#@cli rep_bchstatfunc: eq. to 'rep_by_channel_statistical_function'. +rep_bchstatfunc : rep_by_channel_statistical_function $* +#@cli rep_by_channel_statistical_function: _variable,_resize_bool={ 0=Do not resize | 1= Resize to 1x1 } +#@cli : Creates 1x1 image based on defined variables that depends on image value (minimum, maximum, average, variance, sum, product and median) +#@cli : (eq. to 'rep_bchstatfunc').\n +#@cli : Default value: 'resize_bool=0' +rep_by_channel_statistical_function: +v - _gmic_s="$?" v + +_$0 $"*" +_rep_by_channel_statistical_function: +skip ${2=1} +v - mvcma="$1" +if isnum("$1") if isint("$1") mvcma=${arg\ 1+$1,min,max,avg,var,sum,pro,med} fi fi +foreach { v - _rep_bchstatfunc_$mvcma $2 } +_rep_bchstatfunc_im : _rep_bchstatfunc_min $1 +_rep_bchstatfunc_minimum : _rep_bchstatfunc_min $1 +_rep_bchstatfunc_min : repeat s sh $> f. im#-1 rm. done if $1 r 1,1,1,{s},0 fi +_rep_bchstatfunc_iM : _rep_bchstatfunc_max $1 +_rep_bchstatfunc_maximum : _rep_bchstatfunc_max $1 +_rep_bchstatfunc_max : repeat s sh $> f. iM#-1 rm. done if $1 r 1,1,1,{s},0 fi +_rep_bchstatfunc_ia : _rep_bchstatfunc_avg $1 +_rep_bchstatfunc_average : _rep_bchstatfunc_avg $1 +_rep_bchstatfunc_avg : repeat s sh $> f. ia#-1 rm. done if $1 r 1,1,1,{s},0 fi +_rep_bchstatfunc_iv : _rep_bchstatfunc_var $1 +_rep_bchstatfunc_variance : _rep_bchstatfunc_var $1 +_rep_bchstatfunc_var : repeat s sh $> f. iv#-1 rm. done if $1 r 1,1,1,{s},0 fi +_rep_bchstatfunc_is : _rep_bchstatfunc_sum $1 +_rep_bchstatfunc_total : _rep_bchstatfunc_sum $1 +_rep_bchstatfunc_sum : repeat s sh $> f. is#-1 rm. done if $1 r 1,1,1,{s},0 fi +_rep_bchstatfunc_ip : _rep_bchstatfunc_pro $1 +_rep_bchstatfunc_product : _rep_bchstatfunc_pro $1 +_rep_bchstatfunc_pro : repeat s sh $> f. ip#-1 rm. done if $1 r 1,1,1,{s},0 fi +_rep_bchstatfunc_ic : _rep_bchstatfunc_med $1 +_rep_bchstatfunc_median : _rep_bchstatfunc_med $1 +_rep_bchstatfunc_med : repeat s sh $> f. ic#-1 rm. done if $1 r 1,1,1,{s},0 fi +#@cli rep_lbchstatfunc_to_pal: eq. to 'rep_layers_by_channel_statistical_function_to_palette'. +rep_lbchstatfunc_to_pal: rep_layers_by_channel_statistical_function_to_palette $* +#@cli rep_layers_by_channel_statistical_function_to_palette: _variable +#@cli : Converts layers to palette using statistical function by channels per layers into 1x1 tile, then append them. +#@cli : (eq. to 'rep_layers_by_channel_statistical_function_to_palette'). +rep_layers_by_channel_statistical_function_to_palette: rep_bchstatfunc $1 a x +#@cli rep_photomosaic : {foldername|[images_arg]},_tile_width>=0,_tile_height>=0,_dithering<=1,0<=_interpolation<=5,_palette={ 0=average, 1=median},_autocrop,_maxalp +#@cli : Generates mosaic using multiple pictures using indexing methodology, and uses either average or median to determine the mapping based on colors. Tile_Width and Tile_Height cannot be both zero!\n +#@cli : Author: Reptorian. +#@cli : Default value: 'tile_height=0', 'interpolation=5', 'autocrop=0' +rep_photomosaic: +skip ${3=0},${4=.5},${5=0},${6=0},${7=0},${8=255} +include_image_as_arg=${"is_image_arg $1"} +tile_width={round(abs($2))} +tile_height={round(abs($3))} +half_perimeter={$tile_width*$tile_height} +non_zero_length={$tile_width+$tile_height} +total_target_img={$!} +if !$tile_width&&!$tile_height error "($"1>0")"&&"($"2>0")"==F fi +e[^-1] "Generating Mosaic!" +if $include_image_as_arg +pass$1 0 +else +ig $1 +fi +total_end_img={$!} +if ($!-$total_target_img<2) error "_"#"imports>=2==F" fi +diff={$total_end_img-$total_target_img} +if ${-max_s}==4 to_rgba +elif ${-max_s}==3 to_rgb +elif ${-max_s}==2 to_graya +elif ${-max_s}==1 to_gray +fi +if s==2||s>3 contain_alpha=1 +else contain_alpha=0 +fi +endchan={s-2} +if $tile_width&&$tile_height +if $7 autocrop[$total_target_img--1] fi +rep_aspect_crop_2d[$total_target_img--1] $tile_width,$tile_height +if $contain_alpha +sh[$total_target_img--1] 0,{s-2} +if $5==1 +rep_lbchstatfunc_to_pal[$total_end_img--1] median +else +rep_lbchstatfunc_to_pal[$total_end_img--1] average +fi +rm[$total_end_img--2] +else +if $5==1 +rep_lbchstatfunc_to_pal[$total_target_img--1] median +else +rep_lbchstatfunc_to_pal[$total_target_img--1] average +fi +fi +repeat $total_target_img { +mini_width={ceil(w#$>/$tile_width)} +mini_height={ceil(h#$>/$tile_height)} +r[$>] {$mini_width*$tile_width},{$mini_height*$tile_height},100%,100%,0,1,.5,.5 +r[$>] $mini_width,$mini_height,100%,100%,{abs($6)+1} +if $contain_alpha +sh[$>] 0,$endchan +index. [-2],$4,1 +f. "begin( +const length=w#-2; +); +repeat(length,v, +if(I==I(#-2,v,0),break();); +); +v+$total_target_img;" +rm. +else +index[$>] [-1],$4,1 +f[$>] "begin( +const length=w#-1; +); +repeat(length,v, +if(I==I(#-1,v,0),break();); +); +v+$total_target_img;" +fi +} +rm. +r[$total_target_img--1] $tile_width,$tile_height,100%,100%,{abs($6)+1} +r[0-{$total_target_img-1}] {$tile_width*100}%,{$tile_height*100}%,100%,100%,1 +if $contain_alpha +f[0-{$total_target_img-1}] c1 +continue_loop=1 +count=1 +do +if (w#0==w#$count)&&(h#0==h#$count) +same_dim=1 +else +same_dim=0 +continue_loop=0 +fi +count+=1 +while $count<$total_target_img&&$continue_loop +fi +if $total_target_img==1||$same_dim +temp_tile_width={floor(w#0>h#0?$non_zero_length:w#0/h#0*$non_zero_length)} +temp_tile_height={floor(h#0>w#0?$non_zero_length:h#0/w#0*$non_zero_length)} +tile_width={$temp_tile_width} +tile_height={$temp_tile_height} +mini_width={ceil(w#0/$tile_width)} +mini_height={ceil(h#0/$tile_height)} +if $7 autocrop[$total_target_img--1] fi +rep_aspect_crop_2d[$total_target_img--1] $tile_width,$tile_height +if $contain_alpha +sh[$total_target_img--1] 0,{s-2} +if $5==1 +rep_lbchstatfunc_to_pal[$total_end_img--1] median +else +rep_lbchstatfunc_to_pal[$total_end_img--1] average +fi +rm[$total_end_img--2] +else +if $5==1 +rep_lbchstatfunc_to_pal[$total_target_img--1] median +else +rep_lbchstatfunc_to_pal[$total_target_img--1] average +fi +fi +r[0-{$total_target_img-1}] {$mini_width*$tile_width},{$mini_height*$tile_height},100%,100%,0,3,.5,.5 +r[0-{$total_target_img-1}] $mini_width,$mini_height,100%,100%,{abs($6)+1} +repeat $total_target_img { +if $contain_alpha +sh[$>] 0,$endchan +index. [-2],$4,1 +f. "begin(const length=w#-2;); +repeat(length,v, +if(I==I(#-2,v,0),break();); +); +v+$total_target_img;" +rm. +else +index[$>] [-1],$4,1 +f[$>] "begin(const length=w#-1;); +repeat(length,v, +if(I==I(#-1,v,0),break();); +); +v+$total_target_img;" +fi +} +rm. +r[$total_target_img--1] $tile_width,$tile_height,100%,100%,{abs($6)+1} +r[0-{$total_target_img-1}] {$tile_width*100}%,{$tile_height*100}%,100%,100%,1 +if $contain_alpha +f[0-{$total_target_img-1}] c>h#$>?$non_zero_length:w#$>/h#$>*$non_zero_length)} +temp_tile_height={floor(h#$>>w#$>?$non_zero_length:h#$>/w#$>*$non_zero_length)} +tile_width={$temp_tile_width} +tile_height={$temp_tile_height} +mini_width={ceil(w#$>/$tile_width)} +mini_height={ceil(h#$>/$tile_height)} ++rep_aspect_crop_2d[$total_target_img--1] $tile_width,$tile_height +if $contain_alpha +local[$total_end_img--1] { +endid={$!} +sh 0,{s-2} +if $5==1 +rep_lbchstatfunc_to_pal[$endid--1] median +else +rep_lbchstatfunc_to_pal[$endid--1] average +fi +rm[$endid--2] +} +else +if $5==1 +rep_lbchstatfunc_to_pal[$total_end_img--1] median +else +rep_lbchstatfunc_to_pal[$total_end_img--1] average +fi +fi +r[$>] {$mini_width*$tile_width},{$mini_height*$tile_height},100%,100%,0,3,.5,.5 +r[$>] $mini_width,$mini_height,100%,100%,{abs($6)+1} +if $contain_alpha +sh[$>] 0,$endchan +index. [-2],$4,1 +f. "begin(const length=w#-2;); +repeat(length,v, +if(I==I(#-2,v,0),break();); +); +v+$total_end_img; +" +rm. +else +index[$>] [-1],$4,1 +f[$>] "begin(const length=w#-1;); +repeat(length,v,if(I==I(#-1,v,0),break(););); +v+$total_end_img;" +fi +rm. +r[$total_end_img--1] $tile_width,$tile_height,100%,100%,{abs($6)+1} +r[$>] {$tile_width*100}%,{$tile_height*100}%,100%,100%,1 +if $contain_alpha +f[$>] c] i(#i,x%$tile_width,y%$tile_height,z,c) +fi +k[0-{$total_end_img-1}] +} +k[0-{$total_target_img-1}] +fi +fi +#@cli rep_aspect_crop_2d: width_ratio>0,height_ratio>0,-1<=_shift_factor[%]<=1 +#@cli : Crop images based on specified aspect ratio. +#@cli : Code for finding new dimension was provided by Sumruv in discord/generative. The code that was provided applies only in the case of ratio not equal to 1. +#@cli : Default value: 'shift_factor=0' +#@cli : Author: Reptorian. +rep_aspect_crop_2d: +skip ${3=0},${4=} +_glob_auto_use_same_shift_factors={narg($4)?1:0} +check "$1>0&&$2>0" +_glob_aspect_crop_ratio_2d_w,_glob_aspect_crop_ratio_2d_h,_glob_aspect_crop_2d_crop_shift_factor_a,_glob_aspect_crop_2d_crop_shift_factor_b=${1-2},{(cut(($_glob_auto_use_same_shift_factors?[$3,$4]:vector2($3)),-1,1)+1)/2} +_glob_aspect_crop_2d_crop_shift_factor,_glob_arc2d_crop_ratio={[$_glob_aspect_crop_2d_crop_shift_factor_a,$_glob_aspect_crop_ratio_2d_h/$_glob_aspect_crop_ratio_2d_w]} +if $_glob_aspect_crop_ratio_2d_w==$_glob_aspect_crop_ratio_2d_h +command "cmd_arc_2d_crop : +if w==h return fi +if w>h +start_point={int($_glob_aspect_crop_2d_crop_shift_factor_a*(w-h))} +crop $start_point,0,{$start_point+h-1},{h-1} +else +start_point={int($_glob_aspect_crop_2d_crop_shift_factor_b*(h-w))} +crop 0,$start_point,{w-1},{$start_point+w-1} +fi +" +else +command "cmd_arc_2d_crop : +ratio={h/w} +if $ratio==$_glob_arc2d_crop_ratio return fi +new_dim,mode={b=[w,h];aspect_ratio=$_glob_arc2d_crop_ratio;ny=min(b[0]*aspect_ratio,b[1]);ny0,_main_surf_x_factor>0,_main_surf_y_factor>0,-100<=_x_center[%]<=100,-100<=_y_center[%]<=100,0<=_fxyangle<=360,_wave,0<=_lighting_angle<=360,_disturbance>=0,_distx,_disty,0<=_distangle<=360,_disturbance_mode={ 0= do_not_scale | 1=scale_by_axisfact },_color={ 0=gray | 1=color },_alpha_base={ 0=None | 1=hard_light | 2=hard_shade | 3=soft_light | 4=soft_light },_subpixelevel>=0,subpixelprocessingmethod={ 0=Average | 1=Linear | 2=Grid | 3=Bicubic | 4=Lanczos } +#@cli : Creates a Nebulous texture inspired by its Paint.NET plugin equivalent made by MadJik.\n +#@cli : '_main_surf_xy_factor' - Amount of waves by xy-axis. +#@cli : '_main_surf_x_factor' - Amount of waves by x-axis. +#@cli : '_main_surf_y_factor' - Amount of waves by y-axis. +#@cli : '_x_center' - Placement of Nebulous texture relative to the center by x-axis. +#@cli : '_y_center' - Placement of Nebulous texture relative to the center by y-axis. +#@cli : '_fxyangle' - Function angle of Nebulous texture. +#@cli : '_wave' - Amount of waves within waves. +#@cli : '_lighting_angle' - Shifts color output within waves +#@cli : '_disturbance' - Multiplier for distortion. +#@cli : '_distx' - Distorts function by x-axis. +#@cli : '_disty' - Distorts function by y-axis. +#@cli : '_distangle' - Distortion function Angle +#@cli : '_disturbance_mode' - Influences how the distortion result is calculated. +#@cli : '_color' - Color Output +#@cli : '_alpha_base' - determines the alpha based on waves angle. +#@cli : '_subpixelevel' - Subpixel processing level +#@cli : '_subpixelprocessingmethod' - Subpixel processing method. Only applicable when '_subpixelevel' is greater than 0.\n +#@cli : Default value: '_main_surf_x_factor=10','_main_surf_y_factor=10','_x_center[%]=0','_y_center[%]=0','_fxangle=0','_wave=1','_lighting_angle=0','_disturbance=0','_distx=100','_disty=100','_distangle=0','_disturbance_mode=0','_color=1','_alpha_base=0','_subpixellevel=1','_subpixelprocessingmethod=1'\n +#@cli : Author: Reptorian. +#@cli : $ 640,480,1,1 rep_nebulous 10,,,,,45,,,750,100,100,15,0,1,3 n 0,255 drgba +rep_nebulous: +skip ${2=10},${3=10},${4=0},${5=0},${6=0},${7=1},${8=0},${9=0},${10=100},${11=100},${12=0},${13=0},${14=1},${15=0},${16=0},${17=1} +if $1==0||$2==0||$3==0 v + error "Variable 1 to 3 cannot be zero!" v - fi +if $9<0 v + error "Disturbance factor cannot be less than 0!" v - fi +use_sub={abs($16)} +sublevel={$use_sub+1} +spec_count={!14?0+($15?1:0):3+($15?1:0)} +foreach { +iw,ih={[w,h]} +{$use_sub?w*$sublevel:w},{$use_sub?h*$sublevel:h},1,$spec_count,"begin( +const sd=w/h; +const shx=($4*w)/2; +const shy=($5*h)/2; +const sx=w>h?1:1/sd; +const sy=w>h?sd:1; +const sx2=2/sx; +const sy2=2/sy; +const ang=-pi*$6/180; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +const distlvl=$9*$1; +const dist=pi/(distlvl/100); +const disth=$10; +const distv=$11; +const dang=-pi*$12/180; +const cos_dang=cos(dang); +const sin_dang=sin(dang); +const k=pi+((-pi+(pi*$7))*10)/10; +const ld=-($8-$6)*pi/180; +const IX_mul=$2*4; +const IY_mul=$3*4; +const cx_mul=$13?$2:1; +const cy_mul=$13?$3:1; +const iml=1.5*($1*10); +const angld=ang+ld; +const hpi=pi/2; +); +ix=(((x+shx)/w-.5)*iml)/sx; +iy=(((y+shy)/h-.5)*iml)/sy; +IX=ix*cos_ang-iy*sin_ang; +IY=ix*sin_ang+iy*cos_ang; +IX*=IX_mul; +IY*=IY_mul; +if(distlvl, +dix=(x/w-.5)*sx2; +diy=(y/h-.5)*sy2; +DIX=dix*cos_dang-diy*sin_dang; +DIY=dix*sin_dang+diy*cos_dang; +cx=DIX*cx_mul; +cy=DIY*cy_mul; +fsd=sin(((cx+cy)/2)/dist); +fcd=cos(((cy-cx)/2)/dist); +IX+=disth*(fsd-fcd); +IY-=distv*(fsd+fcd); +); +t=atan2(IY,IX); +r=norm(IX,IY)/100; +ti=sin(t)*cos(r)*k+r+angld; +$15?( +cg=[sin(pi+ti),sin(hpi+ti),sin(ti)]; +g=sum(cg); +alp=$15>2?($15==3?g:g*-1):($15==2?(g*-1<0?-1:1):(g<0?-1:1)); +$14?[cg,alp]:[g,alp]; +):( +$14?[sin(pi+ti),sin(hpi+ti),sin(ti)]:sin(ti)+sin(hpi+ti)+sin(pi+ti); +);" +rm.. +if $use_sub r $iw,$ih,1,{s},{$17+2} fi +} +#@cli rep_sptbwgp: eq. to 'rep_shift_pixel_to_boundary_with_group_pixels' +rep_sptbwgp: rep_shift_pixel_to_boundary_with_group_pixels $* +#@cli rep_shift_pixel_to_boundary_with_group_pixels: 1<=_position<=1,_axis={ x,0=Horizontal | y,1=Vertical },0%<_influence_factor[%]<=100%,0<=_threshold<=100%,channel_mode +#@cli : Shifts pixels to boundary by percentage using grouped pixels. position less than .5 means shift will be negative, and position greater than .5 means shift will be positive. +#@cli : If 'channel_mode' is position, cmyk mode is assumed. If negative, RGB is assumed. If negative, then always last channel would be used. +#@cli : Default values: '_position=-1','_axis=1','_influence_factor=1','_threshold=0','_channel_mode=0' +rep_shift_pixel_to_boundary_with_group_pixels: +skip ${1=-1},${2=0},${3=1},${4=0},${5=0} +position,axis,influence,threshold,tcr={[cut(($1+1)/2,0,1),isnum($2)?[$2]:'$2'-'x',cut([$3,$4],0,1),$5>0?4:$5==0?3]} +if !$influence return fi +if $axis==1 +position={1-$position} +src_img=x,pos +if $influence<1 dst_img=x,round(lerp(pos,insert_pos++,$influence)) +else dst_img=x,insert_pos++ +fi +permute_arg=xczy +elif $axis==0 +src_img=pos,y +if $influence<1 dst_img=round(lerp(pos,insert_pos++,$influence)),y +else dst_img=insert_pos++,y +fi +permute_arg=cyzx +else error invalid_arg_2 +fi +if $threshold +command cmd_process_alpha:"ge {"$threshold"*iM#-1} permute "$permute_arg +else +command cmd_process_alpha:"gt 0 permute "$permute_arg +fi +foreach { +if s==2||s>$tcr ++channels {s-1} +if iv#-1 +cmd_process_alpha[1] +{w#0},{h#0},{d#0},{s#0} +fill[1] :"begin( +const position=$position; +const length=s; +position==1?( +insert_pos_point()=length-number_of_points; +): +!position?( +insert_pos_point()=0; +):( +insert_pos_point()=round(lerp(0,length-number_of_points,position)); +); +); +points=I; +number_of_points=sum(points); +if(number_of_points, +insert_pos=insert_pos_point(); +repeat(length,pos, +if(points[pos], +I(#-1,"$dst_img")=I(#0,"$src_img"); +--number_of_points; +); +if(!number_of_points,break();); +); +); +points;" +keep[-1] +else +remove[-1] +fi +fi +} +uncommand cmd_process_alpha +#@cli rep_sinowaterdist: (eq. to rep_sinusoidal_water_distortion) +rep_sinowaterdist: rep_sinusoidal_water_distortion $* +#@cli rep_sinusoidal_distortion: _xbalance>0,_ybalance>0,_scale>=0,_interpolation,_boundary_condition +#@cli : Shift by sinusoidal distortion formula. +rep_sinusoidal_water_distortion: +skip ${4=2},${5=1} +f " +balanceY=y*sin(180)/$3*10; +balanceX=x*cos(180)/$3*10; +vx=x+cos(balanceY)*$1; +vy=y+sin(balanceX)*$2; +i(vx,vy,z,c,$4,($5?3:2));" +#@cli rep_binaltquad: eq. to 'rep_binary_alterating_quad_texture'. +rep_binaltquad: rep_binary_alterating_quad_texture $* +#@cli rep_binary_alterating_quad_texture: _style={ 0 = Horizontal , 1 = Diagonal , 2 = Simple },_variable_1>=0,_variable_2>=0,_variable_3>=0,0<=_operand<=2,0<=_angle<=360,_x_dir= { 0 = normal | 1 = inverted },_y_dir= { 0=normal | 1 = inverted },_modnum>0 +#@cli : Generates a texture full of alternating quadrilateral shapes using binary logic. Converted, and extended from Asmageddon Quaddro Bumperoo/Inverto Paint.NET source code. +#@cli : (eq. to 'rep_binaltquad').\n +#@cli : Author: Reptorian. +rep_binary_alterating_quad_texture: +skip ${4=128},${5=2},${6=0},${7=0},${8=0},${9=256},${10=255},${11=1} +channels 0 +style=$1 +var_1=$2 +var_2=$3 +var_3=$4 +operand={$1!=2?$5:2} +angle=$6 +x_dir=$7 +y_dir=$8 +modnum=$9 +normalize=$10 +allow_normal=$11 +f begin(ang=pi*($angle/180);sd=w/h;);ix=((x/w)-.5)/(h>w?1/sd:1);iy=((y/h)-.5)/(w>h?sd:1);IX=ix*cos(ang)-iy*sin(ang);IY=ix*sin(ang)+iy*cos(ang);ix=IX;iy=IY;ix+=.5/(h>w?1/sd:1);iy+=.5/(w>h?sd:1);ix=(w>h?ix*w:ix*h);iy=(w>h?iy*w:iy*h);ix=round(ix)+1;iy=round(iy)+1;$style==2?((!$x_dir?xor(ix,$var_1):xor(w-ix,$var_1))+(!$y_dir?xor(iy,$var_2):xor(h-iy,$var_2)))%$modnum:(int(((($style==1?($operand?($operand==1?(((($x_dir?w-ix:ix)|int($var_1))+(($y_dir?h-iy:iy)|int($var_2)))%$modnum):(xor(($x_dir?w-ix:ix),int($var_1))+xor(($y_dir?h-iy:iy),int($var_2)))%$modnum):((($x_dir?w-ix:ix)&int($var_1))+(($y_dir?h-iy:iy)&int($var_2)))):($operand?($operand==1?(((-($x_dir?w-ix:ix)|int($var_1))+(-($y_dir?h-iy:iy)|int($var_2)))%$modnum):(xor(-($x_dir?w-ix:ix),int($var_1))+xor(-($y_dir?h-iy:iy),int($var_2)))%$modnum):((-($x_dir?w-ix:ix)&int($var_1))+(-($y_dir?h-iy:iy)&int($var_2)))))/(int($operand!=2?$var_3:-$var_3)*2))-int(($style==1?($operand?($operand==1?(((($x_dir?w-ix:ix)|int($var_1))+(($y_dir?h-iy:iy)|int($var_2)))%$modnum):(xor(($x_dir?w-ix:ix),int($var_1))+xor(($y_dir?h-iy:iy),int($var_2)))%$modnum):((($x_dir?w-ix:ix)&int($var_1))+(($y_dir?h-iy:iy)&int($var_2)))):($operand?($operand==1?(((-($x_dir?w-ix:ix)|int($var_1))+(-($y_dir?h-iy:iy)|int($var_2)))%$modnum):(xor(-($x_dir?w-ix:ix),int($var_1))+xor(-($y_dir?h-iy:iy),int($var_2)))%$modnum):((-($x_dir?w-ix:ix)&int($var_1))+(-($y_dir?h-iy:iy)&int($var_2)))))/(int($operand!=2?$var_3:-$var_3)*2)))*($style==1?($operand?($operand==1?(((($x_dir?w-ix:ix)|int($var_1))+(($y_dir?h-iy:iy)|int($var_2)))%$modnum):(xor(($x_dir?w-ix:ix),int($var_1))+xor(($y_dir?h-iy:iy),int($var_2)))%$modnum):((($x_dir?w-ix:ix)&int($var_1))+(($y_dir?h-iy:iy)&int($var_2)))):($operand?($operand==1?(((-($x_dir?w-ix:ix)|int($var_1))+(-($y_dir?h-iy:iy)|int($var_2)))%$modnum):(xor(-($x_dir?w-ix:ix),int($var_1))+xor(-($y_dir?h-iy:iy),int($var_2)))%$modnum):((-($x_dir?w-ix:ix)&int($var_1))+(-($y_dir?h-iy:iy)&int($var_2))))))=0,_variable_2>=0,_variable_3>=0,_style={ 0 = Horizontal | 1 = Diagonal },0<=_operand<=2,0<=_angle<=360,_x_dir= { 0 = normal | 1 = inverted },_y_dir= { 0=normal | 1 = inverted }, _variable_1>=0,_variable_2>=0,_variable_3>=0,_style={ 0 = Horizontal | 1 = Diagonal },0<=_operand<=2,0<=_angle<=360,_x_dir= { 0 = normal | 1 = inverted },_y_dir= { 0=normal | 1 = inverted }, _variable_1>=0,_variable_2>=0,_variable_3>=0,_style={ 0 = Horizontal | 1 = Diagonal },0<=_operand<=2,0<=_angle<=360,_x_dir= { 0 = normal | 1 = inverted },_y_dir= { 0=normal | 1 = inverted }, _variable_1>=0,_variable_2>=0,_variable_3>=0,_style={ 0 = Horizontal | 1 = Diagonal },0<=_operand<=2,0<=_angle<=360,_x_dir= { 0 = normal | 1 = inverted },_y_dir= { 0=normal | 1 = inverted }, _variable_1>=0,_variable_2>=0,_variable_3>=0,_style={ 0 = Horizontal | 1 = Diagonal },0<=_operand<=2,0<=_angle<=360,_x_dir= { 0 = normal | 1 = inverted },_y_dir= { 0=normal | 1 = inverted } +#@cli : Generates a texture full of alternating quadrilateral shapes using binary logic. Converted, and extended from Asmageddon Quaddro Bumperoo/Inverto Paint.NET source code. +#@cli : (eq. to 'rep_binaltquadc'). +rep_binary_alterating_quad_c: +skip ${7=0},${8=0},${9=0},${10=0},${11=0},${12=0},${13=0},${14=0},${15=0},${16=0},${17=0},${18=0},${19=0},${20=0},${21=0},${22=0},${23=0},${24=0},${25=0},${26=0},${27=0},${28=0},${29=0},${30=0},${31=0},${32=0},${33=0},${34=0},${35=0},${36=0},${37=0},${38=0},${39=0},${40=0},${41=0},${42=0},${43=0},${44=0},${45=0},${46=0},${47=0},${48=0},${49=0} +foreach { +cs_mode=$1 +cmyk_mode={$cs_mode==3?4:3} +contain_alpha={$2?1:0} +bitmode=$3 +tch={$cmyk_mode+$contain_alpha} +channels 0 +r 100%,100%,100%,$tch +if $tch==3 ($4,$5,$6) +elif $tch==4 ($4,$5,$6,$7) +elif $tch==5 ($4,$5,$6,$7,$8) +fi +tc={w#1} s. x remove_duplicates tw={$!-1} if $tw<$tc v + error "Invalid Channel Order!" v - fi +a[^0] x rv +($*) +if ($cs_mode==3||(($cs_mode>8&&$cs_mode<11)||$cs_mode<3))||$bitmode (256,256,256,256,255) +else +if $cs_mode>3&&$cs_mode<7 (361,101,101,256) +elif $cs_mode==7 (101,201,201,256) +elif $cs_mode==8 (101,129,{ceil((pi)*200)},256) +elif $cs_mode==11 (301,301,301,256) +elif $cs_mode==12 (256,301,301,256) +elif $cs_mode==13 (301,301,301,256) +fi +fi +fact=9 +repeat $tch { +sh[1] {i(#0,$>,0)} +rep_binaltquad. {i(#2,8+$fact*$>,0)},{i(#2,9+$fact*$>,0)},{i(#2,10+$fact*$>,0)},{i(#2,11+$fact*$>,0)},{i(#2,12+$fact*$>,0)},{i(#2,13+$fact*$>,0)},{i(#2,14+$fact*$>,0)},{i(#2,15+$fact*$>,0)},{i(#3,$>,0)},{i(#3,$>,0)-1},{i(#2,16+$fact*$>,0)} +rm. +} +k[1] +if $cs_mode==3 +if $contain_alpha +s c +a[0-{$!-2}] c +cmyk2rgb.. +*.. {255/254} +a c +else +cmyk2rgb +* {255/254} +fi +else +if ($cs_mode>8&&$cs_mode<11)||$cs_mode<3 +if $cs_mode==1 ac "ryb2rgb",rgb +elif $cs_mode==2 ac "cmy2rgb",rgb +elif $cs_mode==9 ac "ycbcr2rgb",rgb +elif $cs_mode==10 ac "ycbcrglic2rgb",rgb +fi +cut 0,255 +else +if $bitmode +if $cs_mode==1 ac "ryb2rgb",rgb +elif $cs_mode==4 ac "hsi82rgb",rgb +elif $cs_mode==5 ac "hsv82rgb",rgb +elif $cs_mode==6 ac "hsl82rgb",rgb +elif $cs_mode==7 ac "lab82rgb",rgb +elif $cs_mode==8 ac "lch82rgb",rgb +elif $cs_mode==11 ac "yiq82rgb",rgb +elif $cs_mode==12 ac "yuv82rgb",rgb +elif $cs_mode==13 ac "xyz82rgb",rgb +fi +cut 0,255 +else +if $cs_mode>3&&$cs_mode<7 +f s<4?[i0,i1/100,i2/100,i3]:[i0,i1/100,i2/100] +if $cs_mode==4 hsi2rgb +elif $cs_mode==5 hsv2rgb +elif $cs_mode==6 hsl2rgb +fi +cut 0,255 +elif $cs_mode==7 +f s<4?[i0,i1-100,i2-100,i3]:[i0,i1-100,i2-100] +lab2rgb +elif $cs_mode==8 +f s<4?[i0,i1,((i2-314.5)*(pi/3.145)/100),i3]:[i0,i1,((i2-314.5)*(pi/3.145)/100)] +sh 0,2 +lch2rgb. +rm. +elif $cs_mode==11 +f s<4?[i0,i1-150,i2-150,i3]:[i0,i1-150,i2-150] +yiq2rgb +elif $cs_mode==12 +f s<4?[i0/255,(i1-150)/150,(i2-150)/150,i3]:[i0/255,(i1-150)/150,(i2-150)/150] +yuv2rgb +elif $cs_mode==13 +f s<4?[i0/300,i1/300,i2/300,i3]:[i0/300,i1/300,i2/300] +xyz2rgb +fi +fi +fi +fi +} +#@cli rep_strbul: eq. to 'rep_strange_bulger'. +rep_strbul: rep_strange_bulger $* +#@cli rep_strange_bulger : 0<=_angle<=360,_axis={ 0 = X-Axis | 1 = Y-Axis },_interpolation,_boundary_condition +#@cli : Performs a bulge effect found in Strange Bulger Series made by Asmageddon for Paint.NET. +#@cli : (eq. to 'rep_strbul').\n +#@cli : _angle refers to the angle of distortion. +#@cli : _axis_of_bulge refers to the axis that is the distortion is based from.\n +#@cli : Author: Reptorian. +rep_strange_bulger: +f "begin( +const BulgeAng=$1*(pi/180); +const cX=w/2; +const cY=h/2; +); +vx=$2?x:cX-x; +vy=$2?cY-y:y; +vx=(vx^2)/cX; +vy=(vy^2)/cY; +vx=(x+(x-vx)*cos(BulgeAng)+(y-vy)*sin(BulgeAng)); +vy=(y+(x-vx)*sin(BulgeAng)+(y-vy)*cos(BulgeAng)); +i(vx,vy,z,c,$3,($4?3:2));" +#@cli rep_strbulkal: eq. to 'rep_strange_bulger_kaleidoscope'. +rep_strbulkal:rep_strange_bulger_kaleidoscope $* +#@cli rep_strange_bulger_kaleidoscope: 0<=_bulge_ang<=360,_axis_of_bulge= { 0=horizontal | 1=vertical },_scale>0,-1<_offset_main_x<=1,-1<_offset_main_y<=1,-1<_offset_kaleido_x<=1,-1<_offset_kaleido_y,-360<=surface_ang<=360,_mirror_placement= { 0=inside-out | 1=outside-in },_boundary_condition= { 0=Periodic | 1=Mirror },1<=_interpolation<=5,_dimension_reference>0 +#@cli : Distorts image using bulge effect found in Strange Bulger Series made by Asmageddon for Paint.NET. This is the Kaleidoscope version of Strange Bulger. +#@cli : (eq. to 'rep_strbulkal').\n +#@cli : _bulge_ang refers to the angle of distortion. +#@cli : _axis_of_bulge refers to the axis that is the distortion is based from. +#@cli : _scale refers to the scaling of the distortion. The larger the _scale value is, the more areas is revealed. +#@cli : _offset_main_x refers to the horizontal displacement of the initial image +#@cli : _offset_main_y refers to the vertical displacement of the initial image +#@cli : _offset_kaleido_x refers to the horizontal displacement of the center of the distortion +#@cli : _offset_kaleido_y refers to the vertical displacement of the center of the distortion +#@cli : _surface_ang refers to the angle of distortion +#@cli : _mirror_placement refers to whether the displacement is mirror from the center or not. +#@cli : _dimension_reference refers to the base dimension used for calculation of bulging, it uses the biggest dimension as a reference for scaling. The PDN version of Strange Bulger Kaleidoscope does not have a dimension reference which means that bulges are dependent on the image size. This is to ensure that preview stays consistent with the end result. What you see is what you get as _dimension_reference variable is a internal dimension processing variable.\n +#@cli : Author: Reptorian. +rep_strange_bulger_kaleidoscope: +skip ${4=0},${5=0},${6=0},${7=0},${8=0},${9=0},${10=0},${11=3},${12=1024} +if $3<10^-8 v + error "Scale cannot be 0 or less than 0!" v - fi +if $12==0 v + error "dimension_reference cannot be 0!" v - fi +shift {50*$4}%,{50*$5}%,0,0,3,1 +f "begin( +const BulgeAng=pi*((h>w?360-$1:$1)/180); +const ang=pi*($8/180); +const sd=w/h; +const iox=$6/(h>w?1/sd:1); +const ioy=($7*-1)/(w>h?sd:1); +const cos_ang=cos(ang); +const sin_ang=sin(ang); +const ox=iox*cos_ang-ioy*sin_ang; +const oy=iox*sin_ang+ioy*cos_ang; +const ed=abs(int($12)); +const id=w>h?ed/w:ed/h; +const iw=w*id; +const ih=h*id; +const cx=iw/2; +const cy=ih/2; +); +ix=((x/w)-.5)/(h>w?1/sd:1); +iy=((y/h)-.5)/(w>h?sd:1); +IX=ix*cos_ang-iy*sin_ang; +IY=ix*sin_ang+iy*cos_ang; +ix=IX; +iy=IY; +ix+=.5/(h>w?1/sd:1); +iy+=.5/(w>h?sd:1); +ix*=ed; +iy*=ed; +xx=sqrt(abs(ix-cx-ox*(cx>cy?cx:cy))); +yy=sqrt(abs(iy-cy-oy*(cx>cy?cx:cy))); +xx*=$3*ed; +yy*=$3*ed; +xx/=100; +yy/=100; +vx=(w>h?$2:!$2)?xx:cx-xx; +vy=(w>h?$2:!$2)?cy-yy:yy; +vx=vx^2/cx; +vy=vy^2/cy; +vx=(xx+(xx-vx)*cos(BulgeAng)+(yy-vy)*sin(BulgeAng)); +vy=(yy+(xx-vx)*sin(BulgeAng)+(yy-vy)*cos(BulgeAng)); +vx*=w/ed; +vy*=h/ed; +i(vx,vy,z,c,$11,($10?3:2));" +if $9 shift 50%,50%,0,0,3,1 fi +#@cli rep_logpindis: eq. to 'rep_logarithmic_pinching_distortion'. +rep_logpindis: rep_logarithmic_pinching_distortion $* +#@cli rep_logarithmic_pinching_distortion: _distortion_main>=0,-1<=_preshift_x<=1,-1<=_preshift_y<=1,-1<=_effposition_x<=1,-1<=_effposition_y<=1,_prescale_x,_prescale_y,_afterscale_x,_afterscale_y,0<=_angle<=360,_mirror_placement= { 0=outside-in | 1=inside-out },_lx_axis= { 0=different axis | 1=same axis},_ly_axis= { 0=different axis | 1=same axis},ix_dir={ 0=negative | 1=positive },iy_dir={ 0=negative | 1=positive },_boundary= { 0=Periodic | 1=Mirror },1<=_interpolation<=5,_dimension_ref>0 +#@cli : (eq. to 'rep_logpindis').\n +#@cli : Author: Reptorian. +rep_logarithmic_pinching_distortion: +skip ${2=0},${3=0},${4=0},${5=0},${6=1},${7=1},${8=1},${9=1},${10=0},${11=0},${12=1},${13=0},${14=1},${15=0},${16=0},${17=5},${18=1024} +if $6==0||$7==0||$8==0||$9==0 v + error "Scale cannot be 0!" v - fi +if $17<1 v + error "interpolation cannot be less than 1" v - fi +shift {50*$2}%,{50*$3}%,0,0,3,1 +f "begin( +const sd=w/h; +const ang=pi*($10/180); +const cos_ang=cos(ang); +const sin_ang=sin(ang); +const iox=($4*-1)/(h>w?1/sd:1); +const ioy=$5/(w>h?sd:1); +const ox=iox*cos_ang-ioy*sin_ang; +const oy=iox*sin_ang+ioy*cos_ang; +const ed=int(abs($18))/2; +const dx=$14?1:-1; +const dy=$15?1:-1; +const iend=$16?3:2; +); +ix=((x/w)-.5)/(h>w?1/sd:1); +iy=((y/h)-.5)/(w>h?sd:1); +IX=ix*cos_ang-iy*sin_ang; +IY=ix*sin_ang+iy*cos_ang; +ix=IX; +iy=IY; +ix=abs(ix+ox/2)*$6; +iy=abs(iy+oy/2)*$7; +ix*=ed; +iy*=ed; +lx=ix==0||iy==0?log(1^-8)*$1:log($12?iy^2:ix*iy)*$1; +ly=ix==0||iy==0?log(1^-8)*$1:log($13?ix^2:ix*iy)*$1; +ix-=lx*dx; +iy-=ly*dy; +ix*=w/ed; +iy*=h/ed; +ix*=$8; +iy*=$9; +i(ix,iy,z,c,$17,iend);" +if $11 shift 50%,50%,0,0,3,1 fi +#@cli rep_sqrlogpindis: eq. to rep_square_root_logarithmic_pinching_distortion +rep_sqrlogpindis: rep_square_root_logarithmic_pinching_distortion $* +#@cli rep_square_root_logarithmic_pinching_distortion: _distortion_main>=0,-1<=_preshift_x<=1,-1<=_preshift_y<=1,-1<=_effposition_x<=1,-1<=_effposition_y<=1,_prescale_x,_prescale_y,_afterscale_x,_afterscale_y,0<=_angle<=360,_mirror_placement= { 0=outside-in | 1=inside-out },_lx_axis= { 0=different axis | 1=same axis},_ly_axis= { 0=different axis | 1=same axis},ix_dir={ 0=negative | 1=positive },iy_dir={ 0=negative | 1=positive },_boundary= { 0=Periodic | 1=Mirror },1<=_interpolation<=5,_dimension_ref>0 +#@cli : (eq. to 'rep_sqrlogpindis').\n +#@cli : Author: Reptorian. +rep_square_root_logarithmic_pinching_distortion: +skip ${2=0},${3=0},${4=0},${5=0},${6=1},${7=1},${8=1},${9=1},${10=0},${11=0},${12=1},${13=0},${14=1},${15=0},${16=0},${17=5},${18=1024} +if $6==0||$7==0||$8==0||$9==0 v + error "Scale cannot be 0!" v - fi +if $17<1 v + error "interpolation cannot be less than 1" v - fi +shift {50*$2}%,{50*$3}%,0,0,3,1 +f "begin( +const ed=int(abs($18)); +const sd=w/h; +const ang=pi*($10/180); +ox=$4; +oy=$5*-1; +ox/=h>w?1/sd:1; +oy/=w>h?sd:1; +OX=ox*cos(ang)-oy*sin(ang); +OY=ox*sin(ang)+oy*cos(ang); +ox=OX; +oy=OY; +); +ix=((x/w)-.5)/(h>w?1/sd:1); +iy=((y/h)-.5)/(w>h?sd:1); +IX=ix*cos(ang)-iy*sin(ang); +IY=ix*sin(ang)+iy*cos(ang); +ix=IX; +iy=IY; +ix+=.5/(h>w?1/sd:1); +iy+=.5/(w>h?sd:1); +iw=w/(h>w||w==h?1/sd:1); +ih=h/(w>h||w==h?1:1/sd); +id=ed/w; +iw*=id; +ih*=id; +cx=iw/2; +cy=ih/2; +ix*=1; +iy*=1; +xx=sqrt(abs(ix*ed-cx-cx*ox))*$6; +yy=sqrt(abs(iy*ed-cy-cx*oy))*$7; +vx=xx*100; +vy=yy*100; +lx=xx==0||yy==0?log(1^-8)*$1:log($12?yy^2:xx*yy)*$1; +ly=xx==0||yy==0?log(1^-8)*$1:log($13?xx^2:xx*yy)*$1; +vx+=($14?-1:1)*lx; +vy+=($15?-1:1)*ly; +vx*=w/ed; +vy*=h/ed; +vx*=$8; +vy*=$9; +i(vx,vy,z,c,$17,($16?3:2));" +if $11 shift 50%,50%,0,0,3,1 fi +#@cli rep_stitch: { offset[%]>=0% | offset>=0 },{ thickness[%]>=0% | thickness>=0 },_modulo,_offset_iter_rand={ 0=single | 1= multiple },_strip_iter_rand={ 0=none | 1=single | 2=multiple },_seed_offset,_seed_strip,_boundary={ 0=none | 1=neumann | 2=periodic | 3=mirror },_sublevel>=0,_interpolation={ 0=nearest | 1=average | 2=linear | 3=bicubic | 4=lanczos },angle_0...angle_inf +#@cli : Stitches images. +#@cli : $ sp rep_stitch 15%,1%,,,,,,,,,45,135 +rep_stitch: +skip ${3=0},${4=0},${5=0},${6=},${7=},${8=3},${9=1},${10=2},${11=} +modulo_mode,random_offset_mode,random_strip_mode,seed_off,seed_strip,boundary,sublevel,interpolation,diff_dim_mode,timg,max_img_ind,has_strip_seed,has_off_seed={int($3)},{$4%2},{$5%3},${6-7},{$8%4},{abs($9)+1},{v=abs($10)+1;v==4?++v:v;},0,{$!},{$!-1},0,0 +if narg($seed_strip) has_strip_seed=1 fi +if narg($seed_off) has_off_seed=1 fi +if ${is_percent\ $1} use_perc_off=1 +else +use_perc_off,offset=0,{abs($1)*$sublevel} +if !$offset return fi +fi +if ${is_percent\ $2} use_perc_thk=1 +else +use_perc_thk,thickness=0,{max(1,int(abs($2)*$sublevel))} +fi +modulo,modulo_mode={abs_mod=abs($modulo_mode);[abs_mod,abs_mod==2||$modulo_mode>=-1]} +if $modulo if $modulo<2 error "$3">1==F fi fi +if narg($11) ang_args=${11--1} +else ang_args=45,135 +fi ++rep_find_nonduplicate_angles $ang_args => rad_ang +num_angs={w#-1} +if $num_angs==1 +random_offset_mode=0 +if $random_strip_mode==2 random_strip_mode=0 fi +fi +if $!>2 +eval " +diff=0; +const ti=$timg; +initial_dimensions=[w#0,h#0,d#0]; +for(p=1,p fi +ow,oh={[w#$>,h#$>]} +if $diff_dim_mode r[$>] {round($ow*$sublevel)},{round($oh*$sublevel)},100%,100%,1 +else r[0--2] {round(w#0*$sublevel)},{round(h#0*$sublevel)},100%,100%,1 +fi +nw,nh={[w#$>,h#$>]} +length={norm($nw,$nh)/2} +if $use_perc_off offset={$length*$1} fi +if $use_perc_thk thickness={max($sublevel,round($length*$2))} fi +if $offset ++f. "begin( +const sublevel=$sublevel; +const thickness=$thickness; +const half_thickness=thickness>>1; +const modulo=$modulo; +const hpi=pi/2; +const nw=$nw; +const nh=$nh; +modulo?( +const img_width=nw; +const img_height=nh; +const hypotenuse=sqrt(img_width^2+img_height^2); +const pt_0=atan2(img_height,img_width); +const pt_1=atan2(img_width,img_height); +calc_nbars(v)=min( modulo, int((v+half_thickness)/thickness) ); +):( +const cx=(nw-1)/2; +const cy=(nh-1)/2; +const hypotenuse=sqrt(cx^2+cy^2); +const pt_0=atan2(cy,cx); +const pt_1=atan2(cx,cy); +calc_nbars(v)=int((v+half_thickness)/thickness); +); +); +angle=i; +quadrant_01=xor(inrange(angle,-hpi,hpi,1,0),angle>=0); +angle%=hpi; +distance=quadrant_01?cos(pt_0-angle)*hypotenuse:cos(angle-pt_1)*hypotenuse; +calc_nbars(distance);" +=> number_of_bars +total_number_of_bars,max_nbar={is#-1},{iM#-1} +if $random_offset_mode +if $has_off_seed +$total_number_of_bars,1,1,{$modulo?1:2},>"begin( +seed=$seed_off; +srand(seed); +num_of_bars_arr=crop(#$number_of_bars); +const arr_length=w#-1; +pos_bars=vectorarr_length(0); +t=0; +repeat(w#-1,p, +t+=num_of_bars_arr[p]; +pos_bars[p]=t; +); +k=0; +activate_place_length=1; +const modulo=$modulo; +modulo?( +output()=( +if(x==pos_bars[k], +++k; +srand(++seed); +); +u(-1,1)*$offset; +); +):( +output()=( +if(x==pos_bars[k], +++k; +activate_place_length=1; +srand(++seed); +); +a=u(-1,1)*$offset; +b=u(-1,1)*$offset; +ov=int(u(0,2))?[b,a]:[a,b]; +if(activate_place_length, +activate_place_length=0; +[ov[0],num_of_bars_arr[k]]; +,ov;); +); +); +); +output();" +else +{is#-1},1,1,{$modulo?1:2},"begin( +const offset=$offset; +const modulo=$modulo; +if(modulo +,output()=u(-1,1)*offset; +,output()=[u(-1,1),u(-1,1)]*offset; +); +); +output();" +eval.. i(#-1,i,0,0,1)=i; +fi +else +{$modulo?max(2,iM#-1+1):iM#-1},1,1,{$modulo?1:2},>"begin( +const offset=$offset; +if($has_off_seed,srand($seed_off);); +); +a=u(-1,1)*offset; +b=u(-1,1)*offset; +ov=int(u(0,2))?[b,a]:[a,b]; +x? ov : [ ov[0],w ];" +fi +f[$img_targets] " +begin( +const has_strip_seed=$has_strip_seed; +if(has_strip_seed,srand($seed_strip);); +const modulo=$modulo; +const modulo_mode=$modulo_mode; +const shift_mod_pos=modulo>>1; +const boundary=$boundary; +const max_x=w-1; +const max_y=h-1; +const cx=max_x/2; +const cy=max_y/2; +const random_offset_mode=$random_offset_mode; +const random_strip_mode=$random_strip_mode; +const length=$total_number_of_bars; +const sub_length=length-1; +const num_angs=$num_angs; +const thickness=$thickness; +const half_thickness=thickness>>1; +vector_of_number_of_bars=crop(#$number_of_bars); +const strip_length=w#-1; +const max_nbar_arr=$max_nbar; +angs=crop(#$rad_ang); +cos_ang=cos(angs); +sin_ang=sin(angs); +rot_x(a,b,c)=a*cos_ang[c]-b*sin_ang[c]; +rot_y(a,b,c)=a*sin_ang[c]-b*cos_ang[c]; +modulo?( +offset_strip=crop(#-1); +random_offset_mode?( +offset_pos=[0,(vector_of_number_of_bars)[0,num_angs-1]]; +t=offset_pos[1]; +for(p=2,p=0?pos_off[(bar_pos+offset_pos[ind])%strip_length]:neg_off[(abs(bar_pos)+offset_pos[ind])%strip_length]; +off_x=cos_ang[ind]*offset; +off_y=sin_ang[ind]*offset; +[off_x,off_y]; +); +):( +find_offset(bar_pos)=( +offset=bar_pos>=0?pos_off[bar_pos%strip_length]:neg_off[abs(bar_pos)%strip_length]; +off_x=cos_ang[ind]*offset; +off_y=sin_ang[ind]*offset; +[off_x,off_y]; +); +); +); +random_strip_mode==2?( +modulo?( +const multi_strip_length=$total_number_of_bars; +has_strip_seed?( +rand_v=expr('>begin(seed=$seed_strip;srand(seed);tbars=crop(#$number_of_bars);vector_of_number_of_bars=vector(#size(tbars),0);t=0;repeat(size(vector_of_number_of_bars),pos,vector_of_number_of_bars[pos]=t+=tbars[pos]);const num_angs=$num_angs;const ina=num_angs+1;k=0;);if(x==vector_of_number_of_bars[k]&&k2, +t=nbars_k_pos[0]; +for(k=1,kbegin(seed=$seed_strip+1;srand(seed);tbars=crop(#$number_of_bars);vector_of_number_of_bars=vector(#size(tbars),0);t=0;repeat(size(vector_of_number_of_bars),pos,vector_of_number_of_bars[pos]=t+=tbars[pos]);const num_angs=$num_angs;const ina=$num_angs+1;k=0;);if(x==vector_of_number_of_bars[k]&&kbegin(seed=$seed_strip-3;srand(seed);const ina=$num_angs+1;int(u(0,ina)););int(u(0,ina));',num_angs); +rand_v=vectormulti_strip_length(); +place=extract_pos=0; +repeat(num_angs,k, +number_of_bars=vector_of_number_of_bars[k]; +copy(rand_v[place],neg_v[extract_pos],number_of_bars); +place+=number_of_bars; +rand_v[place]=middle[k]; +++place; +copy(rand_v[place],pos_v[extract_pos],number_of_bars); +place+=number_of_bars; +extract_pos+=number_of_bars; +); +):( +rand_v=expr('begin(const ina=$num_angs+1;);int(u(0,ina));',multi_strip_length); +); +non_zero_pos=(vector_of_number_of_bars)[0,num_angs-1]<<1; +++non_zero_pos; +if(num_angs>2, +t=non_zero_pos[0]; +for(k=1,k1?( +nbars_k_pos=(vector_of_number_of_bars)[0,num_angs-1]; +t=nbars_k_pos[0]; +for(k=1,kbegin(if($has_strip_seed,srand($seed_strip+1););const ina=$num_angs+1;);int(u(0,ina,1,0));',max_nbar_arr); +middle=int(u(0,num_angs+1,1,0)); +rand_v=[neg_v,middle,pos_v]; +off_out(v)=rand_v[v+vector_of_number_of_bars[k]]; +); +):( +off_out(v)=v%2; +); +modulo?( +modulo_mode?( +calc_t()=(floor((rot_y(xx,yy,k)+half_thickness)/thickness)+shift_mod_pos)%modulo; +):( +const new_modulo=modulo+(modulo-2); +const max_modulo_index=modulo-1; +calc_t()=( +nv=(floor((rot_y(xx,yy,k)+half_thickness)/thickness)+shift_mod_pos)%new_modulo; +nv>max_modulo_index?new_modulo-nv:nv; +); +); +):( +calc_t()=floor((rot_y(xx,yy,k)+half_thickness)/thickness); +); +); +xx=x-cx; +yy=y-cy; +current_bar=vector(#num_angs,0); +ind=0; +repeat(num_angs,k, +t=calc_t(); +current_bar[k]=t; +ind+=off_out(t); +); +ind%=num_angs; +J(find_offset(current_bar[ind]),0,boundary); +" +r[$img_targets] $ow,$oh,100%,100%,$interpolation +rm[-2,-1] +fi +} +rm. +#@cli +rep_find_nonduplicate_angles: angle_0,angle_1,....,angle_n +#@cli : Return all non-duplicate angles in radian form as a image. ++rep_find_nonduplicate_angles: +($*) (0) +eval[-2] " +res_to_0_180(angle)=(angle%180)/180; +if(x, +not_found=1; +test_value=res_to_0_180(i); +for(p=0,p0,_radial_cut_repeat>0,_angle,-1<=_shift_x<=1,-1<=_shift_y<=1,_flip_x= { 0=Original | 1=Flipped },_flip_y= { 0=Original | 1=Flipped },_edge_x= { 0=Repeat | 1=Alternating },0<=_edge_y<=2,_radial_fit_dimension= { 0=Minimum | 1=Maximum },_conical_start_ang= { 0=90 | 1=0 },_sublevel>0,0<_interpolation<=5 +#@cli : _angle_cut_repeat refers to the amount of time a image will repeat along the center. +#@cli : _radial_cut_repeat refers to the amount of time a image will repeat from the center. +#@cli : _angle refers to the angle of the filter function. +#@cli : _shift_x refers to the horizontal distance distance from the center in relative to the center of the target image(s) +#@cli : _shift_y refers to the verticla distance of the center in relative to the center of the target image(s). +#@cli : _flip_x mirrors the image horizontally prior to the polar effect. +#@cli : _flip_y mirrors the image vertically prior to the polar effect. +#@cli : _radial_fit_dimension fits the end of radius cut to the min or max dimension. +#@cli : _conical_start_ang starts the polar image from the standard interpretation or straight up. +#@cli : _sublevel refers to the antialiasing degree of the polar effect. +#@cli : Default value: '_angle_cut_repeat=2','_radial_cut_repeat=1','_angle=0','_shift_x=0','_shift_y=0','_flip_x=0','_flip_y=0','_edge_x=1','_edge_y=1','_radial_fit_dimension=0','_conical_start_ang=0','_sublevel=.5','_interpolation=2'\n +#@cli : Author: Reptorian. +rep_polar_kaleidoscope: +skip ${1=2},${2=1},${3=0},${4=0},${5=0},${6=0},${7=0},${8=1},${9=1},${10=0},${11=0},${12=.5},${13=2} +if $1==0 v + error "Invalid Number - Variable 1" v - fi +if $2==0 v + error "Invalid Number - Variable 2" v - fi +if $4<-1||$4>1 v + error "Invalid Number - Variable 3" v - fi +if $5<-1||$5>1 v + error "Invalid Number - Variable 4" v - fi +if $12<0 v + error "Invalid Number - Variable" 12 v - fi +if $13<=0 v + error "Invalid Number - Variable" 13 v - fi +r2dx {($12+1)*100}%,$13 +f "begin( +const dr=max(w,h)/min(w,h); +const ang=pi*(($3*-1)/180); +); +xx=((x-$4*w/2)/w-.5)*2; +yy=((y+$5*h/2)/h-.5)*2; +xx*=w>h?dr:1; +yy*=w>h?1:dr; +XX=xx*cos(ang)-yy*sin(ang); +YY=xx*sin(ang)+yy*cos(ang); +xx=XX; +yy=YY; +xs=($11?atan2(yy,xx)+pi:atan2(xx,yy)+pi)/(2*pi); +xs*=$1; +ys=norm(xx,yy)/($10?dr/1:1); +ys*=$2; +xs=$8?(int(xs)%2!=0?1-(xs-floor(xs)):xs-floor(xs)):xs-floor(xs); +ys=$9?($9-1?(int(ys)%2!=0?1-(ys-floor(ys)):ys-floor(ys)):ys-floor(ys)):ys; +xs=$6?1-xs:xs; +ys=$7?1-ys:ys; +polkal_a=i(abs(xs*w),ys*h,z,c,0,0); +polkal_b=i(xs*w,ys*h,z,c,1,1); +$9?polkal_b:polkal_a;" +r2dx {(1/($12+1))*100}%,$13 +#@cli rep_objvf: eq. to 'rep_objvolumefilt' +rep_objvf: rep_objvolumefilt $* +#@cli rep_objvolumefilt: 0<=_v1<=100%,0<=_v2<=100%,_mode={ -2=preserve_exterior_filter_max_out || -1=preserve_interior_filter_max_out || 0=preserve_interior || 1=preserve_exterior },_colour1... +#@cli : _v1 and _v2 refers to boundary in percent. By default, this command use alpha as reference unless all channel values are specified next to mode. +#@cli : (eq. to 'rep_objvf').\n +#@cli : Default value: '_mode=1'\n +#@cli : Author: Reptorian. +rep_objvolumefilt: +skip ${3=0},${4=} +if $1<0||$2<0||$1>1||$2>1 error ""(""$"1>=0&&"$"1"<=1)"&&"(""$"2>=0&&"$"2"<=1)==F"" fi +if (max($1,$2)-min($1,$2))==1 error "max"(""$"1,"$"2")"-min"(""$"1,"$"2")"<1==F" fi +if ($1!=$2) +foreach { +ssize={s} +if narg(${4--1})&&s>1 +if (narg(${4--1})<($ssize-1)) error "{narg(${4--1})}>={$ssize-1}==F" fi +if narg(${4--1})<$ssize +channels {s-1} colormap. 0,1,2 alp={i(#-1,0,0)} rm. fi +100%,100%,100%,1,"begin( +const ss=$ssize-1; +ref_color=vectorss(${4--1}); +); +vectorss(I#0)!=ref_color?1:0" +if narg(${4--1})<$ssize End={vector$ssize(${4--1},$alp)} +else End={vector$ssize(${4--1})} +fi +else ++channels {s-1} +End={vector$ssize(0)} +fi +if !iv#-1 error "Variance>0==F" fi +f. i?1 area_fg. 0,1 +if $3<0 f. i==iM?0:i fi ++f. i==0?iM:i +newmin={im#-1} +rm. +MM={iM#-1-$newmin} +area_1={$1*$MM} +area_2={$2*$MM} +area_1+=$newmin +area_2+=$newmin +minarea={min($area_1,$area_2)} +maxarea={max($area_1,$area_2)} +if $3>=0 +if $3 f.. !(i0#-1>=$minarea&&i0#-1<=$maxarea)?I:[$End] +else f.. i0#-1>=$minarea&&i0#-1<=$maxarea?I:[$End] +fi +else +if $3<-1 f.. if(i0#-1,(!(i0#-1>=$minarea&&i0#-1<=$maxarea)?I:[$End]),I) +else f.. if(i0#-1,(i0#-1>=$minarea&&i0#-1<=$maxarea?I:[$End]),I) +fi +fi +rm. +vv=0 +repeat s { +sh $> +vv+={iv#-1} +rm. +} +if !$vv error "Final Variance>0==F" fi +} +fi +#@cli rep_form_pixel: form_id,form_quad_lx!=0,form_quad_ly!=0,_form_ratio[%]!=0,_angle, 0<=_reflect_dir<=2,_sublevel,_tile_boundary={ 0=periodic | 1=mirror_x | 2=mirror_y | 3=mirror_xy },_image_boundary={ 0=neumann | 1=periodic | 2=mirror},_abs_zconvf>=0,_zconv_boundary={0=periodic | 1= mirror},_interpolation={ 0=nearest | 1=average | 2=grid | 3=linear | 4=bicubic | 5=lanczos},cs_mode={ 0=rgb | 1=ryb | 2=cmyk | 3=hcy | 4=hsi | 5=hsl | 6=hsv | 7=lab | 8=lch },_fit_tile={ 0=squash_to_fit | 1=resize_to_fit },_kdol={ 0=new_dim | 1=new_layer_new_dim | 2=new_layer | 3=new_layer_old_dim },shape_option_1..._shape_option_n +#@cli : _form_id refers to the id or name of shape. circle is a valid form id, and any integer number that is 0-24 inclusive is a form id. You can also use image as an argument, so you can use any arbitrary shapes. +#@cli : _form_quad_lx refers to the size of the tile in pixel form. It cannot be 0 unless you want to use _form_quad_ly variable to define the tile width. +#@cli : _form_quad_ly refers to the size of the tile in pixel form. It cannot be 0 unless you want to use _form_quad_lx variable to define it tile height. +#@cli : _form_ratio refers to the how much the shape fills each tile. +#@cli : _angle refers to the rotation of shapes per tile +#@cli : _reflect_dir refers to the mirroring of each shape. 1,2 means the mirroring is applied. +#@cli : _sublevel refers to the initial size of the shape to be scaled down to fit tiles. +#@cli : _tile_boundary refers to how the tiles are repeated within the canvas +#@cli : _image_boundary refers to how the pixels are treated when out-of-range of original canvas before generating tiles +#@cli : _abs_zconvf defines the contrast level of each tiles using z-convolution within a small color tile reference 3D image. +#@cli : _zconv_boundary defines how out-of-range value within z-convolution kernet are treated. +#@cli : _interpolation refers to the interpolation of the scaling of shapes to fit each tile. See 'gmic h resize' _interpolation. +#@cli : _cs_mode refers to the color processing space that form_pixel filter utilize. +#@cli : _fit_tile is a parameter used for whether to fit tile into specified tile width and height or to use stretch resize =method. +#@cli : _kdol can be used to resize the generated result to original dimension and/or to create new layer on top of existing image. +#@cli : _shape_option are used to define the behavior of shapes when available. +#@cli : +#@cli : -- form_id -- +#@cli : string | shape_name_id | shape_options +#@cli : +#@cli : [image] ---- image_as_shape +#@cli : 0 - australia +#@cli : 1 - barbedwire +#@cli : 2 - circle +#@cli : 3 - crosshair +#@cli : 4 - cupid +#@cli : 5 - diamond +#@cli : 6 - dragon ------ dragon_recursion>=0,-360<=dragon_curve_rotation_angle>=360 +#@cli : 7 - dragonfly +#@cli : 8 - fern - size>=0,density[%]>=0,ang,0<=opacity<=1,type={ 0=Black Spleenwort | 1=Marsh } +#@cli : 9 - flip +#@cli : 10 - gear ------- teeth>0,00 +#@cli : 21 - rooster +#@cli : 22 - shopping_cart +#@cli : 23 - snowflake ------- 1<=recursion<=6 +#@cli : 24 - star ------- branches>3,thickness[%] +#@cli : +#@cli : -- end of form_id -- +#@cli : +#@cli : Note: _shape_option_1 can be empty. n refers to corresponding shape option. +#@cli : +#@cli : Author: Reptorian. +#@cli : $ sp landscape +rep_form_pixel star,20,,90%,45,0,1,1,2,75%,0,5,2,0,0 +#@cli : $ sp dog +rep_form_pixel star,15,,80%,20,0,100%,1,0,250% +rep_form_pixel: +skip ${2=0},${3=0},${4=1},${5=0},${6=0},${7=1},${8=0},${9=1},${10=100%},${11=0},${12=5},${13=0},${14=1},${15=0} +form_ratio,ang,mirror,sub,tile_boundary,image_boundary,z_convolve,z_convolve_boundary,interpolation,cs_mode,fit_tile,var_kodl={[cut(abs($4),0,1),$5,int(abs($6))%3,abs($7)+1,int(abs($8))%4,int(abs($9))%3+1,abs($10),abs($11)%2+1,int(abs($12))+1,int(abs($13))%9,$14&1,int(abs($15))%4]} +convert_colors_fwd=${arg\ 1+$cs_mode,none,rgb2ryb,cs_error,rgb2hcy,rgb2hsi,rgb2hsl,rgb2hsv,rgb2lab,rgb2lch} +convert_colors_bwd=${arg\ 1+$cs_mode,none,ryb2rgb,cs_error,hcy2rgb,hsi2rgb,hsl2rgb,hsv2rgb,lab2rgb,lch2rgb} +if $cs_mode>2 +if $cs_mode>=3&&$cs_mode<7 cutf_vals=0,360,0,100,0,1,0,255 +elif $cs_mode==7 cutf_vals=0,100,-176,176,-176,176,0,255 +else cutf_vals=0,100,0,255,{-pi},{pi},0,255 +fi +fi +if $z_convolve +offpixel,onpixel={z_convolve=$z_convolve;[z_convolve*-1,z_convolve*2+1]} +($offpixel/$onpixel/$offpixel) +store. zmap +fi +tile_w,tile_h={round(abs([$2,$3]))} +if $tile_w?$tile_w<4 tile_w=4 fi +if $tile_h?$tile_h<4 tile_h=4 fi +if !($tile_w||$tile_h) error "\$tile_w||\$tile_h==F" fi +tile_w={!$tile_w?$tile_h:$tile_w} +tile_h={!$tile_h?$tile_w:$tile_h} +tile_wh={$tile_w*$tile_h} +tile_dim=[$tile_w,$tile_h] +if ${is_image_arg\ $1} +pass$1 0 +if s<=4&&s>1 +if s==3 +to_gray. +else +s. c,{if(s==4,-3,if(s==2,-1,-s))} +to_gray.. +*[-2,-1] +fi +elif s==5 +s. c,-4 cmyk2rgb.. to_gray.. *[-2,-1] +fi +else +sid=$1 +if isnum($1) if isint($1) +sid=${"-arg "1+$sid"","australia,barbedwire,circle,crosshair,cupid,diamond,dragon,dragonfly,fern,flip,gear,gumleaf,heart,information,kookaburra,mail,mapleleaf,paint_splat,paw,phone,polygon,rooster,shopping_cart,snowflake,star"} +fi fi +if $#>15 shape_$sid {max($tile_w,$tile_h)*$sub},${16--1} +else shape_$sid {max($tile_w,$tile_h)*$sub} +fi +resize. {ceil(w/$tile_w)*$tile_w},{ceil(h/$tile_h)*$tile_h},100%,100%,0,0,.5,.5 +fi +if $ang-360*floor($ang/360) rotate. $ang,1 fi +if $mirror==1 mirror. x +elif $mirror==2 mirror. y +fi +n. 0,1 autocrop. 0 +if $fit_tile +resize2din. {round([$tile_w,$tile_h]*$form_ratio)},$interpolation +else +resize. {round([$tile_w,$tile_h]*$form_ratio)},100%,100%,$interpolation +fi +resize. $tile_w,$tile_h,100%,100%,0,0,.5,.5 +cut. 0,1 n. 0,1 +avgc={ia#-1} +repeat $!-1 { +local[$<,-1] { +ntw,nth,rw,rh={tile_dim=$tile_dim;new_tile=ceil([w#0,h#0]/tile_dim);[new_tile,new_tile*tile_dim]} +if $var_kodl>1 +if $var_kodl==3 +store[0] kodl_image fi +ow,oh={[w#0,h#0]} +resize[0] $rw,$rh,100%,100%,0,$image_boundary,.5,.5 +elif $var_kodl==1 +resize[0] $rw,$rh,100%,100%,0,$image_boundary,.5,.5 ++store[$<] kodl_image +else +resize[0] $rw,$rh,100%,100%,0,$image_boundary,.5,.5 +fi +if $cs_mode&&(s#0>=3) +if $cs_mode!=2 +$convert_colors_fwd[0] +else +if s#$<==3 rgb2cmyk[0] +else +local[0] { +split c,-3 +rgb2cmyk.. +append c +} +fi +fi +fi +$ntw,$nth,2,{s#0},:"begin( +const avg_c=$avgc; +const tw=$tile_w; +const th=$tile_h; +const wwhh=$tile_wh; +const w_avg=wwhh*avg_c; +const iw_avg=wwhh-w_avg; +const tile_boundary=$tile_boundary; +tile_boundary>2?( +find_pos()=1+x%2+y%2*2; +ti_0=crop(#-1,0,0,0,0,tw,th,1,1); +ti_1=crop(#-1,tw,0,0,0,tw,th,1,1,3); +ti_2=crop(#-1,0,th,0,0,tw,th,1,1,3); +ti_3=crop(#-1,tw,th,0,0,tw,th,1,1,3); +i_ti_0=1-ti_0; +i_ti_1=1-ti_1; +i_ti_2=1-ti_2; +i_ti_3=1-ti_3; +generate_color_a()=( +if(z +,sum(crop_area*i_ti_0)/iw_avg; +,sum(crop_area*ti_0)/w_avg; +); +); +generate_color_b()=( +if(z +,sum(crop_area*i_ti_1)/iw_avg; +,sum(crop_area*ti_1)/w_avg; +); +); +generate_color_c()=( +if(z +,sum(crop_area*i_ti_2)/iw_avg; +,sum(crop_area*ti_2)/w_avg; +); +); +generate_color_d()=( +if(z +,sum(crop_area*i_ti_3)/iw_avg; +,sum(crop_area*ti_3)/w_avg; +); +); +generate_color()=arg(find_pos(),generate_color_a(),generate_color_b(),generate_color_c(),generate_color_d()); +): +tile_boundary?( +ti_0=crop(#-1,0,0,0,0,tw,th,1,1); +tile_boundary==2?( +find_pos()=y%2; +ti_1=crop(#-1,0,th,0,0,tw,th,1,1,3); +):( +find_pos()=x%2; +ti_1=crop(#-1,tw,0,0,0,tw,th,1,1,3); +); +i_ti_0=1-ti_0; +i_ti_1=1-ti_1; +generate_color()=( +find_pos()?( +if(z +,sum(crop_area*i_ti_1)/iw_avg; +,sum(crop_area*ti_1)/w_avg; +); +):( +if(z +,sum(crop_area*i_ti_0)/iw_avg; +,sum(crop_area*ti_0)/w_avg; +); +); +); +):( +ti_0=crop(#-1,0,0,0,0,tw,th,1,1); +i_ti_0=1-ti_0; +generate_color()=( +if(z +,sum(crop_area*i_ti_0)/iw_avg; +,sum(crop_area*ti_0)/w_avg; +); +); +); +); +crop_area=crop(#0,x*tw,y*th,0,c,tw,th,1,1); +generate_color(); +" +if $z_convolve +$zmap +convolve.. .,$z_convolve_boundary +rm. +fi +if $cs_mode>=2&&(s#-1>=3) +if $cs_mode!=2 +sh. 0,2 +if $z_convolve rep_mc. $cutf_vals fi +$convert_colors_bwd. +rm. +else +if s#-1==4 +cmyk2rgb. +channels[0] 0,2 +else +s. c,-4 +cmyk2rgb.. +a[-2,-1] c +channels[0] 0,3 +fi +if $z_convolve cut. 0,255 fi +fi +else +if $cs_mode $convert_colors_bwd. fi +if $z_convolve cut. 0,255 fi +fi +$ntw,$nth,1,1,:"begin( +const tw=$tile_w; +const th=$tile_h; +const tile_boundary=$tile_boundary; +const ss=s#-1; +const length=$tile_wh*ss; +nv()=vc_0+vc_1*tile_v; +tile_boundary==3?( +find_pos()=1+x%2+y%2*2; +ti_0=crop(#-2,0,0,0,0,tw,th,1,1); +ti_1=crop(#-2,tw,0,0,0,tw,th,1,1,3); +ti_2=crop(#-2,0,th,0,0,tw,th,1,1,3); +ti_3=crop(#-2,tw,th,0,0,tw,th,1,1,3); +tile_v0=resize(ti_0,length,0,2); +tile_v1=resize(ti_1,length,0,2); +tile_v2=resize(ti_2,length,0,2); +tile_v3=resize(ti_3,length,0,2); +generate_tile()=( +tile_v=arg(find_pos(),tile_v0,tile_v1,tile_v2,tile_v3); +nv=nv(); +draw(#0,nv,x*tw,y*th,0,0,tw,th,1,ss); +); +): +tile_boundary?( +ti_0=crop(#-2,0,0,0,0,tw,th,1,1); +tile_boundary==2?( +find_pos()=y%2; +ti_1=crop(#-2,0,th,0,0,tw,th,1,1,3); +):( +find_pos()=x%2; +ti_1=crop(#-2,tw,0,0,0,tw,th,1,1,3); +); +tile_v0=resize(ti_0,length,0,2); +tile_v1=resize(ti_1,length,0,2); +generate_tile()=( +tile_v=find_pos()?tile_v1:tile_v0; +nv=nv(); +draw(#0,nv,x*tw,y*th,0,0,tw,th,1,ss); +); +):( +ti=crop(#-2,0,0,0,0,tw,th,1,1); +tile_v=resize(ti,length,0,2); +generate_tile()=( +nv=nv(); +draw(#0,nv,x*tw,y*th,0,0,tw,th,1,ss); +); +); +); +c0=J(#-1,0,0,1); +c1=I(#-1); +diff_colors=c1-c0; +vc_0=resize(c0,length,1,0); +vc_1=resize(diff_colors,length,1,0); +generate_tile();" +if $var_kodl +local[0] { +if $var_kodl&1 +$kodl_image +reverse +fi +if $var_kodl>1 +resize $ow,$oh,100%,100%,0,0,.5,.5 +fi +} +fi +remove[-2,-1] +} +} +remove[-1] +#@cli rep_tfrac: eq. to 'rep_thorn_fractal' +rep_tfrac: rep_thorn_fractal $* +#@cli rep_thorn_fractal: -inf<=style<=57,_escape>0,_iteration>0,_subsampling_level>=1,_dx,_dy,_r_xy>0,_r_x>0,_r_y>0,_r_pi= { 0=r_xy multiplied by 1 | 1=r_xy multiplied by pi },_o_x,_o_y,_function_angle,_vx,_vy,..._vx_n,vy_n : \ : \ -inf<=style<=47,_escape>0,_iteration>0,_subsampling_level>=1,_dx,_dy,_r_xy>0,_r_x>0,_r_y>0,_r_pi= { 0=r_xy multiplied by 1 | 1=r_xy multiplied by pi },_o_x,_o_y,_function_angle,_vx,_vy,..._vx_n,vy_n,ovx,ovy,overload_freq>=1 : \ : \ -inf<=style<=47,_escape>0,_iteration>0,_subsampling_level>=1,_dx,_dy,_r_xy>0,_r_x>0,_r_y>0,_r_pi= { 0=r_xy multiplied by 1 | 1=r_xy multiplied by pi },_o_x,_o_y,_function_angle,_vx,_vy,..._vx_n,vy_n,ovx,ovy,cfa,cfb,overload_freq>=1 +#@cli : Thorn Fractal is the fractal attributed to Andrew Wayne Graff, alternatively named the "Secant Sea". The code was adapted from Sample C source code provided by Adam Majewski. +#@cli : +#@cli : Source - http://paulbourke.net/fractals/thorn/#dane +#@cli : +#@cli : Alternating Chaos Formula are alternating formula founded by MadJik and are originally implemented in Fractal Attractor Plugin for Paint.NET. They use overload functions rather than a simple switch. +#@cli : +#@cli : (eq. to 'rep_tfrac'). +#@cli : 'style' variable is used to define how the thorn fractal will look like with predefined formula. Use a integer value less than 0 to use custom formula, and use a integer value less than -1 to use custom alternating formula. See lists of available style and their corresponding id below. +#@cli : 'escape' variable is used to define the minimum value to escape from the iterative loop. +#@cli : 'iteration' variable defines how much repetition of loop used to find the end value. +#@cli : 'subsampling_level' defines the subsampling level of image. +#@cli : 'dx' is a number used to add to a variable involving distortion within the x-axis during the loop used for fractal generation. +#@cli : 'dy' is a number used to add to a variable involving distortion within the y-axis during the loop used for fractal generation. +#@cli : 'r_xy' defines how much the general infinite line boundary will repeat within the xy axis. +#@cli : 'r_x' defines how much the general infinite line boundary will repeat within the x axis. +#@cli : 'r_y' defines how much the general infinite line boundary will repeat within the y axis. +#@cli : 'r_pi' is used as a multiple to r_xy or to normalize the xmin and xmax to pi ranges. +#@cli : 'o_x' offset the resulting image within the x-direction. +#@cli : 'o_y' offset the resulting image within the y-direction. +#@cli : 'ang' defines the function angle of the thorn fractal. +#@cli : 'vx' variable is used to define custom formula for vx variable for the thorn fractal formula by default. +#@cli : 'vy' variable is used to define custom formula for vy variable for the thorn fractal formula by default. +#@cli : 'vx_n' variable defines a custom formula used for vx variable depending on altern number. +#@cli : 'vy_n' variable defines a custom formula used for vy variable depending on altern number. +#@cli : 'ovx' variable defines a custom formula to be used when the altern is greater than the range of cardinality of set of set[vx,vy]. 'o' in ovx stands for overload. +#@cli : 'ovx' variable defines a custom formula to be used when the altern is greater than the range of cardinality of set of set[vx,vy]. 'o' in ovx stands for overload. +#@cli : 'cfa' variable defines a variable that is used by overload formulas. Used as a temporary constant for each number that exceed the cardinality of set of set[vx,vy]. +#@cli : 'cfb' variable defines a variable that is used by overload formulas. Used as a temporary constant for each number that exceed the cardinality of set of set[vx,vy]. +#@cli : 'overload_freq' defines how much the ovx,and ovy formula will be applied when altern is greater than the range of cardinality of set of set[vx,vy]. +#@cli : - Note on custom formula usage -\n +#@cli : Available adjustible variable: v,vx,vy,dx,dy,a,b,cfa,cfb\n +#@cli : 'v' is the iteration number within loop. +#@cli : 'vx' is the output of distortion function for x-axis. +#@cli : 'vy' is the output of distortion function for y-axis. +#@cli : 'dx' is the distortion-x number. +#@cli : 'dy' is the distortion-y number. +#@cli : 'a' defines result of number defined by vx equation based on the number of repeats needed to escape from the iterative loop to check when resulting value is greater than escape number. +#@cli : 'b' defines result of number defined by vy equation based on the number of repeats needed to escape from the iterative loop to check when resulting value is greater than escape number. +#@cli : 'cfa' is the output of overload function for x-axis. +#@cli : 'cfb' is the output of overlload function for x-axis. +#@cli : +#@cli : Multiple expressions are supported, and they are separated by the character semicolon-[;]. Furthermore, the usage of commas-[,] requires you to wrap them around with quotation marks-["]. See example of usage with commas. If it the only expression, then it would be used for calculation of vx or vy. Otherwise, the first expression may be the only one used for calculation of vx or vy. +#@cli : +#@cli : - End of Note on custom formula usage - +#@cli : +#@cli : - Style List - +#@cli : +#@cli : List here below contains all the list of style. The 'asterisk' or * means the line contains a note. +#@cli : +#@cli : n<-1* = Custom Alternating Formula +#@cli : -1 = Custom Formula +#@cli : 0 = Normal +#@cli : 1 = Normal Inverted +#@cli : 2 = Arcangent +#@cli : 3 = Tangent +#@cli : 4 = Tanh Stroke +#@cli : 5 = Asymphological Vibrato +#@cli : 6 = Asymphological Basic +#@cli : 7 = Asymphological Basic 2 +#@cli : 8 = Asymphochaos +#@cli : 9 = Petallian +#@cli : 10 = Semi-Thorny Petallian +#@cli : 11 = Thorny Petal +#@cli : 12 = Thorny Petal 2 +#@cli : 13 = Inflation +#@cli : 14 = Inflation 2 +#@cli : 15 = Chaotic Creation +#@cli : 16 = Earthing +#@cli : 17 = Acrylic Earthing +#@cli : 18 = Unearthing Origami +#@cli : 19 = Cubic Unearthing +#@cli : 20 = Webbing Cubic Unearthing +#@cli : 21 = Unearthing Chaotic Hooks +#@cli : 22 = Chaotic Hooks +#@cli : 23 = Sinusoidal Liquid +#@cli : 24 = Cosinusoidal Liquid +#@cli : 25 = Echo Wide +#@cli : 26 = Echo Squircle +#@cli : 27 = Echo Hall +#@cli : 28 = Echo Hall 2 +#@cli : 29 = Liquid Parabolic +#@cli : 30 = Chaos-Vibrato +#@cli : 31 = Chaos Deep-Vibrato +#@cli : 32 = Chaos Spacetime +#@cli : 33 = Parabolic +#@cli : 34 = Parabolic Chaos +#@cli : 35 = Cubic-Diamond Chaos +#@cli : 36 = C-Line +#@cli : 37 = Contour Chaos +#@cli : 38 = Spiderweb-Diamond +#@cli : 39 = Acrylica +#@cli : 40 = Refractive Space +#@cli : 41 = Smooth-Artistry +#@cli : 42 = Ferrofluid +#@cli : 43 = Triangular Interweaving +#@cli : 44 = Fabric Chaos +#@cli : 45 = Reverse Tangent Division +#@cli : 46 = Chaotic Tangent +#@cli : 47 = Alternating Chaos 0 +#@cli : 48 = Alternating Chaos 1 (Legacy) +#@cli : 49 = Alternating Chaos 2 (Legacy) +#@cli : 50 = Alternating Chaos 3 (Legacy) +#@cli : 51 = Alternating Chaos 4 (Legacy) +#@cli : 52 = Alternating Chaos 5 (Legacy) +#@cli : 53 = Alternating Chaos 1 +#@cli : 54 = Alternating Chaos 2 +#@cli : 55 = Alternating Chaos 3 +#@cli : 56 = Alternating Chaos 4 +#@cli : 57 = Alternating Chaos 5 +#@cli : +#@cli : * = The absolute of value is the numbers of vx,vy next to '_function_angle'. Per loop, every two different functions are assigned instead. +#@cli : +#@cli : - End Style List - +#@cli : +#@cli : Author: Reptorian. +#@cli : Default values: '_escape=50000','_iteration=255','_subsampling_level=4','_dx=0','_dy=0','_r_xy=1','_r_x=1','_r_y=1','_r_pi=1','_o_x=0','_o_y=0','_function_angle=0','_custom_x=','_custom_y=' +#@cli : $ 1024,1024 rep_thorn_fractal -1,10000,255,4,2.544,-5.2424,1,1,1/2,1,0,0,30,atan2(a"^"2\,b"^"2)/cos(b),b/sin(a) +rep_thorn_fractal: +skip ${2=50000},${3=255},${4=4},${5=0},${6=0},${7=1},${8=1},${9=1},${10=1},${11=0},${12=0},${13=0},${14=},${15=} +if $1<0 +if !(narg($14)&&narg($15)) error "When using custom formula, there must be an arguments into custom_x and custom_y variables" +fi +fi +if $1>57 error "$"1<57==F fi +if $2<=0 error "$"2>0==F fi +if $3<1 error "$"3>0==F fi +if $4<1 error "$"4>0==F fi +if !(($7>0&&$8>0)&&$9>0) error "Repeat variables cannot be 0!" fi +if $1>52 +chaos_a=a/cfb +chaos_b=b/cfa +else +chaos_a=a +chaos_b=b +fi +if $1<0 +bounds:=abs($1)*2 +if narg($*)==18+$bounds activate_overload=2 +elif narg($*)==16+$bounds activate_overload=1 +else activate_overload=0 +fi +else activate_overload=0 +fi +if $activate_overload!=2&&$1<0 +repeat narg(${14--1}) { +$=t +it=${t{$>+14}} +n={$>+14} +strcontains $it,cfa +if ${} error \$\-1!=2?!incl(\$$n,cfa):T==F fi +strcontains $it,cfb +if ${} error \$\-1!=2?!incl(\$$n,cfb):T==F fi +if ('$it'=='cfa')||('$it'=='cfb') error overload!=2?str_incl(cfa):T==F fi +} +fi +if $activate_overload==2 +fta=$-3 +ftb=$-2 +if $-1>0 ovf_place_pos=if(use_altlim,if(altern==altlim,cfa=fta();cfb=ftb(););); +elif $-1<0 ovf_place_neg=if(use_altlim,if(altern==altlim,cfa=fta();cfb=ftb(););); +else activate_overload=0 +fi +else +fta=atan(vx) +ftb=atan(vy) +if $1>52 ovf_place_pos=if(use_altlim,if(altern==altlim,cfa=fta();cfb=ftb(););); fi +fi +foreach { +ww,hh={[w,h]} +iw,ih={int($4*[$ww,$hh])} +if !($iw%2) iw+=1 fi +if !($ih%2) ih+=1 fi +rm +$iw,$ih,1,1,"begin( +altern=0; +const half_width=w/2; +const half_height=h/2; +const sd=max(w,h)/min(w,h); +w>h?( +const sx=half_width/sd; +const sy=half_height; +):( +const sx=half_width; +const sy=half_height/sd; +); +const rf=int(abs($3)); +const chaos=$1>46; +const ang=pi*($13/180); +const cos_ang=cos(ang); +const sin_ang=sin(ang); +const dx=$5; +const dy=$6; +const rpi=($10?pi:1); +const ox=$11*rpi; +const oy=$12*rpi; +const srpi=rpi*$7; +const szx=$8*srpi; +const szy=$9*srpi; +const overload=$activate_overload; +const activate_alt_bool=chaos||$1<-1||($1==-1&&overload); +const use_altlim=($1<0&&(overload==2))||$1>52; +chaos?(const altlim=3;) +:(use_altlim?( +const max_vec_pos=(overload?($-1<0?0:1):1); +const altlim=abs($1)-max_vec_pos; +const overlim=altlim+max_vec_pos; +):( +const altlim=abs($1)-1; +const overlim=altlim+1; +); +); +cfa=cfb=1; +vx=vy=0; +fta()="$fta"; +ftb()="$ftb"; +logabs(v)=log(abs(v)); +logabs_zero_inf(v)=log(abs(v)+1); +concat(arg...)=( +ref([arg],numbers); +additional_numbers=size(numbers)-1; +first_number=numbers[0]; +a=abs(first_number); +use_negative=first_number<0; +repeat(additional_numbers,pos, +num_pos=pos+1; +b=abs(numbers[num_pos]); +num_digits=(b>0?int(log10(b)))+1; +if(num_pos!=additional_numbers +,a=int(a*10^num_digits+b); +,a=int(a*10^num_digits)+b; +); +); +use_negative?-a:a; +); +overload?( +const count_overload=abs($-1); +):( +const count_overload=0; +); +chaos?( +const ff=use_altlim? $1-49 : $1-44 ; +):( +const ff=abs($1)-1+count_overload; +); +($1<-1||($1==-1&&overload))?( +overload?( +use_altlim?( +vxf(a,b)=arg(min(altern,overlim)+1,${14--4:2}); +vyf(a,b)=arg(min(altern,overlim)+1,${15--4:2}); +):( +vxf(a,b)=arg(min(altern,overlim)+1,${14--2:2}); +vyf(a,b)=arg(min(altern,overlim)+1,${15--2:2}); +); +):( +vxf(a,b)=arg(altern+1,${14--1:2}); +vyf(a,b)=arg(altern+1,${15--1:2}); +); +): +$1==-1?( +vxf(a,b)=$14; +vyf(a,b)=$15; +): +$1==0?( +vxf(a,b)=a/cos(b); +vyf(a,b)=b/sin(a); +): +$1==1?( +vxf(a,b)=a/sin(b); +vyf(a,b)=b/cos(a); +): +$1==2?( +vxf(a,b)=a/atan(b); +vyf(a,b)=b/atan(a); +): +$1==3?( +vxf(a,b)=a/tan(b); +vyf(a,b)=b/tan(a); +): +$1==4?( +vxf(a,b)=a/cos(b)*sin(b); +vyf(a,b)=b/sin(a)*cos(a); +): +$1==5?( +vxf(a,b)=a*tan(a*b)/sin(b); +vyf(a,b)=b*tan(a*b)/cos(a); +): +$1==6?( +vxf(a,b)=(a+tan(a*b))/sin(b); +vyf(a,b)=(b+tan(a*b))/cos(a); +): +$1==7?( +vxf(a,b)=(a-tan(a*b))/sin(b); +vyf(a,b)=(b-tan(a*b))/cos(a); +): +$1==8?( +vxf(a,b)=a/cos(b)+a/sin(b); +vyf(a,b)=b/cos(a)+b/sin(a); +): +$1==9?( +vxf(a,b)=a/(cos(b)*sin(b)); +vyf(a,b)=b/(sin(a)*cos(a)); +): +$1==10?( +vxf(a,b)=a/(cos(tan(b))*sin(tan(b))); +vyf(a,b)=b/(sin(tan(a))*cos(tan(a))); +): +$1==11?( +vxf(a,b)=(tan(a)+b)/(cos(tan(b))*sin(tan(b))); +vyf(a,b)=(tan(b)+a)/(sin(tan(a))*cos(tan(a))); +): +$1==12?( +vxf(a,b)=(a+tan(a)+tan(b))/(cos(tan(b))*sin(tan(b))); +vyf(a,b)=(b+tan(a)+tan(b))/(sin(tan(a))*cos(tan(a))); +): +$1==13?( +vxf(a,b)=(a+tan(a)+tan(b))/cos(a); +vyf(a,b)=(b+tan(a)+tan(b))/sin(a); +): +$1==14?( +vxf(a,b)=(a+tan(a)+tan(b))/sin(b); +vyf(a,b)=(b+tan(a)+tan(b))/cos(a); +): +$1==15?( +vxf(a,b)=a/sin(cos(b)*sin(b)); +vyf(a,b)=b/cos(sin(a)*cos(a)); +): +$1==16?( +vxf(a,b)=(a+tan(a)/tan(b))/cos(a); +vyf(a,b)=(b+tan(a)/tan(b))/sin(b); +): +$1==17?( +vxf(a,b)=(b+tan(a)/tan(b))/cos(a); +vyf(a,b)=(a+tan(a)/tan(b))/sin(b); +): +$1==18?( +vxf(a,b)=(b+tan(b)/tan(a))/cos(a); +vyf(a,b)=(a+tan(a)/tan(b))/sin(b); +): +$1==19?( +vxf(a,b)=(b+tan(b)/tan(a))/cos(a); +vyf(a,b)=(a+tan(b)/tan(a))/sin(b); +): +$1==20?( +vxf(a,b)=(b+tan(a)/tan(a))/cos(a); +vyf(a,b)=(a+tan(b)/tan(a))/sin(b); +): +$1==21?( +vxf(a,b)=b+tan(a)/a/cos(b)+a/sin(b); +vyf(a,b)=a+tan(b)/b/cos(a)+b/sin(a); +): +$1==22?( +vxf(a,b)=b+tan(a)/(a/cos(b))+a/sin(b); +vyf(a,b)=a+tan(b)/(b/cos(a))+b/sin(a); +): +$1==23?( +vxf(a,b)=a+3*sin(b)-pi; +vyf(a,b)=a+b+3*sin(a)-pi; +): +$1==24?( +vxf(a,b)=a+3*cos(b)-pi; +vyf(a,b)=a+b+3*cos(a)-pi; +): +$1==25?( +vxf(a,b)=a/sin(a/sin(b)); +vyf(a,b)=b/cos(b/cos(a)); +): +$1==26?( +vxf(a,b)=a/cos(a/sin(b)); +vyf(a,b)=b/sin(b/cos(a)); +): +$1==27?( +vxf(a,b)=a/cos(a/atan(sin(b))); +vyf(a,b)=b/sin(b/atan(cos(a))); +): +$1==28?( +vxf(a,b)=a/sin(a/atan(cos(b))); +vyf(a,b)=b/cos(b/atan(sin(a))); +): +$1==29?( +vxf(a,b)=a/atan(cos(b)); +vyf(a,b)=b/atan(sin(a)); +): +$1==30?( +vxf(a,b)=(a+tanh(a*b))/cos(b); +vyf(a,b)=(b+tanh(a*b))/sin(a); +): +$1==31?( +vxf(a,b)=b+tan(b)/(a/(cos(b)))+a/(sin(a)); +vyf(a,b)=a+tan(a)/(b/(cos(a)))+b/(sin(b)); +): +$1==32?( +vxf(a,b)=(a+tanh(a+b))/cos(b); +vyf(a,b)=(b+tanh(a+b))/sin(a); +): +$1==33?( +vxf(a,b)=a/sin(b)/tan(b); +vyf(a,b)=b/cos(a)/tan(a); +): +$1==34?( +vxf(a,b)=a/(tan(b)*cos(b)*sin(b)); +vyf(a,b)=b/(tan(a)*cos(a)*sin(a)); +): +$1==35?( +vxf(a,b)=a/tan(cos(b)); +vyf(a,b)=b/tan(sin(a)); +): +$1==36?( +vxf(a,b)=(a+tanh(a*b))/(cos(b)*sin(a)); +vyf(a,b)=(b+tanh(a*b))/(sin(b)*cos(a)); +): +$1==37?( +vxf(a,b)=(a+tan(cos(a)*sin(b)))/cos(a); +vyf(a,b)=(b+tan(sin(a)*cos(b)))/sin(b); +): +$1==38?( +vxf(a,b)=(tan(a+b)*b)/cos(b); +vyf(a,b)=(tan(a-b)*a)/sin(a); +): +$1==39?( +vxf(a,b)=a/cos(b)*sin(a); +vyf(a,b)=b/sin(a)*cos(b); +): +$1==40?( +vxf(a,b)=a/tan(cos(b)+sin(b)); +vyf(a,b)=b/tan(cos(a)+sin(a)); +): +$1==41?( +vxf(a,b)=a+(tanh(a+b)/cos(b)); +vyf(a,b)=b+(tanh(a+b)/sin(a)); +): +$1==42?( +vxf(a,b)=(a/(cos(b)))/(b/(sin(a))); +vyf(a,b)=(b/(cos(a)))/(a/(sin(b))); +): +$1==43?( +vxf(a,b)=(a*tan(a+b))/sin(b); +vyf(a,b)=(b*tan(a+b))/cos(a); +): +$1==44?( +vxf(a,b)=a/(atan2(b^2,a^2)*tan(b)); +vyf(a,b)=b/(atan2(b^2,a^2)*tan(a)); +): +$1==45?( +vxf(a,b)=tan(a)/b; +vyf(a,b)=tan(b)/a; +): +$1==46?( +vxf(a,b)=a/atan(b/cos(a/sin(a))); +vyf(a,b)=b/atan(a/sin(b/cos(b))); +): +$1>46?( +vxf(a,b)=altern>3?"$chaos_a":arg(altern+1,a/cos(b),a/sin(b),a/tan(b),a/atan(b)); +vyf(a,b)=altern>3?"$chaos_b":arg(altern+1,b/sin(a),b/cos(a),b/tan(a),b/atan(a)); +); +); +xx=(x-half_width)/sx; +yy=(y-half_height)/sy; +zx=szx*((xx*cos_ang-yy*sin_ang))+ox; +zy=szy*((xx*sin_ang+yy*cos_ang))+oy; +zx&&zy?( +vx=zx; +vy=zy; +repeat(rf,v, +a=vx; +b=vy; +"$ovf_place_neg" +vx=vxf(a,b); +vy=vyf(a,b); +"$ovf_place_pos" +vx+=dx; +vy+=dy; +if(activate_alt_bool, +++altern; +if(altern>ff,altern=0); +); +if((vx*vx+vy*vy)>$2,break()); +); +v; +):(0);" +r $ww,$hh,1,1,6 +} +fx_rep_modo: +if ($1>=0&&$1<4)||$1>=9 color_id=[{vector3(255)}] +elif $1==4 color_id=[{vector4(255)}] +elif $1<9 color_id=[360,1,1] +fi +if $1==4 v_n={$2?(!$37&&$11):(!$16&&$15)},{$2?(!$38&&$11):(!$21&&$20)},{$2?(!$39&&$11):(!$26&&$25)},{$2?(!$40&&$11):(!$31&&$30)},{$2?(!$41&&$11):(!$36&&$35)} +else v_n={$2?(!$37&&$11):(!$16&&$15)},{$2?(!$38&&$11):(!$21&&$20)},{$2?(!$39&&$11):(!$26&&$25)},{$2?(!$41&&$11):(!$36&&$35)} +fi +use_negate=max($v_n) +v_n=[$v_n] +color_channels={$1==4?4:3} +convert_colors_fwd=${arg\ $1+1,,rgb2srgb,rgb2ryb,rgb2cmy,,rgb2hcy,rgb2hsi,rgb2hsl,rgb2hsv,rgb2lab8,rgb2lch8,rgb2yiq8,rgb2yuv8,rgb2ycbcr,rgb2ycbcrglic,rgb2xyz8,rgb2yes8,rgb2k18,rgb2ohta8} +convert_colors_bwd=${arg\ $1+1,,srgb2rgb,ryb2rgb,cmy2rgb,,hcy2rgb,hsi2rgb,hsl2rgb,hsv2rgb,lab82rgb,lch82rgb,yiq82rgb,yuv82rgb,ycbcr2rgb,ycbcrglic2rgb,xyz82rgb,yes82rgb,k182rgb,ohta82rgb} +if $1 +foreach { +if $1!=4 +$convert_colors_fwd. +else +if s==3 rgb2cmyk +elif s==4 s c,-3 rgb2cmyk.. a c +fi +u cmyk +fi +} +fi +if $color_channels==3 +modo_variables={$2?$8:$12},{($color_id)[0]},{$2?($37?-2:($10?-1:$9%)):($16?-2:($14?-1:$13%))},{$2?$8:$17},{($color_id)[1]},{$2?($38?-2:($10?-1:$9%)):($21?-2:($19?-1:$18%))},{$2?$8:$22},{($color_id)[2]},{$2?($39?-2:($10?-1:$9%)):($26?-2:($24?-1:$23%))},$32,255,{($2?$41:$36)?-2:($34?-1:$33%)} +else +modo_variables={$2?$8:$12},{($color_id)[0]},{$2?($37?-2:($10?-1:$9%)):($16?-2:($14?-1:$13%))},{$2?$8:$17},{($color_id)[1]},{$2?($38?-2:($10?-1:$9%)):($21?-2:($19?-1:$18%))},{$2?$8:$22},{($color_id)[2]},{$2?($39?-2:($10?-1:$9%)):($26?-2:($24?-1:$23%))},{$2?$8:$27},{($color_id)[3]},{$2?($40?-2:($10?-1:$9%)):($31?-2:($29?-1:$28%))},$32,255,{($2?$41:$36)?-2:($34?-1:$33%)} +fi +rep_modo_mc $modo_variables +if $use_negate +foreach { +ss={s-1} +repeat s { +if $>!=$ss if ($v_n)[$>] sh. $> f. ($color_id)[$>]-i rm. fi +else if ($v_n)[$>] sh. $> f. 255-i rm. fi +fi +} +} +fi +if $1 +foreach { +if $1!=4 +$convert_colors_bwd. +else +if s==4 cmyk2rgb +elif s==5 s c,-4 cmyk2rgb.. a c +fi +fi +} +fi +if !$3 rv fi +if '$_host'=='paintdotnet' k[0] fi +fx_rep_modo_preview: +two_plus_layer={$!>1} +ms=${-max_s} +rv gui_split_preview "fx_rep_modo ${1-41}",${-3--1} +contain_alpha={$ms>3} +activate_individual_channels={!$2?2} +mode_0={$contain_alpha&&$2?2} +mode_1={!$contain_alpha&&!$2?2} +mode_2={$1!=4?(($contain_alpha&&!$2)?2):((!$contain_alpha&&!$2)?2)} +mode_3={!$2?(($1==4&&$contain_alpha)?2)} +use_channel_1_a={$5==0?2} +use_channel_1_b={$6==0?2} +use_channel_1_c={$7==0?2} +use_channel_2_a={$5==1?2} +use_channel_2_b={$6==1?2} +use_channel_2_c={$7==1?2} +use_channel_3_a={$5==2?2} +use_channel_3_b={$6==2?2} +use_channel_3_c={$7==2?2} +activate_a={!$2?(($mode_1?$use_channel_1_a:($mode_2?$use_channel_1_b:$use_channel_1_c))?2)} +activate_b={($mode_1?$use_channel_2_a:($mode_2?$use_channel_2_b:$use_channel_2_c))?2} +activate_c={($mode_1?$use_channel_3_a:($mode_2?$use_channel_3_b:$use_channel_3_c))?2} +activate_d={$1==4?($mode_2?($6==3?2):($mode_3?($7==3?2)))} +activate_e={$2?($mode_0?($4==1?2)):($contain_alpha?($1!=4?($mode_2?($6==3?2):($7==4?2)):($mode_3?$7==4?2)))} +activate_csm={$2&&!$4?2} +activate_bottom_sec={$2?2} +u "{$1}""{$2}""{$3}""{$4}_"{$mode_0}"{$5}_"{$mode_1}"{$6}_"{$mode_2}"{$7}_"{$mode_3}"{$8}_"{$activate_csm}"{$9}_"{$activate_csm}"{$10}_"{$two_plus_layer?$activate_csm}"{$11}_"{$activate_csm}"{$12}_"{$activate_a}"{$13}_"{$activate_a}"{$14}_"{$two_plus_layer?$activate_a}"{$15}_"{$activate_a}"{$16}_"{$activate_a}"{$17}_"{$activate_b}"{$18}_"{$activate_b}"{$19}_"{$two_plus_layer?$activate_b}"{$20}_"{$activate_b}"{$21}_"{$activate_b}"{$22}_"{$activate_c}"{$23}_"{$activate_c}"{$24}_"{$two_plus_layer?$activate_c}"{$25}_"{$activate_c}"{$26}_"{$activate_c}"{$27}_"{$activate_d}"{$28}_"{$activate_d}"{$29}_"{$two_plus_layer?$activate_d}"{$30}_"{$activate_d}"{$31}_"{$activate_d}"{$32}_"{$activate_e}"{$33}_"{$activate_e}"{$34}_"{$two_plus_layer?$activate_e}"{$35}_"{$activate_e}"{$36}_"{!$2?$activate_e}"{$37}_"{$activate_bottom_sec}"{$38}_"{$activate_bottom_sec}"{$39}_"{$activate_bottom_sec}"{$40}_"{$2?($1==4?2)}"{$41}_"{($2&&$contain_alpha)?2}"{$42}""{$43,$44}" +fx_OOBS: +-m "MergeChoice : $""=_mode" -MergeChoice "add","alpha","and","average","burn","darken","difference","divide","dodge","exclusion","freeze","grainextract","grainmerge","hardlight","hardmix","interpolation","lighten","linearburn","linearlight","multiply","normal","negation","or","overlay","pinlight","reflect","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","vividlight","xor","edges","error" +split_opacity +local[0] +if $2==0 +if $1==1 rgb2hsv +elif $1==2 rgb2hsl +elif $1==3 rgb2hsi +elif $1==4 rgb2lch +elif $1==5 rgb2lab +elif $1==6 rgb2ycbcr +elif $1==7 rgb2yiq +elif $1==8 rgb2yuv +elif $1==9 rgb2xyz +fi +elif $2==1 +if $1==0 rgb2srgb +elif $1==1 rgb2hsv8 +elif $1==2 rgb2hsl8 +elif $1==3 rgb2hsi8 +elif $1==4 rgb2lch8 +elif $1==5 rgb2lab8 +elif $1==6 rgb2ycbcrglic +elif $1==7 rgb2yiq8 +elif $1==8 rgb2yuv8 +elif $1==9 rgb2xyz8 +fi fi +s c +if $3==1 +if $4==1 local[0] +oobs_edit[0] $8,$9,$10 -blend[0,1] ${_mode{$11+1}},$12/100 done fi +if $5==1 local[1] +oobs_edit[0] $8,$9,$10 -blend[0,1] ${_mode{$11+1}},$12/100 done fi +if $6==1 local[2] +oobs_edit[0] $8,$9,$10 -blend[0,1] ${_mode{$11+1}},$12/100 done fi +elif $3==0 +if $4==1 local[0] +oobs_edit[0] $13,$14,$15 -blend[0,1] ${_mode{$16+1}},$17/100 done fi +if $5==1 local[1] +oobs_edit[0] $18,$19,$20 -blend[0,1] ${_mode{$21+1}},$22/100 done fi +if $6==1 local[2] +oobs_edit[0] $23,$24,$25 -blend[0,1] ${_mode{$26+1}},$27/100 done fi +fi +a c +if $2==0 +if $1==1 hsv2rgb +elif $1==2 hsl2rgb +elif $1==3 hsi2rgb +elif $1==4 lch2rgb +elif $1==5 lab2rgb +elif $1==6 ycbcr2rgb +elif $1==7 yiq2rgb +elif $1==8 yuv2rgb +elif $1==9 xyz2rgb +fi +elif $2==1 +if $1==0 srgb2rgb +elif $1==1 hsv82rgb +elif $1==2 hsl82rgb +elif $1==3 hsi82rgb +elif $1==4 lch82rgb +elif $1==5 lab82rgb +elif $1==6 ycbcrglic2rgb +elif $1==7 yiq82rgb +elif $1==8 yuv82rgb +elif $1==9 xyz82rgb +fi fi +done +local[1] +if $3==1 if $7==1 +oobs_edit[0] $8,$9,$10 -blend[0,1] ${_mode{$11+1}},$12/100 fi +elif $3==0 if $7==1 +oobs_edit[0] $28,$29,$30 -blend[0,1] ${_mode{$31+1}},$32/100 fi +fi +done +a c +oobs_edit : +if $1==0 -overblur_overline[0] 0,$2,$3 fi +if $1==1 -overblur_overline[0] 1,$2,$3 fi +if $1==2 -blur[0] {$2*$3} fi +if $1==3 -sharpen[0] {$2*$3} fi +overblur_overline : +if $1==0 +blur[0] $2 +elif $1==1 +sharpen[0] $2 +fi ++blend[0,1] difference +mul[2] $3 +remove[1] +-blend[0,1] add +_fx_OOBS_preview : +gui_split_preview "fx_OOBS ${1--2}",$-1 +fx_streeze: skip "${1=10},${2=20},${3=20},${4=80},${5=80},${6=20},${7=80},${8=120},${9=0},${10=2},${11=0},${12=1}" +foreach { +vx,vy:=w,h +if $9==0||$9==2 axis,rx,ry,rxb,ryb=x,$5,100,$8,100 fi +if $9==1 axis,rx,ry,rxb,ryb=y,100,$5,100,$8 fi +repeat 2 { +repeat $1 { +s $axis,$2 +l[0%-$3%,$4%-100%] { r $rx%,$ry%,100%,100%,{$10+1},1 } +l[$6%-$7%] { r $rxb%,$ryb%,100%,100%,{$10+1},1 } +a $axis r $vx,$vy,100%,100%,{$10+1},1 +if $11 w wait $12 fi +} +if $9==2 axis,rx,ry,rxb,ryb=y,100,$5,100,$8 else break fi +} +} +fx_streeze_preview: +fx_streeze $* +uglify : +com,origres,procres,dccires,preset,bst,bstsharp,bstblur,locnorm,filt,dist,distblur,distmerge,diststr,wc,bilsize,bilrep,fuzz,fuzzblur,fuzstr,plsmseed,plsmsat,plsmblur,plasmerge,plastr,cracks,sckrad,sck,lgtone,lgttwo,lgthree,sketch,sklike,cutmin,cutmax,linthick,linestr,brkstr,wl,wldef,skmerge,noistr,cnvs,cvmod,cvr,cvg,cvb,cva,post,emboss,huestr,bri,con,gam,hue,sat=${1-56} +arg0 $distmerge,"add","and","average","blue","burn","darken","difference","divide","dodge","exclusion","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor" +distmerge=${} +arg0 $plasmerge,"add","and","average","blue","burn","darken","difference","divide","dodge","exclusion","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor" +plasmerge=${} +arg0 $skmerge,"add","and","average","blue","burn","darken","difference","divide","dodge","exclusion","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor" +skmerge=${} +foreach { +to_rgba +nm[0] ORIG +__ORIGW={0,w} +__ORIGH={0,h} +if !$origres res=$procres,$procres rr2d[ORIG] $res,0,6 fi +n 0,255 +if $bst +if $bstblur b $bstblur fi +if $bstsharp sharpen $bstsharp fi +if $locnorm normalize_local $locnorm,$locnorm fi +fi +[ORIG] nm. REND +if $filt +if $diststr +[ORIG] nm. FILT +l[REND,FILT] { +usrmod=$dist,$distblur +if [$usrmod]!=[0,0] +if $dist apc. "deform $dist" fi +if $distblur b. $distblur fi +blend[REND,FILT] $distmerge,$diststr +n[REND] 0,255 +fi +} +fi +fi +if $wc +if $plastr +[ORIG] nm. PLAS +l[PLAS] { +if $plsmseed>-1 srand $plsmseed fi +plasma 1,2,5 +if $plsmsat!=0 adjust_colors 0,0,0,0,$plsmsat fi +if $plsmblur>0 b $plsmblur fi +} +blend[REND,PLAS] $plasmerge,$plastr +fi +if $fuzz +[ORIG] nm. FUZZ +l[FUZZ] { +fc 255,255,255 +rectangle $fuzz%,$fuzz%,{100-$fuzz}%,{100-$fuzz}%,1,0 +if $fuzzblur b $fuzzblur,0 fi +repeat 10 { +deform $fuzz +spread {[$fuzz/2,$fuzz/2]} +} +if $fuzstr!=1 mul $fuzstr fi +} +blend_median[REND,FUZZ] fi +fi +local[REND] +if $cracks +if $sckrad deform 1.5 sharpen $sckrad,$sck dilate_oct 1.5 sharpen $sckrad,$sck fi +if $lgtone +repeat 3 { +fx_light_relief $lgtone,$lgttwo,$lgthree,0,0.2,50,50,20,0.084,0,0 +b 2 erode_oct 3 sharpen $sckrad +} +fi +fi +if $wc +if $bilrep>0 +repeat $bilrep { +deform {0,w/1000} bilateral $bilsize,$bilsize,$bilsize,$bilsize +} +fi +fi +done +if $post +if $huestr +[ORIG] nm. HUE +[ORIG] nm. SAT +b[HUE,SAT] 5 +blend[HUE,REND] hue,$huestr +blend[SAT,REND] saturation,$huestr +fi +fi +if $sketch +if $linestr>0 +[ORIG] nm. LINE +l[LINE] { +if $__ORIGW/2>1500 r 50%,50%,100%,100%,6 fi +deform {0,w/2000} rolling_guidance {31-$sklike},20,0 +if $__ORIGW/2>1500 r 200%,200%,100%,100%,6 fi +gradient_norm negate +if $brkstr>0 +. repeat 2 fx_breaks. 1,5,20,0,3 done +blend[-1,-2,LINE] multiply,$brkstr +fi +if $linthick +erode_circ. {$linthick/2} +spread. {$linthick/10} +dilate_circ. {$linthick/10} +b. {$linthick/5} +if $linthick/5>=3 sharpen. {$linthck*100} else sharpen. 100 fi +fi +adjust_colors. ,$cutmin,$cutmax,, n. 0,255 spread. 0.5 ++store. line +} +split[REND] c a[1,2,3] c +blend[LINE,REND] $skmerge,$linestr +if $wl>0 +$line negate. erode_circ. {$linthick/2} +if $wldef deform. $wldef fi +. blend[REND,LINE] or,$wl blend[-1,-2] add,1 +fi +a[REND] [-1],c +fi +fi +n[REND] 0,255 +keep[REND] +if $post +usrmod=$bri,$con,$gam,$hue,$sat +if [$usrmod]!=[0,0,0,0,0] adjust_colors[REND] $bri,$con,$gam,$hue,$sat fi +fi +if $dccires repeat $dccires { r 200%,200%,100%,100%,6 } fi +if $noistr fx_noise $noistr,0,11,1,0,50,50 fi +if $cnvs fx_prawn_canvas[REND] $cnvs,$cvmod,1,$cvr,$cvg,$cvb,$cva fi +if $post +if $emboss rep_emboss_relief 5,0,0.5,$emboss,1,0,1 fi +fi +if $com +expand_y 35,0 +shift 0,35 +text "${1--1}",10,30,12,1,255 +text $distmerge" "$plasmerge" "$skmerge,10,50,20,1,255 +fi +} +uglify_preview : +__output=${1--2} +preset,old_preset={[$5,${-1}]} +if $preset==1 +variables=0,1,1000,0,1,0,0,0,0,0,0,0,13,0,0,0,0,0,0,0,-1,-100,0,23,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,22,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0 +elif $preset==2 +variables=0,1,1000,0,2,1,0,2,0,1,20,10,7,0.4,1,12,2,127,42,0.365,-1,0,0,11,0.5,1,1,0,0.01,0.02,0.02,1,30,0,0,5,1,0,1,4,22,6,0,0,255,255,255,255,1,0,0.8,0,0,9,0,0 +elif $preset==3 +variables=0,1,1000,0,3,0,0,0,0.3,1,3,3,13,0.5,1,12,1,0,20,0.5,-1,-100,0,37,0.755,1,500,1,0.027,0.02,0.02,1,25,0,0,2,1,0.9,1,4,22,6,0.3,0,255,255,255,255,1,1.5,1,0,0,31,0,0 +elif $preset==4 +variables=0,1,1000,0,0,1,500,0,0.366,0,3,3,13,0.5,1,10,0,0,0,0.5,-1,80,0,7,0.2,1,0,1,0.134,0.02,0.02,1,29,0,0,0,0.707,0,1,1.6,19,6,0.61,11,255,255,255,255,1,1.1,0,0,0,0,0,-100 +elif $preset==5 +variables=0,1,1000,0,0,1,308,0,2.3736,1,3,3,0,0.5,1,23,2,350,1,0.5,-1,100,0,10,1,1,0,1,0.2,0.02,0.02,1,29,0,0,2,0.9,1,1,1.6,22,6,1,19,134,110,71,255,1,1,0,0,0,13.4,0,-100 +elif $preset==6 +variables=0,1,1000,0,0,0,0,0,0.3,0,3,3,13,0.5,1,12,0,0,20,0.5,437767,-100,19.75,37,1,1,500,0,0.021,0.02,0.02,1,20,0,0,4,1,1,1,4,13,0,0,16,125,125,125,255,1,0.965,1,0,-47.6,0,0,0 +fi +if $preset +if $preset==$old_preset +if [$__output]!=[$variables] +__output=${1-4},0,${6--2} +fi +else +__output=$variables +fi +fi +com,origres,procres,dccires,preset,bst,bstsharp,bstblur,locnorm,filt,dist,distblur,distmerge,diststr,wc,bilsize,bilrep,fuzz,fuzzblur,fuzstr,plsmseed,plsmsat,plsmblur,plasmerge,plastr,cracks,sckrad,sck,lgtone,lgttwo,lgthree,sketch,sklike,cutmin,cutmax,linthick,linestr,brkstr,wl,wldef,skmerge,noistr,cnvs,cvmod,cvr,cvg,cvb,cva,post,emboss,huestr,bri,con,gam,hue,sat=$__output +uglify $__output +u "{"$com"}""{"$origres"}""{"$procres"}""{"$dccires"}""{"$preset"}""{"$bst"}""{"$bstsharp"}""{"$bstblur"}""{"$locnorm"}""{"$filt"}""{"$dist"}""{"$distblur"}""{"$distmerge"}""{"$diststr"}""{"$wc"}""{"$bilsize"}""{"$bilrep"}""{"$fuzz"}""{"$fuzzblur"}""{"$fuzstr"}""{"$plsmseed"}""{"$plsmsat"}""{"$plsmblur"}""{"$plasmerge"}""{"$plastr"}""{"$cracks"}""{"$sckrad"}""{"$sck"}""{"$lgtone"}""{"$lgttwo"}""{"$lgthree"}""{"$sketch"}""{"$sklike"}""{"$cutmin"}""{"$cutmax"}""{"$linthick"}""{"$linestr"}""{"$brkstr"}""{"$wl"}""{"$wldef"}""{"$skmerge"}""{"$noistr"}""{"$cnvs"}""{"$cvmod"}""{"$cvr,$cvg,$cvb,$cva"}""{"$post"}""{"$emboss"}""{"$huestr"}""{"$bri"}""{"$con"}""{"$gam"}""{"$hue"}""{"$sat"}""{"$preset"}" +fx_rep_array_random_jumble_by_px: +if narg($_persistent) +remove +$_persistent +else +fx_rep_array_random_jumble_by_px_preview $* +fi +fx_rep_array_random_jumble_by_px_preview: +contain_persistent,link_dimensions={narg($_persistent)},$5 +if $contain_persistent +list_of_widths_factors=$11 +list_of_heights_factors=$12 +list_of_widths_and_heights_factors=$13 +number_of_widths_factors,number_of_heights_factors,number_of_widths_and_heights_factors=${14-16} +else +list_of_widths={expr('w#x',$!)} +list_of_heights={expr('h#x',$!)} +list_of_widths_and_heights=$list_of_widths,$list_of_heights +list_of_widths_factors=${rep_find_factors_of\ $list_of_widths} +list_of_heights_factors=${rep_find_factors_of\ $list_of_heights} +list_of_widths_and_heights_factors=${rep_find_factors_of\ $list_of_widths_and_heights} +number_of_widths_factors:=narg($list_of_widths_factors) +number_of_heights_factors:=narg($list_of_heights_factors) +number_of_widths_and_heights_factors:=narg($list_of_widths_and_heights_factors) +fi +enforce_factors={$contain_persistent?$6} +if $enforce_factors +tile_w,tile_h=${1-2} +if $link_dimensions +if $number_of_widths_and_heights_factors==1 error no_common_factors fi +if $tile_w!=$tile_h +tile_dim:=u(0,1,0,0)<.5?$tile_h:$tile_w +elif $tile_w!=$3 +tile_dim=$tile_w +elif $tile_h!=$4 +tile_dim=$tile_h +else +tile_dim=$tile_w +fi +tile_dim=${rep_closest_number_in_ordered_list_of_numbers\ $tile_dim,$list_of_widths_and_heights_factors} +tile_w,tile_h=$tile_dim +else +tile_w=${rep_closest_number_in_ordered_list_of_numbers\ $tile_w,$list_of_widths_factors} +tile_h=${rep_closest_number_in_ordered_list_of_numbers\ $tile_h,$list_of_heights_factors} +fi +else +if $link_dimensions +if $1!=$3 +tile_w,tile_h=$1 +elif $2!=$4 +tile_w,tile_h=$2 +else +tile_w,tile_h={$1==$2?$1:(u(0,1,1,0)<.5?$1:$2)} +fi +else +tile_w,tile_h=${1-2} +fi +fi +shuffle_images={$7||($tile_w!=$3)||($tile_h!=$4)||!$contain_persistent} +tile_dims=$tile_w,$tile_h +if $shuffle_images +foreach { +mini_image_width,mini_image_height={ceil([w,h]/[$tile_dims])} +if $mini_image_width==1&&$mini_image_height==1 continue fi +new_image_width,new_image_height={[$mini_image_width,$mini_image_height]*[$tile_dims]} +refit_image={$new_image_width!=w||$new_image_height!=h} +if $refit_image +ow,oh={[w,h]} +resize $new_image_width,$new_image_height,100%,100%,0,2,.5,.5 +fi +$new_image_width,$new_image_height,100%,100% +$mini_image_width,$mini_image_height,1,2,"begin( +const mini_w=$tile_w; +const mini_h=$tile_h; +); +cx=x*mini_w; +cy=y*mini_h; +[cx,cy];" +gcd_shuffle[-1] +eval[-1] :"begin( +const mini_w=$tile_w; +const mini_h=$tile_h; +const depth=d#0; +const spectrum=s#0; +); +tile=crop(#0,i0,i1,0,0,mini_w,mini_h,depth,spectrum); +draw(#1,tile,x*mini_w,y*mini_h,0,0,mini_w,mini_h,depth,spectrum); +I;" +keep[1] +if $refit_image +start_x,start_y:=int(([$new_image_width,$new_image_height]-[$ow,$oh])>>1) +end_x,end_y:=[$start_x,$start_y]+([$ow,$oh]-1) +crop $start_x,$start_y,$end_x,$end_y +fi +} +store _persistent +else +remove +fi +$_persistent +if '$_host'!='$cli' +crop $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1 +fi +factors_display_mode={1+!$link_dimensions} +u "{"$tile_w"}""{"$tile_h"}""{"$tile_w"}""{"$tile_h"}""{$5}""{"$enforce_factors"}""{0}""{"$list_of_widths_factors"}_"$factors_display_mode"{"$list_of_heights_factors"}_"$factors_display_mode"{"$list_of_widths_and_heights_factors"}""{"$list_of_widths_factors"}""{"$list_of_heights_factors"}""{"$list_of_widths_and_heights_factors"}""{"$number_of_widths_factors"}""{"$number_of_heights_factors"}""{"$number_of_widths_and_heights_factors"}" +fx_rep_trsa: +skip ${18=0},${19=1} +local[-1] { +ww={w} hh={h} +channels 0 f 0 +r2dx {$17*100}% +rep_trsa $1,{$2*$17},${3-12},$19 +u {${}/wh#-1} +n 0,1 +if $14 r 100%,100%,100%,2 fi +if $14<1 f [i^(1/$15)] +else f i^(1/$15) +fi +r $ww,$hh,1,{s},2 +* 255 * $16 +} +fx_rep_trsa_preview: +param1,param2,param3,param4,param5,param6,param7,param8,param9=$4,$5,$6,$7,$8,$9,$10,$11,$12 +if $13 +param1,param2,param3,param4,param5,param6,param7,param8,param9={[u(-1,1),u(-1,1),u(-1,1),u(-1,1),u(-1,1),u(-1,1),u(-1,1),u(-1,1),u(-1,1)]} +fi +fx_rep_trsa ${1-3},$param1,$param2,$param3,$param4,$param5,$param6,$param7,$param8,$param9,0,${14-17},,0 +fill_decimal={${}} +fill_perc={round($fill_decimal*10000)/100} +if $18 to $fill_perc"%" fi +a={$1!=3?2} +b={$1>3?2} +c={$1==5?2} +u "{$1}""{$2}""{$3}""{"$param1"}""{"$param2"}""{"$param3"}_"$a"{"$param4"}_"$a"{"$param5"}_"$b"{"$param6"}_"$b"{"$param7"}_"$c"{"$param8"}_"$c"{"$param9"}_"$c"{0}""{$14}""{$15}""{$16}""{$17}""{$18}" +gui_rep_acb: rep_acb {$1/255},$2,$3,{$4/255},$5 +gui_rep_acb_preview: +gui_split_preview "gui_rep_acb $*",${-3--1} +gui_axis_streak: +if $1 rep_axis_streak $1,!$3,$4%,255 +else rep_axis_streak $1,$2,$4%,255 +fi +gui_axis_streak_preview: +gui_split_preview "gui_axis_streak ${1-4}",${-3--1} +u "{$1}""{$2}"_{$1?0:2}"{$3}"_{$1?2:0}"{$4}""{$5,$6}""{$7}" +rep_binary_quaddro_basic_gui: +if $1==0 rep_binaltquad ${2-12} % 256 +elif $1==1 +foreach { +rep_binaltquad ${2-9},${13-14},1 % 361 ++f 1 +[-1] +a c +hsv2rgb +} +elif $1==2 +foreach { ++rep_binaltquad ${2-9},{w*h-1},{w*h-1} +f.. I[i#1] +k.. +} +fi +rep_binary_quaddro_basic_gui_preview: +rep_binary_quaddro_basic_gui $* +a={$2!=2?2:0} +b={$1==0?2:0} +c={$1==1?2:0} +u "{$1}""{$2}""{$3}""{$4}""{$5}_"$a"{$6}_"$a"{$7}""{$8}""{$9}""{$10}_"$b"{$11}_"$b"{$12}_"$b"{$13}_"$c"{$14}_"$c +rep_binary_quaddro_mc_gui: +cs_mode=$1 +cmyk_mode={$cs_mode==3?4:3} +contain_alpha={$2?1:0} +tch={$cmyk_mode+$contain_alpha} +if $tch==3 rep_binary_alterating_quad_c $1,$2,$3,$4,$5,$6,${14-42} +elif $tch==4 rep_binary_alterating_quad_c $1,$2,$3,$7,$8,$9,$10,${15-51} +else rep_binary_alterating_quad_c $1,$2,$3,$11,$12,$13,$14,$15,${16-60} +fi +rep_binary_quaddro_mc_gui_preview: +cs_mode=$1 +cmyk_mode={$1==3?4:3} +contain_alpha={$2?1:0} +tch={$cmyk_mode+$contain_alpha} +rep_binary_quaddro_mc_gui $* +set_a={$tch==3?2:0} +set_b={$tch==4?2:0} +set_c={$tch==5?2:0} +set_d={$16!=2?2:0} +set_e={$24!=2?2:0} +set_f={$34!=2?2:0} +set_g={$tch>=4?2:0} +set_h={$tch>=4?($43!=2?2:0):0} +set_i={$tch>=5?($43!=2?2:0):0} +set_j={$tch>=5?2:0} +u "{$1}""{$2}""{$3}_"{(($cs_mode>8&&$cs_mode<11)||$cs_mode<=3)?0:2}"{$4}_"$set_a"{$5}_"$set_a"{$6}_"$set_a"{$7}_"$set_b"{$8}_"$set_b"{$9}_"$set_b"{$10}_"$set_b"{$11}_"$set_c"{$12}_"$set_c"{$13}_"$set_c"{$14}_"$set_c"{$15}_"$set_c"{$16}""{$17}""{$18}""{$19}_"$set_d"{$20}_"$set_d"{$21}""{$22}""{$23}""{$24}""{$25}""{$26}""{$27}""{$28}_"$set_e"{$29}_"$set_e"{$30}""{$31}""{$32}""{$33}""{$34}""{$35}""{$36}""{$37}_"$set_f"{$38}_"$set_f"{$39}""{$40}""{$41}""{$42}""{$43}_"$set_g"{$44}_"$set_g"{$45}_"$set_g"{$46}_"$set_h"{$47}_"$set_h"{$48}_"$set_g"{$49}_"$set_g"{$50}_"$set_g"{$51}_"$set_g"{$52}_"$set_j"{$53}_"$set_j"{$54}_"$set_j"{$55}_"$set_i"{$56}_"$set_i"{$57}_"$set_j"{$58}_"$set_j"{$59}_"$set_j"{$60}_"$set_j +fx_rep_bitplane_shuffle: +if $2?$23==1:$4==1 return fi +if narg($_persistent) +if $3 +if $2 *[^-1] 257 fi +$_persistent +map[^-1] [-1] +rm. +if $2 / 257 fi +else +foreach { +if !(s&1) sh 0,{s-2} fi +if $2 *. 257 fi +$_persistent +map[-2] [-1] +if $2 /[-2] 257 fi +k[0] +} +fi +else +args=$1,{!$3} +if $2 rep_bitplane_shuffle $args,${rep_permutation_index2list\ 16,{$23-1}} +else rep_bitplane_shuffle $args,${rep_permutation_index2list\ 8,{$4-1}} +fi +fi +fx_rep_bitplane_shuffle_preview: +direction,use_16_bits_depth,_use_alpha,index_8_bits,old_index_8_bits,index_16_bits,old_index_16_bits,depth_changed=${1-5},${23-24},{$2!=$59} +direction_change:=$direction!=$58 +plane_8bits_a,plane_8bits_b,plane_8bits_c,plane_8bits_d,plane_8bits_e,plane_8bits_f,plane_8bits_g,plane_8bits_h=${6-13} +plane_16bits_a,plane_16bits_b,plane_16bits_c,plane_16bits_d,plane_16bits_e,plane_16bits_f,plane_16bits_g,plane_16bits_h,plane_16bits_i,plane_16bits_j,plane_16bits_k,plane_16bits_l,plane_16bits_m,plane_16bits_n,plane_16bits_o,plane_16bits_p=${25-40} +activate_random_order={$use_16_bits_depth?$57:$22} +if $use_16_bits_depth +change_detected={$depth_changed||$activate_random_order||$direction_change} +if !narg($_persistent)&&$index_16_bits>1 +order:=[${25-40}]-1 +plane_16bits_a,plane_16bits_b,plane_16bits_c,plane_16bits_d,plane_16bits_e,plane_16bits_f,plane_16bits_g,plane_16bits_h,plane_16bits_i,plane_16bits_j,plane_16bits_k,plane_16bits_l,plane_16bits_m,plane_16bits_n,plane_16bits_o,plane_16bits_p:=[$order]+1 +if !$direction order=${rep_inverse_permutation\ $order} fi +order=[$order] +65536,1,1,1,sum((x>>[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]&1)<<$order) +store. _persistent +fi +user_array_changed:=[${25-40}]!=[${41-56}] +change_detected+=$user_array_changed +if $change_detected +if $user_array_changed +eval " +a=[${25-40}]; +b=[${41-56}]; +diff_pos=argmax(abs(a-b)); +swap_pos=find(b,a[diff_pos],0,1); +swap(b[diff_pos],b[swap_pos]); +b;" +plane_16bits_a,plane_16bits_b,plane_16bits_c,plane_16bits_d,plane_16bits_e,plane_16bits_f,plane_16bits_g,plane_16bits_h,plane_16bits_i,plane_16bits_j,plane_16bits_k,plane_16bits_l,plane_16bits_m,plane_16bits_n,plane_16bits_o,plane_16bits_p=${} +new_order:=[${}]-1 +index_16_bits:=${rep_permutation_list2index\ $new_order}+1 +if !$direction new_order=${rep_inverse_permutation\ $new_order} fi +new_order=[$new_order] +65536,1,1,1,sum((x>>[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]&1)<<$new_order) +store. _persistent +elif $depth_changed||$direction_change +order:=[${25-40}]-1 +if !$direction order=${rep_inverse_permutation\ $order} fi +order=[$order] +65536,1,1,1,sum((x>>[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]&1)<<$order) +store. _persistent +else +index_16_bits={int(u(0,20922789888000,1,0))} +new_order=${rep_permutation_index2list\ 16,$index_16_bits} +index_16_bits+=1 +plane_16bits_a,plane_16bits_b,plane_16bits_c,plane_16bits_d,plane_16bits_e,plane_16bits_f,plane_16bits_g,plane_16bits_h,plane_16bits_i,plane_16bits_j,plane_16bits_k,plane_16bits_l,plane_16bits_m,plane_16bits_n,plane_16bits_o,plane_16bits_p:=[$new_order]+1 +if !$direction new_order=${rep_inverse_permutation\ $new_order} fi +new_order=[$new_order] +65536,1,1,1,sum((x>>[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]&1)<<$new_order) +store. _persistent +fi +fi +if $index_16_bits>1 +gui_split_preview " +* 257 +if !$_use_alpha&&(!(s%2)) sh 0,{s-2} fi +$_persistent +map[-2] [-1] +k[0] +/ 257 +",${-3--1} +else +gui_split_preview "skip $*",${3--1} +fi +else +change_detected,index_change={v=$4!=$5;[v||$depth_changed||$activate_random_order||$direction_change,v];} +if !narg($_persistent)&&$index_8_bits>1 +order:=${rep_permutation_index2list\ 8,{$index_8_bits-1}} +plane_8bits_a,plane_8bits_b,plane_8bits_c,plane_8bits_d,plane_8bits_e,plane_8bits_f,plane_8bits_g,plane_8bits_h:=[$order]+1 +if !$direction order=${rep_inverse_permutation\ $order} fi +order=[$order] +256,1,1,1,sum((x>>[0,1,2,3,4,5,6,7]&1)<<$order) +store. _persistent +fi +user_array_changed:=[${6-13}]!=[${14-21}] +change_detected+=$user_array_changed +if $change_detected +if $user_array_changed +eval " +a=[${6-13}]; +b=[${14-21}]; +diff_pos=argmax(abs(a-b)); +swap_pos=find(b,a[diff_pos],0,1); +swap(b[diff_pos],b[swap_pos]); +b;" +plane_8bits_a,plane_8bits_b,plane_8bits_c,plane_8bits_d,plane_8bits_e,plane_8bits_f,plane_8bits_g,plane_8bits_h=${} +new_order:=[${}]-1 +index_8_bits:=${rep_permutation_list2index\ $new_order}+1 +if !$direction new_order=${rep_inverse_permutation\ $new_order} fi +new_order=[$new_order] +256,1,1,1,sum((x>>[0,1,2,3,4,5,6,7]&1)<<$new_order) +store. _persistent +elif $depth_changed||$direction_change +order:=[${6-13}]-1 +if !$direction order=${rep_inverse_permutation\ $order} fi +order=[$order] +256,1,1,1,sum((x>>[0,1,2,3,4,5,6,7]&1)<<$order) +store. _persistent +elif $index_change +new_order=${rep_permutation_index2list\ 8,{$index_8_bits-1}} +plane_8bits_a,plane_8bits_b,plane_8bits_c,plane_8bits_d,plane_8bits_e,plane_8bits_f,plane_8bits_g,plane_8bits_h:=[$new_order]+1 +if !$direction new_order=${rep_inverse_permutation\ $new_order} fi +new_order=[$new_order] +256,1,1,1,sum((x>>[0,1,2,3,4,5,6,7]&1)<<$new_order) +store. _persistent +else +index_8_bits={int(u(0,40320,1,0))} +new_order=${rep_permutation_index2list\ 8,$index_8_bits} +index_8_bits+=1 +plane_8bits_a,plane_8bits_b,plane_8bits_c,plane_8bits_d,plane_8bits_e,plane_8bits_f,plane_8bits_g,plane_8bits_h:=[$new_order]+1 +if !$direction new_order=${rep_inverse_permutation\ $new_order} fi +new_order=[$new_order] +256,1,1,1,sum((x>>[0,1,2,3,4,5,6,7]&1)<<$new_order) +store. _persistent +fi +fi +if $index_8_bits>1 +gui_split_preview " +round 0 +if !$_use_alpha&&(!(s%2)) sh 0,{s-2} fi +$_persistent +map[-2] [-1] +k[0] +",${-3--1} +else +gui_split_preview "skip $*",${3--1} +fi +fi +visible_8_bits,visible_16_bits={$use_16_bits_depth?[0,2]:[2,0]} +u "{"$direction"}""{"$use_16_bits_depth"}""{"$_use_alpha"}""{"$index_8_bits"}_"$visible_8_bits"{"$index_8_bits"}""{"$plane_8bits_a"}_"$visible_8_bits"{"$plane_8bits_b"}_"$visible_8_bits"{"$plane_8bits_c"}_"$visible_8_bits"{"$plane_8bits_d"}_"$visible_8_bits"{"$plane_8bits_e"}_"$visible_8_bits"{"$plane_8bits_f"}_"$visible_8_bits"{"$plane_8bits_g"}_"$visible_8_bits"{"$plane_8bits_h"}_"$visible_8_bits"{"$plane_8bits_a"}""{"$plane_8bits_b"}""{"$plane_8bits_c"}""{"$plane_8bits_d"}""{"$plane_8bits_e"}""{"$plane_8bits_f"}""{"$plane_8bits_g"}""{"$plane_8bits_h"}""{0}_"$visible_8_bits"{"$index_16_bits"}""{"$index_16_bits"}""{"$plane_16bits_a"}_"$visible_16_bits"{"$plane_16bits_b"}_"$visible_16_bits"{"$plane_16bits_c"}_"$visible_16_bits"{"$plane_16bits_d"}_"$visible_16_bits"{"$plane_16bits_e"}_"$visible_16_bits"{"$plane_16bits_f"}_"$visible_16_bits"{"$plane_16bits_g"}_"$visible_16_bits"{"$plane_16bits_h"}_"$visible_16_bits"{"$plane_16bits_i"}_"$visible_16_bits"{"$plane_16bits_j"}_"$visible_16_bits"{"$plane_16bits_k"}_"$visible_16_bits"{"$plane_16bits_l"}_"$visible_16_bits"{"$plane_16bits_m"}_"$visible_16_bits"{"$plane_16bits_n"}_"$visible_16_bits"{"$plane_16bits_o"}_"$visible_16_bits"{"$plane_16bits_p"}_"$visible_16_bits"{"$plane_16bits_a"}""{"$plane_16bits_b"}""{"$plane_16bits_c"}""{"$plane_16bits_d"}""{"$plane_16bits_e"}""{"$plane_16bits_f"}""{"$plane_16bits_g"}""{"$plane_16bits_h"}""{"$plane_16bits_i"}""{"$plane_16bits_j"}""{"$plane_16bits_k"}""{"$plane_16bits_l"}""{"$plane_16bits_m"}""{"$plane_16bits_n"}""{"$plane_16bits_o"}""{"$plane_16bits_p"}""{0}_"$visible_16_bits"{"$direction"}""{"$use_16_bits_depth"}""{$-3}""{$-2,$-1}" +fx_rep_blur_splinter: +rep_blur_splinter $1%,$2,$3,$4%,{$6%},{$5%},$7,$8 cut 0,255 +fx_rep_blur_splinter_preview: +gui_split_preview "fx_rep_blur_splinter ${1-8}",${-3--1} +gui_rep_shape_brick: +-m "MergeChoice : $""=_mode" -MergeChoice "add","alpha","and","average","blue","burn","darken","difference","divide","dodge","exclusion","freeze","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor","edges","error" +foreach { +to_a +rep_shape_brick $1,$2,$3,$4,$5,$9,$10,$6%,$7,$8,$26 +n. 0,1 +r. {w#-2},{h#-2},100%,{s#-2},0,2,0,0 +if $5 ($19,$15,$11^$20,$16,$12^$21,$17,$13^$22,$18,$14) +else ($19,$11^$20,$12^$21,$13^$22,$14) +fi +r. {($26+1)*100}%,100%,100%,100%,3 +f.. i(#-1,(w#-1-1)*i,0,z,c,3) rm. +if $23 blend ${_mode{$24+1}},{$25%} +else k. +fi +} +fx_rep_cstdmap: +srand $15 +if $10==4 $14,1,1,1,u(0,1) store. randorder fi +ww={w} +hh={h} +ld={w>h} +md={max(w,h)} +ti={$!-1} +rep_cstdmap {$9?-1*$8*100:$8*100}%,${1-7} ++f. i?1 store. chan +if $10==0 +if $11 +eq. 0 negate. -.. 1 *.. . n.. 0,255 *. 255 a[-2,-1] c +else n. 0,255 +fi +elif $10==1 -. 1 *. {359.999999/iM#-1} $chan . if $11 . *. 255 fi a[^0-$ti] c +if $12==0 sh. 2 *. .5 rm. hcy2rgb. +elif $12==1 hsi2rgb. +elif $12==2 hsv2rgb. +fi +elif $10==2 r. 100%,100%,1,3,1 pal {$13+1} f.. i0?i(#-1,(i-1)%w#-1,0) rm. if $11 $chan *. 255 a[-2,-1] c fi +elif $10==3 r. 100%,100%,1,3,1 $14,1,1,3,u(0,255) f.. i0?i(#-1,(i-1)%w#-1,0) rm. if $11 $chan *. 255 a[-2,-1] c fi +elif $10==4 +channels[0] 0,2 +colormap. $14,0,0 rm.. $randorder pixelsort.. +,x,[-1] rm. r.. 100%,100%,1,3 f.. i0?i(#-1,(i-1)%w#-1,0) rm. if $11 $chan *. 255 a[-2,-1] c fi +fi +if $8<1 +if $ld r. {$ww*($6?($4&&$5?2:1):1)},{max($hh,$md)*($6?($4&&$5?2:1):1)},100%,100%,0,2,.5,.5 +else r. {max($ww,$md)*($6?($4&&$5?2:1):1)},{$hh*($6?($4&&$5?2:1):1)},100%,100%,0,2,.5,.5 +fi +elif $8>1 +if !$9 r. {$md*($6?($4&&$5?2:1):1)},{$md*($6?1:($4&&$5?2:1))},100%,100%,6 +else r. {$ww*($6?($4&&$5?2:1):1)},{$hh*($6?1:($4&&$5?2:1))},100%,100%,6 +fi +fi +mv. 0 +if '$host'=='paintdotnet' k[0] fi +fx_rep_cstdmap_preview: +fx_rep_cstdmap $* +set_a={(($10==3)||($10==4))?2:0} +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}""{$9}""{$10}""{$11}""{$12}_"{$10==1?2:0}"{$13}_"{$10==2?2:0}"{$14}_"$set_a"{$15}_"$set_a +fx_rep_color_harmonies_preview: +_hsl_h,_hsl_s,_hsl_l,_rgb_0_r,_rgb_0_g,_rgb_0_b,_rgb_1_r,_rgb_1_g,_rgb_1_b,_rgb_2_r,_rgb_2_g,_rgb_2_b,_rgb_3_r,_rgb_3_g,_rgb_3_b,_rgb_4_r,_rgb_4_g,_rgb_4_b,_rgb_5_r,_rgb_5_g,_rgb_5_b,_rgb_0_r_alt,_rgb_0_g_alt,_rgb_0_b_alt,_rgb_1_r_alt,_rgb_1_g_alt,_rgb_1_b_alt,_rgb_2_r_alt,_rgb_2_g_alt,_rgb_2_b_alt,_rgb_3_r_alt,_rgb_3_g_alt,_rgb_3_b_alt,_rgb_4_r_alt,_rgb_4_g_alt,_rgb_4_b_alt,_rgb_5_r_alt,_rgb_5_g_alt,_rgb_5_b_alt,_hsl_0_h,_hsl_0_s,_hsl_0_l,_hsl_1_h,_hsl_1_s,_hsl_1_l,_hsl_2_h,_hsl_2_s,_hsl_2_l,_hsl_3_h,_hsl_3_s,_hsl_3_l,_hsl_4_h,_hsl_4_s,_hsl_4_l,_hsl_5_h,_hsl_5_s,_hsl_5_l,_point_x_0,_point_y_0,folder_name,basename,console_message,console_mode,old_preview_area_width,old_preview_area_height=${1-3},${6-23},${30-65},$24,$25,"$74","$75","$78",${79-81} +use_persistence={narg($_persistent)&&([$2,$4,$26,$27]==[$49,$66,$68,$69])&&([$_preview_area_width,$_preview_area_height]==[$old_preview_area_width,$old_preview_area_height])} +rm +if !$use_persistence $_preview_area_width,$_preview_area_height fi +command "draw_points : +eval[1] \"begin( +const radius=9; +const colsize=sqr(radius)*3; +blkcol=vector(#colsize,128); +circle_alpha_component=expr('begin( +const ww=w-1; +const hh=h-1; +const cx=ww/2; +const cy=hh/2; +); +xx=(x-cx)/cx; +yy=(y-cy)/cy; +inrange(norm(xx,yy),.4,1,1);' +,radius,radius,1,1); +); +m=(I/100)*[w#0,h#0]; +if(x, +draw(#0,blkcol,round(m[0])-6,round(m[1])-6,0,0,radius,radius,1,3,1,circle_alpha_component,1); +); +\" +" +command "gen_pt_info : +width,height={w#0},{h#0} +local[-2] { +lightness={i(#-1,0,0,0,2)} +{w},{h},{d},2,\"begin( +const scale=$27%; +const lightness=($lightness+100)/200; +const width=$width; +const height=$height; +const ww=width-1; +const hh=height-1; +const cx=ww/2; +const cy=hh/2; +const ref_dim=min(cx,cy); +const max_length=ref_dim*scale; +const min_length=max_length*$26/100; +const length=lerp(min_length,max_length,lightness); +); +rad_ang=((360-i(#-1,x,0,0,0))-90)°; +center=[cx,cy]; +off=[cos(rad_ang)*length,sin(rad_ang)*length]; +point=center+off; +point[0]/=ww; +point[1]/=hh; +point*=100;\" +_point_x_0,_point_y_0={I(#-1,0)} +rv +} +draw_points " +command "gen_col_info : +if w==2 +_hsl_0_h,_hsl_1_h,_hsl_0_s,_hsl_1_s,_hsl_0_l,_hsl_1_l={crop(#-2)} +_rgb_0_r,_rgb_1_r,_rgb_0_g,_rgb_1_g,_rgb_0_b,_rgb_1_b={crop(#-1)} +_rgb_0_r_alt,_rgb_1_r_alt,_rgb_0_g_alt,_rgb_1_g_alt,_rgb_0_b_alt,_rgb_1_b_alt={crop(#-1)} +elif w==3 +_hsl_0_h,_hsl_1_h,_h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t,_rgb_0_g_alt,_rgb_1_g_alt,_rgb_2_g_alt,_rgb_3_g_alt,_rgb_4_g_alt,_rgb_0_b_alt,_rgb_1_b_alt,_rgb_2_b_alt,_rgb_3_b_alt,_rgb_4_b_alt={crop(#-1)} +elif w==6 +_hsl_0_h,_hsl_1_h,_hsl_2_h,_hsl_3_h,_hsl_4_h,_hsl_5_h,_hsl_0_s,_hsl_1_s,_hsl_2_s,_hsl_3_s,_hsl_4_s,_hsl_5_s,_hsl_0_l,_hsl_1_l,_hsl_2_l,_hsl_3_l,_hsl_4_l,_hsl_5_l={crop(#-2)} +_rgb_0_r,_rgb_1_r,_rgb_2_r,_rgb_3_r,_rgb_4_r,_rgb_5_r,_rgb_0_g,_rgb_1_g,_rgb_2_g,_rgb_3_g,_rgb_4_g,_rgb_5_g,_rgb_0_b,_rgb_1_b,_rgb_2_b,_rgb_3_b,_rgb_4_b,_rgb_5_b={crop(#-1)} +_rgb_0_r_alt,_rgb_1_r_alt,_rgb_2_r_alt,_rgb_3_r_alt,_rgb_4_r_alt,_rgb_5_r_alt,_rgb_0_g_alt,_rgb_1_g_alt,_rgb_2_g_alt,_rgb_3_g_alt,_rgb_4_g_alt,_rgb_5_g_alt,_rgb_0_b_alt,_rgb_1_b_alt,_rgb_2_b_alt,_rgb_3_b_alt,_rgb_4_b_alt,_rgb_5_b_alt={crop(#-1)} +fi" +console_mode=1 +if ([${1-3}]!=[${48-50}])||($4!=$66)||($5!=$67) +if $use_persistence $_persistent +else +rep_create_hsl_color_select $2%,{$26/100},$4,{$27/100} ++store. _persistent +fi ++rep_color_harmony_palette $1,{$2/100},{$3/100},$5,{$4+2} +sh.. 2 *. 200 -. 100 sh... 1 *. 100 rm[-2,-1] +gen_col_info gen_pt_info +elif [${6-23}]!=[${30-47}] +eval " +vec_a=[${6-23}]; +vec_b=[${30-47}]; +repeat(arg(1+$5,6,6,6,2,3,3,4,3,4,5,6),p, +a=(vec_a)[3*p,3]; +b=(vec_b)[3*p,3]; +a!=b?( +v=p; +set('col_a',v2s(a)); +set('col_b',v2s(b)); +break(); +); +); +v;" +1,1,1,3,([${6-23}])[3*${},3] +1,1,1,3,([${30-47}])[3*${},3] +if $4 +rgb2ryb[-2,-1] +rgb2hsl[-2,-1] +else +rgb2hsl[-2,-1] +fi +hsl_base={" +fmod(a)=a-360*floor(a/360); +rescale_lightness(a)=(a+100)/200; +new_col=crop(#-2); +old_col=crop(#-1); +diff=new_col-old_col; +out_hsl=[${1-3}]; +out_hsl[1]/=100; +out_hsl[2]=rescale_lightness(out_hsl[2]); +out_hsl+=diff; +out_hsl[2]=cut(out_hsl[2]*2-1,-1,1); +out_hsl[1]=cut(out_hsl[1],0,1); +out_hsl; +"} +if $use_persistence $_persistent +else +rep_create_hsl_color_select $2%,{$26/100},$4,{$27/100} ++store. _persistent +fi ++rep_color_harmony_palette $hsl_base,$5,{$4+2} +sh.. 2 *. 200 -. 100 sh... 1 *. 100 rm[-2,-1] +_hsl_h,_hsl_s,_hsl_l={I(#-2,0)} +gen_col_info gen_pt_info +elif [${24-25}]!=[${28-29}] +if $use_persistence $_persistent +else +rep_create_hsl_color_select $2%,{$26/100},$4,{$27/100} ++store. _persistent +fi +hsl_base={" +const scale=$27%; +const mx=w-1; +const my=h-1; +const cx=mx/2; +const cy=my/2; +const ref_dim=min(cx,cy); +const max_length=ref_dim*scale; +const min_length=max_length*$26/100; +const length=max_length-min_length; +const pos_x=mx*$24%; +const pos_y=my*$25%; +const dx=pos_x-cx; +const dy=pos_y-cy; +const hue=(atan2(dx,dy)+pi)/((pi*2)/360); +const dist=2*((cut(sqrt(dx^2+dy^2),min_length,max_length)-min_length)/length)-1; +[hue,$2/100,dist]; +"} ++rep_color_harmony_palette $hsl_base,$5,{$4+2} +sh.. 2 *. 200 -. 100 sh... 1 *. 100 rm[-2,-1] +_hsl_h,_hsl_s,_hsl_l={I(#-2,0)} +gen_col_info gen_pt_info +else +if $use_persistence $_persistent +else +rep_create_hsl_color_select $2%,{$26/100},$4,{$27/100} ++store. _persistent +fi ++rep_color_harmony_palette $1,{$2/100},{$3/100},$5,{$4+2} +sh.. 2 *. 200 -. 100 rm. +gen_pt_info +console_mode=0 +fi +num_of_col={w+1} +uncommand draw_points,gen_pt_info,gen_pt_info_alt,gen_col_info +k[0,-1] +if $77 +format_choice=${arg\ $76+1,gpl,pdn_pal,jasc} +=> "Generated by G'MIC Color Harmonies" +rep_output_$format_choice. $folder_name/$basename +console_mode=2 +fi +if $console_mode==2 +console_message="File has been exported!" +elif $console_mode==1 +console_message="Changed Input!" +elif $console_mode==0 +console_message="Standby Mode" +else +console_message="Initialized" +fi +u "{"$_hsl_h"}""{"$_hsl_s"}""{"$_hsl_l"}""{$4}""{$5}""{"$_rgb_0_r","$_rgb_0_g","$_rgb_0_b"}""{"$_rgb_1_r","$_rgb_1_g","$_rgb_1_b"}""{"$_rgb_2_r","$_rgb_2_g","$_rgb_2_b"}_"{3<$num_of_col?2}"{"$_rgb_3_r","$_rgb_3_g","$_rgb_3_b"}_"{4<$num_of_col?2}"{"$_rgb_4_r","$_rgb_4_g","$_rgb_4_b"}_"{5<$num_of_col?2}"{"$_rgb_5_r","$_rgb_5_g","$_rgb_5_b"}_"{6<$num_of_col?2}"{"$_point_x_0","$_point_y_0"}""{$26}""{$27}""{"$_point_x_0","$_point_y_0"}""{"$_rgb_0_r_alt","$_rgb_0_g_alt","$_rgb_0_b_alt"}""{"$_rgb_1_r_alt","$_rgb_1_g_alt","$_rgb_1_b_alt"}""{"$_rgb_2_r_alt","$_rgb_2_g_alt","$_rgb_2_b_alt"}""{"$_rgb_3_r_alt","$_rgb_3_g_alt","$_rgb_3_b_alt"}""{"$_rgb_4_r_alt","$_rgb_4_g_alt","$_rgb_4_b_alt"}""{"$_rgb_5_r_alt","$_rgb_5_g_alt","$_rgb_5_b_alt"}""{"$_hsl_0_h"}""{"$_hsl_0_s"}""{"$_hsl_0_l"}""{"$_hsl_1_h"}""{"$_hsl_1_s"}""{"$_hsl_1_l"}""{"$_hsl_2_h"}""{"$_hsl_2_s"}""{"$_hsl_2_l"}""{"$_hsl_3_h"}""{"$_hsl_3_s"}""{"$_hsl_3_l"}""{"$_hsl_4_h"}""{"$_hsl_4_s"}""{"$_hsl_4_l"}""{"$_hsl_5_h"}""{"$_hsl_5_s"}""{"$_hsl_5_l"}""{$4}""{$5}""{$26}""{$27}""{$70}""{$71}""{$72}""{$73}""{$74}""{$75}""{$76}""{0}""{"$console_message"}""{"$console_mode"}""{"$_preview_area_width"}""{"$_preview_area_height"}" +rep_create_hsl_color_select: +skip ${2=.25},${3=0},${4=.9} +ow,oh={w#0},{h#0} +rm +$ow,$oh,1,3,"*begin( +const ww=w-1; +const hh=h-1; +const cx=ww/2; +const cy=hh/2; +const sd=max(w,h)/min(w,h); +const scaling=1/$4; +const sx=(w>h?sd:1)*scaling; +const sy=(w>h?1:sd)*scaling; +const cxsx=cx/sx; +const cysy=cy/sy; +const pt=$2; +const ipt=1/(1-pt); +const res_atan_end=(2*pi)/360; +const saturation=$1; +rescale_radial(a)=(a-pt)*ipt; +rescale_atan2(a)=(a+pi)/res_atan_end; +hsl2rgb(hue,saturation,lightness)=( +H=(hue/60)%6; +C=(1-abs(2*lightness-1))*saturation; +X=C*(1-abs(H%2-1)); +m=lightness-C/2; +RGB=arg(1 + int(H),[C,X,0],[X,C,0],[0,C,X],[0,X,C],[X,0,C],[C,0,X]); +(RGB+=m)*=255; +); +hsl2ryb2rgb(hue,saturation,lightness)=( +H=(hue/60)%6; +C=(1-abs(2*lightness-1))*saturation; +X=C*(1-abs(H%2-1)); +m=lightness-C/2; +RYB=arg(1+int(H),[C,X,0],[X,C,0],[0,C,X],[0,X,C],[X,0,C],[C,0,X]); +RYB+=m*=255; +red=RYB[0]; +yellow=RYB[1]; +blue=RYB[2]; +white=min(RYB); +red-=white; +yellow-=white; +blue-=white; +maxyellow=max(red,yellow,blue); +green=min(yellow,blue); +yellow-=green; +blue-=green; +blue>0&&green>0?( +blue*=2; +green*=2 +); +red+=yellow; +green+=yellow; +maxgreen = max(red,green,blue); +maxgreen>0?( +N=maxyellow/maxgreen; +red*=N; +green*=N; +blue*=N; +); +red+=white; +green+=white; +blue+=white; +[red,green,blue]; +); +if($3 +,calc(hue,saturation,lightness)=hsl2ryb2rgb(hue,saturation,lightness); +,calc(hue,saturation,lightness)=hsl2rgb(hue,saturation,lightness); +); +ev_light=vector(#3,255); +ev_dark=vector(#3,0); +); +xx=(x-cx)/cxsx; +yy=(y-cy)/cysy; +radial_gradient=rescale_radial(norm(xx,yy)); +inrange(radial_gradient,0,1,1,1)?( +conical_gradient=rescale_atan2(atan2(xx,yy)); +calc(conical_gradient,saturation,radial_gradient); +):( +radial_gradient>.5?ev_light:ev_dark; +); +" +gui_rep_colmt: +cs=$1 +alp=$2 +tc={$cs!=3?3+$alp:4} +pos={$tc==4?$3:$4} +argset=${1-2},$pos,$6,${49-50} +if $5 rep_color_modulo_texture $argset,${17-48} +else rep_color_modulo_texture $argset,${7-14} +fi +gui_rep_colmt_preview: +gui_rep_colmt $* +cs=$1 +alp={$2?1} +tc={$cs!=3?3+$alp:4} +set_a={!$5?2:0} +set_b={$5?($tc==4?($15==0?2:0):($16==0?2:0)):0} +set_c={$5?($tc==4?($15==1?2:0):($16==1?2:0)):0} +set_d={$5?($tc==4?($15==2?2:0):($16==2?2:0)):0} +set_e={$5?($tc==4?($15==3?2:0):0):0} +u "{$1}""{$2}_"{$1==3?0:2}"{$3}_"{$tc==4?2:0}"{$4}_"{$tc==3?2:0}"{$5}""{$6}""{$7}_"$set_a"{$8}_"$set_a"{$9}_"$set_a"{$10}_"$set_a"{$11}_"$set_a"{$12}_"$set_a"{$13}_"$set_a"{$14}_"$set_a"{$15}_"{$5&&$tc==4?2:0}"{$16}_"{$5&&$tc==3?2:0}"{$17}_"$set_b"{$18}_"$set_b"{$19}_"$set_b"{$20}_"$set_b"{$21}_"$set_b"{$22}_"$set_b"{$23}_"$set_b"{$24}_"$set_b"{$25}_"$set_c"{$26}_"$set_c"{$27}_"$set_c"{$28}_"$set_c"{$29}_"$set_c"{$30}_"$set_c"{$31}_"$set_c"{$32}_"$set_c"{$33}_"$set_d"{$34}_"$set_d"{$35}_"$set_d"{$36}_"$set_d"{$37}_"$set_d"{$38}_"$set_d"{$39}_"$set_d"{$40}_"$set_d"{$41}_"$set_e"{$42}_"$set_e"{$43}_"$set_e"{$44}_"$set_e"{$45}_"$set_e"{$46}_"$set_e"{$47}_"$set_e"{$48}_"$set_e"{$49}""{$50}" +fx_rep_color_region: +if narg($_persistent) +remove $_persistent +else +rep_color_region $1%,$2%,$3 +fi +fx_rep_color_region_preview: +imgs={$!} +if [${1-3}]!=[${4-6}]||!narg($_persistent) ++rep_color_region $1%,$2%,$3 +store[-$imgs--1] _persistent +fi +gui_split_preview "remove $_persistent keep[0]",${-3--1} +u "{$1}""{$2}""{$3}"{!$1?2}"{$1}""{$2}""{$3}""{$7}""{$8,$9}" +#@cli :: Reptorian's Base64 Image Codes +#@cli rep_tileset_n: eq. to 'rep_tileset_nonisometric' : (+) +rep_tileset_n: rep_tileset_nonisometric $* +#@cli rep_tileset_nonisometric : 0<=_tileset_id<=6 +#@cli : Inserts pre-made nonisometric tileset.\n +#@cli : Note: Some tileset has been optimized.\n +#@cli : - The following list contains available arguments. Anything after the dashes is not part of it and are used to credit the main tileset author, and equal sign implies the two arguments generates the same result. -\n +#@cli : 0 = lpc_interior -- (Edited)[LPC] House Interior and Decorations by Lanea Zimmerman/Sharm,Tuomo Untinen authored by Reemax +#@cli : 1 = generic_platform -- (Edited)Generic Platformer by surt authored by tebruno99 +#@cli : 2 = metroid_like -- Metroid Like by chipmunk +#@cli : 3 = omegateam -- Omega Team by surt +#@cli : 4 = classic -- Classic RPG by jestan +#@cli : 5 = dungeon -- Dungeon by stealthix +#@cli : 6 = happyland -- Happyland by Buch +#@cli : Default values: "_tileset_id=?"\n +#@cli : Author: Reptorian. +rep_tileset_nonisometric: +v - _gmic_s="$?" v + +_$0 $"*" +_rep_tileset_nonisometric: +skip ${1=} +tileset="$1" +if isnum("$1")&&{isint("$1")}||!narg($1) +if narg($1) choice=$1 else choice={round(u(0,6))} fi +tileset=${arg\ 1+$choice,lpc_interior,generic_platform,metroid_like,omegateam,classic,dungeon,happyland} +fi +v 0 e[^-1] "Create '"$tileset"' tileset." +_rep_tileset_nonisometric_$tileset +_rep_tileset_nonisometric_lpc_interior: base642img MiB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjU2IDI1NiAxIDQgIzMyNjgzCnic1L0JeBRVvvBduI2OBmM6hADZNOkgi21ijAgTEEKI0pjQbAKDUQkORFokE9lCQuw3YzDIEnSUJGJEHJaIggQEBGVNIGFxRnFGGXGHJOgsd7773TvfPPe+z5PvLLWcc+pUndPpSpj8A91VdXqp3387W9XpmprQRMFSVKQY0tAKpAFv3wNlFRTwuBk9Ug8NjHgZKVZlwYIF1MYCVRSBjBVIzblzB6zk3LlzNXblUBB8TkNRUYOBX5QDRD2gk4LHzTQ6UgfSFSHFtHgXaNALKE0skOavshXAb0cH+W3xEX+OUtTaajhAUU4RkBx8oGhVkc5vUK/avHnVPZsxfxMlAUoAvy4Ev74vwx8Af/AhUBXQt6u0Z2h/K8Jzqv1tNYC+JCenqSlH/0pPDjBqQ4OHsD+2PNbFZk0J6KCIv1hl1fkZdUjwBzB8QN8iHuztf07O/hA5x2N8pwf6v7rPeD7OAsHwGwFvBALhDbL8pFQZD8j+Ng5QY1du8CNpwHmvgfp+HXfVPfdouXCzxr9Zkp+K+GLCGYqLRfltLMPOaGJsiOm/xiBtbQBJD6S+hlaKfzPm30zYf/M9hifI8BPwZn5Bfhtrhx8IYPufq5k1q4CUWbNmqQX8ckMM6+O0BxNfA8W/SudX41/zf6QJifinKwAmG4rym5j/APirYfEgPyqwKOfwA3xYgQMFmPlXEfYn+FeJ+Y3qnpf/ixeI8puQ/wDmMylALbAqN/FDuyPRaj5L/lUGv1z9R+FrO6oWRPlNgv+AiW8W9H+U3mq45Vz+IuQA6InKfyz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iMxILCipzEvNS9Ary0hkAJ50OzQ== +#@cli unpurple : intensity, min_brightnes, min_red_to_blue, max_red_to_blue, blur_std_deviation, gentle_mode +#@cli : Unpurple removes purple fringing +#@cli : Based on https://github.com/mjambon/purple-fringe by Martin Jambon. +#@cli : This implementation works with RGB and RGBA images in any bit depth. +#@cli : Note: the minimum brightness and intensity are relative to the maximum blue value. +#@cli : Ported to G'MIC by Stanislav Paskalev +#@cli : $ image.jpg +unpurple +#@cli : +fx_rep_compb: +ox={(($9-50)/100)*2} +oy={(($10-50)/100)*-2} +setarg=${1-2},"[${3-4}]","[${5-6}]",${7-8},$ox,$oy +midpoint_shift={1-abs($24)} +if $13 +if $12 setarg2=${20-22} +else setarg2=$20,$22 +fi +else +if $12 setarg2=${14-19} +else setarg2=$14,$16,$17,$19 +fi +fi +local[0] { +rep_complexion_burst $setarg,$11,$12,$setarg2 +val_max={iM} +if ($23%)<1 cut 0,{iM*$23%} fi +n 0,1 +if $24>=0 f i^$midpoint_shift +else f 1-((1-i)^$midpoint_shift) +fi +if $26 n 0,255 +else * {$25*$val_max} +fi +} +fx_rep_compb_preview: +fx_rep_compb ${1-26} +if $27 ++f[0] i>0?1 +fillperc={ia*100} rm. +fillperc_l={int($fillperc)} +fillperc_r={int(($fillperc-$fillperc_l)*100)} +fillratio=$fillperc_l +fillratio.=. +fillratio.=$fillperc_r +fillratio.=% +to[0] $fillratio,.5~,.5~,18% +fi +k[0] +a={!$13?2:0} +b={$13?2:0} +c={!$13?($12?2:0):0} +d={$13?($12?2:0):0} +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}""{$9,$10}""{$11}""{$12}""{$13}""{$14}_"$a"{$15}_"$c"{$16}_"$a"{$17}_"$a"{$18}_"$c"{$19}_"$a"{$20}_"$b"{$21}_"$d"{$22}_"$b"{$23}""{$24}""{$25}_"{$26?1:2}"{$26}""{$27}" +_cons_turb : +foreach { cons_turb $* } +cons_turb : +-m "MergeChoice : $""=_mode" -MergeChoice "add","alpha","and","average","blue","burn","darken","difference","divide","dodge","exclusion","freeze","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor","edges","error" +fill_color 0,0,0 +turbulence ${1-3},0,$4 +balance_gamma ${5-7} +remove_opacity +if $10<=4 ac "_fx_noise $8,$9",{$10+2},$11 +else ac "_fx_noise $8,$9",{$10+3},$11 +fi +remove_opacity ++jr_desaturate ${12-16} +blend normal,$17/100 ++cons_self_blend $18,$19 +blend ${_mode{$20+1}},$21/100 +if $22==1 cut $23,$24 +elif $22==2 n $23,$24 +fi +if $25 ac "equalize",rgb fi +if $26 negate fi +fx_make_seamless 256 +fx_warp_by_intensity ${27-34} +if $36 +if !$37 +blur $35 +fx_butterworth_bp ${38-44},0,${45-46} +if $45==1 ++rep_emboss_relief ${48-51},0,$52 +fi +else ++fx_butterworth_bp ${38-44},0,${45-46} +blur[0] $35 +if $47==1 +rep_emboss_relief[1] ${48-51},0,$52 +fi +fi +else +blur $35 +if $47 ++rep_emboss_relief ${48-51},0,$52 +fi +fi +if $47 if $53 blend grainmerge,{$54/100} else blend grainextract,{$54/100} fi fi +cons_self_blend : +-m "MergeChoice : $""=_mode" -MergeChoice "add","burn","dodge","exclusion","freeze","grainextract","grainmerge","hardlight","hardmix","interpolation","linearburn","linearlight","luminance","multiply","negation","overlay","pinlight","reflect","screen","shapeaverage","softburn","softdodge","softlight","stamp","vividlight","edges","error" +[0] +blend ${_mode{$1+1}},$2/100 +_cons_turb_preview : +gui_split_preview "_cons_turb $*",${-3--1} +fx_rep_detailed_info_preview: +skip "$*" +if narg($_persistent)&&($2==$3) +$_persistent +str_inform={t} +rm. +else +s="Host: "$_host\n"Operating System: "$_os\n"Flags: "$_flags\n"Process ID: "$_pid +foreach { +w,h={[w,h]} +s.=\n\n"- Image \#"{$>+1}" -" +s.=\n"Dimensions: "$w{`120`}$h +a,b,true_ratio=${rep_nearest_ratio\ $w,$h,$2,1} +if $true_ratio +s.=\n"Aspect Ratio: "$a{`58`}$b +else +s.=\n"Aspect Ratio (Approximated): "$a{`58`}$b +s.=\n"Error Margin for approximated ratio: "{abs(w/h-$a/$b)} +fi +s.=\n"Minimum Value: "{im} +s.=\n"Maximum Value: "{iM} +s.=\n"Average Value: "{ia} +s.=\n"Variance Value: "{iv} +s.=\n"Summation Value: "{is} +s.=\n"Product Value: "{ip} +s.=\n"Median Value: "{ic} +s.=\n"L2-Norm Vlaue: "{in} +} +('$s') +str_inform={t} +store. _persistent +fi +u "{"$str_inform"}""{$2}""{$2}" +fx_rep_dla: +skip $* +rm $_persistent +fx_rep_dla_preview: +status_changed={[${1-8}]!=[${10-17}]} +if narg($_persistent)?(!$9&&!$status_changed) +crop $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1 +gui_split_preview "rm $_persistent k[0] crop $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1",${-3--1} +else ++store original_images +if $8 foreach { +if s==2||s==4 +shared 0,{s-2} +negate. +rm. +fi +} +fi +rep_diffusion_limited_aggregation ${1-2},{$5%},${3-4},${6-7} +* 255 +store _persistent +$original_images +crop $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1 +gui_split_preview "rm $_persistent k[0] crop $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1",${-3--1} +fi +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}""{0}""{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}""{$18}""{$19,$20}" +fx_rep_dungeon_floor: +ww={w} +hh={h} +sub={abs($3)+1} +f. 0 channels. 0 +r. {$sub*w},{$sub*h},100%,100%,-1 +{w},{h},1,1,"begin( +const cx=(w-1)/2; +const cy=(h-1)/2; +const scaleP=$1?1:.5; +const wx=.043333; +const wy=.053333; +const a=.7; +const TWO_PI=pi*2; +const off_x=cx*($1==0?((1-$2%2)?1)); +const off_y=cy*($1==0?($2>1?1)); +); +xx=scaleP*x/w; +yy=scaleP*y/h; +for(n=0,n<10,++n, +newx=xx+wx-a/(TWO_PI*sin(TWO_PI*yy)); +newy=yy+wy-a/(TWO_PI*sin(TWO_PI*xx)); +xx=(newx+off_x)%w; +yy=(newy+off_y)%h; +i(#0,xx,yy)++; +);" +rm.. +if $3!=0 r. $ww,$hh,100%,100%,2 fi +n. 0,255 +fx_rep_dungeon_floor_preview: +fx_rep_dungeon_floor $* +u "{$1}""{$2}_"{!$1?2:1}"{$3}" +rep_dynamic_contrast_preview: gui_split_preview "rep_dynamic_contrast ${1-3}",${-3--1} +fx_rep_edgefade: +if $3 +rep_edgefade $2%,${4-5},$6%,$7% +else +diag={round((norm(w,h)/2)*($1/100))} +rep_edgefade $diag,${4-5},$6%,$7% +fi +fx_rep_edgefade_preview: +gui_split_preview "fx_rep_edgefade ${1-7}",${-3--1} +u "{$1}_"{!$3?2}"{$2}_"{$3?2}"{$3}""{$4}""{$5}""{$6}_"{$5?2:1}"{$7}_"{$5?2:1}"{$8}""{$9,$10}" +fx_rep_ekb: +to_rgba +convert_colors_fwd=${arg\ $18+1,error,rgb2ryb,rgb2cmy,rgb2cmyk,rgb2hcy,rgb2hsi,rgb2hsl,rgb2hsv,rgb2lab,rgb2lch,rgb2ycbcr,rgb2ycbcrglic,rgb2yiq,rgb2yuv,rgb2xyz,rgb2yes} +square_size={round(min(w,h)/2*$1%)} +if $4 +border_size=$3 +else +border_size=$2% +fi +main_arg=$square_size,$border_size,$15%,$5% +if !$10 ufc=${rep_int82hex\ ${7-9}} fi +second_set_arg=$6,$18 +if !$14 +if $18&&$15 +1,1,1,3,[${11-13}] +$convert_colors_fwd. +second_set_arg.=,{crop(#-1)} +rm. +else +second_set_arg.=,${11-13} +fi +fi +if $16 +mimg={$!-1} +if $18<4||$18==11 vcol=[u(255),u(255),u(255)] +elif $18<8 vcol=[u(359.999),u(1),u(1)] +elif $18==8 vcol=[u(0,100),u(-128,182),u(-155,155)] +elif $18==9 vcol=[u(0,100),u(240),u(-pi,pi)] +elif $18==10 vcol=[u(16.5,236),u(16.9375,240.0625),u(16.9375,240.0625)] +elif $18==12 vcol=[u(255),u(-151.90757751464844,151.90757751464844),u(-133.26069641113281,133.26069641113281)] +elif $18==13 vcol=[u(1),u(-.436,.436),u(-.615,.615)] +elif $18==14 vcol=[u(1),u(1),u(1)] +elif $18==15 vcol=[u(255),u(-127.5,127.5),u(-127.5,127.5)] +fi +$17,1,1,{$18==3?4:3},begin(srand($21));$vcol +srand $20 +rep_ellsworth_kelly_board[0-$mimg] $main_arg,[-1],$ufc,$second_set_arg +rm. +else +ppc=${arg\ $19+1,3,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,179,180,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,292,329,330,331,332,333,334,335,336,337,338,339,346,347,348,349,350,351,352,353,354,355,356,357,358,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378} +srand $20 +rep_ellsworth_kelly_board $main_arg,$ppc,$ufc,$second_set_arg +fi +fx_rep_ekb_preview: +fx_rep_ekb $* +a={$16?2:0} +u "{$1}""{$2}"_{!$4?2:0}"{$3}"_{$4?2:0}"{$4}""{$5}""{$6}""{$7,$8,$9}"_{!$10?2:1}"{$10}""{$11,$12,$13}"_{$6?0:!$14?2:1}"{$14}"_{$6?0:2}"{$15}"_{(($4?$3:$2)!=0)?2:1}"{$16}""{$17}"_$a"{$18}"_$a"{$19}"_{!$16?2:0}"{$20}""{$21}"_{$16?2:0} +fx_emboss_relief: +if !$7 remove_opacity fi +rep_emboss_relief ${1-6} +fx_emboss_relief_preview: gui_split_preview "fx_emboss_relief ${1-7}",${-3--1} +fx_rep_fibonacci: +if $1 +if $11 +pal {$11-1} +rep_fibonacci_fill[^-1] ${3-5},0,$10,{($6-50)/100*2},{($7-50)/100*2},$12%,$16,[-1],$13 +rm. +else +rep_fibonacci_fill ${3-5},0,$10,{($6-50)/100*2},{($7-50)/100*2},$12%,$16 +n 0,255 +fi +else +if $11 +pal {$11-1} +rep_fibonacci_fill[^-1] ${3-5},$2,$10,$8,$9,$12%,$16,[-1],$14,$15 +rm. +else +rep_fibonacci_fill ${3-5},$2,$10,$8,$9,$12%,$16 +n 0,255 +fi +fi +u "{$1}""{$2}_"{$1?0:2}"{$3}""{$4}""{$5}""{$6,$7}_"{$1?($4?2:0):0}"{$8}_"{$1?0:2}"{$9}_"{$1?0:2}"{$10}""{$11}""{$12}""{$13}_"{$1?($11?2:1):0}"{$14}_"{$1?0:($11?2:1)}"{$15}_"{$1?0:($11?2:1)}"{$16}" +gui_rep_frblur: rep_frblur $2,$3%,$4,$5,$6,$7,$1 +gui_rep_frblur_preview: gui_split_preview "gui_rep_frblur $*",${-3--1} +fx_rep_blur_cs: +tcr=3 +convert_colors_fwd=${arg\ 1+$5,none,rgb2srgb,rgb2ryb,rgb2cmy,cs_error,rgb2hcy,rgb2hsi,rgb2hsl,rgb2hsv,rgb2lab,rgb2lch} +convert_colors_bwd=${arg\ 1+$5,none,srgb2rgb,ryb2rgb,cmy2rgb,cs_error,hcy2rgb,hsi2rgb,hsl2rgb,hsv2rgb,lab2rgb,lch2rgb} +foreach { +if $5 +if $5!=4 +$convert_colors_fwd. +else +if s==3 rgb2cmyk tcr+=1 +elif s==4 s c,-3 rgb2cmyk.. a c +fi +fi +fi +_fx_gaussian_blur $1,$2,$3,$4 +if $5 +if $5!=4&&$5 +$convert_colors_bwd. +else +if s==4 cmyk2rgb tcr-=1 +elif s==5 s c,-4 cmyk2rgb.. a c +fi +fi +fi +} +fx_rep_blur_cs_preview: +gui_split_preview "fx_rep_blur_cs ${1-5}",${-3--1} +gui_rep_gv: rep_gv $1%,$2%,$3%,$4%,{$5-50}%,{$6-50}%,$7%,$8,$9%,$10%,$11%,$12,{$13+50}%,{$14+50}%,$18,${15-17} +gui_rep_gv_preview: gui_split_preview "gui_rep_gv ${1-18}",${-3--1} +fx_rep_graduated_filter: rep_graduated_filter $1%,$2%,$3%,$4,,${5-7} +fx_rep_graduated_filter_preview: gui_split_preview "fx_rep_graduated_filter ${1-7}",${-3--1} +fx_rep_x_graphical_tiling: +if !$6 rv fi +if $5 autocrop[^0] +else autocrop_components[^0] 0%,0%,1,1 +fi +if $7 +rep_x_graphical_tiling[0] [1--1],$1,${2-4} k[0,-1] if $7==2 blend alpha fi +else rep_x_graphical_tiling[0] [1--1] k[0] +fi +fx_rep_x_graphical_tiling_preview: +if !$6 rv fi +if $5 autocrop[1] +else autocrop_components[1] 0%,0%,1,1 +fi +k[0,1] +r. {w#0},{h#0},1,{s#0},0,0,.5,.5 +r. 100%,100%,$11,100%,0,1 +f. "begin( +const offx=(100-$9-50)%; +const offy=(100-$10-50)%; +); +j(offx*w*(z/(d-1)),offy*h*(z/(d-1)));" +if $8 k. fi +s. z +if $8!=1 blend alpha +else blend alpha drgba ${2-4} +fi +if $12 +if s==2||s==4 sh. 0,{s-2} fi +text="Interactive Filter" to. $text,.5~,.5~,10% +rm. +fi +fx_rep_sptbwgp: +rep_sptbwgp {$1%},$4,{vec_arg=[${2-3}]/100} +fx_rep_sptbwgp_preview: +gui_split_preview "fx_rep_sptbwgp ${1-4}",${-3--1} +fx_rep_sptbwgp_full: +if !$12 return fi +if narg($_persistent) +imgs={$!} +src_image={$imgs+1} +$_persistent +if $4 keep_named[$src_image--1] result_y +else keep_named[$src_image--1] result_x +fi +repeat w#$alpha_indexes_list { +img_pos:=i(#$alpha_indexes_list,$>) +reverse[$img_pos,$src_image] +rm[$src_image] +} +rm[-1] +else +position,axis,threshold,influence={[$1%,$4,$3%*255,$2%]} +rep_sptbwgp $position,$axis,$influence,$threshold +fi +fx_rep_sptbwgp_preview_full: +max_image_index,threshold,old_axis,contain_alpha,started,changes,minimum_alpha_index,has_activated_post_changes:=[$!-1,$3%,$11,$12,0,0,$13,$14] +old_x_shift,old_x_influence,old_x_threshold,old_y_shift,old_y_influence,old_y_threshold=${5-10} +if $2 +if narg($_persistent) +if $contain_alpha +eval " +const post_changes_mode=$has_activated_post_changes; +const axis=$4; +post_changes_mode?( +user_input=[${1-3}]; +vector_equality=user_input-(axis?[${8-10}]:[${5-7}]); +):( +user_input=[${1-4}]; +vector_equality=user_input-(axis?[${8-10},$old_axis]:[${5-7},$old_axis]); +); +pos_unequal=find(vector_equality,0,0,1); +changes=pos_unequal!=-1; +[changes,vector_equality[2]?1]; +" +changes,threshold_change=${} +if $changes +has_activated_post_changes=1 +$_persistent +contain_result_x,contain_result_y=narg($result_x),narg($result_y) +if $contain_result_x remove[result_x] fi +if $contain_result_y remove[result_y] fi +contain_thresholded_map:=narg($y_axis_generated_thresholded_map)||narg($x_axis_generated_thresholded_map) +activate_create_thresholded_map=0 +if !$contain_thresholded_map&&$3 +activate_create_thresholded_map=1 +elif $threshold_change&&$3 +remove[x_axis_generated_thresholded_map,y_axis_generated_thresholded_map] +activate_create_thresholded_map=1 +fi +if $activate_create_thresholded_map +repeat w#$alpha_indexes_list { +img_pos,max_alp_val:=I(#$alpha_indexes_list,$>) +y_axis_alpha_list_index:=$alpha_indexes_list+1+(2*$>) +x_axis_alpha_list_index:=$y_axis_alpha_list_index+1 +shared[$img_pos] {s#$img_pos-1} +{w#$y_axis_alpha_list_index},1,1,{s#$y_axis_alpha_list_index},"begin( +const ref_y_img_index=$y_axis_alpha_list_index; +const num_of_points=s; +const dec_num_of_points=num_of_points-1; +const threshold=$threshold*$max_alp_val; +empty_vector=vector(#num_of_points,0); +); +new_vector=empty_vector; +info=I#ref_y_img_index; +insertion_pos=0; +repeat(info[0],p, +pos=info[p+1]; +if(i(#-1,x,pos,0,0)>=threshold, +++new_vector[0]; +new_vector[++insertion_pos]=pos; +); +); +new_vector; +" +name[-1] y_axis_generated_thresholded_map +1,{h#$x_axis_alpha_list_index},1,{s#$x_axis_alpha_list_index},"begin( +const ref_x_img_index=$x_axis_alpha_list_index; +const num_of_points=s; +const dec_num_of_points=num_of_points-1; +const threshold=$threshold*$max_alp_val; +empty_vector=vector(#num_of_points,0); +); +new_vector=empty_vector; +info=I#ref_x_img_index; +insertion_pos=0; +repeat(info[0],p, +pos=info[p+1]; +if(i(#-2,pos,y,0,0)>=threshold, +++new_vector[0]; +new_vector[++insertion_pos]=pos; +); +); +new_vector; +" +name[-1] x_axis_generated_thresholded_map +shared[-2,-1] 0 +max_x_alpha_count:=iM#-1 +max_y_alpha_count:=iM#-2 +remove[-5,-2,-1] +crop[-1] 0,0,0,0,0,{h#-1-1},0,$max_x_alpha_count +crop[-2] 0,0,0,0,{w#-2-1},0,0,$max_y_alpha_count +} +contain_thresholded_map=1 +fi +if $3 +repeat w#$alpha_indexes_list { +img_pos:=i(#$alpha_indexes_list,$>) +y_axis_thresholded_map_index:=$x_axis_alpha_list+1+(2*$>) +x_axis_thresholded_map_index:=$y_axis_thresholded_map_index+1 +{w#$img_pos},{h#$img_pos},1,{s#$img_pos} +if $4 name[-1] result_y +{w#$y_axis_thresholded_map_index},1,1,1,:"begin( +const src_img_index=$img_pos; +const dst_img_index=$result_y; +const ref_map=$y_axis_thresholded_map_index; +const height=h#src_img_index; +const influence_factor=$2%; +const shift_position=(-1*$1)/200+.5; +const use_alternative_shift_point=shift_position<1; +); +number_of_points=i(#ref_map); +if(number_of_points, +start_pos=height-number_of_points; +if(use_alternative_shift_point, +start_pos=int(lerp(0,start_pos,shift_position)); +); +repeat(number_of_points,rf, +rf_pos=rf+1; +src_point_position=i(#ref_map,x,0,0,rf_pos); +dst_point_position=round(lerp(src_point_position,start_pos++,influence_factor)); +I(#dst_img_index,x,dst_point_position)=I(#src_img_index,x,src_point_position); +); +);" +else name[-1] result_x +1,{h#$x_axis_thresholded_map_index},1,1,:"begin( +const src_img_index=$img_pos; +const dst_img_index=$result_x; +const ref_map=$x_axis_thresholded_map_index; +const width=w#src_img_index; +const influence_factor=$2%; +const shift_position=$1/200+.5; +const use_alternative_shift_point=shift_position<1; +); +number_of_points=i(#ref_map); +if(number_of_points, +start_pos=width-number_of_points; +if(use_alternative_shift_point, +start_pos=int(lerp(0,start_pos,shift_position)); +); +repeat(number_of_points,rf, +rf_pos=rf+1; +src_point_position=i(#ref_map,0,y,0,rf_pos); +dst_point_position=round(lerp(src_point_position,start_pos++,influence_factor)); +I(#dst_img_index,dst_point_position,y)=I(#src_img_index,src_point_position,y); +); +);" +fi +remove[-1] +} +else +repeat w#$alpha_indexes_list { +img_pos:=i(#$alpha_indexes_list,$>) +y_axis_alpha_list_pos:=$alpha_indexes_list+1+(2*$>) +x_axis_alpha_list_pos:=$y_axis_alpha_list_pos+1 +{w#$img_pos},{h#$img_pos},1,{s#$img_pos} +if $4 name[-1] result_y +{w#$y_axis_alpha_list_pos},1,1,1,:"begin( +const src_img_index=$img_pos; +const dst_img_index=$result_y; +const ref_map=$y_axis_alpha_list_pos; +const height=h#src_img_index; +const influence_factor=$2%; +const shift_position=(-1*$1)/200+.5; +const use_alternative_shift_point=shift_position<1; +); +number_of_points=i(#ref_map); +if(number_of_points, +start_pos=height-number_of_points; +if(use_alternative_shift_point, +start_pos=int(lerp(0,start_pos,shift_position)); +); +repeat(number_of_points,rf, +rf_pos=rf+1; +src_point_position=i(#ref_map,x,0,0,rf_pos); +dst_point_position=round(lerp(src_point_position,start_pos++,influence_factor)); +I(#dst_img_index,x,dst_point_position)=I(#src_img_index,x,src_point_position); +); +);" +else name[-1] result_x +1,{h#$x_axis_alpha_list_pos},1,1,:"begin( +const src_img_index=$img_pos; +const dst_img_index=$result_x; +const ref_map=$x_axis_alpha_list_pos; +const width=w#src_img_index; +const influence_factor=$2%; +const shift_position=$1/200+.5; +const use_alternative_shift_point=shift_position<1; +); +number_of_points=i(#ref_map); +if(number_of_points, +start_pos=width-number_of_points; +if(use_alternative_shift_point, +start_pos=int(lerp(0,start_pos,shift_position)); +); +repeat(number_of_points,rf, +rf_pos=rf+1; +src_point_position=i(#ref_map,0,y,0,rf_pos); +dst_point_position=round(lerp(src_point_position,start_pos++,influence_factor)); +I(#dst_img_index,dst_point_position,y)=I(#src_img_index,src_point_position,y); +); +);" +fi +remove[-1] +} +fi +if narg($y_axis_generated_thresholded_map)||narg($x_axis_generated_thresholded_map) +if $4 store[alpha_indexes_list,y_axis_alpha_list,x_axis_alpha_list,y_axis_generated_thresholded_map,x_axis_generated_thresholded_map,result_y] _persistent +else store[alpha_indexes_list,y_axis_alpha_list,x_axis_alpha_list,y_axis_generated_thresholded_map,x_axis_generated_thresholded_map,result_x] _persistent +fi +else +if $4 store[alpha_indexes_list,y_axis_alpha_list,x_axis_alpha_list,result_y] _persistent +else store[alpha_indexes_list,y_axis_alpha_list,x_axis_alpha_list,result_x] _persistent +fi +fi +fi +fi +else +started,has_activated_post_changes=1,0 +to_automode +num_of_imgs={$!} +1 => temp_alpha_indexes_list +eval " +const temp_alpha_indexes_list=$temp_alpha_indexes_list; +contain_alpha=0; +repeat($num_of_imgs,p, +if(!(s#p&1), +contain_alpha=1; +da_push(#temp_alpha_indexes_list,p); +); +); +if(contain_alpha,da_freeze(#temp_alpha_indexes_list);); +contain_alpha; +" +contain_alpha=${} +if $contain_alpha +1,1,1,2 => alpha_indexes_list +contain_alpha=0 +repeat h#$temp_alpha_indexes_list { +img_pos:=i(#$temp_alpha_indexes_list,0,$>) +shared[$img_pos] {s#$img_pos-1} +if iv#-1 +eval da_push(#$alpha_indexes_list,[$img_pos,{iM#-1}]) +contain_alpha=1 +fi +remove[-1] +} +if $contain_alpha eval da_freeze(#$alpha_indexes_list) fi +remove[temp_alpha_indexes_list] +fi +if $contain_alpha +minimum_alpha_index:=im#-1 +resize[$alpha_indexes_list] {w#$alpha_indexes_list},1,100%,100%,-1 +repeat w#$alpha_indexes_list { +img_pos:=i(#$alpha_indexes_list,$>) +shared[$img_pos] {s#$img_pos-1} +{w#-1},1,1,{h#-1+1},:" +alpha_info=vector(#s,0); +insertion_pos=0; +repeat(h#-1,pixel_position, +alpha_value=i(#-1,x,pixel_position,0,0); +if(alpha_value, +++alpha_info[0]; +alpha_info[++insertion_pos]=pixel_position; +); +); +alpha_info;" +name[-1] y_axis_alpha_list +1,{h#-2},1,{w#-2+1},:" +alpha_info=vector(#s,0); +insertion_pos=0; +repeat(w#-2,pixel_position, +alpha_value=i(#-2,pixel_position,y,0,0); +if(alpha_value, +++alpha_info[0]; +alpha_info[++insertion_pos]=pixel_position; +); +); +alpha_info;" +name[-1] x_axis_alpha_list +shared[-2,-1] 0 +max_x_alpha_count:=iM#-1 +max_y_alpha_count:=iM#-2 +remove[-5,-2,-1] +crop[-1] 0,0,0,0,0,{h#-1-1},0,$max_x_alpha_count +crop[-2] 0,0,0,0,{w#-2-1},0,0,$max_y_alpha_count +} +if $threshold +repeat w#$alpha_indexes_list { +img_pos,max_alp_val:=I(#$alpha_indexes_list,$>) +y_axis_alpha_list_index:=$alpha_indexes_list+1+(2*$>) +x_axis_alpha_list_index:=$y_axis_alpha_list_index+1 +shared[$img_pos] {s#$img_pos-1} +{w#$y_axis_alpha_list_index},1,1,{s#$y_axis_alpha_list_index},"begin( +const ref_y_img_index=$y_axis_alpha_list_index; +const num_of_points=s; +const dec_num_of_points=num_of_points-1; +const threshold=$threshold*$max_alp_val; +empty_vector=vector(#num_of_points,0); +); +new_vector=empty_vector; +info=I#ref_y_img_index; +insertion_pos=0; +repeat(info[0],p, +pos=info[p+1]; +if(i(#-1,x,pos,0,0)>=threshold, +++new_vector[0]; +new_vector[++insertion_pos]=pos; +); +); +new_vector; +" +name[-1] y_axis_generated_thresholded_map +1,{h#$x_axis_alpha_list_index},1,{s#$x_axis_alpha_list_index},"begin( +const ref_x_img_index=$x_axis_alpha_list_index; +const num_of_points=s; +const dec_num_of_points=num_of_points-1; +const threshold=$threshold*$max_alp_val; +empty_vector=vector(#num_of_points,0); +); +new_vector=empty_vector; +info=I#ref_x_img_index; +insertion_pos=0; +repeat(info[0],p, +pos=info[p+1]; +if(i(#-2,pos,y,0,0)>=threshold, +++new_vector[0]; +new_vector[++insertion_pos]=pos; +); +); +new_vector; +" +name[-1] x_axis_generated_thresholded_map +shared[-2,-1] 0 +max_x_alpha_count:=iM#-1 +max_y_alpha_count:=iM#-2 +remove[-5,-2,-1] +crop[-1] 0,0,0,0,0,{h#-1-1},0,$max_x_alpha_count +crop[-2] 0,0,0,0,{w#-2-1},0,0,$max_y_alpha_count +} +repeat w#$alpha_indexes_list { +img_pos:=i(#$alpha_indexes_list,$>) +y_axis_thresholded_map_index:=$x_axis_alpha_list+1+(2*$>) +x_axis_thresholded_map_index:=$y_axis_thresholded_map_index+1 +{w#$img_pos},{h#$img_pos},1,{s#$img_pos} . +name[-2] result_y +name[-1] result_x +{w#$y_axis_thresholded_map_index},1,1,1,:"begin( +const src_img_index=$img_pos; +const dst_img_index=$result_y; +const ref_map=$y_axis_thresholded_map_index; +const height=h#src_img_index; +const influence_factor=$2%; +const shift_position=(-1*$1)/200+.5; +const use_alternative_shift_point=shift_position<1; +); +number_of_points=i(#ref_map); +if(number_of_points, +start_pos=height-number_of_points; +if(use_alternative_shift_point, +start_pos=int(lerp(0,start_pos,shift_position)); +); +repeat(number_of_points,rf, +rf_pos=rf+1; +src_point_position=i(#ref_map,x,0,0,rf_pos); +dst_point_position=round(lerp(src_point_position,start_pos++,influence_factor)); +I(#dst_img_index,x,dst_point_position)=I(#src_img_index,x,src_point_position); +); +);" +rm[-1] +1,{h#$x_axis_thresholded_map_index},1,1,:"begin( +const src_img_index=$img_pos; +const dst_img_index=$result_x; +const ref_map=$x_axis_thresholded_map_index; +const width=w#src_img_index; +const influence_factor=$2%; +const shift_position=$1/200+.5; +const use_alternative_shift_point=shift_position<1; +); +number_of_points=i(#ref_map); +if(number_of_points, +start_pos=width-number_of_points; +if(use_alternative_shift_point, +start_pos=int(lerp(0,start_pos,shift_position)); +); +repeat(number_of_points,rf, +rf_pos=rf+1; +src_point_position=i(#ref_map,0,y,0,rf_pos); +dst_point_position=round(lerp(src_point_position,start_pos++,influence_factor)); +I(#dst_img_index,dst_point_position,y)=I(#src_img_index,src_point_position,y); +); +);" +rm[-1] +} +else +repeat w#$alpha_indexes_list { +img_pos:=i(#$alpha_indexes_list,$>) +y_axis_alpha_list_pos:=$alpha_indexes_list+1+(2*$>) +x_axis_alpha_list_pos:=$y_axis_alpha_list_pos+1 +{w#$img_pos},{h#$img_pos},1,{s#$img_pos} . +name[-2] result_y +name[-1] result_x +{w#$y_axis_alpha_list_pos},1,1,1,:"begin( +const src_img_index=$img_pos; +const dst_img_index=$result_y; +const ref_map=$y_axis_alpha_list_pos; +const height=h#src_img_index; +const influence_factor=$2%; +const shift_position=(-1*$1)/200+.5; +const use_alternative_shift_point=shift_position<1; +); +number_of_points=i(#ref_map); +if(number_of_points, +start_pos=height-number_of_points; +if(use_alternative_shift_point, +start_pos=int(lerp(0,start_pos,shift_position)); +); +repeat(number_of_points,rf, +rf_pos=rf+1; +src_point_position=i(#ref_map,x,0,0,rf_pos); +dst_point_position=round(lerp(src_point_position,start_pos++,influence_factor)); +I(#dst_img_index,x,dst_point_position)=I(#src_img_index,x,src_point_position); +); +);" +rm[-1] +1,{h#$x_axis_alpha_list_pos},1,1,:"begin( +const src_img_index=$img_pos; +const dst_img_index=$result_x; +const ref_map=$x_axis_alpha_list_pos; +const width=w#src_img_index; +const influence_factor=$2%; +const shift_position=$1/200+.5; +const use_alternative_shift_point=shift_position<1; +); +number_of_points=i(#ref_map); +if(number_of_points, +start_pos=width-number_of_points; +if(use_alternative_shift_point, +start_pos=int(lerp(0,start_pos,shift_position)); +); +repeat(number_of_points,rf, +rf_pos=rf+1; +src_point_position=i(#ref_map,0,y,0,rf_pos); +dst_point_position=round(lerp(src_point_position,start_pos++,influence_factor)); +I(#dst_img_index,dst_point_position,y)=I(#src_img_index,src_point_position,y); +); +);" +rm[-1] +} +fi +if narg($y_axis_generated_thresholded_map)||narg($x_axis_generated_thresholded_map) +store[alpha_indexes_list,y_axis_alpha_list,x_axis_alpha_list,y_axis_generated_thresholded_map,x_axis_generated_thresholded_map,result_y,result_x] _persistent +else +store[alpha_indexes_list,y_axis_alpha_list,x_axis_alpha_list,result_y,result_x] _persistent +fi +else +rm[-1] +0 store. _persistent +fi +fi +fi +if $contain_alpha&&$2 +keep[$minimum_alpha_index] +crop $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1 +if $4 gui_split_preview "$_persistent keep[result_y] keep[0] crop $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1",${-3--1} +else gui_split_preview "$_persistent keep[result_x] keep[0] crop $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1",${-3--1} +fi +else +if $contain_alpha keep[$minimum_alpha_index] fi +crop $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1 +gui_split_preview "return",${-3--1} +fi +if $started +old_x_shift,old_x_influence,old_x_threshold,old_y_shift,old_y_influence,old_y_threshold=${1-3},${1-3} +else +if $4 +old_y_shift,old_y_influence,old_y_threshold=${1-3} +else +old_x_shift,old_x_influence,old_x_threshold=${1-3} +fi +fi +old_axis=$4 +u "{$1}""{$2}""{$3}""{$4}""{"$old_x_shift"}""{"$old_x_influence"}""{"$old_x_threshold"}""{"$old_y_shift"}""{"$old_y_influence"}""{"$old_y_threshold"}""{"$old_axis"}""{"$contain_alpha"}""{"$minimum_alpha_index"}""{"$has_activated_post_changes"}""{$-3}""{$-2,$-1}" +fx_rep_henon_phase_diagram: +init_sub={abs($11)} +sub={$init_sub+1} +ww={w} hh={h} +{w*$sub},{h*$sub},1,1,-1 +rm.. +setarg=$1,$7,$8,$9%,$10%,${2-6} +if $12==0 +if $13 +rep_henon_phase_diagram $setarg,{$14==2?3:2} +if $14==2 {w},{h},1,1,255 rv[-2,-1] a[-2,-1] c r. $ww,$hh,100%,100%,2 sh. 1 n. 0,255 rm. +else +inpaint_pde[-3] [-2],1,0,0,1 rm[-2] a[-2,-1] c r. $ww,$hh,100%,100%,2 +if $14 sh. 0 *. $15 cut. 0,255 rm. sh. 1 n. 0,255 rm. +else sh. 0 sh.. 1 n[-2,-1] 0,255 rm[-2,-1] +fi +fi +else +rep_henon_phase_diagram $setarg,{$14>1?3} +r. $ww,$hh,100%,100%,2 +if $14==1 +*. $15 cut. 0,255 +else +n. 0,255 +fi +fi +elif $12==1 +if $13 +rep_henon_phase_diagram $setarg,2 +n... 0,360 +inpaint_pde[-3] [-2],1,0,0,1 rm[-2] +l.. { {w},{h},100%,2,1 a[-2,-1] c } +if $16==0 hcy2rgb.. +elif $16==1 hsi2rgb.. +elif $16==2 hsv2rgb.. +fi +a[-2,-1] c +r. $ww,$hh,100%,100%,2 +sh. 3 n. 0,255 rm. +else +rep_henon_phase_diagram $setarg,1 +n.. 0,360 +r. 100%,100%,100%,2 +a[-2,-1] c +if $16==0 hcy2rgb. +elif $16==1 hsi2rgb. +elif $16==2 hsv2rgb. +fi +r. $ww,$hh,100%,100%,2 +fi +elif $12==2 ++pal {$17+1} +if $13 +rep_henon_phase_diagram[-2] $setarg,2 +*[-4] {(w#-1-1)/iM#-4} +vmin={im#-4} +{w#-4},{h#-4},1,3,pos=i(#-4,x,y,0,0);pos!=$vmin?I(#-1,pos,0,0,1); +inpaint_pde[-1] [-4],1,0,0,1 +rv[-1,-3] a[-1,-3] c +rm[-4,-3,-1] +r. $ww,$hh,100%,100%,2 +sh. 3 n. 0,255 rm. +else +rep_henon_phase_diagram[-2] $setarg +*[-2] {(w#-1-1)/iM#-2} +vmin={im#-2} +{w#-2},{h#-2},1,3,pos=i(#-2,x,y,0,0);pos!=$vmin?I(#-1,pos,0,0,1); +rm[-3,-2] +r. $ww,$hh,100%,100%,2 +fi +fi +fx_rep_henon_phase_diagram_preview: +fx_rep_henon_phase_diagram $* +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}""{$9,$10}""{$11}""{$12}""{$13}""{$14}_"{!$12?2}"{$15}_"{!$12?($14==1?2)}"{$16}_"{$12==1?2}"{$17}_"{$12==2?2}"{$18}"\ +"{$19}"\ +"{$20}" +fx_rep_hitomezashi: +skip "${10=}","${11=}","${12=}" +k[0] +ow,oh={[w,h]} +if $3 +if $4 +length_w={ceil((w-$2)/($2*2))} +length_h={ceil((h-$2)/($2*2))} +else +length_w={floor((w-$2)/($2*2))} +length_h={floor((h-$2)/($2*2))} +fi +else +if $4 +length_w={ceil(w/$2)} +length_h={ceil(h/$2)} +else +length_w={floor(w/$2)} +length_h={floor(h/$2)} +fi +fi +stray_seed,split_count=$51,$35 +if $1 +if !$14&&!$16 +if size('"$11"')>1 +if size('"$11"')<=2 +('"$11"') +r. $length_w,1,1,1,0,2 +bin_str_a={t} +rm. +else +bin_str_a="$11" +fi +else +bin_str_a=${rep_random_binary\ $length_w} +fi +else +bin_str_a=${rep_random_binary\ $length_w} +fi +if !$15&&!$16 +if size('"$12"')>1 +if size('"$12"')<=2 +('"$12"') +r. $length_h,1,1,1,0,2 +bin_str_b={t} +rm. +else +bin_str_b="$12" +fi +else +bin_str_b=${rep_random_binary\ $length_h} +fi +else +bin_str_b=${rep_random_binary\ $length_h} +fi +if !$4 +('$bin_str_a') +r. $length_w,100%,100%,100%,0,2 +bin_a={t} +rm. +('$bin_str_b') +r. $length_h,100%,100%,100%,0,2 +bin_b={t} +rm. +else +bin_a=$bin_str_a +bin_b=$bin_str_b +fi +else +max_length={max($length_w,$length_h)} +if !$13 +if size('"$10"')>1 +if size('"$10"')<=2 +('"$10"') +r. $max_length,1,1,1,0,2 +bin_str_0={t} +rm. +else +bin_str_0="$10" +fi +else +bin_str_0=${rep_random_binary\ $max_length} +fi +else +bin_str_0=${rep_random_binary\ $max_length} +fi +if !$4 +('$bin_str_0') +r. $length_w,100%,100%,100%,0,2 +bin_a={t} +rm. +('$bin_str_0') +r. $length_h,100%,100%,100%,0,2 +bin_b={t} +rm. +else +bin_a=$bin_str_0 +bin_b=$bin_str_0 +fi +fi +if $17==4 +if $29==2 +if $30 col=[u(360),u(1),u(1)] +else col=[u(255),u(255),u(255)] +fi +$34,1,1,3 +if $39 seed_b={int(u(0,200001,1,0))} +else seed_b=$38 +fi +local[-1] { +split_count={$35<$34?$35:$34} +if $split_count>1 s x,$split_count fi +f begin(length=(w-1)/$36;);x/length +$36,1,1,1 +repeat $split_count { +f. begin(srand($seed_b+$>););$col +if $42 mirror. x fi +rep_cubic_map[$>] [-1],2 +} +rm. +a x +if $30 hsl2rgb. fi +if $43 mirror. x fi +} +elif $29==1 +if $39 seed_a={int(u(0,200001,1,0))} +else seed_a=$37 +fi +if $30 $34,1,1,3,begin(srand($seed_a););[u(360),u(1),u(1)] hsl2rgb. +else $34,1,1,3,begin(srand($seed_a););[u(255),u(255),u(255)] +fi +if $44 mirror. x fi +else +if $31 pal $33 +else palette $32 +fi +if $44 mirror. x fi +fi +if $45 +if $52 +stray_seed={int(u(200001))} +fi +if $45==2 +$50,1,1,3,begin(srand($stray_seed););[u(255),u(255),u(255)] +else +pal $49 +fi +if $54 mirror. x fi +if $3 +rep_hitomezashi $bin_a,$bin_b,$2,[-2],[-1],{int($41/100*w#-2)},$40,{$3-1},$stray_seed,${46-48},{round($55/100*$2)},${57-59} +else +rep_hitomezashi $bin_a,$bin_b,$2,[-2],[-1],{int($41/100*w#-2)},$40,,$stray_seed,${46-48},{round($55/100*$2)},${57-59} +fi +rm[-3,-2] +else +if $3 +rep_hitomezashi $bin_a,$bin_b,$2,[-1],,{int($41/100*w#-1)},$40,{$3-1},$stray_seed,${46-48},{round($55/100*$2)},${57-59} +else +rep_hitomezashi $bin_a,$bin_b,$2,[-1],,{int($41/100*w#-1)},$40,,$stray_seed,${46-48},{round($55/100*$2)},${57-59} +fi +rm.. +fi +elif $17==3 +color_a=${rep_int82hex\ ${23-25}} +color_b=${rep_int82hex\ ${26-28}} +if $3 +rep_hitomezashi $bin_a,$bin_b,$2,$color_a,$color_b,{$3-1},{round($55/100*$2)},${57-59} +else +rep_hitomezashi $bin_a,$bin_b,$2,$color_a,$color_b,,{round($55/100*$2)},${57-59} +fi +elif $17==2 +bgcol=${rep_int82hex\ ${20-22}} +if $3 +rep_hitomezashi $bin_a,$bin_b,$2,$bgcol,,{$3-1},{round($55/100*$2)},${57-59} +else +rep_hitomezashi $bin_a,$bin_b,$2,$bgcol,,,{round($55/100*$2)},${57-59} +fi +elif $17==1 +if $3 +rep_hitomezashi $bin_a,$bin_b,$2,$18~,$19~,{$3-1},{round($55/100*$2)},$56 +else +rep_hitomezashi $bin_a,$bin_b,$2,$18~,$19~,,{round($55/100*$2)},$56 +fi +else +if $3 +rep_hitomezashi $bin_a,$bin_b,$2,,,{$3-1} +else +rep_hitomezashi $bin_a,$bin_b,$2 +fi +*. 255 +fi +k. +if !$4 +if $17>1 $ow,$oh,1,{s},[${7-9}] +else +val={$17?$6:$5?($5<<8)-1} +$ow,$oh,1,{s},$val +fi +j[1] [0],.5~,.5~ +rm.. +fi +u $bin_str_0,$bin_str_a,$bin_str_b,$seed_a,$seed_b,$stray_seed,$split_count +fx_rep_hitomezashi_preview: +skip "${10=}","${11=}","${12=}" +fx_rep_hitomezashi $"*" +bin_str_0,bin_str_a,bin_str_b,seed_a,seed_b,stray_seed,split_count=${} +point_x,point_y,started={[$-4,$-3,$-1]} +if !isnan($point_x) +point_x,point_y:=($-2||$started)?[100*(50%*w+1)/w,100*(50%*h)/h]:cut([$-4,$-3],0,100) +eval " +points=[$point_x,$point_y]%; +trim_out_width=min($_preview_width,w); +trim_out_height=min($_preview_height,h); +trimmed_width=w-trim_out_width; +trimmed_height=h-trim_out_height; +x0=ceil(trimmed_width*points[0]); +y0=ceil(trimmed_height*points[1]); +x1=x0+trim_out_width-1; +y1=y0+trim_out_height-1; +[x0,y0,x1,y1];" +crop ${} +started=0 +fi +u "{$1}""{$2}""{$3}""{$4}""{$5}"_{!$17?!$4?2}"{$6}"_{$17==1?!$4?2}"{$7,$8,$9}"_{$17>1?!$4?2}"{"$bin_str_0"}"_{!$1?2}"{"$bin_str_a"}"_{$1?2}"{"$bin_str_b"}"_{$1?2}"{0}"_{!$1?2}"{0}"_{$1?2}"{0}"_{$1?2}"{0}"_{$1?2}"{$17}""{$18}"_{$17==1?2}"{$19}"_{$17==1?2}"{$20,$21,$22}"_{$17==2?2}"{$23,$24,$25}"_{$17==3?2}"{$26,$27,$28}"_{$17==3?2}"{$29}"_{$17==4?2}"{$30}"_{$17==4?($29?2)}"{$31}"_{$17==4?(!$29?2)}"{$32}"_{$17==4?(!$29?!$31?2)}"{$33}"_{$17==4?(!$29?$31?2)}"{$34}"_{$29&&$17==4?2}"{"$split_count"}"_{$17==4?($29==2?2)}"{$36}"_{$17==4?($29==2?2)}"{"$seed_a"}"_{$17==4?($29==1?2)}"{"$seed_b"}"_{$17==4?($29==2?2)}"{0}"_{$17==4?($29?2)}"{$40}"_{$17==4?2}"{$41}"_{$17==4?2}"{$42}"_{$17==4?($29==2?2)}"{$43}"_{$17==4?($29==2?2)}"{$44}"_{$17==4?($29==1?2)}"{$45}"_{$17==4?2}"{$46,$47,$48}"_{$17==4?(!$45?2)}"{$49}"_{$17==4?($45==1?2)}"{$50}"_{$17==4?($45==2?2)}"{"$stray_seed"}"_{$17==4?($45?2)}"{0}"_{$17==4?($45?2)}"{$53}"\ +"{$54}"_{$17==4?($45?2)}"{$55}"_{$17?2}"{$56}"_{$17==1?2}"{$57,$58,$59}"_{$17>1?2}"{"$point_x","$point_y"}""{0}"_{!isnan($-4)+1}"{"$started"}" +fx_rep_p_i: +rep_hsx_poster_index ${1-3},{$4%},${5-6} +fx_rep_p_i_preview: +gui_split_preview "fx_rep_p_i ${1-6}",${-3--1} +fx_find_factors_of_images_preview: +skip "$*" +check "isint($2)" +n_imgs={$!} +act_mult_imgs_mode={$n_imgs>1} +index_pos,index={[$1,$2%$n_imgs]} +if narg($_persistent) +if $act_mult_imgs_mode +if $1!=$7 +index={round(($n_imgs-1)*$1%)} +index_pos={$index/($n_imgs-1)*100} +elif $2!=$8 +index_pos={$index/($n_imgs-1)*100} +fi +$_persistent +width_start_point:=i(#$width_factors_start_indexes,$index) +width_end_point:=$width_start_point+i(#$number_of_width_factors,$index) +height_start_point:=i(#$height_factors_start_indexes,$index) +height_end_point:=$height_start_point+i(#$number_of_height_factors,$index) +width_and_height_start_point:=i(#$width_and_height_factors_start_indexes,$index) +width_and_height_end_point:=$width_and_height_start_point+i(#$number_of_width_and_height_factors,$index) +crop[$width_factors_img] $width_start_point,{$width_end_point-1} +crop[$height_factors_img] $height_start_point,{$height_end_point-1} +crop[$width_and_height_factors_img] $width_and_height_start_point,{$width_and_height_end_point-1} +width_factors={crop(#$width_factors_img)} +height_factors={crop(#$height_factors_img)} +width_height_factors={crop(#$width_and_height_factors_img)} +text_box={t} +remove[-10--1] +else +$_persistent +width_factors={crop(#-4)} +height_factors={crop(#-3)} +width_height_factors={crop(#-2)} +text_box={t} +remove[-4--1] +fi +else +text_box="" +index_pos={$index/($n_imgs-1)*100} +foreach { +if $act_mult_imgs_mode +if $> text_box.=\n fi +text_box.="Image "{`35`}$>\n +text_box.=-----------------------\n +fi +w,h={[w,h]} +temp_width_factors=${rep_find_factors_of\ $w} +temp_height_factors=${rep_find_factors_of\ $h} +temp_width_height_factors=${rep_find_factors_of\ $w,$h} +if $>==$index +width_factors=$temp_width_factors +height_factors=$temp_height_factors +width_height_factors=$temp_width_height_factors +fi +if $act_mult_imgs_mode +($temp_width_factors) => width_factors_img +($temp_height_factors) => height_factors_img +($temp_width_height_factors) => width_and_height_factors_img +fi +text_box.="Image Width: "$w\n +text_box.="Image Height: "$h\n +text_box.="Image Dimensions: "$w{`120`}$h\n +text_box.=\n"Factors of Width: "$temp_width_factors\n +text_box.=\n"Factors of Height: "$temp_height_factors\n +text_box.=\n"Factors of Width and Height: "$temp_width_height_factors +if $act_mult_imgs_mode +text_box.=\n-----------------------\n +fi +} +if $act_mult_imgs_mode +local[width_factors_img] { +$!,1,1,1,w#x => number_of_width_factors +{w},1,1,1,>begin(v=0;);p=v;v+=i(#-1);p; => width_factors_start_indexes +append[^-2--1] x +} +local[height_factors_img] { +$!,1,1,1,w#x => number_of_height_factors +{w},1,1,1,>begin(v=0;);p=v;v+=i(#-1);p; => height_factors_start_indexes +append[^-2--1] x +} +local[width_and_height_factors_img] { +$!,1,1,1,w#x => number_of_width_and_height_factors +{w},1,1,1,>begin(v=0;);p=v;v+=i(#-1);p; => width_and_height_factors_start_indexes +append[^-2--1] x +} +fi +('$text_box') +text_box={t} +if $act_mult_imgs_mode +store[width_factors_img,height_factors_img,width_and_height_factors_img,number_of_width_factors,number_of_height_factors,number_of_width_and_height_factors,width_factors_start_indexes,height_factors_start_indexes,width_and_height_factors_start_indexes,-1] _persistent +else +($width_factors) +($height_factors) +($width_height_factors) +move[-4] {$!} +store[-4--1] _persistent +fi +fi +keep[$index] +act_mult_imgs_mode<<=1 +u "{"$index_pos"}_"$act_mult_imgs_mode"{"$index"}_"$act_mult_imgs_mode"{"$width_factors"}""{"$height_factors"}""{"$width_height_factors"}""{"$text_box"}""{"$index_pos"}""{"$index"}" +gui_rep_polkal: rep_polkal ${1-3},{($4-50)*2}%,{($5-50)*-2}%,${6--1} +fx_rep_lavander_binary_map: +skip "$*" +img_width,img_height={[w#0,h#0]} +if !narg($_persistent) error uninitialized fi +$_persistent +keep[output] +if !$1&&$12 resize $img_width,$img_height,100%,100%,0,{$12+1},.5,.5 fi +fx_rep_lavander_binary_map_preview: +skip "$*" +started,use_persistent,max_img_ind,timg,neq_form,color_mode_change,cont_base_map,ind_col_change,previous_status_of_random,previous_state_of_symmetry,current_num_of_colors,_num_of_colors=$89,{narg($_persistent)?1},{[$!-1,$!]},0,{$32?($32!=$116?1:0):($32!=$116)},0,0,$80,$110,$117,$33 +status_of_random={$32?$previous_status_of_random} +seed_change={$76!=$159} +act_rand_map={$32?(($status_of_random==2?$78)||$seed_change||$77)} +previous_shade,previous_lightness,previous_darkness=${154-156} +cli_command_text="$82" +cli_command_text_with_slash={/"$83"} +_color_info="$84" +mapping_info={/"$85"} +_fx_rep_lavander_binary_map_seed={$77?int(u(24000+1)):$76} +if !narg($_persistent) started=0 fi +if $70||$77||$78 _num_of_colors=$33 fi +if $act_rand_map +command "fx_rep_lavander_binary_map_create_palette: +$_num_of_colors,1,1,3,\"begin( +srand($_fx_rep_lavander_binary_map_seed); +const max_index=w-1; +const half_max_index=max_index>>1; +const expf=1-abs($71)/100; +const rand_light=$72%; +const rand_dark=$73%; +rand_dark||rand_light?( +v_shade=expr('begin(srand($_fx_rep_lavander_binary_map_seed));u(1)',w); +); +rand_dark&&rand_light?( +gen_base_shade()=x>half_max_index?lerp(0,1,lerp(x/max_index,v_shade[x],rand_light)):lerp(0,1,lerp(x/max_index,v_shade[x],rand_dark)); +): +rand_light?( +gen_base_shade()=x>half_max_index?lerp(0,1,lerp(x/max_index,v_shade[x],rand_light)):lerp(0,1,x/max_index); +): +rand_dark?( +gen_base_shade()=x>half_max_index?lerp(0,1,x/max_index):lerp(0,1,lerp(x/max_index,v_shade[x],rand_dark)); +):( +gen_base_shade()=lerp(0,1,x/max_index); +); +$71?( +$71<0?( +gen_shade()=1-(1-gen_base_shade())^expf; +):( +gen_shade()=gen_base_shade()^expf; +); +):( +gen_shade()=gen_base_shade(); +); +); +shade=gen_shade(); +[u(360),u(1),shade]; +\" +hsl2rgb. +if $_num_of_colors==5 _color_info=({round(I(#-1,0))};{round(I(#-1,1))};{round(I(#-1,2))};{round(I(#-1,3))};{round(I(#-1,4))}) +elif $_num_of_colors==4 _color_info=({round(I(#-1,0))};{round(I(#-1,1))};{round(I(#-1,2))};{round(I(#-1,3))}) +elif $_num_of_colors==3 _color_info=({round(I(#-1,0))};{round(I(#-1,1))};{round(I(#-1,2))}) +fi +" +else +if $32 +if $_num_of_colors==5 _color_info=(${55-57};${58-60};${61-63};${64-66};${67-69}) +elif $_num_of_colors==4 _color_info=(${43-45};${46-48};${49-51};${52-54}) +elif $_num_of_colors==3 _color_info=(${34-36};${37-39};${40-42}) +fi +command fx_rep_lavander_binary_map_create_palette:$_color_info +else command "fx_rep_lavander_binary_map_create_palette: 0" +fi +fi +img_width,img_height={[w#0,h#0]} +color_0_0_r,color_0_0_g,color_0_0_b,color_0_1_r,color_0_1_g,color_0_1_b,color_0_2_r,color_0_2_g,color_0_2_b,color_1_0_r,color_1_0_g,color_1_0_b,color_1_1_r,color_1_1_g,color_1_1_b,color_1_2_r,color_1_2_g,color_1_2_b,color_1_3_r,color_1_3_g,color_1_3_b,color_2_0_r,color_2_0_g,color_2_0_b,color_2_1_r,color_2_1_g,color_2_1_b,color_2_2_r,color_2_2_g,color_2_2_b,color_2_3_r,color_2_3_g,color_2_3_b,color_2_4_r,color_2_4_g,color_2_4_b,old_color_0_0_r,old_color_0_0_g,old_color_0_0_b,old_color_0_1_r,old_color_0_1_g,old_color_0_1_b,old_color_0_2_r,old_color_0_2_g,old_color_0_2_b,old_color_1_0_r,old_color_1_0_g,old_color_1_0_b,old_color_1_1_r,old_color_1_1_g,old_color_1_1_b,old_color_1_2_r,old_color_1_2_g,old_color_1_2_b,old_color_1_3_r,old_color_1_3_g,old_color_1_3_b,old_color_2_0_r,old_color_2_0_g,old_color_2_0_b,old_color_2_1_r,old_color_2_1_g,old_color_2_1_b,old_color_2_2_r,old_color_2_2_g,old_color_2_2_b,old_color_2_3_r,old_color_2_3_g,old_color_2_3_b,old_color_2_4_r,old_color_2_4_g,old_color_2_4_b=${34-69},${118-153} +if ($32?([${34-69}]!=[${118-153}]))||$70 +status_of_random=2 +color_mode_change=1 +_num_of_colors=$33 +ind_col_change=1 +fi +if $act_rand_map +color_mode_change=1 +status_of_random=1 +_num_of_colors=$33 +previous_shade,previous_lightness,previous_darkness=${71-73} +fi +if $32?([${71-73}]!=[$previous_shade,$previous_lightness,$previous_darkness])||($33!=$_num_of_colors) status_of_random=2 fi +if $32 previous_status_of_random=$status_of_random fi +if !$started||!narg($_persistent)||!$114 auto_size,auto_size_sym={v=int(log2(min($img_width,$img_height)));[v,v-1]} +else auto_size,auto_size_sym={[$114,$115]} +fi +if $1 +if $1&&!$90 +pw2size,user_defined_size=$112 +else +pw2size,user_defined_size=$2 +fi +elif !$started +user_defined_size,pw2size=$auto_size +else +pw2size={$10?$auto_size_sym:$auto_size} +user_defined_size=$112 +fi +size_changed={$pw2size!=$113} +bin_a=$4 +bin_b=$5 +bin_c=$6 +if v='$bin_a';max(v)>49||min(v)<48 error inv_bin_str_a fi +if v='$bin_b';max(v)>49||min(v)<48 error inv_bin_str_b fi +if v='$bin_c';max(v)>49||min(v)<48 error inv_bin_str_c fi +bin_a_size,bin_b_size,bin_c_size,neq_bin_a,neq_bin_b,neq_bin_c={bin_a='$4';bin_b='$5';bin_c='$6';[size(bin_a),size(bin_b),size(bin_c),bin_a!='$92',bin_b!='$93',bin_c!='$94']} +neq_bin={$neq_bin_a||$neq_bin_b||$neq_bin_c} +if !$bin_a_size error absen_bin_a fi +if !$bin_b_size error absen_bin_b fi +if !$bin_c_size error absen_bin_c fi +if $bin_a_size>4 error exces_bin_a fi +if $bin_b_size>4 error exces_bin_b fi +if $bin_c_size>4 error exces_bin_c fi +num_of_rand_bin_a_digits,num_of_rand_bin_b_digits,num_of_rand_bin_c_digits,binary_string_a_ind_0,binary_string_a_ind_1,binary_string_a_ind_2,binary_string_a_ind_3,binary_string_b_ind_0,binary_string_b_ind_1,binary_string_b_ind_2,binary_string_b_ind_3,binary_string_c_ind_0,binary_string_c_ind_1,binary_string_c_ind_2,binary_string_c_ind_3=${13-27} +if $28||$29||$30||$31 +if $28||$30 +if $num_of_rand_bin_a_digits==1 +bin_a,binary_string_a_ind_0={!$binary_string_a_ind_0} +else +index=${arg\ $num_of_rand_bin_a_digits,${16-19}} +binary_string_a_ind_{$num_of_rand_bin_a_digits-1},temp={a=int(u(0,2^$num_of_rand_bin_a_digits,1,0));a==$index?(a+1)%(2^$num_of_rand_bin_a_digits):a;} +(${rep_r_permutation_index2list\ 2,$num_of_rand_bin_a_digits,$temp}) ++. 48 +bin_a={t} +rm. +fi +fi +if $29||$30 +if $num_of_rand_bin_b_digits==1 +bin_b,binary_string_b_ind_0={!$binary_string_b_ind_0} +else +index=${arg\ $num_of_rand_bin_b_digits,${20-23}} +binary_string_b_ind_{$num_of_rand_bin_b_digits-1},temp={b=int(u(0,2^$num_of_rand_bin_b_digits,1,0));b==$index?(b+1)%(2^$num_of_rand_bin_b_digits):b;} +(${rep_r_permutation_index2list\ 2,$num_of_rand_bin_b_digits,$temp}) ++. 48 +bin_b={t} +rm. +fi +fi +if $31 +if $num_of_rand_bin_c_digits==1 +bin_c,binary_string_c_ind_0={!$binary_string_c_ind_0} +else +index=${arg\ $num_of_rand_bin_c_digits,${24-27}} +binary_string_c_ind_{$num_of_rand_bin_c_digits-1},temp={c=int(u(0,2^$num_of_rand_bin_c_digits,1,0));c==$index?(c+1)%(2^$num_of_rand_bin_c_digits):c;} +(${rep_r_permutation_index2list\ 2,$num_of_rand_bin_c_digits,$temp}) ++. 48 +bin_c={t} +rm. +fi +fi +neq_bin:=('$bin_a'!='$92')||('$bin_b'!='$93')||('$bin_c'!='$94') +elif $neq_bin +if $neq_bin_a +num_of_rand_bin_a_digits=$bin_a_size +binary_string_a_ind_{$num_of_rand_bin_a_digits-1}=${rep_r_permutation_list2index\ 2,{['$4']-48}} +fi +if $neq_bin_b +num_of_rand_bin_b_digits=$bin_b_size +binary_string_b_ind_{$num_of_rand_bin_b_digits-1}=${rep_r_permutation_list2index\ 2,{['$5']-48}} +fi +if $neq_bin_c +num_of_rand_bin_c_digits=$bin_c_size +binary_string_c_ind_{$num_of_rand_bin_c_digits-1}=${rep_r_permutation_list2index\ 2,{['$6']-48}} +fi +else +if $started&&([${16-27}]!=[${95-106}]) +$=arg_pos_ +if $3>2 +repeat 8 { +left_arg=${arg_pos_{$>+16}} +right_arg=${arg_pos_{$>+95}} +ab_pos,bin_group_pos={[int($>/4),$>%4]} +a_b=${arg\ $ab_pos+1,a,b} +num_of_digits={$bin_group_pos+1} +if !$bin_group_pos +if $left_arg!=$right_arg +num_of_rand_bin_$a_b"_digits"=$num_of_digits +bin_$a_b,binary_string_$a_b"_ind_"$bin_group_pos=$left_arg +neq_bin=1 +break +fi +else +if $left_arg!=$right_arg +(${rep_r_permutation_index2list\ 2,$num_of_digits,$left_arg}) ++. 48 +bin_$a_b={t} +num_of_rand_bin_$a_b"_digits"=$num_of_digits +binary_string$a_b"_ind_"$bin_group_pos=$left_arg +neq_bin=1 +rm. break +fi +fi +} +else +repeat 4 { +left_arg=${arg_pos_{$>+24}} +right_arg=${arg_pos_{$>+103}} +num_of_digits={$>+1} +if $left_arg!=$right_arg +(${rep_r_permutation_index2list\ 2,$num_of_digits,$left_arg}) ++. 48 +bin_c={t} +num_of_rand_bin_c_digits=$num_of_digits +binary_string_c_ind_$>=$left_arg +neq_bin=1 +rm. break +fi +} +fi +elif !$started +num_of_rand_bin_a_digits=$bin_a_size +binary_string_a_ind_{$num_of_rand_bin_a_digits-1}=${rep_r_permutation_list2index\ 2,{['$4']-48}} +num_of_rand_bin_b_digits=$bin_b_size +binary_string_b_ind_{$num_of_rand_bin_b_digits-1}=${rep_r_permutation_list2index\ 2,{['$5']-48}} +num_of_rand_bin_c_digits=$bin_c_size +binary_string_c_ind_{$num_of_rand_bin_c_digits-1}=${rep_r_permutation_list2index\ 2,{['$6']-48}} +fi +fi +form_b=$108 +if $3==6 +neq_form:='$8'!='$108' +form_b=$8 +fi +switch_use_sym={($10?1)!=($110?1)} +act_sym_switch={$10!=$110} +sym_mode={$switch_use_sym||$act_sym_switch} +if ([$3,$7]!=[$91,$107])||$neq_form||$neq_bin||$size_changed||!$started +use_persistent,color_mode_change={[0,1]} +if $3<6 formula_mode={$3>2?$3-3:-($3+1)} +else formula_mode=- +fi +if $3>2 ++rep_lavander_binary_map $pw2size,$formula_mode,$bin_a,$bin_b,$7,"$8" => base_map +base_cli_command="+rep_lavander_binary_map "$pw2size,$formula_mode,$bin_a,$bin_b,$7, +else ++rep_lavander_binary_map $pw2size,$formula_mode,$bin_c,,$7,"$8" => base_map +base_cli_command="+rep_lavander_binary_map "$pw2size,$formula_mode,$bin_c,,$7, +fi +cli_command_text=$base_cli_command\"$8\" +cli_command_text_with_slash=$base_cli_command{`92`}\"$8{`92`}\" +keep[base_map] +if $10 rep_symmetrize_xy {$10-1} => base_map fi +cont_base_map=1 +if $sym_mode sym_mode=0 fi +fi +if $sym_mode +use_persistent=0 +if $110?$10&&$110:$10 +$_persistent keep[-2,-1] +if $110 +eval " +const pw2size=2^$pw2size; +const pos=max(0,$110-1); +init_v=[1,pw2size]-1; +off_x=(pw2size-1)*(pos&1); +off_y=(pw2size-1)*(pos%3?1); +xc=init_v+off_x; +yc=init_v+off_y; +[xc[0],yc[0],xc[1],yc[1]]; +" +crop[-2,-1] ${} +fi +else +eval " +const pw2size=2^$pw2size; +const pos=max(0,$110)-1; +init_v=[1,pw2size]-1; +off_x=(pw2size-1)*(pos&1); +off_y=(pw2size-1)*(pos%3?1); +xc=init_v+off_x; +yc=init_v+off_y; +[xc[0],yc[0],xc[1],yc[1]]; +" +$_persistent keep[-2,-1] +crop[-2,-1] ${} +fi +if $10 rep_symmetrize_xy {$10-1} fi +name[-2,-1] base_map,output ++store[-2,-1] _persistent +keep[output] +if !$1&&$12 resize $img_width,$img_height,100%,100%,0,{$12+1},.5,.5 fi +fi +if $color_mode_change +use_persistent=0 +if !$cont_base_map +if narg($_persistent) +$_persistent +keep[base_map] +fi +fi +size_val_arr_base_map={iM#$base_map+1} +if $32 +current_num_of_colors=$_num_of_colors +mi={$_num_of_colors-1} +fx_rep_lavander_binary_map_create_palette => ref_col +if $_num_of_colors==5 +3,1,1,1 +4,1,1,1 +elif $_num_of_colors==4 +3,1,1,1 +5,1,1,1 +elif $_num_of_colors==3 +4,1,1,1 +5,1,1,1 +fi +if !$act_rand_map permute[-3] yzcx fi +f[-2--1] lerp(0,$mi,x/(w-1)) +rep_cubic_map[-2--1] [-3] +sort_list[-3--1] +,w +$size_val_arr_base_map,1,1,1,lerp(0,$mi,x/(w-1)) +rep_cubic_map[-1] [ref_col] ++map[base_map] [-1] rm.. => output ++store[$base_map,-1] _persistent +a[-4--2] x +round.. +cut.. 0,255 +permute[-2] cxyz +color_0_0_r,color_0_0_g,color_0_0_b,color_0_1_r,color_0_1_g,color_0_1_b,color_0_2_r,color_0_2_g,color_0_2_b,color_1_0_r,color_1_0_g,color_1_0_b,color_1_1_r,color_1_1_g,color_1_1_b,color_1_2_r,color_1_2_g,color_1_2_b,color_1_3_r,color_1_3_g,color_1_3_b,color_2_0_r,color_2_0_g,color_2_0_b,color_2_1_r,color_2_1_g,color_2_1_b,color_2_2_r,color_2_2_g,color_2_2_b,color_2_3_r,color_2_3_g,color_2_3_b,color_2_4_r,color_2_4_g,color_2_4_b={crop(#-2)} +old_color_0_0_r,old_color_0_0_g,old_color_0_0_b,old_color_0_1_r,old_color_0_1_g,old_color_0_1_b,old_color_0_2_r,old_color_0_2_g,old_color_0_2_b,old_color_1_0_r,old_color_1_0_g,old_color_1_0_b,old_color_1_1_r,old_color_1_1_g,old_color_1_1_b,old_color_1_2_r,old_color_1_2_g,old_color_1_2_b,old_color_1_3_r,old_color_1_3_g,old_color_1_3_b,old_color_2_0_r,old_color_2_0_g,old_color_2_0_b,old_color_2_1_r,old_color_2_1_g,old_color_2_1_b,old_color_2_2_r,old_color_2_2_g,old_color_2_2_b,old_color_2_3_r,old_color_2_3_g,old_color_2_3_b,old_color_2_4_r,old_color_2_4_g,old_color_2_4_b={crop(#-2)} +if $32!=$116||!$started mapping_info=" "{`123`}iM+1{`125`},1,1,1,lerp(0,{`123`}w#-2-1{`125`},x/(w-1))" "rep_cubic_map[-1]" "[-3]" "map[-2]" "[-1]" "rm[-3,-1] fi +else ++n. 0,255 => output ++store[-2,-1] _persistent +mapping_info=" n[-1] 0,255" +fi +keep[output] +if !$1&&$12 resize $img_width,$img_height,100%,100%,0,{$12+1},.5,.5 fi +fi +if $use_persistent +$_persistent +keep[output] +if !$1&&$12 resize $img_width,$img_height,100%,100%,0,{$12+1},.5,.5 fi +fi +uncommand fx_rep_lavander_binary_map_create_palette +if $86 selectable_cli_command_text=$cli_command_text_with_slash +else selectable_cli_command_text=$cli_command_text +fi +if $10 selectable_cli_command_text.=" rep_symmetrize_xy[-1] "{$10-1} fi +if $32 +selectable_cli_command_text..=$_color_info" permute[-1] yzcx " +fi +selectable_cli_command_text.=$mapping_info +u "{$1}""{"$pw2size"}_"{$1+1}"{$3}""{"$bin_a"}_"{$3>2?2}"{"$bin_b"}_"{$3>2?2}"{"$bin_c"}_"{$3<3?2}"{$7}""{$8}_"{($3==6)+1}"{$9}""{$10}""{$11}""{$12}_"{!$1*2}"{"$num_of_rand_bin_a_digits"}_"{$3>2?2}"{"$num_of_rand_bin_b_digits"}_"{$3>2?2}"{"$num_of_rand_bin_c_digits"}_"{$3<3?2}"{"$binary_string_a_ind_0"}_"{$3>2?$num_of_rand_bin_a_digits==1?2}"{"$binary_string_a_ind_1"}_"{$3>2?$num_of_rand_bin_a_digits==2?2}"{"$binary_string_a_ind_2"}_"{$3>2?$num_of_rand_bin_a_digits==3?2}"{"$binary_string_a_ind_3"}_"{$3>2?$num_of_rand_bin_a_digits==4?2}"{"$binary_string_b_ind_0"}_"{$3>2?$num_of_rand_bin_b_digits==1?2}"{"$binary_string_b_ind_1"}_"{$3>2?$num_of_rand_bin_b_digits==2?2}"{"$binary_string_b_ind_2"}_"{$3>2?$num_of_rand_bin_b_digits==3?2}"{"$binary_string_b_ind_3"}_"{$3>2?$num_of_rand_bin_b_digits==4?2}"{"$binary_string_c_ind_0"}_"{$3<3?$num_of_rand_bin_c_digits==1?2}"{"$binary_string_c_ind_1"}_"{$3<3?$num_of_rand_bin_c_digits==2?2}"{"$binary_string_c_ind_2"}_"{$3<3?$num_of_rand_bin_c_digits==3?2}"{"$binary_string_c_ind_3"}_"{$3<3?$num_of_rand_bin_c_digits==4?2}"{0}_"{$3>2?2}"{0}_"{$3>2?2}"{0}_"{$3>2?2}"{0}_"{$3<3?2}"{$32}""{$33}_"{$32?2}"{"$color_0_0_r","$color_0_0_g","$color_0_0_b"}_"{$32?($33==3?2)}"{"$color_0_1_r","$color_0_1_g","$color_0_1_b"}_"{$32?($33==3?2)}"{"$color_0_2_r","$color_0_2_g","$color_0_2_b"}_"{$32?($33==3?2)}"{"$color_1_0_r","$color_1_0_g","$color_1_0_b"}_"{$32?($33==4?2)}"{"$color_1_1_r","$color_1_1_g","$color_1_1_b"}_"{$32?($33==4?2)}"{"$color_1_2_r","$color_1_2_g","$color_1_2_b"}_"{$32?($33==4?2)}"{"$color_1_3_r","$color_1_3_g","$color_1_3_b"}_"{$32?($33==4?2)}"{"$color_2_0_r","$color_2_0_g","$color_2_0_b"}_"{$32?($33==5?2)}"{"$color_2_1_r","$color_2_1_g","$color_2_1_b"}_"{$32?($33==5?2)}"{"$color_2_2_r","$color_2_2_g","$color_2_2_b"}_"{$32?($33==5?2)}"{"$color_2_3_r","$color_2_3_g","$color_2_3_b"}_"{$32?($33==5?2)}"{"$color_2_4_r","$color_2_4_g","$color_2_4_b"}_"{$32?($33==5?2)}"{0}_"{$32?(($33!=$current_num_of_colors)+1)}"{$71}_"{$32?2}"{$72}_"{$32?2}"{$73}_"{$32?2}"{$74}""{$75}""{"$_fx_rep_lavander_binary_map_seed"}_"{$32?2}"{0}_"{$32?2}"{0}_"{$32?$status_of_random}"{"$status_of_random"}""{"$previous_status_of_random"}""{"$selectable_cli_command_text"}""{"$cli_command_text"}""{"$cli_command_text_with_slash"}""{"$_color_info"}""{"$mapping_info"}""{$86}""{$88}""{$88}""{1}""{$1}""{$3}""{"$bin_a"}""{"$bin_b"}""{"$bin_c"}""{"$binary_string_a_ind_0"}""{"$binary_string_a_ind_1"}""{"$binary_string_a_ind_2"}""{"$binary_string_a_ind_3"}""{"$binary_string_b_ind_0"}""{"$binary_string_b_ind_1"}""{"$binary_string_b_ind_2"}""{"$binary_string_b_ind_3"}""{"$binary_string_c_ind_0"}""{"$binary_string_c_ind_1"}""{"$binary_string_c_ind_2"}""{"$binary_string_c_ind_3"}""{$7}""{"$form_b"}""{$9}""{$10}""{$111}""{"$user_defined_size"}""{"$pw2size"}""{"$auto_size"}""{"$auto_size_sym"}""{$32}""{"$current_num_of_colors"}""{"$old_color_0_0_r","$old_color_0_0_g","$old_color_0_0_b"}""{"$old_color_0_1_r","$old_color_0_1_g","$old_color_0_1_b"}""{"$old_color_0_2_r","$old_color_0_2_g","$old_color_0_2_b"}""{"$old_color_1_0_r","$old_color_1_0_g","$old_color_1_0_b"}""{"$old_color_1_1_r","$old_color_1_1_g","$old_color_1_1_b"}""{"$old_color_1_2_r","$old_color_1_2_g","$old_color_1_2_b"}""{"$old_color_1_3_r","$old_color_1_3_g","$old_color_1_3_b"}""{"$old_color_2_0_r","$old_color_2_0_g","$old_color_2_0_b"}""{"$old_color_2_1_r","$old_color_2_1_g","$old_color_2_1_b"}""{"$old_color_2_2_r","$old_color_2_2_g","$old_color_2_2_b"}""{"$old_color_2_3_r","$old_color_2_3_g","$old_color_2_3_b"}""{"$old_color_2_4_r","$old_color_2_4_g","$old_color_2_4_b"}""{"$previous_shade"}""{"$previous_lightness"}""{"$previous_darkness"}""{$157}""{$158}""{"$_fx_rep_lavander_binary_map_seed"}""{$160}" +rep_logpindis_gui: +rep_logpindis $1,{(($2/100)-.5)*2},{(($3/100)-.5)*-2},{(($4/100)-.5)*2},{(($5/100)-.5)*-2},${6-18} +rep_logpindis_gui_preview: +gui_split_preview "rep_logpindis_gui $*",${-3--1} +gui_rep_majority: +rep_major $3,$4,$1,$2 +if $5 to_graya fi +gui_rep_majority_preview: +gui_split_preview "gui_rep_majority ${1-5}",${-3--1} +gui_rep_majority_threshold: +rep_major_t $3,$4%,$5,$6,$1,$2 +if $7 to_graya fi +gui_rep_majority_threshold_preview: +gui_split_preview "gui_rep_majority_threshold ${1-7}",${-3--1} +fx_rep_mlfrac: +skip "${39=}","${40=}","${41=}" +srand $19 +set_main_arg=${1-3},$4%,$5%,{100-$6}%,$7% +timg={$!} +if $8==0 +rep_markus_lyapunov_fractal[0] $set_main_arg,$9 n 0,255 if $timg>1 f[^0] I#0 fi +elif $8==1 +hex_col_a=${rep_int82hex\ ${10-13}} +hex_col_b=${rep_int82hex\ ${14-17}} +rep_markus_lyapunov_fractal[0] $set_main_arg,$hex_col_a,$hex_col_b +if $timg>1 f[^0] I#0 fi +elif $8==2 +if $18 rep_markus_lyapunov_fractal[0] $set_main_arg,u,u,${21-23} +else rep_markus_lyapunov_fractal[0] $set_main_arg,u,$20,$23 +fi +if $timg>1 f[^0] I#0 fi +elif $8==3 +if $18 ++pal $26 ++pal $28 +rep_markus_lyapunov_fractal[0] $set_main_arg,[-2],[-1],$27,$29 +rm[-2,-1] +if $timg>1 f[^0] I#0 fi +else ++pal $24 +rep_markus_lyapunov_fractal[0] $set_main_arg,[-1],$25 +rm. +if $timg>1 f[^0] I#0 fi +fi +else +if $timg==2||$timg==3 +if $36 rv fi +if $timg==2 +rep_markus_lyapunov_fractal[0] $set_main_arg,[1],$31,$30 +else +if $37 rv[^0] fi +rep_markus_lyapunov_fractal[0] $set_main_arg,[1],[2],$33,$35,$32,$34 +fi +else +error "Invalid number of layer(s) for this mode. 2 or 3 Layers Only!" +fi +fi +use_time=${} +set_a_1={$8==1?2} +set_a_2={$8==2?2} +set_a_3={$8==2&&$18==1?2} +set_b_1={($8==2&&$18==0)?2} +set_b_2={($8==2&&$18==1)?2} +set_c_1={($8==3&&$18==0)?2} +set_c_2={($8==3&&$18==1)?2} +set_d_1={$8==4&&$timg==2?2} +set_d_2={$8==4&&$timg==3?2} +u "{$1}""{$2}""{$3}""{$4}""{$5,$6}""{$7}_"$use_time"{$8}""{$9}_"{!$8?2}"{$10,$11,$12,$13}_"$set_a_1"{$14,$15,$16,$17}_"$set_a_1"{$18}_"{$8>1&&$8<4?2}"{$19}_"{$8==2?2:$8==3?($18?(($27==1||$29==1)?2:1):($25==1?2:1)):$8==4?($timg==3?(($33==1||$35==1)?2:1):($31==1?2:1))}"{$20}_"{$8==2&&$18==0?2}"{$21}_"$set_a_3"{$22}_"$set_a_3"{$23}_"$set_a_2"{$24}_"$set_c_1"{$25}_"$set_c_1"{$26}_"$set_c_2"{$27}_"$set_c_2"{$28}_"$set_c_2"{$29}_"$set_c_2"{$30}_"$set_d_1"{$31}_"$set_d_1"{$32}_"$set_d_2"{$33}_"$set_d_2"{$34}_"$set_d_2"{$35}_"$set_d_2"{$36}_"{$8==4?2}"{$37}_"$set_d_2"{$38}""{$39}""{$40}""{$41}""{$42}""{$43}""{$44}""{$45}""{$46}""{$47}""{$48}""{$49}" +fx_rep_mitchell_concatenation: +_fx_rep_mitchell_concatenation_base $* +fx_rep_mitchell_concatenation_preview: +niw,nih,ms=$_preview_width,${-max_h},${-max_h} +rm +$niw,$nih,1,$ms +_fx_rep_mitchell_concatenation_base $* +r 100%,$_preview_height,100%,100%,0,0,.5,.5 +_fx_rep_mitchell_concatenation_base: +original_dimension:=[w,h] +multiple_images:=$!>1 +pixels:=max(1,round(h*$2%)) +enabl_mode_double_concatenation:=$pixels>=4 +ini_double_concatenation_mode:=$enabl_mode_double_concatenation?$1 +double_concatenation_mode=0 +start_0=$4 +if $105 +start_0:=max(1,($8^($102+1))-int(h/($pixels*2))) +fi +start_a,start_b=${5-6} +if $7&&$ini_double_concatenation_mode +if $5!=$109 start_a,start_b=$5 fi +if $6!=$110 start_a,start_b=$6 fi +fi +base_a,base_b=${9-10} +if $11&&$ini_double_concatenation_mode +if $9!=$111 base_a,base_b=$9 fi +if $10!=$112 base_a,base_b=$10 fi +fi +method_a,method_b=${13-14} +if $15&&$ini_double_concatenation_mode +if $13!=$113 method_a,method_b=$13 fi +if $14!=$114 method_a,method_b=$14 fi +fi +if $ini_double_concatenation_mode +double_concatenation_mode:=(($start_a!=$start_b)||($base_a!=$base_b)||($method_a!=$method_b))?1 +fi +if $double_concatenation_mode +diff:=int(h/($pixels*2)) +if $106||$108 +start_a:=max(1,($base_a^($103+1))-$diff) +fi +if $107||$108 +start_b:=max(1,($base_b^($104+1))-$diff) +fi +if $ini_double_concatenation_mode +double_concatenation_mode:=(($start_a!=$start_b)||($base_a!=$base_b)||($method_a!=$method_b))?1 +fi +fi +if $81 +if $double_concatenation_mode&&$16 +if sum(abs([${39-59}]-[${136-156}]))?1 +col_0_r_0,col_0_g_0,col_0_b_0,col_0_r_1,col_0_g_1,col_0_b_1,col_0_r_2,col_0_g_2,col_0_b_2,col_0_r_3,col_0_g_3,col_0_b_3,col_0_r_4,col_0_g_4,col_0_b_4,col_0_r_5,col_0_g_5,col_0_b_5,col_0_r_6,col_0_g_6,col_0_b_6=${39-59} +col_a_r_0,col_a_g_0,col_a_b_0,col_a_r_1,col_a_g_1,col_a_b_1,col_a_r_2,col_a_g_2,col_a_b_2,col_a_r_3,col_a_g_3,col_a_b_3,col_a_r_4,col_a_g_4,col_a_b_4,col_a_r_5,col_a_g_5,col_a_b_5,col_a_r_6,col_a_g_6,col_a_b_6=${39-59} +col_b_r_0,col_b_g_0,col_b_b_0,col_b_r_1,col_b_g_1,col_b_b_1,col_b_r_2,col_b_g_2,col_b_b_2,col_b_r_3,col_b_g_3,col_b_b_3,col_b_r_4,col_b_g_4,col_b_b_4,col_b_r_5,col_b_g_5,col_b_b_5,col_b_r_6,col_b_g_6,col_b_b_6=${39-59} +elif sum(abs([${60-80}]-[${157-177}]))?1 +col_0_r_0,col_0_g_0,col_0_b_0,col_0_r_1,col_0_g_1,col_0_b_1,col_0_r_2,col_0_g_2,col_0_b_2,col_0_r_3,col_0_g_3,col_0_b_3,col_0_r_4,col_0_g_4,col_0_b_4,col_0_r_5,col_0_g_5,col_0_b_5,col_0_r_6,col_0_g_6,col_0_b_6=${60-80} +col_a_r_0,col_a_g_0,col_a_b_0,col_a_r_1,col_a_g_1,col_a_b_1,col_a_r_2,col_a_g_2,col_a_b_2,col_a_r_3,col_a_g_3,col_a_b_3,col_a_r_4,col_a_g_4,col_a_b_4,col_a_r_5,col_a_g_5,col_a_b_5,col_a_r_6,col_a_g_6,col_a_b_6=${60-80} +col_b_r_0,col_b_g_0,col_b_b_0,col_b_r_1,col_b_g_1,col_b_b_1,col_b_r_2,col_b_g_2,col_b_b_2,col_b_r_3,col_b_g_3,col_b_b_3,col_b_r_4,col_b_g_4,col_b_b_4,col_b_r_5,col_b_g_5,col_b_b_5,col_b_r_6,col_b_g_6,col_b_b_6=${60-80} +else +col_0_r_0,col_0_g_0,col_0_b_0,col_0_r_1,col_0_g_1,col_0_b_1,col_0_r_2,col_0_g_2,col_0_b_2,col_0_r_3,col_0_g_3,col_0_b_3,col_0_r_4,col_0_g_4,col_0_b_4,col_0_r_5,col_0_g_5,col_0_b_5,col_0_r_6,col_0_g_6,col_0_b_6=${18-38} +col_a_r_0,col_a_g_0,col_a_b_0,col_a_r_1,col_a_g_1,col_a_b_1,col_a_r_2,col_a_g_2,col_a_b_2,col_a_r_3,col_a_g_3,col_a_b_3,col_a_r_4,col_a_g_4,col_a_b_4,col_a_r_5,col_a_g_5,col_a_b_5,col_a_r_6,col_a_g_6,col_a_b_6=${39-59} +col_b_r_0,col_b_g_0,col_b_b_0,col_b_r_1,col_b_g_1,col_b_b_1,col_b_r_2,col_b_g_2,col_b_b_2,col_b_r_3,col_b_g_3,col_b_b_3,col_b_r_4,col_b_g_4,col_b_b_4,col_b_r_5,col_b_g_5,col_b_b_5,col_b_r_6,col_b_g_6,col_b_b_6=${60-80} +fi +else +if sum(abs([${18-38}]-[${115-135}]))?1 +col_0_r_0,col_0_g_0,col_0_b_0,col_0_r_1,col_0_g_1,col_0_b_1,col_0_r_2,col_0_g_2,col_0_b_2,col_0_r_3,col_0_g_3,col_0_b_3,col_0_r_4,col_0_g_4,col_0_b_4,col_0_r_5,col_0_g_5,col_0_b_5,col_0_r_6,col_0_g_6,col_0_b_6=${18-38} +col_a_r_0,col_a_g_0,col_a_b_0,col_a_r_1,col_a_g_1,col_a_b_1,col_a_r_2,col_a_g_2,col_a_b_2,col_a_r_3,col_a_g_3,col_a_b_3,col_a_r_4,col_a_g_4,col_a_b_4,col_a_r_5,col_a_g_5,col_a_b_5,col_a_r_6,col_a_g_6,col_a_b_6=${18-38} +col_b_r_0,col_b_g_0,col_b_b_0,col_b_r_1,col_b_g_1,col_b_b_1,col_b_r_2,col_b_g_2,col_b_b_2,col_b_r_3,col_b_g_3,col_b_b_3,col_b_r_4,col_b_g_4,col_b_b_4,col_b_r_5,col_b_g_5,col_b_b_5,col_b_r_6,col_b_g_6,col_b_b_6=${18-38} +else +col_0_r_0,col_0_g_0,col_0_b_0,col_0_r_1,col_0_g_1,col_0_b_1,col_0_r_2,col_0_g_2,col_0_b_2,col_0_r_3,col_0_g_3,col_0_b_3,col_0_r_4,col_0_g_4,col_0_b_4,col_0_r_5,col_0_g_5,col_0_b_5,col_0_r_6,col_0_g_6,col_0_b_6=${18-38} +col_a_r_0,col_a_g_0,col_a_b_0,col_a_r_1,col_a_g_1,col_a_b_1,col_a_r_2,col_a_g_2,col_a_b_2,col_a_r_3,col_a_g_3,col_a_b_3,col_a_r_4,col_a_g_4,col_a_b_4,col_a_r_5,col_a_g_5,col_a_b_5,col_a_r_6,col_a_g_6,col_a_b_6=${39-59} +col_b_r_0,col_b_g_0,col_b_b_0,col_b_r_1,col_b_g_1,col_b_b_1,col_b_r_2,col_b_g_2,col_b_b_2,col_b_r_3,col_b_g_3,col_b_b_3,col_b_r_4,col_b_g_4,col_b_b_4,col_b_r_5,col_b_g_5,col_b_b_5,col_b_r_6,col_b_g_6,col_b_b_6=${60-80} +fi +fi +else +col_0_r_0,col_0_g_0,col_0_b_0,col_0_r_1,col_0_g_1,col_0_b_1,col_0_r_2,col_0_g_2,col_0_b_2,col_0_r_3,col_0_g_3,col_0_b_3,col_0_r_4,col_0_g_4,col_0_b_4,col_0_r_5,col_0_g_5,col_0_b_5,col_0_r_6,col_0_g_6,col_0_b_6=${18-38} +col_a_r_0,col_a_g_0,col_a_b_0,col_a_r_1,col_a_g_1,col_a_b_1,col_a_r_2,col_a_g_2,col_a_b_2,col_a_r_3,col_a_g_3,col_a_b_3,col_a_r_4,col_a_g_4,col_a_b_4,col_a_r_5,col_a_g_5,col_a_b_5,col_a_r_6,col_a_g_6,col_a_b_6=${39-59} +col_b_r_0,col_b_g_0,col_b_b_0,col_b_r_1,col_b_g_1,col_b_b_1,col_b_r_2,col_b_g_2,col_b_b_2,col_b_r_3,col_b_g_3,col_b_b_3,col_b_r_4,col_b_g_4,col_b_b_4,col_b_r_5,col_b_g_5,col_b_b_5,col_b_r_6,col_b_g_6,col_b_b_6=${60-80} +fi +if $double_concatenation_mode +if $16 +dyn_single_palette,dyn_dual_palette=0,2 +($col_a_r_0,$col_a_g_0,$col_a_b_0) +($col_a_r_1,$col_a_g_1,$col_a_b_1) +($col_a_r_2,$col_a_g_2,$col_a_b_2) +($col_a_r_3,$col_a_g_3,$col_a_b_3) +($col_a_r_4,$col_a_g_4,$col_a_b_4) +($col_a_r_5,$col_a_g_5,$col_a_b_5) +($col_a_r_6,$col_a_g_6,$col_a_b_6) +a[-7--1] y permute. cyzx rotate. 90 +($col_b_r_0,$col_b_g_0,$col_b_b_0) +($col_b_r_1,$col_b_g_1,$col_b_b_1) +($col_b_r_2,$col_b_g_2,$col_b_b_2) +($col_b_r_3,$col_b_g_3,$col_b_b_3) +($col_b_r_4,$col_b_g_4,$col_b_b_4) +($col_b_r_5,$col_b_g_5,$col_b_b_5) +($col_b_r_6,$col_b_g_6,$col_b_b_6) +a[-7--1] y permute. cyzx rotate. 90 +if $84&&$multiple_images +use_shape=1 +rep_mitchell_concatenation[0--4] $start_a,$start_b,$base_a,$base_b,$method_a,$method_b,$pixels,[-2],[-1],1,[-3],{$85/100},${86-89},1 +else +use_shape=2 +set_arg=1 +if $83==6 set_arg.=,${90-91} +elif $83==8 set_arg.=,$93%,0,1,$92 +elif $83==10 set_arg.=,${94-97} +elif $83==20 set_arg.=,$98 +elif $83==23 set_arg.=,$99 +elif $83==24 set_arg.=,$100,{$101/100} +fi +rep_mitchell_concatenation[0--3] $start_a,$start_b,$base_a,$base_b,$method_a,$method_b,$pixels,[-2],[-1],1,$83,{$85/100},${86-89},$set_arg +fi +rm[-2,-1] +else +dyn_single_palette,dyn_dual_palette=2,0 +($col_0_r_0,$col_0_g_0,$col_0_b_0) +($col_0_r_1,$col_0_g_1,$col_0_b_1) +($col_0_r_2,$col_0_g_2,$col_0_b_2) +($col_0_r_3,$col_0_g_3,$col_0_b_3) +($col_0_r_4,$col_0_g_4,$col_0_b_4) +($col_0_r_5,$col_0_g_5,$col_0_b_5) +($col_0_r_6,$col_0_g_6,$col_0_b_6) +a[-7--1] y permute. cyzx rotate. 90 +if $84&&$multiple_images +use_shape=1 +rep_mitchell_concatenation[0--3] $start_a,$start_b,$base_a,$base_b,$method_a,$method_b,$pixels,[-1],,1,[-2],{$85/100},${86-89},1 +else +use_shape=2 +set_arg=1 +if $83==6 set_arg.=,${90-91} +elif $83==8 set_arg.=,$93%,0,1,$92 +elif $83==10 set_arg.=,${94-97} +elif $83==20 set_arg.=,$98 +elif $83==23 set_arg.=,$99 +elif $83==24 set_arg.=,$100,{$101/100} +fi +rep_mitchell_concatenation[0--2] $start_a,$start_b,$base_a,$base_b,$method_a,$method_b,$pixels,[-1],,1,$83,{$85/100},${86-89},$set_arg +fi +rm. +fi +else +dyn_single_palette,dyn_dual_palette=2,0 +($col_0_r_0,$col_0_g_0,$col_0_b_0) +($col_0_r_1,$col_0_g_1,$col_0_b_1) +($col_0_r_2,$col_0_g_2,$col_0_b_2) +($col_0_r_3,$col_0_g_3,$col_0_b_3) +($col_0_r_4,$col_0_g_4,$col_0_b_4) +($col_0_r_5,$col_0_g_5,$col_0_b_5) +($col_0_r_6,$col_0_g_6,$col_0_b_6) +a[-7--1] y permute. cyzx rotate. 90 +if $82 +if $84&&$multiple_images +use_shape=1 +rep_mitchell_concatenation[0--3] $start_0,$start_0,$8,$8,$12,$12,$pixels,[-1],,1,[-2],{$85/100},${86-89},1 +else +use_shape=2 +set_arg=1 +if $83==6 set_arg.=,${90-91} +elif $83==8 set_arg.=,$93%,0,1,$92 +elif $83==10 set_arg.=,${94-97} +elif $83==20 set_arg.=,$98 +elif $83==23 set_arg.=,$99 +elif $83==24 set_arg.=,$100,{$101/100} +fi +rep_mitchell_concatenation[0--2] $start_0,$start_0,$8,$8,$12,$12,$pixels,[-1],,1,$83,{$85/100},${86-89},$set_arg +fi +else +use_shape=0 +rep_mitchell_concatenation[0--2] $start_0,$start_0,$8,$8,$12,$12,$pixels,[-1] +fi +rm. +fi +if $3 r $original_dimension,100%,100%,0,0,1,.5 fi +enabl_duo_opt:=$pixels>=4?2:1 +cond_ini_double_concatenation:=$ini_double_concatenation_mode?2 +cond_not_ini_double_concatenation:=!$ini_double_concatenation_mode?2 +cond_double_concatenation:=$double_concatenation_mode?2 +cond_not_double_concatenation:=!$double_concatenation_mode?2 +use_foreground:=$dyn_dual_palette?(!$17?2) +use_background:=$dyn_dual_palette?($17?2) +cond_mul_img:=$multiple_images?2 +act_use_shape:=$use_shape?2 +enab_dyn_shape:=$use_shape==2 +use_dragon_curve:=$enab_dyn_shape?$83==6?2 +use_fern:=$enab_dyn_shape?$83==8?2 +use_gear:=$enab_dyn_shape?$83==10?2 +use_polygon:=$enab_dyn_shape?$83==20?2 +use_snowflake:=$enab_dyn_shape?$83==23?2 +use_star:=$enab_dyn_shape?$83==24?2 +u "{$1}_"$enabl_duo_opt"{$2}""{$3}""{"$start_0"}_"$cond_not_ini_double_concatenation"{"$start_a"}_"$cond_ini_double_concatenation"{"$start_b"}_"$cond_ini_double_concatenation"{$7}_"$cond_ini_double_concatenation"{$8}_"$cond_not_ini_double_concatenation"{"$base_a"}_"$cond_ini_double_concatenation"{"$base_b"}_"$cond_ini_double_concatenation"{$11}_"$cond_ini_double_concatenation"{$12}_"$cond_not_ini_double_concatenation"{"$method_a"}_"$cond_ini_double_concatenation"{"$method_b"}_"$cond_ini_double_concatenation"{$15}_"$cond_ini_double_concatenation"{$16}_"$cond_double_concatenation"{$17}_"$dyn_dual_palette"{"$col_0_r_0","$col_0_g_0","$col_0_b_0"}_"$dyn_single_palette"{"$col_0_r_1","$col_0_g_1","$col_0_b_1"}_"$dyn_single_palette"{"$col_0_r_2","$col_0_g_2","$col_0_b_2"}_"$dyn_single_palette"{"$col_0_r_3","$col_0_g_3","$col_0_b_3"}_"$dyn_single_palette"{"$col_0_r_4","$col_0_g_4","$col_0_b_4"}_"$dyn_single_palette"{"$col_0_r_5","$col_0_g_5","$col_0_b_5"}_"$dyn_single_palette"{"$col_0_r_6","$col_0_g_6","$col_0_b_6"}_"$dyn_single_palette"{"$col_a_r_0","$col_a_g_0","$col_a_b_0"}_"$use_foreground"{"$col_a_r_1","$col_a_g_1","$col_a_b_1"}_"$use_foreground"{"$col_a_r_2","$col_a_g_2","$col_a_b_2"}_"$use_foreground"{"$col_a_r_3","$col_a_g_3","$col_a_b_3"}_"$use_foreground"{"$col_a_r_4","$col_a_g_4","$col_a_b_4"}_"$use_foreground"{"$col_a_r_5","$col_a_g_5","$col_a_b_5"}_"$use_foreground"{"$col_a_r_6","$col_a_g_6","$col_a_b_6"}_"$use_foreground"{"$col_b_r_0","$col_b_g_0","$col_b_b_0"}_"$use_background"{"$col_b_r_1","$col_b_g_1","$col_b_b_1"}_"$use_background"{"$col_b_r_2","$col_b_g_2","$col_b_b_2"}_"$use_background"{"$col_b_r_3","$col_b_g_3","$col_b_b_3"}_"$use_background"{"$col_b_r_4","$col_b_g_4","$col_b_b_4"}_"$use_background"{"$col_b_r_5","$col_b_g_5","$col_b_b_5"}_"$use_background"{"$col_b_r_6","$col_b_g_6","$col_b_b_6"}_"$use_background"{$81}""{$82}_"$cond_not_double_concatenation"{$83}_"$use_shape"{$84}_"$cond_mul_img"{$85}_"$act_use_shape"{$86}_"$act_use_shape"{$87}_"$act_use_shape"{$88}_"$act_use_shape"{$89}_"$act_use_shape"{$90}_"$use_dragon_curve"{$91}_"$use_dragon_curve"{$92}_"$use_fern"{$93}_"$use_fern"{$94}_"$use_gear"{$95}_"$use_gear"{$96}_"$use_gear"{$97}_"$use_gear"{$98}_"$use_polygon"{$99}_"$use_snowflake"{$100}_"$use_star"{$101}_"$use_star"{$102}_"$cond_not_double_concatenation"{$103}_"$cond_double_concatenation"{$104}_"$cond_double_concatenation"{0}_"$cond_not_double_concatenation"{0}_"$cond_double_concatenation"{0}_"$cond_double_concatenation"{0}_"$cond_double_concatenation"{"$start_a"}""{"$start_b"}""{"$base_a"}""{"$base_b"}""{"$method_a"}""{"$method_b"}""{"$col_0_r_0","$col_0_g_0","$col_0_b_0"}""{"$col_0_r_1","$col_0_g_1","$col_0_b_1"}""{"$col_0_r_2","$col_0_g_2","$col_0_b_2"}""{"$col_0_r_3","$col_0_g_3","$col_0_b_3"}""{"$col_0_r_4","$col_0_g_4","$col_0_b_4"}""{"$col_0_r_5","$col_0_g_5","$col_0_b_5"}""{"$col_0_r_6","$col_0_g_6","$col_0_b_6"}""{"$col_a_r_0","$col_a_g_0","$col_a_b_0"}""{"$col_a_r_1","$col_a_g_1","$col_a_b_1"}""{"$col_a_r_2","$col_a_g_2","$col_a_b_2"}""{"$col_a_r_3","$col_a_g_3","$col_a_b_3"}""{"$col_a_r_4","$col_a_g_4","$col_a_b_4"}""{"$col_a_r_5","$col_a_g_5","$col_a_b_5"}""{"$col_a_r_6","$col_a_g_6","$col_a_b_6"}""{"$col_b_r_0","$col_b_g_0","$col_b_b_0"}""{"$col_b_r_1","$col_b_g_1","$col_b_b_1"}""{"$col_b_r_2","$col_b_g_2","$col_b_b_2"}""{"$col_b_r_3","$col_b_g_3","$col_b_b_3"}""{"$col_b_r_4","$col_b_g_4","$col_b_b_4"}""{"$col_b_r_5","$col_b_g_5","$col_b_b_5"}""{"$col_b_r_6","$col_b_g_6","$col_b_b_6"}" +fx_rep_nebulous: +convert_colors=${arg\ 1+$1,to_rgb,ryb2rgb,hsi82rgb,hsl82rgb,hsv82rgb,lab82rgb,lch82rgb,yiq82rgb,yuv82rgb,xyz82rgb,yes82rgb,k182rgb,ohta82rgb,ycocgr2rgb} +foreach { +rep_nebulous ${2-8},{$1>4&&$1<9?$9+180:$9},{$10*$11},${12-16},{$1>4&&$1<9?$17!=0?($17>=3?3+(4-$17):1+(2-$17)):$17},{$18+1},$19 + 1 * 127.5 +if $1&&$16 +$convert_colors. +fi +if $16==1 +s c,{if(s==4,-3,if(s==2,-1,-s))} +if $!==2 +to_gray.. a c +else +to_gray +fi +fi +} +fx_rep_nebulous_preview: +fx_rep_nebulous $* +fx_ncee: +foreach { rep_ncee $3,$2,$5,$6,{$4/100},$7,$1,$8,{$9/100} } +fx_ncee_preview: +gui_split_preview "fx_ncee $*",${-3--1} +fx_rep_rpgtiler_noniso: +skip ${3=""} +ww={w} +hh={h} +if '$_host'=='paintdotnet' if $20 +store. pdnimage fi fi +if $2 fileloc="$3" fi +if $16 if $8 rv[^0] else rv fi fi +if $8 blend[^0] alpha +else blend alpha +fi +if $2 i $fileloc +else rep_tileset_n $1 +fi +if $8 +if $10 rep_tiler_n[-2] [-1],${4-7},[0],$9,${11-15} +else rep_tiler_n[-2] [-1],${4-7},[0],$9,,,,${14-15} +fi +k[-2] +else +if $10 rep_tiler_n[-2] [-1],${4-7},,$9,${11-15} +else rep_tiler_n[-2] [-1],${4-7},,$9,,,,${14-15} +fi +k[-2] +fi +if '$_host'=='paintdotnet' if $20 filename="$21/$22" o[0] $filename rm $pdnimage +else +r $ww,$hh,100%,100%,0,0,.5,.5 +fi fi +fx_rep_rpgtiler_noniso_preview: +skip ${3=""} +if $2 fileloc="$3" fi +ww={w} +hh={h} +if $16 rv fi +if $17 f 0 fi +blend alpha +if !$19 +store. bg +if $2 i $fileloc +else rep_tileset_n $1 +fi +tw={w#-1} +th={h#-1} +r. $ww,$hh,100%,100%,0,0 +shift. {floor((w/$4)/2)*$4-(floor($tw/$4/2)-(!$tw%2?1))*$4},{floor((h/$4)/2)*$4-(floor($th/$4/2)-($th%2?1))*$4} +if !$17 $bg rv blend alpha fi +fi +if $10 +drgba ${11-13} +else +drgba +fi +if $18 +f " +begin( +const psx=floor((w/2)/$4)*$4; +const psy=floor((h/2)/$4)*$4; +const border=2; +const border_left=psx+border; +const border_right=psx+$4-border; +const border_up=psy+border; +const border_down=psy+$4-border; +const boundx=psx+$4; +const boundy=psy+$4; +); +tracker=(x>psx&&xpsy&&y=border_right)||(y<=border_up||y>=border_down)?(xor($15,i)>128?0:255):i):i; +grid=!(((x%$4)==0||(y%$4)==0)||(x==(w-1)||y==(h-1)))?tracker:$14; +" +fi +if '$_host'=='paintdotnet' pdn=1 else pdn=0 fi +u "{$1}_"{!$2?2:1}"{$2}""{$3}_"{$2?2:1}"{$4}""{$5}""{$6}""{$7}""{$8}""{$9}""{$10}""{$11,$12,$13}_"{$10?2:1}"{$14}""{$15}""{$16}_"{!$pdn?2:0}"{$17}""{$18}""{$19}""{$20}_"{$pdn?2:0}"{$21}_"{$pdn?($20?2:1):0}"{$22}_"{$pdn?($20?2:1):0} +gui_rep_sptbwgp_recpoltrans: +position={$1%} +influence={$2%} +threshold={$3%*255} +px={(($4-50)*2)/100} +py={(($5-50)*-2)/100} +rep_sptbwgp_recpoltrans $position,$influence,$threshold,$px,$py +gui_rep_sptbwgp_recpoltrans_preview: +gui_split_preview "gui_rep_sptbwgp_recpoltrans ${1-5}",${-3--1} +gui_rep_objvf: +if $7 preserve_choice={($6+1)*-1} +else preserve_choice=$5 +fi +if !$1 +foreach { +colour={vectors(${8-11})} +if s==2||s>3 +ss={s-1} +colour={vector$ss(${8-11})} +sh {s-1} +maxalp={iM#-1} ++f. i#-1?1 +sumnalp={1-(is#-1/wh#-1)} +rm. +if $sumnalp>$2% +rm. +rep_objvf $3%,$4%,$preserve_choice +else +if !iv#-1 +alp=$maxalp +else +alp=0 +fi +rm. +rep_objvf $3%,$4%,$preserve_choice,$colour,$alp +fi +else +colour={vectors(${8-11})} +rep_objvf $3%,$4%,$preserve_choice,$colour +fi +} +elif $1==1 +rep_objvf $3%,$4%,$preserve_choice +else +colour={vectors(${8-11})} +rep_objvf $3%,$4%,$preserve_choice,$colour +fi +gui_rep_objvf_preview: +show_colour,current_layer=0 +if !$1 +do +local[$current_layer] { +if s==2||s>3 +{w},{h},100%,1,i(#-1,x,y,z,s-1)?1 +sumnalp={1-(is#-1/wh#-1)} +if $1>$2% show_colour=1 fi +rm. +fi +} +current_layer+=1 +while !$show_colour&&$current_layer<$! +elif $1==2 show_colour=1 +fi +if $16==2 channels {s-1} +elif $16==1 channels 0,{s-2} +else +if $12 ++gui_rep_objvf ${1-11} +f begin(ss={s-1};);if(i(x,y,z,ss),i,0); +f.. I!=I#-1?[${13-15},255]:I +else +gui_rep_objvf ${1-11} +fi +fi +u "{$1}""{$2}"_{!$1?2:0}"{$3}""{$4}""{$5}"_{!$7?2:0}"{$6}"_{$7?2:0}"{$7}""{$8,$9,$10,$11}"_{$show_colour?2:0}"{$12}"_{!$16?2:1}"{$13,$14,$15}"_{($12&&!$16)?2:1}"{$16}""{$17}"_0 +fx_rep_loupasc_ordered_dither: +foreach { +if $3 +to_graya sh. 0 rep_loupasc_ordered_dither. $1,$2 rm. +else +sh. 0,2 rep_loupasc_ordered_dither. $1,$2 rm. +fi +} +fx_rep_loupasc_ordered_dither_preview: +gui_split_preview "fx_rep_loupasc_ordered_dither ${1-3}",${-3--1} +rep_fx_shift: f "begin(const ox=($1-50)/100*(w-1);const oy=($2-50)/100*(h-1);); +i(x-ox,y-oy,z,c,$4,$3);" +rep_fx_shift_preview: gui_split_preview "rep_fx_shift ${1-4}",${-3--1} +gui_rep_perspective_streak: +px={(($1-50)*2)/100} +py={(($2-50)*-2)/100} +if $px<-1 px=-1 +elif $px>1 px=1 +fi +if $py<-1 px=-1 +elif $py>1 px=1 +fi +rep_pstrk $px,$py,$3%,$4%,$5%,$6,$7,$8,255 +if $7 * 255 fi +gui_rep_perspective_streak_preview: +gui_split_preview "gui_rep_perspective_streak ${1-8}",${-3--1} +u "{$1,$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}_"{$7!=2?2:1}"{$9,$10}""{$11}" +fx_rep_photomosaic: +fileloc="$2" +filename="$12/$13" +ww={w} +hh={h} +if '$_host'=='paintdotnet' +k[0] ig $fileloc rep_photomosaic[0] [^0],$4,$5,{$6/100},${7-9} k[0] +if $11==0||$11==2 o[0] $filename fi +if $11 r $ww,$hh,100%,100%,0,0,.5,.5 fi +else +if ($!>2)&&!$1 +if $3 rv fi rep_photomosaic[0] [^0],$4,$5,{$6/100},${7-9} if !$3 k[0] fi +else +imgs={$!} ig $fileloc rep_photomosaic[0-{$imgs-1}] [$imgs--1],$4,$5,{$6/100},${7-9} k[0-{$imgs-1}] +fi +if $10 r $ww,$hh,100%,100%,0,0,.5,.5 fi +fi +fx_rep_photomosaic_preview: +if '$_host'=='paintdotnet' pdn=1 else pdn=0 fi +imgs={$!} +fx_rep_photomosaic $1,"$2",${3-11},"$12","$13" +a={$pdn?($11==0||$11==2?2:1)} +u "{$1}_"{!$pdn?($imgs<2?1:2)}"{$2}_"{!$pdn?($imgs>2?($1?2:1):2):2}"{$3}_"{!$pdn?($imgs>2?(!$1?2:1):2)}"{$4}""{$5}""{$6}""{$7}""{$8}""{$9}""{$10}_"{!$pdn?2}"{$11}_"{$pdn?2}"{$12}_"$a"{$13}_"$a +fx_rep_pxpush: rep_pxpush {($1/100-.5)*2},{($2/100-.5)*2} +fx_pxpush_preview: gui_split_preview "fx_rep_pxpush $*",${-3--1} +gui_rep_pw: +rep_pw $1%,$2%,$3%,{($4/100-.5)*2},{($5/100-.5)*-2},$6,$7 +gui_rep_pw_preview: +gui_split_preview "gui_rep_pw ${1-7}",${-3--1} +fx_rep_pfrac: +ox={(($7-50)/100)*2} +oy={(($8-50)/100)*-2} +setarg=${1-6},$ox,$oy +midpoint_shift={1-abs($20)} +if $10 +if $9 setarg2=${17-19} +else setarg2=$17,$19 +fi +else +if $9 setarg2=${11-16} +else setarg2=$11,$13,$14,$16 +fi +fi +local[0] { +rep_pfrac $setarg,$9,$setarg2 +val_max={iM} +n 0,1 +if $20>=0 f i^$midpoint_shift +else f 1-((1-i)^$midpoint_shift) +fi +if $22 n 0,255 +else * {$21*$val_max} +fi +} +fx_rep_pfrac_preview: +fx_rep_pfrac ${1-22} +if $23 ++f[0] i>0?1 +fillperc={ia*100} rm. +fillperc_l={int($fillperc)} +fillperc_r={int(($fillperc-$fillperc_l)*100)} +fillratio=$fillperc_l +fillratio.=. +fillratio.=$fillperc_r +fillratio.=% +to[0] $fillratio,.5~,.5~,18% +fi +k[0] +a={!$10?2:0} +b={$10?2:0} +c={!$10?($9?2:0):0} +d={$10?($9?2:0):0} +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7,$8}""{$9}""{$10}""{$11}_"$a"{$12}_"$c"{$13}_"$a"{$14}_"$a"{$15}_"$c"{$16}_"$a"{$17}_"$b"{$18}_"$d"{$19}_"$b"{$20}""{$21}_"{$22?1:2}"{$22}""{$23}" +fx_rep_pfrac_t_rs: +if $10 +if $11 +if $26==2 set_arg_a=$26,${30-32} +elif $26==1 set_arg_a=$26,${28-29} +else set_arg_a=${26-27} +fi +if $33==2 set_arg_b=$33,${37-39} +elif $33==1 set_arg_b=$33,${35-36} +else set_arg_b=${33-34} +fi +if $40==2 set_arg_c=$40,${44-46} +elif $40==1 set_arg_c=$40,${42-43} +else set_arg_c=${40-41} +fi +set_arg_d=$set_arg_a +set_arg_e=$set_arg_b +set_arg_f=$set_arg_c +else +if $62==2 set_arg_a=$62,${66-68} +elif $62==1 set_arg_a=$62,${64-65} +else set_arg_a=${62-63} +fi +if $69==2 set_arg_b=$69,${73-75} +elif $69==1 set_arg_b=$69,${71-72} +else set_arg_b=${69-70} +fi +if $76==2 set_arg_c=$76,${80-82} +elif $76==1 set_arg_c=$76,${78-79} +else set_arg_c=${76-77} +fi +if $97==2 set_arg_d=$97,${101-103} +elif $97==1 set_arg_d=$97,${99-100} +else set_arg_d=${97-98} +fi +if $104==2 set_arg_e=$104,${108-110} +elif $104==1 set_arg_e=$104,${106-107} +else set_arg_e=${104-105} +fi +if $111==2 set_arg_f=$111,${115-117} +elif $111==1 set_arg_f=$111,${113-114} +else set_arg_f=${111-112} +fi +fi +form_args=$set_arg_a,$set_arg_b,$set_arg_c,$set_arg_d,$set_arg_e,$set_arg_f +else +if $11 +if $12==2 set_arg_a=$12,${16-18} +elif $12==1 set_arg_a=$12,${14-15} +else set_arg_a=${12-13} +fi +if $19==2 set_arg_b=$19,${23-25} +elif $19==1 set_arg_b=$19,${21-22} +else set_arg_b=${19-20} +fi +set_arg_c=$set_arg_a +set_arg_d=$set_arg_b +else +if $48==2 set_arg_a=$48,${52-54} +elif $48==1 set_arg_a=$48,${50-51} +else set_arg_a=${48-49} +fi +if $55==2 set_arg_b=$48,${59-61} +elif $55==1 set_arg_b=$48,${57-58} +else set_arg_b=${55-56} +fi +if $83==2 set_arg_c=$83,${87-89} +elif $83==1 set_arg_c=$83,${85-86} +else set_arg_c=${83-84} +fi +if $90==2 set_arg_d=$90,${94-96} +elif $90==1 set_arg_d=$90,${92-93} +else set_arg_d=${90-91} +fi +fi +form_args=$set_arg_a,$set_arg_b,$set_arg_c,$set_arg_d +fi +rep_popcorn_fractal_transformative_regular_and_swirling[0] {$9?-$1:$1},${2-6},{($7-50)/50},{((100-$8)-50)/50},$10,$form_args +if $118!=100 cut[0] 0,{iM*$118%} fi +rep_exponential_sigmoid_adjustment[0] ${119-121},{$123?-255:$122} +if $124 cut[0] 0,255 negate fi +t4_xy:=!$10&&$11?2 +t6_xy:=$10&&$11?2 +t4_sxy:=!$10&&!$11?2 +t6_sxy:=$10&&!$11?2 +t4_sxy_x:=$t4_sxy&&!$47?2 +t4_sxy_y:=$t4_sxy&&$47?2 +t6_sxy_x:=$t6_sxy&&!$47?2 +t6_sxy_y:=$t6_sxy&&$47?2 +t4_xy_expr_a_mode_0:=$t4_xy?$12==0?2 +t4_xy_expr_a_mode_1:=$t4_xy?$12==1?2 +t4_xy_expr_a_mode_2:=$t4_xy?$12==2?2 +t4_xy_expr_b_mode_0:=$t4_xy?$19==0?2 +t4_xy_expr_b_mode_1:=$t4_xy?$19==1?2 +t4_xy_expr_b_mode_2:=$t4_xy?$19==2?2 +t6_xy_expr_a_mode_0:=$t6_xy?$26==0?2 +t6_xy_expr_a_mode_1:=$t6_xy?$26==1?2 +t6_xy_expr_a_mode_2:=$t6_xy?$26==2?2 +t6_xy_expr_b_mode_0:=$t6_xy?$33==0?2 +t6_xy_expr_b_mode_1:=$t6_xy?$33==1?2 +t6_xy_expr_b_mode_2:=$t6_xy?$33==2?2 +t6_xy_expr_c_mode_0:=$t6_xy?$40==0?2 +t6_xy_expr_c_mode_1:=$t6_xy?$40==1?2 +t6_xy_expr_c_mode_2:=$t6_xy?$40==2?2 +t4_x_expr_a_mode_0:=$t4_sxy_x?$48==0?2 +t4_x_expr_a_mode_1:=$t4_sxy_x?$48==1?2 +t4_x_expr_a_mode_2:=$t4_sxy_x?$48==2?2 +t4_x_expr_b_mode_0:=$t4_sxy_x?$55==0?2 +t4_x_expr_b_mode_1:=$t4_sxy_x?$55==1?2 +t4_x_expr_b_mode_2:=$t4_sxy_x?$55==2?2 +t6_x_expr_a_mode_0:=$t6_sxy_x?$62==0?2 +t6_x_expr_a_mode_1:=$t6_sxy_x?$62==1?2 +t6_x_expr_a_mode_2:=$t6_sxy_x?$62==2?2 +t6_x_expr_b_mode_0:=$t6_sxy_x?$69==0?2 +t6_x_expr_b_mode_1:=$t6_sxy_x?$69==1?2 +t6_x_expr_b_mode_2:=$t6_sxy_x?$69==2?2 +t6_x_expr_c_mode_0:=$t6_sxy_x?$76==0?2 +t6_x_expr_c_mode_1:=$t6_sxy_x?$76==1?2 +t6_x_expr_c_mode_2:=$t6_sxy_x?$76==2?2 +t4_y_expr_a_mode_0:=$t4_sxy_y?$83==0?2 +t4_y_expr_a_mode_1:=$t4_sxy_y?$83==1?2 +t4_y_expr_a_mode_2:=$t4_sxy_y?$83==2?2 +t4_y_expr_b_mode_0:=$t4_sxy_y?$90==0?2 +t4_y_expr_b_mode_1:=$t4_sxy_y?$90==1?2 +t4_y_expr_b_mode_2:=$t4_sxy_y?$90==2?2 +t6_y_expr_a_mode_0:=$t6_sxy_y?$97==0?2 +t6_y_expr_a_mode_1:=$t6_sxy_y?$97==1?2 +t6_y_expr_a_mode_2:=$t6_sxy_y?$97==2?2 +t6_y_expr_b_mode_0:=$t6_sxy_y?$104==0?2 +t6_y_expr_b_mode_1:=$t6_sxy_y?$104==1?2 +t6_y_expr_b_mode_2:=$t6_sxy_y?$104==2?2 +t6_y_expr_c_mode_0:=$t6_sxy_y?$111==0?2 +t6_y_expr_c_mode_1:=$t6_sxy_y?$111==1?2 +t6_y_expr_c_mode_2:=$t6_sxy_y?$111==2?2 +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7,$8}""{$9}""{$10}""{$11}""{$12}_"$t4_xy"{$13}_"$t4_xy_expr_a_mode_0"{$14}_"$t4_xy_expr_a_mode_1"{$15}_"$t4_xy_expr_a_mode_1"{$16}_"$t4_xy_expr_a_mode_2"{$17}_"$t4_xy_expr_a_mode_2"{$18}_"$t4_xy_expr_a_mode_2"{$19}_"$t4_xy"{$20}_"$t4_xy_expr_b_mode_0"{$21}_"$t4_xy_expr_b_mode_1"{$22}_"$t4_xy_expr_b_mode_1"{$23}_"$t4_xy_expr_b_mode_2"{$24}_"$t4_xy_expr_b_mode_2"{$25}_"$t4_xy_expr_b_mode_2"{$26}_"$t6_xy"{$27}_"$t6_xy_expr_a_mode_0"{$28}_"$t6_xy_expr_a_mode_1"{$29}_"$t6_xy_expr_a_mode_1"{$30}_"$t6_xy_expr_a_mode_2"{$31}_"$t6_xy_expr_a_mode_2"{$32}_"$t6_xy_expr_a_mode_2"{$33}_"$t6_xy"{$34}_"$t6_xy_expr_b_mode_0"{$35}_"$t6_xy_expr_b_mode_1"{$36}_"$t6_xy_expr_b_mode_1"{$37}_"$t6_xy_expr_b_mode_2"{$38}_"$t6_xy_expr_b_mode_2"{$39}_"$t6_xy_expr_b_mode_2"{$40}_"$t6_xy"{$41}_"$t6_xy_expr_c_mode_0"{$42}_"$t6_xy_expr_c_mode_1"{$43}_"$t6_xy_expr_c_mode_1"{$44}_"$t6_xy_expr_c_mode_2"{$45}_"$t6_xy_expr_c_mode_2"{$46}_"$t6_xy_expr_c_mode_2"{$47}_"{!$11?2}"{$48}_"$t4_sxy_x"{$49}_"$t4_x_expr_a_mode_0"{$50}_"$t4_x_expr_a_mode_1"{$51}_"$t4_x_expr_a_mode_1"{$52}_"$t4_x_expr_a_mode_2"{$53}_"$t4_x_expr_a_mode_2"{$54}_"$t4_x_expr_a_mode_2"{$55}_"$t4_sxy_x"{$56}_"$t4_x_expr_b_mode_0"{$57}_"$t4_x_expr_b_mode_1"{$58}_"$t4_x_expr_b_mode_1"{$59}_"$t4_x_expr_b_mode_2"{$60}_"$t4_x_expr_b_mode_2"{$61}_"$t4_x_expr_b_mode_2"{$62}_"$t6_sxy_x"{$63}_"$t6_x_expr_a_mode_0"{$64}_"$t6_x_expr_a_mode_1"{$65}_"$t6_x_expr_a_mode_1"{$66}_"$t6_x_expr_a_mode_2"{$67}_"$t6_x_expr_a_mode_2"{$68}_"$t6_x_expr_a_mode_2"{$69}_"$t6_sxy_x"{$70}_"$t6_x_expr_b_mode_0"{$71}_"$t6_x_expr_b_mode_1"{$72}_"$t6_x_expr_b_mode_1"{$73}_"$t6_x_expr_b_mode_2"{$74}_"$t6_x_expr_b_mode_2"{$75}_"$t6_x_expr_b_mode_2"{$76}_"$t6_sxy_x"{$77}_"$t6_x_expr_c_mode_0"{$78}_"$t6_x_expr_c_mode_1"{$79}_"$t6_x_expr_c_mode_1"{$80}_"$t6_x_expr_c_mode_2"{$81}_"$t6_x_expr_c_mode_2"{$82}_"$t6_x_expr_c_mode_2"{$83}_"$t4_sxy_y"{$84}_"$t4_y_expr_a_mode_0"{$85}_"$t4_y_expr_a_mode_1"{$86}_"$t4_y_expr_a_mode_1"{$87}_"$t4_y_expr_a_mode_2"{$88}_"$t4_y_expr_a_mode_2"{$89}_"$t4_y_expr_a_mode_2"{$90}_"$t4_sxy_y"{$91}_"$t4_y_expr_b_mode_0"{$92}_"$t4_y_expr_b_mode_1"{$93}_"$t4_y_expr_b_mode_1"{$94}_"$t4_y_expr_b_mode_2"{$95}_"$t4_y_expr_b_mode_2"{$96}_"$t4_y_expr_b_mode_2"{$97}_"$t6_sxy_y"{$98}_"$t6_y_expr_a_mode_0"{$99}_"$t6_y_expr_a_mode_1"{$100}_"$t6_y_expr_a_mode_1"{$101}_"$t6_y_expr_a_mode_2"{$102}_"$t6_y_expr_a_mode_2"{$103}_"$t6_y_expr_a_mode_2"{$104}_"$t6_sxy_y"{$105}_"$t6_y_expr_b_mode_0"{$106}_"$t6_y_expr_b_mode_1"{$107}_"$t6_y_expr_b_mode_1"{$108}_"$t6_y_expr_b_mode_2"{$109}_"$t6_y_expr_b_mode_2"{$110}_"$t6_y_expr_b_mode_2"{$111}_"$t6_sxy_y"{$112}_"$t6_y_expr_c_mode_0"{$113}_"$t6_y_expr_c_mode_1"{$114}_"$t6_y_expr_c_mode_1"{$115}_"$t6_y_expr_c_mode_2"{$116}_"$t6_y_expr_c_mode_2"{$117}_"$t6_y_expr_c_mode_2"{$118}""{$119}""{$120}""{$121}""{$122}_"{$123?1:2}"{$123}""{$124}" +fx_rep_premade_palette: +xpos,ypos,split_width,scaling,flip_row,rotation_angle,mir_x,mir_y,pal_to_img={$2/2}~,{$3/2}~,${4-6},{((3-$7)-1)*(90*(($8!=$9)?-1:1))},${8-9},$10 ++pal $1 +to_rgba +local[-1] { +s x,-$split_width +if $flip_row&&$!>1 mirror[1--1:2] x fi +a y +} +rotate. $rotation_angle +if $mir_x mirror. x fi +if $mir_y mirror. y fi +r2dx. {w*$scaling},1 +split_opacity. to_rgba.. +store[-2,-1] palette_img +foreach { +if !$pal_to_img {w},{h},1,100% rm.. fi +$palette_img +j[-3] [-2],$xpos,$ypos,0,0,1,[-1],255 +rm[-2,-1] +} +fx_rep_premade_palette_preview: +fx_rep_premade_palette ${1-10} +message_out,act_exp="Available for Export!",$15 +format_choice=${arg\ $13+1,gpl,pdn_pal,jasc} +use_pdn:=['$format_choice']==['pdn_pal'] +enable_export=2 ++pal $1 +if $1!=$-1 +output_name={-1,n} +else +output_name="$12" +fi +rep_correct_exp_ne $output_name +new_out=${} +if $act_exp +rep_output_$format_choice. "$11"/$new_out +if $use_pdn +if whd#-1>96 message_out="Export failed! 96 or less color only for PDN Palette." fi +else message_out="Successfully Exported!" +fi +elif $use_pdn&&whd#-1>96 +enable_export=1 +message_out="96 Colors Restriction Exceeded! Disabled Export!" +fi +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}""{$9}""{$10}""{$11}""{"$new_out"}""{$13}""{"$message_out"}""{0}_"$enable_export"{$1}" +gui_rep_prime_surface: +rep_prime_surface {w},{h},$1,$2 k. n 0,255 +fx_rep_mj_prn: +pos_x={min(max(($7/100-.5)*2,-1),1)} +pos_y={min(max(($8/100-.5)*2,-1),1)} +rep_mj_prn ${1-2},${4-6},$pos_x,$pos_y,$9,$3,${11-12},$10 +fx_rep_mj_prn_preview: +fx_rep_mj_prn $* +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7,$8}""{$9}""{$10}""{$11}""{$12}_"{$11?2:1} +fx_rep_rainbowify: rep_rainbowify ${1-2},$3% +fx_rep_rainbowify_preview: +gui_split_preview "fx_rep_rainbowify ${1-3}",${-3--1} +fx_rep_randgradbar: +srand $1 +foreach { +if $12==0&&$13==0 rep_random_gradient_bars $2%,$3%,$4,$5,{$6/100-.5},{(100-$7)/100-.5},${8-11},-1,,$17,$14,${15-16},$18,$19,$20,$21,$22,$23 +else rep_random_gradient_bars $2%,$3%,$4,$5,{$6/100-.5},{(100-$7)/100-.5},${8-11},{$12-1},{$13-1},$17,$14,${15-16},$18,$19,$20,$21,$22,$23 +fi +if $17==0 sh. 0 n. 0,255 rm. fi +} +fx_rep_randgradbar_preview: +fx_rep_randgradbar ${1-23} +use_color={$17==0?1:($17==1?2:(($3>0&&$14)?2:1))} +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7,$8}""{$9}""{$10}""{$11}""{$12}""{$13}_"{!$12?2:1}"{$14}_"{$3?2:1}"{$15}""{$16}""{$17}""{$18,$19,$20}_"$use_color"{$21,$22,$23}_"$use_color"{$24}""{$25}""{$26}" +fx_rep_rrd: +border_size={max(0,round($2*$7/100))} +rgb_col=${rep_int82hex\ ${14-16}} +if $8==2 +if $12 rep_random_rectangular_division ${1-3},$4%,$5,$7%,$6,$9,$rgb_col,${11-13} +else rep_random_rectangular_division ${1-3},$4%,$5,$7%,$6,$9,$rgb_col,$11,,$13 +fi +elif $8==1 +rep_random_rectangular_division ${1-3},$4%,$5,$7%,$6,$9,$rgb_col,pal,$10,$13 +else +rep_random_rectangular_division ${1-3},$4%,$5,$7%,$6,$9,$rgb_col +fi +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}""{$9}"_{!$8?2}"{$10}"_{$8==1?2}"{$11}"_{$8==2?2}"{$12}"_{$8==2?2}"{$13}"_{$8?2}"{$14,$15,$16}"_{$border_size?2:1} +fx_rep_rand_sqrrecfill: +ww={w} +hh={h} +if $-1!=1 +square_size=$3 +if $8 +if abs($7) +if $7>0 square_size+={abs($5)} +else square_size+=1 +fi +fi +fi +rw={w-$square_size*2} +rh={h-$square_size*2} +nw={floor($rw/($square_size*($8?(($3+1)/$3):1)))*$square_size} +nh={floor($rh/($square_size*($8?(($3+1)/$3):1)))*$square_size} +if $-1==2 r $nw,$nh,100%,100% fi +fi +if $2 rep_rand_sqrrecfill -1,${3--2} +else +rep_rand_sqrrecfill $1,${3--3} +if $1==0 n. 0,255 fi +fi +if $-1!=1 if $-1==2 f. 255-i fi r. $ww,$hh,100%,100%,0,0,.5,.5 if $-1==2 f. 255-i fi fi +k. +u "{$1}_"{$2?1:2}"{$2}""{$3}""{$4}""{$5}""{$6}""{$7}_"{(($1==0&&$2==0)?0:$8)?2:1}"{$8}_"{$1==0&&$2==0?1:2}"{$9}""{$10}"_{!($1==0&&$2!=1)?2:1}"{$11}""{$12}_"{$2?2:1}"{$13}" +fx_rep_red_acrylic_filter: +skip "${2=}","${9=}" +n_images,cond_import_image,cond_refer_image,ref_image_id,luma_fact,verd_green_min_pt,verd_green_visil,previo_cond_import_image,previo_cond_refer_image,previo_ref_image_id,previo_luma_fact,previo_verd_green_min_pt,previo_verd_green_visil={$!},$1,${3-8},${10-14} +args:=[$luma_fact,$verd_green_min_pt,$verd_green_visil]/100 +if $cond_import_image +if narg("$2") +image_loc="$2" +previo_image_loc="$9" +if !narg($_persistent)||('$image_loc'!='$previo_image_loc') i $image_loc +store. _persistent +else $_persistent +fi +rep_red_acrylic_filter[0--2] [-1],$args +rm[-1] +fi +else +if $n_images&1||$cond_refer_image +if $ref_image_id rep_red_acrylic_filter[0--2] [-1],$args +else rep_red_acrylic_filter[1--1] [0],$args +fi +else +rv rep_red_acrylic_filter ,$args +fi +fi +fx_rep_red_acrylic_filter_preview: +skip "${2=}","${9=}" +n_images:=$! +fx_rep_red_acrylic_filter $* +u "{$1}""{$2}_"{$1?2:1}"{$3}_"{!$1?2}"{$4}_"{!$1?$n_images&1||$1?2}"{$5}""{$6}""{$7}""{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}" +fx_rep_rd: +if $1 +convert_colors_fwd=${arg\ $1,rgb2srgb,rgb2ryb,rgb2cmy,error,rgb2hsi8,rgb2hsl8,rgb2hsv8,rgb2lab8,rgb2lch8,rgb2ycbcr,rgb2yiq8,rgb2yuv8,rgb2yes8,rgb2k18,rgb2ohta8} +convert_colors_bwd=${arg\ $1,srgb2rgb,ryb2rgb,cmy2rgb,error,hsi82rgb,hsl82rgb,hsv82rgb,lab82rgb,lch82rgb,ycbcr2rgb,yiq82rgb,yuv82rgb,yes82rgb,k182rgb,ohta82rgb} +fi +not_cmyk={$1!=4} +foreach { +tcr,convert_back,contain_alpha=3,0,{s==2||s==4} +if (s==3||s==4)&&$1 +convert_back=1 +if $not_cmyk +$convert_colors_fwd +else +if s==3 tcr=4 rgb2cmyk +elif s==4 tcr=4 s c,-3 rgb2cmyk.. a c +fi +fi +fi +if $contain_alpha&&!$2 shared 0,{s-2} fi +rep_reverse_digits. ${3-4} +if $5&&!$4 cut. 0,255 fi +rm. +if $convert_back +if $not_cmyk +$convert_colors_bwd +else +if s==4 cmyk2rgb +elif s==5 s c,-4 cmyk2rgb.. a c +fi +fi +fi +} +fx_rep_rd_preview: +gui_split_preview "fx_rep_rd ${1-5}",${-3--1} +u "{$1}""{$2}""{$3}""{$4}""{$5}_"{1+!$4}"{$6}""{$7,$8}" +gui_rep_recc: error "Use Export Button to export color curve map! This filter does nothing on host!" +gui_rep_recc_preview: +filename="$3/$4" +remove_opacity +if $2 mv. 0 fi +if $5 +rep_recc 256 +r 100%,$1 +o $filename +to "Exported!",.5~,.5~,50%,2,255 +else +rep_recc 256 +r 100%,$1 +if $6 a y fi +fi +u "{$1}""{$2}""{$3}""{$4}""{0}""{$6}" +gui_rep_regm: error "Use Export Button to export gradient! This filter does nothing on host!" +gui_rep_regm_preview: +filename="$4/$5" +if $2 mv. 0 fi +if $6 +rep_reverse_engineer_gradient_map 256,$3 +r 100%,$1 +o $filename +remove_opacity to "Exported!",.5~,.5~,50%,2,255 +else +rep_reverse_engineer_gradient_map 256,$3 +r 100%,$1 +if $7 a y fi +fi +u "{$1}""{$2}""{$3}""{$4}""{$5}""{0}""{$7}" +fx_rep_lerp_rgb_gray: +if $1==6 +if $2 rep_lerp_rgb_gray $6%,$7%,$8%,${9-11} +else rep_lerp_rgb_gray $3%,$4%,$5%,${9-11} +fi +else +if $2 rep_lerp_rgb_gray $6%,$7%,$8%,$1 +else rep_lerp_rgb_gray $3%,$4%,$5%,$1 +fi +fi +fx_rep_lerp_rgb_gray_preview: +if $2 r1,g1,b1,r2,g2,b2={[$6<100?$6:$3,$7<100?$7:$4,$8<100?$8:$5,$6,$7,$8]} +else r1,g1,b1,r2,g2,b2={[$3,$4,$5,$3,$4,$5]} +fi +gui_split_preview "fx_rep_lerp_rgb_gray ${1-11}",${-3--1} +a={$2?0:2} +b={$2?2:0} +c={$1==6?2:0} +u "{$1}""{$2}""{"$r1"}_"$a"{"$g1"}_"$a"{"$b1"}_"$a"{"$r2"}_"$b"{"$g2"}_"$b"{"$b2"}_"$b"{$9}_"$c"{$10}_"$c"{$11}_"$c"{$12}""{$13,$14}" +fx_rep_rbtt: +to_a +if $8 rep_rbtt {$1/100},{$2/100},$3,$5,$6,{$7/100},{($9/100-.5)*2},{($10/100-.5)*-2},$11,$12,$13,$14,$15 +else rep_rbtt {$1/100},{$2/100},$3,$4,,,{($9/100-.5)*2},{($10/100-.5)*-2},$11,$12,$13,$14,$15 +fi +fx_rep_rbtt_preview: gui_split_preview "fx_rep_rbtt ${1-13},{$14*-1},$15",${-3--1} +a={$8?2:1} +u "{$1}""{$2}""{$3}""{$4}_"{!$8?2:1}"{$5}_"$a"{$6}_"$a"{$7}_"$a"{$8}""{$9,$10}""{$11}""{$12}""{$13}_"{$12?2:1}"{$14}""{$15}""{$16}""{$17,$18}" +fx_rep_serendipitous_circle: +ow,oh={w},{h} +if $10 +coeff_a,coeff_b=${3-4} +if !$7 +if $3!=$-2 coeff_a,coeff_b=$3 fi +if $4!=$-1 coeff_a,coeff_b=$4 fi +else +coeff_a,coeff_b=0 +fi +else +coeff_a,coeff_b=${3-4} +if $3!=$16 coeff_a=$3 fi +if $4!=$17 coeff_b=$4 fi +if $7 coeff_a=0 fi +if $8 coeff_b=0 fi +fi +if $coeff_a==0 if $5 coeff_a..=- fi fi +if $coeff_b==0 if $6 coeff_b..=- fi fi +seed={$17?round(u(0,1000000)):$16} +rep_serendipitous_circle ${1-2},$coeff_a,$coeff_b,${11-14},$seed,$18,$15 +sh. 0 sh.. 1 +if $19 +rep_exp_sig_adj.. ${20-22},-255 +n. 0,255 +else +n[-2,-1] 0,255 +fi +rm[-2,-1] +r. $ow,$oh,100%,100%,0,0,.5,.5 +u "{$1}""{$2}""{"$coeff_a"}""{"$coeff_b"}""{$5}_"{$coeff_a?1:2}"{$6}_"{$coeff_b?1:2}"{0}_"{!$10?2}"{0}_"{!$10?2}"{0}_"{$10?2}"{$10}""{$11}""{$12}""{$13}""{$14}""{$15}""{"$seed"}""{0}""{$18}""{$19}""{$20}_"{$19?2:1}"{$21}_"{$19?2:1}"{$22}_"{$19?2:1}"{"$coeff_a"}""{"$coeff_b"}" +rep_sinowaterdist_gui: +rep_sinowaterdist $1,$2,{($3/100)*(w>h?w:h)},$4,$5 +rep_sinowaterdist_gui_preview: +gui_split_preview "rep_sinowaterdist_gui $*",${-3--1} +fx_rep_skew: +rep_skew $1,$2%,${3-6} +rep_skew_preview: +gui_split_preview "fx_rep_skew ${1-6}",${-3--1} +gui_rep_sd: rep_sd ${1-6},{($7-50)*2}%,{($8-50)*2}%,$9,{($10-50)*2}%,{($11-50)*-2}%,$12,{($15-50)*2}%,{($16-50)*2}%,{($13-50)*2}%,{($14-50)*2}%,$17,$18 +gui_rep_sd_preview: gui_split_preview "gui_rep_sd ${1-18}",${-3--1} +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7,$8}""{$9}_"{(($7!=50)||($8!=50))?2:1}"{$10,$11}""{$12}_"{($10!=50)||($11!=50)?2:1}"{$13,$14}""{$15}""{$16}""{$17}""{$18}""{$19}""{$20,21}" +rep_sqrlogpindis_gui: +rep_sqrlogpindis $1,{(($2/100)-.5)*2},{(($3/100)-.5)*-2},{(($4/100)-.5)*2},{(($5/100)-.5)*-2},${6-18} +rep_sqrlogpindis_gui_preview: +gui_split_preview "rep_sqrlogpindis_gui $*",${-3--1} +fx_rep_bchstatfunc_average: +convert_colors_fwd=${arg\ 1+$1,none,rgb2srgb,rgb2ryb,rgb2lab} +convert_colors_bwd=${arg\ 1+$1,none,srgb2rgb,ryb2rgb,lab2rgb} +use_alpha={!$2} +foreach { +if s>=3 +if $1 +sh. 0,2 +$convert_colors_fwd. +rep_bchstatfunc[$use_alpha] ia,0 +$convert_colors_bwd. +rm. +else +sh. 0,2 +rep_bchstatfunc[$use_alpha] ia,0 +rm. +fi +else +if s==2 +sh. 1 +rep_bchstatfunc[$use_alpha] ia,0 +rm. +else +rep_bchstatfunc ia,0 +fi +fi +} +fx_rep_bchstatfunc_average_preview: +gui_split_preview "fx_rep_bchstatfunc_average ${1-2}",${-3--1} +fx_rep_stitch: +if $12 angles={expr('$13+x/w*180',$14);} +else angles={([${16-27}])[0,$15]} +fi +cli_args=$1%,$2%,{$3>1?($4?-$3:$3)},${6-9},$5,${10-11},$angles +rep_stitch $cli_args +u "rep_stitch "$cli_args +fx_rep_stitch_preview: +gui_split_preview "fx_rep_stitch ${1-27}",${-3--1} +more_than_one_ang=!$12?$15>1:1 +if !$12 ++rep_find_nonduplicate_angles {([${16-27}])[0,$15]} +if w#-1==1 more_than_one_ang=0 fi +rm. +fi +activate_nonsym:=$12*2 +activate_sym:=!$activate_nonsym*2 +u "{$1}""{$2}""{$3}""{$4}_"{($3>1)+1}"{$5}""{$6}_"{($more_than_one_ang?1)+1}"{$7}_"{($more_than_one_ang?1)+1}"{$8}""{$9}_"{($more_than_one_ang&&$7?1)+1}"{$10}""{$11}_"{($10?1)+1}"{$12}""{$13}_"$activate_nonsym"{$14}_"$activate_nonsym"{$15}_"$activate_sym"{$16}_"{2*($activate_sym&&$15>0)}"{$17}_"{2*($activate_sym&&$15>1)}"{$18}_"{2*($activate_sym&&$15>2)}"{$19}_"{2*($activate_sym&&$15>3)}"{$20}_"{2*($activate_sym&&$15>4)}"{$21}_"{2*($activate_sym&&$15>5)}"{$22}_"{2*($activate_sym&&$15>6)}"{$23}_"{2*($activate_sym&&$15>7)}"{$24}_"{2*($activate_sym&&$15>8)}"{$25}_"{2*($activate_sym&&$15>9)}"{$26}_"{2*($activate_sym&&$15>10)}"{$27}_"{2*($activate_sym&&$15>11)}"{$28}""{$29,$30}" +rep_strbul_preview: +gui_split_preview "rep_strbul $*",${-3--1} +rep_strbulkal_gui: +rep_strbulkal ${1-3},{(($4/100)-.5)*2},{(($5/100)-.5)*-2},{(($6/100)-.5)*2},{(($7/100)-.5)*-2},${8-12} +rep_strbulkal_gui_preview: +gui_split_preview "rep_strbulkal_gui $*",${-3--1} +fx_rep_tco: +tau={2*pi} +ow={w} +oh={h} +mode={$14+1} +ti=$! +local[0] { +rep_three_coupled_oscillators $1,{$tau*$2%},{$tau*$3%},-$4,$5,{($6-50)/50},{($7-50)/-50},$8 +if $9==0 +if $-1!=1 +if $-1>1 +n 0,{255*$-1} +if $-2!=0 + {$-2*255} fi +modf {$-4?3:2},255,100% +else +n 0,{255*$-1} +fi +else +n 0,255 +fi +if $-2!=0&&(!($-1>1)) ++ {$-2*255} +modf {$-4?3:2},255,100% +fi +if $-3 negate fi +elif $9==1 ++pal $10 +n.. 0,{$-1*(w#-1-1)} +if $-3 negate.. fi +if $-2!=0 +.. {(w#-1-1)*$-2} fi +rep_cubic_map.. [-1],$mode +rm. +fi +if $9!=2 r $ow,$oh,100%,100%,6 fi +} +if $9==2 +if $12 convert_colors_bwd=${arg\ $12,hsi2rgb,hcy2rgb,lab2rgb} fi +ti={$!} +if $ti>1 +rm[^0] +[-1]x{$ti-1} +fi +foreach { +if $12==3 $11,1,1,3,begin(srand($13+$>););[u(0,100),u(-128.014,182.136),u(-155.5,155.5)]; +elif $12 $11,1,1,3,begin(srand($13+$>););[u(0,359.999999),u(0,1),u(0,1)]; +else $11,1,1,3,begin(srand($13););u(255); +fi +n.. 0,{$-1*(w#-1-1)} +if $-3 negate.. fi +if $-2!=0 +.. {(w#-1-1)*$-2} fi +rep_cubic_map.. [-1],$mode +rm. +if $12 $convert_colors_bwd. fi +r $ow,$oh,100%,100%,6 +} +else +k. +if $ti>1 +[-1]x{$ti-1} done +fi +fi +rand_col_set={$9==2?2} +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6,$7}""{$8}""{$9}""{$10}"_{$9==1?2}"{$11}"_$rand_col_set"{$12}"_$rand_col_set"{$13}"_$rand_col_set"{$14}""{$15}""{$16}""{$17}" +gui_rep_form_pixel: +use_dynamic=0 +ti={$!} +if $3 rv fi +if $2==7 +form_id=dragon +form_var=${17-18} +use_dynamic=1 +elif $2==9 +form_id=fern +form_var=$20%,0,1,$19 +use_dynamic=1 +elif $2==11 +form_id=gear +form_var=${21-24} +use_dynamic=1 +elif $2==21 +form_id=polygon +form_var=$25 +use_dynamic=1 +elif $2==24 +form_id=snowflake +form_var=$26 +use_dynamic=1 +elif $2==25 +form_id=star +form_var=$27,{$28/100} +use_dynamic=1 +else +form_id={$2-1} +fi +if !$2 +if $ti==1 . fi +rep_form_pixel[^0] [0],${4-5},$6%,${7-9},${13-14},$10%,${11-12},$1,${15-16} +else +if $use_dynamic +rep_form_pixel $form_id,${4-5},$6%,${7-9},${13-14},$10%,${11-12},$1,${15-16},$form_var +else +rep_form_pixel $form_id,${4-5},$6%,${7-9},${13-14},$10%,${11-12},$1,${15-16} +fi +fi +if !$2 rv fi +if ('$_host'=='paintdotnet')&&!$2 rm[0] fi +gui_rep_form_pixel_preview: +if $3 rv fi +if !$2 +if $!==1 +store _ref +else store[0] _ref +fi +fi +if $3 rv fi +if !$2 +if $!==1 +store _ref +else store[0] _ref +fi +fi +gui_split_preview "if !$2 $_ref rv fi gui_rep_form_pixel ${1-28}",${-3--1} +set_a={$2==7?2} +set_b={$2==9?2} +set_c={$2==11?2} +set_d={$2==25?2} +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}""{$9}""{$10}""{$11}_"{$10?2:1}"{$12}""{$13}""{$14}""{$15}""{$16}""{$17}_"$set_a"{$18}_"$set_a"{$19}_"$set_b"{$20}_"$set_b"{$21}_"$set_c"{$22}_"$set_c"{$23}_"$set_c"{$24}_"$set_c"{$25}_"{$2==21?2}"{$26}_"{$2==24?2}"{$27}_"$set_d"{$28}_"$set_d"{$29}""{$30,$31}" +fx_rep_tz: +half_img_diag={norm(w,h)/2} +sw={$1%*$half_img_diag} +sh={$2%*$half_img_diag} +rep_tiled_zoom $sw,$sh,$3,$4 +fx_rep_tz_preview: +gui_split_preview "fx_rep_tz ${1-4}",${-3--1} +gui_rep_trif: rep_trif $1,$2%,$3%,$4 +gui_rep_trif_preview: gui_split_preview "gui_rep_trif ${1-4}",${-3--1} +gui_rep_trps: ac "rep_tr_pixel_sharpener ${1-5}",$6 +gui_rep_trps_preview: gui_split_preview "gui_rep_trps ${1-6}",${-3--1} +u "{$1}""{$2}""{$3}""{$4}_"{$3>2?2:0}"{$5}_"{$3>4?2:0}"{$6}""{$7}""{$8}" +fx_rep_transfer_color_reduced: +skip ${20=""},${1326=""} +if $1330==1 error inv_inp fi +if $1330==2 error import_mode_err fi +use_pal={$1?!$5:1} +img_cont_alp={sum(1-expr('s#x',$!)&1)} +if $img_cont_alp +img_cont_alp=0 +foreach { +if s&1 continue fi +sh. {s#-1-1} +if iv#-1 rm. img_cont_alp=1 break +else rm. +fi +} +fi +if $1318&&$img_cont_alp +if $1 alpha_args=$1319,{$1320/100},$1322 +else alpha_args=$1319,{$1320/100},$1321,$1323,$1324 +fi +else +alpha_args=0 +fi +if $use_pal +if $6==3 +(${29-1308}) +split. x,-5 +a[-256--1] y +permute. yzcx +channels. 0,2 +crop. 0,{$22-1} +store. palette +fi +else +if $7 +if $17 tcrc_arg={2^$13} +else tcrc_arg={2^$14}:{2^$15}:{2^$16} +fi +else +if $12 tcrc_arg=$8 +else tcrc_arg=$9:$10:$11 +fi +fi +fi +fx_rep_tcrc_windows_width,fx_rep_tcrc_window_height=${arg\ $1314+1,$1313,w},${arg\ $1316+1,$1315,h} +if $3&&$4 +fx_rep_tcrc_dither=$4%${arg\ $3,dh,dv,lh,lv,cd,cl} +else +fx_rep_tcrc_dither={$2/100} +fi +foreach { +od={[w-1,h-1]} +if $use_pal +if $6==3 +$palette +if $1 rep_transfer_color_reduced.. :[-1],$fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$alpha_args +else rep_transfer_color_reduced.. [-1],$fx_rep_tcrc_dither,$1311,$1312,$fx_rep_tcrc_windows_width,$fx_rep_tcrc_window_height,$25,$24,$alpha_args +fi +elif $6==1 +if s>2 sh[0] 0,2 +else sh[0] 0 +fi ++colormap. $23,0 rm.. +if $1 rep_transfer_color_reduced.. :[-1],$fx_rep_tcrc_dither,$1311,$1312,$1317,0,$_alpha_args +else rep_transfer_color_reduced.. [-1],$fx_rep_tcrc_dither,$1311,$1312,$fx_rep_tcrc_windows_width,$fx_rep_tcrc_window_height,$25,0,$alpha_args +fi +else ++pal $18 +if $1 rep_transfer_color_reduced.. :[-1],$fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$alpha_args +else rep_transfer_color_reduced.. [-1],$fx_rep_tcrc_dither,$1311,$1312,$fx_rep_tcrc_windows_width,$fx_rep_tcrc_window_height,$25,$24,$alpha_args +fi +fi +rm. +else rep_transfer_color_reduced $tcrc_arg,$fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$alpha_args +fi +if $1330==3 crop 0,0,$od fi +} +fx_rep_transfer_color_reduced_preview: +skip ${20=""},${1326=""} +original_width,original_height={[w#0,h#0]} +imgs,dec_imgs,use_pal,imported={$!},{$!-1},{$1?!$5:1},$1327 +use_custom_pal,num_of_colors,pal_method={$use_pal&&($6>1?1:!$6?$19)},$22,$6 +text_box="$1325" +img_cont_alp={sum(1-expr('s#x',$!)&1)} +if $img_cont_alp +img_cont_alp=0 +foreach { +if s&1 continue fi +sh. {s#-1-1} +if iv#-1 rm. img_cont_alp=1 break +else rm. +fi +} +fi +if $pal_method!=1 +z $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1 +r $_preview_width,$_preview_height,1,100% +fi +if $1309 num_of_colors+=1 fi +if $1314&&$1316 tcrc_windows_width_check,tcrc_windows_height_check,_fx_rep_tcrc_windows_width,_fx_rep_tcrc_window_height=0,0,$1313,$1315 +else tcrc_windows_width_check,tcrc_windows_height_check,_fx_rep_tcrc_windows_width,_fx_rep_tcrc_window_height=$1314,$1316,${arg\ $1314+1,$1313,w},${arg\ $1316+1,$1315,h} +fi +if $1318&&$img_cont_alp +if $1 _alpha_args=$1319,{$1320/100},$1322 +else _alpha_args=$1319,{$1320/100},$1321,$1323,$1324 +fi +else +_alpha_args=0 +fi +if $3&&$4 +_fx_rep_tcrc_dither=$4%${arg\ $3,dh,dv,lh,lv,cd,cl} +else +_fx_rep_tcrc_dither={$2/100} +fi +if narg($_persistent)&&!$use_custom_pal +($_persistent) +repeat 256 { +q={$>*3} +color_$>:=crop(#-1,$q,3) +} +rm. +elif !$use_custom_pal +(${29-1306}) +repeat 256 { +q={$>*5} +color_$>:=crop(#-1,$q,3) +} +_persistent=$color_0,$color_1,$color_2,$color_3,$color_4,$color_5,$color_6,$color_7,$color_8,$color_9,$color_10,$color_11,$color_12,$color_13,$color_14,$color_15,$color_16,$color_17,$color_18,$color_19,$color_20,$color_21,$color_22,$color_23,$color_24,$color_25,$color_26,$color_27,$color_28,$color_29,$color_30,$color_31,$color_32,$color_33,$color_34,$color_35,$color_36,$color_37,$color_38,$color_39,$color_40,$color_41,$color_42,$color_43,$color_44,$color_45,$color_46,$color_47,$color_48,$color_49,$color_50,$color_51,$color_52,$color_53,$color_54,$color_55,$color_56,$color_57,$color_58,$color_59,$color_60,$color_61,$color_62,$color_63,$color_64,$color_65,$color_66,$color_67,$color_68,$color_69,$color_70,$color_71,$color_72,$color_73,$color_74,$color_75,$color_76,$color_77,$color_78,$color_79,$color_80,$color_81,$color_82,$color_83,$color_84,$color_85,$color_86,$color_87,$color_88,$color_89,$color_90,$color_91,$color_92,$color_93,$color_94,$color_95,$color_96,$color_97,$color_98,$color_99,$color_100,$color_101,$color_102,$color_103,$color_104,$color_105,$color_106,$color_107,$color_108,$color_109,$color_110,$color_111,$color_112,$color_113,$color_114,$color_115,$color_116,$color_117,$color_118,$color_119,$color_120,$color_121,$color_122,$color_123,$color_124,$color_125,$color_126,$color_127,$color_128,$color_129,$color_130,$color_131,$color_132,$color_133,$color_134,$color_135,$color_136,$color_137,$color_138,$color_139,$color_140,$color_141,$color_142,$color_143,$color_144,$color_145,$color_146,$color_147,$color_148,$color_149,$color_150,$color_151,$color_152,$color_153,$color_154,$color_155,$color_156,$color_157,$color_158,$color_159,$color_160,$color_161,$color_162,$color_163,$color_164,$color_165,$color_166,$color_167,$color_168,$color_169,$color_170,$color_171,$color_172,$color_173,$color_174,$color_175,$color_176,$color_177,$color_178,$color_179,$color_180,$color_181,$color_182,$color_183,$color_184,$color_185,$color_186,$color_187,$color_188,$color_189,$color_190,$color_191,$color_192,$color_193,$color_194,$color_195,$color_196,$color_197,$color_198,$color_199,$color_200,$color_201,$color_202,$color_203,$color_204,$color_205,$color_206,$color_207,$color_208,$color_209,$color_210,$color_211,$color_212,$color_213,$color_214,$color_215,$color_216,$color_217,$color_218,$color_219,$color_220,$color_221,$color_222,$color_223,$color_224,$color_225,$color_226,$color_227,$color_228,$color_229,$color_230,$color_231,$color_232,$color_233,$color_234,$color_235,$color_236,$color_237,$color_238,$color_239,$color_240,$color_241,$color_242,$color_243,$color_244,$color_245,$color_246,$color_247,$color_248,$color_249,$color_250,$color_251,$color_252,$color_253,$color_254,$color_255 +rm. +fi +if $use_pal +if $use_custom_pal||($6==2?('"$1326"'!='"$20"')) +(${29-1308}) +split. x,-5 +a[-256--1] y +permute. yzcx +fi +if $6==3 +if $27 +sh. 4 +num_of_colors-={is#-1} +t_sub_col={is#-1} +if $t_sub_col +if $num_of_colors +area_fg. 0 +$num_of_colors,1,1,3,"I(#-2,x+i(#-1,x));" +rm.. +else +rm. +num_of_colors=2 +2,1,1,3,vector(#3,x); +fi +else +rm. ++crop. 0,0,0,0,{$num_of_colors-1},0,0,2 +fi +else +sh. 3 +max_val:=iM +pos:=xM +rm. +if $max_val +if $pos==($num_of_colors-1) ++crop. 0,0,0,0,{$num_of_colors-2},0,0,2 +elif !$pos ++crop. 1,0,0,0,{$num_of_colors-1},0,0,2 +else ++crop. 0,0,0,0,{$pos-1},0,0,2 ++crop.. {$pos+1},0,0,0,{$num_of_colors-1},0,0,2 +a[-2,-1] x +fi +num_of_colors-=1 +else ++crop. 0,0,0,0,{$num_of_colors-1},0,0,2 +fi +fi +image.. . +store. _palette +channels. 0,2 +repeat 256 { color_$>={I(#-1,$>)} } +rm. +if $1 +gui_split_preview "$_palette rep_transfer_color_reduced[^-1] :[-1],$_fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$_alpha_args rm.",${-3--1} +text_out="rep_transfer_color_reduced[^-1] :[-1]",$_fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$_alpha_args +else +gui_split_preview "$_palette rep_transfer_color_reduced[^-1] [-1],$_fx_rep_tcrc_dither,$1311,$1312,$_fx_rep_tcrc_windows_width,$_fx_rep_tcrc_window_height,$25,$24,$_alpha_args rm.",${-3--1} +text_out="rep_transfer_color_reduced[^-1] [-1]",$_fx_rep_tcrc_dither,$1311,$1312,$_fx_rep_tcrc_windows_width,$_fx_rep_tcrc_window_height,$25,$24,$_alpha_args +fi +elif $6==2 +apply_preview_image=0 +if narg($20)?(('$1326'!='$20')||($imported?$21)) +apply_preview_image,imported=1 +num_of_images={$!} +i $20 +if $!>($num_of_images+1) error excess_imgs fi +if whd#-1<2 error inv_pal_dim fi +if w#-1>1&&(h#-1>1||d#-1>1) colormap. 0 +elif w#-1==1&&h#-1>1 rotate. 90 +fi +image.. . +num_of_colors={w#-1} +store. _palette +channels. 0,2 +repeat 256 { color_$>={I(#-1,$>)} } +pal_method=3 +fi +k[0-$dec_imgs] +if $apply_preview_image +if $1 +gui_split_preview "$_palette rep_transfer_color_reduced[^-1] :[-1],$_fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$_alpha_args rm.",${-3--1} +text_out="rep_transfer_color_reduced[^-1] :[-1]",$_fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$_alpha_args +else +gui_split_preview "$_palette rep_transfer_color_reduced[^-1] [-1],$_fx_rep_tcrc_dither,$1311,$1312,$_fx_rep_tcrc_windows_width,$_fx_rep_tcrc_window_height,$25,$24,$_alpha_args rm.",${-3--1} +text_out="rep_transfer_color_reduced[^-1] [-1]",$_fx_rep_tcrc_dither,$1311,$1312,$_fx_rep_tcrc_windows_width,$_fx_rep_tcrc_window_height,$25,$24,$_alpha_args +fi +else +foreach { +sh. 0,2 +100%,100%,100%,4 drgba. blend[-2] [-1],normal,.5 rm. +text_outline. "Awaiting\n palette",.5~,.5~,10% +rm. +} +fi +elif $6==1 +if s>2 sh[0] 0,2 +else sh[0] 0 +fi ++colormap. $23,0 +store. _palette +rm. +z $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1 +r $_preview_width,$_preview_height,1,100% +if $1 +gui_split_preview "$_palette rep_transfer_color_reduced[^-1] :[-1],$_fx_rep_tcrc_dither,$1311,$1312,$1317,0,$_alpha_args rm.",${-3--1} +text_box="+colormap $23 rep_transfer_color_reduced[^-1] :[-1]",$_fx_rep_tcrc_dither,$1311,$1312,$1317,0,$_alpha_args +else +gui_split_preview "$_palette rep_transfer_color_reduced[^-1] [-1],$_fx_rep_tcrc_dither,$1311,$1312,$_fx_rep_tcrc_windows_width,$_fx_rep_tcrc_window_height,$25,0,$_alpha_args rm.",${-3--1} +text_box="+colormap $23 $_palette rep_transfer_color_reduced[^-1] [-1]",$_fx_rep_tcrc_dither,$1311,$1312,$_fx_rep_tcrc_windows_width,$_fx_rep_tcrc_window_height,$25,0,$_alpha_args +fi +else ++pal $18 +if $19 +num_of_colors:=whd#-1 +channels.. 0,2 +image.. . +repeat 256 { color_$>={I(#-2,$>)} } +rm.. +pal_method=3 +fi +store. _palette +if $1 +gui_split_preview "$_palette rep_transfer_color_reduced[^-1] :[-1],$_fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$_alpha_args rm.",${-3--1} +text_box="rep_transfer_color_reduced[^-1] :[-1]",$_fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$_alpha_args +else +gui_split_preview "$_palette rep_transfer_color_reduced[^-1] [-1],$_fx_rep_tcrc_dither,$1311,$1312,$_fx_rep_tcrc_windows_width,$_fx_rep_tcrc_window_height,$25,$24,$_alpha_args rm.",${-3--1} +text_box="rep_transfer_color_reduced[^-1] [-1]",$_fx_rep_tcrc_dither,$1311,$1312,$_fx_rep_tcrc_windows_width,$_fx_rep_tcrc_window_height,$25,$24,$_alpha_args +fi +fi +else +if $7 +if $17 _tcrc_arg={2^$13} +else _tcrc_arg={2^$14}:{2^$15}:{2^$16} +fi +else +if $12 _tcrc_arg=$8 +else _tcrc_arg=$9:$10:$11 +fi +fi +gui_split_preview "rep_transfer_color_reduced $_tcrc_arg,$_fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$_alpha_args",${-3--1} +text_box="rep_transfer_color_reduced "$_tcrc_arg,$_fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$_alpha_args +fi +out_status=4 +message_out="" +status_color=${1331-1333} +if $pal_method!=2 +if $1328 +pixel_width,pixel_height=${1311-1312} +pixel_ratio_gcd={gcd($pixel_width,$pixel_height)} +if $pixel_ratio_gcd>1 pixel_width,pixel_height/=$pixel_ratio_gcd fi +if min($pixel_width,$pixel_height)>1 out_status=1 +else +f_w={$original_width/$pixel_width} +f_h={$original_height/$pixel_height} +if ($f_w!=int($f_w))||($f_h!=int($f_h)) out_status=3 fi +fi +fi +else out_status=2 +fi +if $out_status==4 +message_out="Pass!" +status_color=62,205,0 +elif $out_status==3 +message_out="Output Trimmed. Proceed Anyway." +status_color=255,194,0 +else +if $out_status==2 message_out="Exit out of Import Mode to proceed with output" +else message_out="Will not output!" +fi +status_color=170,43,0 +fi +display_palette:=$use_pal&&($pal_method==3) +u "{$1}""{$2}_"{$3?1:2}"{$3}""{$4}_"{$3?2:1}"{$5}_"{$1?2}"{"$pal_method"}_"{$1?(!$5?2):2}"{$7}_"{$1&&$5?2}"{$8}_"{$1&&$5&&!$7?($12?2)}"{$9}_"{$1&&$5&&!$7?(!$12?2)}"{$10}_"{$1&&$5&&!$7?(!$12?2)}"{$11}_"{$1&&$5&&!$7?(!$12?2)}"{$12}_"{$1&&$5&&!$7?2}"{$13}_"{$1&&$5&&$7?($17?2)}"{$14}_"{$1&&$5&&$7?(!$17?2)}"{$15}_"{$1&&$5&&$7?(!$17?2)}"{$16}_"{$1&&$5&&$7?(!$17?2)}"{$17}_"{$1&&$5&&$7?2}"{$18}_"{$1?(!$5?(!$pal_method?2)):(!$pal_method?2)}"{0}_"{$1?(!$5?(!$pal_method?2)):(!$pal_method?2)}"{$20}_"{$1?(!$5?($pal_method==2?2)):($pal_method==2?2)}"{0}_"{$1?(!$5?($pal_method==2?2)):($pal_method==2?($imported?2:1))}"{"$num_of_colors"}_"{$1?(!$5?($pal_method==3?2)):($pal_method==3?2)}"{$23}_"{$1?(!$5?($pal_method==1?2)):($pal_method==1?2)}"{$24}_"{$1?(!$5?($pal_method!=1?2)):($pal_method!=1?2)}"{$25}_"{!$1?2}"{$26}_"{$display_palette?2}"{$27}_"{$26&&$display_palette?2}"{0}_"{$26&&$display_palette&&$27?2}"{"$color_0"}_"{$26&&$display_palette&&(0<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(0<$num_of_colors)?(!$27?1+($num_of_colors!=2))}"{0}_"{$26&&$display_palette&&(0<$num_of_colors)?($27?2)}"{"$color_1"}_"{$26&&$display_palette&&(1<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(1<$num_of_colors)?(!$27?1+($num_of_colors!=2))}"{0}_"{$26&&$display_palette&&(1<$num_of_colors)?($27?2)}"{"$color_2"}_"{$26&&$display_palette&&(2<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(2<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(2<$num_of_colors)?($27?2)}"{"$color_3"}_"{$26&&$display_palette&&(3<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(3<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(3<$num_of_colors)?($27?2)}"{"$color_4"}_"{$26&&$display_palette&&(4<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(4<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(4<$num_of_colors)?($27?2)}"{"$color_5"}_"{$26&&$display_palette&&(5<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(5<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(5<$num_of_colors)?($27?2)}"{"$color_6"}_"{$26&&$display_palette&&(6<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(6<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(6<$num_of_colors)?($27?2)}"{"$color_7"}_"{$26&&$display_palette&&(7<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(7<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(7<$num_of_colors)?($27?2)}"{"$color_8"}_"{$26&&$display_palette&&(8<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(8<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(8<$num_of_colors)?($27?2)}"{"$color_9"}_"{$26&&$display_palette&&(9<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(9<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(9<$num_of_colors)?($27?2)}"{"$color_10"}_"{$26&&$display_palette&&(10<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(10<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(10<$num_of_colors)?($27?2)}"{"$color_11"}_"{$26&&$display_palette&&(11<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(11<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(11<$num_of_colors)?($27?2)}"{"$color_12"}_"{$26&&$display_palette&&(12<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(12<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(12<$num_of_colors)?($27?2)}"{"$color_13"}_"{$26&&$display_palette&&(13<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(13<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(13<$num_of_colors)?($27?2)}"{"$color_14"}_"{$26&&$display_palette&&(14<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(14<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(14<$num_of_colors)?($27?2)}"{"$color_15"}_"{$26&&$display_palette&&(15<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(15<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(15<$num_of_colors)?($27?2)}"{"$color_16"}_"{$26&&$display_palette&&(16<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(16<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(16<$num_of_colors)?($27?2)}"{"$color_17"}_"{$26&&$display_palette&&(17<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(17<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(17<$num_of_colors)?($27?2)}"{"$color_18"}_"{$26&&$display_palette&&(18<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(18<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(18<$num_of_colors)?($27?2)}"{"$color_19"}_"{$26&&$display_palette&&(19<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(19<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(19<$num_of_colors)?($27?2)}"{"$color_20"}_"{$26&&$display_palette&&(20<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(20<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(20<$num_of_colors)?($27?2)}"{"$color_21"}_"{$26&&$display_palette&&(21<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(21<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(21<$num_of_colors)?($27?2)}"{"$color_22"}_"{$26&&$display_palette&&(22<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(22<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(22<$num_of_colors)?($27?2)}"{"$color_23"}_"{$26&&$display_palette&&(23<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(23<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(23<$num_of_colors)?($27?2)}"{"$color_24"}_"{$26&&$display_palette&&(24<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(24<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(24<$num_of_colors)?($27?2)}"{"$color_25"}_"{$26&&$display_palette&&(25<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(25<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(25<$num_of_colors)?($27?2)}"{"$color_26"}_"{$26&&$display_palette&&(26<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(26<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(26<$num_of_colors)?($27?2)}"{"$color_27"}_"{$26&&$display_palette&&(27<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(27<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(27<$num_of_colors)?($27?2)}"{"$color_28"}_"{$26&&$display_palette&&(28<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(28<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(28<$num_of_colors)?($27?2)}"{"$color_29"}_"{$26&&$display_palette&&(29<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(29<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(29<$num_of_colors)?($27?2)}"{"$color_30"}_"{$26&&$display_palette&&(30<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(30<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(30<$num_of_colors)?($27?2)}"{"$color_31"}_"{$26&&$display_palette&&(31<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(31<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(31<$num_of_colors)?($27?2)}"{"$color_32"}_"{$26&&$display_palette&&(32<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(32<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(32<$num_of_colors)?($27?2)}"{"$color_33"}_"{$26&&$display_palette&&(33<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(33<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(33<$num_of_colors)?($27?2)}"{"$color_34"}_"{$26&&$display_palette&&(34<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(34<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(34<$num_of_colors)?($27?2)}"{"$color_35"}_"{$26&&$display_palette&&(35<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(35<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(35<$num_of_colors)?($27?2)}"{"$color_36"}_"{$26&&$display_palette&&(36<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(36<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(36<$num_of_colors)?($27?2)}"{"$color_37"}_"{$26&&$display_palette&&(37<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(37<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(37<$num_of_colors)?($27?2)}"{"$color_38"}_"{$26&&$display_palette&&(38<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(38<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(38<$num_of_colors)?($27?2)}"{"$color_39"}_"{$26&&$display_palette&&(39<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(39<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(39<$num_of_colors)?($27?2)}"{"$color_40"}_"{$26&&$display_palette&&(40<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(40<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(40<$num_of_colors)?($27?2)}"{"$color_41"}_"{$26&&$display_palette&&(41<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(41<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(41<$num_of_colors)?($27?2)}"{"$color_42"}_"{$26&&$display_palette&&(42<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(42<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(42<$num_of_colors)?($27?2)}"{"$color_43"}_"{$26&&$display_palette&&(43<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(43<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(43<$num_of_colors)?($27?2)}"{"$color_44"}_"{$26&&$display_palette&&(44<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(44<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(44<$num_of_colors)?($27?2)}"{"$color_45"}_"{$26&&$display_palette&&(45<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(45<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(45<$num_of_colors)?($27?2)}"{"$color_46"}_"{$26&&$display_palette&&(46<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(46<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(46<$num_of_colors)?($27?2)}"{"$color_47"}_"{$26&&$display_palette&&(47<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(47<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(47<$num_of_colors)?($27?2)}"{"$color_48"}_"{$26&&$display_palette&&(48<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(48<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(48<$num_of_colors)?($27?2)}"{"$color_49"}_"{$26&&$display_palette&&(49<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(49<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(49<$num_of_colors)?($27?2)}"{"$color_50"}_"{$26&&$display_palette&&(50<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(50<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(50<$num_of_colors)?($27?2)}"{"$color_51"}_"{$26&&$display_palette&&(51<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(51<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(51<$num_of_colors)?($27?2)}"{"$color_52"}_"{$26&&$display_palette&&(52<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(52<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(52<$num_of_colors)?($27?2)}"{"$color_53"}_"{$26&&$display_palette&&(53<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(53<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(53<$num_of_colors)?($27?2)}"{"$color_54"}_"{$26&&$display_palette&&(54<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(54<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(54<$num_of_colors)?($27?2)}"{"$color_55"}_"{$26&&$display_palette&&(55<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(55<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(55<$num_of_colors)?($27?2)}"{"$color_56"}_"{$26&&$display_palette&&(56<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(56<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(56<$num_of_colors)?($27?2)}"{"$color_57"}_"{$26&&$display_palette&&(57<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(57<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(57<$num_of_colors)?($27?2)}"{"$color_58"}_"{$26&&$display_palette&&(58<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(58<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(58<$num_of_colors)?($27?2)}"{"$color_59"}_"{$26&&$display_palette&&(59<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(59<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(59<$num_of_colors)?($27?2)}"{"$color_60"}_"{$26&&$display_palette&&(60<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(60<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(60<$num_of_colors)?($27?2)}"{"$color_61"}_"{$26&&$display_palette&&(61<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(61<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(61<$num_of_colors)?($27?2)}"{"$color_62"}_"{$26&&$display_palette&&(62<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(62<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(62<$num_of_colors)?($27?2)}"{"$color_63"}_"{$26&&$display_palette&&(63<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(63<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(63<$num_of_colors)?($27?2)}"{"$color_64"}_"{$26&&$display_palette&&(64<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(64<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(64<$num_of_colors)?($27?2)}"{"$color_65"}_"{$26&&$display_palette&&(65<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(65<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(65<$num_of_colors)?($27?2)}"{"$color_66"}_"{$26&&$display_palette&&(66<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(66<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(66<$num_of_colors)?($27?2)}"{"$color_67"}_"{$26&&$display_palette&&(67<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(67<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(67<$num_of_colors)?($27?2)}"{"$color_68"}_"{$26&&$display_palette&&(68<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(68<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(68<$num_of_colors)?($27?2)}"{"$color_69"}_"{$26&&$display_palette&&(69<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(69<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(69<$num_of_colors)?($27?2)}"{"$color_70"}_"{$26&&$display_palette&&(70<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(70<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(70<$num_of_colors)?($27?2)}"{"$color_71"}_"{$26&&$display_palette&&(71<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(71<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(71<$num_of_colors)?($27?2)}"{"$color_72"}_"{$26&&$display_palette&&(72<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(72<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(72<$num_of_colors)?($27?2)}"{"$color_73"}_"{$26&&$display_palette&&(73<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(73<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(73<$num_of_colors)?($27?2)}"{"$color_74"}_"{$26&&$display_palette&&(74<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(74<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(74<$num_of_colors)?($27?2)}"{"$color_75"}_"{$26&&$display_palette&&(75<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(75<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(75<$num_of_colors)?($27?2)}"{"$color_76"}_"{$26&&$display_palette&&(76<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(76<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(76<$num_of_colors)?($27?2)}"{"$color_77"}_"{$26&&$display_palette&&(77<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(77<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(77<$num_of_colors)?($27?2)}"{"$color_78"}_"{$26&&$display_palette&&(78<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(78<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(78<$num_of_colors)?($27?2)}"{"$color_79"}_"{$26&&$display_palette&&(79<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(79<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(79<$num_of_colors)?($27?2)}"{"$color_80"}_"{$26&&$display_palette&&(80<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(80<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(80<$num_of_colors)?($27?2)}"{"$color_81"}_"{$26&&$display_palette&&(81<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(81<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(81<$num_of_colors)?($27?2)}"{"$color_82"}_"{$26&&$display_palette&&(82<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(82<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(82<$num_of_colors)?($27?2)}"{"$color_83"}_"{$26&&$display_palette&&(83<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(83<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(83<$num_of_colors)?($27?2)}"{"$color_84"}_"{$26&&$display_palette&&(84<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(84<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(84<$num_of_colors)?($27?2)}"{"$color_85"}_"{$26&&$display_palette&&(85<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(85<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(85<$num_of_colors)?($27?2)}"{"$color_86"}_"{$26&&$display_palette&&(86<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(86<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(86<$num_of_colors)?($27?2)}"{"$color_87"}_"{$26&&$display_palette&&(87<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(87<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(87<$num_of_colors)?($27?2)}"{"$color_88"}_"{$26&&$display_palette&&(88<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(88<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(88<$num_of_colors)?($27?2)}"{"$color_89"}_"{$26&&$display_palette&&(89<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(89<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(89<$num_of_colors)?($27?2)}"{"$color_90"}_"{$26&&$display_palette&&(90<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(90<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(90<$num_of_colors)?($27?2)}"{"$color_91"}_"{$26&&$display_palette&&(91<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(91<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(91<$num_of_colors)?($27?2)}"{"$color_92"}_"{$26&&$display_palette&&(92<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(92<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(92<$num_of_colors)?($27?2)}"{"$color_93"}_"{$26&&$display_palette&&(93<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(93<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(93<$num_of_colors)?($27?2)}"{"$color_94"}_"{$26&&$display_palette&&(94<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(94<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(94<$num_of_colors)?($27?2)}"{"$color_95"}_"{$26&&$display_palette&&(95<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(95<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(95<$num_of_colors)?($27?2)}"{"$color_96"}_"{$26&&$display_palette&&(96<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(96<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(96<$num_of_colors)?($27?2)}"{"$color_97"}_"{$26&&$display_palette&&(97<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(97<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(97<$num_of_colors)?($27?2)}"{"$color_98"}_"{$26&&$display_palette&&(98<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(98<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(98<$num_of_colors)?($27?2)}"{"$color_99"}_"{$26&&$display_palette&&(99<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(99<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(99<$num_of_colors)?($27?2)}"{"$color_100"}_"{$26&&$display_palette&&(100<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(100<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(100<$num_of_colors)?($27?2)}"{"$color_101"}_"{$26&&$display_palette&&(101<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(101<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(101<$num_of_colors)?($27?2)}"{"$color_102"}_"{$26&&$display_palette&&(102<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(102<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(102<$num_of_colors)?($27?2)}"{"$color_103"}_"{$26&&$display_palette&&(103<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(103<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(103<$num_of_colors)?($27?2)}"{"$color_104"}_"{$26&&$display_palette&&(104<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(104<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(104<$num_of_colors)?($27?2)}"{"$color_105"}_"{$26&&$display_palette&&(105<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(105<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(105<$num_of_colors)?($27?2)}"{"$color_106"}_"{$26&&$display_palette&&(106<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(106<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(106<$num_of_colors)?($27?2)}"{"$color_107"}_"{$26&&$display_palette&&(107<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(107<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(107<$num_of_colors)?($27?2)}"{"$color_108"}_"{$26&&$display_palette&&(108<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(108<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(108<$num_of_colors)?($27?2)}"{"$color_109"}_"{$26&&$display_palette&&(109<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(109<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(109<$num_of_colors)?($27?2)}"{"$color_110"}_"{$26&&$display_palette&&(110<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(110<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(110<$num_of_colors)?($27?2)}"{"$color_111"}_"{$26&&$display_palette&&(111<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(111<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(111<$num_of_colors)?($27?2)}"{"$color_112"}_"{$26&&$display_palette&&(112<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(112<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(112<$num_of_colors)?($27?2)}"{"$color_113"}_"{$26&&$display_palette&&(113<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(113<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(113<$num_of_colors)?($27?2)}"{"$color_114"}_"{$26&&$display_palette&&(114<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(114<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(114<$num_of_colors)?($27?2)}"{"$color_115"}_"{$26&&$display_palette&&(115<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(115<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(115<$num_of_colors)?($27?2)}"{"$color_116"}_"{$26&&$display_palette&&(116<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(116<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(116<$num_of_colors)?($27?2)}"{"$color_117"}_"{$26&&$display_palette&&(117<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(117<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(117<$num_of_colors)?($27?2)}"{"$color_118"}_"{$26&&$display_palette&&(118<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(118<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(118<$num_of_colors)?($27?2)}"{"$color_119"}_"{$26&&$display_palette&&(119<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(119<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(119<$num_of_colors)?($27?2)}"{"$color_120"}_"{$26&&$display_palette&&(120<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(120<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(120<$num_of_colors)?($27?2)}"{"$color_121"}_"{$26&&$display_palette&&(121<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(121<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(121<$num_of_colors)?($27?2)}"{"$color_122"}_"{$26&&$display_palette&&(122<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(122<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(122<$num_of_colors)?($27?2)}"{"$color_123"}_"{$26&&$display_palette&&(123<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(123<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(123<$num_of_colors)?($27?2)}"{"$color_124"}_"{$26&&$display_palette&&(124<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(124<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(124<$num_of_colors)?($27?2)}"{"$color_125"}_"{$26&&$display_palette&&(125<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(125<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(125<$num_of_colors)?($27?2)}"{"$color_126"}_"{$26&&$display_palette&&(126<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(126<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(126<$num_of_colors)?($27?2)}"{"$color_127"}_"{$26&&$display_palette&&(127<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(127<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(127<$num_of_colors)?($27?2)}"{"$color_128"}_"{$26&&$display_palette&&(128<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(128<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(128<$num_of_colors)?($27?2)}"{"$color_129"}_"{$26&&$display_palette&&(129<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(129<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(129<$num_of_colors)?($27?2)}"{"$color_130"}_"{$26&&$display_palette&&(130<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(130<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(130<$num_of_colors)?($27?2)}"{"$color_131"}_"{$26&&$display_palette&&(131<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(131<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(131<$num_of_colors)?($27?2)}"{"$color_132"}_"{$26&&$display_palette&&(132<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(132<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(132<$num_of_colors)?($27?2)}"{"$color_133"}_"{$26&&$display_palette&&(133<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(133<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(133<$num_of_colors)?($27?2)}"{"$color_134"}_"{$26&&$display_palette&&(134<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(134<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(134<$num_of_colors)?($27?2)}"{"$color_135"}_"{$26&&$display_palette&&(135<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(135<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(135<$num_of_colors)?($27?2)}"{"$color_136"}_"{$26&&$display_palette&&(136<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(136<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(136<$num_of_colors)?($27?2)}"{"$color_137"}_"{$26&&$display_palette&&(137<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(137<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(137<$num_of_colors)?($27?2)}"{"$color_138"}_"{$26&&$display_palette&&(138<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(138<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(138<$num_of_colors)?($27?2)}"{"$color_139"}_"{$26&&$display_palette&&(139<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(139<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(139<$num_of_colors)?($27?2)}"{"$color_140"}_"{$26&&$display_palette&&(140<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(140<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(140<$num_of_colors)?($27?2)}"{"$color_141"}_"{$26&&$display_palette&&(141<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(141<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(141<$num_of_colors)?($27?2)}"{"$color_142"}_"{$26&&$display_palette&&(142<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(142<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(142<$num_of_colors)?($27?2)}"{"$color_143"}_"{$26&&$display_palette&&(143<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(143<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(143<$num_of_colors)?($27?2)}"{"$color_144"}_"{$26&&$display_palette&&(144<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(144<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(144<$num_of_colors)?($27?2)}"{"$color_145"}_"{$26&&$display_palette&&(145<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(145<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(145<$num_of_colors)?($27?2)}"{"$color_146"}_"{$26&&$display_palette&&(146<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(146<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(146<$num_of_colors)?($27?2)}"{"$color_147"}_"{$26&&$display_palette&&(147<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(147<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(147<$num_of_colors)?($27?2)}"{"$color_148"}_"{$26&&$display_palette&&(148<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(148<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(148<$num_of_colors)?($27?2)}"{"$color_149"}_"{$26&&$display_palette&&(149<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(149<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(149<$num_of_colors)?($27?2)}"{"$color_150"}_"{$26&&$display_palette&&(150<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(150<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(150<$num_of_colors)?($27?2)}"{"$color_151"}_"{$26&&$display_palette&&(151<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(151<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(151<$num_of_colors)?($27?2)}"{"$color_152"}_"{$26&&$display_palette&&(152<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(152<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(152<$num_of_colors)?($27?2)}"{"$color_153"}_"{$26&&$display_palette&&(153<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(153<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(153<$num_of_colors)?($27?2)}"{"$color_154"}_"{$26&&$display_palette&&(154<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(154<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(154<$num_of_colors)?($27?2)}"{"$color_155"}_"{$26&&$display_palette&&(155<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(155<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(155<$num_of_colors)?($27?2)}"{"$color_156"}_"{$26&&$display_palette&&(156<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(156<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(156<$num_of_colors)?($27?2)}"{"$color_157"}_"{$26&&$display_palette&&(157<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(157<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(157<$num_of_colors)?($27?2)}"{"$color_158"}_"{$26&&$display_palette&&(158<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(158<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(158<$num_of_colors)?($27?2)}"{"$color_159"}_"{$26&&$display_palette&&(159<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(159<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(159<$num_of_colors)?($27?2)}"{"$color_160"}_"{$26&&$display_palette&&(160<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(160<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(160<$num_of_colors)?($27?2)}"{"$color_161"}_"{$26&&$display_palette&&(161<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(161<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(161<$num_of_colors)?($27?2)}"{"$color_162"}_"{$26&&$display_palette&&(162<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(162<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(162<$num_of_colors)?($27?2)}"{"$color_163"}_"{$26&&$display_palette&&(163<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(163<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(163<$num_of_colors)?($27?2)}"{"$color_164"}_"{$26&&$display_palette&&(164<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(164<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(164<$num_of_colors)?($27?2)}"{"$color_165"}_"{$26&&$display_palette&&(165<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(165<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(165<$num_of_colors)?($27?2)}"{"$color_166"}_"{$26&&$display_palette&&(166<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(166<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(166<$num_of_colors)?($27?2)}"{"$color_167"}_"{$26&&$display_palette&&(167<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(167<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(167<$num_of_colors)?($27?2)}"{"$color_168"}_"{$26&&$display_palette&&(168<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(168<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(168<$num_of_colors)?($27?2)}"{"$color_169"}_"{$26&&$display_palette&&(169<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(169<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(169<$num_of_colors)?($27?2)}"{"$color_170"}_"{$26&&$display_palette&&(170<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(170<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(170<$num_of_colors)?($27?2)}"{"$color_171"}_"{$26&&$display_palette&&(171<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(171<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(171<$num_of_colors)?($27?2)}"{"$color_172"}_"{$26&&$display_palette&&(172<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(172<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(172<$num_of_colors)?($27?2)}"{"$color_173"}_"{$26&&$display_palette&&(173<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(173<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(173<$num_of_colors)?($27?2)}"{"$color_174"}_"{$26&&$display_palette&&(174<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(174<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(174<$num_of_colors)?($27?2)}"{"$color_175"}_"{$26&&$display_palette&&(175<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(175<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(175<$num_of_colors)?($27?2)}"{"$color_176"}_"{$26&&$display_palette&&(176<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(176<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(176<$num_of_colors)?($27?2)}"{"$color_177"}_"{$26&&$display_palette&&(177<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(177<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(177<$num_of_colors)?($27?2)}"{"$color_178"}_"{$26&&$display_palette&&(178<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(178<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(178<$num_of_colors)?($27?2)}"{"$color_179"}_"{$26&&$display_palette&&(179<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(179<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(179<$num_of_colors)?($27?2)}"{"$color_180"}_"{$26&&$display_palette&&(180<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(180<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(180<$num_of_colors)?($27?2)}"{"$color_181"}_"{$26&&$display_palette&&(181<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(181<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(181<$num_of_colors)?($27?2)}"{"$color_182"}_"{$26&&$display_palette&&(182<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(182<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(182<$num_of_colors)?($27?2)}"{"$color_183"}_"{$26&&$display_palette&&(183<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(183<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(183<$num_of_colors)?($27?2)}"{"$color_184"}_"{$26&&$display_palette&&(184<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(184<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(184<$num_of_colors)?($27?2)}"{"$color_185"}_"{$26&&$display_palette&&(185<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(185<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(185<$num_of_colors)?($27?2)}"{"$color_186"}_"{$26&&$display_palette&&(186<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(186<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(186<$num_of_colors)?($27?2)}"{"$color_187"}_"{$26&&$display_palette&&(187<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(187<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(187<$num_of_colors)?($27?2)}"{"$color_188"}_"{$26&&$display_palette&&(188<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(188<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(188<$num_of_colors)?($27?2)}"{"$color_189"}_"{$26&&$display_palette&&(189<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(189<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(189<$num_of_colors)?($27?2)}"{"$color_190"}_"{$26&&$display_palette&&(190<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(190<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(190<$num_of_colors)?($27?2)}"{"$color_191"}_"{$26&&$display_palette&&(191<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(191<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(191<$num_of_colors)?($27?2)}"{"$color_192"}_"{$26&&$display_palette&&(192<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(192<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(192<$num_of_colors)?($27?2)}"{"$color_193"}_"{$26&&$display_palette&&(193<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(193<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(193<$num_of_colors)?($27?2)}"{"$color_194"}_"{$26&&$display_palette&&(194<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(194<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(194<$num_of_colors)?($27?2)}"{"$color_195"}_"{$26&&$display_palette&&(195<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(195<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(195<$num_of_colors)?($27?2)}"{"$color_196"}_"{$26&&$display_palette&&(196<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(196<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(196<$num_of_colors)?($27?2)}"{"$color_197"}_"{$26&&$display_palette&&(197<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(197<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(197<$num_of_colors)?($27?2)}"{"$color_198"}_"{$26&&$display_palette&&(198<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(198<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(198<$num_of_colors)?($27?2)}"{"$color_199"}_"{$26&&$display_palette&&(199<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(199<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(199<$num_of_colors)?($27?2)}"{"$color_200"}_"{$26&&$display_palette&&(200<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(200<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(200<$num_of_colors)?($27?2)}"{"$color_201"}_"{$26&&$display_palette&&(201<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(201<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(201<$num_of_colors)?($27?2)}"{"$color_202"}_"{$26&&$display_palette&&(202<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(202<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(202<$num_of_colors)?($27?2)}"{"$color_203"}_"{$26&&$display_palette&&(203<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(203<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(203<$num_of_colors)?($27?2)}"{"$color_204"}_"{$26&&$display_palette&&(204<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(204<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(204<$num_of_colors)?($27?2)}"{"$color_205"}_"{$26&&$display_palette&&(205<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(205<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(205<$num_of_colors)?($27?2)}"{"$color_206"}_"{$26&&$display_palette&&(206<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(206<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(206<$num_of_colors)?($27?2)}"{"$color_207"}_"{$26&&$display_palette&&(207<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(207<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(207<$num_of_colors)?($27?2)}"{"$color_208"}_"{$26&&$display_palette&&(208<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(208<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(208<$num_of_colors)?($27?2)}"{"$color_209"}_"{$26&&$display_palette&&(209<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(209<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(209<$num_of_colors)?($27?2)}"{"$color_210"}_"{$26&&$display_palette&&(210<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(210<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(210<$num_of_colors)?($27?2)}"{"$color_211"}_"{$26&&$display_palette&&(211<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(211<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(211<$num_of_colors)?($27?2)}"{"$color_212"}_"{$26&&$display_palette&&(212<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(212<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(212<$num_of_colors)?($27?2)}"{"$color_213"}_"{$26&&$display_palette&&(213<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(213<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(213<$num_of_colors)?($27?2)}"{"$color_214"}_"{$26&&$display_palette&&(214<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(214<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(214<$num_of_colors)?($27?2)}"{"$color_215"}_"{$26&&$display_palette&&(215<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(215<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(215<$num_of_colors)?($27?2)}"{"$color_216"}_"{$26&&$display_palette&&(216<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(216<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(216<$num_of_colors)?($27?2)}"{"$color_217"}_"{$26&&$display_palette&&(217<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(217<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(217<$num_of_colors)?($27?2)}"{"$color_218"}_"{$26&&$display_palette&&(218<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(218<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(218<$num_of_colors)?($27?2)}"{"$color_219"}_"{$26&&$display_palette&&(219<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(219<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(219<$num_of_colors)?($27?2)}"{"$color_220"}_"{$26&&$display_palette&&(220<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(220<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(220<$num_of_colors)?($27?2)}"{"$color_221"}_"{$26&&$display_palette&&(221<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(221<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(221<$num_of_colors)?($27?2)}"{"$color_222"}_"{$26&&$display_palette&&(222<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(222<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(222<$num_of_colors)?($27?2)}"{"$color_223"}_"{$26&&$display_palette&&(223<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(223<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(223<$num_of_colors)?($27?2)}"{"$color_224"}_"{$26&&$display_palette&&(224<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(224<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(224<$num_of_colors)?($27?2)}"{"$color_225"}_"{$26&&$display_palette&&(225<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(225<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(225<$num_of_colors)?($27?2)}"{"$color_226"}_"{$26&&$display_palette&&(226<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(226<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(226<$num_of_colors)?($27?2)}"{"$color_227"}_"{$26&&$display_palette&&(227<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(227<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(227<$num_of_colors)?($27?2)}"{"$color_228"}_"{$26&&$display_palette&&(228<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(228<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(228<$num_of_colors)?($27?2)}"{"$color_229"}_"{$26&&$display_palette&&(229<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(229<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(229<$num_of_colors)?($27?2)}"{"$color_230"}_"{$26&&$display_palette&&(230<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(230<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(230<$num_of_colors)?($27?2)}"{"$color_231"}_"{$26&&$display_palette&&(231<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(231<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(231<$num_of_colors)?($27?2)}"{"$color_232"}_"{$26&&$display_palette&&(232<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(232<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(232<$num_of_colors)?($27?2)}"{"$color_233"}_"{$26&&$display_palette&&(233<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(233<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(233<$num_of_colors)?($27?2)}"{"$color_234"}_"{$26&&$display_palette&&(234<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(234<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(234<$num_of_colors)?($27?2)}"{"$color_235"}_"{$26&&$display_palette&&(235<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(235<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(235<$num_of_colors)?($27?2)}"{"$color_236"}_"{$26&&$display_palette&&(236<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(236<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(236<$num_of_colors)?($27?2)}"{"$color_237"}_"{$26&&$display_palette&&(237<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(237<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(237<$num_of_colors)?($27?2)}"{"$color_238"}_"{$26&&$display_palette&&(238<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(238<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(238<$num_of_colors)?($27?2)}"{"$color_239"}_"{$26&&$display_palette&&(239<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(239<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(239<$num_of_colors)?($27?2)}"{"$color_240"}_"{$26&&$display_palette&&(240<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(240<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(240<$num_of_colors)?($27?2)}"{"$color_241"}_"{$26&&$display_palette&&(241<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(241<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(241<$num_of_colors)?($27?2)}"{"$color_242"}_"{$26&&$display_palette&&(242<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(242<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(242<$num_of_colors)?($27?2)}"{"$color_243"}_"{$26&&$display_palette&&(243<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(243<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(243<$num_of_colors)?($27?2)}"{"$color_244"}_"{$26&&$display_palette&&(244<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(244<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(244<$num_of_colors)?($27?2)}"{"$color_245"}_"{$26&&$display_palette&&(245<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(245<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(245<$num_of_colors)?($27?2)}"{"$color_246"}_"{$26&&$display_palette&&(246<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(246<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(246<$num_of_colors)?($27?2)}"{"$color_247"}_"{$26&&$display_palette&&(247<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(247<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(247<$num_of_colors)?($27?2)}"{"$color_248"}_"{$26&&$display_palette&&(248<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(248<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(248<$num_of_colors)?($27?2)}"{"$color_249"}_"{$26&&$display_palette&&(249<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(249<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(249<$num_of_colors)?($27?2)}"{"$color_250"}_"{$26&&$display_palette&&(250<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(250<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(250<$num_of_colors)?($27?2)}"{"$color_251"}_"{$26&&$display_palette&&(251<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(251<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(251<$num_of_colors)?($27?2)}"{"$color_252"}_"{$26&&$display_palette&&(252<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(252<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(252<$num_of_colors)?($27?2)}"{"$color_253"}_"{$26&&$display_palette&&(253<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(253<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(253<$num_of_colors)?($27?2)}"{"$color_254"}_"{$26&&$display_palette&&(254<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(254<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(254<$num_of_colors)?($27?2)}"{"$color_255"}_"{$26&&$display_palette&&(255<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(255<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(255<$num_of_colors)?($27?2)}"{0}_"{$26&&$display_palette?2}"{0}_"{$26&&$display_palette&&$27?2}"{$1311}""{$1312}""{$1313}_"{!$1?((!$25||$tcrc_windows_width_check)?1:2)}"{"$tcrc_windows_width_check"}_"{!$1?(!$25?1:2)}"{$1315}_"{!$1?((!$25||$tcrc_windows_height_check)?1:2)}"{"$tcrc_windows_height_check"}_"{!$1?(!$25?1:2)}"{$1317}_"{$1?2}"{$1318}_"{$img_cont_alp?2}"{$1319}_"{$img_cont_alp?($1318?2:1)}"{$1320}_"{$img_cont_alp?($1318?2:1)}"{$1321}_"{$img_cont_alp?($1318?(!$1?2):(!$1?1))}"{$1322}_"{$img_cont_alp?($1318?($1?2):($1?1))}"{$1323}_"{$img_cont_alp?($1318?(!$1&&$1321==1?2):(!$1&&$1321==1?1))}"{$1324}_"{$img_cont_alp?($1318?(!$1?($1321==2?2:0)):(!$1?($1321==2?1:0)))}"{"$text_box"}""{$20}""{"$imported"}""{$1328}""{"$message_out"}""{"$out_status"}""{"$status_color"}""{$1334}""{$1335,$1336}" +fx_rep_tg3: +if $1 +convert_colors_fwd=${arg\ $1,rgb2ryb,rgb2cmy,rgb2hsi8,rgb2hsl8,rgb2hsv8,rgb2lab8,rgb2lch8,rgb2yiq8,rgb2yuv8,rgb2xyz8,rgb2yes8,rgb2ohta8,rgb2k18} +convert_colors_bwd=${arg\ $1,ryb2rgb,cmy2rgb,hsi82rgb,hsl82rgb,hsv82rgb,lab82rgb,lch82rgb,yiq82rgb,yuv82rgb,xyz82rgb,yes82rgb,ohta82rgb,k182rgb} +fi +foreach { +if s==4 s c,-3 +store.. color store. alpha contain_alpha=1 +elif s<2 continue +else +store color contain_alpha=0 +fi +sh. 0,2 +if $1 $convert_colors_fwd. fi +if $2 rep_tg3. 8il,$4,${11-31} +else rep_tg3. 8i,$4,${11-31} +fi +if $1 $convert_colors_bwd. fi +cut. 0,255 +rm. +if $3 $color blend luminance fi +if $contain_alpha $alpha a c fi +} +fx_rep_tg3_preview: +cc1,cc2,cc3,cc4,cc5,cc6=$5,$6,$7,$8,$9,$10 +cc=[$cc1,$cc2,$cc3,$cc4,$cc5,$cc6] +cc={($cc)[$4]} +cc1,cc2,cc3,cc4,cc5,cc6={[$cc,$cc,$cc,$cc,$cc,$cc]} +gui_split_preview "fx_rep_tg3 ${1-31}",${-3--1} +a={((($4==0&&$5==0)||($4==1&&$6==0))||(($4==2&&$7==0)||($4==3&&$8==0)))||(($4==4&&$9==0)||($4==5&&$10==0))?2:0} +b={((($4==0&&$5==1)||($4==1&&$6==1))||(($4==2&&$7==1)||($4==3&&$8==1)))||(($4==4&&$9==1)||($4==5&&$10==1))?2:0} +c={((($4==0&&$5==2)||($4==1&&$6==2))||(($4==2&&$7==2)||($4==3&&$8==2)))||(($4==4&&$9==2)||($4==5&&$10==2))?2:0} +u "{$1}""{$2}""{$3}""{$4}""{"$cc1"}_"{$4==0?2:0}"{"$cc2"}_"{$4==1?2:0}"{"$cc3"}_"{$4==2?2:0}"{"$cc4"}_"{$4==3?2:0}"{"$cc5"}_"{$4==4?2:0}"{"$cc6"}_"{$4==5?2:0}"{$11}_"$a"{$12}_"$a"{$13}_"$a"{$14}_"$a"{$15}_"$a"{$16}_"$a"{$17}_"$a"{$18}_"$b"{$19}_"$b"{$20}_"$b"{$21}_"$b"{$22}_"$b"{$23}_"$b"{$24}_"$b"{$25}_"$c"{$26}_"$c"{$27}_"$c"{$28}_"$c"{$29}_"$c"{$30}_"$c"{$31}_"$c"{$32}""{$33,$34}" +fx_rep_self_referential_formula: +skip "$*" rm $_persistent +if $1 remove_named tuppers_image_mode_0 +else remove_named tuppers_self_image_base keep[0] +fi +* 255 +fx_rep_self_referential_formula_preview: +skip "$*" +mode_K_a=$1 +mode_K_b=$2 +k_a=$5 +k_b=$6 +predefined_K=$8 +copy_from_stored_value=$9 +negate_after_using_k_input_a=$10 +negate_after_using_k_input_b=$11 +k_value_from_images="$13" +pre_negation_a=$14 +pre_negation_b=$15 +allow_example=$16 +allow_mode_switch=$17 +started=$18 +user_mode_a={$allow_example?$3} +user_mode_b={$allow_example?$4} +mode_K_diff,K_diff,negate_after_K_input_diff,user_diff,pre_negation_diff,copy_from_stored_K_value={[$mode_K_a!=$mode_K_b,'$k_a'!='$k_b',$negate_after_using_k_input_a!=$negate_after_using_k_input_b,$user_mode_a!=$user_mode_b,$pre_negation_a!=$pre_negation_b,$9]} +activate_changes={$mode_K_a?$pre_negation_diff:($mode_K_diff||$K_diff||$negate_after_K_input_diff||$user_diff||$copy_from_stored_K_value)} +if $started&&narg($_persistent) +if $activate_changes +if $mode_K_a +rm $_persistent +rep_tuppers_self_K[tuppers_self_image_base] $pre_negation_a +store _persistent +('${}') +if !$allow_mode_switch +replace_str ",","\n\n" +fi +k_value_from_images={t} +rm +else +if $negate_after_K_input_diff +rm $_persistent +negate[tuppers_image_mode_0] +store _persistent +else +width,height={[w,h]} +rm $_persistent +store temporary_image +$width,$height +if $user_diff||$mode_K_diff +if $user_mode_a +predefined_K=${arg\ $user_mode_a,960939379918958884971672962127852754715004339660129306651505519271702802395266424689642842174350718121267153782770623355993237280874144307891325963941337723487857735749823926629715517173716995165232890538221612403238855866184013235585136048828693337902491454229288667081096184496091705183454067827731551705405381627380967602565625016981482083418783163849115590225610003652351370343874461848378737238198224849863465033159410054974700593138339226497249461751545728366702369745461014655997933798537483143786841806593422227898388722980000748404719,395237837253173619377196292693949302406153931873024916260538490717335936871532361396117451541392229602948889604348128275446264586897474193776400465275167777832622157773372879463606146128022620285693891540788235229239672405060120203686774511468011972485984983535894919421543461759499096362152894616017344239642743391778941134500105852623176726707340602287941750635663845779675174278129608159631247023276032,1162909606774227786762360554904656873467005634722346243123857684508335800080212296528535403972500597220234608121734983386023291518966099546891430040655179625172067449629161883859511896818291049959507502002794829515164438990867773160767189319641778161093019870270482668056135958042158788515967843798733586173623987894941361961956503217167249393827582112256509171868414221167242597679368110852891933106118102448936895420986905619254557683605421985950220457144259359231632456877367983992190446749365022925067669913265323579719756925062086656,1843812769630219797102194898630589042838024531800431544407803208699762220759288686771851688175304525277287596637929619481851566234761209320517998687008822582390183399326187543197624279014134019615905245154166656477378450656137074612544163896000320136805982694616420881365676363963235184229519627621212049120298076086417612215067181351396556381877005473113076180736051591032787133962681831575450591579944470027127255325865144199772221608835705143631909500064802696725673323645838019575905814384115925441812137010043170716647424} +rep_tuppers_self $predefined_K,$negate_after_using_k_input_a +else +rep_tuppers_self $k_a,$negate_after_using_k_input_a +fi +fi +if $K_diff +rep_tuppers_self $k_a,$negate_after_using_k_input_a +fi +if $copy_from_stored_K_value +rep_tuppers_self $k_value_from_images,$negate_after_using_k_input_a +k_a=$k_value_from_images +fi +name tuppers_image_mode_0 +$temporary_image +temporary_image,activate_changes=0 +store _persistent +fi +fi +fi +else +n_imgs={$!} +mode_K_a=1 +negate_after_using_k_input=$pre_negation_a +if $!>1 +allow_mode_switch=0 +reverse +fi +eval " +standard_image_size=[106,17]; +allow_example=1; +repeat($n_imgs,img_id, +if([w#img_id,h#img_id]!=standard_image_size, +allow_example=0; +break(); +); +); +allow_example; +" +allow_example=${} +rep_tuppers_self_K $pre_negation_a +name tuppers_self_image_base +store _persistent +if $allow_mode_switch +k_a,k_b,k_value_from_images=${} +else +('${}') +replace_str ",","\n\n" +k_value_from_images={t} +rm +fi +fi +rm $_persistent +if $mode_K_a +remove_named tuppers_image_mode_0 +if !$allow_mode_switch +append y +fi +else +remove_named tuppers_self_image_base +fi +* 255 +u "{"$mode_K_a"}_"{$allow_mode_switch*2}"{"$mode_K_a"}""{"$user_mode_a"}_"{!$mode_K_a?$allow_example*2}"{"$user_mode_a"}""{"$k_a"}_"{2*(!$mode_K_a&&!$user_mode_a)}"{"$k_a"}""{"$predefined_K"}_"{(!$mode_K_a&&$user_mode_a)*2}"{"$predefined_K"}""{0}_"{!$mode_K_a?(!$user_mode_a?1+('$k_a'!='$k_value_from_images'))}"{"$negate_after_using_k_input_a"}_"{2*!$mode_K_a}"{"$negate_after_using_k_input_a"}""{"$k_value_from_images"}_"{$mode_K_a?2}"{"$k_value_from_images"}""{"$pre_negation_a"}_"{$mode_K_a?2}"{"$pre_negation_a"}""{"$allow_example"}""{"$allow_mode_switch"}""{1}" +fx_rep_vibrance_ych: +rep_vibrance_ych {$1/100} +fx_rep_vibrance_ych_preview: +gui_split_preview "fx_rep_vibrance_ych $1",${-3--1} +fx_vibrato: +split_opacity +local[0] +if $1==1 rgb2cmy +elif $1==2 rgb2hsi8 +elif $1==3 rgb2hsl8 +elif $1==4 rgb2hsv8 +elif $1==5 rgb2lab8 +elif $1==6 rgb2lch8 +elif $1==7 rgb2ycbcr +elif $1==8 rgb2ycbcrglic +elif $1==9 rgb2yuv8 +elif $1==10 rgb2yiq8 +elif $1==11 rgb2xyz8 +elif $1==12 rgb2bayer 0 +fi +s c +if $2==1 +if $3==1 -vibrato[0] $8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22 fi +if $4==1 -vibrato[1] $8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22 fi +if $5==1 -vibrato[2] $8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22 fi +elif $2==0 +if $23==1 -vibrato[0] $24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38 fi +if $39==1 -vibrato[1] $40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$53,$54 fi +if $55==1 -vibrato[2] $56,$57,$58,$59,$60,$61,$62,$63,$64,$65,$66,$67,$68,$69,$70 fi +fi +a c +if $1==1 cmy2rgb +elif $1==2 hsi82rgb +elif $1==3 hsl82rgb +elif $1==4 hsv82rgb +elif $1==5 lab82rgb +elif $1==6 lch82rgb +elif $1==7 ycbcr2rgb +elif $1==8 ycbcrglic2rgb +elif $1==9 yuv82rgb +elif $1==10 yiq82rgb +elif $1==11 xyz82rgb +elif $1==12 bayer2rgb 0,0,0 +fi +done +if $2==1 +if $6==1 -vibrato[1] $8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$7,$19,$20,$21,$22 fi +elif $2==0 +if $71==1 -vibrato[1] $72,$73,$74,$75,$76,$77,$78,$79,$80,$81,$82,$83,$84,$85,$86 fi +fi +a c +vibrato: +foreach { +n 0,255 +f " +q=($8/100)*w; +l=($9/100)*h; +X=(($1?w-x+q:x+q)/w-.5) * 2 * 1/$5 * 1/$7; +Y=(($2?h-y+l:y+l)/h-.5) * 2 * 1/$6 * 1/$7; +U=sqrt($3); +V=sqrt($4); +Z=((X-Y) * (X-U) * (X+U) * (Y-V) * (Y+V))+ $10; +C=(Z+((1-i/255)/(($3>1?$3:1/$3)*($4>1?$4:1/$4)))*$14)*(Z+((1-i/255)/(($3>1?$3:1/$3)*($4>1?$4:1/$4)))*$14); +F=abs(C)>1?C-int(C):C; +A=$12?F:1-F; +B=$11?(i*A):A*200; +E=$13/100*B+(1-$13/100)*i; +" +n 0,255 +mul $15 +mod 256 +} +_fx_vibrato_preview : +gui_split_preview "fx_vibrato ${1--2}",$-1 +fx_rep_w_rgb82gray: +rep_weighted_rgb82gray $1%,$2%,$3%,$4,$5%,$6%,$7,$8,$9 +fx_rep_w_rgb82gray_preview: +gui_split_preview "fx_rep_w_rgb82gray ${1-9}",${-3--1} +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}_"{$5&&$6?2:1}"{$8}""{$9}""{$10}""{$11,$12}" +plasma_transition: check "isint(${4=42}) && isint(${2=5}) && ${1=0.5}>=0 && $1<=1 && $2>=0 && ${3=1}>=0" +repeat int($!/2) +local[{$>},{$>+1}] +if $!<2 return fi +r ${-max_whds},3 +100%,100% srand $4 plasma. 1,0,$2 n. 0,1 ++<=. $1 b. $3 +rm.. +j... ..,0,0,0,0,1,. +k... +done +done +randomwaves : check "isint(${1=84}) && ${2=80}>=0 && $2<=100 && ${3=1.2}>0. && isint(${4=42})" +srand $4 +(0,1,0;1,0,1;0,1,0) /. 2 +=> matconv +{0,w},{0,h},1,1 set. 255,{u(100)}%,{u(100)}% +. +repeat $1 +. +if ${2}>=u(100) +circle. {u(100)}%,{u(100)}%,{u(3)},,255 +fi +convolve. [matconv] /. $3 -. ... +rm... +done +rm[-2,matconv] +g. a[-1,-2] c -warp[0] .,1 rm. +fx_adjust_orientation : +repeat $! +M={max(w,h)} ++gradient_norm. ge. $1% ++*. '1+y' *.. '1+x' a[-2,-1] c +r. {w*h},2,1,1,-1 sort. +,x autocrop. 0 +/. $M +r. 1,2,1,1,2 r. .. -[-2,-1] ++transpose. m*[-2,-1] +eigen. rm.. z. 0,0 +if i<0 *. -1 fi +theta={180*atan2(i(0,1),i)/pi} +rm. +if w>h rotate. {-$theta},1,0,50%,50% +else rotate. {-$theta+90},1,0,50%,50% +fi +mv. 0 done +fx_blur_quad : +mode=${"arg 1+$6,add,alpha,and,average,blue,burn,darken,difference,divide,dodge,edges,exclusion,freeze,grainextract,grainmerge,green,hardlight,hardmix,hue,interpolation,lighten,lightness,linearburn,linearlight,luminance,multiply,negation,or,overlay,pinlight,red,reflect,saturation,softburn,softdodge,softlight,screen,stamp,subtract,value,vividlight,xor"} +repeat $! l[$>] +100%,100%,1,3 +100%,100%,1,[0]," +begin( +const interpolation = 1; +const boundary = 1; +const w1 = w - 1; +const h1 = h - 1; +x0 = $8*w1%; y0 = $9*h1%; +x1 = $10*w1%; y1 = $11*h1%; +x2 = $12*w1%; y2 = $13*h1%; +x3 = $14*w1%; y3 = $15*h1%; +); +xw1 = x/w1; +yh1 = y/h1; +xl = lerp(x0,x3,yh1); +yl = lerp(y0,y3,yh1); +xr = lerp(x1,x2,yh1); +yr = lerp(y1,y2,yh1); +xc = lerp(xl,xr,xw1); +yc = lerp(yl,yr,xw1); +I(#1,round(xc),round(yc))+=[ x,y,1 ]; +I(#0,xc,yc)" +f.. "B?[ R,G,0 ]/B:[ -1,-1,0 ]" channels.. 0,1 +blur_xy. $1%,$2% +adjust_colors. ${3-5},0,0,0,255 +to_a. +100%,100%,1,1,1 a[-2,-1] c +warp. ..,0,1,0 rm.. +sh. 100% mul[-2,-1] channels. 0,{s-2} +blend[-2,-1] $mode,$7% +done done +fx_blur_quad_preview : +fx_blur_quad $* +polygon 4,$8%,$9%,$10%,$11%,$12%,$13%,$14%,$15%,0.5,0xCCCCCCCC,0,0,0,255 +polygon 4,$8%,$9%,$10%,$11%,$12%,$13%,$14%,$15%,0.5,0x33333333,255 +#@cli frame_round_old : _sharpness>0,_size>=0,_smoothness,_shading,_R,_G,_B,_A +#@cli : Draw RGBA-colored round frame in selected images. +#@cli : Default values: 'sharpness=10', 'size=10', 'smoothness=0', 'shading=0' and 'R=G=B=A=255'. +#@cli : $ image.jpg frame_round 10 +frame_round_old : skip ${1=10},${2=10},${3=0},${4=0},${5=255},${6=$5},${7=$6},${8=255} +e[^-1] "Draw round frame on image$?, with sharpness $1, size $2, smoothness $3, shading $4 and +RGBA color ($5,$6,$7,$8)." +to_rgba +foreach { +nm={n} +100%,100%,1,1,"-(abs(x/w-0.5)^$1 + abs(y/h-0.5)^$1)^(1/$1)" >=. $2% +if $4 distance. 1 n. 0,1 *. -1 +. 1 ^. {1/$4} fi +b. $3 i... 100%,100%,1,4 fc... $5,$6,$7,$8 blend_fade[0,1] . rm. +=> $nm +} +fx_apply_curve : +ac "_fx_apply_curve ${1-13}",$14,$15 +_fx_apply_curve : +apply_curve $13,0,$1,${"if $2>=0 u $2,$3, else u \"\" fi"}${"if $4>=0 u $4,$5, else u \"\" fi"}${"if $6>=0 u $6,$7, else u \"\" fi"}${"if $8>=0 u $8,$9, else u \"\" fi"}${"if $10>=0 u $10,$11, else u \"\" fi"}255,$12 +fx_apply_curve_preview : +function1d $13,0,$1,${"if $2>=0 u $2,$3, else u \"\" fi"}${"if $4>=0 u $4,$5, else u \"\" fi"}${"if $6>=0 u $6,$7, else u \"\" fi"}${"if $8>=0 u $8,$9, else u \"\" fi"}${"if $10>=0 u $10,$11, else u \"\" fi"}255,$12 +mv. 0 +repeat $!-1 ++gui_split_preview. "fx_apply_curve $*",$-1 +100%,100% axes. 0,255,255,0,13,1,255 +dilate. 3 r.. ... j... ..,0,0,0,0,1,.,255 rm[-2,-1] +grid. 10%,10%,0,0,0.3,0xCCCCCCCC,255 +line. 0,100%,100%,0,0.3,0xCCCCCCCC,255 +if $-2 +.,. to_gray... histogram... 256,0,255 graph. ...,3,0,0,0,1,1 -!=. 0 *. 255 rm... ++xor[-2,-1] j... .,0,0,0,0,$16,..,255 rm[-2,-1] +else rm.. fi +100%,100% graph. [0],1,0,255,0,1,255 +dilate. 3 r.. ... j... ..,0,0,0,0,1,.,255 rm[-2,-1] +_fx_apply_curve_preview 0,$1,0 _fx_apply_curve_preview $2,$3,1 +_fx_apply_curve_preview $4,$5,2 _fx_apply_curve_preview $6,$7,3 +_fx_apply_curve_preview $8,$9,4 _fx_apply_curve_preview $10,$11,5 +_fx_apply_curve_preview 255,$12,6 +mv. 1 done rm[0] +_fx_apply_curve_preview : +if $1>=0 +x={$1*100/255}% y={100-$2*100/255}% +ellipse. $x,$y,3,3,0,1,0xFFFFFFFF,0,0,0 ellipse. $x,$y,2,2,0,1,0,255,0 +t. $3,$x,{$y*h-20},13,1,255 +fi +fx_apply_Labcurve : skip $1 +fx_apply_Labcurve_configfile +repeat $!-1 l[$>,-1] +to_colormode[0] {max(3,s)} sh[0] 0,2 rgb2lab. rm. +sh[0] 0 *. 2.55 _fx_apply_Labcurve. {-2,@0-12} /. 2.55 rm. +sh[0] 1 +. 86 *. 1.38587 _fx_apply_Labcurve. {-2,@13-25} /. 1.38587 -. 86 rm. +sh[0] 2 +. 108 *. 1.25616 _fx_apply_Labcurve. {-2,@26-38} /. 1.25616 -. 108 rm. +sh[0] 0,2 lab2rgb. rm. +done done +rm. +_fx_apply_Labcurve : +apply_curve $13,0,$1,${"if $2>=0 u $2,$3, else u \"\" fi"}${"if $4>=0 u $4,$5, else u \"\" fi"}${"if $6>=0 u $6,$7, else u \"\" fi"}${"if $8>=0 u $8,$9, else u \"\" fi"}${"if $10>=0 u $10,$11, else u \"\" fi"}255,$12 +c 0,255 +fx_apply_Lcurve_preview : +fx_apply_Labcurve_configfile +sh. 0,0,0,0 f. ${1--3} rm. +fx_apply_Labcurve_preview[^-1] {^},0,${-2,-1} rm. +fx_apply_acurve_preview : +fx_apply_Labcurve_configfile +sh. 1,1,0,0 f. ${1--3} rm. +fx_apply_Labcurve_preview[^-1] {^},1,${-2,-1} rm. +fx_apply_bcurve_preview : +fx_apply_Labcurve_configfile +sh. 2,2,0,0 f. ${1--3} rm. +fx_apply_Labcurve_preview[^-1] {^},2,${-2,-1} rm. +fx_apply_Labcurve_configfile : +filename=${-path_tmp}.gmic_Labcurve.dlm +if isfile(['{/$filename}']) $filename else (0,-1,128,-1,128,-1,128,-1,128,-1,128,255,1) r. 100%,3 fi +fx_apply_Labcurve_preview : +(${1--3}) r. 13,3,1,1,-1 o. ${-path_tmp}.gmic_Labcurve.dlm rm. +function1d $13,0,$1,${"if $2>=0 u $2,$3, else u \"\" fi"}${"if $4>=0 u $4,$5, else u \"\" fi"}${"if $6>=0 u $6,$7, else u \"\" fi"}${"if $8>=0 u $8,$9, else u \"\" fi"}${"if $10>=0 u $10,$11, else u \"\" fi"}255,$12 +function1d $26,0,$14,${"if $15>=0 u $15,$16, else u \"\" fi"}${"if $17>=0 u $17,$18, else u \"\" fi"}${"if $19>=0 u $19,$20, else u \"\" fi"}${"if $21>=0 u $21,$22, else u \"\" fi"}${"if $23>=0 u $23,$24, else u \"\" fi"}255,$25 +function1d $39,0,$27,${"if $28>=0 u $28,$29, else u \"\" fi"}${"if $30>=0 u $30,$31, else u \"\" fi"}${"if $32>=0 u $32,$33, else u \"\" fi"}${"if $34>=0 u $34,$35, else u \"\" fi"}${"if $36>=0 u $36,$37, else u \"\" fi"}255,$38 +a[-3--1] y mv. 0 +repeat $!-1 ++gui_split_preview. "fx_apply_Labcurve 0",$-1 +axes. 0,255,255,0,13,1,255 +100%,100% axes. 0,255,255,0,13,1,255 +dilate. 3 r.. ... j... ..,0,0,0,0,1,.,255 rm[-2,-1] +grid. 10%,10%,0,0,0.3,0xCCCCCCCC,255 +line. 0,100%,100%,0,0.3,0xCCCCCCCC,255 +if $-2 +.,.,1,1,-{$-2*255/100} to_gray... histogram... 256,0,255 graph. ...,3,0,0,0,1,0 +rm... +. {$-2*255/100} +[-2,-1] c. 0,255 +else rm.. fi +line. 0,100%,100%,0,0.3,0xCCCCCCCC,255 +sh[0] 0,0,0,0 +graph.. .,1,0,255,0,1,255,255,255 -. 1 +graph.. .,1,0,255,0,0.5,200,200,200 rm. +sh[0] 1,1,0,0 +graph.. .,1,0,255,0,1,255,128,128 -. 1 +graph.. .,1,0,255,0,0.5,200,0,0 rm. +sh[0] 2,2,0,0 +graph.. .,1,0,255,0,1,128,128,255 -. 1 +graph.. .,1,0,255,0,0.5,0,0,200 rm. +if $40==0 +_fx_apply_curve_preview 0,$1,0 _fx_apply_curve_preview $2,$3,1 +_fx_apply_curve_preview $4,$5,2 _fx_apply_curve_preview $6,$7,3 +_fx_apply_curve_preview $8,$9,4 _fx_apply_curve_preview $10,$11,5 +_fx_apply_curve_preview 255,$12,6 +elif $40==1 +_fx_apply_curve_preview 0,$14,0 _fx_apply_curve_preview $15,$16,1 +_fx_apply_curve_preview $17,$18,2 _fx_apply_curve_preview $19,$20,3 +_fx_apply_curve_preview $21,$22,4 _fx_apply_curve_preview $23,$24,5 +_fx_apply_curve_preview 255,$25,6 +else +_fx_apply_curve_preview 0,$27,0 _fx_apply_curve_preview $28,$29,1 +_fx_apply_curve_preview $30,$31,2 _fx_apply_curve_preview $32,$33,3 +_fx_apply_curve_preview $34,$35,4 _fx_apply_curve_preview $36,$37,5 +_fx_apply_curve_preview 255,$38,6 +fi +mv. 1 done rm[0] +cracks_old : skip ${1=0.2},${2=40},${3=0} +e[^-1] "Add random cracks to image$?, with density $1." +v - repeat $! l[$>] +({im},{iM}) ..,..,1,1 noise. $1,2 ==. 1 distance. 1 sharpen. 10000 +if $3 g. xy +[-2,-1] n. -1,1 else n. 0,1 fi +*. $2 +[-3,-1] c.. {^} rm. +done done v + +fx_cracks_old : +ac "-cracks_old $1,$2,$3",$4 +negative : +e[^-1] "Compute negative of image$?." +v - repeat $! l[$>] - {iM} done done * -1 v + +transfer_colors : skip ${2=0} +e[^-1] "Transfer colors of image $1 to image$?." +v - pass$1 0 mv. 0 to_rgb[0] to_colormode[^0] {max(3,${-max_s})} c 0,255 +repeat $! l[$>] split_opacity rgb2ycbcr[0] a c done done +l[0] s c histogram_cumul 256,1,0,255 a c * 255 done +repeat $!-1 l[0,{$<+1}] +if $2 repeat 3 sh[0,1] $> equalize. 256,0,255 index. ..,0,0 rm[-2,-1] done +else repeat 2 sh[0,1] {$>+1} equalize. 256,0,255 index. ..,0,0 rm[-2,-1] done +fi +done done rm[0] +repeat $! l[$>] split_opacity ycbcr2rgb[0] a c done done +c 0,255 +v + +_transfer_colors : +repeat $! l[$>] rgb2ycbcr s c histogram 256,0,255 a c -dg 300,200 done done +is_bwclut : +to_clutname "$1" name=${} l[] +if narg($GMIC_SYSTEM_PATH) g_path_unix=$GMIC_SYSTEM_PATH +else g_path_unix=/usr/lib/gimp/2.0/plug-ins/ +fi +path_test0=$path_clut +path_test1=$_path_rc +path_test2=${-path_gimp}plug-ins/ +path_test3=${-path_gimp}plug-ins/gmic_gimp_qt/ +path_test4=$g_path_unix +repeat 5 file_clut=${path_test$>}/gmic_cluts.gmz +l[] $file_clut onfail done if $! break fi +done +if !$! +i https://gmic.eu/gmic_cluts.gmz o ${path_clut}gmic_cluts.gmz +fi +k[${"nmd 1,"$name}] +u {s==4} +rm done +mproj : check ${"is_image_arg $1"}" && isint(${2=0}) && $2>=0 && isint(${3=0}) && $3>=0 && ${4=1e-5}>=0" +s0,s1="ces","x" +if !$2 +e[^-1] "Project matri"${s{$!==1}}" onto dictionnary $1, using orthogonal projection." +pass$1 solve[^-1] . rm. return +elif $2==1 +m="Matching Pursuit" +elif $2==2 +m="Matching Pursuit + orthogonal projection" +else +m="Orthogonal Matching Pursuit, with ortho-projection every "{$2-2}" iterations." +fi +e[^-1] "Project matri"${s{$!==1}}" onto dictionnary $1, using "$m"." +pass$1 0 1,{w},1,1,"max(1e-8,norm(crop(#-1,y,1)))" /.. . +repeat $!-2 l[$>,-2,-1] s[0] x +repeat $!-2 l[$>,-2] +if $2<3 +1,{1,w} +eval " +const nmax = $3?$3:w#1; +ref(crop(#0),S); +residual = inf; +for (n = 0, n$4, ++n, +lmax = -1; +absdotmax = dotmax = 0; +for (l = 0, labsdotmax?( +absdotmax = absdot; +dotmax = dot; +lmax = l; +); +); +i[#2,lmax] += dotmax; +S-=(crop(#1,lmax,1)*=dotmax); +residual = norm(S)/size(S); +)" +if $2==2 +f[2] i?y+1:0 +discard[2] 0 transpose. -. 1 ++r[1] 100%,1,1,{1,h},-1 warp. .. r. 100%,{0,h},1,1,-1 ++solve[0] . +eval[3] i[#2,i]=i[#-1,x] +rm[3--1] +fi +else +1,{1,w} +[0] +eval " +orthoproj() = ( +run('f[2] i?y+1:0 +discard[2] 0 transpose. -. 1 ++r[1] 100%,1,1,{1,h},-1 warp. .. r. 100%,{0,h},1,1,-1 ++solve[0] . eval[4] i[#2,i]=i[#-1,x] rm... +m*[-2,-1] +j[3] [0] -[3,-1]'); +); +const nmax = $3?$3:w#1; +ref(crop(#0),S); +residual = inf; +is_orthoproj = 0; +for (n = 0, n$4, ++n, +lmax = -1; +absdotmax = dotmax = 0; +for (l = 0, labsdotmax?( +absdotmax = absdot; +dotmax = dot; +lmax = l; +); +); +!n || (n%($2-2))?( +i[#2,lmax] += dotmax; +S-=(crop(#1,lmax,1)*=dotmax); +residual = norm(S)/size(S); +is_orthoproj = 0; +):( +i[#2,lmax] = 1; # Only used as a mark +orthoproj(); +S = crop(#3); +residual = norm(S)/size(S); +is_orthoproj = 1; +); +); +!is_orthoproj?orthoproj(); +" +rm. +fi +rv[0,-1] rm. +done done +/[^-2,-1] . a[^-2,-1] x +done done +rm[-2,-1] +dodoc : +it $HOME/work/src/gmic/src/gmic_stdlib.gmic +parse_cli list +list=${} +ind={N=narg($list);int(u(0,N))%N} +e[] "\nDocument command : '"${"arg "$ind,$list}"'\n" +q +fx_apply_RGBcurve : skip $1 +fx_apply_RGBcurve_configfile +repeat $!-1 l[$>,-1] +to_colormode[0] {max(3,s)} +sh[0] 0 _fx_apply_RGBcurve. {-2,@0-12} rm. +sh[0] 1 _fx_apply_RGBcurve. {-2,@13-25} rm. +sh[0] 2 _fx_apply_RGBcurve. {-2,@26-38} rm. +done done +rm. +_fx_apply_RGBcurve : +apply_curve $13,0,$1,${"if $2>=0 u $2,$3, else u \"\" fi"}${"if $4>=0 u $4,$5, else u \"\" fi"}${"if $6>=0 u $6,$7, else u \"\" fi"}${"if $8>=0 u $8,$9, else u \"\" fi"}${"if $10>=0 u $10,$11, else u \"\" fi"}255,$12 +c 0,255 +fx_apply_Rcurve_preview : +fx_apply_RGBcurve_configfile +sh. 0,0,0,0 f. ${1--3} rm. +fx_apply_RGBcurve_preview[^-1] {^},0,${-2,-1} rm. +fx_apply_Gcurve_preview : +fx_apply_RGBcurve_configfile +sh. 1,1,0,0 f. ${1--3} rm. +fx_apply_RGBcurve_preview[^-1] {^},1,${-2,-1} rm. +fx_apply_Bcurve_preview : +fx_apply_RGBcurve_configfile +sh. 2,2,0,0 f. ${1--3} rm. +fx_apply_RGBcurve_preview[^-1] {^},2,${-2,-1} rm. +fx_apply_RGBcurve_configfile : +filename=${-path_tmp}.gmic_RGBcurve.dlm +if isfile(['{/$filename}']) $filename else (0,-1,128,-1,128,-1,128,-1,128,-1,128,255,1) r. 100%,3 fi +fx_apply_RGBcurve_preview : +(${1--3}) r. 13,3,1,1,-1 o. ${-path_tmp}.gmic_RGBcurve.dlm rm. +function1d $13,0,$1,${"if $2>=0 u $2,$3, else u \"\" fi"}${"if $4>=0 u $4,$5, else u \"\" fi"}${"if $6>=0 u $6,$7, else u \"\" fi"}${"if $8>=0 u $8,$9, else u \"\" fi"}${"if $10>=0 u $10,$11, else u \"\" fi"}255,$12 +function1d $26,0,$14,${"if $15>=0 u $15,$16, else u \"\" fi"}${"if $17>=0 u $17,$18, else u \"\" fi"}${"if $19>=0 u $19,$20, else u \"\" fi"}${"if $21>=0 u $21,$22, else u \"\" fi"}${"if $23>=0 u $23,$24, else u \"\" fi"}255,$25 +function1d $39,0,$27,${"if $28>=0 u $28,$29, else u \"\" fi"}${"if $30>=0 u $30,$31, else u \"\" fi"}${"if $32>=0 u $32,$33, else u \"\" fi"}${"if $34>=0 u $34,$35, else u \"\" fi"}${"if $36>=0 u $36,$37, else u \"\" fi"}255,$38 +a[-3--1] y mv. 0 +repeat $!-1 ++gui_split_preview. "fx_apply_RGBcurve 0",$-1 +100%,100% axes. 0,255,255,0,13,1,255 +dilate. 3 r.. ... j... ..,0,0,0,0,1,.,255 rm[-2,-1] +grid. 10%,10%,0,0,0.3,0xCCCCCCCC,255 +line. 0,100%,100%,0,0.3,0xCCCCCCCC,255 +if $-2 +.,.,1,1,-{$-2*255/100} to_gray... histogram... 256,0,255 graph. ...,3,0,0,0,1,0 +rm... +. {$-2*255/100} +[-2,-1] c. 0,255 +else rm.. fi +line. 0,100%,100%,0,0.3,0xCCCCCCCC,255 +sh[0] 0,0,0,0 +graph.. .,1,0,255,0,1,255,128,128 -. 1 +graph.. .,1,0,255,0,0.5,200,0,0 rm. +sh[0] 1,1,0,0 +graph.. .,1,0,255,0,1,128,255,128 -. 1 +graph.. .,1,0,255,0,0.5,0,200,0 rm. +sh[0] 2,2,0,0 +graph.. .,1,0,255,0,1,128,128,255 -. 1 +graph.. .,1,0,255,0,0.5,0,0,200 rm. +if $40==0 +_fx_apply_curve_preview 0,$1,0 _fx_apply_curve_preview $2,$3,1 +_fx_apply_curve_preview $4,$5,2 _fx_apply_curve_preview $6,$7,3 +_fx_apply_curve_preview $8,$9,4 _fx_apply_curve_preview $10,$11,5 +_fx_apply_curve_preview 255,$12,6 +elif $40==1 +_fx_apply_curve_preview 0,$14,0 _fx_apply_curve_preview $15,$16,1 +_fx_apply_curve_preview $17,$18,2 _fx_apply_curve_preview $19,$20,3 +_fx_apply_curve_preview $21,$22,4 _fx_apply_curve_preview $23,$24,5 +_fx_apply_curve_preview 255,$25,6 +else +_fx_apply_curve_preview 0,$27,0 _fx_apply_curve_preview $28,$29,1 +_fx_apply_curve_preview $30,$31,2 _fx_apply_curve_preview $32,$33,3 +_fx_apply_curve_preview $34,$35,4 _fx_apply_curve_preview $36,$37,5 +_fx_apply_curve_preview 255,$38,6 +fi +mv. 1 done rm[0] +fx_apply_YCbCrcurve : skip $1 +fx_apply_YCbCrcurve_configfile +repeat $!-1 l[$>,-1] +to_colormode[0] {max(3,s)} sh[0] 0,2 rgb2ycbcr. rm. +sh[0] 0 _fx_apply_YCbCrcurve. {-2,@0-12} rm. +sh[0] 1 _fx_apply_YCbCrcurve. {-2,@13-25} rm. +sh[0] 2 _fx_apply_YCbCrcurve. {-2,@26-38} rm. +sh[0] 0,2 -ycbcr2rgb. rm. +done done +rm. +_fx_apply_YCbCrcurve : +apply_curve $13,0,$1,${"if $2>=0 u $2,$3, else u \"\" fi"}${"if $4>=0 u $4,$5, else u \"\" fi"}${"if $6>=0 u $6,$7, else u \"\" fi"}${"if $8>=0 u $8,$9, else u \"\" fi"}${"if $10>=0 u $10,$11, else u \"\" fi"}255,$12 +c 0,255 +fx_apply_Ycurve_preview : +fx_apply_YCbCrcurve_configfile +sh. 0,0,0,0 f. ${1--3} rm. +fx_apply_YCbCrcurve_preview[^-1] {^},0,${-2,-1} rm. +fx_apply_Cbcurve_preview : +fx_apply_YCbCrcurve_configfile +sh. 1,1,0,0 f. ${1--3} rm. +fx_apply_YCbCrcurve_preview[^-1] {^},1,${-2,-1} rm. +fx_apply_Crcurve_preview : +fx_apply_YCbCrcurve_configfile +sh. 2,2,0,0 f. ${1--3} rm. +fx_apply_YCbCrcurve_preview[^-1] {^},2,${-2,-1} rm. +fx_apply_YCbCrcurve_configfile : +filename=${-path_tmp}.gmic_YCbCrcurve.dlm +if isfile(['{/$filename}']) $filename else (0,-1,128,-1,128,-1,128,-1,128,-1,128,255,1) r. 100%,3 fi +fx_apply_YCbCrcurve_preview : +(${1--3}) r. 13,3,1,1,-1 o. ${-path_tmp}.gmic_YCbCrcurve.dlm rm. +function1d $13,0,$1,${"if $2>=0 u $2,$3, else u \"\" fi"}${"if $4>=0 u $4,$5, else u \"\" fi"}${"if $6>=0 u $6,$7, else u \"\" fi"}${"if $8>=0 u $8,$9, else u \"\" fi"}${"if $10>=0 u $10,$11, else u \"\" fi"}255,$12 +function1d $26,0,$14,${"if $15>=0 u $15,$16, else u \"\" fi"}${"if $17>=0 u $17,$18, else u \"\" fi"}${"if $19>=0 u $19,$20, else u \"\" fi"}${"if $21>=0 u $21,$22, else u \"\" fi"}${"if $23>=0 u $23,$24, else u \"\" fi"}255,$25 +function1d $39,0,$27,${"if $28>=0 u $28,$29, else u \"\" fi"}${"if $30>=0 u $30,$31, else u \"\" fi"}${"if $32>=0 u $32,$33, else u \"\" fi"}${"if $34>=0 u $34,$35, else u \"\" fi"}${"if $36>=0 u $36,$37, else u \"\" fi"}255,$38 +a[-3--1] y mv. 0 +repeat $!-1 ++gui_split_preview. "fx_apply_YCbCrcurve 0",$-1 +axes. 0,255,255,0,13,1,255 +100%,100% axes. 0,255,255,0,13,1,255 +dilate. 3 r.. ... j... ..,0,0,0,0,1,.,255 rm[-2,-1] +grid. 10%,10%,0,0,0.3,0xCCCCCCCC,255 +line. 0,100%,100%,0,0.3,0xCCCCCCCC,255 +if $-2 +.,.,1,1,-{$-2*255/100} to_gray... histogram... 256,0,255 graph. ...,3,0,0,0,1,0 +rm... +. {$-2*255/100} +[-2,-1] c. 0,255 +else rm.. fi +line. 0,100%,100%,0,0.3,0xCCCCCCCC,255 +sh[0] 0,0,0,0 +graph.. .,1,0,255,0,1,255,255,255 -. 1 +graph.. .,1,0,255,0,0.5,200,200,200 rm. +sh[0] 1,1,0,0 +graph.. .,1,0,255,0,1,128,128,255 -. 1 +graph.. .,1,0,255,0,0.5,0,0,200 rm. +sh[0] 2,2,0,0 +graph.. .,1,0,255,0,1,255,128,128 -. 1 +graph.. .,1,0,255,0,0.5,200,0,0 rm. +if $40==0 +_fx_apply_curve_preview 0,$1,0 _fx_apply_curve_preview $2,$3,1 +_fx_apply_curve_preview $4,$5,2 _fx_apply_curve_preview $6,$7,3 +_fx_apply_curve_preview $8,$9,4 _fx_apply_curve_preview $10,$11,5 +_fx_apply_curve_preview 255,$12,6 +elif $40==1 +_fx_apply_curve_preview 0,$14,0 _fx_apply_curve_preview $15,$16,1 +_fx_apply_curve_preview $17,$18,2 _fx_apply_curve_preview $19,$20,3 +_fx_apply_curve_preview $21,$22,4 _fx_apply_curve_preview $23,$24,5 +_fx_apply_curve_preview 255,$25,6 +else +_fx_apply_curve_preview 0,$27,0 _fx_apply_curve_preview $28,$29,1 +_fx_apply_curve_preview $30,$31,2 _fx_apply_curve_preview $32,$33,3 +_fx_apply_curve_preview $34,$35,4 _fx_apply_curve_preview $36,$37,5 +_fx_apply_curve_preview 255,$38,6 +fi +mv. 1 done rm[0] +fx_faded_mirror : +repeat $! l[$>] +if $1==0 +100%,1,1,1,"a=1/(1-w*$2%);b=-a*(w-1);a*x+b" c. 0.01,1 *.. . +r. 100%,.. a c r {2*w-w*$3%},100%,1,100%,0 +mirror x +else +1,100%,1,1,"a=1/(1-h*$2%);b=-a*(h-1);a*y+b" c. 0.01,1 r. ..,100% *.. . +a c r 100%,{2*h-h*$3%},1,100%,0 +mirror y +fi ++ s. c,-{s-1} /[-2,-1] +done done +fx_frame_round_old : +frame_round ${1-8} +if $9 frame_blur $1,{min(99,$1+$9)},$3,$10,$11% fi +view_surfels3d : +nm={n} ++distance. 0 *. -1 +. 1 *. .. +distance.. 1 +[-2,-1] round. 0.1 +l[0] { expand_xyz. 1,0 b. 4,0 g xyz,0,0 shrink_xyz 1 a c n 0,255 } +a c +=> img +m:=round(0.75*min({*,u,v})) w[] $m,$m,0,$nm" ("{img,w}x{img,h}x{img,d}")" +axes3d 60 => axes3d +(1,0,0,0;0,1,0,0;0,0,1,0) store. pose3d +posx,posy,zoom_factor=50,50,1 +T=1 +do +if !0$img3d +if {img,s==1} +f[img] 164 [img] lfacts=0.75,1,1.25 +elif {img,s==3} [img] +norm. gt. 0 *. -inf lfacts=0.9,1,1.1 +else +s[img] c,-{img,s-1} lfacts=0.9,1,1.1 +fi +lt. $T *[-2,-1] +to_rgb. surfels3d. $lfacts +l. { s3d. c.. 0,255 a y } +box3d {img,[w,h,d]} -3d. 0.5,0.5,0.5 col3d. 255,255,255 p3d. 1 o3d. 0.25 +3d[-2,-1] +=> img3d +fi +update_bg:=!0$bg +if 0$bg" && "{0$bg,[w,h]!=[{*,w,h}]} update_bg=1 fi +if $update_bg +(0,0,0;0,0,100;100,0,50) permute. cyzx r. {*,w,h},1,3,3 +=> bg +fi ++-3d[img3d] {img,[w,h,d]/2} *3d. {img,0.65*$zoom_factor*min({*,w,h})/max(w,h,d)} +$pose3d p={^} rm. +pose3d. $p +j3d[bg] .,$posx%,$posy%,0,1,2,1,1 rm.. ++pose3d[axes3d] $p j3d.. .,{-2,[80,h-80]},0,0.75,3,0,0,200 rm. +to. "Threshold: "{_$T},,,3% +w. rm. +if {*,-ARROWUP} T+=0.2 rmn img3d +elif {*,-ARROWDOWN} T-=0.2 rmn img3d +elif {*,-PAGEUP} T+=5 rmn img3d +elif {*,-PAGEDOWN} T-=5 rmn img3d +fi +T={_round($T,0.1)} +mx,my,mb={*,x,y,b} +is_CTRL={{*,CTRLLEFT}" || "{*,CTRLRIGHT}} +if $mx>=0 +if $mb +if !narg($mx0) mx0,my0,mx1,my1=$mx,$my,$mx,$my else mx1,my1=$mx,$my fi +else +if narg($mx0) rmn render fi +mx0,my0,mx1,my1= +fi +fi +if narg($mx1)" && "($mx0!=$mx1" || "$my0!=$my1) +if $mb&1" && "!$is_CTRL +rotation3d[] {" +const w2 = "{*,w}"/2; +const h2 = "{*,h}"/2; +const R = 0.375*min("{*,w,h}"); +const u0 = "$mx0" - w2; +const v0 = "$my0" - h2; +const u1 = "$mx1" - w2; +const v1 = "$my1" - h2; +n0 = norm(u0,v0); +nu0 = n0>R?u0*R/n0:u0; +nv0 = n0>R?v0*R/n0:v0; +nw0 = sqrt(max(0,R^2 - nu0^2 - nv0^2)); +n1 = norm(u1,v1); +nu1 = n1>R?u1*R/n1:u1; +nv1 = n1>R?v1*R/n1:v1; +nw1 = sqrt(max(0,R^2 - nu1^2 - nv1^2)); +u = nv0*nw1 - nw0*nv1; +v = nw0*nu1 - nu0*nw1; +w = nv0*nu1 - nu0*nv1; +n = norm(u,v,w); +[ u,v,w,-asin(n/R^2)*180/pi ]"} +$pose3d m*[-2,-1] store. pose3d +mx0,my0=$mx1,$my1 +elif $mb&4" || "($mb&1" && "$is_CTRL) +posx,posy={" +const px = "$mx1-$mx0+$posx*{*,w}%"; +const py = "$my1-$my0+$posy*{*,h}%"; +cut([ px*100/"{*,w}", py*100/"{*,h}" ],0,100)"} +mx0,my0=$mx1,$my1 +elif $mb&2 +fact={1+($my0-$my1)/100} +zoom_factor*=$fact +mx0,my0=$mx1,$my1 +fi +fi +if {*,o} +fact={1+{*,-o}/10} +zoom_factor*=$fact +fi +wait +while {*}" && "!{*,ESC} +rm +d2d : +_gmic_s="$?" v + _display2d 0,1 +_d2d_core : +_gmic_s="$?" _d2d_core=1 v + _display2d $1,1 +display2d : +_gmic_s="$?" v + _$0 0,1 +_display2d : check "isbool(${1=0}) && isint(${2=1}) && $2>=0" +e[0--3] "Start interactive display of 2D image"$_gmic_s"." +m "_d2d_format : +if $""#>8 u {_([$""*])[0,4]:\\ }\\ ...\\ {_([$""*])[$""#-4,4]:\\ } +else ('\"$""*\"') replace. {','},32 u {t} rm. +fi" +p +foreach { +('{n}') if s=crop();find(s,_'.',size(s)-1,-1)>0 nm={-2,b}.{-2,x} else nm={-2,b} fi rm. +=> img +if !w v - d v + break fi +if d>10 +error[0--6] "Command 'display2d': Input image has "{d}" slices, cannot manage more than 10 simultaneous views." +fi +is_multiview:=d>1 +is_moderate_ratio={0,D=[w,h];max(D)/min(D)<6} +may_have_alpha:=s==2||s>=4 +alpha_mode,axes_mode,fullscreen_mode,ratio_mode={s==1||s==3},1,0,$is_moderate_ratio +normalization_mode={{*}?!!{*,n}:$2} +posx,posy,sizx,sizy={0,[0,0,w,h]} +is_bottom_text,wait_event,mx,my,omb=0,1,-1,-1,0 +xsel0,ysel0,xsel1,ysel1,notification= +wnormalization0={*,n} +fontsize,fontsize_notif= +if $is_multiview" && "!${-is_macos} +if d==2 if {*,u}/w>={*,v}/h wsiz0={r={*,u}*0.48;round([r,r*h/w])} else wsiz0={r={*,v}*0.40;round([r*w/h,r])} fi +elif d<=4 wsiz0=${fitscreen\ .,,45%} +else wsiz0=${fitscreen\ .,,30%} +fi +wsiz0=${fitscreen\ $wsiz0,1,,90%} +else wsiz0=${fitscreen\ .} +fi +if $is_multiview +if narg($_d2d_names) l[] { $_d2d_names repeat $! { wname$>={$>,t} } rm } fi +com_iskey,com_flushkey,com_isvisible,com_isresized,com_idisp,sep= +repeat {img,d} { +if narg($_d2d_names) w$>[] {{*$>,w}?[-1,-1]:[$wsiz0]},0,${wname$>}" ("{w}x{h}x{d}x{s}")" +else w$>[] {{*$>,w}?[-1,-1]:[$wsiz0]},0,$nm" ("{w}x{h}x{d}x{s}")-#"$> +fi +com_iskey.=$sep"{*"$>",$""1}" +com_flushkey.=$sep"{*"$>",-$""1}" +com_isvisible.=$sep"{*"$>"}" +com_isresized.=$sep"{*"$>",r}" +com_idisp.=$sep"{*"$>",x}" +sep=, +} +m "iskey : u {max("$com_iskey")}"\n"flushkey : skip "$com_flushkey\n"isvisible : u {min("$com_isvisible")}"\n"isresized : u {max("$com_isresized")}"\n"idisp : u {argmax("$com_idisp")}" +if !${-is_macos} +ww,wh={[$wsiz0]+[8,40]} +if d==2 +if {*,u}/$ww>{*,v}/$wh +ox,oy={round([max(0,{*,u}-2*$ww),max(0,{*,v}-$wh)]/2)} +w0[] -1,-1,-1,-1,$ox,$oy +w1[] -1,-1,-1,-1,{$ox+$ww},$oy +else +ox,oy={round([{*,u}-$ww,{*,v}-2*$wh]/2)} +w0[] -1,-1,-1,-1,$ox,$oy +w1[] -1,-1,-1,-1,$ox,{$oy+$wh} +fi +elif d<=4 +ox,oy={round([max(0,{*,u}-2*$ww),max(0,{*,v}-2*$wh)]/2)} +ww,wh+=$ox,$oy +w0[] -1,-1,-1,-1,$ox,$oy +w1[] -1,-1,-1,-1,$ww,$oy +w2[] -1,-1,-1,-1,$ox,$wh +if d==4 w3[] -1,-1,-1,-1,$ww,$wh fi +else +ox,oy={round([max(0,{*,u}-3*$ww),max(0,{*,v}-(d>6?3:2)*$wh)]/2)} +ww2,wh2={2*[$ww,$wh]+[$ox,$oy]} +ww,wh+=$ox,$oy +w0[] -1,-1,-1,-1,$ox,$oy +w1[] -1,-1,-1,-1,$ww,$oy +w2[] -1,-1,-1,-1,$ww2,$oy +w3[] -1,-1,-1,-1,$ox,$wh +w4[] -1,-1,-1,-1,$ww,$wh +if d>5 w5[] -1,-1,-1,-1,$ww2,$wh fi +if d>6 w6[] -1,-1,-1,-1,$ox,$wh2 fi +if d>7 w7[] -1,-1,-1,-1,$ww,$wh2 fi +if d>8 w8[] -1,-1,-1,-1,$ww2,$wh2 fi +fi +fi +else +w[] {{*,w}?[-1,-1]:[$wsiz0]},0,$nm" ("{w}x{h}x{d}x{s}")" +m "iskey : u {*,$""1}"\n"flushkey : skip {*,-$""1}"\n"isvisible : u {*}"\n"isresized : u {*,r}"\n"idisp : u 0" +fi +repeat {img,d} { cursor[$>] 0 } +for ${-isvisible}" && "!${"iskey ESC"}" && "!((${"iskey CTRLLEFT"}" || "${"iskey CTRLRIGHT"})" && "${"iskey W"}) { +if $ratio_mode" && "$sizx>16" && "$sizy>16 +nposx,nposy,nsizx,nsizy=$posx,$posy,$sizx,$sizy +repeat 2 { +if {*,w}/$sizx<{*,h}/$sizy +nposy,nsizy={nsizy=$nsizx*{*,h}/{*,w};round([$nposy-(nsizy-$nsizy)/2,nsizy])} +else +nposx,nsizx={nsizx=$nsizy*{*,w}/{*,h};round([$nposx-(nsizx-$nsizx)/2,round(nsizx)])} +fi +if $<" && "$nsizx>w#0" && "$nsizy>h#0 nposx,nposy,nsizx,nsizy={[0,0,w#0,h#0]} fi +} +if [$nposx,$nposy,$nsizx,$nsizy]!=[$posx,$posy,$sizx,$sizy] +posx,posy,sizx,sizy=$nposx,$nposy,$nsizx,$nsizy +rmn baseview +fi +fi +if !narg($baseview) +($posx,{$posx+$sizx}) ($posy;{$posy+$sizy}) r[-2,-1] 2,2 a[-2,-1] c +r. {[{*,w,h}]+1},1,2,3 z. 0,0,{[w,h]-2} round. 1,-1 ind_warp={$!-1} ++channels[0] {0,[0,min(3,s-1)]} warp. ..,0,0,1 +if $is_multiview repeat {img,d-1} { +slices[img] {1+$>} warp. [$ind_warp],0,0,1 } a[-{img,d}--1] z fi +rm.. +if s>($alpha_mode?4:3) channels. 0,{$alpha_mode?3:2} fi ++r[0] 1,1,1,1,2 is_infnan={isnan(i)||isinf(i)} rm. +if $normalization_mode +if $is_infnan +eval[0] "*begin(m = inf; M = -inf); +!isinf(i) && !isnan(i)?(m = min(i,m); M = max(i,M)); +end( +merge(m,min); +merge(M,max); +run('im,iM=',m,',',M) +)" +vim,viM={[$im-abs($im),$iM+abs($iM)]} +f. "isnan(i)?"$vim":isinf(i)?(i<0?"$vim":"$viM"):i" +else +im,iM={0,[im,iM]} +fi +else +im,iM=0,255 +if $is_infnan f. "isnan(i)?"$im":isinf(i)?(i<0?"$im":"$iM"):i" fi +fi +if $normalization_mode==1 +sh. 0,{s-($alpha_mode" && "$may_have_alpha?2:1)} +if $is_multiview repeat {img,d} { +slices. $> n. 0,255 j.. .,0,0,$> rm. } else n. 0,255 fi +rm. +elif $normalization_mode==2 +sh. 0,{s-($alpha_mode" && "$may_have_alpha?2:1)} +if $is_multiview repeat d*s { z,c={[$>%d,int($>/d)]} sh. $z,$z,$c n. 0,255 rm. } +else repeat s { sh. $> n. 0,255 rm. } +fi +rm. +fi +if $posx<0" || "$posy<0" || "$posx+$sizx>=w#0" || "$posy+$sizy>=h#0 +100%,100% +rectangle. {A=-[$posx,$posy]*[w,h]/[$sizx,$sizy];B=A+[w#0,h#0]*[w,h]/[$sizx,$sizy]-1;[ceil(A),floor(B)]},1,1 +*[-2,-1] +fi +if $alpha_mode +coords={A=-[$posx,$posy]*[w,h]/[$sizx,$sizy];B=A+[w#0,h#0]*[w,h]/[$sizx,$sizy]-1;[ceil(A),floor(B)]} +if !$may_have_alpha +100%,100%,1,1,64 rectangle. $coords,1,255 r. 100%,100%,.. a[-2,-1] c +else +sh. 100% 100%,100%,1,1,64 rectangle. $coords,1,0 r. 100%,100%,.. +[-2,-1] rm. +fi +fi +if $alpha_mode +(128,160;160,128) r. 32,32,1,{-2,s-1} r. ..,..,..,100%,0,2,0.5,0.5 sh.. 100% j.. ...,0,0,0,0,1,.,255 rm[-3,-1] +elif s==1 r. 100%,100%,100%,3 +elif s==2 r. 100%,100%,100%,3,0 +fi +=> baseview +rmn view +fi +if narg($notification) +wait_event=0 +if !isnum($notification) +rmn notification_gfx +ofs,fs={narg($fontsize_notif)?0$fontsize_notif:32} +do +0 t. {``$notification},0,0,$fs,1,255 +if narg($fontsize_notif) break +elif {baseview,"(w#-1>0.7*w || h#-1>0.25*h) && "$fs>13" && "$ofs>=$fs} +ofs,fs=$fs,{max(13,round($fs/1.25))} rm. +elif {baseview,"w#-1<0.3*w && h#-1<0.25*h && "$fs<64" && "$ofs<=$fs} +ofs,fs=$fs,{min(64,round($fs*1.25))} rm. +else +fontsize_notif=$fs break +fi +while 1 +r. {[w+12,h+8]},1,1,0,0,0.5,0.5 rectangle. 0,0,100%,100%,1,0xFFFFFFFF,255 to_rgb. +=> notification_gfx +notification=$| +else +if $|>$notification+1 rm[notification_gfx] wait_event=1 notification= fi +rmn view +fi +fi +if !narg($view) +[baseview] +if $mx>=0 +posmx,posmy={floor([$posx,$posy]+[$mx,$my]*[$sizx,$sizy]/[{*,w,h}])} +is_selection_a_point={[0$xsel0,0$ysel0]==[0$xsel1,0$ysel1]} +if narg($xsel0)" && "!$is_selection_a_point +dselx,dsely={[$xsel1-$xsel0,$ysel1-$ysel0]} +ofs,fs={narg($fontsize)?0$fontsize:32} +do +0 t. " Box ( "{``{[min($xsel0,$xsel1),min($ysel0,$ysel1)]}}" ) - ""( "{``{[max($xsel0,$xsel1),max($ysel0,$ysel1)]}}" ) \n"" Size = ( "{``{abs([$dselx,$dsely]+1)}}" ), ""Length = "{_norm($dselx,$dsely)}" \n"" Angle = "{_atan2($dsely,$dselx)*180/pi}"\260 ",1,0,$fs,1,1 +if narg($fontsize) break +elif {baseview,"(w#-1>0.7*w || h#-1>0.45*h) && "$fs>13" && "$ofs>=$fs} +ofs,fs=$fs,{max(13,round($fs/1.25))} rm. +elif {baseview,"w#-1<0.3*w && h#-1<0.45*h && "$fs<64" && "$ofs<=$fs} +ofs,fs=$fs,{min(64,round($fs*1.25))} rm. +else +fontsize=$fs break +fi +while 1 +n. 0,255 +dilate. 3 *. -1 n. 0,80 +[-2,-1] r. 100%,100%,..,.. +j.. .,0,$is_bottom_text~,0,0,0.85 rm. +fi +if $mx>=0 +if $posmx>=0" && "$posmx=0" && "$posmy);(s>=1" || "s<=4)" && "min(isint(P))" && "min(P)>=0" && "max(P)<=255} +hexstr="= \#"{img,`"digit(x) = (x<10?_'0' + x:_'A' + x - 10);P = I("$posmx,$posmy,$>");[ digit(P[0]>>4),digit(P[0]&15),s<2?0:digit(P[1]>>4),s<2?0:digit(P[1]&15),s<3?0:digit(P[2]>>4),s<3?0:digit(P[2]&15),s<4?0:digit(P[3]>>4),s<4?0:digit(P[3]&15) ]"`}" " +else hexstr= fi +ofs,fs={narg($fontsize)?0$fontsize:32} +do +0 t. " Point ( "$posmx","$posmy" ) = [ "${_d2d_format\ {img,_I($posmx,$posmy,$>)}}" ] "$hexstr,1,0,$fs,1,1 +if narg($fontsize) break +elif {baseview,"(w#-1>0.7*w || h#-1>0.15*h) && "$fs>13" && "$ofs>=$fs} +_ofs,fs=$fs,{max(13,round($fs/1.25))} rm. +elif {baseview,"w#-1<0.3*w && h#-1<0.15*h && "$fs<64" && "$ofs<=$fs} +ofs,fs=$fs,{min(64,round($fs*1.25))} rm. +else +fontsize=$fs break +fi +while 1 +n. 0,255 +dilate. 3 *. -1 n. 0,80 +[-2,-1] r. 100%,100%,1,.. +j.. .,0,$is_bottom_text~,$>,0,0.85 rm. +} +fi +x0,y0,x1,y1={[round([$posmx-$posx,$posmy-$posy]*[{*,w,h}]/[$sizx,$sizy]),round([$posmx-$posx+1,$posmy-$posy+1]*[{*,w,h}]/[$sizx,$sizy])-1]} +if $x1-$x0>=8" && "$y1-$y0>=8 +repeat d==1?1:d*s { +if d==1 sh. else sh. {z=$>%d;[z,z,int($>/d)]} fi +rectangle. $x0,$y0,$x1,$y1,1,0x55555555,0 +rectangle. $x0,$y0,$x1,$y1,1,0xAAAAAAAA,255 +rm. +} +fi +fi +if $axes_mode +repeat d==1?1:d*s { +if d==1 sh. else sh. {z=$>%d;[z,z,int($>/d)]} fi +line. $mx,0,$mx,100%,0.5,0xFF00FF00,255 +line. $mx,0,$mx,100%,0.5,0x00FF00FF,0 +line. 0,$my,100%,$my,0.5,0xFF00FF00,255 +line. 0,$my,100%,$my,0.5,0x00FF00FF,0 +rm. +} +fi +fi +if narg($xsel0) +x0,y0,x1,y1={xm=min($xsel0,$xsel1);xM=max($xsel0,$xsel1);ym=min($ysel0,$ysel1);yM=max($ysel0,$ysel1);[[xm-$posx,ym-$posy]*[{*,w,h}]/[$sizx,$sizy],[xM+1-$posx,yM+1-$posy]*[{*,w,h}]/[$sizx,$sizy]-1]} +repeat d==1?1:d*s { +if d==1 sh. else sh. {z=$>%d;[z,z,int($>/d)]} fi +rectangle. $x0,$y0,$x1,$y1,0.2,0 +rectangle. $x0,$y0,$x1,$y1,0.9,0x55555555,0 +rectangle. $x0,$y0,$x1,$y1,0.9,0xAAAAAAAA,255 +rm. +} +if $xsel0>$xsel1 x0,x1=$x1,$x0 fi +if $ysel0>$ysel1 y0,y1=$y1,$y0 fi +if $xsel0!=$xsel1" && "$ysel0!=$ysel1 +x0,y0,x1,y1={[(0.5+[$xsel0-$posx,$ysel0-$posy])*[{*,w,h}]/[$sizx,$sizy],(0.5+[$xsel1-$posx,$ysel1-$posy])*[{*,w,h}]/[$sizx,$sizy]]} +repeat d==1?1:d*s { +if d==1 sh. else sh. {z=$>%d;[z,z,int($>/d)]} fi +line. $x0,$y0,$x1,$y1,0.9,0x33333333,0 +line. $x0,$y0,$x1,$y1,0.9,0xCCCCCCCC,255 +rm. +} +fi +fi +fi +if $notification_gfx ++r[notification_gfx] 100%,100%,. j.. .,{[w#-2-w-4,4]},0,0,{sqrt(max(0,1-($|-$notification)))} rm. +fi +=> view +if $is_multiview repeat d { +slices[view] $> w$>. rm. } else w. fi +fi +if $wait_event wait else wait 40 fi +idisp=${-idisp} +wait_event=1 +old_mx,old_my=$mx,$my +nposx,nposy,nsizx,nsizy=$posx,$posy,$sizx,$sizy +is_CTRL,mb,mx,my,mo={${"iskey CTRLLEFT"}" || "${"iskey CTRLRIGHT"}},{*$idisp,b,x,y,-o} +if !($mb&4)" && "!($is_CTRL" && "($mb&1)) pan_mx,pan_my,pan_posx,pan_posy= fi +if {view,$my<0" || "$my>=h-16} is_bottom_text=0 +elif $my<16 is_bottom_text=1 +fi +if ${-isresized} +repeat {img,d} { +w=$> if {*$w,r} +w$w[] {*$w,d,e} +if $is_multiview repeat {img,d} { w$>[] {*$w,w,h} } fi +if $nsizx>w#0" && "$nsizy>h#0 nposx,nposy,nsizx,nsizy={[0,0,w#0,h#0]} fi +break +fi +} +fontsize,fontsize_notif= +rmn baseview +elif $is_CTRL" && "${"iskey D"}" && "{*$idisp,d}<{*$idisp,u}" && "{*$idisp,e}<{*$idisp,v} +w$idisp[] {round([{*$idisp,w,h}]*1.25)} +if $is_multiview repeat {img,d} { w$>[] {*$idisp,w,h} } fi +notification="Increase Window Size" +fontsize,fontsize_notif= +flushkey D rmn baseview +elif $is_CTRL" && "${"iskey C"}" && "{*$idisp,d}>64" && "{*$idisp,e}>64 +w$idisp[] {round([{*$idisp,w,h}]/1.25)} +if $is_multiview repeat {img,d} { w$>[] {*$idisp,w,h} } fi +notification="Decrease Window Size" +fontsize,fontsize_notif= +flushkey C rmn baseview +elif $is_CTRL" && "${"iskey R"} +nposx,nposy,nsizx,nsizy={0,[0,0,w,h]} +repeat {img,d} { w$>[] $wsiz0 } +notification="Reset Window Size" +fontsize,fontsize_notif= +flushkey R rmn baseview +fi +if !$is_CTRL" && "$mb&1" && "$mx>0 +xsel,ysel={X=[$nposx,$nposy]+[$mx,$my]*[$nsizx,$nsizy]/[{*,w,h}];floor([max(0,min(X[0],w#0-1)),max(0,min(X[1],h#0-1))])} +if !narg($xsel0)" && "!($omb&1) xsel0,ysel0,xsel1,ysel1=$xsel,$ysel,$xsel,$ysel +elif narg($xsel0) xsel1,ysel1=$xsel,$ysel +fi +if $mx<=16 nposx-={$nsizx/64} wait_event=0 xzoom,yzoom= +elif $mx>={*,w}-17 nposx+={$nsizx/64} wait_event=0 xzoom,yzoom= +fi +if $my<=16 nposy-={$nsizy/64} wait_event=0 xzoom,yzoom= +elif $my>{*,h}-17 nposy+={$nsizx/64} wait_event=0 xzoom,yzoom= +fi +wait_event=0 +rmn view +elif !($mb&1) +if narg($xsel0) +if "p0 = ["$xsel0,$ysel0]"; p1 = ["$xsel1,$ysel1"]; +siz = max("$sizx,$sizy"); +p0==p1 || (siz>128 && norm1(p1-p0)<=siz/100)" +if $1" && "$nsizx>=w#0" && "$nsizy>=h#0 break fi +nposx,nposy,nsizx,nsizy={0,[0,0,w,h]} +else +nposx,nposy,nsizx,nsizy={[min($xsel0,$xsel1),min($ysel0,$ysel1),abs([$xsel1-$xsel0,$ysel1-$ysel0])+1]} +fi +xzoom,yzoom= mb={$mb&6} +rmn view +fi +xsel0,ysel0,xsel1,ysel1= +fi +if ${"iskey ARROWLEFT"} nposx-={$nsizx/($is_CTRL?4:16)} xzoom,yzoom= +elif ${"iskey ARROWRIGHT"} nposx+={$nsizx/($is_CTRL?4:16)} xzoom,yzoom= +elif ${"iskey ARROWUP"} nposy-={$nsizy/($is_CTRL?4:16)} xzoom,yzoom= +elif ${"iskey ARROWDOWN"} nposy+={$nsizy/($is_CTRL?4:16)} xzoom,yzoom= +elif $is_CTRL" && "${"iskey O"} +n=0 do filename gmic.gmz,$n n+=1 while isfile(['{/${}}']) +if $is_multiview +slices[img] $idisp o. ${} rm. else o[img] ${} fi +notification="Save Copy:\n"${} +flushkey O +elif $is_CTRL" && "${"iskey S"} +n=0 do filename gmic.png,$n n+=1 while isfile(['{/${}}']) +if $is_multiview +slices[baseview] $idisp o. ${} rm. else o[baseview] ${} fi +notification="Save Screenshot:\n"${} +flushkey S +elif $is_CTRL" && "${"iskey SPACE"} +nposx,nposy,nsizx,nsizy={0,[0,0,w,h]} +notification="Center View" +flushkey SPACE +elif $is_CTRL" && "${"iskey N"} +normalization_mode={($normalization_mode+1)%3} +notification=${"s0=Disable s1=Enable s2=\"Enable C.by.C\" u ${s"$normalization_mode"}"}" Normalization" +flushkey N rmn baseview +elif $is_CTRL" && "${"iskey A"} +alpha_mode={!$alpha_mode} +notification=${"s0=Disable s1=Enable u ${s"$alpha_mode"}"}" Alpha" +flushkey A rmn baseview +elif $is_CTRL" && "${"iskey F"} +fullscreen_mode={!$fullscreen_mode} +if $fullscreen_mode +fullscreen_wsize={*,w,h} fullscreen_params=$nposx,$nposy,$nsizx,$nsizy +w[] {*,u,v},0,1 +else +nposx,nposy,nsizx,nsizy=$fullscreen_params +w[] $fullscreen_wsize,0,0 +fi +repeat {img,d} { cursor[$>] {!$axes_mode} } +notification=${"s0=Disable s1=Enable u ${s"$fullscreen_mode"}"}" Fullscreen" +flushkey F rmn baseview +elif $is_CTRL" && "${"iskey X"} +repeat {img,d} { cursor[$>] $axes_mode } axes_mode={!$axes_mode} +notification=${"s0=Hide s1=Show u ${s"$axes_mode"}"}" Axes" +flushkey X rmn view +elif $is_CTRL" && "${"iskey Z"}" && "$is_moderate_ratio +ratio_mode={!$ratio_mode} +notification=${"s0=Release s1=Hold u ${s"$ratio_mode"}"}" Aspect Ratio" +if !$ratio_mode nposx,nposy,nsizx,nsizy={0,[0,0,w,h]} fi +flushkey Z rmn baseview +elif $mx>=0" && "($mb&4" || "($is_CTRL" && "$mb&1)) +if !narg($pan_mx) pan_mx,pan_my,pan_posx,pan_posy=$mx,$my,$posx,$posy fi +nposx,nposy={shiftx=($mx-$pan_mx)*$nsizx/{*,w};shifty=($my-$pan_my)*$nsizy/{*,h};[$pan_posx-shiftx,$pan_posy-shifty]} +xzoom,yzoom= +elif ${"iskey PADSUB"}" || "($mx>=0" && "$mo<0) +if $nsizx>=w#0" && "$nsizy>=h#0 +nposx,nposy,nsizx,nsizy={[$nposx/2,$nposy/2,w#0,h#0]} +else +if !narg($xzoom) +xzoom,yzoom={X=$mx<0?[$nposx,$nposy]+[$nsizx,$nsizy]/2:[$nposx,$nposy]+[$mx,$my]*[$nsizx,$nsizy]/[{*,w,h}];[max(0,min(X[0],w#0-1)),max(0,min(X[1],h#0-1))]} +fi +nposx,nposy,nsizx,nsizy={[[$xzoom,$yzoom]+[$nposx-$xzoom,$nposy-$yzoom]/0.75,min(w#0,round($nsizx/0.75)),min(h#0,round($nsizy/0.75))]} +if $nsizx>w#0" && "$nsizy>h#0 nsizx,nsizy={[w#0,h#0]} fi +fi +elif ($nsizx>2" || "$nsizy>2)" && "(${"iskey PADADD"}" || "($mx>=0" && "$mo>0)) +xzoom,yzoom={X=$mx<0?[$nposx,$nposy]+[$nsizx,$nsizy]/2:[$nposx,$nposy]+[$mx,$my]*[$nsizx,$nsizy]/[{*,w,h}];[max(0,min(X[0],w#0-1)),max(0,min(X[1],h#0-1))]} +nposx,nposy,nsizx,nsizy={[[$xzoom,$yzoom]+0.75*[$nposx-$xzoom,$nposy-$yzoom],round(0.75*[$nsizx,$nsizy])]} +fi +if $nposx>=w#0-0.5*$nsizx nposx={w#0-1-0.5*$nsizx} +elif $nposx<=-0.5*$nsizx nposx={1-0.5*$nsizx} +fi +if $nposy>=h#0-0.5*$nsizy nposy={h#0-1-0.5*$nsizy} +elif $nposy<=-0.5*$nsizy nposy={1-0.5*$nsizy} +fi +if [$nposx,$nposy,$nsizx,$nsizy]!=[$posx,$posy,$sizx,$sizy] +posx,posy,sizx,sizy=$nposx,$nposy,$nsizx,$nsizy +rmn baseview +fi +if [$mx,$my]!=[$old_mx,$old_my] rmn view fi +omb=$mb +} +k[0] +if narg($_d2d_core) w[] -1,-1,$wnormalization0 +else +if $is_multiview repeat d { w$>[] 0 } else w[] 0 fi +fi +=> $nm um iskey,flushkey,isvisible,isresized,idisp +} +um _d2d_format v -1 d[] +dp : +_gmic_s="$?" v + _display_parallel 1 +display_parallel : +_gmic_s="$?" v + _$0 1 +_display_parallel : check ${1=0}>=0 +e[0--3] "Display image$? in parallel." +print +is_d2d_compatible={"res = l<=10; repeat (l,k, res&=(w#k==w && h#k==h && d#k==1 && s#k==s))"} +if $is_d2d_compatible +N=$! +repeat $! { +if s=['{$>,n}'];find(s,_'.',size(s)-1,-1)>0 nm={$>,b}.{$>,x} else nm={$>,b} fi +('$nm':;) +} +store[-$N--1] _d2d_names +a z _display2d 0,$1 s z +_d2d_names= +else +if $!<=1 v - d v + return fi +14,$! eval. "!x?copy(i(),[[',d['],v2s(y,10,10),_']'])" =. 0 discard. 0 str={t} rm. +m "__dp : parallel "$str __dp um __dp +fi +v -1 d[] +dp0 : +_gmic_s="$?" v + _display_parallel 0 +display_parallel0 : +_gmic_s="$?" v + _display_parallel 0 +default_display : +_gmic_s="$?" v + _display "",1,$[] +gaap_test : +b $1 +u \{{$1+10}\}\{$2,$3,255\} +fx_gca : +channel={1+$6} +repeat $! l[$>] to_color split_opacity l[0] ++fc $1,$2,$3 +-[1] [0] norm[1] /[1] {1e-6+iM} *[1] -1 +[1] 1 ^[1] $4 +rgb2hsl[0] s[0] c +if $5==0 *[$channel,-1] +elif $5==1 ($1^$2^$3) rgb2hsl. *[$channel] {i[$channel]} rm[-2,-1] +else rv[$channel,-1] rm. +fi +a c hsl2rgb +done a c done done +fx_gca_preview : +gui_split_preview "fx_gca $*",$-1 +fx_grain : +repeat $! l[$>] apply_channels "_fx_grain ${1-13}",$4,0 done done +_fx_grain : +if !$1 return fi +s={s} +luminance +if $5 +100%,100%,1,$s noise. 1,$3 b. $6 *. {(1-$7)/max(abs(im),abs(iM))} +100%,100%,1,1 noise. 1,$3 b. $6 *. {$7/max(abs(im),abs(iM))} ++[-2,-1] +ir[1] 0,85 b. $2 n. 0,1 *[-2,-1] *. $5 +fi +if $8 +100%,100%,1,$s noise. 1,$3 b. $9 *. {(1-$10)/max(abs(im),abs(iM))} +100%,100%,1,1 noise. 1,$3 b. $9 *. {$10/max(abs(im),abs(iM))} ++[-2,-1] +ir[1] 86,169 b. $2 n. 0,1 *[-2,-1] *. $8 +fi +if $11 +100%,100%,1,$s noise. 1,$3 b. $12 *. {(1-$13)/max(abs(im),abs(iM))} +100%,100%,1,1 noise. 1,$3 b. $12 *. {$13/max(abs(im),abs(iM))} ++[-2,-1] +ir[1] 170,256 b. $2 n. 0,1 *[-2,-1] *. $11 +fi +rm[1] +[-3--1] n. -$1,$1 + c 0,255 +fx_grain_preview : +gui_split_preview "fx_grain $*",$-1 +fx_krita : +text="Krita helper:\n""Image size = "{w}x{h}x{d}x{s}"\n""Minimal value = "{im}"\n""Maximal value = "{iM}"\n""Average value = "{_round(ia,0.1)}"\n\n\n""* We love Krita! *" +n 0,255 drgba r 512,512,1,3 +to $text,3,3,5% +gui_layer_info : +repeat $! l[$<] nm={n} +animate b,0,10,$1 +=> $nm +done done +repeat $! l[$>] +0 t. "Layer indice: ""#"$>"\nLayer name: "${-gui_layer_name}"\nBlending mode: "${-gui_layer_mode}"\nOpacity : "${-gui_layer_opacity}"\nPosition: "${-gui_layer_pos},0,0,40,1,255 +to_rgba[0] expand_xy. 8,0 +dilate. 8 to_colormode[1] {0,s} j[0] [1],20,20,0,0,1,[2],255 +k[0] +done done +gui_layer_info_preview : +gui_layer_info $1 +gui_preview +fx_perspective_scale : +repeat $! l[$<] to_rgba +w={w} h={h} +f=100 repeat $1-1 f={$f*$2%} +r[0] $f%,$f%,1,4,2 done +repeat $!-1 l[{$>+1}] +sx={round(($>+1)*$w*$3%/($1-1))} +sy={round(($>+1)*$h*$4%/($1-1))} +r $w,$h,1,4,0,0,0.5,0.5 shift. $sx,$sy,0,0,0 +done done +if !$5 repeat $!-1 blend[0,1] alpha,1,1 done fi +done done +fx_perspective_scale_preview : +fx_perspective_scale ${1-4},0 +dt_segment_shaded : +repeat $! l[$>] +b $3 segment_watershed $1,1 ++g xy,1 a[-2,-1] c norm. !=. 0 distance[1] 1 normalize_local. 1000 +n. 0,1 ^. {max(1e-5,$2)} n. 0,255 +blend value +done done +samj_about : +Dim=1024 +rm +$Dim,$Dim,1,3 +samj_Marbre 1,1,8,5,0.1,10,0,1,0,0,255,0,3,1 +fx_cupid 100,0,0,0,0,255,1 +image[-2] [-1],0,0,0,0 +rm[-1] +expand_x {{$Dim-{w}}/2},0 ++samj_Marbre 1,1,8,5,0.1,10,0,1,255,255,0,0,3,1 +rv +blend alpha +to_rgb +text "Bonjour!",{{min(w,h)}/40},{{min(w,h)}/40},{{min(w,h)}/10},1,25,94,183,255 +samj_rien_arrays_and_tiles : +Je_passe_l_hiver_en_Floride[-1] +Annular_Steiner_Chain_Round_Tile: +Dimension_Finale=$1 +Supprimer_Calque_Origine=$2 +X={round({w*{$3/100}})} +Y={round({h*{$4/100}})} +Dimension_Image=$5 +Decalage_Angle_Images_Contour=$6 +Image_Contour_Dimension=$7 +Nb_Circles_Surrounding=$8 +Angle_inclinaison=$9 +Activer_Couleurs_Formes=$10 +R_Contours=$11 +V_Contours=$12 +B_Contours=$13 +A_Contours=$14 +Affichage_Contours=$15 +R_c=$16 +V_c=$17 +B_c=$18 +A_c=$19 +R_d=$20 +V_d=$21 +B_d=$22 +A_d=$23 +Couleurs_aleatoires=$24 +Largeur_Origine={w} +Hauteur_Origine={h} +Angle_Theta={pi/$Nb_Circles_Surrounding} +Rayon_Cercle_Exterieur_Final={$Dimension_Finale/2} +Rayon_Cercle_Centre_Final={{$Rayon_Cercle_Exterieur_Final*{1-{sin($Angle_Theta)}}}/{{1+{sin($Angle_Theta)}}}} +Rayon_Cercles_Ext_Final={{$Rayon_Cercle_Exterieur_Final-$Rayon_Cercle_Centre_Final}/2} +Rayon_Centres_C_Ext_Final={$Rayon_Cercle_Centre_Final+$Rayon_Cercles_Ext_Final} +Rayon_Tang_Final={{{$Rayon_Centres_C_Ext_Final*$Rayon_Centres_C_Ext_Final}-{$Rayon_Cercles_Ext_Final*$Rayon_Cercles_Ext_Final}}^0.5} +Fin_X={round({{w-$X}*$Dimension_Image/{100}})} +Fin_Y={round({{h-$Y}*$Dimension_Image/{100}})} +if $Fin_X>$Fin_Y +Rayon_Cercle_Centre_Origine={$Fin_Y/2} +else +Rayon_Cercle_Centre_Origine={$Fin_X/2} +fi +to_rgb[-1] +{$Rayon_Cercles_Ext_Final*2*$Image_Contour_Dimension/100},{$Rayon_Cercles_Ext_Final*2*$Image_Contour_Dimension/100},1,4 +fill_color[-1] 0,0,0,0 +circle[-1] 50%,50%,{w/2},1,0,0,0,255 ++Je_passe_l_hiver_en_Floride[0] +crop[-1] $X,$Y,{$X+{$Rayon_Cercle_Centre_Origine*2}},{$Y+{$Rayon_Cercle_Centre_Origine*2}} +resize2dy[-1] {$Rayon_Cercles_Ext_Final*2*$Image_Contour_Dimension/100} +samj_blend_20220419[-1,-2] alpha +{$Rayon_Cercle_Centre_Final*2},{$Rayon_Cercle_Centre_Final*2},1,4 +fill_color[-1] 0,0,0,0 +circle[-1] 50%,50%,{w/2},1,0,0,0,255 ++Je_passe_l_hiver_en_Floride[0] +crop[-1] $X,$Y,{$X+{$Rayon_Cercle_Centre_Origine*2}},{$Y+{$Rayon_Cercle_Centre_Origine*2}} +resize2dy[-1] {$Rayon_Cercle_Centre_Final*2} +samj_blend_20220419[-1,-2] alpha,1,1 +expand_xy[-1] {$Rayon_Cercle_Exterieur_Final-$Rayon_Cercle_Centre_Final},0 +Nb_boucles=0 +X_ext=0 +Y_ext=0 +Angle=0 +Dimension_Img_pivotee=0 +X_Deplacement=0 +Y_Deplacement=0 +repeat $Nb_Circles_Surrounding +Angle={$Nb_boucles*(360/$Nb_Circles_Surrounding)} +X_ext={$Rayon_Cercle_Exterieur_Final+($Rayon_Centres_C_Ext_Final*(cos((pi/180*($Angle+$Angle_inclinaison)))))} +Y_ext={$Rayon_Cercle_Exterieur_Final+($Rayon_Centres_C_Ext_Final*(sin((pi/180*($Angle+$Angle_inclinaison)))))} +Nb_boucles+=1 +if $Couleurs_aleatoires==1 +R_c={round(u)*255} +V_c={round(u)*255} +B_c={round(u)*255} +R_d={round(u)*255} +V_d={round(u)*255} +B_d={round(u)*255} +fi +if $Activer_Couleurs_Formes==1 +if ($Nb_Circles_Surrounding%2)==0 +if ($Nb_boucles%2)==0 +ellipse[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext_Final,$Rayon_Cercles_Ext_Final,0,1,$R_c,$V_c,$B_c,$A_c +else +ellipse[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext_Final,$Rayon_Cercles_Ext_Final,0,1,$R_d,$V_d,$B_d,$A_d +fi +else +ellipse[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext_Final,$Rayon_Cercles_Ext_Final,0,1,$R_c,$V_c,$B_c,$A_c +fi +if $Affichage_Contours>0 +ellipse[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext_Final,$Rayon_Cercles_Ext_Final,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +fi ++Je_passe_l_hiver_en_Floride[-2] +rotate[-1] {$Angle+$Decalage_Angle_Images_Contour} +crop[-1] {{w-{$Rayon_Cercles_Ext_Final*2}}/2},{{h-{$Rayon_Cercles_Ext_Final*2}}/2},{{{w-{$Rayon_Cercles_Ext_Final*2}}/2}+{$Rayon_Cercles_Ext_Final*2}},{{{h-{$Rayon_Cercles_Ext_Final*2}}/2}+{$Rayon_Cercles_Ext_Final*2}} +X_Deplacement={$X_ext-$Rayon_Cercles_Ext_Final} +Y_Deplacement={$Y_ext-$Rayon_Cercles_Ext_Final} +crop[-1] {-$X_Deplacement},{-$Y_Deplacement},{{2*$Rayon_Cercle_Exterieur_Final}-$X_Deplacement-1},{{2*$Rayon_Cercle_Exterieur_Final}-$Y_Deplacement-1},0 +samj_blend_20220419[-1,-2] alpha,1,1 +done +if $Activer_Couleurs_Formes==1 +if $Affichage_Contours==1||$Affichage_Contours==2||$Affichage_Contours==3||$Affichage_Contours==4||$Affichage_Contours==5 +ellipse[-1] 50%,50%,$Rayon_Cercle_Exterieur_Final,$Rayon_Cercle_Exterieur_Final,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Affichage_Contours==1||$Affichage_Contours==2||$Affichage_Contours==3||$Affichage_Contours==4||$Affichage_Contours==6 +ellipse[-1] 50%,50%,$Rayon_Cercle_Centre_Final,$Rayon_Cercle_Centre_Final,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Affichage_Contours==2||$Affichage_Contours==3 +ellipse[-1] 50%,50%,$Rayon_Centres_C_Ext_Final,$Rayon_Centres_C_Ext_Final,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Affichage_Contours==3||$Affichage_Contours==4 +ellipse[-1] 50%,50%,$Rayon_Tang_Final,$Rayon_Tang_Final,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +fi +rm[-2] +if $Supprimer_Calque_Origine==1 +rm[0] +else +rv[0,-1] +fi +samj_Bulles_Colorees : +Couleur_Limite_r=$1 +Couleur_Limite_v=$2 +Couleur_Limite_b=$3 +Couleur_Limite_a=$4 +Resolution=$5 +Variation_L=$6 +Variation_H=$7 +Grossissement_A=$8 +Grossissement_B=$9 +Angle_Validation=$10 +Angle_Variation=$11 +Rendu=$12 +Flou_Contours=$13 +Couleur_Fond_r=$14 +Couleur_Fond_v=$15 +Couleur_Fond_b=$16 +Couleur_Fond_a=$17 +Largeur_Origine={w} +Hauteur_Origine={h} +couleur_pixel=0 +rouge_pixel=0 +vert_pixel=0 +bleu_pixel=0 +alpha_pixel=$Couleur_Limite_a +Moyenne_couleur=0 +Coeff_bulle=0 +Angle_Origine=$Angle_Variation +KL=0 +KH=0 +Hauteur=$Resolution +Largeur=$Resolution +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] $Couleur_Fond_r,$Couleur_Fond_v,$Couleur_Fond_b,$Couleur_Fond_a +repeat $Largeur_Origine/($Resolution+$Resolution) +repeat $Hauteur_Origine/($Resolution+$Resolution) +couleur_pixel=${at_ancien[0]\ {$Largeur},{$Hauteur}} +rouge_pixel=${arg\ 1,$couleur_pixel} +vert_pixel=${arg\ 2,$couleur_pixel} +bleu_pixel=${arg\ 3,$couleur_pixel} +Moyenne_couleur={{$rouge_pixel+$vert_pixel+$bleu_pixel}/$Grossissement_A} +KL={$Grossissement_B+(($Moyenne_couleur+$Variation_L)/512)} +KH={$Grossissement_B+(($Moyenne_couleur+$Variation_H)/512)} +if $Angle_Validation==0 +Angle_Variation=$Angle_Origine +else +Angle_Variation={$Angle_Origine+(($rouge_pixel+$vert_pixel+$bleu_pixel)/(255*3)*180)} +fi +if $Rendu==0 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +ellipse[-1] $Largeur,$Hauteur,{$Resolution*$KL},{$Resolution*$KH},$Angle_Variation,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +elif $Rendu==1 +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +ellipse[-1] $Largeur,$Hauteur,{$Resolution*$KL},{$Resolution*$KH},$Angle_Variation,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +elif $Rendu==2 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +ellipse[-1] $Largeur,$Hauteur,{$Resolution*$KL},{$Resolution*$KH},$Angle_Variation,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +ellipse[-1] $Largeur,$Hauteur,{$Resolution*$KL},{$Resolution*$KH},$Angle_Variation,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +fi +Hauteur+=$Resolution+$Resolution +done +Largeur+=$Resolution+$Resolution +Hauteur=$Resolution +done +rm[0] +if $Flou_Contours>0 blur[-1] $Flou_Contours,0 fi +samj_Carres_Noirs : +Limite=$1 +Resolution_Largeur=$2 +Trait_Largeur=$3 +Dilatation=$4 +R_a=$5 +V_a=$6 +B_a=$7 +A_a=$8 +Flou=$9 +R_b=$10 +V_b=$11 +B_b=$12 +A_b=$13 +VA=$14 +R_c=$15 +V_c=$16 +B_c=$17 +A_c=$18 +Ajout_Isophotes=$19 +Flou_Isophotes=$20 +Ajout_Couleur=$21 +Largeur={w} +Hauteur={h} +to_rgba[-1] +if $Ajout_Isophotes==1 ++Je_passe_l_hiver_en_Floride[-1] +fi +luminance[-1] +to_rgba[-1] +n[-1] 0,255 +c[-1] 0,$Limite +n[-1] 0,255 +c[-1] {255-$Limite},255 +n[-1] 0,255 ++Je_passe_l_hiver_en_Floride[-1] +samj_Lignes_Epaisseur_Variable[-1] 0,$Resolution_Largeur,$Trait_Largeur,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0.5,0.5,1.8,0,0 +samj_Lignes_Epaisseur_Variable[-2] 1,$Resolution_Largeur,$Trait_Largeur,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0.5,0.5,1.8,0,0 +samj_blend_20220419[-1,-2] alpha +if $Dilatation>0 +dilate[-1] $Dilatation +fi +resize[-1] $Largeur,$Hauteur +to_rgba[-1] ++Je_passe_l_hiver_en_Floride[-1] +replace_color[-1] 0%,0,0,0,0,255,$R_b,$V_b,$B_b,$A_b +blur[-1] $Flou +shift[-1] $VA,$VA,0,0,0 +crop[-1] 0,0,{w-1},{h-1} +replace_color[-2] 0%,0,0,0,0,255,$R_a,$V_a,$B_a,$A_a +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +{w},{h},1,4 +fill_color[-1] $R_c,$V_c,$B_c,$A_c +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +if $Ajout_Isophotes==1 +blur[-2] $Flou_Isophotes +isophotes[-2] 8 +n[-2] 0,255 +if $Ajout_Couleur==0 +to_graya[-2] +fi +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +fi +Cercles_Concentriques_A: +Dimension_Finale=$1 +Supprimer_Calque_Origine=$2 +Nb_Circles={$3+1} +Type_Variation_Dimensions_Cercles=$4 +Angle_Variation_Origine=$5 +Angle_Variation_Fin=$6 +Coef_Variation=$7 +Sens_Rotation_Horaire=$8 +Decalage_Cercles={$9-50} +Conserver_Exterieur_Cercles=$10 +Activer_Rayons_De_Couleurs=$11 +R_Contours=$12 +V_Contours=$13 +B_Contours=$14 +A_Contours=$15 +Affichage_Contours=$16 +Dilate_Contours=$17 +Flou_Contours=$18 +Sharpen_Contours=$19 +Repetition_Couleurs=$20 +Angle_Decalage_Couleurs=$21 +R_a=$22 +V_a=$23 +B_a=$24 +A_a=$25 +R_b=$26 +V_b=$27 +B_b=$28 +A_b=$29 +R_c=$30 +V_c=$31 +B_c=$32 +A_c=$33 +R_d=$34 +V_d=$35 +B_d=$36 +A_d=$37 +R_e=$38 +V_e=$39 +B_e=$40 +A_e=$41 +Couleurs_aleatoires=$42 +Melange_Couleurs_Contours=$43 +Filtre_Symmetrizoscope=$44 +Iterations_Symmetrizoscope=$45 +Angle_Symmetrizoscope=$46 +Symmetry_Sides=$47 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_boucles=0 +Rayon_Cercle_Final={round({{$Dimension_Finale/2}-1})} +Rayon_Cercle_En_Cours=0 +Rayon_Cercle_Precedent=0 +Rayon_Dernier_Cercle=0 +Rayon_De_Couleur={round({1+{$Dimension_Finale*{2^0.5}}})} +Decrement_Rayon=0 +Angle_Rayon_De_Couleur={72/$Repetition_Couleurs} +Angle_Rayon_De_Couleur_En_Cours=0 +Angle_Rayon_De_Couleur_En_Cours_Fin=0 +Nb_De_Rayon_De_Couleur=0 +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,0 +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,0 +if $Activer_Rayons_De_Couleurs==0 ++Je_passe_l_hiver_en_Floride[0] +if $Largeur_Origine>$Hauteur_Origine +crop[-1] {{$Largeur_Origine-$Hauteur_Origine}/2},0,{{{$Largeur_Origine-$Hauteur_Origine}/2}+$Hauteur_Origine-1},$Hauteur_Origine +elif $Largeur_Origine<$Hauteur_Origine +crop[-1] 0,{{$Hauteur_Origine-$Largeur_Origine}/2},$Largeur_Origine,{{{$Hauteur_Origine-$Largeur_Origine}/2}+$Largeur_Origine-1} +fi +resize[-1] $Dimension_Finale,$Dimension_Finale +to_rgba[-1] +fi +if $Activer_Rayons_De_Couleurs==1 +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,255 +fi +if $Sens_Rotation_Horaire==1 +Angle_Decalage_Couleurs_En_Cours={$Angle_Decalage_Couleurs_En_Cours+{$Angle_Decalage_Couleurs+{$Angle_Rayon_De_Couleur/2}}} +else +Angle_Decalage_Couleurs_En_Cours={{$Angle_Decalage_Couleurs_En_Cours+{$Angle_Decalage_Couleurs+{$Angle_Rayon_De_Couleur/2}}}+{$Angle_Rayon_De_Couleur/2}} +fi +repeat $Repetition_Couleurs +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +R_b={round(u)*255} +V_b={round(u)*255} +B_b={round(u)*255} +R_c={round(u)*255} +V_c={round(u)*255} +B_c={round(u)*255} +R_d={round(u)*255} +V_d={round(u)*255} +B_d={round(u)*255} +R_e={round(u)*255} +V_e={round(u)*255} +B_e={round(u)*255} +fi +Nb_De_Rayon_De_Couleur={$Nb_De_Rayon_De_Couleur+1} +Angle_Rayon_De_Couleur_En_Cours={{$Angle_Rayon_De_Couleur*$Nb_De_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_En_Cours} +Angle_Rayon_De_Couleur_En_Cours_Fin={$Angle_Rayon_De_Couleur+{$Angle_Rayon_De_Couleur*$Nb_De_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_En_Cours} +if $Activer_Rayons_De_Couleurs==1 +polygon[-1] 3,50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin})}}},1,$R_a,$V_a,$B_a,$A_a +fi +if $Affichage_Contours==1||$Affichage_Contours==2 +line[-2] 50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},1,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +Nb_De_Rayon_De_Couleur={$Nb_De_Rayon_De_Couleur+1} +Angle_Rayon_De_Couleur_En_Cours={{$Angle_Rayon_De_Couleur*$Nb_De_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_En_Cours} +Angle_Rayon_De_Couleur_En_Cours_Fin={$Angle_Rayon_De_Couleur+{$Angle_Rayon_De_Couleur*$Nb_De_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_En_Cours} +if $Activer_Rayons_De_Couleurs==1 +polygon[-1] 3,50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin})}}},1,$R_b,$V_b,$B_b,$A_b +fi +if $Affichage_Contours==1||$Affichage_Contours==2 +line[-2] 50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},1,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +Nb_De_Rayon_De_Couleur={$Nb_De_Rayon_De_Couleur+1} +Angle_Rayon_De_Couleur_En_Cours={{$Angle_Rayon_De_Couleur*$Nb_De_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_En_Cours} +Angle_Rayon_De_Couleur_En_Cours_Fin={$Angle_Rayon_De_Couleur+{$Angle_Rayon_De_Couleur*$Nb_De_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_En_Cours} +if $Activer_Rayons_De_Couleurs==1 +polygon[-1] 3,50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin})}}},1,$R_c,$V_c,$B_c,$A_c +fi +if $Affichage_Contours==1||$Affichage_Contours==2 +line[-2] 50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},1,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +Nb_De_Rayon_De_Couleur={$Nb_De_Rayon_De_Couleur+1} +Angle_Rayon_De_Couleur_En_Cours={{$Angle_Rayon_De_Couleur*$Nb_De_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_En_Cours} +Angle_Rayon_De_Couleur_En_Cours_Fin={$Angle_Rayon_De_Couleur+{$Angle_Rayon_De_Couleur*$Nb_De_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_En_Cours} +if $Activer_Rayons_De_Couleurs==1 +polygon[-1] 3,50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin})}}},1,$R_d,$V_d,$B_d,$A_d +fi +if $Affichage_Contours==1||$Affichage_Contours==2 +line[-2] 50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},1,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +Nb_De_Rayon_De_Couleur={$Nb_De_Rayon_De_Couleur+1} +Angle_Rayon_De_Couleur_En_Cours={{$Angle_Rayon_De_Couleur*$Nb_De_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_En_Cours} +Angle_Rayon_De_Couleur_En_Cours_Fin={$Angle_Rayon_De_Couleur+{$Angle_Rayon_De_Couleur*$Nb_De_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_En_Cours} +if $Activer_Rayons_De_Couleurs==1 +polygon[-1] 3,50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin})}}},1,$R_e,$V_e,$B_e,$A_e +fi +if $Affichage_Contours==1||$Affichage_Contours==2 +line[-2] 50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},1,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +done +Rayon_Cercle_En_Cours=$Rayon_Cercle_Final +Rayon_Cercle_Precedent=$Rayon_Cercle_Final +Nb_boucles=0 +repeat $Nb_Circles +if $Type_Variation_Dimensions_Cercles==0 +if $Nb_Circles-$Nb_boucles>1 +Decrement_Rayon={abs({{{$Rayon_Cercle_Precedent*{cos({pi/180*{$Angle_Variation_Fin}})}}-{$Rayon_Cercle_Precedent*{cos({pi/180*{$Angle_Variation_Origine}})}}}/$Nb_Circles})} +else +Decrement_Rayon={$Rayon_Cercle_Final-$Rayon_Cercle_En_Cours} +fi +elif $Type_Variation_Dimensions_Cercles==1 +if $Nb_Circles-$Nb_boucles>1 +Decrement_Rayon={abs({{{$Rayon_Cercle_Precedent*{-1+{cos({pi/180*{$Angle_Variation_Fin}})}}}-{$Rayon_Cercle_Precedent*{1+{cos({pi/180*{$Angle_Variation_Origine}})}}}}/$Nb_Circles})} +else +Decrement_Rayon={$Rayon_Cercle_Final-$Rayon_Cercle_En_Cours} +fi +elif $Type_Variation_Dimensions_Cercles==2 +Decrement_Rayon={abs({{{$Rayon_Cercle_Final*{1+{cos({pi/180*{$Angle_Variation_Fin}})}}}-{$Rayon_Cercle_Final*{1+{cos({pi/180*{$Angle_Variation_Origine}})}}}}/$Nb_Circles})} +fi +if $Sens_Rotation_Horaire==1 +Angle_Decalage_Couleurs_En_Cours={{$Decalage_Cercles*$Angle_Rayon_De_Couleur/100}+$Angle_Decalage_Couleurs_En_Cours+{$Angle_Decalage_Couleurs+{$Angle_Rayon_De_Couleur/2}}} +else +Angle_Decalage_Couleurs_En_Cours={{$Decalage_Cercles*$Angle_Rayon_De_Couleur/100*-1}+$Angle_Decalage_Couleurs_En_Cours-{$Angle_Decalage_Couleurs+{$Angle_Rayon_De_Couleur/2}}} +fi +if $Coef_Variation>0 +Rayon_Cercle_En_Cours={$Rayon_Cercle_En_Cours-{$Decrement_Rayon*$Coef_Variation}} +else +Rayon_Cercle_En_Cours={$Rayon_Cercle_En_Cours-{$Decrement_Rayon*{abs($Coef_Variation)}/{$Nb_boucles+1}}} +fi ++Je_passe_l_hiver_en_Floride[-1] +rotate[-1] {$Angle_Decalage_Couleurs_En_Cours} +crop[-1] {{w-$Dimension_Finale}/2},{{h-$Dimension_Finale}/2},{{{w-$Dimension_Finale}/2}+$Dimension_Finale-1},{{{h-$Dimension_Finale}/2}+$Dimension_Finale-1} +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,255 +circle[-1] 50%,50%,$Rayon_Cercle_Precedent,1,255,0,0,255 +circle[-1] 50%,50%,$Rayon_Cercle_En_Cours,1,0,0,0,255 +replace_color[-1] 0%,0,255,0,0,255,0,0,0,0 +samj_blend_20220419[-1,-2] alpha,1,1 +replace_color[-1] 0%,0,0,0,0,255,0,0,0,0 +samj_blend_20220419[-1,-2] alpha,1,1 +if $Affichage_Contours>0 +rv[-1,-2] +$Dimension_Finale,$Dimension_Finale,1,4 ++Je_passe_l_hiver_en_Floride[-2] +rotate[-1] $Angle_Decalage_Couleurs_En_Cours +crop[-1] {{w-$Dimension_Finale}/2},{{h-$Dimension_Finale}/2},{{{w-$Dimension_Finale}/2}+$Dimension_Finale-1},{{{h-$Dimension_Finale}/2}+$Dimension_Finale-1} +circle[-1] 50%,50%,$Rayon_Cercle_En_Cours,1,0,0,0,0 +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,255 +circle[-1] 50%,50%,$Rayon_Cercle_Precedent,1,0,0,0,0 +samj_blend_20220419[-1,-2] alpha,1,1 +replace_color[-1] 0%,0,0,0,0,255,0,0,0,0 +samj_blend_20220419[-1,-2] alpha,1,1 +if $Affichage_Contours==1||$Affichage_Contours==3 +ellipse[-1] 50%,50%,$Rayon_Cercle_En_Cours,$Rayon_Cercle_En_Cours,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +samj_blend_20220419[-1,-4] alpha,1,0 +rv[-1,-2] +fi +Rayon_Dernier_Cercle=$Rayon_Cercle_Precedent +Rayon_Cercle_Precedent=$Rayon_Cercle_En_Cours +Nb_boucles={$Nb_boucles+1} +done +rm[-2] +if $Affichage_Contours==1||$Affichage_Contours==3 +ellipse[-2] 50%,50%,$Rayon_Cercle_Final,$Rayon_Cercle_Final,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Dilate_Contours>1 dilate_circ[-2] $Dilate_Contours fi +if $Flou_Contours>0 blur[-2] $Flou_Contours,0 fi +if $Sharpen_Contours>0 sharpen[-2] $Sharpen_Contours fi +if $Filtre_Symmetrizoscope==1 +fx_symmetrizoscope[-1,-2] $Iterations_Symmetrizoscope,$Angle_Symmetrizoscope,0,$Symmetry_Sides +Conserver_Exterieur_Cercles=0 +fi +if $Conserver_Exterieur_Cercles==0 +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 255,0,0,255 +circle[-1] 50%,50%,$Rayon_Cercle_Final,1,0,0,0,255 +replace_color[-1] 0%,0,255,0,0,255,0,0,0,0 +rv[-1,-2] +samj_blend_20220419[-2,-1] add,1,0 +fi +if $Supprimer_Calque_Origine==1 +rm[0] +if $Melange_Couleurs_Contours==1 +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha,1,0 +else +rv[-1,-2] +fi +else +if $Melange_Couleurs_Contours==1 +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha,1,0 +rv[-1,-2] +else +rv[-1,-2,-3] +fi +fi +samj_Coeurs_Hearts_002 : +Resolution=$1 +Remplissage=$2 +Angle_Rotation_Motif=$3 +flou=$4 +Coeurs_Hearts=$5 +Interpolation=$6 +R_Couleur=$7 +V_Couleur=$8 +B_Couleur=$9 +A_Couleur=$10 +Gris=$11 +Boost=$12 +Type_Avant_Plan=$13 +Mode_blend=$14 +Opacity_blend=$15 +if $Type_Avant_Plan==1 ++Je_passe_l_hiver_en_Floride[-1] +to_rgb[-2] +negate[-2] +fi +to_rgb[-1] +negate[-1] +if $Interpolation==0 +resize[-1] {w/$Resolution},{h/$Resolution} +c[-1] 0,255 +elif $Interpolation==1 +resize[-1] {w/$Resolution},{h/$Resolution},1,3,3 +c[-1] 0,255 +elif $Interpolation==2 +resize[-1] {w/$Resolution},{h/$Resolution} +n[-1] 0,255 +elif $Interpolation==3 +resize[-1] {w/$Resolution},{h/$Resolution},1,3,3 +n[-1] 0,255 +fi +if $Type_Avant_Plan==1 +resize[-2] {w*$Resolution},{h*$Resolution} +rm[-1] +else +resize[-1] {w*$Resolution},{h*$Resolution} +fi +if $Gris==1 +to_gray[-1] +fi +c[-1] 0,255 +if $Boost==1 +balance_gamma[-1] 128,128,128,1 +n[-1] 0,255 +fi +negate[-1] +to_rgba[-1] +$Resolution,$Resolution,1,4 +fill_color[-1] 0,0,0,0 +if $Coeurs_Hearts==1 +(0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0;0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0;0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0;1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0;0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0;0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0;0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0;0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0;0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0;0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0;0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0;0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0;0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0) +else +(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0;1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0;1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0;1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0;1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0;1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0;1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0;1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0;0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1;0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1;0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1;0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1) +fi +if $Angle_Rotation_Motif>0 +rotate[-1] $Angle_Rotation_Motif,0,0 +autocrop[-1] 0 +fi +resize[-1] {$Resolution*$Remplissage/100},{$Resolution*$Remplissage/100} +samj_blend_20220419[-1,-2] alpha +resize[-1] [-2],[-2],1,1,0,2 +to_rgba[-1] +replace_color[-1] 0%,0,0,0,0,255,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +replace_color[-1] 0%,0,1,1,1,255,0,0,0,0 +gimp_blend_1651[-2,-1] $Mode_blend,2,$Opacity_blend,0 +if $flou>0 +blur[-1] $flou,0 +fi +samj_rien_atistic : +Je_passe_l_hiver_en_Floride[-1] +samj_Tiles_Deconstruction : +Hauteur={h} +Largeur={w} +if $1>$Hauteur||$1>$Largeur Tuiles={min($Largeur,$Hauteur)} else Tuiles=$1 fi +rotate 90 +mirror x +resize {round($Largeur/$Tuiles)*$Tuiles},{round($Hauteur/$Tuiles)*$Tuiles} +split y,$Tuiles +split x,$Tuiles +append y +append x +split y,$Tuiles +append x +resize $Largeur,$Hauteur +if $2>0 to_rgba fi +if $2==1||$2==2 +IncX={w/$Tuiles} +Xorg=0 +Yorg=0 +Xfin=0 +Yfin={h} +repeat $1 +line $Xorg,$Yorg,$Xfin,$Yfin,1,$3,$4,$5,$6 +Xorg+=$IncX +Xfin+=$IncX +done +fi +if $2==1||$2==3 +IncY={h/$Tuiles} +Xorg=0 +Yorg=0 +Xfin={w} +Yfin=0 +repeat $1 +line $Xorg,$Yorg,$Xfin,$Yfin,1,$3,$4,$5,$6 +Yorg+=$IncY +Yfin+=$IncY +done +fi +samj_Ellipses_Colorees : +Couleur_Limite_r=$1 +Couleur_Limite_v=$2 +Couleur_Limite_b=$3 +Couleur_Limite_a=$4 +Rayon_L=$5 +Rayon_H=$6 +Rendu=$7 +Flou_Contours=$8 +Couleur_Fond_r=$9 +Couleur_Fond_v=$10 +Couleur_Fond_b=$11 +Couleur_Fond_a=$12 +Largeur_Origine={w} +Hauteur_Origine={h} +couleur_pixel=0 +rouge_pixel=0 +vert_pixel=0 +bleu_pixel=0 +alpha_pixel=$Couleur_Limite_a +Hauteur=$Rayon_H +Largeur=$Rayon_L +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] $Couleur_Fond_r,$Couleur_Fond_v,$Couleur_Fond_b,$Couleur_Fond_a +repeat $Largeur_Origine/($Rayon_L+$Rayon_L) +repeat $Hauteur_Origine/($Rayon_H+$Rayon_H) +couleur_pixel=${at_ancien[0]\ {$Largeur},{$Hauteur}} +rouge_pixel=${arg\ 1,$couleur_pixel} +vert_pixel=${arg\ 2,$couleur_pixel} +bleu_pixel=${arg\ 3,$couleur_pixel} +if $Rendu==0 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +ellipse[-1] $Largeur,$Hauteur,$Rayon_L,$Rayon_H,0,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +elif $Rendu==1 +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +ellipse[-1] $Largeur,$Hauteur,$Rayon_L,$Rayon_H,0,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +elif $Rendu==2 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +ellipse[-1] $Largeur,$Hauteur,$Rayon_L,$Rayon_H,0,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +ellipse[-1] $Largeur,$Hauteur,$Rayon_L,$Rayon_H,0,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +fi +Hauteur+=$Rayon_H+$Rayon_H +done +Largeur+=$Rayon_L+$Rayon_L +Hauteur=$Rayon_H +done +rm[0] +if $Flou_Contours>0 blur[-1] $Flou_Contours,0 fi +samj_Filtres_Sur_Tuiles : +foreach { +Haut={h} +Larg={w} +if $1>{min($Larg,$Haut)/4} Decoup={round(min($Larg,$Haut)/4)} else Decoup=$1 fi +resize {round($Larg/$Decoup)*$Decoup},{round($Haut/$Decoup)*$Decoup} +split y,$Decoup +split x,$Decoup +to_rgba +$3 +append x +split x,$Decoup +append y +resize $Larg,$Haut +if $2==1 $4 fi +} +samj_Filtres_Sur_Tuiles_V2 : +foreach { +to_a +Larg={w} +Haut={h} +img2patches $1,$4%,$6 +foreach { $3 } +patches2img $Larg,$Haut,$4%,$5% +if $2==1 $7 fi +} +samj_Flouter : +blur $1 +sharpen $2 +if $3>0 autoindex {$3+1} fi +{w},{h},1,3 +fill_color[-1] 255,255,255 +imagegrid[-1] $4,$4 +negate[-1] +to_rgba +replace_color[-1] 1,0,255,255,255,255,0,0,0,0 +blend alpha +replace_color 0,0,0,0,0,255,0,0,0,0 +if $5==0 dilate {$6+$4} else dilate_circ {{$6+$4}*1.5} fi +if $7==1 n 0,255 fi +to_rgb +samj_Losanges_Colores : +Couleur_Limite_r=$1 +Couleur_Limite_v=$2 +Couleur_Limite_b=$3 +Couleur_Limite_a=$4 +Resolution=$5 +Inclinaison_Quadrilataire=$6 +Variation_L=$7 +Variation_H=$8 +Grossissement_A=$9 +Grossissement_B=$10 +Dimension_Variation=$11 +Rendu=$12 +Flou_Contours=$13 +Couleur_Fond_r=$14 +Couleur_Fond_v=$15 +Couleur_Fond_b=$16 +Couleur_Fond_a=$17 +Contours_Polygones=$18 +Largeur_Origine={w} +Hauteur_Origine={h} +couleur_pixel=0 +rouge_pixel=0 +vert_pixel=0 +bleu_pixel=0 +alpha_pixel=$Couleur_Limite_a +Moyenne_couleur=0 +Coeff_bulle=0 +Dimension_Origine={$Dimension_Variation*$Resolution} +KL=0 +KH=0 +Hauteur=$Resolution +Largeur=$Resolution +X_a=0 +Y_a=0 +X_b=0 +Y_b=0 +X_c=0 +Y_c=0 +X_d=0 +Y_d=0 +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] $Couleur_Fond_r,$Couleur_Fond_v,$Couleur_Fond_b,$Couleur_Fond_a +repeat $Largeur_Origine/($Resolution+$Resolution) +repeat $Hauteur_Origine/($Resolution+$Resolution) +couleur_pixel=${at_ancien[0]\ {$Largeur},{$Hauteur}} +rouge_pixel=${arg\ 1,$couleur_pixel} +vert_pixel=${arg\ 2,$couleur_pixel} +bleu_pixel=${arg\ 3,$couleur_pixel} +Moyenne_couleur={{$rouge_pixel+$vert_pixel+$bleu_pixel}/$Grossissement_A} +KL={$Grossissement_B+(($Moyenne_couleur+$Variation_L)/512)} +KH={$Grossissement_B+(($Moyenne_couleur+$Variation_H)/512)} +Dimension_Variation={$Dimension_Origine*(1+(($rouge_pixel+$vert_pixel+$bleu_pixel)/(255*3)))} +if $Inclinaison_Quadrilataire==0 +X_a={$Largeur-($Dimension_Variation*$KL)} +Y_a=$Hauteur +X_b=$Largeur +Y_b={$Hauteur+($Dimension_Variation*$KH)} +X_c={$Largeur+($Dimension_Variation*$KL)} +Y_c=$Hauteur +X_d=$Largeur +Y_d={$Hauteur-($Dimension_Variation*$KH)} +else +X_a={$Largeur-($Dimension_Variation*$KL)} +Y_a={$Hauteur+($Dimension_Variation*$KH)} +X_b={$Largeur+($Dimension_Variation*$KL)} +Y_b={$Hauteur+($Dimension_Variation*$KH)} +X_c={$Largeur+($Dimension_Variation*$KL)} +Y_c={$Hauteur-($Dimension_Variation*$KH)} +X_d={$Largeur-($Dimension_Variation*$KL)} +Y_d={$Hauteur-($Dimension_Variation*$KH)} +fi +if $Rendu==0 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +elif $Rendu==1 +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +elif $Rendu==2 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +fi +if $Contours_Polygones==1 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,0xFFFFFFFF,$Couleur_Fond_r,$Couleur_Fond_v,$Couleur_Fond_b,$Couleur_Fond_a +elif $Contours_Polygones==2 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,0xFFFFFFFF,255,255,255,$alpha_pixel +elif $Contours_Polygones==3 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,0xFFFFFFFF,{{$rouge_pixel+$vert_pixel+$bleu_pixel}/3},{{$rouge_pixel+$vert_pixel+$bleu_pixel}/3},{{$rouge_pixel+$vert_pixel+$bleu_pixel}/3},$alpha_pixel +elif $Contours_Polygones==4 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,0xFFFFFFFF,{$rouge_pixel*0.5},{$vert_pixel*0.5},{$bleu_pixel*0.5},$alpha_pixel +fi +Hauteur+=$Resolution+$Resolution +done +Largeur+=$Resolution+$Resolution +Hauteur=$Resolution +done +rm[0] +if $Flou_Contours>0 blur[-1] $Flou_Contours,0 fi +samj_Moirage_Spline : +Couleur_Ar=$1 +Couleur_Av=$2 +Couleur_Ab=$3 +Couleur_Aa=$4 +Resolution_A=$5 +Decalage_A=$6 +Spline_A_u0=$7 +Spline_A_v0=$8 +Spline_A_u1=$9 +Spline_A_v1=$10 +Orientation_A=$11 +Dilate_A={round($12/100*$Resolution_A)} +Couleur_Br=$13 +Couleur_Bv=$14 +Couleur_Bb=$15 +Couleur_Ba=$16 +Resolution_B=$17 +Decalage_B=$18 +Spline_B_u0=$19 +Spline_B_v0=$20 +Spline_B_u1=$21 +Spline_B_v1=$22 +Orientation_B=$23 +Dilate_B={round($24/100*$Resolution_B)} +Largeur_Origine={w} +Hauteur_Origine={h} +Nouvelle_Dimension={round({{{{$Largeur_Origine^2}+{$Hauteur_Origine^2}}^0.5}+1})} +Nouvelle_Dimension+=max(abs($Nouvelle_Dimension/100*$Spline_A_u0),abs($Nouvelle_Dimension/100*$Spline_B_u0))+max(abs($Nouvelle_Dimension/100*$Spline_A_u1),abs($Nouvelle_Dimension/100*$Spline_B_u1)) +XA_origine={round($Resolution_A/100*$Decalage_A)} +YA_origine=0 +XA_fin=$XA_origine +YA_fin=$Nouvelle_Dimension +XB_origine=0 +YB_origine={round($Resolution_B/100*$Decalage_B)} +XB_fin=$Nouvelle_Dimension +YB_fin=$XB_origine +$Nouvelle_Dimension,$Nouvelle_Dimension,1,4 +repeat $Nouvelle_Dimension/$Resolution_A +spline[-1] $XA_origine,$YA_origine,{$Nouvelle_Dimension/100*$Spline_A_u0},{$Nouvelle_Dimension/100*$Spline_A_v0},$XA_fin,$YA_fin,{$Nouvelle_Dimension/100*$Spline_A_u1},{$Nouvelle_Dimension/100*$Spline_A_v1},1,$Couleur_Ar,$Couleur_Av,$Couleur_Ab,$Couleur_Aa +XA_origine+=$Resolution_A +YA_origine=0 +XA_fin=$XA_origine +YA_fin=$Nouvelle_Dimension +done +if $Orientation_A>0 rotate[-1] {$Orientation_A} fi +crop[-1] {{w-$Largeur_Origine}/2},{{h-$Hauteur_Origine}/2},{{{w-$Largeur_Origine}/2}+$Largeur_Origine-1},{{{h-$Hauteur_Origine}/2}+$Hauteur_Origine-1} +if $Dilate_A>1 dilate_circ[-1] $Dilate_A fi +$Nouvelle_Dimension,$Nouvelle_Dimension,1,4 +repeat $Nouvelle_Dimension/$Resolution_B +spline[-1] $XB_origine,$YB_origine,{$Nouvelle_Dimension/100*$Spline_B_u0},{$Nouvelle_Dimension/100*$Spline_B_v0},$XB_fin,$YB_fin,{$Nouvelle_Dimension/100*$Spline_B_u1},{$Nouvelle_Dimension/100*$Spline_B_v1},1,$Couleur_Br,$Couleur_Bv,$Couleur_Bb,$Couleur_Ba +XB_origine=0 +YB_origine+=$Resolution_B +XB_fin=$Nouvelle_Dimension +YB_fin=$YB_origine +done +if $Orientation_B>0 rotate[-1] {$Orientation_B} fi +crop[-1] {{w-$Largeur_Origine}/2},{{h-$Hauteur_Origine}/2},{{{w-$Largeur_Origine}/2}+$Largeur_Origine-1},{{{h-$Hauteur_Origine}/2}+$Hauteur_Origine-1} +if $Dilate_B>1 dilate_circ[-1] $Dilate_B fi +samj_blend_20220419[-1,-2] alpha,1,1 +rv[-1,-2] +samj_Moirage_Spline_XY : +Couleur_Ar=$1 +Couleur_Av=$2 +Couleur_Ab=$3 +Couleur_Aa=$4 +Resolution_A=$5 +Decalage_A=$6 +Spline_A_u0=$7 +Spline_A_v0=$8 +Spline_A_u1=$9 +Spline_A_v1=$10 +Dilate_A={round($11/100*$Resolution_A)} +Couleur_Br=$12 +Couleur_Bv=$13 +Couleur_Bb=$14 +Couleur_Ba=$15 +Resolution_B=$16 +Decalage_B=$17 +Spline_B_u0=$18 +Spline_B_v0=$19 +Spline_B_u1=$20 +Spline_B_v1=$21 +Dilate_B={round($22/100*$Resolution_B)} +Choix_Calques_Visibles=$23 +Largeur_Origine={w} +Hauteur_Origine={h} +XA_origine={round({{$Resolution_A/100*$Decalage_A}-{$Largeur_Origine/2}})} +YA_origine=0 +XA_fin={round({{$Resolution_A/100*$Decalage_A}+{$Largeur_Origine*1.5}})} +YA_fin=$Hauteur_Origine +Iterations_A={round({{{abs($XA_origine)}+$XA_fin}/$Resolution_A})} +XB_origine=0 +YB_origine={round({{$Resolution_B/100*$Decalage_B}-{$Hauteur_Origine/2}})} +XB_fin=$Largeur_Origine +YB_fin={round({{$Resolution_B/100*$Decalage_B}+{$Hauteur_Origine*1.5}})} +Iterations_B={round({{{abs($YB_origine)}+$YB_fin}/$Resolution_B})} +if $Choix_Calques_Visibles==0||$Choix_Calques_Visibles==1 +$Largeur_Origine,$Hauteur_Origine,1,4 +repeat $Iterations_A +XA_origine+=$Resolution_A +XA_fin=$XA_origine +spline[-1] $XA_origine,$YA_origine,{$Largeur_Origine/100*$Spline_A_u0},{$Largeur_Origine/100*$Spline_A_v0},$XA_fin,$YA_fin,{$Largeur_Origine/100*$Spline_A_u1},{$Largeur_Origine/100*$Spline_A_v1},1,$Couleur_Ar,$Couleur_Av,$Couleur_Ab,$Couleur_Aa +done +if $Dilate_A>1 dilate_circ[-1] $Dilate_A fi +fi +if $Choix_Calques_Visibles==0||$Choix_Calques_Visibles==2 +$Largeur_Origine,$Hauteur_Origine,1,4 +repeat $Iterations_B +YB_origine+=$Resolution_B +YB_fin=$YB_origine +spline[-1] $XB_origine,$YB_origine,{$Hauteur_Origine/100*$Spline_B_u0},{$Hauteur_Origine/100*$Spline_B_v0},$XB_fin,$YB_fin,{$Hauteur_Origine/100*$Spline_B_u1},{$Hauteur_Origine/100*$Spline_B_v1},1,$Couleur_Br,$Couleur_Bv,$Couleur_Bb,$Couleur_Ba +done +if $Dilate_B>1 dilate_circ[-1] $Dilate_B fi +fi +if $Choix_Calques_Visibles==0 +samj_blend_20220419[-1,-2] alpha,1,1 +fi +rv[-1,-2] +samj_Montage_Annular_Steiner_Chain: +Dimension_Finale=$1 +Nb_Circles_Surrounding=$2 +InvSelect=$3 +Rf=$4 +Vf=$5 +Bf=$6 +Af=$7 +varx=$8 +vary=$9 +Dimension_Image={101-$10} +Shift_X=$11 +Shift_Y=$12 +Decalage_Angle_Images_Contour=$13 +RotAng=$14 +Image_Contour_Dimension=$15 +Angle_inclinaison=$16 +Agr=$17 +Shift_Xe=$18 +Shift_Ye=$19 +if $InvSelect==1 rv fi +NbImg=$! +NbImgMont={$Nb_Circles_Surrounding+1} +if $!>$NbImgMont rm[-{$NbImgMont+1}--$!] fi +NbImg=$! +Index=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +$Wtemp,$Htemp,1,4 +fill_color[-1] 255,255,255,255 +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +done +to_rgb +Wsrc={w} +Hsrc={h} +WHsrc={$Wsrc/$Hsrc} +HWsrc={$Hsrc/$Wsrc} +NbImg=$! +if $NbImg<4 +repeat {4-$NbImg} ++Je_passe_l_hiver_en_Floride[-$NbImg] +done +fi +NbImg=$! +if $Nb_Circles_Surrounding>{$NbImg-1} Nb_Circles_Surrounding={$NbImg-1} fi +Angle_Theta={pi/$Nb_Circles_Surrounding} +Rayon_Cercle_Exterieur_Final={round($Dimension_Finale/2)} +Rayon_Cercle_Centre_Final={round({{$Rayon_Cercle_Exterieur_Final*{1-{sin($Angle_Theta)}}}/{{1+{sin($Angle_Theta)}}}})} +Rayon_Cercles_Ext_Final={round({{$Rayon_Cercle_Exterieur_Final-$Rayon_Cercle_Centre_Final}/2})} +Rayon_Centres_C_Ext_Final={round($Rayon_Cercle_Centre_Final+$Rayon_Cercles_Ext_Final)} +Rayon_Tang_Final={round({{{$Rayon_Centres_C_Ext_Final*$Rayon_Centres_C_Ext_Final}-{$Rayon_Cercles_Ext_Final*$Rayon_Cercles_Ext_Final}}^0.5})} +Dim_Img_Ext={round({{$Rayon_Centres_C_Ext_Final-$Rayon_Cercle_Centre_Final}*2*$Agr})} +X={round({$Wsrc*{$varx/100}})} +Y={round({$Hsrc*{$vary/100}})} +Fin_X={round({{$Wsrc-$X}*$Dimension_Image/{100}})} +Fin_Y={round({{$Hsrc-$Y}*$Dimension_Image/{100}})} +if $Fin_X>$Fin_Y +Rayon_Cercle_Centre_Origine={$Fin_Y/2} +else +Rayon_Cercle_Centre_Origine={$Fin_X/2} +fi +{$Rayon_Cercle_Centre_Final*2},{$Rayon_Cercle_Centre_Final*2},1,4 +fill_color[-1] 0,0,0,0 +circle[-1] 50%,50%,{w/2},1,0,0,0,255 +shift[-2] $Shift_X%,$Shift_Y%,0,0,2 ++Je_passe_l_hiver_en_Floride[-2] +crop[-1] $X,$Y,{$X+{$Rayon_Cercle_Centre_Origine*2}},{$Y+{$Rayon_Cercle_Centre_Origine*2}} +resize2dy[-1] {$Rayon_Cercle_Centre_Final*2} +samj_blend_20220419[-1,-2] alpha,1,1 +expand_xy[-1] {$Rayon_Cercle_Exterieur_Final-$Rayon_Cercle_Centre_Final},0 +rm[-2] +Nb_boucles=0 +X_ext=0 +Y_ext=0 +Angle=0 +Dimension_Img_pivotee=0 +X_Deplacement=0 +Y_Deplacement=0 +repeat $Nb_Circles_Surrounding +Angle={$Nb_boucles*(360/$Nb_Circles_Surrounding)} +X_ext={$Rayon_Cercle_Exterieur_Final+($Rayon_Centres_C_Ext_Final*(cos((pi/180*($Angle+$Angle_inclinaison)))))} +Y_ext={$Rayon_Cercle_Exterieur_Final+($Rayon_Centres_C_Ext_Final*(sin((pi/180*($Angle+$Angle_inclinaison)))))} +Nb_boucles+=1 +{$Rayon_Cercles_Ext_Final*2*$Image_Contour_Dimension/100},{$Rayon_Cercles_Ext_Final*2*$Image_Contour_Dimension/100},1,4 +fill_color[-1] 0,0,0,0 +circle[-1] 50%,50%,{w/2},1,0,0,0,255 ++Je_passe_l_hiver_en_Floride[-3] +if w>h +resize[-1] {w/h*$Dim_Img_Ext},$Dim_Img_Ext +else +resize[-1] $Dim_Img_Ext,{h/w*$Dim_Img_Ext} +fi +shift[-1] $Shift_Xe%,$Shift_Ye%,0,0,2 +samj_blend_20220419[-1,-2] alpha +rm[-3] +if $RotAng==1 rotate[-1] {$Angle+$Decalage_Angle_Images_Contour} fi +crop[-1] {{w-{$Rayon_Cercles_Ext_Final*2}}/2},{{h-{$Rayon_Cercles_Ext_Final*2}}/2},{{{w-{$Rayon_Cercles_Ext_Final*2}}/2}+{$Rayon_Cercles_Ext_Final*2}},{{{h-{$Rayon_Cercles_Ext_Final*2}}/2}+{$Rayon_Cercles_Ext_Final*2}} +X_Deplacement={$X_ext-$Rayon_Cercles_Ext_Final} +Y_Deplacement={$Y_ext-$Rayon_Cercles_Ext_Final} +crop[-1] {-$X_Deplacement},{-$Y_Deplacement},{{2*$Rayon_Cercle_Exterieur_Final}-$X_Deplacement-1},{{2*$Rayon_Cercle_Exterieur_Final}-$Y_Deplacement-1},0 +samj_blend_20220419[-1,-2] alpha,1,1 +done +if {$Rf+$Vf+$Bf+$Af}>0 +replace_color[-1] 1,0,0,0,0,0,$Rf,$Vf,$Bf,$Af +fi +c 0,255 +samj_Montage_Annular_Steiner_Chain_Preview : +samj_Montage_Annular_Steiner_Chain 1200,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19 +samj_Montage_Cercle_Spirale : +NbImg=$! +NbImgMont=6 +if $NbImg<$NbImgMont +repeat {$NbImgMont-$NbImg} ++Je_passe_l_hiver_en_Floride[-$NbImg] +done +fi +samj_montage_row_GUI $2,$3,1,{$1*4},0,0,0,0,0,0,0 +if $4==0 +samj_pseudo_trans_c[-1] 3,$4,{$1*2.304},{$1*2.304},100,1,0,0 +else +samj_pseudo_trans_c[-1] 3,$4,{$1*1.945},{$1*1.945},100,1,0,0 +fi +replace_color[-1] 1,0,0,0,0,0,$5,$6,$7,$8 +if $9==1 +mirror[-1] x permute[-1] yx +elif $9==2 +permute[-1] yxzc mirror[-1] x +elif $9==3 +mirror[-1] x mirror[-1] y +fi +samj_Montage_Cercle_Spirale_preview : +samj_Montage_Cercle_Spirale 800,$2,$3,$4,$5,$6,$7,$8,$9 +samj_pseudo_trans_c : +skip ${1=2} +skip ${2=0} +Larg={w} +Haut={h} +to_rgba +if $2>0 +samj_Ecraser_Etirer 12,2,0,0,100,0 +samj_inclinaison_h $2,$Haut +fi +expand_y {$Haut*$1},0,0 +shift 0,{$Haut*{$1-1}} +map_sphere $3,$4,$5,$6,$7,$8 +{w},{h},1,4 +blend alpha +autocrop +samj_Montage_Figures_Geometriques : +Limite=$1 +Col=$2 +ColToRow=$3 +MontType=$4 +RBg=$5 +VBg=$6 +BBg=$7 +ABg=$8 +Select=$9 +ImgCar=$10 +ShiftX=$11 +ShiftY=$12 +Agr=$13 +Padd=$14 +RPad=$15 +VPad=$16 +BPad=$17 +NbCotPoly=$18 +RotPoly=$19 +EffLig=$20 +IntLig=$21 +ForOeuf=$22 +AngOeuf=$23 +to_rgba +NbImg=$! +Index=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +if $ImgCar==1 +if {$Wtemp}>{$Htemp} +crop[$Index] {{{$Wtemp}-{$Htemp}}/2},0,{{$Htemp}+{{{$Wtemp}-{$Htemp}}/2}-1},{{$Htemp}-1} +elif {$Wtemp}<{$Htemp} +crop[$Index] 0,{{{$Htemp}-{$Wtemp}}/2},{{$Wtemp}-1},{{$Wtemp}+{{{$Htemp}-{$Wtemp}}/2}-1} +fi +fi +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +$Wtemp,$Htemp,1,4 +fill_color[-1] 255,255,255,255 +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +done +shift $ShiftX%,$ShiftY%,0,0,2 +if $ColToRow==1 mirror y permute yx fi +if $Select==0 rv fi +NbImg=$! +if $Col==0 +NbCol={round($NbImg^0.5)} +if {$NbImg%$NbCol}!=0 NbCol+=1 fi +else +NbCol=$Col +fi +NbLig={round($NbImg/$NbCol)} +if {{$NbImg%$NbCol}!=0}&&{$Col>1} NbLig+=1 fi +DimMax={$Limite/max($NbCol,$NbLig)} +W,H=${-max_wh} +if {{max($W,$H)}>$DimMax} +if $DimMax<50 +DimMax=50 +fi +fi +if {$MontType==1&&$ImgCar==1} Agr={$Agr-0.18} fi +if {$MontType==3&&$ImgCar==1} Agr={$Agr-0.18} fi +if {$MontType==4&&$ImgCar==1} Agr={$Agr-0.17} fi +if {$MontType==5&&$ImgCar==1} Agr={$Agr-0.24} fi +rr2d {$DimMax*$Agr},{$DimMax*$Agr},2,1 +if $MontType==0 +Hor={h/$Agr} +Wor={w/$Agr} +crop {{w-$Wor}/2},{{h-$Hor}/2},$Wor,$Hor +autocrop +frame_xy $Padd,$Padd,$RPad,$VPad,$BPad,255 +elif $MontType==1 +to_rgb +Index=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +DimW={{min($Htemp,$Wtemp)}/$Agr} +DimH=$DimW +Ang={$RotPoly+(360/$NbCotPoly)} +$DimW,$DimH,1,4 +samj_dessiner_un_polygone[-1] $NbCotPoly,50,50,$Ang,40,50,1,0,0,0,0,0,0,0,0,0,0,255,0,0,255,0,0,0,127,127,127,0,0,0,0,0,255,255,255,0,0,0,0,1,255,0,0,0,1 +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +{$DimW+{3*$Padd}},{$DimH+{3*$Padd}},1,4 +samj_dessiner_un_polygone[-1] $NbCotPoly,50,50,$Ang,40,50,1,$RPad,$VPad,$BPad,0,0,0,0,0,0,0,255,0,0,255,0,0,0,127,127,127,0,0,0,0,0,255,255,255,0,0,0,0,1,255,0,0,0,1 +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +replace_color[$Index] 2,0,0,0,0,0,0,0,0,0 +autocrop[$Index] +done +elif $MontType==2 +to_rgb +Index=0 +repeat $NbImg +Index-=1 +autocrop[$Index] +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +Hor={{h(#$Index)}/$Agr} +Wor={{w(#$Index)}/$Agr} +crop[$Index] {{$Wtemp-$Wor}/2},{{$Htemp-$Hor}/2},$Wor,$Hor +samj_Des_Lignes_002[$Index] {{$Htemp+$Wtemp}/2/abs($IntLig)*$Agr},0,0,255,255,255,255,0,$EffLig,1,50,50,0,0,0,0,1 +to_rgba[$Index] +frame_xy[$Index] $Padd,$Padd,$RPad,$VPad,$BPad,255 +done +RBg=255 +VBg=255 +BBg=255 +ABg=255 +elif $MontType==3 +to_rgb +Index=0 +repeat $NbImg +Index-=1 +autocrop[$Index] +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +Hor={$Htemp/$Agr} +Wor={$Wtemp/$Agr} +RotOeuf=$AngOeuf +if {$Wor<$Hor}&&{$AngOeuf<0} +RotOeuf={$AngOeuf-90} +fi +$Wor,$Hor,1,4 +samj_Egg_Oeuf_Rosillo[-1] 50,50,40,200,$ForOeuf,$RotOeuf,255,255,255,255,1,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,1 +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +{$Wor+{3*$Padd}},{$Hor+{3*$Padd}},1,4 +samj_Egg_Oeuf_Rosillo[-1] 50,50,40,200,$ForOeuf,$RotOeuf,255,255,255,255,1,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,1 +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +replace_color[$Index] 2,0,0,0,0,0,0,0,0,0 +autocrop[$Index] +done +elif $MontType==4 +to_rgb +Index=0 +repeat $NbImg +Index-=1 +autocrop[$Index] +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +Hor={$Htemp/$Agr} +Wor={$Wtemp/$Agr} +$Wor,$Hor,1,4 +samj_kiss_curve[-1] +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +{$Wor+{3*$Padd}},{$Hor+{3*$Padd}},1,4 +samj_kiss_curve[-1] +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +replace_color[$Index] 2,0,0,0,0,0,0,0,0,0 +autocrop[$Index] +done +elif $MontType==5 +to_rgb +Index=0 +repeat $NbImg +Index-=1 +autocrop[$Index] +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +Hor={$Htemp/$Agr} +Wor={$Wtemp/$Agr} +$Wor,$Hor,1,4 +samj_Spirographe_Fleur[-1] +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +{$Wor+{3*$Padd}},{$Hor+{3*$Padd}},1,4 +samj_Spirographe_Fleur[-1] +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +replace_color[$Index] 2,0,0,0,0,0,0,0,0,0 +autocrop[$Index] +done +fi +append_tiles $Col +replace_color[-1] 1,0,0,0,0,0,$RBg,$VBg,$BBg,$ABg +if $ColToRow==1 mirror x permute yx fi +samj_kiss_curve : +X={round(w/2)} +Y={round(h/2)} +Valeur_A={round({{w+h}*0.2})} +Valeur_B={$Valeur_A*2} +Valeur_C={$Valeur_A*3} +Angle=0 +X_Kiss_A_Imprimer=0 +Y_Kiss_A_Imprimer=0 +X_Kiss_A_Imprimer_Precedent={$X+($Valeur_A*(cos(pi/180*$Angle)))} +Y_Kiss_A_Imprimer_Precedent={$Y+(($Valeur_B-($Valeur_A*(cos(pi/180*$Angle))))/($Valeur_C-($Valeur_A*(cos(pi/180*$Angle))))*($Valeur_A*(sin(pi/180*$Angle))))} +Nb_boucles=0 +repeat 720 +Nb_boucles+=1 +Angle={$Nb_boucles/2} +X_Kiss_A_Imprimer={$X+($Valeur_A*(cos(pi/180*$Angle)))} +Y_Kiss_A_Imprimer={$Y+($Valeur_A*((sin(pi/180*$Angle))^3))} +polygon 3,$X,$Y,$X_Kiss_A_Imprimer_Precedent,$Y_Kiss_A_Imprimer_Precedent,$X_Kiss_A_Imprimer,$Y_Kiss_A_Imprimer,1,255,255,255,255 +X_Kiss_A_Imprimer_Precedent=$X_Kiss_A_Imprimer +Y_Kiss_A_Imprimer_Precedent=$Y_Kiss_A_Imprimer +done +samj_Spirographe_Fleur : +theta=0 +Rayon_1={w*300/{1000}} +Rayon_2={w*30/{1000}} +Position_Stylo={w*8/{1000}} +X={round(w/2)} +Y={round(h/2)} +Ancien_point_X=$X +Nouveau_point_X=$Y +Ancien_point_Y=$X +Nouveau_point_Y=$Y +repeat 720 +Nouveau_point_X={$X+((($Rayon_1+$Rayon_2)*(cos(pi/180*$theta)))-(($Rayon_2+$Position_Stylo)*(cos((($Rayon_1+$Rayon_2)/$Rayon_2)*(pi/180*$theta)))))} +Nouveau_point_Y={$Y+((($Rayon_1+$Rayon_2)*(sin(pi/180*$theta)))-(($Rayon_2+$Position_Stylo)*(sin((($Rayon_1+$Rayon_2)/$Rayon_2)*(pi/180*$theta)))))} +polygon 3,$X,$Y,$Ancien_point_X,$Ancien_point_Y,$Nouveau_point_X,$Nouveau_point_Y,1,255,255,255,255 +Ancien_point_X=$Nouveau_point_X +Ancien_point_Y=$Nouveau_point_Y +theta+=0.5 +done +samj_montage_multi_rows_GUI : +DimensionMini=4 +NbTotalCalques=$! +if $NbTotalCalques<4 +repeat {4-$NbTotalCalques} ++Je_passe_l_hiver_en_Floride[-$NbTotalCalques] +done +fi +if $3==0 rv fi +if $!>$1 rm[-{$1+1}--$!] fi +NbCalques=$! +Reste={$NbCalques%$2} +NbImgParRow={{$NbCalques-$Reste}/$2} +NbRow={{$NbCalques-$Reste}/$NbImgParRow} +if {$NbImgParRow*{2*{$6+$7}+$DimensionMini}}>$5 +samj_erreur_montage_multi_rows_GUI +else +NbImg=$! +Index=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +$Wtemp,$Htemp,1,4 +fill_color[-1] 255,255,255,255 +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +done +Index=0 +Hmax=0 +Wmax=0 +Htot=0 +Wtot=0 +repeat $NbCalques +Index-=1 +Htemp={h(#$Index)} +Htot+=$Htemp +if $Htemp>$Hmax +Hmax=$Htemp +fi +Wtemp={w(#$Index)} +Wtot+=$Wtemp +if $Wtemp>$Wmax +Wmax=$Wtemp +fi +Wliste$AbsInd=$Wtemp +Hliste$AbsInd=$Htemp +done +H_moyen={round($Htot/$NbCalques)} +W_moyen={round($Wtot/$NbCalques)} +H_max=$Hmax +W_max=$Wmax +if $Reste>0 +repeat {$NbImgParRow-$Reste} +$W_moyen,$W_moyen,1,3 +fill_color[-1] 255,255,255 +done +NbRow+=1 +fi +Itr= +Idb=0 +repeat $NbRow +repeat $NbImgParRow +Idb-=1 +Itr=$Itr,$Idb +done +samj_montage_row[$Itr] $4,$5,$6,$7,$8,0 +Itr= +Idb+=$NbImgParRow-1 +done +append y +if $9==1 mirror x permute yx fi +fi +samj_erreur_montage_multi_rows_GUI : +rm +1000,1000,1,3 +fill_color 255,255,255 +text[-1] "Erreur!",20,20,20,1,255,0,0 +text[-1] "Solutions possibles :",20,60,20,1,255,0,0 +text[-1] "Diminuer 1 - Images",20,90,20,1,0,0,0 +text[-1] "Diminuer 2 - Lignes/Rows",20,120,20,1,0,0,0 +text[-1] "Diminuer 6 - Contours Pixels et/ou 7 - Espacement/Padding Pixels",20,150,30,1,0,0,0 +text[-1] "Error!",20,220,20,1,255,0,0 +text[-1] "Possible solutions :",20,260,20,1,255,0,0 +text[-1] "Decrease 1 - Images",20,290,20,1,0,0,0 +text[-1] "Decrease 2 - Lignes/Rows",20,320,20,1,0,0,0 +text[-1] "Decrease 6 - Contours Pixels and/or 7 - Espacement/Padding Pixels",20,350,30,1,0,0,0 +samj_Montage_Pappus_Chain : +X=$1 +Y=$1 +Rayon_Cercle_Exterieur=$1 +Rayon_Premier_Cercle={round($Rayon_Cercle_Exterieur*$6/100)} +Angle_inclinaison=$2 +InvSelect=$3 +Angle_Images=$4 +Rayon_Premier_Cercle={round($Rayon_Cercle_Exterieur*$5/100)} +Agr=$6 +Shift_X=$7 +Shift_Y=$8 +R_CE=$9 +V_CE=$10 +B_CE=$11 +A_CE=$12 +R_Im=$13 +V_Im=$14 +B_Im=$15 +A_Im=$16 +X_Cb={{$Rayon_Cercle_Exterieur-$Rayon_Premier_Cercle}*{cos(pi/180*$Angle_inclinaison)}} +Y_Cb={{$Rayon_Cercle_Exterieur-$Rayon_Premier_Cercle}*{sin(pi/180*$Angle_inclinaison)}} +X_Cc={$Rayon_Premier_Cercle*(cos((pi/180*($Angle_inclinaison+180))))} +Y_Cc={$Rayon_Premier_Cercle*(sin((pi/180*($Angle_inclinaison+180))))} +R_Cc={$Rayon_Cercle_Exterieur-$Rayon_Premier_Cercle} +R_Pappus={$R_Cc/$Rayon_Cercle_Exterieur} +n_Pappus=1 +b_Pappus={$R_Cc} +a_Pappus={$Rayon_Premier_Cercle} +R_Cercle_d={{$a_Pappus*$b_Pappus*{$a_Pappus+$b_Pappus}}/{{$n_Pappus*$a_Pappus*$a_Pappus}+{$b_Pappus*{$a_Pappus+$b_Pappus}}}} +Va={$R_Cc+$R_Cercle_d} +Vb={$Rayon_Premier_Cercle+$R_Cercle_d} +d_x={$X_Cb-$X_Cc} +d_y={$Y_Cb-$Y_Cc} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cc+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cc+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_da={$c_x2+$o_rx} +Y_Cercle_da={$c_y2+$o_ry} +X_Cercle_db={$c_x2-$o_rx} +Y_Cercle_db={$c_y2-$o_ry} +R_Pappus={$R_Cc/$Rayon_Cercle_Exterieur} +n_Pappus=4 +b_Pappus={$R_Cc} +a_Pappus={$Rayon_Premier_Cercle} +R_Cercle_e={{$a_Pappus*$b_Pappus*{$a_Pappus+$b_Pappus}}/{{$n_Pappus*$a_Pappus*$a_Pappus}+{$b_Pappus*{$a_Pappus+$b_Pappus}}}} +Vb={$R_Cc+$R_Cercle_e} +Va={$R_Cercle_d+$R_Cercle_e} +d_x={$X_Cc-$X_Cercle_da} +d_y={$Y_Cc-$Y_Cercle_da} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_da+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_da+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_eb={$c_x2-$o_rx} +Y_Cercle_eb={$c_y2-$o_ry} +d_x={$X_Cc-$X_Cercle_db} +d_y={$Y_Cc-$Y_Cercle_db} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_db+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_db+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_ea={$c_x2+$o_rx} +Y_Cercle_ea={$c_y2+$o_ry} +R_Pappus={$R_Cc/$Rayon_Cercle_Exterieur} +n_Pappus=9 +b_Pappus={$R_Cc} +a_Pappus={$Rayon_Premier_Cercle} +R_Cercle_f={{$a_Pappus*$b_Pappus*{$a_Pappus+$b_Pappus}}/{{$n_Pappus*$a_Pappus*$a_Pappus}+{$b_Pappus*{$a_Pappus+$b_Pappus}}}} +Vb={$R_Cc+$R_Cercle_f} +Va={$R_Cercle_e+$R_Cercle_f} +d_x={$X_Cc-$X_Cercle_ea} +d_y={$Y_Cc-$Y_Cercle_ea} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_ea+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_ea+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_fa={$c_x2+$o_rx} +Y_Cercle_fa={$c_y2+$o_ry} +d_x={$X_Cc-$X_Cercle_eb} +d_y={$Y_Cc-$Y_Cercle_eb} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_eb+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_eb+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_fb={$c_x2-$o_rx} +Y_Cercle_fb={$c_y2-$o_ry} +R_Pappus={$R_Cc/$Rayon_Cercle_Exterieur} +n_Pappus=16 +b_Pappus={$R_Cc} +a_Pappus={$Rayon_Premier_Cercle} +R_Cercle_g={{$a_Pappus*$b_Pappus*{$a_Pappus+$b_Pappus}}/{{$n_Pappus*$a_Pappus*$a_Pappus}+{$b_Pappus*{$a_Pappus+$b_Pappus}}}} +Vb={$R_Cc+$R_Cercle_g} +Va={$R_Cercle_f+$R_Cercle_g} +d_x={$X_Cc-$X_Cercle_fa} +d_y={$Y_Cc-$Y_Cercle_fa} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_fa+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_fa+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_ga={$c_x2+$o_rx} +Y_Cercle_ga={$c_y2+$o_ry} +d_x={$X_Cc-$X_Cercle_fb} +d_y={$Y_Cc-$Y_Cercle_fb} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_fb+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_fb+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_gb={$c_x2-$o_rx} +Y_Cercle_gb={$c_y2-$o_ry} +if $InvSelect==1 rv fi +NbImg=$! +NbImgMont=10 +if $NbImg>$NbImgMont rm[-{$NbImgMont+1}--$!] fi +NbImg=$! +Index=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +$Wtemp,$Htemp,1,4 +fill_color[-1] 255,255,255,255 +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +done +to_rgb +if $NbImg<$NbImgMont +repeat {$NbImgMont-$NbImg} ++Je_passe_l_hiver_en_Floride[-$NbImg] +done +fi +{$X*2},{$Y*2},1,4 +Nb_boucles=0 +repeat 10 +Nb_boucles+=1 +if $Nb_boucles==1 +Ray={round($Rayon_Premier_Cercle)} +DepX={round($X+$X_Cb)} +DepY={round($Y+$Y_Cb)} +elif $Nb_boucles==2 +Ray={round($R_Cc)} +DepX={round($X+$X_Cc)} +DepY={round($Y+$Y_Cc)} +elif $Nb_boucles==3 +Ray={round($R_Cercle_d)} +DepX={round($X+$X_Cercle_da)} +DepY={round($Y+$Y_Cercle_da)} +elif $Nb_boucles==4 +Ray={round($R_Cercle_d)} +DepX={round($X+$X_Cercle_db)} +DepY={round($Y+$Y_Cercle_db)} +elif $Nb_boucles==5 +Ray={round($R_Cercle_e)} +DepX={round($X+$X_Cercle_ea)} +DepY={round($Y+$Y_Cercle_ea)} +elif $Nb_boucles==6 +Ray={round($R_Cercle_e)} +DepX={round($X+$X_Cercle_eb)} +DepY={round($Y+$Y_Cercle_eb)} +elif $Nb_boucles==7 +Ray={round($R_Cercle_f)} +DepX={round($X+$X_Cercle_fa)} +DepY={round($Y+$Y_Cercle_fa)} +elif $Nb_boucles==8 +Ray={round($R_Cercle_f)} +DepX={round($X+$X_Cercle_fb)} +DepY={round($Y+$Y_Cercle_fb)} +elif $Nb_boucles==9 +Ray={round($R_Cercle_g)} +DepX={round($X+$X_Cercle_ga)} +DepY={round($Y+$Y_Cercle_ga)} +elif $Nb_boucles==10 +Ray={round($R_Cercle_g)} +DepX={round($X+$X_Cercle_gb)} +DepY={round($Y+$Y_Cercle_gb)} +fi +Index=-3 +{$X*2},{$Y*2},1,4 +fill_color[-1] 0,0,0,0 +circle[-1] $DepX,$DepY,$Ray,1,0,0,0,255 +Wimg={w(#$Index)} +Himg={h(#$Index)} +RayD={$Ray*2} +if $Wimg>$Himg +resize[-3] {$Wimg/$Himg*$RayD},$RayD +else +resize[-3] $RayD,{$Himg/$Wimg*$RayD} +fi +if $Agr!=100 resize[-3] $Agr%,$Agr% fi +if $Angle_Images==1 +mirror[-3] x permute[-3] yx +elif $Angle_Images==2 +permute[-3] yxzc mirror[-3] x +elif $Angle_Images==3 +mirror[-3] x mirror[-3] y +fi +shift[-3] $Shift_X,$Shift_Y,0,0,2 +Wimg={w(#$Index)} # màj +Himg={h(#$Index)} # màj +DepXi={$DepX-$Ray-(($Wimg-$RayD)/2)} +DepYi={$DepY-$Ray-(($Himg-$RayD)/2)} +if $DepXi<0 DepXi=0 fi +if $DepYi<0 DepYi=0 fi +expand_x[$Index] $DepXi,0 +expand_y[$Index] $DepYi,0 +crop[$Index] 0,0,{{$X*2}-1},{{$Y*2}-1},0 ++Je_passe_l_hiver_en_Floride[-3] +samj_blend_20220419[-1,-2] alpha +rm[-3] +samj_blend_20220419[-1,-2] alpha +done +if {$R_CE+$V_CE+$B_CE+$A_CE}>0 +{$X*2},{$Y*2},1,4 +ellipse[-1] $X,$Y,$Rayon_Cercle_Exterieur,$Rayon_Cercle_Exterieur,0,1,$R_CE,$V_CE,$B_CE,$A_CE +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +fi +if {$R_Im+$V_Im+$B_Im+$A_Im}>0 +{$X*2},{$Y*2},1,4 +fill_color[-1] $R_Im,$V_Im,$B_Im,$A_Im +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +fi +samj_Montage_Pappus_Chain_Preview : +samj_Montage_Pappus_Chain 400,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16 +samj_montage_row_GUI : +Type_Proportions_Finales=$2 +DimensionMini=4 +if $2==0 rv fi +if $!>$1 rm[-{$1+1}--$!] fi +if {{$1*{$5+$6+$DimensionMini}}>$4} +samj_erreur_montage_row_GUI +else +samj_montage_row $3,$4,$5,$6,$7,0 +if $9==1 +mirror x permute yx +expand_x {w/2} +ripple {w/2},{h},{$10+1},0,{h/100*$11} +permute yxzc mirror x +autocrop +fi +if $8==1 +mirror x permute yx +fi +fi +samj_montage_row_GUI_preview : +DimensionMini=4 +if $2==0 rv fi +if $!>$1 rm[-{$1+1}--$!] fi +if $!<$1 NbImg=$! else NbImg=$1 fi +if {{$NbImg*{2*{$5+$6}+$DimensionMini}}>$4} +samj_erreur_montage_row_GUI +else +samj_montage_row $3,$4,$5,$6,$7,0 +if $9==1 +mirror x permute yx +expand_x {w/2} +ripple {w/2},{h},{$10+1},0,{h/100*$11} +permute yxzc mirror x +autocrop +fi +if $8==1 +mirror x permute yx +fi +DimReduite=1000 +resize $DimReduite,{h/w*$DimReduite},1,3 +fi +samj_erreur_montage_row_GUI : +rm +1000,1000,1,3 +fill_color 255,255,255 +text "Erreur!",20,20,36,1,255,0,0 +text "Diminuer 5 - Contours Pixels et/ou 6 - Espacement/Padding Pixels",20,60,20,1,255,0,0 +text "Error!",20,100,36,1,255,0,0 +text "Decrease 5 - Contours Pixels and/or 6 - Espacement/Padding Pixels",20,140,20,1,255,0,0 +samj_Montage_Zigzag : +DH=$4 +if $3==0 rv fi +if $!>$2 rm[-{$2+1}--$!] fi +NbImg=$! +Index=0 +Wmax=0 +Wtot=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +if $Htemp>$Wtemp Wtemp=$DH else Wtemp={$Wtemp/$Htemp*$DH} fi +Wtot+=round($Wtemp) +done +if $Wtot>$1 DH={round($DH/$Wtot*$1)} fi +Index=0 +repeat $NbImg +Index-=1 +if {abs($Index+$5)%2}==0 +samj_inclinaison_h[$Index] 0,$DH +Wtemp={w(#$Index)} +Htemp={h(#$Index)} +if $6>0 +smooth[$Index] $6 +polygon[$Index] 3,0,0,{$Wtemp-1},0,0,{$DH-1},1,0,0,0,0 +polygon[$Index] 3,1,{$Htemp-1},{$Wtemp-1},$DH,{$Wtemp-1},{$Htemp-1},1,0,0,0,0 +fi +else +samj_inclinaison_h[$Index] 1,$DH +Wtemp={w(#$Index)} +Htemp={h(#$Index)} +if $6>0 +smooth[$Index] $6 +polygon[$Index] 3,1,0,{$Wtemp-1},0,{$Wtemp-1},{$DH-1},1,0,0,0,0 +polygon[$Index] 3,0,$DH,{$Wtemp-1},{$Htemp-1},0,{$Htemp-1},1,0,0,0,0 +fi +fi +done +append x +replace_color[-1] 1,0,0,0,0,0,$7,$8,$9,$10 +samj_inclinaison_h : +skip ${1=2} +skip ${2=128} +to_rgba +if {$1%2}==0 ++samj_demi_haut $2 +rv +samj_demi_bas[-1] $2 +append y +else +mirror y ++samj_demi_haut $2 +rv +samj_demi_bas[-1] $2 +append y +mirror y +fi +samj_demi_haut : +skip ${1=256} +Haut=$1 +if h>w resize $Haut,$Haut else resize {w/h*$Haut},$Haut fi +split x,$Haut +Index=0 +Decalage=1 +repeat $Haut +Index-=1 +shift[$Index] 0,$Decalage,0,0,0 +Decalage+=1 +done +append x +samj_demi_bas : +skip ${1=256} +Haut=$1 +if h>w resize $Haut,$Haut else resize {w/h*$Haut},$Haut fi +split x,$Haut +Index=0 +Decalage=$Haut +mirror y +repeat {$Haut-1} +Index-=1 +shift[$Index] 0,$Decalage,0,0,0 +Decalage-=1 +done +append x +mirror y +samj_Pixelisation_Contours : +Flou=$1 +Forme=$2 +Pixelisation=$3 +TM_Levels=$4 +TM_Smoothness=$5 +VA=$6 +Type_Rendu=$7 +V_Amplitude=$8 +V_Edge_Threshold=$9 +V_Smoothness=$10 +Largeur={w} +Hauteur={h} +blur[-1] $Flou +if $Forme==0 +pixelize[-1] {$Largeur/$Pixelisation},{$Hauteur/$Pixelisation} +elif $Forme==1 +imagegrid_hexagonal[-1] {round(2*$Largeur/$Pixelisation)},0 +elif $Forme==2 +imagegrid_triangular[-1] {round($Largeur/$Pixelisation)},{round({$Largeur/$Pixelisation/{2^0.5}})},0,0 +elif $Forme==3 +imagegrid_triangular[-1] {round($Largeur/$Pixelisation)},{round({$Largeur/$Pixelisation/{2^0.5}})},1,0 +elif $Forme==4 +imagegrid_triangular[-1] {round($Largeur/$Pixelisation)},{round({$Largeur/$Pixelisation/{2^0.5}})},2,0 +elif $Forme==5 +imagegrid_triangular[-1] {round($Largeur/$Pixelisation)},{round({$Largeur/$Pixelisation/{2^0.5}})},3,0 +elif $Forme==6 +imagegrid_triangular[-1] {round($Largeur/$Pixelisation)},{round({$Largeur/$Pixelisation/{2^0.5}})},4,0 +elif $Forme==7 +imagegrid_triangular[-1] {round($Largeur/$Pixelisation)},{round({$Largeur/$Pixelisation/{2^0.5}})},5,0 +fi +topographic_map[-1] $TM_Levels,$TM_Smoothness ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +if $Type_Rendu==1 +shift[-1] 0,$VA,0,0,0 +shift[-2] $VA,0,0,0,0 +shift[-3] $VA,$VA,0,0,0 +elif $Type_Rendu==2 +shift[-1] 0,$VA,0,0,0 +shift[-2] $VA,$VA,0,0,0 +shift[-3] $VA,0,0,0,0 +elif $Type_Rendu==3 +shift[-1] $VA,0,0,0,0 +shift[-2] 0,$VA,0,0,0 +shift[-3] $VA,$VA,0,0,0 +elif $Type_Rendu==4 +shift[-1] $VA,0,0,0,0 +shift[-2] $VA,$VA,0,0,0 +shift[-3] 0,$VA,0,0,0 +elif $Type_Rendu==5 +shift[-1] $VA,$VA,0,0,0 +shift[-2] $VA,0,0,0,0 +shift[-3] 0,$VA,0,0,0 +elif $Type_Rendu==6 +shift[-1] $VA,$VA,0,0,0 +shift[-2] 0,$VA,0,0,0 +shift[-3] $VA,0,0,0,0 +fi +crop[-1,-2,-3] 0,0,{$Largeur-1-$VA},{$Hauteur-1-$VA} +samj_blend_20220419[-1,-2,-3,-4] edges +fx_smooth_antialias[-1] $V_Amplitude,$V_Edge_Threshold,$V_Smoothness +samj_Pointes_De_Diamants_Colorees : +Couleur_Limite_r=$1 +Couleur_Limite_v=$2 +Couleur_Limite_b=$3 +Couleur_Limite_a=$4 +Resolution=$5 +Variation_L=$6 +Variation_H=$7 +Grossissement_A=$8 +Grossissement_B=$9 +Angle_Variation=$10 +Rendu=$11 +Flou_Contours=$12 +Couleur_Fond_r=$13 +Couleur_Fond_v=$14 +Couleur_Fond_b=$15 +Couleur_Fond_a=$16 +Contours_Polygones=$17 +Largeur_Origine={w} +Hauteur_Origine={h} +couleur_pixel=0 +rouge_pixel=0 +vert_pixel=0 +bleu_pixel=0 +alpha_pixel=$Couleur_Limite_a +Moyenne_couleur=0 +Coeff_bulle=0 +Angle_Origine={45+$Angle_Variation} +KL=0 +KH=0 +Hauteur=$Resolution +Largeur=$Resolution +X_a=0 +Y_a=0 +X_b=0 +Y_b=0 +X_c=0 +Y_c=0 +X_d=0 +Y_d=0 +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] $Couleur_Fond_r,$Couleur_Fond_v,$Couleur_Fond_b,$Couleur_Fond_a +repeat $Largeur_Origine/($Resolution+$Resolution) +repeat $Hauteur_Origine/($Resolution+$Resolution) +couleur_pixel=${at_ancien[0]\ {$Largeur},{$Hauteur}} +rouge_pixel=${arg\ 1,$couleur_pixel} +vert_pixel=${arg\ 2,$couleur_pixel} +bleu_pixel=${arg\ 3,$couleur_pixel} +Moyenne_couleur={{$rouge_pixel+$vert_pixel+$bleu_pixel}/$Grossissement_A} +KL={$Grossissement_B+(($Moyenne_couleur+$Variation_L)/512)} +KH={$Grossissement_B+(($Moyenne_couleur+$Variation_H)/512)} +Angle_Variation={$Angle_Origine+(($rouge_pixel+$vert_pixel+$bleu_pixel)/(255*3)*180)} +X_a={$Largeur-(($Resolution*$KL)*(cos(pi/180*$Angle_Variation)))} +Y_a=$Hauteur +X_b=$Largeur +Y_b={$Hauteur+(($Resolution*$KH)*(sin(pi/180*$Angle_Variation)))} +X_c={$Largeur+(($Resolution*$KL)*(cos(pi/180*$Angle_Variation)))} +Y_c=$Hauteur +X_d=$Largeur +Y_d={$Hauteur-(($Resolution*$KH)*(sin(pi/180*$Angle_Variation)))} +if $Rendu==0 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +elif $Rendu==1 +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +elif $Rendu==2 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +fi +if $Contours_Polygones==1 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,0xFFFFFFFF,$Couleur_Fond_r,$Couleur_Fond_v,$Couleur_Fond_b,$Couleur_Fond_a +elif $Contours_Polygones==2 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,0xFFFFFFFF,255,255,255,$alpha_pixel +elif $Contours_Polygones==3 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,0xFFFFFFFF,{{$rouge_pixel+$vert_pixel+$bleu_pixel}/3},{{$rouge_pixel+$vert_pixel+$bleu_pixel}/3},{{$rouge_pixel+$vert_pixel+$bleu_pixel}/3},$alpha_pixel +elif $Contours_Polygones==4 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,0xFFFFFFFF,{$rouge_pixel*0.5},{$vert_pixel*0.5},{$bleu_pixel*0.5},$alpha_pixel +fi +Hauteur+=$Resolution+$Resolution +done +Largeur+=$Resolution+$Resolution +Hauteur=$Resolution +done +rm[0] +if $Flou_Contours>0 blur[-1] $Flou_Contours,0 fi +samj_reptile : +Texture_Forme=$1 +Texture_Resolution=$2 +Texture_Spread=$3 +Texture_Color=$4 +Texture_Orientation=$5 +Texture_Light=$6 +Opacity=$7 +Largeur_Origine={w} +Hauteur_Origine={h} +Coeff_Echelle_L=1 +Coeff_Echelle_H=1 ++Je_passe_l_hiver_en_Floride[-1] +fx_isophotes[-1] 8,2,1,0 +if $Largeur_Origine<10*$Texture_Resolution +Coeff_Echelle_L={{10*$Texture_Resolution}/$Largeur_Origine} +fi +if $Hauteur_Origine<10*$Texture_Resolution +Coeff_Echelle_H={{10*$Texture_Resolution}/$Hauteur_Origine} +fi +if $Coeff_Echelle_L+$Coeff_Echelle_H>2 +if $Coeff_Echelle_L>$Coeff_Echelle_H +resize[-1,-2] {round($Largeur_Origine*$Coeff_Echelle_L)},{round($Hauteur_Origine*$Coeff_Echelle_L)} +else +resize[-1,-2] {round($Largeur_Origine*$Coeff_Echelle_H)},{round($Hauteur_Origine*$Coeff_Echelle_H)} +fi +fi +to_rgb[-1,-2] +if $Texture_Forme==0 +fx_imagegrid_hexagonal[-1] $Texture_Resolution,0.1,1 +elif $Texture_Forme==1 +imagegrid[-1] {round(w/$Texture_Resolution)},{round(h/$Texture_Resolution)} +elif $Texture_Forme==2 +fx_imagegrid_triangular {round(w/$Texture_Resolution)},{round(1.8*w/$Texture_Resolution)},0,0,0,0,255 +Texture_Spread/=2 +elif $Texture_Forme==3 +fx_imagegrid_triangular {round({h/{1.8*$Texture_Resolution}})},{round(h/$Texture_Resolution)},0,0,0,0,255 +Texture_Spread/=2 +elif $Texture_Forme==4 +fx_imagegrid_triangular {round(w/$Texture_Resolution)},{round(1.8*w/$Texture_Resolution)},1,0,0,0,255 +Texture_Spread/=2 +elif $Texture_Forme==5 +fx_imagegrid_triangular {round({h/{1.8*$Texture_Resolution}})},{round(h/$Texture_Resolution)},1,0,0,0,255 +Texture_Spread/=2 +fi +fx_spread {{w*$Texture_Spread}/{100*$Texture_Resolution}},{{h*$Texture_Spread}/{100*$Texture_Resolution}},0,0,0 +fx_boost_fade[-1] $Texture_Color,0 ++Je_passe_l_hiver_en_Floride[-1] +fx_local_orientation[-1] $Texture_Orientation,0,100,0,16,0 +blend[-1,-2] 14,0,1,1,"0" +fx_lightglow[-1] $Texture_Light,0.5,8,0.8,0,0 +blend[-1,-2] grainmerge,1,$Opacity +samj_Scintillements_Colores : +Couleur_Limite_r=$1 +Couleur_Limite_v=$2 +Couleur_Limite_b=$3 +Couleur_Limite_a=$4 +Resolution_L=$5 +Resolution_H=$6 +Dimension_Variation=$7 +Variation_Couleur=$8 +Scintillement=$9 +Angle_Decalage=$10 +Variation_Aleatoire=$11 +Rendu=$12 +Flou_Contours=$13 +Couleur_Fond_r=$14 +Couleur_Fond_v=$15 +Couleur_Fond_b=$16 +Couleur_Fond_a=$17 +Largeur_Origine={w} +Hauteur_Origine={h} +couleur_pixel=0 +rouge_pixel=0 +vert_pixel=0 +bleu_pixel=0 +alpha_pixel=$Couleur_Limite_a +Hauteur=$Resolution_H +Largeur=$Resolution_L +Rayon_Scintillement_Origine={{$Resolution_H+$Resolution_L}*$Dimension_Variation} +Rayon_Scintillement=0 +Angle_Variation={360/$Scintillement} +Angle_Variation_En_Cours=0 +Coeff_Variation_Aleatoire=0 +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] $Couleur_Fond_r,$Couleur_Fond_v,$Couleur_Fond_b,$Couleur_Fond_a +repeat $Largeur_Origine/($Resolution_L+$Resolution_L) +repeat $Hauteur_Origine/($Resolution_H+$Resolution_H) +couleur_pixel=${at_ancien[0]\ {$Largeur},{$Hauteur}} +rouge_pixel=${arg\ 1,$couleur_pixel} +vert_pixel=${arg\ 2,$couleur_pixel} +bleu_pixel=${arg\ 3,$couleur_pixel} +Moyenne_couleur={1+{{$rouge_pixel+$vert_pixel+$bleu_pixel}/$Variation_Couleur}} +Rayon_Scintillement={$Rayon_Scintillement_Origine*$Moyenne_couleur} +Angle_Variation_En_Cours=0 +if $Rendu==0 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +repeat $Scintillement +Angle_Variation_En_Cours+=$Angle_Variation+$Angle_Decalage +if $Variation_Aleatoire==0 +line[-1] $Largeur,$Hauteur,{$Largeur+{$Rayon_Scintillement*{cos(pi/180*$Angle_Variation_En_Cours)}}},{$Hauteur+{$Rayon_Scintillement*{sin(pi/180*$Angle_Variation_En_Cours)}}},1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +else +Coeff_Variation_Aleatoire={1+{{round(u)*$Variation_Aleatoire}/100}} +line[-1] $Largeur,$Hauteur,{$Largeur+{$Rayon_Scintillement*$Coeff_Variation_Aleatoire*{cos(pi/180*$Angle_Variation_En_Cours*$Coeff_Variation_Aleatoire)}}},{$Hauteur+{$Rayon_Scintillement*$Coeff_Variation_Aleatoire*{sin(pi/180*$Angle_Variation_En_Cours*$Coeff_Variation_Aleatoire)}}},1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +done +fi +elif $Rendu==1 +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +repeat $Scintillement +Angle_Variation_En_Cours+=$Angle_Variation+$Angle_Decalage +if $Variation_Aleatoire==0 +line[-1] $Largeur,$Hauteur,{$Largeur+{$Rayon_Scintillement*{cos(pi/180*$Angle_Variation_En_Cours)}}},{$Hauteur+{$Rayon_Scintillement*{sin(pi/180*$Angle_Variation_En_Cours)}}},1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +else +Coeff_Variation_Aleatoire={1+{{round(u)*$Variation_Aleatoire}/100}} +line[-1] $Largeur,$Hauteur,{$Largeur+{$Rayon_Scintillement*$Coeff_Variation_Aleatoire*{cos(pi/180*$Angle_Variation_En_Cours*$Coeff_Variation_Aleatoire)}}},{$Hauteur+{$Rayon_Scintillement*$Coeff_Variation_Aleatoire*{sin(pi/180*$Angle_Variation_En_Cours*$Coeff_Variation_Aleatoire)}}},1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +done +fi +elif $Rendu==2 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +repeat $Scintillement +Angle_Variation_En_Cours+=$Angle_Variation+$Angle_Decalage +if $Variation_Aleatoire==0 +line[-1] $Largeur,$Hauteur,{$Largeur+{$Rayon_Scintillement*{cos(pi/180*$Angle_Variation_En_Cours)}}},{$Hauteur+{$Rayon_Scintillement*{sin(pi/180*$Angle_Variation_En_Cours)}}},1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +else +Coeff_Variation_Aleatoire={1+{{round(u)*$Variation_Aleatoire}/100}} +line[-1] $Largeur,$Hauteur,{$Largeur+{$Rayon_Scintillement*$Coeff_Variation_Aleatoire*{cos(pi/180*$Angle_Variation_En_Cours*$Coeff_Variation_Aleatoire)}}},{$Hauteur+{$Rayon_Scintillement*$Coeff_Variation_Aleatoire*{sin(pi/180*$Angle_Variation_En_Cours*$Coeff_Variation_Aleatoire)}}},1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +done +fi +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +repeat $Scintillement +Angle_Variation_En_Cours+=$Angle_Variation+$Angle_Decalage +if $Variation_Aleatoire==0 +line[-1] $Largeur,$Hauteur,{$Largeur+{$Rayon_Scintillement*{cos(pi/180*$Angle_Variation_En_Cours)}}},{$Hauteur+{$Rayon_Scintillement*{sin(pi/180*$Angle_Variation_En_Cours)}}},1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +else +Coeff_Variation_Aleatoire={1+{{round(u)*$Variation_Aleatoire}/100}} +line[-1] $Largeur,$Hauteur,{$Largeur+{$Rayon_Scintillement*$Coeff_Variation_Aleatoire*{cos(pi/180*$Angle_Variation_En_Cours*$Coeff_Variation_Aleatoire)}}},{$Hauteur+{$Rayon_Scintillement*$Coeff_Variation_Aleatoire*{sin(pi/180*$Angle_Variation_En_Cours*$Coeff_Variation_Aleatoire)}}},1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +done +fi +fi +Hauteur+=$Resolution_H+$Resolution_H +done +Largeur+=$Resolution_L+$Resolution_L +Hauteur=$Resolution_H +done +rm[0] +if $Flou_Contours>0 blur[-1] $Flou_Contours,0 fi +if $18>0 deform[-1] $18 fi +samj_Angoisse : +iterations=$1 +dog_sigma1=$2 +dog_sigma2={$3/10} +sw_threshold=$4 +smooth_amplitude=$5 +noise_amplitude=$6 +noise_type=$7 +opacite=$8 +sharpen_amplitude=$9 +to_rgb[-1] ++Je_passe_l_hiver_en_Floride[-1] +repeat $iterations +dog[-1] $dog_sigma1%,$dog_sigma2% +segment_watershed[-1] $sw_threshold,1 +smooth[-1] $smooth_amplitude,0,1,1,3 +n[-1] 0,255 +if $noise_amplitude>0 noise[-1] $noise_amplitude,$noise_type fi +to_rgb[-1] +fx_decompose_channels[-1] 4,0,1,0 +remove[-1,-2] +done +to_rgb[-1] +gimp_blend_1651[-1,-2] 28,0,$opacite,0,1 +if $sharpen_amplitude>0 sharpen[-1] $sharpen_amplitude fi +samj_Barbouillage_Paint_Daub : +iterations=$1 +amplitude=$2 +sharpness=$3 +anisotropy=$4 +sigma=$5 +dl=$6 +egaliser=$7 +Couleurs_Plasma=$8 +Scale_Plasma=$9 +to_rgb[-1] +if $Couleurs_Plasma>0 +{w},{h},1,3 +fill_color[-1] 0,0,0 +plasma[-1] 1,1,$Scale_Plasma +n[-1] 0,255 +if $Couleurs_Plasma==1 +fx_decompose_channels[-1,-2] 2,0,1,0 remove[-2,-3,-4] fx_decompose_channels 2,1,1,0 +elif $Couleurs_Plasma==2 +fx_decompose_channels[-1,-2] 2,0,1,0 remove[-1,-5,-6] fx_decompose_channels[-3,-2,-1] 2,1,1,0 +fi +n[-1] 0,255 +to_rgb[-1] +fi ++Je_passe_l_hiver_en_Floride[-1] +repeat $iterations +gradient_norm[-1] +n[-1] 0,255 +equalize[-1] +done +engrave_modifie[-1] 4,0.5,4,0,8,40,0,25,1 +samj_blend_20220419[-1,-2] add +repeat $amplitude +smooth[-1] $sharpness,$anisotropy,1,$sigma,$dl +done +n[-1] 0,255 +if $egaliser==1 equalize[-1] fi +samj_chalkitup : +Abstraction=$1 +Details_scale=$2 +Color=$3 +Smoothness=$4 +Sharpen_shades=$5 +Action=$6 +Size=$7 +Invert_colors=$8 +Shape=$9 +Channel_morpho=$10 +X_variations=$11 +Y_variations=$12 +Channel_spread=$13 +foreach { +remove_opacity[-1] +fx_painting[-1] $Abstraction,$Details_scale,$Color,$Smoothness,$Sharpen_shades +ancien_gimp_morpho[-1] $Action,$Size,$Invert_colors,$Shape,$Channel_morpho,0 +fx_spread[-1] $X_variations,$Y_variations,$Channel_spread,0 +} +samj_chalkitup_preview : +gui_split_preview "samj_chalkitup ${1--2}",$-1 +samj_Color_EdgesO_Engrave : ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +pow[-2] $12 +fx_edge_offsets[-2] $1,$2,$3,$4,0 +fx_engrave[-1,-2] $5,$6,$7,$8,$9,$10,$11,0,10,1,0,0,0,1 +samj_blend_20220419[-1,-2] multiply,1,1 +if $13==1 negate[-1] fi +if $14>0 fx_segment_watershed[-2] $14,1,16,0,0 fi +samj_blend_20220419[-1,-2] multiply,1,1 +if $15==1 +Je_passe_l_hiver_en_Floride[-1] samj_blend_20220419[-1,-2] add,1,1 fi +samj_Contour_Drawings_en : +V_Isophotes=$1 +Flou=$2 +V_Dilate=$3 +V_Color_Autoindex=$4 +V_To_Gray=$5 +V_Amplitude=$6 +V_Edge_Threshold=$7 +V_Smoothness=$8 +BG=$9 +BG_Color=$10 +BG_Variation=$11 +Chalk=$12 +V_Spread=$13 +Largeur={w} +Hauteur={h} +to_rgba[-1] +if $BG==1 ++Je_passe_l_hiver_en_Floride[-1] +fi +blur[-1] $Flou +isophotes[-1] $V_Isophotes ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +shift[-1] 1,1,0,0,0 +shift[-2] 0,1,0,0,0 +shift[-3] 1,0,0,0,0 +crop[-1,-2,-3] 0,0,{$Largeur-1},{$Hauteur-1} +samj_blend_20220419[-1,-2,-3,-4] alpha +dilate[-1] $V_Dilate +if $V_Color_Autoindex>0 +autoindex[-1] {$V_Color_Autoindex+1},1,1 +to_rgba[-1] +fi +fx_smooth_antialias[-1] $V_Amplitude,$V_Edge_Threshold,$V_Smoothness +if $V_To_Gray==1 +to_graya[-1] +n[-1] 64,255 +to_rgba[-1] +fi +if $Chalk==1 +spread[-1] $V_Spread +BG_Color=0 +fi +if $BG==1 +if $BG_Color<1 +to_gray[-2] +fi +blur[-2] {{w+h}/$BG_Variation} +pow[-2] $BG_Color +samj_blend_20220419[-1,-2] alpha +fi +samj_Contour_Epais : +Iterations=$1 +Flou=$2 +V_Edges=$3 +Valider_Isophotes=$4 +V_Isophotes=$5 +V_Amplitude=$6 +V_Edge_Threshold=$7 +V_Smoothness=$8 +Epaisseur=$9 +Type_Rendu=$10 +Largeur={w} +Hauteur={h} +to_rgba[-1] ++Je_passe_l_hiver_en_Floride[-1] +repeat $Iterations +blur[-1] $Flou +edges[-1] $V_Edges% +n[-1] 0,255 +if $Valider_Isophotes==0 +to_rgba[-1] +replace_color[-1] 0%,0,255,255,255,255,0,0,0,0 +fi +done +if $Valider_Isophotes==0 +to_rgba[-1] +c[-1] 0,{$Epaisseur+1} +Epaisseur={abs($Epaisseur-2)} +else +isophotes $V_Isophotes +fi +n[-1] 0,255 ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +shift[-1] 0,1,0,0,0 +shift[-2] 1,0,0,0,0 +shift[-3] 1,1,0,0,0 +crop[-1,-2,-3] 0,0,{$Largeur-1},{$Hauteur-1} +samj_blend_20220419[-1,-2,-3,-4] alpha +blur[-1] 1 +sharpen[-1] 10 +if $Valider_Isophotes==0 +rv[-1,-2] +samj_blend_20220419[-1,-2] edges +pixelize[-1] {$Largeur/4},{$Hauteur/4} +else +samj_blend_20220419[-1,-2] edges +fi +repeat $Epaisseur ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +if $Type_Rendu==1 +shift[-1] 0,1,0,0,0 +shift[-2] 1,0,0,0,0 +shift[-3] 1,1,0,0,0 +elif $Type_Rendu==2 +shift[-1] 0,1,0,0,0 +shift[-2] 1,1,0,0,0 +shift[-3] 1,0,0,0,0 +elif $Type_Rendu==3 +shift[-1] 1,0,0,0,0 +shift[-2] 0,1,0,0,0 +shift[-3] 1,1,0,0,0 +elif $Type_Rendu==4 +shift[-1] 1,0,0,0,0 +shift[-2] 1,1,0,0,0 +shift[-3] 0,1,0,0,0 +elif $Type_Rendu==5 +shift[-1] 1,1,0,0,0 +shift[-2] 1,0,0,0,0 +shift[-3] 0,1,0,0,0 +elif $Type_Rendu==6 +shift[-1] 1,1,0,0,0 +shift[-2] 0,1,0,0,0 +shift[-3] 1,0,0,0,0 +fi +crop[-1,-2,-3] 0,0,{$Largeur-1},{$Hauteur-1} +samj_blend_20220419[-1,-2,-3,-4] alpha +done +fx_smooth_antialias[-1] $V_Amplitude,$V_Edge_Threshold,$V_Smoothness +samj_Couleurs_Rayees : +Lumin=$1 +Pixelisation=$2 +Flou=$3 +PA=$4 +DeformA=$5 +DeformB=$6 +Couleur=$7 +Iterations=$8 +Puissance=$9 +Egaliser=$10 +to_rgba[-1] ++Je_passe_l_hiver_en_Floride[-1] +if $Lumin==1 +luminance[-1] +n[-1] 0,255 +equalize[-1] +fi +to_rgb[-1] +ditheredbw[-1] +pixelize[-1] $Pixelisation +blur[-1] $Flou +ditheredbw[-1] +to_rgba[-1] +replace_color[-1] 0%,0,255,255,255,255,0,0,0,0 +replace_color[-1] 0%,0,0,0,0,255,$Couleur,$Couleur,$Couleur,255 +samj_blend_20220419[-1,-2] alpha +repeat $Iterations +smooth[-1] $PA,0.2,1,$DeformA,$DeformB +done +pow[-1] $Puissance +n[-1] 0,255 +if $Egaliser==1 equalize[-1] fi +samj_Couleurs_Rayees_2 : ++Je_passe_l_hiver_en_Floride[-1] +samj_Gris_Raye[-1] $1,$2,$3,$4,$5,$6,$7,$8 +samj_blend_20220419[-1,-2] luminance +samj_Test_Cubisme_A : +foreach { +if $1==1 +dilate {{w+h}/$2} dilate[-2] {{w+h}/$3} blend edges fi +if $4==1 imagegrid_triangular $5,$6,$7,0,0,0,0 fi +if $8==1 srand 123 spread $9 noise {$9*2.5} to_rgb blur $10 fi +if $11==1 polygonize $12,$13,$14,$15,$16 fi +if $17==1 repeat $18 kuwahara $19 done fi +if $20>0 drawing 200 smooth 300 fi +n 0,255 +if $21==1 +$24,$24,1,3 +fill_color[-1] 0,0,0 +rectangle[-1] 1,1,{w-3},{h-3},1,127,127,127 +srand 123 +noise[-1] 2,2 +if $25==1 negate[-1] fi +n[-1] 0,255 +srand 123 +brushify[0] [-1],$22,,4,,{$23%} +rm[-1] +fi +if $26==1 to_pseudogray 10,1,8 fi +} +samj_Test_Cubisme_B : +foreach { +to_rgba ++samj_Decoupage_Triangle $1,$2,$3,$4,$5 +samj_Decoupage_Triangle[-2] $6,$7,$8,$9,$10 +mode=${arg\ 1+$12,add,alpha,and,average,blue,burn,darken,difference,,divide,dodge,edges,exclusion,freeze,grainextract,grainmerge,green,hardlight,,hardmix,hue,interpolation,lighten,lightness,linearburn,linearlight,luminance,,multiply,negation,or,overlay,pinlight,red,reflect,saturation,seamless,seamless_mixed,,screen,shapeareamax,shapeareamax0,shapeareamin,shapeareamin0,shapeaverage,shapeaverage0,,shapemedian,shapemedian0,shapemin,shapemin0,shapemax,shapemax0,softburn,softdodge,,softlight,stamp,subtract,value,vividlight,xor} +if $11==1 rv[-1,-2] fi +samj_blend_20220419[-1,-2] $mode,$13 +n 0,255 +if $14==1 +$17,$17,1,3 +fill_color[-1] 0,0,0 +rectangle[-1] 1,1,{w-3},{h-3},1,127,127,127 +srand 123 +noise[-1] 2,2 +if $18==1 negate[-1] fi +n[-1] 0,255 +srand 123 +brushify[0] [-1],$15,,4,,{$16%} +rm[-1] +fi +if $19==1 to_pseudogray 10,1,8 fi +} +samj_Decoupage_Triangle : +skip ${1=2},${2=5},${3=0},${4=0},${5=0} +Haut={h} +Larg={w} +shift $4,$5,0,0,2 +resize {round($Larg/$1)*$1},{round($Haut/$1)*$1} +split y,$1 +split x,$1 +if $2<6 +imagegrid_triangular {w},{h},$2,0,0,0,0 +else +NbImg=$! +Index=0 +repeat $NbImg +Index-=1 +imagegrid_triangular[$Index] {w},{h},{$Index%6},0,0,0,0 +done +fi +if $3>0 spread $3 fi +append x +split x,$1 +append y +resize $Larg,$Haut +shift[-1] -$4,-$5,0,0,2 +samj_Diff_Tensors_Blend : +DT_Resolution=$1 +DT_Size=$2 +DT_Colormode=1 +DT_Outline=$3 +DT_Sharpness=$4 +DT_Anisotropy=$5 +DT_Gradientsmoothness=$6 +DT_Tensorsmoothness=$7 +Iterations=$8 +Flou=$9 +Mode_blend=$10 +Opacity_blend=$11 ++Je_passe_l_hiver_en_Floride[-1] +to_rgba[-1,-2] +repeat $Iterations +fx_diffusiontensors[-1] $DT_Resolution,$DT_Size,$DT_Colormode,$DT_Outline,$DT_Sharpness,$DT_Anisotropy,$DT_Gradientsmoothness,$DT_Tensorsmoothness +done +blur[-2] $Flou +gimp_blend_1651[-2,-1] $Mode_blend,2,$Opacity_blend,0 +samj_Edges_And_LIC : +Rendu=$1 +Val_Lic=$2 +Val_Dilate_Circ=$3 +Val_Sharpen=$4 +Val_Blur=$5 +Val_Edges=$6 +Val_Pow=$7 +N_min=$8 +N_max=$9 +Gray=$10 +Valider_Abstraction=$11 +Smoothness_Abstraction=$12 +Levels_Abstraction=$13 +Contrast_Abstraction=$14 +Valider_Blend=$15 +mode=${arg\ 1+$16,add,alpha,and,average,blue,burn,darken,difference,divide,dodge,edges,exclusion,freeze,grainextract,grainmerge,green,hardlight,hardmix,hue,interpolation,lighten,lightness,linearburn,linearlight,luminance,multiply,negation,or,overlay,pinlight,red,reflect,saturation,shapeareamax,shapeareamax0,shapeareamin,shapeareamin0,shapeaverage,shapeaverage0,shapemin,shapemin0,shapemax,shapemax0,softburn,softdodge,softlight,screen,stamp,subtract,value,vividlight,xor} +Inverser_Blend=$17 +to_rgb[-1] +samj_Wavelet_Sharpen_Test_en[-1] 1,0 +if $Valider_Blend==1 ++Je_passe_l_hiver_en_Floride[-1] +fi ++Je_passe_l_hiver_en_Floride[-1] +edges[-1] $Val_Edges% +pow[-1] $Val_Pow +n[-1] $N_min,$N_max +rv[-1,-2] +if $Rendu==0 +lic[-1] $Val_Lic,3 +if $Val_Dilate_Circ>0 dilate_circ[-1] {$Val_Dilate_Circ+1} fi +if $Val_Sharpen>0 sharpen[-1] $Val_Sharpen fi +if $Val_Blur>0 blur[-1] $Val_Blur fi +fi +if $Rendu==1 +mirror[-1] x +lic[-1] $Val_Lic,3 +if $Val_Dilate_Circ>0 dilate_circ[-1] {$Val_Dilate_Circ+1} fi +if $Val_Sharpen>0 sharpen[-1] $Val_Sharpen fi +if $Val_Blur>0 blur[-1] $Val_Blur fi +mirror[-1] x +fi +if $Rendu==2 ++Je_passe_l_hiver_en_Floride[-1] +lic[-1] $Val_Lic,3 +if $Val_Dilate_Circ>0 dilate_circ[-1] {$Val_Dilate_Circ+1} fi +if $Val_Sharpen>0 sharpen[-1] $Val_Sharpen fi +if $Val_Blur>0 blur[-1] $Val_Blur fi +rv[-1,-2] +mirror[-1] x +lic[-1] $Val_Lic,3 +if $Val_Dilate_Circ>0 dilate_circ[-1] {$Val_Dilate_Circ+1} fi +if $Val_Sharpen>0 sharpen[-1] $Val_Sharpen fi +if $Val_Blur>0 blur[-1] $Val_Blur fi +mirror[-1] x +samj_blend_20220419[-1,-2] average +fi +if $Gray==0 +fx_decompose_channels[-1] 7,0,1,0 +remove[-1,-2] +elif $Gray==1 +fx_decompose_channels[-1] 2,0,1,0 +remove[-3,-2] +elif $Gray==2 +fx_decompose_channels[-1] 7,0,1,0 +remove[-3,-2] +elif $Gray==3 +fx_decompose_channels[-1] 2,0,1,0 +remove[-3,-1] +elif $Gray==4 +fx_decompose_channels[-1] 7,0,1,0 +remove[-1,-3] +elif $Gray==5 +fx_decompose_channels[-1] 2,0,1,0 +remove[-1,-2] +elif $Gray==6 +to_gray[-1] +fi +n[-1] 0,255 +to_rgb[-1] +samj_blend_20220419[-1,-2] average +n[-1] 0,255 +if $Valider_Abstraction==1 +fx_color_abstraction[-1] $Smoothness_Abstraction,$Levels_Abstraction,$Contrast_Abstraction +fi +if $Valider_Blend==1 +if $Inverser_Blend==1 rv[-1,-2] fi +samj_blend_20220419[-1,-2] $mode +fi +samj_Flamboyance_Test: +foreach { +HS_Amplitude=$1 +HS_Density=$2 +Flou_HS=$3 +HS_Opacity=$4 +HS_Edge=$5 +HS_Fast_Approximation=$6 +Couleur_HS=$7 +SB_Spatial_Variance=$8 +SB_Value_Variance=$9 +SB_Iterations=$10 +Blend_Grain_Type=$11 +Iterations_Blend_Grain=$12 +Blend_Grain_Proportion=$13 +Interruption_Flamboyance=$14 +S_Amplitude=$15 +S_Sharpness=$16 +S_Anisotropy=$17 +S_Gradient_smoothness=$18 +S_Tensor_smoothness=$19 +S_Spatial_precision=$20 +S_Angular_precision=$21 +S_Value_precision=$22 +S_Interpolation=$23 +S_Fast_approximation=$24 +S_Color_Variation=$25 +C_Smoothness=$26 +C_Sharpening=$27 +C_Edge_threshold=$28 +C_Edge_thickness=$29 +C_Color_strength=$30 +C_Color_quantization=$31 +C_Color_Variation=$32 +Blend_Mode=$33 +Blend_Opacity=$34 +Blend_Reverse=$35 +Sharpen_Origine=$36 +Bruit=$37 +Spread_X=$38 +Spread_Y=$39 +to_rgba[-1] +spread[-1] $Spread_X,$Spread_Y,0 +if $Bruit>0 +Je_passe_l_hiver_en_Floride[-1] noise_hurl[-1] {$Bruit+1} samj_blend_20220419[-1,-2] alpha fi +sharpen[-1] $Sharpen_Origine ++Je_passe_l_hiver_en_Floride[-1] +blur[-1] $Flou_HS ++hardsketchbw[-1] $HS_Amplitude,$HS_Density,$HS_Opacity,$HS_Edge,$HS_Fast_Approximation +samj_blend_20220419[-1,-2] hardlight +to_rgb[-1] +negate[-1] +n[-1] 0,255 +to_graya[-1] +mul[-1] $Couleur_HS +c[-1] 0,255 +to_rgba[-1] +repeat $SB_Iterations +bilateral[-2] $SB_Spatial_Variance,$SB_Value_Variance +done +to_rgba[-2] +if $Blend_Grain_Type==0 ++Je_passe_l_hiver_en_Floride[-1,-2] +samj_blend_20220419[-1,-2] grainextract,$Blend_Grain_Proportion,1 +repeat $Iterations_Blend_Grain ++Je_passe_l_hiver_en_Floride[-2] +samj_blend_20220419[-1,-2] grainextract,$Blend_Grain_Proportion,1 +done +elif $Blend_Grain_Type==1 ++Je_passe_l_hiver_en_Floride[-1,-2] +samj_blend_20220419[-1,-2] grainextract,$Blend_Grain_Proportion,1 +repeat $Iterations_Blend_Grain ++Je_passe_l_hiver_en_Floride[-2] +samj_blend_20220419[-1,-3] grainextract,$Blend_Grain_Proportion,1 +done +elif $Blend_Grain_Type==2 ++Je_passe_l_hiver_en_Floride[-1,-2] +samj_blend_20220419[-1,-2] grainmerge,$Blend_Grain_Proportion,1 +repeat $Iterations_Blend_Grain ++Je_passe_l_hiver_en_Floride[-2] +samj_blend_20220419[-1,-2] grainmerge,$Blend_Grain_Proportion,1 +done +elif $Blend_Grain_Type==3 ++Je_passe_l_hiver_en_Floride[-1,-2] +samj_blend_20220419[-1,-2] grainmerge,$Blend_Grain_Proportion,1 +repeat $Iterations_Blend_Grain ++Je_passe_l_hiver_en_Floride[-2] +samj_blend_20220419[-1,-3] grainmerge,$Blend_Grain_Proportion,1 +done +fi +if $Interruption_Flamboyance==1 +rm[-2,-3] +else +rm[-2] +smooth[-1] $S_Amplitude,$S_Sharpness,$S_Anisotropy,$S_Gradient_smoothness,$S_Tensor_smoothness,$S_Spatial_precision,$S_Angular_precision,$S_Value_precision,$S_Interpolation,$S_Fast_approximation +mul[-1] $S_Color_Variation +c[-1] 0,255 +cartoon[-1] $C_Smoothness,$C_Sharpening,$C_Edge_threshold,$C_Edge_thickness,$C_Color_strength,$C_Color_quantization +mul[-1] $C_Color_Variation +if $Blend_Reverse==0 rv[-1,-2] fi +gimp_blend_1651[-2,-1] $Blend_Mode,2,$Blend_Opacity,0 +fi +} +samj_Flamboyance_Test_preview : +gui_split_preview "samj_Flamboyance_Test $*",$-1 +samj_fond_broderie : +Levels_topographic_map=$1 +Smoothness_topographic_map=$2 +Curviness_gimp_skeleton=$3 +Activer_fx_LCE=$4 +Activer_gimp_frame_blur=$5 +topographic_map[0] $Levels_topographic_map,$Smoothness_topographic_map ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +fx_local_orientation[-1] 0,0,100,0,0,0 +fx_color_abstraction[-1] 2,10,0.5,0 +fx_skeleton[-1] 0,$3,0,0,0 +fx_skeleton[-2] 0,$3,0,0,0 +samj_blend_20220419[-2,-1] add,1,0 +samj_blend_20220419[-2,-1] and,1,0 +if $Activer_fx_LCE==1 +fx_LCE[-1] 80,0.5,1,1,3,0 +fi +if $Activer_gimp_frame_blur==1 +fx_frame_blur[-1] 30,30,0,5,0,0,128,128,128,0,5,255,255,255,2,2,1,0,0.5,0.5,0 +fi +samj_Fond_Brosse : +Brosse=$1 +Couleur=$2 +repeat $Brosse +fx_local_orientation[-1] 0,0,100,0,25,0 +pow[-1] $Couleur +done +fx_smooth_anisotropic[-1] 60,0.7,0.3,4,10,2,180,2,1,1,1,2,0 +fx_normalize_local[-1] 2,6,5,20,1,11,0 +samj_fx_sketchbw_modifie : +samj_fonction_fx_sketchbw_modifie $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17 +if $18 +repeat $19 +smooth $20,$21,1,$22,$23 +done +n 0,255 +if $24==1 equalize fi +fi +samj_fx_sketchbw_modifie_preview : +gui_split_preview "samj_fx_sketchbw_modifie $*",$-1 +samj_fonction_fx_sketchbw_modifie : +if $16==0 srand $17 fi +if $15==4 foreach { +sketchbw ${1-14} blend hardlight } return fi +sketchbw ${1-14} +if $15&1 negate fi +if $15==2 r 100%,100%,1,4 repeat $! sh[$>] 3 *. -2 +. {2*255} c. 0,255 rm. done +elif $15==3 r 100%,100%,1,4 repeat $! sh[$>] 3 *. 2 c. 0,255 rm. done +fi +samj_Texture_Granuleuse : +foreach { +Smoothness_Gradient_RGB=$1 +Max_threshold_Gradient_RGB=$2 +Amplitude_Noise=$3 +Colors=$4 +Automatic_color_balance=$5 ++Je_passe_l_hiver_en_Floride[-1] +fx_gradient2rgb[-1] $Smoothness_Gradient_RGB,0,$Max_threshold_Gradient_RGB,0,0 +{w},{h},1,3 +fill_color[-1] 255,255,255 +to_rgb[-1] +fx_noise[-1] $Amplitude_Noise,0,2,0 +samj_blend_20220419[-1,-2] negation,1,1 +ancien_Tom_Keil_Colortemp[-1] $Colors,$Automatic_color_balance +fx_local_orientation[-1] 0,0,100,0,11 +fx_normalize_local[-1] 0,6,5,20,1,2 +samj_blend_20220419[0,-1] grainmerge,1,1 +} +samj_Texture_Granuleuse_preview : +gui_split_preview "samj_Texture_Granuleuse $*",$-1 +samj_Gris_Raye : +Lumin=$1 +Pixelisation=$2 +Flou=$3 +PA=$4 +DeformA=$5 +DeformB=$6 +Limite=$7 +Iterations=$8 +if $Lumin==1 +luminance[-1] +n[-1] 0,255 +equalize[-1] +fi +to_rgb[-1] +ditheredbw[-1] +pixelize[-1] $Pixelisation +blur[-1] $Flou +ditheredbw[-1] +repeat $Iterations +smooth[-1] $PA,0.2,1,$DeformA,$DeformB +done +n[-1] 0,255 +c[-1] 0,$Limite +n[-1] 0,255 +c[-1] {255-$Limite},255 +n[-1] 0,255 +samj_Hallucinogen : +Larg={w} +Haut={h} +to_rgb +n 0,255 +samj_HallucinoGenerator $1,$2,$3,$4,$5,$6 +if $7==1 samj_HallucinoGenerator $1,$2,$3,$4,$5,$6 fi +if $8==1 +$11,$11,1,3 +fill_color[-1] 0,0,0 +rectangle[-1] 1,1,{w-3},{h-3},1,127,127,127 +srand 123 +noise[-1] 2,2 +if $6==1 negate[-1] fi +n[-1] 0,255 +srand 123 +brushify[0] [-1],$9,,4,,{$10%} +rm[-1] +fi +samj_HallucinoGenerator: +skip ${1=80},${2=2},${3=80},${4=1.5},${5=2},${6=0} +if $1>1 autoindex $1 fi +blur $2 +pow {0.4+{$3/10000}} +mod $4 +repeat $5 smooth 100,0.7,0.3,0.6 done +if $6==1 negate fi +n 0,255 +samj_Hallucinogen_b : +if $18==0 +if $1==1 polygonize $2,$3,$4,$5,$6 fi +samj_Hallucinogen $7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17 +else +if $1==1 ++polygonize $2,$3,$4,$5,$6 +samj_Hallucinogen[-1] $7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17 +else ++samj_Hallucinogen[-1] $7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17 +fi +if $19==1 rv[-1,0] fi +mode=${arg\ 1+$20,add,alpha,and,average,blue,burn,darken,difference,,divide,dodge,edges,exclusion,freeze,grainextract,grainmerge,green,hardlight,,hardmix,hue,interpolation,lighten,lightness,linearburn,linearlight,luminance,,multiply,negation,or,overlay,pinlight,red,reflect,saturation,seamless,seamless_mixed,,screen,shapeareamax,shapeareamax0,shapeareamin,shapeareamin0,shapeaverage,shapeaverage0,,shapemedian,shapemedian0,shapemin,shapemin0,shapemax,shapemax0,softburn,softdodge,,softlight,stamp,subtract,value,vividlight,xor} +blend $mode,$21 +fi +samj_Impressions : +Spread_fond=$1 +X_amplitude=$2 +Y_amplitude=$3 +X_smoothness=$4 +Y_smoothness=$5 +Edge_attenuation=$6 +Edge_influence=$7 +Noise_scale=$8 +iterations=$9 +dog_sigma1=$10 +dog_sigma2={$11/10} +sw_threshold=$12 +smooth_amplitude=$13 +noise_amplitude=$14 +noise_type=$15 +opacite=$16 +sharpen_amplitude=$17 +Couleurs=$18 +spread[-1] $Spread_fond +fx_textured_glass[-1] $X_amplitude,$Y_amplitude,$X_smoothness,$Y_smoothness,$Edge_attenuation,$Edge_influence,$Noise_scale +to_rgb[-1] ++Je_passe_l_hiver_en_Floride[-1] +repeat $iterations +dog[-1] $dog_sigma1%,$dog_sigma2% +segment_watershed[-1] $sw_threshold,1 +smooth[-1] $smooth_amplitude,0,1,1,3 +n[-1] 0,255 +if $noise_amplitude>0 noise[-1] $noise_amplitude,$noise_type fi +to_rgb[-1] +fx_decompose_channels[-1] 4,0,1,0 +remove[-1,-2] +done +to_rgb[-1] +gimp_blend_1651[-1,-2] 28,0,$opacite,0,1 +if $sharpen_amplitude>0 sharpen[-1] $sharpen_amplitude fi +fx_custom_transform[-1] "i",i*$Couleurs,"i","i","i","i",0 +samj_Isophotes_Vers_Aquarelle : +Nb_Decomposition_Couleurs=$1 +Variation_Flou=$2 +Nb_Isophotes=$3 +Dilatation=$4 +Segmentation=$5 +S_E=$6 +S_S=$7 +S_C=$8 +S_V=$9 +Flou=$10 +Couleurs=$11 +Fond=$12 +F_A_N=$13 +F_D_H=$14 +F_S_V=$15 +F_A_W=$16 +F_R=$17 +F_V=$18 +F_B=$19 +F_O=$20 +Nb_Boucles=0 +n[-1] 0,255 ++Je_passe_l_hiver_en_Floride[-1] +repeat $Nb_Decomposition_Couleurs +if $Nb_Boucles>0 +blur[-1] {$Nb_Boucles*$Variation_Flou} +equalize[-1] {$Nb_Boucles+4},0,100 +fi +isophotes[-1] $Nb_Isophotes +if $Nb_Boucles>0 +if $Dilatation>0 dilate_circ[-1] {$Dilatation+1} fi +samj_blend_20220419[-1,-2] alpha +fi +Nb_Boucles+=1 ++Je_passe_l_hiver_en_Floride[-2] +done +rm[-1,-3] +if $Segmentation>0 fx_segment_watershed[-1] $S_E,$S_S,$S_C,$S_V fi +if $Flou>0 blur[-1] $Flou fi +if $Couleurs>0 +mul[-1] $Couleurs +elif $Couleurs<0 +pow[-1] {abs($Couleurs)} +fi +if $Fond==1 +{w},{h},1,3 +samj_Texture_Aquarelle_1[-1] $F_A_N,$F_D_H,$F_S_V,$F_A_W,$F_R,$F_V,$F_B,$F_O +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +fi +samj_Plasmic : +Flou=$1 +Puissance=$2 +Edge_threshold=$3 +Couper_Cut=$4 +Dilate_Contours=$5 +Valeur_Plasma=$6 +Deformation=$7 +Degradation_Spread=$8 +Largeur_Origine={w} +Hauteur_Origine={h} +if $Flou>0 blur[-1] $Flou fi +if $Valeur_Plasma>0 +$Largeur_Origine,$Hauteur_Origine,1,3 +plasma[-1] $Valeur_Plasma,$Valeur_Plasma +n[-1] 0,255 +rv[-1,-2] +else ++Je_passe_l_hiver_en_Floride[0] +fi +to_rgb[-1,-2] +pow[-1] $Puissance +c[-1] 0,255 +fx_segment_watershed[-1] $2,1,0,2,0 +fx_gradient_norm[-1] 0,0.5,0,100,0,0 +c[-1] $Couper_Cut,255 +n[-1] 0,255 +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Dilate_Contours>1 dilate_circ[-1,-2] $Dilate_Contours fi +if $Degradation_Spread>1 spread[-1,-2] $Degradation_Spread fi +samj_blend_20220419[-2,-1] darken,1,0 +samj_Plasmic_V2 : +Valeur_Plasma=$1 +Epaisseur=$2 +Precision=$3 +Coeff_Precision_Pixelise=$4 +Coeff_Precision_Flou=$5 +Nb_Isophotes=$6 +Deformation=$7 +Dilate_Contours=$8 +Degradation_Spread=$9 +R_a=$10 +V_a=$11 +B_a=$12 +A_a=$13 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_Boucles=0 +to_rgba[-1] ++Je_passe_l_hiver_en_Floride[-1] +repeat $Epaisseur +pixelize[-1] {1+round({$Precision+$Epaisseur-$Nb_Boucles}*$Coeff_Precision_Pixelise)},{1+round({$Precision+$Epaisseur-$Nb_Boucles}*$Coeff_Precision_Pixelise)} +blur[-1] {{$Precision+$Epaisseur+$Nb_Boucles}*$Coeff_Precision_Flou} +isophotes[-1] $Nb_Isophotes +if $Nb_Boucles>0 samj_blend_20220419[-1,-2] alpha fi +Nb_Boucles+=1 ++Je_passe_l_hiver_en_Floride[-2] +done +rm[-1,-3] +if {abs($Valeur_Plasma)}>0 +$Largeur_Origine,$Hauteur_Origine,1,3 +plasma[-1] {abs($Valeur_Plasma)},{abs($Valeur_Plasma)} +n[-1] 0,255 +else ++Je_passe_l_hiver_en_Floride[-1] +fi +rv[-1,-2] +if $Deformation>0 samj_Random_Small_Deformations[-1,-2] $Deformation,5,3 fi +if $Dilate_Contours>1 dilate_circ[-1,-2] $Dilate_Contours fi +if $Degradation_Spread>1 spread[-1,-2] $Degradation_Spread fi +if $Deformation<0 samj_Random_Small_Deformations[-1,-2] {abs($Deformation)/10},5,3 fi +if $Valeur_Plasma<0 +samj_Texture_Granuleuse[-1,-2] 0.5,20,80,0,0 +fi +rv[-1,-2] +samj_blend_20220419[-2,-1] alpha +{w},{h},1,4 +fill_color[-1] $R_a,$V_a,$B_a,$A_a +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +samj_Pointillisme : +Intensite=$1 +Densite=$2 +Dimension=$3 +Rond=$4 +Variation=$5 +Fond_Transparent=$6 +R_a=$7 +V_a=$8 +B_a=$9 +A_a=$10 +to_rgba[-1] ++Je_passe_l_hiver_en_Floride[-1] +mul[-1] $Variation +sharpen[-1] {2000*$Intensite} +noise[-1] {1+$Densite} +warp[-2] [-1],1,0,0 +rm[-1] +if $Rond==1 +dilate_circ[-1] $Dimension +else +dilate[-1] $Dimension +fi +if $Fond_Transparent==0 +{w},{h},1,4 +fill_color[-1] $R_a,$V_a,$B_a,$A_a +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +fi +samj_Pointillisme_B : +Variation=$1 +Dilatation=$2 +Pixels=$3 +Dimension=$4 +Rond=$5 +Fond_Transparent=$6 +R_a=$7 +V_a=$8 +B_a=$9 +A_a=$10 +mul[-1] $Variation +if $Dilatation>0 dilate[-1] {$Dilatation+1} fi +remove_pixels[-1] 90% +to_rgba[-1] +replace_color[-1] 0%,0,0,0,0,255,0,0,0,0 +if $Dimension>0 +if $Rond==1 +dilate_circ[-1] {$Dimension+1} +else +dilate[-1] {$Dimension+1} +fi +fi +if $Fond_Transparent==0 +{w},{h},1,4 +fill_color[-1] $R_a,$V_a,$B_a,$A_a +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +fi +samj_Posterize_B: +if $15>0&&$10==1 +blur[-1] $1 n[-2] 0,{255-{$16/$15}} else blur[-1] $1 fi +autoindex[-1] $2 +inpaint_holes[-1] {w/100*$3},1 +repeat $4 smooth[-1] $5,{$6%},1,$7,{2*$7} done +if $8>0 sharpen[-1] $8 fi +if $9==1 n[-1] 0,255 fi +if $10==1 +luminance[-1] +if $11==0 +shift[-1] 1,1,0,0,0 +elif $11==1 +shift[-1] 1,-1,0,0,0 +elif $11==2 +shift[-1] -1,1,0,0,0 +elif $11==3 +shift[-1] -1,-1,0,0,0 +elif $11==4 +shift[-1] 0,1,0,0,0 +elif $11==5 +shift[-1] 1,0,0,0,0 +elif $11==6 +shift[-1] 0,-1,0,0,0 +elif $11==7 +shift[-1] -1,0,0,0,0 +fi +samj_blend_20220419[-1,-2] difference +n[-1] 0,255 +negate[-1] +erode_circ[-1] $12 +round +if $13==1 ditheredbw[-1] fi +if $14>0 grid[-1] {18-$14},{18-$14},0,0,255,255 fi +if $15==1 to_rgb[-1,-2] samj_blend_20220419[-1,-2] vividlight +elif $15==2 ++[-2] to_rgb[-1,-2,-3] repeat 2 samj_blend_20220419[-1,-2] vividlight done +elif $15==3 ++[-2] ++[-3] to_rgb[-1,-2,-3,-4] repeat 3 samj_blend_20220419[-1,-2] vividlight done +fi +if $17==1 to_gray[-1] round select_color[-1] 0,255 n[-1] 0,255 fi +if $18==1 negate[-1] fi +fi +samj_ripple_houghsketchbw : +foreach { +autocrop +blur $1 +ripple {round({w}/$2)},$3,{$4+2},$5,$6 +if $12 ++samj_houghsketchbw_20230528 $7,$8,$9,$10,$11% +mode=${arg\ 1+$13,add,alpha,and,average,blue,burn,darken,difference,,divide,dodge,edges,exclusion,freeze,grainextract,grainmerge,green,hardlight,,hardmix,hue,interpolation,lighten,lightness,linearburn,linearlight,luminance,,multiply,negation,or,overlay,pinlight,red,reflect,saturation,seamless,seamless_mixed,,screen,shapeareamax,shapeareamax0,shapeareamin,shapeareamin0,shapeaverage,shapeaverage0,,shapemedian,shapemedian0,shapemin,shapemin0,shapemax,shapemax0,softburn,softdodge,,softlight,stamp,subtract,value,vividlight,xor} +if $15 rv fi +blend $mode,$14 +else +samj_houghsketchbw_20230528 $7,$8,$9,$10,$11% +fi +c 0,255 +} +samj_ripple_houghsketchbw_preview : +gui_split_preview "samj_ripple_houghsketchbw $*",$-1 +samj_houghsketchbw_20230528 : check "${1=100}>=0 && ${2=3}>=0 && ${3=100}>=0 && $3<=100 && ${4=0.1}>=0 && $4<=1 && ${5=100%}>0" +e[^-1] "Apply hough B&W sketch effect on image$?, with density $1, radius $2, threshold $3, opacity $4 +and votesize $5." +luminance +foreach { +nm={n} +res={round(if(${is_percent\ $5},$5*max(w,h),$5))} w={w} h={h} rhomax={sqrt(w^2+h^2)/2} +hough $res,$res n 0,255 +normalize_local. $1,$2 >=. $3% pointcloud3d. +s3d. rm[-6--5,-3--1] r. 3,{h/3},1,1,-1 columns. 0,1 +s. x,2 +*.. {2*pi/$res} +*. {$rhomax/$res} ++cos.. *. .. +. {$w/2} ++sin... *. ... +. {$h/2} +rm... +i... ... +cos[-4] sin... *[-4,-3] 10000 +++.. ... ++-.. [-5] +-[-4] [-5] ++... [-6] +rm[-6,-5] +i... 1,{h} 1,{h} a[-6--1] x +i.. ('CImg3d') i.. ({2*h},{h}) +1,{h},1,1,2 1,{h},1,1,2*y ++. 1 a[-3--1] x +3,{h},1,1,0 1,{h},1,1,$4 +y[-6--1] a[-6--1] y +$w,$h,1,1,255 j3d. ..,0,0,0,1,1,0,0 rm.. => $nm +} +samj_Test_Skeletik: +Iterations=$1 +Val_Skeleton=$2 +Deformation=$3 +Dilate_Contours=$4 +Degradation_Spread=$5 +mode=${arg\ 1+$6,add,alpha,and,average,blue,burn,darken,difference,divide,dodge,edges,exclusion,freeze,grainextract,grainmerge,green,hardlight,hardmix,hue,interpolation,lighten,lightness,linearburn,linearlight,luminance,multiply,negation,or,overlay,pinlight,red,reflect,saturation,shapeareamax,shapeareamax0,shapeareamin,shapeareamin0,shapeaverage,shapeaverage0,shapemin,shapemin0,shapemax,shapemax0,softburn,softdodge,softlight,screen,stamp,subtract,value,vividlight,xor} +Couleur=$7 +R_a=$8 +V_a=$9 +B_a=$10 +A_a=$11 +Nb_Boucles=0 ++Je_passe_l_hiver_en_Floride[-1] +if $Deformation>0 samj_Random_Small_Deformations[-1] $Deformation,5,3 fi +to_rgb[-1] +repeat $Iterations +Ancien_skeleton[-1] {$Val_Skeleton+$Nb_Boucles} +n[-1] 0,255 +to_rgba[-1] +replace_color[-1] 0%,0,0,0,0,255,0,0,0,0 +if $Nb_Boucles>0 samj_blend_20220419[-1,-2] alpha fi +Nb_Boucles+=1 ++Je_passe_l_hiver_en_Floride[-2] +done +rm[-1] +if $Degradation_Spread>1 spread[-1] $Degradation_Spread fi +if $Dilate_Contours>1 dilate_circ[-1] $Dilate_Contours fi +to_graya[-1] +rv[-1,-2] +samj_blend_20220419[-1,-2] $mode +mul[-1] $Couleur +{w},{h},1,4 +fill_color[-1] $R_a,$V_a,$B_a,$A_a +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +Ancien_skeleton : check ${1=0}>=0 +e[^-1] "Compute skeleton of binary image$?." +->= 50% distance 0 b $1 sharpen 1e10 ->= 100% +repeat $! +erode[$>] 2 --[$>,-1] done +samj_TensorTest : +DT_Sharpness=$1 +DT_Anisotropy=$2 +DT_Alpha=$3 +DT_Sigma=$4 +DT_Is_Sqrt=$5 +Absolu=$6 +SizeX=$7 +Size_Factor=$8 +Ellipse_Size=$9 +Color_Mode=$10 +Outline=$11 +Couleur=$12 +Type_Resize=$13 +Largeur_Origine={w} +Hauteur_Origine={h} +to_rgb[-1] +diffusiontensors[-1] $DT_Sharpness,$DT_Anisotropy,$DT_Alpha,$DT_Sigma,$DT_Is_Sqrt +if $Absolu==1 +abs +fi +resize2dx[-1] $SizeX +display_tensors[-1] $Size_Factor,{$Ellipse_Size/10},$Color_Mode,$Outline +if $Couleur>0 +pow[-1] $Couleur +fi +n[-1] 0,255 +if $Type_Resize==0 +to_rgba[-1] +elif $Type_Resize==1 +to_rgb[-1] +resize[-1] $Largeur_Origine,$Hauteur_Origine,5,3,3 +elif $Type_Resize==2 +to_rgba[-1] +resize[-1] $Largeur_Origine,$Hauteur_Origine,5,4,3 +fi +samj_texture_coloree : +Type=$1 +sharpness=$2 +rf=$3 +vf=$4 +bf=$5 +AmplitudeA=$6 +AmplitudeB=$7 +Angle=$8 +AmplitudeS=$9 +Iterations_Blend=$10 +Opacite_Blend=$11 +if $Type==0 +anisotropy=0 +alpha=0 +sigma=0 +is_sqrt=1 +elif $Type==1 +anisotropy=0 +alpha=4 +sigma=0 +is_sqrt=1 +elif $Type==2 +sharpness=0.5 +anisotropy=0.3 +alpha=4 +sigma=2 +is_sqrt=1 +elif $Type==3 +anisotropy=0 +alpha=0 +sigma=0 +is_sqrt=0 +elif $Type==4 +anisotropy=0 +alpha=4 +sigma=0 +is_sqrt=0 +elif $Type==5 +sharpness=0.5 +anisotropy=0.3 +alpha=4 +sigma=2 +is_sqrt=0 +fi +diffusiontensors[-1] $sharpness,$anisotropy,$alpha,$sigma,$is_sqrt +n[-1] 0,255 +equalize[-1] +fx_decompose_channels[-1] 4,0,1,0 +remove[-1,-2] +to_rgb[-1] +fx_8bits[-1] 100,10000,256 +{w},{h},1,3 +fill_color[-1] $rf,$vf,$bf +samj_blend_20220419[-1,-2] add +to_rgb[-1] +repeat $Iterations_Blend ++Je_passe_l_hiver_en_Floride[-1] +done +blur_linear[-1] $AmplitudeA,{$AmplitudeB*$AmplitudeA/100},$Angle,1 +sharpen[-1] $AmplitudeS +to_rgb[-1] +repeat $Iterations_Blend +fx_blend_edges[-1,-2] $Opacite_Blend,5,0 +done +samj_texture_coloree_en : +samj_texture_coloree $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11 +if $13>0 +deblur_richardsonlucy[-1] $12,$13,$14 +if $15 c[-1] 0,255 else n[-1] 0,255 fi +fi +samj_rien_black_and_white : +Je_passe_l_hiver_en_Floride[-1] +Engrave_colore : +Examples=$1 +Radius=$2 +Densite_A=$3 +Edges=$4 +Coherence=$5 +Threshold=$6 +Minimal_Area=$7 +Repetition=$8 +Anti_Aliasing=$9 +Choix_Couleur=$10 +R_C1=$11 +V_C1=$12 +B_C1=$13 +R_C2=$14 +V_C2=$15 +B_C2=$16 +if $Examples==1 +Radius={0.475+{$Radius/20}} +Densite_A={3.8+{$Densite_A/20}} +Edges/=20 +Coherence={10-{$Coherence/20}} +Threshold={38+{$Threshold/20}} +Minimal_Area/=20 +Repetition={55-{$Repetition/10}} +Anti_Aliasing=1 +elif $Examples==2 +Radius={0.275+{$Radius/20}} +Densite_A={2.3+{$Densite_A/20}} +Edges/=20 +Coherence={10-{$Coherence/20}} +Threshold={38+{$Threshold/20}} +Minimal_Area/=20 +Repetition={55-{$Repetition/10}} +Anti_Aliasing=1 +elif $Examples==3 +Radius={0.475+{$Radius/20}} +Densite_A={3.8+{$Densite_A/20}} +Edges/=20 +Coherence={7-{$Coherence/20}} +Threshold={48+{$Threshold/20}} +Minimal_Area=-100 +Repetition={20-{$Repetition/10}} +Anti_Aliasing=1 +elif $Examples==4 +Radius={0.175+{$Radius/20}} +Densite_A={12-{$Densite_A/2}} +Edges/=20 +Coherence={10-{$Coherence/20}} +Threshold={38+{$Threshold/20}} +Minimal_Area/=20 +Repetition={30-{$Repetition/10}} +Anti_Aliasing=3 +elif $Examples==5 +Radius={1.975+{$Radius/20}} +Densite_A={1.8+{$Densite_A/20}} +Edges/=20 +Coherence={2-{$Coherence/20}} +Threshold={18+{$Threshold/20}} +Minimal_Area=-100 +Repetition={55-{$Repetition/10}} +Anti_Aliasing=2 +elif $Examples==6 +Radius={0.975+{$Radius/20}} +Densite_A={2.3+{$Densite_A/20}} +Edges/=20 +Coherence={10-{$Coherence/20}} +Threshold={28+{$Threshold/20}} +Minimal_Area/=20 +Repetition={55-{$Repetition/10}} +Anti_Aliasing=1 +elif $Examples==7 +Radius={0.475+{$Radius/20}} +Densite_A={3.8+{$Densite_A/20}} +Edges/=20 +Coherence={10-{$Coherence/20}} +Threshold={38+{$Threshold/20}} +Minimal_Area/=20 +Repetition={-5+{$Repetition/10}} +Anti_Aliasing=1 +fi +f={arg(1+$Anti_Aliasing,1,1.5,2,3)} +r={$f*$Radius} +nm=${-gui_layer_name} +pos=${-gui_layer_pos} +C1_blanc=0 +Blend_final=0 +to_rgb[-1] +if $Choix_Couleur==0 +Blend_final=0 +elif $Choix_Couleur==1 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 8,2 +Blend_final=1 +elif $Choix_Couleur==2 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 16,2 +Blend_final=1 +elif $Choix_Couleur==3 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 32,2 +Blend_final=1 +elif $Choix_Couleur==4 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 64,2 +Blend_final=1 +elif $Choix_Couleur==5 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 8,2 +dilate_circ[-2] 2 +blur[-2] 2 +Blend_final=1 +elif $Choix_Couleur==6 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 16,2 +dilate_circ[-2] 4 +blur[-2] 2 +Blend_final=1 +elif $Choix_Couleur==7 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 32,2 +dilate_circ[-2] 8 +blur[-2] 2 +Blend_final=1 +elif $Choix_Couleur==8 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 64,2 +dilate_circ[-2] 16 +blur[-2] 2 +Blend_final=1 +elif $Choix_Couleur==9 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 8,2 +dilate_circ[-2] 2 +blur[-2] 2 +Blend_final=2 +elif $Choix_Couleur==10 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 16,2 +dilate_circ[-2] 4 +blur[-2] 2 +Blend_final=2 +elif $Choix_Couleur==11 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 32,2 +dilate_circ[-2] 8 +blur[-2] 2 +Blend_final=2 +elif $Choix_Couleur==12 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 64,2 +dilate_circ[-2] 16 +blur[-2] 2 +Blend_final=2 +fi +if $R_C1+$V_C1+$B_C1==765 +C1_blanc=1 +B_C1=254 +fi +l[-1] +split_opacity[-1] +l[-1] +wh={w},{h} +norm[-1] +if $Anti_Aliasing +r[-1] {100*$f}%,{100*$f}%,1,1,3 +fi +l[-1] +repeat $Repetition +b[-1] $r +unsharp[-1] $r,{$Densite_A} +c[-1] 0,255 +done +smooth[-1] 100,0.1,1,{$f*$Edges},{$f*$Coherence} +->=[-1] {100-$Threshold}% +done +if $Minimal_Area<0 +area_fg[-1] 0,0 +gt[-1] {$f*$Minimal_Area*$Minimal_Area} +elif $Minimal_Area>0 +-==[-1] 0 +area_fg[-1] 0,0 +gt[-1] {$f*$Minimal_Area*$Minimal_Area} +-==[-1] 0 +fi +n[-1] 0,255 +to_rgb[-1] +if $Blend_final==0 +replace_color[-1] 0,0,0,0,0,$R_C1,$V_C1,$B_C1 +replace_color[-1] 0,0,255,255,255,$R_C2,$V_C2,$B_C2 +if $C1_blanc==1 +replace_color[-1] 0,0,255,255,254,255,255,255 +fi +fi +if $Anti_Aliasing +r[-1] $wh,1,3,2 +else +r[-1] $wh +fi +done +a[-1] c +done +if $Blend_final==1 +samj_blend_20220419[-1,-2] add +replace_color[-1] 0,0,255,255,255,$R_C2,$V_C2,$B_C2 +elif $Blend_final==2 +$wh,1,3 +to_rgb[-1] +replace_color[-1] 0,0,0,0,0,$R_C2,$V_C2,$B_C2 +=>[-3] mode(add),name($nm" [couleurs]"),pos($pos) +=>[-2] name($nm" [gravure]"),pos($pos) +fi +engrave_modifie : +Examples=$1 +Radius=$2 +Densite_A=$3 +Edges=$4 +Coherence=$5 +Threshold=$6 +Minimal_Area=$7 +Repetition=$8 +Anti_Aliasing=$9 +if $Examples==1 +Radius={0.475+{$Radius/20}} +Densite_A={3.8+{$Densite_A/20}} +Edges/=20 +Coherence={10-{$Coherence/20}} +Threshold={38+{$Threshold/20}} +Minimal_Area/=20 +Repetition={55-{$Repetition/10}} +Anti_Aliasing=1 +elif $Examples==2 +Radius={0.275+{$Radius/20}} +Densite_A={2.3+{$Densite_A/20}} +Edges/=20 +Coherence={10-{$Coherence/20}} +Threshold={38+{$Threshold/20}} +Minimal_Area/=20 +Repetition={55-{$Repetition/10}} +Anti_Aliasing=1 +elif $Examples==3 +Radius={0.475+{$Radius/20}} +Densite_A={3.8+{$Densite_A/20}} +Edges/=20 +Coherence={7-{$Coherence/20}} +Threshold={48+{$Threshold/20}} +Minimal_Area=-100 +Repetition={20-{$Repetition/10}} +Anti_Aliasing=1 +elif $Examples==4 +Radius={0.175+{$Radius/20}} +Densite_A={12-{$Densite_A/2}} +Edges/=20 +Coherence={10-{$Coherence/20}} +Threshold={38+{$Threshold/20}} +Minimal_Area/=20 +Repetition={30-{$Repetition/10}} +Anti_Aliasing=3 +elif $Examples==5 +Radius={1.975+{$Radius/20}} +Densite_A={1.8+{$Densite_A/20}} +Edges/=20 +Coherence={2-{$Coherence/20}} +Threshold={18+{$Threshold/20}} +Minimal_Area=-100 +Repetition={55-{$Repetition/10}} +Anti_Aliasing=2 +elif $Examples==6 +Radius={0.975+{$Radius/20}} +Densite_A={2.3+{$Densite_A/20}} +Edges/=20 +Coherence={10-{$Coherence/20}} +Threshold={28+{$Threshold/20}} +Minimal_Area/=20 +Repetition={55-{$Repetition/10}} +Anti_Aliasing=1 +elif $Examples==7 +Radius={0.475+{$Radius/20}} +Densite_A={3.8+{$Densite_A/20}} +Edges/=20 +Coherence={10-{$Coherence/20}} +Threshold={38+{$Threshold/20}} +Minimal_Area/=20 +Repetition={-5+{$Repetition/10}} +Anti_Aliasing=1 +fi +f={arg(1+$Anti_Aliasing,1,1.5,2,3)} +r={$f*$Radius} +nm=${-gui_layer_name} +pos=${-gui_layer_pos} +l[0] +split_opacity +l[0] +wh={w},{h} +norm +if $Anti_Aliasing +r {100*$f}%,{100*$f}%,1,1,3 +fi +l[0] +repeat $Repetition +b $r +unsharp $r,{$Densite_A} +c 0,255 +done +smooth 100,0.1,1,{$f*$Edges},{$f*$Coherence} +->= {100-$Threshold}% +done +if $Minimal_Area<0 +area_fg 0,0 +gt {$f*$Minimal_Area*$Minimal_Area} +elif $Minimal_Area>0 +-== 0 +area_fg 0,0 +gt {$f*$Minimal_Area*$Minimal_Area} +-== 0 +fi +* 255 +if $Anti_Aliasing +r $wh,1,1,2 +fi +done +a c +done +samj_Grid_BW_Color : +Index=0 +repeat $! +Index-=1 +samj_Base_Grid_BW_Color[$Index] $1,$2,$3,$4,$5,$6,$7,$8,$9,$10 +done +samj_Base_Grid_BW_Color : +n[-1] 0,255 +if $9==1 ++Je_passe_l_hiver_en_Floride[-1] +if $3==4 Larg={w} Haut={h} resize[-2] {$Larg/$4},{$Haut/$5} resize[-2] $Larg,$Haut fi +fi +blur[-1] $1 +to_rgba[-1] +if $3==4 Larg={w} Haut={h} resize[-1] {$Larg/$4},{$Haut/$5} resize[-1] $Larg,$Haut fi +map[-1] hocuspocus,1 +smooth[-1] $2 +split[-1] c +rm[-1--11] +c[-1] 0,$6 +if $7==1 negate[-1] fi +autoindex[-1] $8 +if $3==1 +imagegrid[-1] $4,$5 +elif $3==2 +imagegrid_triangular[-1] {$4+2},{$5+2},0,1,0,0,0,255 +elif $3==3 +imagegrid_hexagonal[-1] {round(w/{6+$4})},0.1,1 +elif $3==5 +imagegrid_triangular[-1] {$4+2},{$5+2},0,0,0,0,0,255 +elif $3==6 +imagegrid_hexagonal[-1] {round(w/{6+$4})},0,1 +fi +n[-1] 0,255 +if $9==1 +autoindex[-2] {$10} +if $3==1 +imagegrid[-2] $4,$5 +elif $3==2 +imagegrid_triangular[-2] {$4+2},{$5+2},0,1,0,0,0,255 +elif $3==3 +imagegrid_hexagonal[-2] {round(w/{6+$4})},0.1,1 +elif $3==5 +imagegrid_triangular[-2] {$4+2},{$5+2},0,0,0,0,0,255 +elif $3==6 +imagegrid_hexagonal[-2] {round(w/{6+$4})},0,1 +fi +rv[-1,-2] +samj_blend_20220419[-1,-2] grainmerge +fi +XY_hardsketchbw_samj : +XY=$1 +Amplitude=$2 +Density=$3 +Smoothness=$4 +Opacity=$5 +Edge=$6 +Fast_approximation=$7 +Negative=$8 +Calques=$9 +Octave_Sharpening=$10 +R_Transparence=$11 +V_Transparence=$12 +B_Transparence=$13 +A_Transparence=$14 +Remplir=$15 +Largeur={w} +Hauteur={h} +to_rgba[-1] ++Je_passe_l_hiver_en_Floride[-1] +if $Calques==1 +Je_passe_l_hiver_en_Floride[-1] fi +if $Largeur>$Hauteur +Grande_dimension={$Largeur*1.5} +else +Grande_dimension={$Hauteur*1.5} +fi +Origine_X={round({{{$Grande_dimension}-$Largeur}/2})} +Origine_Y={round({{{$Grande_dimension}-$Hauteur}/2})} +expand_x[-1] $Origine_X,2 +expand_y[-1] $Origine_Y,2 +twirl_ancien_euclidean2polar_ancien_polar2euclidean[-1] $XY,0.5,0.5,1 +fx_hardsketchbw[-1] $Amplitude,$Density,$Smoothness,$Opacity,$Edge,$Fast_approximation,$Negative +twirl_ancien_euclidean2polar_ancien_polar2euclidean[-1] -$XY,0.5,0.5,1 +expand_x[-2] $Origine_X,2 +expand_y[-2] $Origine_Y,2 +twirl_ancien_euclidean2polar_ancien_polar2euclidean[-2] -$XY,0.5,0.5,1 +fx_hardsketchbw[-2] $Amplitude,$Density,$Smoothness,$Opacity,$Edge,$Fast_approximation,$Negative +twirl_ancien_euclidean2polar_ancien_polar2euclidean[-2] $XY,0.5,0.5,1 +samj_blend_20220419[-1,-2] average,1,0 +crop[-1] $Origine_X,$Origine_Y,{$Largeur+$Origine_X-1},{$Hauteur+$Origine_Y-1} +if $Octave_Sharpening==1 +fx_unsharp_octave 4,5,3,0,0,0,24,0 +fi +if $Calques==1 +fx_hardsketchbw[-2] $Amplitude,$Density,$Smoothness,$Opacity,$Edge,$Fast_approximation,$Negative +rv[-1,-2] +fi +if $Remplir==1 +$Largeur,$Hauteur,1,4 +fill_color[-1] $R_Transparence,$V_Transparence,$B_Transparence,$A_Transparence +if $Calques==1 +rv[-1,-2] +fi +samj_blend_20220419[-1,-2] screen,1,1 +if $Calques==1 +rv[-1,-2] +fi +fi +samj_rien_colors : +Je_passe_l_hiver_en_Floride[-1] +samj_Masques_Noir_Et_Blanc : +to_graya +blur $1 +replace_color $2%,0,255,255,0,0 +replace_color {100-$2}%,0,0,255,0,255 ++negate +samj_Masques_Noir_Et_Blanc_Preview : +samj_Masques_Noir_Et_Blanc $1,$2 +blend alpha +samj_NB_EdgesO_Engrave : ++Je_passe_l_hiver_en_Floride[-1] +pow[-2] $12 +fx_edge_offsets[-2] $1,$2,$3,$4,0 +fx_engrave[-1,-2] $5,$6,$7,$8,$9,$10,$11,0,10,1,0,0,0,1 +samj_blend_20220419[-1,-2] multiply,1,1 +samj_scintillements : +Exemple=$1 +dog_sigma1=$2 +dog_sigma2={$3/10} +dog_Iterations=$4 +Variation_noise=$5 +Type_noise=$6 +Amplitude_circle=$7 +AmplitudeA=$8 +AmplitudeB=$9 +Angle=$10 +Amplitude_ln=$11 +Radius_ln=$12 +Neighborhood_smoothness_ln=$13 +Average_smoothness_ln=$14 +Constrain_values_ln=$15 +Channel_ln=$16 +Inverser_couleur=$17 +Degradation_pow={1+{$18/100}} +to_rgb[-1] +if $Exemple==1 +Variation_noise=70 +Amplitude_circle=3 +Angle=0 +elif $Exemple==2 +Variation_noise=70 +Amplitude_circle=3 +Angle=40 +elif $Exemple==3 +Variation_noise=70 +Amplitude_circle=3 +Angle=80 +elif $Exemple==4 +fill_color[-1] 0,0,0 +noise[-1] $Variation_noise,$Type_noise +norm[-1] +elif $Exemple==5 +Variation_noise=2 +fill_color[-1] 0,0,0 +noise[-1] $Variation_noise,$Type_noise +norm[-1] +elif $Exemple==6 +fill_color[-1] 0,0,0 +noise[-1] $Variation_noise,$Type_noise +norm[-1] +Amplitude_circle+=25 +fi +repeat $dog_Iterations +dog[-1] $dog_sigma1%,$dog_sigma2% +done +{w},{h},1 +noise[-1] $Variation_noise,$Type_noise +r[-1] [-2] +n[-1] 0,1 +*[-1,-2] +_circle_1610 $Amplitude_circle +dilate[-2] [-1] +rm[-1] ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +blur_linear[-1] $AmplitudeA,{$AmplitudeB*$AmplitudeA/100},$Angle,1 +blur_linear[-2] $AmplitudeA,{$AmplitudeB*$AmplitudeA/100},{$Angle+120},1 +blur_linear[-3] $AmplitudeA,{$AmplitudeB*$AmplitudeA/100},{$Angle+240},1 +n[-1,-2,-3] 0,255 +fx_blend_average_all[-1,-2,-3] 2 +fx_normalize_local[-1] $Amplitude_ln,$Radius_ln,$Neighborhood_smoothness_ln,$Average_smoothness_ln,$Constrain_values_ln,$Channel_ln +if $Degradation_pow!=1 +pow[-1] $Degradation_pow +n[-1] 0,255 +fi +if $Inverser_couleur==1 negate[-1] fi +_circle_1610 : +if $1%2==0 +i 2,2 +else +i 1 +fi ++[-1] 1 +r[-1] $1,$1,1,1,0,0,0.5,0.5 +distance[-1] 1 +n[-1] 0,1 +sqrt[-1] +c[-1] 0.85,0.86 +*[-1] -1 +n[-1] 0,1 +samj_64_Couleurs_Max: +to_rgb +blur $3 +sharpen $4 +if $6==0 +index=0 +srand $1 +{$2*16},{$2*16},1,3 +fx_array_color[-1] $2,1,1 +elif $6==1 ++colormap $2 +elif $6==2 +16,16,1,3 +fill_color[-1] 0,0,0 +16,16,1,3 +fill_color[-1] 255,255,255 +append_tiles[-1,-2] 2,1 +elif $6==3 +16,16,1,3 +fill_color[-1] 255,255,255 +16,16,1,3 +fill_color[-1] 0,0,0 +append_tiles[-1,-2] 2,1 +elif $6==4 +{$2*16},{$2*16},1,1,4 +fx_linear_gradient[-1] $7,$8,$9,255,$10,$11,$12,255,0,0,0,100,2 +elif $6==5 +{$2*16},{$2*16},1,1,4 +fx_linear_gradient[-1] $7,$8,$9,255,$10,$11,$12,255,1,0,0,100,2 +fi +resize[-1] 64,1 +if $5==1 to_gray[0] fi +n[0] 0,255 +to_rgb +map_clut[0] [-1] +rm[-1] +autoindex[0] $2 +n 0,255 +samj_test_9_colors : +if $28>0 blur $28 fi +if $29>0 sharpen $29 fi +samj9colorsV2 $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27 +samj9colorsV2: +skip ${1=0},${2=0},${3=0},${4=0},${5=128},${6=0},${7=0},${8=255},${9=0},${10=173},${11=245},${12=47},${13=255},${14=255},${15=0},${16=255},${17=218},${18=0},${19=255},${20=165},${21=0},${22=255},${23=0},${24=0},${25=255},${26=255},${27=255} +to_gray +to_rgba +index=0 +repeat 16 +replace_color 1,0,$index,$index,$index,255,$1,$2,$3,255 +index+=1 +done +repeat 32 +replace_color 1,0,$index,$index,$index,255,$4,$5,$6,255 +index+=1 +done +repeat 32 +replace_color 1,0,$index,$index,$index,255,$7,$8,$9,255 +index+=1 +done +repeat 32 +replace_color 1,0,$index,$index,$index,255,$10,$11,$12,255 +index+=1 +done +repeat 32 +replace_color 1,0,$index,$index,$index,255,$13,$14,$15,255 +index+=1 +done +repeat 32 +replace_color 1,0,$index,$index,$index,255,$16,$17,$18,255 +index+=1 +done +repeat 32 +replace_color 1,0,$index,$index,$index,255,$19,$20,$21,255 +index+=1 +done +repeat 32 +replace_color 1,0,$index,$index,$index,255,$22,$23,$24,255 +index+=1 +done +repeat 16 +replace_color 1,0,$index,$index,$index,255,$25,$26,$27,255 +index+=1 +done +samj_At06A_2017_VarCouleurs : +to_rgba[-1] +pow[-1] $1 +n[-1] 0,{{iM}-{im}} +c[-1] {{iM}/100*$2},{iM} +n[-1] 0,{iM} +c[-1] 0,{{iM}/100*$3} +n[-1] 0,255 +if $4==1 +to_graya[-1] +elif $4==2 ++Je_passe_l_hiver_en_Floride[-1] +fx_decompose_channels[-1] 7,0,1,0 +remove[-1,-2] +samj_blend_20220419[-1,-2] alpha +fi +if $5==1 n[-1] 0,255 fi +to_rgba[-1] +samj_Color_Palettes : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Angle_inclinaison=$3 +Rayon_Cercle_Centre={round({w*$4/{100}})} +Nb_Circles_Surrounding=$5 +Angle_Decalage=$6 +Variation_Increment_Anneaux=$7 +R_val=$8 +G_val=$9 +B_val=$10 +Remplir_Couleur_Base=$11 +Matrices_RGB=$12 +XYZ_Tristimulus=$13 +Choix=0 +Outline_Reference_Color=$14 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_Anneaux={2*4} +R_val_comp={255-$R_val} +G_val_comp={255-$G_val} +B_val_comp={255-$B_val} +L_origine=${"samj_RGB_to_LCH_or_Lab[] 1,"{/$R_val}","{/$G_val}","{/$B_val}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""} +C_origine=${"samj_RGB_to_LCH_or_Lab[] 2,"{/$R_val}","{/$G_val}","{/$B_val}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""} +H_origine=${"samj_RGB_to_LCH_or_Lab[] 3,"{/$R_val}","{/$G_val}","{/$B_val}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""} +L_origine25={$L_origine+25} +if $L_origine25>100 L_origine25-=100 fi +L_origine50={$L_origine+50} +if $L_origine50>100 L_origine50-=100 fi +L_origine75={$L_origine+75} +if $L_origine75>100 L_origine75-=100 fi +L_origine_comp=${"samj_RGB_to_LCH_or_Lab[] 1,"{/$R_val_comp}","{/$G_val_comp}","{/$B_val_comp}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""} +C_origine_comp=${"samj_RGB_to_LCH_or_Lab[] 2,"{/$R_val_comp}","{/$G_val_comp}","{/$B_val_comp}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""} +H_origine_comp=${"samj_RGB_to_LCH_or_Lab[] 3,"{/$R_val_comp}","{/$G_val_comp}","{/$B_val_comp}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""} +L_origine_comp25={$L_origine_comp+25} +if $L_origine_comp25>100 L_origine_comp25-=100 fi +L_origine_comp50={$L_origine_comp+50} +if $L_origine_comp50>100 L_origine_comp50-=100 fi +L_origine_comp75={$L_origine_comp+75} +if $L_origine_comp75>100 L_origine_comp75-=100 fi +to_rgba[-1] +if $Remplir_Couleur_Base==1 fill_color[-1] $R_val,$G_val,$B_val,255 fi +Angle_Theta={pi/$Nb_Circles_Surrounding} +if $Rayon_Cercle_Centre<10 +Rayon_Cercle_Centre=10 +fi +Rayon_Cercle_Exterieur={$Rayon_Cercle_Centre*((1+(sin($Angle_Theta))))/(1-(sin($Angle_Theta)))} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre+$Rayon_Cercles_Ext} +Rayon_Tang={{{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}}^0.5} +Nb_boucles=0 +X_ext=0 +Y_ext=0 +Angle=0 +Angle_Decalage_En_Cours=0 +Nb_boucles_anneaux=0 +Rayon_Cercle_Centre_En_Cours=0 +R_en_cours=0 +G_en_cours=0 +B_en_cours=0 +A_en_cours=255 +L_val=0 +L_val_comp=0 +repeat $Nb_Anneaux +Nb_boucles=0 +Angle_Decalage_En_Cours={360/$Nb_Circles_Surrounding*$Angle_Decalage*$Nb_boucles_anneaux} +if $Nb_boucles_anneaux==0 +Rayon_Cercle_Centre_En_Cours={$Rayon_Cercle_Centre} +else +Rayon_Cercle_Centre_En_Cours={$Rayon_Tang+($Rayon_Cercles_Ext*(0.865+$Variation_Increment_Anneaux/100))} +fi +Rayon_Cercle_Exterieur=$Rayon_Cercle_Centre_En_Cours*{{1+{sin($Angle_Theta)}}}/{1-{sin($Angle_Theta)}} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre_En_Cours}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre_En_Cours+$Rayon_Cercles_Ext} +Rayon_Tang={{{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}}^0.5} +repeat $Nb_Circles_Surrounding +Erreur_Couleur=0 +Angle={$Nb_boucles*(360/$Nb_Circles_Surrounding)} +X_ext={$X+($Rayon_Centres_C_Ext*(cos((pi/180*($Angle+$Angle_inclinaison+$Angle_Decalage_En_Cours)))))} +Y_ext={$Y+($Rayon_Centres_C_Ext*(sin((pi/180*($Angle+$Angle_inclinaison+$Angle_Decalage_En_Cours)))))} +if {$Nb_boucles_anneaux%2}==0 +H_val={$H_origine+$Angle} +if $Nb_boucles_anneaux==0 +L_val=$L_origine75 +elif $Nb_boucles_anneaux==2 +L_val=$L_origine50 +elif $Nb_boucles_anneaux==4 +L_val=$L_origine25 +elif $Nb_boucles_anneaux==6 +L_val=$L_origine +fi +R_en_cours={int(${"samj_LCH_or_Lab_to_RGB[] 1,"{/$L_val}","{/$C_origine}","{/$H_val}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +G_en_cours={int(${"samj_LCH_or_Lab_to_RGB[] 2,"{/$L_val}","{/$C_origine}","{/$H_val}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +B_en_cours={int(${"samj_LCH_or_Lab_to_RGB[] 3,"{/$L_val}","{/$C_origine}","{/$H_val}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +else +H_val_comp={$H_origine_comp+$Angle} +if $Nb_boucles_anneaux==1 +L_val_comp=$L_origine_comp75 +elif $Nb_boucles_anneaux==3 +L_val_comp=$L_origine_comp50 +elif $Nb_boucles_anneaux==5 +L_val_comp=$L_origine_comp25 +elif $Nb_boucles_anneaux==7 +L_val_comp=$L_origine_comp +fi +R_en_cours={int(${"samj_LCH_or_Lab_to_RGB[] 1,"{/$L_val_comp}","{/$C_origine_comp}","{/$H_val_comp}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +G_en_cours={int(${"samj_LCH_or_Lab_to_RGB[] 2,"{/$L_val_comp}","{/$C_origine_comp}","{/$H_val_comp}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +B_en_cours={int(${"samj_LCH_or_Lab_to_RGB[] 3,"{/$L_val_comp}","{/$C_origine_comp}","{/$H_val_comp}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +fi +if $R_en_cours<0 Erreur_Couleur=1 fi +if $R_en_cours>255 Erreur_Couleur=1 fi +if $G_en_cours<0 Erreur_Couleur=1 fi +if $G_en_cours>255 Erreur_Couleur=1 fi +if $B_en_cours<0 Erreur_Couleur=1 fi +if $B_en_cours>255 Erreur_Couleur=1 fi +if $Erreur_Couleur==0 circle[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext,1,$R_en_cours,$G_en_cours,$B_en_cours,$A_en_cours fi +if $Nb_boucles==0&&$Nb_boucles_anneaux==6&&$Outline_Reference_Color==1 +circle[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext,1,0xFFFFFFFF,0,0,0,255 +circle[-1] $X_ext,$Y_ext,{$Rayon_Cercles_Ext/2},1,$R_val,$G_val,$B_val,$A_en_cours +circle[-1] $X_ext,$Y_ext,{$Rayon_Cercles_Ext/2},1,0xFFFFFFFF,255,255,255,255 +fi +Nb_boucles+=1 +done +Nb_boucles_anneaux+=1 +done +samj_rien_contours : +Je_passe_l_hiver_en_Floride[-1] +Couleurs_Metalliques : +Transparence=$1 +Rendu=$2 +Amplitude=$3 +Noise_type=$4 +Noise_Channel=7 +Value_range=$5 +Double_effet=$6 +Local_normalization_Amplitude=$7 +Radius=$8 +Neighborhood_smoothness=$9 +Average_smoothness=$10 +Constrain_values=$11 +Local_normalization_Channel=$12 +boost_fade_Amplitude=$13 +Utiliser_Photocomix_Options=$14 +Pencilbw_Size=$15 +Pencilbw_Amplitude=$16 +Blend_soft_light_Opacity=$17 +Blend_soft_light_Revert_layers=$18 +foreach { +if $Rendu==0 +Rendu_local_orientation_channels=11 +elif $Rendu==1 +Rendu_local_orientation_channels=16 +elif $Rendu==2 +Rendu_local_orientation_channels=25 +elif $Rendu==3 +Rendu_local_orientation_channels=27 +elif $Rendu==4 +Rendu_local_orientation_channels=7 +elif $Rendu==5 +Rendu_local_orientation_channels=2 +elif $Rendu==6 +Rendu_local_orientation_channels=2 +fi +if $Transparence==1 +remove_opacity[-1] +fi +if $Utiliser_Photocomix_Options==1 ++pencilbw[-1] $Pencilbw_Size,$Pencilbw_Amplitude +if $Double_effet==1 +fx_normalize_local[-2] $Local_normalization_Amplitude,$Radius,$Neighborhood_smoothness,$Average_smoothness,$Constrain_values,$Local_normalization_Channel +fi +fx_noise[-2] $Amplitude,$Noise_type,$Noise_Channel,$Value_range +fx_local_orientation[-2] 0,0,100,0,$Rendu_local_orientation_channels +fx_normalize_local[-2] $Local_normalization_Amplitude,$Radius,$Neighborhood_smoothness,$Average_smoothness,$Constrain_values,$Local_normalization_Channel +if $boost_fade_Amplitude>0 +fx_boost_fade[-2] $boost_fade_Amplitude +fi +samj_blend_20220419[-2,-1] softlight,$Blend_soft_light_Opacity,$Blend_soft_light_Revert_layers +else +if $Double_effet==1 +fx_normalize_local[-1] $Local_normalization_Amplitude,$Radius,$Neighborhood_smoothness,$Average_smoothness,$Constrain_values,$Local_normalization_Channel +fi +fx_noise[-1] $Amplitude,$Noise_type,$Noise_Channel,$Value_range +fx_local_orientation[-1] 0,0,100,0,$Rendu_local_orientation_channels +fx_normalize_local[-1] $Local_normalization_Amplitude,$Radius,$Neighborhood_smoothness,$Average_smoothness,$Constrain_values,$Local_normalization_Channel +if $boost_fade_Amplitude>0 +fx_boost_fade[-1] $boost_fade_Amplitude +fi +fi +} +Couleurs_Metalliques_preview : +gui_split_preview "Couleurs_Metalliques ${1--2}",$-1 +samj_Dorure: +if $12==1 +Largeur={w} +Hauteur={h} +if w>h +resize 800,{h/w*800} +else +resize {w/h*800},800 +fi +fi +if $10==1 negate fi +samj_Fond_Or $13,$14,$15,$16,$17,$18 +fx_light_relief $1,$2,$3,$4,$5,$6,$7,$8,$9,0,0 +if $11>100 smooth 100,0.7,0.3,0.6 smooth {$11-100},0.7,0.3,0.6 else smooth $11,0.7,0.3,0.6 fi +if $12==1 resize $Largeur,$Hauteur smooth 100,0.7,0.3,0.6 sharpen 50 fi +samj_Fond_Or: +skip ${1=0},${2=0},${3=45},${4=64},${5=255},${6=0} +blur $1 +sharpen $2 +n 0,255 ++fx_linear_gradient 255,208,170,255,220,92,1,255,0,$3,0,100,0 +autoindex[-1] $4 +autoindex[0] $5 +if $6==1 to_gray[0] fi +resize[-1] 64,1 +to_rgb +n 0,255 +negate[0] +map_clut[0] [-1] +rm[-1] +samj_Remplir_Fill_Flood : +foreach { +to_rgba +flood $1%,$2%,0,$7,0,1,$3,$4,$5,$6 +} +samj_test_shapeprevalent : +foreach { ++blur. $1 +quantize. $2,1,1 +quantize_area. $3 +n. 0,255 +blend shapeprevalent +} +samj_Topographie_Eliminate_Contour_Lines : +foreach { +to_rgba ++dilate_circ $1 +erode_circ. $1 +replace_color. $5%,0,$2,$3,$4,255,0,0,0,0 +replace_color. $9%,0,255,255,255,255,$6,$7,$8,255 +replace_color. 0,0,0,0,0,0,$2,$3,$4,255 +replace_color.. $13%,0,$10,$11,$12,255,0,0,0,0 +replace_color.. $17%,0,$14,$15,$16,255,0,0,0,0 +replace_color.. $21%,0,$18,$19,$20,255,0,0,0,0 +replace_color.. $25%,0,$22,$23,$24,255,0,0,0,0 +rv +blend alpha +if $26 +dilate_circ 2 +erode_circ 2 +fi +} +samj_Topographie_Eliminate_Contour_Lines_preview : +gui_split_preview "samj_Topographie_Eliminate_Contour_Lines $*",$-1 +samj_Valeur_Moyenne_LCH : +Echantillon=$1 +Matrices_RGB=$2 +XYZ_Tristimulus=$3 +filename="$4//$5" +Choix=0 ++resize[-1] $Echantillon,{h/w*$Echantillon} +quantize[-1] 1,1,0 +Val_R={i0} +Val_V={i1} +Val_B={i2} +Valeur_L={round(${"samj_RGB_to_LCH_or_Lab[] 1,"$Val_R","$Val_V","$Val_B","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +Valeur_C={round(${"samj_RGB_to_LCH_or_Lab[] 2,"$Val_R","$Val_V","$Val_B","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +Valeur_H={round(${"samj_RGB_to_LCH_or_Lab[] 3,"$Val_R","$Val_V","$Val_B","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +rm[-1] +200,200,1,4 +fill_color[-1] $Val_R,$Val_V,$Val_B,255 +echo_file $filename,L{$Valeur_L}C{$Valeur_C}H{$Valeur_H} +text_outline[-1] R{round($Val_R)}V{round($Val_V)}B{round($Val_B)},2,2,23,2,1,255 +text_outline[-1] L{$Valeur_L}C{$Valeur_C}H{$Valeur_H},2,22,23,2,1,255 +rv[-2,-1] +samj_Valeur_Moyenne_LCH_Preview : +Echantillon=$1 +Matrices_RGB=$2 +XYZ_Tristimulus=$3 +Choix=0 ++resize[-1] $Echantillon,{h/w*$Echantillon} +quantize[-1] 1,1,0 +Val_R={i0} +Val_V={i1} +Val_B={i2} +Valeur_L={round(${"samj_RGB_to_LCH_or_Lab[] 1,"$Val_R","$Val_V","$Val_B","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +Valeur_C={round(${"samj_RGB_to_LCH_or_Lab[] 2,"$Val_R","$Val_V","$Val_B","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +Valeur_H={round(${"samj_RGB_to_LCH_or_Lab[] 3,"$Val_R","$Val_V","$Val_B","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +to_rgba[-1,-2] +samj_blend_20220419[-2,-1] alpha,1,1 +text_outline[-1] "Attention Couleur Selon Apercu",2,22,23,2,1,255 +samj_Valeur_Moyenne_LCH_CSV : +Echantillon=$1 +Matrices_RGB=$2 +XYZ_Tristimulus=$3 +filename="$4//$5" +Img=$6 +Choix=0 ++resize[-1] $Echantillon,{h/w*$Echantillon} +quantize[-1] 1,1,0 +Val_R={i0} +Val_V={i1} +Val_B={i2} +Valeur_L={round(${"samj_RGB_to_LCH_or_Lab[] 1,"$Val_R","$Val_V","$Val_B","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +Valeur_C={round(${"samj_RGB_to_LCH_or_Lab[] 2,"$Val_R","$Val_V","$Val_B","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +Valeur_H={round(${"samj_RGB_to_LCH_or_Lab[] 3,"$Val_R","$Val_V","$Val_B","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +echo_file $filename,$Img,{$Valeur_L},{$Valeur_C},{$Valeur_H} +rm[-1] +samj_Variations_RVB : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Angle_inclinaison=$3 +Rayon_Cercle_Centre={round({w*$4/{100}})} +Angle_Decalage=$5 +Variation_Increment_Anneaux=$6 +R_val=$7 +G_val=$8 +B_val=$9 +Remplir_Couleur_Base=$10 +Outline_Reference_Color=$11 +Type_Variation=$12 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_Circles_Surrounding=32 +Nb_Anneaux=8 +to_rgba[-1] +if $Remplir_Couleur_Base==1 fill_color[-1] $R_val,$G_val,$B_val,255 fi +Angle_Theta={pi/$Nb_Circles_Surrounding} +if $Rayon_Cercle_Centre<10 +Rayon_Cercle_Centre=10 +fi +Rayon_Cercle_Exterieur={$Rayon_Cercle_Centre*((1+(sin($Angle_Theta))))/(1-(sin($Angle_Theta)))} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre+$Rayon_Cercles_Ext} +Rayon_Tang={{{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}}^0.5} +Nb_boucles=0 +X_ext=0 +Y_ext=0 +Angle=0 +Angle_Decalage_En_Cours=0 +Nb_boucles_anneaux=0 +Rayon_Cercle_Centre_En_Cours=0 +R_en_cours=$R_val +G_en_cours=$G_val +B_en_cours=$B_val +A_en_cours=255 +Variation_RVB=0 +repeat $Nb_Anneaux +Nb_boucles=0 +Angle_Decalage_En_Cours={360/$Nb_Circles_Surrounding*$Angle_Decalage*$Nb_boucles_anneaux} +if $Nb_boucles_anneaux==0 +Rayon_Cercle_Centre_En_Cours={$Rayon_Cercle_Centre} +else +Rayon_Cercle_Centre_En_Cours={$Rayon_Tang+($Rayon_Cercles_Ext*(0.865+$Variation_Increment_Anneaux/100))} +fi +Rayon_Cercle_Exterieur=$Rayon_Cercle_Centre_En_Cours*{{1+{sin($Angle_Theta)}}}/{1-{sin($Angle_Theta)}} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre_En_Cours}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre_En_Cours+$Rayon_Cercles_Ext} +Rayon_Tang={{{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}}^0.5} +repeat $Nb_Circles_Surrounding +Angle={$Nb_boucles*(360/$Nb_Circles_Surrounding)} +X_ext={$X+($Rayon_Centres_C_Ext*(cos((pi/180*($Angle+$Angle_inclinaison+$Angle_Decalage_En_Cours)))))} +Y_ext={$Y+($Rayon_Centres_C_Ext*(sin((pi/180*($Angle+$Angle_inclinaison+$Angle_Decalage_En_Cours)))))} +if $Type_Variation==0 +R_en_cours={abs($R_val-$Variation_RVB)} +G_en_cours={abs($G_val-$Variation_RVB)} +B_en_cours={abs($B_val-$Variation_RVB)} +elif $Type_Variation==1 +R_en_cours={abs($R_val-$Variation_RVB)} +elif $Type_Variation==2 +B_en_cours={abs($G_val-$Variation_RVB)} +elif $Type_Variation==3 +B_en_cours={abs($B_val-$Variation_RVB)} +elif $Type_Variation==4 +R_en_cours={abs($R_val-$Variation_RVB)} +G_en_cours={abs($G_val-$Variation_RVB)} +elif $Type_Variation==5 +R_en_cours={abs($R_val-$Variation_RVB)} +B_en_cours={abs($B_val-$Variation_RVB)} +elif $Type_Variation==6 +G_en_cours={abs($G_val-$Variation_RVB)} +B_en_cours={abs($B_val-$Variation_RVB)} +elif $Type_Variation==7 +R_en_cours={$R_val-$Variation_RVB} +G_en_cours={$G_val-$Variation_RVB} +B_en_cours={$B_val-$Variation_RVB} +elif $Type_Variation==8 +R_en_cours={$R_val-$Variation_RVB} +elif $Type_Variation==9 +B_en_cours={$G_val-$Variation_RVB} +elif $Type_Variation==10 +B_en_cours={$B_val-$Variation_RVB} +elif $Type_Variation==11 +R_en_cours={$R_val-$Variation_RVB} +G_en_cours={$G_val-$Variation_RVB} +elif $Type_Variation==12 +R_en_cours={$R_val-$Variation_RVB} +B_en_cours={$B_val-$Variation_RVB} +elif $Type_Variation==13 +G_en_cours={$G_val-$Variation_RVB} +B_en_cours={$B_val-$Variation_RVB} +elif $Type_Variation==14 +R_en_cours={$R_val+$Variation_RVB} +G_en_cours={$G_val+$Variation_RVB} +B_en_cours={$B_val+$Variation_RVB} +elif $Type_Variation==15 +R_en_cours={$R_val+$Variation_RVB} +elif $Type_Variation==16 +B_en_cours={$G_val+$Variation_RVB} +elif $Type_Variation==17 +B_en_cours={$B_val+$Variation_RVB} +elif $Type_Variation==18 +R_en_cours={$R_val+$Variation_RVB} +G_en_cours={$G_val+$Variation_RVB} +elif $Type_Variation==19 +R_en_cours={$R_val+$Variation_RVB} +B_en_cours={$B_val+$Variation_RVB} +elif $Type_Variation==20 +G_en_cours={$G_val+$Variation_RVB} +B_en_cours={$B_val+$Variation_RVB} +fi +if $R_en_cours<0 R_en_cours=0 fi +if $R_en_cours>255 R_en_cours=255 fi +if $G_en_cours<0 G_en_cours=0 fi +if $G_en_cours>255 G_en_cours=255 fi +if $B_en_cours<0 B_en_cours=0 fi +if $B_en_cours>255 B_en_cours=255 fi +circle[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext,1,$R_en_cours,$G_en_cours,$B_en_cours,$A_en_cours +if $Nb_boucles==0&&$Nb_boucles_anneaux==0&&$Outline_Reference_Color==1 +circle[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext,1,0xFFFFFFFF,0,0,0,255 +circle[-1] $X_ext,$Y_ext,{$Rayon_Cercles_Ext/2},1,0xFFFFFFFF,255,255,255,255 +fi +Nb_boucles+=1 +Variation_RVB+=1 +done +Nb_boucles_anneaux+=1 +done +samj_Carte_De_Repoussage : +if $3>0 blur $3 fi +if $1==0 +(0,1,-1;0,1,-1;0,1,-1) +elif $1==1 +(-1,-1,-1;1,1,1;0,0,0) +elif $1==2 +(-1,1,0;-1,1,0;-1,1,0) +elif $1==3 +(0,0,0;1,1,1;-1,-1,-1) +elif $1==4 +(0,1,0;0,0,0;0,-1,0) +elif $1==5 +(0,0,0;1,0,-1;0,0,0) +elif $1==6 +(0,-1,0;0,0,0;0,1,0) +elif $1==7 +(0,0,0;-1,0,1;0,0,0) +elif $1==8 +(1,0,0;0,0,0;0,0,-1) +elif $1==9 +(0,0,-1;0,0,0;1,0,0) +elif $1==10 +(-1,0,0;0,0,0;0,0,1) +elif $1==11 +(0,0,1;0,0,0;-1,0,0) +elif $1==12 +(2,0,0;0,-1,0;0,0,-1) +elif $1==13 +(0,0,-1;0,-1,0;2,0,0) +elif $1==14 +(-1,0,0;0,-1,0;0,0,2) +elif $1==15 +(0,0,2;0,-1,0;-1,0,0) +elif $1==16 +(1,1,-1;1,3,-1;1,-1,-1) +elif $1==17 +(-1,-1,-1;1,3,-1;1,1,1) +elif $1==18 +(-1,-1,1;-1,3,1;-1,1,1) +elif $1==19 +(1,1,1;-1,3,1;-1,-1,-1) +elif $1==20 +(-2,-1,0;-1,1,1;0,1,2) +elif $1==21 +(0,1,2;-1,1,1;-2,-1,0) +elif $1==22 +(2,1,0;1,1,-1;0,-1,-2) +elif $1==23 +(0,-1,-2;1,1,-1;2,1,0) +elif $1==24 +(1,0,0,0,0;0,1,0,0,0;0,0,0,0,0;0,0,0,-1,0;0,0,0,0,-1) +elif $1==25 +(0,0,0,0,1;0,0,0,1,0;0,0,0,0,0;0,-1,0,0,0;-1,0,0,0,0) +elif $1==26 +(-1,0,0,0,0;0,-1,0,0,0;0,0,0,0,0;0,0,0,1,0;0,0,0,0,1) +elif $1==27 +(0,0,0,0,-1;0,0,0,-1,0;0,0,0,0,0;0,1,0,0,0;1,0,0,0,0) +elif $1==28 +(0,1,0,0,0;0,0,1,0,0;0,0,0,0,0;0,0,-1,0,0;0,0,0,-1,0) +elif $1==29 +(0,0,0,0,0;0,0,0,0,1;0,-1,0,1,0;-1,0,0,0,0;0,0,0,0,0) +elif $1==30 +(0,1,0,0,0;0,0,1,0,0;0,0,0,0,0;0,0,-1,0,0;0,0,0,-1,0) +elif $1==31 +(0,0,0,0,0;0,0,0,0,1;0,-1,0,1,0;-1,0,0,0,0;0,0,0,0,0) +elif $1==32 +(1,0,0,0,0,0,0;0,1,0,0,0,0,0;0,0,1,0,0,0,0;0,0,0,0,0,0,0;0,0,0,0,-1,0,0;0,0,0,0,0,-1,0;0,0,0,0,0,0,-1) +elif $1==33 +(0,0,0,0,0,0,1;0,0,0,0,0,1,0;0,0,0,0,1,0,0;0,0,0,0,0,0,0;0,0,-1,0,0,0,0;0,-1,0,0,0,0,0;-1,0,0,0,0,0,0) +elif $1==34 +(-1,0,0,0,0,0,0;0,-1,0,0,0,0,0;0,0,-1,0,0,0,0;0,0,0,0,0,0,0;0,0,0,0,1,0,0;0,0,0,0,0,1,0;0,0,0,0,0,0,1) +elif $1==35 +(0,0,0,0,0,0,-1;0,0,0,0,0,-1,0;0,0,0,0,-1,0,0;0,0,0,0,0,0,0;0,0,1,0,0,0,0;0,1,0,0,0,0,0;1,0,0,0,0,0,0) +elif $1==36 +(-1,0,0;0,1,0;0,0,0) +elif $1==37 +(0,0,0;0,1,0;-1,0,0) +elif $1==38 +(0,0,0;0,1,0;0,0,-1) +elif $1==39 +(0,0,-1;0,1,0;0,0,0) +elif $1==40 +(-1,-1,-1,-1,0;-1,-1,-1,0,1;-1,-1,0,1,1;-1,0,1,1,1;0,1,1,1,1) +elif $1==41 +(0,1,1,1,1;-1,0,1,1,1;-1,-1,0,1,1;-1,-1,-1,0,1;-1,-1,-1,-1,0) +elif $1==42 +(1,1,1,1,0;1,1,1,0,-1;1,1,0,-1,-1;1,0,-1,-1,-1;0,-1,-1,-1,-1) +elif $1==43 +(0,-1,-1,-1,-1;1,0,-1,-1,-1;1,1,0,-1,-1;1,1,1,0,-1;1,1,1,1,0) +elif $1==44 +(-1,-1,0;-1,0,1;0,1,1) +elif $1==45 +(0,1,1;-1,0,1;-1,-1,0) +elif $1==46 +(1,1,0;1,0,-1;0,-1,-1) +elif $1==47 +(0,-1,-1;1,0,-1;1,1,0) +elif $1==48 +(-1,0,0;0,0,0;0,0,1) +elif $1==49 +(0,0,1;0,0,0;-1,0,0) +elif $1==50 +(1,0,0;0,0,0;0,0,-1) +elif $1==51 +(0,0,-1;0,0,0;1,0,0) +elif $1==52 +(-2,-1,0;-1,0,1;0,1,2) +elif $1==53 +(0,1,2;-1,0,1;-2,-1,0) +elif $1==54 +(2,1,0;1,0,-1;0,-1,-2) +elif $1==55 +(0,-1,-2;1,0,-1;2,1,0) +elif $1==56 +(1,1,0,0,0;0,1,1,0,0;1,1,0,-1,-1;0,0,-1,-1,0;0,0,0,-1,-1) +elif $1==57 +(0,0,-1,0,-1;0,0,-1,-1,-1;0,1,0,-1,0;1,1,1,0,0;1,0,1,0,0) +elif $1==58 +(-1,-1,0,0,0;0,-1,-1,0,0;-1,-1,0,1,1;0,0,1,1,0;0,0,0,1,1) +elif $1==59 +(0,0,1,0,1;0,0,1,1,1;0,-1,0,1,0;-1,-1,-1,0,0;-1,0,-1,0,0) +fi +convolve[-2] [-1] +k[-2] +if $4>0 sharpen {$4*100} fi +n 0,255 +if $2==1 to_gray fi +samj_Colored_Outlines : +Axe_blur=$1 +Valeur_blur=$2 +Valeur_isophotes=$3 +Iterations_smooth=$4 +Valeur_dilate=$5 +Couleur_Fond_r=$6 +Couleur_Fond_v=$7 +Couleur_Fond_b=$8 +Couleur_Fond_a=$9 +Largeur_Origine={w} +Hauteur_Origine={h} +to_rgba[-1] +if $Axe_blur==0 +blur[-1] xy,{$Valeur_blur} +elif $Axe_blur==1 +blur[-1] x,{$Valeur_blur} +elif $Axe_blur==2 +blur[-1] y,{$Valeur_blur} +fi +isophotes[-1] $Valeur_isophotes +if $Iterations_smooth>0 fx_smooth_diffusion[-1] 0.7,0.3,0.6,1.1,15,$Iterations_smooth,2,0,24 fi +dilate_circ[-1] $Valeur_dilate +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] $Couleur_Fond_r,$Couleur_Fond_v,$Couleur_Fond_b,$Couleur_Fond_a +gimp_blend_1651[-2,-1] 1,0,1,0,1 +samj_Coloriage: +Dimension_Max=$1 +Limite=$2 +Flou_Lissage=$3 +Isophotes_Nb_Levels=$4 +Dilatation=$5 +R_a=$6 +V_a=$7 +B_a=$8 +A_a=$9 +Dimensions_Origine=$10 +Largeur_Origine={w} +Hauteur_Origine={h} +OrigineH=0 +OrigineV=-1 +couleur_pixel=0 +rouge_pixel=0 +vert_pixel=0 +bleu_pixel=0 +alpha_pixel=0 +if $Hauteur_Origine>$Largeur_Origine +Largeur_A={round($Largeur_Origine/$Hauteur_Origine*$Dimension_Max)} +Hauteur_A=$Dimension_Max +else +Largeur_A=$Dimension_Max +Hauteur_A={round($Hauteur_Origine/$Largeur_Origine*$Dimension_Max)} +fi +resize[-1] $Largeur_A,$Hauteur_A +n[-1] 0,255 +c[-1] 0,$Limite +n[-1] 0,255 +c[-1] {255-$Limite},255 +n[-1] 0,255 +blur[-1] $Flou_Lissage +isophotes[-1] $Isophotes_Nb_Levels +dilate[-1] $Dilatation +repeat $Hauteur_A +OrigineH=0 +OrigineV+=1 +repeat $Largeur_A +couleur_pixel={I($OrigineH,$OrigineV)} +alpha_pixel={arg(4,$couleur_pixel)} +if $alpha_pixel>0 +point[-1] $OrigineH,$OrigineV,0,1,$R_a,$V_a,$B_a,$A_a +fi +OrigineH+=1 +done +done +if $Dimensions_Origine==1 resize[-1] $Largeur_Origine,$Hauteur_Origine fi +samj_Coloriage_preview : +samj_Coloriage[-1] 256,$2,$3,$4,$5,$6,$7,$8,$9,0 +samj_Contours_Arrondis : +Iterations=$1 +Val_Quantize=$2 +Val_Blur=$3 +Val_Isophotes=$4 +RGBA=$5 +Val_Dilate_Circ=$6 +to_rgb[-1] +repeat $Iterations +quantize[-1] $Val_Quantize +blur[-1] {$Val_Blur/10} +n[-1] 0,255 +done +isophotes[-1] $Val_Isophotes +if $RGBA==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Val_Dilate_Circ>1 dilate_circ[-1] $Val_Dilate_Circ fi +samj_rien_deformations : +Je_passe_l_hiver_en_Floride[-1] +samj_Contours_Blancs : +i [-1] +if $1==1 +blur[-1,-2] $3 +quantize[-1] $2,1,1 +elif $1==2 +blur[-1,-2] $3 +quantize[-2] $2,1,1 +elif $1==3 +blur[-1,-2] $3 +quantize[-1,-2] $2,1,1 +fi +fx_gradient_norm[-1] $4,$5,$6,$7,$8 +isophotes[-1] 8 +to_graya[-1] +repeat $9 +i [-1] +samj_blend_20220419[-1,-2] add +done +fx_segment_watershed[-2] $10,$11,$12,$13 +fx_edge_offsets[-2] $14,$15,$16,$17,1 +to_rgba[-1,-2] +replace_color[-1,-2] 0%,0,0,0,0,255,0,0,0,0 +samj_blend_20220419[-1,-2] alpha +samj_Contours_Blancs_preview : +gui_split_preview "samj_Contours_Blancs $*",$-1 +samj_Contours_Coins_Vifs : +foreach { +autoindex $1 dilate $2 +if $3==1 +isophotes 40 isophotes {$1*2} +else ++erode[-1] 2 dilate[-1] 3 isophotes 40 blend alpha isophotes {$1*2} dilate $3 +fi +if $4==0 +if $6>0 ++pow {1+$5} c[-1] 0,255 dilate[-2] {$6} spread[-2] 1 blur[-2] 2 n[-2] 64,192 pow[-2] {1+$7} blend alpha +else +pow {1+$5} c 0,255 +fi +elif $4==1||$4==2 +repeat 128 +- blend add done +if $4==2 replace_color[-1] 1,0,255,255,255,255,0,0,0,255 fi +if $6>0 ++- dilate[-2] {$6} spread[-2] 1 blur[-2] 2 n[-2] 64,192 pow[-2] {1+$7} blend alpha +fi +fi +if {$8+$9+$10+$11}>0 {w},{h},1,4 fill_color[-1] $8,$9,$10,$11 rv blend alpha fi +} +samj_Contours_Colores : +Puissance=$1 +Edge_threshold=$2 +Couper_Cut=$3 +Dilate_Contours=$4 +Degradation_Spread=$5 +pow[-1] $Puissance +c[-1] 0,255 +fx_segment_watershed[-1] $2,1,0,2,0 ++Je_passe_l_hiver_en_Floride[-1] +fx_gradient_norm[-1] 0,0.5,0,100,0,0 +c[-1] $Couper_Cut,255 +n[-1] 0,255 +if $Dilate_Contours>1 dilate_circ[-1,-2] $Dilate_Contours fi +if $Degradation_Spread>1 spread[-1,-2] $Degradation_Spread fi +samj_blend_20220419[-2,-1] darken,1,0 +samj_Edges_Offsets_Dots : +foreach { ++fx_edge_offsets $1,$2,$3,1,0,2,50,50 +to_rgba[-1] +replace_color[-1] 1,0,255,255,255,255,0,0,0,0 +{w},{h},1,4 +fill_color[-1] 0,0,0,0 +Diam={$4*2} +Dens={6-$5} +IndX=$4 +PosX=0 +PosY=$4 +IncrX={$Diam+$Dens} +repeat {h/$Diam} +repeat w +PosX=$IndX ++crop[-2] $PosX,$PosY,$PosX,$PosY,0 +if {iM}==0 AppliForme=0 else AppliForme=1 fi +rm[-1] +if $AppliForme==1 ++crop[-3] $PosX,$PosY,$PosX,$PosY,0 +circle[-2] $PosX,$PosY,$4,1,{I(#-1)},255 +rm[-1] +IndX+=$IncrX +else +IndX+=$Dens +fi +if $IndX>w break fi +done +IndX=$4 +PosY+=$Diam+$4 +done +mirror x permute yx +IndX=$4 +PosX=0 +PosY=$4 +repeat {h/$Diam} +repeat w +PosX=$IndX ++crop[-2] $PosX,$PosY,$PosX,$PosY,0 +if {iM}==0 AppliForme=0 else AppliForme=1 fi +rm[-1] +if $AppliForme==1 ++crop[-3] $PosX,$PosY,$PosX,$PosY,0 +circle[-2] $PosX,$PosY,$4,1,{I(#-1)},255 +rm[-1] +IndX+=$IncrX +else +IndX+=$Dens +fi +if $IndX>w break fi +done +IndX=$4 +PosY+=$Diam+$4 +done +permute yxzc mirror x +dilate_circ[-1] 3 +rm[-2,-3] +if $6!=5 pow {1+$6} c 0,255 fi +if {$7+$8+$9+$10}>0 {w},{h},1,4 fill_color[-1] $7,$8,$9,$10 rv blend alpha fi +} +samj_Quelques_Isophotes : +Epaisseur=$1 +Precision=$2 +Coeff_Precision_Pixelise=$3 +Coeff_Precision_Flou=$4 +Nb_Isophotes=$5 +Nb_Boucles=0 ++Je_passe_l_hiver_en_Floride[-1] +repeat $Epaisseur +pixelize[-1] {1+round({$Precision+$Epaisseur-$Nb_Boucles}*$Coeff_Precision_Pixelise)},{1+round({$Precision+$Epaisseur-$Nb_Boucles}*$Coeff_Precision_Pixelise)} +blur[-1] {{$Precision+$Epaisseur+$Nb_Boucles}*$Coeff_Precision_Flou} +isophotes[-1] $Nb_Isophotes +if $Nb_Boucles>0 samj_blend_20220419[-1,-2] alpha fi +Nb_Boucles+=1 ++Je_passe_l_hiver_en_Floride[-2] +done +rm[-1,-3] +samj_Quelques_Isophotes_B : +if $3==2 ++Je_passe_l_hiver_en_Floride[-1] +samj_Fonction_Quelques_Isophotes_B[-1] $1,$2,0,$4,$5 +rv[-1,-2] +samj_Fonction_Quelques_Isophotes_B[-1] $1,$2,1,$4,$5 +samj_blend_20220419[-1,-2] alpha +else +samj_Fonction_Quelques_Isophotes_B $1,$2,$3,$4,$5 +fi +samj_Fonction_Quelques_Isophotes_B : +Nb_Decomposition_Couleurs=$1 +Variation_Couleurs=$2 +Type_Variation_Couleurs=$3 +Dilatation=$4 +Nb_Isophotes=$5 +Val_min={im} +Val_max={iM} +Variation_Par_Boucle={{{iM}-{im}}/{$Nb_Decomposition_Couleurs*$Variation_Couleurs}} +Nb_Boucles=0 ++Je_passe_l_hiver_en_Floride[-1] +repeat $Nb_Decomposition_Couleurs +if $Type_Variation_Couleurs==0 +c {$Val_min+{$Variation_Par_Boucle*$Nb_Boucles}},$Val_max +elif $Type_Variation_Couleurs==1 +c $Val_min,{$Val_max-{$Variation_Par_Boucle*$Nb_Boucles}} +fi +n 0,255 +isophotes[-1] $Nb_Isophotes +if $Nb_Boucles>0 +if $Dilatation>0 dilate_circ[-1] {$Dilatation+1} fi +samj_blend_20220419[-1,-2] alpha +fi +Nb_Boucles+=1 ++Je_passe_l_hiver_en_Floride[-2] +done +rm[-1,-3] +samj_Quelques_Isophotes_C : +blur $1 +n $2,$3 +c $4,$5 +n 0,255 +isophotes $6 +repeat $7 ++- +shift[-1] $8,0 +blend alpha ++- +shift[-1] 0,$9 +blend alpha +if $8>-1&&$9>-1 shift[-1] -$8,-$9 fi +if $8<0&&$9<0 shift[-1] {abs($8)},{abs($9)} fi +if $8<0&&$9>-1 shift[-1] {abs($8)},-$9 fi +if $8>-1&&$9<0 shift[-1] -$8,{abs($9)} fi +done +if $10==1 wind $11,$12,$13,$14 fi +samj_shapeprevalent_contours : +foreach { +samj_shapeprevalent_degradations $1,$2,$3,$4,$5,$6,$7,$8 ++gradient_norm. +dilate_circ. $10 +to_rgba. +n. 0,255 +replace_color. 1%,0,0,0,0,255,0,0,0,0 +c. 0,128 +replace_color. 50%,0,128,128,128,255,0,0,0,255 +replace_color. 50%,0,192,192,192,255,0,0,0,255 +if $11 fx_smooth_antialias. 5,0,0,0,50,50 fi +if $12 +rm.. +else +if $9!=1 to_rgb.. mul.. $9 c.. 0,255 fi +to_rgba.. blend[-1,-2] alpha +fi +} +samj_shapeprevalent_contours_preview : +gui_split_preview "samj_shapeprevalent_contours $*",$-1 +samj_Scintillements_Colores_Contours : +Val_Flou=$1 +Val_Isophotes=$2 +Val_Dilate=$3 +Resolution_L=$4 +Resolution_H=$5 +Dimension_Variation=$6 +Variation_Couleur=$7 +Scintillement=$8 +Angle_Decalage=$9 +Variation_Aleatoire=$10 +Flou_Contours=$11 +Mode_Overlay=$12 +Couleur_Fond_r=$13 +Couleur_Fond_v=$14 +Couleur_Fond_b=$15 +Couleur_Fond_a=$16 +Largeur_Origine={w} +Hauteur_Origine={h} +couleur_pixel=0 +rouge_pixel=0 +vert_pixel=0 +bleu_pixel=0 +alpha_pixel=0 +Hauteur=$Resolution_H +Largeur=$Resolution_L +Rayon_Scintillement_Origine={{$Resolution_H+$Resolution_L}*$Dimension_Variation} +Rayon_Scintillement=0 +Angle_Variation={360/$Scintillement} +Angle_Variation_En_Cours=0 +Coeff_Variation_Aleatoire=0 +blur[-1] $Val_Flou +to_rgba[-1] +isophotes[-1] $Val_Isophotes +dilate_circ[-1] $Val_Dilate +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] $Couleur_Fond_r,$Couleur_Fond_v,$Couleur_Fond_b,$Couleur_Fond_a +repeat $Largeur_Origine/($Resolution_L+$Resolution_L) +repeat $Hauteur_Origine/($Resolution_H+$Resolution_H) +couleur_pixel=${at_ancien[-2]\ {$Largeur},{$Hauteur}} +rouge_pixel=${arg\ 1,$couleur_pixel} +vert_pixel=${arg\ 2,$couleur_pixel} +bleu_pixel=${arg\ 3,$couleur_pixel} +alpha_pixel=${arg\ 4,$couleur_pixel} +Moyenne_couleur={1+{{$rouge_pixel+$vert_pixel+$bleu_pixel}/$Variation_Couleur}} +Rayon_Scintillement={$Rayon_Scintillement_Origine*$Moyenne_couleur} +Angle_Variation_En_Cours=0 +if $alpha_pixel>1 +repeat $Scintillement +Angle_Variation_En_Cours+=$Angle_Variation+$Angle_Decalage +if $Variation_Aleatoire==0 +line[-1] $Largeur,$Hauteur,{$Largeur+{$Rayon_Scintillement*{cos(pi/180*$Angle_Variation_En_Cours)}}},{$Hauteur+{$Rayon_Scintillement*{sin(pi/180*$Angle_Variation_En_Cours)}}},1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +else +Coeff_Variation_Aleatoire={1+{{round(u)*$Variation_Aleatoire}/100}} +line[-1] $Largeur,$Hauteur,{$Largeur+{$Rayon_Scintillement*$Coeff_Variation_Aleatoire*{cos(pi/180*$Angle_Variation_En_Cours*$Coeff_Variation_Aleatoire)}}},{$Hauteur+{$Rayon_Scintillement*$Coeff_Variation_Aleatoire*{sin(pi/180*$Angle_Variation_En_Cours*$Coeff_Variation_Aleatoire)}}},1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +done +fi +Hauteur+=$Resolution_H+$Resolution_H +done +Largeur+=$Resolution_L+$Resolution_L +Hauteur=$Resolution_H +done +rm[-2] +if $Flou_Contours>0 blur[-1] $Flou_Contours,0 fi +if $Mode_Overlay==1 ++Je_passe_l_hiver_en_Floride[-1] +samj_blend_20220419[-2,-1] overlay,1,0 +fi +samj_Skeletation : +Skeletation=$1 +Variation_SmoothnessA={$2/$Skeletation/100} +Variation_SmoothnessB={$3/$Skeletation/100} +Valider_Blend=$4 +Mode_blend=$5 +Opacity_blend=$6 +Smoothness=0 +index=0 ++Je_passe_l_hiver_en_Floride[-1] +repeat $Skeletation ++Je_passe_l_hiver_en_Floride[0] +fx_skeleton[-1] 0,$Smoothness,0,0,0 +if $index>0 samj_blend_20220419[-2,-1] add,1,0 fi +Smoothness+=$Variation_SmoothnessA +index+=1 +done +fx_local_orientation[-2] 0,0,100,0,0,0 +Smoothness=0 +index=0 +repeat $Skeletation ++Je_passe_l_hiver_en_Floride[1] +fx_skeleton[-1] 0,$Smoothness,0,0,0 +if $index>0 samj_blend_20220419[-2,-1] add,1,0 fi +Smoothness+=$Variation_SmoothnessB +index+=1 +done +samj_blend_20220419[-2,-1] add,1,0 +rm[-2] +if $Valider_Blend==0 +rm[0] +else +gimp_blend_1651[0,-1] $Mode_blend,2,$Opacity_blend,0 +fi +samj_Test_Mauvais_Contours: +mode=${arg\ 1+$12,add,alpha,and,average,blue,burn,darken,difference,divide,dodge,edges,exclusion,freeze,grainextract,grainmerge,green,hardlight,hardmix,hue,interpolation,lighten,lightness,linearburn,linearlight,luminance,multiply,negation,or,overlay,pinlight,red,reflect,saturation,shapeareamax,shapeareamax0,shapeareamin,shapeareamin0,shapeaverage,shapeaverage0,shapemin,shapemin0,shapemax,shapemax0,softburn,softdodge,softlight,screen,stamp,subtract,value,vividlight,xor} +if $11==1 +Je_passe_l_hiver_en_Floride[-1] fi ++Je_passe_l_hiver_en_Floride[-1] +if $1<0 spread[-1] {abs($1/4)},{abs($1/4)} fi +if $1>0 segment_watershed[-1] {int($1)} fi +if $2>0 samj_Random_Small_Deformations[-1] $2,5,3 fi +if $3>0 samj_Random_Small_Deformations[-2] $3,5,3 fi +samj_blend_20220419[-1,-2] edges +gradient_norm[-1] +n[-1] 0,255 +repeat $4 ++Je_passe_l_hiver_en_Floride[-1] +samj_blend_20220419[-1,-2] add +pow[-1] $5 +n[-1] $6,$7 +c[-1] $8,$9 +done +n[-1] 0,255 +if $10>0 negate[-1] fi +if $11==1 +if $13==1 rv[-1,-2] fi +samj_blend_20220419[-1,-2] $mode +fi +samj_Beigne : +foreach { +Carre=0 +Diff=0 +to_rgba +if $8==1 +frame_xy $9,$10,$11,$12,$13,$14 +fi +if $3==1 +mirror x permute yx +elif $3==2 +permute yxzc mirror x +elif $3==3 +mirror x mirror y +fi +Larg={w} +Haut={h} +if $Larg<$Haut +Carre=$Haut +Diff={$Carre-w} +expand_x $Diff,0,0 +crop 0,0,{w-$Diff-1},{h-1} +fi +if $1>0 +expand_y {$Haut*$1/200},1,0 +Carre={$Haut*{100+$1}/100} +Diff={$Carre-w} +if $Diff>0 +expand_x $Diff,0,0 +crop 0,0,{w-$Diff-1},{h-1} +fi +fi +fill "i(((w-(2*x))^2+(h-(2*y))^2)^0.5)" +if $15==1 +fx_symmetrizoscope 3,45,0,0 +rotate 45,2,0 +autocrop +fi +if $2==1 +fx_square_circle 0,1,0,0,0,0,0 +fi +replace_color 1,0,0,0,0,0,$4,$5,$6,$7 +} +samj_Cercle_Polaire: +Repetitions=$1 +Angle_Rotation=$2 +Type_Raccord=$3 +Iterations_AM=$4 +X_offset_AM=$5 +Y_offse_AM=$6 +Array_mode_AM=$7 +Initialization_AM=$8 +Expand_size_AM=$9 +Crop_AM=$10 +X_center_PTE=$11 +Y_center_PTE=$12 +Expension=0 +Securite=4000 +to_rgba[-1] +repeat $Repetitions +if $Type_Raccord==1||$Type_Raccord==3 +if w>h +Expension={round({{w-h}/2})} +expand_y[-1] $Expension,1 +elif w$Securite||h>$Securite +if w>h +resize[-1] $Securite,{$Securite/w*h} +else +resize[-1] {$Securite/h*w},$Securite +fi +fi +fx_array_mirror[-1] 1,$X_offset_AM,$Y_offse_AM,$Array_mode_AM,$Initialization_AM,$Expand_size_AM,$Crop_AM +done +if w>$Securite||h>$Securite +if w>h +resize[-1] $Securite,{$Securite/w*h} +else +resize[-1] {$Securite/h*w},$Securite +fi +fi +polar2euclidean[-1] $X_center_PTE%,$Y_center_PTE%,1,1 +if $Type_Raccord==2||$Type_Raccord==3 +if w>h +Expension={round({{w-h}/2})} +expand_y[-1] $Expension,1 +elif w0 +if $Type_Raccord==2||$Type_Raccord==3||$Type_Raccord==4 +rotate[-1] $Angle_Rotation,0,1 +fi +if $Type_Raccord==0||$Type_Raccord==1 +rotate[-1] $Angle_Rotation,0,0 +fi +fi +autocrop[-1] 0 +if w>$Securite||h>$Securite +if w>h +resize[-1] $Securite,{$Securite/w*h} +else +resize[-1] {$Securite/h*w},$Securite +fi +fi +done +samj_rien_degradations : +Je_passe_l_hiver_en_Floride[-1] +samj_Ecraser_Etirer : +NbSplit=$1 +Effet=$2 +Step={$5/$NbSplit} +Loop=1 +Largeur_Origine={w} +Hauteur_Origine={h} +if $4==1 permute yxzc fi +split y,$NbSplit +repeat $NbSplit +if $Effet==0 +resize[-$Loop] 100%,{$Step*$Loop}% +elif $Effet==1 +resize[-{$NbSplit+1-$Loop}] 100%,{$Step*$Loop}% +elif $Effet==2 +resize[-$Loop] 100%,{100+{$Step*$Loop}}% +elif $Effet==3 +resize[-{$NbSplit+1-$Loop}] 100%,{100+{$Step*$Loop}}% +fi +Loop+=1 +done +append y +if $3==1 resize $Largeur_Origine,$Hauteur_Origine fi +if $4==1 permute yxzc fi +samj_Ecraser_Etirer_preview : +gui_split_preview "samj_Ecraser_Etirer $*",$-1 +samj_Ecraser_Etirer_V2 : +Pourcentage_Decoupe=$5 +Largeur_Origine={w} +Hauteur_Origine={h} +if $2==0||$2==1 ++Je_passe_l_hiver_en_Floride[-1] +crop[-1] 100%,$Pourcentage_Decoupe% +mirror[-2] x +crop[-2] 100%,{100-$Pourcentage_Decoupe}% +mirror[-2] x +if $2==1 mirror[-1,-2] x fi +samj_Ecraser_Etirer[-1] $1,0,0,1,$4 +samj_Ecraser_Etirer[-2] $1,1,0,1,$4 +if $2==1 mirror[-1,-2] x fi +append[-1,-2] x +elif $2==2||$2==3 +permute[-1] yxzc ++Je_passe_l_hiver_en_Floride[-1] +crop[-1] 100%,$Pourcentage_Decoupe% +mirror[-2] x +crop[-2] 100%,{100-$Pourcentage_Decoupe}% +mirror[-2] x +if $2==3 mirror[-1,-2] x fi +samj_Ecraser_Etirer[-1] $1,0,0,1,$4 +samj_Ecraser_Etirer[-2] $1,1,0,1,$4 +if $2==3 mirror[-1,-2] x fi +append[-1,-2] x +permute[-1] yxzc +fi +if $3==1 resize $Largeur_Origine,$Hauteur_Origine fi +samj_Ecraser_Etirer_V2_preview : +gui_split_preview "samj_Ecraser_Etirer_V2 $*",$-1 +samj_Random_Small_Deformations : +Val_Bruit=$1 +Val_Dilate=$2 +Val_Flou=$3 +Val_Expand={round($Val_Bruit+$Val_Dilate+$Val_Flou)*2} +to_rgba[-1] +expand_xy[-1] $Val_Expand,0 +100%,100%,1,2 +noise[-1] $Val_Bruit +dilate[-1] $Val_Dilate +blur[-1] $Val_Flou +warp[-2] [-1],1,0,0 +rm[-1] +autocrop[-1] +samj_Random_Small_Deformations_B : +skip ${1=10},${2=5},${3=3},${4=0} +foreach { +Larg={w} +Haut={h} ++blur {$1*$4/100} +samj_Random_Small_Deformations.. $1,$2,$3 +resize $Larg,$Haut rv blend alpha +} +samj_deformation_20230712 : +foreach { +to_rgba. +repeat $1 +if $5>0 srand $5 fi +deform. $2 +done ++gradient_norm. +blend grainextract,$3 +repeat 2 +smooth. 2,100,0.2,1,4 +done +if $4 n. 0,255 else c. 0,255 fi +} +samj_Zones_Grises : +Iterations_Contours=$1 +Choice_Contours=$2 +Variations_Contours=$3 +Iterations_Blend=$4 +Opacite_Blend=$5 +to_rgb[-1] +repeat $Iterations_Blend ++Je_passe_l_hiver_en_Floride[-1] +done +repeat $Iterations_Contours +if $Choice_Contours==0 +fx_curvature[-1] $Variations_Contours,0,100,0,0,0 +elif $Choice_Contours==1 +dog[-1] {5000/$Variations_Contours},0 +elif $Choice_Contours==2 +fx_edges[-1] 0,{2*$Variations_Contours},0,0 +fi +done +equalize[-1] +fx_decompose_channels[-1] 4,0,1,0 +remove[-1,-2] +to_rgb[-1] +repeat $Iterations_Blend +fx_blend_edges[-1,-2] $Opacite_Blend,5,0 +done +samj_Ellipses_Inpaint : +Couleur_Limite_r=$1 +Couleur_Limite_v=$2 +Couleur_Limite_b=$3 +Rayon_L=$4 +Rayon_H=$5 +Rendu=$6 +Flou_Effet_Sponge=$7 +Valeur_Effet_Sponge=$8 +Largeur_Origine={w} +Hauteur_Origine={h} +couleur_pixel=0 +rouge_pixel=0 +vert_pixel=0 +bleu_pixel=0 +Hauteur=$Rayon_H +Largeur=$Rayon_L +to_rgba[-1] +$Largeur_Origine,$Hauteur_Origine,1,4 +repeat $Largeur_Origine/($Rayon_L+$Rayon_L) +repeat $Hauteur_Origine/($Rayon_H+$Rayon_H) +couleur_pixel=${at_ancien[0]\ {$Largeur},{$Hauteur}} +rouge_pixel=${arg\ 1,$couleur_pixel} +vert_pixel=${arg\ 2,$couleur_pixel} +bleu_pixel=${arg\ 3,$couleur_pixel} +if $Rendu==0 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +ellipse[-1] $Largeur,$Hauteur,$Rayon_L,$Rayon_H,0,1,255 +fi +elif $Rendu==1 +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +ellipse[-1] $Largeur,$Hauteur,$Rayon_L,$Rayon_H,0,1,255 +fi +elif $Rendu==2 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +ellipse[-1] $Largeur,$Hauteur,$Rayon_L,$Rayon_H,0,1,255 +fi +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +ellipse[-1] $Largeur,$Hauteur,$Rayon_L,$Rayon_H,0,1,255 +fi +fi +Hauteur+=$Rayon_H+$Rayon_H +done +Largeur+=$Rayon_L+$Rayon_L +Hauteur=$Rayon_H +done +if $Flou_Effet_Sponge==1 sponge[-1] $Valeur_Effet_Sponge fi +inpaint[-2] [-1] +rm[-1] +samj_Wavelet_Sharpen_Test[-1] 1 +samj_Image_Segments_Degrades : +foreach { +if $11==1 Densite={round($1/4)} else Densite=$1 fi +if $9>0 srand $9 fi +to_rgba +{w},{h},1,4 +fill_color. 0,0,0,255 +repeat $Densite +X1p={round(u*{w})} +Y1p={round(u*{h})} +if $11 +X2p={$X1p+round(u*$2/100*{w})+1} +Y2p={$Y1p-round(u*$2/100*{h})+1} +line. $X1p,$Y1p,$X2p,$Y2p,1,0,0,0,0 +X2p={$X1p-round(u*$2/100*{w})+1} +Y2p={$Y1p-round(u*$2/100*{h})+1} +line. $X1p,$Y1p,$X2p,$Y2p,1,0,0,0,0 +X2p={$X1p-round(u*$2/100*{w})+1} +Y2p={$Y1p+round(u*$2/100*{h})+1} +line. $X1p,$Y1p,$X2p,$Y2p,1,0,0,0,0 +fi +X2p={$X1p+round(u*$2/100*{w})+1} +Y2p={$Y1p+round(u*$2/100*{h})+1} +line. $X1p,$Y1p,$X2p,$Y2p,1,0,0,0,0 +done +if $3>1 erode_circ. $3 fi +blend alpha +if $4 replace_color. 1%,0,0,0,0,255,0,0,0,0 {w},{h},1,4 fill_color. $5,$6,$7,$8 rv blend alpha fi +if $10 dilate. {$3+1} deform $10 fi +} +samj_Image_Vers_Segments : +foreach { +if $9>0 srand $9 fi +to_rgba +{w},{h},1,4 +rv +repeat $1 +X1p={round(u*{w})} +Y1p={round(u*{h})} +X2p={$X1p+round(u*$2/100*{h})+1} +Y2p={$Y1p+round(u*$2/100*{h})+1} +Pixel={I($X1p,$Y1p)} +Rp={arg(1,$Pixel)} +Vp={arg(2,$Pixel)} +Bp={arg(3,$Pixel)} +Ap={arg(4,$Pixel)} +if $2>0 +line.. $X1p,$Y1p,$X2p,$Y2p,1,$Rp,$Vp,$Bp,$Ap +else +X2p={$X1p+round(u/100*{h})+1} +Y2p={$Y1p+round(u/100*{h})+1} +a_Ligne={{$Y2p-$Y1p}/{$X2p-$X1p}} +b_Ligne={$Y2p-($a_Ligne*$X2p)} +X_Ex_a=0 +Y_Ex_a=$b_Ligne +X_Ex_b={{w}-1} +Y_Ex_b={{$a_Ligne*$X_Ex_b}+$b_Ligne} +if $Y_Ex_b>=0 line.. $X_Ex_a,$Y_Ex_a,$X_Ex_b,$Y_Ex_b,1,$Rp,$Vp,$Bp,$Ap fi +fi +done +if $3>1 dilate_circ.. $3 fi +rm. +if $4 {w},{h},1,4 fill_color. $5,$6,$7,$8 rv blend alpha fi +if $10 dilate. {$3+1} deform $10 fi +} +samj_Degradations_Path_Solidify : +Val_Pixelise=$1 +Val_Spread=$2 +Val_Deform=$3 +Val_Isophotes=$4 +Val_Blur=$5 +Patch_Type=$6 +Valeur_Patch=$7 +Dilate_Type=$8 +Valeur_Dilate=$9 +Valeur_Erode=$10 +Valider_Solidify=$11 +smoothness=$12 +diffusion_type=$13 +diffusion_iter=$14 +to_rgb[-1] ++Je_passe_l_hiver_en_Floride[-1] +if $Val_Pixelise>0 pixelize[-1] {$Val_Pixelise+1},{$Val_Pixelise+1} fi +if $Val_Spread>0 spread[-1] $Val_Spread fi +if $Val_Deform>0 deform[-1] $Val_Deform fi +if $Val_Isophotes>0 isophotes[-1] {$Val_Isophotes+2} replace_color[-1] 0%,0,0,0,0,0,0,0,0,255 fi +if $Val_Blur>0 blur[-1] $Val_Blur fi +to_rgb[-1] +if $Patch_Type==2 ++Je_passe_l_hiver_en_Floride[-1] +max_patch[-1] $Valeur_Patch +min_patch[-2] $Valeur_Patch +samj_blend_20220419[-1,-2] add +elif $Patch_Type==1 +min_patch[-1] $Valeur_Patch +elif $Patch_Type==0 +max_patch[-1] $Valeur_Patch +fi +n[-1] 0,255 +to_rgba[-1] +if $Valeur_Dilate>0 +if $Dilate_Type==0 +dilate_circ[-1] {$Valeur_Dilate+1} +elif $Dilate_Type==1 +dilate[-1] {$Valeur_Dilate+1} +fi +fi +if $Valeur_Erode>0 erode[-1] $Valeur_Erode fi +replace_color[-1] 0%,0,0,0,0,255,0,0,0,0 +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +if $Valider_Solidify==1 solidify[-1] $smoothness,$diffusion_type,$diffusion_iter fi +samj_Random_Plasma : +Melange=$1 +Flou=$2 ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +blur[-1] {{w+h}/$Flou} ++Je_passe_l_hiver_en_Floride[-1] +plasma[-1] 1,1,10 +blur[-1] {{w+h}/$Flou} +blend_seamless[-2,-1] 1,0,25% +if $Melange==0 +_gb_bwd_version_1_7_8[-1] 1 +elif $Melange==1 +_gb_bwd_version_1_7_8[-1] 2 +elif $Melange==2 +_gb_bwd_version_1_7_8[-1,-2] 1 +elif $Melange==3 +_gb_bwd_version_1_7_8[-1,-2] 2 +fi +blend_edges[-2,-1] 5 +samj_blend_20220419[-1,-2] alpha +_gb_bwd_version_1_7_8 : +to_color +if $1==1 foreach { sh 0,2 rgb2srgb. rm. } +elif $1==2 foreach { sh 0,2 lab2rgb. rgb2srgb. rm. } +fi +samj_rien_details : +Je_passe_l_hiver_en_Floride[-1] +samj_rotate_flip_image : +foreach { +to_rgba +if $1 +if $5 rotate $2,$3,$4 else rotate $2,$3,$4,50%,50% fi +fi +if $6 +if $7==0 mirror x else mirror y fi +fi +if $8 {w},{h},1,4 fill_color. $9,$10,$11,$12 rv blend alpha fi +} +samj_Selection_Ellipse : +foreach { +to_rgba +if $6 +ellipse $1%,$2%,$3%,$4%,$5,1,0,0,0,0 +else +c 0,254.99 +{w},{h},1,4 +fill_color. 257,257,257,257 +ellipse. $1%,$2%,$3%,$4%,$5,1,0,0,0,0 +blend add +c 0,255 +replace_color 0,0,255,255,255,255,0,0,0,0 ++ellipse $1%,$2%,$3%,$4%,$5,1,255,255,255,255 +rv +blend alpha +fi +if $6==0&&$8==1 rotate {-$5},2,0 +elif $6==0&&$8==2 rotate {-$5-90},2,0 +elif $6==0&&$8==3 rotate {-$5+90},2,0 +elif $6==0&&$8==4 rotate {-$5+180},2,0 +fi +if $7 autocrop fi +} +samj_Selection_Ellipse_preview : +samj_Selection_Ellipse $1,$2,$3,$4,$5,$6,$7,$8 +if $9&&$8==0&&$7==0 +line 0,0,{{w}-1},{{h}-1},1,$11,$11,$11,255 +line 0,{{h}-1},{{w}-1},0,1,$11,$11,$11,255 +GrX={{w}/$10} +GrY={{h}/$10} +Ind=0 +repeat {$10-1} +Ind+=1 +line {$Ind*$GrX},0,{$Ind*$GrX},{{h}-1},1,$11,$11,$11,255 +line 0,{$Ind*$GrY},{{w}-1},{$Ind*$GrY},1,$11,$11,$11,255 +done +fi +samj_Selection_Hermite_Spline : +foreach { +to_rgba +c 0,254.99 ++- +x_spline. +to_rgba. +replace_color. 0,0,0,0,0,255,258,258,258,258 +blend add +c 0,255 +replace_color 0,0,255,255,255,255,0,0,0,0 +if $1 autocrop fi +} +samj_Selection_Polygone : +foreach { +point1_X={{w}*$2/100} +point1_Y={{h}*$3/100} +point2_X={{w}*$4/100} +point2_Y={{h}*$5/100} +point3_X={{w}*$6/100} +point3_Y={{h}*$7/100} +point4_X={{w}*$8/100} +point4_Y={{h}*$9/100} +point5_X={{w}*$10/100} +point5_Y={{h}*$11/100} +point6_X={{w}*$12/100} +point6_Y={{h}*$13/100} +point7_X={{w}*$14/100} +point7_Y={{h}*$15/100} +point8_X={{w}*$16/100} +point8_Y={{h}*$17/100} +to_rgba +if $18 +if $1==3 +polygon 3,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,1,0,0,0,0 +elif $1==4 +polygon 4,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,1,0,0,0,0 +elif $1==5 +polygon 5,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,1,0,0,0,0 +elif $1==6 +polygon 6,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,$point6_X,$point6_Y,1,0,0,0,0 +elif $1==7 +polygon 7,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,$point6_X,$point6_Y,$point7_X,$point7_Y,1,0,0,0,0 +elif $1==8 +polygon 8,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,$point6_X,$point6_Y,$point7_X,$point7_Y,$point8_X,$point8_Y,1,0,0,0,0 +fi +else +c 0,254.99 +{w},{h},1,4 +fill_color. 257,257,257,257 +if $1==3 +polygon. 3,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,1,0,0,0,0 +elif $1==4 +polygon. 4,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,1,0,0,0,0 +elif $1==5 +polygon. 5,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,1,0,0,0,0 +elif $1==6 +polygon. 6,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,$point6_X,$point6_Y,1,0,0,0,0 +elif $1==7 +polygon. 7,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,$point6_X,$point6_Y,$point7_X,$point7_Y,1,0,0,0,0 +elif $1==8 +polygon. 8,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,$point6_X,$point6_Y,$point7_X,$point7_Y,$point8_X,$point8_Y,1,0,0,0,0 +fi +blend add +c 0,255 +replace_color 0,0,255,255,255,255,0,0,0,0 +if $1==3 ++polygon 3,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,1,255,255,255,255 +elif $1==4 ++polygon 4,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,1,255,255,255,255 +elif $1==5 ++polygon 5,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,1,255,255,255,255 +elif $1==6 ++polygon 6,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,$point6_X,$point6_Y,1,255,255,255,255 +elif $1==7 ++polygon 7,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,$point6_X,$point6_Y,$point7_X,$point7_Y,1,255,255,255,255 +elif $1==8 ++polygon 8,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,$point6_X,$point6_Y,$point7_X,$point7_Y,$point8_X,$point8_Y,1,255,255,255,255 +fi +rv +blend alpha +fi +if $19 autocrop fi +} +samj_Selection_Polygone_preview : +samj_Selection_Polygone $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19 +if $20&&$19==0 +line 0,0,{{w}-1},{{h}-1},1,$22,$22,$22,255 +line 0,{{h}-1},{{w}-1},0,1,$22,$22,$22,255 +GrX={{w}/$21} +GrY={{h}/$21} +Ind=0 +repeat {$21-1} +Ind+=1 +line {$Ind*$GrX},0,{$Ind*$GrX},{{h}-1},1,$22,$22,$22,255 +line 0,{$Ind*$GrY},{{w}-1},{$Ind*$GrY},1,$22,$22,$22,255 +done +fi +samj_Selection_Rectangle : +foreach { +Xo={{w}*$1/100} +Yo={{h}*$2/100} +Ca={{{{{w}^2}+{{h}^2}}^0.5}*$3/100} +Cb={{{{{w}^2}+{{h}^2}}^0.5}*$4/100} +Ray={{{{{$Ca}^2}+{{$Cb}^2}}^0.5}/2} +Angle={asin($Cb/$Ray/2)/pi*180} +point1_X={$Xo+{$Ray*{cos(pi/180*{$Angle+$5})}}} +point1_Y={$Yo+{$Ray*{sin(pi/180*{$Angle+$5})}}} +point2_X={$Xo+{$Ray*{cos(pi/180*{180-$Angle+$5})}}} +point2_Y={$Yo+{$Ray*{sin(pi/180*{180-$Angle+$5})}}} +point3_X={$Xo+{$Ray*{cos(pi/180*{180+$Angle+$5})}}} +point3_Y={$Yo+{$Ray*{sin(pi/180*{180+$Angle+$5})}}} +point4_X={$Xo+{$Ray*{cos(pi/180*{-$Angle+$5})}}} +point4_Y={$Yo+{$Ray*{sin(pi/180*{-$Angle+$5})}}} +to_rgba +if $6 +polygon 4,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,1,0,0,0,0 +else +c 0,254.99 +{w},{h},1,4 +fill_color. 257,257,257,257 +polygon. 4,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,1,0,0,0,0 +blend add +c 0,255 +replace_color 0,0,255,255,255,255,0,0,0,0 ++polygon 4,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,1,255,255,255,255 +rv +blend alpha +fi +if $6==0&&$8==1 rotate {-$5},2,0 +elif $6==0&&$8==2 rotate {-$5-90},2,0 +elif $6==0&&$8==3 rotate {-$5+90},2,0 +elif $6==0&&$8==4 rotate {-$5+180},2,0 +fi +if $7 autocrop fi +} +samj_Selection_Rectangle_preview : +samj_Selection_Rectangle $1,$2,$3,$4,$5,$6,$7,$8 +if $9&&$8==0&&$7==0 +line 0,0,{{w}-1},{{h}-1},1,$11,$11,$11,255 +line 0,{{h}-1},{{w}-1},0,1,$11,$11,$11,255 +GrX={{w}/$10} +GrY={{h}/$10} +Ind=0 +repeat {$10-1} +Ind+=1 +line {$Ind*$GrX},0,{$Ind*$GrX},{{h}-1},1,$11,$11,$11,255 +line 0,{$Ind*$GrY},{{w}-1},{$Ind*$GrY},1,$11,$11,$11,255 +done +fi +samj_Selection_Spline_Rounded : +foreach { +point1_X={{w}*$3/100} +point1_Y={{h}*$4/100} +point2_X={{w}*$5/100} +point2_Y={{h}*$6/100} +point3_X={{w}*$7/100} +point3_Y={{h}*$8/100} +point4_X={{w}*$9/100} +point4_Y={{h}*$10/100} +point5_X={{w}*$11/100} +point5_Y={{h}*$12/100} +point6_X={{w}*$13/100} +point6_Y={{h}*$14/100} +point7_X={{w}*$15/100} +point7_Y={{h}*$16/100} +point8_X={{w}*$17/100} +point8_Y={{h}*$18/100} +to_rgba +c 0,254.99 +{w},{h},1,4 +fill_color. 257,257,257,257 +samj_Bezier_Quatre_Points. $point1_X,$point1_Y,$point2_X,$point2_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$1,255,255,255,255 +samj_Bezier_Quatre_Points. $point3_X,$point3_Y,$point4_X,$point4_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,$1,255,255,255,255 +if $2 +samj_Bezier_Quatre_Points. $point5_X,$point5_Y,$point6_X,$point6_Y,$point6_X,$point6_Y,$point7_X,$point7_Y,$1,255,255,255,255 +samj_Bezier_Quatre_Points. $point7_X,$point7_Y,$point8_X,$point8_Y,$point8_X,$point8_Y,$point1_X,$point1_Y,$1,255,255,255,255 +if $19 +flood. {{$point1_X+$point3_X+$point5_X+$point7_X}/4},{{$point1_Y+$point3_Y+$point5_Y+$point7_Y}/4},0,0,0,1,0,0,0,0 +else +flood. {{$point2_X+$point4_X+$point6_X+$point8_X}/4},{{$point2_Y+$point4_Y+$point6_Y+$point8_Y}/4},0,0,0,1,0,0,0,0 +fi +else +samj_Bezier_Quatre_Points. $point5_X,$point5_Y,$point6_X,$point6_Y,$point6_X,$point6_Y,$point1_X,$point1_Y,$1,255,255,255,255 +if $19 +flood. {{$point1_X+$point3_X+$point5_X}/3},{{$point1_Y+$point3_Y+$point5_Y}/3},0,0,0,1,0,0,0,0 +else +flood. {{$point2_X+$point4_X+$point6_X}/3},{{$point2_Y+$point4_Y+$point6_Y}/3},0,0,0,1,0,0,0,0 +fi +fi +if $20 +replace_color. 0,0,0,0,0,0,258,258,258,258 +replace_color. 0,0,257,257,257,257,0,0,0,0 +replace_color. 0,0,255,255,255,255,0,0,0,258 +replace_color 0,0,255,255,255,255,0,0,0,0 +else +replace_color. 0,0,255,255,255,255,0,0,0,255 +fi +blend add +c 0,255 +replace_color 0,0,255,255,255,255,0,0,0,0 +if $21 autocrop fi +} +samj_Selection_Spline_Rounded_preview : +samj_Selection_Spline_Rounded $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21 +if $22&&$21==0 +line 0,0,{{w}-1},{{h}-1},1,$24,$24,$24,255 +line 0,{{h}-1},{{w}-1},0,1,$24,$24,$24,255 +GrX={{w}/$23} +GrY={{h}/$23} +Ind=0 +repeat {$23-1} +Ind+=1 +line {$Ind*$GrX},0,{$Ind*$GrX},{{h}-1},1,$24,$24,$24,255 +line 0,{$Ind*$GrY},{{w}-1},{$Ind*$GrY},1,$24,$24,$24,255 +done +fi +samj_shapeprevalent_degradations : +foreach { ++- +repeat $8 +blur. $1 +sharpen. $2 +smooth. $3,0.2,1,4,4 +quantize. $4,1,1 +dilate_circ. $5 +erode_circ. $6 +quantize_area. $7 +done +blend shapeprevalent +} +samj_shapeprevalent_degradations_preview : +gui_split_preview "samj_shapeprevalent_degradations $*",$-1 +samj_Antialias_Wavelet : +Flou=$1 +Trait=$2 +Cut_Bas=$3 +Cut_Haut=$4 +Dilate_Circle_W=$5 +Nettete=$6 +Dilate_Circle_R=$7 +Normaliser=$8 +Iterations_Contours=$9 +repeat $Iterations_Contours +fx_split_details_wavelets[-1] 2,0,0 +blur[-2] $Flou +if $Trait>0 add[-2] $Trait fi +c[-2] $Cut_Bas,$Cut_Haut +if $Dilate_Circle_W>1 dilate_circ[-1] $Dilate_Circle_W fi +samj_blend_20220419[-1,-2] grainmerge +sharpen[-1] $Nettete +done +if $Dilate_Circle_R>1 dilate_circ[-1] $Dilate_Circle_R fi +if $Normaliser==1 n[-1] 0,255 fi +gui_set_layer_mode[-1] normal +samj_Wavelet_Sharpen_Test_en : +repeat $2+1 +if $1==0 +fx_split_details_wavelets[-1] 2,0,0 ++Je_passe_l_hiver_en_Floride[-2] +samj_blend_20220419[-1,-3] grainmerge +samj_blend_20220419[-1,-2] grainmerge +elif $1==1 +fx_split_details_wavelets[-1] 6,0,0 ++Je_passe_l_hiver_en_Floride[-6] +samj_blend_20220419[-1,-7] grainmerge +samj_blend_20220419[-6,-5] grainmerge ++Je_passe_l_hiver_en_Floride[-3] +samj_blend_20220419[-1,-6] grainmerge +samj_blend_20220419[-5,-4] grainmerge +samj_blend_20220419[-4,-3] grainmerge +samj_blend_20220419[-3,-2] grainmerge +samj_blend_20220419[-1,-2] grainmerge +fi +done +gui_set_layer_mode[-1] normal +samj_rien_frames : +Je_passe_l_hiver_en_Floride[-1] +samj_Wavelet_Sharpen_Test : +Repetition=$1 +repeat $Repetition +fx_split_details_wavelets[-1] 2,0,0 ++Je_passe_l_hiver_en_Floride[-2] +samj_blend_20220419[-1,-3] grainmerge +samj_blend_20220419[-1,-2] grainmerge +done +gui_set_layer_mode[-1] normal +samj_At06A_2017_frame_painting: +Blend_Mode=$14 +Blend_Opacity=$15 +Blend_Reverse=$16 +Largeur={w} +Hauteur={h} +to_rgba[-1] +$Largeur,$Hauteur,1,4 +frame_painting[-1] $1%,$2,$3%,${4-6},$7%,${8-13} +resize[-1] $Largeur,$Hauteur +pow[-1] $17 +n[-1] 0,{{iM}-{im}} +c[-1] {{iM}/100*$18},{iM} +n[-1] 0,{iM} +c[-1] 0,{{iM}/100*$19} +n[-1] 0,255 +if $Blend_Reverse==0 rv[-1,-2] fi +gimp_blend_1651[-2,-1] $Blend_Mode,2,$Blend_Opacity,0 +samj_rien_layers : +Je_passe_l_hiver_en_Floride[-1] +samj_rien_lights_and_shadows : +Je_passe_l_hiver_en_Floride[-1] +samj_Ombre_Portee : +QuA=$1 +FlA=$2 +InvC=$3 +Limite=$4 +Dilatation=$5 +R_a=$6 +V_a=$7 +B_a=$8 +A_a=$9 +R_b=$10 +V_b=$11 +B_b=$12 +A_b=$13 +VA=$14 +Type_Rendu=$15 +R_c=$16 +V_c=$17 +B_c=$18 +A_c=$19 +Flou=$20 +Largeur_Origine={w} +Hauteur_Origine={h} +if $QuA>0 quantize[-1] {$QuA+7},1,1 fi +blur[-1] $FlA +if $InvC==1 negate[-1] fi +to_rgba[-1] +luminance[-1] +to_rgba[-1] +n[-1] 0,255 +c[-1] 0,$Limite +n[-1] 0,255 +c[-1] {255-$Limite},255 +n[-1] 0,255 +ditheredbw[-1] +dilate[-1] {$Dilatation+1} +to_rgba[-1] +replace_color[-1] 0%,0,255,255,255,255,0,0,0,0 ++Je_passe_l_hiver_en_Floride[-1] +replace_color[-1] 0%,0,0,0,0,255,$R_a,$V_a,$B_a,$A_a +replace_color[-2] 0%,0,0,0,0,255,$R_b,$V_b,$B_b,$A_b +if $Type_Rendu==1 +shift[-2] 0,0,0,0,0 +elif $Type_Rendu==2 +shift[-2] $VA,0,0,0,0 +elif $Type_Rendu==3 +shift[-2] 0,$VA,0,0,0 +elif $Type_Rendu==4 +shift[-2] $VA,$VA,0,0,0 +elif $Type_Rendu==5 +shift[-2] {-$VA},0,0,0,0 +elif $Type_Rendu==6 +shift[-2] 0,{-$VA},0,0,0 +elif $Type_Rendu==7 +shift[-2] {-$VA},{-$VA},0,0,0 +fi +crop[-2] 0,0,{w-1},{h-1} +if $Flou>0 blur[-1] $Flou blur[-2] {$Flou+1} fi +samj_blend_20220419[-1,-2] alpha +{w},{h},1,4 +fill_color[-1] $R_c,$V_c,$B_c,$A_c +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +samj_rien_patterns : +Je_passe_l_hiver_en_Floride[-1] +samj_Ombre_Portee_B : +Resolution=$1 +Limite=$2 +Supprimer_Noir=$3 +Contour=$4 +Variation_Contour=$5 +Clair_Fonce=$6 +Precision_Blanc=$7 +Precision_Noir=$8 +R_a=$9 +V_a=$10 +B_a=$11 +A_a=$12 +Dilatation=$13 +Flou=$14 +VA=$15 +Type_Rendu=$16 +R_b=$17 +V_b=$18 +B_b=$19 +A_b=$20 +Largeur_A={round(w/$Resolution)} +Hauteur_A={round(h/$Resolution)} +OrigineH=0 +OrigineV={-$Resolution} +couleur_pixel=0 +rouge_pixel=0 +vert_pixel=0 +bleu_pixel=0 +alpha_pixel=0 +to_rgba[-1] +resize[-1] $Largeur_A,$Hauteur_A +resize[-1] {$Largeur_A*$Resolution},{$Hauteur_A*$Resolution} +luminance[-1] +to_rgba[-1] +n[-1] 0,255 +c[-1] 0,$Limite +n[-1] 0,255 +c[-1] {255-$Limite},255 +n[-1] 0,255 +replace_color[-1] 100,$Precision_Blanc,255,255,255,255,0,0,0,0 +if $Supprimer_Noir==1 +replace_color[-1] 100,$Precision_Noir,0,0,0,255,0,0,0,0 +fi +mul[-1] $Clair_Fonce +{$Largeur_A*$Resolution},{$Hauteur_A*$Resolution},1,4 +rv[-1,-2] +repeat $Hauteur_A +OrigineH=0 +OrigineV+=$Resolution +repeat $Largeur_A +couleur_pixel={I($OrigineH,$OrigineV)} +rouge_pixel={arg(1,$couleur_pixel)} +vert_pixel={arg(2,$couleur_pixel)} +bleu_pixel={arg(3,$couleur_pixel)} +alpha_pixel={arg(4,$couleur_pixel)} +if $alpha_pixel>0 +rectangle[-2] $OrigineH,$OrigineV,{$OrigineH+$Resolution},{$OrigineV+$Resolution},1,$R_a,$V_a,$B_a,$A_a +if $Contour==1 +rectangle[-1] $OrigineH,$OrigineV,{$OrigineH+$Resolution-1},{$OrigineV+$Resolution-1},1,0xFFFFFFFF,{{$rouge_pixel/2}+$Variation_Contour},{{$vert_pixel/2}+$Variation_Contour},{{$bleu_pixel/2}+$Variation_Contour},255 +fi +fi +OrigineH+=$Resolution +done +done +dilate[-2] $Dilatation +blur[-2] $Flou +if $Type_Rendu==1 +shift[-2] 0,0,0,0,0 +elif $Type_Rendu==2 +shift[-2] $VA,0,0,0,0 +elif $Type_Rendu==3 +shift[-2] 0,$VA,0,0,0 +elif $Type_Rendu==4 +shift[-2] $VA,$VA,0,0,0 +elif $Type_Rendu==5 +shift[-2] {-$VA},0,0,0,0 +elif $Type_Rendu==6 +shift[-2] 0,{-$VA},0,0,0 +elif $Type_Rendu==7 +shift[-2] {-$VA},{-$VA},0,0,0 +fi +crop[-2] 0,0,{w-1},{h-1} +samj_blend_20220419[-1,-2] alpha +{$Largeur_A*$Resolution},{$Hauteur_A*$Resolution},1,4 +fill_color[-1] $R_b,$V_b,$B_b,$A_b +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +samj_Ombre_Portee_C : +isophotes[-1] $1 +dilate_circ[-1] $2 +samj_Ombre_Portee_B[-1] $3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22 +samj_Ombre_Portee_D : +Resolution=$1 +Detection_A=$2 +Detection_B=$3 +Flou_Lissage=$4 +Couleur=$5 +Isophotes_AP=$6 +Dilate_AP=$7 +Contour=$8 +Variation_Contour=$9 +Dilatation_ombre=$10 +Couleur_Ombre=$11 +Flou_Ombre=$12 +VA=$13 +Type_Rendu=$14 +R_a=$15 +V_a=$16 +B_a=$17 +A_a=$18 +Largeur_A={round(w/$Resolution)} +Hauteur_A={round(h/$Resolution)} +OrigineH=0 +OrigineV={-$Resolution} +couleur_pixel=0 +rouge_pixel=0 +vert_pixel=0 +bleu_pixel=0 +alpha_pixel=0 +blur $Flou_Lissage +c[-1] 0,255 +n[-1] 0,255 +c[-1] $Detection_A,{255-$Detection_B} +n[-1] 0,255 +mul[-1] $Couleur +isophotes[-1] $Isophotes_AP +dilate[-1] $Dilate_AP +resize[-1] $Largeur_A,$Hauteur_A +resize[-1] {$Largeur_A*$Resolution},{$Hauteur_A*$Resolution} +repeat $Hauteur_A +OrigineH=0 +OrigineV+=$Resolution +repeat $Largeur_A +couleur_pixel={I($OrigineH,$OrigineV)} +rouge_pixel={arg(1,$couleur_pixel)} +vert_pixel={arg(2,$couleur_pixel)} +bleu_pixel={arg(3,$couleur_pixel)} +alpha_pixel={arg(4,$couleur_pixel)} +if $alpha_pixel>0 +rectangle[-1] $OrigineH,$OrigineV,{$OrigineH+$Resolution-1},{$OrigineV+$Resolution-1},1,$rouge_pixel,$vert_pixel,$bleu_pixel,255 +if $Contour==1 +rectangle[-1] $OrigineH,$OrigineV,{$OrigineH+$Resolution-1},{$OrigineV+$Resolution-1},1,0xFFFFFFFF,{{$rouge_pixel/2}+$Variation_Contour},{{$vert_pixel/2}+$Variation_Contour},{{$bleu_pixel/2}+$Variation_Contour},255 +fi +fi +OrigineH+=$Resolution +done +done ++Je_passe_l_hiver_en_Floride[-1] +to_graya[-1] +dilate[-1] $Dilatation_ombre +mul[-1] $Couleur_Ombre +blur[-1] $Flou_Ombre +if $Type_Rendu==1 +shift[-1] 0,0,0,0,0 +elif $Type_Rendu==2 +shift[-1] $VA,0,0,0,0 +elif $Type_Rendu==3 +shift[-1] 0,$VA,0,0,0 +elif $Type_Rendu==4 +shift[-1] $VA,$VA,0,0,0 +elif $Type_Rendu==5 +shift[-1] {-$VA},0,0,0,0 +elif $Type_Rendu==6 +shift[-1] 0,{-$VA},0,0,0 +elif $Type_Rendu==7 +shift[-1] {-$VA},{-$VA},0,0,0 +fi +crop[-1] 0,0,{w-1},{h-1} +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +{$Largeur_A*$Resolution},{$Hauteur_A*$Resolution},1,4 +fill_color[-1] $R_a,$V_a,$B_a,$A_a +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +samj_Posterize_Relief: +foreach { +blur $1 +autoindex $2 +inpaint_holes {w/100*$3},1 +repeat $4 smooth $5,{$6%},1,$7,{2*$7} done +if $8>0 sharpen $8 fi +n 0,255 +fx_light_relief $9,0,0,$10,$11,$12,0,0,0,0,0 +} +samj_Contours_Gros_Pixels : +Flou=$1 +Isophotes_Nb_Levels=$2 +Dilatation=$3 +Gros_Pixels_X=$4 +Gros_Pixels_Y=$5 +Quantize_Levels=$6 +Couleur=$7 +Transparence=$8 +Valider_Edges=$9 +Threshold_Edges=$10 +Colorisation=$11 +Alpha_Colorisation=$12 +Mode_blend=$13 +Opacity_blend=$14 +to_rgb[-1] +blur[-1] $Flou +isophotes[-1] $Isophotes_Nb_Levels +if $Dilatation>0 +dilate_circ[-1] $Dilatation +fi +if $Valider_Edges==1 +if $Colorisation==1 ++Je_passe_l_hiver_en_Floride[-1] +pow[-2] $Couleur +dilate_circ[-2] $Dilatation +fi +fi +wh={w},{h},1,{s} r $Gros_Pixels_X%,$Gros_Pixels_Y%,10%,100%,2 n[-1] 0,255 quantize[-1] $Quantize_Levels,1,0 r $wh +pow[-1] $Couleur +if $Transparence==1 +to_rgba[-1] +else +to_rgb[-1] +fi +if $Valider_Edges==1 +edges[-1] $Threshold_Edges% +n[-1] 0,255 +to_rgb[-1] +if $Colorisation==1 +n[-2] 0,255 +if $Alpha_Colorisation==0 +to_rgb[-2] +fi +gimp_blend_1651[-2,-1] $Mode_blend,2,$Opacity_blend,0 +fi +fi +samj_Degrades_HSL_TSL : +Type_Degrade=$1 +Dimensions=$2 +Ra=$3 +Ga=$4 +Ba=$5 +Aa=$6 +Rb=$7 +Gb=$8 +Bb=$9 +Ab=$10 +Decalage_H=$11 +Decalage_S=$12 +Decalage_L=$13 +Variation_H=$14 +Variation_S=$15 +Variation_L=$16 +Valider_Variations_Canal_A=$17 +Degrades_aleatoires=$18 +H_Min_Ded_Alea=$19 +H_Max_Ded_Alea=$20 +S_Min_Ded_Alea=$21 +S_Max_Ded_Alea=$22 +L_Min_Ded_Alea=$23 +L_Max_Ded_Alea=$24 +Inverser_Degrade=$25 +Variations_Formes=$26 +Parametre_Forme_A=$27 +Parametre_Forme_B=$28 +Nb_Boucles=0 +Inc_H=0 +Inc_S=0 +Inc_L=0 +Inc_A=0 +Diff=0 +Temp=0 +if $Variations_Formes==1 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +elif $Variations_Formes==2 +if $Type_Degrade==0 +Type_Degrade=1 +elif $Type_Degrade==2 +Type_Degrade=3 +elif $Type_Degrade==4 +Type_Degrade=5 +elif $Type_Degrade==6 +Type_Degrade=7 +fi +elif $Variations_Formes==3 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +Valider_Variations_Canal_A=0 +elif $Variations_Formes==4 +if $Type_Degrade==0 +Type_Degrade=1 +elif $Type_Degrade==2 +Type_Degrade=3 +elif $Type_Degrade==4 +Type_Degrade=5 +elif $Type_Degrade==6 +Type_Degrade=7 +fi +Valider_Variations_Canal_A=0 +elif $Variations_Formes==5 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +elif $Variations_Formes==6 +if $Type_Degrade==0 +Type_Degrade=1 +elif $Type_Degrade==2 +Type_Degrade=3 +elif $Type_Degrade==4 +Type_Degrade=5 +elif $Type_Degrade==6 +Type_Degrade=7 +fi +elif $Variations_Formes==7 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +elif $Variations_Formes==8 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +elif $Variations_Formes==9 +if $Type_Degrade==0 +Type_Degrade=1 +elif $Type_Degrade==2 +Type_Degrade=3 +elif $Type_Degrade==4 +Type_Degrade=5 +elif $Type_Degrade==6 +Type_Degrade=7 +fi +elif $Variations_Formes==10 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +elif $Variations_Formes==11 +if $Type_Degrade==0 +Type_Degrade=1 +elif $Type_Degrade==2 +Type_Degrade=3 +elif $Type_Degrade==4 +Type_Degrade=5 +elif $Type_Degrade==6 +Type_Degrade=7 +fi +elif $Variations_Formes==12 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +fi +var_Ra={$Ra/255} +var_Ga={$Ga/255} +var_Ba={$Ba/255} +var_Mina={min($var_Ra,$var_Ga,$var_Ba)} +var_Maxa={max($var_Ra,$var_Ga,$var_Ba)} +var_diffa={$var_Maxa-$var_Mina} +if $var_Maxa==$var_Mina +Ha=0 +elif $var_Maxa==$var_Ra +Ha={{{$var_Ga-$var_Ba}/$var_diffa}%6} +elif $var_Maxa==$var_Ga +Ha={{$var_Ba-$var_Ra}/$var_diffa+2} +else +Ha={{$var_Ra-$var_Ga}/$var_diffa+4} +fi +Ha*=60 +if $Ha<0 +Ha+=360 +fi +La={{$var_Maxa+$var_Mina}/2} +if $var_diffa==0 +Sa=0 +else +Sa={$var_diffa/(1-(abs(2*$La-1)))} +fi +Sa*=100 +La*=100 +var_Rb={$Rb/255} +var_Gb={$Gb/255} +var_Bb={$Bb/255} +var_Minb={min($var_Rb,$var_Gb,$var_Bb)} +var_Maxb={max($var_Rb,$var_Gb,$var_Bb)} +var_diffb={$var_Maxb-$var_Minb} +if $var_Maxb==$var_Minb +Hb=0 +elif $var_Maxb==$var_Rb +Hb={{{$var_Gb-$var_Bb}/$var_diffb}%6} +elif $var_Maxb==$var_Gb +Hb={{$var_Bb-$var_Rb}/$var_diffb+2} +else +Hb={{$var_Rb-$var_Gb}/$var_diffb+4} +fi +Hb*=60 +if $Hb<0 +Hb+=360 +fi +Lb={{$var_Maxb+$var_Minb}/2} +if $var_diffb==0 +Sb=0 +else +Sb={$var_diffb/(1-(abs(2*$Lb-1)))} +fi +Sb*=100 +Lb*=100 +rm[-1] +if $Type_Degrade==0||$Type_Degrade==1||$Type_Degrade==2||$Type_Degrade==3 +if $Type_Degrade==2||$Type_Degrade==3 +Ha=$Hb +Sa=$Sb +La=$Lb +Aa=$Ab +fi +Nb_Boucles=0 +Inc_H={$Variation_H/$Dimensions} +Sa+=$Decalage_S +if $Sa>100 Sa-=100 fi +La+=$Decalage_L +if $La>100 La-=100 fi +$Dimensions,$Dimensions,1,4 +repeat $Dimensions +if $Degrades_aleatoires==1 +if {{{$Nb_Boucles+1}%{round(u(2,{$Dimensions/{2+$Type_Degrade}}))}}==0} +if $H_Max_Ded_Alea>$H_Min_Ded_Alea Ha={round(u($H_Min_Ded_Alea,$H_Max_Ded_Alea))} else Ha={round(u($H_Max_Ded_Alea,$H_Min_Ded_Alea))} fi +if $S_Max_Ded_Alea>$S_Min_Ded_Alea Sa={round(u($S_Min_Ded_Alea,$S_Max_Ded_Alea))} else Sa={round(u($S_Max_Ded_Alea,$S_Min_Ded_Alea))} fi +if $L_Max_Ded_Alea>$L_Min_Ded_Alea La={round(u($L_Min_Ded_Alea,$L_Max_Ded_Alea))} else La={round(u($L_Max_Ded_Alea,$L_Min_Ded_Alea))} fi +fi +fi +if $Inverser_Degrade==0 +Ha_c={$Ha+$Decalage_H+($Nb_Boucles*$Inc_H)} +else +Ha_c={$Ha+$Decalage_H-($Nb_Boucles*$Inc_H)} +fi +if $Ha_c>359 Ha_c-=359 fi +if $Ha_c<0 Ha_c+=359 fi +Sa_c=$Sa +La_c=$La +if $Ha_c>=360 Ha_c=359 fi +if $Sa_c>100 Sa_c=100 fi +if $La_c>100 La_c=100 fi +if $Ha_c<0 Ha_c=0 fi +if $Sa_c<0 Sa_c=0 fi +if $La_c<0 La_c=0 fi +Sa_c/=100 +La_c/=100 +Ca={{1-{abs(2*$La_c-1)}}*$Sa_c} +hha={$Ha_c/60} +Xa={$Ca*(1-(abs($hha%2-1)))} +Ra_c=0 +Ga_c=0 +Ba_c=0 +if $hha>=0&&$hha<1 +Ra_c=$Ca +Ga_c=$Xa +elif $hha>=1&&$hha<2 +Ra_c=$Xa +Ga_c=$Ca +elif $hha>=2&&$hha<3 +Ga_c=$Ca +Ba_c=$Xa +elif $hha>=3&&$hha<4 +Ga_c=$Xa +Ba_c=$Ca +elif $hha>=4&&$hha<5 +Ra_c=$Xa +Ba_c=$Ca +else +Ra_c=$Ca +Ba_c=$Xa +fi +ma={$La_c-$Ca/2} +Ra_c={{$Ra_c+$ma}*255} +Ga_c={{$Ga_c+$ma}*255} +Ba_c={{$Ba_c+$ma}*255} +if $Type_Degrade==0||$Type_Degrade==2 +line[-1] $Nb_Boucles,0,$Nb_Boucles,{$Dimensions-1},1,$Ra_c,$Ga_c,$Ba_c,$Aa +elif $Type_Degrade==1||$Type_Degrade==3 +line[-1] 0,$Nb_Boucles,{$Dimensions-1},$Nb_Boucles,1,$Ra_c,$Ga_c,$Ba_c,$Aa +fi +Nb_Boucles+=1 +done +fi +if $Type_Degrade==4||$Type_Degrade==5||$Type_Degrade==6||$Type_Degrade==7 +Nb_Boucles=0 +if $Type_Degrade==4||$Type_Degrade==5 +if $Inverser_Degrade==0 +Inc_H={{$Ha-$Hb}/$Dimensions} +Inc_S={{$Sa-$Sb}/$Dimensions} +Inc_L={{$La-$Lb}/$Dimensions} +Inc_A={{$Aa-$Ab}/$Dimensions} +else +Inc_H={-1*{{$Ha-$Hb}/$Dimensions}} +Inc_S={-1*{{$Sa-$Sb}/$Dimensions}} +Inc_L={-1*{{$La-$Lb}/$Dimensions}} +Inc_A={-1*{{$Aa-$Ab}/$Dimensions}} +fi +else +if $Inverser_Degrade==0 +Inc_H={-1*{{$Ha-$Hb}/$Dimensions}} +Inc_S={-1*{{$Sa-$Sb}/$Dimensions}} +Inc_L={-1*{{$La-$Lb}/$Dimensions}} +Inc_A={-1*{{$Aa-$Ab}/$Dimensions}} +else +Inc_H={{$Ha-$Hb}/$Dimensions} +Inc_S={{$Sa-$Sb}/$Dimensions} +Inc_L={{$La-$Lb}/$Dimensions} +Inc_A={{$Aa-$Ab}/$Dimensions} +fi +fi +$Dimensions,$Dimensions,1,4 +repeat $Dimensions +if $Degrades_aleatoires==1 +if {{{$Nb_Boucles+1}%{round(u(2,{$Dimensions/10}))}}==0} +if $H_Max_Ded_Alea>$H_Min_Ded_Alea Ha={round(u($H_Min_Ded_Alea,$H_Max_Ded_Alea))} else Ha={round(u($H_Max_Ded_Alea,$H_Min_Ded_Alea))} fi +if $S_Max_Ded_Alea>$S_Min_Ded_Alea Sa={round(u($S_Min_Ded_Alea,$S_Max_Ded_Alea))} else Sa={round(u($S_Max_Ded_Alea,$S_Min_Ded_Alea))} fi +if $L_Max_Ded_Alea>$L_Min_Ded_Alea La={round(u($L_Min_Ded_Alea,$L_Max_Ded_Alea))} else La={round(u($L_Max_Ded_Alea,$L_Min_Ded_Alea))} fi +fi +fi +if $Valider_Variations_Canal_A==1 +Aa+=$Inc_A +if $Aa>255 Aa=255 Inc_A={-1*$Inc_A} fi +if $Aa<0 Aa=0 Inc_A={-1*$Inc_A} fi +fi +Ha_c={$Ha+$Decalage_H+($Nb_Boucles*$Inc_H)} +if $Ha_c>359 Ha_c-=359 fi +if $Ha_c<0 Ha_c+=359 fi +Sa_c={$Sa+$Decalage_S+($Nb_Boucles*$Inc_S)} +if $Sa_c>100 Sa_c-=100 fi +if $Sa_c<0 Sa_c+=100 fi +La_c={$La+$Decalage_L+($Nb_Boucles*$Inc_L)} +if $La_c>100 La_c-=100 fi +if $La_c<0 La_c+=100 fi +if $Ha_c>=360 Ha_c=359 fi +if $Sa_c>100 Sa_c=100 fi +if $La_c>100 La_c=100 fi +if $Ha_c<0 Ha_c=0 fi +if $Sa_c<0 Sa_c=0 fi +if $La_c<0 La_c=0 fi +Sa_c/=100 +La_c/=100 +Ca={{1-{abs(2*$La_c-1)}}*$Sa_c} +hha={$Ha_c/60} +Xa={$Ca*(1-(abs($hha%2-1)))} +Ra_c=0 +Ga_c=0 +Ba_c=0 +if $hha>=0&&$hha<1 +Ra_c=$Ca +Ga_c=$Xa +elif $hha>=1&&$hha<2 +Ra_c=$Xa +Ga_c=$Ca +elif $hha>=2&&$hha<3 +Ga_c=$Ca +Ba_c=$Xa +elif $hha>=3&&$hha<4 +Ga_c=$Xa +Ba_c=$Ca +elif $hha>=4&&$hha<5 +Ra_c=$Xa +Ba_c=$Ca +else +Ra_c=$Ca +Ba_c=$Xa +fi +ma={$La_c-$Ca/2} +Ra_c={{$Ra_c+$ma}*255} +Ga_c={{$Ga_c+$ma}*255} +Ba_c={{$Ba_c+$ma}*255} +if $Type_Degrade==4||$Type_Degrade==6 +line[-1] $Nb_Boucles,0,$Nb_Boucles,{$Dimensions-1},1,$Ra_c,$Ga_c,$Ba_c,$Aa +elif $Type_Degrade==5||$Type_Degrade==7 +line[-1] 0,$Nb_Boucles,{$Dimensions-1},$Nb_Boucles,1,$Ra_c,$Ga_c,$Ba_c,$Aa +fi +Nb_Boucles+=1 +done +fi +if $Variations_Formes==1 +fx_custom_deformation[-1] "(w+h)/"{20+$Parametre_Forme_A}" * cos(y*"{10+$Parametre_Forme_B}"/h)","1",1,1,1 +elif $Variations_Formes==2 +fx_custom_deformation[-1] "1","(w+h)/"{20+$Parametre_Forme_A}" * sin(x*"{10+$Parametre_Forme_B}"/w)",1,1,1 +elif $Variations_Formes==3 +if $Parametre_Forme_A<50 Parametre_Forme_A={{$Parametre_Forme_A+50}/100} else Parametre_Forme_A={{$Parametre_Forme_A-50}/100} fi +if $Parametre_Forme_B<50 Parametre_Forme_B={{$Parametre_Forme_B+50}/100} else Parametre_Forme_B={{$Parametre_Forme_B-50}/100} fi +fx_euclidean2polar[-1] $Parametre_Forme_A,$Parametre_Forme_B,1,1,1 +elif $Variations_Formes==4 +if $Parametre_Forme_A<50 Parametre_Forme_A={{$Parametre_Forme_A+50}/100} else Parametre_Forme_A={{$Parametre_Forme_A-50}/100} fi +if $Parametre_Forme_B<50 Parametre_Forme_B={{$Parametre_Forme_B+50}/100} else Parametre_Forme_B={{$Parametre_Forme_B-50}/100} fi +fx_euclidean2polar[-1] $Parametre_Forme_A,$Parametre_Forme_B,1,1,1 +elif $Variations_Formes==5 +fx_normalize_local[-1] {$Parametre_Forme_A+6},6,5,20,1,{{$Parametre_Forme_B+3}%23} +elif $Variations_Formes==6 +fx_normalize_local[-1] {$Parametre_Forme_A+6},6,5,20,1,{{$Parametre_Forme_B+3}%23} +elif $Variations_Formes==7 +fx_plaid_texture[-1] 50,2,0,90,0,300 +elif $Variations_Formes==8 +fx_symmetrizoscope[-1] 5,0,1,0 +elif $Variations_Formes==9 +fx_symmetrizoscope[-1] 5,0,1,0 +elif $Variations_Formes==10 +fx_warp_perspective[-1] 1.73,0,1,50,50,$Parametre_Forme_A,0,2 +elif $Variations_Formes==11 +fx_map_sphere[-1] {min($Dimensions,$Dimensions)},{min($Dimensions,$Dimensions)},90,0.5,0,0,20,0,0,0,0.5 +elif $Variations_Formes==12 +fx_map_sphere[-1] {min($Dimensions,$Dimensions)},{min($Dimensions,$Dimensions)},90,0.5,0,0,20,0,0,0,0.5 +fi +Denim_samj : +Dimension_Motif=$1 +Dilatation=$2 +Retourner_motif=$3 +Deformation_1=$4 +Deformation_2=$5 +Amplitude_Bruit=$6 +Amplitude_Bruit_2=$7 +Nettete=$8 +R_Couleur_Denim=$9 +V_Couleur_Denim=$10 +B_Couleur_Denim=$11 +A_Couleur_Denim=$12 +Largeur={w} +Hauteur={h} +$Largeur,$Hauteur,1,4 +fill_color[-1] $R_Couleur_Denim,$V_Couleur_Denim,$B_Couleur_Denim,$A_Couleur_Denim +to_rgba[-1] +fx_noise[-1] $Amplitude_Bruit,0,11,0 +$Dimension_Motif,$Dimension_Motif,1,4 +if $Retourner_motif==0 +line[-1] 0,$Dimension_Motif,$Dimension_Motif,0,1,0,0,0,255 +else +line[-1] 0,0,$Dimension_Motif,$Dimension_Motif,1,0,0,0,255 +fi +resize[-1] [-2],[-2],1,100%,0,2 +dilate_circ[-1] $Dilatation +samj_blend_20220419[-1,-2] alpha,1,1 +water[-1] {$Deformation_1/1000},{$Deformation_2/100} +fx_noise[-1] $Amplitude_Bruit_2,0,26,0 +sharpen[-1] $Nettete +rv[-2,-1] +rm[-1] +samj_EPPE_Transform : +X_Centre=$1 +Y_Centre=$2 +Rendu=$3 +euclidean2polar[-1] $X_Centre%,$Y_Centre%,1,1 +if $Rendu==0 +imagegrid[-1] $4,$5 +elif $Rendu==1 +imagegrid_hexagonal[-1] $6,$7 +elif $Rendu==2 +imagegrid_triangular[-1] $8,$9,$10,{1-($14/255)},$11,$12,$13 +elif $Rendu==3 +boxfitting[-1] $15,$16,$17,3 +fi +polar2euclidean[-1] $X_Centre%,$Y_Centre%,1,1 +samj_Formes_Couleurs_Variees_Dans_Image : +Variations_Formes=$1 +Parametre_Forme_A=$2 +Parametre_Forme_B=$3 +Parametre_Forme_C=$4 +Parametre_Forme_D=$5 +Canal_R=$6 +Canal_V=$7 +Canal_B=$8 +Canal_A=$9 +Valider_Variations_Canal_R=$10 +Valider_Variations_Canal_V=$11 +Valider_Variations_Canal_B=$12 +Valider_Variations_Canal_A=$13 +Type_Variations=$14 +Decalage=$15 +Etendue=$16 +Couleurs_aleatoires=$17 +Flou=$18 +Deformation=$19 +Bruit=$20 +Canal_Alpha=$21 +Largeur_Origine={w} +Hauteur_Origine={h} +Total_Boucles=0 +Nb_Boucle=0 +Val_R=$Canal_R +Val_V=$Canal_V +Val_B=$Canal_B +Val_A=$Canal_A +R_imp=0 +V_imp=0 +B_imp=0 +A_imp=0 +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] 0,0,0,255 +if $Variations_Formes==0||$Variations_Formes==2||$Variations_Formes==4||$Variations_Formes==6||$Variations_Formes==8||$Variations_Formes==10||$Variations_Formes==11||$Variations_Formes==13||$Variations_Formes==14 +Total_Boucles=$Largeur_Origine +elif $Variations_Formes==1||$Variations_Formes==3||$Variations_Formes==5||$Variations_Formes==7||$Variations_Formes==9||$Variations_Formes==12||$Variations_Formes==15 +Total_Boucles=$Hauteur_Origine +fi +repeat $Total_Boucles +if $Couleurs_aleatoires==1 +if $Decalage==0 +if $Nb_Boucle%round(u(1,255))==0 +Canal_R={round(u(0,255))} +Canal_V={round(u(0,255))} +Canal_B={round(u(0,255))} +Val_R=$Canal_R +Val_V=$Canal_V +Val_B=$Canal_B +fi +else +if $Nb_Boucle%$Decalage==0 +Canal_R={round(u(0,255))} +Canal_V={round(u(0,255))} +Canal_B={round(u(0,255))} +Val_R=$Canal_R +Val_V=$Canal_V +Val_B=$Canal_B +fi +fi +fi +if $Valider_Variations_Canal_R==1 +if $Type_Variations==0 +Val_R={$Val_R+1} +if $Val_R>{$Canal_R+$Decalage} Val_R=$Canal_R fi +R_imp={{$Val_R+$Decalage}%$Etendue} +elif $Type_Variations==1 +Val_R={$Val_R-1} +if $Val_R<{$Canal_R-$Decalage} Val_R=$Canal_R fi +R_imp={{$Val_R-$Decalage}%$Etendue} +elif $Type_Variations==2 +Val_R={$Val_R+1} +if $Val_R>255 Val_R=$Canal_R fi +R_imp={{$Val_R+$Decalage}%$Etendue} +elif $Type_Variations==3 +Val_R={$Val_R-1} +if $Val_R<0 Val_R=$Canal_R fi +R_imp={{$Val_R-$Decalage}%$Etendue} +elif $Type_Variations==4 +Val_R+={round(u(0,3))} +if $Val_R>255 Val_R=$Canal_R fi +R_imp={{$Val_R+$Decalage}%$Etendue} +elif $Type_Variations==5 +Val_R-={round(u(0,3))} +if $Val_R<0 Val_R=$Canal_R fi +R_imp={{$Val_R-$Decalage}%$Etendue} +fi +else +R_imp=$Canal_R +fi +if $Valider_Variations_Canal_V==1 +if $Type_Variations==0 +Val_V+=1 +if $Val_V>{$Canal_V+$Decalage} Val_V=$Canal_V fi +V_imp={{$Val_V+$Decalage}%$Etendue} +elif $Type_Variations==1 +Val_V-=1 +if $Val_V<{$Canal_V-$Decalage} Val_V=$Canal_V fi +V_imp={{$Val_V-$Decalage}%$Etendue} +elif $Type_Variations==2 +Val_V+=1 +if $Val_V>255 Val_V=$Canal_V fi +V_imp={{$Val_V+$Decalage}%$Etendue} +elif $Type_Variations==3 +Val_V-=1 +if $Val_V<0 Val_V=$Canal_V fi +V_imp={{$Val_V-$Decalage}%$Etendue} +elif $Type_Variations==4 +Val_V+={round(u(0,3))} +if $Val_V>255 Val_V=$Canal_V fi +V_imp={{$Val_V+$Decalage}%$Etendue} +elif $Type_Variations==5 +Val_V-={round(u(0,3))} +if $Val_V<0 Val_V=$Canal_V fi +V_imp={{$Val_V-$Decalage}%$Etendue} +fi +else +V_imp=$Canal_V +fi +if $Valider_Variations_Canal_B==1 +if $Type_Variations==0 +Val_B+=1 +if $Val_B>{$Canal_B+$Decalage} Val_B=$Canal_B fi +B_imp={{$Val_B+$Decalage}%$Etendue} +elif $Type_Variations==1 +Val_B-=1 +if $Val_B<{$Canal_B-$Decalage} Val_V=$Canal_B fi +B_imp={{$Val_B-$Decalage}%$Etendue} +elif $Type_Variations==2 +Val_B+=1 +if $Val_B>255 Val_B=$Canal_B fi +B_imp={{$Val_B+$Decalage}%$Etendue} +elif $Type_Variations==3 +Val_B-=1 +if $Val_B<0 Val_V=$Canal_B fi +B_imp={{$Val_B-$Decalage}%$Etendue} +elif $Type_Variations==4 +Val_B+={round(u(0,3))} +if $Val_B>255 Val_B=$Canal_B fi +B_imp={{$Val_B+$Decalage}%$Etendue} +elif $Type_Variations==5 +Val_B-={round(u(0,3))} +if $Val_B<0 Val_V=$Canal_B fi +B_imp={{$Val_B-$Decalage}%$Etendue} +fi +else +B_imp=$Canal_B +fi +if $Valider_Variations_Canal_A==1 +if $Type_Variations==0 +Val_A+=1 +if $Val_A>{$Canal_A+$Decalage} Val_A=$Canal_A fi +A_imp={{$Val_A+$Decalage}%$Etendue} +elif $Type_Variations==1 +Val_A-=1 +if $Val_A<{$Canal_A-$Decalage} Val_A=$Canal_A fi +A_imp={{$Val_A-$Decalage}%$Etendue} +elif $Type_Variations==2 +Val_A+=1 +if $Val_A>255 Val_A=$Canal_A fi +A_imp={{$Val_A+$Decalage}%$Etendue} +elif $Type_Variations==3 +Val_A-=1 +if $Val_A<0 Val_A=$Canal_A fi +A_imp={{$Val_A-$Decalage}%$Etendue} +elif $Type_Variations==4 +Val_A+={round(u(0,3))} +if $Val_A>255 Val_A=$Canal_A fi +A_imp={{$Val_A+$Decalage}%$Etendue} +elif $Type_Variations==5 +Val_A-={round(u(0,3))} +if $Val_A<0 Val_A=$Canal_A fi +A_imp={{$Val_A-$Decalage}%$Etendue} +fi +else +A_imp=$Canal_A +fi +if $Variations_Formes==0||$Variations_Formes==2||$Variations_Formes==4||$Variations_Formes==6||$Variations_Formes==8||$Variations_Formes==10||$Variations_Formes==11||$Variations_Formes==13||$Variations_Formes==14 +line[-1] $Nb_Boucle,0,$Nb_Boucle,{$Hauteur_Origine-1},1,$R_imp,$V_imp,$B_imp,$A_imp +elif $Variations_Formes==1||$Variations_Formes==3||$Variations_Formes==5||$Variations_Formes==7||$Variations_Formes==9||$Variations_Formes==12||$Variations_Formes==15 +line[-1] 0,$Nb_Boucle,{$Largeur_Origine-1},$Nb_Boucle,1,$R_imp,$V_imp,$B_imp,$A_imp +fi +Nb_Boucle+=1 +done +if $Variations_Formes==0 +fx_custom_deformation[-1] "(w+h)/"{20+$Parametre_Forme_A}" * cos(y*"{10+$Parametre_Forme_B}"/h)","1",1,1,1 +elif $Variations_Formes==1 +fx_custom_deformation[-1] "1","(w+h)/"{20+$Parametre_Forme_A}" * sin(x*"{10+$Parametre_Forme_B}"/w)",1,1,1 +elif $Variations_Formes==2 +if $Parametre_Forme_A<50 Parametre_Forme_A={{$Parametre_Forme_A+50}/100} else Parametre_Forme_A={{$Parametre_Forme_A-50}/100} fi +if $Parametre_Forme_B<50 Parametre_Forme_B={{$Parametre_Forme_B+50}/100} else Parametre_Forme_B={{$Parametre_Forme_B-50}/100} fi +fx_euclidean2polar[-1] $Parametre_Forme_A,$Parametre_Forme_B,1,1,1 +elif $Variations_Formes==3 +if $Parametre_Forme_A<50 Parametre_Forme_A={{$Parametre_Forme_A+50}/100} else Parametre_Forme_A={{$Parametre_Forme_A-50}/100} fi +if $Parametre_Forme_B<50 Parametre_Forme_B={{$Parametre_Forme_B+50}/100} else Parametre_Forme_B={{$Parametre_Forme_B-50}/100} fi +fx_euclidean2polar[-1] $Parametre_Forme_A,$Parametre_Forme_B,1,1,1 +elif $Variations_Formes==6 +fx_normalize_tiles[-1] {$Parametre_Forme_A+4},1,{$Parametre_Forme_B/100*255},{{$Parametre_Forme_C-100}/100*-255},{{$Parametre_Forme_D+3}%22} +elif $Variations_Formes==7 +fx_normalize_tiles[-1] 1,{$Parametre_Forme_A+4},{$Parametre_Forme_B/100*255},{{$Parametre_Forme_C-100}/100*-255},{{$Parametre_Forme_D+3}%22} +elif $Variations_Formes==8 +fx_normalize_local[-1] {$Parametre_Forme_A+6},6,5,20,1,{{$Parametre_Forme_B+3}%23} +elif $Variations_Formes==9 +fx_normalize_local[-1] {$Parametre_Forme_A+6},6,5,20,1,{{$Parametre_Forme_B+3}%23} +elif $Variations_Formes==10 +fx_plaid_texture[-1] 50,2,0,90,0,300 +elif $Variations_Formes==11 +fx_symmetrizoscope[-1] 5,0,1,0 +elif $Variations_Formes==12 +fx_symmetrizoscope[-1] 5,0,1,0 +elif $Variations_Formes==13 +fx_warp_perspective[-1] 1.73,0,1,50,50,$Parametre_Forme_A,0,2 +elif $Variations_Formes==14 +fill_color[-2] 0,0,0,0 +fx_map_sphere[-1] {min($Largeur_Origine,$Hauteur_Origine)},{min($Largeur_Origine,$Hauteur_Origine)},90,0.5,0,0,20,0,0,0,0.5 +autocrop[-1] +elif $Variations_Formes==15 +fill_color[-2] 0,0,0,0 +fx_map_sphere[-1] {min($Largeur_Origine,$Hauteur_Origine)},{min($Largeur_Origine,$Hauteur_Origine)},90,0.5,0,0,20,0,0,0,0.5 +fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 apply_channels[-1] "fx_noise "$Bruit",0,22,1",1 fi +samj_blend_20220419[-2,-1] alpha,1,0 +samj_Lignes_H_ou_V_Colorees : +R_a=$1 +V_a=$2 +B_a=$3 +R_b=$4 +V_b=$5 +B_b=$6 +R_c=$7 +V_c=$8 +B_c=$9 +R_d=$10 +V_d=$11 +B_d=$12 +R_e=$13 +V_e=$14 +B_e=$15 +R_f=$16 +V_f=$17 +B_f=$16 +R_g=$19 +V_g=$20 +B_g=$21 +R_h=$22 +V_h=$23 +B_h=$25 +R_i=$25 +V_i=$26 +B_i=$27 +R_j=$28 +V_j=$29 +B_j=$30 +R_k=$31 +V_k=$32 +B_k=$33 +R_l=$34 +V_l=$35 +B_l=$36 +Transparence=$37 +Largeur=$38 +Nombre_De_Lignes=$39 +Hauteur_De_Une_Ligne=$40 +Rotation=$41 +Boucles=$42 +Position_H=0 +$Largeur,{$Nombre_De_Lignes*$Hauteur_De_Une_Ligne},1,4 +repeat $Nombre_De_Lignes +repeat $Hauteur_De_Une_Ligne +if $Boucles%12==0 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_a,$V_a,$B_a,$Transparence +elif $Boucles%12==1 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_b,$V_b,$B_b,$Transparence +elif $Boucles%12==2 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_c,$V_c,$B_c,$Transparence +elif $Boucles%12==3 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_d,$V_d,$B_d,$Transparence +elif $Boucles%12==4 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_e,$V_e,$B_e,$Transparence +elif $Boucles%12==5 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_f,$V_f,$B_f,$Transparence +elif $Boucles%12==6 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_g,$V_g,$B_g,$Transparence +elif $Boucles%12==7 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_h,$V_h,$B_h,$Transparence +elif $Boucles%12==8 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_i,$V_i,$B_i,$Transparence +elif $Boucles%12==9 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_j,$V_j,$B_j,$Transparence +elif $Boucles%12==10 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_k,$V_k,$B_k,$Transparence +elif $Boucles%12==11 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_l,$V_l,$B_l,$Transparence +fi +Position_H+=1 +done +Boucles+=1 +done +if $Rotation==1 permute[1] yxzc fi +rv[-2,-1] +samj_Marbre : +Plasma_alpha=$1 +Plasma_beta=$2 +Plasma_scale=$3 +Flou=$4 +Gris=$5 +Bruit_Spread=$6 +Attenuation=$7 +Colorisation=$8 +R_a=$9 +V_a=$10 +B_a=$11 +Blend_Image=$12 +Mode_blend=$13 +Opacity_blend=$14 +if $Blend_Image==1 ++Je_passe_l_hiver_en_Floride[-1] +fi +plasma[-1] $Plasma_alpha,$Plasma_beta,$Plasma_scale +blur[-1] $Flou +structuretensors[-1] +abs[-1] +spread[-1] $Bruit_Spread +pow[-1] $Gris +to_gray[-1] +blur[-1] $Attenuation +n[-1] 0,255 +to_rgb[-1] +if $Colorisation==1 +{w},{h},1,3 +fill_color[-1] $R_a,$V_a,$B_a +blend_median[-1,-2] +fi +if $Blend_Image==1 +to_rgb[-2] +gimp_blend_1651[-2,-1] $Mode_blend,2,$Opacity_blend,0 +fi +samj_Mosaic_A : +foreach { +if $5==1 mirror x elif $5==2 mirror y elif $5==3 mirror x mirror y fi +c 0,255 +add 1 +fx_superpixels $1,50,5,1,1,255,255,255,255,0,50,50 +to_rgba ++- +replace_color[-1] 0%,0,255,255,255,255,0,0,0,0 +replace_color[-1] 99%,0,127,127,127,255,255,255,255,255 +erode[-1] $2 +replace_color[-1] 0%,0,0,0,0,0,0,0,0,255 +replace_color[-1] 0%,0,255,255,255,255,0,0,0,0 +blend alpha +replace_color 0%,0,0,0,0,255,0,0,0,0 +if $3==1 +fx_smooth_antialias 5,10,0.8,0,50,50 +samj_Reptorian_fx_emboss_relief_20210508 {$4*36},20,165,500,2,0,1,1,100,0,50,50 +if $6==1 ++samj_Barbouillage_Paint_Daub 2,2,100,0.2,1,4,1,0,8 +rv +fx_blend[-1,-2] 6,0,100,1,"1/2 - 1/4*cos(pi*a) - 1/4*cos(pi*b)" +fi +fi +if $5==1 mirror x elif $5==2 mirror y elif $5==3 mirror x mirror y fi +c 0,255 +} +samj_Reptorian_fx_emboss_relief_20210508 : +to_a foreach { split_opacity if $8 +samj_Reptorian_em[0] {$6?$2+180:$2},{$1?$4/100:$3/100},$5 samj_blend_20220419[^1] grainmerge,{$9/100} else samj_Reptorian_em[0] {$6?$2+180:$2},{$1?$4/100:$3/100},$5 fi if $7 a c else k[0] fi } +samj_Reptorian_em : +samj_Reptorian_emboss_image $* +samj_Reptorian_emboss_image : +-skip ${2=1},${3=0} +l[0] +luminance +fx_gradient2rgb $3,0,100,0,0 +[0] +repeat 2 l[$>] rgb2hsv s c l[0] + {$1+($>*180)} % 360 done a c hsv2rgb to_rgb s c rm[1,2] done done +l[0] n 128,255 done l[1] negate n 0,128 done ++fill_color[0] 128,128,128,255 rv blend grainmerge - 128 mul $2 + 128 cut 0,255 +done +samj_Mosaic_B : +foreach { +to_rgba. +sharpen. $2 +deform. $3 +blur. {round({{{{w}+{h}}}*$4/10000})} +mosaic. $1 +n. 0,255 +if $5>0 ++isophotes. {round({iM}/2)+1} +dilate_circ. $5 +replace_color. 255,0,127,127,127,255,0,0,0,255 +blend alpha +fi +if $6==1 +if $8==1 mirror. x elif $8==2 mirror. y elif $8==3 mirror. x mirror. y fi +fx_smooth_antialias. 5,10,0.8,0,50,50 +samj_Reptorian_fx_emboss_relief_20210508. {$7*36},20,165,500,2,0,1,1,100,0,50,50 +if $9==1 ++samj_Barbouillage_Paint_Daub. 2,2,100,0.2,1,4,1,0,8 +rv +fx_blend[-1,-2] 6,0,100,1,"1/2 - 1/4*cos(pi*a) - 1/4*cos(pi*b)" +fi +if $8==1 mirror. x elif $8==2 mirror. y elif $8==3 mirror. x mirror. y fi +fi +} +samj_Motif_Plasma : +Details=$1 +PlasmaA=$2 +PlasmaB=$3 +Flou=$4 +Melange_Mode=$5 +Melange_Pourcent=$6 +Graine=$7 +Boucle=0 +Larg={w} +Haut={h} +rm[0] +repeat $Details +repeat 2 +$Larg,$Haut,1,3 +Boucle+=1 +if $Graine>0 srand {$Graine*$Boucle} fi +plasma[-1] $PlasmaA,$PlasmaB +blur[-1] {round($Larg/$Flou)} +c[-1] 0,255 +done +blend_seamless $Melange_Mode,0,$Melange_Pourcent +done +samj_Motifs_7200 : +Details=$1 +Plasma_Bruit=$2 +PlasmaA=$3 +PlasmaB=$4 +Flou=$5 +Melange_Mode=$6 +Melange_Pourcent=$7 +Graine=$8 +Effet=$9 +R_a=$10 +V_a=$11 +B_a=$12 +A_a=$13 +Ajouter_Rolling_Guidance=$14 +Ajouter_Mess_With_Bits=$15 +Ajouter_CeKoaSa_004=$16 +Boucle=0 +Larg={w} +Haut={h} +rm[0] +repeat $Details +repeat 2 +$Larg,$Haut,1,3 +Boucle+=1 +if $Graine>0 srand {$Graine*$Boucle} fi +if $Plasma_Bruit==1 +noise[-1] {$Larg*$Haut*$Boucle},1 +blur[-1] {16+$PlasmaA+$PlasmaB+$Boucle+{{round($Larg/512)}}} +else +plasma[-1] $PlasmaA,$PlasmaB +blur[-1] {round($Larg/$Flou)} +fi +c[-1] 0,255 +done +blend_seamless $Melange_Mode,0,$Melange_Pourcent +done +if $Ajouter_Mess_With_Bits==1 fx_mess_with_bits[-1] 1,15,1,1,0,15,100,0,0,50,50 fi +if $Effet==1 +fx_color_abstraction[-1] 10,10,0.2,0,50,50 +elif $Effet==2 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +elif $Effet==3 +fx_color_abstraction[-1] 10,10,0.2,0,50,50 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +elif $Effet==4 ++samj_Soft_Random_Shades_7200[-1] $R_a,$V_a,$B_a,$A_a,1,66,0.1 +fx_blend_seamless[-1,-2] 1,0,85,2,0 +fx_color_abstraction[-1] 10,10,0.2,0,50,50 +elif $Effet==5 ++samj_Soft_Random_Shades_7200[-1] $R_a,$V_a,$B_a,$A_a,1,66,0.1 +fx_blend_seamless[-1,-2] 1,0,85,2,0 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +elif $Effet==6 ++samj_Soft_Random_Shades_7200[-1] $R_a,$V_a,$B_a,$A_a,1,66,0.1 +fx_blend_seamless[-1,-2] 1,0,85,2,0 +fx_color_abstraction[-1] 10,10,0.2,0,50,50 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +elif $Effet==7 +samj_Barbouillage_Paint_Daub[-1] 2,2,100,0.2,1,4,1,0,8 +elif $Effet==8 +samj_Barbouillage_Paint_Daub[-1] 2,2,100,0.2,1,4,1,0,8 ++samj_Soft_Random_Shades_7200[-1] $R_a,$V_a,$B_a,$A_a,1,66,0.1 +fx_blend_seamless[-1,-2] 1,0,85,2,0 +elif $Effet==9 +samj_Barbouillage_Paint_Daub[-1] 2,2,100,0.2,1,4,1,0,8 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +elif $Effet==10 +samj_Barbouillage_Paint_Daub[-1] 2,2,100,0.2,1,4,1,0,8 ++samj_Soft_Random_Shades_7200[-1] $R_a,$V_a,$B_a,$A_a,1,66,0.1 +fx_blend_seamless[-1,-2] 1,0,85,2,0 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +fi +if $Ajouter_Rolling_Guidance==1 rolling_guidance[-1] {u(3,5)},{u(8,12)},{u(0.3,0.6)} fi +if $Ajouter_CeKoaSa_004==1 samj_CeKoaSa_004 30,0,0,0.8,0,0 fi +samj_Soft_Random_Shades_7200 : +R_a=$1 +V_a=$2 +B_a=$3 +A_a=$4 +Variation_A=$5 +Variation_B=$6 +Variation_C=$7 +Largeur={w} +Hauteur={h} +srand {1+$R_a+$V_a+$B_a+$A_a} +{$Largeur},{$Hauteur},1,4 +{$Largeur},{$Hauteur},1,4 +rm[-3] +fill_color[-1,-2] $R_a,$V_a,$B_a,$A_a +samj_Random_Plasma_7200[-1] $Variation_A,$Variation_B +blend[-1,-2] luminance +if $Variation_C==0 +else +{$Largeur},{$Hauteur},1,4 +{$Largeur},{$Hauteur},1,4 +fill_color[-1,-2] $R_a,$V_a,$B_a,$A_a +samj_Random_Plasma_7200[-1] $Variation_A,$Variation_B +blend[-1,-2] luminance +blend[-1,-2] edges,{0.5+$Variation_C},0 +fi +crop[-1] 0,0,{$Largeur-8},{$Hauteur-1} +resize[-1] {$Largeur},{$Hauteur} +samj_Random_Plasma_7200 : +Melange=$1 +Flou=$2 ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +blur[-1] {{w+h}/$Flou} ++Je_passe_l_hiver_en_Floride[-1] +srand {1+$Melange+$Flou} +plasma[-1] 1,1,10 +blur[-1] {{w+h}/$Flou} +blend_seamless[-2,-1] 1,0,25% +if $Melange==0 +samj_7200_gb_bwd_version_1_7_8[-1] 1 +elif $Melange==1 +samj_7200_gb_bwd_version_1_7_8[-1] 2 +elif $Melange==2 +samj_7200_gb_bwd_version_1_7_8[-1,-2] 1 +elif $Melange==3 +samj_7200_gb_bwd_version_1_7_8[-1,-2] 2 +fi +blend_edges[-2,-1] 5 +blend[-1,-2] alpha +samj_7200_gb_bwd_version_1_7_8 : +to_color +if $1==1 foreach { sh 0,2 rgb2srgb. rm. } +elif $1==2 foreach { sh 0,2 lab2rgb. rgb2srgb. rm. } +fi +samj_Motifs_7200_VarianteA : +Details=$1 +Plasma_Bruit=$2 +PlasmaA=$3 +PlasmaB=$4 +Flou=$5 +Melange_Mode=$6 +Melange_Pourcent=$7 +Graine=$8 +Effet=$9 +R_a=$10 +V_a=$11 +B_a=$12 +A_a=$13 +Ajouter_Rolling_Guidance=$14 +Ajouter_Mess_With_Bits=$15 +Ajouter_CeKoaSa_004=$16 +Boucle=0 +Larg={w} +Haut={h} +rm[0] +repeat $Details +repeat 2 +$Larg,$Haut,1,4 +fill_color[-1] $R_a,$V_a,$B_a,$A_a +$Larg,$Haut,1,4 +Boucle+=1 +if $Graine>0 srand {$Graine*$Boucle} fi +if $Plasma_Bruit==1 +noise[-1] {$Larg*$Haut*$Boucle},1 +blur[-1] {16+$PlasmaA+$PlasmaB+$Boucle+{{round($Larg/512)}}} +else +plasma[-1] $PlasmaA,$PlasmaB +blur[-1] {round($Larg/$Flou)} +fi +c[-1] 0,255 +blend[-1,-2] edges,0.5,0 +$Larg,$Haut,1,4 +fill_color[-1] $R_a,$V_a,$B_a,$A_a +blend[-1,-2] luminance +blur[-1] {round($Larg/$Flou)} +done +blend_seamless $Melange_Mode,0,$Melange_Pourcent +done +if $Ajouter_Mess_With_Bits==1 fx_mess_with_bits[-1] 1,15,1,1,0,15,100,0,0,50,50 fi +if $Effet==1 +fx_color_abstraction[-1] 10,10,0.2,0,50,50 +elif $Effet==2 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +elif $Effet==3 +fx_color_abstraction[-1] 10,10,0.2,0,50,50 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +elif $Effet==4 ++samj_Soft_Random_Shades_7200[-1] $R_a,$V_a,$B_a,$A_a,1,66,0.1 +fx_blend_seamless[-1,-2] 1,0,85,2,0 +fx_color_abstraction[-1] 10,10,0.2,0,50,50 +elif $Effet==5 ++samj_Soft_Random_Shades_7200[-1] $R_a,$V_a,$B_a,$A_a,1,66,0.1 +fx_blend_seamless[-1,-2] 1,0,85,2,0 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +elif $Effet==6 ++samj_Soft_Random_Shades_7200[-1] $R_a,$V_a,$B_a,$A_a,1,66,0.1 +fx_blend_seamless[-1,-2] 1,0,85,2,0 +fx_color_abstraction[-1] 10,10,0.2,0,50,50 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +elif $Effet==7 +samj_Barbouillage_Paint_Daub[-1] 2,2,100,0.2,1,4,1,0,8 +elif $Effet==8 +samj_Barbouillage_Paint_Daub[-1] 2,2,100,0.2,1,4,1,0,8 ++samj_Soft_Random_Shades_7200[-1] $R_a,$V_a,$B_a,$A_a,1,66,0.1 +fx_blend_seamless[-1,-2] 1,0,85,2,0 +elif $Effet==9 +samj_Barbouillage_Paint_Daub[-1] 2,2,100,0.2,1,4,1,0,8 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +elif $Effet==10 +samj_Barbouillage_Paint_Daub[-1] 2,2,100,0.2,1,4,1,0,8 ++samj_Soft_Random_Shades_7200[-1] $R_a,$V_a,$B_a,$A_a,1,66,0.1 +fx_blend_seamless[-1,-2] 1,0,85,2,0 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +fi +if $Ajouter_CeKoaSa_004==1 samj_CeKoaSa_004 30,0,0,0.8,0,0 fi +if $Ajouter_Rolling_Guidance==1 rolling_guidance[-1] {u(3,5)},{u(8,12)},{u(0.3,0.6)} fi +$Larg,$Haut,1,4 +samj_Soft_Random_Shades[-1] $R_a,$V_a,$B_a,255,1,66,0.1 +blend[-1,-2] seamless +if $Ajouter_Mess_With_Bits==1 $Larg,$Haut,1,4 samj_Soft_Random_Shades[-1] $R_a,$V_a,$B_a,255,1,66,0.1 fx_blend[-2,-1] 6,0,100,1,"1/2 - 1/4*cos(pi*a) - 1/4*cos(pi*b)" fi +n[-1] 0,255 +samj_Motifs_7200_VarianteB : +Details=$1 +Bruit=$2 +Deformation=$3 +Dispersion=$19 +Cut_vs_Norm=$20 +Seamless_vs_Edges=$21 +Boucle=0 +Larg={w} +Haut={h} +rm[0] +repeat $Details +Boucle+=1 +$Larg,$Haut,1,3 +noise[-1] {{$Dispersion*$Boucle*$Bruit}+$Larg*$Haut*{round(u(1,32))}},1 +blur[-1] {round(u({16*{1+{$Larg/512}}},{32*{1+{$Larg/512}}}))} +if $$Deformation>0 deform[-1] {$Deformation*{$DispersionDeform+$Boucle}} fi +if $Cut_vs_Norm==1 c 0,255 else n 0,255 fi +done +if $Seamless_vs_Edges==1 blend seamless else blend edges fi +fx_sketchbw[-1] $4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18 +samj_Motifs_7200_VarianteC : +Details=$1 +Bruit=$2 +FlouA=$3 +Deformation=$4 +Seamless_vs_EdgesA=$5 +FlouB=$6 +R_a=$7 +V_a=$8 +B_a=$9 +Seamless_vs_EdgesB=$10 +Etendue_Couleurs=$11 +Ajouter_Degrade=$12 +Larg={w} +Haut={h} +rm[0] +repeat $Details +$Larg,$Haut,1,3 +noise[-1] {$Larg*$Haut*{round(u(1,$Bruit))}},1 +blur[-1] {round(u(10,$FlouA))} +deform[-1] {round(u(0,$Deformation))} +if $Etendue_Couleurs==0 c[-1] 0,255 n[-1] 0,255 elif $Etendue_Couleurs==1 c[-1] 0,255 elif $Etendue_Couleurs==2 n[-1] 0,255 fi +done +if $Seamless_vs_EdgesA==1 blend seamless else blend edges fi +blur[-1] {round(u(1,$FlouB))} +rolling_guidance {u(3,5)},{u(8,12)},{u(0.3,0.6)} +$Larg,$Haut,1,3 +fill_color[-1] $R_a,$V_a,$B_a +if $Seamless_vs_EdgesB==1 rv[-1,-2] blend seamless else blend edges fi +fx_color_abstraction[-1] 10,10,0.2,0,50,50 +if $Ajouter_Degrade==1 +to_rgba[-1] +$Larg,$Haut,1,4 +samj_Linear_Gradient_CIE_Lab[-1] $13,$14,$15,$16,$17,$18,$19,$20,$21,$22 +fx_blend_average_all $23 +fi +samj_Motifs_Aleatoires_Symetriques_Degrades : +Type_Degrade=$1 +Dimensions=$2 +Forme=$3 +Boundary=$4 +Symetrie=$5 +Utiliser_Gimp_Feltpen=$6 +Angle={180/$Forme} +Inc_Angle=$Angle +if $Type_Degrade==0 +samj_Degrades_XYZ_CIE[-1] 6,$Dimensions,240,240,40,255,120,40,240,255,0,0,0,100,64,64,0,0,1,0,100,-128,128,-128,128,0,5,0,0 +elif $Type_Degrade==1 +samj_Degrades_XYZ_CIE[-1] 0,$Dimensions,0,0,0,255,0,0,0,255,0,0,0,100,64,64,0,{round(u(0,2))},1,0,100,-128,128,-128,128,0,{round(u(0,2))},0,0 +elif $Type_Degrade==2 +samj_Degrades_HSL_TSL[-1] 4,$Dimensions,240,240,40,255,120,40,240,255,0,0,0,360,100,100,0,1,0,718,75,100,0,100,0,0,0,0 +elif $Type_Degrade==3 +rm[-1] +$Dimensions,$Dimensions,1,4 +samj_Formes_Couleurs_Variees_Dans_Image 4,0,0,0,0,192,128,64,255,1,1,1,0,3,127,255,1,0,0,0,1 +fi +fx_euclidean2polar[-1] 0.5,0.5,1,1,0 +repeat $Forme +symmetrize[-1] 50%,50%,$Angle,$Boundary,0,0 +Angle+=$Inc_Angle +done +if $Utiliser_Gimp_Feltpen==1 +fx_feltpen[-1] 1000,50,1,0.1,1,2 +fi +if $Symetrie==1 +symmetrize[-1] 50%,50%,180,1,0,0 +elif $Symetrie==2 +symmetrize[-1] 50%,50%,180,1,0,0 +symmetrize[-1] 50%,50%,90,1,0,0 +fi +samj_Degrades_XYZ_CIE : +Type_Degrade=$1 +Dimensions=$2 +Ra=$3 +Ga=$4 +Ba=$5 +Aa=$6 +Rb=$7 +Gb=$8 +Bb=$9 +Ab=$10 +Decalage_L=$11 +Decalage_a=$12 +Decalage_b=$13 +Variation_L=$14 +Variation_a=$15 +Variation_b=$16 +Valider_Variations_Canal_A=$17 +Trou_Noir=$18 +Degrades_aleatoires=$19 +L_Min_Ded_Alea=$20 +L_Max_Ded_Alea=$21 +a_Min_Ded_Alea=$22 +a_Max_Ded_Alea=$23 +b_Min_Ded_Alea=$24 +b_Max_Ded_Alea=$25 +Inverser_Degrade=$26 +Variations_Formes=$27 +Parametre_Forme_A=$28 +Parametre_Forme_B=$29 +Nb_Boucles=0 +Inc_L=0 +Inc_a=0 +Inc_b=0 +Inc_Alpha=0 +nt_Ra={$Ra/255} +nt_Ga={$Ga/255} +nt_Ba={$Ba/255} +if $nt_Ra>0.04045 +nt_Ra={({{$nt_Ra+0.055}/1.055})^2.4} +else +nt_Ra/=12.92 +fi +if $nt_Ga>0.04045 +nt_Ga={({{$nt_Ga+0.055}/1.055})^2.4} +else +nt_Ga/=12.92 +fi +if $nt_Ba>0.04045 +nt_Ba={({{$nt_Ba+0.055}/1.055})^2.4} +else +nt_Ba/=12.92 +fi +nt_Ra*=100 +nt_Ga*=100 +nt_Ba*=100 +Xa={$nt_Ra*0.4124564+$nt_Ga*0.3575761+$nt_Ba*0.1804375} +Ya={$nt_Ra*0.2126729+$nt_Ga*0.7151522+$nt_Ba*0.0721750} +Za={$nt_Ra*0.0193339+$nt_Ga*0.1191920+$nt_Ba*0.9503041} +Xca=$Xa +Yca=$Ya +Zca=$Za +ref_Xa=95.047 +ref_Ya=100.000 +ref_Za=108.883 +nt_Xa={$Xca/$ref_Xa} +nt_Ya={$Yca/$ref_Ya} +nt_Za={$Zca/$ref_Za} +if $nt_Xa>0.008856 +nt_Xa={($nt_Xa)^{1/3}} +else +nt_Xa={{7.787*$nt_Xa}+{16/116}} +fi +if $nt_Ya>0.008856 +nt_Ya={($nt_Ya)^{1/3}} +else +nt_Ya={{7.787*$nt_Ya}+{16/116}} +fi +if $nt_Za>0.008856 +nt_Za={($nt_Za)^{1/3}} +else +nt_Za={{7.787*$nt_Za}+{16/116}} +fi +CIE_La={{116*$nt_Ya}-16} +CIE_aa={500*{$nt_Xa-$nt_Ya}} +CIE_ba={200*{$nt_Ya-$nt_Za}} +nt_Ra={$Rb/255} +nt_Ga={$Gb/255} +nt_Ba={$Bb/255} +if $nt_Ra>0.04045 +nt_Ra={({{$nt_Ra+0.055}/1.055})^2.4} +else +nt_Ra/=12.92 +fi +if $nt_Ga>0.04045 +nt_Ga={({{$nt_Ga+0.055}/1.055})^2.4} +else +nt_Ga/=12.92 +fi +if $nt_Ba>0.04045 +nt_Ba={({{$nt_Ba+0.055}/1.055})^2.4} +else +nt_Ba/=12.92 +fi +nt_Ra*=100 +nt_Ga*=100 +nt_Ba*=100 +Xb={$nt_Ra*0.4124564+$nt_Ga*0.3575761+$nt_Ba*0.1804375} +Yb={$nt_Ra*0.2126729+$nt_Ga*0.7151522+$nt_Ba*0.0721750} +Zb={$nt_Ra*0.0193339+$nt_Ga*0.1191920+$nt_Ba*0.9503041} +Xca=$Xb +Yca=$Yb +Zca=$Zb +ref_Xa=95.047 +ref_Ya=100.000 +ref_Za=108.883 +nt_Xa={$Xca/$ref_Xa} +nt_Ya={$Yca/$ref_Ya} +nt_Za={$Zca/$ref_Za} +if $nt_Xa>0.008856 +nt_Xa={($nt_Xa)^{1/3}} +else +nt_Xa={{7.787*$nt_Xa}+{16/116}} +fi +if $nt_Ya>0.008856 +nt_Ya={($nt_Ya)^{1/3}} +else +nt_Ya={{7.787*$nt_Ya}+{16/116}} +fi +if $nt_Za>0.008856 +nt_Za={($nt_Za)^{1/3}} +else +nt_Za={{7.787*$nt_Za}+{16/116}} +fi +CIE_Lb={{116*$nt_Ya}-16} +CIE_ab={500*{$nt_Xa-$nt_Ya}} +CIE_bb={200*{$nt_Ya-$nt_Za}} +if $Variations_Formes==1 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +elif $Variations_Formes==2 +if $Type_Degrade==0 +Type_Degrade=1 +elif $Type_Degrade==2 +Type_Degrade=3 +elif $Type_Degrade==4 +Type_Degrade=5 +elif $Type_Degrade==6 +Type_Degrade=7 +fi +elif $Variations_Formes==3 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +Valider_Variations_Canal_A=0 +elif $Variations_Formes==4 +if $Type_Degrade==0 +Type_Degrade=1 +elif $Type_Degrade==2 +Type_Degrade=3 +elif $Type_Degrade==4 +Type_Degrade=5 +elif $Type_Degrade==6 +Type_Degrade=7 +fi +Valider_Variations_Canal_A=0 +elif $Variations_Formes==5 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +elif $Variations_Formes==6 +if $Type_Degrade==0 +Type_Degrade=1 +elif $Type_Degrade==2 +Type_Degrade=3 +elif $Type_Degrade==4 +Type_Degrade=5 +elif $Type_Degrade==6 +Type_Degrade=7 +fi +elif $Variations_Formes==7 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +elif $Variations_Formes==8 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +elif $Variations_Formes==9 +if $Type_Degrade==0 +Type_Degrade=1 +elif $Type_Degrade==2 +Type_Degrade=3 +elif $Type_Degrade==4 +Type_Degrade=5 +elif $Type_Degrade==6 +Type_Degrade=7 +fi +elif $Variations_Formes==10 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +elif $Variations_Formes==11 +if $Type_Degrade==0 +Type_Degrade=1 +elif $Type_Degrade==2 +Type_Degrade=3 +elif $Type_Degrade==4 +Type_Degrade=5 +elif $Type_Degrade==6 +Type_Degrade=7 +fi +elif $Variations_Formes==12 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +fi +rm[-1] +if $Type_Degrade==0||$Type_Degrade==1||$Type_Degrade==2||$Type_Degrade==3 +if $Type_Degrade==2||$Type_Degrade==3 +CIE_La=$CIE_Lb +CIE_aa=$CIE_ab +CIE_ba=$CIE_bb +Aa=$Ab +fi +Nb_Boucles=0 +Inc_L={$Variation_L/$Dimensions} +Inc_a={$Variation_a/$Dimensions} +Inc_b={$Variation_b/$Dimensions} +$Dimensions,$Dimensions,1,4 +repeat $Dimensions +if $Degrades_aleatoires==1 +if {{$Nb_Boucles+1}%{round(u(2,{$Dimensions/{2+$Type_Degrade}}))}}==0 +if $L_Max_Ded_Alea>$L_Min_Ded_Alea CIE_La={round(u($L_Min_Ded_Alea,$L_Max_Ded_Alea))} else CIE_La={round(u($L_Max_Ded_Alea,$L_Min_Ded_Alea))} fi +if $a_Max_Ded_Alea>$a_Min_Ded_Alea CIE_aa={round(u($a_Min_Ded_Alea,$a_Max_Ded_Alea))} else CIE_aa={round(u($a_Max_Ded_Alea,$a_Min_Ded_Alea))} fi +if $b_Max_Ded_Alea>$b_Min_Ded_Alea CIE_ba={round(u($b_Min_Ded_Alea,$b_Max_Ded_Alea))} else CIE_ba={round(u($b_Max_Ded_Alea,$b_Min_Ded_Alea))} fi +fi +fi +if $Inverser_Degrade==0 +CIE_Lca={$CIE_La+$Decalage_L+($Nb_Boucles*$Inc_L)} +CIE_aca={$CIE_aa+$Decalage_a+($Nb_Boucles*$Inc_a)} +CIE_bca={$CIE_ba+$Decalage_b+($Nb_Boucles*$Inc_b)} +else +CIE_Lca={$CIE_La+$Decalage_L-($Nb_Boucles*$Inc_L)} +CIE_aca={$CIE_aa+$Decalage_a-($Nb_Boucles*$Inc_a)} +CIE_bca={$CIE_ba+$Decalage_b-($Nb_Boucles*$Inc_b)} +fi +if $Trou_Noir==0 +if $CIE_Lca>100 CIE_Lca=100 fi +if $CIE_Lca<0 CIE_Lca=0 fi +if $CIE_aca>127 CIE_aca=127 fi +if $CIE_aca<-128 CIE_aca=-128 fi +if $CIE_bca>127 CIE_bca=127 fi +if $CIE_bca<-128 CIE_bca=-128 fi +elif $Trou_Noir==1 +if $CIE_Lca>100 Inc_L={-1*$Inc_L} CIE_Lca=100 fi +if $CIE_Lca<0 Inc_L={-1*$Inc_L} CIE_Lca=0 fi +if $CIE_aca>127 Inc_a={-1*$Inc_a} CIE_aca=0 fi +if $CIE_aca<-128 Inc_a={-1*$Inc_a} CIE_aca=0 fi +if $CIE_bca>127 Inc_b={-1*$Inc_b} CIE_bca=0 fi +if $CIE_bca<-128 Inc_b={-1*$Inc_b} CIE_bca=0 fi +elif $Trou_Noir==2 +if $CIE_Lca>100 CIE_Lca-=100 fi +if $CIE_Lca<0 CIE_Lca+=100 fi +if $CIE_aca>127 CIE_aca-=255 fi +if $CIE_aca<-128 CIE_aca+=255 fi +if $CIE_bca>127 CIE_bca-=255 fi +if $CIE_bca<-128 CIE_bca+=255 fi +fi +nt_Yca={{$CIE_Lca+16}/116} +nt_Xca={$CIE_aca/500+$nt_Yca} +nt_Zca={$nt_Yca-$CIE_bca/200} +if {($nt_Yca)^3}>0.008856 +nt_Yca={($nt_Yca)^3} +else +nt_Yca={{$nt_Yca-16/116}/7.787} +fi +if {($nt_Xca)^3}>0.008856 +nt_Xca={($nt_Xca)^3} +else +nt_Xca={{$nt_Xca-16/116}/7.787} +fi +if {($nt_Zca)^3}>0.008856 +nt_Zca={($nt_Zca)^3} +else +nt_Zca={{$nt_Zca-16/116}/7.787} +fi +ref_Xca=95.047 +ref_Yca=100.000 +ref_Zca=108.883 +Xca={$ref_Xca*$nt_Xca} +Yca={$ref_Yca*$nt_Yca} +Zca={$ref_Zca*$nt_Zca} +vcXa=$Xca +vcYa=$Yca +vcZa=$Zca +nt_X={$vcXa/100} +nt_Y={$vcYa/100} +nt_Z={$vcZa/100} +nt_R={$nt_X*3.2404542+$nt_Y*-1.5371385+$nt_Z*-0.4985314} +nt_G={$nt_X*-0.9692660+$nt_Y*1.8760108+$nt_Z*0.0415560} +nt_B={$nt_X*0.0556434+$nt_Y*-0.2040259+$nt_Z*1.0572252} +if $nt_R>0.0031308 +nt_R={1.055*{($nt_R)^{1/2.4}}-0.055} +else +nt_R={12.92*$nt_R} +fi +if {$nt_G>0.0031308} +nt_G={1.055*{($nt_G)^{1/2.4}}-0.055} +else +nt_G={12.92*$nt_G} +fi +if $nt_B>0.0031308 +nt_B={1.055*{($nt_B)^{1/2.4}}-0.055} +else +nt_B={12.92*$nt_B} +fi +Rconv={$nt_R*255} +Gconv={$nt_G*255} +Bconv={$nt_B*255} +if $Rconv>255 Rconv=255 fi +if $Rconv<0 Rconv=0 fi +if $Gconv>255 Gconv=255 fi +if $Gconv<0 Gconv=0 fi +if $Bconv>255 Bconv=255 fi +if $Bconv<0 Bconv=0 fi +if $Type_Degrade==0||$Type_Degrade==2 +line[-1] $Nb_Boucles,0,$Nb_Boucles,{$Dimensions-1},1,$Rconv,$Gconv,$Bconv,$Aa +elif $Type_Degrade==1||$Type_Degrade==3 +line[-1] 0,$Nb_Boucles,{$Dimensions-1},$Nb_Boucles,1,$Rconv,$Gconv,$Bconv,$Aa +fi +Nb_Boucles+=1 +done +fi +if $Type_Degrade==4||$Type_Degrade==5||$Type_Degrade==6||$Type_Degrade==7 +Nb_Boucles=0 +Inc_L={{$CIE_La-$CIE_Lb}/$Dimensions} +Inc_a={{$CIE_aa-$CIE_ab}/$Dimensions} +Inc_b={{$CIE_ba-$CIE_bb}/$Dimensions} +Inc_Alpha={{$Ab-$Aa}/$Dimensions} +$Dimensions,$Dimensions,1,4 +repeat $Dimensions +if $Degrades_aleatoires==1 +if {{$Nb_Boucles+1}%{round(u(2,{$Dimensions/{2+$Type_Degrade}}))}}==0 +if $L_Max_Ded_Alea>$L_Min_Ded_Alea CIE_La={round(u($L_Min_Ded_Alea,$L_Max_Ded_Alea))} else CIE_La={round(u($L_Max_Ded_Alea,$L_Min_Ded_Alea))} fi +if $a_Max_Ded_Alea>$a_Min_Ded_Alea CIE_aa={round(u($a_Min_Ded_Alea,$a_Max_Ded_Alea))} else CIE_aa={round(u($a_Max_Ded_Alea,$a_Min_Ded_Alea))} fi +if $b_Max_Ded_Alea>$b_Min_Ded_Alea CIE_ba={round(u($b_Min_Ded_Alea,$b_Max_Ded_Alea))} else CIE_ba={round(u($b_Max_Ded_Alea,$b_Min_Ded_Alea))} fi +fi +fi +if $Inverser_Degrade==0 +CIE_Lca={$CIE_La+$Decalage_L+($Nb_Boucles*$Inc_L)} +CIE_aca={$CIE_aa+$Decalage_a+($Nb_Boucles*$Inc_a)} +CIE_bca={$CIE_ba+$Decalage_b+($Nb_Boucles*$Inc_b)} +fi +if $Inverser_Degrade==1||$Type_Degrade==6||$Type_Degrade==7 +CIE_Lca={$CIE_La+$Decalage_L-($Nb_Boucles*$Inc_L)} +CIE_aca={$CIE_aa+$Decalage_a-($Nb_Boucles*$Inc_a)} +CIE_bca={$CIE_ba+$Decalage_b-($Nb_Boucles*$Inc_b)} +fi +if $Valider_Variations_Canal_A==1 +Aa+=$Inc_Alpha +if {$Aa>255} Aa=255 fi +if {$Aa<0} Aa=0 fi +fi +if $Trou_Noir==0 +if $CIE_Lca>100 CIE_Lca=100 fi +if $CIE_Lca<0 CIE_Lca=0 fi +if $CIE_aca>127 CIE_aca=127 fi +if $CIE_aca<-128 CIE_aca=-128 fi +if $CIE_bca>127 CIE_bca=127 fi +if $CIE_bca<-128 CIE_bca=-128 fi +elif $Trou_Noir==1 +if $CIE_Lca>100 Inc_L={-1*$Inc_L} CIE_Lca=$CIE_Lb fi +if $CIE_Lca<0 Inc_L={-1*$Inc_L} CIE_Lca=$CIE_La fi +if $CIE_aca>127 Inc_a={-1*$Inc_a} CIE_aca=0 fi +if $CIE_aca<-128 Inc_a={-1*$Inc_a} CIE_aca=0 fi +if $CIE_bca>127 Inc_b={-1*$Inc_b} CIE_bca=0 fi +if $CIE_bca<-128 Inc_b={-1*$Inc_b} CIE_bca=0 fi +elif $Trou_Noir==2 +if $CIE_Lca>100 CIE_Lca-=100 fi +if $CIE_Lca<0 CIE_Lca+=100 fi +if $CIE_aca>127 CIE_aca-=255 fi +if $CIE_aca<-128 CIE_aca+=255 fi +if $CIE_bca>127 CIE_bca-=255 fi +if $CIE_bca<-128 CIE_bca+=255 fi +fi +nt_Yca={{$CIE_Lca+16}/116} +nt_Xca={$CIE_aca/500+$nt_Yca} +nt_Zca={$nt_Yca-$CIE_bca/200} +if {($nt_Yca)^3}>0.008856 +nt_Yca={($nt_Yca)^3} +else +nt_Yca={{$nt_Yca-16/116}/7.787} +fi +if {($nt_Xca)^3}>0.008856 +nt_Xca={($nt_Xca)^3} +else +nt_Xca={{$nt_Xca-16/116}/7.787} +fi +if {($nt_Zca)^3}>0.008856 +nt_Zca={($nt_Zca)^3} +else +nt_Zca={{$nt_Zca-16/116}/7.787} +fi +ref_Xca=95.047 +ref_Yca=100.000 +ref_Zca=108.883 +Xca={$ref_Xca*$nt_Xca} +Yca={$ref_Yca*$nt_Yca} +Zca={$ref_Zca*$nt_Zca} +vcXa=$Xca +vcYa=$Yca +vcZa=$Zca +nt_X={$vcXa/100} +nt_Y={$vcYa/100} +nt_Z={$vcZa/100} +nt_R={$nt_X*3.2404542+$nt_Y*-1.5371385+$nt_Z*-0.4985314} +nt_G={$nt_X*-0.9692660+$nt_Y*1.8760108+$nt_Z*0.0415560} +nt_B={$nt_X*0.0556434+$nt_Y*-0.2040259+$nt_Z*1.0572252} +if $nt_R>0.0031308 +nt_R={1.055*{($nt_R)^{1/2.4}}-0.055} +else +nt_R={12.92*$nt_R} +fi +if $nt_G>0.0031308 +nt_G={1.055*{($nt_G)^{1/2.4}}-0.055} +else +nt_G={12.92*$nt_G} +fi +if $nt_B>0.0031308 +nt_B={1.055*{($nt_B)^{1/2.4}}-0.055} +else +nt_B={12.92*$nt_B} +fi +Rconv={$nt_R*255} +Gconv={$nt_G*255} +Bconv={$nt_B*255} +if $Rconv>255 Rconv=255 fi +if $Rconv<0 Rconv=0 fi +if $Gconv>255 Gconv=255 fi +if $Gconv<0 Gconv=0 fi +if $Bconv>255 Bconv=255 fi +if $Bconv<0 Bconv=0 fi +if $Type_Degrade==4||$Type_Degrade==6 +line[-1] $Nb_Boucles,0,$Nb_Boucles,{$Dimensions-1},1,$Rconv,$Gconv,$Bconv,$Aa +elif $Type_Degrade==5||$Type_Degrade==7 +line[-1] 0,$Nb_Boucles,{$Dimensions-1},$Nb_Boucles,1,$Rconv,$Gconv,$Bconv,$Aa +fi +Nb_Boucles+=1 +done +fi +if $Variations_Formes==1 +fx_custom_deformation[-1] "(w+h)/"{20+$Parametre_Forme_A}" * cos(y*"{10+$Parametre_Forme_B}"/h)","1",1,1,1 +elif $Variations_Formes==2 +fx_custom_deformation[-1] "1","(w+h)/"{20+$Parametre_Forme_A}" * sin(x*"{10+$Parametre_Forme_B}"/w)",1,1,1 +elif $Variations_Formes==3 +if $Parametre_Forme_A<50 Parametre_Forme_A={{$Parametre_Forme_A+50}/100} else Parametre_Forme_A={{$Parametre_Forme_A-50}/100} fi +if $Parametre_Forme_B<50 Parametre_Forme_B={{$Parametre_Forme_B+50}/100} else Parametre_Forme_B={{$Parametre_Forme_B-50}/100} fi +fx_euclidean2polar[-1] $Parametre_Forme_A,$Parametre_Forme_B,1,1,1 +elif $Variations_Formes==4 +if $Parametre_Forme_A<50 Parametre_Forme_A={{$Parametre_Forme_A+50}/100} else Parametre_Forme_A={{$Parametre_Forme_A-50}/100} fi +if $Parametre_Forme_B<50 Parametre_Forme_B={{$Parametre_Forme_B+50}/100} else Parametre_Forme_B={{$Parametre_Forme_B-50}/100} fi +fx_euclidean2polar[-1] $Parametre_Forme_A,$Parametre_Forme_B,1,1,1 +elif $Variations_Formes==5 +fx_normalize_local[-1] {$Parametre_Forme_A+6},6,5,20,1,{{$Parametre_Forme_B+3}%23} +elif $Variations_Formes==6 +fx_normalize_local[-1] {$Parametre_Forme_A+6},6,5,20,1,{{$Parametre_Forme_B+3}%23} +elif $Variations_Formes==7 +fx_plaid_texture[-1] 50,2,0,90,0,300 +elif $Variations_Formes==8 +fx_symmetrizoscope[-1] 5,0,1,0 +elif $Variations_Formes==9 +fx_symmetrizoscope[-1] 5,0,1,0 +elif $Variations_Formes==10 +fx_warp_perspective[-1] 1.73,0,1,50,50,$Parametre_Forme_A,0,2 +elif $Variations_Formes==11 +fx_map_sphere[-1] {min($Dimensions,$Dimensions)},{min($Dimensions,$Dimensions)},90,0.5,0,0,20,0,0,0,0.5 +elif $Variations_Formes==12 +fx_map_sphere[-1] {min($Dimensions,$Dimensions)},{min($Dimensions,$Dimensions)},90,0.5,0,0,20,0,0,0,0.5 +fi +samj_Lignes_Perpendiculaires : +Boucle=0 +{w},{h},1,4 +repeat $6 +rotate[-1] 90 +srand {$8+$Boucle} +stripes_y[-1] $5 +rotate[-1] -90 +srand {$9+$Boucle} +stripes_y[-1] $5 +Boucle=$Boucle+1 +done +dilate[-1] $7 +n[-1] 0,255 +{w},{h},1,4 +fill_color[-1] $1,$2,$3,$4 +samj_blend_20220419[-1,-2] average +if $10==0 +rm[0] +else +to_rgba[0] +mode=${arg\ 1+$11,add,alpha,and,average,blue,burn,darken,difference,,divide,dodge,edges,exclusion,freeze,grainextract,grainmerge,green,hardlight,,hardmix,hue,interpolation,lighten,lightness,linearburn,linearlight,luminance,,multiply,negation,or,overlay,pinlight,red,reflect,saturation,seamless,seamless_mixed,,screen,shapeareamax,shapeareamax0,shapeareamin,shapeareamin0,shapeaverage,shapeaverage0,,shapemedian,shapemedian0,shapemin,shapemin0,shapemax,shapemax0,softburn,softdodge,,softlight,stamp,subtract,value,vividlight,xor} +blend $mode,$12 +fi +samj_Points_Aleatoires_001 : +Iterations=$1 +R_Point=$2 +V_Point=$3 +B_Point=$4 +A_Point=$5 +Mode=$6 +Couleurs_Aleatoires=$7 +Continuite=$8 +Choix=0 +Cavalier=0 +Largeur_Origine={w} +Hauteur_Origine={h} +Position_X={round(u(0,{$Largeur_Origine-1}))} +Position_Y={round(u(0,{$Hauteur_Origine-1}))} +{w},{h},1,4 +fill_color[-1] 0,0,0,0 +rm[-2] +repeat $Iterations +if $Couleurs_Aleatoires==1 +R_Point={round(u(0,255))} +V_Point={round(u(0,255))} +B_Point={round(u(0,255))} +A_Point=255 +fi +if $Continuite==0 +Position_X={round(u(0,{$Largeur_Origine-1}))} +Position_Y={round(u(0,{$Hauteur_Origine-1}))} +fi +repeat $Largeur_Origine+$Hauteur_Origine +Choix={round(u(0,1))} +if $Mode==0 +Inc_X={{round(u(0,2))}-1} +Inc_Y={{round(u(0,2))}-1} +elif $Mode==1 +Inc_X={{round(u(0,2))}-1} +Inc_Y={{round(u(0,{$|}))%3}-1} +elif $Mode==2 +Inc_X={{round(u(0,{$|}))%3}-1} +Inc_Y={{round(u(0,2))}-1} +elif $Mode==3 +if $Choix==0 +Cavalier={round(u(0,7))} +else +Cavalier={round(u(0,4095)%8)} +fi +if $Cavalier==0 +Inc_X=-1 +Inc_Y=2 +elif $Cavalier==1 +Inc_X=1 +Inc_Y=2 +elif $Cavalier==2 +Inc_X=2 +Inc_Y=1 +elif $Cavalier==3 +Inc_X=2 +Inc_Y=-1 +elif $Cavalier==4 +Inc_X=1 +Inc_Y=-2 +elif $Cavalier==5 +Inc_X=-1 +Inc_Y=-2 +elif $Cavalier==6 +Inc_X=-2 +Inc_Y=-1 +elif $Cavalier==7 +Inc_X=-2 +Inc_Y=1 +fi +elif $Mode==4 +Inc_X={{round(u(0,8))}-{round(u(0,8))}} +if $Choix==0 +Inc_Y=$Inc_X +else +Inc_Y={0-$Inc_X} +fi +elif $Mode==5 +if {$Choix==0} +Inc_X={{round(u(0,8))}-{round(u(0,8))}} +Inc_Y=0 +else +Inc_X=0 +Inc_Y={{round(u(0,8))}-{round(u(0,8))}} +fi +elif $Mode==6 +Choix={round(u(0,3))} +if $Choix==0 +Inc_X={{round(u(0,8))}-{round(u(0,8))}} +Inc_Y=$Inc_X +elif $Choix==1 +Inc_X={{round(u(0,8))}-{round(u(0,8))}} +Inc_Y=0 +elif $Choix==2 +Inc_X=0 +Inc_Y={{round(u(0,8))}-{round(u(0,8))}} +elif $Choix==3 +Inc_X={{round(u(0,8))}-{round(u(0,8))}} +Inc_Y={0-$Inc_X} +fi +fi +Position_X+=$Inc_X +if {$Position_X<0} +Position_X={$Largeur_Origine-1} +fi +if $Position_X>{$Largeur_Origine-1} +Position_X=0 +fi +Position_Y+=$Inc_Y +if $Position_Y<0 +Position_Y={$Hauteur_Origine-1} +fi +if $Position_Y>{$Hauteur_Origine-1} +Position_Y=0 +fi +point[-1] $Position_X,$Position_Y,0,1,$R_Point,$V_Point,$B_Point,$A_Point +done +done +samj_pouring : +Largeur_Origine={w} +Hauteur_Origine={h} +to_rgb +if $1==0 +pixelsort -,x +elif $1==1 +pixelsort -,y +elif $1==2 +pixelsort +,x +elif $1==3 +pixelsort +,y +elif $1==4 +pixelsort -,xy +elif $1==5 +pixelsort -,yx +elif $1==6 +pixelsort +,xy +elif $1==7 +pixelsort +,yx +fi +if $4>0 +crop {w*$4%},{h*$4%},{w*{100-$4}%},{h*{100-$4}%} +resize $Largeur_Origine,$Hauteur_Origine +fi +twirl $2,50%,50%,3 +if $3==0 +fx_custom_deformation "(w+h)/20 * cos(y*20/h)","(w+h)/20 * sin(x*20/w)",1,1,3 +elif $3==1 +fx_kaleidoscope 50,50,0,0,100,0,3 +elif $3==2 +fx_custom_deformation "(w+h)/20 * cos(y*20/h)","(w+h)/20 * sin(x*20/w)",1,1,3 +fx_array_mirror 1,0,0,2,0,0,0 +elif $3==3 +fx_kaleidoscope 50,50,0,0,100,0,3 +fx_array_mirror 1,0,0,2,0,0,0 +elif $3==5 +fx_array_mirror 1,0,0,2,0,0,0 +fi +samj_Pseudo_Vitrail : +foreach { +repeat {$10+1} samj_Base_Pseudo_Vitrail $1,$2,$3,$4,$5,$6,$7,$8,$9 done +pow {1+$11} +} +samj_Base_Pseudo_Vitrail : +if $1>0 autoindex {$1+1} fi +mosaic $2 +if $3==1 fx_voronoi 160,1,0,50,3,0,0,0,0,0,0,0,0,0,0,0 fi +blur $4 ++isophotes {iM} +if $5>1 dilate[-1] $5 fi +replace_color[-1] 255,0,127,127,127,255,0,0,0,255 +replace_color[-1] 1,0,0,0,0,255,$6,$7,$8,$9 +blend alpha +samj_Motifs_Rapides: +srand $1 fx_array_color {round({w/100*{20.01-$2}})+1},{round({h/100*{20.01-$2}})+1},1 +if $4>0 srand $3 deform {{w+h}/1000*$4} fi +if $5>0 Larg={w} Haut={h} resize {round(w/$6)*$6},{round(h/$6)*$6} split y,$6 split x,$6 append y append x split y,$6 append x resize $Larg,$Haut fi +if $8>0 srand $7 spread $8 fi +if $9==1 blur $10 fi +if $11==1 {w},{h},1,4 fill_color[-1] $12,$13,$14,$15 blend average fi +if $16==1 symmetrize 50%,50%,180 symmetrize 50%,50%,90 fi +if $17==1 resize {w/2},{h/2} +mirror x +mirror y append_tiles 2,2 fi +samj_Motifs_Rapides_B : +Hauteur={h} +Largeur={w} +srand $2 +rm[0] +if $1==1 {$Largeur/$3},1,1,3,u([256,256,256]) else {$Hauteur/$3},1,1,3,u([256,256,256]) rotate 90 fi +n 0,255 +resize $Largeur,$Hauteur +if $4==1 shift 50%,50%,0,0,2 resize {round($Largeur/$5)*$5},{round($Hauteur/$5)*$5} split y,$5 split x,$5 append y append x split y,$5 append x resize $Largeur,$Hauteur fi +samj_Courtepointe : +Cossin=$1 +Cossin_Deux=$2 +Repetition=$3 +Croix=$4 +Texture=$5 +Courbes_Interactives_Couleurs=$6 +rorschach[-1] {$Cossin}%,1 +if $Cossin_Deux==1 +n[-1] 64,192 +fi +n[-1] 0,255 +repeat $Repetition +fx_array_mirror[-1] 1,0,0,2,0,0 +done +if $Croix==1 +fx_symmetrizoscope[-1] 5,0,1,0 +fi +if {$Texture==1} +samj_Texture_Granuleuse[-1] 0.5,20,80,0,0 +fi +if $Courbes_Interactives_Couleurs==0 +x_color_curves[-1] rgb +elif $Courbes_Interactives_Couleurs==1 +x_color_curves[-1] cmy +elif $Courbes_Interactives_Couleurs==2 +x_color_curves[-1] cmyk +elif $Courbes_Interactives_Couleurs==3 +x_color_curves[-1] hsi +elif $Courbes_Interactives_Couleurs==4 +x_color_curves[-1] hsl +elif $Courbes_Interactives_Couleurs==5 +x_color_curves[-1] hsv +elif $Courbes_Interactives_Couleurs==6 +x_color_curves[-1] lab +elif $Courbes_Interactives_Couleurs==7 +x_color_curves[-1] lch +elif $Courbes_Interactives_Couleurs==8 +x_color_curves[-1] ycbcr +fi +samj_Rays_Of_Colors : +Color_Intensity=$1 +Color_Density=($2/512*w) +Radius=$3 +Border_smoothness=$4 +Border_width=$5 +Merge_Layers=$6 +R_a=$7 +V_a=$8 +B_a=$9 +to_rgb[-1] ++Je_passe_l_hiver_en_Floride[-1] +fill_color[-1] $R_a,$V_a,$B_a +repeat $Color_Intensity +R_Couleur={round(u)*255} +V_Couleur={round(u)*255} +B_Couleur={round(u)*255} +X_point={round(u*w)} +Y_point={round(u*h)} +polygon[-1] 4,$X_point,$Y_point,$X_point,{$Y_point+$Color_Density},{$X_point+$Color_Density},{$Y_point+$Color_Density},{$X_point+$Color_Density},$Y_point,1,$R_Couleur,$V_Couleur,$B_Couleur,255 +done +fx_textured_glass[-1] 40,40,1,1,0,2,0 +fx_map_sphere[-1] {w},{h},$Radius,0.5,0,$Border_smoothness,$Border_width,0,0,100,3 +fill_color[-2] $R_a,$V_a,$B_a +repeat $Color_Intensity +R_Couleur={round(u)*255} +V_Couleur={round(u)*255} +B_Couleur={round(u)*255} +X_point={round(u*w)} +Y_point={round(u*h)} +polygon[-2] 4,$X_point,$Y_point,$X_point,{$Y_point+$Color_Density},{$X_point+$Color_Density},{$Y_point+$Color_Density},{$X_point+$Color_Density},$Y_point,1,$R_Couleur,$V_Couleur,$B_Couleur,255 +done +fx_textured_glass[-2] 40,40,1,1,0,2,0 +fx_map_sphere[-2] {w},{h},$Radius,0.5,0,$Border_smoothness,$Border_width,0,0,100,3 +if $Merge_Layers==1 +samj_blend_20220419[-2,-1] add +fi +samj_Soft_Random_Shades : +R_a=$1 +V_a=$2 +B_a=$3 +A_a=$4 +Variation_A=$5 +Variation_B=$6 +Variation_C=$7 +Largeur={w} +Hauteur={h} +{$Largeur},{$Hauteur},1,4 +{$Largeur},{$Hauteur},1,4 +rm[-3] +fill_color[-1,-2] $R_a,$V_a,$B_a,$A_a +samj_Random_Plasma[-1] $Variation_A,$Variation_B +samj_blend_20220419[-1,-2] luminance +if $Variation_C==0 +else +{$Largeur},{$Hauteur},1,4 +{$Largeur},{$Hauteur},1,4 +fill_color[-1,-2] $R_a,$V_a,$B_a,$A_a +samj_Random_Plasma[-1] $Variation_A,$Variation_B +samj_blend_20220419[-1,-2] luminance +samj_blend_20220419[-1,-2] edges,{0.5+$Variation_C},0 +fi +crop[-1] 0,0,{$Largeur-8},{$Hauteur-1} +resize[-1] {$Largeur},{$Hauteur} +samj_rien_rendering : +Je_passe_l_hiver_en_Floride[-1] +samj_Steps_V2 : +Pixelise_X=$1 +Pixelise_Y=$2 +Area_Valeur=$3 +Area_is_high_connectivity=$4 +Isophotes_Valeur=$5 +Dilate_Circle_Valeur=$6 +Smoothness=$7 +BG=$8 +BG_Color=$9 +BG_Variation=$10 ++Je_passe_l_hiver_en_Floride[-1] +to_rgba[-1] +if $BG==1 ++Je_passe_l_hiver_en_Floride[-1] +fi +pixelize[-1,-2] $Pixelise_X,$Pixelise_Y +area[-1] $Area_Valeur,$Area_is_high_connectivity +c[-1] 0,255 +n[-1] 0,255 +isophotes[-1] $Isophotes_Valeur +dilate_circ[-1] $Dilate_Circle_Valeur +to_graya[-1] +fx_blend_edges[-1,-2] 1,$Smoothness,0 +if $BG==1 +blur[-2] {{w+h}/$BG_Variation} +pow[-2] $BG_Color +pixelize[-2] $Pixelise_X,$Pixelise_Y +samj_blend_20220419[-1,-2] alpha +fi +samj_Tissu_Fond_Flou : +X_Origine={round(w/100*$1)} +Y_Origine={round(h/100*$2)} +X_Fin={round(w/100*$3)} +Y_Fin={round(h/100*$4)} +Deplacement_A=$5 +Tissu=$6 +Forme=$7 +Blend_0pacity=$8 +Inversion=$9 +Angle_Rotation=$10 +Deplacement_B=$11 +Flou=$12 +Coeff_Flou=$13 +Largeur={w} +Hauteur={h} +at_line[-1] $X_Origine,$Y_Origine,0,$X_Fin,$X_Fin,0 +resize[-1] $Largeur,$Hauteur +to_rgb[-1] +if $Tissu==1 ++Je_passe_l_hiver_en_Floride[-1] +if $Forme==0 +permute[-1] yxzc +elif $Forme==1 +permute[-1] yxzc +mirror[-1] y +elif $Forme==2 +mirror[-2] x +permute[-1] yxzc +mirror[-1] y +elif $Forme==3 +mirror[-2] x +permute[-1] yxzc +fi +resize[-1] $Largeur,$Hauteur +if $Deplacement_B>0 shift[-1] 0,$Deplacement_B%,0,0,2 fi +if $Deplacement_A>0 shift[-2] $Deplacement_A%,0,0,0,2 fi +if $Inversion==1 rv[-2,-1] fi +samj_blend_20220419[-1,-2] average,$Blend_0pacity,0 +else +if $Deplacement_A>0 shift[-1] $Deplacement_A%,0,0,0,2 fi +fi +if $Angle_Rotation>0 rotate[-1] $Angle_Rotation,1,2,50%,50% fi +if $Flou>0 blur[-1] {$Flou*{10^$Coeff_Flou}} fi +samj_Tissu_Fond_Flou_preview : +foreach { +samj_Tissu_Fond_Flou[-1] $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13 +to_rgba +l[0] +line $1%,$2%,$3%,$4%,1,0xF0F0F0F0,255,255,255,255 +line $1%,$2%,$3%,$4%,1,0x0F0F0F0F,0,0,0,255 +circle $1%,$2%,4,1,255,0,0,255 +circle $3%,$4%,4,1,0,0,255,255 +circle $1%,$2%,4,1,0xFFFFFFFF,0,0,0,255 +circle $3%,$4%,4,1,0xFFFFFFFF,0,0,0,255 +done +} +samj_Variation_Stained_Glass : +to_rgba[-1] ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +stained_glass[-1] $6,{$7/1000},$8 +to_rgba[-1] +n[-1,-2] 0,255 +samj_Colored_Outlines[-2] $1,$2,$3,$4,$5,0,0,0,0 +samj_blend_20220419[-1,-2] alpha +blur[-2] {{w+h}/$10} +pow[-2] $9 +samj_blend_20220419[-1,-2] alpha +samj_Adjacent_Annular_Steiner_Chains : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Angle_inclinaison=$3 +Canal_Alpha=$4 +if $5>0 +Rayon_Cercle_Centre={round({w*$5/{100}})} +else +Rayon_Cercle_Centre={round({-h*$5/{100}})} +fi +Nb_Circles_Surrounding=$6 +Nb_Anneaux=$7 +Angle_Decalage=$8 +Variation_Increment_Anneaux=$9 +R_a=$10 +V_a=$11 +B_a=$12 +A_a=$13 +R_b=$14 +V_b=$15 +B_b=$16 +A_b=$17 +R_c=$18 +V_c=$19 +B_c=$20 +A_c=$21 +R_d=$22 +V_d=$23 +B_d=$24 +A_d=$25 +R_e=$26 +V_e=$27 +B_e=$28 +A_e=$29 +R_f=$30 +V_f=$31 +B_f=$32 +A_f=$33 +R_g=$34 +V_g=$35 +B_g=$36 +A_g=$37 +Rendu=$38 +Variations_Des_Couleurs=$39 +Couleurs_aleatoires=$40 +Affichage_Contours=$41 +R_Contours=$42 +V_Contours=$43 +B_Contours=$44 +A_Contours=$45 +Dilate_Contours=$46 +Flou_Contours=$47 +Sharpen_Contours=$48 +Largeur_Origine={w} +Hauteur_Origine={h} +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] 0,0,0,0 +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] 0,0,0,0 +Angle_Theta={pi/$Nb_Circles_Surrounding} +if $Rayon_Cercle_Centre<1 +Rayon_Cercle_Centre=1 +fi +Rayon_Cercle_Exterieur={$Rayon_Cercle_Centre*((1+(sin($Angle_Theta))))/(1-(sin($Angle_Theta)))} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre+$Rayon_Cercles_Ext} +Rayon_Tang={{{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}}^0.5} +Nb_boucles=0 +X_ext=0 +Y_ext=0 +Angle=0 +Angle_Decalage_En_Cours=0 +Nb_boucles_anneaux=0 +Rayon_Cercle_Centre_En_Cours=0 +Ra_en_cours=0 +Va_en_cours=0 +Ba_en_cours=0 +Aa_en_cours=0 +Suite_Couleurs=0 +if $Couleurs_aleatoires==1 +R_CE={round(u)*255} +V_CE={round(u)*255} +B_CE={round(u)*255} +R_PC={round(u)*255} +V_PC={round(u)*255} +B_PC={round(u)*255} +fi +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +R_b={round(u)*255} +V_b={round(u)*255} +B_b={round(u)*255} +R_c={round(u)*255} +V_c={round(u)*255} +B_c={round(u)*255} +R_d={round(u)*255} +V_d={round(u)*255} +B_d={round(u)*255} +R_e={round(u)*255} +V_e={round(u)*255} +B_e={round(u)*255} +R_f={round(u)*255} +V_f={round(u)*255} +B_f={round(u)*255} +R_g={round(u)*255} +V_g={round(u)*255} +B_g={round(u)*255} +fi +repeat $Nb_Anneaux +Nb_boucles=0 +Suite_Couleurs=0 +if $Couleurs_aleatoires==2 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +R_b={round(u)*255} +V_b={round(u)*255} +B_b={round(u)*255} +R_c={round(u)*255} +V_c={round(u)*255} +B_c={round(u)*255} +R_d={round(u)*255} +V_d={round(u)*255} +B_d={round(u)*255} +R_e={round(u)*255} +V_e={round(u)*255} +B_e={round(u)*255} +R_f={round(u)*255} +V_f={round(u)*255} +B_f={round(u)*255} +R_g={round(u)*255} +V_g={round(u)*255} +B_g={round(u)*255} +fi +Angle_Decalage_En_Cours={360/$Nb_Circles_Surrounding*$Angle_Decalage/100*$Nb_boucles_anneaux} +if $Nb_boucles_anneaux==0 +Rayon_Cercle_Centre_En_Cours={$Rayon_Cercle_Centre} +else +Rayon_Cercle_Centre_En_Cours={$Rayon_Tang+($Rayon_Cercles_Ext*(0.865+$Variation_Increment_Anneaux/100))} +fi +Rayon_Cercle_Exterieur=$Rayon_Cercle_Centre_En_Cours*{{1+{sin($Angle_Theta)}}}/{1-{sin($Angle_Theta)}} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre_En_Cours}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre_En_Cours+$Rayon_Cercles_Ext} +Rayon_Tang={{{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}}^0.5} +repeat $Nb_Circles_Surrounding +if $Couleurs_aleatoires==3 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +R_b={round(u)*255} +V_b={round(u)*255} +B_b={round(u)*255} +R_c={round(u)*255} +V_c={round(u)*255} +B_c={round(u)*255} +R_d={round(u)*255} +V_d={round(u)*255} +B_d={round(u)*255} +R_e={round(u)*255} +V_e={round(u)*255} +B_e={round(u)*255} +R_f={round(u)*255} +V_f={round(u)*255} +B_f={round(u)*255} +R_g={round(u)*255} +V_g={round(u)*255} +B_g={round(u)*255} +fi +if $Rendu==6 +if ($Nb_boucles%7)==0&&$Suite_Couleurs==0 +Ra_en_cours=$R_a +Va_en_cours=$V_a +Ba_en_cours=$B_a +Aa_en_cours=$A_a +Suite_Couleurs=1 +fi +if ($Nb_boucles%7)==1&&$Suite_Couleurs==1 +Ra_en_cours=$R_b +Va_en_cours=$V_b +Ba_en_cours=$B_b +Aa_en_cours=$A_b +Suite_Couleurs=2 +fi +if ($Nb_boucles%7)==2&&$Suite_Couleurs==2 +Ra_en_cours=$R_c +Va_en_cours=$V_c +Ba_en_cours=$B_c +Aa_en_cours=$A_c +Suite_Couleurs=3 +fi +if ($Nb_boucles%7)==3&&$Suite_Couleurs==3 +Ra_en_cours=$R_d +Va_en_cours=$V_d +Ba_en_cours=$B_d +Aa_en_cours=$A_d +Suite_Couleurs=4 +fi +if ($Nb_boucles%7)==4&&$Suite_Couleurs==4 +Ra_en_cours=$R_e +Va_en_cours=$V_e +Ba_en_cours=$B_e +Aa_en_cours=$A_e +Suite_Couleurs=5 +fi +if ($Nb_boucles%7)==5&&$Suite_Couleurs==5 +Ra_en_cours=$R_f +Va_en_cours=$V_f +Ba_en_cours=$B_f +Aa_en_cours=$A_f +Suite_Couleurs=6 +fi +if ($Nb_boucles%7)==6&&$Suite_Couleurs==6 +Ra_en_cours=$R_g +Va_en_cours=$V_g +Ba_en_cours=$B_g +Aa_en_cours=$A_g +Suite_Couleurs=0 +fi +fi +if $Rendu<6 +if ($Nb_boucles%2)==0 +Ra_en_cours=$R_a +Va_en_cours=$V_a +Ba_en_cours=$B_a +Aa_en_cours=$A_a +fi +if ($Nb_boucles%2)==1 +Ra_en_cours=$R_b +Va_en_cours=$V_b +Ba_en_cours=$B_b +Aa_en_cours=$A_b +fi +if ($Nb_boucles%3)==2&&$Rendu>0 +Ra_en_cours=$R_c +Va_en_cours=$V_c +Ba_en_cours=$B_c +Aa_en_cours=$A_c +fi +if ($Nb_boucles%4)==3&&$Rendu>1 +Ra_en_cours=$R_d +Va_en_cours=$V_d +Ba_en_cours=$B_d +Aa_en_cours=$A_d +fi +if ($Nb_boucles%5)==4&&$Rendu>2 +Ra_en_cours=$R_e +Va_en_cours=$V_e +Ba_en_cours=$B_e +Aa_en_cours=$A_e +fi +if ($Nb_boucles%6)==5&&$Rendu>3 +Ra_en_cours=$R_f +Va_en_cours=$V_f +Ba_en_cours=$B_f +Aa_en_cours=$A_f +fi +if ($Nb_boucles%7)==6&&$Rendu>4 +Ra_en_cours=$R_g +Va_en_cours=$V_g +Ba_en_cours=$B_g +Aa_en_cours=$A_g +fi +fi +Angle={$Nb_boucles*(360/$Nb_Circles_Surrounding)} +X_ext={$X+($Rayon_Centres_C_Ext*(cos((pi/180*($Angle+$Angle_inclinaison+$Angle_Decalage_En_Cours)))))} +Y_ext={$Y+($Rayon_Centres_C_Ext*(sin((pi/180*($Angle+$Angle_inclinaison+$Angle_Decalage_En_Cours)))))} +Nb_boucles+=1 +ellipse[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext,$Rayon_Cercles_Ext,0,1,$Ra_en_cours,$Va_en_cours,$Ba_en_cours,$Aa_en_cours +if $Affichage_Contours==1||$Affichage_Contours==2 +ellipse[-2] $X_ext,$Y_ext,$Rayon_Cercles_Ext,$Rayon_Cercles_Ext,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if {$Affichage_Contours==4||$Affichage_Contours==5}&&($Nb_boucles%2)==1 +ellipse[-2] $X_ext,$Y_ext,$Rayon_Cercles_Ext,$Rayon_Cercles_Ext,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +done +Nb_boucles_anneaux+=1 +done +if $Affichage_Contours==1||$Affichage_Contours==3||$Affichage_Contours==5 +ellipse[-2] $X,$Y,{$Rayon_Centres_C_Ext+$Rayon_Cercles_Ext},{$Rayon_Centres_C_Ext+$Rayon_Cercles_Ext},0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Dilate_Contours>1 dilate_circ[-2] $Dilate_Contours fi +if $Flou_Contours>0 blur[-2] $Flou_Contours,0 fi +if $Sharpen_Contours>0 sharpen[-2] $Sharpen_Contours fi +if $Variations_Des_Couleurs<0 *[-1] {abs($Variations_Des_Couleurs)} c[-1] 0,255 fi +samj_blend_20220419[-2,-1] alpha,1,1 +if $Variations_Des_Couleurs>0 *[-1] $Variations_Des_Couleurs c[-1] 0,255 fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Rectangles_Adjacents : +X_Haut_Gauche=$1 +Y_Haut_Gauche=$2 +X_Bas_Droite=$3 +Y_Bas_Droite=$4 +Type_Contact=$5 +Position_Contact=$6 +Nb_Rectangles=$7 +Type_n=$8 +Angle_inclinaison=$9 +R_Contours=$10 +V_Contours=$11 +B_Contours=$12 +A_Contours=$13 +Affichage_Contours=$14 +R_a=$15 +V_a=$16 +B_a=$17 +A_a=$18 +R_b=$19 +V_b=$20 +B_b=$21 +A_b=$22 +Couleurs_aleatoires=$23 +Inversions=$24 +Flou=$25 +Dilatation=$26 +Deformation=$27 +Bruit=$28 +Ombre=$29 +X_Ombre=$30 +Y_Ombre=$31 +Smoothness_Ombre=$32 +Curvature_Ombre=$33 +Compensation_Decalage_Ombre_X=$34 +Compensation_Decalage_Ombre_Y=$35 +Canal_Alpha=$36 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_boucles=0 +Dimension_Image_Rotation={round({{{{$Largeur_Origine*$Largeur_Origine}+{$Hauteur_Origine*$Hauteur_Origine}}^0.5}+2})} +Decalage_X={round({{$Dimension_Image_Rotation-$Largeur_Origine}/2})} +Decalage_Y={round({{$Dimension_Image_Rotation-$Hauteur_Origine}/2})} +X_H_G_origine={$Decalage_X+(round(($Largeur_Origine*($X_Haut_Gauche/100))))} +Y_H_G_origine={$Decalage_Y+(round(($Hauteur_Origine*($Y_Haut_Gauche/100))))} +Largeur_Rectangle_origine={round({$Largeur_Origine*{$X_Bas_Droite/100}})} +Hauteur_Rectangle_origine={round({$Hauteur_Origine*{$Y_Bas_Droite/100}})} +Largeur_A_Imprimer=$Largeur_Rectangle_origine +Hauteur_A_Imprimer=$Hauteur_Rectangle_origine +if $Type_Contact==0 +X_Contact={$X_H_G_origine+(round(($Largeur_Rectangle_origine*($Position_Contact/100))))} +Y_Contact=$Y_H_G_origine +elif $Type_Contact==1 +X_Contact={$X_H_G_origine+(round(($Largeur_Rectangle_origine*($Position_Contact/100))))} +Y_Contact={$Y_H_G_origine+$Hauteur_Rectangle_origine} +elif $Type_Contact==2 +X_Contact=$X_H_G_origine +Y_Contact={$Y_H_G_origine+(round(($Hauteur_Rectangle_origine*($Position_Contact/100))))} +elif $Type_Contact==3 +X_Contact={$X_H_G_origine+$Largeur_Rectangle_origine} +Y_Contact={$Y_H_G_origine+(round(($Hauteur_Rectangle_origine*($Position_Contact/100))))} +fi +X_H_G_A_Imprimer=$X_H_G_origine +Y_H_G_A_Imprimer=$Y_H_G_origine +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Affichage_Contours==1 +$Dimension_Image_Rotation,$Dimension_Image_Rotation,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Dimension_Image_Rotation-1},0,{$Dimension_Image_Rotation-1},{$Dimension_Image_Rotation-1},0,{$Dimension_Image_Rotation-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Dimension_Image_Rotation,$Dimension_Image_Rotation,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Dimension_Image_Rotation-1},0,{$Dimension_Image_Rotation-1},{$Dimension_Image_Rotation-1},0,{$Dimension_Image_Rotation-1},1,0xFFFFFFFF,0,0,0,1 fi +repeat $Nb_Rectangles +Nb_boucles+=1 +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +R_b={round(u)*255} +V_b={round(u)*255} +B_b={round(u)*255} +fi +if ($Nb_boucles%2)==0 +polygon[-1] 4,$X_H_G_A_Imprimer,$Y_H_G_A_Imprimer,{$X_H_G_A_Imprimer+$Largeur_A_Imprimer},$Y_H_G_A_Imprimer,{$X_H_G_A_Imprimer+$Largeur_A_Imprimer},{$Y_H_G_A_Imprimer+$Hauteur_A_Imprimer},$X_H_G_A_Imprimer,{$Y_H_G_A_Imprimer+$Hauteur_A_Imprimer},1,$R_a,$V_a,$B_a,$A_a +else +polygon[-1] 4,$X_H_G_A_Imprimer,$Y_H_G_A_Imprimer,{$X_H_G_A_Imprimer+$Largeur_A_Imprimer},$Y_H_G_A_Imprimer,{$X_H_G_A_Imprimer+$Largeur_A_Imprimer},{$Y_H_G_A_Imprimer+$Hauteur_A_Imprimer},$X_H_G_A_Imprimer,{$Y_H_G_A_Imprimer+$Hauteur_A_Imprimer},1,$R_b,$V_b,$B_b,$A_b +fi +if $Affichage_Contours==1 +polygon[-2] 4,$X_H_G_A_Imprimer,$Y_H_G_A_Imprimer,{$X_H_G_A_Imprimer+$Largeur_A_Imprimer},$Y_H_G_A_Imprimer,{$X_H_G_A_Imprimer+$Largeur_A_Imprimer},{$Y_H_G_A_Imprimer+$Hauteur_A_Imprimer},$X_H_G_A_Imprimer,{$Y_H_G_A_Imprimer+$Hauteur_A_Imprimer},1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Type_n==0 +Largeur_A_Imprimer={$Largeur_Rectangle_origine/($Nb_boucles+1)} +Hauteur_A_Imprimer={$Hauteur_Rectangle_origine/($Nb_boucles+1)} +elif $Type_n==1 +Largeur_A_Imprimer*=0.9 +Hauteur_A_Imprimer*=0.9 +elif $Type_n==2 +Largeur_A_Imprimer*=0.8 +Hauteur_A_Imprimer*=0.8 +elif $Type_n==3 +Largeur_A_Imprimer*=0.7 +Hauteur_A_Imprimer*=0.7 +elif $Type_n==4 +Largeur_A_Imprimer*=u(0.7,0.9) +Hauteur_A_Imprimer*=u(0.7,0.9) +elif $Type_n==5 +Largeur_A_Imprimer={$Largeur_Rectangle_origine/($Nb_boucles+1)} +Hauteur_A_Imprimer*=0.9 +elif $Type_n==6 +Largeur_A_Imprimer*=0.9 +Hauteur_A_Imprimer={$Hauteur_Rectangle_origine/($Nb_boucles+1)} +fi +if $Type_Contact==0 +X_H_G_A_Imprimer={$X_Contact-($Largeur_A_Imprimer/2)} +Y_H_G_A_Imprimer=$Y_Contact +elif $Type_Contact==1 +X_H_G_A_Imprimer={$X_Contact-($Largeur_A_Imprimer/2)} +Y_H_G_A_Imprimer={$Y_Contact-$Hauteur_A_Imprimer} +elif $Type_Contact==2 +X_H_G_A_Imprimer=$X_Contact +Y_H_G_A_Imprimer={$Y_Contact-($Hauteur_A_Imprimer/2)} +elif $Type_Contact==3 +X_H_G_A_Imprimer={$X_Contact-$Largeur_A_Imprimer} +Y_H_G_A_Imprimer={$Y_Contact-($Hauteur_A_Imprimer/2)} +fi +done +if $Affichage_Contours==1 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +if $Angle_inclinaison>0 rotate[-1] $Angle_inclinaison,1,0,{w/2},{h/2} fi +crop[-1] {{w-$Largeur_Origine}/2},{{h-$Hauteur_Origine}/2},{$Largeur_Origine+{{w-$Largeur_Origine-1}/2}-1},{$Hauteur_Origine+{{h-$Hauteur_Origine-1}/2}-1} +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Annular_Steiner_Chains : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +if $3>0 +Rayon_Cercle_Exterieur={round({w*$3/{100}})} +else +Rayon_Cercle_Exterieur={round({-h*$3/{100}})} +fi +Nb_Circles_Surrounding=$4 +Angle_inclinaison=$5 +R_Contours=$6 +V_Contours=$7 +B_Contours=$8 +A_Contours=$9 +Affichage_Contours=$10 +R_CE=$11 +V_CE=$12 +B_CE=$13 +A_CE=$14 +R_PC=$15 +V_PC=$16 +B_PC=$17 +A_PC=$18 +R_c=$19 +V_c=$20 +B_c=$21 +A_c=$22 +R_d=$23 +V_d=$24 +B_d=$25 +A_d=$26 +Couleurs_aleatoires=$27 +Inversions=$28 +Flou=$29 +Dilatation=$30 +Deformation=$31 +Bruit=$32 +Ombre=$33 +X_Ombre=$34 +Y_Ombre=$35 +Smoothness_Ombre=$36 +Curvature_Ombre=$37 +Compensation_Decalage_Ombre_X=$38 +Compensation_Decalage_Ombre_Y=$39 +Canal_Alpha=$40 +Largeur_Origine={w} +Hauteur_Origine={h} +Angle_Theta={pi/$Nb_Circles_Surrounding} +Rayon_Cercle_Centre={{$Rayon_Cercle_Exterieur*{1-{sin($Angle_Theta)}}}/{{1+{sin($Angle_Theta)}}}} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre+$Rayon_Cercles_Ext} +Rayon_Tang={{{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}}^0.5} +Nb_boucles=0 +X_ext=0 +Y_ext=0 +Angle=0 +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Couleurs_aleatoires==1 +R_CE={round(u)*255} +V_CE={round(u)*255} +B_CE={round(u)*255} +R_PC={round(u)*255} +V_PC={round(u)*255} +B_PC={round(u)*255} +fi +if $Affichage_Contours>0 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +if $Affichage_Contours==1||$Affichage_Contours==2||$Affichage_Contours==3||$Affichage_Contours==4||$Affichage_Contours==5 +ellipse[-1] $X,$Y,$Rayon_Cercle_Exterieur,$Rayon_Cercle_Exterieur,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Affichage_Contours==1||$Affichage_Contours==2||$Affichage_Contours==3||$Affichage_Contours==4||$Affichage_Contours==6 +ellipse[-1] $X,$Y,$Rayon_Cercle_Centre,$Rayon_Cercle_Centre,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Affichage_Contours==2||$Affichage_Contours==3 +ellipse[-1] $X,$Y,$Rayon_Centres_C_Ext,$Rayon_Centres_C_Ext,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Affichage_Contours==3||$Affichage_Contours==4 +ellipse[-1] $X,$Y,$Rayon_Tang,$Rayon_Tang,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +ellipse[-1] $X,$Y,$Rayon_Cercle_Exterieur,$Rayon_Cercle_Exterieur,0,1,$R_CE,$V_CE,$B_CE,$A_CE +ellipse[-1] $X,$Y,$Rayon_Cercle_Centre,$Rayon_Cercle_Centre,0,1,$R_PC,$V_PC,$B_PC,$A_PC +repeat $Nb_Circles_Surrounding +Angle={$Nb_boucles*(360/$Nb_Circles_Surrounding)} +X_ext={$X+($Rayon_Centres_C_Ext*(cos((pi/180*($Angle+$Angle_inclinaison)))))} +Y_ext={$Y+($Rayon_Centres_C_Ext*(sin((pi/180*($Angle+$Angle_inclinaison)))))} +Nb_boucles+=1 +if $Couleurs_aleatoires==1 +R_c={round(u)*255} +V_c={round(u)*255} +B_c={round(u)*255} +R_d={round(u)*255} +V_d={round(u)*255} +B_d={round(u)*255} +fi +if ($Nb_Circles_Surrounding%2)==0 +if ($Nb_boucles%2)==0 +ellipse[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext,$Rayon_Cercles_Ext,0,1,$R_c,$V_c,$B_c,$A_c +else +ellipse[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext,$Rayon_Cercles_Ext,0,1,$R_d,$V_d,$B_d,$A_d +fi +else +ellipse[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext,$Rayon_Cercles_Ext,0,1,$R_c,$V_c,$B_c,$A_c +fi +if $Affichage_Contours>0 +ellipse[-2] $X_ext,$Y_ext,$Rayon_Cercles_Ext,$Rayon_Cercles_Ext,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +done +if $Affichage_Contours>0 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Chains_Solidify : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Angle_inclinaison=$3 +if $4>0 +Rayon_Cercle_Centre={round({w*$4/{100}})} +else +Rayon_Cercle_Centre={round({-h*$4/{100}})} +fi +Nb_Circles_Surrounding=$5 +Nb_Anneaux=$6 +Angle_Decalage=$7 +Variation_Increment_Anneaux=$8 +R_a=$9 +V_a=$10 +B_a=$11 +A_a=$12 +R_b=$13 +V_b=$14 +B_b=$15 +A_b=$16 +R_c=$17 +V_c=$18 +B_c=$19 +A_c=$20 +R_d=$21 +V_d=$22 +B_d=$23 +A_d=$24 +R_e=$25 +V_e=$26 +B_e=$27 +A_e=$28 +R_f=$29 +V_f=$30 +B_f=$31 +A_f=$32 +R_g=$33 +V_g=$34 +B_g=$35 +A_g=$36 +Rendu=$37 +R_centre=$38 +V_centre=$39 +B_centre=$40 +A_centre=$41 +R_Fond=$42 +V_Fond=$43 +B_Fond=$44 +A_Fond=$45 +Effet=$46 +Largeur_Origine={w} +Hauteur_Origine={h} +rm[0] +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] 0,0,0,0 ++Je_passe_l_hiver_en_Floride[-1] +Angle_Theta={pi/$Nb_Circles_Surrounding} +if $Rayon_Cercle_Centre<1 +Rayon_Cercle_Centre=1 +fi +Rayon_Cercle_Exterieur={$Rayon_Cercle_Centre*((1+(sin($Angle_Theta))))/(1-(sin($Angle_Theta)))} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre+$Rayon_Cercles_Ext} +Rayon_Tang={{{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}}^0.5} +Nb_boucles=0 +X_ext=0 +Y_ext=0 +Angle=0 +Angle_Decalage_En_Cours=0 +Nb_boucles_anneaux=0 +Rayon_Cercle_Centre_En_Cours=0 +Ra_en_cours=0 +Va_en_cours=0 +Ba_en_cours=0 +Aa_en_cours=0 +Suite_Couleurs=0 +point[-1] $X,$Y,0,1,$R_centre,$V_centre,$B_centre,$A_centre +repeat $Nb_Anneaux +Nb_boucles=0 +Suite_Couleurs=0 +Angle_Decalage_En_Cours={360/$Nb_Circles_Surrounding*$Angle_Decalage/100*$Nb_boucles_anneaux} +if $Nb_boucles_anneaux==0 +Rayon_Cercle_Centre_En_Cours={$Rayon_Cercle_Centre} +else +Rayon_Cercle_Centre_En_Cours={$Rayon_Tang+($Rayon_Cercles_Ext*(0.865+$Variation_Increment_Anneaux/100))} +fi +Rayon_Cercle_Exterieur=$Rayon_Cercle_Centre_En_Cours*{{1+{sin($Angle_Theta)}}}/{1-{sin($Angle_Theta)}} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre_En_Cours}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre_En_Cours+$Rayon_Cercles_Ext} +Rayon_Tang={{{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}}^0.5} +repeat $Nb_Circles_Surrounding +if $Rendu==6 +if ($Nb_boucles%7)==0&&$Suite_Couleurs==0 +Ra_en_cours=$R_a +Va_en_cours=$V_a +Ba_en_cours=$B_a +Aa_en_cours=$A_a +Suite_Couleurs=1 +fi +if ($Nb_boucles%7)==1&&$Suite_Couleurs==1 +Ra_en_cours=$R_b +Va_en_cours=$V_b +Ba_en_cours=$B_b +Aa_en_cours=$A_b +Suite_Couleurs=2 +fi +if ($Nb_boucles%7)==2&&$Suite_Couleurs==2 +Ra_en_cours=$R_c +Va_en_cours=$V_c +Ba_en_cours=$B_c +Aa_en_cours=$A_c +Suite_Couleurs=3 +fi +if ($Nb_boucles%7)==3&&$Suite_Couleurs==3 +Ra_en_cours=$R_d +Va_en_cours=$V_d +Ba_en_cours=$B_d +Aa_en_cours=$A_d +Suite_Couleurs=4 +fi +if ($Nb_boucles%7)==4&&$Suite_Couleurs==4 +Ra_en_cours=$R_e +Va_en_cours=$V_e +Ba_en_cours=$B_e +Aa_en_cours=$A_e +Suite_Couleurs=5 +fi +if ($Nb_boucles%7)==5&&$Suite_Couleurs==5 +Ra_en_cours=$R_f +Va_en_cours=$V_f +Ba_en_cours=$B_f +Aa_en_cours=$A_f +Suite_Couleurs=6 +fi +if ($Nb_boucles%7)==6&&$Suite_Couleurs==6 +Ra_en_cours=$R_g +Va_en_cours=$V_g +Ba_en_cours=$B_g +Aa_en_cours=$A_g +Suite_Couleurs=0 +fi +fi +if $Rendu<6 +if {$Nb_boucles%2}==0 +Ra_en_cours=$R_a +Va_en_cours=$V_a +Ba_en_cours=$B_a +Aa_en_cours=$A_a +fi +if {$Nb_boucles%2}==1 +Ra_en_cours=$R_b +Va_en_cours=$V_b +Ba_en_cours=$B_b +Aa_en_cours=$A_b +fi +if {$Nb_boucles%3}==2&&$Rendu>0 +Ra_en_cours=$R_c +Va_en_cours=$V_c +Ba_en_cours=$B_c +Aa_en_cours=$A_c +fi +if {$Nb_boucles%4}==3&&$Rendu>1 +Ra_en_cours=$R_d +Va_en_cours=$V_d +Ba_en_cours=$B_d +Aa_en_cours=$A_d +fi +if {$Nb_boucles%5}==4&&$Rendu>2 +Ra_en_cours=$R_e +Va_en_cours=$V_e +Ba_en_cours=$B_e +Aa_en_cours=$A_e +fi +if {$Nb_boucles%6}==5&&$Rendu>3 +Ra_en_cours=$R_f +Va_en_cours=$V_f +Ba_en_cours=$B_f +Aa_en_cours=$A_f +fi +if {$Nb_boucles%7}==6&&$Rendu>4 +Ra_en_cours=$R_g +Va_en_cours=$V_g +Ba_en_cours=$B_g +Aa_en_cours=$A_g +fi +fi +Angle={$Nb_boucles*(360/$Nb_Circles_Surrounding)} +X_ext={$X+($Rayon_Centres_C_Ext*(cos((pi/180*($Angle+$Angle_inclinaison+$Angle_Decalage_En_Cours)))))} +Y_ext={$Y+($Rayon_Centres_C_Ext*(sin((pi/180*($Angle+$Angle_inclinaison+$Angle_Decalage_En_Cours)))))} +Nb_boucles+=1 +ellipse[-2] $X_ext,$Y_ext,{$Rayon_Cercles_Ext/100*$Effet},{$Rayon_Cercles_Ext/100*$Effet},0,1,0xFFFFFFFF,$R_Fond,$V_Fond,$B_Fond,$A_Fond +point[-1] $X_ext,$Y_ext,0,1,$Ra_en_cours,$Va_en_cours,$Ba_en_cours,$Aa_en_cours +done +Nb_boucles_anneaux+=1 +done +ellipse[-2] $X,$Y,{$Rayon_Centres_C_Ext+$Rayon_Cercles_Ext},{$Rayon_Centres_C_Ext+$Rayon_Cercles_Ext},0,1,0xFFFFFFFF,$R_Fond,$V_Fond,$B_Fond,$A_Fond +samj_blend_20220419[-1,-2] alpha +solidify[-1] +samj_Noel_2016 : +x={round(w/100*$1)} +y={round(h/100*$2)} +rayonA={w/1000*$3} +rayonB={w/1000*$4} +depth_max=$5 +fil=$6 +R_DT=$7 +V_DT=$8 +B_DT=$9 +A_DT=$10 +Variation_Couleur=$11 +K_espacement=$12 +Type_Rendu=$13 +Ball_Specular_light=$14 +Ball_Specular_size=$15 +Ball_Shadow=$16 +Ball_Angle=$17 +Rotation=$18 +Validation_Smooth_Antialias=$19 +V_Amplitude=$20 +V_Edge_Threshold=$21 +V_Smoothness=$22 +depth=0 +L_Origine={w} +H_Origine={h} +to_rgba[-1] +$L_Origine,$H_Origine,1,4 +samj_guirlande[-1] $x,$y,$rayonA,$rayonB,$depth,$depth_max,$fil,$R_DT,$V_DT,$B_DT,$A_DT,$Variation_Couleur,$K_espacement,$L_Origine,$H_Origine,$Type_Rendu,$Ball_Specular_light,$Ball_Specular_size,$Ball_Shadow,$Ball_Angle +if $Rotation!=0 rotate[-1] $Rotation fi +if $Validation_Smooth_Antialias==1 fx_smooth_antialias[-1] $V_Amplitude,$V_Edge_Threshold,$V_Smoothness fi +samj_blend_20220419[-1,-2] alpha +samj_guirlande : +x=$1 +y=$2 +rayonA=$3 +rayonB=$4 +depth=$5 +depth_max=$6 +fil=$7 +R_DT=$8 +V_DT=$9 +B_DT=$10 +A_DT=$11 +Variation_Couleur=$12 +K_espacement=$13 +L_Origine=$14 +H_Origine=$15 +Type_Rendu=$16 +Ball_Specular_light=$17 +Ball_Specular_size=$18 +Ball_Shadow=$19 +Ball_Angle=$20 +if $depth<$depth_max&&$rayonA>1&&$rayonB>1 +if $Type_Rendu==0 +ellipse[-1] $x,$y,$rayonA,$rayonB,1,1,$R_DT,$V_DT,$B_DT,$A_DT +elif $Type_Rendu==1 +$L_Origine,$H_Origine,1,4 +ellipse[-1] $x,$y,$rayonA,$rayonB,1,1,$R_DT,$V_DT,$B_DT,$A_DT +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +elif $Type_Rendu==2 +$L_Origine,$H_Origine,1,4 +ball {$rayonA*2},$R_DT,$V_DT,$B_DT,$Ball_Specular_light,$Ball_Specular_size,$Ball_Shadow +rotate[-1] $Ball_Angle +autocrop[-1] 0 +samj_blend_20220419[-1,-2] alpha +shift[-1] {-1*{{$L_Origine/2}-$x}},{$y-{$H_Origine/2}},0,0,0 +samj_blend_20220419[-1,-2] alpha +elif $Type_Rendu==3 +$L_Origine,$H_Origine,1,4 +$L_Origine,$H_Origine,1,4 +ball {$rayonA*2},$R_DT,$V_DT,$B_DT,$Ball_Specular_light,$Ball_Specular_size,$Ball_Shadow +rotate[-1] $Ball_Angle +autocrop[-1] 0 +samj_blend_20220419[-1,-2] alpha +shift[-1] {-1*{{$L_Origine/2}-$x}},{$y-{$H_Origine/2}},0,0,0 +samj_blend_20220419[-1,-2] alpha +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +fi +R_DT+=$Variation_Couleur +V_DT+=$Variation_Couleur +B_DT+=$Variation_Couleur +if $R_DT>255 +R_DT={255-{$Variation_Couleur*{$depth_max-$depth}}} +fi +if $V_DT>255 +V_DT={255-{$Variation_Couleur*{$depth_max-$depth}}} +fi +if $B_DT>255 +B_DT={255-{$Variation_Couleur*{$depth_max-$depth}}} +fi +if $R_DT<0 +R_DT+=$Variation_Couleur+{$Variation_Couleur*{$depth_max-$depth}} +fi +if $V_DT<0 +V_DT+=$Variation_Couleur+{$Variation_Couleur*{$depth_max-$depth}} +fi +if $B_DT<0 +B_BT={$B_DT+$Variation_Couleur+($Variation_Couleur*($depth_max-$depth))} +fi +samj_guirlande[-1] {$x+{$rayonA*$K_espacement}},$y,{$rayonA/2},{$rayonB/2},{$depth+1},$depth_max,$fil,$R_DT,$V_DT,$B_DT,$A_DT,$Variation_Couleur,$K_espacement,$L_Origine,$H_Origine,$Type_Rendu,$Ball_Specular_light,$Ball_Specular_size,$Ball_Shadow,$Ball_Angle +samj_guirlande[-1] {$x-{$rayonA*$K_espacement}},$y,{$rayonA/2},{$rayonB/2},{$depth+1},$depth_max,$fil,$R_DT,$V_DT,$B_DT,$A_DT,$Variation_Couleur,$K_espacement,$L_Origine,$H_Origine,$Type_Rendu,$Ball_Specular_light,$Ball_Specular_size,$Ball_Shadow,$Ball_Angle +if $fil==1 +$L_Origine,$H_Origine,1,4 +line[-1] {$x+{$rayonA*$K_espacement}},$y,{$x-{$rayonA*2.5}},$y,1,$R_DT,$V_DT,$B_DT,$A_DT +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +fi +fi +samj_Chryzodes : +Dimension={round({{max(w,h)}*$1/100})} +R_fond=$2 +V_fond=$3 +B_fond=$4 +A_fond=$5 +Demo=$6 +X={round({$Dimension*{$7/100}})} +Y={round({$Dimension*{$8/100}})} +Rayon_Cercle={round($Dimension*$9/100)} +Nb_Points=$10 +Multiplicateur=$11 +Premier_Point=$12 +R_l=$13 +V_l=$14 +B_l=$15 +A_l=$16 +Angle_Inclinaison=$17 +Type_De_Lignes=$18 +Couleurs_aleatoires=$19 +Variations_A=$20 +Variations_B=$21 +Variations_C=$22 +Flou=$23 +Dilatation=$24 +Deformation=$25 +Bruit=$26 +Tracer_Cercle=$27 +if $Demo==1 +Nb_Points=431 +Multiplicateur=7 +Variations_A=0 +Variations_B=0 +Variations_C=0 +elif $Demo==2 +Nb_Points=353 +Multiplicateur=3 +Variations_A=0 +Variations_B=0 +Variations_C=0 +elif $Demo==3 +Nb_Points=619 +Multiplicateur=4 +Variations_A=0 +Variations_B=0 +Variations_C=0 +elif $Demo==4 +Nb_Points=691 +Multiplicateur=12 +Variations_A=0 +Variations_B=0 +Variations_C=0 +elif $Demo==5 +Nb_Points=613 +Multiplicateur=20 +Variations_A=0 +Variations_B=0 +Variations_C=0 +elif $Demo==6 +Nb_Points=358 +Multiplicateur=13 +Variations_A=0 +Variations_B=0 +Variations_C=1 +elif $Demo==7 +Nb_Points=118 +Multiplicateur=20 +Variations_A=0 +Variations_B=0 +Variations_C=1 +elif $Demo==8 +Nb_Points=699 +Multiplicateur=6 +Variations_A=0 +Variations_B=0 +Variations_C=0 +Demo=8 +fi +Largeur_Origine={w} +Hauteur_Origine={h} +Angle_Base={360/$Nb_Points} +Point_Origine=0 +Sortie_Boucle_Lignes=0 +Nb_Boucle_Lignes=0 +Nb_Boucle_Points=0 +Point_A=0 +Angle_A=0 +X_Imp_A=0 +Y_Imp_A=0 +Point_B=0 +Angle_B=0 +X_Imp_B=0 +Y_Imp_B=0 +a_Ligne=0 +b_Ligne=0 +X_Ex_a=0 +Y_Ex_a=0 +X_Ex_b=0 +Y_Ex_b=0 +if $Variations_A==0 +Boucles_Rendu=1 +Variations_A=1 +else +Boucles_Rendu=2 +fi +rm[-1] +$Dimension,$Dimension,1,4 +fill_color[-1] 0,0,0,0 +Point_A=$Premier_Point +Angle_A={$Angle_Base*$Point_A} +X_Imp_A={$X+($Rayon_Cercle*(cos((pi/180*($Angle_A+$Angle_Inclinaison)))))} +Y_Imp_A={$Y+($Rayon_Cercle*(sin((pi/180*($Angle_A+$Angle_Inclinaison)))))} +Point_Origine=$Point_A +test=0 +repeat $Boucles_Rendu+$Variations_B +if $Couleurs_aleatoires==1 +R_l={round(u)*255} +V_l={round(u)*255} +B_l={round(u)*255} +fi +do +if $Couleurs_aleatoires==2 +R_l={round(u)*255} +V_l={round(u)*255} +B_l={round(u)*255} +fi +if $Variations_C==0 +Point_B={{$Point_A*$Multiplicateur}%$Nb_Points} +else +Point_B={{$Point_A*$Multiplicateur*2}%$Nb_Points} +fi +Angle_B={$Angle_Base*$Point_B} +X_Imp_B={$X+($Rayon_Cercle*(cos((pi/180*($Angle_B+$Angle_Inclinaison)))))} +Y_Imp_B={$Y+($Rayon_Cercle*(sin((pi/180*($Angle_B+$Angle_Inclinaison)))))} +if $Type_De_Lignes==1 +if {round($X_Imp_A*1000000000000)}=={round($X_Imp_B*1000000000000)} +X_Ex_a=$X_Imp_A +Y_Ex_a=0 +X_Ex_b=$X_Imp_B +Y_Ex_b={$Dimension-1} +line[-1] $X_Ex_a,$Y_Ex_a,$X_Ex_b,$Y_Ex_b,1,$R_l,$V_l,$B_l,$A_l +else +a_Ligne={{$Y_Imp_B-$Y_Imp_A}/{$X_Imp_B-$X_Imp_A}} +b_Ligne={$Y_Imp_B-($a_Ligne*$X_Imp_B)} +X_Ex_a=0 +Y_Ex_a=$b_Ligne +X_Ex_b={$Dimension-1} +Y_Ex_b={{$a_Ligne*$X_Ex_b}+$b_Ligne} +line[-1] $X_Ex_a,$Y_Ex_a,$X_Ex_b,$Y_Ex_b,1,$R_l,$V_l,$B_l,$A_l +fi +else +line[-1] $X_Imp_A,$Y_Imp_A,$X_Imp_B,$Y_Imp_B,1,$R_l,$V_l,$B_l,$A_l +fi +if $Point_B==$Point_Origine Sortie_Boucle_Lignes=1 fi +if $Nb_Boucle_Lignes>$Nb_Points*$Multiplicateur Sortie_Boucle_Lignes=1 fi +if $Variations_C==1 +if $Nb_Boucle_Lignes>$Nb_Points Sortie_Boucle_Lignes=1 fi +fi +Point_A=$Point_B +X_Imp_A=$X_Imp_B +Y_Imp_A=$Y_Imp_B +Nb_Boucle_Lignes+=1 +while $Sortie_Boucle_Lignes==0 +Nb_Boucle_Points+=1 +Point_A={$Premier_Point+(1/$Nb_Points*$Nb_Boucle_Points/$Variations_A)} +Angle_A={$Angle_Base*$Point_A} +X_Imp_A={$X+($Rayon_Cercle*(cos((pi/180*($Angle_A+$Angle_Inclinaison)))))} +Y_Imp_A={$Y+($Rayon_Cercle*(sin((pi/180*($Angle_A+$Angle_Inclinaison)))))} +Point_Origine=$Point_A +Sortie_Boucle_Lignes=0 +Nb_Boucle_Lignes=0 +done +if $Tracer_Cercle==1 +ellipse[-1] $X,$Y,$Rayon_Cercle,$Rayon_Cercle,0,1,0xFFFFFFFF,$R_l,$V_l,$B_l,$A_l +fi +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +$Dimension,$Dimension,1,4 +fill_color[-1] $R_fond,$V_fond,$B_fond,$A_fond +gimp_blend_1651[-2,-1] 1,0,1,0,1 +samj_Contour_Line_Laser_LED : +to_rgba[-1] +if $3==1 +Largeur={w} +Hauteur={h} +expand_x[-1] {$2+$2},0 +expand_y[-1] {$2+$2},0 +replace_color[-1] 1%,0,0,0,0,0,255,255,255,255 +fi +if $1>0 +if $1==1 +erode_circ[-1] {$2+1} +elif $1==2 +erode_circ[-1] {$2+1} +dilate_circ[-1] {$2+1} +elif $1==3 +erode_circ[-1] {$2+$2+1} +dilate_circ[-1] {$2+1} +fi +replace_color[-1] 70%,0,0,0,0,255,0,0,0,255 +fi +if $3==1 +autocrop[-1] +expand_x[-1] {$Largeur/100},0 +expand_y[-1] {$Hauteur/100},0 +replace_color[-1] 1%,0,0,0,0,0,255,255,255,255 +fi +samj_dessiner_un_polygone: +Nombre_de_cotes=$1 +X_centre_cercle_circonscrit={$2/100*w} +Y_centre_cercle_circonscrit={$3/100*h} +Angle_inclinaison=$4 +if $5>0 +Rayon_cercle_circonscrit={round({w*$5/{100}})} +else +Rayon_cercle_circonscrit={round({-h*$5/{100}})} +fi +Rayon_cercle_interieur={round($Rayon_cercle_circonscrit/100*$6)} +Remplir_polygone_exterieur=$7 +R_Couleur_polygone_exterieur=$8 +V_Couleur_polygone_exterieur=$9 +B_Couleur_polygone_exterieur=$10 +Contour_polygone_exterieur=$11 +R_Couleur_contour_polygone_exterieur=$12 +V_Couleur_contour_polygone_exterieur=$13 +B_Couleur_contour_polygone_exterieur=$14 +Remplir_polygone_interieur=$15 +R_Couleur_polygone_interieur=$16 +V_Couleur_polygone_interieur=$17 +B_Couleur_polygone_interieur=$18 +Contour_polygone_interieur=$19 +R_Couleur_contour_polygone_interieur=$20 +V_Couleur_contour_polygone_interieur=$21 +B_Couleur_contour_polygone_interieur=$22 +Variation_de_couleur=$23 +Remplir_cercle_interieur=$24 +R_CI_plein=$25 +V_CI_plein=$26 +B_CI_plein=$27 +Contour_cercle_interieur=$28 +R_CI_contour=$29 +V_CI_contour=$30 +B_CI_contour=$31 +Remplir_cercle_exterieur=$32 +R_CE_plein=$33 +V_CE_plein=$34 +B_CE_plein=$35 +Contour_cercle_exterieur=$36 +R_CE_contour=$37 +V_CE_contour=$38 +B_CE_contour=$39 +Valeur_dilate_circ=$40 +Transparence_des_couleurs=$41 +Flou_polygone=$42 +Spread_polygone=$43 +Deform_polygone=$44 +blend=$45 +{w},{h},1,4 +fill_color[-1] 0,0,0,0 +if $Remplir_cercle_exterieur==1 +ellipse[-1] $X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$Rayon_cercle_circonscrit,$Rayon_cercle_circonscrit,0,1,$R_CE_plein,$V_CE_plein,$B_CE_plein,$Transparence_des_couleurs +fi +if $Contour_cercle_exterieur==1 +ellipse[-1] $X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$Rayon_cercle_circonscrit,$Rayon_cercle_circonscrit,0,1,0xFFFFFF,$R_CE_contour,$V_CE_contour,$B_CE_contour,$Transparence_des_couleurs +fi +Increment_angle={360/$Nombre_de_cotes} +Nb_boucle=$Nombre_de_cotes +do +if $Variation_de_couleur==0 +X_point_exterieur={$X_centre_cercle_circonscrit+(round(($Rayon_cercle_circonscrit*(cos((pi/180*($Increment_angle+$Angle_inclinaison+(360/$Nombre_de_cotes))))))))} +Y_point_exterieur={$Y_centre_cercle_circonscrit+(round(($Rayon_cercle_circonscrit*(sin((pi/180*($Increment_angle+$Angle_inclinaison+(360/$Nombre_de_cotes))))))))} +X_point_interieur={$X_centre_cercle_circonscrit+(round(($Rayon_cercle_interieur*(cos((pi/180*($Increment_angle+$Angle_inclinaison+(360/$Nombre_de_cotes))))))))} +Y_point_interieur={$Y_centre_cercle_circonscrit+(round(($Rayon_cercle_interieur*(sin((pi/180*($Increment_angle+$Angle_inclinaison+(360/$Nombre_de_cotes))))))))} +if $Nb_boucle==$Nombre_de_cotes +Points_polygone_exterieur=$X_point_exterieur,$Y_point_exterieur +Points_polygone_interieur=$X_point_interieur,$Y_point_interieur +else +Points_polygone_exterieur=$Points_polygone_exterieur,$X_point_exterieur,$Y_point_exterieur +Points_polygone_interieur=$Points_polygone_interieur,$X_point_interieur,$Y_point_interieur +fi +if $Nb_boucle==1 +if $Remplir_polygone_exterieur==1 +polygon[-1] $Nombre_de_cotes,$Points_polygone_exterieur,1,$R_Couleur_polygone_exterieur,$V_Couleur_polygone_exterieur,$B_Couleur_polygone_exterieur,$Transparence_des_couleurs +fi +if $Contour_polygone_exterieur==1 +polygon[-1] $Nombre_de_cotes,$Points_polygone_exterieur,1,0xFFFFFF,$R_Couleur_contour_polygone_exterieur,$V_Couleur_contour_polygone_exterieur,$B_Couleur_contour_polygone_exterieur,$Transparence_des_couleurs +fi +if $Remplir_cercle_interieur==1 +ellipse[-1] $X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$Rayon_cercle_interieur,$Rayon_cercle_interieur,0,1,$R_CI_plein,$V_CI_plein,$B_CI_plein,$Transparence_des_couleurs +fi +if $Contour_cercle_interieur==1 +ellipse[-1] $X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$Rayon_cercle_interieur,$Rayon_cercle_interieur,0,1,0xFFFFFF,$R_CI_contour,$V_CI_contour,$B_CI_contour,$Transparence_des_couleurs +fi +if $Remplir_polygone_interieur==1 +polygon[-1] $Nombre_de_cotes,$Points_polygone_interieur,1,$R_Couleur_polygone_interieur,$V_Couleur_polygone_interieur,$B_Couleur_polygone_interieur,$Transparence_des_couleurs +fi +if $Contour_polygone_interieur==1 +polygon[-1] $Nombre_de_cotes,$Points_polygone_interieur,1,0xFFFFFF,$R_Couleur_contour_polygone_interieur,$V_Couleur_contour_polygone_interieur,$B_Couleur_contour_polygone_interieur,$Transparence_des_couleurs +fi +fi +fi +if $Variation_de_couleur==1 +X_point_exterieur_1={$X_centre_cercle_circonscrit+(round(($Rayon_cercle_circonscrit*(cos((pi/180*($Increment_angle+$Angle_inclinaison+(180/$Nombre_de_cotes))))))))} +Y_point_exterieur_1={$Y_centre_cercle_circonscrit+(round(($Rayon_cercle_circonscrit*(sin((pi/180*($Increment_angle+$Angle_inclinaison+(180/$Nombre_de_cotes))))))))} +X_point_exterieur_2={$X_centre_cercle_circonscrit+(round(($Rayon_cercle_circonscrit*(cos((pi/180*($Increment_angle+$Angle_inclinaison-(180/$Nombre_de_cotes))))))))} +Y_point_exterieur_2={$Y_centre_cercle_circonscrit+(round(($Rayon_cercle_circonscrit*(sin((pi/180*($Increment_angle+$Angle_inclinaison-(180/$Nombre_de_cotes))))))))} +if $Remplir_polygone_exterieur==1 +polygon[-1] 3,$X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$X_point_exterieur_1,$Y_point_exterieur_1,$X_point_exterieur_2,$Y_point_exterieur_2,1,{round(u)*255},{round(u)*255},{round(u)*255},$Transparence_des_couleurs +fi +if $Contour_polygone_exterieur==1 +polygon[-1] 3,$X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$X_point_exterieur_1,$Y_point_exterieur_1,$X_point_exterieur_2,$Y_point_exterieur_2,1,0xFFFFFF,{round(u)*255},{round(u)*255},{round(u)*255},$Transparence_des_couleurs +fi +X_point_interieur_1={$X_centre_cercle_circonscrit+(round(($Rayon_cercle_interieur*(cos((pi/180*($Increment_angle+$Angle_inclinaison+(180/$Nombre_de_cotes))))))))} +Y_point_interieur_1={$Y_centre_cercle_circonscrit+(round(($Rayon_cercle_interieur*(sin((pi/180*($Increment_angle+$Angle_inclinaison+(180/$Nombre_de_cotes))))))))} +X_point_interieur_2={$X_centre_cercle_circonscrit+(round(($Rayon_cercle_interieur*(cos((pi/180*($Increment_angle+$Angle_inclinaison-(180/$Nombre_de_cotes))))))))} +Y_point_interieur_2={$Y_centre_cercle_circonscrit+(round(($Rayon_cercle_interieur*(sin((pi/180*($Increment_angle+$Angle_inclinaison-(180/$Nombre_de_cotes))))))))} +if $Remplir_polygone_interieur==1 +polygon[-1] 3,$X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$X_point_interieur_1,$Y_point_interieur_1,$X_point_interieur_2,$Y_point_interieur_2,1,{round(u)*255},{round(u)*255},{round(u)*255},$Transparence_des_couleurs +fi +if $Contour_polygone_interieur==1 +polygon[-1] 3,$X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$X_point_interieur_1,$Y_point_interieur_1,$X_point_interieur_2,$Y_point_interieur_2,1,0xFFFFFF,{round(u)*255},{round(u)*255},{round(u)*255},$Transparence_des_couleurs +fi +if $Nb_boucle==1 +if $Remplir_cercle_interieur==1 +ellipse[-1] $X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$Rayon_cercle_interieur,$Rayon_cercle_interieur,0,1,$R_CI_plein,$V_CI_plein,$B_CI_plein,$Transparence_des_couleurs +fi +if $Contour_cercle_interieur==1 +ellipse[-1] $X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$Rayon_cercle_interieur,$Rayon_cercle_interieur,0,1,0xFFFFFF,$R_CI_contour,$V_CI_contour,$B_CI_contour,$Transparence_des_couleurs +fi +fi +fi +if $Variation_de_couleur>1 +Valeur_variation_couleur=16 +if $Variation_de_couleur==3 +Valeur_variation_couleur=32 +fi +if $Variation_de_couleur==4 +Valeur_variation_couleur=64 +fi +R_Couleur_polygone_exterieur={round({$8+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $R_Couleur_polygone_exterieur>255 +R_Couleur_polygone_exterieur=$8 +fi +if $R_Couleur_polygone_exterieur<0 +R_Couleur_polygone_exterieur=$8 +fi +V_Couleur_polygone_exterieur={round({$9+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $V_Couleur_polygone_exterieur>255 +V_Couleur_polygone_exterieur=$9 +fi +if $V_Couleur_polygone_exterieur<0 +V_Couleur_polygone_exterieur=$9 +fi +B_Couleur_polygone_exterieur={round({$10+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $B_Couleur_polygone_exterieur>255 +B_Couleur_polygone_exterieur=$10 +fi +if $B_Couleur_polygone_exterieur<0 +B_Couleur_polygone_exterieur=$10 +fi +R_Couleur_polygone_interieur={round({$16+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $R_Couleur_polygone_interieur>255 +R_Couleur_polygone_interieur=$16 +fi +if $R_Couleur_polygone_interieur<0 +R_Couleur_polygone_interieur=$16 +fi +V_Couleur_polygone_interieur={round({$17+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $V_Couleur_polygone_interieur>255 +V_Couleur_polygone_interieur=$17 +fi +if $V_Couleur_polygone_interieur<0 +V_Couleur_polygone_interieur=$17 +fi +B_Couleur_polygone_interieur={round({$18+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $B_Couleur_polygone_interieur>255 +B_Couleur_polygone_interieur=$18 +fi +if $B_Couleur_polygone_interieur<0 +B_Couleur_polygone_interieur=$18 +fi +X_point_exterieur_1={$X_centre_cercle_circonscrit+(round(($Rayon_cercle_circonscrit*(cos((pi/180*($Increment_angle+$Angle_inclinaison+(180/$Nombre_de_cotes))))))))} +Y_point_exterieur_1={$Y_centre_cercle_circonscrit+(round(($Rayon_cercle_circonscrit*(sin((pi/180*($Increment_angle+$Angle_inclinaison+(180/$Nombre_de_cotes))))))))} +X_point_exterieur_2={$X_centre_cercle_circonscrit+(round(($Rayon_cercle_circonscrit*(cos((pi/180*($Increment_angle+$Angle_inclinaison-(180/$Nombre_de_cotes))))))))} +Y_point_exterieur_2={$Y_centre_cercle_circonscrit+(round(($Rayon_cercle_circonscrit*(sin((pi/180*($Increment_angle+$Angle_inclinaison-(180/$Nombre_de_cotes))))))))} +if $Remplir_polygone_exterieur==1 +polygon[-1] 3,$X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$X_point_exterieur_1,$Y_point_exterieur_1,$X_point_exterieur_2,$Y_point_exterieur_2,1,$R_Couleur_polygone_exterieur,$V_Couleur_polygone_exterieur,$B_Couleur_polygone_exterieur,$Transparence_des_couleurs +fi +if $Contour_polygone_exterieur==1 +polygon[-1] 3,$X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$X_point_exterieur_1,$Y_point_exterieur_1,$X_point_exterieur_2,$Y_point_exterieur_2,1,0xFFFFFF,$R_Couleur_contour_polygone_exterieur,$V_Couleur_contour_polygone_exterieur,$B_Couleur_contour_polygone_exterieur,$Transparence_des_couleurs +fi +X_point_interieur_1={$X_centre_cercle_circonscrit+(round(($Rayon_cercle_interieur*(cos((pi/180*($Increment_angle+$Angle_inclinaison+(180/$Nombre_de_cotes))))))))} +Y_point_interieur_1={$Y_centre_cercle_circonscrit+(round(($Rayon_cercle_interieur*(sin((pi/180*($Increment_angle+$Angle_inclinaison+(180/$Nombre_de_cotes))))))))} +X_point_interieur_2={$X_centre_cercle_circonscrit+(round(($Rayon_cercle_interieur*(cos((pi/180*($Increment_angle+$Angle_inclinaison-(180/$Nombre_de_cotes))))))))} +Y_point_interieur_2={$Y_centre_cercle_circonscrit+(round(($Rayon_cercle_interieur*(sin((pi/180*($Increment_angle+$Angle_inclinaison-(180/$Nombre_de_cotes))))))))} +if $Remplir_polygone_interieur==1 +polygon[-1] 3,$X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$X_point_interieur_1,$Y_point_interieur_1,$X_point_interieur_2,$Y_point_interieur_2,1,$R_Couleur_polygone_interieur,$V_Couleur_polygone_interieur,$B_Couleur_polygone_interieur,$Transparence_des_couleurs +fi +if $Contour_polygone_interieur==1 +polygon[-1] 3,$X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$X_point_interieur_1,$Y_point_interieur_1,$X_point_interieur_2,$Y_point_interieur_2,1,0xFFFFFF,$R_Couleur_contour_polygone_interieur,$V_Couleur_contour_polygone_interieur,$B_Couleur_contour_polygone_interieur,$Transparence_des_couleurs +fi +if $Nb_boucle==1 +if $Remplir_cercle_interieur==1 +ellipse[-1] $X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$Rayon_cercle_interieur,$Rayon_cercle_interieur,0,1,$R_CI_plein,$V_CI_plein,$B_CI_plein,$Transparence_des_couleurs +fi +if $Contour_cercle_interieur==1 +ellipse[-1] $X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$Rayon_cercle_interieur,$Rayon_cercle_interieur,0,1,0xFFFFFF,$R_CI_contour,$V_CI_contour,$B_CI_contour,$Transparence_des_couleurs +fi +fi +fi +Increment_angle+={360/$Nombre_de_cotes} +Nb_boucle-=1 +while $Nb_boucle>0 +if $Valeur_dilate_circ>1 +dilate_circ[-1] $Valeur_dilate_circ +fi +blur[-1] $Flou_polygone +spread[-1] $Spread_polygone +deform[-1] $Deform_polygone +gimp_blend_1651[-2,-1] $blend,1,1,1 +samj_Egg_Oeuf_Granville : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Decalage_X={round({{min(w,h)}*$3/100})} +Valeur_A={round({{min(w,h)}*$4/40})} +Valeur_B={round({{min(w,h)}*$5/40})} +Valeur_R={round({{min(w,h)}*$6/40})} +Angle_Rotation=$7 +R_Contours=$8 +V_Contours=$9 +B_Contours=$10 +A_Contours=$11 +Affichage_Contours=$12 +R_a=$13 +V_a=$14 +B_a=$15 +A_a=$16 +Couleurs_aleatoires=$17 +Inversions=$18 +Flou=$19 +Dilatation=$20 +Deformation=$21 +Bruit=$22 +Ombre=$23 +X_Ombre=$24 +Y_Ombre=$25 +Smoothness_Ombre=$26 +Curvature_Ombre=$27 +Compensation_Decalage_Ombre_X=$28 +Compensation_Decalage_Ombre_Y=$29 +Canal_Alpha=$30 +Resolution=720 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_boucles=0 +Angle=0 +X_Oeuf_A_Imprimer=0 +Y_Oeuf_A_Imprimer=0 +X_Oeuf_A_Imprimer_Precedent={{$X-{$Valeur_B+{$Valeur_R/2}}}+{$Decalage_X+{$Valeur_B+{$Valeur_R*{cos(pi/180*$Angle)}}}}} +Y_Oeuf_A_Imprimer_Precedent={$Y+((($Valeur_A*$Valeur_R*(sin(pi/180*$Angle)))/($Valeur_B+($Valeur_R*(cos(pi/180*$Angle))))))} +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Affichage_Contours>0 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +fi +if $Affichage_Contours==2 +ellipse[-2] {$X+$Decalage_X},$Y,$Valeur_A,$Valeur_A,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-2] {$X+$Decalage_X},$Y,$Valeur_B,$Valeur_B,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-2] {$X+$Decalage_X},$Y,$Valeur_R,$Valeur_R,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +repeat $Resolution +Nb_boucles+=1 +Angle={$Nb_boucles*(360/$Resolution)} +X_Oeuf_A_Imprimer={{$X-{$Valeur_B+{$Valeur_R/2}}}+{$Decalage_X+{$Valeur_B+{$Valeur_R*{cos(pi/180*$Angle)}}}}} +Y_Oeuf_A_Imprimer={$Y+((($Valeur_A*$Valeur_R*(sin(pi/180*$Angle)))/($Valeur_B+($Valeur_R*(cos(pi/180*$Angle))))))} +polygon[-1] 3,{$X+$Decalage_X},$Y,$X_Oeuf_A_Imprimer_Precedent,$Y_Oeuf_A_Imprimer_Precedent,$X_Oeuf_A_Imprimer,$Y_Oeuf_A_Imprimer,1,$R_a,$V_a,$B_a,$A_a +if $Affichage_Contours>0 +line[-2] $X_Oeuf_A_Imprimer_Precedent,$Y_Oeuf_A_Imprimer_Precedent,$X_Oeuf_A_Imprimer,$Y_Oeuf_A_Imprimer,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +X_Oeuf_A_Imprimer_Precedent=$X_Oeuf_A_Imprimer +Y_Oeuf_A_Imprimer_Precedent=$Y_Oeuf_A_Imprimer +done +if $Affichage_Contours>0 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +if $Angle_Rotation>0 rotate[-1] $Angle_Rotation,1,0,{w/2},{h/2} fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Egg_Oeuf_Hugelschaffer : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Dimension={round({{min(w,h)}*$3/5000})} +Valeur_A=$4 +Valeur_B=$5 +Valeur_D=$6 +Angle_Rotation=$7 +R_Contours=$8 +V_Contours=$9 +B_Contours=$10 +A_Contours=$11 +Affichage_Contours=$12 +R_a=$13 +V_a=$14 +B_a=$15 +A_a=$16 +Couleurs_aleatoires=$17 +Inversions=$18 +Flou=$19 +Dilatation=$20 +Deformation=$21 +Bruit=$22 +Ombre=$23 +X_Ombre=$24 +Y_Ombre=$25 +Smoothness_Ombre=$26 +Curvature_Ombre=$27 +Compensation_Decalage_Ombre_X=$28 +Compensation_Decalage_Ombre_Y=$29 +Canal_Alpha=$30 +Resolution=720 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_boucles=0 +Angle=0 +X_Oeuf_A_Imprimer=0 +Y_Oeuf_A_Imprimer=0 +X_Oeuf_A_Imprimer_Precedent={$X+($Dimension*(((($Valeur_A*$Valeur_A)-($Valeur_D*$Valeur_D*(sin(pi/180*$Angle))*(sin(pi/180*$Angle)))^0.5)+($Valeur_D*(cos(pi/180*$Angle))))*(cos(pi/180*$Angle))))} +Y_Oeuf_A_Imprimer_Precedent={$Y+($Dimension*($Valeur_B*(sin(pi/180*$Angle))))} +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Affichage_Contours>0 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +fi +if $Affichage_Contours==2 +ellipse[-2] $X,$Y,{$Dimension*$Valeur_A},{$Dimension*$Valeur_A},0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-2] $X,$Y,{$Dimension*$Valeur_B},{$Dimension*$Valeur_B},0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +repeat $Resolution +Nb_boucles+=1 +Angle={$Nb_boucles*(360/$Resolution)} +X_Oeuf_A_Imprimer={$X+($Dimension*(((($Valeur_A*$Valeur_A)-($Valeur_D*$Valeur_D*(sin(pi/180*$Angle))*(sin(pi/180*$Angle)))^0.5)+($Valeur_D*(cos(pi/180*$Angle))))*(cos(pi/180*$Angle))))} +Y_Oeuf_A_Imprimer={$Y+($Dimension*($Valeur_B*(sin(pi/180*$Angle))))} +polygon[-1] 3,$X,$Y,$X_Oeuf_A_Imprimer_Precedent,$Y_Oeuf_A_Imprimer_Precedent,$X_Oeuf_A_Imprimer,$Y_Oeuf_A_Imprimer,1,$R_a,$V_a,$B_a,$A_a +if $Affichage_Contours>0 +line[-2] $X_Oeuf_A_Imprimer_Precedent,$Y_Oeuf_A_Imprimer_Precedent,$X_Oeuf_A_Imprimer,$Y_Oeuf_A_Imprimer,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +X_Oeuf_A_Imprimer_Precedent=$X_Oeuf_A_Imprimer +Y_Oeuf_A_Imprimer_Precedent=$Y_Oeuf_A_Imprimer +done +if $Affichage_Contours>0 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +if $Angle_Rotation>0 rotate[-1] $Angle_Rotation,1,0,{w/2},{h/2} fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Egg_Oeuf_Rosillo : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Valeur_A={round({{w+h}*$3/200})} +Valeur_B={$Valeur_A*$4/100} +Valeur_C={$Valeur_A*$5/100} +Angle_Rotation=$6 +R_Contours=$7 +V_Contours=$8 +B_Contours=$9 +A_Contours=$10 +Affichage_Contours=$11 +R_a=$12 +V_a=$13 +B_a=$14 +A_a=$15 +Couleurs_aleatoires=$16 +Inversions=$17 +Flou=$18 +Dilatation=$19 +Deformation=$20 +Bruit=$21 +Ombre=$22 +X_Ombre=$23 +Y_Ombre=$24 +Smoothness_Ombre=$25 +Curvature_Ombre=$26 +Compensation_Decalage_Ombre_X=$27 +Compensation_Decalage_Ombre_Y=$28 +Canal_Alpha=$29 +Resolution=720 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_boucles=0 +Angle=0 +X_Oeuf_A_Imprimer=0 +Y_Oeuf_A_Imprimer=0 +X_Oeuf_A_Imprimer_Precedent={$X+($Valeur_A*(cos(pi/180*$Angle)))} +Y_Oeuf_A_Imprimer_Precedent={$Y+(($Valeur_B-($Valeur_A*(cos(pi/180*$Angle))))/($Valeur_C-($Valeur_A*(cos(pi/180*$Angle))))*($Valeur_A*(sin(pi/180*$Angle))))} +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Affichage_Contours>0 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +fi +if $Affichage_Contours==2 +ellipse[-2] $X,$Y,$Valeur_A,$Valeur_A,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-2] $X,$Y,$Valeur_B,$Valeur_B,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-2] $X,$Y,$Valeur_C,$Valeur_C,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +repeat $Resolution +Nb_boucles+=1 +Angle={$Nb_boucles*(360/$Resolution)} +X_Oeuf_A_Imprimer={$X+($Valeur_A*(cos(pi/180*$Angle)))} +Y_Oeuf_A_Imprimer={$Y+(($Valeur_B-($Valeur_A*(cos(pi/180*$Angle))))/($Valeur_C-($Valeur_A*(cos(pi/180*$Angle))))*($Valeur_A*(sin(pi/180*$Angle))))} +polygon[-1] 3,$X,$Y,$X_Oeuf_A_Imprimer_Precedent,$Y_Oeuf_A_Imprimer_Precedent,$X_Oeuf_A_Imprimer,$Y_Oeuf_A_Imprimer,1,$R_a,$V_a,$B_a,$A_a +if $Affichage_Contours>0 +line[-2] $X_Oeuf_A_Imprimer_Precedent,$Y_Oeuf_A_Imprimer_Precedent,$X_Oeuf_A_Imprimer,$Y_Oeuf_A_Imprimer,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +X_Oeuf_A_Imprimer_Precedent=$X_Oeuf_A_Imprimer +Y_Oeuf_A_Imprimer_Precedent=$Y_Oeuf_A_Imprimer +done +if $Affichage_Contours>0 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +if $Angle_Rotation>0 rotate[-1] $Angle_Rotation,1,0,{w/2},{h/2} fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Engrenages_Laser_LED : +Module_m={$1+1} +Angle_De_Pression_alpha={round($2*10000)/10000} +Diam_Trou_Arbre=$3 +Nb_Dents_Roue_Z1=$4 +Nb_Dents_Roue_Z2=$5 +Egalite_Primitif=$6 +Contours_Plus=$7 +Trous_Assemb_Nb=$8 +Trous_Assemb_Diam=$9 +Trous_Assemb_Distance_Centre=$10 +Trous_Assemb_Decalage_Angle={{pi}/180*$11} +Rainure_Largeur=$12 +Rainure_Hauteur=$13 +Rainure_Decalage_Angle={{pi}/180*$14} +Echelle=1 +Dimension_Max_Image=7200 +Reserve_Contour_Image=10 +Module_m_Origine={$Module_m-1} +Dia_Primitif_Z1={$Echelle*$Module_m*$Nb_Dents_Roue_Z1} +Dia_Tete_Z1={$Dia_Primitif_Z1+(2*$Echelle*$Module_m)} +Dia_Primitif_Z2={$Echelle*$Module_m*$Nb_Dents_Roue_Z2} +Dia_Tete_Z2={$Dia_Primitif_Z2+(2*$Echelle*$Module_m)} +if $Nb_Dents_Roue_Z1>$Nb_Dents_Roue_Z2 +do +Module_m-=1 +Dia_Primitif_Z1={$Echelle*$Module_m*$Nb_Dents_Roue_Z1} +Dia_Tete_Z1={$Dia_Primitif_Z1+(2*$Echelle*$Module_m)} +while $Dia_Tete_Z1>$Dimension_Max_Image-2*$Reserve_Contour_Image +else +do +Module_m-=1 +Dia_Primitif_Z2={$Echelle*$Module_m*$Nb_Dents_Roue_Z2} +Dia_Tete_Z2={$Dia_Primitif_Z2+(2*$Echelle*$Module_m)} +while $Dia_Tete_Z2>$Dimension_Max_Image-2*$Reserve_Contour_Image +fi +Dia_Primitif_Z1={$Echelle*$Module_m*$Nb_Dents_Roue_Z1} +Dia_Tete_Z1={$Dia_Primitif_Z1+(2*$Echelle*$Module_m)} +Dia_Pied_Z1={$Dia_Primitif_Z1-(2.5*$Echelle*$Module_m)} +Dia_Primitif_Z2={$Echelle*$Module_m*$Nb_Dents_Roue_Z2} +Dia_Tete_Z2={$Dia_Primitif_Z2+(2*$Echelle*$Module_m)} +Dia_Pied_Z2={$Dia_Primitif_Z2-(2.5*$Echelle*$Module_m)} +Angle_De_Pression_alpha_Origine=$Angle_De_Pression_alpha +Angle_De_Pression_alpha+=0.1 +if $Nb_Dents_Roue_Z1>$Nb_Dents_Roue_Z2 +do +Angle_De_Pression_alpha-=0.1 +Diametre_Cercle_De_Base_Z1={$Dia_Primitif_Z1*cos(((pi)/180*$Angle_De_Pression_alpha))} +Rayon_Developpante_Z1={$Diametre_Cercle_De_Base_Z1/2} +while $Dia_Pied_Z1/2>$Rayon_Developpante_Z1 +else +do +Angle_De_Pression_alpha-=0.1 +Diametre_Cercle_De_Base_Z2={$Dia_Primitif_Z2*cos(((pi)/180*$Angle_De_Pression_alpha))} +Rayon_Developpante_Z2={$Diametre_Cercle_De_Base_Z2/2} +while $Dia_Pied_Z2/2>$Rayon_Developpante_Z2 +fi +Angle_De_Pression_alpha={round($Angle_De_Pression_alpha*10000)/10000} +Dia_Primitif_Z1={$Echelle*$Module_m*$Nb_Dents_Roue_Z1} +Dia_Tete_Z1={$Dia_Primitif_Z1+(2*$Echelle*$Module_m)} +Diametre_Cercle_De_Base_Z1={$Dia_Primitif_Z1*cos(((pi)/180*$Angle_De_Pression_alpha))} +Dia_Pied_Z1={$Dia_Primitif_Z1-(2.5*$Echelle*$Module_m)} +Rayon_Developpante_Z1={$Diametre_Cercle_De_Base_Z1/2} +Dia_Primitif_Z2={$Echelle*$Module_m*$Nb_Dents_Roue_Z2} +Dia_Tete_Z2={$Dia_Primitif_Z2+(2*$Echelle*$Module_m)} +Dia_Pied_Z2={$Dia_Primitif_Z2-(2.5*$Echelle*$Module_m)} +Diametre_Cercle_De_Base_Z2={$Dia_Primitif_Z2*cos(((pi)/180*$Angle_De_Pression_alpha))} +Rayon_Developpante_Z2={$Diametre_Cercle_De_Base_Z2/2} +if $Nb_Dents_Roue_Z1>$Nb_Dents_Roue_Z2 +Largeur={round({$Dia_Tete_Z1+{2*{$Reserve_Contour_Image}}})} +else +Largeur={round({$Dia_Tete_Z2+{2*{$Reserve_Contour_Image}}})} +fi +Hauteur=$Largeur +Entraxe_Engrenages_theorique={{$Echelle*$Module_m*{$Nb_Dents_Roue_Z1+$Nb_Dents_Roue_Z2}}/2} +Creux_b={$Echelle*$Module_m*1.25} +Saillie_a={$Echelle*$Module_m} +Vide_Fond_De_Dent_c={$Creux_b-$Saillie_a} +Hauteur_de_dent_ht={$Creux_b+$Saillie_a} +Pas_Primitif_p={$Echelle*$Module_m*(pi)} +Epaisseur_Circulaire_t={$Pas_Primitif_p/2} +Hauteur_Active_hk={2*$Saillie_a} +X_Origine={$Largeur/2} +Y_Origine={$Hauteur/2} +Increment_Developpante={{pi}*0.0002} +Precision_Tracage_Cercles=500 +rm[0] +$Largeur,$Hauteur,1,4 +fill_color[-1] 255,255,255,255 +Rayon_Developpante={$Diametre_Cercle_De_Base_Z1/2} +Dimension_Developpante=0 +Condition_Arret={$Dia_Tete_Z1/2} +Angle_Rotation=0 +Increment_Rotation={2*{pi}/$Nb_Dents_Roue_Z1} +Angle_Dent={{pi}/$Nb_Dents_Roue_Z1} +Base_Dent={2*{{$Diametre_Cercle_De_Base_Z1/2}*sin({{pi}/{$Nb_Dents_Roue_Z1*4}})}} +Angle_Porte_Au_Cercle_Pied={2*asin($Base_Dent/$Dia_Pied_Z1)} +Angle_Decalage_Rainure_Pied={{$Angle_Porte_Au_Cercle_Pied-{$Increment_Rotation/4}}/2} +X_Developpante_Tracage=0 +Y_Developpante_Tracage=0 +Angle_Decalage_Developpante_B={{{pi}/{$Nb_Dents_Roue_Z1*2}}-{{pi}/2}+{{{pi}/$Nb_Dents_Roue_Z1}/2}} +if $Egalite_Primitif==1 +Intersection_Developpante_Cercle_primitif=0 +X_Developpante_Memo=0 +Y_Developpante_Memo=0 +X_Intersection=0 +Y_Intersection=0 +Angle_Developpante_Rad=0 +Nb_boucles=0 +do +X_Developpante={$Rayon_Developpante*(cos($Angle_Developpante_Rad)+($Angle_Developpante_Rad*sin($Angle_Developpante_Rad)))} +Y_Developpante={$Rayon_Developpante*(sin($Angle_Developpante_Rad)-($Angle_Developpante_Rad*cos($Angle_Developpante_Rad)))} +Dimension_Developpante={({{($X_Developpante)^2}+{($Y_Developpante)^2}})^0.5} +X_Developpante_Tracage={$X_Origine+(($X_Developpante*cos($Angle_Rotation))-($Y_Developpante*sin($Angle_Rotation)))} +Y_Developpante_Tracage={$Y_Origine+(($X_Developpante*sin($Angle_Rotation))+($Y_Developpante*cos($Angle_Rotation)))} +if $Intersection_Developpante_Cercle_primitif==0 +if $Dimension_Developpante>{$Dia_Primitif_Z1/2} +Angle_Intersection={atan2({$Y_Developpante_Memo-$Y_Origine},{$X_Developpante_Memo-$X_Origine})} +Angle_Alpha_Base_Primitif={$Angle_Rotation-$Angle_Intersection} +Intersection_Developpante_Cercle_primitif=1 +fi +X_Developpante_Memo=$X_Developpante_Tracage +Y_Developpante_Memo=$Y_Developpante_Tracage +fi +Angle_Developpante_Rad+=$Increment_Developpante +Nb_boucles+=1 +while $Dimension_Developpante<$Condition_Arret +Angle_Rotation=0 +Dimension_Developpante=0 +X_Developpante_Tracage=0 +Y_Developpante_Tracage=0 +fi +repeat $Nb_Dents_Roue_Z1 +Angle_Developpante_Rad=0 +Nb_boucles=0 +do +X_Developpante={$Rayon_Developpante*(cos($Angle_Developpante_Rad)+($Angle_Developpante_Rad*sin($Angle_Developpante_Rad)))} +Y_Developpante={$Rayon_Developpante*(sin($Angle_Developpante_Rad)-($Angle_Developpante_Rad*cos($Angle_Developpante_Rad)))} +Dimension_Developpante={({{($X_Developpante)^2}+{($Y_Developpante)^2}})^0.5} +X_Developpante_Tracage={$X_Origine+(($X_Developpante*cos($Angle_Rotation))-($Y_Developpante*sin($Angle_Rotation)))} +Y_Developpante_Tracage={$Y_Origine+(($X_Developpante*sin($Angle_Rotation))+($Y_Developpante*cos($Angle_Rotation)))} +if $Nb_boucles==0 +X_Debut_Developpante_Tracage_A=$X_Developpante_Tracage +Y_Debut_Developpante_Tracage_A=$Y_Developpante_Tracage +fi +X_Fin_Developpante_Tracage_A=$X_Developpante_Tracage +Y_Fin_Developpante_Tracage_A=$Y_Developpante_Tracage +point[-1] $X_Developpante_Tracage,$Y_Developpante_Tracage,0,1,0,0,0,255 +X_Developpante={$Rayon_Developpante*(sin($Angle_Developpante_Rad)-($Angle_Developpante_Rad*cos($Angle_Developpante_Rad)))} +Y_Developpante={$Rayon_Developpante*(cos($Angle_Developpante_Rad)+($Angle_Developpante_Rad*sin($Angle_Developpante_Rad)))} +if $Egalite_Primitif==1 +X_Developpante_Tracage={$X_Origine+(($X_Developpante*cos($Angle_Rotation-(2*$Angle_Alpha_Base_Primitif)+$Angle_Decalage_Developpante_B))-($Y_Developpante*sin($Angle_Rotation-(2*$Angle_Alpha_Base_Primitif)+$Angle_Decalage_Developpante_B)))} +Y_Developpante_Tracage={$Y_Origine+(($X_Developpante*sin($Angle_Rotation-(2*$Angle_Alpha_Base_Primitif)+$Angle_Decalage_Developpante_B))+($Y_Developpante*cos($Angle_Rotation-(2*$Angle_Alpha_Base_Primitif)+$Angle_Decalage_Developpante_B)))} +else +X_Developpante_Tracage={$X_Origine+(($X_Developpante*cos($Angle_Rotation+$Angle_Decalage_Developpante_B))-($Y_Developpante*sin($Angle_Rotation+$Angle_Decalage_Developpante_B)))} +Y_Developpante_Tracage={$Y_Origine+(($X_Developpante*sin($Angle_Rotation+$Angle_Decalage_Developpante_B))+($Y_Developpante*cos($Angle_Rotation+$Angle_Decalage_Developpante_B)))} +fi +if $Nb_boucles==0 +X_Debut_Developpante_Tracage_B=$X_Developpante_Tracage +Y_Debut_Developpante_Tracage_B=$Y_Developpante_Tracage +fi +X_Fin_Developpante_Tracage_B=$X_Developpante_Tracage +Y_Fin_Developpante_Tracage_B=$Y_Developpante_Tracage +point[-1] $X_Developpante_Tracage,$Y_Developpante_Tracage,0,1,0,0,0,255 +Angle_Developpante_Rad+=$Increment_Developpante +Nb_boucles+=1 +while $Dimension_Developpante<$Condition_Arret +Angle_Fin_Developpante_Tracage_A={atan2({$Y_Fin_Developpante_Tracage_A-$Y_Origine},{$X_Fin_Developpante_Tracage_A-$X_Origine})} +Angle_Fin_Developpante_Tracage_B={atan2({$Y_Fin_Developpante_Tracage_B-$Y_Origine},{$X_Fin_Developpante_Tracage_B-$X_Origine})} +Angle_Tracage=$Angle_Fin_Developpante_Tracage_A +Increment_Angle_Tracage={{$Angle_Fin_Developpante_Tracage_B-$Angle_Fin_Developpante_Tracage_A}/$Precision_Tracage_Cercles} +repeat $Precision_Tracage_Cercles +point[-1] {$X_Origine+{{$Dia_Tete_Z1/2}*{cos($Angle_Tracage)}}},{$Y_Origine+{{$Dia_Tete_Z1/2}*{sin($Angle_Tracage)}}},0,1,0,0,0,255 +Angle_Tracage+=$Increment_Angle_Tracage +done +Angle_Debut_Developpante_Tracage_A={atan2({$Y_Debut_Developpante_Tracage_A-$Y_Origine},{$X_Debut_Developpante_Tracage_A-$X_Origine})} +Angle_Debut_Developpante_Tracage_B={atan2({$Y_Debut_Developpante_Tracage_B-$Y_Origine},{$X_Debut_Developpante_Tracage_B-$X_Origine})} +Angle_Debut_Rainure_Pied={$Angle_Debut_Developpante_Tracage_A-$Angle_Decalage_Rainure_Pied} +Angle_Fin_Rainure_Pied={$Angle_Debut_Developpante_Tracage_B+$Angle_Decalage_Rainure_Pied} +X_Debut_Rainure_Pied={$X_Origine+(($Dia_Pied_Z1/2)*(cos($Angle_Debut_Rainure_Pied)))} +Y_Debut_Rainure_Pied={$Y_Origine+(($Dia_Pied_Z1/2)*(sin($Angle_Debut_Rainure_Pied)))} +X_Fin_Rainure_Pied={$X_Origine+(($Dia_Pied_Z1/2)*(cos($Angle_Fin_Rainure_Pied)))} +Y_Fin_Rainure_Pied={$Y_Origine+(($Dia_Pied_Z1/2)*(sin($Angle_Fin_Rainure_Pied)))} +line[-1] {$X_Origine+{{$Diametre_Cercle_De_Base_Z1/2}*{cos($Angle_Debut_Developpante_Tracage_A)}}},{$Y_Origine+{{$Diametre_Cercle_De_Base_Z1/2}*{sin($Angle_Debut_Developpante_Tracage_A)}}},$X_Debut_Rainure_Pied,$Y_Debut_Rainure_Pied,1,0,0,0,255 +line[-1] {$X_Origine+{{$Diametre_Cercle_De_Base_Z1/2}*{cos($Angle_Debut_Developpante_Tracage_B)}}},{$Y_Origine+{{$Diametre_Cercle_De_Base_Z1/2}*{sin($Angle_Debut_Developpante_Tracage_B)}}},$X_Fin_Rainure_Pied,$Y_Fin_Rainure_Pied,1,0,0,0,255 +Angle_Debut_Rainure_Pied_Suivant={$Angle_Fin_Rainure_Pied+($Increment_Rotation/2)-($Angle_Decalage_Rainure_Pied*2)} +if $Egalite_Primitif==1 +X_Debut_Rainure_Pied_Suivant={$X_Origine+(($Dia_Pied_Z1/2)*(cos($Angle_Debut_Rainure_Pied_Suivant+(2*$Angle_Alpha_Base_Primitif))))} +Y_Debut_Rainure_Pied_Suivant={$Y_Origine+(($Dia_Pied_Z1/2)*(sin($Angle_Debut_Rainure_Pied_Suivant+(2*$Angle_Alpha_Base_Primitif))))} +line[-1] $X_Debut_Rainure_Pied_Suivant,$Y_Debut_Rainure_Pied_Suivant,$X_Fin_Rainure_Pied,$Y_Fin_Rainure_Pied,1,0,0,0,255 +else +X_Debut_Rainure_Pied_Suivant={$X_Origine+(($Dia_Pied_Z1/2)*(cos($Angle_Debut_Rainure_Pied_Suivant)))} +Y_Debut_Rainure_Pied_Suivant={$Y_Origine+(($Dia_Pied_Z1/2)*(sin($Angle_Debut_Rainure_Pied_Suivant)))} +line[-1] $X_Debut_Rainure_Pied_Suivant,$Y_Debut_Rainure_Pied_Suivant,$X_Fin_Rainure_Pied,$Y_Fin_Rainure_Pied,1,0,0,0,255 +fi +Angle_Rotation+=$Increment_Rotation +done +X_Origine={$Largeur/2} +Y_Origine={$Hauteur/2} +Increment_Developpante={{pi}*0.0002} +Precision_Tracage_Cercles=500 +$Largeur,$Hauteur,1,4 +fill_color[-1] 255,255,255,255 +Rayon_Developpante={$Diametre_Cercle_De_Base_Z2/2} +Dimension_Developpante=0 +Condition_Arret={$Dia_Tete_Z2/2} +Angle_Rotation=0 +Increment_Rotation={2*{pi}/$Nb_Dents_Roue_Z2} +Angle_Dent={{pi}/$Nb_Dents_Roue_Z2} +Base_Dent={2*{{$Diametre_Cercle_De_Base_Z2/2}*sin({{pi}/{$Nb_Dents_Roue_Z2*4}})}} +Angle_Porte_Au_Cercle_Pied={2*asin($Base_Dent/$Dia_Pied_Z2)} +Angle_Decalage_Rainure_Pied={{$Angle_Porte_Au_Cercle_Pied-{$Increment_Rotation/4}}/2} +X_Developpante_Tracage=0 +Y_Developpante_Tracage=0 +Angle_Decalage_Developpante_B={{{pi}/{$Nb_Dents_Roue_Z2*2}}-{{pi}/2}+{{{pi}/$Nb_Dents_Roue_Z2}/2}} +if $Egalite_Primitif==1 +Intersection_Developpante_Cercle_primitif=0 +X_Developpante_Memo=0 +Y_Developpante_Memo=0 +X_Intersection=0 +Y_Intersection=0 +Angle_Developpante_Rad=0 +Nb_boucles=0 +do +X_Developpante={$Rayon_Developpante*(cos($Angle_Developpante_Rad)+($Angle_Developpante_Rad*sin($Angle_Developpante_Rad)))} +Y_Developpante={$Rayon_Developpante*(sin($Angle_Developpante_Rad)-($Angle_Developpante_Rad*cos($Angle_Developpante_Rad)))} +Dimension_Developpante={({{($X_Developpante)^2}+{($Y_Developpante)^2}})^0.5} +X_Developpante_Tracage={$X_Origine+(($X_Developpante*cos($Angle_Rotation))-($Y_Developpante*sin($Angle_Rotation)))} +Y_Developpante_Tracage={$Y_Origine+(($X_Developpante*sin($Angle_Rotation))+($Y_Developpante*cos($Angle_Rotation)))} +if $Intersection_Developpante_Cercle_primitif==0 +if $Dimension_Developpante>{$Dia_Primitif_Z2/2} +Angle_Intersection={atan2({$Y_Developpante_Memo-$Y_Origine},{$X_Developpante_Memo-$X_Origine})} +Angle_Alpha_Base_Primitif={$Angle_Rotation-$Angle_Intersection} +Intersection_Developpante_Cercle_primitif=1 +fi +X_Developpante_Memo=$X_Developpante_Tracage +Y_Developpante_Memo=$Y_Developpante_Tracage +fi +Angle_Developpante_Rad+=$Increment_Developpante +Nb_boucles+=1 +while $Dimension_Developpante<$Condition_Arret +Angle_Rotation=0 +Dimension_Developpante=0 +X_Developpante_Tracage=0 +Y_Developpante_Tracage=0 +fi +repeat $Nb_Dents_Roue_Z2 +Angle_Developpante_Rad=0 +Nb_boucles=0 +do +X_Developpante={$Rayon_Developpante*(cos($Angle_Developpante_Rad)+($Angle_Developpante_Rad*sin($Angle_Developpante_Rad)))} +Y_Developpante={$Rayon_Developpante*(sin($Angle_Developpante_Rad)-($Angle_Developpante_Rad*cos($Angle_Developpante_Rad)))} +Dimension_Developpante={({{($X_Developpante)^2}+{($Y_Developpante)^2}})^0.5} +X_Developpante_Tracage={$X_Origine+(($X_Developpante*cos($Angle_Rotation))-($Y_Developpante*sin($Angle_Rotation)))} +Y_Developpante_Tracage={$Y_Origine+(($X_Developpante*sin($Angle_Rotation))+($Y_Developpante*cos($Angle_Rotation)))} +if $Nb_boucles==0 +X_Debut_Developpante_Tracage_A=$X_Developpante_Tracage +Y_Debut_Developpante_Tracage_A=$Y_Developpante_Tracage +fi +X_Fin_Developpante_Tracage_A=$X_Developpante_Tracage +Y_Fin_Developpante_Tracage_A=$Y_Developpante_Tracage +point[-1] $X_Developpante_Tracage,$Y_Developpante_Tracage,0,1,0,0,0,255 +X_Developpante={$Rayon_Developpante*(sin($Angle_Developpante_Rad)-($Angle_Developpante_Rad*cos($Angle_Developpante_Rad)))} +Y_Developpante={$Rayon_Developpante*(cos($Angle_Developpante_Rad)+($Angle_Developpante_Rad*sin($Angle_Developpante_Rad)))} +if $Egalite_Primitif==1 +X_Developpante_Tracage={$X_Origine+(($X_Developpante*cos($Angle_Rotation-(2*$Angle_Alpha_Base_Primitif)+$Angle_Decalage_Developpante_B))-($Y_Developpante*sin($Angle_Rotation-(2*$Angle_Alpha_Base_Primitif)+$Angle_Decalage_Developpante_B)))} +Y_Developpante_Tracage={$Y_Origine+(($X_Developpante*sin($Angle_Rotation-(2*$Angle_Alpha_Base_Primitif)+$Angle_Decalage_Developpante_B))+($Y_Developpante*cos($Angle_Rotation-(2*$Angle_Alpha_Base_Primitif)+$Angle_Decalage_Developpante_B)))} +else +X_Developpante_Tracage={$X_Origine+(($X_Developpante*cos($Angle_Rotation+$Angle_Decalage_Developpante_B))-($Y_Developpante*sin($Angle_Rotation+$Angle_Decalage_Developpante_B)))} +Y_Developpante_Tracage={$Y_Origine+(($X_Developpante*sin($Angle_Rotation+$Angle_Decalage_Developpante_B))+($Y_Developpante*cos($Angle_Rotation+$Angle_Decalage_Developpante_B)))} +fi +if $Nb_boucles==0 +X_Debut_Developpante_Tracage_B=$X_Developpante_Tracage +Y_Debut_Developpante_Tracage_B=$Y_Developpante_Tracage +fi +X_Fin_Developpante_Tracage_B=$X_Developpante_Tracage +Y_Fin_Developpante_Tracage_B=$Y_Developpante_Tracage +point[-1] $X_Developpante_Tracage,$Y_Developpante_Tracage,0,1,0,0,0,255 +Angle_Developpante_Rad+=$Increment_Developpante +Nb_boucles+=1 +while $Dimension_Developpante<$Condition_Arret +Angle_Fin_Developpante_Tracage_A={atan2({$Y_Fin_Developpante_Tracage_A-$Y_Origine},{$X_Fin_Developpante_Tracage_A-$X_Origine})} +Angle_Fin_Developpante_Tracage_B={atan2({$Y_Fin_Developpante_Tracage_B-$Y_Origine},{$X_Fin_Developpante_Tracage_B-$X_Origine})} +Angle_Tracage=$Angle_Fin_Developpante_Tracage_A +Increment_Angle_Tracage={{$Angle_Fin_Developpante_Tracage_B-$Angle_Fin_Developpante_Tracage_A}/$Precision_Tracage_Cercles} +repeat $Precision_Tracage_Cercles +point[-1] {$X_Origine+{{$Dia_Tete_Z2/2}*{cos($Angle_Tracage)}}},{$Y_Origine+{{$Dia_Tete_Z2/2}*{sin($Angle_Tracage)}}},0,1,0,0,0,255 +Angle_Tracage+=$Increment_Angle_Tracage +done +Angle_Debut_Developpante_Tracage_A={atan2({$Y_Debut_Developpante_Tracage_A-$Y_Origine},{$X_Debut_Developpante_Tracage_A-$X_Origine})} +Angle_Debut_Developpante_Tracage_B={atan2({$Y_Debut_Developpante_Tracage_B-$Y_Origine},{$X_Debut_Developpante_Tracage_B-$X_Origine})} +Angle_Debut_Rainure_Pied={$Angle_Debut_Developpante_Tracage_A-$Angle_Decalage_Rainure_Pied} +Angle_Fin_Rainure_Pied={$Angle_Debut_Developpante_Tracage_B+$Angle_Decalage_Rainure_Pied} +X_Debut_Rainure_Pied={$X_Origine+(($Dia_Pied_Z2/2)*(cos($Angle_Debut_Rainure_Pied)))} +Y_Debut_Rainure_Pied={$Y_Origine+(($Dia_Pied_Z2/2)*(sin($Angle_Debut_Rainure_Pied)))} +X_Fin_Rainure_Pied={$X_Origine+(($Dia_Pied_Z2/2)*(cos($Angle_Fin_Rainure_Pied)))} +Y_Fin_Rainure_Pied={$Y_Origine+(($Dia_Pied_Z2/2)*(sin($Angle_Fin_Rainure_Pied)))} +line[-1] {$X_Origine+{{$Diametre_Cercle_De_Base_Z2/2}*{cos($Angle_Debut_Developpante_Tracage_A)}}},{$Y_Origine+{{$Diametre_Cercle_De_Base_Z2/2}*{sin($Angle_Debut_Developpante_Tracage_A)}}},$X_Debut_Rainure_Pied,$Y_Debut_Rainure_Pied,1,0,0,0,255 +line[-1] {$X_Origine+{{$Diametre_Cercle_De_Base_Z2/2}*{cos($Angle_Debut_Developpante_Tracage_B)}}},{$Y_Origine+{{$Diametre_Cercle_De_Base_Z2/2}*{sin($Angle_Debut_Developpante_Tracage_B)}}},$X_Fin_Rainure_Pied,$Y_Fin_Rainure_Pied,1,0,0,0,255 +Angle_Debut_Rainure_Pied_Suivant={$Angle_Fin_Rainure_Pied+($Increment_Rotation/2)-($Angle_Decalage_Rainure_Pied*2)} +if $Egalite_Primitif==1 +X_Debut_Rainure_Pied_Suivant={$X_Origine+(($Dia_Pied_Z2/2)*(cos($Angle_Debut_Rainure_Pied_Suivant+(2*$Angle_Alpha_Base_Primitif))))} +Y_Debut_Rainure_Pied_Suivant={$Y_Origine+(($Dia_Pied_Z2/2)*(sin($Angle_Debut_Rainure_Pied_Suivant+(2*$Angle_Alpha_Base_Primitif))))} +line[-1] $X_Debut_Rainure_Pied_Suivant,$Y_Debut_Rainure_Pied_Suivant,$X_Fin_Rainure_Pied,$Y_Fin_Rainure_Pied,1,0,0,0,255 +else +X_Debut_Rainure_Pied_Suivant={$X_Origine+(($Dia_Pied_Z2/2)*(cos($Angle_Debut_Rainure_Pied_Suivant)))} +Y_Debut_Rainure_Pied_Suivant={$Y_Origine+(($Dia_Pied_Z2/2)*(sin($Angle_Debut_Rainure_Pied_Suivant)))} +line[-1] $X_Debut_Rainure_Pied_Suivant,$Y_Debut_Rainure_Pied_Suivant,$X_Fin_Rainure_Pied,$Y_Fin_Rainure_Pied,1,0,0,0,255 +fi +Angle_Rotation+=$Increment_Rotation +done +$Largeur,$Hauteur,1,4 +fill_color[-1] 0,0,0,0 +Angle_Rot=0 +Inc_Angle={2*{pi}/$Trous_Assemb_Nb} +repeat $Trous_Assemb_Nb +X_Centre={$X_Origine+($Trous_Assemb_Distance_Centre*cos($Trous_Assemb_Decalage_Angle+$Angle_Rot))} +Y_Centre={$Y_Origine+($Trous_Assemb_Distance_Centre*sin($Trous_Assemb_Decalage_Angle+$Angle_Rot))} +circle[-2,-3] $X_Centre,$Y_Centre,{$Trous_Assemb_Diam/2},1,0xFFFFFFFF,0,0,0,255 +circle[-1] $X_Centre,$Y_Centre,{$Trous_Assemb_Diam/2},1,0xFFFFFFFF,255,0,255,255 +Angle_Rot+=$Inc_Angle +done +circle[-1] $X_Origine,$Y_Origine,$Trous_Assemb_Distance_Centre,1,0xFFFFFFFF,255,0,255,255 +Trous_Assemb_Erreur=0 +if {$Trous_Assemb_Distance_Centre+{$Trous_Assemb_Diam/2}}>{$Dia_Pied_Z1/2} Trous_Assemb_Erreur+=1 fi +if {$Trous_Assemb_Distance_Centre-{$Trous_Assemb_Diam/2}}<{$Diam_Trou_Arbre/2} Trous_Assemb_Erreur+=10 fi +if $Trous_Assemb_Nb>3 +Rayon_Cercle_Exterieur={$Trous_Assemb_Distance_Centre+$Trous_Assemb_Diam} +Angle_Theta={pi/$Trous_Assemb_Nb} +Rayon_Cercle_Centre={{$Rayon_Cercle_Exterieur*{1-{sin($Angle_Theta)}}}/{{1+{sin($Angle_Theta)}}}} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre+$Rayon_Cercles_Ext} +Rayon_Tang={({{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}})^0.5} +if $Trous_Assemb_Distance_Centre<$Rayon_Tang Trous_Assemb_Erreur+=100 fi +fi +circle[-1,-2,-3] $X_Origine,$Y_Origine,{$Diam_Trou_Arbre/2},1,0xFFFFFFFF,0,0,0,255 +polygon[-1,-2,-3] 4,2,2,{$Largeur-2},2,{$Largeur-2},{$Hauteur-2},2,{$Hauteur-2},1,0xFFFFFFFF,0,0,0,255 +Erreur_Rainure=0 +if $Rainure_Hauteur>{{$Diam_Trou_Arbre/2}-1} +Erreur_Rainure+=1 +fi +if $Rainure_Largeur>{{$Diam_Trou_Arbre/2}-1} +Erreur_Rainure+=10 +fi +if $Rainure_Largeur>0&&$Rainure_Hauteur>0&&$Rainure_Hauteur<{{$Diam_Trou_Arbre/2}-1}&&$Rainure_Largeur<{{$Diam_Trou_Arbre/2}-1} +Angle_Rainure={acos((($Diam_Trou_Arbre/2)^2*2-$Rainure_Largeur^2)/(2*($Diam_Trou_Arbre/2)^2))} +X_Sommet_A={$X_Origine+($Diam_Trou_Arbre/2)*cos($Rainure_Decalage_Angle+$Angle_Rainure)} +Y_Sommet_A={$Y_Origine+($Diam_Trou_Arbre/2)*sin($Rainure_Decalage_Angle+$Angle_Rainure)} +X_Sommet_B={$X_Origine+($Diam_Trou_Arbre/2)*cos($Rainure_Decalage_Angle)} +Y_Sommet_B={$Y_Origine+($Diam_Trou_Arbre/2)*sin($Rainure_Decalage_Angle)} +Angle_Tracage=0 +Increment_Angle_Tracage={$Angle_Rainure/$Precision_Tracage_Cercles} +repeat $Precision_Tracage_Cercles +point[-2,-3] {$X_Origine+{{$Diam_Trou_Arbre/2}*{cos($Rainure_Decalage_Angle+$Angle_Rainure+$Angle_Tracage)}}},{$Y_Origine+{{$Diam_Trou_Arbre/2}*{sin($Rainure_Decalage_Angle+$Angle_Rainure+$Angle_Tracage)}}},0,1,255,255,255,255 +Angle_Tracage-=$Increment_Angle_Tracage +done +line[-1] $X_Sommet_A,$Y_Sommet_A,$X_Sommet_B,$Y_Sommet_B,1,0,255,255,255 +Rayon_CD={(($Diam_Trou_Arbre/2)^2+$Rainure_Hauteur^2-2*($Diam_Trou_Arbre/2)*$Rainure_Hauteur*cos((pi-$Angle_Rainure)/2+(pi/2)))^0.5} +circle[-1] $X_Origine,$Y_Origine,$Rayon_CD,1,0xFFFFFFFF,0,255,255,255 +Angle_CD={acos(($Rayon_CD^2*2-$Rainure_Largeur^2)/(2*($Rayon_CD)^2))} +Angle_BC_DA={{$Angle_Rainure-$Angle_CD}/2} +X_Sommet_C={$X_Origine+($Rayon_CD*cos($Rainure_Decalage_Angle+$Angle_BC_DA))} +Y_Sommet_C={$Y_Origine+($Rayon_CD*sin($Rainure_Decalage_Angle+$Angle_BC_DA))} +X_Sommet_D={$X_Origine+($Rayon_CD*cos($Rainure_Decalage_Angle+$Angle_BC_DA+$Angle_CD))} +Y_Sommet_D={$Y_Origine+($Rayon_CD*sin($Rainure_Decalage_Angle+$Angle_BC_DA+$Angle_CD))} +line[-2,-3] $X_Sommet_C,$Y_Sommet_C,$X_Sommet_D,$Y_Sommet_D,1,0,0,0,255 +line[-2,-3] $X_Sommet_C,$Y_Sommet_C,$X_Sommet_B,$Y_Sommet_B,1,0,0,0,255 +line[-2,-3] $X_Sommet_A,$Y_Sommet_A,$X_Sommet_D,$Y_Sommet_D,1,0,0,0,255 +line[-1] $X_Sommet_C,$Y_Sommet_C,$X_Sommet_D,$Y_Sommet_D,1,0,255,255,255 +line[-1] $X_Sommet_C,$Y_Sommet_C,$X_Sommet_B,$Y_Sommet_B,1,0,255,255,255 +line[-1] $X_Sommet_A,$Y_Sommet_A,$X_Sommet_D,$Y_Sommet_D,1,0,255,255,255 +fi +L_O=10 +H_O=0 +I_T=32 +H_P=30 +R_P=0 +V_P=0 +B_P=0 +H_O+=$I_T +text[-1] "***** Engrenages Gears Laser : samj_Engrenages_Laser_LED *****",$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +H_O+=$I_T +if $Module_m-$Module_m_Origine==0 +text[-1] "Module m : "$Module_m" Demande/Settings : "$Module_m_Origine,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +else +text[-1] "Module m : "$Module_m" Demande/Settings : "$Module_m_Origine,$L_O,$H_O,{$H_P+2},1,255,0,0,255 +fi +H_O+=$I_T +if $Angle_De_Pression_alpha-$Angle_De_Pression_alpha_Origine==0 +text[-1] "Angle de Pression/Pressure Angle : "$Angle_De_Pression_alpha" Demande/Settings : "$Angle_De_Pression_alpha_Origine,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +else +text[-1] "Angle de Pression/Pressure Angle : "$Angle_De_Pression_alpha" Demande/Settings : "$Angle_De_Pression_alpha_Origine,$L_O,$H_O,{$H_P+2},1,255,0,0,255 +fi +H_O+=$I_T +text[-1] "Diam. trou central [pixels] : "$Diam_Trou_Arbre,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Nb de dents roue Z1 / Nb of teeth gear Z1 : "$Nb_Dents_Roue_Z1,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Nb de dents roue Z2 / Nb of teeth gear Z2 : "$Nb_Dents_Roue_Z2,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +if $Trous_Assemb_Erreur>0 +H_O+=$I_T +text[-1] "Erreur : "$Trous_Assemb_Erreur" . Modifier section : Trous pour assemblage / Mechanical assembly.",$L_O,$H_O,{$H_P+2},1,255,0,0,255 +fi +H_O+=$I_T +text[-1] "Nb. trous assemblage : "$Trous_Assemb_Nb,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Diam. trous assemblage [pixels] : "$Trous_Assemb_Diam,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Distance du centre [pixels] : "$Trous_Assemb_Distance_Centre,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Decalage angulaire trous [degres] : "$Trous_Assemb_Decalage_Angle,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +if $Erreur_Rainure>0 +H_O+=$I_T +text[-1] "Erreur : "$Erreur_Rainure" . Modifier section : Mortaise clavette trou central / Keyway cutting.",$L_O,$H_O,{$H_P+2},1,255,0,0,255 +fi +H_O+=$I_T +text[-1] "Mortaise/Keyway Largeur / Width [pixels] : "$Rainure_Largeur,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Mortaise/Keyway Hauteur / Height [pixels] : "$Rainure_Hauteur,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Mortaise/Keyway Decalage Angulaire [degres] : "$14,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Creux b [pixels] : "$Creux_b,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Saillie a [pixels] : "$Saillie_a,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Vide Fond De Dent c [pixels] : "$Vide_Fond_De_Dent_c,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Hauteur de dent ht [pixels] : "$Hauteur_de_dent_ht,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Pas Primitif p [pixels] : "$Pas_Primitif_p,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Epaisseur Circulaire t [pixels] : "$Epaisseur_Circulaire_t,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Hauteur Active hk [pixels] : "$Hauteur_Active_hk,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Primitif Z1 Rouge/Red [pixels] : "$Dia_Primitif_Z1,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Cercle De Base Z1 Jaune/Yellow [pixels] : "$Diametre_Cercle_De_Base_Z1,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Tete Z1 Bleu/Blue [pixels] : "$Dia_Tete_Z1,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Pied Z1 Vert/Green [pixels] : "$Dia_Pied_Z1,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Primitif Z2 Rouge/Red [pixels] : "$Dia_Primitif_Z2,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Cercle De Base Z2 Jaune/Yellow [pixels] : "$Diametre_Cercle_De_Base_Z2,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Tete Z2 Bleu/Blue [pixels] : "$Dia_Tete_Z2,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Pied Z2 Vert/Green [pixels] : "$Dia_Pied_Z2,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +circle[-1] $X_Origine,$Y_Origine,{$Dia_Tete_Z1/2},1,0xFFFFFFFF,0,0,255,255 +circle[-1] $X_Origine,$Y_Origine,{$Dia_Primitif_Z1/2},1,0xFFFFFFFF,255,0,0,255 +circle[-1] $X_Origine,$Y_Origine,{$Dia_Pied_Z1/2},1,0xFFFFFFFF,0,255,0,255 +circle[-1] $X_Origine,$Y_Origine,{$Diametre_Cercle_De_Base_Z1/2},1,0xFFFFFFFF,255,255,0,255 +circle[-1] $X_Origine,$Y_Origine,{$Dia_Tete_Z2/2},1,0xFFFFFFFF,0,0,255,255 +circle[-1] $X_Origine,$Y_Origine,{$Dia_Primitif_Z2/2},1,0xFFFFFFFF,255,0,0,255 +circle[-1] $X_Origine,$Y_Origine,{$Dia_Pied_Z2/2},1,0xFFFFFFFF,0,255,0,255 +circle[-1] $X_Origine,$Y_Origine,{$Diametre_Cercle_De_Base_Z2/2},1,0xFFFFFFFF,255,255,0,255 +if $Contours_Plus==1 erode_circ[-2,-3] 2 fi +line[-1] {$X_Origine-5},$Y_Origine,{$X_Origine+5},$Y_Origine,1,170,85,255,255 +line[-1] $X_Origine,{$Y_Origine-5},$X_Origine,{$Y_Origine+5},1,170,85,255,255 +reverse[-1,-2,-3] +samj_Engrenages_Laser_LED_Preview : +rm[0] +1080,1080,1,4 +fill_color[-1] 255,255,255,255 +Module_m={$1+1} +Angle_De_Pression_alpha={round($2*10000)/10000} +Diam_Trou_Arbre=$3 +Nb_Dents_Roue_Z1=$4 +Nb_Dents_Roue_Z2=$5 +Egalite_Primitif=$6 +Contours_Plus=$7 +Trous_Assemb_Nb=$8 +Trous_Assemb_Diam=$9 +Trous_Assemb_Distance_Centre=$10 +Trous_Assemb_Decalage_Angle={{pi}/180*$11} +Rainure_Largeur=$12 +Rainure_Hauteur=$13 +Rainure_Decalage_Angle={{pi}/180*$14} +Echelle=1 +Dimension_Max_Image=7200 +Reserve_Contour_Image=10 +Module_m_Origine={$Module_m-1} +Dia_Primitif_Z1={$Echelle*$Module_m*$Nb_Dents_Roue_Z1} +Dia_Tete_Z1={$Dia_Primitif_Z1+(2*$Echelle*$Module_m)} +Dia_Primitif_Z2={$Echelle*$Module_m*$Nb_Dents_Roue_Z2} +Dia_Tete_Z2={$Dia_Primitif_Z2+(2*$Echelle*$Module_m)} +if $Nb_Dents_Roue_Z1>$Nb_Dents_Roue_Z2 +do +Module_m-=1 +Dia_Primitif_Z1={$Echelle*$Module_m*$Nb_Dents_Roue_Z1} +Dia_Tete_Z1={$Dia_Primitif_Z1+(2*$Echelle*$Module_m)} +while $Dia_Tete_Z1>$Dimension_Max_Image-2*$Reserve_Contour_Image +else +do +Module_m-=1 +Dia_Primitif_Z2={$Echelle*$Module_m*$Nb_Dents_Roue_Z2} +Dia_Tete_Z2={$Dia_Primitif_Z2+(2*$Echelle*$Module_m)} +while $Dia_Tete_Z2>$Dimension_Max_Image-2*$Reserve_Contour_Image +fi +Dia_Primitif_Z1={$Echelle*$Module_m*$Nb_Dents_Roue_Z1} +Dia_Tete_Z1={$Dia_Primitif_Z1+(2*$Echelle*$Module_m)} +Dia_Pied_Z1={$Dia_Primitif_Z1-(2.5*$Echelle*$Module_m)} +Dia_Primitif_Z2={$Echelle*$Module_m*$Nb_Dents_Roue_Z2} +Dia_Tete_Z2={$Dia_Primitif_Z2+(2*$Echelle*$Module_m)} +Dia_Pied_Z2={$Dia_Primitif_Z2-(2.5*$Echelle*$Module_m)} +Angle_De_Pression_alpha_Origine=$Angle_De_Pression_alpha +Angle_De_Pression_alpha+=0.1 +if $Nb_Dents_Roue_Z1>$Nb_Dents_Roue_Z2 +do +Angle_De_Pression_alpha-=0.1 +Diametre_Cercle_De_Base_Z1={$Dia_Primitif_Z1*cos(((pi)/180*$Angle_De_Pression_alpha))} +Rayon_Developpante_Z1={$Diametre_Cercle_De_Base_Z1/2} +while $Dia_Pied_Z1/2>$Rayon_Developpante_Z1 +else +do +Angle_De_Pression_alpha-=0.1 +Diametre_Cercle_De_Base_Z2={$Dia_Primitif_Z2*cos(((pi)/180*$Angle_De_Pression_alpha))} +Rayon_Developpante_Z2={$Diametre_Cercle_De_Base_Z2/2} +while $Dia_Pied_Z2/2>$Rayon_Developpante_Z2 +fi +Angle_De_Pression_alpha={round($Angle_De_Pression_alpha*10000)/10000} +Dia_Primitif_Z1={$Echelle*$Module_m*$Nb_Dents_Roue_Z1} +Dia_Tete_Z1={$Dia_Primitif_Z1+(2*$Echelle*$Module_m)} +Diametre_Cercle_De_Base_Z1={$Dia_Primitif_Z1*cos(((pi)/180*$Angle_De_Pression_alpha))} +Dia_Pied_Z1={$Dia_Primitif_Z1-(2.5*$Echelle*$Module_m)} +Dia_Primitif_Z2={$Echelle*$Module_m*$Nb_Dents_Roue_Z2} +Dia_Tete_Z2={$Dia_Primitif_Z2+(2*$Echelle*$Module_m)} +Dia_Pied_Z2={$Dia_Primitif_Z2-(2.5*$Echelle*$Module_m)} +Diametre_Cercle_De_Base_Z2={$Dia_Primitif_Z2*cos(((pi)/180*$Angle_De_Pression_alpha))} +Creux_b={$Echelle*$Module_m*1.25} +Saillie_a={$Echelle*$Module_m} +Vide_Fond_De_Dent_c={$Creux_b-$Saillie_a} +Hauteur_de_dent_ht={$Creux_b+$Saillie_a} +Pas_Primitif_p={$Echelle*$Module_m*(pi)} +Epaisseur_Circulaire_t={$Pas_Primitif_p/2} +Hauteur_Active_hk={2*$Saillie_a} +Trous_Assemb_Erreur=0 +if {{$Trous_Assemb_Distance_Centre+{$Trous_Assemb_Diam/2}}>{$Dia_Pied_Z1/2}} Trous_Assemb_Erreur+=1 fi +if {$Trous_Assemb_Distance_Centre-{$Trous_Assemb_Diam/2}}<{$Diam_Trou_Arbre/2} Trous_Assemb_Erreur+=10 fi +if $Trous_Assemb_Nb>3 +Rayon_Cercle_Exterieur={$Trous_Assemb_Distance_Centre+$Trous_Assemb_Diam} +Angle_Theta={pi/$Trous_Assemb_Nb} +Rayon_Cercle_Centre={{$Rayon_Cercle_Exterieur*{1-{sin($Angle_Theta)}}}/{{1+{sin($Angle_Theta)}}}} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre+$Rayon_Cercles_Ext} +Rayon_Tang={({{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}})^0.5} +if $Trous_Assemb_Distance_Centre<$Rayon_Tang Trous_Assemb_Erreur+=100 fi +fi +Erreur_Rainure=0 +if $Rainure_Hauteur>{{$Diam_Trou_Arbre/2}-1} +Erreur_Rainure+=1 +fi +if $Rainure_Largeur>{{$Diam_Trou_Arbre/2}-1} +Erreur_Rainure+=10 +fi +L_O=10 +H_O=0 +I_T=32 +H_P=30 +R_P=0 +V_P=0 +B_P=0 +H_O+=$I_T +text[-1] "***** Engrenages Gears Laser : samj_Engrenages_Laser_LED *****",$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +H_O+=$I_T +if $Module_m-$Module_m_Origine==0 +text[-1] "Module m : "$Module_m" Demande/Settings : "$Module_m_Origine,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +else +text[-1] "Module m : "$Module_m" Demande/Settings : "$Module_m_Origine,$L_O,$H_O,{$H_P+2},1,255,0,0,255 +fi +H_O+=$I_T +if $Angle_De_Pression_alpha-$Angle_De_Pression_alpha_Origine==0 +text[-1] "Angle de Pression/Pressure Angle : "$Angle_De_Pression_alpha" Demande/Settings : "$Angle_De_Pression_alpha_Origine,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +else +text[-1] "Angle de Pression/Pressure Angle : "$Angle_De_Pression_alpha" Demande/Settings : "$Angle_De_Pression_alpha_Origine,$L_O,$H_O,{$H_P+2},1,255,0,0,255 +fi +H_O+=$I_T +text[-1] "Diam. trou central [pixels] : "$Diam_Trou_Arbre,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Nb de dents roue Z1 / Nb of teeth gear Z1 : "$Nb_Dents_Roue_Z1,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Nb de dents roue Z2 / Nb of teeth gear Z2 : "$Nb_Dents_Roue_Z2,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +if $Trous_Assemb_Erreur>0 +H_O+=$I_T +text[-1] "Erreur : "$Trous_Assemb_Erreur" . Modifier section : Trous pour assemblage / Mechanical assembly.",$L_O,$H_O,{$H_P+2},1,255,0,0,255 +fi +H_O+=$I_T +text[-1] "Nb. trous assemblage : "$Trous_Assemb_Nb,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Diam. trous assemblage [pixels] : "$Trous_Assemb_Diam,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Distance du centre [pixels] : "$Trous_Assemb_Distance_Centre,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Decalage angulaire trous [degres] : "$Trous_Assemb_Decalage_Angle,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +if $Erreur_Rainure>0 +H_O+=$I_T +text[-1] "Erreur : "$Erreur_Rainure" . Modifier section : Mortaise clavette trou central / Keyway cutting.",$L_O,$H_O,{$H_P+2},1,255,0,0,255 +fi +H_O+=$I_T +text[-1] "Mortaise/Keyway Largeur / Width [pixels] : "$Rainure_Largeur,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Mortaise/Keyway Hauteur / Height [pixels] : "$Rainure_Hauteur,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Mortaise/Keyway Decalage Angulaire [degres] : "$14,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Creux b [pixels] : "$Creux_b,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Saillie a [pixels] : "$Saillie_a,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Vide Fond De Dent c [pixels] : "$Vide_Fond_De_Dent_c,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Hauteur de dent ht [pixels] : "$Hauteur_de_dent_ht,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Pas Primitif p [pixels] : "$Pas_Primitif_p,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Epaisseur Circulaire t [pixels] : "$Epaisseur_Circulaire_t,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Hauteur Active hk [pixels] : "$Hauteur_Active_hk,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Primitif Z1 [pixels] : "$Dia_Primitif_Z1,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Cercle De Base Z1 [pixels] : "$Diametre_Cercle_De_Base_Z1,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Tete Z1 [pixels] : "$Dia_Tete_Z1,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Pied Z1 [pixels] : "$Dia_Pied_Z1,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Primitif Z2 [pixels] : "$Dia_Primitif_Z2,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Cercle De Base Z2 [pixels] : "$Diametre_Cercle_De_Base_Z2,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Tete Z2 [pixels] : "$Dia_Tete_Z2,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Pied Z2 [pixels] : "$Dia_Pied_Z2,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +samj_etoile_de_pompei_153 : +Angle_inclinaison=$3 +R_C1=$5 +V_C1=$6 +B_C1=$7 +A_C1=$8 +R_C2=$9 +V_C2=$10 +B_C2=$11 +A_C2=$12 +R_C3=$13 +V_C3=$14 +B_C3=$15 +A_C3=$16 +R_C4=$17 +V_C4=$18 +B_C4=$19 +A_C4=$20 +Remplir_cercle=$21 +angle_point1_carre={0+$Angle_inclinaison} +angle_point2_carre={60+$Angle_inclinaison} +angle_point3_carre={45+$Angle_inclinaison} +angle_point4_carre={15+$Angle_inclinaison} +angle_point5_triangle={30+$Angle_inclinaison} +foreach { +X={round({{w}*{$1/100}})} +Y={round({{h}*{$2/100}})} +Dimension={round(min({w},{h})/547*$4)} +Rayon_Cercle_1=$Dimension +Rayon_Cercle_2={{{2*$Dimension*$Dimension}-{2*$Dimension*$Dimension*{cos(pi/180*150)}}}^0.5} +Rayon_Cercle_3={$Dimension+{$Dimension*{3^0.5}}} +{w},{h},1,4 +rm.. +if {$Remplir_cercle==1} +ellipse[-1] $X,$Y,$Rayon_Cercle_3,$Rayon_Cercle_3,0,1,$R_C4,$V_C4,$B_C4,$A_C4 +fi +ellipse[-1] $X,$Y,$Rayon_Cercle_1,$Rayon_Cercle_1,0,1,$R_C3,$V_C3,$B_C3,$A_C3 +repeat 6 +point1_X={round({$Rayon_Cercle_1*{cos(pi/180*$angle_point1_carre)}})} +point1_Y={round({$Rayon_Cercle_1*{sin(pi/180*$angle_point1_carre)}})} +point2_X={round({$Rayon_Cercle_1*{cos(pi/180*{$angle_point2_carre})}})} +point2_Y={round({$Rayon_Cercle_1*{sin(pi/180*{$angle_point2_carre})}})} +point3_X={round({$Rayon_Cercle_2*{cos(pi/180*{$angle_point3_carre})}})} +point3_Y={round({$Rayon_Cercle_2*{sin(pi/180*{$angle_point3_carre})}})} +point4_X={round({$Rayon_Cercle_2*{cos(pi/180*{$angle_point4_carre})}})} +point4_Y={round({$Rayon_Cercle_2*{sin(pi/180*{$angle_point4_carre})}})} +polygon[-1] 4,{$X+$point1_X},{$Y+$point1_Y},{$X+$point2_X},{$Y+$point2_Y},{$X+$point3_X},{$Y+$point3_Y},{$X+$point4_X},{$Y+$point4_Y},1,$R_C1,$V_C1,$B_C1,$A_C1 +point5_X={round({$Rayon_Cercle_3*{cos(pi/180*{$angle_point5_triangle})}})} +point5_Y={round({$Rayon_Cercle_3*{sin(pi/180*{$angle_point5_triangle})}})} +polygon[-1] 3,{$X+$point3_X},{$Y+$point3_Y},{$X+$point4_X},{$Y+$point4_Y},{$X+$point5_X},{$Y+$point5_Y},1,$R_C2,$V_C2,$B_C2,$A_C2 +point6_X={round({$Rayon_Cercle_3*{cos(pi/180*{$angle_point2_carre})}})} +point6_Y={round({$Rayon_Cercle_3*{sin(pi/180*{$angle_point2_carre})}})} +polygon[-1] 3,{$X+$point2_X},{$Y+$point2_Y},{$X+$point3_X},{$Y+$point3_Y},{$X+$point6_X},{$Y+$point6_Y},1,$R_C3,$V_C3,$B_C3,$A_C3 +point7_X={round({$Rayon_Cercle_3*{cos(pi/180*{$angle_point1_carre})}})} +point7_Y={round({$Rayon_Cercle_3*{sin(pi/180*{$angle_point1_carre})}})} +polygon[-1] 3,{$X+$point1_X},{$Y+$point1_Y},{$X+$point4_X},{$Y+$point4_Y},{$X+$point7_X},{$Y+$point7_Y},1,$R_C3,$V_C3,$B_C3,$A_C3 +angle_point1_carre={$angle_point1_carre+60} +angle_point2_carre={$angle_point2_carre+60} +angle_point3_carre={$angle_point3_carre+60} +angle_point4_carre={$angle_point4_carre+60} +angle_point5_triangle={$angle_point5_triangle+60} +done +if $22>0 smooth $22 fi +} +samj_Etoile_De_Pompei_Triangles_Sierpinski : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Angle_inclinaison=$3 +if $4>0 +Dimension={round({w*$4/{400*{2^0.5}}})} +else +Dimension={round({-h*$4/{400*{2^0.5}}})} +fi +R_Cadre=$5 +V_Cadre=$6 +B_Cadre=$7 +A_Cadre=$8 +Afficher_Cadre=$9 +Recursions_Sierpinski=$10 +R_Centre=$11 +V_Centre=$12 +B_Centre=$13 +A_Centre=$14 +R_Centreb=$15 +V_Centreb=$16 +B_Centreb=$17 +A_Centreb=$18 +R_Triangle=$19 +V_Triangle=$20 +B_Triangle=$21 +A_Triangle=$22 +R_Demi_Losange=$23 +V_Demi_Losange=$24 +B_Demi_Losange=$25 +A_Demi_Losange=$26 +R_Demi_Losange_Deux=$27 +V_Demi_Losange_Deux=$28 +B_Demi_Losange_Deux=$29 +A_Demi_Losange_Deux=$30 +R_Cercle=$31 +V_Cercle=$32 +B_Cercle=$33 +A_Cercle=$34 +Couleurs_aleatoires=$35 +Inversions=$36 +Flou=$37 +Dilatation=$38 +Deformation=$39 +Bruit=$40 +Ombre=$41 +X_Ombre=$42 +Y_Ombre=$43 +Smoothness_Ombre=$44 +Curvature_Ombre=$45 +Compensation_Decalage_Ombre_X=$46 +Compensation_Decalage_Ombre_Y=$47 +Canal_Alpha=$48 +Largeur_Origine={w} +Hauteur_Origine={h} +Rayon_Cercle_1=$Dimension +Rayon_Cercle_2={{{2*$Dimension*$Dimension}-{2*$Dimension*$Dimension*{cos(pi/180*150)}}}^0.5} +Rayon_Cercle_3={$Dimension+{$Dimension*{3^0.5}}} +dephasage_point1_carre={0+$Angle_inclinaison} +dephasage_point2_carre={60+$Angle_inclinaison} +dephasage_point3_carre={45+$Angle_inclinaison} +dephasage_point4_carre={15+$Angle_inclinaison} +dephasage_point5_triangle={30+$Angle_inclinaison} +Nb_Boucle=0 +H_X_a=0 +H_Y_a=0 +H_X_b=0 +H_Y_b=0 +H_X_c=0 +H_Y_c=0 +H_X_d=0 +H_Y_d=0 +H_X_e=0 +H_Y_e=0 +H_X_f=0 +H_Y_f=0 +xca=0 +yca=0 +Angle_C=0 +xcb=0 +ycb=0 +xcc=0 +ycc=0 +xcd=0 +ycd=0 +xce=0 +yce=0 +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Couleurs_aleatoires==1 +R_Centre={round(u)*255} +V_Centre={round(u)*255} +B_Centre={round(u)*255} +R_Centreb={round(u)*255} +V_Centreb={round(u)*255} +B_Centreb={round(u)*255} +R_Triangle={round(u)*255} +V_Triangle={round(u)*255} +B_Triangle={round(u)*255} +R_Demi_Losange={round(u)*255} +V_Demi_Losange={round(u)*255} +B_Demi_Losange={round(u)*255} +R_Demi_Losange_Deux={round(u)*255} +V_Demi_Losange_Deux={round(u)*255} +B_Demi_Losange_Deux={round(u)*255} +R_Cercle={round(u)*255} +V_Cercle={round(u)*255} +B_Cercle={round(u)*255} +fi +if $Afficher_Cadre>0 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +if $Afficher_Cadre==2 +ellipse[-2] $X,$Y,$Rayon_Cercle_3,$Rayon_Cercle_3,0,1,0xFFFFFFFF,$R_Cadre,$V_Cadre,$B_Cadre,$A_Cadre +ellipse[-1] $X,$Y,$Rayon_Cercle_3,$Rayon_Cercle_3,0,1,$R_Cercle,$V_Cercle,$B_Cercle,$A_Cercle +fi +repeat 6 +Nb_Boucle={$Nb_Boucle+1} +if $Couleurs_aleatoires==1 +R_Centreb={round(u)*255} +V_Centreb={round(u)*255} +B_Centreb={round(u)*255} +R_Triangle={round(u)*255} +V_Triangle={round(u)*255} +B_Triangle={round(u)*255} +R_Demi_Losange_Deux={round(u)*255} +V_Demi_Losange_Deux={round(u)*255} +B_Demi_Losange_Deux={round(u)*255} +fi +point1_X={round({$Rayon_Cercle_1*{cos(pi/180*$dephasage_point1_carre)}})} +point1_Y={round({$Rayon_Cercle_1*{sin(pi/180*$dephasage_point1_carre)}})} +point2_X={round({$Rayon_Cercle_1*{cos(pi/180*{$dephasage_point2_carre})}})} +point2_Y={round({$Rayon_Cercle_1*{sin(pi/180*{$dephasage_point2_carre})}})} +point3_X={round({$Rayon_Cercle_2*{cos(pi/180*{$dephasage_point3_carre})}})} +point3_Y={round({$Rayon_Cercle_2*{sin(pi/180*{$dephasage_point3_carre})}})} +point4_X={round({$Rayon_Cercle_2*{cos(pi/180*{$dephasage_point4_carre})}})} +point4_Y={round({$Rayon_Cercle_2*{sin(pi/180*{$dephasage_point4_carre})}})} +if $Nb_Boucle==1 +H_X_a={$X+$point1_X} +H_Y_a={$Y+$point1_Y} +elif $Nb_Boucle==2 +H_X_b={$X+$point1_X} +H_Y_b={$Y+$point1_Y} +elif $Nb_Boucle==3 +H_X_c={$X+$point1_X} +H_Y_c={$Y+$point1_Y} +elif $Nb_Boucle==4 +H_X_d={$X+$point1_X} +H_Y_d={$Y+$point1_Y} +elif $Nb_Boucle==5 +H_X_e={$X+$point1_X} +H_Y_e={$Y+$point1_Y} +elif $Nb_Boucle==6 +H_X_f={$X+$point1_X} +H_Y_f={$Y+$point1_Y} +fi +point5_X={round({$Rayon_Cercle_3*{cos(pi/180*{$dephasage_point5_triangle})}})} +point5_Y={round({$Rayon_Cercle_3*{sin(pi/180*{$dephasage_point5_triangle})}})} +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,{$X+$point3_X},{$Y+$point3_Y},{$X+$point4_X},{$Y+$point4_Y},{$X+$point5_X},{$Y+$point5_Y},$R_Triangle,$V_Triangle,$B_Triangle,$A_Triangle +point6_X={round({$Rayon_Cercle_3*{cos(pi/180*{$dephasage_point2_carre})}})} +point6_Y={round({$Rayon_Cercle_3*{sin(pi/180*{$dephasage_point2_carre})}})} +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,{$X+$point2_X},{$Y+$point2_Y},{$X+$point3_X},{$Y+$point3_Y},{$X+$point6_X},{$Y+$point6_Y},$R_Demi_Losange_Deux,$V_Demi_Losange_Deux,$B_Demi_Losange_Deux,$A_Demi_Losange_Deux +point7_X={round({$Rayon_Cercle_3*{cos(pi/180*{$dephasage_point1_carre})}})} +point7_Y={round({$Rayon_Cercle_3*{sin(pi/180*{$dephasage_point1_carre})}})} +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,{$X+$point1_X},{$Y+$point1_Y},{$X+$point4_X},{$Y+$point4_Y},{$X+$point7_X},{$Y+$point7_Y},$R_Demi_Losange,$V_Demi_Losange,$B_Demi_Losange,$A_Demi_Losange +if $Afficher_Cadre>0 +polygon[-2] 3,{$X+$point3_X},{$Y+$point3_Y},{$X+$point4_X},{$Y+$point4_Y},{$X+$point5_X},{$Y+$point5_Y},1,0xFFFFFFFF,$R_Cadre,$V_Cadre,$B_Cadre,$A_Cadre +polygon[-2] 3,{$X+$point2_X},{$Y+$point2_Y},{$X+$point3_X},{$Y+$point3_Y},{$X+$point6_X},{$Y+$point6_Y},1,0xFFFFFFFF,$R_Cadre,$V_Cadre,$B_Cadre,$A_Cadre +polygon[-2] 3,{$X+$point1_X},{$Y+$point1_Y},{$X+$point4_X},{$Y+$point4_Y},{$X+$point7_X},{$Y+$point7_Y},1,0xFFFFFFFF,$R_Cadre,$V_Cadre,$B_Cadre,$A_Cadre +fi +if $Afficher_Cadre==2 +polygon[-2] 4,{$X+$point1_X},{$Y+$point1_Y},{$X+$point2_X},{$Y+$point2_Y},{$X+$point3_X},{$Y+$point3_Y},{$X+$point4_X},{$Y+$point4_Y},1,0xFFFFFFFF,$R_Cadre,$V_Cadre,$B_Cadre,$A_Cadre +fi +dephasage_point1_carre={$dephasage_point1_carre+60} +dephasage_point2_carre={$dephasage_point2_carre+60} +dephasage_point3_carre={$dephasage_point3_carre+60} +dephasage_point4_carre={$dephasage_point4_carre+60} +dephasage_point5_triangle={$dephasage_point5_triangle+60} +done +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$H_X_a,$H_Y_a,$H_X_b,$H_Y_b,$X,$Y,$R_Centre,$V_Centre,$B_Centre,$A_Centre +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$H_X_b,$H_Y_b,$H_X_c,$H_Y_c,$X,$Y,$R_Centreb,$V_Centreb,$B_Centreb,$A_Centreb +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$H_X_c,$H_Y_c,$H_X_d,$H_Y_d,$X,$Y,$R_Centre,$V_Centre,$B_Centre,$A_Centre +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$H_X_d,$H_Y_d,$H_X_e,$H_Y_e,$X,$Y,$R_Centreb,$V_Centreb,$B_Centreb,$A_Centreb +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$H_X_e,$H_Y_e,$H_X_f,$H_Y_f,$X,$Y,$R_Centre,$V_Centre,$B_Centre,$A_Centre +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$H_X_f,$H_Y_f,$H_X_a,$H_Y_a,$X,$Y,$R_Centreb,$V_Centreb,$B_Centreb,$A_Centreb +if $Afficher_Cadre==0 +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +elif $Afficher_Cadre==1 +polygon[-2] 6,$H_X_a,$H_Y_a,$H_X_b,$H_Y_b,$H_X_c,$H_Y_c,$H_X_d,$H_Y_d,$H_X_e,$H_Y_e,$H_X_f,$H_Y_f,1,0xFFFFFFFF,$R_Cadre,$V_Cadre,$B_Cadre,$A_Cadre +fi +if $Afficher_Cadre>0 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Etoiles_Remplies_Triangles_Sierpinski : +Nombre_de_sommets=$1 +X={round({w*{$2/100}})} +Y={round({h*{$3/100}})} +if $4>0 +Rayon_cercle_exterieur={round({w*$4/{100}})} +else +Rayon_cercle_exterieur={round({-h*$4/{100}})} +fi +Rayon_cercle_interieur={round($Rayon_cercle_exterieur*$5/100)} +Angle_inclinaison=$6 +Pourcentage_excentricite=$7 +Angle_excentricite=$8 +R_Contours=$9 +V_Contours=$10 +B_Contours=$11 +A_Contours=$12 +Affichage=$13 +Recursions_Sierpinski=$14 +R_Centre=$15 +V_Centre=$16 +B_Centre=$17 +A_Centre=$18 +R_Centreb=$19 +V_Centreb=$20 +B_Centreb=$21 +A_Centreb=$22 +R_Sommet=$23 +V_Sommet=$24 +B_Sommet=$25 +A_Sommet=$26 +R_Sommetb=$27 +V_Sommetb=$28 +B_Sommetb=$29 +A_Sommetb=$30 +R_Cercle=$31 +V_Cercle=$32 +B_Cercle=$33 +A_Cercle=$34 +Couleurs_aleatoires=$35 +Inversions=$36 +Flou=$37 +Dilatation=$38 +Deformation=$39 +Bruit=$40 +Ombre=$41 +X_Ombre=$42 +Y_Ombre=$43 +Smoothness_Ombre=$44 +Curvature_Ombre=$45 +Compensation_Decalage_Ombre_X=$46 +Compensation_Decalage_Ombre_Y=$47 +Canal_Alpha=$48 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_Boucle=0 +Angle=0 +Increment_angle={360/$Nombre_de_sommets} +Longueur_excentricite={$Pourcentage_excentricite/100*($Rayon_cercle_exterieur-$Rayon_cercle_interieur)} +Decalage_X_excentricite={round({$Longueur_excentricite*{cos(pi/180*$Angle_excentricite)}})} +Decalage_Y_excentricite={round({$Longueur_excentricite*{sin(pi/180*$Angle_excentricite)}})} +X_centre_cercle_interieur={$X+$Decalage_X_excentricite} +Y_centre_cercle_interieur={$Y+$Decalage_Y_excentricite} +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Couleurs_aleatoires==1 +R_Centre={round(u)*255} +V_Centre={round(u)*255} +B_Centre={round(u)*255} +R_Centreb={round(u)*255} +V_Centreb={round(u)*255} +B_Centreb={round(u)*255} +R_Sommet={round(u)*255} +V_Sommet={round(u)*255} +B_Sommet={round(u)*255} +R_Sommetb={round(u)*255} +V_Sommetb={round(u)*255} +B_Sommetb={round(u)*255} +R_Sommetb_Deux={round(u)*255} +V_Sommetb_Deux={round(u)*255} +B_Sommetb_Deux={round(u)*255} +R_Cercle={round(u)*255} +V_Cercle={round(u)*255} +B_Cercle={round(u)*255} +fi +if $Affichage>3 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +if $Affichage==2||$Affichage==3||$Affichage==6||$Affichage==7 +ellipse[-1] $X,$Y,$Rayon_cercle_exterieur,$Rayon_cercle_exterieur,0,1,$R_Cercle,$V_Cercle,$B_Cercle,$A_Cercle +fi +repeat $Nombre_de_sommets +if $Couleurs_aleatoires==1 +R_Centre={round(u)*255} +V_Centre={round(u)*255} +B_Centre={round(u)*255} +R_Centreb={round(u)*255} +V_Centreb={round(u)*255} +B_Centreb={round(u)*255} +R_Sommet={round(u)*255} +V_Sommet={round(u)*255} +B_Sommet={round(u)*255} +R_Sommetb={round(u)*255} +V_Sommetb={round(u)*255} +B_Sommetb={round(u)*255} +R_Sommetb_Deux={round(u)*255} +V_Sommetb_Deux={round(u)*255} +B_Sommetb_Deux={round(u)*255} +R_Cercle={round(u)*255} +V_Cercle={round(u)*255} +B_Cercle={round(u)*255} +fi +Nb_Boucle+=1 +X_point_exterieur={$X+(round(($Rayon_cercle_exterieur*(cos((pi/180*($Angle+$Angle_inclinaison)))))))} +Y_point_exterieur={$Y+(round(($Rayon_cercle_exterieur*(sin((pi/180*($Angle+$Angle_inclinaison)))))))} +X_point_interieur_a={$X_centre_cercle_interieur+(round(($Rayon_cercle_interieur*(cos((pi/180*($Angle+$Angle_inclinaison+(180/$Nombre_de_sommets))))))))} +Y_point_interieur_a={$Y_centre_cercle_interieur+(round(($Rayon_cercle_interieur*(sin((pi/180*($Angle+$Angle_inclinaison+(180/$Nombre_de_sommets))))))))} +X_point_interieur_b={$X_centre_cercle_interieur+(round(($Rayon_cercle_interieur*(cos((pi/180*($Angle+$Angle_inclinaison-(180/$Nombre_de_sommets))))))))} +Y_point_interieur_b={$Y_centre_cercle_interieur+(round(($Rayon_cercle_interieur*(sin((pi/180*($Angle+$Angle_inclinaison-(180/$Nombre_de_sommets))))))))} +if ($Nombre_de_sommets%2)==0 +if ($Nb_Boucle%2)==0 +if $Recursions_Sierpinski==0 +polygon[-1] 3,$X_point_exterieur,$Y_point_exterieur,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,1,$R_Sommet,$V_Sommet,$B_Sommet,$A_Sommet +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_point_exterieur,$Y_point_exterieur,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,$R_Sommet,$V_Sommet,$B_Sommet,$A_Sommet +fi +if ($Affichage%2)==1 +if $Recursions_Sierpinski==0 +polygon[-1] 3,$X,$Y,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,1,$R_Centre,$V_Centre,$B_Centre,$A_Centre +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X,$Y,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,$R_Centre,$V_Centre,$B_Centre,$A_Centre +fi +fi +else +if $Recursions_Sierpinski==0 +polygon[-1] 3,$X_point_exterieur,$Y_point_exterieur,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,1,$R_Sommetb,$V_Sommetb,$B_Sommetb,$A_Sommetb +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_point_exterieur,$Y_point_exterieur,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,$R_Sommetb,$V_Sommetb,$B_Sommetb,$A_Sommetb +fi +if ($Affichage%2)==1 +if $Recursions_Sierpinski==0 +polygon[-1] 3,$X,$Y,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,1,$R_Centreb,$V_Centreb,$B_Centreb,$A_Centreb +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X,$Y,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,$R_Centreb,$V_Centreb,$B_Centreb,$A_Centreb +fi +fi +fi +else +if $Recursions_Sierpinski==0 +polygon[-1] 3,$X_point_exterieur,$Y_point_exterieur,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,1,$R_Sommet,$V_Sommet,$B_Sommet,$A_Sommet +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_point_exterieur,$Y_point_exterieur,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,$R_Sommet,$V_Sommet,$B_Sommet,$A_Sommet +fi +if ($Affichage%2)==1 +if $Recursions_Sierpinski==0 +polygon[-1] 3,$X,$Y,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,1,$R_Centre,$V_Centre,$B_Centre,$A_Centre +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X,$Y,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,$R_Centre,$V_Centre,$B_Centre,$A_Centre +fi +fi +fi +if $Affichage>3 +polygon[-2] 3,$X_point_exterieur,$Y_point_exterieur,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +Angle={$Increment_angle*$Nb_Boucle} +done +if $Affichage>5 +ellipse[-2] $X,$Y,$Rayon_cercle_exterieur,$Rayon_cercle_exterieur,0,1,0xFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Affichage>3 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Etoiles_Laser_LED : +rm[0] +$1,$1,1,4 +fill_color[-1] 255,255,255,255 +if $3==0 +samj_Etoile_De_Pompei_Triangles_Sierpinski[-1] 50,50,30,96,0,0,0,255,1,1,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,$5,0,0,0,0.5,0.5,1.8,0,0,0,0 +elif $3==1 +samj_Etoile_De_Pompei_Triangles_Sierpinski[-1] 50,50,30,96,0,0,0,255,1,2,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,$5,0,0,0,0.5,0.5,1.8,0,0,0,0 +elif $3==2 +samj_en_Formes_Geometriques_Simples[-1] 50,50,255,255,255,255,0,0,0,255,255,255,255,255,3,48,48,$2,0,$5,1 +elif $3==3 +samj_Annular_Steiner_Chains[-1] 50,50,46,$2,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,$5,0,0,0,0.5,0.5,1.8,0,0,0,1 +elif $3==4 +Traits_Strokes_samj[-1] 50,50,46,0,100,0,$2,0,360,0,0,0,255,0,$5,0,20,0,0,0,1,1 +elif $3==5 +shape_gear[-1] {$1*0.96},$2,100,0,0 +n[-1] 0,255 +samj_blend_20220419[-1,-2] alpha,1,0 +to_rgb[-1] +negate[-1] +to_rgba[-1] +elif $3==6 +Spirographe_samj[-1] 50,50,208,52,150,0,0,0,255,0,0,1,0,1,0,0,0,0,0,0,255,$5,0,0,0,255,0,0,0,1,1 +fi +if $6>0 +circle[-1] {$1/2},{$1/2},{$1*$6/100},1,0,0,0,255 +fi +if $7>0 +circle[-1] {$1/2},{$1/2},{$1*$7/100},1,255,255,255,255 +fi +to_rgba[-1] +if $4==1 +polygon[-1] 4,1%,1%,99%,1%,99%,99%,1%,99%,1,0xFFFFFFFF,0,0,0,1 +elif $4==2 +gradient_norm[-1] +negate[-1] +elif $4==3 +gradient_norm[-1] +negate[-1] +polygon[-1] 4,1%,1%,99%,1%,99%,99%,1%,99%,1,0xFFFFFFFF,0,0,0,1 +fi +replace_color[-1] 70%,0,0,0,0,255,0,0,0,255 +samj_Flocon_Laser_LED : +rm[0] +$1,$1,1,4 +fill_color[-1] 255,255,255,255 +samj_Flocon_De_Neige[-1] 50,50,$2,45,40,0,1,0,0,0,1,2,1,0,0,0,0.7,$3,0,0,0,44,0,0,0,0.5,0.5,1.8,0,0,0,0 +if $4==1 +polygon[-1] 4,1%,1%,99%,1%,99%,99%,1%,99%,1,0xFFFFFFFF,0,0,0,1 +elif $4==2 +gradient_norm[-1] +negate[-1] +replace_color[-1] 70%,0,0,0,0,255,0,0,0,255 +elif $4==3 +gradient_norm[-1] +negate[-1] +polygon[-1] 4,1%,1%,99%,1%,99%,99%,1%,99%,1,0xFFFFFFFF,0,0,0,1 +replace_color[-1] 70%,0,0,0,0,255,0,0,0,255 +fi +samj_Fractal_Tree : +foreach { +x1={round(w/100*$1)} +y1={round(h/100*$2)} +angle=$3 +depth=$4 +Variation_Dimension={w/1000*$5} +Variation_angle=$6 +R_a=$7 +V_a=$8 +B_a=$9 +A_a=$10 +Variation_Couleur=$11 +Motif=$12 +Dimension_Motif=$13 +Dilatation=$14 +Validation_Smooth_Antialias=$15 +V_Amplitude=$16 +V_Edge_Threshold=$17 +V_Smoothness=$18 +to_rgba[-1] +{w},{h},1,4 +samj_drawTree[-1] $x1,$y1,$angle,$depth,$Variation_Dimension,$Variation_angle,$R_a,$V_a,$B_a,$A_a,$Variation_Couleur,$Motif,$Dimension_Motif +dilate[-1] $Dilatation +if $Validation_Smooth_Antialias==1 fx_smooth_antialias[-1] $V_Amplitude,$V_Edge_Threshold,$V_Smoothness fi +samj_blend_20220419[-1,-2] alpha +} +samj_drawTree : +if $4!=0 +R_DT=$7 +V_DT=$8 +B_DT=$9 +A_DT=$10 +if $11<0 +R_DT={round(u(0,255))} +V_DT={round(u(0,255))} +B_DT={round(u(0,255))} +elif $11>0 +R_DT+=$11 +V_DT+=$11 +B_DT+=$11 +if $R_DT>255 +R_DT={255-{$11*$4}} +fi +if $V_DT>255 +V_DT={255-{$11*$4}} +fi +if $B_DT>255 +B_DT={255-{$11*$4}} +fi +fi +x2={$1+(cos(($3*(pi/180)))*$4*$5)} +y2={$2+(sin(($3*(pi/180)))*$4*$5)} +if $12==0 +line[-1] $1,$2,$x2,$y2,1,$7,$8,$9,$10 +elif $12==1 +line[-1] $1,$2,$x2,$y2,1,$7,$8,$9,$10 +circle[-1] $x2,$y2,$13,1,$R_DT,$V_DT,$B_DT,$A_DT +elif $12==2 +line[-1] $1,$2,$x2,$y2,1,$7,$8,$9,$10 +circle[-1] $x2,$y2,$13,1,0xFFFFFFFF,$R_DT,$V_DT,$B_DT,$A_DT +fi +samj_drawTree[-1] $x2,$y2,{$3-$6},{$4-1},$5,$6,$R_DT,$V_DT,$B_DT,$A_DT,$11,$12,$13 +if $11<0 +R_DT={round(u(0,255))} +V_DT={round(u(0,255))} +B_DT={round(u(0,255))} +fi +samj_drawTree[-1] $x2,$y2,{$3+$6},{$4-1},$5,$6,$R_DT,$V_DT,$B_DT,$A_DT,$11,$12,$13 +fi +samj_rien_repair : +Je_passe_l_hiver_en_Floride[-1] +samj_Linear_Gradient_CIE_Lab : +Type_Degrade=$1 +Swap_colors=$2 +Ra=$3 +Ga=$4 +Ba=$5 +Aa=$6 +Rb=$7 +Gb=$8 +Bb=$9 +Ab=$10 +if $Swap_colors==1 +Ra=$7 +Ga=$8 +Ba=$9 +Aa=$10 +Rb=$3 +Gb=$4 +Bb=$5 +Ab=$6 +fi +nt_Ra={$Ra/255} +nt_Ga={$Ga/255} +nt_Ba={$Ba/255} +if $nt_Ra>0.04045 +nt_Ra={({{$nt_Ra+0.055}/1.055})^2.4} +else +nt_Ra/=12.92 +fi +if $nt_Ga>0.04045 +nt_Ga={({{$nt_Ga+0.055}/1.055})^2.4} +else +nt_Ga/=12.92 +fi +if $nt_Ba>0.04045 +nt_Ba={({{$nt_Ba+0.055}/1.055})^2.4} +else +nt_Ba/=12.92 +fi +nt_Ra*=100 +nt_Ga*=100 +nt_Ba*=100 +Xa={$nt_Ra*0.4124564+$nt_Ga*0.3575761+$nt_Ba*0.1804375} +Ya={$nt_Ra*0.2126729+$nt_Ga*0.7151522+$nt_Ba*0.0721750} +Za={$nt_Ra*0.0193339+$nt_Ga*0.1191920+$nt_Ba*0.9503041} +Xca=$Xa +Yca=$Ya +Zca=$Za +ref_Xa=95.047 +ref_Ya=100.000 +ref_Za=108.883 +nt_Xa={$Xca/$ref_Xa} +nt_Ya={$Yca/$ref_Ya} +nt_Za={$Zca/$ref_Za} +if $nt_Xa>0.008856 +nt_Xa={($nt_Xa)^{1/3}} +else +nt_Xa={{7.787*$nt_Xa}+{16/116}} +fi +if $nt_Ya>0.008856 +nt_Ya={($nt_Ya)^{1/3}} +else +nt_Ya={{7.787*$nt_Ya}+{16/116}} +fi +if $nt_Za>0.008856 +nt_Za={($nt_Za)^{1/3}} +else +nt_Za={{7.787*$nt_Za}+{16/116}} +fi +CIE_La={{116*$nt_Ya}-16} +CIE_aa={500*{$nt_Xa-$nt_Ya}} +CIE_ba={200*{$nt_Ya-$nt_Za}} +nt_Ra={$Rb/255} +nt_Ga={$Gb/255} +nt_Ba={$Bb/255} +if $nt_Ra>0.04045 +nt_Ra={({{$nt_Ra+0.055}/1.055})^2.4} +else +nt_Ra/=12.92 +fi +if $nt_Ga>0.04045 +nt_Ga={({{$nt_Ga+0.055}/1.055})^2.4} +else +nt_Ga/=12.92 +fi +if $nt_Ba>0.04045 +nt_Ba={({{$nt_Ba+0.055}/1.055})^2.4} +else +nt_Ba/=12.92 +fi +nt_Ra*=100 +nt_Ga*=100 +nt_Ba*=100 +Xb={$nt_Ra*0.4124564+$nt_Ga*0.3575761+$nt_Ba*0.1804375} +Yb={$nt_Ra*0.2126729+$nt_Ga*0.7151522+$nt_Ba*0.0721750} +Zb={$nt_Ra*0.0193339+$nt_Ga*0.1191920+$nt_Ba*0.9503041} +Xca=$Xb +Yca=$Yb +Zca=$Zb +ref_Xa=95.047 +ref_Ya=100.000 +ref_Za=108.883 +nt_Xa={$Xca/$ref_Xa} +nt_Ya={$Yca/$ref_Ya} +nt_Za={$Zca/$ref_Za} +if $nt_Xa>0.008856 +nt_Xa={($nt_Xa)^{1/3}} +else +nt_Xa={{7.787*$nt_Xa}+{16/116}} +fi +if $nt_Ya>0.008856 +nt_Ya={($nt_Ya)^{1/3}} +else +nt_Ya={{7.787*$nt_Ya}+{16/116}} +fi +if $nt_Za>0.008856 +nt_Za={($nt_Za)^{1/3}} +else +nt_Za={{7.787*$nt_Za}+{16/116}} +fi +CIE_Lb={{116*$nt_Ya}-16} +CIE_ab={500*{$nt_Xa-$nt_Ya}} +CIE_bb={200*{$nt_Ya-$nt_Za}} +{w},{h},1,4 +rm[-2] +Nb_Boucles=0 +Decalage_L=0 +Decalage_a=0 +Decalage_b=0 +if $Type_Degrade==0 +Dimensions={w} +Inc_L={{$CIE_La-$CIE_Lb}/w} +Inc_a={{$CIE_aa-$CIE_ab}/w} +Inc_b={{$CIE_ba-$CIE_bb}/w} +Inc_Alpha={{$Ab-$Aa}/w} +elif $Type_Degrade==1 +Dimensions={h} +Inc_L={{$CIE_La-$CIE_Lb}/h} +Inc_a={{$CIE_aa-$CIE_ab}/h} +Inc_b={{$CIE_ba-$CIE_bb}/h} +Inc_Alpha={{$Ab-$Aa}/h} +fi +repeat $Dimensions +Aa+=$Inc_Alpha +if $Aa>255 Aa=255 fi +if $Aa<0 Aa=0 fi +CIE_Lca={$CIE_La+$Decalage_L-($Nb_Boucles*$Inc_L)} +CIE_aca={$CIE_aa+$Decalage_a-($Nb_Boucles*$Inc_a)} +CIE_bca={$CIE_ba+$Decalage_b-($Nb_Boucles*$Inc_b)} +if $CIE_Lca>100 CIE_Lca=100 fi +if $CIE_Lca<0 CIE_Lca=0 fi +if $CIE_aca>127 CIE_aca=127 fi +if $CIE_aca<-128 CIE_aca=-128 fi +if $CIE_bca>127 CIE_bca=127 fi +if $CIE_bca<-128 CIE_bca=-128 fi +nt_Yca={{$CIE_Lca+16}/116} +nt_Xca={$CIE_aca/500+$nt_Yca} +nt_Zca={$nt_Yca-$CIE_bca/200} +if {($nt_Yca)^3}>0.008856 +nt_Yca={($nt_Yca)^3} +else +nt_Yca={{$nt_Yca-16/116}/7.787} +fi +if {($nt_Xca)^3}>0.008856 +nt_Xca={($nt_Xca)^3} +else +nt_Xca={{$nt_Xca-16/116}/7.787} +fi +if {($nt_Zca)^3}>0.008856 +nt_Zca={($nt_Zca)^3} +else +nt_Zca={{$nt_Zca-16/116}/7.787} +fi +ref_Xca=95.047 +ref_Yca=100.000 +ref_Zca=108.883 +Xca={$ref_Xca*$nt_Xca} +Yca={$ref_Yca*$nt_Yca} +Zca={$ref_Zca*$nt_Zca} +vcXa=$Xca +vcYa=$Yca +vcZa=$Zca +nt_X={$vcXa/100} +nt_Y={$vcYa/100} +nt_Z={$vcZa/100} +nt_R={$nt_X*3.2404542+$nt_Y*-1.5371385+$nt_Z*-0.4985314} +nt_G={$nt_X*-0.9692660+$nt_Y*1.8760108+$nt_Z*0.0415560} +nt_B={$nt_X*0.0556434+$nt_Y*-0.2040259+$nt_Z*1.0572252} +if $nt_R>0.0031308 +nt_R={1.055*{($nt_R)^{1/2.4}}-0.055} +else +nt_R={12.92*$nt_R} +fi +if $nt_G>0.0031308 +nt_G={1.055*{($nt_G)^{1/2.4}}-0.055} +else +nt_G={12.92*$nt_G} +fi +if $nt_B>0.0031308 +nt_B={1.055*{($nt_B)^{1/2.4}}-0.055} +else +nt_B={12.92*$nt_B} +fi +Rconv={$nt_R*255} +Gconv={$nt_G*255} +Bconv={$nt_B*255} +if $Rconv>255 Rconv=255 fi +if $Rconv<0 Rconv=0 fi +if $Gconv>255 Gconv=255 fi +if $Gconv<0 Gconv=0 fi +if $Bconv>255 Bconv=255 fi +if $Bconv<0 Bconv=0 fi +if $Type_Degrade==0 +line[-1] $Nb_Boucles,0,$Nb_Boucles,{h-1},1,$Rconv,$Gconv,$Bconv,$Aa +elif $Type_Degrade==1 +line[-1] 0,$Nb_Boucles,{w-1},$Nb_Boucles,1,$Rconv,$Gconv,$Bconv,$Aa +fi +Nb_Boucles+=1 +done +samj_Shape_Linear_Gradient_CIE_Lab : +Xo={round(w/100*$1)} +Yo={round(h/100*$2)} +Xf={round(w/100*$3)} +Yf={round(h/100*$4)} +Type_Degrade=$5 +Swap_colors=$6 +Ra=$7 +Ga=$8 +Ba=$9 +Aa=$10 +Rb=$11 +Gb=$12 +Bb=$13 +Ab=$14 +Background=$15 +Rback=$16 +Gback=$17 +Bback=$18 +Aback=$19 +Examples=$20 +if $Swap_colors==1 +Ra=$11 +Ga=$12 +Ba=$13 +Aa=$14 +Rb=$7 +Gb=$8 +Bb=$9 +Ab=$10 +fi +if $Xo>$Xf +Xo=$3 +Xf=$1 +elif $Xo==$Xf +Xo={$Xf-1} +fi +if $Yo>$Yf +Yo=$4 +Yf=$2 +elif $Yo==$Yf +Yo={$Yf-1} +fi +if $Type_Degrade==4||$Type_Degrade==5 +Xo={round(w/100*$1)} +Yo={round(h/100*$2)} +Xf={round(w/100*$3)} +Yf={round(h/100*$4)} +fi +if $Examples==1 +Xo={round(w*0.1)} +Yo={round(h*0.1)} +Xf={round(w*0.9)} +Yf={round(h*0.9)} +Type_Degrade=0 +elif $Examples==2 +Xo={round(w*0.1)} +Yo={round(h*0.1)} +Xf={round(w*0.9)} +Yf={round(h*0.9)} +Type_Degrade=1 +elif $Examples==3 +Xo={round(w*0.1)} +Yo={round(h*0.1)} +Xf={round(w*0.9)} +Yf={round(h*0.9)} +Type_Degrade=2 +elif $Examples==4 +Xo={round(w*0.1)} +Yo={round(h*0.1)} +Xf={round(w*0.9)} +Yf={round(h*0.9)} +Type_Degrade=3 +elif $Examples==5 +Xo={round(w*0.4)} +Yo={round(h*0.4)} +Xf={round(w*0.5)} +Yf={round(h*0.5)} +Type_Degrade=4 +elif $Examples==6 +Xo={round(w*0.4)} +Yo={round(h*0.4)} +Xf={round(w*0.5)} +Yf={round(h*0.5)} +Type_Degrade=5 +elif $Examples==7 +Xo={round(w*0.71)} +Yo={round(h*0.71)} +Xf={w} +Yf={h} +Type_Degrade=5 +fi +nt_Ra={$Ra/255} +nt_Ga={$Ga/255} +nt_Ba={$Ba/255} +if $nt_Ra>0.04045 +nt_Ra={({{$nt_Ra+0.055}/1.055})^2.4} +else +nt_Ra/=12.92 +fi +if $nt_Ga>0.04045 +nt_Ga={({{$nt_Ga+0.055}/1.055})^2.4} +else +nt_Ga/=12.92 +fi +if $nt_Ba>0.04045 +nt_Ba={({{$nt_Ba+0.055}/1.055})^2.4} +else +nt_Ba/=12.92 +fi +nt_Ra*=100 +nt_Ga*=100 +nt_Ba*=100 +Xa={$nt_Ra*0.4124564+$nt_Ga*0.3575761+$nt_Ba*0.1804375} +Ya={$nt_Ra*0.2126729+$nt_Ga*0.7151522+$nt_Ba*0.0721750} +Za={$nt_Ra*0.0193339+$nt_Ga*0.1191920+$nt_Ba*0.9503041} +Xca=$Xa +Yca=$Ya +Zca=$Za +ref_Xa=95.047 +ref_Ya=100.000 +ref_Za=108.883 +nt_Xa={$Xca/$ref_Xa} +nt_Ya={$Yca/$ref_Ya} +nt_Za={$Zca/$ref_Za} +if $nt_Xa>0.008856 +nt_Xa={($nt_Xa)^{1/3}} +else +nt_Xa={{7.787*$nt_Xa}+{16/116}} +fi +if $nt_Ya>0.008856 +nt_Ya={($nt_Ya)^{1/3}} +else +nt_Ya={{7.787*$nt_Ya}+{16/116}} +fi +if $nt_Za>0.008856 +nt_Za={($nt_Za)^{1/3}} +else +nt_Za={{7.787*$nt_Za}+{16/116}} +fi +CIE_La={{116*$nt_Ya}-16} +CIE_aa={500*{$nt_Xa-$nt_Ya}} +CIE_ba={200*{$nt_Ya-$nt_Za}} +nt_Ra={$Rb/255} +nt_Ga={$Gb/255} +nt_Ba={$Bb/255} +if $nt_Ra>0.04045 +nt_Ra={({{$nt_Ra+0.055}/1.055})^2.4} +else +nt_Ra/=12.92 +fi +if $nt_Ga>0.04045 +nt_Ga={({{$nt_Ga+0.055}/1.055})^2.4} +else +nt_Ga/=12.92 +fi +if $nt_Ba>0.04045 +nt_Ba={({{$nt_Ba+0.055}/1.055})^2.4} +else +nt_Ba/=12.92 +fi +nt_Ra*=100 +nt_Ga*=100 +nt_Ba*=100 +Xb={$nt_Ra*0.4124564+$nt_Ga*0.3575761+$nt_Ba*0.1804375} +Yb={$nt_Ra*0.2126729+$nt_Ga*0.7151522+$nt_Ba*0.0721750} +Zb={$nt_Ra*0.0193339+$nt_Ga*0.1191920+$nt_Ba*0.9503041} +Xca=$Xb +Yca=$Yb +Zca=$Zb +ref_Xa=95.047 +ref_Ya=100.000 +ref_Za=108.883 +nt_Xa={$Xca/$ref_Xa} +nt_Ya={$Yca/$ref_Ya} +nt_Za={$Zca/$ref_Za} +if $nt_Xa>0.008856 +nt_Xa={($nt_Xa)^{1/3}} +else +nt_Xa={{7.787*$nt_Xa}+{16/116}} +fi +if $nt_Ya>0.008856 +nt_Ya={($nt_Ya)^{1/3}} +else +nt_Ya={{7.787*$nt_Ya}+{16/116}} +fi +if $nt_Za>0.008856 +nt_Za={($nt_Za)^{1/3}} +else +nt_Za={{7.787*$nt_Za}+{16/116}} +fi +CIE_Lb={{116*$nt_Ya}-16} +CIE_ab={500*{$nt_Xa-$nt_Ya}} +CIE_bb={200*{$nt_Ya-$nt_Za}} +if $Background==1 +{w},{h},1,4 +rm[-2] +elif $Background==2 +{w},{h},1,4 +fill_color[-1] $Rback,$Gback,$Bback,$Aback +rm[-2] +fi +Nb_Boucles=0 +if $Type_Degrade==0 +Dimensions={$Xf-$Xo} +elif $Type_Degrade==1 +Dimensions={$Yf-$Yo} +elif $Type_Degrade==2 +if {$Xf-$Xo}>{$Yf-$Yo} +Dimensions={round({{$Yf-$Yo+1}/2})} +else +Dimensions={round({{$Xf-$Xo+1}/2})} +fi +elif $Type_Degrade==3 +if {$Xf-$Xo}>{$Yf-$Yo} +Dimensions={round({{$Xf-$Xo+1}/2})} +else +Dimensions={round({{$Yf-$Yo+1}/2})} +fi +elif $Type_Degrade==4 +Dimensions=$Xo +elif $Type_Degrade==5 +Dimensions={$Xo+$Yo} +fi +Inc_L={{$CIE_La-$CIE_Lb}/$Dimensions} +Inc_a={{$CIE_aa-$CIE_ab}/$Dimensions} +Inc_b={{$CIE_ba-$CIE_bb}/$Dimensions} +Inc_Alpha={{$Ab-$Aa}/$Dimensions} +Decalage_L=0 +Decalage_a=0 +Decalage_b=0 +repeat $Dimensions +Aa+=$Inc_Alpha +if $Aa>255 Aa=255 fi +if $Aa<0 Aa=0 fi +CIE_Lca={$CIE_La+$Decalage_L-($Nb_Boucles*$Inc_L)} +CIE_aca={$CIE_aa+$Decalage_a-($Nb_Boucles*$Inc_a)} +CIE_bca={$CIE_ba+$Decalage_b-($Nb_Boucles*$Inc_b)} +if $CIE_Lca>100 CIE_Lca=100 fi +if $CIE_Lca<0 CIE_Lca=0 fi +if $CIE_aca>127 CIE_aca=127 fi +if $CIE_aca<-128 CIE_aca=-128 fi +if $CIE_bca>127 CIE_bca=127 fi +if $CIE_bca<-128 CIE_bca=-128 fi +nt_Yca={{$CIE_Lca+16}/116} +nt_Xca={$CIE_aca/500+$nt_Yca} +nt_Zca={$nt_Yca-$CIE_bca/200} +if {($nt_Yca)^3}>0.008856 +nt_Yca={($nt_Yca)^3} +else +nt_Yca={{$nt_Yca-16/116}/7.787} +fi +if {($nt_Xca)^3}>0.008856 +nt_Xca={($nt_Xca)^3} +else +nt_Xca={{$nt_Xca-16/116}/7.787} +fi +if {($nt_Zca)^3}>0.008856 +nt_Zca={($nt_Zca)^3} +else +nt_Zca={{$nt_Zca-16/116}/7.787} +fi +ref_Xca=95.047 +ref_Yca=100.000 +ref_Zca=108.883 +Xca={$ref_Xca*$nt_Xca} +Yca={$ref_Yca*$nt_Yca} +Zca={$ref_Zca*$nt_Zca} +vcXa=$Xca +vcYa=$Yca +vcZa=$Zca +nt_X={$vcXa/100} +nt_Y={$vcYa/100} +nt_Z={$vcZa/100} +nt_R={$nt_X*3.2404542+$nt_Y*-1.5371385+$nt_Z*-0.4985314} +nt_G={$nt_X*-0.9692660+$nt_Y*1.8760108+$nt_Z*0.0415560} +nt_B={$nt_X*0.0556434+$nt_Y*-0.2040259+$nt_Z*1.0572252} +if $nt_R>0.0031308 +nt_R={1.055*{($nt_R)^{1/2.4}}-0.055} +else +nt_R={12.92*$nt_R} +fi +if $nt_G>0.0031308 +nt_G={1.055*{($nt_G)^{1/2.4}}-0.055} +else +nt_G={12.92*$nt_G} +fi +if $nt_B>0.0031308 +nt_B={1.055*{($nt_B)^{1/2.4}}-0.055} +else +nt_B={12.92*$nt_B} +fi +Rconv={$nt_R*255} +Gconv={$nt_G*255} +Bconv={$nt_B*255} +if $Rconv>255 Rconv=255 fi +if $Rconv<0 Rconv=0 fi +if $Gconv>255 Gconv=255 fi +if $Gconv<0 Gconv=0 fi +if $Bconv>255 Bconv=255 fi +if $Bconv<0 Bconv=0 fi +if $Type_Degrade==0 +line[-1] {$Xo+$Nb_Boucles},$Yo,{$Xo+$Nb_Boucles},$Yf,1,$Rconv,$Gconv,$Bconv,$Aa +elif $Type_Degrade==1 +line[-1] $Xo,{$Yo+$Nb_Boucles},$Xf,{$Yo+$Nb_Boucles},1,$Rconv,$Gconv,$Bconv,$Aa +elif $Type_Degrade==2 +polygon[-1] 4,{$Xo+$Nb_Boucles},{$Yo+$Nb_Boucles},{$Xf-$Nb_Boucles},{$Yo+$Nb_Boucles},{$Xf-$Nb_Boucles},{$Yf-$Nb_Boucles},{$Xo+$Nb_Boucles},{$Yf-$Nb_Boucles},1,0xFFFFFFFF,$Rconv,$Gconv,$Bconv,$Aa +elif $Type_Degrade==3 +polygon[-1] 4,{$Xo+$Nb_Boucles},{$Yo+$Nb_Boucles},{$Xf-$Nb_Boucles},{$Yo+$Nb_Boucles},{$Xf-$Nb_Boucles},{$Yf-$Nb_Boucles},{$Xo+$Nb_Boucles},{$Yf-$Nb_Boucles},1,0xFFFFFFFF,$Rconv,$Gconv,$Bconv,$Aa +elif $Type_Degrade==4 +ellipse[-1] $Xf,$Yf,{$Dimensions-$Nb_Boucles},{$Dimensions-$Nb_Boucles},0,1,$Rconv,$Gconv,$Bconv,$Aa +elif $Type_Degrade==5 +ellipse[-1] $Xf,$Yf,{$Dimensions-$Nb_Boucles},{$Dimensions-$Nb_Boucles},0,1,$Rconv,$Gconv,$Bconv,$Aa +fi +Nb_Boucles+=1 +done +Harmonograph_samj : +centre_origine_X={$1/100*w} +centre_origine_Y={$2/100*h} +R_Couleur_Stylo=$3 +V_Couleur_Stylo=$4 +B_Couleur_Stylo=$5 +A_Couleur_Stylo=$6 +Variation_de_couleur=$7 +Dilate_Stylo=$8 +Iterations=$9 +Multiplier_Iterations=$10 +Increment_temps=$11 +if $12>0 +Amplitude1={w*$12/{1000}} +else +Amplitude1={-h*$12/{1000}} +fi +if $13>0 +Amplitude2={w*$13/{1000}} +else +Amplitude2={-h*$13/{1000}} +fi +if $14>0 +Amplitude3={w*$14/{1000}} +else +Amplitude3={-h*$14/{1000}} +fi +if $15>0 +Amplitude4={w*$15/{1000}} +else +Amplitude4={-h*$15/{1000}} +fi +Frequence1=$16 +Frequence2=$17 +Frequence3=$18 +Frequence4=$19 +Phase1=$20 +Phase2=$21 +Phase3=$22 +Phase4=$23 +Amort1=$24 +Amort2=$25 +Amort3=$26 +Amort4=$27 +Flou_Harmonograph=$28 +Spread_Harmonograph=$29 +Deform_Harmonograph=$30 +blend=$31 +opacite=$32 +Revert_layers=0 +to_rgba +{w},{h},1,4 +Nb_Boucle=1 +temps=0 +Ancien_point_X=0 +Nouveau_point_X=0 +Ancien_point_Y=0 +Nouveau_point_Y=0 +R_Couleur_origine=$R_Couleur_Stylo +V_Couleur_origine=$V_Couleur_Stylo +B_Couleur_origine=$B_Couleur_Stylo +A_Couleur_origine=$A_Couleur_Stylo +Increment_temps/=10000 +Phase1/=180*{pi} +Phase2/=180*{pi} +Phase3/=180*{pi} +Phase4/=180*{pi} +if $Multiplier_Iterations>0 +Iterations*=$Multiplier_Iterations*5 +fi +repeat $Iterations +if $Variation_de_couleur==1 +R_Couleur_Stylo={round(u)*255} +V_Couleur_Stylo={round(u)*255} +B_Couleur_Stylo={round(u)*255} +fi +if $Variation_de_couleur>1 +Valeur_variation_couleur=16 +if $Variation_de_couleur==3 +Valeur_variation_couleur=32 +fi +if $Variation_de_couleur==4 +Valeur_variation_couleur=64 +fi +R_Couleur_Stylo={round({$R_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $R_Couleur_Stylo>255 +R_Couleur_Stylo=$R_Couleur_origine +fi +if $R_Couleur_Stylo<0 +R_Couleur_Stylo=$R_Couleur_origine +fi +V_Couleur_Stylo={round({$V_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $V_Couleur_Stylo>255 +V_Couleur_Stylo=$V_Couleur_origine +fi +if $V_Couleur_Stylo<0 +V_Couleur_Stylo=$V_Couleur_origine +fi +B_Couleur_Stylo={round({$B_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $B_Couleur_Stylo>255 +B_Couleur_Stylo=$B_Couleur_origine +fi +if $B_Couleur_Stylo<0 +B_Couleur_Stylo=$B_Couleur_origine +fi +fi +Nouveau_point_X={$centre_origine_X+(($Amplitude1*(sin((($Frequence1*$temps)+$Phase1)))*(exp(-$Amort1*$temps)))+($Amplitude2*(sin((($Frequence2*$temps)+$Phase2)))*(exp(-$Amort2*$temps))))} +Nouveau_point_Y={$centre_origine_Y+(($Amplitude3*(sin((($Frequence3*$temps)+$Phase3)))*(exp(-$Amort3*$temps)))+($Amplitude4*(sin((($Frequence4*$temps)+$Phase4)))*(exp(-$Amort4*$temps))))} +if $Nb_Boucle>1 +line[-1] $Ancien_point_X,$Ancien_point_Y,$Nouveau_point_X,$Nouveau_point_Y,1,$R_Couleur_Stylo,$V_Couleur_Stylo,$B_Couleur_Stylo,$A_Couleur_Stylo +fi +Ancien_point_X=$Nouveau_point_X +Ancien_point_Y=$Nouveau_point_Y +temps+=$Increment_temps +Nb_Boucle+=1 +done +if $Dilate_Stylo>0 dilate_circ[-1] $Dilate_Stylo fi +if $Flou_Harmonograph>0 blur[-1] $Flou_Harmonograph,0 fi +if $Spread_Harmonograph>1 spread[-1] $Spread_Harmonograph fi +if $Deform_Harmonograph>0 deform[-1] $Deform_Harmonograph fi +gimp_blend_1651[-1,-2] $blend,1,$opacite,$Revert_layers,1 +samj_Hawaiian_Earring : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Rayon_Cercle_Exterieur={round({{w+h}*$3/200})} +Nb_Circles=$4 +Type_n=$5 +Angle_inclinaison=$6 +R_Contours=$7 +V_Contours=$8 +B_Contours=$9 +A_Contours=$10 +Affichage_Contours=$11 +R_a=$12 +V_a=$13 +B_a=$14 +A_a=$15 +R_b=$16 +V_b=$17 +B_b=$18 +A_b=$19 +Couleurs_aleatoires=$20 +Inversions=$21 +Flou=$22 +Dilatation=$23 +Deformation=$24 +Bruit=$25 +Ombre=$26 +X_Ombre=$27 +Y_Ombre=$28 +Smoothness_Ombre=$29 +Curvature_Ombre=$30 +Compensation_Decalage_Ombre_X=$31 +Compensation_Decalage_Ombre_Y=$32 +Canal_Alpha=$33 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_boucles=0 +X_Cercle_A_Imprimer=$X +Y_Cercle_A_Imprimer=$Y +Rayon_Centre_Cercle_A_Imprimer=0 +Rayon_Cercle_A_Imprimer=$Rayon_Cercle_Exterieur +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Affichage_Contours==1 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +repeat $Nb_Circles +Nb_boucles+=1 +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +R_b={round(u)*255} +V_b={round(u)*255} +B_b={round(u)*255} +fi +if ($Nb_boucles%2)==0 +ellipse[-1] $X_Cercle_A_Imprimer,$Y_Cercle_A_Imprimer,$Rayon_Cercle_A_Imprimer,$Rayon_Cercle_A_Imprimer,0,1,$R_a,$V_a,$B_a,$A_a +else +ellipse[-1] $X_Cercle_A_Imprimer,$Y_Cercle_A_Imprimer,$Rayon_Cercle_A_Imprimer,$Rayon_Cercle_A_Imprimer,0,1,$R_b,$V_b,$B_b,$A_b +fi +if $Affichage_Contours==1 +ellipse[-2] $X_Cercle_A_Imprimer,$Y_Cercle_A_Imprimer,$Rayon_Cercle_A_Imprimer,$Rayon_Cercle_A_Imprimer,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Type_n==0 +Rayon_Cercle_A_Imprimer={$Rayon_Cercle_Exterieur/($Nb_boucles+1)} +elif $Type_n==1 +Rayon_Cercle_A_Imprimer={$Rayon_Cercle_A_Imprimer-($Rayon_Cercle_A_Imprimer*0.1)} +elif $Type_n==2 +Rayon_Cercle_A_Imprimer={$Rayon_Cercle_A_Imprimer-($Rayon_Cercle_A_Imprimer*0.2)} +elif $Type_n==3 +Rayon_Cercle_A_Imprimer={$Rayon_Cercle_A_Imprimer-($Rayon_Cercle_A_Imprimer*0.3)} +elif $Type_n==4 +Rayon_Cercle_A_Imprimer={$Rayon_Cercle_A_Imprimer-($Rayon_Cercle_A_Imprimer*(u(0.1,0.3)))} +fi +Rayon_Centre_Cercle_A_Imprimer={$Rayon_Cercle_Exterieur-$Rayon_Cercle_A_Imprimer} +X_Cercle_A_Imprimer={$X-($Rayon_Centre_Cercle_A_Imprimer*(cos(pi/180*$Angle_inclinaison)))} +Y_Cercle_A_Imprimer={$Y-($Rayon_Centre_Cercle_A_Imprimer*(sin(pi/180*$Angle_inclinaison)))} +done +if $Affichage_Contours==1 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Lignes_Epaisseur_Variable : +Motif_Sprite=$1 +Resolution_Largeur=$2 +Trait_Largeur=$3 +R_fond=$4 +V_fond=$5 +B_fond=$6 +A_fond=$7 +R_a=$8 +V_a=$9 +B_a=$10 +A_a=$11 +Inverser_Fond_Trait=$12 +Couleurs_aleatoires=$13 +Resize_Image=$14 +Antialiasing=$15 +R_Deblur=$16 +Dilatation=$17 +Deformation=$18 +Bruit=$19 +Ombre=$20 +X_Ombre=$21 +Y_Ombre=$22 +Smoothness_Ombre=$23 +Curvature_Ombre=$24 +Canal_Alpha=$25 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_boucles=0 +Nb_boucles_motif=0 +Origine_Trait=0 +if $Inverser_Fond_Trait==0 +R_F=$R_fond +V_F=$V_fond +B_F=$B_fond +A_F=$A_fond +R_M=$R_a +V_M=$V_a +B_M=$B_a +A_M=$A_a +else +R_F=$R_a +V_F=$V_a +B_F=$B_a +A_F=$A_a +R_M=$R_fond +V_M=$V_fond +B_M=$B_fond +A_M=$A_fond +fi +Largeur_Sprite={{7*2}+{7*$Trait_Largeur}} +Hauteur_Sprite=$Largeur_Sprite +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +resize[-1] $Resolution_Largeur,{round($Hauteur_Origine/$Largeur_Origine*$Resolution_Largeur)} +repeat 7 +Nb_boucles+=1 +if $Nb_boucles==1 +if $Couleurs_aleatoires==1 +R_F={round(u)*255} +V_F={round(u)*255} +B_F={round(u)*255} +fi +$Largeur_Sprite,$Hauteur_Sprite,1,4 +fill_color[-1] $R_F,$V_F,$B_F,$A_F +fi +if $Couleurs_aleatoires==1 +R_F={round(u)*255} +V_F={round(u)*255} +B_F={round(u)*255} +R_M={round(u)*255} +V_M={round(u)*255} +B_M={round(u)*255} +fi +$Largeur_Sprite,$Hauteur_Sprite,1,4 +fill_color[-1] $R_F,$V_F,$B_F,$A_F +Nb_boucles_motif=0 +if $Motif_Sprite==0||$Motif_Sprite==1 +Origine_Trait={round({{$Largeur_Sprite-{$Trait_Largeur*$Nb_boucles}}/2})} +repeat $Trait_Largeur*$Nb_boucles +line[-1] {$Origine_Trait+$Nb_boucles_motif},0,{$Origine_Trait+$Nb_boucles_motif},{$Hauteur_Sprite-1},1,$R_M,$V_M,$B_M,$A_M +Nb_boucles_motif+=1 +done +fi +done +if $Motif_Sprite==1 +rotate[-1,-2,-3,-4,-5,-6,-7,-8] 90,0,0 +fi +map_sprites[-1,-2,-3,-4,-5,-6,-7,-8,-9] 8,0 +if $Resize_Image==1 +resize[-1] $Largeur_Origine,$Hauteur_Origine +fi +if $Antialiasing>0 apply_channels[-1] "smooth "$Antialiasing",0.7,0.3,0.6,5,5,0",1 fi +if $R_Deblur>0 apply_channels[-1] "deblur "$R_Deblur",10,20,0.1,1",1 fi +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +fi +samj_Orbites : +Dimension={round({{max(w,h)}*$1/100})} +R_fond=$2 +V_fond=$3 +B_fond=$4 +A_fond=$5 +X={round({$Dimension*{$6/100}})} +Y={round({$Dimension*{$7/100}})} +Rayon_Cercle_A={round($Dimension*$8/100)} +Nb_Points_A=$9 +Rayon_Cercle_B={round($Dimension*$10/100)} +Multiplicateur=$11 +R_a=$12 +V_a=$13 +B_a=$14 +A_a=$15 +Angle_Inclinaison_A=$16 +Angle_Inclinaison_B=$17 +Couleurs_aleatoires=$18 +Flou=$19 +Dilatation=$20 +Deformation=$21 +Bruit=$22 +Tracer_Les_Cercles=$23 +Largeur_Origine={w} +Hauteur_Origine={h} +Variation_Angle_A={360/$Nb_Points_A} +Variation_Angle_B={360/{$Nb_Points_A*$Multiplicateur}} +Sortie_Boucle_Lignes=0 +Nb_Boucle_Lignes=0 +Nb_Boucle_Points=0 +Boucles_Rendu={round({{$Nb_Points_A*$Multiplicateur}+$Nb_Points_A}+1)} +rm[-1] +$Dimension,$Dimension,1,4 +fill_color[-1] 0,0,0,0 +Angle_A=0 +X_Imp_A={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle_A+$Angle_Inclinaison_A)))))} +Y_Imp_A={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle_A+$Angle_Inclinaison_A)))))} +Angle_B=0 +X_Imp_B={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle_B+$Angle_Inclinaison_B)))))} +Y_Imp_B={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle_B+$Angle_Inclinaison_B)))))} +repeat $Boucles_Rendu +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +fi +line[-1] $X_Imp_A,$Y_Imp_A,$X_Imp_B,$Y_Imp_B,1,$R_a,$V_a,$B_a,$A_a +Angle_A+=$Variation_Angle_A +X_Imp_A={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle_A+$Angle_Inclinaison_A)))))} +Y_Imp_A={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle_A+$Angle_Inclinaison_A)))))} +Angle_B+=$Variation_Angle_B +X_Imp_B={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle_B+$Angle_Inclinaison_B)))))} +Y_Imp_B={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle_B+$Angle_Inclinaison_B)))))} +done +if $Tracer_Les_Cercles==1 +ellipse[-1] $X,$Y,$Rayon_Cercle_A,$Rayon_Cercle_A,0,1,0xFFFFFFFF,$R_a,$V_a,$B_a,$A_a +ellipse[-1] $X,$Y,$Rayon_Cercle_B,$Rayon_Cercle_B,0,1,0xFFFFFFFF,$R_a,$V_a,$B_a,$A_a +fi +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +$Dimension,$Dimension,1,4 +fill_color[-1] $R_fond,$V_fond,$B_fond,$A_fond +gimp_blend_1651[-2,-1] 1,0,1,0,1 +samj_Palette_De_Degrades : +R_a=$1 +V_a=$2 +B_a=$3 +R_b=$4 +V_b=$5 +B_b=$6 +R_c=$7 +V_c=$8 +B_c=$9 +R_d=$10 +V_d=$11 +B_d=$12 +R_e=$13 +V_e=$14 +B_e=$15 +R_f=$16 +V_f=$17 +B_f=$16 +R_g=$19 +V_g=$20 +B_g=$21 +R_h=$22 +V_h=$23 +B_h=$25 +R_i=$25 +V_i=$26 +B_i=$27 +R_j=$28 +V_j=$29 +B_j=$30 +R_k=$31 +V_k=$32 +B_k=$33 +R_l=$34 +V_l=$35 +B_l=$36 +Ajouter_Noir=$37 +Ajouter_Blanc=$38 +Etendue_Degrade=$39 +Hauteur_De_Un_Degrade=$40 +Hauteur_Degrade={66*$Hauteur_De_Un_Degrade} +Hauteur_Origine_Degrade=-1 +if {$Ajouter_Noir+$Ajouter_Blanc}==1 +Hauteur_Degrade={78*$Hauteur_De_Un_Degrade} +fi +if {$Ajouter_Noir+$Ajouter_Blanc}==2 +Hauteur_Degrade={91*$Hauteur_De_Un_Degrade} +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_b,$V_b,$B_b,255 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_c,$V_c,$B_c,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_d,$V_d,$B_d,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_e,$V_e,$B_e,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_f,$V_f,$B_f,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_g,$V_g,$B_g,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_h,$V_h,$B_h,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_i,$V_i,$B_i,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_j,$V_j,$B_j,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_k,$V_k,$B_k,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,$R_c,$V_c,$B_c,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,$R_d,$V_d,$B_d,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,$R_e,$V_e,$B_e,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,$R_f,$V_f,$B_f,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,$R_g,$V_g,$B_g,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,$R_h,$V_h,$B_h,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,$R_i,$V_i,$B_i,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,$R_j,$V_j,$B_j,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,$R_k,$V_k,$B_k,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,$R_d,$V_d,$B_d,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,$R_e,$V_e,$B_e,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,$R_f,$V_f,$B_f,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,$R_g,$V_g,$B_g,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,$R_h,$V_h,$B_h,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,$R_i,$V_i,$B_i,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,$R_j,$V_j,$B_j,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,$R_k,$V_k,$B_k,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_d,$V_d,$B_d,255,$R_e,$V_e,$B_e,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_d,$V_d,$B_d,255,$R_f,$V_f,$B_f,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_d,$V_d,$B_d,255,$R_g,$V_g,$B_g,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_d,$V_d,$B_d,255,$R_h,$V_h,$B_h,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_d,$V_d,$B_d,255,$R_i,$V_i,$B_i,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_d,$V_d,$B_d,255,$R_j,$V_j,$B_j,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_d,$V_d,$B_d,255,$R_k,$V_k,$B_k,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_d,$V_d,$B_d,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_d,$V_d,$B_d,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_d,$V_d,$B_d,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_e,$V_e,$B_e,255,$R_f,$V_f,$B_f,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_e,$V_e,$B_e,255,$R_g,$V_g,$B_g,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_e,$V_e,$B_e,255,$R_h,$V_h,$B_h,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_e,$V_e,$B_e,255,$R_i,$V_i,$B_i,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_e,$V_e,$B_e,255,$R_j,$V_j,$B_j,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_e,$V_e,$B_e,255,$R_k,$V_k,$B_k,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_e,$V_e,$B_e,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_e,$V_e,$B_e,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_e,$V_e,$B_e,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_f,$V_f,$B_f,255,$R_g,$V_g,$B_g,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_f,$V_f,$B_f,255,$R_h,$V_h,$B_h,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_f,$V_f,$B_f,255,$R_i,$V_i,$B_i,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_f,$V_f,$B_f,255,$R_j,$V_j,$B_j,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_f,$V_f,$B_f,255,$R_k,$V_k,$B_k,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_f,$V_f,$B_f,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_f,$V_f,$B_f,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_f,$V_f,$B_f,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_g,$V_g,$B_g,255,$R_h,$V_h,$B_h,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_g,$V_g,$B_g,255,$R_i,$V_i,$B_i,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_g,$V_g,$B_g,255,$R_j,$V_j,$B_j,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_g,$V_g,$B_g,255,$R_k,$V_k,$B_k,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_g,$V_g,$B_g,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_g,$V_g,$B_g,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_g,$V_g,$B_g,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_h,$V_h,$B_h,255,$R_i,$V_i,$B_i,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_h,$V_h,$B_h,255,$R_j,$V_j,$B_j,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_h,$V_h,$B_h,255,$R_k,$V_k,$B_k,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_h,$V_h,$B_h,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_h,$V_h,$B_h,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_h,$V_h,$B_h,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_i,$V_i,$B_i,255,$R_j,$V_j,$B_j,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_i,$V_i,$B_i,255,$R_k,$V_k,$B_k,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_i,$V_i,$B_i,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_i,$V_i,$B_i,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_i,$V_i,$B_i,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_j,$V_j,$B_j,255,$R_k,$V_k,$B_k,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_j,$V_j,$B_j,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_j,$V_j,$B_j,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_j,$V_j,$B_j,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_k,$V_k,$B_k,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_k,$V_k,$B_k,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_k,$V_k,$B_k,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_l,$V_l,$B_l,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_l,$V_l,$B_l,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +rv[-2,-1] +samj_Palette_De_Degrades_preview : +samj_Palette_De_Degrades[-1] $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,2 +samj_Cercles_Tangents_Dans_Cercle : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +if $3>0 +Rayon_Cercle_Exterieur={round({w*$3/{100}})} +else +Rayon_Cercle_Exterieur={round({-h*$3/{100}})} +fi +Rayon_Premier_Cercle={round($Rayon_Cercle_Exterieur*$4/100)} +Angle_inclinaison=$5 +R_Contours=$6 +V_Contours=$7 +B_Contours=$8 +A_Contours=$9 +Affichage_Contours=$10 +R_CE=$11 +V_CE=$12 +B_CE=$13 +A_CE=$14 +R_PC=$15 +V_PC=$16 +B_PC=$17 +A_PC=$18 +R_c=$19 +V_c=$20 +B_c=$21 +A_c=$22 +R_d=$23 +V_d=$24 +B_d=$25 +A_d=$26 +R_e=$27 +V_e=$28 +B_e=$29 +A_e=$30 +R_f=$31 +V_f=$32 +B_f=$33 +A_f=$34 +R_g=$35 +V_g=$36 +B_g=$37 +A_g=$38 +R_h=$39 +V_h=$40 +B_h=$41 +A_h=$42 +R_i=$43 +V_i=$44 +B_i=$45 +A_i=$46 +R_j=$47 +V_j=$48 +B_j=$49 +A_j=$50 +R_k=$51 +V_k=$52 +B_k=$53 +A_k=$54 +Couleurs_aleatoires=$55 +Inversions=$56 +Flou=$57 +Dilatation=$58 +Deformation=$59 +Bruit=$60 +Ombre=$61 +X_Ombre=$62 +Y_Ombre=$63 +Smoothness_Ombre=$64 +Curvature_Ombre=$65 +Compensation_Decalage_Ombre_X=$66 +Compensation_Decalage_Ombre_Y=$67 +Canal_Alpha=$68 +Largeur_Origine={w} +Hauteur_Origine={h} +X_Cb={{$Rayon_Cercle_Exterieur-$Rayon_Premier_Cercle}*{cos(pi/180*$Angle_inclinaison)}} +Y_Cb={{$Rayon_Cercle_Exterieur-$Rayon_Premier_Cercle}*{sin(pi/180*$Angle_inclinaison)}} +X_Cc={$Rayon_Premier_Cercle*(cos((pi/180*($Angle_inclinaison+180))))} +Y_Cc={$Rayon_Premier_Cercle*(sin((pi/180*($Angle_inclinaison+180))))} +R_Cc={$Rayon_Cercle_Exterieur-$Rayon_Premier_Cercle} +R_Pappus={$R_Cc/$Rayon_Cercle_Exterieur} +n_Pappus=1 +b_Pappus={$R_Cc} +a_Pappus={$Rayon_Premier_Cercle} +R_Cercle_d={{$a_Pappus*$b_Pappus*{$a_Pappus+$b_Pappus}}/{{$n_Pappus*$a_Pappus*$a_Pappus}+{$b_Pappus*{$a_Pappus+$b_Pappus}}}} +Va={$R_Cc+$R_Cercle_d} +Vb={$Rayon_Premier_Cercle+$R_Cercle_d} +d_x={$X_Cb-$X_Cc} +d_y={$Y_Cb-$Y_Cc} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cc+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cc+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_da={$c_x2+$o_rx} +Y_Cercle_da={$c_y2+$o_ry} +X_Cercle_db={$c_x2-$o_rx} +Y_Cercle_db={$c_y2-$o_ry} +R_Pappus={$R_Cc/$Rayon_Cercle_Exterieur} +n_Pappus=4 +b_Pappus={$R_Cc} +a_Pappus={$Rayon_Premier_Cercle} +R_Cercle_e={{$a_Pappus*$b_Pappus*{$a_Pappus+$b_Pappus}}/{{$n_Pappus*$a_Pappus*$a_Pappus}+{$b_Pappus*{$a_Pappus+$b_Pappus}}}} +Vb={$R_Cc+$R_Cercle_e} +Va={$R_Cercle_d+$R_Cercle_e} +d_x={$X_Cc-$X_Cercle_da} +d_y={$Y_Cc-$Y_Cercle_da} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_da+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_da+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_eb={$c_x2-$o_rx} +Y_Cercle_eb={$c_y2-$o_ry} +d_x={$X_Cc-$X_Cercle_db} +d_y={$Y_Cc-$Y_Cercle_db} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_db+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_db+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_ea={$c_x2+$o_rx} +Y_Cercle_ea={$c_y2+$o_ry} +R_Pappus={$R_Cc/$Rayon_Cercle_Exterieur} +n_Pappus=9 +b_Pappus={$R_Cc} +a_Pappus={$Rayon_Premier_Cercle} +R_Cercle_f={{$a_Pappus*$b_Pappus*{$a_Pappus+$b_Pappus}}/{{$n_Pappus*$a_Pappus*$a_Pappus}+{$b_Pappus*{$a_Pappus+$b_Pappus}}}} +Vb={$R_Cc+$R_Cercle_f} +Va={$R_Cercle_e+$R_Cercle_f} +d_x={$X_Cc-$X_Cercle_ea} +d_y={$Y_Cc-$Y_Cercle_ea} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_ea+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_ea+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_fa={$c_x2+$o_rx} +Y_Cercle_fa={$c_y2+$o_ry} +d_x={$X_Cc-$X_Cercle_eb} +d_y={$Y_Cc-$Y_Cercle_eb} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_eb+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_eb+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_fb={$c_x2-$o_rx} +Y_Cercle_fb={$c_y2-$o_ry} +R_Pappus={$R_Cc/$Rayon_Cercle_Exterieur} +n_Pappus=16 +b_Pappus={$R_Cc} +a_Pappus={$Rayon_Premier_Cercle} +R_Cercle_g={{$a_Pappus*$b_Pappus*{$a_Pappus+$b_Pappus}}/{{$n_Pappus*$a_Pappus*$a_Pappus}+{$b_Pappus*{$a_Pappus+$b_Pappus}}}} +Vb={$R_Cc+$R_Cercle_g} +Va={$R_Cercle_f+$R_Cercle_g} +d_x={$X_Cc-$X_Cercle_fa} +d_y={$Y_Cc-$Y_Cercle_fa} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_fa+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_fa+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_ga={$c_x2+$o_rx} +Y_Cercle_ga={$c_y2+$o_ry} +d_x={$X_Cc-$X_Cercle_fb} +d_y={$Y_Cc-$Y_Cercle_fb} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_fb+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_fb+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_gb={$c_x2-$o_rx} +Y_Cercle_gb={$c_y2-$o_ry} +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Couleurs_aleatoires==1 +R_CE={round(u)*255} +V_CE={round(u)*255} +B_CE={round(u)*255} +R_PC={round(u)*255} +V_PC={round(u)*255} +B_PC={round(u)*255} +R_c={round(u)*255} +V_c={round(u)*255} +B_c={round(u)*255} +R_d={round(u)*255} +V_d={round(u)*255} +B_d={round(u)*255} +R_e={round(u)*255} +V_e={round(u)*255} +B_e={round(u)*255} +R_f={round(u)*255} +V_f={round(u)*255} +B_f={round(u)*255} +R_g={round(u)*255} +V_g={round(u)*255} +B_g={round(u)*255} +R_h={round(u)*255} +V_h={round(u)*255} +B_h={round(u)*255} +R_i={round(u)*255} +V_i={round(u)*255} +B_i={round(u)*255} +R_j={round(u)*255} +V_j={round(u)*255} +B_j={round(u)*255} +R_k={round(u)*255} +V_k={round(u)*255} +B_k={round(u)*255} +fi +if $Affichage_Contours>0 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +ellipse[-1] $X,$Y,$Rayon_Cercle_Exterieur,$Rayon_Cercle_Exterieur,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-1] {$X+$X_Cb},{$Y+$Y_Cb},$Rayon_Premier_Cercle,$Rayon_Premier_Cercle,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-1] {$X+$X_Cc},{$Y+$Y_Cc},$R_Cc,$R_Cc,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-1] {$X+$X_Cercle_da},{$Y+$Y_Cercle_da},$R_Cercle_d,$R_Cercle_d,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-1] {$X+$X_Cercle_db},{$Y+$Y_Cercle_db},$R_Cercle_d,$R_Cercle_d,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-1] {$X+$X_Cercle_ea},{$Y+$Y_Cercle_ea},$R_Cercle_e,$R_Cercle_e,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-1] {$X+$X_Cercle_eb},{$Y+$Y_Cercle_eb},$R_Cercle_e,$R_Cercle_e,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-1] {$X+$X_Cercle_fa},{$Y+$Y_Cercle_fa},$R_Cercle_f,$R_Cercle_f,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-1] {$X+$X_Cercle_fb},{$Y+$Y_Cercle_fb},$R_Cercle_f,$R_Cercle_f,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-1] {$X+$X_Cercle_ga},{$Y+$Y_Cercle_ga},$R_Cercle_g,$R_Cercle_g,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-1] {$X+$X_Cercle_gb},{$Y+$Y_Cercle_gb},$R_Cercle_g,$R_Cercle_g,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +ellipse[-1] $X,$Y,$Rayon_Cercle_Exterieur,$Rayon_Cercle_Exterieur,0,1,$R_CE,$V_CE,$B_CE,$A_CE +ellipse[-1] {$X+$X_Cb},{$Y+$Y_Cb},$Rayon_Premier_Cercle,$Rayon_Premier_Cercle,0,1,$R_PC,$V_PC,$B_PC,$A_PC +ellipse[-1] {$X+$X_Cc},{$Y+$Y_Cc},$R_Cc,$R_Cc,0,1,$R_c,$V_c,$B_c,$A_c +ellipse[-1] {$X+$X_Cercle_da},{$Y+$Y_Cercle_da},$R_Cercle_d,$R_Cercle_d,0,1,$R_d,$V_d,$B_d,$A_d +ellipse[-1] {$X+$X_Cercle_db},{$Y+$Y_Cercle_db},$R_Cercle_d,$R_Cercle_d,0,1,$R_e,$V_e,$B_e,$A_e +ellipse[-1] {$X+$X_Cercle_ea},{$Y+$Y_Cercle_ea},$R_Cercle_e,$R_Cercle_e,0,1,$R_f,$V_f,$B_f,$A_f +ellipse[-1] {$X+$X_Cercle_eb},{$Y+$Y_Cercle_eb},$R_Cercle_e,$R_Cercle_e,0,1,$R_g,$V_g,$B_g,$A_g +ellipse[-1] {$X+$X_Cercle_fa},{$Y+$Y_Cercle_fa},$R_Cercle_f,$R_Cercle_f,0,1,$R_h,$V_h,$B_h,$A_h +ellipse[-1] {$X+$X_Cercle_fb},{$Y+$Y_Cercle_fb},$R_Cercle_f,$R_Cercle_f,0,1,$R_i,$V_i,$B_i,$A_i +ellipse[-1] {$X+$X_Cercle_ga},{$Y+$Y_Cercle_ga},$R_Cercle_g,$R_Cercle_g,0,1,$R_j,$V_j,$B_j,$A_j +ellipse[-1] {$X+$X_Cercle_gb},{$Y+$Y_Cercle_gb},$R_Cercle_g,$R_Cercle_g,0,1,$R_k,$V_k,$B_k,$A_k +if $Affichage_Contours>0 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +samj_blend_20220419[-1,-2] alpha,1,0 +Pintograph_samj : +centre_origine_X={$1/100*w} +centre_origine_Y={$2/100*h} +R_Couleur_Stylo=$3 +V_Couleur_Stylo=$4 +B_Couleur_Stylo=$5 +A_Couleur_Stylo=$6 +Variation_de_couleur=$7 +Dilate_Stylo=$8 +Iterations=$9 +Multiplier_Iterations=$10 +Increment_temps=$11 +if $12>0 +Amplitude1={w*$12/{1000}} +else +Amplitude1={-h*$12/{1000}} +fi +if $13>0 +Amplitude2={w*$13/{1000}} +else +Amplitude2={-h*$13/{1000}} +fi +if $14>0 +Amplitude3={w*$14/{1000}} +else +Amplitude3={-h*$14/{1000}} +fi +if $15>0 +Amplitude4={w*$15/{1000}} +else +Amplitude4={-h*$15/{1000}} +fi +Frequence1=$16 +Frequence2=$17 +Frequence3=$18 +Frequence4=$19 +Phase1=$20 +Phase2=$21 +Phase3=$22 +Phase4=$23 +Flou_Pintograph=$24 +Spread_Pintograph=$25 +Deform_Pintograph=$26 +blend=$27 +opacite=$28 +Revert_layers=0 +to_rgba +{w},{h},1,4 +Nb_Boucle=1 +temps=0 +Ancien_point_X=0 +Nouveau_point_X=0 +Ancien_point_Y=0 +Nouveau_point_Y=0 +R_Couleur_origine=$R_Couleur_Stylo +V_Couleur_origine=$V_Couleur_Stylo +B_Couleur_origine=$B_Couleur_Stylo +A_Couleur_origine=$A_Couleur_Stylo +Increment_temps/=10000 +Phase1/=180*{pi} +Phase2/=180*{pi} +Phase3/=180*{pi} +Phase4/=180*{pi} +if $Multiplier_Iterations>0 +Iterations*=$Multiplier_Iterations*5 +fi +repeat $Iterations +if $Variation_de_couleur==1 +R_Couleur_Stylo={round(u)*255} +V_Couleur_Stylo={round(u)*255} +B_Couleur_Stylo={round(u)*255} +fi +if $Variation_de_couleur>1 +Valeur_variation_couleur=16 +if $Variation_de_couleur==3 +Valeur_variation_couleur=32 +fi +if $Variation_de_couleur==4 +Valeur_variation_couleur=64 +fi +R_Couleur_Stylo={round({$R_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $R_Couleur_Stylo>255 +R_Couleur_Stylo=$R_Couleur_origine +fi +if $R_Couleur_Stylo<0 +R_Couleur_Stylo=$R_Couleur_origine +fi +V_Couleur_Stylo={round({$V_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $V_Couleur_Stylo>255 +V_Couleur_Stylo=$V_Couleur_origine +fi +if $V_Couleur_Stylo<0 +V_Couleur_Stylo=$V_Couleur_origine +fi +B_Couleur_Stylo={round({$B_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $B_Couleur_Stylo>255 +B_Couleur_Stylo=$B_Couleur_origine +fi +if $B_Couleur_Stylo<0 +B_Couleur_Stylo=$B_Couleur_origine +fi +fi +Nouveau_point_X={$centre_origine_X+(($Amplitude1*(sin((($Frequence1*$temps)+$Phase1))))+($Amplitude2*(sin((($Frequence2*$temps)+$Phase2)))))} +Nouveau_point_Y={$centre_origine_Y+(($Amplitude3*(sin((($Frequence3*$temps)+$Phase3))))+($Amplitude4*(sin((($Frequence4*$temps)+$Phase4)))))} +if $Nb_Boucle>1 +line[-1] $Ancien_point_X,$Ancien_point_Y,$Nouveau_point_X,$Nouveau_point_Y,1,$R_Couleur_Stylo,$V_Couleur_Stylo,$B_Couleur_Stylo,$A_Couleur_Stylo +fi +Ancien_point_X=$Nouveau_point_X +Ancien_point_Y=$Nouveau_point_Y +temps+=$Increment_temps +Nb_Boucle+=1 +done +if $Dilate_Stylo>0 dilate_circ[-1] $Dilate_Stylo fi +if $Flou_Pintograph>0 blur[-1] $Flou_Pintograph,0 fi +if $Spread_Pintograph>1 spread[-1] $Spread_Pintograph fi +if $Deform_Pintograph>0 deform[-1] $Deform_Pintograph fi +gimp_blend_1651[-1,-2] $blend,1,$opacite,$Revert_layers,1 +samj_Poisson_D_Avril : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Valeur_A={round({{w+h}*$3/500})} +Valeur_K=$4 +Angle_Rotation=$5 +R_Contours=$6 +V_Contours=$7 +B_Contours=$8 +A_Contours=$9 +Affichage_Contours=$10 +R_a=$11 +V_a=$12 +B_a=$13 +A_a=$14 +R_b=$15 +V_b=$16 +B_b=$17 +A_b=$18 +Couleurs_aleatoires=$19 +Inversions=$20 +Flou=$21 +Dilatation=$22 +Deformation=$23 +Bruit=$24 +Ombre=$25 +X_Ombre=$26 +Y_Ombre=$27 +Smoothness_Ombre=$28 +Curvature_Ombre=$29 +Compensation_Decalage_Ombre_X=$30 +Compensation_Decalage_Ombre_Y=$31 +Canal_Alpha=$32 +Resolution=720 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_boucles=0 +Angle=0 +X_Poisson_A_Imprimer=0 +Y_Poisson_A_Imprimer=0 +X_Poisson_A_Imprimer_Precedent={{$X-$Valeur_A}+{$Valeur_A*{{cos(pi/180*$Angle)}+{$Valeur_K*{cos({pi/180*{$Angle/2}})}}}}} +Y_Poisson_A_Imprimer_Precedent={$Y+($Valeur_A*(sin(pi/180*$Angle)))} +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Affichage_Contours>0 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +if $Affichage_Contours==2 +ellipse[-2] $X,$Y,$Valeur_A,$Valeur_A,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +fi +repeat $Resolution +Nb_boucles+=1 +Angle={$Nb_boucles*(360/$Resolution)} +X_Poisson_A_Imprimer={{$X-$Valeur_A}+{$Valeur_A*{{cos(pi/180*$Angle)}+{$Valeur_K*{cos({pi/180*{$Angle/2}})}}}}} +Y_Poisson_A_Imprimer={$Y+($Valeur_A*(sin(pi/180*$Angle)))} +polygon[-1] 3,{$X-{2*$Valeur_A}},$Y,$X_Poisson_A_Imprimer_Precedent,$Y_Poisson_A_Imprimer_Precedent,$X_Poisson_A_Imprimer,$Y_Poisson_A_Imprimer,1,$R_a,$V_a,$B_a,$A_a +if $Affichage_Contours>0 +line[-2] $X_Poisson_A_Imprimer_Precedent,$Y_Poisson_A_Imprimer_Precedent,$X_Poisson_A_Imprimer,$Y_Poisson_A_Imprimer,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +X_Poisson_A_Imprimer_Precedent=$X_Poisson_A_Imprimer +Y_Poisson_A_Imprimer_Precedent=$Y_Poisson_A_Imprimer +done +Nb_boucles=0 +Angle=0 +X_Poisson_A_Imprimer_Precedent={{$X-$Valeur_A}+{$Valeur_A*{{cos(pi/180*$Angle)}+{$Valeur_K*{cos({pi/180*{$Angle/2}})}}}}} +Y_Poisson_A_Imprimer_Precedent={$Y-($Valeur_A*(sin(pi/180*$Angle)))} +if $Couleurs_aleatoires==1 +R_b={round(u)*255} +V_b={round(u)*255} +B_b={round(u)*255} +fi +repeat $Resolution +Nb_boucles+=1 +Angle={$Nb_boucles*(360/$Resolution)} +X_Poisson_A_Imprimer={{$X-$Valeur_A}+{$Valeur_A*{{cos(pi/180*$Angle)}+{$Valeur_K*{cos({pi/180*{$Angle/2}})}}}}} +Y_Poisson_A_Imprimer={$Y-($Valeur_A*(sin(pi/180*$Angle)))} +polygon[-1] 3,{$X-{2*$Valeur_A}},$Y,$X_Poisson_A_Imprimer_Precedent,$Y_Poisson_A_Imprimer_Precedent,$X_Poisson_A_Imprimer,$Y_Poisson_A_Imprimer,1,$R_b,$V_b,$B_b,$A_b +if $Affichage_Contours>0 +line[-2] $X_Poisson_A_Imprimer_Precedent,$Y_Poisson_A_Imprimer_Precedent,$X_Poisson_A_Imprimer,$Y_Poisson_A_Imprimer,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +X_Poisson_A_Imprimer_Precedent=$X_Poisson_A_Imprimer +Y_Poisson_A_Imprimer_Precedent=$Y_Poisson_A_Imprimer +done +if $Affichage_Contours>0 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +if $Angle_Rotation>0 rotate[-1] $Angle_Rotation,1,0,{w/2},{h/2} fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Arbre_Pythagore : +foreach { +x1={round(w/100*$1)} +y1={round(h/100*$2)} +depth_max=$3 +diff={round(w/$4)} +R_a=$5 +V_a=$6 +B_a=$7 +A_a=$8 +Variation_Couleur=$9 +Rendu=$10 +Dilatation=$11 +Rotation=$12 +Validation_Smooth_Antialias=$13 +V_Amplitude=$14 +V_Edge_Threshold=$15 +V_Smoothness=$16 +to_rgba[-1] +{w},{h},1,4 +samj_pythagoras_tree[-1] {$x1-$diff},$y1,{$x1+$diff},$y1,0,$R_a,$V_a,$B_a,$A_a,$Variation_Couleur,$depth_max,$Rendu +if $Rotation!=0 rotate[-1] $Rotation fi +dilate[-1] $Dilatation +if $Validation_Smooth_Antialias==1 fx_smooth_antialias[-1] $V_Amplitude,$V_Edge_Threshold,$V_Smoothness fi +samj_blend_20220419[-1,-2] alpha +} +samj_pythagoras_tree : +x1=$1 +y1=$2 +x2=$3 +y2=$4 +depth=$5 +R_DT=$6 +V_DT=$7 +B_DT=$8 +A_DT=$9 +Variation_Couleur=$10 +depth_max=$11 +Rendu=$12 +if $depth<$depth_max +dx={$x2-$x1} +dy={$y1-$y2} +x3={$x2-$dy} +y3={$y2-$dx} +x4={$x1-$dy} +y4={$y1-$dx} +x5={$x4+(($dx-$dy)/2)} +y5={$y4-(($dx+$dy)/2)} +if $Variation_Couleur<0 +R_DT={round(u(0,255))} +V_DT={round(u(0,255))} +B_DT={round(u(0,255))} +elif $Variation_Couleur>0 +R_DT+=$Variation_Couleur +V_DT+=$Variation_Couleur +B_DT+=$Variation_Couleur +if $R_DT>255 +R_DT={255-{$Variation_Couleur*{$depth_max-$depth}}} +fi +if $V_DT>255 +V_DT={255-{$Variation_Couleur*{$depth_max-$depth}}} +fi +if $B_DT>255 +B_DT={255-{$Variation_Couleur*{$depth_max-$depth}}} +fi +fi +if $Rendu==0 +line[-1] $x1,$y1,$x2,$y2,1,$R_DT,$V_DT,$B_DT,$A_DT +line[-1] $x2,$y2,$x3,$y3,1,$R_DT,$V_DT,$B_DT,$A_DT +line[-1] $x3,$y3,$x4,$y4,1,$R_DT,$V_DT,$B_DT,$A_DT +line[-1] $x4,$y4,$x1,$y1,1,$R_DT,$V_DT,$B_DT,$A_DT +elif $Rendu==1 +if ($depth%2)==0 +line[-1] $x1,$y1,$x2,$y2,1,$R_DT,$V_DT,$B_DT,$A_DT +line[-1] $x2,$y2,$x3,$y3,1,$R_DT,$V_DT,$B_DT,$A_DT +line[-1] $x3,$y3,$x4,$y4,1,$R_DT,$V_DT,$B_DT,$A_DT +line[-1] $x4,$y4,$x1,$y1,1,$R_DT,$V_DT,$B_DT,$A_DT +else +line[-1] $x1,$y1,$x2,$y2,1,{255-$R_DT},{255-$V_DT},{255-$B_DT},$A_DT +line[-1] $x2,$y2,$x3,$y3,1,{255-$R_DT},{255-$V_DT},{255-$B_DT},$A_DT +line[-1] $x3,$y3,$x4,$y4,1,{255-$R_DT},{255-$V_DT},{255-$B_DT},$A_DT +line[-1] $x4,$y4,$x1,$y1,1,{255-$R_DT},{255-$V_DT},{255-$B_DT},$A_DT +fi +elif $Rendu==2 +if ($depth%2)==0 +line[-1] $x1,$y1,$x2,$y2,1,{255-$R_DT},{255-$V_DT},{255-$B_DT},$A_DT +line[-1] $x2,$y2,$x3,$y3,1,{255-$R_DT},{255-$V_DT},{255-$B_DT},$A_DT +line[-1] $x3,$y3,$x4,$y4,1,{255-$R_DT},{255-$V_DT},{255-$B_DT},$A_DT +line[-1] $x4,$y4,$x1,$y1,1,{255-$R_DT},{255-$V_DT},{255-$B_DT},$A_DT +else +line[-1] $x1,$y1,$x2,$y2,1,$R_DT,$V_DT,$B_DT,$A_DT +line[-1] $x2,$y2,$x3,$y3,1,$R_DT,$V_DT,$B_DT,$A_DT +line[-1] $x3,$y3,$x4,$y4,1,$R_DT,$V_DT,$B_DT,$A_DT +line[-1] $x4,$y4,$x1,$y1,1,$R_DT,$V_DT,$B_DT,$A_DT +fi +fi +samj_pythagoras_tree[-1] $x4,$y4,$x5,$y5,{$depth+1},$R_DT,$V_DT,$B_DT,$A_DT,$Variation_Couleur,$depth_max,$Rendu +samj_pythagoras_tree[-1] $x5,$y5,$x3,$y3,{$depth+1},$R_DT,$V_DT,$B_DT,$A_DT,$Variation_Couleur,$depth_max,$Rendu +fi +samj_Rosace_Triangles_Sierpinski : +Nombre_de_zones=$1 +Nombre_de_couches=$2 +X={round({w*{$3/100}})} +Y={round({h*{$4/100}})} +if $5>0 +Rayon_Premier_Cecle={round({w*$5/{400*{2^0.5}}})} +else +Rayon_Premier_Cecle={round({-h*$5/{400*{2^0.5}}})} +fi +Decalage_Angle=$6 +Hauteur_Triangle={round({{w+h}*$7/2400})} +Recouvrement_Triangle={round({{w+h}*$8/4800})} +Angle_inclinaison=$9 +R_Contours=$10 +V_Contours=$11 +B_Contours=$12 +A_Contours=$13 +Affichage_Contours=$14 +Type_Triangles_A=$15 +Type_Triangles_B=$16 +Type_Decalage=$17 +Recursions_Sierpinski=$18 +R_Tr=$19 +V_Tr=$20 +B_Tr=$21 +A_Tr=$22 +R_Trb=$23 +V_Trb=$24 +B_Trb=$25 +A_Trb=$26 +R_Tr_B=$27 +V_Tr_B=$28 +B_Tr_B=$29 +A_Tr_B=$30 +R_Tr_Bb=$31 +V_Tr_Bb=$32 +B_Tr_Bb=$33 +A_Tr_Bb=$34 +R_Cercle=$35 +V_Cercle=$36 +B_Cercle=$37 +A_Cercle=$38 +Afficher_Cercle=$39 +Couleurs_aleatoires=$40 +Inversions=$41 +Flou=$42 +Dilatation=$43 +Deformation=$44 +Bruit=$45 +Ombre=$46 +X_Ombre=$47 +Y_Ombre=$48 +Smoothness_Ombre=$49 +Curvature_Ombre=$50 +Compensation_Decalage_Ombre_X=$51 +Compensation_Decalage_Ombre_Y=$52 +Canal_Alpha=$53 +Largeur_Origine={w} +Hauteur_Origine={h} +Angle=$Angle_inclinaison +Increment_angle={360/$Nombre_de_zones} +Rayon_Cercle_Origine=$Rayon_Premier_Cecle +Rayon_Cercle_A=0 +Rayon_Cercle_B=0 +Rayon_Cercle_C=0 +Rayon_Cercle_D=0 +H_Tr_A=0 +H_Tr_B=0 +H_Tr_C=0 +H_Tr_D=0 +Nb_Cercles=0 +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Affichage_Contours>0 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +Nb_boucles_couches=0 +repeat $Nombre_de_couches +Nb_boucles_couches+=1 +H_Tr_A={$Hauteur_Triangle*$Nb_Cercles} +Nb_Cercles+=1 +H_Tr_B={$Hauteur_Triangle*$Nb_Cercles} +Nb_Cercles+=1 +H_Tr_C={$Hauteur_Triangle*$Nb_Cercles} +Nb_Cercles+=1 +H_Tr_D={$Hauteur_Triangle*$Nb_Cercles} +Rayon_Cercle_A={$Rayon_Cercle_Origine+$H_Tr_A} +Rayon_Cercle_B={$Rayon_Cercle_Origine+$H_Tr_B} +Rayon_Cercle_C={$Rayon_Cercle_Origine+$H_Tr_C} +Rayon_Cercle_D={$Rayon_Cercle_Origine+$H_Tr_D} +Angle=$Angle_inclinaison +Nb_boucles_zones=0 +repeat $Nombre_de_zones +Nb_boucles_zones+=1 +if $Couleurs_aleatoires==1 +R_Tr={round(u)*255} +V_Tr={round(u)*255} +B_Tr={round(u)*255} +R_Trb={round(u)*255} +V_Trb={round(u)*255} +B_Trb={round(u)*255} +R_Tr_B={round(u)*255} +V_Tr_B={round(u)*255} +B_Tr_B={round(u)*255} +R_Tr_Bb={round(u)*255} +V_Tr_Bb={round(u)*255} +B_Tr_Bb={round(u)*255} +R_Cercle={round(u)*255} +V_Cercle={round(u)*255} +B_Cercle={round(u)*255} +fi +if $Type_Decalage==0 +X_A={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)+(180/$Nombre_de_zones))))))} +Y_A={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)+(180/$Nombre_de_zones))))))} +X_B={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches))))))} +Y_B={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches))))))} +X_C={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)-(180/$Nombre_de_zones))))))} +Y_C={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)-(180/$Nombre_de_zones))))))} +X_D={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)+(180/$Nombre_de_zones))))))} +Y_D={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)+(180/$Nombre_de_zones))))))} +X_E={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches))))))} +Y_E={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches))))))} +X_F={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)-(180/$Nombre_de_zones))))))} +Y_F={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)-(180/$Nombre_de_zones))))))} +X_G={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)+(180/$Nombre_de_zones))))))} +Y_G={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)+(180/$Nombre_de_zones))))))} +X_H={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches))))))} +Y_H={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches))))))} +X_I={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)-(180/$Nombre_de_zones))))))} +Y_I={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)-(180/$Nombre_de_zones))))))} +X_J={$X+(($Recouvrement_Triangle+$Rayon_Cercle_D)*(cos((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)+(180/$Nombre_de_zones))))))} +Y_J={$Y+(($Recouvrement_Triangle+$Rayon_Cercle_D)*(sin((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)+(180/$Nombre_de_zones))))))} +elif $Type_Decalage==1 +X_A={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-3))+(180/$Nombre_de_zones))))))} +Y_A={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-3))+(180/$Nombre_de_zones))))))} +X_B={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-3)))))))} +Y_B={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-3)))))))} +X_C={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-3))-(180/$Nombre_de_zones))))))} +Y_C={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-3))-(180/$Nombre_de_zones))))))} +X_D={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-2))+(180/$Nombre_de_zones))))))} +Y_D={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-2))+(180/$Nombre_de_zones))))))} +X_E={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-2)))))))} +Y_E={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-2)))))))} +X_F={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-2))-(180/$Nombre_de_zones))))))} +Y_F={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-2))-(180/$Nombre_de_zones))))))} +X_G={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-1))+(180/$Nombre_de_zones))))))} +Y_G={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-1))+(180/$Nombre_de_zones))))))} +X_H={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-1)))))))} +Y_H={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-1)))))))} +X_I={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-1))-(180/$Nombre_de_zones))))))} +Y_I={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-1))-(180/$Nombre_de_zones))))))} +X_J={$X+(($Recouvrement_Triangle+$Rayon_Cercle_D)*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_Cercles)+(180/$Nombre_de_zones))))))} +Y_J={$Y+(($Recouvrement_Triangle+$Rayon_Cercle_D)*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_Cercles)+(180/$Nombre_de_zones))))))} +elif $Type_Decalage==2 +X_A={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-3))+(180/$Nombre_de_zones))))))} +Y_A={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-3))+(180/$Nombre_de_zones))))))} +X_B={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-3)))))))} +Y_B={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-3)))))))} +X_C={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-3))-(180/$Nombre_de_zones))))))} +Y_C={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-3))-(180/$Nombre_de_zones))))))} +X_D={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-2))+(180/$Nombre_de_zones))))))} +Y_D={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-2))+(180/$Nombre_de_zones))))))} +X_E={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-2)))))))} +Y_E={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-2)))))))} +X_F={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-2))-(180/$Nombre_de_zones))))))} +Y_F={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-2))-(180/$Nombre_de_zones))))))} +X_G={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-1))+(180/$Nombre_de_zones))))))} +Y_G={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-1))+(180/$Nombre_de_zones))))))} +X_H={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-1)))))))} +Y_H={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-1)))))))} +X_I={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-1))-(180/$Nombre_de_zones))))))} +Y_I={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-1))-(180/$Nombre_de_zones))))))} +X_J={$X+(($Recouvrement_Triangle+$Rayon_Cercle_D)*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*$Nb_Cercles)+(180/$Nombre_de_zones))))))} +Y_J={$Y+(($Recouvrement_Triangle+$Rayon_Cercle_D)*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*$Nb_Cercles)+(180/$Nombre_de_zones))))))} +fi +if $Type_Triangles_A==0 +if ($Nb_boucles_couches%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_D,$Y_D,$X_H,$Y_H,$R_Tr,$V_Tr,$B_Tr,$A_Tr +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_D,$Y_D,$X_H,$Y_H,$R_Trb,$V_Trb,$B_Trb,$A_Trb +fi +if $Affichage_Contours==1||$Affichage_Contours==2||$Affichage_Contours==4||$Affichage_Contours==5 +polygon[-2] 3,$X_J,$Y_J,$X_D,$Y_D,$X_H,$Y_H,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +elif $Type_Triangles_A==1 +if ($Nb_boucles_couches%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_D,$Y_D,$X_E,$Y_E,$R_Tr,$V_Tr,$B_Tr,$A_Tr +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_D,$Y_D,$X_E,$Y_E,$R_Trb,$V_Trb,$B_Trb,$A_Trb +fi +if $Affichage_Contours==1||$Affichage_Contours==2||$Affichage_Contours==4||$Affichage_Contours==5 +polygon[-2] 3,$X_J,$Y_J,$X_D,$Y_D,$X_E,$Y_E,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +elif $Type_Triangles_A==2 +if ($Nb_boucles_couches%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_D,$Y_D,$X_B,$Y_B,$R_Tr,$V_Tr,$B_Tr,$A_Tr +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_D,$Y_D,$X_B,$Y_B,$R_Trb,$V_Trb,$B_Trb,$A_Trb +fi +if $Affichage_Contours==1||$Affichage_Contours==2||$Affichage_Contours==4||$Affichage_Contours==5 +polygon[-2] 3,$X_J,$Y_J,$X_D,$Y_D,$X_B,$Y_B,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +elif $Type_Triangles_A==3 +if ($Nb_boucles_couches%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_A,$Y_A,$X_H,$Y_H,$R_Tr,$V_Tr,$B_Tr,$A_Tr +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_A,$Y_A,$X_H,$Y_H,$R_Trb,$V_Trb,$B_Trb,$A_Trb +fi +if $Affichage_Contours==1||$Affichage_Contours==2||$Affichage_Contours==4||$Affichage_Contours==5 +polygon[-2] 3,$X_J,$Y_J,$X_A,$Y_A,$X_H,$Y_H,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +elif $Type_Triangles_A==4 +if ($Nb_boucles_couches%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_A,$Y_A,$X_E,$Y_E,$R_Tr,$V_Tr,$B_Tr,$A_Tr +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_A,$Y_A,$X_E,$Y_E,$R_Trb,$V_Trb,$B_Trb,$A_Trb +fi +if $Affichage_Contours==1||$Affichage_Contours==2||$Affichage_Contours==4||$Affichage_Contours==5 +polygon[-2] 3,$X_J,$Y_J,$X_A,$Y_A,$X_E,$Y_E,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +elif $Type_Triangles_A==5 +if ($Nb_boucles_couches%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_A,$Y_A,$X_B,$Y_B,$R_Tr,$V_Tr,$B_Tr,$A_Tr +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_A,$Y_A,$X_B,$Y_B,$R_Trb,$V_Trb,$B_Trb,$A_Trb +fi +if $Affichage_Contours==1||$Affichage_Contours==2||$Affichage_Contours==4||$Affichage_Contours==5 +polygon[-2] 3,$X_J,$Y_J,$X_A,$Y_A,$X_B,$Y_B,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +fi +if $Type_Triangles_B==0 +if ($Nb_boucles_couches%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_H,$Y_H,$X_B,$Y_B,$X_I,$Y_I,$R_Tr_B,$V_Tr_B,$B_Tr_B,$A_Tr_B +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_H,$Y_H,$X_B,$Y_B,$X_I,$Y_I,$R_Tr_Bb,$V_Tr_Bb,$B_Tr_Bb,$A_Tr_Bb +fi +if $Affichage_Contours==1||$Affichage_Contours==3||$Affichage_Contours==4||$Affichage_Contours==6 +polygon[-2] 3,$X_H,$Y_H,$X_B,$Y_B,$X_I,$Y_I,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +elif $Type_Triangles_B==1 +if ($Nb_boucles_couches%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_H,$Y_H,$X_B,$Y_B,$X_F,$Y_F,$R_Tr_B,$V_Tr_B,$B_Tr_B,$A_Tr_B +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_H,$Y_H,$X_B,$Y_B,$X_F,$Y_F,$R_Tr_Bb,$V_Tr_Bb,$B_Tr_Bb,$A_Tr_Bb +fi +if $Affichage_Contours==1||$Affichage_Contours==3||$Affichage_Contours==4||$Affichage_Contours==6 +polygon[-2] 3,$X_H,$Y_H,$X_B,$Y_B,$X_F,$Y_F,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +elif $Type_Triangles_B==2 +if ($Nb_boucles_couches%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_H,$Y_H,$X_B,$Y_B,$X_C,$Y_C,$R_Tr_B,$V_Tr_B,$B_Tr_B,$A_Tr_B +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_H,$Y_H,$X_B,$Y_B,$X_C,$Y_C,$R_Tr_Bb,$V_Tr_Bb,$B_Tr_Bb,$A_Tr_Bb +fi +if $Affichage_Contours==1||$Affichage_Contours==3||$Affichage_Contours==4||$Affichage_Contours==6 +polygon[-2] 3,$X_H,$Y_H,$X_B,$Y_B,$X_C,$Y_C,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +fi +Angle={$Angle_inclinaison+($Increment_angle*$Nb_boucles_zones)} +done +Nb_Cercles-=3 +H_Tr=$H_Tr_C +Rayon_Cercle_Origine=$Rayon_Cercle_D +done +if $Afficher_Cercle==1 +$Largeur_Origine,$Hauteur_Origine,1,4 +polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 +ellipse[-1] $X,$Y,$Rayon_Cercle_D,$Rayon_Cercle_D,0,1,$R_Cercle,$V_Cercle,$B_Cercle,$A_Cercle +samj_blend_20220419[-2,-1] alpha,1,1 +fi +if $Affichage_Contours>0 +if $Affichage_Contours>3 +ellipse[-2,-3] $X,$Y,$Rayon_Cercle_D,$Rayon_Cercle_D,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Cercles_Qui_Tournent : +Dimension=$1 +R_fond=$2 +V_fond=$3 +B_fond=$4 +A_fond=$5 +Exemples=$6 +Cax=$7 +Cbx=$8 +Ccx=$9 +Vbx=$10 +Vcx=$11 +Cay=$12 +Cby=$13 +Ccy=$14 +Vby=$15 +Vcy=$16 +Egalite_Param_X_Y=$17 +Theta=$18 +R_a=$19 +V_a=$20 +B_a=$21 +A_a=$22 +Angle_Rotation=$23 +Couleurs_aleatoires=$24 +Flou=$25 +Dilatation=$26 +Deformation=$27 +Bruit=$28 +Ombre=$29 +X_Ombre=$30 +Y_Ombre=$31 +Smoothness_Ombre=$32 +Curvature_Ombre=$33 +if $Exemples==1 +Egalite_Param_X_Y=1 +Cax=1 +Cbx=0.5 +Ccx=0.25 +Vbx=7 +Vcx=21 +Theta=1000 +elif $Exemples==2 +Egalite_Param_X_Y=1 +Cax=1 +Cbx=5 +Ccx=2 +Vbx=3 +Vcx=10 +Theta=4693 +elif $Exemples==3 +Egalite_Param_X_Y=0 +Cax=1 +Cbx=0.5 +Ccx=0.33 +Vbx=7 +Vcx=17 +Cay=1 +Cby=0.5 +Ccy=0.33 +Vby=11 +Vcy=17 +Theta=4886 +elif $Exemples==4 +Egalite_Param_X_Y=0 +Cax=1 +Cbx=0.5 +Ccx=0.33 +Vbx=7 +Vcx=17 +Cay=1 +Cby=0.5 +Ccy=0.33 +Vby=7 +Vcy=3 +Theta=4520 +elif $Exemples==5 +Egalite_Param_X_Y=0 +Cax=1 +Cbx=0.5 +Ccx=0.25 +Vbx=1 +Vcx=6 +Cay=0.8 +Cby=0.2 +Ccy=1 +Vby=9 +Vcy=12 +Theta=493 +elif $Exemples==6 +Egalite_Param_X_Y=1 +Cax=1 +Cbx=0.5 +Ccx=0.33 +Vbx=-5 +Vcx=17 +Theta=10 +fi +if $Egalite_Param_X_Y==1 +Cay=$Cax +Cby=$Cbx +Ccy=$Ccx +Vby=$Vbx +Vcy=$Vcx +fi +rm[-1] +$Dimension,$Dimension,1,4 +fill_color[-1] 0,0,0,0 +fx_equation_parametric[-1] "(cos(t)*"$Cax")+("$Cbx"*cos("$Vbx"*t))+((cos(("{pi/2}")-("$Vcx"*t)))*"$Ccx")","(sin(t)*"$Cay")+("$Cby"*sin("$Vby"*t))+((sin(("{pi/2}")-("$Vcy"*t)))*"$Ccy")",0,$Theta,$Dimension,1,1,0,0,0,0,0,0,1,0,0 +to_rgba[-1] +replace_color[-1] 0%,0,255,255,255,255,0,0,0,0 +replace_color[-1] 0%,0,0,0,0,255,$R_a,$V_a,$B_a,$A_a +if $Couleurs_aleatoires==0 +replace_color[-1] 0%,0,0,0,0,255,$R_a,$V_a,$B_a,$A_a +else +$Dimension,$Dimension,1,4 +fill_color[-1] 0,0,0,0 +fx_corner_gradient[-1] {round(u)*255},{round(u)*255},{round(u)*255},255,{round(u)*255},{round(u)*255},{round(u)*255},255,{round(u)*255},{round(u)*255},{round(u)*255},255,{round(u)*255},{round(u)*255},{round(u)*255},255 +samj_blend_20220419[-1,-2] add,1,0 +to_rgba[-1] +fi +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +fi +if $Angle_Rotation>0 rotate[-1] $Angle_Rotation,1,0,{$Dimension/2},{$Dimension/2} fi +$Dimension,$Dimension,1,4 +fill_color[-1] $R_fond,$V_fond,$B_fond,$A_fond +if $Bruit>0 apply_channels[-1] "fx_noise "$Bruit",0,22,1",1 fi +gimp_blend_1651[-2,-1] 1,0,1,0,1 +samj_Lignes_Colonnes : +to_rgba +if $3==0||$3==1 +IncX={w/$1} +Xorg=0 +Yorg=0 +Xfin=0 +Yfin={h} +repeat $1 +line $Xorg,$Yorg,$Xfin,$Yfin,1,$4,$5,$6,$7 +Xorg+=$IncX +Xfin+=$IncX +done +fi +if $3==0||$3==2 +IncY={h/$2} +Xorg=0 +Yorg=0 +Xfin={w} +Yfin=0 +repeat $2 +line $Xorg,$Yorg,$Xfin,$Yfin,1,$4,$5,$6,$7 +Yorg+=$IncY +Yfin+=$IncY +done +fi +samj_Formes_Geometriques_Simples : +X_Position={round({w*{$1/100}})} +Y_Position={round({h*{$2/100}})} +R_Externe=$3 +V_Externe=$4 +B_Externe=$5 +A_Externe=$6 +R_Interne=$7 +V_Interne=$8 +B_Interne=$9 +A_Interne=$10 +R_Contour=$11 +V_Contour=$12 +B_Contour=$13 +A_Contour=$14 +Forme=$15 +Dimension_Un={round({w*{$16/100}})} +Dimension_Deux={round({h*{$17/100}})} +Nb_Cotes=$18 +Angle_Inclinaison=$19 +Dilatation=$20 +Melange=$21 +Largeur_Origine={w} +Hauteur_Origine={h} +Valeur_Angle=0 +Nb_Boucles=0 +Rayon_Cercle_Circonscrit=0 +if $Forme==0 +Rayon_Cercle_Circonscrit=$Dimension_Un +elif $Forme==1 +Rayon_Cercle_Circonscrit=$Dimension_Deux +elif $Forme==3 +Rayon_Cercle_Circonscrit=$Dimension_Un +if $Nb_Cotes<5 Nb_Cotes=5 fi +elif $Forme==4 +Rayon_Cercle_Circonscrit=$Dimension_Deux +if $Nb_Cotes<5 Nb_Cotes=5 fi +elif $Forme==5 +Rayon_Cercle_Circonscrit=$Dimension_Un +if $Nb_Cotes<5 Nb_Cotes=5 fi +elif $Forme==6 +Rayon_Cercle_Circonscrit=$Dimension_Deux +if $Nb_Cotes<5 Nb_Cotes=5 fi +fi +if $Melange==0 +rm[-1] +else +to_rgba[-1] +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] $R_Externe,$V_Externe,$B_Externe,$A_Externe +if $Forme==2 +ellipse[-1] $X_Position,$Y_Position,$Dimension_Un,$Dimension_Deux,$Angle_Inclinaison,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +ellipse[-1] $X_Position,$Y_Position,$Dimension_Un,$Dimension_Deux,$Angle_Inclinaison,1,0xFFFFFFFF,$R_Contour,$V_Contour,$B_Contour,$A_Contour +else +repeat $Nb_Cotes +Nb_Boucles+=1 +if $Nb_Boucles==1 +X_a={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_a={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==2 +X_b={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_b={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==3 +X_c={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_c={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==4 +X_d={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_d={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==5 +X_e={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_e={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==6 +X_f={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_f={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==7 +X_g={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_g={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==8 +X_h={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_h={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==9 +X_i={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_i={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==10 +X_j={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_j={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==11 +X_k={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_k={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==12 +X_l={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_l={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==13 +X_m={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_m={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==14 +X_n={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_n={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==15 +X_o={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_o={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==16 +X_p={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_p={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==17 +X_q={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_q={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==18 +X_r={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_r={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==19 +X_s={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_s={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==20 +X_t={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_t={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==21 +X_u={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_u={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==22 +X_v={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_v={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==23 +X_w={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_w={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==24 +X_x={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_x={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==25 +X_y={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_y={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==26 +X_z={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_z={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +fi +Valeur_Angle+=360/$Nb_Cotes +done +fi +if $Forme==0||$Forme==1 +if $Nb_Cotes==3 +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,1,0xFFFFFFFF,$R_Contour,$V_Contour,$B_Contour,$A_Contour +elif $Nb_Cotes==4 +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,0xFFFFFFFF,$R_Contour,$V_Contour,$B_Contour,$A_Contour +elif $Nb_Cotes==5 +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,$X_e,$Y_e,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,$X_e,$Y_e,1,0xFFFFFFFF,$R_Contour,$V_Contour,$B_Contour,$A_Contour +elif $Nb_Cotes==6 +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,$X_e,$Y_e,$X_f,$Y_f,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,$X_e,$Y_e,$X_f,$Y_f,1,0xFFFFFFFF,$R_Contour,$V_Contour,$B_Contour,$A_Contour +elif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X_y,$Y_y,$X_l,$Y_l,$X_x,$Y_x,$X_k,$Y_k,$X_w,$Y_w,$X_j,$Y_j,$X_v,$Y_v,$X_i,$Y_i,$X_u,$Y_u,$X_h,$Y_h,$X_t,$Y_t,$X_g,$Y_g,$X_s,$Y_s,$X_f,$Y_f,$X_r,$Y_r,$X_e,$Y_e,$X_q,$Y_q,$X_d,$Y_d,$X_p,$Y_p,$X_c,$Y_c,$X_o,$Y_o,$X_b,$Y_b,$X_n,$Y_n,1,0xFFFFFFFF,$R_Contour,$V_Contour,$B_Contour,$A_Contour +elif $Nb_Cotes==6 +polygon[-1] {$Nb_Cotes/2},$X_a,$Y_a,$X_c,$Y_c,$X_e,$Y_e,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +polygon[-1] {$Nb_Cotes/2},$X_b,$Y_b,$X_d,$Y_d,$X_f,$Y_f,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +polygon[-1] {$Nb_Cotes/2},$X_a,$Y_a,$X_c,$Y_c,$X_e,$Y_e,1,0xFFFFFFFF,$R_Contour,$V_Contour,$B_Contour,$A_Contour +polygon[-1] {$Nb_Cotes/2},$X_b,$Y_b,$X_d,$Y_d,$X_f,$Y_f,1,0xFFFFFFFF,$R_Contour,$V_Contour,$B_Contour,$A_Contour +elif $Nb_Cotes==8 +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_d,$Y_d,$X_g,$Y_g,$X_b,$Y_b,$X_e,$Y_e,$X_h,$Y_h,$X_c,$Y_c,$X_f,$Y_f,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_d,$Y_d,$X_g,$Y_g,$X_b,$Y_b,$X_e,$Y_e,$X_h,$Y_h,$X_c,$Y_c,$X_f,$Y_f,1,0xFFFFFFFF,$R_Contour,$V_Contour,$B_Contour,$A_Contour +elif $Nb_Cotes==10 +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_h,$Y_h,$X_e,$Y_e,$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$Y_v,$X_i,$Y_i,$X_u,$Y_u,$X_h,$Y_h,$X_t,$Y_t,$X_g,$Y_g,$X_s,$Y_s,$X_f,$Y_f,$X_r,$Y_r,$X_e,$Y_e,$X_q,$Y_q,$X_d,$Y_d,$X_p,$Y_p,$X_c,$Y_c,$X_o,$Y_o,$X_b,$Y_b,$X_n,$Y_n,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +elif $Nb_Cotes==6 +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,$X_e,$Y_e,$X_f,$Y_f,1,$R_Contour,$V_Contour,$B_Contour,$A_Contour +polygon[-1] {$Nb_Cotes/2},$X_a,$Y_a,$X_c,$Y_c,$X_e,$Y_e,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +polygon[-1] {$Nb_Cotes/2},$X_b,$Y_b,$X_d,$Y_d,$X_f,$Y_f,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +elif $Nb_Cotes==8 +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,$X_e,$Y_e,$X_f,$Y_f,$X_g,$Y_g,$X_h,$Y_h,1,$R_Contour,$V_Contour,$B_Contour,$A_Contour +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_d,$Y_d,$X_g,$Y_g,$X_b,$Y_b,$X_e,$Y_e,$X_h,$Y_h,$X_c,$Y_c,$X_f,$Y_f,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +elif $Nb_Cotes==10 +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,$X_e,$Y_e,$X_f,$Y_f,$X_g,$Y_g,$X_h,$Y_h,$X_i,$Y_i,$X_j,$Y_j,1,$R_Contour,$V_Contour,$B_Contour,$A_Contour +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_h,$Y_h,$X_e,$Y_e,$X_b,$Y_b,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X_v,$Y_v,$X_g,$Y_g,$X_r,$Y_r,$X_c,$Y_c,$X_n,$Y_n,$X_y,$Y_y,$X_j,$Y_j,$X_u,$Y_u,$X_f,$Y_f,$X_q,$Y_q,$X_b,$Y_b,$X_m,$Y_m,$X_x,$Y_x,$X_i,$Y_i,$X_t,$Y_t,$X_e,$Y_e,$X_p,$Y_p,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +fi +fi +if $Dilatation>1 +dilate_circ[-1] $Dilatation +fi +if $Melange==1 +samj_blend_20220419[-1,-2] alpha,1,0 +fi +samj_en_Formes_Geometriques_Simples : +samj_Formes_Geometriques_Simples $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21 +samj_Flocon_De_Neige : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Nb_Branches=$3 +if $4>0 +Rayon_cercle_exterieur_flocon={round({w*$4/{100}})} +else +Rayon_cercle_exterieur_flocon={round({-h*$4/{100}})} +fi +Rayon_Cercle_Milieu={round($Rayon_cercle_exterieur_flocon*2)} +Rayon_Cercle_Milieu={round($Rayon_cercle_exterieur_flocon*$5/100)} +Angle_inclinaison=$6 +Recursions_Contours=$7 +R_Contours=$8 +V_Contours=$9 +B_Contours=$10 +Opacity_Contours=$11 +Affichage_Contours=$12 +Recursions_Flocon=$13 +R_F=$14 +V_F=$15 +B_F=$16 +Opacity_Flocon=$17 +Type_Flocon=$18 +Couleurs_aleatoires=$19 +Inversions=$20 +Flou=$21 +Dilatation=$22 +Deformation=$23 +Bruit=$24 +Ombre=$25 +X_Ombre=$26 +Y_Ombre=$27 +Smoothness_Ombre=$28 +Curvature_Ombre=$29 +Compensation_Decalage_Ombre_X=$30 +Compensation_Decalage_Ombre_Y=$31 +Canal_Alpha=$32 +Largeur_Origine={w} +Hauteur_Origine={h} +Angle_Theta={360/$Nb_Branches} +Nb_boucles=0 +X_ext=0 +Y_ext=0 +X_exta=0 +Y_exta=0 +X_extb=0 +Y_extb=0 +X_mil=0 +Y_mil=0 +Angle=0 +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Affichage_Contours>0 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +repeat $Nb_Branches +Angle={$Nb_boucles*$Angle_Theta} +X_ext={$X+($Rayon_cercle_exterieur_flocon*(cos((pi/180*($Angle+$Angle_inclinaison+$Angle_Theta)))))} +Y_ext={$Y+($Rayon_cercle_exterieur_flocon*(sin((pi/180*($Angle+$Angle_inclinaison+$Angle_Theta)))))} +X_exta={$X+($Rayon_cercle_exterieur_flocon/3*(cos((pi/180*($Angle+$Angle_inclinaison+$Angle_Theta)))))} +Y_exta={$Y+($Rayon_cercle_exterieur_flocon/3*(sin((pi/180*($Angle+$Angle_inclinaison+$Angle_Theta)))))} +X_extb={$X+($Rayon_cercle_exterieur_flocon/3*2*(cos((pi/180*($Angle+$Angle_inclinaison+$Angle_Theta)))))} +Y_extb={$Y+($Rayon_cercle_exterieur_flocon/3*2*(sin((pi/180*($Angle+$Angle_inclinaison+$Angle_Theta)))))} +X_mil={$X+($Rayon_Cercle_Milieu*(cos((pi/180*($Angle+$Angle_inclinaison+($Angle_Theta/2))))))} +Y_mil={$Y+($Rayon_Cercle_Milieu*(sin((pi/180*($Angle+$Angle_inclinaison+($Angle_Theta/2))))))} +Nb_boucles+=1 +if $Couleurs_aleatoires==1 +R_F={round(u)*255} +V_F={round(u)*255} +B_F={round(u)*255} +fi +if $Type_Flocon==0 +if $Affichage_Contours<2 +samj_snowflake_absolu[-1] $Recursions_Flocon,$X,$Y,$X_extb,$Y_extb,$X,$Y,$Opacity_Flocon,$R_F,$V_F,$B_F +samj_snowflake_absolu[-1] $Recursions_Flocon,$X_extb,$Y_extb,$X_ext,$Y_ext,$X_extb,$Y_extb,$Opacity_Flocon,$R_F,$V_F,$B_F +samj_snowflake_absolu[-1] $Recursions_Flocon,$X,$Y,$X_mil,$Y_mil,$X,$Y,$Opacity_Flocon,$R_F,$V_F,$B_F +fi +if $Affichage_Contours>0 +samj_snowflake_contours_absolu[-2] $Recursions_Flocon,$X,$Y,$X_extb,$Y_extb,$X,$Y,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +samj_snowflake_contours_absolu[-2] $Recursions_Flocon,$X_extb,$Y_extb,$X_ext,$Y_ext,$X_extb,$Y_extb,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +samj_snowflake_contours_absolu[-2] $Recursions_Contours,$X,$Y,$X_mil,$Y_mil,$X,$Y,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +fi +elif $Type_Flocon==1 +if $Affichage_Contours<2 +samj_snowflake_absolu[-1] $Recursions_Flocon,$X,$Y,$X_exta,$Y_exta,$X,$Y,$Opacity_Flocon,$R_F,$V_F,$B_F +samj_snowflake_absolu[-1] $Recursions_Flocon,$X_exta,$Y_exta,$X_extb,$Y_extb,$X_exta,$Y_exta,$Opacity_Flocon,$R_F,$V_F,$B_F +samj_snowflake_absolu[-1] $Recursions_Flocon,$X_extb,$Y_extb,$X_ext,$Y_ext,$X_extb,$Y_extb,$Opacity_Flocon,$R_F,$V_F,$B_F +samj_snowflake_absolu[-1] $Recursions_Flocon,$X,$Y,$X_mil,$Y_mil,$X,$Y,$Opacity_Flocon,$R_F,$V_F,$B_F +fi +if $Affichage_Contours>0 +samj_snowflake_contours_absolu[-2] $Recursions_Flocon,$X,$Y,$X_exta,$Y_exta,$X,$Y,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +samj_snowflake_contours_absolu[-2] $Recursions_Flocon,$X_exta,$Y_exta,$X_extb,$Y_extb,$X_exta,$Y_exta,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +samj_snowflake_contours_absolu[-2] $Recursions_Flocon,$X_extb,$Y_extb,$X_ext,$Y_ext,$X_extb,$Y_extb,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +samj_snowflake_contours_absolu[-2] $Recursions_Contours,$X,$Y,$X_mil,$Y_mil,$X,$Y,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +fi +elif $Type_Flocon==2 +if $Affichage_Contours<2 +samj_snowflake_absolu[-1] $Recursions_Flocon,$X,$Y,$X_ext,$Y_ext,$X,$Y,$Opacity_Flocon,$R_F,$V_F,$B_F +samj_snowflake_absolu[-1] $Recursions_Flocon,$X,$Y,$X_mil,$Y_mil,$X,$Y,$Opacity_Flocon,$R_F,$V_F,$B_F +fi +if $Affichage_Contours>0 +samj_snowflake_contours_absolu[-2] $Recursions_Contours,$X,$Y,$X_ext,$Y_ext,$X,$Y,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +samj_snowflake_contours_absolu[-2] $Recursions_Contours,$X,$Y,$X_mil,$Y_mil,$X,$Y,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +fi +elif $Type_Flocon==3 +if $Affichage_Contours<2 +samj_snowflake_absolu[-1] $Recursions_Flocon,$X,$Y,$X_extb,$Y_extb,$X,$Y,$Opacity_Flocon,$R_F,$V_F,$B_F +samj_snowflake_absolu[-1] $Recursions_Flocon,$X_extb,$Y_extb,$X_ext,$Y_ext,$X_extb,$Y_extb,$Opacity_Flocon,$R_F,$V_F,$B_F +fi +if $Affichage_Contours>0 +samj_snowflake_contours_absolu[-2] $Recursions_Flocon,$X,$Y,$X_extb,$Y_extb,$X,$Y,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +samj_snowflake_contours_absolu[-2] $Recursions_Flocon,$X_extb,$Y_extb,$X_ext,$Y_ext,$X_extb,$Y_extb,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +fi +elif $Type_Flocon==4 +if $Affichage_Contours<2 +samj_snowflake_absolu[-1] $Recursions_Flocon,$X,$Y,$X_exta,$Y_exta,$X,$Y,$Opacity_Flocon,$R_F,$V_F,$B_F +samj_snowflake_absolu[-1] $Recursions_Flocon,$X_exta,$Y_exta,$X_extb,$Y_extb,$X_exta,$Y_exta,$Opacity_Flocon,$R_F,$V_F,$B_F +samj_snowflake_absolu[-1] $Recursions_Flocon,$X_extb,$Y_extb,$X_ext,$Y_ext,$X_extb,$Y_extb,$Opacity_Flocon,$R_F,$V_F,$B_F +fi +if $Affichage_Contours>0 +samj_snowflake_contours_absolu[-2] $Recursions_Flocon,$X,$Y,$X_exta,$Y_exta,$X,$Y,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +samj_snowflake_contours_absolu[-2] $Recursions_Flocon,$X_exta,$Y_exta,$X_extb,$Y_extb,$X_exta,$Y_exta,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +samj_snowflake_contours_absolu[-2] $Recursions_Flocon,$X_extb,$Y_extb,$X_ext,$Y_ext,$X_extb,$Y_extb,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +fi +elif $Type_Flocon==5 +if $Affichage_Contours<2 +samj_snowflake_absolu[-1] $Recursions_Flocon,$X,$Y,$X_ext,$Y_ext,$X,$Y,$Opacity_Flocon,$R_F,$V_F,$B_F +fi +if $Affichage_Contours>0 +samj_snowflake_contours_absolu[-2] $Recursions_Contours,$X,$Y,$X_ext,$Y_ext,$X,$Y,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +fi +fi +done +if $Affichage_Contours>0 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +samj_blend_20220419[-1,-2] alpha,1,0 +Spirographe_samj : +centre_origine_X={$1/100*w} +centre_origine_Y={$2/100*h} +if $3>0 +Rayon_1={w*$3/{1000}} +else +Rayon_1={-h*$3/{1000}} +fi +if $4>0 +Rayon_2={w*$4/{1000}} +else +Rayon_2={-h*$4/{1000}} +fi +if $5>0 +Position_Stylo={w*$5/{1000}} +else +Position_Stylo={-h*$5/{1000}} +fi +R_Couleur_Stylo=$6 +V_Couleur_Stylo=$7 +B_Couleur_Stylo=$8 +A_Couleur_Stylo=$9 +Variation_de_couleur=$10 +Dilate_Stylo=$11 +Nombre_de_tours=$12 +Multiplier_tours=$13 +Increment_angulaire=$14 +Diviser_Increment_angulaire=$15 +Type_de_rendu=$16 +Points_Rayon=$17 +R_Couleur_Points=$18 +V_Couleur_Points=$19 +B_Couleur_Points=$20 +A_Couleur_Points=$21 +Lignes_epaisseur=$22 +R_Couleur_Lignes=$23 +V_Couleur_Lignes=$24 +B_Couleur_Lignes=$25 +A_Couleur_Lignes=$26 +Flou_Spirographe=$27 +Spread_Spirographe=$28 +Deform_Spirographe=$29 +blend=$30 +opacite=$31 +Revert_layers=0 +to_rgba +{w},{h},1,4 +Nb_Boucle=1 +theta=0 +Ancien_point_X=0 +Nouveau_point_X=0 +Ancien_point_Y=0 +Nouveau_point_Y=0 +if $Rayon_2==0 +Rayon_2=1 +fi +if $Multiplier_tours==1 +Nombre_de_tours={$Nombre_de_tours*10} +fi +if $Multiplier_tours==2 +Nombre_de_tours={$Nombre_de_tours*100} +fi +if $Diviser_Increment_angulaire==1 +Increment_angulaire={$Increment_angulaire/10} +fi +if $Diviser_Increment_angulaire==2 +Increment_angulaire={$Increment_angulaire/100} +fi +Nombre_de_tours={$Nombre_de_tours/$Increment_angulaire*360} +R_Couleur_origine=$R_Couleur_Stylo +V_Couleur_origine=$V_Couleur_Stylo +B_Couleur_origine=$B_Couleur_Stylo +A_Couleur_origine=$A_Couleur_Stylo +if $Dilate_Stylo>0 +repeat $Nombre_de_tours +if $Variation_de_couleur==1 +R_Couleur_Stylo={round(u)*255} +V_Couleur_Stylo={round(u)*255} +B_Couleur_Stylo={round(u)*255} +fi +if $Variation_de_couleur>1 +Valeur_variation_couleur=16 +if $Variation_de_couleur==3 +Valeur_variation_couleur=32 +fi +if $Variation_de_couleur==4 +Valeur_variation_couleur=64 +fi +R_Couleur_Stylo={round({$R_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $R_Couleur_Stylo>255 +R_Couleur_Stylo=$R_Couleur_origine +fi +if $R_Couleur_Stylo<0 +R_Couleur_Stylo=$R_Couleur_origine +fi +V_Couleur_Stylo={round({$V_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $V_Couleur_Stylo>255 +V_Couleur_Stylo=$V_Couleur_origine +fi +if $V_Couleur_Stylo<0 +V_Couleur_Stylo=$V_Couleur_origine +fi +B_Couleur_Stylo={round({$B_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $B_Couleur_Stylo>255 +B_Couleur_Stylo=$B_Couleur_origine +fi +if $B_Couleur_Stylo<0 +B_Couleur_Stylo=$B_Couleur_origine +fi +fi +if $Type_de_rendu==0 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==1 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==2 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==3 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==4 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==5 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==6 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==7 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Nb_Boucle>1 +line[-1] $Ancien_point_X,$Ancien_point_Y,$Nouveau_point_X,$Nouveau_point_Y,1,$R_Couleur_Stylo,$V_Couleur_Stylo,$B_Couleur_Stylo,$A_Couleur_Stylo +fi +Ancien_point_X=$Nouveau_point_X +Ancien_point_Y=$Nouveau_point_Y +theta={$theta+$Increment_angulaire} +Nb_Boucle={$Nb_Boucle+1} +done +dilate_circ[-1] $Dilate_Stylo +Nb_Boucle=1 +theta=0 +Ancien_point_X=0 +Nouveau_point_X=0 +Ancien_point_Y=0 +Nouveau_point_Y=0 +if $Lignes_epaisseur>0||$Points_Rayon>0 +repeat $Nombre_de_tours +if $Type_de_rendu==0 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==1 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==2 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==3 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==4 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==5 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==6 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==7 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Nb_Boucle>1 +if $Lignes_epaisseur>0 +if $Points_Rayon>0 +circle[-1] $Ancien_point_X,$Ancien_point_Y,$Points_Rayon,1,$R_Couleur_Points,$V_Couleur_Points,$B_Couleur_Points,$A_Couleur_Points +fi +trait_epais_samj $Ancien_point_X,$Ancien_point_Y,$Nouveau_point_X,$Nouveau_point_Y,$Lignes_epaisseur,1,$R_Couleur_Lignes,$V_Couleur_Lignes,$B_Couleur_Lignes,$A_Couleur_Lignes +if $Points_Rayon>0 +circle[-1] $Nouveau_point_X,$Nouveau_point_Y,$Points_Rayon,1,$R_Couleur_Points,$V_Couleur_Points,$B_Couleur_Points,$A_Couleur_Points +fi +fi +if $Points_Rayon>0 +if $Variation_de_couleur==1 +R_Couleur_Points={round(u)*255} +V_Couleur_Points={round(u)*255} +B_Couleur_Points={round(u)*255} +fi +circle[-1] $Ancien_point_X,$Ancien_point_Y,$Points_Rayon,1,$R_Couleur_Points,$V_Couleur_Points,$B_Couleur_Points,$A_Couleur_Points +fi +fi +Ancien_point_X=$Nouveau_point_X +Ancien_point_Y=$Nouveau_point_Y +theta={$theta+$Increment_angulaire} +Nb_Boucle={$Nb_Boucle+1} +done +fi +else +repeat $Nombre_de_tours +if $Variation_de_couleur==1 +R_Couleur_Stylo={round(u)*255} +V_Couleur_Stylo={round(u)*255} +B_Couleur_Stylo={round(u)*255} +fi +if $Variation_de_couleur>1 +Valeur_variation_couleur=16 +if $Variation_de_couleur==3 +Valeur_variation_couleur=32 +fi +if $Variation_de_couleur==4 +Valeur_variation_couleur=64 +fi +R_Couleur_Stylo={round({$R_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $R_Couleur_Stylo>255 +R_Couleur_Stylo=$R_Couleur_origine +fi +if $R_Couleur_Stylo<0 +R_Couleur_Stylo=$R_Couleur_origine +fi +V_Couleur_Stylo={round({$V_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $V_Couleur_Stylo>255 +V_Couleur_Stylo=$V_Couleur_origine +fi +if $V_Couleur_Stylo<0 +V_Couleur_Stylo=$V_Couleur_origine +fi +B_Couleur_Stylo={round({$B_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $B_Couleur_Stylo>255 +B_Couleur_Stylo=$B_Couleur_origine +fi +if $B_Couleur_Stylo<0 +B_Couleur_Stylo=$B_Couleur_origine +fi +fi +if $Type_de_rendu==0 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==1 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==2 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==3 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==4 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==5 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==6 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==7 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Nb_Boucle>1 +if $Lignes_epaisseur>0 +if $Points_Rayon>0 +circle[-1] $Ancien_point_X,$Ancien_point_Y,$Points_Rayon,1,$R_Couleur_Points,$V_Couleur_Points,$B_Couleur_Points,$A_Couleur_Points +fi +trait_epais_samj $Ancien_point_X,$Ancien_point_Y,$Nouveau_point_X,$Nouveau_point_Y,$Lignes_epaisseur,1,$R_Couleur_Lignes,$V_Couleur_Lignes,$B_Couleur_Lignes,$A_Couleur_Lignes +if $Points_Rayon>0 +circle[-1] $Nouveau_point_X,$Nouveau_point_Y,$Points_Rayon,1,$R_Couleur_Points,$V_Couleur_Points,$B_Couleur_Points,$A_Couleur_Points +fi +fi +if $Lignes_epaisseur<1 +line[-1] $Ancien_point_X,$Ancien_point_Y,$Nouveau_point_X,$Nouveau_point_Y,1,$R_Couleur_Stylo,$V_Couleur_Stylo,$B_Couleur_Stylo,$A_Couleur_Stylo +fi +if $Points_Rayon>0 +if $Variation_de_couleur==1 +R_Couleur_Points={round(u)*255} +V_Couleur_Points={round(u)*255} +B_Couleur_Points={round(u)*255} +fi +circle[-1] $Ancien_point_X,$Ancien_point_Y,$Points_Rayon,1,$R_Couleur_Points,$V_Couleur_Points,$B_Couleur_Points,$A_Couleur_Points +fi +fi +Ancien_point_X=$Nouveau_point_X +Ancien_point_Y=$Nouveau_point_Y +theta={$theta+$Increment_angulaire} +Nb_Boucle={$Nb_Boucle+1} +done +fi +if $Flou_Spirographe>0 blur[-1] $Flou_Spirographe,0 fi +if $Spread_Spirographe>1 spread[-1] $Spread_Spirographe fi +if $Deform_Spirographe>0 deform[-1] $Deform_Spirographe fi +gimp_blend_1651[-1,-2] $blend,1,$opacite,$Revert_layers,1 +samj_Splines_Test : +XO={round(w/100*$1)} +YO={round(h/100*$2)} +Angle_Origine=$3 +Variation_Angle=$4 +Var_Dim=$5 +Repetition_Spline=$6 +Repetition_Dim=$7 +Inc_Angle=$8 +uA0={round({{w+h}/200*$9})} +vA0={round({{w+h}/200*$10})} +uA1={round({{w+h}/200*$11})} +vA1={round({{w+h}/200*$12})} +uB0={round({{w+h}/200*$13})} +vB0={round({{w+h}/200*$14})} +uB1={round({{w+h}/200*$15})} +vB1={round({{w+h}/200*$16})} +R_a=$17 +V_a=$18 +B_a=$19 +A_a=$20 +R_b=$21 +V_b=$22 +B_b=$23 +A_b=$24 +Dilatation=$25 +Validation_Blend=$26 +Version_Spline=$27 +deg_to_rad={pi/180} +X_Debut=$XO +Y_Debut=$YO +XF=0 +YF=0 +XA=0 +YA=0 +XB=0 +YB=0 +to_rgba[-1] +{w},{h},1,4 +repeat $Repetition_Spline +XO=$X_Debut +YO=$Y_Debut +Angle_Origine+=$Inc_Angle +repeat $Repetition_Dim +XF={$XO+(cos(($Angle_Origine+$Variation_Angle)*$deg_to_rad)*$Var_Dim)} +YF={$YO+(sin(($Angle_Origine+$Variation_Angle)*$deg_to_rad)*$Var_Dim)} +XA={round({$XO+{{$XF-$XO}/100*$uA0}})} +YA={round({$YO+{{$YF-$YO}/100*$vA0}})} +XB={round({$XF-{{$XF-$XO}/100*$uA1}})} +YB={round({$YF-{{$YF-$YO}/100*$vA1}})} +if $Version_Spline==0 +spline[-1] $XO,$YO,$XA,$YA,$XF,$YF,$XB,$YB,1,$R_a,$V_a,$B_a,$A_a +else +spline[-1] $XO,$YO,$XA,$YA,$XF,$YF,$XB,$YB,1024,1,$R_a,$V_a,$B_a,$A_a +fi +XO=$XF +YO=$YF +XF={$XO+(cos(($Angle_Origine-$Variation_Angle)*$deg_to_rad)*$Var_Dim)} +YF={$YO+(sin(($Angle_Origine-$Variation_Angle)*$deg_to_rad)*$Var_Dim)} +XA={round({$XO+{{$XF-$XO}/100*$uB0}})} +YA={round({$YO+{{$YF-$YO}/100*$vB0}})} +XB={round({$XF-{{$XF-$XO}/100*$uB1}})} +YB={round({$YF-{{$YF-$YO}/100*$vB1}})} +if $Version_Spline==0 +spline[-1] $XO,$YO,$XA,$YA,$XF,$YF,$XB,$YB,1,$R_b,$V_b,$B_b,$A_b +else +spline[-1] $XO,$YO,$XA,$YA,$XF,$YF,$XB,$YB,1024,1,$R_b,$V_b,$B_b,$A_b +fi +XO=$XF +YO=$YF +done +done +dilate[-1] $Dilatation +if $Validation_Blend==1 samj_blend_20220419[-1,-2] alpha else rv[-1,-2] fi +samj_Splines_Test_preview : +samj_Splines_Test[-1] $1,$2,$3,$4,{$5/2},$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27 +if $26==0 rm[-1] fi +samj_Des_Lignes_002 : +Nombre_Lignes=$1 +Random_Colors=$2 +Gris=$3 +R_Couleur=$4 +V_Couleur=$5 +B_Couleur=$6 +A_Couleur=$7 +Symetrie=$8 +Effet=$9 +Etendue=$10 +point_X={w/100*$11} +point_Y={h/100*$12} +Flou=$13 +Dilatation=$14 +Deformation=$15 +Bruit=$16 +Melange=$17 +Inc_L={w/{{$Nombre_Lignes+1}*$Etendue}} +Inc_H={h/{{$Nombre_Lignes+1}*$Etendue}} +Origine_L=0 +Origine_H=0 +if $Melange==1 +{w},{h},1,4 +else +to_rgba[-1] +fill_color[-1] 0,0,0,0 +fi +repeat $Nombre_Lignes +Origine_L+=$Inc_L +Origine_H+=$Inc_H +if $Random_Colors==1 +R_Couleur={round(u)*255} +V_Couleur={round(u)*255} +B_Couleur={round(u)*255} +fi +if $Gris==1 +R_Couleur={{$R_Couleur+$V_Couleur+$B_Couleur}/3} +V_Couleur=$R_Couleur +B_Couleur=$R_Couleur +fi +if $Effet==0 +line[-1] $Origine_L,0,{w},$Origine_H,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==1 +line[-1] $Origine_L,0,{w},$Origine_H,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==3 +line[-1] $Origine_L,0,{w},$Origine_H,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==5 +line[-1] $Origine_L,0,{w},$Origine_H,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==9 +line[-1] $Origine_L,0,{w},$Origine_H,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==11 +line[-1] $point_X,$point_Y,{w},$Origine_H,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +line[-1] $point_X,$point_Y,{w-$Origine_L},{h},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +line[-1] $point_X,$point_Y,0,{h-$Origine_H},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +line[-1] $point_X,$point_Y,$Origine_L,0,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +fi +if $Random_Colors==1 +R_Couleur={round(u)*255} +V_Couleur={round(u)*255} +B_Couleur={round(u)*255} +fi +if $Gris==1 +R_Couleur={{$R_Couleur+$V_Couleur+$B_Couleur}/3} +V_Couleur=$R_Couleur +B_Couleur=$R_Couleur +fi +if $Effet==0 +line[-1] {w},$Origine_H,{w-$Origine_L},{h},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==2 +line[-1] {w},$Origine_H,{w-$Origine_L},{h},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==3 +line[-1] {w},$Origine_H,{w-$Origine_L},{h},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==6 +line[-1] {w},$Origine_H,{w-$Origine_L},{h},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==10 +line[-1] {w},$Origine_H,{w-$Origine_L},{h},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +fi +if $Random_Colors==1 +R_Couleur={round(u)*255} +V_Couleur={round(u)*255} +B_Couleur={round(u)*255} +fi +if $Gris==1 +R_Couleur={{$R_Couleur+$V_Couleur+$B_Couleur}/3} +V_Couleur=$R_Couleur +B_Couleur=$R_Couleur +fi +if $Effet==0 +line[-1] {w-$Origine_L},{h},0,{h-$Origine_H},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==1 +line[-1] {w-$Origine_L},{h},0,{h-$Origine_H},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==4 +line[-1] {w-$Origine_L},{h},0,{h-$Origine_H},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==7 +line[-1] {w-$Origine_L},{h},0,{h-$Origine_H},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==10 +line[-1] {w-$Origine_L},{h},0,{h-$Origine_H},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +fi +if $Random_Colors==1 +R_Couleur={round(u)*255} +V_Couleur={round(u)*255} +B_Couleur={round(u)*255} +fi +if $Gris==1 +R_Couleur={{$R_Couleur+$V_Couleur+$B_Couleur}/3} +V_Couleur=$R_Couleur +B_Couleur=$R_Couleur +fi +if $Effet==0 +line[-1] 0,{h-$Origine_H},$Origine_L,0,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==2 +line[-1] 0,{h-$Origine_H},$Origine_L,0,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==4 +line[-1] 0,{h-$Origine_H},$Origine_L,0,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==8 +line[-1] 0,{h-$Origine_H},$Origine_L,0,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==9 +line[-1] 0,{h-$Origine_H},$Origine_L,0,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +fi +done +if $Symetrie==1 +mirror[-1] x +elif $Symetrie==2 +mirror[-1] y +elif $Symetrie==3 +mirror[-1] x +mirror[-1] y +fi +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Melange==1 +samj_blend_20220419[-1,-2] alpha,1,0 +fi +samj_Superposition_Triangles_Sierpinski : +Nombre_de_zones=$1 +Nombre_de_superpositions=$2 +X={round({w*{$3/100}})} +Y={round({h*{$4/100}})} +if $5>0 +Rayon_Premier_Cecle={round({w*$5/{200*{2^0.5}}})} +else +Rayon_Premier_Cecle={round({-h*$5/{200*{2^0.5}}})} +fi +Coeff_Superpositions=$6 +Hauteur_Triangle={round({{w+h}*$7/2400})} +Angle_inclinaison=$8 +R_Contours=$9 +V_Contours=$10 +B_Contours=$11 +A_Contours=$12 +Affichage=$13 +Recursions_Sierpinski=$14 +R_Tr=$15 +V_Tr=$16 +B_Tr=$17 +A_Tr=$18 +R_Trb=$19 +V_Trb=$20 +B_Trb=$21 +A_Trb=$22 +R_Lat=$23 +V_Lat=$24 +B_Lat=$25 +A_Lat=$26 +R_Latb=$27 +V_Latb=$28 +B_Latb=$29 +A_Latb=$30 +R_Cercle=$31 +V_Cercle=$32 +B_Cercle=$33 +A_Cercle=$34 +Afficher_Cercle=$35 +Couleurs_aleatoires=$36 +Inversions=$37 +Flou=$38 +Dilatation=$39 +Deformation=$40 +Bruit=$41 +Ombre=$42 +X_Ombre=$43 +Y_Ombre=$44 +Smoothness_Ombre=$45 +Curvature_Ombre=$46 +Compensation_Decalage_Ombre_X=$47 +Compensation_Decalage_Ombre_Y=$48 +Canal_Alpha=$49 +Largeur_Origine={w} +Hauteur_Origine={h} +Angle=$Angle_inclinaison +Increment_angle={360/$Nombre_de_zones} +Rayon_Cercle_A=$Rayon_Premier_Cecle +H_Tr=$Hauteur_Triangle +Rayon_Cercle_B=0 +Rayon_Cercle_C=0 +Rayon_Contour=0 +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Affichage>3 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +Nb_boucles_superpositions=0 +repeat $Nombre_de_superpositions +Nb_boucles_superpositions+=1 +Nb_boucles_zones=0 +Angle=$Angle_inclinaison +repeat $Nombre_de_zones +Nb_boucles_zones+=1 +if $Couleurs_aleatoires==1 +R_Tr={round(u)*255} +V_Tr={round(u)*255} +B_Tr={round(u)*255} +R_Trb={round(u)*255} +V_Trb={round(u)*255} +B_Trb={round(u)*255} +R_Lat={round(u)*255} +V_Lat={round(u)*255} +B_Lat={round(u)*255} +R_Latb={round(u)*255} +V_Latb={round(u)*255} +B_Latb={round(u)*255} +R_Cercle={round(u)*255} +V_Cercle={round(u)*255} +B_Cercle={round(u)*255} +fi +Rayon_Cercle_B={{{$Rayon_Cercle_A*$Rayon_Cercle_A}+{{$Rayon_Cercle_A*{tan({pi/180*{180/$Nombre_de_zones}})}}*{$Rayon_Cercle_A*{tan({pi/180*{180/$Nombre_de_zones}})}}}}^0.5} +X_A={$X+(($Rayon_Cercle_A+$H_Tr)*(cos(pi/180*$Angle)))} +Y_A={$Y+(($Rayon_Cercle_A+$H_Tr)*(sin(pi/180*$Angle)))} +X_B={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle+(180/$Nombre_de_zones))))))} +Y_B={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle+(180/$Nombre_de_zones))))))} +X_C={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle-(180/$Nombre_de_zones))))))} +Y_C={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle-(180/$Nombre_de_zones))))))} +Rayon_Cercle_C={{{{$Rayon_Cercle_A+$H_Tr}*{$Rayon_Cercle_A+$H_Tr}}+{{{$Rayon_Cercle_A+$H_Tr}*{tan({pi/180*{180/$Nombre_de_zones}})}}*{{$Rayon_Cercle_A+$H_Tr}*{tan({pi/180*{180/$Nombre_de_zones}})}}}}^0.5} +X_D={$X+($Rayon_Cercle_A*(cos(pi/180*$Angle)))} +Y_D={$Y+($Rayon_Cercle_A*(sin(pi/180*$Angle)))} +X_E={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle+(180/$Nombre_de_zones))))))} +Y_E={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle+(180/$Nombre_de_zones))))))} +X_F={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle-(180/$Nombre_de_zones))))))} +Y_F={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle-(180/$Nombre_de_zones))))))} +if ($Affichage%2)==0 +Rayon_Contour={$Rayon_Cercle_A+$H_Tr} +if $Recursions_Sierpinski==0 +if ($Nb_boucles_superpositions%2)==0 +polygon[-1] 3,$X_A,$Y_A,$X_B,$Y_B,$X_C,$Y_C,1,$R_Tr,$V_Tr,$B_Tr,$A_Tr +else +polygon[-1] 3,$X_A,$Y_A,$X_B,$Y_B,$X_C,$Y_C,1,$R_Trb,$V_Trb,$B_Trb,$A_Trb +fi +else +if ($Nb_boucles_superpositions%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_A,$Y_A,$X_B,$Y_B,$X_C,$Y_C,$R_Tr,$V_Tr,$B_Tr,$A_Tr +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_A,$Y_A,$X_B,$Y_B,$X_C,$Y_C,$R_Trb,$V_Trb,$B_Trb,$A_Trb +fi +fi +if $Affichage==2||$Affichage==6 +if ($Nb_boucles_superpositions%2)==0 +polygon[-1] 3,$X_A,$Y_A,$X_B,$Y_B,$X_E,$Y_E,1,$R_Lat,$V_Lat,$B_Lat,$A_Lat +polygon[-1] 3,$X_A,$Y_A,$X_C,$Y_C,$X_F,$Y_F,1,$R_Lat,$V_Lat,$B_Lat,$A_Lat +else +polygon[-1] 3,$X_A,$Y_A,$X_B,$Y_B,$X_E,$Y_E,1,$R_Latb,$V_Latb,$B_Latb,$A_Latb +polygon[-1] 3,$X_A,$Y_A,$X_C,$Y_C,$X_F,$Y_F,1,$R_Latb,$V_Latb,$B_Latb,$A_Latb +fi +fi +if $Affichage>3 +polygon[-2] 3,$X_A,$Y_A,$X_B,$Y_B,$X_C,$Y_C,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +else +Rayon_Contour=$Rayon_Cercle_C +if $Recursions_Sierpinski==0 +if ($Nb_boucles_superpositions%2)==0 +polygon[-1] 3,$X_D,$Y_D,$X_E,$Y_E,$X_F,$Y_F,1,$R_Tr,$V_Tr,$B_Tr,$A_Tr +else +polygon[-1] 3,$X_D,$Y_D,$X_E,$Y_E,$X_F,$Y_F,1,$R_Trb,$V_Trb,$B_Trb,$A_Trb +fi +else +if ($Nb_boucles_superpositions%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_D,$Y_D,$X_E,$Y_E,$X_F,$Y_F,$R_Tr,$V_Tr,$B_Tr,$A_Tr +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_D,$Y_D,$X_E,$Y_E,$X_F,$Y_F,$R_Trb,$V_Trb,$B_Trb,$A_Trb +fi +fi +if $Affichage==3||$Affichage==7 +if ($Nb_boucles_superpositions%2)==0 +polygon[-1] 3,$X_D,$Y_D,$X_B,$Y_B,$X_E,$Y_E,1,$R_Lat,$V_Lat,$B_Lat,$A_Lat +polygon[-1] 3,$X_D,$Y_D,$X_C,$Y_C,$X_F,$Y_F,1,$R_Lat,$V_Lat,$B_Lat,$A_Lat +else +polygon[-1] 3,$X_D,$Y_D,$X_B,$Y_B,$X_E,$Y_E,1,$R_Latb,$V_Latb,$B_Latb,$A_Latb +polygon[-1] 3,$X_D,$Y_D,$X_C,$Y_C,$X_F,$Y_F,1,$R_Latb,$V_Latb,$B_Latb,$A_Latb +fi +fi +if $Affichage>3 +polygon[-2] 3,$X_D,$Y_D,$X_E,$Y_E,$X_F,$Y_F,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +fi +Angle={$Angle_inclinaison+($Increment_angle*$Nb_boucles_zones)} +done +Rayon_Cercle_A+=$H_Tr +H_Tr={$Hauteur_Triangle*$Nb_boucles_superpositions*$Coeff_Superpositions} +done +if $Afficher_Cercle==1 +$Largeur_Origine,$Hauteur_Origine,1,4 +polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 +ellipse[-1] $X,$Y,$Rayon_Contour,$Rayon_Contour,0,1,$R_Cercle,$V_Cercle,$B_Cercle,$A_Cercle +samj_blend_20220419[-2,-1] alpha,1,1 +if $Affichage>3 +ellipse[-2] $X,$Y,$Rayon_Contour,$Rayon_Contour,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +fi +if $Affichage>3 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Test_Visu_3D : +Choix=$1 +Fichier=$2 +Val_Elevation=$3 +R_U=$4 +R_V=$5 +R_W=$6 +R_angle=$7 +G_Size=$8 +G_Opacity=$9 +Type_Rendu=$10 +Valider_Autocrop=$11 +Dimensions_Origine=$12 +Width=$13 +Height=$14 +Object_size=$15 +X_angle=$16 +Y_angle=$17 +Z_angle=$18 +FOV=$19 +X_light=$20 +Y_light=$21 +Z_light=$22 +Specular_lightness=$23 +Specular_shininess=$24 +Rendering_mode=$25 +Antialiasing=$26 +S_Dimension=$27 +S_Zoom=$28 +S_R=$29 +S_V=$30 +S_B=$31 +S_A=$32 +Largeur_Origine={w} +Hauteur_Origine={h} +if $Choix==0 +rm[0] +input $Fichier +elif $Choix==1 +elevation3d[-1] $Val_Elevation +elif $Choix==2 +imageplane3d[-1] +elif $Choix==3 +imagecube3d[-1] +elif $Choix==4 +rm[-1] +gmic3d +fi +rotate3d[-1] $R_U,$R_V,$R_W,$R_angle +if $G_Size>0 gaussians3d[-1] $G_Size,$G_Opacity fi +if $Type_Rendu==0 +fx_render3d[-1] $Width,$Height,$Object_size,$X_angle,$Y_angle,$Z_angle,$FOV,$X_light,$Y_light,$Z_light,$Specular_lightness,$Specular_shininess,$Rendering_mode,$Antialiasing +elif $Type_Rendu==1 +snapshot3d[-1] $S_Dimension,$S_Zoom,$S_R,$S_V,$S_B,$S_A +fi +if $Valider_Autocrop==1 autocrop[-1] fi +if $Dimensions_Origine==1 resize[-1] $Largeur_Origine,$Hauteur_Origine fi +Traits_Strokes_samj: +Position_X={round({w*{$1/100}})} +Position_Y={round({h*{$2/100}})} +if $3>0 +Longueur={w*$3/{100}} +else +Longueur={-h*$3/{100}} +fi +Variations_Formes=$4 +Variations_Longueur=$5 +if $6>0 +Eloignement_du_centre={w*$6/{100}} +else +Eloignement_du_centre={-h*$6/{100}} +fi +Nombre_de_traits=$7 +Angle_Depart=$8 +Angle_Fin=$9 +R_Couleur=$10 +V_Couleur=$11 +B_Couleur=$12 +A_Couleur=$13 +Variation_de_couleur=$14 +Epaisseur=$15 +Symetrie=$16 +Pourcent_Longueur_Sym=$17 +Flou_traits=$18 +Spread_traits=$19 +Deform_traits=$20 +blend=$21 +opacite=$22 +Revert_layers=0 +to_rgba +{w},{h},1,4 +Angle=$Angle_Depart +if $Angle_Depart>$Angle_Fin +Angle_Fin+=360 +fi +increment_theta={{$Angle_Fin-$Angle_Depart}/$Nombre_de_traits} +if $Variations_Formes==1 +Variation={{$Longueur/100*$Variations_Longueur}/$Nombre_de_traits} +fi +if $Variations_Formes==2 +Variation={{-$Longueur/1000*$Variations_Longueur}/$Nombre_de_traits} +fi +if $Variations_Formes==3 +Variation={{$Longueur/100*$Variations_Longueur}/{$Nombre_de_traits/2}} +fi +if $Variations_Formes==4 +Variation={{-$Longueur/1000*$Variations_Longueur}/{$Nombre_de_traits/2}} +fi +Longueur_calculee=$Longueur +Nb_Boucle=1 +R_Couleur_origine=$R_Couleur +V_Couleur_origine=$V_Couleur +B_Couleur_origine=$B_Couleur +A_Couleur_origine=$A_Couleur +repeat $Nombre_de_traits +if $Variation_de_couleur==1 +R_Couleur={round(u)*255} +V_Couleur={round(u)*255} +B_Couleur={round(u)*255} +A_Couleur={{round(u)*200}+55} +fi +if $Variation_de_couleur>1 +Valeur_variation_couleur=16 +if $Variation_de_couleur==3 +Valeur_variation_couleur=32 +fi +if $Variation_de_couleur==4 +Valeur_variation_couleur=64 +fi +R_Couleur={round({$R_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $R_Couleur>255 +R_Couleur=$R_Couleur_origine +fi +if $R_Couleur<0 +R_Couleur=$R_Couleur_origine +fi +V_Couleur={round({$V_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $V_Couleur>255 +V_Couleur=$V_Couleur_origine +fi +if $V_Couleur<0 +V_Couleur=$V_Couleur_origine +fi +B_Couleur={round({$B_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $B_Couleur>255 +B_Couleur=$B_Couleur_origine +fi +if $B_Couleur<0 +B_Couleur=$B_Couleur_origine +fi +fi +Debut_X={$Position_X+(round(cos(pi/180*$Angle)*$Eloignement_du_centre))} +Debut_Y={$Position_Y+(round(sin(pi/180*$Angle)*$Eloignement_du_centre))} +Extremite_X={$Position_X+(round(cos(pi/180*$Angle)*($Longueur_calculee+$Eloignement_du_centre)))} +Extremite_Y={$Position_Y+(round(sin(pi/180*$Angle)*($Longueur_calculee+$Eloignement_du_centre)))} +line[-1] $Debut_X,$Debut_Y,$Extremite_X,$Extremite_Y,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +if $Symetrie==1 +Debut_X={$Position_X+(round(cos(pi/180*($Angle+180))*$Eloignement_du_centre))} +Debut_Y={$Position_Y+(round(sin(pi/180*($Angle+180))*$Eloignement_du_centre))} +Extremite_X={$Position_X+(round(cos(pi/180*($Angle+180))*(($Longueur_calculee/100*$Pourcent_Longueur_Sym)+$Eloignement_du_centre)))} +Extremite_Y={$Position_Y+(round(sin(pi/180*($Angle+180))*(($Longueur_calculee/100*$Pourcent_Longueur_Sym)+$Eloignement_du_centre)))} +line[-1] $Debut_X,$Debut_Y,$Extremite_X,$Extremite_Y,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +fi +Angle+=$increment_theta +if $Variations_Formes==1||$Variations_Formes==2 +Longueur_calculee+=$Variation +fi +if $Variations_Formes==3||$Variations_Formes==4 +if $Nb_Boucle<{$Nombre_de_traits/2} +Longueur_calculee+=$Variation +else +Longueur_calculee-=$Variation +fi +fi +Nb_Boucle+=1 +done +if $Epaisseur>0 +dilate_circ[-1] $Epaisseur +fi +blur[-1] $Flou_traits +spread[-1] $Spread_traits +deform[-1] $Deform_traits +gimp_blend_1651[-1,-2] $blend,1,$opacite,$Revert_layers,1 +Triangles_Shades_Adjacents: +Supprimer_Calque_Origine=$1 +Position_Centre_X=$2 +Position_Centre_Y=$3 +Nombre_De_Triangles=$4 +Artefacts=$5 +Angle_Decalage_Couleurs=$6 +R_Centre=$7 +V_Centre=$8 +B_Centre=$9 +R_a=$10 +V_a=$11 +B_a=$12 +R_b=$13 +V_b=$14 +B_b=$15 +R_c=$16 +V_c=$17 +B_c=$18 +R_d=$19 +V_d=$20 +B_d=$21 +R_e=$22 +V_e=$23 +B_e=$24 +R_f=$25 +V_f=$26 +B_f=$27 +R_g=$28 +V_g=$29 +B_g=$30 +Rendu=$31 +Couleurs_aleatoires=$32 +Activer_Color_Balance=$33 +R_Neutral_color=$34 +V_Neutral_color=$35 +B_Neutral_color=$36 +Stretch_colors=$37 +Activer_Melange=$38 +Mode=$39 +Opacity=$40 +Revert_layers=$41 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_boucles=0 +Ra_en_cours=0 +Va_en_cours=0 +Ba_en_cours=0 +Rb_en_cours=0 +Vb_en_cours=0 +Bb_en_cours=0 +Rc_en_cours=0 +Vc_en_cours=0 +Bc_en_cours=0 +Rayon_De_Couleur={round({{{{$Largeur_Origine^2}+{$Hauteur_Origine^2}}^0.5}+1})} +Angle_Rayon_De_Couleur={360/$Nombre_De_Triangles} +Angle_Artefacts=0 +Angle_Rayon_De_Couleur_Ref=0 +Angle_Rayon_De_Couleur_En_Cours=0 +Angle_Rayon_De_Couleur_En_Cours_Fin=0 +if $Nombre_De_Triangles==3 Rayon_De_Couleur*=3 fi +if {$Nombre_De_Triangles-($Rendu+2)}<0 Rendu={$Nombre_De_Triangles-2} fi +if $Artefacts==-1 Angle_Artefacts={0.5-{0.1/$Nombre_De_Triangles}} else Angle_Artefacts=$Artefacts fi +to_rgba[0] +$Largeur_Origine,$Hauteur_Origine,1,3 +fill_color[-1] 0,0,0,255 +repeat $Nombre_De_Triangles +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +R_b={round(u)*255} +V_b={round(u)*255} +B_b={round(u)*255} +R_c={round(u)*255} +V_c={round(u)*255} +B_c={round(u)*255} +R_d={round(u)*255} +V_d={round(u)*255} +B_d={round(u)*255} +R_e={round(u)*255} +V_e={round(u)*255} +B_e={round(u)*255} +R_f={round(u)*255} +V_f={round(u)*255} +B_f={round(u)*255} +R_g={round(u)*255} +V_g={round(u)*255} +B_g={round(u)*255} +fi +if ($Nb_boucles%{$Rendu+2})==0 +Ra_en_cours=$R_Centre +Va_en_cours=$V_Centre +Ba_en_cours=$B_Centre +Rb_en_cours=$R_a +Vb_en_cours=$V_a +Bb_en_cours=$B_a +Rc_en_cours=$R_b +Vc_en_cours=$V_b +Bc_en_cours=$B_b +fi +if ($Nb_boucles%{$Rendu+2})==1 +Ra_en_cours=$R_Centre +Va_en_cours=$V_Centre +Ba_en_cours=$B_Centre +Rb_en_cours=$R_b +Vb_en_cours=$V_b +Bb_en_cours=$B_b +if {$Rendu==0} +Rc_en_cours=$R_a +Vc_en_cours=$V_a +Bc_en_cours=$B_a +else +Rc_en_cours=$R_c +Vc_en_cours=$V_c +Bc_en_cours=$B_c +fi +fi +if ($Nb_boucles%{$Rendu+2})==2&&$Rendu>0 +Ra_en_cours=$R_Centre +Va_en_cours=$V_Centre +Ba_en_cours=$B_Centre +Rb_en_cours=$R_c +Vb_en_cours=$V_c +Bb_en_cours=$B_c +if {$Rendu==1} +Rc_en_cours=$R_a +Vc_en_cours=$V_a +Bc_en_cours=$B_a +else +Rc_en_cours=$R_d +Vc_en_cours=$V_d +Bc_en_cours=$B_d +fi +fi +if ($Nb_boucles%{$Rendu+2})==3&&$Rendu>1 +Ra_en_cours=$R_Centre +Va_en_cours=$V_Centre +Ba_en_cours=$B_Centre +Rb_en_cours=$R_d +Vb_en_cours=$V_d +Bb_en_cours=$B_d +if {$Rendu==2} +Rc_en_cours=$R_a +Vc_en_cours=$V_a +Bc_en_cours=$B_a +else +Rc_en_cours=$R_e +Vc_en_cours=$V_e +Bc_en_cours=$B_e +fi +fi +if ($Nb_boucles%{$Rendu+2})==4&&$Rendu>2 +Ra_en_cours=$R_Centre +Va_en_cours=$V_Centre +Ba_en_cours=$B_Centre +Rb_en_cours=$R_e +Vb_en_cours=$V_e +Bb_en_cours=$B_e +if {$Rendu==3} +Rc_en_cours=$R_a +Vc_en_cours=$V_a +Bc_en_cours=$B_a +else +Rc_en_cours=$R_f +Vc_en_cours=$V_f +Bc_en_cours=$B_f +fi +fi +if ($Nb_boucles%{$Rendu+2})==5&&$Rendu>3 +Ra_en_cours=$R_Centre +Va_en_cours=$V_Centre +Ba_en_cours=$B_Centre +Rb_en_cours=$R_f +Vb_en_cours=$V_f +Bb_en_cours=$B_f +if {$Rendu==4} +Rb_en_cours=$R_a +Vb_en_cours=$V_a +Bb_en_cours=$B_a +else +Rc_en_cours=$R_g +Vc_en_cours=$V_g +Bc_en_cours=$B_g +fi +fi +if ($Nb_boucles%{$Rendu+2})==6&&$Rendu>4 +R_en_cours=$R_g +V_en_cours=$V_g +B_en_cours=$B_g +fi +Angle_Rayon_De_Couleur_Ref={{$Nb_boucles*$Angle_Rayon_De_Couleur}+$Angle_Decalage_Couleurs+$Angle_Artefacts} +if $Nb_boucles==0 +else +fi +Angle_Rayon_De_Couleur_En_Cours={$Angle_Rayon_De_Couleur_Ref-$Angle_Artefacts} +Angle_Rayon_De_Couleur_En_Cours_Fin={$Angle_Rayon_De_Couleur_Ref+$Angle_Rayon_De_Couleur+$Angle_Artefacts} +triangle_shade[-1] {$Position_Centre_X*$Largeur_Origine/100},{$Position_Centre_Y*$Hauteur_Origine/100},{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*{$Angle_Rayon_De_Couleur_En_Cours}})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*{$Angle_Rayon_De_Couleur_En_Cours}})}}},{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*{$Angle_Rayon_De_Couleur_En_Cours_Fin}})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*{$Angle_Rayon_De_Couleur_En_Cours_Fin}})}}},$Ra_en_cours,$Va_en_cours,$Ba_en_cours,$Rb_en_cours,$Vb_en_cours,$Bb_en_cours,$Rc_en_cours,$Vc_en_cours,$Bc_en_cours +Nb_boucles+=1 +done +if $Activer_Color_Balance==1 +fx_balance_gamma[-1] $R_Neutral_color,$V_Neutral_color,$B_Neutral_color,$Stretch_colors=$34 +fi +if $Supprimer_Calque_Origine==1 +rm[0] +else +if $Activer_Melange==1 +if $Revert_layers==1 +rv[-1,-2] +fi +gimp_blend_1651[-2,-1] $Mode,0,$Opacity,0 +else +rv[-1,-2] +fi +fi +Twisted_Rays: +Dimension_Finale=$1 +Supprimer_Calque_Origine=$2 +Amplitude_Twirl=$3 +Melanges_Rayons=$4 +Rendu=$5 +Nb_De_Rayon_De_Couleur=$6 +Angle_Decalage_Couleurs_A=$7 +Angle_Decalage_Couleurs_B=$8 +R_a=$9 +V_a=$10 +B_a=$11 +A_a=$12 +R_b=$13 +V_b=$14 +B_b=$15 +A_b=$16 +R_c=$17 +V_c=$18 +B_c=$19 +A_c=$20 +R_d=$21 +V_d=$22 +B_d=$23 +A_d=$24 +R_e=$25 +V_e=$26 +B_e=$27 +A_e=$28 +R_f=$29 +V_f=$30 +B_f=$31 +A_f=$32 +R_g=$33 +V_g=$34 +B_g=$35 +A_g=$36 +Couleurs_aleatoires=$37 +R_Contours=$38 +V_Contours=$39 +B_Contours=$40 +A_Contours=$41 +Affichage_Contours=$42 +Dilate_Contours=$43 +Flou_Contours=$44 +Sharpen_Contours=$45 +Filtre_Symmetrizoscope=$46 +Iterations_Symmetrizoscope=$47 +Angle_Symmetrizoscope=$48 +Symmetry_Sides=$49 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_boucles=0 +Rayon_Cercle_Final={round({{$Dimension_Finale/2}-1})} +Rayon_De_Couleur={round({1+{$Dimension_Finale*{2^0.5}}})} +Angle_Rayon_De_Couleur={360/$Nb_De_Rayon_De_Couleur} +Angle_Rayon_De_Couleur_En_Cours_A=0 +Angle_Rayon_De_Couleur_En_Cours_Fin_A=0 +Angle_Rayon_De_Couleur_En_Cours_B=0 +Angle_Rayon_De_Couleur_En_Cours_Fin_B=0 +R_en_cours=0 +V_en_cours=0 +B_en_cours=0 +A_en_cours=0 +if $Supprimer_Calque_Origine==1 +rm[0] +fi +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,0 +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,0 +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,0 +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,0 +repeat $Nb_De_Rayon_De_Couleur +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +R_b={round(u)*255} +V_b={round(u)*255} +B_b={round(u)*255} +R_c={round(u)*255} +V_c={round(u)*255} +B_c={round(u)*255} +R_d={round(u)*255} +V_d={round(u)*255} +B_d={round(u)*255} +R_e={round(u)*255} +V_e={round(u)*255} +B_e={round(u)*255} +R_f={round(u)*255} +V_f={round(u)*255} +B_f={round(u)*255} +R_g={round(u)*255} +V_g={round(u)*255} +B_g={round(u)*255} +fi +if ($Nb_boucles%{$Rendu+2})==0 +R_en_cours=$R_a +V_en_cours=$V_a +B_en_cours=$B_a +A_en_cours=$A_a +fi +if ($Nb_boucles%{$Rendu+2})==1 +R_en_cours=$R_b +V_en_cours=$V_b +B_en_cours=$B_b +A_en_cours=$A_b +fi +if ($Nb_boucles%{$Rendu+2})==2&&$Rendu>0 +R_en_cours=$R_c +V_en_cours=$V_c +B_en_cours=$B_c +A_en_cours=$A_c +fi +if ($Nb_boucles%{$Rendu+2})==3&&$Rendu>1 +R_en_cours=$R_d +V_en_cours=$V_d +B_en_cours=$B_d +A_en_cours=$A_d +fi +if ($Nb_boucles%{$Rendu+2})==4&&$Rendu>2 +R_en_cours=$R_e +V_en_cours=$V_e +B_en_cours=$B_e +A_en_cours=$A_e +fi +if ($Nb_boucles%{$Rendu+2})==5&&$Rendu>3 +R_en_cours=$R_f +V_en_cours=$V_f +B_en_cours=$B_f +A_en_cours=$A_f +fi +if ($Nb_boucles%{$Rendu+2})==6&&$Rendu>4 +R_en_cours=$R_g +V_en_cours=$V_g +B_en_cours=$B_g +A_en_cours=$A_g +fi +Angle_Rayon_De_Couleur_En_Cours_A={{$Nb_boucles*$Angle_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_A} +Angle_Rayon_De_Couleur_En_Cours_Fin_A={{{$Nb_boucles+1}*$Angle_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_A} +Angle_Rayon_De_Couleur_En_Cours_B={{$Nb_boucles*$Angle_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_B} +Angle_Rayon_De_Couleur_En_Cours_Fin_B={{{$Nb_boucles+1}*$Angle_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_B} +polygon[-1] 3,50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos(pi/180*$Angle_Rayon_De_Couleur_En_Cours_A)}}},{{h/2}+{$Rayon_De_Couleur*{sin(pi/180*$Angle_Rayon_De_Couleur_En_Cours_A)}}},{{w/2}+{$Rayon_De_Couleur*{cos(pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin_A)}}},{{h/2}+{$Rayon_De_Couleur*{sin(pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin_A)}}},1,$R_en_cours,$V_en_cours,$B_en_cours,$A_en_cours +polygon[-2] 3,50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos(pi/180*$Angle_Rayon_De_Couleur_En_Cours_B)}}},{{h/2}+{$Rayon_De_Couleur*{sin(pi/180*$Angle_Rayon_De_Couleur_En_Cours_B)}}},{{w/2}+{$Rayon_De_Couleur*{cos(pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin_B)}}},{{h/2}+{$Rayon_De_Couleur*{sin(pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin_B)}}},1,$R_en_cours,$V_en_cours,$B_en_cours,$A_en_cours +if $Affichage_Contours==1 +line[-3] 50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos(pi/180*$Angle_Rayon_De_Couleur_En_Cours_A)}}},{{h/2}+{$Rayon_De_Couleur*{sin(pi/180*$Angle_Rayon_De_Couleur_En_Cours_A)}}},1,$R_Contours,$V_Contours,$B_Contours,$A_Contours +line[-4] 50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos(pi/180*$Angle_Rayon_De_Couleur_En_Cours_B)}}},{{h/2}+{$Rayon_De_Couleur*{sin(pi/180*$Angle_Rayon_De_Couleur_En_Cours_B)}}},1,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +Nb_boucles+=1 +done +dilate_circ[-3,-4] 2 +twirl[-1,-3] $Amplitude_Twirl,50%,50%,0 +twirl[-2,-4] -$Amplitude_Twirl,50%,50%,0 +samj_blend_20220419[-3,-4] alpha,1,0 +if $Affichage_Contours==1 +ellipse[-3] 50%,50%,$Rayon_Cercle_Final,$Rayon_Cercle_Final,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-3] 50%,50%,{$Rayon_Cercle_Final-1},{$Rayon_Cercle_Final-1},0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-3] 50%,50%,{$Rayon_Cercle_Final-2},{$Rayon_Cercle_Final-2},0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Dilate_Contours>1 dilate_circ[-3] $Dilate_Contours fi +if $Flou_Contours>0 blur[-3] $Flou_Contours,0 fi +if $Sharpen_Contours>0 sharpen[-3] $Sharpen_Contours fi +if $Filtre_Symmetrizoscope==1 +fx_symmetrizoscope[-1,-2,-3] $Iterations_Symmetrizoscope,$Angle_Symmetrizoscope,0,$Symmetry_Sides +fi +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 255,255,255,255 +circle[-1] 50%,50%,$Rayon_Cercle_Final,1,0,0,0,0 +samj_blend_20220419[-4,-1] alpha,1,0 +replace_color[-3] 100%,0,255,255,255,255,0,0,0,0 +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,0 +circle[-1] 50%,50%,$Rayon_Cercle_Final,1,0,0,0,255 +rv[-1,-3] +samj_blend_20220419[-3,-1] add,1,0 +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,0 +circle[-1] 50%,50%,$Rayon_Cercle_Final,1,0,0,0,255 +rv[-1,-2] +samj_blend_20220419[-2,-1] add,1,0 +if $Melanges_Rayons==0 +samj_blend_20220419[-1,-2] add,1,0 +elif $Melanges_Rayons==1 +samj_blend_20220419[-1,-2] and,1,0 +elif $Melanges_Rayons==2 +samj_blend_20220419[-1,-2] average,1,0 +elif $Melanges_Rayons==3 +samj_blend_20220419[-1,-2] darken,1,0 +elif $Melanges_Rayons==4 +samj_blend_20220419[-1,-2] difference,1,0 +elif $Melanges_Rayons==5 +samj_blend_20220419[-1,-2] edges,1,0 +elif $Melanges_Rayons==6 +samj_blend_20220419[-1,-2] grainextract,1,0 +elif $Melanges_Rayons==7 +samj_blend_20220419[-1,-2] grainmerge,1,0 +elif $Melanges_Rayons==8 +samj_blend_20220419[-1,-2] multiply,1,0 +elif $Melanges_Rayons==9 +samj_blend_20220419[-1,-2] negation,1,0 +elif $Melanges_Rayons==10 +samj_blend_20220419[-1,-2] or,1,0 +elif $Melanges_Rayons==11 +samj_blend_20220419[-1,-2] screen,1,0 +elif $Melanges_Rayons==12 +samj_blend_20220419[-1,-2] softburn,1,0 +elif $Melanges_Rayons==13 +samj_blend_20220419[-1,-2] softdodge,1,0 +elif $Melanges_Rayons==14 +samj_blend_20220419[-1,-2] subtract,1,0 +elif $Melanges_Rayons==15 +samj_blend_20220419[-1,-2] xor,1,0 +elif $Melanges_Rayons==16 +fi +c[-1,-2] 0,255 +if $Supprimer_Calque_Origine==1 +if $Melanges_Rayons==16 +rv[-3,-2,-1] +else +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha,1,0 +fi +else +if $Melanges_Rayons==16 +rv[-3,-2,-1,0] +else +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha,1,0 +rv[0,-1] +fi +fi +samj_CorLine: +Balance_Couleurs=$1 +Chroma_Couleurs=$2 +Nettete_A=$3 +Nettete_B=$4 +Type_Reparation=$5 +Amplitude_Reparation=$6 +Repetition_Reparation=$7 ++Je_passe_l_hiver_en_Floride[0] +to_rgb[-1] +fx_balance_gamma[-1] {127+$Balance_Couleurs},{127+$Balance_Couleurs},{127+$Balance_Couleurs},1 +fx_boost_chroma[-1] {$Chroma_Couleurs/100},1 +fx_unsharp_octave[-1] 1,5,$Nettete_A,0,2,0,24 +if $Type_Reparation==0 +repeat $Repetition_Reparation +fx_smooth_anisotropic[-1] $Amplitude_Reparation,0.7,0.3,0.6,1.1,0.8,30,2,0,1,1,2 +done +elif $Type_Reparation==1 +repeat $Repetition_Reparation +fx_smooth_diffusion[-1] 0.7,0.3,0.6,{0.5+{$Amplitude_Reparation/100}},15,8,0,0,24 +done +fi +if $Nettete_B>0 fx_unsharp_octave[-1] 1,5,$Nettete_B,0,2,0,24 fi +rv[-1,-2] +samj_CorLine_preview : +gui_split_preview "samj_CorLine $*",$-1 +samj_rien_sequences : +Je_passe_l_hiver_en_Floride[-1] +samj_CorLine_B: +Balance_Couleurs=$1 +Valeur_Gamma=$2 +Chroma_Couleurs=$3 +Cyan=$4 +Magenta=$5 +Jaune=$6 +Nettete_A=$7 +Nettete_B=$8 +Type_Reparation=$9 +Amplitude_Reparation=$10 +Repetition_Reparation=$11 ++Je_passe_l_hiver_en_Floride[0] +to_rgb[-1] +fx_balance_gamma[-1] {127+$Balance_Couleurs},{127+$Balance_Couleurs},{127+$Balance_Couleurs},1 +fx_boost_chroma[-1] {$Chroma_Couleurs/100},1 +fx_unsharp_octave[-1] 1,5,$Nettete_A,0,2,0,24 +apply_gamma[-1] $Valeur_Gamma +if $Type_Reparation==0 +repeat $Repetition_Reparation +fx_smooth_anisotropic[-1] $Amplitude_Reparation,0.7,0.3,0.6,1.1,0.8,30,2,0,1,1,2 +done +elif $Type_Reparation==1 +repeat $Repetition_Reparation +fx_smooth_diffusion[-1] 0.7,0.3,0.6,{0.5+{$Amplitude_Reparation/100}},15,8,0,0,24 +done +fi +if $Nettete_B>0 fx_unsharp_octave[-1] 1,5,$Nettete_B,0,2,0,24 fi +if $Cyan!=0 +Cyan={127+$Cyan} +apply_channels[-1] "apply_curve 1,0,0,128,"$Cyan",255,255",cmy_c,0 +fi +if $Magenta!=0 +Magenta={127+$Magenta} +apply_channels[-1] "apply_curve 1,0,0,128,"$Magenta",255,255",cmy_m,0 +fi +if $Jaune!=0 +Jaune={127+$Jaune} +apply_channels[-1] "apply_curve 1,0,0,128,"$Jaune",255,255",cmy_y,0 +fi +rv[-1,-2] +samj_CorLine_B_preview : +gui_split_preview "samj_CorLine_B $*",$-1 +samj_fx_spatial_transition_to_PNG : +Index=0 +repeat {{258*$!}+10} +if $Index<10 +Supprimer="_00000" +elif $Index>9&&$Index<100 +Supprimer="_0000" +elif $Index>99&&$Index<1000 +Supprimer="_000" +elif $Index>999&&$Index<10000 +Supprimer="_00" +elif $Index>9999&&$Index<100000 +Supprimer="_0" +elif $Index>99999&&$Index<1000000 +Supprimer="_" +fi +Supprimer.=$Index +Supprimer.=".png" +if '$_os'=='windows' +delete $_path_rc"\Spatial_Transition"$Supprimer +else +delete $_path_rc"/Spatial_Transition"$Supprimer +fi +Index+=1 +done +fx_spatial_transition $1,$2,$3,$4,$5,$6,$7,$8 +if '$_os'=='windows' +o $_path_rc"\Spatial_Transition.png" +else +o $_path_rc"/Spatial_Transition.png" +fi +if $9 display0[{-round($!/2)}] fi +samj_rien_various : +Je_passe_l_hiver_en_Floride[-1] +samj_transition_H_V_to_PNG : +if $!>0 +Lo={w} +Ho={h} +if $!==1 +- fi +if $3==0 +if $2==1||$2==3 rv fi +else +if $2==0||$2==2 rv fi +fi +if $2==0||$2==1 +append x +Lap={w} +Hap={h} +Int={{$Lap-$Lo}/{$1-1}} +Index=0 +repeat {$1-1} ++crop. {$Index*$Int},0,{$Lo+{$Index*$Int}-1},{$Ho-1},0 +rv[-1,-2] +Index+=1 +done ++crop[-1] {$Lap-$Lo+1},0,$Lap,{$Ho-1},0 +elif $2==2||$2==3 +append y +Lap={w} +Hap={h} +Int={{$Hap-$Ho}/{$1-1}} +Index=0 +repeat {$1-1} ++crop. 0,{$Index*$Int},{$Lo-1},{$Ho+{$Index*$Int}-1},0 +rv[-1,-2] +Index+=1 +done ++crop[-1] 0,{$Hap-$Ho+1},{$Lo-1},$Hap,0 +fi +rm[-2] +if $3==0 rv fi +Index=0 +repeat 300 +if $Index<10 +Supprimer="_00000" +elif $Index>9&&$Index<100 +Supprimer="_0000" +elif $Index>99&&$Index<1000 +Supprimer="_000" +fi +Supprimer.=$Index +Supprimer.=".png" +if '$_os'=='windows' +delete $_path_rc"\TransitionHV"$Supprimer +else +delete $_path_rc"/TransitionHV"$Supprimer +fi +Index+=1 +done +if '$_os'=='windows' +o $_path_rc"\TransitionHV.png" +else +o $_path_rc"/TransitionHV.png" +fi +if $4 display0[{-round($!/2)}] fi +fi +samj_transition_H_V_to_PNG_Preview : +if $!==1 +- fi +if $2==0||$2==2 rv fi +if $2==0||$2==1 +append x +elif $2==2||$2==3 +append y +fi +text "TransitionHV_000000.png",20,20,24,1,255,255,255,255 +samj_BoxFiter_Map : +Flou=$1 +Valeur_X=$2 +Valeur_Y=$3 +Codage=$4 +Melange=$5 +samj_Wavelet_Sharpen=$6 +Iterations_Wavelet_Sharpen=$7 +Valeur_Equalize=$8 +Valeur_Colormap=$9 +Valeur_Dithering=$10 +Autorisation_Transfer=$11 +Transfer_Luminosity_Constraints=$12 +Transfer_Gamma=0.3 +Transfer_Regularization=8 +Transfer_RGB_Resolution=16 +Transfer_Is_Constraints=0 +Val_Max_Norm=255 +if $Melange==1 Val_Max_Norm=127 fi ++Je_passe_l_hiver_en_Floride[-1] +blur[-1] $Flou ++Je_passe_l_hiver_en_Floride[-1] +boxfilter[-1] y,$Valeur_Y,1 +n[-1] 0,$Val_Max_Norm +to_graya[-1] +rv[-2,-1] +boxfilter[-1] x,$Valeur_X,1 +n[-1] 0,$Val_Max_Norm +to_graya[-1] +if $Codage==1 luminance[-1,-2] fi +if $Melange==0 samj_blend_20220419[-1,-2] alpha else samj_blend_20220419[-1,-2] add fi +to_rgb[-1] +if $samj_Wavelet_Sharpen>0 samj_Wavelet_Sharpen_Test_en[-1] {$samj_Wavelet_Sharpen-1},$Iterations_Wavelet_Sharpen fi +equalize[-1] $Valeur_Equalize,0,255 +n[-1] 0,255 +rv[-2,-1] +to_rgb[-1] +if $Autorisation_Transfer==1 Valeur_Colormap={round({{256*0.8}+{$Valeur_Colormap*0.2}})} fi +colormap[-1] $Valeur_Colormap +index[-2] [-1],$Valeur_Dithering,0 +if $Autorisation_Transfer==1 transfer_rgb[-2] [-1],$Transfer_Gamma,$Transfer_Regularization,$Transfer_Luminosity_Constraints,$Transfer_RGB_Resolution,$Transfer_Is_Constraints fi +rm[-1] +n[-1] 0,255 +samj_BoxFiter_Test : +Flou=$1 +Valeur_X=$2 +Valeur_Y=$3 +samj_Wavelet_Sharpen=$4 +Iterations_Wavelet_Sharpen=$5 +blur[-1] $Flou ++Je_passe_l_hiver_en_Floride[-1] +boxfilter[-1] y,$Valeur_Y,1 +n[-1] 0,255 +to_graya[-1] +rv[-2,-1] +boxfilter[-1] x,$Valeur_X,1 +n[-1] 0,255 +to_graya[-1] +samj_blend_20220419[-1,-2] alpha +to_graya[-1] +if $samj_Wavelet_Sharpen>0 samj_Wavelet_Sharpen_Test_en[-1] {$samj_Wavelet_Sharpen-1},$Iterations_Wavelet_Sharpen fi +n[-1] 0,255 +samj_Carres_Lignes : +Quantite=$1 +Variation=$2 +Graine=$3 +Degradation=$4 +AlphaPoly=$5 +PCL=$6 +AlphaLA=$7 +AlphaLB=$8 +DilateLignes=$9 +FR=$10 +VR=$11 +BR=$12 +AR=$13 +foreach { +MaxL={round($Quantite/100*$PCL)+1} +srand $Graine +to_rgba +{w},{h},1,4 +{w},{h},1,4 +rv +repeat $Quantite +Index=$> +Angle={round(u*90)} +Xori={round(u*{w})} +Yori={round(u*{h})} +Diag={round(u*$Variation/400*{w+h})+1} +X1p={$Xori+round($Diag*cos(pi/180*$Angle))} +Y1p={$Yori+round($Diag*sin(pi/180*$Angle))} +X2p={$Xori+round($Diag*cos(pi/180*{$Angle+90}))} +Y2p={$Yori+round($Diag*sin(pi/180*{$Angle+90}))} +X3p={$Xori+round($Diag*cos(pi/180*{$Angle+180}))} +Y3p={$Yori+round($Diag*sin(pi/180*{$Angle+180}))} +X4p={$Xori+round($Diag*cos(pi/180*{$Angle+270}))} +Y4p={$Yori+round($Diag*sin(pi/180*{$Angle+270}))} +couleur_pixel={I(#-1,$Xori,$Yori)} +Rp={arg(1,$couleur_pixel)} +Vp={arg(2,$couleur_pixel)} +Bp={arg(3,$couleur_pixel)} +Ap={arg(4,$couleur_pixel)} +polygon.. 4,$X1p,$Y1p,$X2p,$Y2p,$X3p,$Y3p,$X4p,$Y4p,1,$Rp,$Vp,$Bp,{$AlphaPoly*$Ap} +if $Index<$MaxL +a_Ligne={{$Y3p-$Y1p}/{$X3p-$X1p}} +b_Ligne={$Y3p-($a_Ligne*$X3p)} +X_Ex_a=0 +Y_Ex_a=$b_Ligne +X_Ex_b={{w}-1} +Y_Ex_b={{$a_Ligne*$X_Ex_b}+$b_Ligne} +if $Y_Ex_b>=0 line... $X_Ex_a,$Y_Ex_a,$X_Ex_b,$Y_Ex_b,1,$Rp,$Vp,$Bp,{$AlphaLA*$Ap} fi +a_Ligne={{$Y4p-$Y2p}/{$X4p-$X2p}} +b_Ligne={$Y4p-($a_Ligne*$X4p)} +X_Ex_a=0 +Y_Ex_a=$b_Ligne +X_Ex_b={{w}-1} +Y_Ex_b={{$a_Ligne*$X_Ex_b}+$b_Ligne} +if $Y_Ex_b>=0 line... $X_Ex_a,$Y_Ex_a,$X_Ex_b,$Y_Ex_b,1,$Rp,$Vp,$Bp,{$AlphaLB*$Ap} fi +fi +done +if $DilateLignes>1 dilate_circ... $DilateLignes fi +rm. +blend alpha +{w},{h},1,4 +fill_color. $FR,$VR,$BR,$AR +rv +blend alpha +if $Degradation>0 kuwahara. $Degradation fi +} +samj_CeKoaSa_001 : +Smoothness_thin_edges=$1 +Threshold_thin_edges=$2 +Amplitude_ripple=$3 +Boost=$4 +Size_morpho=$5 ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +fx_thin_edges[-1] $Smoothness_thin_edges,$Threshold_thin_edges,0 ++Je_passe_l_hiver_en_Floride[-1] +ripple[-1] $Amplitude_ripple,20,2,0 +samj_blend_20220419[-1,-2] average,1,1 +ripple[-1] {1.2*{$Amplitude_ripple}},20,2,0 +fx_edges[-2] 0,15,0,0 +samj_blend_20220419[-1,-2] average,1,1 +if $Boost==1 +fx_balance_gamma[-1] 128,128,128,1 +fi +ancien_gimp_morpho[-1] 0,$Size_morpho,0,2,0,1 +fx_normalize_local[-2] 2,6,5,20,1,3 +samj_blend_20220419[-1,-2] softlight,1,0 +fx_LCE[-1] 80,0.5,1,1,3,0 +samj_CeKoaSa_002 : +Smoothness_thin_edges=$1 +Threshold_thin_edges=$2 +Amplitude_ripple=$3 +Boost=$4 +Size_morpho=$5 +Valider_Otsu=$6 +to_rgba[-1] +fx_frame[-1] 0,100,0,100,1,1,0,0,0,255,1,255,255,255,255 +if $Valider_Otsu==1 +otsu[-1] 4 n[-1] 0,255 +fi ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +fx_thin_edges[-1] $Smoothness_thin_edges,$Threshold_thin_edges,0 ++Je_passe_l_hiver_en_Floride[-1] +ripple[-1] $Amplitude_ripple,20,2,0 +samj_blend_20220419[-1,-2] average,1,1 +ripple[-1] {1.2*{$Amplitude_ripple}},20,2,0 +fx_edges[-2] 0,15,0,0 +samj_blend_20220419[-1,-2] average,1,1 +if $Boost==1 +fx_balance_gamma[-1] 128,128,128,1 +fi +ancien_gimp_morpho[-1] 0,$Size_morpho,0,2,0,1 +fx_normalize_local[-2] 2,6,5,20,1,3 +samj_blend_20220419[-1,-2] softlight,1,0 +polygonize_GUI[-1] 10,10,10,10,10,0 +fx_LCE[-1] 80,0.5,1,1,3,0 +samj_CeKoaSa_003 : +Smoothness_thin_edges=$1 +Threshold_thin_edges=$2 +Amplitude_ripple=$3 +Boost=$4 +Size_morpho=$5 ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +fx_thin_edges[-1] $Smoothness_thin_edges,$Threshold_thin_edges,0 ++Je_passe_l_hiver_en_Floride[-1] +ripple[-1] $Amplitude_ripple,20,2,0 +samj_blend_20220419[-1,-2] average,1,1 +ripple[-1] {1.2*{$Amplitude_ripple}},20,2,0 +fx_edges[-2] 0,15,0,0 +samj_blend_20220419[-1,-2] average,1,1 +if $Boost==1 +fx_balance_gamma[-1] 128,128,128,1 +fi +ancien_gimp_morpho[-1] 0,$Size_morpho,0,2,0,1 +fx_normalize_local[-2] 2,6,5,20,1,3 +samj_blend_20220419[-1,-2] softlight,1,0 +fx_LCE[-1] 80,0.5,1,1,3,0 +polygonize_GUI[-2] 10,10,10,10,10,0 +fx_gaussian_blur[-2] 20,0,0,1,0,0 +samj_blend_20220419[-1,-2] average,0.5,1 +samj_CeKoaSa_004 : +Modulo=$1 +Negatif=$2 +B_W_pencil_amplitude=$3 +Opacity_blend_edges=$4 +Denoise_Image=$5 +to_rgb[-1] ++Je_passe_l_hiver_en_Floride[-1] +mod[-1] {20+$Modulo} +n[-1] 0,255 +fx_ditheredbw[-1] 0,1,0,0,0,0 +if $Negatif==1 +negate[-1] +fi +if $B_W_pencil_amplitude>0 +pencilbw[-1] 0.3,$B_W_pencil_amplitude +fi +fx_blend_edges[-1,-2] 1,$Opacity_blend_edges,0 +if $Denoise_Image>0 +denoise[-1] $Denoise_Image,$Denoise_Image,5,6,1,0 +fi +samj_CeKoaSa_005 : +Grille_X=$1 +Grille_Y=$2 +Grille_Carree_X=$3 +Grille_Carree_Y=$4 +Intensite=$5 +Mode_Melange=$6 +Opacity_Melange=$7 +Revert_layers_Melange=$8 +Normaliser=$9 ++Je_passe_l_hiver_en_Floride[-1] +if $Grille_Carree_X==1 +Grille_Y=$Grille_X +fi +if $Grille_Carree_Y==1 +Grille_X=$Grille_Y +fi +rand[-1] 0,255 +imagegrid[-1,-2] $Grille_X,$Grille_Y ++Je_passe_l_hiver_en_Floride[-1] +samj_blend_20220419[-1,-2] add,$Intensite,0 +gimp_blend_1651[-1,-2] $Mode_Melange,0,$Opacity_Melange,$Revert_layers_Melange,1 +if $Normaliser==1 +n[-1] 0,255 +fi +to_colormode[-1] 4 +samj_CeKoaSa_007 : +Val_Max_Patch=$1 +Val_Min_Patch=$2 +Val_Dilate=$3 +Val_Pixelize=$4 +Flou=$5 ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +max_patch[-1] $Val_Max_Patch +n[-1] 0,255 +min_patch[-2] $Val_Min_Patch +n[-2] 0,255 +dilate[-1,-2] $Val_Dilate +samj_blend_20220419[-1,-2] edges +blur[-1] $Flou +pixelize[-1,-2,-3] $Val_Pixelize,$Val_Pixelize ++luminance[-1] +samj_blend_20220419[-1,-2,-3] edges +samj_blend_20220419[-1,-2] grainmerge +samj_CeKoaSa_008: +Detection_A=$1 +Detection_B=$2 +Flou_Lissage=$3 +Couleur=$4 +Type_Rendu=$5 +Niveaux_TM=$6 +Adoucissement_TM=$7 +Edges_SG=$8 +Shading_SG=$9 +Is_Precise_SG=$10 +Intensite_SG=$11 +Isophotes_Nb_Levels=$12 +Validation_Smooth_Antialias=$13 +V_Amplitude=$14 +V_Edge_Threshold=$15 +V_Smoothness=$16 +R_a=$17 +V_a=$18 +B_a=$19 +A_a=$20 +blur[-1] $Flou_Lissage +n[-1] 0,255 +c[-1] {127-$Detection_A},{127+$Detection_B} +n[-1] 0,255 +mul[-1] $Couleur +topographic_map[-1] $Niveaux_TM,$Adoucissement_TM ++Je_passe_l_hiver_en_Floride[-1] +stained_glass[-1] $Edges_SG,$Shading_SG,$Is_Precise_SG +repeat $Intensite_SG ++Je_passe_l_hiver_en_Floride[-1] +samj_blend_20220419[-1,-2] overlay +done +if $Type_Rendu==1 +to_graya[-1] +samj_blend_20220419[-1,-2] overlay +elif $Type_Rendu==2 +to_graya[-1] +samj_blend_20220419[-1,-2] alpha +elif $Type_Rendu==3 +to_graya[-1] +samj_blend_20220419[-1,-2] edges +elif $Type_Rendu==4 +samj_blend_20220419[-1,-2] overlay +elif $Type_Rendu==5 +samj_blend_20220419[-1,-2] alpha +elif $Type_Rendu==6 +samj_blend_20220419[-1,-2] edges +elif $Type_Rendu==7 +samj_blend_20220419[-1,-2] average +fi +isophotes[-1] $Isophotes_Nb_Levels +if $Validation_Smooth_Antialias==1 fx_smooth_antialias[-1] $V_Amplitude,$V_Edge_Threshold,$V_Smoothness fi +{w},{h},1,4 +fill_color[-1] $R_a,$V_a,$B_a,$A_a +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +samj_CeKoaSa_008_preview : +gui_split_preview "samj_CeKoaSa_008 $*",$-1 +samj_CeKoaSa_009: +SM_Iterations=$1 +SM_Amplitude=$2 +SM_Sharpness=$3 +SM_Anisotropy=$4 +SM_Gradient_smoothness=$5 +SM_Tensor_smoothness=$6 +SM_Spatial_precision=$7 +SM_Angular_precision=$8 +SM_Value_precision=$9 +SM_Interpolation=$10 +SM_Fast_approximation=$11 +SC_Edge_Sensitivity=$12 +SC_Iterations=$13 +SC_Paint_effect=$14 +SC_Channels=$15 +SC_Pre_gamma=$16 +SC_Post_gamma=$17 +SC_Blacks=$18 +SC_Dark_grey=$19 +SC_Mid_grey=$20 +SC_Light_grey=$21 +SC_Whites=$22 +SC_Parallel_Processing=$23 +Wavelet_Sharpen=$24 +Wavelet_Sharpen_Type=$25 +Wavelet_Sharpen_Iterations=$26 +Script_Origine=$27 +Utiliser_courbes=$28 +if $Script_Origine==1 ++fx_smooth_anisotropic[0] 10,0.16,0.63,0.6,2.35,0.8,30,2,0,1,1,0,1 +sub[0] [1] +simplelocalcontrast_p[1] 25,1,50,1,1,1.2,1,1,1,1,1,1 +fx_graphic_novelfxl[1] 1,2,6,5,20,0,1,100,0,1,0,0.78,1.92,0,0,2,1,1,1,1.26,0.37,1.05 +add +c 0,255 +else ++Je_passe_l_hiver_en_Floride[-1] +repeat $SM_Iterations +smooth[-1] $SM_Amplitude,$SM_Sharpness,$SM_Anisotropy,$SM_Gradient_smoothness,$SM_Tensor_smoothness,$SM_Spatial_precision,$SM_Angular_precision,$SM_Value_precision,$SM_Interpolation,$SM_Fast_approximation +done +sub[-2] [-1] +simplelocalcontrast_p[-1] $SC_Edge_Sensitivity,$SC_Iterations,$SC_Paint_effect,$SC_Channels,$SC_Pre_gamma,$SC_Post_gamma,$SC_Blacks,$SC_Dark_grey,$SC_Mid_grey,$SC_Light_grey,$SC_Whites,$SC_Parallel_Processing +if $Wavelet_Sharpen==0 +samj_Wavelet_Sharpen_Test_en[-1] $Wavelet_Sharpen_Type,$Wavelet_Sharpen_Iterations +elif $Wavelet_Sharpen==0 +fx_graphic_novelfxl[-1] 1,2,6,5,20,0,1,100,0,1,0,0.78,1.92,0,0,2,1,1,1,1.26,0.37,1.05 +fi +rm[-2] +c[-1] 0,255 +fi +if $Utiliser_courbes==1 +fx_curves_interactive[-1] $29,$30,$31,$32,$33 +fi +samj_CeKoaSa_010 : +FlouA=$1 +FlouB=$2 +DiffA=$3 +DiffB=$4 +Isop=$5 +to_rgba[-1] ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +blur[-1] $FlouA +blur[-2] $FlouB +diffusiontensors[-1] 0,1,1,$DiffA,1 +diffusiontensors[-2] 0,1,1,$DiffB,1 +abs[-1,-2] +n[-1,-2] 0,255 +transfer_colors[-1] [-3] +transfer_colors[-2] [-3] +samj_blend_20220419[-1,-2] add +c[-1] 0,255 +n[-1] 0,255 +isophotes[-1] $Isop +blur[-2] {{w+h}/4} +samj_blend_20220419[-1,-2] alpha +samj_CeKoaSa_011 : +Larg={w} +Haut={h} +if $5==1 ++samj_Masque_CeKoaSa_011[-1] $1,$2,$3,$4 +samj_blend_20220419[-1,-2] average,100,0 +else +samj_Masque_CeKoaSa_011[-1] $1,$2,$3,$4 +fi +if $17==1 c[-1] $18,$19 n[-1] 0,255 fi +if $6==1 +to_rgba[-1] +$Larg,$Haut,1,4 +samj_Linear_Gradient_CIE_Lab[-1] $7,$8,$9,$10,$11,$12,$13,$14,$15,$16 +samj_blend_20220419[-1,-2] average,100,0 +fi +samj_Masque_CeKoaSa_011 : +gradient[-1] +if $2==1 ditheredbw[-1] elif $2==2 ditheredbw[-2] elif $2==3 ditheredbw[-1,-2] fi +append c +blur $1 +if $4==0 +gradient_orientation 1 +elif $4==1 +gradient_orientation 2 rm[-1] +elif $4==2 +gradient_orientation 3 rm[-1,-2] +elif $4==3 +gradient_orientation 2 rm[-2] +elif $4==4 +gradient_orientation 3 rm[-1,-2] +elif $4==5 +orientation +fi +direction2rgb +if $3==1 bump2normal fi +n 0,255 +to_gray +samj_diaporama : +if $2==0 +samj_diapo $1 +else +do +if {{*,ESC}||{*,Q}} break fi +samj_diapo $1 +while 1 +fi +rm[-$!--1] +samj_diapo : +Delai={$1*1000} +Bc=$! +do +if {{*,ESC}||{*,Q}} break fi +if {*,PAGEUP} +Bc+=2 +if $Bc>$! Bc=$! fi +fi +if {*,PAGEDOWN} Bc-=2 fi ++samj_full_screen_display[{$Bc-$!-1}] 1,,,$Delai +Bc-=1 +while $Bc>=1 +Je_passe_l_hiver_en_Floride : +samj_Layers_To_PNG : +if '$_os'=='windows' +o $_path_rc"\samj_Layers.png" +else +o $_path_rc"/samj_Layers.png" +fi +samj_Layers_To_PNG_Texte $! +samj_Layers_To_PNG_Preview : +Calques=$! +rm +samj_Layers_To_PNG_Texte $Calques +samj_Layers_To_PNG_Texte : +1500,120,1,3 +fill_color. 255,255,255 +text. "Enregistre chaque calque comme image PNG / Save all layers as PNG file.",20,20,16,1,0,0,0 +if '$_os'=='windows' +if $1==1 +text. $_path_rc"\samj_Layers.png",20,50,16,1,0,0,0 +elif $1>1 +text. $_path_rc"\samj_Layers_xxxxxx.png",20,50,16,1,0,0,0 +fi +else +if $1==1 +text. $_path_rc"/samj_Layers.png",20,50,16,1,0,0,0 +elif $1>1 +text. $_path_rc"/samj_Layers_xxxxxx.png",20,50,16,1,0,0,0 +fi +fi +if $1<2 +text. $1" Fichier/File",20,80,20,1,255,0,0 +else +text. $1" Fichiers/Files",20,80,20,1,255,0,0 +fi +autocrop. +polygonize_GUI : +if $6>0 to_rgba fx_frame 0,100,0,100,1,1,0,0,0,255,1,255,255,255,255 otsu {$6+3} n 0,255 fi +polygonize $1,$2,$3,$4,$5 +gimp_recolorize_20130115_modifie : +Smoothness=$1 +Nuances=$2 +Normalize_A=$3 +Normalize_B=$4 +Degoulinade_A=$5 +Degoulinade_B=$6 +Precision=$7 +rv[-2,-1] +dilate_circ[-1] $Degoulinade_A +if $Nuances==0 +channels[-2] 0 +elif $Nuances==1 +fx_decompose_channels[-2] 4,0,1,0 remove[-2,-3] +elif $Nuances==2 +to_rgb[-2] rgb2hsl8[-2] split[-2] c rm[-3,-4] +elif $Nuances==3 +to_rgb[-2] rgb2lab8[-2] split[-2] c rm[-2,-3] +elif $Nuances==4 +to_rgb[-2] rgb2cmyk[-2] split[-2] c rm[-3,-4,-5] negate[-2] +fi +to_rgb[-2] to_rgba[-1] +n[-2] $Normalize_A,$Normalize_B +split_opacity[-1] +neq[-1] 0 +srgb2rgb[-3,-2] +rgb2lab8[-3,-2] +channels[-3] 0 +channels[-2] 1,2 ++[-2] 1 +*[-2] [-1] ++gradient_norm[-3] +blur[-1] $Degoulinade_B +*[-1] -1 +watershed[-3] [-1] +rm[-1] +--[-2] 1 +if $Precision==1 ++diffusiontensors[-3] 0,1,1,1 +eq[-2] 0 +*[-1] [-2] +rm[-2] +smooth[-2] [-1],$Smoothness,0.8,45,2,0 +fi +rm[-1] +a[-2,-1] c +lab82rgb[-1] +rgb2srgb[-1] +samj_Relief_A : +V_variation=$1 +V_order=$2 +V_axis=$3 +V_boundary=$4 +SC_Edge_Sensitivity=$5 +SC_Iterations=$6 +SC_Paint_effect=$7 +SC_Channels=$8 +SC_Pre_gamma=$9 +SC_Post_gamma=$10 +SC_Blacks=$11 +SC_Dark_grey=$12 +SC_Mid_grey=$13 +SC_Light_grey=$14 +SC_Whites=$15 +SC_Parallel_Processing=$16 +Wavelet_Sharpen_Selection=$17 +Wavelet_Sharpen_Type_A=$18 +Wavelet_Sharpen_Iterations_A=$19 +Wavelet_Sharpen_Type_B=$20 +Wavelet_Sharpen_Iterations_B=$21 +Cut_A=$22 +Cut_B=$23 ++Je_passe_l_hiver_en_Floride[-1] +if $V_axis==0 +vanvliet[-1] $V_variation,$V_order,x,$V_boundary +elif $V_axis==1 +vanvliet[-1] $V_variation,$V_order,y,$V_boundary +elif $V_axis==2 +mirror[-1] x +vanvliet[-1] $V_variation,$V_order,x,$V_boundary +mirror[-1] x +elif $V_axis==3 +mirror[-1] y +vanvliet[-1] $V_variation,$V_order,y,$V_boundary +mirror[-1] y +fi +n[-1] 0,{{iM}-{im}} +c[-1] {{iM}/100*$Cut_A},{iM} +n[-1] 0,{iM} +c[-1] 0,{{iM}/100*$Cut_B} +n[-1] 0,255 +to_gray[-1] +if $Wavelet_Sharpen_Selection==1||$Wavelet_Sharpen_Selection==2 +samj_Wavelet_Sharpen_Test_en[-1] $Wavelet_Sharpen_Type_B,$Wavelet_Sharpen_Iterations_B +fi +simplelocalcontrast_p[-2] $SC_Edge_Sensitivity,$SC_Iterations,$SC_Paint_effect,$SC_Channels,$SC_Pre_gamma,$SC_Post_gamma,$SC_Blacks,$SC_Dark_grey,$SC_Mid_grey,$SC_Light_grey,$SC_Whites,$SC_Parallel_Processing +if $Wavelet_Sharpen_Selection==0||$Wavelet_Sharpen_Selection==2 +samj_Wavelet_Sharpen_Test_en[-2] $Wavelet_Sharpen_Type_A,$Wavelet_Sharpen_Iterations_A +fi +samj_blend_20220419[-1,-2] grainextract +samj_TSP_Segments_GUI : +foreach { +if $5>0 srand $5 fi +if $13 ++samj_TSP_Segments. $1,$2,$3,$4 +mirror.. x +samj_TSP_Segments.. $1,$2,$3,$4 +mirror.. x +blend alpha +else +samj_TSP_Segments. $1,$2,$3,$4 +fi +if $6>0 dilate_circ. {$6+1} fi +if $11 dilate. {$6+1} deform $11 fi +if $12>1 pow. $12 fi +{w},{h},1,4 fill_color. $7,$8,$9,$10 rv blend alpha +} +samj_TSP_Segments : +skip ${1=3},${2=50},${3=5},${4=1} +Flou=$1 +Masque=$2 +Variation=$3 +Echelle=$4 +to_rgba +Wor={w} +Hor={h} +{w},{h},1,4 ++samj_Masques_Noir_Et_Blanc.. $Flou,$Masque +blend[-1,-2] alpha +to_gray. +negate. +dilate. 10 +pointcloud. 3 +channels. 0,1 +resize. $Echelle%,1 +tsp. 200 +repeat w#-1 +Index=$> ++crop. $Index,0,{$Index+1},0 +X1p={i0} +Y1p={i1} +rm. +Pixel={I(#-3,$X1p,$Y1p)} +X2p={$X1p+round(u*$Variation/100*$Wor)+1} +Y2p={$Y1p+round(u*$Variation/100*$Hor)+1} +line.. $X1p,$Y1p,$X2p,$Y2p,1,$Pixel +done +rm[-1,-3] +samj_Test_Liste_Points_TSP_Splines : +skip ${1=0.5},${2=2.1},${3=1200},${4=0},${5=0},${6=0},${7=2},${8=1},${9=0} +Echelle=$1 +Deformation=$2 +Blanc=$8 +if w>h +resize. $3,{h/w*$3} +else +resize. {w/h*$3},$3 +fi +Wf={w} +Hf={h} +if $Blanc==1 +samj_Masques_Noir_Et_Blanc. 3,50 +blend alpha +to_gray. +negate. +if $9==1 dilate. 4 else dilate_circ. 15 fi +else +to_gray. +autoindex. 2 +variance_patch. 2 +dilate. 6 +fi +pointcloud. 3 +channels. 0,1 +resize. $Echelle%,1 +tsp. 200 +Iter={{w}-2} +$Wf,$Hf,1,3 +fill_color. 255,255,255 +rv +Index=0 +if $9==1 ++crop. {$Index},0,{$Index+1},0 +Xd={i0} +Yd={i1} +rm. ++crop. {$Index+1},0,{$Index+2},0 +Xu={i0} +Yu={i1} +rm. ++crop. {$Index+2},0,{$Index+3},0 +Xt={i0} +Yt={i1} +rm. +repeat $Iter ++crop. {$Index+3},0,{$Index+4},0 +Xq={i0} +Yq={i1} +rm. +Xds={$Xu+$Xu-{$Xd*$Deformation}} +Yds={$Yu+$Yu-{$Yd*$Deformation}} +Xqs={$Xt+$Xt-{$Xq*$Deformation}} +Yqs={$Yt+$Yt-{$Yq*$Deformation}} +spline.. $Xu,$Yu,$Xds,$Yds,$Xt,$Yt,$Xqs,$Yqs,1,$4,$5,$6 +Index+=1 +Xd=$Xu +Yd=$Yu +Xu=$Xt +Yu=$Yt +Xt=$Xq +Yt=$Yq +done +else +Segments=round({{$Wf+$Hf}/200}) +repeat {$Iter/3} ++crop. {$Index},0,{$Index+1},0 +Xu={i0} +Yu={i1} +rm. ++crop. {$Index+1},0,{$Index+2},0 +Xd={i0} +Yd={i1} +rm. ++crop. {$Index+2},0,{$Index+3},0 +Xt={i0} +Yt={i1} +rm. ++crop. {$Index+3},0,{$Index+4},0 +Xq={i0} +Yq={i1} +rm. +samj_Bezier_Quatre_Points.. $Xu,$Yu,$Xd,$Yd,$Xt,$Yt,$Xq,$Yq,$Segments,$4,$5,$6,255 +Index+=3 +done +fi +rm. +erode. $7 +samj_blend_20220419 : skip ${1=alpha},${2=1},${3=1},${4=0} +if ${"is_image_arg $1"} +n={narg($*)} mode=${arg\ 1+($n>=2),alpha,$2} +e[^-1] "Blend image$? with "${arg\ 1+$4,base,top}" layer $1, using '"$mode"' mode and opacity $3." +repeat $! { pass$1 l[$>,-1] { if $4 rv fi blend $mode,$3 } } return +fi +e[^-1] "Blend all image$? together, using '$1' mode and opacity $2." +repeat $!-1 { l[0,1] { +r[1] [0],[0],[0],100%,0,0,0.5,0.5 +s={"s0 = s#0<3?1:3; s1 = s<3?1:3; max(s0,s1)"} # Target color format (G or RGB). +to_colormode[0] {$s+1-(s#0%2)} # Target format (G,GA,RGB or RGBA). +to_colormode[1] {$s+1-(s%2)} +if {0,"s==2 || s==4"} +if "s==2 || s==4" +sh[0,1] 0,{s-2} _blend_$1[2,3] rm[2,3] +if ['"$1"']=='alpha' +sh[0,1] 0,{{0,s}-2} sh[0,1] 100% *[2,4] *[3,4] rm[2,3] ++channels[1] 100% sh[1] 100% f[3] 255 rm[3] +j[0] [1],0,0,0,0,{max(0,min(1,$2))},[2],255 rm[1,2] +sh[0] 0,{s-2} sh[0] 100% +[2] 1e-10 /[1,2] rm[1] c 0,255 +else +sh[1] 0,{s-2} sh[1] 100% j[0] [2],0,0,0,0,{max(0,min(1,$2))},[3],255 rm[^0] +fi +else +sh[0] 0,{{0,s}-2} rv[1,2] _blend_$1[1,2] j[1] [2],0,0,0,0,{max(0,min(1,$2))} rm[^0] +fi +else +if "s==2 || s==4" +sh[1] 0,{s-2} _blend_$1[0,2] rm[2] +sh[1] 100% j[0] [1],0,0,0,0,{max(0,min(1,$2))},[2],255 rm[^0] +else +_blend_$1 j[0] [1],0,0,0,0,{max(0,min(1,$2))} rm[1] +fi +fi +} } +_blend_alpha : +_blend_normal : +_blend_and : +&[1] [0] +_blend_add : ++[1] [0] c[1] 0,255 +_blend_average : ++[1] [0] /[1] 2 +_blend_blue : +sh[0] 0,1 j[1] [2] rm[2] +_blend_burn : ++-[0] 255 +[1] 0.1 /[2] [1] rm[1] +[1] 1 *[1] 255 c[1] 0,255 +_blend_darken : +min[1] [0] +_blend_difference : +-[1] [0] abs[1] +_blend_divide : ++[1] 0.1 ^[1] -1 *[1] [0] *[1] 255 c[1] 0,255 +_blend_dodge : +-[1] 255.1 ^[1] -1 *[1] [0] *[1] -255 c[1] 0,255 +_blend_edges : ++blend_edges 0.5 rm[1] +_blend_exclusion : ++*[0,1] /[2] -127.5 +[1,2] +[1] [0] +_blend_freeze : +*[1] -255 -[1] 0.1 +-[0] 255 sqr[2] /[2] [1] rm[1] +[1] 1 *[1] 255 c[1] 0,255 +_blend_grainextract : +-[1] [0] *[1] -1 +[1] 128 c[1] 0,255 +_blend_grainmerge : ++[1] [0] -[1] 128 c[1] 0,255 +_blend_green : +sh[0] 0 sh[0] 2 j[1] [2] j[1] [3],0,0,0,2 rm[2,3] +_blend_hardlight : ++*[0,1] /[2] 127.5 ++[0,1] *[3] 2 -[3] 255 -[3] [2] >[1] 128 +j[2] [3],0,0,0,0,1,[1] rm[1,3] c[1] 0,255 +_blend_hardmix : ++[1] [0] >=[1] 255 *[1] 255 +_blend_hue : +to_color sh 0,2 rgb2hsv[2,3] sh[2] 1,2 j[1] [4],0,0,0,1 rm[4] hsv2rgb[2,3] rm[2,3] +_blend_interpolation : ++*[0] {pi/255} *[1] {pi/255} cos[1,2] +[1,2] -[1] 2 *[1] -63.75 c[1] 0,255 +_blend_lighten : +max[1] [0] +_blend_lightness : +to_color sh 0,2 rgb2lab[2,3] sh[2] 1,2 j[1] [4],0,0,0,1 rm[4] lab2rgb[2,3] rm[2,3] +_blend_lchlightness : +_blend_lightness +_blend_luminance : +to_color sh 0,2 rgb2ycbcr[2,3] sh[2] 1,2 j[1] [4],0,0,0,1 rm[4] ycbcr2rgb[2,3] rm[2,3] +_blend_linearburn : ++[1] [0] -[1] 255 c. 0,255 +_blend_linearlight : +*[1] 2 +[1] [0] -[1] 255 c[1] 0,255 +_blend_multiply : +*[1] [0] /[1] 255 +_blend_negation : ++[1] [0] -[1] 255 abs[1] *[1] -1 +[1] 255 +_blend_or : +-|[1] [0] +_blend_overlay : ++*[0,1] /[2] 127.5 +[1] [0] *[1] 2 -[1] 255 -[1] [2] +<[0] 128 j[1] [2],0,0,0,0,1,[3] rm[2,3] c[1] 0,255 +_blend_pinlight : +*[1] 2 +blend darken -[1] 256 +blend[0,1] lighten >=[1] 0 +j[2] [3],0,0,0,0,1,[1] rm[1,3] +_blend_reflect : +-[1] 255.1 *[1] -1 +sqr[0] /[2] [1] rm[1] c[1] 0,255 +_blend_red : +sh[0] 1,100% j[1] [2],0,0,0,1 rm[2] +_blend_saturation : +to_color sh 0,2 rgb2hsv[2,3] shift[2,3] 0,0,0,-1,2 sh[2] 1,2 j[1] [4],0,0,0,1 rm[4] shift[2,3] 0,0,0,1,2 +hsv2rgb[2,3] rm[2,3] +_blend_screen : ++-[0] 255 -[1] 255 *[1,2] /[1] 255 *[1] -1 +[1] 255 +_blend_shapeareamax : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[1] round[1] 0.01 label[1] 0 ++f[0] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[2] round[2] 0.01 area[2] 0,0 +{1,iM+1},1,1,{0,s+1} +f[1] ">area = i(#2); best = I[#3,i]; if (area>best[size(best) - 1], I[#3,i] = [ I(#0),area ]);i" +rm[2] channels[2] 0,{s-2} map[1] [2] rm[2] +_blend_shapeareamax0 : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I!=0?I+A:I" norm[1] round[1] 0.01 label_fg[1] 0 ++f[0] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[2] round[2] 0.01 area[2] 0,0 +{1,iM+1},1,1,{0,s+1} +f[1] ">area = i(#2); best = I[#3,i]; if (area>best[size(best) - 1], I[#3,i] = [ I(#0),area ]);i" +rm[2] channels[2] 0,{s-2} point[2] 0,0,0,1,0 map[1] [2] rm[2] +_blend_shapeareamin : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[1] round[1] 0.01 label[1] 0 ++f[0] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[2] round[2] 0.01 area[2] 0,0 +{1,iM+1},1,1,{0,s+1},inf +f[1] ">area = i(#2); best = I[#3,i]; if (areaarea = i(#2); best = I[#3,i]; if (areai(#2,i(#1,x,y,z,0),0,0,c)+=i;i" ++histogram[1] {w},0,{w-1} /[-2,-1] map[1] . rm. +_blend_shapeaverage0 : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I!=0?I+A:I" norm[1] round[1] 0.01 label_fg[1] 0 {iM+1},1,1,{0,s} +f[0] ">i(#2,i(#1,x,y,z,0),0,0,c)+=i;i" ++histogram[1] {w},0,{w-1} /[-2,-1] point. 0,0,0,1,0 map[1] . rm. +_blend_shapemedian : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[1] round[1] 0.01 label[1] 0 +N={iM+1} $N,1,1,{s#0} $N,8,1,{s#0} s. x +f[1] "> +begin(siz = vector"$N"()); +k = i; +k3 = k + 3; +hk3 = h(#k3); +copy(i[#k3,siz[k]++],I(#0),s#0,hk3,whd#0); +if (siz[k]>=hk3,resize(#k3,1,round(1.5*hk3+1),1,s#0,0,0)); +end(repeat (size(siz),k, resize(#k+3,1,siz[k],1,s#0,0,0))); +i" +repeat s#0 { sh[3--1] $> $N,1,1,1,"ic(#"$N"+3+x)" j[2] .,0,0,0,$> rm[-{$N+1}--1] } +map[1] [2] k[0,1] +_blend_shapemedian0 : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I!=0?I+A:I" norm[1] round[1] 0.01 label_fg[1] 0 +N={iM} {$N+1},1,1,{s#0} $N,8,1,{s#0} s. x +f[1] "> +begin(siz = vector"$N"()); +k = i; +if (k, +k1 = k - 1; +k2 = k + 2; +hk2 = h(#k2); +copy(i[#k2,siz[k1]++],I(#0),s#0,hk2,whd#0); +if (siz[k1]>=hk2,resize(#k2,1,round(1.5*hk2+1),1,s#0,0,0)); +); +end(repeat (size(siz),k, resize(#k+3,1,siz[k],1,s#0,0,0))); +i" +repeat s#0 { sh[3--1] $> $N,1,1,1,"ic(#"$N"+3+x)" j[2] .,1,0,0,$> rm[-{$N+1}--1] } +map[1] [2] k[0,1] +_blend_shapemin : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[1] round[1] 0.01 label[1] 0 {iM+1},1,1,{0,s},inf +f[0] ">i(#2,i(#1,x,y,z,0),0,0,c) = min(i(#2,i(#1,x,y,z,0),0,0,c),i);i" +map[1] [2] rm. +_blend_shapemin0 : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I!=0?I+A:I" norm[1] round[1] 0.01 label_fg[1] 0 {iM+1},1,1,{0,s},inf +f[0] ">i(#2,i(#1,x,y,z,0),0,0,c) = min(i(#2,i(#1,x,y,z,0),0,0,c),i);i" +point. 0,0,0,1,0 map[1] [2] rm. +_blend_shapemax : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[1] round[1] 0.01 label[1] 0 {iM+1},1,1,{0,s},-inf +f[0] ">i(#2,i(#1,x,y,z,0),0,0,c) = max(i(#2,i(#1,x,y,z,0),0,0,c),i);i" +map[1] [2] rm. +_blend_shapemax0 : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I!=0?I+A:I" norm[1] round[1] 0.01 label_fg[1] 0 {iM+1},1,1,{0,s},-inf +f[0] ">i(#2,i(#1,x,y,z,0),0,0,c) = max(i(#2,i(#1,x,y,z,0),0,0,c),i);i" +point. 0,0,0,1,0 map[1] [2] rm. +_blend_softburn : ++-[0] 255.1 ^[2] -1 *[2] [1] *[2] -127.5 +-[0] 255 ++[1] 0.1 /[3,4] *[3] 127.5 +[3] 255 +[1] [0] >[1] 255 +j[2] [3],0,0,0,0,1,[1] rm[1,3] c[1] 0,255 +_blend_softdodge : ++-[1] 255.1 ^[2] -1 *[2] [0] *[2] -127.5 +-[1] 255 ++[0] 0.1 /[3,4] *[3] 127.5 +[3] 255 +[1] [0] >[1] 255 +j[2] [3],0,0,0,0,1,[1] rm[1,3] c[1] 0,255 +_blend_softlight : ++/[0] 255 /[1] 255 +sqr. *[2] [1] *[1] [3] *[1] -2 *[2] 2 +[1-3] *[1] 255 c[1] 0,255 +_blend_stamp : +*[1] 2 +[1] [0] -[1] 255 c[1] 0,255 +_blend_subtract : +-[1] [0] *[1] -1 c[1] 0,255 +_blend_value : +to_color sh 0,2 rgb2hsv[2,3] sh[2] 0,1 j[1] [4] rm[4] hsv2rgb[2,3] rm[2,3] +_blend_vividlight : +*[1] 2 +blend burn -[1] 256 +blend[0,1] dodge >=[1] 0 +j[2] [3],0,0,0,0,1,[1] rm[1,3] +_blend_xor : +xor[1] [0] +samj_SVG_Symetries_A: +Dim=1024 +Ray=500 +Ra={$Ray*$2} +Rb={$Ray*$4} +Rc={$Ray*$6} +Rd={$Ray*$8} +Angle={360/$1} +CRLF="\r\n" +Liste=""$CRLF +Liste.=""$CRLF +Liste.="Test GMIC SVG"$CRLF +Liste.="SVG Symetries A"$CRLF +if $12==1 +Couleur=${arg\ 1+$15,Black,Blue,Brown,Chartreuse,Chocolate,Coral,Cyan,DarkRed,DeepPink,FireBrick,ForestGreen,Fuchsia,Gold,Green,HotPink,Indigo,Lime,Magenta,Maroon,Olive,Orange,Orchid,Pink,Purple,Red,Salmon,SeaGreen,Sienna,Violet,Wheat,White,Yellow} +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Couleur=${arg\ 1+$10,Black,Blue,Brown,Chartreuse,Chocolate,Coral,Cyan,DarkRed,DeepPink,FireBrick,ForestGreen,Fuchsia,Gold,Green,HotPink,Indigo,Lime,Magenta,Maroon,Olive,Orange,Orchid,Pink,Purple,Red,Salmon,SeaGreen,Sienna,Violet,Wheat,White,Yellow} +Liste.=""$CRLF +else +Couleur=${arg\ 1+$10,Black,Blue,Brown,Chartreuse,Chocolate,Coral,Cyan,DarkRed,DeepPink,FireBrick,ForestGreen,Fuchsia,Gold,Green,HotPink,Indigo,Lime,Magenta,Maroon,Olive,Orange,Orchid,Pink,Purple,Red,Salmon,SeaGreen,Sienna,Violet,Wheat,White,Yellow} +Liste.=""$CRLF +fi +Index=0 +repeat $1 +AnI={{$Angle*$Index}+{$Angle*$3}} +XoA={{$Dim/2}+{$Ra*cos(pi/180*$AnI)}} +YoA={{$Dim/2}+{$Ra*sin(pi/180*$AnI)}} +AnI={{$Angle*$Index}+{$Angle*$5}} +XoB={{$Dim/2}+{$Rb*cos(pi/180*$AnI)}} +YoB={{$Dim/2}+{$Rb*sin(pi/180*$AnI)}} +AnI={{$Angle*$Index}+{$Angle*$7}} +XoC={{$Dim/2}+{$Rc*cos(pi/180*$AnI)}} +YoC={{$Dim/2}+{$Rc*sin(pi/180*$AnI)}} +AnI={{$Angle*$Index}+{$Angle*$9}} +XoD={{$Dim/2}+{$Rd*cos(pi/180*$AnI)}} +YoD={{$Dim/2}+{$Rd*sin(pi/180*$AnI)}} +Liste.=""$CRLF +AnI={{$Angle*$Index}-{$Angle*$5}} +XoB={{$Dim/2}+{$Rb*cos(pi/180*$AnI)}} +YoB={{$Dim/2}+{$Rb*sin(pi/180*$AnI)}} +AnI={{$Angle*$Index}-{$Angle*$7}} +XoC={{$Dim/2}+{$Rc*cos(pi/180*$AnI)}} +YoC={{$Dim/2}+{$Rc*sin(pi/180*$AnI)}} +Liste.=""$CRLF +Index+=1 +done +Liste.=""$CRLF +Liste.=""$CRLF +('$Liste') +output_text. $_path_rc/Liste_Points_SVG_Symetries_A.svg +rm +1500,100,1,3 +fill_color. 255,255,255 +text. "SVG disponible sur :",20,20,20,1,255,0,0 +if '$_os'=='windows' +text. $_path_rc"\Liste_Points_SVG_Symetries_A.svg",20,50,20,1,255,0,0 +else +text. $_path_rc"/Liste_Points_SVG_Symetries_A.svg",20,50,20,1,255,0,0 +fi +autocrop +samj_SVG_Symetries_A_preview : +rm +Dim=800 +Ray=360 +Ra={$Ray*$2} +Rb={$Ray*$4} +Rc={$Ray*$6} +Rd={$Ray*$8} +Angle={360/$1} +$Dim,$Dim,1,3 +fill_color 255,255,255 +Index=0 +repeat $1 +srand {$Index+123456} +R_Couleur={round(u)*192} +V_Couleur={round(u)*192} +B_Couleur={round(u)*192} +AnI={{$Angle*$Index}+{$Angle*$3}} +XoA={{$Dim/2}+{$Ra*cos(pi/180*$AnI)}} +YoA={{$Dim/2}+{$Ra*sin(pi/180*$AnI)}} +AnI={{$Angle*$Index}+{$Angle*$5}} +XoB={{$Dim/2}+{$Rb*cos(pi/180*$AnI)}} +YoB={{$Dim/2}+{$Rb*sin(pi/180*$AnI)}} +AnI={{$Angle*$Index}+{$Angle*$7}} +XoC={{$Dim/2}+{$Rc*cos(pi/180*$AnI)}} +YoC={{$Dim/2}+{$Rc*sin(pi/180*$AnI)}} +AnI={{$Angle*$Index}+{$Angle*$9}} +XoD={{$Dim/2}+{$Rd*cos(pi/180*$AnI)}} +YoD={{$Dim/2}+{$Rd*sin(pi/180*$AnI)}} +samj_Bezier_Quatre_Points $XoA,$YoA,$XoB,$YoB,$XoC,$YoC,$XoD,$YoD,20,$R_Couleur,$V_Couleur,$B_Couleur,255 +AnI={{$Angle*$Index}-{$Angle*$5}} +XoB={{$Dim/2}+{$Rb*cos(pi/180*$AnI)}} +YoB={{$Dim/2}+{$Rb*sin(pi/180*$AnI)}} +AnI={{$Angle*$Index}-{$Angle*$7}} +XoC={{$Dim/2}+{$Rc*cos(pi/180*$AnI)}} +YoC={{$Dim/2}+{$Rc*sin(pi/180*$AnI)}} +samj_Bezier_Quatre_Points $XoA,$YoA,$XoB,$YoB,$XoC,$YoC,$XoD,$YoD,20,$R_Couleur,$V_Couleur,$B_Couleur,255 +Index+=1 +done +erode 2 +samj_Bezier_Quatre_Points : +Xp1=$1 +Yp1=$2 +Xp2=$3 +Yp2=$4 +Xp3=$5 +Yp3=$6 +Xp4=$7 +Yp4=$8 +Segments=$9 +Index=1 +Xori=$1 +Yori=$2 +repeat $Segments +Tou={$Index/$Segments} +XTou={{{{1-$Tou}^3}*$Xp1}+{{{1-$Tou}^2}*3*$Tou*$Xp2}+{3*{1-$Tou}*{$Tou^2}*$Xp3}+{{$Tou^3}*$Xp4}} +YTou={{{{1-$Tou}^3}*$Yp1}+{{{1-$Tou}^2}*3*$Tou*$Yp2}+{3*{1-$Tou}*{$Tou^2}*$Yp3}+{{$Tou^3}*$Yp4}} +line. $Xori,$Yori,$XTou,$YTou,1,$10,$11,$12,$13 +Xori=$XTou +Yori=$YTou +Index+=1 +done +samj_GUI_Test_Liste_Points_TSP : +if $13==1 +samj_Test_Liste_Points_TSP_Bezier $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12 +else +samj_Test_Liste_Points_TSP $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12 +fi +samj_GUI_Test_Liste_Points_TSP_Preview : +if w>h +resize 600,{h/w*600} +else +resize {w/h*600},600 +fi +if $8==1 ++- +samj_Masques_Noir_Et_Blanc_Preview[-1] $1,$2 +samj_Masques_Noir_Et_Blanc_Preview[-2] $3,$4 +to_gray[-1,-2] +rv +append x +else +samj_Masques_Noir_Et_Blanc_Preview $3,$4 +to_gray +fi +samj_Test_Liste_Points_TSP : +skip ${1=1.25},${2=42},${3=0},${4=32.5},${5=1},${6=0},${7=2},${8=1},${9=1},${10=4},${11=4},${12=1} +Param1Masque1=$1 +Param2Masque1=$2 +Param1Masque2=$3 +Param2Masque2=$4 +Echelle=$5 +CRLF="\r\n" +Liste=""$CRLF +Liste.=""$CRLF +Liste.="Test GMIC SVG"$CRLF +Liste.="Points et Segments"$CRLF +if $9==1 +Couleur=${arg\ 1+$12,Black,Blue,Brown,Chartreuse,Chocolate,Coral,Cyan,DarkRed,DeepPink,FireBrick,ForestGreen,Fuchsia,Gold,Green,HotPink,Indigo,Lime,Magenta,Maroon,Olive,Orange,Orchid,Pink,Purple,Red,Salmon,SeaGreen,Sienna,Violet,Wheat,White,Yellow} +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Couleur=${arg\ 1+$6,Black,Blue,Brown,Chartreuse,Chocolate,Coral,Cyan,DarkRed,DeepPink,FireBrick,ForestGreen,Fuchsia,Gold,Green,HotPink,Indigo,Lime,Magenta,Maroon,Olive,Orange,Orchid,Pink,Purple,Red,Salmon,SeaGreen,Sienna,Violet,Wheat,White,Yellow} +Liste.=""$CRLF +else +Couleur=${arg\ 1+$6,Black,Blue,Brown,Chartreuse,Chocolate,Coral,Cyan,DarkRed,DeepPink,FireBrick,ForestGreen,Fuchsia,Gold,Green,HotPink,Indigo,Lime,Magenta,Maroon,Olive,Orange,Orchid,Pink,Purple,Red,Salmon,SeaGreen,Sienna,Violet,Wheat,White,Yellow} +Liste.=""$CRLF +fi +Liste.="h +resize 1000,{h/w*1000} +else +resize {w/h*1000},1000 +fi ++samj_Masques_Noir_Et_Blanc_Preview $Param1Masque1,$Param2Masque1 +to_gray. +negate. +dilate. 10 +pointcloud. 3 +channels. 0,1 +resize. $Echelle%,1 +add. 12 +tsp. 200 ++crop. 0,0,1,0 +Xend={i0} +Yend={i1} +rm. +repeat w +Index=$> ++crop. $Index,0,{$Index+1},0 +Xa={i0} +Ya={i1} +rm. +Liste.=$Xa" " +Liste.=$Ya" " +done +rm. +if $8==1 +samj_Masques_Noir_Et_Blanc_Preview $Param1Masque2,$Param2Masque2 +to_gray. +negate. +dilate. 10 +pointcloud. 3 +channels. 0,1 +resize. $Echelle%,1 +add. 12 +tsp. 200 +repeat w +Index=$> ++crop. $Index,0,{$Index+1},0 +Xa={i0} +Ya={i1} +rm. +Liste.=$Xa" " +Liste.=$Ya" " +done +fi +Liste.=$Xend" " +Liste.=$Yend" " +Liste.="\"/>"$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +('$Liste') +output_text. $_path_rc/Liste_Points_TSP.svg +rm +1500,100,1,3 +fill_color. 255,255,255 +text. "SVG disponible sur :",20,20,20,1,255,0,0 +if '$_os'=='windows' +text. $_path_rc"\Liste_Points_TSP.svg",20,50,20,1,255,0,0 +else +text. $_path_rc"/Liste_Points_TSP.svg",20,50,20,1,255,0,0 +fi +autocrop +samj_Test_Liste_Points_TSP_Bezier : +skip ${1=1.25},${2=42},${3=0},${4=32.5},${5=1},${6=0},${7=2},${8=1},${9=1},${10=4},${11=4},${12=1} +Param1Masque1=$1 +Param2Masque1=$2 +Param1Masque2=$3 +Param2Masque2=$4 +Echelle=$5 +CRLF="\r\n" +Liste=""$CRLF +Liste.=""$CRLF +Liste.="Test GMIC SVG"$CRLF +Liste.="Points et Courbes de Bezier"$CRLF +if $9==1 +Couleur=${arg\ 1+$12,Black,Blue,Brown,Chartreuse,Chocolate,Coral,Cyan,DarkRed,DeepPink,FireBrick,ForestGreen,Fuchsia,Gold,Green,HotPink,Indigo,Lime,Magenta,Maroon,Olive,Orange,Orchid,Pink,Purple,Red,Salmon,SeaGreen,Sienna,Violet,Wheat,White,Yellow} +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Couleur=${arg\ 1+$6,Black,Blue,Brown,Chartreuse,Chocolate,Coral,Cyan,DarkRed,DeepPink,FireBrick,ForestGreen,Fuchsia,Gold,Green,HotPink,Indigo,Lime,Magenta,Maroon,Olive,Orange,Orchid,Pink,Purple,Red,Salmon,SeaGreen,Sienna,Violet,Wheat,White,Yellow} +Liste.=""$CRLF +else +Couleur=${arg\ 1+$6,Black,Blue,Brown,Chartreuse,Chocolate,Coral,Cyan,DarkRed,DeepPink,FireBrick,ForestGreen,Fuchsia,Gold,Green,HotPink,Indigo,Lime,Magenta,Maroon,Olive,Orange,Orchid,Pink,Purple,Red,Salmon,SeaGreen,Sienna,Violet,Wheat,White,Yellow} +Liste.=""$CRLF +fi +if w>h +resize 1000,{h/w*1000} +else +resize {w/h*1000},1000 +fi ++samj_Masques_Noir_Et_Blanc_Preview $Param1Masque1,$Param2Masque1 +to_gray. +negate. +dilate. 10 +pointcloud. 3 +channels. 0,1 +WWe={round(w/100*$Echelle)} +if {$WWe%2}==0 resize. $WWe,1 else resize. {$WWe-1},1 fi +add. 12 +tsp. 200 ++crop. 0,0,1,0 +Xo={i0} +Yo={i1} +rm[-1] ++crop. 1,0,2,0 +Xs={i0} +Ys={i1} +rm[-1] ++crop. 2,0,3,0 +Xt={i0} +Yt={i1} +rm[-1] ++crop. 3,0,4,0 +Xq={i0} +Yq={i1} +rm[-1] +Liste.=""$CRLF +Index=2 +repeat {{w/2}-1} +Xu=$Xq +Yu=$Yq +Xd=$Xt +Yd=$Yt ++crop {$Index},0,{$Index+1},0 +Xt={i0} +Yt={i1} +rm[-1] +rm[-1] ++crop {$Index+1},0,{$Index+2},0 +Xq={i0} +Yq={i1} +rm[-1] +rm[-1] +Xs={$Xu+$Xu-$Xd} +if $Xs<0 Xs=0 fi +if $Xs>1023 Xs=1023 fi +Ys={$Yu+$Yu-$Yd} +if $Ys<0 Ys=0 fi +if $Ys>1023 Ys=1023 fi +Liste.=""$CRLF +Index={$Index+2} +done +rm. +if $8==1 +samj_Masques_Noir_Et_Blanc_Preview $Param1Masque2,$Param2Masque2 +to_gray. +negate. +dilate. 10 +pointcloud. 3 +channels. 0,1 +WWe={round(w/100*$Echelle)} +if {$WWe%2}==0 resize. $WWe,1 else resize. {$WWe-1},1 fi +add. 12 +tsp. 200 ++crop. 1,0,2,0 +Xs={i0} +Ys={i1} +rm[-1] ++crop. 2,0,3,0 +Xt={i0} +Yt={i1} +rm[-1] ++crop. 3,0,4,0 +Xq={i0} +Yq={i1} +rm[-1] +Liste.=""$CRLF +Index=2 +repeat {{w/2}-1} +Xu=$Xq +Yu=$Yq +Xd=$Xt +Yd=$Yt ++crop {$Index},0,{$Index+1},0 +Xt={i0} +Yt={i1} +rm[-1] ++crop {$Index+1},0,{$Index+2},0 +Xq={i0} +Yq={i1} +rm[-1] +Xs={$Xu+$Xu-$Xd} +if $Xs<0 Xs=0 fi +if $Xs>1023 Xs=1023 fi +Ys={$Yu+$Yu-$Yd} +if $Ys<0 Ys=0 fi +if $Ys>1023 Ys=1023 fi +Liste.=""$CRLF +Index={$Index+2} +done +fi +Liste.=""$CRLF +Liste.=""$CRLF +('$Liste') +output_text. $_path_rc/Liste_Points_TSP_Bezier.svg +rm +1500,100,1,3 +fill_color. 255,255,255 +text. "SVG disponible sur :",20,20,20,1,255,0,0 +if '$_os'=='windows' +text. $_path_rc"\Liste_Points_TSP_Bezier.svg",20,50,20,1,255,0,0 +else +text. $_path_rc"/Liste_Points_TSP_Bezier.svg",20,50,20,1,255,0,0 +fi +autocrop +#@cli samj_resize_screen : expand={ 0 | 1 } +#@cli : Mettre l'image selon les dimensions de l'écran. / Put the image to the dimensions of the screen. +#@cli : $ image.jpg samj_resize_screen +samj_resize_screen : +skip ${1=1} +Screen_W={*,u} +Screen_H={*,v} +Image_W={w} +Image_H={h} +Scr_Rap={$Screen_W/$Screen_H} +Img_Rap={$Image_W/$Image_H} +if {$Scr_Rap}>{$Img_Rap} +resize {$Image_W/$Image_H*$Screen_H},$Screen_H +if $1==1 to_a expand_x {{$Screen_W-w}/2},0 fi +else +resize $Screen_W,{$Image_H/$Image_W*$Screen_W} +if $1==1 to_a expand_y {{$Screen_H-h}/2},0 fi +fi +#@cli samj_full_screen_display : _monitor={ 0 | 1 },_width>0,_height>0,_time_ms>=0 +#@cli : Affiche une image en plein écran, soit selon les caractéristiques de l'écran ou selon les dimensions de $2 et $3. Possibilité d'activer une temporisation en ms ($4). +#@cli : L'appui sur une des touches du clavier 'Q', 'Échappement', 'Barre d'espacement' et 'Entrée' permet d'arrêter l'affichage. +#@cli : Displays a full screen image, depending on the characteristics of the screen or dimensions ($2,$3). Ability to activate a ms delay ($4). +#@cli : The keyboard keys 'Q', 'Escape', 'Space bar' and 'Enter' allows you to stop the display. +#@cli : Valeurs par défaut / Default values: 'monitor=1', 'width=800', 'height=600', 'time_ms=5000'. +#@cli : $ image.jpg +samj_full_screen_display 0,400,300,4000 blur 20 +samj_full_screen_display +samj_full_screen_display : +skip ${1=1},${2=800},${3=600},${4=5000} +if $1==1 +Screen_W={*,u} +Screen_H={*,v} +else +if ["'$2'"]=='' Screen_W=800 else Screen_W=$2 fi +if ["'$3'"]=='' Screen_H=600 else Screen_H=$3 fi +fi +Image_W={w} +Image_H={h} +Scr_Rap={$Screen_W/$Screen_H} +Img_Rap={$Image_W/$Image_H} +if {$Scr_Rap}>{$Img_Rap} +resize {$Image_W/$Image_H*$Screen_H},$Screen_H +expand_x {{$Screen_W-w}/2},0 +else +resize $Screen_W,{$Image_H/$Image_W*$Screen_W} +expand_y {{$Screen_H-h}/2},0 +fi +if $1==1 window $Screen_W,$Screen_H,0,1 else window $Screen_W,$Screen_H,0,0,5%,5%,$Screen_W*$Screen_H fi +if $4>0 +Pre=50 +Bc={$4/$Pre} +repeat $Bc +if {{*,ESC}||{*,Q}||{*,SPACE}||{*,ENTER}} break fi +wait $Pre +done +fi +rm +#@cli samj_test_paint_gmic_gimp : _Iterations>0,_Seed>0,0.01<=_DiffusionTensors<=0.1,0<=_Blur<=10,_ImageSequence={0=No | 1=Yes},_Brush={0=Ellipse | 1=Circle},0.1<=_BrushSize>0<=4 +#@cli : Paint an Image by Randomly Exploring a Space of Brush Strokes by David Tschumperlé. +#@cli : Default values: 'Iterations=200', 'Seed=0', 'DiffusionTensors=0.01', 'Blur=10', 'ImageSequence=0', 'Brush=0' and 'BrushSize=1'. +#@cli : $ image.jpg samj_test_paint_gmic_gimp 300 +samj_test_paint_gmic_gimp : check $1>=1 skip "${1=200},${2=0},${3=0.01},${4=10},${5=0},${6=0},${7=1}" ++diffusiontensors $3,0.95,0.5,1 ++gradient_norm.. ++b[0] $4% +f=0 +if $2>0 Iterations={$1*2} else Iterations=$1 fi +repeat $Iterations t=$> +beta={1-exp(-$t/100)} +100%,100%,1,4 +if $2>0 srand {$2+$f} fi +{u(16,512)},1,1,1,"* +const da = 15; +const dl = 1; +const echelle = $7; +const beta = $beta; +const bs = lerp(60,1,beta); +const anisotropy = lerp(0.5,1,beta); +const opac = lerp(0.5,1,beta); +const alea = $2+$f; +if($2>0, srand(alea) ); +X0 = round(u([w#0,h#0]-1)); +RGBA = [ lerp(I(#0,X0),u([255,255,255]),0),255 ]; +lmax = lerp(1,10,beta^2); +for (a = 0, a<360, a+=da, +X = X0; +U = [cos(0.017453292*$a), sin(0.017453292*$a)]; +for (l = 0, l{2*pi} +crop 0,0,{{h*2*pi}-1},{h-1} +fi +resize[-1] $2,{h/w*$2} +Larg={w} +Haut={h} +RayonInt=$Haut +RayonExt={$RayonInt+$Haut} +AngDep=0 +CirconfInt={2*pi*$RayonInt} +AngArrivee={$Larg/$RayonInt} +elif $1==2 +to_rgba +samj_inclinaison_h 1,{h} +elif $1==3 +to_rgba +samj_inclinaison_h 2,{h} +fi +if $1==1||$1==2||$1==3 +resize[-1] $2,{h/w*$2} +EloigC=$3 +Larg={w} +Haut={h} +if $EloigC>{round({{$Larg/2}/{2*pi}})} +RayonInt={round({{$Larg/2}/{2*pi}})+$EloigC} +else +RayonInt={round({{$Larg/2}/{2*pi}})} +fi +DiamInt={$RayonInt*2} +AngDep=0 +CirconfInt={2*pi*$RayonInt} +AngArrivee={$AngDep+(2*pi)} +RayonExt={$RayonInt+$Haut} +fi +AngDepDeg={pi/180*$4} +CirconfExt={2*pi*$RayonExt} +DimLigneDebut={$RayonInt*$AngArrivee} +DimLigneFin={$RayonExt*$AngArrivee} +Inc={{$DimLigneFin-$DimLigneDebut}/$Haut} +to_rgba +split[-1] y,$Haut +LaTrai=0 +repeat $Haut +LaTrai-=1 +AbsLaTrai={abs($LaTrai)} +resize[$LaTrai] {$CirconfInt+{{abs($LaTrai)-1}*$Inc}},{h} +LargSplit$AbsLaTrai={$CirconfInt+((abs($LaTrai)-1)*$Inc)} +done +append y +DimNewImg={{$RayonExt+3}*2} +$DimNewImg,$DimNewImg,1,4 +fill_color[-1] 0,0,0,0 +Xc={$DimNewImg/2} +Yc={$DimNewImg/2} +LaTrai=0 +IncY=0 +repeat $Haut +LaTrai-=1 +AbsLaTrai={abs($LaTrai)} +LargLigne=${LargSplit$AbsLaTrai} +IncX=0 +IncA={$AngArrivee/$LargLigne} +repeat $LargLigne +Rn={$RayonInt+$IncY} +An={$AngDepDeg+($IncX*$IncA)} +Xp={$Xc+($Rn*cos($An))} +Yp={$Yc+($Rn*sin($An))} +Xf={$Xc+($RayonExt*cos($An))} +Yf={$Yc+($RayonExt*sin($An))} +PosX=$IncX +PosY={{$Haut-1}-$IncY} ++crop[-2] $PosX,$PosY,$PosX,$PosY,0 +line[-2] $Xp,$Yp,$Xf,$Yf,1,{I(#-1)} +rm[-1] +IncX+=1 +done +IncY+=1 +done +$DimNewImg,$DimNewImg,1,4 +fill_color[-1] 0,0,0,0 +circle[-1] $Xc,$Yc,$RayonInt,1,0xFFFFFFFF,255,0,0,255 +circle[-1] $Xc,$Yc,$RayonExt,1,0xFFFFFFFF,0,255,0,255 +Xa={$Xc+($RayonInt*cos($AngDepDeg))} +Ya={$Yc+($RayonInt*sin($AngDepDeg))} +Xb={$Xc+($RayonInt*cos($An))} +Yb={$Yc+($RayonInt*sin($An))} +polygon[-1] 3,$Xc,$Yc,$Xa,$Ya,$Xb,$Yb,1,255,255,0,255 +text[-1] $1-$2-$3-$4-$AngDepDeg,20,20,30,1,255,0,0,255 +text[-1] {$An/pi*180}-$An,20,40,30,1,255,0,0,255 +text[-1] $Haut-$RayonInt-$RayonExt,20,60,30,1,255,0,0,255 +rv[-1,-2,-3] +samj_montage_row : +skip ${7=2} +Type_Proportions_Finales=$1 +LargeurRow=$2 +Contour=$3 +Padding=$4 +Rotation=$5 +Pivoter_En_Colonne=$6 +NbImg=$! +DimensionMini=$7 +if {{$NbImg*{{2*{$3+$4}}+$DimensionMini}}>$2} +echo "ERREUR-ERROR - Diminuer $3,$4 et/ou augmenter $2 / Decrease $3,$4 et/ou increase $2" +rm +else +Index=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +$Wtemp,$Htemp,1,4 +fill_color[-1] 255,255,255,255 +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +done +to_rgb +if $Rotation==1 permute yxzc mirror x fi +NbImg=$! +if $Type_Proportions_Finales==0 +Index=0 +Hmax=0 +Wmax=0 +Htot=0 +Wtot=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +Htot+=$Htemp +if $Htemp>$Hmax +Hmax=$Htemp +fi +Wtemp={w(#$Index)} +Wtot+=$Wtemp +if $Wtemp>$Wmax +Wmax=$Wtemp +fi +done +ContourTot={$NbImg*$Contour*2} +PaddingTot={$NbImg*$Padding*2} +LargeurImages={$LargeurRow-$ContourTot-$PaddingTot} +Echelle={$LargeurImages/$Wtot} +Index=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +resize[$Index] {$Wtemp*$Echelle},{$Htemp*$Echelle} +if $Contour>0 frame_xy[$Index] $Contour,$Contour,0 fi +if $Padding>0 frame_xy[$Index] $Padding,$Padding,255 fi +done +else +Index=0 +Hmax=0 +Wmax=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +if $Htemp>$Hmax +Hmax=$Htemp +fi +Wtemp={w(#$Index)} +if $Wtemp>$Wmax +Wmax=$Wtemp +fi +done +Index=0 +Htot=0 +Wtot=0 +repeat $NbImg +Index-=1 +AbsInd={abs($Index)} +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +NewW$AbsInd={$Wtemp/$Htemp*$Hmax} +NewH$AbsInd=$Hmax +done +Index=0 +Hmax=0 +Wmax=0 +Htot=0 +Wtot=0 +repeat $NbImg +Index-=1 +AbsInd={abs($Index)} +Htemp=${NewH$AbsInd} +Htot+=$Htemp +if $Htemp>$Hmax +Hmax=$Htemp +fi +Wtemp=${NewW$AbsInd} +Wtot+=$Wtemp +if $Wtemp>$Wmax +Wmax=$Wtemp +fi +done +ContourTot={$NbImg*$Contour*2} +PaddingTot={$NbImg*$Padding*2} +LargeurImages={$LargeurRow-$ContourTot-$PaddingTot} +Echelle={$LargeurImages/$Wtot} +Index=0 +repeat $NbImg +Index-=1 +AbsInd={abs($Index)} +Htemp=${NewH$AbsInd} +Wtemp=${NewW$AbsInd} +resize[$Index] {$Wtemp*$Echelle},{$Htemp*$Echelle} +if $Contour>0 frame_xy[$Index] $Contour,$Contour,0 fi +if $Padding>0 frame_xy[$Index] $Padding,$Padding,255 fi +done +fi +Index=0 +Hmaxmontage=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +if $Htemp>$Hmaxmontage +Hmaxmontage=$Htemp +fi +Wtemp={w(#$Index)} +done +Index=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +expand_y[$Index] {{$Hmaxmontage-$Htemp}/2},0 +rectangle[$Index] 0,0,$Wtemp,{{$Hmaxmontage-$Htemp}/2},1,255,255,255 +mirror[$Index] y +rectangle[$Index] 0,0,$Wtemp,{{$Hmaxmontage-$Htemp}/2},1,255,255,255 +mirror[$Index] y +done +append x +Erreur={w-$LargeurRow} +if $Erreur>0 +crop 0,0,{$LargeurRow-1},{h-1} +elif $Erreur<0 +expand_x {-$Erreur-1},0 +rectangle 0,0,{-$Erreur-1},{h},1,255,255,255 +mirror x +rectangle 0,0,{-$Erreur-1},{h},1,255,255,255 +mirror x +crop 0,0,{$LargeurRow-1},{h-1} +fi +to_rgb +if $Pivoter_En_Colonne==1 mirror x permute yx fi +fi +samj_paulmatth_montage_row: +frame $1,$2,$3 +if $9>0 rotate $9,2 fi +frame $4,$5,$6 +montage H +to_rgb +if $7==1 resize $8,{h/w*$8},1,3 fi +samj_RGB_to_LCH_or_Lab: +Type_de_demande=$1 +Ra=$2 +Ga=$3 +Ba=$4 +Matrices_RGB=$5 +XYZ_Tristimulus=$6 +Choix=$7 +nt_Ra={$Ra/255} +nt_Ga={$Ga/255} +nt_Ba={$Ba/255} +if $nt_Ra>0.04045 +nt_Ra={({{$nt_Ra+0.055}/1.055})^2.4} +else +nt_Ra/=12.92 +fi +if $nt_Ga>0.04045 +nt_Ga={({{$nt_Ga+0.055}/1.055})^2.4} +else +nt_Ga/=12.92 +fi +if $nt_Ba>0.04045 +nt_Ba={({{$nt_Ba+0.055}/1.055})^2.4} +else +nt_Ba/=12.92 +fi +nt_Ra*=100 +nt_Ga*=100 +nt_Ba*=100 +Xa={$nt_Ra*1.0000000+$nt_Ga*0.0000000+$nt_Ba*0.0000000} +Ya={$nt_Ra*0.0000000+$nt_Ga*1.0000000+$nt_Ba*0.0000000} +Za={$nt_Ra*0.0000000+$nt_Ga*0.0000000+$nt_Ba*1.0000000} +if $Matrices_RGB==0 +Xa={$nt_Ra*0.5767309+$nt_Ga*0.1855540+$nt_Ba*0.1881852} +Ya={$nt_Ra*0.2973769+$nt_Ga*0.6273491+$nt_Ba*0.0752741} +Za={$nt_Ra*0.0270343+$nt_Ga*0.0706872+$nt_Ba*0.9911085} +elif $Matrices_RGB==1 +Xa={$nt_Ra*0.4497288+$nt_Ga*0.3162486+$nt_Ba*0.1844926} +Ya={$nt_Ra*0.2446525+$nt_Ga*0.6720283+$nt_Ba*0.0833192} +Za={$nt_Ra*0.0251848+$nt_Ga*0.1411824+$nt_Ba*0.9224628} +elif $Matrices_RGB==2 +Xa={$nt_Ra*0.6326696+$nt_Ga*0.2045558+$nt_Ba*0.1269946} +Ya={$nt_Ra*0.2284569+$nt_Ga*0.7373523+$nt_Ba*0.0341908} +Za={$nt_Ra*0.0000000+$nt_Ga*0.0095142+$nt_Ba*0.8156958} +elif $Matrices_RGB==3 +Xa={$nt_Ra*0.6712537+$nt_Ga*0.1745834+$nt_Ba*0.1183829} +Ya={$nt_Ra*0.3032726+$nt_Ga*0.6637861+$nt_Ba*0.0329413} +Za={$nt_Ra*0.0000000+$nt_Ga*0.0407010+$nt_Ba*0.7845090} +elif $Matrices_RGB==4 +Xa={$nt_Ra*0.4674162+$nt_Ga*0.2944512+$nt_Ba*0.1886026} +Ya={$nt_Ra*0.2410115+$nt_Ga*0.6835475+$nt_Ba*0.0754410} +Za={$nt_Ra*0.0219101+$nt_Ga*0.0736128+$nt_Ba*0.9933071} +elif $Matrices_RGB==5 +Xa={$nt_Ra*0.4887180+$nt_Ga*0.3106803+$nt_Ba*0.2006017} +Ya={$nt_Ra*0.1762044+$nt_Ga*0.8129847+$nt_Ba*0.0108109} +Za={$nt_Ra*0.0000000+$nt_Ga*0.0102048+$nt_Ba*0.9897952} +elif $Matrices_RGB==6 +Xa={$nt_Ra*0.5093439+$nt_Ga*0.3209071+$nt_Ba*0.1339691} +Ya={$nt_Ra*0.2748840+$nt_Ga*0.6581315+$nt_Ba*0.0669845} +Za={$nt_Ra*0.0242545+$nt_Ga*0.1087821+$nt_Ba*0.6921735} +elif $Matrices_RGB==7 +Xa={$nt_Ra*0.6457711+$nt_Ga*0.1933511+$nt_Ba*0.1250978} +Ya={$nt_Ra*0.2783496+$nt_Ga*0.6879702+$nt_Ba*0.0336802} +Za={$nt_Ra*0.0037113+$nt_Ga*0.0179861+$nt_Ba*0.8035125} +elif $Matrices_RGB==8 +Xa={$nt_Ra*0.6502043+$nt_Ga*0.1780774+$nt_Ba*0.1359384} +Ya={$nt_Ra*0.3202499+$nt_Ga*0.6020711+$nt_Ba*0.0776791} +Za={$nt_Ra*0.0000000+$nt_Ga*0.0678390+$nt_Ba*0.7573710} +elif $Matrices_RGB==9 +Xa={$nt_Ra*0.5938914+$nt_Ga*0.2729801+$nt_Ba*0.0973485} +Ya={$nt_Ra*0.2606286+$nt_Ga*0.7349465+$nt_Ba*0.0044249} +Za={$nt_Ra*0.0000000+$nt_Ga*0.0419969+$nt_Ba*0.7832131} +elif $Matrices_RGB==10 +Xa={$nt_Ra*0.6068909+$nt_Ga*0.1735011+$nt_Ba*0.2003480} +Ya={$nt_Ra*0.2989164+$nt_Ga*0.5865990+$nt_Ba*0.1144845} +Za={$nt_Ra*0.0000000+$nt_Ga*0.0660957+$nt_Ba*1.1162243} +elif $Matrices_RGB==11 +Xa={$nt_Ra*0.4306190+$nt_Ga*0.3415419+$nt_Ba*0.1783091} +Ya={$nt_Ra*0.2220379+$nt_Ga*0.7066384+$nt_Ba*0.0713236} +Za={$nt_Ra*0.0201853+$nt_Ga*0.1295504+$nt_Ba*0.9390944} +elif $Matrices_RGB==12 +Xa={$nt_Ra*0.7976749+$nt_Ga*0.1351917+$nt_Ba*0.0313534} +Ya={$nt_Ra*0.2880402+$nt_Ga*0.7118741+$nt_Ba*0.0000857} +Za={$nt_Ra*0.0000000+$nt_Ga*0.0000000+$nt_Ba*0.8252100} +elif $Matrices_RGB==13 +Xa={$nt_Ra*0.3935891+$nt_Ga*0.3652497+$nt_Ba*0.1916313} +Ya={$nt_Ra*0.2124132+$nt_Ga*0.7010437+$nt_Ba*0.0865432} +Za={$nt_Ra*0.0187423+$nt_Ga*0.1119313+$nt_Ba*0.9581563} +elif $Matrices_RGB==14 +Xa={$nt_Ra*0.4124564+$nt_Ga*0.3575761+$nt_Ba*0.1804375} +Ya={$nt_Ra*0.2126729+$nt_Ga*0.7151522+$nt_Ba*0.0721750} +Za={$nt_Ra*0.0193339+$nt_Ga*0.1191920+$nt_Ba*0.9503041} +elif $Matrices_RGB==15 +Xa={$nt_Ra*0.7161046+$nt_Ga*0.1009296+$nt_Ba*0.1471858} +Ya={$nt_Ra*0.2581874+$nt_Ga*0.7249378+$nt_Ba*0.0168748} +Za={$nt_Ra*0.0000000+$nt_Ga*0.0517813+$nt_Ba*0.7734287} +fi +Xca=$Xa +Yca=$Ya +Zca=$Za +ref_Xa=100.000 +ref_Ya=100.000 +ref_Za=100.000 +if $XYZ_Tristimulus==0 +ref_Xa=109.850 +ref_Ya=100.000 +ref_Za=35.585 +elif $XYZ_Tristimulus==1 +ref_Xa=98.074 +ref_Ya=100.000 +ref_Za=118.232 +elif $XYZ_Tristimulus==2 +ref_Xa=96.422 +ref_Ya=100.000 +ref_Za=82.521 +elif $XYZ_Tristimulus==3 +ref_Xa=95.682 +ref_Ya=100.000 +ref_Za=92.149 +elif $XYZ_Tristimulus==4 +ref_Xa=95.047 +ref_Ya=100.000 +ref_Za=108.883 +elif $XYZ_Tristimulus==5 +ref_Xa=94.972 +ref_Ya=100.000 +ref_Za=122.638 +elif $XYZ_Tristimulus==6 +ref_Xa=99.187 +ref_Ya=100.000 +ref_Za=67.395 +elif $XYZ_Tristimulus==7 +ref_Xa=95.044 +ref_Ya=100.000 +ref_Za=108.755 +elif $XYZ_Tristimulus==8 +ref_Xa=100.966 +ref_Ya=100.000 +ref_Za=64.370 +elif $XYZ_Tristimulus==10 +ref_Xa=111.144 +ref_Ya=100.000 +ref_Za=35.200 +elif $XYZ_Tristimulus==11 +ref_Xa=97.285 +ref_Ya=100.000 +ref_Za=116.145 +elif $XYZ_Tristimulus==12 +ref_Xa=96.720 +ref_Ya=100.000 +ref_Za=81.427 +elif $XYZ_Tristimulus==13 +ref_Xa=95.799 +ref_Ya=100.000 +ref_Za=90.926 +elif $XYZ_Tristimulus==14 +ref_Xa=94.811 +ref_Ya=100.000 +ref_Za=107.304 +elif $XYZ_Tristimulus==15 +ref_Xa=94.416 +ref_Ya=100.000 +ref_Za=120.641 +elif $XYZ_Tristimulus==16 +ref_Xa=103.280 +ref_Ya=100.000 +ref_Za=69.026 +elif $XYZ_Tristimulus==17 +ref_Xa=95.792 +ref_Ya=100.000 +ref_Za=107.687 +elif $XYZ_Tristimulus==18 +ref_Xa=103.866 +ref_Ya=100.000 +ref_Za=65.627 +fi +nt_Xa={$Xca/$ref_Xa} +nt_Ya={$Yca/$ref_Ya} +nt_Za={$Zca/$ref_Za} +if $nt_Xa>0.008856 +nt_Xa={($nt_Xa)^{1/3}} +else +nt_Xa={{7.787*$nt_Xa}+{16/116}} +fi +if $nt_Ya>0.008856 +nt_Ya={($nt_Ya)^{1/3}} +else +nt_Ya={{7.787*$nt_Ya}+{16/116}} +fi +if $nt_Za>0.008856 +nt_Za={($nt_Za)^{1/3}} +else +nt_Za={{7.787*$nt_Za}+{16/116}} +fi +CIE_La={{116*$nt_Ya}-16} +CIE_aa={500*{$nt_Xa-$nt_Ya}} +CIE_ba={200*{$nt_Ya-$nt_Za}} +if $Choix==1 +if $Type_de_demande==0 u {$CIE_La}","{$CIE_aa}","{$CIE_ba} +elif $Type_de_demande==1 u {$CIE_La} +elif $Type_de_demande==2 u {$CIE_aa} +elif $Type_de_demande==3 u {$CIE_ba} +fi +elif $Choix==0 +var_H={atan2($CIE_ba,$CIE_aa)} +if $var_H>0 +var_H={{$var_H/pi}*180} +else +var_H={360-{{abs($var_H)/pi}*180}} +fi +CIE_L=$CIE_La +CIE_C={({{$CIE_aa*$CIE_aa}+{$CIE_ba*$CIE_ba}})^0.5} +CIE_H=$var_H +if $Type_de_demande==0 u {$CIE_L}","{$CIE_C}","{$CIE_H} +elif $Type_de_demande==1 u {$CIE_L} +elif $Type_de_demande==2 u {$CIE_C} +elif $Type_de_demande==3 u {$CIE_H} +fi +fi +samj_LCH_or_Lab_to_RGB: +Type_de_demande=$1 +Matrices_RGB=$5 +XYZ_Tristimulus=$6 +Choix=$7 +if $Choix==1 +CIE_Lca=$2 +CIE_aca=$3 +CIE_bca=$4 +elif $Choix==0 +CIE_Lca=$2 +CIE_aca={{cos(pi/180*$4)}*$3} +CIE_bca={{sin(pi/180*$4)}*$3} +fi +nt_Yca={{$CIE_Lca+16}/116} +nt_Xca={$CIE_aca/500+$nt_Yca} +nt_Zca={$nt_Yca-$CIE_bca/200} +if {($nt_Yca)^3}>0.008856 +nt_Yca={($nt_Yca)^3} +else +nt_Yca={{$nt_Yca-16/116}/7.787} +fi +if {($nt_Xca)^3}>0.008856 +nt_Xca={($nt_Xca)^3} +else +nt_Xca={{$nt_Xca-16/116}/7.787} +fi +if {($nt_Zca)^3}>0.008856 +nt_Zca={($nt_Zca)^3} +else +nt_Zca={{$nt_Zca-16/116}/7.787} +fi +ref_Xca=100.000 +ref_Yca=100.000 +ref_Zca=100.000 +if $XYZ_Tristimulus==0 +ref_Xca=109.850 +ref_Yca=100.000 +ref_Zca=35.585 +elif $XYZ_Tristimulus==1 +ref_Xca=98.074 +ref_Yca=100.000 +ref_Zca=118.232 +elif $XYZ_Tristimulus==2 +ref_Xca=96.422 +ref_Yca=100.000 +ref_Zca=82.521 +elif $XYZ_Tristimulus==3 +ref_Xca=95.682 +ref_Yca=100.000 +ref_Zca=92.149 +elif $XYZ_Tristimulus==4 +ref_Xca=95.047 +ref_Yca=100.000 +ref_Zca=108.883 +elif $XYZ_Tristimulus==5 +ref_Xca=94.972 +ref_Yca=100.000 +ref_Zca=122.638 +elif $XYZ_Tristimulus==6 +ref_Xca=99.187 +ref_Yca=100.000 +ref_Zca=67.395 +elif $XYZ_Tristimulus==7 +ref_Xca=95.044 +ref_Yca=100.000 +ref_Zca=108.755 +elif $XYZ_Tristimulus==8 +ref_Xca=100.966 +ref_Yca=100.000 +ref_Zca=64.370 +elif $XYZ_Tristimulus==10 +ref_Xca=111.144 +ref_Yca=100.000 +ref_Zca=35.200 +elif $XYZ_Tristimulus==11 +ref_Xca=97.285 +ref_Yca=100.000 +ref_Zca=116.145 +elif $XYZ_Tristimulus==12 +ref_Xca=96.720 +ref_Yca=100.000 +ref_Zca=81.427 +elif $XYZ_Tristimulus==13 +ref_Xca=95.799 +ref_Yca=100.000 +ref_Zca=90.926 +elif $XYZ_Tristimulus==14 +ref_Xca=94.811 +ref_Yca=100.000 +ref_Zca=107.304 +elif $XYZ_Tristimulus==15 +ref_Xca=94.416 +ref_Yca=100.000 +ref_Zca=120.641 +elif $XYZ_Tristimulus==16 +ref_Xca=103.280 +ref_Yca=100.000 +ref_Zca=69.026 +elif $XYZ_Tristimulus==17 +ref_Xca=95.792 +ref_Yca=100.000 +ref_Zca=107.687 +elif $XYZ_Tristimulus==18 +ref_Xca=103.866 +ref_Yca=100.000 +ref_Zca=65.627 +fi +Xca={$ref_Xca*$nt_Xca} +Yca={$ref_Yca*$nt_Yca} +Zca={$ref_Zca*$nt_Zca} +vcXa=$Xca +vcYa=$Yca +vcZa=$Zca +nt_X={$vcXa/100} +nt_Y={$vcYa/100} +nt_Z={$vcZa/100} +nt_R={$nt_X*1.0000000+$nt_Y*0.0000000+$nt_Z*0.0000000} +nt_G={$nt_X*0.0000000+$nt_Y*1.0000000+$nt_Z*0.0000000} +nt_B={$nt_X*0.0000000+$nt_Y*0.0000000+$nt_Z*1.0000000} +if $Matrices_RGB==0 +nt_R={$nt_X*2.0413690+$nt_Y*-0.5649464+$nt_Z*-0.3446944} +nt_G={$nt_X*-0.9692660+$nt_Y*1.8760108+$nt_Z*0.0415560} +nt_B={$nt_X*0.0134474+$nt_Y*-0.1183897+$nt_Z*1.0154096} +elif $Matrices_RGB==1 +nt_R={$nt_X*2.9515373+$nt_Y*-1.2894116+$nt_Z*-0.4738445} +nt_G={$nt_X*-1.0851093+$nt_Y*1.9908566+$nt_Z*0.0372026} +nt_B={$nt_X*0.0854934+$nt_Y*-0.2694964+$nt_Z*1.0912975} +elif $Matrices_RGB==2 +nt_R={$nt_X*1.7552599+$nt_Y*-0.4836786+$nt_Z*-0.2530000} +nt_G={$nt_X*-0.5441336+$nt_Y*1.5068789+$nt_Z*0.0215528} +nt_B={$nt_X*0.0063467+$nt_Y*-0.0175761+$nt_Z*1.2256959} +elif $Matrices_RGB==3 +nt_R={$nt_X*1.6832270+$nt_Y*-0.4282363+$nt_Z*-0.2360185} +nt_G={$nt_X*-0.7710229+$nt_Y*1.7065571+$nt_Z*0.0446900} +nt_B={$nt_X*0.0400013+$nt_Y*-0.0885376+$nt_Z*1.2723640} +elif $Matrices_RGB==4 +nt_R={$nt_X*2.7454669+$nt_Y*-1.1358136+$nt_Z*-0.4350269} +nt_G={$nt_X*-0.9692660+$nt_Y*1.8760108+$nt_Z*0.0415560} +nt_B={$nt_X*0.0112723+$nt_Y*-0.1139754+$nt_Z*1.0132541} +elif $Matrices_RGB==5 +nt_R={$nt_X*2.3706743+$nt_Y*-0.9000405+$nt_Z*-0.4706338} +nt_G={$nt_X*-0.5138850+$nt_Y*1.4253036+$nt_Z*0.0885814} +nt_B={$nt_X*0.0052982+$nt_Y*-0.0146949+$nt_Z*1.0093968} +elif $Matrices_RGB==6 +nt_R={$nt_X*2.6422874+$nt_Y*-1.2234270+$nt_Z*-0.3930143} +nt_G={$nt_X*-1.1119763+$nt_Y*2.0590183+$nt_Z*0.0159614} +nt_B={$nt_X*0.0821699+$nt_Y*-0.2807254+$nt_Z*1.4559877} +elif $Matrices_RGB==7 +nt_R={$nt_X*1.7603902+$nt_Y*-0.4881198+$nt_Z*-0.2536126} +nt_G={$nt_X*-0.7126288+$nt_Y*1.6527432+$nt_Z*0.0416715} +nt_B={$nt_X*0.0078207+$nt_Y*-0.0347411+$nt_Z*1.2447743} +elif $Matrices_RGB==8 +nt_R={$nt_X*1.7827618+$nt_Y*-0.4969847+$nt_Z*-0.2690101} +nt_G={$nt_X*-0.9593623+$nt_Y*1.9477962+$nt_Z*-0.0275807} +nt_B={$nt_X*0.0859317+$nt_Y*-0.1744674+$nt_Z*1.3228273} +elif $Matrices_RGB==9 +nt_R={$nt_X*2.0043819+$nt_Y*-0.7304844+$nt_Z*-0.2450052} +nt_G={$nt_X*-0.7110285+$nt_Y*1.6202126+$nt_Z*0.0792227} +nt_B={$nt_X*0.0381263+$nt_Y*-0.0868780+$nt_Z*1.2725438} +elif $Matrices_RGB==10 +nt_R={$nt_X*1.9099961+$nt_Y*-0.5324542+$nt_Z*-0.2882091} +nt_G={$nt_X*-0.9846663+$nt_Y*1.9991710+$nt_Z*-0.0283082} +nt_B={$nt_X*0.0583056+$nt_Y*-0.1183781+$nt_Z*0.8975535} +elif $Matrices_RGB==11 +nt_R={$nt_X*3.0628971+$nt_Y*-1.3931791+$nt_Z*-0.4757517} +nt_G={$nt_X*-0.9692660+$nt_Y*1.8760108+$nt_Z*0.0415560} +nt_B={$nt_X*0.0678775+$nt_Y*-0.2288548+$nt_Z*1.0693490} +elif $Matrices_RGB==12 +nt_R={$nt_X*1.3459433+$nt_Y*-0.2556075+$nt_Z*-0.0511118} +nt_G={$nt_X*-0.5445989+$nt_Y*1.5081673+$nt_Z*0.0205351} +nt_B={$nt_X*0.0000000+$nt_Y*0.0000000+$nt_Z*1.2118128} +elif $Matrices_RGB==13 +nt_R={$nt_X*3.5053960+$nt_Y*-1.7394894+$nt_Z*-0.5439640} +nt_G={$nt_X*-1.0690722+$nt_Y*1.9778245+$nt_Z*0.0351722} +nt_B={$nt_X*0.0563200+$nt_Y*-0.1970226+$nt_Z*1.0502026} +elif $Matrices_RGB==14 +nt_R={$nt_X*3.2404542+$nt_Y*-1.5371385+$nt_Z*-0.4985314} +nt_G={$nt_X*-0.9692660+$nt_Y*1.8760108+$nt_Z*0.0415560} +nt_B={$nt_X*0.0556434+$nt_Y*-0.2040259+$nt_Z*1.0572252} +elif $Matrices_RGB==15 +nt_R={$nt_X*1.4628067+$nt_Y*-0.1840623+$nt_Z*-0.2743606} +nt_G={$nt_X*-0.5217933+$nt_Y*1.4472381+$nt_Z*0.0677227} +nt_B={$nt_X*0.0349342+$nt_Y*-0.0968930+$nt_Z*1.2884099} +fi +if $nt_R>0.0031308 +nt_R={1.055*{($nt_R)^{1/2.4}}-0.055} +else +nt_R={12.92*$nt_R} +fi +if $nt_G>0.0031308 +nt_G={1.055*{($nt_G)^{1/2.4}}-0.055} +else +nt_G={12.92*$nt_G} +fi +if $nt_B>0.0031308 +nt_B={1.055*{($nt_B)^{1/2.4}}-0.055} +else +nt_B={12.92*$nt_B} +fi +Rconv={$nt_R*255} +Gconv={$nt_G*255} +Bconv={$nt_B*255} +if $Type_de_demande==0 u {$Rconv}","{$Gconv}","{$Bconv} +elif $Type_de_demande==1 u {$Rconv} +elif $Type_de_demande==2 u {$Gconv} +elif $Type_de_demande==3 u {$Bconv} +fi +ancien_Tom_Keil_Colortemp : +foreach { if $2==1 +luminance[-1] to_rgb[-2] +s[-2] c avb={-2,127.5-ia} avg={-3,127.5-ia} avr={-4,127.5-ia} ++[-4] $avr +[-3] $avg +[-2] $avb a[-4,-3,-2] c rv compose_luminance fi +fx_mix_lab 1,0,0,1,{if({$1>=0},{$1/4},{$1*0.75})},0,1,$1,0,0,2,0 } +ancien_gimp_morpho : +apply_channels "__ancien_gimp_morpho ${^0}",$5,$6 +__ancien_gimp_morpho : +if $4==1 suf="_oct" elif $4==0 suf="" else suf="_circ" fi +if $1==0 erode$suf $2 +elif $1==1 dilate$suf $2 +elif $1==2 erode$suf $2 dilate$suf $2 +elif $1==3 dilate$suf $2 erode$suf $2 +elif $1==4 repeat $! +erode$suf $2 --[-2,-1] mv[-1] 0 done +elif $1==5 repeat $! +dilate$suf $2 rv[-2,-1] --[-2,-1] mv[-1] 0 done +elif $1==6 repeat $! +erode$suf $2 dilate$suf[-1] $2 --[-2,-1] mv[-1] 0 done +else repeat $! +dilate$suf $2 erode$suf[-1] $2 rv[-2,-1] --[-2,-1] mv[-1] 0 done +fi +if $3 foreach { split_opacity negative[0] a c } fi +at_ancien : skip ${1=0},${2=0},${3=0} ++z. ${1-3},${1-3} u {^} rm. +gimp_blend_1651 : +mode=${arg\ 1+$1,add,alpha,and,average,blue,burn,darken,difference,divide,dodge,edges,exclusion,freeze,grainextract,grainmerge,green,hardlight,hardmix,hue,interpolation,lighten,lightness,linearburn,linearlight,luminance,multiply,negation,or,overlay,pinlight,red,reflect,saturation,shapeaverage,shapeaverage0,softburn,softdodge,softlight,screen,stamp,subtract,value,vividlight,xor} +if $2==0 repeat int($!/2) l[$>,{$>+1}] rv blend $mode,$3,$4 done done +elif $2==1" && "$!>1 samj_blend_20220419[^0] [0],$mode,$3,1 rm[0] +elif $2==2" && "$!>1 samj_blend_20220419[^-1] [-1],$mode,$3,0 rm[-1] +fi +trait_epais_samj : +if {$3-$1}==0 X1={$1-{$5/2}} Y1=$2 X2={$3-{$5/2}} Y2=$4 X3={$3+{$5/2}} Y3=$4 X4={$1+{$5/2}} Y4=$2 +else +if {$4-$2}==0 X1=$1 Y1={$2+{$5/2}} X2=$3 Y2={$4+{$5/2}} X3=$3 Y3={$4-{$5/2}} X4=$1 Y4={$2-{$5/2}} +else angle_triangle={{{pi}/2}-{atan({{$4-$2}/{$3-$1}})}} X_triangle={{$5/2}*{cos($angle_triangle)}} Y_triangle={{$5/2}*{sin($angle_triangle)}} +X1={$1-$X_triangle} Y1={$2+$Y_triangle} X2={$3-$X_triangle} Y2={$4+$Y_triangle} X3={$3+$X_triangle} Y3={$4-$Y_triangle} X4={$1+$X_triangle} Y4={$2-$Y_triangle} +fi +fi +polygon[-1] 4,$X1,$Y1,$X2,$Y2,$X3,$Y3,$X4,$Y4,1,$7,$8,$9,$10 +if $6==1 circle[-1] $1,$2,{$5/2},1,$7,$8,$9,$10 circle[-1] $3,$4,{$5/2},1,$7,$8,$9,$10 fi +samj_sierpinski_absolu : check ${1=7}>=0 skip ${2=0},${3=0},${4=10},${5=100},${6=150},${7=20},${8=255},${9=255},${10=0},${11=255} +e[^-1] "Draw Sierpinski triangle of degree $1 on image$?." +_samj_sierpinski_absolu ${2-11},$1 +_samj_sierpinski_absolu : +if $11<=0 polygon 3,$1,$2,$3,$4,$5,$6,1,$7,$8,$9,$10 return fi +_samj_sierpinski_absolu $1,$2,{($1+$3)/2},{($2+$4)/2},{($1+$5)/2},{($2+$6)/2},$7,$8,$9,$10,{$11-1} +_samj_sierpinski_absolu {($1+$3)/2},{($2+$4)/2},$3,$4,{($3+$5)/2},{($4+$6)/2},$7,$8,$9,$10,{$11-1} +_samj_sierpinski_absolu {($1+$5)/2},{($2+$6)/2},$5,$6,{($3+$5)/2},{($4+$6)/2},$7,$8,$9,$10,{$11-1} +samj_snowflake_absolu : +to_rgba +polygon 3,$2,$3,$4,$5,$6,$7,${8--1},255 +_samj_snowflake_absolu $1,$2,$3,$6,$7,${8--1} +_samj_snowflake_absolu $1,$6,$7,$4,$5,${8--1} +_samj_snowflake_absolu $1,$4,$5,$2,$3,${8--1} +_samj_snowflake_absolu : +x0={$2+($4-$2)/3} y0={$3+($5-$3)/3} +x1={$2+2*($4-$2)/3} y1={$3+2*($5-$3)/3} +c={cos(-pi/3)} s={sin(-pi/3)} +x2={$x0+($x1-$x0)*$c-($y1-$y0)*$s} y2={$y0+($x1-$x0)*$s+($y1-$y0)*$c} +polygon 3,$x0,$y0,$x1,$y1,$x2,$y2,${6--1},255 +if $1 +_samj_snowflake_absolu {$1-1},$2,$3,$x0,$y0,${6--1} +_samj_snowflake_absolu {$1-1},$x0,$y0,$x2,$y2,${6--1} +_samj_snowflake_absolu {$1-1},$x2,$y2,$x1,$y1,${6--1} +_samj_snowflake_absolu {$1-1},$x1,$y1,$4,$5,${6--1} +fi +samj_snowflake_contours_absolu : +to_rgba +polygon 3,$2,$3,$4,$5,$6,$7,$8,0xFFFFFFFF,$9,$10,$11,255 +_samj_snowflake_contours_absolu $1,$2,$3,$6,$7,${8--1} +_samj_snowflake_contours_absolu $1,$6,$7,$4,$5,${8--1} +_samj_snowflake_contours_absolu $1,$4,$5,$2,$3,${8--1} +_samj_snowflake_contours_absolu : +x0={$2+($4-$2)/3} y0={$3+($5-$3)/3} +x1={$2+2*($4-$2)/3} y1={$3+2*($5-$3)/3} +c={cos(-pi/3)} s={sin(-pi/3)} +x2={$x0+($x1-$x0)*$c-($y1-$y0)*$s} y2={$y0+($x1-$x0)*$s+($y1-$y0)*$c} +polygon 3,$x0,$y0,$x1,$y1,$x2,$y2,$6,0xFFFFFFFF,${7--1},255 +if $1 +_samj_snowflake_contours_absolu {$1-1},$2,$3,$x0,$y0,${6--1} +_samj_snowflake_contours_absolu {$1-1},$x0,$y0,$x2,$y2,${6--1} +_samj_snowflake_contours_absolu {$1-1},$x2,$y2,$x1,$y1,${6--1} +_samj_snowflake_contours_absolu {$1-1},$x1,$y1,$4,$5,${6--1} +fi +twirl_ancien_euclidean2polar_ancien_polar2euclidean : skip ${1=1},${2=50%},${3=50%},${4=1} +e[^-1] "Apply twirl deformation on image$?, with amplitude $1 and center point at ($2%,$3%)." +euclidean2polar_ancien $2,$3,1,$4 repeat $! +[$>],[$>],1,1,$1*x channels[-1] -1,0 warp[$>] [-1],1,1,2 rm[-1] +done polar2euclidean_ancien $2,$3,1,1 +euclidean2polar_ancien : skip ${1=0.5},${2=0.5},${3=1},${4=1} +e[^-1] "Apply euclidean to polar transform on image$?." +foreach { +({w},{h}) ($1,$2) *[-2,-1] ({"sqrt(max("{@0}","{-2,w}"-"{@0}")^2 + max("{@1}","{-2,h}"-"{@1}")^2)"}) +a[-2,-1] x +[-2],[-2],1,1,{@2}"*(x/w)^$3*cos(y*2*pi/h)" +[-1] {-2,@0} +[-1],[-1],1,1,{-2,@2}"*(x/w)^$3*sin(y*2*pi/h)" +[-1] {-3,@1} +rm[-3] a[-2,-1] c warp[-2] [-1],0,1,$4 rm[-1] +} +polar2euclidean_ancien : skip ${1=0.5},${2=0.5},${3=1},${4=1} +e[^-1] "Apply polar to euclidean transform on image$?." +foreach { +({w},{h}) ($1,$2) *[-2,-1] ({"sqrt(max("{@0}","{-2,w}"-"{@0}")^2 + max("{@1}","{-2,h}"-"{@1}")^2)"}) +a[-2,-1] x +[-2],[-2],1,1,"w*(sqrt((x-"{@0}")^2 + (y-"{@1}")^2)/"{@2}")^(1/$3)" +[-1],[-1],1,1,"(atan2(y-"{-2,@1}",x-"{-2,@0}")*h/(2*pi)+h)%h" +rm[-3] a[-2,-1] c warp[-2] [-1],0,1,$4 rm[-1] +} +samj_test_A : +or[-1] {$1} to_rgb[-1] and[-1] {$2} smooth[-1] $3 n[-1] 0,255 Couleurs_Metalliques[-1] 0,0,22,0,0,0,0,6,5,20,1,0,0,0,0.3,60,1,1,0 +samj_test_B : +samj_Points_Aleatoires_001[-1] $1,255,255,0,255,3,1,1 +Je_passe_l_hiver_en_Floride[-1] fx_flower[-1] 30,6,100,0,50,50,1 to_rgb[-1] smooth[-1] 500 n[-1] 0,255 Couleurs_Metalliques[-1] 0,0,22,0,0,0,0,6,5,20,1,0,0,0,0.3,60,1,1,0 fx_boost_chroma[-1] 1,0,0 +samj_test_C : +samj_Points_Aleatoires_001[-1] $1,255,255,0,255,3,1,1 +Je_passe_l_hiver_en_Floride[-1] fx_segment_watershed[-1] 8,0,0,0,0 fx_flower[-1] 10,20,0,360,50,50,1 Couleurs_Metalliques[-1] 0,0,22,0,0,0,0,6,5,20,1,0,0,0,0.3,60,1,1,0 +samj_test_x_color_curves : +Utiliser=$1 +Appliquer_courbes=$2 +if $Utiliser==0 +if $Appliquer_courbes==0 +blur[-1] 5 +elif $Appliquer_courbes==1 +x_color_curves[-1] last +elif $Appliquer_courbes==2 +x_color_curves[-1] rgb +elif $Appliquer_courbes==3 +x_color_curves[-1] cmy +elif $Appliquer_courbes==4 +x_color_curves[-1] cmyk +elif $Appliquer_courbes==5 +x_color_curves[-1] hsi +elif $Appliquer_courbes==6 +x_color_curves[-1] hsl +elif $Appliquer_courbes==7 +x_color_curves[-1] hsv +elif $Appliquer_courbes==8 +x_color_curves[-1] lab +elif $Appliquer_courbes==9 +x_color_curves[-1] lch +elif $Appliquer_courbes==10 +x_color_curves[-1] ycbcr +fi +else +if $Appliquer_courbes==0 +blur[-1] 5 +elif $Appliquer_courbes==1 +deform[-1] 20 +elif $Appliquer_courbes==2 +fx_curves_interactive[-1] 0,0,0,0,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100 +elif $Appliquer_courbes==3 +fx_curves_interactive[-1] 1,0,0,0,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100 +elif $Appliquer_courbes==4 +fx_curves_interactive[-1] 2,0,0,0,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100 +elif $Appliquer_courbes==5 +fx_curves_interactive[-1] 3,0,0,0,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100 +elif $Appliquer_courbes==6 +fx_curves_interactive[-1] 4,0,0,0,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100 +elif $Appliquer_courbes==7 +fx_curves_interactive[-1] 5,0,0,0,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100 +elif $Appliquer_courbes==8 +fx_curves_interactive[-1] 6,0,0,0,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100 +elif $Appliquer_courbes==9 +fx_curves_interactive[-1] 7,0,0,0,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100 +elif $Appliquer_courbes==10 +fx_curves_interactive[-1] 8,0,0,0,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100 +fi +fi +samj_test_D : +Var_sub=$1 +Var_n=$2 +Var_spread=$3 +Var_dilate=$4 +Var_blur=$5 +Deformation=$6 +Levels=$7 +Smoothness=$8 +Var_dilate_circ=$9 +Inner_fading=$10 +Outer_fading=$11 ++Je_passe_l_hiver_en_Floride[-1] +if $Var_sub>0 +sub[-1] $Var_sub +abs[-1] +fi +n[-1] 0,$Var_n +if $Var_spread>0 spread[-1] $Var_spread fi +if $Var_dilate>0 dilate[-1] $Var_dilate fi +if $Var_blur>0 blur[-1] $Var_blur fi +if $Deformation>0 deform[-1] $Deformation fi +fx_isophotes[-2] $Levels,$Smoothness,0 +if $Var_dilate_circ>0 dilate_circ[-2] $Var_dilate_circ fi +fx_blend_seamless[-2,-1] 0,$Inner_fading,$Outer_fading,0,0 +samj_test_Dither_Color : +Flou_a=$1 +Dilatation=$2 +R_C=$3 +V_C=$4 +B_C=$5 +Tolerance_C=$6 +Smoothness_C=$7 ++Je_passe_l_hiver_en_Floride[-1] +gradient_norm[-1] +blur[-1] $Flou_a +dilate_circ[-1] $Dilatation +negative[-1] +n[-1] 0,255 +ditheredbw[-1] +to_rgb[-1] +samj_blend_20220419[-1,-2] add +to_rgb[-1] +n[-1] 0,255 +replace_color[-1] $Tolerance_C,$Smoothness_C,255,255,255,$R_C,$V_C,$B_C +samj_test_E : +exemple=$1 +sharpness=$2 +anisotropy=$3 +alpha=$4 +sigma=$5 +is_sqrt=$6 +rf=$7 +vf=$8 +bf=$9 +Mode=$10 +Opacity=$11 +if $exemple==1 +anisotropy=0 +alpha=0 +sigma=0 +elif $exemple==2 +anisotropy=0 +alpha=4 +sigma=0 +elif $exemple==3 +sharpness=0.5 +anisotropy=0.3 +alpha=$4 +sigma/=10 +is_sqrt=1 +fi +diffusiontensors[-1] $sharpness,$anisotropy,$alpha,$sigma,$is_sqrt +n[-1] 0,255 +equalize[-1] +fx_decompose_channels[-1] 4,0,1,0 +remove[-1,-2] +to_rgb[-1] +fx_8bits[-1] 100,10000,256 +{w},{h},1,3 +fill_color[-1] $rf,$vf,$bf +gimp_blend_1651[-1,-2] $Mode,0,$Opacity,0 +samj_test_F : +repeat $3 +fx_custom_deformation "cos(x*$1)*$2*sin(y)*(w+h)/10000","cos(y*$1)*$2*sin(x)*(w+h)/10000",1,1,1 +done +samj_test_G : +fx_spread $1,$1,0,0,0 +fx_boost_fade[-1] $2,0 ++Je_passe_l_hiver_en_Floride[-1] +fx_local_orientation[-1] $3,0,100,0,16,0 +fx_blend[-1,-2] 14,0,1,1,"0" +fx_lightglow[-1] $4,0.5,8,0.8,0,0 +samj_Test_Solidify : +Epaisseur=$1 +Precision=$2 +Coeff_Precision_Pixelise=$3 +Coeff_Precision_Flou=$4 +Nb_Isophotes=$5 +Valider_Solidify=$6 +smoothness=$7 +diffusion_type=$8 +diffusion_iter=$9 +samj_Quelques_Isophotes[-1] $Epaisseur,$Precision,$Coeff_Precision_Pixelise,$Coeff_Precision_Flou,$Nb_Isophotes +if $Valider_Solidify==1 solidify[-1] $smoothness,$diffusion_type,$diffusion_iter fi +samj_Tests_Fill : +if $1==0 +fill "X=x-w/2; Y=y-h/2; R=sqrt(X^2+Y^2); a=atan2(Y,X); if(R<=(w/100*$2),255*abs(cos(c+200*(x/w-0.5)*(y/h-0.5))),850*(a%(0.1*(c+1))))" +elif $1==1 +fill "zr = $3 + $3*-2*x/w; zi = $3 + $3*-2*y/h; for (iter = 0, zr^2+zi^2<=4 && iter<256, ++iter, t = zr^2 - zi^2 + $4; (zi *= 2*zr) += $5; zr = t); zi;" +elif $1==2 +fill "z = 2.4*[ x/w, y/h ] - 1.2; for (iter = 0, cabs(z)<=2 && iter<256, ++iter, z = z**z + [ 0.4,0.2 ]); iter;" +elif $1==3 +fill "t=x/40;if(c==0,sin(t),cos(t))*(exp(cos(t))-2*cos(4*t)-sin(t/12)^5)" +if $6==1 display_parametric 512,512 fi +elif $1==4 +fill "dmax = -1; nmax = 0; for (n = 0, ++n<=8, p = arg(n,-$7,0,$7,-$7,$7,-$7,0,$7); q = arg(n,-$7,-$7,-$7,0,0,$7,$7,$7); d = (j(p,q,0,0,0,1)-i)^2; if(d>dmax,dmax = d; nmax = n,nmax) )" +elif $1==5 +if $8==0 +fill "1/w*x" +elif $8==1 +fill "1/h*y" +elif $8==2 +fill 'y/h+x/w' +elif $8==3 +fill '(i*(x+y))' +elif $8==4 +fill "!c?x:c==1?y:(x+y)/2" +fi +elif $1==6 +fill "[(G+B)/2,(R+B)/2,(R+G)/2]" +elif $1==7 +if $9==0 +fill "x==y*w/h" +elif $9==1 +fill "x!=y*w/h" +elif $9==2 +fill "x==h-y" +elif $9==3 +fill "0,0,0,0,0.5,0.5,0.5,0.5,1,1,1,1" +elif $9==4 +fill "x!=w/2" +fi +elif $1==8 +if $10==0 +Dimension=16 +1,2,1,3 +fill "255,255,0,255,255,0,0,255" +resize[-1] $Dimension,$Dimension +{$Dimension*16},{$Dimension*16},1,4 +fill [-2] +rm[0] +rv[-1,-2] +elif $10==1 +{w},{h},1,3 +rm[0] +fill "x=x-w/2;y=y-h/2;r=sqrt(x*x+y*y);a=atan2(y,x);5*sin(r/10)*[cos(a),sin(a)]" +fi +elif $1==11 +if $14==0 +fill "x%(10+$15)" +elif $14==1 +fill "y%(10+$15)" +elif $14==2 +fill "x&(1+5*$15)" +elif $14==3 +fill "y&(1+5*$15)" +elif $14==4 +fill "i%(10+$15)" +elif $14==5 +fill "xor(i,(10+$15))" +elif $14==6 +fill "xor((x+($15*10)),(y+($15*10)))" +elif $14==7 +fill "xor(i,xor((x+($15*10)),(y+($15*10))))" +elif $14==8 ++blur {$15/4} +repeat 2 +fill[-1] "dmax=-1; nmax=0; for (n=0, ++n<=8, p=arg(n,-4,0,4,-4,4,-4,0,4); q=arg(n,-4,-4,-4,0,0,4,4,4); d=(j(p,q,0,0,0,1)-i)^2; if(d>dmax,dmax=d; nmax=n,nmax))" +done +fill[-1] "[(R+G+B)/3,(R+G+B)/3,(R+G+B)/3]" +fill[-1] "-i" +n[-1] 0,255 +blend grainmerge +fill "[(G+B)/2,(R+B)/2,(R+G)/2]" +elif $14==9 +{w},{h},1,1 +rm[0] +Orientation=(round($15)%4) +if $Orientation==0 ++fill "x%(16+$15)" +fill[-2] "y%(16+$15)" +elif $Orientation==1 ++fill "-x%(15+$15)" +fill[-2] "y%(15+$15)" +elif $Orientation==2 ++fill "x%(14+$15)" +fill[-2] "-y%(14+$15)" +elif $Orientation==3 ++fill "-x%(13+$15)" +fill[-2] "-y%(13+$15)" +fi +n 0,255 +to_rgb +blend average +elif $14==10 +{w},{h},1,4 +if (round($15)%2)==0 +fill[-1] "x=x-w/2;y=y-h/2;r=sqrt(x*x+y*y);r*sin((1+$15*2)*(x-y)/(x+y));" +else +fill[-1] "x=x-w/2;y=y-h/2;r=sqrt(x*x+y*y);r*sin((1+$15*2)*(x+y)/(x-y));" +fi +n[-1] 128,255 +blend alpha +elif $14==11 +if (round($15)%2)==0 +fill "if(i>(255/100*$15),((x+y)%40),((x-y)%40))" +else +fill "if(i<(255/100*$15),((x+y)%40),((x-y)%40))" +fi +elif $14==12 +if (round($15)%2)==0 +fill "(i>(255/100*$15))&&((x+y)%20)&&((x-y)%20)" +else +fill "(i<(255/100*($15-1)))&&((x+y)%20)&&((x-y)%20)" +fi +fi +fi +n 0,255 +if $1==9 +fill "[$11,$12,$13]" +elif $1==10 +min={stats()[0]} +max={stats()[1]} +fill "-i" +n $min,$max +fi +samj_gimp_texture_zero_zero_deux : +Details_TA=$1 +Polygonize_Resolution_TA=$2 +Threshold_Thin_Edges_TA=$3 +Edges_Threshold=$4 +Blend_Colors_Opacity=$5 +Colors_Boost=$6 +Boost_Intensity=$7 +Black_Lines=$8 +Blend_Black_Lines_Opacity=$9 ++Je_passe_l_hiver_en_Floride[-1] +if $Colors_Boost==1 +n[-1] 0,255 +fi +samj_Toile_D_Araignee[-1] $Details_TA,$Polygonize_Resolution_TA,$Threshold_Thin_Edges_TA +if $Black_Lines==1 ++Je_passe_l_hiver_en_Floride[-1] +fx_edges[-1] 0,$Edges_Threshold,0 +fx_local_orientation[-1] 0,0,100,0,0,0 +samj_blend_20220419[-1,-3] average,$Blend_Colors_Opacity,0 +samj_blend_20220419[-1,-2] luminance,$Blend_Black_Lines_Opacity,0 +else +fx_edges[-1] 0,$Edges_Threshold,0 +fx_local_orientation[-1] 0,0,100,0,0,0 +samj_blend_20220419[-1,-2] average,$Blend_Colors_Opacity,0 +fi +if $Colors_Boost==1 ++Je_passe_l_hiver_en_Floride[-1] +n[-1,-2] 0,255 +samj_blend_20220419[-1,-2] softlight,$Boost_Intensity,0 +fi +samj_Texture_Aquarelle_1 : +Amplitude_Noise=$1 +Density_Hardsketchbw=$2 +Spread_Variations=$3 +Amplitude_Water=$4 +R3=$5 +V3=$6 +B3=$7 +Opacite=$8 +{w},{h},1,3 +rm[-2] +fill_color[-1] 255,255,255 +to_rgb[-1] +fx_noise[-1] $Amplitude_Noise,0,2,0 +fx_hardsketchbw[-1] 300,$Density_Hardsketchbw,1,0.1,20,0,0 +{w},{h},1,3 +fill_color[-1] 255,255,255 +to_rgb[-1] +fx_noise[-1] $Amplitude_Noise,0,2,0 +fx_hardsketchbw[-1] 300,$Density_Hardsketchbw,1,0.1,20,0,0 +fx_spread[-1] $Spread_Variations,$Spread_Variations,0,0 +samj_blend_20220419[-1,-2] average,1,0 +water[-1] $Amplitude_Water,0 +{w},{h},1,3 +fill_color[-1] $R3,$V3,$B3 +to_rgb[-1] +if $Opacite>=0 +samj_blend_20220419[-1,-2] average,$Opacite,0 +else +samj_blend_20220419[-1,-2] edges,{1+$Opacite},1 +fi +samj_Toile_D_Araignee : +Details=$1 +Polygonize_Resolution=$2 +Threshold_Thin_Edges=$3 +apply_curve[0] $Details,-1,128,-1,128,-1,128,-1,128,-1,128,255,1,0,0,0,0 ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +fx_polygonize[-2] 300,100,0,$Polygonize_Resolution,$Polygonize_Resolution,0,0,0,255 +fx_thin_edges[-1] 0,$Threshold_Thin_Edges,0 +fx_blend[-2,-1] 36,1,1,,"0" +fx_isophotes[-1] 8,0,1 +fx_blend_edges[-2,-1] 1,5,0 +to_rgb[-1] +rgb2hsl8[-1] +split[-1] c +rm[-2,-3] +fx_thin_edges[-1] 0,15,0,0 +samj_test_tout_interactif : +x_paint[-1] +threshold[-1] +n[-1] 0,255 +samj_Triangles_Lignes : +Quantite=$1 +Variation=$2 +Graine=$3 +Degradation=$4 +AlphaPoly=$5 +PCL=$6 +AlphaLA=$7 +AlphaLB=$8 +AlphaLC=$9 +DilateLignes=$10 +FR=$11 +VR=$12 +BR=$13 +AR=$14 +foreach { +MaxL={round($Quantite/100*$PCL)+1} +srand $Graine +to_rgba +{w},{h},1,4 +{w},{h},1,4 +rv +repeat $Quantite +Index=$> +X1p={round(u*{w})} +Y1p={round(u*{h})} +X2p={$X1p+round(u*$Variation/100*{h})+1} +Y2p={$Y1p+round(u*$Variation/100*{h})+1} +X3p={$X1p+round(u*$Variation/100*{h})+1} +Y3p={$Y1p+round(u*$Variation/100*{h})+1} +OrigineH=$X1p +OrigineV=$Y1p +couleur_pixel={I(#-1,$OrigineH,$OrigineV)} +Rp={arg(1,$couleur_pixel)} +Vp={arg(2,$couleur_pixel)} +Bp={arg(3,$couleur_pixel)} +Ap={arg(4,$couleur_pixel)} +polygon.. 3,$X1p,$Y1p,$X2p,$Y2p,$X3p,$Y3p,1,$Rp,$Vp,$Bp,{$AlphaPoly*$Ap} +if $Index<$MaxL +a_Ligne={{$Y2p-$Y1p}/{$X2p-$X1p}} +b_Ligne={$Y2p-($a_Ligne*$X2p)} +X_Ex_a=0 +Y_Ex_a=$b_Ligne +X_Ex_b={{w}-1} +Y_Ex_b={{$a_Ligne*$X_Ex_b}+$b_Ligne} +if $Y_Ex_b>=0 line... $X_Ex_a,$Y_Ex_a,$X_Ex_b,$Y_Ex_b,1,$Rp,$Vp,$Bp,{$AlphaLA*$Ap} fi +a_Ligne={{$Y2p-$Y3p}/{$X2p-$X3p}} +b_Ligne={$Y2p-($a_Ligne*$X2p)} +X_Ex_a=0 +Y_Ex_a=$b_Ligne +X_Ex_b={{w}-1} +Y_Ex_b={{$a_Ligne*$X_Ex_b}+$b_Ligne} +if $Y_Ex_b>=0 line... $X_Ex_a,$Y_Ex_a,$X_Ex_b,$Y_Ex_b,1,$Rp,$Vp,$Bp,{$AlphaLB*$Ap} fi +a_Ligne={{$Y1p-$Y3p}/{$X1p-$X3p}} +b_Ligne={$Y1p-($a_Ligne*$X1p)} +X_Ex_a=0 +Y_Ex_a=$b_Ligne +X_Ex_b={{w}-1} +Y_Ex_b={{$a_Ligne*$X_Ex_b}+$b_Ligne} +if $Y_Ex_b>=0 line... $X_Ex_a,$Y_Ex_a,$X_Ex_b,$Y_Ex_b,1,$Rp,$Vp,$Bp,{$AlphaLC*$Ap} fi +fi +done +if $DilateLignes>1 dilate_circ... $DilateLignes fi +rm. +blend alpha +{w},{h},1,4 +fill_color. $FR,$VR,$BR,$AR +rv +blend alpha +if $Degradation>0 kuwahara. $Degradation fi +} +disco_preview : +disco ${1--1} +disco : +repeat $! l[$>] +sh. 0 +f. " +begin( +rl=$1; +gl=$2; +bl=$3; +zoom=$4; +q=2*pi; +); +X=(2*x/(w-1))-1; +Y=1-(2*y/(h-1)); +a=atan2(Y,X); +if (a<0,a=a+(2*pi)); +r=sqrt(X*X+Y*Y); +rz=r*zoom; +RRR=abs(sin(rz/rl+q)+sin(a*rl+q)); +GGG=abs(sin(rz/gl+q)+sin(a*gl+q)); +BBB=abs(sin(rz/bl+q)+sin(a*bl+q)); +i(#0,x,y,0,1)=GGG*255; +i(#0,x,y,0,2)=BBB*255; +RRR*255" +rm. +done done +KittyRings_preview : +KittyRings ${1--1} +KittyRings : +repeat $! l[$>] +sh. 0 +f. " +begin( +sectors=$1; +zoom=$2; +inner=$3; +outer=$4; +R1=$5; +G1=$6; +B1=$7; +R2=$8; +G2=$9; +B2=$10 +); +X=(2*x/(w-1))-1; +Y=1-(2*y/(h-1)); +a=atan2(Y,X); +if (a<0,a=a+(2*pi)); +r=sqrt(X*X+Y*Y); +rfloor=int(log(r)*zoom); +if(log(r)*zoom<0,rfloor=rfloor-1); +v=(sectors*a/(pi*2))+(rfloor*0.5); +vfloor=int(v); +if(v<0,vfloor=vfloor-1); +v=v-vfloor; +outR=0; +outG=0; +outB=0; +if (r>inner && r0.15 && v <0.5,outR=R1; outG=G1; outB=B1); +if (v>0.5 && v <0.65,outR=255; outG=255; outB=255); +if (v>0.65 && v <1,outR=R2; outG=G2; outB=B2); +); +i(#0,x,y,0,1)=outG; +i(#0,x,y,0,2)=outB; +outR" +rm. +done done +moon2panorama_preview : +moon2panorama ${1--1} +moon2panorama : +repeat $! l[$>] ++f. 0 +sh. 0 +f. " +begin( +center_help=$1; +center_x=$2; +center_y=$3; +span=$4; +shift_x=$5; +shift_y=$6; +Antialias = $7; +XEdgeType = $8; +YEdgeType = $9; +AR=w/h; +if (AR>1, W=2;H=2/AR,H=2;W=2/AR); +minXY=min(W/2,H/2); +); +if (AR>1, +X=(2*x/(w-1))-1; +Y=(1-(2*y/(h-1)))/AR, +X=((2*x/(w-1))-1)/AR; +Y=1-(2*y/(h-1)) +); +scaled=X/W*span; +scaledi=(Y/(1+9*center_help))/W*span; +shifted=(scaled-shift_x)*pi/180; +shiftedi=(scaledi-shift_y)*pi/180; +reshifted=shiftedi; +reshiftedi=-shifted; +remapped=-exp(reshifted)*sin(reshiftedi); +remappedi=exp(reshifted)*cos(reshiftedi); +centered=(remapped*0.8+center_x/100)*minXY; +centeredi=(remappedi*0.8+center_y/100)*minXY; +if (center_help && abs(2*Y/H)<0.01, +outR=255; +outG=255; +outB=0; +outA=255, +if (AR>1, +realx=(centered+1)*(w-1)/2; +realy=(1-AR*centeredi)*(h-1)/2, +realx=(AR*centered+1)*(w-1)/2; +realy=(1-centeredi)*(h-1)/2 +); +if(realx<0 || realx>=w, +if(XEdgeType==1, +realx=realx%w; +if(realx<0,realx=w+realx) +); +if(XEdgeType==2, +realx=abs(realx%w); +if(realx=h, +if(YEdgeType==1, +realy=realy%h; +if(realy<0,realy=h+realy) +); +if(YEdgeType==2, +realy=abs(realy%h); +if(realy] +sh. 0 +f. " +begin( +red_rotations=$1; +green_rotations=$2; +blue_rotations=$3; +if ($4==1,direction=-1,direction=1); +); +X=(2*x/(w-1))-1; +Y=1-(2*y/(h-1)); +a=atan2(Y,X); +if (a<0,a=a+(2*pi)); +r=sqrt(X*X+Y*Y); +RRR=sin(r*red_rotations*pi*2+a*direction+2*pi)*0.5+0.5; +GGG=sin(r*green_rotations*pi*2+a*direction+2*pi)*0.5+0.5; +BBB=sin(r*blue_rotations*pi*2+a*direction+2*pi)*0.5+0.5; +i(#0,x,y,0,1)=GGG*255; +i(#0,x,y,0,2)=BBB*255; +RRR*255" +rm. +done done +#@cli shape_dragonfly : _size>=0 +#@cli : Input a 2d dragonfly binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_dragonfly , +shape_dragonfly : check "${1=512}>=0" +e[^-1] "Input a $1x$1 dragonfly binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBpbnQgbGl0dGxlX2VuZGlhbgoxIDEyMTcgMSAxICMxNjQyCniczZhnjFVFGIYvJVGRJgLSpfcOS28uvSiKgoKioogURSFWFMUGsTcEwW7UoAaixIogRUClCCxV2sLugkAwKLhIkXt835znhsnN8ss//tg8eb5vzjkzc2a+M3cThROJhP4KJeK/BHykQxSdL16YjKKSYmmxjFhOLC9WECuKlcXKYlWxqlhNrCZWF6uLNcWaYi1YW6wt1hHriPXEurCeWB82EBuIDcWGYqOAjcTGsInYRGxaAJuKzWBzsbnYImALsWUaW4mtxNYFsLWYAduIGbCN2LYAthXbi+3OwfZiR7FDwE5iR9hJ7CJ2DthV7CJ2E7vCbmKmeJnYXcwUe4jdA/YUe4i9xJ5ib7G32FfsI74hFhe/i6KoL15OXCHvh1cQf8JnyyuJa+T98SriOvkA3Othg/xycRbrYiP+Or5ZfgXu9bJNPlCcif8aeA1xh/xKcQa+M8134a+x3nbj08mne7b8Ksbpdb+O52bTzuMr634ofmkQXx/F493JOLLpZ1bEc4nvIe5x1rcTzyG+RWws7iWeS9zz4HWaQ3/2M0+eD6+/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34tOTZ85n9aXwT/ix1NAt/Pnn2/Of5eAFfh7/EvK3FX8HX4K/iq/AZ1GGfq33+non/SH4WvoL8bHw5+bfkV4vLyL+NLyX/Lr6Y/Pt8txfhH+AL8Q9p/y0+h/w3+Mf4V/intP+C583F55Ofh39O/jP6P4/8fPJzyX9B/hPyXzJfc8h/jX9E/hvm/wPyC3h/7+ELef/v4IuS8bn4TXwx63kWvoTv9gzc5yuv/+m8/x84L7xMfjnnixfJu756nz5H3u7fX8+Q93nR9WAaebvryVTcdbib+CTtfY5znXuMvOux6+Rkxm93nZ2E+7znOv0A7jrtOn8P7nOgz5MT5Bfi/t07nrz3pb9HY3HXbf+eHh24f4ePxH1+9Pd1ROD+Xg/HXd/9/R9G/32+9HliSJD3+WZQkPd56Yog7/rbN7h/MbF70J8iYhfc/68wiyfPusdZDKZ7Me6X7hecI/5/87Cf/9XT5+W8RHz+LMK82ZN4cfxM4IVoXzQRn5ccL0Hc7fyvptPESyZjP048dOdLBV4U933yC8ify83CsEgyvk+KReHg9lH0L+17LGAxIDI1IDEgMSAjNjIKeJxzZ2Bg8AXiKAYIiAZiIyBOAWIFKF0ExIlAnA7E+UCcB8RpQJwDxJVQdcVAnAFVVwDEqUAcCzUTAKELCFQ=" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d dragonfly shape]" v + +mc_flou: +if $4==0 +to_rgb +apply_gamma[0] $5 +c[0] $6,$7 n[0] 0,255 +s[0] c +apply_gamma[0] $8 +apply_gamma[1] $9 +apply_gamma[2] $10 +a[0,1,2] c +fi ++fx_gradient_norm[0] 0,1.5,0,50.38,1,0 +sharpen[0] $1 +b[1] 0.5 +n[1] 0,255 +equalize[1] 4,0%,98% ++a[0,1] c +b[2] $2 +blend[0,2] alpha,$3 +remove_opacity[0] +k[0] +mc_flou_preview: +gui_split_preview "-mc_flou $*",$-1 +mc_pendraw: +repeat $! l[$>] +split_opacity +l[0] +to_rgb +if $10>0 +[0] +b[0] 1 +negate[0] +luminance[0] +rv[0,1] +blend[0,1] overlay,$10 +fi ++fx_gradient_norm[0] 0,1.5,0,50.38,1,0 +[0] +smooth $1,0.2,1,3,3 +b $2 +sharpen $3 +[0] +r[0] 20,20,1,3,2 +equalize[0] 256,0%,98% +index[3] [0],1,1 +rm[0] +=>[0] linee +=>[1] orig +=>[2] pen +if $7==0 +rv[pen,linee] +blend[pen,linee] multiply,1 +elif $7==1 +rv[orig,linee] +blend[orig,linee] multiply,1 +fi +n[0] 5,250 +autoindex[0] $4,$5 +rv[0,1] +blend[0,1] value,$6 +if $8==1 +equalize 21,30,$9 +fi +done a c done done +mc_pendraw_preview: +gui_split_preview "-mc_pendraw $*",$-1 +fx_tk_about : +fx_logo "Tom Keil's Filters" +tk_fx_channel_processing : +fx_channel_processing {$3*100/255},{$2<1?-min(1,$2-1)*100:min(1,0.25*($2-1))*100},{log($1)},${4--1} +tk_fx_select_color : +($4^$5^$6^$7) _fx_select_color. $1 color={^} rm. +repeat $! +if $8==0 ++_fx_select_color. $1 +select_color. $2%,$color +b. $3% +if $9 *. -1 +. 1 fi +to_rgba.. s.. c *[-2,-1] a[-4--1] c +else +_fx_select_color. $1 +select_color. $2%,$color +b. $3 +if $9 *. -1 +. 1 fi +*. 255 r. 100%,100%,1,4 +fi +mv. 0 done +tk_fx_replace_color : +to_rgba replace_color $1,$2%,${3--1} c 0,255 +fx_tk_retouch : +repeat $! l[$>] +if $8==1 ++fx_edges $5,$4,0,0 fx_gaussian_blur {$5*5},0,0,1,1,0,0 +else ++to_rgba[0] +to_gray[0] fx_edges[2] $5,$4,0,0 +fx_gaussian_blur[2] {$5*5},0,0,1,1,0,0 to_gray[2] +to_rgba[0] +negate[2] +fx_highpass[1] {$1},2,1,1,0 +fx_gaussian_blur[1] $2,0,0,1,1,0,0 +to_rgba[0] +if $9==1 +to_rgba[0] channels[5] 0 +tk_fx_channel_processing[5] 1,1,4,0,0,0,100,256,0,0,0,2,7,0 +fx_gaussian_blur[5] {{w+h}/1000},0,0,1,0,0,0 to_gray[5] fi +split[1] c reverse[4,5] compose_multiply[4,5] +if $9==1 reverse[4,-1] compose_multiply[4,-1] fi +append[-6,-5,-4,-3] c +reverse[0,1] fx_compose_softlight[0,1] {$3/5} +fx_unsharp.. 0,$6,30,$7,0.00,1.00,0.5,1,0,7,0 +split.. c reverse[-1,-2] compose_multiply[-1,-2] append[-4,-3,-2,-1] c +blend[0,1] alpha +fi +done done +fx_tk_retouch_preview : +gui_split_preview "fx_tk_retouch ${1--2}",$-1 +fx_tk_dof : +if $8==0||$8==1 if $!!=1 error[] "Select input mode ACTIVE. This option is available for single layer only." fi fi +if $8==2||$8==3 if $15==3||$15==4||$17==3 error[] "Option not available for individual mask" fi fi +if $8==2||$8==3 if $!!=2 error[] "For individual mask select input mode ACTIVE AND BELOW" fi fi +tr={$5} dfs={$6} bsi={$11} bsb={$12} +if $19==1 scdo=50 scup=200 tr={$5/2} dfs={$6/2} bsi={$11/2} bsb={$12/2} fi +if $19==2 scdo=25 scup=400 tr={$5/4} dfs={$6/4} bsi={$11/4} bsb={$12/4} fi +if $8==0||$8==1 +if $19!=0 +r[0] $scdo%,$scdo% else [0] fi +else +if $19!=0 r. $scdo%,$scdo% fi +fi +if $19!=0 +r[0] $scdo%,$scdo% else [0] fi +if $8==2||$8==3 rv[-1,-2] fi +if $15==0||$15==1||$15==2 +if $8==0 fx_tk_autodepth. +elif $8==1 fx_tk_depthmap. 1,20,0,0,0,0,0 +elif $8==2||$8==3 fi +if $18!=3 if $8!=2 +if $20==1 to_rgb. ++f. if(i>={{255-$3}+{$4/2}},0,i) ++f. if(i<={{255-$3}-{$4/2}},0,i) compose_darken[-1,-2] +n. 0,255 f. if(i>=1,255,i) rm.. +else +local_similarity_mask. $1,$2,$3,$4,4,0 +fi +blur_xy. $tr +fi fi +fi +if $15==1||$15==3 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,1,180,100,$16 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,180,0,$17 +compose_darken[-1,-2] +fi +if $15==2||$15==4 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,1,90,100,$16 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,0,$17 +compose_darken[-1,-2] +fi +if $15==1||$15==2 rv[-1,-2] compose_lighten[-1,-2] fi +if $15==3||$15==4 rm.. fi +if $18==0||$18==1 +if $14==1 [-1,-2] +blur_xy. {$tr/2} +ir. 1,256 n. 0,255 +tk_fx_replace_color. 1,0,0,0,0,255,0,0,0,0 +inpaint.. . rm[-1,1] rv[-1,-2] +fi +if $7==0 median.. $dfs +elif $7==1 blur_xy.. $dfs +elif $7==2 median.. {$dfs/2} blur_xy. {$dfs/5} +fi +if $9!=0 if $19==0 [0] else +r[0] $scdo%,$scdo% fi +fx_morpho. 1,$bsi,0,{2-$13},0,1,0 +tk_fx_replace_color. {$10*1.765},0,0,0,0,255,0,0,0,0 +blur_xy. $bsb +rv[-1,-3] fx_compose_lighten[-1,-3] $9 +fi +if $19!=0 r[1,2] $scup%,$scup% fi +to_rgba[0] s[0] c rv[3,5] +compose_multiply[3,5] to_gray[3] +a[0,1,2,3] c +if $18==0 rv[0,1] compose_rgba[0,1] fi +fi +if $18!=1 k. fi +if $18==2||$18==3 if $19!=0 r. $scup%,$scup% fi fi +fx_tk_dof_preview : +to_rgba +if $8==0||$8==1 if $!!=1 error[] "Select input mode ACTIVE. This option is available for single layer only." +fi fi +if $8!=2&&$8!=3 +gui_split_preview "fx_tk_dof ${1--2}",$-1 +else fx_tk_dof ${1--1} fi +to_rgba +if $20==0 +line 100%,$2%,{$1+5}%,$2%,1,255,0,0 +line 0%,$2%,{$1-5}%,$2%,1,255,0,0 +line $1%,100%,$1%,{$2+5}%,1,255,0,0 +line $1%,0%,$1%,{$2-5}%,1,255,0,0 +fi +fx_tk_infrared : +repeat $! l[$>] ++fx_hsv_equalizer 0,120,{240*$4},{if({$2==0},0,$3)},{if({$2==0},-$1,{-1+$2})},$1,240,{120*$6},$5,0,-$1,0,0,0,0,0 +b. $7 fx_compose_alpha $1,0 +tk_fx_channel_processing 1,$9,$8,0,0,0,100,256,0,0,0,2,0,0 +fx_mix_lab 1,0,0,$10,0,0,$10,0,0,0,2,0 +if $11==1 fx_blackandwhite 0.299,0,0.587,0,0.114,0,1,1,0,0,0,$12,$12,$12,2,{{w+h}/60000},0,0,16,4,0,0,0 fi +done done +fx_tk_infrared_preview : +gui_split_preview "fx_tk_infrared ${1--2}",$-1 +demo_ra: +mathmap_ra "rmath*$1","amath*$2" +demo_xy: +mathmap_xy "xmath*$1","ymath*$2" +fx_fourier_picture_watermark : +rr2d[0] {1,w*$1},{1,h*$1} to_gray[0] threshold[0] 127 +watermark_fourier2 c 0,255 +#@cli watermark_fourier2 : +watermark_fourier2 : +fft[-1] shift[-2,-1] {int(w/2)},{int(h/2)},0,0,2 +[0],[0],1,{s} +j[-3,-2] [-1],3,3,0,0,1,[0] +mirror[0] x +j[-3,-2] [-1],{{-2,w}-2-{0,w}},3,0,0,1,[0] +mirror[0] y +j[-3,-2] [-1],{{-2,w}-2-{0,w}},{{-2,h}-2-{0,h}},0,0,1,[0] +mirror[0] x +j[-3,-2] [-1],3,{{-2,h}-2-{0,h}},0,0,1,[0] +mirror[0] y +rm[-1] shift[-2,-1] -{int(w/2)},-{int(h/2)},0,0,2 ifft[-2,-1] rm[-1] +mv[-1] 1 +rm[0] +gcd_spiralbw_warp : +to_graya. +sh. 0 +eval. " +begin(P=[0,0];M=0;LX=w-1;LY=h-1;D=[1,0];R=[0,-1,1,0];off=0); +if( +(P[0]==LX && (P[1]==M || P[1]==LY)) || (P[0]==M && P[1]==LY), D=R*D); +if((P[0]==M && P[1]==M+1), D=R*D;M++;LX--;LY--); +P+=D; +I(#-2,P[0],P[1])=[off%w,int(off/w)]; +++off; +" +rm. +#@cli invert_rgb +#@cli : Inverts images in the RGB colour space. +invert_rgb: +repeat $! split_opacity +l[0] c 0,255 *[$>] -1 +[$>] 255 done +a c +done +#@cli invert_alpha +#@cli : Inverts the alpha channel of images. +invert_alpha: +repeat $! split_opacity +l[1] c 0,255 *[$>] -1 +[$>] 255 done +a c +done +#@cli index_table: 0begin(index=-1);index+=1;index" +mathmap_flag: +mathmap_xy "xmath","ymath+$1*sin(pi*$2/1*(-xmath+$4*2*$3/$2))" +mathmap_rel2ellv3: +mathmap_xy "xmath/sqrt(1-4*(ymath/H)*(ymath/H))","ymath/sqrt(1-4*(xmath/W)*(xmath/W))" +mathmap_spiral: +q="sin(rmath*$1*pi*2-amath+$2*2*pi)*0.5+0.5" +mathmap_grayColor $q +mathmap_xy: +e[^-1] "mathmap xy: fonction with formulas : "$1" and "$2"." +repeat $! l[$>] +{w},{h},1,1 [-1] rv +f[0] "H=2*h/max(w,h);W=2*w/max(w,h);x0=(w-1)/2+1e-10; y0=(h-1)/2; xmath=(x-x0)*W/w; ymath=-(y-y0)*H/h; ($1)*w/W+x0" +f[1] "H=2*h/max(w,h);W=2*w/max(w,h);x0=(w-1)/2+1e-10; y0=(h-1)/2; xmath=(x-x0)*W/w; ymath=-(y-y0)*H/h; -($2)*h/H+y0" +a[0,1] c +warp[-1] [0],0,1,0 +k[-1] +done done +mathmap_ra: +e[^-1] "mathmap ra: fonction with formulas : "$1" and "$2"." +repeat $! l[$>] +{w},{h},1,1 [-1] rv +f[0] "x0=(w-1)/2+1e-10; y0=(h-1)/2; rmath=((x-x0)^2+(y-y0)^2)^0.5*2/w; amath=(atan(-(y-y0)/(x-x0))+pi/2*(sign(x-x0)-1))%(2*pi); x0+($1)*x0*cos($2)" +f[1] "x0=(w-1)/2+1e-10; y0=(h-1)/2; rmath=((x-x0)^2+(y-y0)^2)^0.5*2/w; amath=(atan(-(y-y0)/(x-x0))+pi/2*(sign(x-x0)-1))%(2*pi); y0-($1)*x0*sin($2)" +a[0,1] c +warp[-1] [0],0,1,0 +k[-1] +done done +mathmap_grayColor: +e[^-1] "mathmap grayColor: fonction with formulas : "$1"." +repeat $! l[$>] +r 100%,100%,1,1 +f "H=2*h/max(w,h);W=2*w/max(w,h);x0=(w-1)/2+1e-10; y0=(h-1)/2; rmath=((x-x0)^2+(y-y0)^2)^0.5*2/w; amath=(atan(-(y-y0)/(x-x0))+pi/2*(sign(x-x0)-1))%(2*pi); ($1)" +n 0,255 to_rgba +done done +fx_custom_code : skip "${1=-skip ,}" +({'{/"$1"}'}) discard. 92,10 _gcp_arg={t} rm. +m "_fx_custom_code_start : "$_gcp_arg +if $4 +_nb_in=$! +_dim_in="" sep="" +foreach { _dim_in=$_dim_in$sep"["$>"] = "{w}x{h}x{d}x{s}", in ["{_round([im,iM],0.1)}"]" sep="\n" } +fi +if $2 +ac "_fx_custom_code_start _status_out=${}",{$2-1},$3 +else +_fx_custom_code_start _status_out=${} +if $3==1 c 0,255 elif $3==2 n 0,255 fi +fi +if $4 +_nb_out=$! +_dim_out="" sep="" +foreach { _dim_out=$_dim_out$sep"["$>"] = "{w}x{h}x{d}x{s}", in ["{_round([im,iM],0.1)}"]" sep="\n" } +fi +um _fx_custom_code_start +fx_custom_code_preview : skip "${1=-skip ,}" +w={w} h={h} +l { +({'{/"$1"}'}) discard. 92,10 _gcp_arg={t} rm. +if $6 gui_split_preview "fx_custom_code $_gcp_arg,${2--2}",${-3--1} +else fx_custom_code $_gcp_arg,${2--2} +fi +onfail +error_msg=${} +rr2d $w,$h,2,1 +gui_print_preview "Syntax error:",,{``$error_msg},20,40 +} +if $4 +if !$3 % 256 fi +if $!>1 gui_preview fi +rr2d $_preview_area_width,$_preview_area_height,0,1 +siz0=13 siz1=17 siz2=19 siz3=22 +if ['$_status_out']==0 _status_out=(empty) fi +info="Input images: "#$_nb_in"\n"$_dim_in"\n\n""Output images: "#$_nb_out"\n"$_dim_out"\n\n""Output status: "$_status_out +0 t. {``$info},0,0,${siz$5},1,255 expand_xy. 5,0 +dilate. 3 a[-2,-1] c +rr2d[^-1] ${-max_wh},2,2 +r. ..,..,1,100%,0 drgba[^-1] +/[^-1] 2 blend[^-1] .,alpha rm. +fi +fx_output_565 : +output_565 "$1",$2 +fx_gmic_demos : +coms=2048,blobs,bouncing,connect4,fire,fireworks,fisheye,fourier,hanoi,histogram,hough,jawbreaker,landscape,life,light,mandelbrot,metaballs3d,minesweeper,minimal_path,pacman,paint,plasma,quantize_rgb,reflection3d,rubber3d,shadebobs,spline,starfield3d,tetris,tictactoe,waves,whirl +com=${arg\ {1+$1},$coms} +if $!>0 sel=0 else sel= fi ++l[$sel] { m "foo : x_"$com foo rm um foo } +fx_gmic_demos_preview : +rm input_cached img/gmic_demos.cimgz k[$1,-1] rows. $1 map[0] [1] k[0] +fx_display_histogram : +mode=${arg0\ $2,all,rgba,rgb,rgb_r,rgb_g,rgb_b,rgba_a,lrgb,lrgb_r,lrgb_g,lrgb_b,ycbcr_y,ycbcr_cbcr,ycbcr_cb,ycbcr_cr,ycbcr_cg,lab_l,lab_ab,lab_a,lab_b,lch_ch,lch_c,lch_h,hsv_h,hsv_s,hsv_v,hsi_i,hsl_l,cmyk_c,cmyk_m,cmyk_y,cmyk_k,yiq_y,yiq_iq} +_ac_$mode m "_ac_precond : "$_p m "_ac_forward : "$_f m "_ac_backward : "$_b +foreach { +_ac_precond _ac_forward[0] channels $_s +display_histogram {w},{h},$1,0,255 +if s==2" || "s==4 channels 0,2 fi +} +fx_import_image : skip "${1=}" +rm i "$1" s z if $2 n 0,255 else c 0,255 fi +fx_input_565 : skip "${1=}" +l[] { +check "isint($2) && $2>0 && isint($3) && $3>0" +onfail error "Invalid Specified Dimensions" +} +if ['"$1"']==0 gui_warning_preview "Choose a filename" +elif !isfile(['"$1"']) gui_warning_preview "Filename not found!" +else input_565 "$1",${2-4} mv. 0 +fi +fx_intarsia : +to_rgb ++foreach { +nm=${gui_layer_name.} +if max(w,h)>$3 rr2d $3,$3,0 fi ++colormap 0 +if w>$4 rm. +colormap $4,1 fi +round[1] index[0] [1] +0 => $nm ('{b}') f. 'if(x,i,if(i>=97&&i<=122,i-32,i))' image_basename={t} rm[-2,-1] +('"\n\n
\n

"$image_basename" ("{0,w}x{0,h}")

\n
\n\n"') +0 => "$2" image_name={b} rm. +nb_cols={1,w} +repeat $nb_cols { +color={1,I($>)} +R={arg(1,$color)} G={arg(2,$color)} B={arg(3,$color)} +('${dec2hex\ {$R*65536+$G*256+$B}}') -. {'0'} r. 6,1,1,1,0,0,1,0 +. {'0'} +f. if(i>=_'a'" && "i<=_'z',i+_'A'-_'a',i) +hcolor={t} rm. +48,32,1,4 fc. $color,255 frame. 1,1,0,0,0,255 o. "$1/"${image_name}_$>.png rm. +('"\n"') +} +('"
Colour "$>".png"\" />#"$hcolor"
\n
"') +starting=${"arg {1+$5},\"Top left\",\"Top right\",\"Bottom left\",\"Bottom right\""} +label=${"arg {1+$6},Row,Column"} +if $6 dir0="T → B" dir1="B → T" else dir0="L → R" dir1="R → L" fi +dir={arg(1+2*$5+$6,0,0,1,0,0,1,1,1)} ++map[0] [1] ++fx_intarsia_preview. ${1-7},63 drgba. +rr2d.. 200,200,1,1 +to_rgba[-2,-1] frame[-2,-1] 1,1,0,0,0,255 frame[-2,-1] 0,20,0,0,0,0 +t.. "Result",0,0,16,1,0,0,0,255 +t. "Ordering overview",0,0,16,1,0,0,0,255 +frame[-2,-1] 20,20,0,0,0,0 +o.. "$1/"${image_name}_A.png +o. "$1/"${image_name}_B.png +rm[-2,-1] +('"
""
\n"') +if $7 ('"

Additional comments:

\n"') fi +('"

Starting point: "$starting"          Orientation: "$label" by "$label"

\n"') +rm[1] +('"\n"') +_fx_intarsia[0] $5,$6,0 ++l[0] { +s y +foreach { +if $>%2 mirror. x fi +im={im} compress_rle 0,0 rows 6,100% +('"\n"') +rm[0] a x +dir={!$dir} +} +a x +} +rm[0] +('"
"$label" "{1+$>}""${dir$dir}"\n"') +i=0 n=0 do +val={0,i[$i]} i+=1 +if $val>=0 occ=1 +else +occ={-$val} +val={0,i[$i]} +if $val<0 val=0 else i+=1 fi +fi +val+=$im +('"colour:"$val" "$occ') +if {0,$i\n"') fi +while $i
\n
\n"') +a x ot "$1/$2" +rm +} +fx_intarsia_preview : +to_rgb +foreach { +if max(w,h)>$3 rr2d $3,$3,0 fi +to_rgba +_fx_intarsia $5,$6,0 +100%,100%,1,1,'if(y%2,y*w+w-1-x,y*w+x)<$8*wh/100' * +if min(w,h)<140 rr2d 140,140,1,1 fi +expand_xy 16,0 +100%,100% circle. 16,16,1%,1,1 +arrow3d. 0,0,0,{w/4},0,0,2%,15%,10% col3d. 1 j3d.. .,16,16,0,1,2,0,0 rm. ++dilate. 3 r.. 100%,100%,1,3,0,0,0,0,0,0.5 a[-2,-1] c *. 255 +blend alpha +_fx_intarsia $5,$6,1 +} +_fx_intarsia : +if $3" && "$2 transpose fi +if $1==0 +elif $1==1 +mirror x +elif $1==2 +mirror y +elif $1==3 +mirror xy +fi +if !$3" && "$2 transpose fi +fx_image_sample : +if $1 sp {$1-1},$2,$3 else sp ?,$2,$3 fi +mv. 0 +fx_image_sample_preview : +w={w} h={h} rm +fx_image_sample $1,{$w>$h?$w:0},{$h>$w?$h:0} +fx_solve_maze : +repeat $! { ++norm. >=. 50% +if !$10 negate. fi +*. 255 +b. $5% *.. 1e10 +[-2,-1] +minimal_path. $1%,$2%,0,$3%,$4%,0 transpose. +pointcloud. 0 dilate. $6 r. ..,..,1,1,0 +to_rgba. +replace_color. 0,0,1,1,1,255,${7-9},255 +replace_color. 0,0,0,0,0,255,0,0,0,0 +ellipse. $1%,$2%,5,5,0,1,${7-9},255 +ellipse. $3%,$4%,5,5,0,1,${7-9},255 +rv[-2,-1] +mv[-2,-1] 0 } +fx_solve_maze_preview : +drgba +line $1%,$2%,$3%,$4%,1,0xCCCCCCCC,${7-9} +ellipse $1%,$2%,3,3,0,1,${7-9} +ellipse $1%,$2%,3,3,0,1,0x1,0 +ellipse $3%,$4%,3,3,0,1,${7-9} +ellipse $3%,$4%,3,3,0,1,0x1,0 +#@cli :: Additional Gallery Images +#@cli _gallery_arrays +#@cli : This entry defines some examples of array filters for the G'MIC gallery page. +#@cli : $ image.jpg fx_frame_blur 30,30,0,5,0,0,128,128,128,0,5,255,255,255,2,2,1,0,0.5,0.5,0 _label="Frame~[blur]" +#@cli : $ sample tiger,leno,monkey,duck,eagle frame 3,3,0 frame 3,3,255 montage A _label="Montage" +#@cli : $ image.jpg fx_puzzle 5,5,0.5,0,0,0.3,100,0.2,255,100,0,0,0,0,0,0 _label="Puzzle" +#@cli _gallery_artistic +#@cli : This entry defines some examples of artistic filters for the G'MIC gallery page. +#@cli : $ image.jpg fx_engrave 0.5,4,0,7.68,15.2,0,0,1,10,1,0,0,0,1,0 gui_merge_layers _label="Engrave" +#@cli : $ image.jpg fx_bokeh 3,8,0,30,8,4,0.3,0.2,210,210,80,160,0.7,30,20,20,1,2,170,130,20,110,0.15,0 _label="Bokeh" +#@cli : $ image.jpg fx_8bits 25,800,16,0 _label="Oldschool~8bits" +#@cli : $ image.jpg fire_edges 0.7,0.25,0.5,25,20 _fps=6 _label="Edges~on~fire" +#@cli : $ image.jpg fx_diffusiontensors 10,5,3,1,0.15,1,0,3,0 _label="Diffusion~tensors" +#@cli : $ image.jpg fx_dreamsmooth 3,1,1,0.8,0,0.8,1,24,0 _label="Dream~smoothing" +#@cli : $ image.jpg fx_feltpen 300,50,1,0.1,20,5,0 _label="Felt~pen" +#@cli : $ image.jpg gtutor_fpaint 0.5,0.5,0,0,45,0.5,0.5,0.5,0 _label="Finger~paint" +#@cli : $ image.jpg fx_graphic_novelfxl 0,2,6,5,20,0,0.62,14,0,1,0.5,0.78,1.92,0,0,0,1,1,1,0.5,0.8,1.28 _label="Novel~FX" +#@cli : $ image.jpg fx_illustration_look 100,0,0,0,0 _label="Illustration~look" +#@cli : $ image.jpg fx_lylejk_painting 10,2,4,10,0 _label="Lylejk~painting" +#@cli : $ image.jpg fx_painting 5,2.5,1.5,50,1,0 _label="Painting" +#@cli : $ image.jpg fx_posterize 150,30,1,6,0,0,1,0 _label="Posterize" +#@cli : $ image.jpg fx_quadtree 2,1024,1.05,0,2.33,0.68,0.39,1,0 _label="Quadtree~variations" +#@cli : $ image.jpg fx_vector_painting 9.37,0 _label="Vector~painting" +#@cli : $ image.jpg cl_comic 0,2,0,1,1,15,15,1,10,20,6,2,0,0,0,0,0,0,50,50 _label="Comic~Book" +#@cli : $ image.jpg fx_cpencil 1.3,50,20,2,2,1,0 _label="Colored~Pencils" +#@cli : $ image.jpg fx_paint_with_brush 6,"6",1,16,30,100,100,0,95,0.5,8,-1,-1,2,2,30,0,0,0,100,20,1,0,0,0,30,0,0,0,0,0,0,1,45,0,0,50,50 _label="Whirls" +#@cli : $ image.jpg fx_paint_with_brush 5,"5",0,16,10,100,100,10,80,0.5,3,135,50,6,1,20,0,0,0,90,3,10,0,0,0,30,0,15,15,15,15,15,1,45,0,0,50,50 _label="Fuzzy~Painting" +#@cli : $ sample portrait4 blur 1 fx_polygonize_delaunay 40,5,75,0.5,3,50,0,0,0,255,1,0,50,50 _label="Polygonize" +#@cli : $ image.jpg fx_posterize 150,30,1,12,0,0,0,0,50,50 _label="Posterize" +#@cli : $ sample portrait2 samj_Test_Skeletik 10,1,0,0,0,3,1,0,0,0,255 _label="Skeletik" +#@cli : $ sample portrait6 fx_sketchbw 3,45,180,30,1.75,0.02,0.5,0.75,0.1,0.7,3,6,0,1,4,0,0,50,50 _label="Sketch" +#@cli : $ image.jpg warhol 3,3,2,40 _label="Warhol" +#@cli _gallery_blackandwhite +#@cli : This entry defines some examples of black-and-white filters for the G'MIC gallery page. +#@cli : $ image.jpg fx_freaky_bw 90,20,0,0,0,0 _label="Freaky~B&W" +#@cli : $ image.jpg fx_engrave 0.5,50,0,8,40,0,0,0,10,1,0,0,0,1,0 _label="Engrave" +#@cli : $ image.jpg fx_gcd_layeretch 11,4,12,0.12,100,8.5,5,0,0,3,1,1,0 _label="Multi-layer~etch" +#@cli : $ image.jpg fx_pencil_portraitbw 30,120,1,0.5,144,79,21,0 _label="Pencil~portrait" +#@cli : $ image.jpg fx_gcd_etch 125,153,171,185,0.1,50,80,50,10,15,12,20,0,1,0.3,1,0,0 _label="Threshold~etch" +#@cli : $ image.jpg fx_ghost 200,2,2,1,3,16,0,0,50,50 _label="Ghost" +#@cli : $ image.jpg cl_lineart 0,0,2,1,15,15,1,0,6,2,2,0,0,0,50,50 _label="Lineart" +#@cli : $ image.jpg gcd_emboss 128,0 _label="Emboss" +#@cli _gallery_colors +#@cli : This entry defines some examples of color filters for the G'MIC gallery page. +#@cli : $ image.jpg fx_color_abstraction 1,10,0.2,0 _label="Color~abstraction" +#@cli : $ image.jpg fx_boost_chroma 90,0,0 _label="Boost~chromaticity" +#@cli : $ image.jpg fx_retrofade 20,6,40,0 _label="Retro~fade" +#@cli : $ image.jpg fx_tk_vintage 2,0.85,0.7,80,200,5,147,26,161,0.3,235,220,176,0.4,190,181,108,0.2,0,0,100,0,0.3,25,0,0 _label="Vintage~style" +#@cli : $ image.jpg fx_retinex 75,16,1,1,1,5,15,80,250,0,50,50 _label="Retinex" +#@cli _gallery_deformations +#@cli : This entry defines some examples of deformation filters for the G'MIC gallery page. +#@cli : $ image.jpg animate "flower","30,10,0,0","30,10,0,360",10 rm. _fps=6 _label="flower" +#@cli : $ image.jpg fx_conformal_maps 8,1,0,"((1.1 + i*z/6)/(1.04 - i*z/6))^6.2",0,0,0,0,0,3,0,0,"1024","1024" _label="Conformal~maps" +#@cli : $ image.jpg souphead_droste10 40,100,1,1,1,0,0,0,0,0,1,10,1,0,90,0,0,0,0,1,0,1,1,0,0,0,0,0,1,0,0 _label="Continuous~droste" +#@cli : $ image.jpg fx_crease 30,10,3 _label="Crease" +#@cli : $ image.jpg fx_distort_lens 0.29,0,0.23,50,50,0,0 _label="Distort~lens" +#@cli : $ image.jpg fx_drop_water 0,20,2,80,0,3,35,10,1,0.5,0.25,0.5,0.75,0.05,0.15,1 gui_merge_layers _label="Drop~water" +#@cli : $ image.jpg fx_reflect 50,1,110,160,190,64,0,1.5,0,-3.3,7,1.5 _label="Reflection" +#@cli : $ image.jpg fx_square_circle 0,1,0,0,0,0,0,0 _label="Square~to~circle" +#@cli : $ image.jpg fx_textured_glass 40,40,1,1,0,2,0,0 _label="Textured~glass" +#@cli : $ sample lena,leno,320 morph 40 _fps=5 _label="morph" +#@cli : $ image.jpg fx_breaks 0,30,30,0.5,3 _label="Breaks" +#@cli : $ image.jpg fx_circle_transform 50,50,75,50,-2,-2,0,1,3,1 _label="Circle~Transform" +#@cli : $ image.jpg fx_symmetrizoscope 4,45,3,0 _label="Kaleidoscope" +#@cli : $ image.jpg fx_spherize 50,1,0,50,50,0,0,2,0 _label="Spherize" +#@cli _gallery_filtering +#@cli : This entry defines some examples of filters for the G'MIC gallery page. +#@cli : $ image.jpg fx_gcd_crt 1.8,1.8,0,0 equalize 256 _label="CRT~sub-pixels" +#@cli : $ image.jpg fx_dirty 30,1,0,0,0 _label="Dirty" +#@cli : $ image.jpg fx_freaky_details 2,10,1,11,0,32,0 _label="Freaky~details" +#@cli : $ image.jpg jeje_normalize_local_variance 50,5,5,1,0,0 _label="Local~variance~normalization" +#@cli : $ image.jpg fx_mighty_details 25,1,25,1,11,0 _label="Mighty~details" +#@cli : $ image.jpg samj_Barbouillage_Paint_Daub 2,2,100,0.2,1,4,1,0,8 _label="Barbouillage" +#@cli : $ image.jpg fx_blur_bloom 1,2,5,0,1,0,0,0,7,0,50,50 _label="Blur~Bloom" +#@cli : $ image.jpg fx_glow 6,7,0,0,50,50 _label="Glow" +#@cli : $ image.jpg fx_jpeg_artefacts 25,0,50,50 _label="JPEG~Artefacts" +#@cli : $ image.jpg fx_lomo 20,0,50,50 _label="Lomo" +#@cli : $ image.jpg fx_noise_perlin 0,100,8,0,0,4,0,0,2,0,0,1,0,2,0,50,50 _label="Perlin~Noise" +#@cli _gallery_patterns +#@cli : This entry defines some examples of pattern filters for the G'MIC gallery page. +#@cli : $ image.jpg fx_rain 65,10,50,0.1,1,1,0 gui_merge_layers _label="Rain~&~snow" +#@cli : $ 400,400,1,3 fx_camouflage 9,12,100,30,46,33,75,90,65,179,189,117,255,246,158 _label="Camouflage" +#@cli : $ image.jpg jeje_clouds 50,0.5 _label="Clouds" +#@cli : $ image.jpg fx_crystal 50,0.2,20,0 _label="Crystal" +#@cli : $ 400,400,1,3 fx_crystal_background 10,25,0,100,1 _label="Crystal~background" +#@cli : $ image.jpg fx_marble 0.5,1,0,0,0.4,0.6,0.6,1.1,0,100 _label="Marble" +#@cli : $ image.jpg fx_mineral_mosaic 1,2,1,100,0 _label="Mineral~mosaic" +#@cli : $ image.jpg fx_shapes 1,16,10,2,5,106.8,2,0,0,1,0 _label="Op~art" +#@cli : $ 400,400,1,3 fx_satin 20,1,0,0,0,0,255,255,255,255,255,0,0,0,-50,0,0 _label="Satin" +#@cli : $ 400,400,1,3 fx_seamless_turbulence 15,20,0,1,3,1 _label="Seamless~turbulence" +#@cli : $ image.jpg fx_shockwaves 10,10,20,0,0 _label="Shock~waves" +#@cli : $ 400,400,1,3 fx_equation_parametric "sin(t)*(exp(cos(t))-2*cos(4*t)-sin(t/12)^5)","cos(t)*(exp(cos(t))-2*cos(4*t)-sin(t/12)^5)",0,100,4096,1,0,64,0,0,128,0,0,1,1,1 _label="Equation~plot~[parametric]" +#@cli : $ 400,400,1,3 KittyRings 30,8,0,1,113,0,113,0,255,0 _label="Kitaoka~spin~illusion" +#@cli : $ 400,400,1,3 fx_neon_lightning 50,50,0,50,50,100,50,0.7,3,130,80,50,0.25,0 _label="Neon~lighting" +#@cli : $ image.jpg fx_lava 8,5,3,0,0 _label="Lava" +#@cli : $ sample monkey,lion,monkey 100%,100% plasma. equalize. 256 transition[0,1,2] [3],10 rm. _fps=10 _label="transition" +#@cli : $ image.jpg fx_shapeism 2,7,0.38,0,1,5,32,8,3,1,5,0.5,1,0,0,0,255 _label="Shapeism" +#@cli : $ image.jpg fx_generic_halftone 0,1,100,12,1,0,4,0,90,1,0,0 _label="Halftone" +#@cli : $ image.jpg fx_rebuild_from_similar_blocks 5,10,0.75,1 _label="Rebuild~From~Similar~Blocks" +#@cli : $ image.jpg fx_warp_by_intensity 1.62,0.6,128,128,0,1,3,0,0,50,50 _label="Warp~by~Intensity" +#@cli : $ image.jpg fx_memoakten_algorithm_a 0,20,30,30,2,50,10,50,40,3,60,1,0,0,0,255,255,255,255,0,0,255,128,0,255,255,0,0,0,0 _label="Algorithm A" +#@cli _gallery_3dmeshes +#@cli : This entry defines some examples of 3D rendering filters for the G'MIC gallery page. +#@cli : $ sample leno,lion,leno resize 400,400 transition3d 20,5,5 rm. _fps=10 _label="transition3d" +#@cli : $ 256,192 fx_text_pointcloud3d 64,"G'MIC","Rocks!",1,200,220,255,255,255,255,255,2,2,1,19 _fps=10 _label="3D~text~pointcloud" +#@cli : $ sphere3d 10 repeat 5 { +add3d[-1] 10,{u(-10,10)},0 color3d[-1] ${-rgb} } add3d _fps=10 _label="3D~Spheres" +#@cli : $ repeat 20 { torus3d 15,2 color3d[-1] ${-rgb} mul3d[-1] 0.5,1 if $>%2 rotate3d[-1] 0,1,0,90 fi add3d[-1] 70 add3d rotate3d[-1] 0,0,1,18 } double3d 0 _fps=10 _label="3D~Ring" +#@cli : $ image.jpg distribution3d circles3d 5 o3d 0.5 colorcube3d primitives3d[-1] 1 add3d _fps=10 _label="RGB~Color~Distribution" +#@cli : $ image.jpg blur 5 elevation3d. 0.75 _fps=10 _label="3D~Elevation" +#@cli : 128,128,1,3,u(255) plasma 10,3 blur 4 sharpen 10000 n 0,255 elevation3d[-1] 'X=(x-64)/6;Y=(y-64)/6;-100*exp(-(X^2+Y^2)/30)*abs(cos(X)*sin(Y))' _fps=10 _label="3D~Elevation" +#@cli : $ gmic3d _fps=10 _label="3D~G'MIC~Logo" +#@cli : $ image.jpg resize2dy 32 imageblocks3d -20 mode3d 3 _fps=10 _label="3D~Image~Blocks" +#@cli : $ image.jpg imagerubik3d , _fps=10 _label="Rubik~Cube" +#@cli : $ shape_cupid 480 skeleton3d , _fps=10 _label="3D~Skeleton" +#@cli : $ spherical3d "abs(1+0.5*cos(3*phi)*sin(4*theta))" _fps=10 _label="3D~Spherical~Function" +#@cli : $ 6,6,6,9,"U = [x,y,z] - [w,h,d]/2; U/=norm(U); mul(U,U,3) + 0.3*eye(3)" tensors3d 0.8 _fps=10 _label="3D~Tensors" +#@cli : $ text3d "G'MIC Rocks!" _fps=10 _label="3D~Text" +#@cli : $ torus3d 10,3 color3d[-1] ${-rgb} _fps=10 _label="3D~Torus" +#@cli : $ weird3d 48 color3d[-1] ${-rgb} _fps=10 _label="3D~Weird" +#@cli _gallery_stylization +#@cli : This entry defines some examples of image stylization for the G'MIC gallery page. +#@cli : $ sample car _fx_stylize starrynight _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,5,2,1.85,0 _label="from~Van~Gogh:~Starry~Night" +#@cli : $ sample car _fx_stylize graytree _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,2,2,1.85,0 _label="from~Mondrian:~Gray~Tree" +#@cli : $ sample car _fx_stylize yellowredblue _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,10,2,1.85,0 _label="from~Kandinsky:~Yellow-Red-Blue" +#@cli : $ sample car _fx_stylize littlebayatlaciotat _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,2,2,1.85,0 _label="from~Braque:~Little~Bay~at~La~Ciotat" +#@cli : $ sample car _fx_stylize leviaducalestaque _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Braque:~Le~Viaduc~a~l'Estaque" +#@cli : $ sample car _fx_stylize greatwave _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Hokusai:~The~Great~Wave" +#@cli : $ sample elephant input ../img/hatching.png _output_mode=1 +fx_stylize 1,4,0,0,1,2,3,0.5,0.1,3,3,0,0.7,0,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Hatch~Drawing" +#@cli : $ sample cat input ../img/hatching.png _output_mode=1 +fx_stylize 1,4,0,0,1,2,3,0.5,0.1,3,3,0,0.7,0,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Hatch~Drawing" +#@cli : $ sample bottles _fx_stylize starrynight _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Van~Gogh:~Starry~Night" +#@cli : $ sample cat _fx_stylize summertime9a _output_mode=1 +fx_stylize 1,6,0,0,2,0,1,0.5,0.1,3,3,0,0.7,0,2,1,0,5,5,7,1,130,10,2,1.85,0 _label="from~Pollock:~Summertime~No~9A" +#@cli : $ sample cat _fx_stylize greatwave _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Hokusai:~The~Great~Wave" +#@cli : $ sample dog _fx_stylize convergence _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,5,2,1.85,0 _label="from~Pollock:~Convergence" +#@cli : $ sample dog _fx_stylize irises _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,1,5,0,0.7,1,0,1,0,5,5,7,1,30,20,2,1.85,0 _label="from~Van~Gogh:~Irises" +#@cli : $ sample mandrill _fx_stylize themandola _output_mode=1 +fx_stylize 1,5,0,0,0,3,1,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Braque:~The~Mandola" +#@cli : $ sample square _fx_stylize orientalpleasuregardenanagoria _output_mode=1 +fx_stylize 1,6,0,0,0.52,0.5,3,0.14,0.1,3,3,0,0.7,3.39,0,1,0,5,5,7,5,30,4,2,1.85,0 _label="from~Klee:~Oriental~Pleasure~Garden~Anagoria" +#@cli : $ sample monalisa _fx_stylize squareswithconcentriccircles _output_mode=1 +fx_stylize 1,4,0,0,0.15,3,2,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Kandisnky:~Squares~with~Concentric~Circles" +#@cli : $ sample monalisa _fx_stylize inthestyleofkairouan _output_mode=1 +fx_stylize 1,4,2,0,0.15,3,2,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,5,2,1.85,0 _label="from~Klee:~In~the~Style~of~Kairouan" +#@cli : $ sample square _fx_stylize polyphony2 _output_mode=1 +fx_stylize 1,6,0,0,0.15,3,2,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Klee:~Polyphony~2" +#@cli : $ sample square _fx_stylize wheatstacksendofsummer _output_mode=1 +fx_stylize 1,6,0,0,0.15,3,2,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Monet:~Wheatstacks~-~End~of~Summer" +#@cli : $ sample square _fx_stylize portraitdemetzinger _output_mode=1 +fx_stylize 1,5,0,0,0.1,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,10,2,1.85,0 _label="from~Delaunay:~Portrait~de~Metzinger" +#@cli : $ sample monalisa input ../img/mandelbrot.jpg _output_mode=1 +fx_stylize 1,3,3,0,0.15,4,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,5,2,1.85,0 _label="from~Mandelbrot~Fractal~Set" +#@cli : $ sample bottles _fx_stylize redtree _output_mode=1 +fx_stylize 1,5,0,0,2.12,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Mondrian:~Evening;~Red~Tree" +#@cli : $ sample bottles _fx_stylize redwaistcoat _output_mode=1 +fx_stylize 1,4,0,0,0.67,3.17,3,0.5,0.06,3,3,0,0.7,5,0,2,0,5,5,7,1,30,5,1.05,1.85,0 _label="from~Klee:~Red~Waistcoat" +#@cli : $ sample bottles _fx_stylize reservoirhortadeebro _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Picasso:~The~Reservoir" +#@cli : $ sample bottles _fx_stylize almondblossom _output_mode=1 +fx_stylize 1,6,0,0,0,3,3,0.5,0.1,3,3,0,0.7,5,0,2,0,5,5,7,1,30,1,2,1.85,0 _label="from~Van~Gogh:~Almond~Blossom" +#@cli : $ sample bottles _fx_stylize landscapenearantwerp _output_mode=1 +fx_stylize 1,6,0,0,2.17,3.65,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Braque:~Landscape~near~Antwerp" +#@cli : $ sample bottles _fx_stylize wheatfieldwithcrows _output_mode=1 +fx_stylize 1,6,0,0,3.86,2,3,0.5,0.1,3,3,0,0.7,3.35,1,1,0,5,5,7,1,30,1,5,1.85,0 _label="from~Van~Gogh:~Wheat~Field~with~Crows" +#@cli _gallery_codesamples +#@cli : This entry defines some examples of coding fun filters for the G'MIC gallery page. +#@cli : $ https://gmic.eu/samples/lissajous.gmic go _fps=10 _label="Lissajous" +#@cli : $ https://gmic.eu/samples/torus3d.gmic go _fps=10 _label="3D~torus" +#@cli : $ https://gmic.eu/samples/pacman.gmic go _fps=25 _label="Pacman" +#@cli : $ https://gmic.eu/samples/scrolling.gmic go _fps=25 _label="Scrolling" +#@cli : $ https://gmic.eu/samples/landscape.gmic go _fps=12 _label="Landscape" +#@cli : $ https://gmic.eu/samples/mandelbrot.gmic go _fps=8 _label="Mandelbrot" +#@cli : $ https://gmic.eu/samples/heart.gmic go _fps=15 _label="Heart" +#@cli : $ https://gmic.eu/samples/distortion.gmic go _fps=20 _label="Distortion" +#@cli : $ https://gmic.eu/samples/rotozoom.gmic go _fps=15 _label="Rotozoom" +#@cli : $ https://gmic.eu/samples/french_flag.gmic go _fps=20 _label="French~Flag" +# Local Variables: +# mode: sh +# End: +# +# (End of G'MIC update file) \ No newline at end of file diff --git a/gmic/update331.gmic b/gmic/update331.gmic new file mode 100644 index 0000000..5a012af --- /dev/null +++ b/gmic/update331.gmic @@ -0,0 +1,126457 @@ +#@gmic +# +# File : update333.gmic +# ( G'MIC command file ) +# +# Description : Update file for G'MIC commands and filters, for version 3.3.3). +# ( https://gmic.eu ) +# +# License : CeCILL v2.1 +# ( https://cecill.info/licences/Licence_CeCILL_V2.1-en.html ) +# +# Generated on : 2023/12/27, 14:02 +# +#@gui パターン +#@gui_ja ロールシャッハ図形:fx_rorschach,fx_rorschach +#@gui_ja :スケール=float(3,0,10) +#@gui_ja :対称軸=choice(1,"なし","X 軸","Y 軸","X 軸と Y 軸") +#@gui_ja :ステンシルの種類=choice(2,"白黒","RGB","色付き") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2011/03/12") +#@gui_ja 迷彩:fx_camouflage,fx_camouflage +#@gui_ja :スケール=int(9,2,12) +#@gui_ja :Levels=int(12,2,32) +#@gui_ja :Coherence=float(100,0,1000) +#@gui_ja :色 1=color(#1e2e21) +#@gui_ja :色 2=color(#4b5a41) +#@gui_ja :色 3=color(#b3bd75) +#@gui_ja :色 4=color(#fff69e) +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2016/10/26") +#@gui _フィルムエミュレーション +#@gui_ja インスタント [業務用]:fx_emulate_film_instant_pro,fx_emulate_film_instant_pro_preview(1)+ +#@gui_ja :プリセット=choice("なし","FUJIFILM FP-100c --","FUJIFILM FP-100c -","FUJIFILM FP-100c","FUJIFILM FP-100c +","FUJIFILM FP-100c ++","FUJIFILM FP-100c ++a","FUJIFILM FP-100c +++","FUJIFILM FP-100c Cool --","FUJIFILM FP-100c Cool -","FUJIFILM FP-100c Cool","FUJIFILM FP-100c Cool +","FUJIFILM FP-100c Cool ++","FUJIFILM FP-100c Negative --","FUJIFILM FP-100c Negative -","FUJIFILM FP-100c Negative","FUJIFILM FP-100c Negative +","FUJIFILM FP-100c Negative ++","FUJIFILM FP-100c Negative ++a","FUJIFILM FP-100c Negative +++","FUJIFILM FP-3000b --","FUJIFILM FP-3000b -","FUJIFILM FP-3000b","FUJIFILM FP-3000b +","FUJIFILM FP-3000b ++","FUJIFILM FP-3000b +++","FUJIFILM FP-3000b HC","FUJIFILM FP-3000b Negative --","FUJIFILM FP-3000b Negative -","FUJIFILM FP-3000b Negative","FUJIFILM FP-3000b Negative +","FUJIFILM FP-3000b Negative ++","FUJIFILM FP-3000b Negative +++","FUJIFILM FP-3000b Negative Early","ポラロイド 665 --","ポラロイド 665 -","ポラロイド 665","ポラロイド 665 +","ポラロイド 665 ++","ポラロイド 665 Negative -","ポラロイド 665 Negative","ポラロイド 665 Negative +","ポラロイド 665 Negative HC","ポラロイド 669 --","ポラロイド 669 -","ポラロイド 669","ポラロイド 669 +","ポラロイド 669 ++","ポラロイド 669 +++","ポラロイド 669 Cold --","ポラロイド 669 Cold -","ポラロイド 669 Cold","ポラロイド 669 Cold +","ポラロイド 690 --","ポラロイド 690 -","ポラロイド 690","ポラロイド 690 +","ポラロイド 690 ++","ポラロイド 690 Cold --","ポラロイド 690 Cold -","ポラロイド 690 Cold","ポラロイド 690 Cold +","ポラロイド 690 Cold ++","ポラロイド 690 Warm --","ポラロイド 690 Warm -","ポラロイド 690 Warm","ポラロイド 690 Warm +","ポラロイド 690 Warm ++") +#@gui_ja :_=separator() +#@gui_ja :不透明度=float(1,0,1) +#@gui_ja :ガンマ=float(0,-1.2,1.2) +#@gui_ja :コントラスト=float(1,0,4) +#@gui_ja :輝度=float(0,-255,255) +#@gui_ja :色相=float(0,-180,180) +#@gui_ja :彩度=float(0,-1,1) +#@gui_ja :事前に正規化=bool(0) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("注: このセクションで使用されているカラー LUT は Patrick David により作成されました。詳細は以下の Web ページをご覧ください。") +#@gui_ja :_=link("Film Emulation Presets in G'MIC","http://gmic.eu/film_emulation/index.shtml") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: Patrick DavidDavid Tschumperlé 最終更新: 2013/08/29") +#@gui_ja インスタント [民生用]:fx_emulate_film_instant_consumer,fx_emulate_film_instant_consumer_preview(1)+ +#@gui_ja :プリセット=choice{"なし","ポラロイド PX-100UV+ Cold --","ポラロイド PX-100UV+ Cold -","ポラロイド PX-100UV+ Cold","ポラロイド PX-100UV+ Cold +","ポラロイド PX-100UV+ Cold ++","ポラロイド PX-100UV+ Cold +++","ポラロイド PX-100UV+ Warm --","ポラロイド PX-100UV+ Warm -","ポラロイド PX-100UV+ Warm","ポラロイド PX-100UV+ Warm +","ポラロイド PX-100UV+ Warm ++","ポラロイド PX-100UV+ Warm +++","ポラロイド PX-680 --","ポラロイド PX-680 -","ポラロイド PX-680","ポラロイド PX-680 +","ポラロイド PX-680 ++","ポラロイド PX-680 Cold --","ポラロイド PX-680 Cold -","ポラロイド PX-680 Cold","ポラロイド PX-680 Cold +","ポラロイド PX-680 Cold ++","ポラロイド PX-680 Cold ++a","ポラロイド PX-680 Warm --","ポラロイド PX-680 Warm -","ポラロイド PX-680 Warm","ポラロイド PX-680 Warm +","ポラロイド PX-680 Warm ++","ポラロイド PX-70 --","ポラロイド PX-70 -","ポラロイド PX-70","ポラロイド PX-70 +","ポラロイド PX-70 ++","ポラロイド PX-70 +++","ポラロイド PX-70 Cold --","ポラロイド PX-70 Cold -","ポラロイド PX-70 Cold","ポラロイド PX-70 Cold +","ポラロイド PX-70 Cold ++","ポラロイド PX-70 Warm --","ポラロイド PX-70 Warm -","ポラロイド PX-70 Warm","ポラロイド PX-70 Warm +","ポラロイド PX-70 Warm ++","ポラロイド Time Zero (絶版) ---","ポラロイド Time Zero (絶版) --","ポラロイド Time Zero (絶版) -","ポラロイド Time Zero (絶版)","ポラロイド Time Zero (絶版) +","ポラロイド Time Zero (絶版) ++","ポラロイド Time Zero (絶版) Cold ---","ポラロイド Time Zero (絶版) Cold --","ポラロイド Time Zero (絶版) Cold -","ポラロイド Time Zero (絶版) Cold"} +#@gui_ja :_=separator() +#@gui_ja :不透明度=float(1,0,1) +#@gui_ja :ガンマ=float(0,-1.2,1.2) +#@gui_ja :コントラスト=float(1,0,4) +#@gui_ja :輝度=float(0,-255,255) +#@gui_ja :色相=float(0,-180,180) +#@gui_ja :彩度=float(0,-1,1) +#@gui_ja :事前に正規化=bool(0) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("注: このセクションで使用されているカラー LUT は Patrick David により作成されました。詳細は以下の Web ページをご覧ください。") +#@gui_ja :_=link("Film Emulation Presets in G'MIC","http://gmic.eu/film_emulation/index.shtml") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: Patrick DavidDavid Tschumperlé 最終更新: 2013/08/29") +#@gui_ja ネガフィルム [カラー]:fx_emulate_film_negative_color,fx_emulate_film_negative_color_preview(1)+ +#@gui_ja :プリセット=choice("なし","Agfa Ultra Color 100","Agfa Vista 200","Fuji Superia 200","Fuji Superia HG 1600","Fuji Superia Reala 100","Fuji Superia X-Tra 800","Kodak Elite 100 XPRO","Kodak Elite Color 200","Kodak Elite Color 400","Kodak Portra 160 NC","Kodak Portra 160 VC","Lomography Redscale 100") +#@gui_ja :_=separator() +#@gui_ja :強さ (%)=float(100,0,100) +#@gui_ja :輝度 (%)=float(0,-100,100) +#@gui_ja :コントラスト (%)=float(0,-100,100) +#@gui_ja :ガンマ (%)=float(0,-100,100) +#@gui_ja :色相 (%)=float(0,-100,100) +#@gui_ja :彩度 (%)=float(0,-100,100) +#@gui_ja :色を正規化=choice("無し","処理前","処理後","両方") +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("注: このセクションで使用されているカラー LUT は Patrick David により作成されました。詳細は以下の Web ページをご覧ください。") +#@gui_ja :_=link("Film Emulation Presets in G'MIC","http://gmic.eu/film_emulation/index.shtml") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: Patrick DavidDavid Tschumperlé 最終更新: 2016/08/02") +#@gui _フレーム +#@gui_ja フレーム [ぼかし]:fx_frame_blur,fx_frame_blur(1) +#@gui_ja :水平サイズ (%)=float(30,0,100) +#@gui_ja :垂直サイズ (%)=float(30,0,100) +#@gui_ja :_=separator() +#@gui_ja :切り抜き=float(0,0,100) +#@gui_ja :ぼかし=float(5,0,10) +#@gui_ja :丸み=float(0,0,1) +#@gui_ja :カラーバランスを調整=bool(0) +#@gui_ja :着色=color(#808080) +#@gui_ja :正規化=choice("なし","伸張","平均化") +#@gui_ja :_=separator() +#@gui_ja :輪郭線のサイズ=float(5,0,50) +#@gui_ja :輪郭線の色=color(#ffffff) +#@gui_ja :影の位置 (左右)=float(2,-10,10) +#@gui_ja :影の位置 (上下)=float(2,-10,10) +#@gui_ja :影のぼかし=float(1,0,5) +#@gui_ja :影のコントラスト=float(0,0,100) +#@gui_ja :画像の位置 (左右)=float(0.5,0,1) +#@gui_ja :画像の位置 (上下)=float(0.5,0,1) +#@gui_ja :角度=float(0,-180,180) +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2014/01/19") +#@gui _修復 +#@gui_ja アップスケール [Scale2x]:fx_scalenx,fx_scalenx_preview(0) +#@gui_ja :拡大率=choice("X 2","X 3","X 4","X 6","X 8","X 9","X 12","X 16","X 18","X 27") +#@gui_ja :色空間=choice(0,"RGB","YCbCr","Lab") +#@gui_ja :_=note("\n注: このフィルタは、以下の Web サイトで公開されている画像拡大アルゴリズムを実装したものです。 ") +#@gui_ja :_=link("http://scale2x.sourceforge.net") +#@gui_ja :_=note(" このフィルタは、インデックス画像等の色数の少ない画像のリサイズを目的としたものです。 フルカラー画像に対しての使用には基本的に適しません。 ") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja インターレース除去:deinterlace,fx_deinterlace_preview(0) +#@gui_ja :アルゴリズム=choice("標準","Motion-Compensated") +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja ホットピクセル除去:fx_remove_hotpixels,fx_remove_hotpixels_preview(0) +#@gui_ja :マスクサイズ=int(3,3,20) +#@gui_ja :閾値=float(10,0,200) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: Jérome Boulanger 最終更新: 2010/12/29") +#@gui_ja 補修 [パッチベース]:fx_inpaint_patch,gui_no_preview +#@gui_ja :パッチサイズ=_int(7,1,64) +#@gui_ja :参照サイズ=_float(16,1,32) +#@gui_ja :参照基数=_float(0.1,0,1) +#@gui_ja :ぼかしサイズ=_float(1.2,0,5) +#@gui_ja :ぼかししきい値=_float(0,0,1) +#@gui_ja :ぼかし減衰=_float(0.05,0,0.5) +#@gui_ja :スケールの階層数=_int(10,1,20) +#@gui_ja :マスク外領域のぼかしを許可=_bool(1) +#@gui_ja :マスクの色=_color(#ff0000ff) +#@gui_ja :マスクを広げる=_int(0,0,32) +#@gui_ja :_=separator() +#@gui_ja :_=note("このフィルタの詳しい使い方はこちらで参照できます。") +#@gui_ja :_=link{"Patrick David 氏によるこのフィルタについてのチュートリアル (英語)","http://blog.patdavid.net/2014/02/getting-around-in-gimp-gmic-inpainting.html"} +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David TschumperléMaxime Daisy 最終更新: 2015/11/25") +#@gui_ja 補修 [マルチスケール]:fx_inpaint_matchpatch,fx_inpaint_matchpatch_preview +#@gui_ja :スケールの階層数=_int(0,0,16) +#@gui_ja :_=note{"(自動で設定するには 0 を入力してください)"} +#@gui_ja :パッチサイズ=_int(9,1,64) +#@gui_ja :スケールごとの処理回数=_int(10,1,100) +#@gui_ja :ぼかしサイズ=_int(5,0,32) +#@gui_ja :マスク外領域のぼかしを許可=_bool(1) +#@gui_ja :マスクの色=_color(#ff0000ff) +#@gui_ja :マスクを広げる=_int(0,0,32) +#@gui_ja :_=separator() +#@gui_ja :処理中に進捗状況をプレビュー=_bool(0) +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2015/11/25") +#@gui_ja 透明部分を埋める:fx_solidify_td,fx_solidify_td_preview(1) +#@gui_ja :なめらかさ (%)=float(75,0,100) +#@gui_ja :正規化=choice(1,"等方性","Delaunay-Oriented","Edge-Oriented") +#@gui_ja :正規化の反復処理=int(20,0,100) +#@gui_ja :拡張 / 収縮=int(0,-20,20) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("注: このフィルタは、輸送拡散アルゴリズムを使用して画像の透明部分を再構成します。アルファチャンネルを有する画像にのみ効果があります。 ") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2016/04/07") +#@gui_ja Iain 式高速ノイズ除去:iain_fast_denoise_p,iain_fast_denoise_p_preview(0) +#@gui_ja :輝度=float(0,0,3) +#@gui_ja :色度=float(0,0,3) +#@gui_ja :ガンマ=float(1,.5,3) +#@gui_ja :斑点ノイズ除去=float(0,0,1) +#@gui_ja :出力結果にディザリングをかける=bool(0) +#@gui_ja :プレビューの表示=choice(0,"通常","輝度ノイズ","色度ノイズ") +#@gui_ja :_=separator() +#@gui_ja :並列実行=choice(1,"オフ","自動") +#@gui_ja :_=separator() +#@gui_ja :_=note("このノイズ除去フィルタは高速動作を再優先に設計されています。画像のディテールは損なわれる場合があります。") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: Iain Fergusson") +#@gui_ja :_=note("更新 2015/3/28 - 画像の乱れを解消するために並列実行時のオーバーラップ部分を拡大") +#@gui_ja :_=note("更新 2013/10/26 - 並列実行") +#@gui_ja :_=note("リリース 2013/2/22") +#@gui _光と影 +#@gui_ja ライトリーク:fx_light_leaks,fx_light_leaks_preview(1) +#@gui_ja :ライトリークの種類=int(0,0,70) +#@gui_ja :角度=float(0,-180,180) +#@gui_ja :X 方向のスケール=float(1,1,10) +#@gui_ja :Y 方向のスケール=float(1,1,10) +#@gui_ja :色相=float(0,-180,180) +#@gui_ja :不透明度=float(0.85,0,1) +#@gui_ja :合成モード=choice(2,"標準","明るくする","スクリーン","覆い焼き","加算","暗くする","乗算","焼き込み","オーバーレイ","ソフトライト","ハードライト","差分","減算","微粒取り出し","微粒結合","除算","色相","彩度","明度") +#@gui_ja :別のレイヤーに出力=_bool(1) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("このフィルタは、以下のリンク先で提供されているライトリーク用フリー素材を使用しています。") +#@gui_ja :_=link("Lomo Light Leaks","http://www.photoshoptutorials.ws/downloads/mockups-graphics/lomo-light-leaks/") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2015/07/01") +#@gui _劣化 +#@gui_ja ぼかし [ガウス]:fx_gaussian_blur,fx_gaussian_blur_preview(0) +#@gui_ja :大きさ (X、Y)=float(3,0,20) +#@gui_ja :大きさ (X)=float(0,0,20) +#@gui_ja :大きさ (Y)=float(0,0,20) +#@gui_ja :画像端での処理=choice(1,"黒を使用","最も近いピクセルの色を使用") +#@gui_ja :_=separator() +#@gui_ja :チャンネル=choice("すべて","RGBA [すべて]","RGB [すべて]","RGB [赤]","RGB [緑]","RGB [青]","RGBA [アルファ]","リニア RGB [すべて]","リニア RGB [赤]","リニア RGB [緑]","リニア RGB [青]","YCbCr [輝度]","YCbCr [色度、青-赤]","YCbCr [色度、青]","YCbCr [色度、赤]","YCbCr [色度、緑]","Lab [明度]","Lab [色度、ab]","Lab [色度、a]","Lab [色度、b]","Lch [色度、ch]","Lch [色度、c]","Lch [色度、h]","HSV [色相]","HSV [彩度]","HSV [明度]","HSI [輝度]","HSL [明度]","CMYK [シアン]","CMYK [マゼンタ]","CMYK [イエロー]","CMYK [キー]","YIQ [輝度]","YIQ [色度]") +#@gui_ja :範囲外の値の処理=choice("何もしない","切り捨て","正規化") +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja ぼかし [グロー]:fx_glow,fx_glow_preview(0) +#@gui_ja :大きさ=float(6,0,20) +#@gui_ja :_=separator() +#@gui_ja :チャンネル=choice(7,"すべて","RGBA [すべて]","RGB [すべて]","RGB [赤]","RGB [緑]","RGB [青]","RGBA [アルファ]","リニア RGB [すべて]","リニア RGB [赤]","リニア RGB [緑]","リニア RGB [青]","YCbCr [輝度]","YCbCr [色度、青-赤]","YCbCr [色度、青]","YCbCr [色度、赤]","YCbCr [色度、緑]","Lab [明度]","Lab [色度、ab]","Lab [色度、a]","Lab [色度、b]","Lch [色度、ch]","Lch [色度、c]","Lch [色度、h]","HSV [色相]","HSV [彩度]","HSV [明度]","HSI [輝度]","HSL [明度]","CMYK [シアン]","CMYK [マゼンタ]","CMYK [イエロー]","CMYK [キー]","YIQ [輝度]","YIQ [色度]") +#@gui_ja :範囲外の値の処理=choice("何もしない","切り捨て","正規化") +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja ぼかし [回転]:fx_blur_angular,fx_blur_angular_preview(1) +#@gui_ja :大きさ=float(2,0,10) +#@gui_ja :X 軸方向の中心 (%)=float(50,0,100) +#@gui_ja :Y 軸方向の中心 (%)=float(50,0,100) +#@gui_ja :シャープネス=float(0,0,500) +#@gui_ja :ガイドをプレビューに表示=bool(1) +#@gui_ja :_=separator() +#@gui_ja :チャンネル=choice(7,"すべて","RGBA [すべて]","RGB [すべて]","RGB [赤]","RGB [緑]","RGB [青]","RGBA [アルファ]","リニア RGB [すべて]","リニア RGB [赤]","リニア RGB [緑]","リニア RGB [青]","YCbCr [輝度]","YCbCr [色度、青-赤]","YCbCr [色度、青]","YCbCr [色度、赤]","YCbCr [色度、緑]","Lab [明度]","Lab [色度、ab]","Lab [色度、a]","Lab [色度、b]","Lch [色度、ch]","Lch [色度、c]","Lch [色度、h]","HSV [色相]","HSV [彩度]","HSV [明度]","HSI [輝度]","HSL [明度]","CMYK [シアン]","CMYK [マゼンタ]","CMYK [イエロー]","CMYK [キー]","YIQ [輝度]","YIQ [色度]") +#@gui_ja :範囲外の値の処理=choice("何もしない","切り捨て","正規化") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2015/1/16") +#@gui_ja ぼかし [放射状]:fx_blur_radial,fx_blur_radial_preview(1) +#@gui_ja :大きさ=float(3,0,20) +#@gui_ja :X 軸方向の中心 (%)=float(50,0,100) +#@gui_ja :Y 軸方向の中心 (%)=float(50,0,100) +#@gui_ja :シャープネス=float(0,0,500) +#@gui_ja :ガイドをプレビューに表示=bool(1) +#@gui_ja :_=separator() +#@gui_ja :チャンネル=choice(7,"すべて","RGBA [すべて]","RGB [すべて]","RGB [赤]","RGB [緑]","RGB [青]","RGBA [アルファ]","リニア RGB [すべて]","リニア RGB [赤]","リニア RGB [緑]","リニア RGB [青]","YCbCr [輝度]","YCbCr [色度、青-赤]","YCbCr [色度、青]","YCbCr [色度、赤]","YCbCr [色度、緑]","Lab [明度]","Lab [色度、ab]","Lab [色度、a]","Lab [色度、b]","Lch [色度、ch]","Lch [色度、c]","Lch [色度、h]","HSV [色相]","HSV [彩度]","HSV [明度]","HSI [輝度]","HSL [明度]","CMYK [シアン]","CMYK [マゼンタ]","CMYK [イエロー]","CMYK [キー]","YIQ [輝度]","YIQ [色度]") +#@gui_ja :範囲外の値の処理=choice("何もしない","切り捨て","正規化") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2015/1/16") +#@gui_ja ぼかし [線形]:fx_blur_linear,fx_blur_linear_preview(1) +#@gui_ja :平行方向の半径=float(10,0,100) +#@gui_ja :直交方向の半径=float(0.5,0,100) +#@gui_ja :角度=float(0,0,180) +#@gui_ja :シャープネス=float(0,0,500) +#@gui_ja :画像端での処理=choice(1,"黒を使用","最も近いピクセルの色を使用") +#@gui_ja :_=separator() +#@gui_ja :チャンネル=choice(7,"すべて","RGBA [すべて]","RGB [すべて]","RGB [赤]","RGB [緑]","RGB [青]","RGBA [アルファ]","リニア RGB [すべて]","リニア RGB [赤]","リニア RGB [緑]","リニア RGB [青]","YCbCr [輝度]","YCbCr [色度、青-赤]","YCbCr [色度、青]","YCbCr [色度、赤]","YCbCr [色度、緑]","Lab [明度]","Lab [色度、ab]","Lab [色度、a]","Lab [色度、b]","Lch [色度、ch]","Lch [色度、c]","Lch [色度、h]","HSV [色相]","HSV [彩度]","HSV [明度]","HSI [輝度]","HSL [明度]","CMYK [シアン]","CMYK [マゼンタ]","CMYK [イエロー]","CMYK [キー]","YIQ [輝度]","YIQ [色度]") +#@gui_ja :範囲外の値の処理=choice("何もしない","切り捨て","正規化") +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja ぼかし [被写界深度]:fx_blur_dof,fx_blur_dof_preview(1) +#@gui_ja :大きさ=float(3,0,20) +#@gui_ja :精度=int(16,2,64) +#@gui_ja :被写界深度の種類=choice{"ガウス","ユーザー定義 (最背面のレイヤー)"} +#@gui_ja :ぼかしを反転=bool(0) +#@gui_ja :_=separator() +#@gui_ja :_=note{"被写界深度 (ガウス):"} +#@gui_ja :X 軸方向の中心=float(50,0,100) +#@gui_ja :Y 軸方向の中心=float(50,0,100) +#@gui_ja :半径 1=float(30,0,200) +#@gui_ja :半径 2=float(30,0,200) +#@gui_ja :角度=float(0,0,180) +#@gui_ja :シャープネス=float(1,0,8) +#@gui_ja :ガイドをプレビューに表示=bool(1) +#@gui_ja :_=separator() +#@gui_ja :_=note{"被写界深度 (ユーザー定義):"} +#@gui_ja :ガンマ=float(0,-2,2) +#@gui_ja :_=note("各ピクセルの深度を輝度で表した深度マップ画像を最背面のレイヤーに配置することでフィルタに入力できます。 「入力レイヤー」コンボボックスでレイヤーを有効化するのをお忘れなく。") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2014/02/25") +#@gui_ja 色収差:fx_chromatic_aberrations,fx_chromatic_aberrations_preview(0) +#@gui_ja :第 1 色=color(#ff0000) +#@gui_ja :X 軸シフト=float(2,-16,16) +#@gui_ja :Y 軸シフト=float(2,-16,16) +#@gui_ja :_=separator() +#@gui_ja :第 2 色=color(#00ff00) +#@gui_ja :X 軸シフト (px)=float(0,-16,16) +#@gui_ja :Y 軸シフト (px)=float(0,-16,16) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2015/07/05") +#@gui_ja LOMO 風:fx_lomo,fx_lomo_preview(1) +#@gui_ja :ビネット効果の大きさ=float(20,0,100) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: Jérome BoulangerDavid Tschumperlé 最終更新: 06/06/2012") +#@gui _変形 +#@gui_ja レンズ歪み:fx_distort_lens,fx_distort_lens_preview(1) +#@gui_ja :強度=float(0.1,-1,1) +#@gui_ja :アスペクト比=float(0,-2,2) +#@gui_ja :ズーム=float(0,-4,4) +#@gui_ja :X 方向の中心 (%)=float(50,0,100) +#@gui_ja :Y 方向の中心 (%)=float(50,0,100) +#@gui_ja :画像の外側=choice(0,"透明","最近傍","繰り返し","反転") +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2017/02/18") +#@gui_ja 正距円筒図法画像から天頂・天底を生成:fx_equirectangular2nadirzenith,fx_equirectangular2nadirzenith(1) +#@gui_ja :モード=choice("天頂・天底を生成","正距円筒図法に戻す") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2015/12/29") +#@gui _描画 +#@gui_ja キューピッド:fx_cupid,fx_cupid +#@gui_ja :ぼかし=float(0,0,10) +#@gui_ja :色=color(#ff0000ff) +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2013/11/13") +#@gui_ja グラデーション [四隅]:fx_corner_gradient,fx_corner_gradient +#@gui_ja :色 1 (左上)=color(#ffffff80) +#@gui_ja :色 2 (右上)=color(#ff0000ff) +#@gui_ja :色 3 (左下)=color(#00ff00ff) +#@gui_ja :色 4 (右下)=color(#0000ffff) +#@gui_ja :_=separator() +#@gui_ja :色空間=choice(1,"SRGB","Linear RGB","Lab") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja シェルピンスキーの三角形:fx_sierpinski,fx_sierpinski(1) +#@gui_ja :反復=int(6,0,10) +#@gui_ja :第 1 頂点の X 座標=float(50,0,100) +#@gui_ja :第 1 頂点の Y 座標=float(0,0,100) +#@gui_ja :第 2 頂点の X 座標=float(0,0,100) +#@gui_ja :第 2 頂点の Y 座標=float(100,0,100) +#@gui_ja :第 3 頂点の X 座標=float(100,0,100) +#@gui_ja :第 3 頂点の Y 座標=float(100,0,100) +#@gui_ja :色=color(#808080) +#@gui_ja :不透明度=float(1,0,1) +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja ハートマーク:fx_heart,fx_heart_preview +#@gui_ja :サイズ=float(75,0,100) +#@gui_ja :ぼかし=float(0,0,10) +#@gui_ja :色=color(#ff0000ff) +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2013/11/13") +#@gui_ja バーンスレイのシダ:fx_barnsley_fern,fx_barnsley_fern_preview(1) +#@gui_ja :種類=choice("Asplenium Adiantum-Nigrum","Thelypteridaceae") +#@gui_ja :密度 (%)=float(100,0,300) +#@gui_ja :角度=float(30,-180,180) +#@gui_ja :不透明度 (%)=float(40,0,100) +#@gui_ja :色=color(#0ab200ff) +#@gui_ja :新しいレイヤーに出力=_bool(1) +#@gui_ja :_=separator() +#@gui_ja :_=note{"このフィルタは『バーンスレイのシダ (Barnsley fern} +#@gui_ja :_=link("https://en.wikipedia.org/wiki/Barnsley_fern") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2016/10/18") +#@gui_ja ボール:fx_ball,fx_ball_preview(0) +#@gui_ja :半径=int(128,1,1024) +#@gui_ja :光沢の明るさ=float(0.8,0,8) +#@gui_ja :光沢のサイズ=float(1,0,8) +#@gui_ja :陰影=float(1.5,0,4) +#@gui_ja :色=color(#ff00ff) +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2013/11/27") +#@gui_ja 方程式プロット [パラメトリック]:fx_equation_parametric,fx_equation_parametric +#@gui_ja :X(t)=text{"sin(t)*(exp(cos(t))-2*cos(4*t)-sin(t/12)^5)"} +#@gui_ja :Y(t)=text{"cos(t)*(exp(cos(t))-2*cos(4*t)-sin(t/12)^5)"} +#@gui_ja :Min-T=float(0,-1000,1000) +#@gui_ja :Max-T=float(100,-1000,1000) +#@gui_ja :解像度=int(4096,2,32768) +#@gui_ja :Outline Opacity=float(1,0,1) +#@gui_ja :Dot Size=int(0,0,16) +#@gui_ja :開始色=color(#400000) +#@gui_ja :終了色=color(#800000) +#@gui_ja :Colored Outline=bool(1) +#@gui_ja :アンチエイリアス=bool(1) +#@gui_ja :Decoration=bool(1) +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2013/11/13") +#@gui_ja 虹:fx_rainbow,fx_rainbow +#@gui_ja :左端の位置=float(80,0,100) +#@gui_ja :右端の位置=float(80,0,100) +#@gui_ja :左側の傾き=float(175,0,400) +#@gui_ja :右側の傾き=float(175,0,400) +#@gui_ja :細さ=float(3,0.1,8) +#@gui_ja :不透明度=float(80,0,199) +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja 雪片:fx_snowflake,fx_snowflake(1) +#@gui_ja :反復=int(5,0,6) +#@gui_ja :不透明度=float(1,0,1) +#@gui_ja :色=color(#ffffff) +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja 3D 押し出し:fx_extrude3d,fx_extrude3d_preview(1) +#@gui_ja :奥行き=float(10,1,1024) +#@gui_ja :解像度=int(512,1,1024) +#@gui_ja :丸み=float(0.6,0,3) +#@gui_ja :_=separator() +#@gui_ja :幅=_int(1024,1,4096) +#@gui_ja :高さ=_int(1024,1,4096) +#@gui_ja :サイズ=float(0.5,0,3) +#@gui_ja :X 角度=float(57,0,360) +#@gui_ja :Y 角度=float(41,0,360) +#@gui_ja :Z 角度=float(21,0,360) +#@gui_ja :パース=float(45,1,90) +#@gui_ja :光源位置 X=float(0,-100,100) +#@gui_ja :光源位置 Y=float(0,-100,100) +#@gui_ja :光源位置 Z=float(-100,-100,0) +#@gui_ja :光沢の大きさ=float(0.5,0,1) +#@gui_ja :光沢の強さ=float(0.7,0,3) +#@gui_ja :レンダリング方法=choice(4,"頂点","ワイヤーフレーム","単色","フラットシェーディング","グーローシェーディング","フォンシェーディング") +#@gui_ja :アンチエイリアシング=bool(1) +#@gui_ja :_=separator() +#@gui_ja :_=note("注: 最前面のレイヤーをテクスチャとして使用できます。") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui _白黒画像編集 +#@gui_ja 彩色 [インタラクティブ]:fx_colorize_interactive,fx_colorize_interactive_preview +#@gui_ja :入力タイプ=_choice("白黒写真","線画") +#@gui_ja :出力タイプ=_choice{"彩色済み画像 (1 レイヤー)","色のみ (1 レイヤー)","画像 + 色 (2 レイヤー)","画像 + 色 (複数レイヤー)"} +#@gui_ja :表示解像度=_choice{1,"小 (高速)","中","大 (低速)","最大 (最低速)"} +#@gui_ja :追加パレット 1 (.gpl ファイル)=_file("") +#@gui_ja :追加パレット 2 (.gpl ファイル)=_file("") +#@gui_ja :_=separator() +#@gui_ja :_=note{"説明:\n このフィルタでは、白黒写真や線画を簡単に彩色できます。 ウィンドウ下部の適用または OK をクリックすると、インタラクティブウィンドウが開き、コントロールポイントを追加できます。 コントロールポイントの配置が完了したら、インタラクティブウィンドウを終了すると、彩色処理が実行され結果が GIMP に出力されます。\n\n 処理結果がお気に召さなかった場合はアンドゥ (Ctrl+Z) を行ったあと適用をもう一度クリックし、コントロールポイントの配置を調整してください。 ウィンドウ下部のリセットをクリックするとコントロールポイントをすべて消去できます。 "} +#@gui_ja :コントロールポイントを消去=button(0.5) +#@gui_ja :Last Image Size=const(0,0) +#@gui_ja :Control Points=const(-1) +#@gui_ja :_=separator() +#@gui_ja :_=note{"操作説明:\n インタラクティブウィンドウでは以下のアクションが利用できます。\n\n - 左マウスボタン クリックで新しいコントロールポイントを作成 (またはドラッグで既存のものを移動)\n - 右マウスボタンまたはX キー クリックしたコントロールポイントを削除\n - 右マウスボタンまたはP キー (コントロールポイントのない場所で) クリックした場所の色を取得\n - マウスホイールまたはCtrl+矢印キー上/下 表示を拡大/縮小\n - Ctrl+マウスホイールShift+マウスホイールまたは矢印キー 拡大した画像の表示範囲を移動\n - スペースキー 処理結果予測の表示を更新\n - Tab キー コントロールポイントの表示方法を切り替え\n - Backspace キー 最後に追加したコントロールポイントを削除\n - PageUp キー 画像のコントラストを上げる\n - PageDown キー 画像のコントラストを下げる\n - R キー 色置換モードのオン/オフを切り替え\n - Ctrl+D ウィンドウサイズを大きくする\n - Ctrl+C ウィンドウサイズを小さくする\n - Ctrl+R ウィンドウサイズをリセット\n - Esc キーQ キーまたは Enter キー インタラクティブウィンドウを終了 "} +#@gui_ja :_=separator() +#@gui_ja :_=note("このフィルタの詳しい使い方は以下の Web ページで参照できます。") +#@gui_ja :_=link{"David Revoy 氏による G'MIC Colorize フィルタのチュートリアル (英語)","http://www.davidrevoy.com/article240/gmic-line-art-colorization"} +#@gui_ja :_=link("ぐるぐる氏による上記チュートリアルの日本語翻訳","http://sp-cute.hatenablog.com/entry/2014/10/12/142939") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2014/12/09") +#@gui_ja 彩色 [コミック]:fx_colorize_comics,fx_colorize_comics_preview(1) +#@gui_ja :_=note("レイヤー順序:") +#@gui_ja :入力レイヤー=choice(0,"カラースポット + 線画","線画 + カラースポット","カラースポット + 色分け処理結果 + 線画","線画 + カラースポット + 色分け処理結果") +#@gui_ja :出力レイヤー=_choice(1,"1 レイヤーに統合","色分け処理結果 + 線画","線画 + 色分け処理結果","カラースポット + 色分け処理結果 + 線画","線画 + カラースポット + 色分け処理結果") +#@gui_ja :色分け処理結果の出力=choice("1 レイヤー","2 レイヤー","3 レイヤー","4 レイヤー","5 レイヤー","6 レイヤー","7 レイヤー","8 レイヤー","9 レイヤー","10 レイヤー","色ごとに 1 レイヤーずつ","範囲ごとに 1 レイヤーずつ") +#@gui_ja :_=separator() +#@gui_ja :なめらかさ=float(0.05,0,1) +#@gui_ja :_=separator() +#@gui_ja :_=note{"注: ウィンドウ左側の「入力レイヤー」で「すべて」を選択してください。\n カラースポット = 色指定を描きこんだレイヤーです。\n 線画 = 線画のレイヤー (白黒または空白部分が透明のもの) です。\n 色分け処理結果 = 色分け処理の結果が出力されるレイヤーです。\n\n 注意: \n - プレビューは実際の処理結果と異なる場合があります。 \n - 十分なメモリを搭載していない PC では、「色分け処理結果の出力」で「色ごとに 1 レイヤーずつ」「範囲ごとに 1 レイヤーずつ」のオプションを使用しないでください。 "} +#@gui_ja :_=separator() +#@gui_ja :_=link{"このフィルタの詳しい使い方はこちらで参照できます。(英語)","http://www.gimpchat.com/viewtopic.php?f=28&t=7567"} +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David TschumperléTimothée GietDavid Revoy 最終更新: 2013/06/19") +#@gui_ja 線画を自動的に色分け:fx_autofill_lineart,fx_autofill_lineart_preview(0) +#@gui_ja :輪郭のしきい値 (%)=float(90,0,100) +#@gui_ja :輪郭の正規化=bool(1) +#@gui_ja :Minimal Region Area=int(8,0,256) +#@gui_ja :Tolerance to Gaps=int(0,0,10) +#@gui_ja :プレビューの表示方法=choice("線画と色","色のみ") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2016/11/12") +#@gui_ja :使用する色=choice("ランダム","最前面の色指定レイヤー") +#@gui_ja :_=separator() +#@gui_ja :_=note("Global geometry parameters:") +#@gui_ja :輪郭の検出 (%)=float(95,0,100) +#@gui_ja :輪郭の膨らまし=int(0,-1,10) +#@gui_ja :_=note("輪郭を膨らませるサイズを自動で設定するには、「輪郭の膨らまし」を -1 に設定します。") +#@gui_ja :Output Region Delimiters=_bool(0) +#@gui_ja :_=separator() +#@gui_ja :_=note("「使用する色」に「ランダム」を設定した場合のみ:") +#@gui_ja :色の最大彩度=int(32,0,255) +#@gui_ja :色の最小輝度=int(200,0,255) +#@gui_ja :_=separator() +#@gui_ja :_=note("「使用する色」に「最前面の色指定レイヤー」を設定した場合のみ:") +#@gui_ja :Color Shading (%)=int(0,0,100) +#@gui_ja :_=separator() +#@gui_ja :_=note("接続パラメーター:") +#@gui_ja :End Point Rate (%)=float(85,0,100) +#@gui_ja :端点の最大接続数=int(2,1,5) +#@gui_ja :スプライン曲線の長さの上限 (px)=float(60,0,256) +#@gui_ja :セグメントの長さの上限 (px)=float(20,0,256) +#@gui_ja :スプライン曲線の角度の上限 (度)=float(90,0,180) +#@gui_ja :Spline Roundness=float(1,0,2) +#@gui_ja :Minimal Region Area=float(10,0,100) +#@gui_ja :自己交差を許可=bool(1) +#@gui_ja :_=separator() +#@gui_ja :プレビューの種類=choice(0,"Colored Geometry","Colored Regions","Colored Lineart") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé、Sébastien Fourey、David Revoy 最終更新: 2016/12/13") +#@gui _ +#@gui_ja セピア:fx_sepia,fx_sepia_preview +#@gui_ja :ガンマ=float(0,-1.2,1.2) +#@gui_ja :コントラスト=float(1,0,4) +#@gui_ja :輝度=float(0,-255,255) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja 色を転写 [基本的]:fx_transfer_colors,fx_transfer_colors +#@gui_ja :輝度を転写=bool(0) +#@gui_ja :レイヤー順序を反転=bool(0) +#@gui_ja :_=note("注: 最背面のレイヤーの色を参照します。\n このフィルタを正しく動作させるには、最低でも 2 枚のレイヤーが必要となります。複数のレイヤーを入力できるよう、「入力レイヤー」オプションを調整してください。 ") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja 色を選択して置換:fx_select_color,fx_select_color_preview(0) +#@gui_ja :色空間=choice(0,"RGB[A]","RGB","YCbCr","赤","緑","青","不透明度","輝度","赤・青 色度","色相","彩度") +#@gui_ja :許容誤差=float(20,0,100) +#@gui_ja :なめらかさ=float(0,0,10) +#@gui_ja :穴を埋める=int(0,0,256) +#@gui_ja :選択する色=color(#ffffffff) +#@gui_ja :出力画像=choice(0,"選択した色","選択した色のマスク","除外された色","除外された色のマスク","色を置換") +#@gui_ja :置換に使う色=color(#ff0000ff) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2010/12/29") +#@gui_ja 選択的脱色:fx_selective_desaturation,fx_selective_desaturation_preview(1) +#@gui_ja :指定する色=color(#ffffff) +#@gui_ja :脱色対象=choice("指定色","指定色以外のすべて") +#@gui_ja :効果の強さ=float(3,0,10) +#@gui_ja :正則化=int(0,0,20) +#@gui_ja :彩度の上限=choice("入力画像","指定色","Maximum Value") +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2015/7/15") +#@gui _芸術的 +#@gui_ja 四分木画像処理:fx_quadtree,fx_quadtree_preview(1) +#@gui_ja :モード=choice("Squares","Sierpinksi Design","楕円ブラシで描画") +#@gui_ja :精度=int(1024,2,4096) +#@gui_ja :均一性=float(0.5,0,2) +#@gui_ja :輪郭線=int(0,0,4) +#@gui_ja :_=separator() +#@gui_ja :_=note("「楕円ブラシで描画」用の設定:") +#@gui_ja :第 1 半径=float(3,0,5) +#@gui_ja :第 2 半径=float(1.5,0,5) +#@gui_ja :異方性=float(1,0,4) +#@gui_ja :Only Leafs=bool(1) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体に適用","下半分に適用","右半分に適用","上半分に適用","左半分に適用","複製して上下に並べる","複製して左右に並べる") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2017/06/15") +#@gui _詳細 +#@gui_ja シャープ化 [テクスチャ]:fx_sharpen_texture,fx_sharpen_texture_preview(0) +#@gui_ja :強さ=float(1,0,4) +#@gui_ja :半径=float(4,0,32) +#@gui_ja :_=separator() +#@gui_ja :チャンネル=choice(16,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2016/09/20") +#@gui_ja DCP 霞除去:jeje_dehaze,jeje_dehaze_preview +#@gui_ja :スケール=int(5,1,20) +#@gui_ja :強さ=float(1,0,2) +#@gui_ja :最小=float(.2,0,1) +#@gui_ja :最大=float(1,0,1) +#@gui_ja :輝度=float(0,-100,100) +#@gui_ja :コントラスト=float(0,-100,100) +#@gui_ja :ガンマ=float(0,-100,100) +#@gui_ja :透過率マップ=bool(false) +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("Dark Channel Prior Author に基づく霞除去フィルタです。作者: Jérôme Boulanger 最終更新: 2016/08/09") +#@gui _輪郭 +#@gui_ja 前景切り出し [インタラクティブ]:fx_extract_foreground,gui_no_preview +#@gui_ja :縁のぼかし=_float(0,0,4) +#@gui_ja :広げ=int(0,-32,32) +#@gui_ja :出力モード=choice{3,"RGBA 画像 (背景を完全に透明化 / 1 レイヤー)","RGBA 画像 (可逆的 / 1 レイヤー)","RGB 画像 + 2 値マスク (2 レイヤー)","RGBA 前景 + 背景 (2 レイヤー)"} +#@gui_ja :表示解像度=_choice{1,"小 (高速)","中","大 (低速)","最大 (最低速)"} +#@gui_ja :_=separator() +#@gui_ja :_=note("説明:\n このフィルタでは、不透明な RGB 画像から前景オブジェクトを簡単に切り出すことができます。 ウィンドウ下部の適用または OK をクリックすると、インタラクティブウィンドウが開き、コントロールポイントを追加できます。 コントロールポイントの配置が完了したら、インタラクティブウィンドウを終了すると、切り出し処理が実行され結果が GIMP に出力されます。\n\n 処理結果がお気に召さなかった場合は、適用をもう一度クリックしてコントロールポイントの配置を調整してください。 ウィンドウ下部のリセットをクリックするとコントロールポイントをすべて消去できます。 ") +#@gui_ja :Last Image Size=const(0,0) +#@gui_ja :Control Points=const(-1) +#@gui_ja :_=separator() +#@gui_ja :_=note{"操作:\n インタラクティブ ウィンドウでは以下のアクションが利用できます。\n\n - 左マウスボタンまたは F キー: クリックで新しい前景コントロールポイントを作成 (ドラッグで既存のものを移動)\n - 右マウスボタンまたは B キー: クリックで新しい背景コントロールポイントを作成 (ドラッグで既存のものを移動)\n - マウスホイールまたは Ctrl+矢印キー上/下: 表示を拡大/縮小\n - スペースキー: 切り出しマスクを更新\n - Tab キー: 背景の表示モードを切り替え\n - M キー: コントロールポイントの表示モードを切り替え\n - Backspace キー: 最後に追加したコントロールポイントを削除\n - PageUp キー: 背景の不透明度を上げる\n - PageDown キー: 背景の不透明度を下げる\n - Ctrl+D: ウィンドウサイズを大きくする\n - Ctrl+C: ウィンドウサイズを小さくする\n - Ctrl+R: ウィンドウサイズをリセット\n - Esc キーQ キーまたは Enter キー: インタラクティブウィンドウを終了 "} +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2014/09/29") +#@gui _配列とタイリング +#@gui_ja シームレス化 [パッチベース]:fx_frame_seamless,fx_frame_seamless_preview(0) +#@gui_ja :フレームサイズ=int(32,0,256) +#@gui_ja :パッチサイズ=int(9,3,64) +#@gui_ja :合成部分のサイズ=int(0,0,64) +#@gui_ja :Frame Type=choice(1,"Inner","Outer") +#@gui_ja :Equalize Light=float(100,0,100) +#@gui_ja :_=separator() +#@gui_ja :Preview Original=bool(0) +#@gui_ja :Tiled Preview=choice(3,"None","2x1","1x2","2x2","3x3","4x4") +#@gui_ja :_=separator() +#@gui_ja :プレビューの表示方法=choice("全体","下半分","右半分","上半分","左半分","上端部を複製","左端部を複製","下端部を複製","右端部を複製") +#@gui_ja :_=separator() +#@gui_ja :_=note("注: このフィルタを使用すると、入力した画像をつなぎ目のないパターンに簡単に変換できます。") +#@gui_ja :_=separator() +#@gui_ja :_=note("作者: David Tschumperlé 最終更新: 2015/12/15") +#@gui _About +#@gui ♥ Support Us ! ♥:_none_,fx_support_us +#@gui :_=note("
") +#@gui :_=note("
is proposed to you by
") +#@gui :_=note("
   David Tschumperlé     and        Sébastien Fourey
") +#@gui :_=link{"( IMAGE Team / GREYC Laboratory - CNRS UMR 6072 )","https://www.greyc.fr/?page_id=443&lang=en"} +#@gui :_=note("\nIf you appreciate what we do on G'MIC and want to help us maintaining and developing this piece of software, please consider making a donation!\n\n") +#@gui :_=note(
) +#@gui :_=link("Go to the donation page","https://libreart.info/en/projects/gmic") +#@gui :_=separator() +#@gui :_=note{"\nG'MIC officially collaborates with LILA ("Libre comme l'Art"), a French non-profit organization, which promotes Arts and Artists as well as access to technics and knowledge for everyone.\n LILA collects donations to help developing G'MIC."} +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/03/13.") +#@gui About G'MIC:_none_,_none_ +#@gui :_=note("
") +#@gui :_=note("
is proposed to you by
") +#@gui :_=note("
   David Tschumperlé     and        Sébastien Fourey
") +#@gui :_=link{"( IMAGE Team / GREYC Laboratory - CNRS UMR 6072 )","https://www.greyc.fr/?page_id=443&lang=en"} +#@gui :_=note{"\n This plug-in is based on our open-source libraries G'MIC and CImg (C++ Template Image Processing Library), available at:"} +#@gui :_=note(
  https://gmic.eu     and       http://cimg.eu
) +#@gui :_=note{"\n If you appreciate G'MIC, you are welcome to send us a nice postcard from your place, at:\n\n David Tschumperlé,\n Laboratoire GREYC (CNRS UMR 6072), Equipe Image,\n 6 Bd du Maréchal Juin,\n 14050 Caen Cedex / France."} +#@gui :_=note{"Postcards senders automatically enter the Friends Hall of Fame :) !\nYou may also consider making a donation!"} +#@gui Contributors:_none_,_none_ +#@gui :_=note{" We would like to thank all these people who contributed to G'MIC in one way or another. A big hug to : \n\n - Sylvie Alexandre (packaging, testing & filters) - Partha Bagchi (packaging) - Daniel P. Berrangé (packaging) - Sébastien Bougleux (debugging) - Jérome Boulanger (testing & code) - Claude Bulin (packaging) - Aurélien Ceyden (packaging) - François Collard (testing) - Patrick David (testing & filters) - Maxime Daisy (code & testing) - Frédéric Devernay (code) - Iain Fergusson (filters) - Tobias Fleischer (testing & code) - Roberto Ferramosca (packaging) - Jérome Ferrari (testing, code & tutorials) - Andrea Ferrero (testing, code) - Chris Fiedler (gfx) - Sébastien Fourey (G'MIC-Qt, ZArt code & G'MIC online) - Gentlemanbeggar (filters) - David Gowers (testing) - Claes Holmerson (tutorials) - Arto Huotari (filters) - Dan Leinir Turthra Jensen (debugging) - Tom Keil (testing, filters & tutorials) - Andy Kelday (testing & filters) - Alan Kwan (afre) (testing & filters) - Angelo Lama (testing & EKD integration) - John Lakkas (filters) - Stéphane de la Linuxerie (design) - Mark (translation) - Mahvin (testing & design) - MareroQ (translation) - Ramon Miranda (translation) - Tou Omiya (translation) - Mauro Quercia (translation) - PhotoComiX (testing, translation & filters) - Garry Osgood (documentation & filters) - Jehan Pages (testing & code) - Andreas Påhlsson (filters) - James Prichard (testing & filters) - Guilherme Razgriz (translation) - Karsten Rodenacker (packaging & code) - Marc Roovers (clut data) - Dani Sardà (translation) - Yuri Shemanin (debugging) - Silvio Grosso (debugging) - Stepanekos (translation) - Thorsten "otto" Stettin (packaging) - Lukas Tvrdy (Krita integration) - Martin Wolff (testing & filters) - Bernd Zeimetz (packaging) - Matthias Zepper (testing) -"} +#@gui Download External Data:gui_download_all_data,gui_no_preview(1) +#@gui :_=note{"This filter will download all external data files used by some filters of the G'MIC plug-in (Color Grading, Light Leaks, Grain, etc...), and will install them as persistent files on your hard drive. After this operation, you won't need a permanent internet connection anymore in order to use some of the G'MIC filters."} +#@gui :_=note() +#@gui :_=note("Warning: A lot of data will be downloaded. This can take a long time !") +#@gui :_=separator() +#@gui :Force Re-Download from Scratch=_bool(0) +#@gui :_=separator() +#@gui :_=note{"Alternative (manual) method:\nIf, for any reasons, your plug-in is unable to retrieve data from the Internet, you can download all those data files manually (as a single .zip file) at this address :"} +#@gui :_=link("https://gmic.eu/gmic_all_data.zip") +#@gui :_=note("You must then decompress all files contained in this archive at the following location:\n - for Unix-like systems : $HOME/.cache/gmic/\n - for Windows systems : %APPDATA%/gmic/ ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/16/04.") +#@gui Filter Design:_none_,_none_ +#@gui :_=note{" G'MIC is an open image processing framework. Thus, including user-defined filters into this plug-in is possible.\n\n To do so, you need to create a .gmic file in your $HOME/ folder (or %USERPROFILE%/user.gmic on Windows). It will be read each time the plug-in is launched, or when the Refresh button (under the central pane) is pressed. It must be a regular text file, containing the declarations and implementations of the filters (written in the G'MIC language) that will be added to the list of available ones."} +#@gui :_=note(" Existing filters are already defined this way. Writing a filter from scratch in G'MIC requires some skills, but can be generally done in very few lines.\n\n Example of a valid .gmic entry :") +#@gui :_=note("#@gui My effect : my_effect, my_effect") +#@gui :_=note{"#@gui : Sigma = float(2,0,10)"} +#@gui :_=note("my_effect :\n +blur $1 n 0,255 xor") +#@gui :_=note(" Look at the reference documentation and the tutorial whose links are given below, to learn more. By the way, you are encouraged to share your nice custom filters with us on our forums, for inclusion into next releases of G'MIC. ") +#@gui :_=separator() +#@gui :_=link(0,"[1] G'MIC reference documentation","https://gmic.eu/reference/") +#@gui :_=link(0,"[2] G'MIC scripting tutorial","https://gmic.eu/tutorial/") +#@gui :_=link(0,"[3] G'MIC filter template","https://github.com/GreycLab/gmic-community/blob/master/include/template.gmic") +#@gui Friends Hall of Fame:_none_,fx_friends +#@gui :_=note("\nSupporters:") +#@gui :_=note(" - A big hug goes to these friends who supported the project:") +#@gui :_=note(" Christian Stenner, Daniel Balle, Matthias Fuchs, Alban Bourrat, Elizabeth Hayman, Nicolas Künzler, Mikael Wargh, Giovanni Bianchessi, Job van der Zwan, Laurent Espitallier, Mark van der Grijp, Patrick Wauters, Marc-André Gasser, Steven Shupe, Mika Yrjölä, Silvio Grosso, Marek Kubica, Mike Bing, Dave Allen, Margaret Wong, Adrian Bottomley, Pamela Young, Chris Bowness, Peter Howarth, Marlon Montalvo, Christian Freiherr von Malchus, Nolan Tyrrell, Gilles Bouquerel, Mihail Balabanov, Rolf Niepraschk, Volkmar Geske, Menno Tjoelker, Abhijeet Borkar, Arleta Lesniewska, Nicola Giaccobe, Helmut Mühleisen, Paul Buckley, Olivier Lecarme, Edward Ingram, Stefan Städtler-Ley, Michel Pastor, Sz.U, Sven Kraft, Frederik Elwert, Jessica Leonard, Kenneth Simons, Milos Ciuk, Manlio Barolo, John Lewandowski, Didier Lima, Žygimantas Tauras, Massimo Ferri, Hiroshi Takekawa, Freelance writer, Elaine Hutchings, András Somogyi, Jason Dora, Boris Hajdukovic, Jeff Combs / Mappish, BTraven, Steven Brener, Susanne Gabrielski, Andrea Correani, Mads Thomsen, Djek Eykhout, Michael Calabrese, Joachim Steiert Christian Dubettier, J. Casseur, Okki, Dariusz Duma, Mahvin, Elleen Hennessy, BluffStuffPlus, Bertrand Chan, Mirella Scotto, Paul Sauve, Lars Mielke, Devin Sorell, Pepe Baeza, Andrey Pivovarova, David Oliver, errore, Anudai, James Stalnaker, Paolo Finetti, Luigi Scarselli, Pat David, Juan Jose Rodriguez Vela, Thomas Jakob, Kim Bartholomew, Sudi, Michael Prostka, Arkadi Gelfond, Sabine Schäfers, Bull O'Woods, Jost Jakob Schaper, Dominik Wefers, Frank McLaughlin, Jonas Wagner, Void lon iXaarii, Mark Boadey, Laura Haglund, Lee Elliott, Bernard Desenclos, Randy Gordon-Gilmore, Eddie Dedrick, Greg FitzPatrick, Zsolt Szabo, Daniel Hanna, Peter Bengtsson, Diego Nassetti, William Tweedy, Shawnee Horn, Stephan Munsch, MysticAli3n-Wear, Mika Mantere, Christian Beuschel, Tore Busch, Douc McGregor. Marcel Dahm, Susan Voitel, Henk Koning, Arnie Jordan, Carol Jennings, Sébastien Huart, Jess Stryker, Rui Luis, Renato Salles, Petr Zagalak, Antonio Vicién Faure, Vincent Bermel, Christian Stocco, Richard Benedict, Dr. Helmut Jarausch, Michael Beck, Riccardo Leone, Gisela Looram, Frank Tegtmeyer, David Kettrey, Peter Hoge, Alexander Heitmann, Olivier Larski, Victor Fandrey, Stefan Peter, Dimitrios Psychogios, Antti Luoma, Eddy Young Tie Yang, Thomas Elfstrom, Valentine Boyce, George Harnett, Darius Manka, Chris Knox, Thomas Tapping, Phillip R Ziesemer, Jean Francois. Franz Ziereis, Alessandro Renzi, Tsuda Koshi, Boxrec Ltd, Wolfgang Schweizer, Ramon Miranda, Volker Bradley, Marco Zara, Marco Tedaldi, Rodney Lee, Konstantinos Blatzonis, Simon Chanson, Herbert Malle, Matthias Zepper, Christian Mariucci, M. R., Mark Link, Rolf Steinort, Daniel Tauro, Ben Langhinrichs, Paolo Pedaletti, Ricardo Corin, James Prichard, Matt Jones, Eddy Vervest, Flavio Casadei Della Chiesa, Lyle Kroll. ") +#@gui :_=separator() +#@gui :_=note("\nPostcard senders:") +#@gui :_=note{" - We've received 46 postcards from G'MIC enthusiasts so far. You could be the 47rd sender :)"} +#@gui :_=note{" - A big hug goes to these postcard senders (recently received first) :"} +#@gui :_=note{" Benjamin Russell (Portsmouth/USA), Andreas Weissenburger (Bochum/Germany), Patrick Wanters (USA), Josep Febrer (Pregonda/Menorca), Richard Gledson (Newcastle upon tyne/England), James Jaworski (Winnipeg/Canada), Powlux (France), Volker Doebel (Haldern/Germany), Patrick Wauters (Bilbao/Spain), Sebastien Fourey (Konstanz/Germany), David Revoy (Toulouse/France), Giulio Canevari (Pavia/Italy), Bruno Steinbach (Pondicherry/India), Steve Gillow (Fort Worth/Texas/USA), Peter Neave (Sydney/Australia), Andrea [Photoflow] (Italy), Garry R. Osgood (New York/USA), Justin Pletzfeld (Germany), Werner Meier (Germany), Patrick Wauters (Roma/Italy), Marc Lis (Belgium), ZondeR (France), Bill C. (USA), Michael T. (France), Patrick Wauters (Lisboa), Akky [Gimpchat] (Australia), Michel Thomas (Germany), Pierre-Yves (Ile de Batz/France), Family Hamacher (Trier/Germany), Benoit Gauzere and Francois Lozes (Hokusai/Japan), Dr. Rainer Teubner (Seligenstadt/Germany), Mauro Mitrino (Mantova/Italy), Werner Meier (Mettlach/Germany), Arto Huotari (Helsinki/Finland), Benoit Gauzere (California/USA), Arkadi Gelfond (Foster City - California/USA), Corinne Masimann (Neuchatel/Switzerland), Mahvin (Portland/USA), Vincent Roullier (Caen/France), M???? (Munich/Germany), F. Albior (Jaca/Spain), PhotoComIX (Frascati/Italy), Guy Poizat (Cabestany/France), Institut for Biomathematik und Biometrie (Neuherberg/Germany), Jean-Michel Webbe (Guadeloupe/France), Jaime (Barcelona/Spain). "} +#@gui :_=separator() +#@gui :_=note("\nMay the force be with you!") +#@gui_ca G'MIC per Al GIMP:_none_,_none_ +#@gui_ca :_=note{" ( GREYC's Magic for Image Computing )\n\n és una gentilesa de"} +#@gui_ca :_=link("David Tschumperlé","https://tschumperle.users.greyc.fr/") +#@gui_ca :_=link("Sébastien Fourey","https://foureys.users.greyc.fr/") +#@gui_ca :_=link{"( IMAGE Team / GREYC Laboratory - CNRS UMR 6072 )","https://www.greyc.fr/node/36"} +#@gui_ca :_=note{" Aquest connector està basat en les biblioteques de codi obert G'MIC i CImg (C++ Template Image Processing Library), disponibles a :"} +#@gui_ca :_=link("https://gmic.eu/") +#@gui_ca :_=note("i") +#@gui_ca :_=link("https://cimg.eu/") +#@gui_ca :_=note{"\n Si t'agrada el G'MIC, pots enviar-nos una postal del lloc on vius, a :\n\n David Tschumperlé,\n Laboratoire GREYC (CNRS UMR 6072), Equipe Image,\n 6 Bd du Maréchal Juin,\n 14050 Caen Cedex / France.\n\n Tot aquell que enviï una postal apareixerà al Friends Hall of Fame :) ! "} +#@gui Gmicky - Roddy:fx_gmicky,fx_gmicky_preview +#@gui :Mascot Image=choice{"Gmicky (by Deevad)","Gmicky (by Mahvin)","Gmicky & Wilber (by Mahvin)","Roddy (by Mahvin)"} +#@gui :_=separator() +#@gui :_=note{"Gmicky is the name of the G'MIC mascot. He is a small and cute tiger who knows how to do magic. Gmicky is a tiger, i.e. fast, agile and elegant, just as the G'MIC code is :). As many magicians, Gmicky knows lot of gimmicks, and he is a direct and friendly companion of the ImageMagick's wizard, or the GraphicMagick's frog."} +#@gui :_=note("Roddy is another mascot designed specifically for the Artistic / Rodilius filter of G'MIC.\n") +#@gui :_=note("Gmicky and Roddy have been both created and drawn by ") +#@gui :_=link("Mahvelous Mahvin","http://www.mahvin.com/") +#@gui :_=note("and") +#@gui :_=link{"David Revoy (Deevad)","http://www.davidrevoy.com/"} +#@gui Privacy Notice:_none_,_none_ +#@gui :_=note{"This plugin may download up-to-date filter definitions from the gmic.eu server.\n\n It is the case when first launched after a fresh installation, and periodically with a frequency which can be set in the settings dialog. The user should be aware that the following information may be retrieved from the server logs: IP address of the client; date and time of the request; as well as a short string, supplied through the HTTP protocol "User Agent" header field, which describes the full plugin version as shown in the window title (e.g. "G'MIC-Qt for GIMP 2.10 - Linux 64 bits - 3.3.2").\n\n Note that this information may solely be used for purely anonymous statistical purposes. "} +#@gui :_=separator() +#@gui :_=note("Author: Sébastien Fourey.      Latest Update: 2018/03/01.") +#@gui Release Notes:_none_,_none_ +#@gui :_=note{" - 2009/01/13 : version 1.3.0 (initial plug-in release).\n - 2010/09/03 : version 1.4.0.\n - 2011/07/07 : version 1.5.0.\n - 2014/08/20 : version 1.6.0.\n - 2016/03/25 : version 1.7.0.\n - 2017/05/29 : version 2.0.0.\n - 2017/10/09 : version 2.1.0.\n - 2018/02/15 : version 2.2.0.\n - 2018/06/21 : version 2.3.0.\n - 2018/10/04 : version 2.4.0.\n - 2019/03/15 : version 2.5.0.\n - 2019/04/29 : version 2.6.0.\n - 2019/08/14 : version 2.7.0.\n - 2019/12/04 : version 2.8.0.\n - 2020/03/28 : version 2.9.0.\n - 2021/12/09 : version 3.0.0.\n - 2022/04/06 : version 3.1.0.\n - 2023/01/16 : version 3.2.0.\n - 2023/09/04 : version 3.3.0.\n - 2023/11/10 : version 3.3.2 (Current stable).\n "} +#@gui :_=separator() +#@gui :_=link{"View changelog for upcoming major version (3.4)","https://discuss.pixls.us/t/on-the-road-to-3-4"} +#@gui :_=link{"View changelog for latest major version (3.3)","https://discuss.pixls.us/t/release-of-gmic-3-3"} +#@gui What's New?:_none_,fx_whatsnew_preview +#@gui :_=note("Here you'll find a list of filter additions and deletions in the plug-in, since your last visit. When you have seen what's new, press the Got It! button to reset the list of changes.") +#@gui :_=separator() +#@gui :_=value(0)_0+ +#@gui :_=note("\nThere have been no changes since your last visit.\n\n") +#@gui :New Filters=text(1,"")_0 +#@gui :Removed Filters=text(1,"")_0 +#@gui :Got It!=button(0.5)_0+ +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.       Latest Update: 2021/01/18.") +#@gui _Arrays & Tiles +#@gui Array [Faded]:fx_array_fade,fx_array_fade_preview(1) +#@gui :X-Tiles=int(2,1,10) +#@gui :Y-Tiles=int(2,1,10) +#@gui :X-Offset (%)=float(0,0,100) +#@gui :Y-Offset (%)=float(0,0,100) +#@gui :Fade Start (%)=float(80,1,100) +#@gui :Fade End (%)=float(90,1,100) +#@gui :Mirror=choice("None","X-Axis","Y-Axis","XY-Axes") +#@gui :Size=_choice("Shrink","Expand","Repeat [Memory Consuming!]") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Array [Mirrored]:fx_array_mirror,fx_array_mirror_preview(1) +#@gui :Iterations=int(1,1,10) +#@gui :X-Offset (%)=float(0,0,100) +#@gui :Y-Offset (%)=float(0,0,100) +#@gui :Array Mode=choice(2,"X-Axis","Y-Axis","XY-Axes","2XY-Axes") +#@gui :Initialization=choice("Original","Mirror X","Mirror Y","Rotate 90 Deg.","Rotate 180 Deg.","Rotate 270 Deg.") +#@gui :Expand Size=_bool(false) +#@gui :Crop (%)=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Array [Random Colors]:fx_array_color,fx_array_color(1) +#@gui :X-Tiles=int(5,1,20) +#@gui :Y-Tiles=int(5,1,20) +#@gui :Opacity=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Array [Random]:array_random,array_random(1) +#@gui :Source X-Tiles=int(5,1,20) +#@gui :Source Y-Tiles=int(5,1,20) +#@gui :Destination X-Tiles=int(7,1,20) +#@gui :Destination Y-Tiles=int(7,1,20) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Array [Regular]:fx_array,fx_array_preview(1) +#@gui :X-Tiles=int(2,1,10) +#@gui :Y-Tiles=int(2,1,10) +#@gui :X-Offset (%)=float(0,0,100) +#@gui :Y-Offset (%)=float(0,0,100) +#@gui :Mirror=choice("None","X-Axis","Y-Axis","XY-Axes") +#@gui :Size=_choice("Shrink","Expand","Repeat [Memory Consuming!]") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Ascii Art:fx_asciiart,fx_asciiart_preview(0)+ +#@gui :Charset=choice(5,"Custom","Binary Digits","Digits","Lowercase Letters","Uppercase Letters","Ascii","Card Suits","Math Symbols") +#@gui :Custom Dictionary=text(" .oO0") +#@gui :Analysis Scale=int(16,8,103) +#@gui :Analysis Smoothness=float(15,0,100) +#@gui :Synthesis Scale=int(16,8,103) +#@gui :Result Type=choice(2,"White on Black","Black on White","Colored on Black","Colored on Transparent") +#@gui :_=separator() +#@gui :Gamma=float(0,-3,3) +#@gui :Smoothness=float(0.2,0,5) +#@gui :Colors=choice("Full Colors","2 Colors","3 Colors","4 Colors","8 Colors","12 Colors","16 Colors","Grayscale","2 Grays","3 Grays","4 Grays","8 Grays","12 Grays","16 Grays") +#@gui :_=separator() +#@gui :Output Ascii File=_bool(0) +#@gui :Output Folder=_folder() +#@gui :Output Filename=_text("gmic_asciiart.txt") +#@gui :_=separator() +#@gui :_=link("Click here for a detailed description of this filter.","http://www.gimpchat.com/viewtopic.php?f=28&t=10047") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/27/03.") +#@gui Chessboard:fx_chessboard,fx_chessboard_preview(0) +#@gui :First Size=int(64,1,512) +#@gui :Second Size=int(64,1,512) +#@gui :First Offset=int(0,0,512) +#@gui :Second Offset=int(0,0,512) +#@gui :Angle=float(0,0,180) +#@gui :Opacity=float(0.5,0,1) +#@gui :First Color=color(#000000ff) +#@gui :Second Color=color(#ffffffff) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Dices:fx_dices,fx_dices(0) +#@gui :Resolution=float(2,1,10) +#@gui :Size=int(24,8,64) +#@gui :Color Model=choice(1,"Black Dices","White Dices","Dices with Colored Numbers","Dices with Colored Sides") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/27/06.") +#@gui Drawn Montage:fx_drawn_montage,fx_drawn_montage_preview(1) : * +#@gui :Layer=choice("1st","2nd","3rd","4th","5th","6th","7th","8th","9th","10th","11th","12th","13th","14th","15th","16th") +#@gui :Associated Color=color(#000000) +#@gui :Zoom=float(-10,0,10) +#@gui :X-Centering (%)=float(50,0,100) +#@gui :Y-Centering (%)=float(50,0,100) +#@gui :Angle=choice("0 Deg.","90 Deg.","180 Deg.","270 Deg.") +#@gui :_=value(-1) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=value(0:0:0:0:50:50:0) +#@gui :_=separator() +#@gui :_=note("Note: This filter requires a top layer containing the desired montage layout defined as free-form shapes of different colors. You can then assign each layer to a layout color to create the montage. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/01/29.") +#@gui Extract Objects:fx_extract_objects,fx_extract_objects_preview(1) +#@gui :Background Point (%)=point(0,0) +#@gui :_=separator() +#@gui :Color Tolerance=int(20,0,256) +#@gui :Opacity Threshold (%)=int(50,0,100) +#@gui :Minimal Area=float(0.3,0,5) +#@gui :Connectivity=choice("Low","High") +#@gui :Output As=_choice(0,"Crop","Segmentation") +#@gui :_=separator() +#@gui :Preview Guides=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/23/02.") +#@gui :_=link("Filter explained here","http://gimpchat.com/viewtopic.php?f=28&t=7905") +#@gui Grid [Cartesian]:fx_imagegrid,fx_imagegrid(0) +#@gui :X-Size=int(10,2,512) +#@gui :Y-Size=int(10,2,512) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Grid [Hexagonal]:fx_imagegrid_hexagonal,fx_imagegrid_hexagonal(1) +#@gui :Resolution=int(32,1,128) +#@gui :Outline=float(0.1,0,0.5) +#@gui :Anti-Aliasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/12/01.") +#@gui Grid [Triangular]:fx_imagegrid_triangular,fx_imagegrid_triangular(0) +#@gui :Pattern Width=int(10,8,128) +#@gui :Pattern Height=int(18,8,128) +#@gui :Pattern Type=choice(0,"Horizontal","Vertical","Crossed","Cube","Decreasing","Increasing") +#@gui :Outline Color=color(#ffffff80) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/08/07.") +#@gui Loose Photos:fx_loose_photos,fx_loose_photos_preview(1) +#@gui :_=note("Photo geometry:") +#@gui :Density (%)=float(60,0,100) +#@gui :Maximal Size (%)=float(40,0,100) +#@gui :Minimal Size (% of Max)=float(50,0,100) +#@gui :Maximal Ratio (%)=float(100,0,100) +#@gui :Minimal Ratio (% of Max)=float(50,0,100) +#@gui :Maximal Angle (deg.)=float(360,0,360) +#@gui :Minimal Angle (% of Max)=float(0,0,100) +#@gui :Frame Size (%)=float(2,0,20) +#@gui :Frame Color=color(#ffffff) +#@gui :_=separator() +#@gui :_=note("Photo content:") +#@gui :Rotation Probability (%)=float(50,0,100) +#@gui :Maximal Angle (deg.)=float(25,0,360) +#@gui :Minimal Angle (% of Max)=float(0,0,100) +#@gui :Background=color(#00000000) +#@gui :Background Image (%)=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("Shadow:") +#@gui :Opacity (%)=float(50,0,100) +#@gui :X-Shift (%)=float(1,-10,10) +#@gui :Y-Shift (%)=float(1,-10,10) +#@gui :Smoothness (%)=float(1,0,5) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2023/09/07.") +#@gui Make Seamless [Diffusion]:fx_make_seamless,fx_make_seamless_preview(1) +#@gui :Equalize Light=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Original=bool(0) +#@gui :Tiled Preview=choice(3,"None","2x1","1x2","2x2","3x3","4x4") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note{"Note: This filter helps in converting your input pattern as a seamless (a.k.a periodic) texture."} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/24/02.") +#@gui Make Seamless [Patch-Based]:fx_frame_seamless,fx_frame_seamless_preview(0) +#@gui :Frame Size=int(32,0,256) +#@gui :Patch Size=int(9,3,64) +#@gui :Blend Size=int(0,0,64) +#@gui :Frame Type=choice(1,"Inner","Outer") +#@gui :Equalize Light=float(100,0,100) +#@gui :_=separator() +#@gui :Preview Original=bool(0) +#@gui :Tiled Preview=choice(3,"None","2x1","1x2","2x2","3x3","4x4") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note{"Note: This filter helps in converting your input pattern as a seamless (a.k.a periodic) texture."} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/15/12.") +#@gui Ministeck:fx_ministeck,fx_ministeck_preview(1) +#@gui :Number of Colors=int(8,2,24) +#@gui :Resolution (px)=int(64,16,256) +#@gui :Piece Size (px)=int(8,1,64) +#@gui :Piece Complexity=int(2,1,10) +#@gui :Relief Amplitude=float(100,0,256) +#@gui :Relief Size=float(0.3,0,1) +#@gui :Add 1px Outline=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/14/01.") +#@gui Montage:fx_montage,fx_montage_preview(1) : * +#@gui :Montage Type=choice("Auto","Custom Layout","Horizontal","Vertical","Horizontal Array","Vertical Array") +#@gui :Custom Layout=text{"V(H(0,1),H(2,V(3,4)))"} +#@gui :Merging Mode=choice(1,"Aligned","Scaled") +#@gui :Centering / Scale=float(0.5,0,1) +#@gui :Padding (px)=int(0,0,128) +#@gui :_=separator() +#@gui :Frame (px)=int(0,0,128) +#@gui :Frame Color=color(#000000ff) +#@gui :_=separator() +#@gui :Angle=float(0,0,360) +#@gui :Angle Variations=float(0,0,180) +#@gui :_=separator() +#@gui :Cycle Layers=int(0,-255,255) +#@gui :Revert Layer Order=bool() +#@gui :Output As=_choice("Single Layer","Multiple Layers") +#@gui :_=separator() +#@gui :_=note{"Instructions:\n - Don't forget to set the Input layers... option on the left if you have multiple input layers for your montage.\n - The Custom layout parameter is only active when Montage type is set to Custom layout. This is basically a string containing expressions such as:\n \n . H(a,b) or V(a,b) stand respectively for an horizontal and vertical merge of two blocks a and b. \n . R(a), stands for a 90-deg. rotated version of a block a. Use RR(a) and RRR(a) for resp. 180-deg and 270-deg. rotations. \n . M(a), stands for a X-mirrored version of a block a. Use MRR(a) for a Y-mirrored version of a.\n\n - A block a can be a layer index or a nested montage expression itself.\n - Layer indices start from 0 (top layer) and are treated periodically. "} +#@gui :_=link("Click here for a tutorial","https://patdavid.net/2014/05/gmic-montage.html") +#@gui :_=link("+ video tutorial","http://www.youtube.com/watch?v=iM42vx22gwg") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/22/12.") +#@gui Puzzle:fx_puzzle,fx_puzzle_preview(1) +#@gui :_=note("Pattern parameters:") +#@gui :X-Tiles=int(5,2,32) +#@gui :Y-Tiles=int(5,2,32) +#@gui :Curvature=float(0.5,0,1.5) +#@gui :Connectors Centering=float(0,0,1) +#@gui :Connectors Variability=float(0,0,2) +#@gui :_=separator() +#@gui :_=note("Blending parameters:") +#@gui :Relief Smoothness=float(0.3,0,3) +#@gui :Relief Contrast=float(100,0,255) +#@gui :Outline Smoothness=float(0.2,0,3) +#@gui :Outline Contrast=float(255,0,255) +#@gui :_=separator() +#@gui :_=note("Recomposition parameters:") +#@gui :Scale=float(100,0,150) +#@gui :Scale Variations=float(0,0,100) +#@gui :Angle=float(0,-180,180) +#@gui :Angle Variations=float(0,0,180) +#@gui :Shuffle Pieces=bool(0) +#@gui :Additional Outline=bool(0) +#@gui :Output Each Piece on a Different Layer=_bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/06/01.") +#@gui Shuffle Patches:fx_shuffle_patches,fx_shuffle_patches_preview(0)* +#@gui :Mode=choice("Shuffle","Rotate","Shuffle & Rotate") +#@gui :Reconstruct From=choice("Colors","Gradients","Laplacians") +#@gui :Patch Size=int(64,4,512) +#@gui :Overlap (%)=float(0,0,50) +#@gui :Overlap Std (%)=float(20,0,100) +#@gui :Random Seed=int(0,0,65535) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2022/08/08.") +#@gui Taquin:fx_taquin,fx_taquin(1) +#@gui :X-Tiles=int(7,1,20) +#@gui :Y-Tiles=int(7,1,20) +#@gui :Remove Tile=choice("None","First","Last","Random") +#@gui :_=separator() +#@gui :Relief=float(50,0,255) +#@gui :Border Thickness (%)=float(5,0,100) +#@gui :Border Outline=int(0,0,16) +#@gui :Ouline Color=color(#000000ff) +#@gui :_=separator() +#@gui :Random Seed=int(0,0,65535) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/13/01.") +#@gui Tileable Rotation:fx_rotate_tileable,fx_rotate_tileable_preview(1) +#@gui :Angle=float(45,0,360) +#@gui :Maximum Size Factor=int(8,0,20) +#@gui :Array Mode=choice(0,"None","X-Axis","Y-Axis","Xy-Axes","2xy-Axes") +#@gui :_=separator() +#@gui :_=note("Note: This filter implements the tileable rotation technique described by Peter Yu, at:") +#@gui :_=link("[Peter Yu] Create rotated tileable patterns","http://www.peteryu.ca/tutorials/gimp/rotate_tileable_patterns") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/26/05.") +#@gui Tiled Isolation:fx_isolate_tiles,fx_isolate_tiles(0) +#@gui :X-Size=float(10,0,100) +#@gui :Y-Size=float(10,0,100) +#@gui :X-Border=float(5,0,100) +#@gui :Y-Border=float(5,0,100) +#@gui :Keep Tiles Square=bool(1) +#@gui :Keep Borders Square=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/13/04.") +#@gui Tiled Normalization:fx_normalize_tiles,fx_normalize_tiles(1) +#@gui :X-Tiles=int(25,1,80) +#@gui :Y-Tiles=int(25,1,80) +#@gui :Minimal Value=float(0,0,255) +#@gui :Maximal Value=float(255,0,255) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Tiled Parameterization:fx_parameterize_tiles,fx_parameterize_tiles(1) +#@gui :X-Tiles=int(10,1,30) +#@gui :Y-Tiles=int(10,1,30) +#@gui :Fitting Function=choice("Linear","Quadratic") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Tiled Random Shifts:fx_shift_tiles,fx_shift_tiles(1) +#@gui :X-Tiles=int(10,1,30) +#@gui :Y-Tiles=int(10,1,30) +#@gui :Amplitude=float(10,0,100) +#@gui :Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Tiled Rotation:fx_rotate_tiles,fx_rotate_tiles(1) +#@gui :X-Tiles=int(5,1,80) +#@gui :Y-Tiles=int(5,1,80) +#@gui :Angle=float(15,0,360) +#@gui :X-Shadow=float(3,-20,20) +#@gui :Y-Shadow=float(3,-20,20) +#@gui :Smoothness=float(1.8,0,5) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui _Artistic +#@gui Aurora:gcd_aurora,gcd_aurora(1) +#@gui :_=note("Simple aurora effect filter") +#@gui :_=separator() +#@gui :Vertical Amount=float(6,0,50) +#@gui :Horizontal Amount=float(1,0,50) +#@gui :Blend Mode=choice(0,"None","Average") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2013/02/09.") +#@gui Black Crayon Graffiti:fx_crayongraffiti2,fx_crayongraffiti2_preview(0) +#@gui :Amplitude=float(300,0,4000) +#@gui :Density=float(50,0,100) +#@gui :Smoothness=float(1,0,10) +#@gui :Opacity=float(0.4,0,1) +#@gui :Edge=float(12,0,50) +#@gui :Fast Approximation=bool(1) +#@gui :Color Smoothness=float(2,1,30) +#@gui :Mixer Style=choice(2,"Lightness","Value","Color Doping") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/07/12.") +#@gui Bokeh:fx_bokeh,fx_bokeh_preview(1) +#@gui :Number of Scales=int(3,1,10) +#@gui :Shape=choice(8,"Triangle","Square","Diamond","Pentagon","Hexagon","Octogon","Decagon","Star","Circular") +#@gui :Random Seed=int(0,0,65535) +#@gui :_=separator() +#@gui :_=note("Starting parameters:") +#@gui :Density=int(30,1,256) +#@gui :Radius (%)=float(8,0,50) +#@gui :Outline (%)=float(4,0,100) +#@gui :Inner Shade=float(0.3,0,1) +#@gui :Smoothness=float(0.2,0,8) +#@gui :Color=color(#d2d250a0) +#@gui :Color Dispersion=float(0.7,0,1) +#@gui :_=separator() +#@gui :_=note("Ending parameters:") +#@gui :Density=int(30,1,256) +#@gui :Radius (%)=float(20,0,50) +#@gui :Outline (%)=float(20,0,100) +#@gui :Inner Shade=float(1,0,1) +#@gui :Smoothness=float(2,0,8) +#@gui :Color=color(#aa82146e) +#@gui :Color Dispersion=float(0.15,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/02/07.") +#@gui Brushify:fx_brushify,fx_brushify_preview(0) +#@gui :_=note("Brush parameters:") +#@gui :Shape=choice(7,"Bottom Layer","Top Layer","Rectangle","Diamond","Pentagon","Hexagon","Octogon","Ellipse","Gaussian","Star","Heart") +#@gui :Ratio=float(0.25,0,1) +#@gui :Number of Sizes=int(4,1,16) +#@gui :Maximal Size=int(64,1,128) +#@gui :Minimal Size (%)=float(25,0,100) +#@gui :Number of Orientations=int(12,1,24) +#@gui :Fuzzyness=float(0,0,10) +#@gui :Smoothness=float(2,0,10) +#@gui :Light Type=choice(4,"None","Flat","Darken","Lighten","Full") +#@gui :Light Strength=float(0.2,0,1) +#@gui :Opacity=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Painting parameters:") +#@gui :Density (%)=float(30,0,100) +#@gui :Contour Coherence=float(1,0,1) +#@gui :Orientation Coherence=float(1,0,1) +#@gui :Gradient Smoothness=float(1,0,10) +#@gui :Structure Smoothness=float(5,0,10) +#@gui :Primary Angle=float(0,-180,180) +#@gui :Angle Dispersion=float(0.2,0,1) +#@gui :_=separator() +#@gui :Preview Brush=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/22/04.") +#@gui Cartoon:cartoon,fx_cartoon_preview(0) +#@gui :Smoothness=float(3,0,10) +#@gui :Sharpening=float(200,0,400) +#@gui :Edge Threshold=float(20,1,30) +#@gui :Edge Thickness=float(0.25,0,1) +#@gui :Color Strength=float(1.5,0,3) +#@gui :Color Quantization=int(8,2,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Circle Abstraction:fx_circle_abstraction,fx_circle_abstraction_preview(1) +#@gui :Number of Colors=int(8,2,16) +#@gui :Density=int(5,1,100) +#@gui :Opacity=float(0.8,0,1) +#@gui :Smoothness=float(0,0,4) +#@gui :Filled Circles=bool(1) +#@gui :Fill Transparent Holes=bool(1) +#@gui :Normalize Colors=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/16/06.") +#@gui Color Abstraction Paint:fx_ColorAbstractionPaint,fx_ColorAbstractionPaint_Preview(0) +#@gui :Abstraction=int(5,1,10) +#@gui :Ellipse Ratio=float(10,1,100) +#@gui :_=separator() +#@gui :_=note("Opacities, try 0 to see individual effect layers") +#@gui :Ellipsionism Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :Use as Hue=bool(0) +#@gui :Painting Opacity=float(1,-1,1) +#@gui :_=separator() +#@gui :Use as Saturation=bool(0) +#@gui :Color Abstraction Opacity=float(1,-1,1) +#@gui :Negative Color Abstraction=bool(0) +#@gui :Cubism on Color Abstraction=bool(0) +#@gui :Kuwahara on Painting=bool(0) +#@gui :Soften=float(0,0,100) +#@gui :Soften All Channels=bool(0) +#@gui :DoNotMergeLayers=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=link("Sample art here","http://www.flickr.com/photos/naggobot/6640743133/") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2014/02/23.") +#@gui Colored Pencils:fx_cpencil,fx_cpencil_preview(0) +#@gui :Size=float(1.3,0,5) +#@gui :Amplitude=float(50,0,200) +#@gui :Quantize Colors=int(20,2,255) +#@gui :Color Smoothness=float(2,0,30) +#@gui :Mixer Mode=choice(2,"Color Doping","Darken","Hard Light","Grain Merge","Lightness","Multiply","Soft Light","Value") +#@gui :Color Intensity=float(1,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2010/29/12.") +#@gui Comicbook:cl_comic,cl_comic_preview(0) +#@gui :_=note("Note: Photo to cartoon") +#@gui :_=separator() +#@gui :_=note(" ") +#@gui :Simplification=choice(0,"None","Light","Light Antialias","Strong Antialias","Median","Iuwt","Thin Brush","Mean Curvature") +#@gui :_=separator() +#@gui :_=note("For edges:") +#@gui :Flattening for Edge (bilateral)=int(2,0,5) +#@gui :Edge Method=choice(0,"Diff. of Gauss.","Diff. of BoxBlur","Diff. of Median") +#@gui :Edge Desaturation Method=choice(1,"Lightness","MaxRGB","MinRGB") +#@gui :Line Thickness=float(1,0.5,2) +#@gui :Line Strength=float(15,0,19) +#@gui :Line Antialias=int(15,0,100) +#@gui :_=separator() +#@gui :Add Colors=bool(1) +#@gui :_=note("For colors:") +#@gui :Luminosity Increase=int(10,0,50) +#@gui :Saturation Increase=int(20,0,50) +#@gui :Final Flattening (bilateral)=int(6,0,10) +#@gui :Color Effect=choice(2,"None","Deep Black","Local Contrast Enhancement","Colorful") +#@gui :Flat Color Effect=choice(0,"None","Rainbow","Hard Rainbow","Posterize Softly","Super Flat") +#@gui :Colors to Black or White=choice(0,"No","Soft Threshold","Threshold with Soft Antialias","Lines and Black") +#@gui :_=separator() +#@gui :Relief Effect=choice(0,"None","Groove","Bump") +#@gui :Special Effect=choice(0,"None","Dream","Past","Sketch of Future") +#@gui :_=separator() +#@gui :Final Antialias=choice(0,"None","Simple","Double") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=link("Filter discussed here","http://gimpchat.com/viewtopic.php?f=11&t=19335&p=266517#p266512") +#@gui :_=note("Author: Claude Lion. Latest Update: 2022/05/10.") +#@gui :_=note("It uses filters of David Tschumperlé and a few filters of Jérôme Boulanger.") +#@gui Cubism:fx_cubism,fx_cubism_preview(1) +#@gui :Iterations=int(2,0,10) +#@gui :Density=float(50,0,200) +#@gui :Thickness=float(10,0,50) +#@gui :Angle=float(90,0,360) +#@gui :Opacity=float(0.7,0.01,1) +#@gui :Smoothness=float(0,0,5) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/05/06.") +#@gui Cutout:fx_cutout,fx_cutout_preview(1) +#@gui :Number of Levels=int(4,2,32) +#@gui :Edge Simplicity=float(0.5,0,3) +#@gui :Edge Fidelity=int(4,0,10) +#@gui :Normalize=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé and Garagecoder       Latest Update: 2014/03/06.") +#@gui Diffusion Tensors:fx_diffusiontensors,fx_diffusiontensors_preview(0) +#@gui :Resolution (%)=float(10,0,20) +#@gui :Size=float(5,0,16) +#@gui :Color Mode=choice(3,"Monochrome","Grayscale","Orientation","Color") +#@gui :Outline=int(1,0,16) +#@gui :_=separator() +#@gui :Sharpness=float(0.15,0,1) +#@gui :Anisotropy=float(1,0,1) +#@gui :Gradient Smoothness=float(0,0,10) +#@gui :Tensor Smoothness=float(3,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/19/10.") +#@gui Doodle:fx_doodle,gui_no_preview(0) +#@gui :Precision (%)=float(30,0,100) +#@gui :Smoothness=float(2,0,10) +#@gui :Coherence=float(2,0,10) +#@gui :Contour Threshold=float(1.5,0,10) +#@gui :Spacing=int(2,0,20) +#@gui :Minimal Stroke Length=float(70,0,255) +#@gui :Preview Progression While Running=_bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/07/08.") +#@gui Dream Smoothing:fx_dreamsmooth,fx_dreamsmooth_preview(0) +#@gui :_=note("Updated for 1.5.4.0") +#@gui :_=note("A relatively slow filter that uses anisotropic filtering to smooth an image. More iterations produces softer image as does lower opacity values. Practical modes for merging are Alpha and Average. Note that results are resolution dependent.") +#@gui :_=separator() +#@gui :_=note("General settings") +#@gui :Iterations=int(3,1,10) +#@gui :Equalize at Each Step=bool(1) +#@gui :_=separator() +#@gui :_=note("Merging of iterations") +#@gui :Merging Option=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor","Edges") +#@gui :Opacity=float(0.8,0,1) +#@gui :Reverse Order=bool(0) +#@gui :_=note("Settings for layer mode edges") +#@gui :Smoothness=float(0.8,0,5) +#@gui :_=separator() +#@gui :_=note("Parallel processing settings. Increase spatial overlap if vertical bands appear.") +#@gui :Parallel Processing=choice(1,"Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note(" Author: Arto Huotari Latest update : 2014/02/20.") +#@gui :_=link("Sample processing here","http://www.flickr.com/photos/naggobot/7644006608/") +#@gui Ellipsionism:fx_ellipsionism,fx_ellipsionism_preview(0) +#@gui :Primary Radius=float(20,1,100) +#@gui :Secondary Radius=float(10,1,100) +#@gui :Smoothness=float(0.5,0,10) +#@gui :Opacity=float(0.7,0,1) +#@gui :Outline=float(3,1,3) +#@gui :Density=float(0.5,0.1,2) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Felt Pen:fx_feltpen,fx_feltpen_preview(0) +#@gui :Amplitude=float(300,0,4000) +#@gui :Density=float(50,0,100) +#@gui :Smoothness=float(1,0,10) +#@gui :Opacity=float(0.1,0,1) +#@gui :Edge=float(20,0,100) +#@gui :Thickness=int(5,2,32) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/25/10.") +#@gui Finger Paint:gtutor_fpaint,gtutor_fpaint_preview(0) +#@gui :_=note("Paint Detail") +#@gui :Finger Size=float(0.5,0,1) +#@gui :Keep Detail=float(0.5,0,1) +#@gui :Bristle Size=float(0.0,0,1) +#@gui :Edge Detect Includes Chroma=bool(0) +#@gui :_=separator() +#@gui :_=note("Render Detail") +#@gui :Light Direction=float(45.0,0,360.0) +#@gui :Shadow=float(0.5,0,1) +#@gui :Highlight=float(0.5,0,1) +#@gui :Specular=float(0.5,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Garry R. Osgood. Latest update: 2015/02/26.") +#@gui :_=link("Finger paint instructions and tutorial.","https://gmic.eu/oldtutorial/the-fingerpainting-filter.shtml") +#@gui :_=link("Fingerpaint theory.","https://gmic.eu/tutorial/fingerpainting.html") +#@gui Fractalize:fractalize,fractalize(1) +#@gui :Detail Level=float(0.8,0,1) +#@gui :_=separator() +#@gui :_=note("Note: This filter uses lot of random values to generate its result, so running it twice will give you different results !") +#@gui :_=separator() +#@gui :_=link("Click here for a detailed description of this filter.","http://www.gimpchat.com/viewtopic.php?f=28&t=10036") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/25/04.") +#@gui Ghost:fx_ghost,fx_ghost_preview(0) +#@gui :_=note("Ghost Effect:") +#@gui :Amplitude=float(200,0,1000) +#@gui :Smoothness=float(2,0,10) +#@gui :Coherence=float(2,0,10) +#@gui :Gamma=float(1,-3,3) +#@gui :_=separator() +#@gui :_=note("Normalization:") +#@gui :Amplitude=float(3,0,10) +#@gui :Radius=float(16,1,64) +#@gui :Invert=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/01/30.") +#@gui Graphic Boost:fx_graphic_boost4,fx_graphic_boost4(0) +#@gui :_=separator() +#@gui :_=note("Unsharp Mask controls") +#@gui :Radius=float(1.25,0,20) +#@gui :Darken=float(2,0,10) +#@gui :_=separator() +#@gui :Skip Others Steps=bool(false) +#@gui :_=note("Check for visual control, UNcheck to reactivate the other controls") +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("BW_Pencil Controls") +#@gui :Pencil Size=float(0.15,0,4) +#@gui :Pencil Amplitude=float(14,0,200) +#@gui :_=separator() +#@gui :Skip Others Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :Activate 'Pencil Smoother'=bool(true) +#@gui :_=note("If unchecked the 3 sliders below are disabled") +#@gui :Pencil Smoother Sharpness=float(0.5,0,2) +#@gui :Pencil Smoother Edge Protection=float(0.45,0,1) +#@gui :Pencil Smoother Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Skip Others Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Merging Options") +#@gui :Swap Layers=bool(True) +#@gui :_=note("'Swap' change the effect of Merging and Intesity") +#@gui :Merging Option=choice("Hard Light","Grain Merge","Multiply","Color Burn","Overlay","Value","Darken","Lightness","Luminance","*Colors Doping*","Comix Colors","Graphic Colours","Graphix Colors","Vivid Edges*","Dark Edges","Dark Screen","Vivid Screen","Interpolate") +#@gui :Opacity=float(1,0,1) +#@gui :Intensity=float(1,0,1) +#@gui :_=separator() +#@gui :Add Painter's Touch=bool(true) +#@gui :_=note("If unchecked the 3 sliders below are disabled") +#@gui :_=separator() +#@gui :Painter's Touch Sharpness=float(0.5,0,2) +#@gui :Painter's Edge Protection Flow=float(0.45,0,1) +#@gui :Painter's Smoothness=float(1,0,10) +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11 .") +#@gui :_=link("Filter explained here","http://www.gimpchat.com/viewtopic.php?f=9&t=775") +#@gui Graphic Novel:fx_graphic_novelfxl,fx_graphic_novelfxl(0) +#@gui :_=separator() +#@gui :_=note("Apply Local Normalization") +#@gui :Skip This Step=bool(false) +#@gui :_=separator() +#@gui :_=note("Local Normalization Controls") +#@gui :LN Amplititude=float(2,0,60) +#@gui :LN Size=float(6,0,64) +#@gui :LN Neightborhood-Smoothness=float(5,0,40) +#@gui :LN Average-Smoothness=float(20,0,40) +#@gui :_=separator() +#@gui :Skip All Other Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Pencil Options") +#@gui :Pencil Size=float(0.62,0,4) +#@gui :Pencil Amplitude=float(14,0,200) +#@gui :_=separator() +#@gui :Skip All Other Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :Activate 'Pencil Smoother'=bool(true) +#@gui :_=note("If unchecked the 3 sliders below are disabled") +#@gui :_=separator() +#@gui :Pencil Smoother Sharpness=float(0.5,0,2) +#@gui :Pencil Smoother Edge Protection=float(0.78,0,1) +#@gui :Pencil Smoother Smoothness=float(1.92,0,10) +#@gui :_=separator() +#@gui :Skip All Other Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Boost Merging Options") +#@gui :Swap Layers=bool(false) +#@gui :MIxer=choice("Overlay","Multiply","Soft Light","Color Burn","Darken","Stamp","Hard Light","Value","Grain Merge","Freeze","Lightness","Luminance","*Colors Doping","*Comix Colors*","Graphic Colours","*Graphix Colors","*Vivid Edges*","*Dark Edges*","*Dark Screen*","*Vivid Screen*","Interpolate") +#@gui :Opacity=float(1,0,1) +#@gui :Intensity=float(1,0,1) +#@gui :_=separator() +#@gui :Add Painter's Touch=bool(true) +#@gui :_=separator() +#@gui :Painter's Touch Sharpness=float(0.5,0,2) +#@gui :Painter's Edge Protection Flow=float(0.8,0,1) +#@gui :Painter's Smoothness=float(1.28,0,10) +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui :_=link("Filter explained here","http://www.gimpchat.com/viewtopic.php?f=9&t=1582") +#@gui Hard Sketch:fx_hardsketchbw,fx_hardsketchbw_preview(0) +#@gui :Amplitude=float(300,0,4000) +#@gui :Density=float(50,0,100) +#@gui :Smoothness=float(1,0,10) +#@gui :Opacity=float(0.1,0,1) +#@gui :Edge=float(20,0,100) +#@gui :Fast Approximation=bool(0) +#@gui :Color Model=choice(4,"Black on White","White on Black","Black on Transparent White","White on Transparent Black","Color on White") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Highlight Bloom:fx_highlight_bloom,fx_highlight_bloom_preview(0) +#@gui :Details Strength (%)=float(90,0,400) +#@gui :Details Scale=float(60,0,255) +#@gui :Smoothness=float(60,0,255) +#@gui :Highlight (%)=int(30,0,100) +#@gui :Contrast (%)=float(20,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/24/10.") +#@gui :_=separator() +#@gui :_=note("This effect has been inspired by:") +#@gui :_=link("This tutorial by Sebastien Guyader and Patrick David","https://pixls.us/articles/highlight-bloom-and-photoillustration-look/") +#@gui Hope Poster:fx_poster_hope,fx_poster_hope_preview(0)+ +#@gui :Gamma=float(0,-3,3) +#@gui :Smoothness=float(3,0,20) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/07/11.") +#@gui Hough Sketch:fx_houghsketchbw,fx_houghsketchbw_preview(0) +#@gui :Smoothness=float(1.25,0,10) +#@gui :Density (%)=float(10,0,100) +#@gui :Radius=int(5,0,30) +#@gui :Threshold=float(80,0,100) +#@gui :Opacity=float(0.1,0,1) +#@gui :Color Model=choice(4,"Black on White","White on Black","Black on Transparent White","White on Transparent Black","Color on White") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2023/05/29.") +#@gui Illustration Look:fx_illustration_look,fx_illustration_look_preview(0) +#@gui :Strength (%)=float(100,0,100) +#@gui :Tone Mapping (%)=float(100,0,100) +#@gui :Desaturate (%)=float(0,0,100) +#@gui :Vintage Tone (%)=float(0,0,100) +#@gui :Output as Multiple Layers=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Authors: Sébastien Guyader and David Tschumperlé. Latest update: 2017/05/01.") +#@gui Kuwahara:fx_kuwahara,fx_kuwahara_preview(0) +#@gui :Iterations=int(2,1,20) +#@gui :Radius=int(5,1,30) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/31/05.") +#@gui Lineart:cl_lineart,cl_lineart_preview(0) +#@gui :_=note("Photo to Line Art") +#@gui :_=separator() +#@gui :_=note(" ") +#@gui :Local Contrast Enhancement=int(0,0,4) +#@gui :Simplification=bool(0) +#@gui :_=separator() +#@gui :_=note("For edges:") +#@gui :Flattening for Edge (bilateral)=int(2,0,5) +#@gui :Line Thickness=float(1,0.5,2) +#@gui :Line Strength=float(15,0,19) +#@gui :Lines Antialias=int(15,0,100) +#@gui :_=separator() +#@gui :Add Black or Gray=bool(1) +#@gui :_=note("For black and grays:") +#@gui :Luminosity Increase=int(0,0,40) +#@gui :Final Flattening (bilateral)=int(6,0,10) +#@gui :Type=choice(2,"Soft Threshold","Gray Patches","Lines and Black","Black and Lines") +#@gui :_=separator() +#@gui :Final Antialias=choice(2,"None","Light Simple","Simple","Very Strong") +#@gui :Pen Drawing=choice(0,"None","Simple","Undoing Patterns") +#@gui :_=separator() +#@gui :Effect=choice(0,"None","Charcoal","Groove") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=link("Filter discussed here","http://gimpchat.com/viewtopic.php?f=15&t=5328&start=20#p272779") +#@gui :_=note("Author: Claude Lion. Latest Update: 2022/05/10.") +#@gui :_=note("It uses filters of David Tschumperlé and a few filters of Jérôme Boulanger.") +#@gui :_=note("Type='Lines and Black' is a shortcut of 'Black and Lines' with 'Local Contrast Enhancement = 1' and 'Luminosity Increase = 40'. In this case, 'Local Contrast Enhancement' and 'Luminosity Increase' cursors have no effect.") +#@gui Linify:fx_linify,fx_linify_preview(0) +#@gui :Density=float(40,0,100) +#@gui :Spreading=float(2,0,10) +#@gui :Resolution (%)=float(40,0,100) +#@gui :Line Opacity=float(10,0,30) +#@gui :Line Precision=int(24,1,128) +#@gui :Color Mode=choice(0,"Subtractive","Additive") +#@gui :_=separator() +#@gui :Preview Progression While Running=_bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note{"Note:\n\n - This filter is our own implementation of the nice algorithm proposed on the webpage http://linify.me.\n - This is a quite resource-demanding filter, so please be patient when running it.\n - It actually renders better when applied on small images (<1024). "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/11/21.") +#@gui Lylejk's Painting:fx_lylejk_painting,fx_lylejk_painting_preview(0) +#@gui :Iterations=int(10,1,20) +#@gui :Abstraction=int(2,1,20) +#@gui :Radius=int(4,1,30) +#@gui :Canvas=float(10,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: Lyle Kroll and David Tschumperlé.       Latest Update: 2015/23/02.") +#@gui :_=link("Filter Explained here","http://www.gimpchat.com/viewtopic.php?f=10&t=2624") +#@gui Make Squiggly:fx_Squiggly,fx_Squiggly_Preview(0) +#@gui :_=note("Squigles an image") +#@gui :_=note("Squigle parameters") +#@gui :Spread Noise Amount=float(2,0,20) +#@gui :Segmentation Edge Threshold=float(12,0,15) +#@gui :Segmentation Smoothness=float(0.8,0,5) +#@gui :GradienNormSmoothness=float(0,0,10) +#@gui :GradienNormLinearity=float(0.5,0,1.5) +#@gui :Invert Luminance=bool(1) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Optional color enhancement") +#@gui :_=note("Note that the effect of sliders depends on the merge setting.") +#@gui :Activate Color Enhancement=bool(0) +#@gui :Toggle to View Base Image=bool(0) +#@gui :_=note("Check this to view base image") +#@gui :IncreaseChroma1=float(3,1,4) +#@gui :Tone Threshold=float(0.2,0,1) +#@gui :Tone Gamma=float(0.4,0,1) +#@gui :_=note("Select merging mode to original") +#@gui :Merging Option=choice("Alpha","And","Average","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grain Extract","Grain Merge","Hard Light","Hue","Interpolation","Lighten","Lightness","Luminance","Multiply","Negation","Or","Overlay","Reflect","Saturation","Soft Light","Screen","Stamp","Value","Xor") +#@gui :Opacity=float(1,0,1) +#@gui :Reverse Order=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2013/09/28.") +#@gui :_=link("Filter Explained here","http://www.flickr.com/photos/naggobot/6667673847/") +#@gui Morphology Painting:fx_MorphoPaint,fx_MorphoPaint_preview(0) +#@gui :_=separator() +#@gui :_=note("Creates a painting using Morphology-, Segmentation- and Painting- filters. CPU intensive filter that may take long.") +#@gui :_=separator() +#@gui :_=note("Morphology settings") +#@gui :_=separator() +#@gui :Method=choice(1,"Erosion","Dilation","Opening","Closing") +#@gui :MorphoStrenght=int(18,2,60) +#@gui :Shape=choice(2,"Square","Octagonal","Circular") +#@gui :_=separator() +#@gui :_=note("Lightness for Morpholayer") +#@gui :Black Point=int(25,0,50) +#@gui :Expand Shadows=int(100,50,255) +#@gui :Compress Highlights=int(230,200,255) +#@gui :_=separator() +#@gui :_=note("Smoothing strength") +#@gui :Spread Amount=int(8,0,20) +#@gui :Blur Strength=int(3,0,10) +#@gui :_=separator() +#@gui :_=note("Segmentation settings") +#@gui :Edge Threshold=float(4,0,15) +#@gui :Smoothness=float(0.5,0,5) +#@gui :_=separator() +#@gui :_=note("Painting Settings") +#@gui :Abstraction=int(2,1,10) +#@gui :Details Scale=float(0.5,0,5) +#@gui :Smoothness=float(200,0,1000) +#@gui :_=separator() +#@gui :Merge Layers?=bool(1) +#@gui :_=note("When unchecked the filter will output layers separately for manual composing. Set G'Mic output to new layers.") +#@gui :_=separator() +#@gui :Enable Paintstroke=bool(1) +#@gui :Stroke Strength=float(1,0,1) +#@gui :Enable Segmentation=bool(1) +#@gui :Segments Strength=float(1,0,1) +#@gui :Enable Morphology=bool(1) +#@gui :Morphology Strength=float(1,0,1) +#@gui :Normalize=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2013/09/28.") +#@gui :_=link("Filter Explained here","http://www.flickr.com/photos/naggobot/6108637935/") +#@gui Paint With Brush:fx_paint_with_brush,fx_paint_with_brush_preview(0) +#@gui :Predefined Style=choice("Default","Felt Spots","Colored Edges","Circles","Dreamy","Fuzzy","Whirls","Smooth") +#@gui :_=value(-1) +#@gui :_=separator() +#@gui :_=note("Global Settings:") +#@gui :Painting Order=choice(1,"Random","Coarse to Fine","Fine to Coarse") +#@gui :Number of Iterations=int(16,1,128) +#@gui :Precision (%)=float(30,0,100) +#@gui :Details (%)=float(100,0,100) +#@gui :Background (%)=float(100,0,100) +#@gui :Sharpness (%)=float(10,0,100) +#@gui :Anisotropy (%)=float(80,0,100) +#@gui :Smoothness=float(0.5,0,8) +#@gui :Coherence=float(3,0,16) +#@gui :Twist Angle (°)=int(45,-1,360) +#@gui :_=note{"(-1 means 'Random Angle')."} +#@gui :Twist Strength (%)=int(0,-1,100) +#@gui :_=note{"(-1 means 'Angle Shift')."} +#@gui :Init Canvas=choice(6,"Black","Gray","White","Self","Blur","Kuwahara","Vector Painting") +#@gui :_=separator() +#@gui :_=note("Brush for Details:") +#@gui :Brush Diameter (px)=float(2,0,100) +#@gui :Stroke Length (px)=float(10,0,100) +#@gui :Hue Randomness (%)=float(0,0,100) +#@gui :Saturation Randomness (%)=float(0,0,100) +#@gui :Value Randomness (%)=float(0,0,100) +#@gui :Opacity (%)=float(60,0,100) +#@gui :_=separator() +#@gui :_=note("Brush for Background:") +#@gui :Brush Diameter (px)=float(20,0,100) +#@gui :Stroke Length (px)=float(1,0,100) +#@gui :Hue Randomness (%)=float(0,0,100) +#@gui :Saturation Randomness (%)=float(0,0,100) +#@gui :Value Randomness (%)=float(0,0,100) +#@gui :Opacity (%)=float(30,0,100) +#@gui :_=separator() +#@gui :_=note("Brush Dynamics:") +#@gui :Brush Diameter=float(15,0,255) +#@gui :Stroke Length=float(15,0,255) +#@gui :Hue Randomness=float(15,0,255) +#@gui :Saturation Randomness=float(15,0,255) +#@gui :Value Randomness=float(15,0,255) +#@gui :Opacity=float(15,0,255) +#@gui :Spatial Step=float(1,0,3) +#@gui :Angular Step (°)=float(45,0,90) +#@gui :_=separator() +#@gui :Preview Progression While Running=_bool(0) +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/08/30.") +#@gui Painting:fx_painting,fx_painting_preview(0)+ +#@gui :Abstraction=int(5,1,10) +#@gui :Details Scale=float(2.5,0,5) +#@gui :Color=float(1.5,0,4) +#@gui :Smoothness=float(50,0,1000) +#@gui :Sharpen Shades=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: Lyle Kroll, Angelo Lama and David Tschumperlé.       Latest Update: 2011/02/28.") +#@gui Pastell Art:fx_pastell,fx_pastell_preview(1) +#@gui :MasterOpacity=float(0.6,0.3,1) +#@gui :BG Textured=bool(1) +#@gui :Reverse Effect=bool(0) +#@gui :_=separator() +#@gui :_=note("Rodilius settings") +#@gui :Amplitude=float(20,0,30) +#@gui :Thickness=float(30,0,100) +#@gui :Sharpness=float(300,0,1000) +#@gui :Orientations=int(1,1,36) +#@gui :Offset=float(30,0,180) +#@gui :Color Mode=choice(1,"Darker","Lighter") +#@gui :_=separator() +#@gui :_=note("Gradient settings") +#@gui :Smoothness=float(1,0,10) +#@gui :Linearity=float(0.5,0,1.5) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :Activate Shakes=bool(0) +#@gui :Amount=float(10,0,30) +#@gui :Strength=float(3,1,300) +#@gui :_=separator() +#@gui :Activate Lizards=bool(0) +#@gui :Toes=float(9,0,300) +#@gui :Shivers=float(3,0,4) +#@gui :_=separator() +#@gui :Activate Pink Elephants=bool(0) +#@gui :Trunks=float(12,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2013/09/28.") +#@gui :_=link("Filter Explained here","http://www.flickr.com/photos/naggobot/6294075073/") +#@gui Pen Drawing:fx_pen_drawing,fx_pen_drawing_preview(0)+ +#@gui :Amplitude=float(10,0,30) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Photoillustration:fx_tk_photoillustration,fx_tk_photoillustration_preview(0) +#@gui :_=note("adding an illustrative effect to any photograph") +#@gui :_=separator() +#@gui :Local Contrast Style=choice("Tone Mapping","Tone Mapping Soft","Tone Mapping Fast","Local Normalisation","Unsharp Mask","Global Mapping","Dynamic Range Increase","None") +#@gui :Local Contrast Effect=float(0.25,0.00,2.5) +#@gui :Smoothing Style=choice("Anisotropic","Bilateral","Color Channel Smoothing","Segmentation","Morphological Closing","Selective Gaussian","Wavelet","Kuwahara","None") +#@gui :Contour Precision=float(0.30,0.00,1.00) +#@gui :Area Smoothness=float(0.50,0.00,10.00) +#@gui :Sharpening Radius=float(0.50,0.00,10.00) +#@gui :Sharpening Strength=float(1.00,0.00,5.00) +#@gui :Special Effects=choice("None","Soft Glow","Dusty","Orton Glow","Extra Smooth","Bloom","Paintstroke") +#@gui :Effect Strength=float(5.00,0.00,20.00) +#@gui :Overall Lightness=float(0,-50,50) +#@gui :Overall Contrast=float(1,0.5,1.5) +#@gui :Shadows Lightness=float(0,-100,100) +#@gui :Highlights Lightness=float(0,-100,100) +#@gui :Mid Tone Contrast=float(1,0.5,4) +#@gui :Color Green-Magenta=float(0,-20,20) +#@gui :Color Blue-Yellow=float(0,-20,20) +#@gui :Color Boost=float(1.2,0,4) +#@gui :Detail Reconstruction Detection=float(98.5,50,100) +#@gui :Detail Reconstruction Smoothness=float(5,0,10) +#@gui :Detail Reconstruction Strength=float(0.5,0,1) +#@gui :Detail Reconstruction Style=choice("Micro/macro Details Adjusted","Fine","Strong","High Pass","Artistic Round","Artistic Hard","Artistic Modern","Comic Style","Gritty","None") +#@gui :Keep Detail Layer Separate=bool(0) +#@gui :Remove Artifacts From Micro/Macro Detail=bool(0) +#@gui :Skin Tone Protection=bool(0) +#@gui :Sharpen Edges Only=bool(0) +#@gui :Computation Mode=choice(1,"High Quality","Normal","High Speed") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil Latest update: 2012/08/28.") +#@gui Polygonize [Delaunay]:fx_polygonize_delaunay,fx_polygonize_delaunay_preview(0) +#@gui :Density (%)=float(40,0,100) +#@gui :Edges=float(5,0,100) +#@gui :Boundaries (%)=float(75,0,100) +#@gui :Smoothness=float(0.5,0,8) +#@gui :Filling=choice(3,"Black","White","Random","Average","Linear") +#@gui :Outline (%)=float(50,0,100) +#@gui :Outline Color=color(#000000ff) +#@gui :Anti-Aliasing=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/06/05.") +#@gui Polygonize [Energy]:fx_polygonize,fx_polygonize_preview(0) +#@gui :Amplitude=int(300,0,2000) +#@gui :Smoothness=float(10,0,100) +#@gui :Minimal Area=float(10,0,100) +#@gui :X-Resolution=float(10,1,256) +#@gui :Y-Resolution=float(10,1,256) +#@gui :Outline Color=color(#000000ff) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=link("Click here for a detailed description of this filter.","http://www.gimpchat.com/viewtopic.php?f=28&t=9174") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/02/12.") +#@gui Poster Edges:fx_poster_edges,fx_poster_edges_preview(0) +#@gui :Image Smoothness=float(20,0,100) +#@gui :Edge Threshold=float(60,0,100) +#@gui :Edge Shade=float(5,0,30) +#@gui :Edge Thickness=float(0,0,5) +#@gui :Edge Antialiasing=float(10,0,100) +#@gui :Posterization Level=int(0,0,15) +#@gui :Posterization Antialiasing=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=link("Click here for a detailed description of this filter.","http://www.davidrevoy.com/article147/gmic-new-filter-poster-edges") +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé and David Revoy.       Latest Update: 2012/30/11.") +#@gui Posterize:fx_posterize,fx_posterize_preview(0) +#@gui :Smoothness=float(150,0,800) +#@gui :Edges (%)=float(30,0,100) +#@gui :Paint=float(1,0,10) +#@gui :Colors=int(12,2,64) +#@gui :Minimal Area=int(0,0,64) +#@gui :Outline (%)=float(0,0,100) +#@gui :Normalize Colors=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/25/10.") +#@gui Posterized Dithering:fx_pdithered,fx_pdithered_preview(0) +#@gui :Gamma=float(1,0.01,5) +#@gui :Contrast=float(1,0,4) +#@gui :Brightness=float(0,-255,255) +#@gui :Smoothness=float(0,0,10) +#@gui :Quantize Colors=int(20,2,255) +#@gui :Smooth Colors=float(1,0,30) +#@gui :Mixer Mode=choice("Color Doping","Darken","Soft Light","Grain Merge","Multiply","Value") +#@gui :Color Intensity=float(1,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2010/29/12.") +#@gui Quadtree Variations:fx_quadtree,fx_quadtree_preview(1) +#@gui :Mode=choice("Squares","Sierpinksi Design","Ellipse Painting") +#@gui :Precision=int(1024,2,4096) +#@gui :Homogeneity=float(0.5,0,2) +#@gui :Outline=int(0,0,4) +#@gui :_=separator() +#@gui :_=note("For 'Ellipse painting' only:") +#@gui :Primary Radius=float(3,0,5) +#@gui :Secondary Radius=float(1.5,0,5) +#@gui :Anisotropy=float(1,0,4) +#@gui :Only Leafs=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/15/06.") +#@gui Rodilius:fx_rodilius,fx_rodilius_preview(1) +#@gui :Amplitude=float(10,0,30) +#@gui :Thickness=float(10,0,100) +#@gui :Sharpness=float(300,0,1000) +#@gui :Orientations=int(5,2,36) +#@gui :Offset=float(30,0,180) +#@gui :Smoothness=int(0,0,5) +#@gui :Color Mode=choice(1,"Darker","Lighter") +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=link("Click here for a video tutorial","http://www.youtube.com/watch?v=RC07VUpzwGc") +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé and Rod/GimpChat.       Latest Update: 2013/05/03.") +#@gui Shapeism:fx_shapeism,fx_shapeism_preview(0)+ +#@gui :Shape=choice(2,"Squares","Triangles","Circles","Diamond","Hexagon","Octagon","Stars","Custom") +#@gui :Branches=int(7,3,16) +#@gui :Thickness=float(0.38,0,1) +#@gui :Angle=float(0,0,360) +#@gui :_=note("Note: Parameters Branches, Thickness and Angle are used only for Custom shapes.") +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :Scales=int(5,1,16) +#@gui :Maximal Size=int(32,1,256) +#@gui :Minimal Size=int(8,1,256) +#@gui :Allow Angle=choice(3,"0 Deg.","180 Deg.","90 Deg.","Any") +#@gui :Spacing=int(1,-5,5) +#@gui :Precision=int(5,1,10) +#@gui :Edges=float(0.5,0,2) +#@gui :Smoothness=float(1,0,10) +#@gui :Background=color(#000000ff) +#@gui :_=separator() +#@gui :_=link("Click here for a detailed description of this filter.","http://gimpchat.com/viewtopic.php?f=28&t=7500&sid=5b483979826903b8f8fc8fdaf1767dae") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/11/06.") +#@gui Sharp Abstract:fx_sharp_abstract,fx_sharp_abstract_preview(0) +#@gui :Spatial Scale=float(4,0,32) +#@gui :Value Scale=float(10,0,16) +#@gui :Precision=float(0.5,0,2) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/09.") +#@gui Simple Noise Canvas:fx_SimpleNoiseCanvas,fx_SimpleNoiseCanvasPreview(0) +#@gui :_=note("Simpe noise based xy canvas effect. Preserve canvas and bumpmap image with canvas after filtering for best results. Merge option DoNothing outputs only original image if Preserve canvas option is not selected.") +#@gui :_=separator() +#@gui :Scale Factor=float(0,0,1) +#@gui :_=separator() +#@gui :_=note("Noise Parameters") +#@gui :Amplitude=float(3,0,20) +#@gui :Noise Type=choice(2,"Gaussian","Uniform","Salt and Pepper","Poisson") +#@gui :_=separator() +#@gui :_=note("Thread Length") +#@gui :Horisontal Length=float(5,2,15) +#@gui :Vertical Length=float(5,2,15) +#@gui :Overall Blur=float(0,0,15) +#@gui :Canvas Brightness=float(255,230,255) +#@gui :Canvas Darkness=float(0,0,255) +#@gui :_=separator() +#@gui :_=note("How to combine XY threads") +#@gui :Merging Option=choice(2,"Average","Multiply","Darken","Edges") +#@gui :Invert Canvas Colors=bool(0) +#@gui :Invert Image Colors=bool(0) +#@gui :_=note("How to combine image + canvas") +#@gui :Reverse Order=bool(0) +#@gui :Merging Option=choice(1,"Avg","Multiply","Scr","Darken","Lighten","Dif","Negation","Exclusion","Overlay","Hardlight","Softlight","Dodge","Colorburn","Reflect","Freeze","Stamp","Interpolate","Grainext","Grainmerge","Xor","Edges","DoNothing") +#@gui :Preserve Canvas for Post Bump Mapping=bool(0) +#@gui :Canvas Color=color(#ffffffff) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2013/09/28.") +#@gui :_=link("Filter Explained here","http://www.flickr.com/photos/naggobot/6152040642/") +#@gui Sketch:fx_sketchbw,fx_sketchbw_preview(0) +#@gui :Number of Orientations=int(3,1,16) +#@gui :Starting Angle=float(45,0,180) +#@gui :Angle Range=float(180,0,180) +#@gui :Stroke Length=float(30,0,1000) +#@gui :Contour Threshold=float(1.75,0,10) +#@gui :Opacity=float(0.02,0,0.3) +#@gui :Background Intensity=float(0.5,0,2) +#@gui :Density=float(0.75,0,5) +#@gui :Sharpness=float(0.1,0,1) +#@gui :Anisotropy=float(0.7,0,1) +#@gui :Smoothness=float(3,0,10) +#@gui :Coherence=float(6,0,10) +#@gui :Boost Stroke=bool(0) +#@gui :Curved Stroke=bool(1) +#@gui :Color Model=choice(4,"Black on White","White on Black","Black on Transparent White","White on Transparent Black","Color on White") +#@gui :Random Seed=int(0,0,65535) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/05/11.") +#@gui Smooth Abstract:fx_smooth_abstract,fx_smooth_abstract_preview(0) +#@gui :Smoothness (%)=float(75,0,100) +#@gui :Regularization=choice(0,"Isotropic","Delaunay-Guided","Edge-Oriented") +#@gui :Regularization Iterations=int(20,0,100) +#@gui :Geometry=float(1,0,5) +#@gui :Details=float(30,0,50) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/06/04.") +#@gui Stylize:fx_stylize,fx_stylize_preview +#@gui :Style=choice{0,"Custom Style (Top Layer)","Custom Style (Bottom Layer)","Braque: Landscape near Antwerp","Braque: Le Viaduc à L'Estaque","Braque: Little Bay at La Ciotat","Braque: The Mandola","Christine Garner: Black Colour Pencil","Christine Garner: Colour Pencil Sepia","Christine Garner: Dark Coloured Pencil","Christine Garner: Pencil","Christine Garner: Sketching Pastel","Christine Garner: Willow Charcoal","Delaunay: Windows Open Simultaneously","Delaunay: Portrait De Metzinger","Hokusai: The Great Wave","Kandinsky: Squares with Concentric Circles","Kandinsky: Yellow-Red-Blue","Klee: Death and Fire","Klee: In the Style of Kairouan","Klee: Oriental Pleasure Garden Anagoria","Klee: Polyphony 2","Klee: Red Waistcoat","Klimt: The Kiss","Mondrian: Composition in Red-Yellow-Blue","Mondrian: Evening; Red Tree","Mondrian: Gray Tree","Monet: San Giorgio Maggiore at Dusk","Monet: Water-Lily Pond","Monet: Wheatstacks - End of Summer","Munch: The Scream","Picabia: Udnie","Picasso: Les Demoiselles D'Avignon","Picasso: Seated Woman","Picasso: The Reservoir - Horta De Ebro","Pollock: Convergence","Pollock: Summertime Number 9A","Van Gogh: Almond Blossom","Van Gogh: Irises","Van Gogh: The Starry Night","Van Gogh: Wheat Field with Crows"} +#@gui :Scale Style to Fit Target Resolution=choice(5,"No Rescaling","10%","20%","30%","50%","75%","100%","150%","200%","250%","300%") +#@gui :Style Variations=choice("None","All XY-Flips","All 90° Rotations","All 45° Rotations") +#@gui :Preview Progression While Running=bool(1) +#@gui :_=separator() +#@gui :_=note("Style/Target Parameters:") +#@gui :Fidelity to Target (Finest)=float(0.5,0,5) +#@gui :Fidelity to Target (Coarsest)=float(2,0,5) +#@gui :Fidelity Smoothness (Finest)=float(3,0,5) +#@gui :Fidelity Smoothness (Coarsest)=float(0.5,0,5) +#@gui :Fidelity Chromaticity=float(0.1,0,1) +#@gui :_=separator() +#@gui :_=note("Image Matching Parameters:") +#@gui :Match Colors With=choice(3,"Nothing","Gamma Balance","Histogram Transfer","PCA Transfer") +#@gui :Colorspace=choice{3,"SRGB","Linear RGB","YCbCr","YCbCr (Luma/Chroma),"YCbCr (Luma Only)","YCbCr (Chroma Only)","Lab","Lab (Luma/Chroma)","Lab (Luma Only)","Lab (Chroma Only)"} +#@gui :Keep Color Channels=choice{"All","Luminance Only (YCbCr)","Luminance Only (Lab)","Chrominances Only (CbCr)","Chrominances Only (ab)"} +#@gui :Smoothness=float(0.7,0,5) +#@gui :Also Match Gradients=float(1,0,5) +#@gui :_=separator() +#@gui :_=note("Advanced Parameters:") +#@gui :Init. Type=choice("Best Match","Identity","Randomized") +#@gui :Init. Resolution=choice(1,"8px","16px","32px","64px","128px","256px") +#@gui :Init. With High Gradients Only=float(0,0,100) +#@gui :Patch Size for Analysis=int(5,2,16) +#@gui :Patch Size for Synthesis=int(5,2,16) +#@gui :Patch Size for Synthesis (Final)=int(7,2,16) +#@gui :Number of Matches (Finest)=int(1,0,10) +#@gui :Number of Matches (Coarsest)=int(30,0,200) +#@gui :Penalize Patch Repetitions=int(2,0,300) +#@gui :Matching Precision (Smaller Is Faster)=float(2,0,10) +#@gui :Scale Factor=float(1.85,1.1,4) +#@gui :Skip Finest Scales=int(0,0,3) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/03/23.") +#@gui Vector Painting:fx_vector_painting,fx_vector_painting_preview(1) +#@gui :Details=float(9,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/08/25.") +#@gui Warhol:warhol,warhol(1) +#@gui :X-Tiles=int(3,1,10) +#@gui :Y-Tiles=int(3,1,10) +#@gui :Smoothness=float(2,0,10) +#@gui :Color=float(40,0,60) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Whirl Drawing:fx_draw_whirl,fx_draw_whirl_preview(0) +#@gui :Amplitude=float(20,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui _Black & White +#@gui B&W Stencil:fx_stencilbw,fx_stencilbw_preview(0) +#@gui :Threshold=float(10,0,30) +#@gui :Smoothness=float(10,0,30) +#@gui :Hue=float(0,0,360) +#@gui :Saturation=float(0,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Black & White:fx_blackandwhite,fx_blackandwhite_preview(1)+ +#@gui :Red Level=float(0.299,0,1) +#@gui :Red Smoothness=float(0,0,10) +#@gui :Green Level=float(0.587,0,1) +#@gui :Green Smoothness=float(0,0,10) +#@gui :Blue Level=float(0.114,0,1) +#@gui :Blue Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :Grain (Shadows)=float(0,0,200) +#@gui :Grain (Midtones)=float(0,0,200) +#@gui :Grain (Highlights)=float(0,0,200) +#@gui :Grain Tone Fading=float(2,0,10) +#@gui :Grain Scale=float(0,0,3) +#@gui :Grain Type=choice("Gaussian","Uniform","Salt and Pepper","Poisson") +#@gui :_=separator() +#@gui :Local Contrast=float(0,0,60) +#@gui :Radius=int(16,1,512) +#@gui :Contrast Smoothness=float(4,0,10) +#@gui :_=separator() +#@gui :Pseudo-Gray Dithering=int(0,0,5) +#@gui :Use Maximum Tones=bool(false) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/20/02.") +#@gui Charcoal:fx_charcoal,fx_charcoal_preview(0) +#@gui :Granularity=int(65,0,800) +#@gui :Lowlights Crossover Point=int(70,0,255) +#@gui :Highlights Crossover Point=int(170,0,255) +#@gui :Boost Contrast=bool(0) +#@gui :Resize Image for Optimum Effect=bool(1) +#@gui :Add Chalk Highlights=bool(0) +#@gui :Minimal Highlights=int(50,0,255) +#@gui :Maximal Highlights=int(70,0,255) +#@gui :Background Color=color(#ffffff) +#@gui :Foreground Color=color(#000000) +#@gui :Invert Background / Foreground=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/17/03.") +#@gui :_=note("Inspired from the Charcoal script by micomicon :") +#@gui :_=link("http://registry.gimp.org/node/25078") +#@gui Colorize [Interactive]:fx_colorize_interactive,fx_colorize_interactive_preview +#@gui :Input Type=_choice("B&W Photograph","Lineart") +#@gui :Output Type=_choice{"Colorized Image (1 Layer)","Colors Only (1 Layer)","Image + Colors (2 Layers)","Image + Colors (Multi-Layers)"} +#@gui :View Resolution=_choice{1,"Small (Faster)","Medium","High (Slower)","Very High (Even Slower)"} +#@gui :1st Additional Palette (.gpl)=_filein() +#@gui :2nd Additional Palette (.gpl)=_filein() +#@gui :Image to Grab Color from (.png)=_filein() +#@gui :_=separator() +#@gui :_=note{"Description:\n This filter allows to quickly colorize a B&W image or lineart. Click on the Apply or OK buttons below to open the G'MIC interactive window and start adding color control points. When you're done, exit the interactive window: your colored result will be transferred back to the host software.\n\n If you are not satisfied with the result, Undo it (CTRL+Z), and click on Apply once again to modify your control points defined previously. To clear all control points, click on the Reset button above. "} +#@gui :Clear Control Points=button(0.5) +#@gui :_=value(0,0) +#@gui :_=value(-1) +#@gui :_=separator() +#@gui :_=note{"Interactions:\n Use the following actions in the interactive window to manage your colorization :\n\n - Left mouse button creates a new color control point (or move an existing one).\n - Right mouse button or key X over a control point deletes it.\n - Right mouse button or key P anywhere else picks a color from the image.\n - Mouse wheel, or keys CTRL+arrows up/down zoom view in/out.\n - CTRL+mouse wheel, SHIFT+wheel or arrow keys move image in zoomed view.\n - Key SPACE updates the extrapolated color field.\n - Key TAB toggles markers view modes.\n - Key BACKSPACE deletes the last control point added.\n - Key PAGE UP increases image contrast.\n - Key PAGE DOWN decreases image contrast.\n - Key R enters/exits color replace mode.\n - Keys CTRL+D increase window size.\n - Keys CTRL+C decrease window size.\n - Keys CTRL+R resets window size.\n - Keys ESC, Q or ENTER exit the interactive window. "} +#@gui :_=separator() +#@gui :_=note("You can find more information on how to use this filter here :") +#@gui :_=link("David Revoy's G'MIC Colorization Page","http://www.davidrevoy.com/article240/gmic-line-art-colorization") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/12/07.") +#@gui Colorize [Photographs]:fx_recolorize,fx_recolorize_preview(1) +#@gui :Smoothness=int(2,0,6) +#@gui :Anisotropy=float(0.2,0,1) +#@gui :Output Mode=choice("Merge Brightness / Colors","Split Brightness / Colors") +#@gui :_=separator() +#@gui :_=note{"Note: This filter needs two layers to work properly. The bottom layer must be a B&W image, while the top layer contains color patches that will be extrapolated in a smart way (edge-directed) to fill the entire image. At the end, you get a completely recolored image."} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/16/01.") +#@gui Colorize [with Colormap]:fx_bwrecolorize,fx_bwrecolorize_preview +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Normalize Input=bool(0) +#@gui :_=separator() +#@gui :Gradient Preset=choice("User-Defined","Black to White","White to Black","Sepia","Solarize") +#@gui :Interpolation Type=choice(1,"Nearest","Linear","Cubic","Lanczos") +#@gui :Preserve Initial Brightness=bool(0) +#@gui :_=separator() +#@gui :_=note("User-defined gradient :") +#@gui :Number of Tones=int(5,2,8) +#@gui :1st Tone=color(#000000ff) +#@gui :2nd Tone=color(#2b1937ff) +#@gui :3rd Tone=color(#9e89bdff) +#@gui :4th Tone=color(#e0bfe4ff) +#@gui :5th Tone=color(#ffffffff) +#@gui :6th Tone=color(#ffffffff) +#@gui :7th Tone=color(#ffffffff) +#@gui :8th Tone=color(#ffffffff) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Colorize Lineart [Auto-Fill]:fx_autofill_lineart,fx_autofill_lineart_preview(0) +#@gui :Contour Threshold (%)=float(90,0,100) +#@gui :Contour Normalization=bool(1) +#@gui :Minimal Region Area=int(8,0,256) +#@gui :Tolerance to Gaps=int(0,0,10) +#@gui :Preview Type=choice("Lineart + Colors","Colors Only") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/12/11.") +#@gui Colorize Lineart [Propagation]:fx_colorize_lineart,fx_colorize_lineart_preview(1) +#@gui :_=note("Layers ordering:") +#@gui :Input Layers=choice(0,"Color Spots + Lineart","Lineart + Color Spots","Color Spots + Extrapolated Colors + Lineart","Lineart + Color Spots + Extrapolated Colors") +#@gui :Output Layers=_choice{1,"Single (Merged)","Extrapolated Colors + Lineart","Lineart + Extrapolated Colors","Color Spots + Extrapolated Colors + Lineart","Lineart + Color Spots + Extrapolated Colors"} +#@gui :Extrapolate Colors As=choice("One Layer","Two Layers","Three Layers","Four Layers","Five Layers","Six Layers","Seven Layers","Eight Layers","Nine Layers","Ten Layers","One Layer per Single Color","One Layer per Single Region") +#@gui :_=separator() +#@gui :Smoothness=float(0.05,0,1) +#@gui :_=separator() +#@gui :_=note{"Note: You probably need to select All for the Input layers option on the left.\n Color Spots = your layer with color indications.\n Lineart = your layer with line-art (B&W or transparent).\n Extrapolated Colors = the G'MIC generated layer with flat colors.\n\n Warnings: \n - Do not rely too much on the preview, it is probably not accurate ! \n - Activate option Extrapolate color as one layer per single color/region only if you have a lot of available memory ! "} +#@gui :_=separator() +#@gui :_=link("Click here for a detailed description of this filter.","http://www.gimpchat.com/viewtopic.php?f=28&t=7567") +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé, Timothée Giet and David Revoy.       Latest Update: 2013/19/06.") +#@gui Colorize Lineart [Smart Coloring]:fx_colorize_lineart_smart,fx_colorize_lineart_smart_preview(0) +#@gui :Colorize Mode=choice("Generate Random-Colors Layer","Extrapolate Color Spots on Transparent Top Layer","Auto-Clean Bottom Color Layer") +#@gui :_=separator() +#@gui :_=note("Global geometry parameters:") +#@gui :Contour Detection (%)=float(95,0,100) +#@gui :Discard Contour Guides=bool(0) +#@gui :_=note{"Add strokes with a saturated color having value 255 (e.g. pure red) on your lineart allows to guide the colorization algorithm with virtual contours."} +#@gui :Output Region Delimiters=_bool(0) +#@gui :_=separator() +#@gui :_=note("For Random colors mode only:") +#@gui :Make Hue Depends on Region Size=float(1,0,1) +#@gui :Maximal Color Saturation=int(24,0,255) +#@gui :Minimal Color Intensity=int(200,0,255) +#@gui :_=separator() +#@gui :_=note("For color spots mode only:") +#@gui :Color Shading (%)=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("Connection parameters:") +#@gui :End Point Rate (%)=float(75,0,100) +#@gui :End Point Connectivity=int(2,1,5) +#@gui :Spline Max Length (px)=float(60,0,256) +#@gui :Segment Max Length (px)=float(20,0,256) +#@gui :Spline Max Angle (deg)=float(90,0,180) +#@gui :Spline Roundness=float(1,0,2) +#@gui :Minimal Region Area=float(10,0,100) +#@gui :Allow Self Intersections=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice(0,"Colored Geometry","Colored Regions","Colored Lineart") +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé, Sébastien Fourey and David Revoy.      Latest Update: 2018/11/09.") +#@gui Desaturate Norm:fx_gcd_norm_eq,fx_gcd_norm_eq_preview(0) +#@gui :_=note("Desaturate sRGB using equalized norm") +#@gui :_=separator() +#@gui :Red=float(0.5,0,1) +#@gui :Blue=float(0.5,0,1) +#@gui :Exp=float(2,1,3) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2016/12/27.") +#@gui Dithering:fx_ditheredbw,fx_ditheredbw_preview(0) +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue=float(0,0,360) +#@gui :Saturation (%)=float(0,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Engrave:fx_engrave,fx_engrave_preview(0) +#@gui :_=note("Black & White foreground:") +#@gui :Radius=float(0.5,0,2) +#@gui :Density=float(50,0,200) +#@gui :Edges=float(0,0,10) +#@gui :Coherence=float(8,0,40) +#@gui :Threshold (%)=float(40,0,100) +#@gui :Minimal Area=int(0,-256,256) +#@gui :Flat Regions Removal=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Color background:") +#@gui :Add Color Background=bool() +#@gui :Quantization=float(10,0,40) +#@gui :Shading=int(1,0,5) +#@gui :Hue=float(0,-180,180) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :Lightness (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :Anti-Aliasing=choice(1,"Disabled","X1.5","X2","X3") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: Lyle Kroll and David Tschumperlé.       Latest Update: 03/13/2015.") +#@gui Filaments:fx_filaments,fx_filaments(0)+ +#@gui :Density (%)=float(50,0,100) +#@gui :Length (%)=float(50,0,100) +#@gui :Contour (%)=float(75,0,100) +#@gui :Distortion (%)=float(30,0,100) +#@gui :Smoothness=float(10,0,100) +#@gui :Rotation (deg.)=float(0,-180,180) +#@gui :Local Normalization=bool(1) +#@gui :_=separator() +#@gui :Throw From Left=bool(1) +#@gui :Throw From Right=bool(1) +#@gui :Throw From Above=bool(1) +#@gui :Throw From Below=bool(1) +#@gui :_=separator() +#@gui :Opacity (%)=float(50,0,100) +#@gui :Color Model=choice("White on Black","Black on White","White on Transparent","Black on Transparent") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2023/12/18.") +#@gui Freaky B&W:fx_freaky_bw,fx_freaky_bw_preview +#@gui :Strength (%)=float(90,0,100) +#@gui :Oddness (%)=float(20,0,100) +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/30/09.") +#@gui Ink Wash:fx_ink_wash,fx_ink_wash(0) +#@gui :_=note("Ink wash controls") +#@gui :Size=float(0.14,0,4) +#@gui :Amplitude=float(23,0,200) +#@gui :_=separator() +#@gui :_=note("Check if you wish visual control on this step") +#@gui :Skip All Other Steps=bool(false) +#@gui :_=note("UNcheck to reactivate the other controls") +#@gui :_=separator() +#@gui :Smoother Sharpness=float(0.5,0,2) +#@gui :Smoother Edge Protection=float(0.54,0,1) +#@gui :Smoother Softness=float(2.25,0,10) +#@gui :_=separator() +#@gui :Stretch Contrast=choice("None","Automatic","Automatic & Contrast Mask","Manual Controls") +#@gui :_=note("To activate the sliders below chose 'Manual Controls'") +#@gui :_=separator() +#@gui :LN Amplitude=float(2,0,60) +#@gui :LN Size=float(6,0,64) +#@gui :LN Neightborhood-Smoothness=float(5,0,40) +#@gui :LN Average-Smoothness=float(20,0,40) +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX.       Latest Update: 2011/05/04.") +#@gui :_=link(0,"Forum thread about the filter discussion","http://gimpchat.com/viewtopic.php?f=10&t=914") +#@gui Multi-Layer Etch:fx_gcd_layeretch,fx_gcd_layeretch(2) +#@gui :_=note("Etch with selectable number of layers") +#@gui :_=note("Warning: With high number of layers this can be VERY slow!") +#@gui :_=separator() +#@gui :Total Layers=int(11,2,16) +#@gui :White Layers=int(4,1,15) +#@gui :Etch Tones=int(12,2,32) +#@gui :Tone Blur=float(0.12,0,1) +#@gui :Noise Level=int(100,5,200) +#@gui :Dark Length=float(8.5,0,20) +#@gui :Bright Length=float(5,0,20) +#@gui :Start Angle=int(0,0,180) +#@gui :Random Angle=int(0,0,45) +#@gui :Max Curve=int(3,0,20) +#@gui :Gamma=float(1,0.01,2) +#@gui :Spread Angles=bool(1) +#@gui :Fast Resize=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2012/12/21.") +#@gui Pencil:fx_pencilbw,fx_pencilbw_preview(0) +#@gui :Size=float(0.3,0,5) +#@gui :Amplitude=float(60,0,200) +#@gui :Hue=float(0,0,360) +#@gui :Saturation=float(0,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/05/03.") +#@gui Pencil Portrait:fx_pencil_portraitbw,fx_pencil_portraitbw_preview(0) +#@gui :Stroke Length=float(30,0,500) +#@gui :Stroke Angle=float(120,0,180) +#@gui :Contour Threshold=float(1,0,10) +#@gui :Opacity=float(0.5,0,1) +#@gui :Color=color(#904f15) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: Jamac4k and David Tschumperlé.       Latest Update: 2015/29/06.") +#@gui Stamp:fx_stamp,fx_stamp_preview(0) +#@gui :Auto-Threshold=bool(1) +#@gui :Threshold=int(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Sharpening=float(0,0,30) +#@gui :Grain=float(0,0,100) +#@gui :Negative=bool() +#@gui :Anti-Aliasing=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: Antaron, Mahvin and David Tschumperlé.      Latest Update: 2015/16/03.") +#@gui Threshold Etch:fx_gcd_etch,fx_gcd_etch_preview(1) +#@gui :_=note("Replace tones with noise generated lines") +#@gui :_=note("\nInput Image Settings") +#@gui :_=separator() +#@gui :Threshold Low=int(125,10,255) +#@gui :Threshold Mid=int(153,10,255) +#@gui :Threshold High=int(171,10,255) +#@gui :Threshold Max=int(185,10,255) +#@gui :Blur Amount=float(0.1,0,2) +#@gui :_=note("\nOutput Etch Settings") +#@gui :_=separator() +#@gui :Horizontal Amount=int(50,0,100) +#@gui :Cross-Hatch Amount=int(80,0,100) +#@gui :Vertical 1 Amount=int(50,0,100) +#@gui :Vertical 2 Amount=int(10,0,100) +#@gui :_=separator() +#@gui :Horizontal Length=int(15,0,50) +#@gui :Vertical 1 Length=int(12,0,50) +#@gui :Vertical 2 Length=int(20,0,50) +#@gui :Flip Cross-Hatch=bool(0) +#@gui :_=separator() +#@gui :Curve Amount=int(1,0,20) +#@gui :Gamma=float(0.3,0.01,1) +#@gui :Fast Resize=bool(1) +#@gui :Color Image=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2013/02/09.") +#@gui _Colors +#@gui Abstraction:fx_color_abstraction,fx_color_abstraction_preview(0) +#@gui :Smoothness=float(1,0,10) +#@gui :Levels=int(10,2,100) +#@gui :Contrast=float(0.2,0.01,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/10/19.") +#@gui Apply External CLUT:fx_apply_haldclut,fx_apply_haldclut_preview(1)+ +#@gui :Specify HaldCLUT As=choice(2,"Top Layer","Bottom Layer","Filename") +#@gui :HaldCLUT Filename=filein() +#@gui :_=note("Note: Do not forget to set the Input layers option if you select Top layer or Bottom layer.") +#@gui :_=separator() +#@gui :Strength (%)=float(100,0,100) +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :Normalize Colors=choice("None","Pre-Normalize","Post-Normalize","Both") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/02/08.") +#@gui Apply From CLUT Set:apply_from_clut_set,apply_from_clut_set_preview(1)+ +#@gui :CLUT Set (.gmz File)=file("") +#@gui :Index=int(1,1,1024) +#@gui :_=separator() +#@gui :Strength (%)=float(100,0,100) +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :Normalize Colors=choice("None","Pre-Normalize","Post-Normalize","Both") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2022/05/08.") +#@gui Basic Adjustments:fx_adjust_colors,fx_adjust_colors_preview +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/16/06.") +#@gui Boost Chromaticity:fx_boost_chroma,fx_boost_chroma_preview(1) +#@gui :Amplitude (%)=float(50,0,100) +#@gui :Color Space=choice{"YCbCr (Distinct)","YCbCr (Mixed)","Lab (Distinct)","Lab (Mixed)"} +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/19/07.") +#@gui Boost-Fade:fx_boost_fade,fx_boost_fade_preview +#@gui :Amplitude=float(5,0,10) +#@gui :Chromaticity From=choice("YCbCr","Lab") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/11/26.") +#@gui Brightness:afre_brightness,afre_brightness_preview(1)+ +#@gui :_=note("Enhance luminance brightness.  Filter by afre 2020-2021 Jan8.\n\n") +#@gui :Amount=int(50,-300,300) +#@gui :Smooth=int(0,0,50) +#@gui :_=note("\n\nNote\n\nG'MIC's preview is inaccurate. Apply the filter and review the results in your host editor.") +#@gui Channel Processing:fx_channel_processing,fx_channel_processing_preview(1) +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Value Action=choice("None","Cut","Cut & Normalize","Normalize","Threshold") +#@gui :Low Value=float(0,0,100) +#@gui :High Value=float(100,0,100) +#@gui :Quantization=int(256,1,256) +#@gui :Equalization=bool(0) +#@gui :Negation=bool(0) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Channels to Layers:fx_channels2layers,fx_channels2layers_preview +#@gui :Colorspace=choice("RGB","CMY","HSV") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/15/07.") +#@gui CLUT from After - Before Layers:fx_clut_from_ab,fx_clut_from_ab_preview +#@gui :Output Mode=choice("Replace Layer with CLUT","Insert New CLUT Layer","Save CLUT as .cube or .png File") +#@gui :Output CLUT Resolution=choice(4,16,25,36,49,64,81,100,121,144,169,225,256)_2 +#@gui :_=separator() +#@gui :Output Folder=_folder()_1- +#@gui :Output Filename=_text("output.cube")_1+ +#@gui :_=separator() +#@gui :Influence of Color Samples (%)=float(50,0,100)_2 +#@gui :_=separator() +#@gui :_=note{"What is this filter for?\n\n This filter requires at least two input layers to work properly.\n It assumes you have an input top layer A and a base layer B such that A and B both represent the same image but with only color variations (typically A has been obtained from B using the color curves tool).\n\n This filter is then able to estimate and outputs a color HaldCLUT H so that applying H on the base layer B gives back A.\n\n This is useful when you have a color transformation between two images, that you want to recover and re-apply on a bunch of other images. "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.       Latest Update: 2019/08/27.") +#@gui CMYK Tone:iain_cmyk_tone_p,iain_cmyk_tone_p +#@gui :_=note("Adjust cyans for pixels that have:") +#@gui :A Lot of Cyan=int(0,-255,255) +#@gui :Some Cyan=int(0,-255,255) +#@gui :Little Cyan=int(0,-255,255) +#@gui :_=note("Adjust cyans for pixels that have:") +#@gui :A Lot of Magenta=int(0,-255,255) +#@gui :Some Magenta=int(0,-255,255) +#@gui :Little Magenta=int(0,-255,255) +#@gui :_=note("Adjust cyans for pixels that have:") +#@gui :A Lot of Yellow=int(0,-255,255) +#@gui :Some Yellow=int(0,-255,255) +#@gui :Little Yellow=int(0,-255,255) +#@gui :_=note("Adjust cyans for pixels that have:") +#@gui :A Lot of Key=int(0,-255,255) +#@gui :Some Key=int(0,-255,255) +#@gui :Little Key=int(0,-255,255) +#@gui :_=separator() +#@gui :_=note("Adjust Magentas for pixels that have:") +#@gui :A Lot of Cyan=int(0,-255,255) +#@gui :Some Cyan=int(0,-255,255) +#@gui :Little Cyan=int(0,-255,255) +#@gui :_=note("Adjust Magentas for pixels that have:") +#@gui :A Lot of Magenta=int(0,-255,255) +#@gui :Some Magenta=int(0,-255,255) +#@gui :Little Magenta=int(0,-255,255) +#@gui :_=note("Adjust Magentas for pixels that have:") +#@gui :A Lot of Yellow=int(0,-255,255) +#@gui :Some Yellow=int(0,-255,255) +#@gui :Little Yellow=int(0,-255,255) +#@gui :_=note("Adjust Magentas for pixels that have:") +#@gui :A Lot of Key=int(0,-255,255) +#@gui :Some Key=int(0,-255,255) +#@gui :Little Key=int(0,-255,255) +#@gui :_=separator() +#@gui :_=note("Adjust Yellows for pixels that have:") +#@gui :A Lot of Cyan=int(0,-255,255) +#@gui :Some Cyan=int(0,-255,255) +#@gui :Little Cyan=int(0,-255,255) +#@gui :_=note("Adjust Yellows for pixels that have:") +#@gui :A Lot of Magenta=int(0,-255,255) +#@gui :Some Magenta=int(0,-255,255) +#@gui :Little Magenta=int(0,-255,255) +#@gui :_=note("Adjust Yellows for pixels that have:") +#@gui :A Lot of Yellow=int(0,-255,255) +#@gui :Some Yellow=int(0,-255,255) +#@gui :Little Yellow=int(0,-255,255) +#@gui :_=note("Adjust Yellows for pixels that have:") +#@gui :A Lot of Key=int(0,-255,255) +#@gui :Some Key=int(0,-255,255) +#@gui :Little Key=int(0,-255,255) +#@gui :_=separator() +#@gui :_=note("Adjust Key for pixels that have:") +#@gui :A Lot of Cyan=int(0,-255,255) +#@gui :Some Cyan=int(0,-255,255) +#@gui :Little Cyan=int(0,-255,255) +#@gui :_=note("Adjust Key for pixels that have:") +#@gui :A Lot of Magenta=int(0,-255,255) +#@gui :Some Magenta=int(0,-255,255) +#@gui :Little Magenta=int(0,-255,255) +#@gui :_=note("Adjust Key for pixels that have:") +#@gui :A Lot of Yellow=int(0,-255,255) +#@gui :Some Yellow=int(0,-255,255) +#@gui :Little Yellow=int(0,-255,255) +#@gui :_=note("Adjust Key for pixels that have:") +#@gui :A Lot of Key=int(0,-255,255) +#@gui :Some Key=int(0,-255,255) +#@gui :Little Key=int(0,-255,255) +#@gui :_=separator() +#@gui :_=note("Strength of effect for Saturation level:") +#@gui :None=int(255,0,255) +#@gui :Little=int(255,0,255) +#@gui :Some=int(255,0,255) +#@gui :Much=int(255,0,255) +#@gui :Most=int(255,0,255) +#@gui :_=separator() +#@gui :Output=choice(0,"Perserve Luminance","Clip CMYK","Clip RGB","Scale CMYK","Scale RGB") +#@gui :_=separator() +#@gui :Parallel Processing=choice(0,"Auto","Off") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. Update: 4 March 2014 - Added parallel processing option") +#@gui Color Balance:fx_balance_gamma,fx_balance_gamma_preview +#@gui :Neutral Color=color(#808080) +#@gui :Stretch Colors=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/01/07.") +#@gui Color Blindness:colorblind,fx_colorblind_preview +#@gui :Blindness Type=choice("Protanopia","Protanomaly","Deuteranopia","Deuteranomaly","Tritanopia","Tritanomaly","Achromatopsia","Achromatomaly") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Note: This filter simulates different types of colorblindness vision. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/04.") +#@gui Color Grading:jl_colorgrading,jl_colorgrading_preview(1) +#@gui :_=note("A filter for basic photo editing and color grading.") +#@gui :_=note("Note: Saturation channel gamma affects more the less saturated areas. S-curve contrast, affects shadows and highlights equally. When using noise reduction or sharpening tools, zoom in for more accurate view.") +#@gui :_=separator() +#@gui :HDR Effect (Tone Map)=float(0.,0.0,1) +#@gui :Cool / Warm=int(0,-50,50) +#@gui :Saturation=float(1,0,2) +#@gui :Saturation Channel Gamma=float(1,0.1,3) +#@gui :_=note("Note: Saturation channel gamma may introduce artifacts depending on the image.") +#@gui :_=separator() +#@gui :S-Curve Contrast=int(0,-30,30) +#@gui :Shadows=int(0,-50,50) +#@gui :Highlights=int(0,-50,50) +#@gui :Blacks=int(0,0,50) +#@gui :Brightness=int(0,-50,50) +#@gui :Contrast=int(0,-50,50) +#@gui :Gamma=float(1,0.1,3) +#@gui :_=separator() +#@gui :Clarity=float(0,0.0,2.0) +#@gui :Local Contrast Enhance=float(0,0,3) +#@gui :_=separator() +#@gui :Color Grading=bool(0) +#@gui :Highlights Color Intensity=int(70,0,130) +#@gui :Highlights Hue=int(0,0,360) +#@gui :Highlights Brightness=int(0,-100,100) +#@gui :Midtones Color Intensity=int(0,0,130) +#@gui :Midtones Hue=int(0,0,360) +#@gui :Midtones Brightness=int(0,-100,100) +#@gui :Shadows Color Intensity=int(70,0,130) +#@gui :Shadows Hue Shift=int(180,0,360) +#@gui :Shadows Brightness=int(0,-100,100) +#@gui :_=note("Color grading subsection usage: Use intensity sliders to control the amount of color being applied in the highlights/midtones/shadows, use brightness sliders for bringing up or down highlights/midtones/shadows. Hues here follow rotation axis in color wheel ie: 0 or 360 deg is red, 180 is blue it's complimentary. Shadows hue shift in default position uses always the complimentary color of highlights in the shadows. Default sliders for grading apply red highlights and blue shadows effect.") +#@gui :_=separator() +#@gui :Output Saturation=float(1,0,2) +#@gui :Output Sharpening=float(0,0,10) +#@gui :Output Chroma NR=float(0,0,20) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: John Lakkas. Latest update: 17/03/2015.") +#@gui Color Mask [Interactive]:fx_mask_color,gui_no_preview +#@gui :Color Metric=_choice(13,"RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [all]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [all]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [all]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [all]","HSI [intensity]","HSL [all]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :Spatial Tolerance=_float(10,0,100) +#@gui :Color Tolerance=_float(5,0,100) +#@gui :_=separator() +#@gui :Output Mode=_choice(0,"Masked Image","Color Mask") +#@gui :_=separator() +#@gui :_=note{"Note: This filter is CPU consuming, so use it at least with 4+ cores (or reduce the size of the interactive window to speed up computation)."} +#@gui :_=note{"Interactions:\n Use the following actions in the interactive window to build your color mask :\n\n - Left mouse button make the color pointed by the mouse wanted for the mask.\n - Right mouse button make the color pointed by the mouse unwanted for the mask.\n - Middle mouse button or key R resets color mask.\n - Key SPACE or TAB toggles view modes (half/full-masked RGB or color mask).\n - Keys CTRL+D increase window size.\n - Keys CTRL+C decrease window size.\n - Keys CTRL+R resets window size.\n - Keys ESC, Q or ENTER exit the interactive window. "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 01/20/2017.") +#@gui Color Presets:fx_color_presets,fx_color_presets_preview(1)+ +#@gui :LUTs Pack=choice{21,"Abigail Gonzalez (21)","Alex Jordan (81)","Berat (10)","Cinematic (8)","Cinematic Travel (29)","Creative Pack (33)","EditingCorp (60)","Eric Ellerbrock (14)","FilterGrade Cinematic (8)","Hollywood Movies (74)","InAvision (15)","J.T. Semple (14)","Kyler Holland (10)","Lutify.Me (7)","Michael Ezra (2)","Moviz (48)","Ohad Peretz (7)","Olivio Sarikas (19)","ON1 Photography (90)","PictureFX (25)","Pixelmator (45)","PIXLS.US (31)","Purple11 (12)","RocketStock (35)","Shamoon Abbasi (25)","SmallHD Movie Look (7)","Todd Blankenship (13)","Youssef Hossam (5)","Others (69)"} +#@gui :Preset=choice(1,"All [Collage]","None","Blade Runner","Blue House","Blue Ice","Caribe","Cinema","Cinema 2","Cinema 3","Cinema 4","Cinema 5","Cinema Noir","Cinematic for Flog","Day4Nite","Eterna for Flog","Filmic","Fuji HDR","Golden Gate","Matrix","Monochrome 1","Monochrome 2","Old West","Science Fiction")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Action Magenta 01","Action Red 01","Adventure 1453","Aggressive Highlights Recovery 5","Bleech Bypass Green","Bleech Bypass Yellow 01","Blue Dark","Blue Shadows 01","Bright Green 01","Brownish","Colorful 0209","Conflict 01","Contrast with Highlights Protection","Contrasty Afternoon","Contrasty Green","Cross Process CP 130","Cross Process CP 14","Cross Process CP 15","Cross Process CP 16","Cross Process CP 18","Cross Process CP 3","Cross Process CP 4","Cross Process CP 6","Dark Green 02","Dark Green 1","Dark Place 01","Dream 1","Dream 85","Faded Retro 01","Faded Retro 02","Film 0987","Film 9879","Film Highlight Contrast","Flat 30","Green 2025","Green Action","Green Afternoon","Green Conflict","Green Day 01","Green Day 02","Green G09","Green Indoor","Green Light","Harsh Day","Harsh Sunset","Highlights Protection","Indoor Blue","Low Contrast Blue","Low Key 01","Magenta Day","Magenta Day 01","Magenta Dream","Memories","Moonlight 01","Mostly Blue","Muted 01","Night 01","Only Red","Only Red and Blue","Operation Yellow","Orange Dark 4","Orange Dark 7","Orange Dark Look","Orange Underexposed","Protect Highlights 01","Red Afternoon 01","Red Day 01","Red Dream 01","Retro Brown 01","Retro Magenta 01","Retro Yellow 01","Saturated Blue","Smart Contrast","Subtle Blue","Subtle Green","Yellow 55B","Yellow Film 01")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Brown BM","Cine Blue","Cine BM4k","Golden Time","Green and Orange","Monochrome","Sevsuz","Sunlight Love","Western","Western Lut 2")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Deep","Dimension","Enchanted","Flavin","Frosted","Shine","Ultra Water","Wipe")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Blue Cold Fade","Bright Teal Orange","Bright Warm","Clear Teal Fade","Cold Clear Blue","Cold Clear Blue 1","Deep Blue","Deep Dark Warm","Deep High Contrast","Deep Teal Fade","Deep Warm Fade","Faded Green","Greenish Contrasty","Greenish Fade","Greenish Fade 1","Hard Teal Orange","Neutral Teal Orange","Neutral Warm Fade","Smooth Clear","Smooth Green Orange","Smooth Teal Orange","Teal Fade","Very Warm Greenish","Warm Dark Contrasty","Warm Fade","Warm Fade 1","Warm Neutral","Warm Sunset Red","Warm Teal")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Anime","Bleach Bypass 1","Bleach Bypass 2","Bleach Bypass 3","Bleach Bypass 4","Candle Light","Color Negative","Crisp Warm","Crip Winter","Drop Blues","Edgy Ember","Fall Colors","Foggy Night","Futuristic Bleak 1","Futuristic Bleak 2","Futuristic Bleak 3","Futuristic Bleak 4","Horror Blue","Late Sunset","Moonlight","Night From Day","Red Blue Yellow","Smokey","Soft Warming","Teal Magenta Gold","Teal Orange","Teal Orange 1","Teal Orange 2","Teal Orange 3","Tension Green 1","Tension Green 2","Tension Green 3","Tension Green 4")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Ampio","Asistas","Atusa","Basuco","Beati","Bisogno","Boyado","Calidum","Colore","Convold","Cosa","Culor","Dimmer","Ensaya","Falua","Farkling","Fatos","Fezzle","Filo","Foresta","Huesio","Husmes","Huyan","Ideo","Jarklin","Lavark","Levex","Litore","Loro","Lotta","Maesky","Mercato","Molti","Motus","Mucca","Nigrum","Onda","Padre","Partia","Perso","Picola","Randas","Satid","Scala","Scrittle","Seges","Selor","Sensum","Sino","Soldi","Strano","Stringa","Tirare","Tutto","Upglow","Valize","Valsky","Vita","Vubes","Wavefire")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Avalanche","Black Star","Helios","Hydracore","Hypnosis","Killstreak","Nemesis","Night Blade 4","Paladin","Seringe 4","Serpent","Terra 4","Victory","Yellowstone")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Cine Basic","Cine Bright","Cine Cold","Cine Drama","Cine Teal Orange 1","Cine Teal Orange 2","Cine Vibrant","Cine Warm")_0 +#@gui :Preset=choice(1,"All [Collage]","None","12 Years a Slave","1917","Ad Astra","Aladdin","Ant-Man","Aquaman","Avengers Endgame","Baby Driver","Bad Boys for Life","Beauty and the Beast","Black Panther","Bohemian Rhapsody","Bombshell","Captain Marvel","City of God","Creed 2","Doctor Strange","Dunkirk","Fight Club","Ford V Ferrari","Green Book","Greyhound","Inception","I Tonya","Jojo Rabbit","Joker ","Jumanji The Next Level","Jurassic World Fallen Kingdom","Justice League","Kingsman The Golden Circle","Knives Out","La La Land","Little Women","Logan","Mad Max Fury Road","Marriage Story","Moonlight","Mother!","No Time to Die","Once Upon a Time in Hollywood","Parasite","Pirates of the Caribbean","Rocketman","Separation","Sicario","Spider-Man Far From Home","Spotlight","Star Wars The Rise of Skywalker","Sully","TENET","The Darkest Hour","The Dark Knight","The Gentelmen","The Grand Budapest Hotel","The Hurt Locker","The Irishman","The Lighthouse","The Lobster","The Martian","The Revenant","The Shape of Water","The Social Network","The Two Popes","The Way Back","Thor Ragnarok","Top Gun Maverick","Uncut Gems","Underwater","Venom","War for the Planet of the Apes","Wolf of Wall Street","Wonder Woman","X-Men Dark Phoenix","Zombieland Double Tap")_0 +#@gui :Preset=choice(1,"All [Collage]","None","7Drk21","BC Darkum","Brown Mobster","Cold Ice","Dark Man X","Film GB-19","Formula B","Gremerta","Hitman","J. Wick 21","London Nights","Louetta","Nightlife","VFB 21","Vintage Mob")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Bright Green","Crisp Romance","Crushin","Frosted Beach Picnic","Just Peachy","Late Afternoon Wanderlust","Lush Green Summer","Magenta Coffee","Minimalist Caffeination","Mystic Purple Sunset","Nostalgia Honey","Spring Morning","Toasted Garden","Winter Lighthouse")_0 +#@gui :Preset=choice(1,"All [Collage]","None","KH 1","KH 2","KH 3","KH 4","KH 5","KH 6","KH 7","KH 8","KH 9","KH 10")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Hackmanite","Herderite","Heulandite","Hiddenite","Hilutite","Howlite","Hypersthene")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Deep Skin Tones 2","Deep Skin Tones 3")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Moviz 1","Moviz 2","Moviz 3","Moviz 4","Moviz 5","Moviz 6","Moviz 7","Moviz 8","Moviz 9","Moviz 10","Moviz 11","Moviz 12","Moviz 13","Moviz 14","Moviz 15","Moviz 16","Moviz 17","Moviz 18","Moviz 19","Moviz 20","Moviz 21","Moviz 22","Moviz 23","Moviz 24","Moviz 25","Moviz 26","Moviz 27","Moviz 28","Moviz 29","Moviz 30","Moviz 31","Moviz 32","Moviz 33","Moviz 34","Moviz 35","Moviz 36","Moviz 37","Moviz 38","Moviz 39","Moviz 40","Moviz 41","Moviz 42","Moviz 43","Moviz 44","Moviz 45","Moviz 46","Moviz 47","Moviz 48")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Cold Simplicity 2","D and O 1","Retro Summer 3","Subtle Yellow","Teal Moonlight","True Colors 8","Vintage Warmth 1")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Analog Film 1","Atomic Pink","Beach Aqua Orange","Beach Faded Analog","BW but Yellow","City Dust","Dark Orange Teal","Day to Night King's Blue","DuoTone Blue Red","Faded Pink-Ish","Flat Blue Moon","Honey Light","Infrared - Dust Pink","Neutral Pump","Shade King's Ink","Sunset Aqua Orange","Sunset Intense Violet Blue","Sunset Violet Mood","Violet Taste")_0 +#@gui :Preset=choice(1,"All [Collage]","None","2-Strip Process","Aqua","Aqua and Orange Dark","Berlin Sky","Blues","Black & White-1","Black & White-2","Black & White-3","Black & White-4","Black & White-5","Black & White-6","Black & White-7","Black & White-8","Black & White-9","Black & White-10","Chrome 01","Cinematic-1","Cinematic-2","Cinematic-3","Cinematic-4","Cinematic-5","Cinematic-6","Cinematic-7","Cinematic-8","Cinematic-9","Cinematic-10","Classic Teal and Orange","Earth Tone Boost","Fade to Green","Film Print 01","Film Print 02","French Comedy","Green Blues","Green Yellow","Landscape-1","Landscape-2","Landscape-3","Landscape-4","Landscape-5","Landscape-6","Landscape-7","Landscape-8","Landscape-9","Landscape-10","Lifestyle & Commercial-1","Lifestyle & Commercial-2","Lifestyle & Commercial-3","Lifestyle & Commercial-4","Lifestyle & Commercial-5","Lifestyle & Commercial-6","Lifestyle & Commercial-7","Lifestyle & Commercial-8","Lifestyle & Commercial-9","Lifestyle & Commercial-10","Moody-1","Moody-2","Moody-3","Moody-4","Moody-5","Moody-6","Moody-7","Moody-8","Moody-9","Moody-10","Nature & Wildlife-1","Nature & Wildlife-2","Nature & Wildlife-3","Nature & Wildlife-4","Nature & Wildlife-5","Nature & Wildlife-6","Nature & Wildlife-7","Nature & Wildlife-8","Nature & Wildlife-9","Nature & Wildlife-10","Oranges","Portrait-1","Portrait-2","Portrait-3","Portrait-4","Portrait-5","Portrait-6","Portrait-7","Portrait-8","Portrait-9","Portrait10","Purple","Reds","Reds Oranges Yellows","Studio Skin Tone Shaper","Vintage Chrome")_0 +#@gui :Preset=choice(1,"All [Collage]","None","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","PictureFX - Faux Infrared B&W1","PictureFX - Faux Infrared Color P2","PictureFX - Faux Infrared Color P3","PictureFX - Faux Infrared R0a","PictureFX - Faux Infrared R0b","PictureFX - Faux Infrared YP1","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","TechnicalFX - Backlight Filter","ZilverFX - B&W Solarization","ZilverFX - InfraRed","ZilverFX - Vintage B&W")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Black & White 01","Black & White 02","Black & White 03","Black & White 04","Black & White 05","Black & White 06","Cinematic 01","Cinematic 02","Cinematic 03","Cinematic 04","Cinematic 05","Cinematic 06","Cinematic 07","Classic Films 01","Classic Films 02","Classic Films 03","Classic Films 04","Classic Films 05","Landscape 01","Landscape 02","Landscape 03","Landscape 04","Landscape 05","Modern Films 01","Modern Films 02","Modern Films 03","Modern Films 04","Modern Films 05","Modern Films 06","Modern Films 07","Night 01","Night 02","Night 03","Night 04","Night 05","Urban 01","Urban 02","Urban 03","Urban 04","Urban 05","Vintage 01","Vintage 02","Vintage 03","Vintage 04","Vintage 05")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Amstragram","Amstragram+","Autumn","Cinematic Lady Bird","Cinematic Mexico","Dark Blues in Sunlight","Delicatessen","Expired 69","Faded Look","Faded Print","Hypressen","Magenta Yellow","Metropolis","Modern Film","Newspaper","Night Spy","Progressen","Prussian Blue","Seventies Magazine","Street","Sweet Bubblegum","Sweet Gelatto","Taiga","Tarraco","Unknown","Uzbek Bukhara","Uzbek Marriage","Uzbek Samarcande","Velvetia","Warm Vintage","Whiter Whites")_2 +#@gui :Preset=choice(1,"All [Collage]","None","Going for a Walk","Good Morning","Nah","Once Upon a Time","Passing By","Serenity","Smooth Sailing","Undeniable","Undeniable 2","Urban Cowboy","We'll See","You Can Do It")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Arabica 12","Ava 614","Azrael 93","Bourbon 64","Byers 11","Chemical 168","Clayton 33","Clouseau 54","Cobi 3","Contrail 35","Cubicle 99","Django 25","Domingo 145","Faded 47","Folger 50","Fusion 88","Hyla 68","Korben 214","Lenox 340","Lucky 64","McKinnon 75","Milo 5","Neon 770","Paladin 1875","Pasadena 21","Pitaya 15","Reeve 38","Remy 24","Sprocket 231","Teigen 28","Trent 18","Tweed 71","Vireo 37","Zed 32","Zeke 39")_0 +#@gui :Preset=choice(1,"All [Collage]","None","City 7","Coffee 44","Date 39","Day for Night","Denoise Simple 40","Desert Gold 37","Directions 23","Drop Green Tint 14","Elegance 38","Golden Night Softner 43","Golden Sony 37","Green 15","Happyness 133","HLG 1","Industrial 33","Morning 6","Morroco 16","Night King 141","Rest 33","Shadow King 39","Spy 29","Thriller 2","Turkiest 42","Vintage 163","Wooden Gold 20")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Apocalypse This Very Moment","B-Boyz 2","Bob Ford","Life Giving Tree","Moonrise","Saving Private Damon","The Matrices")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Blue Architecture","Blue Hour","Cold Chrome","Crisp Autumn","Dark And Somber","Hard Boost","Long Beach Morning","Lush Green","Magic Hour","Natural Boost","Orange And Blue","Soft Black And White","Waves")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Cinematic Forest","City","Darkness","Hallowen Dark","Sea")_0 +#@gui :Preset=choice{1,"All [Collage]","None","60's","60's (faded)","60's (faded Alt)","Alien Green","Black & White","Bleach Bypass","Blue Mono","Cinematic-01","Cinematic-02","Cinematic-03","Color (rich)","Faded","Faded (alt)","Faded (analog)","Faded (extreme)","Faded (vivid)","Expired (fade)","Expired (polaroid)","Extreme","Fade","Faux Infrared","Golden","Golden (bright)","Golden (fade)","Golden (mono)","Golden (vibrant)","Green Mono","Hong Kong","Instant-C","K-Tone Vintage Kodachrome","Light (blown)","Lomo","Mono Tinted","Muted Fade","Mute Shift","Natural (vivid)","Nostalgic","Orange Tone","Pink Fade","Purple","Retro","Rotate (muted)","Rotate (vibrant)","Rotated","Rotated (crush)","Smooth Crome-Ish","Smooth Fade","Soft Fade","Solarize Color","Solarized Color2","Summer","Summer (alt)","Sunny","Sunny (alt)","Sunny (warm)","Sunny (rich)","Super Warm","Super Warm (rich)","Sutro FX","Vibrant","Vibrant (alien)","Vibrant (contrast)","Vibrant (crome-Ish)","Vintage","Vintage (alt)","Vintage (brighter)","Warm","Warm (highlight)","Warm (yellow)"}_0 +#@gui :Thumbnail Size=int(512,0,1024)_1 +#@gui :_=separator() +#@gui :Strength (%)=float(100,0,100) +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :Normalize Colors=choice("None","Pre-Normalize","Post-Normalize","Both") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=value(0)_2+ +#@gui :_=separator() +#@gui :_=note("Note: The color LUTs proposed in this category come from:\n") +#@gui :_=value(0)_0+ +#@gui :_=note("
  Abigail Gonzalez - FreshLUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  Alex Jordan - FreshLUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
Berat - FreshLUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
Free Cinematic LUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  30 Cinematic Travel Color
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  RawTherapee Film Simulation
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  EditingCorp - 60 Free Hand-Picked LUTs For Cinematic Color Grading
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  Eric Ellerbrock - FreshLUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  FilterGrade Free Cinematic LUTs Pack
") +#@gui :_=value(0)_0+ +#@gui :_=note("
Hollywood LUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  InAvision - FreshLUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  J.T. Semple - FreshLUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  Kyler Holland 10 Free CLUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  Lutify.Me Free LUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
Michael Ezra
") +#@gui :_=value(0)_0+ +#@gui :_=note("
Moviz LUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
Ohad Peretz - FreshLUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  Olivio Sarikas - Free LUT Packs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  ON1 Free Photography LUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
PictureFX - A Free HaldCLUT Set
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  Pixelmator Free LUTs
") +#@gui :_=value(0)_2+ +#@gui :_=note("
  PIXLS.US Contributors
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  Purple11 - Free LUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  RocketStock 35 Free LUTs for Color Grading
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  Shamoon Abbasi - FreshLUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  SmallHD Free Movie Look Pack
") +#@gui :_=value(0)_0+ +#@gui :_=note("
  Todd Blankenship - Free LUTs
") +#@gui :_=value(0)_0+ +#@gui :_=note("
Youssef Hossam
") +#@gui :_=value(0)_2+ +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.         Latest Update: 2023/06/01.") +#@gui Color Temperature:fx_tk_colortemp,fx_tk_colortemp_preview +#@gui :Color Temperature=float(0,-20,20) +#@gui :Automatic Color Balance=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil. Latest update: 2012/04/05.") +#@gui Colorful Blobs:fx_colorful_blobs,fx_colorful_blobs_preview +#@gui :Colorspace=choice(1,"SRGB","Linear RGB","Lab") +#@gui :Background Color=color(#c8c8c800) +#@gui :Display Blob Controls=bool(1) +#@gui :_=separator() +#@gui :Blob 1=point(25,25,1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 1 Color=color(#ff0000) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob2=point(75,25,1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 2 Color=color(#00ff00) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob 3=point(50,75,1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 3 Color=color(#0000ff) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob 4=point(5,90,-1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 4 Color=color(#ffff00) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob 5=point(5,90,-1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 5 Color=color(#ff00ff) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob 6=point(5,90,-1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 6 Color=color(#00ffff) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob 7=point(5,90,-1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 7 Color=color(#ffffff) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob 8=point(5,90,-1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 8 Color=color(#000000) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob 9=point(5,90,-1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 9 Color=color(#ff8040) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob 10=point(5,90,-1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 10 Color=color(#ff4080) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob 11=point(5,90,-1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 11 Color=color(#8040ff) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :Blob 12=point(5,90,-1,1,0,0,0,0,5) +#@gui :Radius=point(50,50,0,1,0,0,0,0,5)_0 +#@gui :Blob 12 Color=color(#4080ff) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=separator() +#@gui :_=note("This filter can be used to create custom palettes with given color shades. It has been inspired by Adobe's Playful Palette.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/08/26.") +#@gui Colormap:fx_colormap,fx_colormap_preview +#@gui :Colormap=choice{2,"Adaptive","Custom","Standard (256)","HSV (256)","Lines (256)","Hot (256)","Cool (256)","Jet (256)","Flag (256)","Cube (256)"} +#@gui :Dithering=float(1,0,1) +#@gui :_=separator() +#@gui :Number of Tones=int(32,2,256)_0 +#@gui :Number of Colors=int(8,2,8)_0 +#@gui :1st Color=color(#000000)_0 +#@gui :2nd Color=color(#ffffff)_0 +#@gui :3rd Color=color(#ff0000)_0 +#@gui :4th Color=color(#00ff00)_0 +#@gui :5th Color=color(#0000ff)_0 +#@gui :6th Color=color(#ffff00)_0 +#@gui :7th Color=color(#ff00ff)_0 +#@gui :8th Color=color(#00ffff)_0+ +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/27/12.") +#@gui Contrast:afre_contrast,afre_contrast_preview(1)+ +#@gui :_=note("Enhance luminance contrast.  Filter by afre 2020 Jan9.\n\n") +#@gui :Amount=int(50,-200,200) +#@gui :_=note("\n\nNote\n\nG'MIC's preview is inaccurate. Apply the filter and review the results in your host editor.") +#@gui Curves:fx_curves_interactive,fx_curves_interactive_preview +#@gui :Colorspace=choice("RGB","CMY","CMYK","HSI","HSL","HSV","Lab","Lch","YCbCr") +#@gui :Output Preset as a HaldCLUT Layer=_choice("Disable","Lowres CLUT","Highres CLUT") +#@gui :Apply Transformation From=_choice("New Curves [Interactive]","Curves Previously Defined") +#@gui :_=value(0) +#@gui :_=value(0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100) +#@gui :_=separator() +#@gui :_=note("Description:\n This filter allows to apply color curves on your images, in many different colorspaces. Click on the Apply or OK buttons below to open the G'MIC interactive windows and start building your color curves. When you're done, exit the main image window: your modified result will be transferred back to the host software.\n\n Once you've set curves, you can save them by pressing the Add to faves button below the filter tree. To clear control points for your curves, click on the Reset button above. ") +#@gui :_=separator() +#@gui :_=note{"Interactions:\n Use the following actions in the interactive windows to manage your colorization :\n\n - Left mouse button on a curve creates a new color control point (or move an existing one).\n - Right mouse button on a control point deletes it.\n - Left mouse button on the main image window shows the initial image until button is released.\n - Right mouse button on the main image window adds a keypoint to all curves from picked color.\n - Key R on a curve resets it.\n - Keys CTRL+D increase window size.\n - Keys CTRL+C decrease window size.\n - Keys CTRL+R resets window size.\n - Keys ESC, Q or ENTER close the current window. "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 09/28/2014.") +#@gui Customize CLUT:fx_customize_clut,fx_customize_clut_preview(1)+ +#@gui :Keypoint Influence (%)=float(100,0,100) +#@gui :Lock Uniform Sampling=choice{0,"None","8 Keypoints (RGB Corners)","27 Keypoints","64 Keypoints","125 Keypoints","216 Keypoints","343 Keypoints"} +#@gui :Spatial Regularization=int(10,0,30) +#@gui :_=separator() +#@gui :_=note("Global correction:") +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :Post-Normalize=bool(0) +#@gui :_=separator() +#@gui :Output Corresponding CLUT=_choice("Disable","512x512 Layer","4096x4096 Layer") +#@gui :Preview Type=choice{8,"Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Horizontal","Duplicate Vertical","HaldCLUT","3D CLUT (Fast)","3D CLUT (Precise)"} +#@gui :CLUT Opacity=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Color correspondences:") +#@gui :Action #1=choice(1,"Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #1=color(#000000) +#@gui :Target Color #1=color(#000000) +#@gui :_=separator() +#@gui :Action #2=choice(1,"Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #2=color(#ffffff) +#@gui :Target Color #2=color(#ffc480) +#@gui :_=separator() +#@gui :Action #3=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #3=color(#000000) +#@gui :Target Color #3=color(#000000) +#@gui :_=separator() +#@gui :Action #4=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #4=color(#000000) +#@gui :Target Color #4=color(#000000) +#@gui :_=separator() +#@gui :Action #5=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #5=color(#000000) +#@gui :Target Color #5=color(#000000) +#@gui :_=separator() +#@gui :Action #6=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #6=color(#000000) +#@gui :Target Color #6=color(#000000) +#@gui :_=separator() +#@gui :Action #7=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #7=color(#000000) +#@gui :Target Color #7=color(#000000) +#@gui :_=separator() +#@gui :Action #8=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #8=color(#000000) +#@gui :Target Color #8=color(#000000) +#@gui :_=separator() +#@gui :Action #9=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #9=color(#000000) +#@gui :Target Color #9=color(#000000) +#@gui :_=separator() +#@gui :Action #10=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #10=color(#000000) +#@gui :Target Color #10=color(#000000) +#@gui :_=separator() +#@gui :Action #11=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #11=color(#000000) +#@gui :Target Color #11=color(#000000) +#@gui :_=separator() +#@gui :Action #12=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #12=color(#000000) +#@gui :Target Color #12=color(#000000) +#@gui :_=separator() +#@gui :Action #13=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #13=color(#000000) +#@gui :Target Color #13=color(#000000) +#@gui :_=separator() +#@gui :Action #14=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #14=color(#000000) +#@gui :Target Color #14=color(#000000) +#@gui :_=separator() +#@gui :Action #15=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #15=color(#000000) +#@gui :Target Color #15=color(#000000) +#@gui :_=separator() +#@gui :Action #16=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #16=color(#000000) +#@gui :Target Color #16=color(#000000) +#@gui :_=separator() +#@gui :Action #17=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #17=color(#000000) +#@gui :Target Color #17=color(#000000) +#@gui :_=separator() +#@gui :Action #18=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #18=color(#000000) +#@gui :Target Color #18=color(#000000) +#@gui :_=separator() +#@gui :Action #19=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #19=color(#000000) +#@gui :Target Color #19=color(#000000) +#@gui :_=separator() +#@gui :Action #20=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #20=color(#000000) +#@gui :Target Color #20=color(#000000) +#@gui :_=separator() +#@gui :Action #21=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #21=color(#000000) +#@gui :Target Color #21=color(#000000) +#@gui :_=separator() +#@gui :Action #22=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #22=color(#000000) +#@gui :Target Color #22=color(#000000) +#@gui :_=separator() +#@gui :Action #23=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #23=color(#000000) +#@gui :Target Color #23=color(#000000) +#@gui :_=separator() +#@gui :Action #24=choice("Ignore","Lock Source","Replace Source by Target") +#@gui :Source Color #24=color(#000000) +#@gui :Target Color #24=color(#000000) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/14/06.") +#@gui Dark Sky:afre_darksky,afre_darksky_preview(1)+ +#@gui :_=note("Enhance landscape by darkening the sky.  Filter by afre 2017-2020 Sep9.\n\n") +#@gui :Blend=choice("Softlight","Overlay") +#@gui :Contrast=int(0,-100,100) +#@gui :Smooth=choice(1,"Fast (Approx.)","Slow (Accurate)") +#@gui :Radius=int(0,0,3) +#@gui :_=note("\n\nNote\n\nG'MIC's preview is inaccurate. Apply the filter and review the results in your host editor.\n\nE.g. Smooth(fast) may appear to cause artifacts when in fact it does not.") +#@gui Decompose Channels:fx_decompose_channels,fx_decompose_channels_preview +#@gui :Color Basis=choice(7,"RGB","HSV","HSL","HSI","YUV","YCbCr","XYZ","Lab","Lch","CMY","CMYK","YIQ") +#@gui :Action=choice("Decompose","Recompose") +#@gui :Output Multiple Layers=_bool(0) +#@gui :Include Opacity Layer=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/19/07.") +#@gui Detect Skin:fx_detect_skin,fx_detect_skin_preview(1) +#@gui :Skin Estimation=choice(1,"Manual","Automatic") +#@gui :_=separator() +#@gui :Tolerance=float(0.5,0,1) +#@gui :Smoothness=float(0.5,0,5) +#@gui :Threshold=float(1,0,10) +#@gui :Pre-Normalize Image=bool(1) +#@gui :_=separator() +#@gui :_=note("Manual estimation:\n Use the sliders below to target as much skin pixels as you can.") +#@gui :X-Coordinate=float(50,0,100) +#@gui :Y-Coordinate=float(50,0,100) +#@gui :Radius=float(5,0,25) +#@gui :_=separator() +#@gui :Output Mode=choice(1,"Probability Map","Opaque Skin","Transparent Skin") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/03/01.") +#@gui Equalize HSI-HSL-HSV:fx_equalize_hsv,fx_equalize_hsv_preview(0)+ +#@gui :Colorspace=choice(1,"HSI","HSL","HSV") +#@gui :Opacity (%)=float(100,0,100) +#@gui :Value Blending=float(0,0,64) +#@gui :Color Blending=float(0,0,64) +#@gui :_=separator() +#@gui :Preview Mapping=choice("None","Grey","Color") +#@gui :_=separator() +#@gui :_=note("Black:") +#@gui :Hue Offset=float(0,-180,180) +#@gui :Saturation Offset=float(0,-1,1) +#@gui :Value Offset=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("Near black:") +#@gui :Hue Offset=float(0,-180,180) +#@gui :Saturation Offset=float(0,-1,1) +#@gui :Value Offset=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("Dark grey:") +#@gui :Hue Offset=float(0,-180,180) +#@gui :Saturation Offset=float(0,-1,1) +#@gui :Value Offset=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("Mi-dark grey:") +#@gui :Hue Offset=float(0,-180,180) +#@gui :Saturation Offset=float(0,-1,1) +#@gui :Value Offset=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("Middle grey:") +#@gui :Hue Offset=float(0,-180,180) +#@gui :Saturation Offset=float(0,-1,1) +#@gui :Value Offset=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("Mid-light grey:") +#@gui :Hue Offset=float(0,-180,180) +#@gui :Saturation Offset=float(0,-1,1) +#@gui :Value Offset=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("Light grey:") +#@gui :Hue Offset=float(0,-180,180) +#@gui :Saturation Offset=float(0,-1,1) +#@gui :Value Offset=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("Highlights:") +#@gui :Hue Offset=float(0,-180,180) +#@gui :Saturation Offset=float(0,-1,1) +#@gui :Value Offset=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("White:") +#@gui :Hue Offset=float(0,-180,180) +#@gui :Saturation Offset=float(0,-1,1) +#@gui :Value Offset=float(0,-1,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé and David Revoy.       Latest Update: 2018/01/19.") +#@gui Equalize HSV:fx_hsv_equalizer,fx_hsv_equalizer_preview +#@gui :Preview Bands=bool(false) +#@gui :_=separator() +#@gui :Hue Band=float(180,0,360) +#@gui :Band Width=float(40,1,360) +#@gui :Hue Shift=float(0,-180,180) +#@gui :Saturation Correction=float(0,-0.99,0.99) +#@gui :Value Correction=float(0,-0.99,0.99) +#@gui :_=separator() +#@gui :Hue Band=float(180,0,360) +#@gui :Band Width=float(40,1,360) +#@gui :Hue Shift=float(0,-180,180) +#@gui :Saturation Correction=float(0,-0.99,0.99) +#@gui :Value Correction=float(0,-0.99,0.99) +#@gui :_=separator() +#@gui :Hue Band=float(180,0,360) +#@gui :Band Width=float(40,1,360) +#@gui :Hue Shift=float(0,-180,180) +#@gui :Saturation Correction=float(0,-0.99,0.99) +#@gui :Value Correction=float(0,-0.99,0.99) +#@gui :_=separator() +#@gui :_=note("Author: Jérome Ferrari.       Latest Update: 01/14/2011.") +#@gui :_=link("Filter explained here","http://www.flickr.com/groups/gmic/discuss/72157625798533482") +#@gui HSL Adjustment:gcd_hsl,gcd_hsl_preview(1) +#@gui :_=note("\nInput Saturation Settings") +#@gui :_=separator() +#@gui :Contrast=float(1,0,2) +#@gui :Level=float(0,-1,1) +#@gui :Auto Reduce Level (Level Slider Is Disabled)=bool(0) +#@gui :_=note("\nOutput Hue Settings") +#@gui :_=separator() +#@gui :Hue=float(180,0,360) +#@gui :Amount=float(0.2,0,1) +#@gui :Auto Set Hue Inverse (Hue Slider Is Disabled)=bool(0) +#@gui :_=note("\nOutput Luminance Settings") +#@gui :_=separator() +#@gui :Gamma=float(1,0,2) +#@gui :Contrast=float(1,0,2) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2015/05/15.") +#@gui HSV Select:gcd_hsv_select,gcd_hsv_select(2) +#@gui :_=note("Color Selection") +#@gui :_=separator() +#@gui :Hue=int(0,0,360) +#@gui :Saturation=float(0.5,0,1) +#@gui :Value=float(1,0,1) +#@gui :_=note("\nColor Range") +#@gui :_=separator() +#@gui :Hue Range=int(180,0,180) +#@gui :Sat Range=float(0.5,0,0.5) +#@gui :Val Range=float(0.5,0,0.5) +#@gui :_=note("\nOutput Options") +#@gui :_=separator() +#@gui :Grow Alpha=int(2,-20,20) +#@gui :Blur Alpha=int(2,0,20) +#@gui :_=note("\nAdvanced Options") +#@gui :_=separator() +#@gui :Patch Size=int(18,3,100) +#@gui :Fill Holes %=int(0,0,50) +#@gui :Min Area %=int(0,0,50) +#@gui :Show Watershed=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2013/02/11.") +#@gui Hue Lighten-Darken:iain_hue_light_dark_p,iain_hue_light_dark_p +#@gui :Red=float(0,-255,255) +#@gui :2=float(0,-255,255) +#@gui :3=float(0,-255,255) +#@gui :Yellow=float(0,-255,255) +#@gui :5=float(0,-255,255) +#@gui :6=float(0,-255,255) +#@gui :Green=float(0,-255,255) +#@gui :8=float(0,-255,255) +#@gui :Cyan=float(0,-255,255) +#@gui :10=float(0,-255,255) +#@gui :11=float(0,-255,255) +#@gui :Blue=float(0,-255,255) +#@gui :13=float(0,-255,255) +#@gui :14=float(0,-255,255) +#@gui :Magenta=float(0,-255,255) +#@gui :16=float(0,-255,255) +#@gui :17=float(0,-255,255) +#@gui :18=float(0,-255,255) +#@gui :_=separator() +#@gui :Global=float(0,-255,255) +#@gui :HSL=bool(0) +#@gui :_=separator() +#@gui :Sat Top=float(255,0,255) +#@gui :Sat Bottom=float(100,0,255) +#@gui :Value Top=float(255,0,255) +#@gui :Value Bottom=float(0,0,255) +#@gui :_=separator() +#@gui :B&W=bool(0) +#@gui :_=separator() +#@gui :Parallel Processing=choice(0,"Auto","Off") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. Update: 4 March 2014 - Added parallel processing option") +#@gui Local Contrast:afre_localcontrast,afre_localcontrast_preview(1)+ +#@gui :_=note("Enhance local contrast.  Filter by afre 2020 Jul28-Sep5.\n\n") +#@gui :Radius=int(1,1,10) +#@gui :Amount=int(50,-100,100) +#@gui :_=note("\n\nNote\n\nG'MIC's preview is inaccurate. Apply the filter and review the results in your host editor.") +#@gui Metallic Look:fx_tk_metallic,fx_tk_metallic_preview(1) +#@gui :Strength=float(1,0,1) +#@gui :Smoothness=float(0,0,20) +#@gui :Metal=choice("Silver","Gold","Copper","Bronze","Blue Steel") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Tom Keil. Latest update: 2011/12/04.") +#@gui Mixer [CMYK]:fx_mix_cmyk,fx_mix_cmyk_preview(1)+ +#@gui :Cyan Factor=float(1,0,4) +#@gui :Cyan Shift=float(0,-255,255) +#@gui :Cyan Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Magenta Factor=float(1,0,4) +#@gui :Magenta Shift=float(0,-255,255) +#@gui :Magenta Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Yellow Factor=float(1,0,4) +#@gui :Yellow Shift=float(0,-255,255) +#@gui :Yellow Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Key Factor=float(1,0,4) +#@gui :Key Shift=float(0,-255,255) +#@gui :Key Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/06.") +#@gui Mixer [HSV]:fx_mix_hsv,fx_mix_hsv_preview(1)+ +#@gui :Hue Factor=float(1,0,4) +#@gui :Hue Shift=float(0,-180,180) +#@gui :Hue Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Saturation Factor=float(1,0,4) +#@gui :Saturation Shift=float(0,-1,1) +#@gui :Saturation Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Value Factor=float(1,0,4) +#@gui :Value Shift=float(0,-1,1) +#@gui :Value Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/06.") +#@gui Mixer [Lab]:fx_mix_lab,fx_mix_lab_preview(1)+ +#@gui :Lightness Factor=float(1,0.5,1.5) +#@gui :Lightness Shift=float(0,-50,50) +#@gui :Lightness Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :A-Color Factor=float(1,0,4) +#@gui :A-Color Shift=float(0,-20,20) +#@gui :A-Color Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :B-Color Factor=float(1,0,4) +#@gui :B-Color Shift=float(0,-20,20) +#@gui :B-Color Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/06.") +#@gui Mixer [PCA]:fx_mix_pca,fx_mix_pca_preview(1)+ +#@gui :Primary Factor=float(0,-1.5,1.5) +#@gui :Primary Shift=float(0,-255,255) +#@gui :Primary Twist=float(0,-180,180) +#@gui :Primary Gamma=float(0,-100,100) +#@gui :_=separator() +#@gui :Secondary Factor=float(0,-1.5,1.5) +#@gui :Secondary Shift=float(0,-255,255) +#@gui :Secondary Twist=float(0,-180,180) +#@gui :Secondary Gamma=float(0,-100,100) +#@gui :_=separator() +#@gui :Tertiary Factor=float(0,-1.5,1.5) +#@gui :Tertiary Shift=float(0,-255,255) +#@gui :Tertiary Twist=float(0,-180,180) +#@gui :Tertiary Gamma=float(0,-100,100) +#@gui :_=separator() +#@gui :Display Color Axes=bool(1) +#@gui :_=value(-1,-1,-1,-1) +#@gui :_=value(0,0,0,0,0,0,0,0,0,0,0,0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/07/18.") +#@gui Mixer [RGB]:fx_mix_rgb,fx_mix_rgb_preview(1)+ +#@gui :Red Factor=float(1,0,4) +#@gui :Red Shift=float(0,-255,255) +#@gui :Red Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Green Factor=float(1,0,4) +#@gui :Green Shift=float(0,-255,255) +#@gui :Green Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Blue Factor=float(1,0,4) +#@gui :Blue Shift=float(0,-255,255) +#@gui :Blue Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/06.") +#@gui Mixer [YCbCr]:fx_mix_ycbcr,fx_mix_ycbcr_preview(1)+ +#@gui :Luminance Factor=float(1,0,4) +#@gui :Luminance Shift=float(0,-255,255) +#@gui :Luminance Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Blue Chroma Factor=float(1,0,4) +#@gui :Blue Chroma Shift=float(0,-255,255) +#@gui :Blue Chroma Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Red Chroma Factor=float(1,0,4) +#@gui :Red Chroma Shift=float(0,-255,255) +#@gui :Red Chroma Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/06.") +#@gui Random Color Transformation:fx_random_color_transformation,fx_random_color_transformation_preview(1)+ +#@gui :Seed=float(0,0,100000) +#@gui :Randomize Seed=button() +#@gui :_=value(1) +#@gui :_=separator() +#@gui :Amplitude (%)=float(100,0,100) +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2023/03/10.") +#@gui Retinex:fx_retinex,fx_retinex_preview(0)+ +#@gui :Strength (%)=float(75,0,100) +#@gui :Value Offset=float(16,1,256) +#@gui :Colorspace=choice(1,"HSI","HSV","Lab","Linear RGB","RGB","YCbCr") +#@gui :Min Cut (%)=float(1,0,100) +#@gui :Max Cut (%)=float(1,0,100) +#@gui :Regularization=float(5,0,32) +#@gui :_=separator() +#@gui :Low Scale=float(15,1,512) +#@gui :Middle Scale=float(80,1,512) +#@gui :High Scale=float(250,1,512) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Note: This filter implements the Multiscale Color Retinex algorithm, as described in:") +#@gui :_=link("http://www.ipol.im/pub/art/2014/107/") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/13/09.") +#@gui Retro Fade:fx_retrofade,fx_retrofade_preview +#@gui :Iterations=int(20,1,64) +#@gui :Colors=int(6,2,32) +#@gui :Grain=float(40,1,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/25/10.") +#@gui RGB Tone:iain_rgb_tone,iain_rgb_tone +#@gui :_=note("Adjust Reds for pixels that have:") +#@gui :Little Red=float(0,-255,255) +#@gui :Some Red=float(0,-255,255) +#@gui :Much Red=float(0,-255,255) +#@gui :_=note("Adjust Reds for pixels that have:") +#@gui :Little Green=float(0,-255,255) +#@gui :Some Green=float(0,-255,255) +#@gui :Much Green=float(0,-255,255) +#@gui :_=note("Adjust Reds for pixels that have:") +#@gui :Little Blue=float(0,-255,255) +#@gui :Some Blue=float(0,-255,255) +#@gui :Much Blue=float(0,-255,255) +#@gui :_=separator(xx) +#@gui :_=note("Adjust Greens for pixels that have:") +#@gui :Little Red=float(0,-255,255) +#@gui :Some Red=float(0,-255,255) +#@gui :Much Red=float(0,-255,255) +#@gui :_=note("Adjust Greens for pixels that have:") +#@gui :Little Green=float(0,-255,255) +#@gui :Some Green=float(0,-255,255) +#@gui :Much Green=float(0,-255,255) +#@gui :_=note("Adjust Greens for pixels that have:") +#@gui :Little Blue=float(0,-255,255) +#@gui :Some Blue=float(0,-255,255) +#@gui :Much Blue=float(0,-255,255) +#@gui :_=separator() +#@gui :_=note("Adjust Blues for pixels that have:") +#@gui :Little Red=float(0,-255,255) +#@gui :Some Red=float(0,-255,255) +#@gui :Much Red=float(0,-255,255) +#@gui :_=note("Adjust Blues for pixels that have:") +#@gui :Little Green=float(0,-255,255) +#@gui :Some Green=float(0,-255,255) +#@gui :Much Green=float(0,-255,255) +#@gui :_=note("Adjust Blues for pixels that have:") +#@gui :Little Blue=float(0,-255,255) +#@gui :Some Blue=float(0,-255,255) +#@gui :Much Blue=float(0,-255,255) +#@gui :_=separator() +#@gui :_=note("Strength of effect for Saturation level:") +#@gui :None=float(255,0,255) +#@gui :Little=float(255,0,255) +#@gui :Some=float(255,0,255) +#@gui :Much=float(255,0,255) +#@gui :Most=float(255,0,255) +#@gui :_=separator() +#@gui :Output=choice(0,"Perserve Luminance","Clip","Scale") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson.") +#@gui Saturation EQ:Saturation_EQ_p,Saturation_EQ_p +#@gui :_=note("Lightness") +#@gui :Black=float(0,-128,128) +#@gui :Near Black=float(0,-128,128) +#@gui :Dark Grey=float(0,-128,128) +#@gui :Mid-Dark Grey=float(0,-128,128) +#@gui :Middle Grey=float(0,-128,128) +#@gui :Mid-Light Grey=float(0,-128,128) +#@gui :Light Grey=float(0,-128,128) +#@gui :Highlights=float(0,-128,128) +#@gui :White=float(0,-128,128) +#@gui :_=separator() +#@gui :_=note("Hue") +#@gui :0=float(0,-128,128) +#@gui :45=float(0,-128,128) +#@gui :90=float(0,-128,128) +#@gui :135=float(0,-128,128) +#@gui :180=float(0,-128,128) +#@gui :225=float(0,-128,128) +#@gui :270=float(0,-128,128) +#@gui :315=float(0,-128,128) +#@gui :360=float(0,-128,128) +#@gui :Rotate Hue Bands=float(0,-45,45) +#@gui :_=separator() +#@gui :Parallel Processing=choice(0,"Auto","Off") +#@gui :_=separator() +#@gui :_=note("This filter allows you to adjust the Saturation based on the Lightness or Hue of the pixel. The Rotate Hue Bands control allows you shift the hue that each band controls by 45 degrees.") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. Update: 4 March 2014 - Added parallel processing option") +#@gui Select-Replace Color:fx_select_color,fx_select_color_preview(0) +#@gui :Similarity Space=choice(0,"RGB[A]","RGB","YCbCr","Red","Green","Blue","Opacity","Luminance","Blue & Red Chrominances","Hue","Saturation") +#@gui :Tolerance=float(20,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Fill Holes=int(0,0,256) +#@gui :Selected Color=color(#ffffffff) +#@gui :Output As=choice(0,"Selected Colors","Selected Mask","Rejected Colors","Rejected Mask","Replaced Color") +#@gui :Replacement Color=color(#ff0000ff) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Selective Desaturation:fx_selective_desaturation,fx_selective_desaturation_preview(1) +#@gui :Reference Color=color(#ffffff) +#@gui :Desaturate=choice("Reference Color","All but Reference Color") +#@gui :Strength=float(3,0,10) +#@gui :Regularization=int(0,0,20) +#@gui :Maximum Saturation=choice("From Input","From Reference Color","Maximum Value") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/15/07.") +#@gui Sepia:fx_sepia,fx_sepia_preview(1)+ +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Simulate Film:fx_simulate_film,fx_simulate_film_preview(1)+ +#@gui :Category=choice{"Black & White (25)","Instant [Consumer] (54)","Instant [Pro] (68)","Fuji XTrans III (15)","Negative [Color] (13)","Negative [New] (39)","Negative [Old] (44)","Print Films (12)","Slide [Color] (26)"} +#@gui :Preset=choice{1,"All [Collage]","None","Agfa APX 100","Agfa APX 25","Fuji Neopan 1600","Fuji Neopan Acros 100","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","Kodak BW 400 CN","Kodak HIE (HS Infra)","Kodak T-Max 100","Kodak T-Max 3200","Kodak T-Max 400","Kodak Tri-X 400","Polaroid 664","Polaroid 667","Polaroid 672","Rollei IR 400","Rollei Ortho 25","Rollei Retro 100 Tonal","Rollei Retro 80s"}_2 +#@gui :Preset=choice{1,"All [Collage]","None","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 +","Polaroid PX-680 Cold ++","Polaroid PX-680 Cold ++a","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"}_0 +#@gui :Preset=choice{1,"All [Collage]","None","Fuji FP-100c --","Fuji FP-100c -","Fuji FP-100c","Fuji FP-100c (alt)","Fuji FP-100c +","Fuji FP-100c ++","Fuji FP-100c ++a","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 ++","Fuji FP-100c Negative ++a","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","Polaroid 665 --","Polaroid 665 -","Polaroid 665","Polaroid 665 +","Polaroid 665 ++","Polaroid 665 Negative -","Polaroid 665 Negative","Polaroid 665 Negative +","Polaroid 665 Negative HC","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 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 ++"}_0 +#@gui :Preset=choice(1,"All [Collage]","None","Acros","Acros+G","Acros+R","Acros+Ye","Astia","Classic Chrome","Mono","Mono+G","Mono+R","Mono+Ye","Pro Neg Hi","Pro Neg Std","Provia","Sepia","Velvia")_0 +#@gui :Preset=choice(1,"All [Collage]","None","Agfa Ultra Color 100","Agfa Vista 200","Fuji Superia 200","Fuji Superia HG 1600","Fuji Superia Reala 100","Fuji Superia X-Tra 800","Kodak Ektar 100","Kodak Elite 100 XPRO","Kodak Elite Color 200","Kodak Elite Color 400","Kodak Portra 160 NC","Kodak Portra 160 VC","Lomography Redscale 100")_0 +#@gui :Preset=choice{1,"All [Collage]","None","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 Ilford HP5 -","Fuji Ilford HP5","Fuji Ilford HP5 +","Fuji Ilford HP5 ++","Kodak Portra 160 -","Kodak Portra 160","Kodak Portra 160 +","Kodak Portra 160 ++","Kodak Portra 400 -","Kodak Portra 400","Kodak Portra 400 +","Kodak Portra 400 ++","Kodak Portra 800 -","Kodak Portra 800","Kodak Portra 800 +","Kodak Portra 800 ++","Kodak Portra 800 HC","Kodak T-MAX 3200 -","Kodak T-MAX 3200","Kodak T-MAX 3200 +","Kodak T-MAX 3200 ++","Kodak T-MAX 3200 (alt)","Kodak TRI-X 400 -","Kodak TRI-X 400","Kodak TRI-X 400 +","Kodak TRI-X 400 ++","Kodak TRI-X 400 (alt)"}_0 +#@gui :Preset=choice(1,"All [Collage]","None","Fuji Ilford Delta 3200 -","Fuji Ilford Delta 3200","Fuji Ilford Delta 3200 +","Fuji Ilford Delta 3200 ++","Fuji Neopan 1600 -","Fuji Neopan 1600","Fuji Neopan 1600 +","Fuji Neopan 1600 ++","Fuji Superia 100 -","Fuji Superia 100","Fuji Superia 100 +","Fuji Superia 100 ++","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 1600 -","Fuji Superia 1600","Fuji Superia 1600 +","Fuji Superia 1600 ++","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 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 ++")_0 +#@gui :Preset=choice{1,"All [Collage]","None","Fuji 3510 (Constlclip)","Fuji 3510 (Constlmap)","Fuji 3510 (Cuspclip)","Fuji 3513 (Constlclip)","Fuji 3513 (Constlmap)","Fuji 3513 (Cuspclip)","Kodak 2383 (Constlclip)","Kodak 2383 (Constlmap)","Kodak 2383 (Cuspclip)","Kodak 2393 (Constlclip)","Kodak 2393 (Constlmap)","Kodak 2393 (Cuspclip)"}_0 +#@gui :Preset=choice(1,"All [Collage]","None","Agfa Precisa 100","Fuji Astia 100F","Fuji FP 100C","Fuji Provia 100F","Fuji Provia 400F","Fuji Provia 400X","Fuji Sensia 100","Fuji Superia 200 XPRO","Fuji Velvia 50","Generic Fuji Astia 100","Generic Fuji Provia 100","Generic Fuji Velvia 100","Generic Kodachrome 64","Generic Kodak Ektachrome 100 VS","Kodak E-100 GX Ektachrome 100","Kodak Ektachrome 100 VS","Kodak Elite Chrome 200","Kodak Elite Chrome 400","Kodak Elite ExtraColor 100","Kodak Kodachrome 200","Kodak Kodachrome 25","Kodak Kodachrome 64","Lomography X-Pro Slide 200","Polaroid 669","Polaroid 690","Polaroid Polachrome")_0 +#@gui :Thumbnail Size=int(512,0,1024)_1 +#@gui :_=separator() +#@gui :Strength (%)=float(100,0,100) +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :Normalize Colors=choice("None","Pre-Normalize","Post-Normalize","Both") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Note: The color LUTs proposed in this filter come from various free sources :") +#@gui :_=note("* RawTherapee Film Simulation.") +#@gui :_=note("* Pat David Film Emulation. ") +#@gui :_=note("* Fuji Film Simulation Profiles.") +#@gui :_=note("* Print Film LUTs For Download. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/02/27.") +#@gui Softlight:afre_softlight,afre_softlight_preview(1)+ +#@gui :_=note("Blend image with itself or another image using softlight.  Filter by afre 2019-2020 Sept9.\n\n") +#@gui :Amount=int(50,-100,100) +#@gui :Reverse Order=bool(0) +#@gui :_=note("\n\nHint\n\nUse the  Input layers  menu to select the layer(s) you would like to blend.") +#@gui :_=note("\nNote\n\nG'MIC's preview is inaccurate. Apply the filter and review the results in your host editor.") +#@gui Specific Saturation:gcd_hio_levels,gcd_hio_levels_preview(1) +#@gui :_=note("\nHue Levels") +#@gui :_=separator() +#@gui :Input=float(1,0,2) +#@gui :Opposing=float(1,0,2) +#@gui :Hue=int(39,0,360) +#@gui :Level=float(0,-0.5,0.5) +#@gui :_=note("\nLuma Levels") +#@gui :_=separator() +#@gui :Gamma=float(1,0.2,1.8) +#@gui :Contrast=float(1,0.2,1.8) +#@gui :SRGB Conversion=bool(0) +#@gui :Process Top Layer Only=bool(0) +#@gui :_=separator() +#@gui :Preview=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Horizontal","Duplicate Vertical","Blend All Layers") +#@gui :_=value(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2016/01/22.") +#@gui Tone Presets:iain_tone_presets_p,iain_tone_presets_p +#@gui :Preset=choice("Whiter Whites","Warm Vintage","Magenta-Yellow","Velvetia","Seventies Magazine","Faded Print","Expired 69","Modern Film") +#@gui :Strength=float(100,-200,200) +#@gui :Scale Output=bool(0) +#@gui :_=separator() +#@gui :Parallel Processing=choice(0,"Auto","Off") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. Update: 4 March 2014 - Added parallel processing option") +#@gui Transfer Colors [Histogram]:fx_transfer_histogram,fx_transfer_histogram_preview(1)+ : * +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Reference Colors=choice("Bottom Layer","Top Layer") +#@gui :_=separator() +#@gui :Preview Ref Point=point(1,1,0,0,255,255,255,128,4)_0 +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Note: This filter needs at least two layers to work properly. Set the Input layers option to handle multiple input layers. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/01/13.") +#@gui Transfer Colors [Patch-Based]:fx_gcd_transfer_colors_patch,fx_gcd_transfer_colors_patch_preview(1) +#@gui :_=note("Generate a CLUT and apply it to other images.") +#@gui :_=note("\nInput Options") +#@gui :_=separator() +#@gui :Resolution=int(6,2,8) +#@gui :Smooth=float(3,0,10) +#@gui :Iters=int(5,0,20) +#@gui :Random=int(5,0,20) +#@gui :_=note("\nOutput Options") +#@gui :_=separator() +#@gui :Reference=choice("Top Layer","Bottom Layer") +#@gui :Output CLUT=_choice("Disable","512x512 Layer","4096x4096 Layer") +#@gui :_=note("\n") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2017/08/17.") +#@gui :_=note("\nNotes") +#@gui :_=note("Set the Input layers option to transfer colors to other layers.") +#@gui :_=note("If only one input layer is selected a CLUT is always output.") +#@gui :_=note("Higher resolution, iters, or random generally produce better results - at the cost of processing time.") +#@gui :_=note("Results are not necessarily the same every time due to the random based algorithm.") +#@gui Transfer Colors [PCA]:fx_transfer_pca,fx_transfer_pca_preview(1)+ : * +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Reference Colors=choice("Bottom Layer","Top Layer") +#@gui :_=separator() +#@gui :Preview Ref Point=point(1,1,0,0,255,255,255,128,4)_0 +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Note: This filter needs at least two layers to work properly. Set the Input layers option to handle multiple input layers. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/01/13.") +#@gui Transfer Colors [Variational]:fx_transfer_rgb,fx_transfer_rgb_preview(1)+ : * +#@gui :Regularization=int(8,0,32) +#@gui :Preserve Luminance=float(0.2,0,1) +#@gui :Precision=_choice(1,"Low","Normal","High","Very High") +#@gui :Reference Colors=choice("Bottom Layer","Top Layer") +#@gui :Add User-Defined Constraints (Interactive)=_bool(0) +#@gui :_=separator() +#@gui :Preview Ref Point=point(1,1,0,0,255,255,255,128,4)_0 +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Instructions:\n - This filter transfers the colors of one layer to all the others.\n - Don't forget to set the Input layers... option on the left to manage your input layers.\n ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/04/04.") +#@gui Tune HSV Colors:fx_tune_hsv,fx_tune_hsv_preview(1) +#@gui :Dark=choice(2,"Ignore","Lock","Remap") +#@gui :Dark Color=color(#000000) +#@gui :Target Hue (%)=float(100,0,100) +#@gui :Target Saturation (%)=float(100,0,100) +#@gui :Target Value (%)=float(100,0,100) +#@gui :_=separator() +#@gui :Light=choice(2,"Ignore","Lock","Remap") +#@gui :Light Color=color(#ffffff) +#@gui :Target Hue (%)=float(100,0,100) +#@gui :Target Saturation (%)=float(100,0,100) +#@gui :Target Value (%)=float(100,0,100) +#@gui :_=separator() +#@gui :Average=choice(1,"Ignore","Lock","Remap") +#@gui :Average Color=color(#808080)_0 +#@gui :Target Hue (%)=float(0,0,100)_0 +#@gui :Target Saturation (%)=float(50,0,100)_0 +#@gui :Target Value (%)=float(100,0,100)_0 +#@gui :_=separator() +#@gui :Red=choice("Ignore","Lock","Remap") +#@gui :Red Color=color(#ff0000)_0 +#@gui :Target Hue (%)=float(100,0,100)_0 +#@gui :Target Saturation (%)=float(12.5,0,100)_0 +#@gui :Target Value (%)=float(0,0,100)_0 +#@gui :_=separator() +#@gui :Yellow=choice("Ignore","Lock","Remap") +#@gui :Yellow Color=color(#ffff00)_0 +#@gui :Target Hue (%)=float(100,0,100)_0 +#@gui :Target Saturation (%)=float(12.5,0,100)_0 +#@gui :Target Value (%)=float(0,0,100)_0 +#@gui :_=separator() +#@gui :Green=choice("Ignore","Lock","Remap") +#@gui :Green Color=color(#00ff00)_0 +#@gui :Target Hue (%)=float(100,0,100)_0 +#@gui :Target Saturation (%)=float(12.5,0,100)_0 +#@gui :Target Value (%)=float(0,0,100)_0 +#@gui :_=separator() +#@gui :Cyan=choice("Ignore","Lock","Remap") +#@gui :Cyan Color=color(#00ffff)_0 +#@gui :Target Hue (%)=float(100,0,100)_0 +#@gui :Target Saturation (%)=float(12.5,0,100)_0 +#@gui :Target Value (%)=float(0,0,100)_0 +#@gui :_=separator() +#@gui :Blue=choice("Ignore","Lock","Remap") +#@gui :Blue Color=color(#0000ff)_0 +#@gui :Target Hue (%)=float(100,0,100)_0 +#@gui :Target Saturation (%)=float(12.5,0,100)_0 +#@gui :Target Value (%)=float(0,0,100)_0 +#@gui :_=separator() +#@gui :Magenta=choice("Ignore","Lock","Remap") +#@gui :Magenta Color=color(#ff00ff)_0 +#@gui :Target Hue (%)=float(100,0,100)_0 +#@gui :Target Saturation (%)=float(12.5,0,100)_0 +#@gui :Target Value (%)=float(0,0,100)_0 +#@gui :_=separator() +#@gui :Preview Color Mapping=choice(2,"None","Center","Top Left","Top Right","Bottom Left","Bottom Right") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/12/17.") +#@gui User-Defined:fx_custom_transform,fx_custom_transform +#@gui :Red - Green - Blue - Alpha=text("i") +#@gui :Red - Green - Blue=text{"i + 90*(x/w)*cos(i/10)"} +#@gui :Red=text("i") +#@gui :Green=text("i") +#@gui :Blue=text("i") +#@gui :Alpha=text("i") +#@gui :Value Normalization=choice("None","RGB","RGBA") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Vibrance:fx_vibrance,fx_vibrance_preview(1)+ +#@gui :Strength=float(0.5,-1,3) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Age / Pixls.us.      Latest Update: 2022/06/28.") +#@gui Vintage Style:fx_tk_vintage,fx_tk_vintage_preview(1) +#@gui :Exposure=float(2,-5,5) +#@gui :Contrast=float(0.85,0.5,1.5) +#@gui :Saturation=float(0.7,0,4) +#@gui :Shadows Threshold=float(80,0,128) +#@gui :Highlights Threshold=float(200,128,255) +#@gui :Transition Smoothness=float(5,0,50) +#@gui :_=separator() +#@gui :Color Shadows=color(#931aa1) +#@gui :Strength Shadows=float(0.3,0,1) +#@gui :Color Midtones=color(#ebdcb0) +#@gui :Strength Midtones=float(0.4,0,1) +#@gui :Color Highlights=color(#beb56c) +#@gui :Strength Highlights=float(0.2,0,1) +#@gui :Color Overall Effect=color(#000064) +#@gui :Color Effect Mode=choice("Exclusion","Overlay","Soft Light","Multiply","Screen") +#@gui :Strength Effect=float(0.3,0,1) +#@gui :_=separator() +#@gui :Vignette Size=float(25,0,100) +#@gui :Vignette Strenth=float(0,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical") +#@gui :_=separator() +#@gui :_=note("Author : Tom Keil. Latest update: 2011/04/06.") +#@gui Zone System:fx_zonesystem,fx_zonesystem_preview(1) +#@gui :Shadows Zone=int(1,1,5) +#@gui :Highlights Zone=int(10,6,10) +#@gui :Gamma=float(1,0,5) +#@gui :Contrast=float(1,0,4) +#@gui :Black Point=int(0,0,255) +#@gui :White Point=int(255,0,255) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Tom Keil. Latest update: 2011/13/02.") +#@gui _Contours +#@gui Convolve:fx_convolve,fx_convolve_preview(0) +#@gui :Kernel=choice("Custom","Average 3x3","Average 5x5","Average 7x7","Average 9x9","Prewitt-X","Prewitt-Y","Sobel-X","Sobel-Y","Rotinv-X","Rotinv-Y","Laplacian","Robert Cross 1","Robert Cross 2","Impulses 5x5","Impulses 7x7","Impulses 9x9") +#@gui :Boundary=choice(1,"Dirichlet","Neumann") +#@gui :_=separator() +#@gui :_=note("Note: If parameter Kernel is set to Custom, it uses the custom convolution kernel defined below. Use commas and semicolons as separators for res. matrix columns and rows. ") +#@gui :Custom Kernel=text("0,1,0;1,-4,1;0,1,0") +#@gui :_=separator() +#@gui :_=note("Note: Kernel multiplier is useful only when parameter Value range is set to Cut.") +#@gui :Value Range=choice(1,"Cut","Normalize") +#@gui :Kernel Multiplier=float(1,0,50) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/06/06.") +#@gui Curvature:fx_curvature,fx_curvature_preview(0) +#@gui :Smoothness=float(2,0,10) +#@gui :Min Threshold=float(0,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Absolute Value=bool(0) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Difference of Gaussians:fx_dog,fx_dog_preview(1)* +#@gui :1st Variance=float(1.4,0,5) +#@gui :2nd Variance=float(1.5,0,5) +#@gui :Threshold=float(0,0,49) +#@gui :Negative Colors=bool(0) +#@gui :Monochrome=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Distance Transform:fx_distance,fx_distance_preview(0) +#@gui :Value=int(128,0,255) +#@gui :Metric=choice(2,"Chebyshev","Manhattan","Euclidean","Squared-Euclidean") +#@gui :Normalization=choice(2,"Cut","Normalize","Modulo") +#@gui :Modulo Value=int(32,1,255) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/07/04.") +#@gui Edge:afre_edge,afre_edge_preview(0)+ +#@gui :_=note("Compute edge.  Filter by afre 2019-2020 May3.\n\n") +#@gui :Method=choice(0,"Gradient","Standard Deviation") +#@gui :Thinning=int(1,1,10) +#@gui :Recovery=float(1,0.5,4) +#@gui :Brightness=float(1,0.5,4) +#@gui :Details=float(1,0.5,4) +#@gui Edges:fx_edges,fx_edges_preview(0) +#@gui :Smoothness=float(0,0,10) +#@gui :Threshold=float(15,0,50) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Edges (Canny):fx_canny,fx_canny_preview(0) +#@gui :Sigma=float(5,0,20) +#@gui :Lower Threshold=float(0.05,0,1) +#@gui :Upper Threshold=float(0.15,0,1) +#@gui :Monochrome=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Garagecoder and David Tschumperlé.      Latest Update: 2023/12/04.") +#@gui Edges Offsets:fx_edge_offsets,fx_edge_offsets_preview(0) +#@gui :Smoothness=float(0,0,10) +#@gui :Threshold=float(15,0,50) +#@gui :Scale=int(4,0,32) +#@gui :Thickness=int(1,0,16) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Extract Foreground [Interactive]:fx_extract_foreground,gui_no_preview +#@gui :Feathering=_float(0,0,4) +#@gui :Dilation=int(0,-32,32) +#@gui :Output Mode=choice{3,"RGBA Image (Full-Transparency / 1 Layer)","RGBA Image (Updatable / 1 Layer)","RGB Image + Binary Mask (2 Layers)","RGBA Foreground + Background (2 Layers)"} +#@gui :View Resolution=_choice{1,"Small (Faster)","Medium","High (Slower)","Very High (Even Slower)"} +#@gui :_=separator() +#@gui :_=note("Description:\n This filter allows to quickly extract foreground objects from background in opaque RGB images. Click on the Apply or OK buttons below to open the interactive window and start adding foreground and background control points. When you're done, exit the interactive window: your extracted foreground will be transferred back to the host software.\n\n If you are not satisfied with the result, click on Apply once again to modify your control points defined previously. To remove all control points, click on the Reset button above. ") +#@gui :_=value(0,0) +#@gui :_=value(-1) +#@gui :_=separator() +#@gui :_=note{"Interactions:\n Use the following actions in the interactive window to build your extraction mask :\n\n - Left mouse button or key F create a new foreground control point (or move an existing one).\n - Right mouse button or key B create a new background control point (or move an existing one).\n - Mouse wheel, or keys CTRL+arrows UP/DOWN zoom view in/out.\n - Key SPACE updates the extraction mask.\n - Key TAB toggles background view modes.\n - Key M toggles marker view modes.\n - Key BACKSPACE deletes the last control point added.\n - Key PAGE UP increases background opacity.\n - Key PAGE DOWN decreases background opacity.\n - Keys CTRL+D increase window size.\n - Keys CTRL+C decrease window size.\n - Keys CTRL+R reset window size.\n - Keys ESC, Q or ENTER exit the interactive window. "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/29/09.") +#@gui Gradient Norm:fx_gradient_norm,fx_gradient_norm_preview(0) +#@gui :Smoothness=float(0,0,10) +#@gui :Linearity=float(0.5,0,1.5) +#@gui :Min Threshold=float(0,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Gradient RGB:fx_gradient2rgb,fx_gradient2rgb_preview(0) +#@gui :Smoothness=float(0,0,10) +#@gui :Min Threshold=float(0,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Orientation Only=bool(0) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Isophotes:fx_isophotes,fx_isophotes_preview(0) +#@gui :Levels=int(8,1,256) +#@gui :Smoothness=float(0,0,5) +#@gui :Filling=choice(1,"Transparent","Colors") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Laplacian:fx_laplacian,fx_laplacian_preview(0) +#@gui :Smoothness=float(0,0,10) +#@gui :Min Threshold=float(0,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Absolute Value=bool(0) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Local Orientation:fx_local_orientation,fx_local_orientation_preview(1) +#@gui :Smoothness=float(0,0,5) +#@gui :Min Threshold=float(0,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Morphological Filter:fx_morphological,fx_morphological_preview(0) +#@gui :Action=choice{"Erosion","Dilation","Opening","Closing","Original - Erosion","Dilation - Original","Original - Opening","Closing - Original","Original - (Opening + Closing)/2","Closing - Opening"} +#@gui :Kernel=choice(0,"Square","Octagonal","Circular","Custom") +#@gui :Size=int(5,2,60) +#@gui :_=note("Parameter Size is inactive for Custom kernel.") +#@gui :Custom Kernel=text("1,0,1; 0,1,0; 1,0,1") +#@gui :Negative=bool() +#@gui :Process Transparency=bool(0) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Stretch") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/22/06.") +#@gui Segmentation:fx_segment_watershed,fx_segment_watershed_preview(0) +#@gui :Edge Threshold=float(2,0,15) +#@gui :Smoothness=float(1,0,5) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Skeleton:fx_skeleton,fx_skeleton_preview(1) +#@gui :Method=choice{"Distance (Fast)","Thinning (Slow)"} +#@gui :Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/07/04.") +#@gui Super-Pixels:fx_superpixels,fx_superpixels_preview(0) +#@gui :Size=int(16,4,64) +#@gui :Regularity=float(10,0,128) +#@gui :Iterations=int(5,1,16) +#@gui :Colors=choice(1,"Random","Average") +#@gui :Border Opacity=float(1,0,1) +#@gui :Border Thickness (px)=int(1,1,16) +#@gui :Border Color=color(#000000ff) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/11/16.") +#@gui Thin Edges:fx_thin_edges,fx_thin_edges_preview(0) +#@gui :Smoothness=float(0,0,10) +#@gui :Threshold=float(15,0,50) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui _Deformations +#@gui Breaks:fx_breaks,fx_breaks(0) +#@gui :Type=choice("Flat","Relief") +#@gui :Amplitude=float(30,0,300) +#@gui :Frequency (%)=float(30,0,100) +#@gui :Smoothness=float(0.5,0,10) +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/09/09.") +#@gui Cartesian Transform:fx_custom_deformation,fx_custom_deformation(1) +#@gui :X-Warping=text{"(w*a%)*cos(b*y/h)"} +#@gui :Y-Warping=text{"(h*c%)*cos(d*x/w)"} +#@gui :Relative Warping=bool(1) +#@gui :Interpolation=choice(1,"Nearest Neighbor","Linear") +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Note:The parameters below can be used in the warping formulas:") +#@gui :A=float(10,-100,100) +#@gui :B=float(10,-100,100) +#@gui :C=float(10,-100,100) +#@gui :D=float(10,-100,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2023/10/26.") +#@gui Circle Transform:fx_circle_transform,fx_circle_transform_preview(1) +#@gui :Center (%)=point(50,50,0,1) +#@gui :Radius=point(75,50,0,1) +#@gui :X-Scale=float(-2,-16,16) +#@gui :Y-Scale=float(-2,-16,16) +#@gui :Symmetry=choice("None","Inside","Outside") +#@gui :Interpolation=choice(1,"Nearest Neighbor","Linear") +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :Preview Reference Circle=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/08/01.") +#@gui Conformal Maps:fx_conformal_maps,fx_conformal_maps_preview(1) +#@gui :Mapping=choice{8,"Custom Formula","Z","(z+1)/(z-1)","Cos(z)","Sin(z)","Tan(z)","Exp(z)","Log(z)","Dipole: 1/(4*z^2-1)","Star: -5*(z^3/3-Z/4)/2"} +#@gui :Exponent (Real)=float(1,-16,16) +#@gui :Exponent (Imaginary)=float(0,-16,16) +#@gui :Custom Formula=text{1,"((1.1 + i*z/6)/(1.04 - i*z/6))^6.2"} +#@gui :_=separator() +#@gui :Zoom=float(0,-4,4) +#@gui :Angle=float(0,-180,180) +#@gui :Aspect Ratio=float(0,-1,1) +#@gui :X-Shift=float(0,-5,5) +#@gui :Y-Shift=float(0,-5,5) +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :Anti-Aliasing=int(0,0,3) +#@gui :_=separator() +#@gui :Specify Different Output Size=_bool(0) +#@gui :Output Width=_text("1024") +#@gui :Output Height=_text("1024") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/15/02.") +#@gui Continuous Droste:souphead_droste10,souphead_droste10_preview(1) +#@gui :Inner Radius=float(40,1,100) +#@gui :Outer Radius=float(100,1,100) +#@gui :Periodicity=float(1,-6,6) +#@gui :Strands=int(1,-6,6) +#@gui :Zoom=int(1,1,100) +#@gui :Rotate=int(0,-360,360) +#@gui :X-Shift=int(0,-100,100) +#@gui :Y-Shift=int(0,-100,100) +#@gui :Center X-Shift=int(0,-100,100) +#@gui :Center Y-Shift=int(0,-100,100) +#@gui :Starting Level=int(1,1,20) +#@gui :Number of Levels=int(10,1,20) +#@gui :Level Frequency=int(1,1,10) +#@gui :_=separator() +#@gui :Show Both Poles=bool(0) +#@gui :Pole Rotation=int(90,-180,180) +#@gui :Pole Long=int(0,-100,100) +#@gui :Pole Lat=int(0,-100,100) +#@gui :_=separator() +#@gui :Tile Poles=bool(0) +#@gui :Hyper Droste=bool(0) +#@gui :Fractal Points=int(1,1,10) +#@gui :_=separator() +#@gui :Auto-Set Periodicity=bool(0) +#@gui :No Transparency=bool(0) +#@gui :External Transparency=bool(1) +#@gui :Mirror Effect=bool(0) +#@gui :Untwist=bool(0) +#@gui :Do Not Flatten Transparency=bool(0) +#@gui :_=separator() +#@gui :Show Grid=bool(0) +#@gui :Show Frame=bool(0) +#@gui :_=separator() +#@gui :Antialiasing=bool(1) +#@gui :Edge Behavior X=choice("Blank","Wrap","Reflect","Rotate") +#@gui :Edge Behavior Y=choice("Blank","Wrap","Reflect","Rotate") +#@gui :_=separator() +#@gui :_=note("This filter is a conversion of the Mathmap script originally proposed here:") +#@gui :_=link("Droste effect for Mathmap.","https://www.flickr.com/groups/88221799@N00/discuss/72157601071820707/") +#@gui :_=note("Original design by Breic and coding by Josh Sommers.") +#@gui :_=separator() +#@gui :_=note("Author : Souphead. Latest update : 2016/19/01.") +#@gui Crease:fx_crease,fx_crease(0) +#@gui :Amplitude=float(30,0,300) +#@gui :Frequency (%)=float(10,0,100) +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/01/22.") +#@gui Distort Lens:fx_distort_lens,fx_distort_lens(1) +#@gui :Amplitude=float(0.1,-1,1) +#@gui :Aspect Ratio=float(0,-2,2) +#@gui :Zoom=float(0,-4,4) +#@gui :Center (%)=point(50,50,0,1) +#@gui :Boundary=choice(0,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/18/02.") +#@gui Drop Water:fx_drop_water,fx_drop_water_preview(1) +#@gui :_=note("Shape geometry:") +#@gui :Shapes=choice("Procedural","Opaque Regions on Top Layer") +#@gui :Density=float(20,0,100) +#@gui :Radius=float(2,0,5) +#@gui :Variability=float(80,0,100) +#@gui :Random Seed=int(0,0,16384) +#@gui :_=note("Parameters Density, Radius, Variability and Random seed are used only in Procedural shapes mode.") +#@gui :_=separator() +#@gui :_=note("Light parameters:") +#@gui :Refraction=float(3,0,20) +#@gui :Light Angle=float(35,0,360) +#@gui :Specular Size=float(10,0,100) +#@gui :Specular Intensity=float(1,0,1) +#@gui :Specular Centering=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Shadow parameters:") +#@gui :Shadow Size=float(0.25,0,3) +#@gui :Shadow Intensity=float(0.5,0,1) +#@gui :Shadow Smoothness=float(0.75,0,3) +#@gui :Diffuse Shadow=float(0.05,0,3) +#@gui :_=separator() +#@gui :Smoothness=float(0.15,0,3) +#@gui :Output as Separate Layers=_bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/21/07.") +#@gui Equirectangular to Nadir-Zenith:fx_equirectangular2nadirzenith,fx_equirectangular2nadirzenith(1) +#@gui :Mode=choice("to Nadir / Zenith","to Equirectangular") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/29/12.") +#@gui Euclidean - Polar:fx_euclidean2polar,fx_euclidean2polar(1) +#@gui :Center (%)=point(50,50,0,1) +#@gui :Stretch Factor=float(1,0.1,10) +#@gui :Boundary=choice(1,"Transparent","Nearest","Periodic","Mirror") +#@gui :Inverse Transform=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Fish-Eye:fisheye,fisheye(1) +#@gui :Center (%)=point(50,50,0,1,255) +#@gui :Radius=float(70,0,100) +#@gui :Amplitude=float(1,0,2) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Flower:fx_flower,fx_flower_preview(1) +#@gui :Center (%)=point(50,50,0,1) +#@gui :Amplitude / Angle=point(75,50,0,1) +#@gui :Petals=int(6,2,20) +#@gui :Offset (%)=float(0,0,100) +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Kaleidoscope [Blended]:fx_rotoidoscope,fx_rotoidoscope(1) +#@gui :Center (%)=point(50,50) +#@gui :Angular Tiles=int(10,1,72) +#@gui :Smoothness=float(0.5,0,5) +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Kaleidoscope [Polar]:fx_kaleidoscope,fx_kaleidoscope(1) +#@gui :Center (%)=point(50,50) +#@gui :X-Offset (%)=float(0,0,100) +#@gui :Y-Offset (%)=float(0,0,100) +#@gui :Radius Cut=float(100,0,100) +#@gui :Angle Cut=float(10,0,100) +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Kaleidoscope [Symmetry]:fx_symmetrizoscope,fx_symmetrizoscope(1) +#@gui :Iterations=int(4,1,32) +#@gui :Angle=float(0,0,360) +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :Symmetry Sides=choice("Backward","Forward","Swap") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/07/01.") +#@gui Morph [Interactive]:fx_morph_interactive,fx_morph_interactive_preview : + +#@gui :Number of Frames=int(16,3,1024) +#@gui :Preview Precision=choice{2,"Coarsest (faster)","Coarse","Normal","Fine","Finest (slower)"} +#@gui :_=value(-1) +#@gui :_=separator() +#@gui :_=note("Instructions:") +#@gui :_=note(" Use mouse buttons to add/move/remove correspondence keypoints over the interactive window that will appear, in order to create the morphing.\n\n Source/target window:\n\n - Left mouse button: Add new keypoint on current image and move it on the other one.\n - Right mouse button: Add/move keypoint on current image.\n - Key DELETE or middle mouse button: Delete keypoint.\n - Key SPACE or mouse wheel: Toggle source/target.\n\n In-between window:\n\n - Mouse wheel: Change morphing time, from 0 to 1.\n - Left mouse button: Reset morphing time to 0.5.\n\n Both windows:\n\n - Key TAB: Change keypoint radius.\n - Key ENTER: Play/stop in-between animation.\n - Key R: Reset keypoints.\n - Key K: Show/hide keypoints.\n - Keys ESC or Q: Process fullres and exit. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/04/16.") +#@gui Perspective:fx_warp_perspective,fx_warp_perspective(1) +#@gui :X-Angle=float(1.73,-4,4) +#@gui :Y-Angle=float(0,-4,4) +#@gui :Zoom=float(1,0.1,4) +#@gui :Center (%)=point(50,50,0,1,255) +#@gui :X-Offset=float(0,0,100) +#@gui :Y-Offset=float(0,0,100) +#@gui :Boundary=choice(2,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Polar Transform:fx_transform_polar,fx_transform_polar(1) +#@gui :Preset=choice("Custom Transform","Inverse Radius","Swap Radius / Angle") +#@gui :Center (%)=point(50,50,0,1) +#@gui :Radius=text{"r + R/10*cos(a*5)"} +#@gui :Angle=text("a") +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Quadrangle:fx_quadrangle,fx_quadrangle_preview(1) +#@gui :Top-Left Vertex (%)=point(5,5,0,1,255,0,0) +#@gui :Top-Right Vertex (%)=point(95,25,0,1,0,255,0) +#@gui :Bottom-Right Vertex (%)=point(60,95,0,1,64,128,255) +#@gui :Bottom-Left Vertex (%)=point(40,95,0,1,255,255,0) +#@gui :Interpolation=choice(1,"Nearest Neighbor","Linear") +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :Preview Type=choice(1,"Input","Output","Both") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/10/11.") +#@gui Raindrops:raindrops,raindrops(0) +#@gui :Amplitude=float(80,0,300) +#@gui :Density=float(0.1,0,1) +#@gui :Wavelength=float(1,0,2) +#@gui :Merging Steps=int(0,0,20) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/28/11.") +#@gui Random:deform,deform(0) +#@gui :Amplitude=float(10,0,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Reflection:fx_reflect,fx_reflect(1) +#@gui :Height=float(50,0,100) +#@gui :Attenuation=float(1,0.1,4) +#@gui :Color=color(#6ea0be40) +#@gui :Waves Amplitude=float(0,0,100) +#@gui :Waves Smoothness=float(1.5,0,4) +#@gui :X-Angle=float(0,-10,10) +#@gui :Y-Angle=float(-3.30,-10,10) +#@gui :Focale=float(7,0,10) +#@gui :Zoom=float(1.5,1,5) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Ripple:ripple,ripple(0) +#@gui :Amplitude=float(10,0,100) +#@gui :Bandwidth=float(20,1,300) +#@gui :Shape=choice(2,"Block","Triangle","Sine","Sine+","Random") +#@gui :Angle=float(0,0,360) +#@gui :Offset=float(0,0,500) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/23/08.") +#@gui Seamcarve:fx_seamcarve,fx_seamcarve_preview(1) +#@gui :Width (%)=float(85,0,200) +#@gui :Height (%)=float(100,0,200) +#@gui :Maximal Seams per Iteration (%)=float(15,0,100) +#@gui :Use Top Layer as a Priority Mask=bool(0) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Note: You can define a transparent top layer that will help the seam-carving algorithm to preserve or force removing image structures:\n \n - Draw areas in red to force removing them. \n - Draw areas in green to preserve them. \n - Don't forget also to set the Input layers... parameter to input both layers to the filter. ") +#@gui :_=separator() +#@gui :_=note("Authors: Garagecoder and David Tschumperlé.       Latest Update: 2014/02/06.") +#@gui Sphere:fx_map_sphere,fx_map_sphere_preview(1) +#@gui :Width=_int(512,1,4096) +#@gui :Height=_int(512,1,4096) +#@gui :Radius=float(90,0,400) +#@gui :Dilation=float(0.5,0,1) +#@gui :Angle=float(0,-50,50) +#@gui :Border Smoothness=float(0,0,200) +#@gui :Border Width=float(20,0,100) +#@gui :Orientation=choice("0 Deg.","90 Deg.","180 Deg.","270 Deg.") +#@gui :Background=choice("Transparent","Mean Color") +#@gui :Fading=float(0,0,100) +#@gui :Fading Shape=float(0.5,0,3) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/07/11.") +#@gui Spherize:fx_spherize,fx_spherize_preview(1) +#@gui :Radius (%)=float(50,0,300) +#@gui :Strength=float(1,-10,10) +#@gui :Smoothness (%)=float(0,0,4) +#@gui :Center (%)=point(50,50,0,1,255,255,255,170,10) +#@gui :Ratio=float(0,-2,2) +#@gui :Angle=float(0,-90,90) +#@gui :Interpolation=choice(2,"Nearest Neighbor","Linear","Cubic") +#@gui :Preview Grid=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/10/03.") +#@gui Square to Circle:fx_square_circle,fx_square_circle +#@gui :Mode=choice(0,"Square to Circle","Circle to Square") +#@gui :Interpolation=choice(1,"Nearest Neighbor","Linear") +#@gui :Boundary=choice(0,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :X-Factor (%)=float(0,-100,100) +#@gui :Y-Factor (%)=float(0,-100,100) +#@gui :X-Offset (%)=float(0,-300,300) +#@gui :Y-Offset (%)=float(0,-300,300) +#@gui :_=separator() +#@gui :_=note("This filter implements the mapping functions described in this page, by C. Fong:") +#@gui :_=link("http://squircular.blogspot.com/2015/09/mapping-circle-to-square.html") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/10/30.") +#@gui Square to Circle [alt]:fx_square_circle_alt,fx_square_circle_alt_preview(1) +#@gui :Mode=choice("Square to Circle","Circle to Square") +#@gui :Center=point(50,50,0,1) +#@gui :Zoom (%)=float(0,-100,100) +#@gui :Angle (deg.)=float(0,-180,180) +#@gui :Interpolation=choice(1,"Nearest Neighbor","Linear") +#@gui :Boundary=choice("Transparent","Nearest","Periodic","Mirror") +#@gui :Adapt to Image Ratio=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2023/12/24.") +#@gui Stereographic Projection:fx_project_stereographic,fx_project_stereographic_preview(1) +#@gui :Transform=choice("Direct","Inverse") +#@gui :Center (%)=point(50,50,0,1,255,255,255,170) +#@gui :Radius / Angle=point(50,75,0,1,255,0,255,170) +#@gui :Horizon Leveling (deg)=float(0,-10,10) +#@gui :Left / Right Blur (%)=float(0,0,20) +#@gui :Dilation=float(0,-2,2) +#@gui :Mirror=choice("None","X-Axis","Y-Axis","XY-Axis") +#@gui :Boundary=choice(0,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=value(50,50) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/07/04.") +#@gui Symmetrize:fx_symmetrize,fx_symmetrize_preview(1) +#@gui :Point 1=point(50,50,0,1,0,255,0,170,10) +#@gui :Point 2=point(50,75,-1,1,255,255,0,170,10) +#@gui :Angle=float(0,-180,180) +#@gui :Boundary=choice(0,"Transparent","Nearest","Periodic","Mirror") +#@gui :Type=choice("Symmetry","Antisymmetry") +#@gui :Swap Sides=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/06/11.") +#@gui Textured Glass:fx_textured_glass,fx_textured_glass_preview(0) +#@gui :X-Amplitude=float(40,0,400) +#@gui :Y-Amplitude=float(40,0,400) +#@gui :X-Smoothness=float(1,0,5) +#@gui :Y-Smoothness=float(1,0,5) +#@gui :Edge Attenuation=float(0,0,1) +#@gui :Edge Influence=float(2,0,10) +#@gui :Noise Scale=int(0,0,16) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/21/11.") +#@gui Twirl:fx_twirl,fx_twirl(1) +#@gui :Amplitude=float(1,-5,5) +#@gui :Center (%)=point(50,50,0,1) +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Warp [Interactive]:fx_warp_interactive,fx_warp_interactive_preview(1) +#@gui :Preview Precision=choice{1,"Coarsest (faster)","Coarse","Normal","Fine","Finest (slower)"} +#@gui :_=separator() +#@gui :_=note("Pre-defined keypoints") +#@gui :Regular Grid=int(2,2,10) +#@gui :Contours=int(0,0,32) +#@gui :_=value(-1) +#@gui :_=separator() +#@gui :_=note("Instructions:") +#@gui :_=note(" Use mouse to add/move/delete keypoints over the interactive window that will appear, in order to create the deformation map.\n\n - Left mouse button: Add and move keypoint.\n - Right mouse button: Delete keypoint.\n - Key SPACE or middle mouse button: Show/hide keypoints.\n - Key TAB: Change keypoint radius.\n - Key SHIFT: Toggle to original image.\n - Key R: Reset keypoints.\n - Keys ESC, ENTER or Q: Process fullres and exit. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/04/08.") +#@gui Water:water,water(0) +#@gui :Amplitude=float(30,0,300) +#@gui :Smoothness=float(1.5,0,4) +#@gui :Angle=float(45,0,180) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/07/10.") +#@gui Wave:wave,wave(1) +#@gui :Amplitude=float(10,0,30) +#@gui :Frequency=float(0.4,0,2) +#@gui :Center (%)=point(50,50,0,1,255,255,255,170,10) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Wind:fx_wind,fx_wind_preview(0) +#@gui :Amplitude=int(20,0,500) +#@gui :Angle=float(0,0,360) +#@gui :Attenuation=float(0.7,0,1) +#@gui :Threshold=float(20,0,100) +#@gui :Mode=choice(1,"Darker","Brighter") +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2023/05/26.") +#@gui Zoom:fx_zoom,fx_zoom(1) +#@gui :Factor=float(2,0.01,10) +#@gui :Center (%)=point(50,50,0,1,255) +#@gui :Boundary=choice(0,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui _Degradations +#@gui Add Grain:fx_simulate_grain,fx_simulate_grain_preview(0) +#@gui :Preset=choice("Orwo NP20-GDR","Kodak TMAX 400","Kodak TMAX 3200","Kodak TRI-X 1600","Unknown") +#@gui :Blend Mode=choice(1,"Alpha","Grain Merge","Hard Light","Overlay","Soft Light","Grain Only") +#@gui :Opacity=float(0.2,0,1) +#@gui :Scale=float(100,30,800) +#@gui :Sharpness=float(0,0,512) +#@gui :Colored Grain=bool() +#@gui :_=separator() +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Grain Alone=bool() +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/02/08.") +#@gui Blur [Angular]:fx_blur_angular,fx_blur_angular_preview(1) +#@gui :Amplitude (%)=float(2,0,20) +#@gui :Center (%)=point(50,50,0,1) +#@gui :Sharpness=float(0,0,500) +#@gui :Preview Guides=bool(1) +#@gui :_=separator() +#@gui :Channel(s)=choice(7,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/16/01.") +#@gui Blur [Bloom]:fx_blur_bloom,fx_blur_bloom_preview(0) +#@gui :Amplitude=float(1,0,10) +#@gui :Ratio=float(2,0,5) +#@gui :Iterations=int(5,0,100) +#@gui :Operator=choice("Add","Max","Min") +#@gui :Kernel=choice(1,"Deriche","Gaussian","Box","Triangle","Quadratic") +#@gui :Normalize Scales=bool(0) +#@gui :Anisotropy=float(0,0,1) +#@gui :Angle=float(0,-180,180) +#@gui :_=note("Parameter Angle is only active when Anisotropy>0") +#@gui :_=separator() +#@gui :Channel(s)=choice(7,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/03/02.") +#@gui Blur [Depth-Of-Field]:fx_blur_dof,fx_blur_dof_preview(1) +#@gui :Blur Amplitude=float(3,0,20) +#@gui :Blur Precision=int(16,2,64) +#@gui :Depth-Of-Field Type=choice{"Gaussian","User-Defined (Bottom Layer)"} +#@gui :Invert Blur=bool(0) +#@gui :_=separator() +#@gui :_=note("Gaussian depth-of-field:") +#@gui :Center (%)=point(50,50,0,0,255) +#@gui :First Radius=float(30,0,200) +#@gui :Second Radius=float(30,0,200) +#@gui :Angle=float(0,0,180) +#@gui :Sharpness=float(1,0,8) +#@gui :Preview Guides=bool(1) +#@gui :_=separator() +#@gui :_=note("User-defined depth-of-field:") +#@gui :Gamma=float(0,-2,2) +#@gui :_=note("You can specify your own depth-of-field image, as a bottom layer image whose luminance encodes the depth for each pixel. Don't forget to modify the Input layers combo-box to make this layer active for the filter.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/25/02.") +#@gui Blur [Gaussian]:fx_gaussian_blur,fx_gaussian_blur_preview(0) +#@gui :XY-Amplitude=float(3,0,20) +#@gui :X-Amplitude=float(0,0,20) +#@gui :Y-Amplitude=float(0,0,20) +#@gui :Boundary=choice(1,"Black","Nearest") +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Blur [Glow]:fx_glow,fx_glow_preview(0) +#@gui :Amplitude=float(6,0,20) +#@gui :_=separator() +#@gui :Channel(s)=choice(7,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Blur [Linear]:fx_blur_linear,fx_blur_linear_preview(1) +#@gui :Tangent Radius (%)=float(10,0,25) +#@gui :Orthogonal Radius (%)=float(0.5,0,25) +#@gui :Angle=float(0,0,180) +#@gui :Sharpness=float(0,0,500) +#@gui :Boundary=choice(1,"Black","Nearest") +#@gui :_=separator() +#@gui :Channel(s)=choice(7,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Blur [Multidirectional]:fx_blur_multidirectional,fx_blur_multidirectional_preview(0) +#@gui :Number of Orientations=int(5,1,16) +#@gui :Reference Angle (deg.)=float(0,0,360) +#@gui :Angle Range (deg.)=float(360,0,360) +#@gui :_=separator() +#@gui :Smoothness=float(150,0,1024) +#@gui :Kernel Type=choice(0,"Mono-Directional","Bi-Directional") +#@gui :Boundary Conditions=choice(1,"Dirichlet","Neumann","Periodic","Mirror") +#@gui :Sharpness=float(0,0,1000) +#@gui :Blend Mode=choice{2,"Min","Max","Average","Edges-0.5 (beware: Memory-Consuming!)","Edges-1 (beware: Memory-Consuming!)","Edges-2 (beware: Memory-Consuming!)","Median (beware: Memory-Consuming!)"} +#@gui :Boost Contrast=float(2,0,32) +#@gui :_=separator() +#@gui :Channel(s)=choice(7,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/09/11.") +#@gui Blur [Radial]:fx_blur_radial,fx_blur_radial_preview(1) +#@gui :Amplitude=float(3,0,20) +#@gui :Center (%)=point(50,50,0,1) +#@gui :Sharpness=float(0,0,500) +#@gui :Preview Guides=bool(1) +#@gui :_=separator() +#@gui :Channel(s)=choice(7,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/16/01.") +#@gui Chromatic Aberrations:fx_chromatic_aberrations,fx_chromatic_aberrations_preview(0) +#@gui :Primary Color=color(#ff0000) +#@gui :Deformation Type=choice("Shift","Radial","Angular","Random") +#@gui :X-Amplitude=float(2,-32,32) +#@gui :Y-Amplitude=float(2,-32,32) +#@gui :Smoothness=float(0,0,10) +#@gui :Attenuation Near Center (%)=float(50,-100,100) +#@gui :Attenuation Decay=float(1,0,8) +#@gui :_=separator() +#@gui :Secondary Color=color(#00ff00) +#@gui :Deformation Type=choice("Shift","Radial","Angular","Random") +#@gui :X-Amplitude=float(0,-32,32) +#@gui :Y-Amplitude=float(0,-32,32) +#@gui :Smoothness=float(0,0,10) +#@gui :Attenuation Near Center (%)=float(0,-100,100) +#@gui :Attenuation Decay=float(1,0,8) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/08/10.") +#@gui CRT Sub-Pixels:fx_gcd_crt,fx_gcd_crt(2) +#@gui :_=note("Cathode ray tube sub-pixel rendering filter") +#@gui :_=separator() +#@gui :Horizontal Blur=float(1.8,0,5) +#@gui :Vertical Blur=float(1.8,0,5) +#@gui :Screen Border=bool(0) +#@gui :Equalize=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2014/12/11.") +#@gui Dirty:fx_dirty,fx_dirty_preview(0) +#@gui :Amplitude=float(30,0,100) +#@gui :Monochrome=bool(1) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/24/11.") +#@gui Flip & Rotate Blocks:fx_flip_blocks,fx_flip_blocks_preview(0) +#@gui :X-Size (px)=int(4,1,128) +#@gui :Y-Size (px)=int(4,1,128) +#@gui :Flip=choice(3,"None","X-Axis","Y-Axis","XY-Axes") +#@gui :Rotate=choice(1,"-90 Deg.","0 Deg.","90 Deg.") +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/01/09.") +#@gui Huffman Glitches:fx_huffman_glitches,fx_huffman_glitches_preview(1) +#@gui :Noise Level (%)=float(30,0,100) +#@gui :Split Mode=choice("None","Horizontal Blocs","Vertical Blocs","Patches") +#@gui :Bloc Size (%)=int(25,0,100)_1 +#@gui :Patch Overlap (%)=float(0,0,50)_1 +#@gui :Color Space=choice("RGB","CMYK","HCY","HSI","HSL","HSV","Jzazbz","Lab","Lch","OKLab","YCbCr","YIQ") +#@gui :Quantization=int(0,0,64) +#@gui :_=note{"(Set to 0 to turn quantization off)"} +#@gui :_=separator() +#@gui :Random Seed=int(0,0,65536) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Beware:\n\n- The preview does not perfectly reflect what the resulting image will be. It just gives an idea on the kind of effects the filter produces with the specified parameters.\n\n- The filter is slow to compute on large images.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2023/04/26.") +#@gui JPEG Artefacts:fx_jpeg_artefacts,fx_jpeg_artefacts_preview(0) +#@gui :_=note("This filter simulates the JPEG compression artifacts, using DCT quantization on 8x8 blocks.") +#@gui :Quality (%)=int(50,1,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/05/07.") +#@gui Lomo:fx_lomo,fx_lomo_preview(1) +#@gui :Vignette Size=float(20,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: Jérome Boulanger and David Tschumperlé.       Latest Update: 2012/06/06.") +#@gui Mess with Bits:fx_mess_with_bits,fx_mess_with_bits_preview +#@gui :_=note("Input processing:") +#@gui :Pre-Normalize=bool(1) +#@gui :Smoothness (%)=float(15,0,100) +#@gui :Multiplier=int(1,1,256) +#@gui :_=separator() +#@gui :_=note("Output processing:") +#@gui :Reversing=choice(1,"None","Reverse Bits","Reverse Bytes") +#@gui :Bit Masking (Start)=int(0,0,15) +#@gui :Bit Masking (End)=int(15,0,15) +#@gui :Opacity (%)=float(100,0,100) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/01/16.") +#@gui Noise [Additive]:fx_noise,fx_noise_preview(0) +#@gui :Amplitude=float(10,0,200) +#@gui :Noise Type=choice("Gaussian","Uniform","Salt and Pepper","Poisson") +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice(1,"None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Noise [Gradient]:fx_noise_gradient,fx_noise_gradient_preview(0) +#@gui :Strength=float(100,0,255) +#@gui :Smoothness[%]=float(0,0,100) +#@gui :Noise Type=choice("Gaussian","Uniform") +#@gui :_=separator() +#@gui :Channel(s)=choice(2,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2023/12/06.") +#@gui Noise [Perlin]:fx_noise_perlin,fx_noise_perlin_preview(1) +#@gui :Random Seed=int(0,0,65536) +#@gui :_=separator() +#@gui :_=note("1st scale:") +#@gui :Amplitude=float(100,0,512) +#@gui :Scale (%)=float(8,0,100) +#@gui :X/Y-Ratio=float(0,-4,4) +#@gui :_=separator() +#@gui :_=note("2nd scale:") +#@gui :Amplitude=float(0,0,512) +#@gui :Scale (%)=float(4,0,100) +#@gui :X/Y-Ratio=float(0,-4,4) +#@gui :_=separator() +#@gui :_=note("3rd scale:") +#@gui :Amplitude=float(0,0,512) +#@gui :Scale (%)=float(2,0,100) +#@gui :X/Y-Ratio=float(0,-4,4) +#@gui :_=separator() +#@gui :_=note("4th scale:") +#@gui :Amplitude=float(0,0,512) +#@gui :Scale (%)=float(1,0,100) +#@gui :X/Y-Ratio=float(0,-4,4) +#@gui :_=separator() +#@gui :Channel(s)=choice(2,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/01/24.") +#@gui Noise [Spread]:fx_spread,fx_spread_preview(0) +#@gui :X-Variations=float(4,0,20) +#@gui :Y-Variations=float(4,0,20) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Old-Movie Stripes:fx_stripes_y,fx_stripes_y_preview(1) +#@gui :Frequency=float(10,0,100) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Oldschool 8bits:fx_8bits,fx_8bits_preview(0) +#@gui :Scale=float(25,1,100) +#@gui :Dithering=float(800,0,10000) +#@gui :Levels=int(16,2,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/02/11.") +#@gui Pixel Sort:fx_pixelsort,fx_pixelsort_preview(1)+ +#@gui :_=note("Sorting parameters:") +#@gui :Order=choice(1,"Decreasing","Increasing") +#@gui :Axis=choice("X-Axis","Y-Axis","X-Axis Then Y-Axis","Y-Axis Then X-Axis") +#@gui :Sorting Criterion=choice("Red","Green","Blue","Intensity","Luminance","Lightness","Hue","Saturation","Minimum","Maximum","Random") +#@gui :_=separator() +#@gui :_=note("Masking parameters:") +#@gui :Mask By=choice(1,"Bottom Layer","Criterion","Contours","Random") +#@gui :Lower Mask Threshold (%)=float(0,0,100) +#@gui :Higher Mask Threshold (%)=float(100,0,100) +#@gui :Mask Smoothness (%)=float(0,0,5) +#@gui :Invert Mask=bool(0) +#@gui :Preview Mask=bool(0) +#@gui :_=separator() +#@gui :_=note("Note: This filter implements one version of the algorithm described here : ") +#@gui :_=link("http://satyarth.me/articles/pixel-sorting/") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/10/29.") +#@gui Rain & Snow:fx_rain,fx_rain_preview(0) +#@gui :Angle=float(65,-180,180) +#@gui :Speed=float(10,0,50) +#@gui :Density (%)=float(50,0,100) +#@gui :Radius=float(0.1,0,3) +#@gui :Gamma=float(1,0,2) +#@gui :Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/29/06.") +#@gui Random Shade Stripes:fx_shade_stripes,fx_shade_stripes_preview(1) +#@gui :Frequency=float(30,1,100) +#@gui :Orientation=choice(1,"Horizontal","Vertical") +#@gui :Darkness=float(0.8,0,3) +#@gui :Lightness=float(1.3,0,3) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Rebuild From Similar Blocks:fx_rebuild_from_similar_blocks,fx_rebuild_from_similar_blocks(1) +#@gui :Block Size (%)=float(5,2,50) +#@gui :_=separator() +#@gui :Regularization Factor=float(10,0,20) +#@gui :Luminance Factor=float(0.75,0,3) +#@gui :Norm Type=choice(1,"L1","L2") +#@gui :_=separator() +#@gui :_=note("This filter subdivides the image into blocks, and replace each block by the most similar block found in the other blocks.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/09/17.") +#@gui Scanlines:fx_scanlines,fx_scanlines_preview(0) +#@gui :Amplitude=float(60,0,255) +#@gui :Bandwidth=float(2,1,300) +#@gui :Shape=choice(0,"Block","Triangle","Sine","Sine+","Random") +#@gui :Angle=float(0,0,360) +#@gui :Offset=float(0,0,500) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/19/11.") +#@gui Self Glitching:fx_self_glitching,fx_self_glitching_preview(1) +#@gui :Multiplier=float(0,-5,5) +#@gui :Bias=float(0,-255,255) +#@gui :Negate=bool(0) +#@gui :Operator=choice("Add","Mul","And","Or","Xor","Pow","Reverse Pow","Mod","Reverse Mod") +#@gui :Shift Point=point(50,50,0,1) +#@gui :Boundary=choice(3,"Zero","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/08/19.") +#@gui Simulate CRT:fx_crt,fx_crt_preview(0) +#@gui :CRT Type=choice("CRT-1","CRT-2","CRT-3") +#@gui :Upscale Factor=choice(3,"X1","X2","X3","X4","X5","X6","X7","X8") +#@gui :Rendering Precision=choice{"Low (Faster)","High (Slower)"} +#@gui :Smoothness (%)=float(0,0,10) +#@gui :Neighborhhod Size (px)=int(4,1,16) +#@gui :Stride (%)=float(50,0,100) +#@gui :Adaptive Pattern=bool(1) +#@gui :Transpose Pattern=bool(0) +#@gui :Average Over Pattern=bool(0) +#@gui :Normalize=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :Preview Zoom (%)=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2023/12/26.") +#@gui Sloppy Mess:pr_sloppymess,pr_sloppymess_preview(0) +#@gui :_=note("Slices:") +#@gui :Angle=int(0,0,360) +#@gui :Width (px)=int(1,1,5000) +#@gui :Axis=choice("X-Axis","Y-Axis") +#@gui :Mirror Axis=choice("X-Axis","Y-Axis") +#@gui :Mirror Selection Interval (0:Off, -1:Random)=int(-1,-1,50) +#@gui :Invert Mirror Selection=bool(0,0,1) +#@gui :_=separator() +#@gui :_=note("Rotation:") +#@gui :Range Clockwise=int(35,0,90) +#@gui :Range Counter-Clockwise=int(-35,-90,0) +#@gui :Boundary Conditions=int(2,0,3) +#@gui :Center X(%)=int(0,0,100) +#@gui :Center Y(%)=int(0,0,100) +#@gui :_=separator() +#@gui :Deform=int(3,0,20) +#@gui :_=separator() +#@gui :Iterations=int(1,1,20) +#@gui :Blending=choice(3,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lchlightness","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Seamless","Seamless Mixed","Shapeareamax","Shapeareamax0","Shapeareamin","Shapeareamin0","Shapeaverage","Shapeaverage0","Shapemedian","Shapemedian0","Shapemin","Shapemin0","Shapemax","Shapemax0","Shapeprevalent","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Strength=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("Author: Prawnsushi.      Latest Update: 2023/08/17.") +#@gui Streak:fx_streak,fx_streak(1) +#@gui :Mask Color=color(#ff0000ff) +#@gui :Step (%)=float(0,0,30) +#@gui :Angle=float(0,0,360) +#@gui :Propagation=choice(3,"Backward","Forward","Bidirectional [Sharp]","Bidirectional [Smooth]") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/12/22.") +#@gui Visible Watermark:fx_watermark_visible,fx_watermark_visible(0) +#@gui :Text=text("\\251 G'MIC") +#@gui :Opacity=float(0.4,0,1) +#@gui :Font=choice("Acme","Arial","Arial Black","Black Ops One","BlackChancery","Cabin Sketch","Caprasimo","Carnevalee Freakshow","Cheese Burger","Cheque","Cheque-Black","Chlorinar","Comic Sans MS","Courier New","Creepster","Georgia","Impact","Lobster","Luckiest Guy","Macondo","MedievalSharp","Odin Rounded","Oswald","Palatino Linotype","Playfair Display","Roboto","Sacramento","Satisfy","Sofia","Tex Gyre Adventor","Times New Roman","Titan One","Verdana") +#@gui :Size=int(50,13,512) +#@gui :Bold Face=bool(0) +#@gui :Angle=float(25,0,360) +#@gui :Lightness=choice(1,"Darker","Brighter") +#@gui :Smoothness=float(0.5,0,5) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2023/09/16.") +#@gui Warp by Intensity:fx_warp_by_intensity,fx_warp_by_intensity_preview(0) +#@gui :X-Factor=float(0.04,-6,6) +#@gui :Y-Factor=float(0.04,-6,6) +#@gui :_=separator() +#@gui :X-Offset=float(128,0,255) +#@gui :Y-Offset=float(128,0,255) +#@gui :_=separator() +#@gui :Correlated Channels=bool(0) +#@gui :Interpolation=choice(1,"Nearest Neighbor","Linear") +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/02/09.") +#@gui _Details +#@gui Constrained Sharpen:iain_constrained_sharpen,iain_constrained_sharpen(0) +#@gui :Sharpen Radius=float(.75,0,10) +#@gui :Amount=float(2,0,10) +#@gui :Threshold=float(1,0,50) +#@gui :Constraint Radius=int(5,0,10) +#@gui :Overshoot=float(0,0,50) +#@gui :Channel(s)=choice(11,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :Value Action=choice(1,"None","Cut","Normalize") +#@gui :_=separator() +#@gui :_=note("Sharpens image but restricts pixels values to local minimum and maximum values to significantly reduce halos.") +#@gui :_=note("Sharpen Radius, Amount and Threshold are the normal unsharp controls.) +#@gui :_=note("A high Amount will produce aliasing") +#@gui :_=note("Constraint Radius sets the radius to find the local minimum and maximum.) +#@gui :_=note("Overshoot sets how far the sharpening is allowed to go past the local minimum and maximum values.) +#@gui :_=note("Author : Iain Fergusson. release: 2 August 2016 update: 25 August 2018") +#@gui DCP Dehaze:jeje_dehaze,jeje_dehaze_preview +#@gui :Scale=int(5,1,20) +#@gui :Strength=float(1,0,2) +#@gui :Min=float(.2,0,1) +#@gui :Max=float(1,0,1) +#@gui :Brighness=float(0,-100,100) +#@gui :Contrast=float(0,-100,100) +#@gui :Gamma=float(0,-100,100) +#@gui :Transmittance Map=bool(false) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Dark Channel Prior dehazing.Author : Jérôme Boulanger. Latest update: 2016/08/09.") +#@gui Details Equalizer:fx_equalize_details,fx_equalize_details_preview(0) +#@gui :Base Scale=float(5,0,15) +#@gui :Detail Scale=float(0.5,0,5) +#@gui :_=note("Coarse scale:") +#@gui :Threshold=float(0,0,10) +#@gui :Smoothness=float(0,0,10) +#@gui :Smoothness Type=choice(2,"Gaussian","Bilateral","Diffusion") +#@gui :Gain=float(0,-4,4) +#@gui :_=separator() +#@gui :_=note("Medium scale:") +#@gui :Threshold=float(0,0,10) +#@gui :Smoothness=float(0,0,10) +#@gui :Smoothness Type=choice(2,"Gaussian","Bilateral","Diffusion") +#@gui :Gain=float(0,-4,4) +#@gui :_=separator() +#@gui :_=note("Small scale:") +#@gui :Threshold=float(0,0,10) +#@gui :Smoothness=float(0,0,10) +#@gui :Smoothness Type=choice(2,"Gaussian","Bilateral","Diffusion") +#@gui :Gain=float(0,-4,4) +#@gui :_=separator() +#@gui :_=note("Fine scale:") +#@gui :Threshold=float(0,0,10) +#@gui :Smoothness=float(0,0,10) +#@gui :Smoothness Type=choice(2,"Gaussian","Bilateral","Diffusion") +#@gui :Gain=float(0,-4,4) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(32,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Jérome Boulanger and David Tschumperlé.       Latest Update: 2015/11/11.") +#@gui Dynamic Range Increase:fx_tk_dri,fx_tk_dri_preview(1) +#@gui :Map Tones=float(0,0,1) +#@gui :Recover Shadows=float(0,0,1) +#@gui :Recover Highlights=float(0,0,1) +#@gui :Enhance Details=float(1,0,5) +#@gui :Detail Strength=float(0.5,0,1) +#@gui :Map Tones=bool(1) +#@gui :Enhance Details=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil Latest update: 2011/12/04.") +#@gui Equalize Local Histograms:fx_equalize_local_histograms,fx_equalize_local_histograms_preview(0) +#@gui :Strength (%)=float(75,0,100) +#@gui :Mode=choice(2,"Raw","Hard","Soft") +#@gui :Radius=int(4,1,16) +#@gui :Sigma=float(100,0,256) +#@gui :Regularization=float(8,0,32) +#@gui :Reduce Halos=bool(1) +#@gui :_=separator() +#@gui :Channel(s)=choice(16,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/01/31.") +#@gui Freaky Details:fx_freaky_details,fx_freaky_details_preview(0) +#@gui :Amplitude=int(2,1,5) +#@gui :Scale=float(10,0,100) +#@gui :Iterations=int(1,1,4) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé and Patrick David.       Latest Update: 2013/27/02.") +#@gui :_=separator() +#@gui :_=note("This effect has been done following:") +#@gui :_=link("This tutorial from Patrick David","https://patdavid.net/2013/02/calvin-hollywood-freaky-details-in-gimp.html") +#@gui High Pass:fx_highpass,fx_highpass_preview(0) +#@gui :Radius=float(5,0,100) +#@gui :Contrast=float(2,0,7) +#@gui :Inverse=bool(0) +#@gui :Greyscale=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Tom Keil. Latest update: 2011/05/01.") +#@gui Local Contrast Enhancement:fx_LCE,fx_LCE_preview(0) +#@gui :_=note("Local contrast enhancement is Unsharp Mask with high radius. Apply filter to RGB channels for color and contrast enhancement.") +#@gui :Spatial Radius=float(80,30,200) +#@gui :Amount=float(0.5,0,5) +#@gui :Darkness Level=float(1,0,4) +#@gui :Lightness Level=float(1,0,4) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=note("\n\nNote : Original USM code by by David Tschumperlé. ") +#@gui :_=separator() +#@gui :_=note("Authors : Arto Huotari, PhotoComiX. Latest update : 2013/03/23.") +#@gui Local Normalization:fx_normalize_local,fx_normalize_local_preview(0) +#@gui :Amplitude=float(2,0,60) +#@gui :Radius=int(6,1,64) +#@gui :Neighborhood Smoothness=float(5,0,40) +#@gui :Average Smoothness=float(20,0,40) +#@gui :Constrain Values=bool(1) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Local Processing:fx_local_processing,fx_local_processing_preview(1) +#@gui :Action=choice("Normalize","Equalize") +#@gui :Strength (%)=float(75,0,100) +#@gui :Neighborhood Size (%)=float(10,1,100) +#@gui :Overlap (%)=float(50,0,75) +#@gui :Regularization (%)=float(20,0,100) +#@gui :Process Channels Individually=bool(0) +#@gui :_=separator() +#@gui :Channel(s)=choice(7,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/02/28.") +#@gui Local Variance Normalization:jeje_normalize_local_variance,jeje_normalize_local_variance_preview +#@gui :Amplitude=float(50,0,100) +#@gui :Smoothness=float(5,0,20) +#@gui :Threshold=float(5,0,100) +#@gui :Repeat=int(1,1,4) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/10/30.") +#@gui Magic Details:fx_magic_details,fx_magic_details_preview(0) +#@gui :Amplitude=float(6,0,30) +#@gui :Spatial Scale=float(3,0,10) +#@gui :Value Scale=float(15,0,20) +#@gui :Edges=float(-0.5,-3,3) +#@gui :Smoothness=float(2,0,20) +#@gui :_=separator() +#@gui :Channel(s)=choice(27,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/01/10.") +#@gui Make Up:make_up,make_up_preview(0) +#@gui :Space=float(15,1,40) +#@gui :Value=float(4,0,30) +#@gui :Fast=bool(0) +#@gui :Limit Hue Range=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. - Update: 1 March 2013: Fixed resizing issue, some memory useage improvements, and added more options.") +#@gui Mask Creator:fx_tk_mask,fx_tk_mask_preview(1) +#@gui :_=separator() +#@gui :Mask Type=choice("Luminance","Saturation","Hue","LAB-Lightness") +#@gui :Color Channels=choice("All","Red","Green","Blue","Yellow","Magenta","Cyan","LAB-A","LAB-B") +#@gui :Shadows Threshold=float(0,0,255) +#@gui :Highlights Threshold=float(255,0,255) +#@gui :Tones Smoothness=float(0,0,20) +#@gui :Mask Contrast=float(1,0,10) +#@gui :Negative=bool(0) +#@gui :Apply Mask=bool(0) +#@gui :Transparency=float(1,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil. Latest update: 2011/11/04.") +#@gui Mighty Details:fx_mighty_details,fx_mighty_details_preview(0) +#@gui :Amplitude=float(25,0,100) +#@gui :Details Amount=float(1,0,2) +#@gui :Details Scale=float(25,1,100) +#@gui :Details Smoothness=int(1,0,10) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/08/08.") +#@gui Portrait Retouching:fx_tk_portrait,fx_tk_portrait_preview(0) +#@gui :_=separator() +#@gui :Retouching Style=choice("Standard","Glamour Glow","Masculine","High Key","Low Key") +#@gui :Effect Strength=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("Retouching settings:") +#@gui :Fine Details Smoothness=float(1,0,10) +#@gui :Medium Details Smoothness=float(5,0,25) +#@gui :Areas Smoothness=float(20,0,100) +#@gui :Fine Details Threshold=float(3,0,10) +#@gui :Medium Details Threshold=float(20,0,100) +#@gui :Areas Light Adjustment=float(10,0,100) +#@gui :Smoothing Type=choice("Gaussian","Bilateral","Anisotropic","Median") +#@gui :Output Mode=choice("Retouched Image","Composed Layers","All Layers and Masks") +#@gui :_=separator() +#@gui :_=note("Skin tone mask settings:") +#@gui :Apply Skin Tone Mask=bool(1) +#@gui :Similarity Space=choice(2,"RGB[A]","RGB","YCbCr","Red","Green","Blue","Opacity","Luminance","Blue & Red Chrominances","Hue","Saturation") +#@gui :Tolerance=float(25,0,100) +#@gui :Smoothness=float(2,0,25) +#@gui :Selected Color=color(#fab496ff) +#@gui :Generic Skin Structure=bool(0) +#@gui :_=separator() +#@gui :_=note("Enhancement settings:") +#@gui :Apply Adjustments On=choice(0,"Final Image","Retouched Areas Only","Sharpened Areas Only","Retouched and Sharpened Areas") +#@gui :Sharpening Radius=float(1,0,10) +#@gui :Sharpening Strength=float(1.5,0,5) +#@gui :Edge Threshold=float(10,0,50) +#@gui :Edge Smoothness=float(1,0,10) +#@gui :Color Temperature=float(0,-20,20) +#@gui :Lightness=float(0,-50,50) +#@gui :Contrast=float(1,0.5,1.5) +#@gui :Saturation=float(1,0,4) +#@gui :_=separator() +#@gui :Preview Selection=choice("Retouched Image Final","Retouched Image Basic","Retouch Layer","Sharpening Layer","Skin Tone Mask","Skin Tone Colors","Edge Mask","High Frequency Layer","Medium Frequency Layer","Low Frequency Layer") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil. Latest update: 2012/18/04.") +#@gui Pyramid Processing:iain_pyramid_processing,iain_pyramid_processing(0) +#@gui :1 Levels=int(4,1,6) +#@gui :2 Noise=float(50,1,100) +#@gui :3 Mix=float(.5,0,1) +#@gui :Type=choice(0,"Mix","Add") +#@gui :Channels=choice(0,"Lightness","Luma","RGB") +#@gui :_=note("Author : Iain Fergusson. 20 Aug 2019 - Update") +#@gui :_=note(" 14 June 2017 - First release") +#@gui Sharpen [Alpha]:fx_sharpen_alpha,fx_sharpen_alpha_preview(0) +#@gui :Amplitude (%)=float(100,0,400) +#@gui :Number of Scales=int(5,1,10) +#@gui :Anisotropy (%)=float(50,0,100) +#@gui :Minimize Alpha (%)=float(100,0,100) +#@gui :_=separator() +#@gui :Channel(s)=choice(0,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2023/10/14.") +#@gui Sharpen [Deblur]:fx_deblur,fx_deblur_preview(0) +#@gui :Radius=float(2,0,20) +#@gui :Iterations=int(10,0,100) +#@gui :Time Step=float(20,0,50) +#@gui :Smoothness=float(0.1,0,10) +#@gui :Regularization=choice(1,"Tikhonov","Mean Curvature","Total Variation") +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Sharpen [Gold-Meinel]:fx_unsharp_goldmeinel,fx_unsharp_goldmeinel_preview(0) +#@gui :Sigma=float(1,0.5,10) +#@gui :Iterations=int(5,1,15) +#@gui :Acceleration=float(1,1,3) +#@gui :Blur=choice(1,"Exponential","Gaussian") +#@gui :Cut=bool(true) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Jérôme Boulanger.      Latest Update: 2013/29/03.") +#@gui Sharpen [Hessian]:jeje_hessian_sharpen,jeje_hessian_sharpen_preview(0) +#@gui :Number of Scales=int(3,2,10) +#@gui :Strength=float(1,0,10) +#@gui :Repeat=float(1,1,5) +#@gui :Cut=bool(false) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2019/04/30.") +#@gui Sharpen [Inverse Diffusion]:fx_sharpen_inversediff,fx_sharpen_inversediff_preview(0) +#@gui :Amplitude=float(50,1,300) +#@gui :Iterations=int(2,1,10) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Sharpen [Multiscale]:fx_sharpen_multiscale,fx_sharpen_multiscale_preview(0) +#@gui :Strength (%)=float(15,0,100) +#@gui :Regularity (%)=float(20,0,100) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/01/14.") +#@gui Sharpen [Octave Sharpening]:fx_unsharp_octave,fx_unsharp_octave_preview(0) +#@gui :Scales=int(4,1,10) +#@gui :Maximal Radius=float(5,0,20) +#@gui :Amount=float(3,0,10) +#@gui :Threshold=float(0,0,255) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice(1,"Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Sharpen [Richardson-Lucy]:fx_unsharp_richardsonlucy,fx_unsharp_richardsonlucy_preview +#@gui :Sigma=float(1,0.5,10) +#@gui :Iterations=int(10,1,100) +#@gui :Blur=choice(1,"Exponential","Gaussian") +#@gui :Cut=bool(true) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Jérôme Boulanger.      Latest Update: 2013/29/03.") +#@gui Sharpen [Shock Filters]:fx_sharpen_shock,fx_sharpen_shock_preview(0) +#@gui :Amplitude=float(150,1,400) +#@gui :Edge Threshold=float(0.1,0,0.7) +#@gui :Gradient Smoothness=float(0.8,0,10) +#@gui :Tensor Smoothness=float(1.1,0,10) +#@gui :Iterations=int(1,1,10) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Sharpen [Texture]:fx_sharpen_texture,fx_sharpen_texture_preview(0) +#@gui :Strength=float(1,0,4) +#@gui :Radius=float(4,0,32) +#@gui :_=separator() +#@gui :Channel(s)=choice(16,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/09.") +#@gui Sharpen [Unsharp Mask]:fx_unsharp,fx_unsharp_preview(0) +#@gui :Sharpening Type=choice(1,"Gaussian","Bilateral") +#@gui :Spatial Radius=float(1.25,0,20) +#@gui :Bilateral Radius=float(10,0,60) +#@gui :Amount=float(2,0,10) +#@gui :Threshold=float(0,0,20) +#@gui :Darkness Level=float(1,0,4) +#@gui :Lightness Level=float(1,0,4) +#@gui :Iterations=int(1,1,10) +#@gui :Negative Effect=bool(0) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=note("\n\nNote: This filter is inspired by the original GIMP Unsharp Mask filter, with additional parameters. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Sharpen [Whiten]:jeje_whiten_frequency,jeje_whiten_frequency_preview(0) +#@gui :Alpha=float(50,0,100) +#@gui :Cut=bool(false) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note(Note:This filter equalizes frequencies in the image.) +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/06/01.") +#@gui Split Details [Alpha]:fx_split_details_alpha,fx_split_details_alpha_preview(0) +#@gui :Number of Levels=int(0,0,16) +#@gui :_=note("Set Number of Levels to 0 for automatic setting.") +#@gui :_=separator() +#@gui :Set Scales=choice("Auto","User-Defined") +#@gui :Base Scale=float(10,0,30)_1 +#@gui :Details Scale=float(1,0,20)_1 +#@gui :_=separator() +#@gui :Preview Without Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2023/10/06.") +#@gui Split Details [Gaussian]:fx_split_details_gaussian,fx_split_details_gaussian_preview(0) +#@gui :Number of Scales=int(6,3,12) +#@gui :Base Scale=float(10,0,200) +#@gui :Details Scale=float(1,0,20) +#@gui :_=separator() +#@gui :Sharpen Details in Preview=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/22/01.") +#@gui Split Details [Wavelets]:fx_split_details_wavelets,fx_split_details_wavelets_preview(0) +#@gui :Number of Scales=int(6,2,12) +#@gui :Add Alpha Channels to Detail Scale Layers=_bool(0) +#@gui :_=separator() +#@gui :Sharpen Details in Preview=bool(0) +#@gui :_=separator() +#@gui :_=note{"Note: This filter decomposes an image into several detail scales, using wavelet atrous. It should provide similar results to the Wavelet Decompose Plug-in (by Marco Rossini). "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/23/03.") +#@gui Spotify:jeje_spotify,jeje_spotify_preview +#@gui :Scale=float(1,0.75,10) +#@gui :Iteration=int(1,1,50) +#@gui :Gamma=float(1,0,10) +#@gui :Cut=bool(1) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/12/16.") +#@gui Texture:afre_texture,afre_texture_preview(1)+ +#@gui :_=note("Enhance texture with detail scales.  Filter by afre 2020 Aug10-18.\n\n") +#@gui :_=note("Detail Scale") +#@gui :Coarse=int(0,-100,100) +#@gui :Medium=int(0,-100,100) +#@gui :Fine=int(0,-100,100) +#@gui :_=note("\n\nNote\n\nG'MIC's preview is inaccurate. Apply the filter and review the results in your host editor.") +#@gui Texture Enhance:iain_texture_enhance_p,iain_texture_enhance_p_preview(0) +#@gui :Radius=int(2,2,11) +#@gui :Strength=float(2,0,10) +#@gui :Reduce Halos=float(30,0,255) +#@gui :Reduce Noise=float(0,0,255) +#@gui :Channel(s)=choice(11,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :_=separator() +#@gui :Parallel Processing=choice(0,"Auto","Off") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. Update: 4 March 2014 - Added parallel processing option") +#@gui :_=note("Update: 4 March 2013 - Different halo protection method, added option to reduce noise, faster.") +#@gui Tone Enhance:gcd_tone_enhance,gcd_tone_enhance(1) +#@gui :_=note("Sharpen or adjust shadows and highlights") +#@gui :_=separator() +#@gui :_=note("Shadows") +#@gui :Detail=float(0,0,2) +#@gui :Gamma=float(1,0.2,1.8) +#@gui :_=separator() +#@gui :_=note("Highlights") +#@gui :Detail=float(0,0,2) +#@gui :Gamma=float(1,0.2,1.8) +#@gui :_=separator() +#@gui :_=note("Mid Point") +#@gui :Centre=int(128,0,255) +#@gui :Detail=float(0,0,2) +#@gui :Gamma=float(1,0.2,1.8) +#@gui :_=separator() +#@gui :_=note("Extra Shadow/Highlight recovery") +#@gui :Boost=float(0.5,0,1) +#@gui :Smooth=float(0,0,2) +#@gui :_=separator() +#@gui :_=note("Detail Mask") +#@gui :Smooth=int(0,0,20) +#@gui :_=separator() +#@gui :Channels=choice(4,"HSI","HSV","Lab","Linear RGB","RGB","YCbCr") +#@gui :Values=choice("Cut","Normalize") +#@gui :Color Median=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2017/01/03.") +#@gui Tone Mapping:fx_map_tones,fx_map_tones_preview(0) +#@gui :Threshold=float(0.5,0,1) +#@gui :Gamma=float(0.7,0,1) +#@gui :Smoothness=float(0.1,0,10) +#@gui :Iterations=int(30,0,500) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Tone Mapping [Fast]:fx_map_tones_fast,fx_map_tones_fast_preview(0) +#@gui :Radius=float(3,0,20) +#@gui :Power=float(0.5,0,1) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: Paul Nasca and David Tschumperlé.       Latest Update: 2011/10/06.") +#@gui YAG Effect:fx_yag_soften,fx_yag_soften_preview(0) +#@gui :Darken=float(0,0,100) +#@gui :Soften=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2013/09/28.") +#@gui :_=link("Filter Explained here","http://www.flickr.com/photos/naggobot/6260257923/") +#@gui _Frames +#@gui Droste:fx_droste,fx_droste_preview(1) +#@gui :_=note("Upper-left coordinates :") +#@gui :Point #0=point(20,20,0,1,255,0,0) +#@gui :_=separator() +#@gui :_=note("Upper-right coordinates :") +#@gui :Point #1=point(80,20,0,1,255,0,255) +#@gui :_=separator() +#@gui :_=note("Lower-right coordinates :") +#@gui :Point #2=point(80,80,0,1,0,128,255) +#@gui :_=separator() +#@gui :_=note("Lower-left coordinates :") +#@gui :Point #3=point(20,80,0,1,0,255,255) +#@gui :_=separator() +#@gui :Iterations=int(1,1,10) +#@gui :X-Shift=float(0,-100,100) +#@gui :Y-Shift=float(0,-100,100) +#@gui :Angle=float(0,0,360) +#@gui :Zoom=float(1,0.1,5) +#@gui :Mirror=choice("None","X-Axis","Y-Axis","XY-Axes") +#@gui :Boundary=choice(1,"Transparent","Nearest","Periodic","Mirror") +#@gui :Drawing Mode=choice{"Replace","Replace (Sharpest)","Behind","Below"} +#@gui :View Outlines Only=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/11/06.") +#@gui Frame [Blur]:fx_frame_blur,fx_frame_blur(1) +#@gui :Horizontal Size (%)=float(30,0,100) +#@gui :Vertical Size (%)=float(30,0,100) +#@gui :_=separator() +#@gui :Crop=float(0,0,100) +#@gui :Blur=float(5,0,10) +#@gui :Roundness=float(0,0,1) +#@gui :Apply Color Balance=bool(0) +#@gui :Balance Color=color(#808080) +#@gui :Normalization=choice("None","Stretch","Equalize") +#@gui :_=separator() +#@gui :Outline Size=float(5,0,50) +#@gui :Outline Color=color(#ffffff) +#@gui :X-Shadow=float(2,-10,10) +#@gui :Y-Shadow=float(2,-10,10) +#@gui :Shadow Smoothness=float(1,0,5) +#@gui :Shadow Contrast=float(0,0,100) +#@gui :X-Centering=float(0.5,0,1) +#@gui :Y-Centering=float(0.5,0,1) +#@gui :Angle=float(0,-180,180) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/19/01.") +#@gui Frame [Cube]:frame_cube,frame_cube(1) +#@gui :Depth=float(3,0,30) +#@gui :X-Center=float(0,-2,2) +#@gui :Y-Center=float(0,-2,2) +#@gui :Left Side Orientation=choice("Normal","Mirror-X","Mirror-Y","Mirror-XY") +#@gui :Right Side Orientation=choice("Normal","Mirror-X","Mirror-Y","Mirror-XY") +#@gui :Upper Side Orientation=choice("Normal","Mirror-X","Mirror-Y","Mirror-XY") +#@gui :Lower Side Orientation=choice("Normal","Mirror-X","Mirror-Y","Mirror-XY") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé, Angelo Lama.       Latest Update: 2012/29/01.") +#@gui Frame [Fuzzy]:fx_frame_fuzzy,fx_frame_fuzzy(0) +#@gui :Horizontal Size (%)=float(5,0,100) +#@gui :Vertical Size (%)=float(5,0,100) +#@gui :Fuzzyness=float(10,0,40) +#@gui :Smoothness=float(1,0,5) +#@gui :Color=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Frame [Mirror]:fx_frame_mirror,fx_frame_mirror_preview(1) +#@gui :_=note("Frame size:") +#@gui :Horizontal (%)=float(10,0,100) +#@gui :Vertical (%)=float(10,0,100) +#@gui :_=separator() +#@gui :_=note("Image alignment:") +#@gui :Horizontal (%)=float(50,0,100) +#@gui :Vertical (%)=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Frame dilation/shrinking:") +#@gui :Left=float(0,-5,5) +#@gui :Right=float(0,-5,5) +#@gui :Up=float(0,-5,5) +#@gui :Bottom=float(0,-5,5) +#@gui :_=separator() +#@gui :Preview Opacity (%)=float(0.75,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/08/20.") +#@gui Frame [Painting]:fx_frame_painting,fx_frame_painting_preview(1) +#@gui :Size (%)=float(10,0,100) +#@gui :Contrast=float(0.4,0,1) +#@gui :Smoothness=float(6,0,30) +#@gui :Color=color(#e1c878) +#@gui :_=separator() +#@gui :Vignette Size=float(2,0,50) +#@gui :Vignette Contrast=float(400,0,1000) +#@gui :_=separator() +#@gui :Defects Contrast=float(50,0,512) +#@gui :Defects Density=float(10,0,100) +#@gui :Defects Size=float(1,0,10) +#@gui :Defects Smoothness=float(0.5,0,20) +#@gui :_=separator() +#@gui :Serial Number=int(123456,0,1000000) +#@gui :Frame as a New Layer=_bool(false) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/07/06.") +#@gui Frame [Pattern]:fx_frame_pattern,fx_frame_pattern_preview(1) +#@gui :Tiles=int(10,3,30) +#@gui :Pattern=choice(1,"Top Layer","Self Image") +#@gui :Iterations=int(1,1,10) +#@gui :Constrain Image Size=_bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/01/08.") +#@gui Frame [Regular]:fx_frame,fx_frame(1) +#@gui :_=note("Crop parameters :") +#@gui :X-Start (%)=int(0,0,100) +#@gui :X-End (%)=int(100,0,100) +#@gui :Y-Start (%)=int(0,0,100) +#@gui :Y-End (%)=int(100,0,100) +#@gui :_=separator() +#@gui :_=note("Frame parameters :") +#@gui :Width (%)=int(10,0,100) +#@gui :Height (%)=int(10,0,100) +#@gui :Color=color(#000000ff) +#@gui :Outline Size=int(1,0,100) +#@gui :Outline Color=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Frame [Relief]:cl_reliefFrame,cl_reliefFrame(1) +#@gui :_=note("Frame Limit:") +#@gui :Type=choice(2,"Outset","Inset","Groove","Ridge") +#@gui :Size=float(10,6,40) +#@gui :Relief Width=float(1.5,0,10) +#@gui :Relief Amount=float(75,0,127) +#@gui :_=separator() +#@gui :_=note("Frame Area:") +#@gui :Kaleidoscope Effect=bool(1) +#@gui :Frame Blur=float(60,5,80) +#@gui :Frame Hue Change=float(0,-180,180) +#@gui :Frame Saturation Change=float(0,-1,1) +#@gui :Frame Luminosity Change=float(0,-0.5,0.5) +#@gui :_=separator() +#@gui :_=note("Uniform Frame Color:") +#@gui :_=note("This overrides "Frame Area" section.") +#@gui :Set Uniform Frame Color=bool(0) +#@gui :Frame Color=color(#c0c0c0) +#@gui :_=separator() +#@gui :_=note("Graininess:") +#@gui :Graininess Type=choice("Gaussian","Uniform","Poisson") +#@gui :Graininess Amount=float(0,0,80) +#@gui :Graininess On=choice("Frame","Picture","Both") +#@gui :_=separator() +#@gui :_=link("Filter discussed here","http://gimpchat.com/viewtopic.php?f=28&t=20005#p274661") +#@gui :_=note("Author: Claude Lion. Latest Update: 2022/08/26.") +#@gui :_=note("It uses filters of David Tschumperlé and an algorithm of Reptorian.") +#@gui Frame [Round]:fx_frame_round,fx_frame_round(1) +#@gui :X-Size (%)=float(10,0,100) +#@gui :Y-Size (%)=float(10,0,100) +#@gui :Radius (%)=float(20,0,100) +#@gui :Smoothness=float(0.1,0,15) +#@gui :Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Frame [Smooth]:fx_frame_smooth,fx_frame_smooth(1) +#@gui :Width (%)=int(10,0,100) +#@gui :Height (%)=int(10,0,100) +#@gui :Roundness=float(0.25,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/25/04.") +#@gui Old Photograph:fx_old_photo,fx_old_photo(1) +#@gui :Vignette Strength=float(200,0,255) +#@gui :Vignette Min Radius=float(50,0,100) +#@gui :Vignette Max Radius=float(85,0,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Polaroid:fx_polaroid,fx_polaroid(1) +#@gui :Frame Size=int(10,0,400) +#@gui :Bottom Size=int(20,0,400) +#@gui :X-Shadow=float(0,-20,20) +#@gui :Y-Shadow=float(0,-20,20) +#@gui :Smoothness=float(3,0,5) +#@gui :X-Curvature=float(0,0,1) +#@gui :Y-Curvature=float(0,0,1) +#@gui :Angle=float(20,-180,180) +#@gui :Vignette Strength=float(50,0,255) +#@gui :Vignette Min Radius=float(70,0,100) +#@gui :Vignette Max Radius=float(95,0,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/06.") +#@gui Tunnel:fx_tunnel,fx_tunnel(1) +#@gui :Depth=int(4,1,100) +#@gui :Factor=float(80,1,99) +#@gui :Center (%)=point(50,50) +#@gui :Opacity=float(0.2,0,1) +#@gui :Angle=float(0,-90,90) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/22/11.") +#@gui Vignette:fx_vignette,fx_vignette +#@gui :Strength=float(70,0,255) +#@gui :Min Radius=float(70,0,100) +#@gui :Max Radius=float(95,0,100) +#@gui :Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/24/10.") +#@gui _Frequencies +#@gui Bandpass:fx_bandpass,fx_bandpass_preview(0) +#@gui :Low Frequency=float(0,0,100) +#@gui :High Frequency=float(100,0,100) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice(2,"None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Fourier Analysis:fx_display_fft,fx_display_fft(1)* +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Fourier Transform:fx_fourier_transform,fx_fourier_transform_preview(1)* : * +#@gui :Discard Transparency=bool(1) +#@gui :_=separator() +#@gui :_=note("Note: Apply this filter once to get the direct FFT, and once again to get the reverse transform.") +#@gui :_=link("Click here for a video tutorial","http://www.youtube.com/watch?v=3137dDa6P4s") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2022/04/26.") +#@gui Fourier Transform [Old]:fx_fourier_old,fx_fourier_old_preview(1)* : * +#@gui :Magnitude / Phase=choice{0,"One Layer (Horizontal)","One Layer (Vertical)","Two Layers"} +#@gui :Discard Transparency=bool(1) +#@gui :_=separator() +#@gui :_=note("Note: Apply this filter once to get the direct FFT, and once again to get the reverse transform.") +#@gui :_=link("Click here for a video tutorial","http://www.youtube.com/watch?v=3137dDa6P4s") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/06/16.") +#@gui Fourier Watermark:fx_watermark_fourier,_none_ +#@gui :Text=text{"(c) G'MIC"} +#@gui :Size=int(53,13,128) +#@gui :_=separator() +#@gui :_=note("Note: To make the watermark visible afterwards, use the 'Fourier Analysis' filter. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui _Layers +#@gui Align Layers:fx_align_layers,fx_align_layers_preview : * +#@gui :Alignment Type=choice(0,"Rigid","Non-Rigid") +#@gui :Smoothness=float(0.7,0,1) +#@gui :Scales=choice(0,"Auto","1","2","3","4","5","6","7","8") +#@gui :Revert Layers=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/01/11.") +#@gui Blend [Average All]:fx_blend_average_all,fx_blend_average_all : * +#@gui :Colorspace=choice(0,"SRGB","Linear RGB","Lab") +#@gui :_=separator() +#@gui :_=note("Note: This filter takes multiple layers as input and average them. Set the Input layers option to handle multiple input layers. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/11/08.") +#@gui Blend [Edges]:fx_blend_edges,fx_blend_edges(0) : * +#@gui :Opacity=float(1,0,1) +#@gui :Smoothness=float(0.8,0,5) +#@gui :Revert Layers=bool(0) +#@gui :_=separator() +#@gui :_=note("Note: This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/21/01.") +#@gui Blend [Fade]:fx_blend_fade,fx_blend_fade(1) : + +#@gui :Preset=choice(1,"Custom","Linear","Circular","Wave","Keftales") +#@gui :Offset=float(0,-1,1) +#@gui :Thinness=float(0,0,10) +#@gui :Sharpness=float(5,1,20) +#@gui :Sharpest=bool(0) +#@gui :Revert Layers=bool(0) +#@gui :Colorspace=choice("SRGB","Linear RGB","Lab") +#@gui :_=note(\n The parameters below are used in most presets. ) +#@gui :1st Parameter=float(0,-1,1) +#@gui :2nd Parameter=float(0,-1,1) +#@gui :3rd Parameter=float(0,-1,1) +#@gui :_=note(\n The formula below is used for the Custom preset. ) +#@gui :Formula=text{"cos(4*pi*x/w) * sin(4*pi*y/h)"} +#@gui :_=note("Note: This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/21/01.") +#@gui Blend [Median]:fx_blend_median,fx_blend_median(0) : * +#@gui :Colorspace=choice(0,"SRGB","Linear RGB","Lab") +#@gui :_=separator() +#@gui :_=note("Note: This filter needs at least two layers to work properly. Set the Input layers option to handle multiple input layers. ") +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé and Iain Fergusson.       Latest Update: 2014/16/12.") +#@gui Blend [Seamless]:fx_blend_seamless,fx_blend_seamless_preview(1) : * +#@gui :Mixed Mode=bool(0) +#@gui :Inner Fading=float(0,0,100) +#@gui :Outer Fading=float(25,0,100) +#@gui :Colorspace=choice(0,"SRGB","Linear RGB","Lab") +#@gui :_=separator() +#@gui :Output as Separate Layers=_bool(0) +#@gui :_=separator() +#@gui :_=note("Note: This filter needs at least two layers to work properly. Set the Input layers option to handle multiple input layers. ") +#@gui :_=separator() +#@gui :_=link("Click here for a detailed description of this filter.","http://gimpchat.com/viewtopic.php?f=28&t=10204") +#@gui :_=link("+ Video tutorial 1","http://www.youtube.com/watch?v=Nu-S1HmOCgE") +#@gui :_=link("+ Video tutorial 2","http://www.youtube.com/watch?v=zsHgQY6025I") +#@gui :_=link("+ Video tutorial 3","http://www.youtube.com/watch?v=2e6FikWMkaQ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/04/05.") +#@gui Blend [Standard]:fx_blend,fx_blend_preview : * +#@gui :Mode=choice(6,"Add","Alpha","And","Average","Blue","Burn","Custom Formula","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Area Max","Shape Area Max0","Shape Area Min","Shape Area Min0","Shape Average","Shape Average0","Shape Median","Shape Median0","Shape Min","Shape Min0","Shape Max","Shape Max0","Shape Prevalent","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Process As=choice("Two-By-Two","Upper Layer Is the Top Layer for All Blends","Lower Layer Is the Bottom Layer for All Blends") +#@gui :Opacity (%)=float(100,0,100) +#@gui :Preview All Outputs=bool(1) +#@gui :_=separator() +#@gui :Custom Formula=text{"1/2 - 1/4*cos(pi*a) - 1/4*cos(pi*b)"} +#@gui :_=note("Note: In custom formulas, a and b respectively stand for the values of the base layer and the blend layer, and are defined in value range [0,1].") +#@gui :_=separator() +#@gui :_=note("Note: This filter needs at least two layers to work properly. Do not forget to set the Input layers option below to handle multiple input layers. ") +#@gui :_=link("Reference page for G'MIC blending modes","https://github.com/GreycLab/gmic-community/wiki/Blending-modes") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/03/08.") +#@gui Colors to Layers:fx_split_colors,fx_split_colors_preview(1) +#@gui :Color Tolerance=float(50,0,256) +#@gui :Maximum Number of Output Layers=int(16,2,256) +#@gui :Minimal Area (%)=float(1,0,100) +#@gui :Autocrop Output Layers=bool() +#@gui :_=separator() +#@gui :_=note{"Note: This filter decomposes an image into several layers each with a single color + a residual layer (if any). "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/11/03.") +#@gui Fade Layers:fx_fade_layers,fx_fade_layers_preview : + +#@gui :Inter-Frames=_int(10,2,100) +#@gui :_=separator() +#@gui :_=note("Note: This filter needs at least two layers to work properly. Set the Input layers option to handle multiple input layers. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/04/08.") +#@gui Layers to Tiles:append_tiles,fx_append_tiles_preview(1) : * +#@gui :X-Tiles=int(0,0,256) +#@gui :Y-Tiles=int(0,0,256) +#@gui :_=note("For both parameters, 0 means automatic.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Morph Layers:fx_morph_layers,gui_no_preview : * +#@gui :Inter-Frames=_int(10,2,100) +#@gui :Smoothness=_float(0.2,0,2) +#@gui :Precision=_float(0.1,0,2) +#@gui :Revert Layers=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Multiscale Operator:fx_apply_multiscale,fx_apply_multiscale_preview(1) +#@gui :Number of Scales=int(4,2,16) +#@gui :_=separator() +#@gui :Starting Scale (%)=float(25,0,400) +#@gui :Ending Scale (%)=float(100,0,400) +#@gui :Non-Linearity=float(0,-1,1) +#@gui :Rescaling=choice(3,"Block","Linear","Cubic","Lanczsos") +#@gui :_=separator() +#@gui :X-Centering=float(0.5,0,1) +#@gui :Y-Centering=float(0.5,0,1) +#@gui :Angle=float(0,-180,180) +#@gui :_=separator() +#@gui :Enable Interpolated Motion=bool(0) +#@gui :Ending X-Centering=float(0.5,0,1) +#@gui :Ending Y-Centering=float(0.5,0,1) +#@gui :Ending Angle=float(0,-180,180) +#@gui :_=separator() +#@gui :G'MIC Operator=text("") +#@gui :Return Scaling=choice("None","Block","Linear","Cubic","Lanczos") +#@gui :Lock Return Scaling to Source Layer=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/30/03.") +#@gui Pack:fx_pack,fx_pack_preview(1) : * +#@gui :Order By=choice(2,"Width","Height","Maximum Dimension","Area","Name") +#@gui :Tends to Be Square=bool(1) +#@gui :Force Transparency=bool(1) +#@gui :Add Image Label=bool(0) +#@gui :Font Height (px)=float(16,0,64)_0 +#@gui :Font Colors=choice(1,"White on Black","Black on White")_0 +#@gui :_=separator() +#@gui :Output Coordinates File=_bool(0) +#@gui :Output Folder=_folder() +#@gui :_=separator() +#@gui :_=note{"This filter tries to pack all input layers into a single image, while trying to minimize the empty areas. This problem being NP-hard, the algorithm finds (of course) a non-optimal, but often acceptable solution to this packing problem."} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/03/20.") +#@gui Stroke:fx_stroke,fx_stroke_preview(0) +#@gui :Thickness (px)=int(3,1,256) +#@gui :Threshold (%)=float(50,0,100) +#@gui :Smoothness (px)=float(0,0,10) +#@gui :Shape=choice(2,"Square","Diamond","Round") +#@gui :Direction=choice(1,"Inward","Outward") +#@gui :_=separator() +#@gui :Zoom (%)=float(100,1,300) +#@gui :X-Shift (px)=int(0,-256,256) +#@gui :Y-Shift (px)=int(0,-256,256) +#@gui :_=separator() +#@gui :Starting Color=color(#ffffffff) +#@gui :Ending Color=color(#ffffffff) +#@gui :Inside Color=color(#00000000) +#@gui :Outside Color=color(#00000000) +#@gui :_=separator() +#@gui :Output Stroke Layer On=choice(1,"Bottom","Top") +#@gui :Keep Original Image Size=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/24/06.") +#@gui Tiles to Layers:fx_tiles2layers,fx_tiles2layers_preview(1) +#@gui :X-Tiles=int(3,1,100) +#@gui :Y-Tiles=int(3,1,100) +#@gui :Force Tiles to Have Same Size=_bool(false) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Tones to Layers:fx_tones2layers,fx_tones2layers_preview(0) +#@gui :Number of Tones=int(3,2,10) +#@gui :Start of Mid-Tones=int(85,0,255) +#@gui :End of Mid-Tones=int(170,0,255) +#@gui :Smoothness=float(0.5,0,5) +#@gui :Alpha=choice("Binary","Scalar") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/05/04.") +#@gui _Lights & Shadows +#@gui Burn:fx_burn,fx_burn_preview(1) +#@gui :Amplitude=float(0.5,0,1) +#@gui :Scale=float(30,1,100) +#@gui :Smoothness=float(1,0,4) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/24/11.") +#@gui Contrast Swiss Mask:fx_contrast_swm,fx_contrast_swm(0) +#@gui :_=separator() +#@gui :Blur the Mask=float(2,0.5,10) +#@gui :_=separator() +#@gui :_=note("Contrast Mask need the negative of the mask") +#@gui :Skip to Use the Mask to Boost=bool(false) +#@gui :_=note("Uncheck for Contrast Mask,Check for Contrast Boost") +#@gui :_=separator() +#@gui :_=note("Merge the Mask") +#@gui :Intensity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX.      Latest Update: 2011/01/01.") +#@gui :_=link("Filter explained here","http://www.gimpchat.com/viewtopic.php?f=9&t=864") +#@gui Dodge and Burn:fx_dodgeburn,fx_dodgeburn_preview(1) +#@gui :_=note("automatic dodging and burning") +#@gui :_=separator() +#@gui :Highlights Selection=float(15,0,100) +#@gui :Highlights Abstraction=float(1.5,0,10) +#@gui :Dodge Strength=float(25,0,256) +#@gui :Dodge Blur=float(10,0,20) +#@gui :Shadows Selection=float(40,0,100) +#@gui :Shadows Abstraction=float(1.5,0,10) +#@gui :Burn Strength=float(25,0,256) +#@gui :Burn Blur=float(10,0,20) +#@gui :_=separator() +#@gui :_=note("Advanved: output dodge and burn layer separate") +#@gui :Keep Layers Separate=bool(0) +#@gui :Keep Original Layer=bool(0) +#@gui :Blur Dodge and Burn Layer=float(10,0,20) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil. Latest update: 2011/15/02.") +#@gui Drop Shadow:fx_drop_shadow,fx_drop_shadow_preview(1) +#@gui :X-Offset=float(3,-20,20) +#@gui :Y-Offset=float(3,-20,20) +#@gui :Smoothness=float(1.8,0,5) +#@gui :X-Curvature=float(0,-2,2) +#@gui :Y-Curvature=float(0,-2,2) +#@gui :Color=color(#000000) +#@gui :Expand Size=bool(1) +#@gui :Output as Separate Layers=_bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2023/09/02.") +#@gui Drop Shadow 3D:fx_drop_shadow3d,fx_drop_shadow3d_preview(1) +#@gui :X-Angle=float(0,-90,90) +#@gui :Y-Angle=float(0,-90,90) +#@gui :Z-Angle=float(0,-90,90) +#@gui :Zoom=float(0,-100,100) +#@gui :X-Offset=float(1,-50,50) +#@gui :Y-Offset=float(1,-50,50) +#@gui :Perspective=float(2,0,10) +#@gui :Smoothness=float(0.5,0,5) +#@gui :Color=color(#000000c8) +#@gui :Preview Only Shadow=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/02/07.") +#@gui Equalize Light:fx_equalize_light,fx_equalize_light_preview(1) +#@gui :Amount (%)=float(75,0,100) +#@gui :Mode=choice("Preserve Range","Preserve Covariance") +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/03/23.") +#@gui Equalize Shadow:fx_equalize_shadow,fx_equalize_shadow_preview(1) +#@gui :Amplitude=float(1,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: Francois Grassard and David Tschumperlé.       Latest Update: 2021/03/23.") +#@gui Guided Light Rays:fx_guided_lightrays,fx_guided_lightrays_preview(1) : + +#@gui :Amplitude (%)=float(10,0,100) +#@gui :Ray Length=float(2,0,2) +#@gui :Mode=choice("Boundary","Dense") +#@gui :Density (%)=float(80,0,100) +#@gui :Smoothness (%)=float(0.1,0,5) +#@gui :Threshold (%)=float(50,0,100) +#@gui :Light Position=point(50,50,0,1,255,255,0,-128,1%) +#@gui :Light Color=color(#ffffff) +#@gui :Blend Mode=choice(7,"Add","Alpha","Grain Merge","Hard Light","Lighten","Lightness","Luminance","Overlay","Soft Light","Value") +#@gui :Opacity (%)=float(100,0,100) +#@gui :_=separator() +#@gui :Preview Light Shape=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/04/06.") +#@gui Illuminate 2D Shape:fx_illuminate_shape2d,fx_illuminate_shape2d_preview(1)+ +#@gui :_=note("Input / Output:) +#@gui :Input Type=choice("Single Opaque Shapes Over Transp. BG","Multiple Colored Shapes Over Transp. BG","Bump Map","Normal Map") +#@gui :Output Type=choice("Illumination","Bump Map","Normal Map") +#@gui :Input Guide Color=color(#ff0000ff) +#@gui :Keep Base Layer as Input Background=bool(1) +#@gui :Keep Transparency in Output=bool(1) +#@gui :_=separator() +#@gui :_=note("Shape:) +#@gui :Minimal Shape Area=int(4,1,100) +#@gui :_=note("Parameter Minimal shape area is only active in Multiple colored shapes input mode.") +#@gui :Preview Detected Shapes=bool(0) +#@gui :Erosion / Dilation=float(0,-10,10) +#@gui :Smoothness=float(3,0,6) +#@gui :Bump Factor=float(1,-5,5) +#@gui :Std / Max Weight=float(0.5,0,1) +#@gui :Resolution=choice{4,"Full (Slower)","2048","1024","512","256","128","64 (Faster)"} +#@gui :_=separator() +#@gui :_=note("Illumination:) +#@gui :Blending Mode=choice(10,"Normal","Lighten","Screen","Dodge","Add","Darken","Multiply","Burn","Overlay","Soft Light","Hard Light","Grain Merge") +#@gui :Opacity (%)=float(75,0,100) +#@gui :Ambient (%)=float(30,-100,100) +#@gui :Diffuse (%)=float(40,0,200) +#@gui :Specular (%)=float(40,0,300) +#@gui :Shininess=float(80,0,100) +#@gui :Smoothness=float(0.2,0,5) +#@gui :Flatness=float(1,0,3) +#@gui :Linearity=float(0,-100,100) +#@gui :Levels=int(0,0,16) +#@gui :Light-X=float(2,-20,20) +#@gui :Light-Y=float(-2,-20,20) +#@gui :Light-Z=float(2,0,20) +#@gui :Normalize Illumination=bool(0) +#@gui :_=separator() +#@gui :Open Interactive Preview=button() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Note: This filter automatically adds illumination to an opaque shape defined over a transparent background.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/05/18.") +#@gui Light Glow:fx_lightglow,fx_lightglow_preview(0) +#@gui :Density=float(30,0,100) +#@gui :Amplitude=float(0.5,0,2) +#@gui :Mode=choice(8,"Burn","Dodge","Freeze","Grain Merge","Hard Light","Interpolation","Lighten","Multiply","Overlay","Reflect","Soft Light","Stamp","Value") +#@gui :Opacity=float(0.8,0,1) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/21/02.") +#@gui Light Leaks:fx_light_leaks,fx_light_leaks_preview(1) +#@gui :Leak Type=int(0,0,70) +#@gui :Angle=float(0,-180,180) +#@gui :X-Scale=float(1,1,10) +#@gui :Y-Scale=float(1,1,10) +#@gui :Hue=float(0,-180,180) +#@gui :Opacity=float(0.85,0,1) +#@gui :Blend Mode=choice(2,"Normal","Lighten","Screen","Dodge","Add","Darken","Multiply","Burn","Overlay","Soft Light","Hard Light","Difference","Subtract","Grain Extract","Grain Merge","Divide","Hue","Saturation","Value") +#@gui :Output as Separate Layers=_bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("This filter uses the free light leaks dataset available at :") +#@gui :_=link("Lomo Light Leaks","http://www.photoshoptutorials.ws/downloads/mockups-graphics/lomo-light-leaks/") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/01/07.") +#@gui Light Patch:fx_light_patch,fx_light_patch(0) +#@gui :Density=int(5,2,30) +#@gui :Darkness=float(0.7,0,1) +#@gui :Lightness=float(2.5,1,4) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Light Rays:fx_lightrays,fx_lightrays(1) +#@gui :Density=float(30,0,100) +#@gui :Center (%)=point(50,50,0,1) +#@gui :Length=float(1,0,1) +#@gui :Attenuation=float(0.5,0,1) +#@gui :Transparency=bool(0) +#@gui :Color=color(#ffffff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2023/09/01.") +#@gui Pop Shadows:fx_pop_shadows,fx_pop_shadows_preview(1) +#@gui :Strength=float(0.75,0,1) +#@gui :Scale=float(5,0,20) +#@gui :Post-Normalize=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: Morgan Hardwood and David Tschumperlé.       Latest Update: 2017/03/05.") +#@gui Relief Light:fx_light_relief,fx_light_relief(1) +#@gui :Ambient Lightness=float(0.3,0,5) +#@gui :Specular Lightness=float(0.2,0,2) +#@gui :Specular Size=float(0.2,0,1) +#@gui :Darkness=float(0,0,1) +#@gui :Light Smoothness=float(1,0,5) +#@gui :XY-Light=point(50,50,0,1,255,255,128,200,10) +#@gui :Z-Light=float(5,0,20) +#@gui :Z-Scale=float(0.5,0,3) +#@gui :Opacity as Heightmap=bool(0) +#@gui :Image Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Shadow Patch:fx_shadow_patch,fx_shadow_patch(1) +#@gui :Opacity=float(0.7,0,1) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Slice Luminosity:fx_slice_luminosity,fx_slice_luminosity_preview +#@gui :Luminosity Type=choice(1,"Average RGB","Luminance","Lightness","Value") +#@gui :Output As=_choice(1,"Mask","Masked Image") +#@gui :Preview Type=choice(2,"Mask","Mask + Background","Image","Image + Background") +#@gui :_=separator() +#@gui :_=note{"Slice 1 (shadows):"} +#@gui :Activate Slice 1=bool(1) +#@gui :Starting Value=int(0,0,255) +#@gui :Ending Value=int(64,0,255) +#@gui :Starting Feathering=int(0,0,255) +#@gui :Ending Feathering=int(0,0,255) +#@gui :_=separator() +#@gui :_=note{"Slice 2 (low midtones):"} +#@gui :Activate Slice 2=bool(1) +#@gui :Starting Value=int(64,0,255) +#@gui :Ending Value=int(128,0,255) +#@gui :Starting Feathering=int(0,0,255) +#@gui :Ending Feathering=int(0,0,255) +#@gui :_=separator() +#@gui :_=note{"Slice 3 (high midtones):"} +#@gui :Activate Slice 3=bool() +#@gui :Starting Value=int(128,0,255) +#@gui :Ending Value=int(192,0,255) +#@gui :Starting Feathering=int(0,0,255) +#@gui :Ending Feathering=int(0,0,255) +#@gui :_=separator() +#@gui :_=note{"Slice 4 (highlights):"} +#@gui :Activate Slice 4=bool() +#@gui :Starting Value=int(192,0,255) +#@gui :Ending Value=int(255,0,255) +#@gui :Starting Feathering=float(0,0,255) +#@gui :Ending Feathering=float(0,0,255) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/22/09.") +#@gui _Patterns +#@gui Bayer Filter:rgb2bayer,rgb2bayer(0) +#@gui :Starting Pattern=choice(0,"Red-Green","Blue-Green","Green-Red","Green-Blue") +#@gui :Keep Colors=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Box Fitting:fx_boxfitting,fx_boxfitting(0) +#@gui :Minimal Size=int(3,1,32) +#@gui :Maximal Size=int(0,0,32) +#@gui :_=note("Note: Set Maximal size to 0 to allow any size for the squares.") +#@gui :Initial Density=float(0.25,0,1) +#@gui :Minimal Spacing=int(2,1,16) +#@gui :Transparency=bool(0) +#@gui :_=separator() +#@gui :_=note("Note: This filter has been highly inspired by the work of Jared Tarbell, described on the page:") +#@gui :_=link("http://www.complexification.net/gallery/machines/boxFittingImg/") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/06/06.") +#@gui Camouflage:fx_camouflage,fx_camouflage +#@gui :Scale=int(9,2,12) +#@gui :Levels=int(12,2,32) +#@gui :Coherence=float(100,0,1000) +#@gui :Color 1=color(#1e2e21) +#@gui :Color 2=color(#4b5a41) +#@gui :Color 3=color(#b3bd75) +#@gui :Color 4=color(#fff69e) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/26/10.") +#@gui Canvas:fx_canvas,fx_canvas_preview(0) +#@gui :_=note("First direction :") +#@gui :Amplitude=float(70,0,300) +#@gui :Angle=float(45,0,180) +#@gui :Sharpness=float(400,0,2000) +#@gui :_=note("\nSecond direction : ") +#@gui :Activate Second Direction=bool(true) +#@gui :Amplitude=float(70,0,300) +#@gui :Angle=float(135,0,180) +#@gui :Sharpness=float(400,0,2000) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Canvas Texture:texturize_canvas,texturize_canvas(0) +#@gui :Amplitude=float(20,0,256) +#@gui :Fibrousness=float(3,0,20) +#@gui :Emboss=float(0.6,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Clouds:jeje_clouds,jeje_clouds_preview +#@gui :Density=float(50,0,100) +#@gui :Smoothness=float(.5,0,1) +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/05/29.") +#@gui Cracks:fx_cracks,fx_cracks_preview(0) +#@gui :Density (%)=float(30,0,100) +#@gui :Relief=bool(true) +#@gui :Color=color(#ffffff80) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/07.") +#@gui Crystal:fx_crystal,fx_crystal_preview(0) +#@gui :Density=float(50,0,100) +#@gui :Smoothness=float(0.2,0,2) +#@gui :Edges=float(20,0,100) +#@gui :Fast Fill=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/19/01.") +#@gui Crystal Background:fx_crystal_background,fx_crystal_background +#@gui :Iterations=int(10,1,32) +#@gui :Density (%)=float(25,0,100) +#@gui :Random Seed=int(0,0,65535) +#@gui :Opacity (%)=float(100,0,100) +#@gui :Color=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/18/10.") +#@gui Fibers:jeje_fibers,jeje_fibers_preview +#@gui :Number=int(10,1,100) +#@gui :Length=int(50,1,100) +#@gui :Smoothness=float(10,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2015/07/17.") +#@gui Freqy Pattern:jeje_freqy_pattern,jeje_freqy_pattern_preview +#@gui :Random=float(50,0,100) +#@gui :Scale 1=float(33,1,100) +#@gui :Scale 2=float(50,1,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2018/09/25.") +#@gui Halftone:fx_halftone,fx_halftone_preview(0) +#@gui :_=note("Image parameters :") +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Halftone parameters :") +#@gui :Number of Tones=int(5,2,32) +#@gui :Size for Dark Tones=int(8,2,256) +#@gui :Size for Bright Tones=int(8,2,256) +#@gui :Shape=choice{5,"Square","Diamond","Circle","Square (Inv.)","Diamond (Inv.)","Circle (Inv.)"} +#@gui :Smoothness=float(0.1,0,32) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/23/07.") +#@gui Halftone [Generic]:fx_generic_halftone,fx_generic_halftone_preview(1)* +#@gui :_=note("Global Settings:") +#@gui :Background=choice("Black","White") +#@gui :Base Shape=choice(1,"Square","Disc") +#@gui :Max Radius (%)=float(100,0,300) +#@gui :Smoothness (%)=float(10,0,100) +#@gui :Antialiasing=choice(1,"None","X1.25","X1.5","X2","X2.5") +#@gui :Black & White=bool() +#@gui :_=separator() +#@gui :_=note("Halftoning Shape:") +#@gui :Shape=choice{4,"Custom (Top Layer)","Dots","Lines","Self","Spiral"} +#@gui :Layout=choice("Regular","Semi-Regular","Random")_0 +#@gui :Density (%)=float(75,0,100) +#@gui :Smoothness (%)=float(1,0,100)_0 +#@gui :Angle=float(0,0,360)_0 +#@gui :_=separator() +#@gui :_=note{"Note: When adding a top layer that defines a custom halftoning shape, it is recommended to use 1px wide strokes, for a better (and faster) result. "} +#@gui :_=value("-1") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.       Latest Update: 2022/11/07.") +#@gui Hearts:fx_hearts,fx_hearts_preview(0) +#@gui :Density=float(2,0,30) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Lava:fx_lava,fx_lava_preview(0) +#@gui :Perturbation=int(8,0,15) +#@gui :Smoothness=float(5,0,100) +#@gui :Scale=float(3,0,20) +#@gui :Sharpness=float(0,0,1000) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/26/11.") +#@gui Marble:fx_marble,fx_marble +#@gui :Image Weight=float(.5,0,30) +#@gui :Pattern Weight=float(1,0,30) +#@gui :Pattern Angle=float(0,0,360) +#@gui :Amplitude=float(0,0,1000) +#@gui :Sharpness=float(.4,0,5) +#@gui :Anisotropy=float(.6,0,1) +#@gui :Alpha=float(.6,0,20) +#@gui :Sigma=float(1.1,0,20) +#@gui :Cut Low=float(0,0,100) +#@gui :Cut High=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("Author: Preben Soeberg.      Latest Update: 2010/29/12.") +#@gui Maze:fx_maze,fx_maze +#@gui :Cell Size=int(24,1,256) +#@gui :Thickness=int(1,1,10) +#@gui :Masking=choice("None","Render on Dark Areas","Render on White Areas") +#@gui :Preserve Image Dimension=bool(1) +#@gui :Maze Type=choice("Dark Walls","White Walls") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/02/09.") +#@gui Mineral Mosaic:fx_mineral_mosaic,fx_mineral_mosaic(0) +#@gui :Density=float(1,0,3) +#@gui :Area=float(2,0,32) +#@gui :Smoothness=float(1,0,10) +#@gui :Shade Strength=float(100,0,255) +#@gui :Shade Angle=float(0,0,360) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/01/02.") +#@gui Mosaic:fx_mosaic,fx_mosaic_preview(0) +#@gui :Density (%)=float(50,0,100) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/19/07.") +#@gui Op Art:fx_shapes,fx_shapes_preview(0) +#@gui :Shape=choice{1,"Custom Layers","Circles","Squares","Diamonds","Triangles","Horizontal Stripes","Vertical Stripes","Balls","Hearts","Stars","Arrows","Truchet","Circles (Outline)","Squares (Outline)","Diamonds (Outline)","Triangles (Outline)","Hearts (Outline)","Stars (Outline)","Arrows (Outline)"} +#@gui :Number of Scales=int(16,2,24) +#@gui :Resolution=float(10,1,50) +#@gui :Zoom Factor=_int(2,1,8) +#@gui :Minimal Size=float(5,0,150) +#@gui :Maximal Size=float(90,0,150) +#@gui :Stencil Type=choice(0,"Black & White","RGB","Color") +#@gui :Allow Angle=choice("0 Deg.","90 Deg.","180 Deg.") +#@gui :Negative=bool(1) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Note: If you set the parameter Shape to Custom layers, the different shapes used to map the pixel intensities will be defined as the Number of scales top layers of your image. Don't forget to set also Input layers to All to be sure these layers are passed to the filter. ") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/16/12.") +#@gui Pack Ellipses:fx_pack_ellipses,fx_pack_ellipses_preview(0) +#@gui :Min Radius (px)=float(3,1,256) +#@gui :Max Radius (px)=float(20,1,256) +#@gui :Radius Dilation/Erosion (px)=float(0,-10,10) +#@gui :Min Isotropy (%)=float(30,0,100) +#@gui :Max Isotropy (%)=float(100,0,100) +#@gui :Isotropy Quantization=int(6,0,16) +#@gui :Orientation=choice{1,"Isotropic (Circles Only)","Anisotropic (Along Contours)","Anisotropic (Orthogonal to Contours)"} +#@gui :Region Analysis Size=int(3,0,10) +#@gui :Background Color=color(#000000ff) +#@gui :Render Resolution=_choice("X1","X2","X3","X4","X5","X6","X7","X8") +#@gui :Preserve Image Size=_bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2023/03/29.") +#@gui Pack Sprites:fx_pack_sprites,gui_no_preview +#@gui :Number of Scales=int(5,1,16) +#@gui :Minimal Scale (%)=float(25,1,100) +#@gui :Allow Angle=choice(3,"0 Deg.","180 Deg.","90 Deg.","Any") +#@gui :Spacing=int(1,-16,16) +#@gui :Precision=int(7,1,32) +#@gui :_=separator() +#@gui :Masking=choice("No Masking","Mask as Bottom Layer") +#@gui :Width=int(512,32,2048) +#@gui :Height=int(512,32,2048) +#@gui :_=note("Notes:\n - Parameters Width and Height are considered only when No masking mode is selected.\n - Set different sprites on different layers to pack multiple sprites at the same time.") +#@gui :_=link("Click here for a video tutorial","http://www.youtube.com/watch?v=bpg7CGH7vCM") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/24/06.") +#@gui Paper Texture:fx_paper,fx_paper_preview(0) +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Periodic Dots:jeje_periodic_dots,jeje_periodic_dots_preview +#@gui :Number=int(6,2,32) +#@gui :Scale=float(4,1,12) +#@gui :Angle=float(0,0,360) +#@gui :Repeat=int(1,1,10) +#@gui :Map=choice(None,Default,HSV,Lines,Hot,Cool,Jet,Flag,Cube) +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/05/29.") +#@gui Pills:fx_pills,fx_pills_preview +#@gui :Mode=choice("Gray","RGB") +#@gui :_=separator() +#@gui :_=note("Gray Settings:") +#@gui :Cycles=float(4,0,32)_2- +#@gui :Angle=float(0,0,360)_2 +#@gui :_=separator() +#@gui :_=note("Red Settings:") +#@gui :Cycles=float(4,0,32)_0- +#@gui :Angle=float(0,0,360)_0 +#@gui :_=separator() +#@gui :_=note("Green Settings:") +#@gui :Cycles=float(4,0,32)_0- +#@gui :Angle=float(0,0,360)_0 +#@gui :_=separator() +#@gui :_=note("Blue Settings:") +#@gui :Cycles=float(4,0,32)_0- +#@gui :Angle=float(0,0,360)_0 +#@gui :_=separator() +#@gui :_=note{"Note: This filter evaluates the awesome math formula proposed by Miloslav Číž (a.k.a. DrummyFish) on this Wikipedia page. "} +#@gui :_=separator() +#@gui :_=note("Authors: Miloslav Číž and David Tschumperlé.       Latest Update: 2022/11/08.") +#@gui Plaid:fx_plaid_texture,fx_plaid_texture(1) +#@gui :Line=float(50,0,100) +#@gui :Number of Angles=int(2,1,8) +#@gui :Starting Angle=float(0,0,360) +#@gui :Angle Range=float(90,0,360) +#@gui :Smoothness=float(1,0,5) +#@gui :Sharpen=float(300,0,1000) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/16/05.") +#@gui Polka Dots:fx_polka_dots,fx_polka_dots(1) +#@gui :Size=float(80,0,100) +#@gui :Density=float(20,0.1,100) +#@gui :First Offset=float(50,0,100) +#@gui :Second Offset=float(50,0,100) +#@gui :Angle=float(0,0,180) +#@gui :Aliasing=float(0.5,0.1,1) +#@gui :Shading=float(0.1,0.1,1) +#@gui :Opacity=float(1,0,1) +#@gui :Color=color(#ff0000ff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Random Color Ellipses:fx_color_ellipses,fx_color_ellipses(1) +#@gui :Density=int(400,0,3000) +#@gui :Radius=float(8,0,30) +#@gui :Opacity=float(0.1,0.01,0.5) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Random Pattern:fx_random_pattern,fx_random_pattern_preview(1) +#@gui :Size=_int(1024,16,8192) +#@gui :Min Detail Level=float(2,0,20) +#@gui :Seed=float(4038,0,100000) +#@gui :Randomize Seed=button() +#@gui :_=separator() +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/10/08.") +#@gui Rays:jeje_rays,jeje_rays_preview +#@gui :X Center=float(50,0,100) +#@gui :Y Center=float(50,0,100) +#@gui :Frequency=float(10,0,100) +#@gui :Angle=float(0,0,360) +#@gui :Proportion=float(0.5,0,1) +#@gui :Color 1=color(#ff0000) +#@gui :Color 2=color(#ffff00) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2023/07/13.") +#@gui Resynthetize Texture [FFT]:syntexturize,fx_syntexturize_preview(1) +#@gui :Width=_int(1024,32,8192) +#@gui :Height=_int(1024,32,8192) +#@gui :Equalize Light=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note{"Note: This filter tries to re-synthetize a micro-texture (given as the input image) onto an output (seamless) image with an arbitrary size. It uses a phase randomization technique, as described in:"} +#@gui :_=link("Micro-Texture Synthesis by Phase Randomization","http://www.ipol.im/pub/art/2011/ggm_rpn/") +#@gui :_=note("This filter is based on the work of Bruno Galerne, Yann Gousseau and Jean-Michel Morel.") +#@gui :_=separator() +#@gui :_=link("Click here for a detailed description of this filter.","http://gimpchat.com/viewtopic.php?f=28&t=10141") +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé and Jérome Boulanger.       Latest Update: 2014/09/04.") +#@gui Resynthetize Texture [Patch-Based]:syntexturize_matchpatch,fx_syntexturize_matchpatch_preview(1) +#@gui :Width=_int(512,32,8192) +#@gui :Height=_int(512,32,8192) +#@gui :Number of Scales=int(0,0,16) +#@gui :Patch Size=int(7,1,32) +#@gui :Blending Size=int(5,1,24) +#@gui :Precision=float(1,0,5) +#@gui :Equalize Light=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note{"Note: This filter tries to re-synthetize an input texture image onto a bigger output image (with an arbitrary size). Beware, this filter is quite slow to compute!"} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/22/10.") +#@gui Rorschach:fx_rorschach,fx_rorschach +#@gui :Scale=float(3,0,10) +#@gui :Mirror=choice(1,"None","X-Axis","Y-Axis","XY-Axes") +#@gui :Stencil Type=choice(2,"Black & White","RGB","Color") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/12/03.") +#@gui Satin:fx_satin,fx_satin(1) +#@gui :Iterations=int(20,4,128) +#@gui :Smoothness (%)=float(1,0,5) +#@gui :Seed=int(0,0,65535) +#@gui :_=separator() +#@gui :Dark Color=color(#000000ff) +#@gui :Light Color=color(#ffffffff) +#@gui :Stretch Contrast=bool(0) +#@gui :_=separator() +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(-50,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :_=note("This filter has been inspired by this tutorial from DeviantArt user fence-post.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/11/27.") +#@gui Seamless Deco:fx_mad_rorscharchp,fx_mad_rorscharchp +#@gui :Scale=float(3,0,15) +#@gui :Mixer=choice("Average","Grain Extract","Vivid Edges","Difference","Exclusion","Negation") +#@gui :_=separator() +#@gui :Line=float(50,0,100) +#@gui :Smoothness=float(1,0,5) +#@gui :Sharpen=float(300,0,1000) +#@gui :_=separator() +#@gui :Remix=choice("Vivid Edges","Average","Difference","Negation","Dark Edges") +#@gui :PhotoComix Preset=choice("Neat Merge","Lighty Smooth","Dream","Moody","Soft","Naif","Dark Boost","Whitening","None- Skip") +#@gui :Activate Mirror=choice("No-Skip",XY Mirror","2XY Mirror") +#@gui :_=separator() +#@gui :_=note("WARNING,'Expanding Mirrors' multiply image size of x4 or if '2XY Mirrors' x9") +#@gui :_=separator() +#@gui :Expanding Mirrors=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: PhotoComix. Latest update : 2011/13/11.") +#@gui Seamless Turbulence:fx_seamless_turbulence,fx_seamless_turbulence(0) +#@gui :Amplitude=float(15,0,30) +#@gui :Smoothness=float(20,0,40) +#@gui :Orientation=float(0,0,180) +#@gui :Deviation=float(1,0,1) +#@gui :Contrast=float(3,0,4) +#@gui :Color Rendering=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/02/04.") +#@gui Shock Waves:fx_shockwaves,fx_shockwaves_preview +#@gui :Amplitude=float(10,0,100) +#@gui :Low Frequency=float(10,0,100) +#@gui :Frequency Range=float(20,0,100) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/01/12.") +#@gui Sponge:fx_sponge,fx_sponge_preview(0) +#@gui :Size=int(13,3,21) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Stained Glass:fx_stained_glass,fx_stained_glass_preview(0) +#@gui :Edges=float(20,0,100) +#@gui :Shading=float(0.1,0,0.5) +#@gui :Thin Separators=bool(1) +#@gui :_=separator() +#@gui :Equalize=bool(1) +#@gui :Colors=float(1,0,3) +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/18/03.") +#@gui Stars:fx_stars,fx_stars(0) +#@gui :Density=float(10,0,200) +#@gui :Depth=float(0,0,5) +#@gui :Size=int(32,8,128) +#@gui :Branches=int(5,3,16) +#@gui :Thickness=float(0.38,0.1,1) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffff64c8) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/01/10.") +#@gui Stencil:fx_stencil,fx_stencil_preview(0) +#@gui :Radius=float(3,0,10) +#@gui :Smoothness=float(0,0,30) +#@gui :Iterations=int(8,1,100) +#@gui :Aliasing=float(0,0,5) +#@gui :Stencil Type=choice(2,"Black & White","RGB","Color") +#@gui :Transparency=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Strip:jeje_strip,jeje_strip_preview +#@gui :Angle=float(45,0,90) +#@gui :Frequency=float(50,0,100) +#@gui :Phase=float(0,0,180) +#@gui :Amplitude=float(1,0,2) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/06/07.") +#@gui Tetris:fx_tetris,fx_tetris(0) +#@gui :Scale=int(10,1,20) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Triangular Pattern:fx_triangular_pattern,fx_triangular_pattern(1)+ +#@gui :Random Seed=int(43,0,65535) +#@gui :_=separator() +#@gui :Depth=int(7,0,16) +#@gui :Split Type-1=int(4,0,20) +#@gui :Split Type-2=int(4,0,20) +#@gui :Split Type-3=int(4,0,20) +#@gui :Split Type-4=int(0,0,20) +#@gui :Split Type-5=int(0,0,20) +#@gui :Holes Probability (Type-5) (%)=float(0,0,100) +#@gui :_=separator() +#@gui :Filling Opacity (%)=float(100,0,100) +#@gui :Outline Color=color(#000000a0) +#@gui :Anti-Aliasing=choice(1,"None","X1.5","X2","X3","X4") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/09/29.") +#@gui Truchet:fx_truchet,fx_truchet(0) +#@gui :Scale=int(32,1,256) +#@gui :Radius=int(5,1,64) +#@gui :Smoothness=float(1,0,10) +#@gui :Type=choice(1,"Straight","Curved") +#@gui :Color=choice("White on Black","Black on White","White on Transparent","Black on Transparent","Transparent on White","Transparent on Black","Random") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/26/10.") +#@gui Turing:jeje_turing_pattern,gui_no_preview +#@gui :Scale=float(1,0,1) +#@gui :Iterations=int(2000,1,10000) +#@gui :Time Step=float(.1,.01,1) +#@gui :Alpha=float(.899,0,2) +#@gui :Beta=float(-.91,-2,2) +#@gui :Q=float(2,0,3) +#@gui :R=float(.1,0,3) +#@gui :Diffusivity=float(.25,.01,.6) +#@gui :_=separator() +#@gui :_=note(Generate turing pattern using a system of coupled reaction/diffusion equations. The patterns can change from line to spots like structures depending on the parameters. You may use the 'Stencil' filter to achieve similar effects. http://en.wikipedia.org/wiki/The_Chemical_Basis_of_Morphogenesis) +#@gui :_=note(Since the computation is long there is no preview. ) +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2015/01/16.") +#@gui Voronoi:fx_voronoi,fx_voronoi_preview(0) +#@gui :Threshold=float(160,0,255) +#@gui :Threshold On=choice(1,"Pixel Values","Gradient Values") +#@gui :Smoothness=float(0.5,0,10) +#@gui :Subsampling (%)=float(50,0,100) +#@gui :_=separator() +#@gui :Flat Color=choice(3,"Black","White","Transparent","Image") +#@gui :Outline Thickness=int(1,0,8) +#@gui :Outline Color=color(#00000064) +#@gui :Centers Radius=int(2,0,10) +#@gui :Centers Color=color(#ffffff28) +#@gui :_=separator() +#@gui :Anti-Aliasing=choice{1,"X1 (none)","X1.5","X2","X2.5"} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/04/30.") +#@gui Weave:weave,weave(1) +#@gui :Density=int(6,1,32) +#@gui :Thickness=float(65,0,100) +#@gui :Shadow=float(0,0,100) +#@gui :Shading=float(0.5,0,3) +#@gui :Fibers Amplitude=float(0,0,255) +#@gui :Fibers Smoothness=float(0,0,10) +#@gui :Angle=choice("0 Deg.","22.5 Deg.","45 Deg.","67.5 Deg.") +#@gui :X-Curvature=float(0,-1,1) +#@gui :Y-Curvature=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/18/01.") +#@gui Whirls:fx_whirls,fx_whirls_preview(0) +#@gui :Density=int(7,3,20) +#@gui :Smoothness=float(2,0,10) +#@gui :Darkness=float(0.2,0,1) +#@gui :Lightness=float(1.8,1,3) +#@gui :_=separator() +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui _Rendering +#@gui 3D Blocks:fx_blocks3d,fx_blocks3d(1) +#@gui :Resolution=int(32,1,128) +#@gui :Smoothness=float(0,0,40) +#@gui :Elevation=float(4,-10,10) +#@gui :Size=float(1.5,0,3) +#@gui :Angle=float(30,0,360) +#@gui :Tilt=float(60,0,90) +#@gui :FOV=float(45,1,90) +#@gui :Centering (%)=point(50,50) +#@gui :_=separator() +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(-50,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :Use Light=bool(1) +#@gui :Antialiasing=bool(1) +#@gui :Outline Color=color(#00000080) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/10/02.") +#@gui 3D Colored Object:fx_coloredobject3d,fx_coloredobject3d_preview(1) +#@gui :Type=choice(1,"Plane","Box","Pyramid","Ellipsoid","Torus","Gyroid","Weird","Cup") +#@gui :Color=color(#808080ff) +#@gui :_=separator() +#@gui :Size-1=float(0.5,0,3) +#@gui :Size-2=float(0.5,0,3) +#@gui :Size-3=float(0.5,0,3) +#@gui :X-Angle=float(57,0,360) +#@gui :Y-Angle=float(41,0,360) +#@gui :Z-Angle=float(21,0,360) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :Rendering=choice(4,"Dots","Wireframe","Flat","Flat-Shaded","Gouraud","Phong") +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/16/05.") +#@gui 3D Elevation:fx_elevation3d,fx_elevation3d_preview(1) +#@gui :Factor=float(100,-1000,1000) +#@gui :Smoothness=float(1,0,10) +#@gui :_=separator() +#@gui :Width=_int(1024,8,4096) +#@gui :Height=_int(1024,8,4096) +#@gui :Size=float(0.8,0,3) +#@gui :X-Angle=float(25,0,360) +#@gui :Y-Angle=float(0,0,360) +#@gui :Z-Angle=float(21,0,360) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :Rendering=choice(2,"Dots","Wireframe","Flat","Flat-Shaded","Gouraud","Phong") +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :Top Layer Defines Object Texture=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/11/10.") +#@gui 3D Extrusion:fx_extrude3d,fx_extrude3d_preview(1) +#@gui :Depth=float(10,1,1024) +#@gui :Resolution=int(512,1,1024) +#@gui :Smoothness=float(0.6,0,3) +#@gui :_=separator() +#@gui :Width=_int(1024,1,4096) +#@gui :Height=_int(1024,1,4096) +#@gui :Size=float(0.5,0,3) +#@gui :X-Angle=float(57,0,360) +#@gui :Y-Angle=float(41,0,360) +#@gui :Z-Angle=float(21,0,360) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :Rendering=choice(4,"Dots","Wireframe","Flat","Flat-Shaded","Gouraud","Phong") +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :Top Layer Defines Object Texture=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/11/10.") +#@gui 3D Image Object:fx_imageobject3d,fx_imageobject3d_preview(1) +#@gui :Type=choice(1,"Plane","Cube","Pyramid","Sphere","Torus","Gyroid","Weird","Cup","Rubik") +#@gui :_=separator() +#@gui :Width=_int(1024,1,4096) +#@gui :Height=_int(1024,1,4096) +#@gui :Size=float(0.5,0,3) +#@gui :X-Angle=float(57,0,360) +#@gui :Y-Angle=float(41,0,360) +#@gui :Z-Angle=float(21,0,360) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :Rendering=choice(4,"Dots","Wireframe","Flat","Flat-Shaded","Gouraud","Phong") +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui 3D Lathing:fx_lathing3d,fx_lathing3d_preview(1) +#@gui :Resolution=int(76,1,1024) +#@gui :Smoothness=float(2,0,5) +#@gui :Max Angle=float(361,0,361) +#@gui :_=separator() +#@gui :Width=_int(1024,1,4096) +#@gui :Height=_int(1024,1,4096) +#@gui :Size=float(0.5,0,3) +#@gui :X-Angle=float(0,0,360) +#@gui :Y-Angle=float(0,0,360) +#@gui :Z-Angle=float(0,0,360) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :Rendering=choice(4,"Dots","Wireframe","Flat","Flat-Shaded","Gouraud","Phong") +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :Top Layer Defines Object Texture=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui 3D Mesh:fx_mesh3d,fx_mesh3d_preview(1) : * +#@gui :3D Mesh Filename=file("") +#@gui :_=note{"(supported file formats are: .obj, .off and .gmz)."} +#@gui :_=value("0") +#@gui :_=separator() +#@gui :X-Axis=point(80,50,0,1,255,0,128,164,1%)_0 +#@gui :Y-Axis=point(50,70,0,1,128,255,0,164,1%)_0 +#@gui :Scale=point(60,60,0,1,255,200,128,164,0.75%)_0 +#@gui :Center=point(50,50,0,1,255,255,255,-100,2%)_0 +#@gui :_=value(-1) +#@gui :_=value(-1) +#@gui :Pre-Rotate / X=choice("0 Deg.","45 Deg.","90 Deg.","135 Deg.","180 Deg.","225 Deg.","270 Deg.","315 Deg.") +#@gui :Pre-Rotate / Y=choice("0 Deg.","45 Deg.","90 Deg.","135 Deg.","180 Deg.","225 Deg.","270 Deg.","315 Deg.") +#@gui :Pre-Rotate / Z=choice("0 Deg.","45 Deg.","90 Deg.","135 Deg.","180 Deg.","225 Deg.","270 Deg.","315 Deg.") +#@gui :Rendering Mode=choice(5,"Bounding Box","Dots","Wireframe","Flat","Flat Shaded","Gouraud Shaded","Phong Shaded") +#@gui :Face Orientation=choice("Normal","Reverted","Double-Sided") +#@gui :Materials=choice(2,"Discard Colors","Discard Textures","Keep Textures") +#@gui :Recovery Color=color(#c8c8c8) +#@gui :Focale (%)=float(100,0,500) +#@gui :Anti-Aliasing=_choice(1,"None","X1.5","X2","X3","X4") +#@gui :Custom Light=point(50,50,-1,1,255,255,0,-100,3%) +#@gui :Reset 3D Position=button() +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé       Latest Update: 2022/06/21.") +#@gui 3D Random Objects:fx_random3d,fx_random3d(1) +#@gui :Type=choice("Cube","Cone","Cylinder","Sphere","Torus") +#@gui :Density=int(50,1,300) +#@gui :Size=float(3,1,20) +#@gui :Z-Range=float(100,0,300) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :Rendering=choice(3,"Dots","Wireframe","Flat","Flat-Shaded","Gouraud","Phong") +#@gui :Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Algorithm A:fx_memoakten_algorithm_a,fx_memoakten_algorithm_a_preview(1)* +#@gui :Random Seed=int(0,0,65535) +#@gui :Density of Initial Points (%)=float(20,0,100) +#@gui :Rate of Primary Segments (%)=float(30,0,100) +#@gui :Rate of Secondary Segments (%)=float(30,0,100) +#@gui :Max Secondary Segments Occurences=int(2,1,16) +#@gui :Secondary Segments Centering Constraint (%)=float(50,0,100) +#@gui :Min Segment Length (%)=float(10,0,100) +#@gui :Max Segment Length (%)=float(50,0,100) +#@gui :Angle Constraint (%)=float(40,0,100) +#@gui :Line Thickness (px)=int(3,1,16) +#@gui :Density of Color Fill (%)=float(60,0,100) +#@gui :Anti-Aliasing=choice(1,"None","X1.5","X2") +#@gui :_=separator() +#@gui :Foreground Color=color(#000000) +#@gui :Background Color=color(#ffffff) +#@gui :Fill Color 1=color(#ff0000) +#@gui :Fill Color 2=color(#ff8000) +#@gui :Fill Color 3=color(#ffff00) +#@gui :Fill Color 4=color(#000000) +#@gui :_=separator() +#@gui :_=note("Note: This filter has been implemented after reading the following tweet from Memo Akten:") +#@gui :_=link("https://twitter.com/memotv/status/1556619064491102209") +#@gui :_=note{"I (David) found the idea really nice so I tried to convert the algorithm into a G'MIC script. The code is not optimized and probably very perfectible, but at least it works :)} +#@gui :_=separator() +#@gui :_=note{"Authors: Memo Akten (algorithm) and David Tschumperlé (G'MIC conversion)       Latest Update: 2022/08/09."} +#@gui Ball:fx_ball,fx_ball_preview(0) +#@gui :Radius=int(128,1,1024) +#@gui :Specular Light=float(0.8,0,8) +#@gui :Specular Size=float(1,0,8) +#@gui :Shadow=float(1.5,0,4) +#@gui :Color=color(#ff00ff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/27/11.") +#@gui Circle Art:fx_circle_art,fx_circle_art +#@gui :Type=choice(1,"Random","Lissajous Spiral") +#@gui :Density=float(15,0,100) +#@gui :Radius=float(0.5,0,1) +#@gui :Modulo=int(8,2,16) +#@gui :Anti-Aliasing=bool(1) +#@gui :Random Colors=bool(1) +#@gui :_=separator() +#@gui :_=note("Lissajous parameters:") +#@gui :Curve Length=float(15,0,50) +#@gui :Curve Angle=float(0,0,360) +#@gui :Minimal Radius=float(0,-5,5) +#@gui :Maximal Radius=float(0.5,-5,5) +#@gui :X-Dispersion=float(1,0,4) +#@gui :Y-Dispersion=float(1,0,4) +#@gui :X-Factor=int(1,0,16) +#@gui :Y-Factor=int(1,0,16) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/22/08.") +#@gui Equation Plot [Parametric]:fx_equation_parametric,fx_equation_parametric +#@gui :X(t)=text{"sin(t)*(exp(cos(t))-2*cos(4*t)-sin(t/12)^5)"} +#@gui :Y(t)=text{"cos(t)*(exp(cos(t))-2*cos(4*t)-sin(t/12)^5)"} +#@gui :Min-T=float(0,-1000,1000) +#@gui :Max-T=float(100,-1000,1000) +#@gui :Resolution=int(4096,2,32768) +#@gui :Outline Opacity=float(1,0,1) +#@gui :Dot Size=int(0,0,16) +#@gui :Start Color=color(#400000) +#@gui :End Color=color(#800000) +#@gui :Colored Outline=bool(1) +#@gui :Antialiasing=bool(1) +#@gui :Decoration=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/13/11.") +#@gui Equation Plot [Y=f(X)]:fx_equation_plot,fx_equation_plot +#@gui :F(X)=text{"X*c+10*cos(X+c+u)"} +#@gui :X-Min=float(-10,-100,100) +#@gui :X-Max=float(10,-100,100) +#@gui :Resolution=int(100,2,1024) +#@gui :Channels=int(3,1,32) +#@gui :Plot Type=choice(2,"None","Lines","Splines","Bars") +#@gui :Vertex Type=choice(0,"None","Points","Crosses 1","Crosses 2","Circles 1","Circles 2","Square 1","Square 2") +#@gui :_=separator() +#@gui :_=note("Note : Use variable X instead of x in the above equation to take care of the X-min/max settings. Variable c refers to the current channel number. Variable u refers to a uniformly distributed random value in [0,1]. Reduce resolution to be able to view separate graph vertices.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Generate Random Portrait:fx_generate_random_portrait,fx_generate_random_portrait_preview(1)+ +#@gui :Resolution (px)=_int(800,0,2048) +#@gui :Update Portrait=button() +#@gui :_=separator() +#@gui :_=note("This filter loads data from the website:") +#@gui :_=link("https://thispersondoesnotexist.com/") +#@gui :_=note("It means it doesn't perform any calculations on your machine and it requires an active Internet connection.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.       Latest Update: 2022/04/14.") +#@gui Gradient [Corners]:fx_corner_gradient,fx_corner_gradient +#@gui :Color 1 (Up/Left Corner)=color(#ffffff80) +#@gui :Color 2 (Up/Right Corner)=color(#ff0000ff) +#@gui :Color 3 (Bottom/Left Corner)=color(#00ff00ff) +#@gui :Color 4 (Bottom/Right Corner)=color(#0000ffff) +#@gui :_=separator() +#@gui :Colorspace=choice(1,"SRGB","Linear RGB","Lab") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Gradient [Custom Shape]:fx_custom_gradient,fx_custom_gradient_preview(1) +#@gui :_=note("Shape selection:") +#@gui :Select By=choice("Auto","Dark Pixels","Bright Pixels","Opaque Pixels") +#@gui :Smoothness=float(0,0,10) +#@gui :Threshold=float(0,0,100) +#@gui :Preview Shape=bool(1) +#@gui :_=note("Note: Shapes with small strokes may lead to incorrect previews.") +#@gui :_=separator() +#@gui :_=note("Gradient parameters:") +#@gui :Number of Colors=int(4,2,10) +#@gui :Cycles=float(1,1,16) +#@gui :Offset=float(0,0,100) +#@gui :Shading=float(128,1,256) +#@gui :Inner Length=float(100,0,100) +#@gui :Outer Length=float(100,0,100) +#@gui :Spatial Metric=choice(2,"Chebyshev","Manhattan","Euclidean") +#@gui :Color Metric=choice("RGB","HSV","Lab") +#@gui :Shade Back to First Color=bool(1) +#@gui :Preview Gradient=bool(0) +#@gui :Save Gradient As=_text("") +#@gui :_=separator() +#@gui :_=note("Color definitions:") +#@gui :Colormap Type=choice(1,"Pre-Defined","User-Defined") +#@gui :Pre-Defined Colormap=int(0,0,65535) +#@gui :1st Color=color(#000000ff) +#@gui :2nd Color=color(#ff0000ff) +#@gui :3rd Color=color(#ffff00ff) +#@gui :4th Color=color(#ffffffff) +#@gui :5th Color=color(#00ffffff) +#@gui :6th Color=color(#00ff00ff) +#@gui :7th Color=color(#0000ffff) +#@gui :8th Color=color(#808080ff) +#@gui :9th Color=color(#ff00ffff) +#@gui :10th Color=color(#00000000) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/03/10.") +#@gui Gradient [from Line]:fx_line_gradient,fx_line_gradient_preview(1) +#@gui :Starting Point (%)=point(0,0,0,1,255,0,0) +#@gui :Ending Point (%)=point(100,100,0,1,64,128,255) +#@gui :Sampling=float(100,0,100) +#@gui :Length=int(0,0,4096) +#@gui :_=note("Note: Set length to 0 to release gradient length constraints.") +#@gui :Sort Colors=choice("Don't Sort","By Red Component","By Green Component","By Blue Component","By Luminance","By Blue Chrominance","By Red Chrominance","By Lightness") +#@gui :Reverse Gradient=bool(0) +#@gui :_=separator() +#@gui :Preview Gradient=bool(1) +#@gui :Save Gradient As=_text("") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/29/06.") +#@gui Gradient [Linear]:fx_linear_gradient,fx_linear_gradient +#@gui :Starting Color=color(#000000ff) +#@gui :Ending Color=color(#ffffffff) +#@gui :Swap Colors=bool(0) +#@gui :Angle=float(45,0,360) +#@gui :Fade Start=float(0,0,100) +#@gui :Fade End=float(100,0,100) +#@gui :_=separator() +#@gui :Colorspace=choice(0,"SRGB","Linear RGB","Lab") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Gradient [Radial]:fx_radial_gradient,fx_radial_gradient +#@gui :Starting Color=color(#000000ff) +#@gui :Ending Color=color(#ffffffff) +#@gui :Swap Colors=bool(0) +#@gui :Fade Start=float(0,0,100) +#@gui :Fade End=float(100,0,100) +#@gui :Center (%)=point(50,50,0,1,255) +#@gui :_=separator() +#@gui :Colorspace=choice(0,"SRGB","Linear RGB","Lab") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/29/06.") +#@gui Gradient [Random]:fx_random_gradient,fx_random_gradient +#@gui :Density=int(32,1,1024) +#@gui :Seed=int(0,0,65535) +#@gui :Smoothness=float(0,0,10) +#@gui :Color Balance=color(#808080) +#@gui :Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/08/04.") +#@gui Hair Locks:gtutor_hairlock,gtutor_hairlock_preview(0) +#@gui :_=note("Geometry") +#@gui :Spread=float(0.5,0,1) +#@gui :Thickness=float(0.5,0,1) +#@gui :Length=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Color") +#@gui :Color=color(#ffff00ff) +#@gui :Variance=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Lighting") +#@gui :Azimuth=float(45,0,360) +#@gui :Highlight=float(0.5,0,1) +#@gui :Specular=float(0.5,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Garry R. Osgood. Latest update: 2014/12/11.") +#@gui :_=link("Hairlock instructions and tutorial.","https://gmic.eu/oldtutorial/the-hairlock-filter.shtml") +#@gui Hypotrochoid:fx_hypotrochoid,fx_hypotrochoid(1) +#@gui :Periods=int(37,1,100) +#@gui :Outer Radius (%)=float(100,0,300) +#@gui :Inner Radius (%)=float(74,0,300) +#@gui :Distance to Center (%)=float(80,0,300) +#@gui :Thickness (%)=float(0.5,0,5) +#@gui :Color=color(#ffffffff) +#@gui :Anti-Aliasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/01/25.") +#@gui Lightning:fx_lightning,fx_lightning_preview +#@gui :_=note("Global parameters:") +#@gui :Number of Streaks=int(20,1,1024) +#@gui :Size (%)=float(90,0,150) +#@gui :Resolution=int(256,2,4096) +#@gui :Randomness=float(3,0,16) +#@gui :Smoothness=float(1.5,0,10) +#@gui :Balance=float(0.75,0,1) +#@gui :Color=color(#ffffffff) +#@gui :Seed=int(0,0,65535) +#@gui :_=separator() +#@gui :_=note("Initial streak:") +#@gui :XY-Coordinates (%)=point(50,5,0,1) +#@gui :Angle (deg)=float(0,-180,180) +#@gui :Thickness (px)=int(6,1,64) +#@gui :Blur=float(0.2,0,3) +#@gui :_=separator() +#@gui :_=note("Auxiliary streaks:") +#@gui :Min Offset (%)=float(25,0,100) +#@gui :Max Offset (%)=float(60,0,100) +#@gui :Min Length (%)=float(95,0,200) +#@gui :Max Length (%)=float(100,0,200) +#@gui :Min Angle Deviation (deg)=float(30,0,180) +#@gui :Max Angle Deviation (deg)=float(40,0,180) +#@gui :Thickness Factor=float(-0.25,-1,1) +#@gui :Blur Factor=float(-0.1,-1,1) +#@gui :Opacity Factor=float(-0.20,-1,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/27/11.") +#@gui Lissajous:fx_lissajous,fx_lissajous(1) +#@gui :Resolution=int(4096,2,8192) +#@gui :_=separator() +#@gui :X-Size=float(0.9,0,2) +#@gui :Y-Size=float(0.9,0,2) +#@gui :Z-Size=float(3,1,10) +#@gui :_=separator() +#@gui :X-Multiplier=float(8,0,32) +#@gui :Y-Multiplier=float(7,0,32) +#@gui :Z-Multiplier=float(0,0,32) +#@gui :_=separator() +#@gui :X-Offset=float(0,0,1) +#@gui :Y-Offset=float(0,0,1) +#@gui :Z-Offset=float(0,0,1) +#@gui :_=separator() +#@gui :X-Angle=float(0,0,360) +#@gui :Y-Angle=float(0,0,360) +#@gui :Z-Angle=float(0,0,360) +#@gui :_=separator() +#@gui :Thickness=float(0,0,50) +#@gui :Color=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/18/04.") +#@gui Mandelbrot - Julia Sets:fx_mandelbrot,fx_mandelbrot_preview +#@gui :_=value(-2) +#@gui :_=value(-2) +#@gui :_=value(2) +#@gui :_=value(2) +#@gui :_=note("Fractal Type:") +#@gui :Fractal Set=choice("Mandelbrot","Julia") +#@gui :Iterations=int(1024,16,65535) +#@gui :X-Seed (Julia)=float(0.317,-2,2) +#@gui :Y-Seed (Julia)=float(0.03,-2,2) +#@gui :_=separator() +#@gui :_=note("Colormap:") +#@gui :Number of Colors=int(16,2,2048) +#@gui :Smoothness=int(8,1,256) +#@gui :Seed=int(255,0,65536) +#@gui :_=separator() +#@gui :_=note("Navigation:") +#@gui :Zoom Center=point(50,50,0,0,255,255,255,200) +#@gui :Zoom Factor=float(0.25,0,1) +#@gui :Zoom In=button() +#@gui :Center=button() +#@gui :Zoom Out=button() +#@gui :Display Coordinates=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/06/27.") +#@gui Neon Lightning:fx_neon_lightning,fx_neon_lightning(1) +#@gui :Source (%)=point(50,50) +#@gui :R0=float(0,0,100) +#@gui :Destination (%)=point(50,50) +#@gui :R1=float(100,0,100) +#@gui :_=separator() +#@gui :Density=int(50,1,512) +#@gui :Glow=float(0.7,0,5) +#@gui :Thickness=float(3,0,20) +#@gui :_=separator() +#@gui :Color=color(#825032) +#@gui :Color Dispersion=float(0.25,0,1) +#@gui :Transparency=float(0,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/30/06.") +#@gui Newton Fractal:fx_newton_fractal,fx_newton_fractal_preview +#@gui :_=value(-2) +#@gui :_=value(-2) +#@gui :_=value(2) +#@gui :_=value(2) +#@gui :_=note("Fractal Type:") +#@gui :Expression=choice(2,"Custom","Z^^2 - 1","Z^^3 - 1","Z^^5 - 1","Z^^6 + Z^^3 - 1","Z^^8 + 15*z^^4 - 1") +#@gui :P(z)=text{"rot(35°)*z^^3 - z^^2 + 1"}_1 +#@gui :P'(z)=text("3*z^^2 - 2*z")_1 +#@gui :P''(z)=text("6*z - 2")_1 +#@gui :Descent Method=choice(1,"Secant","Newton","Householder") +#@gui :Max Iterations=int(200,16,1024) +#@gui :Precision=float(2,0,12) +#@gui :_=separator() +#@gui :_=note("Rendering:") +#@gui :Coloring=choice(1,"By Custom Expression","By Iteration","By Value") +#@gui :Number of Colors=int(16,2,2048) +#@gui :Smoothness=int(8,1,256) +#@gui :Seed=int(255,0,65536) +#@gui :Colorspace=choice(2,"HSI","HSL","HSV")_0 +#@gui :Hue Min (%)=float(100,0,500)_0 +#@gui :Hue Max (%)=float(150,0,500)_0 +#@gui :Lightness Min (%)=float(20,0,500)_0 +#@gui :Lightness Max (%)=float(400,0,500)_0 +#@gui :Colorspace=choice(3,"RGB,"HSI","HSL","HSV","Lab")_0 +#@gui :Pre-Process=choice(2,"None","Equalize","Normalize","Equalize and Normalize")_0+ +#@gui :_=note{"Tips for Custom expressions:\n - Variables i0,i1 stand for the real and imaginary parts of the iterated complex number.\n - Variable i2 is the number of iterations required for convergence.\n - Variable z is the complex number with value [ i0,i1 ].\n - Functions p(z), dp(z) and d2p(z) are the expressions used for computing the fractal. "} +#@gui :Channel #1=text{"carg(-z)"}_0 +#@gui :Channel #2=text{"(i0 + i1)/2"}_0 +#@gui :Channel #3=text{"10*(i2^0.4)"}_0 +#@gui :Post-Process=choice(0,"None","Equalize","Normalize","Equalize and Normalize")_0 +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Hue (%)=float(0,-100,100) +#@gui :Saturation (%)=float(0,-100,100) +#@gui :Equalization (%)=float(0,0,100) +#@gui :Anti-Aliasing=choice(2,"X1","X1.5","X2","X2.5","X3","X3.5","4") +#@gui :_=note("Note: Anti-aliasing is applied on final rendering only, not on preview.") +#@gui :_=value(0)_2- +#@gui :_=separator() +#@gui :_=note("Navigation:") +#@gui :Zoom Center=point(50,50,0,0,255,255,255,200) +#@gui :Zoom Factor=float(0.5,0,1) +#@gui :Angle=float(0,-180,180) +#@gui :Zoom In=button() +#@gui :Center=button() +#@gui :Zoom Out=button() +#@gui :Reset View=button() +#@gui :Display Coordinates on Preview Window=bool(1) +#@gui :Preview Subsampling=choice(2,"None","X1.5","X2","X2.5","X3","X3.5","X4") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/01/09.") +#@gui Plasma:fx_plasma,fx_plasma(0) +#@gui :Alpha=float(0.5,0,5) +#@gui :Beta=float(0,0,100) +#@gui :Scale=int(8,2,10) +#@gui :Randomize=bool(0) +#@gui :Transparency=bool(0) +#@gui :Color Balance=color(#808080) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/20/03.") +#@gui Quick Copyright:fx_quick_copyright,fx_quick_copyright(0) +#@gui :Text=text("\\251 G'MIC") +#@gui :Size=int(27,13,128) +#@gui :Color=color(#ffffff80) +#@gui :Outline=int(1,0,4) +#@gui :Position=choice(3,"Up-Left","Up-Right","Bottom-Left","Bottom-Right") +#@gui :Offset=int(5,0,40) +#@gui :Orientation=choice(1,"-90 Deg.","0 Deg.","+90 Deg.","+180 Deg.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Rainbow:fx_rainbow,fx_rainbow +#@gui :Left Position=float(80,0,100) +#@gui :Right Position=float(80,0,100) +#@gui :Left Slope=float(175,0,400) +#@gui :Right Slope=float(175,0,400) +#@gui :Thinness=float(3,0.1,8) +#@gui :Opacity=float(80,0,199) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Shade Bobs:fx_shadebobs,fx_shadebobs +#@gui :_=note("Bobs parameters :") +#@gui :Density=int(50,1,200) +#@gui :Radius=int(5,1,100) +#@gui :Duration=int(200,1,500) +#@gui :Velocity=float(1,0,10) +#@gui :_=separator() +#@gui :_=note("Curve parameters :") +#@gui :Rx=float(-1,-3,3) +#@gui :Ry=float(2,-3,3) +#@gui :Rz=float(1,-3,3) +#@gui :Rt=float(0.8,-3,3) +#@gui :Rcx=float(0,-3,3) +#@gui :Colormap=choice(8,"Grayscale","Standard","HSV","Lines","Hot","Cool","Jet","Flag","Cube") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/18/04.") +#@gui Sine Curve:fx_sine_curve,fx_sine_curve_preview +#@gui :_=note("Curve parameters:") +#@gui :Preset=choice{1,"Default (Circle)","Alien Rasta","All Round","Carnivorous Plant","Cat Pad","Flower","Flower Cushion","Fly Karateka","Hearts","Moving Leaf","Radioactive Flower","Rosace","Spaceship","Transformer","Tubular Waves","Twisted Heart","Twisted Heart 2","Twisted Tunnel","Waterslide"} +#@gui :_=value(-1) +#@gui :Resolution (%)=float(75,0,100) +#@gui :Periods=float(1,0,3) +#@gui :_=separator() +#@gui :Parameter Settings=choice(1,"Ratios","Multipliers","Offsets","Exponents","Signs","3D Angles") +#@gui :_=note("Ratios:") +#@gui :Xa/Xb=float(0.5,0,1)_0- +#@gui :Ya/Yb=float(0.5,0,1)_0 +#@gui :Za/Zb=float(0.5,0,1)_0 +#@gui :_=note("Multipliers:") +#@gui :Xa-Multiplier=int(1,0,1024)_2- +#@gui :Ya-Multiplier=int(1,0,1024)_2 +#@gui :Za-Multiplier=int(0,0,1024)_2 +#@gui :Xb-Multiplier=int(800,0,1024)_2 +#@gui :Yb-Multiplier=int(800,0,1024)_2 +#@gui :Zb-Multiplier=int(1,0,1024)_2 +#@gui :_=note("Offsets:") +#@gui :Xa-Offset (deg.)=float(90,0,360)_0- +#@gui :Ya-Offset (deg.)=float(0,0,360)_0 +#@gui :Za-Offset (deg.)=float(0,0,360)_0 +#@gui :Xb-Offset (deg.)=float(90,0,360)_0 +#@gui :Yb-Offset (deg.)=float(0,0,360)_0 +#@gui :Zb-Offset (deg.)=float(0,0,360)_0 +#@gui :_=note("Exponents:") +#@gui :Xa-Exponent=float(1,0,32)_0- +#@gui :Ya-Exponent=float(1,0,32)_0 +#@gui :Za-Exponent=float(1,0,32)_0 +#@gui :Xb-Exponent=float(1,0,32)_0 +#@gui :Yb-Exponent=float(1,0,32)_0 +#@gui :Zb-Exponent=float(1,0,32)_0 +#@gui :_=note("Signs:") +#@gui :Xa-Sign=choice("Preserve","Invert","Negative","Positive")_0- +#@gui :Ya-Sign=choice("Preserve","Invert","Negative","Positive")_0 +#@gui :Za-Sign=choice("Preserve","Invert","Negative","Positive")_0 +#@gui :Xb-Sign=choice("Preserve","Invert","Negative","Positive")_0 +#@gui :Yb-Sign=choice("Preserve","Invert","Negative","Positive")_0 +#@gui :Zb-Sign=choice("Preserve","Invert","Negative","Positive")_0 +#@gui :_=note("3D Angles:") +#@gui :X-Angle (deg.)=float(0,-180,180)_0- +#@gui :Y-Angle (deg.)=float(0,-180,180)_0 +#@gui :Z-Angle (deg.)=float(0,-180,180)_0 +#@gui :Zoom=float(1,0,10)_0 +#@gui :Focale=int(8,1,20)_0 +#@gui :_=separator() +#@gui :_=note("Rendering parameters:") +#@gui :Center=point(50,50,0,1,0,238,85,-170,10)_0 +#@gui :_=value(50) +#@gui :_=value(50) +#@gui :Radius=point(68,68,0,1,238,0,85,-170,10)_0 +#@gui :Angle=point(75,50,0,1,238,85,0,-170,10)_0 +#@gui :_=value(75) +#@gui :_=value(50) +#@gui :Primary Radius (%)=float(3,0,100) +#@gui :Secondary Radius (%)=float(2,0,100) +#@gui :Opacity (%)=float(40,0,100) +#@gui :Color=color(#ffffff) +#@gui :Anti-Aliasing=choice(2,"None","× 1.25","× 1.5","× 2","× 3") +#@gui :_=separator() +#@gui :Preview Background=choice(1,"Image","Black","White") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/03/04.") +#@gui Superformula:fx_superformula,fx_superformula(1) +#@gui :Resolution=int(4096,2,8192) +#@gui :_=separator() +#@gui :X-Size=float(0.9,0,2) +#@gui :Y-Size=float(0.9,0,2) +#@gui :_=separator() +#@gui :M=int(8,1,32) +#@gui :N1=float(1,-32,32) +#@gui :N2=float(5,-32,32) +#@gui :N3=float(8,-32,32) +#@gui :_=separator() +#@gui :X-Angle=float(0,0,360) +#@gui :Y-Angle=float(0,0,360) +#@gui :Z-Angle=float(0,0,360) +#@gui :_=separator() +#@gui :Thickness=float(3,0,50) +#@gui :Color=color(#80ff80ff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/18/04.") +#@gui Symmetric 2D Shape:fx_symmetric_shape2d,fx_symmetric_shape2d_preview(1) +#@gui :Subdivisions=int(5,2,32) +#@gui :Center=point(50,50,0,1,255,255,255,128) +#@gui :_=value(50,50) +#@gui :Angle / Size=point(50,30,0,1,255,255,255,128) +#@gui :_=value(50,30) +#@gui :_=separator() +#@gui :Control Point 1=point(50,25,1,1,255,128,0,255,4) +#@gui :Control Point 2=point(56,42,1,1,255,128,0,255,4) +#@gui :Control Point 3=point(52,52,-1,1,255,128,0,255,4) +#@gui :Control Point 4=point(52,52,-1,1,255,128,0,255,4) +#@gui :Control Point 5=point(52,52,-1,1,255,128,0,255,4) +#@gui :Control Point 6=point(52,52,-1,1,255,128,0,255,4) +#@gui :_=separator() +#@gui :Drawing Mode=choice(1,"Outlined","Filled") +#@gui :Color=color(#ff00ff) +#@gui :Opacity (%)=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/06/17.") +#@gui Tangential Circles:cl_tangentialCircle,cl_tangentialCircle(1) +#@gui :_=note("Warning: This is a slow filter and it might consume too much RAM.") +#@gui :_=separator() +#@gui :_=note("Drawing:") +#@gui :Draw Big Circle=bool(1) +#@gui :Big Circle Radius=float(100,10,1000) +#@gui :Dimensions=choice{0,"According to Radius","According to Layer","According to Layer (Proportionate)","According to Layer (Scaling)"} +#@gui :_=note("If you choose "proportionate" or "Scaling", the Big Circle Radius is a percentage of 1/3 of the smaller dimension of the layer. Otherwise, it is a number of pixels.") +#@gui :Stroke Width=float(1,0.5,10) +#@gui :Number of Small Circles=int(5,2,100) +#@gui :Number of Levels=int(1,1,4) +#@gui :_=separator() +#@gui :_=note("Colors:") +#@gui :Background Color=color(#ffffff) +#@gui :Foreground Color=color(#000000) +#@gui :_=separator() +#@gui :_=note("Effects:") +#@gui :Effect=choice(0,"None","Transparent Background","Strange Polygons","Multicolored","Rainbow","Double","Colored Tube","Red-Yellow Halo","Blue-Cyan Halo") +#@gui :_=separator() +#@gui :_=note("Note: The preview might be much more aliased than the final result and some effects ignore colors.") +#@gui :_=separator() +#@gui :_=link("Filter discussed here","http://gimpchat.com/viewtopic.php?f=28&t=20121") +#@gui :_=note("Author: Claude Lion. Latest Update: 2022/11/14.") +#@gui :_=note("It uses filters of David Tschumperlé and Rod/GimpChat and an algorithm of Reptorian.") +#@gui Thorn Fractal - Secant Sea:gui_rep_tfrac,gui_rep_tfrac_preview +#@gui :_=note("Thorn Fractal is the fractal attributed to Andrew Wayne Graff, alternatively named the "Secant Sea".\nThe code was adapted from Sample C source code provided by Adam Majewski.\n\nDocumentation - Thorn Fractal by Paul Bourke\n\nAlternating Chaos formula are made by MadJik, and they are originally used in Fractal Attractor plugin for Paint.NET software.") +#@gui :_=separator() +#@gui :_=note("Style Setting") +#@gui :Predefined Formula=choice(0,"Normal","Normal Inverted","Arctangent","Tangent","Tanh Stroke","Asymphological Vibrato","Asymphological Basic","Asymphological Basic 2","Asymphochaos","Petallian","Semi-Thorny Petallian","Thorny Petal 1","Thorny Petal 2","Inflation","Inflation 2","Chaotic Creation","Earthing","Acrylic Earthing","Unearthing Origami","Cubic Unearthing","Webbing Cubic Unearthing","Chaotic Hooks Unearthing","Chaotic Hooks","Sinusoidal Liquid","Cosinusoidal Liquid","Echo Wide","Echo Squircle","Echo Hall","Echo Hall 2","Liquid Parabolic","Chaos-Vibrato","Chaos Deep-Vibrato","Chaos Spacetime","Parabolic","Parabolic Chaos","Cubic-Diamond Chaos","C-Line","Contour Chaos","Spiderweb-Diamond","Acrylica","Refractive Space","Smooth-Artistry","Ferrofluid","Triangular Interweaving","Fabric Chaos","Reverse Tangent Division","Chaotic Tangent","Alternating Chaos 0","Alternating Chaos 1 [Legacy]","Alternating Chaos 2 [Legacy]","Alternating Chaos 3 [Legacy]","Alternating Chaos 4 [Legacy]","Alternating Chaos 5 [Legacy]","Alternating Chaos 1","Alternating Chaos 2","Alternating Chaos 3","Alternating Chaos 4","Alternating Chaos 5") +#@gui :Custom Formula=choice(0,"None","Custom Formula","Alternating Custom Formula Level 1","Alternating Custom Formula Level 2","Alternative Custom Formula Level 3","Alternating Custom Formula Level 4") +#@gui :_=separator() +#@gui :_=note("Fractal Calculation Constraints") +#@gui :_=note("Information at bottom of filter. Some predefined formulas requires you to use low values. You may need to type in values from 5-1024 manually.") +#@gui :Escape Value=int(10000,5,3000000) +#@gui :Loop Limitation=int(255,1,1024) +#@gui :Subsampling Level=float(3,1,10) +#@gui :_=separator() +#@gui :_=note("Distortion Factors") +#@gui :Distortion X-[dx]=float(0,-50,50) +#@gui :Distortion Y-[dy]=float(0,-50,50) +#@gui :_=separator() +#@gui :_=note("Transformations") +#@gui :_=note("- Scaling -") +#@gui :Scaling XY-Axis=float(1,.01,15) +#@gui :Scaling X-Axis=float(1,.01,15) +#@gui :Scaling Y-Axis=float(1,.01,15) +#@gui :PI-Based Scaling=bool(1) +#@gui :_=separator() +#@gui :_=note("- Displacement -") +#@gui :Offset X-Transformation=float(0,-5,5) +#@gui :Offset Y-Transformation=float(0,-5,5) +#@gui :_=separator() +#@gui :_=note("- Rotation -") +#@gui :Function Angle=float(0,-180,180) +#@gui :_=separator() +#@gui :_=note("Custom Formula) +#@gui :_=note("See bottom of this filter to see instruction of usage") +#@gui :Custom A-X-[vx]=text{a/sin(b)} +#@gui :Custom A-Y-[vy]=text{b/cos(a)} +#@gui :Custom B-X-[vx]=text{sin(a)/cos(b)} +#@gui :Custom B-Y-[vy]=text{b/cos(a)} +#@gui :Custom C-X-[vx]=text{a/sin(b)} +#@gui :Custom C-Y-[vy]=text{b/cos(a+b)} +#@gui :Custom D-X-[vx]=text(a) +#@gui :Custom D-Y-[vy]=text(b) +#@gui :Custom E-X-[vx]=text(a) +#@gui :Custom E-Y-[vy]=text(b) +#@gui :_=separator() +#@gui :_=note("- Overload -") +#@gui :Activate Overload Functions=bool(0) +#@gui :Enable CFA/CFB* Formulas for OVX and OVY Formulas?=bool(1) +#@gui :Overload X=text{a/(cfb*cos(b))} +#@gui :Overload Y=text{b/(cfa*sin(a))} +#@gui :CFA-[cfa]=text{cos(vx)/tan(vx)} +#@gui :CFB-[cfb]=text{sin(vy)/tan(vy)} +#@gui :Overload Count**=int(1,1,4) +#@gui :Use Negative Overload=bool(0) +#@gui :_=note("*=cfa and cfb must be lowercase when using in overload formula!\n\n**=Negative Overload Count utilize last vector number rather than second last to find cfa,cfb.") +#@gui :_=separator() +#@gui :_=note("Colour Setting) +#@gui :Fractal Mapping=choice(0,"Grayscale","Hue","Random Color Map") +#@gui :Colours=int(3,3,8) +#@gui :Colour Generation Seed=int(0,0,5000) +#@gui :_=separator() +#@gui :_=note("Information of Thorn Fractal - Secant Sea filter") +#@gui :_=separator() +#@gui :_=note("Fractal Calculation Constraints\n\nEscape Value defines the minimum value to escape from the loop used to determine the amount of iteration needed to be bigger than the specified value per pixels. The lower the value, the more contrast at a sacrifise of details.\n\nIterations defines the maximum possible amount of loop per pixels when escape value is not reached. The lower the value, the more contrast and the more posterization of values.\n\nSubsampling Level is used to alter the dimensions before calculation of fractal, and it is resized to the original dimension after the fractal has been generated. The bigger the value, the more computationally intensive it is. In fact, this has the most consistent impact on performance.") +#@gui :_=separator() +#@gui :_=note("Custom Formula\n\nTo use this, type in a formula utilizing the syntax given by the G'MIC reference manual. Use notes given the information provided below.\n\nMultiple expressions are supported, and they are separated by \";\" character. If it the only expression, then it would be used for calculation of vx or vy. Otherwise, the first expression may be the only one used for calculation of vx or vy.\n\nAvailable variables - v,vx,vy,dx,dy,a,b,cfa,cfb\n\nv - Iteration number within Thorn Fractal.\n\nvx - Output of distortion function for x-axis.\n\nvy - Output of distortion function for y-axis.\n\ndx - Distortion-X Number.\n\ndy - Distortion-Y Number.\n\na - Value of a is given by vx equation based on the number of repeats needed to escape from the iterative loop to check when resulting value is greater than escape number.\n\nb - Value of b is given by vx equation based on the number of repeats needed to escape from the iterative loop to check when resulting value is greater than escape number.\n\ncfa - Output of CFA function. Useful if and only if using overload function.\n\ncfb - Output of CFB function. Useful if and only if using overload function.") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/6/13.") +#@gui Tree:fx_tree,fx_tree_preview(1) +#@gui :_=note("Global parameters:") +#@gui :Recursion Depth=int(11,1,18) +#@gui :Random Seed=int(10000,0,65535) +#@gui :X-Ratio=float(0,-1,1) +#@gui :Y-Ratio=float(0,-1,1) +#@gui :_=note("Note: Set Random Seed to 0 to make it random as well.") +#@gui :_=separator() +#@gui :_=note("Trunk:") +#@gui :Thickness (%)=float(15,0,100) +#@gui :Base Thickness (%)=float(150,0,300) +#@gui :Angle (deg.)=float(0,-90,90) +#@gui :_=separator() +#@gui :_=note("Recursion:") +#@gui :Avg Branching=float(2.15,1,6) +#@gui :Std Branching=float(0.8,0,6) +#@gui :Avg Left Angle (deg.)=float(-40,-90,90) +#@gui :Avg Right Angle (deg.)=float(40,-90,90) +#@gui :Std Angle (deg.)=float(10,0,90) +#@gui :Avg Length Factor (%)=float(75,0,200) +#@gui :Std Length Factor (%)=float(0,0,200) +#@gui :Avg Thickness Factor (%)=float(70,0,200) +#@gui :Std Thickness Factor (%)=float(20,0,200) +#@gui :_=separator() +#@gui :_=note("Colors / Opacity:") +#@gui :Trunk Color=color(#281900ff) +#@gui :Trunk Opacity (%)=float(100,0,100) +#@gui :Leaf Color=color(#468c3cff) +#@gui :Leaf Opacity (%)=float(100,0,100) +#@gui :Color Gamma=float(0.4,-2,2) +#@gui :Opacity Gamma=float(0.4,-2,2) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/03/24.") +#@gui Turbulence:fx_turbulence,fx_turbulence +#@gui :Radius=float(128,1,1024) +#@gui :Octaves=int(6,1,12) +#@gui :Damping per Octave=float(4,1,10) +#@gui :Difference Mixing=float(0,-10,10) +#@gui :Mode=choice("Turbulence","Turbulence 2","Fractal Noise","Fractured Clouds","Stardust","Pea Soup") +#@gui :_=separator() +#@gui :_=note("Author: Preben Soeberg.      Latest Update: 2010/29/12.") +#@gui Twisted Rays:fx_twisted_rays,fx_twisted_rays +#@gui :Center=point(50,50,0,1,0,255,0,128,10) +#@gui :Branches=int(9,1,64) +#@gui :Angle (%)=float(50,0,100) +#@gui :Twist (%)=float(50,-400,400) +#@gui :Perspective (%)=float(25,-100,100) +#@gui :Color=color(#ffffffff) +#@gui :Anti-Aliasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé and Frio .       Latest Update: 2023/10/24.") +#@gui _Repair +#@gui Banding Denoise:banding_denoise_v2,banding_denoise_v2_preview(0) +#@gui :V Cutoff=float(5,0,50) +#@gui :H Cutoff=float(5,0,50) +#@gui :Space=float(5,0,20) +#@gui :Value=float(10,0,100) +#@gui :Size of Tiles=choice("No Tiling","64px","128px","256px","512px","1024px","2048px") +#@gui :Preview Difference=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Authors: Iain Fergusson and David Tschumperlé       Latest Update: 2023/02/23.") +#@gui Bayer Reconstruction:bayer2rgb,gui_no_preview +#@gui :G/M Smoothness=_float(6,0,20) +#@gui :R/B Smoothness (Principal)=_float(6,0,20) +#@gui :R/B Smoothness (Secondary)=_float(4,0,20) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Clean Text:afre_cleantext,afre_cleantext_preview(0)+ +#@gui :_=note("Clean scanned text.  Filter by afre 2019 Jun8.\n\n") +#@gui :Clean=int(8,0,10) +#@gui :Range=float(1,0.2,1) +#@gui :Black=int(80,0,100) +#@gui :White=int(95,0,100) +#@gui Deinterlace:deinterlace,fx_deinterlace_preview(0) +#@gui :Algorithm=choice("Standard","Motion-Compensated") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Deinterlace2x:gcd_deinterlace2x,gcd_deinterlace2x_preview(0) +#@gui :_=note("Blend 2x frames for 4:2:0 YUV") +#@gui :_=separator() +#@gui :Balance=int(40,1,255) +#@gui :2x Type=choice("DCCI2x","Edge","Fast Blend","Set Aspect Only") +#@gui :Aspect=choice("None","1:1","4:3","5:4","16:9","16:10","2.35:1","1.85:1") +#@gui :Interp=choice(2,"Linear","Bicubic","Lanczos") +#@gui :Ignore Current Aspect=bool(0) +#@gui :Fast Blend Preview=bool(1) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2017/05/01.") +#@gui :_=note("\nNote: preview may be inaccurate") +#@gui :_=note("Interp is only used when setting aspect") +#@gui Denoise:fx_denoise,fx_denoise_preview(0) +#@gui :Noise Type=choice{"Soft","Heavy","Heavy (Faster)","Poisson + Gaussian","Poisson + Gaussian (v2)"} +#@gui :Iterations=int(1,1,5) +#@gui :_=separator() +#@gui :Update Neural Network=button() +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note{" Note: This filter uses a convolutional neural network (CNN) to denoise images. This filter does not take advantage of GPU computing, so expect it to be quite slow if you don't have many CPU cores available. "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/11/06.") +#@gui Denoise Smooth:afre_denoisesmooth,afre_denoisesmooth_preview(1)+ +#@gui :_=note("Denoise noisy image, or smooth low noise image.  Filter by afre 2020 Oct4.\n\n Filter is slow when the radius  and amount  are high. Start small and increase as appropriate.\n\n") +#@gui :Radius=int(3,1,10) +#@gui :Amount=int(10,1,1000) +#@gui :_=note("\n\nNote\n\nG'MIC's preview is inaccurate. Apply the filter and review the results in your host editor.") +#@gui Denoise Smooth Alt:afre_denoisesmooth_alt,afre_denoisesmooth_alt_preview(1)+ +#@gui :_=note("Denoise noisy image, or smooth low noise image.  Filter by afre 2020 Oct4-11.\n\n Filter is slow when the radius  and amount  are high. Start small and increase as appropriate.\n\n") +#@gui :Radius=int(3,1,10) +#@gui :Amount=int(10,1,1000) +#@gui :_=note("\n\nNote\n\nG'MIC's preview is inaccurate. Apply the filter and review the results in your host editor.") +#@gui Descreen:fx_pahlsson_descreen,fx_pahlsson_descreen_preview(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Andreas Påhlsson. Latest update: 2016/27/06.") +#@gui Despeckle:gcd_despeckle,gcd_despeckle(3) +#@gui :_=note("Remove small dots and specks") +#@gui :_=separator() +#@gui :Tolerance=int(20,0,50) +#@gui :Max Area=int(10,0,100) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2013/02/01.") +#@gui :_=note("\nNotes") +#@gui :_=note("Set max area to 0 for no area size limit.") +#@gui Iain Noise Reduction 2019:iain_nr_2019,iain_nr_2019_preview(0) +#@gui :Gamma=float(1,.05,2) +#@gui :Shadows=float(0,-1,1) +#@gui :Light=float(0,-1,1) +#@gui :Mid Offset=float(0,-0.5,0.5) +#@gui :Desaturate=float(0.5,0,1) +#@gui :Guide Mix=float(1,0,1) +#@gui :Soften Guide=bool(0) +#@gui :Fine=float(5,0,30) +#@gui :Mid=float(3,0,30) +#@gui :Large=float(0,0,30) +#@gui :Lookup=int(3,1,7) +#@gui :Recovery=choice(0,"No Recovery","Fast Recovery","Slow Recovery","Guide Recovery") +#@gui :Recover=float(.5,0,2) +#@gui :Preview Shows=choice(4,"Noise","Fine Noise","Mid Noise","Large Noise","Output") +#@gui :Preview Tones Map=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: Iain Fergusson - completely re-written Dec 2019") +#@gui :_=note("previous update 10 Jan 2013") +#@gui Iain's Fast Denoise:iain_fast_denoise_p,iain_fast_denoise_p_preview(0) +#@gui :Luma=float(0,0,3) +#@gui :Chroma=float(0,0,3) +#@gui :Gamma=float(1,.5,3) +#@gui :Despeckle=float(0,0,1) +#@gui :Dither Output=bool(0) +#@gui :Preview Shows=choice(0,"Normal Output","Luma Noise","Chroma Noise") +#@gui :_=separator() +#@gui :Parallel Processing=choice(1,"Off","Auto") +#@gui :_=separator() +#@gui :_=note("This noise reduction filter is designed for speed, and some quality has been sacrificed.") +#@gui :_=separator() +#@gui :_=note("Author: Iain Fergusson") +#@gui :_=note("Update 28 March 2015 - increased parallel overlap to remove artefacts") +#@gui :_=note("Update 26 Oct 2013 - parallel processing") +#@gui :_=note("Released 22 Feb 2013") +#@gui Inpaint [Holes]:fx_inpaint_holes,fx_inpaint_holes(0) +#@gui :Maximal Area=float(4,1,512) +#@gui :Tolerance=float(20,0,255) +#@gui :Connectivity=choice(1,"Low","High") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/27/05.") +#@gui Inpaint [Morphological]:fx_inpaint_morpho,fx_inpaint_morpho_preview(1) +#@gui :Mask Color=_color(#ff0000ff) +#@gui :Mask Dilation=_int(0,0,32) +#@gui :_=separator() +#@gui :_=note("Note: It is strongly suggested to apply this filter only on a selection around the region to inpaint, to save computation time!") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/25/11.") +#@gui Inpaint [Multi-Scale]:fx_inpaint_matchpatch,fx_inpaint_matchpatch_preview(1) +#@gui :Number of Scales=int(0,0,16) +#@gui :_=note{"(Set Number of scales to 0 for automatic scale detection)"} +#@gui :Patch Size=int(9,1,64) +#@gui :Number of Iterations per Scale=int(10,1,100) +#@gui :Blend Size=int(5,0,32) +#@gui :Allow Outer Blending=bool(1) +#@gui :Mask Color=color(#ff0000ff) +#@gui :Mask Dilation=int(0,0,32) +#@gui :_=separator() +#@gui :Preview Progression While Running=_bool(0) +#@gui :_=separator() +#@gui :_=note("Note: Preview and final result may strongly differ.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/25/11.") +#@gui Inpaint [Patch-Based]:fx_inpaint_patch,fx_inpaint_patch_preview +#@gui :Patch Size=_int(7,1,64) +#@gui :Lookup Size=_float(16,1,32) +#@gui :Lookup Factor=_float(0.1,0,1) +#@gui :Blend Size=_float(1.2,0,5) +#@gui :Blend Threshold=_float(0,0,1) +#@gui :Blend Decay=_float(0.05,0,0.5) +#@gui :Blend Scales=_int(10,1,20) +#@gui :Allow Outer Blending=_bool(1) +#@gui :Mask Color=_color(#ff0000ff) +#@gui :Mask Dilation=_int(0,0,32) +#@gui :Process by Blocks of Size=_choice("100%","75%","50%","25%","10%","5%","2%","1%") +#@gui :_=separator() +#@gui :_=note("A quick tutorial on how to use this filter can be found here:") +#@gui :_=link("G'MIC Inpainting tutorial on Patrick David's blog.","https://patdavid.net/2014/02/getting-around-in-gimp-gmic-inpainting.html") +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé and Maxime Daisy.       Latest Update: 2015/25/11.") +#@gui Inpaint [Transport-Diffusion]:fx_inpaint_pde,fx_inpaint_pde_preview(1) +#@gui :Smoothness (%)=float(75,0,100) +#@gui :Regularization=choice(1,"Isotropic","Delaunay-Guided","Edge-Oriented") +#@gui :Regularization Iterations=int(20,0,100) +#@gui :Mask Color=_color(#ff0000ff) +#@gui :Mask Dilation=_int(0,0,32) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/10/04.") +#@gui Local Similarity Mask:local_similarity_mask,local_similarity_mask(1) +#@gui :_=note("Select pixels at") +#@gui :Center (%)=point(50,50,0,1) +#@gui :_=note("With similarity") +#@gui :Keep=int(50,0,255) +#@gui :Reject=int(128,0,255) +#@gui :_=note("On these channels") +#@gui :Channel(s)=choice(4,"RGB","Red","Green","Blue","Luminance","A-Component","B-Component","Hue","Saturation","Value","Lightness","[Cyan]MYK","C[Magenta]YK","CM[Yellow]K","CMY[Key]") +#@gui :Steps=int(10,2,100) +#@gui :_=separator() +#@gui :_=note("This filter creates a mask based on pixels that are close to, and similar to, the selected pixel.") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. Update 12 September 2018: Added interactive point and Steps control") +#@gui Pixel Denoise:iain_pixel_denoise_p,iain_pixel_denoise_p_preview(0) +#@gui :Method=choice(2,"Old Method - Slowest","Hybrid Median - Medium Speed Softest Output","Morphological - Fastest Sharpest Output") +#@gui :_=separator() +#@gui :Iterations=int(1,1,10) +#@gui :Channel(s)=choice(11,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :_=separator() +#@gui :Preview Shows=choice(0,"Output","Difference") +#@gui :_=separator() +#@gui :Parallel Processing=choice(1,"Off","Auto") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. ") +#@gui :_=note("Update - 1 July 2014 - Added much faster Morphological method. Note: The iteration setting is ignored for this method. There is no change to the output for iterations greater than one.") +#@gui :_=note("Update - 1 December 2013 - Fixed some bugs.") +#@gui :_=note("Update - 20 October 2013 - Parallel Processing") +#@gui :_=note("Update - 8 March 2013 - Incorperated Hybrid Median into this filter and added a choice between the old method and hybrid median") +#@gui Recursive Median:iain_recursive_median_p,iain_recursive_median_p_preview(0) +#@gui :Median Radius=int(3,1,20) +#@gui :Repeats=int(1,1,20) +#@gui :Channel(s)=choice(0,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :_=separator() +#@gui :Preview Shows=choice("Output","Difference") +#@gui :_=separator() +#@gui :Parallel Processing=choice(1,"Off","Auto") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson.") +#@gui :_=note{"Update - 25 October 2013 - Parallel Processing was not working properly, fixed now. note = note("Update - 20 October 2013 - Parallel Processing and Control Layout"} +#@gui Red-Eye Attenuation:red_eye,red_eye +#@gui :Threshold=float(75,0,100) +#@gui :Smoothness=float(3.5,0,20) +#@gui :Factor=float(0.1,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Remove Hot Pixels:fx_remove_hotpixels,fx_remove_hotpixels_preview(0) +#@gui :Mask Size=int(3,3,20) +#@gui :Threshold=float(10,0,200) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Jérome Boulanger.      Latest Update: 2010/29/12.") +#@gui Repair Scanned Document:jeje_scandoc,jeje_scandoc_preview(0) +#@gui :_=note(Use filter is useful to post process document you scan with a digital camera. It peforms smoothing, background correction and white balance adjustement) +#@gui :Smoothness=int(3,1,7) +#@gui :Background=float(1,10,100) +#@gui :White Level=float(90,0,100) +#@gui :Black Level=float(5,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/11/03.") +#@gui Smooth [Anisotropic]:fx_smooth_anisotropic,fx_smooth_anisotropic_preview(0) +#@gui :Amplitude=float(60,0,1000) +#@gui :Sharpness=float(0.7,0,2) +#@gui :Anisotropy=float(0.3,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(1.1,0,10) +#@gui :Spatial Precision=float(0.8,0.1,2) +#@gui :Angular Precision=float(30,1,180) +#@gui :Value Precision=float(2,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(1,1,10) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/08/27.") +#@gui Smooth [Antialias]:fx_smooth_antialias,fx_smooth_antialias_preview(0) +#@gui :Amplitude=float(5,0,100) +#@gui :Edge Threshold (%)=float(10,0,100) +#@gui :Smoothness=float(0.8,0,5) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/11/13.") +#@gui Smooth [Bilateral]:fx_smooth_bilateral,fx_smooth_bilateral_preview(0) +#@gui :Spatial Variance=float(10,0,100) +#@gui :Value Variance=float(7,0,100) +#@gui :Iterations=int(2,1,10) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/27/08.") +#@gui Smooth [Block PCA]:jeje_denoise_patch_dict,jeje_denoise_patch_dict_preview(0) +#@gui :Patch=choice(1,4,8,16,32) +#@gui :Cycles=int(8,1,32) +#@gui :Components=float(1.1,1,9) +#@gui :Coefficients=float(1.1,0,9) +#@gui :Remix=float(0,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note(Note:This filter is quite time consuming.) +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/03/29.") +#@gui Smooth [Diffusion]:fx_smooth_diffusion,fx_smooth_diffusion_preview(0) +#@gui :Sharpness=float(0.7,0,2) +#@gui :Anisotropy=float(0.3,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(1.1,0,10) +#@gui :Time Step=float(15,5,50) +#@gui :Iterations=int(8,1,100) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/27/08.") +#@gui Smooth [Guided]:fx_smooth_guided,fx_smooth_guided_preview(0) +#@gui :Guide As=choice("Self","Top Layer","Bottom Layer") +#@gui :Radius=int(5,1,100) +#@gui :Smoothness=float(30,0,512) +#@gui :Iterations=int(1,1,10) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/10/02.") +#@gui Smooth [IUWT]:jeje_denoise_iuwt,jeje_denoise_iuwt_preview(0) +#@gui :Threshold=float(3,0,10) +#@gui :Number of Scales=int(4,2,6) +#@gui :Wavelet=choice(2,"Spline B1","Spline B2","Spline B3","Spline B4","Spline B5","Spline B6") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Note:Denoise the image by thresholding the coefficient of the Isotropic Undecimated Wavelet Transform.") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/17/12.") +#@gui Smooth [Mean-Curvature]:fx_smooth_meancurvature,fx_smooth_meancurvature_preview(0) +#@gui :Time Step=float(30,5,50) +#@gui :Iterations=int(4,1,30) +#@gui :Keep Iterations as Different Layers=bool(false) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/27/08.") +#@gui Smooth [Median]:fx_smooth_median,fx_smooth_median_preview(0) +#@gui :Radius=int(3,1,20) +#@gui :Threshold=float(255,0,255) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Smooth [NL-Means]:fx_smooth_nlmeans,fx_smooth_nlmeans_preview(0) +#@gui :Patch Size=float(4,0.5,10) +#@gui :Spatial Bandwidth=int(4,3,13) +#@gui :Tonal Bandwidth=float(10,1,50) +#@gui :Patch Measure=choice(3,"Linf-Norm","L1-Norm","L2-Norm","Luminance","Lightness","RGB") +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Jérôme Boulanger.      Latest Update: 2015/01/07.") +#@gui Smooth [Patch-Based]:fx_smooth_patch,fx_smooth_patch_preview(0) +#@gui :Spatial Variance=float(10,0.1,200) +#@gui :Patch Variance=float(10,0.1,200) +#@gui :Patch Size=int(3,2,21) +#@gui :Lookup Size=int(5,2,21) +#@gui :Patch Smoothness=float(0,0,4) +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(1,1,10) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/27/08.") +#@gui Smooth [Patch-PCA]:fx_smooth_patchpca,fx_smooth_patchpca_preview(0) +#@gui :Strength=float(4,0,16) +#@gui :Patch Size=int(7,2,21) +#@gui :Lookup Size=int(11,2,21) +#@gui :Spatial Sampling=int(7,1,16) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note{"Note: Beware, this filter uses a very computationally intensive algorithm to denoise images. So, do not complain too much if you have less than 8 cores available for the computation :) "} +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé and Jérome Boulanger.       Latest Update: 2016/24/03.") +#@gui Smooth [Perona-Malik]:fx_smooth_peronamalik,fx_smooth_peronamalik_preview(0) +#@gui :K-Factor=float(20,0,255) +#@gui :Time Step=float(5,5,50) +#@gui :Iterations=int(5,1,30) +#@gui :Keep Iterations as Different Layers=bool(false) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/26/11.") +#@gui Smooth [Selective Gaussian]:fx_smooth_selective,fx_smooth_selective_preview(0) +#@gui :Amplitude=float(5,0,20) +#@gui :Edges=float(0.5,0,2) +#@gui :Scales=int(5,1,10) +#@gui :Iterations=int(1,1,10) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/27/08.") +#@gui Smooth [Skin]:fx_smooth_skin,fx_smooth_skin_preview(1) +#@gui :_=note("Step 1: Skin detection") +#@gui :Skin Estimation=choice(2,"None","Manual","Automatic") +#@gui :Tolerance=float(0.5,0,1) +#@gui :Smoothness=float(1,0,5) +#@gui :Threshold=float(1,0,10) +#@gui :Pre-Normalize Image=bool(1) +#@gui :X-Coordinate [Manual]=float(50,0,100) +#@gui :Y-Coordinate [Manual]=float(50,0,100) +#@gui :Radius [Manual]=float(5,0,25) +#@gui :_=separator() +#@gui :_=note("Step 2: Medium scale smoothing") +#@gui :Base Scale=float(2,0,10) +#@gui :Fine Scale=float(0.2,0,0.8) +#@gui :Smoothness=float(3,0,10) +#@gui :Smoothness Type=choice(1,"Gaussian","Bilateral") +#@gui :_=separator() +#@gui :_=note("Step 3: Details enhancement") +#@gui :Gain=float(0.05,0,0.5) +#@gui :_=separator() +#@gui :Preview Data=choice{5,"Skin Mask","Base Scale","Medium Scale (Original)","Medium Scale (Smoothed)","Fine Scale","Result Image"} +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=link("Click here for a video tutorial","http://www.youtube.com/watch?v=H8pQfq-ybCc") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/20/12.") +#@gui Smooth [Thin Brush]:fx_smooth_anisotropic,fx_smooth_anisotropic(0) +#@gui :Amplitude=float(60,0,1000) +#@gui :Sharpness=float(0.9,0,2) +#@gui :Anisotropy=float(0.64,0,1) +#@gui :Gradient Smoothness=float(3.1,0,10) +#@gui :Tensor Smoothness=float(1.10,0,10) +#@gui :Spatial Precision=float(0.8,0.1,2) +#@gui :Angular Precision=float(30,1,180) +#@gui :Value Precision=float(2,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(1,1,10) +#@gui :Channel(s)=choice("RGB","Luminance","Blue & Red Chrominances","Blue Chrominance","Red Chrominance") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=note("\nNote: This set of anisotropic smoothing parameters has been suggested by PhotoComiX.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX.      Latest Update: 2010/26/12.") +#@gui Smooth [Total Variation]:fx_smooth_tv,fx_smooth_tv_preview(0) +#@gui :Time Step=float(30,5,100) +#@gui :Iterations=int(10,1,40) +#@gui :Keep Iterations as Different Layers=bool(false) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2013/27/08.") +#@gui Smooth [Wavelets]:fx_smooth_haar,fx_smooth_haar_preview(0) +#@gui :Threshold=float(1,0,10) +#@gui :Iterations=int(10,1,32) +#@gui :Scales=int(10,2,10) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Parallel Processing=choice("Auto","One Thread","Two Threads","Four Threads","Eight Threads","Sixteen Threads") +#@gui :Spatial Overlap=int(24,0,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Jérome Boulanger and David Tschumperlé.       Latest Update: 2013/27/08.") +#@gui Smooth [Wiener]:jeje_local_wiener,jeje_local_wiener_preview(0) +#@gui :Scale=float(2,.5,10) +#@gui :Channel(s)=choice(11,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/06/07.") +#@gui Solidify:fx_solidify_td,fx_solidify_td_preview(1) +#@gui :Smoothness (%)=float(75,0,100) +#@gui :Regularization=choice(1,"Isotropic","Delaunay-Guided","Edge-Oriented") +#@gui :Regularization Iterations=int(20,0,100) +#@gui :Dilation / Erosion=int(0,-20,20) +#@gui :Colorspace=choice(1,"SRGB","Linear RGB") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Note: This filter reconstructs transparent regions of an image using a transport-diffusion algorithm. Useful only for images having an alpha-channel. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/07/04.") +#@gui Unpurple:unpurple,unpurple_preview(0)+ +#@gui :Intensity of Purple Fringe=float(1,0,1) +#@gui :Minimum Brightness=float(0,0,1) +#@gui :Minimum Red:Blue Ratio in the Fringe=float(0,0,1) +#@gui :Maximum Red:Blue Ratio in the Fringe=float(0.33,0,1) +#@gui :Blur Standard Deviation=int(5,1,10) +#@gui :Gentle Mode (overrides Minimum Brightness and Minimun Red:Blue Ratio)=bool(0) +#@gui :_=value(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Unpurple removes purple fringing") +#@gui :_=note("Based on https://github.com/mjambon/purple-fringe by Martin Jambon.") +#@gui :_=note("This implementation works with RGB and RGBA images in any bit depth.") +#@gui :_=note("Note: the minimum brightness and intensity are relative to the maximum blue value.") +#@gui :_=note("Ported to G'MIC by Stanislav Paskalev ") +#@gui Unstrip:jeje_unstrip,jeje_unstrip_preview(0) +#@gui :Smoothness=float(1,0,10) +#@gui :Size=float(20,1,50) +#@gui :Sensitivity=float(4,1,10) +#@gui :Normalize=bool(true) +#@gui :FFT Preview=bool(false) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/06/10.") +#@gui Upscale [DCCI2x]:fx_scale_dcci2x,fx_scale_dcci2x_preview(0) +#@gui :_=note("Directional Cubic Convolution Interpolation") +#@gui :_=separator() +#@gui :Threshold=float(1.15,1,2) +#@gui :Exponent=int(5,1,6) +#@gui :Extend 1px=_bool(0) +#@gui :_=separator() +#@gui :_=note("Author: Garagecoder. Latest Update : 2015/11/07.") +#@gui :_=note("\nNote: This filter re-implements the scaling algorithm described at : ") +#@gui :_=link("wikipedia.org","https://en.wikipedia.org/wiki/Directional_Cubic_Convolution_Interpolation") +#@gui :_=note("The algorithm is intended for enlarging images while avoiding") +#@gui :_=note("artifacts, e.g. staircase artifacts.") +#@gui :_=note("\nThreshold controls edge[lower] to texture[higher] balance.") +#@gui :_=note("Exponent controls texture edge sharpness[higher].") +#@gui :_=note("Warning: highly experimental...") +#@gui Upscale [Diffusion]:fx_upscale_smart,fx_upscale_smart_preview(0) +#@gui :Width=text("200%") +#@gui :Height=text("200%") +#@gui :Smoothness=float(2,0,20) +#@gui :Anisotropy=float(0.4,0,1) +#@gui :Sharpness=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Upscale [Scale2x]:fx_scalenx,fx_scalenx_preview(0) +#@gui :Scaling Factor=choice("X 2","X 3","X 4","X 6","X 8","X 9","X 12","X 16","X 18","X 27") +#@gui :Colorbase=choice(0,"RGB","YCbCr","Lab") +#@gui :_=note("\nNote: This filter re-implements the scaling algorithm described at : ") +#@gui :_=link("http://scale2x.sourceforge.net") +#@gui :_=note{" This filter is useful for resizing images that have very few colors (e.g. indexed images). It is generally useless for true colors images. "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui _Sequences +#@gui 3D Elevation [Animated]:fx_animate_elevation3d,fx_animate_elevation3d_preview(1) +#@gui :Frames=_int(10,2,100) +#@gui :Output as Frames=_bool(1) +#@gui :Output as Files=_bool(0) +#@gui :Output Folder=_folder() +#@gui :_=note("\nGlobal parameters :") +#@gui :Factor=float(100,-1000,1000) +#@gui :Smoothness=float(1,0,10) +#@gui :Width=_int(1024,8,4096) +#@gui :Height=_int(1024,8,4096) +#@gui :Rendering=choice(2,"Dots","Wireframe","Flat","Flat-Shaded","Gouraud","Phong") +#@gui :_=note("\nStarting parameters :") +#@gui :Size=float(0.8,0,3) +#@gui :X-Angle=float(35,0,360) +#@gui :Y-Angle=float(0,0,360) +#@gui :Z-Angle=float(0,0,360) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :_=note("\nEnding parameters :") +#@gui :Size=float(0.8,0,3) +#@gui :X-Angle=float(35,0,1440) +#@gui :Y-Angle=float(0,0,1440) +#@gui :Z-Angle=float(360,0,1440) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui 3D Extrusion [Animated]:fx_animate_extrude3d,fx_animate_extrude3d_preview(1) +#@gui :Frames=_int(10,2,100) +#@gui :Output as Frames=_bool(1) +#@gui :Output as Files=_bool(0) +#@gui :Output Folder=_folder() +#@gui :_=note("\nGlobal parameters :") +#@gui :Depth=float(10,1,256) +#@gui :Resolution=int(512,1,1024) +#@gui :Smoothness=float(0.6,0,3) +#@gui :Width=_int(1024,8,4096) +#@gui :Height=_int(1024,8,4096) +#@gui :Rendering=choice(4,"Dots","Wireframe","Flat","Flat-Shaded","Gouraud","Phong") +#@gui :_=note("\nStarting parameters :") +#@gui :Size=float(0.8,0,3) +#@gui :X-Angle=float(35,0,360) +#@gui :Y-Angle=float(0,0,360) +#@gui :Z-Angle=float(0,0,360) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :_=note("\nEnding parameters :") +#@gui :Size=float(0.8,0,3) +#@gui :X-Angle=float(35,0,1440) +#@gui :Y-Angle=float(360,0,1440) +#@gui :Z-Angle=float(0,0,1440) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui 3D Image Object [Animated]:fx_animate_imageobject3d,fx_animate_imageobject3d_preview(1) +#@gui :Frames=_int(10,2,100) +#@gui :Output as Frames=_bool(1) +#@gui :Output as Files=_bool(0) +#@gui :Output Folder=_folder() +#@gui :_=note("\nGlobal parameters :") +#@gui :Type=choice(1,"Plane","Cube","Pyramid","Sphere","Torus","Gyroid","Weird","Cup","Rubik") +#@gui :Width=_int(1024,1,4096) +#@gui :Height=_int(1024,1,4096) +#@gui :Rendering=choice(4,"Dots","Wireframe","Flat","Flat-Shaded","Gouraud","Phong") +#@gui :_=note("\nStarting parameters :") +#@gui :Size=float(0.5,0,3) +#@gui :X-Angle=float(57,0,360) +#@gui :Y-Angle=float(41,0,360) +#@gui :Z-Angle=float(21,0,360) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :_=note("\nEnding parameters :") +#@gui :Size=float(0.5,0,3) +#@gui :X-Angle=float(57,0,1440) +#@gui :Y-Angle=float(401,0,1440) +#@gui :Z-Angle=float(21,0,1440) +#@gui :FOV=float(45,1,90) +#@gui :X-Light=float(0,-100,100) +#@gui :Y-Light=float(0,-100,100) +#@gui :Z-Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui 3D Text Pointcloud:fx_text_pointcloud3d,fx_text_pointcloud3d_preview +#@gui :Frames=_int(64,1,256) +#@gui :1st Text=text("G'MIC") +#@gui :2nd Text=text("Rocks!") +#@gui :Smoothness=float(1,0,5) +#@gui :Color=color(#c8dcff) +#@gui :Background=color(#ffffffff) +#@gui :X-Shadow=float(2,0,10) +#@gui :Y-Shadow=float(2,0,10) +#@gui :Shadow Smoothness=float(1,0,5) +#@gui :Stationary Frames=_int(19,1,32) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/01/09.") +#@gui 3D Tiles:fx_transition3d,fx_transition3d_preview(0) +#@gui :Inter-Frames=_int(10,3,100) +#@gui :X-Tiles=int(8,1,64) +#@gui :Y-Tiles=int(8,1,64) +#@gui :X-Rotation=text("1") +#@gui :Y-Rotation=text("1") +#@gui :Z-Rotation=text("0") +#@gui :Focale=float(800,100,2000) +#@gui :Enable Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Note: This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2012/13/08.") +#@gui B&W Pencil [Animated]:fx_animate_pencilbw,fx_animate_pencilbw_preview(0) +#@gui :Frames=_int(10,2,100) +#@gui :Output Frames=_bool(1) +#@gui :Output Files=_bool(0) +#@gui :Output Folder=_folder() +#@gui :_=note("\nStarting Parameters :") +#@gui :Pencil Type=float(2.3,0,5) +#@gui :Amplitude=float(100,0,200) +#@gui :_=note("\nEnding Parameters :") +#@gui :Pencil Type=float(0.3,0,5) +#@gui :Amplitude=float(60,0,200) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui B&W Stencil [Animated]:fx_animate_stencilbw,fx_animate_stencilbw_preview(1) +#@gui :Frames=_int(10,2,100) +#@gui :Output Frames=_bool(1) +#@gui :Output Files=_bool(0) +#@gui :Output Folder=_folder() +#@gui :_=note("\nStarting Parameters :") +#@gui :Edge Threshold=float(10,0,30) +#@gui :Smoothness=float(10,0,30) +#@gui :_=note("\nEnding Parameters :") +#@gui :Edge Threshold=float(10,0,30) +#@gui :Smoothness=float(20,0,30) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Cartoon [Animated]:fx_animate_cartoon,fx_animate_cartoon_preview(0) +#@gui :Frames=_int(10,2,100) +#@gui :Output Frames=_bool(1) +#@gui :Output Files=_bool(0) +#@gui :Output Folder=_folder() +#@gui :_=note("\nGlobal Parameters :") +#@gui :Color Quantization=int(4,2,256) +#@gui :_=note("\nStarting parameters :") +#@gui :Smoothness=float(0.5,0,2) +#@gui :Sharpening=float(200,0,400) +#@gui :Edge Threshold=float(10,1,30) +#@gui :Edge Thickness=float(0.1,0,1) +#@gui :Color Strength=float(1.5,0,3) +#@gui :_=note("\nEnding parameters :") +#@gui :Smoothness=float(3,0,2) +#@gui :Sharpening=float(200,0,400) +#@gui :Edge Threshold=float(10,1,30) +#@gui :Edge Thickness=float(0.1,0,1) +#@gui :Color Strength=float(1.5,0,3) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Edges [Animated]:fx_animate_edges,fx_animate_edges_preview(0) +#@gui :Frames=_int(10,2,100) +#@gui :Output Frames=_bool(1) +#@gui :Output Files=_bool(0) +#@gui :Output Folder=_folder() +#@gui :_=note("\nGlobal Parameters :") +#@gui :Negative Colors=bool(0) +#@gui :_=note("\nStarting Parameters :") +#@gui :Smoothness=float(0,0,10) +#@gui :Edge Threshold=float(10,0,30) +#@gui :_=note("\nEnding Parameters :") +#@gui :Smoothness=float(0,0,10) +#@gui :Edge Threshold=float(30,0,30) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Edges on Fire:fx_fire_edges,fx_fire_edges_preview(0) +#@gui :Edges=float(0.7,0,3) +#@gui :Attenuation=float(0.25,0,1) +#@gui :Smoothness=float(0.5,0,5) +#@gui :Threshold=float(25,0,100) +#@gui :_=separator() +#@gui :Number of Frames=_int(20,1,999) +#@gui :Starting Frame=int(20,0,199) +#@gui :Frame Skip=_int(0,0,20) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/06/07.") +#@gui Lava Lamp:fx_lavalampbw,fx_lavalampbw_preview(0) +#@gui :Number of Key-Frames=_int(3,2,50) +#@gui :Number of Inter-Frames=_int(30,2,100) +#@gui :Smooth Looping=_bool(1) +#@gui :_=separator() +#@gui :Resolution=float(20,1,100) +#@gui :Size=float(2,0,30) +#@gui :Smoothness=_float(0.01,0,1) +#@gui :Transparent Background=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/06/07.") +#@gui Lissajous [Animated]:fx_animate_lissajous,fx_animate_lissajous_preview(1) +#@gui :Frames=_int(10,2,100) +#@gui :Output as Frames=_bool(1) +#@gui :Output as Files=_bool(0) +#@gui :Output Folder=_folder() +#@gui :_=separator() +#@gui :_=note("Starting parameters :") +#@gui :Resolution=int(4096,2,8192) +#@gui :X-Size=float(0.9,0,2) +#@gui :Y-Size=float(0.9,0,2) +#@gui :Z-Size=float(3,1,10) +#@gui :X-Multiplier=float(8,0,32) +#@gui :Y-Multiplier=float(7,0,32) +#@gui :Z-Multiplier=float(0,0,32) +#@gui :X-Offset=float(0,0,1) +#@gui :Y-Offset=float(0,0,1) +#@gui :Z-Offset=float(0,0,1) +#@gui :X-Angle=float(0,0,360) +#@gui :Y-Angle=float(0,0,360) +#@gui :Z-Angle=float(0,0,360) +#@gui :Thickness=float(0,0,50) +#@gui :Color=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("Ending parameters :") +#@gui :Resolution=int(4096,2,8192) +#@gui :X-Size=float(0.9,0,2) +#@gui :Y-Size=float(0.9,0,2) +#@gui :Z-Size=float(3,1,10) +#@gui :X-Multiplier=float(8,0,32) +#@gui :Y-Multiplier=float(7,0,32) +#@gui :Z-Multiplier=float(0,0,32) +#@gui :X-Offset=float(0,0,1) +#@gui :Y-Offset=float(0,0,1) +#@gui :Z-Offset=float(0,0,1) +#@gui :X-Angle=float(0,0,360) +#@gui :Y-Angle=float(0,0,360) +#@gui :Z-Angle=float(0,0,360) +#@gui :Thickness=float(0,0,50) +#@gui :Color=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/18/04.") +#@gui Moiré Animation:fx_moire,fx_moire_preview(1)+ : * +#@gui :Stripe Orientation=choice(1,"Horizontal","Vertical") +#@gui :Input Transparency=choice("Replace With White","Reconstruct From Previous Frames") +#@gui :Output Format=choice{2,"Same as Input","A4 / 75 PPI","A4 / 100 PPI (Recommended)","A4 / 150 PPI","A4 / 300 PPI"} +#@gui :Auto-Reduce Number of Frames=bool(1) +#@gui :Landscape=bool(1) +#@gui :Margin (%)=float(2,0,30) +#@gui :_=separator() +#@gui :Print Frame Numbers=choice(1,"Disable","Top Left","Top Right","Bottom Left","Bottom Right") +#@gui :Size of Frame Numbers (%)=float(5,0,30) +#@gui :_=separator() +#@gui :_=note{"Instructions:\n\n This filter renders Moire Animations, as shown on this video.\n To make the animation visible:\n\n • Before running the filter, ensure that all frames are aligned and have the same size (and preferably without alpha)!\n • Run the filter. It is recommended to keep the number of frames <=6.\n • Print the first layer (merged frames) on a A4 blank paper, at 300 PPI.\n • Print the second layer (mask) on a A4 transparent sheet, at 300 PPI.\n • Drag the transparent layer over the A4 paper to render the animation effect. "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/03/02.") +#@gui Object Animation:fx_tk_animateobject,fx_tk_animateobject_preview(1) +#@gui :_=separator() +#@gui :_=note("Object motion:") +#@gui :X-Motion=float(0,-100,100) +#@gui :Y-Motion=float(0,-100,100) +#@gui :Z-Motion=float(0,-10,50) +#@gui :_=separator() +#@gui :_=note("Camera position:") +#@gui :Camera X=float(0.5,0,1) +#@gui :Camera Y=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Frame settings:") +#@gui :Frame Size=int(400,50,1920) +#@gui :Frames=int(2,2,100) +#@gui :Reverse Motion=bool(0) +#@gui :_=note("Your mask must be placed below your image. Switch input layers to Active and below.") +#@gui :_=separator() +#@gui :Work on Frameset=bool(0) +#@gui :_=note("To use this option your mask must be placed below your frames. Switch input layers to All.") +#@gui :_=separator() +#@gui :_=note("Advanced settings:") +#@gui :Sharpen Object=float(0,0,10) +#@gui :Expand Background Reconstruction=float(0,0,50) +#@gui :Smoothen Background Reconstruction=float(0,0,1) +#@gui :Adjust Background Reconstruction=float(1,1,256) +#@gui :_=separator() +#@gui :Blue Screen Mode=bool(0) +#@gui :_=note("Layer stack for images: Object image top, background image below, mask bottom. Layer stack for framesets: Frameset top, object image below, mask bottom. Switch input layers to All.") +#@gui :_=separator() +#@gui :Camera Motion Only=bool(0) +#@gui :Closeup=float(1,1,10) +#@gui :_=note("Use this option without mask layer. Switch input layers to Active or All") +#@gui :_=separator() +#@gui :_=note("Author : Tom Keil. Latest update: 2012/08/04.") +#@gui Rodilius [Animated]:fx_animate_rodilius,fx_animate_rodilius_preview(1) +#@gui :Frames=_int(10,2,100) +#@gui :Output as Frames=_bool(1) +#@gui :Output as Files=_bool(0) +#@gui :Output Folder=_folder() +#@gui :Color Mode=choice(1,"Darker","Lighter") +#@gui :_=note("\nStarting Parameters :") +#@gui :Amplitude=float(10,0,30) +#@gui :Thickness=float(10,0,100) +#@gui :Sharpness=float(300,0,1000) +#@gui :Orientations=int(5,2,20) +#@gui :Offset=float(0,0,180) +#@gui :_=note("\nEnding Parameters :") +#@gui :Amplitude=float(10,0,30) +#@gui :Thickness=float(10,0,100) +#@gui :Sharpness=float(300,0,1000) +#@gui :Orientations=int(5,2,20) +#@gui :Offset=float(180,0,180) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Soft Glow [Animated]:fx_animate_glow,fx_animate_glow_preview(1) +#@gui :Frames=_int(10,2,100) +#@gui :Output as Frames=_bool(1) +#@gui :Output as Files=_bool(0) +#@gui :Output Folder=_folder() +#@gui :_=note("\nStarting Parameters :") +#@gui :Amplitude=float(0,0,8) +#@gui :_=note("\nEnding Parameters :") +#@gui :Amplitude=float(3,0,8) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Spatial Transition:fx_spatial_transition,fx_spatial_transition_preview(1) : * +#@gui :Number of Added Frames=_int(10,1,256) +#@gui :Shading (%)=float(0,0,100) +#@gui :Transition Shape=choice(7,"Bottom Layer","Top Layer","Custom Formula","Horizontal","Vertical","Angular","Radial","Plasma") +#@gui :Custom Formula=text{"cos(x*y/(16+32*A))"}_1 +#@gui :A-Value=float(0,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice(1,"Transition Map","Timed Image","Sequence X4","Sequence X6","Sequence X8") +#@gui :Preview Time=float(0.5,0,1) +#@gui :_=value(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/10/04.") +#@gui _Silhouettes +#@gui Animals +#@gui Dragonfly:mc_dragonfly,mc_dragonfly_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 4th of September 2018.") +#@gui Kookaburra:mc_kookaburra,mc_kookaburra_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 4th of September 2018.") +#@gui Paw:mc_paw,mc_paw_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 4th of September 2018.") +#@gui Rooster:mc_rooster,mc_rooster_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 4th of September 2018.") +#@gui _Icons +#@gui Flip:mc_flip,mc_flip_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 5th of September 2018.") +#@gui Information:mc_information,mc_information_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 5th of September 2018.") +#@gui Mail:mc_mail,mc_mail_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 5th of September 2018.") +#@gui Phone:mc_phone,mc_phone_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 5th of September 2018.") +#@gui Shopping Cart:mc_shopping_cart,mc_shopping_cart_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 5th of September 2018.") +#@gui _Misc +#@gui Barbed Wire:mc_barbed_wire,mc_barbed_wire_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 4th of September 2018.") +#@gui Crosshair:mc_crosshair,mc_crosshair_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 4th of September 2018.") +#@gui Cupid:fx_cupid,fx_cupid_preview +#@gui :Size (%)=float(75,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/01/08.") +#@gui Gear:fx_gear,fx_gear_preview +#@gui :Size (%)=float(75,0,100) +#@gui :Number of Teeth=int(12,1,96) +#@gui :Elevation (%)=float(15,0,100) +#@gui :Angle (%)=float(0,0,100) +#@gui :Inner Radius (%)=float(40,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/01/08.") +#@gui Heart:fx_heart,fx_heart_preview +#@gui :Size (%)=float(75,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2018/01/08.") +#@gui Paint Splat:mc_paint_splat,mc_paint_splat_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 5th of September 2018.") +#@gui Sierpinski Triangle:fx_sierpinski,fx_sierpinski(1) +#@gui :Recursions=int(6,0,10) +#@gui :1st X-Coord=float(50,0,100) +#@gui :1st Y-Coord=float(0,0,100) +#@gui :2nd X-Coord=float(0,0,100) +#@gui :2nd Y-Coord=float(100,0,100) +#@gui :3rd X-Coord=float(100,0,100) +#@gui :3rd Y-Coord=float(100,0,100) +#@gui :Color=color(#ffffff) +#@gui :Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui _Nature +#@gui Australia:mc_australia,mc_australia_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 4th of September 2018.") +#@gui Barnsley Fern:fx_barnsley_fern,fx_barnsley_fern_preview(1) +#@gui :Type=choice("Asplenium Adiantum-Nigrum","Thelypteridaceae") +#@gui :Density (%)=float(100,0,300) +#@gui :Angle=float(30,-180,180) +#@gui :Opacity (%)=float(40,0,100) +#@gui :Color=color(#0ab200ff) +#@gui :Add as a New Layer=_bool(1) +#@gui :_=separator() +#@gui :_=note("This filter renders the Barnsley fern fractal, described here:") +#@gui :_=link("https://en.wikipedia.org/wiki/Barnsley_fern") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/18/10.") +#@gui Gum Leaf:mc_gum_leaf,mc_gum_leaf_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 4th of September 2018.") +#@gui Japanese Maple Leaf:mc_maple_leaf,mc_maple_leaf_preview(1) +#@gui :Size (%)=float(50,0,100) +#@gui :Smoothness=float(0,0,10) +#@gui :Color=color(#ffffffff) +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Mathew Callaghan. Last update: 4th of September 2018.") +#@gui Snowflake:fx_snowflake,fx_snowflake(1) +#@gui :Recursions=int(5,0,6) +#@gui :Opacity=float(1,0,1) +#@gui :Color=color(#ffffff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui _Others +#@gui Dragon Curve:fx_dragoncurve,fx_dragoncurve(1) +#@gui :Recursions=int(20,0,30) +#@gui :Angle=float(0,-180,180) +#@gui :Opacity=float(1,0,1) +#@gui :Color=color(#ffffff) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2019/01/29.") +#@gui __Stereoscopic 3D +#@gui 3D Conversion:fx_tk_make3D,fx_tk_make3D_preview(1) +#@gui :_=separator() +#@gui :_=note("Stereoscopic settings:") +#@gui :Scene Selector=choice("Automatic Depth Estimation","Daylight Scene","Optimized Lateral Inhibition","Light Motive","Dark Motive","Landscape","Center Foreground","Center Background","Left Foreground","Left Diagonal Foreground","Right Foreground","Right Diagonal Foreground","Left and Right Foreground","Left and Right Background","Bottom and Top Foreground","Bottom and Left Foreground","Bottom and Right Foreground","Central Perspective Outdoor","Central Perspective Indoor","Portrait","Human 1","Human 2","Studio","Underwater","Flat") +#@gui :Far Point Deviation=float(20,-100,100) +#@gui :Stereoscopic Window Position=float(0,-100,100) +#@gui :Depth Field Control=float(20,0,100) +#@gui :Feature Analyzer Threshold=float(0,0,5) +#@gui :Feature Analyzer Smoothness=float(0,0,5) +#@gui :Local Detail Enhancer=float(0,0,5) +#@gui :DOF Analyzer=float(0,0,5) +#@gui :Frequency Analyzer=float(0,0,5) +#@gui :Flip Left / Right=bool(0) +#@gui :Use Individual Depth Map=bool(0) +#@gui :_=note("To use this option your depth map must be placed below your image. Switch input layers to Active and below.") +#@gui :_=separator() +#@gui :_=note("Image settings:") +#@gui :Black & White=bool(0) +#@gui :Output Format=choice("Anaglyph Red/cyan","Anaglyph Red/cyan Optimized","Anaglyph Blue/yellow","Anaglyph Blue/yellow Optimized","Anaglyph Green/magenta","Anaglyph Green/magenta Optimized","Full Side by Side Keep Width","Full Side by Side Keep Uncompressed","Full Bottom/top","Half Side by Side","Half Bottom/top","Interlace Horizontal","Interlace Vertical","Full HD Frame Packing","Unaligned Images","Depth Map Only") +#@gui :Gamma Compensation=float(1.2,0,4) +#@gui :Anti-Ghosting=float(25,0,255) +#@gui :Color Boost=float(1,0,4) +#@gui :Anaglyph Glasses Adjustment=float(0,-100,100) +#@gui :Autocrop=bool(1) +#@gui :Bidirectional Rendering=bool(0) +#@gui :_=separator() +#@gui :_=note("Frame settings:") +#@gui :Render Multiple Frames=bool(0) +#@gui :Render Routine for Wiggle Animations=bool(0) +#@gui :Frames=int(2,2,100) +#@gui :Frame Size=int(200,50,1920) +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil. Latest update: 2012/20/09.") +#@gui 3D Video Conversion:fx_tk_video3D,fx_tk_video3D_preview(1) +#@gui :_=separator() +#@gui :_=note("Stereoscopic settings:") +#@gui :Scene Selector=choice("Automatic Depth Estimation","Daylight Scene","Optimized Lateral Inhibition","Light Motive","Dark Motive","Landscape","Center Foreground","Center Background","Left Foreground","Left Diagonal Foreground","Right Foreground","Right Diagonal Foreground","Left and Right Foreground","Left and Right Background","Bottom and Top Foreground","Bottom and Left Foreground","Bottom and Right Foreground","Central Perspective Outdoor","Central Perspective Indoor","Portrait","Human 1","Human 2","Studio","Underwater","Flat") +#@gui :Far Point Deviation=float(10,-100,100) +#@gui :Stereo Window Position=float(-10,-100,100) +#@gui :Depth Field Control=float(20,0,100) +#@gui :Feature Analyzer Threshold=float(0,0,5) +#@gui :Feature Analyzer Smoothness=float(0,0,5) +#@gui :Local Detail Enhancer=float(0,0,5) +#@gui :DOF Analyzer=float(0,0,5) +#@gui :Frequency Analyzer=float(0,0,5) +#@gui :Motion Analyzer=float(0,-5,5) +#@gui :Flip Left / Right=bool(0) +#@gui :_=separator() +#@gui :_=note("Frames settings:") +#@gui :Black & White=bool(0) +#@gui :Output Format=choice("Anaglyph Red/cyan","Anaglyph Red/cyan Optimized","Anaglyph Blue/yellow","Anaglyph Blue/yellow Optimized","Anaglyph Green/magenta","Anaglyph Green/magenta Optimized","Full Side by Side Keep Width","Full Side by Uncompressed","Full Bottom/top","Half Side by Side","Half Bottom/top","Interlace Horizontal","Interlace Vertical","Full HD Frame Packing","Left and Right Image Streams","Depth Maps Only") +#@gui :Output to Folder=bool(0) +#@gui :Folder Name=folder() +#@gui :Gamma Compensation=float(1.2,0,4) +#@gui :Anti-Ghosting=float(25,0,255) +#@gui :Color Boost=float(1,0,4) +#@gui :Anaglyph Glasses Adjustment=float(0,-100,100) +#@gui :Autocrop=bool(1) +#@gui :Set Frame Format=bool(1) +#@gui :Frame Width=int(1280,128,4096) +#@gui :Frame Format=choice(1,"4:3","16:9","3:2","2:1","21:9","Keep Aspect Ratio") +#@gui :Frames Offset=int(0,-5,5) +#@gui :Reverse Frame Stack=bool(0) +#@gui :_=separator() +#@gui :_=note("Input settings:") +#@gui :Processing Mode=choice("Layer Processing","Batch Processing") +#@gui :Input Folder=folder() +#@gui :Input Frame Files Name=text("frame_") +#@gui :Start Frame Number=int(0,0,99998) +#@gui :End Frame Number=int(1,1,99999) +#@gui :Frame Files Format=choice(".png",".bmp") +#@gui :_=separator() +#@gui :_=note("Advanced editing:") +#@gui :Activate Custom Filter=choice("Off","On","Left Stream Only","Right Stream Only") +#@gui :Custom Filter Code=text(1,"#old movie\n#luminance fx_stripes_y 10,3,0 sepia \n\n#simple vintage\n#+fc 0,15,125 rv fx_compose_exclusion 0.3 \n\n#HDR popout\n#fx_map_tones_fast 2,0.3,3,2 fx_unsharp_octave 4,5,3,0,0,0") +#@gui :Depth Fade In Frames=int(0,0,120) +#@gui :Depth Fade Out Frames=int(0,0,120) +#@gui :_=separator() +#@gui :_=note("Advanced quality control:") +#@gui :Key Frame Rate=int(1,1,100) +#@gui :Stabilizer=float(5,0,100) +#@gui :Preprocessor Radius=float(0,0,5) +#@gui :Preprocessor Power=float(0,0,5) +#@gui :Custom Depth Correction=choice("None","Custom Correction Map","Single Custom Depth Map","Custom Depth Maps Stream") +#@gui :Rendering Mode=choice(1,"Right Eye View","Bidirectional Rendering","Align Image Streams","Anaglyph Reconstruction") +#@gui :_=separator() +#@gui :_=note("Preview:") +#@gui :Preview Type=choice("First Frame","Last Frame","Selected Frame","Full Layer Stack -Slow!-") +#@gui :Preview Frame Selection=int(0,0,99999) +#@gui :_=separator() +#@gui :_=note("Switch input layers to All.") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil. Latest update: 2012/07/10.") +#@gui Automatic Depth Estimation:fx_tk_autodepth,fx_tk_autodepth(1) +#@gui :_=separator() +#@gui :_=note("This filter estimates a depth map from a 2D image by analyzing various monoscopic image properties.") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil Latest update: 2012/30/07.") +#@gui De-Anaglyph:fx_tk_deana,fx_tk_deana(1) +#@gui :_=separator() +#@gui :_=note("This filter reconstructs strereoscopic full colour views from anaglyphs") +#@gui :_=separator() +#@gui :Colour Smoothing=float(20,0,100) +#@gui :Gamma Equalizer=float(2,0.1,10) +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil Latest update: 2012/20/09.") +#@gui Depth Map Construction:fx_tk_depthmap,fx_tk_depthmap(1) +#@gui :_=separator() +#@gui :_=note("This filter estimates and constructs a depth map for a 2D image ") +#@gui :Scene Selector=choice("Automatic Depth Estimation","Daylight Scene","Optimized Lateral Inhibition","Light Motive","Dark Motive","Landscape","Center Foreground","Center Background","Left Foreground","Left Diagonal Foreground","Right Foreground","Right Diagonal Foreground","Left and Right Foreground","Left and Right Background","Bottom and Top Foreground","Bottom and Left Foreground","Bottom and Right Foreground","Central Perspective Outdoor","Central Perspective Indoor","Portrait","Human 1","Human 2","Studio","Underwater","Flat") +#@gui :Depth Field Control=float(20,0,100) +#@gui :Feature Analyzer Threshold=float(0,0,5) +#@gui :Feature Analyzer Smoothness=float(0,0,5) +#@gui :Local Detail Enhancer=float(0,0,5) +#@gui :DOF Analyzer=float(0,0,5) +#@gui :Frequency Analyzer=float(0,0,5) +#@gui :Preprocessor Radius=float(0,0,5) +#@gui :Preprocessor Power=float(0,0,5) +#@gui :Smoothing=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil Latest update: 2012/30/07.") +#@gui Depth Map Reconstruction:fx_tk_depth_obtain,fx_tk_depth_obtain(1) +#@gui :_=note("This filter estimates a depth map from the left and the right view of a stereoscopic image. Images must be aligned correct to compute correct depth information.") +#@gui :Flip Left/Right=bool(0) +#@gui :Smoothness=float(0.1,0,1) +#@gui :Center Size=float(100,0,100) +#@gui :Center Smoothness=float(0,0,50) +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil Latest update: 2012/04/09.") +#@gui Lenticular Print:fx_tk_lenticular,fx_tk_lenticular(1) +#@gui :_=separator() +#@gui :Lenticular Density LPI=float(30,5,200) +#@gui :Lenticular Orientation=choice("Vertical","Horizontal") +#@gui :Print Size Width=float(5,1,50) +#@gui :Print Size Unit=choice("Inch","Centimeter") +#@gui :Print Adjustment Marks=bool(1) +#@gui :Automatic Upscale for Optimum Results=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil. Latest update: 2011/10/06.") +#@gui Single Image Stereogram:fx_tk_stereogram,fx_tk_stereogram_preview(1) +#@gui :_=separator() +#@gui :Deviation=float(50,0,200) +#@gui :_=separator() +#@gui :_=note("Pattern generator") +#@gui :Pattern Variation 1=float(0.5,0,1) +#@gui :Pattern Variation 2=float(10,0,20) +#@gui :Pattern Variation 3=float(0,0,1) +#@gui :Tiles=int(40,10,100) +#@gui :Color 1=color(#ffff00) +#@gui :Color 2=color(#ff0000) +#@gui :Color 3=color(#00ff00) +#@gui :Color 4=color(#0000ff) +#@gui :Color Strength=float(0.5,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil. Latest update: 2012/25/02.") +#@gui :_=note("Input image should be a depth map which is turned into an autostereogram, also known as magic eye image") +#@gui :_=link("Background explained here","http://en.wikipedia.org/wiki/Autostereogram") +#@gui Stereo Image:gcd_stereo_img,gcd_stereo_img(1) +#@gui :_=note("Create a 3D image from a flat one") +#@gui :_=note("\n3D Options") +#@gui :_=separator() +#@gui :3D Image Type=choice("Anaglyph: Red/Cyan","Side by Side","Depth Map","Inverse Depth Map") +#@gui :Balance Color=float(0.5,0,1) +#@gui :Depth=float(1.2,0,3) +#@gui :Distance=float(1,-2,2) +#@gui :_=note("\nDepth Map Options") +#@gui :_=separator() +#@gui :Blur Percentage=float(0.25,0,2) +#@gui :Object Ratio=float(2,0,4) +#@gui :Object Tolerance=int(4,0,5) +#@gui :Despeckle=bool(1) +#@gui :_=note("\nOutput Options") +#@gui :_=separator() +#@gui :Auto Crop=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2015/07/02.") +#@gui Stereoscopic Image Alignment:fx_tk_stereoimage,fx_tk_stereoimage(1) +#@gui :_=separator() +#@gui :Mode=choice("Anaglyph Red/cyan","Anaglyph Red/cyan Optimized","Anaglyph Blue/yellow","Anaglyph Blue/yellow Optimized","Anaglyph Green/magenta","Anaglypgh Green/magenta Optimized","Full Side by Side Keep Width","Full Side by Side Keep Uncompressed","Full Bottom/top","Half Side by Side","Half Bottom/top","Interlace Horizontal","Interlace Vertical","Full HD Frame Packing") +#@gui :Flip Left / Right=bool(0) +#@gui :Gamma Compensation=float(1,0,4) +#@gui :Anti-Ghosting=float(0,0,255) +#@gui :Color Boost=float(1,0,4) +#@gui :Anaglyph Glasses Adjustment=float(0,-100,100) +#@gui :_=separator() +#@gui :_=note("This filter needs two aligned input images.") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil Latest update: 2012/04/08.") +#@gui Undo Anaglyph:gcd_unstereo,gcd_unstereo_preview(1) +#@gui :_=note("Attempt to revert red/cyan anaglyph to 2D") +#@gui :_=note("Warning: with high precision or large image this can be VERY slow!") +#@gui :_=note("\nDisplacement Settings") +#@gui :_=separator() +#@gui :Precision=float(5,1,6) +#@gui :Smoothness=float(0.1,0,1) +#@gui :Horizontal Warp Only=bool(1) +#@gui :Fast (Low Precision) Preview=bool(1) +#@gui :_=note("\nTile Settings") +#@gui :_=separator() +#@gui :Horizontal Tiles=int(1,1,8) +#@gui :Vertical Tiles=int(1,1,8) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2013/10/26.") +#@gui _Testing +#@gui afre +#@gui Contrast FFT:afre_contrastfft,afre_contrastfft_preview(0)+ +#@gui :_=note("Enhance contrast with Fourier transform.  Filter by afre 2019.\n\n") +#@gui :Strength=int(75,1,100) +#@gui :Amount=int(50,0,100) +#@gui :Iterations=int(1,1,10) +#@gui Denoise [afre]:afre_denoise,afre_denoise_preview(1)+ +#@gui :_=note("Denoise.  Filter by afre 2022 Feb9-17.\n\n") +#@gui :Radius=int(1,1,10) +#@gui :_=note("\n\nNote\n\nG'MIC's preview is inaccurate. Apply the filter and review the results in your host editor.") +#@gui Details:afre_details,afre_details_preview(2)+ +#@gui :_=note("Split image into detail scales.  Filter by afre 2020 Aug10.\n\n") +#@gui :Scales=int(2,2,6) +#@gui :_=note("\n\nInstructions\n\nDrag preview image to examine different regions of interest.") +#@gui :_=note("\n\nNote\n\nG'MIC's preview is inaccurate. Apply the filter and review the results in your host editor.") +#@gui Gamify:fx_gamify,fx_gamify_preview(0)+ +#@gui :Lightness=int(50,50,60) +#@gui :Chroma=float(2,1.1,5) +#@gui :_=separator() +#@gui :Normalize=bool(1) +#@gui :Contrast=float(1,1,1.5) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Filter by afre. Latest update: 2017-01-05.") +#@gui Gleam:afre_gleam,afre_gleam_preview(0)+ +#@gui :_=note("Add gleam effect.  Hint: Try different combinations of smooth and threshold.  Filter by afre 2019.\n\n * Experimental filter.\n\n") +#@gui :Smooth=int(3,2,100) +#@gui :Threshold=int(50,10,90) +#@gui Half & Half:afre_halfhalf,afre_halfhalf_preview(0)+ +#@gui :_=note("Stitch left and right halves of 2 images, respectively.  Filter by afre 2020-Feb21.\n\n * Remember to set Input layers.\n * Match size doesn't work in Krita.\n\n") +#@gui :Match Size=bool(0) +#@gui Hessian Norm:fx_hnorm,fx_hnorm_preview(0)+ +#@gui :Strength=float(1,0.5,1.5) +#@gui :Contrast=int(50,1,99) +#@gui :Invert=bool(0) +#@gui :_=separator() +#@gui :_=note("Filter by afre. Latest update: 2018-05-09.") +#@gui Montage X:afre_montagex,afre_montagex_preview(1)+ +#@gui :_=note("Generate montage without resizing.  Filter by afre 2021 Apr16.\n\n - Set Input layers to All.\n\n") +#@gui :Max Per Row=int(5,1,25) +#@gui :Spacing=int(1,0,10) +#@gui :Matte Colour=color(#e6ffe6) +#@gui Portrait Montage:afre_portraitmontage,afre_portraitmontage_preview(1)+ +#@gui :_=note("Generate portrait montage with resizing.  Filter by afre 2020-2021 Apr18.\n\n - Set Input layers to All.\n - Centre subjects for best results.\n\n") +#@gui :Size=choice(1,"Small","Large") +#@gui :Spacing=int(1,1,20) +#@gui :Matte Shape=choice("None","Circle","Polygon","Star") +#@gui :Matte Colour=color(#e6ffe6) +#@gui Query Primary:afre_queryprimary,afre_queryprimary_preview(1)+ +#@gui :_=note("Query pixel minima, maxima or medians.  Filter by afre 2021 Jul14.\n\n") +#@gui :Mode=choice(1,"Minima","Maxima","Medians") +#@gui :Skip Last Channel=bool(1) +#@gui :_=note("* Disable if image does not have an alpha or transparency channel.\n\n") +#@gui Sharpen FFT:afre_sharpenfft,afre_sharpenfft_preview(0)+ +#@gui :_=note("Sharpen with Fourier transform.  Filter by afre 2019-2020 Jan18.\n\n") +#@gui :Strength=int(15,1,50) +#@gui :Size=int(1,1,10) +#@gui Vigcirc:afre_vigcirc,afre_vigcirc_preview(0)+ +#@gui :_=note("Add circular vignette.  Filter by afre 2019.\n
Instructions:\n\n * Negative strength brightens the periphery.\n\n") +#@gui :Size=int(90,50,150) +#@gui :Strength=int(75,-500,500) +#@gui :Left-Right=int(50,0,100) +#@gui :Up-Down=int(50,0,100) +#@gui Vigrect:afre_vigrect,afre_vigrect_preview(0)+ +#@gui :_=note("Add rectangular vignette.  Filter by afre 2017-2019.\n
Instructions:\n\n * Negative strength brightens the periphery.\n\n") +#@gui :Size=int(50,1,100) +#@gui :Strength=int(75,-500,500) +#@gui :Blur=int(10,1,50) +#@gui :Left-Right=int(50,0,100) +#@gui :Up-Down=int(50,0,100) +#@gui _Chris From Pixls.Us +#@gui Remove Scratches:fx_remove_scratches,fx_remove_scratches_preview(0) +#@gui :_=note("Note: Scratch removal for scanned film images") +#@gui :_=separator() +#@gui :Threshold=float(72,0,100) +#@gui :Erosion=int(2,0,5) +#@gui :Dilation=int(4,0,7) +#@gui :Show Preview After=choice(3,"Threshold","Erosion","Dilation","Final Image") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Chris/Pixls.us. Latest update: 2017/04/01.") +#@gui _Corvo +#@gui Corvo's Painting 5:fx_corvo_painting_5,fx_corvo_painting_5(0) +#@gui :_=note("Polygonize settings") +#@gui :Amplitude=int(35,0,2000) +#@gui :Smoothness=float(10,0,100) +#@gui :Minimal Area=float(10,0,100) +#@gui :Alpha Polygonize=float(0.5,0,1) +#@gui :_=separator() +#@gui :Texture=float(50,0,100) +#@gui :Plasma=float(0.3,0,1) +#@gui :_=separator() +#@gui :_=note("Smooth settings") +#@gui :Amplitude=float(50,0,1000) +#@gui :Gradient Smoothness=float(2,0,10) +#@gui :Tensor Smoothness=float(5,0,10) +#@gui :Alpha Filter=float(1,0,1) +#@gui _Deprecated +#@gui Morphological Filter (Deprecated):fx_morpho,fx_morpho_preview(0) +#@gui :Action=choice("Erosion","Dilation","Opening","Closing","Original - Erosion","Dilation - Original","Original - Opening","Closing - Original") +#@gui :Size=int(5,2,60) +#@gui :Negative=bool() +#@gui :Shape=choice(0,"Square","Octagonal","Circular") +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :Value Action=choice("None","Cut","Stretch") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2014/06/08.") +#@gui __Repair +#@gui Anti Alias:gcd_anti_alias,gcd_anti_alias_preview(0) +#@gui :_=note("Selectively smooth resizing pixelation") +#@gui :_=separator() +#@gui :Smooth Amount=int(60,0,200) +#@gui :Edge Exponent=float(0.3,0,10) +#@gui :Lighten Edges=int(50,0,255) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2013/02/09.") +#@gui _Colors +#@gui Auto Balance:gcd_auto_balance,gcd_auto_balance(1) +#@gui :_=note("Map based tone and color balance") +#@gui :_=separator() +#@gui :Area=float(30,0,200) +#@gui :Smooth=float(0,0,2) +#@gui :Channels=choice(0,"HSI","HSV","Lab","Linear RGB","RGB","YCbCr") +#@gui :Balance SRGB=bool(1) +#@gui :Reduce RAM=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2018/08/08.") +#@gui _Testing +#@gui Garagecoder +#@gui Blend [Feather]:gcd_blend_feather,gcd_blend_feather(1) +#@gui :_=note("Overlay layers seamlessly by feathering edges") +#@gui :_=note("1. Set Input layers to Active & below for two layers") +#@gui :_=note("2. For best results ensure layers are the same size") +#@gui :_=note("\nOutput Options") +#@gui :_=separator() +#@gui :Max Delta=int(100,0,200) +#@gui :Color Transfer=float(0.5,0,1) +#@gui :Hue Extent=float(2,0,6) +#@gui :Remove BG=int(0,0,20) +#@gui :Keep Layers=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2014/05/05.") +#@gui :_=note("\nNotes") +#@gui :_=note("Remove BG can help mask off unwanted areas, which works") +#@gui :_=note("best on objects surrounded by simple backgrounds.") +#@gui :_=note("Overlaying a larger area can sometimes improve the output.") +#@gui Blend [Multiscale]:fx_gcd_blend_multiscale,fx_gcd_blend_multiscale(0) +#@gui :_=note("Alpha blend with multiscale laplacian filter") +#@gui :_=separator() +#@gui :_=note("* Set Input layers to Active & below for two layers") +#@gui :Scales=int(5,1,10) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2022/05/29.") +#@gui :_=note("\nNotes") +#@gui :_=note("Top layer must have an opacity channel") +#@gui :_=note("Blending occurs at the edges of an opaque region") +#@gui :_=note("Higher scales increase blend distance and cpu cost") +#@gui Canny Edge Detection:fx_gcd_canny,fx_gcd_canny(0) +#@gui :_=note("Locate image edges using canny edge detector") +#@gui :_=separator() +#@gui :Sigma=float(1,0,10) +#@gui :Lower Threshold=float(0.05,0,1) +#@gui :Upper Threshold=float(0.15,0,1) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2023/12/04.") +#@gui Colored Signum:fx_gcd_signum_color,fx_gcd_signum_color(1) +#@gui :_=separator() +#@gui :Sigma1=float(0.1,0,1) +#@gui :Sigma2=float(5,0,20) +#@gui :Axes1=choice(2,"Xy","X","Y") +#@gui :Axes2=choice(0,"Xy","X","Y") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2022/11/01.") +#@gui __Repair +#@gui Compression Blur:gcd_comp_blur,gcd_comp_blur_preview(0) +#@gui :_=note("For subtle smoothing of compression artifacts") +#@gui :_=separator() +#@gui :_=note("1. Preview will not show the final result accurately.") +#@gui :_=note("2. Be sure to apply before any image resizing.") +#@gui :_=note("3. Reduce grid width when increasing divisions to avoid over-smoothing.") +#@gui :_=note("4. Set grid divisions to zero for 100% smoothing.\n") +#@gui :_=separator() +#@gui :Grid Divisions=int(2,0,3) +#@gui :Grid Width=int(3,1,3) +#@gui :Grid Smoothing=float(1,0,1) +#@gui :Preserve Edges=int(100,0,100) +#@gui :Colour Channels=bool(1) +#@gui :Boost Smooth=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2015/05/15.") +#@gui _Testing +#@gui Garagecoder +#@gui CRMT Tiles:fx_gcd_crmt_tile,fx_gcd_crmt_tile(1) +#@gui :_=note("Tiling by Clone, Rotate, Mirror, Translate method.") +#@gui :_=separator() +#@gui :Constants=text{"t_w=[w] t_h=[round(1/2*sqrt(3)*$t_w)]"} +#@gui :Render Size=text("[3*$t_w,2*$t_h]") +#@gui :Command List=text(1,"C0 T0 C0 Fo R-60 T[-1/2*$t_w,0]") +#@gui :Inpaint=bool(0) +#@gui :_=separator() +#@gui :_=note("Implementation : Garagecoder. Latest update : 2019/05/10.") +#@gui :_=note("Author: G. Bachelier") +#@gui :_=note("\nWarning: alpha version, don't expect perfection!") +#@gui Cumulative Math:fx_gcd_cumul_math,fx_gcd_cumul_math_preview(1) +#@gui :_=note("Cumulative Math glitch filter") +#@gui :_=separator() +#@gui :Operation=choice(0,"Add","Or","Xor","And","Mod") +#@gui :Amount=int(1,1,512) +#@gui :Step=int(1,1,256) +#@gui :Horizontal=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2018/08/18.") +#@gui Deblur Texture:fx_gcd_blur_deblur_texture,fx_gcd_blur_deblur_texture_preview(0) +#@gui :_=note("Variance-based edge preserving deblur or smooth") +#@gui :_=separator() +#@gui :Iters=int(4,1,20) +#@gui :Sigma=float(1,0,4) +#@gui :Edges=float(0.5,0,1) +#@gui :Action=choice("Deblur","Smooth") +#@gui :Channels=choice(2,"RGB","Linear RGB","Luma","Chroma") +#@gui :Percentage Sigma=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2018/09/02.") +#@gui :_=note("\nNotes") +#@gui :_=note("Iters: overall amount, increases computation time.") +#@gui :_=note("Sigma: detail scale.") +#@gui :_=note("Edges: amount of edge preservation.") +#@gui :_=note("Percentage sigma: make detail scale relative to image size.") +#@gui Depth Blur:gcd_depth_blur,gcd_depth_blur(1) +#@gui :_=note("Selectively blur based on estimated depth") +#@gui :_=note("Amount of blur applied is relative to luminance of the depth map") +#@gui :_=note("\nFocus Options") +#@gui :_=separator() +#@gui :Distance Threshold=int(0,0,100) +#@gui :Blur Amount=int(15,0,100) +#@gui :_=note("\nDepth Map Options") +#@gui :_=separator() +#@gui :Blur Percentage=float(0.25,0,2) +#@gui :Object Ratio=float(2,0,4) +#@gui :Object Tolerance=int(4,0,5) +#@gui :Create/View Depth Map=bool(0) +#@gui :Reverse Map=bool(1) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2013/02/24.") +#@gui Dither SRGB:fx_gcd_dither_srgb,fx_gcd_dither_srgb(0) +#@gui :_=note("Dither sRGB image with selected levels per channel") +#@gui :_=separator() +#@gui :Levels=int(2,2,16) +#@gui :Luminance=bool(1) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2021/10/17.") +#@gui __Black & White +#@gui Emboss:gcd_emboss,gcd_emboss_preview(1) +#@gui :_=note("Make an image look embossed") +#@gui :_=separator() +#@gui :Midpoint=int(128,0,255) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2014/11/11.") +#@gui _Testing +#@gui Garagecoder +#@gui Geometric Color Balance:gcd_geometric_balance,gcd_geometric_balance(1) +#@gui :_=note("Equalize XYZ channel gammas") +#@gui :_=separator() +#@gui :_=note("Input is assumed to be sRGB D65 [0,255]") +#@gui :Target=float(0,0,1) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2019/01/01.") +#@gui :_=note("\nSet target to zero to use input Y geometric mean.") +#@gui Gradient Exponent:fx_gcd_gradient_exponent,fx_gcd_gradient_exponent(1) +#@gui :_=note("Adjust global gradient ratios") +#@gui :_=separator() +#@gui :Exponent=float(0.5,0,2) +#@gui :_=separator() +#@gui :Channels=choice(0,"RGB","HSI","HSV","YCbCr","Lab") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2022/09/02.") +#@gui Image InfoMap:gcd_infomap,gcd_infomap(1) +#@gui :_=note("View images in various informational ways") +#@gui :_=separator() +#@gui :Output=choice("Spectral Tones","Detail Map","JPEG CbCr Detail","Local Equality","Standard Score") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2016/09/26.") +#@gui Inpaint [Clone]:fx_gcd_clone_inpaint,fx_gcd_clone_inpaint(1) +#@gui :_=note("Simple proximity cloning inpaint for object removal") +#@gui :_=separator() +#@gui :Type=choice("Horizontal","Vertical") +#@gui :Bias=choice(1,"Left/Top","None","Right/Bottom") +#@gui :Scale=float(10,1,100) +#@gui :Blend to Boundary=bool(1) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2022/08/08.") +#@gui :_=note("\nNotes") +#@gui :_=note("Transparent regions will be inpainted") +#@gui :_=note("This filter is not automatic: adjust scale as required") +#@gui :_=note("For best results, inpaint a single region with a simple shape") +#@gui Inverse Bezier Warp:gcd_ebwarp,gcd_ebwarp(1) +#@gui :_=note("Horizontal inverse conformal bezier warp") +#@gui :_=separator() +#@gui :Mid=float(0.5,0,1) +#@gui :End=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2016/02/06.") +#@gui :_=link("http://benpaulthurstonblog.blogspot.co.uk/2015/12/ebezier.html") +#@gui __Repair +#@gui JPEG Smooth:gcd_jpeg_smooth,gcd_jpeg_smooth_preview(0) +#@gui :_=note("Quick JPEG cleanup for moderate compression glitches") +#@gui :_=separator() +#@gui :Compression Filter=bool(1) +#@gui :Anti Alias=bool(1) +#@gui :Quick Enlarge=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2013/02/09.") +#@gui _Testing +#@gui Garagecoder +#@gui Layer Manipulation:gcd_layers,gcd_layers_preview(1) +#@gui :_=note("\nTransform") +#@gui :_=separator() +#@gui :Scale=float(100,1,200) +#@gui :Angle=int(0,-90,90) +#@gui :Reduce Only (Requires Two Layers)=bool(1) +#@gui :_=note("\nPosition") +#@gui :_=separator() +#@gui :CentreX=float(0,-50,50) +#@gui :CentreY=float(0,-50,50) +#@gui :_=note("\nEdges") +#@gui :_=separator() +#@gui :Erode=float(0,0,50) +#@gui :Smooth=int(0,0,25) +#@gui :Curvature (Instead of Gaussian)=bool(0) +#@gui :_=note("\nLayer") +#@gui :_=separator() +#@gui :Opacity=float(1,0,1) +#@gui :Mode=choice("Normal","Add","Burn","Darken","Difference","Divide","Dodge","Grain Extract","Grain Merge","Hard Light","Hue","Lighten","Multiply","Overlay","Saturation","Soft Light","Screen","Subtract","Value") +#@gui :Flip=choice("None","Horizontal","Vertical","Both") +#@gui :Match Lower Layer Size=bool(1) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2017/06/05.") +#@gui :_=note("\nNote: preview is low quality for speed") +#@gui __Colors +#@gui LMS Adjustment:gcd_balance_lms,gcd_balance_lms(1) +#@gui :_=note("Chromatically adapt to a new illuminant") +#@gui :_=separator() +#@gui :Long=float(1,0.5,1.5) +#@gui :Medium=float(1,0.5,1.5) +#@gui :Short=float(1,0.5,1.5) +#@gui :_=separator() +#@gui :Adapt Luminance=bool(0) +#@gui :Pre Normalize=bool(0) +#@gui :Auto Balance=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2018/09/08.") +#@gui :_=note("\nNotes") +#@gui :_=note("sRGB D65 input is assumed.") +#@gui :_=note("LMS sliders: control illuminant ratios.") +#@gui :_=note("Adapt Luminance: adjust luminance as well, may cause clipping.") +#@gui :_=note("Pre Normalize: stretch input RGB ranges to maximum.") +#@gui :_=note("Auto Balance: attempt to set neutral grey lighting.") +#@gui _Testing +#@gui Garagecoder +#@gui Local F-Mean:gcd_fx_local_fmean,gcd_fx_local_fmean(1) +#@gui :_=note("Map local f-mean to match global or target") +#@gui :_=separator() +#@gui :Radius=float(15,0,100) +#@gui :Bright=float(0,0,1) +#@gui :Mean=choice(0,"Harmonic","Geometric","Arithmetic","Quadratic") +#@gui :Channels=choice(5,"HSI","HSV","Lab","Linear RGB","RGB","Luminance","YCbCr") +#@gui :Normalize=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2019/05/11.") +#@gui :_=link("https://en.wikipedia.org/wiki/Quasi-arithmetic_mean") +#@gui :_=note("\nNotes") +#@gui :_=note("Set bright to zero to auto match global f-mean") +#@gui :_=note("Normalize will disable bright control for arithmetic and quadratic") +#@gui Multi Thresholds:tran_multi_threshold,tran_multi_threshold(1) +#@gui :_=note("Apply color to selectable tones") +#@gui :_=separator() +#@gui :Threshold 1=int(50,0,255) +#@gui :Threshold 2=int(100,0,255) +#@gui :Threshold 3=int(150,0,255) +#@gui :Threshold 4=int(200,0,255) +#@gui :1st Color=color(#090001) +#@gui :2nd Color=color(#af2a1b) +#@gui :3rd Color=color(#656565) +#@gui :4th Color=color(#aea583) +#@gui :5th Color=color(#f7e4a0) +#@gui :_=separator() +#@gui :_=note("Author : trandoductin. Latest update : 2016/08/25.") +#@gui __Colors +#@gui Normalize Brightness:gcd_normalize_brightness,gcd_normalize_brightness(1) +#@gui :_=note("Normalize brightness across the image") +#@gui :_=separator() +#@gui :Bright=float(0,-2,2) +#@gui :Area=float(10,0,100) +#@gui :Smooth=float(0,0,4) +#@gui :Channels=choice(3,"HSI","HSV","Lab","YCbCr","SRGB") +#@gui :Mask=choice("Normal","Darken","Lighten") +#@gui :Absolute Brightness=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2017/05/27.") +#@gui :_=note("\nTips:\n\nDefault settings for de-haze.") +#@gui :_=note("Large area and Lab for very bright images.") +#@gui :_=note("Small area and HSV for very dark images.") +#@gui :_=note("Medium area and HSV for high contrast images.") +#@gui :_=note("Smooth to reduce artifacts, however some detail may be lost.") +#@gui _Testing +#@gui Garagecoder +#@gui PQCT Example:gcd_pqct,gcd_pqct(1) +#@gui :_=note("Parameterized Quadratic Conformal transformation") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2016/02/07.") +#@gui :_=note("\nBased on example code from:") +#@gui :_=link("http://benpaulthurstonblog.blogspot.co.uk/2015/12/parameterized-quadratic-conformal.html") +#@gui __Details +#@gui Quick Tonemap:fx_gcd_quicktone,fx_gcd_quicktone(1) +#@gui :_=note("Simple tone and detail control") +#@gui :_=separator() +#@gui :Power=float(1,0.5,2.5) +#@gui :Radius=float(4,0,10) +#@gui :Range=float(20,0,20) +#@gui :Smooth=float(0,0,4) +#@gui :Channels=choice(3,"HSI","HSV","Lab","YCbCr") +#@gui :Values=choice(1,"Cut","Normalize") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2018/06/26.") +#@gui _Testing +#@gui Garagecoder +#@gui Recolor:gcd_recol,gcd_recol(1) +#@gui :_=note("Apply colors to a black and white image") +#@gui :_=separator() +#@gui :Min Hue Drift=int(-14,-45,0) +#@gui :Max Hue Drift=int(14,0,45) +#@gui :_=separator() +#@gui :_=note("Note : This filter needs two layers to work properly.") +#@gui :_=note("Original Author : David Tschumperlé") +#@gui :_=note("Adapted by : Garagecoder. Latest update: 2013/01/16.") +#@gui __Details +#@gui Sharpen [Gradient]:gcd_sharpen_gradient,gcd_sharpen_gradient_preview(1) +#@gui :_=note("Sharpen areas with low detail") +#@gui :_=separator() +#@gui :Amount=float(0.5,0,2) +#@gui :Scale=float(2,0.1,2) +#@gui :Values=choice("Cut","Normalize Luma") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2015/09/28.") +#@gui Sharpen [Tones]:gcd_sharpen_tones,gcd_sharpen_tones_preview(1) +#@gui :_=note("Sharpen shadows and highlights") +#@gui :_=separator() +#@gui :Amount=float(1,0,4) +#@gui :Centre=int(128,0,255) +#@gui :Values=choice("Cut","Normalize Luma") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2015/09/28.") +#@gui _Testing +#@gui Garagecoder +#@gui Simple Dehaze:gcd_simple_dehaze,gcd_simple_dehaze(1) +#@gui :_=note("Simple sRGB dehaze") +#@gui :_=separator() +#@gui :Haze=float(0.75,0,1) +#@gui :Exposure=float(1,0,2) +#@gui :Scale=float(0.75,0,25) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2023/04/08.") +#@gui Smart Rotate:gcd_srotate,gcd_srotate(1) +#@gui :_=note("Rotate an image and extrapolate the corners") +#@gui :_=note("\nRotation Options") +#@gui :_=separator() +#@gui :Angle=int(0,-90,90) +#@gui :Centrex=int(50,0,100) +#@gui :Centrey=int(50,0,100) +#@gui :_=note("\nQuality Options") +#@gui :_=separator() +#@gui :Interpolation=choice(1,"Linear","Bicubic") +#@gui :Inpainting=choice(1,"Low","Normal","High","Ultra") +#@gui :Lookup Scale=int(6,1,16) +#@gui :Lookup Factor=float(0.6,0.2,2) +#@gui :Seamless=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2014/12/05.") +#@gui :_=note("\nNotes") +#@gui :_=note("* Dimensions are not altered") +#@gui :_=note("* Quality settings affect speed!") +#@gui :_=note("The preview is a rough guide only. Images with simple edges tend to work best.") +#@gui :_=note("Results can be improved by selecting a higher inpainting quality, but processing will take longer.") +#@gui :_=note("Select seamless to reduce visible seams at the corners.") +#@gui __Repair +#@gui Smooth [Geometric-Median]:fx_gcd_geometric_median,fx_gcd_geometric_median_preview(0) +#@gui :_=note("Smooth using windowed geometric median of vectors") +#@gui :_=separator() +#@gui :Radius=int(3,1,9) +#@gui :Iters=int(12,1,20) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2018/07/18.") +#@gui :_=note("\nNotes") +#@gui :_=note("This prototype filter can be extremely slow to compute!") +#@gui :_=note("Only odd window sizes are currently supported.") +#@gui _Testing +#@gui Garagecoder +#@gui Split Objects:gcd_splitobj,gcd_splitobj_preview(1) +#@gui :_=note("Extract objects from an image to a new layer") +#@gui :_=note("1. Create a new transparent layer, mark background red and objects green") +#@gui :_=note("2. Set Input layers to Active & below, objects will be split to two layers") +#@gui :_=note("\nEdge Detection Options") +#@gui :_=separator() +#@gui :Alpha Min=int(50,0,100) +#@gui :Edge Flow=int(3,0,20) +#@gui :Median=int(3,0,7) +#@gui :_=note("\nOutput Options") +#@gui :_=separator() +#@gui :Swap Layers=bool(0) +#@gui :Grow Alpha=int(0,-20,20) +#@gui :Blur Alpha=int(0,0,20) +#@gui :Opacity=int(40,0,100) +#@gui :Inpainting=choice(0,"Off","Low","Normal","High","Ultra") +#@gui :_=value(0) +#@gui :_=separator() +#@gui :_=note("Note : This filter needs two layers to work properly.") +#@gui :_=note("Author : Garagecoder. Latest update: 2016/01/22.") +#@gui Stereo Video:gcd_stereo_vid,gcd_stereo_vid_preview(1) +#@gui :_=note("Convert a series of image files to 3D") +#@gui :_=note("\nFile Options") +#@gui :_=separator() +#@gui :Start Image=file() +#@gui :End Image=file() +#@gui :Output Folder=_folder() +#@gui :_=note("\n3D Options") +#@gui :_=separator() +#@gui :3D Image Type=choice("Anaglyph: Red/Cyan","Side by Side","Depth Map","Inverse Depth Map") +#@gui :Balance Color=float(0.5,0,1) +#@gui :Depth=float(1.2,0,2) +#@gui :_=note("\nDepth Map Options") +#@gui :_=separator() +#@gui :Blur Percentage=float(0.25,0,2) +#@gui :Object Ratio=float(2,0,4) +#@gui :Object Tolerance=int(4,0,5) +#@gui :Despeckle=bool(1) +#@gui :_=note("\nVideo Options") +#@gui :_=separator() +#@gui :Frame Buffer=_int(5,1,10) +#@gui :Scene Detection=bool(1) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2015/07/02.") +#@gui Target Color Spot:fx_gcd_color_target,fx_gcd_color_target(1) +#@gui :_=note("Use color curves to make the selected point match the target") +#@gui :_=separator() +#@gui :Coordinates=point(50,50,0,1,40,250,60,128,2%)_0 +#@gui :Target Color=color(#afafaf) +#@gui :Chromacity Range=choice("Global","Wide","Narrow") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2022/06/15.") +#@gui :_=note("\nNotes") +#@gui :_=note("Set the target to the desired color for the spot you selected.") +#@gui :_=note("Reduce chromacity range to limit the affected regions.") +#@gui :_=note("sRGB D65 input is assumed.") +#@gui __Colors +#@gui Temperature Balance:gcd_temp_balance,gcd_temp_balance(1) +#@gui :_=note("Auto-detect lighting and adjust color temperature") +#@gui :_=separator() +#@gui :Saturation=float(0,-1,1) +#@gui :Level=float(0,-1,1) +#@gui :Color=float(1,0,2) +#@gui :Lighting=choice("Automatic","Automatic [Scan All Hues]","Standard [No Scan]") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2016/08/30.") +#@gui _Testing +#@gui Garagecoder +#@gui Transfer Colors [Curves]:fx_gcd_color_spot_matching,fx_gcd_color_spot_matching_preview(1) +#@gui :_=note("Use color curves to match the target to the source") +#@gui :_=separator() +#@gui :Source=point(75,75,0,1,0,150,250,128,2%) +#@gui :Target=point(25,25,0,1,250,250,0,128,2%) +#@gui :Chromacity Range=choice(1,"Global","Wide","Narrow") +#@gui :Preview=choice(0,"Vertical","Horizontal","Layers") +#@gui :Swap Layers=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2022/06/15.") +#@gui :_=note("\nNotes") +#@gui :_=note("Ensure the layer dimensions match for best results.") +#@gui :_=note("Reduce chromacity range to limit the affected regions.") +#@gui :_=note("sRGB D65 input is assumed.") +#@gui Undo Unsharp Mask:fx_gcd_undo_unsharp,fx_gcd_undo_unsharp_preview(0) +#@gui :_=note("Reverse the effect of an unsharp mask") +#@gui :_=separator() +#@gui :Radius=float(3,0,30) +#@gui :Amount=float(0.5,0,5) +#@gui :Type=choice(1,"Box","Gaussian") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2021/12/19.") +#@gui :_=note("\nNotes") +#@gui :_=note("Useful for fixing halos due to excessive unsharp mask application.") +#@gui :_=note("For best results, settings should match the original unsharp filter.") +#@gui :_=note("This obviously requires estimation if the settings are unknown.") +#@gui __Repair +#@gui Unquantize [JPEG Smooth]:gcd_unquantize,gcd_unquantize(0) +#@gui :_=note("Remove quantization artifacts") +#@gui :_=note("1. Preview will not show the final result accurately.") +#@gui :_=note("2. Be sure to apply before any image resizing.") +#@gui :_=note("\nBlock Smoothing Options") +#@gui :_=separator() +#@gui :Iterations=int(6,0,8) +#@gui :Preserve Edges=float(1,0,1) +#@gui :Color Channels=bool(1) +#@gui :_=note("\nAnti-Aliasing Options") +#@gui :_=separator() +#@gui :Iterations=int(5,0,30) +#@gui :Threshold=int(15,1,200) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2014/04/29.") +#@gui :_=note("\nNotes") +#@gui :_=note("Useful for removal of common compression and rescaling artifacts.") +#@gui :_=note("* If a specific glitch remains, try reducing edge preservation.") +#@gui :_=note("* For AA only set Block Iterations to 0.") +#@gui Upscale [Edge]:fx_gcd_upscale_edge,fx_gcd_upscale_edge_preview(0) +#@gui :_=note("Edge sharpening upscale") +#@gui :_=separator() +#@gui :Factor=choice(1,"Custom","2","3","4","5","6","7","8") +#@gui :Factor=float(1,1,8)_0 +#@gui :Type=choice(1,"Linear","Bicubic") +#@gui :Values=choice(1,"Unbounded","Cut","Normalize") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2021/01/12.") +#@gui :_=note("\nVariance smoothed upscale for high scale factors.") +#@gui :_=note("Image dimensions are multiplied by specified factor.") +#@gui _Testing +#@gui Garagecoder +#@gui Upscale [Noise]:gcd_upscale_noise,gcd_upscale_noise_preview(0) +#@gui :_=note("Upscale 2x using randomized estimation of original") +#@gui :_=separator() +#@gui :Noise=int(16,0,32) +#@gui :Iters=int(2,1,3) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2018/08/08.") +#@gui :_=note("\nNote: reduce iters and increase noise for poor images.") +#@gui Upscale [Recursive2x]:fx_gcd_upscale_recursive2x,fx_gcd_upscale_recursive2x_preview(0) +#@gui :_=note("Self similarity 2x upscale") +#@gui :_=note("\nQuality Options") +#@gui :_=separator() +#@gui :Kernel=_int(4,0,10) +#@gui :_=note("\nProcessing Options") +#@gui :_=separator() +#@gui :Sharpness=float(0.05,0,0.4) +#@gui :Grain=float(0.01,0,0.1) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2023/02/14.") +#@gui :_=note("\nNotes") +#@gui :_=note("Preview is fixed to lowest quality kernel.") +#@gui :_=note("Kernel size zero will use randomized matching.") +#@gui :_=note("Due to the algorithm some glitches are expected.") +#@gui :_=note("\nWarning: large kernels are slow to compute.") +#@gui :_=note("Image size also affects computation time significantly.") +#@gui Upscale [Solver2x]:fx_gcd_upscale_solver2x,fx_gcd_upscale_solver2x_preview(0) +#@gui :_=note("Anisotropic 2x upscale with optional unsharpening") +#@gui :_=note("\nQuality Options") +#@gui :_=separator() +#@gui :Kernel=_int(4,1,6) +#@gui :_=note("\nUnsharp Options") +#@gui :_=separator() +#@gui :Enabled=bool(0) +#@gui :Radius=float(1,0,30) +#@gui :Amount=float(1,0,5) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2022/12/20.") +#@gui :_=note("\nUsage") +#@gui :_=note("Preview is fixed to lowest quality kernel.") +#@gui :_=note("Very small images tend to require a small kernel.") +#@gui :_=note("Enable unsharpening to counteract prominent halos.") +#@gui :_=note("\nWarning: large kernels are slow to compute.") +#@gui :_=note("Image size also affects computation time significantly.") +#@gui Warp Map:gcd_warpmap,gcd_warpmap(1) +#@gui :_=note("Warp an image using another as a surface") +#@gui :_=separator() +#@gui :Depth=float(5,0,100) +#@gui :Detail=float(0,0,10) +#@gui :Smoothness=float(0,0,10) +#@gui :Blend Mode=choice("Warp","Multiply","Softlight","None") +#@gui :Swap Layers=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2013/02/09.") +#@gui :_=note("\nNotes") +#@gui :_=note("The top layer will be warped using the bottom layer as a surface.") +#@gui :_=note("\nDepth: Set the apparent depth of the surface.") +#@gui :_=note("Detail: Perform second warp with no smooth for fine detail.") +#@gui :_=note("Smooth: Set low for emboss, high to wrap around large objects.") +#@gui __Rendering +#@gui Wiremap:gcd_wiremap,gcd_wiremap(1) +#@gui :_=note("Turn an image into a wireframe map") +#@gui :_=separator() +#@gui :Segments=int(100,4,400) +#@gui :Depth=int(100,4,400) +#@gui :Smoothness=float(0.5,0,2) +#@gui :Distance=float(0.5,-2,2) +#@gui :Output=choice("Black & White","Color","Transparent Black & White","Transparent Color") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2016/01/27.") +#@gui :_=note("\nWarning: can be extremely slow with high segments!") +#@gui :_=note("Lower layer will be used for color if available.") +#@gui _Testing +#@gui Garagecoder +#@gui Xbr2x:gcd_xbr2x,gcd_xbr2x(1) +#@gui :_=note("Implementation of the xBR 2x [noblend] algorithm by Hyllian.") +#@gui :_=link("http://code.google.com/p/2dimagefilter/wiki/ImageResizer") +#@gui :_=separator() +#@gui :_=note("Author : Garagecoder. Latest update : 2013/05/29.") +#@gui :_=note("Disclaimer : This is a near complete recode based on C# source from ImageResizer") +#@gui :_=note("The results may not fully represent the original routine!") +#@gui _Gentlemanbeggar +#@gui 60's Cinema:fx_gb_cfx,fx_gb_cfx_preview(0) +#@gui :Grain=float(10,0,25) +#@gui :Noon for Midnight=bool(0) +#@gui :GeneKelly=bool() +#@gui :RayHarryhausen=bool() +#@gui :CaryGrant=bool() +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("\nUsage Notes: Set Output mode to 'New Layer'. After running filter, I recommend setting the newly created layer blend mode to 'hard light' when using 'noon for midnight' and 'soft light' for other images. This filter looks best on well lit scenes.") +#@gui About:_none_,gui_gb_about +#@gui :_=note{" ( Gentlemanbeggar?s Filter Set for G'MIC)\n\nis proposed to you by"} +#@gui :_=note("Gentlemanbeggar") +#@gui :_=note("\n") +#@gui :_=separator() +#@gui :_=note(" The source code of this filter is available at :") +#@gui :_=link("http://gentlemanbeggar.wordpress.com") +#@gui :_=separator() +#@gui :_=note("\nThe filters in this folder are still under development and may be subject to changes.") +#@gui Lens Blur:fx_gb_lb,fx_gb_lb_preview(0) +#@gui :_=note("\nUsage Notes: Set Output mode to 'New image' or 'in place' to simply reverse the frames in this image. Set mode to 'New layers' to add the reversing effect to your current image.") +#@gui :Amplitude=float(10,5,20) +#@gui :Bokeh=float(7,0,20) +#@gui :_=separator() +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui Ping Pong:fx_gb_pp,gui_no_preview +#@gui :_=note("\nUsage Notes: Set Output mode to 'New image' or 'in place' to simply reverse the frames in this image. Set mode to 'New layers' to add the reversing effect to your current image.") +#@gui _Gmic Tutorials +#@gui Blur by Color:gtutor_blur_img,gtutor_blur_img_preview +#@gui :Range=choice(3,"XL","VL","L","N","M","VM","XM") +#@gui :Amplitude=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Author: Garry R. Osgood. Latest update: 2014/08/30.") +#@gui :_=link("Blur by color instructions and tutorial.","https://gmic.eu/oldtutorial/blur-by-color-filter.shtml") +#@gui __Patterns +#@gui Hedcut (Experimental):hedcut,gtutor_hedcut_preview(0) +#@gui :_=note("Photometric:") +#@gui :Contrast=float(0.5,0,1) +#@gui :Luminance Level=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Pattern:") +#@gui :Smoothing=float(0.5,0,1) +#@gui :Size=float(0.0,0,1) +#@gui :Step=float(0.5,0,1) +#@gui :_=note("Choice:") +#@gui :Quality=bool(0) +#@gui :Force Gray=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Garry R. Osgood. Latest update: 2015/03/05.") +#@gui :_=link("Hedcut instructions and tutorial","https://gmic.eu/oldtutorial/hedcut-filter.shtml") +#@gui _Testing +#@gui Gmic Tutorials +#@gui Rectangular Tiling:_rec_tileit,gtutor_rectangular_tiling_preview +#@gui :_=note("Generate a mosaic from an image. Works best with line art cartoons with flat color.") +#@gui :_=separator() +#@gui :Tile Size=float(1.0,0.05,5.0) +#@gui :Disrupt Orientation=float(5.0,0.0,10.0) +#@gui :Spread Tiles Apart=float(1.5,0.25,5.0) +#@gui :Fill Holes=bool(1) +#@gui :Color Count=int(4,2,32) +#@gui :Flat Color=bool(0) +#@gui :Light Angle=float(45.0,-180,180) +#@gui :Soften Lighting=float(0.5,0.0,5.0) +#@gui :_=note(Author: Garry R. Osgood. Latest Update: 2021/29/05) +#@gui :_=link("Technical Notes",https://gmic.eu/tutorial/tiled_art.html) +#@gui _Iain Fergusson +#@gui 2D Scopes:iain_2d_scopes,iain_2d_scopes(1) +#@gui :Y Axis=choice(1,"Yuv","YUv","YuV","Hsv","HSv","HsV","Lab","LAb","LaB","LCh","LcH","Cmyk","CMyk","CmYk","CmyK","Rgb","RGb","RgB") +#@gui :X Axis=choice(2,"Yuv","YUv","YuV","Hsv","HSv","HsV","Lab","LAb","LaB","LCh","LcH","Cmyk","CMyk","CmYk","CmyK","Rgb","RGb","RgB") +#@gui :Type=choice(2,"Dots","Circles","Circles Scaled by Luma","Heat Map") +#@gui :Colour Bits=int(6,1,8) +#@gui :Plot Size=int(512,64,1024) +#@gui :Max Samples=int(2048,16,4096) +#@gui :Chart Elements=choice(1,"No Info","Axes","Underlay") +#@gui :Generate Test Colours=bool(0) +#@gui :Mirror Y Axis=bool(0) +#@gui :Mirror X Axis=bool(0) +#@gui :Rotate=choice(0,"0","90","180","270") +#@gui Anisotropic Tutorial:iain_smooth_tutorial,iain_smooth_tutorial(0) +#@gui :Amplitude=float(1000,0,2000) +#@gui :_=separator() +#@gui :_=note("Edge Sensitivity") +#@gui :Sharpness=float(0.5,0,2) +#@gui :_=separator() +#@gui :_=note("Directionality") +#@gui :Anisotropy=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Swirl") +#@gui :Gradient Smoothness=float(0.6,0,20) +#@gui :_=separator() +#@gui :_=note("Align") +#@gui :Tensor Smoothness=float(1.1,0,20) +#@gui :_=separator() +#@gui :Show Tensor Field=choice(0,"Hidden","Overlay","Exclusive") +#@gui :Show Gradient Blur=bool(0) +#@gui Auto WB by Hue Variance:iain_auto_wb,iain_auto_wb_preview(1) +#@gui :_=note("Restrict analysis to this box") +#@gui :Corner 1=point(5,5,0,1,255,255,255,128,10) +#@gui :Corner 2=point(95,95,0,1,255,255,255,128,10) +#@gui :_=separator() +#@gui :Normalise=bool(1) +#@gui :Negative=bool(0) +#@gui :_=separator() +#@gui :_=note("This filter finds the white balance of the image by maxiumising the variation of hues. The area for analysis should contain a range of hues. Do not try to select a neutral grey area.") +#@gui Automixer:automixer,automixer(0) +#@gui :Output Colour Difference=bool(0) +#@gui :Use Partial Image for Noise Calculation=bool(0) +#@gui :_=separator() +#@gui :_=note{"This filter creates a black and white mage with the most pleasant noise characteristics (IMHO). It measures the noise in each colour channel and scales each channel so that the noise levels are even and produces a greyscale output and optionally an extra image with the colour information."} +#@gui :_=note("Author : Iain Fergusson. Latest update : 2012/10/26") +#@gui Brown Spot Clean:iain_brown_spot_clean,iain_brown_spot_clean(0) +#@gui :Red/Green Radius=int(1,1,7) +#@gui :Blue Radius=int(2,1,7) +#@gui CA Correction:iain_CA_correction,iain_CA_correction_pr(0) +#@gui :Blue Adjustment=float(0,-5,5) +#@gui :Red Adjustment=float(0,-5,5) +#@gui :Interpolation Quality=choice(2,"Low","Med","High") +#@gui :_=separator() +#@gui :Preview Shows=choice("Output","Colours Only") +#@gui :Preview Corner=choice(3,"North-West","Northeast","Southeast","South-West") +#@gui :_=note("The preview is only accurate for the corners. Make sure you navigate to the same corner as selected above. ") +#@gui Detect Moire:iain_detect_moire,iain_detect_moire_preview(0) +#@gui :Threshold=float(50,0,100) +#@gui :Mask Size=float(5,0,100) +#@gui :Expand/Contract=int(9,-50,50) +#@gui :_=separator() +#@gui :Preview Saturation=float(30,0,100) +#@gui :_=separator() +#@gui :_=note("Detect Moire on bayer patterns. Requires RGB bayer image as input. Output is a black and white mask.") +#@gui :_=note("Preview shows mask boundary on top of a fast demosaic that will show more moire than a good demosaicing algorithm.") +#@gui __Details +#@gui Easy Skin Retouch:iain_easy_skin_retouch,iain_easy_skin_retouch_preview(0) +#@gui :_=note("Base Smoothing") +#@gui :Edge Sensitivity=float(7,0,25) +#@gui :Iterations=int(2,1,5) +#@gui :Low Bias=float(.7,0,1) +#@gui :_=separator() +#@gui :_=note("Detail Intensity") +#@gui :_=note("If preview appears dark, increase size of preview window.") +#@gui :On=bool(1) +#@gui :Very Fine=float(1,0,2) +#@gui :Fine 2=float(.7,0,2) +#@gui :Medium 3=float(.6,0,2) +#@gui :Course 4=float(.5,0,2) +#@gui :Very Course 5=float(.5,0,2) +#@gui :Reduce Redness=float(.5,0,1) +#@gui :_=separator() +#@gui :Split Base and Detail Output=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: Iain Fergusson - update 12 May 2013 - now handles alpha channel and some internal changes") +#@gui _Testing +#@gui Iain Fergusson +#@gui Exfuse:exfuse,exfuse +#@gui :Exposure=float(1,0,2) +#@gui :Contrast Bias=float(0.6,0,1) +#@gui :Saturation Bias=float(0,0,1) +#@gui :Exposure Sigma=float(0.5,0,1) +#@gui :Exposure Bias=float(1,0,1) +#@gui :Blur=float(5,0,50) +#@gui Exfusion:exfusion,exfusion +#@gui :Width=float(20,0,50) +#@gui Exfusion3:exfusion3,exfusion3 +#@gui :Contrast Bias=float(0.3,0,1) +#@gui :Saturation Bias=float(0.3,0,1) +#@gui :Exposure Sigma=float(0.2,0,1) +#@gui :Exposure Bias=float(0.3,0,1) +#@gui :_=separator() +#@gui :Maxlevels Adjust=int(-1,-5,0) +#@gui :Base Level Median Stack=bool(0) +#@gui :_=separator() +#@gui :_=note("Pyramid levels are calculated automatically, but you can reduce the number of pyramid levels to save memory. You can choose how the base level is fused, by using weight maps like normal, or by using a median of the image stack") +#@gui Exfusion5:exfusion5,exfusion5 +#@gui :Contrast Bias=float(0,0,1) +#@gui :Saturation Bias=float(.2,0,1) +#@gui :Exposure Sigma=float(0.2,0,1) +#@gui :Exposure Bias=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Post Fusion Options") +#@gui :Local Contrast=float(0,0,3) +#@gui :Curve=float(0,-127,127) +#@gui Fast Formula:iain_fast_formula,iain_fast_formula +#@gui :Apply Formula=text("apply_gamma 2.2") +#@gui Fast Median Stack:iain_fast_median_stack,iain_fast_median_stack +#@gui :_=note("This filter gives the median value of the input images at each pixel location and therefore a single input image will have no change. Two input images will be averaged.") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. Update 16 December 2014 - filter now accepts any number of images. ") +#@gui :_=note("Author : Iain Fergusson. Update 8 March 2013 - Combined median_3_stack and median_5_stack into this filter, added median_4_stack and added auto-select based on number of input images. ") +#@gui FFT Tile:fft_tile,fft_tile_preview(0) +#@gui :Threshold=float(500,0,50000) +#@gui :Tile Size=int(128,16,256) +#@gui :Fast=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. Latest update : 2012/08/08") +#@gui Fill Holes:fill_holes,fill_holes_preview(0) +#@gui :Morph Radius=int(11,3,50) +#@gui :Edge Radius=int(21,0,50) +#@gui :Close Radius=int(5,0,10) +#@gui :Channel(s)=choice(0,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :Fill Light Colours=bool(0) +#@gui :Fast=bool(1) +#@gui :_=separator() +#@gui :_=note("Set Morph radius to close holes, set Edge radius to restore edges, set Close radius to fill small holes near the edge") +#@gui :_=note("Author : Iain Fergusson. Latest update : 28 August 2012 - added 'fast' option") +#@gui Grey Descreen:iain_descreen2,iain_descreen2(0) +#@gui :Analysis Cindow=float(3,0,20) +#@gui :Strength=float(-10000,-10000,10000) +#@gui :Range=float(10,0,20) +#@gui __Patterns +#@gui Halftone Shapes:iain_halftone_shapes,iain_halftone_shapes(0) +#@gui :Scale=float(100,5,200) +#@gui :Negative=bool(0) +#@gui :Shape=choice("Circle","Star","Triangle","Heart") +#@gui :Oversample=bool(0) +#@gui :Rotate=float(0,0,180) +#@gui :Twirl=float(0,0,2) +#@gui :Turn on Rotate and Twirl=bool(0) +#@gui :_=separator() +#@gui :_=note("Oversample gives smoother results but takes much longer.") +#@gui :_=note("Twirl distorts the hafltone grid. The preview is not accurate. For best results use with oversample.") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson.") +#@gui _Testing +#@gui Iain Fergusson +#@gui Heart Tone:iain_hearttone,iain_hearttone(0) +#@gui :Scale=float(100,10,200) +#@gui :Enhance Details=float(0,0,10) +#@gui Iain 2x:iain_2x,iain_2x(0) +#@gui Iain Demosaic:iain_demosiac,iain_demosiac(0) +#@gui :Starting Pattern=choice(0,"Red-Green","Blue-Green","Green-Red","Green-Blue") +#@gui :_=separator() +#@gui :_=note("Author: Iain Fergusson - released 6 June 2013") +#@gui Iain Denoise 2019 Beta3:iain_denoise_2019_beta3,iain_denoise_2019_beta3_preview(0) +#@gui :Gamma=float(1,.05,2) +#@gui :Shadows=float(0,-1,1) +#@gui :Light=float(0,-1,1) +#@gui :Mid Offset=float(0,-0.5,0.5) +#@gui :Desaturate=float(0.5,0,1) +#@gui :Guide Mix=float(1,0,1) +#@gui :Soften Guide=bool(0) +#@gui :Fine=float(5,0,30) +#@gui :Mid=float(3,0,30) +#@gui :Large=float(0,0,30) +#@gui :Lookup=int(3,1,7) +#@gui :Recovery=choice(0,"No Recovery","Fast Recovery","Slow Recovery","Guide Recovery") +#@gui :Recover=float(.5,0,2) +#@gui :Preview Shows=choice(4,"Noise","Fine Noise","Mid Noise","Large Noise","Output") +#@gui :Preview Tones Map=bool(0) +#@gui Iain Remove Pattern:iain_remove_pattern,iain_remove_pattern_preview(0) +#@gui :_=note("Smooth") +#@gui :Pre-Blur=float(3,1,50) +#@gui :Smoothness=float(3,1,14) +#@gui :Radius=float(3,1,40) +#@gui :_=separator() +#@gui :_=note("Recover detials") +#@gui :Recover Details=bool(0) +#@gui :Recovery Amount=float(4,0,10) +#@gui :Tile Size=int(128,16,512) +#@gui :Quality=choice(1,"1","3","5","Super Slow") +#@gui :_=separator() +#@gui :Preview=choice(0,"Output","FFT of Input","FFT of Output","FFT Difference") +#@gui :_=separator() +#@gui :_=note("This filter remove patterns by eliminating peaks in frequency domain while protecting edges.") +#@gui :_=note("Stage 1 Pre-blur: Create a guide image that has the pattern blured out") +#@gui :_=note("Stage 2 Smooth: Use guide image to do edge-protected smoothing. Make sure pattern is removed before trying to recover detials.") +#@gui :_=note("Stage 3 Detials: Recover detials by keeping non-peaks the the frequency domain.") +#@gui Iain Star Burst:iain_star_burst,iain_star_burst(0) +#@gui :Threshold=int(254,0,255) +#@gui :Radius=float(50,1,255) +#@gui :Intensity=float(5,0,10) +#@gui :Rotate=int(45,0,90) +#@gui :Lines=int(2,1,10) +#@gui :Colour Modify=bool(0) +#@gui :Output Stars Only=bool(0) +#@gui Iain Unindex:iain_unindex,iain_unindex_preview(0) +#@gui :Smooth=float(30,0,100) +#@gui :Edge Threshold=float(20,0,50) +#@gui :Preview Zoom=bool(1) +#@gui :Zoom Center H=float(50,0,100) +#@gui :Zoom Center V=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Author: Iain Fergusson - released 19 Feb 2013") +#@gui Iain Weightmap:iain_weightmap,iain_weightmap +#@gui :Lap Weight=float(1,0,4) +#@gui :Blur Width=float(40,0,100) +#@gui Iain's Noise Reduction Old:iain_iains_nr,iain_iains_nr_preview(0) +#@gui :1 Luma NR=float(3,0,20) +#@gui :2 Chroma NR=float(3,0,20) +#@gui :3 Despeckle=int(1,0,4) +#@gui :_=note(" Adjust noise reduction by tone") +#@gui :4 Highlights=float(0,-50000,50000) +#@gui :5 Shadows=float(0,-32000,32000) +#@gui :_=separator() +#@gui :_=note("Recover Details") +#@gui :6 Recover Details=choice(0,"Do Not Recover Details","Recover Details","Recover Details as Separate Layer") +#@gui :7 Recovery Amount=float(1,.1,10) +#@gui :_=note(" Adjust detial recovery by size") +#@gui :8 Adjust Fine Details=float(0,-500,500) +#@gui :9 Adjust Medium Details=float(0,-500,500) +#@gui :10 Adjust Large Details=float(0,-500,500) +#@gui :11 Detail Emphasis=float(1.35,1,4) +#@gui :_=separator() +#@gui :12 Sharpen Edges=float(0,0,4) +#@gui :_=note("Preview options") +#@gui :13 Preview Shows=choice(0,"Normal Output","Luma Noise","Chroma Noise","Details") +#@gui :_=separator() +#@gui :_=note("Author: Iain Fergusson - update 10 Jan 2013") +#@gui Iain Highlight Synthesis:iain_highlight_synthesis,iain_highlight_synthesis(0) +#@gui :Red=float(1,0,2) +#@gui :Green=float(0.6,0,2) +#@gui :Blue=float(1,0,2) +#@gui :Rgb to Srgb=bool(0) +#@gui IID Demosaic:iain_iid_demosaic,iain_iid_demosaic(0) +#@gui :1 Starting Pattern=choice(1,"Red-Green","Blue-Green","Green-Red","Green-Blue") +#@gui :2 Clamp Radius=int(1,1,3) +#@gui :3 Refinement Steps=int(1,0,10) +#@gui :4 Reduce Moire=bool(0) +#@gui :_=separator() +#@gui :5 Use Gamma Adjustment=bool(0) +#@gui :_=separator() +#@gui :_=note("IID is a demosaicing algorithm that produces good colour detail and works well in the presence of chromatic aberrations. It attempts to reduce moire patterns. Noise tends to render as a maze like texture.") +#@gui :_=separator() +#@gui :_=note("Clamp Radius: Interploated green pixels are clamped to local values. A clamp radius of 1 reduces ringing and overshoots but may limit some detials. A clamp radius of 3 will give more detials but also more ringing and overshoots. Not much difference can been seen unless you zoom in.") +#@gui :_=note("Refinement Steps: Uses the initital demosaic as a guide for a new partial demosaic, and can be repeated. Each step gives better luma details and noise rendering but degrades chroma edges. Use a low value of clamp radius to reduce arefacts but also the effectiveness. Two or three refinements steps is probably the sweet spot.") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. 25 March 2017 - First release") +#@gui Luminance NR2:luminance_nr_two,luminance_nr_two(0) +#@gui :Patch Variance=float(10,0.1,20) +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(1,1,5) +#@gui :_=separator() +#@gui :_=note("Adjust NR for for larger scales as %") +#@gui :Scale 2=float(.8,0,1) +#@gui :Scale 3=float(.7,0,1) +#@gui :Scale 4=float(.6,0,1) +#@gui :Scale 5=float(.5,0,1) +#@gui :Scale 6=float(.4,0,1) +#@gui :Scale 7=float(.3,0,1) +#@gui :_=separator() +#@gui :_=note("Master threshold for details") +#@gui :Threshold=float(1200,0,10000) +#@gui :Tile Size=int(64,32,128) +#@gui :Nothing=float(0,0,0) +#@gui :_=separator() +#@gui :_=note("Adjust threshold for detials") +#@gui :Fine=float(0,-1000,1000) +#@gui :Medium=float(0,-1000,1000) +#@gui :Course=float(0,-1000,1000) +#@gui :Recover Details=bool(0) +#@gui :_=separator() +#@gui :_=note("Adjust noise reduction by tone") +#@gui :Blacks=int(0,0,500) +#@gui :Darks=int(0,0,500) +#@gui :Midtones=int(0,0,500) +#@gui :Lights=int(0,0,500) +#@gui :White=int(0,0,500) +#@gui :_=separator() +#@gui :Median Pass First=bool(0) +#@gui :_=note("This filter is slow!") +#@gui :_=note("Author : Iain Fergusson. Latest update : 25 August 2012") +#@gui Minimum Chroma Demosaic:iain_minimum_chroma_demosaic,iain_minimum_chroma_demosaic(0) +#@gui :Starting Pattern=choice(0,"Red-Green","Blue-Green","Green-Red","Green-Blue") +#@gui :Moire Size=choice(2,"Small","Medium","Large","Extra Large") +#@gui :Details=choice(0,"Less Detial but Better Colour Edges","More Detial but Degraded Colour Edges") +#@gui __Repair +#@gui Moire Removal:iain_moire_removal,iain_moire_removal(0) +#@gui :Smoothing=float(5,0,20) +#@gui :Smart Threshold=float(5,0,10) +#@gui :Moire Removal Method=choice(0,"Smart","Aggresive","Smooth Only") +#@gui :_=separator() +#@gui :_=note("Moire removal consists of two parts, first, an edge-protected smoothing and second a frequency analyisis of the difference between the smoothed and original image. The image is broken into tiles, and each tile processed. A tile that is a solid colour is skipped.") +#@gui :_=note("Smoothing must be high enough to remove the moire. The Smart Threshold sets the detection of moire for each frequency on each colour channel. If a frequency in one colour channel is determined to be moire it is replaced by the colour channel least likely to have moire.") +#@gui :_=note("The Agressive setting skips the thresolding step and uses the lowest frequency level from the colour channels.") +#@gui :_=note("The filter will reduce chroma details/noise") +#@gui _Testing +#@gui Iain Fergusson +#@gui Moire Removal Not Parallel:iain_moire_removal_NP,iain_moire_removal_NP(0) +#@gui :Smoothing=float(5,0,20) +#@gui :Smart Threshold=float(5,0,10) +#@gui :Moire Removal Method=choice(0,"Smart","Aggresive","Smooth Only") +#@gui :_=separator() +#@gui :_=note("This filter is the same as the other one but doe snot have parallel processing") +#@gui :_=separator() +#@gui :_=note("Moire removal consists of two parts, first, an edge-protected smoothing and second a frequency analyisis of the difference between the smoothed and original image. The image is broken into tiles, and each tile processed. A tile that is a solid colour is skipped.") +#@gui :_=note("Smoothing must be high enough to remove the moire. The Smart Threshold sets the detection of moire for each frequency on each colour channel. If a frequency in one colour channel is determined to be moire it is replaced by the colour channel least likely to have moire.") +#@gui :_=note("The Agressive setting skips the thresolding step and uses the lowest frequency level from the colour channels.") +#@gui :_=note("The filter will reduce chroma details/noise") +#@gui MS NL-Means C Noise2:ms_nlmeans_c_noise2_p,ms_nlmeans_c_noise2_p_preview(0) +#@gui :_=note("Noise Reduction") +#@gui :1 Fine=float(3,0,10) +#@gui :2 Coarse=float(1,0,10) +#@gui :3 Blacks=float(0,-10,10) +#@gui :4 Shadows=float(0,-10,10) +#@gui :5 Midtones=float(0,-10,10) +#@gui :6 Highlights=float(0,-10,10) +#@gui :7 Whites=float(0,-10,10) +#@gui :8 Smooth Curve=float(10,0,50) +#@gui :_=separator() +#@gui :_=note("Advanced settings") +#@gui :9 Patch Size=float(2,1,10) +#@gui :10 Search Radius=int(4,1,10) +#@gui :11 Patch Size=float(2,1,10) +#@gui :12 Search Radius=int(7,1,10) +#@gui :_=separator() +#@gui :_=note("Side chain Processing") +#@gui :13 Red/Blue Median=bool(0) +#@gui :14 Green Despeckle=bool(0) +#@gui :_=separator() +#@gui :15 Use Noise Estimate=bool(0) +#@gui :_=separator() +#@gui :16 Show Info=bool(0) +#@gui MS Patch Chroma:ms_patch_c,ms_patch_c_preview(0) +#@gui :_=note{"Master Patch based smoothing (scale 1)"} +#@gui :Patch Variance=float(5,0.1,50) +#@gui :Median Pass=bool(1) +#@gui :Global Iterations=int(1,1,5) +#@gui :_=separator() +#@gui :Scale 2=float(5,0,25) +#@gui :Scale 3=float(4,0,25) +#@gui :Scale 4=float(3,0,25) +#@gui :Scale 5=float(2,0,25) +#@gui :Scale 6=float(1,0,25) +#@gui :Scale 7=float(1,0,25) +#@gui :Undo Gamma=float(1.3,1,3) +#@gui :_=separator() +#@gui :_=note("Customise Luma weighting") +#@gui :Red=float(0.375,0,1) +#@gui :Green=float(.5,0,1) +#@gui :Blue=float(0.125,0,1) +#@gui :_=separator() +#@gui :Show Difference=bool(0) +#@gui :_=note("Author : Iain Fergusson. Latest update : 10 December 2012 - added show difference option and changed interations from local operation to global operation.") +#@gui MS Patch NR:MS_Patch_NR,MS_Patch_NR(0) +#@gui :Gamma=float(1.3,.5,2) +#@gui :Fine=float(0,0,250) +#@gui :Coarse=float(0,0,250) +#@gui :Coarsest=float(0,0,250) +#@gui :Patch Size=int(3,3,7) +#@gui :Search Radius=int(5,3,17) +#@gui MS Patch NR3:MS_Patch_NR3,MS_Patch_NR3_p(0) +#@gui :Gamma=float(1.3,.5,2) +#@gui :L Fine=int(0,0,250) +#@gui :L Coarse=int(0,0,250) +#@gui :L Coarsest=int(0,0,250) +#@gui :Patch Size=int(3,3,7) +#@gui :Search Radius=int(5,3,17) +#@gui :Fast=choice(1,"Smooth","Fast") +#@gui :Pre-Salt and Pepper=choice(0,"None","Smooth","Fast","Strong") +#@gui :Post-Salt and Pepper=choice(0,"None","Smooth","Fast","Strong") +#@gui :C Fine=int(0,0,250) +#@gui :C Coarse=int(0,0,250) +#@gui :C Coarsest=int(0,0,250) +#@gui Multi Scale Patch Smoothing:ms_patch_smooth,ms_patch_smooth_preview(0) +#@gui :_=note{"Normal Patch based smoothing (scale 1)"} +#@gui :Spatial Variance=float(10,0,20) +#@gui :Patch Variance=float(5,0.1,50) +#@gui :Patch Size=int(3,2,21) +#@gui :Lookup Size=int(5,2,21) +#@gui :Patch Smoothness=float(0,0,4) +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(1,1,5) +#@gui :Channel(s)=choice(7,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :_=separator() +#@gui :_=note("Patch Variance for additional scales") +#@gui :Scale 2=float(5,0,25) +#@gui :Scale 3=float(4,0,25) +#@gui :Scale 4=float(3,0,25) +#@gui :Scale 5=float(2,0,25) +#@gui :Scale 6=float(1,0,25) +#@gui :Scale 7=float(1,0,25) +#@gui :Undo Gamma=float(1.3,1,3) +#@gui :_=separator() +#@gui :Show Difference=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. Latest update : 28 August 2012 - minor speed up, but level 7 does not do anything now.") +#@gui Multi Scale Smoothing:ms_smooth,ms_smooth_preview(0) +#@gui :Smooth Scale 1=float(0,0,100) +#@gui :Smooth Scale 2=float(0,0,100) +#@gui :Smooth Scale 3=float(0,0,100) +#@gui :Smooth Scale 4=float(0,0,100) +#@gui :Smooth Scale 5=float(0,0,100) +#@gui :Smooth Scale 6=float(0,0,100) +#@gui :Smoothness=float(2,0,15) +#@gui :Log Scales=bool(0) +#@gui :Global Repeats=int(2,0,5) +#@gui :Show Difference=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: Iain Fergusson - update 7 Dec 2012") +#@gui Noise Reduction 5:nr5,nr5_preview(0) +#@gui :1 Luma Denoise=float(1.6,0,10) +#@gui :2 Colour Denoie=float(5,0,20) +#@gui :_=separator() +#@gui :3 Recover Details=bool(1) +#@gui :4 Amount=float(1,0.1,10) +#@gui :_=separator() +#@gui :_=note(" sharpen details") +#@gui :5 Radius=float(.75,.25,5) +#@gui :6 Amount=float(3,0,10) +#@gui :7 Threshold=float(0,0,100) +#@gui :_=separator() +#@gui :_=note(" sharpen edges") +#@gui :8 Radius=float(.75,.25,5) +#@gui :9 Amount=float(.5,0,10) +#@gui :10 Threshold=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("Advanced options") +#@gui :11 Base Luma Method=choice(1,"Wavelet","Multi-Scale Patch Smoothing","Semi-Auto MS Patch","Median First MS Patch","Multi Scale Median") +#@gui :12 Chroma Method=choice(1,"Wavelet","Multi-Scale Patch Smoothing") +#@gui :_=separator() +#@gui :13 Adjust Fine Details=float(100,-5000,500) +#@gui :14 Adjust Medium Details=float(0,-5000,500) +#@gui :15 Adjust Large Details=float(-100,-5000,500) +#@gui :_=separator() +#@gui :Experimental Curves=bool(0) +#@gui :Gamma=float(1.3,.3,2) +#@gui :Show Noise=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson. Latest update : 28 November 2012 - added abiltity to view noise") +#@gui PNG Processing:iain_png_processing,iain_png_processing(0) +#@gui :Number of Colours=int(4,2,256) +#@gui :Refine Palette=bool(0) +#@gui :Dither Pattern=choice(0,"Lines","Checkerboard","Diffusion","None") +#@gui :_=separator() +#@gui :Pre Smooth=bool(0) +#@gui :Smooth Radius=float(3,0,20) +#@gui :Smooth Amount=float(3,0,20) +#@gui :_=separator() +#@gui :Pre-Sharpen (Constrained)=bool(0) +#@gui :Sharpen Radius=float(.75,0,10) +#@gui :Amount=float(2,0,10) +#@gui :Threshold=float(1,0,50) +#@gui :Constraint Radius=int(5,0,10) +#@gui :Overshoot=float(0,0,50) +#@gui :_=separator() +#@gui :Post Median=bool(0) +#@gui :Median Radius=int(1,1,10) +#@gui :Median Repeats=int(1,1,5) +#@gui :_=separator() +#@gui :_=note("This filter provides tools to improve the compressabilty or visual quality when creating an indexed image.) +#@gui :_=note("Author : Iain Fergusson. release: 9 September 2018) +#@gui Save Noise Print:iain_savenoiseprint,iain_savenoiseprint_p(0) +#@gui :Pass=choice("Pass 1 Create Noise Print","Pass 2 Remove Noise") +#@gui :Detail Threshold=float(1,0,5) +#@gui :Gamma=float(1.4,1,4) +#@gui :_=note("This filter requires 2 images as input, the bottom image should be noisey and the top image should be the same image only with some kind of noise reduction.") +#@gui :_=note("You need to do 2 passes of this filter to get the results. The first pass analyses the residual noise and creates a noise print and saves it to your computer. On the 1st pass you can click apply and the noise print will be generated after a while. When that has finished switch to 2nd pass and adjust the Detail Threshold to your liking and hit okay or apply.") +#@gui :_=note(" Set output mode to 'New Layers'") +#@gui __Details +#@gui Simple Local Contrast:simplelocalcontrast_p,simplelocalcontrast_p(0) +#@gui :Edge Sensitivity=float(16,0,25) +#@gui :Iterations=int(2,1,5) +#@gui :Paint Effect=float(0,0,50) +#@gui :Channels=choice(1,"Colour","Luminance Only") +#@gui :Pre-Gamma=float(1,.1,5) +#@gui :Post-Gamma=float(1,.1,5) +#@gui :_=separator() +#@gui :_=note("Luminance Mask") +#@gui :Blacks=float(1,0,1) +#@gui :Dark Grey=float(1,0,1) +#@gui :Mid Grey=float(1,0,1) +#@gui :Light Grey=float(1,0,1) +#@gui :Whites=float(1,0,1) +#@gui :_=separator() +#@gui :Parallel Processing=choice(0,"Auto","None") +#@gui :_=separator() +#@gui :_=note("Author: Iain Fergusson - update 18 April 2014 - added parallel processing and luminance mask") +#@gui _Testing +#@gui Iain Fergusson +#@gui Skin Mask:iain_fx_skin_mask,iain_fx_skin_mask_pr +#@gui :_=note("Main Controls") +#@gui :Magenta Ratio=float(55,0,255) +#@gui :Cyan Ratio=float(200,2,255) +#@gui :_=separator() +#@gui :_=note("Refine Hue Range") +#@gui :Remove Reds=float(0,0,255) +#@gui :Remove Yellows=float(0,0,100) +#@gui :_=separator() +#@gui :Output=choice("Masked Image","Just the Mask") +#@gui :Preview Shows=choice(1,"Output","Highlighted Mask") +#@gui :_=separator() +#@gui :_=note("Skin mask uses CMYK colour model to selct skin tones. Skin tones generally have a predictable ratios of Cyan, Magetna and Yellow. Different ethnicies have slighty different ratios. ") +#@gui :_=note("Magenta Ratio: This sets how much the Magenta content is allowed to be below the Yellow content. Increase to include dark skin tones and shadows.") +#@gui :_=note("Cyan Ratio: This set the how much the Cyan content is allowed to be below the Yellow content. Increase to include pale skin tones and highlights.") +#@gui :_=note("Refine Hue Range: This allows you to remove tones that pass through the main controls but are not present in your subject.") +#@gui :_=separator() +#@gui :_=note("Author : Iain Fergusson.") +#@gui Smart Demosaic:iain_smartdemos,iain_smartdemos(0) +#@gui :Starting Pattern=choice(0,"Red-Green","Blue-Green","Green-Red","Green-Blue") +#@gui :Blur Radius=float(1.5,.5,3) +#@gui :Wrong Way-Zippers=float(2,0,5) +#@gui Split Detials [Orientation]:iain_split_orientation,iain_split_orientation_preview(0) +#@gui :Center (%)=point(75,50,0,1) +#@gui :Angle Range=int(45,1,90) +#@gui :Residual Size=float(10,0,50) +#@gui :Snap to Angle=int(5,0,45) +#@gui :Angle Transition=int(5,0,45) +#@gui :Preview Line Only=bool(0) +#@gui :Top Layer=choice(0,"Isolate Orientation","Remove Orientation") +#@gui :Output=choice(1,"Isolated/Removed Only","Isolated/Removed & Residual","Residual Only") +#@gui Star Tone:star_tone,star_tone(0) +#@gui :Scale=float(100,10,200) +#@gui Subtract Cast:iain_sub_cast,iain_sub_cast(0) +#@gui :Noise Reduction=float(5,0,10) +#@gui :Black Level=float(20,0,128) +#@gui :White Level=float(250,128,255) +#@gui __Patterns +#@gui Turbulent Halftone:iain_turbulent_halftone,iain_turbulent_halftone_preview(0) +#@gui :Amplitude=float(15,0,30) +#@gui :Smoothness=float(20,0,40) +#@gui :Orientation=float(0,0,180) +#@gui :Deviation=float(1,0,1) +#@gui :Tile Size=int(512,128,2048) +#@gui :Blob Size=float(0.75,0,4) +#@gui :Colour Model=choice("RGB","CMYK","Luminance") +#@gui :Enhance Detail=float(0,0,10) +#@gui :Oversample=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: Iain Fergusson. Latest update: 2019/09/20 - Improved quality and added oversample.") +#@gui :_=note("Older updates: 2018/08/24.") +#@gui _Testing +#@gui JéJé +#@gui 3D Rendering:jeje_render3d,jeje_render3d_preview +#@gui :Input Image=file() +#@gui :Size=int(8,4,16) +#@gui :Quality=int(6,2,16) +#@gui :Opacity=float(0.1,0,1) +#@gui :Angle X=float(240,0,360) +#@gui :Angle Y=float(0,0,360) +#@gui :Angle Z=float(30,0,360) +#@gui :Zoom=float(1,0,3) +#@gui :Top Color=color(#202040ff) +#@gui :Bottom Color=color(#408060ff) +#@gui :Render=bool(false) +#@gui :_=separator() +#@gui :_=note(Note:Adjust the 3D view first and then enable render to compute the volume rendering.) +#@gui :_=separator() +#@gui :_=note("Author : Jérôme Boulanger. Latest update: 2013/05/29.") +#@gui Deconvolve:jeje_deconvolve,jeje_deconvolve_preview +#@gui :Iterations=int(20,1,100) +#@gui :Algorithm=choice(0,"Richardson-Lucy","Gold-Meinel") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note{"Need two layers (top layer is the blur)
Author : Jérôme Boulanger. Latest update: 2016/22/02."} +#@gui Zernike:jeje_zernike_preview +#@gui :X=float(50,0,100) +#@gui :Y=float(50,0,100) +#@gui :R=float(50,0,100) +#@gui :Piston=float(0,-1,1) +#@gui :Horizontal Tilt=float(0,-1,1) +#@gui :Vertical Tilt=float(0,-1,1) +#@gui :Oblique Astigmatism=float(0,-1,1) +#@gui :Defocus=float(0,-1,1) +#@gui :Vertical Astigmatism=float(0,-1,1) +#@gui :Vertical Trefoil=float(0,-1,1) +#@gui :Vertical Coma=float(0,-1,1) +#@gui :Horizontal Coma=float(0,-1,1) +#@gui :Oblique Trefoil=float(0,-1,1) +#@gui :Oblique Quadrafoil=float(0,-1,1) +#@gui :Oblique Secondary Astigmatism=float(0,-1,1) +#@gui :Primary Spherical=float(0,-1,1) +#@gui :Vertical Secondary Astigmatism=float(0,-1,1) +#@gui :Vertical Quadrafoil=float(0,-1,1) +#@gui :Binarize=bool(false) +#@gui :Period=float(0,0,256) +#@gui :Cycle Ratio=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("https://en.wikipedia.org/wiki/Zernike_polynomials
Author : Jérôme Boulanger. Latest update: 2018/03/12.") +#@gui _Jayprich +#@gui About:_none_,jpr_about +#@gui :_=note("@jayprich filters for G'MIC\nare proposed to you by James Prichard") +#@gui :_=note("source code http://www.h-ps.demon.co.uk/GMIC/jayprich.gmic") +#@gui Jpr Colour Illusion:jpr_colourillusion,jpr_colourillusion(1) +#@gui :_=note("recreated from a Java example http://fiji.sc/wiki/ see Spirals Macro") +#@gui :Arms=int(2,2,10) +#@gui :Scale=float(25,10,50) +#@gui :_=note("update 2013-Feb-06 author @jayprich") +#@gui Jpr Coltexindex:jpr_coltexindex,jpr_coltexindex(1) +#@gui :_=note("Index the image using its colour channels plus the local analysis of its luminance channel.") +#@gui :_=note("Inspired by questions on masking for similar textures and how to make poster art from a photo.") +#@gui :_=note("Watch out for JPEG block-artifacts in colour channels") +#@gui :Number of Types=int(5,3,20) +#@gui :X1=float(55,0,100) +#@gui :Y1=float(55,0,100) +#@gui :X2=float(45,0,100) +#@gui :Y2=float(45,0,100) +#@gui :Factor (X1,Y1) Vs (X2,Y2)=float(1,0,5) +#@gui :Display (X,Y)=bool(1) +#@gui :_=separator() +#@gui :_=note("Luminance Y") +#@gui :Smoothness=float(0,0,5) +#@gui :Black=float(0.05,0,1) +#@gui :Midtone=float(0.5,0,1) +#@gui :Highlight=float(0.95,0,1) +#@gui :_=separator() +#@gui :_=note("Colour & Texture") +#@gui :Colour Smoothing=float(0.5,0,5) +#@gui :_=separator() +#@gui :_=note("Locally Average Gradient Norm or Variance from Luminance") +#@gui :Use Gradient Norm=bool(1) +#@gui :Local Size=float(2,1,9) +#@gui :Weight=float(0.7,0.2,2) +#@gui :_=note("update 2013-Mar-17 author @jayprich") +#@gui Jpr Decimate:jpr_decimate,jpr_decimate(1) +#@gui :_=note("Rescale in linear RGB space by cropping the frequency domain weighted") +#@gui :_=note("to decrease high frequency akin to Lanczos window on Sinc lobes.") +#@gui :_=note("This filter may corrupt the alpha channel") +#@gui :_=note("High sharpness just crops frequency and gives bad halo") +#@gui :Downsample Scale=float(0.375,0.1,1) +#@gui :Sharpness Factor=float(2,1.5,4) +#@gui :_=note("update 2013-Jun-24 author @jayprich") +#@gui Jpr Gradient Smooth:jpr_gradient_smooth,jpr_gradient_smooth(1) +#@gui :_=note("image and its gradient in x y are treated as solid angles and smoothed on the topology of the surface of a sphere\nthis means a loop bright/dark/bright cannot contract through the centre of the sphere") +#@gui :Offset Brightness=float(0,-0.9,0.9) +#@gui :Smoothing Amount=float(1.5,0.8,2.5) +#@gui :_=note("update 2013-Feb-03 author @jayprich") +#@gui Jpr Line Edges:jpr_line_edges,jpr_line_edges(1) +#@gui :_=note("combines the results in several orientations, each one blurs one way and looks for points of max gradient at 90 degrees to the blur") +#@gui :_=note("works best on photographs not line-art") +#@gui :Angles per Quadrant=int(2,1,9) +#@gui :Blurring=int(2,2,24) +#@gui :Gradient Threshold=float(4,0,30) +#@gui :Anti Alias=bool(1) +#@gui :_=note("update 2013-Jan-22 author @jayprich") +#@gui Jpr Orientedthinning:jpr_orientedthinning,jpr_orientedthinning(1) +#@gui :_=note{"Skeleton of a shape against a zero-value (pure-black) background using locally oriented local maxima to find only relevant ridges - not micro ridges from a noisy boundary"} +#@gui :Pre Smooth Borders=float(5,0,10) +#@gui :Propagate Direction=float(15,3,50) +#@gui :Threshold Width=int(1,1,10) +#@gui :Preview Orientation=bool(0) +#@gui :Distance Metric=choice(Max |x| |y| Chebyshev,|x|+|y| Manhattan,|x Y| Euclidean) +#@gui :_=note("update 2013-Apr-14 author @jayprich") +#@gui Jpr Phasecongruence:jpr_phasecongruence,jpr_phasecongruence(1) +#@gui :_=note("Edge detect with directional Phase Congruence using proportionality to Local Energy.") +#@gui :Start Angle=float(45,0,360) +#@gui :Directions=int(1,1,20) +#@gui :Energy Threshold=float(50,0,500) +#@gui :Local Maxima=bool(1) +#@gui :_=note("update 2013-Mar-31 author @jayprich") +#@gui Jpr Remove Blocks1:jpr_remove_blocks1,jpr_remove_blocks1(0) +#@gui :_=separator() +#@gui :_=note("subtracts square edged blocks with limited-amplitude while masking less-smooth areas of an image\n\nthis can reduce low quality jpeg artifacts in very smooth parts of an image\n1. choose a block size in pixels to fit\n2. set smallest amplitude that catches block noise in smooth areas but masks real edges in the image\n3. fine tune the strength around 70, the amount of estimated block-noise to subtract") +#@gui :Spatial Block Size=float(4,2,25) +#@gui :Amplitude=float(3,1,64) +#@gui :Strength Fine-Tune=float(70,20,300) +#@gui :_=note("update 2012-Nov-30 author @jayprich") +#@gui Jpr Shapes Gradient:jpr_shapes_gradient,jpr_shapes_gradient(0) +#@gui :_=note("convert an image to local patches with some gradient patch shape is via watershed algorithm") +#@gui :Pre Blur=float(2,0,15) +#@gui :Watershed Threshold=float(0.25,0.01,10) +#@gui :Gradient Flatten=float(0.001,0.001,0.1) +#@gui :Gradient Cap=float(100,5,200) +#@gui :_=note("update 2017-Jun-10 author @jayprich") +#@gui Jpr Specularbumps:jpr_specularbumps,jpr_specularbumps(1) +#@gui :_=note("Add highlights using brightness gradient.") +#@gui :Gradient Illuminate Angle=float(270,0,360) +#@gui :Pre Smooth=float(1,0,5) +#@gui :Gradient Range=float(13,0,30) +#@gui :Illumination Adjust=float(0,-45,45) +#@gui :Illumination Offset=float(80,0,90) +#@gui :Highlight Size=float(0.1,0,0.25) +#@gui :Roughness=float(0.1,0.05,0.35) +#@gui :Output Type=choice("Black and White","White with Alpha","Compose to Image") +#@gui :_=note("update 2013-Mar-31 author @jayprich") +#@gui Jpr Warpfromthreshold:jpr_warpfromthreshold,jpr_warpfromthreshold(1) +#@gui :_=note("a dummy 100x100 grid is warped using smoothed orientation as a map") +#@gui :Brightness Threshold=float(170,10,245) +#@gui :Simplify Regions=float(2,0,6) +#@gui :Blur & Renormalise Loop=int(10,3,50) +#@gui :Blur Amount per Step=float(2,1,10) +#@gui :_=note("update 2013-Feb-03 author @jayprich") +#@gui _Joan Rake +#@gui Artistic +#@gui Charred Plastic:fx_charred_plastic,fx_charred_plastic_preview +#@gui :_=separator() +#@gui :_=note("Difference of Gaussians") +#@gui :1. Amplitude=float(1,-10,10) +#@gui :2. Gaussian 1=float(10,0,100) +#@gui :3. Gaussian 2=float(40,0,100) +#@gui :4. Mode=choice(1,"Pixels","Percent") +#@gui :_=separator() +#@gui :_=note("Noise") +#@gui :5. Amplitude=float(10,0,200) +#@gui :6. Noise Type=choice("Gaussian","Uniform","Salt and Pepper","Poisson","Rice") +#@gui :7. Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :_=separator() +#@gui :_=note("Local Normalization") +#@gui :8. Amplitude=float(2,0,60) +#@gui :9. Radius=int(6,1,64) +#@gui :10. Neighborhood Smoothness=float(5,0,40) +#@gui :11. Average Smoothness=float(20,0,40) +#@gui :12. Constrain Values=bool(0) +#@gui :13. Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui Dreamy Abstraction:fx_dreamy_abstraction,fx_dreamy_abstraction_preview +#@gui :_=note("A less-aggressive alternative to the Painting filter. Yes, 'Joan Rake' made a filter that isn't aggressive! What kind of digital paint has she been sniffing?") +#@gui :_=separator() +#@gui :_=note("Segmentation") +#@gui :1. Edge Threshold=float(2,0,30) +#@gui :2. Smoothness=float(1,0,10) +#@gui :3. Blend Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :4. Opacity=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Noise") +#@gui :5. Noise Amplitude=float(10,0,100) +#@gui :6. Noise Type=choice("Gaussian","Uniform","Salt and Pepper","Poisson","Rice","Spread") +#@gui :7. Noise Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :8. Blend Mode=choice(7,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :9. Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Blur & Constrained Sharpen") +#@gui :11. Blur Strength=float(3,0,20) +#@gui :12. Sharpen Radius Factor=float(1,0,5) +#@gui :13. Amount Factor=float(1,0,5) +#@gui :14. Threshold=float(1,0,5) +#@gui :15. Constraint Radius Factor=float(1,0,5) +#@gui :16. Overshoot Factor=float(1,0,20) +#@gui :17. Sharpen Channel(s)=choice(11,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :18. Value Action=choice(1,"None","Cut","Normalize") +#@gui :19. Antialias=float(25,0,100) +#@gui :_=separator() +#@gui :_=note("Glow") +#@gui :20. Size=float(5,0,50) +#@gui :21. Intensity=float(1,0,3) +#@gui :22. Darken=float(0,0,1) +#@gui :23. Saturation=float(1.5,0,4) +#@gui :_=separator() +#@gui :24-26. Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui Dreamy Watercolour:fx_dreamy_watercolour,fx_dreamy_watercolour(0) +#@gui :_=note("Creates abstract watercolour images.") +#@gui :_=separator() +#@gui :_=note("Gradient norm") +#@gui :1. Smoothness=float(0,0,10) +#@gui :2. Linearity=float(0.3,0,2) +#@gui :3. Min Threshold=float(40,0,100) +#@gui :4. Max Threshold=float(60,0,100) +#@gui :5. Negative=bool(0) +#@gui :6. Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Antialias") +#@gui :7. Amplitude=float(50,0,200) +#@gui :8. Edge Threshold (%)=float(0,0,100) +#@gui :9. Smoothness=float(10,0,20) +#@gui :_=separator() +#@gui :_=note("Dreamy abstraction") +#@gui :_=separator() +#@gui :_=note("Segmentation") +#@gui :10. Edge Threshold=float(2,0,30) +#@gui :11. Smoothness=float(1,0,10) +#@gui :12. Blend Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :13. Opacity=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Noise") +#@gui :14. Noise Amplitude=float(10,0,100) +#@gui :15. Noise Type=choice("Gaussian","Uniform","Salt and Pepper","Poisson","Rice","Spread") +#@gui :16. Noise Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :17. Blend Mode=choice(7,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :18. Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Blur & Constrained Sharpen") +#@gui :19. Blur Strength=float(3,0,20) +#@gui :20. Sharpen Radius Factor=float(1,0,5) +#@gui :21. Amount Factor=float(1,0,5) +#@gui :22. Threshold=float(1,0,5) +#@gui :23. Constraint Radius Factor=float(1,0,5) +#@gui :24. Overshoot Factor=float(1,0,20) +#@gui :25. Sharpen Channel(s)=choice(11,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :26. Value Action=choice(1,"None","Cut","Normalize") +#@gui :27. Antialias=float(25,0,100) +#@gui :_=separator() +#@gui :_=note("Deform colour layer") +#@gui :28. Amplitude=float(5,0,50) +#@gui :29. Interpolation=choice(1,"None","Linear","Bicubic") +#@gui :30. Matrix Density=float(10,1,100) +#@gui :31. Matrix Interpolation=choice(1,"Linear","Bicubic") +#@gui :32. Mode=choice("Noise","Spread Noise") +#@gui :33. Character=float(0,-100,100) +#@gui :34. Boundary=choice(1,"Dirichlet","Neumann","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Plasma") +#@gui :35. Alpha=float(0.5,0,5) +#@gui :36. Beta=float(0,0,100) +#@gui :37. Scale=float(8,1,20) +#@gui :38. Randomize=bool(1) +#@gui :39. Transparency=bool(0) +#@gui :40-42. Color Balance=color(#808080) +#@gui :43. Fix Edges=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Transfer colours") +#@gui :44. Enable=bool(1) +#@gui :45. Regularization=int(8,0,32) +#@gui :46. Preserve Luminance=float(0.2,0,1) +#@gui :47. Precision=_choice(1,"Low","Normal","High","Very High") +#@gui :48. Reference Colors=choice(1,"Plasma","Painting") +#@gui :49. Add User-Defined Constraints (Interactive)=_bool(0) +#@gui :50. Blend Mode=choice(27,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :51. Opacity=float(0.75,0,1) +#@gui :52. Reverse Order=bool(0) +#@gui :_=separator() +#@gui :_=note("Local normalisation") +#@gui :53. Amplitude=float(1,0,80) +#@gui :54. Radius=int(20,1,96) +#@gui :55. Neighborhood Smoothness=float(40,0,60) +#@gui :56. Average Smoothness=float(40,0,60) +#@gui :57. Constrain Values=bool(1) +#@gui :58. Channel(s)=choice(2,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :_=separator() +#@gui :_=note("Noise") +#@gui :59. Power=float(1.25,0,5) +#@gui :60. Noise Type=choice("Gaussian","Uniform","Salt and Pepper","Poisson","Rice") +#@gui :61. Channel(s)=choice(2,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :62. Value Action=choice(1,"None","Cut","Normalize") +#@gui :63. Blend Mode=choice(27,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :64. Opacity=float(1,0,1) +#@gui Hard Painting:fx_hard_painting,fx_hard_painting_preview(0)+ +#@gui :_=note("Modular filter which can be used to apply an extremely-glossy paint effect.") +#@gui :_=separator() +#@gui :_=note("Painting authors: Lyle Kroll, Angelo Lama and David Tschumperlé.\nLatest update: 2011/28/02.") +#@gui :1. Abstraction=int(1,0,20) +#@gui :2. Details Scale=float(2.5,0,100) +#@gui :3. Color=float(4,0,25) +#@gui :4. Smoothness=float(50,0,2000) +#@gui :5. Sharpen Shades=bool(1) +#@gui :_=separator() +#@gui :_=note("Graphic novel author: PhotoComiX. Latest update : 2011/13/11.") +#@gui :_=link("Filter explained here","http://www.gimpchat.com/viewtopic.php?f=9&t=1582") +#@gui :6. Graphic Novel Iterations=int(1,0,10) +#@gui :_=separator() +#@gui :_=note("Apply Local Normalization") +#@gui :7. Skip This Step=bool(false) +#@gui :_=separator() +#@gui :_=note("Local Normalization Controls") +#@gui :8. Ln Amplititude=float(2,0,60) +#@gui :9. Ln Size=float(6,0,64) +#@gui :10. Ln Neightborhood-Smoothness=float(5,0,40) +#@gui :11. Ln Average-Smoothness=float(20,0,40) +#@gui :_=separator() +#@gui :12. Skip All Other Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note(" Pencil Options") +#@gui :13. Pencil Size=float(0.62,0,4) +#@gui :14. Pencil Amplitude=float(14,0,200) +#@gui :_=separator() +#@gui :15. Skip All Other Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :16. Activate "Pencil Smoother"=bool(true) +#@gui :_=note(" If unchecked the 3 sliders below are disabled ") +#@gui :_=separator() +#@gui :17. Pencil Smoother Sharpness=float(0.5,0,2) +#@gui :18. Pencil Smoother Edge Protection=float(0.78,0,1) +#@gui :19. Pencil Smoother Smoothness=float(1.92,0,10) +#@gui :_=separator() +#@gui :20. Skip All Other Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Boost Merging Options") +#@gui :21. Swap Layers=bool(false) +#@gui :22. Mixer=choice("Overlay","Multiply","Soft Light","Color Burn","Darken","Stamp","Hard Light","Value","Grain Merge","Freeze","Lightness","Luminance","*Colors Doping","*Comix Colors*","Graphic Colours","*Graphix Colors","*Vivid Edges*","*Dark Edges*","*Dark Screen*","*Vivid Screen*","Interpolate") +#@gui :23. Opacity=float(1,0,1) +#@gui :24. Intensity=float(1,0,1) +#@gui :_=separator() +#@gui :25. Add Painter's Touch=bool(true) +#@gui :_=separator() +#@gui :26. Painter's Touch Sharpness=float(0.5,0,2) +#@gui :27. Painter's Edge Protection Flow=float(0.8,0,1) +#@gui :28. Painter's Smoothness=float(1.28,0,10) +#@gui :_=separator() +#@gui :29-31. Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui Neon:fx_neon,fx_neon_preview +#@gui :_=note("Turns bright image outlines into bright, neon-like lines.") +#@gui :_=separator() +#@gui :_=note("Lines") +#@gui :1. Norm Mode=choice("Gradient Norm","Hessian","Laplacian","Rotation-Invariant Gradient","Afre's Edge Algorithm") +#@gui :2. Thinning=int(1,1,10) +#@gui :3. Recovery=float(1,.5,4) +#@gui :4. Brightness=float(1,.5,4) +#@gui :5. Details=float(1,.5,4) +#@gui :6. Smoothness=float(0,0,10) +#@gui :7. Contrast=float(0.45,0,1.5) +#@gui :8. Min Threshold=float(40,0,100) +#@gui :9. Max Threshold=float(60,0,100) +#@gui :10. Negative=bool(0) +#@gui :11. Opacity Over Original=float(1,0,1) +#@gui :12. Saturation=float(1.15,0,4) +#@gui :13. Blur Colours=float(2,0,20) +#@gui :_=separator() +#@gui :_=note("Antialias") +#@gui :14. Amplitude=float(3,0,100) +#@gui :15. Edge Threshold (%)=float(0,0,100) +#@gui :16. Smoothness=float(3,0,5) +#@gui :_=separator() +#@gui :_=note("Colour Glow 1") +#@gui :17. Size=float(20,0,100) +#@gui :18. Intensity=float(0.4,0,3) +#@gui :19. Darken=float(0.1,0,1) +#@gui :20. Saturation=float(1.5,0,4) +#@gui :_=separator() +#@gui :_=note("Colour Glow 2") +#@gui :21. Size=float(5,0,100) +#@gui :22. Intensity=float(0.2,0,3) +#@gui :23. Darken=float(0.1,0,1) +#@gui :24. Saturation=float(1,0,4) +#@gui :_=separator() +#@gui :_=note("Boost Glow") +#@gui :25. Size=float(2,0,5) +#@gui :26. Intensity=float(1,0,3) +#@gui :_=separator() +#@gui :27. Smooth Hues=float(0,0,20) +#@gui :_=separator() +#@gui :28. Alpha=bool(0) +#@gui :29. Alpha Power=float(1,0,5) +#@gui :30. Alpha Multiplier=float(1,0,5) +#@gui :_=separator() +#@gui :31. Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :32-33. Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui Neon Alpha:fx_neon_alpha,fx_neon_alpha_preview(0) +#@gui :_=note("An attempt to make the Neon filter work with alpha channels. Low-quality, comes with some artefacts.") +#@gui :_=separator() +#@gui :_=note("Gradient norm") +#@gui :1. Smoothness=float(0,0,10) +#@gui :2. Linearity=float(0.45,0,1.5) +#@gui :3. Min Threshold=float(40,0,100) +#@gui :4. Max Threshold=float(60,0,100) +#@gui :5. Negative=bool(0) +#@gui :6. Blur Original=float(2,0,20) +#@gui :7. Saturation=float(1.15,0,4) +#@gui :_=separator() +#@gui :_=note("Colour Glow 1") +#@gui :8. Size=float(20,0,100) +#@gui :9. Intensity=float(0.4,0,3) +#@gui :10. Darken=float(0.1,0,1) +#@gui :11. Saturation=float(2.25,0,4) +#@gui :_=separator() +#@gui :_=note("Colour Glow 2") +#@gui :12. Size=float(5,0,100) +#@gui :13. Intensity=float(0.2,0,3) +#@gui :14. Darken=float(0.1,0,1) +#@gui :15. Saturation=float(2.25,0,4) +#@gui :_=separator() +#@gui :_=note("Boost Glow") +#@gui :16. Size=float(2,0,5) +#@gui :17. Intensity=float(1,0,2) +#@gui Otsu-Hessian Blend:fx_otsu_hessian_blend,fx_otsu_hessian_blend_preview(1) +#@gui :_=note("Expansion of a one-line filter by Afre.") +#@gui :Otsu Levels=int(4,1,32) +#@gui :Norm 1=float(0,-5,5) +#@gui :Norm 2=float(1,-5,5) +#@gui :Merging Option=choice(27,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Opacity=float(1,0,1) +#@gui :Reverse Order=bool(0) +#@gui Whirling Lines:fx_whirling_lines,fx_whirling_lines_preview +#@gui :_=note("Creates fingerprint-like lines out of images by blurring and rounding their values. Works best with single-channel images.") +#@gui :1. Blur=float(30,0,100) +#@gui :2. Round=float(6,0,255) +#@gui :_=separator() +#@gui :_=note("Gradient norm") +#@gui :3. Norm Mode=choice("Gradient Norm","Hessian","Laplacian","Rotation-Invariant Gradient") +#@gui :4. Smoothness=float(0,0,10) +#@gui :5. Contrast=float(0.45,0,1.5) +#@gui :6. Min Threshold=float(40,0,100) +#@gui :7. Max Threshold=float(60,0,100) +#@gui :8. Dilate or Erode=int(0,-5,20) +#@gui :9. Negative=bool(0) +#@gui :_=separator() +#@gui :_=note("Antialias") +#@gui :10. Amplitude=float(30,0,100) +#@gui :11. Edge Threshold (%)=float(0,0,100) +#@gui :12. Smoothness=float(3,0,10) +#@gui :13. Value Action=choice(3,"None","Cut","Normalize","Cut Then Normalize") +#@gui _Colors +#@gui Colour Space Swap:csswap,csswap_preview +#@gui :To RGB From=choice("RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :From RGB To=choice("RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","Jzczhz","HCY") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui CubeHelix:fx_cubehelix,fx_cubehelix_preview(1) +#@gui :_=note("Implements and extends the CubeHelix family of colour schemes, allowing for interpolation between two colours as well as scaling the helix dimensions for each individual channel based on those colours.") +#@gui :Pre-Greyscale=choice(1,"Off","Luminance","SRGB Mean") +#@gui :Min Threshold=float(0,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Pre-Normalise=bool(0) +#@gui :Start Colour=color(#000000) +#@gui :End Colour=color(#ffffff) +#@gui :_=separator() +#@gui :Start Hue=float(1,0,3) +#@gui :Rotations=float(-1.5,-20,20) +#@gui :Rotation Bend=float(0,-3,3) +#@gui :_=separator() +#@gui :Saturation Bend=float(0,-3,3) +#@gui :Saturation Start=float(1,0,5) +#@gui :Saturation End=float(1,0,5) +#@gui :Gamma Bend=float(0,-3,3) +#@gui :Gamma Start=float(0,0,1) +#@gui :Gamma End=float(1,0,1) +#@gui :_=separator() +#@gui :Scale Colour Variations=float(1,-4,4) +#@gui :_=note("Scales the colour variations to reflect the difference between the start and end colours. For example, a value of 0 when going from black to yellow will flatten the helix so that only the red and green channels vary.") +#@gui :_=separator() +#@gui :Red Amplitude=float(1,0,4.00000) +#@gui :Red Phase Shift=float(0,0,360) +#@gui :Green Amplitude=float(1,0,4.00000) +#@gui :Green Phase Shift=float(0,0,360) +#@gui :Blue Amplitude=float(1,0,4.00000) +#@gui :Blue Phase Shift=float(0,0,360) +#@gui :_=separator() +#@gui :Preview Colour Scheme=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui Frequency Representation:fx_frequency_representation,fx_frequency_representation_preview(1) +#@gui :_=note("Changes values based on relative frequencies of those values in a histogram of image intensity.") +#@gui :Iterations=int(3,1,20) +#@gui :Clusters=int(256,2,1024) +#@gui :Split Channels=bool(0) +#@gui :Blur=float(40,0,100) +#@gui :Colour Space=choice("RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui Quick Desaturate:jr_desaturate,jr_desaturate_preview(1) +#@gui :_=note("Generates greyscale images, allowing for different (s/)RGB channel intensities before merging. A smaller counterpart to the 'Black & White' filter intended for generating intensity maps.") +#@gui :Colour Space=choice("RGB","SRGB") +#@gui :Channel 1=float(1,0,3) +#@gui :Channel 2=float(1,0,3) +#@gui :Channel 3=float(1,0,3) +#@gui :Normalize=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui Satellite:fx_satellite,fx_satellite_preview(1) +#@gui :_=note("Expresses luminance of images using image enhancement colour schemes which are used in NOAA satellite weather products.") +#@gui :_=separator() +#@gui :Colour Scheme=choice("Aviation","Dvorak","Funktop","JSL2","Shortwave IR2 (Standard and Tropical)","Shortwave IR2 (Fire)","Shortwave IR2 (Summer Fire)","Shortwave IR2 (Winter Fire)","Rainbow (Old)","Rainbow (New)","Water Vapour","Water Vapour (Blue)","IR Window (White-White)","IR Window (White-Brown)","IR Window (White-Black)","IR Window (Blue-White)","IR Window (Blue-Brown)","IR Window (Blue-Black)") +#@gui :Gamma Bend=float(0,-3,3) +#@gui :_=note("Cut range from original image") +#@gui :Cut Lower Threshold=float(0,0,100) +#@gui :Cut Higher Threshold=float(100,0,100) +#@gui :_=note("Apply range of colour scheme to image") +#@gui :Normalise=bool(1) +#@gui :Normalise Lower Threshold=float(0,0,255) +#@gui :Normalise Higher Threshold=float(255,0,255) +#@gui :To SRGB=bool(0) +#@gui :Preview Colour Scheme=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui _Contours +#@gui Gradient Norm [JR's Mod]:fx_jr_gradient_norm,fx_jr_gradient_norm_preview(1) +#@gui :Smoothness=float(0,0,10) +#@gui :Contrast=float(0.45,0,1.5) +#@gui :Min Threshold=float(40,0,100) +#@gui :Max Threshold=float(60,0,100) +#@gui :Negative=bool(0) +#@gui :Include Orientation=choice("Off","On","On (Extrapolate If Negative)") +#@gui :Scale X=float(1,0,5) +#@gui :Scale Y=float(1,0,5) +#@gui :Interpolation=choice(2,"Nearest","Average","Bilinear","Bicubic") +#@gui :Alpha=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui _Deformations +#@gui Auto-Gnarl:fx_auto_gnarl,fx_auto_gnarl_preview(1) +#@gui :_=note("Applies random deformations mainly to sharp edges.") +#@gui :_=separator() +#@gui :_=note("Gradient Norm") +#@gui :Smoothness=float(3,0,10) +#@gui :Contrast=float(0.45,0,1.5) +#@gui :Min Threshold=float(40,0,100) +#@gui :Max Threshold=float(60,0,100) +#@gui :Negative=bool(0) +#@gui :Scale X=float(1,0,5) +#@gui :Scale Y=float(1,0,5) +#@gui :Interpolation=choice(2,"Nearest","Average","Bilinear","Bicubic") +#@gui :_=separator() +#@gui :_=note("Noise Local Normalisation") +#@gui :Amplitude=float(4,0,60) +#@gui :Radius=int(6,1,64) +#@gui :Neighborhood Smoothness=float(5,0,40) +#@gui :Average Smoothness=float(20,0,40) +#@gui :Constrain Values=bool(1) +#@gui :_=separator() +#@gui :_=note("Warping") +#@gui :Smoothness=float(2.5,0,30) +#@gui :Rounding=float(0.5,0,1) +#@gui :Amplitude=float(2,0,5) +#@gui :Interpolation=choice(2,"Nearest","Bilinear","Bicubic") +#@gui :Boundary=choice(3,"None","Nearest","Periodic","Mirror") +#@gui Buffer Destroyer:fx_buffer_destroyer,fx_buffer_destroyer_preview(0) +#@gui :_=note("A preset combo of filters which rip images apart through simulated buffer manipulation and warping.") +#@gui :0. Recompute=button(0) +#@gui :1. Alpha=bool(1) +#@gui :_=separator() +#@gui :_=note("Buffer Error 1") +#@gui :2. Width=float(75,0,200) +#@gui :3. Height=float(40,0,200) +#@gui :4. Buffer Selection Start (%)=float(0,0,100) +#@gui :5. Buffer Selection Length (%)=float(100,0,400) +#@gui :6. Buffer Selection Shift (%)=float(0,0,100) +#@gui :7. Repeat Buffer=bool(1) +#@gui :_=separator() +#@gui :_=note("Shredder") +#@gui :8. Randomised Start=bool(1) +#@gui :9. Channels=choice("Correlated","RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :10. Min Gap=float(50,0,100) +#@gui :11. Max Gap=float(100,0,100) +#@gui :12. Strength=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Pixel Sort") +#@gui :_=note("Sorting parameters:") +#@gui :13. Order=choice(1,"Decreasing","Increasing") +#@gui :14. Axis=choice("X-Axis","Y-Axis","X-Axis Then Y-Axis","Y-Axis Then X-Axis") +#@gui :15. Sorting Criterion=choice(3,"Red","Green","Blue","Intensity","Luminance","Lightness","Hue","Saturation","Minimum","Maximum","Random") +#@gui :_=note("Masking parameters:") +#@gui :16. Mask By=choice("Criterion","Contours","Random") +#@gui :17. Lower Mask Threshold (%)=float(50,0,100) +#@gui :18. Higher Mask Threshold (%)=float(100,0,100) +#@gui :19. Mask Smoothness (%)=float(0,0,5) +#@gui :20. Invert Mask=bool(0) +#@gui :21. Preview Mask=bool(0) +#@gui :_=separator() +#@gui :_=note("Shifter") +#@gui :_=note("Amplitudes are cubed to tame the distortion a little bit.") +#@gui :22. Channels=choice("Correlated","RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :23. X Amplitude=float(2.5,0,10) +#@gui :24. X Iterations=int(20,0,400) +#@gui :25. Y Amplitude=float(2.5,0,10) +#@gui :26. Y Iterations=int(20,0,400) +#@gui :27. Matrix Warp Multiplier=float(1,0,5) +#@gui :28. Matrix Boundary=choice(5,"Random","Random [non-Transparent]","Transparent","Nearest","Periodic","Mirror") +#@gui :29. Warp Boundary=choice(5,"Random","Random [non-Transparent]","Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Buffer Error 2") +#@gui :30. Inverse Of BE1=bool(1) +#@gui :31. Width=float(120,0,200) +#@gui :32. Height=float(80,0,200) +#@gui :33. Buffer Selection Start (%)=float(0,0,100) +#@gui :34. Buffer Selection Length (%)=float(100,0,100) +#@gui :35. Buffer Selection Shift (%)=float(0,0,100) +#@gui :36. Repeat Buffer=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui Buffer Error:fx_buffer_error,fx_buffer_error_preview(0) +#@gui :_=note("Resizes an image without changing the positions of pixels in a specified selection of a simulated image buffer. Buffer shift scales with the buffer length.") +#@gui :1. Width=float(50,0,200) +#@gui :2. Height=float(50,0,200) +#@gui :3. Buffer Selection Start (%)=float(0,0,100) +#@gui :4. Buffer Selection Length (%)=float(100,0,400) +#@gui :5. Buffer Selection Shift (%)=float(0,0,100) +#@gui :6. Repeat Buffer=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui Kaleidoscope Layer Cake:fx_jr_klc,fx_jr_klc_preview(1) +#@gui :_=separator() +#@gui :Kaleidoscope Mirrors=int(6,0,64) +#@gui :Mirror Rotation=float(0,-360,360) +#@gui :M-Rot Mode=choice("Fixed Mirrors","Fixed Background") +#@gui :Result Rotation=float(0,-360,360) +#@gui :R-Rot Mode=choice("Full","Sector") +#@gui :Mirror Offset (%)=point(50,50,0,1) +#@gui :Centre (%)=point(50,50,0,1) +#@gui :Slice Mode=choice("Symmetric","Asymmetric","Reverse Asymmetric") +#@gui :_=separator() +#@gui :Layer Cake Density=float(30,0,100) +#@gui :Angle=float(0,-1440,1440) +#@gui :Angle Mode=choice("Layer","Density","Sector","Density & Sector") +#@gui :_=separator() +#@gui :Scale (%)=float(100,0,1000) +#@gui :Anti-Alias=float(1,0,2) +#@gui :Interpolation=choice(2,"None","Linear","Bicubic") +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui Layer Cake:fx_layer_cake,fx_layer_cake_preview(1) +#@gui :_=note("Splits image into annular or circular layers and rotates each layer. Based on the Paint.NET plugin.") +#@gui :Iterations=int(4,1,32) +#@gui :Angle at Centre=float(360,-1440,1440) +#@gui :Angle Times Iteration=bool(0) +#@gui :Size=float(75,0,200) +#@gui :Centre=point(50,50,0,1,255,255,255,175) +#@gui :Boundary=choice(3,"None","Nearest","Periodic","Mirror") +#@gui :Interpolation=choice(1,"None","Linear","Bicubic") +#@gui :Blur=float(0,0,200) +#@gui :_=separator() +#@gui :Anti-Alias Amplitude=float(30,0,100) +#@gui :Edge Threshold (%)=float(0,0,100) +#@gui :Smoothness=float(3,0,10) +#@gui :Output Layers=choice("Off","Hollow","Filled") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui Layer Cake 2:fx_layer_cake_2,fx_layer_cake_2_preview(1) +#@gui :Layer Density=float(4,1,100) +#@gui :Angle Value=float(360,-2880,2880) +#@gui :Angle Mode=choice("Divided by Density","Per Layer") +#@gui :Centre=point(50,50,0,1,255,255,255,175) +#@gui :Interpolation=choice(2,"None","Linear","Bicubic") +#@gui :Boundary=choice(3,"None","Nearest","Periodic","Mirror") +#@gui :Blur=float(50,0,100) +#@gui :Blur Mode=choice("Anti-Alias","Layer Smoothing") +#@gui :Output Mode=choice("Full","Filled Layers","Hollow Layers") +#@gui PowerTwirl:fx_powertwirl,fx_powertwirl_preview(1) +#@gui :Amplitude=float(1,-20,20) +#@gui :Offset=float(0,-180,180) +#@gui :Center (%)=point(50,50,0,1) +#@gui :Power=float(1,-20,20) +#@gui :Interpolation=choice(2,"None","Linear","Bicubic") +#@gui :Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :Mode=choice(0,"Polar","Cartesian") +#@gui Random Deformations (JR's Mod):fx_jr_deform,fx_jr_deform_preview(1) +#@gui :Recompute=button(0) +#@gui :Amplitude=float(5,0,50) +#@gui :Interpolation=choice(1,"None","Linear","Bicubic") +#@gui :Matrix Density=float(10,1,100) +#@gui :Matrix Interpolation=choice(1,"Linear","Bicubic") +#@gui :Mode=choice("Noise","Spread Noise") +#@gui :Character=float(0,-100,100) +#@gui :Boundary=choice(1,"Dirichlet","Neumann","Periodic","Mirror") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui Rays from Image:fx_rays_from_image,fx_rays_from_image(1) +#@gui :_=note("Creates rays from the colours of an image. If the power is 5, the lines radiate outwards as if the image is being exploded from the chosen point.") +#@gui :_=separator() +#@gui :Power=float(5,0,10) +#@gui :Centre=point(50,50,0,1,255,255,255,175) +#@gui :Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui Shifter:fx_shifter,fx_shifter_preview(1) +#@gui :_=note("Shifts portions of an image using warp maps made from difference blending of rectangles.") +#@gui :_=separator() +#@gui :Recompute=button(0) +#@gui :Channels=choice("Correlated","RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :Alpha=bool(1) +#@gui :X Amplitude=float(1,0,10) +#@gui :X Iterations=int(20,0,400) +#@gui :Y Amplitude=float(1,0,10) +#@gui :Y Iterations=int(20,0,400) +#@gui :Matrix Warp Multiplier=float(1,0,5) +#@gui :Matrix Boundary=choice(5,"Random","Random [non-Transparent]","Transparent","Nearest","Periodic","Mirror") +#@gui :Warp Boundary=choice(5,"Random","Random [non-Transparent]","Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui Spiral Matrix Transformation:fx_jr_spiral_transform,fx_jr_spiral_transform_preview(1) +#@gui :_=note("Transforms images into rectangular spirals. The main use is to run effects on the transformed images and then use a corresponding reverse transformation for unusual effects. Preview may be highly-inaccurate. Based off an unfinished script from the PolyGlitch Paint.NET plugin.\n\n Details of the Spiral Matrix Transform's mathematics can be found in this thread - Challenge: Spiralbw as a parametric function (x(t),y(t)).") +#@gui :_=separator() +#@gui :Mode=choice("Spiral","Inverse Spiral") +#@gui :Spiral Rotation=choice("Clockwise","Anticlockwise") +#@gui :Direction=choice("Down","Up") +#@gui :Starting Axis=choice("X","Y") +#@gui :Spiral Start=choice("Outside","Inside") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian, David Tschumperlé.,Joan Rake and Garagecoder. Latest Update: 2019/5/28.") +#@gui UltraWarp 2:fx_ultrawarptwo,fx_ultrawarptwo_preview(1) +#@gui :_=note("A sequence of multiple self-warps and HSV/HSI/HSL operations. A remake of UltraWarp++++ but with more focus on granular features rather than preset combinations of filters. 'Range' parameters determine the upper and lower bounds while the 'centre' parameters set the mean values.") +#@gui :_=separator() +#@gui :0. Recompute=button(0) +#@gui :_=separator() +#@gui :_=note("Warping") +#@gui :1. Iterations=int(3,1,30) +#@gui :2. From RGB To=choice(1,"Random","RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :3. X-Factor Centre=float(0,-30,30) +#@gui :4. X-Factor Range=float(3,0,30) +#@gui :5. Y-Factor Centre=float(0,-30,30) +#@gui :6. Y-Factor Range=float(3,0,30) +#@gui :7. X-Offset Centre=float(0,-30,30) +#@gui :8. X-Offset Range=float(3,0,30) +#@gui :9. Y-Offset Centre=float(0,-30,30) +#@gui :10. Y-Offset Range=float(3,0,30) +#@gui :11. Correlated Channels=choice(2,"On","Off","Random") +#@gui :12. Interpolation=choice(2,"Nearest","Linear","Random") +#@gui :13. Boundary=choice(5,"Transparent","Nearest","Periodic","Mirror","Random","Random (Non-Transparent)") +#@gui :14. Warp Channel(s)=choice(3,"None","Random","All","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :15. Include Alpha=bool(0) +#@gui :16. To RGB From=choice(1,"Random","RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :17. Random Negation=bool(1) +#@gui :_=separator() +#@gui :_=note("Post-warping HSX8 mixing") +#@gui :18. Repeat For Each Iteration=bool(1) +#@gui :19. X Channel=choice("Value","Intensity","Lightness") +#@gui :20. Hue Factor Centre=float(1,-20,20) +#@gui :21. Hue Factor Range=float(0.5,0,20) +#@gui :22. Saturation Factor Centre=float(2.5,-20,20) +#@gui :23. Saturation Factor Range=float(5,0,20) +#@gui :24. X Channel Factor Centre=float(1,-20,20) +#@gui :25. X Channel Factor Range=float(0,0,20) +#@gui :26. Alpha Factor Centre=float(1,-20,20) +#@gui :27. Alpha Factor Range=float(0,0,20) +#@gui :28. Hue Shift Centre=float(0,-255,255) +#@gui :29. Hue Shift Range=float(255,0,255) +#@gui :30. Saturation Shift Centre=float(0,-255,255) +#@gui :31. Saturation Shift Range=float(255,0,255) +#@gui :32. X Channel Shift Centre=float(0,-255,255) +#@gui :33. X Channel Shift Range=float(0,0,255) +#@gui :34. Alpha Shift Centre=float(0,-255,255) +#@gui :35. Alpha Shift Range=float(0,0,255) +#@gui ___Degradations +#@gui UltraWarp++++:fx_ultrawarp4plus,fx_ultrawarp4plus_preview(0) +#@gui :_=note("A sequence of multiple partially-randomised texture generation and image deformation filters with multi-iteration warping.") +#@gui :_=note("This modular filter is extremely complex and its logic may not follow that which you expect. Left on its default settings, it is very likely to munge your image beyond recognition. This original version has been kept alive despite being slower than UltraWarp 2.") +#@gui :_=separator() +#@gui :0. Recompute=button(0) +#@gui :_=separator() +#@gui :1. Plasma Texture [Discards Input Image]=bool(0) +#@gui :2. Plasma Scale=float(3.3,0,20) +#@gui :3. Plasma Alpha Channel=bool(0) +#@gui :_=separator() +#@gui :4. Segmentation [No Alpha Channel]=bool(0) +#@gui :5. Edge Threshold=float(5,0.01,60) +#@gui :6. Smoothness=float(0,0,60) +#@gui :_=separator() +#@gui :7. Blur=float(0,0,30) +#@gui :_=separator() +#@gui :8. Quadtree Pixelisation [No Alpha Channel]=bool(0) +#@gui :9. Quadtree Min Precision=int(4,2,8192) +#@gui :10. Quadtree Max Precision=int(256,0,8192) +#@gui :11. Quadtree Min Homogeneity=float(4.8,0,5) +#@gui :12. Quadtree Max Homogeneity=float(5,0,5) +#@gui :_=separator() +#@gui :13. Noise Type=choice(2,"Gaussian","Uniform","Salt and Pepper","Poisson") +#@gui :14. Minimum Noise=float(0,0,8) +#@gui :15. Maximum Noise=float(0,0,8) +#@gui :16. Noise Channel(s)=choice(2,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :_=separator() +#@gui :_=note("Warping") +#@gui :17. Warp Iterations=int(3,0,30) +#@gui :18. Warp Intensity=float(3,0,10) +#@gui :19. Warp Offset=float(20,0,2000) +#@gui :20. Scale to Width=bool(1) +#@gui :21. Scale to Height=bool(1) +#@gui :22. Correlated Channels=choice("Random","Off","On") +#@gui :23. Boundary=choice(5,"Random","Random [non-Transparent]","Transparent","Nearest","Periodic","Mirror") +#@gui :24. Warp Channel(s)=choice(2,"Random","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :25. Random Negation=bool(1) +#@gui :26. Random Negation Channel(s)=choice(2,"Random","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :27. Gamma Offset=float(0.25,0,1) +#@gui :28. Hue Offset=float(1,0,1) +#@gui :29. Normalise=bool(1) +#@gui :_=separator() +#@gui :_=note("Final HSV Scaling") +#@gui :30. Minimum Hue=float(0,0,20) +#@gui :31. Maximum Hue=float(5,0,20) +#@gui :32. Minimum Saturation=float(0,0,20) +#@gui :33. Maximum Saturation=float(3,0,20) +#@gui :34. Minimum Value=float(0.5,0,20) +#@gui :35. Maximum Value=float(2,0,20) +#@gui :_=note("Set these to their minimum values for randomisation") +#@gui :36. Hue Offset=float(-180,-180,180) +#@gui :37. Saturation Offset=float(0,-1.01,1) +#@gui :38. Value Offset=float(0,-20.01,20) +#@gui :_=separator() +#@gui :-4. Normalise=bool(1) +#@gui :-3. Normalisation Channel(s)=choice(11,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :_=separator() +#@gui :-2. Overall Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :-1. Value Action=choice("None","Cut","Normalize") +#@gui _Testing +#@gui Joan Rake +#@gui Degradations +#@gui Blur [Bloom Glare]:fx_blur_bloom_glare,fx_blur_bloom_glare_preview(0) +#@gui :Amplitude=float(1,0,20) +#@gui :Ratio=float(2,0,10) +#@gui :Iterations=int(5,0,200) +#@gui :Operator=choice("Add","Max","Min") +#@gui :Kernel=choice("Quasi-Gaussian","Gaussian","Box","Triangle","Quadratic") +#@gui :Normalize Scales=bool(0) +#@gui :Anisotropy=bool(0) +#@gui :Angle=float(0,0,180) +#@gui :Axis=int(3,1,20) +#@gui :Opacity=float(0.5,0,1) +#@gui :_=note("Parameters Angle, Axis and Opacity are only active when Anisotropy is checked") +#@gui :_=separator() +#@gui :Channel(s)=choice(7,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui :_=separator() +#@gui :_=note("Authors: David Tschumperlé. Latest update: 2015/03/02.") +#@gui Bomb Blend:fx_blend_bomb,fx_blend_bomb_preview +#@gui :_=note("Creates a random transfer function 'mesh' and then blends images accordingly. Based on method shown on discuss.pixls.us.") +#@gui :Recompute=button(0) +#@gui :Process As=choice(1,"Two-By-Two","Self-Blend for Each Layer") +#@gui :Mesh X=int(16,1,256) +#@gui :Mesh Y=int(16,1,256) +#@gui :Mesh Smoothness=float(2,0,10) +#@gui :Contrast Scheme=choice("Arctan","Clip","Power") +#@gui :Mesh Contrast=float(50,0,100) +#@gui :Reverse Blending Layers=bool(0) +#@gui :Dimensions=choice("Bottom Layer","Top Layer") +#@gui :Alpha=bool(0) +#@gui :Normalise=bool(0) +#@gui :Output Mesh=bool(0) +#@gui Broken Texture Afre:fx_texture_afre_broken,fx_texture_afre_broken_preview(0) +#@gui :_=note("This shouldn't have happened.") +#@gui :_=separator() +#@gui :P1=float(1,0,10) +#@gui :P2=float(10,0,100) +#@gui :Difference=bool(0) +#@gui Butterworth Bandpass:fx_butterworth_bp,fx_butterworth_bp_preview(0) +#@gui :_=note("Lowpass and highpass zero-phase resonant Butterworth-style filters.") +#@gui :_=separator() +#@gui :LP Frequency Power=float(3,0,16) +#@gui :LP Order Cube Root=float(2,0,4) +#@gui :LP Resonance=float(0,0,5) +#@gui :HP Frequency Power=float(4,0,16) +#@gui :HP Order Cube Root=float(2,0,4) +#@gui :HP Resonance=float(0,0,5) +#@gui :Colour Space=choice("RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :Alpha=bool(0) +#@gui :Absolute=bool(1) +#@gui :Makeup Gain=bool(1) +#@gui :Preview Frequency Response=bool(0) +#@gui Cascading Self Glitching:fx_self_glitching_cascade,fx_self_glitching_cascade_preview(1) +#@gui :_=note("Shifts images in a cascading fashion but computes values based on shifted and original images.") +#@gui :_=note("This filter has many channel options and many operation options allowing for extremely-distorted images. Don't always trust the preview!") +#@gui :_=separator() +#@gui :1. Shift Channels=choice("RGB/SRGB","CMYK/CMY","HSV/HSV8","HSL/HSL8","HSI/HSI8","LCH/LCH8","Lab/Lab8","YCbCr/YCbCrGLIC","YIQ/YIQ8","YUV/YUV8","RYB/HCY","XYZ/XYZ8") +#@gui :2. Alt Choice=bool(0) +#@gui :3. Process Alpha=bool(0) +#@gui :4,5. Zeroth Shift=point(50,50,0,1,255,255,255,175) +#@gui :6. Boundary=choice(3,"Zero","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :7. Iterations=int(3,1,64) +#@gui :8. Repeat Post-Shift Operations=bool(1) +#@gui :_=separator() +#@gui :9,10. Shift Target=point(55,55,0,1,255,0,0,175) +#@gui :11. Target for Final (Rather than First) Shift=bool(0) +#@gui :12,13. Cascade Centre Point=point(45,45,0,1,0,255,0,175) +#@gui :14. Shift Randomness=float(0.75,0,4) +#@gui :15. Boundary=choice(3,"Zero","Nearest","Periodic","Mirror") +#@gui :16. Power=float(0,-5,5) +#@gui :17. Bias=float(0,-256,256) +#@gui :18. Negation=bool(0) +#@gui :19. Shift Operator=choice("Add","Multiply","Bitwise And","Bitwise Or","Bitwise Xor","Power","Reverse Power","Modulo","Reverse Modulo","Divide","Reverse Divide","Subtract","Reverse Subtract","Left Bitwise Shift","Reverse LBS","Right Bitwise Shift","Reverse RBS","Left Bitwise Rotation","Reverse LBR","Right Bitwise Rotation","Reverse RBR","Average","Round","Reverse Round","Sine","Reverse Sine","Cosine","Reverse Cosine","Tangent","Reverse Tangent (CPU-Intensive)","Cosecant","Reverse Cosecant","Secant","Reverse Secant","Cotangent","Reverse Cotangent","Variance","Difference","Minimum","Maximum","Interference (Add)","Reverse Interference (Add)","Interference (Multiply)","Interference (Divide)","Reverse Interference (Div)","Interference (Subtract)","Reverse Interference (Subt)","Interference (Rev Subt)","Reverse Interference (Rev Subt)","Interference (Difference)","Reverse Interference (Diff)","Interference (Variance)","Screen","Colour Dodge","Reverse Colour Dodge","Colour Burn","Reverse Colour Burn","Soft Light (Illusions.Hu)","Reverse Soft Light (Illusions.Hu)","Geometric Mean","Bright Hard Mix","Dark Hard Mix") +#@gui :20. Multiplier 1=float(1,-10,10) +#@gui :21. Addition 1=int(0,-1024,1024) +#@gui :22. Sawtoother Mode=choice(0,"Modulo","Triangular-Modulo","Legacy Modulo") +#@gui :23. Maximum End Value=int(256,0,1024) +#@gui :24. Multiplier 2=float(1,-10,10) +#@gui :25. Addition 2=int(0,-1024,1024) +#@gui :_=separator() +#@gui :26. Run on Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :_=separator() +#@gui :_=note("Original author: David Tschumperlé; extended by some nobody who calls themselves 'Joan Rake' or something.

Latest update: 2018/08/24.") +#@gui DCT FSU:fx_dct_fsu,fx_dct_fsu_preview(0) +#@gui :1. Operation=choice("Low Pass 1","Low Pass 2","High Pass 1","High Pass 2","Isolate","Plaid","Plaid LP","Plaid HP","Randomised Spread","Randomised Spread [intense]") +#@gui :2. X (%)=float(50,0,100) +#@gui :3. Y (%)=float(50,0,100) +#@gui :4-5. Shift Before=point(0,0,0,-1,255,127,0,175) +#@gui :6-7. Shift After=point(100,100,0,-1,127,255,0,175) +#@gui :8. Absolute=bool(0) +#@gui :9. Normalise=bool(1) +#@gui :10. Colour Space=choice("RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :11. Alpha=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui Fake JFIF (JPEG) Encoder:fx_jfif_fake,fx_jfif_fake_preview(0)* +#@gui :_=note("A fake jfif encoder.") +#@gui :Quality (%)=int(50,1,100) +#@gui :Encoding=choice("444","442","424","422") +#@gui :_=separator() +#@gui :_=note("Fake Glitch") +#@gui :Power=float(0,0,5) +#@gui :Colour Distortion=float(1.25,0,10) +#@gui :Max Tile Error Length=int(5,1,10) +#@gui :Persistent Tile Error Power=float(0.25,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui :_=separator() +#@gui :_=note("Author: Joan Rake, \'borrowed\' from David Tschumperlé. Latest Update: 2017/05/07.") +#@gui Faux-QAM Glitch:fx_qam_glitch,fx_qam_glitch_preview(0) +#@gui :_=note("Tries to emulate the effect of a faulty Quadrature Amplitude Modulator.") +#@gui :_=separator() +#@gui :_=note("Channel Modulation") +#@gui :1. Amplitude=float(2,0,10) +#@gui :2. Period=float(20,0,100) +#@gui :3. Phase Offset=float(0,-180,180) +#@gui :4. Angle=float(0,-180,180) +#@gui :5. Amplitude Offset=float(1,-10,10) +#@gui :6. Wave Offset=float(127.5,0,255) +#@gui :7. Colour Space=choice("RGBA","SRGBA","HSVA8","HSVA","HSLA8","HSLA","HSIA8","HSIA","LCHA8","LCHA","LabA8","LabA","YCbCrA","YCbCrAGLIC","YCbCrAJPEG","YIQA8","YIQA","YUVA8","YUVA","HCYA","XYZA8","XYZA","RYBA","CMYA") +#@gui :8. Channel 0=bool(1) +#@gui :9. Channel 1=bool(1) +#@gui :10. Channel 2=bool(1) +#@gui :11. Alpha=bool(0) +#@gui :12. Glitch Negation=bool(0) +#@gui :_=separator() +#@gui :_=note("Scanlines") +#@gui :13. Amplitude=float(20,0,255) +#@gui :14. Bandwidth=float(5,0,20) +#@gui :15. Shape=choice(0,"Bloc","Triangle","Sine","Sine+","Random") +#@gui :16. Angle Offset=float(0,-180,180) +#@gui :17. Offset=float(0,0,500) +#@gui :18. Blur=float(2,0,10) +#@gui :19. Amplitude Modulation=float(0.6,0,1) +#@gui :20. Phase Modulation=float(0.05,0,1) +#@gui :_=separator() +#@gui :21-23. Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui JFIF [JPEG] Self-Bomb:fx_jfif_bomb,fx_jfif_bomb_preview +#@gui :_=note("OI! TRY SMOOTHING THIS!") +#@gui :_=note("Adds JPEG artefacts and then self-bomb-blends. Use grid interpolation with scale factors above 1 to destroy the results even more.") +#@gui :Recompute=button(0) +#@gui :_=separator() +#@gui :Quality (%)=int(50,1,100) +#@gui :Mesh X=int(16,1,256) +#@gui :Mesh Y=int(16,1,256) +#@gui :Mesh Smoothness=float(0.5,0,10) +#@gui :Contrast Scheme=choice(1,"Arctan","Clip","Power) +#@gui :Mesh Contrast=float(75,0,100) +#@gui :Scale X=float(1,0.05,16) +#@gui :Scale Y=float(1,0.05,16) +#@gui :Interpolation=choice(0,"None","Nearest","Average","Bilinear","Grid","Bicubic") +#@gui :Normalize=bool(0) +#@gui :Output Mesh=bool(0) +#@gui :_=separator() +#@gui :Solidify Alpha=bool(1) +#@gui :Smoothness (%)=float(75,0,100) +#@gui :Regularization=choice(1,"Isotropic","Delaunay-Oriented","Edge-Oriented") +#@gui :Regularization Iterations=int(20,0,100) +#@gui :Dilation / Erosion=int(0,-20,20) +#@gui :Colorspace=choice(1,"SRGB","Linear RGB") +#@gui JFIF Effects:fx_jfif,fx_jfif_preview(0) +#@gui :_=note("A poorly-implemented JFIF encoder with extras, all designed to screw with images. Quite slow and very aggressive.") +#@gui :1. Quality (%)=int(50,1,100) +#@gui :2. Encoding=choice(3,"444","442","424","422") +#@gui :_=separator() +#@gui :_=note("Fake Glitch") +#@gui :3. Power=float(0,0,10) +#@gui :4. Colour Distortion=float(1,0,2) +#@gui :5. Max Glitch Length=int(5,2,10) +#@gui :6. Max Value Errors Per Tile=int(5,0,10) +#@gui :7. Error Strength=float(3,0,8) +#@gui :8. Persistent Value Errors Power=float(0.25,0,1) +#@gui :9. Error Bias=float(0.5,0,1) +#@gui :10. Tile Shift Power=float(0.25,0,1) +#@gui :11. Mirror=choice("None","X","Y","XY") +#@gui :12. Rotate=choice("None,"90 Clockwise","180","90 Anticlockwise") +#@gui :_=separator() +#@gui :_=note("Self-Bomb") +#@gui :13. Enable=bool(0) +#@gui :14. Mesh X=int(16,1,256) +#@gui :15. Mesh Y=int(16,1,256) +#@gui :16. Mesh Smoothness=float(0.5,0,10) +#@gui :17. Contrast Scheme=choice(1,"Arctan","Clip","Power) +#@gui :18. Mesh Contrast=float(75,0,100) +#@gui :19. Scale X=float(1,0.05,16) +#@gui :20. Scale Y=float(1,0.05,16) +#@gui :21. Interpolation=choice(0,"None","Nearest","Average","Bilinear","Grid","Bicubic") +#@gui :22. Normalise=bool(0) +#@gui :23. Output Mesh=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui :_=separator() +#@gui :_=note("Author: Joan Rake, \'borrowed\' from David Tschumperlé. Latest Update: 2017/05/07.") +#@gui JFIF Effects Extended:fx_jfif_xt,fx_jfif_xt_preview(0) +#@gui :_=note("A poorly-implemented JFIF encoder with extras, all designed to screw with images. Quite slow and very aggressive.") +#@gui :1. Quality (%)=float(50,0,100) +#@gui :2. Size X=int(8,1,100) +#@gui :3. Size Y=int(8,1,100) +#@gui JPEG Encoder:fx_jpeg_preview +#@gui :_=separator() +#@gui :1. Quality=float(80,0,100) +#@gui :2. Colour Space=choice(21,"RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :3. Channel 1 Block Width=int(8,2,32) +#@gui :4. Channel 1 Block Height=int(8,2,32) +#@gui :5. Channel 2 Block Width=int(16,2,32) +#@gui :6. Channel 2 Block Height=int(16,2,32) +#@gui :7. Channel 3 Block Width=int(16,2,32) +#@gui :8. Channel 3 Block Height=int(16,2,32) +#@gui :Toggle Block Offsets=bool(0) +#@gui :9. Channel 1 Block X Offset=int(0,-32,32) +#@gui :10. Channel 1 Block Y Offset=int(0,-32,32) +#@gui :11. Channel 2 Block X Offset=int(0,-32,32) +#@gui :12. Channel 2 Block Y Offset=int(0,-32,32) +#@gui :13. Channel 3 Block X Offset=int(0,-32,32) +#@gui :14. Channel 3 Block Y Offset=int(0,-32,32) +#@gui Multi-Mosaic:fx_jr_multi_mosaic_preview +#@gui :_=separator() +#@gui :0. Recompute=button() +#@gui :1. Iterations=int(3,1,10) +#@gui :_=separator() +#@gui :_=note("Mosaic") +#@gui :2. Lowest Density=float(15,0,100) +#@gui :3. Highest Density=float(45,0,100) +#@gui :4. Details Influence=float(50,0,100) +#@gui :5. Details Smoothness=float(0,0,100) +#@gui :6-8. Colour Balance=color(#808080) +#@gui :9. Luma Range=float(0,0,100) +#@gui :10. Chroma Range=float(0,0,100) +#@gui :11. Hue Range=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("Edges [Gradient Norm]") +#@gui :12. Opacity=float(1,-1,1) +#@gui :13. Smoothness=float(0,0,10) +#@gui :14. Linearity=float(0.5,0,1.5) +#@gui :15. Min Threshold=float(0,0,100) +#@gui :16. Max Threshold=float(100,0,100) +#@gui :17. Thickness=int(1,1,10) +#@gui :18-20. Color=color(#000000) +#@gui :21. Luma Range=float(0,0,100) +#@gui :22. Chroma Range=float(0,0,100) +#@gui :23. Hue Range=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("Final Edge Blend") +#@gui :24. Edge Blend=bool(1) +#@gui :25. Smoothness=float(15,0,100) +#@gui :_=separator() +#@gui :_=note("Smooth [Diffusion]") +#@gui :26. Iterations=int(16,0,100) +#@gui :27. Sharpness=float(0.5,0,2) +#@gui :28. Anisotropy=float(1,0,1) +#@gui :29. Gradient Smoothness=float(3,0,10) +#@gui :30. Tensor Smoothness=float(5,0,10) +#@gui :31. Time Step=float(15,5,50) +#@gui :_=separator() +#@gui :_=note("Local Normalization") +#@gui :32. Amplitude=float(2,0,60) +#@gui :33. Radius=int(6,1,64) +#@gui :34. Neighborhood Smoothness=float(5,0,40) +#@gui :35. Average Smoothness=float(20,0,40) +#@gui :36. Constrain Values=bool(1) +#@gui :37 .Channel(s)=choice(2,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui Pseudo-ECB (Electronic Code Book Algorithm):pseudo_ecb,_pseudo_ecb_preview(0) +#@gui :_=note("This filter is inspired by one of the glitch plugin for Paint.NET. This doesn't actually emulate how the codebook encryption algorithm actually work, but it is inspired from it. This filter uses bomb blending mode which involves RGBA Transfer Function Mesh. See Mesh Blend filter for a link. \n\n Note that the filter works best on images with large patches of single colors. ") +#@gui :_=separator() +#@gui :_=note("Color Space Choice \n\n Keep in mind that you may not necessarily get what you imagine. Just treat these as themes. ") +#@gui :Colour Space=choice("RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :_=separator() +#@gui :_=note("Final Color Processing \n\n This refers to the how the colors are going to be processed. If you find that there's too little difference in hues or chroma or luminosity in local areas, this should be on. Sometimes, the result are better without the final processing.") +#@gui :Equalize Filter=bool(0) +#@gui :Pseudo-Coloring=bool(1) +#@gui :Tonality Blend=choice(20,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Tonality Blend Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("ECB Pattern Key Generator") +#@gui :Double Gradient?=bool(1) +#@gui :Length of Gradient#1=float(5,0,32) +#@gui :ECB Gradient#1 Angle=float(0,0,360) +#@gui :ECB Inversion#1=bool(0) +#@gui :Length of Gradient#2=float(5,0,32) +#@gui :ECB Gradient#2 Angle=float(90,0,360) +#@gui :ECB Inversion#2=bool(0) +#@gui :Gradient Blend=choice(41,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Gradient Blend Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Sharpen Filtering") +#@gui :Sharpening Noise Processing=float(15,0,200) +#@gui :_=separator() +#@gui :_=note("ECB Image Processing") +#@gui :Transfer Mesh Size for Image (Squared)=int(256,2,256) +#@gui :Image Mesh Contrast=int(75,25,100) +#@gui :Transfer Mesh Size for Gradient (Squared)=int(16,2,256) +#@gui :Gradient Mesh Contrast=int(100,25,100) +#@gui :Double Encryption Effect=bool(1) +#@gui :Inner Blend=choice(41,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Inner Blend Opacity=float(1,0,1) +#@gui :Outer Blend=choice(41,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Outer Blend Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Self-Image Post-Processing \n\n This invokes a self-blending operation after the main pseudo-ecb has been generated with different blend mode.") +#@gui :Activate Self-Image Post-Processing=bool(1) +#@gui :Equalize ECB Processing=bool(0) +#@gui :Pseudo-Coloring=bool(1) +#@gui :Self-Blend=choice(41,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Self-Blend Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Multilayer processing\n\nWarning:All layer must be of same size for expected result!") +#@gui :Apply to All Layers?=bool(0) +#@gui :Boundary Condition=choice(0,"Neumann","Periodic","Mirror") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10) +#@gui :_=separator() +#@gui :_=note("Author : Reptorian Latest update: 2018/12/30.") +#@gui Row Shifter:fx_row_shift,fx_row_shift_preview(0) +#@gui :_=note("Shifts rows.") +#@gui :_=separator() +#@gui :Order=choice("X Then Y","Simultaneous","Y Then X") +#@gui :X Shift=float(0,-5,5) +#@gui :X Centre=float(0.5,0,1) +#@gui :Y Shift=float(0,-5,5) +#@gui :Y Centre=float(0.5,0,1) +#@gui :Interpolation=choice(3,"None","Nearest","Average","Bilinear","Grid","Bicubic","Lanczos") +#@gui :Invert Shifts=bool(0) +#@gui Sawtoother [CMY(-K)]:sawtoother_cmy_k,sawtoother_cmy_k_preview(1)+ +#@gui :_=note("Splits image into CMY or CMYK channels and uses modulo operations to generate sawtooth waves and map channel intensities to them.") +#@gui :_=note("This filter was intended for screwing up images but it can also be used for quick analysis among other things.") +#@gui :_=separator() +#@gui :_=note("Cyan") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Magenta") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Yellow") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Key") +#@gui :Include Channel=bool(0) +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui Sawtoother [HSX]:sawtoother_hsx,sawtoother_hsx_preview(1)+ +#@gui :_=note("Splits image into HSV, HSI or HSL channels and uses modulo operations to generate sawtooth waves and map channel intensities to them.") +#@gui :_=note("This filter was intended for screwing up images but it can also be used for quick analysis among other things.") +#@gui :_=separator() +#@gui :_=note("Hue") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-180,180) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-180,180) +#@gui :_=separator() +#@gui :_=note("Saturation") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-1,1) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("Value/Intensity/Lightness") +#@gui :Channel=choice("Value","Intensity","Lightness) +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-1,1) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-1,1) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui Sawtoother [Lab8]:sawtoother_lab8,sawtoother_lab8_preview(1)+ +#@gui :_=note("Splits image into Lab8 channels and uses modulo operations to generate sawtooth waves and map channel intensities to them.") +#@gui :_=note("This filter was intended for screwing up images but it can also be used for quick analysis among other things.") +#@gui :_=separator() +#@gui :_=note("Luminance") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Chrominance a") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Chrominance b") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui Sawtoother [LCH8]:sawtoother_lch8,sawtoother_lch8_preview(1)+ +#@gui :_=note("Splits image into LCH8 channels and uses modulo operations to generate sawtooth waves and map channel intensities to them.") +#@gui :_=note("This filter was intended for screwing up images but it can also be used for quick analysis among other things.") +#@gui :_=separator() +#@gui :_=note("Luminance") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Chroma") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Hue") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui Sawtoother [RGB]:sawtoother_rgb,sawtoother_rgb_preview(1)+ +#@gui :_=note("Splits image into RGB channels and uses modulo operations to generate sawtooth waves and map channel intensities to them.") +#@gui :_=note("This filter was intended for screwing up images but it can also be used for quick analysis among other things.") +#@gui :_=separator() +#@gui :_=note("Red") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Green") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Blue") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui Sawtoother [sRGB]:sawtoother_srgb,sawtoother_srgb_preview(1)+ +#@gui :_=note("Splits image into sRGB channels and uses modulo operations to generate sawtooth waves and map channel intensities to them.") +#@gui :_=note("This filter was intended for screwing up images but it can also be used for quick analysis among other things.") +#@gui :_=separator() +#@gui :_=note("Red") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Green") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Blue") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui Sawtoother [XYZ8]:sawtoother_xyz8,sawtoother_xyz8_preview(1)+ +#@gui :_=note("Splits image into XYZ8 channels and uses modulo operations to generate sawtooth waves and map channel intensities to them.") +#@gui :_=note("This filter was intended for screwing up images but it can also be used for quick analysis among other things.") +#@gui :_=separator() +#@gui :_=note("X") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Y") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Z") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui Sawtoother [YCbCr-(-GLIC-JPEG)]:sawtoother_ycbcr,sawtoother_ycbcr_preview(1)+ +#@gui :_=note("Splits image into YCbCr channels and uses modulo operations to generate sawtooth waves and map channel intensities to them. One can choose between the original G'MIC implementation, the GLIC implementation, and the JPEG-style implementation by Garagecoder.") +#@gui :_=note("This filter was intended for screwing up images but it can also be used for quick analysis among other things.") +#@gui :Channel=choice("YCbCr","YCbCrGLIC","YCbCrJPEG") +#@gui :_=separator() +#@gui :_=note("Y (Luminance)") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Blue Chrominance") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Red Chrominance") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui Sawtoother [YIQ8]:sawtoother_yiq8,sawtoother_yiq8_preview(1)+ +#@gui :_=note("Splits image into YIQ8 channels and uses modulo operations to generate sawtooth waves and map channel intensities to them.") +#@gui :_=note("This filter was intended for screwing up images but it can also be used for quick analysis among other things.") +#@gui :_=separator() +#@gui :_=note("Y (Luminance)") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Chrominance I") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Chrominance Q") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui Sawtoother [YUV8]:sawtoother_yuv8,sawtoother_yuv8_preview(1)+ +#@gui :_=note("Splits image into YUV8 channels and uses modulo operations to generate sawtooth waves and map channel intensities to them.") +#@gui :_=note("This filter was intended for screwing up images but it can also be used for quick analysis among other things.") +#@gui :_=separator() +#@gui :_=note("Y (Luminance)") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Chrominance I") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :_=note("Chrominance Q") +#@gui :Factor=float(1,0,20) +#@gui :Shift=float(0,-256,256) +#@gui :Smoothness=float(0,0,10) +#@gui :Modulo=bool(1) +#@gui :Multiplier=float(1,0,20) +#@gui :Phase Shift=float(0,-256,256) +#@gui :_=separator() +#@gui :Tones Range=choice("All Tones","Shadows","Mid-Tones","Highlights") +#@gui :Tones Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui Shredder:fx_shredder,fx_shredder_preview(0) +#@gui :_=note("Re-fills an image with its own values but makes random jumps in the relative positions where the lookup for the values takes place. Can be channel-independent. Relative gap sizes are cubed to make it easier to use small gaps between jumps.") +#@gui :0. Recompute=button(0) +#@gui :1. Randomised Start=bool(1) +#@gui :2. Channels=choice("Correlated","RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :3. Alpha=bool(1) +#@gui :4. X Min Gap=float(0,0,100) +#@gui :5. X Max Gap=float(100,0,100) +#@gui :6. X Strength=float(0.5,0,1) +#@gui :7. Y Min Gap=float(0,0,100) +#@gui :8. Y Max Gap=float(100,0,100) +#@gui :9. Y Strength=float(0.5,0,1) +#@gui :10. Mirror=choice("None","X","Y","XY") +#@gui :11. Rotate=choice("None,"90 Clockwise","180","90 Anticlockwise") +#@gui Smooth EQ:fx_jr_smooth_eq,fx_jr_smooth_eq_preview(0) +#@gui :_=note("A zero-phase equaliser with low-pass and high-pass filters and 5 band shelves.") +#@gui :_=separator() +#@gui :_=note("Low Pass") +#@gui :Frequency Power=float(8,0,16) +#@gui :Order Cube Root=float(2,0,4) +#@gui :Resonance=float(0,0,5) +#@gui :_=separator() +#@gui :_=note("Band Shelf 1") +#@gui :Frequency Power=float(3,0,16) +#@gui :Order Cube Root=float(2,0,4) +#@gui :Bandwidth=float(1.5,0,16) +#@gui :Gain=float(0,-10,10) +#@gui :_=separator() +#@gui :_=note("Band Shelf 2") +#@gui :Frequency Power=float(4,0,16) +#@gui :Order Cube Root=float(2,0,4) +#@gui :Bandwidth=float(2,0,16) +#@gui :Gain=float(0,-10,10) +#@gui :_=separator() +#@gui :_=note("Band Shelf 3") +#@gui :Frequency Power=float(5,0,16) +#@gui :Order Cube Root=float(2,0,4) +#@gui :Bandwidth=float(2,0,16) +#@gui :Gain=float(0,-10,10) +#@gui :_=separator() +#@gui :_=note("Band Shelf 4") +#@gui :Frequency Power=float(6,0,16) +#@gui :Order Cube Root=float(2,0,4) +#@gui :Bandwidth=float(2,0,16) +#@gui :Gain=float(0,-10,10) +#@gui :_=separator() +#@gui :_=note("Band Shelf 5") +#@gui :Frequency Power=float(7,0,16) +#@gui :Order Cube Root=float(2,0,4) +#@gui :Bandwidth=float(2,0,16) +#@gui :Gain=float(0,-10,10) +#@gui :_=separator() +#@gui :_=note("High Pass") +#@gui :Frequency Power=float(3,0,16) +#@gui :Order Cube Root=float(2,0,4) +#@gui :Resonance=float(0,0,5) +#@gui :Colour Space=choice("RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :Alpha=bool(0) +#@gui :Absolute=bool(1) +#@gui :Makeup Gain=bool(1) +#@gui :Preview Frequency Response=bool(0) +#@gui Superstreak:fx_superstreak,fx_superstreak_preview(0) +#@gui :_=separator() +#@gui :1. Random Seed=int(10,0,65535) +#@gui :2. Iterations=int(10,1,20) +#@gui :3. Propagation=choice(3,"Backward","Forward","Bidirectional [Sharp]","Bidirectional [Smooth]") +#@gui :4. Min Threshold=float(0.50,0.00,1.00) +#@gui :5. Max Threshold=float(0.50,0.00,1.00) +#@gui :6. Min Step Size=float(10,0,100) +#@gui :7. Max Step Size=float(30,0,100) +#@gui UltraWarp 3:fx_ultrawarp3_preview +#@gui :_=separator() +#@gui :0. Recompute=button() +#@gui :1. Random Seed=int(-1,-1,65535) +#@gui :2. Iterations=int(1,1,10) +#@gui :3. Warp Magnitude=float(1,0,10) +#@gui :4. WM Range=float(1,0,10) +#@gui :5. Warp Angle=float(0,0,360) +#@gui :6. WA Range=float(360,0,360) +#@gui :7. Offset Magnitude=float(1,0,100) +#@gui :8. OM Range=float(1,0,100) +#@gui :9. Offset Angle=float(0,0,360) +#@gui :10. OA Range=float(360,0,360) +#@gui :11. Correlated Channels=bool(0) +#@gui :12. Interpolation=choice(1,"Nearest Neighbor","Linear") +#@gui :13. Boundary=choice(3,"Transparent","Nearest","Periodic","Mirror") +#@gui :14. Colour Space=choice("RGB","SRGB","CMY","RYB","Ohta8","Ohta","YES8","YES","Kodak 1-8","Kodak1","Lab8","Lab","Oklab","LUV","Jzazbz","YIQ8","YIQ","YUV8","YUV","YCbCr","YCbCrGLIC","YCbCrJPEG","YDbDr","XYZ8","XYZ","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","JzCzHz","HCY") +#@gui :_=separator() +#@gui :15. Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :0. Recompute=button() +#@gui :1. Density=float(15,0,100) +#@gui :2. Details Influence=float(50,0,100) +#@gui :3. X Offset Centre=float(0,-100,100) +#@gui :4. X Offset Range=float(25,0,200) +#@gui :5. Y Offset Centre=float(0,-100,100) +#@gui :6. Y Offset Range=float(25,0,200) +#@gui :7. Z Offset Centre=float(0,-100,100) +#@gui :8. Z Offset Range=float(0,0,200) +#@gui :9. Rot Angle Centre=float(0,-360,360) +#@gui :10. Rot Angle Range=float(360,0,360) +#@gui :11. Rot Axis X Centre=float(0,-1,1) +#@gui :12. Rot Axis X Range=float(0,0,2) +#@gui :13. Rot Axis Y Centre=float(0,-1,1) +#@gui :14. Rot Axis Y Range=float(0,0,2) +#@gui :15. Rot Axis Z Centre=float(1,-1,1) +#@gui :16. Rot Axis Z Range=float(0,0,2) +#@gui :17. AA Iterations=int(16,0,100) +#@gui :18. Sharpness=float(0,0,2) +#@gui :19. AA Anisotropy=float(1,0,1) +#@gui :20. AA Gradient Smoothness=float(1,0,10) +#@gui :21. Tensor Smoothness=float(5,0,10) +#@gui :22. Time Step=float(15,5,50) +#@gui _Details +#@gui 8-Bit Plane Splitter:fx_bitplane8,fx_bitplane8_preview(1) +#@gui :Mode=choice("Decompose","Recompose") +#@gui :Split Mode=choice(1,"Z Layers","Separate Images") +#@gui :Value Mode=choice("Real","1","255") +#@gui :Alpha=bool(0) +#@gui Bilinear Enhancement:fx_jr_bilinear,fx_jr_bilinear_preview(1) +#@gui :Overall Iterations=int(1,1,10) +#@gui :Bilateral Sub-Iterations=int(3,1,10) +#@gui :Spatial Variance=float(10,0,100) +#@gui :Value Variance=float(10,0,100) +#@gui :Amplitude=float(1,-10,10) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui _ +#@gui Mesh Blend:fx_mesh_blend,fx_mesh_blend_preview(1) +#@gui :_=note("Universal blending algorithm. Resizes an RGB(A) image to a 256x256 image and uses it as an RGBA LUT 'transfer function mesh' to blend two other images together. Based on method shown on discuss.pixls.us.") +#@gui :_=separator() +#@gui :_=note("[0] is bottom layer, [1] is top layer, [2] is mesh. Mesh origin is at bottom-left. Plugin GUI preview does not accurately show mesh.") +#@gui :Process As=choice(0,"Three-By-Three","Self-Mesh and Self-Blend for Each Layer") +#@gui :Resize Interpolation=choice(3,"None","Nearest","Average","Bilinear","Grid","Bicubic") +#@gui :Reverse Blending Layers=bool(0) +#@gui :Dimensions=choice("Bottom Layer","Top Layer") +#@gui :Blend Alpha Channels=bool(0) +#@gui :Keep Mesh=bool(0) +#@gui Rendering +#@gui Crazy Texture:fx_crazy_texture,fx_crazy_texture_preview(1) +#@gui :_=note("Generates black and white textures using deformed edge offsets applied to Poisson-disk noise. The textures can range from smoothly-deformed and trippy to gnarled and wood-like.") +#@gui :0. Recompute=button(0) +#@gui :_=separator() +#@gui :_=note("Poisson-Disk Noise") +#@gui :1. Radius=float(75,1,1000) +#@gui :2. Max Sampling Attempts=int(30,1,200) +#@gui :_=separator() +#@gui :_=note("Edge Offsets") +#@gui :3. Smoothness=float(0,0,10) +#@gui :4. Threshold=float(15,0,50) +#@gui :5. Scale=int(6,0,64) +#@gui :6. Thickness=int(3,0,32) +#@gui :7. Negative Colors=bool(0) +#@gui :_=separator() +#@gui :_=note("Deform 1") +#@gui :_=note("Set matrix density to 1 for automatic size (coarse)") +#@gui :8. Strength=float(15,0,30) +#@gui :9. Interpolation=choice("None","Bilinear","Bicubic") +#@gui :10. Matrix Density (%)=float(1,1,100) +#@gui :11. Matrix Interpolation (%)=choice(1,"Bilinear","Bicubic") +#@gui :12. Matrix Contrast=float(0,-100,100) +#@gui :_=separator() +#@gui :_=note("Deform 2") +#@gui :_=note("Set matrix density to 1 for automatic size (fine)") +#@gui :13. Strength=float(1.5,0,30) +#@gui :14. Interpolation=choice("None","Bilinear","Bicubic") +#@gui :15. Matrix Density (%)=float(1,1,100) +#@gui :16. Matrix Interpolation (%)=choice(1,"Bilinear","Bicubic") +#@gui :17. Matrix Contrast=float(0,-100,100) +#@gui :_=separator() +#@gui :_=note("This can slow things down a lot if both deform strengths are high!") +#@gui :18. Accurate Boundaries=bool(1) +#@gui :19. Crop Strength=float(1,0,1) +#@gui Rectexture:fx_rectexture,fx_rectexture(1) +#@gui :_=note("Generates textures from rectangles, difference blending and warping.") +#@gui :Recompute=button() +#@gui :Iterations=int(10,0,500) +#@gui :Colours=choice(3,"Random Colours (Difference Blending)","Random Colours (Diffblend + Sine Mapping)","Random Colours (Diffblend + Sinemap + Random HSV Mixing)","Black and White") +#@gui :Warp Multiplier=float(1,0,5) +#@gui :Warp Boundary=choice(5,"Random","Random [non-Transparent]","Transparent","Nearest","Periodic","Mirror") +#@gui :Channel(s)=choice(2,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui __KaRo's Tests +#@gui About:_none_,karos_about +#@gui :_=note("KaRo's test files for G'MIC\n\written by") +#@gui :_=link("Karsten Rodenacker","http://K.Rodenacker.de") +#@gui :_=note("\n") +#@gui :_=note("The source code of this set of filters is located at :") +#@gui :_=link("https://github.com/GreycLab/gmic-community/blob/master/karsten_rodenacker.gmic") +#@gui :_=note("Some help can be found under ") +#@gui :_=link("http://karo03.bplaced.net/gmic/html/") +#@gui :_=separator() +#@gui :_=note{"Several operations here rely on external executables existing in search PATH ($PATH unter Mac/Unix). This means that the executable is downloaded or built and properly located on the local machine. E. g. CImg examples from github have to be built and copied to a location in the search path, (under unix /usr/local/bin). Similar with PINK executables. For Mac they have to be built according the README with ./makelin and PATH as to be extended by ..pink location../linux/bin."} +#@gui :_=separator() +#@gui :_=note(" CImg Skeleton: use_skeleton and \n CImg nlmeans: use_nlmeans in search PATH, sources are under: ") +#@gui :_=link("https://github.com/GreycLab/CImg/blob/master/examples/") +#@gui :_=note(" mM Differences: \n mathematical morphology operation differences\nmM operation size - mM operation size2") +#@gui :_=note(" oC Differences: \n mathematical morphology open/close differences\nmM open size - mM close size") +#@gui :_=note(" Pink operations binary: Pink applications in search PATH") +#@gui :_=link("https://perso.esiee.fr/~coupriem/Pink/doc/html/index.html") +#@gui :_=separator() +#@gui :_=note("\nThe functions defined are quite experimental and subject to changes. Please do not rely on the fact that they will perform equally forever.") +#@gui CImg NL-Means:fx_karo_cimg_nlmeans,fx_karo_cimg_nlmeans_preview(0) +#@gui :Add Gauss Noise=float(0.0,0.0,30.0) +#@gui :Add Uniform Noise=float(0.0,0.0,30.0) +#@gui :Add Salt & Pepper Noise=float(0.0,0.0,30.0) +#@gui :Half Size of Patch=int(1,1,15) +#@gui :Band Width Lambda=float(-1,-1,25) +#@gui :Noise SD Sigma=float(-1,-1,25) +#@gui :Neighborhood Size Alpha=int(3,1,15) +#@gui :Sampling Step Size=int(2,1,5) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note(Smoothing using CImg example plugin use_nlmeans.) +#@gui :_=note("CImg nlmeans: use_nlmeans in search PATH") +#@gui :_=separator() +#@gui :_=note("Author : KaRo. Latest update : 2019/09/03.") +#@gui CImg Skeleton:fx_karo_cimg_skel,fx_karo_cimg_skel_preview(0) +#@gui :Auto-Threshold=bool(1) +#@gui :Threshold (%)=float(50,0,100) +#@gui :Size Median=int(0,0,15) +#@gui :Invert=bool(false) +#@gui :Threshold on Flux=float(-0.3,-5,5) +#@gui :Medial Curve=bool(false) +#@gui :Torsello Correction=bool(false) +#@gui :Discrete Step=int(1,1,15) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note(Skeleton using CImg example plugin use_skeleton.) +#@gui :_=note("CImg Skeleton: use_skeleton in search PATH") +#@gui :_=separator() +#@gui :_=note("Author : KaRo. Latest update : 2012/10/26.") +#@gui MM Differences:fx_karo_mm_diff,fx_karo_mm_diff_preview(0) +#@gui :Size=int(5,1,25) +#@gui :Size2=int(7,1,25) +#@gui :Operation=choice(2,"Erosion","Dilation","Open","Close") +#@gui :Shape=choice(1,"Square","Octagon","Circle") +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Scale=bool(true) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Arithmetical difference of a morphological operation of size and size2.") +#@gui :_=separator() +#@gui :_=note("Author : KaRo. Latest update : 2012/10/26.") +#@gui OC Differences:fx_karo_oc_diff,fx_karo_oc_diff_preview +#@gui :Size=int(5,2,25) +#@gui :Shape=choice(1,"Square","Octagon","Circle") +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :Scale=bool(true) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Difference of mean of morphological opening and closing with original.") +#@gui :_=separator() +#@gui :_=note("Author : KaRo. Latest update : 2013/07/04.") +#@gui Pink Operator:fx_karo_pink,fx_karo_pink_preview +#@gui :Pink Operator=choice("Wshedtopo","Wshedtopo Inv","Minima","Maxima","Heightminima","Heightmaxima","Grayskel","Htkern","Htkernu","Lvkern","Lvkernu","Saliency","Asf","Asflin","Asfr","Asft","Asftmed","Asftndg","Dilatballnum","Erosballnum","Lintophat") +#@gui :Connectivity / Dir=choice("Four/x","Eight/y") +#@gui :Smoothness=float(0,0,5) +#@gui :Height/Rep=int(5,0,25) +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=link("https://perso.esiee.fr/~coupriem/Pink/doc/html/") +#@gui Pink Operator Binary:fx_karo_pink_bin,fx_karo_pink_bin_preview +#@gui :Auto-Threshold=bool(1) +#@gui :Threshold (%)=int(50,0,100) +#@gui :Pink Operator=choice(3,"Skelpar","Skelend","Skelcurv","Skeleton","Barycentre","Border","Closeball","Openball","Convexhull","Dist","Distc","Label Pla","Lantuejoul") +#@gui :Connectivity / Dir=choice("Four/x","Eight/y") +#@gui :Height/Rep=int(5,-1,25) +#@gui :Algorithm=int(4,0,31) +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note(Binary operations with Pink externals.) +#@gui :_=note("Diverse Pink executables in search PATH") +#@gui :_=separator() +#@gui :_=note("Author : KaRo. Latest update : 2014/02/05.") +#@gui :_=link("https://perso.esiee.fr/~coupriem/Pink/doc/html/") +#@gui Pink Test Operator Bianca:fx_karo_pink_bianca,fx_karo_pink_bianca_preview(0) +#@gui :ASF Smooth Size=int(5,1,10) +#@gui :Threshold (%)=int(60,0,100) +#@gui :Watershed Height Min=int(5,0,20) +#@gui :Opening Radius=int(1,0,10) +#@gui :Invert=bool(0) +#@gui :Use G Instead of B=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note(Pink test operator Bianca for RGB image; only B used.) +#@gui :_=note("Pink executables in search PATH or C:\\Pink\\bin\\ for Windows") +#@gui :_=separator() +#@gui :_=note("Author : KaRo. Latest update : 2012/10/26.") +#@gui :_=link("https://perso.esiee.fr/~coupriem/Pink/doc/html/files.html") +#@gui _Lylejk +#@gui Blend [Shape Average]:fx_blend_shapeaverage,fx_blend_shapeaverage(0) +#@gui :Preserve Shading=bool(1) +#@gui :Transparency=bool(0) +#@gui :Revert Layers=bool(0) +#@gui :_=note("Note: This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2011/19/10.") +#@gui Lylejk Luma Invert:Lylejk_Luma_Invert,Lylejk_Luma_Invert_preview(0) +#@gui :_=note("Pow") +#@gui :Value=float(1,0.5,4) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: samj. Latest update: 2018/05/03.") +#@gui Lylejk Quantize Wicker:Lylejk_Quantize_Wicker,Lylejk_Quantize_Wicker_preview(0) +#@gui :_=note("Quantize") +#@gui :Levels=int(16,2,256) +#@gui :_=note("Offset") +#@gui :X (%)=float(50,0,100) +#@gui :Y (%)=float(50,0,100) +#@gui :Offset=choice(0,"No","Yes") +#@gui :_=note("Superpixels") +#@gui :Size=int(16,4,64) +#@gui :Regularity=float(10,0,128) +#@gui :Iterations=int(5,1,16) +#@gui :Colors=choice(1,"Random","Average") +#@gui :Border Opacity=float(1,0,1) +#@gui :Border Color=color(#000000ff) +#@gui :_=note("Dilate") +#@gui :Dilatation=int(1,1,16) +#@gui :_=note("Lylejk_Wicker Rodilius") +#@gui :Amplitude=float(10,0,30) +#@gui :Thickness=float(10,0,100) +#@gui :Sharpness=float(153,0,1000) +#@gui :_=note("Sharpen Deblur") +#@gui :Sharpen Deblur=bool(0) +#@gui :Radius=float(2,0,20) +#@gui :Iterations=int(10,0,100) +#@gui :Time Step=float(20,0,50) +#@gui :Smoothness=float(0.1,0,10) +#@gui :Regularization=choice(1,"Tikhonov","Mean Curvature","Total Variation") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Authors: Lylejk - samj. Latest update: 2018/04/06.") +#@gui Lylejk Ribbon:Lylejk_Ribbon,Lylejk_Ribbon_preview(0) +#@gui :_=link("http://gimpchat.com/viewtopic.php?f=11&t=16390","http://gimpchat.com/viewtopic.php?f=11&t=16390") +#@gui :_=note("Fake Smudge") +#@gui :Amplitude=float(150,0,1000) +#@gui :Sharpness=float(0.42,0,2) +#@gui :Anisotropy=float(0.85,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(7.83,0,10) +#@gui :Spatial Precision=float(0.68,0.1,2) +#@gui :Angular Precision=float(19,1,180) +#@gui :Value Precision=float(2.64,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(2,1,10) +#@gui :_=note("Diffusion tensors") +#@gui :Resolution (%)=float(16,0,20) +#@gui :Size=float(3.44,0,16) +#@gui :Color Mode=choice(0,"Monochrome","Grayscale","Orientation","Color") +#@gui :Outline=int(3,0,16) +#@gui :Sharpness=float(0.79,0,1) +#@gui :Anisotropy=float(0.72,0,1) +#@gui :Gradient Smoothness=float(4.97,0,10) +#@gui :Tensor Smoothness=float(1.70,0,10) +#@gui :_=note("Fake Smudge") +#@gui :Amplitude=float(150,0,1000) +#@gui :Sharpness=float(0.42,0,2) +#@gui :Anisotropy=float(0.85,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(7.83,0,10) +#@gui :Spatial Precision=float(0.68,0.1,2) +#@gui :Angular Precision=float(19,1,180) +#@gui :Value Precision=float(2.64,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(2,1,10) +#@gui :_=note("Gradient Norm 3") +#@gui :Smoothness=float(0,0,10) +#@gui :Linearity=float(0.32,0,1.5) +#@gui :Min Threshold=float(43.1,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=note("Upscale [dcci2x] by Garagecoder") +#@gui :Upscale=choice(2,"No","Yes","Yes and No") +#@gui :Threshold=float(1.15,1,2) +#@gui :Exponent=int(5,1,6) +#@gui :Extend 1px=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Authors: Lylejk - samj. Latest update: 2020/10/24.") +#@gui Lylejk Ripple:ripple,ripple(0) +#@gui :Amplitude=float(10,-100,100) +#@gui :Bandwidth=float(20,1,300) +#@gui :Shape=choice(2,"Bloc","Triangle","Sine","Sine+","Random") +#@gui :Angle=float(0,-360,360) +#@gui :Offset=float(0,-500,500) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2011/23/08.") +#@gui Lylejk Test TRW:lylejk_test_TRW,lylejk_test_TRW_preview(0) +#@gui :_=note("Offset") +#@gui :X (%)=float(50,0,100) +#@gui :Y (%)=float(50,0,100) +#@gui :Offset=choice(1,"A","B") +#@gui :_=note("Superpixels") +#@gui :Size=int(16,4,64) +#@gui :Regularity=float(10,0,128) +#@gui :Iterations=int(5,1,16) +#@gui :Colors=choice(1,"Random","Average") +#@gui :Border Opacity=float(1,0,1) +#@gui :Border Color=color(#000000ff) +#@gui :_=note("Euclidean - Polar") +#@gui :X-Center (%)=float(50,0,100) +#@gui :Y-Center (%)=float(50,0,100) +#@gui :Stretch Factor=float(1,0.1,10) +#@gui :Boundary=choice(1,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=note("Lylejk_Wicker") +#@gui :_=note("Rodilius") +#@gui :Amplitude=float(1.8,0,30) +#@gui :Thickness=float(10,0,100) +#@gui :Sharpness=float(153,0,1000) +#@gui :_=note("Fake Smudge") +#@gui :Amplitude=float(150,0,1000) +#@gui :Sharpness=float(0.42,0,2) +#@gui :Anisotropy=float(0.85,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(7.83,0,10) +#@gui :Spatial Precision=float(0.68,0.1,2) +#@gui :Angular Precision=float(19,1,180) +#@gui :Value Precision=float(2.64,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(1,1,10) +#@gui :_=note("Gradient Norm 1") +#@gui :Smoothness=float(0,0,10) +#@gui :Linearity=float(0.5,0,1.5) +#@gui :Min Threshold=float(10.5,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=note("Gradient Norm 2") +#@gui :Smoothness=float(0,0,10) +#@gui :Linearity=float(0.5,0,1.5) +#@gui :Min Threshold=float(10.5,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=note("Upscale [dcci2x] by Garagecoder") +#@gui :Threshold=float(1.15,1,2) +#@gui :Exponent=int(5,1,6) +#@gui :Extend 1px=bool(1) +#@gui :_=note("Gradient Norm 3") +#@gui :Smoothness=float(0.68,0,10) +#@gui :Linearity=float(0.5,0,1.5) +#@gui :Min Threshold=float(10.5,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=note("Option Lylejk stencil") +#@gui :Apply Lylejk Stencil=bool(0) +#@gui :Amplitude=int(1,1,10) +#@gui :Sharpness=float(10,0,100) +#@gui :Radius=float(1,0,10) +#@gui :Channel(s)=choice(0,"All","RGBA","RGB","Luminance","Blue/red Chrominances","Blue Chrominance","Red Chrominance","Lightness","Ab-Components","A-Component","B-Component","Hue","Saturation","Value","Key","Alpha","Ch-Components","C-Component","H-Component","Red","Green","Blue","Alpha") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Authors: Lyle Kroll - samj. Latest update: 2018/04/06.") +#@gui Lylejk Wicker:Lylejk_Wicker,Lylejk_Wicker_preview(0) +#@gui :_=link("https://github.com/GreycLab/gmic-community/blob/master/tutorial/WickerTute.pdf","https://github.com/GreycLab/gmic-community/blob/master/tutorial/WickerTute.pdf") +#@gui :_=note("Rodilius") +#@gui :Amplitude=float(10,0,30) +#@gui :Thickness=float(10,0,100) +#@gui :Sharpness=float(153,0,1000) +#@gui :_=note("Fake Smudge") +#@gui :Amplitude=float(150,0,1000) +#@gui :Sharpness=float(0.42,0,2) +#@gui :Anisotropy=float(0.85,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(7.83,0,10) +#@gui :Spatial Precision=float(0.68,0.1,2) +#@gui :Angular Precision=float(19,1,180) +#@gui :Value Precision=float(2.64,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(1,1,10) +#@gui :_=note("Gradient Norm 1") +#@gui :Smoothness=float(0,0,10) +#@gui :Linearity=float(0.5,0,1.5) +#@gui :Min Threshold=float(10.5,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=note("Gradient Norm 2") +#@gui :Smoothness=float(0,0,10) +#@gui :Linearity=float(0.5,0,1.5) +#@gui :Min Threshold=float(10.5,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=note("Upscale [dcci2x] by Garagecoder") +#@gui :Threshold=float(1.15,1,2) +#@gui :Exponent=int(5,1,6) +#@gui :Extend 1px=bool(1) +#@gui :_=note("Gradient Norm 3") +#@gui :Smoothness=float(0.68,0,10) +#@gui :Linearity=float(0.5,0,1.5) +#@gui :Min Threshold=float(10.5,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=note("Option Lylejk stencil") +#@gui :Apply Lylejk Stencil=bool(0) +#@gui :Amplitude=int(1,1,10) +#@gui :Sharpness=float(10,0,100) +#@gui :Radius=float(1,0,10) +#@gui :Channel(s)=choice(0,"All","RGBA","RGB","Luminance","Blue/red Chrominances","Blue Chrominance","Red Chrominance","Lightness","Ab-Components","A-Component","B-Component","Hue","Saturation","Value","Key","Alpha","Ch-Components","C-Component","H-Component","Red","Green","Blue","Alpha") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Lyle Kroll. Latest update: 2018/04/03.") +#@gui Lylejk Woven:Lylejk_Woven,Lylejk_Woven_preview(0) +#@gui :_=link("http://gimpchat.com/viewtopic.php?f=11&t=16384&start=10#p226895","http://gimpchat.com/viewtopic.php?f=11&t=16384&start=10#p226895") +#@gui :_=note("Ripple 1") +#@gui :Amplitude=float(19.6,-100,100) +#@gui :Bandwidth=float(32.4,1,300) +#@gui :Shape=choice(1,"Bloc","Triangle","Sine","Sine+","Random") +#@gui :Angle=float(0,-360,360) +#@gui :Offset=float(0,-500,500) +#@gui :_=note("Ripple 2") +#@gui :Amplitude=float(19.6,-100,100) +#@gui :Bandwidth=float(32.4,1,300) +#@gui :Shape=choice(1,"Bloc","Triangle","Sine","Sine+","Random") +#@gui :Angle=float(0,-360,360) +#@gui :Offset=float(0,-500,500) +#@gui :_=note("Superpixels") +#@gui :Size=int(12,4,64) +#@gui :Regularity=float(10,0,128) +#@gui :Iterations=int(5,1,16) +#@gui :Colors=choice(1,"Random","Average") +#@gui :Border Opacity=float(1,0,1) +#@gui :Border Color=color(#000000ff) +#@gui :_=note("Ripple 3") +#@gui :Amplitude=float(19.6,-100,100) +#@gui :Bandwidth=float(32.4,1,300) +#@gui :Shape=choice(1,"Bloc","Triangle","Sine","Sine+","Random") +#@gui :Angle=float(0,-360,360) +#@gui :Offset=float(0,-500,500) +#@gui :_=note("Ripple 4") +#@gui :Amplitude=float(19.6,-100,100) +#@gui :Bandwidth=float(32.4,1,300) +#@gui :Shape=choice(1,"Bloc","Triangle","Sine","Sine+","Random") +#@gui :Angle=float(0,-360,360) +#@gui :Offset=float(0,-500,500) +#@gui :_=note("Fake Smudge") +#@gui :Amplitude=float(150,0,1000) +#@gui :Sharpness=float(0.61,0,2) +#@gui :Anisotropy=float(0.85,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(7.83,0,10) +#@gui :Spatial Precision=float(0.68,0.1,2) +#@gui :Angular Precision=float(19,1,180) +#@gui :Value Precision=float(2.64,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(1,1,10) +#@gui :_=note("Gradient Norm") +#@gui :Smoothness=float(0,0,10) +#@gui :Linearity=float(0.29,0,1.5) +#@gui :Min Threshold=float(37.2,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :_=note("Options Start With ...") +#@gui :Start With Blur=bool(0) +#@gui :Blur=float(2,0,20) +#@gui :Start With Quantize=bool(0) +#@gui :Quantize Levels=int(16,2,256) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Lyle Kroll. Latest update: 2018/04/22.") +#@gui Lylejk's Stencil:fx_lylejk_stencil,fx_lylejk_stencil(0) +#@gui :Amplitude=int(5,1,10) +#@gui :Sharpness=float(10,0,100) +#@gui :Radius=float(3,0,10) +#@gui :Channel(s)=choice("All","RGBA","RGB","Luminance","Blue/red Chrominances","Blue Chrominance","Red Chrominance","Lightness","Ab-Components","A-Component","B-Component","Hue","Saturation","Value","Key","Alpha","Ch-Components","C-Component","H-Component","Red","Green","Blue","Alpha") +#@gui :_=separator() +#@gui :_=note("Authors: Lyle Kroll, David Tschumperlé. Latest update: 2010/29/12.") +#@gui Lylejk Wicker 2:Lylejk_Wicker_2,Lylejk_Wicker_2_preview(0) +#@gui :_=link("https://github.com/GreycLab/gmic-community/blob/master/tutorial/wicker_tut.pdf","https://github.com/GreycLab/gmic-community/blob/master/tutorial/wicker_tut.pdf") +#@gui :_=note("Applying the tutorial from page 1 to 8") +#@gui :_=separator() +#@gui :_=note("Offset") +#@gui :X (%)=float(50,0,100) +#@gui :Y (%)=float(50,0,100) +#@gui :Offset=choice(1,"No","Yes") +#@gui :_=note("Euclidean - Polar") +#@gui :X-Center (%)=float(50,0,100) +#@gui :Y-Center (%)=float(50,0,100) +#@gui :Stretch Factor=float(1,0.1,10) +#@gui :Boundary=choice(1,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=note("Superpixels") +#@gui :Size=int(12,4,64) +#@gui :Regularity=float(10,0,128) +#@gui :Iterations=int(5,1,16) +#@gui :Colors=choice(1,"Random","Average") +#@gui :Border Opacity=float(1,0,1) +#@gui :Border Color=color(#000000ff) +#@gui :_=note("Fake Smudge") +#@gui :Amplitude=float(150,0,1000) +#@gui :Sharpness=float(0.54,0,2) +#@gui :Anisotropy=float(0.85,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(7.83,0,10) +#@gui :Spatial Precision=float(0.68,0.1,2) +#@gui :Angular Precision=float(19,1,180) +#@gui :Value Precision=float(2.64,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(3,1,10) +#@gui :_=note("Gradient Norm") +#@gui :Smoothness=float(0,0,10) +#@gui :Linearity=float(0.29,0,1.5) +#@gui :Min Threshold=float(28.7,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Improve Contrast") +#@gui :Apply a Contrast=choice(0,"No","Sharpen Deblur","Improve Contrast By Lyle Kroll") +#@gui :_=separator() +#@gui :_=note("Sharpen Deblur") +#@gui :Radius=float(1,0,20) +#@gui :Iterations=int(10,0,100) +#@gui :Time Step=float(20,0,50) +#@gui :Smoothness=float(0.1,0,10) +#@gui :Regularization=choice(1,"Tikhonov","Mean Curvature","Total Variation") +#@gui :_=separator() +#@gui :_=note("Improve Contrast By Lyle Kroll") +#@gui :_=note("Smooth Bilateral Contrast") +#@gui :Spatial Variance=float(10,0,100) +#@gui :Value Variance=float(12,0,100) +#@gui :Iterations=int(2,1,10) +#@gui :_=note("Fake Smudge Contrast") +#@gui :Amplitude=float(40,0,1000) +#@gui :Sharpness=float(0.7,0,2) +#@gui :Anisotropy=float(0.3,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(1.1,0,10) +#@gui :Spatial Precision=float(0.8,0.1,2) +#@gui :Angular Precision=float(30,1,180) +#@gui :Value Precision=float(2,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(3,1,10) +#@gui :_=note("Grain Merge Contrast") +#@gui :Amplitude=float(1,0,1) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Option Start With Quantize") +#@gui :Quantize=choice(0,"No","Yes") +#@gui :Levels=int(16,2,256) +#@gui :_=note("Option Euclidian To Polar") +#@gui :Euclidian To Polar=choice(1,"No","Yes") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Lyle Kroll. Latest update: 2018/04/07.") +#@gui Point Star Outline:garagecoder_lylejk_samj_points_outlines,garagecoder_lylejk_samj_points_outlines_preview(0) +#@gui :_=link("https://discuss.pixls.us/t/place-some-points-on-outlines-with-gmic/7006/5","https://discuss.pixls.us/t/place-some-points-on-outlines-with-gmic/7006/5") +#@gui :_=note("Choice Filter") +#@gui :Choice Filter=choice(0,"Garagecoder Staroutline","Garagecoder Pointoutline","Samj") +#@gui :_=note("Garagecoder Staroutline") +#@gui :Less Than Staroutline=float(0.05,0,0.5) +#@gui :Shapecloud=int(10,3,20) +#@gui :_=note("Garagecoder Pointoutline") +#@gui :Less Than Pointoutline=float(0.12,0,0.5) +#@gui :_=note("samj") +#@gui :Determination Contours=int(0,0,2) +#@gui :Type Rendu=int(0,0,2) +#@gui :Dilatation=int(2,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Authors: Garagecoder - Lyle Kroll - samj. Latest update: 2018/04/04.") +#@gui _Marcos Capelini +#@gui Film Grain:mc_film_grain,mc_film_grain_preview(0)* +#@gui :_=note("Grain Pattern") +#@gui :Grain Pattern File:=file() +#@gui :Texture Generator:=choice("Syntexturize","Patch Matching") +#@gui :_=separator() +#@gui :_=note("Blend") +#@gui :Blend Mode:=choice(1,"Grain Only","Grain Merge","Overlay","Soft Light","Hard Light","Alpha") +#@gui :Opacity (%):=float(20,0,100) +#@gui :_=separator() +#@gui :_=note("Grain Size") +#@gui :Film Format:=choice(0,"135 (35mm)","135 Half-Frame (Olympus PEN)","110 (Pocket Instamatic)","120 (Medium Format)","APS (H,C,P Auto-Detect)") +#@gui :Scale (%):=int(100,20,300) +#@gui :Micrograin:=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Grain Appearance") +#@gui :Blur/Sharpen:=float(0,-10,10) +#@gui :Contrast:=int(0,-100,100) +#@gui :Gamma:=int(0,-50,50) +#@gui :_=separator() +#@gui :_=note("Grain Normalise/Cut") +#@gui :Mode:=choice(1,"None","Normalise","Cut") +#@gui :Lowest Value:=int(0,0,127) +#@gui :Highest Value:=int(255,128,255) +#@gui :_=separator() +#@gui :_=note("Image Adustments") +#@gui :Blur/Sharpen:=float(0,-10,10) +#@gui :Highlight Compression:=float(0,0,10) +#@gui :_=separator() +#@gui :Preview:=choice("Filter Output","Grain Only","Filter Output + Debug Info","Grain Only + Debug Info") +#@gui :_=separator() +#@gui :_=note("Author: Marcos Capelini. Latest Update: 2023/04/25") +#@gui :_=note("Based on the \"Add Grain\" filter by: David Tschumperlé.") +#@gui :_=note("\n") +#@gui :Show Usage Tips=button(2) +#@gui _McCap +#@gui Hue Overlay Masks:fx_hue_overlay_masks,fx_hue_overlay_masks_preview(0) +#@gui :_=note("This plugin creates RGB hue masks. They are be exported in overlay mode into Gimp. Try each one to see how it changes your picture. Alternatively you can use them as masks to select regions based on hue.") +#@gui :_=separator() +#@gui :Stretch Constrast=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice(5,"Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right") +#@gui :_=separator() +#@gui :_=note("More details here.") +#@gui :_=separator() +#@gui :_=note("Author: McCap/pixls.us. Latest update: 2017/09/02.") +#@gui _Naggobot +#@gui Abstract Flood:fx_AbstractFlood,fx_AbstractFlood_Preview(1) +#@gui :_=separator() +#@gui :_=note("Warning: Really really slow filter especially with Cubism enabled. Use a maximum of 1 megapixel image. Random walk algorihm is used to select new areas to flood. If Cubism is enabled the filter has to run cubims for every succesful repeat defined in the flood settings section.") +#@gui :Preprocess with Bilateral Filtering=bool(1) +#@gui :Spatial Variance=float(10,0,100) +#@gui :Value Variance=float(7,0,100) +#@gui :Iterations=int(2,1,10) +#@gui :_=separator() +#@gui :_=note("Flood settings") +#@gui :Activate Flood=bool(0) +#@gui :Repeats=int(10,1,1000) +#@gui :Flood Tolerance=int(5,0,100) +#@gui :Flood Base Step=int(3,1,10) +#@gui :Canvas Color=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("Abstraction setting, Consider disabling preview if using high flood repeats!") +#@gui :Activate Cubism=bool(0) +#@gui :Cubism Iterations=int(300,1,2000) +#@gui :Bloc Size=float(10,0,40) +#@gui :Angle=float(90,0,360) +#@gui :Opacity=float(0.7,0.01,1) +#@gui :Smoothness=float(0,0,5) +#@gui :_=note("Opacity threshold used to make decision about flooding. Use 0 if Cubism is not enabled.") +#@gui :Opacity Tolerance=int(0,0,254) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2013/09/28.") +#@gui :_=link("Filter Explained here","http://www.flickr.com/photos/naggobot/6243715666") +#@gui Black & White Film:fx_bwfilmsimulate,fx_bwfilmsimulate_preview(1) +#@gui :Film Type / RGB Balance=choice(0,"Manual","Agfa 200X","Agfapan 25","Agfapan 100","Agfapan 400","Iford Delta 100","Iford Delta 400","Iford Delta 400 Pro & 3200","Ilford FP4","Ilford HP4","Ilford Pan F","Ilford SFX","Ilford XP2 Super","Kodak Tmax 100","Kodak Tmax 400","Kodak Tri-X") +#@gui :_=note("Simpler version available in main tree. This filter will be removed in future from testing. PM me if you need this for some reason.") +#@gui :_=note("RGB sliders work only with manual selection") +#@gui :Red Level=float(0.299,0,1) +#@gui :Red Smoothness=float(0,0,10) +#@gui :Green Level=float(0.587,0,1) +#@gui :Green Smoothness=float(0,0,10) +#@gui :Blue Level=float(0.114,0,1) +#@gui :Blue Smoothness=float(0,0,10) +#@gui :_=separator() +#@gui :Gamma=float(1,0.01,5) +#@gui :Contrast=float(1,0,4) +#@gui :Brightness=float(0,-255,255) +#@gui :Hue=float(0,0,360) +#@gui :Saturation=float(0,0,1) +#@gui :_=separator() +#@gui :Grain (Shadows)=float(0,0,200) +#@gui :Grain (Midtones)=float(0,0,200) +#@gui :Grain (Highlights)=float(0,0,200) +#@gui :Grain Tone Fading=float(2,0,10) +#@gui :Grain Scale=float(0,0,3) +#@gui :Grain Type=choice("Gaussian","Uniform","Salt and Pepper","Poisson") +#@gui :_=separator() +#@gui :Local Contrast=float(0,0,60) +#@gui :Radius=int(16,1,512) +#@gui :Contrast Smoothness=float(4,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : David Tschumperlé, Arto Huotari;. Latest update : 2019/09/28.") +#@gui __Artistic +#@gui Blockism:fx_blockism,fx_blockism_preview(1) +#@gui :_=note("Renders rectangles on to the image.") +#@gui :_=note("Parameters") +#@gui :Relative Size=float(3,0,20) +#@gui :Ratio=float(1.6,1,10) +#@gui :Size Variance=float(0.5,0,10) +#@gui :Relative Block Count=int(50,0,500) +#@gui :Opacity=float(0.5,0,1) +#@gui :Flip Tolerance=int(64,0,255) +#@gui :Reverse Flip=bool(0) +#@gui :Colorspace=choice("Lab","RGB") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=link("Filter Explained here","http://www.flickr.com/photos/naggobot/8063058705/") +#@gui :_=separator() +#@gui :_=note(" Author: Arto Huotari Latest update : 2012/10/07.") +#@gui _Testing +#@gui Naggobot +#@gui Composition Analysis:fx_CompositionAnalysis,fx_no_preview +#@gui :_=note("A tool to abstract the image for subjective composition analysis. Two different methods are available. Set filter output to New layers. For actual analysis the aesthetic sense of the artist is required.") +#@gui :Method=choice(0,"Thumbnail Abstraction","Value and Lines") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2015/01/17.") +#@gui Dodge Sketch:fx_dodgesketch,fx_dodgesketchpreview(0) +#@gui :_=note("Simple BW sketch") +#@gui :_=link("Method is described here","http://www.gimpusers.com/tutorials/making-a-pencil-drawing-from-a-photo.html") +#@gui :_=note("in addition an option to color the sketch is included") +#@gui :_=separator() +#@gui :_=note("Power setting for sketch") +#@gui :Power=int(3,0,10) +#@gui :_=separator() +#@gui :_=note("Presmoothing settins of bilateral filter") +#@gui :Spatial Variance=float(10,0,100) +#@gui :Value Variance=float(7,0,100) +#@gui :Iterations=int(2,1,10) +#@gui :_=separator() +#@gui :Colored?=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2013/09/28.") +#@gui Exposure Fusion Weight Map:fx_ExposureWeightMap,fx_ExposureWeightMapPreview(1) +#@gui :_=separator() +#@gui :_=note("Create exposure fusion weight map") +#@gui :_=separator() +#@gui :_=note("Set filter output to "New layers". Copy filter output to corresponding layer mask. Use aligned layers to combine multiple exposures.") +#@gui :_=separator() +#@gui :Contrast Bias=float(0.3,0,1) +#@gui :Saturation Bias=float(0.3,0,1) +#@gui :Exposure Sigma=float(0.2,0,1) +#@gui :Exposure Bias=float(0.3,0,1) +#@gui :BlurMap=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note(" Author: Arto Huotari Latest update : 2014/11/30 v2.") +#@gui GMic Structure Tensors:fx_StructureTensors,fx_StructureTensorsPreview(0) +#@gui :_=separator() +#@gui :_=note("Structure tensors calculation for Gimp plugin. This is just an interface to built in GMic Structure tensors command") +#@gui :Power=float(0.1,0.1,2) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2011/12/06.") +#@gui Import 16bits Image:fx_import_image_16,fx_import_image_16 +#@gui :_=note("Filter can be used to import and adjust 16 bit images to Gimp. Plugin may have limited set of import formats available depending on compilation. At minimum only .png should work reliably.") +#@gui :_=note("1. Create new empty image to Gimp") +#@gui :_=note("2. Open G'Mic from filters menu") +#@gui :_=note("3. Set G'Mic output to "new layers") +#@gui :_=note("4. Select 16 bit image from folder") +#@gui :_=note("5. Make adjustments using sliders") +#@gui :_=note("6. Image will be outputted to Gimp") +#@gui :_=note("By default a scaled down image is processed. Before processing full size disable preview window from gui.") +#@gui :_=note("LAB adjustment often yields more aesthetic results than RGB adjustment.") +#@gui :Input Image=file() +#@gui :Process Selection=choice(1,"Preview Only","Histogram","Logarithmic Histogram","Full Resolution") +#@gui :Gamma=float(2.2,0,5) +#@gui :_=separator() +#@gui :_=note("LAB adjustment") +#@gui :Brightness=float(0,-1,1) +#@gui :Contrast=float(1,0,3) +#@gui :Equalize=float(0,0,1) +#@gui :Saturation=float(0,-1,10) +#@gui :A(R-G)=float(0,-1,1) +#@gui :B(Y-B)=float(0,-1,1) +#@gui :_=separator() +#@gui :_=note("RGB cut and normalize histogram by percentage") +#@gui :Cut Highlight Values=float(100,0,100) +#@gui :Cut Dark Values=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("Author: Arto Huotari;. Latest update: 2014/04/02.") +#@gui Luminance to Alpha:fx_split_luminance,fx_split_luminance(1) +#@gui :_=note("Filter splits image to different levels of Luminance. Set preview output to "all outputs". Order of output to Gimp from top to bottom is Midtones,Light,LL,..,Dark,DD,.. If reduced overlap is used then first Light layer is removed from output as redundant if more than one level is processed. Mutilevel output becomes Midtones,,LL,LLL,..,Dark,DD,DDD.. with intermediary light and dark levels containing midtones. ") +#@gui :_=separator() +#@gui :Levels=int(1,1,6) +#@gui :Output as Alpha=bool(1) +#@gui :Reduce Overlap=bool(1) +#@gui :_=separator() +#@gui :_=note("Use keep[] or remove[] to select output images") +#@gui :Keep Custom=bool(0) +#@gui :Keep Custom=text(0,keep.) +#@gui :_=separator() +#@gui :_=note("Author: Arto Huotari;. Latest update: 2014/04/13.") +#@gui Make Old Squiggly:fx_OldSquiggly,fx_OldSquiggly +#@gui :_=note("Development version. This version will be removed in future from sources so if you prefer this then copy and save the source to your local .gmic file") +#@gui :Spread Noise Amount=float(2,0,20) +#@gui :Segmentation Edge Threshold=float(12,0,15) +#@gui :Segmentation Smoothness=float(0.8,0,5) +#@gui :GradienNormSmoothness=float(0,0,10) +#@gui :GradienNormLinearity=float(0.5,0,1.5) +#@gui :IncreaseChroma1=float(3,1,4) +#@gui :Tone Threshold=float(0.2,0,1) +#@gui :Tone Gamma=float(0.4,0,1) +#@gui :Paper Grayness=int(50,0,255) +#@gui :Paper Whiteness=int(245,0,255) +#@gui :Squiggle Gamma=int(45,1,128) +#@gui :Squiggle Multiplier=float(0.5,0,1) +#@gui Mapped Smoothing:fx_MappedSmooth,fx_MappedSmooth +#@gui :_=separator() +#@gui :_=note("Two layers required if automap is not used. Set input to active and below. Filter Smooths image with a vector field map. Map is created from R and G channels so that R128,G128 becomes [0 0]. Experiment with solid 128,128,0 color layer and add hues of red and green. Angle shift rotates the vector field and Zero point offset moves the default 0 0 point. This is somewhat a development version, sample art is still missing.") +#@gui :_=separator() +#@gui :Map Type=choice("Automap","Layer Map") +#@gui :Angle Shift=float(0,-180,180) +#@gui :Zero Point Offset=float(0,-128,128) +#@gui :Amplitude=float(300,10,10000) +#@gui :Vector Length Multipler=float(1,0.1,5) +#@gui :_=separator() +#@gui :_=note("Optional viewing of vector field") +#@gui :Show Quiver=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2012/02/25.") +#@gui Night HDR Image Black Noise Correction:fx_fix_HDR_black,fx_fix_HDR_black_preview(0) +#@gui :_=note("Filter to remove blue, magenta and red noise from the black areas of HDR images. Filter is designed specifically for HDR night shots but may work on other images as well. Bilateral filtering and Haar Wavelets are used to filter the noise from the image and mask is used to apply the noise removal only to dark areas.") +#@gui :_=separator() +#@gui :_=note("Mask opacity settings, Black values must be lower than Highlight values. Tick Show mask to view mask and to see the effect of the sliders.") +#@gui :_=note("Black cutoff") +#@gui :X-Coord(1)=int(20,0,255) +#@gui :Y-Coord(1)=int(25,0,255) +#@gui :_=note("Highlight raising") +#@gui :X-Coord(2)=int(50,0,255) +#@gui :Y-Coord(2)=int(200,0,255) +#@gui :Show Mask=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note(" Author: Arto Huotari Latest update : 2013/11/02.") +#@gui Noise Painting:fx_noisepainting,fx_noisepainting_preview(0) +#@gui :_=note("A preprocess suggestion for the painting filter.") +#@gui :_=separator() +#@gui :_=note("Pre process for painting") +#@gui :Spread Noise=int(0,0,20) +#@gui :Additive Noise=int(0,0,30) +#@gui :Luminance Only=bool(0) +#@gui :_=separator() +#@gui :_=note("Painting abstration") +#@gui :Abstraction=int(5,1,10) +#@gui :Details Scale=float(2.5,0,5) +#@gui :Color=float(1.5,0,4) +#@gui :Smoothness=float(50,0,1000) +#@gui :Sharpen Shades=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note(" Author: Arto Huotari Latest update : 2012/07/12.") +#@gui Smooth Sketch:fx_SmoothSketch,fx_SmoothSketch_preview(0) +#@gui :_=note("Convert image to black and white sketch. By default gradient edges are used but if filter input set to Active and Below a premade edge layer can be used from the layer below. Sketch strength slider will not have any effect if premade edges layer is used.") +#@gui :_=separator() +#@gui :_=note("Sketch and edges") +#@gui :Create Sketch=bool(1) +#@gui :Sketch Strength=float(6,0,20) +#@gui :Sharpness=float(0.8,0,1) +#@gui :Anisotropy=float(0.3,0.1,1) +#@gui :Smoother Scaling=float(0.3,0.1,2.5) +#@gui :Smoother Degradation=float(0,0,1) +#@gui :Smoothing Amplitude=float(1000,1,3000) +#@gui :Smudge Angle=float(0,-180,180) +#@gui :_=separator() +#@gui :_=note("Empty area coloring") +#@gui :Coloring Density=float(50,0,200) +#@gui :Coloring Stroke Length=float(10,0,100) +#@gui :Coloring Style=choice(2,"Linear","Angular","Linear Wavy","Angular Wavy") +#@gui :Coloring Opacity=float(0.6,0,1) +#@gui :_=separator() +#@gui :_=note("Post processing parameters") +#@gui :Post Gamma=float(0.55,0.1,2) +#@gui :Fast=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2014/08/31.") +#@gui :_=link("Filter Explained here","http://www.flickr.com/groups/gmic/discuss/72157628307225747") +#@gui Vector Field Rotation Demo:fx_DemoVecRot,fx_DemoVecRot +#@gui :_=note("Vector field rotation and quiver sample") +#@gui :Angle Shift=float(0,-180,180) +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari with help from David Tschumperlé. Latest update : 2012/02/25.") +#@gui Warp Test:fx_WarpTest,fx_WarpTest +#@gui :_=separator() +#@gui :_=note("Two layers required if automap is not used. Set input to active and below. Filter offsetts image with a vector field map. Map is created from R and G channels so that R128,G128 becomes [0 0]. Experiment with solid 128,128,0 color layer and add hues of red and green. Angle shift rotates the vector field and Zero point offset moves the default 0 0 point. This is mainly for fun and testing.") +#@gui :_=separator() +#@gui :Map Type=choice("Automap","Layer Map") +#@gui :Angle Shift=float(0,-180,180) +#@gui :Zero Point Offset=float(0,-128,128) +#@gui :Vector Length Multipler=float(1,0.1,128) +#@gui :_=separator() +#@gui :_=note("Optional viewing of vector field") +#@gui :Show Quiver=bool(0) +#@gui :_=separator() +#@gui :_=note("Author : Arto Huotari. Latest update : 2012/02/28.") +#@gui _Okyl168 +#@gui Jobs Colors:fx_jobs_colors,fx_jobs_colors_preview +#@gui :Gamma=float(0,-2,2) +#@gui :Equalize=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Oberon Leung. Latest update: 2014/25/01.") +#@gui _PhotoComix +#@gui B&W Steampunk Pencil:fx_steampen,fx_steampen_preview(0) +#@gui :_=separator() +#@gui :Radius=float(0.95,0,4) +#@gui :Amplitude=float(14,0,200) +#@gui :Iterations=int(2,1,20) +#@gui :Steam Pressure=int(2,1,30) +#@gui :Lubrication=float(0.9,0,1.9) +#@gui :_=separator() +#@gui :Contrast FX=choice("None-Skip","L Normalization","Mask","Boost","Fast Tone Map") +#@gui :Equalize=bool(true) +#@gui :_=separator() +#@gui :_=note("For a more 'painted' effect") +#@gui :Add Painter's Touch=bool(false) +#@gui :_=note("If unchecked the 3 sliders below are disabled") +#@gui :_=separator() +#@gui :Painter's Touch Sharpness=float(0.5,0,2) +#@gui :Painter's Edge Protection Flow=float(0.75,0,1) +#@gui :Painter's Smoothness=float(0.48,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Last update : 2011/6/29 .") +#@gui Boost Screen:fx_compose_boostscreen,fx_compose_boostscreen +#@gui :Opacity=float(0.7,0,1) +#@gui :Revert Layers=bool(0) +#@gui :Opacity 2=float(0.7,0,1) +#@gui :_=note("This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Color Doping:fx_compose_colordoping,fx_compose_colordoping +#@gui :Opacity=float(1,0,1) +#@gui :Revert Layers=bool(0) +#@gui :_=note("This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Color Sketch:fx_colorsketchbw,fx_colorsketchbw_preview(0) +#@gui :Amplitude=float(300,0,4000) +#@gui :Density=float(50,0,100) +#@gui :Smoothness=float(1,0,10) +#@gui :Opacity=float(0.1,0,1) +#@gui :Edge=float(20,0,100) +#@gui :Fast Approximation=bool(1) +#@gui :Negative=bool(0) +#@gui :Quantize Colors=int(20,2,255) +#@gui :Color Smoothness=float(2,0.50,30) +#@gui :Mixer Mode=choice("Color Doping","Darken","Hard Light","Grain Merge","Lightness","Multiply","Value") +#@gui :Color Intensity=float(1,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2010/29/12.") +#@gui Color Stamp:fx_colorstamp,fx_colorstamp_preview(0) +#@gui :_=note("BW module,analog to Stamp filter") +#@gui :_=separator() +#@gui :Auto-Threshold=bool(1) +#@gui :Threshold=int(50,0,100) +#@gui :_=separator() +#@gui :_=note("Color module") +#@gui :Activate Color Module=bool(1) +#@gui :Quantize Colors=int(20,2,255) +#@gui :Color Smoothness=float(2,0,20) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Authors: PhotoComiX , Antaron, Mahvin, David Tschumperlé. Latest update : 2011/17/05.") +#@gui Comix Colors:fx_compose_comix_color,fx_compose_comix_color +#@gui :Opacity=float(1,0,1) +#@gui :Revert Layers=bool(0) +#@gui :Opacity 2=float(1,0,1) +#@gui :_=note("This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Dark Edges:fx_compose_darkedges,fx_compose_darkedges(0) +#@gui :Opacity=float(1,0,1) +#@gui :Edges Smoothness=float(0.5,0,5) +#@gui :Revert Layers=bool(0) +#@gui :Opacity 2=float(0.7,0,1) +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Dark Screen:fx_compose_darkscreen,fx_compose_darkscreen +#@gui :Opacity=float(0.7,0,1) +#@gui :Revert Layers=bool(0) +#@gui :Opacity 2=float(0.7,0,1) +#@gui :_=note("This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Graphic Boost-Old:fx_graphic_boost,fx_graphic_boost_preview(0) +#@gui :_=separator() +#@gui :_=note("Unsharp Mask controls") +#@gui :Radius=float(1.25,0,20) +#@gui :Darken=float(2,0,10) +#@gui :_=separator() +#@gui :Skip Others Steps=bool(false) +#@gui :_=note("Check for visual control, UNcheck to reactivate the other controls") +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("BW_Pencil Controls") +#@gui :Pencil Size=float(0.15,0,4) +#@gui :Pencil Amplitude=float(14,0,200) +#@gui :_=separator() +#@gui :Skip Others Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :Activate 'Pencil Smoother'=bool(true) +#@gui :_=note("If unchecked the 3 sliders below are disabled") +#@gui :Pencil Smoother Sharpness=float(0.5,0,2) +#@gui :Pencil Smoother Edge Protection=float(0.45,0,1) +#@gui :Pencil Smoother Smoothness=float(2,0,10) +#@gui :_=separator() +#@gui :Skip Others Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Merging Options") +#@gui :Swap Layers=bool(True) +#@gui :_=note("'Swap' change the effect of Merging and Intensity") +#@gui :Merging Option=choice("Hard Light","Grain Merge","Multiply","Color Burn","Overlay","Value","Darken","Stamp") +#@gui :Intensity=float(1,0,1) +#@gui :_=separator() +#@gui :Add Painter's Touch=bool(true) +#@gui :_=note("If unchecked the 3 sliders below are disabled") +#@gui :_=separator() +#@gui :Painter's Touch Sharpness=float(0.5,0,2) +#@gui :Painter's Edge Protection Flow=float(0.45,0,1) +#@gui :Painter's Smoothness=float(1,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/10/01.") +#@gui :_=link("Filter explained here","http://www.gimpchat.com/viewtopic.php?f=9&t=775") +#@gui Graphic Colors:fx_compose_graphicolor,fx_compose_graphicolor +#@gui :Opacity=float(0.6,0,1) +#@gui :Revert Layers=bool(0) +#@gui :Opacity 2=float(0.8,0,1) +#@gui :_=note("This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Graphic Novel-Old:fx_novelfx,fx_novelfx_preview(0) +#@gui :_=separator() +#@gui :_=note("Apply Local Normalization") +#@gui :Skip This Step=bool(false) +#@gui :_=separator() +#@gui :_=note("Local Normalization Controls") +#@gui :LN Amplititude=float(2,0,60) +#@gui :LN Size=float(6,0,64) +#@gui :LN Neightborhood-Smoothness=float(5,0,40) +#@gui :LN Average-Smoothness=float(20,0,40) +#@gui :_=separator() +#@gui :Skip All Other Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Pencil Options") +#@gui :Pencil Size=float(0.62,0,4) +#@gui :Pencil Amplitude=float(14,0,200) +#@gui :_=separator() +#@gui :Skip All Other Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :Activate 'Pencil Smoother'=bool(true) +#@gui :_=note("If unchecked the 3 sliders below are disabled") +#@gui :_=separator() +#@gui :Pencil Smoother Sharpness=float(0.5,0,2) +#@gui :Pencil Smoother Edge Protection=float(0.78,0,1) +#@gui :Pencil Smoother Smoothness=float(1.92,0,10) +#@gui :_=separator() +#@gui :Skip All Other Steps=bool(false) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Boost Merging Options") +#@gui :Swap Layers=bool(false) +#@gui :Boost Merging Option=choice("Overlay","Multiply","Soft Light","Color Burn","Darken","Stamp","Hard Light","Value","Grain Merge","Freeze") +#@gui :Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :Add Painter's Touch=bool(true) +#@gui :_=separator() +#@gui :Painter's Touch Sharpness=float(0.5,0,2) +#@gui :Painter's Edge Protection Flow=float(0.8,0,1) +#@gui :Painter's Smoothness=float(1.28,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/24/04.") +#@gui :_=link("Filter explained here","http://www.gimpchat.com/viewtopic.php?f=9&t=1582") +#@gui GraphiX Colors:fx_compose_graphixcolor,fx_compose_graphixcolor +#@gui :Opacity=float(1,0,1) +#@gui :Revert Layers=bool(0) +#@gui :_=note("This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Heavy Screen:fx_compose_heavyscreen,fx_compose_heavyscreen +#@gui :Opacity=float(0.6,0,1) +#@gui :Revert Layers=bool(0) +#@gui :Opacity 2=float(0.7,0,1) +#@gui :_=note("This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Metallic Grain:fx_metalgrain,fx_metalgrain_preview +#@gui :_=note("add a metallic grain adapt to pictorial and special effects") +#@gui :_=separator() +#@gui :_=note("dependent from 'Couleurs Metalliques' by Samj") +#@gui :_=separator() +#@gui :Intensity=float(0.5,0.1,1) +#@gui :Swap Layers=bool(false) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComix,a hack of a Samj filter. Latest update : 2012/29/02.") +#@gui Metallic Stencils:fx_metallicstencils,fx_metallicstencils_preview +#@gui :Set Mode=choice("Darken","Lighten","Overlay") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComix,a hack of a Samj filter. Latest update : 2012/03/10.") +#@gui Phoenix Steam-Pencil:fx_phoenix,fx_phoenix_preview(0) +#@gui :_=separator() +#@gui :_=note("Controls for 'Pencil' applied on a copy of original) +#@gui :_=separator() +#@gui :Radius=float(0.95,0,4) +#@gui :Amplitude=float(14,0,200) +#@gui :_=separator() +#@gui :_=note("Controls for 'Steam' applied on the Pencil layer) +#@gui :_=separator() +#@gui :Iterations=int(2,1,7) +#@gui :Steam Pressure=int(2,1,7) +#@gui :Lubrication=float(0.9,0,1.9) +#@gui :_=separator() +#@gui :_=note("To exit here or merge with the original") +#@gui :BW or Colours=choice("Black and White","Colours") +#@gui :_=note("to activate the Merging Options below chose 'Colours'") +#@gui :_=separator() +#@gui :Swap Layers=bool(0) +#@gui :Merging Options=choice("Value","Lightness","Luminance","*Colors Doping*","*Comix Colors*","Graphic Colors*",*Dark Edges*","*Vivid Edges*","Multiply","Color Burn","Darken","Lighten","Hard Light","Soft Light","Overlay","Grain Merge","Edges","Interpolation") +#@gui :Opacity=float(1,0,1) +#@gui :*Intensity*=float(1,0,1) +#@gui :_=separator() +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Last update : 2011/11/14 .") +#@gui :_=link("Filter how to and help","http://www.gimpchat.com/viewtopic.php?f=9&t=2983") +#@gui PhotoComiX Smoothing:fx_smooth_anisotropic,fx_smooth_anisotropic(0) +#@gui :Amplitude=float(60,0,1000) +#@gui :Sharpness=float(0.16,0,2) +#@gui :Anisotropy=float(0.63,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(2.35,0,10) +#@gui :Spatial Precision=float(0.8,0.1,2) +#@gui :Angular Precision=float(30,1,180) +#@gui :Value Precision=float(2,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Iterations=int(1,1,10) +#@gui :Channel(s)=choice("RGB","Luminance","Blue & Red Chrominances","Blue Chrominance","Red Chrominance") +#@gui :Tiles=int(1,1,10) +#@gui :_=note("\nNote : This set of anisotropic smoothing parameters has been suggested by PhotoComiX.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2010/29/12.") +#@gui Psychedelic Glasswork Tiler:fx_psyglass,fx_psyglass_preview(1) +#@gui :_=separator() +#@gui :_=note("Stained Glass controls") +#@gui :White Separators=bool(false) +#@gui :Edges=float(20,0,100) +#@gui :Shading=float(0.1,0,0.5) +#@gui :Thin Separators=bool(1) +#@gui :Equalize=bool(1) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("To skip Layer Fx set Opacity to 0") +#@gui :_=separator() +#@gui :Layer Fx=choice("Grain Merge","Hard Light","Soft Light","Overlay","Color Burn","Multiply") +#@gui :Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Quick Corrections and Special Fx") +#@gui :Apply Mask=bool(true) +#@gui :_=note("Contrast Mask preset") +#@gui :_=separator() +#@gui :Raise Local Contrast=bool(false) +#@gui :_=note("Local Normalization preset") +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Mirrors Controls") +#@gui :Activate Mirrors=bool(true) +#@gui :_=separator() +#@gui :Iterations=int(1,1,10) +#@gui :X-Offset=float(0,0,100) +#@gui :Y-Offset=float(0,0,100) +#@gui :Array Mode=choice(2,"X-Axis","Y-Axis","XY-Axes","2XY-Axes") +#@gui :Initialization=choice("Original","Mirror X","Mirror Y","Rotate 90 Deg.","Rotate 180 Deg.","Rotate 270 Deg.") +#@gui :Expand Size=_bool(false) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/30/03.") +#@gui Scale Down Neat:fx_scaledown3,fx_scaledown3_preview(0) +#@gui :_=separator() +#@gui :_=note("To scale down preserving clean edges and smoothly sharpen") +#@gui :_=separator() +#@gui :Automatic Pre-Blur=bool(false) +#@gui :_=separator() +#@gui :_=note("Automatic pre-blur disable the 2 sliders below") +#@gui :_=separator() +#@gui :Blur X=float(1,0.2,4) +#@gui :Blur Y=float(1,0.2,4) +#@gui :_=separator() +#@gui :Scale Down To=choice(1,"New Width and Height","Preserve Image Ratio Set New Width","Preserve Image Ratio Set New Height") +#@gui :New Width=int(1600,16,3200) +#@gui :New Height=int(1600,16,3200) +#@gui :_=separator() +#@gui :Skip Post Sharpening=bool(false) +#@gui :_=separator() +#@gui :_=note(""Skip Post Sharpening": if chosen will deactivate all controls below") +#@gui :_=separator() +#@gui :Amount=float(2.3,0,10) +#@gui :Darkness/Lightness Level=float(1,0,4) +#@gui :Channel(s)=choice(3,"All","RGBA","RGB","Luminance","Blue/red Chrominances","Blue Chrominance","Red Chrominance","Lightness","Ab-Components","A-Component","B-Component","Hue","Saturation","Value","Key","Alpha","Ch-Components","C-Component","H-Component","Red","Green","Blue","Alpha") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Author: PhotoComix. Latest update : 2012/25/09.") +#@gui Symmetry Master:fx_viral,fx_viral +#@gui :Scale=float(8,0,15) +#@gui :Mixer=choice("Average","Grain Extract","Vivid","Difference","Exclusion","Negation") +#@gui :Remix=choice("Vivid","Average","Difference","Negation","Darken") +#@gui :PhotoComix Preset=choice("Neat Merge","Lighty Smooth","Dream","Moody","Soft","Naif","Dark Boost","Whitening","None- Skip") +#@gui :Activate Mirror=choice("No-Skip",XY Mirror","2XY Mirror") +#@gui :_=separator() +#@gui :_=note("WARNING,'Expanding Mirrors' multiply image size of x4 or if '2XY Mirrors' x9") +#@gui :_=separator() +#@gui :Expanding Mirrors=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: PhotoComix. Latest update : 2011/13/11.") +#@gui Vivid Colors:fx_compose_vivid_color,fx_compose_vivid_color +#@gui :Opacity=float(1,0,1) +#@gui :Revert Layers=bool(0) +#@gui :Opacity 2=float(1,0,1) +#@gui :_=note("This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Vivid Edges:fx_compose_vividedges,fx_compose_vividedges +#@gui :Opacity=float(1,0,1) +#@gui :Edges Smoothness=float(0.5,0,5) +#@gui :Revert Layers=bool(0) +#@gui :Opacity 2=float(0.7,0,1) +#@gui :_=note("This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Vivid Screen:fx_compose_vividscreen,fx_compose_vividscreen +#@gui :Opacity=float(0.6,0,1) +#@gui :Revert Layers=bool(0) +#@gui :Opacity 2=float(0.7,0,1) +#@gui :_=note("This filter needs two layers to work properly. Set the Input layers option to handle multiple input layers.") +#@gui :_=separator() +#@gui :_=note("Author: PhotoComiX. Latest update : 2011/13/11.") +#@gui Wild Cartoonizer:fx_m_l_unsharp2,fx_m_l_unsharp2_preview(0) +#@gui :_=separator() +#@gui :_=separator() +#@gui :Radius 1=float(12,0,100) +#@gui :Amount 1=float(2.18,0,10) +#@gui :Radius 2=float(0.3,0,100) +#@gui :Amount 2=float(1.5,0,10) +#@gui :Darken Merge Opacity=float(1,0,1) +#@gui :Lighten Merge Opacity=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Additional Painter Module") +#@gui :_=separator() +#@gui :Add Painter's Touch=bool(false) +#@gui :Painter's Touch Sharpness=float(0.5,0,2) +#@gui :Painter's Edge Protection Flow=float(0.8,0,1) +#@gui :Painter's Smoothness=float(1.28,0,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=note("Author: PhotoComiX. Latest update : 12/29/2010.") +#@gui _Prawnsushi +#@gui Channel Shuffle:pr_chanshuff,pr_chanshuff_preview(1)* +#@gui :Slices (0:Random)=int(0,0,1000) +#@gui :Angle=int(0,0,360) +#@gui :Axis=choice(0,"X","Y") +#@gui :Sorting=choice(1,"Reverse","Shuffle","Minimum Value X","Minimum Value Y","Minimum Value Z","Minimum Value C","Maximum Value X","Maximum Value Y","Maximum Value Z","Maximum Value C","Red","Green","Blue","Alpha","Minimum Deviation","Maximum Deviation","Average Deviation","Variance Deviation","Standard Deviation","Sum Value","Product Value","Median Value","L2-Norm","Width","Height","Depth") +#@gui :Ordering=choice(0,"Positive","Negative") +#@gui :_=note("Author: Prawnsushi, David Tschumperlé.Latest Update: 2023/08/17.") +#@gui :_=note("Forum thread: Pixls.us: Channel Shuffle.") +#@gui Iris:pr_iris,pr_iris_gui +#@gui :Resolution=int(800,800,8192) +#@gui :Internal 2x Upscale=bool(1,0,1) +#@gui :Iris Lines Size=float(10,2,200) +#@gui :Pupil Height=float(0.4,0,1) +#@gui :Pupil Width=float(0.4,0,1) +#@gui :Fire Ring Height=float(20,0,40) +#@gui :Fire Ring Width=float(20,0,40) +#@gui :Defect Width=float(0,0,200) +#@gui :Ring Width=float(100,0,200) +#@gui :Seed (0:Random)=int(0,0,999999) +#@gui :Color 1=color(#646400) +#@gui :Color 2=color(#1e9696) +#@gui :Color 3=color(#ff6400) +#@gui :Variation=int(50,0,200) +#@gui :_=separator() +#@gui :_=note("Author: Prawnsushi.Latest Update: 2023/09/08.") +#@gui Line Spam:pr_linespam,pr_linespam_preview(1)* +#@gui :Iterations=int(30,1,100) +#@gui :Line Base Thickness=float(3,0.01,50) +#@gui :Thickness Scaling=float(1.02,0.01,1.2) +#@gui :Line Opacity=float(0.8,0,1) +#@gui :Start X=float(-1,-100,100) +#@gui :Start Y=float(10,-100,100) +#@gui :End X=float(101,0,200) +#@gui :End Y=float(100,0,200) +#@gui :Deform=float(0,0,20) +#@gui :Style=choice(0,"A","B","C","D") +#@gui :Base Color=color(#ff5500ff) +#@gui :Color Variation=float(0,-15,15) +#@gui :Randomize Colors=bool(0,0,1) +#@gui :_=separator() +#@gui :Antialiasing=bool(0,0,1) +#@gui :Amplitude=int(5,0,100) +#@gui :Edge Threshold (%)=int(10,0,100) +#@gui :Smoothness=float(0.8,0,5) +#@gui :_=separator() +#@gui :Spam!=int(1,1,10) +#@gui :Transparent Background=bool(0,0,1) +#@gui :_=note("Author: Prawnsushi.Latest Update: 2023/08/17.") +#@gui Little Boxy Things:pr_lilboxy,pr_lilboxy_gui(0) +#@gui :Decimate=int(20,0,100) +#@gui :Dilate X=float(40,0,500) +#@gui :Dilate Y=float(60,0,500) +#@gui :Erode X=float(2,0,50) +#@gui :Erode Y=float(2,0,50) +#@gui :Angle=float(0,0,360) +#@gui :Gaps Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("Author: Prawnsushi.Latest Update: 2023/09/13.") +#@gui Paper Cuts:pr_papercuts,pr_papercuts_preview(0) +#@gui :Simplification=float(3,0,32) +#@gui :Local Normalization=float(0,0,6) +#@gui :Colors* ( RAM Hungry! )=int(8,2,40) +#@gui :Color Mode=choice(1,"Original","Monochrome","Random") +#@gui :Monochrome Color=color(#507fff) +#@gui :Color Variation (Off If Random)=int(0,0,10) +#@gui :Sorting=choice(14,"None","Reverse","Shuffle","Minimum Value X","Minimum Value Y","Minimum Value Z","Minimum Value C","Maximum Value X","Maximum Value Y","Maximum Value Z","Maximum Value C","Red","Green","Blue","Alpha","Minimum Deviation","Maximum Deviation","Average Deviation","Variance Deviation","Standard Deviation","Sum Value","Product Value","Median Value","L2-Norm","Width","Height","Depth") +#@gui :Ordering=choice(1,"Forward","Backward") +#@gui :_=separator() +#@gui :_=note("Shadows:") +#@gui :Softness=float(4,0,6) +#@gui :Opacity=float(0.6,0,1) +#@gui :Shifting=float(4,0,10) +#@gui :Light Angle (degrees)=choice(0,"0","45","90","135","180","225","270","315","360") +#@gui :_=separator() +#@gui :Multiple Layers=bool(1,0,1) +#@gui :_=note("First layer will contain all other layers, merged") +#@gui :_=separator() +#@gui :_=note("Imperfections:") +#@gui :Color Dithering=bool(0,0,1) +#@gui :Deformation=float(0,0,40) +#@gui :Seed=int(0,0,100000) +#@gui :Canvas Effect=bool(1,0,1) +#@gui :Canvas Strength=float(0.6,0,1) +#@gui :Downscaling % (Uses Less RAM)=float(100,1,100) +#@gui :_=separator() +#@gui :_=note("Author: Prawnsushi.# Latest Update: 2023/04/09.") +#@gui :_=separator() +#@gui :_=note("*Depends on the number of colors in the indexed version of the input image.\n If "Output to Multiple Layers" is checked, 1 color = 1 layer. \n Try not use a lot of colors if you have less than 16 GB of RAM, or use downsampling.\n Preview itself is already downscaled by 50% unless you choose a value lower than 100.") +#@gui Prawn Canvas:pr_canvas,pr_canvas_preview(0) +#@gui :Strength=float(0.3,0,1) +#@gui :Details=float(0,0,30) +#@gui :Colored=bool(0,0,1) +#@gui :Color=color(#ffffffff) +#@gui :_=note("Author: Prawnsushi.Latest Update: 2023/08/17.") +#@gui Sick Painter:pr_sickpaint,pr_sickpaint_preview(0) +#@gui :Obstinacy=int(30,5,100) +#@gui :Start X (px Range)=int(0,-1000,1000) +#@gui :Start Y (px Range)=int(0,-1000,1000) +#@gui :Step X (px Range)=int(100,50,1000) +#@gui :Step Y (px Range)=int(100,50,1000) +#@gui :Line Base Thickness (px Range)=int(100,10,500) +#@gui :Max Opacity=float(0.7,0.01,1) +#@gui :Min Opacity=float(0.4,0.01,1) +#@gui :Anger & Rage=int(1000,1,2000) +#@gui :Color 1=color(#ff0000) +#@gui :Color 2=color(#2099a2) +#@gui :Panels=int(12,3,50) +#@gui :_=separator() +#@gui :_=note("Author: Prawnsushi.Latest Update: 2023/08/17.") +#@gui Slice Stretch-Squeeze:pr_streeze,pr_streeze_preview(1)+ +#@gui :Iterations=int(10,1,100) +#@gui :_=note("Do not set this higher than the smallest side of the image:") +#@gui :Slices=int(101,5,1001) +#@gui :_=note("If there is a seam in the image try adding or removing Slices. Odd numbers seem to work better. ") +#@gui :_=separator() +#@gui :_=note("Resizing:") +#@gui :Outer Range A (Starting @0%)=int(20,0,100) +#@gui :Outer Range B (Ending @100%)=int(80,0,100) +#@gui :O.R. Factor (%)=int(80,1,200) +#@gui :Inner Selection A (Starting %)=int(20,0,100) +#@gui :Inner Selection B (Ending %)=int(80,0,100) +#@gui :I.S. Factor (%)=int(120,1,200) +#@gui :Axis=choice(0,"X","Y","XY") +#@gui :Interpolation=choice(2,"Nearest","Average","Linear","Grid","Bicubic","Lanczos") +#@gui :Show Steps=bool(0,0,1) +#@gui :Delay (ms)=int(1,1,1000) +#@gui :_=separator() +#@gui :_=note("Author: Prawnsushi.Latest Update: 2023/08/17.") +#@gui Uglify:uglify,uglify_preview(0) +#@gui :Write Settings on Picture=bool(0,0,1) +#@gui :_=note{"Use original input image resolution or choose processing resolution (i.e. Half res + Upscale 2x). Beware: Preview lies."} +#@gui :Original Resolution=bool(1,0,1) +#@gui :Processing Resolution=int(1000,500,5000) +#@gui :Upscale 2x (Iterations)=_int(0,0,5) +#@gui :_=separator() +#@gui :- Presets=choice(0,"Default","1 - From Scratch","2 - Soft","3 - Cracked","4 - Black","5 - Faded Black","6 - Nuudlz for a Blank Page") +#@gui :_=separator() +#@gui :Pre-Process=bool(0,0,1) +#@gui :- Sharpening=int(0,0,500) +#@gui :- Blur=float(0,0,10) +#@gui :- Local Normalization=float(0,0,3) +#@gui :_=separator() +#@gui :Sloppiness=bool(1,0,1) +#@gui :- Distort=float(3,0,20) +#@gui :- Blur=float(3,0,50) +#@gui :- Blend Mode=choice(13,"Add","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :- Strength=float(0.5,0.0,1.0) +#@gui :_=separator() +#@gui :Watering=bool(1,0,1) +#@gui :- Smoothing=int(12,0,40) +#@gui :- Iterations=int(1,0,10) +#@gui :Fuzzy Frame Size (%)=float(5,0,45) +#@gui :- Frame Blur=int(20,0,150) +#@gui :- Frame Strentgh=float(0.5,0,1) +#@gui :Plasma Seed ( -1 : Random )=int(-1,-1,999999) +#@gui :- Plasma Saturation=int(-100,-100,100) +#@gui :- Plasma Blur=float(0,0,50) +#@gui :- Blend Mode=choice(7,"Add","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation",Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :- Plasma Strength=float(0.6,0,1) +#@gui :_=separator() +#@gui :Cracks=bool(1,0,1) +#@gui :Sharpening=int(150,0,500) +#@gui :- Shock Filter=int(1,0,1) +#@gui :Light Relief (0 Means All Off)=float(0.05,0,1) +#@gui :- Light2=float(0.02,0,1) +#@gui :- Light3=float(0.02,0,1) +#@gui :_=separator() +#@gui :Sketch=bool(1,0,1) +#@gui :- Likeness=int(25,0,30) +#@gui :- Contrast=int(0,-100,100) +#@gui :- Gamma=int(0,-100,100) +#@gui :- Thickness=int(2,0,40) +#@gui :- Sketch Strength=float(1,0,1) +#@gui :--- Messy Lines=float(0.8,0,1) +#@gui :- White Lines=float(0.6,0,1) +#@gui :--- W. L. Deform=float(1.6,0,40) +#@gui :- Blend Mode=choice(22,"Add","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation",Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :_=note("Setting Sktech Strength to 0 disables Messy lines too.\n Messy lines uses 'Breaks' by David Tschumperlé.") +#@gui :_=separator() +#@gui :Noise=float(3,0,6) +#@gui :Canvas=float(0.3,0,1) +#@gui :Canvas Density=int(0,0,30) +#@gui :Color=color(#ffffffff) +#@gui :_=separator() +#@gui :Post-Process=bool(1,0,1) +#@gui :Emboss=float(1.5,0,5) +#@gui :Mix Original Hue/Sat=float(0.5,0,1) +#@gui :Brightness=float(0,-100,100) +#@gui :Contrast=float(0,-100,100) +#@gui :Gamma=float(0,-100,100) +#@gui :Hue=float(0,-100,100) +#@gui :Saturation=float(0,-100,100) +#@gui :_=separator() +#@gui :- Old Presets=_choice(0,"Default","1 - From Scratch","2 -Soft","3 - Cracked","4 - Black","5 - Faded Black","6 - Nuudlz for Blank Page")_0 +#@gui :_=separator() +#@gui :_=note("Author: Prawnsushi.      Latest Update: 2023/08/17.") +#@gui _Reptorian +#@gui Array [Random] [Jumble by Px]:fx_rep_array_random_jumble_by_px,fx_rep_array_random_jumble_by_px_preview(1)* +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Tile Width(px)=int(128,1,2048) +#@gui :Tile Height=int(128,1,2048) +#@gui :Old Tile Width(px)=int(128,1,2048)_0 +#@gui :Old Tile Height=int(128,1,2048)_0 +#@gui :Link Dimensions=bool(0) +#@gui :Enforce Factors=bool(0) +#@gui :Reshuffle Tiles=button() +#@gui :_=separator() +#@gui :_=note("Image Factors") +#@gui :List of Width Factors=text("List of Factors") +#@gui :List of Height Factors=text("List of Factors") +#@gui :List of Width and Height Factors=text("List of Factors") +#@gui :Stored List of Width(s) Factors=text("List of Factors")_0 +#@gui :Stored List of Height(s) Factors=text("List of Factors")_0 +#@gui :Stored List of Width(s) and Height(s) Factors=text("List of Factors")_0 +#@gui :Stored Number of Width(s) Factors=int(1,1,16777216)_0 +#@gui :Stored Number of Height(s) Factors=int(1,1,16777216)_0 +#@gui :Stored Number of Width(s) and Height(s) Factors=int(1,1,16777216)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2023/07/06.") +#@gui Attractor:fx_rep_trsa,fx_rep_trsa_preview(0) +#@gui :_=note("Generates Attractor fractal.") +#@gui :_=separator() +#@gui :_=note("Input") +#@gui :Algorithm=choice(0,A,B,C,D,E,F,G) +#@gui :Density=float(7,.5,50) +#@gui :Scale=float(1,.1,3) +#@gui :_=note("Parameters) +#@gui :A=float(1,-1,1) +#@gui :B=float(1,-1,1) +#@gui :C=float(1,-1,1) +#@gui :D=float(1,-1,1) +#@gui :E=float(1,-1,1) +#@gui :F=float(1,-1,1) +#@gui :G=float(1,-1,1) +#@gui :H=float(1,-1,1) +#@gui :I=float(1,-1,1) +#@gui :Randomize Parameters=button() +#@gui :_=separator() +#@gui :_=note("Output") +#@gui :Mode=choice(0,"A","A/B","A/A") +#@gui :Negative Exponential Factor=float(1,1,10) +#@gui :Multiplier=float(1,1,10) +#@gui :Quality=float(1,1,3) +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Fill Percentage=bool(0) +#@gui :_=separator() +#@gui :_=note("Instruction") +#@gui :_=note("Attractor are fractals in which values lean toward a location within phase space.\n\n1. Input setting defines the format of attractor fractal as well as its density and scaling.\n\n2. Parameters are different variables with different numbers assigned. This is used to alter the forms of attractor.\n\n3. Output influence the shading of attractor. A implies that negative exponental factor is applicable while B means that it's not applicable. In case of two letter, the last letter is the alpha channel. The greater the negative exponential factor value is, the more visible the attractor will be.\n\n4. Quality resizes the image and multiply the density by the quality number, then resize the image back to the original size. It is used to reduce noise.\n\n5. Fill Percentage is used as a way to diagnose whether there is a fractal appearing or not. A very low percentage means there is no fractal. Percentage higher than 100% implies some values are out of range in respect to the image boundary.") +#@gui :_=separator() +#@gui :_=note("Info") +#@gui :_=note("Conversion of a PDN plugin made by TechnoRobbo.\n\nSource Code: TR's Strange Attractor Plugin") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/3/29.") +#@gui Autofill Coloring Book:gui_rep_acb,gui_rep_acb_preview(0) +#@gui :_=note("This filter is specifically designed to autofill areas with random colors that only appear once.\n\nDon't trust the preview for colors, test the result first!") +#@gui :_=separator() +#@gui :Line Threshold=int(180,1,254) +#@gui :Dilate/Erode=int(0,-3,3) +#@gui :Line Mode=choice(1,"Hard","Soft") +#@gui :Alpha Threshold=int(0,0,254) +#@gui :Coloring Seed=int(250000,0,500000) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/6/4.") +#@gui Axis Streak:gui_axis_streak,gui_axis_streak_preview +#@gui :_=note("Streaks pixel taking into account of opacity by blending pixels-by-pixels.") +#@gui :_=separator() +#@gui :Orientation=choice(0,"Horizontal","Vertical") +#@gui :Direction=choice(0,"Left","Right") +#@gui :Direction=choice(0,"Up","Down") +#@gui :Alpha Exponential Factor(%)=float(0,-100,500) +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/12/7.") +#@gui Binary Alternating Quaddro Texture [Basic]:rep_binary_quaddro_basic_gui,rep_binary_quaddro_basic_gui_preview(0) +#@gui :_=note("This filter is a extended version of a filter found inAsmageddon Tools Pack v3. Translated to G'MIC using a source code, and then extended. It is a mixture of two texture filters.") +#@gui :_=separator() +#@gui :_=note("Channel Processing") +#@gui :Texture Output=choice(0,"Grayscale","Hue","Degradation Mode") +#@gui :_=separator() +#@gui :_=note("Main Texture Processing") +#@gui :Style=choice(0,"Cracking Alternating Texture","Alternating Glasses","Simple") +#@gui :Variable#1=int(8,-512,512) +#@gui :Variable#2=int(8,-512,512) +#@gui :Variable#3=int(128,-200,200) +#@gui :Operand=choice(2,"AND","OR","XOR") +#@gui :Angle=float(0,-180,180) +#@gui :X-Flip=bool(0) +#@gui :Y-Flip=bool(0) +#@gui :Number Modulo=int(256,256,2048) +#@gui :Internal Normalize=int(255,255,2048) +#@gui :Internal Normalization=bool(1) +#@gui :Number Modulo=int(361,256,2048) +#@gui :Internal Normalize=int(361,360,2048) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2018/12/19.") +#@gui Binary Alternating Quaddro Texture [MultiChannel]:rep_binary_quaddro_mc_gui,rep_binary_quaddro_mc_gui_preview(0) +#@gui :_=note("This filter is a extended version of a filter found in Asmageddon Tools Pack v3. Translated to G'MIC using a source code, and then extended. It is a mixture of two texture filters.") +#@gui :_=separator() +#@gui :_=note("Configuration") +#@gui :Color Space=choice(0,"RGB","RYB","CMY","CMYK","HSI","HSV","HSL","LAB","LCH","YCbCr","YCbCrGLIC","YIQ","YUV","XYZ") +#@gui :Contain Alpha?=bool(0) +#@gui :8-Bit Mode?=bool(0) +#@gui :_=separator() +#@gui :_=note("Channel Order") +#@gui :Channel #1=choice(0,"0","1","2") +#@gui :Channel #2=choice(1,"0","1","2") +#@gui :Channel #3=choice(2,"0","1","2") +#@gui :Channel #1=choice(0,"0","1","2","3") +#@gui :Channel #2=choice(1,"0","1","2","3") +#@gui :Channel #3=choice(2,"0","1","2","3") +#@gui :Channel #4=choice(3,"0","1","2","3") +#@gui :Channel #1=choice(0,"0","1","2","3","4") +#@gui :Channel #2=choice(1,"0","1","2","3","4") +#@gui :Channel #3=choice(2,"0","1","2","3","4") +#@gui :Channel #4=choice(3,"0","1","2","3","4") +#@gui :Channel #5=choice(4,"0","1","2","3","4") +#@gui :_=separator() +#@gui :_=note("Main Texture Processing") +#@gui :_=note("Channel #1") +#@gui :Style=choice(0,"Bumping Alternating Texture","Alternating Glasses","Simple") +#@gui :Variable#1=int(8,-512,512) +#@gui :Variable#2=int(8,-512,512) +#@gui :Variable#3=int(128,-200,200) +#@gui :Operand=choice(2,"AND","OR","XOR") +#@gui :Angle=float(0,-180,180) +#@gui :X-Flip=bool(0) +#@gui :Y-Flip=bool(0) +#@gui :Normalize=bool(1) +#@gui :_=separator() +#@gui :_=note("Channel #2") +#@gui :Style=choice(0,"Bumping Alternating Texture","Alternating Glasses","Simple") +#@gui :Variable#1=int(8,-512,512) +#@gui :Variable#2=int(8,-512,512) +#@gui :Variable#3=int(128,-200,200) +#@gui :Operand=choice(2,"AND","OR","XOR") +#@gui :Angle=float(0,-180,180) +#@gui :X-Flip=bool(0) +#@gui :Y-Flip=bool(0) +#@gui :Normalize=bool(1) +#@gui :_=separator() +#@gui :_=note("Channel #3") +#@gui :Style=choice(0,"Bumping Alternating Texture","Alternating Glasses","Simple") +#@gui :Variable#1=int(8,-512,512) +#@gui :Variable#2=int(8,-512,512) +#@gui :Variable#3=int(128,-200,200) +#@gui :Operand=choice(2,"AND","OR","XOR") +#@gui :Angle=float(0,-180,180) +#@gui :X-Flip=bool(0) +#@gui :Y-Flip=bool(0) +#@gui :Normalize=bool(1) +#@gui :_=separator() +#@gui :_=note("Channel #4") +#@gui :Style=choice(0,"Bumping Alternating Texture","Alternating Glasses","Simple") +#@gui :Variable#1=int(8,-512,512) +#@gui :Variable#2=int(8,-512,512) +#@gui :Variable#3=int(128,-200,200) +#@gui :Operand=choice(2,"AND","OR","XOR") +#@gui :Angle=float(0,-180,180) +#@gui :X-Flip=bool(0) +#@gui :Y-Flip=bool(0) +#@gui :Normalize=bool(1) +#@gui :_=separator() +#@gui :_=note("Channel #5") +#@gui :Style=choice(0,"Bumping Alternating Texture","Alternating Glasses","Simple") +#@gui :Variable#1=int(8,-512,512) +#@gui :Variable#2=int(8,-512,512) +#@gui :Variable#3=int(128,-200,200) +#@gui :Operand=choice(2,"AND","OR","XOR") +#@gui :Angle=float(0,-180,180) +#@gui :X-Flip=bool(0) +#@gui :Y-Flip=bool(0) +#@gui :Normalize=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2018/12/19.") +#@gui Bit-Plane Shuffler:fx_rep_bitplane_shuffle,fx_rep_bitplane_shuffle_preview +#@gui :_=separator() +#@gui :_=note("Main) +#@gui :Direction=choice(0,"Forward","Backward") +#@gui :Depth=choice(0,"8-Bit","16-Bit") +#@gui :Use Alpha?=bool(0) +#@gui :_=separator() +#@gui :_=note("CLI Command") +#@gui :CLI Version=text("Here is where you copy command to command line interface.") +#@gui :CLI Version=text("This is just a reference text")_0 +#@gui :_=separator() +#@gui :_=note("Plane Shuffling) +#@gui :Shuffle Index=int(0,0,40319) +#@gui :Shuffle Index=int(0,0,40319)_0 +#@gui :Shuffle Index=text("0")_0 +#@gui :Plane Shift Method=_choice(0,"Move","Swap") +#@gui :Plane A=int(1,1,8) +#@gui :Plane B=int(2,1,8) +#@gui :Plane C=int(3,1,8) +#@gui :Plane D=int(4,1,8) +#@gui :Plane E=int(5,1,8) +#@gui :Plane F=int(6,1,8) +#@gui :Plane G=int(7,1,8) +#@gui :Plane H=int(8,1,8) +#@gui :Plane A=int(1,1,8)_0 +#@gui :Plane B=int(2,1,8)_0 +#@gui :Plane C=int(3,1,8)_0 +#@gui :Plane D=int(4,1,8)_0 +#@gui :Plane E=int(5,1,8)_0 +#@gui :Plane F=int(6,1,8)_0 +#@gui :Plane G=int(7,1,8)_0 +#@gui :Plane H=int(8,1,8)_0 +#@gui :Plane A=int(8,1,16) +#@gui :Plane B=int(10,1,16) +#@gui :Plane C=int(9,1,16) +#@gui :Plane D=int(4,1,16) +#@gui :Plane E=int(7,1,16) +#@gui :Plane F=int(13,1,16) +#@gui :Plane G=int(1,1,16) +#@gui :Plane H=int(3,1,16) +#@gui :Plane I=int(11,1,16) +#@gui :Plane J=int(14,1,16) +#@gui :Plane K=int(6,1,16) +#@gui :Plane L=int(2,1,16) +#@gui :Plane M=int(12,1,16) +#@gui :Plane N=int(5,1,16) +#@gui :Plane O=int(15,1,16) +#@gui :Plane P=int(16,1,16) +#@gui :Plane A=int(8,1,16)_0 +#@gui :Plane B=int(10,1,16)_0 +#@gui :Plane C=int(9,1,16)_0 +#@gui :Plane D=int(4,1,16)_0 +#@gui :Plane E=int(7,1,16)_0 +#@gui :Plane F=int(13,1,16)_0 +#@gui :Plane G=int(1,1,16)_0 +#@gui :Plane H=int(3,1,16)_0 +#@gui :Plane I=int(11,1,16)_0 +#@gui :Plane J=int(14,1,16)_0 +#@gui :Plane K=int(6,1,16)_0 +#@gui :Plane L=int(2,1,16)_0 +#@gui :Plane M=int(12,1,16)_0 +#@gui :Plane N=int(5,1,16)_0 +#@gui :Plane O=int(15,1,16)_0 +#@gui :Plane P=int(16,1,16)_0 +#@gui :Randomize=button() +#@gui :Depth=choice(0,"8-Bit","16-Bit")_0 +#@gui :Visited 8-Bit=bool(0)_0 +#@gui :Visited 16-Bit=bool(0)_0 +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2023/11/27.") +#@gui __Degradations +#@gui Blur [Splinter]:fx_rep_blur_splinter,fx_rep_blur_splinter_preview +#@gui :_=note(" Apply Splinter Blur.\n\nBased off observation from using Splinter Blur plugin within Paint.NET made by Ed Harvey, and it is inspired by this filter.\n\nComputationally intensive!") +#@gui :_=separator() +#@gui :Half Image-Diagonal(%)=float(20,0.1,100) +#@gui :Duplicates=int(3,3,100) +#@gui :Angle=float(0,-180,180) +#@gui :Thickness(%)=float(0,0,100) +#@gui :Contrast(%)=float(0,0,100) +#@gui :Balance(%)=float(0,-100,100) +#@gui :Boundary=choice(3,"None","Neumann","Periodic","Mirror") +#@gui :Use Bi-Sided Convolution?=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/9/10.") +#@gui _Testing +#@gui Reptorian +#@gui Bricks:gui_rep_shape_brick +#@gui :_=note("This filter on the Bricks plugin for Paint.NET made by Jesse Chunn as part of his plugin pack.\n\n This is a extended version of the bricks filter with bevel options, and blending mode option.") +#@gui :_=separator() +#@gui :_=note("Brick Main Setting") +#@gui :Brick Width (px)=int(150,4,2048) +#@gui :Brick Height (px)=int(150,4,2048) +#@gui :Mortar Width (px)=int(5,0,512) +#@gui :Mortar Height (px)=int(5,0,512) +#@gui :Outline (px)=int(0,0,50) +#@gui :_=separator() +#@gui :_=note("Offset Setting) +#@gui :Brick Offset (%)=float(0,-100,100) +#@gui :Offset Direction=choice(0,"Horizontal","Vertical") +#@gui :Reverse Offset=bool(0) +#@gui :_=separator() +#@gui :_=note("Bevel Setting) +#@gui :Bevel Radius (px)=int(0,0,50) +#@gui :Bevel Style=choice(0,"Round","Inverse Round","Chamfer") +#@gui :_=separator() +#@gui :_=note("Colouring and Blending Options") +#@gui :Brick Colour=color(#aa0000ff) +#@gui :Brick Outline=color(#550000ff) +#@gui :Mortar Colour=color(#794d02ff) +#@gui :Use Blending Mode?=bool(0) +#@gui :Blending Mode=choice(41,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Opacity (%)=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("Antialias) +#@gui :Antialias Level=float(0,0,3) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/10/15.") +#@gui Chirikov-Taylor:fx_rep_cstdmap,fx_rep_cstdmap_preview +#@gui :_=note("Creates Chirikov-Taylor discrete map.") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Lines=int(500,1,10000) +#@gui :Points per Line=int(5000,1,100000) +#@gui :K=float(1,-5,5) +#@gui :Mode=choice(0,"Regular","Symmetric Modified") +#@gui :Center Main Rotor=bool(0) +#@gui :Orientation=choice(0,"XY",YX") +#@gui :Multithreaded Processing=bool(1) +#@gui :_=separator() +#@gui :_=note("Scaling") +#@gui :Factor=float(1,.1,10) +#@gui :Use Image Ratio?=bool(0) +#@gui :_=separator() +#@gui :_=note("Coloring") +#@gui :_=note("Preliminary") +#@gui :Mode=choice(0,"Grayscale","HSX","Palette","Random","From Image") +#@gui :Use Alpha?=bool(0) +#@gui :_=separator() +#@gui :_=note("Additional") +#@gui :HSX Mode=choice(2,"HCY","HSI","HSL/HSV") +#@gui :Palette=choice(0,"Red-Green-Blue-3","Black with Red-Green-Blue-4","Black & White with Red-Green-Blue-5","Cyan-Magenta-Yellow-3","Cyan-Magenta-Yellow-Black-4","White-Cyan-Magenta-Yellow-Black-5","Red-Green-Blue with Cyan-Magenta-Yellow-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus Palette-256","PLAYPAL-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette-33","Koni32","Linear Color Palette Basic-31","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO-46","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8-11","CD-BAC-16","CG Arne-16","DinoKnight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar (Lake Water Lily)-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet Coding Language-20","Matrix-96","Material Design-96","Rainbow-88","Rainbow-96","SCRJ-XXXVI-36","Pxls Default-32","Lospec500-42","Moderna-24","Oak21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80's","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R|place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","FunkyFuture8","The Golden Wall Palette-7","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Cretaceous-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Vanilla MilkShake-16","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58 Palette","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell, Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-7","Ocean Glass-8","RoyalGuard-6","Eulbink-7","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-5","Rabbit 7","Amiga 2600 NTSC-128","Amiga 2600 PAL-104","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series - GTIA-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","Commodore 64 - Pepto-16","Commodore 64 - Colodore-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System Palette-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-244","Win 95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Piet Palette-5","Japanese Woodblock Palette-12","Human Faces-94","HSV Palette-96","ST24 Christmas","Reds-24") +#@gui :Color Count=int(20,2,360) +#@gui :Color Seed=int(0,0,100000) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2023/9/11.") +#@gui Color Existence Distribution [RGB-8]:rep_color_existence_distribution_rgb8,rep_color_existence_distribution_rgb8 +#@gui :_=note("This filter is used to find colors that does or does not exist within a image.\n\n For Paint.NET users, please refer to this tutorial named Finding millions of colors that does or does not exist - G'MIC QT Tutorial") +#@gui :Sep Separator() Set of Color(s)=choice(1,"Nonexistent Colors","Existing Colors") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/9/20.") +#@gui Color Harmonies:_none_,fx_rep_color_harmonies_preview(1)* +#@gui :_=note("This is a recreation of the Color Harmonies plugin for Paint.NET. which was made by midora who is also known as Martin Osieka.") +#@gui :_=separator() +#@gui :_=note("Reference Point") +#@gui :Hue=float(50,0,360) +#@gui :Saturation(%)=float(100,0,100) +#@gui :Shade/Tint(%)=float(0,-100,100) +#@gui :Color Space=choice(0,"RGB",RYB") +#@gui :_=separator() +#@gui :_=note("Additional Information") +#@gui :Palette Mode=choice(0,"Neutral 8","Neutral 15","Analogous 30","Complementary","Split-Complementary","Triadic","Tetradic","Clash","Four Tones","Five Tones","Six Tones") +#@gui :_=separator() +#@gui :_=note("Output Color") +#@gui :Color A=color(#000000) +#@gui :Color B=color(#000000) +#@gui :Color C=color(#000000) +#@gui :Color D=color(#000000) +#@gui :Color E=color(#000000) +#@gui :Color F=color(#000000) +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Color Point Position=point(50,50,0,1,128,128,128,255) +#@gui :Color Select Position(%)=float(10,10,50) +#@gui :Scaling(%)=float(90,30,100) +#@gui :Point=point(50,50,0,0,0,0,0,0,0)_0 +#@gui :Color A=color(#000000)_0 +#@gui :Color B=color(#000000)_0 +#@gui :Color C=color(#000000)_0 +#@gui :Color D=color(#000000)_0 +#@gui :Color E=color(#000000)_0 +#@gui :Color F=color(#000000)_0 +#@gui :Hue=float(0,0,360)_0 +#@gui :Saturation(%)=float(100,0,100)_0 +#@gui :Shade/Tint(%)=float(0,-100,100)_0 +#@gui :Hue=float(0,0,360)_0 +#@gui :Saturation(%)=float(100,0,100)_0 +#@gui :Shade/Tint(%)=float(0,-100,100)_0 +#@gui :Hue=float(0,0,360)_0 +#@gui :Saturation(%)=float(100,0,100)_0 +#@gui :Shade/Tint(%)=float(0,-100,100)_0 +#@gui :Hue=float(0,0,360)_0 +#@gui :Saturation(%)=float(100,0,100)_0 +#@gui :Shade/Tint(%)=float(0,-100,100)_0 +#@gui :Hue=float(0,0,360)_0 +#@gui :Saturation(%)=float(100,0,100)_0 +#@gui :Shade/Tint(%)=float(0,-100,100)_0 +#@gui :Hue=float(0,0,360)_0 +#@gui :Saturation(%)=float(100,0,100)_0 +#@gui :Shade/Tint(%)=float(0,-100,100)_0 +#@gui :Color Space=choice(0,"RGB",RYB")_0 +#@gui :Palette Mode=choice(0,"Neutral 8","Neutral 15","Analogous 30","Complementary","Split-Complementary","Triadic","Tetradic","Clash","Four Tones","Five Tones","Six Tones")_0 +#@gui :Color Select Position(%)=float(10,10,50)_0 +#@gui :Scaling(%)=float(90,30,100)_0 +#@gui :Preview Palette?=bool(0)_0 +#@gui :Orientation=choice(0,"Horizontal","Vertical")_0 +#@gui :Palette X=choice(1,"Bottom","Middle","Top")_0 +#@gui :Palette Y=choice(1,"Left","Middle","Top")_0 +#@gui :_=separator() +#@gui :_=note("Export") +#@gui :Output Location=folder() +#@gui :File Name=text("color_harmonies") +#@gui :Format=choice(0,"GIMP Palette - .gpl","Paint.NET Palette - .txt","JASC-PAL - .pal") +#@gui :Export=button() +#@gui :_=separator() +#@gui :_=note("Miscellaneous") +#@gui :Console Message=text("This is a interactive tool meant to create palette.") +#@gui :Mode=int(-1,-1,2)_0 +#@gui :Old Preview Height=int(0,0,15360)_0 +#@gui :Old Preview Height=int(0,0,15360)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2022/07/01.") +#@gui Color Modulo Texture:gui_rep_colmt,gui_rep_colmt_preview +#@gui :_=note("This filter is inspired by Color Modulo plugin made by MadJik for Paint.NET software.\n\nPreview is inaccurate! Use 100% Zoom Preview for most accuracy!") +#@gui :_=separator() +#@gui :_=note("Colour and Channel Setting") +#@gui :_=separator() +#@gui :_=note("- Colour Space and Alpha Setting -") +#@gui :Colour Space=choice(0,"RGB-8","RYB-8","CMY-8","CMYK-8","HSI-8","HSL-8","HSV-8","LAB-8","LCH-8","YIQ-8","YUV-8","YCbCr-8","YCbCrGLIC-8","XYZ-8","YES-8") +#@gui :Contain Alpha?=bool(0) +#@gui :_=separator() +#@gui :_=note("- Channel Setting -") +#@gui :Channel Order=choice(0,"1-2-3-4","1-2-4-3","1-3-2-4","1-3-4-2","1-4-2-3","1-4-3-2","2-1-3-4","2-1-4-3","2-3-1-4","2-3-4-1","2-4-1-3","2-4-3-1","3-1-2-4","3-1-4-2","3-2-1-4","3-2-4-1","3-4-1-2","3-4-2-1","4-1-2-3","4-1-3-2","4-2-1-3","4-2-3-1","4-3-1-2","4-3-2-1") +#@gui :Channel Order=choice(0,"1-2-3","1-3-2","2-1-3","2-3-1","3-1-2","3-2-1") +#@gui :Edit Multiple Channel Separately?=bool(1) +#@gui :_=separator() +#@gui :_=note("Diagonal Setting") +#@gui :_=separator() +#@gui :Flip Diagonal?=bool(0) +#@gui :_=separator() +#@gui :_=note("Modulo Texture Setting") +#@gui :_=separator() +#@gui :_=note("- Multichannel Editing-") +#@gui :Modulo Mode=choice(3,"Regular Modulo","Continuous Regular Modulo","Divisive Modulo","Continuous Divisive Modulo") +#@gui :Modulo Variable #1=int(0,0,786) +#@gui :Modulo Variable #2=int(255,0,786) +#@gui :Function Angle=float(0,-180,180) +#@gui :Value Shift=int(0,0,786) +#@gui :Centered=bool(1) +#@gui :Negate=bool(0) +#@gui :Normalize=bool(1) +#@gui :_=note("Option available when Edit Multiple Channel Separately is turned off") +#@gui :_=separator() +#@gui :_=note("- Separate Channel Editing -") +#@gui :Channel Section=choice(0,"Channel #1","Channel #2","Channel #3","Channel #4") +#@gui :Channel Section=choice(0,"Channel #1","Channel #2","Channel #3") +#@gui :_=note("Option available when Edit Multiple Channel Separately is turned on") +#@gui :_=separator() +#@gui :Modulo Mode=choice(3,"Regular Modulo","Continuous Regular Modulo","Divisive Modulo","Continuous Divisive Modulo") +#@gui :Modulo Variable #1=int(0,0,786) +#@gui :Modulo Variable #2=int(255,0,786) +#@gui :Function Angle=float(0,-180,180) +#@gui :Value Shift=int(0,0,786) +#@gui :Centered=bool(1) +#@gui :Negate=bool(0) +#@gui :Normalize=bool(1) +#@gui :Modulo Mode=choice(3,"Regular Modulo","Continuous Regular Modulo","Divisive Modulo","Continuous Divisive Modulo") +#@gui :Modulo Variable #1=int(0,0,786) +#@gui :Modulo Variable #2=int(255,0,786) +#@gui :Function Angle=float(0,-180,180) +#@gui :Value Shift=int(0,0,786) +#@gui :Centered=bool(1) +#@gui :Negate=bool(0) +#@gui :Normalize=bool(1) +#@gui :Modulo Mode=choice(3,"Regular Modulo","Continuous Regular Modulo","Divisive Modulo","Continuous Divisive Modulo") +#@gui :Modulo Variable #1=int(0,0,786) +#@gui :Modulo Variable #2=int(255,0,786) +#@gui :Function Angle=float(0,-180,180) +#@gui :Value Shift=int(0,0,786) +#@gui :Centered=bool(1) +#@gui :Negate=bool(0) +#@gui :Normalize=bool(1) +#@gui :Modulo Mode=choice(3,"Regular Modulo","Continuous Regular Modulo","Divisive Modulo","Continuous Divisive Modulo") +#@gui :Modulo Variable #1=int(0,0,786) +#@gui :Modulo Variable #2=int(255,0,786) +#@gui :Function Angle=float(0,-180,180) +#@gui :Value Shift=int(0,0,786) +#@gui :Centered=bool(1) +#@gui :Negate=bool(0) +#@gui :Normalize=bool(1) +#@gui :_=note("Option available when Edit Multiple Channel Separately is turned on") +#@gui :_=separator() +#@gui :_=note("Subpixel Processing Setting") +#@gui :_=separator() +#@gui :Subpixel Rendering Level=float(1,0,1) +#@gui :Subpixel Interpolation=choice(5,"Nearest","Average","Grid","Linear","Bicubic","Lanczos") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/10/07.") +#@gui Color Region:fx_rep_color_region,fx_rep_color_region_preview(0)* +#@gui :Area Threshold (%)=float(5,1,100) +#@gui :Stray Threshold (%)=float(5,0,100) +#@gui :Color Distance Threshold=float(6,0,10) +#@gui :Old Area Threshold (%)=float(-1,-1,100)_0 +#@gui :Old Stray Threshold (%)=float(-1,-1,100)_0 +#@gui :Old Color Distance Threshold=float(-1,-1,10)_0 +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2023/3/15.") +#@gui Complexion Burst:fx_rep_compb,fx_rep_compb_preview +#@gui :_=note("Complex-Plane adaptation of the Pickover Popcorn Fractal. Discovered By Reptorian.") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Points=int(50,1,200) +#@gui :Density=float(1,.01,2) +#@gui :H-Real=float(.05,-75,75) +#@gui :H-Imag=float(3,-75,75) +#@gui :K-Real=float(3,-75,75) +#@gui :K-Imag=float(3,-75,75) +#@gui :Zoom=float(2,.1,20) +#@gui :Angle=float(0,-180,180) +#@gui :Origin=point(50,50,0,1,255,255,255,255) +#@gui :_=separator() +#@gui :_=note("Number Extraction") +#@gui :Method=choice(0,"Per-Axis","Additive") +#@gui :_=separator() +#@gui :_=note("Complex Trigonometric") +#@gui :Mode=choice(0,"Z-4","Z-6") +#@gui :Complex-Plane Mode?=bool(1) +#@gui :Real-Axis Formula S=choice(0,"Complex Sinusoidal","Complex Cosinusoidal","Complex Tangent","Complex Log") +#@gui :Real-Axis Formula T=choice(1,"Complex Sinusoidal","Complex Cosinusoidal","Complex Tangent","Complex Log") +#@gui :Real-Axis Formula U=choice(2,"Complex Sinusoidal","Complex Cosinusoidal","Complex Tangent","Complex Log") +#@gui :Imaginary-Axis Formula S=choice(0,"Complex Sinusoidal","Complex Cosinusoidal","Complex Tangent","Complex Log") +#@gui :Imaginary-Axis Formula T=choice(1,"Complex Sinusoidal","Complex Cosinusoidal","Complex Tangent","Complex Log") +#@gui :Imaginary-Axis Formula U=choice(2,"Complex Sinusoidal","Complex Cosinusoidal","Complex Tangent","Complex Log") +#@gui :XY-Axis Formula S=choice(0,"Complex Sinusoidal","Complex Cosinusoidal","Complex Tangent","Complex Log") +#@gui :XY-Axis Formula T=choice(1,"Complex Sinusoidal","Complex Cosinusoidal","Complex Tangent","Complex Log") +#@gui :XY-Axis Formula U=choice(2,"Complex Sinusoidal","Complex Cosinusoidal","Complex Tangent","Complex Log") +#@gui :_=separator() +#@gui :_=note("Output") +#@gui :Value Limit(%)=float(.5,.5,100) +#@gui :Midpoint Shift=float(.5,-1,1) +#@gui :Multiplier=float(1,.1,10) +#@gui :Normalize=bool(1) +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Show Fill Ratio?=bool(0) +#@gui :_=note("Fill Ratio provides information on whether there is sufficient filled pixels on canvas. The closer to 100%, the more the canvas is filled.") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/08/19.") +#@gui __Rendering +#@gui Construction Material Texture:_cons_turb,_cons_turb_preview(0) +#@gui :_=note("Construction Material Texture filter is based off the following tutorial by theonlychad for Paint.NET software: Concrete Texture Tutorial.\n") +#@gui :_=separator() +#@gui :_=note("Turbulance Texture") +#@gui :Radius=float(88,1,1024) +#@gui :Octaves=int(8,1,12) +#@gui :Damping per Octave=float(2.5,1,10) +#@gui :Mode=choice(2,"Turbulence","Turbulence 2","Fractal Noise","Fractured Clouds","Stardust","Pea Soup") +#@gui :Color Balance=color(#808080) +#@gui :_=separator() +#@gui :_=note("Noise Processing") +#@gui :Amplitude=float(20,0,200) +#@gui :Noise Type=choice(3,"Gaussian","Uniform","Salt and Pepper","Poisson") +#@gui :_=separator() +#@gui :Channel(s)=choice(0,"RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]") +#@gui :Value Action=choice(1,"None","Cut","Normalize") +#@gui :_=separator() +#@gui :_=note("Grayscale Processing") +#@gui :Colour Space=choice("RGB","SRGB") +#@gui :Channel 1=float(1,0,3) +#@gui :Channel 2=float(1,0,3) +#@gui :Channel 3=float(1,0,3) +#@gui :Normalise=bool(1) +#@gui :Desaturation (%)=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("Self-Image Processing") +#@gui :Self-Blending=choice(20,"Add","Burn","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Hardlight","Hardmix","Interpolation","Linearburn","Linearlight","Luminance","Multiply","Negation","Overlay","Pinlight","Reflect","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Vividlight") +#@gui :Self-Blending Opacity (%)=float(100,0,100) +#@gui :Self-Blending V. Original Blending=choice(15,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Self-Blend V. Original Opacity (%)=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("Value Processing") +#@gui :Value Action=choice(2,"None","Cut","Normalize") +#@gui :Number #1=float(0,0,255) +#@gui :Number #2=float(188,0,255) +#@gui :Equalize?=bool(0) +#@gui :Negate?=bool(0) +#@gui :_=separator() +#@gui :_=note("Warp by Intensity") +#@gui :X-Factor=float(0.19,-6,6) +#@gui :Y-Factor=float(0.52,-6,6) +#@gui :_=separator() +#@gui :X-Offset=float(128,0,255) +#@gui :Y-Offset=float(128,0,255) +#@gui :_=separator() +#@gui :Correlated Channels=bool(0) +#@gui :Interpolation=choice(1,"Nearest Neighbor","Linear") +#@gui :Boundary=choice(2,"Transparent","Nearest","Periodic","Mirror") +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]") +#@gui :_=separator() +#@gui :_=note("Style Processing") +#@gui :Blur Original=float(0,0,16) +#@gui :_=separator() +#@gui :_=note("Butterworth Bandpass Processing") +#@gui :Activate Butterworth Bandpass Processing=bool(0) +#@gui :Create Copy?=bool(0) +#@gui :LP Frequency Power=float(3,0,16) +#@gui :LP Order Cube Root=float(2,0,4) +#@gui :LP Resonance=float(0,0,5) +#@gui :HP Frequency Power=float(4,0,16) +#@gui :HP Order Cube Root=float(2,0,4) +#@gui :HP Resonance=float(2,0,4) +#@gui :Colour Space=choice("RGB","SRGB","HSV8","HSV","HSL8","HSL","HSI8","HSI","LCH8","LCH","Lab8","Lab","YCbCr","YCbCrGLIC","YCbCrJPEG","YIQ8","YIQ","YUV8","YUV","HCY","XYZ8","XYZ","CMY","CMYK","Bayer") +#@gui :Absolute=bool(1) +#@gui :Makeup Gain=bool(1) +#@gui :_=separator() +#@gui :_=note("Relief Processing") +#@gui :Activate Relief Processing=bool(1) +#@gui :Radius=int(5,5,100) +#@gui :Angle=float(0,-180,180) +#@gui :Sigma=float(.5,.05,4) +#@gui :Value Scale=float(2,.5,10) +#@gui :Output Color=bool(1) +#@gui :Blending Mode=choice(0,"Grain Extract","Grain Merge") +#@gui :Blending Opacity (%)=float(100,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/12/07.") +#@gui _Testing +#@gui Reptorian +#@gui Detailed Information:_none_,fx_rep_detailed_info_preview(0)* +#@gui :User and Images Information=_text(1,"Every information can be found here") +#@gui :Ratio Proposition Number (0 Disables It)=int(16,0,256) +#@gui :Ratio Proposition Number (0 Disables It)=int(16,0,256)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2022/07/09.") +#@gui Diffusion Limited Aggregation:fx_rep_dla,fx_rep_dla_preview(0)* +#@gui :Attempts=int(100,5,2000) +#@gui :Aggregation Mode=choice(0,"Corners","Axis[Slow!]","All-Around","Alternating") +#@gui :Stem Tone=choice("Dark",Light") +#@gui :Border Size=int(0,0,100) +#@gui :Spread Factor(%)=float(0,0,100) +#@gui :Utilize Dense Point Map=bool(0) +#@gui :Preserve Silhoutte=bool(1) +#@gui :Negate=bool(0) +#@gui :Regenerate Map=button() +#@gui :Old Attempts=int(100,5,2000)_0 +#@gui :Old Aggregation Mode=choice(0,"Corners","Axis[Slow!]","All-Around","Alternating")_0 +#@gui :Old Stem Tone=choice("Dark",Light")_0 +#@gui :Old Border Size=int(0,0,100)_0 +#@gui :Old Spread Factor(%)=float(0,0,100)_0 +#@gui :Old Utilize Dense Point Map=bool(0)_0 +#@gui :Old Preserve Silhoutte=bool(1)_0 +#@gui :Old Negate=bool(0)_0 +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2023/01/04.") +#@gui Dungeon Floor (Super Slow!):fx_rep_dungeon_floor,fx_rep_dungeon_floor_preview +#@gui :Tile Size=choice(0,"1x1","2x2") +#@gui :Tile Choice (If 1x1)=choice(0,"1","2","3","4") +#@gui :Subsampling=float(2,0,5) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2021/6/02.") +#@gui Dynamic Contrast:rep_dynamic_contrast,rep_dynamic_contrast_preview +#@gui :Amount=float(0,-64,64) +#@gui :Threshold=float(128,0,255) +#@gui :Intensity=float(255,0,255) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Code adapted from Source Code to Dynamic Contrast PDN plugin made by Remake.") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/12/18.") +#@gui Edge Fade:fx_rep_edgefade,fx_rep_edgefade_preview(0) +#@gui :_=note("If your image has slim alpha, activate Use Max Distance for better control over the fade, however preview will not be as accurate unless you view the full image.") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Half Image-Diagonal(%)=float(10,.1,100) +#@gui :Max Distance (%)=float(10,.1,100) +#@gui :Use Max Distance?=bool(0) +#@gui :Exponential Factor=float(2,0,3) +#@gui :_=separator() +#@gui :_=note("Local Normalization") +#@gui :Amplitude=float(0,0,15) +#@gui :Neighborhood Smoothness (%)=float(4,.1,100) +#@gui :Average Smoothness (%)=float(2,.1,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/7/13.") +#@gui Ellsworth Kelly Board:fx_rep_ekb,fx_rep_ekb_preview +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Square Size - Half Minimum-Dimension(%)=float(10,1,100) +#@gui :Border Size - Square Size(%)=float(10,-100,100) +#@gui :Border Size - Pixel=int(1,-50,50) +#@gui :Use Pixel Unit to Define Border=bool(1) +#@gui :Frequency(%)=float(50,5,100) +#@gui :Output=choice(0,"Inside","Resized") +#@gui :_=separator() +#@gui :_=note("Color Options") +#@gui :Unfilled Area Color=color(#6e6982) +#@gui :Keep Unfilled Area Empty?=bool(0) +#@gui :Exterior Border Color=color(#ffffff) +#@gui :Keep Exterior Border Color Empty?=bool(0) +#@gui :Border Value(%)=float(25,0,100) +#@gui :Palette=choice(0,"Predefined","Random") +#@gui :Number of Colors=int(12,5,100) +#@gui :Color Space=choice(0,"RGB","RYB","CMY","CMYK","HCY","HSI","HSL","HSV","LAB","LCH","YCbCr","YCbCrGLIC","YIQ","YUV","XYZ","YES") +#@gui :Predefined Palette=choice(10,"Black & White with Red-Green-Blue-5","White-Cyan-Magenta-Yellow-Black-5","Red-Green-Blue with Cyan-Magenta-Yellow-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus Palette-256","PLAYPAL-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette-33","Koni32","Linear Color Palette Basic-31","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO-46","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8-11","CD-BAC-16","CG Arne-16","DinoKnight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar (Lake Water Lily)-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet Coding Language-20","Matrix-96","Material Design-96","Rainbow-88","Rainbow-96","SCRJ-XXXVI-36","Pxls Default-32","Lospec500-42","Moderna-24","Oak21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80's","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R|place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","FunkyFuture8","The Golden Wall Palette-7","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Cretaceous-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Blessing-5","Fairydust 8","Vanilla MilkShake-16","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58 Palette","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell, Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-7","Ocean Glass-8","RoyalGuard-6","Eulbink-7","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 5","Tritanopia-5","Rabbit 7","Amiga 2600 NTSC-128","Amiga 2600 PAL-104","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series - GTIA-256","CGA-16","Commodore 64 - Pepto-16","Commodore 64 - Colodore-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System Palette-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","VGA-244","Win 95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Piet Palette-5","Japanese Woodblock Palette-12","Human Faces-94","HSV Palette-96","ST24 Christmas","Reds-24") +#@gui :_=separator() +#@gui :_=note("Random") +#@gui :Main=int(0,0,1000000) +#@gui :Color=int(0,0,1000000) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/09/16.") +#@gui __Details +#@gui Emboss-Relief:fx_emboss_relief,fx_emboss_relief_preview(0) +#@gui :Radius=int(5,5,100) +#@gui :Angle=float(0,-180,180) +#@gui :Sigma=float(.5,.05,4) +#@gui :Value Scale=float(2,.5,10) +#@gui :Output=choice(0,"Emboss","Relief") +#@gui :Output Color=bool(1) +#@gui :Preserve Alpha?=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/12/07.") +#@gui _Testing +#@gui Reptorian +#@gui Fibonacci:fx_rep_fibonacci,fx_rep_fibonacci +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Fill Mode=choice(1,"Textile","Fill") +#@gui :Iterations=int(10,3,20) +#@gui :Direction=choice(0,"Top Left","Top Right","Bottom Left","Bottom Right") +#@gui :Fibonacci Style=choice(0,"Corner","Spiral") +#@gui :Initial Orientation=choice(0,"Landscape","Portrait") +#@gui :Center - Point=point(50,50) +#@gui :Boundary=choice(0,"Periodic","Mirror") +#@gui :Attachment=choice(0,"A","B") +#@gui :Integer Scale=int(1,1,10) +#@gui :_=separator() +#@gui :_=note("Coloring/Shading") +#@gui :Palette=choice(0,"Normalized Grayscale","Black & White-2","Red-Green-Blue-3","Black with Red-Green-Blue-4","Black & White with Red-Green-Blue-5","Cyan-Magenta-Yellow-3","Cyan-Magenta-Yellow-Black-4","White-Cyan-Magenta-Yellow-Black-5","Red-Green-Blue with Cyan-Magenta-Yellow-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus Palette-256","PLAYPAL-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette-33","Koni32","Linear Color Palette Basic-31","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO-46","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8-11","CD-BAC-16","CG Arne-16","DinoKnight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar (Lake Water Lily)-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet Coding Language-20","Matrix-96","Material Design-96","Rainbow-88","Rainbow-96","SCRJ-XXXVI-36","Pxls Default-32","Lospec500-42","Moderna-24","Oak21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80's","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R|place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","FunkyFuture8","The Golden Wall Palette-7","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Cretaceous-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Vanilla MilkShake-16","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58 Palette","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell, Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-7","Ocean Glass-8","RoyalGuard-6","Eulbink-7","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-5","Rabbit 7","Amiga 2600 NTSC-128","Amiga 2600 PAL-104","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series - GTIA-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","Commodore 64 - Pepto-16","Commodore 64 - Colodore-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System Palette-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-244","Win 95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Piet Palette-5","Japanese Woodblock Palette-12","Human Faces-94","HSV Palette-96","ST24 Christmas","Reds-24") +#@gui :Cycle Color(%)=float(0,0,100) +#@gui :Color Random Ordering Seed=int(2500,0,5000) +#@gui :Color Random Ordering Seed A=int(100,0,5000) +#@gui :Color Random Ordering Seed B=int(500,0,5000) +#@gui :Negate?=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2023/9/11.") +#@gui __Degradations +#@gui Fragment Blur:gui_rep_frblur,gui_rep_frblur_preview(0) +#@gui :_=note("Inspired by the Paint.NET Fragment Blur filter, this implementation improves upon it by adding color space options, preservation of original image as a option, boundary condition option, and interpolation option.\n\nWarning - Preview may not be accurate with image with completely opaque images. The output will not show any transparency regardless.") +#@gui :_=separator() +#@gui :_=note("Main Setting") +#@gui :Color Space=choice(0,"RGB","SRGB","RYB","CMYK","HCY","HSI","HSL","HSV","LAB","LCH") +#@gui :Additional Duplicates Count=int(10,2,100) +#@gui :Half Image-Diagonal (%)=float(5,0,100) +#@gui :Angle=float(0,-180,180) +#@gui :Superimpose with Original?=bool(0) +#@gui :_=separator() +#@gui :_=note("Secondary Setting") +#@gui :Boundary=choice(1,"None","Neumann","Periodic","Mirror") +#@gui :Shift Linear Interpolation?=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author : Reptorian Latest update: 2019/9/26.") +#@gui _Testing +#@gui Reptorian +#@gui Gaussian Blur By Color Space:fx_rep_blur_cs,fx_rep_blur_cs_preview +#@gui :XY-Amplitude=float(3,0,100) +#@gui :X-Amplitude=float(0,0,20) +#@gui :Y-Amplitude=float(0,0,20) +#@gui :Boundary=choice(1,"Black","Nearest") +#@gui :_=separator() +#@gui :Color Space=choice(0,"RGB","SRGB","RYB","CMY","CMYKA","HCY","HSI","HSL","HSV","LAB","LCH") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/10/04.") +#@gui Glass Vignette:gui_rep_gv,gui_rep_gv_preview(0) +#@gui :_=note("Distorts images as if it is based from the view of a bulged car mirror or camera len. This G'MIC filter is a heavily extended version of TR's Glass Vignette plugin made by TechnoRobbo for Paint.NET. It can also be used for generating abstract art as well.") +#@gui :_=separator() +#@gui :_=note("Refraction Settings") +#@gui :Refraction (%)=float(100,-200,200) +#@gui :Refraction Power (%)=float(0,-200,200) +#@gui :Len Size (%)=float(100,25,200) +#@gui :Chromatic Aberration (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :_=note("Transformations Settings") +#@gui :_=note("Preliminary Image Transformations") +#@gui :Preliminary Image Shift=point(50,50,0,1,128,128,128,255) +#@gui :Image Additional Zoom (%)=float(0,0,500) +#@gui :Image Angle=float(0,-180,180) +#@gui :_=separator() +#@gui :_=note("Distortion Transformations") +#@gui :Distortion Scale by X-Axis (%)=float(100,0,1000) +#@gui :Distortion Scale by Y-Axis (%)=float(100,0,1000) +#@gui :Distortion Scale by XY-Axis (%)=float(100,0.01,500) +#@gui :Distortion Angle=float(0,-180,180) +#@gui :Distortion Offset=point(50,50,0,1,255,255,255,255) +#@gui :_=note("When Distortion Scale by X-Axis and/or Y-Axis is 0, then distortion will be based on image ratio.") +#@gui :_=separator() +#@gui :_=note("Processing Settings") +#@gui :Colour Space=choice(0,"RGB","SRGB","RYB","CMY","CMYK",HCY",HSI","HSL","HSV","LAB","LCH","YIQ","YUV","YCbCr","YCbCrGLIC","XYZ","YES","Kodak 1","Ohta") +#@gui :Boundary=choice(3,"None","Neumann","Periodic","Mirror") +#@gui :Interpolation=choice(5,"Nearest","Average","Linear","Grid","Bicubic","Lanczos") +#@gui :Subpixel=float(1,0,2) +#@gui :_=separator() +#@gui :_=note("Preview Settings") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/04/06.") +#@gui Graduated Filter:fx_rep_graduated_filter,fx_rep_graduated_filter_preview(0) +#@gui :Strength (%)=float(50,0,100) +#@gui :Luminosity Filtering Strength (%)=float(100,0,100) +#@gui :Placement (%)=float(50,0,100) +#@gui :Filtering Angle=float(0,-180,180) +#@gui :Graduated Filter Color=color(#000000) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2020/1/4.") +#@gui Graphical Tiling Glitch (Interactive):fx_rep_x_graphical_tiling,fx_rep_x_graphical_tiling_preview(0) +#@gui :_=note("Launch the interactive graphical tiling window.\n\nDetails: The main purpose of this filter is to stimulate graphical tiling glitch observed in Microsoft Windows XP Operating System. However, you can also use it to tile images by hand to artistic purpose.\n\nPlease Read Instruction Below!") +#@gui :_=separator() +#@gui :_=note("Main) +#@gui :Initial Insertion Rate (milliseconds)=int(0,0,1000) +#@gui :Background Color=color(#000000) +#@gui :Autocrop and Separate?=bool(0) +#@gui :Reverse Layers?=bool(0) +#@gui :Output Mode=choice(1,"Tiled Only","New Layer","Blended") +#@gui :_=separator() +#@gui :_=note("Preview) +#@gui :Background Mode=choice(0,"Image","Colored","Alpha") +#@gui :Offset=point(50,50,0,1,255,255,255,255) +#@gui :Duplicates=int(5,1,50) +#@gui :Display Message?=bool(1) +#@gui :_=separator() +#@gui :_=note("Instruction) +#@gui :_=note("\nAll Mode\n\n- O: Change Preview Mode\n- SPACE: Switch Mode\n- ESC: End Interactive Window\n\nImportant Note: Check the message in the title bar.\n\nImage Placement Mode\n\n- D: Display Overlay Image\n- H: Flip Image Horizontally\n- V: Flip Image Vertically\n- Mouse Click: Move/Place Image\n- ARROW UP/DOWN: Change Tiling Image\n- ARROW LEFT/RIGHT: Rotate Image\n\nTiling Mode\n\n- Mouse Move: Place Tile at Insertion Rate\n- ARROW UP/DOWN: Add/Subtract Insertion Rate by 100 ms\n- ARROW LEFT/RIGHT: Add/Subtract Insertion rate by 10 ms") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/8/9.") +#@gui Grouped Pixel Axis-Based Shift:fx_rep_sptbwgp,fx_rep_sptbwgp_preview(1) +#@gui :_=note("Based off MadJik's Paint.NET Gravity Plugin. New feature are shift position, and influence factor.") +#@gui :_=separator() +#@gui :Shift Position (%)=float(0,-100,100) +#@gui :Influence Factor (%)=float(0,0,100) +#@gui :Threshold (%)=float(0,0,100) +#@gui :Axis=choice(0,"Horizontal","Vertical") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2022/11/24.") +#@gui Grouped Pixel Axis-Based Shift[Full Image]:fx_rep_sptbwgp_full,fx_rep_sptbwgp_preview_full(0)* +#@gui :_=note("Based off MadJik's Paint.NET Gravity Plugin. New feature are shift position, and influence factor. Full Image means the preview is utilizing full-sized image, so you may experience slow-down with huge images!") +#@gui :_=separator() +#@gui :Shift Position (%)=float(0,-100,100) +#@gui :Influence Factor (%)=float(100,0,100) +#@gui :Threshold (%)=float(0,0,100) +#@gui :Axis=choice(0,"Horizontal","Vertical") +#@gui :Old X Shift Position (%)=float(0,-100,100)_0 +#@gui :Old X Influence Factor (%)=float(100,0,100)_0 +#@gui :Old X Threshold (%)=float(0,0,100)_0 +#@gui :Old Y Shift Position (%)=float(0,-100,100)_0 +#@gui :Old Y Influence Factor (%)=float(100,0,100)_0 +#@gui :Old Y Threshold (%)=float(0,0,100)_0 +#@gui :Old Axis=choice(0,"Horizontal","Vertical")_0 +#@gui :Contain Alpha=int(0,0,1)_0 +#@gui :Minimum Alpha Index=int(0,0,100000000)_0 +#@gui :Has Activated Post-Changes=bool(0)_0 +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2022/11/24.") +#@gui Henon Phase Diagram:fx_rep_henon_phase_diagram,fx_rep_henon_phase_diagram_preview +#@gui :_=note("Creates Henon Phase Diagram.\n\nWarning!: If your image does not show up as expected, you may have to increase points per line and/or lines. Preview is inaccurate!") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :A-Factor=float(2.569,-3.1415,3.1415) +#@gui :Lines=int(500,1,1000000) +#@gui :Points Per Line=int(1000,1,2000) +#@gui :X0-Start=float(-.5,-5,0) +#@gui :X0-End=float(.5,0,5) +#@gui :X0-Increments=int(8,1,14) +#@gui :_=separator() +#@gui :_=note("Transformation") +#@gui :Scale=float(1,.01,4) +#@gui :Rotation=float(0,-180,180) +#@gui :Position=point(50,50,0,1,255,255,255,255) +#@gui :_=separator() +#@gui :_=note("Post-Processing") +#@gui :Subpixel Level=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Coloring") +#@gui :_=note("Preliminary") +#@gui :Mode=choice(0,"Grayscale","HSX","Palette") +#@gui :Use Alpha?=bool(0) +#@gui :_=separator() +#@gui :_=note("Additional") +#@gui :Gray Output=choice(0,"Normalized","Cut","Threshold") +#@gui :Multiplier=float(1,.01,50) +#@gui :HSX Mode=choice(2,"HCY","HSI","HSL/HSV") +#@gui :Palette=choice(0,"Red-Green-Blue-3","Black with Red-Green-Blue-4","Black & White with Red-Green-Blue-5","Cyan-Magenta-Yellow-3","Cyan-Magenta-Yellow-Black-4","White-Cyan-Magenta-Yellow-Black-5","Red-Green-Blue with Cyan-Magenta-Yellow-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus Palette-256","PLAYPAL-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette-33","Koni32","Linear Color Palette Basic-31","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO-46","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8-11","CD-BAC-16","CG Arne-16","DinoKnight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar (Lake Water Lily)-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet Coding Language-20","Matrix-96","Material Design-96","Rainbow-88","Rainbow-96","SCRJ-XXXVI-36","Pxls Default-32","Lospec500-42","Moderna-24","Oak21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80's","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R|place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","FunkyFuture8","The Golden Wall Palette-7","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Cretaceous-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Vanilla MilkShake-16","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58 Palette","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell, Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-7","Ocean Glass-8","RoyalGuard-6","Eulbink-7","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-5","Rabbit 7","Amiga 2600 NTSC-128","Amiga 2600 PAL-104","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series - GTIA-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","Commodore 64 - Pepto-16","Commodore 64 - Colodore-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System Palette-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-244","Win 95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Piet Palette-5","Japanese Woodblock Palette-12","Human Faces-94","HSV Palette-96","ST24 Christmas","Reds-24") +#@gui :Color Count=int(20,2,360)_0 +#@gui :Color Seed=int(0,0,100000)_0 +#@gui :Hue Shift(%)=float(0,0,100)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2023/9/11.") +#@gui Hitomezashi:fx_rep_hitomezashi,fx_rep_hitomezashi_preview(0)* +#@gui :_=note("Initial") +#@gui :_=separator() +#@gui :Mode=choice(0,"One String","Two Strings") +#@gui :Pixel Size=int(5,1,20) +#@gui :Symmetry=choice(0,"None","Symmetry A","Symmetry B","Symmetry C","Symmetry D") +#@gui :Output=choice(0,"Inside","Resized") +#@gui :Background Color=choice(0,"Black","White") +#@gui :Background Value=int(0,0,255) +#@gui :Background Color=color(#ffffff) +#@gui :_=note("\n\nString") +#@gui :_=separator() +#@gui :String=text("") +#@gui :String A=text("") +#@gui :String B=text("") +#@gui :⠀Randomize String⠀=button() +#@gui :⠀Randomize String A⠀=button() +#@gui :⠀Randomize String B⠀=button() +#@gui :⠀⠀Randomize Both⠀⠀=button() +#@gui :_=note("\nNote : Randomize has been programmed to generate binary as characters are converted as binary in the end.\n\n") +#@gui :_=note("Coloring and Shading") +#@gui :_=separator() +#@gui :Mode=choice(3,"Base Binary","Grayscale","Monotone","Duotone","Palette") +#@gui :Gray A=float(0,0,255) +#@gui :Gray B=float(255,0,255) +#@gui :Background Color=color(#808080) +#@gui :Color A=color(#f1ff55) +#@gui :Color B=color(#9f1a9d) +#@gui :Overall Coloring Palette=choice(0,"Pre-Defined Palettes","Random","Random Split-Gradients") +#@gui :Overall Color Space=choice(0,"RGB","HSL") +#@gui :Overall Palette Collection=choice(0,"256 Colors Collection","Pixel Art Palettes") +#@gui :Overall Palette=choice(44,"Default","HSV","Lines","Hot","Cool","Jet","Flag","Cube","Rainbow","Parula","Spring","Summer","Autumn","Winter","Bone","Copper","Pink","Vga","Algae","Amp","Balance","Curl","Deep","Delta","Dense","Diff","Gray","Haline","Ice","Matter","Oxy","Phase","Rain","Solar","Speed","Tarn","Tempo","Thermal","Topo","Turbid","Aurora","Hocus Pocus","SRB2","Uzebox","Amiga 7800","Amiga7800 MESS","Fornax Void I") +#@gui :Overall Palette=choice(10,"Black & White-2","Red-Green-Blue-3","Black with Red-Green-Blue-4","Black & White with Red-Green-Blue-5","Cyan-Magenta-Yellow-3","Cyan-Magenta-Yellow-Black-4","White-Cyan-Magenta-Yellow-Black-5","Red-Green-Blue with Cyan-Magenta-Yellow-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus Palette-256","PLAYPAL-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette-33","Koni32","Linear Color Palette Basic-31","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO-46","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8-11","CD-BAC-16","CG Arne-16","DinoKnight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar (Lake Water Lily)-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet Coding Language-20","Matrix-96","Material Design-96","Rainbow-88","Rainbow-96","SCRJ-XXXVI-36","Pxls Default-32","Lospec500-42","Moderna-24","Oak21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80's","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R|place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","FunkyFuture8","The Golden Wall Palette-7","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Cretaceous-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Vanilla MilkShake-16","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58 Palette","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell, Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-7","Ocean Glass-8","RoyalGuard-6","Eulbink-7","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-5","Rabbit 7","Amiga 2600 NTSC-128","Amiga 2600 PAL-104","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series - GTIA-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","Commodore 64 - Pepto-16","Commodore 64 - Colodore-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System Palette-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-244","Win 95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Piet Palette-5","Japanese Woodblock Palette-12","Human Faces-94","HSV Palette-96","ST24 Christmas","Reds-24") +#@gui :Overall Number of Colors=int(8,2,255) +#@gui :Overall Number of Split-Colors=int(5,1,25) +#@gui :Overall Number of Colors Per Split=int(4,2,10) +#@gui :Overall Seed=int(0,0,200000) +#@gui :Overall Seed=int(0,0,200000) +#@gui :Overall Randomize Seed=button() +#@gui :Overall Boundary=choice(0,"Periodic","Continuous") +#@gui :Overall Shift Colors(%)=float(0,0,100) +#@gui :Overall Reverse Internal=bool(0) +#@gui :Overall Reverse Entire=bool(0) +#@gui :Overall Reverse=bool(0) +#@gui :Stray Coloring Palette=choice(0,"Single","Pre-Defined Palette","Random") +#@gui :Stray Color=color(#000000) +#@gui :Stray Palette=choice(10,"Black & White-2","Red-Green-Blue-3","Black with Red-Green-Blue-4","Black & White with Red-Green-Blue-5","Cyan-Magenta-Yellow-3","Cyan-Magenta-Yellow-Black-4","White-Cyan-Magenta-Yellow-Black-5","Red-Green-Blue with Cyan-Magenta-Yellow-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus Palette-256","PLAYPAL-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette-33","Koni32","Linear Color Palette Basic-31","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO-46","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8-11","CD-BAC-16","CG Arne-16","DinoKnight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar (Lake Water Lily)-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet Coding Language-20","Matrix-96","Material Design-96","Rainbow-88","Rainbow-96","SCRJ-XXXVI-36","Pxls Default-32","Lospec500-42","Moderna-24","Oak21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80's","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R|place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","FunkyFuture8","The Golden Wall Palette-7","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Cretaceous-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Vanilla MilkShake-16","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58 Palette","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell, Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-7","Ocean Glass-8","RoyalGuard-6","Eulbink-7","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-5","Rabbit 7","Amiga 2600 NTSC-128","Amiga 2600 PAL-104","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series - GTIA-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","Commodore 64 - Pepto-16","Commodore 64 - Colodore-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System Palette-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-244","Win 95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Piet Palette-5","Japanese Woodblock Palette-12","Human Faces-94","HSV Palette-96","ST24 Christmas","Reds-24") +#@gui :Stray Number of Colors=int(8,2,20) +#@gui :Stray Seed=int(0,0,200000) +#@gui :Stray Randomize Seed=button() +#@gui :Stray Symmetry=bool(0)_0 +#@gui :Stray Reverse=bool(0) +#@gui :_=note("Border") +#@gui :_=separator() +#@gui :Border Size(%)=float(10,0,100) +#@gui :Border Value=float(128,0,255) +#@gui :Border Color=color(#000000) +#@gui :_=note("Preview") +#@gui :_=separator() +#@gui :Cropped Viewport Point=point(50,50,-1,1,255,255,255,255,1%) +#@gui :Reset Points to Center=button() +#@gui :Started Filter=bool(1)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2023/9/11.") +#@gui HSX Posterize-Index:fx_rep_p_i,fx_rep_p_i_preview +#@gui :Hue Bands=int(10,2,360) +#@gui :Saturation Bands=int(10,2,100) +#@gui :Luminosity Bands=int(10,2,100) +#@gui :Dithering (%)=float(50,0,100) +#@gui :Start Hue=float(0,0,360) +#@gui :Colour Space=choice(2,"HSI","HSL","HSV","HCY") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2022/12/08.") +#@gui Image Dimensions Factors:_none_,fx_find_factors_of_images_preview(1)* +#@gui :_=note("This tool is used to calculate factors of your image dimension. It is not used to change image.") +#@gui :_=separator() +#@gui :Image Index Position(%)=float(0,0,100) +#@gui :Image Index=text("0") +#@gui :Width Factors=_text("Width Factors will be calculated and inserted here") +#@gui :Height Factors=_text("Height Factors will be calculated and inserted here") +#@gui :Width and Height Factors=_text("Width and Height Factors will be calculated and inserted here") +#@gui :Factors Information=_text(1,"Every factors can be copied and pasted from this box") +#@gui :Image Index Position(%)=float(0,0,100)_0 +#@gui :Image Index=text("0")_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2022/12/11.") +#@gui __Deformations +#@gui Kaleidoscope [Reptorian-Polar]:gui_rep_polkal,gui_rep_polkal +#@gui :Angle Cut=float(2,.01,100) +#@gui :Radius Cut=float(1,.01,100) +#@gui :Surface Angle=float(0,-180,180) +#@gui :Center (%)=point(50,50) +#@gui :Flip Angle Direction?=bool(0) +#@gui :Flip Radial Direction?=bool(0) +#@gui :Angle Edge Behaviour=choice(1,"Repeat","Alternating") +#@gui :Radial Edge Behaviour=choice(2,"None","Repeat","Alternating") +#@gui :Fit Radial End to Min/Max Dimension=choice(0,"Minimum Dimension","Maximum Dimension") +#@gui :Conical Start at 0?=bool(1) +#@gui :_=note("Conical start is only used for matching other software filter behavior with conical gradients") +#@gui :_=separator() +#@gui :Sublevel=float(.5,0,3) +#@gui :Interpolation=choice(2,"Nearest","Average","Linear","Grid","Bicubic","Lanczos") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/9/7.") +#@gui _Testing +#@gui Reptorian +#@gui Lavander Binary Map:fx_rep_lavander_binary_map,fx_rep_lavander_binary_map_preview(0)* +#@gui :_=note("Based on the work of Lavander at discord/generative. Instruction on how it works is described at the bottom of this filter.") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Size of Array=choice(0,"Auto","User-Defined") +#@gui :User-Defined Size=int(8,2,14) +#@gui :Formula=choice(5,"AND-Simple","OR-Simple","XOR-Simple","AND","OR","XOR","User-Defined") +#@gui :Binary String A=text("01") +#@gui :Binary String B=text("10") +#@gui :Binary String=text("01") +#@gui :Shift Factor=int(0,0,1000000) +#@gui :Custom Formula=text{"xor(min(xor(x(),y()),xor(ix(),iy())),ix()|iy())"} +#@gui :_=separator() +#@gui :_=note("Additional") +#@gui :TODO Direction=choice(0,"Default","Mirror-X","Mirror-Y","Mirror-XY")_0 +#@gui :Symmetry=choice(0,"None","Symmetry A","Symmetry B","Symmetry C","Symmetry D") +#@gui :TODO Smooth-Shading=bool(0)_0 +#@gui :Post-Process Out-Of-Bound=choice(0,"None","Periodic","Reflected") +#@gui :_=separator() +#@gui :_=note("Random Binary String") +#@gui :Number of Digits for Binary String A=int(2,1,4) +#@gui :Number of Digits for Binary String B=int(2,1,4) +#@gui :Number of Digits for Binary String=int(2,1,4) +#@gui :Binary String A Index=int(0,0,1) +#@gui :Binary String A Index=int(1,0,3) +#@gui :Binary String A Index=int(2,0,7) +#@gui :Binary String A Index=int(0,0,15) +#@gui :Binary String B Index=int(1,0,1) +#@gui :Binary String B Index=int(2,0,3) +#@gui :Binary String B Index=int(5,0,7) +#@gui :Binary String B Index=int(1,0,15) +#@gui :Binary String Index=int(1,0,1) +#@gui :Binary String Index=int(2,0,3) +#@gui :Binary String Index=int(5,0,7) +#@gui :Binary String Index=int(1,0,15) +#@gui :Randomize Binary String A=button() +#@gui :Randomize Binary String B=button() +#@gui :Randomize Both=button() +#@gui :Randomize=button() +#@gui :_=separator() +#@gui :_=note("Color") +#@gui :Color Mode=choice(1,"Normalized","Colorized") +#@gui :Number of Colors=int(5,3,5) +#@gui :Color A=color(#000000) +#@gui :Color B=color(#906f7a) +#@gui :Color C=color(#ffffff) +#@gui :Color A=color(#000000) +#@gui :Color B=color(#2e7d59) +#@gui :Color C=color(#9d9cbd) +#@gui :Color D=color(#ffffff) +#@gui :Color A=color(#000000) +#@gui :Color B=color(#057a49) +#@gui :Color C=color(#906f7a) +#@gui :Color D=color(#a4b8da) +#@gui :Color E=color(#ffffff) +#@gui :Recolor Using Changed Number of Color=button() +#@gui :Random Shade Exponential Factor (%)=float(0,-80,80) +#@gui :Random Lightness Start A (%)=float(0,0,100) +#@gui :Random Darkness Start B(%)=float(0,0,100) +#@gui :TODO Maximum - Lightness=_float(50,50,100)_0 +#@gui :TODO Minimum - Darkness=_float(0,0,50)_0 +#@gui :Random Seed Index=int(12000,0,24000) +#@gui :Randomize Colors=button() +#@gui :Recolor with Current Seed=button() +#@gui :Randomization Status=int(2,0,2)_0 +#@gui :Previous Randomization Status=int(2,0,2)_0 +#@gui :_=separator() +#@gui :_=note("CLI Command") +#@gui :Copy-Able Text=_text("Input Text") +#@gui :Stored Text=_text("Restore Text")_0 +#@gui :Stored Text 2=_text("Stored Text 2")_0 +#@gui :Color Information=_text("Color Information")_0 +#@gui :Mapping Information=_text("Mapping Information")_0 +#@gui :Escape Quotation Mark=bool(0) +#@gui :_=separator() +#@gui :_=note("Custom Formula Available Macros and Variables") +#@gui :_=note{"\nBasic Description:\n\nRecommended Variables to Use\n\n1 - x : X-Coordinate of image\n2 - y : Y-Coordinate of image\n3 - ix : Inverted X-Coordinate of image\n4 - iy : Inverted Y-Coordinate of image\n\nRecommended Macros to Use\n\n1 - x() : Value at index X-Coordinate of image inside reference array\n2 - y() : Value at index Y-Coordinate of image inside reference array\n3 - ix() : Value at index Inverted X-Coordinate of image inside reference array\n4 - iy() : Value at index Inverted X-Coordinate of image inside reference array\n\nRecommended Operators to Use\n\n1 - xor( a,b ) : Return the value of XOR operation using a,b\n2 - a & b / and(a,b): Return the AND value using a,b\n3 - a | b / or(a,b) : Return the OR value using a,b\n4 - flip(v) : Flip bits of value."} +#@gui :_=separator() +#@gui :_=note("Description of How this filter work") +#@gui :_=note{"\nBasic Description:\n\nGenerates a image based on the count of binary number found in string of binary. Initial array contains value count-sorted by count of binary number within binary representation of integers.\n\nStep:\n\n1) Create an array of integer that matches index with size of 2^n.\n2) Create another array which is the count of 'bin_a' in binary representation of the previous array.\n3) Count sort the array of integer with the count of binary number array.\n4) Delete all other array other than the sorted array.\n5) Generate a surface with row and column the same size as the primary array, and use formula which takes values from the sorted value, and then find the count of 'bin_b' in binary representation of the found value.\n\nSource Code: \n\nAuthor: Lavander in discord/generative AKA weightt_an in discuss.pixls.us"} +#@gui :Python Source Code=_text{1,"def m_show(m,size = 4,cmap = 'afmhot'):\n import matplotlib.pyplot as plt\n from numpy import array\n cmaps = ['binary','gist_yarg','gist_gray','gray','bone',\n 'pink','spring','summer','autumn','winter','cool',\n 'Wistia','hot','afmhot','gist_heat','copper']\n plt.figure(num = None,figsize=(size,size),dpi=300)\n plt.axis('off')\n plot = plt.imshow(array(m),cmap = cmap) #,interpolation='bicubic' )\n plt.show()\n plt.close()\n\nfrom tqdm import tqdm\n\ndef get_matrix_bin(s):\n n = len(s)\n mat = [[0]*n for i in range(n)]\n for x in tqdm(range(0,n)):\n for y in range(0,n):\n f = format((s[x] ^ s[y]),'b').count('10')\n mat[x][y] = f\n #mat[y][x] = f\n return mat\n\nbig_n = 11\n\npows = [i for i in range(0,2**big_n)]\npows = sorted(pows,key = lambda k: format(k,'b').count('01'))\nadj_m = get_matrix_bin(pows)\n\nm_show(adj_m)"} +#@gui :Stored Text=_text{1,"def m_show(m,size = 4,cmap = 'afmhot'):\n import matplotlib.pyplot as plt\n from numpy import array\n cmaps = ['binary','gist_yarg','gist_gray','gray','bone',\n 'pink','spring','summer','autumn','winter','cool',\n 'Wistia','hot','afmhot','gist_heat','copper']\n plt.figure(num = None,figsize=(size,size),dpi=300)\n plt.axis('off')\n plot = plt.imshow(array(m),cmap = cmap) #,interpolation='bicubic' )\n plt.show()\n plt.close()\n\nfrom tqdm import tqdm\n\ndef get_matrix_bin(s):\n n = len(s)\n mat = [[0]*n for i in range(n)]\n for x in tqdm(range(0,n)):\n for y in range(0,n):\n f = format((s[x] ^ s[y]),'b').count('10')\n mat[x][y] = f\n #mat[y][x] = f\n return mat\n\nbig_n = 11\n\npows = [i for i in range(0,2**big_n)]\npows = sorted(pows,key = lambda k: format(k,'b').count('01'))\nadj_m = get_matrix_bin(pows)\n\nm_show(adj_m)"}_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2023/03/21.") +#@gui :Started?=bool(0)_0 +#@gui :Size of Array=choice(0,"Auto","User-Defined")_0 +#@gui :Formula=choice(2,"AND-Simple","OR-Simple","XOR-Simple","AND","OR","XOR","User-Defined")_0 +#@gui :Binary String A=text("01")_0 +#@gui :Binary String B=text("10")_0 +#@gui :Binary String=text("01")_0 +#@gui :Binary String A Index=int(0,0,1)_0 +#@gui :Binary String A Index=int(1,0,3)_0 +#@gui :Binary String A Index=int(2,0,7)_0 +#@gui :Binary String A Index=int(0,0,15)_0 +#@gui :Binary String B Index=int(1,0,1)_0 +#@gui :Binary String B Index=int(2,0,3)_0 +#@gui :Binary String B Index=int(5,0,7)_0 +#@gui :Binary String B Index=int(1,0,15)_0 +#@gui :Binary String Index=int(1,0,1)_0 +#@gui :Binary String Index=int(2,0,3)_0 +#@gui :Binary String Index=int(5,0,7)_0 +#@gui :Binary String Index=int(1,0,15)_0 +#@gui :Shift Factor=int(0,0,1000000)_0 +#@gui :Custom Formula=text{"xor(min(xor(x(),y()),xor(ix(),iy())),ix()|iy())"}_0 +#@gui :TODO Direction=choice(0,"Default","Mirror-X","Mirror-Y","Mirror-XY")_0 +#@gui : 0 Symmetry=choice(0,"None","Symmetry A","Symmetry B","Symmetry C","Symmetry D")_0 +#@gui :TODO Smooth-Shading=bool(0)_0 +#@gui :User-Defined Size=int(8,2,14)_0 +#@gui :Size of Image=int(8,2,14)_0 +#@gui :Auto-Size of Image=int(0,0,14)_0 +#@gui :Auto-Size of Symmetric Image=int(0,0,14)_0 +#@gui :Color Mode=choice(1,"Normalized","Colorized")_0 +#@gui :Number of Colors=int(5,3,5)_0 +#@gui :Color A=color(#000000)_0 +#@gui :Color B=color(#906f7a)_0 +#@gui :Color C=color(#ffffff)_0 +#@gui :Color A=color(#000000)_0 +#@gui :Color B=color(#2e7d59)_0 +#@gui :Color C=color(#9d9cbd)_0 +#@gui :Color D=color(#ffffff)_0 +#@gui :Color A=color(#000000)_0 +#@gui :Color B=color(#057a49)_0 +#@gui :Color C=color(#906f7a)_0 +#@gui :Color D=color(#a4b8da)_0 +#@gui :Color E=color(#ffffff)_0 +#@gui :Random Shade Exponential Factor (%)=_float(0,-80,80)_0 +#@gui :Random Lightness Start A (%)=_float(0,0,100)_0 +#@gui :Random Darkness Start B(%)=_float(0,0,100)_0 +#@gui :TODO Maximum - Lightness=_float(50,50,100)_0 +#@gui :TODO Minimum - Darkness=_float(0,0,50)_0 +#@gui :Random Seed Index=int(12000,0,24000)_0 +#@gui :TODO Has Activated Smooth?-Shade=bool(0)_0 +#@gui __Deformations +#@gui Logarithmic Distortion:rep_logpindis_gui,rep_logpindis_gui_preview(0) +#@gui :_=note("This filter is a extended version of a filter found in Asmageddon Tools Pack v3. Translated to G'MIC using a source code, and then extended. It is a mixture of two texture filters.") +#@gui :_=separator() +#@gui :Distortion Factor=float(1,.1,1000) +#@gui :Preliminary Surface Shift=point(50,50,0,1,128,128,128,255) +#@gui :Distortion Surface Position=point(50,50,0,1,255,255,255,255) +#@gui :Preliminary X-Axis Scaling=float(1,.1,10) +#@gui :Preliminary Y-Axis Scaling=float(1,.1,10) +#@gui :Effect X-Axis Scaling=float(1,.1,10) +#@gui :Effect Y-Axis Scaling=float(1,.1,10) +#@gui :Distortion Surface Angle=float(0,0,360) +#@gui :Placement=choice(0,"Inside-Out","Outside-In") +#@gui :Logarithmic Distortion Axis Combination for X-Axis=choice(0,"Different Axis","Same Axis") +#@gui :Logarithmic Distortion Axis Combination for Y-Axis=choice(0,"Different Axis","Same Axis") +#@gui :Logarithmic Distortion X-Axis Direction=choice(0,"Negative","Positive") +#@gui :Logarithmic Distortion Y-Axis Direction=choice(0,"Negative","Positive") +#@gui :Boundary Condition=choice(0,"Periodic","Mirror") +#@gui :Interpolation=choice(2,"Nearest","Linear","Bicubic") +#@gui :Base Reference Dimension=int(1024,10,4096) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/6/4.") +#@gui _Testing +#@gui Reptorian +#@gui Majority:gui_rep_majority,gui_rep_majority_preview +#@gui :_=separator() +#@gui :_=note("Filter Options") +#@gui :Color Space=choice(11,"RGB","SRGB","RYB","CMY","CMYK","HCY","HSI","HSL","HSV","LAB","LCH","YIQ","YUV","YCbCr","YCbCrGLIC","XYZ","YES","Kodak 1","Ohta") +#@gui :Contain Alpha=bool(0) +#@gui :Kernel Size=int(5,2,50) +#@gui :Mode=choice(0,"Soft Regular","Soft Average Channels","Hard Regular,"Hard Average Channels") +#@gui :Convert to Black and White?=bool(0) +#@gui :_=separator() +#@gui :_=note("Preview Setting") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Info about filter\n\nMajority effects comes in one of those two version.\n\n1- Use a predefined value to take either the value of the min/max values within kernel.\n\n2-Automatically let the average of kernel to define which values to take which can be either min/max value within kernel.") +#@gui :_=separator() +#@gui :_=note("More information - Paint.NET Majority Effect") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/12/31.") +#@gui Majority [Threshold]:gui_rep_majority_threshold,gui_rep_majority_threshold_preview +#@gui :_=separator() +#@gui :_=note("Filter Options") +#@gui :Color Space=choice(11,"RGB","SRGB","RYB","CMY","CMYK","HCY","HSI","HSL","HSV","LAB","LCH","YIQ","YUV","YCbCr","YCbCrGLIC","XYZ","YES","Kodak 1","Ohta") +#@gui :Contain Alpha=bool(0) +#@gui :Kernel Size=int(5,2,50) +#@gui :Tolerance (%)=float(50,0,100) +#@gui :Conditional Mode=choice(1,"Less Than","Greater Than") +#@gui :Output Mode=choice(0,"Soft","Hard") +#@gui :Convert to Black and White?=bool(0) +#@gui :_=separator() +#@gui :_=note("Preview Setting") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Info about filter\n\nMajority effects comes in one of those two version.\n\n1- Use a predefined value to take either the value of the min/max values within kernel.\n\n2-Automatically let the average of kernel to define which values to take which can be either min/max value within kernel.") +#@gui :_=separator() +#@gui :_=note("More information - Paint.NET Majority Effect") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/12/31.") +#@gui Markus-Lyapunov Fractal:fx_rep_mlfrac,fx_rep_mlfrac +#@gui :_=note("Create a mapping of Lyapunov exponent within two values or three values.") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :ABC-String=text("ab") +#@gui :ABC-String Repeats=int(50,1,255) +#@gui :Subsampling Level=float(1,0,6) +#@gui :Viewport(%)=float(100,0,100) +#@gui :Position=point(50,50,0,1,255,255,255,255) +#@gui :C-Time(%)=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Output") +#@gui :Mode=choice(0,"Grayscale","Duotone","Random","Palette","Layers") +#@gui :Use Inverted?=bool(0) +#@gui :Color A=color(#0000ffff) +#@gui :Color B=color(#ffff00ff) +#@gui :Set of Palettes=choice(0,"Single","Double") +#@gui :Seed=int(0,0,10000000) +#@gui :Random Palette Color Count=int(8,2,64) +#@gui :Random Palette A Color Count=int(8,2,64) +#@gui :Random Palette B Color Count=int(8,2,64) +#@gui :Color Space=choice(0,"HSL","LAB","LCH") +#@gui :Palette=choice(12,"Black & White-2","Red-Green-Blue-3","Black with Red-Green-Blue-4","Black & White with Red-Green-Blue-5","Cyan-Magenta-Yellow-3","Cyan-Magenta-Yellow-Black-4","White-Cyan-Magenta-Yellow-Black-5","Red-Green-Blue with Cyan-Magenta-Yellow-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus Palette-256","PLAYPAL-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette-33","Koni32","Linear Color Palette Basic-31","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO-46","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8-11","CD-BAC-16","CG Arne-16","DinoKnight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar (Lake Water Lily)-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet Coding Language-20","Matrix-96","Material Design-96","Rainbow-88","Rainbow-96","SCRJ-XXXVI-36","Pxls Default-32","Lospec500-42","Moderna-24","Oak21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80's","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R|place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","FunkyFuture8","The Golden Wall Palette-7","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Cretaceous-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Vanilla MilkShake-16","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58 Palette","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell, Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-7","Ocean Glass-8","RoyalGuard-6","Eulbink-7","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-5","Rabbit 7","Amiga 2600 NTSC-128","Amiga 2600 PAL-104","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series - GTIA-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","Commodore 64 - Pepto-16","Commodore 64 - Colodore-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System Palette-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-244","Win 95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Piet Palette-5","Japanese Woodblock Palette-12","Human Faces-94","HSV Palette-96","ST24 Christmas","Reds-24") +#@gui :Palette Order=choice(0,"Default","Randomized","Mirrored") +#@gui :Palette A=choice(16,"Black & White-2","Red-Green-Blue-3","Black with Red-Green-Blue-4","Black & White with Red-Green-Blue-5","Cyan-Magenta-Yellow-3","Cyan-Magenta-Yellow-Black-4","White-Cyan-Magenta-Yellow-Black-5","Red-Green-Blue with Cyan-Magenta-Yellow-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus Palette-256","PLAYPAL-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette-33","Koni32","Linear Color Palette Basic-31","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO-46","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8-11","CD-BAC-16","CG Arne-16","DinoKnight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar (Lake Water Lily)-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet Coding Language-20","Matrix-96","Material Design-96","Rainbow-88","Rainbow-96","SCRJ-XXXVI-36","Pxls Default-32","Lospec500-42","Moderna-24","Oak21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80's","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R|place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","FunkyFuture8","The Golden Wall Palette-7","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Cretaceous-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Vanilla MilkShake-16","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58 Palette","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell, Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-7","Ocean Glass-8","RoyalGuard-6","Eulbink-7","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-5","Rabbit 7","Amiga 2600 NTSC-128","Amiga 2600 PAL-104","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series - GTIA-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","Commodore 64 - Pepto-16","Commodore 64 - Colodore-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System Palette-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-244","Win 95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Piet Palette-5","Japanese Woodblock Palette-12","Human Faces-94","HSV Palette-96","ST24 Christmas","Reds-24") +#@gui :Palette A Order=choice(0,"Default","Randomized","Mirrored") +#@gui :Palette B=choice(50,"Black & White-2","Red-Green-Blue-3","Black with Red-Green-Blue-4","Black & White with Red-Green-Blue-5","Cyan-Magenta-Yellow-3","Cyan-Magenta-Yellow-Black-4","White-Cyan-Magenta-Yellow-Black-5","Red-Green-Blue with Cyan-Magenta-Yellow-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus Palette-256","PLAYPAL-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette-33","Koni32","Linear Color Palette Basic-31","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO-46","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8-11","CD-BAC-16","CG Arne-16","DinoKnight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar (Lake Water Lily)-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet Coding Language-20","Matrix-96","Material Design-96","Rainbow-88","Rainbow-96","SCRJ-XXXVI-36","Pxls Default-32","Lospec500-42","Moderna-24","Oak21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80's","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R|place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","FunkyFuture8","The Golden Wall Palette-7","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Cretaceous-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Vanilla MilkShake-16","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58 Palette","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell, Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-7","Ocean Glass-8","RoyalGuard-6","Eulbink-7","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-5","Rabbit 7","Amiga 2600 NTSC-128","Amiga 2600 PAL-104","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series - GTIA-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","Commodore 64 - Pepto-16","Commodore 64 - Colodore-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System Palette-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-244","Win 95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Piet Palette-5","Japanese Woodblock Palette-12","Human Faces-94","HSV Palette-96","ST24 Christmas","Reds-24") +#@gui :Palette B Order=choice(0,"Default","Randomized","Mirrored") +#@gui :Color Count=int(8,2,64) +#@gui :Palette Order=choice(0,"Default","Randomized","Mirrored") +#@gui :Color Count A=int(8,2,64) +#@gui :Palette A Order=choice(0,"Default","Randomized","Mirrored") +#@gui :Color Count B=int(8,2,64) +#@gui :Palette B Order=choice(0,"Default","Randomized","Mirrored") +#@gui :Reverse Layers=bool(0) +#@gui :Reverse Non-Target Layers=bool(0) +#@gui :Mode=choice(0,"Import One File Only","Import Two Files")_0 +#@gui :File=file()_0 +#@gui :File A=file()_0 +#@gui :File B=file()_0 +#@gui :Color Count=int(8,2,64)_0 +#@gui :Randomize Color Position=bool(0)_0 +#@gui :Color Count A=int(8,2,64)_0 +#@gui :Randomize Colors A Position=bool(0)_0 +#@gui :Color Count B=int(8,2,64)_0 +#@gui :Randomize Colors B Position=bool(0)_0 +#@gui :_=separator() +#@gui :_=note("Orientation") +#@gui :X-Direction=choice(0,"Default","Mirrored")_0 +#@gui :Y-Direction=choice(0,"Default","Mirrored")_0 +#@gui :_=note("Under Development!") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2023/9/11.") +#@gui Mitchell Concatenation:fx_rep_mitchell_concatenation,fx_rep_mitchell_concatenation_preview(0)* +#@gui :_=note("This filter is a recreation of Kerry's Mitchell Concatenation.\n\nWarning: Make sure of the options being applied!") +#@gui :_=separator() +#@gui :_=note("Initial") +#@gui :Mode=choice(0,"Singular","Dual") +#@gui :Pixel Size(%)=float(0,0,50) +#@gui :Output=choice(0,"New Dimension","Old Dimension") +#@gui :_=separator() +#@gui :_=note("Starting Point") +#@gui :Start=int(1,1,2000000) +#@gui :Start A=int(1,1,2000000) +#@gui :Start B=int(1,1,2000000) +#@gui :Link Start Numbers?=bool(0) +#@gui :_=separator() +#@gui :_=note("Base System") +#@gui :Base=int(10,2,1000) +#@gui :Base A=int(10,2,1000) +#@gui :Base B=int(10,2,1000) +#@gui :Link Bases?=bool(0) +#@gui :_=separator() +#@gui :_=note("Method") +#@gui :Method=choice(0,"Subtraction","Addition","Multiplication") +#@gui :Method A=choice(0,"Subtraction","Addition","Multiplication") +#@gui :Method B=choice(1,"Subtraction","Addition","Multiplication") +#@gui :Link Method?=bool(0) +#@gui :_=separator() +#@gui :_=note("Palette") +#@gui :Mode=choice(1,"Singular","Dual") +#@gui :Set=choice(0,"Foreground","Background") +#@gui :Color 1=color(#ffffff) +#@gui :Color 2=color(#f3ebe3) +#@gui :Color 3=color(#c8c888) +#@gui :Color 4=color(#7c8f5b) +#@gui :Color 5=color(#354a43) +#@gui :Color 6=color(#221724) +#@gui :Color 7=color(#000000) +#@gui :Color 1=color(#cecece) +#@gui :Color 2=color(#c6bab6) +#@gui :Color 3=color(#a687b6) +#@gui :Color 4=color(#786946) +#@gui :Color 5=color(#374530) +#@gui :Color 6=color(#25212f) +#@gui :Color 7=color(#181818) +#@gui :Color 1=color(#ffffff) +#@gui :Color 2=color(#f3ece3) +#@gui :Color 3=color(#bac888) +#@gui :Color 4=color(#668f5b) +#@gui :Color 5=color(#37354a) +#@gui :Color 6=color(#241719) +#@gui :Color 7=color(#000000) +#@gui :Link Color Palettes?=bool(0) +#@gui :_=separator() +#@gui :_=note("Shape") +#@gui :Use Shape=bool(1) +#@gui :Tiled Shape=choice(2,"Australia","Barbedwire","Circle","Crosshair","Cupid","Diamond","Dragon Curve-[D]","Dragonfly","Fern-[D]","Flip","Gear-[D]","Gumleaf","Heart","Information","Kookaburra","Mail","Mapleleaf","Paint Splat","Paw","Phone","Polygon-[D]","Rooster","Shopping Cart","Snowflake-[D]","Star-[D]") +#@gui :Use Image as Shape?=bool(0) +#@gui :Ratio(%)=float(100,.1,100) +#@gui :Angle=float(0,-180,180) +#@gui :Direction=choice(0,"None","Mirror X","Mirror Y") +#@gui :Tile Boundary=choice(0,"Periodic","Mirror - X","Mirror - Y","Mirror - XY") +#@gui :Fit Tile?=bool(1) +#@gui :Dragon Curve Recursion=int(10,0,30) +#@gui :Dragon Curve Rotation=float(0,-180,180) +#@gui :Fern Type=choice("Asplenium Adiantum-Nigrum","Thelypteridaceae") +#@gui :Fern Density (%)=float(100,0,300) +#@gui :Gear Teeth Count=int(8,3,32) +#@gui :Gear Height (%)=float(25,0.1,100) +#@gui :Gear Offset Teeth (%)=float(0,0,100) +#@gui :Gear Inner Ratio (%)=float(50,0.1,100) +#@gui :Polygon Vertices=int(5,3,100) +#@gui :Snowflake Recursion=int(5,1,6) +#@gui :Star Branches=int(3,5,100) +#@gui :Star Thickness (%)=float(38,.1,100) +#@gui :_=separator() +#@gui :_=note("Misc") +#@gui :Position=choice(0,"10","100","1000","10000","100000") +#@gui :Position A=choice(0,"10","100","1000","10000","100000") +#@gui :Position B=choice(0,"10","100","1000","10000","100000") +#@gui :Push into Start Number=button() +#@gui :Push into Start A=button() +#@gui :Push into Start B=button() +#@gui :Push into Both=button() +#@gui :Start A=int(1,1,2000000)_0 +#@gui :Start B=int(1,1,2000000)_0 +#@gui :Base A=int(10,2,1000)_0 +#@gui :Base B=int(10,2,1000)_0 +#@gui :Method A=choice(0,"Subtraction","Addition","Multiplication")_0 +#@gui :Method B=choice(0,"Subtraction","Addition","Multiplication")_0 +#@gui :Color 1=color(#ffffff)_0 +#@gui :Color 2=color(#f3ebe3)_0 +#@gui :Color 3=color(#c8c888)_0 +#@gui :Color 4=color(#7c8f5b)_0 +#@gui :Color 5=color(#354a43)_0 +#@gui :Color 6=color(#221724)_0 +#@gui :Color 7=color(#000000)_0 +#@gui :Color 1=color(#cecece)_0 +#@gui :Color 2=color(#c6bab6)_0 +#@gui :Color 3=color(#a687b6)_0 +#@gui :Color 4=color(#786946)_0 +#@gui :Color 5=color(#374530)_0 +#@gui :Color 6=color(#25212f)_0 +#@gui :Color 7=color(#181818)_0 +#@gui :Color 1=color(#ffffff)_0 +#@gui :Color 2=color(#f3ece3)_0 +#@gui :Color 3=color(#bac888)_0 +#@gui :Color 4=color(#668f5b)_0 +#@gui :Color 5=color(#37354a)_0 +#@gui :Color 6=color(#241719)_0 +#@gui :Color 7=color(#000000)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2022/02/08.") +#@gui __Rendering +#@gui Nebulous:fx_rep_nebulous,fx_rep_nebulous_preview +#@gui :_=note("Based off MadJik's PDN Nebulous plugin. The G'MIC version of Nebulous allows you to manipulate the result by angle within the main surface and the distortion surface, and allows you to shift the positioning of the Nebulous surface. Furthermore, the G'MIC version of Nebulous doesn't use integer on the output of surface.") +#@gui :_=separator() +#@gui :_=note("Surface Theme") +#@gui :Colour Space Mode=choice(0,"RGB8","RYB8","HSI8","HSL8","HSV8","LAB8","LCH8","YIQ8","YUV8","XYZ8","YES8","Kodak 1-8","Ohta8","YCoCg-R") +#@gui :_=separator() +#@gui :_=note("Surface Generation") +#@gui :XY-Factor=float(4,.1,1000) +#@gui :X-Factor=float(10,.01,1000) +#@gui :Y-Factor=float(10,.01,1000) +#@gui :X-Shift (%)=float(0,-10,10) +#@gui :Y-Shift (%)=float(0,-10,10) +#@gui :Angle of Main Nebulous Surface=float(0,-180,180) +#@gui :Wave(s)=float(1,-25,25) +#@gui :Lighting Angle=float(0,-180,180) +#@gui :Surface Disturbance=float(0,0,2000) +#@gui :Surface Disturbance Multiplier=float(1,1,500) +#@gui :Disturbance X=float(0,0,1000) +#@gui :Disturbance Y=float(0,0,1000) +#@gui :Angle of Disturbance Surface=float(0,-180,180) +#@gui :Disturbance Scale-By-Factor=bool(0) +#@gui :Output Mode=choice(2,"Built-in Gray","Luminosity from Color","Color") +#@gui :Alpha Mode=choice(0,"None","Hard Light","Hard Dark","Smooth Light","Smooth Dark") +#@gui :_=separator() +#@gui :_=note("Subpixel Processing\n\n You do not need to touch this unless you want higher amount of precision, but the difference is small. If you are using a very small surface or hard alpha mode, then it makes sense to touch subpixel processing variables.") +#@gui :Subpixel Level=float(1,0,3) +#@gui :Subpixel Interpolation=choice(3,"Average","Linear","Grid","Bicubic","Lanczos") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2019/5/11.") +#@gui _Testing +#@gui Reptorian +#@gui Newton Fractal [MadJik Style]:rep_mj_newf,rep_mj_newf +#@gui :_=note("Warning- Filter is very hard to control!Also,filter is computationally intensive!\n\nMight be solved later.") +#@gui :_=separator() +#@gui :Zoom=float(16,1,1000000) +#@gui :X-Pan=float(0,-10000,10000) +#@gui :Y-Pan=float(0,-10000,10000) +#@gui :Color Range=float(128,0,255) +#@gui :Factor A=float(9,-100,100) +#@gui :Factor B=float(0,-100,100) +#@gui :Factor C=float(75,-100,100) +#@gui :Factor D=float(5,-100,100) +#@gui :Exponent=float(10,0,17) +#@gui :Depth=float(50,1,500) +#@gui :Background Frequency=float(50,1,500) +#@gui :Color Angle=float(45,-180,180) +#@gui :Alternate Color Function=bool(0) +#@gui :Symmetry=bool(0) +#@gui :Channel Swap=bool(0) +#@gui :_=separator() +#@gui :_=note{"Original Code made by MadJik - Newton Fractal texture (ymd 170915} +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/1/2.") +#@gui Non-Convolution Edge Extraction:fx_ncee,fx_ncee_preview(0) +#@gui :_=note("Based off PS Embossing filtering. The way it works is that you duplicate once and then shift with wrap-around using original image data using an angle and offset. Then finally, you invert one of the layer, and average those values. In this filter, you have several options when it comes to alpha and how the image wrap-around. Also, CMYK mode may be fixed later as I'm trying to avoid the problem with Alpha mode and CMYK mode.") +#@gui :_=separator() +#@gui :Colour Space=choice(0,"RGB8","RYB8","CMY8","CMYK8","HSI8","HSL8","HSV8","LAB8","LCH8","YIQ8","YUV8","XYZ8","YES8","Kodak 1-8","Ohta8") +#@gui :_=separator() +#@gui :Angle=float(0,0,360) +#@gui :Offset=float(1,.5,256) +#@gui :Contrast Factor [%]=float(100,0,500) +#@gui :Wraparound Mode=choice(2,"Dirichlet","Neumann","Periodic","Mirror") +#@gui :Interpolation=bool(0) +#@gui :_=separator() +#@gui :_=note("Alpha Processing") +#@gui :Alpha Mode=choice(0,"Preserve Original Alpha","Multiply Alphas") +#@gui :_=separator() +#@gui :_=note("Blending Processing\n\nIf you're looking for normal blending mode, you do not need to touch this and if you did, set mode to alpha and opacity to 100.") +#@gui :Blending Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Screen","Shapeaverage","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :9. Blending Opacity=float(100,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest Update: 2019/4/25.") +#@gui Non-Isometric RPG Tiler (Interactive):fx_rep_rpgtiler_noniso,fx_rep_rpgtiler_noniso_preview +#@gui :_=note("Launch the interactive non-isometric RPG Tiling toolkit.\n\nNote : When using Custom Tileset, you must load the file in tileset!\n\nPlease Read Instruction Below!") +#@gui :_=separator() +#@gui :_=note("Tileset") +#@gui :Premade Tileset=choice(0,LPC House Interior[32],Generic Platform[32],Metroid Like[16],Omega Team[16],Classic RPG[16],Dungeon[32],Happyland[16]) +#@gui :Import Custom Tileset?=bool(0) +#@gui :Tileset=file() +#@gui :_=separator() +#@gui :_=note("Interactive Window Setting") +#@gui :Tile Size=int(32,3,128) +#@gui :Max Selection Increment=int(2,0,8) +#@gui :Interactive Tileset Width=int(16,2,64) +#@gui :Interactive Tileset Height=int(16,2,64) +#@gui :Layer as Placed Tiles?=bool(0) +#@gui :Apply Image Background on Final Image?=bool(0) +#@gui :Alpha to RGB Background Mode=choice(0,"Checkerboard","Colored") +#@gui :Background Colour=color(#000000) +#@gui :Grid Color=float(0,0,255) +#@gui :Trackpad Color=float(45,0,255) +#@gui :_=separator() +#@gui :_=note("Preprocessing") +#@gui :Reverse Layers?=bool(0) +#@gui :_=note("This option is usable for programs that supports editing on two or more layer at once with G'MIC-QT!") +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Hide Background?=bool(0) +#@gui :Preview Grid and Tracker?=bool(1) +#@gui :Hide Tileset?=bool(0) +#@gui :_=separator() +#@gui :_=note("Paint.NET Workaround") +#@gui :Output Mode=choice(0,"Center Result","Output to File") +#@gui :Output Folder=folder() +#@gui :Output Filename=text("placed_tile.png") +#@gui :_=note("This section is only for Paint.NET users! If you don't use this this software, then you don't need use this section!") +#@gui :_=separator() +#@gui :_=note("\n- Instruction -\n\n") +#@gui :_=separator() +#@gui :_=note("Section 1 - Preview Window") +#@gui :_=separator() +#@gui :_=note("Before processing to the interactive window - Test the following conditions:\n\n1. Tileset is correct\n2. Grid fits and is very visible\n3. Tracker is very visible\n\nIf the preview looks good, then proceed to the interactive tool by clicking OK.\n\nWarning: Apply will only waste your time!") +#@gui :_=separator() +#@gui :_=note("Section 2 - Interactive Windows") +#@gui :_=separator() +#@gui :_=note("Press Escape on Canvas Window to exit!\n\nMain Editing Mode\n\nOn Any Windows\n\n- D: Switch between Place/Eraser Mode\n- R: Activate Replace Mode\n- W: Restore All Windows\n- SPACEBAR: Switch Editing Mode\n\nOn Canvas Window\n\n- C: Copy Mode On/Off\n- X: Cut Mode On/Off\n- Z: Undo Canvas Change\n- F: Activate/Deactivate Background Tile Layering Mode\n- G: Grid Mode On/Off\n- Q: Remove/Restore Background\n- A: Tracker On/Off\n- S: Symmetry Mode On/Off\n\n=== On Canvas[Symmetry Mode] ===\n--- 1: Switch Symmetry Axis to X-Axis\n--- 2: Switch Symmetry Axis to Y-Axis\n--- 3: Switch Symmetry Axis to Cross XY-Axis\n--- 4: Switch Symmetry Axis to Mirror XY-Axis\n--- ARROWKEY: Move Symmetry Line\n--- B: Switch Axis in Symmetry Mode\n--- M: Switch Axis in Periodic/Mirror Mode\n--- J: Symmetry Line to Center\n--- S: Deactivate Symmetry Mode\n\nOn Tileset Window\n\n- G: Grid Mode On/Off\n- CTRL+ARROWKEY : Resize Tile Selection\n- ARROWKEY : Scroll Through Tileset\n\nOn Tile Window\n\n- CTRL+ARROWKEY : Resize Tile Selection\n- ARROWKEY : Scroll Through Tileset\n- MOUSE BUTTON : Switch Between Place/Eraser Mode\n\n=== On Tile[No Symmetry Mode] ===\n--- 1: Switch Fill Boundary to Periodic\n--- 2: Switch Fill Boundary to Mirror\n--- 3: Switch Fill Boundary to Mirror X\n--- 4: Switch Fill Boundary to Mirror Y\n--- B: Switch Fill Boundary Mode\n\nRow/Column Editing Mode\n\nOn Any Windows\n\n- W: Restore All Windows\n- SPACEBAR: Switch Editing Mode\n\nOn Canvas Window\n\n- Z: Undo Canvas Change\n- T: Enable Row/Column Shifting Mode\n- E: Place Mode On/Off\n- G: Grid Mode On/Off\n- Q: Remove/Restore Background\n- A: Tracker On/Off\n- S: Activate Symmetrical Selection Mode\n\n=== On Canvas[Selection] ===\n--- C: Keep Selected Row/Column\n--- X: Delete Selected Row/Column\n--- D: Select/Deselect\n--- R: Clear Selection\n--- V: View Selection Box/Hide Selection Box\n--- Mouse Button: Select/Deselect\n--- ARROWKEY: Switch between Row/Column Selection\n\n=== On Canvas[Symmetry Mode-Symmetry] ===\n--- J: Symmetry Line to Center\n--- ARROWKEY: Move Symmetry Line\n--- S: Deactivate Symmetrical Selection Mode\n\n=== On Canvas[Row/Column Shifting Mode] ===\n--- Mouse Button[1st Click]: Activate Shifting\n--- Mouse Button[2nd Click]: Finalize Shifting\n--- 0: Shift Boundary Mode - None\n--- 1: Shift Boundary Mode - Neumann [Periodic]\n--- 2: Shift Boundary Mode - Neumann [Mirror]\n--- 3: Shift Boundary Mode - Neumann [Alternating]\n--- 4: Shift Boundary Mode - Periodic\n--- 5: Shift Boundary Mode - Mirror\n--- ARROWKEY: Switch between Row/Column Selection\n--- T: Disable Row/Column Shifting Mode\n\n=== On Canvas[Place Mode] ===\n--- Mouse Button: Place Row/Column\n--- B: Switch between Replacement/Placement Mode\n--- F: Place Row/Column as Foreground/Background\n--- Mouse Button: Place Row/Column\n--- E: Deactivate Place Mode\n\nOn Tile Window\n\n- ARROWKEY: Flip Row/Column") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/10/20.") +#@gui Object Size Filtering:gui_rep_objvf,gui_rep_objvf_preview(0) +#@gui :Mode of Object Filtering=choice(0,"Auto","Alpha","Colour") +#@gui :Threshold for Auto-Mode Switching(%)=float(10,0,100) +#@gui :_=separator() +#@gui :_=note("Object Filtering Options") +#@gui :Volume 1 (%)=float(1,0,100) +#@gui :Volume 2 (%)=float(99,0,100) +#@gui :Preserve=choice(0,"Inclusive","Exclusive") +#@gui :Preserve=choice(0,"Inclusive by Secondary Max Area","Exclusive by Secondary Max Area") +#@gui :Use Secondary Maximum Area?=bool(0) +#@gui :Colour=color(#00000000) +#@gui :_=separator() +#@gui :_=note("Preview Settings") +#@gui :Reveal Erased Objects?=bool(1) +#@gui :Colour of Erased Object=color(#7f7f7f) +#@gui :Render Mode=choice(0,"Main","Removed Alpha Mode","Alpha Details") +#@gui :List Percentiles?=bool(0)_0 +#@gui :_=separator() +#@gui :_=note("-Instruction-\n\nThe purpose of this filter is to filter objects based on their volume. It is based on the principle of the Object Pruner plugin for Paint.NET made by MJW.\n\nNote: Use Colour Mode for fully opaque image.\nAlternative Note: Use Colour Mode with Alpha or Auto.\n\nSpecial Note: If you're seeing error, switch the render mode and pick the colors until error no longer show up on Main Render Mode.Sometimes changing Mode of Object Filtering can resolve it.\n----\nWarning: Untested on GIMP!") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/2/21.") +#@gui Ordered Dithering:fx_rep_loupasc_ordered_dither,fx_rep_loupasc_ordered_dither_preview +#@gui :Dithering Method=choice(4,"Checkerboard","Dispersed","Arcade","Ordered","Lines","Matrix","Random") +#@gui :Color Count=choice(3,"2","4","6","16") +#@gui :Use Luminosity?=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Dithering algorithm developed by Pascal Ollive. - Source Code Link") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/5/15.") +#@gui Panel Image:rep_fx_shift,rep_fx_shift_preview +#@gui :Offset=point(50,50,0,1,255,255,255,255) +#@gui :Boundary=choice(2,"None","Neumann","Periodic","Mirror") +#@gui :Interpolation=choice(2,"Nearest","Linear","Bicubic") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/2/04.") +#@gui Perspective Streak:gui_rep_perspective_streak,gui_rep_perspective_streak_preview(0) +#@gui :_=note("Creates streak effect toward vanishing point. Read notes below the filter option for more instructions.\n\nWarning - This is a computationally intensive filter.\n\nNote - Future versions may come with easier way to utilize this filter.") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Vanishing Point (%)=point(50,50,0,1,128,128,128,255) +#@gui :Alpha Exponential Factor (%)=float(0,-100,500) +#@gui :Distance Threshold (%)=float(100,.1,100) +#@gui :Distance Start (%)=float(0,0,99.99) +#@gui :Streak Direction=choice(0,"Inside","Outside") +#@gui :_=separator() +#@gui :_=note("Info Output") +#@gui :Streak Mode=choice(0,"Color","Grayscale","Binary","Grayscale+Binary") +#@gui :Preserve Edges=bool(1) +#@gui :_=note("Preserve Edges are not available on binary mode.") +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("- Instruction Notes-\n\nNote 1 - To effectively use this filter, experiment using Secondary Settings on multiple copies of original image[s].\n\nNote 2 - Use blending modes.\n\nNote 3 - If your software supports alpha inheritance, use that to advantage.") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/12/8.") +#@gui Picture Mosaic:fx_rep_photomosaic,fx_rep_photomosaic_preview +#@gui :_=note("Generates picture mosaic using indexing,color searching, and scaling.\n\nNote - Instruction are found below!") +#@gui :_=separator() +#@gui :_=note("- Input -") +#@gui :Use Folder?=bool(0) +#@gui :Mosaic Tile Pictures=folder() +#@gui :Target Layer=choice(0,"Top","Bottom") +#@gui :_=separator() +#@gui :_=note("- Mosaic Generation -\n\nNote: When either tile_height or tile_width is equal to 0, it will automatically create the tile ratio based on which side is smaller.") +#@gui :Tile Width=int(15,0,50) +#@gui :Tile Height=int(0,0,50) +#@gui :Dithering (%)=float(50,0,100) +#@gui :Scaling Interpolation=choice(0,"Nearest","Average","Linear","Grid","Bicubic","Lanczos") +#@gui :Palette Choice=choice(0,"Average","Median") +#@gui :Autocrop=bool(0) +#@gui :Preserve Original Dimension=bool(0) +#@gui :_=separator() +#@gui :_=note("Paint.NET Workaround") +#@gui :Workaround Mode=choice(1,"Export","Clipped-Center",Both") +#@gui :Folder=folder() +#@gui :Filename=text("mosaic.png") +#@gui :_=note("This section is only for Paint.NET users! If you don't use this this software, then you don't need use this section!") +#@gui :_=separator() +#@gui :_=note("- Information -\n\nDo not be alarmed when multiple command prompt shows up when using folder input as it is a normal process!\n\nThis filter is used for generation of mosaic pictures. Also, the mosaic cli command cannot support a number of images that is less than 3, so this gui filter will automatically use folder input option instead. So, you need at least 2 images inside a folder for the mosaic filter to work when using folder input. For more information, see below.\n\n-Software Usage -\n\nFor Krita, and GIMP: Set to input layers to All assuming 3 or more layers are in your file to create mosaic using the top image as a mosaic target.If you are using folder input instead, it is recommended to set layer input to Active.\n\nFor Paint.NET: Using 3 or more layer is unsupported due to the Paint.NET plugin restriction, so you can only use folder input. This is a workaround as G'MIC itself supports more than 2 layers.") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/5/1.") +#@gui __Deformations +#@gui Pixel Push:fx_rep_pxpush,fx_pxpush_preview(0) +#@gui :Push Point=point(50,50,0,1,255,255,255,255) +#@gui :_=separator() +#@gui :_=note("Recreation of filter from source code to TR's Pixel Push plugin for Paint.NET.Currently only Bezier option is supported until the secondary option is figured out.") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/2/26.") +#@gui Point Warp:gui_rep_pw,gui_rep_pw_preview(0) +#@gui :Point Width=float(100,0,100) +#@gui :Distance=float(100,0,100) +#@gui :Radial Influence=float(0,0,100) +#@gui :Placement of Distortion=point(50,50,0,1,128,128,128,255) +#@gui :Distortion Angle=float(0,-180,180) +#@gui :Boundary Condition=choice(3,"None","Neumann","Periodic","Mirror") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("This is a modified code of a conversion of Illab2014's Paint.NET plugin named Point Warp. The difference between this and Illab2014's filter is that this one takes into account of image size and contains boundary conditions.") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2020/2/26.") +#@gui _Rendering +#@gui Popcorn Fractal:fx_rep_pfrac,fx_rep_pfrac_preview +#@gui :_=note("Fractal attributed to Clifford Pickover. Code adapted from Paul Bourke's C code.") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Points=int(50,1,200) +#@gui :Density=float(1,.01,2) +#@gui :H Variable=float(.05,-5,5) +#@gui :K Variable=float(3,-75,75) +#@gui :Zoom=float(1,.1,10) +#@gui :Angle=float(0,-180,180) +#@gui :Origin=point(50,50,0,1,255,255,255,255) +#@gui :_=separator() +#@gui :_=note("Trigonometric") +#@gui :Mode=choice(0,"Trig-4","Trig-6") +#@gui :XY-Axis Mode?=bool(1) +#@gui :X-Axis Formula S=choice(0,"Sinusoidal","Cosinusoidal","Tangent","Arc-Tangent") +#@gui :X-Axis Formula T=choice(1,"Sinusoidal","Cosinusoidal","Tangent","Arc-Tangent") +#@gui :X-Axis Formula U=choice(2,"Sinusoidal","Cosinusoidal","Tangent","Arc-Tangent") +#@gui :Y-Axis Formula S=choice(0,"Sinusoidal","Cosinusoidal","Tangent","Arc-Tangent") +#@gui :Y-Axis Formula T=choice(1,"Sinusoidal","Cosinusoidal","Tangent","Arc-Tangent") +#@gui :Y-Axis Formula U=choice(2,"Sinusoidal","Cosinusoidal","Tangent","Arc-Tangent") +#@gui :XY-Axis Formula S=choice(0,"Sinusoidal","Cosinusoidal","Tangent","Arc-Tangent") +#@gui :XY-Axis Formula T=choice(1,"Sinusoidal","Cosinusoidal","Tangent","Arc-Tangent") +#@gui :XY-Axis Formula U=choice(2,"Sinusoidal","Cosinusoidal","Tangent","Arc-Tangent") +#@gui :_=separator() +#@gui :_=note("Output") +#@gui :Midpoint Shift=float(0,-1,1) +#@gui :Multiplier=float(1,.1,10) +#@gui :Normalize=bool(0) +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Show Fill Ratio?=bool(0) +#@gui :_=note("Fill Ratio provides information on whether there is sufficient filled pixels on canvas. The closer to 100%, the more the canvas is filled.") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/11/1.") +#@gui _Testing +#@gui Reptorian +#@gui Popcorn Fractal [Transformative]:fx_rep_pfrac_t_rs +#@gui :_=note("Generates Transformative Pickover Popcorn Fractal. Discovered by T.Gangopadhyay at XLRI in C.H.Area[E],Jamshedpur,India in 2012.\n\nThere are two style modes for Transformative Popcorn Fractal.") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :_=separator() +#@gui :Points=int(50,1,200) +#@gui :Density=float(1,.01,10) +#@gui :H Variable=float(.05,-5,5) +#@gui :K Variable=float(3,-75,75) +#@gui :Zoom=float(.5,.1,10) +#@gui :Angle=float(45,-180,180) +#@gui :Origin=point(50,50,0,1,255,255,255,255) +#@gui :Use Swirling Hall Mode?=bool(0) +#@gui :_=separator() +#@gui :_=note("Trigonometric") +#@gui :Mode=choice(0,"Trig-4","Trig-6") +#@gui :XY-Axis Mode?=bool(1) +#@gui :Expression A=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :A=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-3 - Include V?=bool(1) +#@gui :Expression B=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :B=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-3 - Include V?=bool(1) +#@gui :Expression A=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :A=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-3 - Include V?=bool(1) +#@gui :Expression B=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :B=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-3 - Include V?=bool(1) +#@gui :Expression C=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :C=choice(2,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-3 - Include V?=bool(1) +#@gui :Axis=choice(0,"X-Axis","Y-Axis") +#@gui :Expression A=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :A=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-3 - Include V?=bool(1) +#@gui :Expression B=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :B=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-3 - Include V?=bool(1) +#@gui :Expression A=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :A=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-3 - Include V?=bool(1) +#@gui :Expression B=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :B=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-3 - Include V?=bool(1) +#@gui :Expression C=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :C=choice(2,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-3 - Include V?=bool(1) +#@gui :Expression A=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :A=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-3 - Include V?=bool(1) +#@gui :Expression B=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :B=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-3 - Include V?=bool(1) +#@gui :Expression A=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :A=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :A-3 - Include V?=bool(1) +#@gui :Expression B=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :B=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :B-3 - Include V?=bool(1) +#@gui :Expression C=choice(0,"Func 1[v0]","Func 1[v0]+func 2[v1]","Func 1[func 2[v0]+include V?v]") +#@gui :C=choice(2,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-1=choice(1,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-2=choice(0,"Previous Value","Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-1=choice(0,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-2=choice(4,"Sine","Hyperbolic Sine","Cosine","Hyperbolic Cosine","Tangent","Hyperbolic Tangent") +#@gui :C-3 - Include V?=bool(1) +#@gui :_=separator() +#@gui :_=note("Shading") +#@gui :Max Value (%)=float(100,0,100) +#@gui :Mid-Point Shift=float(0,-1,1) +#@gui :Sigmoid-Shift=float(0,-100,100) +#@gui :Value Shift=float(0,-1,1) +#@gui :Multiplier=float(.5,.1,10) +#@gui :Normalize=bool(0) +#@gui :Negate?=bool(0) +#@gui Premade Palette:fx_rep_premade_palette,fx_rep_premade_palette_preview(0) : . +#@gui :_=note("This filter creates palettes. Credits are given below. ") +#@gui :_=separator() +#@gui :Palette=choice(10,"Black & White-2","Red-Green-Blue-3","Black with Red-Green-Blue-4","Black & White with Red-Green-Blue-5","Cyan-Magenta-Yellow-3","Cyan-Magenta-Yellow-Black-4","White-Cyan-Magenta-Yellow-Black-5","Red-Green-Blue with Cyan-Magenta-Yellow-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus Palette-256","PLAYPAL-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette-33","Koni32","Linear Color Palette Basic-31","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO-46","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8-11","CD-BAC-16","CG Arne-16","DinoKnight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar (Lake Water Lily)-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet Coding Language-20","Matrix-96","Material Design-96","Rainbow-88","Rainbow-96","SCRJ-XXXVI-36","Pxls Default-32","Lospec500-42","Moderna-24","Oak21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80's","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R|place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","FunkyFuture8","The Golden Wall Palette-7","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Cretaceous-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Vanilla MilkShake-16","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58 Palette","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell, Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-7","Ocean Glass-8","RoyalGuard-6","Eulbink-7","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-5","Rabbit 7","Amiga 2600 NTSC-128","Amiga 2600 PAL-104","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series - GTIA-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","Commodore 64 - Pepto-16","Commodore 64 - Colodore-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System Palette-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-244","Win 95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Piet Palette-5","Japanese Woodblock Palette-12","Human Faces-94","HSV Palette-96","ST24 Christmas","Reds-24") +#@gui :X-Position=choice(1,"Left","Middle","Right") +#@gui :Y-Position=choice(1,"Top","Middle","Bottom") +#@gui :Palette Width=int(16,1,256) +#@gui :Palette Scaling=int(12,1,32) +#@gui :Alternating Flips=bool(0) +#@gui :Palette Rotation=choice(2,"180","90","0,"-90") +#@gui :Mirror X-Axis Palette=bool(0) +#@gui :Mirror Y-Axis Palette=bool(0) +#@gui :Blend Palette to Image(s)?=bool(1) +#@gui :_=separator() +#@gui :_=note("Export") +#@gui :Output Location=folder() +#@gui :File Name=text("color_harmonies") +#@gui :Format=choice(0,"GIMP Palette - .gpl","Paint.NET Palette - .txt","JASC-PAL - .pal") +#@gui :Message=_text("Available for Export!") +#@gui :Export=button() +#@gui :Palette=choice(0,"Black & White-2","Red-Green-Blue-3","Black with Red-Green-Blue-4","Black & White with Red-Green-Blue-5","Cyan-Magenta-Yellow-3","Cyan-Magenta-Yellow-Black-4","White-Cyan-Magenta-Yellow-Black-5","Red-Green-Blue with Cyan-Magenta-Yellow-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus Palette-256","PLAYPAL-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette-33","Koni32","Linear Color Palette Basic-31","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO-46","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8-11","CD-BAC-16","CG Arne-16","DinoKnight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar (Lake Water Lily)-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet Coding Language-20","Matrix-96","Material Design-96","Rainbow-88","Rainbow-96","SCRJ-XXXVI-36","Pxls Default-32","Lospec500-42","Moderna-24","Oak21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80's","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R|place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","FunkyFuture8","The Golden Wall Palette-7","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Cretaceous-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Vanilla MilkShake-16","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58 Palette","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell, Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-7","Ocean Glass-8","RoyalGuard-6","Eulbink-7","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-5","Rabbit 7","Amiga 2600 NTSC-128","Amiga 2600 PAL-104","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series - GTIA-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","Commodore 64 - Pepto-16","Commodore 64 - Colodore-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System Palette-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-244","Win 95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Piet Palette-5","Japanese Woodblock Palette-12","Human Faces-94","HSV Palette-96","ST24 Christmas","Reds-24")_0 +#@gui :_=separator() +#@gui :_=note("Palette CLI Information\n\n Main Source of Palettes - LoSpec Palette List\n\nPalette Number -- pal number_id = pal name_id -- Full Palette Name by Author[if mentioned]\n\n1 -- +pal 0 = +pal bw -- Black & White\n2 -- +pal 1 = +pal rgb -- Red-Green-Blue\n3 -- +pal 2 = +pal b_rgb -- Black with Red-Green-Blue\n4 -- +pal 3 = +pal bw_rgb -- Black & White with Red-Green-Blue\n5 -- +pal 4 = +pal cmy -- Cyan-Magenta-Yellow\n6 -- +pal 5 = +pal cmyk -- Cyan-Magenta-Yellow-Black\n7 -- +pal 6 = +pal wcmyk -- White-Cyan-Magenta-Yellow-Black\n8 -- +pal 7 = +pal rgbcmy -- Red-Green-Blue with Cyan-Magenta-Yellow\n9 -- +pal 8 = +pal 1bitrgb -- 1-Bit RGB\n10 -- +pal 9 = +pal aurora -- Aurora by GrafxKid\n11 -- +pal 10 = +pal zenit -- Zenit-241 by Zenit40\n12 -- +pal 11 = +pal gbg -- Game Builder Garage: Texture-Sprite Editor Palette\n13 -- +pal 12 = +pal duel -- Duel by Arilyn\n14 -- +pal 13 = +pal hocuspocus -- Hocus Pocus Palette by Apogee Software,Ltd.\n15 -- +pal 14 = +pal playpal -- PLAYPAL by id Tech 1 | DOOM Engine\n16 -- +pal 15 = +pal srb2 -- Sonic Robo Blast 2\n17 -- +pal 16 = +pal uzebox -- Uzebox from Uzebox console\n18 -- +pal 17 = +pal kens16 -- Andrew Kensler - 16 by Andrew Kensler\n19 -- +pal 18 = +pal kens32 -- Andrew Kensler - 32 by Andrew Kensler\n20 -- +pal 19 = +pal kens54 -- Andrew Kensler - 54 by Andrew Kensler\n21 -- +pal 20 = +pal aap12 -- AAP-Micro 12 by Adigun A. Polack\n22 -- +pal 21 = +pal aap16 -- AAP-16 by Adigun A. Polack\n23 -- +pal 22 = +pal aap64 -- AAP-64 by Adigun A. Polack\n24 -- +pal 23 = +pal aap96 -- AAP-RadiantPLUS by Adigun A. Polack\n25 -- +pal 24 = +pal aap128 -- AAP-SPLENDOR128 by Adigun A. Polack\n26 -- +pal 25 = +pal aap_dga16 -- AAP-DGA16 by Adigun A. Polack\n27 -- +pal 26 = +pal cheerful -- Cheerful-32 by SoundsDotZip\n28 -- +pal 27 = +pal db8 -- DB8 by DawnBringer\n29 -- +pal 28 = +pal db16 -- DB16 by DawnBringer\n30 -- +pal 29 = +pal db32 -- DB32 by DawnBringer\n31 -- +pal 30 = +pal db_iso22 -- DB-ISO22 by DawnBringer\n32 -- +pal 31 = +pal dimwid17 -- DimWiddy 17 by DimWiddy\n33 -- +pal 32 = +pal dimwid23 -- DimWiddy 23 by DimWiddy\n34 -- +pal 33 = +pal edg4 -- Endesga-4 by Endesga\n35 -- +pal 34 = +pal edg8 -- Endesga-8 by Endesga\n36 -- +pal 35 = +pal edg16 -- Endesga-16 by Endesga\n37 -- +pal 36 = +pal edg32 -- Endesga-32 by Endesga\n38 -- +pal 37 = +pal edg36 -- Endesga-36 by Endesga\n39 -- +pal 38 = +pal edg64 -- Endesga-64 by Endesga\n40 -- +pal 39 = +pal famicube -- Famicube by Arne\n41 -- +pal 40 = +pal juicy32 -- Juicy-32 by Real Juice\n42 -- +pal 41 = +pal juicy56 -- Juicy-56 by Real Juice\n43 -- +pal 42 = +pal xaiue -- XAIUE-22 by xaiue\n44 -- +pal 43 = +pal 15pdx -- 15P-DX by GrafxKid\n45 -- +pal 44 = +pal 20pdx -- 20P-DX by GrafxKid\n46 -- +pal 45 = +pal 24pdx -- 24P-DX by GrafxKid\n47 -- +pal 46 = +pal cabana -- Cabana-64 by Crabby\n48 -- +pal 47 = +pal fant16 -- Fantasy 16 by Brettybooop\n49 -- +pal 48 = +pal fant24 -- Fantasy 24 by Gabriel C.\n50 -- +pal 49 = +pal tf23 -- Tranquil Fantasy 23 by windfall.apples\n51 -- +pal 50 = +pal tfp39 -- Tranquility Plus 39 by windfall.apples\n52 -- +pal 51 = +pal faraway -- Faraway 48 by Igor Ferreira.\n53 -- +pal 52 = +pal fleja -- Fleja Master Palette by Fleja\n54 -- +pal 53 = +pal koni -- Koni32 by Konic\n55 -- +pal 54 = +pal linearbasic -- Linear Color Palette Basic by GrafxKid\n56 -- +pal 55 = +pal legowiki -- LEGO colors from LEGO wiki\n57 -- +pal 56 = +pal lego2021 -- Lego Colours 2021 by Six Pies\n58 -- +pal 57 = +pal vinelinear -- Vines Flexible Linear Ramps by Vine 2D\n59 -- +pal 58 = +pal arcade -- Arcade Standard 29 by GrafxKid\n60 -- +pal 59 = +pal arq -- ARQ16 by Endesga\n61 -- +pal 60 = +pal atom -- Atom-8 by polyphrog\n62 -- +pal 61 = +pal blk36 -- BLK 36 by BlackedIRL.\n63 -- +pal 62 = +pal blkneo -- BLK-NEO by BlackedIRL.\n64 -- +pal 63 = +pal brokefac -- Broken Facility by telepathic-melon\n65 -- +pal 64 = +pal bubblegum -- Bubblegum-16 by PineTreePizza\n66 -- +pal 65 = +pal cpcboy -- CPC BOY by Arne Niklas Jansson\n67 -- +pal 66 = +pal cade -- Cade 15 by MonstersGoBoom\n68 -- +pal 67 = +pal calder -- Calder 8 by Philip Dodderige\n69 -- +pal 68 = +pal cdbac -- CD-BAC by DimWiddy\n70 -- +pal 69 = +pal cgarne -- CG Arne by Arne Niklas Jansson\n71 -- +pal 70 = +pal dinoknight -- DinoKnight 16 by Retrospec\n72 -- +pal 71 = +pal 4l -- ||||-22 by ||||\n73 -- +pal 72 = +pal fzt -- FZT Ethereal 16 by Fusionnist\n74 -- +pal 73 = +pal indecision -- Indecision by Nelson SMG\n75 -- +pal 74 = +pal island -- Island Joy 16 by Kerrie Lake\n76 -- +pal 75 = +pal journey -- Journey by PineTreePizza\n77 -- +pal 76 = +pal shallowmarsh -- Shallowmarsh26 by archer\n78 -- +pal 77 = +pal lago_nenufar -- Lago Nenufar (Lake Water Lily) by Popxel Art\n79 -- +pal 78 = +pal juicy -- Juicy 17 by JerryPie\n80 -- +pal 79 = +pal chocolateganache -- ChocolateGanache by Ladybug\n81 -- +pal 80 = +pal brightwinter1 -- Bright Winter 1 by Nai\n82 -- +pal 81 = +pal brightwinter2 -- Bright Winter 2 by Nai\n83 -- +pal 82 = +pal kawaii -- Kawaii16 by Arisuki\n84 -- +pal 83 = +pal xdb -- 0xdb-01 by 0xDB\n85 -- +pal 84 = +pal gzxp -- GZXP by GrafxKid\n86 -- +pal 85 = +pal chromatic -- Chromatic16 by DragonDePlatino\n87 -- +pal 86 = +pal piet_code -- Piet Coding Language\n88 -- +pal 87 = +pal boltbait_matrix -- Matrix by BoltBait\n89 -- +pal 88 = +pal material_design -- Material Design by Ruchir L. Sharma\n90 -- +pal 89 = +pal thehamster_rainbow -- Rainbow by thehamster\n91 -- +pal 90 = +pal boltbait_rainbow -- Rainbow by BoltBait\n92 -- +pal 91 = +pal scrj -- SCRJ-XXXVI by StudioCRJ\n93 -- +pal 92 = +pal pxls -- Pxls Default from pxls.space\n94 -- +pal 93 = +pal lospec -- Lospec500 by the Lospec community\n95 -- +pal 94 = +pal moderna -- Moderna by yedamameday\n96 -- +pal 95 = +pal oak -- Oak21 by Dan Oak\n97 -- +pal 96 = +pal nature -- Nature's Embrace 55 by GrafxKid\n98 -- +pal 97 = +pal rbypgo -- RBYPGO by Marilynx\n99 -- +pal 98 = +pal new_worlds -- New Worlds 46 by Count Moriarty\n100 -- +pal 99 = +pal nauris -- Nauris-16 by Nauris\n101 -- +pal 100 = +pal dynamite -- Dynamite by Pixi\n102 -- +pal 101 = +pal interstate -- Interstate 28 by maine\n103 -- +pal 102 = +pal downgraded -- Downgraded 32 by daniel\n104 -- +pal 103 = +pal pear -- Pear 36 by PineTreePizza\n105 -- +pal 104 = +pal pineapple -- Pineapple 32 by PineTreePizza\n106 -- +pal 105 = +pal peachy -- Peachy Pop 16 by Kerrie Lake\n107 -- +pal 106 = +pal resurrect -- Resurrect 32 by Kerrie Lake\n108 -- +pal 107 = +pal rosy42 -- Rosy 42 by PineTreePizza\n109 -- +pal 108 = +pal slso -- SLSO-CLR17 by Luis Miguel Maldonado\n110 -- +pal 109 = +pal softy -- Softy 15 by Eggy\n111 -- +pal 110 = +pal spec -- SPEC12 by Smalls\n112 -- +pal 111 = +pal roarin80s -- The Roarin 80's by Malo\n113 -- +pal 112 = +pal starmancer -- Starmancer by Ominux Games\n114 -- +pal 113 = +pal superfuture -- SuperFuture25 by Endesga\n115 -- +pal 114 = +pal sunshine -- SUNSHINE 35 by mysunnyrose\n116 -- +pal 115 = +pal sweetie -- Sweetie 16 by GrafxKid\n117 -- +pal 116 = +pal calm -- Calm 48 by Xina\n118 -- +pal 117 = +pal optimism -- Optimism by mingapur\n119 -- +pal 118 = +pal taffy -- Taffy 16 by PineTreePizza\n120 -- +pal 119 = +pal todayland -- Todayland Palette V2 by GrafxKid\n121 -- +pal 120 = +pal trirampo -- TriRampo by ANoob\n122 -- +pal 121 = +pal reddit_place_2022 -- r|place 2022\n123 -- +pal 122 = +pal tropical -- Tropical Cone 24 by yedamameday\n124 -- +pal 123 = +pal vivid -- Vivid-17 by Irenaart\n125 -- +pal 124 = +pal shido -- SHIDO50+ by Shidoengie\n126 -- +pal 125 = +pal intacto -- Intacto14 by Anoob\n127 -- +pal 126 = +pal itatsi -- Itatsi by SoundsDotZip\n128 -- +pal 127 = +pal enos -- ENOS16 by Endesga\n129 -- +pal 128 = +pal grixel -- Grixel Grotto by Northernite\n130 -- +pal 129 = +pal superb -- Superb 8 by BigPotato\n131 -- +pal 130 = +pal undertones -- Undertones-17 by Irenaart\n132 -- +pal 131 = +pal tango -- Tango by Duck\n133 -- +pal 132 = +pal cheese -- Cheese Palette by Gors\n134 -- +pal 133 = +pal equpix15 -- Equpix 15 by Night\n135 -- +pal 134 = +pal zughy -- Zughy 32 by Zughy\n136 -- +pal 135 = +pal voodo -- Voodo34 by Shamaboy\n137 -- +pal 136 = +pal franzston -- Franzston 30 by Virus610\n138 -- +pal 137 = +pal night -- Night 16 by Night\n139 -- +pal 138 = +pal star29 -- Star 29 by Starlane\n140 -- +pal 139 = +pal star34 -- Star 34 by Starlane\n141 -- +pal 140 = +pal still_life -- Still-Life by cure\n142 -- +pal 141 = +pal simjpc -- SimpleJPC-16 by Adigun A. Polack\n143 -- +pal 142 = +pal acid -- Acid 15 by pyrometal\n144 -- +pal 143 = +pal battery -- Battery 24 by Battery Jellyfish\n145 -- +pal 144 = +pal clump -- Clumpy 18 by windfall.apples\n146 -- +pal 145 = +pal cthul -- Cthulhu by Starlane\n147 -- +pal 146 = +pal crimso11 -- Crimso 11 by Crimso\n148 -- +pal 147 = +pal coptec -- Copper-Tech by Arne Niklas Jansson\n149 -- +pal 148 = +pal drz -- DRZ15A by Drazille\n150 -- +pal 149 = +pal eggy -- Eggy 15 by Eggy\n151 -- +pal 150 = +pal europa -- Europa 16 by Starlane\n152 -- +pal 151 = +pal greyt -- GreyT-bit by Sam Keddy\n153 -- +pal 152 = +pal jewel -- Jewel by AprilSundae\n154 -- +pal 153 = +pal polar -- Polar 11 by Smalls\n155 -- +pal 154 = +pal sheltzy -- Sheltzy 32 by NatTorpedia\n156 -- +pal 155 = +pal wyrm -- Wyrm 24 by FrogWyrm\n157 -- +pal 156 = +pal yume_nikki -- Yume Nikki by Space Sandwich\n158 -- +pal 157 = +pal rube_goldberg -- Rube-Goldberg\n159 -- +pal 158 = +pal boomboom -- BoomBoom by Salman_Shh\n160 -- +pal 159 = +pal g8 -- Generic-8 by GrafxKid\n161 -- +pal 160 = +pal crayola -- Crayola Blind\n162 -- +pal 161 = +pal funky -- FunkyFuture8 by ShamaBoy\n163 -- +pal 162 = +pal golden_wall -- The Golden Wall Palette by Hans Hofmann\n164 -- +pal 163 = +pal matriax -- Matriax8c by Davit Masia\n165 -- +pal 164 = +pal nt1h -- NT1H by NatTorpedia\n166 -- +pal 165 = +pal jerrypie -- JerryPie 22 by JerryPie\n167 -- +pal 166 = +pal nineties_nine -- Nineties Nine by Cubby Crazes\n168 -- +pal 167 = +pal on70 -- On70 by By8Bits\n169 -- +pal 168 = +pal anb -- ANB16 by Anoob\n170 -- +pal 169 = +pal retrocal -- Retrocal-8 by polyphrog\n171 -- +pal 170 = +pal punolit -- Punolit by Punoli\n172 -- +pal 171 = +pal luap -- Luap 40 by Luap\n173 -- +pal 172 = +pal autum_villan -- Autum Villan 6 by Chase Stemel\n174 -- +pal 173 = +pal au15 -- Autum 15 by jok\n175 -- +pal 174 = +pal au15y -- Autum 15 [Yellow] by jok\n176 -- +pal 175 = +pal galaxy_flame -- Galaxy Flame by Rhoq\n177 -- +pal 176 = +pal cretaceous -- Cretaceous-16 by Joao Vasconcelos\n178 -- +pal 177 = +pal antiquity -- Antiquity16 by ILTA\n179 -- +pal 178 = +pal mushroom -- Mushroom by Jimison3\n180 -- +pal 179 = +pal aerugo -- Aerugo by Lizalot\n181 -- +pal 180 = +pal hotel_paintings -- Hotel Paintings 6 by Chase Stemel\n182 -- +pal 181 = +pal nopal -- Nopal-12 by BlackedIRL.\n183 -- +pal 182 = +pal gpy -- Brightness GPY by rickthepalette\n184 -- +pal 183 = +pal blessing -- Blessing by Maruki\n185 -- +pal 184 = +pal fairydust -- Fairydust 8 by Yousurname\n186 -- +pal 185 = +pal milkshake -- Vanilla MilkShake by Space Sandwich\n187 -- +pal 186 = +pal fuzz -- Fuzzy Four by P-Tux7\n188 -- +pal 187 = +pal fairy -- Fairy Tales by lollige\n189 -- +pal 188 = +pal naji -- Naji 16 by Naji\n190 -- +pal 189 = +pal easter -- Easter Island by skamocore\n191 -- +pal 190 = +pal pastel_and_darks -- Pastel and Darks 58 Palette by Glxss\n192 -- +pal 191 = +pal pastel_irena -- 17 Pastels by Irenaart\n193 -- +pal 192 = +pal nostalgia -- NOSTALGIA15 by Arisuki\n194 -- +pal 193 = +pal ocaso -- Ocaso by Minord\n195 -- +pal 194 = +pal pastel_starlitsunset -- Oh Hell, Pastel by StarlitSunset\n196 -- +pal 195 = +pal pollen -- Pollen-8 by Conker\n197 -- +pal 196 = +pal kule -- KULE-16 by Cuymacu\n198 -- +pal 197 = +pal hydrangea -- Hydrangea 11 by Dinchen's Art\n199 -- +pal 198 = +pal fluffy -- Fluffy8 by vee\n200 -- +pal 199 = +pal st8rb -- ST 8 R&B Remake by Skiller Thomson\n201 -- +pal 200 = +pal neon -- Neon Space by Jimison3\n202 -- +pal 201 = +pal cyclope -- Cyclope6 by Royal_Naym\n203 -- +pal 202 = +pal sy -- Sy17 by xaiue\n204 -- +pal 203 = +pal syz -- Syz15 by Fusionnist\n205 -- +pal 204 = +pal tui -- TUI-15 by Jeremy\n206 -- +pal 205 = +pal cave -- Cave by PineTreePizza\n207 -- +pal 206 = +pal psygnosia -- Psygnosia by Arne Niklas Jansson\n208 -- +pal 207 = +pal marshmellow -- MarshMellow32 by FormalPrejudice\n209 -- +pal 208 = +pal lost_century -- Lost Century 24 by CalmRadish\n210 -- +pal 209 = +pal finlal -- Finlal 11 by Finlal\n211 -- +pal 210 = +pal industrial -- Industrial Factory 16 by Toby_Yasha\n212 -- +pal 211 = +pal murder_mystery -- Murder Mystery 16 by Toby_Yasha\n213 -- +pal 212 = +pal fate_and_destiny -- Fate & Destiny 12 by Toby_Yasha\n214 -- +pal 213 = +pal vinik -- Vinik 24 by Vinik\n215 -- +pal 214 = +pal ykb -- YKB-22 by yahkehbu\n216 -- +pal 215 = +pal halloween -- Halloween by Mememellow\n217 -- +pal 216 = +pal graveyard -- Graveyard-21 by AprilSundae\n218 -- +pal 217 = +pal steamlords -- Steam Lords by Slynyrd\n219 -- +pal 218 = +pal frostical -- Frostical by yedamameday\n220 -- +pal 219 = +pal deuterospill -- DeuteroSpill by Royal_Naym\n221 -- +pal 220 = +pal cool_bone -- Cool Bone 7 by Chase Stemel\n222 -- +pal 221 = +pal muted_ally -- Muted Ally 6 by Chase Stemel\n223 -- +pal 222 = +pal ephemera -- EPHEMERA by K C\n224 -- +pal 223 = +pal ink -- Ink by AprilSundae\n225 -- +pal 224 = +pal violet_dreams -- Violet Dreams by Solitaire\n226 -- +pal 225 = +pal tinyfolks -- Tinyfolks by Pierr Vandermaesan\n227 -- +pal 226 = +pal old_gold -- Old Gold 7 by Chase Stemel\n228 -- +pal 227 = +pal rosemoss -- Rosemoss-8 by polyphrog\n229 -- +pal 228 = +pal aaprad -- AAP-RadiantXV by Adigun A. Polack\n230 -- +pal 229 = +pal aapmaj -- AAP-Majesty XVII by Adigun A. Polack\n231 -- +pal 230 = +pal dead_weight -- Dead Weight-8 by polyphrog\n232 -- +pal 231 = +pal mojave -- Mojave20 by magodellepercussioni\n233 -- +pal 232 = +pal pet8 -- Petite-8 by Adigun A. Polack\n234 -- +pal 233 = +pal pet8d -- Petite-8 Afterdark by Adigun A. Polack\n235 -- +pal 234 = +pal xaiue_rad -- XAIUE-Radiant by xaiue\n236 -- +pal 235 = +pal daruda -- Daruda 22 by daruda\n237 -- +pal 236 = +pal firestorm -- Firestorm by theartistjulian\n238 -- +pal 237 = +pal borkfest -- Borkfest by まるき\n239 -- +pal 238 = +pal spicy -- Spicy 07 by green guy\n240 -- +pal 239 = +pal rust -- Rust-6 by Blue Phoenix\n241 -- +pal 240 = +pal apricot -- Apricot by Chase Stemel\n242 -- +pal 241 = +pal supernova -- SuperNova 7 by Blue Phoenix\n243 -- +pal 242 = +pal pastry -- Pastry by MirruTatep\n244 -- +pal 243 = +pal sandy -- Sandy 06 by green guy\n245 -- +pal 244 = +pal illumination -- Illumination by MirruTatep\n246 -- +pal 245 = +pal nyx -- NYX8 by Javier Guerrero\n247 -- +pal 246 = +pal dreamhaze -- Dream Haze 8 by Klafooty\n248 -- +pal 247 = +pal oil -- OIL6 by GrafxKid\n249 -- +pal 248 = +pal regal -- Regal10 by JRiggles\n250 -- +pal 249 = +pal softdemon -- Soft Demon 7 by Chase Stemel\n251 -- +pal 250 = +pal sgm -- SGM-Palette 2 by s.g.m\n252 -- +pal 251 = +pal midnight_ablaze -- Midnight ablaze by Inkpendude\n253 -- +pal 252 = +pal black_cherry -- Black Cherry by MirruTatep\n254 -- +pal 253 = +pal sunset_red -- Sunset Red by Cabezinu\n255 -- +pal 254 = +pal inkpink -- INKPINK by Inkpendude\n256 -- +pal 255 = +pal brash_pink -- Brash Pink by ItzFred\n257 -- +pal 256 = +pal pink_neon_sign -- Pink Neon Sign 6 by Chase Stemel\n258 -- +pal 257 = +pal enchanted_purple -- Enchanted Purple by Kaiburn\n259 -- +pal 258 = +pal arch -- Arch by Poltergasm\n260 -- +pal 259 = +pal spaceyeaster -- Spacey Easter by Spark Norris\n261 -- +pal 260 = +pal fornaxvoid1 -- Fornax Void I by Fornax Void\n262 -- +pal 261 = +pal fornaxvoid2 -- Fornax Void II by Fornax Void\n263 -- +pal 262 = +pal pixelwave -- Pixelwave by Reptorian\n264 -- +pal 263 = +pal s1 -- S1-6 by Blyzz\n265 -- +pal 264 = +pal berry_nebula -- Berry Nebula by LostInIndigo\n266 -- +pal 265 = +pal abyss -- ABYSS-9 by Jusiv\n267 -- +pal 266 = +pal moonlight -- Moonlight 15 by Tofu\n268 -- +pal 267 = +pal moon39 -- Moonlit-39 by theartistjulian\n269 -- +pal 268 = +pal h2o -- H2O by maine\n270 -- +pal 269 = +pal magic_waters -- Magic Waters 9 by Chase Stemel\n271 -- +pal 270 = +pal bluemold -- Bluem0ld by warpixel\n272 -- +pal 271 = +pal moss -- Moss by Zetomis\n273 -- +pal 272 = +pal deep_maze -- DEEP MAZE by Ryosuke\n274 -- +pal 273 = +pal toxic_slime -- Toxic Slime by MirruTatep\n275 -- +pal 274 = +pal lush_green -- Lush Green by EerieJam\n276 -- +pal 275 = +pal tsunami -- Tsunami by MirruTatep\n277 -- +pal 276 = +pal cryptic_ocean -- Cryptic Ocean by Klafooty\n278 -- +pal 277 = +pal marsh_madness -- Marsh Madness by MirruTatep\n279 -- +pal 278 = +pal oxyd -- OXYD by ItzFred\n280 -- +pal 279 = +pal pinkgreen -- Pink&Green by q1\n281 -- +pal 280 = +pal woodwalk -- Walking in the Woods 8 by Chase Stemel\n282 -- +pal 281 = +pal paper -- Paper 8 by Frosty Rabbid\n283 -- +pal 282 = +pal sahara_pastell -- Sahara Pastell by wermz\n284 -- +pal 283 = +pal sunflower -- Sunflower Painting 7 by Chase Stemel\n285 -- +pal 284 = +pal arthoe -- Art Hoe Aesthetic 7 by Chase Stemel\n286 -- +pal 285 = +pal sky -- Sky5 by MiniTe\n287 -- +pal 286 = +pal ocean_glass -- Ocean Glass by Solitaire\n288 -- +pal 287 = +pal royal -- RoyalGuard by Royal_Naym\n289 -- +pal 288 = +pal eulbink -- Eulbink by Inkpendude\n290 -- +pal 289 = +pal winter_wonderland -- Winter Wonderland by Jimison3\n291 -- +pal 290 = +pal moon_squid -- Moon Squid 7 by Chase Stemel\n292 -- +pal 291 = +pal stratus -- Stratus by MirruTatep\n293 -- +pal 292 = +pal arctic_dust -- Arctic Dust by MirruTatep\n294 -- +pal 293 = +pal clouds_sunset -- CL8UDS by _Nicola \n295 -- +pal 294 = +pal lilac_skies -- Lilac Skies 5 by Chase Stemel\n296 -- +pal 295 = +pal sea_of_fire -- Sea of Fire by TATA-PIXEL\n297 -- +pal 296 = +pal autochrome3 -- Autochrome 3 by Reptorian\n298 -- +pal 297 = +pal autochrome5 -- Autochrome 5 by Reptorian\n299 -- +pal 298 = +pal gb_d_1 -- GB Default 1\n300 -- +pal 299 = +pal gb_d_2 -- GB Default 2\n301 -- +pal 300 = +pal gb_andrade -- GB Andrade by Andrade\n302 -- +pal 301 = +pal gb_blue -- GB Blue Seni by WildLeoKnight\n303 -- +pal 302 = +pal gb_bz -- GB Blackzone\n304 -- +pal 303 = +pal gb_suburb -- GB Suburb by Poppysalmon\n305 -- +pal 304 = +pal gb_crimson -- GB Crimson by WildLeoKnight\n306 -- +pal 305 = +pal gb_didi -- GB Didi by DidiGameboy\n307 -- +pal 306 = +pal gb_dirty -- GB Dirty by WildLeoKnight\n308 -- +pal 307 = +pal gb_arne -- GB Arne by Arne\n309 -- +pal 308 = +pal gb_easy -- GB Easy by GrafxKid\n310 -- +pal 309 = +pal gb_forest -- GB Forest\n311 -- +pal 310 = +pal gb_hg -- GB Harsh Green by WildLeoKnight\n312 -- +pal 311 = +pal gb_lg -- GB Light Green by WildLeoKnight\n313 -- +pal 312 = +pal gb_nostalgia -- GB Nostalgia by WildLeoKnight\n314 -- +pal 313 = +pal gb_platinum -- GB Platinum by WildLeoKnight\n315 -- +pal 314 = +pal gb_kirokaze -- GB Kirokaze by Kirokaze\n316 -- +pal 315 = +pal gb_cyber -- GB Cyber\n317 -- +pal 316 = +pal gb_wish -- GB Wish by Kerrie Lake\n318 -- +pal 317 = +pal gb_grapefruit -- GB Grapefruit by GrafxKid\n319 -- +pal 318 = +pal gb_ice_cream -- GB Ice Cream by Kerrie Lake\n320 -- +pal 319 = +pal gb_rb -- GB Red_Blue\n321 -- +pal 320 = +pal gb_gold -- Gold GB by Isa\n322 -- +pal 321 = +pal gb_choco -- GB Chocolate by GrafxKid\n323 -- +pal 322 = +pal gb_gray -- GB Gray by GrafxKid\n324 -- +pal 323 = +pal gb_space -- GB Spacehaze by WildLeoKnight\n325 -- +pal 324 = +pal gb_purpdawn -- GB Purple Dawn by WildLeoKnight\n326 -- +pal 325 = +pal moon_crystal -- Moon Crystal by Doph\n327 -- +pal 326 = +pal arne -- ARNE4 by Arne\n328 -- +pal 327 = +pal autumn_chill -- Autumn Chill by Doph\n329 -- +pal 328 = +pal cherrymelon -- CherryMelon by WildLeoKnight\n330 -- +pal 329 = +pal hal4 -- HallowPumpkin by WildLeoKnight\n331 -- +pal 330 = +pal hollow -- Hollow by Poltergasm\n332 -- +pal 331 = +pal lavender -- Lavender4 by Solitaire\n333 -- +pal 332 = +pal maw -- MAW by bloo\n334 -- +pal 333 = +pal voltage_warning -- Voltage Warning by Wuchta\n335 -- +pal 334 = +pal tritanopia -- Tritanopia by Allappini\n336 -- +pal 335 = +pal rabbit -- Rabbit 7 by GrafxKid\n337 -- +pal 336 = +pal amiga2600ntsc -- Amiga 2600 NTSC\n338 -- +pal 337 = +pal amiga2600pal -- Amiga 2600 PAL\n339 -- +pal 338 = +pal amiga2600secam -- Amiga 2600 SECAM\n340 -- +pal 339 = +pal amiga7800mess -- Amiga 7800 M.E.S.S by Nabuko78\n341 -- +pal 340 = +pal amiga7800 -- Amiga 7800\n342 -- +pal 341 = +pal amstrad_cpc -- Amstrad CPC\n343 -- +pal 342 = +pal apple -- Apple II\n344 -- +pal 343 = +pal atari -- Atari 8-Bit Series - GTIA by PixelCrunch\n345 -- +pal 344 = +pal cga -- CGA\n346 -- +pal 345 = +pal cga00 -- CGA Mode 0 [Low]\n347 -- +pal 346 = +pal cga01 -- CGA Mode 0 [High]\n348 -- +pal 347 = +pal cga10 -- CGA Mode 1 [Low]\n349 -- +pal 348 = +pal cga11 -- CGA Mode 1 [High]\n350 -- +pal 349 = +pal cga20 -- CGA Mode 2 [Low]\n351 -- +pal 350 = +pal cga21 -- CGA Mode 2 [High]\n352 -- +pal 351 = +pal c64_pepto -- Commodore 64 - Pepto\n353 -- +pal 352 = +pal c64_colodore -- Commodore 64 - Colodore\n354 -- +pal 353 = +pal com_vic_20 -- Commodore VIC-20\n355 -- +pal 354 = +pal colecovision -- Colecovision\n356 -- +pal 355 = +pal jmp -- Japanese Machine Palette by Arne Niklas Jansson\n357 -- +pal 356 = +pal mac2 -- Macintosh II\n358 -- +pal 357 = +pal mac8 -- Macintosh 8-Bit System Palette\n359 -- +pal 358 = +pal msx -- MSX\n360 -- +pal 359 = +pal nes -- NES\n361 -- +pal 360 = +pal pico -- PICO-8 by Lexaloffle Games\n362 -- +pal 361 = +pal risc -- RISC OS\n363 -- +pal 362 = +pal samcoupe -- SAM Coupe\n364 -- +pal 363 = +pal mo5 -- Thomson MO5\n365 -- +pal 364 = +pal trs80 -- TRS-80 Color Computer Palette\n366 -- +pal 365 = +pal virtualboy -- Virtual Boy interpreted by Bruno Weinberger\n367 -- +pal 366 = +pal vga -- VGA\n368 -- +pal 367 = +pal win95 -- Win 95\n369 -- +pal 368 = +pal zx -- ZX Spectrum\n370 -- +pal 369 = +pal gnome -- GNOME 32\n371 -- +pal 370 = +pal elc -- Electronic Crayon 22\n372 -- +pal 371 = +pal chip16 -- Chip16\n373 -- +pal 372 = +pal deluxepaint -- Deluxe Paint\n374 -- +pal 373 = +pal flat -- FlatUI from flat ui colors website\n375 -- +pal 374 = +pal makecode -- MakeCode Arcade Palette\n376 -- +pal 375 = +pal oekaki -- Oekaki from Oekaki.nl\n377 -- +pal 376 = +pal lms -- Legacy Paint\n378 -- +pal 377 = +pal msxp -- XP Paint\n379 -- +pal 378 = +pal vista -- Vista Paint\n380 -- +pal 379 = +pal piet -- Piet Palette by Piet Mondrain\n381 -- +pal 380 = +pal japwood -- Japanese Woodblock Palette by Polyducks\n382 -- +pal 381 = +pal humanfaces -- Human Faces by Romney57\n383 -- +pal 382 = +pal hues -- HSV Palette by MadJik\n384 -- +pal 383 = +pal christmas -- ST24 Christmas by Skiller Thomson\n385 -- +pal 384 = +pal ladybugreds -- Reds by Ladybug") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2023/9/11.") +#@gui Prime Surface:gui_rep_prime_surface +#@gui :Negate Direction?=bool(0) +#@gui :Mirror Direction=choice(0,"None","X","Y") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2020/2/26.") +#@gui __Rendering +#@gui Pseudorandom Noise:fx_rep_mj_prn,fx_rep_mj_prn_preview +#@gui :_=note("Generates pseudorandom noise.\n\nBased off MadJik's Regular Noise Paint.NET Plugin. This is a extended version. Preview may not be accurate!") +#@gui :_=separator() +#@gui :_=note("Preliminary") +#@gui :K-1=float(8,-8,8) +#@gui :K-2=float(2,-8,8) +#@gui :K Mode=choice(0,"Mode 0","Mode 1") +#@gui :Shift=float(1,-256,256) +#@gui :_=separator() +#@gui :_=note("Non-K Factors") +#@gui :Color Angle=float(0,-180,180) +#@gui :Pixel Size=int(1,1,16) +#@gui :Position=point(50,50,0,1,128,128,128,255) +#@gui :Formula=choice(1,"Gray","Sinusoidal","RGB","Tangent") +#@gui :Double Pixel Axis?=bool(0) +#@gui :_=separator() +#@gui :_=note("Grid") +#@gui :Activate Grid?=bool(0) +#@gui :Shade=float(0,0,255) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/1/17.") +#@gui _Testing +#@gui Reptorian +#@gui Rainbowify:fx_rep_rainbowify,fx_rep_rainbowify_preview(0) +#@gui :_=note("Apply rainbowify effect into image. Inspired by Rainbowify effect made by Jonathan Frech.") +#@gui :_=separator() +#@gui :Hue Shift=float(0,-180,180) +#@gui :Gradient Angle=float(0,-180,180) +#@gui :Gradient Scale(%)=float(100,50,200) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/7/26.") +#@gui Random Gradient Bars:fx_rep_randgradbar,fx_rep_randgradbar_preview +#@gui :_=note("Create Random Gradient Bar.\n\nNote - Preview is only for giving a idea.") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Seed=int(0,0,100000) +#@gui :Bar Size - Quarter Image-Diagonal(%)=float(2,0,100) +#@gui :Space Size - Quarter Image-Diagonal(%)=float(0,0,100) +#@gui :Angle=float(0,-180,180) +#@gui :Skew Angle=float(0,-89,89) +#@gui :Origin=point(50,50,0,1,255,255,255,255) +#@gui :Subsampling=float(1,0,3) +#@gui :_=separator() +#@gui :_=note("Gradient Transformation") +#@gui :Shift=float(0,0,100) +#@gui :Multiplier A=float(1,.1,250) +#@gui :Multiplier B=float(100,.1,250) +#@gui :_=separator() +#@gui :_=note("Gradient Modulo") +#@gui :Repetition=choice(0,"Random","Cut","Periodic","Continuous") +#@gui :Random Bar Repetition=choice(0,"All","Cut and Periodic","Cut and Continuous","Periodic and Continuous") +#@gui :Space Mode=choice(0,"Alpha","Cut","Gradient") +#@gui :Symmetry Mode=choice(0,"None","Symmetry A","Symmetry B") +#@gui :Inversion Mode=choice(0,"None","Random-Inversion","Full-Inversion") +#@gui :_=separator() +#@gui :_=note("Color") +#@gui :Output Color=choice(0,"Grayscale","Duotone","RGB - Random Bars","HSV - Random Bars") +#@gui :Space Color A=color(#ff007f) +#@gui :Space Color B=color(#f9d72d) +#@gui :_=separator() +#@gui :_=note("Animation") +#@gui :Shift=float(0,-5,5)_0 +#@gui :Multiplier A=float(1,.1,250)_0 +#@gui :Multiplier B=float(100,.1,250)_0 +#@gui :_=note("Under Development!") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2021/5/24.") +#@gui Random Rectangle Division:fx_rep_rrd,fx_rep_rrd +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Division=int(10,1,20) +#@gui :Additional Thickness=int(5,0,100) +#@gui :Maximum Division Iteration=int(5,2,40) +#@gui :Probability of Division(%)=float(95,20,100) +#@gui :Loop Limit=int(50000,1000,2097152) +#@gui :Seed=int(0,0,300) +#@gui :Border(%)=float(35,0,100) +#@gui :_=separator() +#@gui :_=note("Color") +#@gui :Mode=choice(0,"Grayscale","Palette","Random") +#@gui :Normalize?=bool(1) +#@gui :Palette=choice(12,"Black & White-2","Red-Green-Blue-3","Black with Red-Green-Blue-4","Black & White with Red-Green-Blue-5","Cyan-Magenta-Yellow-3","Cyan-Magenta-Yellow-Black-4","White-Cyan-Magenta-Yellow-Black-5","Red-Green-Blue with Cyan-Magenta-Yellow-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus Palette-256","PLAYPAL-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette-33","Koni32","Linear Color Palette Basic-31","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO-46","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8-11","CD-BAC-16","CG Arne-16","DinoKnight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar (Lake Water Lily)-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet Coding Language-20","Matrix-96","Material Design-96","Rainbow-88","Rainbow-96","SCRJ-XXXVI-36","Pxls Default-32","Lospec500-42","Moderna-24","Oak21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80's","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R|place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","FunkyFuture8","The Golden Wall Palette-7","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Cretaceous-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Vanilla MilkShake-16","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58 Palette","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell, Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-7","Ocean Glass-8","RoyalGuard-6","Eulbink-7","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-5","Rabbit 7","Amiga 2600 NTSC-128","Amiga 2600 PAL-104","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series - GTIA-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","Commodore 64 - Pepto-16","Commodore 64 - Colodore-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System Palette-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-244","Win 95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Piet Palette-5","Japanese Woodblock Palette-12","Human Faces-94","HSV Palette-96","ST24 Christmas","Reds-24") +#@gui :Color Space=choice(0,"RGB","HSV") +#@gui :Number of Color=int(0,0,100) +#@gui :Seed=int(0,0,100000) +#@gui :Border=color(#000000) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2023/9/11.") +#@gui Rectangle-Square Fill:fx_rep_rand_sqrrecfill,fx_rep_rand_sqrrecfill +#@gui :_=note("Main") +#@gui :1.Palette=choice(0,"None","Red-Green-Blue-3","Black with Red-Green-Blue-4","Black & White with Red-Green-Blue-5","Cyan-Magenta-Yellow-3","Cyan-Magenta-Yellow-Black-4","White-Cyan-Magenta-Yellow-Black-5","Red-Green-Blue with Cyan-Magenta-Yellow-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus Palette-256","PLAYPAL-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette-33","Koni32","Linear Color Palette Basic-31","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO-46","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8-11","CD-BAC-16","CG Arne-16","DinoKnight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar (Lake Water Lily)-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet Coding Language-20","Matrix-96","Material Design-96","Rainbow-88","Rainbow-96","SCRJ-XXXVI-36","Pxls Default-32","Lospec500-42","Moderna-24","Oak21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80's","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R|place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","FunkyFuture8","The Golden Wall Palette-7","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Cretaceous-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Vanilla MilkShake-16","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58 Palette","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell, Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-7","Ocean Glass-8","RoyalGuard-6","Eulbink-7","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-5","Rabbit 7","Amiga 2600 NTSC-128","Amiga 2600 PAL-104","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series - GTIA-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","Commodore 64 - Pepto-16","Commodore 64 - Colodore-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System Palette-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-244","Win 95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Piet Palette-5","Japanese Woodblock Palette-12","Human Faces-94","HSV Palette-96","ST24 Christmas","Reds-24") +#@gui :2.Use Random Color Instead?=bool(0) +#@gui :3.Square Size=int(15,2,150) +#@gui :4.Max Primary Dimension of Rectangle=int(2,1,10) +#@gui :5.Max Secondary Dimension of Rectangle=int(1,1,10) +#@gui :6.Frequency of Rectangle=float(1,0,1) +#@gui :7.Line Erosion=int(0,-15,15) +#@gui :8.Line Output=bool(1) +#@gui :9.Reduce Non-Rectangular Shape=bool(1) +#@gui :10.Remove Black from Palette?=bool(1) +#@gui :Seed=int(0,0,50000) +#@gui :Colour Space=choice(0,"RGB-8","RYB-8","HSI-8","HSL-8","HSV-8","LAB-8","LCH-8","YIQ-8","YUV-8") +#@gui :_=separator() +#@gui :_=note("Extra") +#@gui :Output Mode=choice(0,"Clipped","Enlarged","Shrinked") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2023/9/11.") +#@gui Red Acrylic Plastic Filter:fx_rep_red_acrylic_filter,fx_rep_red_acrylic_filter_preview(1) : + +#@gui :_=note("This generates image in which you use red acrylic plastic cover in order to reveal a image.\n\nThis filter require multiple images.") +#@gui :_=separator() +#@gui :_=note("Initial") +#@gui :Use Imported Image?=bool(0) +#@gui :Image Location=file() +#@gui :Use Reference Layer=bool(0) +#@gui :Reference Layer=choice(0,"Top","Bottom") +#@gui :_=separator() +#@gui :_=note("Effect") +#@gui :Luminosity Blend=float(0,0,100) +#@gui :Green Cut Point=float(0,0,100) +#@gui :Green Visibility=float(100,0,100) +#@gui :Use Imported Image?=bool(0)_0 +#@gui :Image Location=file()_0 +#@gui :Use Reference Layer=bool(0)_0 +#@gui :Reference Layer=choice(0,"Top","Bottom")_0 +#@gui :Luminosity Blend=float(0,0,100)_0 +#@gui :Green Cut Point=float(0,0,100)_0 +#@gui :Green Visibility=float(100,0,100)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2022/09/12.") +#@gui Reverse Digits:fx_rep_rd,fx_rep_rd_preview(0) +#@gui :_=note("Reverses digits of image. Used for glitch art.\n\nNote:Max-1 for Out-Of-Bound Mode is only applicable in float color space.") +#@gui :_=separator() +#@gui :_=note("Color and Alpha") +#@gui :Colour Space=choice(0,"RGB-8","SRGB-8","RYB-8","CMY","CMYK","HSI-8,"HSL-8","HSV-8","LAB-8","LCH-8","YCBCR-8","YIQ-8","YUV-8","YES-8","K1-8","Ohta-8") +#@gui :Use Alpha?=bool(0) +#@gui :_=separator() +#@gui :_=note("Values") +#@gui :Base=int(10,2,50) +#@gui :Out-Of-Bound Mode=choice(0,"None","Periodic","Continuous) +#@gui :Cut Value?=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/9/26.") +#@gui Reverse Engineer Color Curve:gui_rep_recc,gui_rep_recc_preview(0) : + +#@gui :_=note("Reverse engineer color curves map. You must export, and then import to your program of choice!") +#@gui :_=separator() +#@gui :_=note("Processing") +#@gui :Gradient Thickness=int(10,1,100) +#@gui :Use First Layer?=bool(1) +#@gui :_=separator() +#@gui :_=note("Export") +#@gui :Folder=folder() +#@gui :Filename=text("gradient.png") +#@gui :Export Gradient=button() +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Preview All Gradient at Once?=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/1/2.") +#@gui Reverse Engineer Gradient Map:gui_rep_regm,gui_rep_regm_preview(0) : + +#@gui :_=note("Reverse engineer gradient map. You must export, and then import to your program of choice!") +#@gui :_=separator() +#@gui :_=note("Processing") +#@gui :Gradient Thickness=int(10,1,100) +#@gui :Use First Layer?=bool(1) +#@gui :Normalize?=bool(0) +#@gui :_=separator() +#@gui :_=note("Export") +#@gui :Folder=folder() +#@gui :Filename=text("gradient.png") +#@gui :Export Gradient=button() +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Preview All Gradient at Once?=bool(1) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/12/27.") +#@gui RGB-Gray Linear Interpolation:fx_rep_lerp_rgb_gray,fx_rep_lerp_rgb_gray_preview(0) +#@gui :_=note("Formula") +#@gui :Mode=choice(0,"Luminosity A","Luminosity B","Lightness","Minimum","Maximum","Average",Weighted") +#@gui :Limit Factor to 100%=bool(0) +#@gui :_=separator() +#@gui :_=note("Channel Factor") +#@gui :Red Factor (%)=float(100,0,150) +#@gui :Green Factor (%)=float(100,0,150) +#@gui :Blue Factor (%)=float(100,0,150) +#@gui :Red Factor (%)=float(100,0,100) +#@gui :Green Factor (%)=float(100,0,100) +#@gui :Blue Factor (%)=float(100,0,100) +#@gui :Red Weight=float(1,0,1) +#@gui :Green Weight=float(1,0,1) +#@gui :Blue Weight=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/14/3.") +#@gui Rotate by Torus Map:fx_rep_rbtt,fx_rep_rbtt_preview(0) +#@gui :_=note("Main") +#@gui :Circumference A (%)=float(100,0,100) +#@gui :Circumference B (%)=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Distortion") +#@gui :Distortion Angle=float(-180,-720,720) +#@gui :Distortion Mode=choice(3,"Soft","Medium","Hard","Alternative Hard","Distroy","Inverse-Distroy","Quad Extrude","Hexagonal Extrude") +#@gui :Distortion Mode A=choice(3,"Soft","Medium","Hard","Alternative Hard","Distroy","Inverse-Distroy","Quad Extrude","Hexagonal Extrude") +#@gui :Distortion Mode B=choice(7,"Soft","Medium","Hard","Alternative Hard","Distroy","Inverse-Distroy","Quad Extrude","Hexagonal Extrude") +#@gui :Distortion Mode Blending (%)=float(50,0,100) +#@gui :Enable Distortion Mode Blending=bool(1) +#@gui :Distortion Position=point(50,50,0,1,255,255,255,255) +#@gui :Wraparound Distortion?=bool(1) +#@gui :_=separator() +#@gui :_=note("Additional") +#@gui :Remove Background?=bool(0) +#@gui :Activate Isolated Torus Mode?=bool(0) +#@gui :_=separator() +#@gui :_=note("Rendering") +#@gui :Interpolation=choice(1,"None","Linear") +#@gui :Boundary Condition=choice(2,"None","Neumann","Periodic","Mirror") +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Information\n") +#@gui :_=note("This filter is inspired by Donut Distortion Paint.NET plugin by MadJik.\n\n This G'MIC version includes additional modes,wraparound mode, and special mode which isolates the distortion.") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/11/08.") +#@gui Serendipitous Circle:fx_rep_serendipitous_circle,fx_rep_serendipitous_circle(0)* +#@gui :_=note("Iterations") +#@gui :_=separator() +#@gui :Points=int(1000,10,100000) +#@gui :Repeats=int(500,10,20000) +#@gui :_=note("Coefficient") +#@gui :_=separator() +#@gui :Coefficient A=float(2,-100,100) +#@gui :Coefficient B=float(2,-100,100) +#@gui :Use -0 for Coefficient A?=bool(0) +#@gui :Use -0 for Coefficient B?=bool(0) +#@gui :Coefficient A to 0=button() +#@gui :Coefficient B to 0=button() +#@gui :Coefficients to 0=button() +#@gui :Linked Coefficient?=bool(0) +#@gui :_=note("Operators") +#@gui :_=separator() +#@gui :Mode A=choice(1,"Multiplication","Division") +#@gui :Mode B=choice(1,"Multiplication","Division") +#@gui :_=note("Variable") +#@gui :_=separator() +#@gui :Use Old Mode=bool(0) +#@gui :_=note("Rendering") +#@gui :_=separator() +#@gui :Sublevel=float(1,0,10) +#@gui :Symmetry Mode=choice(1,"Mode 0","Mode 1") +#@gui :Seed=int(0,0,1000000) +#@gui :Randomize Seed=button() +#@gui :Normalization Convolution=int(0,1,500) +#@gui :Use Exponential-Sigmoid Adjustment?=bool(1) +#@gui :Mid-Point Shift=float(.25,-1,1) +#@gui :Sigmoid-Shift=float(0,-100,100) +#@gui :Value-Shift=float(0,-1,1) +#@gui :Coefficient A=float(2,-100,100)_0 +#@gui :Coefficient B=float(2,-100,100)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2022/03/09.") +#@gui __Deformations +#@gui Sinusoidal Water Distortion:rep_sinowaterdist_gui,rep_sinowaterdist_gui_preview(0) +#@gui :X-Balance=float(0,-100,100) +#@gui :Y-Balance=float(0,-100,100) +#@gui :Scale=float(.5,.1,100) +#@gui :Interpolation=choice(2,"Nearest","Linear","Bicubic") +#@gui :Boundary Condition=choice(0,"Periodic","Mirror") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/6/4.") +#@gui _Testing +#@gui Reptorian +#@gui Skew:rep_skew,rep_skew_preview +#@gui :Angle=float(0,-89.99,89.99) +#@gui :Position(%)=float(0,-100,100) +#@gui :Axis=choice(0,"X","Y") +#@gui :Boundary=choice(3,"None","Neumann","Periodic","Mirror") +#@gui :Interpolation=choice(2,"Nearest","Linear","Bicubic") +#@gui :Enlarge?=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/4/16.") +#@gui Spiral Distortion:gui_rep_sd,gui_rep_sd_preview(0) +#@gui :_=note("Transform image using spiral gradient for x-coordinate, and radial gradient for y-coordinate.") +#@gui :_=separator() +#@gui :Revolution=float(1,.1,10) +#@gui :Spiral Height=float(1,.5,10) +#@gui :Refraction Power=float(0,-.99,2) +#@gui :Direction=choice(0,"Clockwise","Counterclockwise") +#@gui :Angle=float(0,-180,180) +#@gui :Spiral Mode=choice(0,"Periodic","Continuous") +#@gui :Preshift Position=point(50,50,0,1,200,200,200,255) +#@gui :Preshift Boundary=choice(0,"Periodic","Mirror") +#@gui :Skew Position (%)=point(50,50,0,1,100,100,100,255) +#@gui :Skew Multiplier=float(1,-.5,3) +#@gui :Offset (%)=point(50,50,0,1,255,255,255,255) +#@gui :Scale X-Coordinate (%)=float(100,1,1000) +#@gui :Scale Y-Coordinate (%)=float(100,1,1000) +#@gui :Boundary Condition=choice(3,"None","Neumann","Periodic","Mirror") +#@gui :Interpolation=choice(4,"Nearest","Average","Linear","Bicubic","Lanczos") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/10/15.") +#@gui Squareroot - Logarithmic Distortion:rep_sqrlogpindis_gui,rep_sqrlogpindis_gui_preview(0) +#@gui :_=note("This filter is a extended version of a filter found in Asmageddon Tools Pack v3. Translated to G'MIC using a source code, and then extended. It is a mixture of two texture filters.") +#@gui :_=separator() +#@gui :Distortion Factor=float(1,.1,1000) +#@gui :Preliminary Surface Shift=point(50,50,0,1,128,128,128,255) +#@gui :Distortion Surface Position=point(50,50,0,1,255,255,255,255) +#@gui :Preliminary X-Axis Scaling=float(1,.1,10) +#@gui :Preliminary Y-Axis Scaling=float(1,.1,10) +#@gui :Effect X-Axis Scaling=float(1,.1,10) +#@gui :Effect Y-Axis Scaling=float(1,.1,10) +#@gui :Distortion Surface Angle=float(0,0,360) +#@gui :Placement=choice(0,"Inside-Out","Outside-In") +#@gui :Logarithmic Distortion Axis Combination for X-Axis=choice(0,"Different Axis","Same Axis") +#@gui :Logarithmic Distortion Axis Combination for Y-Axis=choice(0,"Different Axis","Same Axis") +#@gui :Logarithmic Distortion X-Axis Direction=choice(0,"Negative","Positive") +#@gui :Logarithmic Distortion Y-Axis Direction=choice(0,"Negative","Positive") +#@gui :Boundary Condition=choice(0,"Periodic","Mirror") +#@gui :Interpolation=choice(2,"Nearest","Linear","Bicubic") +#@gui :Base Reference Dimension=int(1024,10,4096) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/6/4.") +#@gui Statistical Average:fx_rep_bchstatfunc_average,fx_rep_bchstatfunc_average_preview +#@gui :Mode=choice(0,"RGB","SRGB","RYB","LAB") +#@gui :Use Alpha?=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/4/07.") +#@gui Stitch Distort:fx_rep_stitch,fx_rep_stitch_preview +#@gui :_=note("Main") +#@gui :Offset by Half-Image-Diagonal(%)=float(5,-100,100) +#@gui :Strip Thickness(%)=float(1,0,75) +#@gui :Modulo=int(0,0,32) +#@gui :Modulo Boundary=choice(0,"Periodic","Continuous") +#@gui :Image Boundary=choice(3,"None","Neumann","Periodic","Mirror") +#@gui :Offset Mode=choice(0,"Single Iteration of Randomization","Multiple Iteration of Randomization") +#@gui :Strip Mode=choice(0,"None","Single Iteration of Randomization","Multiple Iteration of Randomization") +#@gui :Offset Seed=int(128,0,255) +#@gui :Strip Seed=int(128,0,255) +#@gui :_=separator() +#@gui :_=note("Rendering") +#@gui :Subpixel Processing Level=float(1,0,2) +#@gui :Interpolation=choice(4,"Nearest","Average","Linear","Bicubic","Lanczos") +#@gui :_=separator() +#@gui :_=note("Angles") +#@gui :Angles Mode=choice(1,"Non-Symmetrical","Symmetrical") +#@gui :Start Angle=float(0,-180,180) +#@gui :Number of Angles=int(2,2,12) +#@gui :Number of Angles=int(2,1,12) +#@gui :Angle #1=float(45,-180,180) +#@gui :Angle #2=float(-45,-180,180) +#@gui :Angle #3=float(90,-180,180) +#@gui :Angle #4=float(0,-180,180) +#@gui :Angle #5=float(60,-180,180) +#@gui :Angle #6=float(-60,-180,180) +#@gui :Angle #7=float(15,-180,180) +#@gui :Angle #8=float(-15,-180,180) +#@gui :Angle #9=float(30,-180,180) +#@gui :Angle #10=float(-30,-180,180) +#@gui :Angle #11=float(5,-180,180) +#@gui :Angle #12=float(-5,-180,180) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2022/4/16.") +#@gui Strange Bulger:rep_strbul,rep_strbul_preview(0) +#@gui :Angle=float(0,-180,180) +#@gui :Axis=choice(0,"X-Axis","Y-Axis") +#@gui :Interpolation=choice(2,"Nearest","Linear","Bicubic") +#@gui :Boundary Condition=choice(0,"Periodic","Mirror") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/6/4.") +#@gui Strange Bulger Kaleidoscope:rep_strbulkal_gui,rep_strbulkal_gui_preview(0) +#@gui :_=note("This filter is a extended version of the filters named 'Strange Bulger A', and 'Strange Bulger B' found inAsmageddon Tools Pack v3. Translated to G'MIC using source code for Asmageddon's tool, and then extended.") +#@gui :_=separator() +#@gui :Bulge Angle=float(0,-180,180) +#@gui :Axis of Bulge=choice(0,"X-Axis","Y-Axis") +#@gui :Scale=float(1,.1,10) +#@gui :Preliminary Surface Shift=point(50,50,0,1,128,128,128,255) +#@gui :Distortion Surface Position=point(50,50,0,1,255,255,255,255) +#@gui :Distortion Surface Angle=float(0,0,360) +#@gui :Placement=choice(0,"Inside-Out","Outside-In") +#@gui :Boundary Condition=choice(0,"Periodic","Mirror") +#@gui :Interpolation=choice(2,"Nearest","Linear","Bicubic") +#@gui :Base Reference Dimension=int(1024,10,4096) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/6/4.") +#@gui Three-Coupled Oscillators:fx_rep_tco,fx_rep_tco +#@gui :_=note("Main") +#@gui :_=separator() +#@gui :Maximum Iteration=int(50,1,200) +#@gui :K-A Tau(%)=float(50,-100,100) +#@gui :K-B Tau(%)=float(-50,-100,100) +#@gui :Subpixel Level=float(1,0,2) +#@gui :Angle=float(0,-180,180) +#@gui :Position=point(50,50,0,1,128,128,128,255) +#@gui :Axis-Scale=float(1,1,15) +#@gui :_=note("Coloring") +#@gui :_=separator() +#@gui :Mode=choice(0,"Grayscale","Palette","Random") +#@gui :Palette=choice(12,"Black & White-2","Red-Green-Blue-3","Black with Red-Green-Blue-4","Black & White with Red-Green-Blue-5","Cyan-Magenta-Yellow-3","Cyan-Magenta-Yellow-Black-4","White-Cyan-Magenta-Yellow-Black-5","Red-Green-Blue with Cyan-Magenta-Yellow-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus Palette-256","PLAYPAL-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette-33","Koni32","Linear Color Palette Basic-31","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO-46","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8-11","CD-BAC-16","CG Arne-16","DinoKnight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar (Lake Water Lily)-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet Coding Language-20","Matrix-96","Material Design-96","Rainbow-88","Rainbow-96","SCRJ-XXXVI-36","Pxls Default-32","Lospec500-42","Moderna-24","Oak21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80's","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R|place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","FunkyFuture8","The Golden Wall Palette-7","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Cretaceous-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Vanilla MilkShake-16","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58 Palette","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell, Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-7","Ocean Glass-8","RoyalGuard-6","Eulbink-7","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-5","Rabbit 7","Amiga 2600 NTSC-128","Amiga 2600 PAL-104","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series - GTIA-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","Commodore 64 - Pepto-16","Commodore 64 - Colodore-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System Palette-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-244","Win 95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Piet Palette-5","Japanese Woodblock Palette-12","Human Faces-94","HSV Palette-96","ST24 Christmas","Reds-24") +#@gui :Number of Colors=int(6,2,100) +#@gui :Color Space=choice(0,"RGB","HSI","HCY","LAB") +#@gui :Seed=int(0,0,3000) +#@gui :Boundary=choice(1,"Periodic","Periodic-Smooth","Continuous") +#@gui :Negate=bool(0) +#@gui :Shift Value=float(0,-1,1) +#@gui :Multiplier=float(1,.25,10) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2023/9/11.") +#@gui Tiled Form:gui_rep_form_pixel,gui_rep_form_pixel_preview +#@gui :_=note("Colour Space Processing") +#@gui :Colour Space=choice(0,"RGB","RYB","CMYK","HCY","HSI","HSL","HSV","LAB","LCH") +#@gui :_=separator() +#@gui :_=note("Tile Shape") +#@gui :Tiled Shape=choice(3,"By Layer","Australia","Barbedwire","Circle","Crosshair","Cupid","Diamond","Dragon Curve-[D]","Dragonfly","Fern-[D]","Flip","Gear-[D]","Gumleaf","Heart","Information","Kookaburra","Mail","Mapleleaf","Paint Splat","Paw","Phone","Polygon-[D]","Rooster","Shopping Cart","Snowflake-[D]","Star-[D]") +#@gui :Reverse Layer=bool(0) +#@gui :_=note("For the first option, you must use at least 2 layer to use layer as shape reference, else it'll use the only image itself as shape reference. Reverse Layer option might have to be used to generate the proper result when using first option.") +#@gui :_=separator() +#@gui :_=note("Tiles") +#@gui :Shape Width (px)=int(30,0,512) +#@gui :Shape Height (px)=int(30,0,512) +#@gui :Shape Ratio (%)=float(100,5,100) +#@gui :Shape Rotation=float(0,-180,180) +#@gui :Shape Mirror Axis=choice(0,"None","X","Y") +#@gui :Subpixel Level=float(.5,0,2) +#@gui :Z-Convolution Factor (%)=float(50,0,200) +#@gui :Z-Convolution Boundary=choice(0,"Neumann","Periodic") +#@gui :Interpolation=choice(5,"Nearest","Average","Linear","Grid","Bicubic","Lanczos") +#@gui :Tile Boundary=choice(0,"Periodic","Mirror - X","Mirror - Y","Mirror - XY") +#@gui :Preprocess Boundary=choice(2,"Neumann","Periodic","Mirror") +#@gui :Fit Tile?=bool(1) +#@gui :Output=choice(0,"New Dimension","New Dimension - New Layer","Old Dimension","Old Dimension - New Layer") +#@gui :_=note("If using Krita and New Layer option, then you may have to reorder one layer.") +#@gui :_=separator() +#@gui :_=note("Dynamic Shape") +#@gui :Dragon Curve Recursion=int(10,0,30) +#@gui :Dragon Curve Rotation=float(0,-180,180) +#@gui :Fern Type=choice("Asplenium Adiantum-Nigrum","Thelypteridaceae") +#@gui :Fern Density (%)=float(100,0,300) +#@gui :Gear Teeth Count=int(8,3,32) +#@gui :Gear Height (%)=float(25,0.1,100) +#@gui :Gear Offset Teeth (%)=float(0,0,100) +#@gui :Gear Inner Ratio (%)=float(50,0.1,100) +#@gui :Polygon Vertices=int(5,3,100) +#@gui :Snowflake Recursion=int(5,1,6) +#@gui :Star Branches=int(3,5,100) +#@gui :Star Thickness (%)=float(38,.1,100) +#@gui :_=note("Dynamic Shapes Options are only visible for dynamic shapes!") +#@gui :_=separator() +#@gui :_=note("Original idea comes from TR's Tiled Pixels V1.2 plugin by TechnoRobbo for Paint.NET. This version is a extended version utilizing weighted average sampling per area per tile, boundary option, anti-aliasing, dynamic shape, color space,and transformation. Dynamic shapes are also supported by this filter.") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/12/15.") +#@gui Tiled Zoom:fx_rep_tz,fx_rep_tz_preview(0) +#@gui :_=note("Create tiled zoom.") +#@gui :_=separator() +#@gui :Square Width - Half Image-Diagonal(%)=float(10,1,100) +#@gui :Square Height - Half Image-Diagonal(%)=float(10,1,100) +#@gui :Scale=float(2,1,10) +#@gui :Boundary=choice(0,"None","Neumann","Periodic","Mirror") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2020/9/22.") +#@gui TR's Intense Filtration:gui_rep_trif,gui_rep_trif_preview(0) +#@gui :Hue=float(45,0,360) +#@gui :Image Coefficient (%)=float(100,0,200) +#@gui :Mix Factor (%)=float(0,0,100) +#@gui :Style Base=choice(0,"Based from Original Image","Based on Grayscale","Based on Hue") +#@gui :_=separator() +#@gui :_=note("Preview Setting") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("TR's Intense Filtration is a filter that filters out colors and augment a color based on hue. The formula for the filter is created by TechnoRobbo. The code for this filter is based on the source code of TechnoRobbo's Intense Filtration v1.3 plugin for Paint.NET.") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/11/1.") +#@gui TR's Pixel Sharpener:gui_rep_trps,gui_rep_trps_preview(0) +#@gui :Sharpening=float(0,0,50) +#@gui :Internal Blurring=int(0,0,4) +#@gui :Blur Type=choice(0,"Photo","Horizontal","Vertical","Angle - One Axis","Angle - Two Axis","Angle - Two Axis [Disconnected]") +#@gui :Angle=float(0,-180,180) +#@gui :Angle 2=float(0,-180,180) +#@gui :Channel(s)=choice(11,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :_=note("This is a extended filter which was based on a Paint.NET plugin that was created by TechnoRobbo - TR's Pixel Sharpener") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/11/2.") +#@gui Transfer Color [Reduced Colors]:fx_rep_transfer_color_reduced,fx_rep_transfer_color_reduced_preview(0)* +#@gui :_=separator() +#@gui :_=note("Preliminary Setup") +#@gui :Style of Dithering=choice(0,"Indexing","Ordered") +#@gui :Dithering (%)=float(50,0,100) +#@gui :Special Effect=choice(0,"None","Horizontal-D","Vertical-D","Horizontal-L","Vertical-L","Checkerboard-D","Checkerboard-L") +#@gui :Special Effect Factor (%)=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Palette") +#@gui :Coloring Method=choice(0,"Premade Palette","Bit Depth/Levels") +#@gui :Palette Method=choice(0,"Premade","Auto","Import","Custom") +#@gui :Use Bit Depth=bool(0) +#@gui :Levels=int(4,1,64) +#@gui :Red Levels=int(4,1,64) +#@gui :Green Levels=int(4,1,64) +#@gui :Blue Levels=int(4,1,64) +#@gui :Use Same Levels for All Channels=bool(0) +#@gui :Bit-Depth=int(2,1,8) +#@gui :Red Bit-Depth=int(2,1,8) +#@gui :Green Bit-Depth=int(2,1,8) +#@gui :Blue Bit-Depth=int(2,1,8) +#@gui :Use Same Bit-Depths for All Channel=bool(0) +#@gui :Palette to Use=choice(18,"Black & White-2","Red-Green-Blue-3","Black with Red-Green-Blue-4","Black & White with Red-Green-Blue-5","Cyan-Magenta-Yellow-3","Cyan-Magenta-Yellow-Black-4","White-Cyan-Magenta-Yellow-Black-5","Red-Green-Blue with Cyan-Magenta-Yellow-6","1-Bit RGB-8","Aurora-256","Zenit-241","Game Builder Garage: Texture-Sprite Editor Palette-117","Duel-256","Hocus Pocus Palette-256","PLAYPAL-249","Sonic Robo Blast 2-256","Uzebox-256","Andrew Kensler - 16","Andrew Kensler - 32","Andrew Kensler - 54","AAP-Micro 12","AAP-16","AAP-64","AAP-RadiantPLUS-96","AAP-SPLENDOR128","AAP-DGA16","Cheerful-32","DB8","DB16","DB32","DB-ISO22","DimWiddy 17","DimWiddy 23","Endesga-4","Endesga-8","Endesga-16","Endesga-32","Endesga-36","Endesga-64","Famicube-64","Juicy-32","Juicy-56","XAIUE-22","15P-DX","20P-DX","24P-DX","Cabana-64","Fantasy 16","Fantasy 24","Tranquil Fantasy 23","Tranquility Plus 39","Faraway 48","Fleja Master Palette-33","Koni32","Linear Color Palette Basic-31","LEGO Colors-43","Lego Colours 2021-40","Vines Flexible Linear Ramps-38","Arcade Standard 29","ARQ16","Atom-8","BLK 36","BLK-NEO-46","Broken Facility-40","Bubblegum-16","CPC BOY-32","Cade 15","Calder 8-11","CD-BAC-16","CG Arne-16","DinoKnight 16","||||-22","FZT Ethereal 16","Indecision-17","Island Joy 16","Journey-64","Shallowmarsh26","Lago Nenufar (Lake Water Lily)-19","Juicy 17","ChocolateGanache-96","Bright Winter 1-74","Bright Winter 2-83","Kawaii16","0xdb-01-17","GZXP-11","Chromatic16","Piet Coding Language-20","Matrix-96","Material Design-96","Rainbow-88","Rainbow-96","SCRJ-XXXVI-36","Pxls Default-32","Lospec500-42","Moderna-24","Oak21","Nature's Embrace 55","RBYPGO-94","New Worlds 46","Nauris-16","Dynamite-40","Interstate 28","Downgraded 32","Pear 36","Pineapple 32","Peachy Pop 16","Resurrect 32","Rosy 42","SLSO-CLR17","Softy 15","SPEC12","The Roarin 80's","Starmancer-52","SuperFuture25","SUNSHINE 35","Sweetie 16","Calm 48","Optimism-32","Taffy 16","Todayland Palette V2-25","TriRampo-12","R|place 2022-32","Tropical Cone 24","Vivid-17","SHIDO50+-72","Intacto14","Itatsi-23","ENOS16","Grixel Grotto-16","Superb 8","Undertones-17","Tango-28","Cheese Palette-28","Equpix 15","Zughy 32","Voodo34","Franzston 30","Night 16","Star 29","Star 34","Still-Life-14","SimpleJPC-16","Acid 15","Battery 24","Clumpy 18","Cthulhu-16","Crimso 11-16","Copper-Tech-16","DRZ15A","Eggy 15","Europa 16","GreyT-Bit-8","Jewel-15","Polar 11","Sheltzy 32","Wyrm 24","Yume Nikki-24","Rube-Goldberg-9","BoomBoom-7","Generic-8","Crayola Blind-9","FunkyFuture8","The Golden Wall Palette-7","Matriax8c","NT1H-26","JerryPie 22","Nineties Nine-9","On70-35","ANB16","Retrocal-8","Punolit-21","Luap 40","Autum Villan 6","Autum 15","Autum 15 [Yellow]","Galaxy Flame-16","Cretaceous-16","Antiquity16","Mushroom-14","Aerugo-32","Hotel Paintings 6","Nopal-12","Brightness GPY-3","Blessing-5","Fairydust 8","Vanilla MilkShake-16","Fuzzy Four-4","Fairy Tales-8","Naji 16","Easter Island-16","Pastel and Darks 58 Palette","17 Pastels","NOSTALGIA15","Ocaso-17","Oh Hell, Pastel-15","Pollen-8","KULE-16","Hydrangea 11","Fluffy8","ST 8 R&B Remake","Neon Space-10","Cyclope6","Sy17","Syz15","TUI-15","Cave-8","Psygnosia-16","MarshMellow32","Lost Century 24","Finlal 11","Industrial Factory 16","Murder Mystery 16","Fate & Destiny 12","Vinik 24","YKB-22","Halloween-7","Graveyard-21","Steam Lords-16","Frostical-18","DeuteroSpill-9","Cool Bone 7","Muted Ally 6","EPHEMERA-12","Ink-5","Violet Dreams-8","Tinyfolks-5","Old Gold 7","Rosemoss-8","AAP-RadiantXV-15","AAP-Majesty XVII-17","Dead Weight-8","Mojave20","Petite-8","Petite-8 Afterdark","XAIUE-Radiant-22","Daruda 22","Firestorm-9","Borkfest-8","Spicy 07","Rust-6","Apricot-6","SuperNova 7","Pastry-5","Sandy 06","Illumination-5","NYX8","Dream Haze 8","OIL6","Regal10","Soft Demon 7","SGM-Palette 2-17","Midnight Ablaze-7","Black Cherry-5","Sunset Red-5","INKPINK-6","Brash Pink-5","Pink Neon Sign 6","Enchanted Purple-12","Arch-11","Spacey Easter-17","Fornax Void I-256","Fornax Void II-128","Pixelwave-12","S1-6","Berry Nebula-8","ABYSS-9","Moonlight 15","Moonlit-39","H2O-10","Magic Waters 9","Bluem0ld-4","Moss-5","DEEP MAZE-7","Toxic Slime-5","Lush Green-6","Tsunami-5","Cryptic Ocean-6","Marsh Madness-5","OXYD-8","Pink&Green-8","Walking in the Woods 8","Paper 8","Sahara Pastell-7","Sunflower Painting 7","Art Hoe Aesthetic 7","Sky5-7","Ocean Glass-8","RoyalGuard-6","Eulbink-7","Winter Wonderland-8","Moon Squid 7","Stratus-5","Arctic Dust-5","CL8UDS","Lilac Skies 5","Sea of Fire-6","Autochrome 3","Autochrome 5","GB Default 1-4","GB Default 2-4","GB Andrade-4","GB Blue Seni-4","GB Blackzone-4","GB Suburb-4","GB Crimson-4","GB Didi-4","GB Dirty-4","GB Arne-4","GB Easy-4","GB Forest-4","GB Harsh Green-4","GB Light Green-4","GB Nostalgia-4","GB Platinum-4","GB Kirokaze-4","GB Cyber-4","GB Wish-4","GB Grapefruit-4","GB Ice Cream-4","GB Red Blue-4","Gold GB-4","GB Chocolate-4","GB Gray-4","GB Spacehaze-4","GB Purple Dawn-4","Moon Crystal-4","ARNE4","Autumn Chill-4","CherryMelon-4","HallowPumpkin-4","Hollow-4","Lavender4","MAW-4","Voltage Warning-4","Tritanopia-5","Rabbit 7","Amiga 2600 NTSC-128","Amiga 2600 PAL-104","Amiga 2600 SECAM-8","Amiga 7800 M.E.S.S-256","Amiga 7800-256","Amstrad CPC-27","Apple II-15","Atari 8-Bit Series - GTIA-256","CGA-16","CGA Mode 0 [Low]-4","CGA Mode 0 [High]-4","CGA Mode 1 [Low]-4","CGA Mode 1 [High]-4","CGA Mode 2 [Low]-4","CGA Mode 2 [High]-4","Commodore 64 - Pepto-16","Commodore 64 - Colodore-16","Commodore VIC-20-16","Colecovision-15","Japanese Machine Palette-16","Macintosh II-16","Macintosh 8-Bit System Palette-256","MSX-15","NES-55","PICO-8-16","RISC OS-16","SAM Coupe-128","Thomson MO5-16","TRS-80 Color Computer Palette-4","Virtual Boy Interpreted-4","VGA-244","Win 95-256","ZX Spectrum-15","GNOME 32","Electronic Crayon 22","Chip16","Deluxe Paint-222","FlatUI-20","MakeCode Arcade Palette-15","Oekaki-20","Legacy Paint-16","XP Paint-28","Vista Paint-28","Piet Palette-5","Japanese Woodblock Palette-12","Human Faces-94","HSV Palette-96","ST24 Christmas","Reds-24") +#@gui :‎ - Send to Custom Palette‎ -=button() +#@gui :Palette File Location=file() +#@gui :Re-Import File‎‎=button() +#@gui :Number of Color=int(8,2,256) +#@gui :Number of Color=int(8,2,256) +#@gui :Color Restriction Per Whole Image=int(0,0,256) +#@gui :Color Restriction Per Window=int(0,0,16) +#@gui :Display Custom Palette Colors=bool(1) +#@gui :Multi-Select Palette Color=bool(0) +#@gui :_=separator() +#@gui :Delete All Selected Palette=button(0) +#@gui :_=separator() +#@gui :Palette Color 1=color(#f7f4bf) +#@gui :‎ ‎ ‎ ‎ Delete Color 1‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 1 Selected=_bool(0) +#@gui :Palette Color 2=color(#fff02b) +#@gui :‎ ‎ ‎ ‎ Delete Color 2‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 2 Selected=_bool(0) +#@gui :Palette Color 3=color(#ffcf05) +#@gui :‎ ‎ ‎ ‎ Delete Color 3‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 3 Selected=_bool(0) +#@gui :Palette Color 4=color(#ffb108) +#@gui :‎ ‎ ‎ ‎ Delete Color 4‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 4 Selected=_bool(0) +#@gui :Palette Color 5=color(#e98627) +#@gui :‎ ‎ ‎ ‎ Delete Color 5‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 5 Selected=_bool(0) +#@gui :Palette Color 6=color(#bf5a3e) +#@gui :‎ ‎ ‎ ‎ Delete Color 6‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 6 Selected=_bool(0) +#@gui :Palette Color 7=color(#9c3327) +#@gui :‎ ‎ ‎ ‎ Delete Color 7‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 7 Selected=_bool(0) +#@gui :Palette Color 8=color(#721c03) +#@gui :‎ ‎ ‎ ‎ Delete Color 8‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 8 Selected=_bool(0) +#@gui :Palette Color 9=color(#ffe2cf) +#@gui :‎ ‎ ‎ ‎ Delete Color 9‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 9 Selected=_bool(0) +#@gui :Palette Color 10=color(#d4aeaa) +#@gui :‎ ‎ ‎ ‎ Delete Color 10‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 10 Selected=_bool(0) +#@gui :Palette Color 11=color(#b58b94) +#@gui :‎ ‎ ‎ ‎ Delete Color 11‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 11 Selected=_bool(0) +#@gui :Palette Color 12=color(#ad7984) +#@gui :‎ ‎ ‎ ‎ Delete Color 12‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 12 Selected=_bool(0) +#@gui :Palette Color 13=color(#91606a) +#@gui :‎ ‎ ‎ ‎ Delete Color 13‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 13 Selected=_bool(0) +#@gui :Palette Color 14=color(#77535b) +#@gui :‎ ‎ ‎ ‎ Delete Color 14‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 14 Selected=_bool(0) +#@gui :Palette Color 15=color(#5e414a) +#@gui :‎ ‎ ‎ ‎ Delete Color 15‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 15 Selected=_bool(0) +#@gui :Palette Color 16=color(#492129) +#@gui :‎ ‎ ‎ ‎ Delete Color 16‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 16 Selected=_bool(0) +#@gui :Palette Color 17=color(#8393c3) +#@gui :‎ ‎ ‎ ‎ Delete Color 17‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 17 Selected=_bool(0) +#@gui :Palette Color 18=color(#6c82c4) +#@gui :‎ ‎ ‎ ‎ Delete Color 18‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 18 Selected=_bool(0) +#@gui :Palette Color 19=color(#5274c5) +#@gui :‎ ‎ ‎ ‎ Delete Color 19‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 19 Selected=_bool(0) +#@gui :Palette Color 20=color(#5165ae) +#@gui :‎ ‎ ‎ ‎ Delete Color 20‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 20 Selected=_bool(0) +#@gui :Palette Color 21=color(#3d5083) +#@gui :‎ ‎ ‎ ‎ Delete Color 21‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 21 Selected=_bool(0) +#@gui :Palette Color 22=color(#2d3d72) +#@gui :‎ ‎ ‎ ‎ Delete Color 22‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 22 Selected=_bool(0) +#@gui :Palette Color 23=color(#28335d) +#@gui :‎ ‎ ‎ ‎ Delete Color 23‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 23 Selected=_bool(0) +#@gui :Palette Color 24=color(#262450) +#@gui :‎ ‎ ‎ ‎ Delete Color 24‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 24 Selected=_bool(0) +#@gui :Palette Color 25=color(#d1bdfe) +#@gui :‎ ‎ ‎ ‎ Delete Color 25‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 25 Selected=_bool(0) +#@gui :Palette Color 26=color(#baabf7) +#@gui :‎ ‎ ‎ ‎ Delete Color 26‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 26 Selected=_bool(0) +#@gui :Palette Color 27=color(#a996ec) +#@gui :‎ ‎ ‎ ‎ Delete Color 27‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 27 Selected=_bool(0) +#@gui :Palette Color 28=color(#9585f1) +#@gui :‎ ‎ ‎ ‎ Delete Color 28‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 28 Selected=_bool(0) +#@gui :Palette Color 29=color(#7964ba) +#@gui :‎ ‎ ‎ ‎ Delete Color 29‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 29 Selected=_bool(0) +#@gui :Palette Color 30=color(#584a7f) +#@gui :‎ ‎ ‎ ‎ Delete Color 30‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 30 Selected=_bool(0) +#@gui :Palette Color 31=color(#3c3151) +#@gui :‎ ‎ ‎ ‎ Delete Color 31‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 31 Selected=_bool(0) +#@gui :Palette Color 32=color(#1d1d21) +#@gui :‎ ‎ ‎ ‎ Delete Color 32‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 32 Selected=_bool(0) +#@gui :Palette Color 33=color(#fdf786) +#@gui :‎ ‎ ‎ ‎ Delete Color 33‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 33 Selected=_bool(0) +#@gui :Palette Color 34=color(#ffd59b) +#@gui :‎ ‎ ‎ ‎ Delete Color 34‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 34 Selected=_bool(0) +#@gui :Palette Color 35=color(#ebbd9d) +#@gui :‎ ‎ ‎ ‎ Delete Color 35‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 35 Selected=_bool(0) +#@gui :Palette Color 36=color(#d5a39a) +#@gui :‎ ‎ ‎ ‎ Delete Color 36‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 36 Selected=_bool(0) +#@gui :Palette Color 37=color(#b98c93) +#@gui :‎ ‎ ‎ ‎ Delete Color 37‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 37 Selected=_bool(0) +#@gui :Palette Color 38=color(#977488) +#@gui :‎ ‎ ‎ ‎ Delete Color 38‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 38 Selected=_bool(0) +#@gui :Palette Color 39=color(#765d73) +#@gui :‎ ‎ ‎ ‎ Delete Color 39‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 39 Selected=_bool(0) +#@gui :Palette Color 40=color(#554769) +#@gui :‎ ‎ ‎ ‎ Delete Color 40‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 40 Selected=_bool(0) +#@gui :Palette Color 41=color(#6dccff) +#@gui :‎ ‎ ‎ ‎ Delete Color 41‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 41 Selected=_bool(0) +#@gui :Palette Color 42=color(#55b1f1) +#@gui :‎ ‎ ‎ ‎ Delete Color 42‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 42 Selected=_bool(0) +#@gui :Palette Color 43=color(#4097ea) +#@gui :‎ ‎ ‎ ‎ Delete Color 43‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 43 Selected=_bool(0) +#@gui :Palette Color 44=color(#1476c0) +#@gui :‎ ‎ ‎ ‎ Delete Color 44‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 44 Selected=_bool(0) +#@gui :Palette Color 45=color(#105da2) +#@gui :‎ ‎ ‎ ‎ Delete Color 45‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 45 Selected=_bool(0) +#@gui :Palette Color 46=color(#07487c) +#@gui :‎ ‎ ‎ ‎ Delete Color 46‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 46 Selected=_bool(0) +#@gui :Palette Color 47=color(#03315f) +#@gui :‎ ‎ ‎ ‎ Delete Color 47‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 47 Selected=_bool(0) +#@gui :Palette Color 48=color(#001b40) +#@gui :‎ ‎ ‎ ‎ Delete Color 48‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 48 Selected=_bool(0) +#@gui :Palette Color 49=color(#e0faeb) +#@gui :‎ ‎ ‎ ‎ Delete Color 49‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 49 Selected=_bool(0) +#@gui :Palette Color 50=color(#a9d1c1) +#@gui :‎ ‎ ‎ ‎ Delete Color 50‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 50 Selected=_bool(0) +#@gui :Palette Color 51=color(#8ac196) +#@gui :‎ ‎ ‎ ‎ Delete Color 51‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 51 Selected=_bool(0) +#@gui :Palette Color 52=color(#87ae8e) +#@gui :‎ ‎ ‎ ‎ Delete Color 52‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 52 Selected=_bool(0) +#@gui :Palette Color 53=color(#71957d) +#@gui :‎ ‎ ‎ ‎ Delete Color 53‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 53 Selected=_bool(0) +#@gui :Palette Color 54=color(#5b7b69) +#@gui :‎ ‎ ‎ ‎ Delete Color 54‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 54 Selected=_bool(0) +#@gui :Palette Color 55=color(#47655a) +#@gui :‎ ‎ ‎ ‎ Delete Color 55‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 55 Selected=_bool(0) +#@gui :Palette Color 56=color(#2d4b47) +#@gui :‎ ‎ ‎ ‎ Delete Color 56‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 56 Selected=_bool(0) +#@gui :Palette Color 57=color(#f4a380) +#@gui :‎ ‎ ‎ ‎ Delete Color 57‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 57 Selected=_bool(0) +#@gui :Palette Color 58=color(#d79374) +#@gui :‎ ‎ ‎ ‎ Delete Color 58‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 58 Selected=_bool(0) +#@gui :Palette Color 59=color(#bf7e63) +#@gui :‎ ‎ ‎ ‎ Delete Color 59‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 59 Selected=_bool(0) +#@gui :Palette Color 60=color(#a96d58) +#@gui :‎ ‎ ‎ ‎ Delete Color 60‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 60 Selected=_bool(0) +#@gui :Palette Color 61=color(#945d4f) +#@gui :‎ ‎ ‎ ‎ Delete Color 61‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 61 Selected=_bool(0) +#@gui :Palette Color 62=color(#784c49) +#@gui :‎ ‎ ‎ ‎ Delete Color 62‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 62 Selected=_bool(0) +#@gui :Palette Color 63=color(#53393a) +#@gui :‎ ‎ ‎ ‎ Delete Color 63‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 63 Selected=_bool(0) +#@gui :Palette Color 64=color(#372423) +#@gui :‎ ‎ ‎ ‎ Delete Color 64‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 64 Selected=_bool(0) +#@gui :Palette Color 65=color(#7fbd39) +#@gui :‎ ‎ ‎ ‎ Delete Color 65‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 65 Selected=_bool(0) +#@gui :Palette Color 66=color(#789e24) +#@gui :‎ ‎ ‎ ‎ Delete Color 66‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 66 Selected=_bool(0) +#@gui :Palette Color 67=color(#6b842d) +#@gui :‎ ‎ ‎ ‎ Delete Color 67‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 67 Selected=_bool(0) +#@gui :Palette Color 68=color(#58712c) +#@gui :‎ ‎ ‎ ‎ Delete Color 68‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 68 Selected=_bool(0) +#@gui :Palette Color 69=color(#4c5f33) +#@gui :‎ ‎ ‎ ‎ Delete Color 69‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 69 Selected=_bool(0) +#@gui :Palette Color 70=color(#394d3c) +#@gui :‎ ‎ ‎ ‎ Delete Color 70‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 70 Selected=_bool(0) +#@gui :Palette Color 71=color(#2e3d47) +#@gui :‎ ‎ ‎ ‎ Delete Color 71‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 71 Selected=_bool(0) +#@gui :Palette Color 72=color(#1d2c43) +#@gui :‎ ‎ ‎ ‎ Delete Color 72‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 72 Selected=_bool(0) +#@gui :Palette Color 73=color(#fedfb1) +#@gui :‎ ‎ ‎ ‎ Delete Color 73‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 73 Selected=_bool(0) +#@gui :Palette Color 74=color(#cfaf8e) +#@gui :‎ ‎ ‎ ‎ Delete Color 74‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 74 Selected=_bool(0) +#@gui :Palette Color 75=color(#b39783) +#@gui :‎ ‎ ‎ ‎ Delete Color 75‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 75 Selected=_bool(0) +#@gui :Palette Color 76=color(#917a7b) +#@gui :‎ ‎ ‎ ‎ Delete Color 76‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 76 Selected=_bool(0) +#@gui :Palette Color 77=color(#75686e) +#@gui :‎ ‎ ‎ ‎ Delete Color 77‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 77 Selected=_bool(0) +#@gui :Palette Color 78=color(#56506f) +#@gui :‎ ‎ ‎ ‎ Delete Color 78‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 78 Selected=_bool(0) +#@gui :Palette Color 79=color(#3b3855) +#@gui :‎ ‎ ‎ ‎ Delete Color 79‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 79 Selected=_bool(0) +#@gui :Palette Color 80=color(#26233d) +#@gui :‎ ‎ ‎ ‎ Delete Color 80‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 80 Selected=_bool(0) +#@gui :Palette Color 81=color(#fff64f) +#@gui :‎ ‎ ‎ ‎ Delete Color 81‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 81 Selected=_bool(0) +#@gui :Palette Color 82=color(#e8d24b) +#@gui :‎ ‎ ‎ ‎ Delete Color 82‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 82 Selected=_bool(0) +#@gui :Palette Color 83=color(#d1aa39) +#@gui :‎ ‎ ‎ ‎ Delete Color 83‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 83 Selected=_bool(0) +#@gui :Palette Color 84=color(#ba882e) +#@gui :‎ ‎ ‎ ‎ Delete Color 84‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 84 Selected=_bool(0) +#@gui :Palette Color 85=color(#9e6520) +#@gui :‎ ‎ ‎ ‎ Delete Color 85‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 85 Selected=_bool(0) +#@gui :Palette Color 86=color(#854f12) +#@gui :‎ ‎ ‎ ‎ Delete Color 86‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 86 Selected=_bool(0) +#@gui :Palette Color 87=color(#753b09) +#@gui :‎ ‎ ‎ ‎ Delete Color 87‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 87 Selected=_bool(0) +#@gui :Palette Color 88=color(#622a00) +#@gui :‎ ‎ ‎ ‎ Delete Color 88‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 88 Selected=_bool(0) +#@gui :Palette Color 89=color(#d0cc32) +#@gui :‎ ‎ ‎ ‎ Delete Color 89‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 89 Selected=_bool(0) +#@gui :Palette Color 90=color(#b4aa33) +#@gui :‎ ‎ ‎ ‎ Delete Color 90‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 90 Selected=_bool(0) +#@gui :Palette Color 91=color(#969a26) +#@gui :‎ ‎ ‎ ‎ Delete Color 91‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 91 Selected=_bool(0) +#@gui :Palette Color 92=color(#7c831e) +#@gui :‎ ‎ ‎ ‎ Delete Color 92‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 92 Selected=_bool(0) +#@gui :Palette Color 93=color(#617308) +#@gui :‎ ‎ ‎ ‎ Delete Color 93‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 93 Selected=_bool(0) +#@gui :Palette Color 94=color(#495d00) +#@gui :‎ ‎ ‎ ‎ Delete Color 94‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 94 Selected=_bool(0) +#@gui :Palette Color 95=color(#2f4f08) +#@gui :‎ ‎ ‎ ‎ Delete Color 95‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 95 Selected=_bool(0) +#@gui :Palette Color 96=color(#202900) +#@gui :‎ ‎ ‎ ‎ Delete Color 96‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 96 Selected=_bool(0) +#@gui :Palette Color 97=color(#e59a7c) +#@gui :‎ ‎ ‎ ‎ Delete Color 97‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 97 Selected=_bool(0) +#@gui :Palette Color 98=color(#d28d7a) +#@gui :‎ ‎ ‎ ‎ Delete Color 98‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 98 Selected=_bool(0) +#@gui :Palette Color 99=color(#c17e7a) +#@gui :‎ ‎ ‎ ‎ Delete Color 99‎ ‎ ‎ ‎ ‎=button(0) +#@gui :Color 99 Selected=_bool(0) +#@gui :Palette Color 100=color(#ac6f6e) +#@gui :‎ ‎ ‎ ‎ Delete Color 100‎ ‎ ‎ ‎‎=button(0) +#@gui :Color 100 Selected=_bool(0) +#@gui :Palette Color 101=color(#98595a) +#@gui :‎ ‎ ‎ ‎Delete Color 101‎ ‎ ‎ ‎=button(0) +#@gui :Color 101 Selected=_bool(0) +#@gui :Palette Color 102=color(#7c4b47) +#@gui :‎ ‎ ‎ ‎Delete Color 102‎ ‎ ‎ ‎=button(0) +#@gui :Color 102 Selected=_bool(0) +#@gui :Palette Color 103=color(#633432) +#@gui :‎ ‎ ‎ ‎Delete Color 103‎ ‎ ‎ ‎=button(0) +#@gui :Color 103 Selected=_bool(0) +#@gui :Palette Color 104=color(#49251c) +#@gui :‎ ‎ ‎ ‎Delete Color 104‎ ‎ ‎ ‎=button(0) +#@gui :Color 104 Selected=_bool(0) +#@gui :Palette Color 105=color(#ffcdff) +#@gui :‎ ‎ ‎ ‎Delete Color 105‎ ‎ ‎ ‎=button(0) +#@gui :Color 105 Selected=_bool(0) +#@gui :Palette Color 106=color(#ffa6c5) +#@gui :‎ ‎ ‎ ‎Delete Color 106‎ ‎ ‎ ‎=button(0) +#@gui :Color 106 Selected=_bool(0) +#@gui :Palette Color 107=color(#ff7daf) +#@gui :‎ ‎ ‎ ‎Delete Color 107‎ ‎ ‎ ‎=button(0) +#@gui :Color 107 Selected=_bool(0) +#@gui :Palette Color 108=color(#f85d80) +#@gui :‎ ‎ ‎ ‎Delete Color 108‎ ‎ ‎ ‎=button(0) +#@gui :Color 108 Selected=_bool(0) +#@gui :Palette Color 109=color(#d94a69) +#@gui :‎ ‎ ‎ ‎Delete Color 109‎ ‎ ‎ ‎=button(0) +#@gui :Color 109 Selected=_bool(0) +#@gui :Palette Color 110=color(#9f3b52) +#@gui :‎ ‎ ‎ ‎Delete Color 110‎ ‎ ‎ ‎=button(0) +#@gui :Color 110 Selected=_bool(0) +#@gui :Palette Color 111=color(#712b3b) +#@gui :‎ ‎ ‎ ‎Delete Color 111‎ ‎ ‎ ‎=button(0) +#@gui :Color 111 Selected=_bool(0) +#@gui :Palette Color 112=color(#431729) +#@gui :‎ ‎ ‎ ‎Delete Color 112‎ ‎ ‎ ‎=button(0) +#@gui :Color 112 Selected=_bool(0) +#@gui :Palette Color 113=color(#dcd4ff) +#@gui :‎ ‎ ‎ ‎Delete Color 113‎ ‎ ‎ ‎=button(0) +#@gui :Color 113 Selected=_bool(0) +#@gui :Palette Color 114=color(#b8aeff) +#@gui :‎ ‎ ‎ ‎Delete Color 114‎ ‎ ‎ ‎=button(0) +#@gui :Color 114 Selected=_bool(0) +#@gui :Palette Color 115=color(#9c9bef) +#@gui :‎ ‎ ‎ ‎Delete Color 115‎ ‎ ‎ ‎=button(0) +#@gui :Color 115 Selected=_bool(0) +#@gui :Palette Color 116=color(#8e8ce2) +#@gui :‎ ‎ ‎ ‎Delete Color 116‎ ‎ ‎ ‎=button(0) +#@gui :Color 116 Selected=_bool(0) +#@gui :Palette Color 117=color(#7877c1) +#@gui :‎ ‎ ‎ ‎Delete Color 117‎ ‎ ‎ ‎=button(0) +#@gui :Color 117 Selected=_bool(0) +#@gui :Palette Color 118=color(#64659d) +#@gui :‎ ‎ ‎ ‎Delete Color 118‎ ‎ ‎ ‎=button(0) +#@gui :Color 118 Selected=_bool(0) +#@gui :Palette Color 119=color(#4a5280) +#@gui :‎ ‎ ‎ ‎Delete Color 119‎ ‎ ‎ ‎=button(0) +#@gui :Color 119 Selected=_bool(0) +#@gui :Palette Color 120=color(#323558) +#@gui :‎ ‎ ‎ ‎Delete Color 120‎ ‎ ‎ ‎=button(0) +#@gui :Color 120 Selected=_bool(0) +#@gui :Palette Color 121=color(#edd493) +#@gui :‎ ‎ ‎ ‎Delete Color 121‎ ‎ ‎ ‎=button(0) +#@gui :Color 121 Selected=_bool(0) +#@gui :Palette Color 122=color(#edb67c) +#@gui :‎ ‎ ‎ ‎Delete Color 122‎ ‎ ‎ ‎=button(0) +#@gui :Color 122 Selected=_bool(0) +#@gui :Palette Color 123=color(#ce9770) +#@gui :‎ ‎ ‎ ‎Delete Color 123‎ ‎ ‎ ‎=button(0) +#@gui :Color 123 Selected=_bool(0) +#@gui :Palette Color 124=color(#bd7d64) +#@gui :‎ ‎ ‎ ‎Delete Color 124‎ ‎ ‎ ‎=button(0) +#@gui :Color 124 Selected=_bool(0) +#@gui :Palette Color 125=color(#a76057) +#@gui :‎ ‎ ‎ ‎Delete Color 125‎ ‎ ‎ ‎=button(0) +#@gui :Color 125 Selected=_bool(0) +#@gui :Palette Color 126=color(#904647) +#@gui :‎ ‎ ‎ ‎Delete Color 126‎ ‎ ‎ ‎=button(0) +#@gui :Color 126 Selected=_bool(0) +#@gui :Palette Color 127=color(#6e2434) +#@gui :‎ ‎ ‎ ‎Delete Color 127‎ ‎ ‎ ‎=button(0) +#@gui :Color 127 Selected=_bool(0) +#@gui :Palette Color 128=color(#5f0926) +#@gui :‎ ‎ ‎ ‎Delete Color 128‎ ‎ ‎ ‎=button(0) +#@gui :Color 128 Selected=_bool(0) +#@gui :Palette Color 129=color(#fbeaa3) +#@gui :‎ ‎ ‎ ‎Delete Color 129‎ ‎ ‎ ‎=button(0) +#@gui :Color 129 Selected=_bool(0) +#@gui :Palette Color 130=color(#e8cb82) +#@gui :‎ ‎ ‎ ‎Delete Color 130‎ ‎ ‎ ‎=button(0) +#@gui :Color 130 Selected=_bool(0) +#@gui :Palette Color 131=color(#cca96e) +#@gui :‎ ‎ ‎ ‎Delete Color 131‎ ‎ ‎ ‎=button(0) +#@gui :Color 131 Selected=_bool(0) +#@gui :Palette Color 132=color(#b29062) +#@gui :‎ ‎ ‎ ‎Delete Color 132‎ ‎ ‎ ‎=button(0) +#@gui :Color 132 Selected=_bool(0) +#@gui :Palette Color 133=color(#997951) +#@gui :‎ ‎ ‎ ‎Delete Color 133‎ ‎ ‎ ‎=button(0) +#@gui :Color 133 Selected=_bool(0) +#@gui :Palette Color 134=color(#7e6144) +#@gui :‎ ‎ ‎ ‎Delete Color 134‎ ‎ ‎ ‎=button(0) +#@gui :Color 134 Selected=_bool(0) +#@gui :Palette Color 135=color(#614a3c) +#@gui :‎ ‎ ‎ ‎Delete Color 135‎ ‎ ‎ ‎=button(0) +#@gui :Color 135 Selected=_bool(0) +#@gui :Palette Color 136=color(#453125) +#@gui :‎ ‎ ‎ ‎Delete Color 136‎ ‎ ‎ ‎=button(0) +#@gui :Color 136 Selected=_bool(0) +#@gui :Palette Color 137=color(#00deda) +#@gui :‎ ‎ ‎ ‎Delete Color 137‎ ‎ ‎ ‎=button(0) +#@gui :Color 137 Selected=_bool(0) +#@gui :Palette Color 138=color(#00bfa3) +#@gui :‎ ‎ ‎ ‎Delete Color 138‎ ‎ ‎ ‎=button(0) +#@gui :Color 138 Selected=_bool(0) +#@gui :Palette Color 139=color(#00a087) +#@gui :‎ ‎ ‎ ‎Delete Color 139‎ ‎ ‎ ‎=button(0) +#@gui :Color 139 Selected=_bool(0) +#@gui :Palette Color 140=color(#008279) +#@gui :‎ ‎ ‎ ‎Delete Color 140‎ ‎ ‎ ‎=button(0) +#@gui :Color 140 Selected=_bool(0) +#@gui :Palette Color 141=color(#006b6d) +#@gui :‎ ‎ ‎ ‎Delete Color 141‎ ‎ ‎ ‎=button(0) +#@gui :Color 141 Selected=_bool(0) +#@gui :Palette Color 142=color(#005162) +#@gui :‎ ‎ ‎ ‎Delete Color 142‎ ‎ ‎ ‎=button(0) +#@gui :Color 142 Selected=_bool(0) +#@gui :Palette Color 143=color(#004051) +#@gui :‎ ‎ ‎ ‎Delete Color 143‎ ‎ ‎ ‎=button(0) +#@gui :Color 143 Selected=_bool(0) +#@gui :Palette Color 144=color(#002e49) +#@gui :‎ ‎ ‎ ‎Delete Color 144‎ ‎ ‎ ‎=button(0) +#@gui :Color 144 Selected=_bool(0) +#@gui :Palette Color 145=color(#f8c6da) +#@gui :‎ ‎ ‎ ‎Delete Color 145‎ ‎ ‎ ‎=button(0) +#@gui :Color 145 Selected=_bool(0) +#@gui :Palette Color 146=color(#db99bf) +#@gui :‎ ‎ ‎ ‎Delete Color 146‎ ‎ ‎ ‎=button(0) +#@gui :Color 146 Selected=_bool(0) +#@gui :Palette Color 147=color(#c178aa) +#@gui :‎ ‎ ‎ ‎Delete Color 147‎ ‎ ‎ ‎=button(0) +#@gui :Color 147Selected=_bool(0) +#@gui :Palette Color 148=color(#b96d91) +#@gui :‎ ‎ ‎ ‎Delete Color 148‎ ‎ ‎ ‎=button(0) +#@gui :Color 148 Selected=_bool(0) +#@gui :Palette Color 149=color(#975475) +#@gui :‎ ‎ ‎ ‎Delete Color 149‎ ‎ ‎ ‎=button(0) +#@gui :Color 149 Selected=_bool(0) +#@gui :Palette Color 150=color(#663659) +#@gui :‎ ‎ ‎ ‎Delete Color 150‎ ‎ ‎ ‎=button(0) +#@gui :Color 150 Selected=_bool(0) +#@gui :Palette Color 151=color(#49283d) +#@gui :‎ ‎ ‎ ‎Delete Color 151‎ ‎ ‎ ‎=button(0) +#@gui :Color 151 Selected=_bool(0) +#@gui :Palette Color 152=color(#2e1026) +#@gui :‎ ‎ ‎ ‎Delete Color 152‎ ‎ ‎ ‎=button(0) +#@gui :Color 152 Selected=_bool(0) +#@gui :Palette Color 153=color(#ddbf9a) +#@gui :‎ ‎ ‎ ‎Delete Color 153‎ ‎ ‎ ‎=button(0) +#@gui :Color 153 Selected=_bool(0) +#@gui :Palette Color 154=color(#c0a588) +#@gui :‎ ‎ ‎ ‎Delete Color 154‎ ‎ ‎ ‎=button(0) +#@gui :Color 154 Selected=_bool(0) +#@gui :Palette Color 155=color(#9e8a6e) +#@gui :‎ ‎ ‎ ‎Delete Color 155‎ ‎ ‎ ‎=button(0) +#@gui :Color 155 Selected=_bool(0) +#@gui :Palette Color 156=color(#7e6c54) +#@gui :‎ ‎ ‎ ‎Delete Color 156‎ ‎ ‎ ‎=button(0) +#@gui :Color 156 Selected=_bool(0) +#@gui :Palette Color 157=color(#725a51) +#@gui :‎ ‎ ‎ ‎Delete Color 157‎ ‎ ‎ ‎=button(0) +#@gui :Color 157 Selected=_bool(0) +#@gui :Palette Color 158=color(#5e4646) +#@gui :‎ ‎ ‎ ‎Delete Color 158‎ ‎ ‎ ‎=button(0) +#@gui :Color 158 Selected=_bool(0) +#@gui :Palette Color 159=color(#4a353c) +#@gui :‎ ‎ ‎ ‎Delete Color 159‎ ‎ ‎ ‎=button(0) +#@gui :Color 159 Selected=_bool(0) +#@gui :Palette Color 160=color(#31222a) +#@gui :‎ ‎ ‎ ‎Delete Color 160‎ ‎ ‎ ‎=button(0) +#@gui :Color 160 Selected=_bool(0) +#@gui :Palette Color 161=color(#fffaab) +#@gui :‎ ‎ ‎ ‎Delete Color 161‎ ‎ ‎ ‎=button(0) +#@gui :Color 161 Selected=_bool(0) +#@gui :Palette Color 162=color(#ecc581) +#@gui :‎ ‎ ‎ ‎Delete Color 162‎ ‎ ‎ ‎=button(0) +#@gui :Color 162 Selected=_bool(0) +#@gui :Palette Color 163=color(#d89f75) +#@gui :‎ ‎ ‎ ‎Delete Color 163‎ ‎ ‎ ‎=button(0) +#@gui :Color 163 Selected=_bool(0) +#@gui :Palette Color 164=color(#c7826c) +#@gui :‎ ‎ ‎ ‎Delete Color 164‎ ‎ ‎ ‎=button(0) +#@gui :Color 164 Selected=_bool(0) +#@gui :Palette Color 165=color(#ae6b60) +#@gui :‎ ‎ ‎ ‎Delete Color 165‎ ‎ ‎ ‎=button(0) +#@gui :Color 165 Selected=_bool(0) +#@gui :Palette Color 166=color(#8a5258) +#@gui :‎ ‎ ‎ ‎Delete Color 166‎ ‎ ‎ ‎=button(0) +#@gui :Color 166 Selected=_bool(0) +#@gui :Palette Color 167=color(#5a3c45) +#@gui :‎ ‎ ‎ ‎Delete Color 167‎ ‎ ‎ ‎=button(0) +#@gui :Color 167 Selected=_bool(0) +#@gui :Palette Color 168=color(#3b303c) +#@gui :‎ ‎ ‎ ‎Delete Color 168‎ ‎ ‎ ‎=button(0) +#@gui :Color 168 Selected=_bool(0) +#@gui :Palette Color 169=color(#ebf0f6) +#@gui :‎ ‎ ‎ ‎Delete Color 169‎ ‎ ‎ ‎=button(0) +#@gui :Color 169 Selected=_bool(0) +#@gui :Palette Color 170=color(#bac7db) +#@gui :‎ ‎ ‎ ‎Delete Color 170‎ ‎ ‎ ‎=button(0) +#@gui :Color 170 Selected=_bool(0) +#@gui :Palette Color 171=color(#abaebe) +#@gui :‎ ‎ ‎ ‎Delete Color 171‎ ‎ ‎ ‎=button(0) +#@gui :Color 171 Selected=_bool(0) +#@gui :Palette Color 172=color(#848795) +#@gui :‎ ‎ ‎ ‎Delete Color 172‎ ‎ ‎ ‎=button(0) +#@gui :Color 172 Selected=_bool(0) +#@gui :Palette Color 173=color(#73737f) +#@gui :‎ ‎ ‎ ‎Delete Color 173‎ ‎ ‎ ‎=button(0) +#@gui :Color 173 Selected=_bool(0) +#@gui :Palette Color 174=color(#5b5c69) +#@gui :‎ ‎ ‎ ‎Delete Color 174‎ ‎ ‎ ‎=button(0) +#@gui :Color 174 Selected=_bool(0) +#@gui :Palette Color 175=color(#48474d) +#@gui :‎ ‎ ‎ ‎Delete Color 175‎ ‎ ‎ ‎=button(0) +#@gui :Color 175 Selected=_bool(0) +#@gui :Palette Color 176=color(#2d3136) +#@gui :‎ ‎ ‎ ‎Delete Color 176‎ ‎ ‎ ‎=button(0) +#@gui :Color 176 Selected=_bool(0) +#@gui :Palette Color 177=color(#ffdbff) +#@gui :‎ ‎ ‎ ‎Delete Color 177‎ ‎ ‎ ‎=button(0) +#@gui :Color 177 Selected=_bool(0) +#@gui :Palette Color 178=color(#ffbbc7) +#@gui :‎ ‎ ‎ ‎Delete Color 178‎ ‎ ‎ ‎=button(0) +#@gui :Color 178 Selected=_bool(0) +#@gui :Palette Color 179=color(#ff9ba8) +#@gui :‎ ‎ ‎ ‎Delete Color 179‎ ‎ ‎ ‎=button(0) +#@gui :Color 179 Selected=_bool(0) +#@gui :Palette Color 180=color(#ff7676) +#@gui :‎ ‎ ‎ ‎Delete Color 180‎ ‎ ‎ ‎=button(0) +#@gui :Color 180 Selected=_bool(0) +#@gui :Palette Color 181=color(#e45c5f) +#@gui :‎ ‎ ‎ ‎Delete Color 181‎ ‎ ‎ ‎=button(0) +#@gui :Color 181 Selected=_bool(0) +#@gui :Palette Color 182=color(#b63c35) +#@gui :‎ ‎ ‎ ‎Delete Color 182‎ ‎ ‎ ‎=button(0) +#@gui :Color 182 Selected=_bool(0) +#@gui :Palette Color 183=color(#82211d) +#@gui :‎ ‎ ‎ ‎Delete Color 183‎ ‎ ‎ ‎=button(0) +#@gui :Color 183 Selected=_bool(0) +#@gui :Palette Color 184=color(#5e0711) +#@gui :‎ ‎ ‎ ‎Delete Color 184‎ ‎ ‎ ‎=button(0) +#@gui :Color 184 Selected=_bool(0) +#@gui :Palette Color 185=color(#91daa1) +#@gui :‎ ‎ ‎ ‎Delete Color 185‎ ‎ ‎ ‎=button(0) +#@gui :Color 185 Selected=_bool(0) +#@gui :Palette Color 186=color(#55b67d) +#@gui :‎ ‎ ‎ ‎Delete Color 186‎ ‎ ‎ ‎=button(0) +#@gui :Color 186 Selected=_bool(0) +#@gui :Palette Color 187=color(#498960) +#@gui :‎ ‎ ‎ ‎Delete Color 187‎ ‎ ‎ ‎=button(0) +#@gui :Color 187 Selected=_bool(0) +#@gui :Palette Color 188=color(#417455) +#@gui :‎ ‎ ‎ ‎Delete Color 188‎ ‎ ‎ ‎=button(0) +#@gui :Color 188 Selected=_bool(0) +#@gui :Palette Color 189=color(#325c40) +#@gui :‎ ‎ ‎ ‎Delete Color 189‎ ‎ ‎ ‎=button(0) +#@gui :Color 189 Selected=_bool(0) +#@gui :Palette Color 190=color(#385140) +#@gui :‎ ‎ ‎ ‎Delete Color 190‎ ‎ ‎ ‎=button(0) +#@gui :Color 190 Selected=_bool(0) +#@gui :Palette Color 191=color(#2f3f38) +#@gui :‎ ‎ ‎ ‎Delete Color 191‎ ‎ ‎ ‎=button(0) +#@gui :Color 191 Selected=_bool(0) +#@gui :Palette Color 192=color(#1a332c) +#@gui :‎ ‎ ‎ ‎Delete Color 192‎ ‎ ‎ ‎=button(0) +#@gui :Color 192 Selected=_bool(0) +#@gui :Palette Color 193=color(#74f5fd) +#@gui :‎ ‎ ‎ ‎Delete Color 193‎ ‎ ‎ ‎=button(0) +#@gui :Color 193 Selected=_bool(0) +#@gui :Palette Color 194=color(#52d2ff) +#@gui :‎ ‎ ‎ ‎Delete Color 194‎ ‎ ‎ ‎=button(0) +#@gui :Color 194 Selected=_bool(0) +#@gui :Palette Color 195=color(#41b2e3) +#@gui :‎ ‎ ‎ ‎Delete Color 195‎ ‎ ‎ ‎=button(0) +#@gui :Color 195 Selected=_bool(0) +#@gui :Palette Color 196=color(#318eb8) +#@gui :‎ ‎ ‎ ‎Delete Color 196‎ ‎ ‎ ‎=button(0) +#@gui :Color 196 Selected=_bool(0) +#@gui :Palette Color 197=color(#366b8a) +#@gui :‎ ‎ ‎ ‎Delete Color 197‎ ‎ ‎ ‎=button(0) +#@gui :Color 197 Selected=_bool(0) +#@gui :Palette Color 198=color(#25466b) +#@gui :‎ ‎ ‎ ‎Delete Color 198‎ ‎ ‎ ‎=button(0) +#@gui :Color 198 Selected=_bool(0) +#@gui :Palette Color 199=color(#23324d) +#@gui :‎ ‎ ‎ ‎Delete Color 199‎ ‎ ‎ ‎=button(0) +#@gui :Color 199 Selected=_bool(0) +#@gui :Palette Color 200=color(#181f2f) +#@gui :‎ ‎ ‎ ‎Delete Color 200‎ ‎ ‎ ‎=button(0) +#@gui :Color 200 Selected=_bool(0) +#@gui :Palette Color 201=color(#a6cc34) +#@gui :‎ ‎ ‎ ‎Delete Color 201‎ ‎ ‎ ‎=button(0) +#@gui :Color 201 Selected=_bool(0) +#@gui :Palette Color 202=color(#7da42d) +#@gui :‎ ‎ ‎ ‎Delete Color 202‎ ‎ ‎ ‎=button(0) +#@gui :Color 202 Selected=_bool(0) +#@gui :Palette Color 203=color(#518822) +#@gui :‎ ‎ ‎ ‎Delete Color 203‎ ‎ ‎ ‎=button(0) +#@gui :Color 203 Selected=_bool(0) +#@gui :Palette Color 204=color(#2f690c) +#@gui :‎ ‎ ‎ ‎Delete Color 204‎ ‎ ‎ ‎=button(0) +#@gui :Color 204 Selected=_bool(0) +#@gui :Palette Color 205=color(#225918) +#@gui :‎ ‎ ‎ ‎Delete Color 205‎ ‎ ‎ ‎=button(0) +#@gui :Color 205 Selected=_bool(0) +#@gui :Palette Color 206=color(#174a1b) +#@gui :‎ ‎ ‎ ‎Delete Color 206‎ ‎ ‎ ‎=button(0) +#@gui :Color 206 Selected=_bool(0) +#@gui :Palette Color 207=color(#003221) +#@gui :‎ ‎ ‎ ‎Delete Color 207‎ ‎ ‎ ‎=button(0) +#@gui :Color 207 Selected=_bool(0) +#@gui :Palette Color 208=color(#002219) +#@gui :‎ ‎ ‎ ‎Delete Color 208‎ ‎ ‎ ‎=button(0) +#@gui :Color 208 Selected=_bool(0) +#@gui :Palette Color 209=color(#c6ecff) +#@gui :‎ ‎ ‎ ‎Delete Color 209‎ ‎ ‎ ‎=button(0) +#@gui :Color 209 Selected=_bool(0) +#@gui :Palette Color 210=color(#c7d6ff) +#@gui :‎ ‎ ‎ ‎Delete Color 210‎ ‎ ‎ ‎=button(0) +#@gui :Color 210 Selected=_bool(0) +#@gui :Palette Color 211=color(#96b2d9) +#@gui :‎ ‎ ‎ ‎Delete Color 211‎ ‎ ‎ ‎=button(0) +#@gui :Color 211 Selected=_bool(0) +#@gui :Palette Color 212=color(#8690b2) +#@gui :‎ ‎ ‎ ‎Delete Color 212‎ ‎ ‎ ‎=button(0) +#@gui :Color 212 Selected=_bool(0) +#@gui :Palette Color 213=color(#7a7799) +#@gui :‎ ‎ ‎ ‎Delete Color 213‎ ‎ ‎ ‎=button(0) +#@gui :Color 213 Selected=_bool(0) +#@gui :Palette Color 214=color(#615f84) +#@gui :‎ ‎ ‎ ‎Delete Color 214‎ ‎ ‎ ‎=button(0) +#@gui :Color 214 Selected=_bool(0) +#@gui :Palette Color 215=color(#3a4568) +#@gui :‎ ‎ ‎ ‎Delete Color 215‎ ‎ ‎ ‎=button(0) +#@gui :Color 215 Selected=_bool(0) +#@gui :Palette Color 216=color(#282b4a) +#@gui :‎ ‎ ‎ ‎Delete Color 216‎ ‎ ‎ ‎=button(0) +#@gui :Color 216 Selected=_bool(0) +#@gui :Palette Color 217=color(#ffe949) +#@gui :‎ ‎ ‎ ‎Delete Color 217‎ ‎ ‎ ‎=button(0) +#@gui :Color 217 Selected=_bool(0) +#@gui :Palette Color 218=color(#ffbc4e) +#@gui :‎ ‎ ‎ ‎Delete Color 218‎ ‎ ‎ ‎=button(0) +#@gui :Color 218 Selected=_bool(0) +#@gui :Palette Color 219=color(#f99b4e) +#@gui :‎ ‎ ‎ ‎Delete Color 219‎ ‎ ‎ ‎=button(0) +#@gui :Color 219 Selected=_bool(0) +#@gui :Palette Color 220=color(#e37840) +#@gui :‎ ‎ ‎ ‎Delete Color 220‎ ‎ ‎ ‎=button(0) +#@gui :Color 220 Selected=_bool(0) +#@gui :Palette Color 221=color(#cd5e46) +#@gui :‎ ‎ ‎ ‎Delete Color 221‎ ‎ ‎ ‎=button(0) +#@gui :Color 221 Selected=_bool(0) +#@gui :Palette Color 222=color(#b64d46) +#@gui :‎ ‎ ‎ ‎Delete Color 222‎ ‎ ‎ ‎=button(0) +#@gui :Color 222 Selected=_bool(0) +#@gui :Palette Color 223=color(#94363a) +#@gui :‎ ‎ ‎ ‎Delete Color 223‎ ‎ ‎ ‎=button(0) +#@gui :Color 223 Selected=_bool(0) +#@gui :Palette Color 224=color(#662b29) +#@gui :‎ ‎ ‎ ‎Delete Color 224‎ ‎ ‎ ‎=button(0) +#@gui :Color 224 Selected=_bool(0) +#@gui :Palette Color 225=color(#88d6ff) +#@gui :‎ ‎ ‎ ‎Delete Color 225‎ ‎ ‎ ‎=button(0) +#@gui :Color 225 Selected=_bool(0) +#@gui :Palette Color 226=color(#24aed6) +#@gui :‎ ‎ ‎ ‎Delete Color 226‎ ‎ ‎ ‎=button(0) +#@gui :Color 226 Selected=_bool(0) +#@gui :Palette Color 227=color(#328ca7) +#@gui :‎ ‎ ‎ ‎Delete Color 227‎ ‎ ‎ ‎=button(0) +#@gui :Color 227 Selected=_bool(0) +#@gui :Palette Color 228=color(#006f89) +#@gui :‎ ‎ ‎ ‎Delete Color 228‎ ‎ ‎ ‎=button(0) +#@gui :Color 228 Selected=_bool(0) +#@gui :Palette Color 229=color(#0b667f) +#@gui :‎ ‎ ‎ ‎Delete Color 229‎ ‎ ‎ ‎=button(0) +#@gui :Color 229 Selected=_bool(0) +#@gui :Palette Color 230=color(#004d5e) +#@gui :‎ ‎ ‎ ‎Delete Color 230‎ ‎ ‎ ‎=button(0) +#@gui :Color 230 Selected=_bool(0) +#@gui :Palette Color 231=color(#003850) +#@gui :‎ ‎ ‎ ‎Delete Color 231‎ ‎ ‎ ‎=button(0) +#@gui :Color 231 Selected=_bool(0) +#@gui :Palette Color 232=color(#002735) +#@gui :‎ ‎ ‎ ‎Delete Color 232‎ ‎ ‎ ‎=button(0) +#@gui :Color 232 Selected=_bool(0) +#@gui :Palette Color 233=color(#ffce7f) +#@gui :‎ ‎ ‎ ‎Delete Color 233‎ ‎ ‎ ‎=button(0) +#@gui :Color 233 Selected=_bool(0) +#@gui :Palette Color 234=color(#fbaa84) +#@gui :‎ ‎ ‎ ‎Delete Color 234‎ ‎ ‎ ‎=button(0) +#@gui :Color 234 Selected=_bool(0) +#@gui :Palette Color 235=color(#d58d6b) +#@gui :‎ ‎ ‎ ‎Delete Color 235‎ ‎ ‎ ‎=button(0) +#@gui :Color 235 Selected=_bool(0) +#@gui :Palette Color 236=color(#ad6e51) +#@gui :‎ ‎ ‎ ‎Delete Color 236‎ ‎ ‎ ‎=button(0) +#@gui :Color 236 Selected=_bool(0) +#@gui :Palette Color 237=color(#9a624c) +#@gui :‎ ‎ ‎ ‎Delete Color 237‎ ‎ ‎ ‎=button(0) +#@gui :Color 237 Selected=_bool(0) +#@gui :Palette Color 238=color(#885041) +#@gui :‎ ‎ ‎ ‎Delete Color 238‎ ‎ ‎ ‎=button(0) +#@gui :Color 238 Selected=_bool(0) +#@gui :Palette Color 239=color(#733d3b) +#@gui :‎ ‎ ‎ ‎Delete Color 239‎ ‎ ‎ ‎=button(0) +#@gui :Color 239 Selected=_bool(0) +#@gui :Palette Color 240=color(#583126) +#@gui :‎ ‎ ‎ ‎Delete Color 240‎ ‎ ‎ ‎=button(0) +#@gui :Color 240 Selected=_bool(0) +#@gui :Palette Color 241=color(#fff3d6) +#@gui :‎ ‎ ‎ ‎Delete Color 241‎ ‎ ‎ ‎=button(0) +#@gui :Color 241 Selected=_bool(0) +#@gui :Palette Color 242=color(#eadbc9) +#@gui :‎ ‎ ‎ ‎Delete Color 242‎ ‎ ‎ ‎=button(0) +#@gui :Color 242 Selected=_bool(0) +#@gui :Palette Color 243=color(#ccc3b1) +#@gui :‎ ‎ ‎ ‎Delete Color 243‎ ‎ ‎ ‎=button(0) +#@gui :Color 243 Selected=_bool(0) +#@gui :Palette Color 244=color(#bbafa4) +#@gui :‎ ‎ ‎ ‎Delete Color 244‎ ‎ ‎ ‎=button(0) +#@gui :Color 244 Selected=_bool(0) +#@gui :Palette Color 245=color(#aea189) +#@gui :‎ ‎ ‎ ‎Delete Color 245‎ ‎ ‎ ‎=button(0) +#@gui :Color 245 Selected=_bool(0) +#@gui :Palette Color 246=color(#9e8c79) +#@gui :‎ ‎ ‎ ‎Delete Color 246‎ ‎ ‎ ‎=button(0) +#@gui :Color 246 Selected=_bool(0) +#@gui :Palette Color 247=color(#857565) +#@gui :‎ ‎ ‎ ‎Delete Color 247‎ ‎ ‎ ‎=button(0) +#@gui :Color 247 Selected=_bool(0) +#@gui :Palette Color 248=color(#625d54) +#@gui :‎ ‎ ‎ ‎Delete Color 248‎ ‎ ‎ ‎=button(0) +#@gui :Color 248 Selected=_bool(0) +#@gui :Palette Color 249=color(#f5f7fa) +#@gui :‎ ‎ ‎ ‎Delete Color 249‎ ‎ ‎ ‎=button(0) +#@gui :Color 249 Selected=_bool(0) +#@gui :Palette Color 250=color(#cdd2da) +#@gui :‎ ‎ ‎ ‎Delete Color 250‎ ‎ ‎ ‎=button(0) +#@gui :Color 250 Selected=_bool(0) +#@gui :Palette Color 251=color(#a6aeba) +#@gui :‎ ‎ ‎ ‎Delete Color 251‎ ‎ ‎ ‎=button(0) +#@gui :Color 251 Selected=_bool(0) +#@gui :Palette Color 252=color(#828b98) +#@gui :‎ ‎ ‎ ‎Delete Color 252‎ ‎ ‎ ‎=button(0) +#@gui :Color 252 Selected=_bool(0) +#@gui :Palette Color 253=color(#626871) +#@gui :‎ ‎ ‎ ‎Delete Color 253‎ ‎ ‎ ‎=button(0) +#@gui :Color 253 Selected=_bool(0) +#@gui :Palette Color 254=color(#434549) +#@gui :‎ ‎ ‎ ‎Delete Color 254‎ ‎ ‎ ‎=button(0) +#@gui :Color 254 Selected=_bool(0) +#@gui :Palette Color 255=color(#222323) +#@gui :‎ ‎ ‎ ‎Delete Color 255‎ ‎ ‎ ‎=button(0) +#@gui :Color 255 Selected=_bool(0) +#@gui :Palette Color 256=color(#000000) +#@gui :‎ ‎ ‎ ‎Delete Color 256‎ ‎ ‎ ‎=button(0) +#@gui :Color 256 Selected=_bool(0) +#@gui :_=separator() +#@gui :‎ ‎ ‎ Add Palette Color‎ ‎ ‎ ‎‎=button(0) +#@gui :Delete All Selected Palette=button(0) +#@gui :_=separator() +#@gui :_=note("RGB Output") +#@gui :Pixel Width=int(1,1,8) +#@gui :Pixel Height=int(1,1,8) +#@gui :Windows Width=int(1,1,128) +#@gui :Use Image Width as Windows Width=bool(0) +#@gui :Windows Height=int(1,1,128) +#@gui :Use Image Height as Windows Height=bool(0) +#@gui :Threshold Map Iteration=int(3,1,6) +#@gui :_=separator() +#@gui :_=note("Alpha Output") +#@gui :Enable Alpha Processing=bool(0) +#@gui :Number of Alpha=int(2,2,256) +#@gui :Alpha Dithering (%)=float(50,0,100) +#@gui :Alpha Mode=choice(0,"Indexed","Windows-Based Indexing","Ordered") +#@gui :Alpha Mode=choice(0,"Indexed","Ordered") +#@gui :Alpha Restriction=int(0,0,128) +#@gui :Alpha Threshold Map Iteration=int(3,1,6) +#@gui :_=note("If this section is empty, it is because there is no alpha on any images.") +#@gui :_=separator() +#@gui :_=note("CLI Command") +#@gui :CLI Version=_text("Here is where you copy command to command line interface.") +#@gui :Import Palette File=file()_0 +#@gui :Imported=bool(0)_0 +#@gui :_=note("Note: Here is where you copy command to command line interface. ") +#@gui :_=separator() +#@gui :_=note("Post-Processing") +#@gui :Crop to Original Dimension=bool(1) +#@gui :Message Out=text("Initialized GUI Filter!") +#@gui :Status=int(0,0,3)_0 +#@gui :Color Status=color(#ffffff) +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2023/9/11.") +#@gui Trigonometry Mapping:fx_rep_tg3,fx_rep_tg3_preview(0) +#@gui :_=note("Processing) +#@gui :Colour Space=choice(0,"RGB-8","RYB-8","CMY-8","HSI-8","HSL-8","HSV-8","LAB-8","LCH-8","YIQ-8","YUV-8","XYZ-8","YES-8","OHTA-8","Kodak 1-8") +#@gui :Mode=choice(0,"Direct Trig-3","Luminosity to Trig-3") +#@gui :Preserve Luminosity=bool(1) +#@gui :_=separator() +#@gui :_=note("Mapping) +#@gui :Channel Order=choice(0,"First-Second-Third","First-Third-Second","Second-First-Third","Second-Third-First","Third-First-Second","Third-Second-Third") +#@gui :Channel=choice(0,"First","Second","Third") +#@gui :Channel=choice(0,"First","Third","Second") +#@gui :Channel=choice(0,"Second","First","Third") +#@gui :Channel=choice(0,"Second","Third","First") +#@gui :Channel=choice(0,"Third","First","Second") +#@gui :Channel=choice(0,"Third","Second","First") +#@gui :Formula=choice(0,"Sinusoidal","Cosinusodial","Cubic Sinusoidal","Cubic Cosinusodial","Cubic Sinusoidal-Cosinusodial") +#@gui :Multiplier=float(1,.1,5) +#@gui :Value Shift=float(0,-1,1) +#@gui :Midgray Exponential Factor=float(1,.01,2) +#@gui :Lightness Merge Factor=float(1,0,1) +#@gui :Lightness Exponential Factor=float(1,.01,5) +#@gui :End Value to Base Factor=float(1,0,1) +#@gui :Formula=choice(0,"Sinusoidal","Cosinusodial","Cubic Sinusoidal","Cubic Cosinusodial","Cubic Sinusoidal-Cosinusodial") +#@gui :Multiplier=float(1,.1,5) +#@gui :Value Shift=float(0,-1,1) +#@gui :Midgray Exponential Factor=float(1,.01,2) +#@gui :Lightness Merge Factor=float(1,0,1) +#@gui :Lightness Exponential Factor=float(1,.01,5) +#@gui :End Value to Base Factor=float(1,0,1) +#@gui :Formula=choice(0,"Sinusoidal","Cosinusodial","Cubic Sinusoidal","Cubic Cosinusodial","Cubic Sinusoidal-Cosinusodial") +#@gui :Multiplier=float(1,.1,5) +#@gui :Value Shift=float(0,-1,1) +#@gui :Midgray Exponential Factor=float(1,.01,2) +#@gui :Lightness Merge Factor=float(1,0,1) +#@gui :Lightness Exponential Factor=float(1,.01,5) +#@gui :End Value to Base Factor=float(1,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2020/8/9.") +#@gui Tupper's Self-Referential Formula:fx_rep_self_referential_formula,fx_rep_self_referential_formula_preview(1)* +#@gui :_=note("This filter is to be seen as a showcase filter.\n\nNote - To get the most feature of this filter, you must use a single image of size 106x17.\n\nWarning! - Do not use on images that are not much larger than 106x17. Due to the lack of BIGINT support inside G'MIC, the implementation is quite slow.") +#@gui :_=separator() +#@gui :_=note("Main") +#@gui :Mode=choice(1,"Generate Image from K","Find K from Images") +#@gui :Mode=choice(1,"Generate Image from K","Find K from Images")_0 +#@gui :K Input=choice(0,"User","Tupper's Self-Referential Formula","Euler's Identity","Pacman","Sick App Bro! - Daves") +#@gui :K Input=choice(0,"User","Tupper's Self-Referential Formula","Euler's Identity","Pacman","Sick App Bro! - Daves")_0 +#@gui :K Value=text(1,"0") +#@gui :K Value=text("0")_0 +#@gui :Predefined K Value=text(1,"0") +#@gui :Predefined K Value=text("0")_0 +#@gui :Copy from Stored K Value=button() +#@gui :Negate After Using K-Input Result?=bool(1) +#@gui :Negate After Using K-Input Result?=bool(1)_0 +#@gui :K Values from Image(s)=text(1,"1") +#@gui :Stored K Value(s) from Images=text(1,"1")_0 +#@gui :Pre-Negation?=bool(1) +#@gui :Pre-Negation?=bool(1)_0 +#@gui :Allow Examples=bool(1)_0 +#@gui :Allow Mode Switch?=bool(1)_0 +#@gui :Started=bool(0)_0 +#@gui :_=separator() +#@gui :_=note("Details") +#@gui :_=note("Tupper's Self Referential Formula refers to a formula which refers to itself when a specific value is assigned. This was founded by Jeff Tupper.\n\nK Values for pre-defined K Inputs are based from Tupper's Self-Referential Formula Playground and Tupper Paper by Margaret Fortman.") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2023/01/19.") +#@gui Vibrance [YCH]:fx_rep_vibrance_ych,fx_rep_vibrance_ych_preview +#@gui :Vibrance(%)=float(30,-100,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2022/07/05.") +#@gui Vibrato:fx_vibrato,_fx_vibrato_preview(0) +#@gui :_=note("This is the advanced version of the Vibrato filter. If you do want to manipulate multiple channels at once, use Vibrato - Basic filter. Note: Disable channel mulplication for non-transparent images. \n\n") +#@gui :_=note("This filter is the one of the G'MIC version of MadJik's Paint.NET plugin") +#@gui :_=separator() +#@gui :Colour Space=choice("RGB","CMY","HSI","HSL","HSV","LAB","LCH","YCbCr","YCbCr-Glic","YUV","YIQ","XYZ","Bayer") +#@gui :_=separator() +#@gui :Manipulate Multiple Channels at Once?=bool(1) +#@gui :Process Channel 1?=bool(1) +#@gui :Process Channel 2?=bool(1) +#@gui :Process Channel 3?=bool(1) +#@gui :Process Alpha Channel?=bool(1) +#@gui :Inherit Alpha?=bool(1) +#@gui :X-Orientation=bool(1) +#@gui :Y-Orientation=bool(1) +#@gui :U- Factor=float(.85,.1,15) +#@gui :V- Factor=float(.85,.1,15) +#@gui :X-Scale Factor=float(1,.1,15) +#@gui :Y-Scale Factor=float(1,.1,15) +#@gui :XY-Scale Factor=float(1,.1,3) +#@gui :Percentage-Based X Pixel Shift=float(0,-200,200) +#@gui :Percentage-Based Y Pixel Shift=float(0,-200,200) +#@gui :Elevation=float(.7,-100,100) +#@gui :Multiply Blending=bool(0) +#@gui :Invert Vibrato=bool(0) +#@gui :Vibrato Blending Factor=float(100,0,100) +#@gui :Channel Influence Factor=float(1,-8,8) +#@gui :Final Channel Modulos Multiplication Factor=float(1,1,32) +#@gui :_=separator() +#@gui :_=note("- Channel #1 - ") +#@gui :Process Channel?=bool(1) +#@gui :X-Orientation=bool(1) +#@gui :Y-Orientation=bool(1) +#@gui :U-Factor=float(.85,.1,15) +#@gui :V-Factor=float(.85,.1,15) +#@gui :X-Scale Factor=float(1,.1,15) +#@gui :Y-Scale Factor=float(1,.1,15) +#@gui :XY-Scale Factor=float(1,.1,3) +#@gui :Percentage-Based X Pixel Shift=float(0,-200,200) +#@gui :Percentage-Based Y Pixel Shift=float(0,-200,200) +#@gui :Elevation=float(.7,-100,100) +#@gui :Multiply Blending=bool(0) +#@gui :Invert Vibrato=bool(0) +#@gui :Vibrato Blending Factor=float(100,0,100) +#@gui :Channel Influence Factor=float(1,-8,8) +#@gui :Final Channel Modulos Multiplication Factor=float(1,1,32) +#@gui :_=separator() +#@gui :_=note("- Channel #2 - ") +#@gui :Process Channel?=bool(1) +#@gui :X-Orientation=bool(1) +#@gui :Y-Orientation=bool(1) +#@gui :U-Factor=float(.85,.1,15) +#@gui :V-Factor=float(.85,.1,15) +#@gui :X-Scale Factor=float(1,.1,15) +#@gui :Y-Scale Factor=float(1,.1,15) +#@gui :XY-Scale Factor=float(1,.1,3) +#@gui :Percentage-Based X Pixel Shift=float(0,-200,200) +#@gui :Percentage-Based Y Pixel Shift=float(0,-200,200) +#@gui :Elevation=float(.7,-100,100) +#@gui :Multiply Blending=bool(0) +#@gui :Invert Vibrato=bool(0) +#@gui :Vibrato Blending Factor=float(100,0,100) +#@gui :Channel Influence Factor=float(1,-8,8) +#@gui :Final Channel Modulos Multiplication Factor=float(1,1,32) +#@gui :_=separator() +#@gui :_=note("- Channel #3 - ") +#@gui :Process Channel?=bool(1) +#@gui :X-Orientation=bool(1) +#@gui :Y-Orientation=bool(1) +#@gui :U-Factor=float(.85,.1,15) +#@gui :V-Factor=float(.85,.1,15) +#@gui :X-Scale Factor=float(1,.1,15) +#@gui :Y-Scale Factor=float(1,.1,15) +#@gui :XY-Scale Factor=float(1,.1,3) +#@gui :Percentage-Based X Pixel Shift=float(0,-200,200) +#@gui :Percentage-Based Y Pixel Shift=float(0,-200,200) +#@gui :Elevation=float(.7,-100,100) +#@gui :Multiply Blending=bool(0) +#@gui :Invert Vibrato=bool(0) +#@gui :Vibrato Blending Factor=float(100,0,100) +#@gui :Channel Influence Factor=float(1,-8,8) +#@gui :Final Channel Modulos Multiplication Factor=float(1,1,32) +#@gui :_=separator() +#@gui :_=note("- Alpha Channel #1 - ") +#@gui :Process Channel?=bool(0) +#@gui :X-Orientation=bool(1) +#@gui :Y-Orientation=bool(1) +#@gui :U-Factor=float(.85,.1,15) +#@gui :V-Factor=float(.85,.1,15) +#@gui :X-Scale Factor=float(1,.1,15) +#@gui :Y-Scale Factor=float(1,.1,15) +#@gui :XY-Scale Factor=float(1,.1,3) +#@gui :Percentage-Based X Pixel Shift=float(0,-200,200) +#@gui :Percentage-Based Y Pixel Shift=float(0,-200,200) +#@gui :Elevation=float(.7,-100,100) +#@gui :Multiply Blending=bool(1) +#@gui :Invert Vibrato=bool(0) +#@gui :Vibrato Blending Factor=float(100,0,100) +#@gui :Channel Influence Factor=float(1,-8,8) +#@gui :Final Channel Modulos Multiplication Factor=float(1,1,32) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Reptorian Latest update: 2018/12/19.") +#@gui Weighted RGB To Grayscale:fx_rep_w_rgb82gray,fx_rep_w_rgb82gray_preview(0) +#@gui :_=note("Weigh the R-G-B Channel, and then output based on their weight") +#@gui :_=separator() +#@gui :_=note("Main RGB to Grayscale") +#@gui :Red Weight(%)=float(33.33,0,100) +#@gui :Green Weight(%)=float(33.33,0,100) +#@gui :Blue Weight(%)=float(33.33,0,100) +#@gui :Use Weighted Ratio?=bool(1) +#@gui :_=separator() +#@gui :_=note("Min-Max Value") +#@gui :Min Value Weight(%)=float(0,0,100) +#@gui :Max Value Weight(%)=float(0,0,100) +#@gui :Min-Max Interpolation=float(0,0,1) +#@gui :_=separator() +#@gui :_=note("Post-Process Adjustment") +#@gui :Value Shift=float(0,-128,128) +#@gui :Midgray Shift=float(0,-1,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2021/6/25.") +#@gui Z-Time:rep_z_render : * +#@gui :_=note("Z-Time Rendering is a filter that utilize the value of a layer to represent the frame where frames are interpolated and normalized to the value of that layer. In other word, the reference layer can be seen as a representative of time.Note:Try to use a gradient for top or bottom layer depending on option you use.\n\nZ-Depth Values is recommended to be altered when using float image as reference. Use values less than 255 in order to posterize.\n\nThis filter do not work with Paint.NET as you need 3 images!") +#@gui :_=separator() +#@gui :Layer to Use as Time Reference?=choice(0,"Top Layer","Bottom Layer") +#@gui :Z-Depth Values=int(255,3,1024) +#@gui :Mirror Frame Ordering?=bool(0) +#@gui :Separate Time by Channels?=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: Reptorian. Latest Update: 2019/10/13.") +#@gui _RL +#@gui Plasma Transition:plasma_transition,plasma_transition +#@gui :Balance=float(0.5,0,1) +#@gui :Scale=int(5,0,50) +#@gui :Smoothness=float(1,0,10) +#@gui :Random Initialization=int(42,1,100) +#@gui :_=separator() +#@gui :_=note("Authors: Jean-Baptiste Rolland, Julien Levillain. Latest update: 2013/28/03.") +#@gui RandomWaves:randomwaves,randomwaves +#@gui :Steps Number=int(84,1,1000) +#@gui :Probability of Impulse (% / Step)=float(80.,1.,100.) +#@gui :Lessening=float(1.2,0.01,10.) +#@gui :Random Initialization=int(42,1,100) +#@gui :_=separator() +#@gui :_=note("Authors: Jean-Baptiste Rolland, Julien Levillain. Latest update: 2013/28/03.") +#@gui _Ronounours +#@gui Auto-Adjust Orientation:fx_adjust_orientation,fx_adjust_orientation(1) +#@gui :Threshold=float(5,0,100) +#@gui Blur [Quad]:fx_blur_quad,fx_blur_quad_preview +#@gui :_=note("Blur parameters:") +#@gui :1st Amplitude (%)=float(0,0,100) +#@gui :2nd Amplitude (%)=float(5,0,100) +#@gui :Brightness (%)=float(0,-100,100) +#@gui :Contrast (%)=float(0,-100,100) +#@gui :Gamma (%)=float(0,-100,100) +#@gui :Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacity (%)=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("Quad coordinates:") +#@gui :P0=point(40,25,0,1) +#@gui :P1=point(60,25,0,1) +#@gui :P2=point(95,90,0,1) +#@gui :P3=point(5,90,0,1) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2021/01/18.") +#@gui Curves:fx_apply_curve,fx_apply_curve_preview +#@gui :Starting Y=int(0,0,255) +#@gui :_=separator() +#@gui :X-Coord(1)=int(-1,-1,255) +#@gui :Y-Coord(1)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(2)=int(-1,-1,255) +#@gui :Y-Coord(2)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(3)=int(-1,-1,255) +#@gui :Y-Coord(3)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(4)=int(-1,-1,255) +#@gui :Y-Coord(4)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(5)=int(-1,-1,255) +#@gui :Y-Coord(5)=int(128,0,255) +#@gui :_=separator() +#@gui :Ending Y=int(255,0,255) +#@gui :_=separator() +#@gui :Curve Smoothness=float(1,0,1) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :Display Histogram=float(0,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui Curves [Lab] +#@gui A-Color:fx_apply_Labcurve,fx_apply_acurve_preview +#@gui :Starting Y=int(0,0,255) +#@gui :_=separator() +#@gui :X-Coord(1)=int(-1,-1,255) +#@gui :Y-Coord(1)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(2)=int(-1,-1,255) +#@gui :Y-Coord(2)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(3)=int(-1,-1,255) +#@gui :Y-Coord(3)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(4)=int(-1,-1,255) +#@gui :Y-Coord(4)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(5)=int(-1,-1,255) +#@gui :Y-Coord(5)=int(128,0,255) +#@gui :_=separator() +#@gui :Ending Y=int(255,0,255) +#@gui :_=separator() +#@gui :Curve Smoothness=float(1,0,1) +#@gui :Display Histogram=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui B-Color:fx_apply_Labcurve,fx_apply_bcurve_preview +#@gui :Starting Y=int(0,0,255) +#@gui :_=separator() +#@gui :X-Coord(1)=int(-1,-1,255) +#@gui :Y-Coord(1)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(2)=int(-1,-1,255) +#@gui :Y-Coord(2)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(3)=int(-1,-1,255) +#@gui :Y-Coord(3)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(4)=int(-1,-1,255) +#@gui :Y-Coord(4)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(5)=int(-1,-1,255) +#@gui :Y-Coord(5)=int(128,0,255) +#@gui :_=separator() +#@gui :Ending Y=int(255,0,255) +#@gui :_=separator() +#@gui :Curve Smoothness=float(1,0,1) +#@gui :Display Histogram=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui Lightness:fx_apply_Labcurve,fx_apply_Lcurve_preview +#@gui :Starting Y=int(0,0,255) +#@gui :_=separator() +#@gui :X-Coord(1)=int(-1,-1,255) +#@gui :Y-Coord(1)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(2)=int(-1,-1,255) +#@gui :Y-Coord(2)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(3)=int(-1,-1,255) +#@gui :Y-Coord(3)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(4)=int(-1,-1,255) +#@gui :Y-Coord(4)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(5)=int(-1,-1,255) +#@gui :Y-Coord(5)=int(128,0,255) +#@gui :_=separator() +#@gui :Ending Y=int(255,0,255) +#@gui :_=separator() +#@gui :Curve Smoothness=float(1,0,1) +#@gui :Display Histogram=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui _Curves [RGB] +#@gui Blue:fx_apply_RGBcurve,fx_apply_Bcurve_preview +#@gui :Starting Y=int(0,0,255) +#@gui :_=separator() +#@gui :X-Coord(1)=int(-1,-1,255) +#@gui :Y-Coord(1)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(2)=int(-1,-1,255) +#@gui :Y-Coord(2)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(3)=int(-1,-1,255) +#@gui :Y-Coord(3)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(4)=int(-1,-1,255) +#@gui :Y-Coord(4)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(5)=int(-1,-1,255) +#@gui :Y-Coord(5)=int(128,0,255) +#@gui :_=separator() +#@gui :Ending Y=int(255,0,255) +#@gui :_=separator() +#@gui :Curve Smoothness=float(1,0,1) +#@gui :Display Histogram=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui Green:fx_apply_RGBcurve,fx_apply_Gcurve_preview +#@gui :Starting Y=int(0,0,255) +#@gui :_=separator() +#@gui :X-Coord(1)=int(-1,-1,255) +#@gui :Y-Coord(1)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(2)=int(-1,-1,255) +#@gui :Y-Coord(2)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(3)=int(-1,-1,255) +#@gui :Y-Coord(3)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(4)=int(-1,-1,255) +#@gui :Y-Coord(4)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(5)=int(-1,-1,255) +#@gui :Y-Coord(5)=int(128,0,255) +#@gui :_=separator() +#@gui :Ending Y=int(255,0,255) +#@gui :_=separator() +#@gui :Curve Smoothness=float(1,0,1) +#@gui :Display Histogram=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui Red:fx_apply_RGBcurve,fx_apply_Rcurve_preview +#@gui :Starting Y=int(0,0,255) +#@gui :_=separator() +#@gui :X-Coord(1)=int(-1,-1,255) +#@gui :Y-Coord(1)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(2)=int(-1,-1,255) +#@gui :Y-Coord(2)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(3)=int(-1,-1,255) +#@gui :Y-Coord(3)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(4)=int(-1,-1,255) +#@gui :Y-Coord(4)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(5)=int(-1,-1,255) +#@gui :Y-Coord(5)=int(128,0,255) +#@gui :_=separator() +#@gui :Ending Y=int(255,0,255) +#@gui :_=separator() +#@gui :Curve Smoothness=float(1,0,1) +#@gui :Display Histogram=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui _Curves [YCbCr] +#@gui Blue Chrominance:fx_apply_YCbCrcurve,fx_apply_Cbcurve_preview +#@gui :Starting Y=int(0,0,255) +#@gui :_=separator() +#@gui :X-Coord(1)=int(-1,-1,255) +#@gui :Y-Coord(1)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(2)=int(-1,-1,255) +#@gui :Y-Coord(2)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(3)=int(-1,-1,255) +#@gui :Y-Coord(3)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(4)=int(-1,-1,255) +#@gui :Y-Coord(4)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(5)=int(-1,-1,255) +#@gui :Y-Coord(5)=int(128,0,255) +#@gui :_=separator() +#@gui :Ending Y=int(255,0,255) +#@gui :_=separator() +#@gui :Curve Smoothness=float(1,0,1) +#@gui :Display Histogram=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui Luminance:fx_apply_YCbCrcurve,fx_apply_Ycurve_preview +#@gui :Starting Y=int(0,0,255) +#@gui :_=separator() +#@gui :X-Coord(1)=int(-1,-1,255) +#@gui :Y-Coord(1)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(2)=int(-1,-1,255) +#@gui :Y-Coord(2)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(3)=int(-1,-1,255) +#@gui :Y-Coord(3)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(4)=int(-1,-1,255) +#@gui :Y-Coord(4)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(5)=int(-1,-1,255) +#@gui :Y-Coord(5)=int(128,0,255) +#@gui :_=separator() +#@gui :Ending Y=int(255,0,255) +#@gui :_=separator() +#@gui :Curve Smoothness=float(1,0,1) +#@gui :Display Histogram=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui Red Chrominance:fx_apply_YCbCrcurve,fx_apply_Crcurve_preview +#@gui :Starting Y=int(0,0,255) +#@gui :_=separator() +#@gui :X-Coord(1)=int(-1,-1,255) +#@gui :Y-Coord(1)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(2)=int(-1,-1,255) +#@gui :Y-Coord(2)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(3)=int(-1,-1,255) +#@gui :Y-Coord(3)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(4)=int(-1,-1,255) +#@gui :Y-Coord(4)=int(128,0,255) +#@gui :_=separator() +#@gui :X-Coord(5)=int(-1,-1,255) +#@gui :Y-Coord(5)=int(128,0,255) +#@gui :_=separator() +#@gui :Ending Y=int(255,0,255) +#@gui :_=separator() +#@gui :Curve Smoothness=float(1,0,1) +#@gui :Display Histogram=float(0,0,100) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/29/12.") +#@gui _ +#@gui Faded Mirror:fx_faded_mirror,fx_faded_mirror(1) +#@gui :Axis=choice("X-Axis","Y-Axis") +#@gui :Fading=float(10,0,100) +#@gui :Overlapping=float(10,0,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2013/29/05.") +#@gui Frame [Round] Old:fx_frame_round_old,fx_frame_round_old(1) +#@gui :Sharpness=float(6,0.1,40) +#@gui :Size (%)=float(20,0,100) +#@gui :Smoothness=float(0.1,0,15) +#@gui :Shade=float(0,0,1) +#@gui :Color=color(#ffffffff) +#@gui :Blur Frame=float(0,0,100) +#@gui :Blur Shade=float(0.1,0,1) +#@gui :Blur Amplitude=float(3,0,10) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest Update: 2010/29/12.") +#@gui GAAP Test:gaap_test,gaap_test +#@gui :Sigma=float(0,0,100) +#@gui :Color=color(#000000) +#@gui Graduated Color Accent:fx_gca,fx_gca_preview +#@gui :Reference Color=color(#ffffff) +#@gui :Amplitude=float(1,0,5) +#@gui :Max Value=choice("From Input","From Reference Color","Maximum Allowed") +#@gui :Channel=choice(0,"Saturation","Lightness") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2015/15/07.") +#@gui Grain [Old]:fx_grain,fx_grain_preview(0) +#@gui :Amplitude=float(40,0,512) +#@gui :Tone Smoothness=float(5,0,15) +#@gui :Grain Type=choice("Gaussian","Uniform") +#@gui :Channel(s)=choice(2,"All","RGBA","RGB","Luminance","Blue/red Chrominances","Blue Chrominance","Red Chrominance","Lightness","Ab-Components","A-Component","B-Component","Hue","Saturation","Value","Key","Green Chrominance","Ch-Components","C-Component","H-Component","Red","Green","Blue","Alpha") +#@gui :_=separator() +#@gui :_=note("Shadows:") +#@gui :Strength=float(0.8,0,1) +#@gui :Scale=float(0.5,0,2) +#@gui :Channel Correlation=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Mid-tones:") +#@gui :Strength=float(1,0,1) +#@gui :Scale=float(0,0,2) +#@gui :Channel Correlation=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("Highlights:") +#@gui :Strength=float(0.6,0,1) +#@gui :Scale=float(0.2,0,2) +#@gui :Channel Correlation=float(0.5,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2013/21/11.") +#@gui Krita Helper:fx_krita,fx_krita +#@gui Layer Info:gui_layer_info,gui_layer_info_preview +#@gui :Number of Output Layers for Each Input Layer=int(1,1,5) +#@gui :_=note("Note: This filter displays layer info on each layer.") +#@gui Perspective Scale:fx_perspective_scale,fx_perspective_scale_preview(1) +#@gui :Iterations=int(2,2,10) +#@gui :Factor=float(75,0,100) +#@gui :X-Offset=float(0,-100,100) +#@gui :Y-Offset=float(0,-100,100) +#@gui :Output Mode=_choice("Single Layer","Multiple Layers") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2013/08/02.") +#@gui Shaded Segmentation:dt_segment_shaded,dt_segment_shaded(0) +#@gui :Density=float(1,0,3) +#@gui :Shading=float(0.7,0,2) +#@gui :Smoothness=float(1,0,10) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2013/01/02.") +#@gui _Samj +#@gui About:_none_,samj_about +#@gui :_=note("Informations - Compilations :) +#@gui :_=link("http://www.aljacom.com/~gmic/","http://www.aljacom.com/~gmic/") +#@gui :_=link("http://samjcreations.blogspot.ca/","http://samjcreations.blogspot.ca/") +#@gui :_=note("Filtres :) +#@gui :_=link("https://github.com/GreycLab/gmic-community","https://github.com/GreycLab/gmic-community") +#@gui :_=note("Les filtres contenus dans ce répertoire sont majoritairement traduits en français et/ou en cours de développement.") +#@gui :_=note("The filters included in this directory are mostly translated into French and/or experimental.") +#@gui :_=note("Nettoyage du code/Cleaning the code :) +#@gui :_=note("Thank RepTorian1125 for modernizing the source code of these filters for GMIC 3.1.0") +#@gui :_=note("Merci Reptorian1125 pour avoir modernisé le code source de ces filtres pour GMIC 3.1.0") +#@gui :_=note("Version 2023/09/10 GMIC 3.3.0") +#@gui __Arrays & Tiles +#@gui Annular Steiner Chain Round Tile:Annular_Steiner_Chain_Round_Tile,Annular_Steiner_Chain_Round_Tile(1) +#@gui :_=note("Annular Steiner Chain Round Tiles") +#@gui :_=link("http://en.wikipedia.org/wiki/Steiner_chain","http://en.wikipedia.org/wiki/Steiner_chain") +#@gui :_=separator() +#@gui :_=note("Image Finale") +#@gui :Dimension En Pixels=int(800,256,1920) +#@gui :Supprimer Calque / Delete Layer=bool(1) +#@gui :_=separator() +#@gui :_=note("Image") +#@gui :Position X Origine (%)=float(0,0,100) +#@gui :Position Y Origine (%)=float(0,0,100) +#@gui :Dimension (%)=float(100,1,100) +#@gui :Angle Décalage Image Contour=float(0,0,360) +#@gui :Image Contour Dimension=float(100,1,100) +#@gui :Nb Cercles Extérieurs / Circles Surrounding=int(12,3,180) +#@gui :Angle Inclinaison / Tilt=float(0,0,360) +#@gui :_=separator() +#@gui :_=note("Couleurs Formes") +#@gui :Activer Couleurs Formes=bool(1) +#@gui :Contours=color(#000000ff) +#@gui :Affichage / Display Contours=choice(0,"Sans","A","B","C","D","E","F","G") +#@gui :Cercle / Circle C=color(#ffff007f) +#@gui :Cercle / Circle D=color(#0000ff7f) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui _Testing +#@gui Samj +#@gui Arrays & Tiles +#@gui Bulles Colorees:samj_Bulles_Colorees,samj_Bulles_Colorees(1) +#@gui :_=note("samj_Bulles_Colorees") +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Couleur Limite=color(#404040ff) +#@gui :_=separator() +#@gui :_=note("Resolution") +#@gui :Résolution=int(8,1,32) +#@gui :_=separator() +#@gui :_=note("Bulles") +#@gui :Variation L=int(0,-255,255) +#@gui :Variation H=int(0,-255,255) +#@gui :Grossissement A=float(3,1,9) +#@gui :Grossissement B=float(0,-3,3) +#@gui :Angle=bool(0) +#@gui :Angle Variation=float(0,0,180) +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Rendu=choice(0,"A","Inverser","A + Inverser") +#@gui :Flou / Blur Contours=float(0,0,5) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond / Background Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Carres Noirs:samj_Carres_Noirs,samj_Carres_Noirs (1) +#@gui :_=separator() +#@gui :_=note("Avant plan") +#@gui :Limite Détails=int(128,1,255) +#@gui :Résolution=int(40,8,64) +#@gui :Épaisseur / Thickness=int(7,1,7) +#@gui :Dilate=int(0,0,8) +#@gui :Couleur Avant Plan=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("Ombre") +#@gui :Flou/Blur=float(2,0,10) +#@gui :Couleur Ombre=color(#606060ff) +#@gui :Décalage Ombre=int(2,0,7) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("Isophotes") +#@gui :Ajout Isophotes=bool(0) +#@gui :Flou/Blur=float(2,0,10) +#@gui :Ajout Couleur=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/14.") +#@gui Cercles Concentriques:Cercles_Concentriques_A,Cercles_Concentriques_A(1) +#@gui :_=separator() +#@gui :_=note("Image Finale / Resulting Image") +#@gui :Dimension En Pixels=int(800,256,1920) +#@gui :Supprimer Calque / Delete Layer=bool(1) +#@gui :_=note("Cercles / Circles Rings") +#@gui :Nb Cercles / Circles (anneaux)=int(6,1,180) +#@gui :Variation Dimensions / Size=choice(0,"Sin A","Sin B","Lineaire") +#@gui :Angle Variation Origine=float(0,0,180) +#@gui :Angle Variation Fin / End=float(90,0,180) +#@gui :Coef. Variation=float(1,-1,1) +#@gui :Rotation Horaire / Rotate Clockwise=bool(1) +#@gui :Décalage Cercles % / Shift=float(50,0,500) +#@gui :Conserver Extérieur / Keep Outside=bool(1) +#@gui :_=note("Rayons De Couleurs Et Contours / Colored Rays And Contours") +#@gui :Activer Rayons De Couleurs / Enable=bool(1) +#@gui :_=note(" - Contours - ") +#@gui :Contours=color(#000000ff) +#@gui :Affichage / Display Contours=choice(0,"Sans","Rayons Et Cercles","Rayons","Cercles") +#@gui :Dilate Contours=int(0,0,16) +#@gui :Flou / Blur Contours=float(0,0,5) +#@gui :Sharpen=int(0,0,600) +#@gui :_=note(" - Couleurs - ") +#@gui :Répétition Des Couleurs=int(5,1,180) +#@gui :Angle Décalage Des Couleurs=float(0,0,360) +#@gui :Couleur / Color A=color(#0000ffff) +#@gui :Couleur / Color B=color(#ffff00ff) +#@gui :Couleur / Color C=color(#ff0000ff) +#@gui :Couleur / Color D=color(#00ffffff) +#@gui :Couleur / Color E=color(#ff00ffff) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Mélange Couleurs Contours / Blend=bool(1) +#@gui :_=note("Symmetrizoscope") +#@gui :Activer Symmetrizoscope=bool(0) +#@gui :Itérations=int(5,1,32) +#@gui :Angle=float(0,0,360) +#@gui :Symmetry Sides=choice("Backward","Forward","Swap") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Coeurs Hearts 002:samj_Coeurs_Hearts_002,samj_Coeurs_Hearts_002(1) +#@gui :_=separator() +#@gui :_=note("Des cœurs aux couleurs de l'image.") +#@gui :_=separator() +#@gui :_=note("Cœurs / Hearts") +#@gui :Résolution=int(16,4,128) +#@gui :Remplissage % / Filling %=float(100,20,100) +#@gui :Angle Rotation=int(0,0,360) +#@gui :Flou / Blur=float(0,0,2) +#@gui :Coeurs / Hearts=bool(1) +#@gui :Interpolation=int(0,0,3) +#@gui :Couleur Fond / Background Color=color(#ffffffff) +#@gui :Gris / Grey=bool(0) +#@gui :Amplification Couleurs / Colors Boost=bool(0) +#@gui :_=separator() +#@gui :_=note("Mélange / Blend") +#@gui :Type Avant Plan / Foreground=choice(0,"Type A","Type B") +#@gui :Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/14.") +#@gui Deconstruction:samj_Tiles_Deconstruction,samj_Tiles_Deconstruction +#@gui :_=link("https://samjcreations.blogspot.com","https://samjcreations.blogspot.com") +#@gui :Tuiles/Tiles=int(63,2,1000) +#@gui :_=note("Contours Tuiles/Tiles") +#@gui :Lignes/Lines=choice(0,"None","XY","X","Y") +#@gui :Couleur/Color=color(#00000040) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/11/13.") +#@gui Ellipses Colorees:samj_Ellipses_Colorees,samj_Ellipses_Colorees(1) +#@gui :_=note("samj_Ellipses_Colorees") +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Couleur Limite=color(#404040ff) +#@gui :_=separator() +#@gui :_=note("Ellipse") +#@gui :Rayon L=int(8,1,32) +#@gui :Rayon H=int(8,1,32) +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Rendu=choice(0,"A","Inverser","A + Inverser") +#@gui :Flou / Blur Contours=float(0,0,5) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond / Background Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Filters On Tiles:samj_Filtres_Sur_Tuiles,samj_Filtres_Sur_Tuiles +#@gui :_=note("L'image est découpée en tuiles puis réassemblée.") +#@gui :_=note("Chaque tuile est modifiable par les filtres définis au paramètre 3.") +#@gui :_=note("Les filtres du paramètre 4 modifient l'aspect final si validation dans paramètre 2.") +#@gui :_=separator() +#@gui :_=note("The image is cut into tiles and then reassembled.") +#@gui :_=note("Each tile can be modified by the filters defined in parameter 3.") +#@gui :_=note("The filters of parameter 4 modify the final appearance if validation is allowed in parameter 2.") +#@gui :_=link("PDF Reference","http://gmic.eu/reference/gmic_reference.pdf") +#@gui :_=separator() +#@gui :1 - XY Découpage/Cutting=int(20,2,256) +#@gui :2 - Filtres À Utiliser=choice(0,"Tuiles/Tiles","Tuiles+Réassemblage/Tiles+Reassembly") +#@gui :3 - Tuiles/Tiles=text("shift 2,2,0,0,0 mirror y") +#@gui :4 - Réassemblage/Reassembly=text("dilate 20") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2021/01/16.") +#@gui Filters On Tiles V2:samj_Filtres_Sur_Tuiles_V2,samj_Filtres_Sur_Tuiles_V2 +#@gui :_=note("L'image est découpée en tuiles puis réassemblée.") +#@gui :_=note("Chaque tuile est modifiable par les filtres définis au paramètre 3.") +#@gui :_=note("Les filtres du paramètre 7 modifient l'aspect final si validation dans paramètre 2.") +#@gui :_=separator() +#@gui :_=note("The image is cut into tiles and then reassembled.") +#@gui :_=note("Each tile can be modified by the filters defined in parameter 3.") +#@gui :_=note("The filters of parameter 7 modify the final appearance if validation is allowed in parameter 2.") +#@gui :_=link("PDF Reference","http://gmic.eu/reference/gmic_reference.pdf") +#@gui :_=separator() +#@gui :1 - Tuiles/Tiles Size=int(40,4,512) +#@gui :2 - Filtres À Utiliser=choice(1,"Tuiles/Tiles","Tuiles+Réassemblage/Tiles+Reassembly") +#@gui :3 - Tuiles/Tiles=text("dilate 3 shift 1,1,0,0,0") +#@gui :4 - Overlap (%)=float(0,0,50) +#@gui :5 - Overlap Std (%)=float(0,0,100) +#@gui :6 - Boundary Conditions=choice(3,"Dirichlet","Neumann","Periodic","Mirror") +#@gui :_=separator() +#@gui :7 - Réassemblage/Reassembly=text("pow 1.5 n 0,255") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/08/08.") +#@gui Floutage Blurring:samj_Flouter,samj_Flouter +#@gui :_=link("https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-floutage-blurring.html","https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-floutage-blurring.html") +#@gui :Flou/Blur=float(0,0,20) +#@gui :Netteté/Sharpen=float(0,0,100) +#@gui :Autoindex=int(0,0,255) +#@gui :Grille/Grid=int(10,4,100) +#@gui :Cercle/Circle=bool(0) +#@gui :Taille/Size=int(0,0,100) +#@gui :Norm.=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/10/21.") +#@gui Losanges Colores:samj_Losanges_Colores,samj_Losanges_Colores(1) +#@gui :_=note("samj_Losanges_Colores") +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Couleur Limite=color(#404040ff) +#@gui :_=separator() +#@gui :_=note("Resolution") +#@gui :Résolution=int(8,1,32) +#@gui :_=separator() +#@gui :_=note("Losanges - Rectangles") +#@gui :Inclinaison=bool(0) +#@gui :Variation L=int(0,-255,255) +#@gui :Variation H=int(0,-255,255) +#@gui :Grossissement A=float(1.5,0.5,9) +#@gui :Grossissement B=float(0,-10,10) +#@gui :Dimension Variation=float(1,0.3,3) +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Rendu=choice(0,"A","Inverser","A + Inverser") +#@gui :Flou / Blur Contours=float(0,0,5) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond / Background Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("Contours") +#@gui :Contours Losanges=choice(0,"Sans","Couleur Fond","Blanc","Gris Moyen","Fonce") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Moirage Spline:samj_Moirage_Spline,samj_Moirage_Spline(0) +#@gui :_=note("samj_Moirage_Spline") +#@gui :_=separator() +#@gui :_=note("Calque A") +#@gui :Couleur A=color(#000000ff) +#@gui :Résolution A=int(8,2,32) +#@gui :Décalage A=float(0,-100,100) +#@gui :Spline A U0=float(-50,-250,250) +#@gui :Spline A V0=float(50,-250,250) +#@gui :Spline A U1=float(-50,-250,250) +#@gui :Spline A V1=float(50,-250,250) +#@gui :Orientation A=float(0,0,360) +#@gui :Dilate A %=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("Calque B") +#@gui :Couleur B=color(#000000ff) +#@gui :Résolution B=int(8,2,32) +#@gui :Décalage B=float(0,-100,100) +#@gui :Spline B U0=float(-50,-250,250) +#@gui :Spline B V0=float(50,-250,250) +#@gui :Spline B U1=float(-50,-250,250) +#@gui :Spline B V1=float(50,-250,250) +#@gui :Orientation A=float(0,0,360) +#@gui :Dilate B %=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/04.") +#@gui Moirage Spline XY:samj_Moirage_Spline_XY,samj_Moirage_Spline_XY(0) +#@gui :_=note("samj_Moirage_Spline_XY") +#@gui :_=separator() +#@gui :_=note("Calque A") +#@gui :Couleur A=color(#000000ff) +#@gui :Résolution A=int(8,2,32) +#@gui :Décalage A=float(0,-100,100) +#@gui :Spline A U0=float(-50,-400,400) +#@gui :Spline A V0=float(50,-400,400) +#@gui :Spline A U1=float(-50,-400,400) +#@gui :Spline A V1=float(50,-400,400) +#@gui :Dilate A %=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("Calque B") +#@gui :Couleur B=color(#000000ff) +#@gui :Résolution B=int(8,2,32) +#@gui :Décalage B=float(0,-100,100) +#@gui :Spline B U0=float(-50,-400,400) +#@gui :Spline B V0=float(50,-400,400) +#@gui :Spline B U1=float(-50,-400,400) +#@gui :Spline B V1=float(50,-400,400) +#@gui :Dilate B %=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("Calques Visibles") +#@gui :Choix=choice(0,"Calques A B","Calque A","Calque B") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Montage 1 Page:samj_dt_montage_sur_une_page,samj_dt_montage_sur_une_page +#@gui :_=link("Code de David Tschumperlé","https://discuss.pixls.us/t/image-grid-placement/39342/2") +#@gui :_=note(" - Montage d'images assemblées dans une feuille de dimensions définies en 1 et 2 ") +#@gui :_=note(" - Image assembly in a sheet of dimensions defined in 1 and 2 ") +#@gui :_=note(" - Paramètres 3 et 4 encadrement en pixels. Paramètre 5 pour vérifier le contenu.") +#@gui :_=note(" - Parameters 3 and 4 settings pixels frames. Parameter 5 to check the content.") +#@gui :_=separator() +#@gui :_=note("Montage 1 Page") +#@gui :1 - Largeur / Width=int(1200,400,7200) +#@gui :2 - Hauteur / Height=int(1200,400,7200) +#@gui :3 - Encadrement / Frame=int(2,0,16) +#@gui :4 - Encadrement / Frame=int(5,0,16) +#@gui :_=note("Toutes les images sur la page / All images on the page") +#@gui :5 - Ajuster / Verification=int(0,-12,12) +#@gui :_=separator() +#@gui :_=note("David Tschumperlé - adaptation samj - Derni\303\250re mise \303\240 jour : 2023/09/10.") +#@gui Montage Annular Steiner Chain:samj_Montage_Annular_Steiner_Chain,samj_Montage_Annular_Steiner_Chain_Preview +#@gui :_=link("Documentation","https://samjcreations.blogspot.com/2020/12/nouveaux-montages-dimages-avec-gmic.html") +#@gui :_=note("Utiliser au moins 4 calques pour ce filtre. La qualité de la prévisualisation est limitée.") +#@gui :_=note("Use at least 4 layers for this filter. The quality of the preview is limited.") +#@gui :_=separator() +#@gui :_=note("Image Finale") +#@gui :1 - Dimension Pix.=int(2400,800,7200) +#@gui :2 - Nb Images Extérieures/Annular Chain=int(12,3,180) +#@gui :3 - Sélection=choice(1,"Calques Du Bas/Bottom Layers","Calques Du Haut/Top Layers") +#@gui :4-5-6-7 Fond/Background=color(#00000000) +#@gui :_=separator() +#@gui :_=note("Image Centrale") +#@gui :8 - Position X Origine (%)=float(0,-100,100) +#@gui :9 - Position Y Origine (%)=float(0,-100,100) +#@gui :10 - Agrandissement/Enlarging=float(1,1,100) +#@gui :11 - Décalage/Shift X (%)=float(0,-100,100) +#@gui :12 - Décalage/Shift Y (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :_=note("Images Extérieures/Annular Chain") +#@gui :13 - Angle Décalage Image Contour=float(90,0,360) +#@gui :14 - Rotation Images=bool(1) +#@gui :15 - Image Contour Dimension=float(100,1,100) +#@gui :16 - Angle Inclinaison/Tilt=float(0,0,360) +#@gui :17 - Agrandissement/Enlarging=float(1,0.2,2) +#@gui :18 - Décalage/Shift X (%)=float(0,-100,100) +#@gui :19 - Décalage/Shift Y (%)=float(0,-100,100) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/12/09.") +#@gui Montage Cercle Spirale:samj_Montage_Cercle_Spirale,samj_Montage_Cercle_Spirale_preview +#@gui :_=link("Documentation","https://samjcreations.blogspot.com/2020/12/samuser-avec-gmic-gimp-filtre-montage_21.html") +#@gui :_=note("Utiliser au moins 6 calques pour ce filtre. La qualité de la prévisualisation est limitée.") +#@gui :_=note("Use at least 6 layers for this filter. The quality of the preview is limited.") +#@gui :_=separator() +#@gui :_=note("Montage Cercle Spirale") +#@gui :1 - Dimensions Approx. Pixels=int(2400,800,5100) +#@gui :2 - Nb Images=int(8,6,36) +#@gui :3 - Sélection=choice(0,"Calques Du Haut/Top Layers","Calques Du Bas/Bottom Layers") +#@gui :4 - Forme=choice(1,"Cercle","Spirale","Spirale Inversée") +#@gui :5-6-7-8 Fond/Background=color(#00000000) +#@gui :9 - Rotation Angle=choice(0,"0","90","-90","180") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/12/22.") +#@gui Montage Geometric Figures:samj_Montage_Figures_Geometriques,samj_Montage_Figures_Geometriques +#@gui :_=link("Documentation","https://samjcreations.blogspot.com/2020/12/nouveaux-montages-dimages-avec-gmic.html") +#@gui :_=note("Rapidité de traitement/Speed of image processing") +#@gui :1 - Dimensions Max. Pixels=int(4800,2400,11400) +#@gui :_=note("Montage") +#@gui :2 - Colonnes/Columns - 0 Automatique=int(0,0,20) +#@gui :3 - Colonnes Vers Lignes / Columns to Rows=bool(0) +#@gui :4 - Montage Type=choice(1,"Basique","Polygones - Param 17-18","Rideau - Param 19-20","Oeuf Egg Rosillo - Param 21-22","Kiss Curve","Fleur Flower") +#@gui :5-6-7-8 Fond/Background=color(#00000000) +#@gui :_=note("Calques/Layers") +#@gui :9 - Sélection=choice(1,"Calques Du Bas/Bottom Layers","Calques Du Haut/Top Layers") +#@gui :10 - Image Carrée / Square Image=bool(0) +#@gui :11 - Décalage/Shift X (%)=float(0,-100,100) +#@gui :12 - Décalage/Shift Y (%)=float(0,-100,100) +#@gui :13 - Agrandissement/Enlarging=float(1,0.35,2.75) +#@gui :14 - Contour/Padding=int(10,0,20) +#@gui :15-16-17 Contour/Padding=color(#ffffff) +#@gui :_=note("Polygones") +#@gui :18 - Nb Côtés/Sides Polygone=int(6,3,24) +#@gui :19 - Rotation Polygone=float(30,0,360) +#@gui :_=note("Rideau") +#@gui :20 - Effet / Effect=choice(1,"1","2","3","4","5","6","7","8","9","10","11","12") +#@gui :21 - Intensité=int(-3,-5,1) +#@gui :_=note("Oeuf Egg") +#@gui :22 - Forme=float(300,200,400) +#@gui :23 - Angle=float(270,-360,360) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/12/17.") +#@gui Montage Multi Rows:samj_montage_multi_rows_GUI,samj_montage_multi_rows_GUI +#@gui :_=link("Documentation","https://samjcreations.blogspot.com/2020/12/nouveaux-montages-dimages-avec-gmic.html") +#@gui :_=note(" - Montage d'images assemblées horizontalement - Au moins 4 calques/Images pour 2 lignes") +#@gui :_=note(" - Montage of horizontally assembled images - At least 4 layers/Images for 2 rows") +#@gui :_=note(" - 1 ligne est ajoutée automatiquement si modulo Images/Lignes différent de 0") +#@gui :_=note(" - 1 row is automatically added if modulo Images/Rows different from 0") +#@gui :_=separator() +#@gui :_=note("Montage Multi Rows") +#@gui :1 - Nb. Images Montage=int(4,4,200) +#@gui :2 - Lignes/Rows=int(2,2,20) +#@gui :3 - Sélection=choice(0,"Calques Du Haut/Top Layers","Calques Du Bas/Bottom Layers") +#@gui :4 - Montage Type=choice(1,"Hauteurs Proportionnelles/Proportional Heights","Hauteur Constante/Same Height") +#@gui :5 - Dimension Pixels=int(2400,800,11400) +#@gui :6 - Contours Pixels=int(2,0,24) +#@gui :7 - Espacement/Padding Pixels=int(2,0,24) +#@gui :8 - Rotation Images=bool(0) +#@gui :9 - Lignes Vers Colonnes/Rows to Columns=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/12/11.") +#@gui Montage Pappus Chain:samj_Montage_Pappus_Chain,samj_Montage_Pappus_Chain_Preview +#@gui :_=link("Documentation","https://samjcreations.blogspot.com/2020/12/nouveaux-montages-dimages-avec-gmic.html") +#@gui :_=note("Utiliser 10 calques pour ce filtre. La qualité de la prévisualisation est limitée.") +#@gui :_=note("Use 10 layers for this filter. The quality of the preview is limited.") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :1 - Rayon Cercle Extérieur Pix.=int(1200,600,3600) +#@gui :2 - Rotation Rendu/Rendering=float(0,0,360) +#@gui :_=note("Images Montage") +#@gui :3 - Sélection=choice(1,"Calques Du Bas/Bottom Layers","Calques Du Haut/Top Layers") +#@gui :4 - Rotation Angle=choice(0,"0","90","-90","180") +#@gui :5 - Dimension Images=float(35,5,80) +#@gui :6 - Agrandissement/Enlarging %=float(100,20,200) +#@gui :7 - Décalage/Shift X (%)=float(0,-100,100) +#@gui :8 - Décalage/Shift Y (%)=float(0,-100,100) +#@gui :_=note("Fond/Background") +#@gui :9-10-11-12 Cercle Central=color(#ffffffff) +#@gui :13-14-15-16 Extérieur=color(#00000000) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/12/09.") +#@gui Montage Row:samj_montage_row_GUI,samj_montage_row_GUI_preview +#@gui :_=link("Documentation","https://samjcreations.blogspot.com/2020/12/nouveaux-montages-dimages-avec-gmic.html") +#@gui :_=note("Montage d'images assemblées horizontalement") +#@gui :_=note("Montage of horizontally assembled images") +#@gui :_=separator() +#@gui :_=note("Montage Row") +#@gui :1 - Max. Images=int(8,1,200) +#@gui :2 - Sélection=choice(0,"Calques Du Haut/Top Layers","Calques Du Bas/Bottom Layers") +#@gui :3 - Montage Type=choice(1,"Hauteurs Proportionnelles/Proportional Heights","Hauteur Constante/Same Height") +#@gui :4 - Dimension Pixels=int(2400,800,11400) +#@gui :5 - Contours Pixels=int(2,0,24) +#@gui :6 - Espacement/Padding Pixels=int(2,0,24) +#@gui :7 - Rotation Images=bool(0) +#@gui :8 - Ligne Vers Colonne/Row to Column=bool(0) +#@gui :_=note("Déformation") +#@gui :9 - Déformation=bool(0) +#@gui :10 - Forme/Shape=choice(1,"Angle","Sinus") +#@gui :11 - Offset %=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/12/11.") +#@gui Montage Zigzag:samj_Montage_Zigzag,samj_Montage_Zigzag +#@gui :_=link("Documentation","https://samjcreations.blogspot.com/2020/12/samuser-avec-gmic-gimp-filtre-montage.html") +#@gui :_=note("La hauteur du montage sera automatiquement ajustée si la valeur du paramètre 1 est dépassée.") +#@gui :_=note("The mounting height will be automatically adjusted if the value of parameter 1 is exceeded.") +#@gui :_=separator() +#@gui :_=note("Largeur Max. Approximative/Approximate Maximum Width") +#@gui :1 - Dimensions Max. Pixels=int(4800,1200,11400) +#@gui :_=note("Montage Zigzag") +#@gui :2 - Nb Images=int(8,1,200) +#@gui :3 - Sélection=choice(1,"Calques Du Bas/Bottom Layers","Calques Du Haut/Top Layers") +#@gui :4 - Demi Hauteur/Half Height=int(256,0,1200) +#@gui :5 - Inverser Inclinaison/Reverse Tilt=bool(0) +#@gui :6 - Adoucir/Smooth=int(0,0,100) +#@gui :7-8-9-10 Fond/Background=color(#00000000) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/12/20.") +#@gui Pixelisation Contours:samj_Pixelisation_Contours,samj_Pixelisation_Contours(1) +#@gui :_=separator() +#@gui :_=note("Pixélisation") +#@gui :Flou/Blur=float(0.5,0,16) +#@gui :Forme=choice(0,"Carrée","Hexagonale","Triangulaire A","Triangulaire B","Triangulaire C","Triangulaire D","Triangulaire E","Triangulaire F") +#@gui :Pixélisation=int(20,2,128) +#@gui :Levels=int(8,1,256) +#@gui :Smoothness=float(0,0,5) +#@gui :Décalages=int(0,0,32) +#@gui :Rendu=int(1,1,6) +#@gui :_=separator() +#@gui :_=note("Smooth [antialias]") +#@gui :Amplitude=float(0,0,100) +#@gui :Edge Threshold (%)=float(10,0,100) +#@gui :Smoothness=float(0.8,0,5) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/20.") +#@gui Pointes De Diamants Colorees:samj_Pointes_De_Diamants_Colorees,samj_Pointes_De_Diamants_Colorees(1) +#@gui :_=note("samj_Pointes_De_Diamants_Colorees") +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Couleur Limite=color(#404040ff) +#@gui :_=separator() +#@gui :_=note("Resolution") +#@gui :Résolution=int(8,1,32) +#@gui :_=separator() +#@gui :_=note("Polygones") +#@gui :Variation L=int(0,-255,255) +#@gui :Variation H=int(0,-255,255) +#@gui :Grossissement A=float(1.5,0.5,9) +#@gui :Grossissement B=float(0,-10,10) +#@gui :Angle Variation=float(0,0,180) +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Rendu=choice(0,"A","Inverser","A + Inverser") +#@gui :Flou / Blur Contours=float(0,0,5) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond / Background Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("Contours") +#@gui :Contours Polygones=choice(0,"Sans","Couleur Fond","Blanc","Gris Moyen","Fonce") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui ___Patterns +#@gui Reptile:samj_reptile,samj_reptile(1) +#@gui :_=note("samj_reptile") +#@gui :_=separator() +#@gui :_=note("Texture Peau / Skin Texture") +#@gui :Forme=choice(0,"Hexagonal","Grid","Triangular Ha","Triangular Hb","Triangular Va","Triangular Vb") +#@gui :Résolution=int(64,1,256) +#@gui :Spread=int(25,5,100) +#@gui :Color=float(2,0,10) +#@gui :Orientation=float(0,0,1) +#@gui :Light=int(40,0,100) +#@gui :_=separator() +#@gui :_=note("Blend") +#@gui :Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui _Testing +#@gui Samj +#@gui Arrays & Tiles +#@gui Scintillements Colores:samj_Scintillements_Colores,samj_Scintillements_Colores(1) +#@gui :_=note("Color Rays / samj_Scintillements_Colores") +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Couleur Limite=color(#404040ff) +#@gui :_=separator() +#@gui :_=note("Scintillement") +#@gui :Résolution L=int(8,1,32) +#@gui :Résolution H=int(8,1,32) +#@gui :Dimension Variation=float(1,0.3,3) +#@gui :Variation Couleur=int(768,1,768) +#@gui :Scintillement / Rays=int(12,3,24) +#@gui :Angle Décalage / Shift Angle=float(0,0,120) +#@gui :Variation Aléatoire / Random=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Rendu / Rendering=choice(0,"A","Inverser","A + Inverser") +#@gui :Flou / Blur Contours=float(0,0,5) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond / Background Color=color(#000000ff) +#@gui :Déformation=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui ___Artistic +#@gui Angoisse Anguish:samj_Angoisse,samj_Angoisse(1) +#@gui :_=separator() +#@gui :_=note("Itérations") +#@gui :Itérations=int(1,1,3) +#@gui :_=separator() +#@gui :_=note("Paramètres Filtre dog") +#@gui :Sigma 1=float(5,0,10) +#@gui :Sigma 2=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Paramètres Filtre segment_watershed") +#@gui :Threshold=float(5,0,10) +#@gui :_=separator() +#@gui :_=note("Paramètres Filtre smooth") +#@gui :Amplitude=float(100,0,200) +#@gui :_=separator() +#@gui :_=note("Paramètres Filtre noise") +#@gui :Amplitude=float(2,0,10) +#@gui :Type=choice(4,"Gaussian","Uniform","Salt and Pepper","Poisson","Rice") +#@gui :_=separator() +#@gui :_=note("Paramètres Filtre blend") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Paramètres Filtre sharpen") +#@gui :Amplitude=int(250,0,500) +#@gui :_=separator() +#@gui :_=note("samj Dernière mise à jour : 2016/01/19.") +#@gui Barbouillage Paint Daub:samj_Barbouillage_Paint_Daub,samj_Barbouillage_Paint_Daub(0) +#@gui :_=note("Barbouillage / Paint Daub") +#@gui :_=separator() +#@gui :_=note("Gradient Norm") +#@gui :Itérations=int(2,1,3) +#@gui :_=separator() +#@gui :_=note("Smooth") +#@gui :Amplitude=int(2,1,5) +#@gui :Sharpness=int(100,0,500) +#@gui :Anisotropy=float(0.2,0,0.5) +#@gui :Sigma=float(1,0,10) +#@gui :Dl=float(4,0,10) +#@gui :_=separator() +#@gui :_=note("Equalize") +#@gui :Equalize=bool(1) +#@gui :_=separator() +#@gui :_=note("Plasma Aléatoire / Random Plasma") +#@gui :Plasma=choice(0,"Non / Without","Couleurs A","Couleurs B") +#@gui :Scale Plasma=int(8,1,30) +#@gui :_=separator() +#@gui :_=note("samj Dernière mise à jour : 2015/04/17.") +#@gui Chalk It Up [Fr]:samj_chalkitup,samj_chalkitup_preview +#@gui :_=note("Inspiré du didacticiel proposé par Lylejk") +#@gui :_=note("Inspired by the tutorial proposed by Lylejk") +#@gui :_=link("http://justpaste.it/chalk_it_up","http://justpaste.it/chalk_it_up") +#@gui :_=separator() +#@gui :_=note("Paramètres peinturage / Painting parameters") +#@gui :Abstraction=int(5,0,10) +#@gui :Précision Détails / Details Scale=float(2.5,0,10) +#@gui :Couleur / Color=float(1.5,0,5) +#@gui :Douceur / Smoothness=float(50,0,200) +#@gui :Accentuation Nuances / Sharpen Shades=bool(1) +#@gui :_=separator() +#@gui :_=note("Paramètres filtre Morpho / Morpho parameters") +#@gui :Action=choice(5,"Erosion","Dilation","Opening","Closing","Original - Erosion","Dilation - Original","Original - Opening","Closing - Original") +#@gui :Taille / Size=int(5,0,32) +#@gui :Inversion Couleurs / Invert Colors=bool(0) +#@gui :Modeler / Shape=bool(0) +#@gui :Canaux / Channel(s)=choice(7,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :_=separator() +#@gui :_=note("Paramètres filtre Spread / Spread parameters") +#@gui :X-Variations=float(0.8,-5,5) +#@gui :Y-Variations=float(1.9,-5,5) +#@gui :Canaux / Channel(s)=choice(7,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :_=separator() +#@gui :Type Aperçu=choice("Tout","Rendu En Bas","Rendu a Droite","Rendu En Haut","Rendu a Gauche") +#@gui :_=separator() +#@gui :_=note("Auteurs / Authors : Lylejk/samj/Ronounours. Dernière mise à jour : 2015/03/31.") +#@gui _Testing +#@gui Samj +#@gui Artistic +#@gui Color Edges Engrave:samj_Color_EdgesO_Engrave,samj_Color_EdgesO_Engrave(0) +#@gui :_=note("samj_Color_EdgesO_Engrave") +#@gui :_=separator() +#@gui :_=note("Edges offsets") +#@gui :Smoothness=float(0,0,10) +#@gui :Threshold=float(50,0,100) +#@gui :Scale=int(9,0,32) +#@gui :Thickness=int(1,0,16) +#@gui :_=separator() +#@gui :_=note("Engrave") +#@gui :Radius=float(2,0,4) +#@gui :Density=float(50,0,200) +#@gui :Edges=float(0,0,10) +#@gui :Cohérence=float(8,0,40) +#@gui :Threshold (%)=float(40,0,100) +#@gui :Minimal Area=int(0,-256,256) +#@gui :Flat Regions Removal=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Variations") +#@gui :Areas=float(1,0.8,1.2) +#@gui :Invert Areas=bool(0) +#@gui :Segment=int(0,0,15) +#@gui :Add=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/25.") +#@gui Contour Drawings:samj_Contour_Drawings_en,samj_Contour_Drawings_en (1) +#@gui :_=separator() +#@gui :_=note("Contour") +#@gui :Isophotes=int(5,3,16) +#@gui :Smoothness=float(0,0,5) +#@gui :Dilate=int(2,0,5) +#@gui :Color Autoindex=int(0,0,64) +#@gui :To Gray=bool(0) +#@gui :_=separator() +#@gui :_=note("Smooth [antialias]") +#@gui :Amplitude=float(5,0,100) +#@gui :Edge Threshold (%)=float(10,0,100) +#@gui :Smoothness=float(0.8,0,5) +#@gui :_=separator() +#@gui :_=note("Background") +#@gui :Background=bool(0) +#@gui :Color=float(1.1,0,1.2) +#@gui :Variation=int(10,2,200) +#@gui :_=separator() +#@gui :_=note("Chalk") +#@gui :Chalk=bool(0) +#@gui :Spread=float(1,0,4) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2016/11/18.") +#@gui Contour Epais:samj_Contour_Epais,samj_Contour_Epais (1) +#@gui :_=separator() +#@gui :_=note("Edges") +#@gui :Itérations=int(1,1,5) +#@gui :Flou/Blur=float(0,0,5) +#@gui :Edges %=float(5,0,100) +#@gui :_=separator() +#@gui :_=note("Isophotes") +#@gui :Validation=bool(1) +#@gui :Isophotes=int(5,4,7) +#@gui :_=separator() +#@gui :_=note("Smooth [antialias]") +#@gui :Amplitude=float(5,0,100) +#@gui :Edge Threshold (%)=float(10,0,100) +#@gui :Smoothness=float(0.8,0,5) +#@gui :_=separator() +#@gui :_=note("Rendu") +#@gui :Épaisseur=int(2,0,10) +#@gui :Type Rendu=int(1,1,6) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/14.") +#@gui Couleurs Rayees:samj_Couleurs_Rayees,samj_Couleurs_Rayees (1) +#@gui :_=separator() +#@gui :_=note("Avant plan") +#@gui :Lumin=bool(0) +#@gui :Pixélisation=int(30,8,100) +#@gui :Flou=float(0,0,10) +#@gui :PA=int(100,1,255) +#@gui :DeformA=int(4,-16,16) +#@gui :DeformB=int(4,-16,16) +#@gui :Couleur=int(0,0,255) +#@gui :Itérations=int(2,1,4) +#@gui :Puissance=float(0.7,0.1,2) +#@gui :Equalize=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/14.") +#@gui Couleurs Rayees 2:samj_Couleurs_Rayees_2,samj_Couleurs_Rayees_2 (1) +#@gui :_=separator() +#@gui :_=note("Avant plan") +#@gui :Lumin=bool(0) +#@gui :Pixélisation=int(30,8,100) +#@gui :Flou=float(0,0,10) +#@gui :PA=int(100,1,255) +#@gui :DeformA=int(4,-16,16) +#@gui :DeformB=int(4,-16,16) +#@gui :Limite=int(255,1,255) +#@gui :Itérations=int(1,1,4) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/07.") +#@gui Cubisme A:samj_Test_Cubisme_A,samj_Test_Cubisme_A +#@gui :_=link("Inspiration","https://fr.wikipedia.org/wiki/Portrait_de_Pablo_Picasso#/media/Fichier:Juan_Gris_-_Portrait_of_Pablo_Picasso_-_Google_Art_Project.jpg") +#@gui :_=link("Documentation","https://samjcreations.blogspot.com/2021/01/samuser-avec-gmic-gimp-filtre-cubisme-a.html") +#@gui :_=separator() +#@gui :_=note("Dilate") +#@gui :1 - Dilate=bool(1) +#@gui :2 - DiA=int(120,4,200) +#@gui :3 - DiB=int(70,4,200) +#@gui :_=note("Imagegrid Triangular") +#@gui :4 - Imagegrid=bool(1) +#@gui :5 - X=int(30,1,256) +#@gui :6 - Y=int(30,1,256) +#@gui :7 - Type=choice(2,"Horizontal","Vertical","Crossed","Cube","Decreasing","Increasing") +#@gui :_=note("Variante") +#@gui :8 - Variante=bool(0) +#@gui :9 - Noise-Spread=int(6,1,40) +#@gui :10 - Flou/Blur=float(0,0,10) +#@gui :_=note("Polygonize") +#@gui :11 - Polygonize=bool(1) +#@gui :12 - Amplitude=int(300,0,2000) +#@gui :13 - Douceur/Smoothness=float(8,0,100) +#@gui :14 - Surface Minimale/Minimal Area=float(10,0,100) +#@gui :15 - X-Resolution=float(10,1,256) +#@gui :16 - Y-Resolution=float(20,1,256) +#@gui :_=note("Kuwahara") +#@gui :17 - Kuwahara=bool(1) +#@gui :18 - Répétition/Repeat=int(1,1,4) +#@gui :19 - Size=int(5,1,50) +#@gui :_=note("Drawing-Smooth") +#@gui :20 - Drawing=bool(1) +#@gui :_=note("Brushify") +#@gui :21 - Brushify=bool(1) +#@gui :22 - Nb Dimensions/Sizes=int(64,1,128) +#@gui :23 - Opacité/Opacity=int(25,0,100) +#@gui :24 - Brosse/Brush Dimension=int(8,8,40) +#@gui :25 - Inverser/Invert=bool(1) +#@gui :_=note("Pseudo Gray") +#@gui :26 - Pseudo Gray=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2021/01/12.") +#@gui Cubisme B:samj_Test_Cubisme_B,samj_Test_Cubisme_B +#@gui :_=link("Documentation","https://samjcreations.blogspot.com/2021/01/samuser-avec-gmic-gimp-filtre-cubisme-b.html") +#@gui :_=separator() +#@gui :_=note("Decoupage Triangle A") +#@gui :1 - Tuiles=int(11,1,64) +#@gui :2 - Type Imagegrid=choice(6,"Horizontal","Vertical","Crossed","Cube","Decreasing","Increasing","All Types") +#@gui :3 - Noise-Spread=int(0,0,40) +#@gui :4 - Shift X=int(30,0,300) +#@gui :5 - Shift Y=int(40,0,300) +#@gui :_=note("Decoupage Triangle B") +#@gui :6 - Tuiles=int(17,1,64) +#@gui :7 - Type Imagegrid=choice(6,"Horizontal","Vertical","Crossed","Cube","Decreasing","Increasing,"All Types") +#@gui :8 - Noise-Spread=int(0,0,40) +#@gui :9 - Shift X=int(0,0,300) +#@gui :10 - Shift Y=int(0,0,300) +#@gui :_=note("Mélange/Blend") +#@gui :11 - Inverser/Invert A-B=bool(0) +#@gui :12 - Mode=choice(3,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Seamless","Seamless Mixed","Screen","Shapeareamax","Shapeareamax0","Shapeareamin","Shapeareamin0","Shapeaverage","Shapeaverage0","Shapemedian","Shapemedian0","Shapemin","Shapemin0","Shapemax","Shapemax0","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :13 - Opacité / Opacity=float(1,0,1) +#@gui :_=note("Brushify") +#@gui :14 - Brushify=bool(1) +#@gui :15 - Nb Dimensions/Sizes=int(64,1,128) +#@gui :16 - Opacité/Opacity=int(25,0,100) +#@gui :17 - Brosse/Brush Dimension=int(8,8,40) +#@gui :18 - Inverser/Invert=bool(1) +#@gui :_=note("Pseudo Gray") +#@gui :19 - Pseudo Gray=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2021/01/13.") +#@gui Diff Tensors Blend:samj_Diff_Tensors_Blend,samj_Diff_Tensors_Blend(1) +#@gui :_=note("samj_Diff_Tensors_Blend") +#@gui :_=separator() +#@gui :_=note("Diffusion Tensors") +#@gui :Résolution (%)=float(10,1,20) +#@gui :Size=float(5,0,16) +#@gui :Outline=int(1,0,16) +#@gui :Sharpness=float(0.15,0,1) +#@gui :Anisotropy=float(1,0,1) +#@gui :Gradient Smoothness=float(0,0,10) +#@gui :Tensor Smoothness=float(3,0,10) +#@gui :Itérations=int(1,1,10) +#@gui :_=separator() +#@gui :_=note("Flou-Blur") +#@gui :Flou/Blur=int(0,0,50) +#@gui :_=separator() +#@gui :_=note("Blend") +#@gui :Mode=choice(3,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/10/30.") +#@gui Edges And LIC:samj_Edges_And_LIC,samj_Edges_And_LIC(1) +#@gui :_=separator() +#@gui :_=note("samj_Edges_And_LIC") +#@gui :_=separator() +#@gui :_=note("Background [Step 1]") +#@gui :Rendering=choice(0,"A","B","C") +#@gui :Lic=int(200,10,1000) +#@gui :Dilate=int(0,0,2) +#@gui :Sharpen=int(0,0,5000) +#@gui :Blur=float(0,0,5) +#@gui :_=separator() +#@gui :Edges %=float(15,0,100) +#@gui :Pow=float(8,0.2,8) +#@gui :N Min=int(127,0,255) +#@gui :N Max=int(255,0,255) +#@gui :Gray=choice(0,"A","B","C","D","E","F","G") +#@gui :_=separator() +#@gui :_=note("Abstraction [Optional Step 2]") +#@gui :Abstraction=bool(0) +#@gui :Smoothness=float(1,0,10) +#@gui :Levels=int(20,2,100) +#@gui :Contrast=float(0.2,0.01,1) +#@gui :_=separator() +#@gui :_=note("Blend [Optional Step 3]") +#@gui :Blend=bool(0) +#@gui :Mode=choice(14,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Area Max","Shape Area Max0","Shape Area Min","Shape Area Min0","Shape Average","Shape Average0","Shape Min","Shape Min0","Shape Max","Shape Max0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Reverse=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2017/01/09.") +#@gui Flamboyance Test:samj_Flamboyance_Test,samj_Flamboyance_Test_preview +#@gui :_=separator() +#@gui :_=link("GMIC Adaptation of the tutorial written by Lyle Kroll","http://gimpchat.com/viewtopic.php?f=10&t=14999") +#@gui :_=note("Thank you for this beautiful and interesting effect") +#@gui :_=separator() +#@gui :_=note("Hard Sketch") +#@gui :Amplitude=float(65,0,4000) +#@gui :Density=float(28,0,100) +#@gui :Smoothness=float(9.25,0,10) +#@gui :Opacity=float(0.3,0,1) +#@gui :Edge=float(0,0,100) +#@gui :Fast Approximation=bool(1) +#@gui :Color Variation=float(1.1,0.5,2) +#@gui :_=separator() +#@gui :_=note("Smooth Bilateral") +#@gui :Spatial Variance=float(10,0,100) +#@gui :Value Variance=float(12,0,100) +#@gui :Iterations=int(2,1,10) +#@gui :_=separator() +#@gui :_=note("Blend") +#@gui :Grain Type=choice(0,"A","B","C","D") +#@gui :Iterations=int(0,0,10) +#@gui :Blend Proportion=float(1,0,1) +#@gui :Interruption Flamboyance=bool(0) +#@gui :_=separator() +#@gui :_=note("Smooth") +#@gui :Amplitude=float(150,0,1000) +#@gui :Sharpness=float(0.42,0,2) +#@gui :Anisotropy=float(0.85,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(7.83,0,10) +#@gui :Spatial Precision=float(0.68,0.1,2) +#@gui :Angular Precision=float(19,1,180) +#@gui :Value Precision=float(2.65,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :Color Variation=float(1,0.5,2) +#@gui :_=separator() +#@gui :_=note("Cartoon") +#@gui :Smoothness=float(3,0,10) +#@gui :Sharpening=float(200,0,400) +#@gui :Edge Threshold=float(20,1,30) +#@gui :Edge Thickness=float(0.1,0,1) +#@gui :Color Strength=float(1.5,0,3) +#@gui :Color Quantization=int(8,2,256) +#@gui :Color Variation=float(1,0.5,2) +#@gui :_=separator() +#@gui :_=note("Blend GMIC") +#@gui :Mode=choice(3,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacity=float(1,0,1) +#@gui :Reverse=bool(0) +#@gui :Sharpen=float(20,0,500) +#@gui :Noise=float(0,0,40) +#@gui :Spread X=float(0,0,20) +#@gui :Spread Y=float(0,0,20) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Authors: Lyle Kroll and samj. Latest update: 2016/12/06.") +#@gui Fond Broderie:samj_fond_broderie,samj_fond_broderie(1) +#@gui :_=note("samj_fond_broderie") +#@gui :_=note("topographic_map") +#@gui :Levels=int(8,1,32) +#@gui :Smoothness=float(2,0,5) +#@gui :_=note("gimp_skeleton") +#@gui :Curviness=float(0,0,2) +#@gui :_=note("fx_LCE") +#@gui :Activer Fx LCE=bool(1) +#@gui :_=note("gimp_frame_blur") +#@gui :Activer Gimp Frame Blur=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/01/19.") +#@gui Fond Brosse:samj_Fond_Brosse,samj_Fond_Brosse(1) +#@gui :_=note("samj_Fond_Brosse") +#@gui :_=separator() +#@gui :_=note("Brosse") +#@gui :Brosse=int(3,2,10) +#@gui :_=separator() +#@gui :_=note("Couleur") +#@gui :Couleur=float(1,0.8,1.2) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/01/27.") +#@gui Fx Sketchbw Modifie:samj_fx_sketchbw_modifie,samj_fx_sketchbw_modifie_preview(0) +#@gui :_=separator() +#@gui :_=note("Sketch") +#@gui :Number of Orientations=int(3,1,16) +#@gui :Starting Angle=float(45,0,180) +#@gui :Angle Range=float(180,0,180) +#@gui :Stroke Length=float(30,0,1000) +#@gui :Contour Threshold=float(1.75,0,10) +#@gui :Opacity=float(0.02,0,0.3) +#@gui :Background Intensity=float(0.5,0,2) +#@gui :Density=float(0.75,0,5) +#@gui :Sharpness=float(0.1,0,1) +#@gui :Anisotropy=float(0.7,0,1) +#@gui :Smoothness=float(3,0,10) +#@gui :Cohérence=float(6,0,10) +#@gui :Boost Stroke=bool(0) +#@gui :Curved Stroke=bool(1) +#@gui :Color Model=choice(4,"Black on White","White on Black","Black on Transparent White","White on Transparent Black","Color on White") +#@gui :Forme Aléatoire=bool(0) +#@gui :Forme=int(1234,1,111111) +#@gui :_=separator() +#@gui :_=note("Smooth") +#@gui :Smooth=bool(0) +#@gui :Amplitude=int(2,1,5) +#@gui :Sharpness=int(100,0,500) +#@gui :Anisotropy=float(0.2,0,0.5) +#@gui :Sigma=float(1,0,10) +#@gui :Dl=float(4,0,10) +#@gui :Equalize=bool(1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé / ❤❤ modifications : samj. Latest update: 2018/05/15.") +#@gui Granular Texture:samj_Texture_Granuleuse,samj_Texture_Granuleuse_preview(0) +#@gui :_=note("Texture Granuleuse / Granular Texture") +#@gui :_=separator() +#@gui :Douceur / Smoothness Gradient RGB=float(0,0.5,2) +#@gui :Maximum Seuil Dégradé / Max Threshold Gradient RGB=float(20,10,50) +#@gui :_=separator() +#@gui :Amplitude Bruit / Noise=float(80.0,40,200) +#@gui :_=separator() +#@gui :Couleurs / Colors=float(0,-20,20) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/03/31.") +#@gui Gris Raye:samj_Gris_Raye,samj_Gris_Raye (1) +#@gui :_=separator() +#@gui :_=note("Avant plan") +#@gui :Lumin=bool(0) +#@gui :Pixélisation=int(30,8,100) +#@gui :Flou=float(0,0,10) +#@gui :PA=int(100,1,255) +#@gui :DeformA=int(4,-16,16) +#@gui :DeformB=int(4,-16,16) +#@gui :Limite=int(255,1,255) +#@gui :Itérations=int(1,1,4) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/11/29.") +#@gui Hallucinogen:samj_Hallucinogen,samj_Hallucinogen +#@gui :_=link("https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre.html","https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre.html") +#@gui :_=note("Filtre HallucinoGenerator") +#@gui :Autoindex=int(80,1,255) +#@gui :Flou/Blur=float(2,0,10) +#@gui :Puissance/Pow=float(80,0,100) +#@gui :Modulo=float(1.5,0.5,2) +#@gui :Adoucir/Smooth=int(2,0,5) +#@gui :Inverser/Invert=bool(0) +#@gui :Répéter Ce Filtre/Repeat=bool(0) +#@gui :_=separator() +#@gui :_=note("Brushify") +#@gui :Brushify=bool(0) +#@gui :Nb Dimensions/Sizes=int(1,1,16) +#@gui :Opacité/Opacity=int(80,0,100) +#@gui :Brosse/Brush Dimension=int(8,8,40) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/10/19.") +#@gui Hallucinogen 2:samj_Hallucinogen_b,samj_Hallucinogen_b +#@gui :_=note("Filtre Polygonize") +#@gui :Polygonize=bool(1) +#@gui :Amplitude=int(300,0,2000) +#@gui :Douceur/Smoothness=float(10,0,100) +#@gui :Surface Minimale/Minimal Area=float(10,0,100) +#@gui :X-Resolution=float(10,1,256) +#@gui :Y-Resolution=float(10,1,256) +#@gui :_=note("Filtre HallucinoGenerator") +#@gui :Autoindex=int(80,1,255) +#@gui :Flou/Blur=float(2,0,10) +#@gui :Puissance/Pow=float(80,0,100) +#@gui :Modulo=float(1.5,0.5,2) +#@gui :Adoucir/Smooth=int(2,0,5) +#@gui :Inverser/Invert=bool(0) +#@gui :Répéter Ce Filtre/Repeat=bool(0) +#@gui :_=note("Brushify") +#@gui :Brushify=bool(1) +#@gui :Nb Dimensions/Sizes=int(1,1,16) +#@gui :Opacité/Opacity=int(80,0,100) +#@gui :Brosse/Brush Dimension=int(8,8,40) +#@gui :_=note("Blend") +#@gui :Blend=bool(1) +#@gui :Inverser Calques/Reverse Layers=bool(0) +#@gui :Mode=choice(14,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Seamless","Seamless Mixed","Screen","Shapeareamax","Shapeareamax0","Shapeareamin","Shapeareamin0","Shapeaverage","Shapeaverage0","Shapemedian","Shapemedian0","Shapemin","Shapemin0","Shapemax","Shapemax0","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/11/25.") +#@gui Impressions:samj_Impressions,samj_Impressions(1) +#@gui :_=note("Spread") +#@gui :Spread=float(10,0,50) +#@gui :_=note("Textured Glass") +#@gui :X-Amplitude=float(5,0,400) +#@gui :Y-Amplitude=float(5,0,400) +#@gui :X-Smoothness=float(1,0,5) +#@gui :Y-Smoothness=float(1,0,5) +#@gui :Edge Atténuation=float(0,0,1) +#@gui :Edge Influence=float(2,0,10) +#@gui :Noise Scale=int(0,0,16) +#@gui :_=note("Abstraction") +#@gui :Itérations=int(1,1,3) +#@gui :_=note("Abstraction Dog") +#@gui :Sigma 1=float(5,0,10) +#@gui :Sigma 2=float(0,0,10) +#@gui :_=note("Abstraction Segment Watershed") +#@gui :Threshold=float(5,0,10) +#@gui :_=note("Abstraction Smooth") +#@gui :Amplitude=float(100,0,200) +#@gui :_=note("Abstraction Noise") +#@gui :Amplitude=float(2,0,10) +#@gui :Type=choice(4,"Gaussian","Uniform","Salt and Pepper","Poisson","Rice") +#@gui :_=note("Blend") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=note("Sharpen") +#@gui :Amplitude=int(250,0,500) +#@gui :_=note("Couleurs") +#@gui :Couleurs=float(1.2,0.1,5) +#@gui :_=separator() +#@gui :_=note("samj Dernière mise à jour : 2016/01/19.") +#@gui Isophotes Vers Aquarelle:samj_Isophotes_Vers_Aquarelle,samj_Isophotes_Vers_Aquarelle (1) +#@gui :_=note("Isophotes") +#@gui :Nb Décomposition Couleurs=int(16,2,32) +#@gui :Variation Flou=float(0.5,0.1,2) +#@gui :Isophotes=int(4,3,16) +#@gui :Dilate=int(0,0,8) +#@gui :_=note("Segmentation") +#@gui :Segmentation=bool(1) +#@gui :Edge Threshold=float(10,0,30) +#@gui :Smoothness=float(1,0,5) +#@gui :Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=note("Contours") +#@gui :Flou=float(0,0,2) +#@gui :Couleurs=float(0,-2,2) +#@gui :_=note("Fond") +#@gui :Fond=bool(1) +#@gui :Amplitude Noise=float(10,5,200) +#@gui :Density Hardsketchbw=float(10,5,100) +#@gui :Spread Variations=float(4,3,20) +#@gui :Amplitude Water=float(3,2,10) +#@gui :Couleur / Color=color(#fbedce) +#@gui :Opacité / Opacity=float(1,-1,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2017/01/20.") +#@gui Plasmic:samj_Plasmic,samj_Plasmic(1) +#@gui :_=note("Plasmic filter is based on a composition of Lylejk") +#@gui :_=link("https://www.flickr.com/photos/34520999@N05/24513476052/sizes/o/","https://www.flickr.com/photos/34520999@N05/24513476052/sizes/o/") +#@gui :_=separator() +#@gui :_=note("Blur") +#@gui :Blur=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Contours") +#@gui :Pow=float(1.1,0.2,2) +#@gui :_=separator() +#@gui :_=note("Segment") +#@gui :Edge Threshold=float(2,0,15) +#@gui :_=separator() +#@gui :_=note("Cut") +#@gui :Cut=int(40,0,255) +#@gui :_=separator() +#@gui :_=note("Dilate") +#@gui :Dilate Contours=int(0,0,16) +#@gui :_=separator() +#@gui :_=note("Plasma") +#@gui :Plasmic=int(0,0,20) +#@gui :_=separator() +#@gui :_=note("Dégradation Deform") +#@gui :Deform=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Dégradation Spread") +#@gui :Spread=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2016/02/03.") +#@gui Plasmic V2:samj_Plasmic_V2,samj_Plasmic_V2(0) +#@gui :_=note("samj_Plasmic_V2") +#@gui :_=separator() +#@gui :_=note("Plasma") +#@gui :Plasmic=int(2,-20,20) +#@gui :_=separator() +#@gui :_=note("Lines") +#@gui :Thickness=int(4,1,32) +#@gui :Accuracy=int(10,1,32) +#@gui :Coeff. Accuracy=float(2,0.1,8) +#@gui :Coeff. Blur=float(0.02,0,1) +#@gui :Isophotes=int(8,2,32) +#@gui :_=separator() +#@gui :_=note("Dégradation Deform") +#@gui :Deform=float(0,-200,200) +#@gui :_=separator() +#@gui :_=note("Dilate") +#@gui :Dilate Contours=int(0,0,16) +#@gui :_=separator() +#@gui :_=note("Dégradation Spread") +#@gui :Spread=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Background") +#@gui :Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2020/10/24.") +#@gui Pointillisme:samj_Pointillisme,samj_Pointillisme (1) +#@gui :_=separator() +#@gui :_=note("Points") +#@gui :Intensite=int(10,1,100) +#@gui :Densité=float(2,0,100) +#@gui :Dimension=int(5,2,20) +#@gui :Rond Vs Carré=bool(1) +#@gui :Variation=float(1,0.2,2) +#@gui :_=separator() +#@gui :_=note("Arriere plan") +#@gui :Fond Transparent=bool(1) +#@gui :Couleur=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/08.") +#@gui Pointillisme B:samj_Pointillisme_B,samj_Pointillisme_B (1) +#@gui :_=separator() +#@gui :_=note("Couleurs") +#@gui :Variation=float(1,0.2,2) +#@gui :Dilatation=int(0,0,16) +#@gui :Pixels=float(90,0,100) +#@gui :_=separator() +#@gui :_=note("Points") +#@gui :Dimension=int(3,0,20) +#@gui :Rond Vs Carré=bool(1) +#@gui :_=separator() +#@gui :_=note("Arriere plan") +#@gui :Fond Transparent=bool(1) +#@gui :Couleur=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/14.") +#@gui Posterize B:samj_Posterize_B,samj_Posterize_B(0) +#@gui :_=separator() +#@gui :_=note("Posterize B") +#@gui :Blur=float(1,0,5) +#@gui :Colors=int(12,2,32) +#@gui :Inpaint Holes=float(1,0.1,5) +#@gui :Smooth=int(0,0,8) +#@gui :Smooth - Smoothness=float(40,10,800) +#@gui :Smooth - Edges (%)=float(30,0,100) +#@gui :Smooth - Paint=float(1,0,10) +#@gui :Sharpen=int(0,0,5000) +#@gui :Normalize Colors=bool(0) +#@gui :_=separator() +#@gui :_=note("Contours Difference") +#@gui :Contours Difference=bool(0) +#@gui :XY-Offset=choice(0,"1 1","1 -1","-1 1","-1 -1","0 1","1 0","0 -1","-1 0") +#@gui :Thickness=int(1,1,8) +#@gui :Dithering=bool(0) +#@gui :Erasure Grid=int(0,0,16) +#@gui :Vivid Light - Type=choice(0,"No","Vivid Light 1","Vivid Light 2","Vivid Light 3") +#@gui :Vivid Light - Colors=int(0,0,200) +#@gui :Black and White=bool(0) +#@gui :Negative Colors=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/10/24.") +#@gui Samj Ripple Houghsketchbw:samj_ripple_houghsketchbw,samj_ripple_houghsketchbw_preview(0)* +#@gui :_=separator() +#@gui :_=note("Blur") +#@gui :1 - Blur=float(2,0.1,10) +#@gui :_=note("Ripple") +#@gui :2 Amplitude=int(100,1,300) +#@gui :3 Bandwidth=float(50,1,300) +#@gui :4 Shape=choice(1,"Sine","Sine+") +#@gui :5 Angle=float(45,0,360) +#@gui :6 Offset=float(0,0,500) +#@gui :_=note("houghsketchbw") +#@gui :7 Density=float(10,0,70) +#@gui :8 Radius=int(5,0,30) +#@gui :9 Threshold=float(80,0,100) +#@gui :10 Opacity=float(0.1,0,1) +#@gui :11 Votesize=float(100,10,200) +#@gui :_=note("Color") +#@gui :12 Blend Color=bool(1) +#@gui :13 Mode=choice(17,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Seamless","Seamless Mixed","Screen","Shapeareamax","Shapeareamax0","Shapeareamin","Shapeareamin0","Shapeaverage","Shapeaverage0","Shapemedian","Shapemedian0","Shapemin","Shapemin0","Shapemax","Shapemax0","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :14 Opacity=float(1,0,1) +#@gui :15 Reverse Layers=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/05/28.") +#@gui ___Artistic +#@gui Skeletik:samj_Test_Skeletik,samj_Test_Skeletik(0) +#@gui :_=note("samj_Test_Skeletik") +#@gui :_=separator() +#@gui :_=note("Lines - Cobweb") +#@gui :Itérations=int(10,1,50) +#@gui :Skeleton=int(1,1,20) +#@gui :Deform=float(0,0,200) +#@gui :Dilate=int(0,0,16) +#@gui :Spread=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Blend") +#@gui :Mode=choice(3,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Area Max","Shape Area Max0","Shape Area Min","Shape Area Min0","Shape Average","Shape Average0","Shape Min","Shape Min0","Shape Max","Shape Max0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :_=separator() +#@gui :_=note("Colors") +#@gui :Lines=float(1,0.75,1.25) +#@gui :Background Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2019/12/14.") +#@gui _Testing +#@gui Samj +#@gui Artistic +#@gui Tensor Test:samj_TensorTest,samj_TensorTest(1) +#@gui :_=note("Tensor Test") +#@gui :_=separator() +#@gui :_=note("diffusiontensors") +#@gui :Sharpness=float(0.3,0,1) +#@gui :Anisotropy=float(0.9,0,1) +#@gui :Alpha=float(0.6,0,100) +#@gui :Sigma=float(1.1,0,100) +#@gui :Is Sqrt=bool(0) +#@gui :_=separator() +#@gui :_=note("ABS") +#@gui :Abs=bool(0) +#@gui :_=separator() +#@gui :_=note("resize2dx") +#@gui :SizeX=int(20,8,64) +#@gui :_=separator() +#@gui :_=note("display tensors") +#@gui :Size Factor=int(32,16,128) +#@gui :Ellipse Size=float(20,0,100) +#@gui :Color Mode=choice(2,"Monochrome","Grayscale","Color") +#@gui :Outline=bool(1) +#@gui :_=separator() +#@gui :_=note("Couleur") +#@gui :Couleur=float(0,0,2) +#@gui :_=separator() +#@gui :_=note("Resize") +#@gui :Resize=choice(2,"Non RVBA","Oui RVB","Oui RVBA") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/11/01.") +#@gui Texture Coloree:samj_texture_coloree,samj_texture_coloree(1) +#@gui :_=note("samj_texture_coloree") +#@gui :_=note("diffusiontensors") +#@gui :Type=choice("A","B","C","D","E","F") +#@gui :Sharpness=float(0.7,0.2,2) +#@gui :_=note("Color") +#@gui :Fond / Background Color=color(#c87d32) +#@gui :_=note("Blur Linear") +#@gui :Amplitude A=float(5,0,10) +#@gui :Amplitude B=float(5,0,100) +#@gui :Angle=float(45,0,360) +#@gui :_=note("Sharpen") +#@gui :Amplitude S=int(200,50,1000) +#@gui :_=note("Blend") +#@gui :Itérations=int(4,1,8) +#@gui :Opacité / Opacity=float(0.2,0,0.3) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/04/05.") +#@gui Variations on a Single Color:samj_texture_coloree_en,samj_texture_coloree_en(1) +#@gui :_=note("Variations On A Single Color") +#@gui :_=note("Diffusion Tensors") +#@gui :Type=choice("A","B","C","D","E","F") +#@gui :Sharpness=float(0.7,0.2,1) +#@gui :_=note("Color") +#@gui :Single Color=color(#c87d32) +#@gui :_=note("Blur Linear") +#@gui :Amplitude A=float(5,0,10) +#@gui :Amplitude B=float(5,0,100) +#@gui :Angle=float(45,0,360) +#@gui :_=note("Sharpen") +#@gui :Amplitude S=int(200,50,1000) +#@gui :_=note("Blend") +#@gui :Iterations=int(4,1,8) +#@gui :Opacity=float(0.2,0,0.3) +#@gui :_=note("Richardson Lucy") +#@gui :Sigma=float(1,0.5,10) +#@gui :Iterations=int(10,0,100) +#@gui :Blur=choice(1,"Exponential","Gaussian") +#@gui :Cut=bool(true) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2015/04/13.") +#@gui _Black & White +#@gui Colored Engraving:Engrave_colore,Engrave_colore(1) +#@gui :_=note("Modification du Filtre de Lyle Kroll et David Tschumperlé") +#@gui :_=note("pour obtenir des gravures colorées - samj 20150321") +#@gui :_=separator() +#@gui :Exemples / Examples=choice(0,"Non / None","A","B","C","D ***","E","F","G") +#@gui :_=note("Gravure / Engraving") +#@gui :Radius=float(0.5,0,2) +#@gui :Densité A=float(4,0,10) +#@gui :Edges=float(0,0,10) +#@gui :Cohérence=float(8,0,40) +#@gui :Threshold (%)=float(40,0,100) +#@gui :Minimal Area=int(0,-256,256) +#@gui :Répétition=int(25,0,50) +#@gui :_=note("Anti-aliasing") +#@gui :Anti-Aliasing=choice(1,"Disabled","A","B","C") +#@gui :_=note("Couleurs / Colors") +#@gui :Gravure / Engraving=choice(2,"Avant Plan","Image Avec Contours Des Couleurs 8","Image Avec Contours Des Couleurs 16","Image Avec Contours Des Couleurs 32","Image Avec Contours Des Couleurs 64","Image Sans Contours Des Couleurs 8","Image Sans Contours Des Couleurs 16","Image Sans Contours Des Couleurs 32","Image Sans Contours Des Couleurs 64","3 Calques - Image Sans Contours Des Couleurs 8","3 Calques - Image Sans Contours Des Couleurs 16","3 Calques - Image Sans Contours Des Couleurs 32","3 Calques - Image Sans Contours Des Couleurs 64") +#@gui :Avant Plan=color(#000000) +#@gui :Fond / Background Color=color(#ffffff) +#@gui :_=separator() +#@gui :_=note("Authors: Lyle Kroll and David Tschumperlé . Latest update: 2020/10/24.") +#@gui Engrave Modifie:engrave_modifie,engrave_modifie(1) +#@gui :_=note("Aussi pour obtenir des contours") +#@gui :Exemples / Examples=choice(0,"Non / None","A","B","C","D ***","E","F","G") +#@gui :_=note("Black & White foreground:") +#@gui :Radius=float(0.5,0,2) +#@gui :Densité A=float(4,0,10) +#@gui :Edges=float(0,0,10) +#@gui :Cohérence=float(8,0,40) +#@gui :Threshold (%)=float(40,0,100) +#@gui :Minimal Area=int(0,-256,256) +#@gui :Répétition=int(25,0,50) +#@gui :_=separator() +#@gui :Anti-Aliasing=choice(1,"Disabled","X1.5","X2","X3") +#@gui :_=separator() +#@gui :_=note("Authors: Lyle Kroll and David Tschumperlé. Latest update: samj 2015/03/20.") +#@gui Grid BW Color:samj_Grid_BW_Color,samj_Grid_BW_Color +#@gui :_=link("https://samjcreations.blogspot.com/2020/12/samuser-avec-gmic-gimp-filtre-grid-bw.html","https://samjcreations.blogspot.com/2020/12/samuser-avec-gmic-gimp-filtre-grid-bw.html") +#@gui :1 Flou/Blur=float(3,0,10) +#@gui :2 - Adoucir/Smooth=int(0,0,5000) +#@gui :_=note("Grille/Grid") +#@gui :3 - Grille/Grid=choice(1,"Non/No","Rectangle","Triangle","Hexagone Paramètre 4","Rectangle Sans Contour","Triangle Sans Contour","Hexagone Sans Contour Paramètre 4") +#@gui :4 - X Grille/Grid=int(4,2,64) +#@gui :5 - Y Grille/Grid=int(4,2,64) +#@gui :_=note("Fond Noir/Black Background") +#@gui :6 - Noir/Black=int(32,16,160) +#@gui :7 - Negate=bool(1) +#@gui :8 - Index=int(2,2,8) +#@gui :_=note("Couleur/Color") +#@gui :9 - Color=bool(0) +#@gui :10 - Index=int(32,2,32) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/12/19.") +#@gui Hard Sketch XY:XY_hardsketchbw_samj,XY_hardsketchbw_samj(0) +#@gui :_=separator() +#@gui :_=note("Paramètres Filtre Hard Sketch BW") +#@gui :XY=float(0.2,0,1) +#@gui :Densité / Amplitude=float(300,0,4000) +#@gui :Density / Density=float(50,0,100) +#@gui :Douceur / Smoothness=float(1,0,10) +#@gui :Opacité / Opacity=float(0.1,0,1) +#@gui :Bordure / Edge=float(20,0,100) +#@gui :Approximation Rapide / Fast Approximation=bool(0) +#@gui :Color Model=choice("Black on White","White on Black","Black on Transparent White","White on Transparent Black","Color on White") +#@gui :_=separator() +#@gui :_=note("Calques / Layers") +#@gui :Nb.=choice(0,"1 : XY","2 : XY + Hard Sketch BW Normal") +#@gui :_=separator() +#@gui :_=note("Netteté / Sharpen") +#@gui :Filtre Octave Sharpening=bool(0) +#@gui :_=separator() +#@gui :_=note("XY_hardsketch Color") +#@gui :Couleur / Color=color(#b428a0ff) +#@gui :Remplir / Fill=bool(0) +#@gui :_=separator() +#@gui :_=note("samj Dernière mise à jour : 2015/03/10.") +#@gui Masques B&W Masks:samj_Masques_Noir_Et_Blanc,samj_Masques_Noir_Et_Blanc_Preview +#@gui :_=separator() +#@gui :_=note("Création de 2 masques : Noir/Transparent et Blanc/Transparent") +#@gui :_=note("Create 2 masks : Black/Transparent and White/Transparent") +#@gui :1 - Flou/Blur=float(3,0,10) +#@gui :2 - Masque/Mask %=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/03/06.") +#@gui NB Edges Engrave:samj_NB_EdgesO_Engrave,samj_NB_EdgesO_Engrave(0) +#@gui :_=note("samj_NB_EdgesO_Engrave") +#@gui :_=separator() +#@gui :_=note("Edges offsets") +#@gui :Smoothness=float(0,0,10) +#@gui :Threshold=float(50,0,100) +#@gui :Scale=int(9,0,32) +#@gui :Thickness=int(1,0,16) +#@gui :_=separator() +#@gui :_=note("Engrave") +#@gui :Radius=float(2,0,4) +#@gui :Density=float(50,0,200) +#@gui :Edges=float(0,0,10) +#@gui :Cohérence=float(8,0,40) +#@gui :Threshold (%)=float(40,0,100) +#@gui :Minimal Area=int(0,-256,256) +#@gui :Flat Regions Removal=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("Variation") +#@gui :Variation=float(1,0.8,1.2) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/24.") +#@gui Scintillements:samj_scintillements,samj_scintillements(1) +#@gui :_=note("samj_scintillements") +#@gui :Exemples=choice("Non","A","B","C","D Image Noire","E Image Noire - Scintillements","F Image Noire - Stars") +#@gui :_=note("Dog") +#@gui :Sigma 1=float(5,0,10) +#@gui :Sigma 2=float(0,0,10) +#@gui :Itérations=int(1,1,8) +#@gui :_=note("Noise") +#@gui :Variation=int(20,0,100) +#@gui :Type=choice(2,"Gaussian","Uniform","Salt and Pepper","Poisson","Rice") +#@gui :_=note("Circle") +#@gui :Amplitude=int(6,3,20) +#@gui :_=note("Blur Linear") +#@gui :Amplitude A=float(20,0,100) +#@gui :Amplitude B=float(5,0,100) +#@gui :Angle=float(45,0,120) +#@gui :_=note("Local normalization") +#@gui :Amplitude=float(2,0,60) +#@gui :Radius=int(6,1,64) +#@gui :Neighborhood Smoothness=float(5,0,40) +#@gui :Average Smoothness=float(20,0,40) +#@gui :Constrain Values=bool(1) +#@gui :Channel(s)=choice(7,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :_=note("Couleurs") +#@gui :Inverser Couleur=bool(0) +#@gui :Dégradation=float(0,-50,50) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/01/19.") +#@gui _Colors +#@gui 64 Couleurs Max:samj_64_Couleurs_Max,samj_64_Couleurs_Max(0) +#@gui :_=link("https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre-64.html","https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre-64.html") +#@gui :Graine/Seed=int(9,0,65536) +#@gui :Nb. Max. Couleurs/Colors=int(4,2,64) +#@gui :Flou/Blur=float(2,0,100) +#@gui :Netteté/Sharpen=float(50,0,100) +#@gui :Map Sur Gris/On Gray=bool(1) +#@gui :_=separator() +#@gui :_=note("Palette de couleurs predefinie/Preset color palette") +#@gui :Palette Prédéfinie/Preset Color=choice(0,"Non/No","Palette Origine","N&B-Gris/B&W-Grey","B&N-Gris/W&B-Grey","Choix/Choice 2 Colors A B","Choix/Choice 2 Colors B A") +#@gui :Couleur - Color A=color(#f0f028) +#@gui :Couleur - Color B=color(#7828f0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/10/18.") +#@gui 9 Colors:samj_test_9_colors,samj_test_9_colors +#@gui :_=link("https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre-9-colors.html","https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre-9-colors.html") +#@gui :_=link("https://discuss.pixls.us/t/help-with-gmic-map-command/20801","https://discuss.pixls.us/t/help-with-gmic-map-command/20801") +#@gui :Couleur/Color 1=color(#46110a) +#@gui :Couleur/Color 2=color(#862314) +#@gui :Couleur/Color 3=color(#9a1b3a) +#@gui :Couleur/Color 4=color(#ba3d59) +#@gui :Couleur/Color 5=color(#dc6781) +#@gui :Couleur/Color 6=color(#ef97a9) +#@gui :Couleur/Color 7=color(#f6c2cd) +#@gui :Couleur/Color 8=color(#fdc9d4) +#@gui :Couleur/Color 9=color(#ffffff) +#@gui :Flou/Blur=float(0,0,5) +#@gui :Netteté/Sharpen=float(0,0,200) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/10/19.") +#@gui At06A 2017 VarCouleurs:samj_At06A_2017_VarCouleurs,samj_At06A_2017_VarCouleurs(1) +#@gui :_=separator() +#@gui :_=note("samj_At06A_2017_VarCouleurs") +#@gui :Puissance=float(1,0,8) +#@gui :Couper A %=float(0,0,100) +#@gui :Couper B %=float(100,0,100) +#@gui :Noir Et Blanc=choice(0,"Non","To Gray","Lightness - Lab") +#@gui :Normaliser=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2017/02/27.") +#@gui Color Harmonies:samj_Color_Palettes,samj_Color_Palettes(1) +#@gui :_=separator() +#@gui :_=note("samj_Color_Palettes") +#@gui :_=separator() +#@gui :_=note("Geometry") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Tilt Angle=float(0,0,360) +#@gui :Radius Center Circle=float(6,0,100) +#@gui :Number Of Shades Per Circle=int(24,16,90) +#@gui :Angle Offset Rings=float(0,0,360) +#@gui :Variation Dimension=float(0,-100,200) +#@gui :_=separator() +#@gui :_=note("Color - Palettes") +#@gui :Reference Color=color(#b45a2d) +#@gui :Fill Color=bool(1) +#@gui :RGB XYZ Matrices=int(3,0,15) +#@gui :XYZ Tristimulus=int(2,0,18) +#@gui :Outline Reference Color=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2020/10/24.") +#@gui Couleurs Metalliques:Couleurs_Metalliques,Couleurs_Metalliques_preview +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Transparence / Transparency=choice(0,"Conserver / Preserve","Supprimer / Remove") +#@gui :Rendu / Rendering=choice("YCbCr [luminance]","Lab [lightness]","HSV [value]","HSL [lightness]","Linear RGB [all]","RGB [all]","RGB [all]") +#@gui :_=separator() +#@gui :_=note("Paramètres Filtre Noise - Noise parameters") +#@gui :Amplitude=float(22,0,200) +#@gui :Type De Bruit / Noise Type=choice("Gaussian","Uniform","Salt and Pepper","Poisson") +#@gui :Étendue / Value Range=choice("Cut","Normalize") +#@gui :_=separator() +#@gui :_=note("Paramètres Filtre Local normalization - Local normalization parameters") +#@gui :Double Effet=bool(0) +#@gui :Amplitude=float(0,0,60) +#@gui :Rayon / Radius=int(6,1,64) +#@gui :Lissage Voisinage / Neighborhood Smoothness=float(5,0,40) +#@gui :Lissage Moyenne / Average Smoothness=float(20,0,40) +#@gui :Imposer Valeurs / Constrain Values=bool(1) +#@gui :Canaux / Channel(s)=choice(0,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]") +#@gui :_=separator() +#@gui :_=note("Paramètres Filtre Boost-Fade - Boost-Fade parameters : Siif Amplitude Sup. 0") +#@gui :Amplitude=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("PhotoComix Options") +#@gui :Utiliser / Use PC Options=bool(0) +#@gui :Filtre Pencilbw Taille / Size=float(0.3,0,5) +#@gui :Filtre Pencilbw Amplitude=float(60,0,200) +#@gui :Opacité Mélange / Blend Opacity=float(1,0,1) +#@gui :Mélange Permuter Calques / Blend Revert Layers=bool(1) +#@gui :_=separator() +#@gui :_=separator() +#@gui :Type Aperçu=choice("Tout","Rendu En Bas","Rendu a Droite","Rendu En Haut","Rendu a Gauche") +#@gui :_=separator() +#@gui :_=note("samj Dernière mise à jour : 2015/03/31.") +#@gui Dorure Gilding:samj_Dorure,samj_Dorure +#@gui :_=link("https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre-dorure.html","https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre-dorure.html") +#@gui :_=note("Relief Light") +#@gui :_=note("Obtenir une couleur dorée ou cuivrée par Lightness et Darkness.") +#@gui :_=note("Obtain a golden or copper color by Lightness et Darkness.") +#@gui :Ambient Lightness=float(0.4,0.2,0.7) +#@gui :Specular Lightness=float(0.2,0,2) +#@gui :Specular Size=float(0.2,0,1) +#@gui :Darkness=float(0,0,1) +#@gui :Light Smoothness=float(1,0,5) +#@gui :XY-Light=point(20,20,0,1,255,255,128,200,10) +#@gui :Z-Light=float(0,0,20) +#@gui :Z-Scale=float(0.5,0,3) +#@gui :_=note("Dorure/Gilding") +#@gui :Inverser/Invert Relief=bool(0) +#@gui :Adoucir/Smooth=int(60,0,200) +#@gui :Large Image=bool(0) +#@gui :Flou/Blur=float(0,0,5) +#@gui :Netteté/Sharpen=float(100,0,200) +#@gui :Aspect=float(45,0,360) +#@gui :Map 1=int(18,2,64) +#@gui :Map 2=int(32,2,255) +#@gui :Map 3=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/03/04.") +#@gui Samj Remplir Fill Flood:samj_Remplir_Fill_Flood,samj_Remplir_Fill_Flood(1) +#@gui :_=separator() +#@gui :_=note("Position") +#@gui :1 2 - Origine Flood/Remplissage=point(50,50,0,1,255,255,0,-128,1%) +#@gui :_=note("Remplissage/Filling") +#@gui :3 4 5 6 - Couleur/Color=color(#ff0000ff) +#@gui :7 - Seuil/Threshold=float(20,0,255) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/05/04.") +#@gui Samj Test Shapeprevalent:samj_test_shapeprevalent,samj_test_shapeprevalent +#@gui :_=separator() +#@gui :1 - Flou/Blur=float(2,1,5) +#@gui :2 - Quantize=int(32,4,128) +#@gui :3 - Surface/Area=int(50,2,100) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/03/18.") +#@gui Samj Topographie Eliminate Contour Lines:samj_Topographie_Eliminate_Contour_Lines,samj_Topographie_Eliminate_Contour_Lines_preview(0)* +#@gui :_=separator() +#@gui :_=link("discuss.pixls.us","https://discuss.pixls.us/t/is-there-a-way-to-filter-out-lines-that-are-within-a-common-color/36840") +#@gui :_=link("Cartes/GPS Nautical Charts","https://www.gpsnauticalcharts.com/") +#@gui :_=separator() +#@gui :_=note("Chercher/Look For Minimum") +#@gui :1 - Dilate/Erode=int(10,1,30) +#@gui :_=note("Couleur/Color 1 Masque/Mask") +#@gui :2 3 4 - Couleur/Color 1=color(#98c5f2) +#@gui :5 - Minimum Precision Couleur/Color 1=float(10,0,100) +#@gui :_=note("Couleur/Color 2 Masque/Mask") +#@gui :6 7 8 - Couleur/Color 2=color(#72b6ef) +#@gui :9 - Minimum Precision Couleur/Color 2=float(90,0,100) +#@gui :_=separator() +#@gui :_=note("Lignes/Lines 1") +#@gui :10 11 12 - Lignes/Lines 1=color(#5c5f62) +#@gui :13 - Minimum Precision Lignes/Lines 1=float(30,0,100) +#@gui :_=note("Lignes/Lines 2") +#@gui :14 15 16 - Lignes/Lines 2=color(#85a4c4) +#@gui :17 - Minimum Precision Lignes/Lines 2=float(10,0,100) +#@gui :_=note("Lignes/Lines 3") +#@gui :18 19 20 - Lignes/Lines 3=color(#788fa6) +#@gui :21 - Minimum Precision Lignes/Lines 3=float(10,0,100) +#@gui :_=note("Texte/Text") +#@gui :22 23 24 - Texte/Text=color(#1600f5) +#@gui :25 - Minimum Precision Texte/Text=float(60,0,100) +#@gui :_=separator() +#@gui :_=note("Finition") +#@gui :26 - Finition/Finishing=bool(1) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Pour améliorer les finitions essayer le filtre Select-Replace Color par David Tschumperlé.") +#@gui :_=note("To improve finishes try the Select-Replace Color filter by David Tschumperlé.") +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/05/03.") +#@gui Valeur Moyenne LCH:samj_Valeur_Moyenne_LCH,samj_Valeur_Moyenne_LCH_Preview(0) +#@gui :_=separator() +#@gui :_=link("http://colormine.org/convert/rgb-to-lch","http://colormine.org/convert/rgb-to-lch") +#@gui :_=separator() +#@gui :_=note("samj_Valeur_Moyenne_LCH") +#@gui :Dimension Echantillon Image=int(400,10,800) +#@gui :_=link("http://www.brucelindbloom.com/Eqn_RGB_XYZ_Matrix.html","http://www.brucelindbloom.com/Eqn_RGB_XYZ_Matrix.html") +#@gui :RGB XYZ Matrices=choice(14,"0 Adobe RGB 1998 D65","1 AppleRGB D65","2 Best RGB D50","3 Beta RGB D50","4 Bruce RGB D65","5 CIE RGB E","6 ColorMatch RGB D50","7 Don RGB 4 D50","8 ECI RGB D50","9 Ekta Space PS5 D50 ","10 NTSC RGB C","11 PAL SECAM RGB D65","12 ProPhoto RGB D50","13 SMPTE C RGB D65","14 Observateur 2deg Illuminant D65 SRGB REF","15 Wide Gamut RGB D50") +#@gui :XYZ Tristimulus=choice(4,"0 2deg CIE 1931 A Incandescent","1 2deg CIE 1931 C","2 2deg CIE 1931 D50","3 2deg CIE 1931 D55","4 2deg CIE 1931 D65 Daylight REF","5 2deg CIE 1931 D75","6 2deg CIE 1931 F2 Fluorescent","7 2deg CIE 1931 F7","8 2deg CIE 1931 F11","9 RIEN NONE","10 10deg CIE 1964 A Incandescent","11 10deg CIE 1964 C","12 10deg CIE 1964 D50","13 10deg CIE 1964 D55","14 10deg CIE 1964 D65 Daylight ","15 10deg CIE 1964 D75 ","16 10deg CIE 1964 F2 Fluorescent ","17 10deg CIE 1964 F7 ","18 10deg CIE 1964 F11") +#@gui :_=separator() +#@gui :_=note("Fichier Sauvegarde File") +#@gui :Output Folder=_folder() +#@gui :Output Filename=_text("samj_Valeur_Moyenne_LCH.txt") +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2019/03/26.") +#@gui Variations RVB:samj_Variations_RVB,samj_Variations_RVB(1) +#@gui :_=separator() +#@gui :_=note("samj_Variations_RVB") +#@gui :_=separator() +#@gui :_=note("Geometry") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Tilt Angle=float(0,0,360) +#@gui :Radius Center Circle=float(6,0,100) +#@gui :Angle Offset Rings=float(0,0,360) +#@gui :Variation Dimension=float(0,-100,200) +#@gui :_=separator() +#@gui :_=note("Variations RVB") +#@gui :Reference Color=color(#b45a2d) +#@gui :Fill Color=bool(0) +#@gui :Outline Reference Color=bool(1) +#@gui :Type Variation=int(0,0,20) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2020/10/24.") +#@gui _Contours +#@gui Carte De Repoussage:samj_Carte_De_Repoussage,samj_Carte_De_Repoussage(0) +#@gui :_=separator() +#@gui :_=note("15 Matrices Emboss Pivotees") +#@gui :Matrices Emboss=int(30,0,59) +#@gui :Gris/Gray=bool(1) +#@gui :Flou/Blur=float(0,0,32) +#@gui :Netteté/Sharpen=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/03/22.") +#@gui Colored Outlines:samj_Colored_Outlines,samj_Colored_Outlines(1) +#@gui :_=note("samj_Colored_Outlines") +#@gui :_=separator() +#@gui :_=note("Blur") +#@gui :Axes=choice(0,"XY","X","Y") +#@gui :Blur=float(2,0,10) +#@gui :_=separator() +#@gui :_=note("Isophote") +#@gui :Isophote=float(8,6,16) +#@gui :_=separator() +#@gui :_=note("Smooth") +#@gui :Smooth=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("Dilate") +#@gui :Dilate=int(0,0,16) +#@gui :_=separator() +#@gui :_=note("Background") +#@gui :Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/01/29.") +#@gui Coloriage:samj_Coloriage,samj_Coloriage_preview +#@gui :_=separator() +#@gui :_=note("Filtre Lent") +#@gui :_=note("Pour obtenir un contour de 1 couleur") +#@gui :_=separator() +#@gui :Dimension Max Echantillon=int(612,256,800) +#@gui :Limites=int(255,1,255) +#@gui :Flou Lissage=float(2,0,10) +#@gui :Isophotes Nb Levels=int(6,4,16) +#@gui :Dilatation=int(2,1,16) +#@gui :Couleur Contour=color(#000000ff) +#@gui :Dimensions Origine=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/04.") +#@gui Contours Arrondis:samj_Contours_Arrondis,samj_Contours_Arrondis(1) +#@gui :_=note("samj_Contours_Arrondis") +#@gui :_=note("Lissage") +#@gui :Itérations=int(1,1,25) +#@gui :Quantize=int(3,2,25) +#@gui :Blur=int(5,5,50) +#@gui :_=note("Traits") +#@gui :Isophotes=int(10,2,50) +#@gui :RGBA=bool(0) +#@gui :Dilate Circ=int(0,0,10) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/04/06.") +#@gui Contours Blancs:samj_Contours_Blancs,samj_Contours_Blancs_preview(0) +#@gui :_=separator() +#@gui :_=note("Option Quantize") +#@gui :Quantize=choice(1,"No","A","B","A + B") +#@gui :Levels=int(16,2,256) +#@gui :Blur=float(2,0,100) +#@gui :_=note("Gradient Norm") +#@gui :Smoothness=float(0,0,10) +#@gui :Linearity=float(0.5,0,1.5) +#@gui :Min Threshold=float(0,0,100) +#@gui :Max Threshold=float(100,0,100) +#@gui :Negative Colors=bool(0) +#@gui :_=note("Blanc Contours") +#@gui :White Level Contour=int(3,0,12) +#@gui :_=note("Segment Watershed") +#@gui :Edge Threshold=float(2,0,15) +#@gui :Smoothness=float(1,0,5) +#@gui :Channel(s)=choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-Red Chrominances]","YCbCr [blue Chrominance]","YCbCr [red Chrominance]","YCbCr [green Chrominance]","Lab [lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]") +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :_=note("Edges Offsets") +#@gui :Smoothness=float(0,0,10) +#@gui :Threshold=float(15,0,50) +#@gui :Scale=int(4,0,32) +#@gui :Thickness=int(1,0,16) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: samj. Latest update: 2019/12/16.") +#@gui Contours Coins Vifs:samj_Contours_Coins_Vifs,samj_Contours_Coins_Vifs +#@gui :_=separator() +#@gui :1 - Autoindex (Détails)=int(20,2,255) +#@gui :2 - Dilate (Étendue Zones/Size Areas)=int(20,2,100) +#@gui :3 - Grosseur Traits/Thickness Lines=int(2,1,100) +#@gui :4 - Rendu/Rendering=choice(0,"Couleurs","Blanc","Noir") +#@gui :_=note("Couleurs/Colors") +#@gui :5 - Intensité/intensity=float(0.05,-0.1,0.2) +#@gui :_=note("Flou/Blur") +#@gui :6 - Étendue/Extent=int(0,0,300) +#@gui :7 - Intensité/Intensity=float(0,-0.05,0.2) +#@gui :_=note("Fond/Background") +#@gui :8-9-10-11 Color=color(#00000000) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2021/01/15.") +#@gui Contours Colores:samj_Contours_Colores,samj_Contours_Colores(1) +#@gui :_=note("samj_Contours_Colores") +#@gui :_=separator() +#@gui :_=note("Contours") +#@gui :Puissance / Pow=float(1.1,1,2) +#@gui :_=separator() +#@gui :_=note("Segment") +#@gui :Edge Threshold=float(2,0,15) +#@gui :_=separator() +#@gui :_=note("Cut") +#@gui :Couper / Cut=int(40,0,255) +#@gui :_=separator() +#@gui :_=note("Dilate") +#@gui :Dilate Contours=int(0,0,16) +#@gui :_=separator() +#@gui :_=note("Dégradation Spread") +#@gui :Spread=float(0,0,10) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/01/25.") +#@gui Edges Offsets Dots:samj_Edges_Offsets_Dots,samj_Edges_Offsets_Dots +#@gui :_=note("Edges Offsets") +#@gui :1 - Smoothness=float(1.3,0,10) +#@gui :2 - Threshold=float(40,0,50) +#@gui :3 - Scale=int(18,4,32) +#@gui :_=note("Points/Dots") +#@gui :4 - Rayon/Radius=int(2,1,4) +#@gui :5 - Densité/Density=int(4,1,5) +#@gui :6 - Couleurs=float(0,-0.1,0.2) +#@gui :_=note("Fond/Background") +#@gui :7-8-9-10 Couleur/Color=color(#00000000) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2021/01/19.") +#@gui Quelques Isophotes:samj_Quelques_Isophotes,samj_Quelques_Isophotes (1) +#@gui :Épaisseur=int(10,1,32) +#@gui :Précision=int(10,1,32) +#@gui :Coeff Précision=float(1,0.1,8) +#@gui :Coeff Flou=float(0.02,0,1) +#@gui :Isophotes=int(8,2,32) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/11/23.") +#@gui Quelques Isophotes B:samj_Quelques_Isophotes_B,samj_Quelques_Isophotes_B (1) +#@gui :Nb Décomposition Couleurs=int(16,2,32) +#@gui :Variation Couleurs %=float(100,25,100) +#@gui :Type Variation Couleurs=choice(0,"Min","Max","Min Max") +#@gui :Dilate=int(0,0,8) +#@gui :Isophotes=int(4,2,16) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2017/01/14.") +#@gui Quelques Isophotes C:samj_Quelques_Isophotes_C,samj_Quelques_Isophotes_C +#@gui :_=link("https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre-quelques.html","https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre-quelques.html") +#@gui :_=separator() +#@gui :_=note("Contours") +#@gui :Flou/Blur=float(0,0,20) +#@gui :Normalize Min=int(0,0,255) +#@gui :Normalize Max=int(160,0,255) +#@gui :Cut Min=int(0,0,255) +#@gui :Cut Max=int(80,0,255) +#@gui :Isophotes=int(6,2,64) +#@gui :Épaisseur/thickness=int(4,1,64) +#@gui :Decalage X=int(1,-20,+20) +#@gui :Decalage Y=int(1,-20,+20) +#@gui :_=separator() +#@gui :_=note("Wind") +#@gui :Wind=bool(0) +#@gui :Amplitude=int(20,1,100) +#@gui :Angle=float(45,0,360) +#@gui :Attenuation=float(0.7,0,1) +#@gui :Threshold=int(20,1,50) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/10/28.") +#@gui Samj Shapeprevalent Contours:samj_shapeprevalent_contours,samj_shapeprevalent_contours_preview(0)* +#@gui :_=separator() +#@gui :_=note("Fond/Background") +#@gui :1 - Flou/Blur=float(4,0,8) +#@gui :2 - Sharpen=int(0,0,4000) +#@gui :3 - Smooth=int(200,0,400) +#@gui :4 - Quantize=int(32,8,128) +#@gui :5 - Dilate=int(8,0,32) +#@gui :6 - Erode=int(4,0,32) +#@gui :7 - Surface/Area=int(50,2,100) +#@gui :8 - Repeat=int(1,1,10) +#@gui :9 - Couleurs/Colors=float(1,0.5,2) +#@gui :_=separator() +#@gui :_=note("Contours") +#@gui :10 - Ligne/Thickness=int(2,1,16) +#@gui :11 - Antialiasing=bool(1) +#@gui :12 - Seulement/Only Contours=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/04/08.") +#@gui Scintillements Colores Contours:samj_Scintillements_Colores_Contours,samj_Scintillements_Colores_Contours(1) +#@gui :_=note("samj_Scintillements_Colores_Contours") +#@gui :_=separator() +#@gui :_=note("Limites via Isophote") +#@gui :Flou=int(0,0,10) +#@gui :Isophotes=int(8,6,16) +#@gui :Dilate=int(0,0,10) +#@gui :_=separator() +#@gui :_=note("Scintillement") +#@gui :Résolution L=int(8,1,32) +#@gui :Résolution H=int(8,1,32) +#@gui :Dimension Variation=float(1,0.3,3) +#@gui :Variation Couleur=int(768,1,768) +#@gui :Scintillement=int(12,3,24) +#@gui :Angle Décalage=float(0,0,120) +#@gui :Variation Aléatoire=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("Flou") +#@gui :Flou / Blur Contours=float(0,0,5) +#@gui :_=separator() +#@gui :_=note("Overlay") +#@gui :Overlay=bool(0) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond / Background Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/04.") +#@gui Skeletation:samj_Skeletation,samj_Skeletation(1) +#@gui :_=note("samj_Skeletation") +#@gui :_=note("Skeleton") +#@gui :Skeletation=int(2,2,10) +#@gui :Smoothness A %=int(100,10,100) +#@gui :Smoothness B %=int(100,10,100) +#@gui :_=note("Blend") +#@gui :Blend=bool(0) +#@gui :Mode=choice(0,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/01/20.") +#@gui Test Mauvais Contours:samj_Test_Mauvais_Contours,samj_Test_Mauvais_Contours(0) +#@gui :_=note("samj_Test_Mauvais_Contours") +#@gui :Spread - Watershed +=float(0,-30,30) +#@gui :Déformation A=int(0,0,20) +#@gui :Déformation B=int(0,0,20) +#@gui :Itérations=int(2,1,10) +#@gui :Pow=float(1,0.1,3) +#@gui :Na=int(0,0,255) +#@gui :Nb=int(255,0,255) +#@gui :Ca=int(0,0,255) +#@gui :Cb=int(255,0,255) +#@gui :Negate=bool(0) +#@gui :_=separator() +#@gui :_=note("Blend") +#@gui :Blend=bool(0) +#@gui :Mode=choice(3,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Area Max","Shape Area Max0","Shape Area Min","Shape Area Min0","Shape Average","Shape Average0","Shape Min","Shape Min0","Shape Max","Shape Max0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Reverse=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2016/12/30.") +#@gui _Deformations +#@gui Beigne Donut:samj_Beigne,samj_Beigne +#@gui :_=link("Documentation","https://samjcreations.blogspot.com/2021/01/samuser-avec-gmic-gimp-filtre-beigne.html") +#@gui :_=note("Bonne Année 2021") +#@gui :1 - Trou De Beigne/Donut Hole=float(100,0,300) +#@gui :2 - Effet/Effect=choice(0,"Circulaire/Circular","Carré/Square") +#@gui :3 - Rotation Angle=choice(0,"0","90","-90","180") +#@gui :4-5-6-7 Fond/Background=color(#00000000) +#@gui :_=note("Contours") +#@gui :8 - Contours=bool(0) +#@gui :9 - X=int(20,0,300) +#@gui :10 - Y=int(20,0,300) +#@gui :11-12-13-14 Couleur/Color=color(#ffffffff) +#@gui :_=note("Symétrie/Symmetry") +#@gui :15 - Symétrie/Symmetry=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2021/01/01.") +#@gui Cercle Polaire:samj_Cercle_Polaire,samj_Cercle_Polaire(1) +#@gui :_=note("samj_Cercle_Polaire") +#@gui :_=separator() +#@gui :_=note("Rendu") +#@gui :Répétitions=int(1,1,4) +#@gui :Rotation=float(0,0,360) +#@gui :Type Raccord=choice(0,"Sans","A","B","A+B","C") +#@gui :_=separator() +#@gui :_=note("Array [mirrored]") +#@gui :Itérations=int(1,1,4) +#@gui :X-Offset (%)=float(0,0,100) +#@gui :Y-Offset (%)=float(0,0,100) +#@gui :Array Mode=choice(2,"X-Axis","Y-Axis","Xy-Axes","2xy-Axes") +#@gui :Initialization=choice(0,"Original","Mirror X","Mirror Y","Rotate 90 Deg.","Rotate 180 Deg.","Rotate 270 Deg.") +#@gui :Expand Size=bool(0) +#@gui :Crop (%)=int(0,0,100) +#@gui :_=note("Polar To Euclidean") +#@gui :X-Center (%)=float(50,0,100) +#@gui :Y-Center (%)=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Ecraser Etirer:samj_Ecraser_Etirer,samj_Ecraser_Etirer_preview(0) +#@gui :_=note("samj_Ecraser_Etirer") +#@gui :Découpage=int(12,2,32) +#@gui :Effet=choice(0,"Ecraser Le Bas","Ecraser Le Haut","Etirer Le Haut","Etirer Le Bas") +#@gui :Taille Origine=bool(0) +#@gui :Pivoter Image Origine 90=bool(0) +#@gui :Pourcentage Step=float(100,1,300) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: samj. Latest update: 2018/04/25.") +#@gui Ecraser Etirer V2:samj_Ecraser_Etirer_V2,samj_Ecraser_Etirer_V2_preview(0) +#@gui :_=note("samj_Ecraser_Etirer_V2") +#@gui :Découpage=int(12,2,32) +#@gui :Effet=choice(0,"A","B","C","D") +#@gui :Taille Origine=bool(0) +#@gui :Pourcentage Step=float(100,1,300) +#@gui :Pourcentage Découpe=float(50,25,75) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: samj. Latest update: 2020/10/24.") +#@gui Random Small Deformations:samj_Random_Small_Deformations,samj_Random_Small_Deformations(0) +#@gui :_=separator() +#@gui :_=note("samj_Random_Small_Deformations") +#@gui :Noise Amplitude=float(10,0,200) +#@gui :Dilate=int(5,1,20) +#@gui :Blur=float(3,0,20) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2016/12/07.") +#@gui Random Small Deformations B:samj_Random_Small_Deformations_B,samj_Random_Small_Deformations_B +#@gui :_=separator() +#@gui :_=note("samj_Random_Small_Deformations_B") +#@gui :1 - Noise Amplitude=float(10,0,200) +#@gui :2 - Dilate=int(5,1,20) +#@gui :3 - Blur=float(3,0,20) +#@gui :4 - Outline=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2022/08/18.") +#@gui Samj Deformation 20230712:samj_deformation_20230712,samj_deformation_20230712 +#@gui :_=separator() +#@gui :1 - Deform Iter=int(6,3,12) +#@gui :2 - Deform=int(6,3,12) +#@gui :3 - Mélange/Blend=float(0.25,0.25,1) +#@gui :4 - Normalize=bool(1) +#@gui :5 - Graine/Seed=int(1,0,65536) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/07/12.") +#@gui _Degradations +#@gui Deteriorated Areas:samj_Zones_Grises,samj_Zones_Grises(1) +#@gui :_=note("samj_Zones_Grises / Deteriorated Areas") +#@gui :_=note("Contours") +#@gui :Itérations=int(3,1,10) +#@gui :Type=choice(0,"A","B","C") +#@gui :Variations=float(3,1,10) +#@gui :_=note("Blend") +#@gui :Itérations=int(4,1,8) +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj Dernière mise à jour : 2015/04/04.") +#@gui Ellipses Inpaint:samj_Ellipses_Inpaint,samj_Ellipses_Inpaint(1) +#@gui :_=note("samj_Ellipses_Inpaint") +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Couleur Limite=color(#000000) +#@gui :_=separator() +#@gui :_=note("Ellipse") +#@gui :Rayon L=int(8,1,32) +#@gui :Rayon H=int(8,1,32) +#@gui :_=separator() +#@gui :_=note("Limite") +#@gui :Rendu=choice(2,"A","Inverser","A + Inverser") +#@gui :_=separator() +#@gui :_=note("Random Dégradation") +#@gui :Dégradation=bool(0) +#@gui :Sponge=int(10,1,16) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Image Segments Degrades:samj_Image_Segments_Degrades,samj_Image_Segments_Degrades(0) +#@gui :_=separator() +#@gui :_=note("Ce filtre est très lent - This filter is very slow") +#@gui :_=separator() +#@gui :_=note("Mettre au moins 2000 pour avoir des résultats intéressants.") +#@gui :_=note("Configure 2000 to have interesting results.") +#@gui :1 - Densité/Density=int(2000,1,33333) +#@gui :_=separator() +#@gui :2 - Variation=float(5,1,100) +#@gui :3 - Dilate=int(1,1,5) +#@gui :4 - Fond/Background=bool(0) +#@gui :5 6 7 8 - Fond/Background=color(#000000ff) +#@gui :9 - Graine/Seed=int(1234,0,65536) +#@gui :10 - Deformation=int(0,0,10) +#@gui :11 - X=choice(0,"Sans/Without","X") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/09/06.") +#@gui Image Vers Segments:samj_Image_Vers_Segments,samj_Image_Vers_Segments(0) +#@gui :_=separator() +#@gui :_=note("Ce filtre est très lent - This filter is very slow") +#@gui :_=separator() +#@gui :_=note("Mettre au moins 15000 pour avoir des résultats intéressants.") +#@gui :_=note("Configure 15000 to have interesting results.") +#@gui :1 - Densité/Density=int(1500,1,33333) +#@gui :_=separator() +#@gui :_=note("Si le paramètre 2 est à 0 tracé des segments sur toute l'image pour faire un cadre par exemple.") +#@gui :_=note("If parameter 2 is 0 drawn segments over the entire image to make a frame for example.") +#@gui :2 - Variation=float(5,0,100) +#@gui :_=separator() +#@gui :3 - Dilate=int(1,1,5) +#@gui :4 - Fond/Background=bool(0) +#@gui :5 6 7 8 - Fond/Background=color(#000000ff) +#@gui :9 - Graine/Seed=int(1234,0,65536) +#@gui :10 - Deformation=int(0,0,10) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/08/26.") +#@gui Path Et Solidify:samj_Degradations_Path_Solidify,samj_Degradations_Path_Solidify (1) +#@gui :_=separator() +#@gui :_=note("samj_Degradations_Path_Solidify") +#@gui :_=separator() +#@gui :_=note("Dégradations Image Origine") +#@gui :Pixelise=int(0,0,32) +#@gui :Spread=int(0,0,32) +#@gui :Deform=int(0,0,10) +#@gui :Isophotes=int(0,0,15) +#@gui :Blur=float(0,0,2) +#@gui :_=separator() +#@gui :_=note("Path") +#@gui :Patch Type=choice(2,"Max Patch","Min Patch","Max Et Min Path") +#@gui :Valeur Patch=int(10,1,50) +#@gui :_=separator() +#@gui :_=note("Dégradations Apres Path") +#@gui :Dilate Type=choice(1,"Dilate Circ","Dilate") +#@gui :Valeur Dilate=int(0,0,16) +#@gui :_=separator() +#@gui :Valeur Erode=int(0,0,16) +#@gui :_=separator() +#@gui :_=note("Solidify") +#@gui :Valider Solidify=bool(1) +#@gui :Smoothness %=float(75,0,100) +#@gui :Diffusion Type=choice(0,"Isotropic","Delaunay Oriented","Edge Oriented") +#@gui :Diffusion Iter=int(20,1,200) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/14.") +#@gui Random Plasma:samj_Random_Plasma,samj_Random_Plasma(1) +#@gui :_=note("samj_Random_Plasma") +#@gui :Random Colors=int(0,0,4) +#@gui :Blur=int(80,20,120) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2016/11/05.") +#@gui Samj Rotate Flip Image:samj_rotate_flip_image,samj_rotate_flip_image(1) +#@gui :_=separator() +#@gui :_=note("Rotation") +#@gui :1 - Rotation=bool(1) +#@gui :2 - Angle Degrés/Degrees=float(-45,-180,180) +#@gui :3 - Interpolation=choice(2,"None","Linear","Bicubic") +#@gui :4 - Remplissage/Boundary Conditions=choice(0,"Dirichlet","Neumann","Periodic","Mirror") +#@gui :5 - Ajuster/Adjust Image=bool(1) +#@gui :_=separator() +#@gui :_=note("Retourner / Flip") +#@gui :6 - Retourner/Flip=bool(0) +#@gui :7 - Horizontal Vs Vertical=bool(0) +#@gui :_=separator() +#@gui :_=note("Couleur du fond / Background Color") +#@gui :8 - Fond/Background=bool(0) +#@gui :9 10 11 12 - Fond/Background=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/05/06.") +#@gui Samj Selection Ellipse:samj_Selection_Ellipse,samj_Selection_Ellipse_preview(1) +#@gui :_=separator() +#@gui :_=note("Position") +#@gui :1 2 - Centre=point(50,50,0,1,255,255,0,-128,1%) +#@gui :_=note("Dimensions") +#@gui :3 - R % Diagonale/Diagonal=float(30,0,200) +#@gui :4 - R % Diagonale/Diagonal=float(20,0,200) +#@gui :_=note("Angle") +#@gui :5 - Degrés/Degrees=float(0,-180,180) +#@gui :_=note("Complément/Complement") +#@gui :6 - Extérieur/Outside=bool(0) +#@gui :_=note("Rogner selon le contenu / Crop to content") +#@gui :7 - Autocrop=bool(0) +#@gui :_=note("Pivoter la sélection / Rotate the selection") +#@gui :8 - Pivoter/Rotate=choice(0,"Non/No","Angle","Angle-90","Angle+90","Angle+180") +#@gui :_=separator() +#@gui :_=note("Aperçu Grille / Preview Grid") +#@gui :9 - Visualiser/Preview=bool(0) +#@gui :10 - Divisions X Y=int(2,2,40) +#@gui :11 - Couleur Grille/Color Grid=int(255,0,255) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Pour ajouter un flou utiliser le filtre Blur [Depth-Of-Field] par David Tschumperlé.") +#@gui :_=note("To add a blur use the Blur [Depth-Of-Field] filter by David Tschumperlé.") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/05/06.") +#@gui Samj Selection Hermite Spline:samj_Selection_Hermite_Spline,gui_no_preview +#@gui :_=separator() +#@gui :_=note("Ce filtre utilise la commande interactive 'x_spline'\net affichera une nouvelle fenêtre selon le paramètrage ci-dessous.\n") +#@gui :_=note("This filter uses the interactive command 'x_spline'\nand will display a new window according to the parameters below.\n") +#@gui :_=separator() +#@gui :_=note("Launch spline curve editor.") +#@gui :_=note("Spline curve editor:\n\nMouse to insert/move/delete points.\nKey 'R' to reset the curve.\nKey 'SPACE' to shows/hide spline curve.\nKey 'P' to shows/hide control points.") +#@gui :_=note("Key 'ENTER' to shows/hide control polygon.\nKey 'T' to shows/hide point tangents.\nKey 'I' to shows/hide point indices.") +#@gui :_=note("Key 'C' to shows/hide point coordinates.\nKeys '+' and '-' to increase/decrease roundness.\nKeys 'ESC' or 'Q' to exit.\n") +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Rogner selon le contenu / Crop to content") +#@gui :1 - Autocrop=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/05/06.") +#@gui Samj Selection Polygone:samj_Selection_Polygone,samj_Selection_Polygone_preview(1) +#@gui :_=separator() +#@gui :_=note("Nombre de points/Number of points") +#@gui :1 - Points=int(8,3,8) +#@gui :_=note("Point A") +#@gui :2 3 - A=point(3,3,0,1,255,0,0,-128,1%) +#@gui :_=note("Point B") +#@gui :4 5 - B=point(50,20,0,1,255,255,0,-128,1%) +#@gui :_=note("Point C") +#@gui :6 7 - C=point(97,3,0,1,0,255,0,-128,1%) +#@gui :_=note("Point D") +#@gui :8 9 - D=point(80,50,0,1,0,255,255,-128,1%) +#@gui :_=note("Point E") +#@gui :10 11 - E=point(97,97,0,1,0,0,255,-128,1%) +#@gui :_=note("Point F") +#@gui :12 13 - F=point(50,80,0,1,255,0,255,-128,1%) +#@gui :_=note("Point G") +#@gui :14 15 - G=point(3,97,0,1,255,255,255,-128,1%) +#@gui :_=note("Point H") +#@gui :16 17 - H=point(20,50,0,1,127,127,127,-128,1%) +#@gui :_=note("Complément/Complement") +#@gui :18 - Extérieur/Outside=bool(0) +#@gui :_=note("Rogner selon le contenu / Crop to content") +#@gui :19 - Autocrop=bool(0) +#@gui :_=separator() +#@gui :_=note("Aperçu Grille / Preview Grid") +#@gui :20 - Visualiser/Preview=bool(0) +#@gui :21 - Divisions X Y=int(2,2,40) +#@gui :22 - Couleur Grille/Color Grid=int(255,0,255) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/05/15.") +#@gui Samj Selection Rectangle:samj_Selection_Rectangle,samj_Selection_Rectangle_preview(1) +#@gui :_=separator() +#@gui :_=note("Position") +#@gui :1 2 - Centre=point(50,50,0,1,255,255,0,-128,1%) +#@gui :_=note("Dimensions") +#@gui :3 - Côté/Side A % Diagonale/Diagonal Image=float(50,0,200) +#@gui :4 - Côté/Side B % Diagonale/Diagonal Image=float(40,0,200) +#@gui :_=note("Angle") +#@gui :5 - Degrés/Degrees=float(0,-180,180) +#@gui :_=note("Complément/Complement") +#@gui :6 - Extérieur/Outside=bool(0) +#@gui :_=note("Rogner selon le contenu / Crop to content") +#@gui :7 - Autocrop=bool(0) +#@gui :_=note("Pivoter la sélection / Rotate the selection") +#@gui :8 - Pivoter/Rotate=choice(0,"Non/No","Angle","Angle-90","Angle+90","Angle+180") +#@gui :_=separator() +#@gui :_=note("Aperçu Grille / Preview Grid") +#@gui :9 - Visualiser/Preview=bool(0) +#@gui :10 - Divisions X Y=int(2,2,40) +#@gui :11 - Couleur Grille/Color Grid=int(255,0,255) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/05/06.") +#@gui Samj Selection Spline Rounded:samj_Selection_Spline_Rounded,samj_Selection_Spline_Rounded_preview(1) +#@gui :_=separator() +#@gui :_=note("Précision du trait / Precision of the line") +#@gui :1 - Précision/Precision=int(20,1,200) +#@gui :_=note("4 Splines Ou/Or 3 Splines ") +#@gui :2 - Quatre/Four Splines=bool(1) +#@gui :_=note("Point A") +#@gui :3 4 - A=point(80,20,0,1,255,0,0,-128,1%) +#@gui :_=note("Point B") +#@gui :5 6 - Deform. AC=point(95,50,0,1,255,255,0,-128,1%) +#@gui :_=note("Point C") +#@gui :7 8 - B=point(97,97,0,1,0,255,0,-128,1%) +#@gui :_=note("Point D") +#@gui :9 10 - Deform. CE=point(50,95,0,1,0,255,255,-128,1%) +#@gui :_=note("Point E") +#@gui :11 12 - C=point(20,80,0,1,0,0,255,-128,1%) +#@gui :_=note("Point F") +#@gui :13 14 - Deform. CA Ou/or CF=point(25,40,0,1,255,0,255,-128,1%) +#@gui :_=note("Point G") +#@gui :15 16 - G=point(3,3,0,1,255,255,255,-128,1%) +#@gui :_=note("Point H") +#@gui :17 18 - Deform. GA=point(40,25,0,1,127,127,127,-128,1%) +#@gui :_=note("Barycentre - Pour tester/Try Out") +#@gui :19 - Point Vs Deform=bool(0) +#@gui :_=note("Inverser la sélection / Reverse the selection") +#@gui :20 - Inverser/Reverse=bool(0) +#@gui :_=note("Rogner selon le contenu / Crop to content") +#@gui :21 - Autocrop=bool(0) +#@gui :_=separator() +#@gui :_=note("Aperçu Grille / Preview Grid") +#@gui :22 - Visualiser/Preview=bool(0) +#@gui :23 - Divisions X Y=int(2,2,40) +#@gui :24 - Couleur Grille/Color Grid=int(255,0,255) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/05/15.") +#@gui Samj Shapeprevalent Degradations:samj_shapeprevalent_degradations,samj_shapeprevalent_degradations_preview(0)* +#@gui :_=separator() +#@gui :1 - Flou/Blur=float(2,0,5) +#@gui :2 - Sharpen=int(200,0,4000) +#@gui :3 - Smooth=int(20,0,200) +#@gui :4 - Quantize=int(64,2,128) +#@gui :5 - Dilate=int(8,0,32) +#@gui :6 - Erode=int(4,0,32) +#@gui :7 - Surface/Area=int(50,2,100) +#@gui :8 - Repeat=int(1,1,10) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/04/06.") +#@gui _Details +#@gui Antialias Wavelet:samj_Antialias_Wavelet,samj_Antialias_Wavelet (0) +#@gui :_=note("Pour dessins avec crenelage") +#@gui :Flou=int(40,0,255) +#@gui :Trait=int(0,0,255) +#@gui :Cut Bas=int(127,0,255) +#@gui :Cut Haut=int(255,0,255) +#@gui :Dilate Circle W=int(1,1,3) +#@gui :Netteté=int(60,0,128) +#@gui :Dilate Circle R=int(1,1,3) +#@gui :Normaliser=bool(1) +#@gui :Itérations=int(1,1,3) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/11/17.") +#@gui Sharpen [Wavelet]:samj_Wavelet_Sharpen_Test_en,samj_Wavelet_Sharpen_Test_en(1) +#@gui :_=note("Test") +#@gui :Type=choice(0,"Decompose 2","Decompose 6") +#@gui :Iterations=int(0,0,2) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2016/11/07.") +#@gui Wavelet Sharpen Test:samj_Wavelet_Sharpen_Test,samj_Wavelet_Sharpen_Test(1) +#@gui :_=note("samj_Wavelet_Sharpen_Test") +#@gui :_=note("gimp_split_details_wavelets 2,0,0") +#@gui :Itérations=int(1,1,4) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2016/11/06.") +#@gui _Frames +#@gui At06B 2017 Frame Painting:samj_At06A_2017_frame_painting,samj_At06A_2017_frame_painting(1) +#@gui :_=separator() +#@gui :_=note("Frame") +#@gui :Size (%)=float(10,0,100) +#@gui :Contrast=float(0.4,0,1) +#@gui :Smoothness=float(6,0,30) +#@gui :Color=color(#7f7f7f) +#@gui :Vignette Size=float(2,0,50) +#@gui :Vignette Contrast=float(400,0,1000) +#@gui :Defects Contrast=float(50,0,512) +#@gui :Defects Density=float(10,0,100) +#@gui :Defects Size=float(1,0,10) +#@gui :Defects Smoothness=float(0.5,0,20) +#@gui :Serial Number=int(123456,0,1000000) +#@gui :_=separator() +#@gui :_=note("Blend GMIC") +#@gui :Mode=choice(35,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacity=float(1,0,1) +#@gui :Reverse=bool(1) +#@gui :_=separator() +#@gui :_=note("Frame Color Variation") +#@gui :Pow=float(1,0,8) +#@gui :Cut A %=float(0,0,100) +#@gui :Cut B %=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé + modification samj. Latest update: 2017/02/23.") +#@gui _Lights & Shadows +#@gui Ombre Portee:samj_Ombre_Portee,samj_Ombre_Portee (1) +#@gui :_=separator() +#@gui :_=note("Avant plan") +#@gui :QuA=int(0,0,100) +#@gui :FlA=float(0,0,10) +#@gui :InvC=bool(0) +#@gui :Limite Détails=int(128,1,255) +#@gui :Dilate=int(0,0,8) +#@gui :Couleur Avant=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("Ombre") +#@gui :Couleur Ombre=color(#7f7f7fff) +#@gui :Décalage Ombre=int(2,0,7) +#@gui :Rendu=int(2,1,7) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("Flou") +#@gui :Flou/Blur=float(0.1,0,2) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/14.") +#@gui Ombre Portee B:samj_Ombre_Portee_B,samj_Ombre_Portee_B (1) +#@gui :_=separator() +#@gui :_=note("Avant plan") +#@gui :Résolution=int(16,4,64) +#@gui :Limite Détails=int(128,1,255) +#@gui :Supprimer Noir=bool(0) +#@gui :Contour=bool(1) +#@gui :Variation Contour=int(16,-127,127) +#@gui :Clair Foncé=float(1,0,2) +#@gui :Précision Blanc=float(0,0,1) +#@gui :Précision Noir=float(0,0,1) +#@gui :_=separator() +#@gui :_=note("Ombre") +#@gui :Couleur Ombre=color(#7f7f7fff) +#@gui :Dilate=int(2,0,16) +#@gui :Flou/Blur=float(2,0,10) +#@gui :Décalage Ombre=int(2,0,7) +#@gui :Rendu=int(2,1,7) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/01.") +#@gui Ombre Portee C:samj_Ombre_Portee_C,samj_Ombre_Portee_C (1) +#@gui :_=separator() +#@gui :_=note("Avant plan") +#@gui :Isophotes=int(32,4,64) +#@gui :Dilatation=int(8,1,64) +#@gui :_=note("samj_Ombre_Portee_B") +#@gui :Résolution=int(16,4,64) +#@gui :Limite Détails=int(192,1,255) +#@gui :Supprimer Noir=bool(0) +#@gui :Contour=bool(1) +#@gui :Variation Contour=int(16,-127,127) +#@gui :Clair Foncé=float(1,0,2) +#@gui :Précision Blanc=float(0,0,1) +#@gui :Précision Noir=float(0,0,1) +#@gui :_=separator() +#@gui :_=note("Ombre") +#@gui :Couleur Ombre=color(#606060ff) +#@gui :Dilate=int(2,0,16) +#@gui :Flou/Blur=float(2,0,10) +#@gui :Décalage Ombre=int(2,0,7) +#@gui :Rendu=int(2,1,7) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/01.") +#@gui Ombre Portee D:samj_Ombre_Portee_D,samj_Ombre_Portee_D (1) +#@gui :_=separator() +#@gui :_=note("Avant Plan") +#@gui :Résolution=int(16,4,64) +#@gui :Détection A=int(64,0,255) +#@gui :Détection B=int(64,0,255) +#@gui :Flou Lissage=float(2,0,10) +#@gui :Couleur=float(1,0,4) +#@gui :Isophotes AP=int(16,4,64) +#@gui :Dilate AP=int(5,0,16) +#@gui :_=separator() +#@gui :_=note("Contours Avant Plan") +#@gui :Contour=bool(1) +#@gui :Variation Contour=int(-32,-127,127) +#@gui :_=separator() +#@gui :_=note("Ombre") +#@gui :Dilate=int(4,0,16) +#@gui :Couleur Ombre=float(1,0,4) +#@gui :Flou/Blur=float(2,0,10) +#@gui :Décalage Ombre=int(2,0,7) +#@gui :Rendu=int(2,1,7) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/03.") +#@gui Posterize Relief:samj_Posterize_Relief,samj_Posterize_Relief +#@gui :_=separator() +#@gui :_=note("Posterize") +#@gui :1 - Blur=float(1,0,5) +#@gui :2 - Colors=int(12,2,32) +#@gui :3 - Inpaint Holes=float(20,0.1,50) +#@gui :4 - Smooth=int(0,0,8) +#@gui :5 - Smooth - Smoothness=float(40,10,800) +#@gui :6 - Smooth - Edges (%)=float(30,0,100) +#@gui :7 - Smooth - Paint=float(1,0,10) +#@gui :8 - Sharpen=int(0,0,1000) +#@gui :_=separator() +#@gui :_=note("Light Relief") +#@gui :9 - Ambient Lightness=float(0.4,0.2,0.7) +#@gui :10 - Darkness=float(0,0,1) +#@gui :11 - Light Smoothness=float(1,0,5) +#@gui :12 - XY-Light=point(15,60,0,1,255,255,128,200,10) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/08/17.") +#@gui _Patterns +#@gui Contours Gros Pixels:samj_Contours_Gros_Pixels,samj_Contours_Gros_Pixels(1) +#@gui :_=note("Contours GrosPixels") +#@gui :Flou/Blur=float(1,0,5) +#@gui :Isophotes Nb Levels=int(8,1,256) +#@gui :Dilatation=int(0,0,10) +#@gui :Gros Pixels X=int(20,5,90) +#@gui :Gros Pixels Y=int(20,5,90) +#@gui :Quantize Levels=int(16,1,256) +#@gui :Couleur=float(1.1,0.8,4) +#@gui :Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("Edges") +#@gui :VALIDATION EDGES=bool(0) +#@gui :Threshold=float(15,0.5,50) +#@gui :Colorization=bool(0) +#@gui :Alpha Colorization=bool(0) +#@gui :Colorization Mode=choice(0,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Colorization Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Degrades HSL TSL:samj_Degrades_HSL_TSL,samj_Degrades_HSL_TSL(1) +#@gui :_=separator() +#@gui :_=note("Rendu") +#@gui :Type Dégradé=choice(4,"V Couleur A","H Couleur A","V Couleur B","H Couleur B","V Couleurs A/B","H Couleurs A/B","V Couleurs A/B Inv.","H Couleurs A/B Inv.") +#@gui :Dimensions Image=int(800,128,2048) +#@gui :Couleur A=color(#f0f028ff) +#@gui :Couleur B=color(#7828f0ff) +#@gui :Décalage H=float(0,0,360) +#@gui :Décalage S=float(0,0,100) +#@gui :Décalage L=float(0,0,100) +#@gui :Variation H=float(360,1,360) +#@gui :Variation S=float(100,1,100) +#@gui :Variation L=float(100,1,100) +#@gui :Valider Variations Canal Alpha=bool(0) +#@gui :Dégradés Aléatoires=bool(0) +#@gui :H Min. Ded. Aléa.=float(0,0,718) +#@gui :H Max. Ded. Aléa.=float(718,0,718) +#@gui :S Min. Ded. Aléa.=float(75,0,100) +#@gui :S Max. Ded. Aléa.=float(100,0,100) +#@gui :L Min. Ded. Aléa.=float(0,0,100) +#@gui :L Max. Ded. Aléa.=float(100,0,100) +#@gui :Inverser Dégradé=bool(0) +#@gui :Formes=choice(0,"Non","Sinus V - Param A B","Sinus H - Param A B","Cercles - Param A B","Rayons - Param A B","Lignes V Norm - Param A B","Lignes H Norm - Param A B","Plaid","Carré","Croix","Perspective - Param A","Sphere A","Sphere B") +#@gui :Paramètre Forme A=int(0,0,100) +#@gui :Paramètre Forme B=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui ___Patterns +#@gui Denim Texture:Denim_samj,Denim_samj(0) +#@gui :_=separator() +#@gui :_=note("Texture") +#@gui :Dimension Motif Base=int(5,2,30) +#@gui :Dilatation Motif / Pattern=int(2,0,5) +#@gui :Retourner Motif / Flip Pattern=bool(0) +#@gui :Déformation 1=int(40,0,200) +#@gui :Déformation 2=int(40,0,200) +#@gui :Denim [bruit/noise]=int(25,0,100) +#@gui :Usure [bruit/noise]=int(50,0,100) +#@gui :Netteté / Sharpness=float(0,0,500) +#@gui :_=separator() +#@gui :_=note("Couleur") +#@gui :Couleur Denim=color(#2b6c7eff) +#@gui :_=separator() +#@gui :_=note("samj - Version : 2020/10/24.") +#@gui _Testing +#@gui Samj +#@gui Patterns +#@gui EPPE Transform:samj_EPPE_Transform,samj_EPPE_Transform(1) +#@gui :_=note("samj_EPPE_Transform") +#@gui :X Centre=float(50,0,100) +#@gui :Y Centre=float(50,0,100) +#@gui :Rendu=choice(0,"Imagegrid","Imagegrid Hexagonal","Imagegrid Triangular","BoxFitting") +#@gui :_=separator() +#@gui :_=note("Imagegrid") +#@gui :X-Size=int(10,2,100) +#@gui :Y-Size=int(10,2,100) +#@gui :_=separator() +#@gui :_=note("Imagegrid Hexagonal") +#@gui :Résolution=int(32,1,128) +#@gui :Outline=float(0.1,0,0.5) +#@gui :_=separator() +#@gui :_=note("Imagegrid Triangular") +#@gui :Pattern Width=int(10,8,128) +#@gui :Pattern Height=int(18,8,128) +#@gui :Pattern Type=choice(0,"Horizontal","Vertical","Crossed","Cube","Decreasing","Increasing") +#@gui :Outline Color=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("BoxFitting") +#@gui :Minimal Size=int(3,1,32) +#@gui :Maximal Size=int(0,0,32) +#@gui :Initial Density=float(0.1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Formes Couleurs Variees Dans Image:samj_Formes_Couleurs_Variees_Dans_Image,samj_Formes_Couleurs_Variees_Dans_Image(1) +#@gui :Formes=choice(0,"Sinus V - Param A B","Sinus H - Param A B","Cercles - Param A B","Rayons - Param A B","Lignes V","Lignes H","Tiled V - Param A B C D","Tiled H - Param A B C D","Lignes V Norm - Param A B","Lignes H Norm - Param A B","Plaid","Carré","Croix","Perspective - Param A","Sphere A","Sphere B") +#@gui :Paramètre Forme A=int(0,0,100) +#@gui :Paramètre Forme B=int(0,0,100) +#@gui :Paramètre Forme C=int(0,0,100) +#@gui :Paramètre Forme D=int(0,0,100) +#@gui :Canal R=int(192,0,255) +#@gui :Canal V=int(128,0,255) +#@gui :Canal B=int(64,0,255) +#@gui :Canal Alpha=int(255,0,255) +#@gui :Valider Variations Canal R=bool(1) +#@gui :Valider Variations Canal V=bool(1) +#@gui :Valider Variations Canal B=bool(1) +#@gui :Valider Variations Canal Alpha=bool(0) +#@gui :Type Variations=choice(0,"A","B","C","D","E","F") +#@gui :Décalage=int(127,0,255) +#@gui :Etendue=int(255,1,255) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,200) +#@gui :Canal Alpha=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Lignes H Ou V Colorees:samj_Lignes_H_ou_V_Colorees,samj_Lignes_H_ou_V_Colorees(1) +#@gui :_=separator() +#@gui :_=note("samj_Lignes_H_ou_V_Colorees - Colored Lines") +#@gui :Couleur - Color A=color(#9fbec3) +#@gui :Couleur - Color B=color(#37438c) +#@gui :Couleur - Color C=color(#362827) +#@gui :Couleur - Color D=color(#8c5158) +#@gui :Couleur - Color E=color(#cfafbe) +#@gui :Couleur - Color F=color(#dccac4) +#@gui :Couleur - Color G=color(#aabac0) +#@gui :Couleur - Color H=color(#82958b) +#@gui :Couleur - Color I=color(#706060) +#@gui :Couleur - Color J=color(#eda88a) +#@gui :Couleur - Color K=color(#dcc7cd) +#@gui :Couleur - Color L=color(#ead9db) +#@gui :Alpha=int(255,1,255) +#@gui :Largeur - Width=int(256,2,1024) +#@gui :Nombre De Lignes - Number Of Lines=int(256,2,1024) +#@gui :Hauteur De Une Ligne - Height Of One Line=int(1,1,20) +#@gui :Rotation 90 Degrés - Vertical Lines=bool(0) +#@gui :Origine - First Color=choice(0,"A","B","C","D","E","F","G","H","I","J","K","L") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Marbre Marble:samj_Marbre,samj_Marbre(1) +#@gui :_=note("samj_Marbre") +#@gui :_=separator() +#@gui :_=note("Plasma") +#@gui :Alpha=float(1,0,5) +#@gui :Beta=float(1,0,100) +#@gui :Scale=int(8,2,10) +#@gui :_=separator() +#@gui :_=note("Flou-Blur") +#@gui :Flou/Blur=float(5,2,20) +#@gui :_=separator() +#@gui :_=note("Gris-Gray") +#@gui :Gris/Gray=float(0.2,0.1,0.6) +#@gui :_=separator() +#@gui :_=note("Bruit-Noise") +#@gui :Spread=int(0,0,10) +#@gui :Atténuation=float(0,0,2) +#@gui :_=separator() +#@gui :_=note("Couleur-Color") +#@gui :Colorisation=bool(0) +#@gui :Couleur / Color=color(#8c78dc) +#@gui :_=separator() +#@gui :_=note("Blend Image") +#@gui :Blend Image=bool(0) +#@gui :Mode=choice(3,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Mosaic A:samj_Mosaic_A,samj_Mosaic_A +#@gui :1 - Tuiles Taille/Tiles Size=int(20,10,40) +#@gui :2 - Joints=int(3,2,5) +#@gui :_=note("Relief") +#@gui :3 - Relief=bool(1) +#@gui :4 - Lumière/Light=float(0,0,1) +#@gui :5 - Lumière/Light Orientation=int(0,0,3) +#@gui :6 - Fancy Mosaic - Slow=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/09/10.") +#@gui Mosaic B:samj_Mosaic_B,samj_Mosaic_B +#@gui :_=note("Rendu aléatoire/Random rendering") +#@gui :1 - Tuiles Densité/Tiles Density=int(30,5,50) +#@gui :2 - Créativité/Creativity A=int(400,0,4000) +#@gui :3 - Créativité/Creativity B=int(1,0,10) +#@gui :4 - Créativité/Creativity C=int(100,0,200) +#@gui :5 - Joints=int(1,0,5) +#@gui :_=note("Relief") +#@gui :6 - Relief=bool(1) +#@gui :7 - Lumière/Light=float(0,0,1) +#@gui :8 - Lumière/Light Orientation=int(0,0,3) +#@gui :9 - Fancy Mosaic - Slow=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2023/02/13.") +#@gui Motif Plasma:samj_Motif_Plasma,samj_Motif_Plasma(0) +#@gui :_=separator() +#@gui :_=note("Motif Plasma") +#@gui :Détails=int(2,1,8) +#@gui :Plasma A=int(20,0,32) +#@gui :Plasma B=int(20,0,32) +#@gui :Flou Pourcent=int(30,1,100) +#@gui :Mélange Mode=int(1,0,1) +#@gui :Mélange Pourcent=int(75,0,100) +#@gui :Graine - 0 Pour Motif Aléatoire=int(0,0,1000000) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/02/17.") +#@gui Motifs 7200:samj_Motifs_7200,samj_Motifs_7200(0) +#@gui :_=separator() +#@gui :_=note("Motif Plasma") +#@gui :Détails=int(2,1,8) +#@gui :Plasma 0 - Bruit Aléatoire 1=bool(0) +#@gui :Plasma A - Bruit Dimension=int(20,0,32) +#@gui :Plasma B - Bruit Dimension=int(20,0,32) +#@gui :Flou Pourcent=int(30,1,100) +#@gui :Mélange Mode=int(1,0,1) +#@gui :Mélange Pourcent=int(75,0,100) +#@gui :Graine - 0 Pour Motif Aléatoire=int(0,0,1000000) +#@gui :Effet=choice(0,"0 Plasma","1 CA","2 BR","3 CA BR","4 RS CA","5 RS BR","6 RS CA BR","7 PD","8 PD RS","9 PD BR","10 PD RS BR") +#@gui :Couleur Random Shade=color(#ff00ddff) +#@gui :Ajouter Rolling Guidance [lissage]=bool(0) +#@gui :Ajouter Mess With Bits=bool(0) +#@gui :Ajouter CeKoaSa 004=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/02/17.") +#@gui Motifs 7200 Variante A:samj_Motifs_7200_VarianteA,samj_Motifs_7200_VarianteA(0) +#@gui :_=separator() +#@gui :_=note("Pour obtenir des motifs autour de la couleur choisie") +#@gui :_=separator() +#@gui :_=note("Motif Plasma") +#@gui :Détails=int(2,1,8) +#@gui :Plasma 0 - Bruit Aléatoire 1=bool(0) +#@gui :Plasma A - Bruit Dimension=int(20,0,32) +#@gui :Plasma B - Bruit Dimension=int(20,0,32) +#@gui :Flou Pourcent=int(30,1,100) +#@gui :Mélange Mode=int(1,0,1) +#@gui :Mélange Pourcent=int(75,0,100) +#@gui :Graine - 0 Pour Motif Aléatoire=int(0,0,1000000) +#@gui :Effet=choice(0,"0 Plasma","1 CA","2 BR","3 CA BR","4 RS CA","5 RS BR","6 RS CA BR","7 PD","8 PD RS","9 PD BR","10 PD RS BR") +#@gui :Couleur Random Shade=color(#ff00ddff) +#@gui :Ajouter Rolling Guidance [lissage]=bool(0) +#@gui :Ajouter Mess With Bits=bool(0) +#@gui :Ajouter CeKoaSa 004=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/02/19.") +#@gui Motifs 7200 VarianteB:samj_Motifs_7200_VarianteB,samj_Motifs_7200_VarianteB(0) +#@gui :_=separator() +#@gui :_=note("Pour obtenir des motifs cheveux peignes") +#@gui :Détails=int(4,1,8) +#@gui :Bruit En Plus=int(0,0,64) +#@gui :Déformation En Plus=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("sketchbw") +#@gui :Number of Orientations=int(3,1,16) +#@gui :Starting Angle=float(45,0,180) +#@gui :Angle Range=float(180,0,180) +#@gui :Stroke Length=float(30,0,1000) +#@gui :Contour Threshold=float(0.75,0,10) +#@gui :Opacity=float(0.02,0,0.3) +#@gui :Background Intensity=float(0.5,0,2) +#@gui :Density=float(1.5,0,5) +#@gui :Sharpness=float(0.1,0,1) +#@gui :Anisotropy=float(1,0,1) +#@gui :Smoothness=float(10,0,10) +#@gui :Cohérence=float(10,0,10) +#@gui :Boost Stroke=bool(1) +#@gui :Curved Stroke=bool(1) +#@gui :Color Model=choice(4,"Black on White","White on Black","Black on Transparent White","White on Transparent Black","Color on White") +#@gui :_=separator() +#@gui :_=note("Dispersion") +#@gui :Dispersion=int(48,1,100) +#@gui :DispersionDeform=int(4,1,10) +#@gui :Cut Vs Norm=bool(1) +#@gui :Seamless Vs Edges=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/02/20.") +#@gui Motifs 7200 VarianteC:samj_Motifs_7200_VarianteC,samj_Motifs_7200_VarianteC(0) +#@gui :_=separator() +#@gui :_=note("Pour obtenir des chemins courbes") +#@gui :Détails=int(4,1,8) +#@gui :Bruit=int(32,2,64) +#@gui :Flou A=int(64,2,128) +#@gui :Déformation=int(32,1,100) +#@gui :Seamless Vs Edges A=bool(1) +#@gui :Flou B=int(5,2,10) +#@gui :Couleur=color(#ff00dd) +#@gui :Seamless Vs Edges B=bool(0) +#@gui :Etendue Couleurs=choice(0,"Cut Norm","Cut","Norm","Rien") +#@gui :_=separator() +#@gui :_=note("Dégradé") +#@gui :Ajouter Dégradé=bool(0) +#@gui :Type H / V=choice(0,"H","V") +#@gui :Swap Colors=bool(0) +#@gui :Starting Color A=color(#f028a0ff) +#@gui :Ending Color B=color(#f0f028ff) +#@gui :Colorspace=choice(0,"SRGB","Linear RGB","Lab") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/02/20.") +#@gui Motifs Aleatoires Symetriques Degrades:samj_Motifs_Aleatoires_Symetriques_Degrades,samj_Motifs_Aleatoires_Symetriques_Degrades(1) +#@gui :_=separator() +#@gui :_=note("Rendu") +#@gui :Type Dégradé=choice(0,"Dégradés XYZ CIE A","Dégradés XYZ CIE B","Dégradés HSL TSL","Formes Couleurs Variees Dans Image") +#@gui :Dimensions Motif=int(400,128,2048) +#@gui :Forme=int(4,3,12) +#@gui :Limite / Boundary=int(1,0,2) +#@gui :Symétrie=int(1,0,2) +#@gui :Utiliser GIMP Feltpen=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/11/15.") +#@gui Motifs Degrades CIE:samj_Degrades_XYZ_CIE,samj_Degrades_XYZ_CIE(0) +#@gui :_=separator() +#@gui :_=note("Dégradé Rendu CIE Lab") +#@gui :Type Dégradé=choice(6,"V Couleur A","H Couleur A","V Couleur B","H Couleur B","V Couleurs A/B Inv.","H Couleurs A/B Inv.","V Couleurs A/B","H Couleurs A/B") +#@gui :Dimensions Image=int(800,128,2048) +#@gui :Couleur A=color(#f0f028ff) +#@gui :Couleur B=color(#7828f0ff) +#@gui :Décalage L=float(0,0,100) +#@gui :Décalage A=float(0,-128,127) +#@gui :Décalage B=float(0,-128,127) +#@gui :Variation L=float(100,0,100) +#@gui :Variation A=float(64,0,255) +#@gui :Variation B=float(64,0,255) +#@gui :Valider Variations Canal Alpha=bool(0) +#@gui :Trou Noir=choice(0,"Non","Mode A","Mode B") +#@gui :Dégradés Aléatoires=bool(1) +#@gui :L Min. Ded. Aléa.=float(0,0,100) +#@gui :L Max. Ded. Aléa.=float(100,0,100) +#@gui :A Min. Ded. Aléa.=float(-128,-128,127) +#@gui :A Max. Ded. Aléa.=float(128,-128,127) +#@gui :B Min. Ded. Aléa.=float(-128,-128,127) +#@gui :B Max. Ded. Aléa.=float(128,-128,127) +#@gui :Inverser Dégradé=bool(0) +#@gui :Formes=choice(11,"Non","Sinus V - Param A B","Sinus H - Param A B","Cercles - Param A B","Rayons - Param A B","Lignes V Norm - Param A B","Lignes H Norm - Param A B","Plaid","Carré","Croix","Perspective - Param A","Sphere A","Sphere B") +#@gui :Paramètre Forme A=int(0,0,100) +#@gui :Paramètre Forme B=int(0,0,100) +#@gui :_=separator() +#@gui :_=note("Author: Samj. - Dernière mise à jour : 2010/10/24.") +#@gui Perpendicular Lines:samj_Lignes_Perpendiculaires,samj_Lignes_Perpendiculaires +#@gui :_=link("https://samjcreations.blogspot.com","https://samjcreations.blogspot.com") +#@gui :_=note("Lignes / Lines ") +#@gui :Couleur/Color=color(#ffffffff) +#@gui :Fréquence/Frequency=int(10,1,100) +#@gui :Répétitions/Repeat=int(1,1,100) +#@gui :Dilate=int(2,1,64) +#@gui :Graine/Seed A=int(1234,1,65536) +#@gui :Graine/Seed B=int(5678,1,65536) +#@gui :_=note("Mélange/Blend") +#@gui :Mélange Avec Image / Blend=bool(0) +#@gui :Mode=choice(0,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grainextract","Grainmerge","Green","Hardlight","Hardmix","Hue","Interpolation","Lighten","Lightness","Linearburn","Linearlight","Luminance","Multiply","Negation","Or","Overlay","Pinlight","Red","Reflect","Saturation","Seamless","Seamless Mixed","Screen","Shapeareamax","Shapeareamax0","Shapeareamin","Shapeareamin0","Shapeaverage","Shapeaverage0","Shapemedian","Shapemedian0","Shapemin","Shapemin0","Shapemax","Shapemax0","Softburn","Softdodge","Softlight","Stamp","Subtract","Value","Vividlight","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/10/30.") +#@gui Points Aleatoires 001:samj_Points_Aleatoires_001,gui_no_preview +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("Points") +#@gui :Itérations=int(10,1,200) +#@gui :Couleur Point=color(#ffff00ff) +#@gui :Mode=choice(3,"XY Aléatoire","X Aléatoire","Y Aléatoire","Cavalier","Fou","Tour","Reine") +#@gui :Couleurs Aléatoires=bool(0) +#@gui :Continuité Entre Itérations=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Pouring:samj_pouring,samj_pouring +#@gui :1 - Orientation=choice(0,"-X","-Y","+X","+Y","-XY","-YX","+XY","+YX") +#@gui :2 - Mélange/Mix A=float(1,0,2) +#@gui :3 - Mélange/Mix B=choice(0,"Forme A","Forme B","Forme C","Forme D","Forme E","Forme F") +#@gui :4 - Couleurs/Colors=float(0,0,25) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/02/25.") +#@gui Pseudo Vitrail:samj_Pseudo_Vitrail,samj_Pseudo_Vitrail +#@gui :_=separator() +#@gui :1 - Autoindex=int(0,0,1024) +#@gui :2 - Densité/Density=int(40,1,100) +#@gui :3 - Voronoi=bool(0) +#@gui :4 - Détails=float(0,0,1) +#@gui :5 - Grosseur Trait/Line Thickness=int(2,1,5) +#@gui :6-7-8-9 Trait/Line=color(#000000ff) +#@gui :10 - Itération=bool(0) +#@gui :11 - Couleurs/Colors=float(0,-0.1,0.2) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2021/01/17.") +#@gui Quickly Create Colorful Patterns:samj_Motifs_Rapides,samj_Motifs_Rapides(0) +#@gui :_=link("https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre-quickly.html","https://samjcreations.blogspot.com/2020/10/samuser-avec-gmic-gimp-filtre-quickly.html") +#@gui :_=separator() +#@gui :_=note("Array") +#@gui :Color=int(2345,0,65536) +#@gui :_=note("Set dimension to 20 or very close for very large images.") +#@gui :Dimension=float(19,0,20) +#@gui :_=note("Deform") +#@gui :Seed=int(1234,1,65536) +#@gui :Amplitude=int(30,0,1000) +#@gui :_=note("Tiles") +#@gui :Tiles=bool(0) +#@gui :Nb X Y Tiles=int(10,2,32) +#@gui :_=note("Spread") +#@gui :Seed=int(1234,1,65536) +#@gui :DxDy=int(0,0,100) +#@gui :_=note("Blur") +#@gui :Add Blur=bool(0) +#@gui :Blur=float(1,0,100) +#@gui :_=note("Dominant Color") +#@gui :Add A Dominant Color=bool(0) +#@gui :Color=color(#ffaa0080) +#@gui :_=note("Geometry") +#@gui :Symmetrize=bool(0) +#@gui :Mirror X Y=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/10/14.") +#@gui Quickly Create Colorful Patterns B:samj_Motifs_Rapides_B,samj_Motifs_Rapides_B(0) +#@gui :_=link("https://samjcreations.blogspot.com","https://samjcreations.blogspot.com") +#@gui :_=note("Pour créer rapidement des motifs sur des grosses images 7800*11400 - 13/19") +#@gui :_=note("To quickly create patterns on large images 7800*11400 - 13/19") +#@gui :_=note("Fond/Background") +#@gui :Lignes Verticales/Vertical Lines=bool(1) +#@gui :Couleurs/Colors=int(1234,1,65536) +#@gui :Épaisseur Des Lignes/Line Thickness=int(16,1,128) +#@gui :_=note("Bandes/Strips") +#@gui :Bandes/Strips=bool(0) +#@gui :Nb=int(8,2,16) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/10/31.") +#@gui Random Pattern Courtepointe:samj_Courtepointe,gui_no_preview +#@gui :_=note("Motif au rendu aléatoire / Random Pattern") +#@gui :_=separator() +#@gui :Cossin 1 / Parameter 1=int(20,1,100) +#@gui :Cossin 2 / Parameter 2=bool(0) +#@gui :Répetition / Repeat=int(1,1,5) +#@gui :Croix / Cross=bool(0) +#@gui :Texture=bool(1) +#@gui :Courbes Des Couleurs / Color Curves=choice("RGB","CMY","CMYK","HSI","HSL","HSV","Lab","Lch","YCbCr") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Rays Of Colors:samj_Rays_Of_Colors,samj_Rays_Of_Colors(0) +#@gui :Color Intensity=int(300,1,1600) +#@gui :Color Density=int(12,2,40) +#@gui :Radius=float(40,0,400) +#@gui :Border Smoothness=float(16,0,200) +#@gui :Border Width=float(38,0,100) +#@gui :Merge Layers=bool(1) +#@gui :Background Color=color(#000000) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2020/10/24.") +#@gui ___Patterns +#@gui Soft Random Shades:samj_Soft_Random_Shades,samj_Soft_Random_Shades(1) +#@gui :_=separator() +#@gui :_=note("samj_Soft_Random_Shades") +#@gui :Background Color=color(#8c78dcff) +#@gui :Variation A=int(0,0,4) +#@gui :Variation B=int(20,20,120) +#@gui :Variation C=float(0,0,0.25) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2016/12/06.") +#@gui _Testing +#@gui Samj +#@gui Patterns +#@gui Steps V2:samj_Steps_V2,samj_Steps_V2(1) +#@gui :_=separator() +#@gui :_=note("Background") +#@gui :Pixelise X=int(10,1,256) +#@gui :Pixelise X=int(10,1,256) +#@gui :Area=int(4,1,16) +#@gui :Area IHC=bool(1) +#@gui :Isophotes=int(10,1,127) +#@gui :Dilate Circle=int(2,1,5) +#@gui :Smoothness=float(60,0,100) +#@gui :_=separator() +#@gui :_=note("Background") +#@gui :Background=bool(0) +#@gui :Color=float(1.1,1,1.2) +#@gui :Variation=int(10,5,200) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2020/10/24.") +#@gui Tissu Fond Flou:samj_Tissu_Fond_Flou,samj_Tissu_Fond_Flou_preview(1) +#@gui :_=separator() +#@gui :_=note("Capture Ligne") +#@gui :X Origine=float(0,0,100) +#@gui :Y Origine=float(0,0,100) +#@gui :X Fin=float(100,0,100) +#@gui :Y Fin=float(100,0,100) +#@gui :Déplacement A=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("Tissu") +#@gui :Tissu=bool(1) +#@gui :Forme=choice(0,"A","B","C","D") +#@gui :Blend 0pacity=float(1,0,1) +#@gui :Inversion Calques Blend=bool(0) +#@gui :Angle Rotation=float(0,0,360) +#@gui :Déplacement B=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("Flou/Blur") +#@gui :Flou/Blur=float(0,0,1) +#@gui :Coeff. Flou=choice(0,"Flou/Blur *1","Flou/Blur *10","Flou/Blur *100","Flou/Blur *1000") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/02.") +#@gui Variation Stained Glass:samj_Variation_Stained_Glass,samj_Variation_Stained_Glass(1) +#@gui :_=separator() +#@gui :_=note("Colored Outlines") +#@gui :Axes=choice(0,"XY","X","Y") +#@gui :Blur=float(2,0,10) +#@gui :Isophote=float(8,6,16) +#@gui :Smooth=int(0,0,100) +#@gui :Dilate=int(3,1,16) +#@gui :_=separator() +#@gui :_=note("Stained Glass") +#@gui :Edges=float(40,0,100) +#@gui :Shading=int(100,0,200) +#@gui :Is Precise=bool(0) +#@gui :_=separator() +#@gui :_=note("Background") +#@gui :Color=float(1.1,1,1.2) +#@gui :Variation=int(20,10,200) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/11/13.") +#@gui _Rendering +#@gui Adjacent Annular Steiner Chains:samj_Adjacent_Annular_Steiner_Chains,samj_Adjacent_Annular_Steiner_Chains(1) +#@gui :_=link("http://en.wikipedia.org/wiki/Steiner_chain","http://en.wikipedia.org/wiki/Steiner_chain") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Angle Inclinaison / Tilt=float(0,0,360) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("Cercles") +#@gui :Rayon Cercle Centre / Radius Center Circle A=float(6,-100,100) +#@gui :Nb Cercles Extérieurs / Circles Surrounding=int(56,7,360) +#@gui :_=separator() +#@gui :_=note("Anneaux") +#@gui :Nb Anneaux=int(20,1,100) +#@gui :Angle Décalage / Offset Angle %=float(50,-100,100) +#@gui :Variation Increment Anneaux %=float(0,-100,200) +#@gui :_=separator() +#@gui :_=note("Couleurs Cercles") +#@gui :Couleur / Color A=color(#ff00dd7f) +#@gui :Couleur / Color B=color(#4800ff7f) +#@gui :Couleur / Color C=color(#0091ff7f) +#@gui :Couleur / Color D=color(#00ff907f) +#@gui :Couleur / Color E=color(#48ff007f) +#@gui :Couleur / Color F=color(#ffd9007f) +#@gui :Couleur / Color G=color(#ff00007f) +#@gui :Choix Des Couleurs / Choice Of Colors=choice(5,"Couleurs / Colors AB","Couleurs / Colors ABC","Couleurs / Colors ABCD","Couleurs / Colors ABCDE","Couleurs / Colors ABCDEF","Couleurs / Colors ABCDEFG","Ordre ABCDEFG") +#@gui :Variations Des Couleurs=float(0,-2,2) +#@gui :Couleurs Aléatoires / Random Colors=choice(0,"Non / No","A","B","C") +#@gui :_=separator() +#@gui :_=note("Contours") +#@gui :Affichage / Display Contours=choice(2,"Non / No","A","B","C","D","E") +#@gui :Contours=color(#000000ff) +#@gui :Dilate Contours=int(0,0,16) +#@gui :Flou / Blur Contours=float(0,0,5) +#@gui :Sharpen=int(0,0,600) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Adjacent Rectangles:samj_Rectangles_Adjacents,samj_Rectangles_Adjacents(1) +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X Haut Gauche / Top Left=float(10,-100,100) +#@gui :Position Y Haut Gauche / Top Left=float(10,-100,100) +#@gui :Position X Bas Droite / Down Right=float(80,0,100) +#@gui :Position Y Bas Droite / Down Right=float(80,0,100) +#@gui :Type / Location Contact=choice(0,"Haut - Top","Bas - Down","Gauche - Left","Droite - Right") +#@gui :Position Contact=float(50,0,100) +#@gui :Nb Rectangles=int(6,2,25) +#@gui :Type N=choice(0,"Inc 1","Lin 0.1","Lin 0.2","Lin 0.3","Rand","M1","M2") +#@gui :Angle Inclinaison / Tilt=float(0,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage / Display Contours=bool(1) +#@gui :Rectangle A=color(#ffff007f) +#@gui :Rectangle B=color(#0000ff7f) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Miroir / Mirror=choice(0,"Sans - Wihout"," X "," Y "," X Y ") +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :Décalage Ombre X / Shadow Offset X=float(0,-20,20) +#@gui :Décalage Ombre Y / Shadow Offset Y=float(0,-20,20) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Annular Steiner Chains:samj_Annular_Steiner_Chains,samj_Annular_Steiner_Chains(1) +#@gui :_=link("http://en.wikipedia.org/wiki/Steiner_chain","http://en.wikipedia.org/wiki/Steiner_chain") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Rayon Cercle Extérieur / Radius Outer Circle A (>0 W%) (<0 H%)=float(50,-400,400) +#@gui :Nb Cercles Extérieurs / Circles Surrounding=int(6,3,360) +#@gui :Angle Inclinaison / Tilt=float(0,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage / Display Contours=choice(1,"Sans","CE CI CA","CE CI CA CC","CE CI CA CC CT","CE CI CA CT","CE CA","CI CA","CA") +#@gui :Cercle Extérieur / Exterior Circle A=color(#ffff007f) +#@gui :Cercle Centre / Centre Circle B=color(#40c0807f) +#@gui :Cercle / Circle C=color(#00ff007f) +#@gui :Cercle / Circle D=color(#0000ff7f) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :Décalage Ombre X / Shadow Offset X=float(0,-20,20) +#@gui :Décalage Ombre Y / Shadow Offset Y=float(0,-20,20) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Chains Solidify:samj_Chains_Solidify,samj_Chains_Solidify(1) +#@gui :_=separator() +#@gui :_=note("samj_Chains_Solidify") +#@gui :_=separator() +#@gui :_=note("Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Angle Tilt=float(0,0,360) +#@gui :_=separator() +#@gui :_=note("Circles") +#@gui :Radius Center Circle=float(6,-100,100) +#@gui :Nb Circles Surrounding=int(56,7,360) +#@gui :_=separator() +#@gui :_=note("Rings") +#@gui :Nb Rings=int(20,1,100) +#@gui :Offset Angle %=float(50,-100,100) +#@gui :Change Increment %=float(0,-100,200) +#@gui :_=separator() +#@gui :_=note("Coulors") +#@gui :Color A=color(#ff00ddff) +#@gui :Color B=color(#4800ffff) +#@gui :Color C=color(#0091ffff) +#@gui :Color D=color(#00ff90ff) +#@gui :Color E=color(#48ff00ff) +#@gui :Color F=color(#ffd900ff) +#@gui :Color G=color(#ff0000ff) +#@gui :Choice Of Colors=choice(5,"Couleurs / Colors AB","Couleurs / Colors ABC","Couleurs / Colors ABCD","Couleurs / Colors ABCDE","Couleurs / Colors ABCDEF","Couleurs / Colors ABCDEFG","Ordre ABCDEFG") +#@gui :Center Color=color(#ff7f00ff) +#@gui :Background=color(#000000ff) +#@gui :Variation=float(100,0,1000) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2020/10/24.") +#@gui Christmas Balls:samj_Noel_2016,samj_Noel_2016(1) +#@gui :_=separator() +#@gui :_=note("samj_Noel_2016") +#@gui :X Origine=float(50,0,100) +#@gui :Y Origine=float(50,0,100) +#@gui :Ellipse / Circle A=float(100,1,500) +#@gui :Ellipse B=float(150,1,500) +#@gui :Depth Max=int(7,1,13) +#@gui :Line=bool(0) +#@gui :Color=color(#f02d0fff) +#@gui :Color Variation=int(-15,-255,255) +#@gui :Spacing=float(2.5,0,8) +#@gui :Rendering=choice(2,"Ellipse A","Ellipse B","Ball A","Ball B") +#@gui :_=separator() +#@gui :_=note("Ball [light]") +#@gui :Specular Light=float(0.8,0,8) +#@gui :Specular Size=float(1,0,8) +#@gui :Shadow=float(1.5,0,4) +#@gui :Angle=float(0,-180,180) +#@gui :_=separator() +#@gui :_=note("Rotation") +#@gui :Rotate=float(0,-180,180) +#@gui :_=separator() +#@gui :_=note("Smooth [antialias]") +#@gui :Smooth [antialias]=bool(0) +#@gui :Amplitude=float(0.25,0,100) +#@gui :Edge Threshold (%)=float(10,0,100) +#@gui :Smoothness=float(0.8,0,5) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2020/10/24.") +#@gui Chryzodes:samj_Chryzodes,samj_Chryzodes(1) +#@gui :_=link("http://www.chryzode.org/fr/ligne.htm","http://www.chryzode.org/fr/ligne.htm") +#@gui :_=separator() +#@gui :_=note("New Image") +#@gui :Image Dimensions=float(100,30,400) +#@gui :Background Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("Rendering") +#@gui :Examples=choice(0,"None","431/7/VC=0","353/3/VC=0","619/4/VC=0","691/12/VC=0","613/20/VC=0","358/13/VC=1","118/20/VC=1","699/6/VC=0") +#@gui :X Position (%)=float(50,0,100) +#@gui :Y Position (%)=float(50,0,100) +#@gui :External Circle Radius=float(45,10,200) +#@gui :Number of Points - Module=int(79,10,1080) +#@gui :Multiplier=int(3,3,33) +#@gui :First Point=int(1,1,1080) +#@gui :Color Straight Lines=color(#f08040ff) +#@gui :Tilt Angle=float(0,-360,360) +#@gui :Type Straight Lines=choice(0,"Lines Inside The Circle","Over The Entire Image") +#@gui :Random Colors=choice(0,"None","Variations","Lines") +#@gui :_=separator() +#@gui :_=note("Variations Rendering Image Filter") +#@gui :Variations A=int(0,0,1080) +#@gui :Variations B=int(0,0,3) +#@gui :Variation C=bool(0) +#@gui :_=separator() +#@gui :_=note("Changes Rendering Image Filter") +#@gui :Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Deform=float(0,0,5) +#@gui :Noise=float(0,0,100) +#@gui :Draw The Circle=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2020/10/24.") +#@gui Contour Line Laser:samj_Contour_Line_Laser_LED,samj_Contour_Line_Laser_LED +#@gui :_=link("https://samjcreations.blogspot.com/2019/12/samuser-avec-gmic-gimp-decoupes-laser.html","https://samjcreations.blogspot.com/2019/12/samuser-avec-gmic-gimp-decoupes-laser.html") +#@gui :_=note("Epaissir Adoucir Les Lignes Du Contour") +#@gui :_=note("Thick / Soft Contour Line") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Type=choice(0,"Non / No","Gros/Thick Contour","Doux/Soft Contour","Gros+Doux/Thick+Soft Contour") +#@gui :Dilatation=int(1,1,48) +#@gui :Ajuster Dimension Image=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/28.") +#@gui Dessiner Un Polygone - Draw a Polygon:samj_dessiner_un_polygone,samj_dessiner_un_polygone(1) +#@gui :_=separator() +#@gui :_=note("Polygone / Polygone") +#@gui :Nombre De Côtés / Number of Sides=int(5,3,90) +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Angle Inclinaison=float(0,0,120) +#@gui :Rayon Cercle Circonscrit / Circumcircle Radius (>0 W%) (<0 H%)=float(40,-400,400) +#@gui :Rayon Cercle Intérieur / Inner Circle Radius (%)=float(50,0,100) +#@gui :Remplir Polygone Extérieur / Fill=bool(1) +#@gui :Couleur Polygone Extérieur=color(#ffff00) +#@gui :Contour Polygone Extérieur=bool(0) +#@gui :Couleur Contour Polygone Extérieur=color(#000000) +#@gui :Remplir Polygone Intérieur / Fill=bool(1) +#@gui :Couleur Polygone Intérieur=color(#0000ff) +#@gui :Contour Polygone Intérieur=bool(0) +#@gui :Couleur Contour Polygone Intérieur=color(#00ff00) +#@gui :Variation De Couleur / Color Variation=choice("Pas De Variation / No Change","Couleurs Aleatoires / Random Colors","Faiblement Nuancee / Poorly Nuanced","Moyennement Nuancee / Moderately Nuanced","Fortement Nuancee / Highly Nuanced") +#@gui :_=separator() +#@gui :_=note("cercles / circles") +#@gui :Remplir Cercle Intérieur / Fill=bool(0) +#@gui :Couleur Cercle Intérieur=color(#7f7f7f) +#@gui :Contour Cercle Intérieur=bool(0) +#@gui :Couleur Contour Cercle Intérieur=color(#000000) +#@gui :Remplir Cercle Extérieur / Fill=bool(0) +#@gui :Couleur Cercle Extérieur=color(#ffffff) +#@gui :Contour Cercle Extérieur=bool(0) +#@gui :Couleur Contour Cercle Extérieur=color(#000000) +#@gui :Dilatation (épaisseur)=int(1,1,48) +#@gui :_=separator() +#@gui :_=note("Transparence / Transparency") +#@gui :Transparence Des Couleurs / Color Transparency=int(255,0,255) +#@gui :_=separator() +#@gui :_=note("Divers / Foo") +#@gui :Flou / Blur=float(0,0,10) +#@gui :Spread=float(0,0,10) +#@gui :Déformation=float(0,0,25) +#@gui :_=separator() +#@gui :_=note("Mélange / Blend") +#@gui :Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/02.") +#@gui Egg Oeuf Granville:samj_Egg_Oeuf_Granville,samj_Egg_Oeuf_Granville(1) +#@gui :_=link("http://en.wikipedia.org/wiki/William_Anthony_Granville","http://en.wikipedia.org/wiki/William_Anthony_Granville") +#@gui :_=link("http://www.mathcurve.com/courbes2d/oeuf/oeufgranville.shtml","http://www.mathcurve.com/courbes2d/oeuf/oeufgranville.shtml") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Décalage X=float(0,-100,100) +#@gui :Valeur A Forme=float(20,0,100) +#@gui :Valeur B Forme=float(30,1,100) +#@gui :Valeur R Forme=float(10,0.1,99) +#@gui :Angle Inclinaison=float(0,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage Contours=choice(1,"Sans","Egg Oeuf","Egg Oeuf CA CB CR") +#@gui :Couleur=color(#ffff007f) +#@gui :Couleur Aléatoire / Random Color=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre=bool(0) +#@gui :X-Ombre=float(0.5,-5,5) +#@gui :Y-Ombre=float(0.5,-5,5) +#@gui :Douceur / Smoothness Ombre=float(1.8,0,5) +#@gui :Courbure / Curvature Ombre=float(0,0,1) +#@gui :Compensation Décalage Ombre X=float(0,-50,50) +#@gui :Compensation Décalage Ombre Y=float(0,-50,50) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/02.") +#@gui Egg Oeuf Hugelschaffer:samj_Egg_Oeuf_Hugelschaffer,samj_Egg_Oeuf_Hugelschaffer(1) +#@gui :_=link("http://www.mathcurve.com/courbes2d/oeuf/oeuf.shtml","http://www.mathcurve.com/courbes2d/oeuf/oeuf.shtml") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Dimension=float(50,0,100) +#@gui :Valeur A Forme=float(6,0,10) +#@gui :Valeur B Forme=float(48,0,100) +#@gui :Valeur D Forme=float(0,0,24) +#@gui :Angle Inclinaison=float(0,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage Contours=choice(1,"Sans","Egg Oeuf","Egg Oeuf CA CB") +#@gui :Couleur=color(#ffff007f) +#@gui :Couleur Aléatoire / Random Color=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre=bool(0) +#@gui :X-Ombre=float(0.5,-5,5) +#@gui :Y-Ombre=float(0.5,-5,5) +#@gui :Douceur / Smoothness Ombre=float(1.8,0,5) +#@gui :Courbure / Curvature Ombre=float(0,0,1) +#@gui :Compensation Décalage Ombre X=float(0,-20,20) +#@gui :Compensation Décalage Ombre Y=float(0,-20,20) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/02.") +#@gui Egg Oeuf Rosillo:samj_Egg_Oeuf_Rosillo,samj_Egg_Oeuf_Rosillo(1) +#@gui :_=link("http://www.mathcurve.com/courbes2d/rosillo/rosillo.shtml","http://www.mathcurve.com/courbes2d/rosillo/rosillo.shtml") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Valeur A Dimension=float(40,0,100) +#@gui :Valeur B Forme 200%A=float(200,0,400) +#@gui :Valeur C Forme 300%A=float(300,0,400) +#@gui :Angle Inclinaison=float(0,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage Contours=choice(1,"Sans","Egg Oeuf","Egg Oeuf CA CB CC") +#@gui :Couleur=color(#ffff007f) +#@gui :Couleur Aléatoire / Random Color=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre=bool(0) +#@gui :X-Ombre=float(0.5,-5,5) +#@gui :Y-Ombre=float(0.5,-5,5) +#@gui :Douceur / Smoothness Ombre=float(1.8,0,5) +#@gui :Courbure / Curvature Ombre=float(0,0,1) +#@gui :Compensation Décalage Ombre X=float(0,-50,50) +#@gui :Compensation Décalage Ombre Y=float(0,-50,50) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/02.") +#@gui Engrenages Gears Laser:samj_Engrenages_Laser_LED,samj_Engrenages_Laser_LED_Preview +#@gui :_=separator() +#@gui :_=note("Engrenages Gears Laser Cutting Engraving") +#@gui :_=link("https://samjcreations.blogspot.com/2020/01/samuser-avec-gmic-gimp-engrenages.html","https://samjcreations.blogspot.com/2020/01/samuser-avec-gmic-gimp-engrenages.html") +#@gui :_=separator() +#@gui :_=note("Paramètres / Settings") +#@gui :_=link("https://fr.wikipedia.org/wiki/Engrenage","https://fr.wikipedia.org/wiki/Engrenage") +#@gui :Module M [pixels]=int(80,10,200) +#@gui :_=note("Diminuer Angle De Pression alpha pour inscrire Z1 ou Z2 dans cercle de tête [ 14.5 par exemple ] ") +#@gui :Angle De Pression Alpha / Pressure Angle [20 Degrés]=float(20,10,20) +#@gui :Diam. Trou Central [pixels]=int(12,12,600) +#@gui :Nb De Dents Roue Z1 / Nb of Teeth Gear Z1 [13...17]=int(14,7,151) +#@gui :Nb De Dents Roue Z2 / Nb of Teeth Gear Z2 [13...39]=int(17,7,151) +#@gui :Forme=choice(1,"Dent Plus Petite - Calcul Sur Cercle De Base","Dent=Creux Sur Cercle Primitif") +#@gui :Contours +=bool(1) +#@gui :_=separator() +#@gui :_=note("Trous pour assemblage / Mechanical assembly") +#@gui :Nb. Trous Assemblage / Holes=int(2,0,12) +#@gui :Diam. Trous Assemblage / Holes [pixels]=int(19,12,600) +#@gui :Distance Du Centre / Center Spacing [pixels]=int(250,12,3000) +#@gui :Décalage Angulaire / Angular Offset [Degrés]=float(0,0,360) +#@gui :_=separator() +#@gui :_=note("Mortaise clavette trou central / Keyway cutting") +#@gui :_=link("https://fr.wikipedia.org/wiki/Clavette_(mécanique)","https://fr.wikipedia.org/wiki/Clavette_(mécanique)") +#@gui :Largeur / Width [pixels]=int(0,0,150) +#@gui :Hauteur / Height [pixels]=int(0,0,100) +#@gui :Décalage Angulaire / Angular Offset [Degrés]=float(0,0,360) +#@gui :_=separator() +#@gui :_=note("Ce script est lent car les engrenages sont dessinés point par point.") +#@gui :_=note("Le script donne 3 calques de dimensions identiques max. 7200 pixels : ") +#@gui :_=note(" - 1 calque au fond transparent avec des données techniques.") +#@gui :_=note(" - 1 calque blanc avec un dessin noir pour la roue Z2.") +#@gui :_=note(" - 1 calque blanc avec un dessin noir pour la roue Z1.") +#@gui :_=note("This script is slow because the gears are plotted point by point.") +#@gui :_=note("The script gives 3 layers of the same dimensions max.7200 pixels : ") +#@gui :_=note(" - 1 layer with transparent background with technical data.") +#@gui :_=note(" - 1 white layer with a black outline for the Z2 wheel.") +#@gui :_=note(" - 1 white layer with a black outline for the Z1 wheel.") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/01/06.") +#@gui Etoile De Pompei:samj_etoile_de_pompei_153,samj_etoile_de_pompei_153(1) +#@gui :_=separator() +#@gui :1 - Position X (%)=float(50,0,100) +#@gui :2 - Position Y (%)=float(50,0,100) +#@gui :3 - Angle Inclinaison=float(30,0,60) +#@gui :4 - Dimension (%)=float(90,0,200) +#@gui :5 6 7 8 - Couleur / Color 1=color(#ffffffff) +#@gui :9 10 11 12 -Couleur / Color 2=color(#aaffffff) +#@gui :13 14 15 16 - Couleur / Color 3=color(#006293ff) +#@gui :17 18 19 20 - Couleur / Color 4=color(#003b59ff) +#@gui :21 - Remplir Cercle / Fill Circle=bool(1) +#@gui :22 - Smooth=int(0,0,2000) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/08/21.") +#@gui Etoile De Pompei Triangles Sierpinski:samj_Etoile_De_Pompei_Triangles_Sierpinski,samj_Etoile_De_Pompei_Triangles_Sierpinski(1) +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Angle Inclinaison=float(30,0,60) +#@gui :Dimension (>0 W%) (<0 H%)=float(100,-400,400) +#@gui :Cadre=color(#000000ff) +#@gui :Afficher Cadre=choice(0,"Pas Affichage","Affichage Contours Centre","Affichage Contours") +#@gui :Récursions Sierpinski=int(5,1,7) +#@gui :Centre A=color(#ff00007f) +#@gui :Centre B=color(#ff00ff7f) +#@gui :Triangle=color(#0000ff7f) +#@gui :Demi Losange A=color(#00ffff7f) +#@gui :Demi Losange B=color(#ffff007f) +#@gui :Cercle=color(#003fff40) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :Décalage Ombre X / Shadow Offset X=float(0,-20,20) +#@gui :Décalage Ombre Y / Shadow Offset Y=float(0,-20,20) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/02.") +#@gui Etoiles Remplies Triangles Sierpinski:samj_Etoiles_Remplies_Triangles_Sierpinski,samj_Etoiles_Remplies_Triangles_Sierpinski(1) +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Nombre De Sommets=int(6,2,18) +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Rayon Cercle Extérieur / Outer Circle Radius (>0 W%) (<0 H%)=float(50,-400,400) +#@gui :Rayon Cercle Intérieur / Inner Circle Radius (%)=float(40,0,100) +#@gui :Angle Inclinaison=float(30,0,60) +#@gui :Excentricité / Eccentricity (%)=float(0,0,100) +#@gui :Angle Excentricité / Eccentricity Angle=float(0,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage=choice(1,"Pas De Contours A","Pas De Contours B","Pas De Contours C","Pas De Contours D","Contours A","Contours B","Contours C","Contours D") +#@gui :Recursions Sierpinski=int(4,0,7) +#@gui :Centre A=color(#ff00007f) +#@gui :Centre B=color(#ffc0407f) +#@gui :Sommets A=color(#0000ff7f) +#@gui :Sommets B=color(#00ffff7f) +#@gui :Cercle=color(#ffff007f) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :Décalage Ombre X / Shadow Offset X=float(0,-20,20) +#@gui :Décalage Ombre Y / Shadow Offset Y=float(0,-20,20) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Etoiles Stars Laser:samj_Etoiles_Laser_LED,samj_Etoiles_Laser_LED +#@gui :_=note("Étoiles/Stars Laser Cutting Engraving") +#@gui :_=note("Formes Arrondies / Rounded Shapes") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Dimension X Y=int(1400,800,3200) +#@gui :Nb Branches / Rays=int(5,5,72) +#@gui :Type=choice(2,"Pompei A 12 Branches/Rays","Pompei B 12 Branches/Rays"","C","Annular SteinerChains","Traits/Strokes","Gear","Spirographe 4") +#@gui :Affichage / Display Contours=choice(0,"Non / No","Contours Image","Contours Étoile/Star","Contours Image + Étoile/Star") +#@gui :Dilate=int(0,0,48) +#@gui :Cercle Central Noir/Black=float(0,0,48) +#@gui :Cercle Central Blanc/White=float(0,0,48) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/27.") +#@gui Flocon Snowflake Laser:samj_Flocon_Laser_LED,samj_Flocon_Laser_LED +#@gui :_=note("Flocon/Snowflake Laser Cutting Engraving") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Dimension X Y=int(1400,800,3200) +#@gui :Nb Branches / Rays=int(6,3,15) +#@gui :Type Flocon / Snowflake=choice(5,"A","B","C","A2","B2","C2") +#@gui :Affichage / Display Contours=choice(0,"Non / No","Contours Image","Contours Flocon/Snowflake","Contours Image + Flocon/Snowflake") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/26.") +#@gui Fractal Tree:samj_Fractal_Tree,samj_Fractal_Tree +#@gui :_=separator() +#@gui :_=link("Source code from rosettacode.org","https://www.rosettacode.org/wiki/Fractal_tree") +#@gui :X Origine=float(50,0,100) +#@gui :Y Origine=float(100,0,100) +#@gui :Angle Origine=float(-90,-360,360) +#@gui :Depth=int(8,1,13) +#@gui :Variation Dimension=float(10,1,500) +#@gui :Variation Angle=float(20,-360,360) +#@gui :Color=color(#ff0000ff) +#@gui :Color Variation [random -1]=int(20,-1,255) +#@gui :Rendering=choice("Lines","Circles A","Circles B") +#@gui :Circle Dimension=int(4,1,50) +#@gui :Dilatation=int(1,1,8) +#@gui :_=separator() +#@gui :_=note("Smooth [antialias]") +#@gui :Smooth [antialias]=bool(0) +#@gui :Amplitude=float(0.25,0,100) +#@gui :Edge Threshold (%)=float(10,0,100) +#@gui :Smoothness=float(0.8,0,5) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2020/10/24.") +#@gui Gradient CIE Lab [Linear]:samj_Linear_Gradient_CIE_Lab,samj_Linear_Gradient_CIE_Lab(1) +#@gui :_=link("http://samjcreations.blogspot.ca","http://samjcreations.blogspot.ca") +#@gui :_=separator() +#@gui :_=note("Dégradé / Gradient CIE Lab") +#@gui :Type H / V=choice(0,"H","V") +#@gui :Swap Colors=bool(0) +#@gui :Starting Color A=color(#f028a0ff) +#@gui :Ending Color B=color(#f0f028ff) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2020/10/24.") +#@gui Gradient CIE Lab [Shape]:samj_Shape_Linear_Gradient_CIE_Lab,samj_Shape_Linear_Gradient_CIE_Lab(1) +#@gui :_=link("http://samjcreations.blogspot.ca","http://samjcreations.blogspot.ca") +#@gui :_=note("Dégradé / Gradient CIE Lab") +#@gui :_=separator() +#@gui :_=note("Starting Point / Diameter :") +#@gui :X0=float(10,0,100) +#@gui :Y0=float(10,0,100) +#@gui :_=note("Ending Point / Center :") +#@gui :X1=float(90,0,100) +#@gui :Y1=float(90,0,100) +#@gui :_=note("Parameters :") +#@gui :Shape=choice(2,"Linear H","Linear V","Square","Square Overflow","Circle X0","Circle X0+YO") +#@gui :Swap Colors=bool(0) +#@gui :Starting Color A=color(#f028a0ff) +#@gui :Ending Color B=color(#f0f028ff) +#@gui :Background=choice(0,"Image","Transparent","Color") +#@gui :Background Color=color(#000000ff) +#@gui :Examples=choice(0,"None","10 10 90 90 Linear H","10 10 90 90 Linear V","10 10 90 90 Square","10 10 90 90 Square Overflow","40 40 50 50 Circle X0","40 40 50 50 Circle X0+YO","71 71 100 100 Circle X0+YO") +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2020/10/24.") +#@gui Harmonograph:Harmonograph_samj,Harmonograph_samj(1) +#@gui :_=link("http://en.wikipedia.org/wiki/Harmonograph") +#@gui :_=separator() +#@gui :_=note("Centre / Center") +#@gui :Centre / Center X (%)=float(50,0,100) +#@gui :Centre / Center Y (%)=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Harmonograph") +#@gui :Stylo / Pen (Couleur/Color)=color(#c08040ff) +#@gui :Stylo / Pen (Variation De Couleur/Color Variation)=choice("Pas De Variation / No Change","Couleurs Aleatoires / Random Colors","Faiblement Nuancee / Poorly Nuanced","Moyennement Nuancee / Moderately Nuanced","Fortement Nuancee / Highly Nuanced") +#@gui :Stylo / Pen (Dilate Pixels)=int(0,0,32) +#@gui :Itérations=int(1000,2,30000) +#@gui :Multiplier=choice(0,"Iterations * 1","Iterations * 5 LENT / SLOW","Iterations * 10 TRES LENT / VERY SLOW") +#@gui :Increment Temps / Time Increment [*10000]=float(400,10,500) +#@gui :_=separator() +#@gui :_=note("Amplitude") +#@gui :Amplitude 1 (>0 W) (<0 H)=float(150,-1000,1000) +#@gui :Amplitude 2 (>0 W) (<0 H)=float(200,-1000,1000) +#@gui :Amplitude 3 (>0 W) (<0 H)=float(200,-1000,1000) +#@gui :Amplitude 4 (>0 W) (<0 H)=float(100,-1000,1000) +#@gui :_=separator() +#@gui :_=note("Fréquence / Frequency") +#@gui :Fréquence 1=float(4,0,16) +#@gui :Fréquence 2=float(6,0,16) +#@gui :Fréquence 3=float(2,0,16) +#@gui :Fréquence 4=float(2,0,16) +#@gui :_=separator() +#@gui :_=note("Phase") +#@gui :Phase 1=float(15,0,360) +#@gui :Phase 2=float(270,0,360) +#@gui :Phase 3=float(75,0,360) +#@gui :Phase 4=float(60,0,360) +#@gui :_=separator() +#@gui :_=note("Amortissement / Damping") +#@gui :Amortissement 1=float(0.04,0,1) +#@gui :Amortissement 2=float(0.04,0,1) +#@gui :Amortissement 3=float(0.05,0,1) +#@gui :Amortissement 4=float(0.06,0,1) +#@gui :_=separator() +#@gui :_=note("Divers / Foo") +#@gui :Flou / Blur=float(0,0,10) +#@gui :Spread=float(0,0,10) +#@gui :Déformation=float(0,0,25) +#@gui :_=separator() +#@gui :_=note("Mélange / Blend") +#@gui :Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/02.") +#@gui Hawaiian Earring:samj_Hawaiian_Earring,samj_Hawaiian_Earring(1) +#@gui :_=link("http://en.wikipedia.org/wiki/Hawaiian_earring","http://en.wikipedia.org/wiki/Hawaiian_earring") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Rayon Cercle A / Circle A Radius (%)=float(40,1,200) +#@gui :Nb Cercles / Circles=int(6,2,25) +#@gui :Type N=choice(0,"Inc 1","Lin 0.1","Lin 0.2","Lin 0.3","Rand") +#@gui :Angle Inclinaison / Tilt=float(0,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage / Display Contours=bool(1) +#@gui :Cercle A / Circle A=color(#ffff007f) +#@gui :Cercles B / Circles B=color(#0000ff7f) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Miroir / Mirror=choice(0,"Sans - Wihout"," X "," Y "," X Y ") +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :Décalage Ombre X / Shadow Offset X=float(0,-20,20) +#@gui :Décalage Ombre Y / Shadow Offset Y=float(0,-20,20) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Lines of Varying Thickness:samj_Lignes_Epaisseur_Variable,samj_Lignes_Epaisseur_Variable(1) +#@gui :_=note("Lignes Épaisseur Variable / Lines Of Varying Thickness") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Orientation Lignes / Lines=choice(0,"Vertical Lines","Horizontal Lines") +#@gui :Résolution Largeur / Width=int(32,16,64) +#@gui :Épaisseur Ligne / Line Thickness=int(3,1,7) +#@gui :Fond / Background=color(#000000ff) +#@gui :Ligne / Line=color(#ffffffff) +#@gui :Inverser Fond-Ligne / Invert Background-Line=bool(0) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Resize=choice(1,"Non / No","Dim. Origines") +#@gui :Flou / Blur=int(0,0,200) +#@gui :Deblur=int(0,0,48) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation / Deform=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Orbites:samj_Orbites,samj_Orbites(1) +#@gui :_=link("https://youtu.be/_JgHQU1Fntg","https://youtu.be/_JgHQU1Fntg") +#@gui :_=separator() +#@gui :_=note("New Image") +#@gui :Image Dimensions=float(100,30,400) +#@gui :Background Color=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("Rendering") +#@gui :X Position (%)=float(50,0,100) +#@gui :Y Position (%)=float(50,0,100) +#@gui :Circle A Radius=float(20,10,1000) +#@gui :Number of Points Circle A=int(79,10,1080) +#@gui :Circle B Radius=float(45,1,1000) +#@gui :Multiplier Number of Points Circle B=float(2,0.1,20) +#@gui :Color Straight Lines=color(#f08040ff) +#@gui :Tilt Angle A=float(0,-360,360) +#@gui :Tilt Angle B=float(0,-360,360) +#@gui :Random Colors=bool(0) +#@gui :_=separator() +#@gui :_=note("Changes Rendering Image Filter") +#@gui :Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Deform=float(0,0,5) +#@gui :Noise=float(0,0,100) +#@gui :Draw Circles=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2018/02/04.") +#@gui Palette De Degrades:samj_Palette_De_Degrades,samj_Palette_De_Degrades_preview(1) +#@gui :_=separator() +#@gui :_=note("samj_Palette_De_Degrades - Gradient Palette") +#@gui :_=separator() +#@gui :_=note("Obtenir des degrades avec 12 couleurs plus noir et blanc en option - Lent") +#@gui :_=note("Get gradients from 12 colors with optional black and white - Slow") +#@gui :_=separator() +#@gui :Couleur - Color A=color(#9fbec3) +#@gui :Couleur - Color B=color(#37438c) +#@gui :Couleur - Color C=color(#362827) +#@gui :Couleur - Color D=color(#8c5158) +#@gui :Couleur - Color E=color(#cfafbe) +#@gui :Couleur - Color F=color(#dccac4) +#@gui :Couleur - Color G=color(#aabac0) +#@gui :Couleur - Color H=color(#82958b) +#@gui :Couleur - Color I=color(#706060) +#@gui :Couleur - Color J=color(#eda88a) +#@gui :Couleur - Color K=color(#dcc7cd) +#@gui :Couleur - Color L=color(#ead9db) +#@gui :Ajouter Du Noir - Add Black=bool(0) +#@gui :Ajouter Du Blanc - Add White=bool(0) +#@gui :Étendue Degradé - Width=int(256,2,1024) +#@gui :Hauteur D'un Degradé - Height Of One Gradient=int(2,2,20) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Pappus Chain:samj_Cercles_Tangents_Dans_Cercle,samj_Cercles_Tangents_Dans_Cercle(1) +#@gui :_=link("http://en.wikipedia.org/wiki/Pappus_chain","http://en.wikipedia.org/wiki/Pappus_chain") +#@gui :_=link("http://en.wikipedia.org/wiki/Steiner_chain","http://en.wikipedia.org/wiki/Steiner_chain") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Rayon Cercle Extérieur / Radius Outer Circle A (>0 W%) (<0 H%)=float(50,-400,400) +#@gui :Rayon Premier Cercle B=float(40,0,99) +#@gui :Angle Inclinaison / Tilt=float(0,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage / Display Contours=bool(1) +#@gui :Cercle Extérieur / Outer Circle A=color(#7f7f7f7f) +#@gui :Premier Cercle / First Circle B=color(#ff00007f) +#@gui :Cercle / Circle C=color(#00ff007f) +#@gui :Cercle / Circle D=color(#0000ff7f) +#@gui :Cercle / Circle E=color(#ff00ff7f) +#@gui :Cercle / Circle F=color(#ffff007f) +#@gui :Cercle / Circle G=color(#00ffff7f) +#@gui :Cercle / Circle H=color(#c080407f) +#@gui :Cercle / Circle I=color(#40c0807f) +#@gui :Cercle / Circle J=color(#8040c07f) +#@gui :Cercle / Circle K=color(#c040807f) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :Décalage Ombre X / Shadow Offset X=float(0,-20,20) +#@gui :Décalage Ombre Y / Shadow Offset Y=float(0,-20,20) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/20.") +#@gui Pintograph:Pintograph_samj,Pintograph_samj(1) +#@gui :_=link("http://en.wikipedia.org/wiki/Pintograph") +#@gui :_=separator() +#@gui :_=note("Centre / Center") +#@gui :Centre / Center X (%)=float(50,0,100) +#@gui :Centre / Center Y (%)=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Pintograph") +#@gui :Stylo / Pen (Couleur/Color)=color(#c08040ff) +#@gui :Stylo / Pen (Variation De Couleur/Color Variation)=choice("Pas De Variation / No Change","Couleurs Aleatoires / Random Colors","Faiblement Nuancee / Poorly Nuanced","Moyennement Nuancee / Moderately Nuanced","Fortement Nuancee / Highly Nuanced") +#@gui :Stylo / Pen (Dilate Pixels)=int(0,0,32) +#@gui :Itérations=int(1000,2,30000) +#@gui :Multiplier=choice(0,"Itérations * 1","Itérations * 5 LENT / SLOW","Itérations * 10 TRES LENT / VERY SLOW") +#@gui :Increment Temps / Time Increment [*10000]=float(400,10,500) +#@gui :_=separator() +#@gui :_=note("Amplitude") +#@gui :Amplitude 1 (>0 W) (<0 H)=float(150,-1000,1000) +#@gui :Amplitude 2 (>0 W) (<0 H)=float(200,-1000,1000) +#@gui :Amplitude 3 (>0 W) (<0 H)=float(200,-1000,1000) +#@gui :Amplitude 4 (>0 W) (<0 H)=float(100,-1000,1000) +#@gui :_=separator() +#@gui :_=note("Fréquence / Frequency") +#@gui :Fréquence 1=float(4.00,0,16) +#@gui :Fréquence 2=float(4.05,0,16) +#@gui :Fréquence 3=float(4.16,0,16) +#@gui :Fréquence 4=float(4.32,0,16) +#@gui :_=separator() +#@gui :_=note("Phase") +#@gui :Phase 1=float(75,0,360) +#@gui :Phase 2=float(150,0,360) +#@gui :Phase 3=float(75,0,360) +#@gui :Phase 4=float(60,0,360) +#@gui :_=separator() +#@gui :_=note("Divers / Foo") +#@gui :Flou / Blur=float(0,0,10) +#@gui :Spread=float(0,0,10) +#@gui :Déformation=float(0,0,25) +#@gui :_=separator() +#@gui :_=note("Mélange / Blend") +#@gui :Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/02.") +#@gui Poisson D'Avril:samj_Poisson_D_Avril,samj_Poisson_D_Avril(1) +#@gui :_=link("http://www.mathcurve.com/courbes2d/poisson/poisson.shtml","http://www.mathcurve.com/courbes2d/poisson/poisson.shtml") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Valeur A Dimension=float(40,1,100) +#@gui :Valeur K=float(2,0,4) +#@gui :Angle Inclinaison=float(0,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage Contours=choice(1,"Sans","Poisson","Poisson CA") +#@gui :Couleur A=color(#fa3c0aff) +#@gui :Couleur B=color(#ffffffff) +#@gui :Couleur Aléatoire / Random Color=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre=bool(0) +#@gui :X-Ombre=float(0.5,-5,5) +#@gui :Y-Ombre=float(0.5,-5,5) +#@gui :Douceur / Smoothness Ombre=float(1.8,0,5) +#@gui :Courbure / Curvature Ombre=float(0,0,1) +#@gui :Compensation Décalage Ombre X=float(0,-50,50) +#@gui :Compensation Décalage Ombre Y=float(0,-50,50) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/02.") +#@gui ___Rendering +#@gui Pythagoras Tree:samj_Arbre_Pythagore,samj_Arbre_Pythagore +#@gui :_=separator() +#@gui :_=link("Source code from rosettacode.org","https://rosettacode.org/wiki/Pythagoras_tree") +#@gui :X Origine=float(50,0,100) +#@gui :Y Origine=float(95,0,100) +#@gui :Depth=int(8,1,14) +#@gui :Dimension [Diff]=float(12,4,100) +#@gui :Color=color(#ff0000ff) +#@gui :Color Variation [Random -1]=int(20,-1,255) +#@gui :Rendering=choice("A","B","C") +#@gui :Dilatation=int(1,1,8) +#@gui :Rotate Tree=float(0,-180,180) +#@gui :_=separator() +#@gui :_=note("Smooth [antialias]") +#@gui :Smooth [Antialias]=bool(0) +#@gui :Amplitude=float(0.25,0,100) +#@gui :Edge Threshold (%)=float(10,0,100) +#@gui :Smoothness=float(0.8,0,5) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2020/10/24.") +#@gui _Testing +#@gui Samj +#@gui Rendering +#@gui Rosace Triangles Sierpinski:samj_Rosace_Triangles_Sierpinski,samj_Rosace_Triangles_Sierpinski(1) +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Nombre De Zones=int(6,3,24) +#@gui :Nombre De Couches=int(6,1,50) +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Rayon Premier Cercle (>0 W%) (<0 H%)=float(50,-400,400) +#@gui :Décalage Angle=float(-15,-30,30) +#@gui :Dimension Triangle=float(25,0,100) +#@gui :Recouvrement Triangle=float(5,0,100) +#@gui :Angle Inclinaison=float(30,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage Contours=choice(0,"Sans","Triangle A Et B","Triangle A","Triangle B","Triangle A Et B Et Cercle","Triangle A Et Cercle","Triangle B Et Cercle") +#@gui :Type Triangles A=choice(0,"JDH","JDE","JDB","JAH","JAE","JAB","Sans") +#@gui :Type Triangles B=choice(0,"HBI","HBF","HBC","Sans") +#@gui :Type Decalage=choice(0,"Couches","Cercles","Couches Et Cercles") +#@gui :Recursions Sierpinski=int(3,0,7) +#@gui :Triangle A=color(#0000ff7f) +#@gui :Triangle Ab=color(#ffff007f) +#@gui :Triangle B=color(#8040c07f) +#@gui :Triangle Ba=color(#4080c07f) +#@gui :Cercle=color(#00ffff7f) +#@gui :Afficher Cercle=bool(0) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :Décalage Ombre X / Shadow Offset X=float(0,-20,20) +#@gui :Décalage Ombre Y / Shadow Offset Y=float(0,-20,20) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Rotating Circles:samj_Cercles_Qui_Tournent,samj_Cercles_Qui_Tournent(1) +#@gui :_=note("Cercles Qui Tournent / Rotating Circles") +#@gui :_=link("http://rouxjeanbernard.ch/AM/html/amch57.html","http://rouxjeanbernard.ch/AM/html/amch57.html") +#@gui :_=separator() +#@gui :_=note("Nouvelle New Image") +#@gui :Dimension Image=int(800,2,32768) +#@gui :Fond / Background=color(#ffffffff) +#@gui :_=separator() +#@gui :_=note("Exemples Examples") +#@gui :Examples=choice(0,"Non No","A","B","C","D","E","F") +#@gui :_=separator() +#@gui :_=note("Param. X") +#@gui :Cax=float(1,0.5,2) +#@gui :Cbx=float(0.5,0.05,5) +#@gui :Ccx=float(0.33,0.05,5) +#@gui :Vbx=int(7,-50,50) +#@gui :Vcx=int(17,-50,50) +#@gui :_=separator() +#@gui :_=note("Param. Y") +#@gui :Cay=float(1,0.5,2) +#@gui :Cby=float(0.5,0.05,5) +#@gui :Ccy=float(0.33,0.05,5) +#@gui :Vby=int(7,-50,50) +#@gui :Vcy=int(17,-50,50) +#@gui :_=separator() +#@gui :_=note("Rendu Rendering") +#@gui :Égalite / Equality : Param. X & Param. Y=bool(1) +#@gui :Théta=int(10,1,5000) +#@gui :Ligne / Line=color(#000000ff) +#@gui :Angle Inclinaison=float(0,-360,360) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,200) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/12/14.") +#@gui Rows Columns:samj_Lignes_Colonnes,samj_Lignes_Colonnes +#@gui :Colonnes/Columns=int(16,2,128) +#@gui :Lignes/Rows=int(16,2,128) +#@gui :Afficher/Display=choice(0,"Lignes Colonnes/Rows Columns","Colonnes/Columns","Lignes/Rows") +#@gui :Couleur/Color=color(#00000040) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/11/20.") +#@gui Simple Geometric Shapes:samj_Formes_Geometriques_Simples,samj_Formes_Geometriques_Simples(1) +#@gui :_=separator() +#@gui :_=note("Formes Géometriques Simples / Simple Geometric Shapes") +#@gui :_=separator() +#@gui :_=note("Effet") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Couleur Externe / External Color=color(#7f7f7f7f) +#@gui :Couleur Interne / Interior Color=color(#ffff00ff) +#@gui :Couleur / Color Contour=color(#0000ffff) +#@gui :Forme / Shape=choice(5,"Polygone Inscrit Dimension 1","Polygone Inscrit Dimension 2","Cercle / Ellipse","Étoile Star Dimension 1","Étoile Star Dimension 2","Polygone Étoile Star Dimension 1","Polygone Étoile Star Dimension 2") +#@gui :Dimension 1 (% Width)=float(40,0,400) +#@gui :Dimension 2 (% Height)=float(40,0,400) +#@gui :Nb Côtés / Number Of Sides=int(4,3,26) +#@gui :Angle Inclinaison / Tilt=float(0,0,120) +#@gui :Dilate=int(0,0,48) +#@gui :Blend=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/03/09.") +#@gui ___Rendering +#@gui Snowflake 2:samj_Flocon_De_Neige,samj_Flocon_De_Neige(1) +#@gui :_=note("Ah! comme la neige a neigé! Soir d'hiver / Ėmile Nelligan") +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Nb Branches / Rays=int(6,3,12) +#@gui :Rayon Cercle Extérieur / Radius Outer Circle A (>0 W%) (<0 H%)=float(50,-400,400) +#@gui :Rayon Cercle Milieu / Radius Middle Circle=float(40,1,100) +#@gui :Angle Inclinaison / Tilt=float(0,0,360) +#@gui :Récursions Contours=int(3,0,5) +#@gui :Contours=color(#c0c0c0) +#@gui :Opacité / Opacity Contours=float(1,0,1) +#@gui :Affichage / Display Contours=choice(0,"Non / No","Contours + Flocon/Snowflake","Contours") +#@gui :Recursions Flocon / Snowflake=int(3,0,5) +#@gui :Flocon / Snowflake=color(#ffffff) +#@gui :Opacité Flocon / Opacity Snowflake=float(0.7,0,1) +#@gui :Type Flocon / Snowflake=choice(0,"A","B","C","A2","B2","C2") +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :Décalage Ombre X / Shadow Offset X=float(0,-20,20) +#@gui :Décalage Ombre Y / Shadow Offset Y=float(0,-20,20) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/02.") +#@gui _Testing +#@gui Samj +#@gui Rendering +#@gui Spirographe:Spirographe_samj,Spirographe_samj(1) +#@gui :_=link("http://en.wikipedia.org/wiki/Spirograph") +#@gui :_=separator() +#@gui :_=note("Centre / Center") +#@gui :Centre / Center X (%)=float(50,0,100) +#@gui :Centre / Center Y (%)=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Spirographe") +#@gui :Rayon/Radius R (>0 W) (<0 H)=float(200,-500,500) +#@gui :Rayon/Radius R (>0 W) (<0 H)=float(50,-500,500) +#@gui :Stylo / Pen (Position) (>0 W) (<0 H)=float(150,-500,500) +#@gui :Stylo / Pen (Couleur/Color)=color(#c08040ff) +#@gui :Stylo / Pen (Variation De Couleur/Color Variation)=choice("Pas De Variation / No Change","Couleurs Aleatoires / Random Colors","Faiblement Nuancee / Poorly Nuanced","Moyennement Nuancee / Moderately Nuanced","Fortement Nuancee / Highly Nuanced") +#@gui :Stylo / Pen (Dilate Pixels)=int(0,0,32) +#@gui :Nombre De Tours / Number of Turns=float(3,0.01,20) +#@gui :Multiplier=choice(0,"Tours / Turns * 1","Tours / Turns * 10 LENT / SLOW","Tours / Turns * 100 TRES LENT / VERY SLOW") +#@gui :Incrément Angulaire / Angular Increment (Degrés)=float(1,1,360) +#@gui :Diviser / Divide=choice(0,"Increment Angulaire-Angular Increment / 1","Increment Angulaire-Angular Increment /10 LENT / SLOW","Increment Angulaire-Angular Increment /100 TRES LENT / VERY SLOW") +#@gui :Type De Rendu / Rendering Type=choice("Formule/Formula 1","Formule/Formula 2","Formule/Formula 3","Formule/Formula 4","Formule/Formula 5","Formule/Formula 6","Formule/Formula 7","Formule/Formula 8") +#@gui :Points (Rayon/Radius)=int(0,0,32) +#@gui :Points (Couleur/Color)=color(#ff0000ff) +#@gui :Lignes (Épaisseur/Thickness)=int(0,0,32) +#@gui :Lignes (Couleur/Color)=color(#ffff00ff) +#@gui :_=separator() +#@gui :_=note("Divers / Foo") +#@gui :Flou / Blur=float(0,0,10) +#@gui :Spread=float(0,0,10) +#@gui :Déformation=float(0,0,25) +#@gui :_=separator() +#@gui :_=note("Mélange / Blend") +#@gui :Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Splines Test:samj_Splines_Test,samj_Splines_Test_preview (1) +#@gui :_=separator() +#@gui :_=note("samj_Splines_Test") +#@gui :X Origine=float(50,0,100) +#@gui :Y Origine=float(50,0,100) +#@gui :Angle Origine=float(30,0,360) +#@gui :Variation Angle=float(30,-360,360) +#@gui :Variation Dimension=int(90,1,400) +#@gui :Répétition Spline=int(30,1,360) +#@gui :Répétition Dim=int(1,1,8) +#@gui :Increment Angle=float(10,-360,360) +#@gui :UA0=float(2,-100,100) +#@gui :VA0=float(2,-100,100) +#@gui :UA1=float(2,-100,100) +#@gui :VA1=float(2,-100,100) +#@gui :UB0=float(2,-100,100) +#@gui :VB0=float(2,-100,100) +#@gui :UB1=float(2,-100,100) +#@gui :VB1=float(2,-100,100) +#@gui :Couleur Spline A=color(#ffff00ff) +#@gui :Couleur Spline B=color(#00ffffff) +#@gui :Dilatation=int(1,1,8) +#@gui :Blend=bool(0) +#@gui :Version De Spline=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/09.") +#@gui Straight Lines:samj_Des_Lignes_002,samj_Des_Lignes_002(1) +#@gui :_=separator() +#@gui :_=note("Des Lignes / Straight Lines") +#@gui :_=separator() +#@gui :_=note("Paramètres des lignes") +#@gui :Nombre Lignes / Number Of Lines=int(100,1,4096) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Gris / Gray=bool(0) +#@gui :Couleur / Color=color(#c08040ff) +#@gui :Symétrie / Symmetry=int(0,0,3) +#@gui :Effet / Effect=choice(0,"1","2","3","4","5","6","7","8","9","10","11","12") +#@gui :Etendue / Extent=float(1,1,10) +#@gui :_=separator() +#@gui :_=note("Effet 12 / Effect 12") +#@gui :Origine X (% W)=float(50,-400,400) +#@gui :Origine Y (% H)=float(50,-400,400) +#@gui :_=separator() +#@gui :_=note("Distorsions") +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("Mélange / Blend") +#@gui :Mélange / Blend=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/02/02.") +#@gui Superposition Triangles Sierpinski:samj_Superposition_Triangles_Sierpinski,samj_Superposition_Triangles_Sierpinski(1) +#@gui :_=separator() +#@gui :_=note("Rendu - Rendering") +#@gui :Nombre De Zones=int(6,3,24) +#@gui :Nombre De Superpositions=int(6,1,50) +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :Dimension Premier Cercle (>0 W%) (<0 H%)=float(50,-400,400) +#@gui :Coeff. Superpositions=float(1,0,4) +#@gui :Hauteur Triangle=float(20,0,100) +#@gui :Angle Inclinaison=float(30,0,360) +#@gui :Contours=color(#000000ff) +#@gui :Affichage=choice(1,"Sans Contours Triangles Ext.","Sans Contours Triangles Int.","Sans Contours Triangles Ext. Et Lat.","Sans Contours Triangles Int. Et Lat.","Triangles Ext.","Triangles Int.","Triangles Ext. Et Lat.","Triangles Int. Et Lat.") +#@gui :Recursions Sierpinski=int(4,0,7) +#@gui :Triangle A=color(#0000ff7f) +#@gui :Triangle B=color(#ffff007f) +#@gui :Triangle Lat. A=color(#8040c07f) +#@gui :Triangle Lat. B=color(#4080c07f) +#@gui :Cercle=color(#00ffff7f) +#@gui :Afficher Cercle=bool(0) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :Inversions=int(0,0,3) +#@gui :Flou / Blur=float(0,0,5) +#@gui :Dilate=int(0,0,48) +#@gui :Déformation=float(0,0,5) +#@gui :Bruit / Noise=float(0,0,100) +#@gui :Ombre / Shadow=bool(0) +#@gui :X-Ombre X-Shadow=float(0.5,-5,5) +#@gui :Y-Ombre Y-Shadow=float(0.5,-5,5) +#@gui :Douceur Ombre / Smoothness Shadow=float(1.8,0,5) +#@gui :Courbure Ombre / Curvature Shadow=float(0,0,1) +#@gui :Décalage Ombre X / Shadow Offset X=float(0,-20,20) +#@gui :Décalage Ombre Y / Shadow Offset Y=float(0,-20,20) +#@gui :Canal Alpha=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Test Visu 3D:samj_Test_Visu_3D,samj_Test_Visu_3D(1) +#@gui :_=separator() +#@gui :_=note("samj_Test_Visu_3D") +#@gui :Type 3D=choice(1,"Fichier 3D .off","Elevation3d","Imageplane3d","Imagecube3d","Gmic3d") +#@gui :Fichier 3D .off=text("C:\\\\GimpEval-2.9.5-Win\\\\images_test\\\\GMIC\\\\cube.off") +#@gui :Elevation3d=float(0.5,0,1) +#@gui :_=separator() +#@gui :_=note("rotate3d") +#@gui :U=bool(1) +#@gui :V=bool(1) +#@gui :W=bool(0) +#@gui :Angle=float(0,0,360) +#@gui :_=separator() +#@gui :_=note("gaussians3d") +#@gui :Size=int(0,0,32) +#@gui :Opacity=float(1,0,2) +#@gui :_=separator() +#@gui :_=note("Rendu") +#@gui :Type=choice(0,"Fx Render3d","Snapshot3d") +#@gui :Autocrop=bool(0) +#@gui :Dimensions Origine=bool(0) +#@gui :_=separator() +#@gui :_=note("fx render3d") +#@gui :Width=int(1024,8,4096) +#@gui :Height=int(1024,8,4096) +#@gui :Object Size=float(0.5,0,3) +#@gui :X Angle=float(0,0,360) +#@gui :Y Angle=float(0,0,360) +#@gui :Z Angle=float(0,0,360) +#@gui :FOV=float(45,1,90) +#@gui :X Light=float(0,-100,100) +#@gui :Y Light=float(0,-100,100) +#@gui :Z Light=float(-100,-100,0) +#@gui :Specular Lightness=float(0.5,0,1) +#@gui :Specular Shininess=float(0.7,0,3) +#@gui :Rendering=choice(2,"Dots","Wireframe","Flat","Flat Shaded","Gouraud","Phong") +#@gui :Antialiasing=bool(1) +#@gui :_=separator() +#@gui :_=note("snapshot3d") +#@gui :Dimension=int(400,256,4096) +#@gui :Zoom=float(1,1,2) +#@gui :Fond=color(#e1ffffff) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2017/01/15.") +#@gui Traits Strokes:Traits_Strokes_samj,Traits_Strokes_samj(1) +#@gui :_=separator() +#@gui :_=note("Origine") +#@gui :Position X (%)=float(50,0,100) +#@gui :Position Y (%)=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Traits / Strokes") +#@gui :Longueur / Length (>0 %W) (<0 )=float(35,-400,400) +#@gui :Mode Variations=choice(0,"Non / No","Plus / More","Moins / Less","Plus / More [milieu-Middle]","Moins / Less [milieu-Middle]") +#@gui :Variations % (Longueur/Length)=float(100,0,1000) +#@gui :Éloignement Du Centre / Distance from Center (>0 %W) (<0 )=float(0,-400,400) +#@gui :Nombre De Traits / Number of Strokes=int(30,1,2160) +#@gui :Angle (Départ / Start)=float(0,0,360) +#@gui :Angle (Fin / End)=float(360,0,360) +#@gui :Couleur/ Color=color(#f03c78ff) +#@gui :Variation De Couleur / Color Variation=choice("Pas De Variation / No Change","Couleurs Aleatoires / Random Colors","Faiblement Nuancee / Poorly Nuanced","Moyennement Nuancee / Moderately Nuanced","Fortement Nuancee / Highly Nuanced") +#@gui :Épaisseur / Thickness=int(0,0,32) +#@gui :_=separator() +#@gui :_=note("Symétrie / Symmetry") +#@gui :Symétrie / Symmetry=bool(0) +#@gui :Longueur / Length (%)=float(20,0,100) +#@gui :_=separator() +#@gui :_=note("Divers / Foo") +#@gui :Flou / Blur=float(0,0,10) +#@gui :Spread=float(0,0,10) +#@gui :Déformation=float(0,0,25) +#@gui :_=separator() +#@gui :_=note("Mélange / Blend") +#@gui :Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui Triangles Shades Adjacents:Triangles_Shades_Adjacents,Triangles_Shades_Adjacents(1) +#@gui :_=note("Image Finale / Resulting Image") +#@gui :Supprimer Calque Origine / Delete Layer Source=bool(0) +#@gui :Position Centre X / X Center=float(50,0,100) +#@gui :Position Centre Y / Y Center=float(50,0,100) +#@gui :Nb Triangles=int(60,3,360) +#@gui :Artefacts / Artifacts=int(-1,-1,10) +#@gui :_=note("Couleurs / Colors") +#@gui :Décalage Des Couleurs / Offset (Angle)=float(0,-360,360) +#@gui :- - - Centre / Center - - -=color(#ffffff) +#@gui :Couleur / Color A=color(#ff00dd) +#@gui :Couleur / Color B=color(#4800ff) +#@gui :Couleur / Color C=color(#0091ff) +#@gui :Couleur / Color D=color(#00ff90) +#@gui :Couleur / Color E=color(#48ff00) +#@gui :Couleur / Color F=color(#ffd900) +#@gui :Couleur / Color G=color(#ff0000) +#@gui :Choix Des Couleurs / Choice Of Colors=choice(5,"Couleurs / Colors AB","Couleurs / Colors ABC","Couleurs / Colors ABCD","Couleurs / Colors ABCDE","Couleurs / Colors ABCDEF","Couleurs / Colors ABCDEFG") +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :_=note("Color Balance") +#@gui :Activer / Enable Color Balance=bool(0) +#@gui :Neutral Color=color(#808080) +#@gui :Stretch Colors=bool(1) +#@gui :_=note("Mélange / Blend") +#@gui :Activer Mélange / Enable Blend=bool(0) +#@gui :Mode=choice(3,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacity=float(1,0,1) +#@gui :Revert Layers=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui ___Rendering +#@gui Twisted Rays [Samj]:Twisted_Rays,Twisted_Rays(1) +#@gui :_=note("Image Finale") +#@gui :Dimension En Pixels=int(800,256,1920) +#@gui :Supprimer Calque / Delete Layer=bool(1) +#@gui :Twirl=float(0.2,-5,5) +#@gui :Mélanges Rayons / Blend Rays=choice(2,"Add","And","Average","Darken","Difference","Edges","Grainextract","Grainmerge","Multiply","Negation","Or","Screen","Softburn","Softdodge","Subtract","Xor","- NON / NO -") +#@gui :Rendu=choice(5,"Rayons Couleurs AB","Rayons Couleurs ABC","Rayons Couleurs ABCD","Rayons Couleurs ABCDE","Rayons Couleurs ABCDEF","Rayons Couleurs ABCDEFG") +#@gui :_=note("Rayons De Couleurs") +#@gui :Nombre De Rayons / Number Of Rays=int(21,3,360) +#@gui :Angle Décalage Des Couleurs A / Offset=float(0,-360,360) +#@gui :Angle Décalage Des Couleurs B / Offset=float(0,-360,360) +#@gui :Couleur / Color A=color(#0000ffff) +#@gui :Couleur / Color B=color(#00ffffff) +#@gui :Couleur / Color C=color(#00ff00ff) +#@gui :Couleur / Color D=color(#ffff00ff) +#@gui :Couleur / Color E=color(#ff0000ff) +#@gui :Couleur / Color F=color(#ff00ffff) +#@gui :Couleur / Color G=color(#ffffffff) +#@gui :Couleurs Aléatoires / Random Colors=bool(0) +#@gui :_=note("Contours") +#@gui :Contours=color(#000000ff) +#@gui :Affichage / Display Contours=bool(0) +#@gui :Dilate Contours=int(2,1,16) +#@gui :Flou / Blur Contours=float(2,0,5) +#@gui :Sharpen=int(0,200,400) +#@gui :_=note("Symmetrizoscope") +#@gui :Activer Symmetrizoscope=bool(0) +#@gui :Itérations=int(5,1,32) +#@gui :Angle=float(0,0,360) +#@gui :Symmetry Sides=choice("Backward","Forward","Swap") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/10/24.") +#@gui _Testing +#@gui Samj +#@gui Repair +#@gui CorLine:samj_CorLine,samj_CorLine_preview +#@gui :_=note("samj_CorLine pour vieilles photos décolorées scannées \r\nsamj_CorLine for old faded scanned photos") +#@gui :_=separator() +#@gui :_=note("Couleurs") +#@gui :Balance=int(0,-64,64) +#@gui :Chroma=int(10,0,50) +#@gui :_=separator() +#@gui :_=note("Netteté") +#@gui :Netteté A=float(0.5,0,1.5) +#@gui :Netteté B=float(0,0,1.5) +#@gui :_=separator() +#@gui :_=note("Réparation") +#@gui :Type=choice(0,"Anisotropic","Diffusion") +#@gui :Amplitude=int(50,0,100) +#@gui :Répétition(s)=int(1,1,5) +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Horizontal","Duplicate Vertical") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/05/10.") +#@gui CorLine B:samj_CorLine_B,samj_CorLine_B_preview +#@gui :_=note("samj_CorLine_B pour vieilles photos décolorées scannées \r\nsamj_CorLine_B for old faded scanned photos") +#@gui :_=separator() +#@gui :_=note("Couleurs") +#@gui :Balance=int(0,-64,64) +#@gui :Gamma=float(1,0.8,2.2) +#@gui :Chroma=int(10,0,50) +#@gui :Cyan=int(0,-127,128) +#@gui :Magenta=int(0,-127,128) +#@gui :Jaune=int(0,-127,128) +#@gui :_=separator() +#@gui :_=note("Netteté") +#@gui :Netteté A=float(0.5,0,1.5) +#@gui :Netteté B=float(0,0,1.5) +#@gui :_=separator() +#@gui :_=note("Réparation") +#@gui :Type=choice(0,"Anisotropic","Diffusion") +#@gui :Amplitude=int(50,0,100) +#@gui :Répétition(s)=int(1,1,5) +#@gui :_=separator() +#@gui :_=note("Preview") +#@gui :Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Horizontal","Duplicate Vertical") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/05/11.") +#@gui _Sequences +#@gui Spatial Transition To PNG:samj_fx_spatial_transition_to_PNG,fx_spatial_transition_preview(1) +#@gui :_=separator() +#@gui :_=note("Export all frames/layers as PNG files in :") +#@gui :_=note("/G'MIC folder used to store configuration files/Spatial_Transition_000000.png") +#@gui :_=separator() +#@gui :_=note("PNG to Video with FFMPEG :") +#@gui :_=note("ffmpeg -i Spatial_Transition_%06d.png -c:v libx264 -vf \"yadif,fps=25,format=yuv420p\" GMIC_Transition.mp4") +#@gui :_=separator() +#@gui :Number of Added Frames=_int(10,1,256) +#@gui :Shading (%)=float(0,0,100) +#@gui :Transition Shape=choice(5,"Bottom Layer","Top Layer","Custom Formula","Horizontal","Vertical","Angular","Radial","Plasma") +#@gui :Custom Formula=text{"cos(x*y/(16+32*A))"}_1 +#@gui :A-Value=float(0,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice(4,"Transition Map","Timed Image","Sequence X4","Sequence X6","Sequence X8") +#@gui :Preview Time=float(0,0,1) +#@gui :_=value(0) +#@gui :_=separator() +#@gui :Visualize the Middle Frame of the Transition.=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/10/04.") +#@gui Transition H V To PNG:samj_transition_H_V_to_PNG,samj_transition_H_V_to_PNG_Preview(1) +#@gui :_=separator() +#@gui :_=note("Export all frames/layers as PNG files in :") +#@gui :_=note("/G'MIC folder used to store configuration files/TransitionHV_000000.png") +#@gui :_=separator() +#@gui :_=note("PNG to Video with FFMPEG :") +#@gui :_=note("ffmpeg -i TransitionHV_%06d.png -c:v libx264 -vf \"yadif,fps=25,format=yuv420p\" GMIC_TransitionHV.mp4") +#@gui :_=separator() +#@gui :1 - Number of Frames=_int(10,3,300) +#@gui :2 - Transition Shape=choice(1,"Horizontal A","Horizontal B","Vertical A","Vertical B") +#@gui :3 - Reverse Scrolling=bool(0) +#@gui :_=separator() +#@gui :4 - Visualize the Middle Frame of the Transition.=bool(0) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/04/26.") +#@gui _Various +#@gui BoxFiter Map:samj_BoxFiter_Map,samj_BoxFiter_Map(1) +#@gui :_=note("samj_BoxFiter_Map") +#@gui :_=separator() +#@gui :_=note("BoxFiter") +#@gui :Blur=int(2,0,32) +#@gui :X=int(3,1,32) +#@gui :Y=int(3,1,32) +#@gui :Codage=choice(0,"Gray","Luminance") +#@gui :Blend=choice(0,"Alpha","Add") +#@gui :_=separator() +#@gui :_=note("Sharpen") +#@gui :Type=choice(0,"No","Decompose 2","Decompose 6") +#@gui :Itérations=int(2,0,3) +#@gui :_=separator() +#@gui :_=note("Map") +#@gui :Equalize=int(127,1,256) +#@gui :Colormap=int(16,2,256) +#@gui :Dithering=float(0,0,1) +#@gui :_=separator() +#@gui :_=note("Transfer Color - Slow") +#@gui :Transfer=bool(0) +#@gui :Luminosity Constraints=float(0.2,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/11/13.") +#@gui BoxFiter Test:samj_BoxFiter_Test,samj_BoxFiter_Test(1) +#@gui :_=note("samj_BoxFiter_Test") +#@gui :Blur=int(2,0,32) +#@gui :X=int(3,1,32) +#@gui :Y=int(3,1,32) +#@gui :_=separator() +#@gui :_=note("Sharpen") +#@gui :Type=choice(1,"No","Decompose 2","Decompose 6") +#@gui :Itérations=int(2,0,3) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/11/12.") +#@gui Carres Lignes - Squares Lines:samj_Carres_Lignes,samj_Carres_Lignes(0) +#@gui :_=separator() +#@gui :_=note("Ce filtre est très lent - This filter is very slow") +#@gui :_=separator() +#@gui :1 - Densité/Density=int(2000,10,10000) +#@gui :2 - Variation=float(3,0,100) +#@gui :3 - Graine/Seed=int(1234,0,65536) +#@gui :4 - Degradation=int(0,0,10) +#@gui :_=note("Carrés/Squares") +#@gui :5 - Alpha=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Lignes/Lines") +#@gui :6 - Densité/Density=float(1.5,0,100) +#@gui :7 - Alpha LA=float(0,0,1) +#@gui :8 - Alpha LB=float(0,0,1) +#@gui :9 - Dilate=int(1,1,5) +#@gui :_=separator() +#@gui :_=note("Fond/Background") +#@gui :10 11 12 13 - Fond/Background=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/08/29.") +#@gui CeKoaSa 001:samj_CeKoaSa_001,samj_CeKoaSa_001(1) +#@gui :_=separator() +#@gui :Douceur / Smoothness=float(0,0,10) +#@gui :Seuil / Threshold=float(15,0,50) +#@gui :Déformation=float(3,0,6) +#@gui :Renforcer Couleurs / Boost=bool(1) +#@gui :Taille / Size=int(3,1,10) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/11/24.") +#@gui CeKoaSa 002:samj_CeKoaSa_002,samj_CeKoaSa_002(1) +#@gui :_=separator() +#@gui :Douceur / Smoothness=float(0,0,10) +#@gui :Seuil / Threshold=float(15,0,50) +#@gui :Déformation=float(3,0,6) +#@gui :Renforcer Couleurs / Boost=bool(1) +#@gui :Taille / Size=int(3,1,10) +#@gui :Otsu=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/11/24.") +#@gui CeKoaSa 003:samj_CeKoaSa_003,samj_CeKoaSa_003(1) +#@gui :_=separator() +#@gui :Douceur / Smoothness=float(0,0,10) +#@gui :Seuil / Threshold=float(5,0,50) +#@gui :Déformation=float(1,0,6) +#@gui :Renforcer Couleurs / Boost=bool(1) +#@gui :Taille / Size=int(3,1,10) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/11/24.") +#@gui CeKoaSa 004:samj_CeKoaSa_004,samj_CeKoaSa_004(1) +#@gui :_=separator() +#@gui :Modulo=int(30,0,130) +#@gui :Négatif=bool(0) +#@gui :Filtre B&W Pencil=int(0,0,120) +#@gui :Opacité / Opacity=float(0.8,0.5,1) +#@gui :Filtre Denoise=int(0,0,20) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/11/24.") +#@gui CeKoaSa 005:samj_CeKoaSa_005,samj_CeKoaSa_005(1) +#@gui :_=separator() +#@gui :_=note("Grille / Grid") +#@gui :Grille / Grid X=int(16,2,100) +#@gui :Grille / Grid Y=int(16,2,100) +#@gui :Grille Carrée X=bool(0) +#@gui :Grille Carrée Y=bool(0) +#@gui :_=separator() +#@gui :_=note("Couleurs / Colors") +#@gui :Intensité=float(0.2,0,1) +#@gui :Mode=choice(1,"Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacité / Opacity=float(1,0,1) +#@gui :Inverser Calques / Revert Layers=bool(0) +#@gui :Normaliser=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2020/11/24.") +#@gui CeKoaSa 007:samj_CeKoaSa_007,samj_CeKoaSa_007 (1) +#@gui :_=separator() +#@gui :_=note("samj_CeKoaSa_007") +#@gui :Max Patch=int(8,1,32) +#@gui :Min Patch=int(8,1,32) +#@gui :Dilate=int(10,1,16) +#@gui :Pixelize=int(8,2,100) +#@gui :Blur=int(8,0,30) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2016/11/15.") +#@gui CeKoaSa 008:samj_CeKoaSa_008,samj_CeKoaSa_008_preview(1) +#@gui :_=separator() +#@gui :_=note("Filtre Lent") +#@gui :Détection A=int(64,0,127) +#@gui :Détection B=int(64,0,127) +#@gui :Flou Lissage=float(4,0,10) +#@gui :Couleur=float(1,0,4) +#@gui :Rendu=int(2,1,7) +#@gui :_=separator() +#@gui :_=note("Topographic Map") +#@gui :Levels=int(16,4,256) +#@gui :Smoothness=float(1,0,5) +#@gui :_=separator() +#@gui :_=note("Stained Glass") +#@gui :Edges=float(20,0,100) +#@gui :Shading=float(0.1,0,0.5) +#@gui :Thin Separators=bool(0) +#@gui :Intensité=int(1,1,8) +#@gui :_=separator() +#@gui :_=note("Isophotes") +#@gui :Isophotes Nb Levels=int(64,1,128) +#@gui :_=separator() +#@gui :_=note("Smooth [antialias]") +#@gui :Smooth [antialias]=bool(1) +#@gui :Amplitude=float(2,0,100) +#@gui :Edge Threshold (%)=float(10,0,100) +#@gui :Smoothness=float(0.8,0,5) +#@gui :_=separator() +#@gui :_=note("Fond") +#@gui :Couleur Fond=color(#ffffffff) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/12/04.") +#@gui CeKoaSa 009:samj_CeKoaSa_009,samj_CeKoaSa_009(0) +#@gui :_=separator() +#@gui :_=link("Essai adaptation du didacticiel de Sebastien Guyader et du code de Iain Fergusson","https://discuss.pixls.us/t/highlight-bloom-and-photoillustration-look/2509/29") +#@gui :_=separator() +#@gui :_=note("Smooth") +#@gui :Itérations=int(1,1,10) +#@gui :Amplitude=float(5,0,1000) +#@gui :Sharpness=float(0.5,0,2) +#@gui :Anisotropy=float(0.63,0,1) +#@gui :Gradient Smoothness=float(0.6,0,10) +#@gui :Tensor Smoothness=float(2.35,0,10) +#@gui :Spatial Precision=float(0.8,0.1,2) +#@gui :Angular Precision=float(30,1,180) +#@gui :Value Precision=float(2,0.1,5) +#@gui :Interpolation=choice(0,"Nearest Neighbor","Linear","Runge-Kutta") +#@gui :Fast Approximation=bool(1) +#@gui :_=separator() +#@gui :_=note("Iain Fergusson - Simplelocal Contrast") +#@gui :Edge Sensitivity=float(25,0,25) +#@gui :Itérations=int(1,1,5) +#@gui :Paint Effect=float(50,0,50) +#@gui :Channels=choice(1,"Colour","Luminance Only") +#@gui :Pre Gamma=float(1.0,0.1,5) +#@gui :Post Gamma=float(1.2,0.1,5) +#@gui :_=note("Luminance Mask") +#@gui :Blacks=float(1,0,1) +#@gui :Dark Grey=float(1,0,1) +#@gui :Mid Grey=float(1,0,1) +#@gui :Light Grey=float(1,0,1) +#@gui :Whites=float(1,0,1) +#@gui :Parallel Processing=choice(1,"Auto","None") +#@gui :_=separator() +#@gui :_=note("Wavelet Sharpen") +#@gui :Wavelet Sharpen Vs Graphic Novel=choice(0,"Wavelet Sharpen","Photocomix Graphic Novel") +#@gui :Type=choice(0,"Decompose 2","Decompose 6") +#@gui :Itérations=int(0,0,2) +#@gui :_=separator() +#@gui :_=note("Script Origine de Iain Fergusson") +#@gui :Script Origine=bool(0) +#@gui :_=separator() +#@gui :_=note("Courbes") +#@gui :Utiliser Courbes=choice(0,"Non"," Utiliser Curves Interactive") +#@gui :Colorspace=choice(7,"RGB","CMY","CMYK","HSI","HSL","HSV","Lab","Lch","YCbCr") +#@gui :_=value(0) +#@gui :Apply Transformation From=_choice("New Curves [interactive]","Curves Defined Previously") +#@gui :_=value(0) +#@gui :_=value(0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2017/01/05.") +#@gui CeKoaSa 010:samj_CeKoaSa_010,samj_CeKoaSa_010(1) +#@gui :Flou A=int(30,0,128) +#@gui :Flou B=int(10,0,128) +#@gui :Diff A=float(0.1,0.1,16) +#@gui :Diff B=float(2,0.1,16) +#@gui :Isop=int(10,2,16) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/11/18.") +#@gui CeKoaSa 011:samj_CeKoaSa_011,samj_CeKoaSa_011(0) +#@gui :_=separator() +#@gui :_=note("Masque") +#@gui :Flou=float(0.2,0,32) +#@gui :Ditheredbw=choice(0,"Non","A","B","C") +#@gui :Bump2Normal=bool(0) +#@gui :Orientation=choice(5,"A","B","C","D","E","F") +#@gui :_=separator() +#@gui :_=note("Mélange Blend Image Origine") +#@gui :Mélange=bool(0) +#@gui :_=separator() +#@gui :_=note("Degrade") +#@gui :Ajouter Degrade=bool(0) +#@gui :Type H / V=choice(0,"H","V") +#@gui :Swap Colors=bool(0) +#@gui :Starting Color A=color(#f028a0ff) +#@gui :Ending Color B=color(#f0f028ff) +#@gui :_=separator() +#@gui :_=note("Niveaux Masque") +#@gui :Valider Niveaux=bool(0) +#@gui :Valeur 1=float(50,0,255) +#@gui :Valeur 2=float(205,0,255) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2019/03/19.") +#@gui Diaporama - Slideshow:samj_diaporama,gui_no_preview +#@gui :_=note("Ce filtre démarre un diaporama automatique en mode plein écran.\n Paramétrage à faire :\n - Calques en entrée = Tous.\n - Mode de sortie = Nouvelle image.") +#@gui :_=note(" - Delai / Time Secondes = Temps d'affichage de chaque calque.\n - Diaporama Infini / Infinite slideshow = Boucle infinie d'affichage des images.") +#@gui :_=note("Utilisation du clavier :\n - Barre d'espacement ou Entrée = Image suivante.\n - Échap ou Q = Sortie du diaporama.\n - Page Haut = Image précédente.") +#@gui :_=separator() +#@gui :_=note("This filter starts an automatic slideshow in full screen mode.\n Important settings to do :\n - Input layers = All.\n - Output mode = New image.") +#@gui :_=note(" - Delai / Time Secondes = Display time of each layer.\n - Diaporama Infini / Infinite slideshow = Infinite image display loop.") +#@gui :_=note("Using the keyboard :\n - Space bar or Enter = Next image.\n - Esc or Q = Exit.\n - Page UP = Previous image.") +#@gui :_=separator() +#@gui :Delai / Time Secondes=int(1,1,300) +#@gui :Diaporama Infini / Infinite Slideshow=bool(0) +#@gui Do Nothing:Je_passe_l_hiver_en_Floride,Je_passe_l_hiver_en_Floride +#@gui :_=note("Note : This filters does nothing on the image. Use it to manipulate layers in conjunction with the input/output options of the G'MIC plug-in.") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé. Latest update: 2010/12/29.") +#@gui Layers To PNG:samj_Layers_To_PNG,samj_Layers_To_PNG_Preview +#@gui :_=separator() +#@gui :_=note("Enregistre chaque calque comme une image PNG) +#@gui :_=note("Save all layers as a PNG file) +#@gui :_=separator() +#@gui :_=note("Paramétrage pour une animation :\n - Calques en entrée = Tous.") +#@gui :_=note("Settings for an animation :\n - Input layers = All") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/04/13.") +#@gui Polygonize:polygonize_GUI,polygonize_GUI(0) +#@gui :_=separator() +#@gui :_=note("Paramètres filtre Polygonize / Polygonize parameters") +#@gui :Amplitude=int(300,0,2000) +#@gui :Douceur / Smoothness=float(10,0,100) +#@gui :Surface Minimale / Minimal Area=float(10,0,100) +#@gui :X-Resolution=float(10,1,256) +#@gui :Y-Resolution=float(10,1,256) +#@gui :_=separator() +#@gui :_=note("Test") +#@gui :Test Cadre Et Otsu=int(0,0,256) +#@gui :_=separator() +#@gui :_=note("Filtre créé par David Tschumperlé Dernière mise à jour : 2020/11/24.") +#@gui Recolorize 20130115:gimp_recolorize_20130115_modifie,gimp_recolorize_20130115_modifie(1) +#@gui :_=link("http://www.flickr.com/groups/gmic/discuss/72157632525934815/","http://www.flickr.com/groups/gmic/discuss/72157632525934815/") +#@gui :_=link("http://www.gimpchat.com/viewtopic.php?f=28&t=6207&start=0","http://www.gimpchat.com/viewtopic.php?f=28&t=6207&start=0") +#@gui :Douceur / Smoothness=float(30,0,200) +#@gui :Nuances/decompose=choice(0,"Origine","Canal Y De YUV","Canal L De HSL 8","Canal L De LCH","Canal K De CMYK") +#@gui :Étendue / Normalize A=int(0,0,255) +#@gui :Étendue / Normalize B=int(255,0,255) +#@gui :Dégoulinade A / Extension Colors A=int(0,0,20) +#@gui :Dégoulinade B / Extension Colors B=float(0,0,10) +#@gui :Précision=bool(1) +#@gui :_=separator() +#@gui :_=note{"Note : This filter needs two layers to work properly. The bottom layer can be a B&W or a colored image, while the top layer contains color patches that will be extrapolated in a smart way (edge-directed) to fill the entire image. At the end, you get a completely recolored image."} +#@gui :_=separator() +#@gui :_=note("Auteur / Author : David Tschumperlé. Dernière mise à jour: 2013/01/18 samj.") +#@gui Relief A:samj_Relief_A,samj_Relief_A(1) +#@gui :_=separator() +#@gui :_=note("Vanvliet") +#@gui :Variation=float(3,0,6) +#@gui :Order=int(1,0,3) +#@gui :Axis=choice(0,"X","Y","-X","-Y") +#@gui :Boundary=choice(1,"Dirichlet","Neumann") +#@gui :_=separator() +#@gui :_=note("Iain Fergusson - Simplelocal Contrast") +#@gui :Edge Sensitivity=float(16,0,25) +#@gui :Itérations=int(1,1,5) +#@gui :Paint Effect=float(50,0,50) +#@gui :Channels=choice(1,"Colour","Luminance Only") +#@gui :Pre Gamma=float(1.0,0.1,5) +#@gui :Post Gamma=float(1.2,0.1,5) +#@gui :_=note("Luminance Mask") +#@gui :Blacks=float(1,0,1) +#@gui :Dark Grey=float(1,0,1) +#@gui :Mid Grey=float(1,0,1) +#@gui :Light Grey=float(1,0,1) +#@gui :Whites=float(1,0,1) +#@gui :Parallel Processing=choice(1,"Auto","None") +#@gui :_=separator() +#@gui :_=note("Wavelet Sharpen") +#@gui :Sharpen=choice(0,"Sharpen A","Sharpen B","Sharpen A B") +#@gui :Sharpen A Type=choice(0,"Decompose 2","Decompose 6") +#@gui :Sharpen A Itérations=int(0,0,2) +#@gui :Sharpen B Type=choice(0,"Decompose 2","Decompose 6") +#@gui :Sharpen B Itérations=int(0,0,2) +#@gui :_=separator() +#@gui :_=note("Relief") +#@gui :Cut A %=float(0,0,100) +#@gui :Cut B %=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Update : 2020/10/24.") +#@gui Segments Points TSP:samj_TSP_Segments_GUI,samj_TSP_Segments_GUI(0) +#@gui :_=separator() +#@gui :_=note("TSP - samj_Masques_Noir_Et_Blanc") +#@gui :1 - Flou/Blur=float(3,0,10) +#@gui :2 - Masque/Mask %=float(50,20,80) +#@gui :_=separator() +#@gui :3 - Variation Segments=float(2,0,10) +#@gui :4 - Densité/Density=float(0.5,0.01,1) +#@gui :5 - Graine/Seed=int(12345,0,123456) +#@gui :6 - Dilate=int(0,0,10) +#@gui :7 8 9 10 - Fond/Background=color(#000000ff) +#@gui :11 - Deformation=int(0,0,10) +#@gui :12 - Boost Couleur/Color=float(1,1,1.2) +#@gui :13 - X=choice(1,"Sans/Without","X") +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/08/28.") +#@gui SVG Symetries A:samj_SVG_Symetries_A,samj_SVG_Symetries_A_preview(1) +#@gui :_=separator() +#@gui :_=note("Prévisualisation : Les couleurs sont aléatoires.") +#@gui :_=note("Preview : The colors displayed are random.") +#@gui :_=separator() +#@gui :_=note("Formes") +#@gui :1 Répétitions=int(8,3,90) +#@gui :2 Amplitude A=float(0,0,1) +#@gui :3 Angle A=float(0,-2,2) +#@gui :4 Amplitude B=float(0.33,0,1) +#@gui :5 Angle B=float(1,-2,2) +#@gui :6 Amplitude C=float(0.66,0,1) +#@gui :7 Angle C=float(-1,-2,2) +#@gui :8 Amplitude D=float(1,0,1) +#@gui :9 Angle D=float(0.5,-2,2) +#@gui :_=separator() +#@gui :_=separator() +#@gui :_=note("SVG") +#@gui :10 - Couleur Ligne/ Stroke Color=_choice(0,"Black","Blue","Brown","Chartreuse","Chocolate","Coral","Cyan","DarkRed","DeepPink","FireBrick","ForestGreen","Fuchsia","Gold","Green","HotPink","Indigo","Lime","Magenta","Maroon","Olive","Orange","Orchid","Pink","Purple","Red","Salmon","SeaGreen","Sienna","Violet","Wheat","White","Yellow") +#@gui :11 - Épaisseur Ligne/ Stroke Width=_int(2,1,10) +#@gui :_=separator() +#@gui :_=note("SVG - Filtre Ombre Portée/Drop Shadow Filter ") +#@gui :12 - Ombre Portée/Drop Shadow=bool(0) +#@gui :13 - X=_int(-5,-10,10) +#@gui :14 - Y=_int(5,-10,10) +#@gui :15 - Couleur Ombre/ Shadow Color=_choice(0,"Black","Blue","Brown","Chartreuse","Chocolate","Coral","Cyan","DarkRed","DeepPink","FireBrick","ForestGreen","Fuchsia","Gold","Green","HotPink","Indigo","Lime","Magenta","Maroon","Olive","Orange","Orchid","Pink","Purple","Red","Salmon","SeaGreen","Sienna","Violet","Wheat","White","Yellow") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2022/04/10.") +#@gui SVG TSP:samj_GUI_Test_Liste_Points_TSP,samj_GUI_Test_Liste_Points_TSP_Preview +#@gui :_=separator() +#@gui :_=note("Les zones noires des masques seront remplies de lignes.") +#@gui :_=note("The black areas of the masks will be filled with lines.") +#@gui :_=separator() +#@gui :_=note("Masque/Mask 1 - Gauche/Left") +#@gui :1 - Flou/Blur=float(0,0,10) +#@gui :2 - Masque/Mask %=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("Masque/Mask 2 - Droite/Right") +#@gui :3 - Flou/Blur=float(3,0,10) +#@gui :4 - Masque/Mask %=float(48,0,100) +#@gui :_=separator() +#@gui :_=note("SVG) +#@gui :_=separator() +#@gui :5 - Précision=_float(1,0.1,2) +#@gui :6 - Couleur Ligne/ Stroke Color=_choice(0,"Black","Blue","Brown","Chartreuse","Chocolate","Coral","Cyan","DarkRed","DeepPink","FireBrick","ForestGreen","Fuchsia","Gold","Green","HotPink","Indigo","Lime","Magenta","Maroon","Olive","Orange","Orchid","Pink","Purple","Red","Salmon","SeaGreen","Sienna","Violet","Wheat","White","Yellow") +#@gui :7 - Épaisseur Ligne/ Stroke Width=_int(2,1,10) +#@gui :_=separator() +#@gui :8 - 2 Contours=bool(1) +#@gui :_=separator() +#@gui :_=note("SVG - Filtre Ombre Portée/Drop Shadow Filter ") +#@gui :9 - Ombre Portée/Drop Shadow=bool(1) +#@gui :10 - X=_int(-5,-10,10) +#@gui :11 - Y=_int(5,-10,10) +#@gui :12 - Couleur Ombre/ Shadow Color=_choice(0,"Black","Blue","Brown","Chartreuse","Chocolate","Coral","Cyan","DarkRed","DeepPink","FireBrick","ForestGreen","Fuchsia","Gold","Green","HotPink","Indigo","Lime","Magenta","Maroon","Olive","Orange","Orchid","Pink","Purple","Red","Salmon","SeaGreen","Sienna","Violet","Wheat","White","Yellow") +#@gui :_=separator() +#@gui :13 - Courbes De Bézier/Curves=bool(1) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/03/18.") +#@gui Test A:samj_test_A,samj_test_A(1) +#@gui :_=note("samj_test_A") +#@gui :A=int(64,0,255) +#@gui :B=int(192,0,255) +#@gui :C=int(500,0,10000) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/03/14.") +#@gui Test B:samj_test_B,gui_no_preview +#@gui :_=note("samj_test_B") +#@gui :A=int(100,10,200) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/03/15.") +#@gui Test C:samj_test_C,gui_no_preview +#@gui :_=note("samj_test_C") +#@gui :A=int(100,10,200) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/03/16.") +#@gui Test Courbes:samj_test_x_color_curves,samj_test_x_color_curves(0) +#@gui :_=note("Demo. samj_test_x_color_curves") +#@gui :_=note("") +#@gui :Utiliser=choice(1,"X Color Curves","Gimp Curves Interactive") +#@gui :Appliquer Courbes=choice("Aucun","Appliquer Le Dernier","RGB","CMY","CMYK","HSI","HSL","HSV","Lab","Lch","YCbCr") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/03/04.") +#@gui Test D:samj_test_D,samj_test_D(1) +#@gui :_=note("samj_test_D") +#@gui :Var Sub=float(40,0,255) +#@gui :Var N=float(255,0,255) +#@gui :Var Spread=float(10,0,60) +#@gui :Var Dilate=float(30,0,60) +#@gui :Var Blur=float(5,0,20) +#@gui :Déformation=float(0,0,5) +#@gui :_=separator() +#@gui :Levels=int(8,1,256) +#@gui :Smoothness=float(0,0,5) +#@gui :Var Dilate Circ=float(4,0,60) +#@gui :_=separator() +#@gui :Inner Fading=float(0,0,100) +#@gui :Outer Fading=float(25,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/01/19.") +#@gui Test Dither Color:samj_test_Dither_Color,samj_test_Dither_Color(1) +#@gui :_=note("samj_test_Dither_Color") +#@gui :Flou=int(2,0,10) +#@gui :Dilatation=int(0,0,10) +#@gui :Couleur Fond=color(#e6e696) +#@gui :Tolerance (%)=float(0,0,100) +#@gui :Smoothness (%)=float(0,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/11/08.") +#@gui Test E:samj_test_E,samj_test_E(1) +#@gui :_=note("samj_test_E") +#@gui :_=note("Exemples") +#@gui :Exemple=choice("Non/No","A","B","C") +#@gui :_=note("diffusiontensors") +#@gui :Sharpness=float(0.7,0,2) +#@gui :Anisotropy=float(0.3,0,1) +#@gui :Alpha=float(0.6,0,10) +#@gui :Sigma=float(1.1,0,10) +#@gui :Is Sqrt=bool(0) +#@gui :_=note("Blend") +#@gui :Fond / Background Color=color(#c87d32) +#@gui :Mode=choice("Add","Alpha","And","Average","Blue","Burn","Darken","Difference","Divide","Dodge","Edges","Exclusion","Freeze","Grain Extract","Grain Merge","Green","Hard Light","Hard Mix","Hue","Interpolation","Lighten","Lightness","Linear Burn","Linear Light","Luminance","Multiply","Negation","Or","Overlay","Pin Light","Red","Reflect","Saturation","Shape Average","Shape Average0","Soft Burn","Soft Dodge","Soft Light","Screen","Stamp","Subtract","Value","Vivid Light","Xor") +#@gui :Opacity=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/01/19.") +#@gui Test F:samj_test_F,samj_test_F(1) +#@gui :_=note("samj_test_F") +#@gui :_=note("Flou Effet Verre") +#@gui :A=float(40,0.1,200) +#@gui :B=float(50,0.1,200) +#@gui :Itérations=int(1,1,8) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/04/20.") +#@gui Test G:samj_test_G,samj_test_G(1) +#@gui :_=note("samj_test_G") +#@gui :A=int(0,0,20) +#@gui :B=float(0,0,10) +#@gui :C=float(0,0,1) +#@gui :D=int(30,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2016/01/20.") +#@gui Test Solidify:samj_Test_Solidify,samj_Test_Solidify (1) +#@gui :_=separator() +#@gui :_=note("samj_Quelques_Isophotes") +#@gui :Épaisseur=int(10,1,32) +#@gui :Précision=int(10,1,32) +#@gui :Coeff Précision=float(1,0.1,8) +#@gui :Coeff Flou=float(0.02,0,1) +#@gui :Isophotes=int(8,2,32) +#@gui :_=separator() +#@gui :_=note("Solidify") +#@gui :Valider Solidify=bool(1) +#@gui :Smoothness %=float(75,0,100) +#@gui :Diffusion Type=choice(0,"Isotropic","Delaunay Oriented","Edge Oriented") +#@gui :Diffusion Iter=int(20,1,200) +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2017/01/05.") +#@gui Tests Fill:samj_Tests_Fill,samj_Tests_Fill +#@gui :_=note("Adaptation des exemples de David Tschumperlé, Garry Osgood") +#@gui :_=separator() +#@gui :_=note("Type Fill") +#@gui :1 - Fill=choice(0,"Logo","Julia 1","Julia 2","Courbe","Vector Painting","Gradients","Colorisation","Lignes","Motifs","Couleur","Negatif","Artistic") +#@gui :_=separator() +#@gui :_=note("----- Logo -----") +#@gui :2 - Rayon=int(30,0,100) +#@gui :_=note("----- Julia 1 -----") +#@gui :3 - Zoom=float(2,0.5,4) +#@gui :4 - A=float(-0.8,-1.6,1.6) +#@gui :5 - B=float(0.4,-0.8,0.8) +#@gui :_=note("----- Courbe -----") +#@gui :6 - Display Parametric=bool(1) +#@gui :_=note("----- Vector Painting -----") +#@gui :7 - A=int(1,1,50) +#@gui :_=note("----- Gradients -----") +#@gui :8 - Choix=choice(0,"H","V","H V","Sur Image","2 Couleurs") +#@gui :_=note("----- Lignes -----") +#@gui :9 - Choix=choice(0,"Diagonale","Diagonale Négatif","45 Degrés","Verticales Grises 4 Pix.","Médiane") +#@gui :_=note("----- Motifs -----") +#@gui :10 - Choix=choice(0,"A","B") +#@gui :_=note("----- Couleur -----") +#@gui :11,12,13 - Couleur=color(#7828f0) +#@gui :_=note("----- Artistic -----") +#@gui :14 - Choix=choice(0,"Série Dégradés V","Série Dégradés H","Série 2 - Dégradés V","Série 2 - Dégradés H","Hallucinogen","Zones Couleurs","XorXY","XorXY Blend","Distraction","Carrés","Rayons","Rayé","Tamis") +#@gui :15 - Variation Artistic=float(50,0,100) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2020/11/29.") +#@gui Texture 002:samj_gimp_texture_zero_zero_deux,samj_gimp_texture_zero_zero_deux(1) +#@gui :Détails=int(0,0,127) +#@gui :Résolution=float(10,4,20) +#@gui :Threshold=float(4,2,20) +#@gui :_=separator() +#@gui :Edges=float(10,5,20) +#@gui :Blend Colors=float(0.5,0,1) +#@gui :Colors Boost=bool(1) +#@gui :Boost Intensity=float(1,0,1) +#@gui :_=separator() +#@gui :Black Lines=bool(1) +#@gui :Blend Black Lines=float(0.3,0,1) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2016/11/16.") +#@gui Texture 003:samj_Texture_Aquarelle_1,samj_Texture_Aquarelle_1(1) +#@gui :_=note("Texture") +#@gui :Amplitude Noise=float(10,5,200) +#@gui :Density Hardsketchbw=float(10,5,100) +#@gui :Spread Variations=float(4,3,20) +#@gui :Amplitude Water=float(3,2,10) +#@gui :_=separator() +#@gui :_=note("Couleur / Color") +#@gui :Couleur / Color=color(#fbedce) +#@gui :Opacité / Opacity=float(1,-1,1) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2016/11/16.") +#@gui Toile Araignee:samj_Toile_D_Araignee,samj_Toile_D_Araignee(1) +#@gui :Détails=int(0,0,127) +#@gui :Résolution=float(10,4,20) +#@gui :Threshold=float(4,2,20) +#@gui :_=separator() +#@gui :_=note("samj - Latest update : 2016/11/16.") +#@gui Tout Interactif:samj_test_tout_interactif,gui_no_preview +#@gui :_=note("Demo. Tout interactif") +#@gui :_=note("") +#@gui :_=note("2 filtres interactifs successifs : x_paint et threshold") +#@gui :_=note("x_paint : Choisir un pinceau, appliquer et fermer image") +#@gui :_=note("threshold : Appliquer la souris et fermer image") +#@gui :_=note("") +#@gui :_=note("2 successive interactive filters : x_paint et threshold") +#@gui :_=note("x_paint : Choose a brush, apply and close picture") +#@gui :_=note("threshold : Move the mouse and close picture") +#@gui :_=note("") +#@gui :_=separator() +#@gui :_=note("samj - Dernière mise à jour : 2015/03/03.") +#@gui Triangles Lignes - Lines:samj_Triangles_Lignes,samj_Triangles_Lignes(0) +#@gui :_=separator() +#@gui :_=note("Ce filtre est très lent - This filter is very slow") +#@gui :_=separator() +#@gui :1 - Densité/Density=int(2000,10,10000) +#@gui :2 - Variation=float(3,0,100) +#@gui :3 - Graine/Seed=int(1234,0,65536) +#@gui :4 - Degradation=int(0,0,10) +#@gui :_=note("Triangles") +#@gui :5 - Alpha=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Lignes/Lines") +#@gui :6 - Densité/Density=float(1.5,0,100) +#@gui :7 - Alpha LA=float(0,0,1) +#@gui :8 - Alpha LB=float(0.5,0,1) +#@gui :9 - Alpha LC=float(0.5,0,1) +#@gui :10 - Dilate=int(1,1,5) +#@gui :_=separator() +#@gui :_=note("Fond/Background") +#@gui :11 12 13 14 - Fond/Background=color(#000000ff) +#@gui :_=separator() +#@gui :_=note("samj - Derni\303\250re mise \303\240 jour : 2022/08/25.") +#@gui ___Rendering +#@gui Disco:disco,disco_preview(1) +#@gui :Red Wavelength=int(10,1,50) +#@gui :Green Wavelength=int(15,1,50) +#@gui :Blue Wavelength=int(20,1,50) +#@gui :Zoom=float(250,0,3000) +#@gui :_=separator() +#@gui :_=note("This is a failed attempt on a conversion of a Mathmap script written by persons unknown") +#@gui :_=note("I prefer this over the filter I was attempting to recreate!!!.") +#@gui :_=note("Create a light effect with the size and aspect ratio of the input image.") +#@gui Kitaoka Spin Illusion:KittyRings,KittyRings_preview(1) +#@gui :Sectors=float(30,10,80) +#@gui :Zoom=float(8,1,30) +#@gui :Inner Radius=float(0,0,2) +#@gui :Outer Radius=float(1,0,2) +#@gui :1st Color=color(#710071) +#@gui :2nd Color=color(#00ff00) +#@gui :_=separator() +#@gui :_=note("This filter is a conversion of the Mathmap script originally written by step7 - 2012") +#@gui :_=note("Renders positional displacement illusion 'Spinning Sectors' based on Akiyoshi Kitaoka's 'Rotating Snakes'") +#@gui _Deformations +#@gui Moon2panorama:moon2panorama,moon2panorama_preview(1) +#@gui :Center Help=bool(0) +#@gui :Center X=float(0,-20,20) +#@gui :Center Y=float(0,-20,20) +#@gui :Span=float(360,0,1450) +#@gui :Shift X=float(0,-200,200) +#@gui :Shift Y=float(0,-200,200) +#@gui :_=separator() +#@gui :Antialiasing=bool(1) +#@gui :Edge Behavior X=choice("Blank","Wrap","Reflect","Rotate") +#@gui :Edge Behavior Y=choice("Blank","Wrap","Reflect","Rotate") +#@gui :_=separator() +#@gui :_=note("This filter is a conversion of the Mathmap script originally written by Edgar Bonet") +#@gui :_=link("Edgar Bonet.","http://edgar-bonet.org/") +#@gui :_=note("Converts partial cylindrical layout to panorama layout") +#@gui _Rendering +#@gui Spiral RGB:spiral_RGB,spiral_RGB_preview(1) +#@gui :Red Rotations=int(1,1,20) +#@gui :Green Rotations=int(3,0,20) +#@gui :Blue Rotations=int(5,0,20) +#@gui :Counter Clockwise=bool(0) +#@gui :_=separator() +#@gui :_=note("This filter is based on a conversion of a Mathmap script originally written by Nevit Dilmen") +#@gui :_=note("Create fun spirals with the size and aspect ratio of the input image.") +#@gui _Testing +#@gui Telperion +#@gui Mc Flou:mc_flou,mc_flou_preview +#@gui :_=separator() +#@gui :Sharp=float(30,10,400) +#@gui :Blur=float(6,3,20) +#@gui :Blend=float(1,0,1) +#@gui :_=separator() +#@gui :_=note("Base image adjustement:") +#@gui :Skip=bool(true) +#@gui :Gamma=float(1,0.2,2) +#@gui :Value Min=int(0,0,127) +#@gui :Value Max=int(255,128,255) +#@gui :Gamma R=float(1,0.2,2) +#@gui :Gamma G=float(1,0.2,2) +#@gui :Gamma B=float(1,0.2,2) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Apply a flou effect with edges protection. v.1.1") +#@gui Mc Pendraw:mc_pendraw,mc_pendraw_preview +#@gui :_=separator() +#@gui :Amplitude=float(8,0,30) +#@gui :Blur=float(0.8,0.1,2) +#@gui :Sharp=float(450,100,2000) +#@gui :Color=int(21,4,256) +#@gui :Dithering=float(0.5,0,1) +#@gui :Value=float(1,0,1) +#@gui :Mode 2=bool(false) +#@gui :Color Equal.=bool(false) +#@gui :Equal. Limit=int(255,100,255) +#@gui :_=separator() +#@gui :Lowers Contrast=float(0,0,1) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui _Tom Keil +#@gui About:_none_,fx_tk_about +#@gui :_=note{" ( Tom Keil's Filter Set for G'MIC)\n\nis proposed to you by"} +#@gui :_=note("Tom Keil") +#@gui :_=note("\n") +#@gui :_=separator() +#@gui :_=note(" The source code of this set of filters and additional informations and tutorials are available at :") +#@gui :_=separator() +#@gui :_=note("\nThe filters in this folder are still under development and may be subject to changes. Some filters appearing here are also part of the main filter tree of G'MIC. If they appear here too it means there are changes and updates not yet implemented in the main filter tree.") +#@gui Beauty Retouch:fx_tk_retouch,fx_tk_retouch_preview(0) +#@gui :_=separator() +#@gui :Smoothness=float(30,0,100) +#@gui :Details=float(3,0,10) +#@gui :Smoothing Strength=float(1,0,5) +#@gui :Edge Threshold=float(20,0,50) +#@gui :Edge Smoothness=float(1.5,0,10) +#@gui :Sharpening Radius=float(1,0,10) +#@gui :Sharpening Strength=float(2.5,0,5) +#@gui :View Edge Mask=bool(0) +#@gui :Smoothen Skin Tones Only=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil. Latest update: 2011/05/01.") +#@gui :_=link("Filter explained here","http://www.flickr.com/groups/gmic/discuss/72157625538669041/") +#@gui DOF Manipulation:fx_tk_dof,fx_tk_dof_preview(1) +#@gui :_=separator() +#@gui :Focal Point X=float(50,0,100) +#@gui :Focal Point Y=float(50,0,100) +#@gui :DOF 1=int(30,0,255) +#@gui :DOF 2=int(60,0,255) +#@gui :Transition=float(5,0,25) +#@gui :Defocus Strength=float(15,0,200) +#@gui :Defocus Style=choice(2,"Median","Gaussian","Mixed") +#@gui :Depth Estimation Model=choice("Automatic Depth Estimation","Daylight Scene","Individual Focus Field Mask","Individual Depth Map") +#@gui :Bokeh Strength=float(0,0,1) +#@gui :Highlights Threshold=float(200,0,255) +#@gui :Bokeh Size=float(40,2,200) +#@gui :Bokeh Blur=float(2,0,20) +#@gui :Aperture Type=choice("Circular","Octogonal") +#@gui :Remove Blurring Artifacts=bool(0) +#@gui :_=separator() +#@gui :Scheimpflug Effect=choice("None","Vertical Blend","Horizontal Blend","Vertical Only","Horizontal Only") +#@gui :Tilt Plane 1=float(0,0,100) +#@gui :Tilt Plane 2=float(0.01,0,100) +#@gui :_=separator() +#@gui :Output Mode=choice("Image","Layers in Focus/out of Focus","Focus Field Mask Only","Depth Estimation Only") +#@gui :Computation Mode=choice(1,"High Quality","Normal","High Speed") +#@gui :Use Treshold Mask Mode=bool(0) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil Latest update: 2012/01/21.") +#@gui Infrared Simulation:fx_tk_infrared,fx_tk_infrared_preview(1) +#@gui :Filter Density=float(0.75,0.01,0.99) +#@gui :Wood Effect Saturation=float(0.5,0,1) +#@gui :Wood Effect Color=int(-100,-180,180) +#@gui :Wood Effect Falloff=float(0.75,0,1) +#@gui :Sky Color=int(0,-180,180) +#@gui :Sky Falloff=float(1,0,1) +#@gui :Infrared Defocus=float(0,0,3) +#@gui :Exposure=int(0,-255,255) +#@gui :Contrast=float(1,0,4) +#@gui :Saturation=float(1,0,2) +#@gui :Color / B&W=bool(0) +#@gui :Add Grain=float(50,0,200) +#@gui :_=separator() +#@gui :Preview Type=choice("Full","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse") +#@gui :_=separator() +#@gui :_=note("Author: Tom Keil Latest update: 2012/17/07.") +#@gui _Zonderr +#@gui Demo Mathmap RA:demo_ra,demo_ra +#@gui :_=note("mathmap ra: demo") +#@gui :_=separator() +#@gui :Radius Scale=float(1,0,10) +#@gui :Angle Scale=float(1,0,10) +#@gui Demo Mathmap XY:demo_xy,demo_xy +#@gui :_=note("mathmap xy: demo") +#@gui :_=separator() +#@gui :X Scale=float(1,0,10) +#@gui :Y Scale=float(1,0,10) +#@gui Fourier Picture Watermark:fx_fourier_picture_watermark,_none_ +#@gui :Relative Size=float(0.2,0.1,0.5) +#@gui :_=separator() +#@gui :_=note("Note : To make the watermark visible afterwards, use the 'Fourier Analysis' filter. ") +#@gui Mathmap Flag:mathmap_flag,mathmap_flag +#@gui :Amp=float(0.05,0,1) +#@gui :Len=float(5,0,50) +#@gui :Speed=int(1,1,5) +#@gui :Time=float(5,0,50) +#@gui Rel2ellv3:mathmap_rel2ellv3,mathmap_rel2ellv3 +#@gui __Rendering +#@gui Spiral:mathmap_spiral,mathmap_spiral +#@gui :Rotations=float(5,0,20) +#@gui :Time=float(0,0,1) +#@gui _Various +#@gui Custom Code [Full]:fx_custom_code,fx_custom_code_preview(1)* +#@gui :Code=text(1,"foreach {\n\n to_rgb\n +deform 20\n blend_edges 3\n\n}\n\n\n") +#@gui :_=separator() +#@gui :Channel(s)=choice{"None (Allows Multi-Layers)","All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]"} +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :Display Debug Info on Preview=bool(0) +#@gui :Debug Font Size=choice(2,"Tiny","Small","Normal","Large") +#@gui :_=separator() +#@gui :Preview Type=choice{"Full (Allows Multi-Layers)","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse"} +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Note: This filter can execute any set of instructions understood by the G'MIC language interpreter. Here, you can then test some commands before creating your own G'MIC custom commands and plug-in menu entries.\n\n Please look at the documentation reference web page :") +#@gui :_=link("https://gmic.eu/reference/") +#@gui :_=note(" to learn more about available G'MIC commands. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2022/04/28.") +#@gui Custom Code [Global]:fx_custom_code,fx_custom_code_preview(1) +#@gui :Code=text(1,"foreach {\n\n to_rgb\n +deform 20\n blend_edges 3\n\n}\n\n\n") +#@gui :_=separator() +#@gui :Channel(s)=choice{"None (Allows Multi-Layers)","All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]"} +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :Display Debug Info on Preview=bool(0) +#@gui :Debug Font Size=choice(2,"Tiny","Small","Normal","Large") +#@gui :_=separator() +#@gui :Preview Type=choice{"Full (Allows Multi-Layers)","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse"} +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Note: This filter can execute any set of instructions understood by the G'MIC language interpreter. Here, you can then test some commands before creating your own G'MIC custom commands and plug-in menu entries.\n\n Please look at the documentation reference web page :") +#@gui :_=link("https://gmic.eu/reference/") +#@gui :_=note(" to learn more about available G'MIC commands. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/03/10.") +#@gui Custom Code [Local]:fx_custom_code,fx_custom_code_preview(0) +#@gui :Code=text(1,"foreach {\n\n to_rgb\n +deform 20\n blend_edges 3\n\n}\n\n\n") +#@gui :_=separator() +#@gui :Channel(s)=choice{"None (Allows Multi-Layers)","All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]"} +#@gui :Value Action=choice("None","Cut","Normalize") +#@gui :Display Debug Info on Preview=bool(0) +#@gui :Debug Font Size=choice(2,"Tiny","Small","Normal","Large") +#@gui :_=separator() +#@gui :Preview Type=choice{"Full (Allows Multi-Layers)","Forward Horizontal","Forward Vertical","Backward Horizontal","Backward Vertical","Duplicate Top","Duplicate Left","Duplicate Bottom","Duplicate Right","Duplicate Horizontal","Duplicate Vertical","Checkered","Checkered Inverse"} +#@gui :Preview Split=point(50,50,0,0,200,200,200,0,10)_0 +#@gui :_=separator() +#@gui :_=note("Note: This filter can execute any set of instructions understood by the G'MIC language interpreter. Here, you can then test some commands before creating your own G'MIC custom commands and plug-in menu entries.\n\n Please look at the documentation reference web page :") +#@gui :_=link("https://gmic.eu/reference/") +#@gui :_=note(" to learn more about available G'MIC commands. ") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/03/10.") +#@gui Export RGB-565 File:fx_output_565,_none_ +#@gui :Filename=_fileout("out565.rgb") +#@gui :Reverse Endianness=_bool(0) +#@gui :_=separator() +#@gui :_=note("Note: This filter saves your selected layer as a raw RGB-565 file. Keep in mind that you have to remember the image dimension if you want to reload the image file afterwards!") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/05/03.") +#@gui Games & Demos:fx_gmic_demos,fx_gmic_demos_preview +#@gui :Selection=choice("2048","Blobs Editor","Bouncing Balls","Connect-Four","Fire Effect","Fireworks","Fish-Eye Effect","Fourier Filtering","Hanoi Tower","Histogram","Hough Transform","Jawbreaker","Virtual Landscape","The Game of Life","Light Effect","Mandelbrot Explorer","3D Metaballs","Minesweeper","Minimal Path","Pacman","Paint","Plasma Effect","RGB Quantization","3D Reflection","3D Rubber Object","Shadebobs","Spline Editor","3D Starfield","Tetris","Tic-Tac-Toe","3D Waves","Fractal Whirl") +#@gui :_=separator() +#@gui :_=note("Note: This filter proposes a showcase of some interactive demos, all written as G'MIC scripts.") +#@gui :_=note{"On most demos, you can use the keyboard shortcut CTRL+D to double the window size (and CTRL+C to go back to the original size). Also, feel free to use the mouse buttons, as they are often used to perform an action. "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2014/10/09.") +#@gui Histogram Analysis:_none_,fx_display_histogram(1) +#@gui :Number of Clusters=int(256,2,1024) +#@gui :_=separator() +#@gui :Channel(s)=choice("All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2016/20/06.") +#@gui Import Data:fx_import_image,gui_no_preview +#@gui :Filename=filein() +#@gui :Normalize=bool(1) +#@gui :_=note{"\nNote: This filter can import any image data read by the G'MIC language interpreter. It includes exotic formats as : Pandore, CImg, Inrimage, AVI/MPEG (requires FFMPEG installed), ... "} +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2010/29/12.") +#@gui Import RGB-565 File:fx_input_565 +#@gui :Filename=filein() +#@gui :Width=text("800") +#@gui :Height=text("600") +#@gui :Reverse Endianness=bool(0) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2020/05/03.") +#@gui Intarsia:fx_intarsia,fx_intarsia_preview +#@gui :_=note("Note: Intarsia is a method of Crochet/Knitting with a number of colours, in which a separate ball of yarn is used for each area of colour. This filter creates a HTML version of a graph chart which is solely used for this purpose ") +#@gui :_=separator() +#@gui :Output Directory=_folder("") +#@gui :Output HTML File=_text("intarsia.html") +#@gui :_=separator() +#@gui :Maximum Image Size=int(512,2,1024) +#@gui :Maximum Number of Image Colors=_int(12,2,64) +#@gui :Starting Point=choice(1,"Top Left","Top Right","Bottom Left","Bottom Right") +#@gui :Loop Method=choice("Row by Row","Column by Column") +#@gui :_=separator() +#@gui :Add Comment Area in HTML Page=_bool(1) +#@gui :Preview Progress (%)=float(100,0,100) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2015/09/07.") +#@gui Sample Image:fx_image_sample,fx_image_sample_preview +#@gui :Input=choice{"Random","Apples","Balloons","Barbara","Boats","Bottles","Butterfly","Cameraman","Car","Cat","Chick","Cliff","Colorful","David","Dog","Duck","Eagle","Elephant","Earth","Flower","Fruits","Gmicky (Deevad)","Gmicky (Mahvin)","Gmicky & Wilber","Greece","Gummy","House","Inside","Landscape","Leaf","Lena","Leno","Lion","Mandrill","Mona Lisa","Monkey","Parrots","Pencils","Peppers","Portrait0","Portrait1","Portrait2","Portrait3","Portrait4","Portrait5","Portrait6","Portrait7","Portrait8","Portrait9","Roddy","Rooster","Rose","Square","Swan","Teddy","Tiger","Tulips","Wall","Waterfall","Zelda"} +#@gui :_=note("Choosing 0 for parameters Width or Height means Automatic. ") +#@gui :Width=_int(0,0,1024) +#@gui :Height=_int(0,0,1024) +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2017/16/01.") +#@gui Solve Maze:fx_solve_maze,fx_solve_maze_preview(1) +#@gui :Starting Point (%)=point(5,5) +#@gui :Ending Point (%)=point(95,95) +#@gui :Smoothness=float(0.1,0,1) +#@gui :Thickness=int(3,1,10) +#@gui :Color=color(#ff0000) +#@gui :Maze Type=choice("Dark Walls","White Walls") +#@gui :_=separator() +#@gui :_=note("Author: David Tschumperlé.      Latest Update: 2011/01/09.") +#@cli :: Global Options +cli_noarg : +v 0 use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r _cli_noarg=1 version ++e "\n[gmic] No commands, options or data provided." +gmic_help="gmic help" +if !${-is_macos}" && "!${-is_windows} gmic_help.=" | less" if $_vt100 gmic_help.=" -r" fi fi +if {*,u}>0 ++e "[gmic] (type "${c}"'"$gmic_help"'"$n" to print help, "${c}"'gmic demos'"$n" to launch demos)." +else ++e "[gmic] (type "${c}"'"$gmic_help"'"$n" to print help)." +fi +file_update=${_path_rc}update$_version.gmic +if "isfile(['"{/$file_update}"'])" +update_old:="Y = date(0); M = date(1); D = date(2); date_current = Y*365 + M*31 + D; +Y = date(0,'"{/$file_update}"'); M = date(1,'"{/$file_update}"'); +D = date(2,'"{/$file_update}"'); date_file = Y*365 + M*31 + D; +date_current - date_file" +if $update_old>=14 ++e "[gmic] Command update file is "$update_old" days old, type "$g"'gmic up'"$n" to update it." +fi +else ++e "[gmic] Fetch update and documentation from the G'MIC server." +l[] { up state=${g}Success!$n onfail state=${r}Failed!$n } ++e "\r[gmic] Fetch update and documentation from the G'MIC server. "$state +fi ++e "\n" +cli_start : +#@cli debug : (+) +#@cli : Activate debug mode. +#@cli : When activated, the G'MIC interpreter becomes very verbose and outputs additional log +#@cli : messages about its internal state on the standard output (stdout). +#@cli : This option is useful for developers or to report possible bugs of the interpreter. +#@cli h : eq. to 'help'. +h : +help $"*" +#@cli help : command : (no arg) +#@cli : Display help (optionally for specified command only) and exit. +#@cli : (eq. to 'h'). +help : skip ${1=""} +use_vt100 +foreach { if "w!=1 || d!=1 || s!=1" rm fi } +if ['$1']==0 +_no_examples,_no_default_values,_no_tutorial_link=1 +reference ascii +else +is_embedded_stdlib:=$!==1 +if narg("$1")" && "isfile(['{/$_path_user}']) +l[] { it[] $_path_user onfail } +fi +if narg("$1")" && "narg($_path_commands) l[] { +$_path_commands foreach { l { it[] {n} onfail 0 } k. } +onfail +} fi +if isfile(['{/$_path_rc/update$_version.gmic}']) +l[] { +i cimgz:$_path_rc/update$_version.gmic +onfail l[] { it[] $_path_rc/update$_version.gmic onfail } +} +fi +if $is_embedded_stdlib mv[0] $! fi +if !$! return fi +a y +command={`" +s = ['$1']; len = size(s); z = 0; +(p = find(s,_'['))>0?(s[p] = 0; len = p); +isin(s[0],_'-',_'+') && len>1 && !(s[z + 1]==_'3' && s[z + 2]==_'d')?(copy(s,s[z + 1],len - 1); s[len - 1] = 0); +s"`} +s +,{'"#@cli "$command" :"'} s +,{'"#@cli "$command":"'} s +,{'"#@cli "$command"\n"'} +if $!==1 +l[] { +m "foo : "$command +repeat 16 { um $command } +foo um foo +onfail ('${}') s -,{'"; did you mean "'} if $!>1 s[1] -,39 k[1] misspelling={t} fi rm +} +if narg($misspelling) misspelling="; did you mean '"$_vt100_g$misspelling$_vt100_n"' ?" fi ++e "\n[gmic] No help available for command '"$_vt100_r$command$_vt100_n"'"$misspelling". ""\n Try '"${_vt100_c}"gmic help"$_vt100_n"' for global help." +else +a y +_no_categories=1 ++parse_cli ascii,$command +if narg(${}) parse_cli ascii,${} fi +fi +fi ++e "\n" rm q +reference : skip "${2=}" +m "_section : reference_section_$1 \"$""*\"" +m "_text : reference_text_$1 \"$""*\"" +l { reference_begin_$1 reference_header_$1 onfail } +_section "Usage" +_text "~~~\ngmic [command1 [arg1_1,arg1_2,..]] .. [commandN [argN_1,argN_2,..]]\n~~~"\n\n"`gmic` is the open-source interpreter of the \\\G'MIC language, a script-based programming ""language dedicated to the design of possibly complex image processing pipelines and operators."\n"It can be used to convert, manipulate, filter and visualize image datasets made of one or ""several 1D/2D or 3D multi-spectral images."\n\n"This reference documentation describes all the technical aspects of the G'MIC framework, ""in its current version ___"${-strver}"___."\n\n"As a starting point, you may want to visit our detailed tutorial pages, at: " +_section "Overall Context" +_text "* At any time, \\G'MIC manages one list of numbered (and optionally named) pixel-based images, ""entirely stored in computer memory (uncompressed)."\n"* The first image of the list has index '0' and is denoted by '[0]'. The second image of the ""list is denoted by '[1]', the third by '[2]' and so on."\n"* Negative indices are treated in a periodic way: '[-1]' refers to the last image of the list, '[-2]' to the ""penultimate one, etc. Thus, if the list has 4 images, '[1]' and '[-3]' both designate the second image of the list."\n"* A named image may be also indicated by '[name]', if 'name' uses the character set `[a-zA-Z0-9_]` and does not ""start with a number. Image names can be set or reassigned at any moment during the processing pipeline ""(see command ''name'' for this purpose)."\n"* G'MIC defines a set of various commands and substitution mechanisms to allow the design of complex ""pipelines and operators managing this list of images, in a very flexible way: You can insert or remove images ""in the list, rearrange image order, process images (individually or grouped), merge image data together, ""display and output image files, etc."\n"* Such a pipeline can define a new custom G'MIC command (stored in a user command file), and re-used ""afterwards as a regular command, in a larger pipeline if necessary." +_section "Image Definition and Terminology" +_text "* In \\G'MIC, each image is modeled as a 1D, 2D, 3D or 4D array of scalar values, uniformly ""discretized on a rectangular/parallelepipedic domain."\n"* The four dimensions of this array are respectively denoted by:"\n" - `width`, the number of image columns (size along the `x-axis`)."\n" - `height`, the number of image rows (size along the `y-axis`)."\n" - `depth`, the number of image slices (size along the `z-axis`). ""The depth is equal to '1' for usual color or grayscale 2D images."\n" - `spectrum`, the number of image channels (size along the `c-axis`). ""The spectrum is respectively equal to '3' and '4' for usual `RGB` and `RGBA` color images."\n\n"* There are no hard limitations on the size of the image along each dimension. For instance, the number of image ""slices or channels can be of arbitrary size within the limits of the available memory."\n"* The `width`, `height` and `depth` of an image are considered as _spatial_ dimensions, while the `spectrum` has a ""_multi-spectral_ meaning. Thus, a 4D image in G'MIC should be most often regarded as a 3D dataset of multi-spectral ""voxels. Most of the G'MIC commands will stick with this idea (e.g. command ''blur'' blurs images only along the ""spatial `xyz`-axes)."\n"* G'MIC stores all the image data as buffers of `float` values (32 bits, value range '[-3.4E38,+3.4E38]'. ""It performs all its image processing operations with floating point numbers. Each image pixel takes ""then 32bits/channel (except if double-precision buffers have been enabled during the compilation of the software, ""in which case 64bits/channel can be the default)."\n"* Considering `float`-valued pixels ensure to keep the numerical precision when executing image processing ""pipelines. For image input/output operations, you may want to prescribe the image datatype to be different than ""`float` (like `bool`, `char`, `int`, etc.). This is possible by specifying it as a file option when using ""I/O commands. (see section ''Input/Output Properties'' to learn more about file options)." +_section "Items of a Processing Pipeline" +_text "* In \\G'MIC, an image processing pipeline is described as a sequence of items separated by the ""space character. Such items are interpreted and executed from the left to the right. For instance, the expression:"\n"~~~\nfilename.jpg blur 3,0 sharpen 10 resize 200%,200% output file_out.jpg\n~~~\n""defines a valid pipeline composed of nine G'MIC items."\n\n"* Each G'MIC item is a string that is either a __command__, a list of command __arguments__, ""a __filename__ or a special __input string__."\n"* Escape characters '\\' and double quotes '\"' can be used to define items containing spaces or ""other special characters. For instance, the two strings `single\\ item` and `\"single item\"` ""both define the same single item, with a space in it." +_section "Input Data Items" +_text "* If a specified \\G'MIC item appears to be an existing filename, the corresponding image data ""are loaded and inserted at the end of the image list (which is equivalent to the use of `input filename`). "\n"* Special filenames `-` and `-.ext` stand for the standard input/output streams, optionally ""forced to be in a specific 'ext' file format (e.g. `-.jpg` or `-.png`). "\n"* The following special input strings may be used as G'MIC items to create and insert new ""images with prescribed values, at the end of the image list:"\n" - '[selection]' or '[selection]xN': Insert 1 or N copies of already existing images. ""'selection' may represent one or several images (see section ''Command Items and Selections'' to learn more ""about selections)."\n" - 'width[%],_height[%],_depth[%],_spectrum[%],_values[xN]': Insert one or N images with specified ""size and values (adding '%' to a dimension means __\"percentage of the size along the same axis\"__, ""taken from the last image '[-1]'). Any specified dimension can be also written as ""'[image]', and is then set to the size (along the same axis) of the existing specified image ""'[image]'. 'values' can be either a sequence of numbers separated by commas ',', ""or a mathematical expression, as e.g. in input item '256,256,1,3,[x,y,128]' which ""creates a `256x256` RGB color image with a spatial shading on the red and green channels. ""(see section ''Mathematical Expressions'' to learn more about mathematical expressions). "\n" - '(v1,v2,..)[xN]': Insert one or `N` new images from specified prescribed values. Value separator ""inside parentheses can be ',' (column separator), ';' (row separator), '/' (slice separator) or ""'^' (channel separator). For instance, expression '(1,2,3;4,5,6;7,8,9)' creates a 3x3 matrix (scalar image), ""with values running from 1 to 9. "\n" - '(\\'string\\'[:delimiter])[xN]': Insert one or N new images from specified string, by filling ""the images with the character codes composing the string. When specified, 'delimiter' tells about ""the main orientation of the image. Delimiter can be 'x' (eq. to ',' which is the default), ""'y' (eq. to ';'), 'z' (eq. to '/') or 'c' (eq. to '^'). ""When specified delimiter is ',', ';', '/' or '^', the expression is actually equivalent to ""'({\\'string\\'[:delimiter]})[xN]' (see section ''Substitution Rules'' for more information on the syntax)."\n" - '0[xN]': Insert one or N new `empty` images, containing no pixel data. ""Empty images are used only in rare occasions."\n\n"* Input item 'name=value' declares a new variable 'name', or assign a new string value to an existing variable. ""Variable names must use the character set `[a-zA-Z0-9_]` and cannot start with a number. "\n"* A variable definition is always local to the current command except when it starts by the underscore ""character '_'. In that case, it becomes also accessible by any command invoked outside the current command ""scope (global variable)."\n"* If a variable name starts with two underscores `__`, the global variable is also shared among different threads ""and can be read/set by commands running in parallel (see command ''parallel'' for this purpose). ""Otherwise, it remains local to the thread that defined it."\n"* Numerical variables can be updated with the use of these special operators: ""'+=' (addition), '-=' (subtraction), '*=' (multiplication), '/=' (division), '%=' (modulo), '&=' (bitwise and), ""'|=' (bitwise or), '^=' (power), '<<=' and '>>' (bitwise left and right shifts). For instance, 'foo=1' 'foo+=3'."\n"* Input item 'name.=string' appends specified `string` at the end of variable 'name'."\n"* Input item 'name..=string' prepends specified `string` at the beginning of variable 'name'."\n"* Multiple variable assignments and updates are allowed, with expressions: 'name1,name2,...,nameN=value' or ""'name1,name2,...,nameN=value1,value2,...,valueN' where assignment operator '=' can be replaced by one of the ""allowed operators (e.g. '+=')."\n"* Variables usually store numbers or strings. Use command ''store'' to assign variables from image data ""(and syntax `input $variable` to bring them back on the image list afterwards)." +_section "Command Items and Selections" +_text "* A \\G'MIC item that is not a filename nor a special input string designates a 'command' ""most of the time. Generally, commands perform image processing operations on one or several available images ""of the list."\n"* Reccurent commands have two equivalent names ('regular' and 'short'). For instance, command names ""'resize' and 'r' refer to the same image resizing action."\n"* A G'MIC command may have mandatory or optional __arguments__. Command arguments must be specified ""in the next item on the command line. Commas ',' are used to separate multiple arguments of a single command, ""when required."\n"* The execution of a G'MIC command may be restricted only to a __subset__ of the image list, by ""appending '[selection]' to the command name. Examples of valid syntaxes for 'selection' are: "\n" - 'command[-2]': Apply command only on the penultimate image '[-2]' of the list."\n" - 'command[0,1,3]': Apply command only on images '[0]', '[1]' and '[3]'."\n" - 'command[3-6]': Apply command only on images '[3]' to '[6]' (i.e, '[3]', '[4]', '[5]' and '[6]')."\n" - 'command[50%-100%]': Apply command only on the second half of the image list."\n" - 'command[0,-4--1]': Apply command only on the first image and the last four images."\n" - 'command[0-9:3]': Apply command only on images '[0]' to '[9]', with a step of 3 ""(i.e. on images '[0]', '[3]', '[6]' and '[9]')."\n" - 'command[0--1:2]': Apply command only on images of the list with even indices. "\n" - 'command[0,2-4,50%--1]': Apply command on images '[0]', '[2]', '[3]', '[4]' and on the second half of ""the image list."\n" - 'command[^0,1]': Apply command on all images except the first two."\n" - 'command[name1,name2]': Apply command on named images 'name1' and 'name2'."\n\n"* Indices in selections are always sorted in increasing order, and duplicate indices are ""discarded. For instance, selections '[3-1,1-3]' and '[1,1,1,3,2]' are both equivalent to ""'[1-3]'. If you want to repeat a single command multiple times on an image, use a ""'repeat..done' loop instead. Inverting the order of images for a command is achieved by ""explicitly inverting the order of the images in the list, with command 'reverse[selection]'."\n"* Command selections '[-1]', '[-2]' and '[-3]' are so often used they have their own shortcuts, respectively ""'.', '..' and '...'. For instance, command 'blur..' is equivalent to 'blur[-2]'. ""These shortcuts work also when specifying command arguments."\n"* G'MIC commands invoked without '[selection]' are applied on all images of the list, i.e. the ""default selection is '[0--1]' (except for command ''input'' whose default selection is '[-1]'')."\n"* Prepending a single hyphen '-' to a G'MIC command is allowed. This may be useful to recognize ""command items more easily in a one-liner pipeline (typically invoked from a shell). "\n"* A G'MIC command prepended with a plus sign '+' does not act __in-place__ but inserts its result as one or ""several new images at the end of the image list."\n"* There are two different types of commands that can be run by the G'MIC interpreter:"\n" - __Built-in commands__ are the hard-coded functionalities in the interpreter core. They are thus compiled as ""binary code and run fast, most of the time. Omitting an argument when invoking a built-in command is not permitted, ""except if all following arguments are also omitted. ""For instance, invoking 'plasma 10,,5' is invalid but 'plasma 10' is correct. "\n" - __Custom commands__, are defined as G'MIC pipelines of built-in or other custom commands. ""They are parsed by the G'MIC interpreter, and thus run a bit slower than built-in commands. ""Omitting arguments when invoking a custom command is permitted. For instance, expressions ""`flower ,,,100,,2` or `flower ,` are correct. "\n\n"* Most of the existing commands in G'MIC are actually defined as __custom commands__. "\n"* A user can easily add its own custom commands to the G'MIC interpreter (see section "" ''Adding Custom Commands'' for more details). New built-in commands cannot be added (unless you modify the ""G'MIC interpreter source code and recompile it)." +_section "Input/Output Properties" +_text "* \\G'MIC is able to read/write most of the classical image file formats, including:"\n" - 2D grayscale/color files: `.png`, `.jpeg`, `.gif`, `.pnm`, `.tif`, `.bmp`, ..."\n" - 3D volumetric files: `.dcm`, `.hdr`, `.nii`, `.cube`, `.pan`, `.inr`, `.pnk`, ..."\n" - Video files: `.mpeg`, `.avi`, `.mp4`, `.mov`, `.ogg`, `.flv`, ..."\n" - Generic text or binary data files: `.gmz`, `.cimg`, `.cimgz`, `flo`, `ggr`, `gpl`, `.dlm`, `.asc`, ""`.pfm`, `.raw`, `.txt`, `.h`."\n" - 3D mesh files: `.off`, `.obj`."\n\n"* When dealing with color images, G'MIC generally reads, writes and displays data using the usual ""sRGB color space."\n"* When loading a `.png` and `.tiff` file, the bit-depth of the input image(s) is returned to the status."\n"* G'MIC is able to manage __3D mesh objects__ that may be read from files or generated by G'MIC commands. ""A 3D object is stored as a one-column scalar image containing the object data, in the ""following order: { magic_number; sizes; vertices; primitives; colors; opacities }. ""These 3D representations can be then processed as regular images (see command ''split3d'' for accessing ""each of these 3D object data separately)."\n"* Be aware that usual file formats may be sometimes not adapted to store all the available image ""data, since G'MIC uses float-valued image buffers. For instance, saving an image that was ""initially loaded as a 16bits/channel image, as a `.jpg` file will result in a loss of ""information. Use the G'MIC-specific file extension `.gmz` to ensure that all data ""precision is preserved when saving images."\n"* Sometimes, file options may/must be set for file formats:"\n" - __Video files:__ Only sub-frames of an image sequence may be loaded, using the input expression ""'filename.ext,[first_frame[,last_frame[,step]]]'. Set 'last_frame==-1' to tell it must be ""the last frame of the video. Set 'step' to '0' to force an opened video file to be ""opened/closed. Output framerate and codec can be also set by using the output expression ""'filename.avi,_fps,_codec,_keep_open' where 'keep_open' can be { 0 | 1 }. 'codec' is a 4-char string ""(see ) or '0' for the default codec. 'keep_open' ""tells if the output video file must be kept open for appending new frames afterwards."\n" - `.cimg[z]` __files:__ Only crops and sub-images of .cimg files can be loaded, using the input ""expressions 'filename.cimg,N0,N1', 'filename.cimg,N0,N1,x0,x1', ""'filename.cimg,N0,N1,x0,y0,x1,y1', 'filename.cimg,N0,N1,x0,y0,z0,x1,y1,z1' or ""'filename.cimg,N0,N1,x0,y0,z0,c0,x1,y1,z1,c1'. ""Specifying '-1' for one coordinates stands for the maximum possible value. Output expression ""'filename.cimg[z][,datatype]' can be used to force the output pixel type. 'datatype' can be ""{ auto | bool | uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }. "\n" - `.raw` __binary files:__ Image dimensions and input pixel type may be specified when loading `.raw` ""files with input expression 'filename.raw[,datatype][,width][,height[,depth[,dim[,offset]]]]]'. If no dimensions are ""specified, the resulting image is a one-column vector with maximum possible height. Pixel ""type can also be specified with the output expression 'filename.raw[,datatype]'. ""'datatype' can be the same as for `.cimg[z]` files. "\n" - `.yuv` __files:__ Image dimensions must be specified when loading, and only sub-frames of an image ""sequence may be loaded, using the input expression ""'filename.yuv,width,height[,chroma_subsampling[,first_frame[,last_frame[,step]]]'. ""'chroma_subsampling' can be { 420 | 422 | 444 }. ""When saving, chroma subsampling mode can be specified with output expression ""'filename.yuv[,chroma_subsampling]'. "\n" - `.tiff` __files:__ Only sub-images of multi-pages tiff files can be loaded, using the input ""expression 'filename.tif,_first_frame,_last_frame,_step'. ""Output expression 'filename.tiff,_datatype,_compression,_force_multipage,_use_bigtiff' can be used ""to specify the output pixel type, as well as the compression method. ""'datatype' can be the same as for `.cimg[z]` files. 'compression' can be "" { none (default) | lzw | jpeg }. 'force_multipage' can be { 0:no (default) | 1:yes }. ""'use_bigtiff' can be { 0:no | 1:yes (default) }."\n" - `.pdf` __files:__ When loading a file, the rendering resolution can be specified using the input expression ""'filename.pdf,resolution', where 'resolution' is an unsigned integer value."\n" - `.gif` __files:__ Animated gif files can be saved, using the input expression ""'filename.gif,fps>0,nb_loops'. Specify 'nb_loops=0' to get an infinite number of animation ""loops (this is the default behavior)."\n" - `.jpeg` __files:__ The output quality may be specified (in %), using the output expression ""'filename.jpg,30' (here, to get a 30% quality output). '100' is the default."\n" - `.mnc` __files:__ The output header can set from another file, using the output expression ""'filename.mnc,header_template.mnc'. "\n" - `.pan`, `.cpp`, `.hpp`, `.c` and `.h` __files:__ The output datatype can be selected with output expression ""'filename[,datatype]'. 'datatype' can be the same as for `.cimg[z]` files."\n" - `.gmic` __files:__ These filenames are assumed to be G'MIC custom commands files. Loading such a ""file will add the commands it defines to the interpreter. Debug information can be ""enabled/disabled by the input expression 'filename.gmic[,add_debug_info]' where 'debug_info' can be ""{ 0:false | 1:true }. "\n" - Inserting 'ext:' on the beginning of a filename (e.g. 'jpg:filename') forces G'MIC to ""read/write the file as it would have been done if it had the specified extension `.ext`."\n\n"* Some input/output formats and options may not be supported, depending on the configuration ""flags that have been set during the build of the G'MIC software." +_section "Substitution Rules" +_text "* \\G'MIC items containing '$' or '{}' are substituted before being interpreted. Use these ""substituting expressions to access various data from the interpreter environment."\n"* '$name' and '${name}' are both substituted by the value of the specified named variable ""(set previously by the item 'name=value'). If this variable has not been already set, the ""expression is substituted by the highest positive index of the named image '[name]'. If no ""image has this name, the expression is substituted by the value of the OS environment variable ""with same name (it may be thus an empty string if it is not defined). "\n"* The following reserved variables are predefined by the G'MIC interpreter: "\n" - '$!': The current number of images in the list."\n" - '$>' and '$<': The increasing/decreasing index of the latest (currently running) ""'repeat...done' loop. '$>' goes from `0` (first loop iteration) to `nb_iterations - 1` (last iteration). ""'$<' does the opposite. "\n" - '$/': The current call stack. Stack items are separated by slashes '/'."\n" - '$|': The current value (expressed in seconds) of a millisecond precision timer."\n" - '$^': The current verbosity level."\n" - '$_cpus': The number of computation cores available on your machine."\n" - '$_flags': The list of enabled flags when G'MIC interpreter has been compiled."\n" - '$_host': A string telling about the host running the G'MIC interpreter (e.g. `cli` or `gimp`)."\n" - '$_os': A string describing the running operating system."\n" - '$_path_rc': The path to the G'MIC folder used to store configuration files (its value is OS-dependent)."\n" - '$_path_user': The path to the G'MIC user file `.gmic` or `user.gmic` (its value is OS-dependent)."\n" - '$_path_commands': A list of all imported command files (stored as an image list)."\n" - '$_pid': The current process identifier, as an integer."\n" - '$_pixeltype': The type of image pixels (default: 'float32')."\n" - '$_prerelease': For pre-releases, the date of the pre-release as `yymmdd`. ""For stable releases, this variable is set to `0`."\n" - '$_version': A 3-digits number telling about the current version of the G'MIC interpreter "" (e.g. '"$_version"'). "\n" - '$_vt100': Set to `1` if colored text output is allowed on the console. Otherwise, set to `0`."\n\n"* '$$name' and '$${name}' are both substituted by the G'MIC script code of the specified named ""`custom command`, or by an empty string if no custom command with specified name exists. "\n"* '${\"-pipeline\"}' is substituted by the __status value__ after the execution of the specified ""G'MIC pipeline (see command ''status''). Expression '${}' thus stands for the current status value."\n"* '{``string}' (starting with two backquotes) is substituted by a double-quoted version of the specified string."\n"* '{/string}' is substituted by the escaped version of the specified string."\n"* '{\\'string\\'[:delimiter]}' (between single quotes) is substituted by the sequence of character codes ""that composes the specified string, separated by specified delimiter. Possible delimiters are ""',' (default), ';', '/', '^' or ' '. For instance, item '{'foo'}' is substituted by '102,111,111' and ""'{'foo':;}' by '102;111;111'."\n"* '{image,feature[:delimiter]}' is substituted by a specific feature of the image '[image]'. ""'image' can be either an image number or an image name. It can be also eluded, in which case, ""the last image '[-1]' of the list is considered for the requested feature. ""Specified 'feature' can be one of:"\n" - 'b': The image basename (i.e. filename without the folder path nor extension)."\n" - 'f': The image folder name."\n" - 'n': The image name or filename (if the image has been read from a file)."\n" - 't': The text string from the image values regarded as character codes."\n" - 'x': The image extension (i.e the characters after the last `.` in the image name)."\n" - '^': The sequence of all image values, separated by commas `,`."\n" - '@subset': The sequence of image values corresponding to the specified subset, and separated by commas `,`. "\n" - Any other 'feature' is considered as a __mathematical expression__ associated to the image '[image]' and is ""substituted by the result of its evaluation (float value). For instance, expression '{0,w+h}' is substituted by ""the sum of the width and height of the first image (see section ''Mathematical Expressions'' for more details). ""If a mathematical expression starts with an underscore `_`, the resulting value is truncated to a readable format. ""For instance, item '{_pi}' is substituted by '3.14159' (while '{pi}' is substituted by '3.141592653589793')."\n" - A 'feature' delimited by backquotes is replaced by a string whose character codes correspond to the list of ""values resulting from the evaluation of the specified mathematical expression. For instance, item ""'{`[102,111,111]`}' is substituted by 'foo' and item '{`vector8(65)`}' by 'AAAAAAAA'."\n\n"* '{*}' is substituted by the visibility state of the instant display window '#0' ""(can be { 0:closed | 1:visible }."\n"* '{*[index],feature1,...,featureN[:delimiter]}' is substituted by a specific set of features of the instant display ""window '#0' (or '#index', if specified). Requested 'features' can be:"\n" - 'u': screen width (actually independent on the window size)."\n" - 'v': screen height (actually independent on the window size)."\n" - 'uv': screen width x screen height."\n" - 'd': window width (i.e. width of the window widget)."\n" - 'e': window height (i.e. height of the window widget)."\n" - 'de': window width x window height."\n" - 'w': display width (i.e. width of the display area managed by the window)."\n" - 'h': display height (i.e. height of the display area managed by the window)."\n" - 'wh': display width x display height."\n" - 'i': X-coordinate of the display window."\n" - 'j': Y-coordinate of the display window."\n" - 'f': current fullscreen state of the instant display."\n" - 'n': current normalization type of the instant display."\n" - 't': window title of the instant display."\n" - 'x': X-coordinate of the mouse position (or -1, if outside the display area)."\n" - 'y': Y-coordinate of the mouse position (or -1, if outside the display area)."\n" - 'b': state of the mouse buttons { 1:left-but. | 2:right-but. | 4:middle-but. }."\n" - 'o': state of the mouse wheel."\n" - 'k': decimal code of the pressed key if any, 0 otherwise."\n" - 'c': boolean (0 or 1) telling if the instant display has been closed recently."\n" - 'r': boolean telling if the instant display has been resized recently."\n" - 'm': boolean telling if the instant display has been moved recently."\n" - Any other 'feature' stands for a keycode name (in capital letters), and is substituted ""by a boolean describing the current key state { 0:pressed | 1:released }."\n" - You can also prepend a hyphen '-' to a 'feature' (that supports it) to flush the ""corresponding event immediately after reading its state (works for keys, mouse and window events)."\n\n"* Item substitution is __never__ performed in items between double quotes. One must break the quotes ""to enable substitution if needed, as in '\"3+8 kg = \"{3+8}\" kg\"'. Using double quotes is then ""a convenient way to disable the substitutions mechanism in items, when necessary."\n"* One can also disable the substitution mechanism on items outside double quotes, by escaping the ""`{`, `}` or `$` characters, as in `\\{3+4\\}\\ doesn\47t\\ evaluate`." +_section "Mathematical Expressions" +_text "* \\G'MIC has an embedded __mathematical parser__, used to evaluate (possibly complex) math expressions ""specified inside braces '{}', or formulas in commands that may take one as an argument (e.g. ''fill'' or ''eval'')."\n"* When the context allows it, a formula is evaluated __for each pixel__ of the selected images ""(e.g. ''fill'' or ''eval'')."\n"* A math expression may return a __scalar__ or a __vector-valued__ result (with a fixed number of components)."\n"The mathematical parser understands the following set of functions, operators and variables:"\n"## Usual math operators:"\n"'||' (logical or), '&&' (logical and), '|' (bitwise or), '&' (bitwise and), ""'!=', '==', '<=', '>=', '<', '>', '<<' (left bitwise shift), '>>' (right bitwise shift), '-', '+', '*', '/', ""'%' (modulo), '^' (power), '!' (logical not), '~' (bitwise not), '++', '--', '+=', '-=', '*=', '/=', '%=', ""'&=', '|=', '^=', '>>', '<<=' (in-place operators)."\n"## Usual math functions:"\n"'abs()', 'acos()', 'acosh()', 'arg()', 'arg0()', 'argkth()', 'argmax()', 'argmaxabs()', ""'argmin()', 'argminabs()', 'asin()', 'asinh()', 'atan()', 'atan2()', 'atanh()', 'avg()', 'bool()', 'cbrt()', ""'ceil()', 'cos()', 'cosh()', 'cut()', 'deg2rad()', 'erf()', 'erfinv()', 'exp()', 'fact()', 'fibo()', 'floor()', ""'gamma()', 'gauss()', 'gcd()', 'hypot()', 'int()', 'isconst()', 'isnan()', 'isnum()', 'isinf()', 'isint()', ""'isbool()', 'isexpr()', 'isfile()', 'isdir()', 'isin()', 'kth()', 'log()', 'log2()', 'log10()', 'max()', 'maxabs()', ""'med()', 'min()', 'minabs()', 'narg()', 'prod()', 'rad2deg()', 'rol()' (left bit rotation), 'ror()' ""(right bit rotation), 'round()', 'sign()', 'sin()', 'sinc()', 'sinh()', 'sqrt()', 'std()', 'srand(_seed)', 'sum()', ""'tan()', 'tanh()', 'var()', 'xor()'."\n\n"* 'cov(A,B,_avgA,_avgB)' estimates the covariance between vectors 'A' and 'B' (estimated averages of these vectors ""may be specified as arguments)."\n"* 'mse(A,B)' returns the mean-squared error between vectors 'A' and 'B'."\n"* 'atan2(y,x)' is the version of 'atan()' with two arguments 'y' and 'x' (as in C/C++)."\n"* 'permut(k,n,with_order)' computes the number of permutations of 'k' objects from a set of 'n' objects."\n"* 'gauss(x,_sigma,_is_normalized)' returns `exp(-x^2/(2*s^2))/(is_normalized?sqrt(2*pi*sigma^2):1)`."\n"* 'cut(value,min,max)' returns 'value' if it is in range '[min,max]', or 'min' or 'max' otherwise."\n"* 'narg(a_1,...,a_N)' returns the number of specified arguments (here, 'N')."\n"* 'arg(i,a_1,..,a_N)' returns the `i`-th argument 'a_i'."\n"* 'isnum()', 'isnan()', 'isinf()', 'isint()', 'isbool()' test the type of the given number or expression, ""and return '0' (false) or '1' (true)."\n"* 'isfile(\\'path\\')' (resp. 'isdir('path')') returns '0' (false) or '1' (true) whether its string argument is a ""path to an existing file (resp. to a directory) or not."\n"* 'ispercentage(arg)' returns `1` (true) or `0` (false) whether 'arg' ends with a '%' or not."\n"* 'isvarname(\\'str\\')' returns '0' (false) or '1' (true) whether its string argument would be a valid to name ""a variable or not."\n"* 'isin(v,a_1,...,a_n)' returns '0' (false) or '1' (true) whether the first argument 'v' appears in the set of other ""argument 'a_i'."\n"* 'inrange(value,m,M,include_m,include_M)' returns '0' (false) or '1' (true) whether the specified value lies in ""range '[m,M]' or not ('include_m' and 'includeM' tells how boundaries 'm' and 'M' are considered)."\n"* 'argkth()', 'argmin()', 'argmax()', 'argminabs()', 'argmaxabs()'', 'avg()', 'kth()', 'min()', 'max()', 'minabs()', ""'maxabs()', 'med()', 'prod()', 'std()', 'sum()' and 'var()' can be called with an arbitrary number of scalar/vector ""arguments."\n"* 'vargkth()', 'vargmin()', 'vargmax()', 'vargminabs()', 'vargmaxabs()', 'vavg()', 'vkth()', 'vmin()', ""'vmax()', 'vminabs()', 'vmaxabs()', 'vmed()', 'vprod()', 'vstd()', 'vsum()' and 'vvar()' are the versions of the ""previous function with vector-valued arguments."\n"* 'round(value,rounding_value,direction)' returns a rounded value. 'direction' can be ""{ -1:to-lowest | 0:to-nearest | 1:to-highest }."\n"* 'lerp(a,b,t)' returns 'a*(1-t)+b*t'."\n"* 'swap(a,b)' swaps the values of the given arguments."\n"## Variable names:"\n"Variable names below are pre-defined. They can be overridden."\n"* 'l': length of the associated list of images."\n"* 'k': index of the associated image, in '[0,l-1]'."\n"* 'w': width of the associated image, if any ('0' otherwise)."\n"* 'h': height of the associated image, if any ('0' otherwise)."\n"* 'd': depth of the associated image, if any ('0' otherwise)."\n"* 's': spectrum of the associated image, if any ('0' otherwise)."\n"* 'r': shared state of the associated image, if any ('0' otherwise)."\n"* 'wh': shortcut for width x height."\n"* 'whd': shortcut for width x height x depth."\n"* 'whds': shortcut for width x height x depth x spectrum (i.e. number of image values)."\n"* 'im', 'iM', 'ia', 'iv', 'id', 'is', 'ip', 'ic', 'in': Respectively the minimum, maximum, average, variance, ""standard deviation, sum, product, median value and L2-norm of the associated image, if any ('0' otherwise)."\n"* 'xm', 'ym', 'zm', 'cm': The pixel coordinates of the minimum value in the associated image, ""if any ('0' otherwise)."\n"* 'xM', 'yM', 'zM', 'cM': The pixel coordinates of the maximum value in the associated image, ""if any ('0' otherwise)."\n"* All these variables are considered as __constant values__ by the math parser (for optimization purposes) ""which is indeed the case most of the time. Anyway, this might not be the case, if function 'resize(#ind,..)' ""is used in the math expression. If so, it is safer to invoke functions 'l()', 'w(_#ind)', 'h(_#ind)', ... 's(_#ind)' ""and 'in(_#ind)' instead of the corresponding named variables."\n"* 'i': current processed pixel value (i.e. value located at `(x,y,z,c)`) in the associated image, ""if any ('0' otherwise)."\n"* 'iN': N-th channel value of current processed pixel (i.e. value located at `(x,y,z,N)` in the associated image, ""if any ('0' otherwise). 'N' must be an integer in range '[0,9]'."\n"* 'R', 'G', 'B' and 'A' are equivalent to 'i0', 'i1', 'i2' and 'i3' respectively."\n"* 'I': current vector-valued processed pixel in the associated image, if any ('0' otherwise). ""The number of vector components is equal to the number of image channels (e.g. 'I' = `[ R,G,B ]` for a ""`RGB` image)."\n"* You may add '#ind' to any of the variable name above to retrieve the information for any ""numbered image '[ind]' of the list (when this makes sense). For instance 'ia#0' denotes the average value of the ""first image of the list)."\n"* 'x': current processed column of the associated image, if any ('0' otherwise)."\n"* 'y': current processed row of the associated image, if any ('0' otherwise)."\n"* 'z': current processed slice of the associated image, if any ('0' otherwise)."\n"* 'c': current processed channel of the associated image, if any ('0' otherwise)."\n"* 't': thread id when an expression is evaluated with multiple threads ('0' means __master thread__)."\n"* 'n': maximum number of threads when expression is evaluated in parallel (so that 't' goes from '0' to 'n-1')."\n"* 'e': value of e, i.e. `2.71828...`."\n"* 'pi': value of pi, i.e. `3.1415926...`."\n"* 'u': a random value between '[0,1]', following a uniform distribution."\n"* 'v': a random value between '[-1,1]', following a uniform distribution."\n"* 'g': a random value, following a gaussian distribution of variance 1 (roughly in '[-6,6]')."\n"* 'interpolation': value of the default interpolation mode used when reading pixel values with the pixel access ""operators (i.e. when the interpolation argument is not explicitly specified, see below for more details on pixel ""access operators). Its initial default value is '0'."\n"* 'boundary': value of the default boundary conditions used when reading pixel values with the pixel access ""operators (i.e. when the boundary condition argument is not explicitly specified, see below for more details ""on pixel access operators). Its initial default value is '0'."\n"* The last image of the list is always associated to the evaluations of 'expressions', e.g. G'MIC sequence ""\n~~~\n256,128 fill {w}\n~~~\n will create a 256x128 image filled with value 256."\n"## Vector calculus:"\n"Most operators are also able to work with vector-valued elements."\n"* '[a0,a1,...,aN-1]' defines a 'N'-dimensional vector with scalar coefficients 'ak'."\n"* 'vectorN(a0,a1,,...,aN-1)' does the same, with the 'ak' being repeated periodically if only a few are specified."\n"* 'vector(#N,a0,a1,,...,aN-1)' does the same, and can be used for any constant expression 'N'."\n"* In previous expressions, the 'ak' can be vectors themselves, to be concatenated into a single vector."\n"* The scalar element 'ak' of a vector 'X' is retrieved by 'X[k]'."\n"* The sub-vector '[X[p],X[p+s]...X[p+s*(q-1)]]' (of size 'q') of a vector 'X' is retrieved by 'X[p,q,s]'."\n"* 'expr(formula,_w,_h,_d,_s)' outputs a vector of size 'w*h*d*s' with values generated from ""the specified formula, as if one were filling an image with dimensions '(w,h,d,s)'."\n"* Equality/inequality comparisons between two vectors is done with operators '==' and '!='."\n"* Some vector-specific functions can be used on vector values: ""'cross(X,Y)' (cross product), 'dot(X,Y)' (dot product), 'size(X)' (vector dimension), ""'sort(X,_is_increasing,_nb_elts,_size_elt)' (sorted values), 'reverse(A)' (reverse order of components), ""'map(X,P,_nb_channelsX,_nb_channelsP,_boundary_conditions)', ""'shift(A,_length,_boundary_conditions)' and 'same(A,B,_nb_vals,_is_case_sensitive)' (vector equality test)."\n"* Function 'normP(u1,...,un)' computes the LP-norm of the specified vector ""('P' being a constant or 'inf', as in e.g. 'norm1()')."\n"* Function 'normp(V,_p)' computes the Lp-norm of the specified vector 'V'. Here, 'p' can be variable. ""Default value for 'p' is 2."\n"* Function 'unitnorm(V,_p)' returns a normalized version 'V/normp(V)' of specified vector 'V'. ""Default value for 'p' is 2."\n"* Function 'resize(A,size,_interpolation,_boundary_conditions)' returns a resized version of a vector 'A' with ""specified interpolation mode. 'interpolation' can be ""{ -1:none (memory content) | 0:none | 1:nearest | 2:average | 3:linear | 4:grid | 5:bicubic | 6:lanczos }, and ""'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }."\n"* Function 'resize(A,ow,oh,od,os,nw,_nh,_nd,_ns,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac)' is an ""extended version of the previous function. It allows to resize the vector 'A', seen as an image of size ""'ow x oh x od x os' as a new image of size 'nw x nh x nd x ns', with specified resizing options."\n"* Function 'find(A,B,_starting_index,_search_step)' returns the index where sub-vector 'B' appears in vector 'A', ""(or '-1' if 'B' is not contained in 'A'). Argument 'A' can be also replaced by an image index '#ind'."\n"* A `2`-dimensional vector may be seen as a complex number and used in those particular functions/operators: ""'**' (complex multiplication), '//' (complex division), '^^' (complex exponentiation), ""'**=' (complex self-multiplication), '//=' (complex self-division), '^^=' (complex self-exponentiation), ""'cabs()' (complex modulus), 'carg()' (complex argument), 'cconj()' (complex conjugate), ""'cexp()' (complex exponential), 'clog()' (complex logarithm), 'ccos()' (complex cosine), ""'csin()' (complex sine), 'csqrt()' (complex square root), 'ctan()' (complex tangent), 'ccosh()' ""(complex hyperpolic cosine), 'csinh()' (complex hyperbolic sine) and 'ctanh()' (complex hyperbolic tangent)."\n"* A `MN`-dimensional vector may be seen as a `M` x `N` matrix and used in those particular functions/operators: ""'*' (matrix-vector multiplication), 'det(A)' (determinant), 'diag(V)' (diagonal matrix from a vector), ""'eig(A)' (eigenvalues/eigenvectors), 'eye(n)' (n x n identity matrix), 'invert(A,_nb_colsA,_use_LU,_lambda)' ""(matrix inverse), 'mul(A,B,_nb_colsB)' (matrix-matrix multiplication), ""'rot(u,v,w,angle)' (3D rotation matrix), 'rot(angle)' (2D rotation matrix), ""'solve(A,B,_nb_colsB,_use_LU)' (solver of linear system A.X = B), 'svd(A,_nb_colsA)' (singular value decomposition), ""'trace(A)' (matrix trace) and 'transpose(A,nb_colsA)' (matrix transpose). Argument 'nb_colsB' may be omitted if ""it is equal to `1`".\n"* 'mproj(S,nb_colsS,D,nb_colsD,method,max_iter,max_residual)' projects a matrix 'S' onto a dictionary (matrix) ""'D'. Equivalent to command ''mproj'' but inside the math evaluator."\n"* Specifying a vector-valued math expression as an argument of a command that operates on image values ""(e.g. 'fill') modifies the whole spectrum range of the processed image(s), for each spatial coordinates `(x,y,z)`. ""The command does not loop over the `c`-axis in this case."\n"## String manipulation:"\n"Character strings are defined and managed as vectors objects. ""Dedicated functions and initializers to manage strings are:"\n"* `['string']` and `'string'` define a vector whose values are the character codes of the ""specified `character string` (e.g. `'foo'` is equal to `[ 102,111,111 ]`)."\n"* `_'character'` returns the (scalar) byte code of the specified character (e.g. `_'A'` is equal to '65')."\n"* A special case happens for __empty__ strings: Values of both expressions `['']` and `''` are '0'."\n"* Functions 'lowercase()' and 'uppercase()' return string with all string characters lowercased or uppercased."\n"* Function 's2v(str,_starting_index,_is_strict)' parses specified string 'str' and returns the value contained ""in it."\n"* Function 'v2s(expr,_nb_digits,_siz)' returns a vector of size 'siz' which contains the character representation ""of values described by expression 'expr'. ""'nb_digits' can be { <-1:0-padding of integers | -1:auto-reduced | 0:all | >0:max number of digits }."\n"* Function 'echo(str1,str2,...,strN)' prints the concatenation of given string arguments on the console."\n"* Function 'string(_#siz,str1,str2,...,strN)' generates a vector corresponding to the concatenation of given ""string/number arguments."\n"## Dynamic arrays:"\n"A dynamic array is defined as a one-column (or empty) image '[ind]' in the image list. ""It allows elements to be added or removed, each element having the same dimension ""(which is actually the number of channels of image '[ind]'). ""Dynamic arrays adapt their size to the number of elements they contain."\n\n"A dynamic array can be manipulated in a math expression, with the following functions:"\n"* 'da_size(_#ind)': Return the number of elements in dynamic array '[ind]'."\n"* 'da_back(_#ind)': Return the last element of the dynamic array '[ind]'."\n"* 'da_insert(_#ind,pos,elt_1,_elt_2,...,_elt_N)': Insert 'N' new elements 'elt_k' starting from index 'pos' ""in dynamic array '[ind]'."\n"* 'da_push(_#ind,elt1,_elt2,...,_eltN)': Insert 'N' new elements 'elt_k' at the end of dynamic array '[ind]'."\n"* 'da_pop(_#ind)': Same as 'da_back()' but also remove last element from the dynamic array '[ind]'."\n"* 'da_push_heap(_#ind,elt1,_elt2,...,_eltN)' and 'da_pop_heap(_#ind)' does the same but for a dynamic array viewed ""as a min-heap structure."\n"* 'da_remove(_#ind,_start,_end)': Remove elements located between indices 'start' and 'end' (included) ""in dynamic array '[ind]'."\n"* 'da_freeze(_#ind)': Convert a dynamic array into a 1-column image with height 'da_size(#ind)'."\n"* The value of the k-th element of dynamic array '[ind]' is retrieved with 'i[_#ind,k]' (if the element is a ""scalar value), or 'I[_#ind,k]' (if the element is a vector)."\n\n"In the functions above, argument '#ind' may be omitted in which case it is assumed to be '#-1'."\n"## Special operators:"\n"* ';': expression separator. The returned value is always the last encountered expression. ""For instance expression '1;2;pi' is evaluated as 'pi'."\n"* '=': variable assignment. Variables in mathematical parser can only refer to numerical ""values (vectors or scalars). Variable names are case-sensitive. Use this operator in conjunction with ';' to define ""more complex evaluable expressions, such as \n~~~\nt = cos(x); 3*t^2 + 2*t + 1\n~~~\n""These variables remain __local__ to the mathematical parser and cannot be accessed outside the evaluated ""expression."\n"* Variables defined in math parser may have a __constant__ property, by specifying keyword 'const' before the ""variable name (e.g. 'const foo = pi/4;'). The value set to such a variable must be indeed a __constant scalar__. ""Constant variables allows certain types of optimizations in the math JIT compiler."\n"## Specific functions:"\n"* 'addr(expr)': return the pointer address to the specified expression 'expr'. "\n"* 'o2c(_#ind,offset)' and 'c2o(_#ind,x,_y,_z,_c)': Convert image offset to image coordinates and vice-versa. "\n"* 'fill(target,expr)' or 'fill(target,index_name,expr)' fill the content of the specified target ""(often vector-valued) using a given expression, e.g. `V = vector16(); fill(V,k,k^2 + k + 1);`. ""For a vector-valued target, it is basically equivalent to: ""`for (index_name = 0, index_name=0' (e.g., '46368' for 'N=24'). 'do(expression,condition)' always evaluates the specified ""expression at least once, then check for the loop condition. When done, it returns the last value of 'expression'."\n"* 'for(init,condition,_procedure,body)' first evaluates the expression 'init', then iteratively evaluates 'body' ""(followed by 'procedure' if specified) while 'condition' holds (i.e. not zero). It may happen that no iterations are ""done, in which case the function returns 'nan'. Otherwise, it returns the last value of 'body'. ""For instance, the expression: \n~~~\nif(N<2,N,for(n=N;F0=0;F1=1,n=n-1,F2=F0+F1;F0=F1;F1=F2))\n~~~\n ""returns the 'N'-th value of the Fibonacci sequence, for 'N>=0' (e.g., '46368' for 'N=24')."\n"* 'while(condition,expression)' is exactly the same as 'for(init,condition,expression)' without the specification of ""an initializing expression."\n"* 'repeat(nb_iters,expr)' or 'fill(nb_iters,iter_name,expr)' run 'nb_iters' iterations of the specified expression ""'expr', e.g. `V = vector16(); repeat(16,k,V[k] = k^2 + k + 1);`. ""It is basically equivalent to: ""`for (iter_name = 0, iter_namebegin(foo = 0); ++foo\"')."\n"* 'copy(dest,src,_nb_elts,_inc_d,_inc_s,_opacity)' copies an entire memory block of 'nb_elts' elements starting ""from a source value 'src' to a specified destination 'dest', with increments defined by 'inc_d' and 'inc_s' ""respectively for the destination and source pointers."\n"* 'stats(_#ind)' returns the statistics vector of the running image '[ind]', i.e the vector ""`[ im,iM,ia,iv,xm,ym,zm,cm,xM,yM,zM,cM,is,ip ]` (14 values)."\n"* 'ref(expr,a)' references specified expression 'expr' as variable name 'a'."\n"* 'unref(a,b,...)' destroys references to the named variable given as arguments."\n"* 'breakpoint()' inserts a possible computation breakpoint (useless with the cli interface)."\n"* '_(comment) expr' just returns expression 'expr' (useful for inserting inline comments in math expressions)."\n"* 'run('pipeline')' executes the specified G'MIC pipeline as if it was called outside the currently evaluated ""expression."\n"* 'set(\\'variable_name\\',A)' set the G'MIC variable '$variable_name' with the value of expression 'A'. If 'A' is"" a vector-valued variable, it is assumed to encode a string."\n"* 'store(\\'variable_name\\',A,_w,_h,_d,_s,_is_compressed)' transfers the data of vector 'A' as a ""`w x h x d x s` image to the G'MIC variable '$variable_name'. Thus, the data becomes available outside the math ""expression (that is equivalent to using the regular command ''store'', but directly in the math expression)."\n"* 'get(\\'variable_name\\',_size,_return_as_string)' returns the value of the specified variable, as a vector of ""'size' values, or as a scalar (if 'size' is zero or not specified)."\n"* 'name(_#ind,size)' returns a vector of size 'size', whose values are the characters codes of the name of image ""'[ind]' (or default image selected if 'ind' is not specified)."\n"* 'correlate(I,wI,hI,dI,sI,K,wK,hK,dK,sK,_boundary_conditions,_is_normalized,_channel_mode,_xcenter,_ycenter,""_zcenter,_xstart,_ystart,_zstart,_xend,_yend,_zend,_xstride,_ystride,_zstride,_xdilation,_ydilation,_zdilation,""_interpolation_type)' returns the correlation, unrolled as a vector, of the `wI x hI x dI x sI`-sized image 'I' ""with the `wK x hK x dK x sK`-sized kernel 'K' (the meaning of the other arguments are the same as in command ""'correlate'). Similar function 'convolve(...)' is also defined for computing the convolution between 'I' and 'K'."\n"## User-defined macros:"\n"* Custom macro functions can be defined in a math expression, using the assignment operator ""'=', e.g. \n~~~\nfoo(x,y) = cos(x + y); result = foo(1,2) + foo(2,3)\n~~~\n"\n"* Trying to override a built-in function (e.g. 'abs()') has no effect."\n"* Overloading macros with different number of arguments is possible. Re-defining a previously defined macro with ""the same number of arguments discards its previous definition."\n"* Macro functions are indeed processed as __macros__ by the mathematical evaluator. You should avoid invoking them ""with arguments that are themselves results of assignments or self-operations. ""For instance, \n~~~\nfoo(x) = x + x; z = 0; foo(++z)\n~~~\n returns '4' rather than expected value '2'."\n"* When substituted, macro arguments are placed inside parentheses, except if a number sign ""'#' is located just before or after the argument name. For instance, expression \n""~~~\nfoo(x,y) = x*y; foo(1+2,3)\n~~~\n ""returns '9' (being substituted as '(1+2)*(3)'), while expression \n~~~\nfoo(x,y) = x#*y#; foo(1+2,3)\n~~~\n ""returns '7' (being substituted as '1+2*3')."\n"* Number signs appearing between macro arguments function actually count for __empty__ separators. They may be used ""to force the substitution of macro arguments in unusual places, e.g. as in \n~~~\nstr(N) = ['I like N#'];\n~~~\n""* Macros with variadic arguments can be defined, by specifying a single argument name followed by `...`. ""For instance,\n~~~\nfoo(args...) = sum([ args ]^2);\n~~~\n ""defines a macro that returns the sum of its squared arguments, so `foo(1,2,3)` returns `14` and ""`foo(4,5)` returns `41`.\n""## Multi-threaded and in-place evaluation:"\n"* If your image data are large enough and you have several CPUs available, it is likely that the math expression ""passed to a 'fill', 'eval' or 'input' commands is evaluated in parallel, using multiple computation threads."\n"* Starting an expression with ':' or '*' forces the evaluations required for an image to be run in parallel, ""even if the amount of data to process is small (beware, it may be slower to evaluate in this case!). ""Specify ':' (rather than '*') to avoid possible image copy done before evaluating the expression ""(this saves memory, but do this only if you are sure this step is not required!)"\n"* Expression starting with '+' are evaluated in a single-threaded way, with possible image copy."\n"* If the specified expression starts with '>' or '<', the pixel access operators 'i()', 'i[]', 'j()' and 'j[]' ""return values of the image being currently modified, in forward ('>') or backward ('<') order. ""The multi-threading evaluation of the expression is disabled in this case."\n"* Function 'critical(expr)' forces the execution of the given expression in a single thread at a time."\n"* 'begin_t(expr)' and 'end_t(expr)' evaluates the specified expression once for each running thread ""(so possibly several times) at the beginning and the end of the evaluation procedure."\n"* 'merge(variable,operator)' tells to merge the local variable value computed by threads, with the specified ""operator, when all threads have finished computing."\n"* Expressions 'i(_#ind,x,_y,_z,_c)=value', 'j(_#ind,x,_y,_z,_c)=value', 'i[_#ind,offset]=value' and ""'j[_#ind,offset]=value' set a pixel value at a different location than the running one in the image '[ind]' ""(or in the associated image if argument '#ind' is omitted), either with global coordinates/offsets ""(with 'i(...)' and 'i[...]'), or relatively to the current position `(x,y,z,c)` (with 'j(...)' and 'j[...]'). ""These expressions always return 'value'." +_section "Adding Custom Commands" +_text "* New custom commands can be added by the user, through the use of \\G'MIC __custom commands files__."\n"* A command file is a simple text file, where each line starts either by ""\n~~~\ncommand_name: command_definition\n~~~\n or \n~~~\ncommand_definition (continuation)\n~~~\n"\n"* At startup, G'MIC automatically includes user's command file '$HOME/.gmic' (on __Unix__) or ""'%USERPROFILE%\\user.gmic' (on __Windows__). The CLI tool 'gmic' automatically runs the command ""'cli_start' if defined."\n"* Custom command names must use character set `[a-zA-Z0-9_]` and cannot start with a number."\n"* Any `# comment` expression found in a custom commands file is discarded by the G'MIC parser, ""wherever it is located in a line."\n"* In a custom command, the following '$-expressions' are recognized and substituted:"\n" - '$""\*' is substituted by a verbatim copy of the specified string of arguments ""(do not include arguments set to default values)."\n" - '$\"*\"' is substituted by the sequence of specified arguments, separated by commas ',', ""each being double-quoted (include arguments set to default values)."\n" - '$""#' is substituted by the maximum index of known arguments (either specified by the user or set to a default ""value in the custom command)."\n" - '$""[]' is substituted by the list of selected image indices that have been specified in the command ""invocation."\n" - '$""?' is substituted by a printable version of '$""[]' to be used in command descriptions."\n" - '$i' and '${i}' are both substituted by the `i`-th specified argument. Negative indices such as '${-j}' are ""allowed and refer to the `j`-th latest argument. '$""0' is substituted by the custom command name."\n" - '${i=default}' is substituted by the value of '$i' (if defined) or by its new value set to 'default' otherwise ""('default' may be a `$-expression` as well)."\n" - '${subset}' is substituted by the argument values (separated by commas ',') of a specified argument subset. ""For instance expression '$""{2--2}' is substituted by all specified command arguments except the first and the last ""one. Expression '$""{^0}' is then substituted by all arguments of the invoked command (eq. to '$""*' if all ""arguments have been indeed specified)."\n" - '$""=var' is substituted by the set of instructions that will assign each argument '$i' to the named variable ""'var$i' (for i in '[0...$""#]'. This is particularly useful when a custom command want to manage variable numbers ""of arguments. Variables names must use character set `[a-zA-Z0-9_]` and cannot start with a number."\n\n"* These particular `$-expressions` for custom commands are __always substituted__, even in ""double-quoted items or when the dollar sign '$' is escaped with a backslash '\\$'. To avoid substitution, place an ""empty double quoted string just after the '$' (as in '$\"\"1')."\n"* Specifying arguments may be skipped when invoking a custom command, by replacing them by commas ',' as in ""expression \n~~~\nflower ,,3\n~~~\n Omitted arguments are set to their default values, which must be thus explicitly ""defined in the code of the corresponding custom command (using default argument expressions as '$""{1=default}')."\n"* If one numbered argument required by a custom command misses a value, an error is thrown by the G'MIC ""interpreter."\n"* It is possible to specialize the invocation of a '+command' by defining it as ""\n~~~\n+command_name: command_definition\n~~~\n""* A +-specialization takes priority over the regular command definition when the command is invoked with a ""prepended '+'."\n"* When only a +-specialization of a command is defined, invoking 'command' is actually equivalent to '+command'." +_section "List of Commands" +_text "All available \\G'MIC commands are listed below, by categories. An argument specified between '[]' ""or starting by '_' is optional except when standing for an existing image '[image]', where 'image' ""can be either an index number or an image name. In this case, the '[]' characters are mandatory when writing the ""item. Note that all images that serve as illustrations in this reference documentation are normalized in ""range `[0,255]` before being displayed. You may need to do this explicitly (command `normalize 0,255`) if you want ""to save and view images with the same aspect than those illustrated in the example codes."\n"The examples accompanying this 'List of Commands' illustrate the use of the \\G'MIC language and are written as they ""would appear in a custom command. While some examples may work if entered directly at a shell prompt, there is no ""guarantee. No attempt has been made to escape special characters in these examples, which many shells reserve." +l { reference_list_of_commands_$1 onfail } +xfolder="$2" +if "['$1']=='html' && ['$2']==0" xfolder=$HOME/work/src/gmic-community/reference fi +if ['$xfolder']!=0 +files $xfolder/*.gmd files=${} +repeat narg({/$files}) { +arg0 $>,$files file=${} +l[] { it $file s={b} t={t} rm } +_section {/$s} +_text {/$t} +} +fi +_section "Examples of Use" +_text "`gmic` is a generic image processing tool which can be used in a wide variety of situations. ""The few examples below illustrate possible uses of this tool:"\n"### View a list of images: "\n"\n~~~\n$ gmic file1.bmp file2.jpeg\n~~~"\n\n"### Convert an image file: "\n"\n~~~\n$ gmic input.bmp output output.jpg\n~~~"\n\n"### Create a volumetric image from a movie sequence: "\n"\n~~~\n$ gmic input.mpg append z output output.hdr\n~~~"\n\n"### Compute image gradient norm: "\n"\n~~~\n$ gmic input.bmp gradient_norm\n~~~"\n\n"### Denoise a color image: "\n"\n~~~\n$ gmic image.jpg denoise 30,10 output denoised.jpg\n~~~"\n\n"### Compose two images using overlay layer blending: "\n"\n~~~\n$ gmic image1.jpg image2.jpg blend overlay output blended.jpg\n~~~"\n\n"### Evaluate a mathematical expression: "\n"\n~~~\n$ gmic echo \"cos(pi/4)^2+sin(pi/4)^2={cos(pi/4)^2+sin(pi/4)^2}\"\n~~~"\n\n"### Plot a 2D function: "\n"\n~~~\n$ gmic 1000,1,1,2 fill \"X=3*(x-500)/500;X^2*sin(3*X^2)+(!c?u(0,-1):cos(X*10))\" plot\n~~~"\n"===\n![2D Plot](../img/example_plot.png)\n==="\n\n"### Plot a 3D elevated function in random colors: "\n"\n~~~\n$ gmic 128,128,1,3,\"u(0,255)\" plasma 10,3 blur 4 sharpen 10000 n 0,255 ""elevation3d[-1] \"'X=(x-64)/6;Y=(y-64)/6;100*exp(-(X^2+Y^2)/30)*abs(cos(X)*sin(Y))'\"\n~~~"\n\n"===\n![3D Elevation](../img/example_elevation3d.png)\n==="\n\n"### Plot the isosurface of a 3D volume: "\n"\n~~~\n$ gmic mode3d 5 moded3d 5 double3d 0 isosurface3d \"'x^2+y^2+abs(z)^abs(4*cos(x*y*z*3))'\",3\n~~~"\n"===\n![3D Isosurface](../img/example_isosurface3d.png)\n==="\n\n"### Render a G'MIC 3D logo: "\n"\n~~~\n$ gmic 0 text G\\\47MIC,0,0,53,1,1,1,1 expand_xy 10,0 blur 1 normalize 0,100 +plasma 0.4 add blur 1 ""elevation3d -0.1 moded3d 4\n~~~"\n"===\n![3D G'MIC Logo](../img/example_logo.png)\n==="\n\n"### Generate a 3D ring of torii: "\n"\n~~~\n$ gmic repeat 20 torus3d 15,2 color3d[-1] \"{u(60,255)},{u(60,255)},{u(60,255)}\" *3d[-1] 0.5,1 if \"{$>%2}\" ""rotate3d[-1] 0,1,0,90 fi add3d[-1] 70 add3d rotate3d 0,0,1,18 done moded3d 3 mode3d 5 double3d 0\n~~~"\n"===\n![3D Ring](../img/example_torii.png)\n==="\n\n"### Create a vase from a 3D isosurface: "\n"\n~~~\n$ gmic moded3d 4 isosurface3d \"'x^2+2*abs(y/2)*sin(2*y)^2+z^2-3',0\" sphere3d 1.5 sub3d[-1] 0,5 ""plane3d 15,15 rotate3d[-1] 1,0,0,90 center3d[-1] add3d[-1] 0,3.2 color3d[-1] 180,150,255 color3d[-2] 128,255,0 ""color3d[-3] 255,128,0 add3d\n~~~"\n"===\n![3D Vase](../img/example_vase.png)\n==="\n\n"### Launch a set of interactive demos: "\n"\n~~~\n$ gmic demos\n~~~\n" +l { reference_footer_$1 reference_end_$1 onfail } +um _section,_text +rm +reference_begin_ascii : +use_vt100 +if !narg($_shell_cols) _shell_cols:=${-shell_cols}-5 fi +_section=0 ++e "" +reference_header_ascii : +str=\n" "${_vt100_b}"gmic: GREYC\'s Magic for Image Computing:"$_vt100_n" command-line interface"\n" "${_vt100_c}${_vt100_b}"Version "${strver" "$_version,$_prerelease}$_vt100_n\n" "$_vt100_g$_vt100_u"(https://gmic.eu)"$_vt100_n\n\n" Copyright (c) Since 2008, David Tschumperlé / GREYC / CNRS."\n" "$_vt100_g$_vt100_u"(https://www.greyc.fr)"$_vt100_n ++e $str +reference_section_ascii : +_section+=1 ++e "" +('$_section." "') ('"$*"') +f.. {'" "'} +f.. {'-'} a[-4,-3] x a[-2,-1] x ++e " "$_vt100_r$_vt100_b{-2,t}$_vt100_n ++e " "$_vt100_r{t}$_vt100_n\n +rm[-2,-1] +reference_text_ascii : +l[] { +('"$*"') +gmd2ascii $_shell_cols,1 +s +,{'\n'} +eval "repeat (l,p, +i(#p)==_'\n'?(h#p==1?resize(#p,0,0,0,0):(resize(#p,1,1,1,1);i(#p) = 0)): +(resize(#p,1,h#p + 2,1,1,0,0,0,1); copy(i[#p,0],_' ',2,1,0)))" +foreach { if w +e {/{t}} fi } +rm +} +reference_list_of_commands_ascii : +l { +if !$! it $_path_rc/update$_version.gmic fi +parse_cli ascii +onfail +rm ++e \n" "$_vt100_r${_vt100_b}"No command descriptions available!"$_vt100_n ++e " "${_vt100_r}"Try updating your command files, with command "$_vt100_b"'update'."$_vt100_n +} +reference_footer_ascii : ++e \n" "$_vt100_r$_vt100_b"** G\47MIC comes with ABSOLUTELY NO WARRANTY; ""for details visit: https://gmic.eu **"$_vt100_n +reference_section_html : +name="$*" +reference_end_section_html +('""\n""\n" "\n" "\n" "\n" G'MIC - GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing ""- "$name""\n" "\n" "\n" "\n\n" "\n" "\n\n"

"\n" "\n""\n\n""\n\n"

"$name"

"\n':y) +=> $name +reference_end_section_html : +if $! +('"
"\n\n""\n\n""\n"
"\n" "\n" "':y) +a[-2,-1] y +fi +reference_text_html : +('"$*"':y) gmd2html. 0 +if $!>1 a[-2,-1] y fi +reference_footer_html : +reference_end_section_html +reference_finalize_html : +html=""\n""\n" "\n" "\n" "\n" G'MIC - GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing ""- Table of Contents"\n" "\n" "\n" "\n\n" "\n" "\n\n"
"\n\n" "\n""\n\n""\n\n"

Preamble

"\n" "\n"

Version

"\n"
"\n" G'MIC: ""GREYC's Magic for Image Computing
"\n" https://gmic.eu
"\n" Version "${strver" "$_version,$_prerelease}"

"\n" Copyright © Since 2008, ""David Tschumperlé / ""GREYC / ""CNRS
"\n" https://www.greyc.fr
"\n"
"\n"

Table of Contents

"\n"
    "\n +ind_loc=${"-nmd 1,\"List of Commands\""} +if narg($ind_loc) +foreach { +name={n} strvar $name url=${}.html +if $>==$ind_loc +html.="
  • "$name"
  • " +else +html.="
  • "$name"
  • " +fi +} +html.="\n
"\n\n""\n\n""\n"
"\n" "\n" " +i[0] ({'$html'}:y) =>[0] "Table of Contents" +ind_loc+=1 +if narg($ind_loc)" && "isfile('list_of_commands.html') +it list_of_commands.html +if find(crop(),'""')<0 l[$ind_loc,-1] { +s[0] -,{'""'} +s. -,{'""'} +i[1] ('""':y) +k[0,1,-1] a y +} else => "List of Commands" rv[$ind_loc,-1] rm. fi +fi +fi +if !0$_pdf_output +repeat $! { +current={$>,n} strvar[] $current url_current=${}.html +if $>>1 previous={{$>-1},n} strvar[] $previous url_previous=${}.html else previous= fi +if $< next={{$>+1},n} strvar[] $next url_next=${}.html else next= fi +html_top="
""Table of Contents" +if $> html_top.="  ▸  "$current"" fi +html_top.="" +if ['$previous']!=0 html_top.="◀  "$previous"" fi +if ['$previous']!=0" && "['$next']!=0 html_top.="    |    " fi +if ['$next']!=0 html_top.=""$next"  ▶" fi +html_top.="
" +html_bottom="
" +if ['$previous']!=0 html_bottom.="◀  "$previous"" fi +if ['$previous']!=0" && "['$next']!=0 html_bottom.="    |    " fi +if ['$next']!=0 html_bottom.=""$next"  ▶" fi +html_bottom.="
" +replace_str[$>] "",$html_top +replace_str[$>] "",$html_bottom +} +fi +reference_end_html : +reference_finalize_html +foreach { strvar {n} ot ${}.html } +if isfile('table_of_contents.html') x "ln -fs table_of_contents.html index.html" fi +rm +reference_begin_man : +_section=0 ++e ".TH G\47MIC 1\n.SH NAME\ngmic \\- Perform image processing operations using the G\47MIC framework.\n\n.SH HELP\n" +reference_header_man : +_vt100_b="\\fB" +_vt100_c="\\fB" +_vt100_g="\\fB" +_vt100_m= +_vt100_n="\\fR" +_vt100_r="\\fB" +_vt100_u="\\fI" +_prerelease= +reference_header_ascii +reference_section_man : +reference_section_ascii "$*" +reference_text_man : +reference_text_ascii "$*" +reference_list_of_commands_man : +_vt100_c= +reference_list_of_commands_ascii +_vt100_m="\\fB" +_vt100_b= +reference_footer_man : +reference_footer_ascii "$*" +reference_begin_pdf : +_pdf_output=1 +reference_section_pdf : +reference_section_html "$*" +reference_text_pdf : +reference_text_html "$*" +reference_footer_pdf : +reference_end_section_html +reference_end_pdf : +1024,4,1,3 o. reference_pdf.png rm. +reference_finalize_html +l[] { +it ../../src/gmic_stdlib.gmic +parse_cli. list loc=${} +parse_cli html +repeat narg($loc) { +command=${"arg "1+$>","$loc} +l[] { if ['$command'][0]!=_'_' it $command.html fi onfail } +} +sort_list +,n +} +s +,{'""'} +s +,{'""'} +k[2--1:5] +i[0] ('""\n""\n" "\n" "\n" "\n" reference_pdf"\n" "\n" "\n\n" "\n"
"\n" "\n"

The Handbook

"\n"

Version "${strver" "$_version,$_prerelease}"

"\n"

© David Tschumperlé / GREYC / CNRS

"\n"

"{date(0)}"/"{date(1)}"/"{date(2)}"

"\n"
"':y) +('""\n"

□ End of document

"\n""':y) a y +ot reference_pdf.html +rm +it ../style.css ot. style.css rm +delete reference_pdf.pdf +v 0 e " > Waiting for file 'reference_pdf.pdf'." +for !isfile('reference_pdf.pdf') { wait 5000 } +e " > Removing links in file 'reference_pdf.pdf'." +x "pdfjam reference_pdf.pdf" +e " > Compressing file 'reference_pdf.pdf' to 'gmic_reference.pdf'." +x "gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=gmic_reference.pdf reference_pdf-pdfjam.pdf" +e " > Clean temporary files." +delete style.css,reference_pdf.html,reference_pdf.png,reference_pdf.pdf,reference_pdf-pdfjam.pdf +e " > Upload file 'gmic_reference.pdf' to G'MIC server." +x "lftp sftp://"$GMIC_LOGIN":@ovh -e \"put -O /home/"$GMIC_LOGIN"/www/gmic/reference gmic_reference.pdf; ""quit\" >/dev/null" +use_vt100 : +if !0$_vt100" || "['$_vt100_n']!=0 return fi +_vt100_b="\33[1m" +_vt100_c="\33[0;36;59m" +_vt100_g="\33[0;32;59m" +_vt100_i="\33[3m" +_vt100_m="\33[0;35;59m" +_vt100_n="\33[0;0;0m" +_vt100_r="\33[0;31;59m" +_vt100_s="\33[9m" +_vt100_u="\33[4m" +#@cli version +#@cli : Display current version number on stdout. +version : +use_vt100 +reference_header_ascii[] +if !0$_cli_noarg +e "\n" fi +#@cli :: Input / Output +#@cli camera : _camera_index>=0,_nb_frames>0,_skip_frames>=0,_capture_width>=0,_capture_height>=0 : (+) +#@cli : Insert one or several frames from specified camera. +#@cli : When 'nb_frames==0', the camera stream is released instead of capturing new images. +#@cli : This command requires features from the OpenCV library (not enabled in G'MIC by default). +#@cli : Default values: 'camera_index=0' (default camera), 'nb_frames=1', 'skip_frames=0' and 'capture_width=capture_height=0' (default size). +clean_cluts : +e[^-1] "Clean CLUT dataset.\n" +round c 0,255 +foreach { +nm={n} +if "str = lowercase(['"$nm"*']); +!find(str,'tpf_-_cinematica_')" l[] { +if !narg($tpf) tpf=1 fi +('moviz_$tpf') +tpf+=1 +nm={t} rm +} fi +if "str = lowercase(['"$nm"*']); +find(str,'_-_standard-vk')>=0" l[] { +if !narg($tpf) tpf=1 fi +('moviz_$tpf') +tpf+=1 +nm={t} rm +} fi +if "str = lowercase(['"$nm"*']); +find(str,'_-_rec_709*')>=0" l[] { +('$nm') z. 0,{w-11} +nm={t} rm +} fi +if "str = lowercase(['"$nm"']); +!find(str,'smallhd_movielook_')" l[] { +('$nm') z. 18,100% +replace_str "apocalypsethisverymoment","apocalypse_this_very_moment" +replace_str "bobford","bob_ford" +replace_str "lifegivingtree","life_giving_tree" +replace_str "savingprivatedamon","saving_private_damon" +replace_str "thematrices","the_matrices" +nm={t} rm +} fi +if "str = lowercase(['"$nm"']); +!find(str,'fuji_xtrans_iii')" l[] { +('$nm') +replace_str "_-_","_" nm={t} rm +} fi +if "str = lowercase(['"$nm"']); +!find(str,'kodak') || +!find(str,'polaroid') || +!find(str,'fuji') || +!find(str,'ilford')" l[] { +({'$nm'},{'*'}) +replace_str " ","_" +replace_str "xp_2","xp2" +replace_str "hp_5","hp5" +repeat 8 { n:=1+$> +replace_str "_"${n}"_+","_+" +replace_str "_"${n}"_-","_-" +replace_str "_"${n}"_alt","_alt" +replace_str "_"${n}"_Alt","_alt" +replace_str "_"${n}"*","*" +} += 0,0,100% nm={t} rm +} fi +strclut $nm nm=${} +if "str = lowercase(['"$nm"']); +!find(str,'technicalfx') || +!find(str,'picturefx') || +!find(str,'analogfx') || +!find(str,'goldfx') || +!find(str,'zilverfx')" l[] { +('$nm') +replace_str "-","_" nm={t} rm +} fi +l[] { +({'$nm'},{'*'}) +replace_str "_v_2*","*" +replace_str "_v_1*","*" +replace_str "_*","*" +replace_str "_b_w","_bw" +replace_str "&","" +replace_str "rec_709_-_","rec709_" +replace_str "s-log","slog" +replace_str "__","_" +replace_str "action_-_","action_" +replace_str "-version-","" +replace_str "picturefx_","" += 0,0,100% nm={t} rm +} +=>[^] $nm +} +foreach { +if "ref(crop(#0,0,0,0,3,1,h,1,1),R); +ref(crop(#0,0,0,0,4,1,h,1,1),G); +ref(crop(#0,0,0,0,5,1,h,1,1),B); +R==G && G==B" +channels 0,3 +fi +} +p=0 for $p<$! { +nm0={$p,n} +e "\r- Search duplicates for ["$p"] = '"$nm0"' " +q:=$p+1 for $q<$! { +nm={$q,n} +if ['$nm0']==['$nm'] +e " > Found duplicate ["$q"] -> Original 1x"{$p,h}", new 1x"{$q,h}"\n" +rv[$p,$q] rm[$q] +else q+=1 +fi +} +p+=1 +} +sort_list +,n +doc="#@cli clut : \"clut_name\",_resolution>0,_cut_and_round={ 0:no | 1:yes }\n""#@cli : Insert one of the "$!" pre-defined CLUTs at the end of the image list.\\n\n""#@cli : 'clut_name' can be {" sep="|" +nbc=28 +foreach { +if !$< sep="}" fi +str=" "{n}" "$sep +s_str:=size(['$str']) +nbc+=$s_str +if $nbc<118 +doc=${doc}${str} +else +doc=${doc}" \\\n#"${str} +nbc:=1+$s_str +fi +} +doc=${doc}"\n""#@cli : Default values: 'resolution=33' and 'cut_and_round=1'.\n""#@cli : $ clut summer clut alien_green,17 clut orange_dark4,48\n" +e "\n"$doc +#@cli m : eq. to 'command'. : (+) +#@cli command : _add_debug_info={ 0 | 1 },{ filename | http[s]://URL | "string" } : (+) +#@cli : Import G'MIC custom commands from specified file, URL or string. +#@cli : (eq. to 'm').\n +#@cli : Imported commands are available directly after the 'command' invocation. +#@cli : Specified filename is not allowed to contain colons ':'. +#@cli : Default value: 'add_debug_info=1' (except for a "string" argument, in which case 'add_debug_info=0'). +#@cli : $ image.jpg command "foo : mirror y deform $""1" +foo[0] 5 +foo[0] 15 +compress_gmic : +merge_multiline_comments +merge_multiline +eval " +p = 0; +while (p=0 && l1 +('""\n\n""\n""\n""\n" FilterTextTranslator"\n\n':y) +repeat h#0 { +str={0,`I(0,$>)`} +tr={0,`I(1,$>)`} +if s=['$tr'];s!=0" && norm(s-=_' ')" +({'$str'}) autocrop. {'" "'} _gmd_ascii2html. str={t} rm. +({'$tr'}) autocrop. {'" "'} _gmd_ascii2html. tr={t} rm. +if {0,!i(2,$>)} +('" "\n" "$str""\n" "$tr""\n" "\n\n':y) +else +i=2 +for {0,i($i,$>)} { +path={0,`I($i,$>)`} ({'$path'}) autocrop. {'" "'} _gmd_ascii2html. path={t} rm. +('" "\n" "$str""\n" "$path""\n" "$tr""\n" "\n':y) +i+=1 +} +r. 1,{h+1},1,1,0,1 +fi +fi +} +('"\n"\n':y) +a[^0] y k. +fi +} +#@cli delete : filename1[,filename2,...] : (+) +#@cli : Delete specified filenames on disk. Multiple filenames must be separated by commas. +#@cli d : eq. to 'display'. +d : +_gmic_s="$?" v + _display "",1,$[] ++d : +_gmic_s="$?" v + _display +,{$^>=0},$[] +#@cli display +#@cli : Display selected images in an interactive window. +#@cli : (eq. to 'd'). +#@cli : When invoked with a '+' prefix (i.e. '+display'), the command outputs its log messages on 'stdout' rather than on 'stderr'. +#@cli : Display window \#0 is used as the default window for the display, if already opened. +#@cli : \nAvailable controls are shown below (where 'LMB' = Left mouse button, 'RMB' = Right mouse button, 'MMB' = Middle mouse button and 'MW' = Mouse wheel). +#@cli : \n- **Thumbnail navigation bar:** +#@cli : 'TAB': Show/hide thumbnails - 'LMB': Select thumbnail or shift thumbnail bar - '0'-'9','ARROWS' (opt. '+SHIFT'),'B','BACKSPACE','C','E','END','H','HOME','SPACE': Navigate and select thumbnails (add 'CTRL' if mouse pointer is outside thumbnail bar). +#@cli : \n- **Image view:** +#@cli : 'LMB' or 'MMB': Image pan - 'RMB' or 'MW': Image zoom - 'ARROWS' (opt. '+SHIFT'),'HOME','END': Shift view - 'A': Switch alpha rendering - 'C': Center view - 'E': Go to lower-right corner - 'ENTER': Reset view - 'G': Toggle grid - 'H': Go to upper-left corner - 'K': Switch background - 'M': Toggle 3D view - 'N': Switch normalization - 'P': Print info about current image pixel on 'stdout' - 'PAGEUP' or 'PAGEDOWN': Raise/lower base channel - 'R': Rotate image - 'V': Crop image - 'Z': Switch zoom factor - '0'-'9': Set zoom factor. +#@cli : \n- **3D mesh view:** +#@cli : 'LMB': Mesh rotation - 'CTRL+LMB' or 'MMB': Mesh pan - 'RMB': Mesh zoom - 'A': Toggle axes - 'D': Switch face side mode - 'F': Change focale - 'J': Start/stop animation - 'K': Switch background - 'O': Switch outline mode - 'P': Print 3D pose matrix on 'stdout' - 'R': Switch rendering mode - 'T': Switch motion rendering mode - 'X': Show/hide bounding-box - 'U': Switch animation mode - 'Z': Toggle z-buffer. +#@cli : \n- **2D images specific:** +#@cli : 'CTRL+LMB': Rectangular selection. +#@cli : \n- **3D volumetric images specific:** +#@cli : 'CTRL+MW': Pan along orthogonal axis - 'X': Reset area layout. +#@cli : \n- **Window size, decoration and data I/O:** +#@cli : 'CTRL+C': Decrease window size - 'CTRL+D': Increase window size - 'CTRL+F': Toggle fullscreen - 'CTRL+I': Toggle info label - 'CTRL+O': Save copy of image as a `.gmz` file - 'CTRL+L': Save copy of image list as `.gmz` file - 'CTRL+S': Save screenshot as a `.png` file - 'CTRL+W': Start/stop window recording - 'CTRL+X': Toggle cursor. +#@cli : \n- **Configuration variables:** +#@cli : The viewer configuration can be tuned by assigning the following variables: +#@cli : - '_display_selected' is an integer or an image name that tells which image is selected by default. +#@cli : - '_display_alpha' can be { 0:off | 1:on | 2:over black | 3:over gray | 4:over white } (default value: '0'). +#@cli : - '_display_background', an integer in range [ 0,9 ] (default value: '3'). +#@cli : - '_display_cursor' can be { 0:off | 1:on (2D only) | 2:on (+3D volumetric images) } (default value: '1'). +#@cli : - '_display_is_grid' can be { 0:off | 1:on } (default value: '1'). +#@cli : - '_display_is_info' can be { 0:off | 1:on } (default value: '1'). +#@cli : - '_display_normalization' can be { -1:auto | 0:off | 1:cut | 2:stretch channelwise | 3:stretch global | 4: stretch (global once) } (default value: '-1'). +#@cli : - '_display_print_images' can be { 0:off | N>0 } (default value: '5'). It sets the max number 'N' of images whose information is initially printed on `stderr` or `stdout`. +#@cli : - '_display_3d_is_rendered' can be { 0:off | 1:on } (default value: '1'). +#@cli : - '_display_3d_rendering_mode' can be { 0:dots | 1:wireframe | 2:flat | 3:flat-shaded | 4:gouraud-shaded | 5=phong-shaded } (default value: '4'). +#@cli : - '_display_3d_outline_mode' can be { 0:no-outline | 1:black-outline | 2:gray-outline | 3:red-outline | 4:green-outline | 5:blue-outline | 6:white-outline } (default value: '0'). +#@cli : - '_display_3d_motion_rendering_mode' can be { -1:bounding-box | 0:dots | 1:wireframe | 2:flat | 3:flat-shaded | 4:gouraud-shaded | 5=phong-shaded } (default value: '3'). +#@cli : - '_display_3d_motion_time_limit' is specified in ms. Above this time, motion rendering toggle to 'bounding-box' mode (default value: '300'). +#@cli : - '_display_3d_side_mode' can be { 0:single-sided | 1:double-sided | 2:single-sided (flipped) } (default value: '0'). +#@cli : - '_display_3d_is_zbuffer' can be { 0:off | 1:on } (default value: '1'). +#@cli : - '_display_3d_focale' can be { <0: perspective projection w/o sprite zooming, 0: parallel projection | >0: perspective projection } (default value: 1.5). +#@cli : - '_display_3d_is_axes' can be { 0:off | 1:on } (default value: '1'). +#@cli : - '_display_3d_is_bounding_box' can be { 0:off | 1:on } (default value: '0'). +#@cli : - '_display_3d_background' is an unsigned integer in range [0,11] (default value: '11'). +#@cli : - '_display_3d_pose' is a sequence of 12 values that defines the current 3D pose matrix (read/write). +#@cli : - '_display_3d_animation' can be { 0:off | 1:forward | 2:backward } (default value: '0'). +#@cli : - '_display_3d_animation_mode' can be { 0-3:X-axis | 4-7:Y-axis | 8-11:Z-axis | 12-15:XYZ-axes } (default value: '4'). +display : +_gmic_s="$?" v + _$0 "",1,$[] ++display : +_gmic_s="$?" v + _$0 +,{$^>=0},$[] +_display : skip ${1=},${3=} +if !$! +if $2 e[0--5] "Display image []." fi +is_change 0 +return +fi +check_display "display" +m "$0_rmn : nmd 2,$""* rm[${}]" +nb_images=$! +if ['$_display_selected']!=0 setting_selected=$_display_selected else setting_selected=0 fi +setting_alpha:=narg($_display_alpha)?cut(int(0$_display_alpha),0,4):0 +setting_background:=narg($_display_background)?cut(int(0$_display_background),0,9):3 +setting_cursor:=narg($_display_cursor)?cut(int(0$_display_cursor),0,2):1 +setting_is_grid:=narg($_display_is_grid)?cut(int(0$_display_is_grid),0,1):1 +setting_is_info:=narg($_display_is_info)?cut(int(0$_display_is_info),0,1):1 +setting_normalization:=narg($_display_normalization)?cut(int(0$_display_normalization),-1,4):-1 +setting_print_images:=narg($_display_print_images)?max(0,$_display_print_images):5 +setting_3d_is_rendered:=narg($_display_3d_is_rendered)?cut(int(0$_display_3d_is_rendered),0,1):1 +setting_3d_rendering_mode:=narg($_display_3d_rendering_mode)?cut(int(0$_display_3d_rendering_mode),0,5):narg($_mode3d)?cut(int(0$_mode3d),0,5):4 +setting_3d_outline_mode:=narg($_display_3d_outline_mode)?cut(int(0$_display_3d_outline_mode),0,6):0 +setting_3d_motion_rendering_mode:=narg($_display_3d_motion_rendering_mode)?cut(int(0$_display_3d_motion_rendering_mode),-1,5):narg($_moded3d)?cut(int(0$_moded3d),-1,5):3 +setting_3d_motion_time_limit:=narg($_display_3d_motion_time_limit)?max(0$_display_3d_motion_time_limit,0):300 +setting_3d_side_mode:=narg($_display_3d_side_mode)?cut(int(0$_display_3d_side_mode),0,2):1 +setting_3d_is_zbuffer:=narg($_display_3d_is_zbuffer)?cut(int(0$_display_3d_is_zbuffer),0,1):1 +setting_3d_focale:=narg($_display_3d_focale)?0$_display_3d_focale:1.5 +setting_3d_is_axes:=narg($_display_3d_is_axes)?cut(int(0$_display_3d_is_axes),0,1):1 +setting_3d_is_bounding_box:=narg($_display_3d_is_bounding_box)?cut(int(0$_display_3d_is_bounding_box),0,1):0 +setting_3d_background:=narg($_display_3d_background)?cut(int(0$_display_3d_background),0,12):11 +setting_3d_animation:=narg($_display_3d_animation)?cut(int(0$_display_3d_animation),0,1):0 +setting_3d_animation_mode:=narg($_display_3d_animation_mode)?cut(int(0$_display_3d_animation_mode),0,15):4 +if !narg($_display_3d_pose) _display_3d_pose=1,0,0,0,0,1,0,0,0,0,1,0 fi +if !narg($_display_3d_zoom) _display_3d_zoom=0.65 fi +thumb_height_factor=0.15 +thumb_min_ratio=0.45 +thumb_is_visible:=$nb_images>1 +is_opencv:="find([' "$_flags"'],'opencv')>0" +l { +if isint($setting_selected) selected:=$setting_selected%$nb_images +else nmd 1,$setting_selected selected=${} if !narg($selected) selected=0 fi +fi +onfail selected=0 +} +foreach { image_name$>={n} => _display$> } +(${3--1}:y) => image_indices +if $nb_images<=6 $nb_images,1,1,1,x sel={^} rm. is_ellipsized=0 +else sel=0,1,2,{$nb_images-[3,2,1]} is_ellipsized=1 +fi +log_title,window_title,sep= +repeat narg($sel) { +l_ind:=arg0($>,$sel) +g_ind={image_indices,i[$l_ind]} +basename {``${image_name$l_ind}} +if ['${}']!=0 ({'{/${}}'}) else ('{``${image_name$l_ind}}') fi +basename={`"b = crop(); size(b)>32?copy(b[32-3],[['...'],0]); b"`} rm. +log_title.=$sep$basename +window_title.=$sep[$g_ind]" "$basename +if $is_ellipsized" && "$>==2 sep=", (...) " else sep=", " fi +} +if $nb_images>1 window_title.=" (#"$nb_images")" else window_title.=" ("{0,[w,h,d,s]}")" fi +if $2 e[0--4] "Display image"$_gmic_s" = '"$log_title"'." fi +window_previous_normalization,windows_previous_fullscreen= +if {*} +window_width,window_height={*,d,e} +window_previous_normalization,windows_previous_fullscreen={*,n,f} +if $setting_normalization<0 setting_normalization:={*,n}?4:0 fi +w[] $window_width,$window_height,0,$window_title +else +window_width,window_height=${"$0_default_window_size[0-"{$nb_images-1}"] "$thumb_height_factor,$thumb_min_ratio} +if $setting_normalization<0 setting_normalization=4 fi +w[] $window_width,$window_height,0,$window_title +fi +window_nonfullscreen_width,window_nonfullscreen_height={*,w,h} +is_fullscreen,mouse_x,mouse_y={*,f,x,y} +mouse_area,is_area1,is_area2,is_area3,is_area4,is_area5,is_area234=0 +previous_mouse_x,previous_mouse_y,previous_mouse_area=-1,-1,0 +event_type0,is_clicked0,is_clicked1,is_clicked2,is_released0,is_released1,is_released2,is_drag0,is_drag1,is_drag2=0 +window_no_wait=0 +thumb_mouse_over=-1 +thumb_view_update=0 +thumb_x= +view_center_x,view_center_y,view_center_z,view_zoom=0.5,0.5,0.5,1 +view_zoom_mode,view_is_rotated,view_base_channel=3,0,0 +canvas_rect_x0,canvas_rect_y0,canvas_rect_x1,canvas_rect_y1,canvas_cross_x,canvas_cross_y= +canvas_mouse_x,canvas_mouse_y,window_record_frame=-1 +canvas_label_alignment=0 +area_width,area_height=0 +area_mouse_x,area_mouse_y=-1 +zoom_1_1,view_3d_draw_on_canvas,area_3d_is_motion=0 +if $nb_images>1 (255,0) r. 33,1,1,1,3 channels. -3,0 +mirror. x => thumb_shade_left,thumb_shade_right fi +1,${nb_images}x5 => is_printed,is_infnan,is_rotated,is_mesh3d,thumb_is_cached +f[is_infnan,is_mesh3d] -1 +repeat min($nb_images,$setting_print_images) { +=>[$>] ${image_name$>} +v + _print[$>] $1,0,{image_indices,i[$>]} v - +=>[$>] _display$> +=[is_printed] 1,0,$> +} +for {*}" && "!{*,ESC} { +window_width,window_height={*,w,h} +is_volumetric={$selected,d>1} +if {is_mesh3d,i[$selected]<0} +sh[$selected] if {is_rotated,i[$selected]} y. fi +if h>6" && "int(crop(0,0,1,6))=='CImg3d' =[is_mesh3d] ${is_mesh3d.},0,$selected +else =[is_mesh3d] 0,0,$selected +fi +rm. +fi +is_mesh3d={is_mesh3d,i[$selected]} +is_view3d:=$setting_3d_is_rendered" && "($is_volumetric" || "$is_mesh3d) +if {is_rotated,i[$selected]!=$view_is_rotated} +rotate[$selected] {is_rotated,90*($view_is_rotated-i[$selected])} +=[is_rotated] $view_is_rotated,0,$selected +fi +if !$thumb_is_visible +thumb_height,thumb_height2=0 +else +thumb_height:=max(48,round($window_height*$thumb_height_factor)) +if !0$thumb_coords +1,$nb_images,1,2,"begin(CImg3d = 'CImg3d'); +const ratio = $thumb_min_ratio; +w = w#y; h = h#y; d = d#y; s = s#y; +w==1 && h>6 && d==1 && s==1 && int(crop(#y,0,0,0,0,1,6,1,1))==CImg3d?[ 1,1 ]:( # is 3D mesh? +d>1?(w+=d + 2; h+=d + 2); +Mwh = max(w,h); +wt = Mwh?max(ratio,w/Mwh):0.5; +ht = Mwh?max(ratio,h/Mwh):0.5; +i[#$is_rotated,y]%2?swap(wt,ht); +[ wt,ht ])" +sh. 100% /.. {iM} rm. *. $thumb_height round. ++f. ">begin(Sw = 0); res = [ Sw, round(($thumb_height - i1)/2) ]; Sw+=i0 + 2; res" +rv[-2,-1] a[-2,-1] c => thumb_coords +thumb_sumw={thumb_coords,max(i[h-1]+i(0,h-1,0,2),$window_width)} +thumb_x_px_max={thumb_coords,max(-16,i[h-1]+i(0,h-1,0,2)-$window_width+17)} +if !narg($thumb_x) +x0,w={thumb_coords,[i(0,$selected,0,0),i(0,$selected,0,2)]} +thumb_x:=($x0-48)/$thumb_sumw +fi +$0_flush_thumb_cache +fi +thumb_height2:=$thumb_height+2 +thumb_x_px:=cut($thumb_x*$thumb_sumw,-16,$thumb_x_px_max) +if $thumb_view_update $0_rmn thumb_view thumb_view_update=0 fi +if !0$thumb_view +$0_rmn thumb_index_map +$window_width,$thumb_height,1,3 100%,1,1,1,-1 => thumb_view,thumb_index_map +ind0,ind1={thumb_coords," +find_ind(val) = ( +ref(val,v); i0 = 0; i1 = h - 1; +v<=i[i0]?i0:v>=i[i1]?i1:(while (i1 - i0>1, ic = int((i0 + i1)/2); i[ic]<=v?(i0 = ic):(i1 = ic)); i0) +); +ind0 = find_ind($thumb_x_px); +ind1 = find_ind($thumb_x_px + $window_width); +[ ind0, ind1 ]"} +ind=$ind0 repeat $ind1-$ind0+1 { +x,y,w,h={thumb_coords,I[$ind]} +if {thumb_is_cached,i[$ind]} +${thumb_cache_$ind} r. $w,$h,1,100%,2 +if {thumb_is_cached,i[$ind]==2} +sh[thumb_3d_icon] 100% +j.. [thumb_3d_icon],0.05~,0.95~,0,0,1,.,255 rm. +fi +else +if {$ind,!w} +font_size:=cut($thumb_height/8,16,32) +$w,$h,1,3,100 to. \330,0.42~,0.5~,$font_size,1,1,255 +else +if {is_mesh3d,i[$ind]<0} +sh[$ind] if {is_rotated,i[$ind]} y. fi =[is_mesh3d] ${is_mesh3d.},0,$ind rm. +fi +if {is_mesh3d,i[$ind]} +if !0$thumb_3d_icon +box3d 35 col3d. 0,200,255 c3d. r3d. 1,1,1,45 +64,64,1,3,-1 j3d. ..,50%,50%,0,1,3,0 rm.. ++channels. 0 neq. -1 dilate. 3 *. 200 +f.. "I!=J(-1) || I!=J(1) || I!=J(0,-1) || I!=J(0,1)?[0,0,0]:I+1" +to.. 3D,0.5~,0.5~,24,1,1,255 +a[-2,-1] c autocrop. r. 42,42,1,4,2 +=> thumb_3d_icon +fi +fi +is_alpha={$ind,$setting_alpha" && "(s==2||s==4)} +sh[$ind] 0,{$ind,$is_alpha?s-1:min(2,s-1)} +if d>1 ++r3din. {ceil(min($w/(w+d+2),$h/(h+d+2))*[w,h,d])},1 +volumetric2d. {round([w-(w==1),h-(h==1),d-(d==1)]/2)},2 +rm.. +fi +if w>$w" || "h>$h +r. $w,$h else . fi rm.. +if {is_rotated,i[$ind]} rotate. {is_rotated,-90*i[$ind]} fi +if !$setting_normalization +and. 255 +elif $setting_normalization==1 +c. 0,255 +else +if {is_infnan,i[$ind]<0} =[is_infnan] ${_display_is_infnan[$ind]},0,$ind fi +if $setting_normalization==2 +if {is_infnan,i[$ind]} l. { s c $0_normalize_infnan a c } +else l. { s c n 0,255 a c } +fi +else +if {is_infnan,i[$ind]} $0_normalize_infnan. else n. 0,255 fi +fi +fi +r. {[$w,$h]-2} +if $is_alpha +to_rgba. +if $setting_alpha==1 (64,96;96,64) r. 24,24,1,1 r. $w,$h,1,3,0,2 +else $w,$h,1,3,{arg($setting_alpha-1,0,128,255)} +fi +sh.. 100% j.. ...,0,0,0,0,1,.,255 rm[-3,-1] +elif s==1 r. 100%,100%,1,3 +elif s==2 r. 100%,100%,1,3,0 +fi +if {is_mesh3d,i[$ind]} +sh[thumb_3d_icon] 100% +j.. [thumb_3d_icon],0.05~,0.95~,0,0,1,.,255 rm. +fi +r. {[w,h]+2},1,100%,0,0,0.5,0.5 rectangle. 0,0,100%,100%,1,0x55555555,96 +fi ++store. thumb_cache_$ind +=[thumb_is_cached] 1,0,$ind +fi +offx:=$x-$thumb_x_px +line[thumb_index_map] {[$offx,0,$offx+w-1,0]},1,$ind +j[thumb_view] .,$offx,$y rm. +ind+=1 +} +x0,y0,w,h={thumb_coords,I[$selected]} +x0-=$thumb_x_px +x1,y1:=[$x0,$y0]+[$w,$h]-1 +rectangle[thumb_view] $x0,$y0,$x1,$y1,1,0xFFFFFFFF,255 +rectangle[thumb_view] {[[$x0,$y0]+1,[$x1,$y1]-1]},1,0xFFFFFFFF,255 +rectangle[thumb_view] {[[$x0,$y0]+2,[$x1,$y1]-2]},1,0xFFFFFFFF,0 +font_size:=cut($thumb_height/6,16,32) +to[thumb_view] "#"{image_indices,i[$selected]},{[$x0,$y0]+1},$font_size,2 +if $thumb_mouse_over>=0 +x0,y0,w,h={thumb_coords,I[$thumb_mouse_over]} +x0-=$thumb_x_px +x1,y1:=[$x0,$y0]+[$w,$h]-1 +rectangle[thumb_view] $x0,$y0,$x1,$y1,0.25,200 +if $thumb_mouse_over!=$selected +rectangle[thumb_view] $x0,$y0,$x1,$y1,0.75,0x33333333,0 +rectangle[thumb_view] $x0,$y0,$x1,$y1,0.75,0xCCCCCCCC,255 +to[thumb_view] "#"{image_indices,i[$thumb_mouse_over]},{[$x0,$y0]+1},$font_size,1,0.75 +fi +fi +if $thumb_x_px>0 +r[thumb_shade_left] 100%,$thumb_height sh[thumb_shade_left] 100% +j[thumb_view] [thumb_shade_left],0,0,0,0,{min(1,$thumb_x_px/32)},.,255 rm. +fi +if $thumb_x_px+$window_width<$thumb_sumw +r[thumb_shade_right] 100%,$thumb_height sh[thumb_shade_right] 100% +j[thumb_view] [thumb_shade_right],1~,0,0,0,{min(1,($thumb_sumw-$window_width-$thumb_x_px)/32)},.,255 rm. +fi +$0_rmn window_view +fi +fi +canvas_width,canvas_height=$window_width,{$window_height-$thumb_height2} +if !0$canvas_background" || "{0$canvas_background,[w,h]!=[$canvas_width,$canvas_height]} +$0_rmn canvas_background +$canvas_width,$canvas_height,1,3,{arg0($setting_background>>1,0,64,128,192,255)} +if $setting_background&1 +amp:=$setting_background==1?32:12 +24,24,1,1,-$amp +f. $amp a[-2,-1] x +mirror. x a[-2,-1] y +r. $canvas_width,$canvas_height,1,3,0,2 +[-2,-1] c. 0,255 +fi +=> canvas_background +$0_rmn canvas_base,canvas_volumetric_background +fi +if !0$canvas_base +if {is_printed,$setting_print_images" && "!i[$selected]} +=>[$selected] ${image_name$selected} +v + _print[$selected] $1,0,{image_indices,i[$selected]} v - +=>[$selected] _display$selected +=[is_printed] 1,0,$selected +fi +if $is_volumetric +if !narg($canvas_cross_x) +w,h,d={$selected,i[#$is_rotated,$selected]%2?[h,w,d]:[w,h,d]} +whd={$selected,`string($w,'_',$h,'_',$d)`} +if narg(${view_coords_$whd}) canvas_cross_x,canvas_cross_y:=f=[${view_coords_$whd}];f[size(f)-2,2] +else canvas_cross_x,canvas_cross_y={$selected,[min(0.95,w/(w+d)),min(0.95,h/(h+d))]} +fi +fi +canvas_cross_x,canvas_cross_y:="[ +cut("$canvas_cross_x",16/$canvas_width,($canvas_width-17)/$canvas_width), +cut("$canvas_cross_y",16/$canvas_height,($canvas_height-17)/$canvas_height) +]" +area_xy_width,area_xy_height,area_xz_width,area_xz_height,area_zy_width,area_zy_height,area_3d_width,area_3d_height:=" +const w_ratio = "$canvas_cross_x"; +const h_ratio = "$canvas_cross_y"; +w_xy = round(w_ratio*$canvas_width) - 1; +h_xy = round(h_ratio*$canvas_height) - 1; +w_zy = $canvas_width - w_xy - 1; +h_xz = $canvas_height - h_xy - 1; +[ w_xy,h_xy,w_xy,h_xz,w_zy,h_xy,w_zy,h_xz ]" +elif $is_mesh3d" && "$is_view3d +area_xy_width,area_xy_height,area_xz_width,area_xz_height,area_zy_width,area_zy_height=0 +area_3d_width,area_3d_height=$canvas_width,$canvas_height +else +area_xy_width,area_xy_height=$canvas_width,$canvas_height +area_xz_width,area_xz_height,area_zy_width,area_zy_height,area_3d_width,area_3d_height=0 +fi +if {$selected,!w} +[canvas_background] => canvas_base +elif $is_mesh3d" && "$is_view3d +view_3d_draw_on_canvas=1 +else +is_alpha={$selected,$setting_alpha" && "(s==2||s==4)} +view_base_channel={$selected,cut($view_base_channel,0,max(0,s-3))} +cmin,cmax={$selected,$is_alpha?[0,s-1]:[$view_base_channel,min($view_base_channel+2,s-1)]} +area_xy_x0,area_xy_y0,area_xy_x1,area_xy_y1,area_xy_dx,area_xy_dy,area_xz_x0,area_xz_z0,area_xz_x1,area_xz_z1,area_xz_dx,area_xz_dz,area_zy_z0,area_zy_y0,area_zy_z1,area_zy_y1,area_zy_dz,area_zy_dy={$selected," +const x = $view_center_x*w; const y = $view_center_y*h; const z = $view_center_z*d; +const w_xy = $area_xy_width; const h_xy = $area_xy_height; +const w_xz = $area_xz_width; const h_xz = $area_xz_height; +const w_zy = $area_zy_width; const h_zy = $area_zy_height; +const mw4 = max(w,4); const mh4 = max(h,4); const md4 = max(d,4); +const f_xy = max(mw4/w_xy,mh4/h_xy); +$is_volumetric?( +const f_xz = max(mw4/w_xz,md4/h_xz); +const f_zy = max(md4/w_zy,mh4/h_zy); +const f = 0.5*min(f_xy,f_xz,f_zy)/$view_zoom; +):(const f = 0.5*f_xy/$view_zoom); +[ x - f*w_xy, y - f*h_xy, x + f*w_xy, y + f*h_xy, 2*f*w_xy, 2*f*h_xy, +x - f*w_xz, z - f*h_xz, x + f*w_xz, z + f*h_xz, 2*f*w_xz, 2*f*h_xz, +z - f*w_zy, y - f*h_zy, z + f*w_zy, y + f*h_zy, 2*f*w_zy, 2*f*h_zy ]"} +if $is_volumetric +if !0$canvas_volumetric_background" || "{0$canvas_volumetric_background,[w,h]!=[$canvas_width,$canvas_height]} +$0_rmn canvas_volumetric_background ++j[canvas_background] [canvas_background],{$area_xy_width+2},0 +j. [canvas_background],0,{$area_xy_height+2} +rectangle. 0,$area_xy_height,100%,{$area_xy_height+1},1,0 +rectangle. $area_xy_width,0,{$area_xy_width+1},100%,1,0 +rectangle. {[$area_xy_width,$area_xy_height]+2},100%,100%,0.25,0 +=> canvas_volumetric_background +fi +[canvas_volumetric_background] => canvas_base +else +[canvas_background] => canvas_base +fi +repeat $is_volumetric?3:1 { +if !$> +can_x0,can_y0,can_x1,can_y1,can_dx,can_dy,can_width,can_height=$area_xy_x0,$area_xy_y0,$area_xy_x1,$area_xy_y1,$area_xy_dx,$area_xy_dy,$area_xy_width,$area_xy_height +w_sel,h_sel={$selected,[w,h]} +plane={$selected,cut(round($view_center_z*d,1,-1),0,d-1)} +joffx,joffy=0 +elif $>==1 +can_x0,can_y0,can_x1,can_y1,can_dx,can_dy,can_width,can_height=$area_xz_x0,$area_xz_z0,$area_xz_x1,$area_xz_z1,$area_xz_dx,$area_xz_dz,$area_xz_width,$area_xz_height +w_sel,h_sel={$selected,[w,d]} +plane={$selected,cut(round($view_center_y*h,1,-1),0,h-1)} +joffx,joffy=0,{$area_xy_height+2} +else +can_x0,can_y0,can_x1,can_y1,can_dx,can_dy,can_width,can_height=$area_zy_z0,$area_zy_y0,$area_zy_z1,$area_zy_y1,$area_zy_dz,$area_zy_dy,$area_zy_width,$area_zy_height +w_sel,h_sel={$selected,[d,h]} +plane={$selected,cut(round($view_center_x*w,1,-1),0,w-1)} +joffx,joffy={$area_xy_width+2},0 +fi +ix0,iy0,ix1,iy1:=floor([$can_x0,$can_y0,$can_x1,$can_y1]) +ix0,ix1:=cut([$ix0,$ix1],0,$w_sel-1) +iy0,iy1:=cut([$iy0,$iy1],0,$h_sel-1) +dix,diy:=$ix1-$ix0+1,$iy1-$iy0+1 +p0:=ceil(($ix0-$can_x0)/$can_dx*$can_width) +q0:=ceil(($iy0-$can_y0)/$can_dy*$can_height) +p1:=ceil(($ix1+1-$can_x0)/$can_dx*$can_width) +q1:=ceil(($iy1+1-$can_y0)/$can_dy*$can_height) +dp,dq:=max(1,$p1-$p0),max(1,$q1-$q0) +if {$selected,(w==1" || "h==1)" && "($view_zoom>4*$zoom_1_1" || "$zoom_1_1>1)} +if $dp<8 joffx-=round((8-$dp)/2) dp=8 fi +if $dq<8 joffy-=round((8-$dq)/2) dq=8 fi +fi +fact:=max($can_width/$can_dx,$can_height/$can_dy)*100 +if $fact<100 +sh[$selected] $cmin,$cmax +if !$> if $is_volumetric +z. 0,0,$plane,100%,100%,$plane fi +elif $>==1 +z. 0,$plane,0,100%,$plane,100% permute. xzyc +else +z. $plane,0,0,$plane,100%,100% permute. zyxc +fi +if $is_volumetric r. $fact%,$fact% else +r. $fact%,$fact% fi +rm.. +z. {floor([$ix0*w/$w_sel,$iy0*h/$h_sel,$ix1*w/$w_sel,$iy1*h/$h_sel])} +else +if !$> ++z[$selected] $ix0,$iy0,$plane,$cmin,$ix1,$iy1,$plane,$cmax +elif $>==1 ++z[$selected] $ix0,$plane,$iy0,$cmin,$ix1,$plane,$iy1,$cmax +permute. xzyc +else ++z[$selected] $plane,$iy0,$ix0,$cmin,$plane,$iy1,$ix1,$cmax +permute. zyxc +fi +fi +if !$setting_normalization +and. 255 +elif $setting_normalization==1 +c. 0,255 +else +if {is_infnan,i[$selected]<0} =[is_infnan] ${$0_is_infnan[$selected]},0,$selected fi +if $setting_normalization==2 +if {is_infnan,i[$selected]} l. { s c $0_normalize_infnan a c } +else l. { s c n 0,255 a c } +fi +elif $setting_normalization==3 +if {is_infnan,i[$selected]} $0_normalize_infnan. else n. 0,255 fi +else +if !narg(${display_range_global$selected}) +if {is_infnan,i[$selected]} display_range_global$selected=${-_display_minmax_infnan} +else display_range_global$selected={$selected,[im,iM]} +fi +fi +im,iM:=${display_range_global$selected} +if $im==$iM +f. 0 +else +if {is_infnan,i[$selected]} $0_normalize_infnan. $im,$iM +else -. $im *. {255/($iM-$im)} c. 0,255 fi +fi +fi +fi +r. $dp,$dq +dx,dy,dl:=dx=$can_width/$can_dx;dy=$can_height/$can_dy;[dx,dy,max(dx,dy)] +if $setting_is_grid" && "max($dx,$dy)>8 +opacity,color:=lerp(0,0.5,min(($dl-8)/10,1)^2),ia<64?128:0 +$dix,1,1,1,1 r. $dp,1,1,1,4 +eval. "begin(col = $color); i || x==w - 1?polygon(#-2,2,x,0,x,$dq-1,$opacity,col,col,col,255)" rm. +$diy,1,1,1,1 r. $dq,1,1,1,4 +eval. "begin(col = $color); i || x==w - 1?polygon(#-2,2,0,x,$dp-1,x,$opacity,col,col,col,255)" rm. +fi +if $is_volumetric +if $p0<0 cx0,p0={-$p0},0 else cx0=0 fi +if $q0<0 cy0,q0={-$q0},0 else cy0=0 fi +if $p1>$can_width cx1:=$can_width+w-$p1-1 else cx1=100% fi +if $q1>$can_height cy1:=$can_height+h-$q1-1 else cy1=100% fi +z. $cx0,$cy0,$cx1,$cy1 +fi +np0,nq0:=[$p0,$q0]+[$joffx,$joffy] +np1,nq1:=[$np0,$nq0]+[$dp,$dq]-1 +if $is_alpha +to_rgba. +if $setting_alpha==1 +sh. 100% j[canvas_base] ..,$np0,$nq0,0,0,1,.,255 rm. +else +$dp,$dq,1,3,{arg($setting_alpha-1,0,128,255)} +sh.. 100% j.. ...,0,0,0,0,1,.,255 rm[-3,-1] +j[canvas_base] .,$np0,$nq0 +fi +else +if s==1 r. 100%,100%,1,3 +elif s==2 r. 100%,100%,1,3,0 +fi +j[canvas_base] .,$np0,$nq0 +fi +rm. +} +if $is_volumetric +w2,h2:=int([$area_xy_width,$area_xy_height]/2) +line[canvas_base] 0,$h2,100%,$h2,0.5,0x55555555,0 +line[canvas_base] 0,$h2,100%,$h2,0.5,0xAAAAAAAA,255 +line[canvas_base] $w2,0,$w2,100%,0.5,0x55555555,0 +line[canvas_base] $w2,0,$w2,100%,0.5,0xAAAAAAAA,255 +w2,h2:=[$area_xy_width,$area_xy_height]+2+int([$area_zy_width,$area_xz_height]/2) +line[canvas_base] 0,$h2,$area_xy_width,$h2,0.5,0x55555555,0 +line[canvas_base] 0,$h2,$area_xy_width,$h2,0.5,0xAAAAAAAA,255 +line[canvas_base] $w2,0,$w2,$area_xy_height,0.5,0x55555555,0 +line[canvas_base] $w2,0,$w2,$area_xy_height,0.5,0xAAAAAAAA,255 +if $is_view3d view_3d_draw_on_canvas=1 fi +fi +fi +$0_rmn canvas_label_coords +fi +if $is_view3d +if $setting_3d_is_axes" && "!0$area_3d_axes" && "!$is_volumetric +axes3d 40,40,40,20,X,Y,Z,0 col3d. 0,255,0 l. { s3d a[0-3] y area_3d_axes_offset={0,h} a y } +=> area_3d_axes +fi +if !0$area_3d_mesh +if $is_volumetric ++projections3d[$selected] {$selected,[$view_center_x*w,$view_center_y*h,$view_center_z*d]},1,10 +asiz={$selected,max(w,h,d)/3} +axes3d $asiz,$asiz,$asiz,16 o3d. 0.5 col3d. 255,128,0 +3d[-2,-1] +else +[$selected] +if {is_rotated,i[$selected]} rotate. {is_rotated,-90*i[$selected]} fi +fi +c3d. n3d. +=> area_3d_mesh +$0_rmn area_3d_mesh_notexture,area_3d_bounding_box,area_3d_view +fi +if !0$area_3d_bounding_box" && "($setting_3d_is_bounding_box" || "($area_3d_is_motion" && "$setting_3d_motion_rendering_mode<0" && "!$is_volumetric)) ++boundingbox3d[area_3d_mesh] => area_3d_bounding_box +if $setting_3d_is_bounding_box +o3d[area_3d_bounding_box] 0.35 +3d[area_3d_mesh,-1] fi +fi +if $setting_3d_outline_mode" && "!0$area_3d_mesh_notexture ++l[area_3d_mesh] { +p3d 2 nbp:=f2ui(i[7]) +if $nbp 1,$nbp,1,1,y j.. .,0,{-2,h-4*$nbp} j.. .,0,{-2,h-3*$nbp} j.. .,0,{-2,h-2*$nbp} rm. fi +} +=> area_3d_mesh_notexture +fi +if !0$area_3d_view +if !0$canvas_3d_background" || "{0$canvas_3d_background,[w,h]!=[$area_3d_width,$area_3d_height]} +$0_rmn canvas_3d_background +background,is_checkerboard:=int([$setting_3d_background>>1,$setting_3d_background&1]) +if $background<3 {*,w,h},1,3,{arg(1+$background,0,128,255)} +elif $background==3 3,2,1,1,"16,16,48,44,96,76" permute. cyzx +elif $background==4 3,2,1,1,"0,0,0,0,64,96" permute. cyzx +else 3,3,1,1,"0,0,0,0,0,100,100,0,50" permute. cyzx +fi +r. $area_3d_width,$area_3d_height,1,3,3 +if $is_checkerboard +24,24,1,1,48 +f. 64 a[-2,-1] x +mirror. x a[-2,-1] y r. {-2,[w,h]},1,3,0,2 +[-2,-1] /. 2 +fi +round. +=> canvas_3d_background +fi +[canvas_3d_background] => area_3d_view +if !0$view_3d_pose +($_display_3d_pose) r. 4,3,1,1,-1 => view_3d_pose +view_3d_zoom=$_display_3d_zoom +fi +is_bounding_box_only:=$area_3d_is_motion" && "$setting_3d_motion_rendering_mode<0" && "!$is_volumetric +if $is_bounding_box_only +[area_3d_bounding_box] +else +[area_3d_mesh] +fi +if $setting_3d_side_mode==2 rv3d. fi +nbv:=f2ui(i[6]) +if $nbv ++z. 0,8,0,{7+3*$nbv} r. 3,$nbv,1,1,-1 permute. yzcx +fact:=min($area_3d_width,$area_3d_height) +eval. "begin( +R = crop(#$view_3d_pose,0,0,3,3); +S = crop(#$view_3d_pose,3,0,1,3); +R*=$view_3d_zoom*$fact; S*=$fact; +); +copy(i[#-2,8+3*x],(R*I)+=S)" rm. +else fact=1 +fi +if $is_bounding_box_only +j3d[area_3d_view] .,50%,50%,0,0.5,1,0,0,{1.5*$fact} +else +time0=$| +j3d[area_3d_view] .,50%,50%,0,1,{$is_volumetric?[2,1,1,1.5*$fact]:[$area_3d_is_motion?min($setting_3d_motion_rendering_mode,$setting_3d_rendering_mode):$setting_3d_rendering_mode,$setting_3d_side_mode==1,$setting_3d_is_zbuffer,$setting_3d_focale*$fact]} +if $setting_3d_outline_mode" && "!$is_volumetric ++z. 0,8,0,{7+3*$nbv} j[area_3d_mesh_notexture] .,0,8 rm. +[area_3d_view],[area_3d_view],1,1,-1 +j3d. [area_3d_mesh_notexture],50%,50%,0,1,2,{$setting_3d_side_mode==1},$setting_3d_is_zbuffer,{$setting_3d_focale*$fact} +g. xy,1 !=[-2,-1] 0 or[-2,-1] +100%,100%,1,3 +fc. ${"arg "$setting_3d_outline_mode,"\"0,0,0\",\"128,128,128\",\"255,0,0\",\"0,128,0\",\"0,0,255\",\"255,255,255\""} +j[area_3d_view] .,0,0,0,0,0.5,.. +rm[-2,-1] +fi +dtime:=$|-$time0 +if $area_3d_is_motion" && "1000*$dtime>$setting_3d_motion_time_limit +setting_3d_motion_rendering_mode=-1 +fi +fi +rm. +if $setting_3d_is_axes" && "!$is_volumetric +[area_3d_axes] nbv={@6} ++z. 0,8,0,{7+3*$nbv} r. 3,$nbv,1,1,-1 permute. yzcx +eval. "begin(R = crop(#$view_3d_pose,0,0,3,3)); +copy(i[#-2,8+3*x],R*I)" rm. +eval " +const off = "$area_3d_axes_offset"; +ref([ 255,0,0 ],col); +i[13]>0?copy(i[off],col,3); +i[19]>0?copy(i[off + 3],col,3); +i[25]>0?copy(i[off + 6],col,3)" +j3d[area_3d_view] .,50,{area_3d_view,h-50},0,0.75,1,0,0,150 rm. +fi +if {thumb_is_cached,$thumb_is_visible" && "i[$selected]<2" && "!$is_volumetric} +w,h,Mwh={$thumb_coords,wh=I[$selected][2,2];[wh,max(wh,256)]} ++rr2d[area_3d_view] $Mwh,$Mwh,1,2 +r. $Mwh,$Mwh,1,100%,0,0,0.5,0.5 +store. 1,thumb_cache_$selected +=[thumb_is_cached] 2,0,$selected +thumb_view_update,window_no_wait=1 +fi +view_3d_draw_on_canvas=1 +fi +if $view_3d_draw_on_canvas" && "0$area_3d_view +if $is_mesh3d +$0_rmn canvas_base =>[area_3d_view] canvas_base 0 => area_3d_view +else +j[canvas_base] [area_3d_view],{[$area_xy_width,$area_xy_height]+($is_volumetric?2:0)} +fi +view_3d_draw_on_canvas=0 +$0_rmn canvas_view +fi +fi +if !0$canvas_label_info +0 +basename {``${image_name$selected}} +if ['${}']!=0 ({'{/${}}'}) else ('{``${image_name$selected}}') fi +basename={`"b = crop(); size(b)>32?copy(b[32-3],[['...'],0]); b"`} rm. +if $nb_images==1" && "!$is_fullscreen +str="["{image_indices,i[$l_ind]}"] "$basename" " +if $is_mesh3d" && "$is_view3d +str.="("{$selected,f2ui(i[6])}" vertices, "{$selected,f2ui(i[7])}" primitives)" +else +str.="("{$selected,[w,h,d,s]}")" +fi +w[] -1,-1,$str +else +str= +if $thumb_mouse_over>=0" && "$thumb_mouse_over!=$selected +basename {``${image_name$thumb_mouse_over}} +basename_mo={`"b = ['"{``${}}"']; size(b)>32?copy(b[32-3],[['...'],0]); b"`} +str.="#"{image_indices,i[$thumb_mouse_over]}": " +if {is_mesh3d,$is_view3d" && "i[$thumb_mouse_over]} +str.=$basename_mo" ("{$thumb_mouse_over,f2ui(i[6])}" vertices, "{$thumb_mouse_over,f2ui(i[7])}" primitives)\n" +else +whds={$thumb_mouse_over,i[#$is_rotated,$thumb_mouse_over]%2?[h,w,d,s]:[w,h,d,s]} +str.=$basename_mo" ("{``$whds}")\n" +fi +fi +if $nb_images>1 +str.="#"{image_indices,i[$selected]}": " +fi +if $is_mesh3d" && "$is_view3d +str.=$basename" ("{$selected,f2ui(i[6])}" vertices, "{$selected,f2ui(i[7])}" primitives)" +else +whds={$selected,i[#$is_rotated,$selected]%2?[h,w,d,s]:[w,h,d,s]} +str.=$basename" ("{``$whds}")" +fi +font_size:=cut(round($canvas_height/40),16,32) +t. {``$str},0,0,$font_size,1,255 +fi +=> canvas_label_info +$0_rmn canvas_label +fi +if !0$canvas_label_coords" && "{$selected,w} +0 view_coords= str= +x,y,z={$selected,"floor( +$is_area2?[ lerp($area_xy_x0,$area_xy_x1,$area_mouse_x/$area_xy_width), +lerp($area_xy_y0,$area_xy_y1,$area_mouse_y/$area_xy_height), +cut($view_center_z*d,0,d - 1) ]: +$is_area3?[ lerp($area_xz_x0,$area_xz_x1,$area_mouse_x/$area_xz_width), +cut($view_center_y*h,0,h - 1), +lerp($area_xz_z0,$area_xz_z1,$area_mouse_y/$area_xz_height) ]: +$is_area4?[ cut($view_center_x*w,0,w - 1), +lerp($area_zy_y0,$area_zy_y1,$area_mouse_y/$area_zy_height), +lerp($area_zy_z0,$area_zy_z1,$area_mouse_x/$area_zy_width) ]: +[ -1,-1,-1 ])"} +view_xyz=$x,$y,$z +view_xy_disp={is_rotated,"const w1 = w#$selected - 1; const h1 = h#$selected - 1; ang = i[$selected]; +!ang?[ $x, $y ]:ang==1?[ $y, w1 - $x ]:ang==2?[ w1 - $x, h1 - $y ]:[ h1 - $y, $x ]"} +if narg($canvas_crop_x0)" || "narg($canvas_rect_x0) +if narg($canvas_crop_x0) +x0,y0,z0,x1,y1,z1=$canvas_crop_x0,$canvas_crop_y0,$canvas_crop_z0,$view_xyz +else +x0,y0,z0,x1,y1,z1=$canvas_rect_x0,$canvas_rect_y0,0,$canvas_rect_x1,$canvas_rect_y1,0 +fi +if $x0>$x1 x0,x1=$x1,$x0 fi +if $y0>$y1 y0,y1=$y1,$y0 fi +if $z0>$z1 z0,z1=$z1,$z0 fi +dx,dy,dz:=$x1-$x0,$y1-$y0,$z1-$z0 +view_xy0_disp={is_rotated,"const w1 = w#$selected - 1; const h1 = h#$selected - 1; ang = i[$selected]; +!ang?[ $x0, $y0 ]:ang==1?[ $y0, w1 - $x0 ]:ang==2?[ w1 - $x0, h1 - $y0 ]:[ h1 - $y0, $x0 ]"} +view_xy1_disp={is_rotated,"const w1 = w#$selected - 1; const h1 = h#$selected - 1; ang = i[$selected]; +!ang?[ $x1, $y1 ]:ang==1?[ $y1, w1 - $x1 ]:ang==2?[ w1 - $x1, h1 - $y1 ]:[ h1 - $y1, $x1 ]"} +view_dxy_disp={is_rotated,(i[$selected]%2?[$dy,$dx]:[$dx,$dy])+1} +if $is_volumetric +str="Box ( "$view_xy0_disp,$z0" ) - ( "$view_xy1_disp,$z1" ), Size = ( "$view_dxy_disp,{$dz+1}" )"\n"Length = "{_norm($dx,$dy,$dz)} +else +str="Box ( "$view_xy0_disp" ) - ( "$view_xy1_disp" ), Size = ( "$view_dxy_disp" )"\n"Length = "{_norm($dx,$dy)}", Angle = "{_rad2deg(atan2($y1-$y0,$x1-$x0))%360}"\260" +fi +else +if $is_volumetric view_xyz_disp=$view_xy_disp,$z else view_xyz_disp=$view_xy_disp fi +if {$selected,inrange($x,0,w,1,0)" && "inrange($y,0,h,1,0)" && "inrange($z,0,d,1,0)} +s_value={`"val = I(#$selected,$x,$y,$z); +size(val)<=6?v2s(val,-1):( +vals = vale = vector3(); +copy(vals,val,3); copy(vale,val[size(val)-3],3); +string(#256,v2s(vals,-1),', ... ,',v2s(vale,-1)); +)"`} +s_hex= +if {$selected,"s>4?0:(val = I($x,$y,$z); min(isint(val) & inrange(val,0,255)))"} +s_hex=" = \#"{$selected,`" +to_hex(x) = (ref(x,_x); _x<10?_'0'+_x:_'A'+_x-10); +res = vector(#2*s); +off = 0; repeat (s,k, val = i($x,$y,$z,k); res[off++] = to_hex(val>>4); res[off++] = to_hex(val&15)); +res"`} +fi +if $is_volumetric +str="Point ( "$view_xyz_disp" ) = [ "$s_value" ]"$s_hex +else +str="Point ( "$view_xyz_disp" ) = [ "$s_value" ]"$s_hex +fi +fi +fi +font_size:=cut(round($canvas_height/40),16,32) +t. {``$str},0,0,$font_size,1,255 +=> canvas_label_coords +$0_rmn canvas_label +fi +if !0$canvas_label_notification" && "['$notification']!=0 +font_size:=cut(round($window_height/40),16,32) +0 t. {``$notification},0,0,{round(1.25*$font_size)},1,255 +r. {[w,h]+20},1,1,0,0,0.5,0.5 frame. 2,2,255 r. {[w,h]+6},1,1,0,0,0.5,0.5 ++n. 200,255 r.. 100%,100%,1,3 +a[-2,-1] c +=> canvas_label_notification +notification_opacity,notification=3, +$0_rmn window_view +fi +if !0$canvas_label +0 +if $setting_is_info +if $canvas_label_info a. [canvas_label_info],y fi +if $canvas_label_coords a. [canvas_label_coords],y fi +fi +if w +r. {[w,h]+10},1,1,0,0,0.5,0.5 ++n. 150,255 r.. 100%,100%,1,3 a[-2,-1] c +fi +=> canvas_label +$0_rmn canvas_view +fi +if $window_record_frame>=0 +$0_rmn canvas_view +fi +if !0$canvas_view +[canvas_base] => canvas_view +if {$selected,!w}" || "$is_area1 +cursor[0] 1 +else +ix,iy,iz={$selected," +$is_area2?[ lerp($area_xy_x0,$area_xy_x1,$area_mouse_x/$area_width), +lerp($area_xy_y0,$area_xy_y1,$area_mouse_y/$area_height), +cut($view_center_z*d,0,d - 1) ]: +$is_area3?[ lerp($area_xz_x0,$area_xz_x1,$area_mouse_x/$area_width), +cut($view_center_y*h,0,h - 1), +lerp($area_xz_z0,$area_xz_z1,$area_mouse_y/$area_height) ]: +$is_area4?[ cut($view_center_x*w,0,w - 1), +lerp($area_zy_y0,$area_zy_y1,$area_mouse_y/$area_height), +lerp($area_zy_z0,$area_zy_z1,$area_mouse_x/$area_width) ]: +[ -1,-1,-1 ]"} +rix,riy,riz:=floor([$ix,$iy,$iz]); +is_cursor_over_image={$selected,(!$is_view3d" || "$is_volumetric)" && "(inrange($rix,0,w-1)" && "inrange($riy,0,h-1)" && "inrange($riz,0,d-1))} +if {$selected,!$is_cursor_over_image" || "!$setting_cursor" || "($setting_cursor==1" && "$is_volumetric)} +cursor[0] 1 +else +cursor[0] 0 +wxy2,hxy2:=[$area_xy_width,$area_xy_height]+2 +repeat $is_volumetric?3:1 { +cx,cy:=!$>?[($ix-$area_xy_x0)/$area_xy_dx*$area_xy_width,($iy-$area_xy_y0)/$area_xy_dy*$area_xy_height]:$>==1?[($ix-$area_xz_x0)/$area_xz_dx*$area_xz_width,($iz-$area_xz_z0)/$area_xz_dz*$area_xz_height]:[($iz-$area_zy_z0)/$area_zy_dz*$area_zy_width,($iy-$area_zy_y0)/$area_zy_dy*$area_zy_height] +if !$> +w1,h1:=[$area_xy_width,$area_xy_height]-1 +line[canvas_view] 0,$cy,$w1,$cy,0.65,0x00FF00FF,0 +line[canvas_view] 0,$cy,$w1,$cy,0.65,0xFF00FF00,255 +line[canvas_view] $cx,0,$cx,$h1,0.65,0x00FF00FF,0 +line[canvas_view] $cx,0,$cx,$h1,0.65,0xFF00FF00,255 +elif $>==1 +w1,h1:=[$area_xz_width,$area_xz_height]-1 +cy+=$hxy2 +if $cy>=$hxy2 +line[canvas_view] 0,$cy,$w1,$cy,0.65,0x00FF00FF,0 +line[canvas_view] 0,$cy,$w1,$cy,0.65,0xFF00FF00,255 +fi +line[canvas_view] $cx,$hxy2,$cx,100%,0.65,0x00FF00FF,0 +line[canvas_view] $cx,$hxy2,$cx,100%,0.65,0xFF00FF00,255 +elif $>==2 +w1,h1:=[$area_zy_width,$area_zy_height]-1 +cx+=$wxy2 +line[canvas_view] $wxy2,$cy,100%,$cy,0.65,0x00FF00FF,0 +line[canvas_view] $wxy2,$cy,100%,$cy,0.65,0xFF00FF00,255 +if $cx>=$wxy2 +line[canvas_view] $cx,0,$cx,$h1,0.65,0x00FF00FF,0 +line[canvas_view] $cx,0,$cx,$h1,0.65,0xFF00FF00,255 +fi +fi +} +fi +if $is_area234" && "$is_cursor_over_image +repeat $is_volumetric?3:1 { +dx,dy:=!$>?[$area_xy_width/$area_xy_dx,$area_xy_height/$area_xy_dy]:$>==1?[$area_xz_width/$area_xz_dx,$area_xz_height/$area_xz_dz]:[$area_zy_width/$area_zy_dz,$area_zy_height/$area_zy_dy] +dl:=max($dx,$dy) +if $dl>8 +opacity:=lerp(0,1,min(($dl-8)/10,1)) +cx,cy:=!$>?[($rix-$area_xy_x0)/$area_xy_dx*$area_xy_width,($riy-$area_xy_y0)/$area_xy_dy*$area_xy_height]:$>==1?[($rix-$area_xz_x0)/$area_xz_dx*$area_xz_width,($riz-$area_xz_z0)/$area_xz_dz*$area_xz_height]:[($riz-$area_zy_z0)/$area_zy_dz*$area_zy_width,($riy-$area_zy_y0)/$area_zy_dy*$area_zy_height] +ncx,ncy:=$cx+$dx,$cy+$dy +cx,cy,ncx,ncy:=ceil([$cx,$cy,$ncx-1,$ncy-1]) +if $setting_is_grid cx+=1 cy+=1 fi +if $>==1 cy,ncy+=$area_xy_height+2 elif $>==2 cx,ncx+=$area_xy_width+2 fi +if $is_volumetric ++z[canvas_view] $cx,$cy,$ncx,$ncy +rectangle. 0,0,100%,100%,$opacity,0x33333333,0 +rectangle. 0,0,100%,100%,$opacity,0xCCCCCCCC,255 +if isin($>,0,1)" && "$ncx>=$area_xy_width +x:=w-2-$ncx+$area_xy_width +z. 0,0,$x,100% +fi +if isin($>,0,2)" && "$ncy>=$area_xy_height +y:=h-2-$ncy+$area_xy_height +z. 0,0,100%,$y +fi +if $>==1" && "$cy<$area_xy_height+2 +y,cy:=a=$area_xy_height+2;[a-$cy,a] +if $y==2" && "$cx<$area_xy_width+2 +x,cx:=a=$area_xy_width+2;[a-$cx,a] +if $x?[($canvas_crop_x0-$area_xy_x0)/$area_xy_dx*$area_xy_width,($canvas_crop_y0-$area_xy_y0)/$area_xy_dy*$area_xy_height]:$>==1?[($canvas_crop_x0-$area_xz_x0)/$area_xz_dx*$area_xz_width,($canvas_crop_z0-$area_xz_z0)/$area_xz_dz*$area_xz_height]:[($canvas_crop_z0-$area_zy_z0)/$area_zy_dz*$area_zy_width,($canvas_crop_y0-$area_zy_y0)/$area_zy_dy*$area_zy_height] +cx1,cy1:=!$>?[($rix-$area_xy_x0)/$area_xy_dx*$area_xy_width,($riy-$area_xy_y0)/$area_xy_dy*$area_xy_height]:$>==1?[($rix-$area_xz_x0)/$area_xz_dx*$area_xz_width,($riz-$area_xz_z0)/$area_xz_dz*$area_xz_height]:[($riz-$area_zy_z0)/$area_zy_dz*$area_zy_width,($riy-$area_zy_y0)/$area_zy_dy*$area_zy_height] +cx1,cy1:=$cx1+$dx,$cy1+$dy +cx0,cy0,cx1,cy1:=ceil([$cx0,$cy0,$cx1-1,$cy1-1]) +if $>==1 cy0,cy1+=$area_xy_height+2 elif $>==2 cx0,cx1+=$area_xy_width+2 fi +rectangle[canvas_view] $cx0,$cy0,$cx1,$cy1,0.5,128 +rectangle[canvas_view] $cx0,$cy0,$cx1,$cy1,0.75,0x33333333,0 +rectangle[canvas_view] $cx0,$cy0,$cx1,$cy1,0.75,0xCCCCCCCC,255 +line[canvas_view] $cx0,$cy0,$cx1,$cy1,0.75,0xF0F0F0F0,0 +line[canvas_view] $cx0,$cy0,$cx1,$cy1,0.75,0x0F0F0F0F,255 +fi +} +fi +if $is_area2" && "narg($canvas_rect_x0)" && "!narg($canvas_crop_x0) +x0:=($canvas_rect_x0-$area_xy_x0)/$area_xy_dx*$canvas_width +y0:=($canvas_rect_y0-$area_xy_y0)/$area_xy_dy*$canvas_height +x1:=($canvas_rect_x1-$area_xy_x0)/$area_xy_dx*$canvas_width +y1:=($canvas_rect_y1-$area_xy_y0)/$area_xy_dy*$canvas_height +if $x0>$x1 x0,x1=$x1,$x0 fi +if $y0>$y1 y0,y1=$y1,$y0 fi +x0,y0,x1,y1:=ceil([$x0,$y0,$x1,$y1]) +x1+=$canvas_width/$area_xy_dx-1 +y1+=$canvas_height/$area_xy_dy-1 +if $is_setting_is_grid x0+=1 x1+=1 fi +rectangle[canvas_view] $x0,$y0,$x1,$y1,0.5,128 +rectangle[canvas_view] $x0,$y0,$x1,$y1,0.75,0x33333333,0 +rectangle[canvas_view] $x0,$y0,$x1,$y1,0.75,0xCCCCCCCC,255 +dx,dy:=0.5*[$canvas_width,$canvas_height]/[$area_xy_dx,$area_xy_dy] +x0,y0,x1,y1+=$dx,$dy,-$dx+1,-$dy+1 +line[canvas_view] $x0,$y0,$x1,$y1,0.75,0xF0F0F0F0,0 +line[canvas_view] $x0,$y0,$x1,$y1,0.75,0x0F0F0F0F,255 +fi +fi +if $is_volumetric +if !narg($canvas_cross_button) +21,21,1,4 circle. 50%,50%,10,1,0,0,0,255 circle. 50%,50%,8,1,200,200,200,255 +=> canvas_cross_button +fi +sh[canvas_cross_button] 100% +j[canvas_view] [canvas_cross_button],{canvas_cross_button,round([$canvas_cross_x*$canvas_width-w/2,$canvas_cross_y*$canvas_height-h/2])},0,0,0.5,.,255 rm. +fi +if {canvas_label,w} +sh[canvas_label] 100% +j[canvas_view] [canvas_label],0,$canvas_label_alignment~,0,0,1,.,255 rm. +fi +$0_rmn window_view +fi +if !0$window_view +$window_width,$window_height,1,3 => window_view +if $thumb_is_visible +j[window_view] [thumb_view] +fi +j[window_view] [canvas_view],0,$thumb_height2 +if $window_record_frame>=0 +if !$window_record_frame +if $is_opencv +repeat 256 { filename_animation=${"filename gmic.mp4,"$>} if !isfile('$filename_animation') break fi } +else +repeat 256 { +filename_animation=${"filename gmic.jpg,"$>,0} +if !isfile('$filename_animation') filename_animation=${"filename gmic.jpg",$>} break fi } +fi +notification="Start recording: "$filename_animation +$0_rmn canvas_label_notification +fi +font_size:=cut(round($canvas_height/40),16,32) +if $is_opencv +if {window_view,max([w,h]%2)} ++r[window_view] {[w,h]+([w,h]%2)},1,100%,0 o. $filename_animation,20,0,1 rm. +else +o[window_view] $filename_animation,20,0,1 +fi +else +o[window_view] ${"filename "$filename_animation,$window_record_frame},75 +fi +0 t. "Frame \#"$window_record_frame,0,0,$font_size,1,255 ++dilate. 3 !=. 0 r.. 100%,100%,1,3 +j[window_view] ..,{window_view,[w,h]-[w#-1,h#-1]-5},0,0,0.75,.,1 rm[-2,-1] +window_record_frame+=1 +window_no_wait=1 +fi +if $canvas_label_notification +sh[canvas_label_notification] 100% +j[window_view] [canvas_label_notification],1~,0,0,0,{min(1,$notification_opacity)},.,255 +rm. +window_no_wait=1 +fi +w[window_view] +fi +if $window_no_wait wait 40 else wait fi +is_CTRL,is_SHIFT:={*,CTRLLEFT}" || "{*,CTRLRIGHT},{*,SHIFTLEFT}" || "{*,SHIFTRIGHT} +previous_mouse_x,previous_mouse_y,previous_mouse_area=$mouse_x,$mouse_y,$mouse_area +mouse_x,mouse_y,mouse_button={*,x,y,b} +mouse_area,canvas_mouse_x,canvas_mouse_y:=" +const x = $mouse_x; +const y = $mouse_y; +const ht = $thumb_height; +const ht2 = $thumb_height2; +x<0?[0,-1,-1]: +y}" && "$mouse_area" && "!${is_clicked$>} +is_clicked$>,is_released$>,is_drag$>=$mouse_area,0,0 +drag_start_x$>,drag_start_y$>,drag_end_x$>,drag_end_y$>=$mouse_x,$mouse_y,$mouse_x,$mouse_y +elif ${is_button$>}" && "$mouse_area" && "${is_clicked$>} +drag_end_x$>,drag_end_y$>=$mouse_x,$mouse_y +if !${is_drag$>} +is_drag$>:=norm(${drag_end_x$>}-${drag_start_x$>},${drag_end_y$>}-${drag_start_y$>})>5?$mouse_area:0 +fi +elif !${is_button$>}" && "$mouse_area" && "${is_clicked$>} +is_clicked$>,is_released$>=0,$mouse_area +drag_end_x$>,drag_end_y$>=$mouse_x,$mouse_y +elif $mouse_area" && "!${is_clicked$>} +is_drag$>=0 +fi +} +previous_selected=$selected +if $thumb_is_visible +if $is_drag0==1" && "$is_clicked0==1 +n_thumb_x:=cut($thumb_x-($drag_end_x0-$drag_start_x0)/$thumb_sumw,-16/$thumb_sumw,$thumb_x_px_max/$thumb_sumw) +if $n_thumb_x!=$thumb_x thumb_x=$n_thumb_x drag_start_x0=$drag_end_x0 $0_rmn thumb_view fi +elif $is_drag0==1" && "($is_released0" || "!$mouse_area) +is_drag0,is_released0=0 +fi +if $is_area1 +canvas_label_alignment=0 +ind={thumb_index_map,i[$mouse_x]} +if $ind>=0 +if $ind!=$thumb_mouse_over thumb_mouse_over=$ind $0_rmn thumb_view,canvas_label_info fi +if !$is_drag0" && "$is_released0 +if $selected!=$ind selected=$ind $0_rmn thumb_view,canvas_label_info fi +fi +fi +else +if $thumb_mouse_over>=0 $0_rmn thumb_view,canvas_label_info fi +thumb_mouse_over=-1 +fi +fi +if $nb_images>1 +if (($is_area1" || "$is_CTRL)" && "({*,ARROWLEFT}" || "{*,ARROWRIGHT}" || "{*,ARROWUP}" || "{*,ARROWDOWN}" || "{*,PAGEUP}" || "{*,PAGEDOWN}" || "{*,HOME}" || "{*,END}" || "{*,H}" || "{*,E}))" || "{*,SPACE}" || "{*,BACKSPACE}" || "{*,B} +step:={*,-ARROWLEFT}||{*,-ARROWUP}||{*,BACKSPACE}||{*,B}?($is_SHIFT?-4:-1):{*,-ARROWRIGHT}||{*,-ARROWDOWN}||{*,SPACE}?($is_SHIFT?4:1):{*,-PAGEUP}?-max(2,round($nb_images/16))*($is_SHIFT?4:1):{*,-PAGEDOWN}?max(2,round($nb_images/16))*($is_SHIFT?4:1):{*,-HOME}||{*,-H}?-$selected:{*,-END}||{*,-E}?$nb_images-1-$selected:0 +if {*,-BACKSPACE}" || "{*,-SPACE}" || "{*,-B} selected:=($selected+$step)%$nb_images +else selected:=cut($selected+$step,0,$nb_images-1) +fi +$0_rmn thumb_view,canvas_label_info +elif ($is_area1" || "$is_CTRL)" && "({*,0}" || "{*,1}" || "{*,2}" || "{*,3}" || "{*,4}" || "{*,5}" || "{*,6}" || "{*,7}" || "{*,8}" || "{*,9}" || "{*,PAD0}" || "{*,PAD1}" || "{*,PAD2}" || "{*,PAD3}" || "{*,PAD4}" || "{*,PAD5}" || "{*,PAD6}" || "{*,PAD7}" || "{*,PAD8}" || "{*,PAD9}) +ind=-1 repeat 10 { if {*,$>}" || "{*,PAD$>} ind=$> break fi } +if inrange($ind,0,$nb_images,1,0)" && "$selected!=$ind +selected=$ind +$0_rmn thumb_view,canvas_label_info +skip {*,-PAD$ind},{*,-$ind} +fi +fi +if $is_area1 +if {*,o} +step:={*,-o}*max(1,round($nb_images/32)) +selected:=cut($selected+$step,0,$nb_images-1) +$0_rmn thumb_view,canvas_label_info +elif !$is_CTRL" && "{*,C} +selected:=floor($nb_images/2) +$0_rmn thumb_view,canvas_label_info +fi +fi +if $selected!=$previous_selected +canvas_crop_x0,canvas_crop_y0,canvas_crop_z0,canvas_rect_x0,canvas_rect_y0,canvas_rect_x1,canvas_rect_y1= +drag_start_x0,drag_start_y0,drag_end_x0,drag_end_y0= +is_clicked0,is_clicked1,is_clicked2,is_release0,is_release1,is_release2,is_drag0,is_drag1,is_drag2=0 +if $thumb_is_visible +x0,w={thumb_coords,[i(0,$selected,0,0),i(0,$selected,0,2)]} +if $x0<$thumb_x_px thumb_x:=($x0-48)/$thumb_sumw +elif $x0+$w>=$thumb_x_px+$window_width thumb_x:=($x0+$w-$window_width+48)/$thumb_sumw +fi +fi +pw,ph,pd={$previous_selected,i[#$is_rotated,$previous_selected]%2?[h,w,d]:[w,h,d]} +w,h,d={$selected,i[#$is_rotated,$selected]%2?[h,w,d]:[w,h,d]} +if [$w,$h,$d]!=[$pw,$ph,$pd] +whd={$previous_selected,`string($pw,'_',$ph,'_',$pd)`} +view_coords_$whd=$view_center_x,$view_center_y,$view_center_z,$view_zoom,$view_base_channel,$view_is_rotated,$canvas_cross_x,$canvas_cross_y +whd={$selected,`string($w,'_',$h,'_',$d)`} +if narg(${view_coords_$whd}) +view_center_x,view_center_y,view_center_z,view_zoom,view_base_channel,view_is_rotated,canvas_cross_x,canvas_cross_y=${view_coords_$whd} +else +view_center_x,view_center_y,view_center_z,view_zoom,view_base_channel,view_is_rotated,canvas_cross_x,canvas_cross_y=0.5,0.5,0.5,1,0,0,, +fi +fi +$0_rmn canvas_volumetric_background,canvas_base,area_3d_mesh +fi +fi +if {$selected,w" && "($is_volumetric" || "!$is_view3d)} +zoom_1_1,zoom_min,zoom_max={$selected," +const mw4 = max(w,4); const mh4 = max(h,4); const md4 = max(d,4); +const M = max(mw4/$area_xy_width,mh4/$area_xy_height); +[ M,min(M,0.25),M*max($area_xy_width,$area_xy_height,$area_xz_height,$area_zy_width)/min(max(w,h,d),12) ]"} +pan_x_min,pan_x_max,pan_y_min,pan_y_max,pan_z_min,pan_z_max={$selected," +const mw4 = max(w,4); const mh4 = max(h,4); const md4 = max(d,4); +const delta = 0.5/$view_zoom*min(mw4/$area_xy_width,mh4/$area_xy_height,md4/$area_xz_height,md4/$area_zy_width); +const delta_x = ceil(delta*$area_xy_width/w); +const delta_y = ceil(delta*$area_xy_height/h); +const delta_z = ceil(delta*min($area_xz_height,$area_zy_width)/d); +[ w==1?[ 0.5,0.5 ]:[ min(0,1 - delta_x), max(1,delta_x) ], +h==1?[ 0.5,0.5 ]:[ min(0,1 - delta_y), max(1,delta_y) ], +d==1?[ 0.5,0.5 ]:[ min(0,1 - delta_z), max(1,delta_z) ] ]"} +repeat 2 { +but:=2*$> +if !$but" && "$is_CTRL continue fi +if isin($event_type0,0,1)" && "inrange(${is_drag$but},2,4)" && "inrange(${is_clicked$but},2,4) +drag_dx,drag_dy:=[${drag_end_x$but},${drag_end_y$but}]-[${drag_start_x$but},${drag_start_y$but}] +ar=${is_drag$but} +if $ar==2 +view_center_x-=$drag_dx/$area_width*$area_dx/w#$selected +view_center_y-=$drag_dy/$area_height*$area_dy/h#$selected +elif $ar==3 +view_center_x-=$drag_dx/$area_width*$area_dx/w#$selected +view_center_z-=$drag_dy/$area_height*$area_dy/d#$selected +elif $ar==4 +view_center_z-=$drag_dx/$area_width*$area_dx/d#$selected +view_center_y-=$drag_dy/$area_height*$area_dy/h#$selected +fi +view_center_x,view_center_y,view_center_z:=[cut($view_center_x,$pan_x_min,$pan_x_max),cut($view_center_y,$pan_y_min,$pan_y_max),cut($view_center_z,$pan_z_min,$pan_z_max)] +drag_start_x$but,drag_start_y$but=${drag_end_x$but},${drag_end_y$but} +event_type0=1 +$0_rmn canvas_base,area_3d_mesh +elif $event_type0==1" && "${is_drag$but}==2" && "${is_released$but} +event_type0,is_drag0,is_released0,is_drag2,is_released2=0 +fi +} +if !$is_volumetric" && "$is_CTRL" && "$mouse_x>=0 +if isin($event_type0,0,2)" && "$is_drag0==2" && "$is_clicked0==2" && "!narg($canvas_crop_x0) +if !narg($canvas_rect_x0) x,y=$drag_start_x0,$drag_start_y0 else x,y=$drag_end_x0,$drag_end_y0 fi +cx,cy={$selected,[cut(floor(lerp($area_xy_x0,$area_xy_x1,$x/$canvas_width)),0,w-1),cut(floor(lerp($area_xy_y0,$area_xy_y1,($y-$thumb_height2)/$canvas_height)),0,h-1)]} +if !narg($canvas_rect_x0) +canvas_rect_x0,canvas_rect_y0,canvas_rect_x1,canvas_rect_y1=$cx,$cy,$cx,$cy +$0_rmn canvas_label_coords +elif [$cx,$cy]!=[$canvas_rect_x1,$canvas_rect_y1] +canvas_rect_x1,canvas_rect_y1=$cx,$cy +$0_rmn canvas_label_coords +fi +n_view_center_x,n_view_center_y=$view_center_x,$view_center_y +if $canvas_mouse_x<64 +n_view_center_x-={$selected,lerp(128,8,$canvas_mouse_x/64)/$view_zoom/w} +elif $canvas_mouse_x>=$canvas_width-64 +n_view_center_x+={$selected,lerp(128,8,($canvas_width-$canvas_mouse_x)/64)/$view_zoom/w} +fi +if $canvas_mouse_y<64 +n_view_center_y-={$selected,lerp(128,8,$canvas_mouse_y/64)/$view_zoom/h} +elif $canvas_mouse_y>=$canvas_height-64 +n_view_center_y+={$selected,lerp(128,8,($canvas_height-$canvas_mouse_y)/64)/$view_zoom/h} +fi +n_view_center_x,n_view_center_y:=[cut($n_view_center_x,$pan_x_min,$pan_x_max),cut($n_view_center_y,$pan_y_min,$pan_y_max)] +if [$n_view_center_x,$n_view_center_y]!=[$view_center_x,$view_center_y] +view_center_x,view_center_y=$n_view_center_x,$n_view_center_y +is_rect_scroll=1 +$0_rmn canvas_base +else +is_rect_scroll=0 +fi +event_type0=2 +fi +fi +if $event_type0==2" && "$is_drag0==2" && "$is_released0" && "!narg($canvas_crop_x0) +if $canvas_rect_x0>$canvas_rect_x1 canvas_rect_x0,canvas_rect_x1=$canvas_rect_x1,$canvas_rect_x0 fi +if $canvas_rect_y0>$canvas_rect_y1 canvas_rect_y0,canvas_rect_y1=$canvas_rect_y1,$canvas_rect_y0 fi +if max($canvas_rect_x1-$canvas_rect_x0,$canvas_rect_y1-$canvas_rect_y0)>8 +view_center_x,view_center_y,view_zoom={$selected," +const wc = $canvas_width; +const hc = $canvas_height; +const f = 0.5*max(w/wc,h/hc); +[ cut(0.5*($canvas_rect_x0 + $canvas_rect_x1)/w,0,1), +cut(0.5*($canvas_rect_y0 + $canvas_rect_y1)/h,0,1), +2*f*min(wc/max(8,$canvas_rect_x1 - $canvas_rect_x0), +hc/max(8,$canvas_rect_y1 - $canvas_rect_y0)) ]"} +$0_rmn canvas_base +fi +canvas_rect_x0,canvas_rect_y0,canvas_rect_x1,canvas_rect_y1= +event_type0,is_drag0,is_released0=0 +$0_rmn canvas_label_coords +fi +if inrange($is_drag1,2,4)" && "inrange($is_clicked1,2,4) +amount:=" +dx = $drag_end_x1 - $drag_start_x1; +dy = $drag_end_y1 - $drag_start_y1; +sign(dx)*norm(dx,dy)/200" +if !narg($zoom_focus_x) zoom_focus_x,zoom_focus_y=$area_mouse_x,$area_mouse_y fi +n_view_zoom:=cut($view_zoom*(1+$amount),$zoom_min,$zoom_max) +ratio:=$view_zoom/$n_view_zoom +if $n_view_zoom!=$view_zoom +if !$is_volumetric +if $is_drag1==2 +xc:=lerp($area_xy_x0,$area_xy_x1,$zoom_focus_x/$area_width) +yc:=lerp($area_xy_y0,$area_xy_y1,$zoom_focus_y/$area_height) +view_center_x:=cut(lerp($xc,$view_center_x*w#$selected,$ratio)/w#$selected,$pan_x_min,$pan_x_max) +view_center_y:=cut(lerp($yc,$view_center_y*h#$selected,$ratio)/h#$selected,$pan_y_min,$pan_y_max) +elif $is_drag1==3 +xc:=lerp($area_xz_x0,$area_xz_x1,$zoom_focus_x/$area_width) +zc:=lerp($area_xz_z0,$area_xz_z1,$zoom_focus_y/$area_height) +view_center_x:=cut(lerp($xc,$view_center_x*w#$selected,$ratio)/w#$selected,$pan_x_min,$pan_x_max) +view_center_z:=cut(lerp($zc,$view_center_z*d#$selected,$ratio)/d#$selected,$pan_z_min,$pan_z_max) +elif $is_drag1==4 +zc:=lerp($area_zy_z0,$area_zy_z1,$zoom_focus_x/$area_width) +yc:=lerp($area_zy_y0,$area_zy_y1,$zoom_focus_y/$area_height) +view_center_z:=cut(lerp($zc,$view_center_z*d#$selected,$ratio)/d#$selected,$pan_z_min,$pan_z_max) +view_center_y:=cut(lerp($yc,$view_center_y*h#$selected,$ratio)/h#$selected,$pan_y_min,$pan_y_max) +fi +fi +view_zoom=$n_view_zoom +$0_rmn canvas_base +fi +drag_start_x1,drag_start_y1=$drag_end_x1,$drag_end_y1 +elif inrange($is_drag1,2,5)" && "$is_released1 +zoom_focus_x,zoom_focus_y= +is_drag1,is_released1=0 +fi +if $is_volumetric +if $is_clicked0>=2" && "$canvas_mouse_x>=0" && "($event_type0==3" || "(!$event_type0" && "narg($canvas_cross_x)" && "norm($canvas_mouse_x-$canvas_cross_x*$canvas_width,$canvas_mouse_y-$canvas_cross_y*$canvas_height)<16)) +is_drag0=$mouse_area +canvas_cross_x,canvas_cross_y:=cut($canvas_mouse_x/$canvas_width,0,1),cut($canvas_mouse_y/$canvas_height,0,1) +drag_start_x0,drag_start_y0=$drag_end_x0,$drag_end_y0 +event_type0=3 +$0_rmn canvas_volumetric_background,canvas_base,area_3d_view +elif $event_type0==3" && "$is_drag0>=2" && "$is_released1 +event_type0,is_drag0,is_released0=0 +fi +fi +if $event_type0" && "!$is_clicked0" && "!$is_released0" && "!$is_drag0 +event_type0=0 +$0_rmn canvas_view +fi +if $is_area234 +if {*,o}" || "({*,PADSUB}" || "{*,PADADD}) +if $is_CTRL" && "$is_volumetric +amount:={*,PADADD}?1:{*,PADSUB}?-1:{*,-o} +view_center_x,view_center_y,view_center_z={$selected," +const cx = $view_center_x; +const cy = $view_center_y; +const cz = $view_center_z; +const amount = $amount; +P = $is_area2?[ cx,cy,cz + amount/d ]: +$is_area3?[ cx,cy + amount/d,cz ]: +[ cx + amount/w,cy,cz ]; +[ cut(P[0],$pan_x_min,$pan_x_max), +cut(P[1],$pan_y_min,$pan_y_max), +cut(P[2],$pan_z_min,$pan_z_max) ]"} +$0_rmn canvas_base,area_3d_mesh +else +amount:={*,PADADD}?0.25:{*,PADSUB}?-0.25:{*,-o}/5 +n_view_zoom:=cut($view_zoom*(1+$amount),$zoom_min,$zoom_max) +ratio:=$view_zoom/$n_view_zoom +if $n_view_zoom!=$view_zoom +xc,yc,zc={$selected,"$is_volumetric?( +$is_area2?[ ($area_xy_x0 + $area_xy_x1)/2, ($area_xy_y0 + $area_xy_y1)/2, $view_center_z*d ]: +$is_area3?[ ($area_xz_x0 + $area_xz_x1)/2, $view_center_y*h, ($area_xz_z0 + $area_xz_z1)/2 ]: +[ $view_center_x*w, ($area_zy_y0 + $area_zy_y1)/2, ($area_zy_z0 + $area_zy_z1)/2 ]): +[ lerp($area_xy_x0,$area_xy_x1,$area_mouse_x/$area_width), +lerp($area_xy_y0,$area_xy_y1,$area_mouse_y/$area_height), 0 ]"} +view_center_x:=cut(lerp($xc,$view_center_x*w#$selected,$ratio)/w#$selected,$pan_x_min,$pan_x_max) +view_center_y:=cut(lerp($yc,$view_center_y*h#$selected,$ratio)/h#$selected,$pan_y_min,$pan_y_max) +view_center_z:=cut(lerp($zc,$view_center_z*d#$selected,$ratio)/d#$selected,$pan_z_min,$pan_z_max) +view_zoom=$n_view_zoom +$0_rmn canvas_base +fi +fi +fi +if !$is_CTRL +if ({*,0}" || "{*,1}" || "{*,2}" || "{*,3}" || "{*,4}" || "{*,5}" || "{*,6}" || "{*,7}" || "{*,8}" || "{*,9}" || "{*,PAD0}" || "{*,PAD1}" || "{*,PAD2}" || "{*,PAD3}" || "{*,PAD4}" || "{*,PAD5}" || "{*,PAD6}" || "{*,PAD7}" || "{*,PAD8}" || "{*,PAD9}) +ind=-1 repeat 10 { if {*,$>}" || "{*,PAD$>} ind=$> break fi } +if $ind>=0 +view_zoom_mode:=($ind-1)%10 +n_view_zoom:=cut(arg0($view_zoom_mode,$zoom_1_1,2*$zoom_1_1,4*$zoom_1_1,1,2,4,$zoom_max/8,$zoom_max/4,$zoom_max/2,$zoom_max),$zoom_min,$zoom_max) +if $n_view_zoom!=$view_zoom view_zoom=$n_view_zoom $0_rmn canvas_base fi +notification="Zoom: "${"arg0 "$view_zoom_mode,"1:1,2:1,4:1,x1,x2,x4,Max/8,Max/4,Max/2,Max"} +$0_rmn canvas_label_notification +skip {*,-PAD$ind},{*,-$ind} +fi +elif {*,-END} +view_center_x,view_center_y,view_center_z={$selected,1-0.5/[w,h,d]} +$0_rmn canvas_base,area_3d_mesh +elif {*,-HOME} +view_center_x,view_center_y,view_center_z={$selected,0.5/[w,h,d]} +$0_rmn canvas_base,area_3d_mesh +elif {*,-K} +setting_background:={$setting_background+1}%10 +str=${"arg0 "$setting_background>>1,"Black,\"Dark gray\",Gray,\"Light gray\",White"} +if $setting_background&1 str.=" checkerboard" fi +notification="Background: "$str +$0_rmn canvas_background,canvas_label_notification +elif {*,-P}" && "['$view_xyz']!=0 ++e "Command 'display': I(#"$selected,$view_xyz_disp") = [ "{$selected,I($view_xyz)}" ]" +elif ({*,PAGEUP}" || "{*,PAGEDOWN})" && "{$selected,s>3}" && "!$setting_alpha +n_view_base_channel={$selected,cut($view_base_channel+({*,-PAGEUP}?1:{*,-PAGEDOWN}?-1:0),0,s-3)} +if $n_view_base_channel!=$view_base_channel +view_base_channel=$n_view_base_channel +notification="Base channel: "$view_base_channel +$0_rmn canvas_base,canvas_label_notification +fi +elif $is_area234" && "({*,ARROWLEFT}" || "{*,ARROWRIGHT}" || "{*,ARROWUP}" || "{*,ARROWDOWN}) +step:=$is_volumetric" || "$view_zoom>=$zoom_max/4?1:($area_xy_dx+$area_xy_dy)/40 +dx,dy:={*,ARROWLEFT}?-$step:{*,ARROWRIGHT}?$step:0,{*,ARROWUP}?-$step:{*,ARROWDOWN}?$step:0 +if $is_SHIFT dx,dy*=4 fi +if $is_area2 dx,dy,dz={$selected,[$dx/w,$dy/h,0]} +elif $is_area3 dx,dy,dz={$selected,[$dx/w,0,$dy/d]} +else dx,dy,dz={$selected,[0,$dy/h,$dx/d]} +fi +view_center_x:=cut($view_center_x+$dx,$pan_x_min,$pan_x_max) +view_center_y:=cut($view_center_y+$dy,$pan_y_min,$pan_y_max) +view_center_z:=cut($view_center_z+$dz,$pan_z_min,$pan_z_max) +$0_rmn canvas_base,area_3d_mesh +fi +fi +if [$mouse_x,$mouse_y]!=[$previous_mouse_x,$previous_mouse_y]" && "$is_area234 +$0_rmn canvas_label_coords +fi +elif inrange($previous_mouse_area,2,4) +$0_rmn canvas_label_coords +fi +if {*,-A} +setting_alpha:=($setting_alpha+1)%5 +notification="Alpha: "${"arg0 "$setting_alpha,"Off,On,\"Over black\",\"Over gray\",\"Over white\""} +$0_flush_thumb_cache +$0_rmn canvas_base,canvas_label_notification +elif {*,-G} +setting_is_grid:=!$setting_is_grid +notification="Grid: "${"arg0 "$setting_is_grid,"Off,On"} +$0_rmn canvas_base,canvas_label_notification +elif {*,-H} +view_center_x,view_center_y,view_center_z={$selected,0.5/[w,h,d]} +$0_rmn canvas_base,area_3d_mesh +elif {*,-E} +view_center_x,view_center_y,view_center_z={$selected,1-0.5/[w,h,d]} +$0_rmn canvas_base,area_3d_mesh +elif {*,-N} +setting_normalization:=($setting_normalization+1)%5 +notification="Normalization: "${"arg0 "$setting_normalization,"Off,Cut,\"Stretch (channelwise)\",\"Stretch (global)\",\"Stretch (global once)\""} +$0_flush_thumb_cache +$0_rmn canvas_base,canvas_label_notification +elif {*,-R} +view_is_rotated:=($view_is_rotated+1)%4 +notification="Angle: "{$view_is_rotated*90}\260 +$0_rmn canvas_base,canvas_label_info,canvas_label_notification,area_3d_mesh +elif {*,-V} +x,y,z=$view_xyz +if !narg($canvas_crop_x0) +canvas_crop_x0,canvas_crop_y0,canvas_crop_z0=$x,$y,$z +notification="Start crop" +else +x0,y0,z0,x1,y1,z1:=" +x0 = $canvas_crop_x0; y0 = $canvas_crop_y0; z0 = $canvas_crop_z0; +x1 = $x; y1 = $y; z1 = $z; +x0>x1?swap(x0,x1); +y0>y1?swap(y0,y1); +z0>z1?swap(z0,z1); +[ x0,y0,z0,x1,y1,z1 ]" +notification="End crop" +z[$selected] $x0,$y0,$z0,$x1,$y1,$z1 +canvas_crop_x0,canvas_crop_y0,canvas_crop_z0= +view_center_x,view_center_y,view_center_z,view_zoom,view_3d_zoom=0.5,0.5,0.5,1,1 +if $is_volumetric $0_rmn area_3d_mesh fi +=[thumb_is_cached] 0,0,$selected +$0_rmn thumb_view,canvas_base,canvas_label_info +fi +$0_rmn canvas_label_notification +elif !$is_CTRL" && "{*,X}" && "$is_volumetric +canvas_cross_x,canvas_cross_y= +$0_rmn canvas_volumetric_background,canvas_base,area_3d_view +skip {*,-X} +elif {*,-Z} +view_zoom_mode:=($view_zoom_mode+1)%10 +n_view_zoom:=cut(arg0($view_zoom_mode,$zoom_1_1,2*$zoom_1_1,4*$zoom_1_1,1,2,4,$zoom_max/8,$zoom_max/4,$zoom_max/2,$zoom_max),$zoom_min,$zoom_max) +if $n_view_zoom!=$view_zoom view_zoom=$n_view_zoom $0_rmn canvas_base fi +notification="Zoom: "${"arg0 "$view_zoom_mode,"1:1,2:1,4:1,x1,x2,x4,Max/8,Max/4,Max/2,Max"} +$0_rmn canvas_label_notification +fi +fi +if {canvas_label,($canvas_mouse_x5*h)} +canvas_label_alignment:=!$canvas_label_alignment +$0_rmn canvas_view +fi +if $is_view3d +if !$is_CTRL" && "isin($event_type0,0,4)" && "$is_drag0==5" && "$is_clicked0==5 +eval " +const w2 = $area_3d_width/2; +const h2 = $area_3d_height/2; +const radius = 0.75*min(w2,h2); +const offx = $area_xy_width + ($is_volumetric?2:0); +const offy = $thumb_height2 + $area_xy_height + ($is_volumetric?2:0); +const u0 = $drag_start_x0 - offx - w2; +const v0 = $drag_start_y0 - offy - h2; +const u1 = $drag_end_x0 - offx - w2; +const v1 = $drag_end_y0 - offy - h2; +n0 = norm(u0,v0); +nu0 = n0>radius?u0*radius/n0:u0; +nv0 = n0>radius?v0*radius/n0:v0; +nw0 = sqrt(max(0,radius^2 - nu0^2 - nv0^2)); +n1 = norm(u1,v1); +nu1 = n1>radius?u1*radius/n1:u1; +nv1 = n1>radius?v1*radius/n1:v1; +nw1 = sqrt(max(0,radius^2 - nu1^2 - nv1^2)); +u = nv0*nw1 - nw0*nv1; +v = nw0*nu1 - nu0*nw1; +w = nv0*nu1 - nu0*nv1; +n = norm(u,v,w); +R = rot(u,v,w,-asin(n/radius^2)); +R = mul(R,crop(#$view_3d_pose,0,0,3,3),3); +draw(#$view_3d_pose,R,0,0,3,3)" +drag_start_x0,drag_start_y0=$drag_end_x0,$drag_end_y0 +$0_rmn area_3d_view +area_3d_is_motion=1 +event_type0=4 +elif $event_type0==4" && "$is_drag0==5" && "$is_released0 +event_type0,is_drag0,is_released0=0 +fi +pan_3d_x_min,pan_3d_x_max,pan_3d_y_min,pan_3d_y_max:=" +const w = $area_3d_width; +const h = $area_3d_height; +const mwh = min(w,h); +[ -0.47*$view_3d_zoom, 0.47*$view_3d_zoom, -0.47*$view_3d_zoom, 0.47*$view_3d_zoom ]" +repeat 2 { +but:=2*$> +if !$but" && "!$is_CTRL continue fi +if isin($event_type0,0,5)" && "${is_drag$but}==5" && "${is_clicked$but}==5 +drag_dx,drag_dy:=[${drag_end_x$but},${drag_end_y$but}]-[${drag_start_x$but},${drag_start_y$but}] +eval " +const mwh = min($area_3d_width,$area_3d_height); +i[#$view_3d_pose,3] = cut(i[#$view_3d_pose,3] + $drag_dx/mwh,$pan_3d_x_min,$pan_3d_x_max); +i[#$view_3d_pose,7] = cut(i[#$view_3d_pose,7] + $drag_dy/mwh,$pan_3d_y_min,$pan_3d_y_max)" +drag_start_x$but,drag_start_y$but=${drag_end_x$but},${drag_end_y$but} +area_3d_is_motion=1 +event_type0=5 +$0_rmn area_3d_view +elif $event_type0==5" && "${is_drag$but}==5" && "${is_released$but} +event_type0,is_drag0,is_released0,is_drag2,is_released2=0 +fi +} +zoom_3d_min,zoom_3d_max=0.1,10 +if {*,o}" || "($is_drag1==5" && "$is_clicked1==5)" || "{*,PADADD}" || "{*,PADSUB} +amount:="const mw = "{*,-o}"; +mw?mw: +"{*,-PADADD}"?3: +"{*,-PADSUB}"?-3:( +const dx = $drag_end_x1 - $drag_start_x1; +const dy = $drag_end_y1 - $drag_start_y1; +sign(dx)*norm(dx,dy)/10)" +n_view_3d_zoom:=cut($view_3d_zoom*1.05^$amount,$zoom_3d_min,$zoom_3d_max) +if $n_view_3d_zoom!=$view_3d_zoom +eval " +const mwh = min($area_3d_width,$area_3d_height); +const mx = $is_volumetric?0:$area_mouse_x - $area_width/2; +const my = $is_volumetric?0:$area_mouse_y - $area_height/2; +tx = i[#$view_3d_pose,3]; +ty = i[#$view_3d_pose,7]; +x = (mx/mwh - tx)/$view_3d_zoom; +y = (my/mwh - ty)/$view_3d_zoom; +const dalpha = $view_3d_zoom - $n_view_3d_zoom; +i[#$view_3d_pose,3] = cut(dalpha*x + tx,$pan_3d_x_min,$pan_3d_x_max); +i[#$view_3d_pose,7] = cut(dalpha*y + ty,$pan_3d_x_min,$pan_3d_x_max)" +drag_start_x1,drag_start_y1=$drag_end_x1,$drag_end_y1 +view_3d_zoom=$n_view_3d_zoom +area_3d_is_motion=1 +$0_rmn area_3d_view +fi +elif $is_drag1==5" && "$is_released0 +event_type0,is_drag0,is_released0,is_drag1,is_released2 +fi +if $is_area5" && "({*,ARROWLEFT}" || "{*,ARROWRIGHT}" || "{*,ARROWUP}" || "{*,ARROWDOWN}) +eval " +const stepx = ($pan_3d_x_max - $pan_3d_x_min)/30; +const stepy = ($pan_3d_y_max - $pan_3d_y_min)/30; +dx = "{*,-ARROWLEFT}"?-stepx:"{*,-ARROWRIGHT}"?stepx:0; +dy = "{*,-ARROWUP}"?-stepy:"{*,-ARROWDOWN}"?stepy:0; +$is_SHIFT?(dx*=2; dy*=2); +x = cut(i[#$view_3d_pose,3] + dx,$pan_3d_x_min,$pan_3d_x_max); +y = cut(i[#$view_3d_pose,7] + dy,$pan_3d_y_min,$pan_3d_y_max); +i[#$view_3d_pose,3] = x; +i[#$view_3d_pose,7] = y" +$0_rmn area_3d_view +fi +if {*,-K} +setting_3d_background:={$setting_3d_background+1}%12 +notification="3D background: \#"$setting_3d_background +$0_rmn canvas_3d_background,area_3d_view,canvas_label_notification +elif {*,-J} +setting_3d_animation:=($setting_3d_animation+1)%3 +notification="3D animation: "${"arg0 "$setting_3d_animation,Off,Forward,Backward} +$0_rmn canvas_label_notification +elif {*,-U} +setting_3d_animation_mode:=($setting_3d_animation_mode+1)%16 +if $setting_3d_animation_mode<12 str={`_'X'+int($setting_3d_animation_mode/4)`}-axis +else str=XYZ-axes +fi +str.=" ("${"arg0 "{$setting_3d_animation_mode%4},slow,normal,fast,fast+}")" +notification="3D animation mode: "$str +$0_rmn canvas_label_notification +fi +if !$is_volumetric +if {*,-A} +setting_3d_is_axes:=!$setting_3d_is_axes +notification="Axes: "${"arg0 "$setting_3d_is_axes,Off,On} +$0_rmn area_3d_view,canvas_label_notification +elif !$is_CTRL" && "{*,D} +setting_3d_side_mode:={($setting_3d_side_mode+1)%3} +notification="3D side mode: "${"arg0 "$setting_3d_side_mode,"Single-sided,Double-sided,\"Single-sided (flipped)\""} +$0_rmn area_3d_view,canvas_label_notification +skip {*,-D} +elif !$is_CTRL" && "{*,F} +setting_3d_focale:="_const f = $setting_3d_focale; +lof = [ 0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,1,1.5,2,3,4,6,8,10 ]; +for (k = 0, k} if !isfile('$filename') break fi } +if {*,-L} +f[is_rotated] "i?run('rotate[',y,'] ',-90*i); 0" +foreach[^$nb_images--1] { => ${image_name$>} } +o[^$nb_images--1] $filename +foreach[^$nb_images--1] { => _display$> } +notification="Saved list copy: "$filename +elif {*,-O} +ang={is_rotated,i[$selected]} if $ang rotate[$selected] {-90*$ang} =[is_rotated] 0,0,$selected fi +=>[$selected] ${image_name$selected} +o[$selected] $filename +=>[$selected] _display$selected +notification="Saved image copy: "$filename +fi +$0_rmn canvas_label_notification +elif {*,-S}" && "0$canvas_base +repeat 256 { filename=${"filename gmic.png,"$>} if !isfile('$filename') break fi } +notification="Save screenshot: "$filename +$0_rmn canvas_label_notification +o[canvas_base] $filename +elif $is_CTRL" && "{*,-W} +if $window_record_frame<0 +window_record_frame=0 +else +if $is_opencv o[] $filename_animation,0,0,0 fi +notification="Stop recording (\#"$window_record_frame" frames)" +window_record_frame=-1 +$0_rmn canvas_label_notification +fi +$0_rmn area_3d_view +elif {*,-X} +setting_cursor:=a=($setting_cursor+1)%3;$is_volumetric?(a?2:0):(a==1) +notification="Cursor: "${"arg0 "$setting_cursor,"Off,\"On (2D)\",\"On (3D)\""} +$0_rmn canvas_view,canvas_label_notification +fi +fi +if $nb_images>1" && "{*,-TAB} +thumb_is_visible:=!$thumb_is_visible +area_mouse_x,area_mouse_y=-1 +$0_rmn thumb_view,canvas_base,area_3d_view +fi +if !$is_clicked0 event_type0=0 fi +if $is_released0 is_released0=0 fi +if $canvas_label_notification +notification_opacity-=0.1 +if $notification_opacity<=0 rm[canvas_label_notification] notification_opacity=0 fi +if $notification_opacity<1 $0_rmn window_view fi +fi +} +if 0$view_3d_pose _display_3d_pose={view_3d_pose,^} fi +if narg($view_3d_zoom) _display_3d_zoom=$view_3d_zoom fi +if $is_opencv" && "$window_record_frame>=0 o[] $filename_animation,0,0,0 fi +f[is_rotated] "i?run('rotate[',y,'] ',-90*i); 0" +if narg($window_previous_normalization) +w[] -1,-1,$window_previous_normalization,$window_previous_fullscreen +else +w[] 0 +fi +rm[$nb_images--1] +foreach { => ${image_name$>} } +um "$0_rmn" +is_change 0 +_display_flush_thumb_cache : +==[thumb_is_cached] 2 *[thumb_is_cached] 2 _display_rmn thumb_view +_display_default_window_size : +u {"const fmax = 0.75; +const u = min(1280,fmax*"{*,u}"); +const v = min(1280,fmax*"{*,v}"); +const muv = min(u,v); +CImg3d = ['CImg3d']; +Mw = Mh = 0; +repeat (l,k, +w = w#k; +h = h#k; +is_3d = w==1 && h>6 && d#k==1 && s#k==1 && int(crop(#k,0,0,0,0,1,6,1,1))==CImg3d; +!w || is_3d?(nw = 1.25*muv; nh = muv):( +d>1?(w+=d; h+=d); +fact = min(u/w,v/h); +Mwh = max(w,h); Mwh<16?(f = lerp(2,1,Mwh/16); w/=f; h/=f); +nw = ceil(fact*w); +nh = ceil(fact*h) +); +nw>Mw?(Mw = nw); +nh>Mh?(Mh = nh); +); +Mwh = max(Mw,Mh); +Mw = Mwh*max($2,Mw/Mwh); +Mh = Mwh*max($2,Mh/Mwh); +l>1?(Mh = (Mh + 2)/(1 - $1)): +!w#0?(Mw/=2; Mh/=2); +ceil([ Mw,Mh ])"} +_display_is_infnan : +if w sh 0,{min(s-1,2)} u {s=is;isinf(s)||isnan(s)} rm. +else u 0 +fi +_display_minmax_infnan : +eval. " +begin( +val_min = inf; +val_max = -inf +); +val = i; +!isinf(val)?( +valval_max?(val_max = val) +); +end( +merge(val_min,min); merge(val_max,max); +set('{}',v2s([val_min,val_max])); +)" +_display_normalize_infnan : skip "${1=none},${2=none}" +is_minmax:="isnum($1) && isnum($2)" +if !$is_minmax noarg fi +foreach { +if $is_minmax val_min,val_max:=$1,$2 else val_min,val_max=${-_display_minmax_infnan} fi +f " +const min = $val_min; const max = $val_max; const delta = max - min; +const epsilon = delta>0?delta:1; +const nmin = min - epsilon; const nmax = max + epsilon; const ndelta = nmax - nmin; +const nfact = 255/(ndelta>0?ndelta:1); +val = i; +isinf(val)?(val<0?0:255):isnan(val)?0:(val - nmin)*nfact" +} +#@cli d0 : eq. to 'display0'. +d0 : +_gmic_s="$?" +prev_display_normalization=$_display_normalization +prev_display_alpha=$_display_alpha +_display_normalization=0 +_display_alpha=1 +v + _display "",1,$[] v - +_display_normalization=$prev_display_normalization +_display_alpha=$prev_display_alpha ++d0 : +prev_display_normalization=$_display_normalization +prev_display_alpha=$_display_alpha +_display_normalization=0 +_display_alpha=1 +_gmic_s="$?" v + _display +,1,$[] v - +_display_normalization=$prev_display_normalization +_display_alpha=$prev_display_alpha +#@cli display0 +#@cli : Display selected images in an interactive window, without normalization and alpha mode activated. +display0 : +prev_display_normalization=$_display_normalization +prev_display_alpha=$_display_alpha +_display_normalization=0 +_display_alpha=1 +_gmic_s="$?" v + _display "",1,$[] v - +_display_normalization=$prev_display_normalization +_display_alpha=$prev_display_alpha ++display0 : +prev_display_normalization=$_display_normalization +prev_display_alpha=$_display_alpha +_display_normalization=0 +_display_alpha=1 +_gmic_s="$?" v + _display +,1,$[] v - +_display_normalization=$prev_display_normalization +_display_alpha=$prev_display_alpha +#@cli da : eq. to 'display_array'. +da : +_gmic_s="$?" v + _display_array $* +#@cli display_array : _width>0,_height>0 +#@cli : Display images in interactive windows where pixel neighborhoods can be explored. +#@cli : Default values: 'width=13' and 'height=width'. +display_array : +_gmic_s="$?" v + _$0 $* +_display_array : check ${1=13}>0" && "${2=$1}>0 +e[0--3] "Display $1x$2 array of pixel values for image"$_gmic_s"." +dxb:=round($1/2,1,1) dxf:=$1-1-$dxb +dyb:=round($2/2,1,1) dyf:=$2-1-$dyb +foreach { +if w<128" && "h<128 r 128,128,100%,100%,0,0,0.5,0.5 fi +x0,y0,w,h=0,0,{w},{h} +wmax:=0.9*{*,u} hmax:=0.9*{*,v} +do +if w>=$wmax" || "h>=$hmax +n={n} => "Image "'{b}.{x}'" is too large, please select a sub-image." ++select. 2 x0,y0,w,h:=i[0],i[1],1+i[3]-i[0],1+i[4]-i[1] +rm. => $n +fi ++z. $x0,$y0,0,{$x0+$w-1},{$y0+$h-1},0 round. 1 n. 0,255 +while w>=$wmax" || "h>=$hmax +x1=-1 y1=-1 c1=0 ox1=-1 oy1=-1 oc1=-1 +x2=-1 y2=-1 c2=0 ox2=-1 oy2=-1 oc2=-1 +x3=-1 y3=-1 c3=0 ox3=-1 oy3=-1 oc3=-1 +c0=0 oxm=-1 oym=-1 +w. -1,-1,0,0,{-2,b}.{-2,x} +do +wait[0-3] +oc0=$c0 +repeat 4 { +if $>" && "!{*$>}" && "${x$>}>=0 w$> 0 x$>=-1 y$>=-1 c$>=0 fi +if {*$>,o} c$>:=(${c$>}+sign({*$>,o}))%s wait[$>] -1 fi +if {*$>,SPACE}" || "{*$>,ENTER}" || "{*$>,ARROWRIGHT}" || "{*$>,ARROWDOWN} c$>:=(${c$>}+1)%s wait[$>] -1 fi +if {*$>,BACKSPACE}" || "{*$>,ARROWLEFT}" || "{*$>,ARROWUP} c$>:=(${c$>}-1)%s wait[$>] -1 fi +} +if $oc0!=$c0 c1=$c0 c2=$c0 c3=$c0 fi +xm,ym={*,x,y} +if $xm>=0" && "{*,b}&1 x1=$xm y1=$ym fi +if $xm>=0" && "{*,b}&2 x2=$xm y2=$ym fi +if $xm>=0" && "{*,b}&4 x3=$xm y3=$ym fi +if $xm>=0" && "($oxm!=$xm" || "$oym!=$ym) w[] -1,-1,{-2,b}.{-2,x}" - ("$xm,$ym")" fi +if $x1!=$ox1" || "$y1!=$oy1" || "$x2!=$ox2" || "$y2!=$oy2" || "$x3!=$ox3" || "$y3!=$oy3 +. +if $x1>=0 +xb:=$x1-$dxb yb:=$y1-$dyb xe:=$x1+$dxf ye:=$y1+$dyf +rectangle. $xb,$yb,$xe,$ye,0.2,0,255,255 +rectangle. $xb,$yb,$xe,$ye,1,0xFFFFFFFF,0,255,255 +fi +if $x2>=0 +xb:=$x2-$dxb yb:=$y2-$dyb xe:=$x2+$dxf ye:=$y2+$dyf +rectangle. $xb,$yb,$xe,$ye,0.2,255,32,255 +rectangle. $xb,$yb,$xe,$ye,1,0xFFFFFFFF,255,32,255 +fi +if $x3>=0 +xb:=$x3-$dxb yb:=$y3-$dyb xe:=$x3+$dxf ye:=$y3+$dyf +rectangle. $xb,$yb,$xe,$ye,0.2,255,255,0 +rectangle. $xb,$yb,$xe,$ye,1,0xFFFFFFFF,255,255,0 +fi +w. {-2,w},{-2,h} rm. oxm=$xm oym=$ym +fi +if $x1>=0" && "($ox1!=$x1" || "$oy1!=$y1" || "$oc1!=$c1) ++z.. {$x1-$dxb},{$y1-$dyb},0,$c1,{$x1+$dxf},{$y1+$dyf},0,$c1 ++z.. {$x1-$dxb},{$y1-$dyb},0,{$x1+$dxf},{$y1+$dyf},0 +__display_array[-2,-1] $1,$2,0,255,255 +w1. {w},{h},0,0,{-3,b}" - ("$x1,$y1,c=$c1")" +rm. ox1=$x1 oy1=$y1 oc1=$c1 +fi +if $x2>=0" && "($ox2!=$x2" || "$oy2!=$y2" || "$oc2!=$c2) ++z.. {$x2-$dxb},{$y2-$dyb},0,$c2,{$x2+$dxf},{$y2+$dyf},0,$c2 ++z.. {$x2-$dxb},{$y2-$dyb},0,{$x2+$dxf},{$y2+$dyf},0 +__display_array[-2,-1] $1,$2,255,32,255 +w2. {w},{h},0,0,{-3,b}" - ("$x2,$y2,c=$c2")" +rm. ox2=$x2 oy2=$y2 oc2=$c2 +fi +if $x3>=0" && "($ox3!=$x3" || "$oy3!=$y3" || "$oc3!=$c3) ++z.. {$x3-$dxb},{$y3-$dyb},0,$c3,{$x3+$dxf},{$y3+$dyf},0,$c3 ++z.. {$x3-$dxb},{$y3-$dyb},0,{$x3+$dxf},{$y3+$dyf},0 +__display_array[-2,-1] $1,$2,255,255,0 +w3. {w},{h},0,0,{-3,b}" - ("$x3,$y3,c=$c3")" +rm. ox3=$x3 oy3=$y3 oc3=$c3 +fi +while {*}" && "!{*,ESC}" && "!{*,Q}" && "!{*1,ESC}" && "!{*1,Q}" && "!{*2,ESC}" && "!{*2,Q}" && "!{*3,ESC}" && "!{*3,Q} +k[0] w 0 w1 0 w2 0 w3 0 +} +__display_array : +round.. 1 c.. 0,999 r. 100%,100%,1,3,{s==1} ++luminance. r.. {$1*24},{$2*24} grid.. {100/$1}%,{100/$2}%,0,0,1,0 +xb:=24*int($1/2) yb:=24*int($2/2) xe:=$xb+24 ye:=$yb+24 +rectangle.. $xb,$yb,$xe,$ye,1,0xFFFFFFFF,$3,$4,$5 +repeat $2 { yg=$> +repeat $1 { xg=$> +t.. {-3,i($xg,$yg)},{5+$xg*24},{5+$yg*24},13,0.8,{i($xg,$yg)>128?0:255} +} +} +rm[-3,-1] +#@cli dc : eq. to 'display_camera'. +dc : check_opencv $0 +v + _display_camera +#@cli display_camera +#@cli : Open camera viewer. +#@cli : This command requires features from the OpenCV library (not enabled in G'MIC by default). +display_camera : check_opencv $0 +v + _$0 +_display_camera : +e[0--3] "Open camera stream viewer." +l[] { +camera +onfail +use_vt100 +e[0--4] ${_vt100_r}${_vt100_b}"Command 'display_camera': Unable to read camera stream. Exiting."$_vt100_n +return +} +wc,hc:=w,h +w ${"fitscreen "$wc,$hc},0,"G'MIC Camera Stream Viewer" +wnfs,hnfs={*,w,h} +angle,fullscreen,brightness,contrast=0 +do +ww,wh={*,w,h} +camera +if $angle rotate. {90*$angle} fi +if $brightness +. {10*$brightness} c. 0,255 fi +if $contrast /. 255 *. {1.2^$contrast} *. 255 c. 0,255 fi +rr2d. $ww,$wh,2,1 w. +rm +wait 30 +if {*,r} w[] {*,d,e} +elif {*,-R}" || "{*,-SPACE} angle:=($angle+1)%4 +elif {*,-ARROWUP} brightness:=min(5,$brightness+1) +elif {*,-ARROWDOWN} brightness:=max(-5,$brightness-1) +elif {*,-ARROWRIGHT} contrast:=min(5,$contrast+1) +elif {*,-ARROWLEFT} contrast:=max(-5,$contrast-1) +elif {*,-F}" || "{*,-ENTER}" || "{*,-F5} +fullscreen:=1-$fullscreen +if $fullscreen +wwnfs,whnfs={*,w,h} +w[] {*,u,v},0,1 +else +w[] $wwnfs,$whnfs,0,0 +fi +fi +while {*}" && "!{*,ESC} +camera 0,0 w[] 0 +#@cli dclut : eq. to 'display_clut'. +dclut : check "isint(${1=256}) && $1>0 && isint(${2=33}) && $2>0" +v + _display_clut $* +#@cli display_clut : _image_resolution>0,_clut_resolution>0 +#@cli : Display selected 3D color LUTs. +#@cli : Default values: 'image_resolution=320' and 'clut_resolution=33'. +#@cli : $ clut tealorange clut summer clut 60s display_clut 400 +display_clut : +v + _$0 $* +_display_clut : check "isint(${1=320}) && $1>0 && isint(${2=33}) && $2>0" +e[0--3] "Display selected 3D color LUTs, with image resolution $1x$1 and CLUT resolution $2x$2x$2." +foreach { nm={n} +r3dx $2 pointcloud3d circles3d 1 o3d 0.1 *3d {255/($2-1)} colorcube3d 1 +3d +pose3d 0.815360904,-0.144610703,-0.560602367,0,-0.149177685,0.883129835,-0.444778264,0,0.559404552,0.446283728,0.698496521,0 +c3d n3d *3d. {2.10*$1} +{2*$1},{2*$1},1,3,-1 j3d. ..,47%,46%,0,1,2,0,0,{4*$1} rm.. +to_rgba replace_color 0,0.5%,-1,-1,-1,255,96,96,96,0 r2dx $1 +=> $nm +} +#@cli dfft : eq. to 'display_fft'. +dfft : +v + _display_fft +#@cli display_fft +#@cli : Display fourier transform of selected images, with centered log-module and argument. +#@cli : (eq. to 'dfft'). +#@cli : $ image.jpg +display_fft +display_fft : +v + _$0 +_display_fft : +e[0--3] "Render fourier transform of image$? with centered log-module and argument." +foreach { fftpolar +.. 1 log.. n 0,255 a x } s x,2 +#@cli dg : eq. to 'display_graph'. +dg : check "${1=0}>=0 && ${2=0}>=0" skip ${3=1},${4=0},${5=0},${6=0},${7=0},${8=0},"${9=x-axis}","${10=y-axis}" +_display_graph ${1-8},"$9","$10" +#@cli display_graph : _width>=0,_height>=0,_plot_type,_vertex_type,_xmin,_xmax,_ymin,_ymax,_xlabel,_ylabel +#@cli : Render graph plot from selected image data. +#@cli : 'plot_type' can be { 0:none | 1:lines | 2:splines | 3:bar }. +#@cli : 'vertex_type' can be { 0:none | 1:points | 2,3:crosses | 4,5:circles | 6,7:squares }. +#@cli : 'xmin','xmax','ymin','ymax' set the coordinates of the displayed xy-axes. +#@cli : if specified 'width' or 'height' is '0', then image size is set to half the screen size. +#@cli : Default values: 'width=0', 'height=0', 'plot_type=1', 'vertex_type=1', 'xmin=xmax=ymin=ymax=0 (auto)', 'xlabel="x-axis"' and 'ylabel="y-axis"'. +#@cli : $ 128,1,1,1,'cos(x/10+u)' +display_graph 400,300,3 +display_graph : check "${1=0}>=0 && ${2=0}>=0" +skip ${3=1},${4=0},${5=0},${6=0},${7=0},${8=0},"${9=x-axis}","${10=y-axis}" +_display_graph ${1-8},"$9","$10" +_display_graph : check "${1=0}>=0 && ${2=0}>=0" +skip ${3=1},${4=0},${5=0},${6=0},${7=0},${8=0},"${9=x-axis}","${10=y-axis}" +e[0--3] "Render $1x$2 graph plot from data of image$?." +foreach { +nm={n} +if $1>0" && "$2>0 w,h=$1,$2 else w,h:=[{*,u,v}]/2 fi +w,h:=max($w,33),max($h,33) +one:=$3!=3 siz:=w*h*d +if $5==$6 xmin=0 xmax:=$siz-$one else xmin:=min($5,$6) xmax:=max($5,$6) fi +if $7==$8 ymin:=im-(iM-im)/20 ymax:=iM+(iM-im)/20 else ymin:=min($7,$8) ymax:=max($7,$8) fi +dx,dy:=$xmax-$xmin,$ymax-$ymin +u=${"_axes[] "$xmin,$xmax",{0.3*"$w"/14}"} offx:=arg(1,$u) deltax:=arg(2,$u) +u=${"_axes[] "$ymin,$ymax",{0.3*"$h"/14}"} offy:=arg(1,$u) deltay:=arg(2,$u) +gw:=$w-32 gh:=$h-32 gg:=($gw-$one)/($siz-$one) +$gw,$gh,1,3,255 +grid. {$deltax*$gw/$dx},{$deltay*$gh/$dy},{($offx-$xmin)*$gw/$dx},{$gh-($offy-$ymin)*$gh/$dy},0.25,0xCCCCCCCC,0 +if s#-2==1 (120,120,200) +elif s#-2<=3 (220,10,10;10,220,10;10,10,220) +else +(0,255) r. 256,1,1,1,3 map. 2 z. 2,100% permute. cxyz r. 3,{-3,max(3,s)},1,1,0,2 +sh. 0,2,0,0 f. 255,0,0,0,255,0,0,0,255 rm. +fi +repeat s#-3 { sh... $> graph... .,$3,$4,$ymax,$ymin,1,{-2,@0-2} rm. shift. 0,-1 } +rm[-3,-1] +line. 0,0,100%,0,1,110 line. 100%,0,100%,100%,1,110 +line. 100%,100%,0,100%,1,255 line. 0,100%,0,0,1,255 +100%,100%,1,1,255 +axes. $xmin,$xmax,$ymax,$ymin,14,1,0 +if $xmin>0 axes. 0,0,$ymax,$ymin,14,1,160 fi +if $xmax<0 axes. {w-1},{w-1},$ymax,$ymin,14,1,160 fi +if $ymin>0 axes. $xmin,$xmax,{h-1},{h-1},14,1,160 fi +if $ymax<0 axes. $xmin,$xmax,0,0,14,1,160 fi ++erode. 3 !=. 255 r.. 100%,100%,1,3 j... ..,0,0,0,0,1,.,1 rm[-2,-1] +frame. 16,16,220 +0 t. "$9",0,0,14,1,-220,-220,-220 j.. .,{({-2,w}-w)/2},{{-2,h}-16},0,0,-1 rm. +0 t. "$10",0,0,14,1,-220,-220,-220 rotate. -90 j.. .,2,{({-2,h}-h)/2},0,0,-1 rm. +=> $nm +} +c 0,255 +#@cli dh : eq. to 'display_histogram'. +dh : +_gmic_s="$?" v + _display_histogram $"*" +#@cli display_histogram : _width>=0,_height>=0,_clusters>0,_min_value[%],_max_value[%],_show_axes={ 0 | 1 },_expression. +#@cli : Render a channel-by-channel histogram. +#@cli : If selected images have several slices, the rendering is performed for all input slices. +#@cli : 'expression' is a mathematical expression used to transform the histogram data for visualization purpose. +#@cli : (eq. to 'dh'). +#@cli : if specified 'width' or 'height' is '0', then image size is set to half the screen size. +#@cli : Default values: 'width=0', 'height=0', 'clusters=256', 'min_value=0%', 'max_value=100%', 'show_axes=1' and 'expression=i'. +#@cli : $ image.jpg +display_histogram 512,300 +display_histogram : +_gmic_s="$?" v + _$0 $"*" +_display_histogram : check "${1=0}>=0 && ${2=0}>=0 && ${3=256}>0" skip ${4=0%},${5=100%},${6=1},"${7=i}" +e[0--3] "Render $1x$2 channel-by-channel histogram of image"$_gmic_s", with $3 clusters, minimum value $4 +and maximum value $5." +foreach { +nm={n} +if ispercentage($4) m:=im+(iM-im)*$4 else m=$4 fi +if ispercentage($5) M:=im+(iM-im)*$5 else M=$5 fi +s:=s s c +repeat $s { l[{-1-$>}] { s z histogram $3,$m,$M a z } } +a c f "${7--1}" vM:=iM s z +foreach { +if $1>0" && "$2>0 wh=$1,$2 else wh:=[{*,u,v}]/2 fi +$wh,1,{s},-255 +repeat s { sh[-2,-1] $> graph. ..,3,0,$vM,0,1,0 rm[-2,-1] } +rm.. + 255 +if $6 +100%,100% +axes. $m,$M,$vM,0,14,1,255 +if $m>0 axes. 0,0,$vM,0,14,1,200 fi +if $M<0 axes. {w-1},{w-1},$vM,0,14,1,200 fi ++dilate. 3 ri.. ... j... ..,0,0,0,0,1,.,255 rm[-2,-1] +fi +} +a z => $nm +} +#@cli display_parametric : _width>0,_height>0,_outline_opacity,_vertex_radius>=0,_is_antialiased={ 0 | 1 },_is_decorated={ 0 | 1 },_xlabel,_ylabel +#@cli : Render 2D or 3D parametric curve or point clouds from selected image data. +#@cli : Curve points are defined as pixels of a 2 or 3-channel image. +#@cli : If the point image contains more than 3 channels, additional channels define the (R,G,B) color for each vertex. +#@cli : If 'outline_opacity>1', the outline is colored according to the specified vertex colors and +#@cli : 'outline_opacity-1' is used as the actual drawing opacity. +#@cli : Default values: 'width=512', 'height=width', 'outline_opacity=3', 'vertex_radius=0', 'is_antialiased=1','is_decorated=1', 'xlabel="x-axis"' and 'ylabel="y-axis"'. +#@cli : $ 1024,1,1,2,'t=x/40;(!c?sin(t):cos(t))*(exp(cos(t))-2*cos(4*t)-sin(t/12)^5)' display_parametric 512,512 +#@cli : $ 1000,1,1,2,u(-100,100) quantize 4,1 noise 12 channels 0,2 +normalize 0,255 append c display_parametric 512,512,0.1,8 +display_parametric : check "${1=512}>0 && ${2=$1}>0 && ${4=0}>=0" skip ${3=3},${5=1},${6=1},"${7=x-axis}","${8=y-axis}" +s0="no " s1="" o0="" o1="colored " +e[^-1] "Render $1x$2 parametric graph plot from data of image$?, with "${o{$3>1}}"outline opacity "{$3>1?$3-1:$3}", vertex radius $4, "${s{$5!=0}}"antialiasing and "${s{$6!=0}}"decoration." +foreach { +nm={n} N:=w*h*d +i[0] ('CImg3d') +[0] 0.5 i[1] ($N;$N) +if s==4 +channels. 3,3 r. 100%,100%,1,2 a[-2,-1] c is_grayscale=1 +else is_grayscale:=s<4 channels. 0,5 +fi +sh. 0 xm,xM:=im,iM rm. +sh. 1 ym,yM:=im,iM rm. +sh. 2 zm,zM:=im,iM rm. +permute. cxyz s. x,2 +i.. (1,0;1,{$N-1}) r.. 2,$N,1,1,3 round.. 1,$N,1,1,1 +y a y c3d n3d *3d 1,-1,1 +{$6?[max(1,$1-32),max(1,$2-32)]:[$1,$2]},1,{$is_grayscale?1:3},255 +*3d[0] {0.96*min(w,h)} +if $6 L:=0.1*max($1,$2) grid[1] $L,$L,0,0,0.25,0xCCCCCCCC,0 fi +if $5 +r[1] 200%,200%,1,100%,1 *3d[0] 2 +if $4 +circles3d[0] {2*$4} j3d[1] [2],50%,50%,0,1,3,0,0 rm[2] fi +elif $4 ++circles3d[0] $4 j3d[1] [2],50%,50%,0,1,3,0,0 rm[2] +fi +if $3 l[0] { +s3d f[1] "i-y" rm[3] i[3] (2,0,1;2,{$N-2},{$N-1}) r[3] 3,{$N-1},1,1,3 round[3] +r[5] 1,{h-1},1,1,0 +if $3>1 r[4] 3,{4,h/3},1,1,-1 r[4] 3,{4,h-1},1,1,2 else rm[4] i[4] 3,{$N-1} fi +y a y +} j3d[1] [0],50%,50%,0,{$3>1?$3-1:$3},2,0,0 fi +rm[0] +if $5 r. 50%,50%,1,100%,2 fi +if $6 +xc:=0.5*($xm+$xM) yc:=0.5*($ym+$yM) dx:=0.5*($xM-$xm)/0.96 dy:=0.5*($yM-$ym)/0.96 +xm,xM,ym,yM:=$xc-$dx,$xc+$dx,$yc-$dy,$yc+$dy +100%,100%,1,1,255 axes. $xm,$xM,$yM,$ym,14,1,0 +if $xm>0 axes. 0,0,$yM,$ym,14,1,160 fi +if $xM<0 axes. {w-1},{w-1},$yM,$ym,14,1,160 fi +if $ym>0 axes. $xm,$xM,{h-1},{h-1},14,1,160 fi +if $yM<0 axes. $xm,$xM,0,0,14,1,160 fi ++erode. 3 !=. 255 r.. 100%,100%,1,3 j... ..,0,0,0,0,1,.,1 rm[-2,-1] +frame 1,1,128 frame 15,15,220 +0 t. "$7",0,0,14,1,-220,-220,-220 j.. .,{({-2,w}-w)/2},{{-2,h}-16},0,0,-1 rm. +0 t. "$8",0,0,14,1,-220,-220,-220 rotate. -90 j.. .,2,{({-2,h}-h)/2},0,0,-1 rm. +fi +=> $nm +} +#@cli display_polar : _width>32,_height>32,_outline_type,_fill_R,_fill_G,_fill_B,_theta_start,_theta_end,_xlabel,_ylabel +#@cli : Render polar curve from selected image data. +#@cli : 'outline_type' can be { r<0:dots with radius -r | 0:no outline | r>0:lines+dots with radius r }. +#@cli : 'fill_color' can be { -1:no fill | R,G,B:fill with specified color }. +#@cli : Default values: 'width=500', 'height=width', 'outline_type=1', 'fill_R=fill_G=fill_B=200', 'theta_start=0', 'theta_end=360', 'xlabel="x-axis"' and 'ylabel="y-axis"'. +#@cli : $ 300,1,1,1,'0.3+abs(cos(10*pi*x/w))+u(0.4)' display_polar 512,512,4,200,255,200 +#@cli : $ 3000,1,1,1,'x^3/1e10' display_polar 400,400,1,-1,,,0,{15*360} +display_polar : check "${1=500}>32 && ${2=$1}>32" +skip ${3=1},${4=200},${5=$4},${6=$5},${7=0},${8=360},"${9=x-axis}","${10=y-axis}" +e[^-1] "Render $1x$2 polar graph plot from data of image"$_gmic_s", with outline $4 and fill color ($4,$5,$6)." +foreach { +nm={n} +M:=max(abs(iM),abs(im)) +* {0.48*min($1,$2)/$M} +y ({$7*pi/180};{-$8*pi/180}) r. 1,..,1,1,3 ++sin. cos.. *. ... *[-3,-2] +a[-2,-1] x N:=h +=> coords +if $3 +('CImg3d') +. 0.5 ($N,$N) ++z[coords] 0,2 +1,$N,1,1,2 1,$N,1,1,'y' ++. 1 a[-3--1] x =. 0,2,100% +3,$N,1,1,0 1,$N,1,1,1 y[-6--1] a[-6--1] y +=> _plot_polar_outline +fi +if "$4>=0 && $5>=0 && $6>=0" +('CImg3d') +. 0.5 ({$N+1},$N) ++z[coords] 0,-1,2,100% z. 0,2 +1,$N,1,1,3 1,$N 1,$N,1,1,'1+y' ++. 1 a[-4--1] x =. 1,3,100% +3,$N,1,1,$4,$5,$6 1,$N,1,1,1 +y[-6--1] a[-6--1] y +=> _plot_polar_fill +fi +rm[coords] +{$1-32},{$2-32},1,3,255 +L:=0.1*max($1,$2) grid. $L,$L,0,0,0.25,0xCCCCCCCC,0 +if "$4>=0 && $5>=0 && $6>=0" +j3d. [_plot_polar_fill],50%,50%,0,1,2,1,0 +rm[_plot_polar_fill] +fi +if $3 +if $3>=0 +j3d. [_plot_polar_outline],50%,50%,0,1,1,0,0 +fi +if $3!=0 +if abs($3)>1 circles3d[_plot_polar_outline] {abs($3)} fi +j3d. [_plot_polar_outline],50%,50%,0,0.2,2,0,0 +fi +rm[_plot_polar_outline] +fi +nM:=$M/0.96 +100%,100%,1,1,255 axes. {-$nM},$nM,$nM,{-$nM},14,1,0 ++erode. 3 !=. 255 r.. 100%,100%,1,3 j... ..,0,0,0,0,1,.,1 rm[-2,-1] +frame. 1,1,128 frame. 15,15,220 +0 t. "$9",0,0,13,1,-220,-220,-220 j.. .,{({-2,w}-w)/2},{{-2,h}-16},0,0,-1 rm. +0 t. "$10",0,0,13,1,-220,-220,-220 rotate. -90 j.. .,2,{({-2,h}-h)/2},0,0,-1 rm. => $nm +} +#@cli dq : eq. to 'display_quiver'. +dq : +_gmic_s="$?" v + _display_quiver $* +#@cli display_quiver : _size_factor>0,_arrow_size>=0,_color_mode={ 0:monochrome | 1:grayscale | 2:color } +#@cli : Render selected images of 2D vectors as a field of 2D arrows. +#@cli : (eq. to 'dq'). +#@cli : Default values: 'size_factor=16', 'arrow_size=1.5' and 'color_mode=1'. +#@cli : $ image.jpg +luminance gradient[-1] xy rv[-2,-1] *[-2] -1 a[-2,-1] c crop 60,10,90,30 +display_quiver[1] , +display_quiver : +_gmic_s="$?" v + _$0 $* +_display_quiver : check "${1=16}>0 && ${2=1.5}>=0 && isint(${3=2}) && $3>=0 && $3<=2" +e[0--3] "Render field of 2D arrows from image"$_gmic_s", with size factor $1, arrow size $2 in "${arg0\ $3,monochrome,grayscale,color}" mode." +foreach { ++norm. /.. {max(1e-6,iM)} rm. +{$1*w},{$1*h},1,{"1<[0] {1,n} +sh. {s-1} j[0] [1],0,0,0,0,1,[2],255 k[0] +fi +} +to_rgb u $is_rgb +#@cli dt : eq. to 'display_tensors'. +dt : +_gmic_s="$?" v + _display_tensors $* +#@cli display_tensors : _size_factor>0,_ellipse_size>=0,_color_mode={ 0:monochrome | 1:grayscale | 2:color },_outline>=0 +#@cli : Render selected images of tensors as a field of 2D ellipses. +#@cli : (eq. to 'dt'). +#@cli : Default values: 'size_factor=16', 'ellipse_size=1.5', 'color_mode=2' and 'outline=2'. +#@cli : $ image.jpg +diffusiontensors 0.1,0.9 resize2dx. 64 +display_tensors. 16,2 +#@cli : $$ https://gmic.eu/oldtutorial/_display_tensors +display_tensors : +_gmic_s="$?" v + _$0 $* +_display_tensors : check "${1=16}>0 && ${2=1.5}>=0 && isint(${3=2}) && $3>=0 && $3<=2 && ${4=2}>=0" +e[0--3] "Render field of 2x2 tensors from image"$_gmic_s", with size factor $1, ellipse size $2 in "${arg0\ $3,monochrome,grayscale,color}" mode and outline $4." +foreach { +* {($2*$1/2)/max(abs(im),abs(iM))} +{$1*w},{$1*h},1,{"1<=0, --k, ellipse(#1,X,r1 + k*$4,r2 + k*$4,ang°,1,arg(k + 1,C,Co))); +I" +rm.. +} +#@cli dv3d : eq. to 'display_voxels3d'. +dv3d : +_gmic_s="$?" v + _display_voxels3d +#@cli display_voxels3d +#@cli : Display selected images as set of 3D voxels. +#@cli : (eq. to 'dv3d'). +display_voxels3d : +_gmic_s="$?" v + _$0 +_display_voxels3d : +nb_images=$! +foreach { nm$>={n} } ++foreach { +w,h,d={w},{h},{d} +nm=${nm$>} bnm={b} l. { if ['{x}']!=0 bnm.=.{x} fi onfail bnm.=.{x} } +asiz:=max(w,h,d)/5 ++norm1. !=. 0 nbv:=is rm. +e[0--4] "Display image ["{arg(1+$>,$[])}"] = '"$nm"' ("${w}x${h}x${d}", "$nbv" voxels)." +args=0.5,1,0.75 +if s==1 +im,iM:=im,iM +eval. "*begin(is_bin = 1); i!=$im && i!=$iM?(is_bin = 0; break()); end(merge(is_bin,&&); set('is_bin',is_bin))" +if $is_bin +>. {lerp($im,$iM,0.5)} +expand_xyz. 1 b. {min(w,h,d)*2%},0 g. xyz a[-3--1] c orientation. n. 0,220 +shrink_xyz. 1 *. .. k. args=0.9,1.1,1 +fi +fi +surfels3d $args +3d. 0.5,0.5,0.5 +axes3d $asiz,$asiz,$asiz,16 o3d. 0.5 col3d. 255,128,0 ++3d +} +foreach[$nb_images--1] { => ${nm$>} } +_display_3d_rendering_mode=2 +_display_3d_is_bounding_box=1 +_display[$nb_images--1] "",0,$[] rm[$nb_images--1] +is_change 0 +#@cli dw : eq. to 'display_warp'. +dw : +_gmic_s="$?" v + _display_warp $* +#@cli display_warp : _cell_size>0 +#@cli : Render selected 2D warping fields. +#@cli : (eq. to 'dw'). +#@cli : Default value: 'cell_size=15'. +#@cli : $ 400,400,1,2,'x=x-w/2;y=y-h/2;r=sqrt(x*x+y*y);a=atan2(y,x);5*sin(r/10)*[cos(a),sin(a)]' +display_warp 10 +display_warp : +_gmic_s="$?" v + _$0 $* +_display_warp : check "${1=15}>0" +e[0--3] "Render 2D warping field"$_gmic_s", with cell size $1." +foreach { +if d!=1" || "s!=2 +error[0--3] "Command 'display_warp': Invalid image ["{$!-$>-1}"]: Dimensions "{w}","{h}","{d}","{s}" +does not represent a 2D field of 2D vectors." +fi +i[0] 100%,100%,1,1,1 grid[0] $1,$1 =>[0] {1,n} +warp[0] [1],1,1,0 rm[1] +} * 255 +#@cli e : eq. to 'echo'. : (+) +#@cli echo : message : (+) +#@cli : Output specified message on the error output. +#@cli : (eq. to 'e').\n +#@cli : Command selection (if any) stands for displayed call stack subset instead of image indices. +#@cli : When invoked with a '+' prefix (i.e. '+echo'), the command output its message on stdout rather than stderr. +#@cli echo_file : filename,message +#@cli : Output specified message, appending it to specified output file. +#@cli : (similar to 'echo' for specified output file stream). +echo_file : skip "${2='\n'}" +l[] { it "$1" onfail 0 } +('"${2--1}\n"':y) a[-2,-1] y ot. $1 rm. +#@cli font : { 'Font_name' | font_number | font.gmz },_font_height[%]>0,_is_bold={ 0 | 1 } +#@cli : Return font identifier (variable name) that can be further used in command `text` as a custom font. +#@cli : 'Font_name' can be { Acme | Arial | Arial Black | Black Ops One | BlackChancery | Cabin Sketch | Caprasimo | Carnevalee Freakshow | Cheese Burger | Cheque | Cheque-Black | Chlorinar | Comic Sans MS | Courier New | Creepster | Georgia | Impact | Lobster | Luckiest Guy | Macondo | MedievalSharp | Odin Rounded | Oswald | Palatino Linotype | Playfair Display | Roboto | Sacramento | Satisfy | Sofia | Tex Gyre Adventor | Times New Roman | Titan One | Verdana }. +#@cli : If a filename 'font.gmz' is specified, it must be a file converted with command `font2gmz`. +#@cli : Default values: 'font_height=64' and 'is_bold=0'. +#@cli : $ 400,300,1,3 text "Hello World!",0.5~,0.5~,${"font \"Cheese Burger\",80"},1,255,255,128 ++font : check "isint(${2=24}) && $2>0 && isbool(${3=0})" +fonts="Acme","Arial","Arial Black","Black Ops One","BlackChancery","Cabin Sketch","Caprasimo","Carnevalee Freakshow","Cheese Burger","Cheque","Cheque-Black","Chlorinar","Comic Sans MS","Courier New","Creepster","Georgia","Impact","Lobster","Luckiest Guy","Macondo","MedievalSharp","Odin Rounded","Oswald","Palatino Linotype","Playfair Display","Roboto","Sacramento","Satisfy","Sofia","Tex Gyre Adventor","Times New Roman","Titan One","Verdana" +if "s = ['$1']; find(s,'.gmz')==size(s)-4" font="$1" is_file=1 +elif "isint($1)" arg0 {$1%narg($fonts)},$fonts font=${} is_file=0 +else font="$1" is_file=0 +fi +qualifier0,qualifier1="regular","bold" +e[^-1] "Return default font '"$font"' with height $2 and "${qualifier$3}" face." +height:=ispercentage($2)?h*$2:$2 +strvar $font fontname=${} +varname=__font_${fontname}_$qualifier$3$height +if narg(${$varname}) u $varname return fi +l[] { +if $is_file "$1" +else input_cached gmic_fonts.gmz k[$fontname] unserialize +fi +if $3 +dsiz:="s = round(h/32); s+=1 - (s%2); max(3,s)" expand_xy {round($dsiz/2)} dilate $dsiz +fi +if h!=$height +if h>$height foreach { r {max(1,round(w*$height/h))},$height,1,1,2 } +else +sigma:=($height-h)/64 +foreach { r {max(1,round(w*$height/h))},$height,1,1,3 } +b $sigma,0 +function1d[] 1,0,0,128,10,200,255,255,255 c. 0,255 map[^-1] . rm. +fi +round +fi +[^] f[0-255] 255 +foreach { if $><256 => char$> else => mask{$>-256} fi } +store $varname +onfail +v + error[0--3] "Command 'font': Unknown font '$1'." v - +varname=$2 +rm +} +u $varname +#@cli font2gmz : _font_name,_font_size>0,_font_qualifier +#@cli : Convert specified font to G'MIC format, so that it can be used as a custom font for command `text`. +#@cli : 'font_name' can be either a filename as 'font.ttf', or a 'Google Font Name'. +#@cli : This command requires the command line tool `cutycapt` to be installed on your system. +#@cli : Beware, 'font_size' is the size of font used for the rendering, it does **not** correspond to the font height. +#@cli : Default values: 'font_name=Sofia', 'font_size=24' and 'font_qualifier=""'. ++font2gmz : skip "${1=Sofia},${3=}" check "isint(${2=64}) && $2>0" +basename "$1",_dir basename=${} +if ['$_dir']==0 _dir=${-path_current} fi +path=$_dir 0 => $basename base={b} ext={x} rm. +strvar $base varname=${} +e[^-1] "Convert font '"$basename"' to G'MIC format, with font size $2 and font qualifier '$3'." +256,1,1,1,"x; +end( +codes0 = [ 32,32,8853,8854,8855,8856,8857,8747,8711,32,32,8800,8730,32,9824,9827, +9829,9830,8745,8746,8743,8744,8712,32,32,32,32,32,32,32,32,8364 ]; +draw(codes0,0,size(codes0)); +codes1 = [ 32,8734,945,946,8706,948,949,951,947,955,956,969,966,960,968,961, +963,964,952,916,931,915,937,934,928,936,920,8592,8593,8594,8595,8596,8597 ]; +draw(codes1,127,size(codes1)); +") +codes={^} rm. +if "isin(['"$ext"'],'ttf','otf')" +str1= +str2="@font-face {\nfont-family: gmicFont;\nsrc: url('"$path$basename"');\n}" +font_family="gmicFont" +else +str1="" +str2= +font_family="\"$1\" $3" +fi +('" \n\n\n\n"$str1"\n\n\n"') +({'"\n\n"'}) +ind=0 +repeat 256 +code:=[$codes][$>] +bgcolor=${dec2hex\ {16752640+$>}} +if !($ind%16) ('"\n"') fi +('"\n"') +ind+=1 +if !($ind%16)" || "!$< ('"\n"') fi +done +({'"
"') +('"&#"$code;') +('"
\n\n"'}) +y a y +file_html=${-path_tmp}gmic_$0_$varname.html +ot $file_html +file_png=${-path_tmp}gmic_$0_$varname.png +x 0,"cutycapt --min-width="{32*$2}" --min-height="{32*$2}" --url=file://"$file_html" --out="$file_png +rm $file_png to_rgb +autocrop +eval[0] ": +begin( +x0s = y0s = vector256(inf); +x1s = y1s = vector256(-inf); +void = [ 0,0,0 ]; +); +i0==255 && i1==160?( +ind = i2; +xx1s[ind]?(x1s[ind] = x); +y>y1s[ind]?(y1s[ind] = y); +); +void; +end( +merge(x0s,min); merge(y0s,min); +merge(x1s,max); merge(y1s,max); +set('x0s',v2s(x0s)); +set('y0s',v2s(y0s)); +set('x1s',v2s(x1s)); +set('y1s',v2s(y1s)); +)" +repeat narg($x0s) { +x0,y0,x1,y1:=([$x0s][$>]),([$y0s][$>]),([$x1s][$>]),([$y1s][$>]) ++z[0] $x0,$y0,0,0,$x1,$y1,0,0 +} +rm[0] negate +foreach { if iM>0 autocrop_coords 0 x0,y0,z0,x1,y1,z1=${} z $x0,$x1 fi } +my0,My1=inf,-inf +foreach { if iM autocrop_coords 0 x0,y0,z0,x1,y1,z1=${} my0,My1:=min($my0,$y0),max($My1,$y1) fi } +z 0,$my0,100%,$My1 +W={{'f'},w} foreach { if !iM r $W,100%,1,1,0 fi } +n 0,255 sharpen 100 round +foreach { => mask$> } +#@cli function1d : 0<=smoothness<=1,x0>=0,y0,x1>=0,y1,...,xn>=0,yn +#@cli : Insert continuous 1D function from specified list of keypoints (xk,yk) +#@cli : in range [0,max(xk)] (xk are positive integers). +#@cli : $ function1d 1,0,0,10,30,40,20,70,30,80,0 +display_graph 400,300 ++function1d : +e[^-1] "Input continuous 1D function, with smoothness $1 and keypoints (${2--1})." +l[] { +smoothness:=max(0,min(1,$1)) +(${2--1}) r 2,{int(w/2)},1,1,-1 +sort +,y s x size={0,iM>=0?1+int(iM):0} +if !$size rm 0 break fi +a x ++f "(j(0,1,0,0,0,1) - j(0,-1,0,0,0,1))/2" s. x max.. 0.01 /. .. rm.. a x +$size,1,1,1,-1 +repeat h#0-1 { +x0,y0,x1,y1={0,[i(0,$>),i(1,$>),i(0,$>+1),i(1,$>+1)]} +slope:=($y1-$y0)/max(0.01,$x1-$x0) +yp0={0,i(2,$>)*$smoothness+(1-$smoothness)*$slope} +yp1={0,i(2,$>+1)*$smoothness+(1-$smoothness)*$slope} +i:=round($x0,1,1) +j:=round($x1,1,0) +line[1] $i,0,$j,0,1,$> +if $j-$i<=1 +({$y0-$x0*$slope}^{$slope}^0^0) +else +(1,$x0,{($x0)^2},{($x0)^3};1,$x1,{($x1)^2},{($x1)^3};0,1,{2*$x0},{3*($x0)^2};0,1,{2*$x1},{3*($x1)^2}) +($y0;$y1;$yp0;$yp1) +invert.. 1 mmul[-2,-1] y. c +fi +} +a[2--1] x map.. . rm. +100%,1,1,1,1 +(0,{w-1}) r. {-2,w},1,1,1,3 round. ++sqr. +*[-2,-1] a[-4--1] c *[-2,-1] s. c +[-4--1] rm.. +} +update_fonts : +fonts="Acme","Arial","Arial Black","Black Ops One","Cabin Sketch","Caprasimo","Comic Sans MS","Courier New","Creepster","Georgia","Impact","Luckiest Guy","Macondo","MedievalSharp","Oswald","Palatino Linotype","Playfair Display","Roboto","Satisfy","Sofia","Titan One","Times New Roman","Verdana" +files $HOME/work/src/gmic/html/fonts/*.otf if narg(${}) fonts.=,${} fi +files $HOME/work/src/gmic/html/fonts/*.ttf if narg(${}) fonts.=,${} fi +target_height=512 +nb_fonts:=narg($fonts) +repeat narg($fonts) { +arg0 $>,$fonts font=${} basename $font 0 => ${} name={b} rm. strvar $name varname=${} +outfile=$_path_rc/font_$varname.gmz +e " - "$name +if !isfile(['$outfile']) l[] { +outgmz=${-path_tmp}gmic_$0_$varname.gmz +size:=round($target_height/1.18) +best_size=0 best_font= +do +rm +if $size!=$best_size" || "!narg($best_font) +x 0,"gmic font2gmz \\\""$font"\\\","$size" o "$outgmz +$outgmz +if h>$target_height +store best_font best_size=$size fi +e " \#"$>" -> "{h} +else +$best_font +e " \#"$>" -> Best guess: "{h} +break +fi +if h!=$target_height +nsize:=$size+$target_height-h +size:=round(lerp($nsize,$size,0.35)) +fi +while h!=$target_height +delete $outgmz +if h>$target_height r2dy $target_height fi +ge 75% * 255 serialize auto,1,0 => $varname +o $outfile +rm +} fi +} +files ${_path_rc}font_*.gmz files=${} +repeat narg($files) { arg0 $>,$files ${} } +sort_list +,n +outfile1=${_path_rc}gmic_fonts.gmz +outfile2=$HOME/work/src/gmic/resources/gmic_fonts.gmz +o $outfile1 +o $outfile2 +e " - Upload all fonts to G'MIC server." +_upload $outfile1 +rm +list_fonts,sep= +repeat narg($fonts) { +arg0 $>,$fonts font=${} basename $font 0 => ${} name={b} rm. strvar $name varname=${} +list_fonts.=$sep$name sep=, +} +str="#@cli : 'Font name' can be { " +0x{narg($list_fonts)} => $list_fonts sort_list +,n lof n list_fonts=${} rm +repeat narg($list_fonts) { +arg0 $>,$list_fonts +str.=${} +if $< str.=" | " else str.=" }." fi +} +e " - Generate documentation string for command 'font':\n"$str +#@cli identity : _width>=0,_height>=0,_depth>=0 +#@cli : Insert an identity map of given size at the end of the image list. +#@cli : Default values: 'height=width' and 'depth=1'. +#@cli : $ identity 5,1 identity 8,8 ++identity : check "isint($1) && $1>=0 && isint(${2=$1}) && $2>=0 && isint(${3=1}) && $3>=0" +e[^-1] "Input $1x$2x$3 identity map." +if $3>1 $1,$2,$3,3,[x,y,z] +elif $2>1 $1,$2,1,2,[x,y] +elif $1>0 $1,1,1,1,x +else 0 +fi +#@cli i : eq. to 'input'. : (+) +#@cli input : [type:]filename : [type:]http://URL : [selection]x_nb_copies>0 : { width>0[%] | [image_w] },{ _height>0[%] | [image_h] },{ _depth>0[%] | [image_d] },{ _spectrum>0[%] | [image_s] },_{ value1,_value2,... | 'formula' } : (value1{,|;|/|^}value2{,|;|/|^}...[:{x|y|z|c|,|;|/|^}]) : 0 : (+) +#@cli : Insert a new image taken from a filename or from a copy of an existing image [index], +#@cli : or insert new image with specified dimensions and values. Single quotes may be omitted in +#@cli : 'formula'. Specifying argument '0' inserts an 'empty' image. +#@cli : (eq. to 'i' | (no arg)). +#@cli : Default values: 'nb_copies=1', 'height=depth=spectrum=1' and 'value1=0'. +#@cli : $ input image.jpg +#@cli : $ input (1,2,3;4,5,6;7,8,9^9,8,7;6,5,4;3,2,1) +#@cli : $ image.jpg (1,2,3;4,5,6;7,8,9) (255^128^64) 400,400,1,3,'(x>w/2?x:y)*c' +#@cli : $$ +#@cli input_565 : filename,width>0,height>0,reverse_endianness={ 0 | 1 } +#@cli : Insert image data from a raw RGB-565 file, at the end of the list. +#@cli : Default value: 'reverse_endianness=0'. ++input_565 : check "isint($2) && $2>0 && isint($3) && $3>0 && isbool(${4=0})" +e[^-1] "Input raw RGB-565 file '"{/"$1"}"', with size $2x$3." +l[] { +raw:"$1",uint16 if $4 endian uint16 fi +r $2,$3,1,1,-1 +>> 5 &. 63 +&.. 31 >>... 11 *[-3,-1] 8 *.. 4 a c +} +#@cli ib : eq. to 'input_bytes'. ++ib : +v + _input_bytes "$*" +#@cli input_bytes : filename +#@cli : Input specified filename as a 1D array of bytes. +#@cli : (eq. to 'ib'). ++input_bytes : +v + _$0 "$*" +_input_bytes : +e[0--3] "Input file '"{/"$*"}"' as a 1D array of bytes." +i raw:"$*",uint8 +#@cli input_csv : "filename",_read_data_as={ 0:numbers | 1:strings | _variable_name } +#@cli : Insert number of string array from specified .csv file. +#@cli : If 'variable_name' is provided, the string of each cell is stored in a numbered variable '_variable_name_x_y', where 'x' and 'y' are the indices of the cell column and row respectively (starting from '0'). +#@cli : Otherwise, a 'WxH' image is inserted at the end of the list, with each vector-valued pixel 'I(x,y)' encoding the number or the string of each cell. +#@cli : This command returns the 'W,H' dimension of the read array, as the status. +#@cli : Default value: 'read_data_as=1'. ++input_csv : check "isvarname('${2=1}') || isin($2,0,1,2)" +l[] { +is_var:="s = ['$2']; s!='0' && s!='1'" +if $is_var +e[0--4] "Input string array from file '"{/"$1"}"', in variable '$2'." +it "$1" replace {'" "'},255 s -,{'\n'} +W,H=0,$! +repeat $! { _input_csv_var[] $2,$>,${u\ {$>,t}} W:=max($W,${}) } +rm u $W,$H +else +s0,s1="number","string" +e[0--4] "Input "${s$2}" array from file '"{/"$1"}"'." +it "$1" s -,{'\n'} replace {'" "'},255 +if $2 repeat $! { _input_csv_str[] ${u\ {$>,t}} rv[$>,-1] rm. } a y replace 255,{'" "'} +else repeat $! { _input_csv_val[] ${u\ {$>,t}} rv[$>,-1] rm. } a y +fi +=> "$1" u {[w,h]} +fi +} +_input_csv_var : +$=arg +W:=$#-2 +repeat $W { +arg=${arg{3+$>}} +if ['$arg']!=0 ({'${arg{3+$>}}'}) replace. 255,{'" "'} $1_$>_$2={t} rm. else $1_$>_$2= fi +} +u $W +_input_csv_str : +$=arg +repeat $# { +arg=${arg{1+$>}} +if ['$arg']!=0 ({'$arg'}:c) else (0) fi +} +a x +_input_csv_val : +$=arg +repeat $# { +arg=${arg{1+$>}} +if ['$arg']!=0 ({s2v(['$arg'])}) else (nan) fi +} +a x +#@cli input_cube : "filename",_convert_1d_cluts_to_3d={ 0 | 1 }. +#@cli : Insert CLUT data from a .cube filename (Adobe CLUT file format). +#@cli : Default value: 'convert_1d_cluts_to_3d=1'. ++input_cube : skip ${2=1} +e[^-1] "Input CLUT from file '"{/"$1"}"'" +l[] { +it[] "$1" f "i<_' ' && i!=10?_' ':i" s -,10 +i[0] 0 +range:=" +ref(vector128(),line); +dmin = [ 0,0,0 ]; +dmax = [ 1,1,1 ]; +dim = size = 0; +target = 0; +for (k = 1, k1 && h==1 && d==1 && $2" size:=w s c y.. y. z r $size,$size,$size a c fi +=> "$1" +} +#@cli input_flo : "filename" +#@cli : Insert optical flow data from a .flo filename (vision.middlebury.edu file format). ++input_flo : +e[^-1] "Input optical flow from file '"{/"$1"}"'." +l[] { +i raw:"$1",float32 +if i!=202021.25 endian. fi +if i!=202021.25 error[0--3] "Command 'input_flo': Filename '$1' is not a valid .flo file." return fi ++rows 1,2 cast. float32,uint32 w,h={^} rm. +rows 3,100% r 2,$w,$h,1,-1 permute yzcx +} +#@cli ig : eq. to 'input_glob'. ++ig : +v + _input_glob "$*" +#@cli input_glob : pattern +#@cli : Insert new images from several filenames that match the specified glob pattern. +#@cli : (eq. to 'ig'). ++input_glob : +_input_glob "$*" +_input_glob : +e[0--3] "Input all files that match glob pattern '"{/"$*"}"'." +files 3,"$*" +N=$! +m "_ig : $""=arg repeat $""# { i ${arg{1+$>}} }" +_ig ${} um _ig +if $N==$! error[0--3] "Command 'input_glob': No matching filenames for pattern '$*'." fi +#@cli input_gpl : filename +#@cli : Input specified filename as a .gpl palette data file. ++input_gpl : +e[^-1] "Input palette from file '"{/"$*"}"'." +l[] { +it[] "$*" discard 13 replace 9,32 s -,10 +colors=0 +foreach { +l { +s -,32 +if $!>=3" && "isint({0,t})" && "isint({1,t})" && "isint({2,t}) colors=$colors;{0,t},{1,t},{2,t} fi +rm 0 +onfail rm 0 +} +} +rm ($colors) rows 1,100% => "$1" permute yzcx +} +#@cli input_cached : "basename.ext",_try_downloading_from_gmic_server={ 0 | 1 } +#@cli : Input specified filename, assumed to be stored in one of the G'MIC resource folder. +#@cli : If file not found and 'try_downloading=1', file is downloaded from the G'MIC server and stored +#@cli : in the '${-path_cache}' folder. +#@cli : Default value: 'try_downloading_from_gmic_server=1'. ++input_cached : check "isbool(${2=1})" +basename "$1" basename=${} +e[^-1] "Input cached file '"$basename"'." +if ['$GMIC_SYSTEM_PATH']!=0 g_path_unix=$GMIC_SYSTEM_PATH/ else g_path_unix=/usr/lib/gimp/2.0/plug-ins/ fi +path_test0=${-path_cache} +path_test1=$_path_rc +path_test2=${-path_gimp}plug-ins/ +path_test3=${-path_gimp}plug-ins/gmic_gimp_qt/ +if !${-is_windows} +path_test4=/usr/share/gmic/ +path_test5=$g_path_unix +else +path_test4=$g_path_unix +fi +file_found=0 +repeat inf { +if ['{/${path_test$>}}']==0 break fi +file=${path_test$>}$basename +l[] { i $file file_found=1 onfail } +if $file_found break fi +} +if !$file_found" && $2" +url=https://gmic.eu/"$1" +l[] { i $url o ${-path_cache}$basename file_found=1 is_change 1 onfail } +fi +if !$file_found +error[0--3] "Command 'input_cached': Unknown filename '"{/"$1"}"'." +fi +#@cli input_obj : filename +#@cli : Input specified 3D mesh from a .obj Wavefront file. ++input_obj : +e[^-1] "Input 3D mesh from file '"{/"$*"}"'" +l[] { +it "$1" f "i<=_' ' && i!=_'\n'?_' ':i" +0 => "$1" folder={f} rm. +1 +1 +1 +1 +1,1,1,2 +0 +_input_obj_rgb,_input_obj_alpha= +eval " +next_item() = ( +while (line[q] && line[q]!=_' ' && line[q]!=_'/',++q); +while (line[q] && line[q]==_' ', ++q); +); +push_texture() = ( +s_ind_prim = string('ind_prim',p_img); +ind_prim = get(s_ind_prim); +isnan(ind_prim)?( +da_push(#3,-128,ui2f(p_whs[0]),p_whs[1],p_whs[2]); +dsiz = da_size(#3); isiz = prod(p_whs); +resize(#3,1,h(#3) + isiz,1,1,0); +copy(i[#3,dsiz],i[#p_img,0],isiz); +i[#3,h(#3) - 1] = ui2f(dsiz + isiz); +set(s_ind_prim,nbp); +):( +da_push(#3,-128,ui2f(ind_prim),0,0); +); +); +id_v = 'v '; id_f = 'f '; id_l = 'l '; id_p = 'p '; id_vt = 'vt '; +id_mtllib = 'mtllib '; id_usemtl = 'usemtl '; +line = vector1024(0); +p_rgb = [ 200,200,200 ]; p_alpha = 1; p_img = -1; p_whs = [ 0,0,0 ]; +line_number = 1; +nbv = nbp = p = 0; +while (p0?( +copy(line,line[q],len + 1); +run('_input_obj_parse_mtl \""{/$folder}"\",\"',line,'\"'); +); +):line[0,7]==id_usemtl?( +q = 0; next_item(); +len = find(line,0,q); +len>0?( +copy(line,line[q],len + 1); +run('_input_obj_set_mtl ',line); +p_rgb = get('_input_obj_rgb',3); +p_alpha = get('_input_obj_alpha'); +p_whs = get('_input_obj_whs',3); +p_img = get('_input_obj_img'); +); +); +p = ++np; +++line_number; +); +repeat(6,k,k1 = k + 1; resize(#k1,1,da_size(#k1),1,s#k1,0)); +set('nbv',nbv); set('nbp',nbp)" +if "im#3==iM#3 && iM#6>=0" # Convert vertex weights to colored primitives +1,$nbp,1,1,">begin(N = p = 0); +nbv = i[#2,p++]; +R = G = B = nR = nG = nB = 0; +repeat (nbv, +ind = i[#2,p++]; +val = i(#6,0,ind,0,0); val>=0?(R+=val; ++nR); +val = i(#6,0,ind,0,1); val>=0?(G+=val; ++nG); +val = i(#6,0,ind,0,2); val>=0?(B+=val; ++nB); +); +R = nR>0?round(255*R/nR):200; +G = nG>0?round(255*G/nG):R; +B = nB>0?round(255*B/nB):B; +off = 3*N; +i[#3,off++] = R; +i[#3,off++] = G; +i[#3,off] = B; +++N" rm. +fi +rm[0,5--1] i[0] ({'CImg3d'},{ui2f([$nbv,$nbp])}:y) a y => "$1" +} +_input_obj_parse_mtl : skip "${1=}" +img_ind=$! mtl_filename="$1$2" +if !isfile(['{/$mtl_filename}']) return fi +l[] +it $mtl_filename f "i<=_' ' && i!=_'\n'?_' ':i" +s -,{'\n'} autocrop {'" "'} N:=$!-1 +m=default _input_obj_rgb_$m=200,200,200 _input_obj_alpha_$m=1 _input_obj_whs_$m=0,0,0 +repeat $! { if {$>,i!=_'#'} +if "crop(#$>,0,0,1,7)=='newmtl '" # New material +rows[$>] 7,100% strcasevar {$>,t} m=${} +_input_obj_rgb_$m=200,200,200 _input_obj_alpha_$m=1 _input_obj_whs_$m=0,0,0 +elif "crop(#$>,0,0,1,3)=='Kd '" # Diffuse color +l[$>] { rows 3,100% s -,{'" "'} _input_obj_rgb_$m:="255*["{0,t},{1,t},{2,t}"]" k[0] } +elif "crop(#$>,0,0,1,2)=='d '" # Opacity +rows[$>] 2,100% _input_obj_alpha_$m:={$>,t} +elif "crop(#$>,0,0,1,7)=='map_Kd '" # Diffuse texture +rows[$>] 7,100% img_filename={$>,t} +l[] { +"$1"$img_filename +_input_obj_img_$m:=$img_ind img_ind+=1 +_input_obj_whs_$m:=[w,h,s] +y +onfail _input_obj_img_$m=-1 _input_obj_whs_$m=0,0,0 +} +fi +fi } +rm[0-$N] +} +_input_obj_set_mtl : +strcasevar "{/$1}" m=${} +if ['${_input_obj_img_$m}']!=0 _input_obj_img=${_input_obj_img_$m} _input_obj_whs=${_input_obj_whs_$m} +else _input_obj_img=-1 _input_obj_whs=0,0,0 +fi +if ['${_input_obj_rgb_$m}']!=0 _input_obj_rgb=${_input_obj_rgb_$m} +else _input_obj_rgb=200,200,200 +fi +if ['${_input_obj_alpha_$m}']!=0 _input_obj_alpha=${_input_obj_alpha_$m} +else _input_obj_alpha=1 +fi +#@cli it : eq. to 'input_text'. ++it : +v + _input_text "$*" +#@cli input_text : filename +#@cli : Input specified text-data filename as a new image. +#@cli : (eq. to 'it'). ++input_text : +v + _$0 "$*" +_input_text : +e[0--3] "Input text-data file '"{/"$*"}"'." +i raw:"$*",uint8 +if i[0]==239" && "i[1]==187" && "i[2]==191 rows. 3,100% fi +discard. {'\r'} +#@cli lorem : _width>0,_height>0 +#@cli : Input random image of specified size, retrieved from Internet. +#@cli : Default values: 'width=height=800'. ++lorem : check "isint(${1=800}) && $1>0 && isint(${2=$1}) && $2>0" +e[^-1] "Input random image of size $1x$2." +i jpg:"https://picsum.photos/$1/$2" => lorem +merge_multiline : +eval[^] "*i==_'\\' && j[-1]!=_'\\' && j[+1]==_'\n'?( +for (p = 2, j[p] && j[p]<=_' ' && j[p]!=_'\n', ++p); copy(i(),-1,p,1,0))" +discard -1 +merge_multiline_comments : +eval[^] "*i==_'\\' && j[-1]!=_'\\' && j[+1]==_'\n' && j[+2]==_'#'?( +for (p = 3, j[p] && j[p]<=_' ' && j[p]!=_'\n', ++p); copy(i(),-1,p,1,0))" +discard -1 +#@cli network : mode={ -1=disabled | 0:enabled w/o timeout | >0:enabled w/ specified timeout in seconds } : (+) +#@cli : Enable/disable load-from-network and set corresponding timeout. +#@cli : (Default mode is 'enabled w/o timeout'). +#@cli o : eq. to 'output'. : (+) +#@cli output : [type:]filename,_format_options : (+) +#@cli : Output selected images as one or several numbered file(s). +#@cli : (eq. to 'o'). +#@cli : Default value: 'format_options'=(undefined). +#@cli output_565 : "filename",reverse_endianness={ 0:false | 1:true } +#@cli : Output selected images as raw RGB-565 files. +#@cli : Default value: 'reverse_endianness=0'. +output_565 : check "isbool(${2=0})" +e[^-1] "Output image$? as raw RGB-565 file '"{/"$1"}"'." +N=$! +foreach { +s c c 0,255 /[-3,-1] 8 /.. 4 round +bsl... 11 bsl.. 5 + +if $N>1 fn=${"filename \"$1\",$>"} else fn="$1" fi +if $2 endian uint16 fi +o raw:$fn,uint16 rm +} +is_change 0 +#@cli output_cube : "filename" +#@cli : Output selected CLUTs as a .cube file (Adobe CLUT format). +output_cube : +e[^-1] "Output CLUT$? as file '"{/"$1"}"'." +N=$! +foreach { +to_rgb +l:=round((w*h*d)^(1/3)) +if w*h*d!=$l^3 error "Command '$0': CLUT '"{n}"' has invalid dimensions "({w},{h},{d},{s}). fi +r $l,$l,$l,3,-1 permute cxyz / 255 +if $N>1 fn=${"filename \"$1\",$>"} else fn="$1" fi +o dlm:$fn rm it[] $fn replace {','},32 +0 => $fn basename={b} rm. +header="\# Created by: G'MIC (https://gmic.eu)\n""TITLE \""$basename"\"\n\n""# LUT size\n""LUT_3D_SIZE "$l"\n\n""# Data domain\n""DOMAIN_MIN 0.0 0.0 0.0\n""DOMAIN_MAX 1.0 1.0 1.0\n\n""# LUT data points\n" +i[0] ('$header') +y a y ot $fn rm +} +is_change 0 +#@cli output_flo : "filename" +#@cli : Output selected optical flow as a .flo file (vision.middlebury.edu file format). +output_flo : +e[^-1] "Output optical flow$? as file '"{/"$1"}"'." +N=$! +foreach { +w,h={w},{h} +channels 0,1 permute cxyz i[0] (202021.25) i[1] ($w,$h) cast[1] uint32,float32 y a y +if $N>1 fn=${"filename \"$1\",$>"} else fn="$1" fi +o raw:$fn,float32 rm +} +is_change 0 +#@cli output_ggr : filename,_gradient_name +#@cli : Output selected images as .ggr gradient files (GIMP). +#@cli : If no gradient name is specified, it is deduced from the filename. +output_ggr : skip "${2=}" +e[^-1] "Output image$? as .ggr gradient file '"{/"$1"}"'." +N=$! +foreach { +r 1,{w*h*d},1,100%,-1 to_rgba / 255 +if narg("$2") name="$2" +else l[] { 1 => "$1" ('{b}') f "!x && i>=_'a' && i<=_'z'?i-_'a'+_'A':i" name={t} rm } +fi +('"GIMP Gradient\nName: "$name\n{0,h}\n') +repeat h#0 { +start={_$>/{0,h}} +end={_($>+1)/{0,h}} +mid={_0.5*($start+$end)} +rgba={0,I(0,$>)} +r:=arg(1,$rgba) g:=arg(2,$rgba) b:=arg(3,$rgba) a:=arg(4,$rgba) +('$start" "$mid" "$end" "$r" "$g" "$b" "$a" "$r" "$g" "$b" "$a" 0 0\n"') +} +rm[0] a x +if $N>1 ot ${"filename \"$1\",$>"} else ot "$1" fi +rm +} +is_change 0 +#@cli output_gmz : filename,_datatype +#@cli : Output selected images as .gmz files (G'MIC native file format). +#@cli : 'datatype' can be { bool | uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }. +output_gmz : skip ${2=auto} +e[^-1] "Output image$? as gmz file '"{/"$1"}"', with pixel type '$2'." +1,64 +eval " +draw([_'G',_'M',_'Z'],0,0,1,3); +pos = 4; +repeat (l - 1,k, +ref(name(#k,1026),nam); +len = find(nam,0); +len>=0?( +pos + len>=h?resize(#-1,1,2*h + len,1,1,0); +len>0?draw(nam,0,pos,1,len); +pos+=1 + len; +); +); +resize(#-1,1,pos,1,1,0)" +o cimgz:$1,$2 +rm. +#@cli output_obj : filename,_save_materials={ 0:no | 1:yes } +#@cli : Output selected 3D meshes as Wavefront 3D object files. +#@cli : Set 'save_materials' to '1' to produce a corresponding material file (`.mtl`) and eventually texture files. +#@cli : Beware, the export to `.obj` files may be quite slow for large 3D objects. +#@cli : Default value: 'save_materials=1'. +output_obj : check "isbool(${2=1})" check3d +s0,s1=out, +e[^-1] "Output 3D object$? as Wavefront 3D object file '"{/"$1"}"' (with"${s$2}" materials)." +N=$! +foreach { +nm={n} nb_materials,nb_primitives,nb_textures,nb_tcoords=0 +if $N>1 filename=${"filename \"$1\",$>"} else filename="$1" fi +0 => $filename basename={b} folder={f} ext={x} if narg($ext) ext=.$ext fi rm. +fnobj="begin(out = 0; s_rgba = vector8()); +tos(x) = v2s(x,6); +strhex(v,str) = ( +ref(v,_v); +hex(x) = (_x = int(x); _x + (_x<10?_'0':_'A' - 10)); +fill(str,_k,hex(_k%2?_v[(_k-1)/2]%16:_v[_k/2]/16)); +); +write(ind,s) = ( +l_s = find(s,0); +l_s<=0?(l_s = size(s)); +out + l_s>h(#ind)?resize(#ind,1,2*h(#ind) + l_s,1,1,0); +copy(i[#ind,out],s,l_s); +out+=l_s)" +s3d nb_vertices,nbp={1,f2ui([i[0],i[1]])} rm[0,1] +e " > File '"$folder$basename$ext"' ("$nb_vertices" vertices, "$nbp" primitives)." +l[0] { +e " - Export vertices." +r 3,{h/3},1,1,-1 permute zycx +0 => out_obj +eval.. ">"$fnobj"; +!(y%10000)?run('e \"\r - Export vertices: ',round(100*y/h),' % \"'); +ref(string('v ',tos(i0),' ',tos(i1),' ',tos(i2),'\n'),str); +write(#"$out_obj",str); I; +end(resize(#"$out_obj",1,out,1,1,0))" +rm[0] i[0] ('"\n# Vertices.\n"':y) a y => out_obj +e "\r - Export vertices: Done." +} +if $2 l[2,3] { +e " - Export materials." +1,$nbp,1,3 => materials +0 => out_mtl +mv[0] $! +eval $fnobj"; +const nbp = "$nbp"; +off_p = off_o = nb_materials = nb_textures = 0; +rgba = vector4(); +s_opac = vector32(); +repeat (nbp,p, +!(p%10000)?run('e \"\r - Export materials: ',round(100*p/nbp),' % \"'); +s_opac[0] = 0; +opac = i[#0,off_o]; +i[off_p]!=-128?( +ref(cut(round(crop(0,off_p,1,4)),0,255),rgba); +rgba[3] = opac!=-128?round(255*cut(opac,0,1)):255; +strhex(rgba,s_rgba); +vname = string('mat_',s_rgba); +m = get(vname); +isnan(m)?( +++nb_materials; +opac!=-128 && opac<1?copy(s_opac,string('d ',tos(cut(opac,0,1)),'\n')); +ref(string('newmtl m',nb_materials,'\n', +'Kd ',tos(rgba[0]/255),' ',tos(rgba[1]/255),' ',tos(rgba[2]/255),'\n',s_opac),str); +write(#"$out_mtl",str); +set(vname,v2s(m = nb_materials)); +); +i[#"$materials",p] = m; +off_p+=3; +):i[off_p + 2]?( +++nb_materials; ++nb_textures; +wt = i[off_p + 1]; ht = i[off_p + 2]; st = i[off_p + 3]; +opac!=-128 && opac<1?copy(s_opac,string('d ',tos(cut(opac,0,1)),'\n')); +run('+rows. ',off_p + 4,',',off_p + 3 + wt*ht*st,' r. ',wt,',',ht,',1,',st,',-1 tfn=$folder${basename}_t', +nb_textures,'.png o. $tfn rm.'); +tfile = get('tfn',1024,1); +ref(string('newmtl m',nb_materials,'\n', +'map_Kd ',get('tfn',1024,1),'\n',s_opac),str); +write(#"$out_mtl",str); +I[#"$materials",p] = [ nb_materials,wt,ht ]; +off_p+=4 + wt*ht*st; +):( +tind = i[off_p + 1]; +I[#"$materials",p] = I[#"$materials",tind]; +off_p+=4; +); +off_o+=(opac==-128?4 + prod(crop(#0,0,off_o + 1,1,3)):1); +); +resize(#"$out_mtl",1,out,1,1,0); +run('nb_materials,nb_textures=',nb_materials,',',nb_textures)" +e "\r - Export materials: Done." +k[materials,out_mtl] +} fi +e " - Export primitives." +0 => out_prim +mv[1] $! +eval $fnobj"; +const materials = 0"$materials"; +const nbp = "$nbp"; +off = p_material = material = nb_primitives = nb_tcoords = 0; +repeat (nbp,p, +!(p%10000)?run('e \"\r - Export primitives: ',round(100*p/nbp),' % \"'); +type = i[off]; +$2?material = i[#materials,p]; +material!=p_material?ref(string('usemtl m',material,'\n'),str_mtl); +type==1?( +ref(string('p ',f2ui(i[off + 1] + 1),'\n'),str); +write(#"$out_prim",str); +++nb_primitives; +):type==2 || type==6?( +ref(string('l ',f2ui(i[off + 1]) + 1,' ',f2ui(i[off + 2]) + 1,'\n'),str); +write(#"$out_prim",str); +++nb_primitives; +):type==3 || (type==9 && !$2)?( +$2 && material!=p_material?write(#"$out_prim",str_mtl); +ref(string('f ',f2ui(i[off + 1]) + 1,' ',f2ui(i[off + 2]) + 1,' ',f2ui(i[off + 3]) + 1,'\n'),str); +write(#"$out_prim",str); +++nb_primitives; +):type==4 || (type==12 && !$2)?( +$2 && material!=p_material?write(#"$out_prim",str_mtl); +ref(string('f ',f2ui(i[off + 1]) + 1,' ',f2ui(i[off + 2]) + 1,' ', +f2ui(i[off + 3]) + 1,' ',f2ui(i[off + 4]) + 1,'\n'),str); +write(#"$out_prim",str); +++nb_primitives; +):type==9?( +material!=p_material?write(#"$out_prim",str_mtl); +wt = i(#materials,0,p,0,1); ht = i(#materials,0,p,0,2); +ref(string('vt ',tos(i[off + 4]/wt),' ',tos(1 - i[off + 5]/ht),'\n', +'vt ',tos(i[off + 6]/wt),' ',tos(1 - i[off + 7]/ht),'\n', +'vt ',tos(i[off + 8]/wt),' ',tos(1 - i[off + 9]/ht),'\n', +'f ',f2ui(i[off + 1]) + 1,'/',nb_tcoords + 1,' ',f2ui(i[off + 2]) + 1,'/',nb_tcoords + 2, +' ',f2ui(i[off + 3]) + 1,'/',nb_tcoords + 3,'\n'),str); +write(#"$out_prim",str); +nb_tcoords+=3; +++nb_primitives; +):type==12?( +material!=p_material?write(#"$out_prim",str_mtl); +wt = i(#materials,0,p,0,1); ht = i(#materials,0,p,0,2); +ref(string('vt ',tos(i[off + 5]/wt),' ',tos(1 - i[off + 6]/ht),'\n', +'vt ',tos(i[off + 7]/wt),' ',tos(1 - i[off + 8]/ht),'\n', +'vt ',tos(i[off + 9]/wt),' ',tos(1 - i[off + 10]/ht),'\n', +'vt ',tos(i[off + 11]/wt),' ',tos(1 - i[off + 12]/ht),'\n', +'f ',f2ui(i[off + 1]) + 1,'/',nb_tcoords + 1,' ',f2ui(i[off + 2]) + 1,'/',nb_tcoords + 2, +' ',f2ui(i[off + 3]) + 1,'/',nb_tcoords + 3,' ',f2ui(i[off + 4]) + 1,'/',nb_tcoords + 4,'\n'),str); +write(#"$out_prim",str); +nb_tcoords+=4; +++nb_primitives; +):( +run(['warn \"Command 'output_obj': Cannot convert primitive \#'],p,'/',nbp - 1, +' (size ',type,'). Ignoring it.\"'); +); +off+=type + 1; +p_material = material; +); +resize(#"$out_prim",1,out,1,1,0); +run('nb_primitives=',nb_primitives)" +e "\r - Export primitives: Done." +l[out_obj,out_prim] { i[1] ('"\n# Primitives.\n"':y) a y } +if $2 k[out_mtl,out_obj] else k[out_obj] fi +header="# Object name: "$nm\n"# Vertices: "$nb_vertices\n"# Primitives: "$nb_primitives\n"# Materials: "$nb_materials\n"# Textures: "$nb_textures\n{`"d2(x) = (s = date(x); s>9?v2s(s,-1,2):[0,s]+_'0'); +string('# Generated on ',date(0),'/',d2(1),'/',d2(2),' at ',d2(4),':',d2(5),':',d2(6), +' by G\47MIC (https://gmic.eu).\n')"`} +l[out_obj] { +i[0] ('"# File: "$folder$basename$ext\n$header':y) +if $2 i[1] ('"\n# Materials.\nmtllib "$folder$basename".mtl\n"':y) fi +a y +ot $folder$basename$ext +} +if $2 l[out_mtl] { +i[0] ('"# File: "$folder$basename.mtl\n$header\n':y) +a y +ot $folder$basename.mtl +} fi +rm +} +is_change 0 +#@cli ot : eq. to 'output_text'. +ot : +_gmic_s="$?" v + _output_text "$*" +#@cli output_text : filename +#@cli : Output selected images as text-data filenames. +#@cli : (eq. to 'ot'). +output_text : +_gmic_s="$?" v + _$0 "$1" +_output_text : +e[0--3] "Output image"$_gmic_s" as text-data file '"{/"$1"}"'." +o raw:"$1",uint8 +#@cli on : eq. to 'outputn'. +on : +_gmic_s="$?" v + _outputn $* +#@cli outputn : filename,_index +#@cli : Output selected images as automatically numbered filenames in repeat...done loops. +#@cli : (eq. to 'on'). +outputn : +_gmic_s="$?" v + _$0 $* +_outputn : skip "${2=}" +if $#==1 filename=${filename\ "$1",$>} +else filename=${filename\ "$1",$2} +fi +e[0--3] "Output image"$_gmic_s" as file '"{/$filename}"'." +o $filename +#@cli op : eq. to 'outputp'. +op : +_gmic_s="$?" v + _outputp $* +#@cli outputp : prefix +#@cli : Output selected images as prefixed versions of their original filenames. +#@cli : (eq. to 'op'). +#@cli : Default value: 'prefix=_'. +outputp : +_gmic_s="$?" v + _$0 $* +_outputp : skip ${1="_"} +if $!>1 e[0--4] "Output image"$_gmic_s" as their initial locations, prefixed by '$1'." +else e[0--4] "Output image"$_gmic_s" as its initial location, prefixed by '$1'." +fi +repeat $! { o[$>] {$>,f}$1{$>,b}.{$>,x} } +#@cli ow : eq. to 'outputw'. +ow : +_gmic_s="$?" v + _outputw +#@cli outputw +#@cli : Output selected images by overwriting their original location. +#@cli : (eq. to 'ow'). +outputw : +_gmic_s="$?" v + _$0 $* +_outputw : +if $!>1 e[0--4] "Output image"$_gmic_s" as their initial location." +else e[0--4] "Output image"$_gmic_s" as its initial location." +fi +repeat $! { o[$>] {$>,n} } +#@cli ox : eq. to 'outputx'. +ox : +_gmic_s="$?" v + _outputx $* +#@cli outputx : extension1,_extension2,_...,_extensionN,_output_at_same_location={ 0 | 1 } +#@cli : Output selected images with same base filenames but for N different extensions. +#@cli : (eq. to 'ox'). +#@cli : Default value: 'output_at_same_location=0'. +outputx : +_gmic_s="$?" v + _$0 $* +_outputx : +$=arg +is_last_arg=0 is_same_location=0 +if isnum($-1) is_last_arg:=isint($-1)" && "$-1>=0" && "$-1<=1 is_same_location=$-1 fi +N:=$#-$is_last_arg s0= s1=s +if !$N e[0--3] "Output image"$_gmic_s" at same location, with same base filename but extension '' +(skipped, no extension provided)." return +fi +if $is_same_location +if $is_last_arg +e[0--4] "Output image"$_gmic_s" at same location, with same base filename but extension"${s{$N>1}}"' ${^-1}'." +else +e[0--4] "Output image"$_gmic_s" at same location, with same base filename but extension"${s{$N>1}}" '$*'." +fi +foreach { +repeat $N { ext=${arg{1+$>}} if isin(lowercase(['$ext']),'jpg','jpeg') ext.=,85 fi o {0,f}{0,b}.$ext } +} +else +if $is_last_arg e[0--4] "Output image"$_gmic_s" with same base filename but extension"${s{$N>1}}"' ${^-1}'." +else e[0--4] "Output image"$_gmic_s" with same base filename but extension"${s{$N>1}}" '$*'." +fi +foreach { +repeat $N { ext=${arg{1+$>}} if isin(lowercase(['$ext']),'jpg','jpeg') ext.=,85 fi o {0,b}.$ext } +} +fi +#@cli parse_cli : _output_mode,_{ * | command_name } +#@cli : Parse definition of '@cli'-documented commands and output info about them in specified output mode. +#@cli : 'output_mode' can be { ascii | bashcompletion | html | images | print }. +#@cli : Default values: 'output_mode=print' and 'command_name=*'. +parse_cli : skip "${1=print},${2=*}" +e[^-1] "Parse '#@cli' command(s) '$2' and output in '$1' mode." +l[] { +({'$$parse_cli_$1'}) rm +onfail error[0--2] "Command 'parse_cli': Invalid output mode '$1'." +} +if !$! l[] { it ${_path_rc}update$_version.gmic onfail } fi +if !$! return fi +i[0] ('\n') y a y +merge_multiline_comments +eval " +for (p = 0, p=h || i[r]==_'\n'?(copy(i[p],0,r - p,1,0); p = r; continue()); +(i[r]==_':' && i[r + 1]==_':')?( +r = find(#0,_'\n',r)%h; +):i[r]!=_':'?do( +r = find(#0,_'\n',r)%h; +crop(0,r,1,6)=='\n#@cli'?( +for (s = r + 6, s +begin( +ref(vector1024(),command); +ref(vector1024(),category); +); +for (p = 5, p=h#x || i[#x,p]==_'\n'?(run('=>[',x,'] __to_discard__'); break()); +i[#x,p]==_':' && i[#x,p + 1]==_':'?( # Category +for (p+=2, i[#x,p]<=_' ', ++p); +for (q = h#x - 1, i[#x,q]<=_' ', --q); +copy(category,i[#x,p],l = min(q - p + 1,size(category) - 1)); +category[l] = 0; +run('=>[',x,'] __to_discard__'); +):( +for (q = p, q_' ', ++q); +copy(command,i[#x,p],l = min(q - p,size(command) - 1)); +command[l] = 0; +run('=>[',x,'] \"',string(command,'@',category),'\"'); +)" +rm. rmn __to_discard__ +l { parse_cli_trigger_$1 $2 onfail } +fi +parse_cli_$1 +parse_cli_is_eqto : +nbl:="n = 1; for (p = 0, (q = find(#-1,_'\n',p))>=0, ++n, p = ++q); n" +u {$nbl"==1 && find(#-1,'eq. to \'')>=0"} +parse_cli_bashcompletion : +v 0 use_vt100 +sort_list +,n ++e "#"\n"# Bash completion rules for 'gmic'."\n"#"\n"# This file has been generated automatically."\n"# Do not edit!"\n"#"\n"# This file should be copied/renamed in '/usr/share/bash-completion/completions/gmic'."\n"#"\n\n"_gmic()"\n"{"\n" local cur prev opts coms"\n" if type -t _init_completion >/dev/null; then"\n" _init_completion -n = || return"\n" else"\n" COMPREPLY=()"\n" cur=\"${COMP_WORDS[COMP_CWORD]}\""\n" prev=\"${COMP_WORDS[COMP_CWORD-1]}\""\n" fi" +coms=" coms=\"" c= +foreach { +if s=['{n}'];s[0]==_'_' continue fi +('{n}') l. { s -,{'@'} name={0,t} rm } => $name +coms.=$c$name c=" " +} ++e $coms"\""\n" opts=$(echo \"$coms\" | sed \"s: \\([^ ]\\+\\): \\1 -\\1 \\+\\1:g\")"\n +repeat $! { +if s=['{$>,n}'];s[0]==_'_' continue fi +name={$>,n} +if ${parse_cli_is_eqto[$>]} ++l[$>] { s -,{'"eq. to "'} k. s -,39 eqto={0,t} rm } +l[$>] { +pass[$eqto] 0 k. => $name +onfail +warn "Warning: Ignoring shortcut '"$_vt100_c$name$_vt100_m$_vt100_b"', ""links to unknown command '"$_vt100_c$eqto$_vt100_m$_vt100_b"'." +=> __to_discard__ +} +fi +} +rmn __to_discard__ ++e " case \"${prev}\" in" +repeat $! { +if s=['{$>,n}'];s[0]==_'_' continue fi +l[$>] { +name={n} +if n=['$name'];"n[0]!=_'_' && find(n,'input')!=0 && find(n,'output')!=0 && ""find(n,'load')<0 && find(n,'save')<0 && ""n!='i' && n!='o' && n!='m' && n!='it' && n!='ot'" +if isin(['$name'],'help','h') ++e " \""$name"\" | \"-"$name"\" | \"+"$name"\")" ++e " COMPREPLY=( $(compgen -W \"$coms\" -- \"$cur\") ); return 0;;" +else +s -,{'\n'} k[0] discard {'#@cli'} max {'" "'} autocrop {'" "'} +s -,{':'} autocrop {'" "'} rm[0] replace {'" "'},{'_'} +n_args=0 args,c= repeat $! { if ['{/{$>,t}}']!='(+)' args.=$c{$>,t} c=" " n_args+=1 fi } +if $n_args==1 args="> "$args fi +if ['$args']!=0 ++e " \""$name"\" | \"-"$name"\" | \"+"$name"\")" ++e " COMPREPLY=( $(compgen -W \""{/{/$args}}"\") ); return 0;;" +fi +fi +rm 0 +fi +} +} ++e " esac"\n\n" COMPREPLY=( $(compgen -W \"$opts\" -- \"$cur\") )"\n" if type -t _filedir >/dev/null; then"\n" _filedir"\n" else"\n" comptopt -o filenames 2>/dev/null"\n" COMPREPLY=( $(compgen -f -- ${cur}) )"\n" fi"\n"}"\n"complete -F _gmic -o filenames gmic" +rm +parse_cli_trigger_bashcompletion : +parse_cli_trigger_print $* +parse_cli_ascii : +use_vt100 +if !narg($_shell_cols) _shell_cols:=${-shell_cols}-5 fi +category= n_category=0 +if !narg($_section) _section=1 fi +repeat $! { if s=['{$>,n}'];s[0]==_'_' continue fi l[$>] { +if !0$_no_categories +('{n}') l. { s -,{'@'} if $!>1 cat={t} fi rm } +if ['$cat']!=['$category'] +n_category+=1 +category=$cat +('$_section.$n_category." "') ('$category') +f.. {'" "'} +f.. {'-'} a[-4,-3] x a[-2,-1] x ++e \n" "$_vt100_r$_vt100_b{-2,t}$_vt100_n ++e " "$_vt100_r{t}$_vt100_n +rm[-2,-1] +fi +fi +s -,{'\n'} discard {'#@cli'} max {'" "'} autocrop {'" "'} ++l[0] { +s -,{'": "'} autocrop {'" "'} +name={0,t} rm[0] +is_builtin=0 +if $! +is_builtin:="find(#-1,'(+)')>=0" +if $is_builtin rm. fi +fi ++e "\n "$_vt100_m$_vt100_b$name${"s1,s0=\" (+)\", u $s"$is_builtin}:$_vt100_n +foreach { +if ${parse_cli_is_eqto.} +s -,39 eqto={1,t} k[0] ++e " "${_vt100_i}"Shortcut for command '"$_vt100_m$_vt100_b$eqto$_vt100_n"'." +else +eqto= +l. { _gmd2ascii_cut $_shell_cols,8 if $!>1 i[1--2] ('"\\\\\n "':y) a y fi } +str=" "{t}${"if "$<" u \" |\" else u \"\" fi"} ++e ${_vt100_c}$str$_vt100_n +fi +} +rm +} +rm[0] +n_example=0 nl="\n" +repeat $! { if {$>,i==_':'} l[$>] { +if "h==1 || (h==2 && i[-1,2]==_' ')" rm ('": "':y) fi +rows {1+(i[1]==_'" "')},100% +if "find(#0,'(eq. to ')>=0" # Found 'Eq. to' description. ++l { s -,{'\47'} shortcut={1,t} rm onfail shortcut="(unknown)" rm } ++e $nl" ("${_vt100_i}"equivalent to shortcut command '"$_vt100_m$_vt100_b$shortcut$_vt100_n"')." nl="\n" +elif "find(#0,'Default value:')>=0 || find(#0,'Default values:')>=0" # Found 'Default value(s):' description +if !0$_no_default_values +s +,{':'} +if $!>2" && "h#1==1" && "i("#1")==_':' +i[0] ('$_vt100_b':y) i[2] ('$_vt100_n':y) +fi +a y gmd2ascii $_shell_cols,5 +if $!>1 i[1--2] ('"\n "':y) a y fi autocrop {'\n'} ++e "\n "{/{t}} nl= +fi +elif i==_'$'" && "i[1]!=_'$' +if !0$_no_examples +rows 1,100% autocrop {'" "'} +_gmd2ascii_cut {$_shell_cols-8},7 +if $!>1 i[1--2] ('"\\\\\n "':y) a y fi autocrop {'\n'} +example={/{t}} +n_example+=1 +if $n_example==1 example_str=${_vt100_b}"Example:"$_vt100_n"\n "[#$n_example] nl="\n" +else example_str=" "[#$n_example] +fi ++e $nl" "$example_str" "$_vt100_c$example$_vt100_n nl= +fi +elif i==_'$'" && "i[1]==_'$' +if !0$_no_tutorial_link +if h==2 +url=https://gmic.eu/tutorial/$name +else +rows 2,100 autocrop {'" "'} url={t} +fi ++e "\n "${_vt100_b}"Tutorial: "$_vt100_n$_vt100_u$url$_vt100_n nl= +fi +else +parse_cli_text_ascii. +if w +e $nl{/{t}} nl= fi +fi +} fi } +rm 0 +} } rm u $eqto +parse_cli_text_ascii : +if !narg($_shell_cols) _shell_cols:=${-shell_cols}-5 fi +replace_str "\\n","\n" gmd2ascii $_shell_cols,0 +if w +s +,{'\n'} +if {i==_'\n'} rm. fi +eval "repeat (l,p, +i(#p)==_'\n'?( +h(#p)>2?resize(#p,1,1,1,1,0) +):( +resize(#p,1,h#p + 4,1,1,0,0,0,1); +copy(i[#p,0],_' ',4,1,0)) +)" +a y +fi +parse_cli_trigger_ascii : +if "['$1']!='*'" +1,$!,1,1," +begin(ref([lowercase(['$1']),_'@'],str)); +ref(lowercase(name(#y)),nm); +!find(nm,str)?y:-1" +discard. -1 if h k[{i}] else rm fi +fi +parse_cli_html : +v 0 use_vt100 e "" +html=""\n""\n" "\n" "\n" "\n" "\n" "\n\n" G'MIC - GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing ""- Reference Documentation"\n" "\n" "\n" "\n\n" "\n" "\n\n"
"\n\n" "\n\n""\n\n""\n +list_categories,c= +category,p_category= n,is_tr,is_table,row=0 +repeat $! { +if s=['{$>,n}'];s[0]==_'_' continue fi +l[$>] { +('{n}') l. { s -,{'@'} name={0,t} if $!>1 category={1,t} else category= fi rm } +if ['$category']!=['$p_category'] +strvar $category category_id=${} +if $is_tr +if $n%5" && "$row>1 html.="

"\n is_table=0 fi +html.="\n

"$category":

"\n" "\n +('$category') replace_str. ",","," lcategory={t} rm. +list_categories.=$c$lcategory c=, +is_table=1 +n,row=0 +fi +if !${parse_cli_is_eqto.} +is_builtin:="find(#-1,'(+)')>=0" +if !($n%5) +if $is_tr html.=" "\n fi +html.=" "\n +is_tr=1 row+=1 +fi +if ['$name']=='index' url_name=_index.html else url_name=$name.html fi +if $is_builtin +html.=" "\n +else +html.=" "\n +fi +n+=1 +fi +p_category=$category +} +} +if $is_tr +if $n%5" && "$row>1 html.=" "\n fi +html.=" "\n +fi +if $is_table html.="
"$name""$name"
"\n fi +html.="\n

Command Shortcuts:

"\n" "\n" "\n +repeat $! { +if s=['{$>,n}'];s[0]==_'_' continue fi +l[$>] { +('{n}') l. { s -,{'@'} name={0,t} if $!>1 category={1,t} else category= fi rm } +if ${parse_cli_is_eqto.} +is_builtin:="find(#-1,'(+)')>=0" ++l { s -,{'"eq. to \47"'} k. s -,{'\47'} k[0] autocrop {'" "'} eqto={t} rm } +('$name') replace_str. ">",">" replace_str. "<","<" html_name={t} rm. +html.=" " +if $is_builtin +html.="" +else +html.="" +fi +html.=""\n +n+=1 +fi +} +} +if $is_table html.="
Shortcut name""Equivalent command name
"$html_name""$eqto""$eqto"
"\n fi +html.=\n""\n\n""\n"
"\n" "\n" " +({'$html'}:y) +toc_html="

Categories:

    "\n +repeat narg({/$list_categories}) { +arg0 $>,{/$list_categories} category=${} +('$category') replace_str. ",","," category={t} rm. +strvar $category category_id=${} +toc_html.="
  • "$category"
  • "\n +} +toc_html.="
  • Command Shortcuts
  • "\n +toc_html.="
" +replace_str. "",$toc_html +ot. list_of_commands.html +if !isfile('index.html') x "ln -fs list_of_commands.html index.html" fi +rm. +repeat $! { +if s=['{$<,n}'];s[0]==_'_' rm[$<] else l[$<] { +('{n}') l. { s -,{'@'} name={0,t} if $!>1 category={1,t} else category= fi rm } +is_eqto=${parse_cli_is_eqto.} +if !$is_eqto _is_$name=1 else rm fi +onfail rm +} fi +} +foreach { +('{n}') l. { s -,{'@'} name={0,t} if $!>1 category={1,t} else category= fi rm } +e "\r > "$_vt100_c[#{1+$>}]$_vt100_n" "{`s=vector48(_'" "');copy(s,['$category" / "$name']);s`} +if !$> previous= else pass[{$>-1}] 1 ('{n}') discard. {'_c1'} previous={t} rm[-2,-1] fi +if !$< next= else pass[{$>+1}] 1 ('{n}') l. { s -,{'@'} next={0,t} rm } rm. fi +if ['$name']=='index' url_name=_index.html else url_name=$name.html fi +if ['$previous']=='index' url_previous=_index.html else url_previous=$previous.html fi +if ['$next']=='index' url_next=_index.html else url_next=$next.html fi +strvar[] $category category_id=${} +html=""\n""\n" "\n" "\n" "\n" "\n" "\n\n" G'MIC - GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing ""- Reference Documentation - "$name""\n" "\n" "\n" "\n" "\n" "\n\n" "\n" "\n\n" ""
"\n\n" "\n\n""\n\n +if !0$_pdf_output +html.=" " +if narg($previous)" || "narg($next) +html.=""\n +fi +html.="
""Table of Contents  ▸  ""List of Commands  ▸  """$category"  ▸  """$name"" +if narg($previous) html.="◀  "$previous"" fi +if narg($previous)" && "narg($next) html.="    |    " fi +if narg($next) html.=""$next"  ▶" fi +html.="
\n" +else +html.=""\n +fi +s -,{'\n'} discard {'#@cli'} max {'" "'} autocrop {'" "'} ++l[0] { +s -,{'": "'} autocrop {'" "'} rm[0] +is_builtin=0 +if $!" && find(#-1,'(+)')>=0" is_builtin=1 rm. fi +if $is_builtin +html.="

"$name"

Built-in command
"\n +else +html.="

"$name"

"\n +fi +if $! +html.="\n

Arguments:

\n
    "\n +if $!>1 or="    or" else or= fi +foreach { +if !$< or= fi +html.="
  • "{t}""$or"
  • "\n +} +html.="
"\n +else +html.="\n

No arguments

"\n +fi +rm +} +rm[0] +html.="\n

Description:

"\n +line=0 +n_example=0 +nb_examples=0 +is_tutorial_tag=0 +tutorial_html= +repeat $! { +if {$>,i==_':'} l[$>] { +if "h==1 || (h==2 && i[-1,2]==_' ')" rm ('": "':y) fi +rows {1+(i[1]==_'" "')},100% +if i==_'$'" && "i[1]!=_'$' nb_examples+=1 fi +} fi +} +foreach { +if "find(#0,'(eq. to ')>=0" ++l { s -,{'\47'} +replace_str[1] "&","&" +replace_str[1] "<","<" +replace_str[1] ">",">" +shortcut={1,t} +rm +onfail shortcut="(unknown)" rm +} +html.="

(equivalent to shortcut command "$shortcut").

"\n +elif "find(#0,'See also:')>=0" +s +,{':'} autocrop {'" "'} +if $!>2" && "h#1==1" && "i("#1")==_':' +html.="\n

See also:

"\n +rm[0,1] +fi +a y +gmd2html 0 +html.=" "{t}\n +elif "find(#0,'Default value:')>=0 || find(#0,'Default values:')>=0" +s +,{':'} autocrop {'" "'} +if $!>2" && "h#1==1" && "i("#1")==_':' +html.="\n

Default values:

"\n +rm[0,1] +fi +a y +gmd2html 0 +html.="

"{t}"

"\n +elif i==_'$'" && "i[1]!=_'$' +rows 1,100% autocrop {'" "'} +if !0$_pdf_output +replace_str "image.jpg","""image.jpg" +fi +example={/{t}} +n_example+=1 +if $n_example>1 basename=${name}_$n_example.jpg else basename=${name}.jpg fi +if $n_example==1 +if !$is_tutorial_tag html.="" is_tutorial_tag=1 fi +html.="\n

Example"${"if "$nb_examples">1 u s else u \"\" fi"}" of use:

"\n fi +if $nb_examples!=1 html.="

• Example \#"$n_example"

"\n fi +html.="
"$example"

"\n +if 0$_pdf_output html.="
"\n fi +if isfile('img/f_$basename') +if !0$_pdf_output +html.=" """"
Command: "$example"
"\n +else +html.=""\n +fi +elif isfile('img/f0_$basename') +i=0 +html.="
" +for isfile('img/f${i}_$basename') { +if !0$_pdf_output +html.=" """"
Command: "$example"
"\n +else +html.=""\n +fi +i+=1 +} +html.="
" +fi +if 0$_pdf_output html.="
"\n fi +elif i==_'$'" && "i[1]==_'$' +if !$is_tutorial_tag html.="" is_tutorial_tag=1 fi +if h==2 +url=https://gmic.eu/tutorial/$name +l[] { it $url if "find(#-1,'404 Not Found')>=0" url=https://gmic.eu/oldtutorial/_$name fi rm } +else +rows 2,100 autocrop {'" "'} url={t} +fi +tutorial_html.="

This command has a ""tutorial page.

" +else ++autocrop {"' '"} is_list:="isin(i,_'*',_'-',_'.')" rm. +('\n') a y +replace_str "\\n","\n" gmd2html 0 +if $line==1" && "!$is_list html.="
"\n fi +html.={t} +if i[-1,2]!=_'\n' html.="\n" fi +line+=1 +fi +} +html.=\n""\n\n""\n"
"\n" "\n" " +rm ({'$html'}:y) +replace_str. "",$tutorial_html +=> $name ot $url_name +} +rm +e "\r > "${_vt100_g}{`s=vector64(_'" "');copy(s,'"Parsing done!"');s`}$_vt100_n +parse_cli_trigger_html : +parse_cli_trigger_print $* +parse_cli_images : +v 0 use_vt100 e "" +old_category,category= n_category,n_example=0 +if !isfile('image.jpg') l[] { sp bottles,640 onfail testimage2d 500 } o. image.jpg rm. fi +n_global=0 +repeat $! { +if s=['{$>,n}'];s[0]==_'_' continue fi +l[$>] { +('{n}') l. { s -,{'@'} name={0,t} if $!>1 category={1,t} else category= fi rm } +if ['$category']!=['$old_category'] +n_category+=1 +e $_vt100_r"\n ** Section \#"$n_category": "$category"."$_vt100_n"\n" +fi +s -,{'\n'} discard {'#@cli'} max {'" "'} autocrop {'" "'} +n_example=0 +foreach { +if "i==_':' && ( +for (p = 1, p1 +basename=${name}_$n_example.jpg +else +basename=${name}.jpg +fi +e $_vt100_c[$n_global]$_vt100_n" Command '"$_vt100_g$name$_vt100_n"': $ "$example +skip_rendering:="['"$name"'][0]==_'_' || ""(isfile(['"{/${_parse_cli_images_path}f_$basename}"']) &&"" isfile(['"{/${_parse_cli_images_path}t_$basename}"'])) || ""(isfile(['"{/${_parse_cli_images_path}f0_$basename}"']) && ""isfile(['"{/${_parse_cli_images_path}t0_$basename}"']))" +if !$skip_rendering +m "run_example : "$example +l[] { +reset etime=$| +run_example +etime="done in "$_vt100_n{_round($|-$etime,0.01)}"s"$_vt100_m +_parse_cli_images 1 +if $! +if $!>1 repeat $! { o[$>] ${_parse_cli_images_path}f$>_$basename,85 } +else o ${_parse_cli_images_path}f_$basename,85 fi +rr2d 480,320,0,2 +if $!>1 repeat $! { o[$>] ${_parse_cli_images_path}t$>_$basename,75 } +else o ${_parse_cli_images_path}t_$basename,75 fi +rm +fi +} +um run_example +else etime="skipped" +fi +e "\r"$_vt100_c[$n_global]$_vt100_n" Command '"$_vt100_g$name$_vt100_n"': $ "$example" "${_vt100_m}"("$etime")."$_vt100_n +fi +} +old_category=$category +rm 0 +} +} +rm +_parse_cli_images : l[] { check "isbool(${1=1})" is_arg=1 arg1=$1 onfail is_arg=0 arg1=1 } +if !$is_arg noarg fi +if !$! rm return fi +W,H=640,480 +foreach { +nm={n} label=[$>]:" "'$nm' +if ${-is_mesh3d} +label2="("{i[6]}" vert., "{i[7]}" prim.)" +r3d 1,1,0,-80 r3d 0,1,0,80 snapshot3d {max($W,$H)} +else +label2="("{w}x{h}x{d}x{s}")" +if s>4 channels 0,2 fi +r 100%,100%,100%,{max(s,3)},{s==1} +if d>1 ++slices 50% ++z[0] 50%,0,0,50%,100%,100% permute. zyxc ++z[0] 0,50%,0,100%,50%,100% permute. xzyc +rr2d... $W,$H,0,2 +r2dy.. {-3,h},1 +r2dx. {-3,w},1 +s:=min(w#-2,h) +if $s>64 projections3d[0] 50%,50%,50%,1 mv[0] $! r3d. 1,1,0,-80 r3d. 0,1,0,80 snapshot3d. $s +else rm[0] 0 +fi +eW,eH:=[w#0+w#1,h#0+h#2] +if $eW>$W" || "$eH>$H fact:=min($W/$eW,$H/$eH)*100 r $fact%,$fact%,1,100%,2 fi +n 0,255 +fs={0,max(w,h)*7%} +if {0,h>1.5*$fs} to[0] XY,4,2,$fs fi +if {1,h>1.5*$fs} to[1] XZ,4,2,$fs fi +if {2,h>1.5*$fs} to[2] YZ,4,2,$fs fi +if w to[3] 3D,4,2,$fs frame[3] 1,1,200 fi +frame[0-2] 1,1,200 +a[0,1] x a[1,2] x a y +fi +fi +if w>5*h r $W,{$H/3},1,100%,1 +elif h>5*w r {$W/3},$H,1,100%,1 +else rr2d $W,$H,0,{w<$W&&h<$H?1:2} +fi +n 0,255 +if $arg1 +if s>3 drgba fi +r {[w,h]+2},1,100%,0,0,0.5,0.5 +- 245 r {[w+10,h+5]},1,100%,0,0,0.5,0.5 r 100%,{h+1},1,100%,0,0,0,1 + 245 +0 t. $label" "$label2,5,0,32,1,1 +if w>w#0" || "h>h#0 +rm. 0 t. $label\n$label2,5,0,32,1,1 +if w>w#0" || "h>h#0 rr2d. {0,[w,h]},0,2 fi +fi +*. -1 n. 0,255 to_rgb. +- 245 a y,0.5 + 245 +fi +} +c 0,255 +parse_cli_trigger_images : +parse_cli_trigger_print $* +parse_cli_list : +res= +repeat $! { ('{$>,n}') l. { s -,{'@'} res.=$c{0,t} c=, rm } } +rm u $res +parse_cli_print : +v 0 e "" +sort_list +,n +foreach { +is_native:="find(#-1,' : (+)')>0" +('{n}') l. { s -,{'@'} name={0,t} rm } +if $is_native +e $name" (+)" else +e $name fi +} +rm +parse_cli_trigger_print : +if "['$1']!='*'" +1,$!,1,1," +begin(ref(lowercase(['$1']),str)); +ref(lowercase(name(#y)),nm); +arobace = find(nm,_'@'); +inrange(find(nm,str),0,arobace - 1)?y:-1" +discard. -1 k[{^}] +fi +#@cli parse_gmd +#@cli : Parse and tokenize selected images, viewed as text strings formatted with the G'MIC markdown syntax. +parse_gmd : +e[^-1] "Parse and tokenize images$? viewed as text strings formatted with the G\47MIC markdown syntax." +y 1 a[^-1] .,y rm. +eval[^] ">"${-_gmd_tokens}" +begin( +section = subsection = subsubsection = subsubsubsection = anchor = +bullet = subbullet = subsubbullet = center = right = table = blockquote = detail_block = code_block = +shell = bold_italic_a = bold_italic_u = bold_a = bold_u = italic_a = italic_u = strikethrough = underline = +monospace = value_set = word_highlight = url = page_link = text_link1 = text_link2 = img1 = img2 = pipeline = +formula = opening_offset = -1; +blank(c) = isin(c,_' ',_'\n',s_whitespace,s_tab,0); +semiblank(c) = isin(c,_' ',_'\n',_'.',_',',_';',_':',_'!',_'?', +_')',_'(',_'[',_']',_'|',_'-',s_whitespace,s_tab,0); +newline(c) = isin(c,_'\n',0); +reset(c) = (#c = -1); +res = crop(); +); +pc = j[-1]; c = i; nc = j[1]; ac = j[2]; +ym1 = y - 1; y1 = y + 1; y2 = y + 2; +linestart = newline(pc); +is_raw = max(blockquote,code_block,shell,monospace,url,page_link,text_link2,img2,pipeline,formula)>=0; +non_escaped = is_raw || (pc!=_'\\'); +!non_escaped && +isin(c,_'%',_'$',_'\\',_'\'',_'`',_'*',_'_',_'{',_'}',_'[',_']',_'<',_'>',_'(',_')',_'#',_'+',_'-',_'.',_'!')?( +res[ym1] = i[ym1] = 0; +): +linestart && c==_'#' && nc==_' '?( # Opening +section = y; +): +section>=0 && newline(c)?( +opening_offset = section; +res[section++] = s_section; +while (blank(res[section]), res[section++] = 0); +res[y] = e_section; +for (p = opening_offset - 1, p>=0 && res[p]==_'\n', res[p--] = 0); +for (p = ym1, p>opening_offset && blank(res[p]), res[p--] = 0); +for (p = y1, p=0 && newline(c)?( +opening_offset = subsection; +res[subsection++] = s_subsection; res[subsection++] = 0; +while (blank(res[subsection]), res[subsection++] = 0); +res[y] = e_subsection; +for (p = ym1, p>opening_offset && blank(res[p]), res[p--] = 0); +for (p = y1, p=0 && newline(c)?( +opening_offset = subsubsection; +res[subsubsection++] = s_subsubsection; copy(res[subsubsection],0,2,1,0); subsubsection+=2; +while (blank(res[subsubsection]), res[subsubsection++] = 0); +res[y] = e_subsubsection; +for (p = ym1, p>opening_offset && blank(res[p]), res[p--] = 0); +for (p = y1, p=0 && newline(c)?( +opening_offset = subsubsubsection; +res[subsubsubsection++] = s_subsubsubsection; copy(res[subsubsubsection],0,3,1,0); subsubsubsection+=3; +while (blank(res[subsubsubsection]), res[subsubsubsection++] = 0); +res[y] = e_subsubsubsection; +for (p = ym1, p>opening_offset && blank(res[p]), res[p--] = 0); +for (p = y1, p=0 && newline(c)?( +opening_offset = anchor; +res[anchor++] = s_anchor; +while (blank(res[anchor]), res[anchor++] = 0); +res[y] = e_anchor; +res[y1]==_'\n'?(res[y1] = 0); +for (p = ym1, p>opening_offset && blank(res[p]), res[p--] = 0); +): +linestart && isin(c,_'-',_'*',_'+') && nc==_' ' && bullet<0?( +bullet = y; +): +bullet>=0 && newline(c)?( +opening_offset = bullet; +res[bullet++] = s_bullet; res[bullet] = 0; +res[y] = e_bullet; +): +linestart && c==_' ' && nc==_' ' && isin(ac,_'-',_'*',_'+') && j[3]==_' ' && subbullet<0?( +subbullet = y; +): +subbullet>=0 && newline(c)?( +opening_offset = subbullet; +res[subbullet++] = s_subbullet; copy(res[subbullet],0,2,1,0); +res[y] = e_subbullet; +): +linestart && c==_' ' && nc==_' ' && ac==_' ' && j[3]==_' ' && isin(j[4],_'-',_'*',_'+') && j[5]==_' ' && +subsubbullet<0?( +subsubbullet = y; +): +subsubbullet>=0 && newline(c)?( +opening_offset = subsubbullet; +res[subsubbullet++] = s_subsubbullet; copy(res[subsubbullet],0,4,1,0); +res[y] = e_subsubbullet; +): +linestart && c==_'=' && nc==c && ac==c && newline(j[3])?( +center<0?( +center = y; +): +center>=0 && y>center + 3?( +opening_offset = center; +res[center++] = s_center; copy(res[center],0,3,1,0); center+=3; +newline(res[ym1])?(res[ym1] = 0); +res[y] = e_center; copy(res[y + 1],0,3,1,0); +); +): +linestart && c==_'>' && nc==c && ac==c && newline(j[3])?( +right<0?( +right = y; +): +right>=0 && y>right + 3?( +opening_offset = right; +res[right++] = s_right; copy(res[right],0,3,1,0); right+=3; +newline(res[ym1])?(res[ym1] = 0); +res[y] = e_right; copy(res[y + 1],0,3,1,0); +); +): +table<0 && linestart && c==_'|'?( +table = y; +): +table>=0 && newline(c) && nc!=_'|'?( +opening_offset = table; +d = i[table + 1]; +d==_'|'?(res[table++] = s_htable; res[table++] = 0): +d==_'-'?(res[table++] = s_vtable; res[table++] = 0): +d==_'+'?(res[table++] = s_hvtable; res[table++] = 0):(res[table++] = s_table); +i[table]==_' '?(res[table++] = 0); +newline(i[table]) && i[table + 1]==_'|'?(copy(res[table],0,2,1,0); table+=2); +for (p = table, p' && blank(nc)?( +blockquote = y; +): +blockquote>=0 && newline(c) && (nc!=_'>' || !blank(ac))?( +opening_offset = blockquote; +res[blockquote++] = s_blockquote; res[blockquote] = 0; +for (p = blockquote, p'?copy(res[p],0,res[p + 1]==_' '?2:1,1,0)); +res[y] = e_blockquote; +): +linestart && c==_'?' && nc==c && ac==c && blank(j[3])?( +detail_block<0?( +detail_block = y; +): +detail_block>=0 && y>detail_block + 3 && newline(j[3])?( +opening_offset = detail_block; +res[detail_block++] = s_detail_block; copy(res[detail_block],0,2,1,0); +res[ym1] = e_detail_block; copy(res[y],0,4,1,0); +); +): +linestart && isin(c,_'~',_'`') && nc==c && ac==c && newline(j[3])?( +code_block<0?( +code_block = y; +): +code_block>=0 && y>code_block + 3?( +opening_offset = code_block; +res[code_block++] = s_code_block; copy(res[code_block],0,3,1,0); code_block+=3; +copy(res[code_block],i[code_block],y - code_block); +for (p = code_block, p=0 && y>shell + 3?( +opening_offset = shell; +res[shell++] = s_shell; copy(res[shell],0,3,1,0); shell+=3; +copy(res[shell],i[shell],y - shell); +res[ym1] = e_shell; copy(res[y],0,4,1,0); +); +): +linestart && isin(c,_'-','_','*') && nc==c && ac==c && newline(j[3])?( +res[y] = s_hrule; +copy(res[y1],0,3,1,0); +): +non_escaped && c==_'*' && nc==c && ac==c?( +bold_italic_a<0?( +bold_italic_a = y; +): +bold_italic_a>=0 && y>bold_italic_a + 3 && j[3]!=_'*'?( +opening_offset = bold_italic_a; +res[bold_italic_a++] = s_bold_italic_a; res[bold_italic_a++] = 0; res[bold_italic_a] = 0; +res[y] = e_bold_italic_a; res[y1] = res[y2] = 0; +); +): +non_escaped && c==_'_' && nc==c && ac==c?( +bold_italic_u<0 && semiblank(pc)?( +bold_italic_u = y; +): +bold_italic_u>=0 && y>bold_italic_u + 3 && semiblank(j[3])?( +opening_offset = bold_italic_u; +res[bold_italic_u++] = s_bold_italic_u; res[bold_italic_u++] = 0; res[bold_italic_u] = 0; +res[y] = e_bold_italic_u; res[y1] = res[y2] = 0; +); +): +non_escaped && c==_'*' && nc==c?( +bold_a<0?( +bold_a = y; +): +bold_a>=0 && y>bold_a + 2 && ac!=_'*'?( +opening_offset = bold_a; +res[bold_a++] = s_bold_a; res[bold_a] = 0; +res[y] = e_bold_a; res[y1] = 0; +); +): +non_escaped && c==_'_' && nc==c?( +bold_u<0 && semiblank(pc)?( +bold_u = y; +): +bold_u>=0 && y>bold_u + 2 && semiblank(ac)?( +opening_offset = bold_u; +res[bold_u++] = s_bold_u; res[bold_u] = 0; +res[y] = e_bold_u; res[y1] = 0; +); +): +non_escaped && c==_'*' && pc!=c?( +italic_a<0?( +italic_a = y; +): +italic_a>=0 && y>italic_a + 1 && ac!=_'*'?( +opening_offset = italic_a; +res[italic_a] = s_italic_a; +res[y] = e_italic_a; +); +): +non_escaped && c==_'_' && pc!=c?( +italic_u<0 && semiblank(pc)?( +italic_u = y +): +italic_u>=0 && y>italic_u + 1 && semiblank(nc)?( +opening_offset = italic_u; +res[italic_u] = s_italic_u; +res[y] = e_italic_u; +); +): +non_escaped && c==_'~' && nc==c && pc!=c?( +strikethrough<0?( +strikethrough = y; +): +strikethrough>=0 && y>strikethrough + 2?( +opening_offset = strikethrough; +res[strikethrough++] = s_strikethrough; res[strikethrough] = 0; +res[y] = e_strikethrough; res[y1] = 0; +); +): +non_escaped && c==_'=' && nc==c && pc!=c?( +underline<0?( +underline = y; +): +underline>=0 && y>underline + 2?( +opening_offset = underline; +res[underline++] = s_underline; res[underline] = 0; +res[y] = e_underline; res[y1] = 0; +); +): +non_escaped && c==_'`'?( +monospace<0?( +monospace = y; +): +monospace>=0 && y>monospace + 1?( +opening_offset = monospace; +res[monospace++] = s_monospace; +copy(res[monospace],i[monospace],y - monospace); +for (p = monospace, p=0 && y>value_set + 1 && semiblank(nc)?( +opening_offset = value_set; +res[value_set++] = s_value_set; +copy(res[value_set],i[value_set],y - value_set); +res[y] = e_value_set; +): +non_escaped && c==_'\'' && nc!=c?( +word_highlight<0 && semiblank(pc)?( +word_highlight = y; +): +word_highlight>=0 && y>word_highlight + 1 && semiblank(nc)?( +opening_offset = word_highlight; +res[word_highlight++] = s_word_highlight; +copy(res[word_highlight],i[word_highlight],y - word_highlight); +res[y] = e_word_highlight; +); +): +non_escaped && c==_'<' && url<0 && +(crop(0,y1,1,8)=='https://' || crop(0,y1,1,7)=='http://' || crop(0,y1,1,6)=='ftp://')?( +url = y; +): +non_escaped && c==_'>' && url>=0 && y>url + 1?( +opening_offset = url; +res[url++] = s_url; +copy(res[url],i[url],y - url); +res[y] = e_url; +): +non_escaped && c==_'\'' && nc==c?( +page_link<0 && semiblank(pc)?( +page_link = y; +): +page_link>=0 && y>page_link + 2 && semiblank(ac)?( +opening_offset = page_link; +res[page_link++] = s_page_link; res[page_link++] = 0; +copy(res[page_link],i[page_link],y - page_link); +res[y] = e_page_link; res[y1] = 0; +); +): +non_escaped && c==_'[' && text_link1<0 && text_link2<0 && img1<0?( +text_link1 = y; +): +non_escaped && c==_']' && nc==_'(' && text_link1>=0 && text_link2<0 && img1<0?( +text_link2 = y; +): +non_escaped && c==_')' && text_link2>=0 && img1<0?( +opening_offset = text_link1; +res[text_link1] = s_text_link; +res[text_link2++] = m_text_link; res[text_link2++] = 0; +copy(res[text_link2],i[text_link2],y - text_link2); +res[y] = e_text_link; +): +non_escaped && c==_'!' && nc==_'[' && img1<0 && img2<0?( +img1 = y; +): +non_escaped && c==_']' && nc==_'(' && img1>=0 && img2<0?( +img2 = y; +): +non_escaped && c==_')' && img2>=0?( +opening_offset = img1; +res[img1++] = s_img; res[img1++] = 0; +res[img2++] = m_img; res[img2++] = 0; +copy(res[img1],i[img1],img2 - img1 - 2); copy(res[img2],i[img2],y - img2); +res[y] = e_img; +): +non_escaped && c==_'%' && nc==c?( +pipeline<0 && semiblank(pc)?( +pipeline = y; +): +pipeline>=0 && y>pipeline + 2 && semiblank(ac)?( +opening_offset = pipeline; +res[pipeline++] = s_pipeline; res[pipeline++] = 0; +copy(res[pipeline],i[pipeline],y - pipeline); +while (blank(i[pipeline]), res[pipeline++] = 0); +for (p = ym1, blank(res[p]), res[p--] = 0); +res[y] = e_pipeline; res[y1] = 0; +); +): +non_escaped && c==_'$' && nc==c?( +formula<0 && semiblank(pc)?( +formula = y; +): +formula>=0 && y>formula + 2 && semiblank(ac)?( +opening_offset = formula; +res[formula++] = s_formula; res[formula++] = 0; +copy(res[formula],i[formula],y - formula); +while (blank(i[formula]), res[formula++] = 0); +for (p = ym1, blank(res[p]), res[p--] = 0); +res[y] = e_formula; res[y1] = 0; +); +): +semiblank(pc) && c==_'\\' && nc==_'G' && ac==_'\'' && j[3]==_'M' && j[4]==_'I' && j[5]==_'C' && semiblank(j[6])?( +res[y] = s_gmic; +copy(res[y1],0,4,1,0); +res[y + 5] = e_gmic; +): +c==_' '?( +c==_' ' && (linestart || pc==c)?( +res[y] = s_whitespace; +); +reset(word_highlight); +reset(url); +text_link2>=0?(reset(text_link1); reset(text_link2)); +img2>=0?(reset(img1); reset(img2)); +): +c==_'\\' && nc==_'n'?( +res[y] = _'\n'; res[y + 1] = 0; +): +c==_'\t'?( +res[y] = s_tab; +): +c==_'\n'?( +reset(bold_italic_a); +reset(bold_italic_u); +reset(bold_u); +reset(bold_a); +reset(italic_a); +reset(italic_u); +reset(strikethrough); +reset(underline); +reset(monospace); +reset(word_highlight); +reset(url); +reset(page_link); +text_link2>=0?(reset(text_link1); reset(text_link2)); +img2>=0?(reset(img1); reset(img2)); +); +opening_offset>=0?( +section>=opening_offset ? reset(section); +subsection>=opening_offset ? reset(subsection); +subsubsection>=opening_offset ? reset(subsubsection); +subsubsubsection>=opening_offset ? reset(subsubsubsection); +anchor>=opening_offset ? reset(anchor); +bullet>=opening_offset ? reset(bullet); +subbullet>=opening_offset ? reset(subbullet); +subsubbullet>=opening_offset ? reset(subsubbullet); +center>=opening_offset ? reset(center); +right>=opening_offset ? reset(right); +table>=opening_offset ? reset(table); +blockquote>=opening_offset ? reset(blockquote); +detail_block>=opening_offset ? reset(detail_block); +code_block>=opening_offset? reset(code_block); +shell>=opening_offset? reset(shell); +bold_italic_a>=opening_offset ? reset(bold_italic_a); +bold_italic_u>=opening_offset ? reset(bold_italic_u); +bold_a>=opening_offset ? reset(bold_a); +bold_u>=opening_offset ? reset(bold_u); +italic_a>=opening_offset ? reset(italic_a); +italic_u>=opening_offset ? reset(italic_u); +strikethrough>=opening_offset ? reset(strikethrough); +underline>=opening_offset ? reset(underline); +monospace>=opening_offset ? reset(monospace); +value_set>=opening_offset ? reset(value_set); +word_highlight>=opening_offset ? reset(word_highlight); +url>=opening_offset ? reset(url); +page_link>=opening_offset ? reset(page_link); +text_link1>=opening_offset || text_link2>=opening_offset ? (reset(text_link1); reset(text_link2)); +img1>=opening_offset || img2>=opening_offset ? (reset(img1); reset(img2)); +pipeline>=opening_offset ? reset(pipeline); +formula>=opening_offset ? reset(formula); +opening_offset = -1; +); +end(copy(i[0],res))" +discard 0 +#@cli gmd2html : _include_default_header_footer={ 0:none | 1:Reference | 2:Tutorial | 3:News } : (no arg) +#@cli : Convert selected gmd-formatted text images to html format. +#@cli : Default values: 'include_default_header_footer=1'. +gmd2html : skip "${1=}" +l[] { is_arg:=isint("$1") onfail is_arg=0 } +if $is_arg embed_html=$1 else embed_html=1 noarg fi +parse_gmd +s_section,e_section={${-_gmd_tokens}"[s_section,e_section]"} +foreach { +nm$>={b} strvar ${nm$>} fnm=${} +if "i=="$s_section" && find(#-1,"$e_section")>0" ++rows 1,{"find(#-1,"$e_section")-1"} title$>={t} rm. +else title$>= +fi +. +eval. "> +begin("${-_gmd_tokens}${-_gmd_write}"); +c = i; +c>0?( +c==_'\n' ? write('
\n'): +c==_'&' ? write('&'): +c==_'\47' ? write('''): +c==_'>' ? write('>'): +c==_'\"' ? write('"'): +c==_'<' ? write('<'): +write(c); +):( +isin(c,e_bold_a,e_bold_u,e_bold_italic_a,e_bold_italic_u,e_italic_a,e_italic_u, +e_monospace,e_strikethrough,e_underline,e_word_highlight) ? write(''): +isin(c,e_bullet,e_subbullet,e_subsubbullet) ? write('\n'): +isin(c,e_section,e_subsection,e_subsubsection,e_subsubsubsection) ? write('\n'): +c==s_section ? ( +ind_e = find(#1,e_section,y); +run('_gmd2html_section. ',y + 1,',',ind_e - 1); +ref(get('_gmd_name',1024,1),str_nam); +write_nl(); +write('
'); +): +c==s_subsection ? ( +ind_e = find(#1,e_subsection,y); +run('_gmd2html_section. ',y + 1,',',ind_e - 1); +ref(get('_gmd_name',1024,1),str_nam); +write_nl(); +write('
'); +): +c==s_subsubsection ? ( +ind_e = find(#1,e_subsubsection,y); +run('_gmd2html_section. ',y + 1,',',ind_e - 1); +ref(get('_gmd_name',1024,1),str_nam); +write_nl(); +write('
'); +): +c==s_subsubsubsection ? ( +ind_e = find(#1,e_subsubsubsection,y); +run('_gmd2html_section. ',y + 1,',',ind_e - 1); +ref(get('_gmd_name',1024,1),str_nam); +write_nl(); +write('
'); +): +c==s_anchor ? ( +ind_e = find(#1,e_anchor,y); +run('_gmd2html_section. ',y + 1,',',ind_e - 1); +ref(get('_gmd_name',1024,1),str_nam); +write('\n'); +copy(i[y],0,ind_e - y + 1,1,0); +): +c==s_bullet ? write('
'): +c==s_subbullet ? write('
'): +c==s_subsubbullet ? write('
'): +c==s_center ? write('
\n'): +c==e_center ? (write_nl(); write('
')): +c==s_right ? write('
\n'): +c==e_right ? (write_nl(); write('
')): +c==s_table ? (write_nl(); write('\n
')): +c==s_htable ? (write_nl(); write('\n
')): +c==s_vtable ? (write_nl(); write('\n
')): +c==s_hvtable ? (write_nl(); write('\n\n\n
')): +c==m_table ? write(''): +c==n_table ? write('
'): +c==e_table ? write('
\n'): +c==s_blockquote ? (write_nl(); write('
\n')): +c==e_blockquote ? (write('\n
\n')): +c==s_detail_block ? ( +write_nl(); +write('
\n'); +ny = y + 1; +nc = j[1]; +nc!=e_detail_block?( +j[1] = 0; +ind_e = find(#1,e_detail_block,ny); +nc==_' '?( +ind_nl = find(#1,_'\n',ny); +ind_nl<0 || ind_nl>ind_e?(ind_nl = ind_e); +write(#1,y + 2,ind_nl - y - 2); +copy(i[ny],0,ind_nl - y - 1,1,0); +i[ind_nl]!=e_detail_block?(i[ind_nl] = 0); +):write('Details:'); +write('\n'); +) +): +c==e_detail_block ? (write_nl(); write('
\n')): +c==s_code_block ? write('
'): +c==e_code_block ? write('
\n'); +c==s_shell ? ( +ind_e = find(#1,e_shell,y); +run('_gmd2html_shell. ',y + 1,',',ind_e - 1); +ref(get('_gmd_command',1024,1),str_com); +write('
$ '); +len = find(str_com,0); +write(str_com,len); +write('

\n'); +write(#-1,0,h(#-1)); +run('rm.'); +write('
\n'); +copy(i[y],0,ind_e - y + 1,1,0); +): +c==s_hrule ? (write_nl(); write('
\n')): +c==s_bold_italic_a ? write(''): +c==s_bold_italic_u ? write(''): +c==s_bold_a ? write(''): +c==s_bold_u ? write(''): +c==s_italic_a ? write(''): +c==s_italic_u ? write(''): +c==s_strikethrough? write(''): +c==s_underline? write(''): +c==s_monospace ? write(''): +c==s_value_set ? write('{'): +c==e_value_set ? write('}'): +c==s_word_highlight ? write(''): +c==s_url ? ( +ind_e = find(#1,e_url,y); +write(''); +): +c==e_url ? write(''): +c==s_page_link ? ( +ind_e = find(#1,e_page_link,y); +run('_gmd2html_page_link. ',y + 1,',',ind_e - 1); +ref(get('_gmd_link',1024,1),str_link); +ref(get('_gmd_text',1024,1),str_text); +write(''); +len = find(str_text,0); +write(str_text,len); +write(''); +copy(i[y],0,ind_e - y + 1,1,0); +): +c==s_text_link ? ( +ind_m = find(#1,m_text_link,y); +ind_e = find(#1,e_text_link,ind_m); +write(''): +write('\" target=\"_blank\">'); +): +c==m_text_link ? ( +ind_e = find(#1,e_text_link,y); +copy(i[y],0,ind_e - y + 1,1,0); +write(''); +): +c==s_img ? ( +ind_m = find(#1,m_img,y); +ind_e = find(#1,e_img,ind_m); +ind_d = find(#1,_'.',ind_e - 1,-1); +is_video = 0; +ind_d>ind_m?( +ref(crop(#1,0,ind_d + 1,1,3),ext3); +ref(crop(#1,0,ind_d + 1,1,4),ext4); +is_video = isin(ext3,'mp4','ogg') || ext4=='webm' +); +is_video?( +write('
" +else td_$cat="" +fi +} +html=""\n""\n" "\n" "\n" "\n" "\n" "\n\n" G'MIC - GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image ""Processing - Gallery"\n" "\n" "\n" "\n" "\n\n" "\n" "\n" "\n\n" "\n" "\n\n"

Image Gallery

"\n\n"

This gallery gives a quick overview of the kind of features and generic filters available in the ""G'MIC open-source image processing framework.

"\n"

All the images below have been processed by the CLI interface ""gmic"" of G'MIC, from a set of initial 2D color images."\n" Click on an image to enlarge it and display the G'MIC command-line ""used for the processing (note: to reproduce this, you may have to escape some characters, ""according to the type of shell you use!).

"\n"

Remember, G'MIC lets you define your own image pipelines through""custom command files."\n" Your custom filters can be easily added afterwards in the plug-in for ""GIMP or Krita.

"\n"

For more details, visit the tutorial pages as well as the ""technical reference to get a full documentation on this ""software.

"\n +html_menu=" \n "$td_arrays"Arrays & Frames"$td_artistic"Artistic"$td_blackandwhite"B&W"$td_colors"Colors"$td_deformations"Deformations"$td_filtering"Filtering"$td_patterns"Patterns"$td_3dmeshes"3D Meshes"$td_stylization"Stylization"$td_codesamples"Code samples"\n"

\n\n" +html=${html}${html_menu}" \n" +repeat $nb_commands { +command=${"arg "1+$>,$commands} +is_stylization:=['$command']=='_gallery_stylization' +e $_vt100_m" - Command '"$_vt100_b$command$_vt100_n"' ["{1+$>}/$nb_commands"]." ++l { +s -,{'"#@cli "$command" :"'} +if $!<2 s -,{'"#@cli "$command"\n"'} i[1] ('\n') a[-2,-1] y fi +if $!<2 warn " ** Command '"$command"' not found! **" +else +k. +eval " +ref(crop(#-1),str); +ind = 0; +while ((ind = find(str,'\n#@cli ',ind))>=0, +++ind; +str[ind+6]!=_':' ? break() : +str[ind+7]==_' ' && str[ind+8]==_'$' && str[ind+9]==_' '?( +beg = ind + 10; +end = find(str,_'\n',beg) - 1; +ref(vector1024(0),com); +run('+rows[0] ',beg,',',end); +); +)"; +rm[0] +nb_examples=$! +repeat $nb_examples { +example$nex={$>,t} +e $_vt100_g" $ "${example$nex}$_vt100_n +sample=${"arg0 "{($nex+8*$ncat)%narg($pics)},$pics} +is_codesample=0 +l[] { +('${example$nex}') y +is_input:="find(#-1,'image.jpg')>=0" +if !$is_input" && find(#-1,'sample ')>=0" +s +,{'"sample "'} +if {0,crop()=='"sample "'" && "$!>1} l[1] { +s +,{'" "'} +if "find(#0,_',')==-1" sample={0,t} is_input=1 fi +a y +} fi +a y +fi +replace_str. "image.jpg",""$sample".png" +replace_str. "_output_mode=1","" +l. { +s +,{'" "'} +repeat $! { +if {$<,crop(0,0,1,5)=='_fps='" || "crop(0,0,1,7)=='_label='} rm[$<] fi +} +a y +} +l. { +s +,{'" "'} repeat $! { +if {$<,crop(0,0,1,8)=='https://'} l[$<] { +if crop(0,0,1,24)=='https://gmic.eu/samples/' +is_codesample=1 +basename_codesample={`crop(0,24,1,h-24)`} +filename_codesample="../../resources/samples"/$basename_codesample +url_codesample="https://gmic.eu/samples/"$basename_codesample +if $1 +x "lftp sftp://"$GMIC_LOGIN":@ovh -e \"put -O /home/"$GMIC_LOGIN"/www/gmic/samples ""\\\""$filename_codesample"\\\"; quit\" >/dev/null" fi +i[0] ('""') +else i[0] ('""') +fi +('') y a y +} fi +} +a y +} +replaced_example$nex={t} rm +} +('${example$nex}') replace_str. "https://gmic.eu/samples/","../../resources/samples/" example$nex={t} rm. +m "_run : _preview_area_width,_preview_area_height=450,300 "${example$nex} +if $is_input sample_=${sample}_ else sample_= fi +filename_original=img/${category}_${sample_}original_$nex.jpg +filename_thumb_original=img/${category}_${sample_}thumb_original_$nex.jpg +if "find(['"${example$nex}"'],' _fps=')>=0" +filename_full=img/${category}_${sample_}full_$nex.gif +filename_thumb=img/${category}_${sample_}thumb_$nex.gif +_is_animated=1 +else +filename_full=img/${category}_${sample_}full_$nex.jpg +filename_thumb=img/${category}_${sample_}thumb_$nex.jpg +_is_animated=0 +fi +etime= +_label= +if !isfile('{/$filename_thumb}') l[] { +if $is_input sp $sample,600 o image.jpg rm fi +db3d m3d md3d f3d l3d sl3d ss3d 0.8 srand 512 +etime=$| _run etime:=_round($|-$etime,0.01) +if $is_stylization ++l { _gallery o $filename_full,70 rm } k. +_gallery +width,height:=[w,h] +else +_gallery +width,height:=[w,h] +if $_is_animated o $filename_full,$_fps else o $filename_full,70 fi +fi +e "\r"$_vt100_g" $ "${example$nex}" (done in "$_vt100_n${etime}"s"$_vt100_g")."$_vt100_n +crop 5,5,{w-6},{h-6} +frame 3%,3%,255 rr2d 440,440,0,3 drop_shadow 2,2,2 +if $_is_animated rr2d 230,230,0,3 else rr2d 300,300,0,3 fi +100%,100%,1,3,245 blend[^-1] .,alpha,1,1 rm. +if $_is_animated o $filename_thumb,$_fps else o $filename_thumb,60 fi +rm +if $is_input +image.jpg _gallery +rr2d $width,$height,0,5 c 0,255 +to "Input",2%,2%,6% +- 255 r $width,$height,1,3,0,0,0.5,0.5 + 255 +o $filename_original,60 +crop 5,5,{w-6},{h-6} +frame 3%,3%,255 rr2d 440,440,0,3 drop_shadow 2,2,2 +if $_is_animated rr2d 230,230,0,3 else rr2d 300,300,0,3 fi +100%,100%,1,3,245 blend[^-1] .,alpha,1,1 rm. +o $filename_thumb_original,60 +rm +fi +} fi +is_samesize=0 +l[] { +$filename_full +width,height:=round([w,h]*(max(w,h)<300?1.75:1)) +if isfile(['{/${filename}_original}']) $filename_original is_samesize:=w==w#0" && "h==h#0 fi +rm +} +if !$is_samesize filename_original=$filename_full fi +if !($col%$nb_cols) html=${html}" \n" fi +if $nb_examples==1 counter= +else counter=" "[{$>+1}/$nb_examples]"" +fi +html_etime= +if narg($etime) html_etime="
(generated in "${etime}"s)" fi +html_codesample= +if $is_codesample +html_codesample="\n
""\n
\n"
+it[] $url_codesample html_codesample=${html_codesample}{t} rm.
+html_codesample=${html_codesample}"\n
\n""
\n""[ Source code ]

\n" +fi +if ['$_label']==0 _label=$command$counter else ('$_label') replace_str. "~"," " _label={t} rm. fi +if $is_input +html=${html}" \n" +else +html=${html}" \n" +fi +nex+=1 +col:=($col+1)%$nb_cols +if !$col html=${html}" \n" fi +} +fi +rm +} +} +if $col html=${html}" \n" fi +html=${html}"
\n"" \""gallery_$command$nex"\"
"${_label}${html_codesample}"
\n""
\n"" \""gallery_$command$nex"\"\n""
\n""
Command: ""$ gmic "${replaced_example$nex}""${html_etime}"
\n"" \""gallery_$command$nex"\"""
"${_label}${html_codesample}"
\n""
\n"" \""gallery_$command$nex"\"\n""
\n""
Command: ""$ gmic "${replaced_example$nex}""${html_etime}"

\n"${html_menu}"
"\n" "\n" " +('$html') ot. $category.html rm. +} +rm +x "ln -fs artistic.html index.html" +x "ln -fs "$HOME/work/src/gmic/html/header1.html" ." +x "ln -fs "$HOME/work/src/gmic/html/footer.html" ." +if $1 +e "\n * Transfer gallery on G'MIC server.\n" +x "lftp sftp://"$GMIC_LOGIN":@ovh -e \"mirror -eRL . /home/"$GMIC_LOGIN"/www/gmic/gallery ; quit\"" +fi +e " * All done!\n" +_gallery : +foreach { +if ${-_is_mesh3d} +r3d 1,1,0,-80 r3d 0,1,0,30 +animate3d 20,0,5,0,1.5,0 s z +rv[1--2] +else +if w>8192 z 0,8191 elif h>8192 rows 0,8191 fi +n 0,255 +fi +} +if !$_is_animated ++__gallery +if w>1024 r:=round(1024*100/w,0.1) r[^-1] $r%,$r%,1,100%,2 fi rm. +fi +foreach { +if s==1 r {w},{h},1,3 +elif s==4 drgba +else r {w},{h},1,3,0 fi +if w<=h" && "h<256 r2dy 256,2 elif h<=w" && "w<256 r2dx 256,2 fi +if w<=h" && "h>620 r2dy 620,2 elif h<=w" && "w>620 r2dx 620,2 fi +if h<48 r 100%,48 fi +if w<48 r 48,100% fi +if $_is_animated" && "(w>480" || "h>480) rr2d 480,480,0,2 fi +frame 1,1,0 frame 4,4,255 +} +if $_is_animated +- 255 r ${-max_wh},1,3,0,0,0.5,0.5 + 255 +else +- 255 __gallery + 255 +if w<256 - 255 r 256,100%,1,100%,0,0,0.5,0.5 + 255 fi +if h<256 - 255 r 100%,256,1,100%,0,0,0.5,0.5 + 255 fi +fi +__gallery : +if $!==2 if w>h a y else a x fi +else montage A +fi +update_gmicol : +e[^-1] "Generate XML file and thumbnails for the G'MIC Online website." +filename=$_path_rc/update$_version.gmic +if !isfile('$filename') up fi +rm it $filename +m "parse_gui_trigger_gmicol : _update_gmicol $*" +v + +parse_gui. gmicol v - +um parse_gui_trigger_gmicol +ot. gmicol.xml +rm. +m "parse_gui_trigger_thumbnails : _update_gmicol $*" +v + w[] parse_gui thumbnails v - +um parse_gui_trigger_thumbnails +_update_gmicol : +nmd 3,"About/♥ Support Us ! ♥","About/About G'MIC","About/Friends Hall of Fame","Arrays & Tiles/Annular Steiner Chain Round Tile","Arrays & Tiles/Array [Faded]","Arrays & Tiles/Array [Mirrored]","Arrays & Tiles/Array [Random Colors]","Arrays & Tiles/Array [Random]","Arrays & Tiles/Array [Regular]","Arrays & Tiles/Ascii Art","Arrays & Tiles/Chessboard","Arrays & Tiles/Dices","Arrays & Tiles/Grid [Cartesian]","Arrays & Tiles/Grid [Hexagonal]","Arrays & Tiles/Grid [Triangular]","Arrays & Tiles/Ministeck","Arrays & Tiles/Puzzle","Arrays & Tiles/Taquin","Arrays & Tiles/Tiled Isolation","Arrays & Tiles/Tiled Normalization","Arrays & Tiles/Tiled Parameterization","Arrays & Tiles/Tiled Random Shifts","Arrays & Tiles/Tiled Rotation","Artistic/Angoisse Anguish","Artistic/Aurora","Artistic/Blockism","Artistic/Bokeh","Artistic/Cartoon","Artistic/Circle Abstraction","Artistic/Color Abstraction Paint","Artistic/Colored Pencils","Artistic/Comic Book","Artistic/Cubism","Artistic/Cutout","Artistic/Diffusion Tensors","Artistic/Dream Smoothing","Artistic/Ellipsionism","Artistic/Felt Pen","Artistic/Finger Paint","Artistic/Fractalize","Artistic/Ghost","Artistic/Graphic Boost","Artistic/Graphic Novel","Artistic/Hard Sketch","Artistic/Highlight Bloom","Artistic/Hope Poster","Artistic/Hough Sketch","Artistic/Illustration Look","Artistic/Kuwahara","Artistic/Lylejk's Painting","Artistic/Make Squiggly","Artistic/Morphology Painting","Artistic/Paint With Brush","Artistic/Painting","Artistic/Pen Drawing","Artistic/Photoillustration","Artistic/Polygonize [Delaunay]","Artistic/Polygonize [Energy]","Artistic/Poster Edges","Artistic/Posterize","Artistic/Posterized Dithering","Artistic/Quadtree Variations","Artistic/Rodilius","Artistic/Sharp Abstract","Artistic/Simple Noise Canvas","Artistic/Skeletik","Artistic/Sketch","Artistic/Smooth Abstract","Artistic/Stylize","Artistic/Vector Painting","Artistic/Warhol","Artistic/Whirl Drawing","Black & White/B&W Stencil","Black & White/Black & White","Black & White/Charcoal","Black & White/Colorize [with Colormap]","Black & White/Colorize Lineart [Auto-Fill]","Black & White/Colorize Lineart [Smart Coloring]","Black & White/Desaturate Norm","Black & White/Dithering","Black & White/Emboss","Black & White/Engrave","Black & White/Freaky B&W","Black & White/Ink Wash","Black & White/Multi-Layer Etch","Black & White/Pencil","Black & White/Pencil Portrait","Black & White/Stamp","Black & White/Threshold Etch","Colors/Abstraction","Colors/Auto Balance","Colors/Basic Adjustments","Colors/Boost Chromaticity","Colors/Boost-Fade","Colors/Brightness","Colors/Channel Processing","Colors/CMYK Tone","Colors/Color Balance","Colors/Color Blindness","Colors/Color Grading","Colors/Color Presets","Colors/Color Temperature","Colors/Colormap","Colors/Contrast","Colors/Customize CLUT","Colors/Dark Sky","Colors/Equalize HSI-HSL-HSV","Colors/Equalize HSV","Colors/HSL Adjustment","Colors/HSV Select","Colors/Hue Lighten-Darken","Colors/LMS Adjustment","Colors/Local Contrast","Colors/Metallic Look","Colors/Mixer [CMYK]","Colors/Mixer [HSV]","Colors/Mixer [Lab]","Colors/Mixer [PCA]","Colors/Mixer [RGB]","Colors/Mixer [YCbCr]","Colors/Normalize Brightness","Colors/Retinex","Colors/Retro Fade","Colors/RGB Tone","Colors/Saturation EQ","Colors/Select-Replace Color","Colors/Selective Desaturation","Colors/Sepia","Colors/Simulate Film","Colors/Softlight","Colors/Specific Saturation","Colors/Temperature Balance","Colors/Tone Presets","Colors/Tune HSV Colors","Colors/User-Defined","Colors/Vintage Style","Colors/Zone System","Contours/Convolve","Contours/Curvature","Contours/Difference of Gaussians","Contours/Distance Transform","Contours/Edge","Contours/Edges","Contours/Edges Offsets","Contours/Gradient Norm","Contours/Gradient RGB","Contours/Isophotes","Contours/Laplacian","Contours/Local Orientation","Contours/Morphological Filter","Contours/Segmentation","Contours/Skeleton","Contours/Super-Pixels","Contours/Thin Edges","Deformations/Breaks","Deformations/Cartesian Transform","Deformations/Circle Transform","Deformations/Conformal Maps","Deformations/Continuous Droste","Deformations/Crease","Deformations/Distort Lens","Deformations/Drop Water","Deformations/Equirectangular to Nadir-Zenith","Deformations/Euclidean - Polar","Deformations/Fish-Eye","Deformations/Flower","Deformations/Kaleidoscope [Blended]","Deformations/Kaleidoscope [Polar]","Deformations/Kaleidoscope [Reptorian-Polar]","Deformations/Kaleidoscope [Symmetry]","Deformations/Logarithmic Distortion","Deformations/Moon2panorama","Deformations/Perspective","Deformations/Pixel Push","Deformations/Point Warp","Deformations/Polar Transform","Deformations/Quadrangle","Deformations/Raindrops","Deformations/Random","Deformations/Reflection","Deformations/Ripple","Deformations/Seamcarve","Deformations/Sinusoidal Water Distortion","Deformations/Sphere","Deformations/Spherize","Deformations/Square to Circle","Deformations/Stereographic Projection","Deformations/Symmetrize","Deformations/Textured Glass","Deformations/Twirl","Deformations/Water","Deformations/Wave","Deformations/Wind","Deformations/Zoom","Degradations/Add Grain","Degradations/Blur [Angular]","Degradations/Blur [Bloom]","Degradations/Blur [Depth-Of-Field]","Degradations/Blur [Gaussian]","Degradations/Blur [Glow]","Degradations/Blur [Linear]","Degradations/Blur [Multidirectional]","Degradations/Blur [Radial]","Degradations/Blur [Splinter]","Degradations/Chromatic Aberrations","Degradations/CRT Sub-Pixels","Degradations/Dirty","Degradations/Flip & Rotate Blocks","Degradations/Fragment Blur","Degradations/JPEG Artefacts","Degradations/Lomo","Degradations/Mess with Bits","Degradations/Noise [Additive]","Degradations/Noise [Perlin]","Degradations/Noise [Spread]","Degradations/Old-Movie Stripes","Degradations/Oldschool 8bits","Degradations/Pixel Sort","Degradations/Rain & Snow","Degradations/Random Shade Stripes","Degradations/Rebuild From Similar Blocks","Degradations/Scanlines","Degradations/Self Glitching","Degradations/Streak","Degradations/UltraWarp++++","Degradations/Visible Watermark","Degradations/Warp by Intensity","Details/Constrained Sharpen","Details/DCP Dehaze","Details/Details Equalizer","Details/Dynamic Range Increase","Details/Easy Skin Retouch","Details/Emboss-Relief","Details/Equalize Local Histograms","Details/Freaky Details","Details/High Pass","Details/Local Contrast Enhancement","Details/Local Normalization","Details/Local Processing","Details/Local Variance Normalization","Details/Magic Details","Details/Make Up","Details/Mighty Details","Details/Portrait Retouching","Details/Pyramid Processing","Details/Quick Tonemap","Details/Sharpen [Deblur]","Details/Sharpen [Gold-Meinel]","Details/Sharpen [Gradient]","Details/Sharpen [Hessian]","Details/Sharpen [Inverse Diffusion]","Details/Sharpen [Multiscale]","Details/Sharpen [Octave Sharpening]","Details/Sharpen [Richardson-Lucy]","Details/Sharpen [Shock Filters]","Details/Sharpen [Texture]","Details/Sharpen [Tones]","Details/Sharpen [Unsharp Mask]","Details/Sharpen [Whiten]","Details/Simple Local Contrast","Details/Spotify","Details/Texture","Details/Texture Enhance","Details/Tone Enhance","Details/Tone Mapping","Details/Tone Mapping [Fast]","Details/YAG Effect","Frames/Droste","Frames/Frame [Blur]","Frames/Frame [Cube]","Frames/Frame [Fuzzy]","Frames/Frame [Mirror]","Frames/Frame [Painting]","Frames/Frame [Pattern]","Frames/Frame [Regular]","Frames/Frame [Round]","Frames/Frame [Smooth]","Frames/Old Photograph","Frames/Polaroid","Frames/Tunnel","Frames/Vignette","Frequencies/Bandpass","Frequencies/Fourier Analysis","Frequencies/Fourier Transform","Frequencies/Fourier Watermark","Lights & Shadows/Burn","Lights & Shadows/Contrast Swiss Mask","Lights & Shadows/Dodge and Burn","Lights & Shadows/Drop Shadow","Lights & Shadows/Drop Shadow 3D","Lights & Shadows/Equalize Light","Lights & Shadows/Equalize Shadow","Lights & Shadows/Guided Light Rays","Lights & Shadows/Illuminate 2D Shape","Lights & Shadows/Light Glow","Lights & Shadows/Light Leaks","Lights & Shadows/Light Patch","Lights & Shadows/Light Rays","Lights & Shadows/Pop Shadows","Lights & Shadows/Relief Light","Lights & Shadows/Shadow Patch","Patterns/Bayer Filter","Patterns/Box Fitting","Patterns/Camouflage","Patterns/Canvas","Patterns/Canvas Texture","Patterns/Clouds","Patterns/Cracks","Patterns/Crystal","Patterns/Crystal Background","Patterns/Denim Texture","Patterns/Fibers","Patterns/Freqy Pattern","Patterns/Halftone","Patterns/Halftone Shapes","Patterns/Hearts","Patterns/Hedcut (Experimental)","Patterns/Lava","Patterns/Marble","Patterns/Maze","Patterns/Mineral Mosaic","Patterns/Mosaic","Patterns/Op Art","Patterns/Paper Texture","Patterns/Periodic Dots","Patterns/Plaid","Patterns/Polka Dots","Patterns/Random Color Ellipses","Patterns/Random Pattern","Patterns/Rays","Patterns/Reptile","Patterns/Resynthetize Texture [FFT]","Patterns/Resynthetize Texture [Patch-Based]","Patterns/Rorschach","Patterns/Satin","Patterns/Seamless Deco","Patterns/Seamless Turbulence","Patterns/Shock Waves","Patterns/Soft Random Shades","Patterns/Sponge","Patterns/Stained Glass","Patterns/Stars","Patterns/Stencil","Patterns/Strip","Patterns/Tetris","Patterns/Triangular Pattern","Patterns/Truchet","Patterns/Turbulent Halftone","Patterns/Voronoi","Patterns/Weave","Patterns/Whirls","Rendering/3D Blocks","Rendering/3D Colored Object","Rendering/3D Elevation","Rendering/3D Extrusion","Rendering/3D Image Object","Rendering/3D Lathing","Rendering/3D Random Objects","Rendering/Ball","Rendering/Circle Art","Rendering/Construction Material Texture","Rendering/Disco","Rendering/Equation Plot [Parametric]","Rendering/Equation Plot [Y=f(X)]","Rendering/Gradient [Corners]","Rendering/Gradient [Custom Shape]","Rendering/Gradient [from Line]","Rendering/Gradient [Linear]","Rendering/Gradient [Radial]","Rendering/Gradient [Random]","Rendering/Hair Locks","Rendering/Hypotrochoid","Rendering/Kitaoka Spin Illusion","Rendering/Lightning","Rendering/Lissajous","Rendering/Mandelbrot - Julia Sets","Rendering/Nebulous","Rendering/Neon Lightning","Rendering/Newton Fractal","Rendering/Plasma","Rendering/Popcorn Fractal","Rendering/Pseudorandom Noise","Rendering/Pythagoras Tree","Rendering/Quick Copyright","Rendering/Rainbow","Rendering/Shade Bobs","Rendering/Sine Curve","Rendering/Snowflake 2","Rendering/Spiral","Rendering/Spiral RGB","Rendering/Superformula","Rendering/Symmetric 2D Shape","Rendering/Thorn Fractal - Secant Sea","Rendering/Tree","Rendering/Turbulence","Rendering/Twisted Rays [Samj]","Rendering/Wiremap","Repair/Anti Alias","Repair/Banding Denoise","Repair/Bayer Reconstruction","Repair/Clean Text","Repair/Compression Blur","Repair/Deinterlace","Repair/Deinterlace2x","Repair/Denoise","Repair/Denoise Smooth","Repair/Denoise Smooth Alt","Repair/Descreen","Repair/Despeckle","Repair/Iain Noise Reduction 2019","Repair/Iain's Fast Denoise","Repair/Inpaint [Holes]","Repair/Inpaint [Morphological]","Repair/Inpaint [Multi-Scale]","Repair/Inpaint [Patch-Based]","Repair/Inpaint [Transport-Diffusion]","Repair/JPEG Smooth","Repair/Local Similarity Mask","Repair/Moire Removal","Repair/Pixel Denoise","Repair/Recursive Median","Repair/Red-Eye Attenuation","Repair/Remove Hot Pixels","Repair/Repair Scanned Document","Repair/Smooth [Anisotropic]","Repair/Smooth [Antialias]","Repair/Smooth [Bilateral]","Repair/Smooth [Block PCA]","Repair/Smooth [Diffusion]","Repair/Smooth [Geometric-Median]","Repair/Smooth [Guided]","Repair/Smooth [IUWT]","Repair/Smooth [Mean-Curvature]","Repair/Smooth [Median]","Repair/Smooth [NL-Means]","Repair/Smooth [Patch-Based]","Repair/Smooth [Patch-PCA]","Repair/Smooth [Perona-Malik]","Repair/Smooth [Selective Gaussian]","Repair/Smooth [Skin]","Repair/Smooth [Thin Brush]","Repair/Smooth [Total Variation]","Repair/Smooth [Wavelets]","Repair/Smooth [Wiener]","Repair/Solidify","Repair/Unpurple","Repair/Unquantize [JPEG Smooth]","Repair/Unstrip","Repair/Upscale [DCCI2x]","Repair/Upscale [Diffusion]","Repair/Upscale [Edge]","Repair/Upscale [Scale2x]" +k[${}] +sort_list +,n +update_reference_html : check "isbool(${1=0})" +path_current=${-path_current} path_ok=$HOME/work/src/gmic/html/reference/ +if ['$path_current']!=['$path_ok'] +error[0--3] "Command 'update_reference_html: Command run from wrong path: '"$path_current"', ""should be '"$path_ok"'." +fi +x "rm -f *.pdf" +rm +e[^-1] "Generate reference documentation pages for the G'MIC website." +it $HOME/work/src/gmic/src/gmic_stdlib.gmic +a y +x "mkdir -p img" +_parse_cli_images_path="img/" ++parse_cli images +parse_cli html +rm +x "ln -fs "$HOME/work/src/gmic/html/header1.html" ." +x "ln -fs "$HOME/work/src/gmic/html/footer.html" ." +x "cp -rf "$HOME/work/src/gmic-community/reference/images" ." +reference html,$HOME/work/src/gmic-community/reference +if $1 +e "\n > Transfer reference documentation on G'MIC server.\n" +x "lftp sftp://"$GMIC_LOGIN":@ovh -e \"mirror -RL . /home/"$GMIC_LOGIN"/www/gmic/reference ; quit\"" +fi +e "\n > All done.\n" +update_tutorial_html : check "isbool(${1=0})" +path_current=${-path_current} path_ok=$HOME/work/src/gmic/html/tutorial/ +if ['$path_current']!=['$path_ok'] +error[0--3] "Command 'update_tutorial_html: Command run from wrong path: '"$path_current"', ""should be '"$path_ok"'." +fi +rm +e[^-1] "Generate tutorial pages for the G'MIC website." +path_tutorial=$HOME/work/src/gmic-community/tutorial +use_vt100 +e " > Build directory structure." +x "ln -fs "$HOME/work/src/gmic/html/header1.html" ." +x "ln -fs "$HOME/work/src/gmic/html/footer.html" ." +x "mkdir -p images scripts" +files 5,$path_tutorial/* +l[] { +({'${}'}:y) s -,{','} +for $! { +file={0,t} rm[0] +basename $file basename=${} 0 => $basename ext={`lowercase(['{x}'])`} rm. +if ['$basename']!='img' +if isdir(['$file']) files 5,$file/* ({'${}'}:y) s. -,{','} +elif isin(['$ext'],'png','jpg','jpeg','gif','mp4','svg','webm') +x "cp -f \""$file"\" images/" +elif isin(['$ext'],'gmic','py') +x "cp -f \""$file"\" scripts/" +elif ['$ext']=='gmd' +it[] $file +ot. $basename rm. +fi +fi +} +} +files 0,*.gmd files=${} +repeat narg({/$files}) { +arg0 $>,$files file=${} +e " > Generate '"$_vt100_c$file$_vt100_n"'." +t0=$| +it $file +replace_str. "../listmanip/","" +replace_str. "../images/","images/" +gmd2html 2 +ot {n} rm. +t1=$| +e "\r > Generate '"$_vt100_c$file$_vt100_n"' (done in "$_vt100_g{_round($t1-$t0,0.1)}"s"$_vt100_n")." +} +x "rm -f *.gmd" +if $1 +e "\n > Transfer tutorial pages on G'MIC server.\n" +x "lftp sftp://"$GMIC_LOGIN":@ovh -e \"mirror -RL . /home/"$GMIC_LOGIN"/www/gmic/tutorial ; quit\"" +fi +e "\n > All done.\n" +strings2ts : skip "${1=}" +e[^-1] "Regenerate translation file by merging file '$1' and source/translated strings '$2/$3'." +if narg($1) l[] { +it "$1" +lang={`" +lang = vector256(); +p = find(#-1,'language=\"'); +p>=0?( +p+=10; +q = find(#-1,'\">',p); +q>=0?copy(lang,i[p],q - p); +); lang"`} +e " > File '$1', detected language : "$lang. +s -,10 +N0=0 +foreach { +autocrop {'" "'} +if s=crop();find(s,'')>=0" && "find(s,'')>=0 +discard {''} discard {''} src$N0={t} +elif s=crop();find(s,'')>=0" && "find(s,'')>=0 +discard {''} discard {''} dest$N0={t} +N0+=1 +fi +} +rm +} else N0=0 lang= +fi +if $N0 e " > File '$1' contains "$N0" strings." fi +l[] { it "$2" s -,10 N1=$! repeat $! { nsrc$>={$>,t} } rm } +l[] { it "$3" replace_str " ;",";" s -,10 N2=$! repeat $! { ndest$>={$>,t} } rm } +if $N1!=$N2 error[0--3] "Command 'strings2ts': Number of lines do not match in files '$2' and '$3'." fi +e " > Files '$2' and '$3' contain "$N1" strings." +l[] { repeat $N1 { ({'${ndest$>}'}) => ${nsrc$>} } y } +repeat $N0 { rmn ${src$>} } +if $N0 i[0] 0 l[0] { rm repeat $N0 { i ({'${dest$>}'}) => ${src$>} } y } fi +foreach { +src={n} dest={t} +if lowercase(['$src'])==lowercase(['$dest']) rm fi +} +sort_list +,n +e " > "$!" strings remain after cleaning/merging ("{$!-$N0}" new)." +foreach { +_strings2ts_src {n} src=${} +_strings2ts_dest {t} dest=${} +rm +({'" "\n" "$src""\n" "$dest""\n" "\n\n'}) +} +i[0] ({'""\n""\n""\n" "\n" FilterTextTranslator"\n\n'}) +({'" "\n""\n'}) +y a y +_strings2ts_src : +({'"$*"'}) +replace_str. "°","°" +replace_str. "à","à" +replace_str. "&","&" +replace_str. "<","<" +replace_str. ">",">" +replace_str. "\"",""" +replace_str. "'","'" +u {t} +rm. +_strings2ts_dest : +({'"$*"'}) html2utf8. +replace_str. "°","°" +replace_str. "à","à" +replace_str. "&","&" +replace_str. "<","<" +replace_str. ">",">" +replace_str. "\"",""" +replace_str. "'","'" +u {t} +rm. +parse_gui_parseparams_zart : u 1 +parse_gui_trigger_zart : +foreach { +=> {`s=[['{n}'],0];p=find(s,_'/',size(s)-1,0);p>=0?(p=find(s,_'/',p-1,0);p>0?copy(s,s[p+1],size(s)-p));s`} +} +sort_list +,n +parse_gui_zart : +e " >> Generate output, in 'zart' mode.\n" ++e "" ++e "\n" +current_group= +N:=$_nb_filters-1 +repeat $_nb_filters { f=$> +e "\r >> "$_vt100_c[#$f/$N]$_vt100_n" "{`s=vector48(_'" "');copy(s,['${_f${f}_path}${_f${f}_name}']);s`} +0 => {`s=['${_f${f}_path}'];s[0,size(s)-1]`} path={b} rm. +if ['$current_group']!=['$path'] +if ['$current_group']!=0 +e "\n" fi ++e "" ++e "\n" +current_group=$path +fi +_parse_gui_zart[] ${_f${f}_name} fname=${} ++e "" ++e "" ++e " "${_f${f}_command_preview}" $""*" +repeat ${_f${f}_nb_params} { p=$> +_parse_gui_zart ${_f${f}_p{$p}_name} name=${} +type=${_f${f}_p{$p}_type} +nbargs=${_f${f}_p{$p}_nb_args} +arg0= repeat $nbargs { ('${_f${f}_p${p}_a$>}') autocrop. {'\"'} _parse_gui_zart {t} arg$>=${} rm. } +if ['$type']=='bool' +if lowercase(['$arg0'])=='false' arg0=0 elif lowercase(['$arg0'])=='true' arg0=1 elif !isnum($arg0) arg0=0 fi ++e " " +elif ['$type']=='choice' +default=0 n=0 args= +l[] { if isint($arg0) default=$arg0 n+=1 fi onfail } +c= repeat $nbargs-$n { a=$> args.=${c}"choice"$>"=\""${arg{$n+$a}}"\"" c=" " } ++e " " +elif ['$type']=='color' +if $nbargs==1" && "['$arg0'][0]==_'#' # Convert colors specified as '#RRGGBB[AA]' +l[] { ('$arg0') autocrop. {'#'} s x,-2 nbargs=$! repeat $! { a=$> hex2dec {$>,t} arg$a=${} } rm } +fi +args= c= repeat $nbargs { a=$> args.=$c${arg$a} c="," } ++e " " +elif isin(['$type'],'int','float') ++e " <"$type" name=\""$name"\" default=\""$arg0"\" min=\""$arg1"\" max=\""$arg2"\" />" +elif isin(['$type'],'file','filein','fileout') ++e " " +elif ['$type']=='folder' ++e " " +elif ['$type']=='link' +align=-1 name= url= n=0 +l[] { if isnum($arg0) align=$arg0 n+=1 fi onfail } +if $nbargs-$n>1 name=${arg$n} url=${arg{$n+1}} +else url,name=${arg$n} +fi +if !$align align=left elif $align==1 align=right else align=center fi ++e " " +elif ['$type']=='note' +text={/$arg0} ++e " " +elif ['$type']=='point' ++e " " +elif ['$type']=='separator' ++e " " +elif ['$type']=='text' ++e " " +elif ['$type']=='value' ++e " " +else ++e " " +fi +} ++e "\n" +} +if narg($current_group) +e "" fi ++e "" +e "\r >> "${_vt100_g}{`s=vector64(_'" "');copy(s,'"Output done!"');s`}$_vt100_n +_parse_gui_zart : +l[] { +('"$*"') +replace_str "&","#amp;" +replace_str. "&","&" +replace_str. "<","<" +replace_str. ">",">" +replace_str. "\"",""" +replace_str "#amp;","&" +u {t} rm. +onfail u "" } +html2utf8 : +if h +eval " +ref(crop(),source); +ref(vector8(),svalue); +p = 0; +while (1, +p = p0 = find(source,'&#',p); +p<0?break(); +p+=2; +p>=size(source)?break(); +q = find(source,';',p); +q>p && q<=p+8 && !isnan(val=s2v(source,p))?( +copy(svalue,source[p],q-p); svalue[q-p] = 0; +val = s2v(svalue,0,1); +!isnan(val) && isint(val) && val>0?( +val<=0x007f?( +i[p0++] = val; +):val<=0x07ff?( +i[p0++] = (val>>6)|0xc0; +i[p0++] = (val&0x3f)|0x80; +):val<=0xffff?( +i[p0++] = (val>>12)|0xe0; +i[p0++] = ((val>>6)&0x3f)|0x80; +i[p0++] = (val&0x3f)|0x80; +):( +i[p0++] = (val>>18)|0xf0; +i[p0++] = ((val>>12)&0x3f)|0x80; +i[p0++] = ((val>>6)&0x3f)|0x80; +i[p0++] = (val&0x3f)|0x80; +); +copy(i[p0],-1,q-p0+1,1,0); +p = q + 1; +); +); +)" +discard. -1 +fi +utf82html : +if h +eval " +write_seq() = ( copy(res[q],'&#'); q+=2; s = v2s(val); l = find(s,0); copy(res[q],s,l); q+=l; res[q++]=_';' ); +ref(vector(#4*wh),res); +q = 0; +repeat (wh,p, +i = i[p]; +!(i&0x80)?( +res[q++] = i; +):(i&0xe0)==0xc0?( +val = (i&0x1f)<<6; i = i[p + 1]; val|= (i&0x3f); +write_seq(); +):(i&0xf0)==0xe0?( +val = (i&0xf)<<12; i = i[p + 1]; val|= (i&0x3f)<<6; i = i[p + 2]; val|= (i&0x3f); +write_seq(); +):(i&0xf8)==0xf0?( +val = (i&0x7)<<18; i = i[p + 1]; val|= (i&0x3f)<<12; i = i[p + 2]; val|= (i&0x3f)<<6; +i = i[p + 3]; val|= (i&0x3f); +write_seq(); +); +); +store('res',res,1,q)" +rm. $res +fi +_upload_filters_move : +m "move_filter : skip \"${""2=}\" nmd 3,\"$""1\" ind=${} +if $ind basename \"$""1\" =>[$ind] \"$""2\"/${} +else v 0 e[0--4] \"Cannot move unknown filter '\"${_vt100_r}\"$""1\"${_vt100_n}\"' +to '\"${_vt100_g}\"$""2\"${_vt100_n}\"'\" fi" +sort_list +,n +move_filter "Testing/Garagecoder/Anti Alias","Repair" +move_filter "Testing/Garagecoder/Auto Balance","Colors" +move_filter "Testing/Garagecoder/LMS Adjustment","Colors" +move_filter "Testing/Garagecoder/Compression Blur","Repair" +move_filter "Testing/Garagecoder/Emboss","Black & White" +move_filter "Testing/Garagecoder/JPEG Smooth","Repair" +move_filter "Testing/Garagecoder/Quick Tonemap","Details" +move_filter "Testing/Garagecoder/Normalize Brightness","Colors" +move_filter "Testing/Garagecoder/Sharpen [Gradient]","Details" +move_filter "Testing/Garagecoder/Sharpen [Tones]","Details" +move_filter "Testing/Garagecoder/Temperature Balance","Colors" +move_filter "Testing/Garagecoder/Unquantize [JPEG Smooth]","Repair" +move_filter "Testing/Garagecoder/Upscale [Edge]","Repair" +move_filter "Testing/Garagecoder/Wiremap","Rendering" +move_filter "Testing/Garagecoder/Smooth [Geometric-Median]","Repair" +move_filter "Testing/Gmic Tutorials/Hedcut (Experimental)","Patterns" +move_filter "Testing/Iain Fergusson/Easy Skin Retouch","Details" +move_filter "Testing/Iain Fergusson/Moire Removal","Repair" +move_filter "Testing/Iain Fergusson/Halftone Shapes","Patterns" +move_filter "Testing/Iain Fergusson/Simple Local Contrast","Details" +move_filter "Testing/Iain Fergusson/Turbulent Halftone","Patterns" +move_filter "Testing/Joan Rake/Deformations/Ultrawarp++++","Degradations" +move_filter "Testing/Naggobot/Blockism","Artistic" +move_filter "Testing/Reptorian/Blur [Splinter]","Degradations" +move_filter "Testing/Reptorian/Construction Material Texture","Rendering" +move_filter "Testing/Reptorian/Emboss-Relief","Details" +move_filter "Testing/Reptorian/Fragment Blur","Degradations" +move_filter "Testing/Reptorian/Kaleidoscope [Reptorian-Polar]","Deformations" +move_filter "Testing/Reptorian/Logarithmic Distortion","Deformations" +move_filter "Testing/Reptorian/Nebulous","Rendering" +move_filter "Testing/Reptorian/Pixel Push","Deformations" +move_filter "Testing/Reptorian/Point Warp","Deformations" +move_filter "Testing/Reptorian/Popcorn Fractal","Rendering" +move_filter "Testing/Reptorian/Pseudorandom Noise","Rendering" +move_filter "Testing/Reptorian/Sinusoidal Water Distortion","Deformations" +move_filter "Testing/Samj/Arrays & Tiles/Annular Steiner Chain Round Tile","Arrays & Tiles" +move_filter "Testing/Samj/Arrays & Tiles/Reptile","Patterns" +move_filter "Testing/Samj/Artistic/Angoisse Anguish","Artistic" +move_filter "Testing/Samj/Artistic/Chalk It Up [Fr]","Artistic" +move_filter "Testing/Samj/Artistic/Barbouillage Paint Daub","Artistic" +move_filter "Testing/Samj/Artistic/Skeletik","Artistic" +move_filter "Testing/Samj/Patterns/Denim Texture","Patterns" +move_filter "Testing/Samj/Patterns/Soft Random Shades","Patterns" +move_filter "Testing/Samj/Rendering/Pythagoras Tree","Rendering" +move_filter "Testing/Samj/Rendering/Snowflake 2","Rendering" +move_filter "Testing/Samj/Rendering/Twisted Rays [Samj]","Rendering" +move_filter "Testing/Souphead/Disco","Rendering" +move_filter "Testing/Souphead/Moon2panorama","Deformations" +move_filter "Testing/Souphead/Spiral RGB","Rendering" +move_filter "Testing/Souphead/Kitaoka Spin Illusion","Rendering" +move_filter "Testing/Zonderr/Spiral","Rendering" +um move_filter +upload_filters : +e[^-1] "Upload filter definition file on G'MIC server.\n" +rm +x "cd "$HOME"/work/src/gmic && git pull" +x "cd "$HOME"/work/src/gmic-community && git pull" +(331,332,333,$_version) sort. discard. store. compat +files $HOME/work/src/gmic-community/include/*.gmic +files=${},$HOME/work/src/gmic/src/gmic_stdlib.gmic +repeat narg($files) { l[] { +file=${"arg0 $>,"$files} +it[] $file +basename $file basename=${} +if ['$basename']=='sylvie_alexandre.gmic' +s +,{'"#@gui "'} i[1--2:2] ('"#@gui ________Testing\n#@gui Samj\n"') y a y +elif ['$basename']=='template.gmic' +rm 0 +fi +} } +i[1--2] ('"\n#@gui _________________\n"') y a y ++l. { +e "** Generate filter update file." +m "parse_gui_trigger_update : _upload_filters_move" +v + parse_gui. update v - +um parse_gui_trigger_update +e "** Upload filter update." +ot ${_path_rc}update$_version.gmic +if "d = date(3); h = date(4); h>=7 && d>=1 && d<=5" url=http://bit.ly/2uaBRMB +else url=http://bit.ly/2uaBRMB +fi +replace_str "David Tschumperlé","David Tschumperlé" +o cimgz:/tmp/update$_version.gmic,uint8 +$compat +repeat h { +v:=i[$>] +_upload[] ${_path_rc}update$_version.gmic,plain_update$v.gmic,1 +_upload[] /tmp/update$_version.gmic,update$v.gmic,1 +} +rm +} ++l. { +e "** Generate JSON filters file." +v + parse_gui. json v - +e "** Upload JSON filters." +ot ${_path_rc}/update$_version.json +$compat +repeat h { +v:=i[$>] +_upload[] ${_path_rc}/update$_version.json,update$v.json,1 +} +rm +} ++l. { +e "** Generate filter listing." +v + parse_gui. list v - +ot /tmp/gui_filters.txt +rm +} +rm +_upload : skip "${2=""}","${3=0}" +if narg("$2") out="$2" else basename "$1" out=${} fi +if !narg($GMIC_LOGIN) +GMIC_LOGIN=${"gmic_ftp 0"} +GMIC_PASSWD=${"gmic_ftp 1"} +fi +if narg($GMIC_LOGIN) +x $3,"lftp sftp://"$GMIC_LOGIN":@ovh -e \"put -O /home/"$GMIC_LOGIN"/www/gmic/ ""\\\"$1\\\" -o \\\""$out"\\\"; quit\" >/dev/null" +fi +upload_binaries : check "isbool(${2=1})" +is_pre=${"strcontains $1,_pre"} +N=0 +file$N=gmic_$1_debian10_buster_amd64.deb N+=1 +file$N=gmic_$1_debian11_bullseye_amd64.deb N+=1 +file$N=gmic_$1_debian12_bookworm_amd64.deb N+=1 +file$N=gmic_$1_ubuntu20-04_focal_amd64.deb N+=1 +file$N=gmic_$1_ubuntu21-10_impish_amd64.deb N+=1 +file$N=gmic_$1_ubuntu22-04_jammy_amd64.deb N+=1 +file$N=gmic_$1_gimp2.10_debian10_buster_amd64.zip N+=1 +file$N=gmic_$1_gimp2.10_debian11_bullseye_amd64.zip N+=1 +file$N=gmic_$1_gimp2.10_debian12_bookworm_amd64.zip N+=1 +file$N=gmic_$1_gimp2.10_ubuntu20-04_focal_amd64.zip N+=1 +file$N=gmic_$1_gimp2.10_ubuntu21-10_impish_amd64.zip N+=1 +file$N=gmic_$1_gimp2.10_ubuntu22-04_jammy_amd64.zip N+=1 +file$N=gmic_$1_cli_win64.zip N+=1 +file$N=gmic_$1_lib_win64.zip N+=1 +file$N=gmic_$1_qt_win64.zip N+=1 +file$N=gmic_$1_gimp2.10_win64.zip N+=1 +file$N=gmic_$1_gimp2.10_win64.exe N+=1 +if !$2 +e[0--3] "List URLs of released binaries ($1) from the G'MIC web server.\n" +repeat $N { +file=${file$>} +is_win=${strcontains[]" "$file,win} +if $is_win folder="windows" else folder="linux" fi +e "http://gmic.eu/files/"$folder/$file +} +e "" +else +e[0--3] "Upload released binaries ($1) on the G'MIC web server." +t0=$| n=0 t=0 +e "- Waiting for binary files to be build." +do +repeat $N { +file=${file$>} +if isfile(['{/$file}']) +strreplace $file,_$1_,_ +file_short=${} +is_win=${strcontains[]" "$file,win} +if $is_win folder="windows" else folder="linux" fi +e "- Upload file '"$file"' to 'https://gmic.eu/files/prerelease/"$file_short"'." +_upload[] $file,"files/prerelease/"$file_short +if !$is_pre +e "- Upload file '"$file"' to 'https://gmic.eu/files/"$folder/$file"'." +_upload[] $file,"files/"$folder/$file +fi +file$>= n+=1 +fi +} +if $n<$N +if !($t%4) +remaining= sep= +repeat $N { if narg(${file$>}) remaining.=${sep}${file$>} sep=", " fi } +e "- Waiting for files: "$remaining"." +fi +wait 30000 t+=1 +fi +while $n<$N" && "$|<$t0+60*60*6 +if $n<$N e "- Partial uploads done (timeout reached)." +else e "- All uploads done !" +fi +fi +_update_header_html : check "narg(${1=}) && ${2=0}>0 && isbool(${3=0})" +filename="$1" +l[] { +it[] $filename +s +,{'\n'} +foreach { if h>=64 ++autocrop {'" "'} autocrop. {'\t'} +if "find(#0,['Latest stable version: '])>=0" +is_gmic:="find(#-1,'gmic.eu')>=0" +is_cimg:="find(#-1,'cimg.eu')>=0" +if !$is_gmic" && "!$is_cimg error "Cannot determine CImg or G'MIC header file." fi ++l. { +s -,{'>'} +if {2,"inrange(i[0],_'0',_'9') && i[1]==_'.' && +inrange(i[2],_'0',_'9') && i[3]==_'.' && +inrange(i[4],_'0',_'9')"} +stable_ver={2,`crop(0,0,1,5)`} +fi +if $3 +x "date +%Y%m%d >"${-path_tmp}/gmic_date it ${-path_tmp}/gmic_date discard. 10 date={t} rm. +pre_ver=${strver\ $2} +pre_date={`s=['$date'];string(s[0,4],'/',s[4,2],'/',s[6,2])`} +else +stable_ver=${strver\ $2} +pre_ver,pre_date= +fi +rm +} +rm[0] +if $is_gmic +i[0] ('" Latest stable version: """$stable_ver""') +if ['$pre_ver']!=0 +i[1] ('"        ""Current pre-release: "$pre_ver" ""("$pre_date")"') +fi +else +i[0] ('" Latest stable version: """$stable_ver""') +if ['$pre_ver']!=0 +i[1] ('"        ""Current pre-release: "$pre_ver" ""("$pre_date")"') +fi +fi +y +fi +rm. +fi } +a y +ot $filename +rm +} +#@cli v : eq. to 'verbose'. : (+) +#@cli verbose : level : { + | - } : (+) +#@cli : Set or increment/decrement the verbosity level. Default level is 0. +#@cli : (eq. to 'v').\n +#@cli : When 'level>0', G'MIC log messages are displayed on the standard error (stderr). +#@cli : Default value: 'level=1'. +#@cli wait : delay : (no arg) : (+) +#@cli : Wait for a given delay (in ms), optionally since the last call to 'wait'. +#@cli : or wait for a user event occurring on the selected instant display windows. +#@cli : 'delay' can be { <0:delay+flush events | 0:event | >0:delay }. +#@cli : Command selection (if any) stands for instant display window indices instead of image indices. +#@cli : If no window indices are specified and if 'delay' is positive, the command results +#@cli : in a 'hard' sleep during specified delay. +#@cli : Default value: 'delay=0'. +#@cli warn : _force_visible={ 0 | 1 },_message : (+) +#@cli : Print specified warning message, on the standard error (stderr). +#@cli : Command selection (if any) stands for displayed call stack subset instead of image indices. +#@cli w : eq. to 'window'. : (+) +#@cli window : _width[%]>=-1,_height[%]>=-1,_normalization,_fullscreen,_pos_x[%],_pos_y[%],_title : (+) +#@cli : Display selected images into an instant display window with specified size, normalization type, +#@cli : fullscreen mode and title. +#@cli : (eq. to 'w').\n +#@cli : If 'width' or 'height' is set to -1, the corresponding dimension is adjusted to the window +#@cli : or image size. +#@cli : Specify 'pos_x' and 'pos_y' arguments only if the window has to be moved to the specified +#@cli : coordinates. Otherwise, they can be avoided. +#@cli : 'width'=0 or 'height'=0 closes the instant display window. +#@cli : 'normalization' can be { -1:keep same | 0:none | 1:always | 2:1st-time | 3:auto }. +#@cli : 'fullscreen' can be { -1:keep same | 0:no | 1:yes }. +#@cli : You can manage up to 10 different instant display windows by using the numbered variants +#@cli : 'w0' (default, eq. to 'w'),'w1',...,'w9' of the command 'w'. +#@cli : Invoke 'window' with no selection to make the window visible, if it has been closed by the user. +#@cli : Default values: 'width=height=normalization=fullscreen=-1' and 'title=(undefined)'. +#@cli :: List Manipulation +#@cli k : eq. to 'keep'. : (+) +#@cli keep : (+) +#@cli : Keep only selected images. +#@cli : (eq. to 'k'). +#@cli : $ image.jpg split x keep[0-50%:2] append x +#@cli : $ image.jpg split x keep[^30%-70%] append x +#@cli kn : eq. to 'keep_named'. +kn : +e[^-1] "Keep images named '$*'." +nmd $"*" k[${}] +#@cli keep_named : "name1","name2",... +#@cli : Keep all images with specified names from the list of images. +#@cli : Remove all images if no images with those names exist. +#@cli : (eq. to 'kmn'). +keep_named : +e[^-1] "Keep images named '$*'." +nmd $"*" k[${}] +#@cli mv : eq. to 'move'. : (+) +#@cli move : position[%] : (+) +#@cli : Move selected images at specified position. +#@cli : Images are actually inserted between current positions 'position-1' and 'position'. +#@cli : (eq. to 'mv'). +#@cli : $ image.jpg split x,3 move[1] 0 +#@cli : $ image.jpg split x move[50%--1:2] 0 append x +#@cli nm : eq. to 'name'. : (+) +#@cli => : eq. to 'name'. : (+) +#@cli name : "name1","name2",...,"nameN" : (+) +#@cli : Set names of selected images. +#@cli : - If no explicit image selection is given, image selection is assumed to be '[-N--1]', where 'N' is the number of specified arguments. +#@cli : - If 'N' is higher than the number of images in selection, an error is thrown. +#@cli : - If 'N' is lower than the number of images in selection, image names are assigned in a periodic way, i.e. `name(selection[k]) = arg[k%N]`. +#@cli : (eq. to '=>' and 'nm'). +#@cli : $ image.jpg name image blur[image] 2 +#@cli : $$ +#@cli rm : eq. to 'remove'. : (+) +#@cli remove : (+) +#@cli : Remove selected images. +#@cli : (eq. to 'rm'). +#@cli : $ image.jpg split x remove[30%-70%] append x +#@cli : $ image.jpg split x remove[0-50%:2] append x +#@cli remove_duplicates +#@cli : Remove duplicates images in the selected images list. +#@cli : $ (1,2,3,4,2,4,3,1,3,4,2,1) split x remove_duplicates append x +remove_duplicates : +e[^-1] "Remove duplicates images in selected list of image$?." +repeat $! { +base=$> off=0 +repeat $!-$>-1 { +comp:=$base+1+$>-$off +if $comp>=$! break fi ++-[$base,$comp] abs. is_duplicate:=!is rm. +if $is_duplicate rm[$comp] off+=1 fi +} +} +#@cli remove_empty +#@cli : Remove empty images in the selected image list. +remove_empty : +e[^-1] "Remove empty images in selected list of image$?." +$!,1,1,1,"!w#x?x:-1" discard. -1 +if w rm[{^},-1] else rm. fi +#@cli rmn : eq. to 'remove_named'. +rmn : +e[^-1] "Remove images named '$*'." +nmd $"*" rm[${}] +#@cli remove_named : "name1","name2",... +#@cli : Remove all images with specified names from the list of images. +#@cli : Does nothing if no images with those names exist. +#@cli : (eq. to 'rmn'). +remove_named : +e[^-1] "Remove images named '$*'." +nmd $"*" rm[${}] +#@cli rv : eq. to 'reverse'. : (+) +#@cli reverse : (+) +#@cli : Reverse positions of selected images. +#@cli : (eq. to 'rv'). +#@cli : $ image.jpg split x,3 reverse[-2,-1] +#@cli : $ image.jpg split x,-16 reverse[50%-100%] append x +#@cli sort_list : _ordering={ + | - },_criterion +#@cli : Sort list of selected images according to the specified image criterion. +#@cli : Default values: 'ordering=+', 'criterion=i'. +#@cli : $ (1;4;7;3;9;2;4;7;6;3;9;1;0;3;3;2) split y sort_list +,i append y +sort_list : skip ${1=+},${2=i} +s0="descending" s1="ascending" +e[^-1] "Sort list of image$? in "${s{['$1']=='+'}}" order, according to the image criterion '$2'." +if $! +if isin('$2','n','N') +op={`;['$1']=='-'?_'>':_'<'`} +if ['$2']=='n' fn=lowercase else fn= fi +$!,1,1,1,"n = name(#x,1024); find(n,0)%1025" slen:=iM rm. # Largest name length. +eval " +const lm1 = l - 1; +const slen = "$slen"; +strcmp(n0,n1) = (for (k = 0, k0, +range = pop(); +lo = range[0]; +hi = range[1]; +pivot = int((lo + hi)/2); +ref(name(#pivot,slen),npivot); +while (lo,$2}) } a[$i--1] y +f. y a[-2,-1] x sort. $1,y z. 1,1 +repeat h { nm$>={$>,n} =>[$>] sortlist$> } +repeat h { mv[sortlist{i(0,$>)}] -1 } +repeat h { =>[$>] ${nm{i(0,$>)}} } +rm. +fi +fi +#@cli :: Mathematical Operators +#@cli abs : (+) +#@cli : Compute the pointwise absolute values of selected images. +#@cli : $ image.jpg +sub {ia} abs[-1] +#@cli : $ 300,1,1,1,'cos(20*x/w)' +abs display_graph 400,300 +#@cli acos : (+) +#@cli : Compute the pointwise arccosine of selected images. +#@cli : $ image.jpg +normalize -1,1 acos[-1] +#@cli : $ 300,1,1,1,'cut(x/w+0.1*u,0,1)' +acos display_graph 400,300 +#@cli : $$ https://gmic.eu/oldtutorial/trigometric-and-inverse-trigometric-commands +#@cli acosh : (+) +#@cli : Compute the pointwise hyperbolic arccosine of selected images. +#@cli + : eq. to 'add'. : (+) +#@cli add : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Add specified value, image or mathematical expression to selected images, or compute the pointwise sum of selected images. +#@cli : (eq. to '+'). +#@cli : $ image.jpg +add 30% cut 0,255 +#@cli : $ image.jpg +blur 5 normalize 0,255 add[1] [0] +#@cli : $ image.jpg add '80*cos(80*(x/w-0.5)*(y/w-0.5)+c)' cut 0,255 +#@cli : $ image.jpg repeat 9 { +rotate[0] {$>*36},1,0,50%,50% } add div 10 +#@cli & : eq. to 'and'. : (+) +#@cli and : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the bitwise AND of selected images with specified value, image or mathematical expression, or compute the pointwise sequential bitwise AND of selected images. +#@cli : (eq. to '&'). +#@cli : $ image.jpg and {128+64} +#@cli : $ image.jpg +mirror x and +#@cli argmax +#@cli : Compute the argmax of selected images. Returns a single image +#@cli : with each pixel value being the index of the input image with maximal value. +#@cli : $ image.jpg sample lena,lion,square +argmax +argmax : +e[^-1] "Compute argmax of image$?." +if !$! return fi +13,$! eval. "!x?copy(i(),[[',i#'],v2s(y,10,10)])" =. 0 discard. 0 str={t} rm. +${-max_whds},"argmax("$str")" k. => [argmax] +#@cli argmaxabs +#@cli : Compute the argmaxabs of selected images. Returns a single image +#@cli : with each pixel value being the index of the input image with maxabs value. +argmaxabs : +e[^-1] "Compute argmaxabs of image$?." +if !$! return fi +13,$! eval. "!x?copy(i(),[[',i#'],v2s(y,10,10)])" =. 0 discard. 0 str={t} rm. +${-max_whds},"argmaxabs("$str")" k. => [argmaxabs] +#@cli argmin +#@cli : Compute the argmin of selected images. Returns a single image +#@cli : with each pixel value being the index of the input image with minimal value. +#@cli : $ image.jpg sample lena,lion,square +argmin +argmin : +e[^-1] "Compute argmin of image$?." +if !$! return fi +13,$! eval. "!x?copy(i(),[[',i#'],v2s(y,10,10)])" =. 0 discard. 0 str={t} rm. +${-max_whds},"argmin("$str")" k. => [argmin] +#@cli argminabs +#@cli : Compute the argminabs of selected images. Returns a single image +#@cli : with each pixel value being the index of the input image with minabs value. +argminabs : +e[^-1] "Compute argminabs of image$?." +if !$! return fi +13,$! eval. "!x?copy(i(),[[',i#'],v2s(y,10,10)])" =. 0 discard. 0 str={t} rm. +${-max_whds},"argminabs("$str")" k. => [argminabs] +#@cli asin : (+) +#@cli : Compute the pointwise arcsine of selected images. +#@cli : $ image.jpg +normalize -1,1 asin[-1] +#@cli : $ 300,1,1,1,'cut(x/w+0.1*u,0,1)' +asin display_graph 400,300 +#@cli : $$ https://gmic.eu/oldtutorial/trigometric-and-inverse-trigometric-commands +#@cli asinh : (+) +#@cli : Compute the pointwise hyperbolic arcsine of selected images. +#@cli atan : (+) +#@cli : Compute the pointwise arctangent of selected images. +#@cli : $ image.jpg +normalize 0,8 atan[-1] +#@cli : $ 300,1,1,1,'4*x/w+u' +atan display_graph 400,300 +#@cli : $$ https://gmic.eu/oldtutorial/trigometric-and-inverse-trigometric-commands +#@cli atan2 : [x_argument] : (+) +#@cli : Compute the pointwise oriented arctangent of selected images. +#@cli : Each selected image is regarded as the y-argument of the arctangent function, while the +#@cli : specified image gives the corresponding x-argument. +#@cli : $ (-1,1) (-1;1) resize 400,400,1,1,3 atan2[1] [0] keep[1] mod {pi/8} +#@cli : $$ https://gmic.eu/oldtutorial/trigometric-and-inverse-trigometric-commands +#@cli atanh : (+) +#@cli : Compute the pointwise hyperbolic arctangent of selected images. +#@cli << : eq. to 'bsl'. : (+) +#@cli bsl : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the bitwise left shift of selected images with specified value, image or mathematical expression, or compute the pointwise sequential bitwise left shift of selected images. +#@cli : (eq. to '<<'). +#@cli : $ image.jpg bsl 'round(3*x/w,0)' cut 0,255 +#@cli >> : eq. to 'bsr'. : (+) +#@cli bsr : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the bitwise right shift of selected images with specified value, image or mathematical expression, or compute the pointwise sequential bitwise right shift of selected images. +#@cli : (eq. to '>>'). +#@cli : $ image.jpg bsr 'round(3*x/w,0)' cut 0,255 +#@cli cos : (+) +#@cli : Compute the pointwise cosine of selected images. +#@cli : $ image.jpg +normalize 0,{2*pi} cos[-1] +#@cli : $ 300,1,1,1,'20*x/w+u' +cos display_graph 400,300 +#@cli : $$ https://gmic.eu/oldtutorial/trigometric-and-inverse-trigometric-commands +#@cli cosh : (+) +#@cli : Compute the pointwise hyperbolic cosine of selected images. +#@cli : $ image.jpg +normalize -3,3 cosh[-1] +#@cli : $ 300,1,1,1,'4*x/w+u' +cosh display_graph 400,300 +#@cli deg2rad +#@cli : Convert pointwise angle values of selected images, from degrees to radians (apply 'i*pi/180'). +deg2rad : +e[^-1] "Convert pointwise angle values of image$?, from degrees to radians." +* 0.017453292519943295 +#@cli / : eq. to 'div'. : (+) +#@cli div : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Divide selected images by specified value, image or mathematical expression, or compute the pointwise quotient of selected images. +#@cli : (eq. to '/'). +#@cli : $ image.jpg div '1+abs(cos(x/10)*sin(y/10))' +#@cli : $ image.jpg +norm add[-1] 1 +div +#@cli div_complex : [divider_real,divider_imag],_epsilon>=0 +#@cli : Perform division of the selected complex pairs (real1,imag1,...,realN,imagN) of images by +#@cli : specified complex pair of images (divider_real,divider_imag). +#@cli : In complex pairs, the real image must be always located before the imaginary image in the image list. +#@cli : Default value: 'epsilon=1e-8'. +div_complex : check ${3=1e-8}>=0 +e[^-1] "Divide complex pair$? by complex pair "${"pass$1,$2 -1"}" (with epsilon $3)." +repeat int($!/2) { +pass${1,2} 0 l[$>,{$>+1},-2,-1] { ++*[1,2] +*[0,3] -[-2,-1] +*[0] [2] *[1] [3] +[0,1] +sqr[1,2] +[1,2] +[1] $3 +/[2] [1] /[0,1] +} +} +#@cli == : eq. to 'eq'. : (+) +#@cli eq : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the boolean equality of selected images with specified value, image or mathematical expression, or compute the boolean equality of selected images. +#@cli : (eq. to '=='). +#@cli : $ image.jpg round 40 eq {round(ia,40)} +#@cli : $ image.jpg +mirror x eq +#@cli erf : (+) +#@cli : Compute the pointwise error function of selected images. +#@cli : $ image.jpg +normalize 0,2 erf[-1] +#@cli : $ 300,1,1,1,'7*x/w-3.5+u' +erf display_graph 400,300 +#@cli exp : (+) +#@cli : Compute the pointwise exponential of selected images. +#@cli : $ image.jpg +normalize 0,2 exp[-1] +#@cli : $ 300,1,1,1,'7*x/w+u' +exp display_graph 400,300 +#@cli >= : eq. to 'ge'. : (+) +#@cli ge : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the boolean 'greater or equal than' of selected images with specified value, image +#@cli : or mathematical expression, or compute the boolean 'greater or equal than' of selected images. +#@cli : (eq. to '>='). +#@cli : $ image.jpg ge {ia} +#@cli : $ image.jpg +mirror x ge +#@cli > : eq. to 'gt'. : (+) +#@cli gt : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the boolean 'greater than' of selected images with specified value, image or mathematical expression, or compute the boolean 'greater than' of selected images. +#@cli : (eq. to '>'). +#@cli : $ image.jpg gt {ia} +#@cli : $ image.jpg +mirror x gt +#@cli <= : eq. to 'le'. : (+) +#@cli le : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the boolean 'less or equal than' of selected images with specified value, image or mathematical expression, or compute the boolean 'less or equal than' of selected images. +#@cli : (eq. to '<='). +#@cli : $ image.jpg le {ia} +#@cli : $ image.jpg +mirror x le +#@cli < : eq. to 'lt'. : (+) +#@cli lt : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the boolean 'less than' of selected images with specified value, image or mathematical expression, or compute the boolean 'less than' of selected images. +#@cli : (eq. to '<'). +#@cli : $ image.jpg lt {ia} +#@cli : $ image.jpg +mirror x lt +#@cli log : (+) +#@cli : Compute the pointwise base-e logarithm of selected images. +#@cli : $ image.jpg +add 1 log[-1] +#@cli : $ 300,1,1,1,'7*x/w+u' +log display_graph 400,300 +#@cli log10 : (+) +#@cli : Compute the pointwise base-10 logarithm of selected images. +#@cli : $ image.jpg +add 1 log10[-1] +#@cli : $ 300,1,1,1,'7*x/w+u' +log10 display_graph 400,300 +#@cli log2 : (+) +#@cli : Compute the pointwise base-2 logarithm of selected images +#@cli : $ image.jpg +add 1 log2[-1] +#@cli : $ 300,1,1,1,'7*x/w+u' +log2 display_graph 400,300 +#@cli max : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the maximum between selected images and specified value, image or mathematical expression, or compute the pointwise maxima between selected images. +#@cli : $ image.jpg +mirror x max +#@cli : $ image.jpg max 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R' +#@cli maxabs : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the maxabs between selected images and specified value, image or mathematical expression, or compute the pointwise maxabs between selected images. +#@cli m/ : eq. to 'mdiv'. : (+) +#@cli mdiv : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the matrix division of selected matrices/vectors by specified value, image or mathematical expression, or compute the matrix division of selected images. +#@cli : (eq. to 'm/'). +#@cli med +#@cli : Compute the median of selected images. +#@cli : $ image.jpg sample lena,lion,square +med +med : +e[^-1] "Compute median of image$?." +if !$! return fi +13,$! eval. "!x?copy(i(),[[',i#'],v2s(y,10,10)])" =. 0 discard. 0 str={t} rm. +${-max_whds},"med("$str")" k. => [med] +#@cli min : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the minimum between selected images and specified value, image or mathematical expression, or compute the pointwise minima between selected images. +#@cli : $ image.jpg +mirror x min +#@cli : $ image.jpg min 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R' +#@cli minabs : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the minabs between selected images and specified value, image or mathematical expression, or compute the pointwise minabs between selected images. +#@cli % : eq. to 'mod'. : (+) +#@cli mod : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the modulo of selected images with specified value, image or mathematical expression, or compute the pointwise sequential modulo of selected images. +#@cli : (eq. to '%'). +#@cli : $ image.jpg +mirror x n. 1,255 round. mod +#@cli : $ image.jpg mod 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R' +#@cli m* : eq. to 'mmul'. : (+) +#@cli mmul : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the matrix right multiplication of selected matrices/vectors by specified value, image or mathematical expression, or compute the matrix right multiplication of selected images. +#@cli : (eq. to 'm*'). +#@cli : $ (0,1,0;0,0,1;1,0,0) (1;2;3) +mmul +#@cli * : eq. to 'mul'. : (+) +#@cli mul : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Multiply selected images by specified value, image or mathematical expression, or compute the pointwise product of selected images. +#@cli : (eq. to '*'). +#@cli : See also: ''add'', ''sub'', ''div''. +#@cli : $ image.jpg +mul 2 cut 0,255 +#@cli : $ image.jpg (1,2,3,4,5,6,7,8) ri[-1] [0] mul[0] [-1] +#@cli : $ image.jpg mul '1-3*abs(x/w-0.5)' cut 0,255 +#@cli : $ image.jpg +luminance negate[-1] +mul +#@cli mul_channels : value1,_value2,...,_valueN +#@cli : Multiply channels of selected images by specified sequence of values. +#@cli : $ image.jpg +mul_channels 1,0.5,0.8 +mul_channels : +e[^-1] "Multiply channels of image$? by value sequence ($*)." +$=arg repeat $# { i=$> +fact=${arg{1+($>%$#)}} +repeat $! { if {$>,$i] $i *. $fact rm. fi } +} +#@cli mul_complex : [multiplier_real,multiplier_imag] +#@cli : Perform multiplication of the selected complex pairs (real1,imag1,...,realN,imagN) of images by +#@cli : specified complex pair of images (multiplier_real,multiplier_imag). +#@cli : In complex pairs, the real image must be always located before the imaginary image in the image list. +mul_complex : +e[^-1] "Multiply complex pair$? by complex pair "${"pass$1,$2 -1"}"." +repeat int($!/2) { +pass${1,2} 0 l[$>,{$>+1},-2,-1] { ++*[0,3] +*[1,2] +[-2,-1] +*[0,2] *[1,2] -[0,1] +} +} +#@cli != : eq. to 'neq'. : (+) +#@cli neq : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the boolean inequality of selected images with specified value, image or mathematical expression, or compute the boolean inequality of selected images. +#@cli : (eq. to '!='). +#@cli : $ image.jpg round 40 neq {round(ia,40)} +#@cli | : eq. to 'or'. : (+) +#@cli or : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the bitwise OR of selected images with specified value, image or mathematical expression, or compute the pointwise sequential bitwise OR of selected images. +#@cli : (eq. to '|'). +#@cli : $ image.jpg or 128 +#@cli : $ image.jpg +mirror x or +#@cli ^ : eq. to 'pow'. : (+) +#@cli pow : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Raise selected images to the power of specified value, image or mathematical expression, or compute the pointwise sequential powers of selected images. +#@cli : (eq. to '^'). +#@cli : $ image.jpg div 255 +pow 0.5 mul 255 +#@cli : $ image.jpg gradient pow 2 add pow 0.2 +#@cli rad2deg +#@cli : Convert pointwise angle values of selected images, from radians to degrees (apply 'i*180/pi'). +rad2deg : +e[^-1] "Convert pointwise angle values of image$?, from radians to degrees." +* 57.295779513082323 +#@cli rol : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the bitwise left rotation of selected images with specified value, image or mathematical expression, or compute the pointwise sequential bitwise left rotation of selected images. +#@cli : $ image.jpg rol 'round(3*x/w,0)' cut 0,255 +#@cli ror : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the bitwise right rotation of selected images with specified value, image or mathematical expression, or compute the pointwise sequential bitwise right rotation of selected images. +#@cli : $ image.jpg ror 'round(3*x/w,0)' cut 0,255 +#@cli sign : (+) +#@cli : Compute the pointwise sign of selected images. +#@cli : $ image.jpg +sub {ia} sign[-1] +#@cli : $ 300,1,1,1,'cos(20*x/w+u)' +sign display_graph 400,300 +#@cli sin : (+) +#@cli : Compute the pointwise sine of selected images. +#@cli : $ image.jpg +normalize 0,{2*pi} sin[-1] +#@cli : $ 300,1,1,1,'20*x/w+u' +sin display_graph 400,300 +#@cli : $$ https://gmic.eu/oldtutorial/trigometric-and-inverse-trigometric-commands +#@cli sinc : (+) +#@cli : Compute the pointwise sinc function of selected images. +#@cli : $ image.jpg +normalize {-2*pi},{2*pi} sinc[-1] +#@cli : $ 300,1,1,1,'20*x/w+u' +sinc display_graph 400,300 +#@cli sinh : (+) +#@cli : Compute the pointwise hyperbolic sine of selected images. +#@cli : $ image.jpg +normalize -3,3 sinh[-1] +#@cli : $ 300,1,1,1,'4*x/w+u' +sinh display_graph 400,300 +#@cli sqr : (+) +#@cli : Compute the pointwise square function of selected images. +#@cli : $ image.jpg +sqr +#@cli : $ 300,1,1,1,'40*x/w+u' +sqr display_graph 400,300 +#@cli sqrt : (+) +#@cli : Compute the pointwise square root of selected images. +#@cli : $ image.jpg +sqrt +#@cli : $ 300,1,1,1,'40*x/w+u' +sqrt display_graph 400,300 +#@cli - : eq. to 'sub'. : (+) +#@cli sub : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Subtract specified value, image or mathematical expression to selected images, or compute the pointwise difference of selected images. +#@cli : (eq. to '-'). +#@cli : $ image.jpg +sub 30% cut 0,255 +#@cli : $ image.jpg +mirror x sub[-1] [0] +#@cli : $ image.jpg sub 'i(w/2+0.9*(x-w/2),y)' +#@cli : $ image.jpg +mirror x sub +#@cli tan : (+) +#@cli : Compute the pointwise tangent of selected images. +#@cli : $ image.jpg +normalize {-0.47*pi},{0.47*pi} tan[-1] +#@cli : $ 300,1,1,1,'20*x/w+u' +tan display_graph 400,300 +#@cli : $$ https://gmic.eu/oldtutorial/trigometric-and-inverse-trigometric-commands +#@cli tanh : (+) +#@cli : Compute the pointwise hyperbolic tangent of selected images. +#@cli : $ image.jpg +normalize -3,3 tanh[-1] +#@cli : $ 300,1,1,1,'4*x/w+u' +tanh display_graph 400,300 +#@cli xor : value[%] : [image] : 'formula' : (no arg) : (+) +#@cli : Compute the bitwise XOR of selected images with specified value, image or mathematical expression, or compute the pointwise sequential bitwise XOR of selected images. +#@cli : $ image.jpg xor 128 +#@cli : $ image.jpg +mirror x xor +#@cli :: Values Manipulation +#@cli apply_curve : 0<=smoothness<=1,x0,y0,x1,y1,x2,y2,...,xN,yN +#@cli : Apply curve transformation to image values. +#@cli : Default values: 'smoothness=1', 'x0=0', 'y0=100'. +#@cli : $ image.jpg +apply_curve 1,0,0,128,255,255,0 +apply_curve : check "${1=1}>=0 && $1<=1" skip ${2=0},${3=100} +e[^-1] "Apply intensity curve with smoothness $1 and keypoints (${2--1}) on image$?." +(${^0,1}) r. 2,{w/2},1,1,-1 +z. 0,0 vm,vM:=[im,iM] n. 0,8191 j.. . function1d[] $1,{-2,^} rm[-3,-2] +-[^-1] $vm *[^-1] {8191/($vM-$vm)} map[^-1] .,1 rm. +#@cli apply_gamma : gamma>=0 +#@cli : Apply gamma correction to selected images. +#@cli : $ image.jpg +apply_gamma 2 +apply_gamma : check $1>=0 +e[^-1] "Apply Gamma-correction to image$?, with gamma $1." +if $1==1 return fi +foreach { mM:=[im,iM] n 0,1 ^ {1/$1} n $mM } +#@cli balance_gamma : _ref_color1,... +#@cli : Compute gamma-corrected color balance of selected image, with respect to specified reference color. +#@cli : Default value: 'ref_color1=128'. +#@cli : $ image.jpg +balance_gamma 128,64,64 +balance_gamma : check "isnum(${1=128})" +e[^-1] "Apply gamma-corrected color balance of image$?, with reference color ("${^0}")." +foreach { +(${^0}) r. {-2,s},1,1,1,0,1 s.. c /. 255 +repeat $!-1 { /[$>] 255 ^[$>] {log({@$>})/log({$>,ia})} *[$>] 255 } +rm. a c c 0,255 +} +#@cli cast : datatype_source,datatype_target +#@cli : Cast datatype of image buffer from specified source type to specified target type. +#@cli : 'datatype_source' and 'datatype_target' can be { uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }. +cast : +e[^-1] "Cast datatype of image buffer$? from '$1' to '$2'." +ssize:=s=['"$1"'];s=='uint8'||s=='int8'?1:s=='uint16'||s=='int16'?2:s=='uint32'||s=='int32'||s=='float32'?4:8 +dsize:=s=['"$2"'];s=='uint8'||s=='int8'?1:s=='uint16'||s=='int16'?2:s=='uint32'||s=='int32'||s=='float32'?4:8 +foreach { +w,h,d,s={w},{h},{d},{s} +serialize $1,0,0 +s -,{'\n$w\ $h\ $d\ $s\n'} +i[1] ('\n1\ {int($w*$h*$d*$s*$ssize/$dsize)}\ 1\ 1\n') y[1] +replace_str[0] "$1","$2" +a y unserialize +} +#@cli complex2polar +#@cli : Compute complex to polar transforms of selected images. +#@cli : $ image.jpg +fft complex2polar[-2,-1] log[-2] shift[-2] 50%,50%,0,0,2 remove[-1] +complex2polar : +e[^-1] "Compute complex to polar transforms of image$?." +repeat int($!/2) { +l[{2*$>},{2*$>+1}] { +ri[1] [0],3 +atan2[1] [0] => {1,n} sqr[-3,-2] +[-3,-2] sqrt.. +} +} +#@cli compress_clut : _max_error>0,_avg_error>0,_max_nbpoints>=8 | 0 (unlimited),_error_metric={ 0:L2-norm | 1:deltaE_1976 | 2:deltaE_2000 },_reconstruction_colorspace={ 0:srgb | 1:rgb | 2:lab },_try_rbf_first={ 0:false | 1:true } +#@cli : Compress selected color LUTs as sequences of colored keypoints. +#@cli : Default values: 'max_error=1.5', 'avg_error=0.75', 'max_nb_points=2048', 'error_metric=2', 'reconstruction_colorspace=0' and 'try_rbf_first=1'. +compress_clut : check "${1=1.5}>0 && ${2=0.75}>0 && isint(${3=2048}) && (!$3 || $3>=8) && isin(${4=2},0,1,2) && ""isin(${5=0},0,1,2) && isbool(${6=1})" +e[^-1] "Compress color LUT$? as a set of colored keypoints, with maximum error $1, average error $2, ""$3 maximum keypoints, "${"s0,s1,s2=L2-RGB,DeltaE_1976,DeltaE_2000 u $s$4"}" metric and "${"s0,s1,s2=srgb,rgb,lab u $s$5"}" colorspace for reconstruction." +v 0 +max_error,avg_error,max_keypoints,metric,colorspace,try_rbf=${1-6} +if $try_rbf method=rbf else method=pde fi +foreach { +nm={b} +if iM>1024 / 257 fi +if d==1 S:=round(cbrt(wh)) r $S,$S,$S,100%,-1 fi +e "\n* Process CLUT '"$nm"' ("{w}"x"{h}"x"{d}")." +if "s==3 && +crop(0,0,0,0,w,h,d,1)==crop(0,0,0,1,w,h,d,1) && +crop(0,0,0,0,w,h,d,1)==crop(0,0,0,2,w,h,d,1)" +channels 0 +fi +_metric:=s==3?$metric:0 +if $_metric +srgb2lab fi +1,8,1,{s+3} +eval " +coords = [ 0,0,0, 255,0,0, 255,255,0, 0,255,0, 0,0,255, 255,0,255, 255,255,255, 0,255,255 ]; +repeat (size(coords)/3,k, +P = coords[3*k,3]; +I[k] = [ P, I(#0,round(P*([w#0,h#0,d#0]-1)/255)) ] +)" +sep="\n" +do ++decompress_clut_$method. {0,[w,h,d]},$colorspace +if !$_metric -. [0] norm. else srgb2lab. deltaE. [1],{$_metric-1}," " fi +emax,eavg:=[iM,ia] +e "\r"$sep" > Add [#"{-2,h}"] Max_Err = "{_$emax}", Avg_Err = "{_$eavg}" " sep="" +if $emax<=$max_error" && "$eavg<=$avg_error rm. break fi +1,1,1,{0,s+3},{"P = [ xM,yM,zM ]; [ P*255/[max(1,w#0-1),max(1,h#0-1),max(1,d#0-1)], I(#0,P) ]"} rm.. +a[-2,-1] y +if $max_keypoints" && "h>=512" && "['$method']=='rbf' method=pde rows. 0,7 fi +while h<($max_keypoints?$max_keypoints:inf) +if h>8 +if $_metric max_rounding,avg_rounding=0.1,0.025 +else max_rounding,avg_rounding=1,0.25 +fi +if $emax>$max_error" || "$eavg>$avg_error +max_error=round($max_error,$max_rounding,1) +avg_error=round($avg_error,$avg_rounding,1) +fi +index=8 sep="\n" +do ++l. { s y rm[$index] a y } ++decompress_clut_$method. {0,[w,h,d]},$colorspace +if !$_metric -. [0] norm. else srgb2lab. deltaE. [1],{$_metric-1}," " fi +emax,eavg:=[iM,ia] rm. +if $emax<=$max_error" && "$eavg<=$avg_error rv[-2,-1] else index+=1 fi +e "\r"$sep" > Rem [#"{min($index,h-1)}"/"{h}"] Max_Err = "{_$emax}", Avg_Err = "{_$eavg}" " +sep="" +rm. +while $index ${} +} +compress_cluts : check "${2=1.5}>0 && ${3=0.75}>0 && isint(${4=2048}) && $4>8" +rm +if isfile(['{/"$1"}']) it[] "$1" s -,{'\n'} +else files "$1" ('${}') s -,{','} +fi +foreach { +filename={t} 0 => $filename ext={x} rm +basename $filename +l[] { ('${}') replace_str .$ext,"" basename={t} rm } +need_compression=1 +cclut=cclut_$basename.gmz +if isfile(['{/$cclut}']) +i $cclut +if "dat = (date(5) + 60*(date(4) + date(2)*24)); +fdat = (date(5,'"{/$cclut}"') + 60*(date(4,'"{/$cclut}"') + date(2,'"{/$cclut}"')*24)); +!h && dat-fdat<30" +e "* Skip file '"$filename"' (CLUT already being compressed)." +need_compression=0 +elif h>0" && "h!=2048 +e "* Skip file '"$filename"' (CLUT already compressed)." +need_compression=0 +fi +rm. +fi +if $need_compression +0 o. $cclut rm. +if lowercase(['$ext'])=='cube' input_cube $filename c. 0,255 +elif lowercase(['$ext'])=='png' i $filename S:=round(cbrt(wh)) r $S,$S,$S,100%,-1 +else e "* Skip file '"$filename"' (unknown CLUT format)." continue +fi +e "* Compress file '"$filename"'." +if w>33 r3dx 33 fi +to_rgb +tic compress_clut $2,$3,$4 toc +o $cclut +fi +rm +} +#@cli compress_huffman : [huffman_tree],_max_leaf_value +#@cli : Compress selected images with Huffman coding. +#@cli : See also: ''decompress_huffman'', ''huffman_tree''. +compress_huffman : check ${"is_image_arg $1"} skip "${2=}" +e[^-1] "Compress image$? with Huffman coding, using tree $1." +pass$1 +if ['$2']==0 +eval. ">begin(Mlv = -inf); i2<0 && i3<0?Mlv = max(Mlv,i0); end(set('Mlv',Mlv)); I" +else +Mlv=$2 +fi +1,{$Mlv+1},1,2 +eval.. ":i2<0?( +ind = y; +code = nb_bits = 0; +while (ind>=0, +par = i(0,ind,0,1); +par>=0?((code<<=1)|=(i(0,par,0,2)!=ind); ++nb_bits); +ind = par; +); +ncode = 0; repeat (nb_bits,(ncode<<=1)|=(code&1); code>>=1); +I[#-1,i0] = [ ncode,nb_bits ]; +); I" +rm.. +foreach[^-1] { +nm={n} pass. 2 +0 eval... ">begin(da_push(w,h,d,s); out_stream = nb_bits = 0); +C = I[#-2,int(i),1]; +(out_stream<<=C[1])|=C[0]; +nb_bits+=C[1]; +while (nb_bits>=8, +da_push(out_stream>>(nb_bits-=8)); +out_stream%=1< $nm +} +rm. +#@cli huffman_tree +#@cli : Generate Huffman coding tree from the statistics of all selected images. +#@cli : Huffman tree is returned as a 1xN image inserted at the end of the image list, representing the 'N' vector-valued leafs/nodes of the tree, encoded as `[ value,parent,child0,child1 ]`. +#@cli : Last row of the returned image corresponds to the tree root. +#@cli : Selected images must contain only positive integer values. +#@cli : Return maximal value of the input data in the status. +#@cli : See also: ''compress_huffman'', ''decompress_huffman''. ++huffman_tree : +e[^-1] "Generate Huffman coding tree from the statistic of image$?." +Mlv:="val=-inf;for(k=0,k=active, --k, +occ = i(0,k,0,1); +occ<=omin1?(oind2 = oind1; omin2 = omin1; oind1 = k; omin1 = occ): +occ<=omin2?(oind2 = k; omin2 = occ); +); +oind1>oind2?swap(oind1,oind2); +i(0,oind1,0,3) = i(0,oind2,0,3) = id; +da_push([ id++,omin1 + omin2,-1,-1,i[oind1],i[oind2] ]); +swap(I[oind1],I[active++]); +swap(I[oind2],I[active++]); +,_(while) active "[Huffman Tree]" +u $Mlv +#@cli compress_rle : _is_binary_data={ 0 | 1 },_maximum_sequence_length>=0 +#@cli : Compress selected images as 2xN data matrices, using RLE algorithm. +#@cli : Set 'maximum_sequence_length=0' to disable maximum length constraint. +#@cli : Default values: 'is_binary_data=0' and 'maximum_sequence_length=0'. +#@cli : $ image.jpg resize2dy 100 quantize 4 round +compress_rle , +decompress_rle[-1] +compress_rle : check "isbool(${1=0}) && isint(${2=0}) && $2>=0" +s0=" for binary data" s1="" +if $2 s=", with maximal sequence length "$2 else s="" fi +e[^-1] "Compress image$? using RLE algorithm"${s{!$1}}$s"." +foreach { +nm={n} im:=im header:=w,h,d,s,$im,$1!=0 +- $im y x ({{0,@-1}+1}) a x r 100%,3 +f ">!y?i:y==1?(i(x,0)==i(x+1,0)?-1:x):(i(x-1,1)==-1?i(x-1,2)+1:1)" +if $2 +transpose mirror x +f. ">x==2?i:!x?(j(0,-1)==$2?1:i!=1?j(0,-1)+1:1):(i==-1&&j(-1)==$2?y:i)" +mirror x transpose +fi +z 0,{w-2} s y,3 y[1] discard[1] -1 warp[0,2] [1],0,0 rm[1] +if $1 +!=[0] 0 *[0] 2 -[0] 1 * +else +*. -1 rv a x y discard -1 +f ">i(0,y-1)<0 && !i && i(0,y+1)<0?-1:i" discard -1 +fi +i[0] ($header:y) a y => $nm +} +#@cli cumulate : { x | y | z | c }...{ x | y | z | c } : (no arg) : (+) +#@cli : Compute the cumulative function of specified image data, optionally along the specified axes. +#@cli : $ image.jpg +histogram 256 +cumulate[-1] display_graph[-2,-1] 400,300,3 +#@cli c : eq. to 'cut'. : (+) +#@cli cut : { value0[%] | [image0] },{ value1[%] | [image1] } : [image] : (+) +#@cli : Cut values of selected images in specified range. +#@cli : (eq. to 'c').\n +#@cli : $ image.jpg +add 30% cut[-1] 0,255 +#@cli : $ image.jpg +cut 25%,75% +#@cli decompress_clut : _width>0,_height>0,_depth>0,_reconstruction_colorspace={ 0:srgb | 1:rgb | 2:lab } +#@cli : Decompress selected colored keypoints into 3D CLUTs, using a mixed RBF/PDE approach. +#@cli : Default values: 'width=height=depth=33' and 'reconstruction_colorspace=0'. +decompress_clut : check "isint(${1=33}) && $1>0 && isint(${2=$1}) && $2>0 && isint(${3=$1}) && $3>0 && ""isin(${4=0},0,1,2)" +e[^-1] "Decompress colored keypoint$? into $1x$2x$3 CLUTs, using "${"s0,s1=srgb,rgb u $s$4"}" colorspace for reconstruction." +foreach { +if "h>=512 || (P0 = I[0]; P1 = I[h - 1]; val(P) = (P[0]*65536 + P[1]*256 + P[2]); val(P0)>val(P1))" +decompress_clut_pde. ${1-4} +else +decompress_clut_rbf. ${1-4} +fi +} +#@cli decompress_clut_rbf : _width>0,_height>0,_depth>0,_reconstruction_colorspace={ 0:srgb | 1:rgb | 2:lab } +#@cli : Decompress selected colored keypoints into 3D CLUTs, using RBF thin plate spline interpolation. +#@cli : Default value: 'width=height=depth=33' and 'reconstruction_colorspace=0'. +decompress_clut_rbf : check "isint(${1=33}) && $1>0 && isint(${2=$1}) && $2>0 && isint(${3=$1}) && $3>0 && ""isin(${4=0},0,1,2)" +e[^-1] "Decompress colored keypoint$? into $1x$2x$3 CLUTs (RBF approach), using "${"s0,s1,s2=srgb,rgb,lab u $s$4"}" colorspace for reconstruction." +foreach { +if $4 s c,-3 srgb2${"arg $4,rgb,lab"}. a c fi +rbf $1,$2,$3,0,0,0,255,255,255 +if $4 ${"arg $4,rgb,lab"}2srgb fi +} +#@cli decompress_clut_pde : _width>0,_height>0,_depth>0,_reconstruction_colorspace={ 0:srgb | 1:rgb | 2:lab } +#@cli : Decompress selected colored keypoints into 3D CLUTs, using multiscale diffusion PDE's. +#@cli : Default values: 'width=height=depth=33' and 'reconstruction_colorspace=0'. +decompress_clut_pde : check "isint(${1=33}) && $1>0 && isint(${2=$1}) && $2>0 && isint(${3=$1}) && $3>0 && ""isin(${4=0},0,1,2)" +e[^-1] "Decompress colored keypoint$? into $1x$2x$3 CLUTs (PDE approach), using "${"s0,s1,s2=srgb,rgb,lab u $s$4"}" colorspace for reconstruction." +foreach { +nm={n} +if $4 s c,-3 srgb2${"arg $4,rgb,lab"}. a c fi +2,2,2,{s-3} +do ++f. 0 .,.,.,1 +eval[0] "begin(fact = ([w#1,h#1,d#1] - 1)/255); PC = I; P = PC[0,3]; X = round(P*fact); +I(#2,X)+=PC[3,s-3]; ++i(#3,X); I" +f. "*i?(I(#2)/=i;1):0" +if im rm[-3,-1] +else ++distance. 1 .,.,.,3 +eval.. "* +const boundary = 1; +maxabs(a,b) = (abs(a)>abs(b)?a:b); +I(#-1) = [ maxabs(j(1) - i,i - j(-1)), +maxabs(j(0,1) - i,i - j(0,-1)), +maxabs(j(0,0,1) - i,i - j(0,0,-1)) ]" +orientation. rm.. +repeat 20 { +j[-4] ...,0,0,0,0,1,.. ++warp[-4] .,1,2,1 *.. -1 warp[-5] ..,1,2,1 +[-5,-1] /[-4] 2 +} +j[-4] ...,0,0,0,0,1,.. k[0,1] +fi +if "w<$1 || h<$2 || d<$3" r. {[min($1,2*w),min($2,2*h),min($3,2*d)]},100%,3 else break fi +while 1 +k. +if $4 ${"arg $4,rgb,lab"}2srgb fi +=> $nm +} +um srgb2srgb +#@cli decompress_huffman : [huffman_tree] +#@cli : Decompress selected images with Huffman decoding. +#@cli : See also: ''compress_huffman'', ''huffman_tree''. +#@cli : $ image.jpg huffman_tree compress_huffman.. . +decompress_huffman.. . +decompress_huffman : check ${"is_image_arg $1"} +e[^-1] "Decompress image$? with Huffman decoding, using tree $1." +pass$1 +foreach[^-1] { +nm={n} pass. 2 +0 eval " +hvalues = crop(#-2,0,0,0,0,1,h#-2,1,1); +hparent = crop(#-2,0,0,0,1,1,h#-2,1,1); +hchild0 = crop(#-2,0,0,0,2,1,h#-2,1,1); +hchild1 = crop(#-2,0,0,0,3,1,h#-2,1,1); +const root = size(hvalues) - 1; +siz = prod(crop(#-3,0,0,1,4)); +off = 4; mask = byte = bytes_written = 0; +ind = root; +while (bytes_written>=1; +child = bit?hchild1[ind]:hchild0[ind]; +val = hvalues[child]; +val>=0?( +da_push(val); +ind = root; +++bytes_written; +):(ind = child); +); da_freeze()" +r. {"crop(#-3,0,0,1,4)"},-1 k. => $nm +} +rm. +#@cli decompress_rle +#@cli : Decompress selected data vectors, using RLE algorithm. +decompress_rle : +e[^-1] "Decompress data vector$?, using RLE algorithm." +foreach { +y whds={0,@0-3} im={0,@4} is_binary_data={0,@5} rows 6,100% +if $is_binary_data ++>= 0 abs[0] a x +else ++<. 0 +(0;1;1) +erode.. .,0 rm. -. 1 a x discard -1 ++< 0 (0;1;1) dilate.. . rm. *. -2 +. 1 +rv abs. a x discard -1 +r 2,{h/2},1,1,-1 +fi +s y,-256 +foreach { +i[0] ('CImg3d') +[0] 0.5 +i[1] ({2*h};{h}) +s. x,2 cumulate.. siz={-2,@-1} ++shift.. 0,1 -... 1 rv[-3,-1] z[-3,-1] 0,2 a[-3,-1] x +i[3] (2,0,1;2,{2*h-2},{2*h-1}) r[3] 3,{h},1,1,3 round[3] +r[4] 3 1,100%,1,1,1 y a y +$siz j3d. ..,0,0,0,1,2,0,0 rm.. +} +a x r $whds,-1 + $im +} +#@cli discard : _value1,_value2,... : { x | y | z | c}...{ x | y | z | c},_value1,_value2,... : (no arg) : (+) +#@cli : Discard specified values in selected images or discard neighboring duplicate values, +#@cli : optionally only for the values along the first of a specified axis. +#@cli : If no arguments are specified, neighboring duplicate values are discarded. +#@cli : If all pixels of a selected image are discarded, an empty image is returned. +#@cli : $ (1;2;3;4;3;2;1) +discard 2 +#@cli : $ (1,2,2,3,3,3,4,4,4,4) +discard x +#@cli eigen2tensor +#@cli : Recompose selected pairs of eigenvalues/eigenvectors as 2x2 or 3x3 tensor fields. +#@cli : $$ +eigen2tensor : +e[^-1] "Recompose pairs in eigen field$? as 2x2 or 3x3 tensor fields." +repeat $!/2 { l[$>,{$>+1}] { +nm={0,n} +if s==2 +s. c ++sqr. *.. ... sqr... +sh. +*... -1 +sh[-5] +a[-3--1] c a[-4--2] c +sh... 0 *[-3,-1] +sh... 1 *[-2,-1] +rm... +[-2,-1] +elif s==6 +s. c +l[-6--4] { +sqr.. +*[-2,-3] +sqr... *[-5] [-6] *[-4] [-6] sqr[-6] a c } +l[-3--1] { +sqr.. +*[-2,-3] +sqr... *[-5] [-6] *[-4] [-6] sqr[-6] a c } +s... c +-[-5] ... -[-4] ... *.. [-5] *. [-4] +(1^0^0^1^0^1) ri. ... *. [-4] rm[-6--4] +[-3--1] +else error[0--3] "Command '$0': Invalid image ["{$!-$>-1}"] : Dimensions "{w}","{h}","{d}","{s}" does +not represent a field of 2D or 3D eigenvectors." +fi +=> $nm +} } +#@cli endian : _datatype : (+) +#@cli : Reverse data endianness of selected images, eventually considering the pixel being of the specified datatype. +#@cli : 'datatype' can be { bool | uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }. +#@cli : This command does nothing for 'bool', 'uint8' and 'int8' datatypes. +#@cli equalize : _nb_levels>0[%],_value_min[%],_value_max[%] : (no arg) : (+) +#@cli : Equalize histograms of selected images. +#@cli : If value range is specified, the equalization is done only for pixels in the specified +#@cli : value range. +#@cli : Default values: 'nb_levels=256', 'value_min=0%' and 'value_max=100%'. +#@cli : $ image.jpg +equalize +#@cli : $ image.jpg +equalize 4,0,128 +#@cli f : eq. to 'fill'. : (+) +#@cli fill : value1,_value2,... : [image] : 'formula' : (+) +#@cli : Fill selected images with values read from the specified value list, existing image +#@cli : or mathematical expression. Single quotes may be omitted in 'formula'. +#@cli : (eq. to 'f'). +#@cli : $ 4,4 fill 1,2,3,4,5,6,7 +#@cli : $ 4,4 (1,2,3,4,5,6,7) fill[-2] [-1] +#@cli : $ 400,400,1,3 fill "X=x-w/2; Y=y-h/2; R=sqrt(X^2+Y^2); a=atan2(Y,X); R<=180?255*abs(cos(c+200*(x/w-0.5)*(y/h-0.5))):850*(a%(0.1*(c+1)))" +#@cli : $$ +#@cli index : { [palette] | palette_name },0<=_dithering<=1,_map_palette={ 0 | 1 } : (+) +#@cli : Index selected vector-valued images by specified vector-valued palette. +#@cli : 'palette_name' can be { default | hsv | lines | hot | cool | jet | flag | cube | rainbow | algae | amp |balance | curl | deep | delta | dense | diff | haline | ice | matter | oxy | phase | rain | solar | speed | tarn |tempo | thermal | topo | turbid | aurora | hocuspocus | srb2 | uzebox } +#@cli : Default values: 'dithering=0' and 'map_palette=0'. +#@cli : $ image.jpg +index 1,1,1 +#@cli : $ image.jpg (0;255;255^0;128;255^0;0;255) +index[-2] [-1],1,1 +#@cli : $$ https://gmic.eu/tutorial/gindex +index : check "${2=0}>=0 && $2<=1 && isbool(${3=0})" +if ${"is_image_arg $1"} pass$1 e[0--3] "Index values in image$? by LUT $1, with dithering level $2." +else +names=${-_palette_names} N:=narg($names) +l[] { if isint("$1") name=${"arg0 ($1%"$N"),"$names} else name="$1" fi onfail name="$1" } +e[0--3] "Index values in image$? by LUT '"$name"', with dithering level $2." +palette $1 +fi +index[^-1] .,$2,$3 rm. +#@cli ir : eq. to 'inrange'. +ir : check "isbool(${3=1}) && isbool(${4=$3})" +_gmic_s="$?" v + _inrange $* +#@cli inrange : min[%],max[%],_include_min_boundary={ 0:no | 1:yes },_include_max_boundary={ 0:no | 1:yes } +#@cli : Detect pixels whose values are in specified range `[min,max]`, in selected images. +#@cli : (eq. to 'ir'). +#@cli : Default value: 'include_min_boundary=include_max_boundary=1'. +#@cli : $ image.jpg +inrange 25%,75% +inrange : check "isbool(${3=1}) && isbool(${4=$3})" +_gmic_s="$?" v + _$0 $* +_inrange : skip "${3=1},${4=$3}" +v:=$3+2*$4 +s=${"arg0 "$v",out,\" min\",\" max\",\" min and max\""} +if $v%3 b="y" else b="ies" fi +e[0--3] "Extract pixel values in range [$1,$2] in image"$_gmic_s", with"$s" boundar"$b" included." +foreach { +m=$1 M=$2 +if ispercentage($1) m:=im+(iM-im)*$1 fi +if ispercentage($2) M:=im+(iM-im)*$2 fi +f. inrange(i,$m,$M,$3) +} +#@cli map : [palette],_boundary_conditions : palette_name,_boundary_conditions : (+) +#@cli : Map specified vector-valued palette to selected indexed scalar images. +#@cli : 'palette_name' can be { default | hsv | lines | hot | cool | jet | flag | cube | rainbow | algae | amp | balance | curl | deep | delta | dense | diff | gray | haline | ice | matter | oxy | phase | rain | solar | speed | tarn | tempo | thermal | topo | turbid | aurora | hocuspocus | srb2 | uzebox } +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : Default value: 'boundary_conditions=0'. +#@cli : $ image.jpg +luminance map[-1] 3 +#@cli : $ image.jpg +rgb2ycbcr split[-1] c (0,255,0) resize[-1] 256,1,1,1,3 map[-4] [-1] remove[-1] append[-3--1] c ycbcr2rgb[-1] +#@cli : $$ +map : check "isint(${2=0}) && $2>=0 && $2<=3" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror boundary=${s$2} +names=${-_palette_names} N:=narg($names) +l[] { if isint("$1") name=${"arg0 ($1%"$N"),"$names} else name="$1" fi onfail name="$1" } +e[^-1] "Map color LUT '"$name"' on image$?, with "$boundary" boundary conditions." +palette $1 map[^-1] .,$2 rm. +#@cli mix_channels : (a00,...,aMN) : [matrix] +#@cli : Apply specified matrix to channels of selected images. +#@cli : $ image.jpg +mix_channels (0,1,0;1,0,0;0,0,1) +mix_channels : +e[^-1] "Apply matrix $* to channels of image$?." +if ${"is_image_arg $1"} pass$1 1 else i ${^0} fi +foreach[^-1] { +nm={n} whd:=[w,h,d] r. {[whd,s]},1,1,-1 +pass. 0 mv. 0 m* r $whd,{h},-1 => $nm +} rm. +#@cli negate : base_value : (no arg) +#@cli : Negate image values. +#@cli : Default value: 'base_value=(undefined)'. +#@cli : $ image.jpg +negate +negate : skip "${1=,}" +if isnum("$*") +e[0--3] "Negate values of image$?, according to base value $*." +- {"$*"} * -1 +else +e[0--3] "Negate values of image$?." +repeat $! { -[$>] {$>,iM} } * -1 +if ['"$1"']!=',' noarg fi +fi +#@cli noise : std_deviation>=0[%],_noise_type : (+) +#@cli : Add random noise to selected images. +#@cli : 'noise_type' can be { 0:gaussian | 1:uniform | 2:salt&pepper | 3:poisson | 4:rice }. +#@cli : Default value: 'noise_type=0'. +#@cli : $ image.jpg +noise[0] 50,0 +noise[0] 50,1 +noise[0] 10,2 cut 0,255 +#@cli : $ 300,300,1,3 [0] noise[0] 20,0 noise[1] 20,1 +histogram 100 display_graph[-2,-1] 400,300,3 +#@cli noise_perlin : _scale_x[%]>0,_scale_y[%]>0,_scale_z[%]>0,_seed_x,_seed_y,_seed_z +#@cli : Render 2D or 3D Perlin noise on selected images, from specified coordinates. +#@cli : The Perlin noise is a specific type of smooth noise, +#@cli : described here : . +#@cli : Default values: 'scale_x=scale_y=scale_z=16' and 'seed_x=seed_y=seed_z=0'. +#@cli : $ 500,500,1,3 noise_perlin , +noise_perlin : check "${1=16}>0 && ${2=$1}>0 && ${3=$1}>0 && isnum(${4=0}) && isnum(${5=0}) && isnum(${6=0})" +e[^-1] "Render Perlin noise on image$?, with scales (${1-3}) and seeds (${4-6})." +init="permutation = [ 151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240, +21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88, +237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231, +83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1, +216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198, +173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47, +16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167, +43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251, +34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31, +181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29, +24,72,243,141,128,195,78,66,215,61,156,180 ]; +p = [ permutation,permutation ]; +fade(t) = (t*t*t*(t*(t*6 - 15) + 10)); +_lerp(t,a,b) = lerp(a,b,t); +pcmod255 = vectors(); repeat (s,k,pcmod255[k] = p[k%255]); +sx = ['$1']; is_px = sx[size(sx) - 1]==_'%'; +sy = ['$2']; is_py = sy[size(sy) - 1]==_'%'; +sz = ['$3']; is_pz = sz[size(sz) - 1]==_'%'; +x0 = $4; +y0 = $5; +z0 = $6; +x1 = x0 + (is_px?1/$1:w/$1); +y1 = y0 + (is_py?1/$2:h/$2); +z1 = z0 + (is_pz?1/$3:d/$3); +fw = (x1 - x0)/max(w - 1,1); +fh = (y1 - y0)/max(h - 1,1); +fd = (z1 - z0)/max(d - 1,1);" +repeat $! { if {$>,d>1} +f[$>] "*begin("$init" +grad(hash,x,y,z) = ( gh = hash&15; gu = gh<8?x:y; gv = gh<4?y:gh==12 || gh==14?x:z; +(!(gh&1)?gu:-gu) + (!(gh&2)?gv:-gv)) +); +x = x0 + x*fw + pcmod255[c]; y = y0 + y*fh + pcmod255[c]; z = z0 + z*fd + pcmod255[c]; +ix = floor(x); iy = floor(y); iz = floor(z); +X = ix&255; Y = iy&255; Z = iz&255; +fx = x - ix; fy = y - iy; fz = z - iz; +u = fade(fx); v = fade(fy); w = fade(fz); +A = p[X] + Y; AA = p[A] + Z; AB = p[A + 1] + Z; +B = p[X + 1] + Y; BA = p[B] + Z; BB = p[B + 1] + Z; +fx1 = fx - 1; fy1 = fy - 1; fz1 = fz - 1; +lerp(lerp(lerp(grad(p[AA],fx,fy,fz), +grad(p[BA],fx1,fy,fz),u), +lerp(grad(p[AB],fx,fy1,fz), +grad(p[BB],fx1,fy1,fz),u),v), +lerp(lerp(grad(p[AA + 1],fx,fy,fz1), +grad(p[BA + 1],fx1,fy,fz1,u), +lerp(grad(p[AB + 1],fx,fy1,fz1), +grad(p[BB+1],fx1,fy1,fz1),u),v),w)" +else +f[$>] "*begin("$init" +grad(hash,x,y) = ( gh = hash&15; gu = gh<8?x:y; gv = gh<4?y:gh==12 || gh==14?x:0; +(!(gh&1)?gu:-gu) + (!(gh&2)?gv:-gv)) +); +x = x0 + x*fw + pcmod255[c]; y = y0 + y*fh + pcmod255[c]; +ix = floor(x); iy = floor(y); +X = ix&255; Y = iy&255; +fx = x - ix; fy = y - iy; +u = fade(fx); v = fade(fy); +A = p[X] + Y; B = p[X + 1] + Y; +fx1 = fx - 1; fy1 = fy - 1; +lerp(lerp(grad(p[A],fx,fy), +grad(p[B],fx1,fy),u), +lerp(grad(p[A + 1],fx,fy1), +grad(p[B + 1],fx1,fy1),u),v)" +fi } +#@cli noise_poissondisk : _radius[%]>0,_max_sample_attempts>0,_p_norm>0 +#@cli : Add poisson disk sampling noise to selected images. +#@cli : Implements the algorithm from the article "Fast Poisson Disk Sampling in Arbitrary Dimensions", +#@cli : by Robert Bridson (SIGGRAPH'2007). +#@cli : Default values: 'radius=8', 'max_sample_attempts=30' and 'p_norm=2'. +#@cli : $ 300,300 noise_poissondisk 8 +noise_poissondisk : check "${1=8}>0 && isint(${2=30}) && $2>0 && ${3=2}>0" +e[^-1] "Add poisson disk sampling points to image$?, with radius $1, max sample attempts $2 and p-norm $3." +R0,K,P=${1-3} +foreach { +W,H,D={w},{h},{d} +value:=iM+(im==iM) +R:=ispercentage($R0)?max(w,h,d)*$R0:$R0 +C:=$R/sqrt(sum([$W,$H,$D]>1)) +_poissondisk[] $R,$P,$C +f. "($W<2 && i0) || ($H<2 && i1) || ($D<2 && i2)?[8,8,8]:I" discard. 8 s. y,3 a[-3--1] x +neighbors={^} rm. +{ceil([$W,$H,$D]/$C)},1,-1 => grid +1,32,1,3 => points +1,32,1,1 => active +eval " +insert_active_point(X) = ( +i(#$grid,int(X/$C)) = new_ind = da_size(#$points); +da_push(#$points,X); +da_push(#$active,new_ind); +I(#0,X) = $value; +); +const eps = 1e-8; +neighbors = ["$neighbors"]; +X = int(u([$W,$H,$D] - eps)); +insert_active_point(X); +while (siz = da_size(#$active), +indX = int(u(siz - eps)); +X = I[#$points,i[#$active,indX]]; +for (k = 0, k<$K, ++k, +U = [ $W>1?v:0, $H>1?v:0, $D>1?v:0 ]; +U*=u($R,2*$R)/(norm(U) + eps); +Y = round(X + U); +min(inrange(Y,0,[$W,$H,$D] - 1))?( +P = int(Y/$C); +i(#$grid,P)<0?( +is_sample_ok = 1; +repeat(size(neighbors)/3,n, +ind = i(#$grid,P + neighbors[3*n,3]); +ind>=0?(nY = I[#$points,ind]; norm"$P"(nY - Y)<=$R?(is_sample_ok = 0; break())); # Invalid point +); +is_sample_ok?(insert_active_point(Y); break()); +); +); +); +k>=$K?da_remove(#$active,indX); # Remove point from active list +); +resize(#$points,1,da_size(#$points),1,3,0)" +k[0] +} ++_poissondisk : +R,P,C=${1-3} +0 eval " +dmin(dx,dy,dz,C) = ( +_dx = dx*C; _dy = dy*C; _dz = dz*C; +norm"$P"(min(abs(_dx),abs(_dx + C),abs(_dx - C)), +min(abs(_dy),abs(_dy + C),abs(_dy - C)), +min(abs(_dz),abs(_dz + C),abs(_dz - C))); +); +for (n = 1, n<4, ++n, +is_none_added = 1; +for (k = -n, k<=n, ++k, +for (j = -n, j<=n, ++j, +for (i = -n, i<=n, ++i, +abs(maxabs(i,j,k))==n && dmin(i,j,k,$C)<$R?(da_push([i,j,k]); is_none_added = 0) +) +) +); +is_none_added?break(); +); +resize(#-1,1,da_size(),1,3,0)" +#@cli normp : p>=0 +#@cli : Compute the pointwise Lp-norm norm of vector-valued pixels in selected images. +#@cli : Default value: 'p=2'. +#@cli : $ image.jpg +normp[0] 0 +normp[0] 1 +normp[0] 2 +normp[0] inf +normp : check "isnum(${1==2}) && $1>=0" +e[^-1] "Compute pointwise L"$1"-norm of vectors, in image$?." +if !$1 != 0 compose_channels + +elif $1==1 abs compose_channels + +elif $1==2 norm +elif $1==inf abs compose_channels max +else ^ $1 compose_channels + ^ {1/$1} +fi +#@cli norm1 +#@cli : Compute the pointwise L1-norm of vector-valued pixels in selected images. +#@cli : $ image.jpg +norm1 +#@cli : $$ +norm1 : +e[^-1] "Compute pointwise L1-norm of vectors, in image$?." +abs compose_channels + +#@cli norm : eq. to 'norm2'. +norm : +_gmic_s="$?" v + _norm2 +#@cli norm2 +#@cli : Compute the pointwise L2-norm (euclidean norm) of vector-valued pixels in selected images. +#@cli : $ image.jpg +norm +#@cli : $$ +norm2 : +_gmic_s="$?" v + _$0 +_norm2 : +e[^-1] "Compute pointwise euclidean norm of vectors, in image"$_gmic_s"." +sqr compose_channels + sqrt +#@cli n : eq. to 'normalize'. : (+) +#@cli normalize : { value0[%] | [image0] },{ value1[%] | [image1] },_constant_case_ratio : [image] : (+) +#@cli : Linearly normalize values of selected images in specified range. +#@cli : (eq. to 'n'). +#@cli : $ image.jpg split x,2 normalize[-1] 64,196 append x +#@cli : $$ +#@cli normalize_l2 +#@cli : Normalize selected images such that they have a unit L2 norm. +normalize_l2 : +e[^-1] "Normalize image$?, s.t they have a unit L2 norm." +repeat $! { /[$>] {norm={$>,in};norm!=0?norm:1} } +#@cli normalize_sum +#@cli : Normalize selected images such that they have a unit sum. +#@cli : $ image.jpg +histogram 256 normalize_sum[-1] display_graph[-1] 400,300 +normalize_sum : +e[^-1] "Normalize image$?, s.t they have a unit sum." +repeat $! { /[$>] {sum={$>,is};sum!=0?sum:1} } +#@cli not +#@cli : Apply boolean not operation on selected images. +#@cli : $ image.jpg +ge 50% +not[-1] +not : +e[^-1] "Apply boolean not operation on image$?." +== 0 +#@cli orientation +#@cli : Compute the pointwise orientation of vector-valued pixels in selected images. +#@cli : $ image.jpg +orientation +norm[-2] negate[-1] mul[-2] [-1] reverse[-2,-1] +#@cli : $$ +orientation : +e[^-1] "Compute pointwise orientation vectors, in image$?." +repeat $! { +norm[$>] replace. 0,1 /[$>,-1] } +#@cli oneminus +#@cli : For each selected image, compute one minus image. +#@cli : $ image.jpg normalize 0,1 +oneminus +oneminus : +e[^-1] "Compute one minus selected images$?." +* -1 + 1 +#@cli otsu : _nb_levels>0 +#@cli : Hard-threshold selected images using Otsu's method. +#@cli : The computed thresholds are returned as a list of values in the status. +#@cli : Default value: 'nb_levels=256'. +#@cli : $ image.jpg luminance +otsu , +otsu : check "isint(${1=256}) && $1>0" +e[^-1] "Hard-threshold image$? using Otsu\47s method, with $1 histogram levels." +foreach { +imM:=[im,iM] +histogram $1,$imM +otsu:=" +sum = sumB = wB = best_variance = best_t = 0; +repeat (w,t,sum+=t*i[t]); +repeat (w,t, +wB+=i[t]; +if (!wB, continue()); +wF = whds#-2 - wB; +if (!wF, break()); +sumB+=t*i[t]; +mB = sumB/wB; +mF = (sum - sumB)/wF; +variance = wB*wF*(mB - mF)^2; +if (variance>best_variance, best_variance = variance; best_t = t); +); +imM = ["$imM"]; +imM[0] + best_t*(imM[1] - imM[0])/(w - 1)" +rm. >=. $otsu +if $> u ${},$otsu else u $otsu fi +} +#@cli polar2complex +#@cli : Compute polar to complex transforms of selected images. +polar2complex : +e[^-1] "Compute polar to complex transforms of image$?." +repeat int($!/2) { +l[{2*$>},{2*$>+1}] { +ri[1] [0],3 +sin. cos.. *. ... *[-3,-2] +} +} +#@cli quantize : nb_levels>=1,_keep_values={ 0 | 1 },_quantization_type={ -1:median-cut | 0:k-means | 1:uniform } +#@cli : Quantize selected images. +#@cli : Default value: 'keep_values=1' and 'quantization_type=0'. +#@cli : $ image.jpg luminance +quantize 3 +#@cli : $ 200,200,1,1,'cos(x/10)*sin(y/10)' +quantize[0] 6 +quantize[0] 4 +quantize[0] 3 +quantize[0] 2 +quantize : check "isint($1) && $1>=1 && isbool(${2=1}) && isint(${3=0}) && $3>=-1 && $3<=1" +e[^-1] "Quantize image$? using $1 levels, "${arg0\ !$2,with,without}" keeping value range." +foreach { +if $3==1 +if s==1 +if $2 mM:=[im,iM] n 0,$1 round 1,-1 min {$1-1} n $mM +else n 0,$1 round 1,-1 min {$1-1} fi +else mM:=[im,iM] uniform_distribution $1,{s} n. $mM index.. .,0,$2 rm. +fi +else +colormap $1,{!$3},1 index.. .,0,$2 rm. +fi +} +#@cli quantize_area : _min_area>0 +#@cli : Quantize selected images such that each flat region has an area greater or equal to 'min_area'. +#@cli : Default value: 'min_area=10'. +#@cli : $ image.jpg quantize 3 +blur 1 round[-1] +quantize_area[-1] 2 +quantize_area : check "${1=10}>0" +e[^-1] "Quantize image$? by regions of areas greater than $1." +if $1==1 return fi +foreach { +if s>1 +f. "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm. round. 0.01 else [0] fi +area. 0,0 <. $1 +do +[0] +f.. "* +begin( +const boundary = 1; +offx = [ -1,1,0,0,0,0 ]; +offy = [ 0,0,-1,1,0,0 ]; +offz = [ 0,0,0,0,-1,1 ]; +nb_offs = d>1?6:h>1?4:2; +); +is_neighbor = j(-1) && j(-1); +if (h>1, is_neighbor&=j(1,0) && j(0,1)); +if (d>1, is_neighbor&=j(0,0,-1) && j(0,0,1)); +is_neighbor = !is_neighbor; +i && is_neighbor?( +col0 = I(#0); +kmin = -1; +distmin = inf; +repeat (nb_offs,k, +p = offx[k]; +q = offy[k]; +r = offz[k]; +if (!j(p,q,r), +col = J(#0,p,q,r); +dist = norm(col-=col0); +if (dist=0, +I(#-1) = J(#0,offx[kmin],offy[kmin],offz[kmin]); +0, +1 +); +):i" +rv[0,-1] rm. +while iM +rm. +} +#@cli rand : { value0[%] | [image0] },_{ value1[%] | [image1] } : [image] : (+) +#@cli : Fill selected images with random values uniformly distributed in the specified range. +#@cli : $ 400,400,1,3 rand -10,10 +blur 10 sign[-1] +#@cli rand_sum : sum>0,_random_function +#@cli : Fill selected images with strictly positive, random, integer values, that sums to 'sum'. +#@cli : For each image, 'sum' must be greater or equal than 'width*height*depth*spectrum'. +#@cli : Default value: 'random_function=u'. +#@cli : $ 100 rand_sum 1000 +rand_sum : check "isint($1) && isexpr(${3=u})" +e[^-1] "Fill image$? with strictly positive, random, integer values that sums to $1, with random function '$3'." +foreach { +if whds>$1 +error[0--4] "Command 'rand_sum': Image ["$>"] = ("{[w,h,d,s]}") has "{whds}" elements (should be <=$1)." +fi +f. "abs($3)" *. {($1-whds)/is} round. +. 1 +eval " +sum = is; +while (sum!=$1, +off = int(u(whds))%whds; +val = i[off]; +delta = $1 - sum; +absdeltap1 = abs(delta) + 1; +dval = sign(delta)*(int(u(1,absdeltap1))%absdeltap1); +val + dval>0?(i[off]+=dval; sum+=dval); +)" +} +#@cli replace : source,target +#@cli : Replace pixel values in selected images. +#@cli : $ (1;2;3;4) +replace 2,3 +replace : +e[^-1] "Replace pixel values $1 with $2 in image$?." +f "i==$1?($2):i" +#@cli replace_inf : _expression +#@cli : Replace all infinite values in selected images by specified expression. +#@cli : $ (0;1;2) log +replace_inf 2 +replace_inf : +e[^-1] "Replace all infinite values in image$? by expression '$1'." +f "isinf(i)?($1):i" +#@cli replace_infnan : _expression +#@cli : Replace all NaN and infinite values in selected images by specified expression. +replace_infnan : +e[^-1] "Replace all +-inf and NaN values in images$? by expression '$1'." +f "isinf(i) || isnan(i)?($1):i" +#@cli replace_nan : _expression +#@cli : Replace all NaN values in selected images by specified expression. +#@cli : $ (-1;0;2) sqrt +replace_nan 2 +replace_nan : +e[^-1] "Replace all NaN values in images$? by expression '$1'." +f "isnan(i)?($1):i" +#@cli replace_seq : "search_seq","replace_seq" +#@cli : Search and replace a sequence of values in selected images. +#@cli : $ (1;2;3;4;5) +replace_seq "2,3,4","7,8" +replace_seq : skip "${2=''}" +e[^-1] "Replace value sequence '$1' by value sequence '${2--1}' in image$?." +y foreach { +nm={n} +1,100% +eval "ref([ $1 ],str1); +ref([ ${2--1} ],str2); +copy_block(pd,src,len) = ( +l = len; +pd + l>=h#1?resize(#1,1,h(#1) + 3*l,1,1,0); +copy(i[pd],src,l); +pd+=l; +); +for (ps = pd = 0, ps=0, +qs>ps?copy_block(pd,i[#0,ps],qs - ps); +copy_block(pd,str2,size(str2)); +ps = qs + size(str1); +); +ps $nm +} +#@cli replace_str : "search_str","replace_str" +#@cli : Search and replace a string in selected images (viewed as strings, i.e. sequences of character codes). +#@cli : $ ('"Hello there, how are you ?"') +replace_str "Hello there","Hi David" +replace_str : skip "${2=}" +e[^-1] "Replace string '"{/"$1"}"' by string '"{/"${2--1}"}"' in image$?." +replace_seq {``{'"$1"'}},{'"${2--1}"'} +#@cli round : rounding_value>=0,_rounding_type : (no arg) : (+) +#@cli : Round values of selected images. +#@cli : 'rounding_type' can be { -1:backward | 0:nearest | 1:forward }. +#@cli : Default value: 'rounding_type=0'. +#@cli : $ image.jpg +round 100 +#@cli : $ image.jpg mul {pi/180} sin +round +#@cli roundify : gamma>=0 +#@cli : Apply roundify transformation on float-valued data, with specified gamma. +#@cli : Default value: 'gamma=0'. +#@cli : $ 1000 fill '4*x/w' repeat 5 { +roundify[0] {$>*0.2} } append c display_graph 400,300 +roundify : check $1>=0 +e[^-1] "Roundify image$?, with gamma $1." +if $1==1 return fi +foreach { +round 1 -.. . +*.. 2 abs. ^. $1 sign... *[-3,-1] *.. 0.5 + } +#@cli = : eq. to 'set'. : (+) +#@cli set : value,_x[%],_y[%],_z[%],_c[%] : (+) +#@cli : Set pixel value in selected images, at specified coordinates. +#@cli : (eq. to '=').\n +#@cli : If specified coordinates are outside the image bounds, no action is performed. +#@cli : Default values: 'x=y=z=c=0'. +#@cli : $ 2,2 set 1,0,0 set 2,1,0 set 3,0,1 set 4,1,1 +#@cli : $ image.jpg repeat 10000 { set 255,{u(100)}%,{u(100)}%,0,{u(100)}% } +#@cli threshold : value[%],_is_soft={ 0 | 1 } : +#@cli : Threshold values of selected images. +#@cli : 'soft' can be { 0:hard-thresholding | 1:soft-thresholding }. +#@cli : Default value: 'is_soft=0'. +#@cli : $ image.jpg +threshold[0] 50% +threshold[0] 50%,1 +#@cli : $$ +threshold : check "isexpr($1) && isbool(${2=0})" +e[^-1] ${"arg0 !$2,Soft,Hard"}"-threshold image$? by $1." +if $2 +f "begin( +str = ['$1']; +value = str[size(str)-1]==_'%'?im + (iM-im)*$1:$1 +); +i>=value?i - value: +i<=-value?i + value:0" +else ge $1 +fi +#@cli vector2tensor +#@cli : Convert selected vector fields to corresponding tensor fields. +vector2tensor : +e[^-1] "Convert vector field$? to tensor field$?." +foreach { +s c +if $!==2 +sqr. *.. ... sqr... +elif $!==3 +sqr.. +*... .. +sqr... *[-5,-4] [-6] sqr[-6] +else error[0--4] "Command '$0': Invalid image ["{$!-$>-1}"] : Dimensions "{w}","{h}","{d}","{s}" does not +represent a field of 2D or 3D vectors." +fi +a c +} +#@cli :: Colors +#@cli adjust_colors : -100<=_brightness<=100,-100<=_contrast<=100,-100<=_gamma<=100,-100<=_hue_shift<=100,-100<=_saturation<=100,_value_min,_value_max +#@cli : Perform a global adjustment of colors on selected images. +#@cli : Range of correct image values are considered to be in [value_min,value_max] (e.g. [0,255]). +#@cli : If 'value_min==value_max==0', value range is estimated from min/max values of selected images. +#@cli : Processed images have pixel values constrained in [value_min,value_max]. +#@cli : Default values: 'brightness=0', 'contrast=0', 'gamma=0', 'hue_shift=0', 'saturation=0', 'value_min=value_max=0'. +#@cli : $ image.jpg +adjust_colors 0,30,0,0,30 +adjust_colors : check "${1=0}>=-100 && $1<=100 && ${2=0}>=-100 && $2<=100 && ${3=0}>=-100 && $3<=100 && +${4=0}>=-100 && $4<=100 && ${5=0}>=-100 && $5<=100" skip ${6=0},${7=0} +e[^-1] "Adjust colors of image$?, with brightness $1, contrast $2, gamma $3, hue shift $4, saturation $5 and +value range [$6,$7]." +foreach { split_opacity l[0] { +range:="$6==$7 && !$6?[im,iM]:[min($6,$7),max($6,$7)]" +m:=arg(1,$range) M:=arg(2,$range) fact:=255/max(1e-5,$M-$m) +- $m * $fact +if $4" || "$5 +to_rgb[0] rgb2hsv[0] +sh[0] 0 +. {$4*1.8} rm. +sh[0] 1 +. {($5%)^(1+($5>0))} c. 0,1 rm. +hsv2rgb[0] +fi +if $3 +/[0] 255 ^[0] {10^-($3%)} *[0] 255 +fi +if $2 +-[0] 128 *[0] {exp($2/64)} +[0] 128 +fi ++[0] {$1*2} +/[0] $fact +[0] $m c[0] $range +a c +} a c } +#@cli ac : eq. to 'apply_channels'. +ac : +_gmic_s="$?" v + _apply_channels $"*" +#@cli apply_channels : "command",color_channels,_value_action={ 0:none | 1:cut | 2:normalize } +#@cli : Apply specified command on the chosen color channel(s) of each selected images. +#@cli : (eq. to 'ac').\n +#@cli : Argument 'color_channels' refers to a colorspace, and can be basically one of +#@cli : { all | rgba | [s]rgb | ryb | lrgb | ycbcr | lab | lch | hsv | hsi | hsl | cmy | cmyk | yiq }. +#@cli : You can also make the processing focus on a few particular channels of this colorspace, +#@cli : by setting 'color_channels' as 'colorspace_channel' (e.g. 'hsv_h' for the hue). +#@cli : All channel values are considered to be provided in the [0,255] range. +#@cli : Default value: 'value_action=0'. +#@cli : $ image.jpg +apply_channels "equalize blur 2",ycbcr_cbcr +apply_channels : +_gmic_s="$?" v + _$0 $"*" +_apply_channels : check "isint(${3=0}) && $3>=0 && $3<=2" +channels=${"_ac_list \"$2\""} +e[^-1] "Apply command '$1' on channels '"$channels"' of image"$_gmic_s"." +('$/') id:="h=0;for(k=0,k0,0<=_dithering<=1,_method={ 0:median-cut | 1:k-means } +#@cli : Index selected vector-valued images by adapted colormaps. +#@cli : Default values: 'dithering=0' and 'method=1'. +#@cli : $ image.jpg +autoindex[0] 4 +autoindex[0] 8 +autoindex[0] 16 +autoindex : check "isint($1) && $1>0 && ${2=0}>=0" skip ${3=1} +e[^-1] "Index colors in images$? by adapted colormap with $1 entries, dithering level $2 and "${arg0\ !$3,k-means,median-cut}" method." +foreach { +if w>h if w>256 +r2dx 256 else [0] fi +else if h>256 +r2dy 256 else [0] fi +fi +colormap[1] $1,$3,0 +index[0] [1],$2,1 rm[1] +} +#@cli bayer2rgb : _GM_smoothness,_RB_smoothness1,_RB_smoothness2 +#@cli : Transform selected RGB-Bayer sampled images to color images. +#@cli : Default values: 'GM_smoothness=RB_smoothness=1' and 'RB_smoothness2=0.5'. +#@cli : $ image.jpg rgb2bayer 0 +bayer2rgb 1,1,0.5 +bayer2rgb : skip ${1=1},${2=1},${3=0.5} +e[^-1] "Transform RGB-Bayer image$? to color images, with smoothness ($1,$2,$3)." +channels 0 +foreach { +expand_x {"2 + 4*$1"},0 expand_y {"2 + 4*$1"},0 +(-1,1;1,-1) r. ..,..,1,1,0,2 ++*.. . +(0.25,0.5,0.25) convolve.. . transpose. convolve.. . rm. +b. $1 +*.. . +-[-3,-2] +(1,-1) r. ..,..,1,1,0,2 +*. ... +(0.25,0.5,0.25) convolve.. . transpose. convolve.. . rm. +blur_y. $2 blur_x. $3 +(1;-1) r. ..,..,1,1,0,2 +*. [-4] +(0.25,0.5,0.25) convolve.. . transpose. convolve.. . rm. +blur_x. $2 blur_y. $3 ++[-2,-1] /. 2 +(2,0;0,-2) r. ..,..,1,1,0,2 +*. .. +-[-4,-1] +a[-3--1] c +mix_rgb. 1,-1,2,1,1,0,1,-1,-2 +shrink_x {"2 + 4*$1"},0 shrink_y {"2 + 4*$1"},0 +c 0,255 +} +#@cli clut : "clut_name",_resolution>0,_cut_and_round={ 0:no | 1:yes } +#@cli : Insert one of the 1105 pre-defined CLUTs at the end of the image list.\n +#@cli : 'clut_name' can be { 12_years_a_slave | 1917 | 2-strip-process | 60s | 60s_faded | 60s_faded_alt | 7drk_21 | action_magenta_01 | action_red_01 | ad_astra | adventure_1453 | agfa_apx_100 | agfa_apx_25 | agfa_precisa_100 | agfa_ultra_color_100 | agfa_vista_200 | agressive_highligjtes_recovery_5 | aladdin | alberto_street | alien_green | ampio | amstragram | amstragram+ | analog_film_1 | 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 | anime | ant-man | apocalypse_this_very_moment | aqua | aqua_and_orange_dark | aquaman | arabica_12 | asistas | atomic_pink | atusa | autumn | ava_614 | avalanche | avengers_endgame | azrael_93 | baby_driver | bad_boys_for_life | basuco | bboyz_2 | bc_darkum | beach_aqua_orange | beach_faded_analog | beati | beauty_and_the_beast | berlin_sky | bisogno | black_and_white | black_panther | black_star | black_white_01 | black_white_02 | black_white_03 | black_white_04 | black_white_05 | black_white_06 | blade_runner | bleach_bypass | bleachbypass_1 | bleachbypass_2 | bleachbypass_3 | bleachbypass_4 | bleech_bypass_green | bleech_bypass_yellow_01 | blue_cold_fade | blue_dark | blue_house | blue_ice | blue_mono | blue_shadows_01 | bluearchitecture | bluehour | blues | bob_ford | bohemian_rhapsody | bombshell | bourbon_64 | boyado | bright_green_01 | bright_teal_orange | bright_warm | brightgreen | brown_mobster | brownbm | brownish | bw_1 | bw_10 | bw_2 | bw_3 | bw_4 | bw_5 | bw_6 | bw_7 | bw_8 | bw_9 | bw_but_yellow | byers_11 | calidum | candlelight | captain_marvel | caribe | chemical_168 | chrome_01 | cineblue | cinebm_4k | cinema | cinema_2 | cinema_3 | cinema_4 | cinema_5 | cinema_noir | cinematic-1 | cinematic-10 | cinematic-2 | cinematic-3 | cinematic-4 | cinematic-5 | cinematic-6 | cinematic-7 | cinematic-8 | cinematic-9 | cinematic_01 | cinematic_02 | cinematic_03 | cinematic_for_flog | cinematic_forest | cinematic_lady_bird | cinematic_mexico | city | city_7 | city_dust | city_of_god | classic_films_01 | classic_films_02 | classic_films_03 | classic_films_04 | classic_films_05 | classic_teal_and_orange | clayton_33 | clear_teal_fade | clouseau_54 | cobi_3 | coffee_44 | cold_clear_blue | cold_clear_blue_1 | cold_ice | cold_simplicity_2 | coldchrome | color_rich | colore | colorful_0209 | colornegative | conflict_01 | contrail_35 | contrast_with_highlights_protection | contrasty_afternoon | contrasty_green | convold | cosa | creed_2 | crispautumn | crispromance | crispwarm | crispwinter | cross_process_cp_130 | cross_process_cp_14 | cross_process_cp_15 | cross_process_cp_16 | cross_process_cp_18 | cross_process_cp_3 | cross_process_cp_4 | cross_process_cp_6 | crushin | cubicle_99 | culor | d_o_1 | dark_blues_in_sunlight | dark_green_02 | dark_green_1 | dark_man_x | dark_orange_teal | dark_place_01 | darkandsomber | darkness | date_39 | day_4nite | day_for_night | day_to_night_kings_blue | deep | deep_blue | deep_dark_warm | deep_high_contrast | deep_teal_fade | deep_warm_fade | deepskintones_2 | deepskintones_3 | delicatessen | denoiser_simple_40 | desert_gold_37 | dimension | dimmer | directions_23 | django_25 | doctor_strange | domingo_145 | dream_1 | dream_85 | drop_green_tint_14 | dropblues | dunkirk | duotone_blue_red | earth_tone_boost | edgyember | elegance_38 | enchanted | ensaya | eterna_for_flog | expired_69 | expired_fade | expired_polaroid | extreme | fade | fade_to_green | faded | faded_47 | faded_alt | faded_analog | faded_extreme | faded_green | faded_pink-ish | faded_print | faded_retro_01 | faded_retro_02 | faded_vivid | fadedlook | fallcolors | falua | farkling | fatos | faux_infrared | faux_infrared_bw_1 | faux_infrared_color_p_2 | faux_infrared_color_p_3 | faux_infrared_color_r_0a | faux_infrared_color_r_0b | faux_infrared_color_yp_1 | fezzle | fgcinebasic | fgcinebright | fgcinecold | fgcinedrama | fgcinetealorange_1 | fgcinetealorange_2 | fgcinevibrant | fgcinewarm | fight_club | film_0987 | film_9879 | film_gb-19 | film_high_contrast | film_print_01 | film_print_02 | filmic | filo | flat_30 | flat_blue_moon | flavin | foggynight | folger_50 | ford_v_ferrari | foresta | formula_b | french_comedy | frosted | frostedbeachpicnic | fuji_160c | fuji_160c_+ | fuji_160c_++ | fuji_160c_- | fuji_3510_constlclip | fuji_3510_constlmap | fuji_3510_cuspclip | fuji_3513_constlclip | fuji_3513_constlmap | fuji_3513_cuspclip | fuji_400h | fuji_400h_+ | fuji_400h_++ | fuji_400h_- | fuji_800z | fuji_800z_+ | fuji_800z_++ | fuji_800z_- | fuji_astia_100_generic | 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_alt | 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_hdr | fuji_neopan_1600 | fuji_neopan_1600_+ | fuji_neopan_1600_++ | fuji_neopan_1600_- | fuji_neopan_acros_100 | fuji_provia_100_generic | 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_100_generic | fuji_velvia_50 | fuji_xtrans_iii_acros | fuji_xtrans_iii_acros+g | fuji_xtrans_iii_acros+r | fuji_xtrans_iii_acros+ye | fuji_xtrans_iii_astia | fuji_xtrans_iii_classic_chrome | fuji_xtrans_iii_mono | fuji_xtrans_iii_mono+g | fuji_xtrans_iii_mono+r | fuji_xtrans_iii_mono+ye | fuji_xtrans_iii_pro_neg_hi | fuji_xtrans_iii_pro_neg_std | fuji_xtrans_iii_provia | fuji_xtrans_iii_sepia | fuji_xtrans_iii_velvia | fusion_88 | futuristicbleak_1 | futuristicbleak_2 | futuristicbleak_3 | futuristicbleak_4 | going_for_a_walk | golden | golden_bright | golden_fade | golden_mono | golden_night_softner_43 | golden_sony_37 | golden_vibrant | goldengate | goldentime | 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 | good_morning | green_15 | green_2025 | green_action | green_afternoon | green_and_orange | green_blues | green_book | green_conflict | green_day_01 | green_day_02 | green_g_09 | green_indoor | green_light | green_mono | green_yellow | greenish_contrasty | greenish_fade | greenish_fade_1 | gremerta | greyhound | hackmanite | hallowen_dark | happyness_133 | hard_teal_orange | hardboost | harsh_day | harsh_sunset | helios | herderite | heulandite | hiddenite | highlights_protection | hilutite | hitman | hlg_1_1 | honey_light | hong_kong | horrorblue | howlite | huesio | husmes | huyan | hydracore | hyla_68 | hypersthene | hypnosis | hypressen | i_tonya | ideo | ilford_delta_100 | ilford_delta_3200 | ilford_delta_3200_+ | ilford_delta_3200_++ | ilford_delta_3200_- | ilford_delta_400 | ilford_fp_4_plus_125 | ilford_hp_5 | ilford_hp_5_+ | ilford_hp_5_++ | ilford_hp_5_- | ilford_hp_5_plus_400 | ilford_hps_800 | ilford_pan_f_plus_50 | ilford_xp_2 | inception | indoor_blue | industrial_33 | infrared_-_dust_pink | instantc | jarklin | jojo_rabbit | joker | jumanji_the_next_level | jurassic_world_fallen_kingdom | justice_league | justpeachy | jwick_21 | k_tone_vintage_kodachrome | kh_1 | kh_10 | kh_2 | kh_3 | kh_4 | kh_5 | kh_6 | kh_7 | kh_8 | kh_9 | killstreak | kingsman_the_golden_circle | knives_out | kodak_2383_constlclip | kodak_2383_constlmap | kodak_2383_cuspclip | kodak_2393_constlclip | kodak_2393_constlmap | kodak_2393_cuspclip | kodak_bw_400_cn | kodak_e-100_gx_ektachrome_100 | kodak_ektachrome_100_vs | kodak_ektachrome_100_vs_generic | kodak_ektar_100 | 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_kodachrome_64_generic | 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_portra_800_hc | 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_tmax_3200_alt | kodak_tri-x_400 | kodak_tri-x_400_+ | kodak_tri-x_400_++ | kodak_tri-x_400_- | kodak_tri-x_400_alt | korben_214 | la_la_land | landscape_01 | landscape_02 | landscape_03 | landscape_04 | landscape_05 | landscape_1 | landscape_10 | landscape_2 | landscape_3 | landscape_4 | landscape_5 | landscape_6 | landscape_7 | landscape_8 | landscape_9 | lateafternoonwanderlust | latesunset | lavark | lc_1 | lc_10 | lc_2 | lc_3 | lc_4 | lc_5 | lc_6 | lc_7 | lc_8 | lc_9 | lenox_340 | levex | life_giving_tree | light_blown | litore | little_women | logan | lomo | lomography_redscale_100 | lomography_x-pro_slide_200 | london_nights | longbeachmorning | loro | lotta | louetta | low_contrast_blue | low_key_01 | lucky_64 | lushgreen | lushgreensummer | mad_max_fury_road | maesky | magenta_day | magenta_day_01 | magenta_dream | magenta_yellow | magentacoffee | magichour | marriage_story | matrix | mckinnon_75 | memories | mercato | metropolis | milo_5 | minimalistcaffeination | modern_film | modern_films_01 | modern_films_02 | modern_films_03 | modern_films_04 | modern_films_05 | modern_films_06 | modern_films_07 | molti | mono_tinted | monochrome | monochrome_1 | monochrome_2 | moody_1 | moody_10 | moody_2 | moody_3 | moody_4 | moody_5 | moody_6 | moody_7 | moody_8 | moody_9 | moonlight | moonlight_01 | moonlight_2 | moonrise | morning_6 | morroco_16 | mostly_blue | mother! | motus | moviz_1 | moviz_10 | moviz_11 | moviz_12 | moviz_13 | moviz_14 | moviz_15 | moviz_16 | moviz_17 | moviz_18 | moviz_19 | moviz_2 | moviz_20 | moviz_21 | moviz_22 | moviz_23 | moviz_24 | moviz_25 | moviz_26 | moviz_27 | moviz_28 | moviz_29 | moviz_3 | moviz_30 | moviz_31 | moviz_32 | moviz_33 | moviz_34 | moviz_35 | moviz_36 | moviz_37 | moviz_38 | moviz_39 | moviz_4 | moviz_40 | moviz_41 | moviz_42 | moviz_43 | moviz_44 | moviz_45 | moviz_46 | moviz_47 | moviz_48 | moviz_5 | moviz_6 | moviz_7 | moviz_8 | moviz_9 | mucca | mute_shift | muted_01 | muted_fade | mysticpurplesunset | nah | natural_vivid | naturalboost | nemesis | neon_770 | neutral_pump | neutral_teal_orange | neutral_warm_fade | newspaper | night_01 | night_blade_4 | night_king_141 | night_spy | nightfromday | nightlife | nigrum | no_time_to_die | nostalgiahoney | nostalgic | nw-1 | nw-10 | nw-2 | nw-3 | nw-4 | nw-5 | nw-6 | nw-7 | nw-8 | nw-9 | old_west | once_upon_a_time | once_upon_a_time_in_hollywood | onda | only_red | only_red_and_blue | operation_yellow | orange_dark_4 | orange_dark_7 | orange_dark_look | orange_tone | orange_underexposed | orangeandblue | oranges | padre | paladin | paladin_1875 | parasite | partia | pasadena_21 | passing_by | perso | picola | pink_fade | pirates_of_the_caribbean | pitaya_15 | pmcinematic_01 | pmcinematic_02 | pmcinematic_03 | pmcinematic_04 | pmcinematic_05 | pmcinematic_06 | pmcinematic_07 | pmnight_01 | pmnight_02 | pmnight_03 | pmnight_04 | pmnight_05 | 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_--- | portrait_1 | portrait_10 | portrait_2 | portrait_3 | portrait_4 | portrait_5 | portrait_6 | portrait_7 | portrait_8 | portrait_9 | progressen | protect_highlights_01 | prussian_blue | pseudogrey | purple | purple_2 | randas | red_afternoon_01 | red_day_01 | red_dream_01 | redblueyellow | reds | reds_oranges_yellows | reeve_38 | remy_24 | rest_33 | retro | retro_brown_01 | retro_magenta_01 | retro_summer_3 | retro_yellow_01 | rocketman | rollei_ir_400 | rollei_ortho_25 | rollei_retro_100_tonal | rollei_retro_80s | rotate_muted | rotate_vibrant | rotated | rotated_crush | satid | saturated_blue | saving_private_damon | scala | science_fiction | scrittle | sea | seges | selor | sensum | separation | serenity | seringe_4 | serpent | seventies_magazine | sevsuz | shade_kings_ink | shadow_king_39 | shine | sicario | sino | skin_tones | smart_contrast | smokey | smooth_clear | smooth_cromeish | smooth_fade | smooth_green_orange | smooth_sailing | smooth_teal_orange | soft_fade | softblackandwhite | softwarming | solarized_color | solarized_color_2 | soldi | spider-man_far_from_home | spotlight | springmorning | sprocket_231 | spy_29 | star_wars_the_rise_of_skywalker | strano | street | stringa | studio_skin_tone_shaper | subtle_blue | subtle_green | subtle_yellow | sully | summer | summer_alt | sunlightlove | sunny | sunny_alt | sunny_rich | sunny_warm | sunset_aqua_orange | sunset_intense_violet_blue | sunset_violet_mood | super_warm | super_warm_rich | sutro_fx | sweet_bubblegum | sweet_gelatto | taiga | tarraco | teal_fade | teal_moonlight | tealmagentagold | tealorange | tealorange_1 | tealorange_2 | tealorange_3 | technicalfx_backlight_filter | teigen_28 | tenet | tensiongreen_1 | tensiongreen_2 | tensiongreen_3 | tensiongreen_4 | terra_4 | the_dark_knight | the_darkest_hour | the_gentelmen | the_grand_budapest_hotel | the_hurt_locker | the_irishman | the_lighthouse | the_lobster | the_martian | the_matrices | the_revenant | the_shape_of_water | the_social_network | the_two_popes | the_way_back | thor_ragnarok | thriller_2 | tirare | toastedgarden | top_gun_maverick | trent_18 | true_colors_8 | turkiest_42 | tutto | tweed_71 | ultra_water | uncut_gems | undeniable | undeniable_2 | underwater | unknown | upglow | urban_01 | urban_02 | urban_03 | urban_04 | urban_05 | urban_cowboy | uzbek_bukhara | uzbek_marriage | uzbek_samarcande | valize | valsky | velvetia | venom | very_warm_greenish | vfb_21 | vibrant | vibrant_alien | vibrant_contrast | vibrant_cromeish | victory | vintage | vintage_01 | vintage_02 | vintage_03 | vintage_04 | vintage_05 | vintage_163 | vintage_alt | vintage_brighter | vintage_chrome | vintage_mob | vintage_warmth_1 | violet_taste | vireo_37 | vita | vubes | war_for_the_planet_of_the_apes | warm | warm_dark_contrasty | warm_fade | warm_fade_1 | warm_highlight | warm_neutral | warm_sunset_red | warm_teal | warm_vintage | warm_yellow | wavefire | waves | well_see | western | westernlut_2 | whiter_whites | winterlighthouse | wipe | wolf_of_wall_street | wonder_woman | wooden_gold_20 | x-men_dark_phoenix | yellow_55b | yellow_film_01 | yellowstone | you_can_do_it | zed_32 | zeke_39 | zilverfx_bw_solarization | zilverfx_infrared | zilverfx_vintage_bw | zombieland_double_tap } +#@cli : Default values: 'resolution=33' and 'cut_and_round=1'. +#@cli : $ clut summer clut alien_green,17 clut orange_dark4,48 ++clut : check "isnum(${2=33}) && $2>0 && isbool(${3=1})" +strclut "$1" name=${} l[] { +e[^-1] "Input CLUT '"$name"' with resolution $2." +path_clut=${-path_cache} +if isfile(['{/${path_clut}clut_$name.cimgz}']) i ${path_clut}clut_$name.cimgz fi +if $!"!=1 || w<$2 || h<$2 || d<$2" +rm input_cached gmic_cluts.gmz k[${"nmd 1,"$name}] +if $!!=1 +rm i https://gmic.eu/gmic_cluts.gmz o ${path_clut}gmic_cluts.gmz +repeat $! { if ['{$>,n}']==['$name'] k[$>] break fi } +if $!!=1 +error[0--5] "Command '$0': Unknown CLUT name '"$name"'." +fi +fi +decompress_clut $2,$2,$2 +if $3 round c 0,255 to_rgb fi +o. ${path_clut}clut_$name.cimgz +elif "w>$2 || h>$2 || d>$2" r $2,$2,$2,3,2 +fi +k. => $name +} +#@cli cmy2rgb +#@cli : Convert color representation of selected images from CMY to RGB. +cmy2rgb : +e[^-1] "Convert color representation of image$? from CMY to RGB." +rgb2cmy +#@cli cmyk2rgb +#@cli : Convert color representation of selected images from CMYK to RGB. +cmyk2rgb : +e[^-1] "Convert color representation of image$? from CMYK to RGB." +foreach { +s c +/. -255 +. 1 *[0-2] . rm. +[0-2] . rm. +a c cmy2rgb +} +#@cli colorblind : type={ 0:protanopia | 1:protanomaly | 2:deuteranopia | 3:deuteranomaly | 4:tritanopia | 5:tritanomaly | 6:achromatopsia | 7:achromatomaly } +#@cli : Simulate color blindness vision. +#@cli : Simulation method of Vienot, Brettel & Mollon 1999, "Digital video colourmaps for checking the legibility of displays by dichromats". +#@cli : The dichromacy matrices of the paper were adapted to sRGB (RGB->XYZ). +#@cli : Anomalous trichromacy simulated via linear interpolation with the identity and a factor of 0.6. +#@cli : $ image.jpg +colorblind 0 +colorblind : check "isint($1) && $1>=0 && $1<=7" +s0="protanopia" s1="protanomaly" s2="deuteranopia" s3="deuteranomaly" s4="tritanopia" +s5="tritanomaly" s6="achromatopsia" s7="achromatomaly" +e[^-1] "Simulate color blindness of type '"${s$1}"' on image$?." +type0=(0.10889,0.89111,0;0.10889,0.89111,0;0.00447,-0.00447,1.0) +type1=(0.46533,0.53467,0;0.06533,0.93467,0;0.00268,-0.00268,1) +type2=(0.29031,0.70969,0;0.29031,0.70969,0;-0.02197,0.02197,1) +type3=(0.57418,0.42582,0;0.17418,0.82582,0;-0.01318,0.01318,1) +type4=(1,0.15236,-0.15236;0,0.86717,0.13283;0,0.86717,0.13283) +type5=(1,0.09142,-0.09142;0,0.92030,0.07970;0,0.52030,0.47970) +type6=(0.299,0.587,0.114;0.299,0.587,0.114;0.299,0.587,0.114) +type7=(0.618,0.320,0.062;0.163,0.775,0.062;0.163,0.320,0.516) +foreach { split_opacity l[0] { to_rgb srgb2rgb mix_channels ${type$1} rgb2srgb } a c } +#@cli colormap : nb_levels>=0,_method={ 0:median-cut | 1:k-means },_sort_vectors +#@cli : Estimate best-fitting colormap with 'nb_colors' entries, to index selected images. +#@cli : Set 'nb_levels==0' to extract all existing colors of an image. +#@cli : 'sort_vectors' can be { 0:unsorted | 1:by increasing norm | 2:by decreasing occurrence }. +#@cli : Default value: 'method=1' and 'sort_vectors=1'. +#@cli : $ image.jpg +colormap[0] 4 +colormap[0] 8 +colormap[0] 16 +#@cli : $$ https://gmic.eu/oldtutorial/_colormap +colormap : check "isint($1) && $1>=0" skip ${2=1},${3=1} +if $1 e[0--3] "Estimate colormap with $1 entries for image$?, by "${arg0\ !$2,k-means,median-cut}" method." +else e[0--3] "Estimate full colormap for image$?." +fi +foreach { +nm={b} is_half=${-is_half} +if $1 +r {whd},1,1,100%,-1 ++_colormap $1 +if $2 +max_diff:=(iM-im+1)/8192 +do ++index.. . +if $is_half +..,1,1,{1,s} +eval " +csum = vector(#w*s#0); +cocc = vector(#w,0); +repeat (w#2,k, +ind = i[#2,k]; +repeat (s#0,c,csum[ind + c*w]+=i(#0,k,0,0,c)); +++cocc[ind]; +); +off = 0; +repeat (s#0,c, +repeat (w,k,occ = cocc[k]; occ?(csum[off++]/=occ)); +); +draw(#3,csum)" +rm.. +else +..,1,1,{1,s+1} +f.. ">I[#3,i]+=[ I[#0,x],1 ]" rm.. +f. "s = i(x,0,0,s-1); s?I/s:[ I[#1,x], 0 ]" +fi ++-.. . abs. diff:=iM/w rm. +j.. . rm. +while $diff>$max_diff +fi +if $3 index.. .,0,0 histogram.. {[w,0,w-1]} a y sort -,x rows 1 +else rm.. +fi +else ++n. 0,255 f. "ret = vectors(); H = 0; repeat (s,p,(H*=31)+=j(0,0,0,p)); ret[0] = H%2048; ret" +channels. 0 equalize. 2048 n. 0,2047 round. 1 +0x2048 +eval[0] "> +begin(sizes = vector2048(); ret = vectors()); +col_s = I; +H = i#1; indH = H + 2; +sH = sizes[H]; +!sH || find(#indH,col_s,s#0*(sH - 1),-s#0)<0?( # Color not found +sH>=h(#indH)?resize(#indH,s#0,max(8,2*h#indH),1,1,0); +copy(i(#indH,0,sH,0,0),col_s); +++sizes[H]; +); +ret; +end(fill(sizes,k,resize(#k + 2,s#0,sizes[k],1,1,0)))" +a[2--1] y permute. yzcx k. +fi +if $3==1 +norm rv a c sort +,x channels 1,100% fi +=> "[colormap of "$nm"]" +} +_colormap : +m "__colormap : repeat s { sh[$""1] $> =.. {iM-im},$""1,0,0,$> rm. }" +1,1,1,{s} __colormap 0 +repeat $1-1 { +b,a:=xM,cM +l[$b] { shift 0,0,0,-$a,2 sort +,x shift 0,0,0,$a,2 xm:=int(w/2) } +if {$b,w>1} +z[$b] $xm,100% z[$b] 0,{$xm-1} else 1,1,1,{$b,s} fi +rv[-2,-1] r. {w+1},1,1,100%,0 +__colormap $b __colormap {$!-2} +} +rm. r 1,1,1,100%,2 a x +um __colormap +#@cli compose_channels +#@cli : Compose all channels of each selected image, using specified arithmetic operator (+,-,or,min,...). +#@cli : Default value: '1=+'. +#@cli : $ image.jpg +compose_channels and +#@cli : $$ +compose_channels : skip ${1="+"} +e[^-1] "Compose all channels of image$?, with operator '$1'." +foreach { +repeat s { sh[0] $> } +$1[^0] r[0] 100%,100%,100%,1,-1 k[0] +} +#@cli deltaE : [image],_metric={ 0:deltaE_1976 | 1:deltaE_2000 },"_to_Lab_command" +#@cli : Compute the CIE DeltaE color difference between selected images and specified [image]. +#@cli : Argument 'to_Lab_command' is a command able to convert colors of [image] into a Lab representation. +#@cli : Default values: 'metric=1' and 'to_Lab_command="srgb2lab"'. +#@cli : $ image.jpg +blur 2 +deltaE[0] [1],1,srgb2lab +deltaE : check ${"is_image_arg $1"}" && isbool(${2=1})" skip "${3=srgb2lab}" +e[^-1] "Compute the CIE DeltaE_"${"s0,s1=1976,2000 u $s$2"}" color difference between image$? and image$1, ""with to_Lab command '$3'." +pass$1 1 +needs_to_lab:="s = ['$3']; s!=0 && s!=' '" +if $needs_to_lab m "_deltaE_to_lab : $3" +_deltaE_to_lab. rm.. fi +repeat $!-1 { l[$>,-1] { +nm={0,n} +if $needs_to_lab _deltaE_to_lab[0] fi +if !$2 -.. . norm.. +else 100%,100%,100%,1,${-math_lib}"deltaE00(I#0,I#1)" rv[0,-1] rm. # DeltaE_2000 +fi +=>[0] $nm +} } +rm. um _deltaE_to_lab +#@cli direction2rgb +#@cli : Compute RGB representation of selected 2D direction fields. +#@cli : $ image.jpg luminance gradient append c blur 2 orientation +direction2rgb +direction2rgb : +e[^-1] "Compute RGB representation of 2D direction field$?." +channels 0,1 +foreach { +nm={n} +s c complex2polar round.. 0.001 +*. {180/pi} %. 360 100%,100%,1,1,1 mv... $! +if im!=iM n. 0,1 else f. 1 fi +a c hsv2rgb => $nm +} +#@cli ditheredbw +#@cli : Create dithered B&W version of selected images. +#@cli : $ image.jpg +equalize ditheredbw[-1] +ditheredbw : +e[^-1] "Create dithered B&W version of image$?." +foreach { split_opacity luminance[0] n[0] 0,255 (0,255) index[0] .,1,1 rm. a c } +#@cli fc : eq. to 'fill_color'. +fc : +_gmic_s="$?" v + _fill_color $* +#@cli fill_color : col1,...,colN +#@cli : Fill selected images with specified color. +#@cli : (eq. to 'fc'). +#@cli : $ image.jpg +fill_color 255,0,255 +#@cli : $$ https://gmic.eu/oldtutorial/_fill_color +fill_color : +_gmic_s="$?" v + _$0 $* +_fill_color : +e[0--3] "Fill image"$_gmic_s" with color (${^0})." +foreach { +repeat s { sh[0] $> f. {arg(1+$>,${^0})} } k[0] +} +#@cli gradient2rgb : _is_orientation={ 0 | 1 } +#@cli : Compute RGB representation of 2D gradient of selected images. +#@cli : Default value: 'is_orientation=0'. +#@cli : $ image.jpg +gradient2rgb 0 equalize[-1] +gradient2rgb : check "isbool(${1=0})" +arg0 !$1,"orientation ","" +e[^-1] "Compute RGB representation of 2D gradient "${}"of image$?." +norm foreach { +if $1 gradient_orientation 2 else g xy fi +a c direction2rgb +} +#@cli hcy2rgb +#@cli : Convert color representation of selected images from HCY to RGB. +hcy2rgb : +e[^-1] "Convert color representation of image$? from HCY to RGB." +to_color f " +H = (R/60)%6; +X = G*(1 - abs(H%2 - 1)); +RGB = arg0(int(H),[G,X,0],[X,G,0],[0,G,X],[0,X,G],[X,0,G],[G,0,X]); +m = B - 0.3*RGB[0] - 0.59*RGB[1] - 0.11*RGB[2]; +cut((RGB+=m)*=255,0,255)" +#@cli hsi2rgb +#@cli : Convert color representation of selected images from HSI to RGB. +hsi2rgb : +e[^-1] "Convert color representation of image$? from HSI to RGB." +to_color +f " +H = (R/60)%6; +S = G; +I = B; +Z = 1 - abs((H%2) - 1); +C = I*S/(1 + Z); +X = C*Z; +m = I*(1 - S)/3; +RGB = arg0(int(H),[C,X,0],[X,C,0],[0,C,X],[0,X,C],[X,0,C],[C,0,X]); +(RGB+=m)*=3*255" +#@cli hsi82rgb +#@cli : Convert color representation of selected images from HSI8 to RGB. +hsi82rgb : +e[^-1] "Convert color representation of image$? from HSI8 to RGB." +_hsx82rgb hsi2rgb +#@cli hsl2rgb +#@cli : Convert color representation of selected images from HSL to RGB. +hsl2rgb : +e[^-1] "Convert color representation of image$? from HSL to RGB." +to_color +f " +H = (R/60)%6; +S = G; +L = B; +C = (1 - abs(2*L - 1))*S; +X = C*(1 - abs(H%2 - 1)); +m = L - C/2; +RGB = arg0(int(H),[C,X,0],[X,C,0],[0,C,X],[0,X,C],[X,0,C],[C,0,X]); +(RGB+=m)*=255" +#@cli hsl82rgb +#@cli : Convert color representation of selected images from HSL8 to RGB. +hsl82rgb : +e[^-1] "Convert color representation of image$? from HSL8 to RGB." +_hsx82rgb hsl2rgb +#@cli hsv2rgb +#@cli : Convert color representation of selected images from HSV to RGB. +#@cli : $ (0,360;0,360^0,0;1,1^1,1;1,1) resize 400,400,1,3,3 hsv2rgb +hsv2rgb : +e[^-1] "Convert color representation of image$? from HSV to RGB." +to_color +f " +H = (R/60)%6; +S = G; +V = B; +C = V*S; +X = C*(1 - abs(H%2 - 1)); +m = V - C; +RGB = arg0(int(H),[C,X,0],[X,C,0],[0,C,X],[0,X,C],[X,0,C],[C,0,X]); +(RGB+=m)*=255" +#@cli hsv82rgb +#@cli : Convert color representation of selected images from HSV8 to RGB. +hsv82rgb : +e[^-1] "Convert color representation of image$? from HSV8 to RGB." +_hsx82rgb hsv2rgb +_hsx82rgb : +foreach { +sh[0] 0 /. 0.708333 rm. +sh[0] 1,2 /. 255 rm. +} +#@cli int2rgb +#@cli : Convert color representation of selected images from INT24 to RGB. +int2rgb : +e[^-1] "Convert color representation of image$? from INT24 scalars to RGB." +round foreach { +>> 8 &[1] 255 +&[0] 255 >>[0] 16 a c } +#@cli ipremula +#@cli : Convert selected images with premultiplied alpha colors to normal colors. +#@cli : See also: ''premula''. +ipremula : +e[^-1] "Convert image$? with premultiplied alpha colors to normal colors." +to_a foreach { +channels. 100% /. 255 max. 1e-8 sh.. 0,{s#0-2} /. .. k[0] } +#@cli jzazbz2rgb : illuminant={ 0:D50 | 1:D65 | 2:E } : (no arg) +#@cli : Convert color representation of selected images from RGB to Jzazbz. +#@cli : Default value: 'illuminant=2'. +jzazbz2rgb : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from Jzazbz to RGB, using the "${arg0\ $illu,D50,D65,E}" illuminant." +jzazbz2xyz xyz2rgb $illu +#@cli jzazbz2xyz +#@cli : Convert color representation of selected images from RGB to XYZ. +jzazbz2xyz : +e[^-1] "Convert color representation of image$? from Jzazbz to XYZ." +foreach { split_opacity +f[0] ${-_jzazbz_const}" +tmp = i0 + Jzazbz_d0; +Iz = tmp/(1 + Jzazbz_d - Jzazbz_d*tmp); +azz = i1; +bzz = i2; +Lp = Iz + 0.138605043271539*azz + 0.0580473161561189*bzz; +Mp = Iz - 0.138605043271539*azz - 0.0580473161561189*bzz; +Sp = Iz - 0.0960192420263189*azz - 0.811891896056039*bzz; +tmp = Lp^(1/Jzazbz_p); +L = peakLum*((Jzazbz_c1 - tmp)/(Jzazbz_c3*tmp-Jzazbz_c2))^(1/Jzazbz_n); +tmp = Mp^(1/Jzazbz_p); +M = peakLum*((Jzazbz_c1 - tmp)/(Jzazbz_c3*tmp-Jzazbz_c2))^(1/Jzazbz_n); +tmp = Sp^(1/Jzazbz_p); +S = peakLum*((Jzazbz_c1 - tmp)/(Jzazbz_c3*tmp-Jzazbz_c2))^(1/Jzazbz_n); +Xp = 1.92422643578761*L - 1.00479231259537*M + 0.037651404030618*S; +Yp = 0.350316762094999*L + 0.726481193931655*M - 0.065384422948085*S; +Zp = -0.0909828109828476*L - 0.312728290523074*M + 1.52276656130526*S; +X = (Xp + (Jzazbz_b - 1)*Zp)/Jzazbz_b; +Y = (Yp + (Jzazbz_g - 1)*X)/Jzazbz_g; +Z = Zp; +[ X,Y,Z ]/255" +a c } +_jzazbz_const : +u "const Jzazbz_b = 1.15; +const Jzazbz_g = 0.66; +const Jzazbz_c1 = 3424/4096; +const Jzazbz_c2 = 2413/128; +const Jzazbz_c3 = 2392/128; +const Jzazbz_n = 2610/16384; +const Jzazbz_p = 1.7*2523/32; +const Jzazbz_d = -0.56; +const Jzazbz_d0 = 1.6295499532821566e-11; +const peakLum = 10000;" +#@cli lab2lch +#@cli : Convert color representation of selected images from Lab to Lch. +lab2lch : +e[^-1] "Convert color representation of image$? from Lab to Lch." +foreach { to_color s c complex2polar[1,2] a c } +#@cli lab2rgb : illuminant={ 0:D50 | 1:D65 | 2:E } : (no arg) +#@cli : Convert color representation of selected images from Lab to RGB. +#@cli : Default value: 'illuminant=2'. +#@cli : $ (50,50;50,50^-3,3;-3,3^-3,-3;3,3) resize 400,400,1,3,3 lab2rgb +lab2rgb : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from Lab to RGB, using the "${arg0\ $illu,D50,D65,E}" illuminant." +lab2xyz $illu xyz2rgb $illu +#@cli lab2srgb : illuminant={ 0:D50 | 1:D65 | 2:E } : (no arg) +#@cli : Convert color representation of selected images from Lab to sRGB. +#@cli : Default value: 'illuminant=2'. +#@cli : $ (50,50;50,50^-3,3;-3,3^-3,-3;3,3) resize 400,400,1,3,3 lab2rgb +lab2srgb : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from Lab to sRGB, using the "${arg0\ $illu,D50,D65,E}" illuminant." +lab2rgb $illu rgb2srgb +#@cli lab82srgb : illuminant={ 0:D50 | 1:D65 | 2:E } : (no arg) +#@cli : Convert color representation of selected images from Lab8 to sRGB. +#@cli : Default value: 'illuminant=2'. +#@cli : $ (50,50;50,50^-3,3;-3,3^-3,-3;3,3) resize 400,400,1,3,3 lab2rgb +lab82srgb : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from Lab8 to sRGB, using the "${arg0\ $illu,D50,D65,E}" illuminant." +lab82rgb $illu rgb2srgb +#@cli lab2xyz : illuminant={ 0:D50 | 1:D65 | 2:E } : (no arg) +#@cli : Convert color representation of selected images from Lab to XYZ. +#@cli : Default value: 'illuminant=2'. +lab2xyz : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from Lab to XYZ, using the "${arg0\ $illu,D50,D65,E}" illuminant." +to_color +f " +begin( +const epsilon = 216/24389; +const kappa = 24389/27; +D65 = [ 0.4124564, 0.3575761, 0.1804375, +0.2126729, 0.7151522, 0.0721750, +0.0193339, 0.1191920, 0.9503041 ]; +D50 = [ 0.43603516, 0.38511658, 0.14305115, +0.22248840, 0.71690369, 0.06060791, +0.01391602, 0.09706116, 0.71392822 ]; +E = [ 0.488718,0.3106803,0.2006017, +0.1762044,0.8129847,0.0108109, +0,0.0102048,0.9897952 ]; +white = ("$illu"==2?E:"$illu"==1?D65:D50)*[ 1,1,1 ]; +); +fy = (i0 + 16)/116; +fz = fy - i2/200; +fx = i1/500 + fy; +fx3 = fx^3; +fz3 = fz^3; +XYZ = [ fx3>epsilon?fx3:(116*fx - 16)/kappa, +i0>kappa*epsilon?((i0+16)/116)^3:i0/kappa, +fz3>epsilon?fz3:(116*fz - 16)/kappa ]; +XYZ*=white" +#@cli lab82rgb : illuminant={ 0:D50 | 1:D65 | 2:E } : (no arg) +#@cli : Convert color representation of selected images from Lab8 to RGB. +#@cli : Default value: 'illuminant=2'. +lab82rgb : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from Lab8 to RGB, using the "${arg0\ $illu,D50,D65,E}" illuminant." +foreach { +sh[0] 0 /. 2.55 rm. +sh[0] 1 /. 0.85 -. 127 rm. +sh[0] 2 /. 0.836 -. 149 rm. +} +lab2rgb $illu c 0,255 +#@cli lch2lab +#@cli : Convert color representation of selected images from Lch to Lab. +lch2lab : +e[^-1] "Convert color representation of image$? from Lch to Lab." +foreach { to_color s c polar2complex[1,2] a c } +#@cli lch2rgb : illuminant={ 0:D50 | 1:D65 | 2:E } : (no arg) +#@cli : Convert color representation of selected images from Lch to RGB. +#@cli : Default value: 'illuminant=2'. +lch2rgb : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from Lch to RGB, using the "${arg0\ $illu,D50,D65,E}" illuminant." +lch2lab lab2rgb $illu +#@cli lch82rgb : illuminant={ 0:D50 | 1:D65 | 2:E } : (no arg) +#@cli : Convert color representation of selected images from Lch8 to RGB. +#@cli : Default value: 'illuminant=2'. +lch82rgb : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from Lch8 to RGB, using the "${arg0\ $illu,D50,D65,E}" illuminant." +pi,facth:=[pi,255/(2*pi)] +foreach { +sh[0] 0 /. 2.55 rm. +sh[0] 1 /. 1.1086 rm. +sh[0] 2 /. $facth -. $pi rm. +} +lch2rgb $illu c 0,255 +#@cli luminance +#@cli : Compute luminance of selected sRGB images. +#@cli : $ image.jpg +luminance +#@cli : $$ +luminance : +e[^-1] "Compute luminance of image$?." +remove_opacity srgb2rgb +foreach { +if s==3 sh 0 sh[0] 1 sh[0] 2 *[1] 0.22248840 *[2] 0.71690369 *[3] 0.06060791 +[1-3] rm[1] +elif s!=1 norm n 0,255 +fi +} +channels 0 rgb2srgb +#@cli lightness +#@cli : Compute lightness of selected sRGB images. +#@cli : $ image.jpg +lightness +lightness : +e[^-1] "Compute lightness of image$?." +remove_opacity srgb2rgb +if s==3 srgb2lab channels 0 * {255/100} elif s!=1 norm n 0,255 rgb2srgb fi +#@cli lut_contrast : _nb_colors>1,_min_rgb_value +#@cli : Generate a RGB colormap where consecutive colors have high contrast. +#@cli : This function performs a specific score maximization to generate the result, so +#@cli : it may take some time when 'nb_colors' is high. +#@cli : Default values: 'nb_colors=256' and 'min_rgb_value=64'. ++lut_contrast : check "isint(${1=256}) && $1>=1 && isnum(${2=48})" +e[^-1] "Generate high-contrast RGB colormap with $1 colors and min RGB value $2." +l[] { +64,64,64,1 eval "repeat (8,k, x = !!(k&1); y = !!(k&2); z = !!(k&4); i([x,y,z]*(w-1)) = 1)" +N:=is +e "" +do ++neq. 0 distance. 1 xyzM:=[xM,yM,zM] rm. +col:=round([$xyzM]*255/(w-1)) +if max($col)>=$2 =. 1,$xyzM N+=1 else =. -1,$xyzM fi +e "\r [ Init ] > Colors \#"$N +while $N<$1 +>. 0 {is},1,1,3 +eval.. ">begin(k = 0); i>0?(I[#-1,k++] = round([ x,y,z ]*255/63))" +k. +N0=5 +s x +repeat $! { +if {$>,I==[0,0,0]} rv[$>,0] fi +if {$>,I==[255,255,255]} rv[$>,1] fi +if {$>,I==[255,0,0]} rv[$>,2] fi +if {$>,I==[0,255,0]} rv[$>,3] fi +if {$>,I==[0,0,255]} rv[$>,4] fi +} +a x +e "" ++srgb2lab a c +energy_max=${-_lut_contrast.} +nb_attempts=1000 +do +e "\r [ Optim ] > Score = "{_$energy_max}", Attempts = "$nb_attempts" " +. eval " +do( +k0 = round(u("$N0",w-1)); +k1 = round(u("$N0",w-1)), +k0==k1); +tmp = I[k0]; I[k0] = I[k1]; I[k1] = tmp" +energy=${-_lut_contrast.} +if $energy>$energy_max energy_max=$energy k. nb_attempts=1000 else rm. nb_attempts-=1 fi +while $nb_attempts>0 +channels 0,2 +} +_lut_contrast : +100%,1,1,1,"> +const N = 10; +dist = 0; sumw = 0; +RGB0 = (I[#0,x])[3,3]; +kmin = max(x-N,0); +kmax = min(x+N,w-1); +for (k = kmin, k<=kmax, ++k, +RGB = (I[#0,k])[3,3]; +w = (1 + N - abs(k-x))^1.5; +dist+= w*norm(RGB - RGB0); +sumw+=w; +); +dist/=sumw" +u {is} rm. +#@cli map_clut : [clut] | "clut_name" +#@cli : Map specified RGB color LUT to selected images. +#@cli : $ image.jpg uniform_distribution {2^6},3 mirror[-1] x +map_clut[0] [1] +map_clut : +e[^-1] "Map color LUT $1 on image$?." +if !$! return fi +to_color +if ${"is_image_arg $1"} pass$1 0 to_rgb. else clut "$1" fi +l:=round((w*h*d)^(1/3)) +if w*h*d!=$l^3 error "Command '$0': Specified CLUT $1 has invalid dimensions "({w},{h},{d},{s}). fi +r. $l,$l,$l,3,-1 +repeat $!-1 { l[$>,-1] { +nm={0,n} split_opacity[0] /[0] {256/$l} ++warp. [0],0,1,1 +rm[0] mv. 0 a[^-1] c =>[0] $nm +} } rm. +#@cli match_histogram : [reference_image],_nb_levels>0,_color_channels +#@cli : Transfer histogram of the specified reference image to selected images. +#@cli : Argument 'color channels' is the same as with command 'apply_channels'. +#@cli : Default value: 'nb_levels=256' and 'color_channels=all'. +#@cli : $ image.jpg 100,100,1,3,"u([256,200,100])" +match_histogram[0] [1] +match_histogram : check ${"is_image_arg $1"}" && ${2=1024}>0" skip "${3=0}" +channels=${"_ac_list \"$3\""} +e[^-1] "Transfer histogram from image ["${"pass$1 -1"}"] to image$?, ""with $2 levels, for channels '"$channels"'." +pass$1 1 sref:=s rm. +to_colormode $sref +if ['$channels']!='all' +pass$1 {$sref==3?2:0} +to_color +ac. "+store _match_histogram_reference",$channels rm. +ac "_match_histogram $2",$channels,1 +else +pass$1 +store. _match_histogram_reference +foreach { _match_histogram $2 } +fi +_match_histogram_reference= +_match_histogram : +$_match_histogram_reference +repeat min(s#0,s#1) { +sh $> ++histogram[-2,-1] $1 cumulate[-2,-1] /.. {-2,i[-1,2]} /. {i[-1,2]} +f.. "* +const w1 = w -1; +val = i; X = x; +val=1, nX = max(0,X - step); val(val - vp)?--X); # Rounding +):( +step = int((w1 - X)/2); +while (X=1, nX = min(w1,X + step); val>i[#-1,nX]?(X = nX):(step = int(step/2))); +X(vn - val)?++X); # Rounding +); +im#-3 + (iM#-3 - im#-3)*X/w1" +n[-4] 0,{w-1} round[-4] map[-4] .. +k[0,1] +} +rm. +#@cli match_icp : [reference_image],_precision>0,_transformation_variable +#@cli : Transform selected set of d-dimensional vectors to match specified set of reference vectors, using ICP (*Iterative Closest Point*) algorithm. +#@cli : A description of ICP is available at . +#@cli : Return the L2 alignment error. +#@cli : Default values: 'precision=1e-2' and 'transformation_variable=(undefined)'. +#@cli : sample lena,earth +match_icp[0] [1] +match_icp : check ${"is_image_arg $1"}" && ${2=1e-2}>0" skip "${3=}" +e[^-1] "Match vector set$? with reference vector set $1, using ICP with precision $2.\n" +pass$1 +foreach[^-1] { +w,h,d,s={w},{h},{d},{s} +pass. mv. 0 +if "['$3']!=0" +store. img fi +match_pca. .. +old_err=inf +repeat inf { +100%,100%,100%,4,"* +P = I(#1); +distmin = pmin = qmin = rmin = inf; +repeat (d#0,r, +repeat (h#0,q, +repeat (w#0,p, +dist = norm(I(#0,p,q,r) - P); +dist Iteration "$>": Error = "{_$err} +if !$err" || "abs($err-$old_err)<1e-3 rm. break fi +old_err=$err ++warp[0] .,0,0 rm.. +_match_icp[-2,-1] +mmul[-2,-1] r. $s,{h/$s},1,1,-1 permute. yzcx r. $w,$h,$d,$s,-1 +} +k. +if "['$3']!=0" $img rv +_match_icp $3={^} rm[0,-2,-1] fi +u $err +} +rm. +_match_icp : +N,s:=whd,s +permute. cxyz y. +l.. { +r 1,{whd},1,100%,-1 permute cyxz 1,100%,1,1,1 a x +r 100%,{$s*$N},1,1 r {($s+1)^2},100%,1,1,0 r {$s*($s+1)},{($s+1)*$N},1,1,-1 +s y rm[$s--1:{$s+1}] a y +} +solve. .. +#@cli match_pca : [reference_image],_color_channels +#@cli : Transfer mean and covariance matrix of specified vector-valued reference image to selected images. +#@cli : Argument 'color channels' is the same as with command 'apply_channels'. +#@cli : Default value: 'color_channels=all'. +#@cli : $ sample lena,earth +match_pca[0] [1] +match_pca : check ${"is_image_arg $1"} skip "${2=all}" +channels=${"_ac_list \"$2\""} +e[^-1] "Transfer mean vector and covariance matrix from image ["${"pass$1 -1"}"] to image$?, ""for channels '"$channels"'." +pass$1 1 sref:=s rm. +if $sref<=4 to_colormode[^-1] $sref fi +if $sref==1 +pass$1 +var_ref,avg_ref:=[iv,ia] rm. +foreach { - {ia} * {sqrt($var_ref/max(1e-8,iv))} + $avg_ref } +elif ['$channels']!='all' +pass$1 {$sref==3?2:0} +to_color +ac. "+store _match_pca_reference",$channels rm. +ac "_match_pca",$channels,1 +else +pass$1 +store. _match_pca_reference +foreach { _match_pca } +fi +_match_pca_reference= +_match_pca : +$_match_pca_reference +f.. "*begin( +cov_ref = [ "${"covariance_vectors[1] _avg_ref"}" ]; +cov = [ "${"covariance_vectors[0] _avg"}" ]; +avg_ref = [ "$_avg_ref" ]; +avg = [ "$_avg" ]; +eig_ref = eig(cov_ref); +eig = eig(cov); +lambda_ref = sqrt(eig_ref[0,s]); +lambda = 1/sqrt(1e-6 + eig[0,s]); +repeat(s,k, +sks = s + k*s; +Uref = eig_ref[sks,s]; +U = eig[sks,s]; +dot(Uref,U)<0?copy(eig[sks],U*=-1); +); +rot_ref = mul(transpose(eig_ref[s,s*s],s),diag(lambda_ref),s); +rot = mul(diag(lambda),eig[s,s*s],s); +M = mul(rot_ref,rot,s); +); +avg_ref + M*(I - avg)" +rm. +#@cli match_rgb : [target],_gamma>=0,_regularization>=0,_luminosity_constraints>=0,_rgb_resolution>=0,_is_constraints={ 0 | 1 } +#@cli : Transfer colors from selected source images to selected reference image (given as argument). +#@cli : 'gamma' determines the importance of color occurrences in the matching process (0:none to 1:huge). +#@cli : 'regularization' determines the number of guided filter iterations to remove quantization effects. +#@cli : 'luminosity_constraints' tells if luminosity constraints must be applied on non-confident matched colors. +#@cli : 'is_constraints' tells if additional hard color constraints must be set (opens an interactive window). +#@cli : Default values: 'gamma=0.3','regularization=8', 'luminosity_constraints=0.1', 'rgb_resolution=64' and 'is_constraints=0'. +#@cli : $ sample pencils,wall +match_rgb[0] [1],0,0.01 +match_rgb : check "${2=0.3}>=0 && ${3=8}>=0 && ${4=0.15}>=0 && ${5=64}>=0 && isint(${6=0})" +e[^-1] "Transfer colors of image $1 to image$?." +sigma=1.5 +repeat $! { pass$1 0 l[$>,-1] { +nm_source={0,b} nm_target={1,b} +=> source,target ++_match_rgb[source,target] $2,$sigma,$5 => fsource,ftarget +n[fsource,ftarget] 0,255 +if $6 +h0:=2*{*,v}/3 ws0={source,max(1,w*$h0/h)} wt0={target,max(1,w*$h0/h)} +w1:=2*{*,u}/3 hs1={source,max(1,h*$w1/w)} ht1={target,max(1,h*$w1/w)} +if abs($ws0+$wt0-$w1)$w1 r2dx[-2,-1] $w1 fi +if h>$h0 r2dy[-2,-1] $h0 fi +=> visu,both +w[visu] -1,-1 +N=0 do +w[] -1,-1,"[G'MIC] Add Color Guide (Constraint ""#"{1+$N}")" ++select[$visu] 1 if i==-1 rm. break fi +line[$visu] {i[0]},{i[1]},{i[3]},{i[4]},1,0xF0F0F0F0,0 +line[$visu] {i[0]},{i[1]},{i[3]},{i[4]},1,0x0F0F0F0F,255 +circle[$visu] {i[0]},{i[1]},5,1,0,0,0 circle[$visu] {i[0]},{i[1]},3,1,255,0,0 +circle[$visu] {i[3]},{i[4]},5,1,0,0,0 circle[$visu] {i[3]},{i[4]},3,1,0,255,0 +s. y,2 rows[-2,-1] 0,1 a[-2,-1] x permute. xczy ++warp[$both] .,0,0,1 rm.. +*. {($5-1)/255} s. x,2 +-. .. *. -1 a[-2,-1] c +N+=1 +while {*} +if $N a[-$N--1] x permute. xczy => constraints fi +rm[$visu,$both] w 0 +fi +if $constraints ++pointcloud. 0 r. ...,...,...,3,0 +compose_channels. + a[-2,-1] c +displacement[fsource] [ftarget],0.001,5,0,10000,1,. rm[ftarget,constraints,-1] +else +displacement[fsource] [ftarget],0.005 rm[ftarget] +fi +=>[fsource] displacement ++_match_rgb[target] 0,$sigma,{displacement,w} +warp. [displacement],1,1,1 c. 0,100% => fconfidence ++map_clut[source] . => confidence +[displacement],[displacement],[displacement],1,x +f. y +f. z a[-3--1] c *. {255/(w-1)} +. 1 ++_match_rgb[target] 0,0,{w} *.. . +warp[-2,-1] [displacement],1,0,1 +distance. 1 *. -1 watershed.. . rm. -. 1 +=> clut +b[clut] $sigma% +if $4>0 +^[fconfidence] {$4/10} *[fconfidence] -1 +[fconfidence] 1 ++f[fconfidence] x +f. y +f. z a[-3--1] c *. {255/(w-1)} +rgb2hsv[clut,-1] channels. 100% +j[clut] .,0,0,0,2,1,[fconfidence] rm. +hsv2rgb[clut] +fi ++map_clut[source] [clut] => res_noregul +if !$3 +=>[res_noregul] res +else +l[source,res_noregul] { +rgb2ycbcr ++-[1] [0] repeat $3 { guided. [0],5,5 } +. [0] c. 0,255 +ycbcr2rgb +} +=> res +j[res] [res_noregul],0,0,0,0,1,[confidence] +rm[res_noregul] +fi +k[res] +} } +_match_rgb : +l[] { +check "${1=0}>=0 && ${2=1.5}>=0 && ${3=128}>0" gamma=$1 smoothness=$2 res=$3 +onfail noarg gamma=0 smoothness=1.5 res=128 +} +e[^-1] "Convert image$? as 3D volumetric scalar functions for color matching, with gamma "$gamma", +smoothness "$smoothness" and resolution "$res"." +to_rgb +foreach { +b 0.3% +r {w*h},3,1,1,-1 * {($res-1)/255} +pointcloud 1,$res,$res,$res f i?i^$gamma:0 b $smoothness% n 0,1 +} +#@cli mix_rgb : a11,a12,a13,a21,a22,a23,a31,a32,a33 +#@cli : Apply 3x3 specified matrix to RGB colors of selected images. +#@cli : Default values: 'a11=1', 'a12=a13=a21=0', 'a22=1', 'a23=a31=a32=0' and 'a33=1'. +#@cli : $ image.jpg +mix_rgb 0,1,0,1,0,0,0,0,1 +#@cli : $$ +mix_rgb : skip ${1=1},${2=0},${3=0},${4=0},${5=1},${6=0},${7=0},${8=0},${9=1} +e[^-1] "Apply matrix [ $1 $2 $3 ; $4 $5 $6 ; $7 $8 $9 ] to RGB colors of image$?." +to_color +foreach { sh 0,2 mix_channels. (${1-3};${4-6};${7-9}) rm. } +#@cli oklab2rgb +#@cli : Convert color representation of selected images from OKlab to RGB. +#@cli : (see colorspace definition at: ). +#@cli : See also: ''rgb2oklab''. +oklab2rgb : +e[^-1] "Convert color representation of image$? from Oklab to RGB." +foreach { +split_opacity to_rgb[0] +f[0] " +l = (i0 + 0.3963377774*i1 + 0.2158037573*i2)^3; +m = (i0 - 0.1055613458*i1 - 0.0638541728*i2)^3; +s = (i0 - 0.0894841775*i1 - 1.2914855480*i2)^3; +[ 4.0767245293*l - 3.3072168827*m + 0.2307590544*s, +-1.2681437731*l + 2.6093323231*m - 0.3411344290*s, +-0.0041119885*l - 0.7034763098*m + 1.7068625689*s ]" +* 255 a c +} +#@cli palette : palette_name | palette_number +#@cli : Input specified color palette at the end of the image list. +#@cli : 'palette_name' can be { default | hsv | lines | hot | cool | jet | flag | cube | rainbow | parula | spring | summer | autumn | winter | bone | copper | pink | vga | algae | amp | balance | curl | deep | delta | dense | diff | gray | haline | ice | matter | oxy | phase | rain | solar | speed | tarn | tempo | thermal | topo | turbid | aurora | hocuspocus | srb2 | uzebox | amiga7800 | amiga7800mess | fornaxvoid1 } +#@cli : $ palette hsv ++palette : +names=${-_palette_names} N:=narg($names) +l[] { if isint("$1") name=${"arg0 ($1%"$N"),"$names} else name="$1" fi onfail name="$1" } +e[^-1] "Input color palette '"$name"'." +_palette_$name +=> $name +_palette_names : +u default,hsv,lines,hot,cool,jet,flag,cube,rainbow,parula,spring,summer,autumn,winter,bone,copper,pink,vga,algae,amp,balance,curl,deep,delta,dense,diff,gray,haline,ice,matter,oxy,phase,rain,solar,speed,tarn,tempo,thermal,topo,turbid,aurora,hocuspocus,srb2,uzebox,amiga7800,amiga7800mess,fornaxvoid1 +_palette2code : +sort_list +,n +foreach { +r {whd},1,1,100%,-1 +img2base64 0,0 +e "_palette_"{n}" : " +b64=\"${}\" +l[] { ('$b64') s x,-119 ('\\\\\n') a[0--3] .,x rm. a x b64={t} rm } +e " base642img \\\n"$b64"\n" +} +_palette_default : +256,1,1,3,[16+32*int(x>>5),16+32*int((x>>2)&7),32+64*int(x&3)] +_palette_hsv : +256,1,1,3,[x*359/(w-1),1,1] hsv2rgb. round. +_palette_lines : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjU2IDEgMSAzICM2MTcKeJwNkhGgu1AYxT8YDP4QDB4Eg+BKEATBYBAEQXDhQhAMHgweBBeuXBgMgmAwCIIgCIJBEAQPguBKEASDwWDwYDD4/tGx75zf+Q4gAuhCPFVzM0CgvUXFmr0plIpkB2KwW4bppr16aMgRzge16wbwTbxW0L6Y0IxsjiFyZyQvAISoDPFMYgWlnTUI/M4bsllO+I5M0GuoWm+LP6kImrtktjhu8sxjaJ9V6zwNDy0FijoRcloRzGvghbDTAiO+Z8/Hv9JoKRbRr79JjwXqpOfBGxRasEejCH2kHyhruCHk2jXJ5xkgGFdjPgp/4IZ4HDTk4LTjXrAED56dzkIskRGG8Gwh9FdqTh8bkMgp0+JG9tb+xXpLf58ugHG/GoPG6ZmnSGh+Bn1OyCkX23dUAjon753DhyTJuhiCaxcy8acf79DuuwbQNo/NItIqXXWF491E8R0ECNOppKlesjlaK8wsIqpKwL3QJwnhCygGtbCWbgbvJ0W4GFMOSrgnpIQ9rZHDYMyVS261dE1U1B/hkUInqiU/44MDQ/m4BMtHV9Wq5bgqjtJ6laFWKUDtOwsRFvaMLvSAZbHj+u9o/u0itAN5xHX85KSu4GblHN0BJgEHfPGtksZjK4JkzFY1AvkIMTEJBX7tO4HCF6Hov85VvUXaEWosOIqirYUDkWW/OH7FGP18B9h0jjs49tyukEYSKYiZTjCmPnkxI7neAWkOOTxrs4A3blzFEhvJsgMXqmsicxgRGMFil7o5wS3HuIZmAGccg8wvlM8UfPWXpfJN5JTPj+YlnxB6QD6tvGmdD9oUxoBrWc3mf8h5fjM=" +_palette_flag : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjU2IDEgMSAzICMyNAp4nPv/n4Hh/wjGDCMeD4JIGEAMAH3RPtA=" +_palette_cube : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjMxIDEgMSAzICMzMzgKeJxj5BCQkFfXN7Nz8wuLS80trWnpmTJn8erNuw6dunTr0cuPP39/e/f83vXzxw/s2LBy4cyJnY1VRVnJ0cHezjYmOqqyoryszFxCUoqahhaOHgER8en55XVtfdPmLV27dc+RM1fuPH79+ffvL2+e3Ll69ui+beuWz5ve395QUZCRGBHo6WhlpKUsLczNwsIjIqOsbWzt7BUUlZhZWNnYMWHGguXrt+87fu7avadvv/759enVo1uXTx/es2XNkjlTe1vryvLS4sL83e0tDDQUJQQ5Wdj4xGRVdU1tXX1CYpKzi6ubuybNWrhy486DJy/cePD8/fd/DIQAE6eghKKGgYW9u39YXFpeWV1r79Q5S9Zs2XP49OVbj159+vWf9oCQN5kI+oIOgIVbWFpZy8jK0TMwIjGjoKKhvX/6vOXrtu07evbqnSdvvvymQ0ABAC/raR8=" r. 256,1,1,3,3 round. +_palette_rainbow : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjI1IDEgMSAzICM1NjcKeJxj5ublE+DnF5KQUVBWU9fS0tHV0dXVAVL6RiZm5haWFpaWVpZWVtbW1iBsbWMDJq3BwMrK0sLMWF9LRYqLkYGRAQygFAYbG2DkVrH2iUjNq2zpnTp3+eadB09fvvXo+dvPP/7+//v375/fv37++PH9+7dvX799/fr1GwQAWV+/ACEUABmf3796+uDW1X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MH1MvNIapk7+sVnlLRPnrdl57PLDd7+xaPz55t7Fw9tWzulrKkmP8rU3UpXgYoTbPWXh+j0nrz35+BeLxm8vb587sHnZzO76wpRwLxt9JVF2PL5gYAAAc+1twA==" +r. 256,1,1,3,3 round. +_palette_hot : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMTI0IDEgMSAzICMxNDEKeJzjFRKXVdLQNTK3dXb3DY6IS87IK66oa+nsmzJz3pKV67fu2n/k1IWrt+4/ff3+66//1AUMpABGdl5BcRlFdZBTndx9g0BOzS2urGvuADl18cr1W3buP3LyPMipr4BO/UdNu0kEjFxC0kpaRtbO3kHRydnFNS3dk2cvXr1lz5EzV+88efP1LwA796yq" r. 256,1,1,3,3 round. +_palette_cool : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMzIgMSAxIDMgIzc4CnicY+ERkVHRMbFx8QmJSckpqWnpmTJnyZote46cuXLnyZsvf/58efPkzpUzR/ZsWbNkzpSelpqSnJSYEB8XGxMdFRkRHpb/BAAAHuY/4Q==" r. 256,1,1,3,3 round. +_palette_spring : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjggMSAxIDMgIzcxCnic+/8fN2DhFVPQNLJ28Q1LyCyqbumdtmDlpt1Hzl578PLT79+fXj64dvbI7k0rF0zrbakuykwI83WxNtJUEONlAQDKiDfN" r. 256,1,1,3,3 round. +_palette_summer : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjggMSAxIDMgIzcxCnicY+EVU9A0snbxDUvILKpu6Z22YOWm3UfOXnvw8tPvprbuCVNmzl20bPX6LTv2Hjx26vyVm3cfPXv94cvPv2l4AACR+i4M" r. 256,1,1,3,3 round. +_palette_autumn : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjYgMSAxIDMgIzQyCnic+/8fF2Dhk1DSMXPwDI5NL6xu6ZuxaM22Aycv333+8TcDTgAAaHcm2w==" +r. 256,1,1,3,3 round. +_palette_winter : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMzEgMSAxIDMgIzc5CnicY2DAC1h4RGRUdU1t3fzC4tLzyxs6JsxYuHLjzkOnLt16/Prz778/v358+/Lpwzs3rlw4ffzw/t3bN69bvXzxvFnTJvV1tTUBACEGJp4=" r. 256,1,1,3,3 round. +_palette_bone : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KOTkgMSAxIDMgIzI1Mgp4nGNkZuXg4uETFBaVkJKRU1BWVdfU0TMwNjG3tLZzcHJx9/T28w8KCY+MjktISk3PzM4rKCwpq6iqbWhqaevs7p0wccq0GbPnzl+4ZNnKtRu3bN+9/9Cxk2cuXLl+696jpy/ffPj8/dc/RmKsCI2IiU9KzcjJLyqtqK5rbGnv6ps4ZfqsuQsWAw3esHnbzr37Dx09cfrM+YtXrt24fef+w8fPnr968+7j56/ff/35x8TKwcMvJCopLa+koq6lZ2hibmXnCDTZNyA4PDI2ITktE2hwSVlldV1DU2t7Z3cf2N2zwO5esXrtho1btu3YvXf/wSPHcFoBAJTokrQ=" r. 256,1,1,3,3 round. +_palette_copper : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMTE1IDEgMSAzICMzMzkKeJxj4+TmExQWk5SWU1RW09TRNzKxsLK1d3b18PINCA6NiI5LSE7LyM4rKC6rqK5rbGnv7O2fNGX6rLnzFy1dvmrthk1bd+zee+DQ0ROnz164fO3mnXsPnzx7+eb9xy/ff/359x87YGFl5+Dm5RMQFBYVk5CSlpVXVFZRU9fU1tEzMDIxNbe0trG1d3R2dfP08vH1DwwKCY2Iio6NT0hKTk3PyMrJKygsLi2rqKyurW9sam1r7+zu7eufOGXa9Jmz5sybv3DxkmUrVq1Zu37Dpi1bt+/avXffgUOHjx5jYgZZysnFzcPLxy8oJCwiIiYuISklLSMrp6CopKyiqqauoakFdIG+gaGRsYmpmbmFpZWNrZ29g6OTs4ubu4ent4+vn39AYFBwaFh4RGRUdExsXHxCYnJKalp6RmZWdm5uXn5BUXFJaVl5RWVVTW1dPQCk5ZAs" r. 256,1,1,3,3 round. +_palette_pink : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMTIxIDEgMSAzICMzMDUKeJxT1DG1cfbwC46ISUzNzC0sraiub2rr7O6bOGX6zDnzFy5ZtnL1ug2bt27fuXvvgUOHDx85euz4iZOnTp85e+7c+QsXL12+cuXqtes3bt66ffvO3Xv37j94+PDR4ydPnj57/uLFy1evX799++79hw8fP33+8uXr12/ff/z49ev37z9///37zyoso6SurW9sZmVr7+Tq7uXjHxQSFh4ZHRuflJyanpGVnZtfWFRSWl5RWV1b39Ta0d0PddLiZSvXIJx05NiJU2fOXbh89fqNW3fu3X/0BGgzFS1uaGxqaW1r7+zu6e2bMHHS5CnTps+YOWv2nHnzFy5avGTpsuUrVq5avWbtuvUbNm4COmn3vgOHj504fRbonhu3795/+OTZi1dv33/68u3Hrz//AH2168E=" +r. 256,1,1,3,3 round. +_palette_vga : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjU2IDEgMSAzICMxNzgKeJz7/+fn10/vXz9/8uDOjasXzpw4sv/IiTMXrt648+DJ89fvP339+ec/Bvjx8dXj25dOHdi2ZsGU1tIEVwbCwDWhtHXKgjXbDpy6dPvxq48/MM2Q0zF3cPcLiYpPycgtLK2saSAMaipLC3MzUuKjQvzcHcx15IhwB4Yt/zH8v2vr+pWL507r72goz00KdTPEdDthQEYIYbgMw3c0CSEi/E9G7JIRQoT9T0YYEgYAJsphWQ==" +_palette_algae : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KNTAgMSAxIDMgIzE2MQp4nAGWAGn/1M3Hwbq0raegmZKLhH11bWVcU0k+MygeFg8JBwYICg0PEhQVFxgZGRkZGRkYFxYVExL38u7p5ODc19PPy8fEwLy4tbGtqqainpqWko2JhH96dnFtaGRfW1ZRTUlEQDw3My4qJczFvbavqKGak42GgHp0bmhjX1pXVFJRUFBPTk1MS0lIRkRCPz07ODUyLywpJiMgHBkV1p88Lw==" r. 256,1,1,3,3 round. +_palette_amp : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KNjEgMSAxIDMgIzE5NAp4nAG3AEj/8O3r6ejm5OLh397c29nY1tXU0tHPzszLycjGxMPBv728uri1s7CtqqainpqVkIuFgHp0b2lkXlhTTkhDPurm4dzX0s3Iw765tLCrpqGcmJOOiYSAe3ZxbGdiXVhTTklDPTgyLSgjHhkWEhAODg0ODg4ODg4NDQwLCgnq5N7Y0szGwLq0rqihnJWPiYN9eHJsZmBbVU9KRUA7NjIuKygmJCQkJCUmJicoKSkpKCcmJSMhHxwaGBUS64BWpQ==" r. 256,1,1,3,3 round. +_palette_balance : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMTIxIDEgMSAzICMzNzQKeJwBawGU/hgaHB4gIiMlJigoKSkoJyQgGhMNCgoMERYcIictMzg+Q0lOVVthaG51fIKJkJado6mwtrzDyc7V2+Dm7PDu7Oro5+Xj4t/e3dva2NfW1NLR0M7Ny8rIxsXDwcC+vLq4tbOwraqno56alZCLhYB6dG9pY15YU01IQj0dICImKCsuMDM2OTs/QUVJTFFVW19kaGxxdHh8gISHi46SlZmcoKOmqqyvs7a5vL/CxcnMz9PW2t3h5ens6OPe2dTPysXAu7axraijnpmVkIuGgXx3cm1pY15ZVE9KRD45My4oIx8aFhMQDw4NDg4ODg4ODQ0MCwoJREpRWF5lbHN7goqSmqGpsLa7vb69vby8u7u6urm5ubm5ubq6uru8vL2+v8HDxcbIys3P0dXX2t3f4ubp6+fh2tXPyMK9trCqpJ6YkYuGf3l0bWhiXFZQS0ZBPDczLisoJiQkJCQlJSYnKCkpKSgnJiQiIR4cGhcVEqaTs4c=" r. 256,1,1,3,3 round. +_palette_curl : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMTI0IDEgMSAzICMzODEKeJwTFROXkJCUkpKWlpaRARJSkuJiosJCggKCwmLSCup6Znbu/uHx6fnldW29U2YtXLF+6+6DJ85duXn/6euP3/78+fn96+eP79++efXy+bOnjx89uH/3zu2b169duXT+7KkTRw/u271984Y1K5YsmDN9Ul9nS31VaUF2anxUqL+Xi72VqZySmpaekZmVraOrp29gSERMQnJGTkFxeXV9U3tX38SpM2bPW7h0xaq1GzZv27F738Ejx0+dvXDl+q27D5+8ePPhy+d3r57cv3X1wumjB/ds37hm+UKgHb0dTbUVxXmZKQnR4UF+Xq6OtlZmxvraGqpKCrJgn4kIg/wmwMfr4ubh7esfFBIWGR2bkJSSnpWTV1BUXFpeUVVdU1tXV9/Q2NTc2tbR1Tth8rRZcxcuXbVu8469h0+cvQz2+cfXT+5eO3/i4O4ta5cvnD21v6u1obq8uCA3KyMtJTkpMSEhIT4+PgEG4uPjYqMjw0OD/L09nO2tzACwu7nF" r. 256,1,1,3,3 round. +_palette_deep : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KNDkgMSAxIDMgIzE1OAp4nAGTAGz/+e7j2M7Dt6yhlYqAdm5mYVxYVVJPTUtKSEZEQ0FAPz49PT0+P0BBQT8+Ozk2MzAsKfv38/Ds6OXh3dnV0czIw764s66po56Yk46Ig396dG9qZF5ZU05IQz46NjIvKycjHxvJw724s6+rqKWko6Kjo6Ojo6OjoqKhoJ+dnJuamZeWlZSTkY+Mh4B4b2ZeVU1FPTYvM2JJnA==" r. 256,1,1,3,3 round. +_palette_delta : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjU2IDEgMSAzICM3NzAKeJwTEBIWEROXkJSWkZWTV1BUUlZRVVUDAlVlJUV5OVlZGWlpKRCQlpaWASmBqFFT19DU0tHVNzA0NjWzsLKxc3Bycff08Q8Ki4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Kj4kMC/L38XBxsDF//+bV8ycP792+ce3ShTMnjx3ev3fXts3r16xYsmDOjCkTejpaGmoqivOz05Pjo8NDAnw8XB3trMyNDfW0NFSVFGSlJcXFRISFhQQF+Pnev3398sWzp0+ePH4EA48fP34CBo8fP3p4/+7tm9euXDh78tihfbu2bly7YvG8mVP6u1rqK0vyMpJjwwN93BxtzI30NFUBgy55hg==" r. 256,1,1,3,3 round. +_palette_diff : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMTQzIDEgMSAzICM0NDAKeJwBrQFS/gcJCw0ODxESFBYWGBseIiYqLjI2Oj5CRUlNUVRYXF9jZmtvcnZ5fYCEiYyQk5ebn6Onq66yt7q/wsfLz9PX3N/k5+vu8fP19fX08e/s6ebi39zZ1dLOy8jEwr67uLWyr6yppqOgnZqYlZKPjIqHhIF+fHl2c3Bua2hkYF1ZVlJPS0hFQT47NzQwLSomIyAdIyYpLC8zNTk7P0JFSEtNUFNVWFteYGNmaGtucHN2eXx+gYSHioyPkpWYm56hpKeqrbC0trq+wMTHy8/R1djc3+Pm6ezu8PHx8O/s6ufj4NzZ1dLOy8fDwLy5trKvq6mlop+bmJWSj4yJhoOAfXp3dHFubGhmY2BeW1hWU1FOTEpHRUI/PTs4NTIwLSooJSJAQ0dKTlFUWFteYWRmaGpsbnByc3V4enx9gIKEhoiKjY+Rk5aYmpyfoaSnqauusLO2uLu+wcTGyszP0tXY29/i5efq7O7v8PDv7Onm4t3Z1dDLxsK9ubSvq6einZqVkY2IhIB8d3Nva2djX1tXU09LR0RAOzg0MS0qJyQiISAeHRsbGRgWFRQSEA4ODAoIBjEs26k=" r. 256,1,1,3,3 round. +_palette_gray : +256,1,1,1,x r. 100%,1,1,3 +_palette_haline : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KNDYgMSAxIDMgIzE0OQp4nAGKAHX/KiwuLSgiGxQPDAwPEhcbICUpLTA0Nzo8QEJGSU5TWF9mb3m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. 256,1,1,3,3 round. +_palette_oxy : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjU2IDEgMSAzICM2NTYKeJyzd3RydnP39PL18w8MDg2LiIqJjUtMSknNyMzOyS8oKi4rr6iqqatvaG5pbevo7Oru6e0LDAgMDA4JCQ0Pj4iMigaqj09ISEpOTklLS8/IzMrOyc3LLygsKi4uLSsvr6yqrq6tq2tobGoCGgAzoX/CxEmTp0ydNn3mzFmz586bP3/hosVLli5bvmLV6jVr163fsHHzlq3btu/YuXvP3n0HDh46dOToseMnT50+c+78hYuXr1y9duPmrdt3791/8Ojxk6fPX7x89ebt+w+fPn/5/u3L54/v3719/frVq1cvIeAFEDx//vzZs2dPnz558uTx40ePHj18+ODB/fv37t29e+cOKxCwQQE7DED5rGDAwgJSws7Bxc3HLygkKibh6x8QGBQcEhoWHhERFR0dEwcMgMSk5JTUtPT0zKys7Ny8vPxCYACUAgOgAhgANbV1DcAAaAGFIDAAenp7+4D+nwTy/wyg/+cAAwDo/8Vg/wMDAOT/TZu3QP2/dz8wAAj7/937T5+//vv75/fPH6BQ+PTh3ZvXL58/ffLowb27d25ev3b10sXz586cOnni6JFDB/fv3bN7x/ZtWzdt3LAO4n92dg4OTk4uLi5ubh4eHl4g4AMCfhAAMYB8Hm5uLk5OTg4OdnZvsP+DQ8LC4AkgPjEpKTk1FSUBFJWUlpVVVFZW1dTW1jc0NgJTUGt7R2cnSgIABsCcuXPnLYAmgJXAAAAlgE2bNoMSwK7de/bsAwbAYWAAnAAGwNlz585fvHT5yrXrN27evnP3HigAngED4DUwAD58fJSRlpIYExUe4uft4epgZ2NlYWZqYmRooK+ro6OtqamhrqaqqqKspKSoIC8vJysrIyMlJSkJADQjlG8=" +_palette_phase : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMTA2IDEgMSAzICMzMjkKeJwBPgHB/qissLO2uby/wsTHyczO0dPU1tjZ29zd3d7e3t7d3NvZ19XSz8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3+AVGBodHyIlJysvNDpARk5VXGRrc3uDi5OcpK22v8jR2+Xu+RkcHyEjJCQkIiAeHBoYFhQTExITFBUXGh0gJCgsMDU6PkNIm9UqlA==" +r. 256,1,1,3,3 round. +_palette_speed : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KNDkgMSAxIDMgIzE1OAp4nAGTAGz//fn28+/r5+Pf2tXOyMG5samgl46FfHJpYFZNQzoxKCAZEg4LCgwOEBMVFxgZGRkYF/rz7efh29bQy8bCvbm1sq6rqKWinpuYlZKOi4eDf3t3c25pZWBbVlFMSEI9ODMvKSTIvbKnnJCFeW5jWE1COS8nHxgRDAcFBQgLDxQYGx8iJScpKywsLCwrKiknJCIfGxgUF7w7kA==" r. 256,1,1,3,3 round. +_palette_tarn : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMTA1IDEgMSAzICMzMjYKeJwBOwHE/hcaHiEjJyktMDU8Q0lQV11kanF4f4aNk5uiqbG4v8XKzc/S1NbY2t3f4uPm6evu8PT2+vv8+/j08Ovn4tzWzsa+t6+ooJmSioR9dm5nX1dPRz84MSolIh8eHRwaGRcUExAOCwoICQsODyQoLTE1OT5CRklMT1JVWFpdYGNlZ2psb3F0dnl7fYCEiY6Ump+lq7C2vMHHzdLY3uTq7/T39vPu6eTf2tXRzcrGwr66trOvq6ekoJyZlpKOi4eDf3t3cm5qZGFcV1NOSkVBPTgzLikkIA0ODw8QDw8ODQwNEBETFhgbHR8hIyUnKisuMTQ3O0FIUlpia3N8hI2Vnqavt8DJ0dri6/H18uzj29HJwLewq6ikop+dm5mXlJKPjYuJh4WEgoF/fnx7enh2c3JvbWtpaGZkYmFfXVpVUfhNmgM=" r. 256,1,1,3,3 round. +_palette_tempo : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMTEyIDEgMSAzICMzNDcKeJwBUAGv/v369/Tx7uvn5OHe29fU0c3Kx8PAvLm1sq+rp6OgnJiVkI2JhYB9eHRwa2hjX1pVUUxIQz86NTEtKSUhHhsYFhMSEREQEBEREhMUFBUWFxcYGRkaGhsbGxscHBwcHBsbGxsbGhoaGRkZGBgXFxYWFRX08vDu7Oro5eTi4N7c2tjW1dPRz87MysnHxcPCwL+9u7q4t7W0srGvrqyqqaempKKhn52cmpiWlZKQj42KiYeEgoB+fHp4dXNxb21raWZkYmBeXFpXVVNRT01LSEZFQ0A+PDo4NjQxLy4rKSclIiAe8+/s6eXi3tvY1dLOy8jFwr+9ure0sa+sqqelo6CenJqYlpSSkY+OjIuKiIeGhYSDg4KBgYGAgH9/fn5+fXx8e3t6eXh4d3Z1dHNycXBvbm1samloZmVkY2FgX11cW1pYV1ZUU1JQT05MS0pIR0ZFRA7PoM4=" r. 256,1,1,3,3 round. +_palette_thermal : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMTA3IDEgMSAzICMzMjUKeJxjYWFhZWVj5+Ti4RcUkZBRUNUyMLWyd/HwCQiJiI5PSsvMyS8qq6ypb2rr7J0wefqseQuXrlizYfP2XfsOHj155vzla7fuPnj07MXrt+8/fv7y7fuPn79+/YaAX79+/vzx/dvXL58/fXz/7s2rF8qq6hpa2jp6+gaGRkbGYACkTMzMLaysbe0dnJxd3T28vH39/AODgkNCwyMio6JjY+MTEpOSU1LTMjKzcnLzC4pKyiqraxua2zp7JkyeNmveoqUr127cumPPgSMnzly4cuPOgycv3nz8+tPE0tbJ3ScwPCYpI6+0urGjb8qM2fPmz58/b+6c2bNmzpg2dcrkSRMn9Pf39fb2dHd1drS3tbY0NzXU11RXlpcWFeRlZ6QmJcREhgUH+nl7uLk6Odrb2dqAgK2tHdSlQIcGBoeGRwIArFub1Q==" r. 256,1,1,3,3 round. +_palette_topo : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjU2IDEgMSAzICM2OTEKeJxT19TS1tXTNzQyNjE1s7C0sraxtbWzt3dwcAQBBwc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Zo365tm9YuWzRv1rRJfV1tTXVVZc115cX52enJ8dHhwf7e7s6/P715/vDOtQtH9+3avnn9mhVPz+9cPLE61R/mf3h6gMY/AyMzCxs7hxyu+AcA2aYUlw==" +_palette_srb2 : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjU2IDEgMSAzICM0OTcKeJz7//398/vXzx/fv3398vnT+9vry/PT48P93e3N9dXlxfnZGcAS0/ra6kpzU2NDfJz3b169eDZIXXZ8sLe9sfZ/GIAYdBrG/fz0xul9G5dMh8ufX9+f76/P///19cPrZ7cXw4Tf3z+/f/38/vr8eH97fXn+/5+f3z69f/NyqIWh5QWZiVFB3s42prpqckD33Du+dmpNipcRAxT8/39///z6ePuXR+aWhzjqSV/dv2pqQ1Yo2Pkg+efH1vYUBxlKMKCB89vnt+eH26v/J+T/5QtmTOhsrCzKSooKBjrDuLo4Pzs5PjzY390ZqEZb+fXj25eB2neDgmVyd3P9uzund66Y3gZ2vK+rrRmG/2/vnl0d7awNcbY8uru2L+6vzo72t9dTV5AU4mZl+P/hwYUDGxZMaChICHAwUOD//+TE2knlUfZQb8vnQ/XB/P/x9eO7186f2D+3vzx+P1ABDv//h4c3If/3dzRUFILiwMvJ2lhbRdob6G9rc2N9bXVleWlxYf77l4/v3rx89uTm6uLs5Ohg/zs7p5eGmknCbXoP9TeMXxzurC8vzM5AwP8wvr+3m6ONuZGuhrKcpAg/F8uKKQ3ZES4Gsujx//nhud3Lm2NMYKENEgX5Hx78z89tndOSHeRvb64uz8/+Hxb/ADJVV38=" +_palette_uzebox : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjU2IDEgMSAzICM1Mwp4nGNQ8ciduO3Wf4aRSkOBChR4QEEuFEyEgm1QcAsK/kPBcNFPLgilEKyiEPynEAAA16V90A==" +_palette_amiga7800 : +base642img "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjU2IDEgMSAzICM1MzMKeJ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V1b1i5bMHNSD7r/+zqaasoKslLiIoJ83BysTG8cWjMN6HG4+9H9r62hpqKkICcjKS4qLMjPy43u//8fHl46vGXptI7KrGgfWz2FBXNnz5w+dfLEvp6ujraWpgYGTiFpFV0ze4/AqOSc0rq2A2tmthUnGDDgAuj+/48GXn/6icI/c+Hy9Vt3Hz558frdp68///zH8D+RABb//79/ePHw5qVTh3dvWTuxLNrh/7d3T+9eOXN496ZVC2dO6GhgEFQydglNK++YuWr3mbvv/qP7n6B6KHhx4QA4Cfy/v39+fby9PAOXsIyqnjlGeAIAmOWLbw==" +compress_palette : +N:=w +do +N-=1 ++r. $N,1,1,3,2 round. +ri. ..,3 round. +deltaE. .. +dEavg,dEmax="[ia,iM]" rm. +e "N = "$N", dEavg = "$dEavg", dEmax = "$dEmax +while $dEavg<0.75" && "$dEmax<1.25 +N+=1 +r $N,1,1,3,2 round. +e "" +img2base64 0,0 rm +str=\"${}\" +('$str') s. x,-119 ('\\\n') if $!>2 a[0--3] .,x fi rm. +i[0] ('" base642img \\\n"') +('"\n r. 256,1,1,3,3 round.\n"') +a x +ot pal.txt +#@cli premula +#@cli : Convert selected images with normal colors to premultiplied alpha colors. +#@cli : After conversion, alpha channel of resulting images has value in [0,1] range. +#@cli : See also: ''ipremula''. +premula : +e[^-1] "Convert image$? with normal colors to premultiplied alpha colors." +to_a foreach { +channels. 100% /. 255 sh.. 0,{s#0-2} *. .. k[0] } +#@cli pseudogray : _max_increment>=0,_JND_threshold>=0,_bits_depth>0 +#@cli : Generate pseudogray colormap with specified increment and perceptual threshold. +#@cli : If 'JND_threshold' is 0, no perceptual constraints are applied. +#@cli : Default values: 'max_increment=5', 'JND_threshold=2.3' and 'bits_depth=8'. +#@cli : $ pseudogray 5 +pseudogray : check "isint(${1=5}) && $1>=0 && ${2=2.3}>=0 && isint(${3=8}) && $3>0" +e[^-1] "Generate pseudogray colormap with increment $1, JND threshold $2 and $3 bits depth." +{round(2^$3)},1,1,3,'x' +if !$1 n. 0,255 return fi +{$1+1},{$1+1},{$1+1},1,"x" +f. "y" +f. "z" a[-3--1] c r. {w*h*d},1,1,3,-1 +f. "R = i(x,0,0,0); G = i(x,0,0,1); B = i(x,0,0,2); min(R,G,B)?-1:i" +permute. cxyz discard. -1 r. 3,{h/3},1,1,-1 permute. yzcx +r.. {w*100}% ri. ..,0,2 +[-2,-1] +f. "R = i(x,0,0,0); G = i(x,0,0,1); B = i(x,0,0,2); max(R,G,B)>2^$3-1?-1:i" +permute. cxyz discard. -1 r. 3,{h/3},1,1,-1 permute. yzcx +n. 0,255 ++srgb2lab. rv[-2,-1] a[-2,-1] y sort. +,x +if !$2 rows. 1 +else +s. y rv[-2,-1] . sh. 1,2 f. 0 rm. -[-2,-1] norm. +<=. $2 *. 'x+1' discard. 0 -. 1 map. .. rm.. +repeat 10000 { ++srgb2lab. +shift. 0,{1-2*($>%2)},0,0,1 -[-2,-1] norm. +<=. $2 +if im rm. break fi +*. 'y+1' discard. 0 -. 1 map. .. rm.. +} +transpose. +fi +=> pseudogray$1 +#@cli random_clut +#@cli : Generate a 33x33x33 random 3D color LUT. +#@cli : $ image.jpg random_clut +map_clut.. . +#@cli random_clut : _seed = { >=0 | -1 } +#@cli : Generate a 33x33x33 random 3D color LUT. +#@cli : If specified 'seed' is positive, it is used as a seed for the random number generator @cli : (so that using the same seed will return the same CLUT). +#@cli : $ image.jpg random_clut +map_clut.. . ++random_clut : l[] { check "isint(${1=-1}) && $1>=-1" seed=$1 onfail seed=-1 noarg } +e[^-1] "Generate a random 3D color LUT." +if $seed>=0 srand $seed fi +1,1,1,3 +1,8,1,1,"u<0.75 || !y?da_push(255*[ y&1, (y>>1)&1, (y>>2)&1 ])" rm. +1,{round(u(2,12))},1,1," +do ( +RGB = u([255,255,255]); +dmin = inf; +for (p = 0, p70?(da_push(RGB); break()); +1)" rm. +da_freeze. +rgb2hsl. mirror. c sort. +,y mirror. c ++f. "begin(Lmax = 0); +H = i0; S = i1; L = i2; +u<0.5?( +do ( +nH = (H + 30*g)%360; +nS = cut(S + g/4,0,1); +nL = cut(L + g/8,0,1), +_(while) nL=0,smoothness[%]>=0,src1,src2,...,dest1,dest2,... +#@cli : Replace pixels from/to specified colors in selected images. +#@cli : $ image.jpg +replace_color 40,3,204,153,110,255,0,0 +replace_color : check "$1>=0 && $2>=0" +l[] { (${3--1}) y c s c,2 col1={0,^} col2={1,^} rm } +e[^-1] "Replace color ("$col1") by color ("$col2") in image$?, with tolerance $1 and smoothness $2." +foreach { +1,1,1,100%,$col1 ri[1] [0] +if $1 -[1] [0] norm[1] <=[1] $1 else ==[1] [0] l[1] { s c & } fi +b[1] $2 +1,1,1,{0,s},$col2 ri[2] [0] j[0] [2],0,0,0,0,1,[1] k[0] +} +#@cli retinex : _value_offset>0,_colorspace={ hsi | hsv | lab | lrgb | rgb | ycbcr },0<=_min_cut<=100,0<=_max_cut<=100,_sigma_low>0,_sigma_mid>0,_sigma_high>0 +#@cli : Apply multi-scale retinex algorithm on selected images to improve color consistency. +#@cli : (as described in the page ). +#@cli : Default values: 'offset=1', 'colorspace=hsv', 'min_cut=1', 'max_cut=1', 'sigma_low=15','sigma_mid=80' and 'sigma_high=250'. +retinex : check "${1=5}>0 && ${3=1}>=0 && $3<=100 && ${4=1}>=0 && $4<=100 && ${5=15}>0 && ${6=80}>0 && ${7=250}>0" +skip "${2=hsv}" +e[^-1] "Apply Retinex color consistency algorithm on image$?, with value offset $1, colorspace '$2', cuts ($3,$4) +and sigmas (${5-7})." +if ['$2']=='hsi' mode=hsi_i +elif ['$2']=='hsv' mode=hsv_v +elif ['$2']=='lab' mode=lab_l +elif ['$2']=='rgb' mode=rgb +elif ['$2']=='lrgb' mode=lrgb +elif ['$2']=='ycbcr' mode=ycbcr_y +else error[0--2] "Command '$0': Invalid colorspace argument '$2'." +fi +ac "_retinex $1,${3--1}",$mode +_retinex : +- {im-$1} {[w,h,d,s]},1 +repeat 3 { +b[0] {arg(1+$>,${4-6})} +/[0,-1] rm.. *[1,-1] } +rm[0] log c $2%,{100-$3}% n 0,255 +#@cli rgb2bayer : _start_pattern=0,_color_grid=0 +#@cli : Transform selected color images to RGB-Bayer sampled images. +#@cli : Default values: 'start_pattern=0' and 'color_grid=0'. +#@cli : $ image.jpg +rgb2bayer 0 +rgb2bayer : skip ${1=0},${2=0} +e[^-1] "Transform image$? to a RGB-Bayer "${arg0\ !$2,color,monochrome}" grid, starting from pattern '$1'." +to_rgb foreach { _rgb2bayer$1 ri[1] [0],0,2 * if !$2 s c + fi } +_rgb2bayer0 : (1,0;0,0^0,1;1,0^0,0;0,1) +_rgb2bayer1 : (0,0;0,1^0,1;1,0^1,0;0,0) +_rgb2bayer2 : (0,1;0,0^1,0;0,1^0,0;1,0) +_rgb2bayer3 : (0,0;1,0^1,0;0,1^0,1;0,0) +#@cli rgb2cmy +#@cli : Convert color representation of selected images from RGB to CMY. +#@cli : $ image.jpg rgb2cmy split c +rgb2cmy : +e[^-1] "Convert color representation of image$? from RGB to CMY." +to_rgb * -1 + 255 c 0,255 +#@cli rgb2cmyk +#@cli : Convert color representation of selected images from RGB to CMYK. +#@cli : $ image.jpg rgb2cmyk split c +#@cli : $ image.jpg rgb2cmyk split c fill[3] 0 append c cmyk2rgb +rgb2cmyk : +e[^-1] "Convert color representation of image$? from RGB to CMYK." +rgb2cmy foreach { s c +min -[0-2] . +/. 255 -. 1 *. -1 +==. 0 +[-2,-1] /[0-2] . rm. a c } +#@cli rgb2hcy +#@cli : Convert color representation of selected images from RGB to HCY. +#@cli : $ image.jpg rgb2hcy split c +rgb2hcy : +e[^-1] "Convert color representation of image$? from RGB to HCY." +to_color f " +M = max(R,G,B); +C = M - min(R,G,B); +H = 60*(!C?0:M==R?((G-B)/C)%6:M==G?(B-R)/C+2:(R-G)/C+4); +Y = 0.299*R + 0.587*G + 0.114*B; +[ H,C/255,Y/255 ]" +#@cli rgb2hsi +#@cli : Convert color representation of selected images from RGB to HSI. +#@cli : $ image.jpg rgb2hsi split c +rgb2hsi : +e[^-1] "Convert color representation of image$? from RGB to HSI." +to_color +f " +m = min(R,G,B); +M = max(R,G,B); +C = M - m; +sum = R + G + B; +H = 60*(!C?0:M==R?((G - B)/C)%6:M==G?(B - R)/C + 2:(R - G)/C + 4); +S = sum<=0?0:1 - 3*m/sum; +I = sum/(3*255); +[ H, S, I ]" +#@cli rgb2hsi8 +#@cli : Convert color representation of selected images from RGB to HSI8. +#@cli : $ image.jpg rgb2hsi8 split c +rgb2hsi8 : +e[^-1] "Convert color representation of image$? from RGB to HSI8." +rgb2hsi _rgb2hsx8 +#@cli rgb2hsl +#@cli : Convert color representation of selected images from RGB to HSL. +#@cli : $ image.jpg rgb2hsl split c +#@cli : $ image.jpg rgb2hsl +split c add[-3] 100 mod[-3] 360 append[-3--1] c hsl2rgb +rgb2hsl : +e[^-1] "Convert color representation of image$? from RGB to HSL." +to_color +f " +m = min(R,G,B); +M = max(R,G,B); +C = M - m; +H = 60*(!C?0:M==R?((G - B)/C)%6:M==G?(B - R)/C + 2:(R - G)/C + 4); +L = 0.5*(m + M)/255; +S = L==1 || !L?0:C/(1 - abs(2*L - 1))/255; +[ H, S, L ]" +#@cli rgb2hsl8 +#@cli : Convert color representation of selected images from RGB to HSL8. +#@cli : $ image.jpg rgb2hsl8 split c +rgb2hsl8 : +e[^-1] "Convert color representation of image$? from RGB to HSL8." +rgb2hsl _rgb2hsx8 +#@cli rgb2hsv +#@cli : Convert color representation of selected images from RGB to HSV. +#@cli : $ image.jpg rgb2hsv split c +#@cli : $ image.jpg rgb2hsv +split c add[-2] 0.3 cut[-2] 0,1 append[-3--1] c hsv2rgb +rgb2hsv : +e[^-1] "Convert color representation of image$? from RGB to HSV." +to_color +f " +M = max(R,G,B); +C = M - min(R,G,B); +H = 60*(!C?0:M==R?((G - B)/C)%6:M==G?(B - R)/C + 2:(R - G)/C + 4); +S = M<=0?0:C/M; +[ H, S, M/255 ]" +#@cli rgb2hsv8 +#@cli : Convert color representation of selected images from RGB to HSV8. +#@cli : $ image.jpg rgb2hsv8 split c +rgb2hsv8 : +e[^-1] "Convert color representation of image$? from RGB to HSV8." +rgb2hsv _rgb2hsx8 +_rgb2hsx8 : +foreach { +sh[0] 0 *. 0.708333 rm. +sh[0] 1,2 *. 255 rm. +} +#@cli rgb2int +#@cli : Convert color representation of selected images from RGB to INT24 scalars. +#@cli : $ image.jpg rgb2int +rgb2int : +e[^-1] "Convert color representation of image$? from RGB to INT24 scalars." +to_rgb round foreach { s c <<[0] 16 <<[1] 8 + } +#@cli rgb2jzazbz : illuminant={ 0:D50 | 1:D65 | 2:E } : (no arg) +#@cli : Convert color representation of selected images from RGB to Jzazbz. +#@cli : Default value: 'illuminant=2'. +rgb2jzazbz : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from RGB to Jzazbz, using the "${arg0\ $illu,D50,D65,E}" illuminant." +rgb2xyz $illu xyz2jzazbz +#@cli rgb2lab : illuminant={ 0:D50 | 1:D65 | 2:E } : (no arg) +#@cli : Convert color representation of selected images from RGB to Lab. +#@cli : Default value: 'illuminant=2'. +rgb2lab : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from RGB to Lab, using the "${arg0\ $illu,D50,D65,E}" illuminant." +rgb2xyz $illu xyz2lab $illu +#@cli rgb2lab8 : illuminant={ 0:D50 | 1:D65 | 2:E } : (no arg) +#@cli : Convert color representation of selected images from RGB to Lab8. +#@cli : Default value: 'illuminant=2'. +#@cli : $ image.jpg rgb2lab8 split c +rgb2lab8 : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from RGB to Lab8, using the "${arg0\ $illu,D50,D65,E}" illuminant." +rgb2lab $illu +foreach { +sh[0] 0 *. 2.55 rm. +sh[0] 1 +. 127 *. 0.85 rm. +sh[0] 2 +. 149 *. 0.836 rm. +} +c 0,255 +#@cli rgb2lch : illuminant={ 0:D50 | 1:D65 | 2:E } : (no arg) +#@cli : Convert color representation of selected images from RGB to Lch. +#@cli : Default value: 'illuminant=2'. +#@cli : $ image.jpg rgb2lch split c +rgb2lch : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from RGB to Lch, using the "${arg0\ $illu,D50,D65,E}" illuminant." +rgb2lab $illu lab2lch +#@cli rgb2lch8 : illuminant={ 0:D50 | 1:D65 | 2:E } : (no arg) +#@cli : Convert color representation of selected images from RGB to Lch8. +#@cli : Default value: 'illuminant=2'. +#@cli : $ image.jpg rgb2lch8 split c +rgb2lch8 : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from RGB to Lch8, using the "${arg0\ $illu,D50,D65,E}" illuminant." +pi,facth:=[pi,255/(2*pi)] +rgb2lch $illu +foreach { +sh[0] 0 *. 2.55 rm. +sh[0] 1 *. 1.1086 rm. +sh[0] 2 +. $pi *. $facth rm. +} +c 0,255 +#@cli rgb2luv +#@cli : Convert color representation of selected images from RGB to LUV. +#@cli : $ image.jpg rgb2luv split c +rgb2luv : +e[^-1] "Convert color representation of image$? from RGB to LUV." +foreach { ++rgb2xyz rgb2lab.. channels.. 0 s. c +*. 3 +*.. 15 +[-2,-1] +. ... +. 1e-8 +*... 4 *.. 9 /[-3,-2] . rm. +-.. 0.2009 -. 0.4610 ++*... 13 *... . *[-2,-1] a c +} +#@cli rgb2oklab +#@cli : Convert color representation of selected images from RGB to Oklab. +#@cli : (see colorspace definition at: ). +#@cli : See also: ''oklab2rgb''. +rgb2oklab : +e[^-1] "Convert color representation of image$? from RGB to Oklab." +foreach { +split_opacity to_rgb[0] /[0] 255 +f[0] " +l = cbrt(0.4121656120*R + 0.5362752080*G + 0.0514575653*B); +m = cbrt(0.2118591070*R + 0.6807189584*G + 0.1074065790*B); +s = cbrt(0.0883097947*R + 0.2818474174*G + 0.6302613616*B); +[ 0.2104542553*l + 0.7936177850*m - 0.0040720468*s, +1.9779984951*l - 2.4285922050*m + 0.4505937099*s, +0.0259040371*l + 0.7827717662*m - 0.8086757660*s ]" +a c +} +#@cli rgb2ryb +#@cli : Convert color representation of selected images from RGB to RYB. +#@cli : $ image.jpg rgb2ryb split c +rgb2ryb : +e[^-1] "Convert color representation of image$? from RGB to RYB." +to_color +f "red = R; +green = G; +blue = B; +white = min(red,green,blue); +red-=white; +green-=white; +blue-=white; +maxgreen = max(red,green,blue); +yellow = min(red,green); +red-=yellow; +green-=yellow; +blue>0 && green>0?(blue/=2; green/=2); +yellow+=green; +blue+=green; +maxyellow = max(red,yellow,blue); +maxyellow>0?( +N = maxgreen/maxyellow; +red*=N; +yellow*=N; +blue*=N; +); +red+=white; +yellow+=white; +blue+=white; +[ red,yellow,blue ]" +#@cli rgb2srgb +#@cli : Convert color representation of selected images from linear RGB to sRGB. +rgb2srgb : +e[^-1] "Convert color representation of image$? from linear RGB to sRGB." +f "val = i/255; sval = val<=0.0031308?val*12.92:1.055*val^0.416667 - 0.055; cut(255*sval,0,255)" +#@cli rgb2xyz : illuminant={ 0:D50 | 1:D65 | 2:E } : (no arg) +#@cli : Convert color representation of selected images from RGB to XYZ. +#@cli : Default value: 'illuminant=2'. +#@cli : $ image.jpg rgb2xyz split c +rgb2xyz : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from RGB to XYZ, using the "${arg0\ $illu,D50,D65,E}" illuminant." +if $illu==2 +mix_rgb {[0.488718,0.3106803,0.2006017,0.1762044,0.8129847,0.0108109,0,0.0102048,0.9897952]/255} +elif $illu==1 +mix_rgb {[0.4124564,0.3575761,0.1804375,0.2126729,0.7151522,0.0721750,0.0193339,0.1191920,0.9503041]/255} +else +mix_rgb {[0.43603516,0.38511658,0.14305115,0.22248840,0.71690369,0.06060791,0.01391602,0.09706116,0.71392822]/255} +fi +#@cli rgb2xyz8 : illuminant={ 0:D50 | 1:D65 | 2:E } : (no arg) +#@cli : Convert color representation of selected images from RGB to XYZ8. +#@cli : Default value: 'illuminant=2'. +#@cli : $ image.jpg rgb2xyz8 split c +rgb2xyz8 : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from RGB to XYZ8, using the "${arg0\ $illu,D50,D65,E}" illuminant." +rgb2xyz $illu +foreach { +sh[0] 0 *. 255 rm. +sh[0] 1 *. 255 rm. +sh[0] 2 *. 231.8182 rm. +} +#@cli rgb2yiq +#@cli : Convert color representation of selected images from RGB to YIQ. +#@cli : $ image.jpg rgb2yiq split c +rgb2yiq : +e[^-1] "Convert color representation of image$? from RGB to YIQ." +mix_rgb 0.299,0.587,0.114,0.595716,-0.274453,-0.321263,0.211456,-0.522591,0.311135 +#@cli rgb2yiq8 +#@cli : Convert color representation of selected images from RGB to YIQ8. +#@cli : $ image.jpg rgb2yiq8 split c +rgb2yiq8 : +e[^-1] "Convert color representation of image$? from RGB to YIQ." +rgb2yiq +foreach { +sh[0] 1 +. 151.908 *. 0.8393238012481239 rm. +sh[0] 2 +. 133.261 *. 0.9567690472081104 rm. +} +#@cli rgb2ycbcr +#@cli : Convert color representation of selected images from RGB to YCbCr. +#@cli : $ image.jpg rgb2ycbcr split c +rgb2ycbcr : +e[^-1] "Convert color representation of image$? from RGB to YCbCr." +mix_rgb 66,129,25,-38,-74,112,112,-94,-18 +foreach { +sh[0] 0,2 +. 128 /. 256 rm. +sh[0] 0 +. 16 rm. +sh[0] 1,2 +. 128 rm. +} +#@cli rgb2yuv +#@cli : Convert color representation of selected images from RGB to YUV. +#@cli : $ image.jpg rgb2yuv split c +rgb2yuv : +e[^-1] "Convert color representation of image$? from RGB to YUV." +mix_rgb {[0.299,0.587,0.114,-0.14713,-0.28886,0.436,0.615,-0.51498,-0.10001]/255} +#@cli rgb2yuv8 +#@cli : Convert color representation of selected images from RGB to YUV8. +#@cli : $ image.jpg rgb2yuv8 split c +rgb2yuv8 : +e[^-1] "Convert color representation of image$? from RGB to YUV8." +rgb2yuv +foreach { +sh[0] 0 *. 255 rm. +sh[0] 1 +. 0.44 *. 289.773 rm. +sh[0] 2 +. 0.62 *. 205.645 rm. +} +#@cli remove_opacity +#@cli : Remove opacity channel of selected images. +remove_opacity : +e[^-1] "Remove opacity channel of image$?." +foreach { +if !s||s>4 error[0--5] "Command '$0': Image ["$>"] is not a G,GA,RGB or RGBA image ("{s}" channels)." +elif s==2 channels 0 +elif s==4 channels 0,2 +fi +} +#@cli ryb2rgb +#@cli : Convert color representation of selected images from RYB to RGB. +ryb2rgb : +e[^-1] "Convert color representation of image$? from RYB to RGB." +to_color +f "red = R; +yellow = G; +blue = B; +white = min(red,yellow,blue); +red-=white; +yellow-=white; +blue-=white; +maxyellow = max(red,yellow,blue); +green = min(yellow,blue); +yellow-=green; +blue-=green; +blue>0 && green>0?(blue*=2; green*=2); +red+=yellow; +green+=yellow; +maxgreen = max(red,green,blue); +maxgreen>0?( +N = maxyellow/maxgreen; +red*=N; +green*=N; +blue*=N; +); +red+=white; +green+=white; +blue+=white; +[ red,green,blue ]" +#@cli select_color : tolerance[%]>=0,col1,...,colN +#@cli : Select pixels with specified color in selected images. +#@cli : $ image.jpg +select_color 40,204,153,110 +#@cli : $$ https://gmic.eu/oldtutorial/_select_color +select_color : skip ${1=0} +e[^-1] "Select color (${2--1}) in image$?, with tolerance $1." +foreach { +fc ${2--1} - norm <= $1 } +#@cli sepia +#@cli : Apply sepia tones effect on selected images. +#@cli : $ image.jpg sepia +sepia : +e[^-1] "Apply sepia tones effect on image$?." +(0,44,115,143,196,244^0,20,84,119,184,235^0,5,44,73,144,200) r. 256,1,1,3,3 +foreach[^-1] { pass. split_opacity[0] luminance[0] map[0] . rm. a c } +rm. +#@cli solarize +#@cli : Solarize selected images. +#@cli : $ image.jpg solarize +solarize : +e[^-1] "Solarize image$?." +luminance n 0,128 map 1 +#@cli split_colors : _tolerance>=0,_max_nb_outputs>0,_min_area>0 +#@cli : Split selected images as several image containing a single color. +#@cli : One selected image can be split as at most 'max_nb_outputs' images. +#@cli : Output images are sorted by decreasing area of extracted color regions and have an additional alpha-channel. +#@cli : Default values: 'tolerance=0', 'max_nb_outputs=256' and 'min_area=8'. +#@cli : $ image.jpg quantize 5 +split_colors , display_rgba +split_colors : check "${1=0}>=0 && isint(${2=256}) && $2>0 && ${3=8}>=1" +e[^-1] "Split image$? as single color outputs, with tolerance $1, $2 maximal outputs and minimal color area $3." +foreach { ++label 0,1 norm. area. 0,1 +repeat $2-1 { +coordsM={1,[xM,yM,zM,cM]} +if {1,i($coordsM)<$3} break fi +color={0,I($coordsM)} ++select_color[0] $1,$color +==. 0 *[1] . ==. 0 +} +if iM#1 !=[1] 0 mv[1] $! # Residual mask, if any. +else rm[1] fi +r[^0] [0],[0],[0],{0,s+1} +N:=$!-1 +sh[^0] 0,{s-2} *[-$N--1] [0] rm[-$N--1] +sh[^0] 100% *[-$N--1] 255 rm[0,-$N--1] +} +#@cli split_opacity +#@cli : Split color and opacity parts of selected images. +#@cli : This command returns 1 or 2 images for each selected image, whether it has an opacity channel or not. +split_opacity : +e[^-1] "Split color and opacity parts of image$?." +foreach { s c,{s==4?-3:s==2?-1:-s} } +#@cli srgb2lab : illuminant={ 0:D50 | 1:D65 | 2:E } : (no arg) +#@cli : Convert color representation of selected images from sRGB to Lab. +#@cli : Default value: 'illuminant=2'. +#@cli : $ image.jpg srgb2lab split c +#@cli : $ image.jpg srgb2lab +split c mul[-2,-1] 2.5 append[-3--1] c lab2srgb +srgb2lab : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from sRGB to Lab, using the "${arg0\ $illu,D50,D65,E}" illuminant." +srgb2rgb rgb2lab $illu +#@cli srgb2lab8 : illuminant={ 0:D50 | 1:D65 | 2:E } : (no arg) +#@cli : Convert color representation of selected images from sRGB to Lab8. +#@cli : Default value: 'illuminant=2'. +srgb2lab8 : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from sRGB to Lab8, using the "${arg0\ $illu,D50,D65,E}" illuminant." +srgb2rgb rgb2lab8 $illu +#@cli srgb2rgb +#@cli : Convert color representation of selected images from sRGB to linear RGB. +srgb2rgb : +e[^-1] "Convert color representation of image$? from sRGB to linear RGB." +f "sval = i/255; val = sval<=0.04045?sval/12.92:((sval + 0.055)/(1.055))^2.4; cut(255*val,0,255)" +#@cli to_a +#@cli : Force selected images to have an alpha channel. +to_a : +e[^-1] "Force image$? to have an alpha channel." +foreach { +if !s||s>4 error[0--5] "Command '$0': Image ["$>"] is not a G,GA,RGB or RGBA image ("{s}" channels)." +elif s==1||s==3 channels 0,{s} sh. {s-1} f. 255 rm. fi +} +#@cli to_color +#@cli : Force selected images to be in color mode (RGB or RGBA). +to_color : +e[^-1] "Force image$? to be in color mode." +foreach { +if !s||s>4 error[0--5] "Command '$0': Image ["$>"] is not a G,GA,RGB or RGBA image ("{s}" channels)." +elif s==2 r 100%,100%,1,4,0,1,0,0,0,1 +elif s==1 r 100%,100%,1,3,1 +fi +} +#@cli to_colormode : mode={ 0:adaptive | 1:G | 2:GA | 3:RGB | 4:RGBA } +#@cli : Force selected images to be in a given color mode. +#@cli : Default value: 'mode=0'. +to_colormode : check "isint(${1=0}) && inrange($1,0,4)" +s,err:="$1?[ $1,$1 ]:(rgb = a = e = 0; repeat (l,k,rgb|=s#k>=3; a|=!(s#k%2); e|=!s#k||s#k>4); [ (rgb?3:1) + a,e ])" +if $err foreach { +if !s||s>4 error[0--5] "Command '$0': Image ["$>"] is not a G,GA,RGB or RGBA image ("{s}" channels)." fi +} fi +ss=${"arg "$s",gray,graya,rgb,rgba"} +e[^-1] "Force image$? to be in "{`uppercase(['$ss'])`}" mode." +to_$ss +#@cli to_gray +#@cli : Force selected images to be in GRAY mode. +#@cli : $ image.jpg +to_gray +to_gray : +e[^-1] "Force image$? to be in GRAY mode." +foreach { +if !s||s>4 error[0--5] "Command '$0': Image ["$>"] is not a G,GA,RGB or RGBA image ("{s}" channels)." +elif s>=3 luminance +elif s==2 channels 0 +fi +} +#@cli to_graya +#@cli : Force selected images to be in GRAYA mode. +to_graya : +e[^-1] "Force image$? to be in GRAYA mode." +foreach { +if !s||s>4 error[0--5] "Command '$0': Image ["$>"] is not a G,GA,RGB or RGBA image ("{s}" channels)." +elif s==4 s c,-3 luminance.. a c +elif s==3 luminance channels 0,1 sh. 1 f. 255 rm. +elif s==1 channels 0,1 sh. 1 f. 255 rm. +fi +} +#@cli to_pseudogray : _max_step>=0,_is_perceptual_constraint={ 0 | 1 },_bits_depth>0 +#@cli : Convert selected scalar images ([0-255]-valued) to pseudo-gray color images. +#@cli : Default values: 'max_step=5', 'is_perceptual_constraint=1' and 'bits_depth=8'. +#@cli : The original pseudo-gray technique has been introduced by Rich Franzen . +#@cli : Extension of this technique to arbitrary increments for more tones, has been done by David Tschumperlé. +to_pseudogray : check "isint(${1=5}) && $1>=0 && isint(${3=8}) && $3>0" skip ${2=1} +e[^-1] "Convert scalar image$? to pseudo-gray color images, with steps $1." +channels 0 srgb2rgb pseudogray $1,{2.3*$2},$3 ++srgb2lab. channels. 0 *. {65535/100} round. rows. 0,2 +rv[-2,-1] permute. xcyz +. 1 a[-2,-1] y pointcloud. 0 ++norm. !=. 0 distance. 1 *. -1 watershed.. . rm. -. 1 +repeat $!-1 { +to_rgb[$>] rgb2lab[$>] channels[$>] 0 *[$>] {65535/100} round[$>] c[$>] 0,65535 +map[$>] . +} rm. +#@cli to_rgb +#@cli : Force selected images to be in RGB mode. +to_rgb : +e[^-1] "Force image$? to be in RGB mode." +foreach { +if !s||s>4 error[0--5] "Command '$0': Image ["$>"] is not a G,GA,RGB or RGBA image ("{s}" channels)." +elif s==4 channels 0,2 +elif s==2 channels 0 r 100%,100%,100%,3 +elif s==1 r 100%,100%,100%,3 +fi +} +#@cli to_rgba +#@cli : Force selected images to be in RGBA mode. +to_rgba : +e[^-1] "Force image$? to be in RGBA mode." +foreach { +if !s||s>4 error[0--5] "Command '$0': Image ["$>"] is not a G,GA,RGB or RGBA image ("{s}" channels)." +elif s==3 channels 0,3 sh. 3 f. 255 rm. +elif s==2 r 100%,100%,100%,4,0,1,0,0,0,1 +elif s==1 r 100%,100%,100%,4 sh. 3 f. 255 rm. +fi +} +#@cli to_automode +#@cli : Force selected images to be in the most significant color mode. +#@cli : This commands checks for useless alpha channel (all values equal to 255), as well as +#@cli : detects grayscale images encoded as color images. +to_automode : +e[^-1] "Force image$? to be in most significant color mode." +foreach { +if s==2||s==4 +sh 100% +if im==iM" && "im==255 rm. channels 0,{s-2} else rm. fi +fi +if s==3||s==4 +eval. "begin(is_gray = 1); is_gray && (i0!=i1 || i0!=i2)?(is_gray = 0); +end(merge(is_gray,&&); set('is_gray',is_gray))" +if $is_gray s c,-3 channels[0] 0 a c fi +fi +} +#@cli xyz2jzazbz +#@cli : Convert color representation of selected images from XYZ to RGB. +xyz2jzazbz : +e[^-1] "Convert color representation of image$? from XYZ to Jzazbz." +foreach { split_opacity +f[0] ${-_jzazbz_const}" +X = i0*255; +Y = i1*255; +Z = i2*255; +Xp = Jzazbz_b*X - (Jzazbz_b - 1)*Z; +Yp = Jzazbz_g*Y - (Jzazbz_g - 1)*X; +Zp = Z; +L = 0.41478972*Xp + 0.579999*Yp + 0.0146480*Zp; +M = -0.2015100*Xp + 1.120649*Yp + 0.0531008*Zp; +S = -0.0166008*Xp + 0.264800*Yp + 0.6684799*Zp; +tmp = (L/peakLum)^Jzazbz_n; +Lp = ((Jzazbz_c1 + Jzazbz_c2*tmp)/(1 + Jzazbz_c3*tmp))^Jzazbz_p; +tmp = (M/peakLum)^Jzazbz_n; +Mp = ((Jzazbz_c1 + Jzazbz_c2*tmp)/(1 + Jzazbz_c3*tmp))^Jzazbz_p; +tmp = (S/peakLum)^Jzazbz_n; +Sp = ((Jzazbz_c1 + Jzazbz_c2*tmp)/(1 + Jzazbz_c3*tmp))^Jzazbz_p; +Iz = 0.5*Lp + 0.5*Mp; +az = 3.52400*Lp - 4.066708*Mp + 0.542708*Sp; +bz = 0.199076*Lp + 1.096799*Mp - 1.295875*Sp; +Jz = (1 + Jzazbz_d)*Iz/(1 + Jzazbz_d*Iz) - Jzazbz_d0; +[ Jz,az,bz ]" +a c } +#@cli xyz2lab : illuminant={ 0:D50 | 1:D65 | 2:E } : (no arg) +#@cli : Convert color representation of selected images from XYZ to Lab. +#@cli : Default value: 'illuminant=2'. +xyz2lab : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from XYZ to Lab, using the "${arg0\ $illu,D50,D65,E}" illuminant." +to_color +f " +begin( +const epsilon = 216/24389; +const kappa = 24389/27; +lab(x) = (x>epsilon?cbrt(x):(x*kappa + 16)/116); +D65 = [ 0.4124564, 0.3575761, 0.1804375, +0.2126729, 0.7151522, 0.0721750, +0.0193339, 0.1191920, 0.9503041 ]; +D50 = [ 0.43603516, 0.38511658, 0.14305115, +0.22248840, 0.71690369, 0.06060791, +0.01391602, 0.09706116, 0.71392822 ]; +E = [ 0.488718,0.3106803,0.2006017, +0.1762044,0.8129847,0.0108109, +0,0.0102048,0.9897952 ]; +white = ("$illu"==2?E:"$illu"==1?D65:D50)*[ 1,1,1 ]; +); +xr = i0/white[0]; +yr = i1/white[1]; +zr = i2/white[2]; +fx = lab(xr); +fy = lab(yr); +fz = lab(zr); +[ cut(116*fy - 16,0,100), 500*(fx - fy), 200*(fy - fz) ]" +#@cli xyz2rgb : illuminant={ 0:D50 | 1:D65 | 2:E } : (no arg) +#@cli : Convert color representation of selected images from XYZ to RGB. +#@cli : Default value: 'illuminant=2'. +xyz2rgb : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from XYZ to RGB, using the "${arg0\ $illu,D50,D65,E}" illuminant." +if $illu==2 +mix_rgb {[2.3706743,-0.9000405,-0.4706338,-0.513885,1.4253036,0.0885814,0.0052982,-0.0146949,1.0093968]*255} +elif $illu +mix_rgb {[3.2404542,-1.5371385,-0.4985314,-0.9692660,1.8760108,0.0415560,0.0556434,-0.2040259,1.0572252]*255} +else +mix_rgb {[3.134274799724,-1.617275708956,-0.490724283042,-0.978795575994,1.916161689117,0.033453331711,0.071976988401,-0.228984974402,1.405718224383]*255} +fi +c 0,255 +#@cli xyz82rgb : illuminant={ 0:D50 | 1:D65 | 2:E } : (no arg) +#@cli : Convert color representation of selected images from XYZ8 to RGB. +#@cli : Default value: 'illuminant=2'. +xyz82rgb : skip "${1=,}" +l[] { if isnum("$1") illu:="$1>1?2:$1>0" else if ["'$1'"]!=',' noarg fi illu=2 fi onfail noarg illu=2 } +e[^-1] "Convert color representation of image$? from XYZ8 to RGB, using the "${arg0\ $illu,D50,D65,E}" illuminant." +foreach { +sh[0] 0 /. 255 rm. +sh[0] 1 /. 255 rm. +sh[0] 2 /. 231.8182 rm. +} +xyz2rgb $illu +#@cli ycbcr2rgb +#@cli : Convert color representation of selected images from YCbCr to RGB. +ycbcr2rgb : +e[^-1] "Convert color representation of image$? from YCbCr to RGB." +foreach { +sh[0] 0 -. 16 rm. +sh[0] 1,2 -. 128 rm. +sh[0] 0,2 mix_rgb. 298,0,409,298,-100,-208,298,516,0 ++. 128 /. 256 c. 0,255 rm. +} +#@cli yiq2rgb +#@cli : Convert color representation of selected images from YIQ to RGB. +yiq2rgb : +e[^-1] "Convert color representation of image$? from YIQ to RGB." +mix_rgb 1,0.9563,0.6210,1,-0.2721,-0.6474,1,-1.1070,1.7046 +c 0,255 +#@cli yiq82rgb +#@cli : Convert color representation of selected images from YIQ8 to RGB. +yiq82rgb : +e[^-1] "Convert color representation of image$? from YIQ8 to RGB." +foreach { +sh[0] 1 /. 0.8393238012481239 -. 151.908 rm. +sh[0] 2 /. 0.9567690472081104 -. 133.261 rm. +} +mix_rgb 1,0.9563,0.6210,1,-0.2721,-0.6474,1,-1.1070,1.7046 +c 0,255 +#@cli yuv2rgb +#@cli : Convert color representation of selected images from YUV to RGB. +yuv2rgb : +e[^-1] "Convert color representation of image$? from YUV to RGB." +mix_rgb {[1,0,1.13983,1,-0.39465,-0.5806,1,2.03211,0]*255} +c 0,255 +#@cli yuv82rgb +#@cli : Convert selected images from YUV8 to RGB color bases. +yuv82rgb : +e[^-1] "Convert color representation of image$? from YUV8 to RGB." +foreach { +sh[0] 0 /. 255 rm. +sh[0] 1 /. 289.773 -. 0.44 rm. +sh[0] 2 /. 205.645 -. 0.62 rm. +} yuv2rgb +#@cli :: Geometry Manipulation +#@cli a : eq. to 'append' : (+) +#@cli append : [image],axis,_centering : axis,_centering : (+) +#@cli : Append specified image to selected images, or all selected images together, along specified axis. +#@cli : (eq. to 'a').\n +#@cli : 'axis' can be { x | y | z | c }. +#@cli : Usual 'centering' values are { 0:left-justified | 0.5:centered | 1:right-justified }. +#@cli : Default value: 'centering=0'. +#@cli : $ image.jpg split y,10 reverse append y +#@cli : $ image.jpg repeat 5 { +rows[0] 0,{10+18*$>}% } remove[0] append x,0.5 +#@cli : $ image.jpg append[0] [0],y +#@cli append_tiles : _M>=0,_N>=0,0<=_centering_x<=1,0<=_centering_y<=1 +#@cli : Append MxN selected tiles as new images. +#@cli : If 'N' is set to 0, number of rows is estimated automatically. +#@cli : If 'M' is set to 0, number of columns is estimated automatically. +#@cli : If 'M' and 'N' are both set to '0', auto-mode is used. +#@cli : If 'M' or 'N' is set to 0, only a single image is produced. +#@cli : 'centering_x' and 'centering_y' tells about the centering of tiles when they have different sizes. +#@cli : Default values: 'M=0', 'N=0', 'centering_x=centering_y=0.5'. +#@cli : $ image.jpg split xy,4 append_tiles , +append_tiles : check "isint(${1=0}) && isint(${2=0}) && ${3=0}>=0 && $3<=1 && ${4=$3}>=0 && $4<=1" +if !$! +e[0--3] "Append image$? as a 0x0-tiled image." +return +elif !$1" && "!$2 +N:=int(sqrt($!)) M:=ceil($!/$N) +e[0--3] "Append image$? as a "${M}x${N}"-tiled image (auto-mode)." +elif !$2 +M=$1 N:=round($!/$1,1,1) +e[0--3] "Append image$? as a "${M}x${N}"-tiled image." +elif !$1 +M:=round($!/$2,1,1) N=$2 +e[0--3] "Append image$? as a "${M}x${N}"-tiled image." +else +e[0--3] "Append image$?, as $1x$2-tiled images." +M=$1 N=$2 +fi +W,H=${-max_wh} rr2d $W,$H,2,1 +MN:=$M*$N if $!%$MN 0x{$MN-($!%$MN)} fi +repeat $!/$MN { l[$>-{$>+$MN-1}] { +repeat $!/$M { a[$>-{$>+$M-1}] x,$3 } +a y,$4 +} } +#@cli apply_scales : "command",number_of_scales>0,_min_scale[%]>=0,_max_scale[%]>=0,_scale_gamma>0,_interpolation +#@cli : Apply specified command on different scales of selected images. +#@cli : 'interpolation' can be { 0:none | 1:nearest | 2:average | 3:linear | 4:grid | 5:bicubic | 6:lanczos }. +#@cli : Default value: 'min_scale=25%', 'max_scale=100%' and 'interpolation=3'. +#@cli : $ image.jpg apply_scales "blur 5 sharpen 1000",4 +apply_scales : check "isint($2) && $2>0 && ${3=25%}>=0 && ${4=100%}>=0 && ${5=1}>0 && isint(${6=3}) && $6>=0" +skip "${1=}" +s0="no" s1="nearest-neighbor" s2="average" s3="linear" s4="grid" s5="bicubic" s6="lanczos" +e[^-1] "Apply command '$1' on image$? for $2 scales ($3 -> $4) and "${s{min(6,$6)}}" interpolation." +foreach { +nm={n} +scale0:=ispercentage($3)?$3*max(w,h,d):$3 +scale1:=ispercentage($4)?$4*max(w,h,d):$4 +repeat $2 { +scale:=$scale0+($scale1-$scale0)*($>/max(1,$2-1))^$5 +w={0,w==1?1:max(1,round($scale*w/max(w,h,d)))} +h={0,h==1?1:max(1,round($scale*h/max(w,h,d)))} +d={0,d==1?1:max(1,round($scale*d/max(w,h,d)))} ++r[0] $w,$h,$d,100%,$6 +if narg("$1") l. { $1 } fi +} +rm[0] =>[^] $nm +} +#@cli autocrop : value1,value2,... : (no arg) : (+) +#@cli : Autocrop selected images by specified vector-valued intensity. +#@cli : If no arguments are provided, cropping value is guessed. +#@cli : $ 400,400,1,3 fill_color 64,128,255 ellipse 50%,50%,120,120,0,1,255 +autocrop +#@cli autocrop_components : _threshold[%],_min_area[%]>=0,_is_high_connectivity={ 0 | 1 },_output_type={ 0:crop | 1:segmentation | 2:coordinates } +#@cli : Autocrop and extract connected components in selected images, according to a mask given as the last channel of +#@cli : each of the selected image (e.g. alpha-channel). +#@cli : Default values: 'threshold=0%', 'min_area=0.1%', 'is_high_connectivity=0' and 'output_type=1'. +#@cli : $ 256,256 noise 0.1,2 eq 1 dilate_circ 20 label_fg 0,1 normalize 0,255 +neq 0 *[-1] 255 append c +autocrop_components , +autocrop_components : skip ${1=0%} check "${2=0.1%}>=0 && isbool(${3=0}) && isint(${4=1}) && $4>=0 && $4<=2" +e[^-1] "Autocrop connected components from image$?, with threshold $1, minimal area $2, "${arg0\ $3,low,high}" connectivity ""and output type set to '"${arg0\ $4,crop,segmentation,coordinates}"'.\n" +foreach { +min_area:=max(1,round(ispercentage($2)?$2*w*h:$2)) ++channels 100% >. $1 area_fg. 0,$3 >=. $min_area ++area. 0,1 <. $min_area -|[-2,-1] label_fg. 0,1 +N:=iM repeat iM { +n:=1+$> +e "\r > "$n/$N +rprogress {100*$n/$N} ++==[1] $n +*[0,-1] rm.. +if !$4 coords=${autocrop_coords.\ auto} rm. +z[0] $coords +elif $4==1 autocrop. +else coords=${autocrop_coords.\ auto} rm. ($coords) y. +fi +} +rm[0,1] +if !$! 0 fi +if $4==2 a x fi +} +#@cli autocrop_seq : value1,value2,... | auto +#@cli : Autocrop selected images using the crop geometry of the last one by specified vector-valued intensity, +#@cli : or by automatic guessing the cropping value. +#@cli : Default value: auto mode. +#@cli : $ image.jpg +fill[-1] 0 ellipse[-1] 50%,50%,30%,20%,0,1,1 autocrop_seq 0 +autocrop_seq : skip ${1=auto} +e[^-1] "Auto-crop image$? using crop geometry of last image by vector '$*'." +if !$! return fi +is_auto:=['"$1"']=='auto' +if $!==1 _autocrop$is_auto ${1--1} return fi +coords=${autocrop_coords.\ ${1--1}} +x0,y0,z0,x1,y1,z1:=[$coords][0,6] +if $x0>$x1" || "$y0>$y1" || "$z0>$z1 i[0--2] 0 rm[1--1:2] +else z $x0,$y0,$z0,$x1,$y1,$z1 +fi +#@cli channels : c0[%],_c1[%] +#@cli : Keep only specified channels of selected images. +#@cli : Dirichlet boundary is used when specified channels are out of range. +#@cli : Default value: 'c1=c0'. +#@cli : $ image.jpg channels 0,1 +#@cli : $ image.jpg luminance channels 0,2 +channels : skip ${2=$1} +e[^-1] "Keep channels $1...$2 of image$?." +z 0,0,0,$1,100%,100%,100%,$2 +#@cli columns : x0[%],_x1[%] +#@cli : Keep only specified columns of selected images. +#@cli : Dirichlet boundary is used when specified columns are out of range. +#@cli : Default value: 'x1=x0'. +#@cli : $ image.jpg columns -25%,50% +columns : skip ${2=$1} +e[^-1] "Keep columns $1...$2 of image?." +z $1,$2 +#@cli z : eq. to 'crop'. : (+) +#@cli crop : x0[%],x1[%],_boundary_conditions : x0[%],y0[%],x1[%],y1[%],_boundary_conditions : x0[%],y0[%],z0[%],x1[%],y1[%],z1[%],_boundary_conditions : x0[%],y0[%],z0[%],c0[%],x1[%],y1[%],z1[%],c1[%],_boundary_conditions : (+) +#@cli : Crop selected images with specified region coordinates. +#@cli : (eq. to 'z').\n +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : Default value: 'boundary_conditions=0'. +#@cli : $ image.jpg +crop -230,-230,280,280,1 crop[0] -230,-230,280,280,0 +#@cli : $ image.jpg crop 25%,25%,75%,75% +#@cli diagonal +#@cli : Transform selected vectors as diagonal matrices. +#@cli : $ 1,10,1,1,'y' +diagonal +diagonal : +e[^-1] "Transform vector$? as diagonal matrix." +y foreach { r {h+1},100%,1,1,0 r {h},100%,1,1,-1 } +downsize_aliased : check "${1=50}>=0 && $1<=100" +if $1==100 return elif !$1 r 1,1,1,100%,2 return fi +N:=ceil(1+100/$1) +foreach { +split_opacity +if $!==1 continue fi ++dilate.. $N +==.. 0 +j[0] ..,0,0,0,0,1,. rm[-2,-1] +a c +r $1%,$1%,$1%,100%,2 +} +#@cli edgels : x0,y0 : (no arg) +#@cli : Retrieve list of edgels (and their normals) that go around a 2D binary silhouette. +#@cli : When specified, arguments 'x0,y0' are the 2D coordinates of the starting point (must be located at the edge of the binary silhouette). +#@cli : Output image has 3 channels '[x,y,n]' where 'x' and 'y' are the 2D coordinates of the edgel point, and 'n' is the orientation of its associated canonical normal (can be { 0:[1,0] | 1:[0,1] | 2:[-1,0] | 3:[0,-1] }. +edgels : skip "${1=},${2=}" +l[] { if "isint($1) && $1>=0 && isint($2) && $2>=0" x0,y0=${1,2} else error[] fi onfail x0,y0=-1 noarg } +foreach { +slices. 0 channels. 0 gt. 0 +1,1,1,3 +eval ${-math_lib}" +x0 = $x0<0?xM#-2:$1; +y0 = $y0<0?yM#-2:$2; +P0 = P = [ x0,y0,argmin(i(#-2,x0 + 1,y0),i(#-2,x0,y0 + 1),i(#-2,x0 - 1,y0),i(#-2,x0,y0 - 1)) ]; +do (da_push(P); P = next_edgel4_fg(#-2,P,1), P!=P0); +resize(#-1,1,da_size(),1,3,0)" +k. +} +#@cli elevate : _depth,_is_plain={ 0 | 1 },_is_colored={ 0 | 1 } +#@cli : Elevate selected 2D images into 3D volumes. +#@cli : Default values: 'depth=64', 'is_plain=1' and 'is_colored=1'. +elevate : check "${1=64}>0" skip ${2=1},${3=1} +e[^-1] "Elevate 2D image$? into $1-slices volume(s)." +r 100%,100%,1,100% +foreach { +nm={n} ++norm 100%,100%,$1,{$3?{0,s}:1} +m={-2,im} d={-2,iM-$m} +repeat $1 { +if $2 +>=[1] {$m+$d*($>+1)/$1} +else +ir[1] {$m+$d*$>/$1},{$m+$d*($>+1)/$1} +fi +r. 100%,100%,1,.. if $3 *. [0] fi +j.. .,0,0,$> rm. +} +rm[0,1] => $nm } +#@cli expand_x : size_x>=0,_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror } +#@cli : Expand selected images along the x-axis. +#@cli : Default value: 'boundary_conditions=0'. +#@cli : $ image.jpg expand_x 30,0 +expand_x : check "$1>=0 && ${2=0}>=0 && $2<=3" +e[^-1] "Expand image$? along the x-axis with size $1 and "${"arg0 $2,dirichlet,neumann,periodic,mirror"}" +boundary conditions." +foreach { r {w+2*$1},100%,100%,100%,0,$2,0.5,0.5,0.5 } +#@cli expand_xy : size>=0,_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror } +#@cli : Expand selected images along the xy-axes. +#@cli : Default value: 'boundary_conditions=0'. +#@cli : $ image.jpg expand_xy 30,0 +expand_xy : check "$1>=0 && ${2=0}>=0 && $2<=3" +e[^-1] "Expand image$? along the xy-axes with size $1 and "${"arg0 $2,dirichlet,neumann,periodic,mirror"}" +boundary conditions." +foreach { r {[w,h]+2*$1},100%,100%,0,$2,0.5,0.5,0.5 } +#@cli expand_xyz : size>=0,_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror } +#@cli : Expand selected images along the xyz-axes. +#@cli : Default value: 'boundary_conditions=0'. +expand_xyz : check "$1>=0 && ${2=0}>=0 && $2<=3" +e[^-1] "Expand image$? along the xyz-axes with size $1 and "${"arg0 $2,dirichlet,neumann,periodic,mirror"}" +boundary conditions." +foreach { r {[w,h,d]+2*$1},100%,0,$2,0.5,0.5,0.5 } +#@cli expand_y : size_y>=0,_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror } +#@cli : Expand selected images along the y-axis. +#@cli : Default value: 'boundary_conditions=0'. +#@cli : $ image.jpg expand_y 30,0 +expand_y : check "$1>=0 && ${2=0}>=0 && $2<=3" +e[^-1] "Expand image$? along the y-axis with size $1 and "${"arg0 $2,dirichlet,neumann,periodic,mirror"}" +boundary conditions." +foreach { r 100%,{h+2*$1},100%,100%,0,$2,0.5,0.5,0.5 } +#@cli expand_z : size_z>=0,_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror } +#@cli : Expand selected images along the z-axis. +#@cli : Default value: 'boundary_conditions=0'. +expand_z : check "$1>=0 && ${2=0}>=0 && $2<=3" +e[^-1] "Expand image$? along the z-axis with size $1 and "${"arg0 $2,dirichlet,neumann,periodic,mirror"}" +boundary conditions." +foreach { r 100%,100%,{d+2*$1},100%,0,$2,0.5,0.5,0.5 } +#@cli extract : "condition",_output_type={ 0:xyzc-coordinates | 1:xyz-coordinates | 2:scalar-values | 3:vector-values } +#@cli : Extract a list of coordinates or values from selected image, where +#@cli : specified mathematical condition holds. +#@cli : For N coordinates matching, result is a 1xNx1x4 image. +#@cli : Default values: 'output_type=0'. +#@cli : $ sp lena +extract "norm(I)>128",3 +extract : check "isin(${2=0},0,1,2,3)" +s0,s1,s2,s3=xyzc-coordinates,xyz-coordinates,scalar-values,vector-values +e[^-1] "Extract "$s$2" from image$? verifying condition '$1'." +str=">begin(run('1,32,1,',arg(1+$2,4,3,1,s)));($1)?(" +if !$2 str.="da_push([x,y,z,c]));i" +elif $2==1 str.="da_push([x,y,z]));I" +elif $2==2 str.="da_push(i));i" +else str.="da_push(I));I" +fi +str.=";end(resize(#-1,1,da_size(),1,s(#-1),0))" +repeat $! { nm={$>,n} eval[$>] $str => $nm rv[$>,-1] rm. } +#@cli extract_region : [label_image],_extract_xyz_coordinates={ 0 | 1 },_label_1,...,_label_M +#@cli : Extract all pixels of selected images whose corresponding label in '[label_image]' is equal to 'label_m', +#@cli : and output them as M column images. +#@cli : Default value: 'extract_xyz_coordinates=0'. +#@cli : $ image.jpg +blur 3 quantize. 4,0 +extract_region[0] [1],0,1,3 +extract_region : check ${"is_image_arg $1"}" && isnum(${2=0})" +if $#<3 e[0--3] "Extract pixels of image$? for labels [] in image $1, with"${"arg0 !!$2,out"}" coordinates +-> no labels provided, ignoring." return fi +e[^-1] "Extract pixels of image$? for labels {${3--1}} in image $1, with"${"arg0 !!$2,out"}" coordinates." +pass$1 mv. 0 repeat $!-1 { l[0,{1+$<}] { +nm={n} +1,16,1,{s+($2?3:0)} if $#>3 .x{$#-3} fi +f[0] "> +begin( +const N = iM + 1; +R = [ ${3--1} ]; +hash = vectorN(0); +repeat (size(R),k, hash[R[k]] = k + 2); +); +(ind = hash[i])>0?( +$2?da_push(#ind,[ I(#1),x,y,z ]):da_push(#ind,I(#1)); +); i; +end( +repeat (l - 2,k, resize(#k + 2,1,da_size(#k + 2),1,-100,0)) +)" +rm[1] =>[^] $nm +} } rm[0] +#@cli montage : "_layout_code",_montage_mode={ 0<=centering<=1 | 2<=scale+2<=3 },_output_mode={ 0:single layer | 1:multiple layers },"_processing_command" +#@cli : Create a single image montage from selected images, according to specified layout code : +#@cli : - 'X' to assemble all images using an automatically estimated layout. +#@cli : - 'H' to assemble all images horizontally. +#@cli : - 'V' to assemble all images vertically. +#@cli : - 'A' to assemble all images as an horizontal array. +#@cli : - 'B' to assemble all images as a vertical array. +#@cli : - 'Ha:b' to assemble two blocks 'a' and 'b' horizontally. +#@cli : - 'Va:b' to assemble two blocks 'a' and 'b' vertically. +#@cli : - 'Ra' to rotate a block 'a' by 90 deg. ('RRa' for 180 deg. and 'RRRa' for 270 deg.). +#@cli : - 'Ma' to mirror a block 'a' along the X-axis ('MRRa' for the Y-axis). +#@cli : A block 'a' can be an image index (treated periodically) or a nested layout expression 'Hb:c','Vb:c','Rb' or +#@cli : 'Mb' itself. +#@cli : For example, layout code 'H0:V1:2' creates an image where image [0] is on the left, and images [1] and [2] +#@cli : vertically packed on the right. +#@cli : Default values: 'layout_code=X', 'montage_mode=2', output_mode='0' and 'processing_command=""'. +#@cli : $ image.jpg sample ? +plasma[0] shape_cupid 256 normalize 0,255 frame 3,3,0 frame 10,10,255 to_rgb +montage A +montage[^-1] H1:V0:VH2:1H0:3 +montage : check "isnum(${2=2}) && $2>=0 && $2<=3" skip "${1=X}",${3=0},"${4=}" +if $2<=1 e[0--3] "Create aligned montage from image$?, with layout code '$1' and centering $2." +else e[0--3] "Create scaled montage from image$?, with layout code '$1' and scale "{$2-2}"." +fi +to_colormode 0 +if lowercase(['"$1"'])=='x' ++l { +foreach { => $> } +repeat $!-1 { +if {-2,w>h}" && "w>h mode=V +elif {-2,h>w}" && "h>w mode=H +elif {-2,w>h}" && "h>w +if {-2,h/w}<(w/h) mode=V else mode=H fi +else +if {-2,w/h}<(h/w) mode=H else mode=V fi +fi +name=$mode{-2,n}:{n} +montage[-2,-1] $mode,$2 +mv. 0 =>[0] $name +} +layout={0,n} +rm +} +montage $layout,$2,$3,"$4" +else +N=$! +l[] { +_scode="$1" _mode=$2 +if lowercase(['"$1"'])=='h' if $N>1 {$N-1},1,1,1,-1 $N,1,1,1,x a x y else return fi +elif lowercase(['"$1"'])=='v' if $N>1 {$N-1},1,1,1,-2 $N,1,1,1,x a x y else return fi +elif isin(lowercase(['"$1"']),'a','b') +if $N<2 return fi +nr:=round(sqrt($N)) nc:=round($N/$nr,1,1) +if lowercase(['"$1"'])=='b' n=$nr nr=$nc nc=$n fi +$N,1,1,1,x s x,-{round(w/$nr,1,1)} foreach { if w>1 i[0] {w-1},1,1,1,-1 a x fi } a x +if $nr>1 i[0] {$nr-1},1,1,1,-2 a x fi y +else +('"$1"') f "i==72 || i==104?-1: +i==86 || i==118?-2: +i==82 || i==114?-3: +i==77 || i==109?-4: +i>=48 && i<=57?i-48:-5" +s +,-1 s +,-2 s +,-3 s +,-4 s +,-5 +foreach { if im>=0 ++. 48 =.. {t} rm. rows 0 fi } a y discard -5 +fi +f "i<0?i:i%$N" +} +if $!==$N rm return fi +=>[^-1] 0 +repeat h { +c:=i[$>] +if $c>=0 if {$c,n} i.. [$c] i:=$!-2 =. $i,0,$> ref$i=$c else =>[$c] 1 ref$c=$c fi fi +} +_code={^} _lcode:=narg($_code) rm. +N=$! repeat $N { ($>,0,0,{$>,w},{$>,h},0,0,0) } +l[$N--1] { +_p=1 k[${-_montage}] w:=i[3] h:=i[4] f i(0,y)<0?-1:i discard -1 y r 8,{h/8},1,1,-1 +onfail error[0--3] "Too many input images." +} +if narg("$4") m "__montage : $4 k[0]" +else m "__montage : if $""7%2 mirror x fi if $""8%2 mirror y fi rotate {90*$""6} +r {max(1,round($""4,1,1))},{max(1,round($""5,1,1))},1,100%,3" +fi +s=${max_s[^-1]} +repeat h { +i,xi,yi,wi,hi,ai,mxi,myi:=crop(0,$>,w,1) +if $3||!$> i.. $w,$h,1,$s fi +__montage[$i] ${ref$i},$xi,$yi,{max(1,$wi)},{max(1,$hi)},$ai,$mxi,$myi +j.. [$i],$xi,$yi +} +um __montage +rm[0-{$N-1},-1] +fi +=> "[Montage '$1']" +_montage : +if $_p>$_lcode error "Command 'montage': Incomplete layout code '"$_scode"'." fi +c:=arg($_p,$_code) +if $c>=0 _p+=1 u $c +elif $c==-4 +_p+=1 l=${-_montage} f[$l] "a=i(5,y)%2;(x==7&&a)||(x==6&&!a)?!i:x==1?i(3,0)-i(3,y)-i:i" u $l +elif $c==-3 +_p+=1 l=${-_montage} l[$l] { s x +[2] [4] rv[1,2] *[1] -1 +[1] {4,@0} rv[3,4] +[5] 1 a x } u $l +else +_p+=1 +l=${-_montage} lw={$l,@3} lh={$l,@4} +r=${-_montage} rw={$r,@3} rh={$r,@4} +if $c==-1 +if $_mode<2 +h:=max($lh,$rh) ++[$l] '0,0,{($h-$lh)*min(1,$_mode)},0,0,0,0,0' ++[$r] '0,$lw,{($h-$rh)*min(1,$_mode)},0,0,0,0,0' +else +h:=($_mode-2)*max($lh,$rh)+(3-$_mode)*min($lh,$rh) +lf:=$h/$lh rf:=$h/$rh lw:=$lw*$lf rw:=$rw*$rf +*[$l] '1,$lf,$lf,$lf,$lf,1,1,1' *[$r] '1,$rf,$rf,$rf,$rf,1,1,1' +[$r] '0,$lw,0,0,0,0,0,0' +fi +i[$l] (-1,0,0,{$lw+$rw},$h,0,0,0) a[$l,{$l+1}] y a[$l] [$r],y r[$r] 1,1,1,1,0 +else +if $_mode<2 +w:=max($lw,$rw) ++[$l] '0,{($w-$lw)*min(1,$_mode)},0,0,0,0,0,0' ++[$r] '0,{($w-$rw)*min(1,$_mode)},$lh,0,0,0,0,0' +else +w:=($_mode-2)*max($lw,$rw)+(3-$_mode)*min($lw,$rw) +lf:=$w/$lw rf:=$w/$rw lh:=$lh*$lf rh:=$rh*$rf +*[$l] '1,$lf,$lf,$lf,$lf,1,1,1' *[$r] '1,$rf,$rf,$rf,$rf,1,1,1' +[$r] '0,0,$lh,0,0,0,0,0' +fi +i[$l] (-1,0,0,$w,{$lh+$rh},0,0,0) a[$l,{$l+1}] y a[$l] [$r],y r[$r] 1,1,1,1,0 +fi +u $l +fi +#@cli mirror : { x | y | z }...{ x | y | z } : (+) +#@cli : Mirror selected images along specified axes. +#@cli : $ image.jpg +mirror y +mirror[0] c +#@cli : $ image.jpg +mirror x +mirror y append_tiles 2,2 +#@cli permute : permutation_string : (+) +#@cli : Permute selected image axes by specified permutation. +#@cli : 'permutation' is a combination of the character set {x|y|z|c}, +#@cli : e.g. 'xycz', 'cxyz', ... +#@cli : $ image.jpg permute yxzc +#@cli r : eq. to 'resize'. : (+) +#@cli resize : {[image_w] | width>0[%]},_{[image_h] | height>0[%]},_{[image_d] | depth>0[%]},_{[image_s] | spectrum>0[%]},_interpolation,_boundary_conditions,_ax,_ay,_az,_ac : (+) +#@cli : Resize selected images with specified geometry. +#@cli : (eq. to 'r').\n +#@cli : 'interpolation' can be { -1:none (memory content) | 0:none | 1:nearest | 2:average | 3:linear | 4=grid | 5=bicubic | 6=lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0:none | 1:neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0 or 4' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'interpolation=1', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +#@cli : $ image.jpg +resize[-1] 256,128,1,3,2 +resize[-1] 120%,120%,1,3,0,1,0.5,0.5 +resize[-1] 120%,120%,1,3,0,0,0.2,0.2 +resize[-1] [0],[0],1,3,4 +#@cli ri : eq. to 'resize_as_image'. +ri : skip "${2=1},${3=0},${4=0},${5=0},${6=0},${7=0}" +pass$1 r[^-1] .,.,.,.,${2--1} rm. +#@cli resize_as_image : [reference],_interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images to the geometry of specified [reference] image. +#@cli : (eq. to 'ri'). +#@cli : Default values: 'interpolation=1', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +#@cli : $ image.jpg sample duck +resize_as_image[-1] [-2] +resize_as_image : check ${"is_image_arg $1"}" && isint(${2=1}) && $2>=-1 && $2<=6 && ""isint(${3=0}) && $3>=0 && $3<=3 && isnum(${4=0}) && isnum(${5=0}) && isnum(${6=0}) && isnum(${7=0})" +pass$1 r[^-1] .,.,.,.,${2--1} rm. +#@cli resize_mn : width[%]>=0,_height[%]>=0,_depth[%]>=0,_B_value,_C_value +#@cli : Resize selected images with Mitchell-Netravali filter (cubic). +#@cli : For details about the method, see: . +#@cli : Default values: 'height=100%', 'depth=100%', 'B=0.3333' and 'C=0.3333'. +#@cli : $ image.jpg resize2dx 32 resize_mn 800%,800% +resize_mn : check "${2=100%}>=0 && ${3=100%}>=0" skip "${4=0.333},${5=0.333}" +e[^-1] "Resize image$? to $1x$2x$3 using Mitchell-Netravali filter (B=$4, C=$5)." +lib="const B = $4; const C = $5; const boundary = 1; const interp = 0; +mn(P0,P1,P2,P3,d) = ( ( (-B/6-C)*P0 + (-3*B/2-C+2)*P1 + (3*B/2+C-2)*P2 + (B/6+C)*P3 )*d^3 ++ ( (B/2+2*C)*P0 + (2*B+C-3)*P1 + (-5*B/2-2*C+3)*P2 -C*P3)*d^2 ++ ( (-B/2-C)*P0 + (B/2+C)*P2)*d ++ B/6*P0 + (-B/3+1)*P1 + B/6*P2);" +foreach { +nm={n} +nw:=ispercentage($1)?max(1,round($1*w)):round($1) +nh:=ispercentage($2)?max(1,round($2*h)):round($2) +nd:=ispercentage($3)?max(1,round($3*d)):round($3) +if !$nw" || "!$nh" || "!$nd rm 0 +elif !w rm $nw,$nh,$nd,1 +else +if w==1||$nww +$nw,100%,100%,100%,${lib}"X = x*(w#-1-1)/(w-1); d = X - int(X); P0 = I(#-1,X-1); P1 = I(#-1,X); +P2 = I(#-1,X+1); P3 = I(#-1,X+2); mn(P0,P1,P2,P3,d);" k. +fi +if h==1||$nh $nm +} +#@cli resize_pow2 : _interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images so that each dimension is a power of 2. +#@cli : 'interpolation' can be { -1:none (memory content) | 0:none | 1:nearest | 2:average | 3:linear | 4:grid | 5:bicubic | 6:lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0:none | 1:neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'interpolation=0', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +#@cli : $ image.jpg +resize_pow2[-1] 0 +resize_pow2 : check "isint(${1=0}) && $1>=-1 && $1<=6" skip ${2=0},${3=0},${4=0},${5=0},${6=0} +e[^-1] "Resize image$? so that each dimension is a power of 2." +foreach { r {2^(ceil(log2([w,h,d])))},100%,${1-6} } +#@cli rr2d : eq. to 'resize_ratio2d'. +rr2d : +_gmic_s="$?" v + _resize_ratio2d $* +#@cli resize_ratio2d : width>0,height>0,_mode={ 0:inside | 1:outside | 2:padded },0=<_interpolation<=6 +#@cli : Resize selected images while preserving their aspect ratio. +#@cli : (eq. to 'rr2d'). +#@cli : Default values: 'mode=0' and 'interpolation=6'. +resize_ratio2d : +_gmic_s="$?" v + _$0 $* +_resize_ratio2d : check "$1>0 && $2>0 && ${3=0}>=0 && $3<=2 && ${4=6}>=0 && $4<=6" +e[0--3] "Resize 2D image"$_gmic_s" to $1x$2 with ratio-"${arg0\ $3,inside,outside,padded}" mode and interpolation type $4." +foreach { +ratio:=$3==1?max($1/w,$2/h):min($1/w,$2/h) +r {[max(1,round(w*$ratio)),max(1,round(h*$ratio))]},100%,100%,$4 +} +if $3==2 r $1,$2,100%,100%,0,0,0.5,0.5 fi +#@cli r2din : eq. to 'resize2din' +r2din : +_gmic_s="$?" v + _resize2din $* +#@cli resize2din : width[%]>0,_height[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images so the size is not larger than 'width'x'height' while preserving 2D ratio. +#@cli : (eq. to 'r2din').\n +#@cli : 'interpolation' can be { -1:none (memory content) | 0:none | 1:nearest | 2:average | 3:linear | 4:grid | 5:bicubic | 6:lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0:none | 1:neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'height=100%', 'interpolation=3', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +#@cli : $ image.jpg +resize2din 100,100 append x +resize2din : +_gmic_s="$?" v + _$0 $* +_resize2din : check "$1>0 && ${2=100%}>0 && ${3=3}>=0 && $3<=6 && ${4=0}>=0 && $4<=3 && ""${5=0}>=0 && $5<=1 && ${6=0}>=0 && $6<=1 && ${7=0}>=0 && $7<=1 && ${8=0}>=0 && $8<=1" +e[0--3] "Resize image"$_gmic_s" so the size is not larger than $1x$2, while preserving 2D ratio." +eval "repeat (l,k, +W = ispercentage($1)?w#k*$1:$1; +H = ispercentage($2)?h#k*$2:$2; +dims = round(min(W/w#k,H/h#k)*[w#k,h#k]); +resize(#k,max(1,dims[0]),max(1,dims[1]),d#k,s#k,${3-8}); +)" +#@cli r3din : eq. to 'resize3din' +r3din : +_gmic_s="$?" v + _resize3din $* +#@cli resize3din : width[%]>0,_height[%]>0,_depth[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images so the size is not larger than 'width'x'height'x'depth' while preserving 3D ratio. +#@cli : (eq. to 'r3din').\n +#@cli : 'interpolation' can be { -1:none (memory content) | 0:none | 1:nearest | 2:average | 3:linear | 4:grid | 5:bicubic | 6:lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0:none | 1:neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'height=100%', 'depth=100%', 'interpolation=3', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +resize3din : +_gmic_s="$?" v + _$0 $* +_resize3din : check "$1>0 && ${2=100%}>0 && ${3=100%}>0 && ${4=3}>=0 && $4<=6 && ${5=0}>=0 && $5<=3 && ""${6=0}>=0 && $6<=1 && ${7=0}>=0 && $7<=1 && ${8=0}>=0 && $8<=1 && ${9=0}>=0 && $9<=1" +e[0--3] "Resize image"$_gmic_s" so the size is not larger than $1x$2x$3, while preserving 3D ratio." +eval "repeat (l,k, +W = ispercentage($1)?w#k*$1:$1; +H = ispercentage($2)?h#k*$2:$2; +D = ispercentage($3)?d#k*$3:$3; +dims = round(min(W/w#k,H/h#k,D/d#k)*[w#k,h#k,d#k]); +resize(#k,max(1,dims[0]),max(1,dims[1]),max(1,dims[2]),s#k,${4-9}); +)" +#@cli r2dout : eq. to 'resize2dout' +r2dout : +_gmic_s="$?" v + _resize2dout $* +#@cli resize2dout : width[%]>0,_height[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images so the size is not smaller than 'width'x'height' while preserving 2D ratio. +#@cli : (eq. to 'r2dout').\n +#@cli : 'interpolation' can be { -1:none (memory content) | 0:none | 1:nearest | 2:average | 3:linear | 4:grid | 5:bicubic | 6:lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0:none | 1:neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'height=100%', 'interpolation=3', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +#@cli : $ image.jpg +resize2dout 100,100 append x +resize2dout : +_gmic_s="$?" v + _$0 $* +_resize2dout : check "$1>0 && ${2=100%}>0 && ${3=3}>=0 && $3<=6 && ${4=0}>=0 && $4<=3 && ""${5=0}>=0 && $5<=1 && ${6=0}>=0 && $6<=1 && ${7=0}>=0 && $7<=1 && ${8=0}>=0 && $8<=1" +e[0--3] "Resize image"$_gmic_s" so the size is not larger than $1x$2, while preserving 2D ratio." +eval "repeat (l,k, +W = ispercentage($1)?w#k*$1:$1; +H = ispercentage($2)?h#k*$2:$2; +dims = round(max(W/w#k,H/h#k)*[w#k,h#k]); +resize(#k,max(1,dims[0]),max(1,dims[1]),d#k,s#k,${3-8}); +)" +#@cli r3dout : eq. to 'resize3dout' +r2dout : +_gmic_s="$?" v + _resize3dout $* +#@cli resize3dout : width[%]>0,_height[%]>0,_depth[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images so the size is not smaller than 'width'x'height'x'depth' while preserving 3D ratio. +#@cli : (eq. to 'r3dout').\n +#@cli : 'interpolation' can be { -1:none (memory content) | 0:none | 1:nearest | 2:average | 3:linear | 4:grid | 5:bicubic | 6:lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0:none | 1:neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'height=100%', 'depth=100%', 'interpolation=3', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +resize3dout : +_gmic_s="$?" v + _$0 $* +_resize3dout : check "$1>0 && ${2=100%}>0 && ${3=100%}>0 && ${4=3}>=0 && $4<=6 && ${5=0}>=0 && $5<=3 && ""${6=0}>=0 && $6<=1 && ${7=0}>=0 && $7<=1 && ${8=0}>=0 && $8<=1 && ${9=0}>=0 && $9<=1" +e[0--3] "Resize image"$_gmic_s" so the size is not larger than $1x$2x$3, while preserving 3D ratio." +eval "repeat (l,k, +W = ispercentage($1)?w#k*$1:$1; +H = ispercentage($2)?h#k*$2:$2; +D = ispercentage($3)?d#k*$3:$3; +dims = round(max(W/w#k,H/h#k,D/d#k)*[w#k,h#k,d#k]); +resize(#k,max(1,dims[0]),max(1,dims[1]),max(1,dims[2]),s#k,${4-9}); +)" +#@cli r2dx : eq. to 'resize2dx'. +r2dx : +_gmic_s="$?" v + _resize2dx $* +#@cli resize2dx : width[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images along the x-axis, while preserving 2D ratio. +#@cli : (eq. to 'r2dx').\n +#@cli : 'interpolation' can be { -1:none (memory content) | 0:none | 1:nearest | 2:average | 3:linear | 4:grid | 5:bicubic | 6:lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0:none | 1:neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'interpolation=3', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +#@cli : $ image.jpg +resize2dx 100,2 append x +resize2dx : +_gmic_s="$?" v + _$0 $* +_resize2dx : check "$1>0 && ${2=3}>=0 && $2<=6 && ${3=0}>=0 && $3<=3 && ${4=0}>=0 && $4<=1 && ${5=0}>=0 && $5<=1 && +${6=0}>=0 && $6<=1 && ${7=0}>=0 && $7<=1" +e[0--3] "Resize 2D image"$_gmic_s" to $1 pixels along the x-axis, while preserving 2D ratio." +foreach { +size:=ispercentage($1)?$1*w:$1 +r {max(1,$size)},{max(1,h*$size/w)},100%,100%,${2-7} +} +#@cli r2dy : eq. to 'resize2dy'. +r2dy : +_gmic_s="$?" v + _resize2dy $* +#@cli resize2dy : height[%]>=0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images along the y-axis, while preserving 2D ratio. +#@cli : (eq. to 'r2dy').\n +#@cli : 'interpolation' can be { -1:none (memory content) | 0:none | 1:nearest | 2:average | 3:linear | 4:grid | 5:bicubic | 6:lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0:none | 1:neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'interpolation=3', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +#@cli : $ image.jpg +resize2dy 100,2 append x +resize2dy : +_gmic_s="$?" v + _$0 $* +_resize2dy : check "$1>=0 && ${2=3}>=0 && $2<=6 && ${3=0}>=0 && $3<=3 && ${4=0}>=0 && $4<=1 && ${5=0}>=0 && $5<=1 && +${6=0}>=0 && $6<=1 && ${7=0}>=0 && $7<=1" +e[0--3] "Resize 2D image"$_gmic_s" to $1 pixels along the y-axis, while preserving 2D ratio." +foreach { +size:=ispercentage($1)?$1*h:$1 +r {max(1,w*$size/h)},{max(1,$size)},100%,100%,${2-7} +} +#@cli r3dx : eq. to 'resize3dx'. +r3dx : +_gmic_s="$?" v + _resize3dx $* +#@cli resize3dx : width[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images along the x-axis, while preserving 3D ratio. +#@cli : (eq. to 'r3dx').\n +#@cli : 'interpolation' can be { -1:none (memory content) | 0:none | 1:nearest | 2:average | 3:linear | 4:grid | 5:bicubic | 6:lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0:none | 1:neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'interpolation=3', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +resize3dx : +_gmic_s="$?" v + _$0 $* +_resize3dx : check "$1>0 && ${2=3}>=0 && $2<=6 && ${3=0}>=0 && $3<=3 && ${4=0}>=0 && $4<=1 && ${5=0}>=0 && $5<=1 && +${6=0}>=0 && $6<=1 && ${7=0}>=0 && $7<=1" +e[0--3] "Resize 3D image"$_gmic_s" to $1 pixels along the x-axis, while preserving 3D ratio." +foreach { +size:=ispercentage($1)?$1*w:$1 +r {max(1,$size)},{max(1,h*$size/w)},{max(1,d*$size/w)},100%,${2-7} +} +#@cli r3dy : eq. to 'resize3dy'. +r3dy : +_gmic_s="$?" v + _resize3dy $* +#@cli resize3dy : height[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images along the y-axis, while preserving 3D ratio. +#@cli : (eq. to 'r3dy').\n +#@cli : 'interpolation' can be { -1:none (memory content) | 0:none | 1:nearest | 2:average | 3:linear | 4:grid | 5:bicubic | 6:lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0:none | 1:neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'interpolation=3', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +resize3dy : +_gmic_s="$?" v + _$0 $* +_resize3dy : check "$1>0 && ${2=3}>=0 && $2<=6 && ${3=0}>=0 && $3<=3 && ${4=0}>=0 && $4<=1 && ${5=0}>=0 && $5<=1 && +${6=0}>=0 && $6<=1 && ${7=0}>=0 && $7<=1" +e[0--3] "Resize 3D image"$_gmic_s" to $1 pixels along the y-axis, while preserving 3D ratio." +foreach { +size:=ispercentage($1)?$1*h:$1 +r {max(1,w*$size/h)},{max(1,$size)},{max(1,d*$size/h)},100%,${2-7} +} +#@cli r3dz : eq. to 'resize3dz'. +r3dz : +_gmic_s="$?" v + _resize3dz $* +#@cli resize3dz : depth[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac +#@cli : Resize selected images along the z-axis, while preserving 3D ratio. +#@cli : (eq. to 'r3dz').\n +#@cli : 'interpolation' can be { -1:none (memory content) | 0:none | 1:nearest | 2:average | 3:linear | 4:grid | 5:bicubic | 6:lanczos }. +#@cli : 'boundary_conditions' has different meanings, according to the chosen 'interpolation' mode : +#@cli : . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions' is meaningless. +#@cli : . When 'interpolation==0', 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be { 0:none | 1:neumann }. +#@cli : 'ax,ay,az,ac' set the centering along each axis when 'interpolation=0' +#@cli : (set to '0' by default, must be defined in range [0,1]). +#@cli : Default values: 'interpolation=3', 'boundary_conditions=0' and 'ax=ay=az=ac=0'. +resize3dz : +_gmic_s="$?" v + _$0 $* +_resize3dz : check "$1>0 && ${2=3}>=0 && $2<=6 && ${3=0}>=0 && $3<=3 && ${4=0}>=0 && $4<=1 && ${5=0}>=0 && $5<=1 && +${6=0}>=0 && $6<=1 && ${7=0}>=0 && $7<=1" +e[0--3] "Resize 3D image"$_gmic_s" to $1 pixels along the z-axis, while preserving 3D ratio." +foreach { +size:=ispercentage($1)?$1*d:$1 +r[$>] {max(1,w*$size/d)},{max(1,h*$size/d)},{max(1,$size)},100%,${2-7} +} +#@cli rotate : angle,_interpolation,_boundary_conditions,_center_x[%],_center_y[%] : u,v,w,angle,interpolation,boundary_conditions,_center_x[%],_center_y[%],_center_z[%] : (+) +#@cli : Rotate selected images with specified angle (in deg.), and optionally 3D axis (u,v,w). +#@cli : 'interpolation' can be { 0:none | 1:linear | 2:bicubic }. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : When a rotation center (cx,cy,_cz) is specified, the size of the image is preserved. +#@cli : Default values: 'interpolation=1', 'boundary_conditions=0' and 'center_x=center_y=(undefined)'. +#@cli : $ image.jpg +rotate -25,1,2,50%,50% rotate[0] 25 +#@cli rotate_tileable : angle,_max_size_factor>=0 +#@cli : Rotate selected images by specified angle and make them tileable. +#@cli : If resulting size of an image is too big, the image is replaced by a 1x1 image. +#@cli : Default values: 'max_size_factor=8'. +rotate_tileable : check ${2=8}>=0 +e[^-1] "Rotate image$? with angle $1 deg. and make them tileable." +angle:=$1%360 +if $angle>=270 rotate 270 angle-=270 +elif $angle>=180 rotate 180 angle-=180 +elif $angle>=90 rotate 90 angle-=90 +fi +(0,1;1,8;1,7;1,6;1,5;1,4;1,5;1,3;2,5;1,2;2,5;3,5;2,3;3,4;4,5;1,1;5,4;7,5;3,2;8,5;9,5;2,1;3,1;4,1;5,1;6,1;7,1;8,1) +s. x,2 +/[-2,-1] atan. *. {180/pi} +($angle) index. .. rm.. +p={-3,@{^}} q={-2,@{^}} rm[-3--1] +if !$p||!$q return fi +foreach { +theta:=atan2($p,$q) +gcd=${gcd" "{h*$q},{w*$p}} +pw:=h*$q/$gcd +nw:=round($pw*w/cos($theta)) +gcd=${gcd" "{h*$p},{w*$q}} +qh:=w*$q/$gcd +nh:=round($qh*h/cos($theta)) +if !$2" || "($nw<$2*w" && "$nh<$2*h) +r {1.5*$nw},{1.5*$nh},1,100%,0,2 +rotate {$theta*180/pi},1,2,50%,50% +r $nw,$nh,1,100%,0,2,0.5,0.5 +else error[0--4] "Command '$0': Invalid image dimension "({w},{h},{d},{s}). +fi +} +#@cli rows : y0[%],_y1[%] +#@cli : Keep only specified rows of selected images. +#@cli : Dirichlet boundary conditions are used when specified rows are out of range. +#@cli : Default value: 'y1=y0'. +#@cli : $ image.jpg rows -25%,50% +rows : skip ${2=$1} +e[^-1] "Keep rows $1...$2 of image$?." +z 0,$1,100%,$2 +#@cli scale2x +#@cli : Resize selected images using the Scale2x algorithm. +#@cli : $ image.jpg threshold 50% resize 50%,50% +scale2x +scale2x : +e[^-1] "Double xy-dimensions of image$?, using Scale2x algorithm." +foreach { +r 200%,200% +f "dx=x&1;dy=y&1;A=j(0,-2,0,0,0,1);B=j(2,0,0,0,0,1);C=j(-2,0,0,0,0,1);D=j(0,2,0,0,0,1); +!dy*(!dx*(C==A&&C!=D&&A!=B?A:i) + dx*(A==B&&A!=C&&B!=D?B:i)) + +dy*(dx*(B==D&&B!=A&&D!=C?D:i) + !dx*(D==C&&D!=B&&C!=A?C:i))" +} +#@cli scale3x +#@cli : Resize selected images using the Scale3x algorithm. +#@cli : $ image.jpg threshold 50% resize 33%,33% +scale3x +scale3x : +e[^-1] "Triple xy-dimensions of image$?, using Scale3x algorithm." +foreach { +r 300%,300% +f "dx=x%3;dy=y%3;c0=!dx;c1=(dx==1);c2=(dx==2); +A=j(-3,-3,0,0,0,1);B=j(0,-3,0,0,0,1);C=j(3,-3,0,0,0,1); +D=j(-3,0,0,0,0,1);F=j(3,0,0,0,0,1); +G=j(-3,3,0,0,0,1);H=j(0,3,0,0,0,1);I=j(3,3,0,0,0,1); +!dy*(c0*(D==B&&D!=H&&B!=F?D:i) + c1*((D==B&&D!=H&&B!=F&&i!=C)||(B==F&&B!=D&&F!=H&&i!=A)?B:i) + +c2*(B==F&&B!=D&&F!=H?F:i)) + +(dy==1)*(c0*((H==D&&H!=F&&D!=B&&i!=A)||(D==B&&D!=H&&B!=F&&i!=G)?D:i) + c1*i + +c2*((B==F&&B!=D&&F!=H&&i!=I)||(F==H&&F!=B&&H!=D&&i!=C)?F:i)) + +(dy==2)*(c0*(H==D&&H!=F&&D!=B?D:i) + c1*((F==H&&F!=B&&H!=D&&i!=G)||(H==D&&H!=F&&D!=B&&i!=I)?H:i) + +c2*(F==H&&F!=B&&H!=D?F:i))" +} +#@cli scale_dcci2x : _edge_threshold>=0,_exponent>0,_extend_1px={ 0:false | 1:true } +#@cli : Double image size using directional cubic convolution interpolation, +#@cli : as described in . +#@cli : Default values: 'edge_threshold=1.15', 'exponent=5' and 'extend_1px=0'. +#@cli : $ image.jpg +scale_dcci2x , +scale_dcci2x : check "${1=1.15}>=0 && ${2=5}>=0" skip ${3=0} +e[^-1] "Double xy-dimensions of image$?, using DCCI2x algorithm." +foreach { +r {2*w-(!$3)},{2*h-(!$3)},1,100%,4 +f "begin( +const threshold = $1; +const exponent = $2; +interpolation = 0; +boundary = 1; +j1(x,y) = P[7*y + x + 24]; +j2(x,y) = P[7*x - y + 24]; +interp(k) = -k#(-3,-3) + 9*k#(-1,-1) + 9*k#(1,1) - k#(3,3); +d(k) = sum(abs([ +k#(-1,-3) - k#(-3,-1), k#(1,-3) - k#(-1,-1), k#(3,-3) - k#(1,-1), +k#(-1,-1) - k#(-3,1), k#(1,-1) - k#(-1,1), k#(3,-1) - k#(1,1), +k#(-1,1) - k#(-3,3), k#(1,1) - k#(-1,3), k#(3,1) - k#(1,3) +])); +); +if (!((x*y)%2),i, +ref(crop(x - 3,y - 3,0,c,7,7,1,1),P); +d1 = d(j1); +d2 = d(j2); +ratio = (1 + d1)/(1 + d2); +value = ratio>threshold ? interp(j1): +ratio<(1/threshold) ? interp(j2): +(w1 = 1/(1 + d1^exponent); w2 = 1/(1 + d2^exponent); +(interp(j1)*w1 + interp(j2)*w2)/(w1 + w2)); +value/=16)" +f "begin( +const threshold = $1; +const exponent = $2; +interpolation = 0; +boundary = 1; +j1(x,y) = P[7*y + x + 24]; +j2(x,y) = P[7*x - y + 24]; +interp(k) = -k#(0,-3) + 9*k#(0,-1) + 9*k#(0,1) - k#(0,3); +d(k) = sum(abs([ +k#(-1,-2) - k#(1,-2), +k#(-2,-1) - k#(0,-1), k#(0,-1) - k#(2,-1), +k#(-3,0) - k#(-1,0), k#(-1,0) - k#(1,0), k#(1,0) - k#(3,0), +k#(-2,1) - k#(0,1), k#(0,1) - k#(2,1), +k#(-1,2) - k#(1,2) +])); +); +if ((x%2) + (y%2)!=1,i, +ref(crop(x - 3,y - 3,0,c,7,7,1,1),P); +d1 = d(j1); +d2 = d(j2); +ratio = (1 + d1)/(1 + d2); +value = ratio>threshold ? interp(j1) : +ratio<(1/threshold) ? interp(j2) : +(w1 = 1/(1 + d1^exponent); w2 = 1/(1 + d2^exponent); +(interp(j1)*w1 + interp(j2)*w2)/(w1 + w2)); +value/=16)" +} +#@cli seamcarve : _width[%]>=0,_height[%]>=0,_is_priority_channel={ 0 | 1 },_is_antialiasing={ 0 | 1 },_maximum_seams[%]>=0 +#@cli : Resize selected images with specified 2D geometry, using the seam-carving algorithm. +#@cli : Default values: 'height=100%', 'is_priority_channel=0', 'is_antialiasing=1' and 'maximum_seams=25%'. +#@cli : $ image.jpg seamcarve 60% +seamcarve : check "${2=100%}>=0 && ${5=25%}>=0" skip ${3=0},${4=1} +e[^-1] "Resize image$? to $1x$2 using seam-carving algorithm, "${arg0\ !$3,with,without}" priority channel, "${arg0\ !$4,with,without}" anti-aliasing and maximum seams $5." +foreach { +nw:=max(1,round(ispercentage($1)?$1*w:$1)) +nh:=max(1,round(ispercentage($2)?$2*h:$2)) +if $nw!=w _seamcarve $nw,$3,$4,$5 fi +if $nh!=h transpose _seamcarve $nh,$3,$4,$5 transpose fi +} +_seamcarve : +do +max_seams:=max(1,round(ispercentage($4)?$4*w:$4)) +ssms:=max(min(round($1-w),w),1-w) +sms:=min($max_seams,abs($ssms)) +if $2 s[0] c,{1-s} /. 256 fi ++gradient[0] a[-2,-1] c abs. compose_channels. + n. 0,1 +if $2 +. .. a[0,1] c fi +if $3 100%,1,1,1,x r. [0],[0] a[0,-1] c fi +. +repeat h { ++rows. {$<+1} erode. 3 +j.. .,0,$<,0,0,-1 rm. +} +100%,100% +rows[1] 0 +=> grad,low,seam,top +repeat h#0-1 { nr:=$>+1 ++rows[low] $nr ++*[4,5] +shift[4] 1 *. [5] +shift[5] 1 *. [4] ++[-2,-1] j[5] [4] a[-3--1] c +f. ">c?i:max(j(-1)+j(0,0,0,1),j(-2)+j(0,0,0,2))" +s. c shift... 1 +.. ... shift... 1 +[-3,-1] +>[-2,-1] f. " +a[-2,-1] c f. "j(i,0,0,-1)" channels. 1 ++rows[grad] $nr +[top,-1] +} +max:=iM*2 repeat $sms { =. $max,{xm} } +j[grad] .,0,100% rm[low,top] a[-2,-1] c +f. "0 +-. 2 s[0] c +repeat $s { if $><($s-1) . fi a[$>,-1] c } +permute cxyz a c discard -1 f "i<0?j(0,-1):i" +r {$w+$sms},$h,1,$s,-1 +fi +if $3 +s c,{1-s} g. x,1 round !=. 1 +(0.5,0.5) +convolve[0] . rm.. +j[0] .,0,0,0,0,1,[1] rm[-2,-1] +fi +rprogress {a=w/$1;a<1?a*100:100/a} +while w!=$1 +#@cli shift : vx[%],_vy[%],_vz[%],_vc[%],_boundary_conditions,_interpolation={ 0:nearest_neighbor | 1:linear } : (+) +#@cli : Shift selected images by specified displacement vector. +#@cli : Displacement vector can be non-integer in which case linear interpolation should be chosen. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : Default value: 'boundary_conditions=0' and 'interpolation=0'. +#@cli : $ image.jpg +shift[0] 50%,50%,0,0,0 +shift[0] 50%,50%,0,0,1 +shift[0] 50%,50%,0,0,2 +#@cli shrink_x : size_x>=0 +#@cli : Shrink selected images along the x-axis. +#@cli : $ image.jpg shrink_x 30 +shrink_x : check "$1>=0" +e[^-1] "Shrink image$? along the x-axis with size $1." +foreach { z $1,{w-1-$1} } +#@cli shrink_xy : size>=0 +#@cli : Shrink selected images along the xy-axes. +#@cli : $ image.jpg shrink_xy 30 +shrink_xy : check "$1>=0" +e[^-1] "Shrink image$? along the xy-axes with size $1." +foreach { z $1,$1,{[w,h]-1-$1} } +#@cli shrink_xyz : size>=0 +#@cli : Shrink selected images along the xyz-axes. +shrink_xyz : check "$1>=0" +e[^-1] "Shrink image$? along the xyz-axes with size $1." +foreach { z $1,$1,$1,{[w,h,d]-1-$1} } +#@cli shrink_y : size_y>=0 +#@cli : Shrink selected images along the y-axis. +#@cli : $ image.jpg shrink_y 30 +shrink_y : check "$1>=0" +e[^-1] "Shrink image$? along the y-axis with size $1." +foreach { z 0,$1,100%,{h-1-$1} } +#@cli shrink_z : size_z>=0 +#@cli : Shrink selected images along the z-axis. +shrink_z : check "$1>=0" +e[^-1] "Shrink image$? along the z-axis with size $1." +foreach { z 0,0,$1,100%,100%,{d-1-$1} } +#@cli slices : z0[%],_z1[%] +#@cli : Keep only specified slices of selected images. +#@cli : Dirichlet boundary conditions are used when specified slices are out of range. +#@cli : Default value: 'z1=z0'. +slices : skip ${2=$1} +e[^-1] "Keep slices $1...$2 of image$?." +z 0,0,$1,100%,100%,$2 +#@cli sort : _ordering={ + | - },_axis={ x | y | z | c } : (+) +#@cli : Sort pixel values of selected images. +#@cli : If 'axis' is specified, the sorting is done according to the data of the first column/row/slice/channel +#@cli : of selected images. +#@cli : Default values: 'ordering=+' and 'axis=(undefined)'. +#@cli : $ 64 rand 0,100 +sort display_graph 400,300,3 +#@cli s : eq. to 'split'. : (+) +#@cli split : { x | y | z | c }...{ x | y | z | c },_split_mode : keep_splitting_values={ + | - },_{ x | y | z | c }...{ x | y | z | c },value1,_value2,... : (no arg) : (+) +#@cli : Split selected images along specified axes, or regarding to a sequence of scalar values +#@cli : (optionally along specified axes too). +#@cli : (eq. to 's').\n +#@cli : 'split_mode' can be { 0:split according to constant values | >0:split in N parts | <0:split in parts of size -N }. +#@cli : Default value: 'split_mode=-1'. +#@cli : $ image.jpg split c +#@cli : $ image.jpg split y,3 +#@cli : $ image.jpg split x,-128 +#@cli : $ 1,20,1,1,"1,2,3,4" +split -,2,3 append[1--1] y +#@cli : $ (1,2,2,3,3,3,4,4,4,4) +split x,0 append[1--1] y +#@cli split_tiles : M!=0,_N!=0,_is_homogeneous={ 0 | 1 } +#@cli : Split selected images as a MxN array of tiles. +#@cli : If M or N is negative, it stands for the tile size instead. +#@cli : Default values: 'N=M' and 'is_homogeneous=0'. +#@cli : $ image.jpg +local split_tiles 5,4 blur 3,0 sharpen 700 append_tiles 4,5 done +split_tiles : skip ${2=$1},${3=0} +if $3 e[^-1] "Split image$? as a $1x$2 array of homogeneous tiles." +else e[^-1] "Split image$? as a $1x$2 array of tiles." +fi +foreach { nm={n} s y,$2 s x,$1 if $3 r [0],[0],100%,100%,0 fi =>[^] $nm } +#@cli undistort : -1<=_amplitude<=1,_aspect_ratio,_zoom,_center_x[%],_center_y[%],_boundary_conditions +#@cli : Correct barrel/pincushion distortions occurring with wide-angle lens. +#@cli : References: +#@cli : [1] Zhang Z. (1999). Flexible camera calibration by viewing a plane from unknown orientation. +#@cli : [2] Andrew W. Fitzgibbon (2001). Simultaneous linear estimation of multiple view geometry and lens distortion. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : Default values: 'amplitude=0.25', 'aspect_ratio=0', 'zoom=0', 'center_x=center_y=50%' and 'boundary_conditions=0'. +undistort : check "${1=0.1}>=-1 && $1<=1 && ${6=0}>=0 && $6<=3" skip ${2=0},${3=0},${4=50%},${5=50%} +e[^-1] "Undistort barrel/pincushion effect in image$?, with amplitude $1, aspect ratio $2, zoom factor $3, +center ($4,$5) and "${"arg0 $6,dirichlet,neumann,periodic,mirror"}" boundary conditions." +foreach { +center_x:=ispercentage($4)?w*$4:$4 +center_y:=ispercentage($5)?h*$5:$5 +f " +const interpolation = 1; +const boundary = $6; +const center_x = "$center_x"; +const center_y = "$center_y"; +const alpha = cut($1,-0.999,0.999); +const ratio = $2>=0?1+$2:1/(1-$2); +const zoom = $3>=0?1+$3:1/(1-$3); +const M = max(w,h); +x = 2*(x - center_x)/(zoom*ratio*M); +y = 2*(y - center_y)/(zoom*M); +r = norm(x,y); +nr = r/(1 - alpha*r^2); +if (r>0, +nx = nr/r*x; ny = nr/r*y, +nx = x; ny = y +); +x = 0.5*nx*ratio*M + center_x; +y = 0.5*ny*M + center_y; +I(x,y)" +} +#@cli y : eq. to 'unroll'. : (+) +#@cli unroll : _axis={ x | y | z | c } : (+) +#@cli : Unroll selected images along specified axis. +#@cli : (eq. to 'y'). +#@cli : Default value: 'axis=y'. +#@cli : $ (1,2,3;4,5,6;7,8,9) +unroll y +#@cli upscale_smart : width[%],_height[%],_depth,_smoothness>=0,_anisotropy=[0,1],sharpening>=0 +#@cli : Upscale selected images with an edge-preserving algorithm. +#@cli : Default values: 'height=100%', 'depth=100%', 'smoothness=2', 'anisotropy=0.4' and 'sharpening=10'. +#@cli : $ image.jpg resize2dy 100 +upscale_smart 500%,500% append x +upscale_smart : skip ${2=100%},${3=100%} check "${4=2}>=0 && ${5=0.4}>=0 && $5<=1 && ${6=10}>=0" +e[^-1] "Upscale image$? to $1x$2x$3, with smoothness $4, anisotropy $5 and sharpening $6." +foreach { +w,h={w},{h} ++r. $1,$2,$3,1,0 +if w<$w" && "h<$h +rm. r. $1,$2,$3,100%,2 +else +rm. +diffusiontensors 0,$5,1.2,1.2 +r[-2,-1] $1,$2,$3,100%,5 +smooth.. .,$4 rm. +ac "sharpen. $6,10",ycbcr_y +fi +} +#@cli volumetric2d : _x[%],_y[%],_z[%],_separator_size>=0 +#@cli : Convert selected 3D volumetric images into a 2D representation. +#@cli : Default values: 'x=y=z=50%' and 'separator_size=0'. +#@cli : $ image.jpg resize2dx 64 animate noise,0,100,50 cut 0,255 append z volumetric2d 50%,50%,50%,1 +volumetric2d : skip ${1=50%},${2=50%},${3=50%} check "isint(${4=0}) && $4>=0" +e[^-1] "Convert 3D volumetric image$? into a 2D representation, with coordinates (${1-3}) and separator size $4." +foreach { nm={n} +{[w+d+$4,h+d+$4]},1,100%,{im} ++slices[0] $3 j.. . rm. ++rows[0] $2 permute. xzyc j.. .,0,{0,h+$4} rm. ++columns[0] $1 permute. zyxc j.. .,{0,w+$4},0 +k.. => $nm +} +#@cli :: Filtering +#@cli bandpass : _min_freq[%],_max_freq[%] +#@cli : Apply bandpass filter to selected images. +#@cli : Default values: 'min_freq=0' and 'max_freq=20%'. +#@cli : $ image.jpg bandpass 1%,3% +#@cli : $$ https://gmic.eu/oldtutorial/_bandpass +bandpass : skip ${1=0},${2=20%} +e[^-1] "Apply bandpass filter [$1,$2] to image$?." +foreach { +100%,100%,100% f. "sqrt((x/w-0.5)^2 + (y/h-0.5)^2 + (z/d-0.5)^2)" +n. 0,1 ir. $1,$2 shift. {int(w/2)},{int(h/2)},{int(d/2)},0,2 +fft.. *... . *[-2,-1] ifft rm. +} +#@cli bilateral : [guide],std_deviation_s[%]>=0,std_deviation_r[%]>=0,_sampling_s>=0,_sampling_r>=0 : std_deviation_s[%]>=0,std_deviation_r[%]>=0,_sampling_s>=0,_sampling_r>=0 : (+) +#@cli : Blur selected images by anisotropic (eventually joint/cross) bilateral filtering. +#@cli : If a guide image is provided, it is used for drive the smoothing filter. +#@cli : A guide image must be of the same xyz-size as the selected images. +#@cli : Set 'sampling' arguments to '0' for automatic adjustment. +#@cli : $ image.jpg repeat 5 { bilateral 10,10 } +#@cli b : eq. to 'blur'. : (+) +#@cli blur : std_deviation>=0[%],_boundary_conditions,_kernel : axes,std_deviation>=0[%],_boundary_conditions,_kernel : (+) +#@cli : Blur selected images by a deriche or gaussian filter (recursive implementation). +#@cli : (eq. to 'b').\n +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : 'kernel' can be { 0:deriche | 1:gaussian }. +#@cli : When specified, argument 'axes' is a sequence of { x | y | z | c }. +#@cli : Specifying one axis multiple times apply also the blur multiple times. +#@cli : Default values: 'boundary_conditions=1' and 'kernel=1'. +#@cli : $ image.jpg +blur 5,0 +blur[0] 5,1 +#@cli : $ image.jpg +blur y,10% +#@cli : $$ https://gmic.eu/oldtutorial/_blur +#@cli blur_angular : amplitude[%],_center_x[%],_center_y[%] +#@cli : Apply angular blur on selected images. +#@cli : Default values: 'center_x=center_y=50%'. +#@cli : $ image.jpg blur_angular 2% +#@cli : $$ https://gmic.eu/oldtutorial/_blur_angular +blur_angular : skip ${2=50%},${3=50%} +e[^-1] "Apply angular blur on image$?, with amplitude $1 and center point ($2,$3)." +euclidean2polar $2,$3,1.3,1 +foreach { 1,100% =. 1,50%,50% b. y,$1 convolve_fft.. . rm. } +polar2euclidean $2,$3,1.3,1 +#@cli blur_bloom : _amplitude>=0,_ratio>=0,_nb_iter>=0,_blend_operator={ + | max | min },_kernel={ 0:deriche | 1:gaussian | 2:box | 3:triangle | 4:quadratic },_normalize_scales={ 0 | 1 },_axes +#@cli : Apply a bloom filter that blend multiple blur filters of different radii, +#@cli : resulting in a larger but sharper glare than a simple blur. +#@cli : When specified, argument 'axes' is a sequence of { x | y | z | c }. +#@cli : Specifying one axis multiple times apply also the blur multiple times. +#@cli : Reference: Masaki Kawase, "Practical Implementation of High Dynamic Range Rendering", GDC 2004. +#@cli : Default values: 'amplitude=1', 'ratio=2', 'nb_iter=5', 'blend_operator=+', 'kernel=1', 'normalize_scales=0' and 'axes=(all)' +#@cli : $ image.jpg blur_bloom , +blur_bloom : check "${1=1}>=0 && ${2=2}>=0 && isint(${3=5}) && $3>=0 && isint(${5=1}) && $5>=0 && $5<=4 && +isnum(${6=0})" skip "${4=+},${7=}" +e[^-1] "Apply bloom effect on image$?, with amplitude $1, ratio $2, $3 iterations, blend operator '$4' and "${"arg0 !$6,\"\",\"no \""}"scale normalization." +if narg("$7") axes=$7, fi +m "_bloom0 : b "$axes"$""1" +m "_bloom1 : b "$axes"$""1,1,1" +m "_bloom2 : boxfilter "$axes"{1+2*$""1},0,1" +m "_bloom3 : boxfilter "$axes"{1+2*$""1},0,1,2" +m "_bloom4 : boxfilter "$axes"{1+2*$""1},0,1,3" +foreach { +nm={n} mM:=[im,iM] +[0] repeat $3 { +sigma:=$1*($2^$>) +_bloom$5[0] $sigma +if $6 n. $mM fi +-$4[1,-1] +} +n. $mM k. => $nm +} +um _bloom0,_bloom1,_bloom2,_bloom3,_bloom4 +#@cli blur_linear : amplitude1[%],_amplitude2[%],_angle,_boundary_conditions={ 0:dirichlet | 1:neumann } +#@cli : Apply linear blur on selected images, with specified angle and amplitudes. +#@cli : Default values: 'amplitude2=0', 'angle=0' and 'boundary_conditions=1'. +#@cli : $ image.jpg blur_linear 10,0,45 +#@cli : $$ https://gmic.eu/oldtutorial/_blur_linear +blur_linear : skip ${2=0},${3=0},${4=1} +e[^-1] "Apply linear blur on image$?, with angle $3 deg. and amplitudes ($1,$2)." +std1:=ispercentage($1)?$1*max(w,h):$1 +std2:=ispercentage($2)?$2*max(w,h):$2 +stdM:=round(1.25*max($std1,$std2)) +if $stdM<=0 return fi +foreach { +expand_xy $stdM,{$4!=0} +{s=2*$stdM;[s,s]} gaussian. $1,$2,$3 normalize_sum. +convolve_fft[0] [1] rm. shrink_xy $stdM +} +#@cli blur_radial : amplitude[%],_center_x[%],_center_y[%] +#@cli : Apply radial blur on selected images. +#@cli : Default values: 'center_x=center_y=50%'. +#@cli : $ image.jpg blur_radial 2% +#@cli : $$ https://gmic.eu/oldtutorial/_blur_radial +blur_radial : skip ${2=50%},${3=50%} +e[^-1] "Apply radial blur on image$?, with amplitude $1 and center point ($2,$3)." +euclidean2polar $2,$3,5,1 blur_x $1 polar2euclidean $2,$3,5,1 +#@cli blur_selective : sigma>=0,_edges>0,_nb_scales>0 +#@cli : Blur selected images using selective gaussian scales. +#@cli : Default values: 'sigma=5', 'edges=0.5' and 'nb_scales=5'. +#@cli : $ image.jpg noise 20 cut 0,255 +local[-1] repeat 4 { blur_selective , } done +#@cli : $$ https://gmic.eu/oldtutorial/_blur_selective +blur_selective : check "${1=5}>=0 && ${2=0.5}>=0 && isint(${3=5}) && $3>0" +e[^-1] "Blur image$? using $3 selective gaussian scales, with sigma $1 and edges $2." +foreach { +nm={n} ++gradient_norm +. 1 ^. {-max(0.01,$2)} quantize. {$3+1},0,1 min. {$3-1} ri. .. +repeat $3 { +==. $> *. ... +[-2,-1] b.. {$1/($3+1)} } +rm.. => $nm +} +#@cli blur_x : amplitude[%]>=0,_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror } +#@cli : Blur selected images along the x-axis. +#@cli : Default value: 'boundary_conditions=1'. +#@cli : $ image.jpg +blur_x 6 +#@cli : $$ https://gmic.eu/oldtutorial/_blur_x +blur_x : check "isint(${2=1}) && inrange($2,0,3)" +e[^-1] "Blur image$? along the x-axis, with sigma $1 and "${arg0\ !$2,neumann,dirichlet}" boundary conditions." +deriche $1,0,x,$2 +#@cli blur_xy : amplitude_x[%],amplitude_y[%],_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror } +#@cli : Blur selected images along the X and Y axes. +#@cli : Default value: 'boundary_conditions=1'. +#@cli : $ image.jpg +blur_xy 6 +#@cli : $$ https://gmic.eu/oldtutorial/_blur_y +blur_xy : skip ${2=$1} check "isint(${3=1}) && inrange($3,0,3)" +e[^-1] "Blur image$? along the xy-axes, with sigma $1 and "${arg0\ !$2,neumann,dirichlet}" boundary conditions." +deriche $1,0,x,$3 deriche $2,0,y,$3 +#@cli blur_xyz : amplitude_x[%],amplitude_y[%],amplitude_z,_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror } +#@cli : Blur selected images along the X, Y and Z axes. +#@cli : Default value: 'boundary_conditions=1'. +#@cli : $$ https://gmic.eu/oldtutorial/_blur_xyz +blur_xyz : skip ${2=$1},${3=$1} check "isint(${4=1}) && inrange($4,0,3)" +e[^-1] "Blur image$? along the xyz-axes, with sigma $1 and "${arg0\ !$2,neumann,dirichlet}" boundary conditions." +deriche $1,0,x,$4 deriche $2,0,y,$4 deriche $3,0,z,$4 +#@cli blur_y : amplitude[%]>=0,_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror } +#@cli : Blur selected images along the y-axis. +#@cli : Default value: 'boundary_conditions=1'. +#@cli : $ image.jpg +blur_y 6 +#@cli : $$ https://gmic.eu/oldtutorial/_blur_y +blur_y : check "isint(${2=1}) && inrange($2,0,3)" +e[^-1] "Blur image$? along the y-axis, with sigma $1 and "${arg0\ !$2,neumann,dirichlet}" boundary conditions." +deriche $1,0,y,$2 +#@cli blur_z : amplitude[%]>=0,_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror } +#@cli : Blur selected images along the z-axis. +#@cli : Default value: 'boundary_conditions=1'. +#@cli : $$ https://gmic.eu/oldtutorial/_blur_z +blur_z : check "isint(${2=1}) && inrange($2,0,3)" +e[^-1] "Blur image$? along the z-axis, with sigma $1 and "${arg0\ !$2,neumann,dirichlet}" boundary conditions." +deriche $1,0,z,$2 +#@cli boxfilter : size>=0[%],_order,_boundary_conditions,_nb_iter>=0 : axes,size>=0[%],_order,_boundary_conditions,_nb_iter>=0 : (+) +#@cli : Blur selected images by a box filter of specified size (fast recursive implementation). +#@cli : 'order' can be { 0:smooth | 1:1st-derivative | 2:2nd-derivative }. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : When specified, argument 'axes' is a sequence of { x | y | z | c }. +#@cli : Specifying one axis multiple times apply also the blur multiple times. +#@cli : Default values: 'order=0', 'boundary_conditions=1' and 'nb_iter=1'. +#@cli : $ image.jpg +boxfilter 5% +#@cli : $ image.jpg +boxfilter y,3,1 +#@cli bump2normal +#@cli : Convert selected bumpmaps to normalmaps. +#@cli : $ 300,300 circle 50%,50%,128,1,1 blur 5% bump2normal +bump2normal : +e[^-1] "Convert bumpmap$? to normalmap." +foreach { +channels 0 g xy,1 +f. 1 a c orientation +* 127 + 128 round c 0,255 +} +#@cli closing : size>=0 : size_x>=0,size_y>=0,_size_z>=0 : [kernel],_boundary_conditions,_is_real={ 0:binary-mode | 1:real-mode } +#@cli : Apply morphological closing to selected images. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : Default values: 'size_z=1', 'boundary_conditions=1' and 'is_real=0'. +#@cli : $ image.jpg +closing 10 +closing : skip "${2=},${3=}" +boundary,is_kernel,sel=1,0,^ +if "isnum($1)" +if "['$2']==0 && ['$3']==0" +sx,sy,sz=$1 +e[0--4] "Apply morphological closing to image$?, with kernel of size "$sx"." +else +sx=$1 +if ['$2']==0 sy=1 else sy=$2 fi +if ['$3']==0 sz=1 else sz=$3 fi +e[0--4] "Apply morphological closing to image$?, with "${sx}"x"${sy}"x"${sz}" kernel." +fi +elif ${"is_image_arg $1"}" && narg("${"pass$1 -1"}")==1" +pass$1 +sx,sy,sz={w},{h},{d} +is_kernel,sel,r0,r1,b0,b1,b2,b3=1,^-1,binary,real,dirichlet,neumann,periodic,mirror +is_real=0 +if ['$2']!=0 boundary:=cut($2,0,3) fi +if ['$3']!=0 is_real=$3 fi +e[0--3] "Apply morphological closing to image$? with kernel ["${"pass$1 -1"}"] and "${b$boundary}" boundary ""conditions, in "${r$is_real}" mode." +else error[0--3] "Command 'closing': Invalid arguments '$*'." +fi +if $sx>0||$sy>0||$sz>0 +sx1,sx2:="s=int(($sx-1)/2);[s,$sx-s-1]" +sy1,sy2:="s=int(($sy-1)/2);[s,$sy-s-1]" +sz1,sz2:="s=int(($sz-1)/2);[s,$sz-s-1]" +foreach[$sel] { +nm={n} +if d>1 +r {[w+$sx+1,h+$sy+1,d+$sz+1]},100%,0,$boundary,0.5,0.5,0.5 +if $is_kernel pass. dilate.. .,0,$is_real erode.. .,0,$is_real rm. +else dilate $sx,$sy,$sz erode $sx,$sy,$sz +fi +z {$sx1+1},{$sy1+1},{$sz1+1},{w-$sx2-2},{h-$sy2-2},{d-$sz2-2} => $nm +elif h>1 +r {[w+$sx+1,h+$sy+1]},1,100%,0,$boundary,0.5,0.5 +if $is_kernel pass. dilate.. .,0,$is_real erode.. .,0,$is_real rm. +else dilate $sx,$sy erode $sx,$sy +fi +z {$sx1+1},{$sy1+1},{w-$sx2-2},{h-$sy2-2} => $nm +else +r {w+$sx+1},1,1,100%,0,$boundary,0.5 +if $is_kernel pass. dilate.. .,0,$is_real erode.. .,0,$is_real rm. +else dilate $sx,1 erode $sx,1 +fi +z {$sx1+1},{w-$sx2-2} => $nm +fi +} +fi +if $is_kernel rm. fi +#@cli closing_circ : _size>=0,_is_real={ 0 | 1 } +#@cli : Apply circular dilation of selected images by specified size. +#@cli : Default values: 'boundary_conditions=1' and 'is_real=0'. +#@cli : $ image.jpg +closing_circ 7 +closing_circ : check "$1>=0 && isbool(${2=0})" +r0,r1=binary,real +e[^-1] "Apply morphologicel closing of image$? by circular kernel of size $1, in "${r$2}" mode." +if $1<2 return fi +shape_circle $1 closing[^-1] .,$2 rm. +#@cli compose_freq +#@cli : Compose selected low and high frequency parts into new images. +#@cli : $ image.jpg split_freq 2% mirror[-1] x compose_freq +compose_freq : +e[^-1] "Compose low and high frequency part$? into new images." +repeat int($!/2) { +[$>,{$>+1}] } +#@cli convolve : [mask],_boundary_conditions,_is_normalized={ 0 | 1 },_channel_mode,_xcenter,_ycenter,_zcenter,_xstart,_ystart,_zstart,_xend,_yend,_zend,_xstride,_ystride,_zstride,_xdilation,_ydilation,_zdilation,interpolation_type : (+) +#@cli : Convolve selected images by specified mask. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : 'channel_mode' can be { 0:all | 1:one-for-one | 2:partial sum | 3:full sum }. +#@cli : 'interpolation_type' can be { 0:nearest-neighbor | 1:linear }. +#@cli : Default values: 'boundary_conditions=1', 'is_normalized=0', 'channel_mode=1', 'xcenter=ycenter=zcenter=(undefined)', 'xstart=ystart=zstart=0', 'xend=yend=zend=(max-coordinates)', 'xstride=ystride=zstride=1', 'xdilation=ydilation=zdilation=1' and 'interpolation_type=0'. +#@cli : $ image.jpg (0,1,0;1,-4,1;0,1,0) convolve[-2] [-1] keep[-2] +#@cli : $ image.jpg (0,1,0) resize[-1] 130,1,1,1,3 +convolve[0] [1] +#@cli : $$ https://gmic.eu/oldtutorial/_convolve +#@cli convolve_fft : [mask],_boundary_conditions +#@cli : Convolve selected images with specified mask, in the fourier domain. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : $ image.jpg 100%,100% gaussian[-1] 20,1,45 +convolve_fft[0] [1] +convolve_fft : check ${is_image_arg\ $1}" && isin(${2=2},0,1,2,3)" +e[^-1] "Convolve image$? with mask $1, in the fourier domain." +pass$1 store. kernel +foreach { +if w +w0,h0,d0={w},{h},{d} +$kernel +if $2!=2 r[0] {[w#0,h#0,d#0]+2*round([w#1>1?w#1:0,h#1>1?h#1:0,d#1>1?d#1:0]/2)},100%,0,$2,0.5,0.5 fi +r ${-max_whd},100%,0,0,0.5,0.5 r 100%,100%,100%,${-max_s} +fft[1] fft[0] ++*[1,2] +*[0,3] +[-2,-1] *[1,3] *[0,2] -[0,1] +ifft rm. +shift {-int(([w,h,d]-1)/2)},0,2 +r $w0,$h0,$d0,100%,0,0,0.5,0.5 +fi +} +#@cli correlate : [mask],_boundary_conditions,_is_normalized={ 0 | 1 },_channel_mode,_xcenter,_ycenter,_zcenter,_xstart,_ystart,_zstart,_xend,_yend,_zend,_xstride,_ystride,_zstride,_xdilation,_ydilation,_zdilation,interpolation_type : (+) +#@cli : Correlate selected images by specified mask. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : 'channel_mode' can be { 0:all | 1:one-for-one | 2:partial sum | 3:full sum }. +#@cli : 'interpolation_type' can be { 0:nearest-neighbor | 1:linear }. +#@cli : Default values: 'boundary_conditions=1', 'is_normalized=0', 'channel_mode=1', 'xcenter=ycenter=zcenter=-1', 'xstart=ystart=zstart=0', 'xend=yend=zend=(max-coordinates)', 'xstride=ystride=zstride=1', 'xdilation=ydilation=zdilation=1' and 'interpolation_type=0'. +#@cli : $ image.jpg (0,1,0;1,-4,1;0,1,0) correlate[-2] [-1] keep[-2] +#@cli : $ image.jpg +crop 40%,40%,60%,60% +correlate[0] [-1],0,1 +#@cli cross_correlation : [mask] +#@cli : Compute cross-correlation of selected images with specified mask. +#@cli : $ image.jpg +shift -30,-20 +cross_correlation[0] [1] +cross_correlation : check ${is_image_arg\ $1} +e[^-1] "Compute cross-correlation of image$? with mask $1." +repeat $! { +pass$1 0 l[$>,-1] { +norm fft.. fft. [-2,-1] *.. [-5] *. [-6] +-[-2,-1] *[-5,-3] *[-3,-2] +[-3,-2] ifft rm. +} +} +#@cli curvature +#@cli : Compute isophote curvatures on selected images. +#@cli : $ image.jpg blur 10 curvature +curvature : +e[^-1] "Compute isophote curvatures on image$?." +foreach { +if d==1 ++g xy,0 hessian... xxxyyy +*... .. *[-4] . *[-4] -2 ++[-4,-3] *... .. +sqr[-2,-1] *[-4] . +[-4,-3] ++[-2,-1] +. 0.1 ^. 1.5 / +else ++inn +gradient_norm.. laplacian... +-[-3,-2] +. 0.1 /[-2,-1] ++inn. laplacian.. - +fi +} +#@cli dct : _{ x | y | z }...{ x | y | z } : (no arg) +#@cli : Compute the discrete cosine transform of selected images, optionally along the specified axes only. +#@cli : Output images are always evenly sized, so this command may change the size of the selected images. +#@cli : Default values: (no arg) +#@cli : See also: ''idct''. +#@cli : $ image.jpg +dct +idct[-1] abs[-2] +[-2] 1 log[-2] +#@cli : $$ https://gmic.eu/oldtutorial/_dct-and-idct +dct : skip ${1=0} +('"$1"') +is_axes:="im>=_'x' && iM<=_'z'" +if $is_axes +e[0--3] "Compute discrete cosine transform of image$? along axes '$1'." +repeat w { +axis:=i[$>] +if $axis==_'x' foreach[^-1] { if w>1 _dct fi } +elif $axis==_'y' foreach[^-1] { if h>1 permute yxzc _dct permute yxzc fi } +elif $axis==_'z' foreach[^-1] { if d>1 permute zxyc _dct permute yzxc fi } +fi +} +rm. +else +rm. +e[0--3] "Compute discrete cosine transform of image$?." +noarg +foreach { +if w>1 _dct fi +if h>1 permute yxzc _dct permute yxzc fi +if d>1 permute zxyc _dct permute yzxc fi +} +fi +_dct : +if w%2 r {w+1},100%,100%,100%,0,1 fi +s x l[1--1:2] { a x mirror x } mv[1] $! a x +fft x +100%,1,1,1,2*cos(-x*pi/(2*w)) *[0,2] +100%,1,1,1,2*sin(-x*pi/(2*w)) *[1,2] +- ++z[0] 0,0 /. {sqrt(2)} j.. .,0,0,0 rm. * {sqrt(2/w)} +#@cli deblur : amplitude[%]>=0,_nb_iter>=0,_dt>=0,_regul>=0,_regul_type={ 0:Tikhonov | 1:meancurv. | 2:TV } +#@cli : Deblur image using a regularized Jansson-Van Cittert algorithm. +#@cli : Default values: 'nb_iter=10', 'dt=20', 'regul=0.7' and 'regul_type=1'. +#@cli : $ image.jpg blur 3 +deblur 3,40,20,0.01 +deblur : check "${2=10}>=0 && ${3=20}>=0 && ${4=0.7}>=0" skip ${5=1} +e[^-1] "Deblur image$? with a regularized Jansson-Van Cittert algorithm, with sigma $1, $2 iterations, +time step $3 and regularization $4." +foreach { +nm={n} +[0] +repeat $2 { +if $5>=2 +curvature. +elif $5>=1 +iee. +else +laplacian. +fi +*. $4 ++b.. $1 -. [-4] +-[-2,-1] +*. {$3/(0.0001+max(abs(im),abs(iM)))} ++[-2,-1] +} +rm.. +=> $nm } +#@cli deblur_goldmeinel : sigma>=0,_nb_iter>=0,_acceleration>=0,_kernel_type={ 0:deriche | 1:gaussian }. +#@cli : Deblur selected images using Gold-Meinel algorithm +#@cli : Default values: 'nb_iter=8', 'acceleration=1' and 'kernel_type=1'. +#@cli : $ image.jpg +blur 1 +deblur_goldmeinel[-1] 1 +deblur_goldmeinel : check "$1>=0 && ${2=8}>=0 && ${3=1}>=0" skip ${4=1} +e[^-1] "Deblur image$? using Gold-Meinel algorithm, with sigma $1, $2 iterations, acceleration $3 and "${arg0\ !$4,"",quasi-}"gaussian kernel." +foreach { +[0] repeat $2 { ++b. $1,1,$4 +/[0,-1] rm.. ^. $3 *[-1,-2] +} rm[0] +} +#@cli deblur_richardsonlucy : sigma>=0, nb_iter>=0, _kernel_type={ 0:deriche | 1:gaussian }. +#@cli : Deblur selected images using Richardson-Lucy algorithm. +#@cli : Default values: 'nb_iter=50' and 'kernel_type=1'. +#@cli : $ image.jpg +blur 1 +deblur_richardsonlucy[-1] 1 +deblur_richardsonlucy : check "$1>=0 && ${2=50}>=0" skip ${3=1} +e[^-1] "Deblur image$? using Richardson-Lucy algorithm, with sigma $1, $2 iterations and "${arg0\ !$3,"",quasi-}"gaussian kernel." +foreach { +[0] repeat $2 { ++b. $1,1,{$3!=0} max. 1e-6 +/[0,-1] rm.. b. $1,1,{$3!=0} *[-1,-2] +} rm[0] +} +#@cli deconvolve_fft : [kernel],_regularization>=0 +#@cli : Deconvolve selected images by specified mask in the fourier space. +#@cli : Default value: 'regularization>=0'. +#@cli : $ image.jpg +gaussian 5 +convolve_fft[0] [1] +deconvolve_fft[-1] [1] +deconvolve_fft : check ${is_image_arg\ $1}" && ${2=.001}>=0" +e[^-1] "Deconvolve image$? with mask $1 and regularization $2, in the fourier domain." +repeat $! { pass$1 0 l[$>,-1] { +w2,h2,d2={0,int([w,h,d]/2)} +r[1] [0],[0],[0],1,0,0,0.5,0.5,0.5,0.5 shift[1] -$w2,-$h2,-$d2,0,2 +fft[0] fft[2] ++l[-1,-2] { sqr + + $2 } ++*[-4] ... ++*[-6] ... +-[-2,-1] +*[-6,-4] +*[-4,-3] ++[-4,-3] +/. .. /[-3,-2] +ifft rm. +} } +#@cli deinterlace : _method={ 0 | 1 } +#@cli : Deinterlace selected images ('method' can be { 0:standard or 1:motion-compensated }). +#@cli : Default value: 'method=0'. +#@cli : $ image.jpg +rotate 3,1,1,50%,50% resize 100%,50% resize 100%,200%,1,3,4 shift[-1] 0,1 add +deinterlace 1 +deinterlace : skip ${1=0} +e[^-1] "Deinterlace image$? with "${arg0\ !$1,motion-compensated,standard}" method." +foreach { +wh:=[w,h] +s y a[0--1:2] y a[^0] y ri.. .,0 r 100%,200%,1,100%,5 +if $1!=0 +displacement. ..,0.05 warp... .,1,1,1 rm. fi ++ / 2 c 0,255 r $wh +} +#@cli denoise : [guide],std_deviation_s[%]>=0,std_deviation_r[%]>=0,_patch_size>0,_lookup_size>0,_smoothness,_fast_approx={ 0 | 1 } : std_deviation_s[%]>=0,std_deviation_r[%]>=0,_patch_size>0,_lookup_size>0,_smoothness,_fast_approx={ 0 | 1 } : (+) +#@cli : Denoise selected images by non-local patch averaging. +#@cli : Default values: 'patch_size=5', 'lookup_size=6' and 'smoothness=1'. +#@cli : $ image.jpg +denoise 5,5,8 +#@cli denoise_haar : _threshold>=0,_nb_scales>=0,_cycle_spinning>0 +#@cli : Denoise selected images using haar-wavelet thresholding with cycle spinning. +#@cli : Set 'nb_scales==0' to automatically determine the optimal number of scales. +#@cli : Default values: 'threshold=1.4', 'nb_scale=0' and 'cycle_spinning=10'. +#@cli : $ image.jpg noise 20 cut 0,255 +denoise_haar[-1] 0.8 +denoise_haar : check "${1=1.4}>=0 && isint(${2=0}) && $2>=0 && isint(${3=10}) && $3>0" +e[^-1] "Denoise image$? using haar-wavelet thresholding, with threshold $1, "${arg0\ ($2>0),auto,$2}" scales and $3 spinning cycles." +foreach { +nm={n} nb_scales:=min($2?$2:32,int(log2(min(w,h))-1)) w,h,d={w},{h},{d} sigma=${-std_noise} +r {round(w,2^($nb_scales+1),1)},{round(h,2^($nb_scales+1),1)},{d==1?1:round(d,2^($nb_scales+1),1)},100%,0,0 ++f 0 +repeat $3 { +dx:=round(u(0,{4*$nb_scales})) +dy:=round(u(0,{4*$nb_scales})) +dz:=$d==1?0:round(u(0,{4*$nb_scales})) ++shift[0] $dx,$dy,$dz,0,2 +haar. $nb_scales +threshold. {$1*$sigma},1 +ihaar. $nb_scales +shift. {-$dx},{-$dy},{-$dz},0,2 ++[-2,-1] +} +rm[0] / $3 r $w,$h,$d,100%,0 +=> $nm } +#@cli denoise_cnn : _noise_type={ 0:soft | 1:heavy | 2:heavy (faster) | 3:poisson+gaussian | 4:poisson+gaussian2 },_patch_size>0 +#@cli : Denoise selected images using a convolutional neural network (CNN). +#@cli : Input value range should be [0,255]. Output value range is [0,255]. +#@cli : Default value: 'patch_size=64'. +#@cli : $ image.jpg noise 20 cut 0,255 +denoise_cnn +denoise_cnn : skip "${1=0},${2=64}" +N=$! +if isint($1)" && "inrange($1,0,4) check "isint($2) && $2>0" type=$1 else type=0 noarg fi +s0,s1,s2,s3,s4=soft,heavy,heavy,poisson+gaussian,poisson+gaussian2 +e[^-1] "Denoise image$? using a convolutional neural network (for "${s$type}"-noise), with patch size $2." +if 0${_is_denoise_cnn_$type} ${_denoise_cnn_$type} +else l[] { +l[] { +input_cached gmic_denoise_cnn.gmz +onfail error[0--5] "Command 'denoise_cnn': Unable to load network file 'gmic_denoise_cnn.gmz'." +} +k[$type] unserialize +store _denoise_cnn_$type _is_denoise_cnn_$type=1 +} fi +ps=$2 +replace_str. "nn_layer_","nn_" +replace_str. "nn_input X,32,32,1,3","nn_input X,"$ps","$ps",1,3" +if !$1 +replace_str. "nn_crop OUT,OUT0,2,2,0,29,29,0","nn_crop OUT,OUT0,2,2,0,0,29,29,0,2" +elif inrange($1,1,4) +replace_str. "nn_crop OUT,OUT0,2,2,0,29,29,0","nn_crop OUT,OUT0,2,2,0,0,29,29,0,2" +replace_str. ",1,1,0 ",",1,1,0,1,0 " +replace_str. ",1,1,1 ",",1,1,0,1,1 " +fi +run {t} rm[-2,-1] +repeat $N { l[$>,$N--1] { +w,h:=w#0,h#0 to_color[0] +if $type==3 srgb2rgb[0] +elif $type==4 srgb2rgb[0] /[0] 255 +fi +img2patches[0] $ps,6,3 +1,1,{0,d},1,*${-nn_lib}"X = crop(#0,0,0,z,0,$ps,$ps,1,3);"${_nn_forward}"draw(#0,OUT0,0,0,z,0,$ps,$ps,1,3)" rm. +patches2img[0] $w,$h,6,30% +c[0] 0,255 +if $type==3 rgb2srgb[0] +elif $type==4 *[0] 255 rgb2srgb[0] +fi +} } +rm[$N--1] +#@cli denoise_patchpca : _strength>=0,_patch_size>0,_lookup_size>0,_spatial_sampling>0 +#@cli : Denoise selected images using the patch-pca algorithm. +#@cli : Default values: 'patch_size=7', 'lookup_size=11', 'details=1.8' and 'spatial_sampling=5'. +#@cli : $ image.jpg +noise 20 cut[-1] 0,255 +denoise_patchpca[-1] , +denoise_patchpca : check "${1=1.8} && $1>=0 && isint(${2=7}) && $2>0 && isint(${3=11}) && $3>0 && isint(${4=5}) && $4>0" +e[^-1] "Denoise image$? using patch-pca, with strength $1, patch size $2, lookup size $3 and spatial sampling $4." +foreach { +nm={n} N2:=$2^2 M2:=$3^2 stdnoise=${-std_noise} +100%,100%,1,100% => aggreg +100%,100% => weights +f[0] "* +begin( +n1 = int($2/2); n2 = $2 - n1 - 1; +m1 = int($3/2); m2 = $3 - m1 - 1; +patch(x,y) = crop(x - n1,y - n1,0,c,$2,$2,1,1,1); +ngauss(x) = exp(-x*x/(2*n1*n1)); +ref(vector"$N2"(0),zero); +ref(vector"$N2"(0),mask); +for (l = 0; q = -n1, q<=n2, ++q, +for (p = -n1, p<=n2, ++p, mask[l++] = ngauss(p)*ngauss(q) +) +) +); +if (!(x%$4) && !(y%$4), +ref(patch(x,y),X); +ref(vector"{$N2*$N2}"(0),M); +for (q = -m1, q<=m2, ++q, +for (p = -m1, p<=m2, ++p, +ref(patch(x + p,y + q) - X,Xk); +M += mul(Xk,Xk,"$N2"); +) +); +M/="$M2"; +eig = eig(M); +lambda = sqrt(abs(eig[0,"$N2"])); +for (k = 0, k=$1*"$stdnoise", ++k); +Qt = eig["$N2","{$N2*$N2}"]; +Q = transpose(Qt,"$N2"); +for (q = -m1, q<=m2, ++q, +for (p = -m1, p<=m2, ++p, +pY = Qt*(patch(x + p,y + q) - X); +copy(pY[k],zero[0],size(pY) - k); +(Y = Q*pY)+=X; +draw(#"$aggreg",Y,x + p - n1,y + q - n1,0,c,$2,$2,1,1,-1,mask); +draw(#"$weights",mask,x + p - n1,y + q - n1,0,c,$2,$2,1,1,-1); +) +); +0);0" +max[weights] 0.01 /[aggreg,weights] k[aggreg] => $nm +} +#@cli deriche : std_deviation>=0[%],order={ 0 | 1 | 2 },axis={ x | y | z | c },_boundary_conditions : (+) +#@cli : Apply Deriche recursive filter on selected images, along specified axis and with +#@cli : specified standard deviation, order and boundary conditions. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : Default value: 'boundary_conditions=1'. +#@cli : $ image.jpg deriche 3,1,x +#@cli : $ image.jpg +deriche 30,0,x deriche[-2] 30,0,y add +#@cli : $$ https://gmic.eu/oldtutorial/_deriche +#@cli dilate : size>=0 : size_x>=0,size_y>=0,size_z>=0 : [kernel],_boundary_conditions,_is_real={ 0:binary-mode | 1:real-mode } : (+) +#@cli : Dilate selected images by a rectangular or the specified structuring element. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : Default values: 'size_z=1', 'boundary_conditions=1' and 'is_real=0'. +#@cli : $ image.jpg +dilate 10 +#@cli dilate_circ : _size>=0,_boundary_conditions,_is_real={ 0 | 1 } +#@cli : Apply circular dilation of selected images by specified size. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : Default values: 'boundary_conditions=1' and 'is_real=0'. +#@cli : $ image.jpg +dilate_circ 7 +dilate_circ : check "$1>=0 && isint(${2=1}) && inrange($2,0,3) && isbool(${3=0})" +r0,r1=binary,real +e[^-1] "Apply circular dilation of image$? by size $1, boundary conditions $2, in "${r$3}" mode." +if $1<2 return fi +shape_circle $1 dilate[^-1] .,$2,$3 rm. +#@cli dilate_oct : _size>=0,_boundary_conditions,_is_real={ 0 | 1 } +#@cli : Apply octagonal dilation of selected images by specified size. +#@cli : Default values: 'boundary_conditions=1' and 'is_real=0'. +#@cli : $ image.jpg +dilate_oct 7 +dilate_oct : check "$1>=0 && isint(${2=1}) && inrange($2,0,3) && isbool(${3=0})" +r0,r1=binary,real +e[^-1] "Apply octagonal dilation of image$? by size $1, boundary conditions $2, in "${r$3}" mode." +if $1<2 return fi +if $1&1 ss=$1 else ss:=$1+1 fi +i[0] (0,1,0;1,1,1;0,1,0) i[1] (1,1,1;1,1,1;1,1,1) +repeat $!-2 { +r:=round(($ss-1)*sqrt(2)/(1+sqrt(2))/2) +q:=round(($ss-1)/(1+sqrt(2))/2) +if $r>0 repeat $r { dilate. [0],$2,$3 } fi +if $q>0 repeat $q { dilate. [1],$2,$3 } fi +mv. 2 +} +rm[0,1] +_kr_circle : +if !($1%2) 2,2,1,1,1 else 1,1,1,1,1 fi r. $1,$1,1,1,0,0,0.5,0.5 +distance. 1 round. 0.5 ir. 0,{$1/2} +_jf_circle : +{round($1)},{round($1)} +center:=0.5*(w-1) +f. "sqrt((x - $center)^2 + (y - $center)^2)" +if !(w%2) +round. 0.0001,-1 +t1:=sqrt(((round($1)-1)/2)^2+0.25) +t2:=sqrt(((round($1)+1)/2)^2+0.25) +k:=$1-round($1)+0.5 +t:=$t1+($t2-$t1)*$k +ir. 0,$t +else ir. 0,{$1/2-0.25} +fi +#@cli dilate_threshold : size_x>=1,size_y>=1,size_z>=1,_threshold>=0,_boundary_conditions +#@cli : Dilate selected images in the (X,Y,Z,I) space. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : Default values: 'size_y=size_x', 'size_z=1', 'threshold=255' and 'boundary_conditions=1'. +dilate_threshold : check "isint($1) && $1>=1 && isint(${2=$1}) && $2>=1 && isint(${3=1}) && $3>=1 && ${4=255}>=0 && +isint(${5=1}) && $5>=0" +e[^-1] "Dilate image$? with mask $1x$2x$3, threshold $4 and "${arg\ $5,dirichlet,neumann}" boundary conditions." +l[] { +dx1:=int($1/2) dx2:=$1-$dx1-1 +dy1:=int($2/2) dy2:=$2-$dy1-1 +dz1:=int($3/2) dz2:=$3-$dz1-1 +(-$dx1,$dx1) (-$dy1;$dy1) (-$dz1/$dz1) r $1,$2,$3,1,3 a c round r {w*h*d},3,1,1,-1 transpose. +i.. 1,100%,1,1,254 1,100%,1,1,255 a x +('{^}') rm.. replace_str "254,","(v=j(" replace_str ",255",",0,0,$5);abs(v-i)<=$4?v:-1e20)" list={t} +rm +} +f max($list) +#@cli divergence +#@cli : Compute divergence of selected vector fields. +#@cli : $ image.jpg luminance +gradient append[-2,-1] c divergence[-1] +divergence : +e[^-1] "Compute divergence of vector field$?." +foreach { +if s==1 g x,0 +elif s==2 s c g.. x,0 g. y,0 + +elif s==3 s c g... x,0 g.. y,0 g. z,0 + +else error[] "Command '$0': Cannot compute divergence of image ["$>"] (has "{s}">3 channels)." +fi +} +#@cli dog : _sigma1>=0[%],_sigma2>=0[%] +#@cli : Compute difference of gaussian on selected images. +#@cli : Default values: 'sigma1=2%' and 'sigma2=3%'. +#@cli : $ image.jpg dog 2,3 +dog : check "${1=2%}>=0 && ${2=3%}>=0" +e[^-1] "Compute difference of gaussian on image$?, with standard deviations $1 and $2." +foreach { [0] parallel "b[0] $1","b[1] $2" - abs } +#@cli diffusiontensors : _sharpness>=0,0<=_anisotropy<=1,_alpha[%],_sigma[%],is_sqrt={ 0 | 1 } +#@cli : Compute the diffusion tensors of selected images for edge-preserving smoothing algorithms. +#@cli : Default values: 'sharpness=0.7', 'anisotropy=0.3', 'alpha=0.6', 'sigma=1.1' and 'is_sqrt=0'. +#@cli : $ image.jpg diffusiontensors 0.8 abs pow 0.2 +#@cli : $$ https://gmic.eu/oldtutorial/_diffusiontensors +diffusiontensors : check "${1=0.7}>=0 && ${2=0.3}>=0 && $2<=1" skip ${3=0.6},${4=1.1},${5=0} +e[^-1] "Compute diffusion tensors for image$?, with sharpness $1, anisotropy $2, alpha $3 and sigma $4." +p1:=($5?0.5:1)*max($1,1e-2) +p2:=$p1/(1e-7+1-$2) +b $3 n 0,255 structuretensors 0 b $4 +foreach { +eigen max.. 0 +if s==2 s.. c +[-3,-2] +.. 1 +^.. -$p1 ^... -$p2 a[-3,-1] c +else s.. c +[-4--2] +.. 1 +^.. -$p1 r. 100%,100%,100%,2 ^... -$p2 a[-3,-1] c +fi +eigen2tensor +} +#@cli edges : _threshold[%]>=0 +#@cli : Estimate contours of selected images. +#@cli : Default value: 'edges=15%' +#@cli : $ image.jpg +edges 15% +edges : skip ${1=15%} +e[^-1] "Estimate image contours of image$?, with threshold $1." +gradient_norm b 0.5 >= $1 distance 0 equalize negate c 30%,70% n 0,1 +#@cli erode : size>=0 : size_x>=0,size_y>=0,_size_z>=0 : [kernel],_boundary_conditions,_is_real={ 0:binary-mode | 1:real-mode } : (+) +#@cli : Erode selected images by a rectangular or the specified structuring element. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : Default values: 'size_z=1', 'boundary_conditions=1' and 'is_real=0'. +#@cli : $ image.jpg +erode 10 +#@cli erode_circ : _size>=0,_boundary_conditions,_is_real={ 0 | 1 } +#@cli : Apply circular erosion of selected images by specified size. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : Default values: 'boundary_conditions=1' and 'is_real=0'. +#@cli : $ image.jpg +erode_circ 7 +erode_circ : check "$1>=0 && isint(${2=1}) && inrange($2,0,3) && isbool(${3=0})" +r0,r1=binary,real +e[^-1] "Apply circular erosion of image$? by size $1, boundary conditions $2, in "${r$3}" mode." +if $1<2 return fi +shape_circle $1 erode[^-1] .,$2,$3 rm. +#@cli erode_oct : _size>=0,_boundary_conditions,_is_real={ 0 | 1 } +#@cli : Apply octagonal erosion of selected images by specified size. +#@cli : Default values: 'boundary_conditions=1' and 'is_real=0'. +#@cli : $ image.jpg +erode_oct 7 +erode_oct : check "$1>=0 && isint(${2=1}) && inrange($2,0,3) && isbool(${3=0})" +r0,r1=binary,real +e[^-1] "Apply octagonal erosion of image$? by size $1, boundary conditions $2, in "${r$3}" mode." +if $1<2 return fi +if $1&1 ss=$1 else ss:=$1+1 fi +i[0] (0,1,0;1,1,1;0,1,0) i[1] (1,1,1;1,1,1;1,1,1) +repeat $!-2 { +r:=round(($ss-1)*sqrt(2)/(1+sqrt(2))/2) +q:=round(($ss-1)/(1+sqrt(2))/2) +if $r>0 repeat $r { erode. [0],$2,$3 } fi +if $q>0 repeat $q { erode. [1],$2,$3 } fi +mv. 2 +} +rm[0,1] +#@cli erode_threshold : size_x>=1,size_y>=1,size_z>=1,_threshold>=0,_boundary_conditions +#@cli : Erode selected images in the (X,Y,Z,I) space. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : Default values: 'size_y=size_x', 'size_z=1', 'threshold=255' and 'boundary_conditions=1'. +erode_threshold : check "isint($1) && $1>=1 && isint(${2=$1}) && $2>=1 && isint(${3=1}) && $3>=1 && ${4=255}>=0 && +isint(${5=1}) && $5>=0" +e[^-1] "Erode image$? with mask $1x$2x$3, threshold $4 and "${arg\ $5,dirichlet,neumann}" boundary conditions." +l[] { +dx1:=int($1/2) dx2:=$1-$dx1-1 +dy1:=int($2/2) dy2:=$2-$dy1-1 +dz1:=int($3/2) dz2:=$3-$dz1-1 +(-$dx1,$dx1) (-$dy1;$dy1) (-$dz1/$dz1) r $1,$2,$3,1,3 a c round r {w*h*d},3,1,1,-1 transpose. +i.. 1,100%,1,1,254 1,100%,1,1,255 a x +('{^}') rm.. replace_str "254,","(v=j(" replace_str ",255",",0,0,$5);abs(v-i)<=$4?v:1e20)" list={t} +rm +} +f min($list) +#@cli fft : _{ x | y | z }...{ x | y | z } : (+) +#@cli : Compute the direct fourier transform (real and imaginary parts) of selected images, +#@cli : optionally along the specified axes only. +#@cli : See also: ''ifft''. +#@cli : $ image.jpg luminance +fft append[-2,-1] c norm[-1] log[-1] shift[-1] 50%,50%,0,0,2 +#@cli : $ image.jpg w2:=int(w/2) h2:=int(h/2) fft shift $w2,$h2,0,0,2 ellipse $w2,$h2,30,30,0,1,0 shift -$w2,-$h2,0,0,2 ifft remove[-1] +#@cli : $$ https://gmic.eu/oldtutorial/_fft +#@cli g : eq. to 'gradient'. : (+) +g : +_gmic_s="$?" axes,scheme,boundary,is_noarg=${"_gradient_get_args $*"} +v + _gradient $axes,$scheme,$boundary v - +if $is_noarg noarg fi +#@cli gradient : { x | y | z | c }...{ x | y | z | c },_scheme,_boundary_conditions : (no arg) +#@cli : Compute the gradient components (first derivatives) of selected images, along specified axes. +#@cli : (eq. to 'g').\n +#@cli : 'scheme' can be { -1:backward | 0:centered | 1:forward | 2:sobel | 3:rotation-invariant (default) | 4:deriche | 5:vanvliet }. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : (no arg) compute all significant components. +#@cli : Default values: 'scheme=0' and 'boundary_conditions=1'. +#@cli : $ image.jpg gradient +#@cli : $$ https://gmic.eu/oldtutorial/_gradient +gradient : +_gmic_s="$?" axes,scheme,boundary,is_noarg=${"_gradient_get_args $*"} +v + _gradient $axes,$scheme,$boundary v - +if $is_noarg noarg fi +_gradient_get_args : skip "${1=},${2=},${3=}" +is_noarg=0 +l[] { +if ['$1']==0 axes,scheme,boundary=,0,1 is_noarg=1 +else +is_axes:="s=['$1'];fill(s,k,isin(s[k],_'x',_'y',_'z',_'c'));min(s)" +if !$is_axes axes,scheme,boundary=,0,1 is_noarg=1 +elif ['$2']==0 axes,scheme,boundary=$1,0,1 +else +is_scheme:="isint($2) && inrange($2,-1,5)" +if !$is_scheme axes,scheme,boundary=,0,1 is_noarg=1 +elif ['$3']==0 axes,scheme,boundary=$1,$2,1 +else +is_boundary:="isint($3) && inrange($3,0,3)" +if !$is_boundary axes,scheme,boundary=,0,1 is_noarg=1 +else axes,scheme,boundary=${1-3} +fi +fi +fi +fi +onfail axes,scheme,boundary=,0,1 is_noarg=1 +} +u $axes,$scheme,$boundary,$is_noarg +_gradient : +axes,scheme,boundary=${1=},${2=},${3=} +if ['$axes']!=0 s_axes=" along axes '"$axes"'" fi +s0,s1,s2,s3,s4,s5,s6=backward,centered,forward,sobel,rotation-invariant,deriche,vanvliet +s_scheme=${s{$scheme+1}} +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +s_boundary=${s$boundary} +e[0--3] "Compute gradient of image"$_gmic_s$s_axes", with "$s_scheme" scheme and "$s_boundary" boundary conditions." +sx,sy,sz,sc=",",;,/,^ +foreach { +nm={n} laxes=$axes if ['$laxes']==0 if d>1 laxes=xyz else laxes=xy fi fi +('$laxes') +repeat w { +a={`i[#1,$>]`} s=${s$a} +if 0${gradient_$a}>0 [gradient_$a] +elif $scheme==-1 +(-1${s}1${s}0) +correlate[0] .,$boundary rm.. +elif !$scheme +(-0.5${s}0${s}0.5) +correlate[0] .,$boundary rm.. +elif $scheme==1 +(0${s}-1${s}1) +correlate[0] .,$boundary rm.. +elif $scheme==2 +if _'$a'==_'x' (-1,0,1;-2,0,2;-1,0,1) +elif _'$a'==_'y' (-1,-2,-1;0,0,0;1,2,1) +else (-0.5${s}0${s}0.5) +fi ++correlate[0] .,$boundary rm.. +elif $scheme==3 +A,B:=[0.25*(2-sqrt(2)),0.5*(sqrt(2)-1)] +if _'$a'==_'x' (-$A,0,$A;-$B,0,$B;-$A,0,$A) +elif _'$a'==_'y' (-$A,-$B,-$A;0,0,0;$A,$B,$A) +else (-0.5${s}0${s}0.5) +fi ++correlate[0] .,$boundary rm.. +else +s4,s5=deriche,vanvliet com=${s$scheme} +if $boundary<2 +$com[0] 0,1,$a,$boundary +else +if _'$a'==_'x' +r[0] {0,[w+2,h,d,s]},0,$boundary,0.5 $com. 0,1,$a shrink_x. 1 +elif _'$a'==_'y' +r[0] {0,[w,h+2,d,s]},0,$boundary,0,0.5 $com. 0,1,$a shrink_y. 1 +elif _'$a'==_'z' +r[0] {0,[w,h,d+2,s]},0,$boundary,0,0,0.5 $com. 0,1,$a shrink_z. 1 +fi +fi +fi +=> gradient_$a +} +rm[0,1] =>[^] $nm +} +u $is_noaarg +#@cli gradient_norm +#@cli : Compute gradient norm of selected images. +#@cli : $ image.jpg gradient_norm equalize +#@cli : $$ https://gmic.eu/oldtutorial/_gradient_norm +gradient_norm : +e[^-1] "Compute gradient norm of image$?." +foreach { g sqr s c + sqrt } +#@cli gradient_orientation : _dimension={ 1 | 2 | 3 } +#@cli : Compute N-d gradient orientation of selected images. +#@cli : Default value: 'dimension=3'. +#@cli : $ image.jpg +gradient_orientation 2 +gradient_orientation : check "isint(${1=3}) && inrange($1,1,3)" +e[^-1] "Compute $1-d gradient orientation of image$?." +foreach { +if $1==1 g x +abs. +. 1e-8 -/ +elif $1==2 g xy +sqr +[-2,-1] +. 1e-8 sqrt. /... . /[-2,-1] +else g xyz +sqr +[-3--1] +. 1e-8 sqrt. /[-4,-3] . /[-2,-1] +fi +} +#@cli guided : [guide],radius[%]>=0,regularization[%]>=0 : radius[%]>=0,regularization[%]>=0 : (+) +#@cli : Blur selected images by guided image filtering. +#@cli : If a guide image is provided, it is used to drive the smoothing process. +#@cli : A guide image must be of the same xyz-size as the selected images. +#@cli : This command implements the filtering algorithm described in: +#@cli : He, Kaiming; Sun, Jian; Tang, Xiaoou, "Guided Image Filtering", +#@cli : IEEE Transactions on Pattern Analysis and Machine Intelligence, vol.35, no.6, pp.1397,1409, June 2013 +#@cli : $ image.jpg +guided 5,400 +#@cli haar : scale>0 +#@cli : Compute the direct haar multiscale wavelet transform of selected images. +#@cli : See also: ''ihaar''. +#@cli : $$ https://gmic.eu/oldtutorial/_haar +haar : check "isint(${1=1}) && $1>=0" +e[^-1] "Compute haar transform of image$? with $1 scales." +foreach { +_haar +repeat $1-1 { +w,h,d:="vmax(0,round([w,h,d]/2^(1+"$>"))-1)" ++z 0,0,0,$w,$h,$d _haar. j.. . rm. +} +} +_haar : +_haar_x _haar_y _haar_z +_haar_x : +if w<=1 return fi +if w%2 error[0--6] "Command 'haar': Invalid image width="{w}" (is not even)." fi ++shift -1 r 50% +-[1] [0] +[0,1] / {sqrt(2)} a x +_haar_y : +if h<=1 return fi +if h%2 error[0--6] "Command 'haar': Invalid image height="{h}" (is not even)." fi ++shift 0,-1 r 100%,50% +-[1] [0] +[0,1] / {sqrt(2)} a y +_haar_z : +if d<=1 return fi +if d%2 error[0--6] "Command 'haar': Invalid image depth="{h}" (is not even)." fi ++shift 0,0,-1 r 100%,100%,50% +-[1] [0] +[0,1] / {sqrt(2)} a z +#@cli heat_flow : _nb_iter>=0,_dt,_keep_sequence={ 0 | 1 } +#@cli : Apply iterations of the heat flow on selected images. +#@cli : Default values: 'nb_iter=10', 'dt=30' and 'keep_sequence=0'. +#@cli : $ image.jpg +heat_flow 20 +heat_flow : skip ${1=10},${2=30},${3=0} +e[^-1] "Apply $1 iterations of the heat flow on image$?, with time step $2." +pde_flow $1,$2,laplacian,$3 +#@cli hessian : { xx | xy | xz | yy | yz | zz }...{ xx | xy | xz | yy | yz | zz },_boundary_conditions : (no arg) : +#@cli : Compute the hessian components (second derivatives) of selected images along specified axes. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : (no arg) compute all significant components. +#@cli : Default value: 'boundary_conditions=1'. +#@cli : $ image.jpg hessian +hessian : skip "${1=},${2=}" +l[] { +if ['$1']==0 axes,boundary=,1 noarg +else +is_axes:="s=['$1'];fill(s,k,isin(s[k],_'x',_'y',_'z'));min(s)" +if !$is_axes axes,boundary=,1 noarg +elif ['$2']==0 axes,boundary=$1,1 +else +is_boundary:="isint($2) && inrange($2,0,3)" +if !$is_boundary axes,boundary=,1 noarg +else axes,boundary=$1,$2 +fi +fi +fi +onfail axes,boundary=,1 noarg +} +if ['$axes']!=0 s_axes=" along axes '"$axes"'" fi +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +s_boundary=${s$boundary} +e[^-1] "Compute hessian of image$?"$s_axes", with "$s_boundary" boundary conditions." +foreach { +nm={n} laxes=$axes if ['$laxes']==0 if d>1 laxes=xxxyxzyyyzzz else laxes=xxxyyy fi fi +('$laxes') +repeat int(w/2) { +a1,a2={`i[#1,2*$>]`},{`i[#1,2*$>+1]`} +if _'$a1'>_'$a2' a1,a2=$a2,$a1 fi +if 0${hessian_$a1$a2}>0 [hessian_$a1$a2] +elif _'$a1'==_'x'" && "_'$a2'==_'x' (1,-2,1) +correlate[0] .,$boundary rm.. +elif _'$a1'==_'x'" && "_'$a2'==_'y' (0.25,0,-0.25;0,0,0;-0.25,0,0.25) +correlate[0] .,$boundary rm.. +elif _'$a1'==_'x'" && "_'$a2'==_'z' (0.25,0,-0.25/0,0,0/-0.25,0,0.25) +correlate[0] .,$boundary rm.. +elif _'$a1'==_'y'" && "_'$a2'==_'y' (1;-2;1) +correlate[0] .,$boundary rm.. +elif _'$a1'==_'y'" && "_'$a2'==_'z' (0.25;0;-0.25/0;0;0/-0.25;0;0.25) +correlate[0] .,$boundary rm.. +elif _'$a1'==_'z'" && "_'$a2'==_'z' (1/-2/1) +correlate[0] .,$boundary rm.. +fi +=> hessian_$a1$a2 +} +rm[0,1] =>[^] $nm +} +u $is_noaarg +#@cli idct : _{ x | y | z }...{ x | y | z } : (no arg) +#@cli : Compute the inverse discrete cosine transform of selected images, optionally along the specified axes only. +#@cli : Output images are always evenly sized, so this command may change the size of the selected images. +#@cli : (dct images obtained with the 'dct' command are evenly sized anyway). +#@cli : Default values: (no arg) +#@cli : See also: ''dct''. +#@cli : $$ https://gmic.eu/oldtutorial/_dct-and-idct +idct : skip ${1=0} +('"$1"') +is_axes:="im>=_'x' && iM<=_'z'" +if $is_axes +e[0--3] "Compute inverse discrete cosine transform of image$? along axes '$1'." +repeat w { +axis:=i[$>] +if $axis==_'x' foreach[^-1] { if w>1 _idct fi } +elif $axis==_'y' foreach[^-1] { if h>1 permute yxzc _idct permute yxzc fi } +elif $axis==_'z' foreach[^-1] { if d>1 permute zxyc _idct permute yzxc fi } +fi +} +rm. +else +rm. +e[0--3] "Compute inverse discrete cosine transform of image$?." +noarg +foreach { +if w>1 _idct fi +if h>1 permute yxzc _idct permute yxzc fi +if d>1 permute zxyc _idct permute yzxc fi +} +fi +_idct : +if w%2 r {w+1},100%,100%,100%,0,0 fi +/ {sqrt(2/w)} +z[0] 0,0 *. {sqrt(2)} j.. .,0,0,0 rm. ++mirror x shift. 1 *. -1 +100%,1,1,1,cos(x*pi/(2*w)) +100%,1,1,1,sin(x*pi/(2*w)) ++*[0,3] +*[1,2] +[-2,-1] +*[0,2] *[1,2] -[0,1] +ifft x k[0] / 2 +s x,2 mirror. x +r[0] 200%,100%,100%,100%,4,0,0 +r[1] 200%,100%,100%,100%,4,0,1 ++ +#@cli iee +#@cli : Compute gradient-orthogonal-directed 2nd derivative of image(s). +#@cli : $ image.jpg iee +iee : +e[^-1] "Compute gradient-orthogonal-directed 2nd derivative of image$?." +foreach { +if d==1 ++g xy,0 hessian... xxxyyy +*... .. *[-4] . *[-4] -2 ++[-4,-3] *... .. +sqr[-2,-1] *[-4] . +[-4,-3] ++[-2,-1] +. 1e-8 / +else ++inn laplacian.. - +fi +} +#@cli ifft : _{ x | y | z }...{ x | y | z } : (+) +#@cli : Compute the inverse fourier transform (real and imaginary parts) of selected images. +#@cli : optionally along the specified axes only. +#@cli : See also: ''fft''. +#@cli : $$ https://gmic.eu/oldtutorial/_fft +#@cli ihaar : scale>0 +#@cli : Compute the inverse haar multiscale wavelet transform of selected images. +#@cli : See also: ''haar''. +#@cli : $$ https://gmic.eu/oldtutorial/_haar +ihaar : check "isint(${1=1}) && $1>=0" +e[^-1] "Compute inverse haar transform of image$? with $1 scales." +foreach { +repeat $1-1 { +w,h,d:="vmax(0,round([w,h,d]/2^(1+"$<"))-1)" ++z 0,0,0,$w,$h,$d _ihaar. j.. . rm. +} +_ihaar +} +_ihaar : +_ihaar_x _ihaar_y _ihaar_z +_ihaar_x : +if w<=1 return fi +if w%2 error[0--6] "Command 'ihaar': Invalid image width="{w}" (is not even)." fi +s x,2 r 200% (-1,1) *[-2,-1] + / {sqrt(2)} +_ihaar_y : +if h<=1 return fi +if h%2 error "Command 'ihaar': Invalid image height="{h}" (is not even)." fi +s y,2 r 100%,200% (-1;1) r. {-2,w} *[-2,-1] + / {sqrt(2)} +_ihaar_z : +if d<=1 return fi +if d%2 error "Command 'ihaar': Invalid image depth="{h}" (is not even)." fi +s z,2 r 100%,100%,200% (-1/1) r. {-2,w},{-2,h} *[-2,-1] + / {sqrt(2)} +#@cli ilaplacian : { nb_iterations>0 | 0 },_[initial_estimate] +#@cli : Invert selected Laplacian images. +#@cli : If given 'nb_iterations' is '0', inversion is done in Fourier space (single iteration), +#@cli : otherwise, by applying 'nb_iterations' of a Laplacian-inversion PDE flow. +#@cli : Note that the resulting inversions are just estimation of possible/approximated solutions. +#@cli : Default values: 'nb_iterations=0' and '[initial_estimated]=(undefined)'. +#@cli : $ image.jpg +laplacian +ilaplacian[-1] 0 +ilaplacian : check "${1=0}>=0" skip "${2=}" +is_estimate=${"is_image_arg $2"} nb_iter:=round($1) +if !$nb_iter +if $is_estimate +e[0--4] "Invert Laplacian image$? in Fourier space, with initial estimate $2." +pass$2 1 ia=${-average_vectors} rm. +else +e[0--4] "Invert Laplacian image$? in Fourier space." +ia=0 +fi +foreach { +fft 100%,100%,1,1,"2*(cos(x*2*pi/w) + cos(y*2*pi/h)) - 4" =. 1 +/[-3,-2] . rm. += 0 ifft rm. +} ++ '"begin(S = resize(["$ia"],s,0)); S"' +else +if $is_estimate +e[0--4] "Invert Laplacian image$? using $1 iterations of PDE flow and +initial estimate $2." +repeat $! { pass$2 0 l[$>,-1] { +*[0] 5 i[1] (0,5,0;5,0,5;0,5,0) +repeat $1 { +convolve. [1] -. [0] +[-2,-1] /. 21 } k. +} } +else +e[0--4] "Invert Laplacian image$? using $1 iterations of PDE flow." +foreach { +* 5 (0,5,0;5,0,5;0,5,0) +f.. 0 +repeat $1 { +convolve. [1] -. [0] +[-2,-1] /. 21 } k. +} +fi +fi +#@cli inn +#@cli : Compute gradient-directed 2nd derivative of image(s). +#@cli : $ image.jpg inn +inn : +e[^-1] "Compute gradient-directed 2nd derivative of image$?." +foreach { +if d==1 ++g xy,0 hessian... xxxyyy +*[-5] .. *[-4] . *[-4] 2 ++[-5,-4] *[-4] .. +sqr[-2,-1] *... . +[-4,-3] ++[-2,-1] +. 1e-8 / +else ++g xyz,0 hessian[-4] xxxyxzyyyzzz +*[-9] ... *[-8] .. *[-8] 2 *[-7] . *[-7] 2 ++[-9--7] *[-7] ... +*[-6] .. *[-5] . *[-5] 2 ++[-6,-5] *[-5] .. +[-6,-5] +sqr[-3--1] *[-4] . +[-5,-4] ++[-3--1] +. 1e-8 / +fi +} +#@cli inpaint : [mask] : [mask],0,_fast_method : [mask],_patch_size>=1,_lookup_size>=1,_lookup_factor>=0,_lookup_increment!=0,_blend_size>=0,0<=_blend_threshold<=1,_blend_decay>=0,_blend_scales>=1,_is_blend_outer={ 0 | 1 } : (+) +#@cli : Inpaint selected images by specified mask. +#@cli : If no patch size (or 0) is specified, inpainting is done using a fast average or median algorithm. +#@cli : Otherwise, it used a patch-based reconstruction method, that can be very time consuming. +#@cli : 'fast_method' can be { 0:low-connectivity average | 1:high-connectivity average | 2:low-connectivity median | 3:high-connectivity median }. +#@cli : Default values: 'patch_size=0', 'fast_method=1', 'lookup_size=22', 'lookup_factor=0.5', 'lookup_increment=1', 'blend_size=0', 'blend_threshold=0', 'blend_decay=0.05', 'blend_scales=10' and 'is_blend_outer=1'. +#@cli : $ image.jpg 100%,100% ellipse 50%,50%,30,30,0,1,255 ellipse 20%,20%,30,10,0,1,255 +inpaint[-2] [-1] remove[-2] +#@cli : $ image.jpg 100%,100% circle 30%,30%,30,1,255,0,255 circle 70%,70%,50,1,255,0,255 +inpaint[0] [1],5,15,0.5,1,9,0 remove[1] +#@cli inpaint_pde : [mask],_nb_scales[%]>=0,_diffusion_type={ 0:isotropic | 1:Delaunay-guided | 2:edge-guided | 3:mask-guided },_diffusion_iter>=0 +#@cli : Inpaint selected images by specified mask using a multiscale transport-diffusion algorithm. +#@cli : If 'diffusion type==3', non-zero values of the mask (e.g. a distance function) are used +#@cli : to guide the diffusion process. +#@cli : Default values: 'nb_scales=75%', 'diffusion_type=1' and 'diffusion_iter=20'. +#@cli : $ image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 +inpaint_pde[0] [1] +inpaint_pde : check ${is_image_arg\ $1}" && ${2=75%}>=0 && isint(${3=1}) && $3>=0 && $3<=3 && ${4=20}>=0" +s0="isotropic" s1="Delaunay-guided" s2="edge-guided" s3="mask-guided" +e[^-1] "Inpaint image$? by mask $1, using a multiscale diffusion algorithm with $2 scales +and $4 iterations of "${s$3}" diffusion." +repeat $! { nm={n} pass$1 l[$>,-1] { +nb_scalesM:=ceil(log2(max(w,h,d))) +nb_scales:=round(ispercentage($2)?$nb_scalesM*$2:$2) +nb_scales:=max(1,min($nb_scales,$nb_scalesM)) +nb_iter:=max(5,$4) +repeat $nb_scales { +{0,"S = 2^"$<"; round([ max(1,w/S), max(1,h/S), max(1,d/S), s ])"} +100%,100%,100% +eval[1] "const wl1 = w#-1 - 1; const hl1 = h#-1 - 1; const dl1 = d#-1 - 1; +const w1 = max(1,w - 1); const h1 = max(1,h - 1); const d1 = max(1,d - 1); +!i?( +X = round(x*wl1/w1); Y = round(y*hl1/h1); Z = round(z*dl1/d1); +I(#-2,X,Y,Z) += I(#0,x,y,z); +++i(#-1,X,Y,Z) +);I" ++max. 1 /[-3,-1] !=. 0 +if !$> +im={-2,im} +-.. {$im-1} *. .. ++distance.. 1 *. -1 watershed.. . rm. ++. {$im-1} mv. -3 +fi +if $>>0" || "$nb_scales==1 +ri... ..,3 +if !$3 +repeat $nb_iter { j... ..,0,0,0,0,1,. b... 0.5 } +elif $3==1 ++distance. 1 100%,100%,100%,{d==1?2:3} +eval.. "* +const boundary = 1; +maxabs(a,b) = (abs(a)>abs(b)?a:b); +ix = maxabs(j(1) - i,i - j(-1)); +iy = maxabs(j(0,1) - i,i - j(0,-1)); +d>1?( +iz = maxabs(j(0,0,1) - i,i - j(0,0,-1)); +copy(I(#-1),[ ix,iy,iz ],3,whd); +):copy(I(#-1),[ ix,iy ],2,whd)" +rm.. orientation. +repeat $nb_iter { +j[-4] ...,0,0,0,0,1,.. ++warp[-4] .,1,2,1 *.. -1 warp[-5] ..,1,2,1 +[-5,-1] /[-4] 2 +} +rm. +elif $3==2 +repeat $nb_iter { ++diffusiontensors... 0,1,1.5,0.5 +j[-4] ...,0,0,0,0,1,.. +smooth[-4] .,1,10,0 rm. +} +else ++r[1] .,2 g. a[-{d==1?2:3}--1] c orientation. +repeat $nb_iter { +j[-4] ...,0,0,0,0,1,.. ++warp[-4] .,1,2,1 *.. -1 warp[-5] ..,1,2,1 +[-5,-1] /[-4] 2 +} rm. +fi +j... ..,0,0,0,0,1,. +fi +rm[-2,-1] +} +=> $nm rv[0,-1] rm. +} rm. } +#@cli inpaint_flow : [mask],_nb_global_iter>=0,_nb_local_iter>=0,_dt>0,_alpha>=0,_sigma>=0 +#@cli : Apply iteration of the inpainting flow on selected images. +#@cli : Default values: 'nb_global_iter=10', 'nb_local_iter=100', 'dt=5', 'alpha=1' and 'sigma=3'. +#@cli : $ image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 inpaint_flow[0] [1] +inpaint_flow : check ${is_image_arg\ $1}" && ${2=10}>=0 && ${3=100}>=0 && ${4=5}>0 && ${5=1}>=0 && ${6=3}>=0" +e[^-1] "Apply $2x$3 iterations of the inpainting flow on image$?, with mask $1, time step $4, alpha $5 and sigma $6." +repeat $! { +pass$1 0 l[$>,-1] { +r. [0],[0],[0],1,0 inpaint.. [1] +repeat $2 { +progress {100*$>/($2-1)} ++diffusiontensors.. 0,1,$5,$6,0 *. .. smooth... .,$3,$4,0 rm. +} +progress 100 +} +rm. +} +#@cli inpaint_holes : maximal_area[%]>=0,_tolerance>=0,_is_high_connectivity={ 0 | 1 } +#@cli : Inpaint all connected regions having an area less than specified value. +#@cli : Default values: 'maximal_area=4', 'tolerance=0' and 'is_high_connectivity=0'. +#@cli : $ image.jpg noise 5%,2 +inpaint_holes 8,40 +inpaint_holes : check "${1=4}>=0 && ${2=0}>=0" skip ${3=0} +e[^-1] "Inpaint holes with area less than $1 pixels in image$?, with tolerance $2 and "${arg0\ !$3,high,low}" connectivity." +foreach { +100%,100%,100% +area:=ispercentage($1)?$1*w*h*d:$1 +repeat s#0 { sh[0] $> +area. $2,$3 <=. $1 -|[1,-1] rm. } +if im k[0] whd={w},{h},{d} r 1,1,1,100%,2 r $whd,100% +else inpaint[0] [1],0,{2*!$2+!!$3} k[0] fi +} +#@cli inpaint_morpho : [mask] +#@cli : Inpaint selected images by specified mask using morphological operators. +#@cli : $ image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 +inpaint_morpho[0] [1] +inpaint_morpho : check ${is_image_arg\ $1} +e[^-1] "Inpaint image$? by mask $1, using morphological operators." +repeat $! { +pass$1 0 l[$>,-1] { +nm={0,n} im,iM={0,[im,iM]} im1,iM1:=$im-1,$iM+1 +channels. 0 ==. 0 ++f[0] $im1 j. [0],0,0,0,0,1,.. +do ++dilate. 3 +replace.. $im1,$iM1 +erode.. 3 +replace.. $iM1,$im1 ++[-2,-1] /. 2 +j. ...,0,0,0,0,1,.. +while im==$im1 +k. => $nm +} +} +#@cli inpaint_matchpatch : [mask],_nb_scales={ 0:auto | >0 },_patch_size>0,_nb_iterations_per_scale>0,_blend_size>=0,_allow_outer_blending={ 0 | 1 },_is_already_initialized={ 0 | 1 } +#@cli : Inpaint selected images by specified binary mask, using a multi-scale matchpatch algorithm. +#@cli : Default values: 'nb_scales=0', 'patch_size=9', 'nb_iterations_per_scale=10', 'blend_size=5','allow_outer_blending=1' and 'is_already_initialized=0'. +#@cli : $ image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 +inpaint_matchpatch[0] [1] +inpaint_matchpatch : check ${is_image_arg\ $1}"&& ${2=0}>=0 && isint(${3=9}) && $3>0 && isint(${4=10}) && $4>0 && +isint(${5=5}) && $5>=0" skip ${6=1},${7=0} +e[^-1] "Inpaint image$? with mask $1, using a multiscale patch-matching algorithm with "${"if $2 u \"$2 \" else u auto- fi"}"scales, $3x$3 patches, $4 iterations per scale and blending size $5." +repeat $! { pass$1 0 l[$>,-1] { +nm={0,n} +=> img,mask +nb_scales:=max(1,round($2?$2:log2(min(w,h)/16),1,1)) +visu_size=${fitscreen[]" "{0,[w,h,1]},25%,50%} +slices[img] 0 r[mask] [img],[img],1,1,0 !=[mask] 0 +if !$7 inpaint_pde[img] [mask],75% fi +im={img,im} -[img] $im +first_iter=1 iter=0 +repeat $nb_scales { +scale:=100*(0.5^$<) +e "> Process scale "{1+$>}"/"$nb_scales" -> "$scale% +progress {100*$>/max(1,$nb_scales-1)} ++r[img,mask] $scale%,$scale%,1,100%,2 => scaled_img,scaled_mask +>=[scaled_mask] 0.95 +if {scaled_mask,!iM} rm[scaled_img,scaled_mask] continue fi ++f[scaled_img] -4096 +j[scaled_img] .,0,0,0,0,1,[scaled_mask] rm.. => scaled_reference +coef:=0.5^($nb_scales-$iter) +patch_size:="v=round(max(min($3,5),$3*$coef));v+(1-(v%2))" +patch_size:=min(w,h,$patch_size) +blend_size:="v=$5?round(max(3,$5*$coef)):0;v+(1-(v%2))" +iter+=1 +==[scaled_mask] 0 +if $first_iter +100%,100%,1,1,x +f. y mv[scaled_mask] $! a[-3--1] c +matchpatch[scaled_img] [scaled_reference],$patch_size,$patch_size,1,4,4,0,0,. +rm[scaled_reference,-1] +=> correspondence +first_iter=0 +else +*[correspondence] 2 r[correspondence] 200%,200%,1,2 r[correspondence] [scaled_img],[scaled_img],1,2,0,1 +100%,100%,1,1,x +f. y a[-2,-1] c +f[scaled_mask] "*i?1:( +upc = i(#"$correspondence",x-1,y,0,0); vpc = i(#"$correspondence",x-1,y,0,1); +ucp = i(#"$correspondence",x,y-1,0,0); vcp = i(#"$correspondence",x,y-1,0,1); +ucc = i(#"$correspondence",x,y,0,0); vcc = i(#"$correspondence",x,y,0,1); +i(#-1,x,y,0,0) = (ucc==upc && vcc==vpc)?upc + 1:ucc; +i(#-1,x,y,0,1) = (ucc==ucp && vcc==vcp)?vcp + 1:vcc; +0)" +rm[correspondence] => correspondence +a[correspondence] [scaled_mask],c +nbs1:=max(1,$nb_scales-1) +nb_iter:=round(max(1,$4*(($<+1)/$nbs1)^2)) +repeat $nb_iter { +_inpaint_matchpatch[scaled_img] [correspondence],[scaled_mask],$blend_size,$6 ++matchpatch[scaled_img] [scaled_reference],$patch_size,$patch_size,1,4,4,0,0,[correspondence] +j[correspondence] . rm. +if {*1} w1[scaled_img] $visu_size,0 fi +if {*2} w2[correspondence] $visu_size,1 fi +} +rm[scaled_img,scaled_mask,scaled_reference] channels[correspondence] 0,1 +fi +} +progress 100 +if $correspondence +==[mask] 0 +_inpaint_matchpatch[img] [correspondence],[mask],$5,$6 +rm[correspondence] +fi ++[img] $im +=>[0] $nm +} rm[mask] } +_inpaint_matchpatch : +pass$1 1 pass$2 {!$3" || "!$4} +if !$3 +warp[0] [1],0,0,1 +else +if $4 erode. $3 fi +f[0] "*begin( +boundary = 1; +const patch_size = $3; +const p2 = int(patch_size/2); +const p1 = patch_size - p2 - 1; +avg = resize([0],s#0); +wpq = resize([0],patch_size^2); +g = 0; +for (q = -p1, q<=p2, ++q, +for (p = -p1, p<=p2, ++p, +wpq[g++] = exp(-(p^2 + q^2)/(2*(0.3*patch_size)^2)); +); +); +); +if (i#2,I, +g = 0; +avg = 0; +norm = 0; +for (q = -p1, q<=p2, ++q, +for (p = -p1, p<=p2, ++p, +U = I(#1,x + p,y + q); +w = wpq[g++]; +norm+=w; +avg+=w*I(#0,U[0,2] - [p,q]); +); +); +avg/norm)" +fi +k[0] +_inpaint_warping2d : +foreach { +100%,100%,100%,2,"> begin(const S = s#0; zero0 = vectorS(); zero1 = [0,0]; N = 0); I(#-1)==zero0?zero1:[++N,1]" +s. c distance. 1 *. -1 +watershed.. . rm. +repeat 2 { +f.. ">i?I:( +nP = vectors(); +const sP = size(nP); +r = i(#-1); +(P = J(-1,-1))[0] && j(#-1,-1,-1)==r?(nP[0] = ++P[0]; nP[1] = ++P[1]; sP>2?copy(nP[2],P[2],sP-2)): +(P = J(0,-1))[0] && j(#-1,0,-1)==r ?(nP[0] = P[0]; nP[1] = ++P[1]; sP>2?copy(nP[2],P[2],sP-2)): +(P = J(1,-1))[0] && j(#-1,1,-1)==r ?(nP[0] = --P[0]; nP[1] = ++P[1]; sP>2?copy(nP[2],P[2],sP-2)): +(P = J(-1,0))[0] && j(#-1,-1,0)==r ?(nP[0] = ++P[0]; nP[1] = P[1]; sP>2?copy(nP[2],P[2],sP-2)); +nP)" +f.. "2?copy(nP[2],P[2],sP-2)): +(P = J(0,1))[0] && j(#-1,0,1)==r ?(nP[0] = P[0]; nP[1] = --P[1]; sP>2?copy(nP[2],P[2],sP-2)): +(P = J(-1,1))[0] && j(#-1,-1,1)==r?(nP[0] = ++P[0]; nP[1] = --P[1]; sP>2?copy(nP[2],P[2],sP-2)): +(P = J(1,0))[0] && j(#-1,1,0)==r ?(nP[0] = --P[0]; nP[1] = P[1]; sP>2?copy(nP[2],P[2],sP-2)); +nP)" +} +rm. +} +#@cli kuwahara : size>0 +#@cli : Apply Kuwahara filter of specified size on selected images. +#@cli : $ image.jpg kuwahara 9 +kuwahara : check $1>0 +e[^-1] "Apply Kuwahara filter of size $1 on image$?." +foreach { +s:=s ++dilate $1 compose_channels. min ++erode[0] $1 compose_channels. max +-[-2,-1] +$1,1,1,1,{1/$1} convolve[0] . transpose. convolve[0] . rm. +p:=int($1/2) +a[-2,-1] c +f "v1=i(x-"$p",y-"$p",0,"$s",0,1); v2=i(x+"$p",y-"$p",0,"$s",0,1); v3=i(x-"$p",y+"$p",0,"$s",0,1); v4=i(x+"$p",y+"$p",0,"$s",0,1); vm=min(v1,v2,v3,v4); c>="$s"?i: vm==v1?i(x-"$p",y-"$p",0,c,0,1): +vm==v2?i(x+"$p",y-"$p",0,c,0,1): +vm==v3?i(x-"$p",y+"$p",0,c,0,1): +i(x+"$p",y+"$p",0,c,0,1)" +channels 0,{s-2} +} +#@cli laplacian +#@cli : Compute Laplacian of selected images. +#@cli : $ image.jpg laplacian +laplacian : +e[^-1] "Compute Laplacian of image$?." +foreach { hessian ${arg0\ (d==1),xxyyzz,xxyy} + } +#@cli lic : _amplitude>0,_channels>0 +#@cli : Render LIC representation of selected vector fields. +#@cli : Default values: 'amplitude=30' and 'channels=1'. +#@cli : $ 400,400,1,2,'!c?x-w/2:y-h/2' +lic 200,3 quiver[-2] [-2],10,1,1,1,255 +lic : skip ${1=30},${2=1} +e[^-1] "Render LIC representation of 2D vector field$?, with amplitude $1 and $2 channel(s)." +foreach { +nm={n} +channels 0,1 / {max(abs(im),abs(iM))} vector2tensor +100%,100%,100%,$2 rand. 0,255 smooth. ..,$1 rm.. +equalize => $nm +} +#@cli map_tones : _threshold>=0,_gamma>=0,_smoothness>=0,nb_iter>=0 +#@cli : Apply tone mapping operator on selected images, based on Poisson equation. +#@cli : Default values: 'threshold=0.1', 'gamma=0.8', 'smoothness=0.5' and 'nb_iter=30'. +#@cli : $ image.jpg +map_tones , +map_tones : skip ${1=0.1},${2=0.8},${3=0.5},${4=30} +e[^-1] "Apply tone mapping operator on image$?, with threshold $1, gamma $2, smoothness $3 and $4 iterations." +foreach { ++l { +s c foreach { +g xy,1 a c +norm orientation.. +m,M:=[im,iM] b. $3 n. $m,$M +*. 'alpha=$1*iM;(alpha/(1e-10+i))*(i/(1e-10+alpha))^$2' +* s c g.. x,-1 g. y,-1 + +} +a c * 0.25 +} +repeat $4 { +laplacian.. *. 0.25 +. ... -. .. *. 800 +[-3,-1] /.. 801 c.. 0,255 } rm. +} +#@cli map_tones_fast : _radius[%]>=0,_power>=0 +#@cli : Apply fast tone mapping operator on selected images. +#@cli : Default values: 'radius=3%' and 'power=0.3'. +#@cli : $ image.jpg +map_tones_fast , +map_tones_fast : check "${1=3%}>=0 && ${2=0.3}>=0" +e[^-1] "Apply fast tone mapping operator on image$?, with radius $1 and power $2." +foreach { ++luminance b. $1 n 0,1 ++*. 2 -. 1 abs. *. {$2*log(10)} exp. +<=.. 0.5 ri. ... ++*... -1 +. 1 ^. .. *. -1 +. 1 *. ... +^[-4,-2] ==.. 0 *[-3,-2] + +} +n 0,255 +#@cli meancurvature_flow : _nb_iter>=0,_dt,_keep_sequence={ 0 | 1 } +#@cli : Apply iterations of the mean curvature flow on selected images. +#@cli : Default values: 'nb_iter=10', 'dt=30' and 'keep_sequence=0'. +#@cli : $ image.jpg +meancurvature_flow 20 +meancurvature_flow : skip ${1=10},${2=30},${3=0} +e[^-1] "Apply $1 iterations of the mean curvature flow on image$?, with time step $2." +pde_flow $1,$2,iee,$3 +#@cli median : size>=0,_threshold>0 : (+) +#@cli : Apply (opt. thresholded) median filter on selected images with structuring element size x size. +#@cli : $ image.jpg +median 5 +#@cli merge_alpha +#@cli : Merge selected alpha detail scales into a single image. +#@cli : Alpha detail scales have been obtained with command ''split_alpha''. +merge_alpha : +e[^-1] "Merge alpha detail$? into a single image." +repeat $!-1 { +r[0] [1],[1],1,100%,5 c[0] 0,255 +blend[0,1] alpha +} +if s=['{b}'];find(s,'_0')==size(s)-2 +ext={x} if ['$ext']!=0 ext..=. fi +({'{f}{b}'}) z. 0,{w-3} bm={t} rm. +=> $bm$ext +fi +#@cli nlmeans : [guide],_patch_radius>0,_spatial_bandwidth>0,_tonal_bandwidth>0,_patch_measure_command : _patch_radius>0,_spatial_bandwidth>0,_tonal_bandwidth>0,_patch_measure_command +#@cli : Apply non local means denoising of Buades et al, 2005. on selected images. +#@cli : The patch is a gaussian function of 'std_patch_radius'. +#@cli : The spatial kernel is a rectangle of radius 'spatial_bandwidth'. +#@cli : The tonal kernel is exponential (`exp(-d^2/_tonal_bandwidth^2)`) +#@cli : with `d` the euclidean distance between image patches. +#@cli : Default values: 'patch_radius=4', 'spatial_bandwidth=4', 'tonal_bandwidth=10' and 'patch_measure_command=-norm'. +#@cli : $ image.jpg +noise 10 nlmeans[-1] 4,4,{0.6*${-std_noise}} +nlmeans: +if ${"is_image_arg $1"} +check "${2=4}>0 && ${3=4}>0 && ${4=10}>0" skip "${5=-norm}" +e[^-1] "Apply non-local means denoising on image$?, with guide $1, patch size $2, spatial bandwidth $3, +tonal bandwidth $4 and patch measure command '$5'." +pass$1 0 l. { $5 k[0] } +repeat $!-1 { l[$>,-1] { +100%,100%,100%,100%,{-1.0/($4*$4)} +nlmeans_core[0] [1],[2],$2,$3 rm. +} } +rm. +else +check "${1=4}>0 && ${2=4}>0 && ${3=10}>0" skip "${4=-norm}" +e[^-1] "Apply non-local means denoising on image$?, with patch size $1, spatial bandwidth $2, +tonal bandwidth $3 and patch measure command '$4'." +foreach { ++l { $4 k[0] } +100%,100%,100%,100%,{-1.0/($3*$3)} +nlmeans_core[0] [1],[2],$1,$2 k[0] +} +fi +#@cli nlmeans_core: _reference_image,_scaling_map,_patch_radius>0,_spatial_bandwidth>0 +#@cli : Apply non local means denoising using a image for weight and a map for scaling +nlmeans_core : check ${is_image_arg\ $1}" && "${is_image_arg\ $2}" && $3>0 && $4>0" +e[^-1] "Apply non-local means denoising using weight images $1, scaling map $2, patch size $3 and +spatial bandwidth $4." +pass$1 0 pass$2 0 +repeat $!-2 { l[$>,-1,-2] { +100%,100%,100%,{0,s},0 100%,100%,100%,{1,s},0 100%,100%,100%,{1,s},1e-6 +if d#0==1 +repeat 2*$4+1 { j:=$>-$4 repeat 2*$4+1 { i:=$>-$4 +if $i!=0||$j!=0 ++shift[0,1] $i,$j,0,0,2 -[7] [1] +sqr[7] b[7] $3 *[7] [2] exp[7] +*[6] [7] max[5] [7] +[4,7] +[3,6] +fi +} } +else +repeat 2*$4+1 { k:=$>-$4 repeat 2*$4+1 { j:=$>-$4 repeat 2*$4+1 { i:=$>-$4 +if $i!=0||$j!=0||$k!=0 ++shift[0,1] $i,$j,0,0,2 -[7] [1] +sqr[7] b[7] $3 *[7] [2] exp[7] +*[6] [7] max[5] [7] +[4,7] +[3,6] +fi +} } } +fi +rm[1,2] +*[0] [3] +[1,0] +[1,2] +/ +} } +#@cli normalize_local : _amplitude>=0,_radius>0,_n_smooth>=0[%],_a_smooth>=0[%],_is_cut={ 0 | 1 },_min=0,_max=255 +#@cli : Normalize selected images locally. +#@cli : Default values: 'amplitude=3', 'radius=16', 'n_smooth=4%', 'a_smooth=2%', 'is_cut=1', 'min=0' and 'max=255'. +#@cli : $ image.jpg normalize_local 8,10 +normalize_local : +check "${1=3}>=0 && ${2=16}>0 && isbool(${5=1})" skip ${3=4%},${4=2%},${6=0},${7=255} +e[^-1] "Normalize image$? locally, with amplitude $1, radius $2, neighborhood smoothness $3 and +average smoothness $4." +foreach { ++l { erode {2*$2+1} s c min } ++l.. { dilate {2*$2+1} s c max } ++b... $4 b[-3,-2] $3 ++-.. ... +. 0.01 -[-5] [-4] /[-5,-1] +*[-3,-2] {$1+1} *. -$1 +... . +[-2,-1] +if $5 max.. $6 min. $7 fi +-. .. *[-3,-1] + +if $5 c $6,$7 fi +} +#@cli normalized_cross_correlation : [mask] +#@cli : Compute normalized cross-correlation of selected images with specified mask. +#@cli : $ image.jpg +shift -30,-20 +normalized_cross_correlation[0] [1] +normalized_cross_correlation : check ${is_image_arg\ $1} +e[^-1] "Compute normalized cross-correlation of image$? with mask $1." +pass$1 0 norm repeat $!-1 { . l[$>,-1] { +fft.. fft. [-2,-1] *.. [-5] *. [-6] +-[-2,-1] *[-5,-3] *[-3,-2] +[-3,-2] [-2,-1] a[-2,-1] c norm. +/... . /[-2,-1] ifft rm. +} } rm. +#@cli opening : size>=0 : size_x>=0,size_y>=0,_size_z>=0 : [kernel],_boundary_conditions,_is_real={ 0:binary-mode | 1:real-mode } +#@cli : Apply morphological opening to selected images. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : Default values: 'size_z=1', 'boundary_conditions=1' and 'is_real=0'. +#@cli : $ image.jpg +opening 10 +opening : skip "${2=},${3=}" +boundary,is_kernel,sel=1,0,^ +if "isnum($1)" +if "['$2']==0 && ['$3']==0" +sx,sy,sz=$1 +e[0--4] "Apply morphological opening to image$?, with kernel of size "$sx"." +else +sx=$1 +if ['$2']==0 sy=1 else sy=$2 fi +if ['$3']==0 sz=1 else sz=$3 fi +e[0--4] "Apply morphological opening to image$?, with "${sx}"x"${sy}"x"${sz}" kernel." +fi +elif ${"is_image_arg $1"}" && narg("${"pass$1 -1"}")==1" +pass$1 +sx,sy,sz={w},{h},{d} +is_kernel,sel,r0,r1,b0,b1,b2,b3=1,^-1,binary,real,dirichlet,neumann,periodic,mirror +is_real=0 +if ['$2']!=0 boundary:=cut($2,0,3) fi +if ['$3']!=0 is_real=$3 fi +e[0--3] "Apply morphological opening to image$? with kernel ["${"pass$1 -1"}"] and "${b$boundary}" boundary ""conditions, in "${r$is_real}" mode." +else error[0--3] "Command 'opening': Invalid arguments '$*'." +fi +if $sx>0||$sy>=0||$sz>=0 +sx1,sx2:="s=int(($sx-1)/2);[s,$sx-s-1]" +sy1,sy2:="s=int(($sy-1)/2);[s,$sy-s-1]" +sz1,sz2:="s=int(($sz-1)/2);[s,$sz-s-1]" +foreach[$sel] { +nm={n} +if d>1 +r {[w+$sx+1,h+$sy+1,d+$sz+1]},100%,0,$boundary,0.5,0.5,0.5 +if $is_kernel pass. erode.. .,0,$is_real dilate.. .,0,$is_real rm. +else erode $sx,$sy,$sz dilate $sx,$sy,$sz +fi +z {$sx1+1},{$sy1+1},{$sz1+1},{w-$sx2-2},{h-$sy2-2},{d-$sz2-2} => $nm +elif h>1 +r {[w+$sx+1,h+$sy+1]},1,100%,0,$boundary,0.5,0.5 +if $is_kernel pass. erode.. .,0,$is_real dilate.. .,0,$is_real rm. +else erode $sx,$sy dilate $sx,$sy +fi +z {$sx1+1},{$sy1+1},{w-$sx2-2},{h-$sy2-2} => $nm +else +r {w+$sx+1},1,1,100%,0,$boundary,0.5 +if $is_kernel pass. erode.. .,0,$is_real dilate.. .,0,$is_real rm. +else erode $sx,1 dilate $sx,1 +fi +z {$sx1+1},{w-$sx2-2} => $nm +fi +} +fi +if $is_kernel rm. fi +#@cli opening_circ : _size>=0,_is_real={ 0 | 1 } +#@cli : Apply circular opening of selected images by specified size. +#@cli : Default values: 'boundary_conditions=1' and 'is_real=0'. +#@cli : $ image.jpg +opening_circ 7 +opening_circ : check "$1>=0 && isbool(${2=0})" +r0,r1=binary,real +e[^-1] "Apply morphological opening of image$? with circular kernel of size $1, in "${r$2}" mode." +if $1<2 return fi +shape_circle $1 opening[^-1] .,$2 rm. +#@cli percentile : [mask],0<=_min_percentile[%]<=100,0<=_max_percentile[%]<=100. +#@cli : Apply percentile averaging filter to selected images. +#@cli : Default values: 'min_percentile=0' and 'max_percentile=100'. +#@cli : $ image.jpg shape_circle 11,11 +percentile[0] [1],25,75 +percentile : check ${"is_image_arg $1"}" && inrange(${2=0},0,100) && inrange(${3=100},0,100) && $2<=$3" +vmin,vmax:=_[ispercentage($2)?100*$2:$2,ispercentage($3)?100*$3:$3] +e[^-1] "Apply percentile averaging filter to image$?, with mask $1, ""min percentile "$vmin"% and max percentile "$vmax"%." +pass$1 0 !=. 0 N:=is if !$N rm. return fi 128,$N +eval.. "> +begin( +p = 0; +const w2 = int(w/2); +const h2 = int(h/2); +); +i?( +out = string('N[',p,']=j(',x - w2,',',y - h2,');'); +copy(i(#-1,0,p++),out,size(out)); +)" +discard. 0 code={t} rm[-2,-1] +f " +begin( N = vector"$N"() ); +const boundary = 1; +const sS = size(N) - 1; +const s0 = round(sS*"$vmin"%); +const s1 = round(sS*"$vmax"%); +const ds = 1 + s1 - s0; +"$code" +S = sort(N); +res = 0; for (s = s0, s<=s1, ++s, res+=S[s]); res/=ds" +#@cli peronamalik_flow : K_factor>0,_nb_iter>=0,_dt,_keep_sequence={ 0 | 1 } +#@cli : Apply iterations of the Perona-Malik flow on selected images. +#@cli : Default values: 'K_factor=20', 'nb_iter=5', 'dt=5' and 'keep_sequence=0'. +#@cli : $ image.jpg +heat_flow 20 +peronamalik_flow : check "${1=20}>0 && ${2=5}>=0" skip ${3=5},${4=0} +e[^-1] "Apply $2 iterations of the Perona-Malik flow on image$?, with K factor $1 and time step $3." +m "_peronamalik_flow : ++gradient xy,0 a[-2,-1] c norm. b. 0.8 /. $1 sqr. *. -1 exp. a[-2,-1] c +f. \"s1 = s-1; +C = i(x,y,z,s-1); +c>=s1?0: +(C+i(x+1,y,z,s-1,0,1))*(j(1,0,0,0,0,1)-i) - +(C+i(x-1,y,z,s-1,0,1))*(i-j(-1,0,0,0,0,1)) + +(C+i(x,y+1,z,s-1,0,1))*(j(0,1,0,0,0,1)-i) - +(C+i(x,y-1,z,s-1,0,1))*(i-j(0,-1,0,0,0,1))\"" +pde_flow $2,$3,_peronamalik_flow,$4 +um _peronamalik_flow +#@cli phase_correlation : [destination] +#@cli : Estimate translation vector between selected source images and specified destination. +#@cli : $ image.jpg +shift -30,-20 +phase_correlation[0] [1] unroll[-1] y +phase_correlation : check ${"is_image_arg $1"} +e[^-1] "Estimate shift between source image$? and destination $1." +pass$1 +repeat $!-1 { +normalized_cross_correlation[$>] . +l[$>] { +eval " +store('res', +[xM>=w/2?xM - w:xM, +yM>=h/2?yM - h:yM, +zM>=d/2?zM - d:zM]*=-1,1,1,1,3)" +} +$res => "[phase correlation]" rv[$>,-1] rm. +} rm. +#@cli pde_flow : _nb_iter>=0,_dt,_velocity_command,_keep_sequence={ 0 | 1 } +#@cli : Apply iterations of a generic PDE flow on selected images. +#@cli : Default values: 'nb_iter=10', 'dt=30', 'velocity_command=laplacian' and 'keep_sequence=0'. +#@cli : $ image.jpg +pde_flow 20 +pde_flow : skip ${1=10},${2=30},${3=laplacian},${4=0} +e[^-1] "Apply $1 iterations of the velocity flow '$3' on image$?, with time step $2." +foreach { +repeat $1 { ++$3. *. {$2/(0.01+max(abs(im),abs(iM)))} +if $4 +. .. else +[-2,-1] fi +} +if $4 rm[0] fi +a x +} +if $4 s x,$1 fi +#@cli periodize_poisson +#@cli : Periodize selected images using a Poisson solver in Fourier space. +#@cli : $ image.jpg +periodize_poisson array 2,2,2 +periodize_poisson : +e[^-1] "Periodize image$? using Poisson solver in Fourier space." +foreach { +s c foreach { +mM:=[im,iM] sum={0,ia} +laplacian ilaplacian 0 + $sum c $mM +} +a c +} +#@cli rbf : dx,_x0,_x1,_phi(r) : dx,dy,_x0,_y0,_x1,_y1,_phi(r) : dx,dy,dz,x0,y0,z0,x1,y1,z1,phi(r) +#@cli : Reconstruct 1D/2D or 3D image from selected sets of keypoints, by RBF-interpolation. +#@cli : A set of keypoints is represented by a vector-valued image, where each pixel represents a single keypoint. +#@cli : Vector components of a keypoint have the following meaning: +#@cli : - For 1D reconstruction: [ x_k, f1(k),...fN(k) ]. +#@cli : - For 2D reconstruction: [ x_k,y_k, f1(k),...,fN(k) ]. +#@cli : - For 3D reconstruction: [ x_k,y_k,z_k, f1(k),...,fN(k) ]. +#@cli : Values 'x_k','y_k' and 'z_k' are the spatial coordinates of keypoint 'k'. +#@cli : Values 'f1(k),..,fN(k)' are the 'N' components of the vector value of keypoint 'k'. +#@cli : The command reconstructs an image with specified size 'dx'x'dy'x'dz', with 'N' channels. +#@cli : Default values: 'x0=y0=z0=0', 'x1=dx-1', 'y1=dy-1', 'z1=dz-1', 'phi(r)=r^2*log(1e-5+r)'. +#@cli : $ sp colorful r2dx 400 100%,100% noise_poissondisk. 10 1,{is},1,5 eval[-2] "begin(p=0);i?(I[#-1,p++]=[x,y,I(#0)])" to_rgb[1] mul[0,1] dilate_circ[0] 5 +rbf[-1] {0,[w,h]} c[-1] 0,255 +#@cli : $ 32,1,1,5,u([400,400,255,255,255]) rbf 400,400 c 0,255 +rbf : +$=a +default_phi_r="r^2*log(1 + r)" +if isin($#,1,3,4) # 1D reconstruction +dx,x0,x1=$a1,{$#>1?[$a2,$a3]:[0,$a1-1]} +phi_r={`$#>3?['$a4']:'$default_phi_r'`} +check $dx>0 +e[^-1] "Reconstruct 1D image from keypoint set$?, with size "$dx", ""from ("$x0") to ("$x1") and phi(r) = "$phi_r. +foreach { nm={n} if !w $dx elif whd==1 channels. 1,100% r. $dx,1,1,100% else +r 1,{whd},1,100%,-1 permute. cyzx +$dx,1,1,{w-1},"* +begin( +phi(r) = ("$phi_r"); +ref(crop(#0,0,0,0,0,1,h#0,1,1),X); +ref(crop(#0,1,0,0,0,s,h#0,1,1,1),F); +ref(vector(#h#0^2),M); +repeat (h#0,k, +for (l = 0, l<=k, ++l, +r = abs(X[k] - X[l]); +M[k*h#0 + l] = M[l*h#0 + k] = phi(r); +) +); +ref(solve(M,F,s,1),W); +const fx = ("$x1-$x0")/(w-1); +); +ref(vectors(),res); x = (x - "$x0")*fx; +repeat (h#0,k, r = abs(x - X[k]); res+=W[s*k,s]*phi(r)); +res" +k. => $nm +fi } +elif isin($#,2,6,7) # 2D reconstruction +dx,dy,x0,y0,x1,y1=$a1,$a2,{$#>2?[$a3,$a4,$a5,$a6]:[0,0,[$a1,$a2]-1]} +phi_r={`$#>6?['$a7']:'$default_phi_r'`} +check $dx>0" && "$dy>0 +e[^-1] "Reconstruct 2D image from keypoint set$?, with size "$dx,$dy", ""from ("$x0,$y0") to ("$x1,$y1") and phi(r) = "$phi_r. +foreach { nm={n} if !w $dx,$dy elif whd==1 channels 2,100% r. $dx,$dy,1,100% else +r 1,{whd},1,100%,-1 permute. cyzx +$dx,$dy,1,{w-2},"* +begin( +phi(r) = ("$phi_r"); +ref(crop(#0,0,0,0,0,1,h#0,1,1),X); +ref(crop(#0,1,0,0,0,1,h#0,1,1),Y); +ref(crop(#0,2,0,0,0,s,h#0,1,1,1),F); +ref(vector(#h#0^2),M); +repeat (h#0,k, +for (l = 0, l<=k, ++l, +r = norm(X[k] - X[l],Y[k] - Y[l]); +M[k*h#0 + l] = M[l*h#0 + k] = phi(r); +) +); +ref(solve(M,F,s,1),W); +const fx = ("$x1-$x0")/(w-1); +const fy = ("$y1-$y0")/(h-1); +); +ref(vectors(),res); x = (x - "$x0")*fx; y = (y - "$y0")*fy; +repeat (h#0,k, r = norm(x - X[k], y - Y[k]); res+=W[s*k,s]*phi(r)); +res" +k. => $nm +fi } +elif isin($#,3,9,10) # 3D reconstruction +dx,dy,dz,x0,y0,z0,x1,y1,z1=$a1,$a2,$a3,{$#>3?[$a4,$a5,$a6,$a7,$a8,$a9]:[0,0,0,[$a1,$a2,$a3]-1]} +phi_r={`$#>9?['$arg10']:'$default_phi_r'`} +check $dx>0" && "$dy>0" && "$dz>0 +e[^-1] "Reconstruct 3D image from keypoint set$?, with size "$dx,$dy,$dz", ""from ("$x0,$y0,$z0") to ("$x1,$y1,$z1") and phi(r) = "$phi_r. +foreach { nm={n} if !w $dx,$dy,$dz elif whd==1 channels 3,100% r. $dx,$dy,$dz,100% else +r 1,{whd},1,100%,-1 permute. cyzx +$dx,$dy,$dz,{w-3},"* +begin( +phi(r) = ("$phi_r"); +ref(crop(#0,0,0,0,0,1,h#0,1,1),X); +ref(crop(#0,1,0,0,0,1,h#0,1,1),Y); +ref(crop(#0,2,0,0,0,1,h#0,1,1),Z); +ref(crop(#0,3,0,0,0,s,h#0,1,1,1),F); +ref(vector(#h#0^2),M); +repeat (h#0,k, +for (l = 0, l<=k, ++l, +r = norm(X[k] - X[l],Y[k] - Y[l],Z[k] - Z[l]); +M[k*h#0 + l] = M[l*h#0 + k] = phi(r); +) +); +ref(solve(M,F,s,1),W); +const fx = ("$x1-$x0")/(w - 1); +const fy = ("$y1-$y0")/(h - 1); +const fz = ("$z1-$z0")/(d - 1); +); +ref(vectors(),res); x = (x - "$x0")*fx; y = (y - "$y0")*fy; z = (z - "$z0")*fz; +repeat (h#0,k, r = norm(x - X[k], y - Y[k], z - Z[k]); res+=W[s*k,s]*phi(r)); +res" +k. => $nm +fi } +else error[0--2] "Command 'rbf': invalid arguments '$*'." +fi +#@cli red_eye : 0<=_threshold<=100,_smoothness>=0,0<=attenuation<=1 +#@cli : Attenuate red-eye effect in selected images. +#@cli : Default values: 'threshold=75', 'smoothness=3.5' and 'attenuation=0.1'. +#@cli : $ image.jpg +red_eye , +red_eye : skip ${1=75},${2=3.5},${3=0.1} +e[^-1] "Attenuate red-eye effect in image$?, with threshold $1, smoothness $2 and attenuation $3." +to_rgb rgb2ycbcr +foreach { +s c -. 128 +>=. $1% b. $2 sqrt. *. -1 +. 1 +n. $3,1 *[-2,-1] +. 128 a c ycbcr2rgb +} +#@cli remove_hotpixels : _mask_size>0, _threshold[%]>0 +#@cli : Remove hot pixels in selected images. +#@cli : Default values: 'mask_size=3' and 'threshold=10%'. +#@cli : $ image.jpg noise 10,2 +remove_hotpixels , +remove_hotpixels : check ${1=3}>0 skip ${2=10%} +e[^-1] "Remove hot pixels in image$?, with mask size $1 and threshold $2." +foreach { ++median $1 +- abs. >=. $2 +*.. . ==. 0 *[-3,-1] + +} +#@cli remove_pixels : number_of_pixels[%]>=0 +#@cli : Remove specified number of pixels (i.e. set them to 0) from the set of non-zero pixels in selected images. +#@cli : $ image.jpg +remove_pixels 50% +remove_pixels : check "$1>=0" +e[^-1] "Remove $1 of the non-zero pixels in image$?." +foreach { ++norm !=. 0 +N:=is +n:=round(ispercentage($1)?$N*$1:$1) +if $n<=0 rm. +elif $n>=$N rm. f 0 +elif $n>int($N/2) +remove_pixels. {$N-$n} ==. 0 * +else +d:=d r 100%,{d*h},1,100%,-1 +100%,1,1,1,x 1,{-2,h},1,1,y +[-2,-1] 1 r[-2,-1] ..,. +*[-2,-1] ... rm... +y[-2,-1] a[-2,-1] x discard. y,0 +do +1,100%,1,1 rand. 0,{h} <=. {$n*1.25} +if is>=$n break else rm. fi +while 1 +r. 2 *[-2,-1] discard. y,0 +i.. 1,100% rand.. 0,1 a[-2,-1] x sort. +,y +rows. 0,{$n-1} -. 1 z. 1,3 +i.. ({'CImg3d'},{h},{h}) +1,100%,1,1,1 1,100%,1,1,y a[-2,-1] x +3,100% 1,100%,1,1,1 y[-5--1] a[-5--1] y +if s#0<=3 j3d.. .,0,0,0,1,0,0,0,0 +else [0],[0],1,1,1 j3d. ..,0,0,0,1,0,0,0,0 *[0,-1] +fi +rm. +r 100%,{h/$d},$d,100%,-1 +fi +} +#@cli rolling_guidance : std_deviation_s[%]>=0,std_deviation_r[%]>=0,_precision>=0 +#@cli : Apply the rolling guidance filter on selected image. +#@cli : Rolling guidance filter is a fast image abstraction filter, described in: +#@cli : "Rolling Guidance Filter", Qi Zhang Xiaoyong, Shen Li, Xu Jiaya Jia, ECCV'2014. +#@cli : Default values: 'std_deviation_s=4', 'std_deviation_r=10' and 'precision=0.5'. +#@cli : $ image.jpg +rolling_guidance , +- +rolling_guidance : check "${1=4}>=0 && ${2=10}>=0 && ${3=0.5}>=0" +e[^-1] "Apply rolling guidance filter on image$?, with standard deviations ($1,$2) and precision $3." +precision:=2^-$3 +foreach { nm={n} ++b $1 +repeat 100 { +if c>1 +norm. +bilateral... .,$1,$2 rm.. +else +bilateral.. .,$1,$2 +fi +-.. . std={-2,id} rm.. +if $std<$precision break fi +} +k. => $nm +} +#@cli sharpen : amplitude>=0 : amplitude>=0,edge>=0,_alpha[%],_sigma[%] +#@cli : Sharpen selected images by inverse diffusion or shock filters methods. +#@cli : 'edge' must be specified to enable shock-filter method. +#@cli : Default values: 'edge=0', 'alpha=0' and 'sigma=0'. +#@cli : $ image.jpg sharpen 300 +#@cli : $ image.jpg blur 5 sharpen 300,1 +sharpen : check "$1>=0 && ${2=0}>=0 && ${3=0}>=0 && ${4=0}>=0" +if $2>0 +e[0--3] "Sharpen image$? with shock filters, amplitude $1, edge $2, alpha $3 and sigma $4." +foreach { +im,iM:=[im,iM] ++b $3 structuretensors. 0 b. $4 eigen. l.. { max 0 s c + + 1 ^ {-0.5*$2} *. -1 +. 1 } +if {0,d>1} ++f[0] "const boundary = 1; +minmod(a,b) = (a*b<=0?0:minabs(a,b)); +u = i(#-1,x,y,z,0); +v = i(#-1,x,y,z,1); +w = i(#-1,x,y,z,2); +amp = i(#-2,x,y,z,0); +Ippp = j(-1,-1,-1); Icpp = j(0,-1,-1); Inpp = j(1,-1,-1); +Ipcp = j(-1,0,-1); Iccp = j(0,0,-1); Incp = j(1,0,-1); +Ipnp = j(-1,1,-1); Icnp = j(0,1,-1); Innp = j(1,1,-1); +Ippc = j(-1,-1,0); Icpc = j(0,-1,0); Inpc = j(1,-1,0); +Ipcc = j(-1,0,0); Iccc = i; Incc = j(1,0,0); +Ipnc = j(-1,1,0); Icnc = j(0,1,0); Innc = j(1,1,0); +Ippn = j(-1,-1,1); Icpn = j(0,-1,1); Inpn = j(1,-1,1); +Ipcn = j(-1,0,1); Iccn = j(0,0,1); Incn = j(1,0,1); +Ipnn = j(-1,1,1); Icnn = j(0,1,1); Innn = j(1,1,1); +ixx = Incc + Ipcc - 2*Iccc; +ixy = 0.25*(Innc + Ippc - Inpc - Ipnc); +ixz = 0.25*(Incn + Ipcp - Incp - Ipcn); +iyy = Icnc + Icpc - 2*Iccc; +iyz = 0.25*(Icnn + Icpp - Icnp - Icpn); +izz = Iccn + Iccp - 2*Iccc; +ixf = Incc - Iccc; +ixb = Iccc - Ipcc; +iyf = Icnc - Iccc; +iyb = Iccc - Icpc; +izf = Iccn - Iccc; +izb = Iccc - Iccp; +itt = u^2*ixx + v^2*iyy + w^2*izz + 2*u*v*ixy + 2*u*w*ixz + 2*v*w*iyz; +it = u*minmod(ixf,ixb) + v*minmod(iyf,iyb) + w*minmod(izf,izb); +amp*sign(itt)*abs(it)" +else ++f[0] "const boundary = 1; +minmod(a,b) = (a*b<=0?0:minabs(a,b)); +u = i(#-1,x,y,z,0); +v = i(#-1,x,y,z,1); +amp = i(#-2,x,y,z,0); +Ipp = j(-1,-1); Icp = j(0,-1); Inp = j(1,-1); +Ipc = j(-1,0); Icc = i; Inc = j(1,0); +Ipn = j(-1,1); Icn = j(0,1); Inn = j(1,1); +ixx = Inc + Ipc - 2*Icc; +ixy = 0.25*(Ipp + Inn - Ipn - Inp); +iyy = Icn + Icp - 2*Icc; +ixf = Inc - Icc; +iyf = Icn - Icc; +ixb = Icc - Ipc; +iyb = Icc - Icp; +itt = u^2*ixx + v^2*iyy + 2*u*v*ixy; +it = y*minmod(ixf,ixb) + v*minmod(iyf,iyb); +amp*sign(itt)*abs(it)" +fi +vM:=abs(maxabs(im,iM)) +if $vM>1e-8 *. {$1/$vM} rm[-3,-2] - else rm[-3--1] fi +c $im,$iM +} +else +e[0--3] "Sharpen image$? with inverse diffusion and amplitude $1." +foreach { +im,iM:=[im,iM] +laplacian +vM:=abs(maxabs(im,iM)) +if $vM>1e-8 *. {$1/abs(maxabs(im,iM))} - else rm. fi +c $im,$iM +} +fi +#@cli sharpen_alpha : _amplitude[%]>=0,_nb_scales>0,0<=_anisotropy<=1,0<=_minimize_alpha<=1 +#@cli : Sharpen selected images using a multi-scale and alpha boosting algorithm. +#@cli : Default values: 'amplitude=1', 'nb_scales=5', 'anisotropy=0' and 'minimize_alpha=1'. +sharpen_alpha : check "${1=1}>=0 && isint(${2=5}) && $2>0 && inrange(${3=0},0,1) && inrange(${4=1},0,1)" +e[^-1] "Sharpen image$? with a multi-scale and alpha boosting algorithm, with amplitude $1, $2 scales, ""anisotropy $3 and alpha minimization factor $4." +foreach { +split_opacity l[0] { +split_alpha $2,0,$3,$4 +foreach[^0] { sh 100% *. {$/($>+$<)):(1+$1)} c. 0,255 rm. } +merge_alpha +} a c +} +#@cli smooth : amplitude[%]>=0,_sharpness>=0,0<=_anisotropy<=1,_alpha[%],_sigma[%],_dl>0,_da>0,_precision>0,_interpolation,_fast_approx={ 0 | 1 } : nb_iterations>=0,_sharpness>=0,_anisotropy,_alpha,_sigma,_dt>0,0 : [tensor_field],_amplitude>=0,_dl>0,_da>0,_precision>0,_interpolation,_fast_approx={ 0 | 1 } : [tensor_field],_nb_iters>=0,_dt>0,0 : (+) +#@cli : Smooth selected images anisotropically using diffusion PDE's, with specified field of +#@cli : diffusion tensors. +#@cli : 'interpolation' can be { 0:nearest | 1:linear | 2:runge-kutta }. +#@cli : Default values: 'sharpness=0.7', 'anisotropy=0.3', 'alpha=0.6', 'sigma=1.1', 'dl=0.8', 'da=30', 'precision=2', 'interpolation=0' and 'fast_approx=1'. +#@cli : $ image.jpg repeat 3 smooth 40,0,1,1,2 done +#@cli : $ image.jpg 100%,100%,1,2 rand[-1] -100,100 repeat 2 smooth[-1] 100,0.2,1,4,4 done warp[0] [-1],1,1,1 +#@cli : $$ https://gmic.eu/oldtutorial/_smooth +#@cli split_freq : smoothness>0[%] +#@cli : Split selected images into low and high frequency parts. +#@cli : $ image.jpg split_freq 2% +split_freq : +e[^-1] "Split image$? into low and high frequency parts, with smoothness $1." +foreach { +b $1 -[0] [1] rv } +#@cli solve_poisson : "laplacian_command",_nb_iterations>=0,_time_step>0,_nb_scales>=0 +#@cli : Solve Poisson equation so that applying 'laplacian[n]' is close to the result of 'laplacian_command[n]'. +#@cli : Solving is performed using a multi-scale gradient descent algorithm. +#@cli : If 'nb_scales=0', the number of scales is automatically determined. +#@cli : Default values: 'nb_iterations=60', 'dt=5' and 'nb_scales=0'. +#@cli : $ image.jpg command "foo : gradient x" +solve_poisson foo +foo[0] +laplacian[1] +solve_poisson : check "${2=60}>=0 && ${3=5}>0 && ${4=0}>=0" +e[^-1] "Solve Poisson equation for image$?, for laplacian command '$1', with $2 iterations, time step $3 and "${arg0\ !$4,$4,auto}" scales." +foreach { +[0] +repeat $4?$4:int(max(log2(max(w,h))-1,1)) { +f:=2^$< +r[1] {0,max(1,w/$f)},{0,max(1,h/$f)},1,100%,3 ++ri[0] [1],2 l. { $1 k[0] } +repeat $2 { +laplacian.. -. .. *. {$3/max(1e-8,abs(im),abs(iM))} +[-3,-1] } +rm. +} +rm[0] +} +#@cli split_alpha : _nb_scales[%]={ 0:auto | -S<0 | N>0 },_subsample={ 0:no | 1:yes },0<=_anisotropy<=1,0<=_minimize_alpha<=1 +#@cli : Split selected images into alpha detail scales. +#@cli : If 'nb_scales==-S', the lowest scale has a size of at least 'SxS'. +#@cli : Parameter 'anisotropy' is only considered when 'subsample=0'. +#@cli : Image reconstruction is done with command ''merge_alpha''. +#@cli : Default values: 'nb_scales=0', 'subsample=0', 'anisotropy=0' and 'minimize_alpha=1'. +split_alpha : check "(isint(${1=0}) || ispercentage($1)) && isbool(${2=0}) && inrange(${3=0},0,1) && ""inrange(${4=1},0,1)" +s= if $1 s="$1 " fi s0,s1="out", +e[^-1] "Split image$? into "${s}"alpha detail scales, with"$s$2" subsampling, anisotropy $3 ""and alpha minimization factor $4." +foreach { +bm={f}{b} ext={x} if ['$ext']!=0 ext..=. fi +nb_scales_max:=int(log2(min(w,h))) +nb_scales:=cut(ispercentage($1)?round($nb_scales_max*$1):$1<0?int(log2(min(w,h)/(-$1)))+1:$1?$1:$nb_scales_max,1,$nb_scales_max) +if $nb_scales>1 +repeat $nb_scales-1 { +if $2 ++r. {int([w,h]/2)},1,100%,2 +r. ..,..,1,100%,5 c. 0,255 sub_alpha... .,$4 rm. +else +if $3 +bilateral. {0.25+2^$>},{(1-$3)*100} b. {0.5+$3} +else +b. {0.25+2^$>} +fi +sub_alpha.. .,$4 +fi +} +rv foreach { => ${bm}_$>$ext } +fi +} +#@cli split_details : _nb_scales[%]={ 0:auto | -S<0 | N>0 },_base_scale[%]>=0,_detail_scale[%]>=0 +#@cli : Split selected images into 'nb_scales' detail scales. +#@cli : If 'base_scale' = 'detail_scale' = 0, the image decomposition is done with 'a trous' wavelets. +#@cli : Otherwise, it uses laplacian pyramids with linear standard deviations. +#@cli : Default values: 'nb_scales=0', 'base_scale=0' and 'detail_scale=0'. +#@cli : $ image.jpg split_details , +split_details : check "(isint(${1=0}) || ispercentage($1)) && ${2=0}>=0 && ${3=0}>=0" +if !max($2,$3) +e[0--3] "Split image$? using $1 scales and 'a trous' wavelets." +else +e[0--3] "Split image$? using $1 scales, with base scale $2 and detail scale $3." +fi +foreach { +bm={f}{b} ext={x} if ['$ext']!=0 ext..=. fi +nb_scales_max:=int(log2(min(w,h))) +nb_scales:=cut(ispercentage($1)?round($nb_scales_max*$1):$1<0?int(log2(min(w,h)/(-$1)))+1:$1?$1:$nb_scales_max,1,$nb_scales_max) +if !max($2,$3) +repeat $nb_scales-1 { ++f. "begin(interpolation = 0; boundary = 1; d = 2^"$>"; d2 = d*2); +i(x - d2) + i(x + d2) + 4*i(x - d) + 4*i(x + d) + 6*i;" +/. 16 +if h>1 +f. "begin(interpolation = 0; boundary = 1; d = 2^"$>"; d2 = d*2); +i(x,y - d2) + i(x,y + d2) + 4*i(x,y - d) + 4*i(x,y + d) + 6*i;" +/. 16 +fi +if d>1 +f. "begin(interpolation = 0; boundary = 1; d = 2^"$>"; d2 = d*2); +i(x,y,z - d2) + i(x,y,z + d2) + 4*i(x,y,z - d) + 4*i(x,y,z + d) + 6*i;" +/. 16 +fi +-.. . +} +else +ss:=max(0.25,ispercentage($3)?$3*max(w,h):$3) +se:=max(0.25,ispercentage($2)?$2*max(w,h):$2) +repeat $nb_scales-1 { ++b. {lerp($ss,$se,$>/($>+$<))} +-.. . +} +fi +rv foreach { => ${bm}_$>$ext } +} +#@cli structuretensors : _scheme={ 0:centered | 1:forward/backward } +#@cli : Compute the structure tensor field of selected images. +#@cli : Default value: 'scheme=0'. +#@cli : $ image.jpg structuretensors abs pow 0.2 +#@cli : $$ https://gmic.eu/oldtutorial/_structuretensors +structuretensors : skip "${1=}" +l[] { if "isbool($1)" scheme=$1 else scheme=0 noarg fi onfail scheme=0 noarg } +s0,s1=centered,forward-backward +e[^-1] "Compute structure tensor field of image$?, with "${s$scheme}" scheme." +foreach { +if d>1 +if $scheme ++g xyz,-1 +g[0] xyz,1 sqr[^0] +[1,4] +[2,4] +[3,4] /[^0] 2 +g[0] xyz,0 [2] *. [1] *[2] [0] *[0,1] compose_channels + mv[2] 0 mv. -2 a c +else +g xyz,0 +*[0,1] +*[0,2] +*[1,2] sqr[0-2] compose_channels + mv[3,4] 1 rv[4,5] a c +fi +else +if $scheme ++g xy,-1 +g[0] xy,1 sqr[^0] +[1,3] +[2,3] /[^0] 2 +g[0] xy,0 *[0,1] compose_channels + mv[0] 2 a c +else +g xy,0 +* sqr[0,1] compose_channels + rv[1,2] a c +fi +fi +} +#@cli solidify : _smoothness[%]>=0,_diffusion_type={ 0:isotropic | 1:Delaunay-guided | 2:edge-oriented },_diffusion_iter>=0 +#@cli : Solidify selected transparent images. +#@cli : Default values: 'smoothness=75%', 'diffusion_type=1' and 'diffusion_iter=20'. +#@cli : $ image.jpg 100%,100% circle[-1] 50%,50%,25%,1,255 append c +solidify , display_rgba +solidify : check "${1=75%}>=0 && isint(${2=1}) && $2>=0 && $2<=2 && ${3=20}>=0" +s0="isotropic" s1="Delaunay-guided" s2="edge-oriented" +e[^-1] "Solidify transparent image$? with smoothness $1 and $3 iterations of "${s$2}" diffusion." +foreach { split_opacity if $!>1 <=. 128 inpaint_pde.. [1],${1-3} rm. c 0,255 fi } +#@cli syntexturize : _width[%]>0,_height[%]>0 +#@cli : Resynthetize 'width'x'height' versions of selected micro-textures by phase randomization. +#@cli : The texture synthesis algorithm is a straightforward implementation of the method described in : +#@cli : . +#@cli : Default values: 'width=height=100%'. +#@cli : $ image.jpg crop 2,282,50,328 +syntexturize 320,320 +syntexturize : check "${1=100%}>0 && ${2=$1}>0" +e[^-1] "Resynthetize $1x$2 versions of texture$? by phase randomization." +foreach { +mM:=im,iM repeat s { sh. $> sum$>:=is var$>:=iv rm. } +nw:=ispercentage($1)?$1*w:$1 +nh:=ispercentage($2)?$2*h:$2 +repeat s { sum$>*={$nw*$nh/(w*h)} } +if $nw>w||$nh>h +periodize_poisson +100%,100% rectangle. 5,5,{w-6},{h-6},1,1 b. 2 n. 0,1 +$nw,$nh,1,{-2,s} fc. ${average_vectors...} +j. ...,{(w-{-2,w})/2},{(h-{-2,h})/2},0,0,1,.. +rm[-3,-2] +else +r $nw,$nh,1,100%,0,0,0.5,0.5 +periodize_poisson +fi +fft +100%,100% rand. {-pi},{pi} +=. 0 +if !(w%2) =. {(u<0.5)*pi},{int(w/2)} fi +if !(h%2) =. {(u<0.5)*pi},0,{int(h/2)} fi +if !(h%2)&&!(h%2) =. {(u<0.5)*pi},{int(w/2)},{int(h/2)} fi ++sin. cos.. ++*[-4,-1] +*[-4,-3] +[-2,-1] +*[-5,-3] *[-3,-2] -[-3,-2] +repeat s { =.. ${sum$>},0,0,0,$> =. 0,0,0,0,$> } +ifft rm. +repeat s { sh. $> avg:=ia -. $avg *. {sqrt(${var$>}/(iv?iv:1))} +. $avg rm. } +c $mM +} +#@cli syntexturize_matchpatch : _width[%]>0,_height[%]>0,_nb_scales>=0,_patch_size>0,_blending_size>=0,_precision>=0 +#@cli : Resynthetize 'width'x'height' versions of selected micro-textures using a patch-matching algorithm. +#@cli : If 'nbscales==0', the number of scales used is estimated from the image size. +#@cli : Default values: 'width=height=100%', 'nb_scales=0', 'patch_size=7', 'blending_size=5' and 'precision=1'. +#@cli : $ image.jpg crop 25%,25%,75%,75% syntexturize_matchpatch 512,512 +syntexturize_matchpatch : check "${1=100%}>0 && ${2=$1}>0 && isint(${3=0}) && $3>=0 && isint(${4=7}) && $4>0 && +${5=5}>=0 && ${6=1}>=0" +e[^-1] "Resynthetize $1x$2 version(s) of texture$? using a patch-matching algorithm with "${"if $3 u \"$3 \" else u auto- fi"}"scales, $4x$4 patches, blending size $5 and precision $6." +foreach { +nb_scales:=round($3?$3:log2(min(w,h)/16),1,1) +width:=ispercentage($1)?round(w*$1,1,1):$1 +height:=ispercentage($2)?round(h*$2,1,1):$2 +repeat $nb_scales { +scale:=100*(0.5^$<) ++r[0] $scale%,$scale%,1,3,2 +if !$> +{1+round(w*$width/{0,w},1,1)},{1+round(h*$height/{0,h},1,1)},1,1 +noise. 0.2,2 ==. 1 +distance. 1 *. -1 +label_fg.. 0 watershed.. . rm. +100%,100%,1,1,x +f. y a[-2,-1] c channels. 0,2 ++blend. ..,shapeaverage -.. . rm. +channels. 0,1 +{-2,iM+1} rand. 0,{-4,w} +rand. 0,{-4,h} a[-2,-1] c +map... . rm. +[-2,-1] round. +s. c %.. {-3,w} %. {-3,h} a[-2,-1] c +else +rv[-2,-1] channels. 0,1 +*. 2 r. 200%,200%,1,2,1 +f. "*upc = i(x - 1,y,0,0); +vpc = i(x - 1,y,0,1); +ucp = i(x,y - 1,0,0); +vcp = i(x,y - 1,0,1); +ucc = i(x,y,0,0); +vcc = i(x,y,0,1); +if (ucc==upc && vcc==vpc && !c, upc + 1, +if (ucc==ucp && vcc==vcp && c==1, vcp + 1,i))" +fi +psize={-2,min(w,h,$4)} +repeat 1+$6*$< { +psynth:=int(max(3,$5*$scale%)) ++warp_patch.. .,$psynth +matchpatch. ...,$psize,$psize,1,4,4,0,0,.. rm.. +} +rm.. +} +warp_patch.. .,$5 +rm. r $width,$height,1,100%,0,0,0.5,0.5 +} +_syntexturize_matchpatch : check ${is_image_arg\ $1}" && isint(${2=3}) && $2>=0" +if $2<=1 pass$1 warp[^-1] .,0 rm. +else repeat $! { pass$1 l[$>,-1] { +[1],[1],1,[0] +f. "*begin( +boundary = 1; +const patch_size = $2; +const p2 = int(patch_size/2); +const p1 = patch_size - p2 - 1; +avg = resize([0],s#0); +wpq = resize([0],patch_size^2); +g = 0; +for (q = -p1, q<=p2, ++q, +for (p = -p1, p<=p2, ++p, +wpq[g++] = exp(-(p^2 + q^2)/(2*(0.3*patch_size)^2)); +); +); +); +g = 0; +avg = 0; +norm = 0; +for (q = -p1, q<=p2, ++q, +for (p = -p1, p<=p2, ++p, +U = I(#1,x + p,y + q); +w = wpq[g++]; +avg+=w*I(#0,U - [p,q]); +norm+=w; +); +); +avg/norm" +k. +} } fi +#@cli tv_flow : _nb_iter>=0,_dt,_keep_sequence={ 0 | 1 } +#@cli : Apply iterations of the total variation flow on selected images. +#@cli : Default values: 'nb_iter=10', 'dt=30' and 'keep_sequence=0'. +#@cli : $ image.jpg +tv_flow 40 +tv_flow : skip ${1=10},${2=30},${3=0} +e[^-1] "Apply $1 iterations of the total variation flow on image$?, with time step $2." +pde_flow $1,$2,curvature,$3 +#@cli unsharp : radius[%]>=0,_amount>=0,_threshold[%]>=0 +#@cli : Apply unsharp mask on selected images. +#@cli : Default values: 'amount=2' and 'threshold=0'. +#@cli : $ image.jpg blur 3 +unsharp 1.5,15 cut 0,255 +unsharp : check "${2=2}>=0" skip ${3=0} +e[^-1] "Apply unsharp mask on image$?, with radius $1, amount $2 and threshold $3." +foreach { ++b $1 -. .. +if $3 +norm. >=. $3 *[-2,-1] fi +*. $2 - +} +#@cli unsharp_octave : _nb_scales>0,_radius[%]>=0,_amount>=0,threshold[%]>=0 +#@cli : Apply octave sharpening on selected images. +#@cli : Default values: 'nb_scales=4', 'radius=1', 'amount=2' and 'threshold=0'. +#@cli : $ image.jpg blur 3 +unsharp_octave 4,5,15 cut 0,255 +unsharp_octave : check "${1=4}>0 && ${3=2}>=0" skip ${2=1},${4=0} +e[^-1] "Apply octave sharpening on image$?, with $1 scales, radius $2, amount $3 and threshold $4." +foreach { +nm={n} ++f 0 weight=0 +repeat $1 { ++unsharp[0] {$2*2^-$<},$3,$4 *. {2^-$>} +weight+=2^-$> ++[1,-1] +} +rm[0] / $weight => $nm +} +#@cli vanvliet : std_deviation>=0[%],order={ 0 | 1 | 2 | 3 },axis={ x | y | z | c },_boundary_conditions : (+) +#@cli : Apply Vanvliet recursive filter on selected images, along specified axis and with +#@cli : specified standard deviation, order and boundary conditions. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : Default value: 'boundary_conditions=1'. +#@cli : $ image.jpg +vanvliet 3,1,x +#@cli : $ image.jpg +vanvliet 30,0,x vanvliet[-2] 30,0,y add +#@cli voronoi +#@cli : Compute the discrete Voronoi diagram of non-zero pixels in selected images. +#@cli : $ 400,400 noise 0.2,2 eq 1 +label_fg 0 voronoi[-1] +gradient[-1] xy,1 append[-2,-1] c norm[-1] ==[-1] 0 map[-2] 2,2 mul[-2,-1] normalize[-2] 0,255 dilate_circ[-2] 4 reverse max +voronoi : +e[^-1] "Compute the discrete Voronoi diagram of non-zero pixels in image$?." +foreach { +s c +foreach { ++!=. 0 distance. 1 *. -1 +watershed.. . rm. +} +a c +} +#@cli watermark_fourier : text,_size>0 +#@cli : Add a textual watermark in the frequency domain of selected images. +#@cli : Default value: 'size=33'. +#@cli : $ image.jpg +watermark_fourier "Watermarked!" +display_fft remove[-3,-1] normalize 0,255 append[-4,-2] y append[-2,-1] y +watermark_fourier : check ${2=33}>0 +e[^-1] "Add textual watermark '$1' with size $2 in the frequency domain of image$?." +i[0] 0 t[0] "$1",0,0,$2,1,1 >=[0] 0.5 autocrop[0] 0 +repeat $!-1 { +w2,h2:=int([w,h]/2) +fft. +shift[-2,-1] $w2,$h2,0,0,2 +[0],[0],1,{s} +j[-3,-2] .,3,3,0,0,1,[0] +mirror[0] x +j[-3,-2] .,{{-2,w}-2-{0,w}},3,0,0,1,[0] +mirror[0] y +j[-3,-2] .,{{-2,w}-2-{0,w}},{{-2,h}-2-{0,h}},0,0,1,[0] +mirror[0] x +j[-3,-2] .,3,{{-2,h}-2-{0,h}},0,0,1,[0] +mirror[0] y +rm. +shift[-2,-1] -$w2,-$h2,0,0,2 +ifft[-2,-1] rm. mv. 1 +} +rm[0] +#@cli watershed : [priority_image],_is_high_connectivity={ 0 | 1 } : (+) +#@cli : Compute the watershed transform of selected images. +#@cli : Default value: 'is_high_connectivity=1'. +#@cli : $ 400,400 noise 0.2,2 eq 1 +distance 1 mul[-1] -1 label[-2] watershed[-2] [-1] mod[-2] 256 map[-2] 0 reverse +#@cli :: Features Extraction +#@cli area : tolerance>=0,is_high_connectivity={ 0 | 1 } +#@cli : Compute area of connected components in selected images. +#@cli : Default values: 'is_high_connectivity=0'. +#@cli : $ image.jpg luminance stencil[-1] 1 +area 0 +#@cli : $$ https://gmic.eu/oldtutorial/_area +area : check "$1>=0" skip ${2=0} +e[^-1] "Compute area of connected components in image$?, with tolerance $1 and "${arg0\ !$2,high,low}" connectivity." +foreach { +s c +foreach { label $1,$2 nb:=iM+1 +histogram $nb,0,{$nb-1} map.. . rm. } +a c +} +#@cli area_fg : tolerance>=0,is_high_connectivity={ 0 | 1 } +#@cli : Compute area of connected components for non-zero values in selected images. +#@cli : Similar to 'area' except that 0-valued pixels are not considered. +#@cli : Default values: 'is_high_connectivity=0'. +#@cli : $ image.jpg luminance stencil[-1] 1 +area_fg 0 +area_fg : check "$1>=0" skip ${2=0} +e[^-1] "Compute area of foreground connected components in image$?, with tolerance $1 and "${arg0\ !$2,high,low}" connectivity." +foreach { +s c +foreach { label_fg $1,$2 nb:=1+iM +histogram $nb,0,{$nb-1} =. 0 map.. . rm. } +a c +} +#@cli at_line : x0[%],y0[%],z0[%],x1[%],y1[%],z1[%] +#@cli : Retrieve pixels of the selected images belonging to the specified line (x0,y0,z0)-(x1,y1,z1). +#@cli : $ image.jpg +at_line 0,0,0,100%,100%,0 line[0] 0,0,100%,100%,1,0xFF00FF00,255,0,0 +at_line : check ${7=100%}>=0 +e[^-1] "Retrieve pixels of image$?, belonging to line ($1,$2,$3)-($4,$5,$6)." +foreach { +x0:=ispercentage($1)?(w-1)*$1:$1 +y0:=ispercentage($2)?(h-1)*$2:$2 +z0:=ispercentage($3)?(d-1)*$3:$3 +x1:=ispercentage($4)?(w-1)*$4:$4 +y1:=ispercentage($5)?(h-1)*$5:$5 +z1:=ispercentage($6)?(d-1)*$6:$6 +($x0,$x1^$y0,$y1^$z0,$z1) +r. {1+max(abs($x1-$x0),abs($y1-$y0),abs($z1-$z0))},1,1,3,3 +round. 1 warp[0] .,0,0,0 rm. +} +#@cli at_quadrangle : x0[%],y0[%],x1[%],y1[%],x2[%],y2[%],x3[%],y3[%],_interpolation,_boundary_conditions : x0[%],y0[%],z0[%],x1[%],y1[%],z1[%],x2[%],y2[%],z2[%],x3[%],y3[%],z3[%],_interpolation,_boundary_conditions +#@cli : Retrieve pixels of the selected images belonging to the specified 2D or 3D quadrangle. +#@cli : 'interpolation' can be { 0:nearest-neighbor | 1:linear | 2:cubic }. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : $ image.jpg params=5%,5%,95%,5%,60%,95%,40%,95% +at_quadrangle $params polygon.. 4,$params,0.5,255 +at_quadrangle : check "$#>=8 && $#<=14 && $#!=11" +_at_quadrangle{$#<12?2:3} $* +_at_quadrangle2 : check "${9=1}>=0 && $9<=2 && ${10=0}>=0 && $10<=3" +foreach { +x0:=round(ispercentage($1)?(w-1)*$1:$1) +y0:=round(ispercentage($2)?(h-1)*$2:$2) +x1:=round(ispercentage($3)?(w-1)*$3:$3) +y1:=round(ispercentage($4)?(h-1)*$4:$4) +x2:=round(ispercentage($5)?(w-1)*$5:$5) +y2:=round(ispercentage($6)?(h-1)*$6:$6) +x3:=round(ispercentage($7)?(w-1)*$7:$7) +y3:=round(ispercentage($8)?(h-1)*$8:$8) +($x0,$x1;$x3,$x2^$y0,$y1;$y3,$y2) +r. {P0=[$x0,$y0];P1=[$x1,$y1];P2=[$x2,$y2];P3=[$x3,$y3];1+round([max(norm(P1-P0),norm(P3-P2)),max(norm(P3-P0),norm(P2-P1))])},1,2,3 +warp.. .,0,$9,$10 rm. +} +_at_quadrangle3 : check "${13=1}>=0 && $13<=2 && ${14=0}>=0 && $14<=3" +foreach { +x0:=round(ispercentage($1)?(w-1)*$1:$1) +y0:=round(ispercentage($2)?(h-1)*$2:$2) +z0:=round(ispercentage($3)?(h-1)*$3:$3) +x1:=round(ispercentage($4)?(w-1)*$4:$4) +y1:=round(ispercentage($5)?(h-1)*$5:$5) +z1:=round(ispercentage($6)?(h-1)*$6:$6) +x2:=round(ispercentage($7)?(w-1)*$7:$7) +y2:=round(ispercentage($8)?(h-1)*$8:$8) +z2:=round(ispercentage($9)?(h-1)*$9:$9) +x3:=round(ispercentage($10)?(w-1)*$10:$10) +y3:=round(ispercentage($11)?(h-1)*$11:$11) +z3:=round(ispercentage($12)?(h-1)*$12:$12) +($x0,$x1;$x3,$x2^$y0,$y1;$y3,$y2^$z0,$z1;$z3,$z2) +r. {P0=[$x0,$y0,$z0];P1=[$x1,$y1,$z1];P2=[$x2,$y2,$z2];P3=[$x3,$y3,$z2];1+round([max(norm(P1-P0),norm(P3-P2)),max(norm(P3-P0),norm(P2-P1))])},1,3,3 +warp.. .,0,$13,$14 rm. +} +#@cli barycenter +#@cli : Compute the barycenter vector of pixel values. +#@cli : $ 256,256 ellipse 50%,50%,20%,20%,0,1,1 deform 20 +barycenter +ellipse[-2] {@0,1},5,5,0,10 +barycenter : +e[^-1] "Compute the barycenter vector of pixel values of image$?." +norm +foreach { +nm={0,b} +sum:=is +if $sum>0 +if d>1 +* 'z' z:=is rm. else z=0 fi +if h>1 +* 'y' y:=is rm. else y=0 fi +* 'x' x:=is rm. +({$x/$sum};{$y/$sum};{$z/$sum}) +else ({w/2},{h/2},{d/2}) rm.. +fi +=> "[barycenter of '"$nm"']" +} +#@cli betti +#@cli : Compute Betti numbers B0,B1 and B2 from selected 3D binary shapes. +#@cli : Values B0,B1 and B2 are returned in the status. When multiple images are selected, the B0,B1,B2 of each image are concatenated in the status. +#@cli : (see 'https://en.wikipedia.org/wiki/Betti_number' for details about Betti numbers). +betti : +e[^-1] "Compute Betti numbers B0,B1 and B2 from binary shape$?." +res,c= +foreach { +{[2*w+1,2*h+1,2*d+1]} +eval.. "*i?( +X = 2*x; Y = 2*y; Z = 2*z; +X1 = X + 1; Y1 = Y + 1; Z1 = Z + 1; +X2 = X + 2; Y2 = Y + 2; Z2 = Z + 2; +i(#-1,X,Y,Z) = i(#-1,X2,Y,Z) = i(#-1,X2,Y2,Z) = i(#-1,X,Y2,Z) = +i(#-1,X,Y,Z2) = i(#-1,X2,Y,Z2) = i(#-1,X2,Y2,Z2) = i(#-1,X,Y2,Z2) = 1; +i(#-1,X1,Y,Z) = i(#-1,X2,Y1,Z) = i(#-1,X1,Y2,Z) = i(#-1,X,Y1,Z) = +i(#-1,X1,Y,Z2) = i(#-1,X2,Y1,Z2) = i(#-1,X1,Y2,Z2) = i(#-1,X,Y1,Z2) = +i(#-1,X,Y,Z1) = i(#-1,X2,Y,Z1) = i(#-1,X,Y2,Z1) = i(#-1,X2,Y2,Z1) = 2; +i(#-1,X1,Y1,Z) = i(#-1,X1,Y1,Z2) = +i(#-1,X1,Y,Z1) = i(#-1,X1,Y2,Z1) = +i(#-1,X,Y1,Z1) = i(#-1,X2,Y1,Z1) = 3; +i(#-1,X1,Y1,Z1) = 4; +)" +histogram. 4,1,4 Xi:=i[0]-i[1]+i[2]-i[3] rm. +expand_xyz. 1,0 ++label. 0,1 {iM+1} eval.. "*i(#-3)?(i[#-1,i] = 1)" B0:=is rm[-2,-1] # Number of connected components ++label. 0,0 {iM+1} eval.. "*!i(#-3) && i?(i[#-1,i] = 1)" B2:=is rm[-2,-1] # Number of cavities +B1:=$B0+$B2-$Xi +shrink_xyz. 1 +res.=$c$B0,$B1,$B2 c=, +} +u $res +#@cli canny : _sigma[%]>=0,_low_threshold>=0,_high_threshold>=0 +#@cli : Locate image edges using Canny edge detector. +#@cli : Default values: 'sigma=1', 'low_threshold=0.05', 'high_threshold=0.15'. +#@cli : $ image.jpg canny 1 +canny : check "${1=1}>=0 && ${2=0.05}>=0 && ${3=0.15}>=0 && isint(${4=0}) && inrange($4,0,2)" +e[^-1] "Apply Canny edge detection on image$?, with sigma $1, low threshold $2 and high threshold $3." +low,high:=$2*$3,$3 +foreach { +nm={n} +b $1 (1,0,-1;2,0,-2;1,0,-1^1,2,1;0,0,0;-1,-2,-1) convolve.. .,1,0,0 rm. s. c,2 ++atan2.. . mul. {4/pi} round. 1 mod. 4 +sqr[0,1] +[0,1] sqrt.. +f.. " +A = i#1; +Y = A<1?max(j(0,-1),j(0,1)): +A<2?max(j(-1,-1),j(1,1)): +A<3?max(j(-1),j(1)): +max(j(-1,1),j(1,-1)); +i>=Y?i:0" rm. +div {iM} +ge $high ge.. $low +f. ">max(crop(x-1,y-1,z,c,3,3,1,1)) && i#0?1:i" +f. " $nm +} +#@cli delaunay : _output_type={ 0:image | 1:coordinates/triangles } +#@cli : Generate discrete 2D Delaunay triangulation of non-zero pixels in selected images. +#@cli : Input images must be scalar. +#@cli : Each pixel of the output image is a triplet (a,b,c) meaning the pixel belongs to +#@cli : the Delaunay triangle 'ABC' where 'a','b','c' are the labels of the pixels 'A','B','C'. +#@cli : $ 400,400 rand 32,255 100%,100% noise. 0.4,2 eq. 1 mul +delaunay +#@cli : $ image.jpg 100%,100% noise. 2,2 eq. 1 delaunay. +blend shapeaverage0 +delaunay : skip "${1=0}" +mode=0 if isin(['"$1"'],'0','1') mode=$1 else mode=0 noarg fi +s0,s1=image,coordinates +e[^-1] "Generate discrete 2D Delaunay triangulation of non-zero pixels in image$?, in "${s$mode}" mode." +foreach { +bnm={b} nm={n} +1,64,1,2 =. 1,0,100% +f.. "begin(N = 0); I!=0?(da_push([x,y]);++N):0; end(resize(#-1,1,da_size(),1,2,0))" ++neq.. 0 distance. 1 *. -1 watershed... . rm. +1,64,1,3 +eval... " +V = crop(x,y,2,2); +min(V)?( +V[1]==V[0] && V[2]!=V[0] && V[3]!=V[0] && V[3]!=V[2]?( +da_push([ V[0],V[2],V[3] ]); +):(V[2]==V[0] && V[1]!=V[0] && V[3]!=V[0] && V[3]!=V[1]) || +(V[1]==V[2] && V[0]!=V[1] && V[3]!=V[0] && V[3]!=V[1])?( +da_push([ V[0],V[1],V[3] ]); +):(V[3]==V[0] && V[1]!=V[0] && V[2]!=V[0] && V[2]!=V[1]) || +(V[1]==V[3] && V[0]!=V[1] && V[2]!=V[0] && V[2]!=V[1]) || +(V[2]==V[3] && V[0]!=V[1] && V[0]!=V[2] && V[1]!=V[2]) ?( +da_push([ V[0],V[1],V[2] ]); +):V[0]!=V[1] && V[0]!=V[2] && V[0]!=V[3] && V[1]!=V[2] && V[1]!=V[3] && V[2]!=V[3]?( +da_push([ V[0],V[1],V[2] ]); +da_push([ V[1],V[3],V[2] ]); +); +end(resize(#-1,1,da_size(),1,3,0)); +)" +if $mode k[-2,-1] => ${bnm}_points,${bnm}_faces +else {0,[w,h,1,3]} eval.. "polygon(#-1,3,I[#1,i0],I[#1,i1],I[#1,i2],1,i0,i1,i2)" k. => $nm fi +} +#@cli detect_skin : 0<=tolerance<=1,_skin_x,_skin_y,_skin_radius>=0 +#@cli : Detect skin in selected color images and output an appartenance probability map. +#@cli : Detection is performed using CbCr chromaticity data of skin pixels. +#@cli : If arguments 'skin_x', 'skin_y' and 'skin_radius' are provided, skin pixels are learnt +#@cli : from the sample pixels inside the circle located at ('skin_x','skin_y') with radius 'skin_radius'. +#@cli : Default value: 'tolerance=0.5' and 'skin_x=skiny=radius=-1'. +detect_skin : check "${1=0.5}>=0 && $1<=1" skip ${2=-1},${3=-1},${4=-1} +if $2<0||$3<=0||$4<=0 +e[0--3] "Detect skin in image$?, using tolerance $1." +m0=120.9292108800069 +m1=142.5745272918084 +A=0.09749985486268997 +B=0.06388871371746063 +C=0.05250053107738495 +to_rgb srgb2rgb rgb2ycbcr channels 1,2 +foreach { +whd={w},{h},{d} r {whd},2,1,1,-1 +s y -[0] $m0 -[1] $m1 a y +i[0] ($A,$B;$B,$C) +m* rm[0] +* s y + *. {$1-1} exp. +r $whd,1,-1 +} +else +e[0--3] "Detect skin in image$?, using tolerance $1 and target circle at ($2,$3) with radius $4." +to_rgb srgb2rgb rgb2ycbcr channels 1,2 +foreach { +100%,100% circle[1] $2,$3,$4,1,1 +f[1] "i?y:-1" f[1] "i?x:-1" discard[1,2] -1 a[1,2] c ++warp[0] [1],0,0,1 rm[1] +s[1] c +m0={1,ia} -[1] $m0 +m1={2,ia} -[2] $m1 +M:=h a[1,2] x +transpose[1] rv[1,2] m*[1,2] /[1] $M invert[1] +rv whd={w},{h},{d} r[1] {whd},2,1,1,-1 +s[1] y -[1] $m0 -[2] $m1 a[1,2] y +m* rm[0] +* s y + *. {$1-1} exp. +r $whd,1,-1 +} +fi +#@cli displacement : [source_image],_smoothness,_precision>=0,_nb_scales>=0,_iteration_max>=0,is_backward={ 0 | 1 },_[guide] : (+) +#@cli : Estimate displacement field between specified source and selected target images. +#@cli : If 'smoothness>=0', regularization type is set to isotropic, else to anisotropic. +#@cli : If 'nbscales==0', the number of scales used is estimated from the image size. +#@cli : Default values: 'smoothness=0.1', 'precision=5', 'nb_scales=0', 'iteration_max=10000', 'is_backward=1' and '[guide]=(unused)'. +#@cli : $ image.jpg +rotate 3,1,0,50%,50% +displacement[-1] [-2] quiver[-1] [-1],15,1,1,1,{1.5*iM} +#@cli distance : isovalue[%],_metric : isovalue[%],[metric],_method : (+) +#@cli : Compute the unsigned distance function to specified isovalue, opt. according to a custom metric. +#@cli : 'metric' can be { 0:chebyshev | 1:manhattan | 2:euclidean | 3:squared-euclidean }. +#@cli : 'method' can be { 0:fast-marching | 1:low-connectivity dijkstra | 2:high-connectivity dijkstra | 3:1+return path | 4:2+return path }. +#@cli : Default value: 'metric=2' and 'method=0'. +#@cli : $ image.jpg threshold 20% distance 0 pow 0.3 +#@cli : $ 400,400 set 1,50%,50% +distance[0] 1,2 +distance[0] 1,1 distance[0] 1,0 mod 32 threshold 16 append c +#@cli : $$ https://gmic.eu/oldtutorial/_distance +#@cli fftpolar +#@cli : Compute fourier transform of selected images, as centered magnitude/phase images. +#@cli : $ image.jpg fftpolar ellipse 50%,50%,10,10,0,1,0 ifftpolar +fftpolar : +e[^-1] "Compute fourier transform of image$?, as centered magnitude/phase images." +foreach { fft complex2polar shift {-round(w/2)},{-round(h/2)},{-round(d/2)},0,2 } +#@cli histogram : nb_levels>0[%],_min_value[%],_max_value[%] : (+) +#@cli : Compute the histogram of selected images. +#@cli : If value range is set, the histogram is estimated only for pixels in the specified +#@cli : value range. Argument 'max_value' must be specified if 'min_value' is set. +#@cli : Default values: 'min_value=0%' and 'max_value=100%'. +#@cli : $ image.jpg +histogram 64 display_graph[-1] 400,300,3 +#@cli histogram_masked : [mask],nb_levels>0[%],_min_value[%],_max_value[%] +#@cli : Compute the masked histogram of selected images. +#@cli : Default values: 'min_value=0%' and 'max_value=100%'. +histogram_masked : check ${"is_image_arg $1"}" && isint($2) && $2>0" skip ${3=0%},${4=100%} +e[^-1] "Compute histogram of image$?, with mask $1, $2 levels in range [$3,$4]." +pass$1 +foreach[^-1] { +vmin,vmax:="1 + (ispercentage($3)?$3:($3 - im)/(iM - im)),""1 + (ispercentage($4)?$4:($4 - im)/(iM - im))" +n 1,2 pass$1 !=. 0 * discard 0 histogram $2,$vmin,$vmax +} +rm. +#@cli histogram_nd : nb_levels>0[%],_value0[%],_value1[%] +#@cli : Compute the 1D,2D or 3D histogram of selected multi-channels images (having 1,2 or 3 channels). +#@cli : If value range is set, the histogram is estimated only for pixels in the specified +#@cli : value range. +#@cli : Default values: 'value0=0%' and 'value1=100%'. +#@cli : $ image.jpg channels 0,1 +histogram_nd 256 +histogram_nd : check $1>0 skip ${2=0%},${3=100%} +e[^-1] "Compute histogram of multi-channels image$?, using $1 levels in range [$1,$2]." +foreach { nm={n} +vmin,vmax:="const a = ispercentage($2)?lerp(im,iM,$2):$2; +const b = ispercentage($3)?lerp(im,iM,$3):$3; +[ min(a,b), max(a,b) ]" +nb_levels:=max(1,round(ispercentage($1)?(1+$vmax-$vmin)*$1:$1)) +r {whd},1,1,{min(3,s)},-1 +if s==1 +histogram $nb_levels,$vmin,$vmax +elif s==2 +$nb_levels,$nb_levels +eval.. "ind(p) = cut(int($nb_levels*(p - $vmin)/($vmax - $vmin)),0,$nb_levels - 1); +inrange(i0,$vmin,$vmax) && inrange(i1,$vmin,$vmax)? +++i(#-1,ind(i0),ind(i1),0,0); I" +else +$nb_levels,$nb_levels,$nb_levels +eval.. "ind(p) = cut(int($nb_levels*(p - $vmin)/($vmax - $vmin)),0,$nb_levels - 1); +inrange(i0,$vmin,$vmax) && inrange(i1,$vmin,$vmax) && inrange(i2,$vmin,$vmax)? +++i(#-1,ind(i0),ind(i1),ind(i2),0); I" +fi +k. => $nm +} +#@cli histogram_cumul : _nb_levels>0,_is_normalized={ 0 | 1 },_val0[%],_val1[%] +#@cli : Compute cumulative histogram of selected images. +#@cli : Default values: 'nb_levels=256', 'is_normalized=0', 'val0=0%' and 'val1=100%'. +#@cli : $ image.jpg +histogram_cumul 256 histogram[0] 256 display_graph 400,300,3 +histogram_cumul : check ${1=256}>0 skip ${2=0},${3=0%},${4=100%} +arg0 !$2,"normalized ","" +e[^-1] "Compute "${}"cumulative histogram of image$?, using $1 levels." +histogram $1,$3,$4 cumulate if $2 foreach { / {iM} } fi +#@cli histogram_pointwise : nb_levels>0[%],_value0[%],_value1[%] +#@cli : Compute the histogram of each vector-valued point of selected images. +#@cli : If value range is set, the histogram is estimated only for values in the specified +#@cli : value range. +#@cli : Default values: 'value0=0%' and 'value1=100%'. +histogram_pointwise : skip ${2=0%},${3=100%} +e[^-1] "Compute the pointwise histogram of vector-valued points in image$?, with $1 levels." +foreach { +nm={n} +nb_levels:=round(ispercentage($1)?(iM-im)*$1:$1) +value0:=ispercentage($2)?im+(iM-im)*$2:$2 +value1:=ispercentage($3)?im+(iM-im)*$3:$3 +- $value0 * {$nb_levels/max(1,abs($value1-$value0))} c 0,{$nb_levels-1} round +w,h,d={w},{h},{d} r {whd},{s},1,1,-1 +i.. (0,{w-1}) r.. .,.,1,1,3 round.. +r[-2,-1] 300%,100%,1,1,4 shift. 1 +[-2,-1] y. +i.. ({'CImg3d'},{h/3},{h/3}) +(1,0;1,{h/3-1}) r. 2,{-2,h/3},1,1,3 round. +3,100%,1,1,1 1,100%,1,1,-1 y[-5,-3,-2] a[-5--1] y +{$w*$h*$d},$nb_levels j3d. ..,0,0,0,1,0,0,0 rm.. +r $w,$h,$d,$nb_levels,-1 => $nm +} +#@cli hough : _width>0,_height>0,gradient_norm_voting={ 0 | 1 } +#@cli : Compute hough transform (theta,rho) of selected images. +#@cli : Default values: 'width=512', 'height=width' and 'gradient_norm_voting=1'. +#@cli : $ image.jpg +blur 1.5 hough[-1] 400,400 blur[-1] 0.5 add[-1] 1 log[-1] +hough : check "${1=512}>0 && ${2=$1}>0" skip ${3=1} +e[^-1] "Compute $1x$2 hough transform of image$?, "${arg0\ !$3,with,without}" gradient norm voting." +slices 50% luminance +foreach { +nm={n} +rhomax:=sqrt(w^2+h^2)/2 +g (0,{w-1}) (0;{{-2,h}-1}) r[-2,-1] {-3,w},{-3,h},1,1,3 -.. {w/2} -. {h/2} +complex2polar[-4--1] -. ... polar2complex[-2,-1] rm. ++<. 0 *. {pi} +[-3,-1] abs. %.. {2*pi} +*. {$2/$rhomax} *.. {0.5*$1/pi} +y[-3--1] x {w} mv[-4] $! if !$3 f. 1 fi +a y pointcloud 1 r $1,$2,1,1,0 => $nm +} +#@cli ifftpolar +#@cli : Compute inverse fourier transform of selected images, from centered magnitude/phase images. +ifftpolar : +e[^-1] "Compute inverse fourier transform of image$?, from centered magnitude/phase images." +repeat int($!/2) { l[$>,{$>+1}] { +shift {round(w/2)},{round(h/2)},{round(d/2)},0,2 polar2complex ifft rm. +} } +#@cli img2patches : patch_size>0,_overlap[%]>0,_boundary_conditions +#@cli : Decompose selected 2D images into (possibly overlapping) patches and stack them along the z-axis. +#@cli : 'overlap' must be in range '[0,patch_size-1]'. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : Default values: 'overlap=0' and 'boundary_conditions=0'. +#@cli : See also: ''patches2img''. +#@cli : $ image.jpg img2patches 64 +img2patches : check "isint($1) && $1>0 && ${2=0}>=0 && isint(${3=0}) && $3>=0 && $3<=3" +e[^-1] "Decompose 2D images$? as $1x$1 patch-image, with overlap $2." +foreach { +if d>1 error[0--4] "Command 'img2patches': Image ["$>"] is not a 2D image (size: "{[w,h,d,s]}")." fi +nm={n} psiz=$1 +if ispercentage($2) overlap:=round(lerp(0,$psiz-1,$2)) else overlap:=int($2) fi +if $overlap<0" || "$overlap>=$psiz +error[0--4] "Command 'img2patches': Specified overlap $2 (value: "$overlap") is larger than ""patch size (value: "$psiz")." +fi +step:=$psiz-$overlap +Nw,Nh:=round([w,h]/$step,1,1) +$1,$1,{$Nw*$Nh},100% +eval.. "* +begin(ret = vector(#s); const boundary = $3); +(x%$step) + (y%$step)==0?( +P = crop(x,y,$psiz,$psiz); +ind = (y*$Nw + x)/$step; +draw(#1,P,0,0,ind,0,$psiz,$psiz,1,s); +); +ret" +k. => $nm +} +#@cli isophotes : _nb_levels>0 +#@cli : Render isophotes of selected images on a transparent background. +#@cli : Default value: 'nb_levels=64' +#@cli : $ image.jpg blur 2 isophotes 6 dilate_circ 5 display_rgba +isophotes : skip ${1=64} +e[^-1] "Render isophote maps from images$?, with $1 levels." +to_rgba +foreach { ++luminance repeat $1 { +isoline3d[1] {$>*255/($1-1)} } rm[1] +3d[^0] col3d. 1 +[0],[0] j3d. ..,0,0,0,1,0,0,0 rm.. * +} +#@cli label : _tolerance>=0,is_high_connectivity={ 0 | 1 },_is_L2_norm={ 0 | 1 } : (+) +#@cli : Label connected components in selected images. +#@cli : If 'is_L2_norm=1', tolerances are compared against L2-norm, otherwise L1-norm is used. +#@cli : Default values: 'tolerance=0', 'is_high_connectivity=0' and 'is_L2_norm=1'. +#@cli : $ image.jpg luminance threshold 60% label normalize 0,255 map 0 +#@cli : $ 400,400 set 1,50%,50% distance 1 mod 16 threshold 8 label mod 255 map 2 +#@cli : $$ https://gmic.eu/oldtutorial/_label +#@cli label_fg : tolerance>=0,is_high_connectivity={ 0 | 1 },_is_L2_norm={ 0 | 1 } +#@cli : Label connected components for non-zero values (foreground) in selected images. +#@cli : Similar to 'label' except that 0-valued pixels are not labeled. +#@cli : If 'is_L2_norm=1', tolerances are compared against L2-norm, otherwise L1-norm is used. +#@cli : Default value: 'is_high_connectivity=0'. +label_fg : check "$1>=0 && isbool(${2=0}) && isbool(${3=1})" +e[^-1] "Label foreground connected components on image [1], with tolerance $1 (L"{$3+1}"-norm) and "${arg0\ !$2,high,low}" connectivity." +foreach { +if d>1 +z -1,-1,-1,100%,100%,100% label. $1,$2,$3 z. 1,1,1,100%,100%,100% +else +z -1,-1,100%,100% label. $1,$2,$3 z. 1,1,100%,100% +fi +norm.. !=.. 0 * +histogram {1+iM} =. 0 +>. 0 cumulate. map.. . rm. +} +#@cli laar +#@cli : Extract the largest axis-aligned rectangle in non-zero areas of selected images. +#@cli : Rectangle coordinates are returned in status, as a sequence of numbers x0,y0,x1,y1. +#@cli : $ shape_cupid 256 coords=${-laar} normalize 0,255 to_rgb rectangle $coords,0.5,0,128,0 +laar : +e[^-1] "Extract the largest axis-aligned rectangle in non-zero areas of image$?." +res= sep= +foreach { ++channels 0 gt. 0 => shape ++cumulate[shape] xy => cumul +val:=i[-1,2] +if !$val res.=-1,-1,-1,-1 +elif $val==wh res.=0,0,{[w,h]-1} +else +Rin,Rout=0,{min(w,h)+1} +P0,P= +do +Rmid:=int(($Rin+$Rout)/2) +Q=${_laar\ $Rmid,$Rmid,$P} +if narg($Q) Rin=$Rmid P0=$Q P=$Q else Rout=$Rmid P= fi +while $Rin!=$Rout-1 +if $Rin==1 P=${_laar\ 1,1} fi +maxA,maxW,maxH=0 maxcoords= +P=$P0 W,H=$Rin +for $H>0 { +A:=$W*$H if $A>$maxA maxA,maxW,maxH=$A,$W,$H maxP:=[$P][0,2] fi +nW:=$W+1 +Q=${_laar\ $nW,$H,$P} +if narg($Q) W=$nW P=$Q +elif $H>1 +pH:=$H-1 +Q=${_laar\ $nW,$pH} +if narg($Q) W,H=$nW,$pH P=$Q +else H-=2 P= +fi +else break +fi +} +P=$P0 W,H=$Rin +for $W>0 { +A:=$W*$H if $A>$maxA maxA,maxW,maxH=$A,$W,$H maxP:=[$P][0,2] fi +nH:=$H+1 +Q=${_laar\ $W,$nH,$P} +if narg($Q) H=$nH P=$Q +elif $W>1 +pW:=$W-1 +Q=${_laar\ $pW,$nH} +if narg($Q) W,H=$pW,$nH P=$Q +else W-=2 P= +fi +else break +fi +} +res.=$sep$maxP,{[$maxP]+[$maxW,$maxH]-1} sep=, +fi +rm[shape,cumul] +} +u $res +_laar : skip "${3=}" +fn="cumul(x0,y0,x1,y1) = ( +_px0 = x0 - 1; +_py0 = y0 - 1; +i(#"$cumul,"x1,y1) + i(#"$cumul",_px0,_py0) - i(#"$cumul",x1,_py0) - i(#"$cumul",_px0,y1); +);" +res= +if narg($3) +(${3--1}) r. 2,{w/2},1,1,-1 s. x a[-2,-1] c +f. ${fn}"x1 = i0 + $1 - 1; y1 = i1 + $2 - 1; +i(#"$shape",i0,i1) && x1=1 +#@cli : Return locations of maximal values in local patch-based neighborhood of given size for selected images. +#@cli : Default value: 'patch_size=16'. +#@cli : $ image.jpg norm +max_patch 16 +max_patch : check "isint(${1=16}) && $1>=1" +e[^-1] "Return locations of maximal values in local patch neighborhood of size $1, in image$?." +foreach { +dilate $1 == } +#@cli min_patch : _patch_size>=1 +#@cli : Return locations of minimal values in local patch-based neighborhood of given size for selected images. +#@cli : Default value: 'patch_size=16'. +#@cli : $ image.jpg norm +min_patch 16 +min_patch : check "isint(${1=16}) && $1>=1" +e[^-1] "Return locations of minimal values in local patch neighborhood of size $1, in image$?." +foreach { +erode $1 == } +#@cli minimal_path : x0[%]>=0,y0[%]>=0,z0[%]>=0,x1[%]>=0,y1[%]>=0,z1[%]>=0,_is_high_connectivity={ 0 | 1 } +#@cli : Compute minimal path between two points on selected potential maps. +#@cli : Default value: 'is_high_connectivity=0'. +#@cli : $ image.jpg +gradient_norm fill[-1] 1/(1+i) minimal_path[-1] 0,0,0,100%,100%,0 pointcloud[-1] 0 *[-1] 280 to_rgb[-1] ri[-1] [-2],0 or +minimal_path : check "$1>=0 && $2>=0 && $3>=0" skip ${7=0} +e[^-1] "Compute minimal path between points ($1,$2,$3) and ($4,$5,$6) for potential map$?, with "${arg0\ $7,low,high}" connectivity." +foreach { +nm={n} +- {im} + {iM/100} +100%,100% = 1,${4-6} distance. 1,[0],{$7?4:3} k. channels. 1 +i[0] 0 +eval " +x = round(ispercentage($1)?$1*(w - 1):$1); +y = round(ispercentage($2)?$2*(h - 1):$2); +z = round(ispercentage($3)?$3*(d - 1):$3); +da_push(#0,[x,y,z]); +do ( +p = i(x,y,z); +p&1?--x:p&2?++x; +p&4?--y:p&8?++y; +p&16?--z:p&32?++z; +da_push(#0,[x,y,z]), +_(while) p); +resize(#0,1,da_size(#0),1,3,0)" +rm. => $nm +} +#@cli mse : [reference] +#@cli : Return the MSE (Mean-Squared Error) between selected images and specified reference image. +#@cli : This command does not modify the images. It returns a value or a list of values in the status. +mse : +e[^-1] "Compute MSE between image$? and reference image $1." +pass$1 1 +_mse[^-1] . rm. ++mse : +e[^-1] "Compute MSE between image$? and reference image $1." +pass$1 1 +_mse[^-1] . rm. ++_mse : check ${"is_image_arg $1"} +rep,sep= +pass$1 1 ++foreach[^-1] { +pass. 1 +if [w#0,h#0,d#0,s#0]!=[w#1,h#1,d#1,s#1] +error[0--5] "Command 'mse': Image dimensions ("{0,[w,h,d,s]}") and ("{1,[w,h,d,s]}") do not match." +fi +- sqr res.=$sep{ia} sep=, rm +} +rm. u $res +#@cli mse_matrix +#@cli : Compute MSE (Mean-Squared Error) matrix between selected images. +#@cli : $ image.jpg +noise 30 +noise[0] 35 +noise[0] 38 cut. 0,255 +mse_matrix +mse_matrix : +e[^-1] "Compute the "$!x$!" matrix of MSE values, for image$?." ++mse_matrix k. ++mse_matrix : +e[^-1] "Compute the "$!x$!" matrix of MSE values, for images$?." +N=$! $N,$N +repeat $N { i=$> +j:=$i+1 for $j<$N { ++mse[$i] [$j] =. ${},$i,$j =. ${},$j,$i +j+=1 +} +} +#@cli patches2img : width>0,height>0,_overlap[%]>0,_overlap_std[%] +#@cli : Recompose 2D images from their selected patch representations. +#@cli : 'overlap' must be in range '[0,patch_size-1]' where 'patch_size' is the width/height of the selected image. +#@cli : 'overlap_std' is the standard deviation of the gaussian weights used for reconstructing overlapping patches. +#@cli : If 'overlap_std' is set to '-1', uniform weights are used rather than gaussian. +#@cli : Default value: 'overlap=0' and 'overlap_std=-1'. +#@cli : See also: ''img2patches''. +#@cli : $ image.jpg +img2patches 32,0,3 mirror[-1] xy patches2img[-1] {0,[w,h]} +patches2img : check "isint($1) && $1>0 && isint($2) && $2>0 && ${3=0}>=0 && (${4=-1}==-1 || $4>=0)" +e[^-1] "Recompose 2D images from patch-image$?, with size ($1,$2), overlap $3 and overlap_std $4." +foreach { +if w!=h error[0--4] "Command 'patches2img': Image "[$>]" is not a patch-image (size: "{[w,h,d,s]}")." fi +nm={n} psiz:=w W,H:=${1,2} +if ispercentage($3) overlap:=round(lerp(0,$psiz-1,$3)) else overlap:=int($3) fi +if $overlap<0" || "$overlap>=$psiz +error[0--4] "Command 'patches2img': Specified overlap $3 (value: "$overlap") is larger than ""patch size (value: "$psiz")." +fi +step:=$psiz-$overlap +Nw,Nh:=round([$W,$H]/$step,1,1) +$W,$H,1,100% +if $overlap +$psiz,$psiz if $4==-1 f. 1 else gaussian. $4 n. 1e-8,1 fi store. weights +$W,$H,1,1,1e-5 +1,1,[0],1,"> +begin(M = get('weights',$psiz*$psiz)); +P = crop(#0,0,0,z,$psiz,$psiz,1); +X = $step*(z%$Nw); +Y = $step*int(z/$Nw); +draw(#1,P,X,Y,0,0,$psiz,$psiz,1,s#0,-1,M); +draw(#2,M,X,Y,0,0,$psiz,$psiz,1,1,-1)" +/[-3,-2] +else +1,1,[0],1,"* +P = crop(#0,0,0,z,w#0,h#0,1); +X = $step*(z%$Nw); +Y = $step*int(z/$Nw); +draw(#1,P,X,Y,0,0,w#0,h#0,1,s#0)" +fi +k.. => $nm +} +#@cli patches : patch_width>0,patch_height>0,patch_depth>0,x0,y0,z0,_x1,_y1,_z1,...,_xN,_yN,_zN +#@cli : Extract N+1 patches from selected images, centered at specified locations. +#@cli : $ image.jpg +patches 64,64,1,153,124,0,184,240,0,217,126,0,275,38,0 +patches : check "isint($1) && $1>0 && isint($2) && $2>0 && isint($3) && $3>0" +e[^-1] "Extract $1x$2x$3 patches from image$?, at locations (${4--1})." +(${4--1}) r. 3,{w/3},1,1,-1 permute. yzcx N:=w +H:=int(sqrt(w)) W:=round(w/$H,1,1) r. {$W*$H},1,1,3,0 r. $W,$H,1,3,-1 +r. {w*$1},{h*$2},{d*$3} +$1,$2,$3,1,x-{int($1/2)} +f. y-{int($2/2)} +f. z-{int($3/2)} a[-3--1] c ri. ..,0,2 +[-2,-1] +repeat $!-1 { warp[$>] .,0,0,0 } rm. +foreach { s y,$H s x,$W k[0-{$N-1}] } +#@cli matchpatch : [patch_image],patch_width>=1,_patch_height>=1,_patch_depth>=1,_nb_iterations>=0,_nb_randoms>=0,_patch_penalization,_output_score={ 0 | 1 },_[guide] : (+) +#@cli : Estimate correspondence map between selected images and specified patch image, using +#@cli : a patch-matching algorithm. +#@cli : Each pixel of the returned correspondence map gives the location (p,q) of the closest patch in +#@cli : the specified patch image. If 'output_score=1', the third channel also gives the corresponding +#@cli : matching score for each patch as well. +#@cli : If 'patch_penalization' is >=0, SSD is penalized with patch occurrences. +#@cli : If 'patch_penalization' is <0, SSD is inf-penalized when distance between patches are less than '-patch_penalization'. +#@cli : Default values: 'patch_height=patch_width', 'patch_depth=1', 'nb_iterations=5', 'nb_randoms=5', 'patch_penalization=0', 'output_score=0' and 'guide=(undefined)'. +#@cli : $ image.jpg sample colorful +matchpatch[0] [1],3 +warp[-2] [-1],0 +#@cli plot2value +#@cli : Retrieve values from selected 2D graph plots. +#@cli : $ 400,300,1,1,'y>300*abs(cos(x/10+2*u))' +plot2value +display_graph[-1] 400,300 +plot2value : +e[^-1] "Retrieve values from 2D graph plot$?." +foreach { +s c >= 50% +foreach { (1,{w}) ri[1] [0],3 * histogram {w},1,{w} } +a c +} +#@cli pointcloud : _type = { -X:-X-opacity | 0:binary | 1:cumulative | 2:label | 3:retrieve coordinates },_width,_height>0,_depth>0 +#@cli : Render a set of point coordinates, as a point cloud in a 1D/2D or 3D binary image +#@cli : (or do the reverse, i.e. retrieve coordinates of non-zero points from a rendered point cloud). +#@cli : Input point coordinates can be a NxMx1x1, Nx1x1xM or 1xNx1xM image, where 'N' is the number of points, +#@cli : and M the point coordinates. +#@cli : If 'M'>3, the 3-to-M components sets the (M-3)-dimensional color at each point. +#@cli : Parameters 'width','height' and 'depth' are related to the size of the final image : +#@cli : - If set to 0, the size is automatically set along the specified axis. +#@cli : - If set to N>0, the size along the specified axis is N. +#@cli : - If set to N<0, the size along the specified axis is at most N. +#@cli : Points with coordinates that are negative or higher than specified ('width','height','depth') +#@cli : are not plotted. +#@cli : Default values: 'type=0' and 'max_width=max_height=max_depth=0'. +#@cli : $ 3000,2 rand 0,400 +pointcloud 0 dilate[-1] 3 +#@cli : $ 3000,2 rand 0,400 {w} {w},3 rand[-1] 0,255 append y +pointcloud 0 dilate[-1] 3 +pointcloud : check "${1=0}<=3 && ${2=0}>=0 && ${3=0}>=0 && ${4=0}>=0" +e[^-1] "Convert image$? to point clouds, in "${arg\ 2+($1>=0)*$1-($1<0),{-$1}-opacity,binary,cumulative,labeling}" mode, with dimensions $2x$3x$4." +foreach { +nm={n} +if $1!=3 +if "d>1 || (w>1 && h>1 && s>1)" +error "Command '$0': Invalid input image "{w}x{h}x{d}x{s}". Should be NxMx1x1, Nx1x1xM or 1xNx1xM." +fi +if "w>1 && h>1 && s==1" r 100%,1,1,{h},-1 +elif "w==1 && h>1 && s>1" r {h},1,1,{s},-1 +fi +if s<3 channels 0,2 fi +if s<4 100%,1,1,1,1 a[-2,-1] c fi +sh. 0 round. siz_x:=!$2?iM+1:$2 +sh.. 1 round. siz_y:=!$3?iM+1:$3 +sh... 2 round. siz_z:=!$4?iM+1:$4 +rm[-3--1] +$siz_x,$siz_y,$siz_z,{$1!=2?s-3:1} +if $1<0 +f.. ">V = I; P = V[0,3]; C = V[3,size(V) - 3]; I(#-1,P) = (1+$1)*I(#-1,P) - $1*C; V" +elif !$1 +f.. ">V = I; P = V[0,3]; C = V[3,size(V) - 3]; I(#-1,P) = C; V" +elif $1==1 +f.. ">V = I; P = V[0,3]; C = V[3,size(V) - 3]; I(#-1,P) += C; V" +else +f.. ">begin(l = 0); V = I; P = V[0,3]; C = V[3,size(V) - 3]; I(#-1,P) = ++l; V" +fi +else +16,1,1,{s+3} +f.. "> +begin(N = 0; zero = vectors(0)); +I!=zero?I[#-1,N++] = [ x,y,z,I ]; +N>=w(#-1)?resize(#-1,1.5*w(#-1),1,1,s#-1,0); +end(resize(#-1,N,1,1,s#-1,0)); +I" +fi +k. => $nm +} +#@cli psnr : [reference],_max_value>0 +#@cli : Return PSNR (Peak Signal-to-Noise Ratio) between selected images and specified reference image. +#@cli : This command does not modify the images. It returns a value or a list of values in the status. +#@cli : Default value: 'max_value=255'. +psnr : check ${"is_image_arg $1"}" && ${2=255}>0" +e[^-1] "Compute PSNR between image$? and reference image $1, with max value $2." +pass$1 1 +_psnr[^-1] .,$2 rm. ++psnr : check ${"is_image_arg $1"}" && ${2=255}>0" +e[^-1] "Compute PSNR between image$? and reference image $1, with max value $2." +pass$1 1 +_psnr[^-1] .,$2 rm. ++_psnr : check ${"is_image_arg $1"}" && ${2=255}>0" +rep,sep= +pass$1 1 ++foreach[^-1] { +pass. 1 +if [w#0,h#0,d#0,s#0]!=[w#1,h#1,d#1,s#1] +error[0--5] "Command 'psnr': Image dimensions ("{0,[w,h,d,s]}") and ("{1,[w,h,d,s]}") do not match." +fi +- sqr res.=$sep{"const m2 = ($2)^2; 10*log10(m2/ia)"} sep=, rm +} +rm. u $res +#@cli psnr_matrix : _max_value>0 +#@cli : Compute PSNR (Peak Signal-to-Noise Ratio) matrix between selected images. +#@cli : Default value: 'max_value=255'. +#@cli : $ image.jpg +noise 30 +noise[0] 35 +noise[0] 38 cut. 0,255 +psnr_matrix +psnr_matrix : check "${1=255}>0" +e[^-1] "Compute the "$!x$!" matrix of PSNR values, for image$?, with max value $1." ++psnr_matrix $1 k. ++psnr_matrix : check "${1=255}>0" +e[^-1] "Compute the "$!x$!" matrix of PSNR values, for images$?, with max value $1." +N=$! $N,$N +repeat $N { i=$> +j:=$i+1 for $j<$N { ++psnr[$i] [$j],$1 =. ${},$i,$j =. ${},$j,$i +j+=1 +} +=. inf,$i,$i +} +#@cli segment_watershed : _threshold>=0 +#@cli : Apply watershed segmentation on selected images. +#@cli : Default values: 'threshold=2'. +#@cli : $ image.jpg segment_watershed 2 +segment_watershed : check "${1=2}>=0" +e[^-1] "Apply watershed segmentation on image$?, with edge threshold $1." +foreach { +min:=im ++ {1+$min} +gradient_norm ++f. "i<$1 && i=0,0<=_weight_std_max_avg<=1,_dilation,_smoothness>=0 +#@cli : Estimate bumpmap from binary shape in selected images. +#@cli : Default value: 'resolution=256', 'weight_std_max=0.75', 'dilation=0' and 'smoothness=100'. +shape2bump : check "isint(${1=256}) && $1>=0 && ${2=0.75}>=0 && $2<=1 && isnum(${3=0}) && ${4=100}>=0" +e[^-1] "Estimate bumpmap from binary shape in image$?, using "${"if $1 u \"resolution $1\" else u \"full resolution\" fi"}", avg/max weight $2, dilation $3 +and smoothness $4." +foreach { +slices 0 channels 100% > 0 siz:=w,h +distance 0 + $3 ++f. "const boundary = 1; +(i>j(-1)&&i>j(1)) || (i>j(0,-1)&&i>j(0,1)) || (i>j(-1,-1)&&i>j(1,1)) || (i>j(-1,1)&&i>j(1,-1))" +is_resized=0 +if $1" && "max(w,h)>$1 rr2d $1,$1,0,2 gt. 0 thinning. 1 *.. {$1/max([$siz])} is_resized=1 fi +rmax={0,iM} +[0],[0] +if $2>0 +eval[1] ":i?( +r = i(#0,x,y); +ir = floor(r); +r2 = r^2; +for (q = -ir, q<=ir, ++q, +Y = y + q; +for (p = -ir, p<=ir, ++p, +X = x + p; +dist = norm(p,q); +dist=0 && $1<=1)" +if isnum($1) bc=$1 else bc=1 noarg fi +e[^-1] "Compute skeleton of binary image$? with "${"arg0 "$bc",dirichlet,neumann"}" boundary conditions." +foreach { s c foreach { +1,16,1,2 +1,16,1,2 ++distance[0] 0 +f. "const boundary = 1; +(i>j(-1)&&i>j(1)) || (i>j(0,-1)&&i>j(0,1)) || (i>j(-1,-1)&&i>j(1,1)) || (i>j(-1,1)&&i>j(1,-1))" +f[0] ">const boundary = "$bc"; +i && (!j(-1) || !j(1) || !j(0,-1) || !j(0,1))?da_push(#1,[x,y]); i;" +eval " +const boundary = "$bc"; +is_removable = [ 0,0,1,1,0,0,1,1,1,1,0,1,1,1,0,1,1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,1,1,1,0,1,1,1,0, +1,1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,1,1,0,0,1,1,0,0,1,1,0,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,1,1,1,0,1,1, +1,0,1,1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,1,1,1,0,1,1,1,0,1,1,1,0,0,1,1,1,1,0,0,0,0, +0,0,0,1,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,0,0,1,1,0,0,1,1,0, +1,1,1,0,1,1,1,0,0,1,1,1,1,1,1,0,1,1,1,1,0 ]; +dotm = [ 128,64,32,16,0,8,4,2,1 ]; +is_removed = 1; +while (is_removed, +is_removed = 0; +N = da_size(#1); +repeat (N,n, +xc = i(#1,0,n,0,0); +yc = i(#1,0,n,0,1); +icc = i(#0,xc,yc); +(icc && !i(#3,xc,yc))?( +xp = xc - 1; yp = yc - 1; +xn = xc + 1; yn = yc + 1; +ref(crop(#0,xp,yp,3,3),V); +val = dot(dotm,V>0); +is_removable[val]?( +i(#0,xc,yc) = 0; +is_removed = 1; +V[3]==1?(da_push(#2,[xp,yc]); i(#0,xp,yc) = 2); +V[5]==1?(da_push(#2,[xn,yc]); i(#0,xn,yc) = 2); +V[1]==1?(da_push(#2,[xc,yp]); i(#0,xc,yp) = 2); +V[7]==1?(da_push(#2,[xc,yn]); i(#0,xc,yn) = 2); +):(da_push(#2,[xc,yc]); i(#0,xc,yc) = 2); +) +); +resize(#1,1,h(#2),1,2,0); +copy(i(#1),i(#2),2*h(#2)); +i[#2,h(#2)-1] = 0; +);" +k[0] > 0 thinning +} a c } +#@cli slic : size>0,_regularity>=0,_nb_iterations>0 +#@cli : Segment selected 2D images with superpixels, using the SLIC algorithm (Simple Linear Iterative Clustering). +#@cli : Scalar images of increasingly labeled pixels are returned. +#@cli : Reference paper: Achanta, R., Shaji, A., Smith, K., Lucchi, A., Fua, P., & Susstrunk, S. (2010). SLIC Superpixels (No. EPFL-REPORT-149300). +#@cli : Default values: 'size=16', 'regularity=10' and 'nb_iterations=10'. +#@cli : $ image.jpg +srgb2lab slic[-1] 16 +blend shapeaverage f[-2] "j(1,0)==i && j(0,1)==i" *[-1] [-2] +slic : check "${1=16}>0 && ${2=10}>=0 && ${3=10}>0" +e[^-1] "Segment image$? using SLIC superpixels, with size $1, regularity $2 and $3 iterations." +S,m,nb_iter=${1-3} +foreach { +slices 50% +{[max(1,round(w/$S)),max(1,round(h/$S))]},1,2,"round(([x,y]+=0.5)*="$S")" +if $S>=3 ++b[0] 0.7 g. xy,1 a[-2,-1] c norm. +f.. " +const n = round("$S"/3); +const n1 = int(n/2); +pos = argmin(crop(#-1,i0 - n1,i1 - n1,n,n,1)); +dxy = [pos%n,int(pos/n)] - n1; +[ cut(i0 + dxy[0],0,w#0-1), cut(i1 + dxy[1],0,h#0-1) ]" +rm. +fi +r. {wh},1,1,2,-1 +100%,1,1,{0,s},"I(#0,I#1)" a[-2,-1] c # Add superpixels colors +[0],[0],1,2 eval.. "I(#-1,i0,i1) = [ x + 1,1 ]; I" s. c distance. 1 *. -1 watershed.. . rm. channels. 0,1 +repeat $nb_iter { +sh[2] 1 f. inf rm. +eval[1] " +const m = "$m"; +const S = "$S"; +k = x; +xk = i0; +yk = i1; +Ik = (I)[2,s#0]; +x0 = max(xk - S,0); +x1 = min(xk + S,w#0 - 1); +y0 = max(yk - S,0); +y1 = min(yk + S,h#0 - 1); +for (y = y0, y<=y1, ++y, +for (x = x0, x<=x1, ++x, +delta_c = norm(I(#0,x,y) - Ik); +delta_s = norm([x - xk, y - yk]); +delta = delta_c + m/S*delta_s; +if (delta +const boundary = 1; +if (i[#-1,i]>=0, +N = [ j(-1,0),j(0,-1),j(1,0),j(0,1) ]; +repeat (size(N),k, +if (N[k]!=i, +i[#-1,i] = i[#-1,i]==i || i[#-1,i]==N[k]?N[k]:-1 +); +); +); +i" +f. "i>=0" +map[0] . rm.. or[-2,-1] ++[0] 1 100%,100% j[0] .,0,0,0,0,1,.. rm. +distance. 0 *. -1 watershed.. . rm. +label. 0,0 +} +#@cli ssd_patch : [patch],_use_fourier={ 0 | 1 },_boundary_conditions +#@cli : Compute fields of SSD between selected images and specified patch. +#@cli : Argument 'boundary_conditions' is valid only when 'use_fourier=0'. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : Default value: 'use_fourier=0' and 'boundary_conditions=0'. +#@cli : $ image.jpg +crop 20%,20%,35%,35% +ssd_patch[0] [1],0,0 +ssd_patch : check ${is_image_arg\ $1} skip ${2=0},${3=0} +e[^-1] "Compute field of SSD between image$? and patch $1 using "${arg0\ !$2,fourier,spatial}" mode." +repeat $! { pass$1 0 l[$>,-1] { +r 100%,100%,100%,${-max_s} s c +repeat $!/2 { l[$>,{-1-$<}] { ++sqr[1] val:=is rm. ++sqr[0] +f[1] 1 +if $2 +convolve_fft.. . rm. +mirror[1] xyz convolve_fft[0] [1] rm[1] +else +correlate.. .,$3 rm. +correlate[0] [1],$3 rm[1] +fi +*[0] -2 +[0,1] + $val +} } + +} } +#@cli ssim : [reference],_patch_size>0,_max_value>0 +#@cli : Compute the Structural Similarity Index Measure (SSIM) between selected images and specified reference image. +#@cli : This command does not modify the images, it just returns a value or a list of values in the status. +#@cli : When 'downsampling_factor' is specified with a ending '%', its value is equal to '1+(patch_size-1)*spatial_factor%'. +#@cli : \nSSIM is a measure introduced int the following paper: +#@cli : *Wang, Zhou, et al.*, "Image quality assessment: from error visibility to structural similarity.", +#@cli : in IEEE transactions on image processing 13.4 (2004): 600-612. +#@cli : \nThe implementation of this command is a direct translation of the reference code (in Matlab), found at : +#@cli : https://ece.uwaterloo.ca/~z70wang/research/ssim/ +#@cli : Default values: 'patch_size=11', and 'max_value=255'. ++ssim : check ${"is_image_arg $1"}" && isint(${2=11}) && $2>0 && ${3=255}>0" +e[^-1] "Compute the SSIM between image$? and reference image $1, with patch size $2 and max_value $3." +C1,C2:=([0.01,0.03]*$3)^2 +$2,$2 gaussian. 1.5 /. {is} store. gaussian_weights +res,sep= +pass$1 ++foreach[^-1] { +pass. 0 +if [w#0,h#0,d#0,s#0]!=[w#1,h#1,d#1,s#1] +error[0--4] "Command 'ssim': Image dimensions ("{0,[w,h,d,s]}") and ("{1,[w,h,d,s]}") do not match." +fi +f:=max(1,round(min(w,h)/256)); +if $f>1 r {round([w,h,d]/$f,1,1)},100%,2 fi +=> A,B +$gaussian_weights => W +p0,p1:="p0 = round(w/2,1,-1); [ p0,w-1-p0 ]" ++correlate[A,B] [W],0,0,1,$p0,$p0,0,$p0,$p0,0,{A,[w,h]-1-$p1},0 +mul[-2,-1] sqr[-3,-2] => muA2,muB2,muAB ++mul[A,B] sqr[A,B] =>[A,B,-1] A2,B2,AB +correlate[A2,B2,AB] [W],0,0,1,$p0,$p0,0,$p0,$p0,0,{A2,[w,h]-1-$p1},0 -[A2] [muA2] -[B2] [muB2] -[AB] [muAB] +=>[A2,B2,AB] sigA2,sigB2,sigAB +*[muAB] 2 +[muAB] $C1 *[sigAB] 2 +[sigAB] $C2 *[muAB,sigAB] =>[muAB] num ++[muA2,muB2] +[muA2] $C1 +[sigA2,sigB2] +[sigA2] $C2 *[sigA2,muA2] =>[sigA2] den +/[num] [den] +res.=$sep{ia} sep=, rm +} +rm. u $res +#@cli ssim_matrix : _patch_size>0,_max_value>0 +#@cli : Compute SSIM (Structural Similarity Index Measure) matrix between selected images. +#@cli : Default values: 'patch_size=11', and 'max_value=255'. +#@cli : $ image.jpg +noise 30 +noise[0] 35 +noise[0] 38 cut. 0,255 +ssim_matrix +ssim_matrix : check "isint(${1=11}) && $1>0 && ${2=255}>0" +e[^-1] "Compute the "$!x$!" matrix of SSIM values, for image$?, with patch size $1 and max value $2." ++ssim_matrix ${1,2} k. ++ssim_matrix : check "isint(${1=11}) && $1>0 && ${2=255}>0" +e[^-1] "Compute the "$!x$!" matrix of SSIM values, for image$?, with patch size $1 and max value $2." +N=$! $N,$N +repeat $N { i=$> +j:=$i+1 for $j<$N { ++ssim[$i] [$j],${1,2} =. ${},$i,$j =. ${},$j,$i +j+=1 +} +=. 1,$i,$i +} +#@cli thinning : _boundary_conditions={ 0:dirichlet | 1:neumann } +#@cli : Compute skeleton of binary shapes using morphological thinning +#@cli : (beware, this is a quite slow iterative process) +#@cli : Default value: 'boundary_conditions=1'. +#@cli : $ shape_cupid 320 +thinning +thinning : check "!isnum(${1=1}) || ($1>=0 && $1<=1)" +if isnum($1) bc=$1 else bc=1 noarg fi +e[^-1] "Apply morphological thinning to binary image$? with "${"arg0 "$bc",dirichlet,neumann"}" boundary conditions." +foreach { s c foreach { +1,16,1,2 +1,16,1,2 +1,16,1,2 +f[0] ">const boundary = "$bc"; +i && (!j(-1) || !j(1) || !j(0,-1) || !j(0,1))?da_push(#1,[x,y]); i;" +eval " +const boundary = "$bc"; +hm_and = [ 231,189,231,189,122,91,94,218 ]; +hm_eq = [ 7,148,224,41,18,80,72,10 ]; +dotm = [ 128,64,32,16,0,8,4,2,1 ]; +is_removed = vector8(0); +ind = 1; +nind = 3; +it = 0; +do ( +N = da_size(#ind); +it8 = it%8; +is_removed[it8] = 0; +repeat (N,n, +xc = i(#ind,0,n,0,0); +yc = i(#ind,0,n,0,1); +icc = i(#0,xc,yc); +icc?( +xp = xc - 1; yp = yc - 1; +xn = xc + 1; yn = yc + 1; +ref(crop(#0,xp,yp,3,3),V); +val = dot(dotm,V>0); +(val & hm_and[it8])==hm_eq[it8]?( +da_push(#2,[xc,yc]); +is_removed[it8] = 1; +V[3]==1?(da_push(#nind,[xp,yc]); i(#0,xp,yc) = 2); +V[5]==1?(da_push(#nind,[xn,yc]); i(#0,xn,yc) = 2); +V[1]==1?(da_push(#nind,[xc,yp]); i(#0,xc,yp) = 2); +V[7]==1?(da_push(#nind,[xc,yn]); i(#0,xc,yn) = 2); +):(da_push(#nind,[xc,yc]); i(#0,xc,yc) = 2); +); +); +N = da_size(#nind); +repeat (N,n, i(#0,i[#nind,n],i[#nind,n + h(#nind)]) = 1); +_tmp = ind; ind = nind; nind = _tmp; +i[#nind,h(#nind)-1] = 0; +N = da_size(#2); +repeat (N,n, i(#0,I[#2,n]) = 0); +i[#2,h(#2)-1] = 0; +++it; +_(while), max(is_removed) +);" +k[0] +} a c } +#@cli tones : N>0 +#@cli : Get N tones masks from selected images. +#@cli : $ image.jpg +tones 3 +tones : check $1>0 +e[^-1] "Get $1 tones masks from image$?." +norm n 0,{$1-1} round 1 +foreach { +repeat $1-1 { +==[0] {1+$>} } ==[0] 0 +} +#@cli topographic_map : _nb_levels>0,_smoothness +#@cli : Render selected images as topographic maps. +#@cli : Default values: 'nb_levels=16' and 'smoothness=2'. +#@cli : $ image.jpg topographic_map 10 +topographic_map : check "isint(${1=16}) && $1>0" skip ${2=2} +e[^-1] "Render topographic maps from image$?, with $1 levels and smoothness $2." +foreach { +b $2 isophotes. $1 compose_channels. + ==. 0 blend shapeaverage0 } +#@cli tsp : _precision>=0 +#@cli : Try to solve the 'travelling salesman' problem, using a combination of greedy search and 2-opt algorithms. +#@cli : Selected images must have dimensions Nx1x1xC to represent N cities each with C-dimensional coordinates. +#@cli : This command re-order the selected data along the x-axis so that the point sequence becomes a shortest path. +#@cli : Default values: 'precision=256'. +#@cli : $ 256,1,1,2 rand 0,512 tsp , 512,512,1,3 repeat w#0 circle[-1] {0,I[$>]},2,1,255,255,255 line[-1] {0,boundary=2;[I[$>],I[$>+1]]},1,255,128,0 done keep[-1] +tsp : check "${1=256}>=0" +e[^-1] "Try to solve the 'travelling salesman' problem for pointcloud$?, with precision $1." +foreach { +nm={n} +if h>1" || "d>1 error[0--4] "Selected image '"{n}"' has invalid dimensions ("{[w,h,d,s]}")." fi +eval " +is_used = vectorw(0); +next = vectorw(-1); +n_initial = n_current = round(u(0,w-1)); +do ( +is_used[n_current] = 1; +P_current = I[n_current]; +n_next = -1; dmin = inf; +repeat (w,n, +if (!is_used[n], +d = norm(I[n] - P_current); +if (dbegin(ind = 0); val = I[#0,ind]; ind = val[s]; val" rm.. +eval " +is_improved = 1; +while (is_improved, +is_improved = 0; +nb_try = $1*w; +repeat (nb_try,try, +r = round(max(8,0.5*w*(try/nb_try)^0.25)); +i = round(u(0,w-1)); +ni = (i+1)%w; +pi = (i-1)%w; +do (j = (i + round(u(-r,r)))%w; _(while), j==i || j==ni || j==pi); +nj = (j+1)%w; +P_i = I[i]; +P_ni = I[ni]; +P_j = I[j]; +P_nj = I[nj]; +dist_ini = norm(P_ni - P_i); +dist_jnj = norm(P_nj - P_j); +dist_ij = norm(P_j - P_i); +dist_ninj = norm(P_nj - P_ni); +if (dist_ij + dist_ninj $nm +} +#@cli variance_patch : _patch_size>=1 +#@cli : Compute variance of each images patch centered at (x,y), in selected images. +#@cli : Default value: 'patch_size=16' +#@cli : $ image.jpg +variance_patch +variance_patch : check "isint(${1=16}) && $1>=1" +e[^-1] "Compute variance of image patches in image$?, with patch size $1." +$1,$1,1,1,1 normalize_sum. +repeat $!-1 { l[$>,-1] { ++sqr[0] convolve[0,2] [1] +sqr[0] rv[0,2] -[0,2] max[0] 0 +} } rm. +#@cli :: Image Drawing +#@cli arrow : x0[%],y0[%],x1[%],y1[%],_thickness[%]>=0,_head_length[%]>=0,_head_thickness[%]>=0,_opacity,_pattern,_color1,... +#@cli : Draw specified arrow on selected images. +#@cli : 'pattern' is an hexadecimal number starting with '0x' which can be omitted +#@cli : even if a color is specified. If a pattern is specified, the arrow is +#@cli : drawn outlined instead of filled. +#@cli : Default values: 'thickness=1%', 'head_length=10%', 'head_thickness=3%', 'opacity=1', 'pattern=(undefined)' and 'color1=0'. +#@cli : $ 400,400,1,3 repeat 100 arrow 50%,50%,{u(100)}%,{u(100)}%,3,20,10,0.3,${-rgb} done +arrow : check "${5=1%}>=0 && ${6=10%}>=0 && ${7=3%}" skip ${8=1} +e[^-1] "Draw arrow in image$?, from ($1,$2) to ($3,$4), with thickness $5, head length $6, +head_thickness $7 and opacity $8." +foreach { +polygon. 7,{" +x0 = ispercentage($1)?(w-1)*$1:$1; +y0 = ispercentage($2)?(h-1)*$2:$2; +x1 = ispercentage($3)?(w-1)*$3:$3; +y1 = ispercentage($4)?(h-1)*$4:$4; +p0 = [x0,y0]; +dp = [x1,y1]-=p0; +l = norm(dp); +t = ispercentage($5)?l*$5:$5; +hl = ispercentage($6)?l*$6:$6; +ht = ispercentage($7)?l*$7:$7; +lmhl = l - hl; +X = mul([0,-t,lmhl,-t,lmhl,-ht,l,0,lmhl,ht,lmhl,t,0,t],rot(-atan2(dp[1],dp[0])),2); +X+=[p0,p0,p0,p0,p0,p0,p0]"},${8--1} +} +#@cli axes : x0,x1,y0,y1,_font_height>=0,_opacity,_pattern,_color1,... +#@cli : Draw xy-axes on selected images. +#@cli : 'pattern' is an hexadecimal number starting with '0x' which can be omitted +#@cli : even if a color is specified. +#@cli : To draw only one x-axis at row Y, set both 'y0' and 'y1' to Y. +#@cli : To draw only one y-axis at column X, set both 'x0' and 'x1' to X. +#@cli : Default values: 'font_height=14', 'opacity=1', 'pattern=(undefined)' and 'color1=0'. +#@cli : $ 400,400,1,3,255 axes -1,1,1,-1 +axes : check "isint(${5=14}) && $5>=0 && ${6=1}>=0" skip ${7=0},${8=0} +if ${"is_pattern \"$7\""} +e[0--3] "Draw xy-axes on image$?, with x-range ($1,$2), y-range ($3,$4), font height $5, opacity $6, +pattern $7 and color (${8--1})." +pattern=$7 color=${8--1} +else +e[0--3] "Draw xy-axes on image$?, with x-range ($1,$2), y-range ($3,$4), font height $5, opacity $6 +and color (${7--1})." +pattern=0xFFFFFFFF color=${7--1} +fi +if !$5" || "!$6 return fi +mx:=min($1,$2) Mx:=max($1,$2) +my:=min($3,$4) My:=max($3,$4) +foreach { +w1,h1={0,[w,h]-1} +if $1!=$2 u=${"_axes[] $1,$2,{0.3*w/$5}"} offx:=arg(1,$u) deltax:=arg(2,$u) fi +if $3!=$4 u=${"_axes[] $3,$4,{0.3*h/$5}"} offy:=arg(1,$u) deltay:=arg(2,$u) fi +is_0x=0 +if $3==$4 y0=$3 else y0:=v=-($my)*$h1/($My-$my);$4>=$3?v:$h1-v fi +sty:=$y0>$h1-$5?-1:1 +if $1!=$2" && "$y0>=0" && "$y0<=$h1 +line 0,$y0,$w1,$y0,$6,$pattern,$color +4,4,1,1,x<=y +mirror. y rows. 1,3 a[-2,-1] y .,.,1,[0] fc. $color +if $2>=$1 j[0] .,{$w1-3},{$y0-3},0,0,$6,.. +else mirror.. x j[0] .,0,{$y0-3},0,0,$6,.. +fi +rm[-2,-1] +i=0 do +val:=_$offx+$i*$deltax i+=1 +if $val>=$mx" && "$val<=$Mx +x:=v=($val-$mx)*$w1/($Mx-$mx);$2>=$1?v:$w1-v +line $x,{$y0-1},$x,{$y0+1},$6,$pattern,$color +if $val +0 t. $val,0,0,$5,1,1 100%,100%,1,[0] fc. $color +j[0] .,{max(0,min($w1-w,$x-w/2))},{$sty>0?$y0+3:$y0-h-3},0,0,$6,.. rm[-2,-1] +else is_0x=1 +fi +fi +while $val<$Mx +fi +is_0y=0 +if $1==$2 x0=$1 else x0:=v=-($mx)*$w1/($Mx-$mx);$2>=$1?v:$w1-v fi +stx:=$x0>$w1-$5?-1:1 +if $3!=$4" && "$x0>=0" && "$x0<=$w1 +line $x0,0,$x0,$h1,$6,$pattern,$color +4,4,1,1,x>=y +mirror. x z. 1,3 a[-2,-1] x .,.,1,[0] fc. $color +if $4>=$3 j[0] .,{$x0-3},{$h1-3},0,0,$6,.. +else mirror.. y j[0] .,{$x0-3},0,0,0,$6,.. +fi +rm[-2,-1] +i=0 do +val:=_$offy+$i*$deltay i+=1 +if $val>=$my" && "$val<=$My +y:=v=($val-$my)*$h1/($My-$my);$4>=$3?v:$h1-v +line {$x0-1},$y,{$x0+1},$y,$6,$pattern,$color +if $val +0 t. $val,0,0,$5,1,1 100%,100%,1,[0] fc. $color +j[0] .,{$stx>0?$x0+6:$x0-w-6},{max(0,min($h1-h,$y-h/2))},0,0,$6,.. rm[-2,-1] +else is_0y=1 +fi +fi +while $val<$My +fi +if $is_0x" || "$is_0y +0 t. 0,0,0,$5,1,1 100%,100%,1,[0] fc. $color +j[0] .,{$stx>0?$x0+6:$x0-w-6},{$sty>0?$y0+3:$y0-h-3},0,0,$6,.. rm[-2,-1] +fi +} +_axes : +n:=max(1,round($3)) +d:=abs($2-$1)/($n-1) +s:=10^round(log10($d)) +m:=round(min($1,$2),$s,-1) +M:=round(max($1,$2),$s,1) +do N:=1+round(($M-$m)/$s,1,1) s:=2*$s while $N>$n +u $m,{$s/2} +#@cli ball : _size>0, _R,_G,_B,0<=_specular_light<=8,0<=_specular_size<=8,_shadow>=0 +#@cli : Input a 2D RGBA colored ball sprite. +#@cli : Default values: 'size=64', 'R=255', 'G=R', 'B=R', 'specular_light=0.8', 'specular_size=1' and 'shading=1.5'. +#@cli : $ repeat 9 { ball {1.5^($>+2)},${-rgb} } append x ++ball : check "${1=64}>0 && ${5=0.8}>=0 && $5<=8 && ${6=1}>=0 && $6<=8 && ${7=1.5}>=0" skip ${2=255},${3=$2},${4=$3} +e[^-1] "Input $1x$1 ball with color (${2-4}), specular light $5, specular size $6 and shadow factor $7." +l[] { +{2*$1},{2*$1} = 1,65%,30% distance 1 * -1 ++n 0,1 ^[1] $7 *[1] 1.4 +*[1] $3 +*[1] $4 *[1] $2 a[^0] c +>=[0] {100-10*$6}% b[0] {3*$6}% n[0] 0,{$5*255} rv + c 0,255 +100%,100% circle[1] 50%,50%,34%,1,1 *[0] [1] *. 255 a c +r $1,$1,1,4,2 +} +chromeball64x64 : +base642img[] "MiB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KNjQgNjQgMSAyICMzMzY0CnicxZl5VJNnvsfT0mM7ntPp9N7paefe6ZzOmWlnemfGmTpzer0dO1W""RnQCBQPZ9TwhhDQkYwyKQAAlbEjZBthgRRBahFamAggp1KS7QIgKyk7DIpoCQd54XtComyPLH/f7xvn/k/Xyf3/N7n+X35EUgLOqN9z/DHcqtaW69cq""EmK8z7s3csP2ZZO/7ILGzpHhwaHBzoHxgA9/vt55M8fvPaxuh37NOu9AyNjBpNY+PjE+OmkYGuOzfb73XURu1589X0zx2PXu8ZMo0Dbnh41DQxMT5mH""O7vam/v7O5sUH35Cgebvyiaf+g3jRuHB/oGjeMPpqamHkyMDvb3g3iG+7tvnjm8a71e/Af+5PXOYdPo4MCwaWr24cO5ubnZ2ekHY6PDgwNDRtNQT9u3""mRirqXztt5Laa10jo0N9fcaZ+UWghflHwGBudnpywjTUNzjcd/faN3kBH1vGX98VWdd6b2B4oKt3fH7JbF5+vDC/ADQPm0xPTRr779/vuNZUdUzyT0t""9eON/5Webb3f8eOdqW9/Eo2XI/Gh6auYxbAMMHsIO48OD/TcvnCvNltjbvIz/I/RMXVPTlaa6xrauwbG55eU5wAObpZmJialpoJnpSZCZ63WV+rRgxz""fW9n0Xr/RsZVX1mdOV9a237o3OLT+amJw3Q9DS3IRxdNQ4NmYcn4YN7l8+U5ybIDq4pgsf4fPrjhcWF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7yzfCA1kllvC32veIA5U+PL5/722jeMWDHY2b""gaHoGNr+JLN4RAU/gIeulkcMiOfwz9/xaixJNOzcfDmzc3jEHTmJ/7QVnAI8n6CfzC7Nb7vyZ9pmVvDIUi4OnK2kLwnAaysiJFbxSEInsw2A1vnLwF+""39ZxCALLcvp2eAkCsY3wIagJ8fvt4NDCTuy2eGifent8YMX2eN2mlq2XdXZwe/w2m4d6/r/5DW1Z6/DbDKClZXt8RfH2eHXE9nim2/b43e9tC596HbG""lveepKhGIbSWACgq2beAL74IF+PrW+TJ4/2BtnbeH+R19W8VbVvfPgK3yzk/Kh+6t4c1P6wfUlvCF3T8VIKVb4ROe1U+/7N88fu3549CXm64hJv+AeF""6CTeILTmsK0NhN4WYmYq02Y2DmvIQjEHLrH37WBk+1gCMQRCtfHdZq0s4ijkD8tXMj+P2PrODg+JXx6u3kzLpH8C+urU93e69HA9ng2q3TfbwNfIFGO""Fda7sUF0kZP8L8S1K05Ay80hP52g/CqdnzOTa1o6QFqqdb57dlp7bl/A5UFagkxIDQ1IDEgMSAjNTIKeJxz941i0M/Iz03VTykpTs4ozS3Qd0ktzi7J""L9BPzigCiscXF2SkFqXqFeSlMwAAcSYQbQ==" +s. c +apply_gamma.. 0.05 b. 3 n. 0,150 n... 0,1 i[-4] 100%,100%,1,3 fc[-4] ${1-3} *[-4,-3] +[-3,-1] +c.. 0,255 a[-2,-1] c +#@cli chessboard : size1>0,_size2>0,_offset1,_offset2,_angle,_opacity,_color1,...,_color2,... +#@cli : Draw chessboard on selected images. +#@cli : Default values: 'size2=size1', 'offset1=offset2=0', 'angle=0', 'opacity=1', 'color1=0' and 'color2=255'. +#@cli : $ image.jpg chessboard 32,32,0,0,25,0.3,255,128,0,0,128,255 +chessboard : check "$1>0 && ${2=$1}>0" skip ${3=0},${4=0},${5=0},${6=1},${7=0},${8=255} +e[^-1] "Draw chessboard on image$?, with sizes ($1,$2), offsets ($3,$4), angle $5 deg., opacity $6 and +colors (${7--1})." +i[0] (${7--1}) r[0] {{0,w}/2},1,1,2,-1 permute[0] cyzx +repeat $!-1 { +w,h={w},{h} theta:=$5*pi/180 +($3,{$3+$w-1};$3,{$3+$w-1}^$4,$4;{$4+$h-1},{$4+$h-1}) r. $w,$h,1,2,3 +r. {$w*$h},2,1,1,-1 +i.. ({cos($theta)},{-sin($theta)};{sin($theta)},{cos($theta)}) m*[-2,-1] +r. $w,$h,1,2,-1 +%. {$1+$2} >=. $1 s. c xor[-2,-1] map. [0] r. 100%,100%,1,.. +j.. .,0,0,0,0,$6 rm. mv. 1 +} rm[0] +#@cli cie1931 +#@cli : Draw CIE-1931 chromaticity diagram on selected images. +#@cli : $ 500,400,1,3 cie1931 +cie1931 : +e[^-1] "Draw CIE-1931 chromaticity diagram on image$?." +(67.5;73.5;109.5;103.5;51.5;100.5;37;36) +(280,420,0;171,829,0;158,820,0;153,816,0;147,811,0;140,804,0;132,794,0;121,776,0;106,747,0;88,701,0;\ +65,633,0;42,539,0;20,421,0;5,295,0;0,179,0;4,115,0;10,83,0;16,61,0;25,38,0;35,21,0;47,10,0;58,3,0;71,0,0;92,1,0;111,7,0;151,28,0;189,52,0;226,79,0;262,109,0;298,141,0;334,175,0;370,209,0;405,244,0;441,279,0;475,313,0;509,347,0;731,568,0) +xM=731 yM=829 +2,{h-1},1,1,3,0 1,{h},1,1,'y' ++. 1 %. {h} +[-2,-1] 1 a[-3--1] x +3,{h},1,1,160 1,{h},1,1,1 +y[-4--2] a[-5--1] y mv. 0 +xR=636 yR=504 xG=297 yG=234 xB=147 yB=774 +512,512,1,3 triangle_shade. 0,0,{w-1},0,0,{h-1},""255,0,0,""0,255,0,""0,0,255 rgb2srgb. ++compose_channels. max +. 1e-8 /[-2,-1] *. 255 +i.. (67.5;73.5;109.5;103.5;51.5;100.5;3;1;$xR;$yR;-0.01;$xG;$yG;-0.01;$xB;$yB;-0.01;9;0;1;2;0;0;511;0;0;511;-128;512;512;3) +y. (1) a[-3--1] y mv. 1 +repeat $!-2 { +to_rgb. fc. 255,255,255 grid. 10%,10%,0,0,0.3,0xCCCCCCCC,1,0 +100%,100%,1,3 ++*3d[0,1] {(w-8)/$xM},{(h-32)/$yM} +j3d... .,2,30,0,1,2 ++!=... 0 distance. 1 *. -1 watershed[-4] . rm. /... 1.5 +j3d... .,2,30,0,1,2 +p3d. 1 p3d. 2 col3d. 128 j3d... .,2,30,0,1,1 rm. +{-2,w},{-2,h} j3d. ..,2,30,0,1,2 rm.. ++erode. 4 -. .. ==. 0 *[-3,-1] +a[-2,-1] c blend[-2,-1] alpha +100%,100%,1,1,255 axes. 0,0.75,0.85,0,14,1 +erode. 3 negate. to_rgb.. +j... ..,0,0,0,0,1,.,400 rm[-2,-1] +mv. 2 +} +rm[0,1] +#@cli circle : x[%],y[%],R[%],_opacity,_pattern,_color1,... +#@cli : Draw specified colored circle on selected images. +#@cli : A radius of '100%' stands for 'sqrt(width^2+height^2)'. +#@cli : 'pattern' is an hexadecimal number starting with '0x' which can be omitted +#@cli : even if a color is specified. If a pattern is specified, the circle is +#@cli : drawn outlined instead of filled. +#@cli : Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'. +#@cli : $ image.jpg repeat 300 circle {u(100)}%,{u(100)}%,{u(30)},0.3,${-rgb} done circle 50%,50%,100,0.7,255 +circle : skip ${4=1},${5=0},${6=0} +if ${"is_pattern \"$5\""} +e[0--3] "Draw outlined circle at ($1,$2) with radius $3 on image$?, with opacity $4, pattern $5 and +color (${6--1})." +else +e[0--3] "Draw filled circle at ($1,$2) with radius $3 on image$?, with opacity $4 and color (${5--1})." +fi +ellipse $1,$2,$3,$3,0,${4--1} +#@cli close_binary : 0<=_endpoint_rate<=100,_endpoint_connectivity>=0,_spline_distmax>=0,_segment_distmax>=0,0<=_spline_anglemax<=180,_spline_roundness>=0,_area_min>=0,_allow_self_intersection={ 0 | 1 } +#@cli : Automatically close open shapes in binary images (defining white strokes on black background). +#@cli : Default values: 'endpoint_rate=75', 'endpoint_connectivity=2', 'spline_distmax=80', 'segment_distmax=20', 'spline_anglemax=90', 'spline_roundness=1','area_min=100', 'allow_self_intersection=1'. +close_binary : +check "${1=75}>=0 && $1<=100 && ${2=2}>=0 && ${3=80}>=0 && ${4=20}>=0 && ${5=90}>=0 && $5<=180 && ${6=1}>=0 && +${7=100}>=0 && isnum(${8=1})" +e[^-1] "Close open shapes in binary image$?, with endpoint rate $1, endpoint connectivity $2, spline max distance $3, +segment max distance $4, spline max angle $5, spline roundness $6, area min $7 and self intersections "${"arg0 !$8,allowed,\"not allowed\""}"." +endpoint_threshold:=100-$1 +endpoint_connectivity:=round($2) +spline_distmax=$3 +segment_distmax=$4 +spline_anglemax=$5 +spline_roundness=$6 +area_min=$7 +allow_self_intersections:=!!$8 +_edgel_lib=" +begin( +pn = [ 0,1,1,1,-1,0,-1,1,0,-1,-1,-1,1,0,1,-1 ]; +pp = [ 0,-1,1,-1,1,0,1,1,0,1,-1,1,-1,0,-1,-1 ]; +); +next(img,p) = ( +p0 = p#[0,2] + pn[4*p#[2],2]; +p1 = p#[0,2] + pn[4*p#[2] + 2,2]; +case = !!i(#img,p0[0],p0[1],0,0) + 2*!!i(#img,p1[0],p1[1],0,0); +!case?[ p[0],p[1],(p[2]+1)%4 ]:case==1?[ p0[0],p0[1],p[2] ]:[ p1[0],p1[1],(p[2]-1)%4 ]; +); +previous(img,p) = ( +p0 = p#[0,2] + pp[4*p#[2],2]; +p1 = p#[0,2] + pp[4*p#[2] + 2,2]; +case = !!i(#img,p0[0],p0[1],0,0) + 2*!!i(#img,p1[0],p1[1],0,0); +!case?[ p[0],p[1],(p[2]-1)%4 ]:case==1?[ p0[0],p0[1],p[2] ]:[ p1[0],p1[1],(p[2]+1)%4 ]; +); +next2(img,p) = ( +p0 = p#[0,2] + pn[4*p#[2],2]; +p1 = p#[0,2] + pn[4*p#[2] + 2,2]; +case = !(i(#img,p0[0],p0[1],0,0)&3) + 2*!(i(#img,p1[0],p1[1],0,0)&3); +case==1?[ p0[0],p0[1],p[2] ]:case==3?[ p1[0],p1[1],(p[2]-1)%4 ]:[ p[0],p[1],(p[2]+1)%4 ]; +); +next3(img,p) = ( +p0 = p#[0,2] + pn[4*p#[2],2]; +p1 = p#[0,2] + pn[4*p#[2] + 2,2]; +val1 = i(#img,p0[0],p0[1],0,0); +val2 = i(#img,p1[0],p1[1],0,0); +case = (val1==1 || val1==2) + 2*(val2==1 || val2==2); +case==1?[ p0[0],p0[1],p[2] ]:case==3?[ p1[0],p1[1],(p[2]-1)%4 ]:[ p[0],p[1],(p[2]+1)%4 ]; +); +vec(p) = ( +ang = i(p[0],p[1],0,p[2])*pi/180; +[ cos(ang), sin(ang) ]; +);" +foreach { +nm={n} +slices 50% channels 0 > 0 +=> strokes +100%,100%,1,4," +ref(crop(#"$strokes",x - 1,y - 1,0,0,3,3,1,1,1),N); +N[4]?[ N[5]?-2:0, N[7]?-2:90, N[3]?-2:180, N[1]?-2:270 ]:[-2,-2,-2,-2]; +" => e_normals +f[e_normals] $_edgel_lib" +const boundary = 1; +i<-1?-2:( +ppos = npos = pos = [ x,y,c ]; +u = vec(pos); +for (t = 1, t<=5, ++t, +ppos = previous(#"$strokes",ppos); +npos = next(#"$strokes",npos); +if (ppos==npos, break()); +w = exp(-t^2/30); +u+=w*vec(ppos); +u+=w*vec(npos); +); +ang = (atan2(u[1],u[0])*180/pi)%360; +)" ++f[e_normals] $_edgel_lib" +const boundary = 1; +i<-1?-2:( +pos = [ x,y,c ]; +ppos = previous(#"$strokes",pos); +npos = next(#"$strokes",pos); +pu = vec(ppos); +nu = vec(npos); +du = (nu - pu)/2; +cr = cross([vec(pos),0],[du,0]); +norm(du)*sign(cr[2]); +)" +=> e_curvatures ++f[e_curvatures] $_edgel_lib" +const boundary = 1; +i<-1?-2:( +ppos = npos = pos = [ x,y,c ]; +val = i; sumw = 1; +for (t = 1, t<=5, ++t, +ppos = previous(#"$strokes",ppos); +npos = next(#"$strokes",npos); +if (ppos==npos, break()); +w = exp(-t^2/30); +val+=w*i(ppos[0],ppos[1],0,ppos[2]); +val+=w*i(npos[0],npos[1],0,npos[2]); +sumw+=2*w; +); +val/sumw; +)" +=> e_smooth_curvatures ++distance[strokes] 0 +f. " +i<1-0.01||i>1+0.01?0:( +p = x; q = y; d = 1; +for (is_better = 1, is_better && d<32, +next_p = p; +next_q = q; +is_better = 0; +pp = p - 1; +np = p + 1; +pq = q - 1; +nq = q + 1; +(nd = i(pp,pq))>d?(d = nd; next_p = pp; next_q = pq; is_better = 1); +(nd = i(p, pq))>d?(d = nd; next_p = p; next_q = pq; is_better = 1); +(nd = i(np,pq))>d?(d = nd; next_p = np; next_q = pq; is_better = 1); +(nd = i(pp,q))>d?(d = nd; next_p = pp; next_q = q; is_better = 1); +(nd = i(np,q))>d?(d = nd; next_p = np; next_q = q; is_better = 1); +(nd = i(pp,nq))>d?(d = nd; next_p = pp; next_q = nq; is_better = 1); +(nd = i(p, nq))>d?(d = nd; next_p = p; next_q = nq; is_better = 1); +(nd = i(np,nq))>d?(d = nd; next_p = np; next_q = nq; is_better = 1); +p = next_p; +q = next_q; +); +d)" +=> stroke_radii +compose_channels[e_smooth_curvatures] max =>[e_smooth_curvatures] smooth_curvatures ++compose_channels[e_curvatures] max => curvatures +f. "i(#"$smooth_curvatures")>=("$endpoint_threshold"%)/(max(1,i(#"$stroke_radii"))) || +i>=max(0.25,"$endpoint_threshold"%)" +label_fg. 0,1 => keypoints +if iM>0 +{iM},1,1,3,-1 => keycoords +f[keypoints] "> +ret = 0; +if (i, +j = i - 1; +old_max = I[#"$keycoords",j]; +kappa = i(#"$smooth_curvatures"); +if (kappa>old_max[2], +I[#"$keycoords",j] = [ x,y,kappa ]; +i(#"$keypoints",old_max[0],old_max[1]) = 0; +ret = 1; +); +); ret" +channels[keycoords] 0,3 +fi +rm[smooth_curvatures,stroke_radii,keypoints] +if !narg($keycoords) +rm[e_normals,e_curvatures] [strokes] => new_strokes +else +f[keycoords] " +P = (I)[0,2]; +angles = I(#"$e_normals",P); +U = [ 0,0 ]; +repeat (size(angles),k, +if (angles[k]>=0, +w = max(1e-8,i(#"$e_curvatures",P[0],P[1],0,k))^2; +ang = angles[k]*pi/180; +U += w*[ cos(ang),sin(ang) ]; +); +); +[ P,0,(atan2(U[1],U[0])*180/pi)%360 ]" +rm[e_normals,e_curvatures] +256,1,1,3 => keypairs +f[keycoords] "> +begin(ind = 0); +for (nx = x + 1, nx0, +if (ind>=w(#"$keypairs"), resize(#"$keypairs",2*ind,1,1,3,0)); +I[#"$keypairs",ind++] = [ quality,x,nx ]; +); +); +end(resize(#"$keypairs",ind,1,1,3,0)); +I" +if {keypairs,w} sort[keypairs] -,x +else rm[keypairs] +fi +[strokes] => new_strokes +ind_strokes:=$allow_self_intersections?$strokes:$new_strokes +if narg($keypairs) +f[keypairs] ">"$_edgel_lib" +for_spline(code) = for (t = 0, t<=1, t+=dt, +t3 = t*(t2 = t*t); +P = round(mul([t3,t2,t,1],C,2)); +code#; +dP = abs(mul([3*t2,2*t,1,0],C,2)) + 1e-8; +dt = min(dtmin,0.75/max(dP)); +); +Ic = I; +indS = Ic[1]; +indT = Ic[2]; +if (i(#"$keycoords",indS,0,0,2)<"$endpoint_connectivity" && +i(#"$keycoords",indT,0,0,2)<"$endpoint_connectivity", +S = I(#"$keycoords",indS)[0,2]; +T = I(#"$keycoords",indT)[0,2]; +angS = i(#"$keycoords",indS,0,0,3)*pi/180; +angT = i(#"$keycoords",indT,0,0,3)*pi/180; +ST = T - S; +dist = "$spline_roundness"*norm(ST); +NS = [ cos(angS),sin(angS) ]; +NT = [ cos(angT),sin(angT) ]; +tmax = max(abs(ST)); +is_cond = 1; +C = mul([ 2,-2,1,1,-3,3,-2,-1,0,0,1,0,1,0,0,0 ],[ S,T,dist*NS,-dist*NT ],2); +dt = dtmin = 1/max(abs(T - S)); +current_val = 1; +nb_switches = 0; +for_spline( +if (i(#"$ind_strokes",P,0,0)!=current_val, ++nb_switches; current_val=!current_val); +if (nb_switches>2, is_cond = 0; break()) +); +if (is_cond, +const area_max_threshold = "$area_min"; +const area_min_threshold = 5; +const max_edgels = 2*(area_max_threshold + 1); +if (area_max_threshold<=0, +for_spline(i(#"$new_strokes",P)=1); +, +for_spline(i(#"$new_strokes",P)|=2); +for_spline( +if (!i(#"$new_strokes",P[0] + 1,P[1]), +edgels = area = 0; Q0 = Q = [ P[0] + 1,P[1],2 ]; +do ( +i(#"$new_strokes",Q[0],Q[1]) = 4; +area+=(Q[2]&1?0:1-Q[2])*(Q[0]+!Q[2]); +Q = next2(#"$new_strokes",Q), +Q!=Q0 && ++edgels<=max_edgels); +if (edgels<=max_edgels && area>=area_min_threshold && area=area_min_threshold && area=area_min_threshold && area=area_min_threshold && area"$_edgel_lib" +for_segment(code) = for (t = 0, t<=tmax, ++t, +P = round(S + t*ST); +code#; +); +if (i(#"$keycoords",x,0,0,2)<"$endpoint_connectivity", +S = I(#"$keycoords",x)[0,2]; +angS = i(#"$keycoords",x,0,0,3)*pi/180; +NS = [ cos(angS),sin(angS) ]; +ST = round(NS*"$segment_distmax"); +tmax = max(abs(ST)); +ST/=tmax; +is_cond = 0; +current_val = 0; +nb_switches = 0; +for_segment( +if (i(#"$new_strokes",P,0,0)!=current_val, ++nb_switches; current_val=1 - current_val); +if (nb_switches==2,is_cond = 1; break();); +); +tmax = t; +if (is_cond, +const area_max_threshold = "$area_min"; +const area_min_threshold = 5; +const max_edgels = 2*(area_max_threshold + 1); +if (area_max_threshold<=0, +for_segment(i(#"$new_strokes",P)=0); +, +for_segment(i(#"$new_strokes",P)|=4); +for_segment( +if (i(#"$new_strokes",P[0] + 1,P[1])==1, +edgels = area = 0; Q0 = Q = [ P[0] + 1,P[1],2 ]; +do ( +i(#"$new_strokes",Q[0],Q[1]) = 2; +area+=(Q[2]&1?0:1-Q[2])*(Q[0]+!Q[2]); +Q = next3(#"$new_strokes",Q), +Q!=Q0 && ++edgels<=max_edgels); +if (edgels<=max_edgels && area>=area_min_threshold && area=area_min_threshold && area=area_min_threshold && area=area_min_threshold && area[new_strokes] $nm +} +#@cli ellipse : x[%],y[%],R[%],r[%],_angle,_opacity,_pattern,_color1,... : (+) +#@cli : Draw specified colored ellipse on selected images. +#@cli : A radius of '100%' stands for 'sqrt(width^2+height^2)'. +#@cli : 'pattern' is an hexadecimal number starting with '0x' which can be omitted +#@cli : even if a color is specified. If a pattern is specified, the ellipse is +#@cli : drawn outlined instead of filled. +#@cli : Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'. +#@cli : $ image.jpg repeat 300 ellipse {u(100)}%,{u(100)}%,{u(30)},{u(30)},{u(180)},0.3,${-rgb} done ellipse 50%,50%,100,100,0,0.7,255 +#@cli flood : x[%],_y[%],_z[%],_tolerance>=0,_is_high_connectivity={ 0 | 1 },_opacity,_color1,... : (+) +#@cli : Flood-fill selected images using specified value and tolerance. +#@cli : Default values: 'y=z=0', 'tolerance=0', 'is_high_connectivity=0', 'opacity=1' and 'color1=0'. +#@cli : $ image.jpg repeat 1000 flood {u(100)}%,{u(100)}%,0,20,0,1,${-rgb} done +#@cli gaussian : _sigma1[%],_sigma2[%],_angle +#@cli : Draw a centered gaussian on selected images, with specified standard deviations and orientation. +#@cli : Default values: 'sigma1=3', 'sigma2=sigma1' and 'angle=0'. +#@cli : $ 400,400 gaussian 100,30,45 +#@cli : $$ https://gmic.eu/oldtutorial/_gaussian +gaussian : skip ${1=15%},${2=$1},${3=0} +e[^-1] "Draw centered gaussian on image$? with standard deviations ($1,$2) and angle $3 deg." +u:=cos($3*pi/180) +v:=sin($3*pi/180) +dmax:=max(w,h) +if isnum($1) l1=$1 else l1:=${1}10000*$dmax/100 fi +if isnum($2) l2=$2 else l2:=${2}10000*$dmax/100 fi +l1:=1/(2*max(1/3,$l1)^2) +l2:=1/(2*max(1/3,$l2)^2) +A:=$l1*$u*$u+$l2*$v*$v +B:=($l1-$l2)*$u*$v +C:=$l1*$v*$v+$l2*$u*$u +foreach { +nm={n} w,h={w},{h} ds={d},{s} rm +$w,$h,1,1,'X=x-{($w-1)/2};Y=y-{($h-1)/2};$A*X*X+2*$B*X*Y+$C*Y*Y' +* -1 exp r $w,$h,$ds => $nm +} +#@cli graph : [function_image],_plot_type,_vertex_type,_ymin,_ymax,_opacity,_pattern,_color1,... : 'formula',_resolution>=0,_plot_type,_vertex_type,_xmin,xmax,_ymin,_ymax,_opacity,_pattern,_color1,... : (+) +#@cli : Draw specified function graph on selected images. +#@cli : 'plot_type' can be { 0:none | 1:lines | 2:splines | 3:bar }. +#@cli : 'vertex_type' can be { 0:none | 1:points | 2,3:crosses | 4,5:circles | 6,7:squares }. +#@cli : 'pattern' is an hexadecimal number starting with '0x' which can be omitted +#@cli : even if a color is specified. +#@cli : Default values: 'plot_type=1', 'vertex_type=1', 'ymin=ymax=0 (auto)', 'opacity=1', 'pattern=(undefined)' +#@cli : and 'color1=0'. +#@cli : $ image.jpg +rows 50% blur[-1] 3 split[-1] c div[0] 1.5 graph[0] [1],2,0,0,0,1,255,0,0 graph[0] [2],2,0,0,0,1,0,255,0 graph[0] [3],2,0,0,0,1,0,0,255 keep[0] +#@cli grid : size_x[%]>=0,size_y[%]>=0,_offset_x[%],_offset_y[%],_opacity,_pattern,_color1,... +#@cli : Draw xy-grid on selected images. +#@cli : 'pattern' is an hexadecimal number starting with '0x' which can be omitted +#@cli : even if a color is specified. +#@cli : Default values: 'offset_x=offset_y=0', 'opacity=1', 'pattern=(undefined)' and 'color1=0'. +#@cli : $ image.jpg grid 10%,10%,0,0,0.5,255 +#@cli : $ 400,400,1,3,255 grid 10%,10%,0,0,0.3,0xCCCCCCCC,128,32,16 +grid : check "$1>=0 && $2>=0" skip ${3=0},${4=0},${5=1},${6=0},${7=$6} +if ${"is_pattern \"$6\""} +e[0--3] "Draw xy-grid on image$?, with sizes ($1,$2), offsets ($3,$4), opacity $5, pattern $6 and color (${7--1})." +pattern=$6 color=${7--1} +else +e[0--3] "Draw xy-grid on image$?, with sizes ($1,$2), offsets ($3,$4), opacity $5, and color (${6--1})." +pattern=0xFFFFFFFF color=${6--1} +fi +eval " +repeat (l,k, +size = ispercentage($1)?max(1,w#k*$1):$1; +size>=1?( +off = (ispercentage($3)?size*$3:$3)%size; +for (x = off, x=1?( +off = (ispercentage($4)?size*$4:$4)%size; +for (y = off, y] ..,$2,$3,$4,$5,$6,.,255 } rm[-3--1] +else s. c,{1-s} repeat $!-2 { j[$>] ..,$2,$3,$4,$5,$6,.,255 } rm[-2,-1] +fi +#@cli line : x0[%],y0[%],x1[%],y1[%],_opacity,_pattern,_color1,... : (+) +#@cli : Draw specified colored line on selected images. +#@cli : 'pattern' is an hexadecimal number starting with '0x' which can be omitted +#@cli : even if a color is specified. +#@cli : Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'. +#@cli : $ image.jpg repeat 500 line 50%,50%,{u(w)},{u(h)},0.5,${-rgb} done line 0,0,100%,100%,1,0xCCCCCCCC,255 line 100%,0,0,100%,1,0xCCCCCCCC,255 +#@cli line_aa : x0[%],y0[%],x1[%],y1[%],_opacity,_color1,... +#@cli : Draw specified antialiased colored line on selected images. +#@cli : Default values: 'opacity=1' and 'color1=0'. +#@cli : $ 512,512,1,3 repeat 100 line_aa {round(u([w,h,w,h])-1)},1,${-RGB} done +line_aa : check "isnum(${5=1}) && isnum(${6=0})" +e[^-1] "Draw antialiased line ($1,$2) - ($3,$4) on image$?, with opacity $5 and color (${6--1})." +if !$5 return fi +foreach { +x0:=ispercentage($1)?(w-1)*$1:$1 +y0:=ispercentage($2)?(h-1)*$2:$2 +x1:=ispercentage($3)?(w-1)*$3:$3 +y1:=ispercentage($4)?(h-1)*$4:$4 +if $#>6 eval ${-math_lib}"line_aa($x0,$y0,$x1,$y1,$5,[${6--1}])" +else eval ${-math_lib}"line_aa($x0,$y0,$x1,$y1,$5,$6)" +fi +} +#@cli spline : x0[%],y0[%],u0[%],v0[%],x1[%],y1[%],u1[%],v1[%],_opacity,_color1,... +#@cli : Draw specified colored spline curve on selected images (cubic hermite spline). +#@cli : Default values: 'opacity=1' and 'color1=0'. +#@cli : $ image.jpg repeat 30 { spline {u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},{u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},1,${-RGB} } +spline : skip ${9=1},${10=0} +e[^-1] "Draw spline from ($1,$2) [$3,$4] to ($5,$6) [$7,$8] on image$?, with opacity $9 and color (${10--1})." +foreach { +x0:=ispercentage($1)?$1*(w-1):$1 +y0:=ispercentage($2)?$2*(h-1):$2 +u0:=ispercentage($3)?$3*(w-1):$3 +v0:=ispercentage($4)?$4*(h-1):$4 +x1:=ispercentage($5)?$5*(w-1):$5 +y1:=ispercentage($6)?$6*(h-1):$6 +u1:=ispercentage($7)?$7*(w-1):$7 +v1:=ispercentage($8)?$8*(h-1):$8 +eval ${-math_lib}"spline(#0,["$x0","$y0"],["$u0","$v0"],["$x1","$y1"],["$u1","$v1"],$9,[${10--1}])" +} +#@cli thickline : x0[%],y0[%],x1[%],y1[%],_thickness,_opacity,_color1 +#@cli : Draw specified colored thick line on selected images. +#@cli : Default values: 'thickness=2', 'opacity=1' and 'color1=0'. +#@cli : $ 400,400,1,3 repeat 100 thickline {u([w,h,w,h,5])},0.5,${-rgb} done +thickline : check "${5=2}>=0 && isnum(${6=1}) && isnum(${7=0})" +e[^-1] "Draw thick line ($1,$2) - ($3,$4) on image$?, with thickness $5, opacity $6 and color (${7--1})." +if !$5 line ${1-4},${6--1} +else foreach { +x0:=ispercentage($1)?(w-1)*$1:$1 +y0:=ispercentage($2)?(h-1)*$2:$2 +x1:=ispercentage($3)?(w-1)*$3:$3 +y1:=ispercentage($4)?(h-1)*$4:$4 +coords:=" +const th = "$5"; +P0 = [ "$x0","$y0" ]; +P1 = [ "$x1","$y1" ]; +dP = P1 - P0; +n = [ -dP[1],dP[0] ]/max(1e-8,norm(dP))*th/2; +round([ P0 - n, P0 + n, P1 + n, P1 - n ]); +" +polygon 4,$coords,${6--1} +} fi +#@cli thickspline : x0[%],y0[%],u0[%],v0[%],x1[%],y1[%],u1[%],v1[%],_thickness,_opacity,_color1,... +#@cli : Draw specified colored thick spline curve on selected images (cubic hermite spline). +#@cli : Default values: 'thickness=3', 'opacity=1' and 'color1=0'. +#@cli : $ image.jpg repeat 30 { thickspline {u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},{u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},3,1,${-RGB} } +thickspline : skip ${9=3},${10=1},${11=0} +e[^-1] "Draw spline from ($1,$2) [$3,$4] to ($5,$6) [$7,$8] on image$?, ""with thickness $9, opacity $10 and color (${11--1})." +foreach { +x0:=ispercentage($1)?$1*(w-1):$1 +y0:=ispercentage($2)?$2*(h-1):$2 +u0:=ispercentage($3)?$3*(w-1):$3 +v0:=ispercentage($4)?$4*(h-1):$4 +x1:=ispercentage($5)?$5*(w-1):$5 +y1:=ispercentage($6)?$6*(h-1):$6 +u1:=ispercentage($7)?$7*(w-1):$7 +v1:=ispercentage($8)?$8*(h-1):$8 +eval ${-math_lib}"thickspline(#0,["$x0","$y0"],["$u0","$v0"],["$x1","$y1"],["$u1","$v1"],$9,$10,[${11--1}])" +} +#@cli mandelbrot : z0r,z0i,z1r,z1i,_iteration_max>=0,_is_julia={ 0 | 1 },_c0r,_c0i,_opacity : (+) +#@cli : Draw mandelbrot/julia fractal on selected images. +#@cli : Default values: 'iteration_max=100', 'is_julia=0', 'c0r=c0i=0' and 'opacity=1'. +#@cli : $ 400,400 mandelbrot -2.5,-2,2,2,1024 map 0 +blur 2 elevation3d[-1] -0.2 +#@cli marble : _image_weight,_pattern_weight,_angle,_amplitude,_sharpness>=0,_anisotropy>=0,_alpha,_sigma,_cut_low>=0,_cut_high>=0 +#@cli : Render marble like pattern on selected images. +#@cli : Default values: 'image_weight=0.2', 'pattern_weight=0.1', 'angle=45', 'amplitude=0', 'sharpness=0.4' and 'anisotropy=0.8', +#@cli : 'alpha=0.6', 'sigma=1.1' and 'cut_low=cut_high=0'. +#@cli : $ image.jpg +marble , +marble : skip ${1=0.2},${2=0.1},${3=45},${4=0},${5=0.4},${6=0.8},${7=0.6},${8=1.1},${9=0%},${10=100%} +e[^-1] "Render marble like pattern on image$?, with image weight $1, pattern weight $2, angle $3 deg., +amplitude $4, sharpness $5, anisotropy $6, alpha $7, sigma $8, and cut ($9,$10)." +sx:=$2*sin($3*pi/180) sy:=$2*cos($3*pi/180) f sin(x*$sx+y*$sy+i*$1) +if $4 smooth $4,$5,$6,$7,$8 fi +c $9,$10 n 0,255 +#@cli maze : _width>0,_height>0,_cell_size>0 +#@cli : Input maze with specified size. +#@cli : $ maze 30,20 negate normalize 0,255 ++maze : check "isint(${1=15}) && $1>0 && isint(${2=$1}) && $2>0 && isint(${3=24}) && $3>0" +e[^-1] "Input $1x$2 maze." +({round(u($1-1))},{round(u($2-1))}) +$1,$2,1,1,15 +f. 0 a[-2,-1] c +_generate_maze $1,$2 +_render_maze. $3 => [maze] +_generate_maze : +do +x={-2,@-2} y={-2,@-1} +=. 1,$x,$y,0,1 +is_candidate=0 +up=-1 if i($x,$y)&8" && "$y>0" && "!i($x,$y-1,0,1) up=$x,{$y-1},8 is_candidate=1 fi +down=-1 if i($x,$y)&4" && "$y<$2-1" && "!i($x,$y+1,0,1) down=$x,{$y+1},4 is_candidate=1 fi +left=-1 if i($x,$y)&2" && "$x>0" && "!i($x-1,$y,0,1) left={$x-1},$y,2 is_candidate=1 fi +right=-1 if i($x,$y)&1" && "$x<$1-1" && "!i($x+1,$y,0,1) right={$x+1},$y,1 is_candidate=1 fi +if $is_candidate +($up,$down,$left,$right) y. discard. -1 r. 3,{h/3},1,1,-1 shift. 0,{round(u(4))},0,0,2 rows. 0,0 mv. -2 +fi +if $is_candidate +if {-2,@-1}==8 =. {i($x,$y)&7},$x,$y =. {i($x,$y-1)&11},$x,{$y-1} +elif {-2,@-1}==4 =. {i($x,$y)&11},$x,$y =. {i($x,$y+1)&7},$x,{$y+1} +elif {-2,@-1}==2 =. {i($x,$y)&13},$x,$y =. {i($x-1,$y)&14},{$x-1},$y +else =. {i($x,$y)&14},$x,$y =. {i($x+1,$y)&13},{$x+1},$y +fi +z.. 0,1 a[-3,-2] y +else +if h#-2==1 break fi +rows.. 0,{{-2,h}-2} +fi +while 1 +rm.. channels. 0 +_render_maze : +i[0] $1,$1 i[1] [0]x15 +line[8-15] 0,0,100%,0,1,1 +line[4-7,12-15] 0,100%,100%,100%,1,1 +line[2-3,6-7,10-11,14-15] 0,0,0,100%,1,1 +line[1-15:2] 100%,0,100%,100%,1,1 +a[0-15] x r. {w*$1},{h*$1} *. $1 channels. 0,1 +$1,$1,1,1,x $1,$1,1,1,y a[-2,-1] c r. ..,..,1,2,0,2 +[-2,-1] +warp.. .,0,0,0 rm. +#@cli maze_mask : _cellsize>0 +#@cli : Input maze according to size and shape of selected mask images. +#@cli : Mask may contain disconnected shapes. +#@cli : $ 0 text "G'MIC",0,0,53,1,1 dilate 3 autocrop 0 frame 1,1,0 maze_mask 8 dilate 3 negate mul 255 +maze_mask : check "isint(${1=24}) && $1>0" +e[^-1] "Input masked maze from image$? with cell size $1." +compose_channels + >= 50% +foreach { +do ++rand[0] 0,1 *. [0] ({[xM,yM]}) rm.. ++flood[0] {^},0,0,0,1,2 >=. 2 +negate. *.. 15 a[-2,-1] c +flood[0] {-2,^},0,0,0,1,0 +_generate_maze {w},{h} +while iM#0 +rm[0] + _render_maze. $1 => [maze] +} +#@cli newton_fractal : z0r,z0i,z1r,z1i,_angle,0<=_descent_method<=2,_iteration_max>=0,_convergence_precision>0,_expr_p(z),_expr_dp(z),_expr_d2p(z) +#@cli : Draw newton fractal on selected images, for complex numbers in range (z0r,z0i) - (z1r,z1i). +#@cli : Resulting images have 3 channels whose meaning is [ last_zr, last_zi, nb_iter_used_for_convergence ]. +#@cli : 'descent_method' can be { 0:secant | 1:newton | 2:householder }. +#@cli : Default values: 'angle=0', 'descent_method=1', 'iteration_max=200', 'convergence_precision=0.01', 'expr_p(z)=z^^3-1', 'expr_dp(z)=3*z^^2' and 'expr_d2z(z)=6*z'. +#@cli : $ 400,400 newton_fractal -1.5,-1.5,1.5,1.5,0,2,200,0.01,"z^^6 + z^^3 - 1","6*z^^5 + 3*z^^2","30*z^^4 + 6*z" f "[ atan2(i1,i0)*90+20,1,cut(i2/30,0.2,0.7) ]" hsl2rgb +newton_fractal : check "isin(${6=1},0,1,2) && ${7=200}>=0 && ${8=0.01}>0" +skip "${4=0},${9=z^^3-1},${10=3*z^^2},${11=6*z}" +m0,m1,m2=secant,newton,householder +e[^-1] "Draw newton fractal on image$?, for complex range ($1,$2)-($3,$4), with angle $5, $7 max "${m$6}" ""iterations, precision $8, and expressions 'p(z)=$9', 'dp(z)=$10' and 'd2p(z)=$11'." +channels 0,2 +f "* +begin( +const dx = abs($3 - $1); +const dy = abs($4 - $2); +const angle = $5; +const method = $6; +const itermax = $7; +const precision = $8; +zc = [ $1 + $3, $2 + $4 ]/2; +R = rot(-angle°); +); +p(z) = ($9); +dp(z) = ($10); +d2p(z) = ($11); +zn = [ $1 + x*dx/(w-1), $2 + y*dy/(h-1) ]; +angle?(zn = (R*(zn-=zc)+=zc)); +!method?(znm1 = zn + [ precision,0 ]); +repeat (itermax,iter, +pzn = p(zn); +!method?( +znp1 = zn - pzn**(zn - znm1)//(pzn - p(znm1)); +znm1 = zn; +):method==1?( +dpzn = dp(zn); +znp1 = zn - pzn//dpzn; +):( +dpzn = dp(zn); +d2pzn = d2p(zn); +hn = (pzn**d2pzn)//(2*dpzn^^2); +znp1 = zn - pzn//dpzn**([1,0] + hn); +); +norm(znp1 - zn)=0,0<=_min_scale<=100,_allow_rotation={ 0:0 deg. | 1:180 deg. | 2:90 deg. | 3:any },_spacing,_precision>=0,max_iterations>=0 +#@cli : Try to randomly pack as many sprites as possible onto the 'empty' areas of an image. +#@cli : Sprites can be eventually rotated and scaled during the packing process. +#@cli : First selected image is the canvas that will be filled with the sprites. +#@cli : Its last channel must be a binary mask whose zero values represent potential locations for drawing the sprites. +#@cli : All other selected images represent the sprites considered for packing. +#@cli : Their last channel must be a binary mask that represents the sprite shape (i.e. a 8-connected component). +#@cli : The order of sprite packing follows the order of specified sprites in the image list. +#@cli : Sprite packing is done on random locations and iteratively with decreasing scales. +#@cli : 'nb_scales' sets the number of decreasing scales considered for all specified sprites to be packed. +#@cli : 'min_scale' (in %) sets the minimal size considered for packing (specified as a percentage of the +#@cli : original sprite size). +#@cli : 'spacing' can be positive or negative. +#@cli : 'precision' tells about the desired number of failed trials before ending the filling process. +#@cli : Default values: 'nb_scales=5', 'min_scale=25', 'allow_rotation=3', 'spacing=1', 'precision=7' and 'max_iterations=256'. +#@cli : $ 512,512,1,3,"min(255,y*c/2)" 100%,100% circle 50%,50%,100,1,255 append c image.jpg resize2dy[-1] 24 to_rgba pack_sprites 3,25 +pack_sprites : check "isint(${1=5}) && $1>=0 && ${2=25}>=0 && $2<=100 && isint(${3=3}) && $3>=0 && $3<=3 && +isint(${4=1}) && isint(${5=7}) && $5>=0 && isint(${6=256}) && $6>=0" +e[^-1] "Randomly pack image$? with $1 scales, minimum scale $2%, "${arg0\ $3,no,180\"\ \"deg.,90\"\ \"deg.,any}" rotation, spacing $4, precision $5 and $6 maximum iterations." +N:=$!-1 is_first_time=1 +foreach { r 100%,100%,1,{max(2,s)} } +repeat $1 { +rprogress {$>*100/$1} +nb_attempts=0 +ratio={$1>1?$2+(100-$2)*$}] { +w,h:=[w,h]*$ratio +if $w<1||$h<1 rm +else r $w,$h,1,100%,2 sh. 100% !=. 0 area{1+$>}:=is rm. +fi +} } +l[0,{$N+1}--1] { repeat $6 { +ind:=1+($>%$N) area=${area$ind} +if !$3 [$ind] +elif $3==1 +rotate[$ind] {round(u)*180} +elif $3==2 +rotate[$ind] {round(u(3))*90} +else +rotate[$ind] {u*360} sh. 100% !=. 0 area:=is rm. +fi ++channels[0] 100% ==. 0 +if $4>1 erode. {2*$4-1} +elif $4<1 dilate. {-2*$4+3} +fi ++rectangle. 0,0,100%,100%,1,0xFFFFFFFF,0 +if $is_first_time noise. 0.1,2 ==. 1 fi +distance. 0 noise. 1,1 +max_patch. {$ind,round(1.5*max(w,h))} +*. .. pointcloud3d. +if $N>1 l. { +s3d /[1] $N round[1] max[1] 1 n={1,@0} +r[2] 3,{{2,h}/3},1,1,-1 +i[2] 1,{2,h} rand[2] 0,1 a[2,3] x sort[2] +,y z[2] 1,3 r[2] 3,$n,1,1 y[2] +r[3] 1,{2*$n},1,1,0 r[4] 1,{3*$n},1,1,0 r[5] 1,$n,1,1,0 a y +} fi +n={@7} +if $n +s3d. rm[-2,-1] +if !$3 +[-6] i.. (-128;{w};{h};{s}) +if $n>1 4,{$n-1},1,1,-128,0,0,0 fi ++channels.. 100% i.. (-128;{w};{h};{s}) +if $n>1 ... fi +elif $3==1 ++rotate[-6] {round(u(1))*180} i.. (-128;{w};{h};{s}) +if $n>1 +rotate. 180 i.. (-128;{w};{h};{s}) fi +if $n>2 4,{$n-2},1,1,-128,0,0,0 1,100% rand. 0,1 round. 1 j.. .,1 rm. fi ++channels[-4] 100% i.. (-128;{w};{h};{s}) +if $n>1 +channels[-4] 100% i.. (-128;{w};{h};{s}) fi +if $n>2 [-5] fi +else ++rotate[-6] {round(u(3))*90} i.. (-128;{w};{h};{s}) +if $n>1 +rotate. 90 i.. (-128;{w};{h};{s}) fi +if $n>2 +rotate. 90 i.. (-128;{w};{h};{s}) fi +if $n>3 +rotate. 90 i.. (-128;{w};{h};{s}) fi +if $n>4 4,{$n-4},1,1,-128,0,0,0 1,100% rand. 0,3 round. 1 j.. .,1 rm. fi ++channels[-8] 100% i.. (-128;{w};{h};{s}) +if $n>1 +channels[-8] 100% i.. (-128;{w};{h};{s}) fi +if $n>2 +channels[-8] 100% i.. (-128;{w};{h};{s}) fi +if $n>3 +channels[-8] 100% i.. (-128;{w};{h};{s}) fi +if $n>4 [-9] fi +fi +y[{$N+3}--1] a[{$N+3}--1] y +fi +rm... +[0] sh. 100% f. 1 -. [-4] +j3d.. ...,0,0,0,1,2,0,0 rm[-3,-1] +sh. 100% area_fg. 0,1 ==. $area +*. ... rm... sh.. 0,{-2,s-2} *. .. rm. +if iM j[0] ..,0,0,0,0,1,. rm[-2,-1] +else +rm[-2,-1] +nb_attempts+=1 +if $nb_attempts>$5 break else continue fi +fi +} k[0] } +} k[0] +#@cli piechart : label_height>=0,label_R,label_G,label_B,"label1",value1,R1,G1,B1,...,"labelN",valueN,RN,GN,BN +#@cli : Draw pie chart on selected (RGB) images. +#@cli : $ image.jpg piechart 25,0,0,0,"Red",55,255,0,0,"Green",40,0,255,0,"Blue",30,128,128,255,"Other",5,128,128,128 +piechart : check $1>=0 +e[^-1] "Draw pie chart on image$?, with label height $1 and color ($2,$3,$4)." +$=arg +foreach { +ellipse 50%,50%,{w/2-1},{h/2-1},0,1,1 +ellipse 50%,50%,{w/2-1},{h/2-1},0,1,0xFFFFFFFF +(${6--1:5}) normalize_sum. +theta=0 +if w>1 repeat w { +xe:=0.5*{-2,w}*(1+cos($theta)) +ye:=0.5*{-2,h}*(1+sin($theta)) +line.. 50%,50%,$xe,$ye +theta-=2*pi*i($>) +} fi +theta=0 +repeat w { if i($>) +ntheta:=$theta-2*pi*i($>) +xc:=0.5*{-2,w}*(1+0.5*cos(0.5*($ntheta+$theta))) +yc:=0.5*{-2,h}*(1+0.5*sin(0.5*($ntheta+$theta))) +xf:=0.5*{-2,w}*(1+0.8*cos(0.5*($ntheta+$theta))) +yf:=0.5*{-2,h}*(1+0.8*sin(0.5*($ntheta+$theta))) +flood.. $xf,$yf,0,0,0,1,${arg{7+5*$>}},${arg{8+5*$>}},${arg{9+5*$>}} +if abs($ntheta-$theta)>0.1 +0 t. ${arg{5+5*$>}},0,0,$1,1,1 +($2^$3^$4) r. ..,..,1,3 *. .. +j[-4] .,{$xc-w/2},{$yc-h/2},0,0,1,.. +rm[-2,-1] +fi +theta=$ntheta +fi } +rm. +} +#@cli plasma : _alpha,_beta,_scale>=0 : (+) +#@cli : Draw a random colored plasma fractal on selected images. +#@cli : This command implements the so-called 'Diamond-Square' algorithm. +#@cli : Default values: 'alpha=1', 'beta=1' and 'scale=8'. +#@cli : $ 400,400,1,3 plasma +#@cli : $$ https://gmic.eu/oldtutorial/_plasma +#@cli point : x[%],_y[%],_z[%],_opacity,_color1,... : (+) +#@cli : Set specified colored pixel on selected images. +#@cli : Default values: 'z=0', 'opacity=1' and 'color1=0'. +#@cli : $ image.jpg repeat 10000 point {u(100)}%,{u(100)}%,0,1,${-rgb} done +#@cli polka_dots : diameter>=0,_density,_offset1,_offset2,_angle,_aliasing,_shading,_opacity,_color,... +#@cli : Draw dots pattern on selected images. +#@cli : Default values: 'density=20', 'offset1=offset2=50', 'angle=0', 'aliasing=10', 'shading=1', 'opacity=1' and 'color=255'. +#@cli : $ image.jpg polka_dots 10,15,0,0,20,10,1,0.5,0,128,255 +polka_dots : check $1>=0 skip ${2=20},${3=50},${4=50},${5=0},${6=10},${7=1},${8=1},${9=255} +e[^-1] "Draw polka dots on image$?, with diameter $1, density $2, angle $3 deg., shift ($4,$5), aliasing $6 and +shading $7." +theta:=$5*pi/180 ct:=cos($theta) st:=sin($theta) mid1:=$1/2 mid2:=$2/2 +i[0] (${9--1}) y[0] c +repeat $!-1 { +WH:=max(w,h) +100%,100%,100%,1,"xn = 100*x/"$WH"-$3; yn = 100*y/"$WH"-$4; xr = xn*"$ct"-yn*"$st"; yr = xn*"$st"+yn*"$ct"; xc = xr%$2-"$mid2"; yc = yr%$2-"$mid2"; "$mid1"-sqrt(xc*xc+yc*yc)" +*. $6 c. 0,$7 n. 0,$8 (${9--1}) y. c r. ..,..,.. +j... .,0,0,0,0,1,.. rm[-2,-1] mv. 1 +} +rm[0] +#@cli polygon : N>=1,x1[%],y1[%],...,xN[%],yN[%],_opacity,_pattern,_color1,... : (+) +#@cli : Draw specified colored N-vertices polygon on selected images. +#@cli : 'pattern' is an hexadecimal number starting with '0x' which can be omitted +#@cli : even if a color is specified. If a pattern is specified, the polygon is +#@cli : drawn outlined instead of filled. +#@cli : Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'. +#@cli : $ image.jpg polygon 4,20%,20%,80%,30%,80%,70%,20%,80%,0.3,0,255,0 polygon 4,20%,20%,80%,30%,80%,70%,20%,80%,1,0xCCCCCCCC,255 +#@cli : $ image.jpg 2,16,1,1,'u(x?{h}:{w})' polygon[-2] {h},{^},0.6,255,0,255 remove[-1] +#@cli quiver : [function_image],_sampling[%]>0,_factor>=0,_is_arrow={ 0 | 1 },_opacity,_color1,... +#@cli : Draw specified 2D vector/orientation field on selected images. +#@cli : Default values: 'sampling=5%', 'factor=1', 'is_arrow=1', 'opacity=1', 'pattern=(undefined)' +#@cli : and 'color1=0'. +#@cli : $ 100,100,1,2,'!c?x-w/2:y-h/2' 500,500,1,3,255 quiver[-1] [-2],10 +#@cli : $ image.jpg +resize2dy 600 luminance[0] gradient[0] mul[1] -1 reverse[0,1] append[0,1] c blur[0] 8 orientation[0] quiver[1] [0],20,1,1,0.8,255 +quiver : check ${"is_image_arg $1"}" && ${2=5%}>0 && ${3=1}>=0 && isbool(${4=1})" skip "${5=1},${6=0}" +e[^-1] "Draw 2D vector field $1 on image$?, with sampling $2, factor $3, arrows "${"arg0 $4,disabled,enabled"}", +opacity $5 and color (${6--1})." +pass$1 repeat $!-1 { l[$>,-1] { +eval ${-math_lib}" +s_sampling = ['$2']; +sampling = s_sampling[size(s_sampling) - 1 ]==_'%'?min(w#0,h#0)*$2:$2; +vmax = max(abs(im),abs(iM)); +vmax = vmax?vmax:1; +fact = $3*sampling/vmax; +for (y = sampling/2, y=0','mirroring={ 0:none | 1:x | 2:y | 3:xy } +#@cli : Render rorschach-like inkblots on selected images. +#@cli : Default values: 'smoothness=5%' and 'mirroring=1'. +#@cli : $ 400,400 rorschach 3% +rorschach : check "${1=5%}>=0 && isint(${2=1}) && $2>=0 && $2<=3" +e[^-1] "Render rorschach-like inkblots on image$?, with smoothness $1 and "${arg0\ $2,no,x,y,xy}"-mirroring." +if !$2 +rand -1,1 b $1 >= 0 +elif $2==1 +foreach { +w:=w +columns 0,{w/2-1} rand -1,1 b $1 >= 0 ++mirror x if $w%2 columns. 1,100% fi a x +} +elif $2==2 +foreach { +h:=h +rows 0,{h/2-1} rand -1,1 b $1 >= 0 ++mirror y if $h%2 rows. 1,100% fi a y +} +elif $2==3 +foreach { +w,h={w},{h} +z 0,0,{w/2-1},{h/2-1} rand -1,1 b $1 >= 0 ++mirror x if $w%2 columns. 1,100% fi a x ++mirror y if $h%2 rows. 1,100% fi a y +} +fi +#@cli sierpinski : recursion_level>=0 +#@cli : Draw Sierpinski triangle on selected images. +#@cli : Default value: 'recursion_level=7'. +#@cli : $ image.jpg sierpinski 7 +sierpinski : check ${1=7}>=0 skip ${2=50},${3=0},${4=0},${5=100},${6=100},${7=100} +e[^-1] "Draw Sierpinski triangle of degree $1 on image$?." +_sierpinski ${2-7},$1 +_sierpinski : +if $7<=0 polygon 3,$1%,$2%,$3%,$4%,$5%,$6%,1,255 return fi +_sierpinski $1,$2,{($1+$3)/2},{($2+$4)/2},{($1+$5)/2},{($2+$6)/2},{$7-1} +_sierpinski {($1+$3)/2},{($2+$4)/2},$3,$4,{($3+$5)/2},{($4+$6)/2},{$7-1} +_sierpinski {($1+$5)/2},{($2+$6)/2},$5,$6,{($3+$5)/2},{($4+$6)/2},{$7-1} +#@cli spiralbw : width>0,_height>0,_is_2dcoords={ 0 | 1 } +#@cli : Input a 2D rectangular spiral image with specified size. +#@cli : Default values: 'height=width' and 'is_2dcoords=0'. +#@cli : $ spiralbw 16 +#@cli : $ image.jpg spiralbw {[w,h]},1 +warp[0] [1],0,1,1 +warp[2] [1],2,1,1 ++spiralbw : check "$1>=1 && ${2=$1}>=1 && isbool(${3=0})" +e[^-1] "Input 2D rectangular spiral image of size $1x$2." +main="alpha = min(x,y,w - 1 - x,h - 1 - y); +t0 = alpha*2*(w + h) - 4*alpha^2; +X = x - alpha; +Y = y - alpha; +W = w - 2*alpha; +H = h - 2*alpha; +t = t0 + (!Y?X: +X==W - 1?W - 1 + Y: +Y==H - 1?2*W + H - 3 - X: +2*(W + H - 2) - Y);" +if $3 $1,$2,1,2,$main"[ t%w, int(t/w) ]" else $1,$2,1,1,$main fi +#@cli tetraedron_shade : x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3,R0,G0,B0,...,R1,G1,B1,...,R2,G2,B2,...,R3,G3,B3,... +#@cli : Draw tetraedron with interpolated colors on selected (volumetric) images. +tetraedron_shade : +e[^-1] "Draw tetraderon ($1,$2,$3)-($4,$5,$6)-($7,$8,$9)-($10,$11,$12) with interpolated colors in image$?." +xm:=round(min($1,$4,$7,$10),1,-1) xM:=round(max($1,$4,$7,$10),1,1) +ym:=round(min($2,$5,$8,$11),1,-1) yM:=round(max($2,$5,$8,$11),1,1) +zm:=round(min($3,$6,$9,$12),1,-1) zM:=round(max($3,$6,$9,$12),1,1) +l[] { (${1-3},1;${4-6},1;${7-9},1;${10-12},1) (${13--1}) r. {w/4},4,1,1,-1 s. x solve[^0] [0] rm[0] a c } +f[^-1] "* +begin( +x0 = $1; y0 = $2; z0 = $3; +x1 = $4; y1 = $5; z1 = $6; +x2 = $7; y2 = $8; z2 = $9; +x3 = $10; y3 = $11; z3 = $12; +u01 = x1 - x0; v01 = y1 - y0; w01 = z1 - z0; +u02 = x2 - x0; v02 = y2 - y0; w02 = z2 - z0; +u03 = x3 - x0; v03 = y3 - y0; w03 = z3 - z0; +u12 = x2 - x1; v12 = y2 - y1; w12 = z2 - z1; +u13 = x3 - x1; v13 = y3 - y1; w13 = z3 - z1; +u23 = x3 - x2; v23 = y3 - y2; w23 = z3 - z2; +nx012 = v01*w02 - w01*v02; ny012 = w01*u02 - u01*w02; nz012 = u01*v02 - v01*u02; +if (nx012*u03 + ny012*v03 + nz012*w03<0, nx012*=-1; ny012*=-1; nz012*=-1); +nx013 = v01*w03 - w01*v03; ny013 = w01*u03 - u01*w03; nz013 = u01*v03 - v01*u03; +if (nx013*u02 + ny013*v02 + nz013*w02<0, nx013*=-1; ny013*=-1; nz013*=-1); +nx023 = v02*w03 - w02*v03; ny023 = w02*u03 - u02*w03; nz023 = u02*v03 - v02*u03; +if (nx023*u01 + ny023*v01 + nz023*w01<0, nx023*=-1; ny023*=-1; nz023*=-1); +nx123 = v12*w13 - w12*v13; ny123 = w12*u13 - u12*w13; nz123 = u12*v13 - v12*u13; +if (-nx123*u01 - ny123*v01 - nz123*w01<0, nx123*=-1; ny123*=-1; nz123*=-1); +); +if (x<"$xm" || x>"$xM" || y<"$ym" || y>"$yM" || z<"$zm" || z>"$zM",i, +dx0 = x - x0; dy0 = y - y0; dz0 = z - z0; +dx1 = x - x1; dy1 = y - y1; dz1 = z - z1; +is_in = dx0*nx012 + dy0*ny012 + dz0*nz012>=0 && +dx0*nx013 + dy0*ny013 + dz0*nz013>=0 && +dx0*nx023 + dy0*ny023 + dz0*nz023>=0 && +dx1*nx123 + dy1*ny123 + dz1*nz123>=0; +is_in? i(#-1,0,0,0)*x + i(#-1,0,1,0)*y + i(#-1,0,2,0)*z + i(#-1,0,3,0) :i +) +" +rm. +#@cli t : eq. to 'text'. : (+) +#@cli text : text,_x[%|~],_y[%|~],_{ font_height[%]>=0 | custom_font },_opacity,_color1,... : (+) +#@cli : Draw specified colored text string on selected images. +#@cli : (eq. to 't').\n +#@cli : If one of the x or y argument ends with a '~', its value is expected to be a centering ratio (in [0,1]) rather than a position. +#@cli : Usual centering ratio are { 0:left-justified | 0.5:centered | 1:right-justified }. +#@cli : Sizes '13' and '128' are special and correspond to binary fonts (no-antialiasing). Any other font size is rendered with anti-aliasing. +#@cli : Specifying an empty target image resizes it to new dimensions such that the image contains the entire text string. +#@cli : A custom font can be specified as a variable name that stores an image list of 256 or 512 items (512 for 256 character sprites + 256 associated opacities), or as an image selection that is a serialized version of such an image list. +#@cli : Default values: 'x=y=0.01~', 'font_height=16', 'opacity=1' and 'color1=0'. +#@cli : $ image.jpg resize2dy 600 y=0 repeat 30 { text {2*$>}" : This is a nice text, isn't it ?",10,$y,{2*$>},0.9,255 y+={2*$>} } +#@cli : $ 0 text "G'MIC",0,0,23,1,255 +#@cli to : eq. to 'text_outline'. +to : skip "${1=}",${2=0.01~},${3=0.01~},${4=7.5%} check "${5=2}>=0 && isnum(${6=1}) && isnum(${7=255}) && ""isnum(${8=$7}) && isnum(${9=$7}) && isnum(${10=255})" +_text_outline $"*" +#@cli text_outline : text,_x[%|~],_y[%|~],{ _font_height[%]>0 | custom_font },_outline>=0,_opacity,_color1,... +#@cli : Draw specified colored and outlined text string on selected images. +#@cli : If one of the x or y argument ends with a '~', its value is expected to be +#@cli : a centering ratio (in [0,1]) rather than a position. +#@cli : Usual centering ratio are { 0:left-justified | 0.5:centered | 1:right-justified }. +#@cli : Default values: 'x=y=0.01~', 'font_height=7.5%', 'outline=2', 'opacity=1', 'color1=color2=color3=255' and 'color4=255'. +#@cli : $ image.jpg text_outline "Hi there!",10,10,63,3 +text_outline : skip "${1=}",${2=0.01~},${3=0.01~},${4=7.5%} +check "${5=2}>=0 && isnum(${6=1}) && isnum(${7=255}) && ""isnum(${8=$7}) && isnum(${9=$7}) && isnum(${10=255})" +_text_outline $"*" +_text_outline : skip "${1=}" +if "isexpr($4)" str="height $4" is_custom_font=0 else str="'$4'" is_custom_font=1 fi +e[0--3] "Draw outlined text '$1' at position ($2,$3) on image$?, with font "$str", outline $5, opacity $6 and +color ${7--1}." +if ['"$1"']==0 return fi +sepx,sepy:="sx=['$2']; sy=['$3']; [sx[size(sx)-1], sy[size(sy)-1]]" +if !$is_custom_font is_fontpercent:=ispercentage($4) fi +xpos={`s=['"$2"'];$sepx==_'~'||$sepx==_'%'?s[0,size(s)-1]:s`} +ypos={`s=['"$3"'];$sepy==_'~'||$sepy==_'%'?s[0,size(s)-1]:s`} +foreach { +0 +if $is_custom_font +t. "$1",0,0,$4,1,1 +else +t. "$1",0,0,{-2,$is_fontpercent?h*$4:$4},1,1 +fi +expand_xy. {1+$5},0 ++dilate. {2*$5+1} +i[-3] (${7--1}) r... {s#0},1,1,1,0,2 y... c r... .,.,1,100% +if $5 *[-3,-2] else rm.. fi +if w#0 +j... ..,{[($sepx==_'~'?(w#0-1-w):$sepx==_'%'?(w#0-1)%:1)*$xpos,($sepy==_'~'?(h#0-1-h):$sepy==_'%'?(h#0-1)%:1)*$ypos]},0,0,$6,. +k[0] +else k[1] +fi +} +#@cli triangle_shade : x0,y0,x1,y1,x2,y2,R0,G0,B0,...,R1,G1,B1,...,R2,G2,B2,... +#@cli : Draw triangle with interpolated colors on selected images. +#@cli : $ image.jpg triangle_shade 20,20,400,100,120,200,255,0,0,0,255,0,0,0,255 +triangle_shade : +e[^-1] "Draw triangle ($1,$2)-($3,$4)-($5,$6) with interpolated colors on image$?." +l[] { ($1,$2,1;$3,$4,1;$5,$6,1) (${7--1}) r. {w/3},3,1,1,-1 s. x solve[^0] [0] rm[0] a c } +invarea:=(-$4*$5+$2*(-$3+$5)+$1*($2-$6)+$3*$6)^-1 +s1:=$2*$5-$1*$6 s2:=$6-$2 s3:=$1-$5 +t1:=$1*$4-$2*$3 t2:=$2-$4 t3:=$3-$1 +repeat $!-1 { +l[$>,-1] { +repeat s#0 { +a:=i(0,0,0,$>) b:=i(0,1,0,$>) c:=i(0,2,0,$>) +sh[0] $> +f. "s = "$invarea"*("$s1" + "$s2"*x + "$s3"*y); +t = "$invarea"*("$t1" + "$t2"*x + "$t3"*y); +s>=0 && t>=0 && t+s<=1 ? "$a"*x+"$b"*y+"$c":i" +rm. +} +} +} +rm. +#@cli truchet : _scale>0,_radius>=0,_pattern_type={ 0:straight | 1:curved } +#@cli : Fill selected images with random truchet patterns. +#@cli : Default values: 'scale=32', 'radius=5' and 'pattern_type=1'. +#@cli : $ 400,300 truchet , +truchet : check "isint(${1=32}) && $1>0 && ${2=3}>=0" skip ${3=1} +e[^-1] "Render "${arg0\ !$3,curved,straight}" truchet patterns in image$?, with scale $1 and radius $2." +foreach { +nm={n} w,h,s={w},{h},{s} rm +$1,$1 = 1,0,0 = 1,100%,100% distance 1,{1+$3} M:=int(iM/2) +ir {$M-$2/2-($1%2)},{$M+$2/2} +mirror y a x +{round($w/$1,1,1)},{round($h/$1,1,1)} rand. 0,1 >=. 50% r. {w*$1},{h*$1} *. $1 +channels. 0,1 (0,{$1-1}) r. $1,$1,1,1,3 +transpose. a[-2,-1] c ri. ..,0,2 +[-2,-1] +warp.. . rm. >= 50% r $w,$h,1,1,0 r 100%,100%,1,$s => $nm +} +#@cli turbulence : _radius>0,_octaves={1,2,3...,12},_alpha>0,_difference={-10,10},_mode={0,1,2,3} +#@cli : Render fractal noise or turbulence on selected images. +#@cli : Default values: 'radius=32', 'octaves=6', 'alpha=3', 'difference=0' and 'mode=0'. +#@cli : $ 400,400,1,3 turbulence 16 +#@cli : $$ https://gmic.eu/oldtutorial/_turbulence +turbulence : check "${1=32}>0 && ${2=6}>0" skip ${3=3},${4=0},${5=0} +e[^-1] "Render fractal noise or turbulence on image$?, with radius $1, octaves $2, damping per octave $3, +difference $4 and mode $5." +foreach { +nm={n} +if $4 . fi +f. 0 +noise. 10,0 b. $1,0 +if isbool($5) -. {ia} abs. +elif $5==3||$5==4 ^. 2 +elif $5==5 ^. 3 +fi +repeat $2-1 { ++noise.. 10,0 b. {$1/2^$>},0 +if !$5 -. {ia} abs. +elif $5==4 ^. 2 +elif $5==5 ^. 3 +fi +*.. $3 +[-2--1] +} +n. 0,255 +rm.. +if $4 *. $4 mv.. 2 - n. 0,255 fi +=> $nm +} +#@cli yinyang +#@cli : Draw a yin-yang symbol on selected images. +#@cli : $ 400,400 yinyang +yinyang : +e[^-1] "Draw yin-yang symbol on image$?." +f 0 +foreach { +s:=s channels 0 +r:=round(0.95*min(w,h)/4) ++line 50%,0,50%,50%,1,2 ellipse. 50%,{h/2-$r},$r,$r,0,1,2 +line. 50%,50%,50%,100%,1,1 ellipse. 50%,{h/2+$r},$r,$r,0,1,1 +flood. {w/2-$r},50%,0,0,0,1,2 +flood. {w/2+$r},50%,0,0,0,1,1 +ellipse.. 50%,50%,{2*$r},{2*$r},0,1,1 +* +ellipse. 50%,{h/2-$r},{$r/3},{$r/3},0,1,1 +ellipse. 50%,{h/2+$r},{$r/3},{$r/3},0,1,2 +r 100%,100%,1,$s +} +#@cli :: Matrix Computation +#@cli dijkstra : starting_vertex>=0,_ending_vertex={ -1:none | >=0 } +#@cli : Compute minimal distances/paths in selected graphs, from specified 'starting_vertex' to all other vertices (opt. only until 'ending_vertex' has been reached). +#@cli : A graph of 'N' vertices is specified as a 'NxN' adjacency matrix giving the weights of all edges connecting vertices (set to 'inf' when two vertices are not connected). +#@cli : This command return a '1xNx1x2' image containing the '[distance,parent]' information : +#@cli : - 'distance' is the minimal distance from vertex '#y' to the 'starting_vertex' (i.e. the sum of edge weights composing the minimal path between these two vertices). +#@cli : - 'parent' is the index of the next vertex that must be followed to reaches the 'starting_vertex' through the minimal path. +#@cli : Default value: 'ending_vertex=-1' ++dijkstra : check "isint($1) && $1>=0 && isint(${2=-1}) && $2>=-1" +s0,s1=x,ces t0,t1=," to vertex \#$2" +e[^-1] "Compute minimal distances/path from vertex \#$1"${t{$2>=0}}", for adjacency matri"${s{$!>1}}" [$[]]." +if $2!=-1 str_check_end_vertex="C[1]==$2?break();" fi +foreach { +nm={n} +if !w" || "w!=h" || "d>1" || "s>1 +error[0--4] "Command 'dijkstra': Image ["{arg0($>,$[])}"]: '"$nm"', of size ("{[w,h,d,s]}") ""is not an adjacency matrix." +fi +N:=w +1,$N,1,2,[inf,-1] =. 0,0,$1 +1,{$N+1},1,2,[inf,y] eval "swap(I[0],I[$1]); i[0] = 0; I[h - 1] = [$N,0]" +eval " +while (da_size(), +C = da_pop_heap(); +"$str_check_end_vertex" +repeat (da_size(),q, +N = I[q]; +edge = i(#0,C[1],N[1]); +!isinf(edge)?( +dist = C[0] + edge; +dist0, +parent = (index - 1)>>1; +N[0] $nm +} +mv[1--1:2] $! add_copymark[50%--1] +dijkstra : +foreach { nm={n} +dijkstra $* k. => $nm } +#@cli eigen : (+) +#@cli : Compute the eigenvalues and eigenvectors of selected symmetric matrices or matrix fields. +#@cli : If one selected image has 3 or 6 channels, it is regarded as a field of 2x2 or 3x3 symmetric matrices, +#@cli : whose eigen elements are computed at each point of the field. +#@cli : $ (1,0,0;0,2,0;0,0,3) +eigen +#@cli : $ image.jpg structuretensors blur 2 eigen split[0] c +#@cli : $$ https://gmic.eu/oldtutorial/_eigen +#@cli eye : _size>0 +#@cli : Insert an identity matrix of given size at the end of the image list. +#@cli : $ eye 3 eye 7 eye 10 ++eye : check "isint($1) && $1>=0" +e[^-1] "Input $1x$1 identity matrix." +if $1 $1,$1,1,1,x==y else 0 fi +#@cli fitsamples : nb_samples>0,_relevant_dimension[%]>0,_average_vector_varname,_dilation_vector_varname,_orientation_matrix_varname +#@cli : Generate 'nb_samples' vectors having the same multivariate gaussian distribution as the vectors of the selected images. +#@cli : Each input represents a set of 'M' vectors of dimension 'N' (with M>1) (specified as an image with size 'MxNx1x1', 'Mx1xNx1', 'Mx1x1xN', '1xMxNx1', '1xMx1xN' or '1x1xMxN'). +#@cli : The command returns a new set of random vectors with similar geometry. +#@cli : Default values: 'relevant_dimension=100%', and 'average_vector_varname=orientation_matrix_varname=dilation_matrix_varname=(undefined)'. +fitsamples : check "isint($1) && $1>0 && ${2=100%}>0" skip "${3=},${4=},${5=}" +e[^-1] "Generate $1 new vectors for input vector set$? with $2 relevant dimensions." +fwd0,fwd1,fwd2,fwd3,fwd4,fwd5=xzcy,xycz,,yxcz,yxzc,zxyc +bwd0,bwd1,bwd2,bwd3,bwd4,bwd5=xcyz,xycz,,yxcz,yxzc,yzxc +foreach { +nm={n} +M,N,type:=w>1?[w,h>1?[h,0]:d>1?[d,1]:[s,2]]:h>1?[h,d>1?[d,3]:[s,4]]:d>1?[d,s>1?[s,5]:[-1,-1]] +if $M*$N!=whds +error[0--4] "Command 'fitsamples': Selected image ("{[w,h,d,s]}") does not represent a set of vectors." +fi +permute ${fwd$type} +if !narg("$3") +l { s x + / $M } else $$3 fi +=> avg +if !narg("$4")" || "!narg("$5") +$N,$N +eval... "* +begin(avg = crop(#$avg); C = vector(#$N^2,0)); +mI = I - avg; +C+=mul(mI,mI,s); +end(merge(C,+); C/=$M; draw(#-1,C,0,0,0,0,$N,$N,1,1))" +P:=round(ispercentage($2)?$N*$2:$2) +poweriteration. $P sqrt.. +else +$$4 $$5 P:=w +fi +=> dilation,orientation +$1,1,1,$N,"* +begin(avg = crop(#$avg); L = crop(#$dilation); R = crop(#$orientation)); +U = vector(#$P); fill(U,k,g*L[k]); +mul(R,U)+=avg" +k. permute ${bwd$type} => $nm +} +#@cli invert : _use_LU={ 0:SVD | 1:LU },_lambda>=0 : (+) +#@cli : Inverse selected matrices (or compute Moore-Penrose pseudoinverse for non-square matrices). +#@cli : SVD solver is slower but more precise than LU. +#@cli : 'lambda' is used only in the Moore-Penrose pseudoinverse, by estimating A^t.(A^t.A + lambda.Id)^-1. +#@cli : Default value: 'use_LU=0' and 'lambda=0'. +#@cli : $ (0,1,0;0,0,1;1,0,0) +invert +#@cli meigen : m>=1 +#@cli : Compute an approximation of the 'm' largest eigenvalues and eigenvectors of selected symmetric matrices, +#@cli : using the Arnoldi iteration method (https://en.wikipedia.org/wiki/Arnoldi_iteration). +#@cli : A larger 'm' goes with better numerical precision. +#@cli : $ (1,0,0;0,2,0;0,0,3) +meigen 3 +meigen : check "isint($1) && $1>0" +if $!!=1 s="ce" else s="x" fi +e[^-1] "Compute $1 largest eigen-values of matri"$s"$?." +foreach { +nm={n} +if w!=h" || "d!=1" || "s!=1 v 1 error[0--5] "Command 'meigen': Image '"$nm"' is not a square matrix." fi +eval ${-math_lib}" store('val',meig(crop(),$1,h),1,min($1,h))" $val k. => $nm +} +#@cli mproj : [dictionary],_method,_max_iter={ 0:auto | >0 },_max_residual>=0 : (+) +#@cli : Find best matching projection of selected matrices onto the span of an over-complete +#@cli : dictionary D, using the orthogonal projection or Matching Pursuit algorithm. +#@cli : Selected images are 2D-matrices in which each column represent a signal to project. +#@cli : '[dictionary]' is a matrix in which each column is an element of the dictionary D. +#@cli : 'method' tells what projection algorithm must be applied. It can be: +#@cli : \ - 0 = orthogonal projection (least-squares solution using LU-based solver). +#@cli : \ - 1 = matching pursuit. +#@cli : \ - 2 = matching pursuit, with a single orthogonal projection step at the end. +#@cli : \ - >=3 = orthogonal matching pursuit where an orthogonal projection step is performed +#@cli : \ every 'method-2' iterations. +#@cli : 'max_iter' sets the max number of iterations processed for each signal. +#@cli : If set to '0' (default), 'max_iter' is equal to the number of columns in D. +#@cli : (only meaningful for matching pursuit and its variants). +#@cli : 'max_residual' gives a stopping criterion on signal reconstruction accuracy. +#@cli : (only meaningful for matching pursuit and its variants). +#@cli : For each selected image, the result is returned as a matrix W +#@cli : whose columns correspond to the weights associated to each column of D, +#@cli : such that the matrix product D*W is an approximation of the input matrix. +#@cli : Default values: 'method=0', 'max_iter=0' and 'max_residual=1e-6'. +#@cli orthogonalize : _mode = { 0:orthogonalize | 1:orthonormalize } +#@cli : Orthogonalize or orthonormalize selected matrices, using Modified Gram-Schmidt process. +#@cli : Default value: 'mode=0'. +orthogonalize : +if isbool($1) mode=$1 else mode=0 noarg fi +u0,u1,v0,v1=Orthogonalize,Orthonormalize,x,ce +e[^-1] ${u$mode}" matri"${v{$!!=1}}"$?, using Modified Gram-Schmidt process." +foreach { +eval "> +proj(u,v) = (dot(u,v)/dot(u,u)*u); +for (p = 1, p0,_epsilon>0,_max_iter>0 +#@cli : Compute the 'nb_eigenvectors' largest eigenvectors of the selected symmetric matrices, +#@cli : using the power iteration algorithm. +#@cli : Default values: 'nb_eigenvectors=1', 'epsilon=1e-5' and 'max_iter=100'. +poweriteration : check "isint(${1=1}) && $1>0 && ${2=1e-6}>0 && isint(${3=1000}) && $3>0" +s0,s1=,s if $!>1 c=ces else c=x fi +e[^-1] "Compute the $1 first eigenvector"${s{$1>1}}" of matri"$c" [$[]] with epsilon $2." +foreach { +nm={n} +if !w rm 0 0 => $nm[val] $nm[vec] continue fi +if w!=h" || "d>1" || "s>1 +error[0--3] "Command '$0': Image "[{[$[]][$>]}]" ("{[w,h,d,s]}") is not a square matrix." +fi +1,$1 $1,.. +eval " +const N = w#0; +A = crop(#0); +b = expr('v',N); b/=norm(b); +repeat ($1,k, +p_lambda = inf; +repeat ($3, +c = mul(A,b); +lambda = norm(c); +c/=lambda; +delta = abs(lambda - p_lambda); +b = c; +p_lambda = lambda; +delta<$2?break(); +); +lambda = mul(b,mul(A,b,1))[0]; +i[#-2,k] = lambda; +draw(#-1,b,k,1); +A-=(mul(b,b,N)*=lambda); +)" +rm[0] +} +#@cli solve : [image],_use_LU={ 0:SVD | 1:LU } : (+) +#@cli : Solve linear system AX = B for selected B-matrices and specified A-matrix. +#@cli : If the system is under- or over-determined, the least squares solution is returned. +#@cli : Default value: 'use_LU=0'. +#@cli : $ (0,1,0;1,0,0;0,0,1) (1;2;3) +solve[-1] [-2] +#@cli svd : (+) +#@cli : Compute SVD decomposition of selected matrices. +#@cli : $ 10,10,1,1,'x==y?x+u(-0.2,0.2):0' +svd +#@cli transpose +#@cli : Transpose selected matrices. +#@cli : $ image.jpg +transpose +transpose : +e[^-1] "Transpose image$?." +permute yxzc +#@cli trisolve : [image] : (+) +#@cli : Solve tridiagonal system AX = B for selected B-vectors and specified tridiagonal A-matrix. +#@cli : Tridiagonal matrix must be stored as a 3 column vector, where 2nd column contains the +#@cli : diagonal coefficients, while 1st and 3rd columns contain the left and right coefficients. +#@cli : $ (0,0,1;1,0,0;0,1,0) (1;2;3) +trisolve[-1] [-2] +#@cli :: 3D Meshes +#@cli +3d : eq. to 'add3d'. : (+) +#@cli add3d : tx,_ty,_tz : [object3d] : (no arg) : (+) +#@cli : Shift selected 3D objects with specified displacement vector, or merge them with specified +#@cli : 3D object, or merge all selected 3D objects together. +#@cli : (eq. to '+3d'). +#@cli : Default values: 'ty=tz=0'. +#@cli : $ sphere3d 10 repeat 5 { +add3d[-1] 10,{u(-10,10)},0 color3d[-1] ${-rgb} } add3d +#@cli : $ repeat 20 { torus3d 15,2 color3d[-1] ${-rgb} mul3d[-1] 0.5,1 if $>%2 rotate3d[-1] 0,1,0,90 fi add3d[-1] 70 add3d rotate3d[-1] 0,0,1,18 } double3d 0 +#@cli animate3d : nb_frames>0,_step_angle_x,_step_angle_y,_step_angle_z,_zoom_factor,0<=_fake_shadow_level<=100,_[background] +#@cli : Generate 3D animation frames of rotating 3D objects. +#@cli : Frames are stacked along the z-axis (volumetric image). +#@cli : Frame size is the same as the size of the '[background]' image (or 800x800 if no background specified). +#@cli : Default values: 'step_angle_x=0', 'step_angle_y=5', 'step_angle_z=0', 'zoom_factor=1', 'fake_shadow_level=50' and 'background=(undefined)'. +animate3d : check "isint($1) && $1>0 && isnum(${2=0}) && isnum(${3=5}) && isnum(${4=0}) && ${5=1}>0 && ""inrange(${6=50},0,100)" skip "${7=}" +e[^-1] "Generate 3D animation frames from 3D object$?, with $1 frames, angle steps (${2-4}), zoom factor $5 ""and $6% fake shadow." +if ${"is_image_arg $7"} pass$7 +else 3,2,1,1,"32,32,64,64,116,96" permute. cyzx r. 800,800,1,3,3 round. +fi +=> anim3d_bg +repeat {$!-1} { l[$>,-1] { +check ${-is_mesh3d..} nm={0,n} bn={0,b} +e " * Object '"$bn"': 0/$1" +c3d[0] n3d[0] *3d[0] {1,$5*min(w,h)/2} +repeat $1 { +e "\r * Object '"$bn"': "{1+$>}"/$1" ++r3d[0] 0,0,1,{$>*$4} r3d. 0,1,0,{$>*$3} r3d. 1,0,0,{$>*$2} +{1,[w,h,d,4]},-1 j3d. ..,50%,50%,0,1 +sh. 0,{s-2} +l.. { s c max } !=. -1 mul.. . mul. 255 j... .,0,0,0,{-2,s} rm[-2,-1] +if $6 sh. 100% +b. 2% shift. {m=min(w,h)*2%;[m,m]} -. {255-$6*255%} c. 0,255 max[-2,-1] rm. fi ++blend[1,-1] alpha rm[-3,-2] +if {*} w. -1,-1,0 fi +} +a[2--1] z +rv[0,-1] rm. +} =>[$>] $nm } +rm. +#@cli apply_camera3d : pos_x,pos_y,pos_z,target_x,target_y,target_z,up_x,up_y,up_z +#@cli : Apply 3D camera matrix to selected 3D objects. +#@cli : Default values: 'target_x=0', 'target_y=0', 'target_z=0', 'up_x=0', 'up_y=-1' and 'up_z=0'. +apply_camera3d : skip ${4=0},${5=0},${6=0},${7=0},${8=-1},${9=0} +e[^-1] "Apply 3D camera matrix to 3D object$?, with camera position ($1,$2,$3), target position ($4,$5,$6) and +up-vector ($7,$8,$9)." +({$4-$1}^{$5-$2}^{$6-$3}) +($7^$8^$9) +orientation[-2,-1] +_cross3d {-2,^},{^} +_cross3d {^},{-3,^} +rm... y[-3--1] x mv[-2,-1] -3 +a[-3--1] y z. 0,3 +-3d[^-1] $1,$2,$3 pose3d[^-1] {^} rm. -3d 0,0,800 +_cross3d : +({$2*$6-$3*$5}^{$3*$4-$1*$6}^{$1*$5-$2*$4}) orientation. y. +#@cli apply_matrix3d : a11,a12,a13,...,a31,a32,a33 +#@cli : Apply specified 3D rotation matrix to selected 3D objects. +#@cli : $ torus3d 10,1 +apply_matrix3d {mul(rot(1,0,1,-15°),[1,0,0,0,2,0,0,0,8],3)} double3d 0 +apply_matrix3d : +e[^-1] "Apply 3x3 matrix (${1-3};${4-6};${7-9}) to 3D object$?." +foreach { nbp:=i[6] sh 8,{8+3*$nbp-1},0,0 r. 3,$nbp,1,1,-1 3,3,1,1,$* transpose. m*[-2,-1] rm. } +#@cli array3d : size_x>=1,_size_y>=1,_size_z>=1,_offset_x[%],_offset_y[%],_offset_y[%] +#@cli : Duplicate a 3D object along the X,Y and Z axes. +#@cli : Default values: 'size_y=1', 'size_z=1' and 'offset_x=offset_y=offset_z=100%'. +#@cli : $ torus3d 10,1 +array3d 5,5,5,110%,110%,300% +array3d : check "isint($1) && $1>0 && isint(${2=1}) && $2>0 && isint(${3=1}) && $3>0" +skip ${4=100%},${5=100%},${6=100%} +e[^-1] "Duplicate 3D object$? along X,Y,Z axes with factors ($1,$2,$3) and offsets ($4,$5,$6)." +foreach { ++rows 8,{8+3*i[6]} r. 3,{h/3},1,1,-1 s. x,3 +dx={-3,ispercentage($4)?$4*(iM-im):$4} +dy={-2,ispercentage($5)?$5*(iM-im):$5} +dz={-1,ispercentage($6)?$6*(iM-im):$6} +rm[-3--1] +off=0 repeat int(log2($1)) { +++3d. {2^$>*$dx} +3d. .. +if !($1&(2^$>)) rm.. else +3d.. $off off+=2^$>*$dx fi +} +3d. $off +3d +off=0 repeat int(log2($2)) { +++3d. 0,{2^$>*$dy} +3d. .. +if !($2&(2^$>)) rm.. else +3d.. 0,$off off+=2^$>*$dy fi +} +3d. 0,$off +3d +off=0 repeat int(log2($3)) { +++3d. 0,0,{2^$>*$dz} +3d. .. +if !($3&(2^$>)) rm.. else +3d.. 0,0,$off off+=2^$>*$dz fi +} +3d. 0,0,$off +3d +} +#@cli arrow3d : x0,y0,z0,x1,y1,z1,_radius[%]>=0,_head_length[%]>=0,_head_radius[%]>=0 +#@cli : Input 3D arrow with specified starting and ending 3D points. +#@cli : Default values: 'radius=5%', 'head_length=25%' and 'head_radius=15%'. +#@cli : $ repeat 10 { a:=$>*2*pi/10 arrow3d 0,0,0,{cos($a)},{sin($a)},-0.5 } +3d ++arrow3d : check "${7=5%}>=0 && ${8=25%}>=0 && ${9=15%}>=0" +e[^-1] "Input 3D arrow, from (${1-3}) to (${4-6}), with radius $7, head length $8 and head radius $9." +L:=sqrt(($4-$1)^2+($5-$2)^2+($6-$3)^2) +R:=ispercentage($7)?$7*$L:$7 +l:=ispercentage($8)?$8*$L:$8 +r:=ispercentage($9)?$9*$L:$9 +L-=$l cylinder3d $R,$L cone3d $r,$l +3d. 0,0,$L +3d[-2,-1] +({$4-$1}^{$5-$2}^{$6-$3}) (0.01^-0.02^0.03) orientation[-2,-1] +_cross3d {-2,^},{^} _cross3d {^},{-3,^} rm... y[-3--1] x mv[-2,-1] -3 +a[-3--1] y +s3d.. r[-5] 3,{-5,h/3},1,1,-1 m*[-5,-1] +y[-4] a[-6--1] y +3d. ${1-3} rv3d. +#@cli axes3d : _size_x,_size_y,_size_z,_font_size>0,_label_x,_label_y,_label_z,_is_origin={ 0:no | 1:yes } +#@cli : Input 3D axes with specified sizes along the x,y and z orientations. +#@cli : Default values: 'size_x=size_y=size_z=1', 'font_size=23', 'label_x=X', 'label_y=Y', 'label_z=Z' and 'is_origin=1' +#@cli : $ axes3d , ++axes3d : check "${4=23}>0 && isbool(${8=1})" skip ${1=1},${2=$1},${3=$2},"${5=X},${6=Y},${7=Z}" +e[^-1] "Input 3D axes with sizes ($1,$2,$3)." +l[] { +m:=max(abs($1),abs($2),abs($3))/40 m2:=2*$m m3:=1.2*$m2 +if $1 line3d 0,0,0,$1,0,0 fi +if $2 line3d 0,0,0,0,$2,0 fi +if $3 line3d 0,0,0,0,0,$3 fi +if $1 +cone3d $m,{2*$m},16 r3d. 0,1,0,90 +3d. {$1-$m2},0,0 +_axes3d "$5",$4 +3d. {$1+$m3},0,0 +fi +if $2 +cone3d $m,{2*$m},16 r3d. 1,0,0,-90 +3d. 0,{$2-$m2},0 +_axes3d "$6",$4 +3d. 0,{$2+$m3},0 +fi +if $3 +cone3d $m,{2*$m},16 +3d. 0,0,{$3-$m2} +_axes3d "$7",$4 +3d. 0,0,{$3+$m3} +fi +if $8 _axes3d "O",$4 -3d. $m3,$m3,$m3 fi ++3d => [3d\ axes] +} +_axes3d : +0 t. "$1",2,0,$2,1,1 +dilate. 3 *.. 255 r.. 100%,100%,1,3 +i... (67.5;73.5;109.5;103.5;51.5;100.5;1;1;0;0;0;1;0;-128;{w};{h};3) +i.. (-128;{w};{h};1) y[-3,-1] a[-4--1] y +#@cli boundingbox3d +#@cli : Replace selected 3D objects by their 3D bounding boxes. +#@cli : $ torus3d 100,30 +boundingbox3d +3d[-1] [-2] +boundingbox3d : +e[^-1] "Replace 3D object$? by their 3D bounding boxes." +foreach { +s3d nbv,nbp={1,f2ui([i[0],i[1]])} k[2,3] => pts,prims +r[pts] 3,{pts,h/3},1,1,-1 permute[pts] zycx ($nbv) a[pts,-1] y +$nbp eval. ">begin(p = 0); +N = i[#$prims,p++]; +N==5?( +i0 = i[#$prims,p++]; i1 = i[#$prims,p++]; p+=3; +P0 = I[#$pts,i0]; P1 = I[#$pts,i1]; Pc = (P0 + P1)/2; +U = (P1 - P0)/2; +V = rot(-U[1],U[0],U[2],pi/2)*U; +W = cross(U,V)/norm(U); +da_push(#$pts,Pc + V,Pc - V,Pc + W,Pc - W); +):(p+=N); +end(da_freeze(#$pts))" rm[prims,-1] +s c +xm,dx={0,[im,iM-im]} +ym,dy={1,[im,iM-im]} +zm,dz={2,[im,iM-im]} +rm box3d $dx,$dy,$dz +3d $xm,$ym,$zm p3d 1 +} +#@cli box3d : _size_x,_size_y,_size_z +#@cli : Input 3D box at (0,0,0), with specified geometry. +#@cli : Default values: 'size_x=1' and 'size_z=size_y=size_x'. +#@cli : $ box3d 100,40,30 +primitives3d 1 color3d[-2] ${-rgb} ++box3d : skip ${1=1},${2=$1},${3=$2} +e[^-1] "Input 3D box, with size ($1,$2,$3)." +1,86,1,1,67.5,73.5,109.5,103.5,51.5,100.5,8,6,0,0,0,$1,0,0,$1,$2,0,0,$2,0,0,0,$3,$1,0,$3,$1,$2,$3,0,$2,$3,4,0,3,2,1,4,4,5,6,7,4,0,1,5,4,4,3,7,6,2,4,0,4,7,3,4,1,2,6,5,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,1,1,1,1,1,1 +=> [3D\ box] +#@cli c3d : eq. to 'center3d'. +c3d : +_center3d +#@cli center3d +#@cli : Center selected 3D objects at (0,0,0). +#@cli : (eq. to 'c3d'). +#@cli : $ repeat 100 { circle3d {u(100)},{u(100)},{u(100)},2 } add3d color3d[-1] 255,0,0 +center3d color3d[-1] 0,255,0 add3d +center3d : +_$0 +_center3d : +e[0--3] "Center 3D object$?." +check3d foreach { +if i[6] +s3d r[2] 3,{2,h/3},1,1,-1 s[2] x +-[2] {2,(iM+im)/2} -[3] {3,(iM+im)/2} -[4] {4,(iM+im)/2} +a[2-4] x y[2] a y +fi +} +#@cli chainring3d : _nb_links>=3,_x_scale>0,_y_scale>0,_z_scale>0 +#@cli : Input 3D chain ring with specified geometry. +#@cli : 'nb_links' should be preferably even. +#@cli : Default values: 'nb_links=16', 'x_scale=0.5', 'y_scale=1' and 'z_scale=1'. +#@cli : $ chainring3d +chainring3d : check "isint(${1=16}) && $1>=3 && ${2=0.5}>0 && ${3=1}>0 && ${4=1}>0" +e[^-1] "Input 3D chain ring, with $1 links and scales (${2-4})." +l[] { +torus3d 1,0.1 *3d ${2-4} shift:=0.75*$1/pi +repeat $1 { +ang:=$>*360/$1 +($ang^1^0.784) hsv2rgb. +col3d[0] {^} rm.. +if $>%2 r3d. 0,1,0,90 fi ++3d. $shift r3d. 0,0,1,$ang +} +rm[0] +3d /3d $shift +=> [3D\ chainring] +} +#@cli circle3d : _x0,_y0,_z0,_radius>=0 +#@cli : Input 3D circle at specified coordinates. +#@cli : Default values: 'x0=y0=z0=0' and 'radius=1'. +#@cli : $ repeat 500 { a:=$>*pi/250 circle3d {cos(3*$a)},{sin(2*$a)},0,{$a/50} color3d[-1] ${-rgb},0.4 } add3d ++circle3d : skip ${1=0},${2=0},${3=0},${4=1} +e[^-1] "Input 3D circle at position ($1,$2,$3) with radius $4." +r:=$4/sqrt(3) +1,24,1,1,67.5,73.5,109.5,103.5,51.5,100.5,2,1,{$1-$r},{$2-$r},{$3-$r},{$1+$r},{$2+$r},{$3+$r},5,0,1,0,0,0,200,200,200,1 +=> [3D\ circle] +#@cli circles3d : _radius>=0,_is_outlined={ 0 | 1 } +#@cli : Convert specified 3D objects to sets of 3D circles with specified radius. +#@cli : Default values: 'radius=1' and 'is_outlined=1'. +#@cli : $ image.jpg luminance resize2dy 40 threshold 50% * 255 pointcloud3d color3d[-1] 255,255,255 circles3d 0.7 +circles3d : check "${1=1}>=0 && isbool(${2=0})" +e[^-1] "Convert 3D object$? to sets of 3D "${arg0\ $2,filled,outlined}" circles with radius $1." +p3d 0 +foreach { +-3d {$1/2},0,0 ++3d $1,0,0 +3d[1] [0] +s3d +rows[7] 0 j[1] [7] +rv[2,8] +rv[3,9] l[3] { r 2,{h/2},1,1,-1 z 1,1 s y,2 i[0] 1,100%,1,1,5 1,100%,1,1,$2 2,100% a x y } +k[0-5] a y +} +#@cli col3d : eq. to 'color3d'. +col3d : +_gmic_s="$?" v + _color3d $* +#@cli color3d : R,_G,_B,_opacity +#@cli : Set color (and optionally opacity) of selected 3D objects. +#@cli : (eq. to 'col3d'). +#@cli : Default value: 'B=G=R' and 'opacity=(undefined)'. +#@cli : $ torus3d 100,10 double3d 0 repeat 7 { +rotate3d[-1] 1,0,0,20 color3d[-1] ${-rgb} } add3d +color3d : +_gmic_s="$?" v + _$0 $* +_color3d : +$=arg col:=$#==1?[$arg1,$arg1,$arg1]:$#==2?[$arg1,$arg2,0]:[$arg1,$arg2,$arg3] +if $#<4 e[0--4] "Set color of 3D object"$_gmic_s" to ("$col")." +else e[0--4] "Set color of 3D object"$_gmic_s" to ("$col"), with opacity "$arg4"." +fi +foreach { +nbv,nbp:=f2ui([i[6],i[7]]) $nbp +eval. ">begin(p = 8 + 3*$nbv); p+=i[#0,p] + 1; end(set('p',p))" # Find beginning of color data +eval. ">begin(p = $p; col = ["$col"]); +i[#0,p]==-128?(p+=prod(crop(#0,0,++p,1,3))):copy(i[#0,p],col); p+=3; +end(set('p',p))" +if $#>3 eval. ">begin(p = $p; const o = $arg4); i[#0,p]==-128?(p+=3 + prod(crop(#0,0,++p,1,3))):(i[#0,p++] = o)" fi +k[0] +} +#@cli colorcube3d : _is_wireframe={ 0 | 1 } +#@cli : Input 3D color cube. +#@cli : Default value: 'is_wireframe=0'. +#@cli : $ colorcube3d mode3d 2 +primitives3d 1 ++colorcube3d : l[] { check "isbool(${1=0})" is_wireframe=$1 onfail is_wireframe=1 noarg } +s0,s1="face","wireframe" +e[^-1] "Input 3D RGB-color "$s$1" cube." +if $is_wireframe l[] { +({'CImg3d'},8,12) +(0,0,0;255,0,0;255,255,0;0,255,0;0,0,255;255,0,255;255,255,255;0,255,255) +(6,0,1,0,0,63,0;6,1,2,0,1,63,1;6,2,3,0,2,63,2;6,3,0,0,3,63,3;\ +6,0,4,0,4,63,4;6,1,5,0,5,63,5;6,2,6,0,6,63,6;6,3,7,0,7,63,7;6,4,5,0,8,63,8;6,5,6,0,9,63,9;6,6,7,0,10,63,10;6,7,4,0,11,63,11) +(-128,64,12,3) (0,0,0;255,0,0/255,0,0;255,255,0/255,255,0;0,255,0/0,255,0;0,0,0/\ +0,0,0;0,0,255/255,0,0;255,0,255/255,255,0;255,255,255/0,255,0;0,255,255/0,0,255;255,0,255/255,0,255;255,255,255/255,255,255;0,255,255/0,255,255;0,0,255) +permute. yzcx r. 64,100%,1,3,3 +(-128,0,0,0)x11 +1,12,1,1,1 +y a y +} else l[] { +({'CImg3d'},8,6) +(0,0,0;255,0,0;255,255,0;0,255,0;0,0,255;255,0,255;255,255,255;0,255,255) +(12,0,3,2,1,0,0,0,63,63,63,63,0;12,1,2,6,5,0,0,0,63,63,63,63,0;\ +12,0,4,7,3,0,0,63,0,63,63,0,63;12,4,5,6,7,0,0,63,0,63,63,0,63;12,0,1,5,4,0,0,63,0,63,63,0,63;12,3,7,6,2,0,0,0,63,63,63,63,0) +(0,255;0,255^0,0;255,255^0,0;0,0) +(255,255;255,255^0,0;255,255^0,255;0,255) +(0,0;0,0^0,0;255,255^0,255;0,255) +(0,255;0,255^0,0;255,255^255,255;255,255) +(0,255;0,255^0,0;0,0^0,0;255,255) +(0,255;0,255^255,255;255,255^0,0;255,255) +r[-6--1] 64,64,1,3,3 round[-6--1] y[-6--1] i[-7--2] (-128;64;64;3) +1,6,1,1,1 +y a y +} fi +=> [3D\ colorcube] +#@cli cone3d : _radius,_height,_nb_subdivisions>0 +#@cli : Input 3D cone at (0,0,0), with specified geometry. +#@cli : Default value: 'radius=1','height=1' and 'nb_subdivisions=24'. +#@cli : $ cone3d 10,40 +primitives3d 1 color3d[-2] ${-rgb} ++cone3d : check ${3=24}>0 skip ${1=1},${2=1} +e[^-1] "Input 3D cone, with radius $1, height $2 and $3 subdivisions." +(67.5;73.5;109.5;103.5;51.5;100.5) +({$3+2};{2*$3}) +(0,0,0;0,0,$2) +(0;{2*pi}) r. 1,{$3+1},1,1,3 rows. 0,{$3-1} +sin. cos.. *[-2,-1] $1 a[-2,-1] x z. 0,2 a[-2,-1] y +1,$3,1,1,'y' +shift. 0,-1 +[-2,-1] 2 +2,$3,1,1,3,0 .. [-4] a[-3--1] x +i[-4] 2,$3,1,1,3,1 a[-4--2] x +a[-2,-1] y +3,{h},1,1,200 +1,{h},1,1,1 +y[-4--2] a[-6--1] y => [3D\ cone] +#@cli cubes3d : _size>=0 +#@cli : Convert specified 3D objects to sets of 3D cubes with specified size. +#@cli : Default value: 'size=1'. +#@cli : $ image.jpg luminance resize2dy 40 threshold 50% * 255 pointcloud3d color3d[-1] 255,255,255 cubes3d 1 +cubes3d : check ${1=1}>=0 +e[^-1] "Convert 3D object$? to sets of 3D cubes with size $1." +p3d 0 +foreach { +nbv={@6} nbp={@7} +if $nbv&&$nbp +s3d +l[1] { = {8*i[0]} = {6*i[1]},0,1 } +l[2] { +r 3,{h/3},1,1,-1 +half:=$1/2 +- '$half,0,0' ++ '$1,0,0' a x +- '0,$half,0' ++ '0,$1,0' a x +- '0,0,$half' ++ '0,0,$1' a x +} +l[3] { +r 2,{h/2},1,1,-1 +z 1,1 * 8 r 4,100% i[0] 1,100%,1,1,4 a x [-1]x5 a x ++ '"0,0,2,3,1, 0,4,5,7,6, 0,0,1,5,4, 0,2,6,7,3, 0,0,4,6,2, 0,1,3,7,5"' +} +l[4] { r 3,{h/3},1,1,-1 r 18,100%,1,1,0,2 } r[5] 6,100% +y a y +fi +} +#@cli cup3d : _resolution>0 +#@cli : Input 3D cup object. +#@cli : Default value: 'resolution=128'. +#@cli : $ cup3d , ++cup3d : check ${1=128}>0 +e[^-1] "Input 3D cup, with resolution $1." +100,200 +ellipse. 0%,0%,40%,40%,0,1,1 +ellipse. 0,0,35%,35%,0,1,0 +polygon. 4,0,45%,8%,45%,20%,90%,0,90%,1,1 +ellipse. 0%,100%,30%,10%,0,1,1 b. 0.1% +lathe3d. $1,2 +=> [3D\ cup] +#@cli curve3d : _"x(t)",_"y(t)",_"z(t)",_"r(t)",_resolution>1,_tmin,_tmax,_nb_sides>=0,_is_closed_curve={ 0 | 1 } +#@cli : Input 3D curve with specified parameterization. +#@cli : If 'r(t)==0' or 'nb_sides<3', the generated 3D object is composed of segments only. +#@cli : Default values: 'x(t)=cos(2*pi*t)', 'y(t)=sin(2*pi*t)', 'z(t)=t', 'r(t)=0.025', 'resolution=128', 'tmin=0', 'tmax=1', 'nb_sides=16' and 'is_closed_curve=0'. +#@cli : $ curve3d , ++curve3d : check "isint(${5=128}) && $5>1 && isbool(${9=0}) && isint(${8=16}) && $8>=0" +skip "${1=0.25*cos(4*pi*t)},${2=0.25*sin(4*pi*t)},${3=t},${4=0.025},${6=0},${7=1}" +xt,yt,zt,rt,resolution,tmin,tmax,nb_sides,is_closed=$"*" +nb_sides:="$nb_sides<3 || ['"$rt"']=='0'?1:$nb_sides" +s0,s1="open","closed" +e[^-1] "Input 3D "${s$is_closed}" curve with parameterization ("$xt,$yt,$zt"), radius '"$rt"', ""resolution "$resolution", t-range ["$tmin,$tmax"], radius and "$nb_sides" sides." +('CImg3d') (0,0) +1,$resolution,1,4,"t = lerp($tmin,$tmax,y/(h - !$is_closed)); [ ("$xt"),("$yt"),("$zt"),("$rt") ]" s. c,-3 +if $nb_sides==1 +rm. 1,{$resolution-1+$is_closed},1,3,"[ 2,y,(y + 1)%$resolution ]" nbv=$resolution nbp:=h permute[-2,-1] cyzx +else ++g.. y,0,{$is_closed?2:1} orientation. +0 $nb_sides,$resolution,1,1," +!x?( +P = I(#-4,0,y); +R = i(#-3,0,y); +W = I(#-2,0,y); +!norm(W)?(W = [ 0,0,1 ]); +!y?( +P0 = P; +do (ref = [ v,v,v ]; ref/=norm(v); crossWref = cross(W,ref), norm(crossWref)<1e-5); +); +U = cross(W,ref); U/=norm(U); +V = cross(W,U); V/=norm(V); +M = transpose([ U,V,W ],3); +ref = -V; +); +ang = x*2*pi/w; +Q = P + R*mul(M,[ cos(ang),sin(ang),0 ]); +da_push(Q[0],Q[1],Q[2]); +end( +!$is_closed?da_push(P0[0],P0[1],P0[2],P[0],P[1],P[2]); +da_freeze(); +)" rm[-5--3,-1] +nbv:=h/3 +0 $nb_sides,{$resolution-1+$is_closed},1,1,"begin(nbp = 0); +b0 = y*$nb_sides; b1 = ((y + 1)%$resolution)*$nb_sides; nx = (x+1)%$nb_sides; +da_push(4,b0 + x,b0 + nx,b1 + nx,b1 + x); +++nbp; +end( +const indmin = $nb_sides*$resolution; +const indmax = indmin + 1; +const last = indmin - $nb_sides; +!$is_closed?( +repeat($nb_sides,k,da_push(3,indmin,(k + 1)%$nb_sides,k); ++nbp); +repeat($nb_sides,k,da_push(3,indmax,last + k,last + ((k + 1)%$nb_sides)); ++nbp); +); +da_freeze(); +set('nbp',nbp); +)" rm. +fi +eval "i[#-3,0] = ui2f($nbv); i[#-3,1] = ui2f($nbp)" +3,$nbp,1,1,200 1,$nbp,1,1,1 y[-6--1] a[-6--1] y => [3D\ Curve] +#@cli cylinder3d : _radius,_height,_nb_subdivisions>0 +#@cli : Input 3D cylinder at (0,0,0), with specified geometry. +#@cli : Default value: 'radius=1','height=1' and 'nb_subdivisions=24'. +#@cli : $ cylinder3d 10,40 +primitives3d 1 color3d[-2] ${-rgb} ++cylinder3d : check ${3=24}>0 skip ${1=1},${2=1} +e[^-1] "Input 3D cylinder, with radius $1, height $2 and $3 subdivisions." +l[] { +N:=round($3) +nbv,nbp:=2*$N+2,3*$N +({0.5+[{'CImg3d'}]}) +($nbv,$nbp) +1,$nbv,1,3,"Z = (y<="$N"?0:$2); ang = ((y%("$N"+1))-1)*2*pi/"$N"; +!(y%("$N"+1))?[0,0,Z]:[$1*cos(ang),$1*sin(ang),Z]" +1,$N,1,13,"i1 = 1 + y; i2 = 1 + (i1%"$N"); const j0 = "$N" + 1; j1 = j0 + i1; j2 = j0 + i2; +[ 3,0,i2,i1, 3,j0,j1,j2, 4,i1,i2,j2,j1 ]" +permute[^0,1] "cyzx" 1,$nbp,1,3,200 1,$nbp,1,1,1 y a y => [3D\ cylinder] +} +#@cli delaunay3d +#@cli : Generate 3D Delaunay triangulations from selected images. +#@cli : One assumes that the selected input images are binary images containing the set of points to mesh. +#@cli : The output 3D object is a mesh composed of non-oriented triangles. +#@cli : $ 500,500 noise 0.05,2 eq 1 * 255 +delaunay3d color3d[1] 255,128,0 dilate_circ[0] 5 to_rgb[0] +object3d[0] [1],0,0,0,1,1 max[-1] [0] +delaunay3d : +e[^-1] "Generate 3D Delaunay triangulation from image$?." +foreach { +channels 0 != 0 +whd={w},{h},{d} +r 1,{whd},1,1,-1 cumulate. *. .. r. $whd,1,-1 ++distance[0] 1 *[2] -1 watershed[1] [2] rm[2] +r[1] 100%,100%,100%,3 +if d>1 ++_delaunay3d[1] 1,0,0,0,0,1 +_delaunay3d[1] -1,0,0,0,0,-1 ++_delaunay3d[1] 0,1,0,0,0,1 +_delaunay3d[1] 0,-1,0,0,0,-1 +fi ++_delaunay3d[1] 1,0,0,0,1,0 _delaunay3d[1] -1,0,0,0,-1,0 +a[^0] x transpose. -. 1 +pointcloud3d[0] +s3d[0] rm[3-5] i.. 1,100%,1,1,3 a[-2,-1] x +3,100%,1,1,200 1,100%,1,1,1 =[1] {h},0,1 y a y +} +_delaunay3d : +f. "A=j($1,$2,$3,0,0,1); B=j($4,$5,$6,0,0,1); +i!=A && i!=B && A!=B?kth(1+c,i,A,B):0" +discard. 0 r. {h/3},3,1,1,-1 +#@cli distribution3d +#@cli : Get 3D color distribution of selected images. +#@cli : $ image.jpg distribution3d colorcube3d primitives3d[-1] 1 add3d +distribution3d : +e[^-1] "Get 3D color distribution of image$?." +to_rgb permute "cxyz" y +foreach { +nbp:=round(h/3) +i.. (67.5;73.5;109.5;103.5;51.5;100.5;\ +$nbp;$nbp) +1,$nbp,1,1,1 +f. y a[-2,-1] x y. +.. +1,$nbp,1,1,1 +a y => [3D\ distribution] +} +#@cli /3d : eq. to 'div3d'. : (+) +#@cli div3d : factor : factor_x,factor_y,_factor_z : (+) +#@cli : Scale selected 3D objects isotropically or anisotropically, with the inverse of specified +#@cli : factors. +#@cli : (eq. to '/3d'). +#@cli : Default value: 'factor_z=1'. +#@cli : $ torus3d 5,2 repeat 5 { +add3d[-1] 12,0,0 div3d[-1] 1.2 color3d[-1] ${-rgb} } add3d +#@cli db3d : eq. to 'double3d'. +db3d : +l[] { check "isbool(${1=1})" mode=$1 onfail noarg mode=1 } +v + _double3d $mode +#@cli double3d : _is_double_sided={ 0 | 1 } +#@cli : Enable/disable double-sided mode for 3D rendering. +#@cli : (eq. to 'db3d'). +#@cli : Default value: 'is_double_sided=1'. +#@cli : $ mode3d 1 repeat 2 { torus3d 100,30 rotate3d[-1] 1,1,0,60 double3d $> snapshot3d[-1] 400 } +double3d : +l[] { check "isbool(${1=1})" mode=$1 onfail noarg mode=1 } +v + _$0 $mode +_double3d : +if $^>=0 +s0,s1=Disable,Enable +e[0--4] ${s$1}" double-sided mode for 3D rendering." +fi +_double3d=$1 +#@cli elevation3d : { z-factor | [elevation_map] | 'formula' },base_height={ -1 | >=0 } : (no arg) +#@cli : Generate 3D elevation of selected images, opt. with a specified elevation map. +#@cli : When invoked with (no arg) or 'z-factor', the elevation map is computed as the pointwise L2 norm of the +#@cli : pixel values. Otherwise, the elevation map is taken from the specified image or formula. +#@cli : $ image.jpg +blur 5 elevation3d. 0.75 +#@cli : $ 128,128,1,3,u(255) plasma 10,3 blur 4 sharpen 10000 n 0,255 elevation3d[-1] 'X=(x-64)/6;Y=(y-64)/6;-100*exp(-(X^2+Y^2)/30)*abs(cos(X)*sin(Y))' +elevation3d : skip "${1=_noarg}" check "${2=-1}==-1 || $2>=0" +if $2>=0 base_str=" and base height $2" else base_str= fi +if isnum($1) +e[^-1] "Generate 3D elevation of image$?, with z-factor $1"$base_str. argtype,zfactor=0,$1 +elif ${"is_image_arg $1"} +e[^-1] "Generate 3D elevation of image$?, from elevation $1"$base_str. argtype=2 +pass$1 0 if s>1 norm. fi store. elevation_img +elif isexpr($1) +e[^-1] "Generate 3D elevation of image$?, with formula '$1'"$base_str. argtype=1 +else +e[^-1] "Generate 3D elevation of image$?." argtype,zfactor=0,1 +fi +is_base:=$2>=0 +foreach { +nm={n} M,N:=w,h to_rgb +100%,100%,1,2,[x,y] +if !$argtype +norm[0] *. $zfactor +elif $argtype==1 [0],[0],1,1,"$1" +else $elevation_img +fi +a[-2,-1] c +if $is_base . sh. 100% f. {-sign($1)*$2} rm. a[-2,-1] y fi +r. {wh},1,1,3,-1 permute. cxyz nbv:=h +header="const M = "$M"; const N = "$N"; const MN = M*N" +{[$M,$N]-1},1,5,$header"; +i0 = M*y + x; i1 = i0 + MN; +[ 4,ui2f(i0),ui2f(i0 + M),ui2f(i0 + 1 + M),ui2f(i0 + 1) ]" +r. 1,{wh},1,100%,-1 nbp:=h +if $is_base +{[$M,$N]-1},1,5,$header"; +i0 = M*y + x; i1 = i0 + MN; +[ 4,ui2f(i1),ui2f(i1 + 1),ui2f(i1 + 1 + M),ui2f(i1 + M) ]" +r. 1,{wh},1,100%,-1 nbp+=h +{$M-1},1,1,10,$header" ; +i0 = x; i1 = i0 + MN; i2 = i0 + M*(N - 1); i3 = i2 + MN; +[ 4,ui2f(i0),ui2f(i0 + 1),ui2f(i1 + 1),ui2f(i1), +4,ui2f(i2),ui2f(i3),ui2f(i3 + 1),ui2f(i2 + 1) ]" +r. 1,{wh},1,100%,-1 s. c,2 nbp+=2*h +{$N-1},1,1,10,$header"; +i0 = M*x; i1 = i0 + MN; i2 = i0 + M - 1; i3 = i2 + MN; +[ 4,ui2f(i0),ui2f(i1),ui2f(i1 + M),ui2f(i0 + M), +4,ui2f(i2),ui2f(i2 + M),ui2f(i3 + M),ui2f(i3) ]" +r. 1,{wh},1,100%,-1 s. c,2 nbp+=2*h +permute[-6--1] cyxz -a[-6--1] y +else permute. cyxz +fi +mv[0] $! r. {[w,h]-1},1,3,0 r. {wh},1,1,3,-1 permute. cxyz +if $is_base 3,{$nbp-h},1,1,200 fi +1,$nbp,1,1,1 +i[0] ('CImg3d':y) +[0] 0.5 i[1] ({ui2f([$nbv,$nbp]):;}) y a y +=> $nm +} +#@cli empty3d +#@cli : Input empty 3D object. +#@cli : $ empty3d ++empty3d : +e[^-1] "Input empty 3D object." +(67.5;73.5;109.5;103.5;51.5;100.5;0;0) => [3D\ empty] +#@cli extract_textures3d +#@cli : Extract texture data from selected 3D objects. +#@cli : $ image.jpg imagesphere3d 10,10 +extract_textures3d +extract_textures3d : +e[^-1] "Extract textures from 3D object$?." +check3d foreach { +ext={x} if ['$ext']!=0 ext..=. fi +bn={`"s = ['"{b}'"]; e = ['"$ext"']; p = find(s,e,size(s) - size(e),-1); p>0?s[p] = 0; s"`} +s3d nbv,nbp={1,f2ui(crop())} +tmp=$! $nbp eval. ">begin(p = N = 0); +i[#4,p++]==-128?( +W = i[#4,p++]; H = i[#4,p++]; S = i[#4,p++]; WHS = W*H*S; +WHS?(run('+z[4] 0,',p,',0,',p + WHS - 1,' r. ',W,',',H,',1,',S,',-1 => tx',N); p+=WHS); +):(p+=2); +++N" +rm[0-$tmp] foreach { => ${bn}_texture$> } +} +#@cli extrude3d : _depth>0,_resolution>0,_smoothness[%]>=0 +#@cli : Generate extruded 3D object from selected binary XY-profiles. +#@cli : Default values: 'depth=16', 'resolution=1024' and 'smoothness=0.5%'. +#@cli : $ image.jpg threshold 50% extrude3d 16 +extrude3d : check "${1=16}>0 && ${2=1024}>0 && ${3=0.5%}>=0" +e[^-1] "Generate extruded 3D object from XY-profile$?, with depth $1, resolution $2 and smoothness $3." +norm n 0,1 autocrop 0 +foreach { +nm={n} +wr:=round(max(1,w>h?min($2,w):min($2,h)*w/h)) +hr:=round(max(1,w>h?min($2,w)*h/w:min($2,h))) +fact:=$1/max(w/$wr,h/$hr) +b $3,0 r $wr,$hr,1,1,2 expand_xyz 1,0 +isosurface3d 50% *3d 1,1,$fact rv3d => $nm +} +#@cli f3d : eq. to 'focale3d'. +f3d : +l[] { check "isnum(${1=700})" focale=$1 onfail noarg focale=700 } +v + _focale3d $focale +#@cli focale3d : focale +#@cli : Set 3D focale. +#@cli : (eq. to 'f3d').\n +#@cli : Set 'focale' to 0 to enable parallel projection (instead of perspective). +#@cli : Set negative 'focale' will disable 3D sprite zooming. +#@cli : Default value: 'focale=700'. +#@cli : $ repeat 5 { torus3d 100,30 rotate3d[-1] 1,1,0,60 focale3d {$<*90} snapshot3d[-1] 400 } remove[0] +focale3d : +l[] { check "isnum(${1=700})" focale=$1 onfail noarg focale=700 } +v + _$0 $focale +_focale3d : +e[0--3] "Set 3D focale to $1." +_focale3d=$1 +#@cli fov3d : fov_angle>=0,_image_resolution>0 +#@cli : Set 3D focale to match specified field of vision angle (in degree) for rendering a 3D object in an image with specified resolution. +#@cli : Return corresponding value of the focale in status. +#@cli : Default value: 'fov_angle=45' and 'image_size=max(w,h)' (max size of the latest image). +fov3d : check "${1=45}>=0 && isint(${2=max(w,h)}) && $2>0" +e[^-1] "Set 3D focale to have FOV angle of $1 for image size $2." +if !$1 f3d=0 else f3d:=($2)/2/tan(($1)°/2) fi +f3d $f3d u $f3d +#@cli gaussians3d : _size>0,_opacity +#@cli : Convert selected 3D objects into set of 3D gaussian-shaped sprites. +#@cli : $ image.jpg r2dy 32 distribution3d gaussians3d 20 colorcube3d primitives3d[-1] 1 +3d +gaussians3d : check "${1=32}>0" skip ${2=0.3} +e[^-1] "Convert 3D object$? into sets of gaussian-shaped 3D sprites, with size $1 and opacity $2." +p3d 2 p3d 0 +foreach { +nm={n} s3d nbv:=h rm. (-128;$1;$1;1) +$1,$1 gaussian. 35%,35%,0 c. 30%,100% n. 0,$2 y. a[-2,-1] y +if $nbv>1 4,{$nbv-1},1,1,-128,0,0,0 y[-2,-1] a[-2,-1] y fi +a y => $nm +} +#@cli gmic3d +#@cli : Input a 3D G'MIC logo. +#@cli : $ gmic3d +primitives3d 1 ++gmic3d : +e[^-1] "Input 3D G\47MIC logo." +text3d G,60,20,2 col3d. 16,64,255 +text3d \',60,20,2 +3d. 40 col3d. 64,128,255 +text3d M,60,20,2 +3d. 50 col3d. 96,196,255 +text3d I,60,20,2 +3d. 90 col3d. 64,128,255 +text3d C,60,20,2 +3d. 100 col3d. 16,64,255 +sphere3d 8,-3 +3d. 102,-3,20 col3d. 192,128,255 ++3d[-6--1] c3d. +repeat 30 { +box3d {min(3+$,20+80*$>,10*$>],0,255)},0.5 +r3d. 1,1,1,{$>*12} ++3d. {80*cos(0.5+1.02*$>*12*pi/180)},{30*sin(0.8+$>*12*pi/180)},{2*$>-60} +} ++3d[-30--1] +3d. 0,5,30 +3d[-2--1] => [3d\ gmic] +#@cli gyroid3d : _resolution>0,_zoom +#@cli : Input 3D gyroid at (0,0,0), with specified resolution. +#@cli : Default values: 'resolution=32' and 'zoom=5'. +#@cli : $ gyroid3d 48 +primitives3d 1 ++gyroid3d : check ${1=32}>0 skip ${2=5} +e[^-1] "Input 3D gyroid, with resolution $1 and range $2." +isosurface3d "'0.49*(cos( 2*x + y + z - pi) + cos( 2*x - y + z - pi)+ cos(- 2*x + y - z - pi) + cos(- 2*x - y - z - pi)+ cos( x + 2*y + z - pi) + cos( x + 2*y - z - pi)+ cos(- x - 2*y + z - pi) + cos(- x - 2*y - z - pi)+ cos( x + y + 2*z - pi) + cos(- x + y + 2*z - pi)+ cos( x - y - 2*z - pi) + cos(- x - y - 2*z - pi)+ cos(- 2*x + y + z) + cos( 2*x + y - z)+ cos(- 2*x - y + z) + cos( 2*x - y - z)+ cos(- x + 2*y + z) + cos( x - 2*y + z)+ cos(- x + 2*y - z) + cos( x - 2*y - z)+ cos( x - y + 2*z) + cos( x + y - 2*z)+ cos(- x - y + 2*z) + cos(- x + y - 2*z)) + 0.27*( cos(- 2*x + 2*y - pi) + cos( 2*x - 2*y - pi)+ cos( 2*x + 2*y - pi) + cos(- 2*x - 2*y - pi)+ cos(- 2*y + 2*z - pi) + cos( 2*y - 2*z - pi)+ cos( 2*y + 2*z - pi) + cos(- 2*y - 2*z - pi)+ cos(- 2*z + 2*x - pi) + cos( 2*z - 2*x - pi)+ cos( 2*z + 2*x - pi) + cos(- 2*z - 2*x - pi)) - 0.69'",0,{-$2},{-$2},{-$2},$2,$2,$2,$1,$1,$1 +c3d. n3d. => [3D\ gyroid] +#@cli histogram3d +#@cli : Get 3D color histogram of selected images. +#@cli : $ image.jpg resize2dx 64 histogram3d circles3d 3 opacity3d. 0.75 colorcube3d primitives3d[-1] 1 add3d +histogram3d : +e[^-1] "Get 3D color histogram of image$?." +to_rgb +foreach { +r {wh},3,1,1,-1 pointcloud 1 n 0,255 palette hot point. 0,0,0,1,0 map.. . rm. pointcloud3d => "[3D histogram]" +} +#@cli image6cube3d +#@cli : Generate 3D mapped cubes from 6-sets of selected images. +#@cli : $ image.jpg animate flower,"30,0","30,5",6 image6cube3d +image6cube3d : +e[^-1] "Generate 3D mapped cubes from image$?." +M:=max(${-max_wh}) r $M,$M,1,3 imageplane3d n3d c3d +repeat int($!/6) { l[$>-{$>+5}] { ++3d[0] 0,0,-0.5 +r3d[1] 0,1,0,90 +3d[1] -0.5,0,0 +r3d[2] 0,1,0,180 +3d[2] 0,0,0.5 +r3d[3] 0,1,0,270 +3d[3] 0.5,0,0 +r3d[4] 1,0,0,90 +3d[4] 0,0.5,0 +r3d[5] 1,0,0,270 +3d[5] 0,-0.5,0 ++3d => "[3D image cube]" +} } +#@cli imageblocks3d : _maximum_elevation,_smoothness[%]>=0 +#@cli : Generate 3D blocks from selected images. +#@cli : Transparency of selected images is taken into account. +#@cli : Default values: 'maximum_elevation=10' and 'smoothness=0'. +#@cli : $ image.jpg resize2dy 32 imageblocks3d -20 mode3d 3 +imageblocks3d : check ${2=0}>=0 skip ${1=10},${3=0} +e[^-1] "Generate 3D blocks from image$?, with maximum elevation $1 and smoothness $2." +foreach { +w,h={w},{h} +split_opacity to_rgb[0] is_opacity:=$!==2 +l[] { +box3d 1,1,0 +repeat $w-1 { ++3d. 1,0,0 } +3d +repeat $h-1 { ++3d. 0,1,0 } +3d +} +s3d. ++norm[0] b. $2 +y. n. 0,$1 +r[-5] 24,{-5,round(w*h/24)},1,1,-1 +if $1<0 j[-5] .,2 j[-5] .,5 j[-5] .,8 j[-5] .,11 +else j[-5] .,14 j[-5] .,17 j[-5] .,20 j[-5] .,23 +fi +rm. y[-4] +rm.. r[0] {0,wh},1,1,100%,-1 permute[0] cxyz r[0] 600%,100%,1,1,0,2 y[0] mv[0] -1 +if $is_opacity rm. mv[0] $! /. 255 y. r. 6,100%,1,1 y. fi +a y +} +#@cli imagecube3d +#@cli : Generate 3D mapped cubes from selected images. +#@cli : $ image.jpg imagecube3d +imagecube3d : +e[^-1] "Generate 3D mapped cubes from image$?." +slices 50% to_rgb +foreach { +nm={n} +i.. (67.5;73.5;109.5;103.5;51.5;100.5;\ +8;6;\ +-0.5;-0.5;-0.5;\ +0.5;-0.5;-0.5;0.5;0.5;-0.5;-0.5;0.5;-0.5;-0.5;-0.5;0.5;0.5;-0.5;0.5;0.5;0.5;0.5;-0.5;0.5;0.5;12;0;3;2;1;0;0;0;{h};{w};{h};{w};0;\ +12;1;2;6;5;0;0;0;{h};{w};{h};{w};0;12;5;6;7;4;0;0;0;{h};{w};{h};{w};0;12;4;7;3;0;0;0;0;{h};{w};{h};{w};0;12;4;0;1;5;0;0;0;{h};{w};{h};{w};0;12;3;7;6;2;0;0;0;{h};{w};{h};{w};0;-128;{w};{h};{s}) +y. +(-128;0;0;0;-128;0;0;0;-128;0;0;0;-128;0;0;0;-128;0;0;0;1;1;1;1;1;1) +a y => $nm +} +#@cli imageplane3d +#@cli : Generate 3D mapped planes from selected images. +#@cli : $ image.jpg imageplane3d +imageplane3d : +e[^-1] "Generate 3D mapped planes from image$?." +slices 50% to_color +foreach { +w,h,s,w1,h1={w},{h},{s},{w-1},{h-1} +nm={n} +i.. (67.5;73.5;109.5;103.5;51.5;100.5;\ +4;1;\ +0;0;0;\ +$w;0;0;$w;$h;0;0;$h;0;12;0;3;2;1;0;0;0;$h1;$w1;$h1;$w1;0;\ +-128;$w;$h;$s) +y. +(1) +a y => $nm +} +#@cli imagepyramid3d +#@cli : Generate 3D mapped pyramids from selected images. +#@cli : $ image.jpg imagepyramid3d +imagepyramid3d : +e[^-1] "Generate 3D mapped pyramids from image$?." +to_rgb +foreach { +nm={n} w2:=w/2 +i.. (67.5;73.5;109.5;103.5;51.5;100.5;\ +5;5;\ +-0.5;-0.5;-0.5;\ +0.5;-0.5;-0.5;0.5;0.5;-0.5;-0.5;0.5;-0.5;0;0;0.5;12;0;3;2;1;0;0;0;{h};{w};{h};{w};0;\ +9;0;4;3;0;{h};$w2;0;{w};{h};9;1;4;0;0;{h};$w2;0;{w};{h};9;2;4;1;0;{h};$w2;0;{w};{h};9;3;4;2;0;{h};$w2;0;{w};{h};-128;{w};{h};{s}) +y. +(-128;0;0;0;-128;0;0;0;-128;0;0;0;-128;0;0;0;1;1;1;1;1) +a y => $nm +} +#@cli imagerubik3d : _xy_tiles>=1,0<=xy_shift<=100,0<=z_shift<=100 +#@cli : Generate 3D mapped rubik's cubes from selected images. +#@cli : Default values: 'xy_tiles=3', 'xy_shift=5' and 'z_shift=5'. +#@cli : $ image.jpg imagerubik3d , +imagerubik3d : check "${1=3}>=1 && ${2=5}>=0 && $2<=100 && ${3=5}>=0 && $3<=100" +e[^-1] "Generate 3D mapped rubik\47s cubes from image$? with $1 xy-tiles, xy-shift $2 and z-shift $3." +foreach { +nm={n} +('CImg3d') +. 0.5 +(8,5) +(0,0,0;100,0,0;100,100,0;0,100,0;$2,$2,{-$3};{100-$2},$2,{-$3};{100-$2},{100-$2},{-$3};$2,{100-$2},{-$3}) +(4,4,7,6,5;4,0,4,5,1;4,3,2,6,7;4,0,3,7,4;4,1,5,6,2) +3,5,1,1,200 +1,5,1,1,1 +y[-6--1] a[-6--1] y +repeat $1-1 { ++3d. 100 } +3d[-$1--1] +repeat $1-1 { ++3d. 0,100 } +3d[-$1--1] +t3d. .. rm.. +/3d. $1 -3d. 50,50,50 ++r3d. 0,1,0,-90 +r3d. 0,1,0,-90 +r3d. 0,1,0,-90 ++r3d. 0,0,1,-90 +r3d. 0,0,1,180 ++3d => $nm +} +#@cli imagesphere3d : _resolution1>=3,_resolution2>=3 +#@cli : Generate 3D mapped sphere from selected images. +#@cli : Default values: 'resolution1=32' and 'resolutions2=16'. +#@cli : $ image.jpg imagesphere3d 32,16 +imagesphere3d : check "${1=32}>=3 && ${2=16}>=3" +e[^-1] "Generate 3D mapped sphere from image$?, with resolutions ($1,$2)." +to_rgb +foreach { +nm={n} +tw,th:=[w,h]-1 +nbv:=2+$1*($2-2) +nbp:=$1*($2-1) +(67.5;73.5;109.5;103.5;51.5;100.5;\ +$nbv;$nbp) +(0;0;1) (0;0;-1) (0,{2*pi};0,{2*pi}^0,0;{pi},{pi}) +r. {$1+1},$2,1,2,3 z. 0,1,{w-2},{h-2} s. c ++sin. +sin... *[-2,-1] +cos.. sin... cos[-4] *[-4,-3] +a[-3--1] c permute. cxyz y. a[-3--1] y +repeat $1 { v=$> +tx0:=$v*$tw/$1 tx1:=($v+1)*$tw/$1 ty1:=$th/($2-1) +(9;0;{2+$v};{2+($v+1)%$1};{$tw/2};0;$tx0;$ty1;$tx1;$ty1) +repeat $2-3 { u=$> +ty0=$ty1 ty1:=($u+2)*$th/($2-1) i0:=2+$u*$1+$v i1:=2+$u*$1+($v+1)%$1 +(12;$i0;{$i0+$1};{$i1+$1};$i1;$tx0;$ty0;$tx0;$ty1;$tx1;$ty1;$tx1;$ty0) +} +(9;1;{2+$1*($2-3)+($v+1)%$1};{2+$1*($2-3)+$v};{$tw/2};$th;$tx1;$ty1;$tx0;$ty1) +} +a[-$nbp--1] y +mv[-4] $! i.. (-128;{w};{h};3) y. 1,{4*($nbp-1)},1,1,-128,0,0,0 1,$nbp,1,1,1 a y => $nm +} +#@cli isoline3d : isovalue[%] : 'formula',value,_x0,_y0,_x1,_y1,_size_x>0[%],_size_y>0[%] : (+) +#@cli : Extract 3D isolines with specified value from selected images or from specified formula. +#@cli : Default values: 'x0=y0=-3', 'x1=y1=3' and 'size_x=size_y=256'. +#@cli : $ image.jpg blur 1 isoline3d 50% +#@cli : $ isoline3d 'X=x-w/2;Y=y-h/2;(X^2+Y^2)%20',10,-10,-10,10,10 +#@cli isosurface3d : isovalue[%] : 'formula',value,_x0,_y0,_z0,_x1,_y1,_z1,_size_x>0[%],_size_y>0[%],_size_z>0[%] : (+) +#@cli : Extract 3D isosurfaces with specified value from selected images or from specified formula. +#@cli : Default values: 'x0=y0=z0=-3', 'x1=y1=z1=3' and 'size_x=size_y=size_z=32'. +#@cli : $ image.jpg resize2dy 128 luminance threshold 50% expand_z 2,0 blur 1 isosurface3d 50% mul3d 1,1,30 +#@cli : $ isosurface3d 'x^2+y^2+abs(z)^abs(4*cos(x*y*z*3))',3 +#@cli label3d : "text",font_height>=0,_opacity,_color1,... +#@cli : Generate 3D text label. +#@cli : Default values: 'font_height=13', 'opacity=1' and 'color=255,255,255'. ++label3d : check ${2=13}>=0 skip ${3=1},${4=255},${5=$4},${6=$5} +e[^-1] "Generate 3D label '$1' with font height $2, opacity $3 and color (${4--1})." +l[] { 0 t "$1",0,0,$2,1,${4--1},255 sprite3d } +#@cli label_points3d : _label_size>0,_opacity +#@cli : Add a numbered label to all vertices of selected 3D objects. +#@cli : Default values: 'label_size=13' and 'opacity=0.8'. +#@cli : $ torus3d 100,40,6,6 label_points3d 23,1 mode3d 1 +label_points3d : check ${1=13}>0 skip ${2=0.8} +e[^-1] "Label vertices of 3D object$?." +repeat $! { ++p3d[$>] 0 l. { +s3d rm[-3--1] +nbp={-2,@0} =.. $nbp,0,1 +(1,0;1,{$nbp-1}) r. 2,$nbp,1,1,3 r. 1,{2*h},1,1,-1 +repeat $nbp { +0 t. $>,0,0,$1,1,255,255,255 autocrop. 0 +i.. (-128;{w};{h};3) y. +} +repeat $nbp { +0 t. $>,0,0,$1,1,$2 autocrop. 0 +i.. (-128;{w};{h};1) y. +} +a y +} ++3d[$>,-1] +} +#@cli lathe3d : _resolution>0,_smoothness[%]>=0,_max_angle>=0 +#@cli : Generate 3D object from selected binary XY-profiles. +#@cli : Default values: 'resolution=128', 'smoothness=0.5%' and 'max_angle=361'. +#@cli : $ 300,300 rand -1,1 blur 40 sign normalize 0,255 lathe3d , +lathe3d : check "${1=128}>0 && ${2=0.5%}>=0 && ${3=361}>=0" +e[^-1] "Generate lathed 3D object from XY-profile$?, with resolution $1, smoothness $2 and maximum angle $3 deg." +tmax:=($3-180)*pi/180 round norm n 0,1 autocrop 0 +foreach { +wr:=max(1,w2=2*w;w2>h?min($1,w2):min($1,h)*w2/h) +hr:=max(1,w2=2*w;w2>h?min($1,w2)*h/w2:min($1,h)) +rmax:=sqrt(($wr)^2+($hr)^2)/2 +$wr,1,$wr,1,"xc = x - w/2; zc = z - d/2; t = atan2(zc,xc); t>"$tmax"?"$rmax":sqrt(xc*xc+zc*zc)" +*. {2*({-2,w}-1)/(w-1)} r. $wr,$hr,$wr +(0;{{-2,h}-1}) r. $wr,$hr,$wr,1,3 a[-2--1] c +warp.. .,0,1,0 rm. +expand_xyz 10,0 b $2 isosurface3d 50% rv3d +} +#@cli l3d : eq. to 'light3d'. : (+) +#@cli light3d : position_x,position_y,position_z : [texture] : (no arg) : (+) +#@cli : Set the light coordinates or the light texture for 3D rendering. +#@cli : (eq. to 'l3d').\n +#@cli : (no arg) resets the 3D light to default. +#@cli : $ torus3d 100,30 double3d 0 specs3d 1.2 repeat 5 { light3d {$>*100},0,-300 +snapshot3d[0] 400 } remove[0] +#@cli line3d : x0,y0,z0,x1,y1,z1 +#@cli : Input 3D line at specified coordinates. +#@cli : $ repeat 100 { a:=$>*pi/50 line3d 0,0,0,{cos(3*$a)},{sin(2*$a)},0 color3d. ${-rgb} } add3d ++line3d : +e[^-1] "Input 3D line (${1-3})-(${4-6})." +1,21,1,1,67.5,73.5,109.5,103.5,51.5,100.5,2,1,${1-6},2,0,1,200,200,200,1 => [3D\ line] +#@cli lissajous3d : resolution>1,a,A,b,B,c,C +#@cli : Input 3D lissajous curves `x(t)=sin(a*t+A*2*pi)`, `y(t)=sin(b*t+B*2*pi)`, `z(t)=sin(c*t+C*2*pi)`. +#@cli : Default values: 'resolution=1024', 'a=2', 'A=0', 'b=1', 'B=0', 'c=0' and 'C=0'. +#@cli : $ lissajous3d , ++lissajous3d : check "isint(${1=1024}) && $1>1" skip ${2=2},${3=0},${4=1},${5=0},${6=0},${7=0} +e[^-1] "Input 3D lissajous curve, with resolution $1, (a,A)=($2,$3), (b,B)=($4,$5) and (c,C)=($6,$7)." +curve3d[] "const pi2 = 2*pi; sin($2*t + $3*pi2)","sin($4*t + $5*pi2)","sin($6*t + $7*pi2)",0,$1,0,{2*pi} +=> [3D\ lissajou] +#@cli m3d : eq. to 'mode3d'. +m3d : +l[] { check "isint(${1=4}) && inrange($1,-1,5)" mode=$1 onfail noarg mode=4 } +v + _mode3d $mode +#@cli mode3d : _mode +#@cli : Set static 3D rendering mode. +#@cli : (eq. to 'm3d').\n +#@cli : 'mode' can be { -1:bounding-box | 0:dots | 1:wireframe | 2:flat | 3:flat-shaded | 4:gouraud-shaded | 5:phong-shaded }. +#@cli : Bounding-box mode ('mode==-1') is active only for the interactive 3D viewer. +#@cli : Default value: 'mode=4'. +#@cli : $ (0,1,2,3,4,5) double3d 0 repeat w { torus3d 100,30 rotate3d[-1] 1,1,0,60 mode3d {0,@$>} snapshot3d[-1] 300 } remove[0] +mode3d : +l[] { check "isint(${1=4}) && inrange($1,-1,5)" mode=$1 onfail noarg mode=4 } +v + _$0 $mode +_mode3d : +if $^>=0 +s0,s1,s2,s3,s4,s5,s6=bounding-box,dots,wireframe,flat,flat-shaded,gouraud-shaded,phong-shaded +e[0--4] "Set static 3D rendering mode to "${s{$1+1}}"." +fi +_mode3d=$1 +#@cli md3d : eq. to 'moded3d'. +md3d : +l[] { check "isint(${1=-1}) && inrange($1,-1,5)" mode=$1 onfail noarg mode=-1 } +v + _moded3d $mode +#@cli moded3d : _mode +#@cli : Set dynamic 3D rendering mode for interactive 3D viewer. +#@cli : (eq. to 'md3d').\n +#@cli : 'mode' can be { -1:bounding-box | 0:dots | 1:wireframe | 2:flat | 3:flat-shaded | 4:gouraud-shaded | 5:phong-shaded }. +#@cli : Default value: 'mode=-1'. +moded3d : +l[] { check "isint(${1=-1}) && inrange($1,-1,5)" mode=$1 onfail noarg mode=-1 } +v + _$0 $mode +_moded3d : +if $^>=0 +s0,s1,s2,s3,s4,s5,s6=bounding-box,dots,wireframe,flat,flat-shaded,gouraud-shaded,phong-shaded +e[0--4] "Set dynamic 3D rendering mode to "${s{$1+1}}"." +fi +_moded3d=$1 +#@cli *3d : eq. to 'mul3d'. : (+) +#@cli mul3d : factor : factor_x,factor_y,_factor_z : (+) +#@cli : Scale selected 3D objects isotropically or anisotropically, with specified factors. +#@cli : (eq. to '*3d'). +#@cli : Default value: 'factor_z=1'. +#@cli : $ torus3d 5,2 repeat 5 { +add3d[-1] 10,0,0 mul3d[-1] 1.2 color3d[-1] ${-rgb} } add3d +#@cli n3d : eq. to 'normalize3d'. +n3d : +_normalize3d +#@cli normalize3d +#@cli : Normalize selected 3D objects to unit size. +#@cli : (eq. to 'n3d'). +#@cli : $ repeat 100 { circle3d {u(3)},{u(3)},{u(3)},0.1 } add3d color3d[-1] 255,0,0 +normalize3d[-1] color3d[-1] 0,255,0 add3d +normalize3d : +_$0 +_normalize3d : +e[0--3] "Normalize size of 3D object$?." +check3d foreach { +if i[6] +s3d r[2] 3,{2,h/3},1,1,-1 s[2] x +factor:=v=max({2,iM-im},{3,iM-im},{4,iM-im});v?v:1 +a[2-4] x /[2] $factor y[2] a y +fi +} +#@cli o3d : eq. to 'opacity3d'. +o3d : +_gmic_s="$?" v + _opacity3d $* +#@cli opacity3d : opacity +#@cli : Set opacity of selected 3D objects. +#@cli : (eq. to 'o3d'). +#@cli : $ torus3d 100,10 double3d 0 repeat 7 { +rotate3d[-1] 1,0,0,20 opacity3d[-1] {u} } add3d +opacity3d : +_gmic_s="$?" v + _$0 $* +_opacity3d : +e[0--3] "Set opacity of 3D object"$_gmic_s" to $1." +foreach { +nbv,nbp:=f2ui([i[6],i[7]]) $nbp +eval. ">begin(p = 8 + 3*$nbv); p+=i[#0,p] + 1; end(set('p',p))" # Find beginning of color data +eval. ">begin(p = $p); i[#0,p]==-128?(p+=prod(crop(#0,0,++p,1,3))); p+=3; end(set('p',p))" # Skip color data +eval. ">begin(p = $p; const o = $1); i[#0,p]==-128?(p+=3 + prod(crop(#0,0,++p,1,3))):(i[#0,p++] = o)" +k[0] +} +#@cli parametric3d : _x(a,b),_y(a,b),_z(a,b),_amin,_amax,_bmin,_bmax,_res_a>0,_res_b>0,_res_x>0,_res_y>0,_res_z>0,_smoothness>=0,_isovalue>=0 +#@cli : Input 3D object from specified parametric surface `(a,b) ⟶ (x(a,b),y(a,b),z(a,b))`. +#@cli : Default values: 'x=(2+cos(b))*sin(a)', 'y=(2+cos(b))*cos(a)', 'c=sin(b)', 'amin=-pi', 'amax=pi', 'bmin=-pi', 'bmax=pi', 'res_a=512', 'res_b=res_a', 'res_x=64', 'res_y=res_x', 'res_z=res_y', 'smoothness=2%' and 'isovalue=10%'. +#@cli : $ parametric3d , ++parametric3d : skip "${1=(2+cos(b))*sin(a)}","${2=(2+cos(b))*cos(a)}","${3=sin(b)}" +skip ${4={-pi}},${5={pi}},${6={-pi}},${7={pi}} +check "${8=512}>0 && ${9=$8}>0 && ${10=64}>0 && ${11=$10}>0 && ${12=$11}>0 && ${13=2%}>=0 && ${14=10%}>=0" +e[^-1] "Input 3D object from parametric surface ($1,$2,$3)." +($4,$5;$4,$5^$6,$6;$7,$7) r. $8,$9,1,2,3 channels. 0,2 +f. "a=i(x,y,0,0);b=i(x,y,0,1);!c?$1:c==1?$2:$3" +sh. 0 xmin,xmax:=im,iM n. 16,{$10-17} rm. +sh. 1 ymin,ymax:=im,iM n. 16,{$11-17} rm. +sh. 2 zmin,zmax:=im,iM n. 16,{$12-17} rm. +r. {w*h},3,1,1,-1 +pointcloud. 1 r. $10,$11,$12,1,0 b. $13,0 +isosurface3d. $14 +c3d. n3d. *3d. {$xmax-$xmin},{$ymax-$ymin},{$zmax-$zmin} => [3D\ parametric] +#@cli pca_patch3d : _patch_size>0,_M>0,_N>0,_normalize_input={ 0 | 1 },_normalize_output={ 0 | 1 },_lambda_xy +#@cli : Get 3D patch-pca representation of selected images. +#@cli : The 3D patch-pca is estimated from M patches on the input image, and displayed as a cloud of N 3D points. +#@cli : Default values: 'patch_size=7', 'M=1000', 'N=3000', 'normalize_input=1', 'normalize_output=0', and 'lambda_xy=0'. +#@cli : $ image.jpg pca_patch3d 7 +pca_patch3d : check "isint(${1=7}) && $1>0 && isint(${2=1000}) && $2>0 && isint(${3=3000}) && $3>0" +skip ${4=1},${5=0},${6=0} +e[^-1] "Get 3D patch-pca representation"${arg0\ ($!>1),s,""}" of image$?, from $2 $1x$1 input patches, +with $3 output patches, input normalization "${arg0\ !$4,enabled,disabled}", output normalization "${arg0\ !$5,enabled,disabled}" and lambda_xy $6." +P1:=int($1/2) +P2:=$1-$P1-1 +n 0,255 round 1 +foreach { +nm={n} s:=s +1,$2 rand. 0,{0,w-1} +rand. 0,{0,h-1} +f. 0 a[-3--1] x round. 1 +patches[0] $1,$1,1,{^} y[2--1] a[2--1] x +z[1] 0,1 transpose[1] *[1] $6 a[1,2] y s[^0] x +++[^0] /. $2 -[1--2] . rm. +a[^0] x +if $4 l. { s y / 'sqrt(1e-8+iv)' a y } fi ++transpose. m*[-2,-1] +eigen. rows.. 0,2 columns. 0,2 transpose. +if $5 sqrt.. /.. {-2,iM} ri.. . /. .. fi +rm.. +repeat $3 { +x:=round(u({0,w})) +y:=round(u({0,h})) +({$6*$x};{$6*$y}) ++z[0] {$x-$P1},{$y-$P1},{$x+$P2},{$y+$P2},1 +y. a[-2,-1] y +} ++a[2--1] x m*[1,-1] transpose[1] +rows[2--1] 2,100% +if $s!=3 +r[2--1] $1,$1,1,{min(3,$s)},-1 +r[2--1] $1,$1,1,3,{$s==1} +y[2--1] +fi +i[2--2] (-128;$1;$1;3) a[2--1] y +rm[0] +i[0] ('CImg3d') +i[1] ($3;$3) +i[3] 2,$3,1,1,x?y:1 +1,$3,1,1,1 +y a[-6--1] y +=> $nm +} +#@cli plane3d : _size_x,_size_y,_nb_subdivisions_x>0,_nb_subdisivions_y>0 +#@cli : Input 3D plane at (0,0,0), with specified geometry. +#@cli : Default values: 'size_x=1', 'size_y=size_x' and 'nb_subdivisions_x=nb_subdivisions_y=24'. +#@cli : $ plane3d 50,30 +primitives3d 1 color3d[-2] ${-rgb} ++plane3d : check "${3=24}>0 && ${4=24}>0" skip ${1=1},${2=$1} +e[^-1] "Input 3D plane, with size (${1,2}) and subdivisions (${3,4})." +{$3+1},{$4+1} elevation3d. 0 *3d. {$1/$3},{$2/$4} col3d. 200 => [3D\ plane] +#@cli point3d : x0,y0,z0 +#@cli : Input 3D point at specified coordinates. +#@cli : $ repeat 1000 { a:=$>*pi/500 point3d {cos(3*$a)},{sin(2*$a)},0 color3d[-1] ${-rgb} } add3d ++point3d : +e[^-1] "Input 3D point ($1,$2,$3)." +1,17,1,1,67.5,73.5,109.5,103.5,51.5,100.5,1,1,${1-3},1,0,200,200,200,1 => [3D\ point] +#@cli pointcloud3d +#@cli : Convert selected planar or volumetric images to 3D point clouds. +#@cli : $ image.jpg luminance resize2dy 100 threshold 50% mul 255 pointcloud3d color3d[-1] 255,255,255 +pointcloud3d : +e[^-1] "Convert image$? to 3D point cloud." +foreach { +nm={n} s z +foreach { ++norm !=. 0 +i.. (1,{w};1,{w}^1,1;{h},{h}) r.. .,.,1,2,3 *[-2,-1] round. permute. cxyz +l. { s -,0 a y is_points=$! } +if $is_points +-. 1 r. 2,{h/2},1,1,-1 permute. cyzx +warp.. .,0,0,1 rm... +permute.. cyzx i.. 1,{h},1,1,$> a[-3,-2] x +i... ('CImg3d') i... ({h},{h}) +i.. 1,{h},1,1,1 i.. 1,{h},1,1,y a[-3,-2] x +permute. cyzx +if w==1 r. 3,{h},1,1 +elif w>3 i.. 4,{h},1,1,-128,1,1,{w} a[-2,-1] x +else r. 3,{h},1,1,0 +fi +1,{h},1,1,1 +y[-6--1] a[-6--1] y +else rm empty3d +fi +} ++3d => $nm +} +#@cli pose3d : p1,...,p12 +#@cli : Apply 3D pose matrix to selected 3D objects. +#@cli : $ torus3d 100,20 pose3d 0.152437,1.20666,-0.546366,0,-0.535962,0.559129,1.08531,0,1.21132,0.0955431,0.548966,0,0,0,-206,1 snapshot3d 400 +pose3d : +e[^-1] "Apply 3D pose matrix [ $1,$2,$3,$4; $5,$6,$7,$8; $9,$10,$11,$12 ] to 3D object$?." +foreach { +if ${-_is_mesh3d} +if "i[6] && i[7]" +s3d r[2] 3,{2,h/3},1,1,-1 i[3] 1,{2,h},1,1,1 a[2,3] x +i[3] ($1,$5,$9;$2,$6,$10;$3,$7,$11;$4,$8,$12) m*[2,3] +r[2] 1,{2,3*h},1,1,-1 a y +fi +else error "Command '$0': Image ["{$!-$>-1}"] does not represent a 3D object." +fi +} +#@cli p3d : eq. to 'primitives3d'. +p3d : check "isint($1) && inrange($1,0,2)" +_gmic_s="$?" v + _primitives3d $* +#@cli primitives3d : mode +#@cli : Convert primitives of selected 3D objects. +#@cli : (eq. to 'p3d').\n +#@cli : 'mode' can be { 0:points | 1:outlines | 2:non-textured }. +#@cli : $ sphere3d 30 primitives3d 1 torus3d 50,10 color3d[-1] ${-rgb} add3d +primitives3d : check "isint($1) && inrange($1,0,2)" +_gmic_s="$?" v + _$0 $* +_primitives3d : +s0,s1,s2=points,segments,non-textured +e[0--3] "Convert primitives of 3D object"$_gmic_s" to "$s$1"." +check3d foreach { +s3d nbv,nbp={1,f2ui(crop())} +r[2] 3,{2,h/3},1,1,-1 permute[2] zycx ($nbv) a[2,-1] y +tmp=$! $nbp eval. ">begin(p = N = 0); +i[#4,p++]==-128?( +W = i[#4,p++]; H = i[#4,p++]; S = i[#4,p++]; WHS = W*H*S; +WHS?(run('+z[4] 0,',p,',0,',p + WHS - 1,' r. ',W,',',H,',1,',S,',-1 => tx',N); p+=WHS); +):(p+=2); +++N" rm[$tmp] +1x3 => prims,cols,opacs +$nbp eval. "> +begin( +const mode = $1; +pp = pc = po = 0; +M = N = 0; +RGB0 = RGB1 = RGB2 = RGB3 = [ 0,0,0 ]; +refc = vector(#$nbp); # Correspondence old -> new indices for shared textures +add_colored_point(i,R,G,B,O) = ( +vname = string(#24,'pt',i); +isnan(get(vname))?( +da_push(#$prims,1,ui2f(i)); +da_push(#$cols,R,G,B); +da_push(#$opacs,O); +set(vname,1); +++N; +); +); +add_colored_segment(i0,i1,R,G,B,O) = ( +vname = string(#24,'seg',min(i0,i1),'_',max(i0,i1)); +isnan(get(vname))?( +da_push(#$prims,2,ui2f(i0),ui2f(i1)); +da_push(#$cols,R,G,B); +da_push(#$opacs,O); +set(vname,1); +++N; +); +); +add_textured_segment(i0,i1,tx0,ty0,tx1,ty1) = ( +vname = string(#24,'seg',min(i0,i1),'_',max(i0,i1)); +isnan(get(vname))?( +da_push(#$prims,6,ui2f(i0),ui2f(i1),tx0,ty0,tx1,ty1); +!is_shared_texture?( +da_push(#$cols,-128,wc,hc,sc); +off = da_size(#$cols); +resize(#$cols,1,h(#$cols) + whsc,1,1,0); +copy(i[#$cols,off],i[#ind_texture,0],whsc); +i[#$cols,h(#$cols) - 1] = off + whsc; +is_shared_texture = 1; +refc[M] = N; +wc = M; +):da_push(#$cols,-128,ui2f(refc[wc]),0,0); # Shared texture +da_push(#$opacs,O); +set(vname,1); +++N; +); +); +); +n = i[#3,pp++]; # Type of primitive +ind_texture = -1; R = i[#4,pc++]; +R==-128?( +wc = i[#4,pc++]; hc = i[#4,pc++]; sc = i[#4,pc++]; whsc = wc*hc*sc; +is_shared_texture = !whsc; vname = string(#24,'tx',whsc?M:wc); ind_texture = get(vname); pc+=whsc; +wt1 = w#ind_texture - 1; ht1 = h#ind_texture - 1; +R = G = B = 200; +):(G = i[#4,pc++]; B = i[#4,pc++]); +O = i[#5,po++]; +O==-128?( +wo = i[#5,po++]; ho = i[#5,po++]; so = i[#5,po++]; whso = wo*ho*so; po+=whso; +O = 1; +); +n==1?( +i0 = f2ui(i[#3,pp++]); +add_colored_point(i0,R,G,B,O); +):n==2?( +i0 = f2ui(i[#3,pp++]); i1 = f2ui(i[#3,pp++]); +!mode?(add_colored_point(i0,R,G,B,O); add_colored_point(i1,R,G,B,O)): +add_colored_segment(i0,i1,R,G,B,O); +):n==3?( +i0 = f2ui(i[#3,pp++]); i1 = f2ui(i[#3,pp++]); i2 = f2ui(i[#3,pp++]); +!mode?(add_colored_point(i0,R,G,B,O); add_colored_point(i1,R,G,B,O); add_colored_point(i2,R,G,B,O)): +mode==1?(add_colored_segment(i0,i1,R,G,B,O); add_colored_segment(i1,i2,R,G,B,O); +add_colored_segment(i2,i0,R,G,B,O)): +(da_push(#$prims,3,ui2f(i0),ui2f(i1),ui2f(i2)); da_push(#$cols,R,G,B); da_push(#$opacs,O); ++N); +):n==4?( +i0 = f2ui(i[#3,pp++]); i1 = f2ui(i[#3,pp++]); i2 = f2ui(i[#3,pp++]); i3 = f2ui(i[#3,pp++]); +!mode?(add_colored_point(i0,R,G,B,O); add_colored_point(i1,R,G,B,O); +add_colored_point(i2,R,G,B,O); add_colored_point(i3,R,G,B,O)): +mode==1?(add_colored_segment(i0,i1,R,G,B,O); add_colored_segment(i1,i2,R,G,B,O); +add_colored_segment(i2,i3,R,G,B,O); add_colored_segment(i3,i0,R,G,B,O)): +(da_push(#$prims,4,ui2f(i0),ui2f(i1),ui2f(i2),ui2f(i3)); da_push(#$cols,R,G,B); da_push(#$opacs,O); ++N); +):n==5?( +i0 = f2ui(i[#3,pp++]); i1 = f2ui(i[#3,pp++]); is_outlined = i[#3,pp]; pp+=3; +!mode?( +P0 = I[#2,i0]; P1 = I[#2,i1]; nind = da_size(#2); da_push(#2,(P0 + P1)/2); +add_colored_point(nind,R,G,B,O); +):( +da_push(#$prims,5,ui2f(i0),ui2f(i1),mode==1?1:is_outlined,0,0); da_push(#$cols,R,G,B); da_push(#$opacs,O); +++N; +); +):n==6?( +i0 = f2ui(i[#3,pp++]); i1 = f2ui(i[#3,pp++]); +tx0 = cut(i[#3,pp++],0,wt1); ty0 = cut(i[#3,pp++],0,ht1); +tx1 = cut(i[#3,pp++],0,wt1); ty1 = cut(i[#3,pp++],0,ht1); +!mode?( +copy(RGB0,i(#ind_texture,tx0,ty0,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB1,i(#ind_texture,tx1,ty1,0,0),min(3,s#ind_texture),1,wh#ind_texture); +add_colored_point(i0,RGB0[0],RGB0[1],RGB0[2],O); +add_colored_point(i1,RGB1[0],RGB1[1],RGB1[2],O); +):mode==1?add_textured_segment(i0,i1,tx0,ty0,tx1,ty1):( +da_push(#$prims,2,ui2f(i0),ui2f(i1)); +copy(RGB0,i(#ind_texture,tx0,ty0,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB1,i(#ind_texture,tx1,ty1,0,0),min(3,s#ind_texture),1,wh#ind_texture); +(RGB0+=RGB1)/=2; +da_push(#$cols,RGB0[0],RGB0[1],RGB0[2]); +da_push(#$opacs,O); +++N; +); +):n==9?( +i0 = f2ui(i[#3,pp++]); i1 = f2ui(i[#3,pp++]); i2 = f2ui(i[#3,pp++]); +tx0 = cut(i[#3,pp++],0,wt1); ty0 = cut(i[#3,pp++],0,ht1); +tx1 = cut(i[#3,pp++],0,wt1); ty1 = cut(i[#3,pp++],0,ht1); +tx2 = cut(i[#3,pp++],0,wt1); ty2 = cut(i[#3,pp++],0,ht1); +!mode?( +copy(RGB0,i(#ind_texture,tx0,ty0,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB1,i(#ind_texture,tx1,ty1,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB2,i(#ind_texture,tx2,ty2,0,0),min(3,s#ind_texture),1,wh#ind_texture); +add_colored_point(i0,RGB0[0],RGB0[1],RGB0[2],O); +add_colored_point(i1,RGB1[0],RGB1[1],RGB1[2],O); +add_colored_point(i2,RGB2[0],RGB2[1],RGB2[2],O); +):mode==1?( +add_textured_segment(i0,i1,tx0,ty0,tx1,ty1); +add_textured_segment(i1,i2,tx0,ty0,tx2,ty2); +add_textured_segment(i2,i0,tx2,ty2,tx0,ty0); +):( +da_push(#$prims,3,ui2f(i0),ui2f(i1),ui2f(i2)); +copy(RGB0,i(#ind_texture,tx0,ty0,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB1,i(#ind_texture,tx1,ty1,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB2,i(#ind_texture,tx2,ty2,0,0),min(3,s#ind_texture),1,wh#ind_texture); +(RGB0+=RGB1+=RGB2)/=3; +da_push(#$cols,RGB0[0],RGB0[1],RGB0[2]); +da_push(#$opacs,O); +++N; +); +):n==12?( +i0 = f2ui(i[#3,pp++]); i1 = f2ui(i[#3,pp++]); i2 = f2ui(i[#3,pp++]); i3 = f2ui(i[#3,pp++]); +tx0 = cut(i[#3,pp++],0,wt1); ty0 = cut(i[#3,pp++],0,ht1); +tx1 = cut(i[#3,pp++],0,wt1); ty1 = cut(i[#3,pp++],0,ht1); +tx2 = cut(i[#3,pp++],0,wt1); ty2 = cut(i[#3,pp++],0,ht1); +tx3 = cut(i[#3,pp++],0,wt1); ty3 = cut(i[#3,pp++],0,ht1); +!mode?( +copy(RGB0,i(#ind_texture,tx0,ty0,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB1,i(#ind_texture,tx1,ty1,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB2,i(#ind_texture,tx2,ty2,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB3,i(#ind_texture,tx3,ty3,0,0),min(3,s#ind_texture),1,wh#ind_texture); +add_colored_point(i0,RGB0[0],RGB0[1],RGB0[2],O); +add_colored_point(i1,RGB1[0],RGB1[1],RGB1[2],O); +add_colored_point(i2,RGB2[0],RGB2[1],RGB2[2],O); +add_colored_point(i3,RGB3[0],RGB3[1],RGB3[2],O) +):mode==1?( +add_textured_segment(i0,i1,tx0,ty0,tx1,ty1); +add_textured_segment(i1,i2,tx1,ty1,tx2,ty2); +add_textured_segment(i2,i3,tx2,ty2,tx3,ty3); +add_textured_segment(i3,i0,tx3,ty3,tx0,ty0); +):( +da_push(#$prims,4,ui2f(i0),ui2f(i1),ui2f(i2),ui2f(i3)); +copy(RGB0,i(#ind_texture,tx0,ty0,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB1,i(#ind_texture,tx1,ty1,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB2,i(#ind_texture,tx2,ty2,0,0),min(3,s#ind_texture),1,wh#ind_texture); +copy(RGB3,i(#ind_texture,tx3,ty3,0,0),min(3,s#ind_texture),1,wh#ind_texture); +(RGB0+=RGB1+=RGB2+=RGB3)/=4; +da_push(#$cols,RGB0[0],RGB0[1],RGB0[2]); +da_push(#$opacs,O); +++N; +); +):(pp+=n); +++M; +end(set('N',N)); +" rm. +da_freeze[2,prims,cols,opacs] +f[1] {2,h},$N +permute[2] cyzx y[2] rv[3,prims] rv[4,cols] rv[5,opacs] k[0-5] a y +} +#@cli projections3d : _x[%],_y[%],_z[%],_is_bounding_box={ 0 | 1 },nb_subdivisions>0 +#@cli : Generate 3D xy,xz,yz projection planes from specified volumetric images. +#@cli : Default values: 'x=y=z=50%', 'is_bounding_box=1' and 'nb_subdividions=5' +projections3d : skip "${1=50%},${2=50%},${3=50%}" check "isbool(${4=1}) && isint(${5=5}) && $5>0" +e[^-1] "Generate 3D projection planes (XY,XZ,ZY) from image$?, from point ($1,$2,$3)." +foreach { +projections3d ${1-4} k. } ++projections3d : skip "${1=50%},${2=50%},${3=50%}" check "isbool(${4=1}) && isint(${5=5}) && $5>0" +e[^-1] "Generate 3D projection planes (XY,XZ,ZY) from image$?, from point ($1,$2,$3)." +foreach { +w,h,d,x,y,z:="[ w,h,d, +cut(ispercentage($1)?$1*w:$1,0,w-1), +cut(ispercentage($2)?$2*h:$2,0,h-1), +cut(ispercentage($3)?$3*d:$3,0,d-1) ]" ++z. 0,0,$z,100%,100%,$z ++z.. 0,$y,100%,$y permute. xzyc ++z... $x,$x permute. zyxc +n[-3--1] 0,255 r[-3--1] 100%,100%,1,3 +foreach[-3--1] { plane3d {[w,h]},$5,$5 t3d. .. rm.. } ++3d... 0,0,$z +r3d.. 1,0,0,90 +3d.. 0,$y,0 +r3d. 0,1,0,-90 +3d. $x,0,0 +o3d[^0] 0.8 +if $4 box3d $w,$h,$d p3d. 1 o3d. 0.5 fi ++3d[^0] +} +mv[1--1:2] $! +#@cli pyramid3d : width,height +#@cli : Input 3D pyramid at (0,0,0), with specified geometry. +#@cli : $ pyramid3d 100,-100 +primitives3d 1 color3d[-2] ${-rgb} ++pyramid3d : +e[^-1] "Input new 3D pyramid, with width $1 and height $2." +(67.5;73.5;109.5;103.5;51.5;100.5;\ +5;5;\ +{-$1/2};{-$1/2};{-$2/2};\ +{$1/2};{-$1/2};{-$2/2};{$1/2};{$1/2};{-$2/2};{-$1/2};{$1/2};{-$2/2};0;0;{$2/2};4;0;3;2;1;\ +3;0;4;3;3;1;4;0;3;2;4;1;3;3;4;2) +1,15,1,1,200 1,5,1,1,1 a[-3--1] y => [3D\ pyramid] +#@cli quadrangle3d : x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3 +#@cli : Input 3D quadrangle at specified coordinates. +#@cli : $ quadrangle3d -10,-10,10,10,-10,10,10,10,10,-10,10,10 repeat 10 { +rotate3d[-1] 0,1,0,30 color3d[-1] ${-rgb},0.6 } add3d mode3d 2 ++quadrangle3d : +e[^-1] "Input 3D quadrangle ($1,$2,$3)-($4,$5,$6)-($7,$8,$9)-($10,$11,$12)." +1,29,1,1,67.5,73.5,109.5,103.5,51.5,100.5,4,1,${1-12},4,0,1,2,3,200,200,200,1 => [3D\ quadrangle] +#@cli random3d : nb_points>=0 +#@cli : Input random 3D point cloud in [0,1]^3. +#@cli : $ random3d 100 circles3d 0.1 opacity3d 0.5 ++random3d : check "$1>=0" +e[^-1] "Input random 3D point cloud, with $1 points." +if $1<0.5 empty3d +else l[] { +N:=round($1) +({'CImg3d'},$N,$N) +3,$N rand. 0,1 +1,$N,1,1,1 1,$N,1,1,y a[-2,-1] x +3,$N,1,1,200 1,$N,1,1,1 +y a y +} fi +=> [3D\ random\ pointcloud] +#@cli rv3d : eq. to 'reverse3d'. +rv3d : +_gmic_s="$?" v + _reverse3d +#@cli reverse3d +#@cli : Reverse primitive orientations of selected 3D objects. +#@cli : (eq. to 'rv3d'). +#@cli : $ torus3d 100,40 double3d 0 +reverse3d +reverse3d : +_gmic_s="$?" v + _$0 +_reverse3d : +e[0--3] "Reverse primitives orientation of 3D object"$_gmic_s"." +check3d foreach { +{f2ui(i[7])} eval. ">begin(p = 8 + 3*f2ui(i[#0,6])); +n = i[#0,p++]; +n==2?swap(i[#0,p],i[#0,p + 1]): +n==3?swap(i[#0,p + 1],i[#0,p + 2]): +n==4?swap(i[#0,p + 1],i[#0,p + 3]): +n==6?(swap(i[#0,p],i[#0,p + 1]); swap(i[#0,p + 2],i[#0,p + 4]); swap(i[#0,p + 3],i[#0,p + 5])): +n==9?(swap(i[#0,p + 1],i[#0,p + 2]); swap(i[#0,p + 5],i[#0,p + 7]); swap(i[#0,p + 6],i[#0,p + 8])): +n==12?(swap(i[#0,p + 1],i[#0,p + 3]); swap(i[#0,p + 6],i[#0,p + 10]); swap(i[#0,p + 7],i[#0,p + 11])); +p+=n" +rm. +} +#@cli r3d : eq. to 'rotate3d'. : (+) +#@cli rotate3d : u,v,w,angle : (+) +#@cli : Rotate selected 3D objects around specified axis with specified angle (in deg.). +#@cli : (eq. to 'r3d'). +#@cli : $ torus3d 100,10 double3d 0 repeat 7 { +rotate3d[-1] 1,0,0,20 } add3d +#@cli rotation3d : u,v,w,angle +#@cli : Input 3x3 rotation matrix with specified axis and angle (in deg). +#@cli : $ rotation3d 1,0,0,0 rotation3d 1,0,0,90 rotation3d 1,0,0,180 +rotation3d : +e[^-1] "Input 3D rotation matrix around axis ($1,$2,$3) with angle $4 deg." +3,3,1,1,{"rot(${1-4}°)"} => [3D\ rotation] +#@cli sierpinski3d : _recursion_level>=0,_width,_height +#@cli : Input 3D Sierpinski pyramid. +#@cli : $ sierpinski3d 3,100,-100 +primitives3d 1 color3d[-2] ${-rgb} ++sierpinski3d : check ${1=4}>=0 skip ${2=1},${3=1} +-e[^-1] "Input 3D Sierpinski pyramid of degree $1, with width $2 and height $3." +l[] { +_sierpinski3d {-$2/2},{-$2/2},{-$3/2},{$2/2},{-$2/2},{-$3/2},{$2/2},{$2/2},{-$3/2},{-$2/2},{$2/2},{-$3/2},0,0,{$3/2},$1 ++3d +} +=> [3D\ sierpinski] +_sierpinski3d : +if $16<=0 +(67.5;73.5;109.5;103.5;51.5;100.5;5;5;$1;$2;$3;$4;$5;$6;$7;$8;$9;$10;$11;$12;$13;$14;$15;4;0;3;2;1;3;0;4;3;3;1;4;0;3;2;4;1;3;3;4;2) +1,15,1,1,200 1,5,1,1,1 a[-3--1] y +return fi +_sierpinski3d $1,$2,$3,{($1+$4)/2},{($2+$5)/2},{($3+$6)/2},{($1+$4+$7+$10)/4},{($2+$5+$8+$11)/4},{($3+$6+$9+$12)/4},{($1+$10)/2},{($2+$11)/2},{($3+$12)/2},{($1+$13)/2},{($2+$14)/2},{($3+$15)/2},{$16-1} +_sierpinski3d {($1+$4)/2},{($2+$5)/2},{($3+$6)/2},$4,$5,$6,{($4+$7)/2},{($5+$8)/2},{($6+$9)/2},{($1+$4+$7+$10)/4},{($2+$5+$8+$11)/4},{($3+$6+$9+$12)/4},{($4+$13)/2},{($5+$14)/2},{($6+$15)/2},{$16-1} +_sierpinski3d {($1+$4+$7+$10)/4},{($2+$5+$8+$11)/4},{($3+$6+$9+$12)/4},{($4+$7)/2},{($5+$8)/2},{($6+$9)/2},$7,$8,$9,{($7+$10)/2},{($8+$11)/2},{($9+$12)/2},{($7+$13)/2},{($8+$14)/2},{($9+$15)/2},{$16-1} +_sierpinski3d {($1+$10)/2},{($2+$11)/2},{($3+$12)/2},{($1+$4+$7+$10)/4},{($2+$5+$8+$11)/4},{($3+$6+$9+$12)/4},{($7+$10)/2},{($8+$11)/2},{($9+$12)/2},$10,$11,$12,{($10+$13)/2},{($11+$14)/2},{($12+$15)/2},{$16-1} +_sierpinski3d {($1+$13)/2},{($2+$14)/2},{($3+$15)/2},{($4+$13)/2},{($5+$14)/2},{($6+$15)/2},{($7+$13)/2},{($8+$14)/2},{($9+$15)/2},{($10+$13)/2},{($11+$14)/2},{($12+$15)/2},$13,$14,$15,{$16-1} +#@cli size3d +#@cli : Return bounding box size of the last selected 3D object. +size3d : ++rows. 8,{8+3*i[6]} r. 3,{h/3},1,1,-1 s. x,3 +u {-3,iM-im},{-2,iM-im},{iM-im} +rm[-3--1] +#@cli skeleton3d : _metric,_frame_type={ 0:squares | 1:diamonds | 2:circles | 3:auto },_skeleton_opacity,_frame_opacity,_is_frame_wireframe={ 0 | 1 } +#@cli : Build 3D skeletal structure object from 2d binary shapes located in selected images. +#@cli : 'metric' can be { 0:chebyshev | 1:manhattan | 2:euclidean }. +#@cli : Default values: 'metric=2', 'bones_type=3', 'skeleton_opacity=1' and 'frame_opacity=0.1'. +#@cli : $ shape_cupid 480 +skeleton3d , +skeleton3d : check "isint(${1=2}) && $1>=0 && $1<=2 && isint(${2=3}) && $2>=0 && $2<=3" skip ${3=1},${4=0.1},${5=1} +e[^-1] "Build 3D skeletal structure object from image$?, with "${arg0\ $1,chebyshev,manhattan,euclidean}" metric, "${arg0\ $2,squares,diamonds,circles,auto}" bones, skeleton opacity $3 and frame opacity $4 ." +foreach { +channels 0 ++distance 0,$1 ++f. "(i>j(-1)&&i>j(1)) || (i>j(0,-1)&&i>j(0,1)) || (i>j(-1,-1)&&i>j(1,1)) || (i>j(-1,1)&&i>j(1,-1))" +if $3 +slices. -1,0 isosurface3d. 0.5 o3d. $3 col3d. 255,0,0 fi +*[0-2] pointcloud3d[0] +if $4 l[0] { +s3d +n={1,@0} +if $n +r[2] 3,$n,1,1,-1 r[3] 2,$n,1,1,-1 r[4] 3,$n,1,1,-1 +if !$2" || "($2==3" && "!$1) +=[1] {4*$n} +i[3] [2]x3 +z.. 0,1 z. 0,2 -[2] . +[4] . +s. x *.. -1 a[-3--1] x +[3] . -[5,-1] a[2-5] x +rm[3] 1,$n,1,1,4 +f. 4*y ++. 1 ++. 1 ++. 1 rv[-3,-1] a[-5--1] x mv. 3 +elif $2==1" || "($2==3" && "$1==1) +=[1] {4*$n} +i[3] [2]x3 +z.. 0,0 z. 0,2 -[2] . +[4] . +shift. 1,0 -[3] . +[5,-1] a[2-5] x +rm[3] 1,$n,1,1,4 +f. 4*y ++. 1 ++. 1 ++. 1 rv[-3,-1] a[-5--1] x mv. 3 +elif $2==2" || "($2==3" && "$1==2) +=[1] {2*$n} ++z[4] 0,0 z. 0,2 ++[2,-1] -[2,-2] a[2,-1] x +rm[3] 1,$n,1,1,5 +f. 2*y ++. 1 3,100% a[-4--1] x mv. 3 +fi +y a y o3d $4 if $5 p3d 1 fi col3d 200 +else rm empty3d fi +} else rm[0] fi ++3d +} +#@cli snapshot3d : _size>0,_zoom>=0,_backgroundR,_backgroundG,_backgroundB,_backgroundA,_fov_angle>=0 : [background_image],zoom>=0,_fov_angle>=0 +#@cli : Take 2D snapshots of selected 3D objects. +#@cli : Set 'zoom' to 0 to disable object auto-scaling. +#@cli : Default values: 'size=1024', 'zoom=1', '[background_image]=(default)' and 'fov_angle=45'. +#@cli : $ torus3d 100,20 rotate3d 1,1,0,60 snapshot3d 400,1.2,128,64,32 +#@cli : $ torus3d 100,20 rotate3d 1,1,0,60 sample ? +snapshot3d[0] [1],1.2 +snapshot3d : check "("${"is_image_arg $1"}" || (isint(${1=1024}) && $1>0)) && ""${2=1}>=0 && ${7=45}>=0" skip ${3=""},${4=$3},${5=$4},${6=255} +fov=$7 +if ${"is_image_arg $1"} +pass$1 0 to_color. +if isnum($3) fov=$3 fi +e[0--3] "Take "{w}"x"{h}" snapshot of 3D object$?, with background image $1, zoom factor $2 and FOV "$fov"." +elif isnum($3) +e[0--3] "Take $1x$1 snapshot of 3D object$?, with zoom factor $2, background color (${3-6}) ""and FOV "$fov"." +if $6>=255 ($3^$4^$5) else ($3^$4^$5^$6) fi +r. $1,$1 +else +e[0--3] "Take $1x$1 snapshot of 3D object$?, with zoom factor $2, default background and FOV "$fov"." +3,3,1,1,"0,0,0,0,0,100,100,0,50" permute. cyzx r. $1,$1,1,3,3 +24,24,1,1,48 +f. 64 a[-2,-1] x +mirror. x a[-2,-1] y r. {-2,[w,h]},1,3,0,2 +[-2,-1] /. 2 round. +fi +ofocale3d=$_focale3d +fov3d $fov +foreach[^-1] { +pass. 0 +if $2!=0 c3d[0] n3d[0] *3d[0] {3*min(w,h)*$2/4} fi +if s>3 +o3d[0] 1 +100%,100%,1,3,-1 j3d. [0],50%,50%,0,1 +to_rgba. replace_color. 0,0,-1,-1,-1,255,0,0,0,0 blend[-2,-1] alpha +else +j3d[1] [0],50%,50%,0,1 +fi +=>[1] {0,n} k. +} rm. +_focale3d=$ofocale3d +#@cli sl3d : eq. to 'specl3d'. +sl3d : +l[] { check "${1=0.15}>=0" value=$1 onfail noarg value=0.15 } +v + _specl3d $value +#@cli specl3d : value>=0 +#@cli : Set lightness of 3D specular light. +#@cli : (eq. to 'sl3d'). +#@cli : Default value: 'value=0.15'. +#@cli : $ (0,0.3,0.6,0.9,1.2) repeat w { torus3d 100,30 rotate3d[-1] 1,1,0,60 color3d[-1] 255,0,0 specl3d {0,@$>} snapshot3d[-1] 400 } remove[0] +specl3d : +l[] { check "${1=0.15}>=0" value=$1 onfail noarg value=0.15 } +v + _$0 $value +_specl3d : +e[0--3] "Set lightness of 3D specular light to $1." +_specl3d=$1 +#@cli ss3d : eq. to 'specs3d'. +ss3d : +l[] { check "${1=0.8}>=0" value=$1 onfail noarg value=0.8 } +v + _specs3d $value +#@cli specs3d : value>=0 +#@cli : Set shininess of 3D specular light. +#@cli : (eq. to 'ss3d'). +#@cli : Default value: 'value=0.8'. +#@cli : $ (0,0.3,0.6,0.9,1.2) repeat w { torus3d 100,30 rotate3d[-1] 1,1,0,60 color3d[-1] 255,0,0 specs3d {0,@$>} snapshot3d[-1] 400 } remove[0] +specs3d : +l[] { check "${1=0.8}>=0" value=$1 onfail noarg value=0.8 } +v + _$0 $value +_specs3d : +e[0--3] "Set shininess of 3D specular light to $1." +_specs3d=$1 +#@cli sphere3d : radius,_nb_recursions!=0 : radius,_nb_phi>=3,_nb_theta>=3 +#@cli : Input 3D sphere at (0,0,0), with specified geometry. +#@cli : - If 2 arguments are specified: +#@cli : - If 'nb_recursions>0', the sphere is generated using recursive subdivisions of an **icosahedron**. +#@cli : - If 'nb_recursions<0', the sphere is generated using recursive subdividions of a **cube**. +#@cli : - If 3 arguments are specified, the sphere is generated using spherical coordinates discretization. +#@cli : Default value: 'nb_recursions=3'. +#@cli : $ sphere3d 100 +primitives3d 1 color3d[-2] ${-rgb} ++sphere3d : check "isnum(${1=1})" skip "${2=3},${3=}" +if !narg($3) +e[0--3] "Input 3D sphere, with radius $1 and $2 subdivision iterations." +l[] { +if $2>=0 +(1;3;1;3;2;2;2;2;4;0;4;0^2;2;2;2;4;4;0;0;3;3;1;1^4;4;0;0;3;1;3;1;2;2;2;2) +(-0.850650808352039932,-0.525731112119133606,0,0.525731112119133606,0.850650808352039932) +map.. . rm. (12) a[-2,-1] y +(0;0;9;4;4;8;8;5;5;2;7;7;7;11;0;6;9;9;9;7^\ +1;4;4;8;1;1;10;8;3;3;3;10;6;6;6;10;11;2;5;11^4;9;5;5;8;10;3;3;2;7;10;6;11;0;1;1;0;11;2;2) (20) a[-2,-1] y +repeat $2 { +0 +1,{1,@{1,h-1}},1,1," +unit(V) = (ref(V,_V); _V/norm(_V)); +p = I[#1,y]; +P0 = I[#0,p[0]]; P1 = I[#0,p[1]]; P2 = I[#0,p[2]]; +ref(string(#48,'p',min(p[0],p[1]),'_',max(p[0],p[1])),varname); p01 = get(varname); +isnan(p01)?(set(varname,p01 = da_size(#0)); da_push(#0,unit((P0 + P1)/2))); +ref(string(#48,'p',min(p[0],p[2]),'_',max(p[0],p[2])),varname); p02 = get(varname); +isnan(p02)?(set(varname,p02 = da_size(#0)); da_push(#0,unit((P0 + P2)/2))); +ref(string(#48,'p',min(p[1],p[2]),'_',max(p[1],p[2])),varname); p12 = get(varname); +isnan(p12)?(set(varname,p12 = da_size(#0)); da_push(#0,unit((P1 + P2)/2))); +da_push([p[0],p01,p02],[p01,p[1],p12],[p02,p12,p[2]],[p01,p12,p02])" +rm[1,-1] +} +else +(-1;1;1;-1;-1;1;1;-1^-1;-1;1;1;-1;-1;1;1^-1;-1;-1;-1;1;1;1;1) /. {sqrt(3)} (8) a[-2,-1] y +(0;4;0;3;0;1^3;5;1;7;4;2^2;6;5;6;7;6^1;7;4;2;3;5) (6) a[-2,-1] y +repeat -$2 { +0 +1,{1,@{1,h-1}},1,1," +unit(V) = (ref(V,_V); _V/norm(_V)); +p = I[#1,y]; +P0 = I[#0,p[0]]; P1 = I[#0,p[1]]; P2 = I[#0,p[2]]; P3 = I[#0,p[3]]; +ref(string(#48,'p',min(p[0],p[1]),'_',max(p[0],p[1])),varname); p01 = get(varname); +isnan(p01)?(set(varname,p01 = da_size(#0)); da_push(#0,unit((P0 + P1)/2))); +ref(string(#48,'p',min(p[1],p[2]),'_',max(p[1],p[2])),varname); p12 = get(varname); +isnan(p12)?(set(varname,p12 = da_size(#0)); da_push(#0,unit((P1 + P2)/2))); +ref(string(#48,'p',min(p[2],p[3]),'_',max(p[2],p[3])),varname); p23 = get(varname); +isnan(p23)?(set(varname,p23 = da_size(#0)); da_push(#0,unit((P2 + P3)/2))); +ref(string(#48,'p',min(p[0],p[3]),'_',max(p[0],p[3])),varname); p03 = get(varname); +isnan(p03)?(set(varname,p03 = da_size(#0)); da_push(#0,unit((P0 + P3)/2))); +pc = da_size(#0); +da_push(#0,unit((P0 + P1 + P2 + P3)/4)); +da_push([p[0],p01,pc,p03],[p01,p[1],p12,pc],[pc,p12,p[2],p23],[p03,pc,p23,p[3]])" +rm[1,-1] +} +fi +da_freeze nbp={1,h} +*[0] $1 permute cyzx i.. 1,100%,1,1,{w} a[-2,-1] x +i[0] ({'CImg3d'},{0,h},$nbp) 3,$nbp,1,1,200 1,$nbp,1,1,1 y a y +} +else +e[0--3] "Input 3D sphere, with radius $1 and angular discretizations ($2,$3)." +l[] { +nb_phi,nb_theta:=max(3,$2),max(3,$3) +1 $nb_phi,{$nb_theta-2},1,1," +begin(da_push(#0,0,0,-1)); +theta = lerp(0,pi,(y + 1)/(h + 1)); +phi = lerp(0,2*pi,x/w); +st = sin(theta); +da_push(#0,cos(phi)*st,sin(phi)*st,-cos(theta)); +end(da_push(#0,0,0,1); da_freeze())" rm. +1 $nb_phi,{$nb_theta-1},1,1," +const p = w; const ptm2p1 = p*(h - 1) + 1; +xp1 = x + 1; xp1mpp1 = xp1%p + 1; +yp = (y - 1)*p; yp1p = yp + p; +!y?da_push(3,0,xp1mpp1,xp1): +y "[3D sphere]" +#@cli spherical3d : "radius_function(phi,theta)",_nb_recursions!=0 : "radius_function(phi,theta)",_nb_phi>=3,_nb_theta>=3 +#@cli : Input 3D spherical object at (0,0,0), with specified geometry. +#@cli : Second and third arguments are the same as in command ''sphere3d''. +#@cli : Default values: 'nb_recursions=5'. +#@cli : $ spherical3d "abs(1+0.5*cos(3*phi)*sin(4*theta))" +primitives3d 1 ++spherical3d : check "${2=5}!=0" skip "${3=}" +e[^-1] "Input 3D spherical object, with radius function '$1'." +l[] { +sphere3d 1,${2--1} +s3d +r[2] 3,{2,h/3},1,1,-1 permute[2] zycx +f[2] " +V = [ i0,i1,i2 ]; +V/=norm(V); +theta = -acos(V[2]); +phi = atan2(V[1],V[0]); +R = ($1); +st = sin(theta); +[ R*cos(phi)*st,R*sin(phi)*st,R*cos(theta) ]" +permute[2] cyzx y[2] a y +=> "[3D spherical surface '$1']" +} +#@cli spline3d : x0[%],y0[%],z0[%],u0[%],v0[%],w0[%],x1[%],y1[%],z1[%],u1[%],v1[%],w1[%],_nb_vertices>=2 +#@cli : Input 3D spline with specified geometry. +#@cli : Default values: 'nb_vertices=128'. +#@cli : $ repeat 100 { spline3d {u},{u},{u},{u},{u},{u},{u},{u},{u},{u},{u},{u},128 color3d[-1] ${-rgb} } box3d 1 primitives3d[-1] 1 add3d ++spline3d : check ${13=128}>=2 +e[^-1] "Input new 3D spline from (${1-3}) [${4-6}] to (${7-9}) [${10-12}] with $13 vertices." +('CImg3d') +. 0.5 +($13;{$13-1}) +1,$13,1,1,1 (0;1) r. 1,$13,1,1,3 +sqr. +*[-2,-1] a[-4--1] x ++*. '$2,$5,{3*(($8)-($2))-2*($5)-($11)},{($5)+($11)+2*(($2)-($8))}' l. { s x + } ++*.. '$3,$6,{3*(($9)-($3))-2*($6)-($12)},{($6)+($12)+2*(($3)-($9))}' l. { s x + } +*... '$1,$4,{3*(($7)-($1))-2*($4)-($10)},{($4)+($10)+2*(($1)-($7))}' l... { s x + } +a[-3--1] x +1,{$13-1},1,1,2 (0,1;{$13-2},{$13-1}) r. 2,..,1,1,3 round. a[-2,-1] x +1,{3*($13-1)},1,1,200 1,{$13-1},1,1,1 +y[-3,-4,-6] a[-6--1] y +#@cli s3d : eq. to 'split3d'. +s3d : +_gmic_s="$?" v + _split3d +#@cli split3d +#@cli : Split selected 3D objects into feature vectors : +#@cli : { header, sizes, vertices, primitives, colors, opacities }. +#@cli : (eq. to 's3d').\n +#@cli : To recreate the 3D object, append all produced images along the y-axis (with command `append y`). +#@cli : $ box3d 100 +split3d +split3d : +_gmic_s="$?" v + _$0 +_split3d : +e[0--3] "Split 3D object$? into feature vectors." +check3d foreach { nm={n} ++z. 0,0,0,5 +z.. 0,6,0,7 nbv,nbp:=f2ui(crop()) +indp:=8+3*$nbv +if $nbv +z... 0,8,0,{$indp-1} else 0 fi +if $nbp +$nbp eval. ">begin(p = $indp); p+=i[#0,p] + 1; end(set('indc',p))" rm. ++z[0] 0,$indp,0,{$indc-1} +$nbp eval. ">begin(p = $indc); i[#0,p]==-128?(p+=prod(crop(#0,0,++p,1,3))); p+=3; end(set('indo',p))" rm. ++z[0] 0,$indc,0,{$indo-1} ++z[0] 0,$indo,0,100% +else +0 0 0 +fi +rm[0] +=> $nm,${nm}_c1,${nm}_c2,${nm}_c3,${nm}_c4,${nm}_c5 +} +#@cli sprite3d +#@cli : Convert selected images as 3D sprites. +#@cli : Selected images with alpha channels are managed. +#@cli : $ image.jpg sprite3d +sprite3d : +e[^-1] "Convert image$? as 3D sprites." +foreach { +nm={n} split_opacity +i[0] (67.5;73.5;109.5;103.5;51.5;100.5;1;1;0;0;0;1;0;-128;{w};{h};{0,s}) y[1] +if $!==2 (1) a y +else /. 255 i.. (-128;{w};{h};{s}) y. +fi +a y => $nm +} +#@cli sprites3d : [sprite],_sprite_has_alpha_channel={ 0 | 1 } +#@cli : Convert selected 3D objects as a sprite cloud. +#@cli : Set 'sprite_has_alpha_channel' to 1 to make the last channel of the selected sprite be a transparency mask. +#@cli : Default value: 'mask_has_alpha_channel=0'. +#@cli : $ torus3d 100,20 image.jpg resize2dy[-1] 64 100%,100% gaussian[-1] 30%,30% *[-1] 255 append[-2,-1] c +sprites3d[0] [1],1 display_rgba[-2] +sprites3d : check ${is_image_arg\ $1} skip ${2=0} +e[^-1] "Convert image$? as 3D sprites clouds, using sprite $1 ("${"arg {1+!$2},with,without"}" alpha-channel)." +repeat $! { +if !{$>,i(0,7)} continue fi +pass$1 0 +if !w empty3d rv[$>,-1] =>[$>] {n} rm. continue fi +l[$>,-1] { +s3d[0] N={1,@0} =[1] $N,0,1 +rm[3-5] i[3] (1,0;1,{$N-1}) r[3] 2,$N,1,1,3 round[3] +if $2 +if s==1 +i.. 3,$N,1,1,200 /. 255 +i.. (-128;{w};{h};1) +if $N>1 1,{4*($N-1)},1,1,-128,0,0,0 fi +else +s. c,-{s-1} /. 255 +i... (-128;{w};{h};{-2,s}) +if $N>1 i.. 1,{4*($N-1)},1,1,-128,0,0,0 fi +i.. (-128;{w};{h};1) +if $N>1 1,{4*($N-1)},1,1,-128,0,0,0 fi +fi +else +i.. (-128;{w};{h};{s}) y[-3,-1] +if $N>1 1,{4*($N-1)},1,1,-128,0,0,0 fi +1,$N,1,1,1 +fi +y a y +} +} +#@cli star3d : _nb_branches>0,0<=_thickness<=1 +#@cli : Input 3D star at position `(0,0,0)`, with specified geometry. +#@cli : Default values: 'nb_branches=5' and 'thickness=0.38'. +#@cli : $ star3d , +primitives3d 1 color3d[-2] ${-rgb} ++star3d : check "${1=5}>0 && ${2=0.38}>=0 && $2<=1" +e[^-1] "Input 3D star, with $1 branches and thickness $2." +N:=2*$1 ('CImg3d') +. 0.5 ({$N+1};$N) +({-pi/2};{3*pi/2}) r. 1,{$N+1},1,1,3 rows. 0,{h-2} +sin. cos.. a[-2,-1] x +(1,1;$2,$2) *[-2,-1] z. 0,2 r. 3,{h+1},1,1,0 +(3,$N,1,0;3,$N,$N,{$N-1}) r. 4,$N,1,1,3 round. =. 0,2,100% +3,$N,1,1,200 1,$N,1,1,1 y[-6,-4--2] a[-6--1] y => [3D\ star] +#@cli streamline3d : x[%],y[%],z[%],_L>=0,_dl>0,_interpolation,_is_backward={ 0 | 1 },_is_oriented={ 0 | 1 } : 'formula',x,y,z,_L>=0,_dl>0,_interpolation,_is_backward={ 0 | 1 },_is_oriented={ 0 | 1 } : (+) +#@cli : Extract 3D streamlines from selected vector fields or from specified formula. +#@cli : 'interpolation' can be { 0:nearest integer | 1:1st-order | 2:2nd-order | 3:4th-order }. +#@cli : Default values: 'dl=0.1', 'interpolation=2', 'is_backward=0' and 'is_oriented=0'. +#@cli : $ 100,100,100,3 rand -10,10 blur 3 repeat 300 { +streamline3d[0] {u(100)},{u(100)},{u(100)},1000,1,1 color3d[-1] ${-rgb} } remove[0] box3d 100 primitives3d[-1] 1 add3d +#@cli -3d : eq. to 'sub3d'. : (+) +#@cli sub3d : tx,_ty,_tz : (+) +#@cli : Shift selected 3D objects with the opposite of specified displacement vector. +#@cli : (eq. to '3d'). +#@cli : Default values: 'ty=tz=0'. +#@cli : $ sphere3d 10 repeat 5 { +sub3d[-1] 10,{u(-10,10)},0 color3d[-1] ${-rgb} } add3d +#@cli subdivide3d +#@cli : Subdivide primitives of selected 3D objects. +subdivide3d : +e[^-1] "Subdivide primitives of selected 3D objects." +foreach { +s3d nbv,nbp={1,f2ui(crop())} +r[2] 3,{2,h/3},1,1,-1 permute[2] zycx +foreach[2--1] { ({h}) a y } +$nbp eval. ">begin(pp = pc = po = M = N = 0); +n = i[#3,pp++]; # Type of primitive +R = i[#4,pc++]; +R==-128?( +wc = f2ui(i[#4,pc++]); hc = i[#4,pc++]; sc = i[#4,pc++]; whsc = wc*hc*sc; ind_texture = whsc?wc:M; pc+=whsc; +R = G = B = 200; +):(G = i[#4,pc++]; B = i[#4,pc++]); +O = i[#5,po++]; +O==-128?( +wo = f2ui(i[#5,po++]); ho = i[#5,po++]; so = i[#5,po++]; whso = wo*ho*so; po+=whso; +O = 1; +); +n==2 || n==6?( +opp = pp; i0 = f2ui(i[#3,pp++]); i1 = f2ui(i[#3,pp++]); +P0 = I[#2,i0]; P1 = I[#2,i1]; +P01 = (P0 + P1)/2; +i01 = da_size(#2); da_push(#2,P01); +i0 = ui2f(i0); i1 = ui2f(i1); i01 = ui2f(i01); +n==2?( +copy(i[#3,opp],[ i0,i01 ]); +da_push(#3,2,i01,i1); +da_push(#4,R,G,B); +):( +tx0 = i[#3,pp++]; ty0 = i[#3,pp++]; tx1 = i[#3,pp++]; ty1 = i[#3,pp++]; +tx01 = round((tx0 + tx1)/2); ty01 = round((ty0 + ty1)/2); +copy(i[#3,opp],[ i0,i01,tx0,ty0,tx01,ty01 ]); +da_push(#3,6,i01,i1,tx01,ty01,tx1,ty1); +whsc?(ui2fM = ui2f(M); da_push(#4,-128,ui2fM,0,0)): +(ui2fwc = ui2f(wc); da_push(#4,-128,ui2fwc,0,0)); +); +da_push(#5,O); +N+=2): +n==3 || n==9?( +opp = pp; i0 = f2ui(i[#3,pp++]); i1 = f2ui(i[#3,pp++]); i2 = f2ui(i[#3,pp++]); +P0 = I[#2,i0]; P1 = I[#2,i1]; P2 = I[#2,i2]; +P01 = (P0 + P1)/2; P12 = (P1 + P2)/2; P20 = (P2 + P0)/2; +i01 = da_size(#2); i12 = i01 + 1; i20 = i12 + 1; da_push(#2,P01,P12,P20); +i0 = ui2f(i0); i1 = ui2f(i1); i2 = ui2f(i2); i01 = ui2f(i01); i12 = ui2f(i12); i20 = ui2f(i20); +n==3?( +copy(i[#3,opp],[ i01,i12,i20 ]); +da_push(#3,3,i0,i01,i20, +3,i01,i1,i12, +3,i20,i12,i2); +da_push(#4,R,G,B, R,G,B, R,G,B); +):( +tx0 = i[#3,pp++]; ty0 = i[#3,pp++]; tx1 = i[#3,pp++]; ty1 = i[#3,pp++]; tx2 = i[#3,pp++]; ty2 = i[#3,pp++]; +tx01 = round((tx0 + tx1)/2); ty01 = round((ty0 + ty1)/2); +tx12 = round((tx1 + tx2)/2); ty12 = round((ty1 + ty2)/2); +tx20 = round((tx2 + tx0)/2); ty20 = round((ty2 + ty0)/2); +copy(i[#3,opp],[ i01,i12,i20,tx01,ty01,tx12,ty12,tx20,ty20 ]); +da_push(#3,9,i0,i01,i20,tx0,ty0,tx01,ty01,tx20,ty20, +9,i01,i1,i12,tx01,ty01,tx1,ty1,tx12,ty12, +9,i20,i12,i2,tx20,ty20,tx12,ty12,tx2,ty2); +whsc?(ui2fM = ui2f(M); da_push(#4,-128,ui2fM,0,0, -128,ui2fM,0,0, -128,ui2fM,0,0)): +(ui2fwc = ui2f(wc); da_push(#4,-128,ui2fwc,0,0, -128,ui2fwc,0,0, -128,ui2fwc,0,0)); +); +da_push(#5,O,O,O); +N+=4): +n==4 || n==12?( +opp = pp; i0 = f2ui(i[#3,pp++]); i1 = f2ui(i[#3,pp++]); i2 = f2ui(i[#3,pp++]); i3 = f2ui(i[#3,pp++]); +P0 = I[#2,i0]; P1 = I[#2,i1]; P2 = I[#2,i2]; P3 = I[#2,i3]; +P01 = (P0 + P1)/2; P12 = (P1 + P2)/2; P23 = (P2 + P3)/2; P30 = (P3 + P0)/2; Pc = (P0 + P1 + P2 + P3)/4; +i01 = da_size(#2); i12 = i01 + 1; i23 = i12 + 1; i30 = i23 + 1; ic = i30 + 1; da_push(#2,P01,P12,P23,P30,Pc); +i0 = ui2f(i0); i1 = ui2f(i1); i2 = ui2f(i2); i3 = ui2f(i3); +i01 = ui2f(i01); i12 = ui2f(i12); i23 = ui2f(i23); i30 = ui2f(i30); ic = ui2f(ic); +n==4?( +copy(i[#3,opp],[ i0,i01,ic,i30 ]); +da_push(#3,4,i01,i1,i12,ic, +4,ic,i12,i2,i23, +4,i30,ic,i23,i3); +da_push(#4,R,G,B, R,G,B, R,G,B); +):( +tx0 = i[#3,pp++]; ty0 = i[#3,pp++]; tx1 = i[#3,pp++]; ty1 = i[#3,pp++]; +tx2 = i[#3,pp++]; ty2 = i[#3,pp++]; tx3 = i[#3,pp++]; ty3 = i[#3,pp++]; +tx01 = round((tx0 + tx1)/2); ty01 = round((ty0 + ty1)/2); +tx12 = round((tx1 + tx2)/2); ty12 = round((ty1 + ty2)/2); +tx23 = round((tx2 + tx3)/2); ty23 = round((ty2 + ty3)/2); +tx30 = round((tx3 + tx0)/2); ty30 = round((ty3 + ty0)/2); +txc = (tx0 + tx1 + tx2 + tx3)/4; tyc = (ty0 + ty1 + ty2 + ty3)/4; +copy(i[#3,opp],[ i0,i01,ic,i30,tx0,ty0,tx01,ty01,txc,tyc,tx30,ty30 ]); +da_push(#3,12,i01,i1,i12,ic,tx01,ty01,tx1,ty1,tx12,ty12,txc,tyc, +12,ic,i12,i2,i23,txc,tyc,tx12,ty12,tx2,ty2,tx23,ty23, +12,i30,ic,i23,i3,tx30,ty30,txc,tyc,tx23,ty23,tx3,ty3); +whsc?(ui2fM = ui2f(M); da_push(#4,-128,ui2fM,0,0, -128,ui2fM,0,0, -128,ui2fM,0,0)): +(ui2fwc = ui2f(wc); da_push(#4,-128,ui2fwc,0,0, -128,ui2fwc,0,0, -128,ui2fwc,0,0)); +); +da_push(#5,O,O,O); +N+=4): +(pp+=n; ++N); +++M; +end(i[#1,0] = ui2f(da_size(#2)); i[#1,1] = ui2f(N))" rm. +da_freeze[2--1] nbv={2,h} permute[2] cyzx y[2] a y +} +#@cli superformula3d : resolution>1,m>=1,n1,n2,n3 +#@cli : Input 2D superformula curve as a 3D object. +#@cli : Default values: 'resolution=1024', 'm=8', 'n1=1', 'n2=5' and 'n3=8'. +#@cli : $ superformula3d , ++superformula3d : check "${1=1024}>1 && ${2=8}>=1" skip ${3=1},${4=5},${5=8} +e[^-1] "Input 2D superformula curve, with resolution $1, m=$2 and (n1,n2,n3)=($3,$4,$5)." +res:=round($1) +(67.5;73.5;109.5;103.5;51.5;100.5;$res;{$res-1}) +(0,{2*pi}) r. $res,1,1,1,3 . +*. {$2/4} +sin. cos.. abs[-2,-1] +^.. $4 ^. $5 +[-2,-1] ^. {-1/$3} ++sin.. cos... *. .. *[-3,-2] n[-2,-1] -1,1 +a[-2,-1] y rows. 0,2 transpose. r. 1,{w*h},1,1,-1 +1,{$res-1},1,1,2 (0;{$res-2}) r. 1,{$res-1},1,1,3 ++. 1 a[-3--1] x round. 1 r. 1,{w*h},1,1,-1 +1,{3*($res-1)},1,1,200 1,{$res-1},1,1,1 a[-5--1] y => [3D\ superformula] +#@cli surfels3d : 0<=_left_right_attenuation<=1,0<=_top_bottom_attenuation<=1,0<=_closer_further_attenuation<=1 +#@cli : Convert selected images to 3D objects composed of 3D surfels (or 2D edgels for 2D images). +#@cli : The binary shape is composed of all non-zero voxels. +#@cli : The resulting 3D object is colored according to the color of non zero voxels. +#@cli : Default values: 'left_right_attenuation=1', 'top_bottom_attenuation=1' and 'closer_further_attenuation=1'. +#@cli : $ 100,100,100 = 1,40%,40%,40% = 1,60%,60%,60% distance 1 lt 30% blur 3 gt 50% surfels3d 0.5,0.75,1 +surfels3d : check "${1=1}>0 && ${2=1}>0 && ${3=1}>0" +e[^-1] "Generate 3D surfel object from binary shape$? with color attenuations (${1-3})." +foreach { +nm={n} +if d==1 +{[w,h]+1},1,1,-1 1,1,1,2x2 1,1,1,{0,s} => ind,pts,prims,cols +eval[0] ">val = I; norm(val)?( +const ind = $ind; const pts = $pts; const prims = $prims; const cols = $cols; +nx = x + 1; ny = y + 1; +!j(-1)?( +i0 = i(#ind,x,y); i0<0?(i0 = i(#ind,x,y) = da_size(#pts); da_push(#pts,[x - 0.5, y - 0.5])); +i1 = i(#ind,x,ny); i1<0?(i1 = i(#ind,x,ny) = da_size(#pts); da_push(#pts,[x - 0.5, y + 0.5])); +da_push(#prims,[i1,i0]); +da_push(#cols,val*$1); +); +!j(1)?( +i0 = i(#ind,nx,y); i0<0?(i0 = i(#ind,nx,y) = da_size(#pts); da_push(#pts,[x + 0.5, y - 0.5])); +i1 = i(#ind,nx,ny); i1<0?(i1 = i(#ind,nx,ny) = da_size(#pts); da_push(#pts,[x + 0.5, y + 0.5])); +da_push(#prims,[i0,i1]); +da_push(#cols,val*$1); +); +!j(0,-1)?( +i0 = i(#ind,x,y); i0<0?(i0 = i(#ind,x,y) = da_size(#pts); da_push(#pts,[x - 0.5, y - 0.5])); +i1 = i(#ind,nx,y); i1<0?(i1 = i(#ind,nx,y) = da_size(#pts); da_push(#pts,[x + 0.5, y - 0.5])); +da_push(#prims,[i0,i1]); +da_push(#cols,val*$2); +); +!j(0,1)?( +i0 = i(#ind,x,ny); i0<0?(i0 = i(#ind,x,ny) = da_size(#pts); da_push(#pts,[x - 0.5, y + 0.5])); +i1 = i(#ind,nx,ny); i1<0?(i1 = i(#ind,nx,ny) = da_size(#pts); da_push(#pts,[x + 0.5, y + 0.5])); +da_push(#prims,[i1,i0]); +da_push(#cols,val*$2); +); +); I; +end( +resize(#pts,1,da_size(#pts),1,s#pts,0); +resize(#prims,1,da_size(#prims),1,s#prims,0); +resize(#cols,1,da_size(#cols),1,s#cols,0); +)" +if !w rm +else +c[cols] 0,255 to_rgb[cols] +k[pts,prims,cols] permute cyzx i[1] 1,{0,h},1,1,0 a[0,1] x i[1] 1,{1,h},1,1,2 a[1,2] x =>.. prims +fi +else +{[w,h,d]+1},1,-1 1,1,1,3 1,1,1,4 1,1,1,{0,s} => ind,pts,prims,cols +eval[0] ">val = I; norm(val)?( +const ind = $ind; const pts = $pts; const prims = $prims; const cols = $cols; +nx = x + 1; ny = y + 1; nz = z + 1; +!j(-1)?( +i0 = i(#ind,x,y,z); i0<0?(i0 = i(#ind,x,y,z) = da_size(#pts); da_push(#pts,[x-0.5, y-0.5, z-0.5])); +i1 = i(#ind,x,ny,z); i1<0?(i1 = i(#ind,x,ny,z) = da_size(#pts); da_push(#pts,[x-0.5, y+0.5, z-0.5])); +i2 = i(#ind,x,ny,nz); i2<0?(i2 = i(#ind,x,ny,nz) = da_size(#pts); da_push(#pts,[x-0.5, y+0.5, z+0.5])); +i3 = i(#ind,x,y,nz); i3<0?(i3 = i(#ind,x,y,nz) = da_size(#pts); da_push(#pts,[x-0.5, y-0.5, z+0.5])); +da_push(#prims,[i0,i3,i2,i1]); +da_push(#cols,val*$1); +); +!j(1)?( +i0 = i(#ind,nx,y,z); i0<0?(i0 = i(#ind,nx,y,z) = da_size(#pts); da_push(#pts,[x+0.5, y-0.5, z-0.5])); +i1 = i(#ind,nx,ny,z); i1<0?(i1 = i(#ind,nx,ny,z) = da_size(#pts); da_push(#pts,[x+0.5, y+0.5, z-0.5])); +i2 = i(#ind,nx,ny,nz); i2<0?(i2 = i(#ind,nx,ny,nz) = da_size(#pts); da_push(#pts,[x+0.5, y+0.5, z+0.5])); +i3 = i(#ind,nx,y,nz); i3<0?(i3 = i(#ind,nx,y,nz) = da_size(#pts); da_push(#pts,[x+0.5, y-0.5, z+0.5])); +da_push(#prims,[i0,i1,i2,i3]); +da_push(#cols,val*$1); +); +!j(0,-1)?( +i0 = i(#ind,x,y,z); i0<0?(i0 = i(#ind,x,y,z) = da_size(#pts); da_push(#pts,[x-0.5, y-0.5, z-0.5])); +i1 = i(#ind,nx,y,z); i1<0?(i1 = i(#ind,nx,y,z) = da_size(#pts); da_push(#pts,[x+0.5, y-0.5, z-0.5])); +i2 = i(#ind,nx,y,nz); i2<0?(i2 = i(#ind,nx,y,nz) = da_size(#pts); da_push(#pts,[x+0.5, y-0.5, z+0.5])); +i3 = i(#ind,x,y,nz); i3<0?(i3 = i(#ind,x,y,nz) = da_size(#pts); da_push(#pts,[x-0.5, y-0.5, z+0.5])); +da_push(#prims,[i0,i1,i2,i3]); +da_push(#cols,val*$2); +); +!j(0,1)?( +i0 = i(#ind,x,ny,z); i0<0?(i0 = i(#ind,x,ny,z) = da_size(#pts); da_push(#pts,[x-0.5, y+0.5, z-0.5])); +i1 = i(#ind,nx,ny,z); i1<0?(i1 = i(#ind,nx,ny,z) = da_size(#pts); da_push(#pts,[x+0.5, y+0.5, z-0.5])); +i2 = i(#ind,nx,ny,nz); i2<0?(i2 = i(#ind,nx,ny,nz) = da_size(#pts); da_push(#pts,[x+0.5, y+0.5, z+0.5])); +i3 = i(#ind,x,ny,nz); i3<0?(i3 = i(#ind,x,ny,nz) = da_size(#pts); da_push(#pts,[x-0.5, y+0.5, z+0.5])); +da_push(#prims,[i0,i3,i2,i1]); +da_push(#cols,val*$2); +); +!j(0,0,-1)?( +i0 = i(#ind,x,y,z); i0<0?(i0 = i(#ind,x,y,z) = da_size(#pts); da_push(#pts,[x-0.5, y-0.5, z-0.5])); +i1 = i(#ind,nx,y,z); i1<0?(i1 = i(#ind,nx,y,z) = da_size(#pts); da_push(#pts,[x+0.5, y-0.5, z-0.5])); +i2 = i(#ind,nx,ny,z); i2<0?(i2 = i(#ind,nx,ny,z) = da_size(#pts); da_push(#pts,[x+0.5, y+0.5, z-0.5])); +i3 = i(#ind,x,ny,z); i3<0?(i3 = i(#ind,x,ny,z) = da_size(#pts); da_push(#pts,[x-0.5, y+0.5, z-0.5])); +da_push(#prims,[i0,i3,i2,i1]); +da_push(#cols,val*$3); +); +!j(0,0,1)?( +i0 = i(#ind,x,y,nz); i0<0?(i0 = i(#ind,x,y,nz) = da_size(#pts); da_push(#pts,[x-0.5, y-0.5, z+0.5])); +i1 = i(#ind,nx,y,nz); i1<0?(i1 = i(#ind,nx,y,nz) = da_size(#pts); da_push(#pts,[x+0.5, y-0.5, z+0.5])); +i2 = i(#ind,nx,ny,nz); i2<0?(i2 = i(#ind,nx,ny,nz) = da_size(#pts); da_push(#pts,[x+0.5, y+0.5, z+0.5])); +i3 = i(#ind,x,ny,nz); i3<0?(i3 = i(#ind,x,ny,nz) = da_size(#pts); da_push(#pts,[x-0.5, y+0.5, z+0.5])); +da_push(#prims,[i0,i1,i2,i3]); +da_push(#cols,val*$3); +); +); I; +end( +resize(#pts,1,da_size(#pts),1,s#pts,0); +resize(#prims,1,da_size(#prims),1,s#prims,0); +resize(#cols,1,da_size(#cols),1,s#cols,0); +)" +if !w rm +else +c[cols] 0,255 to_rgb[cols] +k[pts,prims,cols] permute cyzx i[1] 1,{1,h},1,1,4 a[1,2] x =>.. prims +fi +fi +if !$! empty3d else i[0] ({'CImg3d'},{pts,h},{prims,h}:y) 1,100%,1,1,1 y a y fi +=> $nm +} +#@cli tensors3d : _radius_factor>=0,_shape={ 0:box | >=N:ellipsoid },_radius_min>=0 +#@cli : Generate 3D tensor fields from selected images. +#@cli : when 'shape'>0, it gives the ellipsoid shape precision. +#@cli : Default values: 'radius_factor=1', 'shape=2' and 'radius_min=0.05'. +#@cli : $ 6,6,6,9,"U = [x,y,z] - [w,h,d]/2; U/=norm(U); mul(U,U,3) + 0.3*eye(3)" tensors3d 0.8 +tensors3d : check "${1=1}>=0 && isint(${2=2}) && $2>=0 && ${3=0.05}>=0" +e[^-1] "Generate 3D tensor field(s) from image$?, with radius factor $1, "${"if $2 u ellipsoid else u box fi"}" shape and radius min $3." +foreach { +if s==1 100%,100%,100%,6,"[i#0,0,0,i#0,0,i#0]" k. +elif s==3 100%,100%,100%,6,"[R#0,G#0,0,B#0,0,0]" k. +elif s==4 100%,100%,100%,6,"[R#0,G#0,0,A#0,0,0]" k. +elif s==9 100%,100%,100%,6,"I=I#0;[I[0],I[1],I[2],I[4],I[5],I[8]]" k. +fi +if s!=6 error[0--4] "Command '$0': Image '"{n}"' has an invalid size (spectrum="{s}")." fi +100%,100%,100%,12," +T = I(#0); +M = [ T[0], T[1], T[2], T[1], T[3], T[4], T[2], T[4], T[5] ]; +eig = eig(M); +if (det(eig[3,9])<0, eig[3]*=-1; eig[4]*=-1; eig[5]*=-1); +eig[0] = max(0,eig[0]); +eig[1] = max(0,eig[1]); +eig[2] = max(0,eig[2]); +eig" +k. +if $2 sphere3d 1,{$2-1} else box3d 1 fi +N,P:=i[6],i[7] siz:=h n3d. c3d. .x{0,whd-1} +f[0] " +const N = "$N"; +const P = "$P"; +const siz = "$siz"; +eig = I; +const d = size(eig); +ind = 1 + x + w*y + wh*z; +L = eig[0,3]; +if (!max(L), +i[#ind,6] = i[#ind,7] = 0; +resize(#ind,1,8,1,1,0); +_(else), +L*=$1; +L[0] = max($3,L[0]); +L[1] = max($3,L[1]); +L[2] = max($3,L[2]); +R = eig[3,9]; +anisotropy = sqrt(((L[0] - L[1])^2 + (L[1] - L[2])^2 + (L[2] - L[0])^2)/(2*(L[0]^2 + L[1]^2 + L[2]^2))); +ref(crop(#ind,0,8,0,0,1,3*N,1,1),pts); +pts *= resize(L,size(pts),0,2); +pts = mul(pts,R,3); +pts += resize([x,y,z],size(pts),0,2); +draw(#ind,pts,0,8,0,0,1,size(pts),1,1); +col0 = cut(255*anisotropy*abs([ R[0],R[1],R[2] ]) + (1 - anisotropy)*200,0,255); +col = resize(col0,3*P,0,2); +const off = siz - 4*P; +draw(#ind,col,0,off,0,0,1,size(col),1,1); +0); I" +rm[0] +3d +} +#@cli text_pointcloud3d : _"text1",_"text2",_smoothness +#@cli : Input 3D text pointcloud from the two specified strings. +#@cli : Default values: 'text1="text1"', 'text2="text2"' and 'smoothness=1'. +#@cli : $ text_pointcloud3d "G'MIC","Rocks!" ++text_pointcloud3d : skip "${1=text1}","${2=text2}",${3=1} +e[^-1] "Input 3D pointcloud text object from strings '$1' and '$2', with smoothness $3." +0 t. "$1",0,0,53,1,1 +0 t. "$2",0,0,53,1,1 mirror. y +autocrop[-2,-1] 0 +expand_xy[-2,-1] 2,0 dilate[-2,-1] 2 +permute. zyxc r[-2,-1] ${-max_whd} &[-2,-1] +100%,100% rand. 0,{{-2,d}-1} round. ri. .. f. z==i +distance. 1 +. 1 +f. 1 rv[-2,-1] /[-2,-1] *. .. ++dilate. 0,0,{d} ==[-2,-1] *. .. +1,100%,100% rand. 0,{{-2,w}-1} round. ri. .. f. x==i +distance. 1 +. 1 +f. 1 rv[-2,-1] /[-2,-1] *. ... ++dilate. 0,0,{d} ==[-2,-1] *[-3,-1] +-|[-2,-1] +b. $3 isosurface3d. 25% +c3d. n3d. => "[3D text pointcloud]" +#@cli text3d : text,_font_height>0,_depth>0,_smoothness +#@cli : Input a 3D text object from specified text. +#@cli : Default values: 'font_height=53', 'depth=10' and 'smoothness=1.5'. +#@cli : $ text3d "G'MIC as a\n3D logo!" ++text3d : skip ${2=53},${3=10},${4=1.5} +e[^-1] "Input 3D text object '$1' with size $2, depth $3 and smoothness $4." +0 t. "$1",0,0,$2,1,1 autocrop. 0 r. 100%,100%,$3 expand_xyz. 10,0 +b. $4 isosurface3d. 40% rv3d. => "[3D text '$1']" +#@cli t3d : eq. to 'texturize3d'. +t3d : check ${"is_image_arg $1"}" && (!narg(${2=}) || "${"is_image_arg $2"}")" +e[^-1] "Texturize 3D object$? with texture $1"${"if narg($2) u \" and texture coordinates $2\" else u \"\" fi"}"." +pass$1 0 slices. 0 if s==1 to_rgb. else channels. 0,2 fi +if narg($2) pass$2 else 0 fi +v + _texturize3d +#@cli texturize3d : [ind_texture],_[ind_coords] +#@cli : Texturize selected 3D objects with specified texture and coordinates. +#@cli : (eq. to 't3d').\n +#@cli : When '[ind_coords]' is omitted, default XY texture projection is performed. +#@cli : Default value: 'ind_coords=(undefined)'. +#@cli : $ image.jpg torus3d 100,30 texturize3d[-1] [-2] keep[-1] +texturize3d : check ${"is_image_arg $1"}" && (!narg(${2=}) || "${"is_image_arg $2"}")" +e[^-1] "Texturize 3D object$? with texture $1"${"if narg($2) u \" and texture coordinates $2\" else u \"\" fi"}"." +pass$1 0 slices. 0 if s==1 to_rgb. else channels. 0,2 fi +if narg($2) pass$2 else 0 fi +v + _$0 +_texturize3d : +repeat $!-2 { l[$>,-2,-1] { +np:=f2ui(i[7]) +s3d[0] +if !w ++r[2] 3,{2,round(h/3)},1,1,-1 s. x,3 rm. +n.. 0,{6,w-1} n. 0,{6,h-1} a[-2,-1] x +mv. -2 +fi +1,{5,2*h} +1,{5,3*h} +1,{5,h},1,1,1 +eval " +add_material() = ( +ind_tex>=0?( +copy(i[#-2,qc],[ -128,ind_tex,0,0 ],4); qc+=4 +):( +qc + whds#6 + 4>=h(#-2)?resize(#-2,1,int(1.5*qc + whds#6 + 4),1,1,0,0); +copy(i[#-2,qc],[ -128,w#6,h#6,s#6 ],4); qc+=4; +copy(i[#-2,qc],i(#6),whds#6); qc+=whds#6; +ind_tex = np; +); +); +ind_tex = -1; +for (pp = pc = qp = qc = np = 0, pp=h(#-3)?resize(#-3,1,int(1.5*qp + 13),1,1,0,0); +qc + 3>=h(#-2)?resize(#-2,1,int(1.5*qc + 3),1,1,0,0); +N = i[#3,pp++]; +N==1?( +v0 = f2ui(i[#3,pp++]); tx0 = i(#7,0,v0); ty0 = i(#7,1,v0); +R = i(#6,tx0,ty0,0,0); G = i(#6,tx0,ty0,0,1); B = i(#6,tx0,ty0,0,2); +copy(i[#-3,qp],[ 1,ui2f(v0) ],2); qp+=2; +copy(i[#-2,qc],[ R,G,B ],3); qc+=3; +):(N==2 || N==6)?( +v0 = f2ui(i[#3,pp++]); tx0 = i(#7,0,v0); ty0 = i(#7,1,v0); +v1 = f2ui(i[#3,pp++]); tx1 = i(#7,0,v1); ty1 = i(#7,1,v1); +N==6?(pp+=4); +copy(i[#-3,qp],[ 6,ui2f(v0),ui2f(v1),tx0,ty0,tx1,ty1 ],7); qp+=7; +add_material(); +):(N==3 || N==9)?( +v0 = f2ui(i[#3,pp++]); tx0 = i(#7,0,v0); ty0 = i(#7,1,v0); +v1 = f2ui(i[#3,pp++]); tx1 = i(#7,0,v1); ty1 = i(#7,1,v1); +v2 = f2ui(i[#3,pp++]); tx2 = i(#7,0,v2); ty2 = i(#7,1,v2); +N==9?(pp+=6); +copy(i[#-3,qp],[ 9,ui2f(v0),ui2f(v1),ui2f(v2),tx0,ty0,tx1,ty1,tx2,ty2 ],10); qp+=10; +add_material(); +):(N==4 || N==12)?( +v0 = f2ui(i[#3,pp++]); tx0 = i(#7,0,v0); ty0 = i(#7,1,v0); +v1 = f2ui(i[#3,pp++]); tx1 = i(#7,0,v1); ty1 = i(#7,1,v1); +v2 = f2ui(i[#3,pp++]); tx2 = i(#7,0,v2); ty2 = i(#7,1,v2); +v3 = f2ui(i[#3,pp++]); tx3 = i(#7,0,v3); ty3 = i(#7,1,v3); +N==12?(pp+=8); +copy(i[#-3,qp],[ 12,ui2f(v0),ui2f(v1),ui2f(v2),ui2f(v3),tx0,ty0,tx1,ty1,tx2,ty2,tx3,ty3 ],13); qp+=13; +add_material(); +):N==5?( +v0 = f2ui(i[#3,pp++]); tx0 = i(#7,0,v0); ty0 = i(#7,1,v0); +v1 = f2ui(i[#3,pp++]); tx1 = i(#7,0,v1); ty1 = i(#7,1,v1); +v2 = f2ui(i[#3,pp++]); pp+=2; +(tx0+=tx1)/=2; (ty0+=ty1)/=2; +R = i(#6,tx0,ty0,0,0); G = i(#6,tx0,ty0,0,1); B = i(#6,tx0,ty0,0,2); +copy(i[#-3,qp],[ 5,ui2f(v0),ui2f(v1),ui2f(v2),0,0 ],6); qp+=6; +copy(i[#-2,qc],[ R,G,B ],3); qc+=3; +); +); +resize(#-3,1,qp,1,1,0,0); +resize(#-2,1,qc,1,1,0,0)" +rm[3-5] mv[-3--1] 3 +if !w rm.. fi +a[0-5] y +} } +rm[-2,-1] +#@cli torus3d : _radius1,_radius2,_nb_subdivisions1>2,_nb_subdivisions2>2 +#@cli : Input 3D torus at (0,0,0), with specified geometry. +#@cli : Default values: 'radius1=1', 'radius2=0.3', 'nb_subdivisions1=24' and 'nb_subdivisions2=12'. +#@cli : $ torus3d 10,3 +primitives3d 1 color3d[-2] ${-rgb} ++torus3d : check "${1=1} && ${2=0.3} && ${3=24}>2 && ${4=12}>2" +e[^-1] "Input 3D torus, with radii ($1,$2) and subdivisions ($3,$4)." +nbp:=$3*$4 +1,8,1,1,67.5,73.5,109.5,103.5,51.5,100.5,$nbp,{$4*$3} +(0;{2*pi}) +y. x +r.. 1,{$3+1},1,1,3 z.. 0,0,0,{$3-1} +r. {$4+1},1,1,1,3 z. 0,{$4-1} ++sin[-2,-1] cos[-4,-3] r[-4--1] $4,$3 +*... $2 +... $1 *. $2 *[-4] ... *[-3,-2] +y[-3--1] a[-3--1] x +1,$3,1,1,'y' *. $4 +shift. 0,-1 $4,1,1,1,'x' +shift. -1 r[-4--1] $4,$3 +++[-4,-1] +.. [-4] +[-5] ... +[-4,-3] y[-4--1] i[-5] 1,{h},1,1,4 a[-5--1] x +3,{h},1,1,200 1,{h},1,1,1 y[-4--2] a[-5--1] y +=> [3D\ torus] +#@cli triangle3d : x0,y0,z0,x1,y1,z1,x2,y2,z2 +#@cli : Input 3D triangle at specified coordinates. +#@cli : $ repeat 100 { a:=$>*pi/50 triangle3d 0,0,0,0,0,3,{cos(3*$a)},{sin(2*$a)},0 color3d[-1] ${-rgb} } add3d ++triangle3d : +e[^-1] "Input 3D triangle ($1,$2,$3)-($4,$5,$6)-($7,$8,$9)." +1,25,1,1,67.5,73.5,109.5,103.5,51.5,100.5,3,1,${1-9},3,0,1,2,200,200,200,1 => [3D\ triangle] +#@cli volume3d +#@cli : Transform selected 3D volumetric images as 3D parallelepipedic objects. +#@cli : $ image.jpg animate blur,0,5,30 append z volume3d +volume3d : +e[^-1] "Transform image$? as 3D parallelepipedic objects." +foreach { +w,h,d={w},{h},{d} ++slices[0] 0 ++columns[0] 0 permute. zyxc mirror. x ++slices[0] 100% mirror. x ++columns[0] 100% permute. zyxc ++rows[0] 100% permute. xzyc ++rows[0] 0 permute. xzyc mirror. y +rm[0] image6cube3d *3d $w,$h,$d +} +#@cli voxelize3d : _max_resolution>0,_fill_interior={ 0 | 1 },_preserve_colors={ 0 | 1 } +#@cli : Convert selected 3D objects as 3D volumetric images of binary voxels, using 3D mesh rasterization. +#@cli : Default values: 'max_resolution=128', 'fill_interior=1' and 'preserve_colors=0'. +voxelize3d : check "${1=128}>0 && isbool(${2=1}) && isbool(${3=0})" check3d +s0,s1,t0,t1="",", interior filling","scalar","color" +e[^-1] "Voxelize 3D object$?, with max resolution $1"$s$2" and "$t$3" output." +foreach { +nm={n} p3d 2 ++boundingbox3d l. { s3d store[2] bbpts rm } +s3d nbp={1,@1} k[2,3,4] => pts,prims,cols +l[pts] { +$bbpts a y +r 3,{h/3},1,1,-1 s x +w,h,d:="const dx = iM#0 - im#0; +const dy = iM#1 - im#1; +const dz = iM#2 - im#2; +M = max(dx,dy,dz); +S = round([ dx, dy, dz ]*$1/M); +[ max(S[0],1), max(S[1],1), max(S[2],1) ]" +n[0] 0,{$w-1} n[1] 0,{$h-1} n[2] 0,{$d-1} +round a c +} +if $3 l[cols] { r 3,{h/3},1,1,-1 permute zycx +norm1 ==. 0 + } else rm[cols] fi +$w,$h,$d => out +$nbp eval. "> +begin( +p = 0; +label = 2; +P0 = P1 = P2 = P3 = vector3(); +rasterize_point(P) = ( +i(#$out,P#) = label; +); +rasterize_segment(P0,P1) = ( +l01 = max(1,abs(P1# - P0#)); +repeat (l01 + 1,l, +ln = l/l01; +Q = round(lerp(P0#,P1#,ln)); +i(#$out,Q) = label; +); +); +rasterize_triangle(P0,P1,P2) = ( +N = cross(P1# - P0#,P2# - P0#); # Normal vector +rasterize_segment(P0#,P1#); # Hack: Ensure correct jonction between adjacent triangles +rasterize_segment(P0#,P2#); +rasterize_segment(P1#,P2#); +norm(N)?( +S = -dot(N,P0#); # Affine shift +proj_plane = argmax(abs(N)); +!proj_plane?( +Q0 = [ P0#[1],P0#[2] ]; Q1 = [ P1#[1],P1#[2] ]; Q2 = [ P2#[1],P2#[2] ]; +_rasterize_triangle(Q0,Q1,Q2,round((-N[1]*a - N[2]*b - S)/N[0]),a,b); +):proj_plane==1?( +Q0 = [ P0#[0],P0#[2] ]; Q1 = [ P1#[0],P1#[2] ]; Q2 = [ P2#[0],P2#[2] ]; +_rasterize_triangle(Q0,Q1,Q2,a,round((-N[0]*a - N[2]*b - S)/N[1]),b); +):( +Q0 = [ P0#[0],P0#[1] ]; Q1 = [ P1#[0],P1#[1] ]; Q2 = [ P2#[0],P2#[1] ]; +_rasterize_triangle(Q0,Q1,Q2,a,b,round((-N[0]*a - N[1]*b - S)/N[2])); +); +); +); +_rasterize_triangle(P0,P1,P2,projX,projY,projZ) = ( +P0#[1]>P1#[1]?swap(P0#,P1#); +P0#[1]>P2#[1]?swap(P0#,P2#); +P1#[1]>P2#[1]?swap(P1#,P2#); +db01 = P1#[1] - P0#[1]; m1db01 = max(1,db01); +db02 = P2#[1] - P0#[1]; m1db02 = max(1,db02); +db12 = P2#[1] - P1#[1]; m1db12 = max(1,db12); +repeat (db01,l, +b = P0#[1] + l; +a0 = round(lerp(P0#[0],P1#[0],l/m1db01)); +a1 = round(lerp(P0#[0],P2#[0],l/m1db02)); +a0>a1?swap(a0,a1); +for (a = a0, a<=a1, ++a, i(#$out,projX#,projY#,projZ#) = label); +); +repeat (db12 + 1,l, +b = P1#[1] + l; +a0 = round(lerp(P1#[0],P2#[0],l/m1db12)); +a1 = round(lerp(P0#[0],P2#[0],(db01 + l)/m1db02)); +a0>a1?swap(a0,a1); +for (a = a0, a<=a1, ++a, i(#$out,projX#,projY#,projZ#) = label); +); +); +rasterize_sphere(P0,P1) = ( +P = (P0# + P1#)/2; +R = norm(P1# - P0#)/2; +xm = floor(P[0] - R); xM = ceil(P[0] + R); +ym = floor(P[1] - R); yM = ceil(P[1] + R); +zm = floor(P[2] - R); zM = ceil(P[2] + R); +for (z = zm, z<=zM, ++z, +for (y = ym, y<=yM, ++y, +for (x = xm, x<=xM, ++x, +norm([x,y,z] - P)<=R?(i(#$out,x,y,z) = label); +); +); +); +); +); +n = i[#$prims,p++]; +P0 = I[#$pts,f2ui(i[#$prims,p++])]; +n>1?(P1 = I[#$pts,f2ui(i[#$prims,p++])]); +n>2?(P2 = I[#$pts,f2ui(i[#$prims,p++])]); +n>3?(P3 = I[#$pts,f2ui(i[#$prims,p++])]); +n>4?(p+=n - 4); +n==1?rasterize_point(P0): +n==2 || n==6?rasterize_segment(P0,P1): +n==3 || n==9?rasterize_triangle(P0,P1,P2): +n==4 || n==12?(rasterize_triangle(P0,P1,P2); rasterize_triangle(P0,P2,P3)): +n==5?rasterize_sphere(P0,P1); +$3?++label" rm. +if $2 expand_xyz[out] 1,0 flood[out] 0,0,0,0,0,1,-1 +<[out] 2 +[out,-1] shrink_xyz[out] 1 fi +if $3 r[cols] 1,{cols,h+2},1,100%,0,0,0,1 point[cols] 0,1,0,1,1 map[out] [cols] +else >[out] 0 +fi +k[out] => $nm +} +#@cli weird3d : _resolution>0 +#@cli : Input 3D weird object at (0,0,0), with specified resolution. +#@cli : Default value: 'resolution=32'. +#@cli : $ weird3d 48 +primitives3d 1 color3d[-2] ${-rgb} ++weird3d : skip ${1=32} +e[^-1] "Input 3D weird object, with resolution $1." +isosurface3d '" +T = 1.61803399; +2 - (cos(x + T*y) + cos(x - T*y) + cos(y + T*z) + cos(y - T*z) + cos(z - T*x) + cos(z + T*x))"',0,-4.7,-4.7,-4.7,4.7,4.7,4.7,$1,$1,$1 +c3d. n3d. => [3D\ weird] +#@cli :: Flow Control +#@cli ap : eq. to 'apply_parallel'. +ap : +_gmic_s="$?" v + _apply_parallel "$*" +#@cli apply_parallel : "command" +#@cli : Apply specified command on each of the selected images, by parallelizing it for all image of the list. +#@cli : (eq. to 'ap'). +#@cli : $ image.jpg +mirror x +mirror y apply_parallel "blur 3" +apply_parallel : +_gmic_s="$?" v + _$0 "$*" +_apply_parallel : +e[0--3] "Apply command '$*' on all image"$_gmic_s" in parallel, using "$_cpus" threads." +if $!" && "narg("$*") +m "_ap : foreach { $* if $! k[0] else 0 fi }" +N:=min($!,$_cpus) +commands= sep= repeat $N { commands=$commands${sep}_ap[$>--1:$N] sep=, } +parallel $commands +um _ap +fi +#@cli apc : eq. to 'apply_parallel_channels'. +apc : +_gmic_s="$?" v + _apply_parallel_channels "$*" +#@cli apply_parallel_channels : "command" +#@cli : Apply specified command on each of the selected images, by parallelizing it for all channel +#@cli : of the images independently. +#@cli : (eq. to 'apc'). +#@cli : $ image.jpg apply_parallel_channels "blur 3" +apply_parallel_channels : +_gmic_s="$?" v + _$0 "$*" +_apply_parallel_channels : +e[0--3] "Apply command '$*' on all channels of image"$_gmic_s" in parallel, using "$_cpus" threads." +N=$! repeat $N { s$>={$>,s} } s c +ap "$1" +repeat $N { a[$>-{$>+${s$>}-1}] c } +#@cli apo : eq. to 'apply_parallel_overlap'. +apo : check "${2=0}>=0 && isint(${3=0}) && $3>=0" +_gmic_s="$?" v + _apply_parallel_overlap "$1",${2--1} +#@cli apply_parallel_overlap : "command",overlap[%],nb_threads={ 0:auto | 1 | 2 | 4 | 8 | 16 } +#@cli : Apply specified command on each of the selected images, by parallelizing it on 'nb_threads' +#@cli : overlapped sub-images. +#@cli : (eq. to 'apo').\n +#@cli : 'nb_threads' must be a power of 2. +#@cli : Default values: 'overlap=0','nb_threads=0'. +#@cli : $ image.jpg +apply_parallel_overlap "smooth 500,0,1",1 +apply_parallel_overlap : check "${2=0}>=0 && isint(${3=0}) && $3>=0" +_gmic_s="$?" v + _$0 "$1",${2--1} +_apply_parallel_overlap : check "${2=0}>=0 && isint(${3=0}) && $3>=0" +N:=$3?max(1,round($3)):$_cpus N:=2^int(log2(min(16,$N))) +e[0--3] "Apply parallelized command '$1' on image"$_gmic_s", with overlap $2 and "$N" threads." +__apo_exception="" +m "_check1 : if $!!=1 rm 0 __apo_exception=\"Command 'apply_parallel_overlap': Specified command '$1' changes the +size of the image stack.\" fi" +foreach { _apply_parallel_overlap$N "$1",$2 } +um _check1 +_apply_parallel_overlap1 : +$1 +if narg($__apo_exception) error[0--12] $__apo_exception fi +_apply_parallel_overlap2 : +if w>=h +ovx:=round(ispercentage($2)?w*$2:$2) w2:=int(w/2) ++z[0] {$w2-$ovx},100% z[0] 0,{$w2+$ovx-1} +parallel "l[0] { $1 _check1 }","l[1] { $1 _check1 }" +if narg($__apo_exception) error[0--12] $__apo_exception fi +z[0] 0,{0,w-1-$ovx} z[1] $ovx,100% a x +else +ovy:=round(ispercentage($2)?h*$2:$2) h2:=int(h/2) ++rows[0] {$h2-$ovy},100% rows[0] 0,{$h2+$ovy-1} +parallel "l[0] { $1 _check1 }","l[1] { $1 _check1 }" +if narg($__apo_exception) error[0--12] $__apo_exception fi +rows[0] 0,{0,h-1-$ovy} rows[1] $ovy,100% a y +fi +_apply_parallel_overlap4 : +if max(w,h)/min(w,h)>=3 +_apply_parallel_overlap2 "_apply_parallel_overlap2 \"$1\",$2",$2 +else +ovx:=round(ispercentage($2)?w*$2:$2) w2:=int(w/2) +ovy:=round(ispercentage($2)?h*$2:$2) h2:=int(h/2) ++z[0] {$w2-$ovx},0,100%,{$h2+$ovy-1} +z[0] 0,{$h2-$ovy},{$w2+$ovx-1},100% ++z[0] {$w2-$ovx},{$h2-$ovy},100%,100% z[0] 0,0,{$w2+$ovx-1},{$h2+$ovy-1} +parallel "l[0] { $1 _check1 }","l[1] { $1 _check1 }","l[2] { $1 _check1 }","l[3] { $1 _check1 }" +if narg($__apo_exception) error[0--12] $__apo_exception fi +z[0] 0,0,{0,w-1-$ovx},{0,h-1-$ovy} z[1] $ovx,0,100%,{1,h-1-$ovy} +z[2] 0,$ovy,{2,w-1-$ovx},100% z[3] $ovx,$ovy,100%,100% +a[0,1] x a[1,2] x a y +fi +_apply_parallel_overlap8 : +_apply_parallel_overlap2 "_apply_parallel_overlap4 \"$1\",$2",$2 +_apply_parallel_overlap16 : +_apply_parallel_overlap2 "_apply_parallel_overlap8 \"$1\",$2",$2 +#@cli at : eq. to 'apply_tiles'. +at : check "${2=10%}>0 && ${3=10%}>0 && ${4=10%}>0 && ${5=0}>=0 && ${6=0}>=0 && ${7=0}>=0 && +isint(${8=1}) && $8>=0 && $8<=3" +_gmic_s="$?" v + _apply_tiles "$1",${2--1} +#@cli apply_tiles : "command",_tile_width[%]>0,_tile_height[%]>0,_tile_depth[%]>0,_overlap_width[%]>=0,_overlap_height[%]>=0,_overlap_depth[%]>=0,_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror } +#@cli : Apply specified command on each tile (neighborhood) of the selected images, eventually with overlapping tiles. +#@cli : (eq. to 'at'). +#@cli : Default values: 'tile_width=tile_height=tile_depth=10%','overlap_width=overlap_height=overlap_depth=0' and 'boundary_conditions=1'. +#@cli : $ image.jpg +equalize[0] 256 +apply_tiles[0] "equalize 256",16,16,1,50%,50% +apply_tiles : check "${2=10%}>0 && ${3=10%}>0 && ${4=10%}>0 && ${5=0}>=0 && ${6=0}>=0 && ${7=0}>=0 && +isint(${8=1}) && $8>=0 && $8<=3" +_gmic_s="$?" v + _$0 "$1",${2--1} +_apply_tiles : +e[0--3] "Apply command '$1' on $2x$3x$4 tiles of image$?, with overlaps ($5,$6,$7) and "${"arg0 $8,dirichlet,neumann,periodic,mirror"}" boundary conditions." +foreach { +bw:=cut(round(ispercentage($2)?w*$2:$2),1,w) +bh:=cut(round(ispercentage($3)?h*$3:$3),1,h) +bd:=cut(round(ispercentage($4)?d*$4:$4),1,d) +ow:=round(ispercentage($5)?$bw*$5:$5) +oh:=round(ispercentage($6)?$bh*$6:$6) +od:=round(ispercentage($7)?$bd*$7:$7) +sw:=cut($bw-$ow,1,$bw) +sh:=cut($bh-$oh,1,$bh) +sd:=cut($bd-$od,1,$bd) +100%,100%,100%,{s+1} +if $ow>0" || "$oh>0" || "$od>0 l[] { +$bw,1,1 1,$bh,1 1,1,$bd += 1,50%,50%,50% distance 1 +/[0] {0.3*$bw} /[1] {0.3*$bh} /[2] {0.3*$bd} +sqr * -1 exp r $bw,$bh,$bd,1 * +} else $bw,$bh,$bd,1,1 +fi +$bw,$bh,$bd,[0] +m "__at : $1 k. r "$bw,$bh,$bd,{0,s},0 +eval " +ref(crop(#2),mask); +for (z = 0, z0:with specified timeout (in seconds) } +#@cli : Apply a command with a timeout. +#@cli : Set variable '$_is_timeout' to '1' if timeout occurred, '0' otherwise. +#@cli : Default value: 'timeout=20'. +apply_timeout : check "${2=20}>=0" +if $2<=0 +e[0--3] "Apply command '$1' on image$?, with no timeout." +$1 +_is_timeout=0 +else +e[0--3] "Apply command '$1' on image$?, with a timeout of $2 seconds." +l[] { ('$/') id:=is rm } +l { ++store initial +__done$id=0 __is_timeout$id=0 +parallel "$1 __done"$id"=1","l[] do if $|-"$|">$2 __is_timeout"$id"=1 error \"\" elif $__done"$id" break fi wait 100 while 1 done" +onfail +rm $initial +_is_timeout=0 +if ${__is_timeout$id} _is_timeout=1 error[0--5] "Command '$0': Time out ($2 seconds) for command '$1'." +else error[0--5] "Command '$0': "${} +fi +} +fi +#@cli check : condition : (+) +#@cli : Evaluate specified condition and display an error message if evaluated to false. +#@cli check3d : _is_full_check={ 0 | 1 } : (+) +#@cli : Check validity of selected 3D vector objects, and display an error message +#@cli : if one of the selected images is not a valid 3D vector object. +#@cli : Full 3D object check is slower but more precise. +#@cli : Default value: 'is_full_check=1'. +check_display : skip "${1=check_display}" +if !{*,u} error[0--3] "Command '$1': No display available." fi +check_opencv : skip "${1=check_opencv}" +if find(['$_flags'],'opencv')<0 +error[0--3] "Command '$1': No OpenCV features available. ""Your G'MIC interpreter has not been compiled with OpenCV support." +fi +#@cli continue : (+) +#@cli : Go to end of current 'do...while', 'for...done', 'foreach...done', 'local...done' or 'repeat...done' block. +#@cli : $ image.jpg repeat 10 blur 1 if 1==1 continue fi deform 10 done +#@cli break : (+) +#@cli : Break current 'do...while', 'for...done', 'foreach...done', 'local...done' or 'repeat...done' block. +#@cli : $ image.jpg repeat 10 blur 1 if 1==1 break fi deform 10 done +#@cli do : (+) +#@cli : Start a 'do...while' block. +#@cli : $ image.jpg luminance i:=ia+2 do set 255,{u(100)}%,{u(100)}% while ia<$i +#@cli done : (+) +#@cli : End a 'for/foreach/local/repeat...done' block, and go to associated 'for/foreach/repeat' if iterations remain. +#@cli : (eq. to '}'). +#@cli elif : condition : (+) +#@cli : Start a 'elif...[else]...fi' block if previous 'if' was not verified +#@cli : and test if specified condition holds +#@cli : 'condition' is a mathematical expression, whose evaluation is interpreted as { 0:false | other:true }.. +#@cli : $$ https://gmic.eu/tutorial/iffi +#@cli else : (+) +#@cli : Execute following commands if previous 'if' or 'elif' conditions failed. +#@cli : $$ https://gmic.eu/tutorial/iffi +#@cli fi : (+) +#@cli : End a 'if...[elif]...[else]...fi' block. +#@cli : (eq. to 'fi').\n +#@cli : $$ https://gmic.eu/tutorial/iffi +#@cli error : message : (+) +#@cli : Print specified error message on the standard error (stderr) and exit interpreter, except +#@cli : if error is caught by a 'onfail' command. +#@cli : Command selection (if any) stands for displayed call stack subset instead of image indices. +#@cli eval : expression : (+) +#@cli : Evaluate specified math expression. +#@cli : - If no command selection is specified, the expression is evaluated once and its result is set to status. +#@cli : - If command selection is specified, the evaluation is looped over selected images. Status is unchanged. In this case, 'eval' is similar to ''fill'' without assigning the image values. +#@cli x : eq. to 'exec'. : (+) +#@cli exec : _is_verbose={ 0 | 1 },"command" : (+) +#@cli : Execute external command using a system call. +#@cli : The status value is then set to the error code returned by the system call. +#@cli : If 'is_verbose=1', the executed command is allowed to output on stdout/stderr. +#@cli : (eq. to 'x'). +#@cli : Default value: 'is_verbose=1'. +#@cli xo : eq. to 'exec_out'. +xo : +v + _exec_out $"*" +#@cli exec_out : _mode,"command" +#@cli : Execute external command using a system call, and return resulting `stdout` and/or `stderr`. +#@cli : 'mode' can be { 0:stdout | 1:stderr | 2:stdout+stderr }. +exec_out : +v + _exec_out $"*" +_exec_out : +l[] { +if "isint($1) && isin($1,0,1,2)" mode=$1 command="${2--1}" +else mode=0 command="$*" +fi +onfail mode=0 command="$*" +} +s0,s1,s2=stdout,stderr,stdout+stderr +e[0--3] "Execute external command '"$command"', and return "${s$mode}" output." +filename_rand filename=${} +if !$mode x $command" > "$filename +elif $mode==1 x $command" 2> "$filename +else x $command" >"$filename" 2>&1" +fi +it $filename u {t} rm. delete $filename +#@cli for : condition : (+) +#@cli : Start a `for...done` block. +#@cli : $ image.jpg resize2dy 32 400,400,1,3 x=0 for $x<400 image[1] [0],$x,$x x+=40 done +#@cli foreach : (+) +#@cli : Start a 'foreach...done' block, that iterates over all images in the selection, with a separate local environment for each one. +#@cli : $ sample colorful,earth,duck,dog foreach[^2] +blur 10 sub normalize 0,255 done +#@cli if : condition : (+) +#@cli : Start a 'if...[elif]...[else]...fi' block and test if specified condition holds. +#@cli : 'condition' is a mathematical expression, whose evaluation is interpreted as { 0:false | other:true }. +#@cli : $ image.jpg if ia<64 add 50% elif ia<128 add 25% elif ia<192 sub 25% else sub 50% fi cut 0,255 +#@cli : $$ https://gmic.eu/tutorial/iffi +#@cli l : eq. to 'local'. : (+) +#@cli local : (+) +#@cli : Start a 'local...[onfail]...done' block, with selected images. +#@cli : (eq. to 'l'). +#@cli : $ image.jpg local[] 300,300,1,3 rand[0] 0,255 blur 4 sharpen 1000 done +#@cli : $ image.jpg +local repeat 3 { deform 20 } done +#@cli : $$ https://gmic.eu/oldtutorial/_local +#@cli mutex : index,_action={ 0:unlock | 1:lock } : (+) +#@cli : Lock or unlock specified mutex for multi-threaded programming. +#@cli : A locked mutex can be unlocked only by the same thread. All mutexes are unlocked by default. +#@cli : 'index' designates the mutex index, in [0,255]. +#@cli : Default value: 'action=1'. +#@cli noarg : (+) +#@cli : Used in a custom command, 'noarg' tells the command that its argument list have not been used +#@cli : finally, and so they must be evaluated next in the G'MIC pipeline, just as if the custom +#@cli : command takes no arguments at all. +#@cli : Use this command to write a custom command which can decide if it takes arguments or not. +#@cli onfail : (+) +#@cli : Execute following commands when an error is encountered in the body of the 'local...done' block. +#@cli : The status value is set with the corresponding error message. +#@cli : $ image.jpg +local blur -3 onfail mirror x done +#@cli parallel : _wait_threads,"command1","command2",... : (+) +#@cli : Execute specified commands in parallel, each in a different thread. +#@cli : Parallel threads share the list of images. +#@cli : 'wait_threads' can be { 0:when current environment ends | 1:immediately }. +#@cli : Default value: 'wait_threads=1'. +#@cli : $ image.jpg [0] parallel "blur[0] 3","mirror[1] c" +parallel : skip "${1=},${2=},${3=},${4=},${5=},${6=},${7=},${8=},${9=},${10=},${11=},${12=},${13=},${14=},${15=}" +if inrange($1,0,2) e[0--3] "Execute "{$#-1}" commands '${2--1}' in parallel on image$?." +else e[0--3] "Execute "$#" commands '$*' in parallel on image$?." +fi +parallel $"*" +#@cli progress : 0<=value<=100 : -1 : (+) +#@cli : Set the progress index of the current processing pipeline. +#@cli : This command is useful only when G'MIC is used by an embedding application. +#@cli q : eq. to 'quit'. : (+) +#@cli quit : (+) +#@cli : Quit G'MIC interpreter. +#@cli : (eq. to 'q'). +#@cli repeat : nb_iterations : (+) +#@cli : Start 'nb_iterations' iterations of a `repeat...done` block. +#@cli : 'nb_iterations' is a mathematical expression that will be evaluated. +#@cli : $ image.jpg split y repeat $! n=$> shift[$n] $<,0,0,0,2 done append y +#@cli : $ image.jpg mode3d 2 repeat 4 imagecube3d rotate3d 1,1,0,40 snapshot3d 400,1.4 done +#@cli : $$ https://gmic.eu/oldtutorial/_repeat +#@cli return : (+) +#@cli : Return from current custom command. +#@cli rprogress : 0<=value<=100 | -1 | "command",0<=value_min<=100,0<=value_max<=100 +#@cli : Set the progress index of the current processing pipeline (relatively to +#@cli : previously defined progress bounds), or call the specified command with +#@cli : specified progress bounds. +rprogress : skip ${2=""} +if !narg($_progress_bounds) _progress_bounds=0,100 fi +m:=arg(-2,$_progress_bounds) M:=arg(-1,$_progress_bounds) +if $#==2&&!narg($2) # 1 argument -> Set progress bar. +e[0--3] "Set relative progress index to $1%." +progress {$1<0?-1:min(100,max(0,$m+($M-$m)*$1%))} +elif $#==3 # 3 arguments -> Call command with specified bounds. +nm:=min($2,$-1) nM:=max($2,$-1) +e[0--3] "Call command '$1' with progress bounds ["$nm,$nM"]." +progress $m _progress_bounds=$_progress_bounds,{$m+$nm*($M-$m)/100},{$m+$nM*($M-$m)/100} +run "$1" +progress $M ($_progress_bounds) _progress_bounds={@0--3} rm. +else error[0--3] "Command '$0': Invalid argument '$*'." +fi +#@cli run : "G'MIC pipeline" +#@cli : Run specified G'MIC pipeline. +run : +m "__run : $*" v=$^ v {$v+2} __run v $v um __run +#@cli skip : item : (+) +#@cli : Do nothing but skip specified item. +#@cli u : eq. to 'status'. : (+) +#@cli status : status_string : (+) +#@cli : Set the current status. Used to define a returning value from a function. +#@cli : (eq. to 'u'). +#@cli : $ image.jpg command "foo : u0=Dark u1=Bright status ${u{ia>=128}}" text_outline ${-foo},2,2,23,2,1,255 +#@cli while : condition : (+) +#@cli : End a 'do...while' block and go back to associated 'do' if specified condition holds. +#@cli : 'condition' is a mathematical expression, whose evaluation is interpreted as { 0:false | other:true }. +#@cli :: Neural Networks +#@cli nn_lib : +#@cli : Return the list of library functions that has to be included in a math expression,in order to use the neural network library. +nn_lib : +u " +begin( +const nn_nb_threads_max = n; +const nn_is_training = $_nn_is_training!=0; +); +begin_t( +nn_thread_id = t; +nn_nb_threads_used = nn_thread_id + 1; +nn_batch_size = 0; +); +++nn_batch_size; +end( +merge(nn_nb_threads_used,max); +merge(nn_batch_size,+); +); +nn_display(L) = display(L#,L#_width,L#_height,L#_depth,L#_spectrum); +nn_display(L,M) = display(L#,M#_width,M#_height,M#_depth,M#_spectrum); +nn_store(L) = store(['L#'],L#,L#_width,L#_height,L#_depth,L#_spectrum); +nn_store(L,M) = store(['L#'],L#,M#_width,M#_height,M#_depth,M#_spectrum); +nn_activation_elu(z) = (z<0?exp(z) - 1:z); +nn_activation_d_elu(z) = (z<0?exp(z):1); +"{['$_expr']!=0}"?( +begin( +_nn_tab_expr = expr('z = lerp(-32,32,x/(w-1)); "$_expr"',65537); +_nn_tab_d_expr = vector(#size(_nn_tab_expr)); +const _nn_delta_expr = 64/(size(_nn_tab_expr) - 1); +fill(_nn_tab_d_expr,_nn_k, +_nn_pk = _nn_k?_nn_k - 1:_nn_k; +_nn_nk = _nn_k=0); +nn_activation_sigmoid(z) = (0.5 + 0.5*tanh(z/2)); +nn_activation_d_sigmoid(z) = (_nn_sig = nn_activation_sigmoid(z); _nn_sig*(1 - _nn_sig)); +nn_activation_sin(z) = sin(z); +nn_activation_d_sin(z) = cos(z); +nn_activation_sinc(z) = sinc(z); +nn_activation_d_sinc(z) = ((cos(z) - sinc(z))/(1e-10+z)); +nn_activation_sqr(z) = (z^2); +nn_activation_d_sqr(z) = (2*z); +nn_activation_sqrt(z) = (sqrt(abs(z))); +nn_activation_d_sqrt(z) = (0.5*sign(x)/sqrt(max(1e-8,abs(z)))); +const _nn_steps_S0 = isnan($_S0)?2:$_S0; +const _nn_steps_S1 = isnan($_S1)?0.5:$_S1; +const _nn_steps_b = (1 - _nn_steps_S1)/2; +const _nn_steps_eps = _nn_steps_b/max(1e-10,_nn_steps_S0 - _nn_steps_S1); +nn_activation_steps(z) = ( +_nn_steps_zi = round(z); +_nn_steps_zf = z - _nn_steps_zi; +_nn_steps_zi + (_nn_steps_zf<-_nn_steps_eps?_nn_steps_S1*_nn_steps_zf - _nn_steps_b: +_nn_steps_zf<_nn_steps_eps?_nn_steps_S0*_nn_steps_zf: +_nn_steps_S1*_nn_steps_zf + _nn_steps_b); +); +nn_activation_d_steps(z) = ( +_nn_steps_zi = round(z); +_nn_steps_zf = z - _nn_steps_zi; +abs(_nn_steps_zf)<_nn_steps_eps?_nn_steps_S0:_nn_steps_S1; +); +nn_activation_swish(z) = (z*nn_activation_sigmoid(z)); +nn_activation_d_swish(z) = ( +_nn_sig = nn_activation_sigmoid(z); +_nn_swi = z*_nn_sig; +_nn_swi + _nn_sig*(1 - _nn_swi) +); +nn_activation_tanh(z) = (tanh(z)); +nn_activation_d_tanh(z) = (1 - tanh(z)^2); +nn_activation_waves(z,a,b,c) = ( +_nn_waves_zi = round(z); +_nn_waves_zf = z - _nn_waves_zi; +_nn_waves_zi + a*_nn_waves_zf^3 + b*sign(_nn_waves_zf)*abs(_nn_waves_zf)^2 + c*_nn_waves_zf; +); +nn_activation_d_waves(z,a,b,c) = ( +_nn_waves_zi = round(z); +_nn_waves_zf = z - _nn_waves_zi; +3*a*_nn_waves_zf^2 + 2*b*abs(_nn_waves_zf) + c; +); +const _nn_waves0_S0 = isnan($_S0)?2:$_S0; +const _nn_waves0_S1 = isnan($_S1)?-1:$_S1; +const _nn_waves0_a = 4*_nn_waves0_S0 + 4*_nn_waves0_S1 - 8; +const _nn_waves0_b = -4*_nn_waves0_S0 - 2*_nn_waves0_S1 + 6; +const _nn_waves0_c = _nn_waves0_S0; +nn_activation_waves0(z) = nn_activation_waves(z,_nn_waves0_a,_nn_waves0_b,_nn_waves0_c); +nn_activation_d_waves0(z) = nn_activation_d_waves(z,_nn_waves0_a,_nn_waves0_b,_nn_waves0_c); +nn_activation_waves1(z) = nn_activation_waves(z,-6,3,1); +nn_activation_d_waves1(z) = nn_activation_d_waves(z,-6,3,1); +nn_activation_waves2(z) = nn_activation_waves(z,-4,0,2); +nn_activation_d_waves2(z) = nn_activation_d_waves(z,-4,0,2); +nn_activation_waves3(z) = nn_activation_waves(z,-2,-3,3); +nn_activation_d_waves3(z) = nn_activation_d_waves(z,-2,-3,3); +nn_activation_waves4(z) = nn_activation_waves(z,0,-6,4); +nn_activation_d_waves4(z) = nn_activation_d_waves(z,0,-6,4); +nn_activation_zpsinz(z) = (z + 0.5*sin(2*pi*z)); +nn_activation_d_zpsinz(z) = (1 + pi*cos(2*pi*z)); +nn_trainer_init_backward(T,L,O,S) = ( +const T#_ind = $T#; +nn_iteration = i[##T#_ind,0]; +nn_learning_rate = i[##T#_ind,1]; +nn_learning_rate0 = i[##T#_ind,2]; +nn_previous_loss = i[##T#_ind,3]; +nn_best_loss = i[##T#_ind,4]; +nn_optimizer_#O#_init(); +nn_scheduler_#S#_init(); +); +nn_trainer_update(T,L,S) = ( +nn_scheduler_#S#_update(#T,#L); +i[##T#_ind,0] = ++nn_iteration; +i[##T#_ind,1] = nn_learning_rate; +i[##T#_ind,3] = L#; +i[##T#_ind,4] = min(nn_best_loss,L#); +); +nn_scheduler_constant_init() = 0; +nn_scheduler_constant_update(T,L) = 0; +nn_scheduler_linear_init() = 0; +nn_scheduler_linear_update(T,L) = ( +nn_learning_rate = lerp(nn_learning_rate0,1e-8,min(1,nn_iteration/1000)); +); +nn_scheduler_exponential_init() = 0; +nn_scheduler_exponential_update(T,L) = ( +nn_learning_rate*=0.999; +); +nn_scheduler_adaptive_init(T) = ( +nn_adaptive_trend_moment = i(##T#_ind,0,2,0,0); +nn_adaptive_nb_decreases = i(##T#_ind,1,2,0,0); +nn_adaptive_nb_increases = i(##T#_ind,2,2,0,0); +); +nn_scheduler_adaptive_update(T,L) = ( +nn_iteration?( +nn_adaptive_trend = (L# - nn_previous_loss)/max(1e-8,nn_previous_loss); +nn_adaptive_trend_moment = lerp(sign(nn_adaptive_trend),nn_adaptive_trend_moment,0.75); +nn_adaptive_trend>=0.3?( +nn_learning_rate = max(0.25*nn_learning_rate,1e-8); +nn_adaptive_nb_increases = nn_adaptive_nb_decreases = 0; +):nn_adaptive_trend_moment>=0?( +++nn_adaptive_nb_increases; +nn_adaptive_nb_decreases = 0; +nn_adaptive_nb_increases>=2?( +nn_learning_rate = max(0.75*nn_learning_rate,1e-8); +nn_adaptive_nb_increases = 0; +); +):nn_adaptive_trend_moment<0?( +++nn_adaptive_nb_decreases; +nn_adaptive_nb_decreases>=4?( +nn_learning_rate = min(nn_learning_rate*1.15,0.1); +nn_adaptive_nb_decreases = 0; +); +); +); +copy(i(##T#_ind,0,2,0,0),[ nn_adaptive_trend_moment,nn_adaptive_nb_decreases,nn_adaptive_nb_increases ]); +); +nn_optimizer_generic_update_normalize(O,P,learning_mode) = ( +P#_is_channelwise?( # Channel-by-channel normalization +draw(##P#_ind,batch_#P#_avg,2,0,1,h##P#_ind,0.01); +draw(##P#_ind,batch_#P#_var,3,0,1,h##P#_ind,0.01); +learning_mode&1?( +nn_optimizer_#O#_update_weights(P#_alpha); +draw(##P#_ind,P#_alpha,0,0,1,h##P#_ind); +); +learning_mode&2?( +nn_optimizer_#O#_update_weights(P#_beta); +draw(##P#_ind,P#_beta,1,0,1,h##P#_ind); +); +):( +i[##P#_ind,2] = lerp(P#_avg,batch_#P#_avg,0.01); +i[##P#_ind,3] = lerp(P#_var,batch_#P#_var,0.01); +learning_mode&1?( +nn_optimizer_#O#_update_weights(P#_alpha); +i[##P#_ind,0] = P#_alpha; +); +learning_mode&2?( +nn_optimizer_#O#_update_weights(P#_beta); +i[##P#_ind,1] = P#_beta; +); +); +); +nn_optimizer_sgd_init() = 0; +nn_optimizer_sgd_update_weights(W) = ( +W#-=nn_learning_rate*batch_d#W; +); +nn_optimizer_sgd_update_conv_or_fc(P,learning_mode) = ( +learning_mode&1?( +nn_optimizer_sgd_update_weights(P#_weights); +draw(##P#_ind,P#_weights,0,0,w##P#_ind - 1,h##P#_ind); +); +learning_mode&2?( +nn_optimizer_sgd_update_weights(P#_biases); +draw(##P#_ind,P#_biases,w##P#_ind - 1,0,1,h##P#_ind); +); +); +nn_optimizer_sgd_update_conv2d(P,learning_mode) = ( +learning_mode?nn_optimizer_sgd_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_sgd_update_conv3d(P,learning_mode) = ( +learning_mode?nn_optimizer_sgd_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_sgd_update_fc(P,learning_mode) = ( +learning_mode?nn_optimizer_sgd_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_sgd_update_normalize(P,learning_mode) = ( +nn_optimizer_generic_update_normalize(sgd,#P,#learning_mode); +); +nn_optimizer_sgd_update_nlfc(P,learning_mode) = ( +learning_mode&1?( +nn_optimizer_sgd_update_weights(P#_weights); +draw(##P#_ind,P#_weights,0,0,w##P#_ind/2,h##P#_ind); +); +learning_mode&2?( +nn_optimizer_sgd_update_weights(P#_biases); +draw(##P#_ind,P#_biases,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +); +); +nn_optimizer_rmsprop_init() = ( +const nn_optimizer_rmsprop_beta = 0.9; +); +nn_optimizer_rmsprop_update_weights(W) = ( +d#W#_g2 = lerp(batch_d#W^2,d#W#_g2,nn_optimizer_rmsprop_beta); +W#-=nn_learning_rate*batch_d#W/sqrt(1e-8 + d#W#_g2); +); +nn_optimizer_rmsprop_update_conv_or_fc(P,learning_mode) = ( +const P#_ind_g2 = $P#_g2; +learning_mode&1?( +d#P#_weights_g2 = crop(##P#_ind_g2,0,0,w##P#_ind - 1,h##P#_ind); +nn_optimizer_rmsprop_update_weights(P#_weights); +draw(##P#_ind,P#_weights,0,0,w##P#_ind - 1,h##P#_ind); +draw(##P#_ind_g2,d#P#_weights_g2,0,0,w##P#_ind - 1,h##P#_ind); +); +learning_mode&2?( +d#P#_biases_g2 = crop(##P#_ind_g2,w##P#_ind - 1,0,1,h##P#_ind); +nn_optimizer_rmsprop_update_weights(P#_biases); +draw(##P#_ind,P#_biases,w##P#_ind - 1,0,1,h##P#_ind); +draw(##P#_ind_g2,d#P#_biases_g2,w##P#_ind - 1,0,1,h##P#_ind); +); +); +nn_optimizer_rmsprop_update_conv2d(P,learning_mode) = ( +learning_mode?nn_optimizer_rmsprop_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_rmsprop_update_conv3d(P,learning_mode) = ( +learning_mode?nn_optimizer_rmsprop_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_rmsprop_update_fc(P,learning_mode) = ( +learning_mode?nn_optimizer_rmsprop_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_rmsprop_update_normalize(P,learning_mode) = ( +const P#_ind_g2 = $P#_g2; +learning_mode?( +P#_is_channelwise?( # Channel-by-channel normalization +d#P#_alpha_g2 = crop(##P#_ind_g2,0,1); +d#P#_beta_g2 = crop(##P#_ind_g2,1,1); +):( +d#P#_alpha_g2 = i[##P#_ind_g2,0]; +d#P#_beta_g2 = i[##P#_ind_g2,1]; +); +); +nn_optimizer_generic_update_normalize(rmsprop,#P,#learning_mode); +); +nn_optimizer_rmsprop_update_nlfc(P,learning_mode) = ( +const P#_ind_g2 = $P#_g2; +learning_mode&1?( +d#P#_weights_g2 = crop(##P#_ind_g2,0,0,w##P#_ind/2,h##P#_ind); +nn_optimizer_rmsprop_update_weights(P#_weights); +draw(##P#_ind,P#_weights,0,0,w##P#_ind/2,h##P#_ind); +draw(##P#_ind_g2,d#P#_weights_g2,0,0,w##P#_ind/2,h##P#_ind); +); +learning_mode&2?( +d#P#_biases_g2 = crop(##P#_ind_g2,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +nn_optimizer_rmsprop_update_weights(P#_biases); +draw(##P#_ind,P#_biases,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +draw(##P#_ind_g2,d#P#_biases_g2,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +); +); +nn_optimizer_adam_init() = ( +begin( +const nn_optimizer_adam_beta1 = 0.9; +const nn_optimizer_adam_beta2 = 0.999; +nn_optimizer_adam_beta1_t = nn_iteration>200?0:nn_optimizer_adam_beta1^(nn_iteration + 1); +nn_optimizer_adam_beta2_t = nn_iteration>200?0:nn_optimizer_adam_beta2^(nn_iteration + 1); +nn_optimizer_adam_alpha_t = sqrt(1 - nn_optimizer_adam_beta2_t)/(1 - nn_optimizer_adam_beta1_t); +); +); +nn_optimizer_adam_update_weights(W) = ( +d#W#_m = lerp(batch_d#W,d#W#_m,nn_optimizer_adam_beta1); +d#W#_v = lerp(batch_d#W^2,d#W#_v,nn_optimizer_adam_beta2); +W#-=nn_learning_rate*nn_optimizer_adam_alpha_t*d#W#_m/sqrt(1e-8 + d#W#_v); +); +nn_optimizer_adam_update_conv_or_fc(P,learning_mode) = ( +const P#_ind_m = $P#_m; +const P#_ind_v = $P#_v; +learning_mode&1?( +d#P#_weights_m = crop(##P#_ind_m,0,0,w##P#_ind - 1,h##P#_ind); +d#P#_weights_v = crop(##P#_ind_v,0,0,w##P#_ind - 1,h##P#_ind); +nn_optimizer_adam_update_weights(P#_weights); +draw(##P#_ind,P#_weights,0,0,w##P#_ind - 1,h##P#_ind); +draw(##P#_ind_m,d#P#_weights_m,0,0,w##P#_ind - 1,h##P#_ind); +draw(##P#_ind_v,d#P#_weights_v,0,0,w##P#_ind - 1,h##P#_ind); +); +learning_mode&2?( +d#P#_biases_m = crop(##P#_ind_m,w##P#_ind - 1,0,1,h##P#_ind); +d#P#_biases_v = crop(##P#_ind_v,w##P#_ind - 1,0,1,h##P#_ind); +nn_optimizer_adam_update_weights(P#_biases); +draw(##P#_ind,P#_biases,w##P#_ind - 1,0,1,h##P#_ind); +draw(##P#_ind_m,d#P#_biases_m,w##P#_ind - 1,0,1,h##P#_ind); +draw(##P#_ind_v,d#P#_biases_v,w##P#_ind - 1,0,1,h##P#_ind); +); +); +nn_optimizer_adam_update_conv2d(P,learning_mode) = ( +learning_mode?nn_optimizer_adam_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_adam_update_conv3d(P,learning_mode) = ( +learning_mode?nn_optimizer_adam_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_adam_update_fc(P,learning_mode) = ( +learning_mode?nn_optimizer_adam_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_adam_update_normalize(P,learning_mode) = ( +const P#_ind_m = $P#_m; +const P#_ind_v = $P#_v; +learning_mode?( +P#_is_channelwise?( # Channel-by-channel normalization +d#P#_alpha_m = crop(##P#_ind_m,0,1); +d#P#_beta_m = crop(##P#_ind_m,1,1); +d#P#_alpha_v = crop(##P#_ind_v,0,1); +d#P#_beta_v = crop(##P#_ind_v,1,1); +):( +d#P#_alpha_m = i[##P#_ind_m,0]; +d#P#_beta_m = i[##P#_ind_m,1]; +d#P#_alpha_v = i[##P#_ind_v,0]; +d#P#_beta_v = i[##P#_ind_v,1]; +); +); +nn_optimizer_generic_update_normalize(adam,#P,#learning_mode); +); +nn_optimizer_adam_update_nlfc(P,learning_mode) = ( +learning_mode?( +const P#_ind_m = $P#_m; +const P#_ind_v = $P#_v; +learning_mode&1?( +d#P#_weights_m = crop(##P#_ind_m,0,0,w##P#_ind/2,h##P#_ind); +d#P#_weights_v = crop(##P#_ind_v,0,0,w##P#_ind/2,h##P#_ind); +nn_optimizer_adam_update_weights(P#_weights); +draw(##P#_ind,P#_weights,0,0,w##P#_ind/2,h##P#_ind); +draw(##P#_ind_m,d#P#_weights_m,0,0,w##P#_ind/2,h##P#_ind); +draw(##P#_ind_v,d#P#_weights_v,0,0,w##P#_ind/2,h##P#_ind); +); +learning_mode&2?( +d#P#_biases_m = crop(##P#_ind_m,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +d#P#_biases_v = crop(##P#_ind_v,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +nn_optimizer_adam_update_weights(P#_biases); +draw(##P#_ind,P#_biases,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +draw(##P#_ind_m,d#P#_biases_m,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +draw(##P#_ind_v,d#P#_biases_v,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +); +); +); +nn_optimizer_adamax_init() = ( +begin( +const nn_optimizer_adamax_beta1 = 0.9; +const nn_optimizer_adamax_beta2 = 0.999; +nn_optimizer_adamax_ombeta1_t = nn_iteration>200?1:(1 - nn_optimizer_adamax_beta1^(nn_iteration + 1)); +); +); +nn_optimizer_adamax_update_weights(W) = ( +d#W#_m = lerp(batch_d#W,d#W#_m,nn_optimizer_adamax_beta1); +d#W#_v = vmax(abs(batch_d#W),nn_optimizer_adamax_beta2*d#W#_v); +W#-=(nn_learning_rate/nn_optimizer_adamax_ombeta1_t)*d#W#_m/sqrt(1e-8 + d#W#_v); +); +nn_optimizer_adamax_update_conv_or_fc(P,learning_mode) = ( +const P#_ind_m = $P#_m; +const P#_ind_v = $P#_v; +learning_mode&1?( +d#P#_weights_m = crop(##P#_ind_m,0,0,w##P#_ind - 1,h##P#_ind); +d#P#_weights_v = crop(##P#_ind_v,0,0,w##P#_ind - 1,h##P#_ind); +nn_optimizer_adamax_update_weights(P#_weights); +draw(##P#_ind,P#_weights,0,0,w##P#_ind - 1,h##P#_ind); +draw(##P#_ind_m,d#P#_weights_m,0,0,w##P#_ind - 1,h##P#_ind); +draw(##P#_ind_v,d#P#_weights_v,0,0,w##P#_ind - 1,h##P#_ind); +); +learning_mode&2?( +d#P#_biases_m = crop(##P#_ind_m,w##P#_ind - 1,0,1,h##P#_ind); +d#P#_biases_v = crop(##P#_ind_v,w##P#_ind - 1,0,1,h##P#_ind); +nn_optimizer_adamax_update_weights(P#_biases); +draw(##P#_ind,P#_biases,w##P#_ind - 1,0,1,h##P#_ind); +draw(##P#_ind_m,d#P#_biases_m,w##P#_ind - 1,0,1,h##P#_ind); +draw(##P#_ind_v,d#P#_biases_v,w##P#_ind - 1,0,1,h##P#_ind); +); +); +nn_optimizer_adamax_update_conv2d(P,learning_mode) = ( +learning_mode?nn_optimizer_adamax_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_adamax_update_conv3d(P,learning_mode) = ( +learning_mode?nn_optimizer_adamax_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_adamax_update_fc(P,learning_mode) = ( +learning_mode?nn_optimizer_adamax_update_conv_or_fc(#P,learning_mode); +); +nn_optimizer_adamax_update_normalize(P,learning_mode) = ( +const P#_ind_m = $P#_m; +const P#_ind_v = $P#_v; +learning_mode?( +P#_is_channelwise?( # Channel-by-channel normalization +d#P#_alpha_m = crop(##P#_ind_m,0,1); +d#P#_beta_m = crop(##P#_ind_m,1,1); +d#P#_alpha_v = crop(##P#_ind_v,0,1); +d#P#_beta_v = crop(##P#_ind_v,1,1); +):( +d#P#_alpha_m = i[##P#_ind_m,0]; +d#P#_beta_m = i[##P#_ind_m,1]; +d#P#_alpha_v = i[##P#_ind_v,0]; +d#P#_beta_v = i[##P#_ind_v,1]; +); +); +nn_optimizer_generic_update_normalize(adamax,#P,#learning_mode); +); +nn_optimizer_adamax_update_nlfc(P,learning_mode) = ( +const P#_ind_m = $P#_m; +const P#_ind_v = $P#_v; +learning_mode&1?( +d#P#_weights_m = crop(##P#_ind_m,0,0,w##P#_ind/2,h##P#_ind); +d#P#_weights_v = crop(##P#_ind_v,0,0,w##P#_ind/2,h##P#_ind); +nn_optimizer_adamax_update_weights(P#_weights); +draw(##P#_ind,P#_weights,0,0,w##P#_ind/2,h##P#_ind); +draw(##P#_ind_m,d#P#_weights_m,0,0,w##P#_ind/2,h##P#_ind); +draw(##P#_ind_v,d#P#_weights_v,0,0,w##P#_ind/2,h##P#_ind); +); +learning_mode&2?( +d#P#_biases_m = crop(##P#_ind_m,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +d#P#_biases_v = crop(##P#_ind_v,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +nn_optimizer_adamax_update_weights(P#_biases); +draw(##P#_ind,P#_biases,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +draw(##P#_ind_m,d#P#_biases_m,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +draw(##P#_ind_v,d#P#_biases_v,w##P#_ind/2,0,w##P#_ind/2,h##P#_ind); +); +); +nn_add_init_forward(OUT,IN) = ( +const OUT#_width = IN#_width; +const OUT#_height = IN#_height; +const OUT#_depth = IN#_depth; +const OUT#_spectrum = IN#_spectrum; +); +nn_add_forward(OUT,IN0,IN1) = ( +OUT# = IN0# + IN1#; +); +nn_add_backward(OUT,IN0,IN1) = ( +d#IN0 = d#IN1 = d#OUT/2; +); +nn_append_init_forward(OUT,IN0,IN1) = ( +const OUT#_width = IN0#_width; +const OUT#_height = IN0#_height; +const OUT#_depth = IN0#_depth; +const OUT#_spectrum = IN0#_spectrum + IN1#_spectrum; +); +nn_append_forward(OUT,IN0,IN1) = ( +OUT# = vector(#size(IN0#) + size(IN1#)); +copy(OUT#,IN0#,size(IN0#)); +copy(OUT#[size(IN0#)],IN1#,size(IN1#)); +); +nn_append_backward(OUT,IN0,IN1) = ( +d#IN0 = d#OUT[0,size(IN0#)]; +d#IN1 = d#OUT[size(IN0#),size(IN1#)]; +); +nn_avgpool2d_init_forward(OUT,IN,patch_size) = ( +const OUT#_width = int(IN#_width/patch_size); +const OUT#_height = int(IN#_height/patch_size); +const OUT#_depth = IN#_depth; +const OUT#_spectrum = IN#_spectrum; +); +nn_avgpool2d_forward(OUT,IN) = ( +OUT# = resize(IN#, +IN#_width,IN#_height,IN#_depth,IN#_spectrum, +OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +2); +); +nn_avgpool2d_backward(OUT,IN) = ( +d#IN = resize(d#OUT, +OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +IN#_width,IN#_height,IN#_depth,IN#_spectrum, +1); +); +nn_avgpool3d_init_forward(OUT,IN,patch_size) = ( +const OUT#_width = int(IN#_width/patch_size); +const OUT#_height = int(IN#_height/patch_size); +const OUT#_depth = int(IN#_depth/patch_size); +const OUT#_spectrum = IN#_spectrum; +); +nn_avgpool3d_forward(OUT,IN) = nn_avgpool2d_forward(OUT#,IN#); # Same as avgpool2d +nn_avgpool3d_backward(OUT,IN) = nn_avgpool2d_backward(OUT#,IN#); # Same as avgpool2d +nn_clone_init_forward(OUT0,OUT1,IN) = ( +const OUT0#_width = IN#_width; +const OUT0#_height = IN#_height; +const OUT0#_depth = IN#_depth; +const OUT0#_spectrum = IN#_spectrum; +const OUT1#_width = IN#_width; +const OUT1#_height = IN#_height; +const OUT1#_depth = IN#_depth; +const OUT1#_spectrum = IN#_spectrum; +); +nn_clone_forward(OUT0,OUT1,IN) = ( +OUT0# = IN#; +OUT1# = IN#; +); +nn_clone_backward(OUT0,OUT1,IN) = ( +d#IN = d#OUT0 + d#OUT1; +); +nn_conv2d_init_forward(OUT,IN,size,stride,dilation,shrink,boundary_conditions) = ( +const OUT#_ind = $OUT#; +const OUT#_shrink = shrink; +const OUT#_width = int(IN#_width/stride) - 2*OUT#_shrink; +const OUT#_height = int(IN#_height/stride) - 2*OUT#_shrink; +const OUT#_depth = IN#_depth; +const OUT#_spectrum = h##OUT#_ind; +const OUT#_whd = OUT#_width*OUT#_height*OUT#_depth; +const OUT#_kernel_size = size; +const OUT#_kernel_size2 = OUT#_kernel_size^2; +const OUT#_kernel_center = OUT#_kernel_size - 1 - int(OUT#_kernel_size/2); +const OUT#_stride = stride; +const OUT#_dilation = dilation; +const OUT#_boundary_conditions = boundary_conditions; +OUT#_weights = crop(##OUT#_ind,0,0,w##OUT#_ind - 1,OUT#_spectrum); +OUT#_biases = crop(##OUT#_ind,w##OUT#_ind - 1,0,1,OUT#_spectrum); +); +nn_conv2d_forward(OUT,IN) = ( +OUT# = convolve(IN#, +IN#_width,IN#_height,IN#_depth,IN#_spectrum, +OUT#_weights, +OUT#_kernel_size,OUT#_kernel_size,1,IN#_spectrum*OUT#_spectrum, +OUT#_boundary_conditions,0,2, +OUT#_kernel_center,OUT#_kernel_center,0, +OUT#_shrink,OUT#_shrink,0, +OUT#_width - 1 + OUT#_shrink,OUT#_height - 1 + OUT#_shrink,OUT#_depth - 1, +OUT#_stride,OUT#_stride,1, +OUT#_dilation,OUT#_dilation,1); +repeat (OUT#_spectrum,_nn_k,copy(OUT#[_nn_k*OUT#_whd],OUT#_biases[_nn_k],OUT#_whd,1,0,-1)); # Add biases +); +nn_conv2d_init_backward(OUT,IN) = ( +batch_d#OUT#_weights = vector(#size(OUT#_weights)); +batch_d#OUT#_biases = vector(#size(OUT#_biases)); +); +nn_conv2d_backward(OUT,IN) = ( +const OUT#_offset = -int(OUT#_shrink/OUT#_stride); +const OUT#_invstride = 1/OUT#_stride; +const OUT#_dons = OUT#_dilation/OUT#_stride; +d#IN = vector(#size(IN#)); +repeat (IN#_spectrum,_nn_k, +draw(d#IN,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +correlate(d#OUT, +OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +crop(OUT#_weights,w##OUT#_ind - 1,OUT#_spectrum,1,1, +_nn_k*OUT#_kernel_size2,0,OUT#_kernel_size2,OUT#_spectrum), +OUT#_kernel_size,OUT#_kernel_size,1,OUT#_spectrum, +0,0,2, +OUT#_kernel_center,OUT#_kernel_center,0, +OUT#_offset,OUT#_offset,0, +IN#_width - 1 + OUT#_offset,IN#_height - 1 + OUT#_offset,IN#_depth - 1, +OUT#_invstride,OUT#_invstride,1, +OUT#_dons,OUT#_dons,1), +0,0,0,_nn_k,IN#_width,IN#_height,IN#_depth,1); +); +d#OUT#_biases = vector(#size(OUT#_biases)); +fill(d#OUT#_biases,_nn_k,sum(d#OUT[_nn_k*OUT#_whd,OUT#_whd])); +batch_d#OUT#_biases+=d#OUT#_biases; +const OUT#_dcenter = OUT#_dilation*OUT#_kernel_center; +const OUT#_kend = OUT#_kernel_size - 1 + OUT#_offset; +d#OUT#_weights = vector(#size(OUT#_weights)); +repeat (OUT#_spectrum,_nn_k, +draw(d#OUT#_weights, +OUT#_kernel_size,OUT#_kernel_size,1,OUT#_spectrum*IN#_spectrum, +correlate(crop(d#OUT,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +0,0,0,_nn_k,OUT#_width,OUT#_height,OUT#_depth,1), +OUT#_width,OUT#_height,OUT#_depth,1, +IN#, +IN#_width,IN#_height,IN#_depth,IN#_spectrum, +0,0,1, +OUT#_dcenter,OUT#_dcenter,0, +OUT#_offset,OUT#_offset,0, +OUT#_kend,OUT#_kend,0, +OUT#_dons,OUT#_dons,1, +OUT#_invstride,OUT#_invstride,1), +0,0,0,_nn_k*IN#_spectrum, +OUT#_kernel_size,OUT#_kernel_size,1,IN#_spectrum); +); +batch_d#OUT#_weights+=d#OUT#_weights; +); +nn_conv2d_end_backward(OUT) = ( +merge(batch_d#OUT#_weights,+); +merge(batch_d#OUT#_biases,+); +batch_d#OUT#_weights/=nn_batch_size; +batch_d#OUT#_biases/=nn_batch_size; +); +nn_conv3d_init_forward(OUT,IN,size,stride,dilation,shrink,boundary_conditions) = ( +const OUT#_ind = $OUT#; +const OUT#_shrink = shrink; +const OUT#_width = int(IN#_width/stride) - 2*OUT#_shrink; +const OUT#_height = int(IN#_height/stride) - 2*OUT#_shrink; +const OUT#_depth = int(IN#_depth/stride) - 2*OUT#_shrink; +const OUT#_spectrum = h##OUT#_ind; +const OUT#_whd = OUT#_width*OUT#_height*OUT#_depth; +const OUT#_kernel_size = size; +const OUT#_kernel_size3 = OUT#_kernel_size^3; +const OUT#_kernel_center = OUT#_kernel_size - 1 - int(OUT#_kernel_size/2); +const OUT#_stride = stride; +const OUT#_dilation = dilation; +const OUT#_boundary_conditions = boundary_conditions; +OUT#_weights = crop(##OUT#_ind,0,0,w##OUT#_ind - 1,OUT#_spectrum); +OUT#_biases = crop(##OUT#_ind,w##OUT#_ind - 1,0,1,OUT#_spectrum); +); +nn_conv3d_forward(OUT,IN) = ( +OUT# = convolve(IN#, +IN#_width,IN#_height,IN#_depth,IN#_spectrum, +OUT#_weights, +OUT#_kernel_size,OUT#_kernel_size,OUT#_kernel_size,IN#_spectrum*OUT#_spectrum, +OUT#_boundary_conditions,0,2, +OUT#_kernel_center,OUT#_kernel_center,OUT#_kernel_center, +OUT#_shrink,OUT#_shrink,OUT#_shrink, +OUT#_width - 1 + OUT#_shrink,OUT#_height - 1 + OUT#_shrink,OUT#_depth - 1 + OUT#_shrink, +OUT#_stride,OUT#_stride,OUT#_stride, +OUT#_dilation,OUT#_dilation,OUT#_dilation); +repeat (OUT#_spectrum,_nn_k,copy(OUT#[_nn_k*OUT#_whd],OUT#_biases[_nn_k],OUT#_whd,1,0,-1)); # Add biases +); +nn_conv3d_init_backward(OUT,IN) = ( +batch_d#OUT#_weights = vector(#size(OUT#_weights)); +batch_d#OUT#_biases = vector(#size(OUT#_biases)); +); +nn_conv3d_backward(OUT,IN) = ( +const OUT#_offset = -int(OUT#_shrink/OUT#_stride); +const OUT#_invstride = 1/OUT#_stride; +const OUT#_dons = OUT#_dilation/OUT#_stride; +d#IN = vector(#size(IN#)); +repeat (IN#_spectrum,_nn_k, +draw(d#IN,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +correlate(d#OUT, +OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +crop(OUT#_weights,w##OUT#_ind - 1,OUT#_spectrum,1,1, +_nn_k*OUT#_kernel_size3,0,OUT#_kernel_size3,OUT#_spectrum), +OUT#_kernel_size,OUT#_kernel_size,OUT#_kernel_size,OUT#_spectrum, +0,0,2, +OUT#_kernel_center,OUT#_kernel_center,OUT#_kernel_center, +OUT#_offset,OUT#_offset,OUT#_offset, +IN#_width - 1 + OUT#_offset,IN#_height - 1 + OUT#_offset,IN#_depth - 1 + OUT#_offset, +OUT#_invstride,OUT#_invstride,OUT#_invstride, +OUT#_dons,OUT#_dons,OUT#_dons), +0,0,0,_nn_k,IN#_width,IN#_height,IN#_depth,1); +); +d#OUT#_biases = vector(#size(OUT#_biases)); +fill(d#OUT#_biases,_nn_k,sum(d#OUT[_nn_k*OUT#_whd,OUT#_whd])); +batch_d#OUT#_biases+=d#OUT#_biases; +const OUT#_dcenter = OUT#_dilation*OUT#_kernel_center; +const OUT#_kend = OUT#_kernel_size - 1 + OUT#_offset; +d#OUT#_weights = vector(#size(OUT#_weights)); +repeat (OUT#_spectrum,_nn_k, +draw(d#OUT#_weights, +OUT#_kernel_size,OUT#_kernel_size,OUT#_kernel_size,OUT#_spectrum*IN#_spectrum, +correlate(crop(d#OUT,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +0,0,0,_nn_k,OUT#_width,OUT#_height,OUT#_depth,1), +OUT#_width,OUT#_height,OUT#_depth,1, +IN#, +IN#_width,IN#_height,IN#_depth,IN#_spectrum, +0,0,1, +OUT#_dcenter,OUT#_dcenter,OUT#_dcenter, +OUT#_offset,OUT#_offset,OUT#_offset, +OUT#_kend,OUT#_kend,OUT#_kend, +OUT#_dons,OUT#_dons,OUT#_dons, +OUT#_invstride,OUT#_invstride,OUT#_invstride), +0,0,0,_nn_k*IN#_spectrum, +OUT#_kernel_size,OUT#_kernel_size,OUT#_kernel_size,IN#_spectrum); +); +batch_d#OUT#_weights+=d#OUT#_weights; +); +nn_conv3d_end_backward(OUT) = ( +merge(batch_d#OUT#_weights,+); +merge(batch_d#OUT#_biases,+); +batch_d#OUT#_weights/=nn_batch_size; +batch_d#OUT#_biases/=nn_batch_size; +); +nn_crop_init_forward(OUT,IN,x0,y0,z0,c0,x1,y1,z1,c1,boundary_conditions) = ( +const OUT#_x0 = x0; +const OUT#_y0 = y0; +const OUT#_z0 = z0; +const OUT#_c0 = c0; +const OUT#_width = abs(x1 - x0) + 1; +const OUT#_height = abs(y1 - y0) + 1; +const OUT#_depth = abs(z1 - z0) + 1; +const OUT#_spectrum = abs(c1 - c0) + 1; +const OUT#_boundary_conditions = boundary_conditions; +); +nn_crop_forward(OUT,IN) = ( +OUT# = crop(IN#,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +OUT#_x0,OUT#_y0,OUT#_z0,OUT#_c0, +OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +OUT#_boundary_conditions); +); +nn_crop_backward(OUT,IN) = ( +d#IN = crop(d#OUT,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +-OUT#_x0,-OUT#_y0,-OUT#_z0,-OUT#_c0, +IN#_width,IN#_height,IN#_depth,IN#_spectrum, +0); +); +nn_distance_init_forward(OUT,metric) = ( +const OUT#_width = 1; +const OUT#_height = 1; +const OUT#_depth = 1; +const OUT#_spectrum = 1; +const OUT#_metric = metric; +); +nn_distance_forward(OUT,IN0,IN1) = ( +OUT#_diff = IN0# - IN1#; +OUT# = [ OUT#_metric>0?norm#OUT#_metric(OUT#_diff):norm(OUT#_diff)^2 ]; +); +nn_distance_backward(OUT,IN0,IN1) = ( +!OUT_#metric?( # L2-squared +d#IN0 = 2*OUT#_diff; +):OUT#_metric==2?( # L2 +d#IN0 = OUT#_diff/(1e-8 + OUT#[0]); +):( +d#IN0 = (abs(OUT#_diff)/(1e-8 + OUT#[0]))^(OUT#_metric - 1)*sign(OUT#_diff); +); +d#IN1 = -d#IN0; +); +nn_dropout_init_forward(OUT,IN,dropout_rate) = ( +const OUT#_width = IN#_width; +const OUT#_height = IN#_height; +const OUT#_depth = IN#_depth; +const OUT#_spectrum = IN#_spectrum; +const OUT#_dropout_rate = nn_is_training?cut(dropout_rate,0,1):0; +OUT#_dropout_rate?( +OUT#_dropout_channels = vector(##OUT#_spectrum); +fill(OUT#_dropout_channels,u>=OUT#_dropout_rate); +OUT#_dropout_sum = sum(OUT#_dropout_channels); +!OUT#_dropout_sum?(OUT#_dropout_channels = 1; OUT#_dropout_sum = size(OUT#_dropout_channels)); +OUT#_dropout_mask = resize(OUT#_dropout_channels,size(IN#),1); +OUT#_dropout_mask*=size(OUT#_dropout_channels)/OUT#_dropout_sum; +); +); +nn_dropout_forward(OUT,IN) = ( +OUT#_dropout_rate?( +OUT# = IN#*OUT#_dropout_mask; +):( +ref(IN#,OUT#); +); +); +nn_dropout_backward(OUT,IN) = ( +OUT#_dropout_rate?( +d#IN = d#OUT*OUT#_dropout_mask; +):( +ref(d#OUT,d#IN); +); +); +nn_fc_init_forward(OUT,IN) = ( +const OUT#_ind = $OUT#; +const OUT#_width = 1; +const OUT#_height = 1; +const OUT#_depth = 1; +const OUT#_spectrum = h##OUT#_ind; +OUT#_weights = crop(##OUT#_ind,0,0,size(IN#),h##OUT#_ind); +OUT#_biases = crop(##OUT#_ind,size(IN#),0,1,h##OUT#_ind); +); +nn_fc_forward(OUT,IN) = ( +OUT# = mul(OUT#_weights,IN#); +OUT#+=OUT#_biases; +); +nn_fc_init_backward(OUT) = ( +batch_d#OUT#_weights = vector(#size(OUT#_weights)); +batch_d#OUT#_biases = vector(#size(OUT#_biases)); +); +nn_fc_backward(OUT,IN) = ( +d#IN = mul(transpose(OUT#_weights,size(IN#)),d#OUT); +d#OUT#_weights = mul(d#OUT,IN#,size(IN#)); +batch_d#OUT#_weights+=d#OUT#_weights; +batch_d#OUT#_biases+=d#OUT; +); +nn_fc_end_backward(OUT) = ( +merge(batch_d#OUT#_weights,+); +merge(batch_d#OUT#_biases,+); +batch_d#OUT#_weights/=nn_batch_size; +batch_d#OUT#_biases/=nn_batch_size; +); +nn_nlfc_init_forward(OUT,IN) = ( +const OUT#_ind = $OUT#; +const OUT#_width = 1; +const OUT#_height = 1; +const OUT#_depth = 1; +const OUT#_spectrum = h##OUT#_ind; +OUT#_weights = crop(##OUT#_ind,0,0,size(IN#),h##OUT#_ind); +OUT#_biases = crop(##OUT#_ind,size(IN#),0,size(IN#),h##OUT#_ind); +); +nn_nlfc_forward(OUT,IN,activation) = ( +OUT# = vector(##OUT#_spectrum); +repeat(OUT#_spectrum,_nn_i, +_nn_res = 0; +repeat (size(IN#),_nn_j, +_nn_off = _nn_i*size(IN#) + _nn_j; +_nn_res+=nn_activation_#activation(OUT#_weights[_nn_off]*IN#[_nn_j] + OUT#_biases[_nn_off]); +); +OUT#[_nn_i] = _nn_res; +); +); +nn_nlfc_init_backward(OUT) = ( +batch_d#OUT#_weights = vector(#size(OUT#_weights)); +batch_d#OUT#_biases = vector(#size(OUT#_biases)); +); +nn_nlfc_backward(OUT,IN,activation) = ( +d#IN = vector(#size(IN#)); +repeat (size(IN#),_nn_j, +_nn_res = _nn_off = 0; +repeat (OUT#_spectrum,_nn_i, +_nn_off = _nn_i*size(IN#) + _nn_j; +_nn_Wij = OUT#_weights[_nn_off]; +_nn_res+=nn_activation_d_#activation(_nn_Wij*IN#[_nn_j] + OUT#_biases[_nn_off])*_nn_Wij*d#OUT[_nn_i]; +); +d#IN[_nn_j] = _nn_res; +); +d#OUT#_weights = vector(#size(OUT#_weights)); +d#OUT#_biases = vector(#size(OUT#_biases)); +_nn_ptr = 0; +repeat (OUT#_spectrum,_nn_i, +repeat (size(IN#),_nn_j, +_nn_off = _nn_i*size(IN#) + _nn_j; +_nn_Wij = OUT#_weights[_nn_off]; +_nn_sigmad = nn_activation_d_#activation(_nn_Wij*IN#[_nn_j] + OUT#_biases[_nn_off]); +d#OUT#_weights[_nn_ptr] = _nn_sigmad*IN#[_nn_j]*d#OUT[_nn_i]; +d#OUT#_biases[_nn_ptr] = _nn_sigmad*d#OUT#[_nn_i]; +++_nn_ptr; +); +); +batch_d#OUT#_weights+=d#OUT#_weights; +batch_d#OUT#_biases+=d#OUT#_biases; +); +nn_nlfc_end_backward(OUT) = ( +merge(batch_d#OUT#_weights,+); +merge(batch_d#OUT#_biases,+); +batch_d#OUT#_weights/=nn_batch_size; +batch_d#OUT#_biases/=nn_batch_size; +); +nn_input_init_forward(OUT,w,h,d,s) = ( +const OUT#_width = w; +const OUT#_height = h; +const OUT#_depth = d; +const OUT#_spectrum = s; +); +nn_maxpool2d_init_forward(OUT,IN,patch_size) = ( +const OUT#_width = int(IN#_width/patch_size); +const OUT#_height = int(IN#_height/patch_size); +const OUT#_depth = IN#_depth; +const OUT#_spectrum = IN#_spectrum; +const OUT#_patch_size = patch_size; +); +nn_maxpool2d_forward(OUT,IN) = ( +OUT# = vector(##OUT#_width*OUT#_height*OUT#_depth*OUT#_spectrum); +OUT#_from = vector(#size(OUT#)); +_nn_off = 0; +repeat (OUT#_spectrum,_nn_c, +repeat (OUT#_depth,_nn_z, +repeat (OUT#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (OUT#_width,_nn_x, +OUT#_patch = crop(IN#,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +_nn_x*OUT#_patch_size,_nn_yp,_nn_z,_nn_c, +OUT#_patch_size,OUT#_patch_size,1,1); +_nn_argmax = argmax(OUT#_patch); +OUT#[_nn_off] = OUT#_patch[_nn_argmax]; +OUT#_from[_nn_off++] = _nn_argmax; +); +); +); +); +); +nn_maxpool2d_backward(OUT,IN) = ( +d#IN = vector(#size(IN#)); +_nn_offOUT = 0; +repeat (OUT#_spectrum,_nn_c, +repeat (OUT#_depth,_nn_z, +_nn_offIN0 = IN#_width*IN#_height*(_nn_z + IN#_depth*_nn_c); +repeat (OUT#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (OUT#_width,_nn_x, +_nn_from = OUT#_from[_nn_offOUT]; +_nn_from_x = _nn_from%OUT#_patch_size; +_nn_from_y = int(_nn_from/OUT#_patch_size); +_nn_offIN = _nn_offIN0 + _nn_x*OUT#_patch_size + _nn_from_x + IN#_width*(_nn_yp + _nn_from_y); +d#IN[_nn_offIN] = d#OUT[_nn_offOUT++]; +); +); +); +); +); +nn_maxpool3d_init_forward(OUT,IN,patch_size) = ( +const OUT#_width = int(IN#_width/patch_size); +const OUT#_height = int(IN#_height/patch_size); +const OUT#_depth = int(IN#_depth/patch_size); +const OUT#_spectrum = IN#_spectrum; +const OUT#_patch_size = patch_size; +); +nn_maxpool3d_forward(OUT,IN) = ( +OUT# = vector(##OUT#_width*OUT#_height*OUT#_depth*OUT#_spectrum); +OUT#_from = vector(#size(OUT#)); +_nn_off = 0; +repeat (OUT#_spectrum,_nn_c, +repeat (OUT#_depth,_nn_z, +_nn_zp = _nn_z*OUT#_patch_size; +repeat (OUT#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (OUT#_width,_nn_x, +OUT#_patch = crop(IN#,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +_nn_x*OUT#_patch_size,_nn_yp,_nn_zp,_nn_c, +OUT#_patch_size,OUT#_patch_size,OUT#_patch_size,1); +_nn_argmax = argmax(OUT#_patch); +OUT#[_nn_off] = OUT#_patch[_nn_argmax]; +OUT#_from[_nn_off++] = _nn_argmax; +); +); +); +); +); +nn_maxpool3d_backward(OUT,IN) = ( +d#IN = vector(#size(IN#)); +_nn_offOUT = 0; +repeat (OUT#_spectrum,_nn_c, +_nn_offIN0 = IN#_width*IN#_height*IN#_depth*_nn_c; +repeat (OUT#_depth,_nn_z, +_nn_zp = _nn_z*OUT#_patch_size; +repeat (OUT#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (OUT#_width,_nn_x, +_nn_from = OUT#_from[_nn_offOUT]; +_nn_from_x = _nn_from%OUT#_patch_size; +_nn_from_y = int(_nn_from/OUT#_patch_size)%OUT#_patch_size; +_nn_from_z = int(_nn_from/OUT#_patch_size^2); +_nn_offIN = _nn_offIN0 + _nn_x*OUT#_patch_size + _nn_from_x + +IN#_width*(_nn_yp + _nn_from_y + IN#_height*(_nn_zp + _nn_from_z)); +d#IN[_nn_offIN] = d#OUT[_nn_offOUT++]; +); +); +); +); +); +nn_mul_init_forward(OUT,IN) = ( +const OUT#_width = IN#_width; +const OUT#_height = IN#_height; +const OUT#_depth = IN#_depth; +const OUT#_spectrum = IN#_spectrum; +); +nn_mul_forward(OUT,IN0,IN1) = ( +OUT# = IN0#*IN1#; +); +nn_mul_backward(OUT,IN0,IN1) = ( +d#IN0 = IN1#*d#OUT; +d#IN1 = IN0#*d#OUT; +); +nn_nl_init_forward(OUT,IN) = ( +const OUT#_width = IN#_width; +const OUT#_height = IN#_height; +const OUT#_depth = IN#_depth; +const OUT#_spectrum = IN#_spectrum; +); +nn_nl_forward(OUT,IN,activation) = ( +OUT# = vector(#size(IN#)); +fill(OUT#,_nn_k,OUT#[_nn_k] = nn_activation_#activation(IN#[_nn_k])); +); +nn_nl_backward(OUT,IN,activation) = ( +d#IN = vector(#size(IN#)); +fill(d#IN,_nn_k,d#OUT[_nn_k]*nn_activation_d_#activation(IN#[_nn_k])); +); +nn_softmax_forward(OUT,IN) = ( +OUT# = exp(IN# - max(IN#)); +OUT#/=sum(OUT#); +); +nn_softmax_backward(OUT,IN) = ( +d#IN = d#OUT - dot(d#OUT,OUT#); +d#IN*=OUT#; +); +nn_normalize_init_forward(OUT,IN,is_channelwise) = ( +const OUT#_ind = $OUT#; +const OUT#_width = IN#_width; +const OUT#_height = IN#_height; +const OUT#_depth = IN#_depth; +const OUT#_spectrum = IN#_spectrum; +const OUT#_is_channelwise = is_channelwise; +OUT#_is_channelwise?( # Channel-by-channel normalization +OUT#_alpha = crop(##OUT#_ind,0,1); +OUT#_beta = crop(##OUT#_ind,1,1); +OUT#_avg = crop(##OUT#_ind,2,1); +OUT#_var = crop(##OUT#_ind,3,1); +):( +OUT#_alpha = i[##OUT#_ind,0]; +OUT#_beta = i[##OUT#_ind,1]; +OUT#_avg = i[##OUT#_ind,2]; +OUT#_var = i[##OUT#_ind,3]; +); +OUT#_std = sqrt(OUT#_var); +OUT#_std+=1e-8; +); +nn_normalize_forward(OUT,IN) = ( +OUT#_is_channelwise?( # Channel-by-channel normalization +const OUT#_whd = OUT#_width*OUT#_height*OUT#_depth; +OUT#_hat = vector(#size(IN#)); +OUT# = vector(#size(IN#)); +repeat (size(OUT#_avg),_nn_k, +OUT#_tmp = IN#[_nn_k*OUT#_whd,OUT#_whd] - OUT#_avg[_nn_k]; # One channel of IN +OUT#_tmp/=OUT#_std[_nn_k]; +copy(OUT#_hat[_nn_k*OUT#_whd],OUT#_tmp); +OUT#_tmp*=OUT#_alpha[_nn_k]; +OUT#_tmp+=OUT#_beta[_nn_k]; +copy(OUT#[_nn_k*OUT#_whd],OUT#_tmp); +); +):( +OUT#_hat = IN# - OUT#_avg; +OUT#_hat/=OUT#_std; +OUT# = OUT#_hat*OUT#_alpha; +OUT#+=OUT#_beta; +); +); +nn_normalize_init_backward(OUT) = ( +OUT#_is_channelwise?( # Channel-by-channel normalization +batch_d#OUT#_alpha = vector(#size(OUT#_avg)); +batch_d#OUT#_beta = vector(#size(OUT#_avg)); +batch_#OUT#_avg = vector(#size(OUT#_avg)); +batch_#OUT#_var = vector(#size(OUT#_avg)); +):( +batch_d#OUT#_alpha = batch_d#OUT#_beta = batch_#OUT#_avg = batch_#OUT#_var = 0; +); +); +nn_normalize_backward(OUT,IN) = ( +OUT#_is_channelwise?( # Channel-by-channel normalization +d#IN = vector(#size(IN#)); +repeat (size(#OUT#_avg),_nn_k, +OUT#_tmp = d#OUT[_nn_k*OUT#_whd,OUT#_whd]; # One channel of dOUT +copy(d#IN[_nn_k*OUT#_whd],OUT#_tmp*OUT#_alpha[_nn_k]/OUT#_std[_nn_k]); +batch_d#OUT#_alpha[_nn_k]+=dot(OUT#_tmp,OUT#_hat[_nn_k*OUT#_whd,OUT#_whd]); +batch_d#OUT#_beta[_nn_k]+=sum(OUT#_tmp); +OUT#_tmp = IN#[_nn_k*OUT#_whd,OUT#_whd]; # One channel of IN +batch_#OUT#_avg[_nn_k]+=avg(OUT#_tmp); +batch_#OUT#_var[_nn_k]+=var(OUT#_tmp); +); +):( +d#IN = d#OUT*OUT#_alpha/OUT#_std; +batch_d#OUT#_alpha+=dot(d#OUT,OUT#_hat); +batch_d#OUT#_beta+=sum(d#OUT); +batch_#OUT#_avg+=avg(IN#); +batch_#OUT#_var+=var(IN#); +); +); +nn_normalize_end_backward(OUT) = ( +merge(batch_d#OUT#_alpha,+); +merge(batch_d#OUT#_beta,+); +merge(batch_#OUT#_avg,+); +merge(batch_#OUT#_var,+); +batch_d#OUT#_alpha/=nn_batch_size; +batch_d#OUT#_beta/=nn_batch_size; +batch_#OUT#_avg/=nn_batch_size; +batch_#OUT#_var/=nn_batch_size; +); +nn_patchdown2d_init_forward(OUT,IN,patch_size) = ( +const OUT#_width = int(IN#_width/patch_size); +const OUT#_height = int(IN#_height/patch_size); +const OUT#_depth = IN#_depth; +const OUT#_spectrum = IN#_spectrum*patch_size^2; +const OUT#_patch_size = patch_size; +); +nn_patchdown2d_forward(OUT,IN) = ( +OUT# = vector(##OUT#_width*OUT#_height*OUT#_depth*OUT#_spectrum); +repeat (OUT#_depth,_nn_z, +repeat (OUT#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (OUT#_width,_nn_x, +draw(OUT#,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +crop(IN#,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +_nn_x*OUT#_patch_size,_nn_yp,_nn_z, +OUT#_patch_size,OUT#_patch_size,1), +_nn_x,_nn_y,_nn_z,1,1,1); +); +); +); +); +nn_patchdown2d_backward(OUT,IN) = ( +d#IN = vector(#size(IN#)); +repeat (OUT#_depth,_nn_z, +repeat (OUT#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (OUT#_width,_nn_x, +draw(d#IN#,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +crop(d#OUT,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum,_nn_x,_nn_y,_nn_z,1,1,1), +_nn_x*OUT#_patch_size,_nn_yp,_nn_z, +OUT#_patch_size,OUT#_patch_size,1); +); +); +); +); +nn_patchdown3d_init_forward(OUT,IN,patch_size) = ( +const OUT#_width = int(IN#_width/patch_size); +const OUT#_height = int(IN#_height/patch_size); +const OUT#_depth = int(IN#_depth/patch_size); +const OUT#_spectrum = IN#_spectrum*patch_size^3; +const OUT#_patch_size = patch_size; +); +nn_patchdown3d_forward(OUT,IN) = ( +OUT# = vector(##OUT#_width*OUT#_height*OUT#_depth*OUT#_spectrum); +repeat (OUT#_depth,_nn_z, +_nn_zp = _nn_z*OUT#_patch_size; +repeat (OUT#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (OUT#_width,_nn_x, +draw(OUT#,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +crop(IN#,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +_nn_x*OUT#_patch_size,_nn_yp,_nn_zp, +OUT#_patch_size,OUT#_patch_size,OUT#_patch_size), +_nn_x,_nn_y,_nn_z,1,1,1); +); +); +); +); +nn_patchdown3d_backward(OUT,IN) = ( +d#IN = vector(#size(IN#)); +repeat (OUT#_depth,_nn_z, +_nn_zp = _nn_z*OUT#_patch_size; +repeat (OUT#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (OUT#_width,_nn_x, +draw(d#IN#,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +crop(d#OUT,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum,_nn_x,_nn_y,_nn_z,1,1,1), +_nn_x*OUT#_patch_size,_nn_yp,_nn_zp, +OUT#_patch_size,OUT#_patch_size,OUT#_patch_size); +); +); +); +); +nn_patchup2d_init_forward(OUT,IN,patch_size) = ( +const OUT#_width = IN#_width*patch_size; +const OUT#_height = IN#_height*patch_size; +const OUT#_depth = IN#_depth; +const OUT#_spectrum = IN#_spectrum/patch_size^2; +const OUT#_patchsize = patch_size; +); +nn_patchup2d_forward(OUT,IN) = ( +OUT# = vector(##OUT#_width*OUT#_height*OUT#_depth*OUT#_spectrum); +repeat (IN#_depth,_nn_z, +repeat (IN#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (IN#_width,_nn_x, +draw(OUT#,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +crop(#IN,IN#_width,IN#_height,IN#_depth,IN#_spectrum,_nn_x,_nn_y,_nn_z,1,1,1), +_nn_x*OUT#_patch_size,_nn_yp,_nn_z, +OUT#_patch_size,OUT#_patch_size,1); +); +); +); +); +nn_patchup2d_backward(OUT,IN) = ( +d#IN = vector(#size(IN#)); +repeat (IN#_depth,_nn_z, +repeat (IN#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (IN#_width,_nn_x, +draw(d#IN,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +crop(d#OUT,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +_nn_x*OUT#_patch_size,_nn_yp,_nn_z, +OUT#_patch_size,OUT#_patch_size,1), +_nn_x,_nn_y,_nn_z,1,1,1); +); +); +); +); +nn_patchup3d_init_forward(OUT,IN,patch_size) = ( +const OUT#_width = IN#_width*patch_size; +const OUT#_height = IN#_height*patch_size; +const OUT#_depth = IN#_depth*patch_size; +const OUT#_spectrum = IN#_spectrum/patch_size^3; +const OUT#_patch_size = patch_size; +); +nn_patchup3d_forward(OUT,IN) = ( +OUT# = vector(##OUT#_width*OUT#_height*OUT#_depth*OUT#_spectrum); +repeat (IN#_depth,_nn_z, +_nn_zp = _nn_z*OUT#_patch_size; +repeat (IN#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (IN#_width,_nn_x, +draw(OUT#,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +crop(#IN,IN#_width,IN#_height,IN#_depth,IN#_spectrum,_nn_x,_nn_y,_nn_z,1,1,1), +_nn_x*OUT#_patch_size,_nn_yp,_nn_zp, +OUT#_patch_size,OUT#_patch_size,OUT#_patch_size); +); +); +); +); +nn_patchup3d_backward(OUT,IN) = ( +d#IN = vector(#size(IN#)); +repeat (IN#_depth,_nn_z, +_nn_zp = _nn_z*OUT#_patch_size; +repeat (IN#_height,_nn_y, +_nn_yp = _nn_y*OUT#_patch_size; +repeat (IN#_width,_nn_x, +draw(d#IN,IN#_width,IN#_height,IN#_depth,IN#_spectrum, +crop(d#OUT,OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +_nn_x*OUT#_patch_size,_nn_yp,_nn_zp, +OUT#_patch_size,OUT#_patch_size,OUT#_patch_size), +_nn_x,_nn_y,_nn_z,1,1,1); +); +); +); +); +nn_rename_init_forward(OUT,IN) = ( +const OUT#_width = IN#_width; +const OUT#_height = IN#_height; +const OUT#_depth = IN#_depth; +const OUT#_spectrum = IN#_spectrum; +ref(IN#,OUT#); +); +nn_rename_backward(OUT,IN) = ( +ref(d#OUT,d#IN); +); +nn_reshape_init_forward(OUT,IN,w,h,d,s) = ( +const OUT#_width = w; +const OUT#_height = h; +const OUT#_depth = d; +const OUT#_spectrum = s; +ref(IN#,OUT#); +); +nn_reshape_init_backward(OUT,IN) = ( +ref(d#OUT,d#IN); +); +nn_resize_init_forward(OUT,IN,w,h,d,s,interpolation) = ( +const OUT#_width = w; +const OUT#_height = h; +const OUT#_depth = d; +const OUT#_spectrum = s; +const OUT#_interpolation = interpolation; +); +nn_resize_forward(OUT,IN) = ( +OUT# = resize(IN#, +IN#_width,IN#_height,IN#_depth,IN#_spectrum, +OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +OUT#_interpolation); +); +nn_resize_backward(OUT,IN) = ( +d#IN = resize(d#OUT, +OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +IN#_width,IN#_height,IN#_depth,IN#_spectrum, +2); +); +nn_run_init_forward(OUT,IN,command,w,h,d,s) = ( +const OUT#_width = w; +const OUT#_height = h; +const OUT#_depth = d; +const OUT#_spectrum = s; +OUT#_varname = 'nn_#OUT'; +OUT#_pipeline = string('l[] { $nn_#IN ',command,' k. r ', +OUT#_width,',',OUT#_height,',',OUT#_depth,',',OUT#_spectrum, +',3 k. store ',OUT#_varname,' }'); +); +nn_run_forward(OUT,IN) = ( +critical( +store('nn_#IN',IN#,IN#_width,IN#_height,IN#_depth,IN#_spectrum); +run(OUT#_pipeline); +OUT# = get(OUT#_varname,OUT#_width*OUT#_height*OUT#_depth*OUT#_spectrum); +); +); +nn_run_backward(OUT,IN) = ( +d#IN = resize(d#OUT, +OUT#_width,OUT#_height,OUT#_depth,OUT#_spectrum, +IN#_width,IN#_height,IN#_depth,IN#_spectrum, +3); +); +nn_split_init_forward(OUT0,OUT1,IN,nb_channels0) = ( +const OUT0#_width = IN#_width; +const OUT0#_height = IN#_height; +const OUT0#_depth = IN#_depth; +const OUT0#_spectrum = nb_channels0; +const OUT1#_width = IN#_width; +const OUT1#_height = IN#_height; +const OUT1#_depth = IN#_depth; +const OUT1#_spectrum = IN#_spectrum - nb_channels0; +); +nn_split_forward(OUT0,OUT1,IN) = ( +const OUT0#_siz0 = OUT0#_width*OUT0#_height*OUT0#_depth*OUT0#_spectrum; +OUT0# = IN#[0,OUT0#_siz0]; +OUT1# = IN#[OUT0#_siz0,OUT1#_width*OUT1#_height*OUT1#_depth*OUT1#_spectrum]; +); +nn_split_backward(OUT0,OUT1,IN) = ( +d#IN = vector(#size(IN#)); +copy(d#IN,d#OUT0,size(OUT0#)); +copy(d#IN[size(OUT0#)],d#OUT1,size(OUT1#)); +); +nn_loss_binary_crossentropy_init_forward(L) = ( +batch_#L = 0; +); +nn_loss_binary_crossentropy_forward(L,IN,TRUTH) = ( +L#_epsiloned = IN# + 1e-5; +L#_epsiloned1 = 1 - IN# + 1e-5; +L# = -sum(TRUTH*log(L#_epsiloned) + (1 - TRUTH)*log(L#_epsiloned1)); +batch_#L+=L#; +); +nn_loss_binary_crossentropy_end_forward(L) = ( +merge(batch_#L,+); +batch_#L/=nn_batch_size; +L# = batch_#L; +); +nn_loss_binary_crossentropy_backward(L,IN,TRUTH) = ( +d#IN = (IN# - TRUTH)/(L#_epsiloned*L#_epsiloned1); +); +nn_loss_crossentropy_init_forward(L) = ( +batch_#L = 0; +); +nn_loss_crossentropy_forward(L,IN,TRUTH) = ( +L#_epsiloned = IN# + 1e-8; +L# = -sum(TRUTH*log(L#_epsiloned)); +batch_#L+=L#; +); +nn_loss_crossentropy_end_forward(L) = ( +merge(batch_#L,+); +batch_#L/=nn_batch_size; +L# = batch_#L; +); +nn_loss_crossentropy_backward(L,IN,TRUTH) = ( +d#IN = -TRUTH/L#_epsiloned; +); +nn_loss_mse_init_forward(L) = ( +batch_#L = 0; +); +nn_loss_mse_forward(L,IN,TRUTH) = ( +d#IN = IN# - TRUTH; +L# = norm(d#IN)^2/size(d#IN); +batch_#L+=L#; +); +nn_loss_mse_end_forward(L) = ( +merge(batch_#L,+); +batch_#L/=nn_batch_size; +L# = batch_#L; +); +nn_loss_mse_backward(L,IN,TRUTH) = ( +d#IN*=2; +); +nn_loss_normp_init_forward(L,metric) = ( +const L#_metric = metric; +batch_#L = 0; +); +nn_loss_normp_forward(L,IN,TRUTH) = ( +d#IN = IN# - TRUTH; +L# = (!L#_metric?norm(d#IN)^2:norm#L#_metric(d#IN))/size(d#IN); +batch_#L+=L#; +); +nn_loss_normp_end_forward(L) = ( +merge(batch_#L,+); +batch_#L/=nn_batch_size; +L# = batch_#L; +); +nn_loss_normp_backward(L,IN,TRUTH) = ( +!L#_metric?( # L2-squared +d#IN*=2; +):L#_metric==2?( # L2 +d#IN/=(1e-8 + L#); +):( +d#IN = (abs(d#IN)/(1e-8 + L#))^(L#_metric - 1)*sign(d#IN); +); +); +nn_loss_softmax_crossentropy_init_forward(L) = ( +batch_#L = 0; +); +nn_loss_softmax_crossentropy_forward(L,IN,TRUTH) = ( +L#_softmax = exp(IN# - max(IN#)); +L#_softmax/=sum(L#_softmax); +L#_softmax+=1e-8; +L# = -sum(TRUTH*log(L#_softmax)); +d#IN = L#_softmax - TRUTH; +batch_#L+=L#; +); +nn_loss_softmax_crossentropy_end_forward(L) = ( +merge(batch_#L,+); +batch_#L/=nn_batch_size; +L# = batch_#L; +); +nn_loss_softmax_crossentropy_backward(L,IN,TRUTH) = ( +L#_softmax = exp(IN# - max(IN#)); +L#_softmax/=sum(L#_softmax); +L#_softmax+=1e-8; +L# = -sum(TRUTH*log(L#_softmax)); +d#IN = L#_softmax - TRUTH; +batch_#L+=L#; +);" +#@cli nn_init +#@cli : Initialize a new network. +nn_init : +e[^-1] "[nn_lib] Initialize new network." +_nn_modules_names,_nn_modules_types,_nn_trainer_data,_nn_forward,_nn_loss,_nn_backward,_nn_update,_nn_latest= +_nn_init="$0 " +#@cli nn_check_layer : name +#@cli : Check that the layer with specified name already exists in the network. +nn_check_layer : +if !isvarname('"$1"') +error[0--3] "Command 'nn_check_layer': Invalid layer name '$1'." +elif narg($_nn_$1_size)!=4 +error[0--3] "Command 'nn_check_layer': Layer with name '$1' does not exist." +fi +#@cli nn_add : out,in0,_in1 +#@cli : Add an 'add' layer to the network. +#@cli : Default value: 'in1=. (previous layer)'. +nn_add : if ['$2']=='.' in0=$_nn_latest else in0=$2 fi nn_check_layer $in0 +if ['${3=.}']=='.' in1=$_nn_latest else in1=$3 fi nn_check_layer $in1 +check "isvarname('$1') && "[${_nn_${in0}_size}]==[${_nn_${in1}_size}] +e[^-1] "[nn_lib] Add 'add' layer '$1', with inputs '"$in0"' and '"$in1"'." +_nn_modules_names.=$1, +_nn_modules_types.=add, +_nn_$1_size=${_nn_${in0}_size} +_nn_$1_input=$in0,$in1 +_nn_forward.="begin(nn_add_init_forward($1,"$in0"));""nn_add_forward($1,"$in0","$in1");" +_nn_backward..="nn_add_backward($1,"$in0","$in1");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_append : out,in0,_in1 +#@cli : Add an 'append' layer to the network. +#@cli : Default value: 'in1=. (previous layer)'. +nn_append : if ['$2']=='.' in0=$_nn_latest else in0=$2 fi nn_check_layer $in0 +if ['${3=.}']=='.' in1=$_nn_latest else in1=$3 fi nn_check_layer $in1 +check "isvarname('$1') && "[${_nn_${in0}_size}][0,3]==[${_nn_${in1}_size}][0,3] +e[^-1] "[nn_lib] Add 'append' layer '$1', with inputs '"$in0"' and '"$in1"'." +_nn_modules_names.=$1, +_nn_modules_types.=append, +_nn_$1_size:=[${_nn_${in0}_size}]+[0,0,0,[${_nn_${in1}_size}][3]] +_nn_$1_input=$in0,$in1 +_nn_forward.="begin(nn_append_init_forward($1,"$in0","$in1"));""nn_append_forward($1,"$in0","$in1");" +_nn_backward..="nn_append_backward($1,"$in0","$in1");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_avgpool2d : out,_in,_patch_size>1 +#@cli : Add a 'avgpool2d' layer (2D average pooling) to the network. +#@cli : Default value: 'in=. (previous layer)'. +nn_avgpool2d : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=2}) && $3>1" +e[^-1] "[nn_lib] Add 'avgpool2d' layer '$1', with input '"$in"' and patch size $3x$3." +_nn_modules_names.=$1, +_nn_modules_types.=avgpool2d, +_nn_$1_size:=s=[${_nn_${in}_size}];[int(s[0,2]/$3),s[2,2]] +_nn_$1_input=$in +_nn_$1_properties="patch_size=$3x$3" +_nn_forward.="begin(nn_avgpool2d_init_forward($1,"$in",$3));""nn_avgpool2d_forward($1,"$in");" +_nn_backward..="nn_avgpool2d_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_avgpool3d : out,_in,_patch_size>1 +#@cli : Add a 'avgpool3d' layer (3D average pooling) to the network. +#@cli : Default value: 'in=. (previous layer)'. +nn_avgpool3d : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=2}) && $3>1" +e[^-1] "[nn_lib] Add 'avgpool3d' layer '$1', with input '"$in"' and patch size $3x$3x$3." +_nn_modules_names.=$1, +_nn_modules_types.=avgpool3d, +_nn_$1_size:=s=[${_nn_${in}_size}];[int(s[0,3]/$3),s[3]] +_nn_$1_input=$in +_nn_$1_properties="patch_size=$3x$3x$3" +_nn_forward.="begin(nn_avgpool3d_init_forward($1,"$in",$3));""nn_avgpool3d_forward($1,"$in");" +_nn_backward..="nn_avgpool3d_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_clone : name0,name1,_in +#@cli : Add a 'clone' layer to the network. +#@cli : Default value: 'in=. (previous layer)'. +nn_clone : if ['${3=.}']=='.' in=$_nn_latest else in=$3 fi nn_check_layer $in +check "isvarname('$1') && isvarname('$2')" +e[^-1] "[nn_lib] Add 'clone' layer with input '"$in"' and outputs '$1' and '$2'." +_nn_modules_names.=$1,$2, +_nn_modules_types.=clone,clone, +_nn_$1_size=${_nn_${in}_size} +_nn_$2_size=${_nn_${in}_size} +_nn_$1_input,_nn_$2_input=$in +_nn_forward.="begin(nn_clone_init_forward($1,$2,"$in"));""nn_clone_forward($1,$2,"$in");" +_nn_backward..="nn_clone_backward($1,$2,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_conv2d : out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation,_border_shrink>=0,_boundary_conditions,0<=_learning_mode<=3 +#@cli : Add a 'conv2d' layer (2D convolutional layer) to the network. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : 'learning_mode' can be { 0:no learning | 1:weights only | 2:biases only | 3:weights+biases }. +#@cli : Default values: 'kernel_size=3', 'stride=1', 'dilation=1', 'border_shrink=0', 'boundary_conditions=1' and 'learning_mode=3'. +nn_conv2d : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint($3) && $3>0 && isint(${4=3}) && $4>0 && ""${5=1}>0 && isint(${7=0}) && $7>=0 && ""isint(${8=1}) && inrange($8,0,3) && isint(${9=3}) && inrange($9,0,3)" skip "${6=1}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'conv2d' layer '$1', with input '"$in"', $3 channels, $4x$4 kernels, stride $5, dilation $6, ""border shrink $7 and "$s$8" boundary conditions." +init=$_nn_init +_nn_conv2d $1_conv2d,$in,${3-9} +nn_rename $1,$1_conv2d +_nn_init=${init}"$0 $* " +_nn_latest=$1 +_nn_conv2d : +_nn_modules_names.=$1, +_nn_modules_types.=conv2d, +_nn_$1_size:=s=[$_nn_$2_size];[int(s[0,2]/$5)-2*$7,s[2],$3] +_nn_$1_learning_mode=$9 +_nn_$1_input=$2 +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +_nn_$1_properties="kernel=$4x$4, stride=$5, dilation=$6, border_shrink=$7, boundary_conditions="$s$8", ""learning_mode=$9" +if !isint($$1) +{[$_nn_$2_size][3]*$4^2+1},$3,1,1,4*g/(w-1) +if $9<2 1,100% j.. .,100% rm. fi +=> $1 +fi +_nn_forward.="begin(nn_conv2d_init_forward($1,$2,${4-8}));""nn_conv2d_forward($1,$2);" +_nn_backward..="begin(nn_conv2d_init_backward($1,$2));""nn_conv2d_backward($1,$2);""end(nn_conv2d_end_backward($1));" +_nn_init.="$0 $* " +#@cli nn_conv2dnl : out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation>0,_border_shrink>=0,_boundary_conditions,_activation,0<=_learning_mode<=3 +#@cli : Add a 'conv2dnl' (2D convolutional layer followed by a non-linearity) to the network. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : 'learning_mode' can be { 0:no learning | 1:weights only | 2:biases only | 3:weights+biases }. +#@cli : Default values: 'kernel_size=3', 'stride=1', 'dilation=1', 'border_shrink=0', 'boundary_conditions=1', 'activation=leakyrelu' and 'learning_mode=3'. +nn_conv2dnl : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint($3) && $3>0 && isint(${4=3}) && $4>0 && ${5=1}>0 && ""isint(${7=0}) && $7>=0 && isint(${8=1}) && inrange($8,0,3) && isint(${10=3}) && inrange($10,0,3)" +skip "${6=1}","${9=leakyrelu}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'conv2d+nl' layer '$1', with input '"$in"', $3 channels, $4x$4 kernels, ""stride $5, dilation $6, border shrink $7, "$s$8" boundary conditions and '$9' activation." +init=$_nn_init +_nn_conv2d $1_conv2d,$in,${3-8},$10 +nn_nl $1,$1_conv2d,$9 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_conv2dnnl : out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation>0,_border_shrink>=0,_boundary_conditions,_activation,0<=_learning_mode<=3 +#@cli : Add a 'conv2dnnl' (2D convolutional layer followed by a normalization layer, then a non-linearity) to the network. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : 'learning_mode' can be { 0:no learning | 1:weights only | 2:biases only | 3:weights+biases }. +#@cli : Default values: 'kernel_size=3', 'stride=1', 'dilation=1', 'border_shrink=0', 'boundary_conditions=1', 'activation=leakyrelu' and 'learning_mode=3'. +nn_conv2dnnl : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint($3) && $3>0 && isint(${4=3}) && $4>0 && ${5=1}>0 && ""isint(${7=0}) && $7>=0 && isint(${8=1}) && inrange($8,0,3) && isint(${10=3}) && inrange($10,0,3)" +skip "${6=1}","${9=leakyrelu}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'conv2d+normalize+nl' layer '$1', with input '"$in"', $3 channels, $4x$4 kernels, ""stride $5, dilation $6, border shrink $7, "$s$8" boundary conditions and '$9' activation." +init=$_nn_init +_nn_conv2d $1_conv2d,$in,${3-8},$10 +_nn_normalize $1_normalize,$1_conv2d,1,3 +nn_nl $1,$1_normalize,$9 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_conv3d : out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation,_border_shrink>=0,_boundary_conditions,0<=_learning_mode<=3 +#@cli : Add a 'conv3d' layer (3D convolutional layer) to the network. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : 'learning_mode' can be { 0:no learning | 1:weights only | 2:biases only | 3:weights+biases }. +#@cli : Default values: 'kernel_size=3', 'stride=1', 'dilation=1', 'border_shrink=0', 'boundary_conditions=1' and 'learning_mode=3'. +nn_conv3d : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint($3) && $3>0 && isint(${4=3}) && $4>0 && ""${5=1}>0 && isint(${7=0}) && $7>=0 && ""isint(${8=1}) && inrange($8,0,3) && isint(${9=3}) && inrange($9,0,3)" skip "${6=1}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'conv3d' layer '$1', with input '"$in"', $3 channels, $4x$4x$4 kernels, stride $5, ""dilation $6, border shrink $7 and "$s$8" boundary conditions." +init=$_nn_init +_nn_conv3d $1_conv3d,$in,${3-9} +nn_rename $1,$1_conv3d +_nn_init=${init}"$0 $* " +_nn_latest=$1 +_nn_conv3d : +_nn_modules_names.=$1, +_nn_modules_types.=conv3d, +_nn_$1_size:=s=[$_nn_$2_size];[int(s[0,3]/$5)-2*$7,$3] +_nn_$1_learning_mode=$9 +_nn_$1_input=$2 +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +_nn_$1_properties="kernel=$4x$4x$4, stride=$5, dilation=$6, border_shrink=$7, boundary_conditions="$s$8", ""learning_mode=$9" +if !isint($$1) +{[$_nn_$2_size][3]*$4^3+1},$3,1,1,4*g/(w-1) +if $9<2 1,100% j.. .,100% rm. fi +=> $1 +fi +_nn_forward.="begin(nn_conv3d_init_forward($1,$2,${4-8}));""nn_conv3d_forward($1,$2);" +_nn_backward..="begin(nn_conv3d_init_backward($1,$2));""nn_conv3d_backward($1,$2);""end(nn_conv3d_end_backward($1));" +_nn_init.="$0 $* " +#@cli nn_conv3dnl : out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation>0,_border_shrink>=0,_boundary_conditions,_activation,0<=_learning_mode<=3 +#@cli : Add a 'conv3dnl' (3D convolutional layer followed by a non-linearity) to the network. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : 'learning_mode' can be { 0:no learning | 1:weights only | 2:biases only | 3:weights+biases }. +#@cli : Default values: 'kernel_size=3', 'stride=1', 'dilation=1', 'border_shrink=0', 'boundary_conditions=1', 'activation=leakyrelu' and 'learning_mode=3'. +nn_conv3dnl : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint($3) && $3>0 && isint(${4=3}) && $4>0 && ${5=1}>0 && ""isint(${7=0}) && $7>=0 && isint(${8=1}) && inrange($8,0,3) && isint(${10=3}) && inrange($10,0,3)" +skip "${6=1}","${9=leakyrelu}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'conv3d+nl' layer '$1', with input '"$in"', $3 channels, $4x$4x$4 kernels, ""stride $5, dilation $6, border shrink $7, "$s$8" boundary conditions and '$9' activation." +init=$_nn_init +_nn_conv3d $1_conv3d,$in,${3-8},$10 +nn_nl $1,$1_conv3d,$9 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_conv3dnnl : out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation>0,_border_shrink>=0,_boundary_conditions,_activation,0<=_learning_mode<=3 +#@cli : Add a 'conv3dnnl' (3D convolutional layer followed by a normalization layer, then a non-linearity) to the network. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : 'learning_mode' can be { 0:no learning | 1:weights only | 2:biases only | 3:weights+biases }. +#@cli : Default values: 'kernel_size=3', 'stride=1', 'dilation=1', 'border_shrink=0', 'boundary_conditions=1', 'activation=leakyrelu' and 'learning_mode=3'. +nn_conv3dnnl : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint($3) && $3>0 && isint(${4=3}) && $4>0 && ${5=1}>0 && ""isint(${7=0}) && $7>=0 && isint(${8=1}) && inrange($8,0,3) && isint(${10=3}) && inrange($10,0,3)" +skip "${6=1}","${9=leakyrelu}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'conv3d+normalize+nl' layer '$1', with input '"$in"', $3 channels, $4x$4x$4 kernels, ""stride $5, dilation $6, border shrink $7, "$s$8" boundary conditions and '$9' activation." +init=$_nn_init +_nn_conv3d $1_conv3d,$in,${3-8},$10 +_nn_normalize $1_normalize,$1_conv3d,1,3 +nn_nl $1,$1_normalize,$9 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_crop : out,in,x0,y0,z0,c0,x1,y1,z1,c1,_boundary_conditions +#@cli : Add a 'crop' layer to the network. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : Default value: 'boundary_conditions=0'. +nn_crop : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "inrange(${11=0},0,3) && min(isint([${3-11}]))" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^1] "[nn_lin] Add 'crop' layer '$1', with input '"$in"', coordinates (${3-6})-(${7-10}) and "$s$11" boundary conditions." +_nn_modules_names.=$1, +_nn_modules_types.=crop, +cmin:=vmin([${3-6}],[${7-10}]) +cmax:=vmax([${3-6}],[${7-10}]) +_nn_$1_size:=[$cmax]-[$cmin]+1 +_nn_$1_input=$in +_nn_$1_properties="coordinates=(${3-6})x(${7-10})" +_nn_forward.="begin(nn_crop_init_forward($1,"$in",${3-11}));""nn_crop_forward($1,"$in");" +_nn_backward..="nn_crop_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_distance : out,in0,_in1,_metric={ 0:squared-L2 | p>0:Lp-norm } +#@cli : Add a 'distance' layer to the network (distance between two inputs, with specified metric). +#@cli : Default value: 'in=. (previous layer)', +nn_distance : if ['$2']=='.' in0=$_nn_latest else in0=$2 fi nn_check_layer $in0 +if ['${3=.}']=='.' in1=$_nn_latest else in1=$3 fi nn_check_layer $in1 +check "isvarname('$1') && ${4=0}>=0 && "[${_nn_${in0}_size}]==[${_nn_${in1}_size}] +s0,s1="squared-L2 norm","L$4" +e[^-1] "[nn_lib] Add 'distance' layer '$1' ("${s{$4>0}}"), with inputs '"$in0"' and '"$in1"'." +_nn_modules_names.=$1, +_nn_modules_types.=distance, +_nn_$1_size=1,1,1,1 +_nn_$1_input=$in0,$in1 +_nn_$1_properties="metric="${s{$4>0}} +_nn_forward.="begin(nn_distance_init_forward($1,$4));""nn_distance_forward($1,"$in0","$in1");" +_nn_backward..="nn_distance_backward($1,"$in0","$in1");" +_nn_init.="$0 $*" +_nn_latest=$1 +#@cli nn_dropout : out,in,0<=dropout_rate<1 +#@cli : Add a 'dropout' layer to the network. +nn_dropout : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && inrange($3,0,1,1,0)" +e[^-1] "[nn_lib] Add 'dropout' layer '$1', with input '"$in"' and dropout rate $3." +_nn_modules_names.=$1, +_nn_modules_types.=dropout, +_nn_$1_size=${_nn_${in}_size} +_nn_$1_input=$in +_nn_$1_properties="dropout_rate=$3" +_nn_forward.="begin(nn_dropout_init_forward($1,"$in",$3));""nn_dropout_forward($1,"$in");" +_nn_backward..="nn_dropout_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_fc : out,in,nb_channels>0,0<=_learning_mode<=3 +#@cli : Add a 'fc' layer (fully connected layer) to the network. +#@cli : 'learning_mode' can be { 0:no learning | 1:weights only | 2:biases only | 3:weights+biases }. +#@cli : Default value: 'learning_mode=3'. +nn_fc : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint($3) && $3>0 && isint(${4=3}) && inrange($4,0,3)" +e[^-1] "[nn_lib] Add 'fc' layer '$1', with input '"$in"' and $3 channels." +init=$_nn_init +_nn_fc $1_fc,$in,${3-4} +nn_rename $1,$1_fc +_nn_init=${init}"$0 $* " +_nn_latest=$1 +_nn_fc : +_nn_modules_names.=$1, +_nn_modules_types.=fc, +_nn_$1_size=1,1,1,$3 +_nn_$1_learning_mode=$4 +_nn_$1_input=$2 +_nn_$1_properties="learning_mode=$4" +if !isint($$1) +{prod($_nn_$2_size)+1},$3 +f. 4*g/(w-1) +if $4<2 1,100% j.. .,100% rm. fi +=> $1 +fi +_nn_forward.="begin(nn_fc_init_forward($1,$2));""nn_fc_forward($1,$2);" +_nn_backward..="begin(nn_fc_init_backward($1));""nn_fc_backward($1,$2);""end(nn_fc_end_backward($1));" +_nn_init.="$0 $* " +#@cli nn_nlfc : out,in,nb_channels>0,_activation,0<=_learning_mode<=3 +#@cli : Add a 'nlfc' layer (nonlinear fully connected layer) to the network. +#@cli : 'learning_mode' can be { 0:no learning | 1:weights only | 2:biases only | 3:weights+biases }. +#@cli : Default values: 'activation=leakyrelu' and 'learning_mode=3'. +nn_nlfc : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint($3) && $3>0 && isint(${5=3}) && inrange($5,0,3)" +skip ${4=leakyrelu} +e[^-1] "[nn_lib] Add 'nlfc' layer '$1', with input '"$in"', $3 channels and '$4' activation." +init=$_nn_init +_nn_nlfc $1_nlfc,$in,${3-5} +nn_rename $1,$1_nlfc +_nn_init=${init}"$0 $* " +_nn_latest=$1 +_nn_nlfc : +_nn_modules_names.=$1, +_nn_modules_types.=nlfc, +_nn_$1_size=1,1,1,$3 +_nn_$1_learning_mode=$5 +_nn_$1_input=$2 +_nn_$1_properties="activation=$4, learning_mode=$5" +if !isint($$1) +{2*prod($_nn_$2_size)},$3 +f. 4*g/(w-1) +if $5<2 50%,100% j.. .,50% rm. fi +=> $1 +fi +_nn_forward.="begin(nn_nlfc_init_forward($1,$2));""nn_nlfc_forward($1,$2,$4);" +_nn_backward..="begin(nn_nlfc_init_backward($1));""nn_nlfc_backward($1,$2,$4);""end(nn_nlfc_end_backward($1));" +_nn_init.="$0 $* " +#@cli nn_fcnl : out,in,nb_neurons>0,_activation,0<=_learning_mode<=3 +#@cli : Add a 'fcnl' layer (fully connected layer followed by a non-linearity) to the network. +#@cli : 'learning_mode' can be { 0:no learning | 1:weights only | 2:biases only | 3:weights+biases }. +#@cli : Default values: 'activation=leakyrelu' and 'learning_mode=3'. +nn_fcnl : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint($3) && $3>0 && isint(${5=3}) && inrange($5,0,3)" +skip ${4=leakyrelu} +e[^-1] "[nn_lib] Add 'fc+nl' layer '$1' to the network, with input '"$in"', $3 channels and '$4' activation." +init=$_nn_init +_nn_fc $1_fc,$in,$3,$5 +nn_nl $1,$1_fc,$4 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_fcnnl : out,in,nb_neurons>0,_activation,0<=_learning_mode<=3 +#@cli : Add a 'fcnnl' layer (fully connected layer followed by a normalization layer, then a non-linearity) to the network. +#@cli : 'learning_mode' can be { 0:no learning | 1:weights only | 2:biases only | 3:weights+biases }. +#@cli : Default values: 'activation=leakyrelu' and 'learning_mode=3'. +nn_fcnnl : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint($3) && $3>0 && isint(${5=3})" +skip ${4=leakyrelu} +e[^-1] "[nn_lib] Add 'fc+normalize+nl' layer '$1' to the network, with input '"$in"', $3 channels ""and '$4' activation." +init=$_nn_init +_nn_fc $1_fc,$in,$3,$5 +_nn_normalize $1_normalize,$1_fc,0,3 +nn_nl $1,$1_normalize,$4 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_input : name,width,_height,_depth,_spectrum +#@cli : Add a new 'input' to the network. +#@cli : Default values: 'height=1', 'depth=1' and 'spectrum=1'. +nn_input : check "isvarname('$1') && isint($2) && $2>0 && isint(${3=1}) && $3>0 && isint(${4=1}) && $4>0 && ""isint(${5=1}) && $5>0" +e[^-1] "[nn_lib] Add input '$1', with size ($2,$3,$4,$5)." +_nn_modules_names.=$1, +_nn_modules_types.=input, +_nn_$1_size=$2,$3,$4,$5 +_nn_forward.="begin(nn_input_init_forward($1,$2,$3,$4,$5));" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_maxpool2d : out,_in,_patch_size>1 +#@cli : Add a 'maxpool2d' layer (2D max pooling) to the network. +#@cli : Default values: 'in=. (previous layer)' and 'patch_size=2'. +nn_maxpool2d : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=2}) && $3>1" +e[^-1] "[nn_lib] Add 'maxpool2d' layer '$1', with input '"$in"' and patch size $3x$3." +_nn_modules_names.=$1, +_nn_modules_types.=maxpool2d, +_nn_$1_size:=s=[${_nn_${in}_size}];[int(s[0,2]/$3),s[2,2]] +_nn_$1_input=$in +_nn_$1_properties="patch_size=$3x$3" +_nn_forward.="begin(nn_maxpool2d_init_forward($1,"$in",$3));""nn_maxpool2d_forward($1,"$in");" +_nn_backward..="nn_maxpool2d_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_maxpool3d : out,_in,_patch_size>1 +#@cli : Add a 'maxpool3d' layer (3d max pooling) to the network. +#@cli : Default values: 'in=. (previous layer)' and 'patch_size=2'. +nn_maxpool3d : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=2}) && $3>1" +e[^-1] "[nn_lib] Add 'maxpool3d' layer '$1', with input '"$in"' and patch size $3x$3x$3." +_nn_modules_names.=$1, +_nn_modules_types.=maxpool3d, +_nn_$1_size:=s=[${_nn_${in}_size}];[int(s[0,3]/$3),s[3]] +_nn_$1_input=$in +_nn_$1_properties="patch_size=$3x$3x$3" +_nn_forward.="begin(nn_maxpool3d_init_forward($1,"$in",$3));""nn_maxpool3d_forward($1,"$in");" +_nn_backward..="nn_maxpool3d_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_mul : out,in0,_in1 +#@cli : Add an 'mul' layer to the network. +#@cli : Default value: 'in1=. (previous layer)'. +nn_mul : if ['$2']=='.' in0=$_nn_latest else in0=$2 fi nn_check_layer $in0 +if ['${3=.}']=='.' in1=$_nn_latest else in1=$3 fi nn_check_layer $in1 +check "isvarname('$1') && "[${_nn_${in0}_size}]==[${_nn_${in1}_size}] +e[^-1] "[nn_lib] Add 'mul' layer '$1', with inputs '"$in0"' and '"$in1"'." +_nn_modules_names.=$1, +_nn_modules_types.=mul, +_nn_$1_size=${_nn_${in0}_size} +_nn_$1_input=$in0,$in1 +_nn_forward.="begin(nn_mul_init_forward($1,"$in0"));""nn_mul_forward($1,"$in0","$in1");" +_nn_backward..="nn_mul_backward($1,"$in0","$in1");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_nl : out,_in,_activation +#@cli : Add a 'nl' (nonlinearity) layer to the network. +#@cli : 'activation' can be { elu | gelu | leakyrelu | linear | relu | sigmoid | sin | sinc | softmax | sqr | sqrt | swish | tanh }. +#@cli : Default values: 'in=. (previous layer)' and 'activation=leakyrelu'. +nn_nl : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1')" +skip ${3=leakyrelu} +e[^-1] "[nn_lib] Add 'nl' layer '$1', with input '"$in"' and '$3' activation." +_nn_modules_names.=$1, +_nn_modules_types.=nl, +_nn_$1_size=${_nn_${in}_size} +_nn_$1_input=$in +_nn_$1_properties="activation=$3" +_nn_forward.="begin(nn_nl_init_forward($1,"$in"));" +if ['$3']=='softmax' +_nn_forward.="nn_$3_forward($1,"$in");" +_nn_backward..="nn_$3_backward($1,"$in");" +else +_nn_forward.="nn_nl_forward($1,"$in",$3);" +_nn_backward..="nn_nl_backward($1,"$in",$3);" +fi +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_normalize : out,_in,_normalization_mode_,0<=_learning_mode<=3 +#@cli : Add a 'normalize' layer to the network. +#@cli : 'normalization_mode' can be { 0:global parameters | 1:channel-by-channel parameters } +#@cli : 'learning_mode' can be { 0:no learning | 1:alpha only | 2:beta only | 3:alpha+beta } +#@cli : Default values: 'in=. (previous layer)','normalization_mode=0' and 'learning_mode=3'. +nn_normalize : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isbool(${3=0}) && isint(${4=3}) && inrange($4,0,3)" +s0,s1=global,channel-by-channel +e[^-1] "[nn_lib] Add 'normalize' layer '$1', with input '"$in"' and "${s$3}" normalization." +_nn_normalize $1_normalize,$in,${3-4} +nn_rename $1,$1_normalize +_nn_latest=$1 +_nn_normalize : +s0,s1=global,channel-by-channel +_nn_modules_names.=$1, +_nn_modules_types.=normalize, +_nn_$1_size=$_nn_$2_size +_nn_$1_learning_mode=$4 +_nn_$1_input=$2 +_nn_$1_properties="normalization="${s$3}", learning_mode=$4" +if !isint($$1) +(1,0,0,1) +if $3 r. 100%,{[$_nn_$2_size][3]} fi +=> $1 +fi +_nn_forward.="begin(nn_normalize_init_forward($1,$2,$3));""nn_normalize_forward($1,$2);" +_nn_backward..="begin(nn_normalize_init_backward($1));""nn_normalize_backward($1,$2);""end(nn_normalize_end_backward($1));" +_nn_init.="$0 $* " +#@cli nn_patchdown2d : out,_in,_patch_size>1 +#@cli : Add a 'patchdown2d' (2D downscale by patch) layer to the network. +#@cli : Default values: 'in=. (previous layer)' and 'patch_size=2'. +nn_patchdown2d : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=2}) && $3>1" +e[^-1] "[nn_lib] Add 'patchdown2d' layer '$1', with input '"$in"' and patch size $3x$3." +_nn_modules_names.=$1, +_nn_modules_types.=patchdown2d, +_nn_$1_size:=s=[${_nn_${in}_size}];[int(s[0,2]/$3),s[2],s[3]*$3^2] +_nn_$1_input=$in +_nn_$1_properties="patch_size=$3x$3" +if !min($_nn_$1_size) +error[0--3] "Command 'nn_patchdown2d': Specified patch size ($3x$3) is higher than ""input size ("${_nn_${in}_size}")." +fi +_nn_forward.="begin(nn_patchdown2d_init_forward($1,"$in",$3));""nn_patchdown2d_forward($1,"$in");" +_nn_backward..="nn_patchdown2d_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_patchdown3d : out,_in,_patch_size>1 +#@cli : Add a 'patchdown3d' (3D downscale by patch) layer to the network. +#@cli : Default values: 'in=. (previous layer)' and 'patch_size=2'. +nn_patchdown3d : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=2}) && $3>1" +e[^-1] "[nn_lib] Add 'patchdown3d' layer '$1', with input '"$in"' and patch size $3x$3x$3." +_nn_modules_names.=$1, +_nn_modules_types.=patchdown3d, +_nn_$1_size:=s=[${_nn_${in}_size}];[int(s[0,3]/$3),s[3]*$3^3] +_nn_$1_input=$in +_nn_$1_properties="patch_size=$3x$3x$3" +if !min($_nn_$1_size) +error[0--3] "Command 'nn_patchdown3d': Specified patch size ($3x$3x$3) is higher than ""input size ("${_nn_${in}_size}")." +fi +_nn_forward.="begin(nn_patchdown3d_init_forward($1,"$in",$3));""nn_patchdown3d_forward($1,"$in");" +_nn_backward..="nn_patchdown3d_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_patchup2d : out,_in,_patch_size>1 +#@cli : Add a 'patchup2d' (2D upscale by patch) layer to the network. +#@cli : Default values: 'in=. (previous layer)' and 'patch_size=2'. +nn_patchup2d : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=2}) && $3>1" +e[^-1] "[nn_lib] Add 'patchup2d' layer '$1', with input '"$in"' and patch size $3x$3." +_nn_modules_names.=$1, +_nn_modules_types.=patchup2d, +_nn_$1_size:=s=[${_nn_${in}_size}];[int(s[0,2]*$3),s[2],s[3]/$3^2] +_nn_$1_input=$in +_nn_$1_properties="patch_size=$3x$3" +_nn_forward.="begin(nn_patchup2d_init_forward($1,"$in",$3));""nn_patchup2d_forward($1,"$in");" +_nn_backward..="nn_patchup2d_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_patchup3d : out,_in,_patch_size>1 +#@cli : Add a 'patchup3d' (3D upscale by patch) layer to the network. +#@cli : Default values: 'in=. (previous layer)' and 'patch_size=2'. +nn_patchup3d : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=2}) && $3>1" +e[^-1] "[nn_lib] Add 'patchup3d' layer '$1', with input '"$in"' and patch size $3x$3x$3." +_nn_modules_names.=$1, +_nn_modules_types.=patchup3d, +_nn_$1_size:=s=[${_nn_${in}_size}];[int(s[0,3]*$3),s[3]/$3^3] +_nn_$1_input=$in +_nn_$1_properties="patch_size=$3x$3x$3" +_nn_forward.="begin(nn_patchup3d_init_forward($1,"$in",$3));""nn_patchup3d_forward($1,"$in");" +_nn_backward..="nn_patchup3d_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_rename : out,_in +#@cli : Add a 'rename' layer to the network. +#@cli : Default value: 'in=. (previous layer)'. +nn_rename : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1')" +e[^-1] "[nn_lib] Add 'rename' layer '$1', with input '"$in"'." +_nn_modules_names.=$1, +_nn_modules_types.=rename, +_nn_$1_size=${_nn_${in}_size} +_nn_$1_input=$in +_nn_forward.="begin(nn_rename_init_forward($1,"$in"));" +_nn_backward..="nn_rename_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_resconv2d : out,_in,_kernel_size>0,_dilation>0,_boundary_conditions,0<=_learning_mode<=3 +#@cli : Add a 'resconv2d' (residual 2D convolutional layer) to the network. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : 'learning_mode' can be { 0:no learning | 1:weights only | 2:biases only | 3:weights+biases }. +#@cli : Default values: 'in=. (previous layer)', 'kernel_size=3', 'dilation=1', 'boundary_conditions=1' and 'learning_mode=3'. +nn_resconv2d : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=3}) && $3>0 && isint(${5=1}) && inrange($5,0,3) && ""isint(${6=3}) && inrange($6,0,3)" +skip "${4=1}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'resconv2d' layer '$1', with input '"$in"', $3x$3 kernels, dilation $4 and "$s$5" boundary conditions." +init=$_nn_init +nn_clone $1_clone0,$1_clone1,$in +_nn_conv2d $1_conv2d,$1_clone1,{[${_nn_${in}_size}][3]},$3,1,$4,0,$5,$6 +nn_add $1,$1_conv2d,$1_clone0 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_resconv2dnl : out,_in,_kernel_size>0,_dilation>0,_boundary_conditions,_activation,0<=_learning_mode<=3 +#@cli : Add a 'resconv2dnl' (residual 2D convolutional layer followed by a non-linearity) to the network. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : 'learning_mode' can be { 0:no learning | 1:weights only | 2:biases only | 3:weights+biases }. +#@cli : Default values: 'in=. (previous layer)', 'kernel_size=3', 'dilation=1', 'boundary_conditions=1', 'activation=leakyrelu' and 'learning_mode=3'. +nn_resconv2dnl : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=3}) && $3>0 && isint(${5=1}) && inrange($5,0,3) && ""isint(${7=3}) && inrange($7,0,3)" +skip "${4=1}","${6=leakyrelu}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'resconv2dnl' layer '$1', with input '"$in"', $3x$3 kernels, dilation $4, "$s$5" boundary conditions and '$6' activation." +init=$_nn_init +nn_clone $1_clone0,$1_clone1,$in +_nn_conv2d $1_conv2d,$1_clone1,{[${_nn_${in}_size}][3]},$3,1,$4,0,$5,$7 +nn_add $1_add,$1_conv2d,$1_clone0 +nn_nl $1,$1_add,$6 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_resconv2dnnl : out,_in,_kernel_size>0,_dilation>0,_boundary_conditions,_activation,0<=_learning_mode<=3 +#@cli : Add a 'resconv2dnnl' (residual 2D convolutional layer followed by a normalization layer, then a non-linearity)to the network. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : 'learning_mode' can be { 0:no learning | 1:weights only | 2:biases only | 3:weights+biases }. +#@cli : Default values: 'in=. (previous layer)', 'kernel_size=3', 'dilation=1', 'boundary_conditions=1', 'activation=leakyrelu' and 'learning_mode=3'. +nn_resconv2dnnl : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=3}) && $3>0 && isint(${5=1}) && inrange($5,0,3) && ""isint(${7=3}) && inrange($7,0,3)" +skip "${4=1}","${6=leakyrelu}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'resconv2dnnl' layer '$1', with input '"$in"', $3x$3 kernels, dilation $4, "$s$5" boundary conditions and '$6' activation." +init=$_nn_init +nn_clone $1_clone0,$1_clone1,$in +_nn_conv2d $1_conv2d,$1_clone1,{[${_nn_${in}_size}][3]},$3,1,$4,0,$5,$7 +_nn_normalize $1_normalize,$1_conv2d,1,3 +nn_add $1_add,$1_normalize,$1_clone0 +nn_nl $1,$1_add,$6 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_resconv3d : out,_in,_kernel_size>0,_dilation>0,_boundary_conditions,0<=_learning_mode<=3 +#@cli : Add a 'resconv3d' (residual 3D convolutional layer) to the network. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : 'learning_mode' can be { 0:no learning | 1:weights only | 2:biases only | 3:weights+biases }. +#@cli : Default values: 'in=. (previous layer)', 'kernel_size=3', 'dilation=1', 'boundary_conditions=1' and 'learning_mode=3'. +nn_resconv3d : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=3}) && $3>0 && isint(${5=1}) && inrange($5,0,3) && ""isint(${6=3}) && inrange($6,0,3)" +skip "${4=1}" +e[^-1] "[nn_lib] Add 'resconv3d' layer '$1', with input '"$in"', $3x$3x$3 kernels, dilation $4 and "$s$5" boundary conditions." +init=$_nn_init +nn_clone $1_clone0,$1_clone1,$in +_nn_conv3d $1_conv3d,$1_clone1,{[${_nn_${in}_size}][3]},$3,1,$4,0,$5,$6 +nn_add $1,$1_conv3d,$1_clone0 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_resconv3dnl : out,_in,_kernel_size>0,_dilation>0,_boundary_conditions,_activation,0<=_learning_mode<=3 +#@cli : Add a 'resconv3dnl' (residual 3D convolutional layer followed by a non-linearity) to the network. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : 'learning_mode' can be { 0:no learning | 1:weights only | 2:biases only | 3:weights+biases }. +#@cli : Default values: 'in=. (previous layer)', 'kernel_size=3', 'dilation=1', 'boundary_conditions=1', activation='leakyrelu' and 'learning_mode=3'. +nn_resconv3dnl : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=3}) && $3>0 && isint(${5=1}) && inrange($5,0,3) && ""isint(${7=1}) && inrange($7,0,3)" +skip "${4=1}","${6=leakyrelu}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'resconv3dnl' layer '$1', with input '"$in"', $3x$3x$3 kernels, dilation $4, "$s$5" boundary conditions and '$6' activation." +init=$_nn_init +nn_clone $1_clone0,$1_clone1,$in +_nn_conv3d $1_conv3d,$1_clone1,{[${_nn_${in}_size}][3]},$3,1,$4,0,$5,$7 +nn_add $1_add,$1_conv3d,$1_clone0 +nn_nl $1,$1_add,$6 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_resconv3dnnl : out,_in,_kernel_size>0,_dilation>0,_boundary_conditions,_activation,0<=_learning_mode<=3 +#@cli : Add a 'resconv3dnnl' (residual 3D convolutional layer followed by a normalization layer, then a non-linearity)to the network. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : 'learning_mode' can be { 0:no learning | 1:weights only | 2:biases only | 3:weights+biases }. +#@cli : Default values: 'in=. (previous layer)', 'kernel_size=3', 'dilation=1', 'boundary_conditions=1', 'activation=leakyrelu' and 'learning_mode=3'. +nn_resconv3dnnl : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=3}) && $3>0 && isint(${5=1}) && inrange($5,0,3) && ""isint(${7=3}) && inrange($7,0,3)" +skip "${4=1}","${6=leakyrelu}" +s0,s1,s2,s3=dirichlet,neumann,periodic,mirror +e[^-1] "[nn_lib] Add 'resconv3dnnl' layer '$1', with input '"$in"', $3x$3x$3 kernels, dilation $4, "$s$5" boundary conditions and '$6' activation." +init=$_nn_init +nn_clone $1_clone0,$1_clone1,$in +_nn_conv3d $1_conv3d,$1_clone1,{[${_nn_${in}_size}][3]},$3,1,$4,0,$5,$7 +_nn_normalize $1_normalize,$1_conv3d,1,3 +nn_add $1_add,$1_normalize,$1_clone0 +nn_nl $1,$1_add,$6 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_resfc : out,_in,0<=_learning_mode<=3 +#@cli : Add a 'resfc' (residual fully connecter layer) to the network. +#@cli : 'learning_mode' can be { 0:no learning | 1:weights only | 2:biases only | 3:weights+biases }. +#@cli : Default values: 'in=. (previous layer)' and 'learning_mode=3'. +nn_resfc : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${3=3}) && inrange($3,0,3)" +e[^-1] "[nn_lib] Add 'resfc' layer '$1', with input '"$in"'." +init=$_nn_init +nn_clone $1_clone0,$1_clone1,$in +_nn_fc $1_fc,$1_clone1,{prod(${_nn_${in}_size})},$3 +nn_add $1,$1_fc,$1_clone0 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_resfcnl : out,_in,_activation,0<=_learning_mode<=3 +#@cli : Add a 'resfcnl' (residual fully connecter layer followed by a non-linearity) to the network. +#@cli : 'learning_mode' can be { 0:no learning | 1:weights only | 2:biases only | 3:weights+biases }. +#@cli : Default values: 'in=. (previous layer)', 'activation=leakyrelu' and 'learning_mode=3'. +nn_resfcnl : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${4=3}) && inrange($4,0,3)" +skip ${3=leakyrelu} +e[^-1] "[nn_lib] Add 'resfc+nl' layer '$1' to the network, with input '"$in"' and '$4' activation." +init=$_nn_init +nn_clone $1_clone0,$1_clone1,$in +_nn_fc $1_fc,$1_clone1,{prod(${_nn_${in}_size})},$4 +nn_add $1_add,$1_fc,$1_clone0 +nn_nl $1,$1_add,$3 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_resfcnnl : out,_in,_activation,0<=_learning_mode<=3 +#@cli : Add a 'resfcnnl' (residual fully connecter layer followed by a normalization layer, then a non-linearity) to the network. +#@cli : 'learning_mode' can be { 0:no learning | 1:weights only | 2:biases only | 3:weights+biases }. +#@cli : Default values: 'in=. (previous layer)', 'activation=leakyrelu' and 'learning_mode=3'. +nn_resfcnnl : if ['${2=.}']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isint(${4=3}) && inrange($4,0,3)" +skip ${3=leakyrelu} +e[^-1] "[nn_lib] Add 'resfc+normalize+nl' layer '$1' to the network, with input '"$in"' and '$4' activation." +init=$_nn_init +nn_clone $1_clone0,$1_clone1,$in +_nn_fc $1_fc,$1_clone1,{prod(${_nn_${in}_size})},1 +_nn_normalize $1_normalize,$1_fc,0,3 +nn_add $1_add,$1_normalize,$1_clone0 +nn_nl $1,$1_add,$3 +_nn_init=${init}"$0 $* " +_nn_latest=$1 +#@cli nn_reshape : out,in,width>0,height>0,depth>0,spectrum>0 +#@cli : Add a 'reshape' layer to the network. +nn_reshape : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1')" +e[^-1] "[nn_lib] Add 'reshape' layer '$1', with input '"$in"' and size ($3,$4,$5,$6)." +_nn_modules_names.=$1, +_nn_modules_types.=reshape, +_nn_$1_size=$3,$4,$5,$6 +_nn_$1_input=$in +if prod($_nn_$1_size)!=prod(${_nn_${in}_size}) +error[0--3] "Command 'nn_reshape': Cannot reshape input ("${_nn_${in}_size}") to output ("$_nn_$1_size")." +fi +_nn_forward.="begin(nn_reshape_init_forward($1,"$in",${3-6}));" +_nn_backward..="begin(nn_reshape_init_backward($1,"$in"));" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_resize : out,in,width[%]>0,_height[%]>0,_depth[%]>0,_spectrum[%]>0,_interpolation +#@cli : Add a 'resize' layer to the network. +#@cli : Default values: 'height=depth=spectrum=100%' and 'interpolation=3'. +nn_resize : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && $3>0 && ${4=100%}>0 && ${5=100%}>0 && ${6=100%}>0" +skip ${7=3} +if ispercentage($3) w:=max(1,round([${_nn_${in}_size}][1]*$3)) else w=$3 fi +if ispercentage($4) h:=max(1,round([${_nn_${in}_size}][1]*$4)) else h=$4 fi +if ispercentage($5) d:=max(1,round([${_nn_${in}_size}][2]*$5)) else d=$5 fi +if ispercentage($6) s:=max(1,round([${_nn_${in}_size}][3]*$6)) else s=$6 fi +e[^-1] "[nn_lib] Add 'resize' layer '$1', with input '"$in"' and output size ("$w","$h","$d","$s")." +_nn_modules_names.=$1, +_nn_modules_types.=resize, +_nn_$1_size=$w,$h,$d,$s +_nn_$1_input=$in +_nn_$1_properties="interpolation=$7" +_nn_forward.="begin(nn_resize_init_forward($1,"$in","$w","$h","$d","$s",$7));""nn_resize_forward($1,"$in");" +_nn_backward..="nn_resize_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_run : out,in,"command",_width[%]>0,_height[%]>0,_depth[%]>0,_spectrum[%]>0 +#@cli : Add a 'run' layer to the network. +#@cli : Default values: 'width=height=depth=spectrum=100%'. +nn_run : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && ${4=100%}>0 && ${5=100%}>0 && ${6=100%}>0 && ${7=100%}>0" +if ispercentage($4) w:=max(1,round([${_nn_${in}_size}][0]*$4)) else w=$4 fi +if ispercentage($5) h:=max(1,round([${_nn_${in}_size}][1]*$5)) else h=$5 fi +if ispercentage($6) d:=max(1,round([${_nn_${in}_size}][2]*$6)) else d=$6 fi +if ispercentage($7) s:=max(1,round([${_nn_${in}_size}][3]*$7)) else s=$7 fi +e[^-1] "[nn_lib] Add 'run' layer '$1', with input '"$in"', command '$3' and output size ("$w","$h","$d","$s")." +_nn_modules_names.=$1, +_nn_modules_types.=run, +_nn_$1_size=$w,$h,$d,$s +_nn_$1_input=$in +_nn_$1_properties="command='$3'" +_nn_forward.="begin(nn_run_init_forward($1,"$in",'$3',"$w","$h","$d","$s"));""nn_run_forward($1,"$in");" +_nn_backward..="nn_run_backward($1,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_split : name0,name1,in,nb_channels0 +#@cli : Add a 'split' layer to the network. +nn_split : if ['$3']=='.' in=$_nn_latest else in=$3 fi nn_check_layer $in +check "isvarname('$1') && isvarname('$2')" +e[^-1] "[nn_lib] Add 'split' layer, with input '"$in"' and outputs '$1' and '$2'." +_nn_modules_names.=$1,$2, +_nn_modules_types.=split,split, +_nn_$1_size:=[[${_nn_${in}_size}][0,3],$4] +_nn_$1_input=$2 +_nn_$2_size:=[${_nn_${in}_size}]-[0,0,0,$4] +_nn_$2_input=$2 +_nn_forward.="begin(nn_split_init_forward($1,$2,"$in",$4));""nn_split_forward($1,$2,"$in");" +_nn_backward..="nn_split_backward($1,$2,"$in");" +_nn_init.="$0 $* " +_nn_latest=$1 +#@cli nn_loss_binary_crossentropy : out,in,ground_truth +#@cli : Add a 'binary_crossentropy' loss to the network (binary cross entropy). +nn_loss_binary_crossentropy : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isvarname('$3')" +e[^-1] "[nn_lib] Add binary cross entropy loss '$1', with input '"$in"' and ground truth '$3'." +_nn_modules_names.=$1, +_nn_modules_types.=loss_binary_crossentropy, +_nn_$1_size=1,1,1,1 +_nn_$1_input=$in +_nn_$1_properties="ground_truth=$3" +_nn_loss.="begin(nn_loss_binary_crossentropy_init_forward($1));""nn_loss_binary_crossentropy_forward($1,"$in",$3);""end(nn_loss_binary_crossentropy_end_forward($1));" +_nn_backward..="nn_loss_binary_crossentropy_backward($1,"$in",$3);" +_nn_latest=$1 +#@cli nn_loss_crossentropy : out,in,ground_truth +#@cli : Add a 'crossentropy' loss to the network (cross entropy). +nn_loss_crossentropy : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isvarname('$3')" +e[^-1] "[nn_lib] Add cross entropy loss '$1', with input '"$in"' and ground truth '$3'." +_nn_modules_names.=$1, +_nn_modules_types.=loss_crossentropy, +_nn_$1_size=1,1,1,1 +_nn_$1_input=$in +_nn_$1_properties="ground_truth=$3" +_nn_loss.="begin(nn_loss_crossentropy_init_forward($1));""nn_loss_crossentropy_forward($1,"$in",$3);""end(nn_loss_crossentropy_end_forward($1));" +_nn_backward..="nn_loss_crossentropy_backward($1,"$in",$3);" +_nn_latest=$1 +#@cli nn_loss_mse : out,in,ground_truth +#@cli : Add a 'mse' loss to the network (mean-squared error). +nn_loss_mse : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isvarname('$3')" +e[^-1] "[nn_lib] Add MSE loss '$1', with input '"$in"' and ground truth '$3'." +_nn_modules_names.=$1, +_nn_modules_types.=loss_mse, +_nn_$1_size=1,1,1,1 +_nn_$1_input=$in +_nn_$1_properties="ground_truth=$3" +_nn_loss.="begin(nn_loss_mse_init_forward($1));""nn_loss_mse_forward($1,"$in",$3);""end(nn_loss_mse_end_forward($1));" +_nn_backward..="nn_loss_mse_backward($1,"$in",$3);" +_nn_latest=$1 +#@cli nn_loss_normp : out,in,ground_truth,_metric={ 0:squared-L2 | p>0:Lp-norm } +#@cli : Add a 'normp' loss to the network (||out - ground_truth||_p). +#@cli : Default value: 'metric=1'. +nn_loss_normp : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isvarname('$3') && isint(${4=1}) && $4>=0" +e[^-1] "[nn_lib] Add normp loss '$1', with input '"$in"', ground truth '$3' and metric $4." +_nn_modules_names.=$1, +_nn_modules_types.=loss_normp, +_nn_$1_size=1,1,1,1 +_nn_$1_input=$in +_nn_$1_properties="ground_truth=$3, metric=$4" +_nn_loss.="begin(nn_loss_normp_init_forward($1,$4));""nn_loss_normp_forward($1,"$in",$3);""end(nn_loss_normp_end_forward($1));" +_nn_backward..="nn_loss_normp_backward($1,"$in",$3);" +_nn_latest=$1 +#@cli nn_loss_softmax_crossentropy : out,in,ground_truth +#@cli : Add a 'softmax_crossentropy' loss to the network (softmax followed by cross entropy). +nn_loss_softmax_crossentropy : if ['$2']=='.' in=$_nn_latest else in=$2 fi nn_check_layer $in +check "isvarname('$1') && isvarname('$3')" +e[^-1] "[nn_lib] Add softmax + cross entropy loss '$1', with input '"$in"' and ground truth '$3'." +_nn_modules_names.=$1, +_nn_modules_types.=loss_softmax_crossentropy, +_nn_$1_size=1,1,1,1 +_nn_$1_input=$2 +_nn_$1_properties="ground_truth=$3" +_nn_loss.="begin(nn_loss_softmax_crossentropy_init_forward($1));""nn_loss_softmax_crossentropy_forward($1,"$in",$3);""end(nn_loss_softmax_crossentropy_end_forward($1));" +_nn_backward..="nn_loss_softmax_crossentropy_backward($1,"$in",$3);" +_nn_latest=$1 +#@cli nn_print +#@cli : Print info on current neural network. +nn_print : +e[^-1] "[nn_lib] Print info on current neural network." +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r b=$_vt100_b v 0 +e " * List of modules:" +repeat narg($_nn_modules_names)-1 { +type=${arg0\ $>,$_nn_modules_types} +name=${arg0\ $>,$_nn_modules_names} +learning_mode=${_nn_${name}_learning_mode} +e " - Module: "$b$name$n" (type: "$g$type$n")" +if ['${_nn_${name}_input}']!=0 +s={`find(['${_nn_${name}_input}'],_',')>0?_'s':0`} +e " * Input"$s": "$c${_nn_${name}_input}$n +fi +e " * Output size: "$c${_nn_${name}_size}$n +if ['${_nn_${name}_properties}']!=0 +ies={`find(['${_nn_${name}_properties}'],_',')>0?'ies':[_'y',0,0]`} +e " * Propert"$ies": "$c${_nn_${name}_properties}$n +fi +if ${$name} +e " * Parameters: "$c{$name,whds}$n +fi +} +e "\n * Total: "${b}{narg($_nn_modules_names)-1}$n" modules, "$b${-nn_size}$n" parameters.\n" +#@cli nn_trainer : name,_loss,_learning_rate>0,_optimizer,_scheduler +#@cli : Add a network trainer to the network. +#@cli : 'optimizer' can be { sgd | rmsprop | adam | adamax }. +#@cli : 'scheduler' can be { constant | linear | exponential | adaptive }. +#@cli : Default values: 'loss=. (previous loss)', 'learning_rate=2e-4', 'optimizer=rmsprop' and 'scheduler=constant'. +nn_trainer : if ['${2=.}']=='.' loss=$_nn_latest else loss=$2 fi nn_check_layer $loss +check "isvarname('$1') && ${3=2e-4}>0 && isvarname('${4=rmsprop}') && isvarname('${5=constant}')" +e[^-1] "[nn_lib] Add trainer '$1' for loss '"$loss"', with learning rate '$3', $4 optimizer and $5 scheduler." +_nn_modules_names.=$1, +_nn_modules_types.=trainer, +_nn_$1_size=0,0,0,0 +_nn_$1_properties="loss="$loss", learning_rate=$3, optimizer=$4, scheduler=$5" +if !isint($$1) +l[] { (0,$3,$3,inf,inf) _nn_optimizer_$4 _nn_scheduler_$5 a y => $1 } +else +=[$1] $3,1,0 +=[$1] $3,2,0 +fi +_nn_$1_update="begin(nn_trainer_init_backward($1,"$loss",$4,$5));end(" +repeat narg($_nn_modules_names)-1 { +type=${arg0\ $>,$_nn_modules_types} +name=${arg0\ $>,$_nn_modules_names} +learning_mode=${_nn_${name}_learning_mode} +if isin('$type','conv2d','conv3d','fc','nlfc','normalize') +_nn_$1_update.="nn_optimizer_$4_update_"$type"("$name,$learning_mode");" +if $learning_mode +if ['$4']=='rmsprop' +name_g2=${name}_g2 +if !isint(${$name_g2}) +f[$name] 0 => $name_g2 fi +_nn_trainer_data.=$name_g2, +elif isin('$4','adam','adamax') +name_m,name_v=${name}_m,${name}_v +if !isint(${$name_m}) +f[$name] 0 => $name_m fi +if !isint(${$name_v}) +f[$name] 0 => $name_v fi +_nn_trainer_data.=$name_m,$name_v, +fi +fi +fi +} +_nn_$1_update.="nn_trainer_update($1,"$loss",$5));" +_nn_update=$_nn_$1_update +_nn_optimizer_sgd : 1 +_nn_optimizer_rmsprop : 1 +_nn_optimizer_adam : 1 +_nn_optimizer_adamax : 1 +_nn_scheduler_constant : 1 +_nn_scheduler_linear : 1 +_nn_scheduler_exponential : 1 +_nn_scheduler_adaptive : (0,0,0) +#@cli nn_size +#@cli: Return size of the current network (i.e. number of stored parameters). +nn_size : +e[^-1] "[nn_lib] Return size of the current network." +siz=0 +repeat narg($_nn_modules_names)-1 { +type=${arg0\ $>,$_nn_modules_types} +name=${arg0\ $>,$_nn_modules_names} +if isin('$type','conv2d','conv3d','fc','nlfc','normalize') siz+={$name,whds} fi +} +u $siz +#@cli nn_load : 'filename.gmz',_include_trainer_data={ 0:no | 1:yes } +#@cli : Load and initialize network saved as a .gmz file. +#@cli : Neural network files can be only loaded in .gmz format. +#@cli : Default value: 'include_trainer_data=1'. ++nn_load : check "s=['$1']; find(s,'.gmz')==size(s) - 4 && isbool(${2=1})" +e[^-1] "[nn_lib] Load network from file '$1'." +l[] { +"$1" run {t} rm. +if !$2 +nmd $_nn_modules_names k[${}] +fi +} +#@cli nn_save : 'filename.gmz',_include_trainer_data={ 0:no | 1:yes } +#@cli : Save current network as a .gmz file. +#@cli : `.gmz` is mandatory extension, specifying another file extension will throw an error. +#@cli : Default value: 'include_trainer_data=1'. +nn_save : check "s=['$1']; find(s,'.gmz')==size(s) - 4 && isbool(${2=1})" +s0,s1=""," (include trainer data)" +e[^-1] "[nn_lib] Save current network as file '$1'"$s$2"." +if $2 sel=$_nn_trainer_data fi c= +repeat narg($_nn_modules_names)-1 { +type=${arg0\ $>,$_nn_modules_types} +name=${arg0\ $>,$_nn_modules_names} +if isin('$type','conv2d','conv3d','fc','nlfc','normalize','trainer') sel.=$c$name c=, fi +} +('$_nn_init') autocrop. {'" "'} => _nn_init +o[$sel,-1] "$1" +rm. +#@cli nn_store : 'variable_name',_include_trainer_data={ 0:no | 1:yes } +#@cli : Store current network into a variable. +#@cli : Default value: 'include_trainer_data=1'. +nn_store : check "isbool(${2=1})" +s0,s1=""," (include trainer data)" +e[^-1] "[nn_lib] Store current network into variable '$1'"$s$2"." +if $2 sel=$_nn_trainer_data fi c= +repeat narg($_nn_modules_names)-1 { +type=${arg0\ $>,$_nn_modules_types} +name=${arg0\ $>,$_nn_modules_names} +if isin('$type','conv2d','conv3d','fc','nlfc','normalize','trainer') sel.=$c$name c=, fi +} +('$_nn_init') autocrop. {'" "'} => _nn_init ++store[$sel,-1] "$1" +rm. +#@cli :: Arrays, Tiles and Frames +#@cli array : M>0,_N>0,_expand_type={ 0:min | 1:max | 2:all } +#@cli : Create MxN array from selected images. +#@cli : Default values: 'N=M' and 'expand_type=0'. +#@cli : $ image.jpg array 3,2,2 +array : check "isint($1) && $1>0 && isint(${2=$1}) && $2>0" skip ${3=0} +e[^-1] "Create $1x$2 array from image$?, with expand type $3." +r0:=100/max($1,$2) r1:=100/min($1,$2) r2=100 +r ${r$3}%,${r$3}%,1,100%,2 r {$1*100}%,{$2*100}%,1,100%,0,2 +#@cli array_fade : M>0,_N>0,0<=_fade_start<=100,0<=_fade_end<=100,_expand_type={0:min | 1:max | 2:all} +#@cli : Create MxN array from selected images. +#@cli : Default values: 'N=M', 'fade_start=60', 'fade_end=90' and 'expand_type=1'. +#@cli : $ image.jpg array_fade 3,2 +array_fade : skip ${2=$1},${3=60},${4=90},${5=1} +e[^-1] "Create $1x$2 array of ($3%,$4%) faded tiles from image$?, with expand type $5." +foreach { . shift.. {round(w/2)},{round(h/2)},1,1,2 fade_diamond $3,$4 } +array $1,$2,$5 +#@cli array_mirror : N>=0,_dir={ 0:x | 1:y | 2:xy | 3:tri-xy },_expand_type={ 0 | 1 } +#@cli : Create 2^Nx2^N array from selected images. +#@cli : Default values: 'dir=2' and 'expand_type=0'. +#@cli : $ image.jpg array_mirror 2 +array_mirror : skip ${2=2},${3=0} +e[^-1] "Create a 2^$1x2^$1 mirrored-array from image$?, with expand type $2." +repeat $1 { +if !$3 +if $2>=3 r 33%,33%,100%,100%,2 +else r 50%,50%,100%,100%,2 +fi +fi +foreach { +if !$2 +mirror x a x +elif $2==1 +mirror y a y +else +mirror x a x +mirror y a y if $2==3 r 150%,150%,1,100%,0,2,1,1 fi +fi +} +} +#@cli array_random : Ms>0,_Ns>0,_Md>0,_Nd>0 +#@cli : Create MdxNd array of tiles from selected MsxNs source arrays. +#@cli : Default values: 'Ns=Ms', 'Md=Ms' and 'Nd=Ns'. +#@cli : $ image.jpg +array_random 8,8,15,10 +array_random : skip ${2=$1},${3=$1},${4=$2} +e[^-1] "Create $3x$4 array of tiles from $1x$2 array$?." +foreach { +nm={n} +split_tiles $1,$2 +repeat $3 { repeat $4 { [{u($1*$2-1)}] } } +rm[0-{$1*$2-1}] append_tiles $3,$4 +=> $nm +} +#@cli frame : eq. to 'frame_xy'. +frame : skip ${2=$1}>=0,${3=255},${4=$3},${5=$4},${6=255} +_gmic_s="$?" v + _frame_xy ${1--1} +#@cli frame_blur : _sharpness>0,_size>=0,_smoothness,_shading,_blur +#@cli : Draw RGBA-colored round frame in selected images. +#@cli : Default values: 'sharpness=10', 'size=30', 'smoothness=0', 'shading=1' and 'blur=3%'. +#@cli : $ image.jpg frame_blur 3,30,8,10% +frame_blur : skip ${1=10},${2=30},${3=0},${4=1},${5=3%} +e[^-1] "Draw round frame on image$?, with sharpness $1, size $2, smoothness $3, shading $4 and blur $5." +to_rgba foreach { +nm={n} +100%,100%,1,1,"-(abs(x/w-0.5)^$1 + abs(y/h-0.5)^$1)^(1/$1)" >=. $2% +if $4 distance. 1 n. 0,1 *. -1 +. 1 ^. {1/$4} fi +b. $3 +b.. $5 mv. -3 blend_fade[0,1] . rm. +=> $nm +} +#@cli frame_cube : _depth>=0,_centering_x,_centering_y,_left_side={ 0:normal | 1:mirror-x | 2:mirror-y | 3:mirror-xy },_right_side,_lower_side,_upper_side +#@cli : Insert 3D frames in selected images. +#@cli : Default values: 'depth=1', 'centering_x=centering_y=0' and 'left_side=right_side,lower_side=upper_side=0'. +#@cli : $ image.jpg frame_cube , +frame_cube : check "${1=1}>=0" skip ${2=0},${3=0},${4=0},${5=0},${6=0},${7=0} +e[^-1] "Insert 3D frame in image$?, with depth $1, centering point ($2,$3) and orientations (${4--1})." +foreach { +nm={n} split_opacity +if $!==2 frame_cube ${1--1} a c +else +m:=max(w,h) w,h,s={w},{h},{s} +imageplane3d c3d /3d. $w,$h,1 ++_frame_cube[0] $4 r3d. 0,1,0,-90 +3d. -0.5,0,-0.5 ++_frame_cube[0] $5 r3d. 0,1,0,90 +3d. 0.5,0,-0.5 ++_frame_cube[0] $6 r3d. 1,0,0,-90 +3d. 0,0.5,-0.5 ++_frame_cube[0] $7 r3d. 1,0,0,90 +3d. 0,-0.5,-0.5 ++3d 0,0,1 +3d *3d $w,$h,$m +f=1000 +cx=$2*$w/2*($f+$m*$1)/$f +cy=$3*$h/2*($f+$m*$1)/$f +s3d r[2] 3,{{2,h}/3},1,1,-1 +f[2] "i(2,y)<0.5?i:i+(!x?"$cx":x==1?"$cy":($1-1)*"$m")" +y[2] a y +*3d 2 {2*$w},{2*$h},1,$s f3d {2*$f} +j3d. ..,50%,50%,0,1,2,0,0 rm.. +r $w,$h,1,100%,2 +fi +=> $nm +} +_frame_cube : +if $1==1 r3d. 0,1,0,180 rv3d. +elif $1==2 r3d. 1,0,0,180 rv3d. +elif $1==3 r3d. 0,0,1,180 +fi +#@cli frame_fuzzy : size_x[%]>=0,_size_y[%]>=0,_fuzzyness>=0,_smoothness[%]>=0,_R,_G,_B,_A +#@cli : Draw RGBA-colored fuzzy frame in selected images. +#@cli : Default values: 'size_y=size_x', 'fuzzyness=5', 'smoothness=1' and 'R=G=B=A=255'. +#@cli : $ image.jpg frame_fuzzy 20 +frame_fuzzy : skip ${2=$1},${3=5},${4=1},${5=255},${6=$5},${7=$6},${8=255} +e[^-1] "Draw $1x$2 fuzzy frame on image$?, with fuzzyness $3, smoothness $4 and RGBA color ($5,$6,$7,$8)." +to_rgba +foreach { +100%,100%,1,1,1 +padx:=ispercentage($1)?$1*(w-1)/2:$1 +pady:=ispercentage($2)?$2*(h-1)/2:$2 +rectangle. $padx,$pady,{w-1-$padx},{h-1-$pady} +spread. $3 b. $4 100%,100%,1,4 fc. ${5-8} +j[0] [2],0,0,0,0,1,[1] k[0] +} +#@cli frame_painting : _size[%]>=0,0<=_contrast<=1,_profile_smoothness[%]>=0,_R,_G,_B,_vignette_size[%]>=0,_vignette_contrast>=0,_defects_contrast>=0,0<=_defects_density<=100,_defects_size>=0,_defects_smoothness[%]>=0,_serial_number +#@cli : Add a painting frame to selected images. +#@cli : Default values: 'size=10%', 'contrast=0.4', 'profile_smoothness=6%', 'R=225', 'G=200', 'B=120', 'vignette_size=2%', 'vignette_contrast=400', 'defects_contrast=50', 'defects_density=10', 'defects_size=1', 'defects_smoothness=0.5%' and 'serial_number=123456789'. +#@cli : $ image.jpg frame_painting , +frame_painting : +check "${1=10%}>=0 && ${2=0.4}>=0 && $2<=1 && ${3=6%}>=0 && ${7=2%}>=0 && ${8=400}>=0 && ${9=50}>=0 && +${10=10}>=0 && $10<=100 && ${11=1}>=0 && ${12=0.5%}>=0" +skip ${4=225},${5=200},${6=120},${13=123456789} +e[^-1] "Add painting frame to image$?, with size $1, contrast $2, profile smoothness $3, color (${4-6}), +vignette size $7, vignette strength $8, defects contrast $9, defects density $10, defects size $11, +defects smoothness $12 and serial number $13." +if !$1 return fi +foreach { +$1,$1 s:=max(w,h) rm. +('${dec2bin\ $13}') -. {'0'} r. $s +transpose. b. $3 n. {1-$2},{1+$2} ++r. {{-2,w}+2*$s},100%,1,1 ++mirror. y +mv... $! transpose. r. 100%,{-4,h+2*$s},1,1 ++mirror. x +...,...,1,1,1 +polygon. 3,0,0,{$s-1},{$s-1},0,{$s-1},1,0 +polygon. 3,100%,0,{w-$s},100%,100%,100%,1,0 +..,..,1,1,1 +polygon. 3,1,0,100%,{$s-2},100%,0 +polygon. 3,1,100%,100%,{h-$s+1},100%,100%,1,0 +_frame_painting[-6--3] ${4-6},${9-12} +{-7,w+2*$s},{-7,h+2*$s},1,3 +j. [-7],0,0,0,0,1,...,1 rm[-7] mirror... y +j. [-6],0,{h-$s},0,0,1,...,1 rm[-6,-3] +j. [-4],0,0,0,0,1,..,1 rm[-4] mirror.. x +j. ...,{w-$s},0,0,0,1,..,1 rm[-3,-2] +..,..,1,1,-255 r. ..,..,1,1,0,0,0.5,0.5 +. 255 +b. $7 n. 0,$8 max[-2,-1] c. 0,255 +a[-2--1] c +r.. .,.,1,100%,0,0,0.5,0.5 blend alpha +} +_frame_painting : +foreach { ++*. $2 +*.. $3 *... $1 a[-3--1] c +100%,100% +i=0 do rand. 0,1 remove_pixels. {100-$5}% b. $6 >=. 50% i+=1 while "m=$5/200;(iam+0.2) && "$i"<10" +b. $7 g. +[-2,-1] n. -$4,$4 ++[-2,-1] c. 0,255 +} +#@cli frame_pattern : M>=3,_constrain_size={ 0 | 1 } : M>=3,_[frame_image],_constrain_size={ 0 | 1 } +#@cli : Insert selected pattern frame in selected images. +#@cli : Default values: 'pattern=0' and 'constrain_size=0'. +#@cli : $ image.jpg frame_pattern 8 +frame_pattern : check $1>=3 skip "${2=0},${3=0}" +to_colormode 0 +if ${"is_image_arg $2"} +e[^-1] "Insert $1x$1 pattern frame on image$?, using frame image$2." +pass$2 0 +foreach[^-1] { pass. +wh={0,[w,h]} ++r[1] {0,max(1,w/($1-2))},{0,max(1,h/($1-2))},1,100%,2 +r[0] {{0,w}+2*w},{{0,h}+2*h},1,100%,0,0,0.5,0.5 +[-1]x{$1+2} a[{-$1-2}--1] x j[0] .,0,0 j[0] .,0,{{0,h}-1-h} rm. +[-1]x{$1+1} a[{-$1-2}--1] y j[0] .,0,0 j[0] .,{{0,w}-1-w} rm. +if $3 r[0] $wh,1,100%,2 fi +rm. +} rm. +else +e[^-1] "Insert $1x$1 self-pattern frame on image$?." +foreach { +wh:=w,h ++r {max(1,w/($1-2))},{max(1,h/($1-2))},1,100%,2 r.. {$1*w},{$1*h},1,100%,0,0,0.5,0.5 +[-1]x{$1+2} a[{-$1-2}--1] x j... .,0,0 j... .,0,{{-3,h}-1-h} rm. +[-1]x{$1+1} a[{-$1-2}--1] y j.. .,0,0 j.. .,{{-2,w}-1-w} rm. +if $3 r $wh,1,100%,2 fi +} +fi +#@cli frame_round : size_x[%]>=0,size_y[%]>=0,radius[%]>=0,_smoothness[%]>=0,_col1,...,_colN +#@cli : Insert an inner round frame in selected images. +#@cli : Default values: 'size_x=size_y=5%, 'radius=30%', 'smoothness=0' and 'col=0,0,0,255'. +frame_round : check "${1=5%}>=0 && ${2=$1}>=0 && ${3=30%}>=0 && ${4=0}>=0" skip "${5=0},${6=$5},${7=$5},${8=255}" +e[^-1] "Insert $1x$2 round frame on image$?, with radius $3, smoothness $4 and color (${5--1})." +if !max($1,$2,$3) return fi +foreach { +fwM,fhM:=round([w,h]/2) +fw,fh:=round([ispercentage($1)?lerp(0,$fwM,$1):$1,ispercentage($2)?lerp(0,$fhM,$2):$2]) +iw,ih:=[w,h]-2*[$fw,$fh] +if $iw<=0" || "$ih<=0 fc ${5--1} +else +R:=ispercentage($3)?max(w,h)*$3:$3 +$iw,$ih +shape_circle $R shift. 50%,50%,0,0,2 ==. 0 +x0,y0,x1,y1:=w2=round(w/2);h2=round(w/2);[-w2,-h2,w#1-w2,h#1-h2] +j.. .,$x0,$y0 j.. .,$x1,$y0 j.. .,$x1,$y1 j.. .,$x0,$y1 rm. +frame. $fw,$fh,1 b. $4 +1,1,1,{0,s},${5--1} r. ..,..,1,100% +j... .,0,0,0,0,1,.. +k... +fi +} +#@cli frame_seamless : frame_size>=0,_patch_size>0,_blend_size>=0,_frame_direction={ 0:inner (preserve image size) | 1:outer } +#@cli : Insert frame in selected images, so that tiling the resulting image makes less visible seams. +#@cli : Default values: 'patch_size=7', 'blend_size=5' and 'frame_direction=1'. +#@cli : $ image.jpg +frame_seamless 30 array 2,2 +frame_seamless : check "$1>=0 && isint(${2=7}) && $2>0 && isint(${3=5}) && $3>=0" skip ${4=1} +s0="inner" s1="outer" +e[^-1] "Insert "${s{!!$4}}" seamless frame in image$?, with size $1, patch size $2 and blend size $3." +foreach { +w2,h2:=round([w,h]/2) +w4,h4:=round([w,h]/4) +if !$4 r {max(1,w-$1)},{max(1,h-$1)},1,100%,0,0,0.5,0.5 fi +100%,100%,1,1,-1 r[-2,-1] {w+$1},{h+$1},1,100%,0,0,0.5,0.5 n. 0,1 +shift -$w2,-$h2,0,0,2 +inpaint_matchpatch.. [1],0,$2,10,$3 +rectangle. $1,$1,{w-1-$1},{h-1-$1} +shift -$w4,-$h4,0,0,2 +inpaint_matchpatch.. [1],0,$2,10,$3 +rm. +shift {$w4+$w2},{$h4+$h2},0,0,2 +} +#@cli frame_x : size_x[%],_col1,...,_colN +#@cli : Insert outer frame along the x-axis in selected images. +#@cli : Default values: 'col1=col2=col3=255' and 'col4=255'. +#@cli : $ image.jpg frame_x 20,255,0,255 +frame_x : skip ${2=255},${3=$2},${4=$3},${5=255} +e[^-1] "Insert $1 outer frame in image$? along the x-axis, with color (${2--1})." +_frame $1,0,0,${2--1} +#@cli frame_xy : size_x[%],_size_y[%],_col1,...,_colN +#@cli : Insert outer frame along the x-axis in selected images. +#@cli : Default values: 'size_y=size_x', 'col1=col2=col3=255' and 'col4=255'. +#@cli : (eq. to 'frame'). +#@cli : $ image.jpg frame_xy 1,1,0 frame_xy 20,10,255,0,255 +frame_xy : skip ${2=$1},${3=255},${4=$3},${5=$4},${6=255} +_gmic_s="$?" v + _$0 ${1--1} +_frame_xy : +e[0--3] "Insert $1x$2 outer frame in image"$_gmic_s" along the xy-axes, with color (${3--1})." +_frame $1,$2,0,${3--1} +#@cli frame_xyz : size_x[%],_size_y[%],_size_z[%]_col1,...,_colN +#@cli : Insert outer frame along the x-axis in selected images. +#@cli : Default values: 'size_y=size_x=size_z', 'col1=col2=col3=255' and 'col4=255'. +frame_xyz : skip ${2=$1},${3=$2},${4=255},${5=$4},${6=$5},${7=255} +e[^-1] "Insert $1x$2x$3 outer frame in image$? along the xyz-axes, with color (${4--1})." +_frame $1,$2,$3,${4--1} +#@cli frame_y : size_y[%],_col1,...,_colN +#@cli : Insert outer frame along the y-axis in selected images. +#@cli : Default values: 'col1=col2=col3=255' and 'col4=255'. +#@cli : $ image.jpg frame_y 20,255,0,255 +frame_y : skip ${2=255},${3=$2},${4=$3},${5=255} +e[^-1] "Insert $1 outer frame in image$? along the y-axis, with color (${2--1})." +_frame 0,$1,0,${2--1} +_frame : +foreach { +nm={n} +fw,fh,fd:=round([ispercentage($1)?w*$1:$1,ispercentage($2)?h*$2:$2,ispercentage($3)?d*$3:$3]) +1,1,1,100%,${4--1} r. {0,[w,h,d]+2*[$fw,$fh,$fd]},100% +j. ..,$fw,$fh,$fd +k. => $nm +} +#@cli img2ascii : _charset,_analysis_scale>0,_analysis_smoothness[%]>=0,_synthesis_scale>0,_output_ascii_filename +#@cli : Render selected images as binary ascii art. +#@cli : This command returns the corresponding the list of widths and heights (expressed as a number of characters) +#@cli : for each selected image. +#@cli : Default values: 'charset=[ascii charset]', 'analysis_scale=16', 'analysis_smoothness=20%', 'synthesis_scale=16' and '_output_ascii_filename=[undefined]'. +#@cli : $ image.jpg img2ascii , +img2ascii : check "${2=16}>0 && ${3=20%}>=0 && ${4=16}>0" +skip "${1= !\042#$%&\047()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\133\\\135^_\140abcdefghijk""lmnopqrstuvwxyz\173|\174~}","${5=}" +e[^-1] "Render image$? as binary ascii art, with charset '$1', analysis scale $2, analysis smoothness $3, +synthesis scale $4 and output ascii filename '$5'." +is_multi:=$!>1 +l[] { +('"$1"') repeat w { +C={`92`}${dec2oct\ {0,@$>}} +0 t. $C,0,0,$2,1,1 +0 t. $C,0,0,$4,1,1 +} rm[0] += -1 = -1,0,100% autocrop = 0 = 0,0,100% +l[0--2:2] { r {${-max_w}+1},100%,1,1,0,0,0.5 b $3 n 0,255 a z } +l[1--1] { r {${-max_w}+1},100%,1,1,0,0,0.5 a z } +} +w,h={-2,[w,h]} +repeat $!-2 { l[$>,-2,-1] { +luminance[0] n[0] 0,255 +nw,nh={0,round([w/$w,h/$h],1,1)} +if $> list_wh=$list_wh,$nw,$nh else list_wh=$nw,$nh fi +s[0] y,-$h s[0--3] x,-$w r[0--3] $w,$h,1,1,0,0 +repeat $!-2 { l[$>,-2,-1] { +rprogress {$>*100/($!-2)} +ri[0] [1] -[0] [1] sqr[0] r[0] 1,1,100%,1,2 y[0] +C={0,ym} rm[0] ++slices[1] $C mv. 0 +if narg("$5") +f[0] $C a[0,-1] c fi +} } +append_tiles[0--2] $nw,$nh +if narg("$5") s[0] c l[1] { +r $nw,$nh,1,1,1 +('"$1"') map[0] . k[0] +s y i[1-$!] ('\n') +a x +if $is_multi filename=${filename\ "$5",$>} else filename="$5" fi +ot $filename rm +} fi +} } +rm[-2,-1] u $list_wh +#@cli imagegrid : M>0,_N>0 +#@cli : Create MxN image grid from selected images. +#@cli : Default value: 'N=M'. +#@cli : $ image.jpg imagegrid 16 +imagegrid : skip ${2=$1} +e[^-1] "Create $1x$2 image grid from image$?." +foreach { +({w},{h}) ($1,$2) /[-2,-1] round. 1 r.. {^},..,..,2 rm. +({w},{h}) ($1,$2) *[-2,-1] r.. {^},..,..,2 rm. +$1,$2,1,.,1 shift. 1,1 ri. ..,0,2 * +} +#@cli imagegrid_hexagonal : _resolution>0,0<=_outline<=1 +#@cli : Create hexagonal grids from selected images. +#@cli : Default values: 'resolution=32', 'outline=0.1' and 'is_antialiased=1'. +#@cli : $ image.jpg imagegrid_hexagonal 24 +imagegrid_hexagonal : check "isint(${1=32}) && $1>0 && ${2=0.1}>=0 && $2<=1" +e[^-1] "Create hexagonal grid(s) from image$?, with resolution $1 and outline $2." +foreach { +l[] { +({'CImg3d'},6,6) +(0;{2*pi}) -. {pi/2} r. 1,7,1,1,3 +sin. cos.. a[-2,-1] x rows. 0,5 z. 0,2 +2,6,1,1,3,0 1,100%,1,1,y ++. 1 %. 6 rv[-2,-1] a[-3--1] x +3,100%,1,1,1 1,100%,1,1,1 y a y +*3d. {1-$2} +++3d {sqrt(3)} ++3d {sqrt(3)/2},1.5 +col3d... 2 col3d.. 3 col3d. 4 +3d +/3d 1.5 +} +ny:=1+round(0.5*$1,1,1) +nx={0,1+round($1*w/h*3/(sqrt(3)*4),1,1)} +array3d. $nx,$ny,1,{4*sqrt(3)/3},2 +c3d. *3d. {0,h/$1} +[0],[0] j3d. ..,50%,50%,0,1,2,0,0 rm.. +blend shapeaverage0 +} +#@cli imagegrid_triangular : pattern_width>=1,_pattern_height>=1,_pattern_type,0<=_outline_opacity<=1,_outline_color1,... +#@cli : Create triangular grids from selected images. +#@cli : 'pattern type' can be { 0:horizontal | 1:vertical | 2:crossed | 3:cube | 4:decreasing | 5:increasing }. +#@cli : Default values: 'pattern_width=24', 'pattern_height=pattern_width', 'pattern_type=0', 'outline_opacity=0.1' and 'outline_color1=0'. +#@cli : $ image.jpg imagegrid_triangular 6,10,3,0.5 +imagegrid_triangular : check "$1>=1 && ${2=$1}>=1 && isint(${3=0}) && $3>=0 && $3<=5" skip ${4=0},${5=0} +s0="horizontal" s1="vertical" s2="crossed" s3="cube" +e[^-1] "Create triangular grid(s) from image$?, with pattern width $1, height $2, pattern type '"${s$3}"', ""outline opacity $4 and outline color (${5--1})." +M:=max($1,$2) +if $3==4" || "$3==5 +$M,$M,1,1,x>y ++. 2 a[-2,-1] x ++. 4 a[-2,-1] y +$M,$M,1,1,"!x || !y || x==y" r. 200%,200%,1,1,0,2 +a[-2,-1] c +if $3==5 mirror. y fi +elif $3==3 +$M,$M,1,1,x>y 100%,100%,1,1,w-1-x>=y a[-2,-1] x ++. 2 mirror. y a[-2,-1] y +++. 4 =. 4,50%,50% =.. 2 a[-2,-1] x label. 0,0 +(2,2,2,0,1,2,1,1,3,3,3,1,1,0) map.. . rm. +100%,100%,1,1 +line. 0,0,{$M-1},{$M-1},1,1 line. {$M-1},$M,0,100%,1,1 +line. {$M-1},{$M-1},{3*$M-1},{$M-1},1,1 line. {2*$M},0,0,0,1,1 +line. {2*$M},0,100%,100%,1,1 line. {2*$M},100%,100%,0,1,1 +a[-2,-1] c +elif $3==2 +$M,$M,1,1,x>y ++. 2 mirror. x a[-2,-1] x ++. 4 mirror. y a[-2,-1] y +100%,100%,1,1,"!x || !y || x==int(w/2) || y==int(h/2) || x==y || w-1-x==y" +a[-2,-1] c +elif $3==1 +$M,$M,1,1,x>y 100%,100%,1,1,w-1-x<=y a[-2,-1] y ++. 2 mirror. x a[-2,-1] x +100%,100%,1,1,"!x || x==int(w/2) || x==y || w-1-x==y" +a[-2,-1] c +else +$M,$M,1,1,x>y 100%,100%,1,1,w-1-x>=y a[-2,-1] x ++. 2 mirror. y a[-2,-1] y +100%,100%,1,1,"!y || y==int(h/2) || x==y || w-1-x==y" +a[-2,-1] c +fi +repeat $!-1 { +wh={$>,[w,h]} +if $1>$2 r[$>] 100%,{$>,$1*h/$2} elif $1<$2 r[$>] {$>,$2*w/$1} fi ++r. [$>],[$>],1,2,0,2,0.5,0.5 +s. c +blend[$>,-2] shapeaverage ++fc[$>] ${5--1} j[$>] .,0,0,0,0,$4,.. rm[-2,-1] +r[$>] $wh,1,100%,2 +} +rm. +#@cli linearize_tiles : M>0,_N>0 +#@cli : Linearize MxN tiles on selected images. +#@cli : Default value: 'N=M'. +#@cli : $ image.jpg +linearize_tiles 16 +linearize_tiles : check "$1>0 && ${2=$1}>0" +e[^-1] "Linearize $1x$2 tiles on image$?." +foreach { +nm={n} +s:=s split_tiles $1,$2 s c +foreach { +wh:=w,h ++f x +f. y +f. 1 y a[^0] x solve.. . rm. +$wh,1,1,{@0}"*x + "{@1}"*y + "{@2} rm.. +} +repeat int($!/$s) { a[-$s--1] c mv. 0 } append_tiles $1,$2 => $nm +} +#@cli map_sprites : _nb_sprites>=1,_allow_rotation={ 0:none | 1:90 deg. | 2:180 deg. } +#@cli : Map set of sprites (defined as the 'nb_sprites' latest images of the selection) to other selected images, +#@cli : according to the luminosity of their pixel values. +#@cli : $ image.jpg resize2dy 48 repeat 16 ball {8+2*$>},${-rgb} mul[-1] {(1+$>)/16} done map_sprites 16 +map_sprites : check "isint($1) && $1>0 && isint(${2=0}) && $2>=0 && $2<=2" +e[^-1] "Map set of $1 sprites to image selection$?." +norm[0--{$1+1}] quantize[0--{$1+1}] $1,0,1 +slices[-$1--1] 0 r[-$1--1] ${max_wh[-$1--1]},1,100%,0,0,0.5,0.5 +if $2==1 +N:=4*$1 +repeat $!-$1 { *[$>] 4 +rand[$>] 0,3 round. +[$>,-1] } +repeat $1 { l[{1+$<}] { +mirror xy +rotate 90 } } +elif $2==2 +N:=2*$1 +repeat $!-$1 { *[$>] 2 +rand[$>] 0,1 round. +[$>,-1] } +repeat $1 { l[{1+$<}] { +mirror xy } } +else N=$1 fi +r[-$N--1] 100%,100%,1,${max_s[-$N--1]} w,h={w},{h} a[-$N--1] x +r[^-1] ${w}00%,${h}00%,1,1 *[^-1] $w +(0,{$w-1};0,{$w-1}^0,0;{$h-1},{$h-1}) r. $w,$h,1,2,3 round. +repeat $!-2 { +r. [$>],[$>],1,2,0,2 r[$>] 100%,100%,1,2,0 +[$>,-1] +warp.. [$>],0,0,1 rv[$>,-1] rm. } rm[-2,-1] +#@cli pack : is_ratio_constraint={ 0 | 1 },_sort_criterion +#@cli : Pack selected images into a single image. +#@cli : The returned status contains the list of new (x,y) offsets for each input image. +#@cli : Parameter 'is_ratio_constraint' tells if the resulting image must tend to a square image. +#@cli : Default values: 'is_ratio_constraint=0' and 'sort_criterion=max(w,h)'. +#@cli : $ image.jpg repeat 10 +resize2dx[-1] 75% balance_gamma[-1] ${-rgb} done pack 0 +pack : skip ${1=0},${2=max(w,h)} +e[^-1] "Pack image$? into a single image." +if $!<2 return fi +if ${-max_d}>1 error[0--3] "Command '$0': Selected images contain at least one volumetric image (depth>1). +Should all be 2D." fi +nm={0,n} to_colormode 0 +foreach { nm$>={n} => ${nm$>}:$> } +m "_pack : ('{n}') l. { s +,{':'} u {t} rm }" +if ['$2']=='n' sort_list +,n else sort_list -,"$2" fi +offsets${-_pack[0]}=0,0 +N=$! +i[0] 0 +do l[0,1,2] { +w1,h1,w2,h2:=w#1,h#1,w#2,h#2 +slot,min_slot_area=-1,inf +repeat h#0 { +x,y,w,h={0,crop(0,$>,4,1)} +slot_area:=$w*$h +if $w>=$w2" && "$h>=$h2" && "$slot_area<=$min_slot_area +slot,min_slot_area=$>,$slot_area +fi +} +if $slot>=0 +x,y,w,h={0,crop(0,$slot,4,1)} +j[1] [2],$x,$y offsets${-_pack[2]}=$x,$y +l[0] { +s y rm[$slot] +area1:=max(($w-$w2)*$h,$w2*($h-$h2)) +area2:=max(($w-$w2)*$h2,$w*($h-$h2)) +if $area1>=$area2 +if $w2<$w i[$slot] ({$x+$w2},$y,{$w-$w2},$h) fi +if $h2<$h i[$slot] ($x,{$y+$h2},$w2,{$h-$h2}) fi +else +if $w2<$w i[$slot] ({$x+$w2},$y,{$w-$w2},$h2) fi +if $h2<$h i[$slot] ($x,{$y+$h2},$w,{$h-$h2}) fi +fi +a y if !$! 0 fi +} +rm[2] +else +if $1 +metric_h:=abs($w1+$w2-max($h1,$h2)) +metric_v:=abs($h1+$h2-max($w1,$w2)) +else +metric_h:=$h2<$h1?$w2*($h1-$h2):$w1*($h2-$h1) +metric_v:=$w2<$w1?$h2*($w1-$w2):$h1*($w2-$w1) +fi +if $metric_h<=$metric_v +offsets${-_pack[2]}=$w1,0 +a[1,2] x,0 +if $h2<$h1 ($w1,$h2,$w2,{$h1-$h2}) a[0,-1] y +elif $h2>$h1 (0,$h1,$w1,{$h2-$h1}) a[0,-1] y +fi +else +offsets${-_pack[2]}=0,$h1 +a[1,2] y,0 +if $w2<$w1 ($w2,$h1,{$w1-$w2},$h2) a[0,-1] y +elif $w2>$w1 ($w1,0,{$w2-$w1},$h1) a[0,-1] y +fi +fi +fi +} while $!>2 +rm[0] +status= +repeat $N { if narg($status) status=$status,${offsets$>} else status=${offsets$>} fi } +=> $nm u $status +um _pack +#@cli puzzle : _width>0,_height>0,_M>=1,_N>=1,_curvature,_centering,_connectors_variability,_resolution>=1 +#@cli : Input puzzle binary mask with specified size and geometry. +#@cli : Default values: 'width=height=512', 'M=N=5', 'curvature=0.5', 'centering=0.5', 'connectors_variability=0.5' and 'resolution=64'. +#@cli : $ puzzle , +puzzle : check "isint(${1=512}) && $1>0 && isint(${2=$1}) && $2>0 && isint(${3=5}) && $3>0 && +isint(${4=$3}) && $4>0 && isint(${8=64}) && $8>0" +skip ${5=0.5},${6=0.5},${7=0.5} +e[^-1] "Draw $3x$4 puzzle pattern on image$?, with curvature $5, centering $6, connectors variability $7 +and resolution $8." +l[] { +if $4>=2 _puzzle[] $3,{$4-1},${5-8} +3d. 0,1 fi +if $3>=2 _puzzle[] $4,{$3-1},${5-8} r3d. 0,0,1,-90 +3d. 1,$4 fi +*3d {$1/$3},{$2/$4} quadrangle3d 0,0,0,{$1-1},0,0,{$1-1},{$2-1},0,0,{$2-1},0 p3d. 1 +3d col3d 1 +$1,$2 j3d. ..,0,0,0,1,1,0,0 rm.. +} +_puzzle : +R:=$6*$1 +repeat $2 { +({'CImg3d'},$R,{$R-1}) +repeat $1 { +sign:=u<=0.5?-1:1 +center:=$4*u(-0.25,0.25) +knob:=$5*u(-0.05,0.12) +($>,0;{0.2+$center+$>},{-$sign*$3*0.1};{0.4+$center+$>},0;{0.35+$center+$>},{0.1*$sign};{0.45+$center+$>},{(0.15+$knob)*$sign};{0.55+$center+$>},{(0.15+$knob)*$sign};{0.65+$center+$>},{0.1*$sign};{0.6+$center+$>},0;{0.8+$center+$>},{-$sign*$3*0.1}) +} +($1,0) a[-{$1+1}--1] y r. 2,$R,1,1,5 z. 0,2 +(2,0,1;2,{$R-2},{$R-1}) r. 3,{$R-1},1,1,3 round. +3,{h},1,1,255 1,{h},1,1,255 y[-5--1] y a[-5--1] y +3d. 0,$> +} +3d +#@cli quadratize_tiles : M>0,_N>0 +#@cli : Quadratize MxN tiles on selected images. +#@cli : Default value: 'N=M'. +#@cli : $ image.jpg +quadratize_tiles 16 +quadratize_tiles : check "$1>0 && ${2=$1}>0" +e[^-1] "Quadratize $1x$2 tiles on image$?." +foreach { +nm={n} +s:=s split_tiles $1,$2 s c +foreach { +wh:=w,h ++f x^2 +f. y^2 +f. x*y +f. x +f. y +f. 1 y a[^0] x +solve.. . rm. +$wh,1,1,{@0}"*x^2 + "{@1}"*y^2 + "{@2}"*x*y +"{@3}"*x + "{@4}"*y + "{@5} rm.. +} +repeat int($!/$s) { a[-$s--1] c mv. 0 } append_tiles $1,$2 +=> $nm +} +#@cli rotate_tiles : angle,_M>0,N>0 +#@cli : Apply MxN tiled-rotation effect on selected images. +#@cli : Default values: 'M=8' and 'N=M'. +#@cli : $ image.jpg to_rgba rotate_tiles 10,8 drop_shadow 10,10 display_rgba +rotate_tiles : skip ${2=8},${3=$2} +e[^-1] "Apply $2x$3 tiled-rotation effect on image$?, with angle $1 deg." +split_tiles $2,$3,1 rotate $1 append_tiles $2,$3 +#@cli shift_tiles : M>0,_N>0,_amplitude +#@cli : Apply MxN tiled-shift effect on selected images. +#@cli : Default values: 'N=M' and 'amplitude=20'. +#@cli : $ image.jpg +shift_tiles 8,8,10 +shift_tiles : check "${2=$1}>=0" skip ${3=20} +e[^-1] "Apply $1x$2 tiled-shift effect on image$?, with amplitude $3." +foreach { $1,$2,1,2 noise. $3 r. ..,..,1,2 warp.. .,1,1,0 rm. } +#@cli taquin : M>0,_N>0,_remove_tile={ 0:none | 1:first | 2:last | 3:random },_relief,_border_thickness[%],_border_outline[%],_outline_color +#@cli : Create MxN taquin puzzle from selected images. +#@cli : Default value: 'N=M', 'relief=50', 'border_thickness=5', 'border_outline=0' and 'remove_tile=0'. +#@cli : $ image.jpg +taquin 8 +taquin : check "isint($1) && $1>0 & isint(${2=$1}) && $2>0" +skip ${3=0},${4=50},${5=5%},${6=0},${7=0},${8=$7},${9=$8},${10=255} +e[^-1] "Create $1x$2 taquin puzzle from image$?, with relief $4, border thickness $5, border outline $6 and +outline color (${7--1})." +foreach { +nm={n} +split_tiles $1,$2 r ${-min_wh},100%,100%,0 +100%,100%,1,1,1 +if ispercentage($5) rectangle. {100*$5/2}%,{100*$5/2}%,{100-50*$5}%,{100-50*$5}%,1,0 +else rectangle. $5,$5,{w-1-$5},{h-1-$5},1,0 fi +*. '1-2*(x/w,-1] { split_opacity[0] +[0] . a[^-1] c } } rm. c 0,255 +frame $6,$6,${7-10} +if $3==3 f. 0 fi +repeat $! { mv[$>] {u($!)} } +if $3==1 f[0] 0 elif $3==2 f. 0 fi +append_tiles $1,$2 => $nm +} +#@cli tunnel : _level>=0,_factor>0,_centering_x,_centering_y,_opacity,_angle +#@cli : Apply tunnel effect on selected images. +#@cli : Default values: 'level=9', 'factor=80%', 'centering_x=centering_y=0.5', 'opacity=1' and 'angle=0' +#@cli : $ image.jpg tunnel 20 +tunnel : check "${1=9}>=0 && ${2=80%}>0" skip ${3=0.5},${4=0.5},${5=0.1},${6=0} +e[^-1] "Apply tunnel effect on image$?, with depth $1, factor $2, centering ($3,$4), opacity $5 and angle $6." +foreach { +repeat $1 { ++r. $2,$2,1,100%,5 +if $6 100%,100%,1,1,1 rotate[-2,-1] $6,1,0 erode. 3 j... ..,{({-3,w}-w)*$3},{({-3,h}-h)*$4},0,0,$5,. rm[-2,-1] +else j.. .,{({-2,w}-w)*$3},{({-2,h}-h)*$4},0,0,$5 rm. fi +} +} +c 0,255 +#@cli :: Artistic +#@cli boxfitting : _min_box_size>=1,_max_box_size>=0,_initial_density>=0,_min_spacing>0 +#@cli : Apply box fitting effect on selected images, as displayed the web page: +#@cli : . +#@cli : Default values: 'min_box_size=1', 'max_box_size=0', 'initial_density=0.25' and 'min_spacing=1'. +#@cli : $ image.jpg boxfitting , +boxfitting : check "isint(${1=3}) && $1>=1 && isint(${2=0}) && $2>=0 && ${3=0.25}>=0 && isint(${4=1}) && $4>0" +e[^-1] "Apply box fitting effect on image$?, with box sizes ($1,$2), initial density $3 and min spacing $4." +min_spacing,min_size:=$4,$1+$4-1 +foreach { +max_size:=$4-1+($2?$2:max(w,h)) +prec=5 +100%,100% +repeat inf { +if $><1 +100%,100% noise. {max(1e-3,$3)},2 ==. 1 +else ++distance. 1 +rand. 0,1 *[-2,-1] max_patch. {round($prec*$min_size)} +prec:=max(1,$prec*0.9) +fi +0 eval.. ">i && !max(crop(#-3,x-1,y-1,3,3))?(da_push([x,y,1]); i(#-3,x,y) = 1)" +if !i[h-1] rm[-2,-1] break fi +r. 1,{i[h-1]},1,3,0 rm.. +do +f. "> +begin(is_new = 0; const boundary = 1); +Xc = i0; Yc = i1; N = i2; +N>0?( +N2 = int(N/2); N1 = N - N2 - 1; +is_odd = N%2; is_new = 0; +X0 = Xc - N1 - 1; X0m1 = X0 - 1; Y0 = Yc - N1 - 1; Y0m1 = Y0 - 1; +X1 = Xc + N2 + 1; X1p1 = X1 + 1; Y1 = Yc + N2 + 1; Y1p1 = Y1 + 1; +is_up = is_down = 1; +for (X = X0, (is_up || is_down) && X<=X1, ++X, +is_up&=!i(#-2,X,Y0) && !i(#-2,X,Y0m1); +is_down&=!i(#-2,X,Y1) && !i(#-2,X,Y1p1); +); +is_left = is_right = 1; +for (Y = Y0, (is_left || is_right) && Y<=Y1, ++Y, +is_left&=!i(#-2,X0,Y) && !i(#-2,X0m1,Y); +is_right&=!i(#-2,X1,Y) && !i(#-2,X1p1,Y); +); +is_left && is_up && !i(#-2,X0m1,Y0m1)?( # Left/Up +polygon(#-2,2,X0,Y0,X1 - 1,Y0,1,1); polygon(#-2,2,X0,Y0,X0,Y1 - 1,1,1); +Xc-=is_odd; Yc-=is_odd; is_new=1; +):is_right && is_up && !i(#-2,X1p1,Y0m1)?( # Right/Up +polygon(#-2,2,X0 + 1,Y0,X1,Y0,1,1); polygon(#-2,2,X1,Y0,X1,Y1 - 1,1,1); +Xc+=!is_odd; Yc-=is_odd; is_new=1; +):is_left && is_down && !i(#-2,X0m1,Y1p1)?( # Left/Bottom +polygon(#-2,2,X0,Y1,X1 - 1,Y1,1,1); polygon(#-2,2,X0,Y1,X0,Y0 + 1,1,1); +Xc-=is_odd; Yc+=!is_odd; is_new=1; +):is_right && is_down && !i(#-2,X1p1,Y1p1)?( # Right/Bottom +polygon(#-2,2,X1,Y0 + 1,X1,Y1,1,1); polygon(#-2,2,X1,Y1,X0 + 1,Y1,1,1); +Xc+=!is_odd; Yc+=!is_odd; is_new=1; +); +is_new?(++N>=$max_size?(N = -N)):(N = -N); +); +[ Xc,Yc,N ]" +sh. 100% is_new:=iM>0 rm. +while $is_new +f. " +Xc = i0; Yc = i1; N = abs(i2); +N<$min_size?( +N2 = int(N/2); N1 = N - N2 - 1; +X0 = Xc - N1; Y0 = Yc - N1; +X1 = Xc + N2; Y1 = Yc + N2; +polygon(#-2,4,X0,Y0,X1,Y0,X1,Y1,X0,Y1,1,0); +[ -1,-1,-1 ]; +):[ Xc,Yc,N ]" +discard. -1 +if !h rm. break fi +rm. +} +if $min_spacing>1 r. {[w,h]+2},1,1,0,0,0.5,0.5 erode. {$min_spacing} z. 1,1,{[w,h]-2} fi +blend shapeaverage0 +} +#@cli brushify : [brush],_brush_nb_sizes>=1,0<=_brush_min_size_factor<=1,_brush_nb_orientations>=1,_brush_light_type,0<=_brush_light_strength<=1,_brush_opacity,_painting_density[%]>=0,0<=_painting_contours_coherence<=1,0<=_painting_orientation_coherence<=1,_painting_coherence_alpha[%]>=0,_painting_coherence_sigma[%]>=0,_painting_primary_angle,0<=_painting_angle_dispersion<=1 +#@cli : Apply specified brush to create painterly versions of specified images. +#@cli : 'brush_light_type' can be { 0:none | 1:flat | 2:darken | 3:lighten | 4:full }. +#@cli : Default values: 'brush_nb_sizes=3', 'brush_min_size_factor=0.66', 'brush_nb_orientations=12', 'brush_light_type=0', 'brush_light_strength=0.25', 'brush_opacity=0.8', 'painting_density=20%', 'painting_contours_coherence=0.9', 'painting_orientation_coherence=0.9', 'painting_coherence_alpha=1', 'painting_coherence_sigma=1', 'painting_primary_angle=0', 'painting_angle_dispersion=0.2' +#@cli : $ image.jpg 40,40 gaussian[-1] 10,4 spread[-1] 10,0 brushify[0] [1],1 +brushify : check ${"is_image_arg $1"}" &&"\ +"isint(${2=4}) && $2>=1 &&"\ +"${3=0.25}>=0 && $3<=1 &&"\ +"isint(${4=12}) && $4>=1 &&"\ +"isint(${5=4}) && $5>=0 &&"\ +"${6=0.07}>=0 && $6<=1 &&"\ +"isnum(${7=0.75}) &&"\ +"${8=40%}>=0 && $8>=0 &&"\ +"${9=0.7}>=0 && $9<=1 &&"\ +"${10=1}>=0 && $10<=1 &&"\ +"${11=1}>=0 && ${12=0.5%}>=0 &&"\ +"isnum(${13=45}) &&"\ +"${14=0.2}>=0 && $14<=1" +e[^-1] "Brushify image$?, with brush $1." +pass$1 0 l. { +slices 0 max 1e-8 norm n 0,1 threshold 0.1,1 autocrop. +repeat $4 { +rotate[0] {360*$>/$4} } +rm[0] n 0,1 threshold 0.1,1 +autocrop r ${-max_wh},1,1,0,0,0.5,0.5 +a z => brush +wb,hb,whb={w},{h},{wh} ls:=255*$6 +if !$5 +f. 0 +elif $5==1 +n. -$ls,0 +elif $5==2 +g xy +[-2,-1] min. 0 n. -$ls,0 +elif $5==3 +g xy +[-2,-1] max. 0 n. 0,$ls +else +g xy +[-2,-1] n. -$ls,$ls +fi +=> brushlight +repeat $2-1 { +ratio={v=(1+$>)/max(1,$2-1);100*((1-v)+$3*v)}% ++r[brush,brushlight] $ratio,$ratio,100%,1,2 +ri[-2,-1] [brush],0,0,0.5,0.5 +} +a[0--1:2] z a[^0] z +} +repeat $!-2 { l[$>,brush,brushlight] { +s={0,s} nm={0,n} to_rgb[0] =>[0] img ++diffusiontensors[img] $9,$10,$11,$12 => geometry ++channels[geometry] 0 sh[geometry] 2 +[-2,-1] ^. 0.3 quantize. $2,0 *. -1 +. $2 -. 1 => contours +1,{img,max(1,ispercentage($8)?wh*$8:$8)} rand. 0,{img,w-1} +rand. 0,{img,h-1} a[-2,-1] c => pts ++to_rgba[img] => res +f[pts] "* +begin( +S2 = round(0.5*["$wb","$hb"]); +brush_r = brush_g = brush_b = brush_a = vector"$whb"(255); +ang = $13*pi/180; +cu = [ cos(ang),sin(ang) ]; +cv = [ -cu[1],cu[0] ]; +T = mul(cu,cu,2) + $14*mul(cv,cv,2); +); +P = I; +G = I(#"$geometry",P); +ang = u(pi); +V = [ G[0],G[1],G[1],G[2] ]*(T*[ cos(ang),sin(ang) ]); +amp = i(#"$contours",P); #cut($2-round(5*$2*sqrt(G[0] + G[2])),0,$2-1); +ang = round(((atan2(V[1],V[0])%(2*pi))*$4/(2*pi)))%$4; +col = I(#"$img",P); +ind = amp*$4 + ang; +brush = crop(#"$brush",0,0,ind,0,"$wb","$hb",1,1); +brushlight = crop(#"$brushlight",0,0,ind,0,"$wb","$hb",1,1); +brush_r = cut(col[0] + brushlight,0,255); +brush_g = cut(col[1] + brushlight,0,255); +brush_b = cut(col[2] + brushlight,0,255); +PmS2 = P - S2; +draw(#"$res",[brush_r,brush_g,brush_b,brush_a],PmS2[0],PmS2[1],0,0,"$wb","$hb",1,4,$7,brush,1); +P" +k[res,brush,brushlight] mv[res] 0 =>[0] $nm to_colormode[0] {$s+($s%2)} +} } rm[brush,brushlight] +#@cli cartoon : _smoothness,_sharpening,_threshold>=0,_thickness>=0,_color>=0,quantization>0 +#@cli : Apply cartoon effect on selected images. +#@cli : Default values: 'smoothness=3', 'sharpening=150', 'threshold=20', 'thickness=0.25', 'color=1.5' and 'quantization=8'. +#@cli : $ image.jpg cartoon 3,50,10,0.25,3,16 +cartoon : skip ${1=3},${2=150},${3=15},${4=0.25},${5=1.5},${6=8} +e[^-1] "Apply cartoon effect on image$?, with smoothness $1, sharpening $2, threshold $3, thickness $4, color $5 +and quantization $6." +foreach { +split_opacity +l[0] { +to_rgb +b $1 sharpen $2,1 c 0,255 n 0,255 +if $4 +edges $3 b. $4 >=. 0.9 else 100%,100%,1,1,1 fi +rgb2lab.. s.. c *[-3,-2] $5 a[-4--2] c lab2rgb.. +quantize.. $6,1,-1 +n.. 0,255 * +} +a c +} +#@cli color_ellipses : _count>0,_radius>=0,_opacity>=0 +#@cli : Add random color ellipses to selected images. +#@cli : Default values: 'count=400', 'radius=5' and 'opacity=0.1'. +#@cli : $ image.jpg +color_ellipses ,,0.15 +color_ellipses : skip ${1=1400},${2=5},${3=0.1} +e[^-1] "Add $1 random color ellipses to image$?, with maximum radius $2 and opacity $1." +repeat $1 { +ellipse {u(0,100)}%,{u(0,100)}%,{u(0,$2)}%,{u(0,$2)}%,{u(0,360)},$3,{u(60,255)},{u(60,255)},{u(60,255)},255 +} +#@cli cubism : _density>=0,0<=_thickness<=50,_max_angle,_opacity,_smoothness>=0 +#@cli : Apply cubism effect on selected images. +#@cli : Default values: 'density=50', 'thickness=10', 'max_angle=75', 'opacity=0.7' and 'smoothness=0'. +#@cli : $ image.jpg cubism , +cubism : check "${1=50}>=0 && ${2=10}>=0 && $2<=50 && ${5=0}>=0" skip ${3=75},${4=0.7} +e[^-1] "Apply cubism effect on image$?, with density $1, thickness $2, maximum angle $3 deg., opacity $4 and +smoothness $5." +if "!$1 || !$2 || !$3 || !$4" return fi +foreach { +w,h,s={w},{h},{s} +P:=round($2*max(w,h)/200) +N:=round(1.5*$1*w*h/(4*$P)/100) +('CImg3d') +. 0.5 ({4*$N};$N) +1,$N rand. $P,{$w-1-$P} +rand. $P,{$h-1-$P} a[-2,-1] x round. +++. '-$P,-$P' ++.. '$P,-$P' ++... '$P,$P' ++[-4] '-$P,$P' +a[-4--1] x i.. (12,0,1,2,3;12,{4*($N-1)},{4*($N-1)+1},{4*($N-1)+2},{4*($N-1)+3}) +r.. 5,$N,1,1,3 round.. 1 a[-2,-1] x +1,$N rand. {225-$3},{225+$3} *. {pi/180} ++sin. cos.. +*. -1 ... a[-4--3] x a[-2,-1] x z[-4,-2,-1] 0,2 +*[-2,-1] -1 a[-4--1] x *. {sqrt(2)*$P} +r... 400%,100%,1,1,0,2 +[-3,-1] +(-128;$w;$h;$s) +b[0] $5 +if $N>1 4,{$N-1},1,1,-128,0,0,0 fi +1,$N,1,1,1 +y[1--1] a[1--1] y rv3d. +if $4>=1 j3d[0] [1],0,0,0,1,2,0,0 rm[1] +else +j3d[0] [1],0,0,0,1,2,0,0 rm[1] blend alpha,$4 +fi +} +#@cli draw_whirl : _amplitude>=0 +#@cli : Apply whirl drawing effect on selected images. +#@cli : Default value: 'amplitude=100'. +#@cli : $ image.jpg draw_whirl , +draw_whirl : skip ${1=100} +e[^-1] "Apply whirl drawing effect on image$? with amplitude $1." +foreach { +100%,100% noise. 70,2 ==. 1 *. 255 ri. .. &[-1,-2] smooth. $1,0,1,2,2 +sqrt. n. 0,255 equalize. +} +#@cli drawing : _amplitude>=0 +#@cli : Apply drawing effect on selected images. +#@cli : Default value: 'amplitude=200'. +#@cli : $ image.jpg +drawing , +drawing : skip ${1=200} +e[^-1] "Apply drawing effect on image$? with amplitude $1." +foreach { +split_opacity +l[0] { +to_rgb +smooth $1,0.2,1,3,3 b 2 sharpen 1000 [0] +r[0] 20,20,1,3,2 equalize[0] index[1] [0],1,1 +=> {0,n} rm[0] +} +a c +} +#@cli drop_shadow : _offset_x[%],_offset_y[%],_smoothness[%]>=0,_curvature_x,_curvature_y,_expand_size={ 0 | 1 } +#@cli : Drop shadow behind selected images. +#@cli : Default values: 'offset_x=20', 'offset_y=offset_x', 'smoothness=5', 'curvature=0' and 'expand_size=1'. +#@cli : $ image.jpg drop_shadow 10,20,5,0.5 expand_xy 20,0 display_rgba +#@cli drop_shadow : _offset_x[%],_offset_y[%],_smoothness[%]>=0,curvature_x>=0,curvature_y>=0,_expand_size={ 0 | 1 },_output_separate_layers={ 0 | 1 } +#@cli : Drop shadow behind selected images. +#@cli : Default values: 'offset_x=20', 'offset_y=offset_x', 'smoothness=5', 'curvature_x=curvature_y=0', 'expand_size=1' and 'output_separate_layers=0'. +#@cli : $ image.jpg drop_shadow 10,20,5,0.5 display_rgba +drop_shadow : check "isexpr(${1=20}) && isexpr(${2=$1}) && ${3=5}>=0 && isnum(${4=0}) && isnum(${5=0}) && ""isbool(${6=1}) && isbool(${7=0})" +s0,s1,t0,t1=original,expanded,single,separate +e[^-1] "Drop shadow behind image$?, with offsets ($1,$2), smoothness $3, curvatures ($4,$5) "${s$6}" size and "${t$7}" layer output." +foreach { +nm={n} +if s>4 error[0--3] "Command 'drop_shadow': Invalid input image (has "{s}" channels)." fi +to_a +shiftx,shifty:=round([ispercentage($1)?$1*w:$1,ispercentage($2)?$2*h:$2]) +sigma:=ispercentage($3)?max(w,h)*$3:$3 ++channels. 100% ge. 50% label_fg. 0,1 +1,{iM},1,4,[inf,inf,-inf,-inf] +eval.. "> +ind = i; +ind?( +--ind; +xi(#-1,0,ind,0,2)?(i(#-1,0,ind,0,2) = x); +y>i(#-1,0,ind,0,3)?(i(#-1,0,ind,0,3) = y); +)" +if $6 +s. c x0,y0,x1,y1:=im#-4,im#-3,iM#-2,iM#-1 a[-4--1] c +nx0,ny0,nx1,ny1=$x0,$y0,$x1,$y1 +nx0,nx1+=$shiftx +ny0,ny1+=$shifty +if $sigma>0 nx0,ny0,nx1,ny1+="const S = 3.5*$sigma; [-S,-S,S,S]" fi +if $4 nx0,nx1+="const S = $shiftx*$4; S>0?[-S,0]:[0,-S]" fi +if $5 ny0,ny1+="const S = $shifty*$5; S>0?[-S,0]:[0,-S]" fi +nx0,ny0,nx1,ny1={0,round([min($nx0,0),min($ny0,0),max($nx1,w-1),max($ny1,h-1)])} +z[0,1] $nx0,$ny0,$nx1,$ny1 ++[2] '"const dx = -$nx0; const dy = -$ny0; [dx,dy,dx,dy]"' +fi +[0],[0] +repeat h#2 { +x0,y0,x1,y1:=I[#2,$>] +w,h:=$x1-$x0,$y1-$y0 +if w" && "h +nx0,ny0,nx1,ny1=$x0,$y0,$x1,$y1 +if $4 nx0,nx1+="const S = $shiftx*$4; S>0?[-S,0]:[0,-S]" fi +if $5 ny0,ny1+="const S = $shifty*$5; S>0?[-S,0]:[0,-S]" fi +nx0,ny0,nx1,ny1:=round([$nx0,$ny0,$nx1,$ny1]) ++z[0,1] $nx0,$ny0,0,100%,$nx1,$ny1,0,100% ==. {$>+1} *[-2,-1] +if $4" || "$5 +100%,100%,1,2," +X = lerp($nx0,$nx1,x/(w-1)); +Y = lerp($ny0,$ny1,y/(h-1)); +ampx = sin((Y-$y0)/($h - 1)*pi); +ampy = sin((X-$x0)/($w - 1)*pi); +[ -$shiftx*abs($4)*($4>0?ampx:(1 - ampx)), +-$shifty*abs($5)*($5>0?ampy:(1 - ampy))]" +warp.. .,1,1,0 rm. +fi +sx0,sy0,sx1,sy1:=$nx0+$shiftx,$ny0+$shifty,$nx1+$shiftx,$ny1+$shifty ++z[3] $sx0,$sy0,$sx1,$sy1 max[-2,-1] +j[3] .,$sx0,$sy0 rm. +fi +} +rm[1,2] +b. $sigma,0 +channels. -1,0 +rv +if !$7 blend alpha fi +=>[^] $nm +} +#@cli ellipsionism : _R>0[%],_r>0[%],_smoothness>=0[%],_opacity,_outline>0,_density>0 +#@cli : Apply ellipsionism filter to selected images. +#@cli : Default values: 'R=10', 'r=3', 'smoothness=1%', 'opacity=0.7', 'outline=8' and 'density=0.6'. +#@cli : $ image.jpg ellipsionism , +ellipsionism : check "${1=10}>0 && ${2=3}>0 && ${5=8}>0 && ${6=0.6}>0" skip ${3=1%},${4=0.7} +e[^-1] "Apply ellipsionism filter to image$?, with radii ($1,$2), smoothness $3, opacity $4 and outline $5." +foreach { +to_color ++luminance g. xy a[-2,-1] c b. $3 orientation. +sh. 0 sh.. 1 atan2. .. *. {180/pi} +. 90 rm[-2,-1] channels. 1,1 +100%,100%,1,4 +eval " +const interpolation = 1; +const N = $6*wh/max($1,$2); +repeat (N,n, +x = round(u(w-1)); y = round(u(h-1)); +ellipse(x,y,$1,$2,i(#-2,x,y)°,$4,I(#0,x,y),255); +ellipse(x,y,-$1,-$2,i(#-2,x,y)°,$4,0xFFFFFFFF,I(#0,x,y)/$5,255); +)" +rm.. blend alpha +} +#@cli fire_edges : _edges>=0,0<=_attenuation<=1,_smoothness>=0,_threshold>=0,_nb_frames>0,_starting_frame>=0,frame_skip>=0 +#@cli : Generate fire effect from edges of selected images. +#@cli : Default values: 'edges=0.7', 'attenuation=0.25', 'smoothness=0.5', 'threshold=25', 'nb_frames=1', 'starting_frame=20' and 'frame_skip=0'. +#@cli : $ image.jpg fire_edges , +fire_edges : check "${1=0.7}>=0 && ${2=0.25}>=0 && $2<=1 && ${3=0.5}>=0 && ${4=25}>=0 && ${5=1}>0 && +${6=20}>=0 && ${7=0}>=0" +e[^-1] "Generate fire effect from edges of image$?, with edges $1, attenuation $2, smoothness $3, threshold $4, +$5 frames, starting frame $6 and frame skip $7." +foreach { +nm={n} +norm +gradient_norm n. 0,1 roundify. $1 f[0] 0 +(0,0,0;0,0,0;1,1,1;0,1,0) *. {(1-$2^4)/4} +repeat $5*(1+$7)+$6 { +{0,w},{0,h} rand. 0,255 *. [1] +b. $3 +if $4 >=. $4% else equalize. fi +n. 0,255 +j[0] .,0,0,0,0,1,[1],1 rm. +correlate[0] [2] +if $>>=$6" && "!(($>-$6)%($7+1)) [0] fi +} +rm[0-2] =>[^] $nm +} +(0,255,255,255,255^0,0,255,255,255^0,0,0,128,255) r. 256,1,1,3,3 +map[^-1] . rm. +#@cli fractalize : 0<=detail_level<=1 +#@cli : Randomly fractalize selected images. +#@cli : Default value: 'detail_level=0.8' +#@cli : $ image.jpg fractalize , +fractalize : check "${1=0.8}>=0 && $1<=1" +e[^-1] "Randomly fractalize image$?, with detail level $1." +xc=0.4433 +yc=0.2645 +delta=0.1 +c0r=0.317 +c0i=0.03 +foreach { +nm={n} +luminance equalize 256 b 0.25% n 0,255 +100%,100% +dx:=$delta*w/max(w,h) +dy:=$delta*h/max(w,h) +x0:=$xc-$dx/2 +y0:=$yc-$dy/2 +x1:=$xc+$dx/2 +y1:=$yc+$dy/2 +mandelbrot. $x0,$y0,$x1,$y1,256,1,$c0r,$c0i ++==. 0 inpaint.. . rm. +n. 0,256 +16,1,1,3 rand. 0,255 r. 256,1,1,3,3 map.. . rm. +s. c +i[2,3] [0] +s:=0.1*(1-$1) +parallel "register_nonrigid[1] [0],"$s",5","register_nonrigid[3] [2],"$s",5","register_nonrigid[5] [4],"$s",5" +rm[0,2,4] a c => $nm +} +#@cli glow : _amplitude>=0 +#@cli : Add soft glow on selected images. +#@cli : Default value: 'amplitude=1%'. +#@cli : $ image.jpg glow , +glow : skip ${1=1%} +e[^-1] "Add soft glow on image$?, with amplitude $1." +foreach { split_opacity +b[0] $1 n. [0] blend_edges[0,-1] 1 a c } +#@cli halftone : nb_levels>=2,_size_dark>=2,_size_bright>=2,_shape={ 0:square | 1:diamond | 2:circle | 3:inv-square | 4:inv-diamond | 5:inv-circle },_smoothness[%]>=0 +#@cli : Apply halftone dithering to selected images. +#@cli : Default values: 'nb_levels=5', 'size_dark=8', 'size_bright=8', 'shape=5' and 'smoothnesss=0'. +#@cli : $ image.jpg halftone , +halftone : check "${1=5}>=2 && ${2=8}>=2 && ${3=8}>=2 && ${5=0}>=0" skip ${4=5} +s0="square" s1="diamond" s2="circle" s3="inv-square" s4="inv-diamond" s5="inv-circle" +e[^-1] "Apply halftone dithering to image$?, with $1 levels, dark size $3, bright size $4, "${s$4}" shape and smoothness $5." +foreach { +s c +foreach { +(0,255) a y quantize $1,0 rows 0,{h-2} +repeat $1 { +s:=round(($2*$<+$3*$>)/($1-1)) +$s,$s =. 1,50%,50% distance. 1,{$4%3} +shift. {round(w/2)},{round(h/2)},0,0,2 min[-2,-1] +if $4>=3 <. {100*$} +else <. {100*$>/($1-1.1)}% *. 255 -. $> +fi +ri. ..,0,2 b. $5 +==.. $> *[-2,-1] +[-2,-1] +} +} +a c +} +#@cli hardsketchbw : _amplitude>=0,_density>=0,_opacity,0<=_edge_threshold<=100,_is_fast={ 0 | 1 } +#@cli : Apply hard B&W sketch effect on selected images. +#@cli : Default values: 'amplitude=1000', 'sampling=3', 'opacity=0.1', 'edge_threshold=20' and 'is_fast=0'. +#@cli : $ image.jpg +hardsketchbw 200,70,0.1,10 median[-1] 2 +local reverse blur[-1] 3 blend[-2,-1] overlay done +hardsketchbw : skip ${1=300},${2=50},${3=0.1},${4=20},${5=0} +e[^-1] "Apply hard B&W sketch effect on image$?, with amplitude $1, density $2, opacity $3 and edge threshold $4." +if !$2 channels 0 f 255 return fi +luminance n 0,1 +if $5 +foreach { +nm={n} +g xy rv *.. -1 a c +if $4 +norm >=. $4% * fi +100%,100%,1,1,255 quiver. ..,{max(1,10-$2/6)},$1,0,$3 rm.. => $nm +} +else +foreach { +nm={n} +w,h={w},{h} g xy rv *.. -1 a c * $1 ++norm >=. $4% 100%,100% noise. $2,2 ==. 1 *[-2,-1] +pointcloud3d. +if i[-1,2] +s3d. rm[-6--5,-3--1] r. 3,{h/3},1,1,-1 s. x rm. a[-2,-1] c +warp.. .,0,0,1 +-. .. +[-3,-2] s[-2,-1] c +i... 1,{h} 1,{h} a[-6--1] x +i.. ('CImg3d') i.. ({2*h},{h}) +1,{h},1,1,2 1,{h},1,1,2*y ++. 1 a[-3--1] x +3,{h} 1,{h},1,1,$3 y[-6--1] a[-6--1] y +$w,$h,1,1,255 j3d. ..,0,0,0,1,1,0,0 rm.. +else +rm $w,$h,1,1,255 +fi +=> $nm +} +fi +#@cli hearts : _density>=0 +#@cli : Apply heart effect on selected images. +#@cli : Default value: 'density=10'. +#@cli : $ image.jpg hearts , +hearts : skip ${1=10} +e[^-1] "Apply heart filter on image$?, with density $1." +foreach { +100%,100%,1 noise. $1,2 ==. 1 ri. .. n. 0,1 *[-1,-2] _heart9x7 +dilate.. . rm. +} +_heart9x7 : +(9,7,1,1,0,1,-1,2,-3,2,-1,4,-1,13,-1,7,-3,5,-5,3,-7,1,-4) +decompress_rle. +#@cli houghsketchbw : _density>=0,_radius>0,0<=_threshold<=100,0<=_opacity<=1,_votesize[%]>0 +#@cli : Apply hough B&W sketch effect on selected images. +#@cli : Default values: 'density=100', 'radius=3', 'threshold=100', 'opacity=0.1' and 'votesize=100%'. +#@cli : $ image.jpg +houghsketchbw , +houghsketchbw : check "${1=100}>=0 && ${2=3}>=0 && ${3=100}>=0 && $3<=100 && ${4=0.1}>=0 && $4<=1 && ${5=100%}>0" +e[^-1] "Apply hough B&W sketch effect on image$?, with density $1, radius $2, threshold $3, opacity $4 +and votesize $5." +luminance +foreach { +nm={n} +res:=round(ispercentage($5)?$5*max(w,h):$5) w,h={w},{h} rhomax:=sqrt(w^2+h^2)/2 +hough $res,$res +normalize_local. $1,$2 >. $3% +if !iM continue fi +pointcloud3d. s3d. rm[-6--5,-3--1] r. 3,{h/3},1,1,-1 columns. 0,1 +s. x,2 +*.. {2*pi/$res} +*. {$rhomax/$res} ++cos.. *. .. +. {$w/2} ++sin... *. ... +. {$h/2} +rm... +i... ... +cos[-4] sin... *[-4,-3] 10000 +++.. ... ++-.. [-5] +-[-4] [-5] ++... [-6] +rm[-6,-5] +i... 1,{h} 1,{h} a[-6--1] x +i.. ('CImg3d') i.. ({2*h},{h}) +1,{h},1,1,2 1,{h},1,1,2*y ++. 1 a[-3--1] x +3,{h},1,1,0 1,{h},1,1,$4 +y[-6--1] a[-6--1] y +$w,$h,1,1,255 j3d. ..,0,0,0,1,1,0,0 rm.. => $nm +} +#@cli lightrays : 100<=_density<=0,_center_x[%],_center_y[%],_ray_length>=0,_ray_attenuation>=0 +#@cli : Generate ray lights from the edges of selected images. +#@cli : Default values: 'density=50%', 'center_x=50%', 'center_y=50%', 'ray_length=0.9' and 'ray_attenuation=0.5'. +#@cli : $ image.jpg +lightrays , + cut 0,255 +lightrays : check "${1=50}>=0 && $1<=100 && ${4=1}>=0 && ${5=1}>=0" skip ${2=50%},${3=50%} +e[^-1] "Generate ray lights from image$?, with density $1, center point ($2,$3), ray length $4 and attenuation $5." +foreach { +gradient_norm >= $1% euclidean2polar $2,$3 +repeat log2(w) { +shift. {2^$>} +[-2,-1] } +function1d 0.5,0,1,{$4*w},1,{1+($4+1-$5)*w},0 r. {-2,w},1,1,1,0 +(1,{w}) r. {-2,w},1,1,1,3 /[-2,-1] +ri. .. *[-2,-1] polar2euclidean $2,$3 n 0,255 +} +#@cli light_relief : _ambient_light,_specular_lightness,_specular_size,_darkness,_light_smoothness,_xl,_yl,_zl,_zscale,_opacity_is_heightmap={ 0 | 1 } +#@cli : Apply relief light to selected images. +#@cli : Default values(s) : 'ambient_light=0.3', 'specular_lightness=0.5', 'specular_size=0.2', 'darkness=0', 'xl=0.2', 'yl=zl=0.5', +#@cli : 'zscale=1', 'opacity=1' and 'opacity_is_heightmap=0'. +#@cli : $ image.jpg blur 2 light_relief 0.3,4,0.1,0 +light_relief : skip ${1=0.3},${2=0.5},${3=0.2},${4=0},${5=0.2},${6=0.5},${7=0.5},${8=1},${9=1},${10=0} +e[^-1] "Apply relief light to image$?." +foreach { +({-$6},{1-$6};{-$6},{1-$6}^{-$7},{-$7};{1-$7},{1-$7}^$8,$8;$8,$8) r. ..,..,1,3,3 +if $10 +channels.. 3 to_rgb... else +to_rgb.. norm. fi +b. $5% g. xy 100%,100%,1,1,$9 a[-3--1] c +orientation[-2,-1] *[-2,-1] s. c +[-3--1] +100%,100% =. 1,{$6*100}%,{$7*100}% distance. 1 sqr. *. -1 +/. {($3*max(w,h))^2} exp. *. $2 +. $1 +*[-2,-1] -. $4 *. {-2,iM} +split_opacity[0] +[0,-1] a c c 0,255 +} +#@cli linify : 0<=_density<=100,_spreading>=0,_resolution[%]>0,_line_opacity>=0,_line_precision>0,_mode={ 0:subtractive | 1:additive } +#@cli : Apply linify effect on selected images. +#@cli : The algorithm is inspired from the one described on the webpage . +#@cli : Default values: 'density=50', 'spreading=2', 'resolution=40%', 'line_opacity=10', 'line_precision=24' and 'mode=0'. +#@cli : $ image.jpg linify 60 +linify : check "${1=40}>=0 && $1<=100 && ${2=2}>=0 && ${3=40%}>0 && ${4=10}>=0 && isint(${5=24}) && $5>0 && +isbool(${6=0})" +e[^-1] "Apply linify effect on image$?, with density $1, spreading $2, resolution $3, line opacity $4, +line precision $5 and "${"arg0 $6,subtractive,additive"}" mode." +foreach { +remove_opacity nm={n} +100%,100%,1,{s},$6?0:255 +if {0,w>h} r2dx[0] {ispercentage($3)?max(1,$3*w):min(w,$3)} +else r2dy[0] {ispercentage($3)?max(1,$3*h):min(h,$3)} +fi +n[0] 0,100 +if narg($_debug)" && "!{*,w} w[] ${-fitscreen[]\ {1,[w,h]}} fi +eval " +is_in(ind,P) = (P[0]>=0 && P[0]=0 && P[1]best_avg):(avgdensity):(ref $nm +} +#@cli mosaic : 0<=_density<=100 +#@cli : Create random mosaic from selected images. +#@cli : Default values: 'density=30'. +#@cli : $ image.jpg mosaic , +fill "I!=J(1) || I!=J(0,1)?[0,0,0]:I" +mosaic : check "${1=30}>=0" +e[^-1] "Apply mosaic effect on image$?, with density $1." +foreach { +100%,100%,1,2,'u<0.25*($1%)^4?[u,1]' s. c +distance. 1 *. -1 watershed.. . rm. +blend shapeaverage +} +#@cli old_photo +#@cli : Apply old photo effect on selected images. +#@cli : $ image.jpg old_photo +old_photo : +e[^-1] "Apply old photo effect on image$?." +noise 20 bilateral 30,60 b 2 sharpen 100 frame_fuzzy 8%,8%,6,3 to_rgb shadow_patch 0.75 n 0,255 sepia +#@cli pencilbw : _size>=0,_amplitude>=0 +#@cli : Apply B&W pencil effect on selected images. +#@cli : Default values: 'size=0.3' and 'amplitude=60'. +#@cli : $ image.jpg pencilbw , +pencilbw : skip ${1=0.3},${2=60} +e[^-1] "Apply B&W pencil effect on image$?, with size $1 and amplitude $2." +foreach { +split_opacity l[0] { norm b $1 sharpen 4000 smooth $2,0,1 equalize sqrt n 0,255 } +a c +} +#@cli pixelsort : _ordering={ + | - },_axis={ x | y | z | xy | yx },_[sorting_criterion],_[mask] +#@cli : Apply a 'pixel sorting' algorithm on selected images, as described in the page : +#@cli : . +#@cli : Default values: 'ordering=+', 'axis=x' and 'sorting_criterion=mask=(undefined)'. +#@cli : $ image.jpg +norm +ge[-1] 30% +pixelsort[0] +,y,[1],[2] +pixelsort : check "(str1=['${1=+}']; isin(str1,'+','-')) && ""(str2=['${2=x}']; isin(str2,'x','y','z','xy','yx')) && ""(['${3=}']==0 || "${"is_image_arg $3"}") && ""(['${4=}']==0 || "${"is_image_arg $4"}")" +s0="descending" s1="ascending" +if ['$3']!=0" && "['$4']!=0 +e[^-1] "Apply 'pixelsort' effect to image$? in "${s{['$1']=='+'}}" order, along axis $2, +with sorting criterion $3 and mask $4." +elif ['$3']!=0" && "['$4']==0 +e[^-1] "Apply 'pixelsort' effect to image$? in "${s{['$1']=='+'}}" order, along axis $2, +with sorting criterion $3." +elif ['$3']==0" && "['$4']!=0 +e[^-1] "Apply 'pixelsort' effect to image$? in "${s{['$1']=='+'}}" order, along axis $2, +with mask $4." +else +e[^-1] "Apply 'pixelsort' effect to image$? in "${s{['$1']=='+'}}" order, along axis $2." +fi +repeat $! { +if ['$3']!=0 pass$3 0 else +compose_channels[$>] + fi +if [w#1,h#1,d#1,s#1]!=[w#0,h#0,d#0,1] +error[0--4] "Command 'pixelsort': Invalid specified sorting criterion (size=("{1,[w,h,d,s]}")) for image ["$>"] ""(size=("{0,[w,h,d,s]}"))." +fi +if ['$4']!=0 pass$4 0 else [$>],[$>],[$>],1,1 fi +if [w#2,h#2,d#2,s#2]!=[w#0,h#0,d#0,1] +error[0--4] "Command 'pixelsort': Invalid specified mask (size=("{1,[w,h,d,s]}")) for image ["$>"] ""(size=("{0,[w,h,d,s]}"))." +fi +l[$>,-2,-1] { +nm={0,n} >=. 50% mv.. 0 a c +if ['$2']=='x'; +_pixelsort $1 +elif ['$2']=='y'; +permute yxzc _pixelsort $1 permute yxzc +elif ['$2']=='z'; +permute zxyc _pixelsort $1 permute yzxc +elif ['$2']=='xy'; +_pixelsort $1 permute yxzc _pixelsort $1 permute yxzc +elif ['$2']=='yx'; +permute yxzc _pixelsort $1 permute yxzc _pixelsort $1 +fi +channels 1,{s-2} => $nm +} +} +_pixelsort : +s. c,-{s-1} N={-2,s} permute.. cxyz r.. {-2,[w*h,d,s,1]},-1 +sort:=;_'$1'==_'+'; +eval. "*begin(ret = 0; V = vector(#w#0); const N = $N); +i && !j(-1)?( +for (xe = x + 1, i(xe,y,z) && xex?(dx = xe - x + 1; Ndx = N*dx; Nx = N*x; copy(V,i(#0,Nx),Ndx); copy(i(#0,Nx),sort(V,$sort,dx,N),Ndx)); +);" +r.. {-2,[$N,w/$N,h,d]},-1 permute.. yzcx a c +#@cli polaroid : _size1>=0,_size2>=0 +#@cli : Create polaroid effect in selected images. +#@cli : Default values: 'size1=10' and 'size2=20'. +#@cli : $ image.jpg to_rgba polaroid 5,30 rotate 20 drop_shadow , drgba +polaroid : check "${1=10}>=0 && ${2=20}>=0" +e[^-1] "Create polaroid effect in image$?, with borders sizes $1 and $2." +- 255 r {100+$1}%,{100+$1}%,1,100%,0,0,0.5,0.5 r 100%,{100+$2}%,1,100%,0,0,0 + 255 +#@cli polygonize : _warp_amplitude>=0,_smoothness[%]>=0,_min_area[%]>=0,_resolution_x[%]>0,_resolution_y[%]>0 +#@cli : Apply polygon effect on selected images. +#@cli : Default values: 'warp_amplitude=300', 'smoothness=2%', 'min_area=0.1%', 'resolution_x=resolution_y=10%'. +#@cli : $ image.jpg image.jpg polygonize 100,10 +fill "I!=J(1) || I!=J(0,1)?[0,0,0]:I" +polygonize : check "${1=300}>=0 && ${2=2%}>=0 && ${3=0.1%}>=0 && ${4=10%}>0 && ${5=$4}>0" +e[^-1] "Polygonize image$? with warp amplitude $1, smoothness $2, minimal area $3 and resolutions ($4,$5)." +foreach { ++b $2 gradient_norm. g. a[-2,-1] c channels. 0,2 *. {1/0.1+max(abs(im),abs(iM))} +resx:=max(1,round(ispercentage($4)?w*$4:w/$4)-1) +resy:=max(1,round(ispercentage($5)?h*$5,h/$5)-1) +plane3d 1,1,$resx,$resy *3d. {0,w-1},{0,h-1},1 +s3d. rm.. i.. (0;{h-1}) r.. 3,{h},1,1,3 round.. y.. +[-4] a[-7--2] y r. 3,{h/3},1,1,-1 z. 0,1 permute. yzcx +repeat $1 { +warp[1] .,0,0,1 +[-2,-1] } +permute. cxyz z. 0,2 y. j[2] .,0,8 rm[-3,-1] +[0],[0] j3d. [1],0,0,0,1,2 rm[1] +if $3>0 +min_area={0,ispercentage($3)?$3*w*h:$3} ++area. 0,1 >=. $min_area +.. 1 *.. . distance. 1 *. -1 watershed.. . rm. +fi +blend shapeaverage +} +#@cli poster_edges : 0<=_edge_threshold<=100,0<=_edge_shade<=100,_edge_thickness>=0,_edge_antialiasing>=0,0<=_posterization_level<=15,_posterization_antialiasing>=0 +#@cli : Apply poster edges effect on selected images. +#@cli : Default values: 'edge_threshold=40', 'edge_shade=5', 'edge_thickness=0.5', 'edge_antialiasing=10', 'posterization_level=12' and 'posterization_antialiasing=0'. +#@cli : $ image.jpg poster_edges , +poster_edges : check "${1=40}>=0 && $1<=100 && ${2=5}>=0 && $2<=100 && ${3=0.5}>=0 && ${4=10}>=0 && +${5=12}>=0 && $5<=15 && ${6=0}>=0" +e[^-1] "Apply poster edge on image$?, with edge threshold $1, edge shade $2, edge thickness $3, +edge antialiasing $4, $5 level of posterization and posterization antialiasing $6." +foreach { +split_opacity l[0] { ++g xy,1 a[-2,-1] c norm. b. $3 n. 0,255 +apply_curve. 1,0,1,{max(0,(100-($1%)^0.1*100)*255%)},0.99,{min(255,(101-($1%)^0.1*100+$2)*255%)},0.01,255,0 c. 0,1 +if $4 smooth. {min(50,$4)},0,1,{$4/40},{$4/40},0.8,90 fi +if $5 autoindex[0] {round((4-sqrt($5+1))*32+2)} fi +if $6 smooth[0] {min(50,$6)},0,1,{$6/40},{$6/40},0.8,90 fi +* +} +a c +} +#@cli poster_hope : _smoothness>=0 +#@cli : Apply Hope stencil poster effect on selected images. +#@cli : Default value: 'smoothness=3'. +#@cli : $ image.jpg poster_hope , +poster_hope : check "${1=3}>=0" +e[^-1] "Apply Hope stencil poster effect on image$?, with smoothness $1." +foreach { +to_rgb +apc "smooth 200,0,1,$1,1" +quantize 7,0 f i!=5?i:i+1-2*(y%2) +(0,32,47;0,32,47;209,1,23;209,1,23;90,141,145;-1,-1,-1;253,221,138) permute. yzcx +map[0] [1] rm[1] +} +#@cli rodilius : 0<=_amplitude<=100,_0<=thickness<=100,_sharpness>=0,_nb_orientations>0,_offset,_color_mode={ 0:darker | 1:brighter } +#@cli : Apply rodilius (fractalius-like) filter on selected images. +#@cli : Default values: 'amplitude=10', 'thickness=10', 'sharpness=400', 'nb_orientations=7', 'offset=0' and 'color_mode=1'. +#@cli : $ image.jpg rodilius 12,10,300,10 normalize_local 10,6 +#@cli : $ image.jpg normalize_local 10,16 rodilius 10,4,400,16 smooth 60,0,1,1,4 normalize_local 10,16 +rodilius : check "${1=10}>=0 && $1<=200 && ${2=10}>=0 && $2<=100 && ${3=400}>=0 && ${4=7}>0" skip ${5=0},${6=1} +e[^-1] "Apply rodilius filter on image$? with amplitude $1, thickness $2, sharpness $3, $4 orientations, +offset $5 and "${arg0\ !$6,brighter,darker}" color mode." +foreach { nm={n} split_opacity l[0] { +if !$6 negate fi ++f. 0 +repeat round($4) { +angle:=$5+$>*180/round($4) ++blur_linear.. $1%,{$1*$2/100}%,$angle,1 b. 0.7 sharpen. $3 +max[1,-1] +} +k[1] +if !$6 negate fi +} a c } +#@cli sketchbw : _nb_angles>0,_start_angle,_angle_range>=0,_length>=0,_threshold>=0,_opacity,_bgfactor>=0,_density>0,_sharpness>=0,_anisotropy>=0,_smoothness>=0,_coherence>=0,_is_boost={ 0 | 1 },_is_curved={ 0 | 1 } +#@cli : Apply sketch effect to selected images. +#@cli : Default values: 'nb_angles=2', 'start_angle=45', 'angle_range=180', 'length=30', 'threshold=3', 'opacity=0.03', 'bgfactor=0', 'density=0.6', 'sharpness=0.1', 'anisotropy=0.6', 'smoothness=0.25', 'coherence=1', 'is_boost=0' and 'is_curved=1'. +#@cli : $ image.jpg +sketchbw 1 reverse blur[-1] 3 blend[-2,-1] overlay +sketchbw : +check "${1=2}>0 && ${3=180}>=0 && ${4=30}>=0 && ${5=3}>=0 && ${7=0}>=0 && ${8=0.6}>0 && ${9=0.1}>=0 && +${10=0.6}>=0 && ${11=0.25}>=0 && ${12=1}>=0" +skip ${2=45},${6=0.03},${13=0},${14=0} +e[^-1] "Apply B&W sketch effect on image$?." +nb_angles,start_angle,angle_range,length,threshold,opacity,bgfactor,density,sharpness,anisotropy,smoothness,coherence,is_boost,is_curved=${1-14} +length:=max($length,1) +foreach { +{0,[w,h,1,1,0]} ++gradient_norm[0] sqrt. +diffusiontensors[0] $sharpness,$anisotropy,$smoothness,$coherence +a[0,-1] c +1,{$density*wh/sqrt($length)},1,2,round(u([w#0,h#0]-1)) # [2] = set of random points +repeat $nb_angles { +[0],[0],1,2," +const angle = ("$start_angle" + "$>"*"$angle_range"/"$nb_angles")*pi/180; +const ca = cos(angle); +const sa = sin(angle); +T = I(#0); +U = [ T[0]*ca + T[1]*sa, T[1]*ca + T[2]*sa ]; +if ("$is_boost",U/=(1e-8 + norm(U))); +U" +if $is_curved +f[2] "* +oub = ovb = ouf = ovf = 0; +oixb = xb = xf = i0; +oiyb = yb = yf = i1; +oixf = oiyf = -1; +op = "$opacity" * (i(#0,xf,yf,0,3)<"$threshold"?"$bgfactor":1); +omop = 1 - op; +if (op>0, repeat ("$length",dl, +ixf = round(xf); +iyf = round(yf); +if (ixf!=oixf || iyf!=oiyf, (i(#1,ixf,iyf)*=omop)+=op; oixf = ixf; oiyf = iyf); +uf = i(#-1,xf,yf,0,0,1,1); +vf = i(#-1,xf,yf,0,1,1,1); +if (ouf*uf + ovf*vf<0, uf*=-1; vf*=-1); +xf+=uf; +yf+=vf; +ouf = uf; +ovf = vf; +ub = i(#-1,xb,yb,0,0,1,1); +vb = i(#-1,xb,yb,0,1,1,1); +if (oub*ub + ovb*vb<0, ub*=-1; vb*=-1); +xb-=ub; +yb-=vb; +oub = ub; +ovb = vb; +ixb = round(xb); +iyb = round(yb); +if (ixb!=oixb || iyb!=oiyb, (i(#1,ixb,iyb)*=omop)+=op; oixb = ixb; oiyb = iyb); +)); +I" +else +f[2] "* +const l = "$length"; +x = i0; +y = i1; +u = i(#-1,x,y,0,0); +v = i(#-1,x,y,0,1); +op = "$opacity" * (i(#0,x,y,0,3)<"$threshold"?"$bgfactor":1); +omop = 1 - op; +polygon(#1,2,x - l*u,y - l*v,x + l*u,y + l*v,op,1); +I" +fi +rm. +} +k.. * -1 n 0,255 +} +#@cli sponge : _size>0 +#@cli : Apply sponge effect on selected images. +#@cli : Default value: 'size=13'. +#@cli : $ image.jpg sponge , +sponge : skip ${1=13} +e[^-1] "Apply sponge filter on image$?, with brush size $1." +foreach { +100%,100%,1,1 noise. 20,2 ==. 1 ri. .. n. 0,1 *[-1,-2] +_circle $1 dilate.. . rm. +} +_circle : +if !($1%2) 2,2 else 1 fi ++. 1 r. $1,$1,1,1,0,0,0.5,0.5 distance. 1 n. 0,1 sqrt. c. 0.85,0.86 *. -1 n. 0,1 +#@cli stained_glass : _edges[%]>=0, shading>=0, is_thin_separators={ 0 | 1 } +#@cli : Generate stained glass from selected images. +#@cli : Default values: 'edges=40%', 'shading=0.2' and 'is_precise=0'. +#@cli : $ image.jpg stained_glass 20%,1 cut 0,20 +stained_glass : check "${1=40%}>=0 && ${2=0.2}>=0" skip ${3=0} +e[^-1] "Apply stained glass effect on image$?, with edges $1, shading $2 and thin-separators "${arg0\ !$3,enabled,disabled}"." +foreach { +im:=im-1 - $im ++gradient_norm >=. $1 *.. . +distance. 1 sharpen. 1e10 !=. 0 +if $3 skeleton. 0 fi +distance. 1 watershed.. . +.. $im +n. 0,1 ^. $2 * +} +#@cli stars : _density[%]>=0,_depth>=0,_size>0,_nb_branches>=1,0<=_thickness<=1,_smoothness[%]>=0,_R,_G,_B,_opacity +#@cli : Add random stars to selected images. +#@cli : Default values: 'density=10%', 'depth=1', 'size=32', 'nb_branches=5', 'thickness=0.38', 'smoothness=0.5', 'R=G=B=200' and 'opacity=1'. +#@cli : $ image.jpg stars , +stars : check "${1=10%}>=0 && ${2=1}>=0 && ${3=32}>0 && ${4=5}>=1 && ${5=0.38}>=0 && $5<=1 && ${6=0.5}>=0" +skip ${7=200},${8=$7},${9=$8},${10=1} +e[^-1] "Add $1 random stars to image$?, with depth $2, size $3, $4 branches, thickness $5, smoothness $6, +color ($7,$8,$9) and opacity $10." +if !$1 return fi +star3d $4,$5 col3d. 255 *3d. $3 +l. { repeat 4 { {round(2*$3)},{round(2*$3)} j3d. [0],50%,50%,0,1,2,0,0 r3d[0] 0,0,1,-90 } rm[0] } +autocrop[-4--1] 0 r2dy[-4--1] $3 b[-4--1] $6,0 r[-4--1] 100%,100%,1,4 +repeat 4 { sh[{-1-$>}] 0,2 fc. $7,$8,$9 rm. } +repeat $!-1 { [-4--1] l[$>,-4--1] { +N:=round((ispercentage($1)?w*h*$1:$1)/4,1,1) +repeat 4 { +2,$N rand. -1,1 1,$N rand. 0,1 a[-2,-1] x +i.. ('CImg3d') +.. 0.5 i.. ($N;$N) +(1,0;1,{$N-1}) r. 2,$N,1,1,3 round. 4,$N,1,1,1 y[-5,-3--1] a[-5--1] y +rv[-2,-1] sprites3d.. .,1 rm. *3d. {0.75*{0,w}},{0.75*{0,h}},{1000*$2} +j3d[0] .,50%,50%,0,$10,0,0,0 rm. +} +} } +rm[-4--1] +#@cli stencil : _radius[%]>=0,_smoothness>=0,_iterations>=0 +#@cli : Apply stencil filter on selected images. +#@cli : Default values: 'radius=3', 'smoothness=1' and 'iterations=8'. +#@cli : $ image.jpg +norm stencil. 2,1,4 +mul rm[0] +stencil : check "${1=3}>=0 && ${2=1}>=0 && ${3=8}>=0" +e[^-1] "Apply stencil filter on image$?, with radius $1, smoothness $2 and $3 iterations." +n 0,1 repeat $3 { b $1 unsharp {$1+$2},1000 c 0,255 } +#@cli stencilbw : _edges>=0,_smoothness>=0 +#@cli : Apply B&W stencil effect on selected images. +#@cli : Default values: 'edges=15' and 'smoothness=10'. +#@cli : $ image.jpg +stencilbw 40,4 +stencilbw : skip ${1=15},${2=10} +e[^-1] "Apply B&W stencil effect on image$?, with edges $1 and smoothness $2." +foreach { +split_opacity luminance[0] n[0] 0,255 ++edges[0] $1 quantize[0] 3,0,1 b[0] $2 +sharpen[0] 1000000 n[0] 0,1 *[0,-1] n[0] 0,255 a c +} +#@cli stylize : [style_image],_fidelity_finest,_fidelity_coarsest,_fidelity_smoothness_finest>=0,_fidelity_smoothnes_coarsest>=0,0<=_fidelity_chroma<=1,_init_type,_init_resolution>=0,init_max_gradient>=0,_patch_size_analysis>0,_patch_size_synthesis>0,_patch_size_synthesis_final>0,_nb_matches_finest>=0,_nb_matches_coarsest>=0,_penalize_repetitions>=0,_matching_precision>=0,_scale_factor>1,_skip_finest_scales>=0,_"image_matching_command" +#@cli : Transfer colors and textures from specified style image to selected images, using a multi-scale patch-mathing algorithm. +#@cli : If instant display window[0] is opened, the steps of the image synthesis are displayed on it. +#@cli : 'init_type' can be { 0:best-match | 1:identity | 2:randomized }. +#@cli : Default values: 'fidelity_finest=0.5', 'fidelity_coarsest=2', 'fidelity_smoothness_finest=3', 'fidelity_smoothness_coarsest=0.5', 'fidelity_chroma=0.1', 'init_type=0', 'init_resolution=16', 'init_max_gradient=0', 'patch_size_analysis=5', 'patch_size_synthesis=5', 'patch_size_synthesis_final=5', 'nb_matches_finest=2', 'nb_matchesc_coarsest=30', 'penalize_repetitions=2', 'matching_precision=2', 'scale_factor=1.85', 'skip_finest_scales=0' and 'image_matching_command'="s c,-3 match_pca[0] [2] b[0,2] xy,0.7 n[0,2] 0,255 n[1,2] 0,200 a[0,1] c a[1,2] c"'. +stylize : +check ${"is_image_arg $1"}" && isnum(${2=0.5}) && isnum(${3=2}) && ${4=3}>=0 && ${5=0.5}>=0 && ${6=0.1}>=0 && ""$6<=1 && isint(${7=0}) && $7>=0 && $7<=3 && isint(${8=16}) && $8>=0 && ${9=0}>=0 && isint(${10=5}) && ""$10>0 && isint(${11=5}) && $11>0 && isint(${12=$11}) && $12>0 && isint(${13=2}) && isint(${14=30}) && ""${15=2}>=0 && ${16=2}>=0 && ${17=1.85}>1 && isint(${18=0})>=0" +skip "${19=s c,-3 match_pca[0] [2] b[0,2] xy,0.7 n[0,2] 0,255 n[1,2] 0,200 a[0,1] c a[1,2] c}" +e[^-1] "Stylize image$? with style image $1." +fidelity_finest,\ +fidelity_coarsest,\ +fidelity_smoothness_finest,\ +fidelity_smoothness_coarsest,\ +fidelity_chroma,\ +init_type,\ +init_resolution,\ +init_max_gradient,\ +patch_size_analysis,\ +patch_size_synthesis,\ +patch_size_synthesis_final,\ +nb_matches_finest,\ +nb_matches_coarsest,\ +penalize_repetitions,\ +matching_precision,\ +scale_factor,\ +skip_finest_scales=${2-18} \ +m "stylize_match : $19" +init_resolution:=max(2*$patch_size_analysis,$init_resolution) +mprec0:=round(2+1.5*$matching_precision) +mprec1:=1+round(4*$matching_precision) +is_window={*} +pass$1 +repeat $!-1 { l[$>,-1] { +to_colormode.. {s} +nb_scales:=1+round(log(min(w#0,h#0,w#1,h#1)/$init_resolution)/log($scale_factor),1,-1) +if {*} wsiz=${"fitscreen "{0,[w,h]}} w[0] $wsiz,0,"[G'MIC Stylize]" fi +repeat $nb_scales { scale=$> +size_factor:=100/($scale_factor^$<) +if !$scale ++r[0,1] $size_factor%,$size_factor%,100%,100%,2 ws,hs={-2,[w,h]} ++to_color[0,1] channels[-2,-1] 0,2 gradient_norm[-2,-1] +r. [-3],[-3],[-3],1,2 r.. [-4],[-4],[-4],1,2 +a[-3,-1] c a[-3,-1] c +stylize_match[-2,-1] +if !$init_type ++matchpatch.. .,3,3,1,{2*$mprec0},{2*$mprec1},$penalize_repetitions +else +..,..,1,2,"round([x,y]*([w#-1,h#-1]-1)/([w,h]-1))" # Identity +if d#-2>1 channels. 0,2 fi +if $init_type==2 eval. ">P = u([w,h]-1); tmp = I(P); I(P) = I; I() = tmp" fi +fi +rm[-3,-2] +if $init_max_gradient>0 ++gradient_norm[0] r. ..,..,1,1,2 gt. $init_max_gradient ++.. 1 *[-2,-1] _inpaint_warping2d. --. 1 +fi +if $is_window" && "!{*} break fi +else +factor:=1-($scale-1)/max(1,$nb_scales-2) ++r[0,1] $size_factor%,$size_factor%,100%,100%,2 ++to_color[-2,-1] channels[-2,-1] 0,2 gradient_norm[-2,-1] +a[-3,-1] c a[-3,-1] c +stylize_match[-2,-1] mv[-2,-1] -3 +sh. 0 *. {-3,w/$ws} rm. sh. 1 *. {-3,h/$hs} rm. round. ++. 1 r. ...,...,1,100%,4 -. 1 +do +f. "begin(const boundary = 1; nx = ny = vectors(); nx[0] = ny[1] = 1); +i>=0?I:( +j(-1)>=0?J(-1) + nx: +j(0,-1)>=0?J(0,-1) + ny: +j(1)>0?J(1) - nx: +j(0,1)>0?J(0,1) - ny:I)" +while im<0 +ws,hs={-2,[w,h]} +if $<<$skip_finest_scales rm[-3,-2] continue fi ++warp_patch.. .,$patch_size_synthesis,$patch_size_synthesis,1 +if {*} w. fi +fidelity:=max(0,$fidelity_finest+($fidelity_coarsest-$fidelity_finest)*$factor) +fidelity_smoothness:=$fidelity_smoothness_finest+($fidelity_smoothness_coarsest-$fidelity_smoothness_finest)*$factor +if $fidelity>0.1 +sh. 0,2 sh[-5] 0,2 +gradient_norm[-2,-1] rm[-4,-3] +*. $fidelity argmax[-2,-1] b. xy,$fidelity_smoothness n. 0,{min(1,$fidelity)} +sh[-5,-2] 0,2 srgb2lab[-2,-1] rm[-2,-1] ++*. $fidelity_chroma r. 100%,100%,1,2,1 a[-2,-1] c j.. [-5],0,0,0,0,1,. rm. +sh. 0,2 lab2srgb. rm. +fi +rm[-4] +nb_matches:=max(0,round($nb_matches_finest+($nb_matches_coarsest-$nb_matches_finest)*$factor^2)) +nb_scales1:=$nb_scales-1 +nb_matches1:=$nb_matches-1 +if {*} +r. $wsiz,1,100% to. "Scale "$scale/$nb_scales1": 0%",5,2,24 w. -1,-1,0 rm. fi +repeat $nb_matches { +matchpatch. ...,$patch_size_analysis,$patch_size_analysis,1,$mprec0,$mprec1,$penalize_repetitions,0,.. +-.. . abs.. diff={-2,ia} rm.. ++warp_patch.. .,$patch_size_synthesis,$patch_size_synthesis,1 +if {*}" && "(!($>%5)" || "$nb_matches<=10) ++r. $wsiz,1,100% +to. "Scale "$scale/$nb_scales1": "{round(100*($>+1)/$nb_matches)}%,5,2,24 w. -1,-1,0 rm. +fi +if $is_window" && "!{*} break fi +if $diff<1 break fi +} +rm[-3,-1] +fi +if $is_window" && "!{*} break fi +} +if $is_window" && "!{*} k[0,1] break fi ++warp_patch[1] .,$patch_size_synthesis_final,$patch_size_synthesis_final,1 c. 0,255 +rv[0,-1] rm[-2,-1] +} } rm. +um stylize_match +#@cli tetris : _scale>0 +#@cli : Apply tetris effect on selected images. +#@cli : Default value: 'scale=10'. +#@cli : $ image.jpg +tetris 10 +tetris : skip ${1=10} +e[^-1] "Apply tetris effect on image$?, with scale $1." +foreach { wh={w},{h},1,{s} r $1%,$1%,$1%,100%,2 n 0,255 quantize 10,1,0 r $wh b 2 sharpen 300,1 } +#@cli warhol : _M>0,_N>0,_smoothness>=0,_color>=0 +#@cli : Create MxN Andy Warhol-like artwork from selected images. +#@cli : Default values: 'M=3', 'N=M', 'smoothness=2' and 'color=20'. +#@cli : $ image.jpg warhol 3,3,3,40 +warhol : skip ${1=3},${2=$1},${3=2},${4=20} +e[^-1] "Create $1x$2 Andy Warhol-like artwork from image$?." +r0:=100/max($1,$2) +foreach { +norm b $3 r $r0%,$r0%,1,100%,2 quantize 6 n 0,5 round 1 +repeat $1 { +repeat $2 { (0,1,2,3,4,5) n. 32,224 6,1,1,2,128 noise. $4,0 c. 0,255 a[-2,-1] c ycbcr2rgb. +map[0] . rm.. } +} +append_tiles[^0] $1,$2 =>[1] {0,n} rm[0] +} +#@cli weave : _density>=0,0<=_thickness<=100,0<=_shadow<=100,_shading>=0,_fibers_amplitude>=0,_fibers_smoothness>=0,_angle,-1<=_x_curvature<=1,-1<=_y_curvature<=1 +#@cli : Apply weave effect to the selected images. +#@cli : 'angle' can be { 0:0 deg. | 1:22.5 deg. | 2:45 deg. | 3:67.5 deg. }. +#@cli : Default values: 'density=6', 'thickness=65', 'shadow=40', 'shading=0.5', 'fibers_amplitude=0', _'fibers_smoothness=0', 'angle=0' and 'curvature_x=curvature_y=0' +#@cli : $ image.jpg weave , +weave : check "${1=6}>=0 && ${2=65}>=0 && $2<=100 && ${3=40}>=0 && $3<=100 && ${4=0.5}>=0" +check "${5=0}>=0 && ${6=0}>=0 && ${7=0}>=0 && $7<=3 && ${8=0}>=-1 && $8<=1 && ${9=0}>=-1 && $9<=1" +e[^-1] "Apply weave effect to image$?, with $1 strips, thickness $2, shadow $3, shading $4, ""fibers amplitude $5 and fibers smoothness $6, angle "{$7*22.5}" deg. and curvatures ($8,$9)." +foreach { split_opacity l[0] { +w:=round(max(w,h)/$1,1,1) h=$w s:=(100-$3)*255% p:=max(0.01,$4) +1,$h =. 1,0,50% distance. 1 ^. $p c. 50%,100% r. {max(1,round($2*$w%))},100% +$w,1 =. 1,50% distance. 1 ^. $p c. 50%,100% *. -1 r. 100%,{max(1,round($2*$h%))} ++*. -1 +*... -1 n[-4,-2] 0,$s n[-3,-1] $s,255 +{w},1 1,... rand[-2,-1] 0,1 b[-2,-1] $6% n[-2,-1] -$5,$5 ri. [-4] +[-5] . +[-4,-1] +[-5] . +[-2,-1] ++f... 255 a[-4,-1] c +f. 255 a[-2,-1] c +amp_x:=$8*($w-w)/2 amp_y:=$9*($w-w)/2 +r[-4--1] $w,$h,1,100%,0,0,0.5,0.5 +f[-4] i(x+$amp_x*sin(y/h*pi),y,0,c,1,2) f. i(x-$amp_x*sin(y/h*pi),y,0,c,1,2) +f... i(x,y+$amp_y*sin(x/w*pi),0,c,1,2) f.. i(x,y-$amp_y*sin(x/w*pi),0,c,1,2) +blend[-4,-3] alpha blend[-2,-1] alpha c[-2,-1] 0,255 +/[-2,-1] 255 . ... a[-4,-2] x a[-2,-1] x a[-2,-1] y rotate_tileable. {$7*22.5} +r. ..,..,1,1,0,2 *[-2,-1] +} a c } +#@cli whirls : _texture>=0,_smoothness>=0,_darkness>=0,_lightness>=0 +#@cli : Add random whirl texture to selected images. +#@cli : Default values: 'texture=3', 'smoothness=6', 'darkness=0.5' and 'lightness=1.8'. +#@cli : $ image.jpg whirls , +whirls : skip ${1=3},${2=6},${3=0.5},${4=1.8} +e[^-1] "Add random whirl texture to image$?, with texture $1, smoothness $2, darkness $3 and lightness $4." +foreach { +100%,100% noise. 0.3,2 ==. 1 repeat $1 { b. $2 +. 0.1 gradient_norm. ^. 0.2 } +n. $3,$4 ri. .. * c 0,255 +} +#@cli :: Warpings +#@cli deform : _amplitude>=0,_interpolation +#@cli : Apply random smooth deformation on selected images. +#@cli : 'interpolation' can be { 0:none | 1:linear | 2:bicubic }. +#@cli : Default value: 'amplitude=10'. +#@cli : $ image.jpg +deform[0] 10 +deform[0] 20 +deform : skip ${1=10},${2=1} +e[^-1] "Apply random smooth deformation on image$?, with amplitude $1." +foreach { 2%,2%,1,2 noise. $1 r. ..,..,1,2,5 warp.. .,1,$2,1 rm. } +#@cli euclidean2polar : _center_x[%],_center_y[%],_stretch_factor>0,_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror } +#@cli : Apply euclidean to polar transform on selected images. +#@cli : Default values: 'center_x=center_y=50%', 'stretch_factor=1' and 'boundary_conditions=3'. +#@cli : $ image.jpg +euclidean2polar , +euclidean2polar : skip ${1=50%},${2=50%} check "${3=1}>0 && isint(${4=3}) && $4>=0 && $4<=3" +e[^-1] "Apply euclidean to polar transform on image$?, with center point ($1,$2), stretch factor $3 and "${"arg0 $4,dirichlet,neumann,periodic,mirror"}" boundary conditions." +foreach { +cx,cy:=ispercentage($1)?$1*(w-1):$1,ispercentage($2)?$2*(h-1):$2 +R:=sqrt(max($cx^2,(w-1-$cx)^2)+max($cy^2,(h-1-$cy)^2)) +f "r = $R*(x/(w-1))^$3; +a = y*2*pi/(h-1); +i($cx + r*cos(a),$cy + r*sin(a),z,c,1,$4)" +} +#@cli equirectangular2nadirzenith +#@cli : Transform selected equirectangular images to nadir/zenith rectilinear projections. +equirectangular2nadirzenith : +e[^-1] "Transform equirectangular image$? to nadir/zenith rectilinear projections." +foreach { +100%,100%,1,2 +sh. 100% +f. " +X = 2*x/(w-1) - 1; +Y = y/(h-1) - 0.5; +if (X<0, +sinphi1 = 1; X+=0.5, +sinphi1 = -1; X-=0.5 +); +rr = sqrt(X*X + Y*Y); +cc = atan(2*rr); +phi = rr?asin(cos(cc)*sinphi1):0; +X = atan2(X,-Y*sinphi1)/pi; +Y = phi/pi; +(++X)*=0.5*w; +(Y+=0.5)*=h; +i(#-2) = X; Y;" +warp[0] [1],0,0,1 k... +} +#@cli fisheye : _center_x,_center_y,0<=_radius<=100,_amplitude>=0 +#@cli : Apply fish-eye deformation on selected images. +#@cli : Default values: 'x=y=50', 'radius=50' and 'amplitude=1.2'. +#@cli : $ image.jpg +fisheye , +fisheye : skip ${1=50},${2=50},${3=50},${4=1.2} +e[^-1] "Apply Fish-eye effect on image$?, centered at ($1%,$2%) with radius $3% and amplitude $4." +if !$4 return fi +foreach { +100%,100%,1,1 =. 1,$1%,$2% distance. 1 c. 0,$3% *. -1 n. 0,1 ^. {1/$4} +i.. ({-$1/100},{1-$1/100};{-$1/100},{1-$1/100}^{-$2/100},{-$2/100};{1-$2/100},{1-$2/100}) r.. .,.,1,2,3 +n. 0,{max(w,h)} *[-2,-1] +warp.. .,1,1,1 rm. +} +#@cli flower : _amplitude,_frequency,_offset_r[%],_angle,_center_x[%],_center_y[%],_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror} +#@cli : Apply flower deformation on selected images. +#@cli : Default values: 'amplitude=30', 'frequency=6', 'offset_r=0', 'angle=0', 'center_x=center_y=50%' and 'boundary_conditions=3'. +#@cli : $ image.jpg +flower , +flower : skip ${1=30},${2=6},${3=0},${4=0},${5=50%},${6=50%},${7=3} +e[^-1] "Apply flower deformation on image$?, with amplitude $1, frequency $2, offset $3, angle $4 deg. and +center point ($1,$2)." +if ispercentage($3) +transform_polar "r + (R*$3) + R*$1/100*cos(a*$2+$4*pi/180)","a",$5,$6,$7 +else +transform_polar "r + $3 + R*$1/100*cos(a*$2+$4*pi/180)","a",$5,$6,$7 +fi +#@cli kaleidoscope : _center_x[%],_center_y[%],_radius,_angle,_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror } +#@cli : Create kaleidoscope effect from selected images. +#@cli : Default values: 'center_x=center_y=50%', 'radius=100', 'angle=30' and 'boundary_conditions=3'. +#@cli : $ image.jpg kaleidoscope , +kaleidoscope : skip ${1=50%},${2=50%},${3=100},${4=30},${5=3} +e[^-1] "Create kaleidoscope effect from image$?, with center point ($1,$2), radius $3, angle $4 deg." +euclidean2polar $1,$2,1,$5 +foreach { +columns 0,$3% rows. 0,$4% ri. ..,0,2 =>[1] {0,n} rm[0] } +polar2euclidean $1,$2,1,$5 +#@cli map_sphere : _width>0,_height>0,_radius,_dilation>0,_fading>=0,_fading_power>=0 +#@cli : Map selected images on a sphere. +#@cli : Default values: 'width=height=512', 'radius=100', 'dilation=0.5', 'fading=0' and 'fading_power=0.5'. +#@cli : $ image.jpg map_sphere , +map_sphere : check "${1=512}>0 && ${2=512}>0 && ${5=0}>=0 && ${6=0.5}>=0" skip ${3=100},${4=0.5} +e[^-1] "Map image$? on spheres in $1x$2 images, with radius $3, dilation $4 and fading $5." +r2:=($3*min($1,$2)/200)^2 +foreach { +i.. 100%,1,1,100%,0 =>[0] {1,n} a y +({-$1/2},{$1/2}) ({-$2/2};{$2/2}) r[-2,-1] $1,$2,1,1,3 atan2. .. rm.. +$1,$2 =. 1,50%,50% distance. 1,3 /. $r2 sqrt. c. 0,1 +asin. ++.. {pi} *.. {({-3,w}-1)/(2*pi)} +*. {2/pi} ^. $4 *. {{-3,h}-1} *. -1 +. {{-3,h}-1} +if $5 +>=. 1 distance. 1 c. 0,$5% n. 0,1 ^. $6 c.. 1,100% -[-2,-1] fi +r[-1,-2] 100%,100%,{-3,d} ++f. z a[-3--1] c +warp.. .,0,1,1 rm. +} +#@cli nadirzenith2equirectangular +#@cli : Transform selected nadir/zenith rectilinear projections to equirectangular images. +nadirzenith2equirectangular : +e[^-1] "Transform nadir/zenith rectilinear projection$? to equirectangular images." +foreach { +100%,100%,1,2 +sh. 100% +f. " +X = 2*x/(w-1) - 1; +Y = y/(h-1) - 0.5; +output = 1; +if (Y>0.125, +sinphi1 = 1; xc = -0.5, +if (Y<-0.125, +sinphi1 = -1; xc = 0.5, +output = 0 +)); +cosc = sinphi1*sin(Y*pi); +xx = cos(Y*pi)*sin(X*pi)/cosc; +yy = -sinphi1*cos(Y*pi)*cos(X*pi)/cosc; +if (abs(xx)>1, output=0); +(xx*=0.5)+=xc; +yy*=0.5; +if (!output, xx = yy = -1); +(++xx)*=0.5*w; +(yy+=0.5)*=h; +i(#-2) = xx; yy;" +to_a[0] warp[0] [1],0,0,0 k... +} +#@cli polar2euclidean : _center_x[%],_center_y[%],_stretch_factor>0,_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror } +#@cli : Apply euclidean to polar transform on selected images. +#@cli : Default values: 'center_x=center_y=50%', 'stretch_factor=1' and 'boundary_conditions=3'. +#@cli : $ image.jpg +euclidean2polar , +polar2euclidean : skip ${1=50%},${2=50%} check "${3=1}>0 && isint(${4=3}) && $4>=0 && $4<=3" +e[^-1] "Apply polar to euclidean transform on image$?, with center point ($1,$2), stretch factor $3 and "${"arg0 $4,dirichlet,neumann,periodic,mirror"}" boundary conditions." +foreach { +cx,cy:=ispercentage($1)?$1*(w-1):$1,ispercentage($2)?$2*(h-1):$2 +R:=sqrt(max($cx^2,(w-1-$cx)^2)+max($cy^2,(h-1-$cy)^2)) +f "X = sqrt((x - "$cx")^2 + (y - "$cy")^2); +tmp = atan2(y - "$cy",x - "$cx"); +Y = tmp<0?tmp + 2*pi:tmp; +i((X/"$R")^(1/$3)*(w - 1),Y*(h - 1)/(2*pi),z,c,1,$4)" +} +#@cli raindrops : _amplitude,_density>=0,_wavelength>=0,_merging_steps>=0 +#@cli : Apply raindrops deformation on selected images. +#@cli : Default values: 'amplitude=80','density=0.1', 'wavelength=1' and 'merging_steps=0'. +#@cli : $ image.jpg +raindrops , +raindrops : check "${2=0.1}>=0 && ${3=1}>=0 && isint(${4=0}) && $4>=0" skip ${1=80} +e[^-1] "Apply raindrops deformation on image$?, with amplitude $1, density $2, wavelength $3 and $4 merging steps." +foreach { +100%,100% noise. $2,2 ==. 1 distance. 1 f. "cos(i)/(1+i/(1e-8+$3))" +if $4 +i.. (0,1,0;1,0,1;0,1,0) /.. 2 . +repeat $4 { +convolve. ...,1 -. ... rm... } rm[-3,-2] +fi +g. a[-2,-1] c *. {$1/(1e-5+max(abs(im),abs(iM)))} +warp.. .,1,1,1 rm. +} +#@cli ripple : _amplitude,_bandwidth,_shape={ 0:block | 1:triangle | 2:sine | 3:sine+ | 4:random },_angle,_offset +#@cli : Apply ripple deformation on selected images. +#@cli : Default values: 'amplitude=10', 'bandwidth=10', 'shape=2', 'angle=0' and 'offset=0'. +#@cli : $ image.jpg +ripple , +ripple : skip ${1=10},${2=20},${3=2},${4=0},${5=0} +e[^-1] "Apply ripple deformation on image$?, with amplitude $1, bandwidth $2, shape $3, angle $4 deg. and offset $5." +theta:=$4*pi/180 C:=cos($theta) S:=-sin($theta) +foreach { +100%,100%,1,1,"x" -. {w/2} 100%,100%,1,1,'y' +-. {h/2-$5} *.. $S *. $C +[-2,-1] +_ripple$3. $1,$2 ++*. {-$S} *.. $C a[-2,-1] c +warp.. .,1,1,1 rm. +} +_ripple0 : f {$1/2}*"(1-2*(i%"{2*$2}"<$2))" +_ripple1 : f "I=(i%$2)/$2;$1*(2*(I<0.5?I:1-I)-0.5)" +_ripple2 : f {-$1/2}*"cos(i*"{2*pi/$2}")" +_ripple3 : f {-$1/2}*"abs(cos(i*"{2*pi/$2}"))" +_ripple4 : skip $* n 0,{h-1} 1,{h} rand. {-$1/2},{$1/2} m,M:=im,iM b. {$2/10} n. $m,$M map.. . rm. +#@cli rotoidoscope : _center_x[%],_center_y[%],_tiles>0,_smoothness[%]>=0,_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror } +#@cli : Create rotational kaleidoscope effect from selected images. +#@cli : Default values: 'center_x=center_y=50%', 'tiles=10', 'smoothness=1' and 'boundary_conditions=3'. +#@cli : $ image.jpg +rotoidoscope , +rotoidoscope : skip ${1=50%},${2=50%},${5=1} check "${3=10}>0 && ${4=3}>=0" +e[^-1] "Create rotational kaleidoscope effect from image$?, with center point ($1,$2), $3 tiles and smoothness $4." +foreach { +repeat $3 { +rotate[0] {360/$3},1,$5,$1,$2 blend_edges $4 } +} +#@cli spherize : _radius[%]>=0,_strength,_smoothness[%]>=0,_center_x[%],_center_y[%],_ratio_x/y>0,_angle,_interpolation +#@cli : Apply spherize effect on selected images. +#@cli : Default values: 'radius=50%', 'strength=1', 'smoothness=0', 'center_x=center_y=50%', 'ratio_x/y=1', 'angle=0' and 'interpolation=1'. +#@cli : $ image.jpg grid 5%,5%,0,0,0.6,255 spherize , +spherize : check "${1=50%}>=0 && ${3=0}>=0 && ${6=1}>0 && isint(${8=1}) && $8>=0 && $8<=2" +skip "${2=1},${4=50%},${5=50%},${7=0}" +e[^-1] "Apply spherize effect on image$?, with radius $1, strength $2, smoothness $3, center ($4,$5), +x/y-ratio $6, angle $7 and "${"arg0 $8,nearest-neighbor,linear,cubic"}" interpolation." +if !$1||!$2 return fi +foreach { +rmax:=ispercentage($1)?0.5*sqrt((w-1)^2+(h-1)^2)*$1:$1 +centerx:=ispercentage($4)?(w-1)*$4:$4 +centery:=ispercentage($5)?(h-1)*$5:$5 +strength:=$2>0?$2:1-exp($2/5) +100%,100%,1,2," +begin( +center = [ "$centerx","$centery" ]; +wh1 = [ w,h ] - 1; +m2wh1 = 0.5*max(wh1); +rmax = "$rmax"/m2wh1; +const f = 1/"$strength"; +const ratio = $6; +rotf = rot($7°); +rotb = rot(-$7°); +); +xy = ([x,y] - center)/m2wh1; +xy = rotf*xy; +ratio>=1?(xy[1]*=ratio):(xy[0]/=ratio); +r = norm(xy); +z = r=1?(xy[1]/=ratio):(xy[0]*=ratio); +xy = rotb*xy; +xy = center + f*xy/(f + z)*m2wh1" +b. $3 +warp.. .,0,$8,1 rm. +} +#@cli symmetrize : _x[%],_y[%],_angle,_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror },_is_antisymmetry={ 0 | 1 },_swap_sides={ 0 | 1 } +#@cli : Symmetrize selected images regarding specified axis. +#@cli : Default values: 'x=y=50%', 'angle=90', 'boundary_conditions=3', 'is_antisymmetry=0' and 'swap_sides=0'. +#@cli : $ image.jpg +symmetrize 50%,50%,45 +symmetrize[-1] 50%,50%,-45 +symmetrize : skip ${1=50%},${2=50%},${3=90},${4=3},${5=0},${6=0} +e[^-1] "Symmetrize image$?, regarding axis ($1,$2,$3 deg.)." +theta:=deg2rad($3) u,v:=cos($theta),sin($theta) +if $6 symmetry_cond=A<0 else symmetry_cond=A>0 fi +foreach { +x0:=ispercentage($1)?w*$1:$1 +y0:=ispercentage($2)?h*$2:$2 +if $5 +f "A = ($y0 - y)*$u - ($x0 - x)*$v; X = x + 2*($x0 - x); Y = y + 2*($y0 - y); "$symmetry_cond"?i(X,Y,z,c,1,$4):i" +else +f "A = ($y0 - y)*$u - ($x0 - x)*$v; X = x - 2*$v*A; Y = y + 2*$u*A; "$symmetry_cond"?i(X,Y,z,c,1,$4):i" +fi +} +#@cli transform_polar : "expr_radius",_"expr_angle",_center_x[%],_center_y[%],_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror } +#@cli : Apply user-defined transform on polar representation of selected images. +#@cli : Default values: 'expr_radius=R-r', 'expr_rangle=a', 'center_x=center_y=50%' and 'boundary_conditions=3'. +#@cli : $ image.jpg +transform_polar[0] R*(r/R)^2,a +transform_polar[0] r,2*a +transform_polar : skip "${1=R-r}","${2=a}",${3=50%},${4=50%},${5=3} +e[^-1] "Apply custom polar transform with 'new_r = $1', 'new_a = $2', center point ($3%,$4%)." +foreach { +cx:=ispercentage($3)?$3*(w-1):$3 +cy:=ispercentage($4)?$4*(h-1):$4 +R:=sqrt(max($cx^2,(w-1-$cx)^2)+max($cy^2,(h-1-$cy)^2)) +f "R ="$R"; +r = sqrt((x-"$cx")^2 + (y-"$cy")^2); +a = atan2(y-"$cy",x-"$cx"); +nr = ($1); +na = ($2); +i("$cx" + nr*cos(na), "$cy" + nr*sin(na), z, c,1,$5)" +} +#@cli twirl : _amplitude,_center_x[%],_center_y[%],_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror } +#@cli : Apply twirl deformation on selected images. +#@cli : Default values: 'amplitude=1', 'center_x=center_y=50%' and 'boundary_conditions=3'. +#@cli : $ image.jpg twirl 0.6 +twirl : skip ${1=1},${2=50%},${3=50%},${4=3} +e[^-1] "Apply twirl deformation on image$?, with amplitude $1 and center point at ($2%,$3%)." +euclidean2polar $2,$3,1,$4 +foreach { .,.,1,1,$1*x channels. -1,0 warp.. .,1,1,2 rm. } +polar2euclidean $2,$3,1,1 +#@cli warp : [warping_field],_mode,_interpolation,_boundary_conditions,_nb_frames>0 : (+) +#@cli : Warp selected images with specified displacement field. +#@cli : 'mode' can be { 0:backward-absolute | 1:backward-relative | 2:forward-absolute | 3:forward-relative }. +#@cli : 'interpolation' can be { 0:nearest-neighbor | 1:linear | 2:cubic }. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : Default values: 'mode=0', 'interpolation=1', 'boundary_conditions=0' and 'nb_frames=1'. +#@cli : $ image.jpg 100%,100%,1,2,'X=x/w-0.5;Y=y/h-0.5;R=(X*X+Y*Y)^0.5;A=atan2(Y,X);130*R*(!c?cos(4*A):sin(8*A))' warp[-2] [-1],1,1,0 quiver[-1] [-1],10,1,1,1,100 +#@cli : $$ https://gmic.eu/oldtutorial/_warp +#@cli warp_patch : [warping_field],patch_width>=1,_patch_height>=1,_patch_depth>=1,_std_factor>0,_boundary_conditions. +#@cli : Patch-warp selected images, with specified 2D or 3D displacement field (in backward-absolute mode). +#@cli : Argument 'std_factor' sets the std of the gaussian weights for the patch overlap, +#@cli : equal to 'std = std_factor*patch_size'. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : Default values: 'std_factor=0.3' and 'boundary_conditions=3'. +warp_patch : check ${is_image_arg\ $1}" && isint(${2=3}) && $2>=1 && isint(${3=$2}) && $3>=1 && +isint(${4=1}) && $4>=1 && isnum(${5=0.3}) && $5>0 && isint(${6=3}) && $6>=0 && $6<=3" +e[^-1] "Patch-warp image$? with backward-absolute displacement field $1, using $2x$3x$4 patches, std factor $5 +and "${"arg0 $6,dirichlet,neumann,periodic,mirror"}" boundary conditions." +if $2<=1 pass$1 warp[^-1] .,0 rm. return fi +repeat $! { pass$1 l[$>,-1] { +nm={0,n} +[0],[0],[0],1,1 a[0,-1] c +100%,100%,100%,{0,s} +if s#1>=3 # 3D version +eval[1] "> +begin( +const pw = $2; +const ph = $3; +const pd = $4; +const stdf = $5; +const boundary = $6; +const pw1 = int(pw/2); +const pw2 = pw - pw1 - 1; +const ph1 = int(ph/2); +const ph2 = ph - ph1 - 1; +const pd1 = int(pd/2); +const pd2 = pd - pd1 - 1; +const pwhd = pw*ph*pd; +return = vector(s); +if (stdf<5, +ref(vectorpwhd(),weights); +offw = 0; +for (zw = -pd1, zw<=pd2, ++zw, +for (yw = -ph1, yw<=ph2, ++yw, +for (xw = -pw1, xw<=pw2, ++xw, +weights[offw++] = exp(-xw^2/(2*(stdf*pw)^2) - yw^2/(2*(stdf*ph)^2) - zw^2/(2*(stdf*pd)^2)); +); +); +); +); +); +u = i(x,y,z,0); +v = i(x,y,z,1); +w = i(x,y,z,2); +ref(crop(#0,u - pw1, v - ph1,w - pd1,pw,ph,pd,boundary),patch); +stdf<5? +draw(#2,patch,x - pw1,y - ph1,z - pd1,0,pw,ph,pd,s#0,-1,weights): +draw(#2,patch,x - pw1,y - ph1,z - pd1,0,pw,ph,pd,s#0,-1); +return" +else +eval[1] "> +begin( +const pw = $2; +const ph = $3; +const stdf = $5; +const boundary = $6; +const pw1 = int(pw/2); +const pw2 = pw - pw1 - 1; +const ph1 = int(ph/2); +const ph2 = ph - ph1 - 1; +const pwh = pw*ph; +return = vector(s); +if (stdf<5, +ref(vectorpwh(),weights); +offw = 0; +for (yw = -ph1, yw<=ph2, ++yw, +for (xw = -pw1, xw<=pw2, ++xw, +weights[offw++] = exp(-xw^2/(2*(stdf*pw)^2) - yw^2/(2*(stdf*ph)^2)); +); +); +); +); +u = i(x,y,z,0); +v = i(x,y,z,1); +ref(crop(#0,u - pw1, v - ph1,pw,ph,boundary),patch); +stdf<5? +draw(#2,patch,x - pw1,y - ph1,0,0,pw,ph,1,s#0,-1,weights): +draw(#2,patch,x - pw1,y - ph1,0,0,pw,ph,1,s#0,-1); +return" +fi +s. c,-{0,s-1} /[-2,-1] k. => $nm +} } +#@cli warp_perspective : _x-angle,_y-angle,_zoom>0,_x-center,_y-center,_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror } +#@cli : Warp selected images with perspective deformation. +#@cli : Default values: 'x-angle=1.5', 'y-angle=0', 'zoom=1', 'x-center=y-center=50' and 'boundary_conditions=2'. +#@cli : $ image.jpg warp_perspective , +warp_perspective : skip ${1=1.5},${2=0},${3=1},${4=50},${5=50},${6=2} +e[^-1] "Apply perspective warp on image$?, with angles ($1 deg.,$2 deg.), zoom $3 and offsets ($4,$5)." +foreach { +(0,100) -. $4 /. 100 (0;100) -. $5 /. 100 r[-2,-1] ...,...,...,1,3 ++*.. $2 +*.. $1 +[-2,-1] +. $3 /... . /[-2,-1] +*.. 100 +.. $4 /.. 100 *.. {-3,w} +*. 100 +. $5 /. 100 *. {-3,h} +a[-2,-1] c warp.. .,0,1,$6 rm. +} +#@cli warp_rbf : xs0[%],ys0[%],xt0[%],yt0[%],...,xsN[%],ysN[%],xtN[%],ytN[%] +#@cli : Warp selected images using RBF-based interpolation. +#@cli : Each argument (xsk,ysk)-(xtk,ytk) corresponds to the coordinates of a keypoint +#@cli : respectively on the source and target images. The set of all keypoints define the overall image deformation. +#@cli : $ image.jpg +warp_rbf 0,0,0,0,100%,0,100%,0,100%,100%,100%,100%,0,100%,0,100%,50%,50%,70%,50%,25%,25%,25%,75% +warp_rbf : +e[^-1] "Warp image$? using RBF interpolation, with keypoints ($*)." +$=arg N:=$#/4 +if int($N)!=$N error[0--2] "Command 'warp_rbf': Wrong number of arguments ($#)." fi +foreach { +4,$N +repeat wh { a=${arg{1+$>}} isp:=ispercentage($a) eval i[$>]=$isp?($>%2?w#0:h#0)*$a:$a } +s. x,2 -. .. a[-2,-1] x permute. yzcx +rbf. {0,[w,h]} warp[0] .,1,1,3 rm. +} +#@cli water : _amplitude,_smoothness>=0,_angle +#@cli : Apply water deformation on selected images. +#@cli : Default values: 'amplitude=30', 'smoothness=1.5' and 'angle=45'. +#@cli : $ image.jpg water , +water : check ${2=1.5}>=0 skip ${1=30},${3=1},${4=45} +e[^-1] "Apply water deformation on image$?, with amplitude $1, smoothness $2 and angle $3." +foreach { +25%,25%,25%,1 noise. $1 g. xy *.. {-sin($3*pi/180)} *. {cos($3*pi/180)} +[-2,-1] b. $2 *. 2 +r. ..,..,1,2,3 warp.. .,1,1,1 rm. +} +#@cli wave : _amplitude>=0,_frequency>=0,_center_x,_center_y +#@cli : Apply wave deformation on selected images. +#@cli : Default values: 'amplitude=4', 'frequency=0.4' and 'center_x=center_y=50'. +#@cli : $ image.jpg wave , +wave : skip ${1=4},${2=0.4},${3=50},${4=50} +e[^-1] "Apply wave deformation on image$?, with amplitude $1, frequency $2 and center point at ($3%,$4%)." +foreach { +100%,100% =. 1,$3%,$4% distance. 1 +*. $2 +sin. cos.. a[-2,-1] c *. $1 +warp.. .,1,1,1 rm. +} +#@cli wind : _amplitude>=0,_angle,0<=_attenuation<=1,_threshold +#@cli : Apply wind effect on selected images. +#@cli : Default values: 'amplitude=20', 'angle=0', 'attenuation=0.7' and 'threshold=20'. +#@cli : $ image.jpg +wind , +wind : check "isint(${1=20}) && $1>=0 && ${3=0.7}>=0 && $3<=1" skip "${2=0},${4=20}" +e[^-1] "Apply wind effect on image$?, with amplitude $1, angle $2 deg., attenuation $3 and threshold $4." +if !$1 return fi +dx,dy,fact:=[cexp([0,$2°]),(1-$3)^(1/$1)] +foreach { ++gradient_norm >=. $4% M:=iM +r. 100%,100%,1,.. *. .. +repeat $1 { +shift. {round($>*[$dx,$dy])} max[0,-1] *. $fact remove_pixels. {100/$1}% } +rm. +} +#@cli zoom : _factor,_cx,_cy,_cz,_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror } +#@cli : Apply zoom factor to selected images. +#@cli : Default values: 'factor=1', 'cx=cy=cz=0.5' and 'boundary_conditions=0'. +#@cli : $ image.jpg +zoom[0] 0.6 +zoom[0] 1.5 +zoom : skip ${1=2},${2=0.5},${3=0.5},${4=0.5},${5=0} +e[^-1] "Apply zoom effect on image$?, with factor $1 and center ($2,$3)." +foreach { +if d==1 +({(w-1)*$2*(1-1/$1)},{(w-1)*($2+(1-$2)/$1)}) +({({-2,h}-1)*$3*(1-1/$1)};{({-2,h}-1)*($3+(1-$3)/$1)}) +r[-2--1] ...,...,1,1,3 a[-2--1] c warp.. .,0,1,$5 +else +({(w-1)*$2*(1-1/$1)},{(w-1)*($2+(1-$2)/$1)}) +({({-2,h}-1)*$3*(1-1/$1)};{({-2,h}-1)*($3+(1-$3)/$1)}) +({({-3,d}-1)*$4*(1-1/$1)}/{({-3,d}-1)*($4+(1-$4)/$1)}) +r[-3--1] [-4],[-4],[-4],1,3 a[-3--1] c warp.. .,0,1,$5 +fi +rm. +} +#@cli :: Degradations +#@cli cracks : 0<=_density<=100,_is_relief={ 0 | 1 },_opacity,_color1,... +#@cli : Draw random cracks on selected images with specified color. +#@cli : Default values: 'density=25', 'is_relief=0', 'opacity=1' and 'color1=0'. +#@cli : $ image.jpg +cracks , +cracks : check "${1=25}>=0" skip ${2=0},${3=1},${4=0} +e[^-1] "Add random cracks to image$?, with density $1, opacity $3 and color (${4--1})." +foreach { +cut:=im,iM +100%,100%,1,2,'u<0.25*($1%)^4?[u,1]:[0,0]' +s. c distance. 1 *. -1 watershed.. . rm. ++dilate. 3 -[-2,-1] !=. 0 +if $2 +f. "i?i:j(1)?2:j(-1)?0.5:i" n. 0,1 ++fc.. ${4--1} *. .. !=.. 0 j... .,0,0,0,0,$3,.. +else ++fc.. ${4--1} j... .,0,0,0,0,$3,.. +fi +k[0] +} +#@cli light_patch : _density>0,_darkness>=0,_lightness>=0 +#@cli : Add light patches to selected images. +#@cli : Default values: 'density=10', 'darkness=0.9' and 'lightness=1.7'. +#@cli : $ image.jpg +light_patch 20,0.9,4 +light_patch : skip ${1=10},${2=0.9},${3=1.7} +e[^-1] "Apply light patches to image$?, with density $1, darkness $2 and lightness $3." +foreach { +n 0,255 $1,$1 noise. 40 ri. ..,5 c. 0,255 +n. $2,$3 * c 0,255 +} +#@cli noise_hurl : _amplitude>=0 +#@cli : Add hurl noise to selected images. +#@cli : Default value: 'amplitude=10'. +#@cli : $ image.jpg +noise_hurl , +noise_hurl : skip ${1=10} +e[^-1] "Add hurl noise to image$?, with amplitude $1%." +foreach { ++f 0 noise. 10 n. {-2,[im,iM]} 100%,100% +noise. $1,2 >. 0 ri. .. +*.. . *. -1 +. 1 *[-3,-1] + +} +#@cli pixelize : _scale_x>0,_scale_y>0,_scale_z>0 +#@cli : Pixelize selected images with specified scales. +#@cli : Default values: 'scale_x=20' and 'scale_y=scale_z=scale_x'. +#@cli : $ image.jpg +pixelize , +pixelize : skip ${1=20},${2=$1},${3=$1} +e[^-1] "Pixelize image$? with scales ($1%,$2%,$3%)." +foreach { whd={w},{h},{d} r $1%,$2%,$3%,100%,2 r $whd } +#@cli scanlines : _amplitude,_bandwidth,_shape={ 0:block | 1:triangle | 2:sine | 3:sine+ | 4:random },_angle,_offset +#@cli : Apply ripple deformation on selected images. +#@cli : Default values: 'amplitude=60', 'bandwidth=2', 'shape=0', 'angle=0' and 'offset=0'. +#@cli : $ image.jpg +scanlines , +scanlines : skip ${1=60},${2=2},${3=0},${4=0},${5=0} +e[^-1] "Apply scanlines effect on image$?, with amplitude $1, bandwidth $2, shape $3, angle $4 deg. and offset $5." +theta:=$4*pi/180 C:=cos($theta) S:=-sin($theta) +foreach { +100%,100%,1,1,"x" -. {w/2} 100%,100%,1,1,'y' +-. {h/2-$5} *.. $S *. $C +[-2,-1] +_ripple$3. $1,$2 +n. {-$1},$1 ++ cut 0,255 +} +#@cli shade_stripes : _frequency>=0,_direction={ 0:horizontal | 1:vertical },_darkness>=0,_lightness>=0 +#@cli : Add shade stripes to selected images. +#@cli : Default values: 'frequency=5', 'direction=1', 'darkness=0.8' and 'lightness=2'. +#@cli : $ image.jpg +shade_stripes 30 +shade_stripes : skip ${1=5},${2=1},${3=0.8},${4=2} +e[^-1] "Add "${arg0\ !$2,vertical,horizontal}" shaded stripes to image$?, with frequency $1, darkness $3 and +lightness $4." +n 0,255 foreach { {max(1,w*($2!=0))},{max(1,h*!$2)} noise. $1,2 ==. 1 distance. 1 ri. .. n. $3,$4 * c 0,255 } +#@cli shadow_patch : _opacity>=0 +#@cli : Add shadow patches to selected images. +#@cli : Default value: 'opacity=0.7'. +#@cli : $ image.jpg +shadow_patch 0.4 +shadow_patch : skip ${1=0.7} +e[^-1] "Apply shadow patches to image$?, with opacity $1." +foreach { +100%,100%,1,1 shift. -2,-2 shift. 1,1 +plasma. 3,0.3,8 abs. b. 1 c. 3%,15% ri. .. +n. $1,1 * +} +#@cli spread : _dx>=0,_dy>=0,_dz>=0 +#@cli : Spread pixel values of selected images randomly along x,y and z. +#@cli : Default values: 'dx=3', 'dy=dx' and 'dz=0'. +#@cli : $ image.jpg +spread 3 +spread : skip ${1=3},${2=$1},${3=0} +e[^-1] "Spread pixel of image$? randomly, with amplitudes ($1,$2,$3)." +foreach { +100%,100%,100%,3 +sh. 0 rand. {-$1},$1 rm. +sh. 1 rand. {-$2},$2 rm. +sh. 2 rand. {-$3},$3 rm. +warp.. .,1,1,1 rm. +} +#@cli stripes_y : _frequency>=0 +#@cli : Add vertical stripes to selected images. +#@cli : Default value: 'frequency=10'. +#@cli : $ image.jpg +stripes_y , +stripes_y : skip ${1=10} +e[^-1] "Add vertical stripes to image$?, with frequency $1." +foreach { 100% noise. $1,2 ==. 1 *. 255 ri. .. *. 0.15 + c 0,255 } +#@cli texturize_canvas : _amplitude>=0,_fibrousness>=0,_emboss_level>=0 +#@cli : Add paint canvas texture to selected images. +#@cli : Default values: 'amplitude=20', 'fibrousness=3' and 'emboss_level=0.6'. +#@cli : $ image.jpg +texturize_canvas , +texturize_canvas : check "${1=20}>=0 && ${2=3}>=0 && ${3=0.6}>=0 && ${4=80}" +e[^-1] "Add canvas texture to image$?, with amplitude $1, fibrousness $2 and emboss level $3." +foreach { +{w},{h} rand. 0,255 +blur_x. $2 blur_y.. $2 +[-2,-1] g. a[-2,-1] c ++compose_channels. + orientation.. compose_channels.. + n.. $3,1 n. 0,255 +sharpen. 80 *[-2,-1] n. -$1,$1 + c 0,255 +} +#@cli texturize_paper +#@cli : Add paper texture to selected images. +#@cli : $ image.jpg +texturize_paper +texturize_paper : +e[^-1] "Add paper texture to image$?." +foreach { +. 30%,30% noise. 1,2 ==. 1 r. ..,..,..,1,0 ifft. +rm. shift. {round(w/2)},{round(h/2)},{round(d/2)},0,2 sharpen. 1 n. 1,1.2 ri. .. +*[-2,-1] c. ..,.. rm.. +} +#@cli vignette : _strength>=0,0<=_radius_min<=100,0<=_radius_max<=100 +#@cli : Add vignette effect to selected images. +#@cli : Default values: 'strength=100', 'radius_min=70' and 'radius_max=90'. +#@cli : $ image.jpg vignette , +vignette : check "${1=100}>=0 && ${2=70}>=0 && $2<=100 && ${3=90}>=0 && $3<=100" +e[^-1] "Add vignette effect to image$?, with strength $1 and size $2." +foreach { +mM:=im,iM d:=max(w,h) +$d,$d =. 1,50%,50% distance. 1 ri. ..,2 +c. $2%,$3% n. 0,$1 - c $mM +} +#@cli watermark_visible : _text,0<_opacity<1,_{ size>0 | font },_angle,_mode={ 0:remove | 1:add },_smoothness>=0 +#@cli : Add or remove a visible watermark on selected images (value range must be [0,255]). +#@cli : Default values: 'text=(c) G'MIC', 'opacity=0.3', 'size=53', 'angle=25', 'mode=1' and 'smoothness=0'. +#@cli : $ image.jpg watermark_visible ,0.7 +watermark_visible : check "inrange(${2=0.3},0,1) && ${6=0.5}>=0" +skip "${1=\251\ G\47MIC}",${3=53},${4=25},${5=1} +e[^-1] ${arg0\ !$5,Add,Remove}" visible watermark '$1' on image$?, with opacity $2, size $3, angle $4 deg." +foreach { +0 t. "$1",0,0,$3,1,255 rotate. $4,0,0 b. $6 n. 0,255 +ri. ..,0,2 +. .. c. 0,255 +if $5 *. $2 *.. {1-$2} + +else *. $2 - / {1-$2} +fi +c 0,255 +} +#@cli :: Blending and Fading +#@cli blend : [layer],blending_mode,_opacity[%],_selection_is={ 0:base-layers | 1:top-layers } : blending_mode,_opacity[%] +#@cli : Blend selected G,GA,RGB or RGBA images by specified layer or blend all selected images together, +#@cli : using specified blending mode. +#@cli : 'blending_mode' can be { add | alpha | and | average | blue | burn | darken | difference | +#@cli : divide | dodge | edges | exclusion | freeze | grainextract | grainmerge | green | hardlight | +#@cli : hardmix | hue | interpolation | lchlightness | lighten | lightness | linearburn | linearlight | luminance | +#@cli : multiply | negation | or | overlay | pinlight | red | reflect | saturation | +#@cli : screen | seamless | seamless_mixed | shapeareamax | shapeareamax0 | shapeareamin | shapeareamin0 | +#@cli : shapeaverage | shapeaverage0 | shapemedian | shapemedian0 | shapemin | shapemin0 | shapemax | shapemax0 | +#@cli : shapeprevalent | softburn | softdodge | softlight | stamp | subtract | value | vividlight | xor }. +#@cli : 'opacity' must be in range '[0,1]' (or '[0%,100%]'). +#@cli : Default values: 'blending_mode=alpha', 'opacity=1' and 'selection_is=0'. +#@cli : $ image.jpg +drop_shadow , resize2dy[-1] 200 rotate[-1] 20 +blend alpha display_rgba[-2] +#@cli : $ image.jpg testimage2d {w},{h} blend overlay +#@cli : $ command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:\" \"${arg{$>+1}},2,2,23,2,1,255 done" image.jpg testimage2d {w},{h} ex add,alpha,and,average,blue,burn,darken +#@cli : $ command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:\" \"${arg{$>+1}},2,2,23,2,1,255 done" image.jpg testimage2d {w},{h} ex difference,divide,dodge,exclusion,freeze,grainextract,grainmerge +#@cli : $ command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:\" \"${arg{$>+1}},2,2,23,2,1,255 done" image.jpg testimage2d {w},{h} ex green,hardlight,hardmix,hue,interpolation,lighten,lightness +#@cli : $ command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:\" \"${arg{$>+1}},2,2,23,2,1,255 done" image.jpg testimage2d {w},{h} ex linearburn,linearlight,luminance,multiply,negation,or,overlay +#@cli : $ command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:\" \"${arg{$>+1}},2,2,23,2,1,255 done" image.jpg testimage2d {w},{h} ex pinlight,red,reflect,saturation,screen,shapeaverage,softburn +#@cli : $ command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:\" \"${arg{$>+1}},2,2,23,2,1,255 done" image.jpg testimage2d {w},{h} ex softdodge,softlight,stamp,subtract,value,vividlight,xor +blend : skip "${1=},${2=},${3=},${4=}" +if !${"is_image_arg $1"} +if ['$1']!=0 mode=$1 else mode=alpha fi +if ['$2']!=0 opacity=$2 else opacity=1 fi +e[0--3] "Blend image$? together, using '"$mode"' mode and opacity "$opacity"." +repeat $!-1 { $0.. .,$mode,$opacity rm. } +return +fi +if ['$2']!=0 mode=$2 else mode=alpha fi +if ['$3']!=0 opacity:=$3 else opacity=1 fi +if ['$4']!=0 selection_mode=$4 else selection_mode=0 fi +if $selection_mode s0,s1=foreground,background else s0,s1=background,foreground fi +e[^-1] "Blend "$s0" image$? with "$s1" image $1, using '"$mode"' mode and opacity "$opacity"." +if !$opacity return fi +pass$1 1 +foreach[^-1] { nm={n} +pass. 0 if $selection_mode rv fi +nb_col_channels,is_alpha_b,is_alpha_f:=max(s#0,s)>=3?3:1,!(s#0%2),!(s%2)||w $nm +} +rm. +_blend_alpha : +_blend_normal : +_blend_and : +&[1] [0] +_blend_add : ++[1] [0] c[1] 0,255 +_blend_average : ++[1] [0] /[1] 2 +_blend_blue : +sh[0] 0,1 j[1] [2] rm[2] +_blend_burn : ++-[0] 255 +[1] 0.1 /[2] [1] rm[1] +[1] 1 *[1] 255 c[1] 0,255 +_blend_darken : +min[1] [0] +_blend_difference : +-[1] [0] abs[1] +_blend_divide : ++[1] 0.1 ^[1] -1 *[1] [0] *[1] 255 c[1] 0,255 +_blend_dodge : +-[1] 255.1 ^[1] -1 *[1] [0] *[1] -255 c[1] 0,255 +_blend_edges : ++blend_edges 0.5 rm[1] +_blend_exclusion : ++*[0,1] /[2] -127.5 +[1,2] +[1] [0] +_blend_freeze : +*[1] -255 -[1] 0.1 +-[0] 255 sqr[2] /[2] [1] rm[1] +[1] 1 *[1] 255 c[1] 0,255 +_blend_grainextract : +-[1] [0] *[1] -1 +[1] 128 c[1] 0,255 +_blend_grainmerge : ++[1] [0] -[1] 128 c[1] 0,255 +_blend_green : +sh[0] 0 sh[0] 2 j[1] [2] j[1] [3],0,0,0,2 rm[2,3] +_blend_hardlight : ++*[0,1] /[2] 127.5 ++[0,1] *[3] 2 -[3] 255 -[3] [2] >[1] 128 +j[2] [3],0,0,0,0,1,[1] rm[1,3] c[1] 0,255 +_blend_hardmix : ++[1] [0] >=[1] 255 *[1] 255 +_blend_hue : +to_color sh 0,2 rgb2hsv[2,3] sh[2] 1,2 j[1] [4],0,0,0,1 rm[4] hsv2rgb[2,3] rm[2,3] +_blend_interpolation : ++*[0] {pi/255} *[1] {pi/255} cos[1,2] +[1,2] -[1] 2 *[1] -63.75 c[1] 0,255 +_blend_lighten : +max[1] [0] +_blend_lightness : +to_color sh 0,2 rgb2lab[2,3] sh[2] 1,2 j[1] [4],0,0,0,1 rm[4] lab2rgb[2,3] rm[2,3] +_blend_lchlightness : +_blend_lightness +_blend_luminance : +to_color sh 0,2 rgb2ycbcr[2,3] sh[2] 1,2 j[1] [4],0,0,0,1 rm[4] ycbcr2rgb[2,3] rm[2,3] +_blend_linearburn : ++[1] [0] -[1] 255 c. 0,255 +_blend_linearlight : +*[1] 2 +[1] [0] -[1] 255 c[1] 0,255 +_blend_multiply : +*[1] [0] /[1] 255 +_blend_negation : ++[1] [0] -[1] 255 abs[1] *[1] -1 +[1] 255 +_blend_or : +-|[1] [0] +_blend_overlay : ++*[0,1] /[2] 127.5 +[1] [0] *[1] 2 -[1] 255 -[1] [2] +<[0] 128 j[1] [2],0,0,0,0,1,[3] rm[2,3] c[1] 0,255 +_blend_pinlight : +*[1] 2 +blend darken -[1] 256 +blend[0,1] lighten >=[1] 0 +j[2] [3],0,0,0,0,1,[1] rm[1,3] +_blend_reflect : +-[1] 255.1 *[1] -1 +sqr[0] /[2] [1] rm[1] c[1] 0,255 +_blend_red : +sh[0] 1,100% j[1] [2],0,0,0,1 rm[2] +_blend_saturation : +to_color sh 0,2 rgb2hsv[2,3] shift[2,3] 0,0,0,-1,2 sh[2] 1,2 j[1] [4],0,0,0,1 rm[4] shift[2,3] 0,0,0,1,2 +hsv2rgb[2,3] rm[2,3] +_blend_screen : ++-[0] 255 -[1] 255 *[1,2] /[1] 255 *[1] -1 +[1] 255 +_blend_shapeareamax : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[1] round[1] 0.01 label[1] 0 ++f[0] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[2] round[2] 0.01 area[2] 0,0 +{1,iM+1},1,1,{0,s+1} +f[1] ">area = i(#2); best = I[#3,i]; if (area>best[size(best) - 1], I[#3,i] = [ I(#0),area ]);i" +rm[2] channels[2] 0,{s-2} map[1] [2] rm[2] +_blend_shapeareamax0 : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I!=0?I+A:I" norm[1] round[1] 0.01 label_fg[1] 0 ++f[0] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[2] round[2] 0.01 area[2] 0,0 +{1,iM+1},1,1,{0,s+1} +f[1] ">area = i(#2); best = I[#3,i]; if (area>best[size(best) - 1], I[#3,i] = [ I(#0),area ]);i" +rm[2] channels[2] 0,{s-2} point[2] 0,0,0,1,0 map[1] [2] rm[2] +_blend_shapeareamin : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[1] round[1] 0.01 label[1] 0 ++f[0] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[2] round[2] 0.01 area[2] 0,0 +{1,iM+1},1,1,{0,s+1},inf +f[1] ">area = i(#2); best = I[#3,i]; if (areaarea = i(#2); best = I[#3,i]; if (areai(#2,i(#1,x,y,z,0),0,0,c)+=i;i" ++histogram[1] {w},0,{w-1} /[-2,-1] map[1] . rm. +_blend_shapeaverage0 : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I!=0?I+A:I" norm[1] round[1] 0.01 label_fg[1] 0 {iM+1},1,1,{0,s} +f[0] ">i(#2,i(#1,x,y,z,0),0,0,c)+=i;i" ++histogram[1] {w},0,{w-1} /[-2,-1] point. 0,0,0,1,0 map[1] . rm. +_blend_shapemedian : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[1] round[1] 0.01 label[1] 0 +N:=iM+1 $N,1,1,{s#0} $N,8,1,{s#0} s. x +f[1] "> +begin(siz = vector"$N"()); +k = i; +k3 = k + 3; +hk3 = h(#k3); +copy(i[#k3,siz[k]++],I(#0),s#0,hk3,whd#0); +if (siz[k]>=hk3,resize(#k3,1,round(1.5*hk3+1),1,s#0,0,0)); +end(repeat (size(siz),k, resize(#k+3,1,siz[k],1,s#0,0,0))); +i" +repeat s#0 { sh[3--1] $> $N,1,1,1,"ic(#"$N"+3+x)" j[2] .,0,0,0,$> rm[-{$N+1}--1] } +map[1] [2] k[0,1] +_blend_shapemedian0 : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I!=0?I+A:I" norm[1] round[1] 0.01 label_fg[1] 0 +N:=iM {$N+1},1,1,{s#0} $N,8,1,{s#0} s. x +f[1] "> +begin(siz = vector"$N"()); +k = i; +if (k, +k1 = k - 1; +k2 = k + 2; +hk2 = h(#k2); +copy(i[#k2,siz[k1]++],I(#0),s#0,hk2,whd#0); +if (siz[k1]>=hk2,resize(#k2,1,round(1.5*hk2+1),1,s#0,0,0)); +); +end(repeat (size(siz),k, resize(#k+3,1,siz[k],1,s#0,0,0))); +i" +repeat s#0 { sh[3--1] $> $N,1,1,1,"ic(#"$N"+3+x)" j[2] .,1,0,0,$> rm[-{$N+1}--1] } +map[1] [2] k[0,1] +_blend_shapemin : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[1] round[1] 0.01 label[1] 0 {iM+1},1,1,{0,s},inf +f[0] ">i(#2,i(#1,x,y,z,0),0,0,c) = min(i(#2,i(#1,x,y,z,0),0,0,c),i);i" +map[1] [2] rm. +_blend_shapemin0 : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I!=0?I+A:I" norm[1] round[1] 0.01 label_fg[1] 0 {iM+1},1,1,{0,s},inf +f[0] ">i(#2,i(#1,x,y,z,0),0,0,c) = min(i(#2,i(#1,x,y,z,0),0,0,c),i);i" +point. 0,0,0,1,0 map[1] [2] rm. +_blend_shapemax : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[1] round[1] 0.01 label[1] 0 {iM+1},1,1,{0,s},-inf +f[0] ">i(#2,i(#1,x,y,z,0),0,0,c) = max(i(#2,i(#1,x,y,z,0),0,0,c),i);i" +map[1] [2] rm. +_blend_shapemax0 : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I!=0?I+A:I" norm[1] round[1] 0.01 label_fg[1] 0 {iM+1},1,1,{0,s},-inf +f[0] ">i(#2,i(#1,x,y,z,0),0,0,c) = max(i(#2,i(#1,x,y,z,0),0,0,c),i);i" +point. 0,0,0,1,0 map[1] [2] rm. +_blend_shapeprevalent : +label. 0,0 nb_labels:=iM+1 a c ++n. 0,255 100%,100%,1,1,"H = 0; repeat (s#-1,p,(H*=31)+=j(#-1,0,0,0,p)); int(H)%2048" rm.. # Compute color hashcodes +1,1,1,{0,s+1}x2048 +eval[1] "begin(_color = tmp = vector(#s#0)); +color = I(#0); +ind = i + 2; +whdind = whd(#ind); +found = 0; +repeat (da_size(#ind),k, +copy(_color,i(#ind,0,k,0,1),s#0,1,whdind); +_color==color?( +found = 1; +copy(tmp,i[#ind,0],s#ind,1,whdind); +copy(i[#ind,0],i[#ind,k],s#ind,whdind,whdind); +copy(i[#ind,k],tmp,s#ind,whdind,1); +break(); +); +); +found?++i[#ind,k]:da_push(#ind,[ 1,color ])" +da_freeze[2--1] a[2--1] y rm.. +1,$nb_labels,1,{0,s} +eval.. "P = I; region = P[size(P) - 1]; i[#-1,region][1] 255 +j[2] [3],0,0,0,0,1,[1] rm[1,3] c[1] 0,255 +_blend_softdodge : ++-[1] 255.1 ^[2] -1 *[2] [0] *[2] -127.5 +-[1] 255 ++[0] 0.1 /[3,4] *[3] 127.5 +[3] 255 +[1] [0] >[1] 255 +j[2] [3],0,0,0,0,1,[1] rm[1,3] c[1] 0,255 +_blend_softlight : ++/[0] 255 /[1] 255 +sqr. *[2] [1] *[1] [3] *[1] -2 *[2] 2 +[1-3] *[1] 255 c[1] 0,255 +_blend_stamp : +*[1] 2 +[1] [0] -[1] 255 c[1] 0,255 +_blend_subtract : +-[1] [0] *[1] -1 c[1] 0,255 +_blend_value : +to_color sh 0,2 rgb2hsv[2,3] sh[2] 0,1 j[1] [4] rm[4] hsv2rgb[2,3] rm[2,3] +_blend_vividlight : +*[1] 2 +blend burn -[1] 256 +blend[0,1] dodge >=[1] 0 +j[2] [3],0,0,0,0,1,[1] rm[1,3] +_blend_xor : +xor[1] [0] +#@cli blend_edges : smoothness[%]>=0 +#@cli : Blend selected images togethers using 'edges' mode. +#@cli : $ image.jpg testimage2d {w},{h} +blend_edges 0.8 +blend_edges : check {$1>=0} +e[^-1] "Blend image$? using 'edges' mode, with smoothness $1." +if $!>1 +to_rgb ri[^0] [0],0,0,0.5,0.5 +foreach { +gradient_norm +. 1 b. $1 n. 1,10 sqr. s.. c *[-4--2] . a[-4--1] c } +ri[^0] [0],0,0,0.5,0.5 + s. c /[-4--2] . rm. a[-3--1] c +fi +#@cli blend_fade : [fading_shape] +#@cli : Blend selected images together using specified fading shape. +#@cli : $ image.jpg testimage2d {w},{h} 100%,100%,1,1,'cos(y/10)' normalize[-1] 0,1 +blend_fade[0,1] [2] +blend_fade : +e[^-1] "Blend image$? together using fading pattern $1." +r ${-max_whds},0 +pass$1 0 r. [0],[0],[0],100%,1 max. 0 min. {$!-2} +repeat $!-1 { +-. $> abs. -. 1 *. -1 max. 0 *[$>,-1] } rm. ++ +_fade : +ri.. ...,5 ri. ..,3 c. $1%,$2% n. 0,1 j... ..,0,0,0,0,1,. rm[-2,-1] +#@cli blend_median +#@cli : Blend selected images together using 'median' mode. +#@cli : $ image.jpg testimage2d {w},{h} +mirror[0] y +blend_median +blend_median : +e[^-1] "Blend image$? using 'median' mode." +if $!<2 return fi +to_colormode 0 r ${-max_whd},100%,0,0,0.5,0.5,0.5 +if $!==2 + / 2 +else +whds={w},{h},{d},{s} r 100%,100%,{d*s},1,-1 a c +100%,100%,100%,1,"med(I(#0))" k. r $whds,-1 +fi +#@cli blend_seamless : _is_mixed_mode={ 0 | 1 },_inner_fading[%]>=0,_outer_fading[%]>=0 +#@cli : Blend selected images using a seamless blending mode (Poisson-based). +#@cli : Default values: 'is_mixed=0', 'inner_fading=0' and 'outer_fading=100%'. +blend_seamless : check "${2=0}>=0 && ${3=100%}>=0" skip ${1=0} +s0="non-mixed" s1="mixed" +e[^-1] "Blend image$? using seamless mode (Poisson-based), in "${s{$1!=0}}" mode with inner fading $2 and +outer fading $3." +to_a[^0] +if ['$3']!='100%' +repeat $!-1 { l[0,1] { ++blend_seamless $1,$2,100% channels.. 100% !=.. 0 distance.. 1 +iM={-2,iM} ic:=ispercentage($3)?2*$3*$iM:1+$3 +if $ic<=$iM c.. 0,{max(1,$ic)} n.. 0,1 +else n.. 0,{max(0,2-$ic/$iM)} +fi +*.. -1 +.. 1 +j[0] [2],0,0,0,0,1,[1] rm[1,2] +} } +else +repeat $!-1 { l[0,1] { ++r[0] 1,1,1,100%,2 avg={^} rm. +split_opacity. !=. 0 *.. . erode. 3 +g[0,1] xy,1,2 +*[-3,-2] . +if $1 ++a[0,1] c +a[2,3] c norm[-2,-1] +<[-2,-1] *[-2,-1] +fi +if $2 +distance. 0 +iM:=iM ic:=ispercentage($2)?2*$2*$iM:1+$2 +if $ic<=$iM c. 0,{max(1,$ic)} n. 0,1 +else n. 0,{max(0,2-$ic/$iM)} +fi +fi +j[-5] ...,0,0,0,0,1,. +j[-4] ..,0,0,0,0,1,. +rm[-3--1] +g[0] x,-1,2 g[1] y,-1,2 + +ilaplacian 0 ++fc. $avg ++[-2,-1] +c 0,255 +} } +fi +#@cli fade_diamond : 0<=_start<=100,0<=_end<=100 +#@cli : Create diamond fading from selected images. +#@cli : Default values: 'start=80' and 'end=90'. +#@cli : $ image.jpg testimage2d {w},{h} +fade_diamond 80,85 +fade_diamond : skip ${1=70},${2=90} +e[^-1] "Create ($1%,$2%) diamond-shaped fading from image$?." +repeat int($!/2) { l[$>,{$>+1}] { +(0,1,0;1,1,1;0,1,0) _fade $1,$2 +} } +#@cli fade_linear : _angle,0<=_start<=100,0<=_end<=100 +#@cli : Create linear fading from selected images. +#@cli : Default values: 'angle=45', 'start=30' and 'end=70'. +#@cli : $ image.jpg testimage2d {w},{h} +fade_linear 45,48,52 +fade_linear : skip ${1=45},${2=30},${3=70} +e[^-1] "Create ($2%,$3%) linear fading from image$?, with angle $1 deg." +repeat int($!/2) { l[$>,{$>+1}] { +64,64,1,1,"x*cos($1*pi/180) + y*sin($1*pi/180)" _fade $2,$3 +} } +#@cli fade_radial : 0<=_start<=100,0<=_end<=100 +#@cli : Create radial fading from selected images. +#@cli : Default values: 'start=30' and 'end=70'. +#@cli : $ image.jpg testimage2d {w},{h} +fade_radial 30,70 +fade_radial : skip ${1=30},${2=70} +e[^-1] "Create ($1%,$2%) radial fading from image$?." +repeat int($!/2) { l[$>,{$>+1}] { +100%,100% =. 1,50%,50% distance. 1 _fade $1,$2 +} } +#@cli fade_x : 0<=_start<=100,0<=_end<=100 +#@cli : Create horizontal fading from selected images. +#@cli : Default values: 'start=30' and 'end=70'. +#@cli : $ image.jpg testimage2d {w},{h} +fade_x 30,70 +fade_x : skip ${1=30},${2=70} +e[^-1] "Create ($1%,$2%) horizontal fading from image$?." +repeat int($!/2) { l[$>,{$>+1}] { (0,1) _fade $1,$2 } } +#@cli fade_y : 0<=_start<=100,0<=_end<=100 +#@cli : Create vertical fading from selected images. +#@cli : Default values: 'start=30' and 'end=70'. +#@cli : $ image.jpg testimage2d {w},{h} +fade_y 30,70 +fade_y : skip ${1=30},${2=70} +e[^-1] "Create ($1%,$2%) vertical fading from image$?." +repeat int($!/2) { l[$>,{$>+1}] { (0;1) _fade $1,$2 } } +#@cli fade_z : 0<=_start<=100,0<=_end<=100 +#@cli : Create transversal fading from selected images. +#@cli : Default values: 'start=30' and 'end=70'. +fade_z : skip ${1=30},${2=70} +e[^-1] "Create ($1%,$2%) transversal fading from image$?." +repeat int($!/2) { l[$>,{$>+1}] { (0/1) _fade $1,$2 } } +#@cli sub_alpha : [base_image],0<=_minimize_alpha<=1 +#@cli : Compute the alpha-channel difference (opposite of alpha blending) between the selected images +#@cli : and the specified base image. +#@cli : The alpha difference A-B is defined as the image having 'minimal' opacity, such that alpha_blend(B,A-B) = A. +#@cli : The 'min_alpha' argument is used to relax the alpha minimality constraint. When set to '1', alpha is constrained to be minimal. When set to '0', alpha is maximal (i.e. '255'). +#@cli : Default value: 'minimize_alpha=1'. +#@cli : $ image.jpg testimage2d {w},{h} +sub_alpha[0] [1] display_rgba +sub_alpha : check ${"is_image_arg $1"}" && inrange(${2=1},0,1)" +e[^-1] "Compute minimal alpha-channel difference between image$? and base image $1, ""with alpha minimization factor $2." +remove_opacity +pass$1 +foreach[^-1] { +nm={n} pass. rv +100%,100%,1,{s+1},"begin(null = vector(#s,0); I_b = vector(#s#0)); +I_a = I(#0); +I_c = I(#1); +I_c==I_a?null:( +dI_ac = I_a - I_c; +fill(I_b,k,I_c[k]>I_a[k]?lerp(I_c[k],255,$2):lerp(I_c[k],0,$2)); +alpha_b = max(dI_ac/(I_a - I_b)); +I_b = I_a - dI_ac/alpha_b; +cut([ I_b,alpha_b*255 ],0,255) +)" +k. => $nm +} +rm. +#@cli :: Image Sequences and Videos +#@cli animate : filter_name,"param1_start,...,paramN_start","param1_end,...,paramN_end",nb_frames>=0,_output_frames={ 0 | 1 },_output_filename : delay>0,_back and forth={ 0 | 1 } +#@cli : Animate filter from starting parameters to ending parameters or animate selected images +#@cli : in a display window. +#@cli : Default value: 'delay=30'. +#@cli : $ image.jpg animate flower,"0,3","20,8",9 +animate : skip ${1=30},${2=0},${3=""},${4=10},${5=1},"${6=}" +if "isnum($1)" +e[0--3] "Animate image$?, with a delay of $1 ms"${"if $2 u \", in back-and-forth mode\" else u \"\" fi"}. +if !$! return fi +speed,pause,direction,scale,frame=$1,-1,1,1,0 +is_same_size={"res = 1; s = [ w#0,h#0 ]; for (k = 1, k=0 direction=$pause pause=-1 +else pause=$direction direction=0 fi +wait -1 +fi +while {*}" && "!{*,Q}" && "!{*,ESC} w 0 +else +e[0--3] "Compute animated version of filter '$1', from parameters $2 to $3 with $4 frames." +if !($5||narg("$6")) return fi +($2) ($3) y[-2,-1] x a[-2,-1] y r. 100%,$4,1,1,3 mv. 0 rprogress 0 +repeat $!-1 { +u=$> +e " > Animate image ["$>"]" +repeat $4 { +l[0,1] { +-$1. {0,@{$>*{0,w}}-{($>+1)*{0,w}-1}} rm[0] +if narg("$6") o ${filename\ "$6",$u,$>} fi +if !$5 rm fi +rprogress {100*($>+1)/$4} +e "\r > Animate image ["$u"] : Frame "{$>+1}"/$4 " +} } +rm[1] +} +rm[0] +fi +#@cli apply_camera : _"command",_camera_index>=0,_skip_frames>=0,_output_filename +#@cli : Apply specified command on live camera stream, and display it on display window [0]. +#@cli : This command requires features from the OpenCV library (not enabled in G'MIC by default). +#@cli : Default values: 'command=""', 'camera_index=0' (default camera), 'skip_frames=0' and 'output_filename=""'. +apply_camera : check_opencv $0 skip "${1=},${4=}" check "${2=0}>=0 && ${3=0}>=0" +e[^-1] "Apply command '$1' on camera stream ""#$2, with $3 frames skip and output filename '$4'." +m "_apply_camera_com : $1" +is_ext "$4",avi is_outavi=${} +is_ext "$4",mp4 is_outmp4=${} +is_fs=0 +l[] { +i=0 +do +camera $2,1,$3 +_apply_camera_com. +if !$! 640,480,1,3 else k. fi +if {*}" && "[w,h]!=[{*,d,e}] ++r2din. {*,d,e},1,0,0.5,0.5 r. {*,d,e},1,100%,0,0,0.5,0.5 +else . +fi +w. -1,-1,"[G'MIC] Camera ""#$2 ("{0,w}x{0,h}")" +k[0] +if narg("$4") +if $is_outavi||$is_outmp4 z. 0,{w-(w%8)-1} o. "$4",25,mp4v,1 +else o. ${filename\ "$4",$i} i+=1 +fi +fi +if {*,S} o. gmic_camera.png fi +is_ctrl:={*,CTRLLEFT}" || "{*,CTRLRIGHT} +if !$is_fs" && "$is_ctrl" && "{*,-D} w[] {{*,w}*1.5},{{*,h}*1.5} fi +if !$is_fs" && "$is_ctrl" && "{*,-C} w[] {{*,w}/1.5},{{*,h}/1.5} fi +if $is_ctrl" && "{*,-F} +if !$is_fs fs_wh={*,w,h} w[] {*,u,v},1,1 is_fs=1 +else w[] $fs_wh,1,0 is_fs=0 +fi +fi +if $is_ctrl" && "{*,-R} w[] {0,w},{0,h},1,0 is_fs=0 fi +rm +while {*}" && "!{*,ESC}" && "!{*,Q} +camera $2,0 +} +#@cli apply_files : "filename_pattern",_"command",_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1,_output_filename +#@cli : Apply a G'MIC command on specified input image files, in a streamed way. +#@cli : If a display window is opened, rendered frames are displayed in it during processing. +#@cli : The output filename may have extension '.avi' or '.mp4' (saved as a video), or any other usual image file +#@cli : extension (saved as a sequence of images). +#@cli : Default values: 'command=(undefined)', 'first_frame=0', 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'. +apply_files : check "isint(${3=0}) && $3>=0 && isint(${4=-1}) && ($4>=0 || $4==-1) && ${5=1}>=1" skip "${2=},${6=}" +e[^-1] "Apply command '$2' on input image files '$1', with first frame $3, last frame $4, frame step $5 and +output filename '$6'.\n" +files 3,"$1" _N=/{narg(${})-1} arg2var _file,${} v + _apply_stream[] "${_file{$frame+1}}","$2",${3-5},"$6" +#@cli apply_video : video_filename,_"command",_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1,_output_filename +#@cli : Apply a G'MIC command on all frames of the specified input video file, in a streamed way. +#@cli : If a display window is opened, rendered frames are displayed in it during processing. +#@cli : The output filename may have extension '.avi' or '.mp4' (saved as a video), or any other usual image +#@cli : file extension (saved as a sequence of images). +#@cli : This command requires features from the OpenCV library (not enabled in G'MIC by default). +#@cli : Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'. +apply_video : check_opencv $0 check "isint(${3=0}) && $3>=0 && isint(${4=-1}) && ($4>=0 || $4==-1) && ${5=1}>=1" +skip "${2=},${6=}" +e[^-1] "Apply command '$2' on input video file '$1', with first frame $3, last frame $4, frame step $5 and +output filename '$6'.\n" +_N= v + _apply_stream[] "\"$1\",$frame","$2",${3-5},"$6" +_apply_stream : skip "${2=},${6=}" +is_ext "$6",avi is_outavi=${} +is_ext "$6",mp4 is_outmp4=${} +frame=$3 i=0 go_on=1 +do +l[] { $1 onfail go_on=0 } +if $go_on +e "\r > Frame ""#"$frame$_N" " +frame+=$5 +l { $2 onfail error[0--5] "Command 'apply_stream': Specified command errored: "${} } +if !$! continue fi +if narg("$6") +if $is_outavi||$is_outmp4 z. 0,{w-(w%8)-1} o. "$6",25,mp4v,1 else o. ${filename\ "$6",$i} i+=1 fi +fi +if {*} +title="[G'MIC] Frame ""#"$frame +if !narg($wh) wh=${fitscreen[]\ {[w,h]}} w. $wh,0,$title +else w. -1,-1,0,$title +fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,D} w[] {{*,w}*1.5},{{*,h}*1.5} wait -1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,C} w[] {{*,w}/1.5},{{*,h}/1.5} wait -1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,R} w[] {0,w},{0,h} wait -1 fi +fi +rm. +fi +while $go_on" && "($4==-1" || "$frame<=$4) +if $is_outavi||$is_outmp4 o[] "$6",25,mp4v,0 fi +#@cli average_files : "filename_pattern",_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1,_output_filename +#@cli : Average specified input image files, in a streamed way. +#@cli : If a display window is opened, rendered frames are displayed in it during processing. +#@cli : The output filename may have extension '.avi' or '.mp4' (saved as a video), or any other usual image +#@cli : file extension (saved as a sequence of images). +#@cli : Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'. +average_files : check "isint(${2=0}) && $2>=0 && isint(${3=-1}) && ($3>=0 || $3==-1) && ${4=1}>=1" skip "${5=}" +e[^-1] "Average input image files '$1', with first frame $2, last frame $3, frame step $4 and +output filename '$5'.\n" +files 3,"$1" _N=/{narg(${})-1} arg2var _file,${} v + _average_stream[] "${_file{$frame+1}}",${2-4},"$5" +#@cli average_video : video_filename,_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1,_output_filename +#@cli : Average frames of specified input video file, in a streamed way. +#@cli : If a display window is opened, rendered frames are displayed in it during processing. +#@cli : The output filename may have extension '.avi' or '.mp4' (saved as a video), or any other usual image +#@cli : file extension (saved as a sequence of images). +#@cli : This command requires features from the OpenCV library (not enabled in G'MIC by default). +#@cli : Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'. +average_video : check_opencv $0 check "isint(${2=0}) && $2>=0 && isint(${3=-1}) && ($3>=0 || $3==-1) && ${4=1}>=1" +skip "${5=}" +e[^-1] "Average frames of input video file '$1', with first frame $2, last frame $3, frame step $4 and +output filename '$5'.\n" +_N= v + _average_stream[] "\"$1\",$frame",${2-4},"$5" +_average_stream : skip "${5=}" +is_ext "$5",avi is_outavi=${} +is_ext "$5",mp4 is_outmp4=${} +frame=$2 i=0 go_on=1 N=0 +imM=inf,-inf +do +l[] { $1 onfail go_on=0 } +if $go_on +e "\r > Frame ""#"$frame$_N" " +imM:=v=[$imM];[min(im,v[0]),max(iM,v[1])] +N+=1 +if $!>1 r ${-max_whds} + fi +if narg("$5") ++/. $N c. $imM +if $is_outavi||$is_outmp4 z. 0,{w-(w%8)-1} o. "$5",25,mp4v,1 else o. ${filename\ "$5",$i} i+=1 fi +rm. +fi +if {*} +title="[G'MIC] Frame ""#"$frame ++n 0,255 +if !narg($wh) wh=${fitscreen[]\ {[w,h]}} w. $wh,0,$title +else w. -1,-1,0,$title +fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,D} w[] {{*,w}*1.5},{{*,h}*1.5} wait -1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,C} w[] {{*,w}/1.5},{{*,h}/1.5} wait -1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,R} w[] {0,w},{0,h} wait -1 fi +rm. +fi +frame+=$4 +fi +while $go_on" && "($3==-1" || "$frame<=$3) +/ $N c $imM +if $is_outavi||$is_outmp4 o[] "$5",25,mp4v,0 fi +#@cli fade_files : "filename_pattern",_nb_inner_frames>0,_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1,_output_filename +#@cli : Generate a temporal fading from specified input image files, in a streamed way. +#@cli : If a display window is opened, rendered frames are displayed in it during processing. +#@cli : The output filename may have extension 'avi' or 'mp4' (saved as a video), or any other usual image +#@cli : file extension (saved as a sequence of images). +#@cli : Default values: 'nb_inner_frames=10', 'first_frame=0', 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'. +fade_files : check "isint(${2=10}) && $2>0 && isint(${3=0}) && $3>=0 && +isint(${4=-1}) && ($4>=0 || $4==-1) && ${5=1}>=1" skip "${6=}" +e[^-1] "Fade input image files '$1', with $2 inner frames, first frame $3, last frame $4, frame step $5 and +output filename '$6'.\n" +files 3,"$1" _N=/{narg(${})-1} arg2var _file,${} v + _fade_stream[] "${_file{$frame+1}}",${2-5},"$6" +#@cli fade_video : video_filename,_nb_inner_frames>0,_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1,_output_filename +#@cli : Create a temporal fading sequence from specified input video file, in a streamed way. +#@cli : If a display window is opened, rendered frames are displayed in it during processing. +#@cli : This command requires features from the OpenCV library (not enabled in G'MIC by default). +#@cli : Default values: 'nb_inner_frames=10', 'first_frame=0', 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'. +fade_video : check_opencv $0 check "isint(${2=10}) && $2>0 && isint(${3=0}) && $3>=0 && +isint(${4=-1}) && ($4>=0 || $4==-1) && ${5=1}>=1" skip "${6=}" +e[^-1] "Fade frames of input video file '$1', with $2 inner frames, first frame $3, last frame $4, frame step $5 and +output filename '$6'.\n" +_N= v + _fade_stream[] "\"$1\",$frame",${2-5},"$6" +_fade_stream : skip "${6=}" +is_ext "$6",avi is_outavi=${} +is_ext "$6",mp4 is_outmp4=${} +frame=$3 i=0 go_on=1 +l { $1 onfail go_on=0 } +if !$go_on return fi +w,h,s={w},{h},{s} +if {*} w. ${fitscreen\ $w,$h},0,"[G'MIC]" fi +pframe=$frame frame+=$5 +do +l[] { $1 onfail go_on=0 } +if !$go_on break fi +to_colormode. $s r. $w,$h +repeat $2+2 { +if $< +title="[G'MIC] Frame ""#"$pframe" -> ""#"$frame$_N" ("{1+$>}/$2")" +e "\r - "$title ++j[0] [1],0,0,0,0,{$>/($2+1)} +if narg("$6") +if $is_outavi||$is_outmp4 z. 0,{w-(w%8)-1} o. "$6",25,mp4v,1 else filename "$6",$i i+=1 o. ${} fi +fi +if {*} +w. -1,-1,0,$title +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,D} w[] {{*,w}*1.5},{{*,h}*1.5} wait -1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,C} w[] {{*,w}/1.5},{{*,h}/1.5} wait -1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,R} w[] {0,w},{0,h} wait -1 fi +fi +rm. +fi +} +rm[0] pframe=$frame frame+=$5 +while $go_on" && "($4==-1" || "$frame<=$4) +if narg("$6") +if $is_outavi||$is_outmp4 z. 0,{w-(w%8)-1} o[] "$6",25,mp4v,0 else filename "$6",$i o. ${} fi +fi +rm +#@cli files2video : "filename_pattern",_output_filename,_fps>0,_codec +#@cli : Convert several files into a single video file. +#@cli : Default values: 'output_filename=output.mp4', 'fps=25' and 'codec=mp4v'. +files2video : check "isint(${3=25}) && $3>0" skip "${2=output.mp4}",${4=mp4v} +files=${"files \"$1\""} arg2var _file,$files nb_files=${} +('$files') if w>128 z. 0,127 s_files={t}... else s_files=$files fi rm. +e[^-1] "Convert image files '"$s_files"' into frames of output video '$2', with $3 fps and $4 codec.\n" +repeat $nb_files { l[] { +file=${_file{$>+1}} +_file=${basename\ $file} +e "\r - Image "{1+$>}/$nb_files" ["$_file"] -> [$2] " +i $file o "$2",$3,$4,1 +rm +onfail e "\n - Error occurred on input file '"$file"'.\n" +} } +o $"$2",0,0,0 +#@cli median_files : "filename_pattern",_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1,_frame_rows[%]>=1,_is_fast_approximation={ 0 | 1 } +#@cli : Compute the median frame of specified input image files, in a streamed way. +#@cli : If a display window is opened, rendered frame is displayed in it during processing. +#@cli : Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1', 'frame_rows=20%' and 'is_fast_approximation=0'. +median_files : check "isint(${2=0}) && $2>=0 && isint(${3=-1}) && ($3>=0 || $3==-1) && +${4=1}>=1 && ${5=20%}>0 && isnum(${6=0})" +s0="fast" s1="precise" +e[^-1] "Compute median of input image files '$1', with first frame $2, last frame $3, frame step $4, +frame rows $5, using "${s{!$6}}" algorithm." +files 3,"$1" _N=/{narg(${})-1} arg2var _file,${} +l[] { +${_file{$frame+1}} => res f. 0 +v + _median_stream "${_file{$frame+1}}",${2-6} v - +} +#@cli median_video : video_filename,_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1,_frame_rows[%]>=1,_is_fast_approximation={ 0 | 1 } +#@cli : Compute the median of all frames of an input video file, in a streamed way. +#@cli : If a display window is opened, rendered frame is displayed in it during processing. +#@cli : This command requires features from the OpenCV library (not enabled in G'MIC by default). +#@cli : Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1', 'frame_rows=100%' and 'is_fast_approximation=1'. +median_video : check_opencv $0 check "isint(${2=0}) && $2>=0 && isint(${3=-1}) && ($3>=0 || $3==-1) && +${4=1}>=1 && ${5=100%}>0 && isnum(${6=1})" +s0="fast" s1="precise" +e[^-1] "Compute median frame of input video file '$1', with first frame $2, last frame $3, frame step $4, +frame rows $5, using "${s{!$6}}" algorithm." +_N= +l[] { +"$1",0 => res f. 0 +v + _median_stream "\"$1\",$frame",${2-6} v - +} +_median_stream : +if $6 +e "- Retrieve min/max values of all frames.\n" +frame=$2 go_on=1 +imM=inf,-inf +do +l[] { $1 onfail go_on=0 } +if $go_on +e "\r > Frame ""#"$frame$_N" " +imM:=v=[$imM];[min(im,v[0]),max(iM,v[1])] +if {*} +title="[G'MIC] Frame ""#"$frame +if !narg($wh) wh=${fitscreen[]\ {[w,h]}} w. $wh,1,$title +else w. -1,-1,1,$title +fi +fi +rm. +frame+=$4 +fi +while $go_on" && "($3==-1" || "$frame<=$3) +_N=/{$frame-$4} +fact:=v=[$imM];dv=v[1]-v[0];dv<=0?0:255/dv +fi +h1:=h-1 drows:=round(ispercentage($5)?$5*h:$5) +nb_iter:=round(h/$drows,1,1) +repeat $nb_iter { +row0:=$drows*$> row1={0,min(h,$row0+$drows-1)} +e "- Iteration \#"{$>+1}/$nb_iter": Load rows "$row0-$row1/$h1".\n" +frame=$2 go_on=1 +if $6 +N=0 +{w},$drows,256,{s} => hist +do +l[] { $1 => img onfail go_on=0 } +if $img +e "\r > Frame ""#"$frame$_N" " +if {*}" && "!$> +title="[G'MIC] Frame ""#"$frame +if !narg($wh) wh=${fitscreen[]\ {img,[w,h]}} w[img] $wh,1,$title +else w[img] -1,-1,1,$title +fi +fi +rows[img] $row0,$row1 f[img] ":++i(#-2,x,y,round(i*"$fact"),c)" +rm[img] +frame+=$4 N+=1 +fi +while $go_on" && "($3==-1" || "$frame<=$3) +cumulate[hist] z +N2:=int($N/2) +[hist],[hist],1,[hist] +if $N%2 +f. ":go_on = 1; for (z = 0, i(#"$hist",x,y,z,c)<"$N2" && z<256, ++z); z" +else +f. ":begin(N2p = "$N2"; N2n = N2p + 1); +go_on = 1; +for (zp = 0, i(#"$hist",x,y,zp,c) img onfail go_on=0 } +if $go_on +e "\r > Frame ""#"$frame$_N" " +if {*}" && "!$> +title="[G'MIC] Frame ""#"$frame +if !narg($wh) wh=${fitscreen[]\ {[w,h]}} w. $wh,1,$title +else w. -1,-1,1,$title +fi +fi +rows. $row0,$row1 +frame+=$4 +fi +while $go_on" && "($3==-1" || "$frame<=$3) +e "\r > Compute median blending of "$!" frames." +__median_stream +} +fi +_N=/{$frame-$4} +j[res] .,0,$row0 +if {*} w[res] -1,-1,1,"[G'MIC] Iteration ""#"$> fi +rm. +} +e "- Done!" +__median_stream : +if $!<2 return +elif $!==2 + / 2 +else +f. ": +stack = vector"{0,2*$!}"(); +stacksize = 0; +push(elt0,elt1) = (stack[stacksize++] = elt0; stack[stacksize++] = elt1); +pop() = (_s1 = stack[--stacksize]; _s0 = stack[--stacksize]; [_s0,_s1]); +push(0,"$!" - 1); +while (stacksize>0, +range = pop(); +lo = range[0]; +hi = range[1]; +pivot = i(#int((lo + hi)/2)); +while (lo<=hi, +while (i(#lo)=1,_smoothness>=0,_precision>=0 +#@cli : Create morphing sequence between selected images. +#@cli : Default values: 'smoothness=0.1' and 'precision=4'. +#@cli : $ image.jpg +rotate 20,1,1,50%,50% morph 9 +morph : check "$1>=0.5 && ${2=0.1}>=0 && ${3=4}>=0" +nbf:=round($1) +e[^-1] "Create morphing sequence between image$?, with "$nbf" inner frames, smoothness $2 and precision $3.\n" +nchan=${-max_s} if $nchan<=4 to_colormode $nchan else channels 0,{$nchan-1} fi +ri[^0] [0],3 +repeat $!-1 { +nm={$>,n} +l[$<,{$<+1}] { +e "\r > Morph image "$>" to image "{$>+1}". " ++equalize[0,1] n[-2,-1] 0,255 ++displacement[3] [2],$2,$3 +displacement[2] [3],$2,$3 rm[-4,-3] +repeat $nbf+2 { +if $>&&$< +t:=$>/($nbf+1) omt:=1-$t ++*[2] $t +warp[0] .,1,1,1 rm.. *. $omt ++*[3] {1-$t} +warp[1] .,1,1,1 rm.. *. $t ++[-2,-1] +fi +} +rm[2,3] mv[2--1] 1 =>[^] $nm +} +} +#@cli morph_files : "filename_pattern",_nb_inner_frames>0,_smoothness>=0,_precision>=0,_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1,_output_filename +#@cli : Generate a temporal morphing from specified input image files, in a streamed way. +#@cli : If a display window is opened, rendered frames are displayed in it during processing. +#@cli : The output filename may have extension '.avi' or '.mp4' (saved as a video), or any other usual image +#@cli : file extension (saved as a sequence of images). +#@cli : Default values: 'nb_inner_frames=10', 'smoothness=0.1', 'precision=4', 'first_frame=0', 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'. +morph_files : check "isint(${2=10}) && $2>0 && ${3=0.1}>=0 && ${4=4}>=0 && +isint(${5=0}) && $5>=0 && isint(${6=-1}) && ($6>=0 || $6==-1) && ${7=1}>=1" skip "${8=}" +e[^-1] "Morph input image files '$1', with $2 inner frames, smoothness $3, precision $4, first frame $5, +last frame $6, frame step $7 and output filename '$8'.\n" +files 3,"$1" _N=/{narg(${})-1} arg2var _file,${} _morph_stream[] "${_file{$frame+1}}",${2-7},"$8" +#@cli morph_rbf : nb_inner_frames>=1,xs0[%],ys0[%],xt0[%],yt0[%],...,xsN[%],ysN[%],xtN[%],ytN[%] +#@cli : Create morphing sequence between selected images, using RBF-based interpolation. +#@cli : Each argument (xsk,ysk)-(xtk,ytk) corresponds to the coordinates of a keypoint +#@cli : respectively on the source and target images. The set of all keypoints define the overall image deformation. +morph_rbf : check "$1>=0.5" +nbf:=round($1) +e[^-1] "Create morphing sequence between image$? using RBF interpolation, ""with "$nbf" inner frames and keypoints ($*)." +$=arg N:=($#-1)/4 +if int($N)!=$N error[0--2] "Command 'morph_rbf': Wrong number of arguments ($#)." fi +ri[^0] [0],3 +repeat $!-1 { nm={$>,n} l[$<,{$<+1}] { +e "\r > Morph image "$>" to image "{$>+1}". " +4,$N +repeat wh { a=${arg{2+$>}} isp:=ispercentage($a) eval i[$>]=$isp?($>%2?w#0:h#0)*$a:$a } +permute. yzcx ++f. "[i0,i1,i2-i0,i3-i1]" +f.. "[i2,i3,i0-i2,i1-i3]" +rbf[-2,-1] {0,[w,h]} +repeat $nbf+2 { +if $>&&$< +[0],[0],1,[0]," +const interpolation = 1; +const boundary = 3; +const t = "$>"/("$nbf"+1); +const omt = 1 - t; +begin(print([t,omt])); +ub = i(#2,x,y,0,0); +vb = i(#2,x,y,0,1); +uf = i(#3,x,y,0,0); +vf = i(#3,x,y,0,1); +omt*I(#0,x - t*uf,y - t*vf) + t*I(#1,x - omt*ub,y - omt*vb)" +fi +} +rm[2,3] mv[2--1] 1 =>[^] $nm +} } +#@cli morph_video : video_filename,_nb_inner_frames>0,_smoothness>=0,_precision>=0,_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1,_output_filename +#@cli : Generate a temporal morphing from specified input video file, in a streamed way. +#@cli : If a display window is opened, rendered frames are displayed in it during processing. +#@cli : The output filename may have extension '.avi' or '.mp4' (saved as a video), or any other usual image +#@cli : file extension (saved as a sequence of images). +#@cli : This command requires features from the OpenCV library (not enabled in G'MIC by default). +#@cli : Default values: 'nb_inner_frames=10', 'smoothness=0.1', 'precision=4', 'first_frame=0', 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'. +morph_video : check_opencv $0 check "isint(${2=10}) && $2>0 && ${3=0.1}>=0 && ${4=4}>=0 && +isint(${5=0}) && $5>=0 && isint(${6=-1}) && ($6>=0 || $6==-1) && ${7=1}>=1" skip "${8=}" +e[^-1] "Morph frames of input video file '$1', with $2 fading frames, smoothness $3, precision $4, first frame $5, +last frame $6, frame step $7 and output filename '$8'.\n" +_N= v + _morph_stream[] "\"$1\",$frame",${2-7},"$8" +_morph_stream : skip "${8=}" +is_ext "$8",avi is_outavi=${} +is_ext "$8",mp4 is_outmp4=${} +frame=$5 i=0 go_on=1 +l { $1 onfail go_on=0 } +if !$go_on return fi +w,h,s={w},{h},{s} +if {*} w. ${fitscreen\ $w,$h},0,"[G'MIC]" fi +pframe=$frame frame+=$7 +do +l[] { $1 onfail go_on=0 } +if !$go_on break fi +to_colormode. $s r. $w,$h +cutvals:=min(im#0,im#1),max(iM#0,iM#1) +e "\r - Frame ""#"$pframe" -> ""#"$frame" " ++equalize[0,1] n[-2,-1] 0,255 ++displacement[3] [2],$3,$4 +displacement[2] [3],$3,$4 rm[-4,-3] +repeat $2+2 { +if $< +title="Frame ""#"$pframe" -> ""#"$frame" ("$>/$2") " +e "\r - "$title +t:=$>/($2+1) omt:=1-$t ++*[2] $t +warp[0] .,1,1,1 rm.. *. $omt ++*[3] {1-$t} +warp[1] .,1,1,1 rm.. *. $t ++[-2,-1] c. $cutvals +if narg("$8") +if $is_outavi||$is_outmp4 z. 0,{w-(w%8)-1} o. "$8",25,mp4v,1 else filename "$8",$i i+=1 o. ${} fi +fi +if {*} +w. -1,-1,0,$title +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,D} w[] {{*,w}*1.5},{{*,h}*1.5} wait -1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,C} w[] {{*,w}/1.5},{{*,h}/1.5} wait -1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,R} w[] {0,w},{0,h} wait -1 fi +fi +rm. +fi +} +rm[0,-2,-1] pframe=$frame frame+=$7 +while $go_on" && "($6==-1" || "$frame<=$6) +if narg("$8") +if $is_outavi||$is_outmp4 z. 0,{w-(w%8)-1} o[] "$8",25,mp4v,0 else filename "$8",$i o. ${} fi +fi +rm +#@cli register_nonrigid : [destination],_smoothness>=0,_precision>0,_nb_scale>=0 +#@cli : Register selected source images with specified destination image, using non-rigid warp. +#@cli : Default values: 'smoothness=0.2', 'precision=6' and 'nb_scale=0(auto)'. +#@cli : $ image.jpg +rotate 20,1,1,50%,50% +register_nonrigid[0] [1] +register_nonrigid : check ${is_image_arg\ $1}" && ${2=0.2}>=0 && ${3=5}>0 && ${4=0}>=0" +e[^-1] "Register source image$? with destination image $1, using non-rigid warp with smoothness $2, +precision $3 and $4 scale(s)." +pass$1 0 equalize. n. 0,255 +repeat $!-1 { ++equalize[$>] n. 0,255 +displacement.. .,$2,$3,$4 rm.. +warp[$>] .,1,1,1 rm. +} rm. +#@cli register_rigid : [destination],_smoothness>=0,_boundary_conditions={ 0:dirichlet | 1:neumann | 2:periodic | 3:mirror } +#@cli : Register selected source images with specified destination image, using rigid warp (shift). +#@cli : Default values: 'smoothness=0.1%' and 'boundary_conditions=0'. +#@cli : $ image.jpg +shift 30,20 +register_rigid[0] [1] +register_rigid : check ${is_image_arg\ $1}" && ${2=0.1%}>=0 && isint(${3=0}) && $3>=0 && $3<=3" +e[^-1] "Register source image$? with destination image $1, using rigid warp with smoothness $2." +m "_register_rigid : b $2 equalize 256 n 0,1" +pass$1 0 W,H,D,S={w},{h},{d},{s} +f:=max(w,h)/1024 +if $f<=1 +_register_rigid. +repeat $!-1 { +if {$>,w!=$W||h!=$H||d!=$D} +error[0--4] "Images have incompatible sizes ("{$>,[w,h,d,s]}") and ("{[$W,$H,$D,$S]}")." +fi ++_register_rigid[$>] phase_correlation. .. shift[$>] {^},0,$3 rm. +} +rm. +else ++r. {[min(w,1024),min(h,1024),min(d,1024)]},100%,0,0,0.5,0.5 +rr2d.. 1024,1024,0,2 +_register_rigid[-2,-1] +repeat $!-2 { +if {$>,w!=$W||h!=$H||d!=$D} +error[0--4] "Images have incompatible sizes ("{$>,[w,h,d,s]}") and ("{[$W,$H,$D,$S]}")." +fi ++rr2d[$>] 1024,1024,0,2 _register_rigid. +phase_correlation. ... +s:=$f*crop() rm. ++shift[$>] $s,0,$3 +r. {[min(w,1024),min(h,1024),min(d,1024)]},100%,0,0,0.5,0.5 _register_rigid. +phase_correlation. .. +s:=[$s]+crop() rm. +shift[$>] $s,0,$3 +} +rm[-2,-1] +fi +um _register_rigid +#@cli transition : [transition_shape],nb_added_frames>=0,100>=shading>=0,_single_frame_only={ -1=disabled | >=0 } +#@cli : Generate a transition sequence between selected images. +#@cli : Default values: 'shading=0' and 'single_frame_only=-1'. +#@cli : $ image.jpg +mirror c 100%,100% plasma[-1] 1,1,6 transition[0,1] [2],5 +transition : check ${is_image_arg\ $1}" && $2>=0 && ${3=0}>=0 && $3<=100" skip ${4=-1} +frame:=round($4) s0=" and shading $3" s1=", shading $3 and single-frame-only "$frame +e[^-1] "Create transition sequence between image$? with $2 added frames, transition shape $1"${s{$4>0}}"." +if $!<2" || "!$2 return fi +to_colormode 0 r ${-max_whd},100%,0,0,0.5,0.5 +pass$1 0 norm. r. [0],[0],[0],1,3 n. 0,1 mv. 0 +repeat $!-2 { l[0,{$<+1},{$<+2}] { +nm0={1,n} +if $3 repeat $2 { if $4<0" || "$>==$frame +val0:=($>+0.5)/$2-$3% +val1:=($>+0.5)/$2+$3% ++f[0] "(i - $val0)/($val1 - $val0)" c. 0,1 ++j[2] [1],0,0,0,0,1,. rm.. +=> $nm0\ ""#{1+$>} +fi } else repeat $2 { if $4<0" || "$>==$frame ++>=[0] {($>+0.5)/$2} ++j[2] [1],0,0,0,0,1,. rm.. +=> $nm0\ ""#{1+$>} +fi } fi +mv[2] $! +} } rm[0] +#@cli transition3d : _nb_frames>=2,_nb_xtiles>0,_nb_ytiles>0,_axis_x,_axis_y,_axis_z,_is_antialias={ 0 | 1 } +#@cli : Create 3D transition sequence between selected consecutive images. +#@cli : 'axis_x', 'axis_y' and 'axis_z' can be set as mathematical expressions, depending on 'x' and 'y'. +#@cli : Default values: 'nb_frames=10', 'nb_xtiles=nb_ytiles=3', 'axis_x=1', 'axis_y=1', 'axis_z=0' and 'is_antialias=1'. +#@cli : $ image.jpg +blur 5 transition3d 9 display_rgba +transition3d : check "isint(${1=10}) && $1>=2 && isint(${2=3}) && $2>0 && isint(${3=$2}) && $3>0" +skip ${4=1},${5=1},${6=0},${7=1} +e[^-1] "Create 3D transition sequence between image$?, with $1 frames, $2x$3 tiles and rotation axis ($4,$5,$6).\n" +if $!<2 return fi +slices 0 to_rgb r ${-max_whds},3 +off=0 repeat $!-1 { l[{$>+$off},{$>+$off+1}] { +e "\r > Generate transition from image "$>" to image "{$>+1}". " +$2,$3,1,1,'$4' +$2,$3,1,1,'$5' +$2,$3,1,1,'$6' +a[-3--1] z +permute. zxyc r. 3,{$2*$3},1,1,-1 +repeat h { rot$>={@0-2} shift. 0,-1,0,0 } +rm. ++split_tiles[-2,-1] $2,$3 mv[0,1] $! +N:=$2*$3 i=0 y=0 +repeat $3 { +x=0 +repeat $2 { +lw,lh={$i,[w,h]} +imageplane3d[$i] imageplane3d[$N] r3d[$N] ${rot$i},180 c3d[$i,$N] +3d[$i,$N] +x$i=$x y$i=$y x+=$lw i+=1 +} +y+=$lh +} +repeat $1-2 { +repeat $N { r3d[$>] ${rot$>},{180/(1-$1)} ++3d[$>] ${x$>},${y$>},0 } ++3d[-$N--1] c3d. +if $7 +i... {-2,2*[w,h]},1,3,-1 +*3d. 2 j3d... .,50%,50%,0,1,2,0,0 rm. +to_rgba.. replace_color.. 0,0,-1,-1,-1,255,0,0,0,0 +downsize_aliased.. 50 +else +i... {-2,w},{-2,h},1,3,-1 j3d... .,50%,50%,0,1,2,0,0 rm. +to_rgba.. replace_color.. 0,0,-1,-1,-1,255,0,0,0,0 +fi +} +rm[0-{$N-1}] +=>[1--2] {0,n} +off+=$1-2 +} } +#@cli video2files : input_filename,_output_filename,_first_frame>=0,_last_frame={ >=0 | -1=last },_frame_step>=1 +#@cli : Split specified input video file into image files, one for each frame. +#@cli : First and last frames as well as step between frames can be specified. +#@cli : Default values: 'output_filename=frame.png', 'first_frame=0', 'last_frame=-1' and 'frame_step=1'. +video2files : check "isint(${3=0}) && $3>=0 && isint(${4=-1}) && ($4>=0 || $4==-1) && isint(${5=1}) && $5>=1" +skip ${2="frame.png"} +e[^-1] "Split input video file '$1' into image frames '$2', with first frame $3, last frame $4, and frame step $5.\n" +frame=$3 stopflag=0 +do l[] { +i "$1",$frame +if $! +o ${"filename \"$2\","$frame} rm +e "\r > Frame ""#"$frame +frame+=$5 +else stopflag=1 +fi +onfail stopflag=1 +} while !$stopflag" && "($frame<=$4" || "$4==-1) +#@cli :: Convenience Functions +#@cli add_copymark +#@cli : Add copymark suffix in names of selected images. +add_copymark : +foreach { nm={n} 0 => $nm . =>[0] {n} k[0] } +#@cli alert : _title,_message,_label_button1,_label_button2,... +#@cli : Display an alert box and wait for user's choice. +#@cli : If a single image is in the selection, it is used as an icon for the alert box. +#@cli : Default values: 'title=[G'MIC Alert]' and 'message=This is an alert box.'. +alert : skip "${1=[G"{`39`}"MIC Alert]},${2=This is an alert box.},${3=OK}" +if $!==1 +e[0--3] "Display alert box, with image$?, title '$1', message '$2' and buttons '${3--1}'." +else +e[0--3] "Display alert box, with title '$1', message '$2' and buttons '${3--1}'." +fi +if $!==1 logo= else logo=[] fi ++l$logo { +if $!==1 to_rgb +else +64,64 polygon 3,50%,10%,10%,90%,90%,90%,1,1 b 3 >= 50% ++erode. 5 -. .. ==. 0 +polygon. 4,47%,43%,53%,43%,53%,66%,47%,66%,1,0 circle. 50%,76%,2,1,0 ++*[0] 255 . 100%,100% a[-3--1] c -. '3*(y-h/2)' c. 0,255 +*. .. rm.. *[0] 255 rv a c +drop_shadow 3,3,1 i[0] 100%,100%,1,3,200 blend alpha +fi +channels -1,2 +$=arg +repeat $#-2 { label=${arg{$>+3}} 0 t. $label,0,0,16,1,-200 } +r[^0] {min(128,max(64,${max_w[^0]}+12))},{min(48,max(24,${max_h[^0]}+12))},1,1,0,0,0.5,0.5 ++[^0] 200 to_rgb[^0] +mv[0] $! +[0],[0],1,1,'(y-h/2)' *. -2 c. -30,30 +[0--3] . rm. c[^-1] 0,255 +foreach[^-1] { ++rectangle 0,0,100%,100%,1,0xFFFFFFFF,0 +rectangle. 1,1,{w-2},{h-2},1,0xFFFFFFFF,0 +line. 2,{h-3},{w-3},{h-3},1,150 line. {w-3},{h-3},{w-3},2,1,150 +line. 1,1,{w-3},1,1,255 line. 1,1,1,{h-3},1,255 +rectangle. 4,4,{w-5},{h-5},1,0xAAAAAAAA,0 ++shift.. 1,1,0,0,2 +rectangle. 0,0,100%,100%,1,0xFFFFFFFF,0 +rectangle. 1,1,{w-2},{h-2},1,0xFFFFFFFF,150 +rectangle. 4,4,{w-5},{h-5},1,0xAAAAAAAA,0 +rectangle... 0,0,100%,100%,1,0xFFFFFFFF,0 +line... 1,{h-2},{w-2},{h-2},1,150 line... {w-2},{h-2},{w-2},1,1,150 +line... 0,0,{w-2},0,1,255 line... 0,0,0,{h-2},1,255 +i[0] 100%,100% =[0] 1,0,0 +a c +} ++l { +channels 0,3 sh 1,100% -[50%--1] 200 rm[50%--1] frame 8,8,0 +if $!<6 a[^-1] x else append_tiles[^-1] , fi +0 t. "$2",0,0,16,1,0,-200,-200,-200 r. {w+16},{h+8},1,4,0 +a[-2,-1] x,0.5 rv a y,0.5 +sh 1,100% +. 200 rm. +rectangle 0,0,100%,100%,1,0xFFFFFFFF,0 +line 0,0,{w-2},0,1,0,255,255,255 line 0,0,0,{h-2},1,0,255,255,255 +} +rm.. ++channels. 0 +(0,{w-1}) (0;{-2,h-1}) ri[-2,-1] ...,3 a[-2,-1] c round. rv[-2,-1] *[-2,-1] +discard. 0 y. r. {h/2},2,1,1,-1 +channels.. 1,3 rv[-2,-1] +100%,100% repeat w#-3 { x0={-3,i($>,0)} y0={-3,i($>,1)} rectangle. $x0,$y0,{$x0+{0,w}-1},{$y0+{0,h}-1},1,{1+$>} } +a[-2,-1] c +repeat 9 { if !{*$>} disp=$> break fi } +if !narg($disp) error[0--4] "Command '$0': Cannot open display window for alert box." fi +selected:=$#==3?0:-1 clicked=-1 +do ++channels. 0,2 +if $clicked>=0 +x0={-3,i($clicked,0)} y0={-3,i($clicked,1)} +sh[$clicked] 7,9 +j.. .,$x0,$y0 rm. +elif $selected>=0 +x0={-3,i($selected,0)} y0={-3,i($selected,1)} +sh[$selected] 4,6 +j.. .,$x0,$y0 rm. +fi +w$disp. 100%,100%,0,"$1" rm. wait +xm,ym={*$disp,x,y} bm:={*$disp,b}&1 val:=i($xm,$ym,0,3) +if $bm" && "$val clicked:=$val-1 +elif $bm" && "!$val" && "$clicked>=0 selected=$clicked clicked=-1 +elif !$bm" && "$clicked>=0" && "$clicked==$val-1 break +fi +if {*$disp,ARROWRIGHT} selected:=($selected+1)%{-2,w} wait -1 +elif {*$disp,ARROWLEFT} selected:=($selected-1)%{-2,w}+($selected==-1) wait -1 +elif $selected>=0" && "{*$disp,ENTER} clicked=$selected break +fi +while {*$disp}" && "!{*$disp,ESC} +w$disp 0 rm u $clicked +} +#@cli arg : n>=1,_arg1,...,_argN +#@cli : Return the n-th argument of the specified argument list. +arg : check "isint($1) && ($1)>0" +$=arg u ${arg{1+($1)}} +#@cli arg0 : n>=0,_arg0,...,_argN +#@cli : Return the n-th argument of the specified argument list (where 'n' starts from '0'). +arg0 : check "isint($1) && ($1)>=0" +$=arg u ${arg{2+($1)}} +#@cli arg2img : argument_1,...,argument_N +#@cli : Split specified list of arguments and return each as a new image (as a null-terminated string). +arg2img : +$=arg repeat $# { arg=${arg{1+$>}} ({'$arg'},0) => $arg } +#@cli arg2var : variable_name,argument_1,...,argument_N +#@cli : For each i in [1...N], set 'variable_name$i=argument_i'. +#@cli : The variable name should be global to make this command useful (i.e. starts by an underscore). +arg2var : +$=arg u {$#-1} repeat ${} { $1{1+$>}=${arg{2+$>}} } +#@cli autocrop_coords : value1,value2,... | auto +#@cli : Return coordinates (x0,y0,z0,x1,y1,z1) of the autocrop that could be performed on the latest +#@cli : of the selected images. +#@cli : Default value: 'auto' +autocrop_coords : skip ${1=auto} +is_auto:=['"$1"']=='auto' +w,h,d,value={w},{h},{d},{i(w-1,h-1,d-1)} ++=. {1+$value},100%,100%,100% _autocrop$is_auto. ${1--1} =. $value,100%,100%,100% +x0,y0,z0:=$w-w,$h-h,$d-d +_autocrop$is_auto. ${1--1} +x1,y1,z1:=$x0+w-1,$y0+h-1,$z0+d-1 rm. +u $x0,$y0,$z0,$x1,$y1,$z1 +_autocrop0 : autocrop $* +_autocrop1 : skip $* autocrop +#@cli average_vectors +#@cli : Return the vector-valued average of the latest of the selected images. +average_vectors : +if !w u "" return fi +repeat s-1 { sh. $> res.={ia}, rm. } +sh. 100% u $res{ia} rm. +#@cli base642img : "base64_string" +#@cli : Decode given base64-encoded string as a newly inserted image at the end of the list. +#@cli : The argument string must have been generated using command 'img2base64'. ++base642img : +base642uint8 "$1" unserialize. +#@cli base642uint8 : "base64_string" +#@cli : Decode given base64-encoded string as a newly inserted 1-column image at the end of the list. +#@cli : The argument string must have been generated using command 'uint82base64'. ++base642uint8 : +0 +eval " +ref(vector256(),hash); +for (k = _'A', k<=_'Z', ++k, hash[k] = k - _'A'); +for (k = _'a', k<=_'z', ++k, hash[k] = k - _'a' + 26); +for (k = _'0', k<=_'9', ++k, hash[k] = k - _'0' + 52); +hash[_'+'] = hash[_'-'] = 62; +hash[_'/'] = hash[_'_'] = 63; +s = ['$1']; +const ss = size(s); +ss>=2?( +resize(#-1,1,ss*3/4 - (s[ss-1]==_'=') - (s[ss-2]==_'='),1,1); +od = 0; +for (os = 0, os>4); +i[#-1,od++] = ((c2&15)<<4) | (c3>>2); +i[#-1,od++] = ((c3&3)<<6) | c4; +) +)" +=> "[unnamed]" +#@cli basename : file_path,_variable_name_for_folder +#@cli : Return the basename of a file path, and opt. its folder location. +#@cli : When specified 'variable_name_for_folder' must starts by an underscore +#@cli : (global variable accessible from calling function). +basename : skip ${2=unused} +l[] { +({"'$1'"}) replace 92,47 s +,47 +if i==47 a y $2={t} u "" +elif $!==1 u {t} $2="" +else a[^-1] y u {t} $2={-2,t} +fi +rm +} +#@cli bin : binary_int1,... +#@cli : Print specified binary integers into their octal, decimal, hexadecimal and string representations. +bin : +dec=${bin2dec\ ${^0}} +e[^-1] "Convert binary integer"${arg0\ ($#>1),"",s}" '${^0}' to octal '"${dec2oct\ $dec}"', +decimal '"$dec"', hexadecimal '"${dec2hex\ $dec}"' and string '"${dec2str\ $dec}"'." +#@cli bin2dec : binary_int1,... +#@cli : Convert specified binary integers into their decimal representations. +bin2dec : +$=arg res,sep= repeat $# { res=$res$sep${_$0\ ${arg{$>+1}}} sep=, } u $res +_bin2dec : +u {"str = v2s(abs($1)); +for (k = val = 0, str[k], ++k, +c = str[k]; +(val<<=1)+=(c==_'0'?0:c==_'1'?1:nan); +isnan(val)?break() +); sign($1)*val"} +#@cli cat : filename,_display_line_numbers={ 0 | 1 },_line_selection, +#@cli : Print specified line selection of given filename on stdout. +#@cli : Default values: 'display_line_numbers=1' and 'line_selection=^'. +cat : skip "${2=},${3=}" +if "isbool($2)" dln=$2 if "['$3']!=0" ls=${3--1} else ls=^ fi +else dln=0 if "['$2']!=0" ls=${2--1} else ls=^ fi +fi +it "$1" +1 eval.. ">i==10?da_push(0,-1):i!=13?da_push(i); end(da_freeze())" +s. -,-1 0 rv[0,-1] rm. +m "_$0 : u $""[]" sel=${"-_$0["$ls"]"} um _$0 k[$ls] +e "" +if $dln ($sel) foreach[^-1] { pass. 1 +e "#"{@$>}:" "{/{0,t}} rm. } else foreach { +e {/{t}} } fi +rm +_check120 : +use_vt100 +it[] "$1" s +,10 +if !$! return fi +1,$!,1,2,">begin(line = 1); is_lines=i[#y,0]==10; line+=is_lines?h#y:0; [is_lines || h#y<=120?-1:y,line]" +lines={{@-1}-1} f. "I = I; I[0]<0?(I[1]=-1); I" +discard. -1 +if w +r. 1,{h/2},1,2,-1 +repeat h { +l,L:=I[$>] +e $_vt100_c" - [Line "$_vt100_b$L$_vt100_n$_vt100_c", "$_vt100_b{$l,h}$_vt100_n$_vt100_c" chars]: "$_vt100_n{$l,t} +} +fi +rm +_total_lines+=$lines +e " - Scanned : "${lines}" lines" +check120 : +_total_lines=0 +files 0,*.h c={`narg($files)?',':0`} if narg(${}) files=$files$c${} fi +files 0,*.cpp c={`narg($files)?',':0`} if narg(${}) files=$files$c${} fi +files 0,*.c c={`narg($files)?',':0`} if narg(${}) files=$files$c${} fi +files 0,*.gmic c={`narg($files)?',':0`} if narg(${}) files=$files$c${} fi +repeat narg($files) { +arg0 $>,$files file=${} +e " * File '"$file"'." +v + _check120 $file v - +} +e " - Total scanned : "${_total_lines}" lines" +#@cli color2name : R,G,B +#@cli : Return the name (as a string, in English) that most matches the specified color. +color2name : +_color2name ($1^$2^$3) r. {-2,w},1,1,3 -[-2,-1] norm. arg0 {xm},${"u "{n}} +('${}') replace. {'~'},{'" "'} u {t} rm[-2,-1] +_color2name : +if ['$__color2name']==0 +base642img "MiB1aW50OCBsaXR0bGVfZW5kaWFuCjg4MSAxIDEgMyAjMjU4MQp4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4/0MrutB/pQsiBDV8V6CrR9s7xfJwJmnPfylo+vhO/5OSjurq07nP62KY3gESren/67lB+Coh3iulJcbq19XVva7nO9pu+5M5OJAhQgy1Hp5gA7/7g2vEj3z3tW8t+0CmhtQFhm4m16Z0ZPsJkR1CV6LtfxEn/RZN2UEXAjiFFEIrlMmO+P++ogkVSIffwzX0ZVaMiwHl0nc6EB7PIIQslkrIUReFtpWk2M7e6B8wYn/fvL/od1iXwzM+UnkLUWyR/dWKGzS7ZzwxOUy/weTnio/x3kK9a8AoEtE3mgEVw232h4Yg5/+nXuGBbeEtn1e9BTp4h2d6o9s32dT/utrtOqraI1wc1xQk/XB21qei9NtJhJIWfStJAbhCi8GN1CNwO6fDRioUnk+J3wfRxol06AM1e5+ov3qPzC79X2j246meq5z/QUEYKkStf/sfIaI+Kg==" ++store. __color2name +else $__color2name +fi +#@cli covariance_vectors : _avg_outvarname +#@cli : Return the covariance matrix of the vector-valued colors in the latest of the selected images +#@cli : (for arbitrary number of channels). +#@cli : Parameter 'avg_outvarname' is used as a variable name that takes the value of the average vector-value. +covariance_vectors : skip "${1=avg}" +$1=${-average_vectors} +eval. "*begin(avg = [ "$""$1" ]; C = vector(#s^2,0)); +mI = I - avg; +C+=mul(mI,mI,s); +end(merge(C,+); C/=whd - 1; run('u ',v2s(C)))" +#@cli da_freeze +#@cli : Convert each of the selected dynamic arrays into a 1-column image whose height is the number of array elements. +da_freeze : +e[^-1] "Freeze dynamic array$?." +$! eval. "da_freeze(#x)" rm. +#@cli dec : decimal_int1,... +#@cli : Print specified decimal integers into their binary, octal, hexadecimal and string representations. +dec : +e[^-1] "Convert decimal integer"${arg0\ ($#>1),"",s}" '${^0}' to binary '"${dec2bin\ ${^0}}"',"" octal '"${dec2oct\ ${^0}}"', hexadecimal '"${dec2hex\ ${^0}}"' and string '"${dec2str\ ${^0}}"'." +#@cli dec2str : decimal_int1,... +#@cli : Convert specifial decimal integers into its string representation. +dec2str : +u {`[${^0}]`} +#@cli dec2bin : decimal_int1,... +#@cli : Convert specified decimal integers into their binary representations. +dec2bin : +$=arg res,sep= repeat $# { res=$res$sep${_$0\ ${arg{$>+1}}} sep=, } u $res +_dec2bin : +u {`"const sgn = sign($1); +const N = (isinf($1) || isnan($1)?1:1 + floor(log2(max(1,abs($1))))) + (sgn<0); +res = vectorN(); +sgn>=0?0:(res[0] = _'-'); +for (val = abs($1); k = size(res) - 1, k>=(sgn<0), --k, res[k] = _'0' + (val&1); val>>=1); res"`} +#@cli dec2hex : decimal_int1,... +#@cli : Convert specified decimal integers into their hexadecimal representations. +dec2hex : +$=arg res,sep= repeat $# { res=$res$sep${_$0\ ${arg{$>+1}}} sep=, } u $res +_dec2hex : +u {`"begin(tab = [ _'0',_'1',_'2',_'3',_'4',_'5',_'6',_'7',_'8',_'9',_'a',_'b',_'c',_'d',_'e',_'f' ]); +const sgn = sign($1); +const N = (isinf($1) || isnan($1)?1:1 + floor(log2(max(1,abs($1)))/4)) + (sgn<0); +res = vectorN(); +sgn>=0?0:(res[0] = _'-'); +for (val = abs($1); k = size(res) - 1, k>=(sgn<0), --k, res[k] = tab[val&15]; val>>=4); res"`} +#@cli dec2oct : decimal_int1,... +#@cli : Convert specified decimal integers into their octal representations. +dec2oct : +$=arg res,sep= repeat $# { res=$res$sep${_$0\ ${arg{$>+1}}} sep=, } u $res +_dec2oct : +u {`"const sgn = sign($1); +const N = (isinf($1) || isnan($1)?1:1 + floor(log2(max(1,abs($1)))/3)) + (sgn<0); +res = vectorN(); +sgn>=0?0:(res[0] = _'-'); +for (val = abs($1); k = size(res) - 1, k>=(sgn<0), --k, res[k] = _'0' + (val&7); val>>=3); res"`} +#@cli fibonacci : N>=0 +#@cli : Return the Nth number of the Fibonacci sequence. +#@cli : $ echo ${"fibonacci 10"} +#@cli : \n~~~\n[gmic]-0./ Start G'MIC interpreter.\n[gmic]-0./ 55\n[gmic]-0./ End G'MIC interpreter.\n~~~\n +fibonacci : check "$1>=0" +u {N=$1;N<2?N:for(n=N;F0=0;F1=1,n=n-1,F2=F0+F1;F0=F1;F1=F2)} +#@cli file_mv : filename_src,filename_dest +#@cli : Rename or move a file from a location $1 to another location $2. +file_mv : +e[^-1] "Move file '$1' to location '$2'." +if ${-is_windows} x "move "$1" "$2 else x "mv "$1" "$2 fi +#@cli filename : filename,_number1,_number2,...,_numberN +#@cli : Return a filename numbered with specified indices. +filename : skip "${1=default}" +if $#==1 u "$1" +else +(${2--1}) => "$1" u {f}{b} +repeat w { +u ${}_{int(i/100000)%10}{int(i/10000)%10}{int(i/1000)%10}{int(i/100)%10}{int(i/10)%10}{i%10} +shift. -1 +} +if narg({'{x}'}) u ${}.{x} fi +rm. +fi +#@cli filename_rand +#@cli : Return a random filename for storing temporary data. +filename_rand : +do filename=${-path_tmp}gmic$_pid{`round(u(vector6(_'0'),vector6(_'9')))`} +while isfile(['{/$filename}']) +u $filename +#@cli filename_dated : filename +#@cli : Convert specified filename to one stamped with the current date (`filename_YYYYMMDD_HHMMSS.ext`). +filename_dated : +0 => "$1" ext={x} folder={f} basename={b} rm. +if ['$ext']!=0 ext..=. fi +u ${folder}${basename}_{`" +str='00000000_000000'; +copy(str,v2s(date(0)),4); +v = date(1); copy(str[4 + (v<10)],v2s(v),2); +v = date(2); copy(str[6 + (v<10)],v2s(v),2); +v = date(4); copy(str[9 + (v<10)],v2s(v),2); +v = date(5); copy(str[11 + (v<10)],v2s(v),2); +v = date(6); copy(str[13 + (v<10)],v2s(v),v<10?1:2); +str"`}$ext +#@cli files : _mode,path : (+) +#@cli : Return the list of files and/or subfolders from specified path. +#@cli : 'path' can be eventually a matching pattern. +#@cli : 'mode' can be { 0:files only | 1:folders only | 2:files + folders }. +#@cli : Add '3' to 'mode' to return full paths instead of filenames only. +#@cli : Default value: 'mode=5'. +#@cli files2img : _mode,path +#@cli : Insert a new image where each vector-valued pixel is a string encoding the filenames returned by command ''files''. +#@cli : Useful to manage list of filenames containing characters that have a special meaning in the G'MIC language,such as spaces or commas. ++files2img : +if ['$$_$0_f2i']==0 m "_$0_f2i: $""=arg repeat $""# { ({'${arg{1+$>}}'}:^) } a y" fi +files $"*" l[] { _$0_f2i[] ${} if !$! 0 fi } +#@cli fitratio_wh : min_width,min_height,ratio_wh +#@cli : Return a 2D size 'width,height' which is bigger than 'min_width,min_height' and has the specified w/h ratio. +fitratio_wh : +if $3*$2>$1 u {int($3*$2)},$2 else u $1,{int($1/$3)} fi +#@cli fitscreen : width,height,_depth,_minimal_size[%],_maximal_size[%] : [image],_minimal_size[%],_maximal_size[%] +#@cli : Return the 'ideal' size WxH for a window intended to display an image of specified size on screen. +#@cli : Default values: 'depth=1', 'minimal_size=128' and 'maximal_size=85%'. +fitscreen : skip "${2=},${3=},${4=},${5=}" +if ${"is_image_arg $1"} +l$1 { W,H,D={w},{h},{d} } if narg($2) m=$2 else m=25% fi if narg($3) M=$3 else M=85% fi +else +W,H=${1-2} if narg($3) D=$3 else D=1 fi if narg($4) m=$4 else m=25% fi if narg($5) M=$5 else M=85% fi +fi +eval " +const u = "{*,u}"; +const v = "{*,v}"; +ms = round(ispercentage("$m")?[ u,v ]*"$m":[ "$m,$m" ]); +Ms = round(ispercentage("$M")?[ u,v ]*"$M":[ "$M,$M" ]); +s = [ "$W,$H" ]; +"$D">1?(s+="$D"); +s[0]Ms[0]?(s = [ Ms[0],s[1]*Ms[0]/s[0] ]); +s[1]>Ms[1]?(s = [ s[0]*Ms[1]/s[1],Ms[1] ]); +s[0] = max(1,s[0],ms[0]); +s[1] = max(1,s[1],ms[1]); +round(s)" +#@cli fontchart : display_mode. +#@cli : Insert G'MIC font chart at the end of the image list. +#@cli : 'display_mode' can be { 0: List of characters | N: List of fonts with height 'N'}. +#@cli : Default value: 'display_mode=0'. +#@cli : $ fontchart 0 fontchart 64 ++fontchart : check "isint(${1=0}) && $1>=0" +s0,s1=characters,"fonts, with height $1" +e[^-1] "Generate G'MIC font chart (list of "${s{!!$1}}")." +if !$1 l[] { +repeat 256 { +if $>==92 char=\\ else char={`max(1,(c=$>;c>=23&&c<=28?32:c))`} fi +0 t. {``$char},0,0,50,1,255 +} +a z,0.5 +s z +foreach { +t $>,1,-1,13,1,200 +0 t. \\${dec2oct\ $>},1,-1,13,1,1 +100%,100%,1,1,200 j... .,{-3,[w,h]-[w#-1,h#-1]},0,0,1,.. rm[-2,-1] +} +frame 1,1,128 append_tiles , +} else l[] { +input_cached gmic_fonts.gmz +foreach { +('{n}') strcapitalize {t} name=${} rm. +e " - "$name +rm +0 t. $name:\n" Hello World!",0,0,${"font \""$name"\",$1"},1,255 +} +r ${-max_wh},1,1,0,0,0.5,0.5 +frame 10,25,0 frame 3,3,128 +append_tiles 3 +} fi +font2cimgh : +e[^-1] "Encode font image$? as a C-style string for CImg.h." +foreach { +bnm={0,b} W,H:=w/256,h +e " > Encode font '"$bnm"'." +if !isint($W) error[0--4] "Font image '"$bnm"' has wrong dimensions ("{[w,h,d,s]}")." fi ++f "i==im || i==iM" is_binary:=im==1 rm. +Mm=0 MM=100 +do +M:=floor(($Mm+$MM)/2) ++compress_rle $is_binary,$M rows. 6,100% +. {32-im} iM:=iM +if iM<126 Mm=$M rm. elif iM>126 MM=$M rm. fi +while $iM!=126 +k. nb_chunks:=1+int(h/65536) +e "\r > Encode font '"$bnm"' -> W = "$W", H = "$H", M = "$M", is_binary = "$is_binary", +nb_chunks = "$nb_chunks"." +replace_str "\\","\\\\" +replace_str "\"","\\\"" +s y,-111 +repeat $! { +if {$>,i[h-1]==_'\\'&&i[h-2]!=_'\\'} rows[$>] 0,{$>,h-2} rows[{$>+1}] -1,100% =[{$>+1}] {'\\'} fi +l[$>] { +i[0] ('" \""') ('\"') +if !$< ('" };"') fi +('\n') +y a y +} +} +repeat $nb_chunks-1 { ind:=int($!*($>+1)/$nb_chunks) l[$ind] { = {','},0,100% ('\n') y a y } } +i[0] ('" static const char *const data_font"${W}x${H}"[] = {"\n') +y a y ot $bnm.h +} +#@cli fps +#@cli : Return the number of time this function is called per second, or -1 if this info is not yet available. +#@cli : Useful to display the framerate when displaying animations. +fps : +if narg($_fps_fps) +dt:=$|-$_fps_time +if $dt>1 _fps_fps:=round($_fps_nbframes/$dt) _fps_time=$| _fps_nbframes=0 fi +u $_fps_fps +_fps_nbframes+=1 +else _fps_nbframes=0 _fps_time=$| _fps_fps=-1 u -1 +fi +#@cli gcd : a,b +#@cli : Return the GCD (greatest common divisor) between a and b. +gcd : check "isint($1) && isint($2) && $1*$2!=0" +_gcd {max(abs($1),abs($2))},{min(abs($1),abs($2))} +_gcd : +r:=$1%$2 if $r u ${_gcd\ $2,$r} else u $2 fi +#@cli hex : hexadecimal_int1,... +#@cli : Print specified hexadecimal integers into their binary, octal, decimal and string representations. +hex : +dec=${hex2dec\ ${^0}} +e[^-1] "Convert hexadecimal integer"${arg0\ ($#>1),s,""}" '${^0}' to binary '"${dec2bin\ $dec}"', +octal '"${dec2oct\ $dec}"', decimal '"$dec"' and string '"${dec2str\ $dec}"'." +#@cli hex2dec : hexadecimal_int1,... +#@cli : Convert specified hexadecimal integers into their decimal representations. +hex2dec : +$=arg res,sep= repeat $# { res=$res$sep${_$0\ ${arg{$>+1}}} sep=, } u $res +_hex2dec : +u {"str = ['$1']; str[0]==_'-'?-s2v([['0x'],str[1,max(1,size(str)-1)]]):s2v([['0x'],str])"} +#@cli hex2img : "hexadecimal_string" +#@cli : Insert new image 1xN at the end of the list with values specified by the given hexadecimal-encoded string. ++hex2img : +('"$1"') 1,{w/2} +f. "* +from_char(x) = x>=48 && x<=57?x - 48:x-87; +off = 2*y; +from_char(i[#-2,off])*16 + from_char(i[#-2,off + 1])" +rm.. +#@cli hex2str : hexadecimal_string +#@cli : Convert specified hexadecimal string into a string. +#@cli : See also: ''str2hex''. +hex2str : skip ${1=""} +if !narg("$1") u "" return fi +('$*') if w<2 rm. u "" return fi +f. "v = i - (i>=97?87:48); x%2?v:v*16" r. 2,{int(w/2)},1,1,-1 cumulate. x z. 1,1 +u {t} rm. +#@cli img2base64 : _encoding={ 0:base64 | 1:base64url },_store_names={ 0 | 1 } +#@cli : Encode selected images as a base64-encoded string. +#@cli : The images can be then decoded using command 'base642img'. +#@cli : Default values: 'encoding=0' and 'store_names=1'. +img2base64 : check "isbool(${1=0}) && isbool(${2=1})" +if isnum("$1") encoding=$1 else encoding=0 noarg fi ++serialize auto,1,$2 u ${uint82base64\ $encoding} rm. +#@cli img2hex +#@cli : Return representation of last image as an hexadecimal-encoded string. +#@cli : Input image must have values that are integers in [0,255]. +img2hex : +whds={w},{h},{d},{s} y. 2,{h} +f.. "* +to_char(x) = x>=0 && x<=9?48 + x:87 + x; +i(#-1,0,y) = to_char(int(i/16)); +i(#-1,1,y) = to_char(i%16); +i" +u {t} rm. r. $whds,-1 +#@cli img2str +#@cli : Return the content of the selected images, as special G'MIC input strings. +img2str : +str,sep= +foreach { +str.=$sep({`"s = v2s(crop()); +for (k = 1; p = find(s,_','), p>=0, p = find(s,_',',++p), +s[p] = k%w?_',':k%wh?_';':k%whd?_'/':_'^'; ++k; +); s"`}) +sep=" " +} +u $str +#@cli img2text : _line_separator +#@cli : Return text contained in a multi-line image. +#@cli : Default value: 'line_separator= '. +img2text : skip "${1= }" ++l { s y s -,0 y x if $!>1 i[1--2] ('"$1"') fi a x u {0,t} rm } +#@cli is_mesh3d +#@cli : Return 1 if all of the selected images are 3D meshes, 0 otherwise. +is_mesh3d : +u 1 l { check3d 1 onfail u 0 } +_is_mesh3d : +u {"w==1 && h>6 && d==1 && s==1 && int(crop(0,0,1,6))==['CImg3d']"} +#@cli is_change : _value={ 0:false | 1:true } +#@cli : Set or unset the 'is_change' flag associated to the image list. +#@cli : This flag tells the interpreter whether or not the image list should be displayed when the pipeline ends. +#@cli : Default value: 'value=1'. +is_change : +l[] { check "isbool(${1=1})" arg=$1 onfail noarg arg=1 } +if $arg 0 rm. elif {*9} w9[] -1,-1 else w9 0 fi +#@cli is_half +#@cli : Return 1 if the type of image pixels is limited to half-float. +is_half : +(2049) u {i==2048} rm. +#@cli is_ext : filename,_extension +#@cli : Return 1 if specified filename has a given extension. +is_ext : skip "${1=},${2=}" +0 => "_$1" u {"lowercase(['"{x}"'])==lowercase(['$2'])"} rm. +#@cli is_image_arg : string +#@cli : Return 1 if specified string looks like '[ind]'. +is_image_arg : skip "${1=;}" +u {"str = ['$1']; +s1 = size(str) - 1; +(str[0]==_'[' && str[s1]==_']') || (str[0]==_'.' && str[s1]==_'.') && min(str)>=45 && max(str)<=122"} +#@cli is_pattern : string +#@cli : Return 1 if specified string looks like a drawing pattern '0x......'. +is_pattern : skip "${1=;}" +u {"str = ['$1']; size(str)>2 && same(str,'0x',2)"} +#@cli is_varname : string +#@cli : Return 1 if specified string can be considered as a valid variable name. +is_varname : skip "${1=}" +u {" +S = ['$1']; is_varname = 1; +inrange(S[0],_'0',_'9')?(is_varname = 0): +repeat(size(S),k, c = S[k]; +is_varname&=inrange(c,_'0',_'9') || inrange(c,_'a',_'z') || inrange(c,_'A',_'Z') || c==_'_'; +!is_varname?break(); +); +is_varname"} +#@cli is_videofilename : filename +#@cli : Return 1 if extension of specified filename is typical from video files. +is_videofilename : skip "${1=}" +0 => "_$1" u {" +ext = lowercase(['"{x}"']); +isin(ext,'avi','mov','asf','divx','flv','mpg','m1v','m2v','m4v','mjp','mp4','mkv','mpe','movie','ogm','ogg','ogv', +'qt','rm','vob','wmv','xvid','mpeg')"} +rm. +#@cli is_macos +#@cli : Return 1 if current computer OS is Darwin (MacOS), 0 otherwise. +is_macos : +if !narg($_is_macos) _is_macos:=isdir('/Library/Apple/System/Library') fi +u $_is_macos +#@cli is_windows +#@cli : Return 1 if current computer OS is Windows, 0 otherwise. +is_windows : +if !narg($_is_windows) _is_windows:=['$OS']!=0" && "['$WINDIR']!=0 fi +u $_is_windows +#@cli lof : feature +#@cli : Return the list of specified features (separated by commas) for each selected images. +lof : +foreach { res.=$c{"$*"} c=, } u $res +#@cli math_lib +#@cli : Return string that defines a set of several useful macros for the embedded math evaluator. +math_lib : +u " +dist(A,B) = ( +norm(B - A); +); +dist(X,A,B) = ( +AB = B - A; +P = A + dot(X - A,B - A)/max(1e-8,dot(AB,AB))*AB; +dot(P - A,P - B)<=0?norm(P - X):min(norm(A - X),norm(B - X)); +); +dist(A,B,C,D) = ( +min(dist(A,C,D),dist(B,C,D),dist(C,A,B),dist(D,A,B)); +); +meig(A,m,n) = ( +unref(meig_m,meig_n); +const meig_n = n; +const meig_m = min(m,meig_n); +ref(vector(#meig_m*meig_n),meig_V); +ref(vector(#meig_m^2),meig_H); +ref(expr('v',1,meig_n),meig_vj); meig_vj/=norm(meig_vj); +repeat (meig_m,meig_j, +copy(meig_V[meig_j*meig_n],meig_vj,meig_n); +meig_vj = A*meig_vj; +for (meig_i = 0, meig_i<=meig_j, ++meig_i, +ref(meig_V[meig_i*meig_n,meig_n],meig_vi); +meig_d = dot(meig_vj,meig_vi); +meig_H[meig_j*meig_m + meig_i] = meig_d; +meig_vj-=meig_d*meig_vi; +); +meig_nvj = norm(meig_vj); +meig_H[meig_j*meig_m + meig_j + 1] = meig_nvj; +meig_nvj<1e-12?break(); +meig_vj/=meig_nvj; +); +eig(meig_H)[0,m]; +); +search_dichotomic(fn_x,target,epsilon,xmin,xmax) = ( +_dicho_fn(x) = _dicho_sgn*(fn_x); +_dicho_epsilon = epsilon; +_dicho_m = xmin; +_dicho_M = xmax; +_dicho_sgn = 1; +_dicho_autom = isnan(_dicho_m); +_dicho_autoM = isnan(_dicho_M); +if (_dicho_autom, _dicho_m = -1); +if (_dicho_autoM, _dicho_M = 1); +_dicho_sgn = _dicho_fn(_dicho_m)>_dicho_fn(_dicho_M)?-1:1; +_dicho_res = nan; +_dicho_target = _dicho_sgn*target; +_dicho_nb_attempts = 30; +_dicho_autom?do ( +_dicho_fm = _dicho_fn(_dicho_m); +_dicho_fm<_dicho_target?break(); +_dicho_m*=2; +_(while), --_dicho_nb_attempts); +_dicho_nb_attempts?( +_dicho_autoM?do ( +_dicho_fM = _dicho_fn(_dicho_M); +_dicho_fM>_dicho_target?break(); +_dicho_M*=2; +_(while), --_dicho_nb_attempts); +_dicho_nb_attempts?( +_dicho_nb_attempts = 100; +do ( +_dicho_c = (_dicho_m + _dicho_M)/2; +_dicho_fc = _dicho_fn(_dicho_c); +abs(_dicho_fc - _dicho_target)<_dicho_epsilon?(_dicho_res = _dicho_c; break()): +_dicho_fc<_dicho_target?(_dicho_m = _dicho_c): +(_dicho_M = _dicho_c); +_(while), --_dicho_nb_attempts +); +); +); +_dicho_res; +); +search_dichotomic(fn_x,target,epsilon) = search_dichotomic(fn_x,target,1e-3,nan,nan); +search_dichotomic(fn_x,target) = search_dichotomic(fn_x,target,1e-3); +search_dichotomic(fn_x) = search_dichotomic(fn_x,0); +arrow(ind,P0,P1,angle,length,opacity,color) = ( +unref(_da_color); +_opacity = opacity; +_da_color = color; +_P0 = P0; +_P1 = P1; +_P0P1 = _P1; +_P0P1-=_P0; +if (length<0, _P0P1*=-length/100, _P0P1*=length/norm(_P0P1)); +coords = [ _P0,_P1,_P1,_P1 - rot(angle°)*_P0P1,_P1,_P1 - rot(-angle°)*_P0P1 ]; +repeat (3,_k, polygon(#ind,2,coords[4*_k,2],coords[4*_k+2,2],_opacity,_da_color)); +); +spline(ind,P0,T0,P1,T1,opacity,color) = ( +unref(_ds_color); +_P0 = P0; +_P1 = P1; +_opacity = opacity; +_ds_color = resize(color,s#ind)*=abs(_opacity); +_omopacity = 1 - max(_opacity,0); +_C = mul([ 2,-2,1,1,-3,3,-2,-1,0,0,1,0,1,0,0,0 ],[ _P0,P1,T0,T1 ],2); +_dt = _dtmin = 1/max(abs(_P1 - _P0)); +_P0 = inf; +for (_t = 0, _t<=1, _t+=_dt, +_P = round(mul([_t^3,_t^2,_t,1],_C,2)); +_dP = abs(mul([3*_t^2,2*_t,1,0],_C,2)); +_dt = min(_dtmin,0.75/max(_dP)); +if (_P0!=_P, I(#ind,_P) = _ds_color + _omopacity*I(#ind,_P)); +_P0 = _P; +); +nan; +); +thickspline(ind,P0,T0,P1,T1,thickness,opacity,color) = ( +unref(_ds_color); +unref(_ds_mask); +_P0 = P0; +_P1 = P1; +_opacity = opacity; +_radius = thickness/2; +_ds_color = resize(color,s#ind)*=abs(_opacity); +_omopacity = 1 - max(_opacity,0); +_C = mul([ 2,-2,1,1,-3,3,-2,-1,0,0,1,0,1,0,0,0 ],[ _P0,P1,T0,T1 ],2); +_dt = _dtmin = 1/max(abs(_P1 - _P0)); +_P0 = inf; +for (_t = 0, _t<=1, _t+=_dt, +_P = round(mul([_t^3,_t^2,_t,1],_C,2)); +_dP = abs(mul([3*_t^2,2*_t,1,0],_C,2)); +_dt = min(_dtmin,0.75/max(_dP)); +if (_P0!=_P, +ellipse(#ind,_P[0],_P[1],_radius,_radius,0,_opacity,_ds_color); +); +_P0 = _P; +); +nan; +); +triangle(ind,P0,P1,P2,opacity,color0,color1,color2) = ( +unref(_dt_color); +unref(_dt_color0); +unref(_dt_color1); +unref(_dt_color2); +_opacity = opacity; +_dt_color0 = resize(color0,s#ind); +_dt_color1 = resize(color1,s#ind); +_dt_color2 = resize(color2,s#ind); +_A = round(P0); +_B = round(P1); +_C = round(P2); +_xmin = max(0,min(_A[0],_B[0],_C[0])); +_xmax = min(w#ind-1,max(_A[0],_B[0],_C[0])); +_ymin = max(0,min(_A[1],_B[1],_C[1])); +_ymax = min(h#ind-1,max(_A[1],_B[1],_C[1])); +_M = transpose([_A,1,_B,1,_C,1],3); +for (_y = _ymin, _y<_ymax, ++_y, +for (_x = _xmin, _x<_xmax, ++_x, +_L = round(solve(_M,[_x,_y,1]),1e-5); +if (min(_L)>=0, +_dt_color = _L[0]*_dt_color0 + _L[1]*_dt_color1 + _L[2]*_dt_color2; +copy(i(#ind,_x,_y,0,0),_dt_color,size(_dt_color),whd#ind,1,_opacity); +); +); +); +nan; +); +line_aa_plot(ind,x,y,o) = ( +_line_aa_o = o*line_aa_opacity; +(I(#ind,x,y)*=1 - _line_aa_o)+=line_aa_color*_line_aa_o; +); +line_aa_fpart(x) = (x - floor(x)); +line_aa_rfpart(x) = (1 - line_aa_fpart(x)); +line_aa(x0,y0,x1,y1,opacity,color) = line_aa(#-1,#x0,#y0,#x1,#y1,opacity,color); +line_aa(ind,x0,y0,x1,y1,opacity,color) = ( +line_aa_x0 = x0; line_aa_y0 = y0; +line_aa_x1 = x1; line_aa_y1 = y1; +line_aa_color = color; +line_aa_opacity = opacity; +line_aa_steep = abs(line_aa_y1 - line_aa_y0)>abs(line_aa_x1 - line_aa_x0); +line_aa_steep?(swap(line_aa_x0, line_aa_y0); swap(line_aa_x1, line_aa_y1)); +line_aa_x0>line_aa_x1?(swap(line_aa_x0, line_aa_x1); swap(line_aa_y0, line_aa_y1)); +line_aa_dx = line_aa_x1 - line_aa_x0; +line_aa_dy = line_aa_y1 - line_aa_y0; +line_aa_gradient = line_aa_dx?line_aa_dy/line_aa_dx;1; +line_aa_xend = round(line_aa_x0); +line_aa_yend = line_aa_y0 + line_aa_gradient*(line_aa_xend - line_aa_x0); +line_aa_xgap = line_aa_rfpart(line_aa_x0 + 0.5); +line_aa_xpxl1 = line_aa_xend; +line_aa_ypxl1 = floor(line_aa_yend); +line_aa_steep?( +line_aa_plot(#ind,line_aa_ypxl1,line_aa_xpxl1,line_aa_rfpart(line_aa_yend)*line_aa_xgap); +line_aa_plot(#ind,line_aa_ypxl1 + 1,line_aa_xpxl1,line_aa_fpart(line_aa_yend)*line_aa_xgap); +):( +line_aa_plot(#ind,line_aa_xpxl1,line_aa_ypxl1,line_aa_rfpart(line_aa_yend)*line_aa_xgap); +line_aa_plot(#ind,line_aa_xpxl1,line_aa_ypxl1 + 1,line_aa_fpart(line_aa_yend)*line_aa_xgap); +); +line_aa_intery = line_aa_yend + line_aa_gradient; +line_aa_xend = round(line_aa_x1); +line_aa_yend = line_aa_y1 + line_aa_gradient*(line_aa_xend - line_aa_x1); +line_aa_xgap = line_aa_fpart(line_aa_x1 + 0.5); +line_aa_xpxl2 = line_aa_xend; +line_aa_ypxl2 = floor(line_aa_yend); +line_aa_steep?( +line_aa_plot(#ind,line_aa_ypxl2,line_aa_xpxl2,line_aa_rfpart(line_aa_yend)*line_aa_xgap); +line_aa_plot(#ind,line_aa_ypxl2 + 1,line_aa_xpxl2,line_aa_fpart(line_aa_yend)*line_aa_xgap); +):( +line_aa_plot(#ind,line_aa_xpxl2,line_aa_ypxl2,line_aa_rfpart(line_aa_yend)*line_aa_xgap); +line_aa_plot(#ind,line_aa_xpxl2,line_aa_ypxl2 + 1,line_aa_fpart(line_aa_yend)*line_aa_xgap); +); +line_aa_steep?( +for (line_aa_x = line_aa_xpxl1 + 1, line_aa_x<=line_aa_xpxl2 - 1, ++line_aa_x, +line_aa_plot(#ind,floor(line_aa_intery),line_aa_x,line_aa_rfpart(line_aa_intery)); +line_aa_plot(#ind,floor(line_aa_intery) + 1,line_aa_x,line_aa_fpart(line_aa_intery)); +line_aa_intery+=line_aa_gradient; +); +):( +for (line_aa_x = line_aa_xpxl1 + 1, line_aa_x<=line_aa_xpxl2 - 1, ++line_aa_x, +line_aa_plot(#ind,line_aa_x,floor(line_aa_intery),line_aa_rfpart(line_aa_intery)); +line_aa_plot(#ind,line_aa_x,floor(line_aa_intery) + 1,line_aa_fpart(line_aa_intery)); +line_aa_intery+=line_aa_gradient; +); +); +); +hsv2rgb(I...) = ( +ref([I],_I); +_I[0]%=360; +_I[1] = cut(_I[1],0,1); +_I[2] = cut(_I[2],0,1); +_c = _I[2]*_I[1]; +_x = _c*(1-abs((_I[0]/60)%2-1)); +(arg(1 + int(_I[0]/60),[_c,_x,0],[_x,_c,0],[0,_c,_x],[0,_x,_c],[_x,0,_c],[_c,0,_x])+=_I[2] - _c)*=255; +); +rgb2hsv(I...) = ( +ref([I],_I); +_M = max(_I); +_C = _M - min(_I); +[ 60*(!_C?0:_M==_I[0]?((_I[1] - _I[2])/_C)%6:_M==_I[1]?(_I[2] - _I[0])/_C + 2:(_I[0] - _I[1])/_C + 4), +_M<=0?0:_C/_M, _M/255 ]; +); +is_intriangle(P,A,B,C) = ( +_v0 = C - A; +_v1 = B - A; +_v2 = P - A; +_dot00 = dot(_v0,_v0); +_dot01 = dot(_v0,_v1); +_dot02 = dot(_v0,_v2); +_dot11 = dot(_v1,_v1); +_dot12 = dot(_v1,_v2); +_invDenom = 1/(_dot00*_dot11 - _dot01*_dot01); +_u = (_dot11*_dot02 - _dot01*_dot12)*_invDenom; +_v = (_dot00*_dot12 - _dot01*_dot02)*_invDenom; +_u>=0 && _v>=0 && _u + _v<1); +is_inquadrilateral(P,A,B,C,D) = ( +is_intriangle(P,A,B,D) || is_intriangle(P,B,C,D); +); +do_intersect(p0x,p0y,p1x,p1y,q0x,q0y,q1x,q1y) = ( +_o1 = _doi_orientation(p0x,p0y,p1x,p1y,q0x,q0y); +_o2 = _doi_orientation(p0x,p0y,p1x,p1y,q1x,q1y); +_o3 = _doi_orientation(q0x,q0y,q1x,q1y,p0x,p0y); +_o4 = _doi_orientation(q0x,q0y,q1x,q1y,p1x,p1y); +(_o1!=_o2 && _o3!=_o4) || +(!_o1 && _doi_on_segment(p0x,p0y,q0x,q0y,p1x,p1y)) || +(!_o2 && _doi_on_segment(p0x,p0y,q1x,q1y,p1x,p1y)) || +(!_o3 && _doi_on_segment(q0x,q0y,p0x,p0y,q1x,q1y)) || +(!_o4 && _doi_on_segment(q0x,q0y,p1x,p1y,q1x,q1y)) +); +_doi_on_segment(px,py,qx,qy,rx,ry) = ( +inrange(qx,min(px,rx),max(px,rx)) && inrange(qy,min(py,ry),max(py,ry)); +); +_doi_orientation(px,py,qx,qy,rx,ry) = ( +_doi_orientation_val = (qy - py)*(rx - qx) - (qx - px)*(ry - qy); +!_doi_orientation_val?0:_doi_orientation_val>0?1:2; +); +length_spline(P0,T0,P1,T1) = ( +_P0 = P0; +_P1 = P1; +_C = mul([ 2,-2,1,1,-3,3,-2,-1,0,0,1,0,1,0,0,0 ],[ _P0,_P1,T0,T1 ],2); +_l = norm(_P1 - _P0); +if (_l, +_nl = _l + 1; +_dt = 1/_l; +while (_nl - _l>=0.01, +_l = _nl; +_nl = 0; +__P0 = _P0; +for (_t = 0, _t<=1, _t+=_dt, +__P = mul([_t^3,_t^2,_t,1],_C,2); +_nl+=norm(__P - __P0); +__P0 = __P; +); +_dt = 1/max(1,_nl); +); +); +_l +); +pexp(x) = ( +_pexp_x = abs(x); +_pexp_x<2?-0.110353*_pexp_x^4 + 0.683221*_pexp_x^3 -1.17282*_pexp_x^2 + 1:0 +); +proj(X,A,B) = ( +_AB = B - A; +P = A + dot(X - A,_AB)/max(1e-8,dot(_AB,_AB))*_AB; +); +deltaE00(lab1,lab2) = ( +_deltaE00_deg2rad(deg) = (deg*pi/180); +unref(_deltaE00_lab1); _deltaE00_lab1 = lab1; +unref(_deltaE00_lab2); _deltaE00_lab2 = lab2; +unref(_deltaE00_k_L); const _deltaE00_k_L = 1; +unref(_deltaE00_k_C); const _deltaE00_k_C = 1; +unref(_deltaE00_k_H); const _deltaE00_k_H = 1; +unref(_deltaE00_deg360inrad); const _deltaE00_deg360inrad = _deltaE00_deg2rad(360); +unref(_deltaE00_deg180inrad); const _deltaE00_deg180inrad = _deltaE00_deg2rad(180); +unref(_deltaE00_pow25to7); const _deltaE00_pow25to7 = 25^7; +_deltaE00_C1 = norm(_deltaE00_lab1[1,2]); +_deltaE00_C2 = norm(_deltaE00_lab2[1,2]); +_deltaE00_barC = (_deltaE00_C1 + _deltaE00_C2)/2; +_deltaE00_G = 0.5*(1 - sqrt(_deltaE00_barC^7/(_deltaE00_barC^7 + _deltaE00_pow25to7))); +_deltaE00_a1prime = (1 + _deltaE00_G)*_deltaE00_lab1[1]; +_deltaE00_a2prime = (1 + _deltaE00_G)*_deltaE00_lab2[1]; +_deltaE00_Cprime1 = norm(_deltaE00_a1prime,_deltaE00_lab1[2]); +_deltaE00_Cprime2 = norm(_deltaE00_a2prime,_deltaE00_lab2[2]); +!_deltaE00_lab1[2] && !_deltaE00_a1prime?( +_deltaE00_hprime1 = 0; +):( +_deltaE00_hprime1 = atan2(_deltaE00_lab1[2],_deltaE00_a1prime); +_deltaE00_hprime1<0?(_deltaE00_hprime1+=_deltaE00_deg360inrad); +!_deltaE00_lab2[2] && !_deltaE00_a2prime?( +_deltaE00_hprime2 = 0; +):( +_deltaE00_hprime2 = atan2(_deltaE00_lab2[2],_deltaE00_a2prime); +_deltaE00_hprime2<0?(_deltaE00_hprime2+=_deltaE00_deg360inrad); +); +); +_deltaE00_deltaLprime = _deltaE00_lab2[0] - _deltaE00_lab1[0]; +_deltaE00_deltaCprime = _deltaE00_Cprime2 - _deltaE00_Cprime1; +_deltaE00_CprimeProduct = _deltaE00_Cprime1*_deltaE00_Cprime2; +!_deltaE00_CprimeProduct?( +_deltaE00_deltahprime = 0; +):( +_deltaE00_deltahprime = _deltaE00_hprime2 - _deltaE00_hprime1; +_deltaE00_deltahprime<-_deltaE00_deg180inrad?( +_deltaE00_deltahprime += _deltaE00_deg360inrad; +):_deltaE00_deltahprime>_deltaE00_deg180inrad?( +_deltaE00_deltahprime -= _deltaE00_deg360inrad; +); +); +_deltaE00_deltaHprime = 2*sqrt(_deltaE00_CprimeProduct)*sin(_deltaE00_deltahprime/2); +_deltaE00_barLprime = (_deltaE00_lab1[0] + _deltaE00_lab2[0])/2; +_deltaE00_barCprime = (_deltaE00_Cprime1 + _deltaE00_Cprime2)/2; +_deltaE00_hprimeSum = _deltaE00_hprime1 + _deltaE00_hprime2; +!(_deltaE00_Cprime1*_deltaE00_Cprime2)?( +_deltaE00_barhprime = _deltaE00_hprimeSum; +):( +abs(_deltaE00_hprime1 - _deltaE00_hprime2)<=_deltaE00_deg180inrad?( +_deltaE00_barhprime = _deltaE00_hprimeSum/2; +):( +_deltaE00_hprimeSum<_deltaE00_deg360inrad?( +_deltaE00_barhprime = (_deltaE00_hprimeSum + _deltaE00_deg360inrad)/2; +):( +_deltaE00_barhprime = (_deltaE00_hprimeSum - _deltaE00_deg360inrad)/2; +); +); +); +_deltaE00_T = 1.0 - (0.17*cos(_deltaE00_barhprime - _deltaE00_deg2rad(30))) + +(0.24*cos(2*_deltaE00_barhprime)) + +(0.32*cos(3*_deltaE00_barhprime + _deltaE00_deg2rad(6))) - +(0.2*cos(4*_deltaE00_barhprime - _deltaE00_deg2rad(63))); +_deltaE00_deltaTheta = _deltaE00_deg2rad(30)* +exp(-((_deltaE00_barhprime - _deltaE00_deg2rad(275)) / _deltaE00_deg2rad(25))^2); +_deltaE00_R_C = 2*sqrt(_deltaE00_barCprime^7/(_deltaE00_barCprime^7 + _deltaE00_pow25to7)); +_deltaE00_S_L = 1 + 0.015*(_deltaE00_barLprime - 50)^2/sqrt(20 + (_deltaE00_barLprime - 50)^2); +_deltaE00_S_C = 1 + 0.045*_deltaE00_barCprime; +_deltaE00_S_H = 1 + 0.015*_deltaE00_barCprime*_deltaE00_T; +_deltaE00_R_T = -sin(2*_deltaE00_deltaTheta)* _deltaE00_R_C; +sqrt((_deltaE00_deltaLprime/(_deltaE00_k_L*_deltaE00_S_L))^2 + +(_deltaE00_deltaCprime/(_deltaE00_k_C*_deltaE00_S_C))^2 + +(_deltaE00_deltaHprime/(_deltaE00_k_H*_deltaE00_S_H))^2 + +_deltaE00_R_T*_deltaE00_deltaCprime/(_deltaE00_k_C*_deltaE00_S_C)* +_deltaE00_deltaHprime/(_deltaE00_k_H*_deltaE00_S_H)); +); +_next_edgel4(k,P,op) = ( +ref(P#[0],_u); ref(P#[1],_v); +!P#[2]?(i(#k,_u,_nv = _v + 1,0,0)#op?[ _u,_v,1 ]:i(#k,_nu = _u + 1,_nv,0,0)#op?[ _u,_nv,0 ]:[ _nu,_nv,3 ]): +P#[2]==1?(i(#k,_pu = _u - 1,_v,0,0)#op?[ _u,_v,2 ]:i(#k,_pu,_nv = _v + 1,0,0)#op?[ _pu,_v,1 ]:[ _pu,_nv,0 ]): +P#[2]==2?(i(#k,_u,_pv = _v - 1,0,0)#op?[ _u,_v,3 ]:i(#k,_pu = _u - 1,_pv,0,0)#op?[ _u,_pv,2 ]:[ _pu,_pv,1 ]): +(i(#k,_nu = _u + 1,_v,0,0)#op?[ _u,_v,0 ]:i(#k,_nu,_pv = _v - 1,0,0)#op?[ _nu,_v,3 ]:[ _nu,_pv,2 ]); +); +next_edgel4_fg(k,P,fg) = _next_edgel4(#k,#P,!=fg); # Next edgel, 4-connexity (foreground value specified) +next_edgel4_bg(k,P,bg) = _next_edgel4(#k,#P,==bg); # Next edgel, 4-connexity (background value specified) +_previous_edgel4(k,P,op) = ( +ref(P#[0],_u); ref(P#[1],_v); +!P#[2]?(i(#k,_u,_pv = _v - 1,0,0)#op?[ _u,_v,3 ]:i(#k,_nu = _u + 1,_pv,0,0)#op?[ _u,_pv,0 ]:[ _nu,_pv,1 ]): +P#[2]==1?(i(#k,_nu = _u + 1,_v,0,0)#op?[ _u,_v,0 ]:i(#k,_nu,_nv = _v + 1,0,0)#op?[ _nu,_v,1 ]:[ _nu,_nv,2 ]): +P#[2]==2?(i(#k,_u,_nv = _v + 1,0,0)#op?[ _u,_v,1 ]:i(#k,_pu = _u - 1,_nv,0,0)#op?[ _u,_nv,2 ]:[ _pu,_nv,3 ]): +(i(#k,_pu = _u - 1,_v,0,0)#op?[ _u,_v,2 ]:i(#k,_pu,_pv = _v - 1,0,0)#op?[ _pu,_v,3 ]:[ _pu,_pv,0 ]); +); +previous_edgel4_fg(k,P,fg) = _previous_edgel4(#k,#P,!=fg); # Previous edgel, 4-connexity (foreground value specified) +previous_edgel4_bg(k,P,bg) = _previous_edgel4(#k,#P,==bg); # Previous edgel, 4-connexity (background value specified) +_next_edgel8(k,P,op) = ( +ref(P#[0],_u); ref(P#[1],_v); +!P#[2]?(i(#k,_nu = _u + 1,_nv = _v + 1,0,0)#op?[ _nu,_nv,3 ]:i(#k,_u,_nv,0,0)#op?[ _u,_nv,0 ]:[ _u,_v,1 ]): +P#[2]==1?(i(#k,_pu = _u - 1,_nv = _v + 1,0,0)#op?[ _pu,_nv,0 ]:i(#k,_pu,_v,0,0)#op?[ _pu,_v,1 ]:[ _u,_v,2 ]): +P#[2]==2?(i(#k,_pu = _u - 1,_pv = _v - 1,0,0)#op?[ _pu,_pv,1 ]:i(#k,_u,_pv,0,0)#op?[ _u,_pv,2 ]:[ _u,_v,3 ]): +(i(#k,_nu = _u + 1,_pv = _v - 1,0,0)#op?[ _nu,_pv,2 ]:i(#k,_nu,_v,0,0)#op?[ _nu,_v,3 ]:[ _u,_v,0 ]); +); +next_edgel8_fg(k,P,fg) = _next_edgel8(#k,#P,==fg); # Next edgel, 8-connexity (foreground value specified) +next_edgel8_bg(k,P,bg) = _next_edgel8(#k,#P,!=bg); # Next edgel, 8-connexity (background value specified) +_previous_edgel8(k,P,op) = ( +ref(P#[0],_u); ref(P#[1],_v); +!P#[2]?(i(#k,_nu = _u + 1,_pv = _v - 1,0,0)#op?[ _nu,_pv,1 ]:i(#k,_u,_pv,0,0)#op?[ _u,_pv,0 ]:[ _u,_v,3 ]): +P#[2]==1?(i(#k,_nu = _u + 1,_nv = _v + 1,0,0)#op?[ _nu,_nv,2 ]:i(#k,_nu,_v,0,0)#op?[ _nu,_v,1 ]:[ _u,_v,0 ]): +P#[2]==2?(i(#k,_pu = _u - 1,_nv = _v + 1,0,0)#op?[ _pu,_nv,3 ]:i(#k,_u,_nv,0,0)#op?[ _u,_nv,2 ]:[ _u,_v,1 ]): +(i(#k,_pu = _u - 1,_pv = _v - 1,0,0)#op?[ _pu,_pv,0 ]:i(#k,_pu,_v,0,0)#op?[ _pu,_v,3 ]:[ _u,_v,2 ]); +); +previous_edgel8_fg(k,P,fg) = _previous_edgel8(#k,#P,==fg); # Previous edgel, 8-connexity (foreground value specified) +previous_edgel8_bg(k,P,bg) = _previous_edgel8(#k,#P,!=bg); # Previous edgel, 8-connexity (background value specified) +" +#@cli mad +#@cli : Return the MAD (Maximum Absolute Deviation) of the last selected image. +#@cli : The MAD is defined as MAD = med_i|x_i-med_j(x_j)| +mad : +if $! +-. {ic} abs. u {1.4826*ic} rm. else u 0 fi +#@cli max_w +#@cli : Return the maximal width between selected images. +max_w : +_minmax_whds max,0,1 +#@cli max_h +#@cli : Return the maximal height between selected images. +max_h : +_minmax_whds max,1,1 +#@cli max_d +#@cli : Return the maximal depth between selected images. +max_d : +_minmax_whds max,2,1 +#@cli max_s +#@cli : Return the maximal spectrum between selected images. +max_s : +_minmax_whds max,3,1 +#@cli max_wh +#@cli : Return the maximal wxh size of selected images. +max_wh : +_minmax_whds max,0,2 +#@cli max_whd +#@cli : Return the maximal wxhxd size of selected images. +max_whd : +_minmax_whds max,0,3 +#@cli max_whds +#@cli : Return the maximal wxhxdxs size of selected images. +max_whds : +_minmax_whds max,0,4 +#@cli median_vectors +#@cli : Return the median vector value of the last selected image (median computed channel by channel) +median_vectors : +u {"expr('med(crop(#-1,0,0,0,y,w#-1,h#-1,d#-1,1))',1,s#-1)"} +#@cli min_w +#@cli : Return the minimal width between selected images. +min_w : +_minmax_whds min,0,1 +#@cli min_h +#@cli : Return the minimal height between selected images. +min_h : +_minmax_whds min,1,1 +#@cli min_d +#@cli : Return the minimal depth between selected images. +min_d : +_minmax_whds min,2,1 +#@cli min_s +#@cli : Return the minimal s size of selected images. +min_s : +_minmax_whds min,3,1 +#@cli min_wh +#@cli : Return the minimal wxh size of selected images. +min_wh : +_minmax_whds min,0,2 +#@cli min_whd +#@cli : Return the minimal wxhxd size of selected images. +min_whd : +_minmax_whds min,0,3 +#@cli min_whds +#@cli : Return the minimal wxhxdxs size of selected images. +min_whds : +_minmax_whds min,0,4 +_minmax_whds : +u {" +mw = w; mh = h; md = d; ms = s; +repeat (l,k, +mw = $1(mw,w#k); +mh = $1(mh,h#k); +md = $1(md,d#k); +ms = $1(ms,s#k); +); +([mw,mh,md,ms])[$2,$3]"} +#@cli name2color : name +#@cli : Return the R,G,B color that matches the specified color name. +name2color : +strvar "$1" name=${} +_color2name +names={`"s = ['"{n}"']; m = !(s-_'~')*(_'_'-_'~'); s+=m; lowercase(s)"`} +l. { +s x => $names u {$name,^} rm +onfail rm error[0--3] "Command 'name2color': Unknown color '$1'." +} +#@cli nmd : eq. to 'named' : (+) +#@cli named : _mode,"name1","name2",... : (+) +#@cli : Return the set of indices corresponding to images of the selection with specified names. +#@cli : After this command returns, the status contains a list of indices (unsigned integers), +#@cli : separated by commas (or an empty string if no images with those names have been found). +#@cli : (eq. to 'nmd'). +#@cli : 'mode' can be { 0:all indices (default) | 1:lowest index | 2:highest index | 3:all indices (case insensitive) | 4:lowest index (case insensitive) | 5:highest index (case insensitive)} +#@cli narg : arg1,arg2,...,argN +#@cli : Return number of specified arguments. +narg : +u $# +#@cli normalize_filename : filename +#@cli : Return a "normalized" version of the specified filename, without spaces and capital letters. +normalize_filename : +('"$1"') f. "i>=65 && i<=90?i+32:i==32?95:i" u {t} rm. +#@cli oct : octal_int1,... +#@cli : Print specified octal integers into their binary, decimal, hexadecimal and string representations. +oct : +dec=${oct2dec\ ${^0}} +e[^-1] "Convert octal integer"${arg0\ ($#>1),"",s}" '${^0}' to binary '"${dec2bin\ $dec}"', decimal '"$dec"', +hexadecimal '"${dec2hex\ $dec}"' and string '"${dec2str\ $dec}"'." +#@cli oct2dec : octal_int1,... +#@cli : Convert specified octal integers into their decimal representations. +oct2dec : +$=arg res,sep= repeat $# { res=$res$sep${_$0\ ${arg{$>+1}}} sep=, } u $res +_oct2dec : +u {"str = v2s(abs($1)); +for (k = val = 0, str[k], ++k, +c = str[k]; +(val<<=3)+=(c>=_'0' && c<=_'7'?c - _'0':nan); +isnan(val)?break() +); sign($1)*val"} +ovh2stats : skip "${1=gmic.eu-*-*-*.log.gz}" +e[^-1] "Generate statistics on the usage of G'MIC-Qt from OVH server logfiles '$1'." +use_vt100 +files "$1" files=${} +e "* Load log files." +if !narg(${}) error[0--2] "No OVH logfiles matching name '$1' have been found." fi +repeat narg(${}) { +arg0 $>,$files file=${} +day,month,year:="str = ['"$file"']; +t1 = find(str,_'-') + 1; +t2 = find(str,_'-',t1) + 1; +t3 = find(str,_'-',t2) + 1; +t1>0 && t2>t1 && t3>t2?( +day = s2v(str,t1); +month = s2v(str,t2); +year = s2v(str,t3); +[ day,month,year ]; +):[0,0,0]" +if !$day&&!$month&&!$year day,month,year=n.a fi +e " > "$year/$month/$day:" "$_vt100_g$file$_vt100_n +it $file +if "find(#-1,['G'MIC-Qt for '])<0" +rm. i raw:$file,uint8 o. raw:${-path_tmp}gmic.gz,uint8 rm. +x "gunzip -f "${-path_tmp}gmic.gz +it ${-path_tmp}gmic +fi +=> ${year}_${month}_${day} +} +foreach { +nm={n} +s -,{'\n'} +eval " +str = ['G'MIC-Qt']; +to_keep = vectorl(); +p = 0; +repeat (l,k, find(#k,str)>=0?(to_keep[p++] = k)); +store('to_keep',to_keep,p); +run('$to_keep k[{^}]')" +if $!>1 i[1--2] ('\n') fi +a y +=> $nm +} +e "\n* Analyze log files (day by day)." ++_ovh2stats +e "\n* Analyze log files (all days)." +a y _ovh2stats +_ovh2stats : +v + N=$! +foreach { +('{n}') replace. {'_'},{'^'} ({t}) +date={`[v2s(i0,0,4),_'/',i1<10?[_'0',i1+_'0']:v2s(i1,0,2),_'/',i2<10?[_'0',i2+_'0']:v2s(i2,0,2)]`} +s -,{'\n'} +eval " +name = vector256(); +repeat (l,k, +p = find(#k,_' '); +copy(name,i[#k,0],p); +name[p] = 0; +run('name[',k,'] ',name); +)" +eval " +const N = "$!"; +ref(vector(#2*N),tab); +repeat (N,k, +ref(name(#k,256),nam); +for (i = j = 0, i=0?++gimp: +find(str,'krita')>=0?++krita: +find(str,'8bf')>=0?++_8bf: +find(str,'paint.net')>=0?++paintdotnet: +find(str,'digikam')>=0?++digikam: +++standalone; +find(str,'windows')>=0?++windows: +find(str,'linux')>=0?++linux: +find(str,'mac os')>=0?++macos: +find(str,'bsd')>=0?++bsd: +++unknown; +(eos = find(str,0))<0?(eos = size(str)); +space = find(str,_' ',eos,-1); +ver = sum(([ str[space + 1],str[space + 3],str[space + 5] ] - _'0')*[ 100,10,1 ]); +++versions[ver]; +find(str,'_pre#')>=0?++prereleases; +++ips; +); +store('features', +[ips,gimp,krita,_8bf,paintdotnet,digikam,standalone,windows,linux,macos,bsd,unknown,prereleases]); +store('versions',versions)" +rm $features +ips,gimp,krita,_8bf,paintdotnet,digikam,standalone,windows,linux,macos,bsd,unknown,prereleases={^} +$versions +a y +if $N>1 +e " > "$date": "${_vt100_b}"Unique IPs"${_vt100_n}" = "$ips" (100%)," +e " "${_vt100_m}${_vt100_b}"GIMP"${_vt100_n}" = "$gimp" ("{_round($gimp/$ips*100,0.1)}"%), "${_vt100_c}${_vt100_b}"Krita"${_vt100_n}" = "$krita" ("{_round($krita/$ips*100,0.1)}"%), "${_vt100_g}${_vt100_b}"8bf"${_vt100_n}" = "$_8bf" ("{_round($_8bf/$ips*100,0.1)}"%), "${_vt100_r}${_vt100_b}"Paint.NET"${_vt100_n}" = "$paintdotnet" ("{_round($paintdotnet/$ips*100,0.1)}"%), "${_vt100_m}${_vt100_b}"Digikam"${_vt100_n}" = "$digikam" ("{_round($digikam/$ips*100,0.1)}"%), "${_vt100_c}${_vt100_b}"Standalone"${_vt100_n}" = "$standalone" ("{_round($standalone/$ips*100,0.1)}"%)." +e " "${_vt100_r}${_vt100_b}"Windows"${_vt100_n}" = "$windows" ("{_round($windows/$ips*100,0.1)}"%), "${_vt100_g}${_vt100_b}"Linux"${_vt100_n}" = "$linux" ("{_round($linux/$ips*100,0.1)}"%), "${_vt100_m}${_vt100_b}"Mac OS"${_vt100_n}" = "$macos" ("{_round($macos/$ips*100,0.1)}"%), "${_vt100_c}${_vt100_b}"BSD"${_vt100_n}" = "$bsd" ("{_round($bsd/$ips*100,0.1)}"%), "${_vt100_c}${_vt100_b}"Unknown"${_vt100_n}" = "$unknown" ("{_round($unknown/$ips*100,0.1)}"%)." +e " "${_vt100_b}"Prereleases"${_vt100_n}" = "$prereleases" ("{_round($prereleases/$ips*100,0.1)}"%)." +_ovh2stats_versions +fi +} ++ / $N round. ++z. 0,0,12,0 ips,gimp,krita,_8bf,paintdotnet,digikam,standalone,windows,linux,macos,bsd,unknown,prereleases={^} rm. +summary0,summary1="Total: ","Average: " +e " > "${summary{$N>1}}${_vt100_b}"Unique IPs"${_vt100_n}" = "$ips" (100%)," +e " "${_vt100_m}${_vt100_b}"GIMP"${_vt100_n}" = "$gimp" ("{_round($gimp/$ips*100,0.1)}"%), "${_vt100_c}${_vt100_b}"Krita"${_vt100_n}" = "$krita" ("{_round($krita/$ips*100,0.1)}"%), "${_vt100_g}${_vt100_b}"8bf"${_vt100_n}" = "$_8bf" ("{_round($_8bf/$ips*100,0.1)}"%), "${_vt100_r}${_vt100_b}"Paint.NET"${_vt100_n}" = "$paintdotnet" ("{_round($paintdotnet/$ips*100,0.1)}"%), "${_vt100_m}${_vt100_b}"Digikam"${_vt100_n}" = "$digikam" ("{_round($digikam/$ips*100,0.1)}"%), "${_vt100_c}${_vt100_b}"Standalone"${_vt100_n}" = "$standalone" ("{_round($standalone/$ips*100,0.1)}"%)." +e " "${_vt100_r}${_vt100_b}"Windows"${_vt100_n}" = "$windows" ("{_round($windows/$ips*100,0.1)}"%), "${_vt100_g}${_vt100_b}"Linux"${_vt100_n}" = "$linux" ("{_round($linux/$ips*100,0.1)}"%), "${_vt100_m}${_vt100_b}"Mac OS"${_vt100_n}" = "$macos" ("{_round($macos/$ips*100,0.1)}"%), "${_vt100_c}${_vt100_b}"BSD"${_vt100_n}" = "$bsd" ("{_round($bsd/$ips*100,0.1)}"%), "${_vt100_c}${_vt100_b}"Unknown"${_vt100_n}" = "$unknown" ("{_round($unknown/$ips*100,0.1)}"%)." +e " "${_vt100_b}"Prereleases"${_vt100_n}" = "$prereleases" ("{_round($prereleases/$ips*100,0.1)}"%)." +_ovh2stats_versions +rm +_ovh2stats_versions : +v + +rows. 100% +l. { +ips:=is ++f x a y sort -,x eo0:=min(9,find(crop(),0)) +if $eo0 +str= v=0 c= +for i($v,0)>0" && "$v<9 { +str.=$c${_vt100_b}{i($v,1)}${_vt100_n}" ("{i($v,0)}": "{_round(i($v,0)/$ips*100,0.1)}"%)" +v+=1 c=", " +} +e " "${_vt100_c}${_vt100_b}"Version"${_vt100_n}" = "$str".\n" +fi +rm +} +#@cli padint : number,_size>0 +#@cli : Return a integer with 'size' digits (eventually left-padded with '0'). +padint : check "isint($1)" skip ${2=4} +u "" repeat $2 { u ${}{int($1/10^$<)%10} } +#@cli path_cache +#@cli : Return a path to store G'MIC data files for one user (whose value is OS-dependent). +path_cache : +if !narg({'$_path_cache'}) +_path_cache=$_path_rc +if ['$GMIC_CACHE_PATH']!=0 _patch_cache=$GMIC_CACHE_PATH +elif !${-is_windows} +if isdir(['{/$HOME/.cache}']) _path_cache=$HOME/.cache/gmic/ +elif ['$XDG_CACHE_HOME']!=0 _path_cache=$XDG_CACHE_HOME/gmic/ +fi +if !isdir('{/$_path_cache}') x "mkdir -p "$_path_cache fi +fi +fi +u $_path_cache +#@cli path_current +#@cli : Return current folder from where G'MIC has been run. +path_current : +if !${-is_windows} +filename=${-path_tmp}gmic_pwd +l[] { x "pwd > "$filename it $filename autocrop {'\n'} autocrop {'" "'} u {t}/ rm onfail u "./" } +else u "./" +fi +#@cli path_gimp +#@cli : Return a path to store GIMP configuration files for one user (whose value is OS-dependent). +path_gimp : +if !narg({'$_path_gimp'}) +if narg({'${GIMP2_DIRECTORY}'}) _path_gimp=${GIMP2_DIRECTORY} +elif narg({'${USERPROFILE}'}) _path_gimp=${USERPROFILE} +elif narg({'${HOME}'}) _path_gimp=${HOME} +fi +if ${-is_windows} sep={`92`} else sep=/ fi +if isdir(['{/$_path_gimp${sep}AppData${sep}Roaming${sep}GIMP${sep}2.10}']) +_path_gimp=$_path_gimp${sep}AppData${sep}Roaming${sep}GIMP${sep}2.10${sep} +elif isdir(['{/$_path_gimp${sep}AppData${sep}Roaming${sep}GIMP${sep}2.8}']) +_path_gimp=$_path_gimp${sep}AppData${sep}Roaming${sep}GIMP${sep}2.8${sep} +elif isdir(['{/$_path_gimp${sep}.config${sep}GIMP${sep}2.10}']) +_path_gimp=$_path_gimp${sep}.config${sep}GIMP${sep}2.10${sep} +elif isdir(['{/$_path_gimp${sep}.gimp-2.8}']) +_path_gimp=$_path_gimp${sep}.gimp-2.8${sep} +elif isdir(['{/$_path_gimp${sep}.gimp-2.6}']) +_path_gimp=$_path_gimp${sep}.gimp-2.6${sep} +else +_path_gimp=${-path_tmp} +fi +fi +u $_path_gimp +#@cli path_tmp +#@cli : Return a path to store temporary files (whose value is OS-dependent). +path_tmp : +if !narg({'$_path_tmp'}) +if narg({'${TMP}'}) _path_tmp=${TMP} +elif narg({'${TEMP}'}) _path_tmp=${TEMP} +elif narg({'${TMPDIR}'}) _path_tmp=${TMPDIR} +elif narg({'${HOME}'}) _path_tmp="/tmp" +fi +if ${-is_windows} _path_tmp=$_path_tmp{`92`} else _path_tmp=$_path_tmp/ fi +fi +u $_path_tmp +#@cli remove_copymark +#@cli : Remove copymark suffix in names of selected images. +remove_copymark : +foreach { +=> {`" +nm = ['"{n}'"]; +const siz = size(nm); +i = find(nm,'_c',siz - 1,-1); +inrange(i,0,siz - 3) && inrange(nm[i + 2],_'1',_'9')?( +ext = ['"{x}"']; +size(ext)?copy(nm[i],[_'.',ext,0]):(nm[i] = 0); +); nm;"`} +} +render_donations : skip "${1="$HOME"/work/src/private_tschumperle/gmic_donations.csv}",${2=0} +use_vt100 +nb_months:=$2?$2:4 +l[] { +"$1" +eur2usd:=1/0.873824 +nb_entries:=h +repeat $nb_entries { e=$> +date_$e={`I(0,$e)`} +name_$e={`I(1,$e)`} +type_$e={`I(2,$e)`} +currency_$e={`lowercase(I(3,$e))`} +donation_$e={{`I(4,$e)`}} +charge_paypal_$e={{`I(5,$e)`}} +charge_lila_$e={{`I(6,$e)`}} +mail_$e={`I(7,$e)`} +message_$e={`I(8,$e)`} +l[] { +('${date_$e}') s -,{'/'} day_$e,month_$e,year_$e={0,t},{1,t},{2,t} rm +edate_$e:=${day_$e}+100*(${month_$e}+100*${year_$e}) +} +donation_charged_$e:=${donation_$e}+${charge_paypal_$e}+${charge_lila_$e} +if ['${currency_$e}']=='eur' +donation_eur_$e=${donation_$e} +donation_charged_eur_$e=${donation_charged_$e} +donation_usd_$e:=${donation_$e}*$eur2usd +donation_charged_usd_$e:=${donation_charged_$e}*$eur2usd +else +donation_usd_$e=${donation_$e} +donation_charged_usd_$e=${donation_charged_$e} +donation_eur_$e:=${donation_$e}/$eur2usd +donation_charged_eur_$e:=${donation_charged_$e}/$eur2usd +fi +if ${donation_$e}>=10 col=$_vt100_r else col= fi +e "- ["$_vt100_c$_vt100_b"#"$e$_vt100_n" - "$_vt100_c${date_$e}$_vt100_n"] "$col$_vt100_b{_${donation_$e}}" "${currency_$e}$_vt100_n" (paypal: "{_${charge_paypal_$e}}" "${currency_$e}," lila: "{_${charge_lila_$e}}" "${currency_$e}" ->"" "{_${donation_charged_$e}}" "${currency_$e}" ="" "{_${donation_charged_eur_$e}}" eur),"" from "${name_$e}" ("${mail_$e}") : '"$_vt100_b${message_$e}$_vt100_n"'" +} +rm +e "" +all_eur,all_usd,all_charged_eur,all_charged_usd,asep_eur,asep_usd= +repeat $nb_months { +edate:=y=date(0);m=date(1)-1-$>;while(m<=0,--y;m+=12);100*y+m +s_month=${"arg "$edate%100",January,February,March,April,May,June,July,August,September,October,November,December"} +s_year:=int($edate/100) +month_eur,month_charged_eur,month_usd,month_charged_usd,msep_eur,msep_usd= +nb_sponsors=0 +repeat $nb_entries { e=$> +if $edate==int(${edate_$e}/100) +currency=${currency_$e} +val_eur=${donation_eur_$e} +val_charged_eur=${donation_charged_eur_$e} +val_usd=${donation_usd_$e} +val_charged_usd=${donation_charged_usd_$e} +nb_sponsors+=1 +if ['${currency_$e}']=='eur' +all_eur.=$asep_eur$val_eur +all_charged_eur.=$asep_eur$val_charged_eur +month_eur.=$msep_eur$val_eur +month_charged_eur.=$msep_eur$val_charged_eur +asep_eur=, msep_eur=, +else +all_usd.=$asep_usd$val_usd +all_charged_usd.=$asep_usd$val_charged_usd +month_usd.=$msep_usd$val_usd +month_charged_usd.=$msep_usd$val_charged_usd +asep_usd=, msep_usd=, +fi +fi +} +month_sum_eur:=sum(0$month_eur)+sum(0$month_usd)/$eur2usd +month_sum_charged_eur:=sum(0$month_charged_eur)+sum(0$month_charged_usd)/$eur2usd +e "* "$_vt100_c$_vt100_b$s_month" "$s_year": "$_vt100_n$_vt100_b{_$month_sum_eur}" eur"$_vt100_n" (charged: "{_$month_sum_charged_eur}" eur)"" = "{_sum(0$month_eur)}" eur"$_vt100_n" (charged: "{_sum(0$month_charged_eur)}" eur)"" + "{_sum(0$month_usd)}" usd (charged: "{_sum(0$month_charged_usd)}" usd)" +600,30,1,3,'x<$month_sum_eur?[139,181,173]+(y>h/2?0:40):[220,230,240]' r. 500,30,1,3 c. 0,255 +shape_circle 24 s. x,2 s[-2,-1] y,2 +ri[-4] [-5],0,1,0,0 ri[-3] [-5],0,1,0,1 ri[-2] [-5],0,1,1,0 ri[-1] [-5],0,1,1,1 min[-4--1] +channels. 0 *.. . *. 255 a[-2,-1] c +r. {[w,h]+4},1,100%,0,0,0.5,0.5 +sh. 100% dilate_circ. 3 b. 1 rm. +t. $s_month" "$s_year,0.02~,0.5~,24,0.5,0,0,0,255 +t. {_round($month_sum_eur)}" \37 = "{_round($month_sum_eur*$eur2usd)}" $",0.5~,0.5~,24,1,0,0,0,255 +t. $nb_sponsors" sponsor"${"if "$nb_sponsors"!=1 u s else u \"\" fi"},0.97~,0.5~,24,0.5,0,0,0,255 +} +rv +all_max:=max($all_eur,[$all_usd]/$eur2usd) +all_min:=min($all_eur,[$all_usd]/$eur2usd) +all_sum_eur:=sum($all_eur) +all_sum_usd:=sum($all_usd) +all_sum_charged_eur:=sum($all_charged_eur) +all_sum_charged_usd:=sum($all_charged_usd) +all_avg:=avg($all_eur,[$all_usd]/$eur2usd) +all_med:=med($all_eur,[$all_usd]/$eur2usd) +0 t. "Avg: "{_max(0.1,round($all_avg,0.1))}"\37 / ""Med: "{_max(0.1,round($all_med,0.1))}"\37 / ""Min: "{_max(0.1,round($all_min,0.1))}"\37 / ""Max: "{_max(0.1,round($all_max,0.1))}"\37",0,0,24,1,1 +*. 200 i[-2] 100%,100%,1,3 a[-2,-1] c +rows -5,100% a y,0.5 r2dx 480 +if !$2 o $HOME/work/src/gmic/html/img/donations_latest_months.png fi +} +total_eur:=$all_sum_eur+$all_sum_usd/$eur2usd +total_charged_eur:=$all_sum_charged_eur+$all_sum_charged_usd/$eur2usd +e "\n==> "$_vt100_c${_vt100_b}"TOTAL : "$_vt100_n$_vt100_b{_floor($total_eur)}" eur"$_vt100_n" (charged : "{_floor($total_charged_eur)}" eur)"" = "{_floor($all_sum_eur)}" eur (charged: "{_floor($all_sum_charged_eur)}" eur)"" + "{_floor($all_sum_usd)}" usd (charged: "{_floor($all_sum_charged_usd)}" usd)\n" +sp gmicky,{h} +l[-2,-1] { +rgb:=I(w-1) to_rgba rv +frame 10,10,0,0,0,0 +drgba $rgb a x +shape_heart 82 +r. 100%,100%,1,3 hsv2rgb. rv[-2,-1] *. 255 a[-2,-1] c +r. ..,..,1,100%,0,0,0.23,0.15 drop_shadow. 3,3,2,0,0 +blend alpha,0.7 r2dx 500 +if !$2 o $HOME/Desktop/donations_latest_months.jpg,85 rm return fi +} +l[] { +$HOME/work/src/gmic/html/img/icon_coin.png +N=0 +text$N,r$N,g$N,b$N,file$N="2 \37",32,48,32,"don_2eur.png" N+=1 +text$N,r$N,g$N,b$N,file$N="5 \37",200,200,200,"don_5eur.png" N+=1 +text$N,r$N,g$N,b$N,file$N="10 \37",190,100,100,"don_10eur.png" N+=1 +text$N,r$N,g$N,b$N,file$N="+ \37",255,128,0,"don_moreeur.png" N+=1 +text$N,r$N,g$N,b$N,file$N="2 $",32,48,32,"don_2usd.png" N+=1 +text$N,r$N,g$N,b$N,file$N="5 $",200,200,200,"don_5usd.png" N+=1 +text$N,r$N,g$N,b$N,file$N="10 $",190,100,100,"don_10usd.png" N+=1 +text$N,r$N,g$N,b$N,file$N="+ $",255,128,0,"don_moreusd.png" N+=1 +repeat $N { +l[0] { +frame. 10,10,0,0,0,0 +sh. 0,2 +(${r$>}^${g$>}^${b$>}) rgb2hsl[-2,-1] H,S:=R,G rm. +l. { s c -[0] {ia#0-$H} %[0] 360 -[1] {ia#1-$S} +[2] 0.1 /[1] 2 c[1,2] 0,1 a c } +hsl2rgb. rm. +sh. 100% dilate_circ. 10 rm. +100%,100% t. ${text$>},0.5~,0.5~,45%,1,255 dilate_circ. 10 +dilate_circ. 15 to_rgb.. a[-2,-1] c +blend[-2,-1] alpha drop_shadow. 1,1 r2dx. 48 frame 10,5,0,0,0,0 +outfile=$HOME/work/src/gmic/html/img/${file$>} +if !isfile('$outfile') o. $outfile fi +rm. +} } +rm[0] +} +#@cli reset +#@cli : Reset global parameters of the interpreter environment. +reset : +e[^-1] "Reset global parameters of the interpreter environment." +db3d m3d md3d f3d l3d sl3d ss3d +#@cli rgb +#@cli : Return a random int-valued RGB color. +rgb : +u {round(u(255))},{round(u(255))},{round(u(255))} +RGB : rgb +#@cli rgba +#@cli : Return a random int-valued RGBA color. +rgba : +u {round(u(255))},{round(u(255))},{round(u(255))},{round(u(255))} +RGBA : rgba +#@cli shell_cols +#@cli : Return the estimated number of columns of the current shell. +shell_cols : +if ${-is_windows}" || "${-is_macos} u 80 +else +filename_rand filename=${} +l[] { cols=80 x "tput cols > "$filename it $filename if isint({t}) cols={{t}} fi rm onfail cols=80 rm } +delete $filename +u $cols +fi +#@cli size_value +#@cli : Return the size (in bytes) of image values. +size_value : +u {str=['$_pixeltype'];str=='float32'?4:str=='float64'?8:0} +#@cli std_noise +#@cli : Return the estimated noise standard deviation of the last selected image. +std_noise : +if $! +laplacian. -. {ic} abs. u {1.4826*ic/sqrt(d==1?20:42)} rm. else u 0 fi +#@cli str : string +#@cli : Print specified string into its binary, octal, decimal and hexadecimal representations. +str : skip "$1" +dec={'"$*"'} +e[^-1] "Convert string '$*' to binary '"${dec2bin\ $dec}"', octal '"${dec2oct\ $dec}"', decimal '"$dec"' and +hexadecimal '"${dec2hex\ $dec}"'." +#@cli strbuffer : buffer_size +#@cli : Return a string describing a size for the specified buffer size. +strbuffer : +u {`"const limit = 10000; +unit = vector4(); +siz = $1; +siz=0"} +#@cli strclut : "string" +#@cli : Return simplified version of the specified string that can be used as a CLUT name. +strclut : +0 => "$1" nm={b} rm. +u {`"ss = lowercase([['"{/$nm}"'],0]); +const N = 2*size(ss); +sd = vectorN(); +for (ps = pd = 0, ss[ps], ++ps, +ss[ps]<=_' '?(sd[pd++] = _'_'): +(ss[ps]==_'(' || ss[ps]==_')' || +ss[ps]==_'{' || ss[ps]==_'}' || +ss[ps]==_'[' || ss[ps]==_']' || +ss[ps]==_'\'' || ss[ps]==_'\"')?0: +(ps && ss[ps]>=_'0' && ss[ps]<=_'9' && ss[ps-1]>=_'a' && ss[ps-1]<=_'z')?(sd[pd++] = _'_'; sd[pd++] = ss[ps]): +(sd[pd++] = ss[ps]); +); sd[pd] = 0; sd"`} +#@cli strlen : string1 +#@cli : Return the length of specified string argument. +strlen : skip "${1=}" +u {narg({'"$1"'})} +#@cli strreplace : string,search,replace +#@cli : Search and replace substrings in an input string. +strreplace : skip "${3=}" +if narg("$3") +ls=${strlen\ "$2"} +lr:=${strlen\ "$3"}-1 +l[] { +('"$1"':y) s +,{'"$2"'} s y,-$ls +repeat $! { if [{$>,^}]==['"$2"'] rows[$>] 0,$lr f[$>] {'"$3"'} fi } +a y u {t} rm +} +else +l[] { ('"$1"') s -,{'"$2"'} a y u {t} rm } +fi +#@cli strlowercase : string +#@cli : Return a lower-case version of the specified string. +strlowercase : +('"$*"') u {`lowercase([{^}])`} rm. +#@cli struppercase : string +#@cli : Return an upper-case version of the specified string. +struppercase : +('"$*"') u {`uppercase([{^}])`} rm. +#@cli strvar : "string" +#@cli : Return a simplified version of the specified string, that can be used as a variable name. +#@cli : (version that creates a lowercase result, no longer than 128 chars). +strvar : +_strvar_fn="lowercase(c)" _strvar "$*" +#@cli strcasevar : "string" +#@cli : Return a simplified version of the specified string, that can be used as a variable name. +#@cli : (version that keeps original case of specified string, no longer than 128 chars). +strcasevar : +_strvar_fn="c" _strvar "$*" +_strvar : +l[] { +('"$*"':y) f. "c = i; inrange(c,_'0',_'9') || inrange(c,_'a',_'z') || +inrange(c,_'A',_'Z') || c==_'_'?"$_strvar_fn":_'_'" +rows. 0,{min(h,128)-1} autocrop. {'_'} +if inrange(i,_'0',_'9') i.. ('_') a[-2,-1] y fi +do h:=h replace_str. "__","_" while h!=$h +u {t} rm +} +#@cli strver : _version,_prerelease +#@cli : Return the specified version number of the G'MIC interpreter, as a string. +#@cli : Default value: 'version=$_version' and 'prerelease='. +strver : skip "${1=},${2=}" +if isnum("$1")" && $1>0" ver="$1" else ver=$_version noarg fi +('$ver') r. {2*w-1} f. "x%2?_'.':i" u {t} rm. +if s=['$2'];s!=0&&s!='0' u ${}" (pre-release \#"$2")" fi +#@cli tic +#@cli : Initialize tic-toc timer. +#@cli : Use it in conjunction with 'toc'. +tic : +e[^-1] "Initialize timer." +if !narg($_ticpos) _ticpos=0 fi _tic$_ticpos=$| _ticpos+=1 +#@cli toc +#@cli : Display elapsed time of the tic-toc timer since the last call to 'tic'. +#@cli : This command returns the elapsed time in the status value. +#@cli : Use it in conjunction with 'tic'. +toc : +v=$^ _ticpos-=1 u {_$|-${_tic$_ticpos}} +v 0 e[^-1] "Elapsed time: "${}" s". v $v +#@cli uint82base64 : _encoding={ 0:base64 | 1:base64url } +#@cli : Encode the values of the latest of the selected images as a base64-encoded string. +#@cli : The string can be decoded using command 'base642uint8'. +#@cli : Selected images must have values that are integers in [0,255]. +#@cli : Default values: 'encoding=0'. +uint82base64 : skip "${1=0}" +if isnum("$1") encoding=$1 else encoding=0 noarg fi +{ceil(whds*4/3)+([0,2,1])[whds%3]} +eval " +hash = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +"$encoding"?(hash[62] = _'-'; hash[63] = _'_'); +od = ov = n = 0; +for (os = 0, os>2]; ov = v; n = 1): +n==1?(i[#-1,od++] = hash[((ov&3)<<4) | (v>>4)]; ov = v; n = 2): +(i[#-1,od++] = hash[((ov&15)<<2) | (v>>6)]; i[#-1,od++] = hash[v&63]; n = 0); +); +n==1?(i[#-1,od++] = hash[((ov&3)<<4)]; copy(i[#-1,od],_'=',2,1,0); od+=2): +n==2?(i[#-1,od++] = hash[((ov&15)<<2)]; i[#-1,od++] = _'='); +" +u {t} rm. +#@cli :: Other Interactive Commands +#@cli demos : _run_in_parallel={ 0:no | 1:yes | 2:auto } +#@cli : Show a menu to select and view all G'MIC interactive demos. +demos : check "isint(${1=2}) && $1>=0 && $1<=2" check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +strver=${strver" "$_version,$_prerelease} +e "\n +------ "${g}"G\47MIC demos"$n" ------------------\n +----\n +---- "${c}"Mouse button"$n" to select a demo.\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-------------------------------------" +l[] { +entries="2048 game","Blobs Editor","Bouncing Balls","Connect Four","Fire Effect","Fireworks","Fish-Eye Effect","Fourier Filtering","Tower of Hano\357","Histogram Demo","Hough Transform","Jawbreaker","Virtual Landscape","The Game of Life","Light Effect","Mandelbrot Explorer","3D Metaballs","Minesweeper","Minimal Path","Pacman","Paint","Plasma Effect","RGB Quantization","3D Reflection","3D Rubber Object","Shade Bobs","Spline Editor","3D Starfield","Tetris","Tic-Tac-Toe","Image Waves","Fractal Whirls","Color Curves" +commands=x_2048,x_blobs,x_bouncing,x_connect4,x_fire,x_fireworks,x_fisheye,x_fourier,x_hanoi,x_histogram,x_hough,x_jawbreaker,x_landscape,x_life,x_light,x_mandelbrot,x_metaballs3d,x_minesweeper,x_minimal_path,x_pacman,x_paint,x_plasma,x_quantize_rgb,x_reflection3d,x_rubber3d,x_shadebobs,x_spline,x_starfield3d,x_tetris,x_tictactoe,x_waves,x_whirl,_demo_color_curves +nb_entries:=narg($entries) +parallel_mode:=1-($1!=2?$1:$_cpus>=2) +l[] { +_demos_font +repeat $nb_entries { arg0 $>,$entries entry=${} 0 t. $entry,0,0,_font,1,1 } +r ${-max_wh},1,1,0,0,0.5,0.5 +frame 12,6,0 a z ++n[0] 0,255 ++shift[0] 1,3,0,0 max[0,-1] ++f[0] z+1 +1,1,100%,3,u(128,255) r. 1,[0],[0],3 *. 'y/(h-1)' r. [0],[0],[0],3,3 +200%,200%,1,1,"x = min(x,w-1-x); y = min(y,h-1-y); (x*y/wh)^0.7>0.01" ++dilate. 3 xor.. . +distance.. 1 c.. 0,2 negate.. distance. 0 c. 0,2 +r2dx[-2,-1] 50% n[-2,-1] 0,1 ++[0] .. +*.. 100 +[1,-2] +*[2,3] . +rm. +frame 4,4,0 +a c s z +append_tiles 3 s c +to_rgb[1] a[3-5] c +0 t. "G\'MIC demos",2,2,32,1,1,1,1 +if $_prerelease 0 t. "Version:\n"$strver,40,1,18,1,1,1,1 rows. 2,100% +else 0 t. "Version: "$strver,40,1,18,1,1,1,1 rows. -2,100% +fi +a[-2,-1] x,0.5 +b. 0.5 n. 0,1 +(255;255^255;16^128;0) r. ..,..,1,3,3 *[-2,-1] round. 1,-1 +!=. 0 channels. 1 +s=8 +r[^-2,-1] 100%,{h+h#0+2*$s+6},1,100%,0,0,0,1 +rectangle[0] 0,$s,100%,{$s+6+h-1},1,0.6 +rectangle[1] 0,$s,100%,{$s+6+h-1},1,120,32,32 +j[0] .,{(w#0-w)/2},{$s+3},0,0,-1 +j[1] ..,{(w#0-w)/2},{$s+3},0,0,1,. rm[-2,-1] +c[0] 0,1 +=> menu_opac,menu_fgcol,menu_ind,menu_bgcol +} +arrow3d 20,20,0,0,0,0,20%,40%,40% col3d. 255,128,0 => cursor3d +l[] { +n=16 +chromeball64x64[] 200,100,64 n. 0,230 s. c,-3 +rgb2hsv.. r.. 100%,100%,$n,3 f.. "[z*360/d,G,B]" hsv2rgb.. +N:=6*$n P:=2*$N-1 +i[0] ('CImg3d') i[1] ($N,$P) i[2] 3,$N +i[3] 2,$N,1,1,"x?y:1" i[4] 3,{$N-1},1,1,"!x?2:x==1?y:y+1" y[3,4] a[3,4] y +l[4] { +s z i[0--2] (-128,{w},{h},3) 4,{$N-$n},1,1,'!x?-128:x==1?y%$n:0' +3,{$P-$N},1,1,200 y a y +} +l[5] { +n 0,0.5 i[0] (-128,{w},{h},1) 4,{$N-1},1,1,-128,0,0,0 +1,{$P-$N},1,1,0.25 y a y +} +y a y +=> background3d +} +{menu_fgcol,[w,h]},1,3 +plasma. 1,1,5 n. 0,230 water. 100 +(0.1;0.3^0.1;0.2^0.5;0.3) ri. ..,3 *[-2,-1] +(0;1) r. ..,..,1,1,3 ^. 1.5 n. 0.2,1.15 *[-2,-1] n. 0,128 +=> background +w. -1,-1,0,"[G'MIC - "$strver"]" cursor 0 w[] -1,-1,0,0,{([{*,u,v}]-[{*,w,h}])/2} +omb,ind_clicked,cfx,cfy,cfz,alpha=0 +nfx,nfy,nfz:=g,g,g time0:=$|-4 +do +mx,my,mb={menu_fgcol,x={*,x};y={*,y};[x<0?-1:x*(w-1)/({*,w}-1),y<0?-1:y*(h-1)/({*,h}-1),{*,b}]} +ind={menu_ind,i($mx,$my)} +if $mb" && "!$ind_clicked ind_clicked=$ind fi +[background] +3,$N,1,1,"const t = 0.8*"$|"; const a = "$alpha"; const oma = 1 - a; +!x?oma*cos("$cfx"*y + t) + a*cos("$nfx"*y + t): +x==1?oma*sin("$cfy"*y + t) + a*sin("$nfy"*y + t): +oma*sin("$cfz"*y + t) + a*sin("$nfz"*y + t)" +y. +j[background3d] .,0,8 rm. ++r3d[background3d] 1,2,3,{20*$|} *3d. {menu_fgcol,[w,h]/2-30},300 +3d. 0,0,300 +j3d.. .,50%,50%,0,1,1,0,0,200 rm. +if $|-$time0>5 alpha+=0.02 fi +if $alpha>1 alpha-=1 cfx,cfy,cfz=$nfx,$nfy,$nfz nfx,nfy,nfz:=g,g,g time0:=$|-u*3 fi +if $ind>0 +==[menu_ind] +$ind j.. [menu_bgcol],0,0,0,0,{$mb" && "$ind_clicked==$ind?0.6:1},. rm. +fi +j. [menu_fgcol],0,0,0,0,1,[menu_opac] +if $mx>0 ++r3d[cursor3d] 1,1.3,0.6,{50*cos($|)} +j3d.. .,$mx,$my,0,1,4,0,0,800,{-2,[w,h]/2},-1000,0.7 rm. +fi +w. -1,-1,0 +if {*,CTRLLEFT}" && "{*,D} w. 150%,150% elif {*,CTRLLEFT}" && "{*,C} w. 100%,100% fi +rm. +if !$mb" && "$omb" && "$ind_clicked" && "$ind_clicked==$ind +m "com : v 1 "${arg\ $ind,$commands} parallel $parallel_mode,"l[] { com rm }" um com +elif !$mb ind_clicked=0 +fi +omb=$mb +wait 20 +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w 0 } v 0 e "" +_demos_font : +l[] { +base642img "MjU3IHVpbnQ4IGxpdHRsZV9lbmRpYW4KMjggNzggMSAxICMyNQp4nGNgGAWjYBSMglEwCkbBKBgYAAAIiAABMjggNzggMSAxICMyNQp4nGNgGAWjYBSMg""lEwCkbBKBgYAAAIiAABNDMgNzggMSAxICMxNDUKeJztlEkSwCAIwPj/p+mpMwpBwfEmOVWJYl0QaZrGoD9Zb2erJy0GcmCCG5pO9oHI5Qmod+4avp2LqT""Ek2FwktEloHrd0Xt6R6vaD2klVwYzHHqga8Yx6d18LB1u/LqlLuHkFBXWOKgVXsdTjNmXE/TGWl1J5ovImErkWseTNSoFnmUWwF+Kgb62meZEP+3ShiTQ""zIDc4IDEgMSAjMTM1Cnic7dTBDoAgDANQ/v+n58kItKXD6In1SJ+YEUJrlUplStzJOqcDk4YCC4lWQrCkUZjvwFblCFAkhvVyLldybNdy6LeplB1wm3bC""yoe8oKFyDP3jXFN3YOO6fH9f4bP1psZOXWgLVQjM1rk1q+x5U//CyAG83HngOeYQsXaD96xSOTAXsqErADQzIDc4IDEgMSAjMTc0Cnic7ZRLEoAwCEN7/""0vjwvGTkExhXEpWCm8w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GQRGM2FpSEhc6Bf5NENX7JF8UzKdro56OaIM/AE05AWXSiBwkGi5Luco8Htu""gNcYNFgN8QHgq5RwPDXDB2+EjU5d3z7EjXMx0AMe1o2sxIDE5NDIgMSAxICM1MjgKeJw9lTtuHDEUBHUkdvN/Ake+gDLFgiLfHzDArqeEGQu7M1U9f/5+""fvx8/ftu79Q7/c7+zvHO+c71zv3O886bW1zObeW6cl8BKAQFoTAUiEJxKOY3hOJQHIpDcSgOxaE4lB5KD6XzV0LpofRQeig9lB5KD2WEMkIZoQyeSCgjl""BHKCGWEMkKZocxQZigzlMmDDWWGMkOZocxQVigrlBXKCmWFsng/oaxQVigrlB3KDmWHskPZoexQNq85lB3KDuWEckI5oZxQTignlBPKwZZQTig3lBvKDe""WGckO5odxQbigX6co6tGt41xCvYV5DvYZ7Dfka9jX0a/B+NYZXIpfJpXK5XDKXzaUzPguh5eoCHk4LqYXVQmvhtRBbmC3UFm6rV2jw0Fv4LQQXhgvFheN""CcmG50FyjyoWH6UJ14bqQXdgudBe+C+GF8Zo1BfCQXlgvtBfeC/GF+UJ94b6QX6u2BR7+iwBEASIB0YCIQFQgMhAdaNdYwSMF0YKIQdQgchA9iCBEESIJ""nVo/eFQhshBdiDBEGSIN0YaIQ9ShW3Nae8qg0ofpw/Rh+jB9mD5MH6YP04dVAw2PPkwfpg/Th+nD9GH6cO19Df7v4sOrza/Rr9Wv2a/dr+GnD9OH6cO9P""iHw6MP0YfowfZg+TB+mD9OH6cOjvknw6MP0YfowfZg+TB+mD9OH6cOzPnLz4z8MZjG7" +r2dy 32 r 300%,300%,1,100%,3 (0,1,0;1,1,1;0,1,0) dilate[^-1] . rm. r 33%,33%,1,100%,2 n 0,255 sharpen 0.2 +store 1,_font +} +_demo_color_curves : +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +if !narg($__demo_color_curve) +e "\n +------ "${g}"Color curves"$n" ----------------------------------------------------------------------------\n +----\n +---- "${c}"Left mouse button"$n" on a curve creates a new control point (or moves an existing one).\n +---- "${c}"Right mouse button"$n" on a control point deletes it.\n +---- "${c}"Left mouse button"$n" on the main image window shows the initial image until button is released.\n +---- "${c}"Right mouse button"$n" on the main image window adds a keypoint to all curves from picked color.\n +---- Key '"${c}"R"$n"' on a curve resets it.\n +---- Keys '"${c}"CTRL+D"$n"' increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' decrease window size.\n +---- Keys '"${c}"CTRL+R"$n"' reset window size.\n +---- Keys '"${c}"ESC"$n"', '"${c}"Q"$n"' or '"${c}"ENTER"$n"' close the current window.\n +----\n +------------------------------------------------------------------------------------------------" +__demo_color_curve=1 l[] { do rm sp ? while s!=3 } x_color_curves rgb __demo_color_curve= +else +e "\n +------ "${g}"Color curves"$n" ----------------------------------------------------------------------------\n +----\n +---- Only "${c}"one session"$n" allowed at the same time !\n +----\n +------------------------------------------------------------------------------------------------" +fi +#@cli tixy : "expression" +#@cli : Animate specified mathematical expression with a 16x16 grid of circles, using the rules described at . +tixy : skip "${1=sin(t-sqrt((x-8)^2+(y-8)^2))}" check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r b=$_vt100_b +if narg("$*") expr="$*" else expr="$1" fi +l[] { +('$expr') +replace_str "%","%25" +replace_str "&","%26" +replace_str "(","%28" +replace_str ")","%29" +replace_str "+","%2B" +replace_str ",","%2C" +replace_str ";","%2C" +replace_str "/","%2F" +replace_str "[","%5B" +replace_str "]","%5D" +replace_str "|","%7C" +replace_str "^","**" +replace_str " ","+" +url=https://tixy.land?code={t} +rm +} +e "\n +------ "${g}"tixy"$n" ------------------------------------------------------------------------------------\n +----\n +---- tixy - creative code golfing: "${g}"https://tixy.land"$n"\n +----\n +---- "$r${b}"Expression:"$n" "$expr"\n +----\n +---- "$r${b}"Corresponding URL:"$n" "$url"\n +----\n +---- "$r${b}"Rules:"$n"\n +---- . Specified expression depends on 4 variables "${g}"(t,i,x,y)"$n" and is rendered as an animation.\n +---- . Variables "${g}"x"$n" and "${g}"y"$n", in range "${c}"[0,15]"$n", are the spatial position of each dot.\n +---- . Variable "${g}"i"$n", in range "${c}"[0,255]"$n", is the dot index, i.e. "${c}"i = x + 16*y"$n".\n +---- . Variable "${g}"t>=0"$n" is the (decimal) number of elapsed seconds.\n +---- . Specified expression "${g}"func(t,i,x,y)"$n" must return a complex value "${c}"c"$n".\n +---- . Variable "${g}"z"$n" can be used as a shortcut for "${g}"[ x,y ]"$n".\n +---- . Variable "${g}"j"$n" is the complex imaginary number "${g}"[ 0,1 ]"$n".\n +---- . "${c}"cabs(c)"$n" in "${g}"[0,1]"$n" determines the radius of each dot at "${c}"(x,y)"$n".\n +---- . "${c}"carg(c)"$n" in "${g}"[-pi,pi]"$n" determine the color of each dot at "${c}"(x,y)"$n".\n +----\n +---- Key '"${c}"SPACE"$n"' starts/stops recording animation as video file '"${c}"out.mp4"$n"'.\n +---- Key '"${c}"ENTER"$n"' takes a screenshot of current image.\n +---- Key '"${c}"A"$n"' enables/disables anti-aliasing.\n +---- Key '"${c}"F"$n"' displays formula on the image.\n +---- Key '"${c}"R"$n"' resets time.\n +---- Keys '"${c}"CTRL+D"$n"' increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' decrease window size.\n +---- Keys '"${c}"CTRL+R"$n"' reset window size.\n +---- Keys '"${c}"ESC"$n"', '"${c}"Q"$n"' or '"${c}"ENTER"$n"' close the current window.\n +------------------------------------------------------------------------------------------------" +w[] 400,400,0,"[G'MIC] tixy: "$expr +t0=$| is_recording=0 is_antialias=1 is_screenshot=0 is_formula=0 nb_frames=0 +360,1,1,3,[x,abs(cos(x/w*pi))^0.5,1] hsv2rgb. shift. -180,0,0,0,2 => cmap +strvar $expr basename=${} +do +is_ctrl:={*,CTRLLEFT}" || "{*,CTRLRIGHT} +if $is_ctrl" && "{*,-D} w[] {1.25*[{*,w,h}]} rmn formula,mformula +elif $is_ctrl" && "{*,-C} w[] {0.8*[{*,w,h}]} rmn formula,mformula +elif $is_ctrl" && "{*,R} w[] 400,400 rmn formula,mformula +elif {*,-A} is_antialias:=!$is_antialias +elif {*,-F} is_formula:=!$is_formula +elif {*,R} t0=$| +elif {*,-SPACE} +if $is_recording o[] $basename.mp4,15,0,0 nb_frames=0 +else t0=$| fi +is_recording:=!$is_recording +elif {*,-ENTER} is_screenshot=1 +fi +m:=min({*,w,h}) _is_antialias:=$is_antialias" && "$m<512 +{m=$m*($_is_antialias?2:1);[m,m]},1,3 +16,16,1,1,">begin( +const b = w#-1/16; +const t = "$|-$t0"; +j = [ 0,1 ]; +); +i = x + 16*y; +ref([ x,y ],z); +val = ("$expr"); +n = cabs(val); +r = floor(0.48*b*cut(n,0,1)); +a = (360+carg(val)*180/pi)%360; +c = I[#"$cmap",a]; +r>1?ellipse(#-1,b*(x + 0.5),b*(y + 0.5),r,r,0,1,c): +r>0?ellipse(#-1,b*(x + 0.5),b*(y + 0.5),1,1,0,0.5,c)" +rm. +if $_is_antialias r. 50%,50%,1,3,2 fi +if {*,w}!={*,h} -. 128 r. {*,w,h},1,3,0,0,0.5,0.5 +. 128 fi +if $is_formula +if !narg($formula) +0 t. {``$expr},0,0,48,1,255 frame. 5,5,0 +dilate. 11 max. 128 to_rgb.. +if w>0.75*{*,w} r2dx[-2,-1] {0.75*{*,w}} fi +mv[-2,-1] 0 =>[0,1] formula,mformula +fi +j. [formula],0.5~,1~,0,0,1,[mformula],255 +fi +if $is_screenshot o. $basename.png is_screenshot=0 fi +if $is_recording o. $basename.mp4,15,0,1 nb_frames+=1 to. "Recording video\n[Frame \#"$nb_frames"]",0,0,5% fi +w. rm. wait 40 +while {*}" && "!{*,ESC}" && "!{*,Q} +rmn cmap,formula,mformula +w[] 0 +#@cli x_2048 +#@cli : Launch the 2048 game. +x_2048 : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"2048"$n" -----------------------------------------------\n +----\n +---- Join the numbers and get to the "${g}"2048"$n" tile!\n +----\n +---- Use your "${c}"arrow keys"$n" to move the tiles. When two tiles\n +---- with the same number touch, they merge into one!\n +---- This command is a port of the '"${c}"2048"$n"' game originally\n +---- designed by "${c}"Gabriele Cirulli"$n", and available at:\n +---- "${g}"http://gabrielecirulli.github.io/2048/"$n"\n +----\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------------------------" +l[] { +score=0 f3d 50 m3d 0 +m "_x_2048_setrandom : +==[0] 0 f. i?4*y+x:-1 discard. -1 +off:=i[round(u(h-1))] rm. x:=$off&3 y:=$off>>2 n:=u<0.75?1:2 +=[0] $n,$x,$y [{2+$n}] c3d. +repeat 6 { j3d[1] .,{78+$x*121},{190+$y*121},{10*$<},{(1+$>)/6} w[1] wait 20 } +rm." +m "_x_2048_object3d : +f[0] i?i*16+4*y+x:-1 discard. -1 +N:=h repeat h { v={-{1+$>},@$>} ++3d[{2+($v>>4)}] {$v&3},{($v>>2)&3} } ++3d[-$N--1] rm.." +i[0] 4,4 +b0=204,192,179 b1=238,228,218 b2=237,224,200 b3=242,177,121 +b4=245,149,99 b5=246,124,95 b6=246,94,59 b7=237,207,114 +c0=119,110,101 c1=249,246,242 s0=" " +520,630,1,3 fc. 250,248,239 +t. "2048",20,10,86,1,$c0 +t. "Join the numbers and get to the 2048 tile!",20,90,20,1,$c0 +rectangle. 422,20,501,75,1,187,173,160 t. "SCORE",439,25,15,1,238,228,218 +repeat 12 { +107,107,1,3 fc. ${b{min($>,7)}} +fc. ${c{$>>2}} +s1:=2^$> 0 t. ${s{$>>0}},0,0,52,1,1 +r. ..,..,1,1,0,0,0.5,0.5 dilate_circ. 3 b. 0.5 +j... ..,0,0,0,0,1,.,1 rm[-2,-1] +} +frame_round[2--1] 0,0,20%,0.5,187,173,160 frame[2--1] 7,7,187,173,160 +to_rgb[2--1] +r[2] 400%,400%,1,3,0,2 j[1] [2],18,130 +sprite3d[3--1] +w[1] 100%,100%,0,"[G"{`39`}"MIC] 2048" insert_new=1 +repeat 2 { _x_2048_setrandom } +do +if $insert_new +_x_2048_object3d *3d. 121 j[1] [2],18,130 j3d[1] .,78,190 rm. +80,25,1,3 fc. $c1 0 t. $score,0,0,25,1,1,1,1 ri. ..,0,0,0.5,0.8 +rectangle[1] 422,45,501,69,1,187,173,160 j[1] ..,422,45,0,0,1,. rm[-2,-1] +w[1] insert_new=0 +fi +++[0] 1 f. j(-1)==i||j(1)==i||j(0,-1)==i||j(1,0)==i||i==1 +if {0,iM==11} +alert "Game Over","\nCongratulations! You got the 2048 title!\n\n Your score: "$score,"OK" +break +elif !iM +alert "Game Over","\nBad luck! You lost the game!\n\n Your score: "$score,"OK" +break +fi +rm. +wait +is_shift=0 um shift2048,ishift2048,vshift2048 +if {*,ARROWLEFT} +m "shift2048:" m "ishift2048:" m "vshift2048:" +is_shift=1 +elif {*,ARROWRIGHT} +m "shift2048: rotate 180" m "ishift2048: rotate 180" +m "vshift2048: s3d l[2] { r 3,{h/3},1,1,-1 s x -[0,1] 3 *[0,1] -1 a x y } a y" +is_shift=1 +elif {*,ARROWUP} +m "shift2048: rotate -90" m "ishift2048: rotate 90" +m "vshift2048: s3d l[2] { r 3,{h/3},1,1,-1 s x rv[0,1] -[0] 3 *[0] -1 a x y } a y" +is_shift=1 +elif {*,ARROWDOWN} +m "shift2048: rotate 90" m "ishift2048: rotate -90" +m "vshift2048: s3d l[2] { r 3,{h/3},1,1,-1 s x rv[0,1] -[1] 3 *[1] -1 a x y } a y" +is_shift=1 +fi +if {*,r} w[1] 100%,100% fi +if $is_shift +wait -1 +shift2048[0] +repeat 2 { +_x_2048_object3d ++s[0] y discard[-4--1] 0 y[-4--1] x r[-4--1] 4,1,1,1,0,0 a[-4--1] y ++==[0,-1] insert_new:=$insert_new||!im rm. ++f[0,-1] "i?x:-1" discard[-2,-1] -1 rv[-2,-1] -[-2,-1] rv[0,-2] rm.. +if (im||iM)&&!{*,k} +/. 5 z. 0,2 y. +repeat 5 { +j.. .,0,8,0,0,-1 +j[1] [2],18,130 +vshift2048.. *3d. 121 j3d[1] .,78,190 rm. +w[1] wait 20 +} +fi +rm[-2,-1] +if !$> dscore=0 +[0] +f[0] "i?i*16+4*y+x:-1" discard. -1 +repeat h { +x:=i[$>]&3 y:=(i[$>]>>2)&3 n:=i[$>]>>4 +if $x>0" && "{0,i($x-1,$y)}==$n +=[0] 0,$x,$y =[0] {$n+1},{$x-1},$y =.. 0,$x,$y insert_new=1 dscore+=2^($n+1) +else =. -1,0,$> +fi +} +score+=$dscore +if iM<0 rm[-2,-1] +else +discard. -1 +rv[0,-2] _x_2048_object3d rv[0,-3] vshift2048. *3d. 121 +j[1] [2],18,130 j3d[1] .,78,190 rm[-3,-1] +N:=h repeat h { v={-{1+$>},@$>} ++3d[{2+($v>>4)}] {$v&3},{($v>>2)&3} } ++3d[-$N--1] rm.. +0 t. +$dscore,0,0,33,1,1 100%,100%,1,3 fc. $c0 +repeat 6 { ++vshift2048... *3d. 121 +j3d[1] .,78,190 +j. ...,440,{40-3*$>},0,0,{min(1,$1 +{0,[w,h]},1,2 +repeat h#1 { +r={1,i[2]*(1+i[3]*cos(i[4]+i[5]*$|*1000))} +ellipse. {1,@0,1},$r,$r,0,1,{1,@6-7} +d:=sqrt(($x-{1,@0})^2+($y-{1,@1})^2) +if $d<$r nearest=$> fi +shift[1] 0,-1,0,0,2 +} +b. 15 ++norm. +>=. 50 <=.. 40 *[-3,-1] ++*[0,-1] rm.. rv[-2,-1] *. 1.6 c. 0,255 +[-2,-1] +if $fps>0 to. $fps" fps",5,{h-29},24,2,0.2 fi +w. +if {*,CTRLLEFT}" && "{*,D} w[] {2*[w,h]} elif {*,CTRLLEFT}" && "{*,C} w[] {[w,h]} fi +rm. +else ++to[0] "G\47MIC Blobs Editor",75,100,35,3,1,200,128,255 +to. "* Left mouse button : Create and move blobs.\n\n* Right mouse button : Remove blob.\n\n* Middle mouse button : Remove all blobs.\n\n* Key 'ESC' or 'Q' : Quit.\n\n* Colors and sizes of appearing blobs are\n chosen randomly",50,180,18,1,1,255 +w. +if {*,CTRLLEFT}" && "{*,D} w[] {1.5*[w,h]} elif {*,CTRLLEFT}" && "{*,C} w[] {[w,h]} fi +rm. +fi +wait 20 +if $x<0||$y<0 continue fi +if $b&1 +if $nearest>=0" || "$moving>=0 +if $moving<0 moving=$nearest fi +=[1] $x,0,$moving =[1] $y,1,$moving +else +($x,$y,{u(20,50)},{u(-0.3,0.3)},{u(0,pi/2)},{u(0,0.009)},{u(64,255)},{u(64,255)}) a[^0] y +moving:=h-1 +fi +elif $b&2 +if $nearest>=0 l[1] { s y rm[$nearest] a y } nearest=-1 fi +elif $b&4 +k[0] +else +moving=-1 +fi +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w 0 } +#@cli x_bouncing +#@cli : Launch the bouncing balls demo. +x_bouncing : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Bouncing balls"$n" ------------------------------\n +----\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-----------------------------------------------------" +l[] { +520,320,1,3 plasma 1,1,9 n 0,220 +N=12 +repeat $N { +ball[] {round(u(32,80))},${-rgb} +t$>:=u(200) x$>:=u(10,w#0-10) h$>:=u(150,300) vx$>:=(u<0.5?1:-1)*u(1,8) +} +mv[0] $! +w. {f=w<0.5*{*,u}?1.5:1;[w,h]*=f},0,"[G"{`39`}"MIC] Bouncing Balls" +(0;0.7;1) r. {-2,w},70,1,1,3 +do +[$N] +repeat $N { +bw,bh={$>,[w,h]} +y:=${h$>}*abs(cos(${t$>}*pi/60))-$bh/2 +dt=1 +if $y<0 d:=-$y y=0 bh-=$d bw+=$d dt:=max(0.2,1-($d/$bh)^2) else dt=1 fi +if ${x$>}+$bw/2>w +d:=${x$>}+$bw/2-w bw-=$d bh+=0.5*$d +if ${x$>}+$bw/4>w vx$>:=-${vx$>} fi +fi +if ${x$>}-$bw/2<0 +d:=$bw/2-${x$>} bw-=$d bh+=0.5*$d +if ${x$>}-$bw/4<0 vx$>:=-${vx$>} fi +fi ++r[$>] $bw,$bh,1,4,3 s. c,-3 +j... ..,{max(0,min({$N,w-$bw},${x$>}-$bw/2))},{{$N,h}-{h}-$y-70},0,0,1,.,255 rm[-2,-1] +t$>+=$dt +x$>+=$dt*${vx$>} +} ++rows. {h-2*70},{h-1-70} mirror. y *. [{$N+1}] +j.. .,0,{-2,h-71},0,0,0.5 rm. +fps=${-fps} if $fps>0 to. $fps" fps",5,{h-29},24,2,0.2 fi +if {*,CTRLLEFT}" && "{*,D} w[] {1.5*w},{1.5*h} elif {*,CTRLLEFT}" && "{*,C} w[] {w},{h} fi +w. rm. wait 20 +while {*}" && "!{*,ESC}" && "!{*,Q} +w 0 rm } +#@cli x_color_curves : _colorspace={ rgb | cmy | cmyk | hsi | hsl | hsv | lab | lch | ycbcr | last } +#@cli : Apply color curves on selected RGB[A] images, using an interactive window. +#@cli : Set 'colorspace' to 'last' to apply last defined color curves without opening interactive windows. +#@cli : Default value: 'colorspace=rgb'. +x_color_curves : skip ${1=rgb} +if ['"$1"']!='last'&&!{*,u} error[0--3] "Command '$0': No display available." return fi +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e[^-1] "Apply color curves of image$?, in the '$1' colorspace." +if ['"$1"']=='last' +if !narg($_xcc_colorbase) return fi +__x_color_curves[] $_xcc_colorbase +else +e "\n +------------------------------------------------------------------------------------------------\n +----\n +---- "${c}"Left mouse button"$n" on a curve creates a new control point (or moves an existing one).\n +---- "${c}"Right mouse button"$n" on a control point deletes it.\n +---- "${c}"Left mouse button"$n" on the main image window shows the initial image until button is released.\n +---- "${c}"Right mouse button"$n" on the main image window adds a keypoint to all curves from picked color.\n +---- Key '"${c}"R"$n"' on a curve resets it.\n +---- Keys '"${c}"CTRL+D"$n"' increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' decrease window size.\n +---- Keys '"${c}"CTRL+R"$n"' reset window size.\n +---- Keys '"${c}"ESC"$n"', '"${c}"Q"$n"' or '"${c}"ENTER"$n"' close the current window.\n +----\n +------------------------------------------------------------------------------------------------" +__x_color_curves[] $1 _xcc_colorbase=$1 +fi +to_color +foreach { +if ['"$1"']!='last' ++r[0] ${fitscreen[]\ {0,[w,h,1]},128,70%},1,100%,3 ++l. { +xcc_goto s c histogram 256,0,255 xcc_info +} +__C0= __C1= __C2= __C3= __C4= +if narg($__xcc_C0) __C0=$__xcc_C0 fi +if narg($__xcc_C1) __C1=$__xcc_C1 fi +if narg($__xcc_C2) __C2=$__xcc_C2 fi +if narg($__xcc_C3) __C3=$__xcc_C3 fi +if narg($__xcc_C4) __C4=$__xcc_C4 fi +x={1,({*,u}-560-w)/2} y={1,({*,v}-h)/2} +if $!==5 +parallel "w[] 256,256,0,0,"$x","$y",\"Curve: "$_title0"\" x_select_function1d... __C0,"$_color0"","w[] 256,256,0,0,"{$x+280}","$y",\"Curve: "$_title1"\" x_select_function1d.. __C1,"$_color1"","w[] 256,256,0,0,"$x","{$y+300}",\"Curve: "$_title2"\" x_select_function1d. __C2,"$_color2"","w. 100%,100%,0,0,"{$x+560}","$y" _x_color_curves[-4]" +elif $!==6 +parallel "w[] 256,256,0,0,"$x","$y",\"Curve: "$_title0"\" x_select_function1d[-4] __C0,"$_color0"","w[] 256,256,0,0,"{$x+280}","$y",\"Curve: "$_title1"\" x_select_function1d... __C1,"$_color1"","w[] 256,256,0,0,"$x","{$y+300}",\"Curve: "$_title2"\" x_select_function1d.. __C2,"$_color2"","w[] 256,256,0,0,"{$x+280}","{$y+300}",\"Curve: "$_title3"\" x_select_function1d. __C3,"$_color3"","w. 100%,100%,0,0,"{$x+560}","$y" _x_color_curves[-5]" +elif $!==7 +parallel "w[] 256,256,0,0,"$x","$y",\"Curve: "$_title0"\" x_select_function1d[-5] __C0,"$_color0"","w[] 256,256,0,0,"{$x+280}","$y",\"Curve: "$_title1"\" x_select_function1d[-4] __C1,"$_color1"","w[] 256,256,0,0,"$x","{$y+300}",\"Curve: "$_title2"\" x_select_function1d... __C2,"$_color2"","w[] 256,256,0,0,"{$x+280}","{$y+300}",\"Curve: "$_title3"\" x_select_function1d.. __C3,"$_color3"","w[] 256,256,0,0,"{$x+280}","{$y+600}",\"Curve: "$_title4"\" x_select_function1d. __C4,"$_color4"","w. 100%,100%,0,0,"{$x+560}","$y" _x_color_curves[-6]" +fi +k[0] +fi +xcc_goto +repeat s { function1d[] 1,${__xcc_C$>} *. {255%} r. 256,1,1,1,5 c. 0,255 sh[0] $> map. .. rm[-2,-1] } +xcc_backto +} +um xcc_goto,xcc_backto,xcc_info +_x_color_curves : +title={0,b} if narg({'{0,x}'}) title=$title.{0,x} fi ('$title') discard. {'~'} title={t} rm. ++drgba. w. 100%,100%,0,"[G"{`39`}"MIC] Image: "$title rm. +xcc_goto. . +oC0= oC1= oC2= oC3= oC4= viewmode=0 +do +wait 100 need_refresh=0 +oviewmode=$viewmode is_ctrl:={*,CTRLLEFT}" || "{*,CTRLRIGHT} x,y={*,x,y} +if {*,r} need_refresh=1 +elif $is_ctrl" && "{*,-D} w[] {{*,w}*125%},{{*,h}*125%} need_refresh=1 +elif $is_ctrl" && "{*,-C} w[] {{*,w}*80%},{{*,h}*80%} need_refresh=1 +elif $is_ctrl" && "{*,-R} w[] {w},{h} need_refresh=1 +elif {*,b}&1 viewmode:=x={*,x};x=0" && "$y>=0 +xc:=$x*w/{*,w} yc:=$y*h/{*,h} +z[0] $xc,$yc,$xc,$yc +repeat s { (${__C$>},{i[$>]/255%},{i[$>]/255%}) r. 2,{w/2},1,1,-1 sort. +,y __C$>={^} rm. } +rm. wait -1 +else viewmode=0 +fi +need_refresh:=$need_refresh||$oviewmode!=$viewmode +repeat s { if ['_${oC$>}']!=['_${__C$>}'] +function1d[] 1,${__C$>} *. {255%} r. 256,1,1,1,5 c. 0,255 ++channels[0] $> map. .. j[1] .,0,0,0,$> rm[-2,-1] +need_refresh=1 oC$>=${__C$>} +fi } +if $need_refresh +if !$viewmode ++xcc_backto[1] +elif $viewmode%2 +w2={0,int(w/2)} b:=$viewmode==1 +z[{!$b}] 0,{$w2-1} +z[$b] $w2,100% +xcc_backto.. xcc_backto. a[-2,-1] x line. 50%,0,50%,100%,1,0 +else ++xcc_backto[0] +fi +if s>3 drgba. fi w. rm. refresh=0 +fi +while {*}" && "!{*,ESC}" && "!{*,Q}" && "!{*,SPACE}" && "!{*,ENTER} +w 0 +repeat 5 { if narg(${__C$>}) __xcc_C$>=${__C$>} __C$>=-1 fi } +__x_color_curves : +if ['"$1"']=='rgb' +_color0="255,180,180" _color1="180,255,180" _color2="180,180,255" _color3="220,220,220" +_title0=Red _title1=Green _title2=Blue _title3=Alpha +m "xcc_goto:" m "xcc_backto:" +m "xcc_info: (0,255;0,0;0,0) (0,0;0,255;0,0) (0,0;0,0;0,255) r[-3--1] 256,3,1,1,3 +a[0,-3] y a[1,-2] y a[2,-1] y" +elif ['"$1"']=='cmy' +_color0="180,255,255" _color1="255,180,255" _color2="255,255,100" _color3="220,220,220" +_title0=Cyan _title1=Magenta _title2=Yellow _title3=Alpha +m "xcc_goto: s c,-3 rgb2cmy[0] a c" m "xcc_backto: s c,-3 cmy2rgb[0] a c" +m "xcc_info: (255,0;255,255;255,255) (255,255;255,0;255,255) (255,255;255,255;255,0) r[-3--1] 256,3,1,1,3 +a[0,-3] y a[1,-2] y a[2,-1] y" +elif ['"$1"']=='cmyk' +_color0="180,255,255" _color1="255,180,255" _color2="255,255,100" _color3="180,180,180" _color4="220,220,220" +_title0=Cyan _title1=Magenta _title2=Yellow _title3=Key _title4=Alpha +m "xcc_goto: s c,-3 rgb2cmyk[0] a c" m "xcc_backto: s c,-4 cmyk2rgb[0] a c" +m "xcc_info: (255,0;255,255;255,255) (255,255;255,0;255,255) (255,255;255,255;255,0) (255,0) r[-4--1] 256,3,1,1,3 +a[0,-4] y a[1,-3] y a[2,-2] y a[3,-1] y" +elif ['"$1"']=='hsi' +_color0="255,220,220" _color1="220,220,220" _color2="180,180,180" _color3="220,220,220" +_title0=Hue _title1=Saturation _title2=Intensity _title3=Alpha +m "xcc_goto: s c,-3 rgb2hsi8[0] a c" m "xcc_backto: s c,-3 hsi82rgb[0] a c" +m "xcc_info: 256,1,1,3,!c?x:128 256,1,1,3,!c?0:c==1?x:128 256,1,1,3,!c?0:c==1?0:x +hsi82rgb[-3--1] permute[-3--1] xcyz a[0,-3] y a[1,-2] y a[2,-1] y" +elif ['"$1"']=='hsl' +_color0="255,220,220" _color1="220,220,220" _color2="180,180,180" _color3="220,220,220" +_title0=Hue _title1=Saturation _title2=Lightness _title3=Alpha +m "xcc_goto: s c,-3 rgb2hsl8[0] a c" m "xcc_backto: s c,-3 hsl82rgb[0] a c" +m "xcc_info: 256,1,1,3,!c?x:128 256,1,1,3,!c?0:c==1?x:128 256,1,1,3,!c?0:c==1?0:x +hsl82rgb[-3--1] permute[-3--1] xcyz a[0,-3] y a[1,-2] y a[2,-1] y" +elif ['"$1"']=='hsv' +_color0="255,220,220" _color1="220,220,220" _color2="180,180,180" _color3="220,220,220" +_title0=Hue _title1=Saturation _title2=Value _title3=Alpha +m "xcc_goto: s c,-3 rgb2hsv8[0] a c" m "xcc_backto: s c,-3 hsv82rgb[0] a c" +m "xcc_info: 256,1,1,3,!c?x:255 256,1,1,3,!c?0:c==1?x:128 256,1,1,3,!c?0:c==1?0:x +hsv82rgb[-3--1] permute[-3--1] xcyz a[0,-3] y a[1,-2] y a[2,-1] y" +elif ['"$1"']=='lab' +_color0="180,180,180" _color1="220,180,220" _color2="220,220,180" _color3="220,220,220" +_title0=Lightness _title1=Chroma-A _title2=Chroma-B _title3=Alpha +m "xcc_goto: s c,-3 srgb2rgb[0] apo[0] rgb2lab8,0,4 a c" m "xcc_backto: s c,-3 apo[0] lab82rgb,0,4 rgb2srgb[0] a c" +m "xcc_info: 256,1,1,3,!c?x:128 256,1,1,3,!c?240:c==1?x:128 256,1,1,3,!c?240:c==1?128:x +lab82rgb[-3--1] permute[-3--1] xcyz a[0,-3] y a[1,-2] y a[2,-1] y" +elif ['"$1"']=='lch' +_color0="180,180,180" _color1="220,180,220" _color2="255,220,220" _color3="220,220,220" +_title0=Lightness _title1=Chroma _title2=Hue _title3=Alpha +m "xcc_goto: s c,-3 srgb2rgb[0] apo[0] rgb2lch8[0],0,4 a c" m "xcc_backto: s c,-3 apo[0] lch82rgb[0],0,4 +rgb2srgb[0] a c" +m "xcc_info: 256,1,1,3,!c?x:0 256,1,1,3,!c?255:c==1?x:128 256,1,1,3,!c?220:c==1?128:x +lch82rgb[-3--1] permute[-3--1] xcyz a[0,-3] y a[1,-2] y a[2,-1] y" +elif ['"$1"']=='ycbcr' +_color0="180,180,180" _color1="220,220,255" _color2="255,220,220" _color3="220,220,220" +_title0=Luma _title1=Blue\ chroma _title2=Red\ chroma _title3=Alpha +m "xcc_goto: s c,-3 rgb2ycbcr[0] a c" m "xcc_backto: s c,-3 ycbcr2rgb[0] a c" +m "xcc_info: 256,1,1,3,!c?x:128 256,1,1,3,!c?128:c==1?x:128 256,1,1,3,!c?128:c==1?128:x +ycbcr2rgb[-3--1] permute[-3--1] xcyz a[0,-3] y a[1,-2] y a[2,-1] y" +else error[0--3] "Command 'x_color_curves': Unknown specified color space '$1'." +fi +#@cli x_colorize : _is_lineart={ 0 | 1 },_max_resolution={ 0 | >=128 },_multichannels_output={ 0 | 1 },_[palette1],_[palette2],_[grabber1] +#@cli : Colorized selected B&W images, using an interactive window. +#@cli : When >0, argument 'max_resolution' defines the maximal image resolution used in the interactive window. +#@cli : Default values: 'is_lineart=1', 'max_resolution=1024' and 'multichannels_output=0'. +x_colorize : skip ${1=0},${3=0},${4=0},${5=0},${6=0} check "!${2=1024} || $2>=128" check_display $0 +s0="image" s1="lineart" s2="multichannel" s3="merged" use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e[^-1] "Colorize selected B&W "${s{!$1}}"$? interactively, with maximum resolution $2 and "${s{2+!$3}}" output." +e "\n +--------------------------------------------------------------------------------------\n +----\n +---- "${c}"Left mouse button"$n" creates a new colored control point (or moves an existing one).\n +---- "${c}"Right mouse button"$n" or key '"${c}"X"$n"' over a control point deletes it.\n +---- "${c}"Right mouse button"$n" or key '"${c}"P"$n"' anywhere else picks a color from the image.\n +---- "${c}"Mouse wheel"$n", or keys '"${c}"CTRL+arrows UP/DOWN"$n"' zoom view in/out.\n +---- '"${c}"CTRL+mouse wheel"$n"', '"${c}"SHIFT+mouse wheel"$n"' or "${c}"arrow keys"$n" move image in zoomed view.\n +---- Key '"${c}"SPACE"$n"' updates the extrapolated color field.\n +---- Key '"${c}"TAB"$n"' toggles between markers view modes.\n +---- Key '"${c}"BACKSPACE"$n"' deletes the last control point added.\n +---- Key '"${c}"PAGE UP"$n"' increases image contrast.\n +---- Key '"${c}"PAGE DOWN"$n"' decreases image contrast.\n +---- Key '"${c}"R"$n"' toggles color replace mode.\n +---- Keys '"${c}"CTRL+D"$n"' increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' decrease window size.\n +---- Keys '"${c}"CTRL+R"$n"' reset window size.\n +---- Keys '"${c}"ESC"$n"', '"${c}"Q"$n"' or '"${c}"ENTER"$n"' exit the interactive window.\n +----\n +--------------------------------------------------------------------------------------" +N=$! +thread_main="_x_colorize[0] ${1--1}" +thread_color="w[] 400,320,0,\"Palette: main\" x_select_color[] __color,255,255,255" +is_palette1=${"is_image_arg[] $4"} +if $is_palette1 +pass$4 1 ('{b}') discard. {'~'} palette_title1={t} rm. +thread_palette1="w[] 400,400,0,\"Palette: "$palette_title1"\" x_select_palette["{$!-1}"] __color" +fi +is_palette2=${"is_image_arg[] $5"} +if $is_palette2 +pass$5 1 ('{b}') discard. {'~'} palette_title2={t} rm. +thread_palette2="w[] 400,400,0,\"Palette: "$palette_title2"\" x_select_palette["{$!-1}"] __color" +fi +is_grabber=${"is_image_arg[] $6"} +if $is_grabber +pass$6 1 ('{b}') discard. {'~'} palette_grabber={t} rm. +thread_grabber="w[] ${\"fitscreen[] {[w,h,1]},128,50%\"},0,\"Grabber: "$palette_grabber"\" +x_grab_color["{$!-1}"] __color" +fi +__color=255,255,255 +if !$is_palette1" && "!$is_palette2" && "!$is_grabber +foreach[0-{$N-1}] { parallel $thread_main,$thread_color } +else +repeat $N { l[$>,$N--1] { +parallel $thread_main,$thread_color,$thread_palette1,$thread_palette2,$thread_grabber +} } +fi +k[0-{$N-1}] +_x_colorize : +name={n} title={b} if narg({x}) title=$title.{x} fi +w,h={w},{h} +if $1 +if s==4 sh. 3 if abs(im-iM)>64 +*. -1 rm.. +. 255 else rm. sh. 0 fi +else sh. 0 +fi +n 0,255 +else +if s==1 sh. 0 +else +luminance. +fi +fi +=> img +fdim=${fitscreen[]\ $w,$h} ww:=arg(1,$fdim) wh:=arg(2,$fdim) x0=0 y0=0 x1:=w-1 y1:=h-1 +selection=-1 view_markers=2 contrast=9 xpan=-1 ypan=-1 replace_color= current_replace_color= +if narg($_gui_control_points)>=6 +($_gui_control_points) r. {w/6},6,1,1,-1 +else 0 +fi +=> points +if $2>0 if $w>$h +r2dx[img] {min($2,$w)},2 else +r2dy[img] {min($2,$h)},2 fi else [img] fi +__x_colorize. $1 +pw,ph={potential,[w,h]} +do +if narg($replace_color)" && "{*,x}<0" && "{*,y}<0 wait 200 else wait fi +x={*,x} y={*,y} b={*,b} o={*,-o} +is_ctrl:={*,CTRLLEFT}" || "{*,CTRLRIGHT} +is_shift:={*,SHIFTLEFT}" || "{*,SHIFTRIGHT} +is_mouseout:=$x<0" || "$y<0 +x:=$x0+$x*($x1-$x0+1)/$ww y:=$y0+$y*($y1-$y0+1)/$wh +oww=$ww owh=$wh ox0=$x0 oy0=$y0 ox1=$x1 oy1=$y1 +if {*,r} +nww={*,d} nwh={*,e} m:=min($nww,$nwh) +cx:=($x0+$x1)/2 cy:=($y0+$y1)/2 dx:=$nww*($x1-$x0+1)/$ww dy:=$nwh*($y1-$y0+1)/$wh +x0:=$cx-$dx/2 x1:=$cx+$dx/2 +y0:=$cy-$dy/2 y1:=$cy+$dy/2 +ww=$nww wh=$nwh +elif $is_ctrl" && "{*,-D} +nww:=min({*,u},$ww*1.25) nwh:=min({*,v},$wh*1.25) m:=min($nww,$nwh) +if $m==$nww ww=$m wh:=$h*$m/$w else ww:=$w*$m/$h wh=$m fi +elif $is_ctrl" && "{*,-C} +nww:=$ww/1.25 nwh:=$wh/1.25 +if min($nww,$nwh)>=64 ww=$nww wh=$nwh fi +elif $is_ctrl" && "{*,R} +fdim=${fitscreen[]\ $w,$h} ww:=arg(1,$fdim) wh:=arg(2,$fdim) +x0=0 y0=0 x1:=$w-1 y1:=$h-1 +elif ($is_shift" && "$o<0)" || "{*,ARROWLEFT} +dx:=($x1-$x0)/6 x0-=$dx x1-=$dx +elif ($is_shift" && "$o>0)" || "{*,ARROWRIGHT} +dx:=($x1-$x0)/6 x0+=$dx x1+=$dx +elif ($is_ctrl" && "$o>0)" || "({*,ARROWUP}" && "!$is_ctrl) +dy:=($y1-$y0)/6 y0-=$dy y1-=$dy +elif ($is_ctrl" && "$o<0)" || "({*,ARROWDOWN}" && "!$is_ctrl) +dy:=($y1-$y0)/6 y0+=$dy y1+=$dy +elif $o>0" || "($is_ctrl" && "{*,ARROWUP}) +if $x1-$x0>16" && "$y1-$y0>16 +cx:=$x>=0" && "!{*,ARROWUP}?$x:($x0+$x1)/2) +cy:=$y>=0" && "!{*,ARROWUP}?$y:($y0+$y1)/2) +x0:=$cx+($x0-$cx)*0.75} y0={$cy+($y0-$cy)*0.75 +x1:=$cx+($x1-$cx)*0.75} y1={$cy+($y1-$cy)*0.75 +fi +elif $o<0" || "($is_ctrl" && "{*,ARROWDOWN}) +zfactor:=max(($x1-$x0+1)/$w,($y1-$y0+1)/$h) +if $zfactor<1.3 +cx:=$x>=0" && "!{*,ARROWDOWN}?$x:($x0+$x1)/2) +cy:=$y>=0" && "!{*,ARROWDOWN}?$y:($y0+$y1)/2) +x0:=$cx+($x0-$cx)/0.75} y0={$cy+($y0-$cy)/0.75 +x1:=$cx+($x1-$cx)/0.75} y1={$cy+($y1-$cy)/0.75 +dx:=$zfactor^2*($w-$x0-$x1)/2} dy={$zfactor^2*($h-$y0-$y1)/2 +x0+=$dx x1+=$dx y0+=$dy y1+=$dy +else +dx:=($w-$x0-$x1)/2 dy:=($h-$y0-$y1)/2 +x0+=$dx x1+=$dx y0+=$dy y1+=$dy +fi +elif $b&4" && "!$is_mouseout +if $panx<0" && "$pany<0 panx=$x pany=$y +else dx:=round($panx-$x) dy:=round($pany-$y) x0+=$dx y0+=$dy x1+=$dx y1+=$dy +fi +else panx=-1 pany=-1 +fi +if $ww!=$oww" || "$wh!=$owh" || "$ox0!=$x0" || "$oy0!=$y0" || "$ox1!=$x1" || "$oy1!=$y1 rm[baseview] fi +N={points,w} +if narg($baseview)" && "($b&3" || "{*,X}" || "{*,P})" && "$x>=0" && "$y>=0" && "$x<$w" && "$y<$h +if $selection==-1" && "$N +($x;$y) r. $N,2 -. [points] *. {max($ww,$wh)/max($x1-$x0,$y1-$y0)} sqr. s. y +[-2,-1] +dmin:=im selection:=$dmin>25?-1:xm rm. +fi +if narg($replace_color) +replace_color= wait -1 +elif $selection>=0 +if $b&1" && "$view_markers ++columns[points] $selection ox:=i[0] oy:=i[1] =. $x =. $y,0,1 j[points] .,$selection rm. +rm[view] +elif ($b&2" || "{*,X})" && "$view_markers +if $N>1 +z[points] {$selection+1},100% j[points] .,$selection rm. r[points] {$N-1},100%,1,1,0 +else rm[points] 0 => points fi +wait -1 rm[view] +fi +elif $b&1 +($x;$y;0) ($__color) y. y +. 1 a[-2,-1] y a[points,-1] x selection=$N +if !$view_markers view_markers=2 fi +rm[view] +elif $b&2" || "{*,P} +__color={colors,I($x*$pw/$w,$y*$ph/$h)} +fi +else selection=-1 +if {*,-SPACE}" && "narg($colors) replace_color= rm[colors] +elif {*,-TAB} view_markers:=($view_markers-1)%3 rm[view] wait -1 +elif !$is_ctrl" && "{*,-R} +if narg($replace_color) replace_color= else replace_color=$__color fi +rm[baseview] wait -1 +elif {*,PAGEDOWN} contrast:=max(0,$contrast-1) rm[view] wait -1 +elif {*,PAGEUP} contrast:=min(9,$contrast+1) rm[view] wait -1 +elif {*,BACKSPACE}" && "$N +if $N>1 z[points] 0,{$N-2} else i=$points rm[points] i[$i] 0 =>[$i] points fi +rm[view] wait -1 +fi +fi +w2,h2:=round(([$x1-$x0,$y1-$y0])/2) +if $x0<-$w2 x1-=$x0+$w2 x0=-$w2 fi +if $y0<-$h2 y1-=$y0+$h2 y0=-$h2 fi +if $x1>=$w+$w2 x0+=$w-1+$w2-$x1 x1:=$w-1+$w2 fi +if $y1>=$h+$h2 y0+=$h-1+$h2-$y1 y1:=$h-1+$h2 fi +if !narg($colors) +N={points,w} +if narg($view) to[view] "Processing...",5,5,20,2 w[view] fi +if $N +[points] +sh. 0,0,0,0 *. {$pw/$w} rm. +sh. 1,1,0,0 *. {$ph/$h} rm. +pointcloud. -1,$pw,$ph ++compose_channels. max !=. 0 distance. 1 *. 0.02 +. 1 ^. -1 +. [potential] +if !$1 dilate.. 3 fi +watershed.. . rm. -. 1 +else [potential],[potential],1,3,255 +fi +=> colors +if narg($baseview) rm[baseview] fi +fi +if !narg($replace_color)" && "narg($points_replaced) +rm[points,colors,view] =>[colors_replaced] colors =>[points_replaced] points current_replace_color= +elif narg($replace_color)" && "['$__color']!=['$current_replace_color'] +if narg($colors_replaced) rm[colors_replaced,points_replaced] fi +current_replace_color=$__color +if {points,w} ++replace_color[colors] 0,0,$replace_color,$current_replace_color ++rows[points] 3,5 permute. xzcy -. 1 +replace_color. 0,0,$replace_color,$current_replace_color ++. 1 permute. xcyz +j[points] .,0,3 rm.. +else 0 0 +fi +=> colors_replaced,points_replaced +if narg($baseview) rm[baseview] fi +fi +if !narg($baseview) +nx0:=$x0*$pw/$w ny0:=$y0*$ph/$h +nx1:=$x1*$pw/$w ny1:=$y1*$ph/$h ++z[img] $x0,$y0,$x1,$y1 +r. $ww,$wh,1,100%,{$ww baseview +if narg($view) rm[view] fi +fi +if !narg($view) +[baseview] r. 100%,100%,1,3 +if $contrast<9 /. {10-$contrast} +. {128*(1-1/(10-$contrast))} fi +if $view_markers +if $view_markers==2 rad1=5 rad2=3 else rad1=3 rad2=2 fi +if narg($replace_color)" && "{points,w} ipoints=$points_replaced else ipoints=$points fi +repeat w#$ipoints { ++columns[$ipoints] $> +x:=(i[0]-$x0)*$ww/(1+$x1-$x0) +y:=(i[1]-$y0)*$wh/(1+$y1-$y0) +col:=i[3]-1,i[4]-1,i[5]-1 +rm. +circle. $x,$y,$rad1,1,0 circle. $x,$y,$rad2,1,$col +} +fi +if narg($replace_color) +to. "Replace by",5,5,20,2 +rectangle. 80,8,111,25,1,0 rectangle. 82,10,109,23,1,$replace_color +rectangle. 150,8,181,25,1,0 rectangle. 152,10,179,23,1,$current_replace_color +fi +=> view +w[view] $ww,$wh,0,$title +fi +while {*}" && "!{*,ESC}" && "!{*,Q}" && "!{*,ENTER} +if narg($view) to[view] "Processing fullres...",5,5,20,2 w[view] fi +k[0,img,points] +N={points,w} status= +if $N +status={points,^} +[img] __x_colorize. $1 +pointcloud[points] -1,$w,$h ++compose_channels[points] max !=. 0 distance. 1 *. 0.02 +. 1 ^. -1 +[potential,-1] +if !$1 zfact:={img,max(w,h)}/{potential,max(w,h)} dilate[points] {int(3*$zfact)} fi +watershed[points] [potential] -[points] 1 =>[points] colors +else [img],[img],1,3,255 => colors +fi +if $3 +k[0,colors] a c +else +k[0,img,colors] +if $1 +*[img] -1 +. 255 channels. -3,0 blend[colors,-1] alpha rm[0,img] +else rgb2ycbcr[colors] j[colors] [img],0,0,0,0 rm[0,img] ycbcr2rgb[colors] +fi +fi +a c => $name +__color=-1 +u $status +w 0 +__x_colorize : +if $1 +n. 0,1 ^. 5 repeat 4 { +b. 0.5% min } +else +gradient_norm. n. 0,255 normalize_local. 3,3 *. -1 n. 0,255 +b. 0.05% n. 0,1 sqr. +b. 0.5% n[-2,-1] 0,1 min[-2,-1] +fi +=> potential +#@cli x_connect4 +#@cli : Launch the Connect Four game. +x_connect4 : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Connect Four"$n" --------------------------------------------\n +----\n +---- Connect four tokens in a row, column or diagonally\n +---- to win the game.\n +----\n +---- "${c}"Left mouse button"$n" on a column inserts a new token.\n +---- Keys '"${c}"SPACE"$n"' or '"${c}"ENTER"$n"' lets the computer play the turn\n +---- (or restart game when it's over).\n +---- Key '"${c}"ENTER"$n"' also enables autoplay for the current player.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' close the window.\n +----\n +----------------------------------------------------------------" +l[] { +7,6 => board +R={board,u={*,u};v={*,v};int(0.5*min(u/w,v/h))} +{2*$R},{2*$R} circle. 50%,50%,32%,1,1 b. 2% g. xy +[-2,-1] n. 0,1 ++n. -1,0.5 abs. negate. +f. 200 rv[-3--1] a[-3--1] c hsv2rgb. +to_rgba. circle. 50%,50%,27%,1,0 +{4*$R},{4*$R} circle. 50%,50%,20%,1,1 b. 1% g. xy +[-2,-1] n. 0,1 negate. +sqrt. +n. -1,0.8 abs. negate. +f. 10 rv[-3--1] a[-3--1] c +. sh. 0 f. 60 rm. hsv2rgb[-2,-1] +100%,100% circle. 50%,50%,30%,1,255 a[-3,-2] .,c rm. +r2dx[-3--1] $R s[-3--1] c,-3 rm... +n[^0] 0,255 round[^0] =>[^0] cache,cachem,token0,token1,tokenm ++b[cachem] 2% shift. 1%,1%,0,0,2 max[cachem,-1] +r[cache,cachem] 100%,{board,h*100}%,1,100%,0,2 +evalf="const op = 3 - p; +case(dx,dy) = ( +pgood = pbad = 0; +for (k = -2, k<2, ++k, +X = x + k*dx; +Y = y + k*dy; +if (X>=0 && X=0 && Y=0 && val==op, pgood = -1, pgood+=!!val); +if (pbad>=0 && val==p, pbad = -1, pbad+=!!val); +); +); +pgood = arg(2 + pgood,0,1,2,4,100,1e8); +pbad = arg(2 + pbad,0,1,2,4,10000,1e8); +pgood - pbad; +); +case(1,0) + case(0,1) + case(1,1) + case(1,-1)" +do +if !narg($visu) +{board,[w,h]*$R},1,3,64 +repeat h#$board { y=$> +repeat w#$board { x=$> +val={board,i($x,$y)} if $val j. [token{$val-1}],{$x*$R},{$y*$R},0,0,1,[tokenm],255 fi +} +} ++r[cache,cachem] {board,[w,h]*$R},1,100%,0,2 a[-2,-1] c blend[-2,-1] alpha +=> visu w[visu] 100%,100%,0,"[G'MIC] Connect Four" +turn=0 is_falling=0 x=-1 yv=0 dyv=0 winner= +autoplayer0=0 autoplayer1=0 +fi +if !narg($ymax) +{board,w},1,1,1,"y = -1; repeat (h#"$board",k, !i(#"$board",x,k)?(y = k)); y" => ymax +if iM<0 winner=-1,-1,-1 fi +fi +if narg($winner) +[visu] => tmpvisu +x:=arg(1,$winner) y:=arg(2,$winner) c:=arg(3,$winner) +if $x<0 +if !narg($text) +0 t. "Draw game",0,0,57,1,1 r2dx. {tmpvisu,w/2} expand_xy. 3,0 +dilate. 5 n.. 0,255 to_rgb.. +=> text,textm +fi +j[tmpvisu] [text],{tmpvisu,([w,h]-[w#$text,h#$text])/2},0,0,{0.7+0.3*sin(5*$|)},[textm] +else +repeat 4 { +[token$turn] +rgb2hsv. sh. 1,2 +. {0.4*sin(5*$|)} c. 0,1 rm. hsv2rgb. +j. [cache],0,0,0,0,1,[cachem],255 +j[tmpvisu] .,{$R*[$x,$y]},0,0,1 rm. +x+=$c!=2 y+=$c==1?0:$c==4?-1:1 +} +fi +w[tmpvisu] 100%,100% rm[tmpvisu] wait 20 +if {*,-SPACE}" || "{*,-ENTER} +rm[visu,ymax] f[board] 0 winner= +fi +elif !$is_falling +if !${autoplayer$turn} +x={visu,X={*,x};X<0?X:int(X*w#$board/w)} +yM:=i("#"$ymax,$x) +if {board,$x<0" || "$x>=w} w[visu] 100%,100% +else +[visu] $R,100%,1,3,($yM>=0)*($turn?[255,255,0]:[255,0,0]) +j.. .,{$x*$R},0,0,0,{$yM>=0?0.15:0.3} rm. +w. 100%,100% rm. +fi +wait +fi +if {*,-b}&1" && "$yM>=0" && "$x>=0 is_falling=1 yv=0 dyv=1 +elif ${autoplayer$turn}" || "{*,-SPACE}" || "{*,ENTER} +if {*,-ENTER} autoplayer$turn=1 fi +max_score=-inf max_col= +repeat w#$board { move1=$> +yM1:=i("#"$ymax,$move1) +if $yM1>=0 ++=[board] {1+$turn},$move1,$yM1 => board1 +{board,w},1,1,1,"y = -1; repeat (h#"$board1",k, !i(#"$board1",x,k)?(y = k)); y" => ymax1 +opp_max_score=-inf opp_max_board={board,^} +opp_turn:=($turn+1)%2 +repeat w#$board { move2=$> +yM2:=i("#"$ymax1,$move2) +if $yM2>=0 ++=[board1] {1+$opp_turn},$move2,$yM2 ++f. "const p = 1 + "$opp_turn"; "$evalf score:=is+u rm. +if $score>$opp_max_score opp_max_score=$score opp_max_board={^} fi +rm. +fi +} +rm[board1,ymax1] +{board,[w,h,1,1]},$opp_max_board +f. "const p = 1 + "$turn"; "$evalf score:=is+u rm. +if $score>$max_score max_score=$score max_col=$move1 fi +fi +} +x=$max_col is_falling=1 yv=0 dyv=1 +fi +else +if !narg($column) +$R,{board,h*$R},1,3,64 +repeat h#$board { v={board,i($x,$>)} if $v j. [token{$v-1}],0,{$>*$R},0,0,1,[tokenm],255 fi } +=> column +fi +yM:=i("#"$ymax,$x) +[column] +j. [token$turn],0,$yv,0,0,1,[tokenm],255 +j. [cache],0,0,0,0,1,[cachem],255 +[visu] => tmpvisu +j[tmpvisu] ..,{$R*$x},0,0,0 rm.. w[tmpvisu] 100%,100% +if $yv>=$yM*$R +j[visu] [tmpvisu] is_falling=0 +=[board] {$turn+1},$x,$yM +rm[ymax,column] ++f[board] "if (!i,0, +case_h = i==j(1) && i==j(2) && i==j(3); +case_v = i==j(0,1) && i==j(0,2) && i==j(0,3); +case_d1 = i==j(1,1) && i==j(2,2) && i==j(3,3); +case_d2 = i==j(1,-1) && i==j(2,-2) && i==j(3,-3); +case_h?1:case_v?2:case_d1?3:case_d2?4)" +if iM winner:=xM,yM,i(xM,yM) +else turn:=($turn+1)%2 +fi +rm. +fi +rm[tmpvisu] +yv:=min($yM*$R,$yv+$dyv) dyv+={visu,h/100} +wait 20 +fi +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w 0 } +#@cli xz : eq. to 'x_crop' +xz : +_gmic_s="$?" v + _x_crop +#@cli x_crop +#@cli : Crop selected images interactively. +#@cli : If multiple input images are selected, the same crop is applied to all images. +#@cli : (eq. to 'xz'). +x_crop : +_gmic_s="$?" v + _$0 +_x_crop : +e[0--3] "Crop image"$_gmic_s" interactively." +if $!<1 return fi +w[0] ${"fitscreen "{0,[w,h,d]}},1,"[G'MIC] "{n}" - Interactive crop" ++select[0] 2,{0,round([w,h,d]/2)},0,1 coords={^} rm. +z $coords +u $coords +#@cli x_cut +#@cli : Cut selected images interactively. +x_cut : +e[^-1] "Cut image"$_gmic_s" interactively." +foreach { +wsiz0=${"fitscreen ."} +value0,value1=-1,-1 +w[] $wsiz0,0,"[G'MIC] "{n}" - Interactive cut" +0 +for {*}" && "!{*,ESC} { +if [w#1,h#1]!=[{*,w,h}] # Generate image view +rm[1] +slices[0] 50% r. {*,w,h},1,100%,1 w. +fi +mx,my,mb={*,x,y,b} +if $mb" && "$mx>=0" && "$my>=0 +value0,value1:="dw1 = "{*,w}" - 1; value0 = "$mx"*100/dw1; +dh1 = "{*,h}" - 1; value1 = "$my"*100/dh1; +[ value0,value1 ];" +update_view=1 +fi +if $update_view +if $value0>=0" && "$value1>=0 ++c[1] $value0%,$value1% n. 0,255 +to. "Min: "{_round($value0,0.1)}%"\n""Max: "{_round($value1,0.1)}%,1%,1%,{max(13,3.5*h%)} +w. rm. +else w. +fi +update_view=0 +fi +wait +if {*,r} update_view=1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,D} +w[] {{*,w}*1.5},{{*,h}*1.5} wait -1 update_view=1 +fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,C} +w[] {{*,w}/1.5},{{*,h}/1.5} wait -1 update_view=1 +fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,R} +w[] $wsiz0 wait -1 update_view=1 +fi +} +w[] 0 rm. u $value0%,$value1% c ${} +} +#@cli x_fire +#@cli : Launch the fire effect demo. +x_fire : skip "${1=}" check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Fire effect"$n" ------------------------\n +----\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-------------------------------------------" +if "['$1']==0" label="G\47MIC" is_fps=1 else label="$1" is_fps=0 fi +i[0] 100,32 w[0] {[4.5*w,6.75*h]},0,"[G"{`39`}"MIC] Fire Effect" +if {*,w}<0.5*{*,u} w[] {[{*,w},{*,h}]*1.5} fi +i[1] (0,255,255,255,255^0,0,255,255,255^0,0,0,128,255) r[1] 256,1,1,3,3 +i[2] (0,0,0;0,0,0;1,1,1;0,1,0) *[2] 0.21 +text3d $label,33,3,1 +mv. 3 c3d[3] n3d[3] *3d[3] 320 col3d[3] 255,205,130 db3d 0 f3d 300 +100,100 rand. 0,255 ellipse. 50%,50%,5,5,0,1,300 b. 10 +sharpen. 1000 shrink_xy. 1 n. 0,255 to_rgb. light3d . rm. +angle=0 +do +correlate[0] [2] +{0,w},1 rand. 128,256 j[0] .,0,{{0,h}-1} rm. ++r[0] 400,200,1,1,3 map. [1] ++r3d[3] 0,1,0,$angle j3d.. .,50%,50%,0,1,5,0,0 +*3d. 0.25,0.16,1 j3d[0] .,50%,50%,0,1,3,0,0 +rm. +angle+=3 +if $is_fps +fps=${-fps} if $fps>0 to. $fps" fps",5,{h-22},16,1,0.2 fi +fi +w. +if {*,CTRLLEFT}" && "{*,D} w[] {1.5*[w,h]} elif {*,CTRLLEFT}" && "{*,C} w[] {[w,h]} fi +rm. wait 40 +while {*}" && "!{*,ESC}" && "!{*,Q} +rm[0-3] w 0 +#@cli x_fireworks +#@cli : Launch the fireworks demo. +x_fireworks : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Fireworks"$n" --------------------------\n +----\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------" +l[] { +(16;64^64;32^128;32) r 320,160,1,3,3 +. +w. ${"fitscreen .,35%"},0,"[G"{`39`}"MIC] Fireworks" +time=0 +do +time-=1 +if $!==2\ ||\ $time<0 +i[0] ({u(w)},\ +{h},\ +{u(-3,3)},\ +{u(2)-5},\ +{30+u(20)},\ +1.5,\ +255,255,255) +time:=u(20) +fi +*. 0.99 +j. ..,0,0,0,0,0.2 +i=0 +repeat $!-2 { +to_be_removed=0 +radius:={$i,@4}>0?{$i,@5}/3:{$i,@5}*(1+2*({$i,@4}+2)/120) +ellipse. {$i,@0},{$i,@1},{$i,@5},{max(1,$radius)},{atan2({$i,@3},{$i,@2})*180/pi},0.6,{$i,@6-8} +({$i,@2},{$i,@3},0,0.09,-1,0,0,0,0) +[$i,-1] +if {$i,@0}<0\ ||\ {$i,@0}>=w\ ||\ {$i,@1}>=h\ ||\ $radius<0 to_be_removed=1 fi +if {$i,@4}<0\ &&\ {$i,@4}>=-1 +color:=min(255,80+u(200)),min(255,80+u(200)),min(255,80+u(200)) +radius:=u(10) +N:=5+u(10) +repeat $N { +angle:=$>*2*pi/$N +i... ({$i,@0,1},{2*cos($angle)+{$i,@2}/1.5},{2*sin($angle)+{$i,@3}/1.5},-2,$radius,$color) +} +to_be_removed=1 +fi +if $to_be_removed rm[$i] else i+=1 fi +} +fps=${-fps} if $fps>0 to. $fps" fps",3,{h-20},14,1,0.2 fi +w. wait 20 +if {*,CTRLLEFT}" && "{*,D} w[] {3*w},{3*h} elif {*,CTRLLEFT}" && "{*,C} w[] {1.5*w},{1.5*h} fi +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w 0 } +#@cli x_fisheye +#@cli : Launch the fish-eye effect demo. +x_fisheye : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Fish-eye effect"$n" --------------------\n +----\n +---- "${c}"Mouse pointer"$n" moves fish-eye center.\n +---- "${c}"Mouse buttons"$n" set fish-eye size.\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-------------------------------------------" +if $!>0 a x n 0,255 r2dy 220 else +120,90,1,3 rand. 0,255 plasma. 0.3,3 n 0,255 +t " G\47MIC\nFISH-EYE\n EFFECT",20,13,23,1,255 scale3x b 5 sharpen 1000 +f i+150-3*abs(y-h/2) c. 0,255 frame_fuzzy. 15,10,15,1.5,0 to_rgb. +fi +torus3d 20,6 col3d. {u(30,255)},{u(30,255)},{u(30,255)} +r3d. 1,0,0,90 +col3d. {u(30,255)},{u(30,255)},{u(30,255)} +3d. 15 +3d[-2,-1] *3d. 4 db3d 0 c3d. +R=30 +w.. {1.25*{-2,w}},{1.25*{-2,h}},0,"[G"{`39`}"MIC] Fish-Eye Effect" +do +wait 40 +if {*,b}==1 R:=min(80,$R+8) fi +if {*,b}==2 R:=max(3,$R-8) fi ++j3d.. .,{50+30*cos($|*2.5)}%,{50+30*sin($|*1.6)}%,{80+230*sin($|*2.6)},0.7,3,0,0 r3d.. 1,0.2,0.6,3 +if {*,x}>=0 +fisheye. {{*,x}*100/{*,w}},{{*,y}*100/{*,h}},$R +fi +w. +if {*,CTRLLEFT}" && "{*,D} w[] {3*w},{3*h} elif {*,CTRLLEFT}" && "{*,C} w[] {1.5*w},{1.5*h} fi +rm. +if !{*}" || "{*,ESC}" || "{*,Q} rm[-2,-1] w 0 return fi +while 1 +#@cli x_fourier +#@cli : Launch the fourier filtering demo. +x_fourier : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Fourier-filtering"$n" ----------------------------------------\n +----\n +---- "${c}"Mouse buttons"$n" on the right image to set min/max frequencies.\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to decrease window size.\n +---- Keys '"${c}"CTRL+R"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-----------------------------------------------------------------" +if !$! sp ? r2dx 400 fi +foreach { +need_update=1 +freqmin=0 +freqmax=100 +if w>3*{*,u}/5 r2dx. {3*{*,u}/10} fi +if h>3*{*,v}/5 r2dy. {3*{*,v}/5} fi ++fft. => real,imag ++sqr[real,imag] +[-2,-1] sqrt. +. 1 log. +n. 0,255 shift. {round(w/2)},{round(h/2)},0,0,2 to_colormode. {-2,s} +=> logmag ++r2dy. 128 frame. 1,1,0 => thumb +w[0,-2] -1,-1,0,"[G"{`39`}"MIC] Fourier Filtering" +l { +if !narg($first_time) +parallel 0,"alert[thumb] \"[G"{`39`}"MIC Fourier Filtering]\",\"The G\47MIC Fourier filtering demo illustrates the effect\nof bandpass frequency filtering on an image. Use your mouse\nbuttons to select low and high bounds for the frequencies\ndisplayed on the Fourier representation of the image\n(right image).\",\"OK\"" +first_time=0 +fi +do +if $need_update +[logmag],[logmag] => mask +r:=sqrt(w^2+h^2)*$freqmax/200 ellipse[mask] 50%,50%,$r,$r,0,1,1 +r:=max(0,sqrt(w^2+h^2)*$freqmin/200-1) if $r ellipse[mask] 50%,50%,$r,$r,0,1,0 fi ++*[logmag] [mask] +. [mask] /. 2 n. 0,255 +shift[mask] -{mask,round(w/2)},-{mask,round(h/2)},0,0,2 ++*[real,imag] [mask] +rm[mask] +ifft[-2,-1] rm. n. 0,255 +rv[-2,-1] +if {*} r[-2,-1] {{*,w}/2},{*,h} fi +t. "Freq. Min/Max = "{int($freqmin)}"% / "{int($freqmax)}"%",5,5,13,1,255 +w[-2,-1] rm[-2,-1] +need_update=0 +fi +wait +if {*,b}" && "{*,x}>={*,w}/2 +r:=200*sqrt(({*,x}-3*{*,w}/4)^2+({*,y}-{*,h}/2)^2)/\ +sqrt(({*,w}/2)^2+{*,h}^2) +if {*,b}&1 freqmax=$r +else freqmin:=max(0,$r-3) +fi +if $freqmin>=$freqmax freqmin=$freqmax fi +need_update=1 +fi +if {*,r} need_update=1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,D} w[] {{*,w}*1.5},{{*,h}*1.5} need_update=1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,C} w[] {{*,w}/1.5},{{*,h}/1.5} need_update=1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,R} w[] {2*{0,w}},{0,h} need_update=1 fi +while {*}" && "!{*,ESC}" && "!{*,Q} +w 0 +} +rm[^0] +} rm +#@cli x_grab_color : _variable_name +#@cli : Open a color grabber widget from the first selected image. +#@cli : Argument 'variable_name' specifies the variable that contains the selected color values at any time. +#@cli : Assigning '-1' to it forces the interactive window to close. +#@cli : Default values: 'variable_name=xgc_variable'. +x_grab_color : skip ${1=xgc_variable} check_display $0 +if !$! error[0--3] "Command '$0': Missing specified input image." fi +l[0] { nm={n} => img +e[^-1] "Open "${arg\ {0,s},GRAY,GRAYA,RGB,RGBA}" color grabber widget for image$?, with variable name '$1'." +if !{*} w[] ${fitscreen[]\ {[w,h,1]},128,50%},0,0,-1,-1,"Grab a color" fi +_x_grab_color +dilate. 3 => icon_mask *.. 255 to_rgb.. =>.. icon_sprite +xc=5 yc=5 o$1=$$1 +cursor[0] 0 +do +if !narg($visu0) ++r[img] {*,w},{*,h},1,100%,2 drgba. w. => visu0 +fi +x,y,b={*,x,y,b} mouse_over={$x>=0" && "$y>=0} +hc:=narg($$1)?40:24 +yc={visu0,nhc=h-$hc-8;!$mouse_over?$yc:$y<$hc||$yc+$hc>=h?nhc:$y>=nhc?5:$yc} +if [0$ox,0$oy,0$ob,0$ohc,0$oyc,0$ocolor,0${o$1}]!=[$x,$y,$b,$hc,$yc,0$color,0$$1] +[visu0] => visu +if narg($color) +24,$hc,1,[img] fc. $color +if narg($$1) rectangle. 0,24,100%,100%,1,$$1 line. 0,24,100%,24,1,0 fi +drgba. frame. 1,1,0 frame. 1,1,255 j[visu] .,$xc,$yc rm. +0 +if narg($$1) +t. "Position ("$X","$Y")\nColor ("{``$color}")\nSelected ("{``$$1}")",1,0,15,1,255 +else +t. "Position ("$X","$Y")\nColor ("{``$color}")",1,0,15,1,255 +fi ++dilate. 5 r.. 100%,100%,1,3 +j[visu] ..,{30+$xc},$yc,0,0,0.85,.,255 rm[-2,-1] +fi +if $mouse_over +X={img,round($x*(w-1)/({*,w}-1))} +Y={img,round($y*(h-1)/({*,h}-1))} +color={img,round(I($X,$Y))} +j[visu] [icon_sprite],$x,{icon_sprite,$y-h+1},0,0,1,[icon_mask] +if $b&1 $1=$color fi +fi +w[visu] rm[visu] +ox=$x oy=$y ob=$b ohc=$hc oyc=$yc ocolor=$color o$1=$$1 +fi +if arg(1,{'$1'})==_'_'" && "arg(2,{'$1'})==_'_' wait 50 else wait fi +if {*,r} w[] -1 rm[visu0] yc=5 fi +if ['$$1']=='-1' break fi +while {*}" && "!{*,ESC}" && "!{*,Q} +w 0 k[img] => $nm } +u $color +_x_grab_color : +base642img[] "MSB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMSAzMzcgMSAxICMyNzcKeJyNiNlOwlAYBi9IDDcaY+LGpiJbj7tBKEbglTQE7dcbkZS1gfNXFCx""lK6WE83w+gDaaeG0mmWTm67NSea5s1Pz6Ot80tnrb/d3BnhkYBq3QKDyOTA5nmfqDnW2W5nK77Mj60yLXgZvrqm6Oq47MYWc4ZhnCJE2wrgjmBWFwRm""r/hNQ3ZqivKQIlCN0YQZdeQGgxzXOD1T3XWEMhVWMtz1Wmw4h1QHEOShogqQc67YPOBwpdmgpdWzDSY9DNFJS1wWUH/NZF926FTl4oel48tgui3C6KU""rMo7rWCYCvJg4k/fvp/5/dJq9QyuUy48UXMOZ5H7ah9ND2YRMbhUXgUsoLDgOnxsf++0/TX1zRf1fcNa0iPgw==" +-. 127 decompress_rle. +frame. 10,10,0 +r2dx. 24 +#@cli x_hanoi +#@cli : Launch the Tower of Hanoi game. +x_hanoi : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Tower of Hanoï"$n" ---------------------\n +----\n +---- "${c}"Left button"$n" and "${c}"mouse"$n" to move a disk.\n +---- "${c}"Right button"$n" to rotate 3D view.\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-------------------------------------------" +l[] { +l[] { +cylinder3d 1,10 r3d 1,0,0,90 +++3d 10,0,0 +-3d.. 10,0,0 +box3d 30,1,10 -3d. 15,0,5 ++3d => rods3d +400,400 noise. 1 fftpolar. f.. "r = sqrt((x - w/2)^2 + .01*(y - h/2)^2);i/(1 + r)" ifftpolar[-2,-1] n. 0,31 +(86,50,50;132,36,12;218,109,66;231,207,180;255,193,140) permute. yzcx r. 32,1,1,3,3 +map.. . rm. b. 2% b. x,1% sharpen. 100 c. 0,255 +r3d.. 1,0,0,-90 texturize3d.. . r3d.. 1,0,0,90 rm. +} +l[] { +6,1,1,3,'[360*x/w,0.9*(1-(x/w)^0.5),0.9]' hsi2rgb. +ytop0=0 +repeat w#0 { +R,r:=3-0.3*$>,1.6-0.22*$> +torus3d $R,$r,36,10 +300,300 plasma. 1,1,3 b. 20 sharpen. 300 n. 150,255 1,1,1,3,{0,I[$>]} r. ..,..,1,3 rv[-2,-1] blend[-2,-1] +luminance,0.75 +texturize3d.. . rm. +/3d. 1,1,{0.3+$r} r3d. 1,0,0,90 -3d. 0,0.8,0 +a$>,x$>,y$>,h$>=0,0,$ytop0,{1.8*$r/(0.3+$r)} +ytop0+=${h$>} +=> disk3d$> +} +rm[0] +} +w[] 640,400,0,"[G"{`39`}"MIC] Tower of Hano\357" +1,3,1,3,'!y?[32,128,100]:y==1?[64,16,0]:[0,0,0]' r. {*,w},{*,h},1,3,3 => background +nb_moves,buttons,motion3d_x,motion3d_y=0 +x,rod,rod_source,rod_target,selected=-1 +fading=$| error=0 +do +repeat 6 { +r3d[disk3d$>] 1,1,1,${a$>} +3d. {10*(${x$>}-1)},-${y$>},0 } +3d[-6--1] +3d. [rods3d] +r3d. 1,0,0,20 +if !($buttons&2) r3d. 0,1,0.3,{5*cos(1.5*$|)} r3d. 0.3,0,1,{3*sin(0.8*$|)} fi +r3d. 1,0,0,$motion3d_y r3d. 0,-1,0,$motion3d_x *3d. 20 +[background] j3d. ..,50%,70%,10,1,5,0,1,800,200,0,-3000,0.15,0.2 +t. "#Moves: "$nb_moves,2%,92%,20,1,255 +if $error (255^0^0) ri. .. j.. .,0,0,0,0,$error error:=max(0,$error-0.2) rm. fi +if $|-$fading<1 *. {$|-$fading} fi +w. wait 40 +if {*,CTRLLEFT}" && "{*,D} w[] {w*1.5},{h*1.5} elif {*,CTRLLEFT}" && "{*,C} w[] {w},{h} fi +rm[-2,-1] +top0,top1,top2,ytop0,ytop1,ytop2=-1 +repeat 6 { +rod:=round(${x$>}) +if $selected!=$>" && "${y$>}+${h$>}>${ytop$rod} ytop$rod:=${y$>}+${h$>} top$rod=$> fi +} +prev_buttons=$buttons +mouse_x,mouse_y,buttons={*,x,y,b} +if $mouse_x>=0 x:=2.6*($mouse_x/{*,w}-0.5)+1 rod:=round($x) fi +if $mouse_x>=0" && "$buttons&2 +motion3d_x,motion3d_y:=([$mouse_x,$mouse_y]/[{*,w},{*,h}]-0.5)*90 +elif $mouse_x>=0" && "$buttons&1 +if $selected<0 +selected=${top$rod} +rod_source:=$selected<0?-1:$rod +fi +if $selected>=0" && "$rod>=0 +if ${y$selected}<11 y$selected:=min(11,${y$selected}+3) +else +x$selected+=d=$rod-${x$selected};sign(d)*min(0.3,abs(d)) +y$selected:=x=${x$selected};11+1.5*sin(pi*abs(x-round(x))) +a$selected:=x=${x$selected};45*sin(pi*abs(x-round(x))) +fi +fi +elif !$buttons +if $rod>=0" && "$selected>=0 +if $rod_target<0 +if ${top$rod}<$selected rod_target=$rod nb_moves+=$rod_target!=$rod_source +else rod_target=$rod_source error=0.8 +fi +fi +x$selected=$rod_target +a$selected=0 +ytop:=max(0,${ytop$rod_target}) +if ${y$selected}>$ytop y$selected:=max($ytop,${y$selected}-3) +else x,rod,rod_source,rod_target,selected=-1 +fi +fi +fi +if !($buttons&2) +motion3d_x-=sign($motion3d_x)*min(1,abs($motion3d_x)) +motion3d_y-=sign($motion3d_y)*min(1,abs($motion3d_y)) +fi +while {*}" && "!{*,ESC}" && "!{*,Q} +w[] 0 rm } +#@cli x_histogram +#@cli : Launch the histogram demo. +x_histogram : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Histogram demo"$n" -------------------------------\n +----\n +---- "${c}"Mouse"$n" to set parameters.\n +---- "${c}"Right button"$n" or key '"${c}"SPACE"$n"' to reset.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-----------------------------------------------------" +if !$! sp ? to_rgb +else k[0] to_rgb r2dy 300,2 if w>800 r 800,100%,1,3,2 fi n 0,255 +fi ++frame. 1,1,0 +300,{h},1,3,220 +t. "Gamma :",5,0,16,1,0 +t. "Contrast :",5,50,16,1,0 +t. "Brightness :",5,100,16,1,0 +t. "Smoothness :",5,150,16,1,0 +t. "Sharpness :",5,200,16,1,0 +t. "Clusters :",5,250,16,1,0 +a[-2,-1] x +{w},200,1,3,255 +grid. 10%,10%,0,0,0.3,0xCCCCCCCC,0 +rectangle. 0,0,100%,100%,1,0xFFFFFFFF,0 +axes. 0,255,1,0,13,1,0 +frame[-2,-1] 5,5,220 +a[-2,-1] y +clusters=64 sharpness=0 smoothness=0 contrast=1 brightness=0 gamma=1 +do +[0] +ia:=ia +if $gamma /. 255 ^. {1/$gamma} *. 255 fi +-. $ia *. $contrast +. $brightness +. $ia +b. $smoothness +sharpen. $sharpness +c. 0,255 ++j.. .,6,6 +sx:=w#0+12 +_x_histogram. {$gamma*100/4} j.. .,$sx,25 rm. +_x_histogram. {$contrast*100/4} j.. .,$sx,75 rm. +_x_histogram. {($brightness+128)*100/256} j.. .,$sx,125 rm. +_x_histogram. {$smoothness*100/10} j.. .,$sx,175 rm. +_x_histogram. {$sharpness*100/2000} j.. .,$sx,225 rm. +_x_histogram. {$clusters*100/256} j.. .,$sx,275 rm. ++s.. c histogram[-3--1] $clusters,0,255 /[-3--1] {6*{0,wh}/$clusters} rm[-5] ++z[-4] 5,{0,h+16},{{-4,w}-5},{{-4,h}-6} +graph. [-4],3,0,1,0,0.2,255,0,0 +graph. ...,3,0,1,0,0.2,0,255,0 +graph. ..,3,0,1,0,0.2,0,0,255 +rm[-4--2] +j.. .,5,{0,h+16} rm. +if {*,b}&1\ &&\ {*,x}<{0,w}\ &&\ {*,y}<{0,h} +j. [0],6,6 to. Original,10,10,16 +fi +w. {w},{h},0,"[G"{`39`}"MIC] Histogram Demo" rm. +wait +if {*,b}&1\ &&\ {*,x}>={0,w}-10 +if {*,y}>=25\ &&\ {*,y}<=42 +gamma:=max(0,min(4,({*,x}-$sx)*4/280)) +elif {*,y}>=75\ &&\ {*,y}<=92 +contrast:=max(0,min(4,({*,x}-$sx)*4/280)) +elif {*,y}>=125\ &&\ {*,y}<=142 +brightness:=max(-128,min(128,({*,x}-$sx)*256/280-128)) +elif {*,y}>=175\ &&\ {*,y}<=192 +smoothness:=max(0,min(10,({*,x}-$sx)*10/280)) +elif {*,y}>=225\ &&\ {*,y}<=242 +sharpness:=max(0,min(2000,({*,x}-$sx)*2000/280)) +elif {*,y}>=275\ &&\ {*,y}<=292 +clusters:=max(2,min(256,({*,x}-$sx)*256/280)) +fi +fi +if {*,b}&2\ ||\ {*,SPACE} clusters=64 sharpness=0 smoothness=0 contrast=1 brightness=0 gamma=1 fi +while {*}" && "!{*,ESC}" && "!{*,Q} +w 0 rm +_x_histogram : +val:=max(0,min(100,$1)) +280,2,1,3,255 line. 0,0,$val%,0,1,0,255,0 line. 0,1,$val%,1,1,240,255,62 r. 100%,16,1,3,3 +0 t. {round($val)}%,0,0,14,1,1 +*. -255 +. 255 r. 100%,100%,1,3 +j... .,{(280-w)/2},{(16-h)/2},0,0,1,.. rm[-2,-1] +r. {w+2},{h+2},1,3,0,0,0.5,0.5 +#@cli x_hough +#@cli : Launch the hough transform demo. +x_hough : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Hough-transform"$n" -----------------------------------------\n +----\n +---- "${c}"Mouse buttons"$n" on the vote image to draw corresponding line.\n +---- "${c}"Mouse buttons"$n" on the image to vote for all lines crossing.\n +---- the clicked point.\n +---- Key '"${c}"SPACE"$n"' to reset the hough window.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-----------------------------------------------------------------" +if !$! l[] { sp greece onfail testimage2d 400 } fi +n 0,255 +foreach { +r. ${fitscreen\ {[w,h]}},1,100%,3 +if !narg($first_time) +parallel 0,"+l[0] { r2dy 128 frame 1,1,0 alert \"[G"{`39`}"MIC Hough Transform]\",\"The G\47MIC Hough transform demo illustrates the application\nof the Hough transform to detect lines in an image. Use your\nmouse buttons to explore the transform image and see how\nlines in images are represented by points in the transform.\",\"OK\" rm }" +first_time=0 +fi +rhomax:=sqrt(w^2+h^2)/2 ++b. 1.5 hough. 512,400 b. 0.5 +. 1 log. n. 0,255 +w.. -1,-1,0,"[G"{`39`}"MIC] Image" w1. -1,-1,0,"[G"{`39`}"MIC] Hough Transform" +do +wait +if {*,b} +x0:={*,x}-{*,w}/2 +y0:={*,y}-{*,h}/2 +rho0:=sqrt(($x0)^2+($y0)^2) +theta0:=atan2($y0,$x0) +(0,{2*pi}) ($theta0,{$theta0-2*pi}) +r[-2,-1] {-3,w},1,1,1,3 +cos. *. $rho0 +<. 0 abs.. +*. {pi} +[-3,-1] %.. {2*pi} +*.. {0.5*{-3,w}/pi} *. {{-3,h}/$rhomax} +a[-2,-1] y +repeat w { point.. {i($>,0)},{i($>,1)},0,0.3,255 } +rm. w1. +elif {*1,x}>=0" && "{*1,b} +theta:={*1,x}*2*pi/{*1,w} +rho:={*1,y}*$rhomax/{*1,h} +x:={-2,w}/2+$rho*cos($theta) +y:={-2,h}/2+$rho*sin($theta) +x0:=$x+1000*sin($theta) +y0:=$y-1000*cos($theta) +x1:=$x-1000*sin($theta) +y1:=$y+1000*cos($theta) +.. +line. $x0,$y0,$x1,$y1,1,0x0F0F0F0F,255 +line. {$x0+1},$y0,$x1,$y1,1,0x0F0F0F0F,255 +line. $x0,{$y0+1},$x1,$y1,1,0x0F0F0F0F,255 +line. $x0,$y0,$x1,$y1,1,0xF0F0F0F0,0 +line. {$x0+1},$y0,$x1,$y1,1,0xF0F0F0F0,0 +line. $x0,{$y0+1},$x1,$y1,1,0xF0F0F0F0,0 +w. rm. +elif {*,SPACE}" || "{*1,SPACE} +rm. +b. 1.5 hough. 512,400 b. 0.5 +. 1 log. n. 0,255 +w1. -1,-1,0,"Hough Transform" +elif {*,r} w.. +elif {*1,r} w1. +fi +while {*}" && "{*1}" && "!{*,ESC}" && "!{*,Q}" && "!{*1,ESC}" && "!{*1,Q} +w 0 w1 0 +rm. +if !{*}" || "!{*1} break fi +} +rm +#@cli x_jawbreaker : 0<_width<20,0<_height<20,0<_balls<=8 +#@cli : Launch the Jawbreaker game. +x_jawbreaker : check "${1=12}>0 && $1<20 && ${2=13}>0 && $2<20 && ${3=5}>0 && $3<=8" check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Jawbreaker"$n" --------------------------------------------\n +----\n +---- The goal of the game is to "${c}"remove the maximum number of\n +---- balls on the board"$n", simply by clicking on them. But a\n +---- colored ball can disappear only if it is grouped with at\n +---- least one ball of the same color. The score is higher if\n +---- you destroy larger sets of connected colored balls.\n +----\n +---- "${c}"Left mouse button"$n" to select/destroy balls on board.\n +---- Key '"${c}"BACKSPACE"$n"' or '"${c}"SPACE"$n"' to undo the last move.\n +---- Key '"${c}"S"$n"' to save snapshot of the current view.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------------------------" +$1,$2 => board rand[board] 1,$3 round[board] 1 +. => undo +40,40,1,4 => balls _x_jawbreaker_ball. +autocrop. 0 expand_xy. 1,0 *. 1.5 c. 0,255 r. {{board,w}*w},{{board,h}*h},1,1,0,2 /. 255 +{w},{h},1,3 => back +l. { +rand 0,255 blur_xy 6,20 equalize 100,0,255 blur_xy 2,4 +sh 0 sh.. 1 sh... 2 /... 4 /.. 8 /. 2 rm[-3--1] +} +[back] => visu +score=0 +undoscore=0 +render_board=1 +shapescorey=0 +shapescore=0 +do +if $render_board ++abs[board] -. 1 *. {360/$3} +>=[board] 0 *. 0.9 +!=[board] 0 +ri[-3--1] [balls] [balls] *[-2,-1] a[-3--1] c hsv2rgb. ++compose_channels. + >. 0 dilate. 3 +j[visu] [back] j[visu] ..,0,0,0,0,1,. rm[-2,-1] +if !$shapescorey w[visu] {back,w},{back,h},0,"[G"{`39`}"MIC] Jawbreaker (Score : "$score")" fi +render_board=0 +fi +if $shapescorey ++t[visu] "+"$shapescore,{*,x},{{*,y}-64+$shapescorey},32,{($shapescorey-1)/31},255 +shapescorey:=max(0,$shapescorey-1) +w. {back,w},{back,h},0,"[G"{`39`}"MIC] Jawbreaker (Score : "$score")" rm. wait 25 +else wait fi ++f[board] "i?j(-1)==i || j(1)==i || j(0,1)==i || j(0,-1)==i:0" +if !is rm. break fi rm. +if {*,r} render_board=1 +elif {*,S} o[visu] gmic_jawbreaker.png +elif {*,BACKSPACE}" || "{*,SPACE} +abs[undo] j[board] [undo] +score=$undoscore +render_board=1 +elif {*,x}>=0" && "{*,b} +wait -1 +x:=int({*,x}*{board,w}/{*,w}) +y:=int({*,y}*{board,h}/{*,h}) +if {{board,i($x,$y)}>0} +abs[board] flood[board] $x,$y,0,0,0,1,-{board,i($x,$y)} ++>=[board] 0 -. 1 +shapescore:=(is+1)^2 shapescorey:=$shapescore?32:0 rm. +elif {board,i($x,$y)} ++flood[board] $x,$y,0,0,0,1,-1 ==. -1 +if is>1 +j[undo] [board] +undoscore=$score +flood[board] $x,$y,0,0,0,1,0 +repeat w#$board { ++columns[board] $> mirror. y +h={board,h} +l. { s -,0 a y if $! r 1,$h,1,1,0 mirror y else i 1,$h fi } +j[board] .,$> rm. +} +rows[board] -1,100% f[board] "!y?(i(x,h-1)?x:w):i" sort[board] +,x rows[board] 1,100% +score+=int((is-1)^2) +fi +rm. +else abs[board] +fi +render_board=1 +fi +while {*}" && "!{*,Q}" && "!{*,ESC} +if {*}" && "!{*,ESC} +w[] {visu,w},{visu,h},0,"[G"{`39`}"MIC] Jawbreaker (Final Score : "$score")" +260,85 => gameover t. "Game Over!",3,0,53,1,1 t. "Score : "$score,23,53,32,1,1 ++dilate. 5 => "mgameover" *.. 255 r.. 100%,100%,1,3 +repeat 25 { ++r[gameover,mgameover] {400-12*($>+1)}%,{400-12*($>+1)}% ++j[visu] ..,{({visu,w}-w)/2},{({visu,h}-h)/2},0,0,{$>/25},. +w. rm[-3--1] wait 25 +} +do +wait if {*,r} w[] {*,w},{*,h} wait -1 fi +while {*}" && "!{*,Q}" && "!{*,ESC}" && "!{*,b} +rm[gameover,mgameover] +fi +rm[board,undo,balls,back,visu] +w 0 +_x_jawbreaker_ball : +mwh:=min(w,h) +sh 3 f. 0 rm. +ellipse {0.5*$mwh},{0.5*$mwh},{0.5*$mwh-4},{0.5*$mwh-4},0,1,240,240,240,1 +sh 0,2 *. '($mwh+y-x)/(2*w)' rm. +sh 3 *.. . dilate. 5 rm. +sh 0,2 +. '"i && (!j(-1) || !j(1) || !j(0,-1) || !j(0,1))?240/6:0"' rm. +ellipse {$mwh*0.7},{$mwh*0.3},{min(30,$mwh*$mwh/512)},{min(30,$mwh*$mwh/512)},0,{min($mwh/64,1)},255,255,255,1 +#@cli x_landscape +#@cli : Launch the virtual landscape demo. +x_landscape : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Virtual landscape"$n" -------------------------------------\n +----\n +---- Enjoy the view!\n +----\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------------------------" +l[] { +W=150 H=350 +900,900 plasma. 1,1,6 b. 0.07% n. 0,255 => map ++g. *. 0.5 +[-2,-1] n. 0,1 ^. 2 n. -150,330 +equalize[map] 256 n[map] -400,160 c[map] 0,100% +(0,102,51;149,175,124;102,42,0;255,255,255) permute. yzcx srgb2rgb. r. 256,1,1,3,3 rgb2srgb. ++n[map] 0,255 map. .. rm.. ++. .. rm.. c. 0,255 => colors +$W,$H,1,1,x y. x => x +$W,$H,1,1,"1 + x + y*w" y. x => offsets +$W,$H,1,1,"0.5*y" => gmap Mgmap:=iM +$W,$H,1,3 fc. 60,80,135 => ccolors +$W,$H,1,1,"(y/$H)^2" => mcolors +$W,400,1,1,"b=h-1-$Mgmap;y>=b?256+(y-b)*255/(h-1-b):y*255/b" round. +(96^16^128) (0^200^255) a[-2,-1] x r. 256,1,1,3,3 +(0^32^0) (0^64^128) a[-2,-1] x r. 256,1,1,3,3 +a[-2,-1] x map.. . rm. +=> background +quadrangle3d[] -0.45,0,0,0.45,0,0,0.55,1,0,-0.55,1,0 *3d. {$W/2},{$H/2} => viewrange3d +(64^16^0) r. $W => groundcolor +w[] 600,400,0,"[G"{`39`}"MIC] Virtual Landscape" +do +t:=$|*0.03 +xm={map,w/2+(w-$H/2)/2*cos(3.1*$t)} +ym={map,h/2+(h-$H/2)/2*sin(2.8*$t)} +u={map,(w-$H/2)*cos(2.5*$t)} +v={map,(h-$H/2)*sin(9.7*$t)} +a:=atan2($v,$u)*180/pi ++r3d[viewrange3d] 0,0,1,$a y. x +({$xm+i[8]},{$xm+i[11]};{$xm+i[17]},{$xm+i[14]}^{$ym+i[9]},{$ym+i[12]};{$ym+i[18]},{$ym+i[15]}) rm.. +r. $W,$H,1,2,3 +warp[map,colors] .,0,1,0 rm... +=> lmap,lcolors ++!=[lmap] 0 => ground ++[lmap] [gmap] +j[lcolors] [ccolors],0,0,0,0,1,[mcolors] +j[lcolors] [groundcolor] ++round[lmap] f. ">m = abs(j(0,-1)); i>m?i:-m" => y0 ++shift. 0,1 abs. +. 1 => y1 +*[y0,y1] [ground] rm[ground] +r[lcolors,y0,y1] {$W*$H},1,1,100%,-1 ++>[y0] 0 *. [offsets] discard. 0 y. +if h +-. 1 +warp[x] .,0,0,0 => lx +warp[lcolors,y0,y1] ..,0,0,0 rm.. +N:=h ({'CImg3d'},{2*$N},$N) ++a[lx] [y0],x rm[y0] +a[lx] [y1],x rm[lx,y1] a[-2,-1] y z. 0,2 +1,$N,1,1,2 +f. y ++. $N a[-3--1] x +mv[lcolors] $! permute. cyzx +1,$N,1,1,1 +y[-5--1] y a[-5--1] y *3d. -1,-1 ++j3d[background] .,{background,w-1},{background,h},0,1,1,0,0,0 rm[-3,-2] +else +rm[-5--1] [background] +fi +r. {*,w},{*,h},1,3 +fps=${-fps} if $fps>0 to. $fps" fps",5,5,24,2,0.2 fi +w. -1,-1,0 rm. +if {*,CTRLLEFT}" && "{*,D} w[] 900,600 elif {*,CTRLLEFT}" && "{*,C} w[] 600,400 fi +wait 20 +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w 0 } +#@cli x_life +#@cli : Launch the game of life. +x_life : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"The game of life"$n" --------------------------------------\n +----\n +---- The goal is to create the "${c}"biggest possible biological\n +---- system"$n". You start with a stock of cells which you can\n +---- spread over the board. For each new cells created\n +---- simultaneously and spontaneously by your system, you\n +---- gain more new cells to scatter.\n +----\n +---- "${c}"Left mouse button"$n" to scatter cells in stock.\n +---- "${c}"Right mouse button"$n" to reset game.\n +---- Key '"${c}"S"$n"' to save snapshot of the current view.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------------------------" +i[0] 90,90,1,1,0 +i[1] [0] f[1] 0 +i[2] 400,400,1,3 +i[3] 1 +iteration=0 +score=0 +bestscore=0 +stock=500 +w[0] 400,400,0,"[G"{`39`}"MIC] The Game of Life" +cursor[0] 0 +do +(1,1,1;1,0,1;1,1,1) +correlate[0] .,0 rm.. ++ir. 2,2 &. [0] ir.. 3,3 -|[-2,-1] +rv[0,-1] +if {*,x}>0" && "{*,b}==1" && "$stock>0 +nb:=u*7 +repeat $nb { +x:={*,x}/{*,w}*{0,w}+u(-4,4) +y:={*,y}/{*,h}*{0,h}+u(-3,3) +=[0] 1,$x,$y +=[1] $iteration,$x,$y +point[2] {$x*{2,w}/{0,w}},{$y*{2,h}/{0,h}},0,0.8,255 +} +stock:=round(max(0,$stock-$nb)) +fi +-. [0] *. -1 +stock-=2*(min(0,int(is/16*$score/150))) ++[1] [0] +min. 0 +. 1 *[1,-1] +if {*,b}==2 +f[0-2] 0 iteration=0 score=0 bestscore=0 stock=500 rm[3] i[3] 1 +fi +if {3,w}==1 +rm[3] i[3] {u(3,12)},1,1,3,u(100,255) +r[3] {u(100,300)}%,1,1,3,4 +point[3] 0,0,0,1,0 +r[3] {u(100,600)}%,1,1,3,5 c[3] 0,255 +fi ++r[1] {2,w},{2,h} &. 7 b. {1+$score*0.05} +n. 0,{3,w} map. [3] *. 0.1 +[2,-1] /[2] 1.1 +[2] if {*,x}>0 +opac:=0.7*min(1,$stock/500) r:=min(500,$stock)*cos($iteration)/100 +ellipse. {*,x},{*,y},{15+$r},{15+$r},0,$opac,0,196,0 +ellipse. {*,x},{*,y},{10+$r},{10+$r},0,$opac,32,64,16 +ellipse. {*,x},{*,y},{5+$r},{5+$r},0,$opac,255,230,0 +fi +t. "Living cells : "$score"\n"\ +"Stock : "$stock"\n""Score : "$bestscore,5,3,22,0.7,255 +w. {*,w},{*,h} +if {*,S} o. gmic_life.png fi +rm. +if !($iteration%10) +score={0,is} bestscore:=max($score,$bestscore) +fi +wait 60 +iteration+=1 +while {*}" && "!{*,ESC}" && "!{*,Q} +rm[0-3] w 0 +#@cli x_light +#@cli : Launch the light effect demo. +x_light : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Light effect"$n" ------------------------\n +----\n +---- Move light position with "${c}"mouse"$n".\n +---- "${c}"Mouse buttons"$n" fade light in/out.\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-------------------------------------------" +0 t. " G\47MIC\nLight effect",0,0,80,1,255 expand_xy. 15,0 b. 3 +. n.. 0,1 r.. 100%,100%,1,3 +sh.. 0 *. 120 rm. +sh.. 1 *. 70 rm. +sh.. 0,50%,0,2 *. 120 rm. +25%,25%,1,1 rand. -20,20 smooth. 10,0,1,1,4 ri. ..,3 b. 3 n. -100,100 ++[-2,-1] g. xy a[-2,-1] c n. -150,150 +w[] {1.5*{-2,w}},{1.5*{-2,h}},0,"[G"{`39`}"MIC] Light Effect" +cursor[0] 0 +light=70 +640,640 gaussian. $light n. 0,255 +t=0 +do +if {*,x}>=0 +X:=round((w-{*,x})/2) +Y:=round((h-{*,y})/2) +else +X:=round((w-{-2,w}*(1+cos(2*$t)))/2) +Y:=round((h-{-2,h}*(1+sin(2.5*$t)))/2) +t+=0.02 +fi +if {*,b}&1 light:=min(200,$light+10) gaussian. $light n. 0,255 fi +if {*,b}&2 light:=max(10,$light-10) gaussian. $light n. 0,255 fi ++z. $X,$Y,{$X+{-2,w}-1},{$Y+{-2,h}-1} +warp. ...,1,0,1 +r. 100%,100%,1,3 +. [-4] c. 0,255 +fps=${-fps} if $fps>0 to. $fps" fps",5,5,16,1,0.2 fi +w. +if {*,CTRLLEFT}" && "{*,D} w[] {3*w},{3*h} elif {*,CTRLLEFT}" && "{*,C} w[] {1.5*w},{1.5*h} fi +rm. if {*,x}>=0" && "!{*,b} wait else wait 20 fi +while {*}" && "!{*,ESC}" && "!{*,Q} +w[] 0 rm[-3--1] +#@cli x_mandelbrot : _julia={ 0 | 1 },_c0r,_c0i +#@cli : Launch Mandelbrot/Julia explorer. +x_mandelbrot : skip ${1=0},${2=0.317},${3=0.03} check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Mandelbrot/Julia explorer"$n" -----------------\n +----\n +---- Select zooming region with "${c}"mouse"$n".\n +---- "${c}"Click once"$n" to reset zoom factor.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +---- Key '"${c}"C"$n"' to print current fractal coordinates.\n +----\n +--------------------------------------------------" +rm w 512,512,0 _x_mandelbrot_coords $1 _x_mandelbrot_palette +do +siz:=min({*,w,h}) +$siz,$siz mandelbrot. {0,^},256,$1,{[$1?$2:0,$1?$3:0]} map. [1] +if $1 w. $siz,$siz,0,"[G"{`39`}"MIC] Julia Set c=("{0,@0-1}")-("{0,@2-3}"), c0=($2,$3)" +else w. $siz,$siz,0,"[G"{`39`}"MIC] Mandelbrot Set c=("{0,@0-1}")-("{0,@2-3}")" fi +w,h={w},{h} round. select. 2,0,0,0,1 +if i[0]>0 +M:=max(i[3]-i[0],i[4]-i[1]) +if $M<5 _x_mandelbrot_coords $1 rm[1] _x_mandelbrot_palette mv. 1 +else ({{0,@0}+{@0}*({0,@2}-{0,@0})/$w};\ +{{0,@1}+{@1}*({0,@3}-{0,@1})/$h};{{0,@0}+({@0}+$M)*({0,@2}-{0,@0})/$w};{{0,@1}+({@1}+$M)*({0,@3}-{0,@1})/$h}) +fi +rm[0] mv. 0 +fi +rm. +if {*,C} +if $1 e "Julia set, at c = ("{0,@0-1}")-("{0,@2-3}"), with c0 = ($2,$3)." +else e "Mandelbrot set, at c = ("{0,@0-1}")-("{0,@2-3}")." +fi +fi +if !{*}" || "{*,ESC}" || "{*,Q} break fi +wait -1 +while 1 rm w 0 +_x_mandelbrot_coords : +if $1 (-2;-2;2;2) else (-2.1;-1.5;1.2;1.5) fi +_x_mandelbrot_palette : +6,1,1,3 rand. 20,255 r. 32,1,1,3,3 r. 1024,1,1,3,0,2 =. 0,0,0,0,0 =. 0,0,0,0,1 =. 0,0,0,0,2 +#@cli x_mask_color : _colorspace={ all | rgb | lrgb | ycbcr | lab | lch | hsv | hsi | hsl | cmy | cmyk | yiq },_spatial_tolerance>=0,_color_tolerance>=0 +#@cli : Interactively select a color, and add an alpha channel containing the corresponding color mask. +#@cli : Argument 'colorspace' refers to the color metric used to compute color similarities, and can be basically +#@cli : one of { rgb | lrgb | ycbcr | lab | lch | hsv | hsi | hsl | cmy | cmyk | yiq }. +#@cli : You can also select one one particular channel of this colorspace, by setting 'colorspace' as +#@cli : 'colorspace_channel' (e.g. 'hsv_h' for the hue). +#@cli : Default values: 'colorspace=all', 'spatial_tolerance=5' and 'color_tolerance=5'. +x_mask_color : check "${2=5}>=0 && ${3=5}>=0" skip ${1=all} check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e[^-1] "Interactively create color mask for image$?, with color space $1, spatial tolerance $2 and +color tolerance $3." +e "\n +----------------------------------------------------------------------------------------------------\n +----\n +---- "${c}"Left mouse button"$n" adds a wanted color to the selection.\n +---- "${c}"Right mouse button"$n" adds an unwanted colors to the selection.\n +---- "${c}"Middle mouse button"$n" or key '"${c}"R"$n"' resets color mask.\n +---- Key '"${c}"SPACE"$n"' or '"${c}"TAB"$n"' toggles view modes (masked RGB or mask).\n +---- Keys '"${c}"CTRL+D"$n"' increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' decrease window size.\n +---- Keys '"${c}"CTRL+R"$n"' reset window size.\n +---- Keys '"${c}"ESC"$n"', '"${c}"Q"$n"' or '"${c}"ENTER"$n"' exit the interactive window.\n +----\n +----------------------------------------------------------------------------------------------------" +l[] { _ac_$1 onfail error[0--3] "Command '$0' : Invalid colorspace '$*'." } +m _ac_forward:$_f +foreach { +slices 0 basename {0,n} nm=${} +wh=${fitscreen\ {[w,h,1]},128,1024} ++r $wh,1,100%,2 ++_ac_forward. channels. $_s +if {1,s>3} channels[1] 0,2 fi to_rgb[1] +w[1] 100%,100%,0,$nm +colors_add=-1 colors_sub=-1 visumode=0 +is_clicked=0 time=0 delay=0.1 +do +time:=$is_clicked?$time:$| +wait +x:=round({*,x}*(w#2-1)/(w-1)) +y:=round({*,y}*(h#2-1)/(h-1)) +b={*,b} +c=$x,$y,{2,I($x,$y)} +is_add:=arg(1,$colors_add)>=0 +is_sub:=arg(1,$colors_sub)>=0 +is_ctrl:={*,CTRLLEFT}" || "{*,CTRLRIGHT} +is_resized=0 +refresh=0 +if $x>=0" && "$b&1 +if $is_add colors_add=$colors_add,$c else colors_add=$c fi +is_clicked=1 +refresh:=$|-$time>$delay +elif $x>=0" && "$b&2 +if $is_sub colors_sub=$colors_sub,$c else colors_sub=$c fi +is_clicked=1 +refresh:=$|-$time>$delay +elif $b&4" || "{*,R} +colors_add=-1 colors_sub=-1 refresh=1 is_clicked=1 +elif !$b +refresh:=$is_clicked==1 +is_clicked=0 +fi +if {*,-TAB}" || "{*,-SPACE} visumode:=($visumode+1)%3 refresh=1 fi +if {*,r} is_resized=1 +elif $is_ctrl" && "{*,-D} w[] {1,1.25*[w,h]} is_resized=1 +elif $is_ctrl" && "{*,-C} w[] {1,0.8*[w,h]} is_resized=1 +elif $is_ctrl" && "{*,R} w[] ${fitscreen\ {0,[w,h,1]},128,1024} is_resized=1 +fi +if $is_resized rm[1,2] +r {*,d},{*,e},1,3,2 +_ac_forward. channels. $_s refresh=1 fi +if $refresh +_x_mask_color[2] {$2*w#2/w#0},$3,{``$colors_add},{``$colors_sub} delay=${} +if !$visumode +. 64 c. 0,255 +a[1,-1] c drgba. w. -1,-1,$nm" [half-masked]" rm. +elif $visumode==1 +a[1,-1] c drgba. w. -1,-1,$nm" [masked]" rm. +else w. -1,-1,$nm" [mask]" +fi +rm. +time=$| +fi +while {*}" && "!{*,ESC}" && "!{*,Q}" && "!{*,ENTER} +if arg(1,$colors_add)>=0 ($colors_add) +r. {2+s#2},{w/(2+s#2)},1,1,-1 +z. 0,1 *. '{(w#0-1)/(w#2-1)},{(h#0-1)/(h#2-1)}' +j.. . colors_add={-2,^} rm[-2,-1] +fi +if arg(1,$colors_sub)>=0 ($colors_sub) +r. {2+s#2},{w/(2+s#2)},1,1,-1 +z. 0,1 *. '{(w#0-1)/(w#2-1)},{(h#0-1)/(h#2-1)}' +j.. . colors_sub={-2,^} rm[-2,-1] +fi +rm[-2,-1] +_ac_forward channels. $_s +_x_mask_color. $2,$3,{``$colors_add},{``$colors_sub} +rm.. a c +} +um _ac_forward +_x_mask_color : +100%,100% +is_add:=arg(1,$3)>=0 +is_sub:=arg(1,$4)>=0 +t0=$| +if $is_add" || "$is_sub +if $is_add +($3) r. {2+s#0},{w/(2+s#0)},1,1,-1 +N_add:=h M_add:="M = vectorw(); fill(M,k,med(crop(k,1)));M" rm. +fi +if $is_sub +($4) r. {2+s#0},{w/(2+s#0)},1,1,-1 +N_sub:=h M_sub:="M = vectorw(); fill(M,k,med(crop(k,1)));M" rm. +fi +f. "begin( +const is_add = "$is_add"; +const is_sub = "$is_sub"; +const ss = sqrt(2)*$1; +const sc = sqrt(2)*$2; +colors_add = [ $3 ]; +colors_sub = [ $4 ]; +M_add = [ 0"$M_add"]; +M_sub = [ 0"$M_sub"]; +const N_add = 0"$N_add"; +const N_sub = 0"$N_sub"; +const siz = 2 + s#0; +const siz2 = sqr(siz); +sigma = vectorsiz(sc); +sigma[0] = sigma[1] = ss; +tensor(op) = ( +T = vectorsiz2(); +if (is_#op, +for (k = 0, k,fy$>,fz$>:=2*[g,g,g] } +w[0] -1,-1,0,"[G"{`39`}"MIC] 3D Metaballs" +do +repeat $M { +x$>:=w/2+0.5*(w-{2,w}-4)*cos(${fx$>}*$|) +y$>:=h/2+0.5*(h-{2,h}-4)*sin(${fy$>}*$|) +z$>:=d/2+0.5*(d-{2,d}-4)*sin(${fz$>}*$|) +} +f[3] 0 repeat $M { j[3] [2],{${x$>}-{2,w/2}},{${y$>}-{2,h/2}},{${z$>}-{2,d/2}},0,-1 } ++r[3] 28,28,28,1,2 isosurface3d. 0.4 -3d. 12,12,12 *3d. 13 rv3d. +r3d. 1,2,1,{100*$|} +N:=i[7] (255,255,150;200,96,164;50,150,230) r. 3,$N,1,1,3 y. j.. .,0,{{-2,h}-4*$N} +if !$mode circles3d.. 4 fi +if !{1,w} +0 t. ${s$mode},5,5,23,0.5,255,255,255 r. {w+5},100%,1,3,0 b. 0.7 n. 0,255 ++dilate. 3 +j[0] ..,5,3,0,0,1,.,255 mv. 1 rm[2,-2,-1] +fi ++j3d[1] ..,50%,50%,0,1,{!$mode?3:$mode},0,0,300,0,0,-500,0.1,1.5 +fps=${-fps} if $fps>0 to. $fps" fps",5,{h-22},16,2,0.2 fi +w. +if {*,CTRLLEFT}" && "{*,D} w[] {2*w},{2*h} elif {*,CTRLLEFT}" && "{*,C} w[] {w},{h} fi +rm[-3--1] wait 20 +if {*,b}" || "{*,SPACE} mode:=($mode+({*,b}&2?-1:1))%6 wait -1 rm[1] i[1] 0 fi +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w 0 } +#@cli x_minesweeper : 8<=_width=<20,8<=_height<=20 +#@cli : Launch the Minesweeper game. +x_minesweeper : check "${1=20}>=8 && $1<=30 && ${2=$1}>=8 && $2<=30" check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Minesweeper"$n" -------------------------------------------\n +----\n +---- The goal is to "${c}"clear the minefield"$n" without detonating a\n +---- mine.\n +----\n +---- "${c}"Left mouse button"$n" to try clearing one square.\n +---- "${c}"Right mouse button"$n" to flag or unflag a square.\n +---- "${c}"Middle mouse button"$n" to reset mine field.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------------------------\n" +$1,$2 noise. 30,2 ==. 1 nb_mines:=is (1,1,1;1,0,1;1,1,1) +convolve.. .,0 rm.. +. 1 ==.. 0 *[-2,-1] => field +do x:=round(u(w-1)) y:=round(u(h-1)) while i($x,$y)!=1 ++f[field] 11 =. 12,$x,$y => board +24,24,1,3,200 fc. 255,180,130 +ellipse. 12,12,4,4 line. 6,12,18,12 line. 12,6,12,18 line. 13,10,14,10,1,255 line. 13,11,14,11,1,255 +z. 1,1,{w-2},{h-2} frame. 1,1,0 ++fc. 230,250,255 ++t. "1",10,5,13,1,0,196,0 +t.. "2",9,5,13,1,0,128,0 +t... "3",9,5,13,1,0,0,255 ++t[-4] "4",9,5,13,1,255,0,0 +t[-5] "5",9,5,13,1,200,0,0 +t[-6] "6",9,5,13,1,150,0,0 ++t[-7] "7",9,5,13,1,128,0,0 +t[-8] "8",9,5,13,1,64,0,0 ++f. "x<=1 || y<=1 || x>=w-2 || y>=h-2?(x sprites +(0,23;0,23^0,0;23,23) r. 24,24,1,2,3 r. {board,w*24},{board,h*24},1,2,0,2 => offsets +.,.,1,3,255 frame. 1,1,0 frame. 23,23,255 +0 t. "Number of mines : "$nb_mines,0,0,18,1,100,200,255 negate. j.. .,{({-2,w}-w)/2},{{-2,h}-h-2} rm. +=> canvas +failed=0 succeeded=0 nb_flags=0 started=0 +do ++*[board] 24 r. [offsets],[offsets] channels. 0,1 +. [offsets] +warp[sprites] .,0,0,1 rm.. +j[canvas] .,24,24 rm. +wait -1 +if $failed +0 t. "Game\nOver!",3,3,38,1,255 r. 100%,100%,1,4 sh. 3 dilate. 5 /. 2 rm. +drop_shadow. 5,5,1 blend[canvas,-1] alpha +0 t. "Boom! You failed!",0,0,18,1,100,255,255 r. {canvas,w},100%,1,3,0,0,0.5,0.5 negate. j[canvas] .,0,3 rm. +do w[canvas] {w},{h} wait while {*}" && "!{*,ESC}" && "!{*,Q} +elif $succeeded +0 t. "Success!",3,3,38,1,255 r. 100%,100%,1,4 sh. 3 dilate. 5 /. 2 rm. +drop_shadow. 5,5,1 blend[canvas,-1] alpha +0 t. "Congratulations! ("{round($|-$tic)}" s)",0,0,18,1,255,100,255 r. {canvas,w},100%,1,3,0,0,0.5,0.5 +negate. j[canvas] .,0,3 rm. +do w[canvas] {w},{h} wait while {*}" && "!{*,ESC}" && "!{*,Q} +else ++==[board] 10 nb_flags:=is rm. +do +if !$started tic=$| fi +0 t. "Elapsed time : "{round($|-$tic)}" s / Flags : "$nb_flags,0,0,18,1,255,200,0 +r. {canvas,w},100%,1,3,0,0,0.5,0.5 +negate. j[canvas] .,0,3 rm. +wait 50 +x,y:=int(([{*,x,y}]-24)/24) b={*,b} +w[canvas] {w},{h},0,"[G"{`39`}"MIC] Minesweeper" +while {*}" && "!{*,ESC}" && "!{*,Q}" && "!$b +fi +if $x>=0\ &&\ $y>=0\ &&\ $x<{board,w}\ &&\ $y<{board,h} +if $b&1 +started=1 val={field,i($x,$y)} +if !$val +==[field] 0 j[board] [field],0,0,0,0,1,. rm. failed=1 +elif $val==1 ++flood[field] $x,$y,0,0,1,1,-1 ==. -1 dilate. 3 j[board] [field],0,0,0,0,1,. rm. +else =[board] $val,$x,$y +fi +elif n={board,i($x,$y)};$b&2" && "n>=10" && "n<=11 +=[board] {board,i($x,$y)==11?10:11},$x,$y +elif $b&4 f[board] 10 +fi +fi +if $nb_mines==$nb_flags\ &&\ {board,iM}!=11 succeeded=1 fi +while {*}" && "!{*,ESC}" && "!{*,Q} +w 0 +#@cli x_minimal_path +#@cli : Launch the minimal path demo. +x_minimal_path : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Minimal path"$n" ------------------------------------------\n +----\n +---- "${c}"Click on two points"$n" to compute and display the minimal\n +---- path between those points. The ending point is then\n +---- chosen as the next starting point for another path.\n +---- Key '"${c}"S"$n"' to save snapshot of the current view.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------------------------" +if !$! sp ? fi +n 0,200 round 1 +foreach { +w[0] -1,-1,0,"[G"{`39`}"MIC] Select Starting Point P0" +if !narg($first_time) +parallel 0,"+l[0] { r2dy 128 frame 1,1,0 alert \"[G"{`39`}"MIC Minimal Path]\",\"The G\47MIC minimal path demo illustrates how minimal paths\ncan be computed in images to detect and track edge points.\nUse your mouse to select desired starting and ending points,\nand see what is the minimal path computed between these points.\",\"OK\" rm }" +first_time=0 +fi ++gradient_norm b. 1 f. exp(-i/10) +to_rgb[0] +select[0] 0 P0={^} +ellipse[0] {@0,1},3,3,0,1,255,0,255 +ellipse[0] {@0,1},3,3,0,1,0xFFFFFFFF,255,255,255 +rm. +if min($P0)>=0 +p=1 +do +w[0] -1,-1,0,"[G"{`39`}"MIC] Select Ending Point P"$p ++select[0] 0 +if {*,S} +rm. ++to[0] "Saving snapshot...",5,5,13,1,1,255,255,255 w. rm. +o[0] gmic_minimal_path.png +wait -1 +else +P1={^} +ellipse[0] {@0,1},3,3,0,1,255,0,255 +ellipse[0] {@0,1},3,3,0,1,0xFFFFFFFF,255,255,255 +rm. +if min($P1)>=0 ++to[0] "Processing...",5,5,13,1,1,255,255,255 w. rm. ++minimal_path[1] $P0,$P1,1 transpose. +pointcloud. 0 *. 255 r. 100%,100%,1,[0],0,0,0,0,0,0.5 ri. [0],0 -|[0,-1] +P0=$P1 p+=1 +fi +fi +while {*}" && "!{*,ESC}" && "!{*,Q} +fi +rm[1] w 0 +} +#@cli x_morph : _nb_frames>=2,_preview_fidelity={ 0:coarsest | 1:coarse | 2:normal | 3:fine | 4:finest } +#@cli : Launch the interactive image morpher. +#@cli : Default values: 'nb_frames=16' and 'preview_fidelity=3'. +x_morph : check "isint(${1=16}) && isint(${2=3}) && $2>=0 && $2<=4" check_display $0 +if $!<2 error[0--3] "Command '$0': Requires at least two input images!" return fi +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r b=$_vt100_b +e "\n +------ "${g}"Interactive image morpher"$n" ---------------------------\n +----\n +---- "${b}"Source/target window:"$n"\n +---- "${c}"Left mouse button"$n": Add new keypoint on current image\n +---- and move it on the other one.\n +---- "${c}"Right mouse button"$n": Add/move keypoint on current image.\n +---- Key '"${c}"DELETE"$n"' or "${c}"middle mouse button"$n": Delete keypoint.\n +---- Key '"${c}"SPACE"$n"' or "${c}"mouse wheel"$n": Toggle source/target.\n\n +---- "${b}"In-between window:"$n"\n +---- "${c}"Mouse wheel"$n": Change morphing time, from 0 to 1.\n +---- "${c}"Left mouse button"$n": Reset morphing time to 0.5.\n\n +---- "${b}"Both windows:"$n"\n +---- Key '"${c}"TAB"$n"': Change keypoint radius.\n +---- Key '"${c}"ENTER"$n"': Play/stop in-between animation.\n +---- Key '"${c}"R"$n"': Reset keypoints.\n +---- Key '"${c}"K"$n"': Show/hide keypoints.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"': Process fullres and exit.\n +----\n +-----------------------------------------------------------" +offset=0 +radius_keypoints=3 +repeat $!-1 { l[{[$>,$>+1]+$offset}] { +nm0={0,n} nm1={1,n} +to_colormode 0 +rr2d ${-max_wh},2 +=> img0,img1 +256,1,1,1,"x>=4?x-2:1" map. 2 => colormap +selected_keypoint=-1 +view_keypoints=1 +time_inbetween=0.5 +animate_inbetween=0 +move_other=0 +frame=0 +do +if !narg($keypoints) +if narg($__x_morph_keypoints) ($__x_morph_keypoints) r. 1,{w/5},1,5,-1 +else 1,4,1,5,"p = y%2; q = int(y/2); [ [ p,q,p,q ]*100,y ]" +fi +N0:=h => keypoints +rmn warp0,warp1 +fi +if !narg($imgb0)" || "!narg($imgb1) +if {*} wdims=${"fitscreen "{*,d},{img0,{*,d}*h/w}} +else wdims=${"fitscreen "{img0,[w,h,1]},128,50%} +fi +w[] $wdims,0,"[G'MIC] Interactive Morph" +repeat 2 { +to_color[img$>] r. $wdims,1,100%,2 n. 0,255 => imgb$> } +rmn imgr,warp0,warp1 +fi +if (!narg($warp0)" || "!narg($warp1)) +subsamp:=arg(1+$2,8,6,4,2,1) ++_x_warp_rbf[keypoints] {imgb0,round([w,h]/$subsamp)} ++l[keypoints] { s c,-2 rv[0,1] a c } +_x_warp_rbf. {imgb0,round([w,h]/$subsamp)} rm.. +*[-2,-1] $subsamp +r[-2,-1] {imgb0,[w,h]},1,100%,3 +=> warp0,warp1 +rmn imgm +fi +if !narg($imgr) +[imgb$frame] => imgr +if s==4 drgba. fi +if $view_keypoints +eval[keypoints] "* +begin( +fact = ([ w#"$imgb0",h#"$imgb0" ] - 1)/100; +const radius1 = "$radius_keypoints"; +const radius2 = radius1 + 2; +const opacity = min(1,3/"($radius_keypoints-1)"); +); +X = round((I)[2*"$frame",2]*fact); +y=="$selected_keypoint"?(ellipse(#-1,X,radius2+2,radius2+2,0,1,255)); +ellipse(#-1,X,radius2,radius2,0,opacity,0); +ellipse(#-1,X,radius1,radius1,0,opacity,I[#"$colormap",i4]); I" +fi +w. -1,-1,0,"[G'MIC] Interactive Morph ("${"s0=Source s1=Target u ${s"$frame"}"}")" +fi +if !narg($imgm) +t,onemt:=t=$animate_inbetween?0.5*(1+sin(2*($time_inbetween+$|-$animate_inbetween))):$time_inbetween;[t,1-t] ++*[warp1] $t *. -1 +warp[imgb0] .,1,2,3 rm.. *. $onemt ++*[warp0] $onemt *. -1 +warp[imgb1] .,1,2,3 rm.. *. $t ++[-2,-1] c. 0,255 => imgm +w1. -1,-1,0,"[G'MIC] Interactive Morph (In-between)" +fi +if $animate_inbetween wait 40 else wait fi +mb={*,b} mxy:=[{*,x,y}]*100/([{*,w,h}]-1) mouse_over:={*,x}>=0 +if $mouse_over" && "($mb" || "{*,DELETE})" && "$selected_keypoint<0" && "h#$keypoints>0 +selected_keypoint={keypoints,"dmin = inf; kmin = -1; fact = ([w#"$imgr",h#"$imgr"]-1)%; +repeat (h,k, +dist = norm(((I[k])[2*"$frame",2] - ["$mxy"])*fact); +dist=0 && dmin<"max(8,1.5*$radius_keypoints)"?kmin:-1"} +fi +if {*,-o}" || "{*,-SPACE}" || "{*1,-SPACE} frame:=!$frame rmn imgr fi +if {*,-K}" || "{*1,-K} view_keypoints:=!$view_keypoints rmn imgr fi +if {*,-R}" || "{*1,-R} rmn keypoints,imgr __x_morph_keypoints= fi +if {*,-TAB}" || "{*1,-TAB} +radius_keypoints:=max(2,($radius_keypoints+2)%8) view_keypoints=1 rmn imgr +fi +if {*,-ENTER}" || "{*1,-ENTER} animate_inbetween:=$animate_inbetween?0:$| fi +if {*,r} rmn imgb0,imgb1 fi +if {*1,r} rmn imgm fi +if {*1,o} +time_inbetween:=max(0,min(1,$time_inbetween+0.05*{*1,-o})) animate_inbetween=0 rmn imgm +fi +if {*1,-b} time_inbetween=0.5 animate_inbetween=0 rmn imgm fi +if $mouse_over" && "($mb==1" || "$mb==2)" && "$selected_keypoint<0 +if $mb==1" && "!$move_other frame:=!$frame move_other=1 fi +({keypoints,[$mxy,$mxy,h]}) +permute. zycx a[keypoints,-1] y +selected_keypoint={keypoints,h-1} +rmn imgr +elif $mouse_over" && "($mb==1" || "$mb==2)" && "$selected_keypoint>=0 +if $mb==1" && "!$move_other frame:=!$frame move_other=1 fi +({[$mxy]}) permute. zycx j[keypoints] .,0,$selected_keypoint,0,{2*$frame} rm. +rmn imgr +elif $mouse_over" && "$selected_keypoint>=0" && ("{*,-DELETE}" || "$mb==4") && "h#$keypoints>4 # Delete keypoint +1,1,1,5,-1 j[keypoints] .,0,$selected_keypoint rm. discard[keypoints] -1 r[keypoints] 1,{keypoints,h/5},1,5,-1 +N0-=$selected_keypoint<$N0 selected_keypoint=-1 +rmn warp0,warp1,imgr +elif !{*,b}" && "$selected_keypoint>=0 +if $move_other frame:=!$frame move_other=0 fi +selected_keypoint=-1 +rmn warp0,warp1,imgr +fi +if $animate_inbetween rmn imgm fi +while {*}" && "!{*,ESC}" && "!{*,Q}" && "{*1}" && "!{*1,ESC}" && "!{*1,Q} +if !$< __x_morph_keypoints={keypoints,^} fi +rmn colormap,imgb0,imgb1,warp0,warp1,imgr,imgm ++_x_warp_rbf[keypoints] {img0,[w,h]} ++l[keypoints] { s c,-2 rv[0,1] a c } +_x_warp_rbf. {img0,[w,h]} rm.. +=> warp0,warp1 +repeat $1 { +t,onemt:=t=$>/max(1,$1-1);[t,1-t] ++*[warp1] $t *. -1 +warp[img0] .,1,2,3 rm.. *. $onemt ++*[warp0] $onemt *. -1 +warp[img1] .,1,2,3 rm.. *. $t ++[-2,-1] c. 0,255 => ${nm0}_$> +if {*}" && "{*1} w1 0 fi +if {*}" || "{*1} +text="Processing frame \#"$>"/"{$1-1}"..." +if {*} +r. {*,d,e},1,100%,2 to. $text,5,5,20,2 w. rm. fi +if {*1} +r. {*1,d,e},1,100%,2 to. $text,5,5,20,2 w1. rm. fi +fi +} +=> $nm1 k[-$1--1] +offset+=$!-2 +} } w0 0 w1 0 +#@cli x_pacman +#@cli : Launch pacman game. +x_pacman : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Pacman"$n" -----------------------------------------------\n +----\n +---- This is a G\47MIC implementation of the "${g}"pacman"$n" game.\n +----\n +---- Move the pacman to eat all pacdots on the different levels.\n +---- Eating a pacgum makes pacman invincible for "${c}"10 seconds"$n",\n +---- which mean pacman can eat ghosts during this time.\n +---- Eating a ghost earns "${c}"100 pts"$n".\n +---- Eating a cherry earns "${c}"10 pts"$n".\n +---- Eating a strawberry earns "${c}"100 pts"$n".\n +---- Eating an orange earns "${c}"1000 pts"$n".\n +---- Eating a banana earns "${c}"5000 pts"$n".\n +----\n +---- "${c}"Arrow keys"$n" to control pacman.\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------------------------" +l[] { +m "_pacman_ghost_base_gfx : 31,19 circle. 15,15,15,1,1 31,12,1,1,'y<4+8*abs(cos(x*0.3+0.25*pi*$""1))' a[-2,-1] y" +repeat 4 { +_pacman_ghost_standard_gfx 255,0,0,$> => ghost0_$> +_pacman_ghost_standard_gfx 0,255,222,$> => ghost1_$> +_pacman_ghost_standard_gfx 255,184,222,$> => ghost2_$> +_pacman_ghost_standard_gfx 255,184,71,$> => ghost3_$> +_pacman_ghost_afraid_gfx $> => ghosta_$> +_pacman_ghost_base_gfx $> r. 16,16,1,1,2 => ghostm_$> +_pacman_ghost_standard_gfx 0,0,0,$> => ghostd_$> +_pacman_pacman_gfx $> => pacman_$>,pacmanm_$> +} ++channels[ghostd_0] 0 !=. 0 => ghostdm +_pacman_cherry_gfx _pacman_strawberry_gfx _pacman_orange_gfx _pacman_banana_gfx => fruit0,fruit1,fruit2,fruit3 +20,2,1,3,200 => gate +score0,score1,score2,score3,score4=10,100,1000,5000,"Argh!" +repeat 5 { +0 t. ${score$>},0,0,13,1,255,255,255 autocrop. 0 expand_xy. 1,0 +dilate. 3 => score$>,scorem$> +} +time4=255,255,255 time3=255,255,32 time2=255,128,32 time1=255,32,32 +repeat 11 { 0 t. $<" s",0,0,23,1,${time{min(4,round(($<+1)/2))}} => time$< } +0 t. "Get Ready!",0,0,32,1,255 autocrop. 0 expand_xy. 4,0 +dilate. 8 r.. 100%,100%,1,3 => get_ready,get_readym +0 t. "Game\nOver!",0,0,53,1,255 autocrop. 0 expand_xy. 4,0 +dilate. 8 r.. 100%,100%,1,3 => game_over,game_overm +score=0 level=-1 lives=3 is_quit=0 +do +if $level<0 +_rlevel=33 _glevel=33 _blevel=255 +_pacman_map_level{((-$level-1)%6)+1} mw,mh,mw2,mh2:=w,h,int(w/2),int(h/2) +if $level<-6 replace. 3,2 fi +. => map0,map ++shift[map] -1,0 +shift[map] 0,-1 +shift[map] 1,0 +shift[map] 0,1 a[-4--1] z !=. 1 => can_go ++==[map] 1 100%,100% =. 1,$mw2,$mh2 distance. 1,..,3 channels. 100% +f. "i==2?0:i==8?1:i==1?2:i==4?3:i" => path ++==[map] 2 pacdots:=is rm. +level:=-$level +fi +f[map] "i>=4?0:i" +==[map] 1 expand_xy. 1,0 r. 1600%,1600% erode. 9 b. 2 +g. xy abs[-2,-1] +[-2,-1] >=. 80% b. 2 n. 0,1 shrink_xy. 16 ++*. $_glevel +*.. $_blevel *... $_rlevel a[-3--1] c +16,16,1,1,'x' +-[map] 1 max. 0 *. 16 r. 1600%,1600% +16,16,1,1,'y' ri[-3,-1] ..,0,2 +[-2,-1] a[-2,-1] c +16,16,1,3 _pacman_pacdots_gfx _pacman_pacgum_gfx a[-3--1] y +warp. ..,0,0,1 rm.. -|[-2,-1] r. 100%,{h+24},1,3,0,0,0,1 +t. "Lives :",10,0,24,1,255 t. "Score :",{w-140},0,24,1,255 +if $lives +r[pacman_2] 12,12,1,4,2 r. {100*$lives}%,100%,1,4,0,2 j.. .,90,7 rm. fi => visu +w[visu] {visu,f=h<0.5*{*,v}?1.5:1;[w,h]*=f},0,"[G"{`39`}"MIC] Pacman" cursor[0] 0 +0 t. "Level "$level,0,0,64,1,1 autocrop. 0 expand_xy. 4,0 (0,255^0,255^0,0) +map.. . rm.. dilate.. 8 +=> levelm_N,level_N +repeat 4 { xg$>:=16*$mw2 yg$>:=16*$mh2+4*$> dg$>=3 mg$>=0 } +xp:=16*10 yp:=16*21 dp=-1 pacgum_timer=-1 fruit_timer=$| dying_pacman=0 is_get_ready=1 +xscore=0 yscore=0 nscore=0 oscore=0 +do +t:=int(6*$|)%4 left:=$pacgum_timer>=0?10-$|+$pacgum_timer:-1 +[visu] +repeat 4 { +mg=${mg$>} xg=${xg$>} yg:=${yg$>}+24 +if !$mg j. [ghost$>_$t],$xg,$yg,0,0,1,[ghostm_$t] +elif $mg==1 t2:=$left>7?$t:$left>3?int(12*$|)%4:int(24*$|)%4 j. [ghosta_$t2],$xg,$yg,0,0,1,[ghostm_$t] +elif $mg==2 j. [ghostd_$t],$xg,$yg,0,0,0.8,[ghostdm] +else j. [ghost$>_$t],$xg,$yg,0,0,{$mg-2},[ghostm_$t] j. [ghostd_$t],$xg,$yg,0,0,1,[ghostdm] +fi +} +if $dying_pacman +_pacman_pacman_gfx {$dying_pacman/2} rotate[-2,-1] {90*(abs($dp)-1)} j... ..,$xp,{24+$yp},0,0,1,.,255 rm[-2,-1] +dying_pacman+=1 +if $dying_pacman>64 +if $lives!=1 rm. break fi +j. [game_over],{(w-{game_over,w})/2},{12+(h-{game_over,h})/2},0,0,{min(1,($dying_pacman-64)/50)},[game_overm],255 +rectangle. 90,7,101,18,1,0 +fi +else ++rotate[pacman_$t,pacmanm_$t] {90*(abs($dp)-1)} j... ..,$xp,{24+$yp},0,0,1,.,255 rm[-2,-1] +if $left>=0" && "($left>=5" || "$t<=2) j. [time{round($left)}],{(w-{time0,w})/2-10},1 fi +fi +t. $score,{w-60},3,20,1,255 +if $is_get_ready +j. [level_N],{(w-{level_N,w})/2},{12+(h-1.5*{level_N,h})/2},0,0,1,[levelm_N] +if int($|*4)%2 j. [get_ready],{(w-{get_ready,w})/2},{24+(h+{get_ready,h})/2},0,0,1,[get_readym],255 fi +fi +if $oscore>0 j. [score$nscore],$xscore,$yscore,0,0,$oscore,[scorem$nscore],255 oscore-=0.04 yscore-=1 fi +j. [gate],158,223,0,0,0.6 +w. +if {*,CTRLLEFT}" && "{*,D} w[] {2*w},{2*h} +elif {*,CTRLLEFT}" && "{*,C} w[] {f=h<0.5*{*,v}?1.5:1;[w,h]*=f} +fi +rm. +repeat 4 { +xg=${xg$>} yg=${yg$>} dg=${dg$>} mg=${mg$>} +if max(abs($xg-$xp),abs($yg-$yp))<=8 +if !$mg" && "!$dying_pacman dying_pacman=1 +xscore=$xp yscore:=$yp+12 oscore=1 nscore=4 +elif $mg==1 mg=2 mg$>=$mg score+=100 +xscore=$xp yscore:=$yp+12 oscore=1 nscore=1 +fi +fi +if $mg>=2" && "($xg>>4)==$mw2" && "($yg>>4)==$mh2 +mg+=0.01 +if $mg>=3 mg=0 xg&=-2 yg&=-2 fi +mg$>=$mg +fi +if !($xg&15)" && "!($yg&15) +({u},{u},{u},{u};0,1,2,3) +if $mg<2 +=. {u(0.6,1)},{!$mg?(dX0=$xp-$xg;dY0=$yp-$yg;abs(dX0)>abs(dY0)?(dX0>0?0:2):(dY0>0?1:3)):(dX1=$xp-$xg;dY1=$yp-$yg;abs(dX1)0?2:0):(dY1>0?3:1))} +=. 0,{($dg+2)%4} +if $is_get_ready =. 0.8,{path,i({$xg>>4},{$yg>>4})} fi +else =. 1,{path,i({$xg>>4},{$yg>>4})} +fi +sort. -,x +repeat 4 { d:=i($>,1) +if {can_go,i({$xg>>4},{$yg>>4},$d)} dg=$d break fi +} rm. +dg$>=$d +fi +u:=D=${dg$>};(D==0)-(D==2) +v:=D=${dg$>};(D==1)-(D==3) +xg$>:=($xg+$u*(1+!$mg))%(16*$mw) +yg$>:=($yg+$v*(1+!$mg))%(16*$mh) +} +wait 22 +if !$dying_pacman +d:={*,ARROWRIGHT}?1:{*,ARROWDOWN}?2:{*,ARROWLEFT}?3:{*,ARROWUP}?4:$dp +if !($xp&15)" && "!($yp&15) +i={map,i({$xp>>4},{$yp>>4})} +if $i==2 score+=10 pacdots-=1 +elif $i==3 pacgum_timer=$| repeat 4 { if !${mg$>} mg$>=1 dg$>:=(${dg$>}+2)%4 fi } +elif $i>=4 score+=${score{$i-4}} xscore=$xp yscore:=$yp+12 oscore=1 nscore:=$i-4 +fi +=[map] 0,{$xp>>4},{$yp>>4} +16,16,1,3 j[visu] .,$xp,{24+$yp} rm. +d={can_go,i($xp>>4,$yp>>4,abs($d)-1)?$d:$dp} +d={can_go,i($xp>>4,$yp>>4,abs($d)-1)?$d:-abs($dp)} +dp=$d +else dp:=abs($d-$dp)==2?$d:$dp +fi +is_get_ready:=$dp>0?0:$is_get_ready +u:=($dp==1)-($dp==3) +v:=($dp==2)-($dp==4) +xp:=($xp+2*$u)%(16*$mw) +yp:=($yp+2*$v)%(16*$mh) +if $pacgum_timer>=0" && "$|>$pacgum_timer+10 +repeat 4 { xg$>&=-2 yg$>&=-2 mg$>:=${mg$>}==1?0:${mg$>} } +pacgum_timer=-1 +fi +if !$is_get_ready" && "($|-$fruit_timer)>=10 +x:=round(u(0,{map0,w})) +y:=round(u(0,{map0,h})) +if !{map,i($x,$y)}" && "{map0,i($x,$y)}==2 +n:=min(3,int(abs(g*1.7))) =[map] {4+$n},$x,$y j[visu] [fruit$n],{16*$x},{16*$y+24} fruit_timer=$| +fi +fi +fi +if !{*}" || "{*,Q}" || "{*,ESC} is_quit=1 fi +while !$is_quit" && "$pacdots +if $is_quit break +elif $pacdots +lives-=1 +else +level:=-$level-1 wait[0] -1 +rm[map0,map,can_go,path] +fi +rm[visu,level_N,levelm_N] +while $lives +rm w 0 } +_pacman_ghost_standard_gfx : +_pacman_ghost_base_gfx $4 (0,$1^0,$2^0,$3) map.. . rm. +ellipse. 10,11,3,4,0,1,255 ellipse. 20,11,3,4,0,1,255 +r. 16,16,1,3,2 point. 5,{7-($4>=2)},0,1,1 point. 10,{7-($4>=2)},0,1,1 +_pacman_ghost_afraid_gfx : +_pacman_ghost_base_gfx $1 +if $1<2 col=255,255,255 (0,0^0,0^0,208) else col=255,0,0 (0,248^0,248^0,248) fi +map.. . rm. r. 16,16,1,3,2 +line. 4,4,6,6,1,$col,255 line. 4,6,6,4,1,$col,255 +line. 9,4,11,6,1,$col,255 line. 9,6,11,4,1,$col,255 +f. "y>=9 && y<=10 && x>=2 && x<=13 && ((int((x+1)/2)+y)%2)?arg(c+1,$col):i" +_pacman_pacman_gfx : +32,32,1,1,'X=x-15;Y=y-15;A=atan2(Y,X);R=sqrt(X^2+Y^2);R<15.5&&abs(A)>0.8*0.33*$1' +(0,255^0,255^0,0^0,255) map.. . rm. r. 16,16,1,4,2 s. c,-3 +_pacman_pacdots_gfx : +(255^184^151) r. 4,4,1,3 r. 16,16,1,3,0,0,0.5,0.5 +_pacman_pacgum_gfx : +64,64,1,3 circle. 31,31,31,1,255,128,64 r2dx. 16 +_pacman_cherry_gfx : +base642img[] "MSBpbnQ4IGxpdHRsZV9lbmRpYW4KNzYgMSAxIDEgIzU5CnicFYpBCgAxDALVXvv/p5ZtmsgmIMoM7k0Cx/ySYYIXrE5qOgTmE1KGlo""UW1pp1qVUqmkt3Hj9Whx3S" +decompress_rle. (0,0,255,255^0,173,0,255^0,0,0,255) map.. . rm. r2dy. 14 r. 16,16,1,3,0,0,0.5,0.5 +_pacman_strawberry_gfx : +base642img[] "MSBpbnQ4IGxpdHRsZV9lbmRpYW4KNzIgMSAxIDEgIzYwCnicJYlJDoAwEMOyHOH/H+UANJ0RBaRIlp1tJ4HAd9HFaoUtTNWC1yIPWT""5ew5em+lT994guKHgAoIoa8w==" +decompress_rle. (0,0,255,255^0,173,0,255^0,0,0,255) map.. . rm. r2dy. 14 r. 16,16,1,3,0,0,0.5,0.5 +_pacman_orange_gfx : +base642img[] "MSBpbnQ4IGxpdHRsZV9lbmRpYW4KNDQgMSAxIDEgIzQ2CnicBcHBDQAgDAOxXPjC/gsxU4VKi7DnAukKPU6SYjTVptxhbSv8wpVufU""wDEZ4=" +decompress_rle. (0,0,255,255^0,173,173,255^0,0,0,255) map.. . rm. r2dy. 14 r. 16,16,1,3,0,0,0.5,0.5 +_pacman_banana_gfx : +base642img[] "MSBpbnQ4IGxpdHRsZV9lbmRpYW4KNzAgMSAxIDEgIzQ4CnicNcqxDQAgDMTANx0S++8aIC9ShObceC6QQoSJ5Ai5vWW2WTI6xr+bvL""U/BnUW3g==" +decompress_rle. (0,255,255^0,173,255^0,0,255) map.. . rm. r2dy. 14 r. 16,16,1,3,0,0,0.5,0.5 +_pacman_map_level1 : +base642img[] "MSBpbnQ4IGxpdHRsZV9lbmRpYW4KMjAxIDEgMSAxICM5Nwp4nGWOUQ6AMAhDKX56Be9/QnWJArEM9MdsGa9QYOsGiOy4FaZYHAo1aM""ezIJ+QJnszLsq2aRaf9Q9GiaBnGmEZhSe8wLOdVqO+My+cFdJj9OpVQ0vzRm8l/L954AHE9jns" +decompress_rle. +mirror. x z. 1,100% a[-2,-1] x +_rlevel=33 _glevel=33 _blevel=255 +_pacman_map_level2 : +base642img[] "MSBpbnQ4IGxpdHRsZV9lbmRpYW4KMjA4IDEgMSAxICMxMDAKeJxljkEOAzEIAxn32C/0/y+MdlUloAKJemgvjAOG+PkCs8ElHsjRQk""0iycwS+/2jcuJlnhhhf3SxPKWw9DaJmYsbmLOqmyaXn92UsVV9Y+sweOvb7YB1vQPPDnV4a/ABHS45BA==" +decompress_rle. +mirror. x z. 1,100% a[-2,-1] x +_rlevel=200 _glevel=33 _blevel=33 +_pacman_map_level3 : +base642img[] "MSBpbnQ4IGxpdHRsZV9lbmRpYW4KMjA5IDEgMSAxICMxMDEKeJxVTlsOwDAIAve5K+z+N+zStGomeyTdjwIKYT9IoHGAbpOgdQ3n1i""1ZinHdnO+20FuKg3nf4WIO3YolP8QEQ75CEkoKaUIDT3K95w8OZbp4lDcMj1PNUjXyDg+u4LTGC5LiOwA=" +decompress_rle. +mirror. x z. 1,100% a[-2,-1] x +_rlevel=33 _glevel=200 _blevel=255 +_pacman_map_level4 : +base642img[] "MSBpbnQ4IGxpdHRsZV9lbmRpYW4KMjEwIDEgMSAxICM5MAp4nHVPQQ6AMAhr8egX/P8TN+cGGSy6TBMTQgqlUPaDBDINLBJZbMQHqm""wq7e40eahgy8i/jDKB1QhlRWBzcPH09Rnr9ALTrHSOuN5N+IFF9LIY9uOPDitcQvE=" +decompress_rle. +mirror. x z. 1,100% a[-2,-1] x +_rlevel=200 _glevel=200 _blevel=33 +_pacman_map_level5 : +base642img[] "MSBpbnQ4IGxpdHRsZV9lbmRpYW4KMjA3IDEgMSAxICMxMDAKeJxdjlEKxCAMRPOmn3uF3v+ELXRrDE2qwrIgzPB8Mn52MDv4ihBbQy""jQyuRBz96RF8NmSYAb98s65j95Wd0bFqxG1MNV/s1ealMujRHdI5wtf9X0WnWmFWO/7JmJXScPVxI1Cg==" +decompress_rle. +mirror. x z. 1,100% a[-2,-1] x +_rlevel=200 _glevel=255 _blevel=33 +_pacman_map_level6 : +base642img[] "MSBpbnQ4IGxpdHRsZV9lbmRpYW4KMTgzIDEgMSAxICM5Mgp4nGVO0QqAQAhz67Ff6P+/sK66TNqJUBCozDHn5gUwW9EIBnhi2nmBPQ""mHCeMwDbuzBNCH1oZeDBEiPSWiAoXU8Yfhn4PyiNc1X3i99NwUJPMoVyVs3PAASqEr4g==" +decompress_rle. +mirror. x z. 1,100% a[-2,-1] x +_rlevel=255 _glevel=130 _blevel=233 +#@cli x_paint +#@cli : Launch the interactive painter. +x_paint : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Interactive painter"$n" -----------------------\n +----\n +---- Use "${c}"mouse"$n" to select color and brush.\n +---- "${c}"Left button"$n" draws a colored stroke.\n +---- "${c}"Right button"$n" fills a colored region.\n +---- "${c}"Arrow keys"$n" or '"${c}"SPACE"$n"' and '"${c}"BACKSPACE"$n"' to swap\n +---- between available images.\n +---- Key '"${c}"S"$n"' to save snapshot of the current view.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------------" +to_rgb +if !$! i[0] 512,512,1,3,255 =>[0] "[New image]" else k[0] fi +1 +parallel "_x_paint[]","w[] 400,320,0,Palette x_select_color[] __color,0,0,0" k[0] +_x_paint : +pass[-2,-1] 1 ('{-2,n}') discard. {'_c1'} =>[0] {t} rm. +__color={0,vector3(ia<128?255:0)} +brushsize=1 +brushopacity=0 +brushangle=90 +brushthickness=1 +image=0 +refresh_image=1 +refresh_brush=1 +ox1=-1 +oy1=-1 +do +if $refresh_brush +rm. (32,64;64,32) r. 24,24,1,3,1 r. {8*48},{4*48},1,3,0,2 +repeat 4 { y=$> +repeat 8 { +ellipse. {48*$>+24},{48*$y+24},{2*$>+1},{(2*$>+1)*$brushthickness},$brushangle,{1-$y/4},255 +} +} +rectangle. {$brushsize*48},{$brushopacity*48},{$brushsize*48+47},{$brushopacity*48+47},1,0xFFFFFFFF,255,128,128 +{w},16,1,3 line. 0,50%,100%,50%,1,0x55555555,128,64,128 +bx:=$brushangle*w/180 +rectangle. {$bx-16},20%,{$bx+16},80%,1,128 +line. {$bx-16},20%,{$bx+16},20%,1,255 line. {$bx+16},20%,{$bx+16},80%,1,255 +line. {$bx-16},80%,{$bx+16},80%,1,64 line. {$bx-16},20%,{$bx-16},80%,1,64 +a[-2,-1] y +16,{h-16},1,3 line. 50%,0,50%,100%,1,0x55555555,128,64,128 +by:=$brushthickness*(h-16) +rectangle. 20%,{$by-16},80%,{$by+16},1,128 +line. 20%,{$by-16},80%,{$by-16},1,255 line. 80%,{$by-16},80%,{$by+16},1,255 +line. 20%,{$by-16},20%,{$by+16},1,64 line. 20%,{$by+16},80%,{$by+16},1,64 +a[-2,-1] x +w3. {w},{h},0,"Brush" +refresh_brush=0 +fi +if $refresh_image +w1[$image] {$image,w},{$image,h},0,"Image "\#$image" : "{$image,b}.{$image,x} +refresh_image=0 +fi +x1={*1,x} y1={*1,y} +x2={*2,x} y2={*2,y} +x3={*3,x} y3={*3,y} +if $x1>=0 +if {*1,b}&1 +ox1:=$ox1<0?$x1:$ox1 +oy1:=$oy1<0?$y1:$oy1 +delta:=max(abs($x1-$ox1),abs($y1-$oy1)) +r1:=2*$brushsize+1 +r2:=$r1*$brushthickness +dx:=2*($x1-$ox1)/max(1,$delta) +dy:=2*($y1-$oy1)/max(1,$delta) +o:=1-($brushopacity/4)^0.04 +repeat max(1,($delta+1)/2) { +ellipse[$image] {$ox1+$>*$dx},{$oy1+$>*$dy},$r1,$r2,$brushangle,$o,$__color +} +ox1=$x1 oy1=$y1 +refresh_image=1 +else +ox1=-1 oy1=-1 +if {*1,b}&2 +flood[$image] $x1,$y1,0,10,0,1,$__color +refresh_image=1 +fi +fi +fi +if {*1,ARROWRIGHT}" || "{*2,ARROWRIGHT}" || "{*3,ARROWRIGHT}" || "\ +{*1,ARROWUP}" || "{*2,ARROWUP}" || "{*3,ARROWUP}" || "{*1,SPACE}" || "{*2,SPACE}" || "{*3,SPACE} +image:=($image+1)%($!-2) refresh_image=1 +elif {*1,ARROWLEFT}" || "{*2,ARROWLEFT}" || "{*3,ARROWLEFT}" || "{*1,ARROWDOWN}" || "{*2,ARROWDOWN}" || "{*3,ARROWDOWN}" || "{*1,BACKSPACE}" || "{*2,BACKSPACE}" || "{*3,BACKSPACE} +image:=($image-1)%($!-2) refresh_image=1 +fi +if {*1,S} o[$image] gmic_paint.png fi +if {*3,b}" && "$x3>=0 +if $x3<384" && "$y3>=192 brushangle:=$x3*180/(w-16) +elif $x3>=384" && "$y3<192 brushthickness:=$y3/(h-16) +elif $x3<384" && "$y3<192 brushsize:=int($x3*8/(w-16)) brushopacity:=int($y3*4/(h-16)) +fi +refresh_brush=1 +fi +wait +while {*1}" && "!{*1,Q}" && "!{*1,ESC} +__color=-1 w1[] 0 w2[] 0 w3[] 0 rm[-2,-1] +#@cli x_plasma +#@cli : Launch the plasma effect demo. +x_plasma : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Plasma effect"$n" ----------------------\n +----\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-------------------------------------------" +l[] { +N=8 +repeat $N { +320,200,1,3 rand. 0,255 plasma. 1,0,7 n. 0,255 +amp:=u(-40,40) freq:=round(u(2,6)) dir$>:=(u<0.5?-1:1)*round(u(1,2)) +100%,100%,1,1,'$amp*cos(y*2*pi*$freq/h)' +} +{w+2},100%,1,1,'x' 100%,100%,1,1,'Y=(y-80+15*cos(x/30)+10*sin(x/22));Y<0||Y>=50?-1:Y' a[-2,-1] c +0 t. "** Welcome to G\47MIC, a powerful image processing framework **",0,0,50,1,255 +b. 0.5 n. 0,255 +M:=w +w[] {0,f=1.5*h<0.5*{*,v}?3:1.5;[w,h]*=f},0,"[G"{`39`}"MIC] Plasma Effect" +t=0 tt:=-1.5*{0,w} +do +tic=$| +a:=int($t) a2:=2*$a a21:=$a2+1 +b:=($a+1)%$N b2:=2*$b b21:=$b2+1 ++warp[$a2] [$a21],1,0,2 ++warp[$b2] [$b21],1,0,2 +j.. .,0,0,0,0,{$t-$a} rm. +shift[$a21] 0,${dir$a},0,0,2 +shift[$b21] 0,${dir$b},0,0,2 +if int($t+0.005)>int($t) dir$a:=(u<0.5?-1:1)*round(u(1,3)) fi +t:=($t+max(0.005,($|-$tic)))%$N ++z.. $tt,{$tt+w-1+2} +warp. [-4],0,0,0 +r. 100%,100%,1,3 ++*. -1 +. 255 +j... .,0,0,0,0,1,..,255 rm. +j.. .,-2,-2,0,0,1,.,255 rm. +tt+=max(2,($|-$tic)*250) +if $tt>=$M tt:=-1.5*{0,w} fi +fps=${-fps} if $fps>0 to. $fps" fps",5,5,16,1,0.2 fi +w. +if {*,CTRLLEFT}" && "{*,D} w[] {3*w},{3*h} elif {*,CTRLLEFT}" && "{*,C} w[] {1.5*w},{1.5*h} fi +rm. wait 20 +while {*}" && "!{*,ESC}" && "!{*,Q} +rm[{-2*$N-2}--1] w[] 0 } +#@cli x_quantize_rgb : _nbcolors>=2 +#@cli : Launch the RGB color quantization demo. +x_quantize_rgb : check "isint(${1=16}) && $1>1" check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"RGB Quantization"$n" --------------------------------------\n +----\n +---- This demo shows how RGB colors can be quantified using\n +---- the "${c}"k-means algorithm"$n".\n +----\n +---- "${c}"Left mouse button"$n" on 3D view rotates the color cube.\n +---- "${c}"Right mouse button"$n" on 3D view toggles colors/clusters mode.\n +---- "${c}"Left mouse button"$n" on image toggles dithering mode,\n +---- "${c}"Left mouse button"$n" on colormap adds a random color.\n +---- "${c}"Right mouse button"$n" on colormap removes a color.\n +---- Key '"${c}"R"$n"' init colormap with random values.\n +---- Key '"${c}"U"$n"' init colormap with uniform sampling.\n +---- Key '"${c}"M"$n"' init colormap with median-cut algorithm.\n +---- Key '"${c}"SPACE"$n"' does a single iteration of k-means and pauses.\n +---- Key '"${c}"ENTER"$n"' runs k-means algorithm.\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------------------------" +if !$! sp ? fi +k[0] to_rgb if h>300 r2dy 300 round 1 fi => img ++r {w*h},1,1,3,-1 r. {min(w,8192)},1,1,3 => colors +$1,1,1,3 rand. 0,255 round. 1 => centroids +_x_quantize_rgb_3d (1,0,0,0;0,1,0,0;0,0,1,0) => pose3d +_x_quantize_rgb_text "Colors",clustering0 +_x_quantize_rgb_text "Clusters",clustering1 +_x_quantize_rgb_text "Dithering: off",dithering0 +_x_quantize_rgb_text "Dithering: on",dithering1 +if {img,h<300} +r2dy[img] 300,1 else [img] fi +{w+315},365,1,3,255 rm.. +rectangle. 4,4,305,305,1,0xFFFFFFFF,0 +rectangle. 309,4,{w-5},305,1,0xFFFFFFFF,0 +rectangle. 4,309,{w-5},360,1,0xFFFFFFFF,0 +.,. +rectangle. 310,5,{w-6},305,1,1 +rectangle. 5,310,{w-6},360,1,2 +300,300,1,1,'(y<<11)+(x<<2)+3' j.. .,5,5 rm. +a[-2,-1] c => visu +dithering=0 clustering=0 pause=1 s0=off s1=on +do +if !narg($visu_3d) ++-[centroids] 3 ++[centroids] 3 a[-2,-1] x permute. cxyz y. -. 128 +j[obj3d] .,0,8 rm. +[obj3d] +if $clustering +if {colors,iM}<256 ++index[colors] [centroids] *. 256 +[colors,-1] +fi ++channels[colors] 0 >>. 8 map. 2 permute. cxyz y. j.. .,0,{{-2,h}-$_N-h} rm. +fi +pose3d. {pose3d,^} +600,600,1,3 j3d. ..,50%,50%,-150,1,2,0,0,600 *. 1.5 b. 0.75 c. 0,255 rm.. r2dx. 50% +j. [clustering$clustering],2,0,0,0,1,[mclustering$clustering],255 +=> visu_3d j[visu] [visu_3d],5,5 +fi +if !narg($visu_img) ++index[img] [centroids],{0.7*$dithering},1 if h<300 r2dy. 300,1 fi +j. [dithering$dithering],2,0,0,0,1,[mdithering$dithering],255 +=> visu_img j[visu] [visu_img],310,5 +fi +if !narg($visu_centroids) ++luminance[centroids] a. [centroids],y sort. +,x rows. 1 r. {visu,w-10},50,1,3 +0 t. "Colors: "{centroids,w},2,0,16,1,255,255,255 +dilate. 3 j... ..,2,2,0,0,1,.,255 +rm[-2,-1] => visu_centroids j[visu] [visu_centroids],5,310 +fi +l[visu] { +w -1,-1,0,"[G"{`39`}"MIC] RGB Quantization" +if {*,CTRLLEFT}" && "{*,D} w[] {2*w},{2*h} elif {*,CTRLLEFT}" && "{*,C} w[] {w},{h} fi +} +x:=int({*,x}*{visu,w}/{*,w}) +y:=int({*,y}*{visu,h}/{*,h}) +b={*,b} +i={visu,i($x,$y,0,3)} +if $b&1" && "$i==1 +dithering:=!$dithering rm[visu_img] wait -1 +elif $b&1" && "$i==2 +(${-rgb}) y. c a[centroids,-1] x _x_quantize_rgb_3d rm[visu_3d,visu_img,visu_centroids] &[colors] 255 +pause=1 wait 100 +elif $b&2" && "$i==2" && "{centroids,w}>2 +r[centroids] {centroids,w-1} _x_quantize_rgb_3d rm[visu_3d,visu_img,visu_centroids] &[colors] 255 +pause=1 wait 100 +elif $b&2" && "$i>=3 +clustering:=!$clustering rm[visu_3d] wait -1 +elif {*,M} ++&[colors] 255 colormap. {centroids,w},0,0 rm[centroids] => centroids +_x_quantize_rgb_3d rm[visu_3d,visu_img,visu_centroids] &[colors] 255 +pause=1 wait -1 +elif {*,R} +rand[centroids] 0,255 round[centroids] 1 +_x_quantize_rgb_3d rm[visu_3d,visu_img,visu_centroids] &[colors] 255 +pause=1 wait -1 +elif {*,U} +uniform_distribution {centroids,w},3 *. 255 rm[centroids] => centroids +_x_quantize_rgb_3d rm[visu_3d,visu_img,visu_centroids] &[colors] 255 +pause=1 wait -1 +elif {*,ENTER} +pause=0 +elif $b&1" && "$i>=3 +coords={visu,i($x,$y,0,3)-3} u1:=(($coords>>2)&511)-150 v1:=($coords>>11)-150 +if !narg($u0) u0=$u1 v0=$v1 fi +if $u0!=$u1" || "$v0!=$v1 +n0:=sqrt(($u0)^2+($v0)^2) +nu0:=$n0>135?$u0*135/$n0:$u0 nv0:=$n0>135?$v0*135/$n0:$v0 nw0:=sqrt(max(0,18225-($nu0)^2-($nv0)^2)) +n1:=sqrt(($u1)^2+($v1)^2) +nu1:=$n1>135?$u1*135/$n1:$u1 nv1:=$n1>135?$v1*135/$n1:$v1 nw1:=sqrt(max(0,18225-($nu1)^2-($nv1)^2)) +u:=$nv0*$nw1-$nw0*$nv1 v:=$nw0*$nu1-$nu0*$nw1 w:=$nv0*$nu1-$nu0*$nv1 n:=sqrt(($u)^2+($v)^2+($w)^2) +rotation3d[] $u,$v,$w,{-asin($n/18225)*180/pi} mv[pose3d] $! m*[-2,-1] => pose3d +u0=$u1 v0=$v1 rm[visu_3d] +fi +elif !($b&1) u0= +fi +if !$pause" || "{*,SPACE} +pause={*,-SPACE} +&[colors] 255 +index[colors] [centroids] *. 256 +[colors,-1] +repeat s#$colors { # Recompute centroid positions. +sh[colors] $> +histogram. {centroids,w*256},0,{centroids,w*256-1} rm.. +i.. 256,1,1,1,'x' r.. {w},1,1,1,0,2 *.. . r[-2,-1] {centroids,w},1,1,1,2 max. 0.01 /[-2,-1] +} +a[-{colors,s}--1] c +rm[centroids] => centroids ++>>[colors] 8 channels. 0 histogram. {centroids,w},0,{centroids,w-1} +cmax:=xM +repeat w { +if !i($>) point[centroids] $>,0,0,1,{centroids,I($cmax)} point[centroids] $>,0,0,-0.001,${-rgb} fi +} +rm. c[centroids] 0,255 +if $visu_3d rm[visu_3d] fi +if $visu_img rm[visu_img] fi +if $visu_centroids rm[visu_centroids] fi +wait 20 +else if $visu_img wait fi +fi +while {*}" && "!{*,Q}" && "!{*,ESC} +rm w 0 +_x_quantize_rgb_3d : +if $obj3d rm[obj3d] fi ++distribution3d[centroids] circles3d. 5 col3d. 255 +colorcube3d 1 ++&[colors] 255 distribution3d. circles3d. 5 o3d. 0.2 +3d[-3--1] +-3d. 128,128,128 => obj3d _N:=i[7] +_x_quantize_rgb_text : +0 t. "$1",0,0,16,1,255 r. {w+2},15,1,1,0,0,0.5,0.5 +dilate. 3 to_rgb.. +=> $2,m$2 +#@cli x_reflection3d +#@cli : Launch the 3D reflection demo. +x_reflection3d : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"3D reflection"$n" ----------------------\n +----\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-------------------------------------------" +200,400,1,3 rand. 0,255 plasma. 1,100 blur_xy. 30,2 +sh. 0 n. 0,90 rm. sh. 1 n. 0,60 rm. sh. 2 n. 0,180 rm. ++mirror. x [-2,-1] a[-4--1] x ++luminance. mirror. x b. 2 n. 0,255 +torus3d 45,16 col3d. 255,200,0 +spherical3d "125+32*abs(cos(2*theta))",51,50 s3d. rm.. i.. 3,{h},1,1,150,220,255,200,255,255 y.. a[-6--1] y +spherical3d "150*abs(1+0.6*cos(3*phi)*sin(4*theta))",51,50 +r3d[-2,-1] 0,1,0,90 db3d 0 +xb,xl,anim=0 +w[] ${"fitscreen 400,400,1,35%"},0,"[G"{`39`}"MIC] 3D Reflection" +do +tic=$| ++rows. 8,{8+3*i[6]-1} +j... .,0,8,0,0,{$anim<250?0:0.5-0.5*cos(($anim-250)/100)} rm.. ++z[-6] $xb,0,{$xb+399},399 j3d. ..,75%,50%,0,1,3,0,0 ++z[-6] $xl,0,{$xl+399},399 +xf:=min(30,$anim-70)+20*cos(1.8*$|) +yf:=50+20*sin(2.7*$|) +j3d. [-6],{20+$xf}%,$yf%,0,1,4,0,0 +l3d . rm. +j3d. ..,75%,50%,0,1,5,0,0 j.. .,0,0,0,0,0.6 rm[-3,-1] +j3d. [-4],$xf%,$yf%,0,1,4,0,0 +fps=${-fps} if $fps>0 to. $fps" fps",5,{h-19},13,1,0.2 fi +w. rm. +if {*,CTRLLEFT}" && "{*,D} w[] 800,800 elif {*,CTRLLEFT}" && "{*,C} w[] 400,400 fi +xb:=($xb+6)%400 +xl:=($xl-6)%400 +anim+=1 +r3d[-2,-1] {sin(0.5*$|)},{cos($|)},1,{max(0.005,$|-$tic)*33} +r3d... -1,0.3,0.8,{max(0.005,$|-$tic)*100} +wait 20 +while {*}" && "!{*,ESC}" && "!{*,Q} +rm[-5--1] w[] 0 +#@cli x_rubber3d +#@cli : Launch the 3D rubber object demo. +x_rubber3d : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"3D rubber object"$n" -------------------\n +----\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-------------------------------------------" +rm +sphere3d 150,0 torus3d 70,15 cylinder3d 20,40 +col3d... 200,200,200,0.3 col3d.. 128,200,76 col3d. 200,128,76 +c3d[-3--1] r3d. 1,0,0,70 +3d[-3--1] +3d. 10,-8,20 *3d. 1.5 +400,400,64,3 +{w},{h},1,3,'!c?x:c==1?y:y*{1,d}/h' +{w},{h},1,3 +w[] ${"fitscreen .,35%"},0,"[G"{`39`}"MIC] 3D Rubber Object" +frame=0 +do +fps=${-fps} +{w},{h},1,3 fc. 16,32,32 j3d. [0],50%,50%,0,1,3,0,0 j[1] .,0,0,$frame rm. +r3d[0] 0.1,1,0.6,{3*cos($|*1.25)} r3d[0] 1,0.2,0.6,-1 ++warp[1] [2],0,0,1 *[3] 0.8 *. 0.2 +[3] . rm. +if $fps>0 to. $fps" fps",5,{h-29},24,2,0.2 fi +w. +if {*,CTRLLEFT}" && "{*,D} w[] {2*w},{2*h} elif {*,CTRLLEFT}" && "{*,C} w[] {w},{h} fi +wait[0] 20 +sh[2] 2 -. 1 &. {{1,d}-1} rm. +frame:=($frame-1)%{1,d} +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w 0 +#@cli x_segment : _max_resolution={ 0 | >=128 } +#@cli : Segment foreground from background in selected opaque RGB images, interactively. +#@cli : Return RGBA images with binary alpha-channels. +#@cli : Default value: 'max_resolution=1024'. +x_segment : check "!${1=1024} || $1>=128" check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e[^-1] "Extract foreground from background in image$? interactively, with maximum resolution $1." +e "\n +----------------------------------------------------------------------------------------------------\n +----\n +---- "${c}"Left mouse button"$n" or key '"${c}"F"$n"' create a new foreground control point +(or move an existing one).\n +---- "${c}"Right mouse button"$n" or key '"${c}"B"$n"' create a new background control point +(or move an existing one).\n +---- "${c}"Mouse wheel"$n", or keys '"${c}"CTRL+arrows UP/DOWN"$n"' zoom view in/out.\n +---- '"${c}"CTRL+mouse wheel"$n"', '"${c}"SHIFT+mouse wheel"$n"' or "${c}"arrow keys"$n" move image in zoomed view.\n +---- Key '"${c}"SPACE"$n"' updates the extraction mask.\n +---- Key '"${c}"TAB"$n"' toggles background view modes.\n +---- Key '"${c}"M"$n"' toggles marker view modes.\n +---- Key '"${c}"BACKSPACE"$n"' deletes the last control point added.\n +---- Key '"${c}"PAGE UP"$n"' increases background opacity.\n +---- Key '"${c}"PAGE DOWN"$n"' decreases background opacity.\n +---- Keys '"${c}"CTRL+D"$n"' increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' decrease window size.\n +---- Keys '"${c}"CTRL+R"$n"' reset window size.\n +---- Keys '"${c}"ESC"$n"', '"${c}"Q"$n"' or '"${c}"ENTER"$n"' exit the interactive window.\n +----\n +----------------------------------------------------------------------------------------------------" +foreach { +name={0,n} title={0,b} if narg({0,x}) title=$title.{0,x} fi +w,h={w},{h} fdim=${fitscreen[]\ $w,$h} ww:=arg(1,$fdim) wh:=arg(2,$fdim) x0=0 y0=0 x1:=w-1 y1:=h-1 +selection=-1 marker_mode=2 xpan=-1 ypan=-1 bg_mode=0 opacity=64 +to_rgb => img +if narg($_gui_control_points)>=4 +($_gui_control_points) r. {w/4},4,1,1,-1 +else 0 +fi +=> points +if $1>0 if $w>$h +r2dx[img] {min($1,$w)},2 else +r2dy[img] {min($1,$h)},2 fi else [img] fi +_x_segment. +pw,ph={potential,[w,h]} +do +wait +x,y,b,o={*,x,y,b,-o} +is_ctrl:={*,CTRLLEFT}" || "{*,CTRLRIGHT} +is_shift:={*,SHIFTLEFT}" || "{*,SHIFTRIGHT} +is_mouseout:=$x<0" || "$y<0 +x:=$x0+$x*($x1-$x0+1)/$ww y:=$y0+$y*($y1-$y0+1)/$wh +oww=$ww owh=$wh ox0=$x0 oy0=$y0 ox1=$x1 oy1=$y1 +if {*,r} +nww,nwh={*,d,e} m:=min($nww,$nwh) +cx:=($x0+$x1)/2 cy:=($y0+$y1)/2 dx:=$nww*($x1-$x0+1)/$ww dy:=$nwh*($y1-$y0+1)/$wh +x0:=$cx-$dx/2 x1:=$cx+$dx/2 +y0:=$cy-$dy/2 y1:=$cy+$dy/2 +ww=$nww wh=$nwh +elif $is_ctrl" && "{*,-D} +nww:=min({*,u},$ww*1.25) nwh:=min({*,v},$wh*1.25) m:=min($nww,$nwh) +if $m==$nww ww=$m wh:=$h*$m/$w else ww:=$w*$m/$h wh=$m fi +elif $is_ctrl" && "{*,-C} +nww:=$ww/1.25 nwh:=$wh/1.25 +if min($nww,$nwh)>=64 ww=$nww wh=$nwh fi +elif $is_ctrl" && "{*,-R} +fdim=${fitscreen[]\ $w,$h} ww:=arg(1,$fdim) wh:=arg(2,$fdim) +x0=0 y0=0 x1:=$w-1 y1:=$h-1 +elif ($is_shift" && "$o<0)" || "{*,ARROWLEFT} +dx:=($x1-$x0)/6 x0-=$dx x1-=$dx +elif ($is_shift" && "$o>0)" || "{*,ARROWRIGHT} +dx:=($x1-$x0)/6 x0+=$dx x1+=$dx +elif ($is_ctrl" && "$o>0)" || "({*,ARROWUP}" && "!$is_ctrl) +dy:=($y1-$y0)/6 y0-=$dy y1-=$dy +elif ($is_ctrl" && "$o<0)" || "({*,ARROWDOWN}" && "!$is_ctrl) +dy:=($y1-$y0)/6 y0+=$dy y1+=$dy +elif $o>0" || "($is_ctrl" && "{*,ARROWUP}) +if $x1-$x0>16" && "$y1-$y0>16 +cx:=$x>=0" && "!{*,ARROWUP}?$x:($x0+$x1)/2 +cy:=$y>=0" && "!{*,ARROWUP}?$y:($y0+$y1)/2 +x0:=$cx+($x0-$cx)*0.75} y0={$cy+($y0-$cy)*0.75 +x1:=$cx+($x1-$cx)*0.75} y1={$cy+($y1-$cy)*0.75 +fi +elif $o<0" || "($is_ctrl" && "{*,ARROWDOWN}) +zfactor:=max(($x1-$x0+1)/$w,($y1-$y0+1)/$h) +if $zfactor<1.3 +cx:=$x>=0" && "!{*,ARROWDOWN}?$x:($x0+$x1)/2 +cy:=$y>=0" && "!{*,ARROWDOWN}?$y:($y0+$y1)/2 +x0:=$cx+($x0-$cx)/0.75} y0={$cy+($y0-$cy)/0.75 +x1:=$cx+($x1-$cx)/0.75} y1={$cy+($y1-$cy)/0.75 +dx:=$zfactor^2*($w-$x0-$x1)/2 dy:=$zfactor^2*($h-$y0-$y1)/2 +x0+=$dx x1+=$dx y0+=$dy y1+=$dy +else +dx:=($w-$x0-$x1)/2 dy:=($h-$y0-$y1)/2 +x0+=$dx x1+=$dx y0+=$dy y1+=$dy +fi +elif $b&4" && "!$is_mouseout +if $panx<0" && "$pany<0 panx=$x pany=$y +else dx:=round($panx-$x) dy:=round($pany-$y) x0+=$dx y0+=$dy x1+=$dx y1+=$dy +fi +else panx=-1 pany=-1 +fi +if $ww!=$oww" || "$wh!=$owh" || "$ox0!=$x0" || "$oy0!=$y0" || "$ox1!=$x1" || "$oy1!=$y1 rm[baseview] fi +N={points,w} +is_left_button:=$b&1" || "{*,F} is_right_button:=$b&2" || "{*,B} +is_button:=$is_left_button" || "$is_right_button +if narg($baseview)" && "$is_button" && "$x>=0" && "$y>=0" && "$x<$w" && "$y<$h +if $selection==-1" && "$N +($x;$y) r. $N,2 -. [points] *. {max($ww,$wh)/max($x1-$x0,$y1-$y0)} sqr. s. y +[-2,-1] +dmin:=im selection:=$dmin>25?-1:xm rm. +fi +if $selection>=0 +if $marker_mode ++columns[points] $selection ox,oy:=i[0],i[1] +=. $x =. $y,0,1 =. {1+$is_left_button},0,3 +j[points] .,$selection rm. rm[view] +fi +else +($x;$y;0;{1+$is_left_button}) a[points,-1] x selection=$N if !$marker_mode marker_mode=2 fi rm[view] +fi +else selection=-1 +if {*,SPACE}" && "narg($labels) rm[labels] +elif {*,TAB}" && "narg($baseview) +bg_mode:=($bg_mode+1)%6 rm[baseview] wait -1 +elif {*,M}" && "narg($view) +marker_mode:=($marker_mode-1)%3 rm[view] wait -1 +elif {*,PAGEDOWN}" && "narg($baseview) +opacity:=max(0,$opacity-32) rm[baseview] wait -1 +elif {*,PAGEUP}" && "narg($baseview) +opacity:=min(255,$opacity+32) rm[baseview] wait -1 +elif {*,BACKSPACE}" && "$N +if $N>1 z[points] 0,{$N-2} +else i=$points rm[points] i[$i] 0 =>[$i] points +fi rm[view] wait -1 +fi +fi +w2:=round(($x1-$x0)/2) h2:=round(($y1-$y0)/2) +if $x0<-$w2 x1-=$x0+$w2 x0=-$w2 fi +if $y0<-$h2 y1-=$y0+$h2 y0=-$h2 fi +if $x1>=$w+$w2 x0+=$w-1+$w2-$x1 x1:=$w-1+$w2 fi +if $y1>=$h+$h2 y0+=$h-1+$h2-$y1 y1:=$h-1+$h2 fi +if !narg($labels) +N={points,w} +if narg($view) to[view] "Processing...",5,5,20,2 w[view] fi +if $N +[points] +sh. 0,0,0,0 *. {$pw/$w} rm. +sh. 1,1,0,0 *. {$ph/$h} rm. +pointcloud. -1,$pw,$ph dilate. 3 +watershed. [potential] -. 1 +else [potential],[potential],1,1,1 +fi +=> labels +if narg($baseview) rm[baseview] fi +fi +if !narg($baseview) +nx0:=$x0*$pw/$w ny0:=$y0*$ph/$h +nx1:=$x1*$pw/$w ny1:=$y1*$ph/$h ++z[img] $x0,$y0,$x1,$y1 +r. $ww,$wh,1,100%,{$ww=3 *. -1 +. 1 fi +*. {255-$opacity} +. $opacity a[-2,-1] c +if $bg_mode%3>=1 i.. 100%,100%,1,3,{(($bg_mode-1)%3)*255} blend[-2,-1] alpha +else drgba. +fi +=> baseview +if narg($view) rm[view] fi +fi +if !narg($view) +[baseview] r. 100%,100%,1,3 +if $marker_mode +if $marker_mode==2 rad1=5 rad2=3 opa=1 else rad1=3 rad2=2 opa=0.8 fi +col0=255,0,0 col1=0,255,0 +repeat w#$points { ++columns[points] $> x:=(i[0]-$x0)*$ww/(1+$x1-$x0) y:=(i[1]-$y0)*$wh/(1+$y1-$y0) l:=i[3]-1 rm. +circle. $x,$y,$rad1,1,0 circle. $x,$y,$rad2,$opa,${col$l} +} +fi +=> view +w[view] $ww,$wh,0,$title +fi +while {*}" && "!{*,ESC}" && "!{*,Q}" && "!{*,ENTER} +if narg($view) to[view] "Processing fullres...",5,5,20,2 w[view] fi +k[img,points] +N={points,w} status= +if $N +status={points,^} +[img] _x_segment. pointcloud[points] -1,$w,$h +zfact:={img,max(w,h)}/{potential,max(w,h)} dilate[points] {int(3*$zfact)} +watershed[points] [potential] -[points] 1 k[img,points] +*. 255 +else k[img] [img],[img],1,1,255 +fi +a c => $name +} +u $status +w 0 +_x_segment : +b. 0.2% gradient_norm. f. 1/(1+i^2) +=> potential +#@cli x_select_color : _variable_name +#@cli : Display a RGB or RGBA color selector. +#@cli : Argument 'variable_name' specifies the variable that contains the selected color values (as R,G,B,[A]) +#@cli : at any time. +#@cli : Its value specifies the initial selected color. Assigning '-1' to it forces the interactive window to close. +#@cli : Default value: 'variable_name=xsc_variable'. +x_select_color : skip ${1=xsc_variable} check_display $0 +rm +n:=narg($$1) if !$n $1=0,0,0 fi +rgba_mode:=$n>=4 R:=arg(1,$$1) G:=arg(2,$$1) B:=arg(3,$$1) A:=$rgba_mode?arg(4,$$1):255 +e[^-1] "Open "${arg0\ $rgba_mode,RGB,RGBA}" color selector widget, with variable '$1' and starting color "($$1)"." +if !{*} w[] {400+24*$rgba_mode},400,0,"Select a color" fi +update_view=1 is_sv=0 is_h=0 is_a=0 colordb=0 is_thread_variable:=arg(1,{'$1'})==_'_'" && "arg(2,{'$1'})==_'_' +m "add_preset : if !narg($_xsc_preset$""1) _xsc_preset$""1=$""2,$""3,$""4 fi" +add_preset 0,0,0,0,0 add_preset 1,255,255,255 add_preset 2,255,0,0 add_preset 3,0,255,0 +add_preset 4,0,0,255 add_preset 5,255,255,0 add_preset 6,255,0,255 add_preset 7,0,255,255 +add_preset 8,50,50,50 add_preset 9,100,100,100 add_preset 10,150,150,150 add_preset 11,200,200,200 +um add_preset +if !narg($_xsc_preset) _xsc_preset=11 fi +($R^$G^$B) c. 0,255 rgb2hsv. H,S,V:=i[0],i[1],i[2] rm. +do +w,h,x,y,b={*,d,e,x,y,b} +if !$! +$w,$h,1,3,200 +if $rgba_mode x1:=w-89 y1:=h-57 x2:=w-80 else x1:=w-49 y1:=h-57 x2:=w-40 fi +x0=8 y0=8 x3:=$x2+31 x4:=w-40 x5:=$x4+31 x6:=max($x0+232+32*$rgba_mode,w-152) y6:=$y1+7 +rectangle {$x0-1},{$y0-1},{$x1+1},{$y1+1},1,0xFFFFFFFF,232 +line {$x0-1},{$y0-1},{$x1+1},{$y0-1},1,128 +line {$x0-1},{$y0-1},{$x0-1},{$y1+1},1,128 +(1;0) (0,1) r[-2,-1] {$x1-$x0+1},{$y1-$y0+1},1,1,3 i... 100%,100%,1,1,$H a[-3--1] c hsv2rgb. j.. .,$x0,$y0 rm. +rectangle {$x2-1},{$y0-1},{$x3+1},{$y1+1},1,0xFFFFFFFF,232 +line {$x2-1},{$y0-1},{$x3+1},{$y0-1},1,128 +line {$x2-1},{$y0-1},{$x2-1},{$y1+1},1,128 +(359;0^1;1^1;1) r. {$x3-$x2+1},{$y1-$y0+1},1,3,3 hsv2rgb. j.. .,$x2,$y0 rm. +if $rgba_mode +rectangle {$x4-1},{$y0-1},{$x5+1},{$y1+1},1,0xFFFFFFFF,232 +line {$x4-1},{$y0-1},{$x5+1},{$y0-1},1,128 +line {$x4-1},{$y0-1},{$x4-1},{$y1+1},1,128 +(1;0) r. {$x5-$x4+1},{$y1-$y0+1},1,4,3 *. 255 drgba. j.. .,$x4,$y0 rm. +fi +t. "Current",$x0,{$y1+12},14,1,0 +if narg($_xsc_old) +t. "Old",$x0,{$y1+34},14,1,0 +($_xsc_old) y. c r. 48,16 drgba. r. {w+2},{h+2},1,3,0,0,0.5,0.5 j.. .,{$x0+55},{$y1+32} rm. +fi +repeat 12 { +(${_xsc_preset$>}) -. 255 r. 4,1,1,1,0 +. 255 +y. c r. 18,18 drgba. frame. 1,1,{255*($>==$_xsc_preset)} +j.. .,{$x6+($>%6)*25},{$y6+($>>=6)*25} rm. +} +update_view=1 +fi +if $update_view +. +cx:=$x0+$V*($x1-$x0) cy:=$y0+(1-$S)*($y1-$y0) +if $cx>$x0 line. {$cx-1},$y0,{$cx-1},$y1,1,200 fi +if $cx<$x1 line. {$cx+1},$y0,{$cx+1},$y1,1,200 fi +if $cy>$y0 line. $x0,{$cy-1},$x1,{$cy-1},1,200 fi +if $cy<$y1 line. $x0,{$cy+1},$x1,{$cy+1},1,200 fi +line. $x0,$cy,$x1,$cy,1,0 line. $cx,$y0,$cx,$y1,1,0 +cy:=$y0+(359-$H)*($y1-$y0)/359 +if $cy>$y0 line. $x2,{$cy-1},$x3,{$cy-1},1,200 fi +if $cy<$y1 line. $x2,{$cy+1},$x3,{$cy+1},1,200 fi +line. $x2,$cy,$x3,$cy,1,0 +if $rgba_mode +cy:=$y0+(255-$A)*($y1-$y0)/255 +if $cy>$y0 line. $x4,{$cy-1},$x5,{$cy-1},1,200 fi +if $cy<$y1 line. $x4,{$cy+1},$x5,{$cy+1},1,200 fi +line. $x4,$cy,$x5,$cy,1,0 +fi +($H^$S^$V^$A) sh. 0,2 hsv2rgb. rm. round. R,G,B:=i[0],i[1],i[2] +r. 48,16 drgba. r. {w+2},{h+2},1,3,0,0,0.5,0.5 j.. .,{$x0+55},{$y1+10} rm. +t. "HSV ("{round($H)}","{round($S*255)}","{round($V*255)}")",{$x0+115},{$y1+24},14,1,0 +if $rgba_mode t. "RGBA ("$R","$G","$B","{round($A)}")",{$x0+115},{$y1+8},14,1,0 +else t. "RGB ("$R","$G","$B")",{$x0+115},{$y1+8},14,1,0 +fi +('${dec2hex\ {$R*65536+$G*256+$B}}') -. {'0'} r. 6,1,1,1,0,0,1,0 +. {'0'} +f. i>=_'a'" && "i<=_'z'?i+_'A'-_'a':i +t.. "html ""#"{t},{$x0+115},{$y1+40},14,1,0 rm. +w. 100%,100%,0 rm. +if $rgba_mode $1=$R,$G,$B,$A else $1=$R,$G,$B fi +update_view=0 +fi +if $is_thread_variable wait 50 else wait fi +ww,wh={*,w,h} +is_ctrl:={*,CTRLLEFT}" || "{*,CTRLRIGHT} +if {*,r} ww,wh={*,d,e} +elif $is_ctrl" && "{*,-D} ww,wh:=1.25*[$ww,$wh] +elif $is_ctrl" && "{*,-C} ww,wh:=0.8*[$ww,$wh] +elif $is_ctrl" && "{*,R} ww,wh:=400+[24*$rgba_mode,0] +fi +ww,wh:=max(200,$ww),max(200,$wh) +if $ww!={*,w}" || "$wh!={*,h} w[] $ww,$wh rm fi +if $b&1" && "$x>=0" && "$y>=0 +if !$is_h" && "!$is_a" && "($is_sv" || "($x>=$x0" && "$x<=$x1" && "$y>=$y0" && "$y<=$y1)) +S:=max(0,min(1,1-($y-$y0)/($y1-$y0))) V:=max(0,min(1,($x-$x0)/($x1-$x0))) +update_view=1 colordb=0 is_sv=1 k[0] +elif !$is_sv" && "!$is_a" && "($is_h" || "($x>=$x2" && "$x<=$x3" && "$y>=$y0" && "$y<=$y1)) +H:=max(0,min(359,359-($y-$y0)*359/($y1-$y0))) +colordb=0 is_h=1 rm +elif !$is_sv" && "!$is_h" && "($is_a" || "($x>=$x4" && "$x<=$x5" && "$y>=$y0" && "$y<=$y1)) +A:=round(max(0,min(255,255-($y-$y0)*255/($y1-$y0)))) +colordb=0 is_a=1 update_view=1 k[0] +elif !$is_sv" && "!$is_h" && "!$is_a" && "{narg($_xsc_old)}" && "$x>=$x0+55" && "$x<=$x0+102" && "$y>=$y1+32" && "$y<=$y1+47 +($_xsc_old) y. c sh. 0,2 rgb2hsv. rm. H,S,V,A:=i[0],i[1],i[2],i[3] +colordb=0 rm +elif !$is_sv" && "!$is_h" && "!$is_a" && "$x>=$x6" && "$x<=$x5" && "$y>=$y6" && "$y<=$y6+50" && "($x-$x6)%25<=20" && "($y-$y6)%25<=20 +p:=int(($x-$x6)/25)+6*int(($y-$y6)/25) (${_xsc_preset$p}) -. 255 r. 4,1,1,1,0 +. 255 y. c sh. 0,2 rgb2hsv. rm. +H,S,V,A:=i[0],i[1],i[2],i[3] +colordb=0 rm +elif !$is_sv" && "!$is_h" && "!$is_a" && "$x>=$x0+55" && "$x<=$x0+102" && "$y>=$y1+10" && "$y<=$y1+27 +_xsc_old=$R,$G,$B,$A colordb:=($colordb+1)%2 +if !$colordb +_xsc_preset$_xsc_preset=$R,$G,$B,$A _xsc_preset:=($_xsc_preset-1)%12 +fi +rm wait -1 +else colordb=0 +fi +elif !$b is_sv=0 is_h=0 is_a=0 +fi +if {*,ARROWUP} colordb=0 S:=min(1,$S+1/256) update_view=1 k[0] wait -1 +elif {*,ARROWDOWN} colordb=0 S:=max(0,$S-1/256) update_view=1 k[0] wait -1 +elif {*,ARROWRIGHT} colordb=0 V:=min(1,$V+1/256) update_view=1 k[0] wait -1 +elif {*,ARROWLEFT} colordb=0 V:=max(0,$V-1/256) update_view=1 k[0] wait -1 +elif {*,PAGEUP} colordb=0 H:=min(359,$H+1) rm wait -1 +elif {*,PAGEDOWN} colordb=0 H:=max(0,$H-1) rm wait -1 +fi +if ['$$1']=='-1' break fi +if (($rgba_mode" && "['$$1']!='$R,$G,$B,$A')" || "(!$rgba_mode" && "['$$1']!='$R,$G,$B'))" && "$x<0" && "$y<0" && "!$is_sv" && "!$is_h" && "!$is_a +($$1) y. c -. 255 r. 1,1,1,4,0 +. 255 sh. 0,2 rgb2hsv. rm. +H,S,V,A:=i[0],i[1],i[2],i[3] rm +fi +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w 0 +if $rgba_mode u $R,$G,$B,$A else u $R,$G,$B fi +_xsc_old=${} +#@cli x_select_function1d : _variable_name,_background_curve_R,_background_curve_G,_background_curve_B +#@cli : Open an interactive window, where the user can defined its own 1D function. +#@cli : If an image is selected, it is used to display additional information : +#@cli : - The first row defines the values of a background curve displayed on the window (e.g. an histogram). +#@cli : - The 2nd, 3rd and 4th rows define the R,G,B color components displayed beside the X and Y axes. +#@cli : Argument 'variable_name' specifies the variable that contains the selected function keypoints at any time. +#@cli : Assigning '-1' to it forces the interactive window to close. +#@cli : Default values: 'variable_name=xsf_variable', 'background_curve_R=220', 'background_curve_G=background_curve_B=background_curve_T'. +x_select_function1d : skip ${1=xsf_variable},${2=220},${3=$2},${4=$2} check_display $0 +e[^-1] "Open 1D function widget, with variable name '$1'." +if $! k[0] fi +is_additional_data=$! +if !{*} w[] 400,400,0,"Create a 1D function" fi +reset_w,reset_h={*,w,h} +if !narg($$1) $1=0,0,100,100 fi +($$1) => points y. x r. 2,{w/2},1,1,-1 +is_thread_variable:=arg(1,{'$1'})==_'_'" && "arg(2,{'$1'})==_'_' selected=-1 X=-1 Y=-1 +do +if !narg($baseview) +{{*,d}-48},{{*,e}-48},1,3,255 +if $is_additional_data +100%,100% +rows[0] 0 graph.. .,3,0,0,0,1,1 rm. c. 0,1 ++fc.. ${2-4} j... .,0,0,0,0,1,.. rm[-2,-1] +fi +grid. {(w-1)/8},{(h-1)/8},0,0,0.2,0xCCCCCCCC,0 +line. 0,100%,100%,0,0.2,0 +frame. 24,24,200 +rectangle. 23,23,{w-24},{h-24},1,0xFFFFFFFF,232 line. 23,23,23,{h-24},1,128 line. 23,23,{w-24},23,1,128 +if $is_additional_data" && "{0,h}>1 +if {0,h}>2 +rows[0] 1,3 else +rows[0] 1 r. 100%,3 fi +r. {-2,w-48},3,1,1,3 permute. xzcy r. 100%,8 frame. 1,1,0 +j.. .,23,{-2,h-19} rotate. -90 j.. .,{-2,w-19},23 rm. +fi +=> baseview +l { rm[view] onfail } +fi +if !narg($view) ++z[baseview] 24,24,{baseview,w-25},{baseview,h-25} r. 200%,200% +function1d[] 1,{points,^} +l. { +c 0,100 transpose +i[0] ({'CImg3d'},{h},{h-1}) +i.. 1,100%,1,1,y 1,100% a[-3--1] x +1,{h-1},1,1,2 +f. y ++. 1 a[-3--1] x +4,100%,1,1,1 y a y col3d 0 +} +*3d. {-2,(w-1)/100},{-2,(1-h)/100} +j3d.. .,0,100%,0,1,1,0,0 rm. +repeat h#$points { +x,y={points,[i(0,$>),100-i(1,$>)]} +circle. $x%,$y%,6,1,0xFFFFFFFF,0 +} +if $selected>=0 +x,y={points,[i(0,$selected),100-i(1,$selected)]} +circle. $x%,$y%,3,1,0 +fi +r. 50%,50%,1,3,2 ++j[baseview] .,24,24 rm.. +if $X>=0" && "$Y>=0 t. "X: "{min(255,round(255*$X/100))}" Y: "{min(255,round(255*$Y/100))},24,6,12,1 fi +=> view +w[view] +fi +if $is_thread_variable wait 50 else wait fi +x,y,b={*,x,y,b} is_ctrl:={*,CTRLLEFT}" || "{*,CTRLRIGHT} +X:=($x-24)*100/({*,w}-49) Y:=100-($y-24)*100/({*,h}-49) +oww,owh={*,w,h} ww=$oww wh=$owh +if {*,r} ww,wh={*,d,e} +elif $is_ctrl" && "{*,-D} ww={view,w*125%} wh={view,h*125%} +elif $is_ctrl" && "{*,-C} ww={view,w*75%} wh={view,h*75%} +elif $is_ctrl" && "{*,R} ww=$reset_w wh=$reset_h +elif !$is_ctrl" && "{*,R} rm[points] (0,0;100,100) => points $1={points,^} rm[view] +elif $b&3 +is_inside:=$X>=0" && "$Y>=0" && "$X<=100" && "$Y<=100 +if $selected<0 +f[points] "sqrt((i - $X)^2 + (j(1) - $Y)^2)*"{*,w}% z. 0,0 selected:=im>8?-1:ym rm. fi +if $x>=0" && "$b&1" && "$selected>=0 +if {*,SHIFTLEFT}" || "{*,SHIFTRIGHT} X={points,i(0,$selected)} fi +if {*,CTRLLEFT}" || "{*,CTRLRIGHT} Y={points,i(1,$selected)} fi +if {points,$selected>0" && "$selected8?-1:ym $1={points,^} rm[view,-1] +elif $b&2" && "$selected>0" && "$selected<{points,h-1}" && "$is_inside +l[points] { s y rm[$selected] a y } wait -1 selected=-1 $1={points,^} rm[view] +fi +elif !($b&1) selected=-1 +fi +ww:=min(90%*{*,u},max(200,$ww)) +wh:=min(90%*{*,v},max(200,$wh)) +if $oww!=$ww" || "$owh!=$wh w[] $ww,$wh rm[baseview,view] fi +if ['$$1']=='-1' break fi +if ['$$1']!=['{points,^}'] +rm[points] ($$1) => points y. x r. 2,{w/2},1,1,-1 l { rm[view] onfail } +fi +while {*}" && "!{*,ESC}" && "!{*,Q} +w[] 0 u {points,^} +if $is_additional_data rm[^0] else rm fi +#@cli x_select_palette : _variable_name,_number_of_columns={ 0:auto | >0 } +#@cli : Open a RGB or RGBA color selector widget from a palette. +#@cli : The palette is given as a selected image. +#@cli : Argument 'variable_name' specifies the variable that contains the selected color values (as R,G,B,[A]) +#@cli : at any time. +#@cli : Assigning '-1' to it forces the interactive window to close. +#@cli : Default values: 'variable_name=xsp_variable' and 'number_of_columns=2'. +x_select_palette : skip ${1=xsp_variable},${2=0} check_display $0 +if !$! error[0--3] "Command '$0': Missing specified palette image." fi +k[0] +r {w*h*d},1,1,{s},-1 to_color. rgba_mode:=s==4 to_rgba. => palette +e[^-1] "Open "${arg0\ $rgba_mode,RGB,RGBA}" color selector widget for palette$?, with variable name '$1'." +if w>1024 error[0--3] "Command '$0': Too much colors ("{w}") in selected palette." fi +if !{*} w[] 400,400,0,0,-1,-1,"Palette: "{0,b} fi +selected=-1 oselected=-1 +do +ww,wh={*,w,h} +R,G,B,A={palette,round(I[$selected])} +if $selected>=0" && "$oselected!=$selected +if $rgba_mode $1=$R,$G,$B,$A else $1=$R,$G,$B fi +fi +if ['$$1']=='-1' break fi +if !narg($baseview) l[palette] { +{w},1,1,1,x +. 1 +s. x append_tiles[^0] $2 +M,N:=w,h 100%,100%,1,1,1 ++r. {$ww-17},100%,1,1,4 +r.. 100%,{$wh-57},1,1,4 +r[-2,-1] .,.. -|[-2,-1] +line. 100%,0,100%,100%,1,1 +line. 0,100%,100%,100%,1,1 +-. 1 *. -1 +r.. .,.,1,1,1 -.. 1 ++map.. [0],0 drgba. +rv[-2,-1] *[-2,-1] ++!=.. -1 dilate. 3 +mv... $! +. 1 a[-3--1] c +=> baseview +} +if narg($view) rm[view] fi +fi +if !narg($view) +$ww,$wh,1,3,200 +if $selected<0 sh[baseview] 0,2 +else ++channels[baseview] 0,2 +channels[baseview] 4,4 +!=. {$selected+1} rectangle. 0,0,100%,100%,1,0xFFFFFFFF,1 ++dilate. 5 -[-2,-1] *. -1 +dilate. 5 *.. 255 +r.. 100%,100%,1,3 j... ..,0,0,0,0,1,. rm[-2,-1] +if $rgba_mode t.. "RGBA ("$R","$G","$B","$A")",8,{$wh-45},14,1,0 +else t.. "RGB ("$R","$G","$B")",8,{$wh-45},14,1,0 +fi +($R^$G^$B) rgb2hsv. H,S,V:=round([i[0],i[1]*255,i[2]*255]) rm. +t.. "HSV ("$H","$S","$V")",8,{$wh-31},14,1,0 +('${dec2hex\ {$R*65536+$G*256+$B}}') -. {'0'} r. 6,1,1,1,0,0,1,0 +. {'0'} +f. i>=_'a'" && "i<=_'z'?i+_'A'-_'a':i +t... "html ""#"{t},8,{$wh-17},14,1,0 rm. +fi +sh[baseview] 3 j... ..,8,8,0,0,1,. rm[-2,-1] +=> view w[view] +fi +if arg(1,{'$1'})==_'_'" && "arg(2,{'$1'})==_'_' wait 50 else wait fi +is_ctrl:={*,CTRLLEFT}" || "{*,CTRLRIGHT} +if {*,r} ww,wh={*,d,e} +elif $is_ctrl" && "{*,-D} ww,wh:=1.25*[$ww,$wh] +elif $is_ctrl" && "{*,-C} ww,wh:=0.8*[$ww,$wh] +elif $is_ctrl" && "{*,R} ww,wh=400 +fi +ww,wh:=max(200,$ww),max(200,$wh) +if ($ww!={*,w}" || "$wh!={*,h})" && "narg($baseview) w[] $ww,$wh rm[baseview] fi +oselected=$selected +if narg($baseview) +x,y,b={*,x,y,b} +if $b&1" && "$x>=0" && "$y>=0 +if {baseview,i($x-8,$y-8,0,4)} selected={baseview,i($x-8,$y-8,0,4)-1} else selected=-1 fi +rm[view] wait -1 +elif {*,ARROWUP}" && "$selected>=$M selected-=$M rm[view] wait -1 +elif {*,ARROWDOWN}" && "$selected<{0,w-$M} selected+=$M rm[view] wait -1 +elif {*,ARROWRIGHT}" && "$selected<{0,w-1} selected+=1 rm[view] wait -1 +elif {*,ARROWLEFT}" && "$selected>0 selected-=1 rm[view] wait -1 +fi +fi +while {*}" && "!{*,ESC}" && "!{*,Q} +w 0 k[0] +if $selected>=0 if $rgba_mode u $R,$G,$B,$A else u $R,$G,$B fi else u -1 fi +#@cli x_shadebobs +#@cli : Launch the shade bobs demo. +x_shadebobs : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Shade bobs"$n" -------------------------------\n +----\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-------------------------------------------------" +rm t=100 w ${"fitscreen 512,512,1,35%"},0,"[G"{`39`}"MIC] Shade Bobs" +do +t+=0.015 +if $t>4*pi" || "{*,b} +rx,ry,rz,rt,rcx,t:=v,v,v,v,u(-0.6*0.6),0 +N:=20+round(u(80)) R:=(2+round(u(40)))*min({*,w},{*,h})/300 +if $obj3d rm[colormap,img,obj3d] fi +{4+round(u(12))},1,1,3 noise[0] 255,2 ==. 1 r[0] 256,1,1,3,3 *[0] 255 shift[0] 1 => colormap +(67.5;73.5;109.5;103.5;51.5;100.5;{2*$N};$N) 3,{2*$N},1,1,0 +1,$N,1,1,5 2,$N,1,1,'y+x*$N' a[-2--1] x z. 0,5 +4,$N,1,1,1 y[-3--1] a[-4--1] y => obj3d +{*,w},{*,h} => img +wait -1 +fi +r:=$ry+$rx*cos(6*$rz*$t)+(1-$rx)*sin(6*$rt*$t) +(0;{30*$ry*($N-1)}) ($t;{2*pi*($N-1)/$N+$t}) r[-2,-1] 1,$N,1,1,3 ++.. {360*sin($rz*$t)} *.. {pi/180} ++sin[-2,-1] cos[-4,-3] *[-4,-2] $r *[-3,-1] $rcx +[-4,-3] +[-2,-1] +*.. {{*,w}/2} *. {{*,h}/2} a[-2,-1] x +++. $R -.. $R a[-2,-1] y z. 0,2 y. j[obj3d] .,0,8 rm. +j3d[img] [obj3d],50%,50%,0,-1,2,0,0 +&[img] 255 +map[img] [colormap] w. rm. wait 20 +if {*,CTRLLEFT}" && "{*,D} w[] 1024,1024 elif {*,CTRLLEFT}" && "{*,C} w[] 512,512 fi +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w 0 +#@cli x_spline +#@cli : Launch spline curve editor. +x_spline : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Spline curve editor"$n" --------------------------\n +----\n +---- "${c}"Mouse"$n" to insert/move/delete points.\n +---- Key '"${c}"R"$n"' to reset the curve.\n +---- Key '"${c}"SPACE"$n"' to shows/hide spline curve.\n +---- Key '"${c}"P"$n"' to shows/hide control points.\n +---- Key '"${c}"ENTER"$n"' to shows/hide control polygon.\n +---- Key '"${c}"T"$n"' to shows/hide point tangents.\n +---- Key '"${c}"I"$n"' to shows/hide point indices.\n +---- Key '"${c}"C"$n"' to shows/hide point coordinates.\n +---- Keys '"${c}"+"$n"' and '"${c}"-"$n"' to increase/decrease roundness.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-----------------------------------------------------" +if $! a x n 0,255 to_rgb else (0;0^0;128^0;0) r. 1024,1024,1,3,3 => "[G"{`39`}"MIC] Spline Editor" fi +w[0] {0,[w,h]/2},0,0,{n} +0 +roundness=0.5 +visuflags=23 +nearest=-1 +active=-1 +do +if !{1,whds} +rm[1] roundness=0.5 nearest=-1 active=-1 +i[1] ({0.2*w},{0.2*h};{0.2*w},{0.8*h};{0.8*w},{0.8*h};{0.8*w},{0.2*h}) +fi +[1] ({{*,w}*2/{0,w}},{{*,h}*2/{0,h}}) *[-2,-1] ++shift[2] 0,-1,0,0,2 +shift[2] 0,1,0,0,2 -[-2,-1] *. $roundness ++s. x sqr[-2,-1] +[-2,-1] sqrt. r. 2 +/[-2,-1] rm.. ++r[0] {2*[{*,w},{*,h}]},1,3 +if $visuflags&4 polygon. {2,h},{2,^},0.3,128,200,255 fi +repeat h#1 { +line. {2,@0-3},0.3,255,255,0 +if $visuflags&1 +spline. {2,@0-1},{3,@0-1},{2,@2-3},{3,@2-3},1,255 +fi +if $visuflags&8 +thickline. {{2,@0}-{4,@0}*40},{{2,@1}-{4,@1}*40},{{2,@0}+{4,@0}*40},{{2,@1}+{4,@1}*40},3,1,0,255,0 +fi +if $visuflags&16 +t. $>,{{2,@0}-10},{{2,@1}-42},35,1,255,255,0 +fi +if $visuflags&32 +t. "("{round({1,@0})}","{round({1,@1})}")",{{2,@0}-50},{{2,@1}+16},30,1,100,200,255 +fi +shift[1-4] 0,-1,0,0,2 +} +if $visuflags&2 repeat h#1 { +ellipse. {2,@0-1},10,10,0,1,0,0,0 ellipse. {2,@0-1},8,8,0,1,255,100,155 shift[2] 0,1,0,0,2 +} fi +r2dx. 50% w. rm[3,4,-1] wait +if {*,SPACE} visuflags+=$visuflags&1?-1:1 wait -1 fi +if {*,P} visuflags+=$visuflags&2?-2:2 wait -1 fi +if {*,ENTER} visuflags+=$visuflags&4?-4:4 wait -1 fi +if {*,T} visuflags+=$visuflags&8?-8:8 wait -1 fi +if {*,I} visuflags+=$visuflags&16?-16:16 wait -1 fi +if {*,C}" && "!{*,CTRLLEFT}" && "!{*,CTRLRIGHT} +visuflags+=$visuflags&32?-32:32 wait -1 fi +if {*,PADADD}" && "$roundness<1 roundness*=1.1 wait -1 fi +if {*,PADSUB}" && "$roundness>0.1 roundness*=0.9 wait -1 fi +if {*,R}" && "!{*,CTRLLEFT}" && "!{*,CTRLRIGHT} rm. i[1] 0 wait -1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,D} w[] {{*,w}*1.5},{{*,h}*1.5} fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,C} w[] {{*,w}/1.5},{{*,h}/1.5} fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,R} w[] {0,w},{0,h} fi +if {*,r} w[] fi +if !{*,b} active=-1 +elif {*,x}>=0" && "{*,b}" && "$active==-1 +[2] ({2*[{*,x},{*,y}]}) -[-2,-1] sqr. s. x +[-2,-1] +nearest:=ym +if im<256 active=$nearest fi +rm. +fi +rm[2] +if {*,b}&1" && "{*,x}>=0" && "$active!=-1 +=[1] {{*,x}*{0,w}/{*,w}},0,$active +=[1] {{*,y}*{0,h}/{*,h}},1,$active +elif {*,b}&2" && "{*,x}>=0" && "{1,h}>3 +l[1] { s y rm[$nearest] a y } wait -1 +elif {*,b}&1" && "{*,x}>=0 +xy=({{*,x}*{0,w}/{*,w}},{{*,y}*{0,h}/{*,h}}) ++shift[1] 0,-1,0,0,2 +. [1] /. 2 +$xy -[-2,-1] sqr. s. x +[-2,-1] +ns:=ym rm. +l[1] { s y i[{$ns+1}] $xy a y } +active:=$ns+1 +fi +while {*}" && "!{*,ESC}" && "!{*,Q} ++shift[1] 0,-1,0,0,2 +shift[1] 0,1,0,0,2 -[-2,-1] *. $roundness +[0],[0],1,1,2 rm[0] +repeat h#1 { spline. {0,@0-1},{1,@0-1},{0,@2-3},{1,@2-3},1,1 shift[0] 0,-1,0,0,2 shift[1] 0,-1,0,0,2 } +flood. 0,0,0,0,0,1,0 +rm[0,1] w 0 +#@cli x_starfield3d +#@cli : Launch the 3D starfield demo. +x_starfield3d : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"3D starfield"$n" ---------------------------------------\n +----\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +-----------------------------------------------------------" +l[] { +('G\47MIC') s x +x=0 N=$! repeat $N { 0 t. {$>,t},0,0,48,1,1 x$>=$x y$>=0 z$>:=-3200-150*$> x:=$x+w+8 } k[50%--1] +expand_xy 6,0 dilate_circ 5 b 0.5 expand_z 1,0 isosurface3d 10% *3d 1,1,5 rv3d +repeat $N { col3d[$>] ${-rgb} } +0 t. "Version "${-strver},0,0,48,1,1 r2dy. 18 +f. 255 to_rgb. +random3d 2500 col3d. 255 *3d. 320,200,1000 -3d. 160,100 +l3d 0,0,-600 +w[] ${"fitscreen 640,400,1,35%"},0,"[G"{`39`}"MIC] 3D Starfield" +t0=0 t=0 +do +320,200,1,3 +l.. { +s3d +r[2] 3,{2,h/3},1,1,-1 s[2] x %[4] 1000 ++/[4] 1000 *. -1 n. 0,2 c. 0,1 sqr. j.. . rm. +a[2-4] x +y a y +} +j3d. ..,50%,50%,-600,1,0,0,0,240 -3d.. 0,0,{min(12,$t0/10-4)} +torus3d 100,30 col3d. 255,64,255 ++col3d. 64,64,255 r3d. 1,0,0,-90 +3d. 65,0,0 ++3d[-2,-1] c3d. +r3d. 1,1,0,{-6*$t} r3d. 0,0,1,{2*$t} +j3d.. .,{($t-200)*2}%,50%,0,0.25,3,0,0 rm. +repeat $N { ++r3d[$>] 1,{$>%4},1,{-${z$>}/2} +j3d.. .,{90+${x$>}},{60+${y$>}},${z$>},1,4,0,0 rm. +z$>:=tl=280+6*$<;$t}+20):-20*($t-tl) +} +if $t<280 op:=max(0,min(1,($t-200)/20)) +else op:=max(0,1-($t-280)/20) +fi +j. ...,{(w-{-3,w})/2},120,0,0,$op,[-4] +w. wait 30 rm. +t0+=1 t:=$t0%350 +if !$t x=0 repeat 5 { z$>:=-3200-150*$> } fi +while {*}" && "!{*,ESC}" && "!{*,Q} +w[] 0 rm +} +#@cli x_tetris +#@cli : Launch tetris game. +x_tetris : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Tetris"$n" --------------------------------------------\n +----\n +---- This is a G\47MIC implementation of the "${g}"Tetris"$n" game.\n +----\n +---- "${c}"Arrow keys"$n" to move/rotate the triominos.\n +---- Key '"${c}"SPACE"$n"' to make the current triomino falling.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +----------------------------------------------------------" +rm +4,1,1,1,1,1,1,1 +3,2,1,1,1,0,0,1,1,1 +3,2,1,1,0,0,1,1,1,1 +2,2,1,1,1,1,1,1 +3,2,1,1,0,1,1,1,1,0 +3,2,1,1,0,1,0,1,1,1 +3,2,1,1,1,1,0,0,1,1 +=> m0,m4,m8,m12,m16,m20,m24 +if u<0.25 +i 2,1,1,1,1,1 +i 2,2,1,1,1,1,0,1 +i 3,1,1,1,1,1,1 +i 1,1,1,1,1 +i 3,2,1,1,1,1,1,1,0,1 +i 3,3,1,1,1,1,1,1,0,1,1,1,1 +=> m28,m32,m36,m40,m44,m48 +fi +repeat $! { i:=4*$> l[m$i] { repeat 3 { +rotate[0] {90*($>+1)} => m{$i+$>+1} } } } +N=$! +3,$N,1,1,'u(16,224)' r. 3,400% => colors +(0,-1,0;1,0,-1;0,1,0) *. 120 => mask +repeat $N { ++r[m$>] 500%,500%,1,3 +correlate. [mask],0 r. 200%,200%,1,1,3 ri.. . *[-2,-1] c. 30%,100% ++r[m$>] .,.,1,3 +replace_color. 0,0,1,1,1,{colors,@{3*$>}-{3*$>+2}} rv[-3,-1] +[-3,-1] c.. 0,255 +channels. 0 *. 255 a[-2,-1] c => s$> +} +rm[colors,mask] +fact:={s0,w}/{m0,w} +W=12 H=20 +$W,$H . => board,curr_board +{$fact*$W},{$fact*$H},1,3 . => render,curr_render +channels. 0 => curr_render_mask ++rows[render] 0,50% plasma. 1,2 noise. 20 blur_y. 40%,1 +mirror. y a[-2,-1] y ri. [render] +n. 0,64 blur_x. 1 100%,100% noise. 0.5,2 ==. 1 b. 1 *. 300 +[-2,-1] c. 0,255 => background +time=$| score=0 fall_mode=0 gameover=0 n=-1 nn:=round(u(0,$N-1)) +do +wait {$fall_mode?-1:-20} +if $gameover ++j[background] [curr_render],0,0,0,0,0.7,[curr_render_mask],255 +to. "Game\nOver!",22,30%,32,2,1,255 w. rm. +continue +fi +if $n<0 +l[board] { +s y i=-1 repeat $! { if {$<,im} i=$<,$i fi } +0 rm[$i] a y score+=2^(narg($i)-1)-1 r $W,$H,1,1,0,0,0,1 => board +} +if narg($i)>1 l[render] { s y,$H 0 rm[$i] a y r {$fact*$W},{$fact*$H},1,3,0,0,0,1 => render } fi +n=$nn nn:=round(u(0,$N-1)) x:=$W/2 y=0 do_render=1 fall_mode=0 +fi +if $do_render +rm[curr_board,curr_render,curr_render_mask] +[board] => curr_board j[curr_board] [m$n],{$x-int({m$n,w}/2)},$y,0,0,1,[m$n] +[render] => curr_render sh[s$n] 3 j[curr_render] [s$n],{$fact*($x-int({m$n,w}/2))},{$fact*$y},0,0,1,.,255 rm. ++*[curr_board] 255 r. [curr_render],[curr_render] => curr_render_mask +0 t. "Score : "$score" Next :",4,0,25,1,200 r. 50%,50%,1,3,2 +!=. 0 *. 255 +j[curr_render] ..,0,0,0,0,1,.,255 j[curr_render_mask] .,0,0,0,0,1,.,255 rm[-2,-1] ++*[m$nn] 196 r. 300%,300%,1,3 j[curr_render,curr_render_mask] .,{{curr_render,w}-w-4},3,0,0,1,.,196 rm. +do_render=0 +fi ++shift[background] 0,{round(-13*$|*1.04^$score)},0,0,2 +j. [curr_render],0,0,0,0,1,[curr_render_mask],255 +w. ${"fitscreen .,20%"},0,"[G"{`39`}"MIC] Tetris" rm. cursor[0] 0 +if {*,SPACE} fall_mode=1 fi +if {*,ARROWUP}" || "{*,ARROWLEFT}" || "{*,ARROWRIGHT} +an:={*,ARROWUP}?(n=$n+1;n%4?n:n-4):$n +nx:=w2=int({m$an,w}/2);max(w2,min($x-{*,ARROWLEFT}+{*,ARROWRIGHT},$W-({m$an,w}%2)-w2)) ++j[board] [m$an],{$nx-int({m$an,w}/2)},$y,0,0,-1,[m$an] +if iM==1 x=$nx n=$an fi +rm. +do_render=1 +fi +if {*,ARROWDOWN}" || "$|-$time>0.9^int($score/2)" || "$fall_mode +y+=1 ++j[board] [m$n],{$x-int({m$n,w}/2)},$y,0,0,-1,[m$n] +if iM>1" || "$y+{m$n,h}>$H +if $y<=1 gameover=1 fi +j[board] [curr_board] j[render] [curr_render] n=-1 +fi +rm. +time=$| do_render=1 +fi +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w 0 +#@cli x_threshold +#@cli : Threshold selected images interactively. +x_threshold : +e[^-1] "Threshold image"$_gmic_s" interactively." +foreach { +wsiz0=${"fitscreen ."} +value=-1 +w[] $wsiz0,0,"[G'MIC] "{n}" - Interactive threshold" +0 +for {*}" && "!{*,ESC} { +if [w#1,h#1]!=[{*,w,h}] # Generate image view +rm[1] +slices[0] 50% r. {*,w,h},1,100%,1 w. +fi +mx,my,mb={*,x,y,b} +if $mb" && "$mx>=0" && "$my>=0 +value:="w>h?( dw1 = "{*,w}" - 1; val = (dw1 - "$mx")*100/dw1; ): +( dh1 = "{*,h}" - 1; val = (dh1 - "$my")*100/dh1; )" +update_view=1 +fi +if $update_view +if $value>=0 ++ge[1] $value% *. 255 +to. "Threshold: "{_round($value,0.1)}%,1%,1%,{max(13,3.5*h%)} +w. rm. +else w. +fi +update_view=0 +fi +wait +if {*,r} update_view=1 fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,D} +w[] {{*,w}*1.5},{{*,h}*1.5} wait -1 update_view=1 +fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,C} +w[] {{*,w}/1.5},{{*,h}/1.5} wait -1 update_view=1 +fi +if ({*,CTRLLEFT}" || "{*,CTRLRIGHT})" && "{*,R} +w[] $wsiz0 wait -1 update_view=1 +fi +} +w[] 0 rm. u $value% ge ${} +} +#@cli x_tictactoe +#@cli : Launch tic-tac-toe game. +x_tictactoe : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Tic-Tac-Toe game"$n" -----------------\n +----\n +---- Use "${c}"mouse"$n" to select positions of the\n +---- symbols. Close window to exit game.\n +----\n +-----------------------------------------" +message=0 +counter=0 +player=0 +state=0 +tmp3=0 +tmp2=0 +tmp1=0 +_x_tictactoe2 +w. -1,-1,0," " +do +if $player message="Tic-Tac-Toe (O to play)" +else message="Tic-Tac-Toe (X to play)" +fi +do +w[] {w},{h},0,"[G"{`39`}"MIC] "$message wait +if !{*}" || "{*,ESC}" || "{*,Q} w[] 0 rm return fi +if {*,b}&1" && "{*,x}>20" && "{*,y}>20" && "{*,x}<400" && "{*,y}<400 +tmp3:=int(({*,x}-15)/130) +tmp2:=int(({*,y}-15)/130) +tmp1:=4^($tmp2*3+$tmp3) +if int($state/$tmp1)%4 tmp1=-1 fi +else tmp1=-1 fi +while $tmp1<0 +_x_tictactoe{$player%2} +j... ..,{"130*"$tmp3" + 15+u(-5,5)"},\ +{"130*"$tmp2" + 15+u(-5,5)"},0,0,1,. +rm[-2--1] +w. +state+=(1+$player)*$tmp1 +(21,1344,86016,4161,16644,66576,65793,4368;\ +0,0,0,0,1,2,0,0;\ +0,1,2,0,0,0,0,0;\ +3,3,3,4,4,4,5,6) +repeat w { +tmp1={@$>} +if ($state&$tmp1)==$tmp1||($state&(2*$tmp1))==2*$tmp1 +_x_tictactoe{i($>,3)} +j[-4] ..,{130*{-3,i($>,1)}+u(-5,5)},\ +{130*{-3,i($>,2)}+u(-5,5)},0,0,1,. rm[-2--1] +if ($state&$tmp1)==$tmp1 w.. -1,-1,0,"Tic-Tac-Toe (X won!)" +else w.. -1,-1,0,"Tic-Tac-Toe (O won!)" +fi +do wait +if {*} w[] {*,w},{*,h} fi +while {*}" && "!{*,ESC}" && "!{*,Q} +rm w[] 0 return +fi +} +rm. +player:=($player+1)%2 +counter+=1 +while $counter<9 +w[] -1,-1,0,0,"Tic-Tac-Toe (Tied game!)" +do wait +if {*} w[] {*,w},{*,h} fi +while {*}" && "!{*,ESC}" && "!{*,Q} +w[] 0 rm +_x_tictactoe : +spread. 4 b. 6,1,0 sharpen. 0.8 n. 0,1 +__x_tictactoe : ++f. 1-i +n.. $2,255 +n... $3,255 n[-4] $1,255 a[-4,-2,-1] c +_x_tictactoe0 : +128,128,1,1,1 line. 15%,15%,85%,85%,1,0 line. 15%,85%,85%,15%,1,0 erode. 12 +_x_tictactoe deform. 4 +__x_tictactoe 40,40,160 +_x_tictactoe1 : +128,128,1,1,1 ellipse. 50%,50%,22%,22%,0,1,0 ellipse. 50%,50%,15%,15%,0,1,1 +_x_tictactoe deform. 4 +__x_tictactoe 160,40,160 +_x_tictactoe2 : +391,391,1,1,"!(x%130) || !(y%130)" r. 421,421,1,1,0,0,0.5,0.5 dilate. 3 _x_tictactoe f. 1-i +100%,100% noise. 10 b. 8,0 sharpen. 1.5 n. 220,255 *[-2,-1] to_rgb. +_x_tictactoe3 : +421,130,1,1,1 line. 10%,60%,90%,60%,1,0 erode. 6 +_x_tictactoe rotate. {u(-6,6)},1,1,50%,50% +__x_tictactoe 180,10,10 +_x_tictactoe4 : +_x_tictactoe3 transpose[-2--1] +_x_tictactoe5 : +421,421,1,1,1 line. 10%,10%,90%,90%,1,0 erode. 6 +_x_tictactoe +__x_tictactoe 180,10,10 +_x_tictactoe6 : +421,421,1,1,1 line. 10%,90%,90%,10%,1,0 erode. 6 _x_tictactoe __x_tictactoe 180,10,10 +#@cli x_warp : _nb_keypoints_xgrid>=2,_nb_keypoints_ygrid>=2,_nb_keypoints_contours>=0,_preview_fidelity={ 0:coarsest | 1:coarse | 2:normal | 3:fine | 4:finest },_[background_image],0<=_background_opacity<=1 +#@cli : Launch the interactive image warper. +#@cli : Default values: 'nb_keypoints_xgrid=nb_keypoints_ygrid=2', 'nb_keypoints_contours=0' and 'preview_fidelity=1'. +x_warp : check "isint(${1=2}) && $1>=2 && isint(${2=$1}) && $2>=2 && isint(${3=0}) && $3>=0 && +isint(${4=1}) && $4>=0 && $4<=4 && ${6=0.5}>=0 && $6<=1" skip "${5=}" check_display $0 +if !$! error[0--3] "Command '$0': Requires at least one input image!" return fi +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Interactive image warper"$n" -----------------------------\n +----\n +---- "${c}"Left mouse button"$n": Add and move keypoint.\n +---- "${c}"Right mouse button"$n": Delete keypoint.\n +---- Key '"${c}"SPACE"$n"' or "${c}"middle mouse button"$n": Show/hide keypoints.\n +---- Key '"${c}"TAB"$n"': Change keypoint radius.\n +---- Key '"${c}"SHIFT"$n"': Toggle to original image.\n +---- Key '"${c}"R"$n"': Reset keypoints.\n +---- Keys '"${c}"ESC"$n"', '"${c}"ENTER"$n"' or '"${c}"Q"$n"': Process fullres and exit.\n +----\n +-------------------------------------------------------------" +if ${"is_image_arg $5"} pass$5 store. background fi +radius_keypoints=4 +foreach { +nm={n} => img +if narg($background) $background rr2d. {-2,[w,h]},2,3 store. rbackground fi +selected_keypoint=-1 +view_keypoints=1 +do +if !narg($imgb) +if {*} wdims=${"fitscreen "{*,d},{img,{*,d}*h/w}} +else wdims=${"fitscreen "{img,[w,h,1]},128,60%} +fi +w[] $wdims,0,"[G'MIC] Interactive Warp" ++to_color[img] r. $wdims,1,100%,2 n. 0,255 => imgb +rmn warp,imgw,imgr +fi +if !narg($keypoints) +if narg($__x_warp_keypoints) ($__x_warp_keypoints) r. 1,{w/4},1,4,-1 +else +nbp,nbq=$1,$2 +1,{$nbp*$nbq},1,4,"const nbp = "$nbp"; const nbq = "$nbq"; +p = y%nbp; +q = int(y/nbp); +x = p*100/(nbp - 1); +y = q*100/(nbq - 1); +[ x,y,x,y ]" +nbc=$3 +if $nbc>0 ++b[imgb] 0.5 gradient_norm. sqrt. {round([w,h]/4)} gaussian. 20% +1,$nbc,1,4,"> +begin(ref(crop(#-1),gauss)); +st = stats(#-2); +iM = st[1]; +xM = st[8]; +yM = st[9]; +img = vector(#w#-1*h#-1,-iM); +draw(#-2,img,xM - w#-1/2,yM - h#-1/2,0,0,w#-1,h#-1,1,1,-1,gauss); +nxyM = [ xM,yM ]*100/([w#-2,h#-2]-1); +[ nxyM,nxyM ]" +rm[-3,-2] +a[-2,-1] y +fi +fi +N0:=h => keypoints +rmn warp,imgw,imgr +fi +if !narg($warp) +subsamp:=arg(1+$4,8,6,4,2,1) ++_x_warp_rbf[keypoints] {imgb,round([w,h]/$subsamp)} *. $subsamp +r. {imgb,[w,h]},1,100%,3 +. '[x,y]' +=> warp +rmn imgw,imgr +fi +if !narg($imgw) ++warp[imgb] [warp],0,1,3 => imgw +rmn imgr +fi +if !narg($imgr) +[imgw] +if narg($rbackground) $rbackground ri. .. j.. .,0,0,0,0,$6 rm. fi +=> imgr +if s==4 drgba. fi +if $view_keypoints +eval[keypoints] "* +begin( +col1 = [ 64,200,255 ]; +col2 = [ 255,255,255 ]; +fact = ([ w#"$imgw",h#"$imgw" ] - 1)/100; +const radius1 = "$radius_keypoints"; +const radius2 = radius1 + 2; +const opacity = min(1,3/"($radius_keypoints-1)"); +); +X = round((I)[0,2]*fact); +ellipse(#-1,X,radius2,radius2,0,opacity,0); +ellipse(#-1,X,radius1,radius1,0,opacity,y<"$N0"?col1:col2); I" +fi +w. +fi +wait +mb={*,b} mxy:=[{*,x,y}]*100/([{*,w,h}]-1) mouse_over:={*,x}>=0 +if $mouse_over" && "$mb" && "$selected_keypoint<0" && "h#$keypoints>0 # Determine selected keypoint +selected_keypoint={keypoints,"dmin = inf; kmin = -1; fact = ([w#"$imgr",h#"$imgr"]-1)%; +repeat (h,k, +dist = norm(((I[k])[0,2] - ["$mxy"])*fact); +dist=0 && dmin<"max(8,1.5*$radius_keypoints)"?kmin:-1"} +fi +if {*,-SPACE}" || "$mb==4 view_keypoints:=!$view_keypoints rmn imgr fi +if {*,-R} rmn keypoints __x_warp_keypoints= fi +if {*,-TAB} +radius_keypoints:=max(2,($radius_keypoints+2)%16) view_keypoints=1 rmn imgr +fi +if {*,SHIFTLEFT}" || "{*,SHIFTRIGHT} +if {imgb,s==4} +drgba[imgb] w. rm. else w[imgb] fi +do wait while {*,SHIFTLEFT}" || "{*,SHIFTRIGHT} rmn imgr +fi +if {*,r} rmn imgb fi +if $mouse_over" && "$mb==1" && "$selected_keypoint<0 +wxy={warp,I([$mxy]*([w,h]-1)/100,1)*100/([w,h]-1)} +({"[ "$mxy,$wxy" ]"}) permute. zycx a[keypoints,-1] y +selected_keypoint={keypoints,h-1} +rmn warp +elif $mouse_over" && "$mb==1" && "$selected_keypoint>=0 +({"[ "$mxy" ]"}) permute. zycx j[keypoints] .,0,$selected_keypoint rm. +rmn warp +elif $mouse_over" && "$mb==2" && "$selected_keypoint>=0" && "h#$keypoints>4 # Remove keypoint +1,1,1,4,-1 j[keypoints] .,0,$selected_keypoint rm. discard[keypoints] -1 r[keypoints] 1,{keypoints,h/4},1,4,-1 +N0-={$selected_keypoint<$N0} selected_keypoint=-1 +rmn warp +elif !$mb selected_keypoint=-1 +fi +while {*}" && "!{*,ESC}" && "!{*,Q}" && "!{*,ENTER} +if !$< __x_warp_keypoints={keypoints,^} fi ++drgba[imgw] to. "Processing fullres...",5,5,20,2 w. rm. +k[img,keypoints] +_x_warp_rbf[keypoints] {img,[w,h]} +. '[x,y]' +warp[img] .,0,2,3 rm. => $nm +} +c 0,255 w 0 +_x_warp_rbf : +if !h $1,$2,1,2,[x,y] return fi +$1,$2,1,2,"* +begin( +fact = ([w,h] - 1)/100; +xy(p) = (I[#0,p])[0,2]*fact; +const N = h#0; +ref(vector(#N*N),A); +ref(vector(#N*2),B); +repeat (N,p, +repeat (N,q, A[q + N*p] = A[p + N*q] = norm(xy(p) - xy(q))); +copy(B[2*p],(I[#0,p])[2,2]*fact - xy(p),2); +); +W = solve(A,B,2); +); +res = [ 0,0 ]; +repeat (N,p,res += W[2*p,2]*(norm([x,y] - xy(p)))); +res" +k. +#@cli x_waves +#@cli : Launch the image waves demo. +x_waves : check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Image waves"$n" --------------------------\n +----\n +---- "${c}"Left mouse button"$n" to drop balls.\n +---- "${c}"Right mouse button"$n" to rotate view.\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"CTRL+F"$n"' to switch fullscreen mode.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +---------------------------------------------" +if !$! l[] { +200,200 x:=-1.06-u*0.1 y:=-0.26-u*0.1 +mandelbrot $x,$y,{$x+0.1},{$y+0.1},256 +16,1,1,3,u r. 256,1,1,3,3 shift. 1 +map[0] . rm. r2dx 100 ++mirror y +mirror x + n 0,128 +shape_fern {2*w},70%,25 r2dx. {-2,3*w/4} to_rgb. ri. ..,0,0,0.5,0.5 n. 0,196 +[-2,-1] c. 0,255 +} else k[0] r[0] 100,100,1,3,2 fi +i[0] (20;80;0^20;80;0^20;80;0) r[0] 400,300,1,3,3 water[0] 100,2 +w[0] ${"fitscreen [0],35%"},0,"[G"{`39`}"MIC] Image Waves" +w:=w elevation3d. 0 rv3d. +sh. 8,{7+3*i[6]},0,0 r. 3,{h/3},1,1,-1 +(0,1,0;1,0,1;0,1,0) /. 2 +ball[] 20,200,255,128,1,0.7,3.5 +0 $w,$w . +l3d {$w/2},-200,-1000 sl3d 0.4 ss3d 0.8 f3d 500 time0=$| +do ++convolve. [3],1 -. ... rm... b. 0.8 -. {ia} +r. 1,{$w*$w},1,1,-1 j[2] .,2,0 r. $w,$w,1,1,-1 +[1] +if {5,h} +l[5] { +rows 0,2 +nb:=w +i[0] ('CImg3d') i[1] ($nb,$nb) transpose[2] +(1,0;1,{$nb-1}) r. 2,$nb,1,1,3 round. +1,{4*$nb},1,1,1 y a y +} [4] sprites3d.. .,1 rm. +3d[-2,-1] fi +-3d. {$w/2},{$w/2} *3d. {0,0.9*max(w,h)/$w} +r3d. 0,0,1,{{*,b}&2?{*,x}*360/{*,w}:$|*30} r3d. 1,0,0,120 ++j3d[0] .,50%,65%,30,1,3,0,0 +fps=${-fps} if $fps>0 to. $fps" fps",5,{h-22},16,2,0.2 fi +w. +if {*,CTRLLEFT}" && "{*,D} w[] {2.25*w},{2.25*h} elif {*,CTRLLEFT}" && "{*,C} w[] {1.25*w},{1.25*h} +elif {*,CTRLLEFT}" && "{*,F} +if !narg($is_fs) is_fs={*,w,h} fw:=min({*,u}*h/w,{*,v}*w/h) w[] $fw,{$fw*h/w},0,1 +else w[] $is_fs,0,0 is_fs="" +fi +fi +rm[-2,-1] wait 20 +if {*,b}&1||($|-$time0)>1 ({u*$w};{u*$w};70;0) a[5,-1] x time0:=$|-u fi +if {5,h} l[5,-1] { +sh[0] 2,2,0,0 sh[0] 3,3,0,0 -.. . +. 0.2 rm[-2,-1] +s[0] x repeat $!-1 { coords={$<,@0-1} if {$<,@2}=0 +#@cli : Launch the fractal whirls demo. +#@cli : Default values: 'opacity=0.2'. +x_whirl : check "${1=0.2}>=0" check_display $0 +use_vt100 g=$_vt100_g c=$_vt100_c n=$_vt100_n r=$_vt100_r +e "\n +------ "${g}"Fractal whirls"$n" ----------------------------\n +----\n +---- Keys '"${c}"CTRL+D"$n"' to increase window size.\n +---- Keys '"${c}"CTRL+C"$n"' to reset window size.\n +---- Keys '"${c}"ESC"$n"' or '"${c}"Q"$n"' to exit.\n +----\n +--------------------------------------------------" +5,5,1,3 256,256,1,3 [-1] w. ${"fitscreen 384,384,1,35%"},0,"[G"{`39`}"MIC] Fractal Whirls" +tangle=0 tzoom=0 xc,yc:=(w-{-3,w})/2,(h-{-3,h})/2 +do +rand... 0,255 j.. [-3],$xc,$yc,0,0 +f.. "*begin(R = rot(8*sin(-"$tangle")°)/(1.03+0.02*sin("$tzoom")); C=[w,h]/2); I((R*([x,y]-=C))+=C,0,0)" +tangle+=0.001 +tzoom+=0.02 +j. [-2],0,0,0,0,$1 w. +if {*,CTRLLEFT}" && "{*,D} w[] {3*w},{3*h} elif {*,CTRLLEFT}" && "{*,C} w[] {1.5*w},{1.5*h} fi +wait 20 +while {*}" && "!{*,ESC}" && "!{*,Q} +rm[-3,-2] w[] 0 +gui_crop_preview : +if narg($_preview_x0) z 0$_preview_x0,0$_preview_y0,0$_preview_x1,0$_preview_y1 fi +gui_resize_preview : +if narg($_preview_width) r $_preview_width,$_preview_height,100%,100%,2 fi +gui_resize_preview_area : +if narg($_preview_area_width) r $_preview_area_width,$_preview_area_height,100%,100%,2 fi +gui_crop_resize_preview : +gui_crop_preview gui_resize_preview +gui_preview_wh : +u {0$_preview_area_width?[0$_preview_area_width,0$_preview_area_height]:0$_preview_width?[0$_preview_width,0$_preview_height]:min(w,h)>=256?[w,h]:[400,400]} +gui_parallel_overlap : +apo "$1",$3,{$2?2^($2-1):0} +gui_preview : +frame 1,1,0,0,0,255 montage B +gui_layer_name : +u ${"_gui_merge_layers[0] name,[unnamed]"} +gui_layer_mode : +u ${"_gui_merge_layers[0] mode,alpha"} +gui_layer_opacity : +u ${"_gui_merge_layers[0] opacity,100"} +gui_layer_pos : +u ${"_gui_merge_layers[0] pos,0,0"} +gui_set_layer_name : +foreach { +opacity=${-gui_layer_opacity} mode=${-gui_layer_mode} pos=${-gui_layer_pos} +=> "name($*),mode("$mode"),opacity("$opacity"),pos("$pos")" +} +gui_set_layer_mode : +foreach { +name=${-gui_layer_name} opacity=${-gui_layer_opacity} pos=${-gui_layer_pos} +=> "name("$name"),mode($1),opacity("$opacity"),pos("$pos")" +} +gui_set_layer_opacity : +foreach { +name=${-gui_layer_name} mode=${-gui_layer_mode} pos=${-gui_layer_pos} +=> "name("$name"),mode("$mode"),opacity($1),pos("$pos")" +} +gui_set_layer_pos : +foreach { +name=${-gui_layer_name} mode=${-gui_layer_mode} opacity=${-gui_layer_opacity} +=> "name("$name"),mode("$mode"),opacity("$opacity"),pos("{round("$1")}","{round("$2")}")" +} +gui_merge_layers : +if !$! return fi +mode0=${"_gui_merge_layers. mode,alpha"} +opacity0=${"_gui_merge_layers. opacity,100"} +pos0=${"_gui_merge_layers. pos,0,0"} +if $opacity0<100" || "['$pos0']!='0,0' 100%,100%,1,4 fi +wh0:=w,h +wh=${-max_wh} r. $wh,1,100%,0 +repeat $!-1 { l[-2,-1] { +rv +mode=${"_gui_merge_layers[1] mode,alpha"} +opacity=${"_gui_merge_layers[1] opacity,100"} +pos=${"_gui_merge_layers[1] pos,0,0"} +to_a[1] r[1] $wh,1,100%,0 +shift[1] ${u\ $pos},0,0 +to_colormode[0,1] 0 +blend $mode,{max(0,min(1,$opacity/100))} +} } +r $wh0,1,100%,0 +_gui_merge_layers : +u {`" +str = ["{'{n}'}"]; const sstr = size(str); +def = ['${2--1}']; +ker = ['$1(']; const sker = size(ker); +const N = max(size(str),size(def)); +ref(vectorN(0),res); +p = q = find(str,ker); +p>=0?( +q+=sker; +r = find(str,'),',q); +q = r>=0?r:(str[sstr-1]==_')'?sstr-1:-1); +); +q>=0?copy(res,str[p + sker],q - p - sker):(def = ['${2--1}']; copy(res,def,size(def))); +for (p = 0, p=0, res[p=q++] = 26); +res"`} +gui_split_preview : check "isint(${2=0}) && $2>=0 && $2<=12 && ${5=0}>=0" skip "${3=nan},${4=nan}" +__split_preview="$1" m "_split_preview : run $__split_preview k[0]" +is_movable:=!isnan($3)" && "!isnan($4) +posx,posy:=$is_movable?cut([$3,$4],0,100):[50,50] +pw,ph=${-gui_preview_wh} +foreach { +is_failed=0 ++l { +apply_timeout _split_preview,0$_preview_timeout +onfail +if 0$_is_timeout gui_timeout_preview +else gui_error_preview ${} +fi +is_failed=1 +} +if $is_failed" || "!$2 k. +else +drgba rr2d $pw,$ph,0,2 +r {[max(w#0,w#1),max(h#0,h#1)]},1,100%,0,0,0.5,0.5 +posx,posy:=round([$posx,$posy]*([w,h]-1)%) +if $2==1" || "$2==3 +1,[0],1,1,'y>=$posy?($2==1):($2==3)' r. [0],[0],1,1 j[0] [1],0,0,0,0,1,. +elif $2==2" || "$2==4 +[0],1,1,1,'x>=$posx?($2==2):($2==4)' r. [0],[0],1,1 j[0] [1],0,0,0,0,1,. +elif $2==5 +j[0] [1],0,$posy +elif $2==6 +j[0] [1],$posx +elif $2==7 +j[0] [1],0,{$posy-h} +elif $2==8 +j[0] [1],{$posx-w} +elif $2==9 +if !$posy k. elif $posy>=h k.. else r[0] 100%,$posy,1,100%,0,0,0,0.5 r[1] 100%,{h-$posy},1,100%,0,0,0,0.5 a y fi +elif $2==10 +if !$posx k. elif $posx>=h k.. else r[0] $posx,100%,1,100%,0,0,0.5 r[1] {w-$posx},100%,1,100%,0,0,0.5 a x fi +elif $2==11 +1,[0],1,1,'y>=$posy' [0],1,1,1,'x>=$posx' r[-2,-1] [0],[0],1,1 xor[-2,-1] +j[0] [1],0,0,0,0,1,. +elif $2==12 +1,[0],1,1,'y<=$posy' [0],1,1,1,'x>=$posx' r[-2,-1] [0],[0],1,1 xor[-2,-1] +j[0] [1],0,0,0,0,1,. +fi +k[0] +dir=0 +if isin($2,1,3,5,7,9,11,12) +dir+=1 +line 0,$posy,100%,$posy,0.75,0xF0F0F0F0,255 line 0,$posy,100%,$posy,0.75,0x0F0F0F0F,0 +if $is_movable +coords:=p=[$posx,$posy];[p+[-10,-1],p+[10,-1],p+[0,-11]] +polygon 3,$coords,0.7,255 +polygon 3,$coords,0.7,0xFFFFFFFF,0 +coords:=p=[$posx,$posy];[p+[-10,1],p+[10,1],p+[0,11]] +polygon 3,$coords,0.7,255 +polygon 3,$coords,0.7,0xFFFFFFFF,0 +fi +fi +if isin($2,2,4,6,8,10,11,12) +dir+=2 +line $posx,0,$posx,100%,0.75,0xF0F0F0F0,255 line $posx,0,$posx,100%,0.75,0x0F0F0F0F,0 +if $2!=9" && "$is_movable +coords:=p=[$posx,$posy];[p+[-1,-10],p+[-1,10],p+[-11,0]] +polygon 3,$coords,0.7,255 +polygon 3,$coords,0.7,0xFFFFFFFF,0 +coords:=p=[$posx,$posy];[p+[1,-10],p+[1,10],p+[11,0]] +polygon 3,$coords,0.7,255 +polygon 3,$coords,0.7,0xFFFFFFFF,0 +fi +fi +l[] { +0 +t. "After",0,0,20,1,255 t.. "Before",0,0,20,1,255 +autocrop 0 z[0] {0,[-1,-1,w,h]} z[1] {1,[-1,-1,w,h]} +if isin($2,3,4,7,8,12) rv fi ++dilate[-2,-1] 3 /[-2,-1] 255 r[-4,-3] 100%,100%,1,3 +} +if {-4,"const c1 = "$posx">w+2; const c2 = "$posy">h+2; arg("$dir",c2,c1,c1&&c2)"} +j[0] [-4],2,2,0,0,1,.. +fi +if {-3,"const c1 = "$posx"h+2); arg("$dir",c2,c1,c1&&c2)"} +j[0] [-3],{[w#0-3-w,isin($2,11,12)?2:h#0-3-h]},0,0,1,. +fi +k[0] +fi +} +um _split_preview +gui_print_preview : skip "${1=},${3=}" check "${2=32}>=0 && ${4=20}>=0" +if $! k[0] fi +drgba +siz:=0$_preview_area_width?[0$_preview_area_width,0$_preview_area_height]:0$_preview_width?[0$_preview_width,0$_preview_height]:[${fitscreen\ {[max(w,1),max(h,1),1]},400,800}] +sizw:=arg(1,$siz)-8 +if $! rr2d $siz,2,3 drgba else $siz,1,3,128 fi +(1;0.5^1;0.5^0;1) +(0,0.5,0;0.5,1,0.5;0,0.5,0) *. 0.65 +ri[-2,-1] ...,3 * c 0,255 +l[] { +if ['"$1"']!=0 msg="$1" else msg=" " fi +0 t. $msg,0,0,$2,1,255 i.. 100%,100%,1,3 fc.. 255,200,120 a[-2,-1] c r2dx. {min(w,arg(1,$sizw)-8)} +r. 100%,140%,1,100%,0,0 +onfail rm +} +l[] { +if ['"$3"']!=0 msg="$3" else msg=" " fi +0 t. $msg,0,0,$4,1,255 i.. 100%,100%,1,3,255 a c +('$msg') is_err:="crop(0,4)=='*** '" rm. +if $is_err +x:="ref(crop(0,0,0,3,32,h,1,1),T); +for (c = 32, c$sizw { +x:="const c0 = "$sizw"-1; +const c02 = c0/2; +for (c = c0, c>=c02, --c, max(crop(#-1,c-2,0,0,3,5,h,1,1))<=0?break()); +c=c02, --c, max(crop(#-1,c,0,0,3,1,h,1,1))<=0?break()); +c "mode("$mode"),opacity("$opacity"),pos("{arg(1,$coords)}","{arg(2,$coords)}"),name("$nm")" +} +fx_logo : skip "${1= }" +rm[^0] +w,h=${-gui_preview_wh} +({'"$1"'}) c. 0,127 r. 15,1,1,1,0,2 r. {w/3},1,1,3,-1 n. 0,255 100%,1,1,1,lerp(0,$w-1,x/(w-1)) rv[-2,-1] a[-2,-1] c +rbf. $h transpose. r. $w,$h,1,3,3 +blend alpha,0.5 +to "$1",0.5~,0.5~,10% +fx_support_us : +if $!>0 k[0] fi +gui_print_preview "" +l[] { +filename=${-path_tmp}gmic_donations.png +need_update:="Y = date(0); M = date(1); D = date(2); date_current = Y*365 + M*31 + D; +Y = date(0,'"{/$filename}"'); M = date(1,'"{/$filename}"'); +D = date(2,'"{/$filename}"'); date_file = Y*365 + M*31 + D; +date_current - date_file>=15" +if $need_update i https://gmic.eu/img/donations_latest_months.png o. $filename +else i $filename +fi +0 t. "Latest donations to the G'MIC project:",0,0,24,1,1 rows. 0,120% *. 255 channels. -3,0 +rv a y,0.5 drgba 200 frame 4,4,200 frame 2,2,0 to_rgba +onfail rm +} +if w>w#0" || "h>h#0 rr2d. {-2,[w,h]},0 fi +j.. .,{([w#0,h#0]-[w,h])/2},0,0,0.85 +rm. +gui_download_all_data : +l[] { clut foo rm onfail rm } +_filenames_grain=${-_fx_simulate_grain} +_url_grain=https://gmic.eu/data_film_presets +_prefix_grain=grain_ +_ext_grain=cimgz +_filenames_lightleak=${-_fx_light_leaks} +_url_lightleak=https://gmic.eu/data_lightleaks +_prefix_lightleak= +_ext_lightleak=cimgz +_filenames_sample=${-__sample} +_url_sample=https://gmic.eu/img +_prefix_sample=sample_ +_ext_sample=png +_filenames_demos=gmic_demos +_url_demos=https://gmic.eu/img +_prefix_demos= +_ext_demos=cimgz +_n=0 +_N:=narg($_filenames_grain,$_filenames_lightleak,$_filenames_logo,$_filenames_sample) +progress 0 +_gui_download_all_data[] grain,$1 +_gui_download_all_data[] lightleak,$1 +_gui_download_all_data[] logo,$1 +_gui_download_all_data[] sample,$1 +_gui_download_all_data[] demos,$1 +progress 100 +_gui_download_all_data : +repeat narg(${_filenames_$1}) { +filename=${_prefix_$1}${arg0\ $>,${_filenames_$1}}.${_ext_$1} +e "Download "$filename +if $2" || "!isfile(['{/${-path_cache}$filename}']) l[] { +${_url_$1}/$filename o ${-path_cache}$filename rm onfail +} fi +progress {100*$_n/$_N} +_n+=1 +} +fx_friends : +if $! ratio:=w/h else ratio=1 fi +rm _heart80x73 scale3x r 150%,150%,1,1,0,0,0.5,0.5 ++*. 70 +*.. 110 +*... 255 *[-4] 255 a c +blur_radial 4 sharpen 300 +i.. ${fitratio_wh\ {w},{h},$ratio},1,3 +rand.. 0,255 sh.. 1,2 /. 2 rm. +blur_radial.. 20 sharpen.. 50 +r. ..,..,1,4,0,0,0.5,0.5 blend alpha +143,80,1,1,0 t. "Greetings to\n all G\47MIC\n friends!",2,-2,27,1,1 ++dilate. 3 *.. 255 to_rgb.. j... ..,{[w#-3-w#-2,h#-3-h#-2]/2},0,0,1,. +rm[-2,-1] +_heart80x73 : +40,73,1,1,0 ellipse 22,22,20,20,0,1,1 polygon 3,7,37,42,72,42,27,1,1 +mirror x a x +fx_logo_ca : +fx_logo "per al GIMP\n [ "${-strver}" ]"," per al GIMP\n[ "${-strver}" pre-release ""#"$_prerelease"]" +fx_gmicky : +rm +if !$1 sp gmicky => "name(Gmicky)" +elif $1==1 sp gmicky_mahvin => "name(Gmicky)" +elif $1==2 sp gmicky_wilber => "name(Gmicky & Wilber)" +else sp roddy => "name(Roddy)" +fi +fx_gmicky_preview : +fx_gmicky $* rr2d $_preview_area_width,$_preview_area_height,0,2 +fx_whatsnew_preview : skip "$*" +file=${-path_cache}whatsnew.txt +l[] { +if !isfile(['{/$_path_rc/update$_version.gmic}']) update fi +parse_gui whatsnew +if isfile(['{/$file}']) it $file date={date([0,1,2],['{/$file}']):/} else 0 date={date([0,1,2]):/} fi +utf82html.. utf82html. +if $4 ot.. $file newfilters,delfilters= is_changes=0 +else +newfilters,delfilters= ++- is_changes:=max(abs(im),abs(iM))!=0 rm. +if !w +rm. s -,10 +repeat $! { newfilters.=" - "{$>,t}{`10`} } +elif $is_changes +eval " +ref(vector256(),str0); +ref(vector256(),str1); +for (s0 = s1 = 0, s01 mirror y fi +array_fade $1,$2,$5,$6,$8 +shift -$3%,-$4%,0,0,2 +fx_array_fade_preview : +fx_array_fade $1,$2,$3,$4,$5,$6,$7,0 +fx_array_mirror : skip ${7=0} +if $5==1 mirror x +elif $5==2 mirror y +elif $5==3 rotate 90 +elif $5==4 rotate 180 +elif $5==5 rotate 270 +fi +if $7 +if !$4 columns 0,{100-$7}% +elif $4==1 rows 0,{100-$7}% +elif $4==2 z 0,0,{100-$7}%,{100-$7}% +elif $4==3 z {$7/2}%,{$7/2}%,{100-$7/2}%,{100-$7/2}% +fi +fi +shift -$2%,-$3%,0,0,2 +array_mirror $1,$4,$6 +fx_array_mirror_preview : +fx_array_mirror $1,$2,$3,$4,$5,0,$7 +fx_array_color : +repeat $! { l. { +$1,$2,1,3 rand. 0,255 to_colormode. {-2,s} ri. .. *. $3 *.. {1-$3} +[-2,-1] +} mv. 0 } +fx_array : +shift -$3%,-$4%,0,0,2 +if $5&1 mirror x fi if $5>1 mirror y fi +array $1,$2,$6 +fx_array_preview : +fx_array $1,$2,$3,$4,$5,0 +fx_asciiart : skip "${10=},${11=},${12=}" +foreach { +to_rgb apply_gamma {10^$7} b $8% n 0,255 +if !$1 dict="$2" +elif $1==1 +dict=" 01" +elif $1==2 +dict=" 0123456789" +elif $1==3 +dict=" abcdefghijklmnopqrstuvwxyz" +elif $1==4 +dict=" ABCDEFGHIJKLMNOPQRSTUVWXYZ" +elif $1==5 +dict=" !\042#$%&\047()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\133\\\135^_\140abcdefghijklmnopqrstu""vwxyz\173|\174~" +elif $1==6 +dict=" \16\17\20\21" +elif $1==7 +dict=" \200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231" +fi +if $6==1 negate fi +if $-3 +img2ascii $dict,$3,$4%,$5,"$-2"/"$-1" +else +img2ascii $dict,$3,$4%,$5 +fi +wh=${} +if !$6 k. n 0,255 +elif $6==1 k. negate n 0,255 +elif $6==2" || "$6==3 +r[0] $wh,1,100%,1 +if $9>=7 luminance[0] fi +if $9%7 quantize[0] {arg($9%7,2,3,4,8,12,16)-1},1,0 fi +r[0] [1],[1],1,100% *[0] [1] +if $6==2 rm[1] +else *[1] 255 a c +fi +fi +} +fx_asciiart_preview : +foreach { +w,h={w},{h} +fx_asciiart $1,"$2",${3-9},0,foo,foo +r $w,$h,1,100%,0,0,0.5,0.5 +} +fx_chessboard : +to_rgba chessboard ${1-14} +fx_chessboard_preview : +gui_split_preview "fx_chessboard $*",${-3--1} +fx_dices : +repeat 6 { {2*$2},{2*$2} _dice$> } +if $3%2 negate[-6--1] fi +frame_round[-6--1] 0,0,30%,0.5,128,128,128,0 frame[-6--1] 1,1,128,128,128,0 +r2dy[-6--1] $2 a[-6--1] x +foreach[^-1] { +pass. ++luminance[0] rv[1,2] r[0,1] {100*$1/$2}%,{100*$1/$2}%,1,100%,2 quantize[1] 6,0 +*.. $2 channels.. 0,1 r.. {$2*100}%,{$2*100}% +$2,$2,1,2,"c?y:x" r. ...,...,1,2,0,2 +[-3,-1] +warp. ..,0,0,1 rm... +if $3<2 rm[0] mv. 0 +else r[0] [2],[2],1,100% rv[0,-1] blend[0,-1] multiply +fi +rm. +} +rm. +_dice0 : ellipse. 50%,50%,5.2%,5.2%,0,1,255 +_dice1 : ellipse. 25%,25%,5.2%,5.2%,0,1,255 ellipse. 75%,75%,5.2%,5.2%,0,1,255 +_dice2 : _dice1 _dice0 +_dice3 : _dice1 ellipse. 25%,75%,5.2%,5.2%,0,1,255 ellipse. 75%,25%,5.2%,5.2%,0,1,255 +_dice4 : _dice3 _dice0 +_dice5 : _dice3 ellipse. 25%,50%,5.2%,5.2%,0,1,255 ellipse. 75%,50%,5.2%,5.2%,0,1,255 +_fx_drawn_montage : +nb_layers:=min(16,$!-1) +if !$nb_layers +error="A top layout layer is missing for this filter to make it work properly!" +if $-1 gui_warning_preview $error return +else error $error +fi +fi +pargs,args0,args1,args2,args3,args4,args5,args6,args7,args8,args9,args10,args11,args12,args13,args14,args15=${9-25} +if $1!=$pargs +('${args$1}') replace. {':'},{','} arg_R,arg_G,arg_B,arg_zoom,arg_xcenter,arg_ycenter,arg_angle=${u\ {t}} rm. +else +arg_R,arg_G,arg_B,arg_zoom,arg_xcenter,arg_ycenter,arg_angle=${2-8} +fi +args$1=$arg_R:$arg_G:$arg_B:$arg_zoom:$arg_xcenter:$arg_ycenter:$arg_angle +status=\{$1\}\{$arg_R,$arg_G,$arg_B\}\{$arg_zoom\}\{$arg_xcenter\}\{$arg_ycenter\}\{$arg_angle\}\{$1\}\{$args0\}\{$args1\}\{$args2\}\{$args3\}\{$args4\}\{$args5\}\{$args6\}\{$args7\}\{$args8\}\{$args9\}\{$args10\}\{$args11\}\{$args12\}\{$args13\}\{$args14\}\{$args15\} +c= repeat $nb_layers { +('${args$>}') replace. {':'},{','} R$>,G$>,B$>,zoom$>,xcenter$>,ycenter$>,angle$>=${u\ {t}} +cols=$cols$c${R$>},${G$>},${B$>} c=, rm. rotate[{1+$>}] {90*${angle$>}} +} +to_rgb[0] to_rgba[^0] $nb_layers,1,1,4,[inf,inf,-inf,-inf] [0],[0] +f[0] " +begin(colors = [ "$cols" ]); +repeat ("$nb_layers",l, +I==colors[3*l,3]?( +if (xi(#-2,l,0,0,2), i(#-2,l,0,0,2) = x); +if (y>i(#-2,l,0,0,3), i(#-2,l,0,0,3) = y); +i(#-1,x,y) = l + 1; +); +); I" +thumbnail=0 boundaries=0 +if $-1 +l:=1+$1 +if $l<=$nb_layers +if {$l,w>h} +r2dx[$l] {(0$_preview_area_width?0$_preview_area_width:400)/6} +else +r2dy[$l] {(0$_preview_area_height?0$_preview_area_height:400)/6} fi +frame. 1,1,0,0,0,255 drgba. to. "#"$l,0,-2,13 to_rgba. +mv. -3 +thumbnail=1 +fi ++f. "const boundaries = 1; ref(crop(x - 2,y - 2,5,5),V); if (min(V)==max(V),0,i)" +(0,0,0,$cols) r. 3,{$nb_layers+1},1,1,-1 1,100%,1,1,y?255:0 a[-2,-1] x permute. yzcx map.. . rm. +repeat $nb_layers { +xmin,ymin,xmax,ymax={-3,I[$>]} +if !isinf($xmin)" && "!isinf($ymin)" && "!isinf($xmax)" && "!isinf($ymax) +xc$>,yc$>:=0.5*([$xmin,$ymin]+[$xmax,$ymax]-6)*100/[w,h] +else xc$>,yc$>=-1024 +fi +} +mv. -3 +boundaries=1 +fi +if iM>0 +repeat $nb_layers { +l:=$>+1 xmin,ymin,xmax,ymax={-2,I[$>]} +if !isinf($xmin)" && "!isinf($ymin)" && "!isinf($xmax)" && "!isinf($ymax) +dx,dy:=$xmax-$xmin+1,$ymax-$ymin+1 +nw,nh={$l,round(min(w/$dx,h/$dy)*[$dx,$dy]/(1+3*(${zoom$>}/10)^2))} +r[$l] $nw,$nh,1,100%,0,0,{(100-${xcenter$>})%},{(100-${ycenter$>})%} +r[$l] $dx,$dy,1,100%,6 +else r[$l] 1,1 +fi +} +to_rgba[0] +f[0] " +l = i#-1; +l1 = l - 1; +l<=0?I:( +xmin = i(#-2,l1,0,0,0); +ymin = i(#-2,l1,0,0,1); +rx = x - xmin; +ry = y - ymin; +crop(#l,rx,ry,0,0,1,1,1,4); +)" +fi +rm[-2,-1] +if $boundaries blend[0,-1] alpha fi +if $thumbnail +drgba[0] rr2d[0] ${-gui_preview_wh} +j[0] .,3,3,0,0,0.75 +rm. +fi +if $-1 repeat $nb_layers { to "#"{1+$>},${xc$>}%,${yc$>}%,13,1,0.75 } fi +k[0] c 0,255 +u $status +fx_drawn_montage : +_fx_drawn_montage $*,0 +fx_drawn_montage_preview : +_fx_drawn_montage $*,1 +fx_extract_objects : +if $5 min_area=$5% else min_area=6 fi +foreach { +to_rgba +nm=${-gui_layer_name} +w,h={w},{h} +x,y:=$1%*(w-1),$2%*(h-1) +color:=I($x,$y) +if !$7 ++replace_color $3,0,$color,0,0,0,0 autocrop_components. $4%,$min_area,$6,2 +repeat w { ++z[0] {1,i($>,0)},{1,i($>,1)},{1,i($>,3)},{1,i($>,4)} +=> pos({1,i($>,0)}\,{1,i($>,1)})\,name($nm" "[$>]) +} +rm[0,1] +elif $7==1 +replace_color $3,0,$color,0,0,0,0 ++autocrop_components[0] $4%,$min_area,$6,2 +autocrop_components[0] $4%,$min_area,$6,1 +repeat w { =>[$>] pos({i($>,0)}\,{i($>,1)})\,name($nm" "[$>]) } rm. +fi +$w,$h,1,4 fc. $color => name($nm" [background]") +} +fx_extract_objects_preview : +x0,y0=${1,2} +if $5 min_area=$5% else min_area=5 fi +foreach { +to_rgba +x:=$x0%*(w-1) +y:=$y0%*(h-1) +color:=I($x,$y) ++replace_color $3,0,$color,0,0,0,0 +autocrop_components. $4%,$min_area,$6,2 +repeat w { +xycoords={1,i($>,0)},{1,i($>,1)},{1,i($>,3)},{1,i($>,4)} +rectangle[0] $xycoords,0.3,0,0,255,255 +rectangle[0] $xycoords,1,0xFFFFFFFF,0,0,0,255 +} +drgba[0] +to[0] {w}" objects",2,2,13,2,0.3,255,255,255,255 +k[0] +if $8 +line 0,$y0%,100%,$y0%,0.5,0xF0F0F0F0,255 line 0,$y0%,100%,$y0%,0.5,0x0F0F0F0F,0 +line $x0%,0,$x0%,100%,0.5,0xF0F0F0F0,255 line $x0%,0,$x0%,100%,0.5,0x0F0F0F0F,0 +fi +circle $x,$y,3,1,0,255,0 circle $x,$y,3,1,0xFFFFFFFF,0 +} +fx_imagegrid : +imagegrid $1,$2 +fx_imagegrid_hexagonal : +foreach { +if $3 r 200%,200%,1,100% fi +imagegrid_hexagonal $1,$2 +if $3 r 50%,50%,1,100%,2 fi +} +fx_imagegrid_triangular : +foreach { +split_opacity l[0] { to_rgb imagegrid_triangular ${1-3},{$7/255},${4-6} } +a c +} +fx_loose_photos : +photo_density,photo_max_size,photo_min_size,photo_max_ratio,photo_min_ratio,photo_max_angle,photo_min_angle,frame_size,frame_R,frame_G,frame_B,image_rot_prob,image_max_angle,image_min_angle,background_R,background_G,background_B,background_A,background_image,shadow_opacity,shadow_shift_x,shadow_shift_y,shadow_smoothness=${1-23} +foreach { +nm={n} to_rgba +if narg($_is_preview) srand {date(4)} fi +frame:=$frame_size%*max(w,h)*$photo_max_size% +100%,100% noise_poissondisk. {lerp(100,5,($photo_density%)^0.25)}% +0 eval.. "i?( +const Mwh = max(w,h); +const M_size = Mwh*$photo_max_size%; +const m_size = M_size*$photo_min_size%; +width = u(m_size,M_size); +const M_ratio = $photo_max_ratio%; +const m_ratio = M_ratio*$photo_min_ratio%; +ratio = u(m_ratio,M_ratio); +height = width*ratio; +u<0.5?swap(width,height); +const M_angle = $photo_max_angle; +const m_angle = M_angle*$photo_min_angle%; +angle = u(m_angle,M_angle); +da_push([u, x, y, width, height, angle]) +)" +da_freeze. rm.. sort. +,y channels. 1,100% => coords +[0],[0],1,4 => canvas +repeat h#$coords { +x,y,w,h,ang={coords,I[$>]} +plane3d $w,$h,1,1 col3d. -1 +plane3d {[$w,$h]+2*$frame},1,1 col3d. 255 +c3d[-2,-1] +3d. 0,0,0.1 +3d[-2,-1] r3d. 0,0,1,$ang ++l. { s3d k[2] r. 3,{h/3},1,1,-1 z. 0,1 s x xm,ym,xM,yM:=floor([im#0,im#1]),ceil([iM#0,iM#1]) rm } +{2*([$xM-$xm,$yM-$ym]+1)},1,1,-2 j3d. ..,50%,50%,-100,1,2,0,0,200 rm.. +r. 100%,100%,1,4 +f. "const boundary = 3; +const x0 = int($x - w/4); +const y0 = int($y - h/4); +i>=0?[[i0*$frame_R,i1*$frame_G,i2*$frame_B]/255,i3]: +i==-2?[0,0,0,0]: +I(#0,x0 + x/2,y0 + y/2)" +r2dx. 50% +if u<$image_rot_prob% +rotate. {"const M_angle = $image_max_angle; +const m_angle = M_angle*$image_min_angle%; +(u<0.5?-1:1)*u(m_angle,M_angle)"} +fi +x0,y0,x1,y1:=" +const x0 = floor($x - w/2); +const y0 = floor($y - h/2); +const x1 = x0 + w - 1; +const y1 = y0 + h - 1; +[ x0,y0,x1,y1 ]" +if $shadow_opacity>0 +nx0,ny0,nx1,ny1:=$x0,$y0,$x1,$y1 +shift_x,shift_y={0,round([$shadow_shift_x,$shadow_shift_y]*max(w,h)%)} +sigma:=$shadow_smoothness +if $shift_x>0 nx1+=$shift_x else nx0+=$shift_x fi +if $shift_y>0 ny1+=$shift_y else ny0+=$shift_y fi +if $sigma nx0,ny0,nx1,ny1+=3.5*$sigma*[-1,-1,1,1] fi +z. {p=$nx0-$x0;q=$ny0-$y0;[p,q,p+$nx1-$nx0,q+$ny1-$ny0]} +sh. 100% +b. $sigma% shift. $shift_x,$shift_y n. 0,{$shadow_opacity*255%} max[-2,-1] rm. +else +nx0,ny0=$x0,$y0 +fi ++channels. 100% sh.. 100% f. 255 rm. j[canvas] ..,$nx0,$ny0,0,0,1,.,255 rm[-2,-1] +} +k[0,canvas] => $nm +i[0] 100%,100%,1,4 fc[0] $background_R,$background_G,$background_B,$background_A +if $background_image sh[1] 100% *. {$background_image%} rm. else rm[1] fi +blend alpha +} +fx_loose_photos_preview : +_is_preview=1 +fx_loose_photos $* +fx_make_seamless : +foreach { +if $1 +b {20.5-$1/50}% -[0] [1] fc. ${average_vectors.} + fi +} +periodize_poisson c 0,255 +fx_make_seamless_preview : +u,v:=arg($3,2,1,2,3,4),arg($3,1,2,2,3,4) +gui_split_preview "if !$2 fx_make_seamless $* fi if $3 array "$u","$v" fi",${-3--1} +fx_frame_seamless : +foreach { +if $5 +b {20.5-$5/50}% -[0] [1] fc. ${average_vectors.} + fi +} +frame_seamless ${1-4} c 0,255 +fx_frame_seamless_preview : +u,v:=arg($7,2,1,2,3,4),arg($7,1,2,2,3,4) +gui_split_preview "if !$6 fx_frame_seamless $* fi if $7 array "$u","$v" fi",${-3--1} +fx_ministeck : +foreach { +if w>h r2dx {min($2,w)} else r2dy {min($2,h)} fi +split_opacity l[0] { ++colormap. $1 index.. . +[0],[0],1,1 rand[2] 0,1 dilate[2] $4 +[0,2] +r[0] $3""00%,$3""00% ++g[0] xy,1 !=[-2,-1] 0 +f[0] "i(x+1,y+1)-i(x,y)" !=[-3--1] 0 -|[-3--1] +z[0,-1] 0,0,{w-2},{h-2} +if $7 . fi ++shift. 1,1 *.. -1 +[-2,-1] b. {$6*$3/5} n. -$5,$5 +map[0] [1] rm[1] +[0,-1] +if $7 ==[1] 0 * fi +} r. [0],[0],1,100% a c +} +c 0,255 +fx_ministeck_preview : +foreach { +w,h={w},{h} +fx_ministeck $* +r $w,$h,1,100%,0,0,0.5,0.5 +} +fx_montage : skip "${2=A}" +if !$! return fi +code0=X code1="$2" code2=H code3=V code4=A code5=B +if $3==1" && "$4<0.5 r {max(10,$4*200)}%,{max(10,$4*200)}%,1,100%,2 fi +to_rgba if $14 rv fi if $13%$! mv[{$13%$!}--1] 0 fi +if $11" || "$12 repeat $! { rotate[$>] {$11+u(-$12,$12)},1,0 } fi +montage ${code$1},{!$3?$4:2+max(0,$4-0.5)},$15,"if $""7%2 mirror x fi if $""8%2 mirror y fi ""rotate {90*$""6} ""if $5||$6 ""r {max(1,$""4-2*($5+$6))},{max(1,$""5-2*($5+$6))},1,100%,2 ""frame $6,$6,${7-10} ""r {w+2*$5},{h+2*$5},1,100%,0,0,0.5,0.5 ""else r $""4,$""5,1,100%,2 fi " +if $15 gui_autocrop_layers fi +gui_set_layer_name "[Montage]" +fx_montage_preview : skip "${2=A}" +if !$! return fi +w,h={w},{h} +if $3==1" && "$4<0.5 r {max(10,$4*200)}%,{max(10,$4*200)}%,1,100%,2 fi +drgba +code0=X code1="$2" code2=H code3=V code4=A code5=B +to_rgba if $14 rv fi if $13%$! mv[{$13%$!}--1] 0 fi +if $11" || "$12 repeat $! { rotate[$>] {$11+u(-$12,$12)},1,0 } fi +montage ${code$1},{!$3?$4:2+max(0,$4-0.5)},0,"if $""7%2 mirror x fi if $""8%2 mirror y fi +rotate {90*$""6} +if $5||$6 +r {max(1,$""4-2*($5+$6))},{max(1,$""5-2*($5+$6))},1,100%,2 fs:=min(53,max(w,h)/3) +frame $6,$6,${7-10} +r {w+2*$5},{h+2*$5},1,100%,0,0,0.5,0.5 +0 t. \\\#$""1,0,0,$fs,1,255 expand_xy. 3,0 [-1]x3 a[-4--2] c +dilate. {3+2*$fs/20} a.. .,c j[0] [1],{5+$5+$6},{$5+$6},0,0,1,[2],255 k[0] +else +r $""4,$""5,1,100%,2 fs:=min(53,max(w,h)/3) +0 t. \\\#$""1,0,0,$fs,1,255 expand_xy. 3,0 [-1]x3 a[-4--2] c +dilate. {3+2*$fs/20} a.. .,c j[0] [1],5,0,0,0,1,[2],255 k[0] +fi " +nw,nh:=w,h +resize_ratio2d $w,{$h-16},2,2 +drgba +i[0] 100%,15,1,3,240 t[0] "Estimated size : "{round(100*$nw/$w)}%" x "{round(100*$nh/$h)}%,2,0,16 r[0] 100%,16,1,3,0 +a y +fx_puzzle : +foreach { +w,h={w},{h} to_rgb +puzzle $w,$h,$1,$2,$3,$4,$5 ++b. $6%,0 g. xy +[-2,-1] n. -$7,$7 +[0,-1] ++b. $8%,0 n. 0,1 *. -1 +. 1 n. {(255-$9)/255},1 *[0,-1] c 0,255 +if $10!=100||$11||$12||$13||$14||$15||$16 ++-. 1 label_fg. 0 ++area_fg. 0,0 <. 50% -|... . ==. 0 *[-2,-1] +distance.. 0 *.. -1 watershed. .. rm.. label. 0,0 +repeat iM+1 { ++==[1] $> +coords=${autocrop_coords.\ 0} ++z[0] $coords z.. $coords rv[-2,-1] *.. . *. 255 a[-2,-1] c +x$>,y$>:=arg(1,$coords)+round(w/2),arg(2,$coords)+round(h/2) +} +rm[0,1] +if $14 sort_list +,u fi +if $16 +foreach { +r2dy {max(0.1,$10+$11*v)}% rotate {$12+$13*v} +if $15 expand_xy 1,0 fi +cx,cy:=round([w,h]/2) +sh 100% if $15 dilate. 3 fi +i[0] $w,$h,1,4 +j[0] ..,{${x$>}-$cx},{${y$>}-$cy},0,0,1,.,255 rm[-2,-1] +} +else +i[0] $w,$h,1,{s} +repeat $!-1 { +r2dy. {max(0.1,$10+$11*v)}% rotate. {$12+$13*v} +if $15 expand_xy. 1,0 fi +cx,cy:=round([w,h]/2) +sh. 100% if $15 dilate. 3 fi +j[0] ..,{${x$<}-$cx},{${y$<}-$cy},0,0,1,.,255 rm[-2,-1] +} +fi +else rm. +fi +} +fx_puzzle_preview : +fx_puzzle ${1-15},0 +fx_shuffle_patches_preview : +fx_shuffle_patches $* +gui_crop_resize_preview +fx_shuffle_patches : +mode,recons,patch_size,overlap,overlap_std,seed=${1-6} +foreach { +nm={n} w,h={w},{h} +s c foreach { avg$>,std$>:=ia,id } a c +ps:=min(w,h,$patch_size) +if $recons==1 g xy,1 a c +elif $recons==2 laplacian +fi +img2patches $ps,$overlap%,3 +s z srand $seed +if isin($mode,0,2) sort_list +,u fi +if $mode>0 foreach { rotate {90*round(u(3))} } fi +a z +patches2img $w,$h,$overlap%,$overlap_std% +if $recons==1 s c,2 g.. x,-1,2 g. y,-1,2 + ilaplacian 0 +elif $recons==2 ilaplacian 0 +fi +s c foreach { - {ia} / {id} * ${std$>} + ${avg$>} } a c +c 0,255 +} +fx_taquin : +to_a foreach { srand $11 taquin $1,$2,$3,$4,$5%,$6,${7-10} } +fx_rotate_tileable : +if $3 array_mirror 1,{$3-1},1 fi +rotate_tileable $1,{!$3?$2:$2/2} +fx_rotate_tileable_preview : +l { fx_rotate_tileable $* onfail gui_warning_preview "Invalid image size" } +fx_isolate_tiles : +foreach { +to_rgba +if $5 sx,sy:=round(min(w,h)*max($1,$2)/100) else sx,sy:=round(w*$1/100),round(h*$2/100) fi +if $6 bx:=max($3,$4) by=$bx else bx,by=$3,$4 fi +s x,-$sx +foreach { s y,-$sy r 100%,{100+$by}%,1,100%,0,0,0.5,0.5 a y } +r {100+$bx}%,100%,1,100%,0,0,0.5,0.5 a x +} +_fx_normalize_tiles : +repeat $! { l. { split_tiles $1,$2 n $3,$4 append_tiles $1,$2 } mv. 0 } +fx_normalize_tiles : +ac "_fx_normalize_tiles ${1-4}",$-1 +fx_parameterize_tiles : +if $3 +quadratize_tiles $1,$2 +else +linearize_tiles $1,$2 +fi +c 0,255 +fx_shift_tiles : +to_rgba shift_tiles $1,$2,$3 +if $4<1 repeat $! { s. c *. $4 a[-4--1] c mv. 0 } fi +fx_rotate_tiles : +to_rgba rotate_tiles $3,$1,$2 drop_shadow $4%,$5%,$6% +gcd_aurora : skip ${1=6},${2=1},${3=0} +repeat $! l[$>] +to_rgb +deriche $1%,2,y deriche. $2%,0,x +c. 0,255 n. 0,255 +if $3 blend average else k. fi +done done +fx_crayongraffiti2 : +repeat $! l[$>] split_opacity l[0] ++b $3 hardsketchbw. $1,$2,$4,$5,$6 to_rgb +negate. blur_xy.. $7,$7 reverse +if $8==0 compose_lightness +elif $8==1 compose_value +elif $8==2 fx_compose_colordoping 1,1 fi +done a c done done +fx_crayongraffiti2_preview : +gui_split_preview "fx_crayongraffiti2 ${1--2}",$-1 +fx_bokeh : +_shape=$2 +srand $3 +foreach { +nm=${-gui_layer_name} pos=${-gui_layer_pos} +100%,100%,1,3 +(${4-13};${14-23}) if $1>2 r. 100%,$1,1,1,3 fi +repeat $1 { +rows. $> _fx_bokeh... {^} rm. } +rm. => "name("$nm"),opacity(100),mode(screen),pos("$pos")" +rv +if !0$_output_mode gui_merge_layers +elif 0$_output_mode<2 rm. +fi +} +_fx_bokeh0 : shape_star $1,3 +_fx_bokeh1 : $1,$1,1,1,1 +_fx_bokeh2 : shape_diamond $1 +_fx_bokeh3 : shape_polygon $1,5,45 +_fx_bokeh4 : shape_polygon $1,6,45 +_fx_bokeh5 : shape_polygon $1,8,45 +_fx_bokeh6 : shape_polygon $1,10,45 +_fx_bokeh7 : shape_star $1,5 +_fx_bokeh8 : shape_circle $1 +fx_bokeh_preview : +gui_split_preview "_output_mode=0 fx_bokeh $*",${-3--1} +_fx_bokeh : +radius1:=r=max(w,h)*$2%;r+1-(r%2) +radius2:=r=$radius1-($radius1*$3%);r+1-(r%2) +random3d $1 *3d. {-2,w},{-2,h},0 +_fx_bokeh$_shape $radius1 +if $radius2>=1 _fx_bokeh$_shape $radius2 ri. ..,0,0,0.5,0.5 *. {max(0,min(1,1-$4))} -[-2,-1] fi +sigma={-3,$5%*w} +r. {w+5*$sigma},{h+5*$sigma},1,1,0,0,0.5,0.5 +b. $sigma,0 n. 0,255 +sprites3d[1] [2],1 rm[2] +l. { +s3d r.. 3,{-2,h/3},1,1,-1 s.. x +d:=$10*255 +rand[-4] {$6-$d},{$6+$d} +rand... {$7-$d},{$7+$d} +rand.. {$8-$d},{$8+$d} +a[-4--2] x c.. 0,255 y a y +} +j3d[0] [1],0,0,0,{$9/255},1,0,0 rm[1] +fx_brushify : +_fx_brushify $* +s0=0--3 s1=1--2 s2=0--2 +l[${s{!$1?0:$1==1?1:2}},-1] { brushify[^-1] .,$3,{$5%},$6,$9,$10,$11,$12%,$13,$14,$15,$16,$17,$18 rm. } +_fx_brushify : +N:=0.9*$4 +if !$1 +autocrop. i.. 100%,100%,1,3,1 blend[-2,-1] alpha rr2d. $N,$N,0,3 +elif $1==1 +autocrop[0] i.. 100%,100%,1,3,1 blend[-2,-1] alpha rr2d. $N,$N,0,3 +elif $1==2 $4,$4 rectangle. 10%,10%,90%,90%,1,1 +elif $1==3 shape_diamond. $N +elif $1==4 shape_polygon $N,5 +elif $1==5 shape_polygon $N,6 +elif $1==6 shape_polygon $N,8 +elif $1==7 shape_circle. $N +elif $1==8 $4,$4 gaussian. 30%,30%,0 +elif $1==9 shape_star $N +elif $1==10 shape_heart $N +fi +norm. r. 100%,{max(0.01,100*$2)}%,1,1,2 r. $4,$4,1,1,0,0,0.5,0.5 +spread. $7 b. $8% n. 0,1 +fx_brushify_preview : +if $1<2" && "$!<2 +gui_error_preview "When a custom brush (bottom or top layer) is specified, at least two layers are required +for this filter to work.In this case, don't forget to set the 'Input layers' option!" +return +fi +fx_brushify $* +if $19 +_fx_brushify $* +if !$1 rm.. elif $1==1 rm[0] fi +rr2d. {0,max(1,w/5)},{0,max(1,h/5)},0,2 n. 0,255 +frame. 3,3,0 frame. 1,1,255 frame. 1,1,0 +to_rgb. to. "Brush",4,2,13,2,1,255,255,0 to_a. +j[^-1] .,2,2 rm. +else +if !$1 rm. elif $1==1 rm[0] fi +fi +fx_cartoon_preview : +gui_split_preview "cartoon $*",${-3--1} +fx_circle_abstraction : +foreach { +b $4% ++colormap $1 index[0] [1],0,0 +[0],[0],1,4,0 +repeat $1 { +rprogress {$>*100/$1} ++==[0] $> +skeleton3d. 2,2,0,1,0 +if {@7} +s3d. l[-6--1] { +r[2] 3,{2,h/3},1,1,-1 +1,{2,h/2*$2%},1,1,1 r. 1,{2,h/2},1,1,4 r. 3,200% *[2,-1] y +} +a[-6--1] y col3d. {1,I($>)} +[0],[0],1,4,0 +j3d. ..,0,0,0,1,{1+$5},0,0 +sh. 3 col3d... 255 j3d. ...,0,0,0,$3,{1+$5},0,0 rm. +rm.. +blend[2,-1] alpha +fi +} +k[2] +if $6 +channels 3 <. 1 inpaint[0] [1],0,1 rm. channels. 0,2 fi +if $7 n 0,255 fi +rprogress 100 +} +fx_circle_abstraction_preview : +gui_split_preview "fx_circle_abstraction $*",${-3--1} +fx_ColorAbstractionPaint : +to_rgb +pAbstraction=$1 +EllipseRatio=$2 +ValueOpacity=$3 +UseHue=$4 +MultiplyOpacity=$5 +UseSaturation=$6 +GrainMergeOpacity=$7 +NCA=$8 +CubeIt=$9 +KuwaIt=$10 +Soften=$11 +SoftenAll=$12 +DoNotCompose=$13 +ReverseOrder0=1 +ReverseOrder1=1 +ReverseOrder2=1 +eSmoothness=1 +eOpacity=0.8 +eOutline=1 +eDensity={1.5*$eSmoothness/10} +pDetailsScale={$pAbstraction/2} +pColor=1.5 +pSmoothness={10*$pAbstraction} +eSmoothness={10+($pAbstraction-1)*(1-10)/(10-1)} +ePrimaryRadius={0,($pAbstraction/5)*($pAbstraction/5)*sqrt(h)} +eSecondaryRadius={$EllipseRatio/100*$ePrimaryRadius} +cAbstraction={2+($pAbstraction-1)*(10-2)/(10-1)} +CubeSize={4+($pAbstraction-1)*(10-4)/(10-1)} ++fx_ellipsionism[0] $ePrimaryRadius,$eSecondaryRadius,$eSmoothness,$eOpacity,1,$eDensity,0 +if $SoftenAll==1" && "$Soften>0 b. $Soften,0 fi ++fx_painting[0] $pAbstraction,$pDetailsScale,$pColor,$pSmoothness,1,0 +if $KuwaIt==1 fx_kuwahara. 2,$pAbstraction,0,0 fi +if $Soften>0 b. $Soften,0 fi ++fx_color_abstraction[0] $cAbstraction,45,0.35,0 +if $NCA==1 negate. fi +if $CubeIt==1 cubism. 600,$CubeSize,40,0.7,0 fi +if $Soften>0 b. $Soften,0 fi +if $DoNotCompose==0 +blend[0,1] value,$ValueOpacity,$ReverseOrder0 +if $MultiplyOpacity<0 +ReverseOrder1=0 +MultiplyOpacity={-1*$MultiplyOpacity} +fi +if $UseHue==0 +blend[0,1] multiply,$MultiplyOpacity,$ReverseOrder1 +elif $UseHue==1 +blend[0,1] hue,$MultiplyOpacity,$ReverseOrder1 +fi +if $GrainMergeOpacity<0 +ReverseOrder2=0 +GrainMergeOpacity={-1*$GrainMergeOpacity} +fi +if $UseSaturation==0 +blend[0,1] grainmerge,$GrainMergeOpacity,$ReverseOrder2 +elif $UseSaturation==1 +blend[0,1] saturation,$GrainMergeOpacity,$ReverseOrder2 +fi +k[0] +fi +if $DoNotCompose==1 rm[0] fi +fx_ColorAbstractionPaint_Preview : +gui_split_preview "fx_ColorAbstractionPaint ${1--2}",$-1 +fx_cpencil : +repeat $! l[$>] split_opacity l[0] ++pencilbw $1,$2 blur_xy. 0.4,0.4 +quantize.. $3 n 0,255 to_rgb +blur_xy.. $4,$4 +if $5==0 fx_compose_colordoping $6,0 +elif $5==1 fx_compose_darken $6,1 +elif $5==2 fx_compose_hardlight $6,0 +elif $5==3 fx_compose_grainmerge $6,0 +elif $5==4 fx_compose_lightness $6,1 +elif $5==5 fx_compose_multiply $6,0 +elif $5==6 fx_compose_softlight $6,0 +elif $5==7 fx_compose_value $6,1 fi +done a c done done +fx_cpencil_preview : +gui_split_preview "fx_cpencil ${1--2}",$-1 +cl_comic : +_output_mode=0 +foreach { +simplif=$1 +nbBilatBord=$2 +methBord=$3 +methDesat=$4 +lineThick=$5 +forceTrait=$6 +antialias=$7 +addColors=$8 +augmLum=$9 +augmSat=$10 +nbBilatFin=$11 +colorEffect=$12 +flatColorEffect=$13 +bw=$14 +reliefEffect=$15 +specialEffect=$16 +finalAntialias=$17 +if $simplif==2 +fx_smooth_antialias. 100,0,2.5,0,50,50 +elif $simplif==3 +fx_smooth_antialias. 100,0,5,0,50,50 +elif $simplif==4 +fx_smooth_median. 3,255,0,0,50,50 +elif $simplif==5 +jeje_denoise_iuwt. 3,4,2,0 +jeje_denoise_iuwt. 3,4,2,0 +elif $simplif==6 +fx_smooth_anisotropic. 60,0.9,0.64,3.1,1.1,0.8,30,2,0,1,1,0,0,24 +elif $simplif==7 +meancurvature_flow. 20 +fi +curv="0,0,"{50-$augmLum}","{50+$augmLum}",100,100,-1,0,0,"{50-$augmSat}","{50+$augmSat}",100,100,-1,0,0,100,100,-1,0,0,100,100,-1" ++fx_curves_interactive. 7,0,1,"7",$curv +fx_smooth_nlmeans.. 4,4,10,5,0,0,24,0 +fx_smooth_bilateral.. 10,7,$nbBilatBord,0,0 ++cut.. 0,255 +reverse[-2,-1] +if $methBord==0 +blur[-3] {$lineThick} +elif $methBord==1 +boxfilter[-3] xy,{$lineThick+0.01} +elif $methBord==2 +median[-3] {($lineThick+0.01)*2} +fi +sub[-3,-2] +if $methDesat==0 +fill.. "m = min(R,G,B); M = max(R,G,B); L = 0.5*(m + M); [L, L, L]" +elif $methDesat==1 +fill.. "M = max(R,G,B); [M, M, M]" +elif $methDesat==2 +fill.. "M = min(R,G,B); [M, M, M]" +fi +cut.. 0,255 n.. 0,255 +negate.. +threshold.. {$forceTrait+80}% +n.. 0,255 +if $simplif>0 +fx_smooth_antialias.. 100,0,2.5,0,50,50 +fx_curves_interactive.. 7,0,1,"7","0,0,69,0,70,100,100,100,-1,0,0,100,0,-1,0,0,100,100,-1,0,0,100,100,-1" +fi +fx_smooth_antialias.. $antialias,0,1,0,50,50 +if $addColors==1 +mul[-2,-1] +n. 0,255 +fx_smooth_bilateral. 10,7,$nbBilatFin,0,0 +if $colorEffect==1 +fx_custom_transform. "i","if(i<64,0, sqrt((i-64)/(256-64))*256 )","i","i","i","i",0 +elif $colorEffect==2 +fx_LCE. 80,0.5,1,1,0,0 +elif $colorEffect==3 +remove_opacity. +rgb2hsv. split. c =>. val =>.. sat =>... hue ++mul[val] [sat] =>. ref +sqrt[ref] ++sub[ref] 1 =>. subRef +sub[val] 1 *[val] [subRef] negate[val] +sub[sat] 1 *[sat] [subRef] negate[sat] +rm[ref] rm[subRef] +append[-3--1] c +hsv2rgb. +fi +if $flatColorEffect==1 +(255,0,0,0,0,0,0,0,0,0,0,64,128,192,255,255,255,255,255,255,255,255,255,192,128,64^255,0,0,64,128,192,255,255,255,255,255,255,255,255,255,192,128,64,0,0,0,0,0,0,0,0^255,0,255,255,255,255,255,192,128,64,0,0,0,0,0,0,0,0,0,64,128,192,255,255,255,255) +remove_opacity.. +index.. [-1],0,1 +rm. +fx_smooth_antialias. 15,0,1,0,50,50 +elif $flatColorEffect==2 +otsu. 256 n. 0,255 +fx_smooth_antialias. 15,0,1,0,50,50 +elif $flatColorEffect==3 +fx_posterize. 150,30,1,32,0,0,0,0,50,50 +fx_custom_transform. "i","if(i<64,0, sqrt((i-64)/(256-64))*256 )","i","i","i","i",0 +elif $flatColorEffect==4 +if s==4 split_opacity. rm. fi ++colormap. 8 +index.. [-1],0,1 +rm. +rgb2hsl. split. c +n. 0,1 +append c hsl2rgb +fi +remove_opacity. +if $bw==1 +fx_curves_interactive. 7,0,1,"7","0,0,16,100,100,100,-1,0,0,100,0,-1,0,0,100,100,-1,0,0,100,100,-1" +elif $bw==2 +fx_blackandwhite. 0.299,0,0.587,0,0.114,0,0,0,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0,50,50 +threshold. 33% n 0,255 +fx_smooth_antialias. 100,0.5,5,0,50,50 +fx_smooth_antialias. 100,0.5,5,0,50,50 +elif $bw==3 +fx_blackandwhite. 0.299,0,0.587,0,0.114,0,0,0,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0,50,50 +otsu 4 +n 0,255 +fi +else +remove[-1] +fi +if $reliefEffect==1 ++fx_curves_interactive. 7,0,1,"7","0,0,16,100,100,100,-1,0,0,100,0,-1,0,0,100,100,-1,0,0,100,100,-1" +l. +b. 3 +gradient2rgb. 0 n. 0,255 +[-1] +rgb2hsv[-2,-1] split[-2,-1] c +l[-3--1] +[-3] {315} %[-3] 360 done +l[-6--4] +[-3] {135} %[-3] 360 done +l[-3--1] a c hsv2rgb s c done +l[-6--4] a c hsv2rgb s c done +rm[^-6,-3] +negate.. +/ 2 ++. 128 +blend grainmerge,1 +done +to_rgb +blend grainmerge,1 +elif $reliefEffect==2 +fx_frame. 0,100,0,100,0,0,255,255,255,255,2,0,0,0,255 +fx_custom_transform. "i","if(i<64,0, sqrt((i-64)/(256-64))*256 )","i","i","i","i",0 +fx_illuminate_shape2d. 0,0,0,0,0,255,1,1,4,0,0,3,1,1,4,10,75,30,40,40,80,0.2,1,0,0,-2,-2,2,0,0,0 +crop. 2,2,{w-4},{h-4} +fi +if $specialEffect==1 ++blur. 12.5 +add[-2,-1] *. 0.8 add. 40 +cut. 0,255 +fx_smooth_antialias. 100,2,5,0,50,50 +fx_frame_fuzzy. 12,12,30,5,255,255,255,255 +jeje_clouds. 50,0.5 +elif $specialEffect==2 +fx_curves_interactive. 7,0,1,"7","0,0,100,100,-1,0,0,65,35,100,100,-1,0,0,50,50,100,100,-1,0,0,100,100,-1" +fx_stripes_y. 4,0,0,0,50,50 +fx_simulate_grain. 0,1,0.2,100,0,0,0,0,0,0,0,0,0 +fx_dirty. 1,1,0,0,0,50,50 +elif $specialEffect==3 ++fx_smooth_antialias. 100,0,5,0,50,50 +fx_smooth_antialias. 100,0,5,0,50,50 +fx_smooth_antialias. 100,0,5,0,50,50 +fx_hardsketchbw. 80,100,1,0.1,50,0,0,0,50,50 +fx_smooth_antialias. 100,0,5,0,50,50 +fx_smooth_antialias. 100,0,5,0,50,50 +otsu. 4 n. 0,255 +fx_smooth_antialias. 15,0,1,0,50,50 +fx_smooth_antialias. 50,50,2.5,0,50,50 +blur.. 10 +fx_smooth_bilateral.. 10,7,6,0,0 +mul[-2,-1] n. 0,255 +fi +if $finalAntialias==1 +fx_smooth_antialias 50,50,2.5,0,50,50 +elif $finalAntialias==2 +fx_smooth_antialias. 15,0,1,0,50,50 +fx_smooth_antialias 50,50,2.5,0,50,50 +fi +} +cl_comic_preview : +gui_split_preview "cl_comic $*",${-3--1} +fx_cubism : +repeat $1 { cubism ${2--1} } +fx_cubism_preview : +gui_split_preview "fx_cubism $*",${-3--1} +fx_cutout : +foreach { +split_opacity l[0] { +median {10-$3} +quantize $1 ++luminance. round. area. 0,1 med:=ic rm. +inpaint_holes {$med*$2%},0,1 +if $4 n 0,255 fi +} +a c +} +fx_cutout_preview : +gui_split_preview "fx_cutout $*",${-3--1} +fx_diffusiontensors : +foreach { +wh:=w,h ++diffusiontensors ${5-8} +r2dx. {max(1,w*$1%)} +dt. {round(125/max(1,$1))},$2,{$3<3?$3:0},$4 +if $3==3 +remove_opacity.. r.. .,.,1,100%,3 blend[0] [1],shapeaverage0 dilate. {1+2*$4} a c +else k. fi +r. $wh,1,100%,2 +} +fx_diffusiontensors_preview : +gui_split_preview "fx_diffusiontensors $*",${-3--1} +fx_doodle : skip "$*" +foreach { +b $2 n 0,255 structuretensors b $3 +100%,100%,1,1,100 +if $7 w. ${"fitscreen ."},"[G'MIC] Doodle" fi +_stopflag=0 +eval " +const dt = 0.5; +nb_strokes = nb_consecutive_fails = 0; +while (nb_consecutive_fails<500*$1%, +run('+store. canvas'); +P0 = u([w,h] - 1); +length = 0; +repeat (2,dir, +P = P0; +oiP = iP = round(P); +C = I(#0,P); E = eig([ C[0], C[1], C[1], C[2] ]); oV = V = (dir?1:-1)*E[4,2]; +while (E[0]>$4^2 && (i(iP)>$5 || oiP==iP), +i(iP) = 0; +oiP = iP; +P+=dt*V; +iP = round(P); +C = I(#0,P,1); E = eig([ C[0], C[1], C[1], C[2] ]); V = E[4,2]; +dot(oV,V)<0?(V*=-1); +oV = V; +iP!=oiP?++length; +); +); +length<$6?(run('rm. $canvas'); ++nb_consecutive_fails):( +!(++nb_strokes%15)?run('distance. 0'); +nb_consecutive_fails = 0; +$7 && !(nb_strokes%30)?( +nb_consecutive_fails = run('if !{*} u inf else +neq. 0 r. {*,w,h},1,1,2 w. rm. u 0 fi') +); +) +)" +k. != 0 * 255 +} +fx_dreamsmooth : +m "MergeChoise : $""=_mode" MergeChoise "add","alpha","and","average","blue","burn","darken","difference","divide","dodge","exclusion","freeze","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor","edges","error" +to_color +Iterations=$1 +Eqa=$2 +MergingOption=$3 +Opacity=$4 +ReverseOrder=$5 +Smoothness=$6 +Threads=$7 +Overlap=$8 +repeat $! l[$>] split_opacity l[0] +repeat $Iterations +IWidth={0,round(w/($<+1))} +IHeight={0,round(h/($<+1))} +if $>!=0 +r. $IWidth,$IHeight,1,3,5,1 +fi ++r[0] $IWidth,$IHeight,1,3,5,1 +fx_smooth_anisotropic. {430/$Iterations*($<+1)},0.4,0.5,0.6,2,0.8,30,2,0,0,1,0,$Threads,$Overlap,0 +fx_smooth_anisotropic. {600/$Iterations*($<+1)},0.4,1,0.6,4,0.8,15,5,0,1,1,0,$Threads,$Overlap,0 +if $>!=0 +if $3!=42 +blend[-1,-2] ${_mode{$MergingOption+1}},$Opacity,$ReverseOrder +fi +if $3==42 +blend_edges[-1,-2] $Opacity,$Smoothness,$ReverseOrder +fi +if $Eqa +equalize. 256 +fi +fi +done +k. +done a c done done +fx_dreamsmooth_preview : +gui_split_preview "fx_dreamsmooth ${1--2}",$-1 +fx_ellipsionism : +ellipsionism ${^0} +fx_ellipsionism_preview : +gui_split_preview "fx_ellipsionism $*",${-3--1} +fx_feltpen : +foreach { +fx_hardsketchbw ${1-5},0,0 blend hardlight erode_oct $6 } +fx_feltpen_preview : +gui_split_preview "fx_feltpen $*",${-3--1} +gtutor_fpaint : +repeat $! +l[$>] +hasalpha={s>3} +if $hasalpha +split_opacity. +rv[-2,-1] +fi +lh={h} ++b. {$1/1.25}% +if $4 ++luminance. +rgb2hsl.. +s.. c +rm[-4,-2] +quantize[-2,-1] {round(5+15*(1-$1))},1,1 +gradient_norm[-2,-1] +n[-2,-1] 0,255 ++[-2,-1] +else +quantize. {round(5+15*(1-$1))},1,1 +gradient_norm. +n. 0,255 +fi +threshold. {80-60*$2}% +dilate_circ. 8 +thinning. +dilate_circ. 3 ++diffusiontensors. 0.1,0.85,0.3,{4+8*$1} +if $2<1 +. +r2dy[-3,-1] {$lh*(0.25+0.75*$2)},5 +repeat 2 +smooth... .,{400*(1-$2)} +done +rm. +r.. ...,...,..,..,5,0 +fi +eigen. +s.. c +fill_color... {1-0.15*$3} +fill_color.. {0.15*$3} +a[-3,-2] c +eigen2tensor[-2,-1] +98%,98%,1,1 noise. {20-10*$3},2 ==. 1 +r. ..,..,.,.,0,0,0.5,0.5,0.5,0.5 +to_rgb. +*. [-4] ++ac[-4] "* 0.6","hsl_s" +ac. "* 0.85","hsl_l" +repeat 2 +smooth[-2,-1] ...,{100*(6-5*$2)} +done ++luminance.. +n. 0,0.7 ++n[-5] 0,1 ++[-2,-1] +n. 0,1 +blend[-3,-2] add +gradient. +a[-2,-1] c +100%,100%,1,2 +if $6 +fill_color. {cos(2*((180+$5)%360)*pi/360)},{sin(2*((180+$5)%360)*pi/360)} ++*[-2,-1] +compose_channels. + +cut. {ia},{iM} +n. 0,1 +to_rgb. +*. [-7] +negate. +n. 0,255 +blend[-4,-1] multiply,$6 +fi +if $7 +fill_color. {cos(2*$5*pi/360)},{sin(2*$5*pi/360)} ++*[-2,-1] +compose_channels. + +cut. {ia},{iM} +n. 0,1 +to_rgb. +*. [-7] +n. 0,255 +blend[-4,-1] screen,$7 +fi +if $8 +fill_color. {cos(2*$5*pi/360)},{sin(2*$5*pi/360)} ++*[-2,-1] +compose_channels. + +cut. {ia},{iM} +to_rgb. +n. 0,255 +blend[-4,-1] screen,$8 +fi +rm[-1,-2,-4,-5,-6] +ac. "apply_curve 1,0,32,127,180,255,255","hsl_s" +apply_gamma. 1.4 +if $hasalpha +rv[-2,-1] +a[-2,-1] c +fi +done +done +gtutor_fpaint_preview : +gui_split_preview "gtutor_fpaint ${^0}",$-1 +fx_ghost : +foreach { +split_opacity l[0] { +diffusiontensors. 1,1,$2,$3 eigen. compose_channels.. + sqrt.. n.. 1,100 ^.. $4 n.. 0,$1 +100%,100% +eval.. "* +ca = i(x,y,0,0); +sa = i(x,y,0,1); +N = i(#-3,x,y); +x0 = x + N*ca; +y0 = y + N*sa; +x1 = x - N*ca; +y1 = y - N*sa; +polygon(#-1,2,x0,y0,x1,y1,-1,1); +I" +k. normalize_local $5,$6 +n 0,255 if $7 negate fi +} +a c +} +fx_ghost_preview : +gui_split_preview "fx_ghost $*",${-3--1} +fx_graphic_boost4 : +repeat $! l[$>] split_opacity l[0] +fx_unsharp 1,$1,30,3,0,$2,0.40,1,0,0,0 +if $3==1 break fi ++fx_pencilbw $4,$5,0,0,0 +if $6==1 k. break fi +if $7==1 fx_smooth_anisotropic[1] 60,$8,$9,$10,1.1,0.8,30,2,0,1,1,0 fi +if $11==1 k. break fi +if $12==1 reverse fi +if $13==0 fx_compose_hardlight $14,0 +elif $13==1 fx_compose_grainmerge $14,0 +elif $13==2 fx_compose_multiply $14,0 +elif $13==3 fx_compose_colorburn $14,0 +elif $13==4 fx_compose_overlay $14,0 +elif $13==5 fx_compose_value $14,1 +elif $13==6 fx_compose_darken $14,0 +elif $13==7 fx_compose_lightness $14,1 +elif $13==8 fx_compose_luminance $14,1 +elif $13==9 fx_compose_colordoping $14,0 +elif $13==10 fx_compose_comix_color $14,0,$15 +elif $13==11 fx_compose_graphicolor $14,0,$15 +elif $13==12 fx_compose_graphixcolor $14,0 +elif $13==13 fx_compose_vividedges $14,0.50,0,$15 +elif $13==14 fx_compose_darkedges $14,0.50,0,$15 +elif $13==15 fx_compose_vividscreen $14,0,$15 +elif $13==16 fx_compose_darkscreen $14,0,$15 +elif $13==17 fx_compose_interpolation $14,0 fi +if $16==1 fx_smooth_anisotropic 60,$17,$18,$19,1.1,0.8,30,2,0,1,1,0 fi +done a c done done +fx_graphic_novelfxl : +repeat $! l[$>] split_opacity l[0] +if $1==0 fx_normalize_local $2,$3,$4,$5,1,3,0 fi +if $6==0 +fx_pencilbw $7,$8,0,0,0 fi +if $9==1 k. break fi +if $10==1 fx_smooth_anisotropic. 60,$11,$12,$13,1.1,0.8,30,2,0,1,1,0 fi +if $14==1 k. break fi +if $15==1 reverse fi +if $16==0 fx_compose_overlay $17,0 +elif $16==1 fx_compose_multiply $17,0 +elif $16==2 fx_compose_softlight $17,0 +elif $16==3 fx_compose_colorburn $17,0 +elif $16==4 fx_compose_darken $17,0 +elif $16==5 fx_compose_stamp $17,0 +elif $16==6 fx_compose_hardlight $17,0 +elif $16==7 fx_compose_value $17,1 +elif $16==8 fx_compose_grainmerge $17,0 +elif $16==9 fx_compose_freeze $17,0 +elif $16==10 fx_compose_lightness $17,1 +elif $16==11 fx_compose_luminance $17,1 +elif $16==12 fx_compose_colordoping $17,0 +elif $16==13 fx_compose_comix_color $17,0,$18 +elif $16==14 fx_compose_graphicolor $17,0,$18 +elif $16==15 fx_compose_graphixcolor $17,0 +elif $16==16 fx_compose_vividedges $17,0.50,0,$18 +elif $16==17 fx_compose_darkedges $17,0.50,0,$18 +elif $16==18 fx_compose_vividscreen $17,0,$18 +elif $16==19 fx_compose_darkscreen $17,0,$18 +elif $16==20 fx_compose_interpolation $17,0 fi +if $19==1 fx_smooth_anisotropic 60,$20,$21,$22,1.1,0.8,30,2,0,1,1,0 fi +done a c done done +fx_hardsketchbw : +b $3 +if $7==4 foreach { +hardsketchbw $1,$2,$4,$5,$6 blend hardlight } return fi +hardsketchbw $1,$2,$4,$5,$6 +if $7&1 negate fi +if $7==2 r 100%,100%,1,4 repeat $! { sh[$>] 3 *. -2 +. {2*255} c. 0,255 rm. } +elif $7==3 r 100%,100%,1,4 repeat $! { sh[$>] 3 *. 2 c. 0,255 rm. } +fi +fx_hardsketchbw_preview : +gui_split_preview "fx_hardsketchbw $*",${-3--1} +fx_highlight_bloom : +foreach { +split_opacity l[0] { ++smooth $2,0.3,0.8,1,2 +-.. . +amp=$3 do smooth. {min(50,$amp)},0.1,1,1,2 amp-=50 while $amp>0 ++retinex. 16,lab,0,15 j.. .,0,0,0,0,{$4%} rm. +ac. "normalize_local {$5%},5",lab_l +*.. {$1%} ++ c 0,255 +} +a c +} +fx_highlight_bloom_preview : +gui_split_preview "fx_highlight_bloom $*",${-3--1} +fx_poster_hope : +foreach { +split_opacity l[0] { apply_gamma {10^$1} poster_hope $2 } a c +} +fx_poster_hope_preview : +gui_split_preview "fx_poster_hope $*",${-3--1} +fx_houghsketchbw : +b $1 n 0,255 +if $6==4 foreach { +houghsketchbw ${2-5} blend hardlight } return fi +houghsketchbw ${2-5} +if $6&1 negate fi +if $6==2 r 100%,100%,1,4 repeat $! { sh[$>] 3 *. -2 +. {2*255} c. 0,255 rm. } +elif $6==3 r 100%,100%,1,4 repeat $! { sh[$>] 3 *. 2 c. 0,255 rm. } +fi +fx_houghsketchbw_preview : +gui_split_preview "fx_houghsketchbw $*",${-3--1} +fx_illustration_look : +foreach { +nm=${-gui_layer_name} +to_rgb => base_layer ++fx_smooth_anisotropic[base_layer] 20,0.16,0.63,0.6,2.35,0.8,30,2,0,1,1,0,1,24 => blur_layer ++blend[base_layer,blur_layer] grainextract => detail_layer +if $3 rgb2hsv[blur_layer] sh[blur_layer] 1 -. {$3%} c. 0,1 rm. hsv2rgb[blur_layer] fi +if $4 +fx_mix_rgb[blur_layer] 1,10,0,1,0,0,0.7,-10,0,0,10,0 j[blur_layer] .,0,0,0,0,{$4%} rm. fi +if $2 +fx_map_tones_fast[blur_layer] 20,0.2,11,0 j[blur_layer] .,0,0,0,0,{$2%} rm. fi +simplelocalcontrast_p[blur_layer] 25,1,50,1,1,1,1,1,1,1,1,1 ++fx_graphic_novelfxl[blur_layer] 1,2,6,5,20,0,1.02857,200,0,1,0.0761905,0.0857143,0,0,0,2,1,1,1,1.25714,0.371429,1.04762 => graphicnovel_layer +mv[detail_layer] 0 =>[detail_layer] "name("$nm" [Detail]),mode(grainmerge),opacity(100)" +mv[graphicnovel_layer] 1 =>[graphicnovel_layer] "name("$nm" [Paint]),mode(normal),opacity(50)" +mv[blur_layer] 2 =>[blur_layer] "name("$nm" [Base]),mode(normal),opacity(100)" +if $1<100 +mv[base_layer] 0 =>[base_layer] "name("$nm" [Original]),mode(normal),opacity("{round(100-$1)}")" +else +rm[base_layer] +fi +if !$5 +gui_merge_layers => "name("$nm"),mode(normal),opacity(100)" +fi +} +fx_illustration_look_preview : +gui_split_preview "fx_illustration_look ${1-4},0",$-1 +jl_hsv_to_rgb : +({360*$1}^$2^$3) hsv2rgb. u {^} rm. +levels : +_inplow={int($1)} +_inphigh={int($2)} +_gamma=$3 +_outlow={int($4)} +_outhigh={int($5)} +_tmp2="" +if $_gamma!=1 +_tmp2="-apply_gamma "$_gamma +apply_channels $_tmp2,$6,0 +fi +_curve1="0," +if $_inplow>0 +_tmp1="0," +_curve1=$_curve1$_tmp1$_outlow"," +fi +_curve1=$_curve1$_inplow","$_outlow","$_inphigh","$_outhigh +if $_inphigh<255 +_curve1=$_curve1",255,"$_outhigh +fi +if ['$_curve1']!='0,0,0,255,255' +_tmp2="-apply_curve "$_curve1 +apply_channels $_tmp2,$6,0 +fi +fx_equalize_s : +repeat $! l[$>] split_opacity l[0] to_rgb +rgb2hsv sh 1,1 *. $1 +. $2 c. 0,1 rm. hsv2rgb +done a c done done +fx_kuwahara : +ac "repeat $1 { kuwahara $2 }",$3,$4 +fx_kuwahara_preview : +gui_split_preview "fx_kuwahara $*",${-3--1} +cl_lineart: +locContEnh=$1 +simplif=$2 +nbBilatBord=$3 +lineThick=$4 +forceTrait=$5 +antialias=$6 +addGrays=$7 +augmLum=$8 +nbBilatFin=$9 +type=$10 +finalAntialias=$11 +penDrawing=$12 +effect=$13 +foreach { +if $type==2 +locContEnh=1 +augmLum=40 +fi +if $penDrawing==2 +fx_smooth_anisotropic. 60,0.9,0.64,3.1,1.1,0.8,30,2,0,1,1,0,0,24 +fi +fx_LCE. 80,{$locContEnh/2},1,1,0,0 +if $simplif==1 +fx_smooth_antialias. 100,0,5,0,50,50 +fi +curv="0,0,"{50-$augmLum}","{50+$augmLum}",100,100,-1,0,0,30,70,100,100,-1,0,0,100,100,-1,0,0,100,100,-1" ++fx_curves_interactive. 7,0,1,"7",$curv +fx_smooth_nlmeans.. 4,4,10,5,0,0,24,0 +fx_smooth_bilateral.. 10,7,$nbBilatBord,0,0 ++cut.. 0,255 +reverse[-2,-1] +blur[-3] {$lineThick} +sub[-3,-2] +fill.. "M = max(R,G,B); [M, M, M]" +cut.. 0,255 n.. 0,255 +negate.. +threshold.. {$forceTrait+80}% +n.. 0,255 +fx_smooth_antialias.. $antialias,0,1,0,50,50 +if $addGrays==1 +mul[-2,-1] +n. 0,255 +fx_smooth_bilateral. 10,7,$nbBilatFin,0,0 +if $type==0 +fx_curves_interactive. 7,0,1,"7","0,0,60,0,80,100,100,100,-1,0,0,100,0,-1,0,0,100,100,-1,0,0,100,100,-1" +elif $type==1 +remove_opacity. ++colormap. 8 +index.. [-1],0,1 +rm. +rgb2hsl. split. c +n. 0,1 +append c hsl2rgb +fx_blackandwhite. 0.299,0,0.587,0,0.114,0,0,0,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0,50,50 +fx_curves_interactive. 7,0,1,"7","0,0,20,80,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1" +elif $type>=2 +fx_blackandwhite. 0.299,0,0.587,0,0.114,0,0,0,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0,50,50 +otsu 4 +n 0,255 +fi +else +remove[-1] +fi +if $finalAntialias==1 +fx_smooth_antialias. 15,0,1,0,50,50 +elif $finalAntialias==2 +fx_smooth_antialias. 15,0,1,0,50,50 +fx_smooth_antialias. 50,50,2.5,0,50,50 +elif $finalAntialias==3 +fx_smooth_antialias. 100,0.5,5,0,50,50 +fx_smooth_antialias. 100,0.5,5,0,50,50 +fi +if $penDrawing>=1 +fx_pen_drawing. 10,0,50,50 +n 0,255 +otsu 4 +n 0,255 +fx_smooth_antialias. 15,0,1,0,50,50 +fx_smooth_antialias. 50,50,2.5,0,50,50 +fi +if $effect==1 +fx_spread. 2,2,0,0,0,50,50 +elif $effect==2 ++fx_curves_interactive. 7,0,1,"7","0,0,16,100,100,100,-1,0,0,100,0,-1,0,0,100,100,-1,0,0,100,100,-1" +l. +b. 3 +gradient2rgb. 0 n. 0,255 +[-1] +rgb2hsv[-2,-1] split[-2,-1] c +l[-3--1] +[-3] {315} %[-3] 360 done +l[-6--4] +[-3] {135} %[-3] 360 done +l[-3--1] a c hsv2rgb s c done +l[-6--4] a c hsv2rgb s c done +rm[^-6,-3] +negate.. +/ 2 ++. 128 +blend grainmerge,1 +done +to_rgb +blend grainmerge,1 +fi +} +cl_lineart_preview: +gui_split_preview "cl_lineart $*",${-3--1} +fx_linify : +foreach { +if $7 _debug=1 w ${-fitscreen\ {[w,h]}},0,"[Preview] G'MIC: Linify" fi +linify $1,$2,$3%,$4,$5,$6 +} +fx_linify_preview : +gui_split_preview "fx_linify ${1-6},0",${-3--1} +fx_lylejk_painting : +foreach { +nm={n} ++l { repeat $1 { b 0.75 unsharp 0.75,10.49 c 0,255 mv. 0 } } +smooth. 300,0.26,1,0,7 +. rv[-3--1] +blend[-2,-1] lighten,0.5 +blend[-2,-1] grainmerge,1 +fx_kuwahara. $2,$3,0,0 +texturize_canvas. $4,4 => $nm +} +fx_lylejk_painting_preview : +gui_split_preview "fx_lylejk_painting $*",${-3--1} +fx_Squiggly : +SpreadNoiseAmount=$1 +SEgThrshld=$2 +SegSmooth=$3 +GNSmooth=$4 +GNLin=$5 +InvertLuminance=$6 +EnhanceColors=$7 +ToggleOrg=$8 +Chroma=$9 +ToneTr=$10 +ToneGm=$11 +OrgMergeCh=$12 +OrgOpacity=$13 +OrgReverseorder=$14 +repeat $! l[$>] +if $ToggleOrg==1 +OrgMergeCh=30 +OrgReverseorder=1 +fi +to_rgb ++fx_spread[0] $SpreadNoiseAmount,$SpreadNoiseAmount,0,0 +fx_segment_watershed[1] $SEgThrshld,$SegSmooth,0,0 ++fx_gradient_norm[1] $GNSmooth,$GNLin,0,100,0,0 ++blend[2,1] multiply +if $InvertLuminance==1 +rgb2lab. +s. c +negate... +a[-3--1] c +lab2rgb. +fi +if $EnhanceColors==1 +fx_mix_ycbcr[3] 1,0,0,$Chroma,0,0,$Chroma,0,0,0,2,0 +fx_map_tones[0] $ToneTr,$ToneGm,0.1,30,0,0 +fx_blend[0,3] $OrgMergeCh,0,$OrgOpacity,0,0 +k[0] +fi +k. +done done +fx_Squiggly_Preview : +gui_split_preview "fx_Squiggly ${1--2}",$-1 +fx_MorphoPaint : +to_rgb[0] ++fx_morpho[0] $1,$2,0,2,0,$3,0 ++fx_apply_curve[1] $4,50,$5,200,$6,-1,128,-1,128,-1,128,255,1,3,0,0,0 +fx_spread[1] $7,$7,0,0 +fx_gaussian_blur[2] $8,0,0,1,0,0,0 +fx_segment_watershed[1] $9,$10,0,0 ++fx_painting[0] $11,$12,1.5,$13,1,0 +rm[0] +rv[0,2] +rv[1,2] +if $14 +if $19==0 MorphoStrength={0} elif $19==1 MorphoStrength={$20} fi +*[2] {$MorphoStrength/3} +if $15==0 StrokeStrength={0} elif $15==1 StrokeStrength={$16} fi +*[0] {$StrokeStrength/3} +if $17==0 SegmentStrength={0} elif $17==1 SegmentStrength={$18} fi +*[1] {$SegmentStrength/3} ++[1] [2] ++[1] [0] +if $21 n[1] 0,255 fi +rm[0,2] +fi +fx_MorphoPaint_preview : +gui_split_preview "fx_MorphoPaint ${1--2}",$-1 +fx_paint_with_brush : +predefined_style,previous_style,painting_order,nb_iterations,precision,details_threshold,background_threshold,sharpness,anisotropy,smoothness,coherence,twist_angle,twist_strength,init_canvas,brush_diameter_details,stroke_length_details,hue_randomness_details,saturation_randomness_details,value_randomness_details,opacity_details,brush_diameter_background,stroke_length_background,hue_randomness_background,saturation_randomness_background,value_randomness_background,opacity_background,brush_diameter_dynamics,stroke_length_dynamics,hue_randomness_dynamics,saturation_randomness_dynamics,value_randomness_dynamics,opacity_dynamics,spatial_step,angular_step,preview_progression,preview_type,preview_splitx,preview_splity=${1-38} +style0=1,16,50,100,100,10,80,0.5,3,0,0,6,2,10,0,0,0,60,20,1,0,0,0,30,15,15,15,15,15,15,1,45 +style1=1,16,4,100,100,1,30,0.5,3,0,0,2,3,1,0,0,0,80,10,1,0,0,0,30,8,15,15,15,15,15,1,45 +style2=2,16,30,100,20,10,100,0.5,3,45,0,4,4,10,80,0,0,60,20,1,0,0,0,30,10,15,15,15,15,15,1,45 +style3=1,16,6.6,100,100,0,0,1.7,3,0,0,2,3,1,0,0,50,80,30,1,0,0,50,20,15,15,15,15,15,15,1,45 +style4=1,16,50,100,80,5,80,0.5,1.5,45,0,4,1,20,0,0,0,10,5,1,0,0,0,30,15,15,15,15,15,15,1,45 +style5=0,16,10,100,100,10,80,0.5,3,135,50,6,1,20,0,0,0,90,3,10,0,0,0,30,0,15,15,15,15,15,1,45 +style6=1,16,30,100,100,0,95,0.5,8,-1,-1,2,2,30,0,0,0,100,20,1,0,0,0,30,0,0,0,0,0,0,1,45 +style7=1,16,50,100,100,10,80,0.5,3,0,0,6,1,10,0,0,0,6,20,1,0,0,0,100,17.34,15,15,15,15,20,1,45 +if $predefined_style!=$previous_style" && "$previous_style>=0 +painting_order,nb_iterations,precision,details_threshold,background_threshold,sharpness,anisotropy,smoothness,coherence,twist_angle,twist_strength,init_canvas,brush_diameter_details,stroke_length_details,hue_randomness_details,saturation_randomness_details,value_randomness_details,opacity_details,brush_diameter_background,stroke_length_background,hue_randomness_background,saturation_randomness_background,value_randomness_background,opacity_background,brush_diameter_dynamics,stroke_length_dynamics,hue_randomness_dynamics,saturation_randomness_dynamics,value_randomness_dynamics,opacity_dynamics,spatial_step,angular_step=${style$predefined_style} +fi +foreach { +to_color ++diffusiontensors {[$sharpness,$anisotropy]%},$smoothness,$coherence +if $twist_strength>0 +if $twist_angle>=0 +f. "begin(Id = eye(2)); +T = [ i0,i1,i1,i2 ]; +eig = eig(T); +const ang = $twist_angle°; +U = lerp(eig[2,2],[ cos(ang),sin(ang) ],$twist_strength%); +U/=max(1e-8,norm(U)); +UUt = mul(U,U,2); +T = eig[0]*UUt + eig[1]*(Id - UUt); +[ T[0],T[1],T[3] ]" +else +100%,100%,1,2 rand. -1,1 b. $coherence orientation. +f.. "begin(Id = eye(2)); +T = [ i0,i1,i1,i2 ]; +eig = eig(T); +U = lerp(eig[2,2],I(#-1),$twist_strength%); +UUt = mul(U,U,2); +T = eig[0]*UUt + eig[1]*(Id - UUt); +[ T[0],T[1],T[3] ]" +rm. +fi +elif $twist_strength<0 +if $twist_angle>=0 +f. "R = rot($twist_angle°); +Rt = transpose(R,2); +T = mul(mul(Rt,[ i0,i1,i1,i2 ],2),R,2); +[ T[0],T[1],T[3] ]" +else +100%,100%,1,2 rand. -1,1 b. $coherence orientation. +f.. "ang = atan2(i(#-1,x,y,0,1),i(#-1,x,y,0,0)); +R = rot(ang); +Rt = transpose(R,2); +T = mul(mul(Rt,[ i0,i1,i1,i2 ],2),R,2); +[ T[0],T[1],T[3] ]" +rm. +fi +fi ++gradient_norm.. 100%,100%,1,2,[x,y] a[-2,-1] c r. {wh},1,1,3,-1 sort. +,x +r. {max(0.01,$precision)}%,1,1,3 z. {(100-$background_threshold)*$details_threshold%}%,$details_threshold% +if !$painting_order 100% rand. 0,100 rv[-2,-1] a[-2,-1] c sort. +,x channels. 1,100% +elif $painting_order==2 mirror. x +fi +arg0 $init_canvas,"+f[0] 0","+f[0] 128","+f[0] 255","[0]","+b[0] 1%","+kuwahara[0] 10","+fx_vector_painting[0] 9" +run ${} +ind=0 +repeat inf { t=$> +progress {$ind*100/w#2} +100%,100%,1,{s#0+1} +nb_strokes:=max(1,w#2/$nb_iterations) +$nb_strokes,1,1,1,:${-math_lib}" +begin(color_random = vector(#s#0)); +lambda(tau) = min(1,edge/(1e-8+tau)); +const brush_diameter_background = $brush_diameter_background; +const brush_diameter_details = $brush_diameter_details; +const brush_diameter_dynamics = $brush_diameter_dynamics; +const stroke_length_background = $stroke_length_background; +const stroke_length_details = $stroke_length_details; +const stroke_length_dynamics = $stroke_length_dynamics; +const opacity_background = 255*$opacity_background%; +const opacity_details = 255*$opacity_details%; +const opacity_dynamics = $opacity_dynamics; +const hue_randomness_background = $hue_randomness_background%; +const hue_randomness_details = $hue_randomness_details%; +const hue_randomness_dynamics = $hue_randomness_dynamics; +const saturation_randomness_background = $saturation_randomness_background%; +const saturation_randomness_details = $saturation_randomness_details%; +const saturation_randomness_dynamics = $saturation_randomness_dynamics; +const value_randomness_background = $value_randomness_background%; +const value_randomness_details = $value_randomness_details%; +const value_randomness_dynamics = $value_randomness_dynamics; +const spatial_step = max($spatial_step,0.1); +const angular_step = max($angular_step,1); +stroke = $ind + x; +stroke=w#2 break fi +} +k. +} +if $predefined_style!=$previous_style +u "{"$predefined_style"}{"$predefined_style"}""{"$painting_order"}{"$nb_iterations"}{"$precision"}{"$details_threshold"}{"$background_threshold"}""{"$sharpness"}{"$anisotropy"}{"$smoothness"}{"$coherence"}{"$twist_angle"}{"$twist_strength"}{"$init_canvas"}""{"$brush_diameter_details"}{"$stroke_length_details"}""{"$hue_randomness_details"}{"$saturation_randomness_details"}{"$value_randomness_details"}{"$opacity_details"}""{"$brush_diameter_background"}{"$stroke_length_background"}""{"$hue_randomness_background"}{"$saturation_randomness_background"}{"$value_randomness_background"}""{"$opacity_background"}""{"$brush_diameter_dynamics"}{"$stroke_length_dynamics"}""{"$hue_randomness_dynamics"}{"$saturation_randomness_dynamics"}{"$value_randomness_dynamics"}""{"$opacity_dynamics"}""{"$spatial_step"}{"$angular_step"}{"$preview_progression"}{"$preview_type"}{"$preview_splitx,$preview_splity"}" +fi +fx_paint_with_brush_preview : +_is_preview=1 +gui_split_preview "fx_paint_with_brush $*",${-3--1} +fx_painting : skip ${4=0},${5=0} +foreach { +to_colormode {max(3,s)} split_opacity rv +repeat $1 { fx_normalize_local. 10,6,5,20,1,11 } +fx_smooth_anisotropic. {100*$2},0.2,1,$2,{2*$2},0.8,90,2,0,1,1,2,1,16 +fx_mix_lab. 1,0,0,$3,0,0.5,$3,0,0.5,0,2,0 +if $5 fx_segment_watershed. 10,1,0 fi +smooth. $4,0,1,1,1 +rv a c +} +fx_painting_preview : +gui_split_preview "fx_painting $*",${-3--1} +fx_pastell : +MasterOpacity=$1 +BgTextured=$2 +ReverseEffect=$3 +RAmplitude=$4 +RThickness=$5 +RSharpness=$6 +ROrientations=$7 +ROffset=$8 +RColormode=$9 +GSmoothness=$10 +GLinearity=$11 +GNegativeColors=$12 +ActivateShakes=$13 +RiAmplitude=$14 +RiSize=$15 +ActivateLizards=$16 +WAmplitude=$17 +WSmoothness=$18 +ActivatePink=$19 +RDeform=$20 +RChannels=0 +GMinThreshold=0 +GMaxThreshold=100 +RiShape=3 +RiAngle=135 +if $ActivatePink==1 deform[0] $RDeform fi ++fx_rodilius[0] $RAmplitude,$RThickness,$RSharpness,$ROrientations,$ROffset,0,$RColormode,$RChannels,0 ++fx_gradient_norm[0] $GSmoothness,$GLinearity,$GMinThreshold,$GMaxThreshold,$GNegativeColors,0 +fx_smooth_bilateral[0] 15,10,3,3,0 +if $ActivateLizards==1 water[0,2] $WAmplitude,$WSmoothness fi +if $ActivateShakes==1 ripple[0,2] $RiAmplitude,$RiSize,$RiShape,$RiAngle,0 fi +if $ReverseEffect==1 rv[0,2] fi ++blend[0,2] divide,1,0 +rv[1,3] +blend[1,3] value,1,0 +if $BgTextured==1 fx_ellipsionism[0] 20,2,10,0.5,1,1,0 fi +blend[0,1] alpha,$MasterOpacity,0 +k[0] +fx_pastell_preview : +gui_split_preview "fx_pastell ${1--2}",$-1 +fx_pen_drawing : +drawing $1 +fx_pen_drawing_preview : +gui_split_preview "fx_pen_drawing $*",${-3--1} +fx_tk_photoillustration : +repeat $! l[$>] +if $26==1 scdo=50 scup=200 fi +if $26==2 scdo=25 scup=400 fi +if $26!=0 r $scdo%,$scdo% else fi +if $21==0 +[^] +negate[1] [0] +negate[0] +fx_gaussian_blur[2] {{{100-$18}/5}+0.5},0,0,1,0,0,0 fx_compose_dodge[1,2] 1 +if $23==1 fx_gaussian_blur[1] {{{100-$18}/10}+0.5},0,0,1,0,0,0 fi +fx_gaussian_blur[3] {{{{{100-$18}/5}+1}*10}+10},0,0,1,0,0,0 +fx_compose_dodge[2,3] 1 +if $23==1 fx_gaussian_blur[2] {{{{100-$18}/10}+0.5}*3},0,0,1,0,0,0 fi +reverse[1,2] fx_compose_multiply[1,2] {1-{$19/10}} +tk_fx_channel_processing[1] {{1-$20}+0.1},1,0,0,0,0,100,256,0,0,0,2,7,0 +elif $21==1 ++fx_laplacian $19,{99.99-$18},$18,1,1,0 +elif $21==2 ++fx_gradient_norm $19,0.5,{99.99-$18},$18,1,0 +elif $21==3 ++fx_highpass {-{$18-100.3}},{{10-$19}*0.7},0,1,0 +elif $21==4 ++fx_pencilbw {100-$18},{$19*20},0,0,0 +elif $21==5 ++fx_hardsketchbw {300+{{$18-50}*15}},{$19*10},$19,1,{50-{$18/2}},0,0,0 +elif $21==6 ++fx_thin_edges $19,{{$18/5}-10},0,0 +elif $21==7 ++fx_edges {$19/3.5},{95-$18},0,0 ++fx_mix_hsv[0] 1,0,0,1,-1,0,1,0,0,0,2,0 +tk_fx_channel_processing[2] 1,1,0,{$19/10},4,{{$18-50}*2},100,256,0,0,0,2,7,0 +reverse[1,2] fx_compose_multiply[1,2] {0.5+{$20/2}} +elif $21==8 ++channels 2 +if $19<=5 fx_unsharp[1] 1,{2-{{$19*0.3}+0.5}},20,{5-$19},0.00,1.00,0.5,1,0,7,0 +else fx_gaussian_blur[1] {$19-5},0,0,1,0,0,0 +fi +fi +if $1!=3 +fi +if $24==0 +if $1==0 +fx_map_tones[0] {$2/2.5},{1-{$2/2.5}},$2,{2+{$2*80}},3,0 +elif $1==1 +fx_map_tones[0] {$2/10},0.5,{10-{$2*2}},300,3,0 +elif $1==2 +fx_map_tones_fast[0] {$2*2},{$2/2.5},3,0 +elif $1==3 +fx_normalize_local[0] {$2*2},{1+{$2*25.2}},{$2*16},{$2*16},0,3,0 +elif $1==4 +fx_unsharp[0] 0,{{w+h}/100},0,$2,0,1,1,1,0,7,0 +elif $1==5 ++negate[0] +if $21!=9 reverse[1,2] fi +fx_gaussian_blur[1] {{{w+h}/5}-{$2*{{w+h}/12.5}}},0,0,1,0,0,0 +to_gray[1] reverse[0,1] fx_compose_softlight[0,1] {$2/2.5} +elif $1==6 +fx_tk_dri[0] {$2/2.5},{$2/5},{$2/2.5},{$2*2},{$2/2.5},1,1,0 +fi +else ++to_rgba[0] +channels[0] 0 +if $21!=9 move[1] 4 fi +negate[2] +tk_fx_channel_processing[2] 1,1,2,0,0,0,100,256,0,0,0,2,7,0 +fx_gaussian_blur[2] {{w+h}/500},0,0,1,0,0,0 +to_gray[2] +if $1==0 +fx_map_tones[1] {$2/2.5},{1-{$2/2.5}},$2,{2+{$2*80}},3,0 +elif $1==1 +fx_map_tones[1] {$2/10},0.5,{10-{$2*2}},300,3,0 +elif $1==2 +fx_map_tones_fast[1] {$2*2},{$2/2.5},3,0 +elif $1==3 +fx_normalize_local[1] {$2*2},{1+{$2*25.2}},{$2*16},{$2*16},0,3,0 +elif $1==4 +fx_unsharp[1] 0,100,0,$2,0,1,1,1,0,7,0 +elif $1==5 +negate[1] fx_gaussian_blur[1] {{{w+h}/5}-{$2*{{w+h}/12.5}}},0,0,1,0,0,0 +to_gray[1] to_rgba[1] +elif $1==6 +fx_tk_dri[1] {$2/2.5},{$2/5},{$2/2.5},{$2*2},{$2/2.5},1,1,0 to_rgba[1] +fi +split[1] c +if $21!=9 reverse[4,5] compose_multiply[4,5] append[-5,-4,-3,-2] c +else reverse[3,4] compose_multiply[3,4] append[-4,-3,-2,-1] c +fi +if $1!=3 compose_rgba[0,1] +else reverse[0,1] fx_compose_softlight[0,1] {$2/2.5} +fi +fi +tk_fx_channel_processing[0] 1,$11,$10,0,0,0,100,256,0,0,0,2,7,0 +if $1==3 +fi +if $3==0 fx_smooth_anisotropic[0] {$5*100},{$4*2},$4,$5,$5,0.80,30.00,2.0,0,1,1,0,1,0 +elif $3==1 fx_smooth_bilateral[0] {100-{$4*100}},{$5*25},1,0,0 +elif $3==2 fx_gaussian_blur[0] {$5*10},0,0,1,8,0,0 +elif $3==3 fx_segment_watershed[0] {$4*5},{$5/2},0,0 +elif $3==4 fx_morpho[0] 3,{$5*2+2},0,2,0,1,0 +elif $3==5 fx_smooth_selective[0] {$5*4},{$4*2},10,10,0,1,0 +elif $3==6 fx_smooth_haar[0] {10-{$4*10}},{round($5*5,1)},0,0,1,0 +elif $3==7 to_rgb[0] fx_kuwahara[0] {6-{$4*5}},{1+{$5*2.9}},0,0 +fi +fx_mix_lab[0] 1,0,0,$17,$15,0,$17,$16,0,0,2,0 +if $25==0 fx_unsharp[0] 1,$6,20,$7,0.00,1.00,0.5,1,0,7,0 +else ++to_rgba[0] +fx_edges[0] $6,{30-{$7*5}},1,0 +if $21!=9 move[1] 4 fi +fx_unsharp[1] 1,$6,20,$7,0.00,1.00,0.5,1,0,7,0 +fx_gaussian_blur[2] {{w+h}/500},0,0,1,0,0,0 +to_gray[2] +split[1] c +if $21!=9 reverse[4,5] compose_multiply[4,5] append[-5,-4,-3,-2] c +else reverse[3,4] compose_multiply[3,4] append[-4,-3,-2,-1] c +fi +compose_rgba[0,1] +fi +if $22==0 +if $21==3 reverse fx_compose_overlay $20 +elif $21==8 reverse fx_compose_hardlight $20 +elif $21!=9 reverse fx_compose_multiply $20 +fi +fi +if $8==1 +fx_glow[0] $9,0,0 +elif $8==2 ++fx_highpass[0] {$9*3},2,1,0,0 +if $22==1" && "$21!=9 reverse[1,2] fi +reverse[0,1] fx_compose_overlay[0,1] {$9/40} +elif $8==3 [0] [0] +if $22==1" && "$21!=9 reverse[1,3] fi +fx_compose_screen[1,2] 1 fx_gaussian_blur[1] {$9*3},0,0,1,0,0,0 +reverse[0,1] fx_compose_softlight[0,1] {$9/20} +elif $8==4 +fx_smooth_anisotropic[0] 0,1.5,0.3,{$9/4},1.10,0.80,30.00,2.0,0,1,1,0,1,0 +elif $8==5 ++fx_mix_hsv[0] 1,0,0,1,-1,0,1,0,0,0,2,0 +if $22==1" && "$21!=9 reverse[1,2] fi +tk_fx_channel_processing[1] 1,1,0,0,4,0,{100-{$9*2.5}},256,0,1,0,2,0,0 +fx_gaussian_blur[1] $9,0,0,1,0,0,0 +tk_fx_channel_processing[1] 1,1,0,0,4,0,{50-{$9*2}},256,0,1,0,2,0,0 +tk_fx_replace_color[1] 1,0,0,0,0,255,0,0,0,0 +fx_gaussian_blur[1] {$9*2},0,0,1,0,0,0 +reverse[0,1] fx_compose_softlight[0,1] {0.25+{$9/150}} +elif $8==6 +fx_smooth_anisotropic[0] 60,0.16,{{$9/50}+0.6},{{$9/9}+0.6},2.35,0.8,30,2,0,1,1,0,1 +fi +if $26!=0 r $scup%,$scup% fi +done done +fx_tk_photoillustration_preview : +gui_split_preview "fx_tk_photoillustration ${1--2}",$-1 +fx_polygonize_delaunay : +foreach { +to_rgba wh:=w,h if $11 r 150%,150%,1,100%,3 fi +mM:=im,iM b $4 n $mM ++to_rgb. gradient_norm. ge. $2 +f. "!x || !y || x==w-1 || y==h-1?(u^0.25<$3%):(u^0.25<$1%?i:0)" +{is+1},1,1,2 f.. ">begin(p = 0); i?(I[#-1,++p] = [x,y];p):0" +delaunay.. 0 +if $5==4 ++f[0] 0 f... "*i?( +p = I(#1); P0 = I[#2,p[0]]; P1 = I[#2,p[1]]; P2 = I[#2,p[2]]; +W = solve([P0[0],P1[0],P2[0],P0[1],P1[1],P2[1],1,1,1],[x,y,1]); +I(#-1) = cut(W[0]*I(#0,P0) + W[1]*I(#0,P1) + W[2]*I(#0,P2),0,255); +);I" +elif $5==3 ++f[0] 0 f... "*i?( +p = I(#1); P0 = I[#2,p[0]]; P1 = I[#2,p[1]]; P2 = I[#2,p[2]]; +I(#-1) = (I(#0,P0) + I(#0,P1) + I(#0,P2))/3; +);I" +elif $5==2 ++norm[1] label_fg. 0 {iM+1},1,1,3 rand. 0,255 to_rgba. point. 0 map.. . rm. +else ++norm[1] !=. 0 *. 255 channels. -3,0 +if $5 sh. 0,2 f. 255 rm. fi +fi +rm[0,2] +if $6 +norm[0] f[0] "i!=j(1) || i!=j(0,1)" ++fc. ${7-10} j.. .,0,0,0,0,{$6%},... rm. +fi +k. +if $11 r $wh,1,100%,2 fi +} +fx_polygonize_delaunay_preview : +gui_split_preview "fx_polygonize_delaunay $*",${-3--1} +fx_polygonize : +polygonize $1,$2,{$3^2},$4,$5 +if $9 foreach { ++norm g. xy,1 !=[-2,-1] 0 -|[-2,-1] r. 100%,100%,1,4 +replace_color. 0,0,1,1,1,1,$6,$7,$8,$9 +blend alpha +} fi +fx_polygonize_preview : +gui_split_preview "fx_polygonize $*",${-3--1} +fx_poster_edges : +if $1 bilateral 10,$1 fi +poster_edges ${2-7} +fx_poster_edges_preview : +gui_split_preview "fx_poster_edges $*",${-3--1} +fx_posterize : +foreach { +split_opacity l[0] { +. amp=$1 do smooth. {min(50,$amp)},{$2%},1,$3,{2*$3} amp-=50 while $amp>0 +bilateral.. .,5,10 rm. +srgb2rgb +colormap $4,0 rgb2srgb +index.. .,0,0 +if $5 +area.. 0,0 <. $5 inpaint... .,0,3 rm. fi +map.. . rm. +if $6 ++norm (0,1,0;1,1,1;0,1,0) +dilate.. . rm.. -[-2,-1] !=. 0 100%,100%,1,{0,s} j... .,0,0,0,0,{$6%},.. rm[-2,-1] +fi +if $7 n 0,255 fi +} +a c +} +fx_posterize_preview : +gui_split_preview "fx_posterize $*",${-3--1} +fx_pdithered : ++apply_gamma. $1 - 128 * $2 + 128 + $3 b. $4 c. 0,255 ditheredbw. +quantize.. $5 to_rgb blur_xy.. $6,$6 +if $7==0 fx_compose_colordoping $8,0 +elif $7==1 fx_compose_darken $8,0 +elif $7==2 fx_compose_softlight $8,0 +elif $7==3 fx_compose_grainmerge $8,0 +elif $7==4 fx_compose_multiply $8,1 +elif $7==5 fx_compose_value $8,1 fi +fx_pdithered_preview : +gui_split_preview "fx_pdithered ${1--2}",$-1 +fx_quadtree : +mode,precision,homogeneity,outline,radius1,radius2,anisotropy,only_leafs=${1-8} +m "_qt : sh 3 u {w>1&&h>1?iv*(w*h)^"$homogeneity":-0.1} k[0]" +foreach { +to_rgb +keep_only_leafs:=$mode!=2" || "$only_leafs ++norm. a c +_qt ({d=max(w,h);[0,0,d-1,d-1]},0,${}) +repeat $precision { ++columns. 100% n:=yM rm. +x0,y0,x1,y1,level:=crop(0,$n,5,1) +xc,yc:=round([$x1+$x0,$y1+$y0]/2) +xc1,yc1:=[$xc,$yc]-1 +level1:=$level+1 +B0=$x0,$y0,$xc1,$yc1 +crop[0] $B0,3 _qt. B0.=,$level1,${} rm. +B1=$xc,$y0,$x1,$yc1 +crop[0] $B1,3 _qt. B1.=,$level1,${} rm. +B2=$x0,$yc,$xc1,$y1 +crop[0] $B2,3 _qt. B2.=,$level1,${} rm. +B3=$xc,$yc,$x1,$y1 +crop[0] $B3,3 _qt. B3.=,$level1,${} rm. +if $keep_only_leafs +sh. $n,$n,0,0 f. $B0 rm. +($B1;$B2;$B3) a[-2,-1] y +else +=. -1,5,$n +($B0;$B1;$B2;$B3) a[-2,-1] y +else +fi +} +shift. 2,0,0,0,2 sort. +,y levelmax:=i(0,h-1) shift. -2,0,0,0,2 +channels[0] 0,2 +structuretensors[0] a[0,-1] c +r. {w+6},100%,1,1,0 +repeat h { +x0,y0,x1,y1:=crop(0,$>,4,1) ++crop[0] $x0,$y0,$x1,$y1,3 r. 1,1,1,100%,2 y. x +j.. .,{-2,w-6},$> rm. +} +permute. cyzx +channels[0] 0,3 f[0] 0 +if !$mode +f. "> +rectangle(ind,P0,P1,opacity,color) = ( +_P0 = P0; +_P2 = P1; +_P1 = [ _P2[0], _P0[1] ]; +_P3 = [ _P0[0], _P2[1] ]; +polygon(#ind,4,_P0,_P1,_P2,_P3,opacity,color); +); +begin(colo = [ 0,0,0,255 ]); +P = I; +Xpp = P[0,2]; +Xnn = P[2,2]; +col = [ P[6,3],255 ]; +if ("$outline"<=0, +rectangle(#0,Xpp,Xnn,1,col); +_(else), +rectangle(#0,Xpp,Xnn,1,colo); +rectangle(#0,Xpp + "$outline",Xnn - "$outline",1,col); +); +I" +elif $mode==1 +f. "> +P = I; +Xpp = P[0,2]; +Xnn = P[2,2]; +Xnp = [ Xnn[0],Xpp[1] ]; +Xpn = [ Xpp[0],Xnn[1] ]; +col1 = [ P[6,3],255 ]; +col2 = [ P[6,3],64 ]; +T = [ P[9],P[10],P[10],P[11] ]; +eig = eig(T); +angle = atan2(eig[5],eig[4])*180/pi; +if ((angle>=0 && angle<90) || angle<-90, +polygon(#0,3,Xpp,Xnp,Xnn,1,col1); +polygon(#0,3,Xpp,Xnn,Xpn,1,col2); +_(else), +polygon(#0,3,Xnp,Xnn,Xpn,1,col1); +polygon(#0,3,Xnp,Xpp,Xpn,1,col2) +); +I" +else +f. "> +begin(colo = [ 0,0,0,255 ]); +P = I; +Xpp = P[0,2]; +Xnn = P[2,2]; +Xcc = (Xpp + Xnn)/2; +R = (Xnn[0] - Xpp[0])/2; +col = [ P[6,3],255 ]; +r = "$radius2"*R; +R*="$radius1"; +T = [ P[9],P[10],P[10],P[11] ]; +eig = eig(T); +anisotropy = (1 + eig[1])/(1 + eig[0]); +r*=anisotropy^"$anisotropy"; +angle = atan2(eig[5],eig[4])*180/pi; +if ("$outline">0, ellipse(#0,Xcc,R,r,angle°,1,colo)); +ellipse(#0,Xcc,R - "$outline",r - "$outline",angle°,1,col); +I" +if !$outline sh[0] 100% if !im solidify[0] 10% fi fi +fi +k[0] +} +um _qt +fx_quadtree_preview : +gui_split_preview "fx_quadtree $*",${-3--1} +fx_rodilius : +ac "rodilius ${1-5,7} repeat $6 { smooth 10,0,1,1,1,0.8,45 sharpen 30 } c 0,255",$8,$9 +fx_rodilius_preview : +gui_split_preview "fx_rodilius $*",${-3--1} +fx_shapeism : +foreach { +to_rgb ++gradient_norm b. $13% ^. $12 quantize. $6,0,0 +100%,100%,1,2 +repeat $6 { ++channels[2] 100% +>[1] $> !=.. 0 -|[-2,-1] a[2,-1] c +size:=$6<=1?$7:$7+($8-$7)*$>/($6-1) +if $size<1 break fi +if $5 {2*$size},{2*$size} _fx_shapeism$1. ${2-4} r2dy. $size +else $size,$size _fx_shapeism$1. ${2-4} +fi ++!=. 0 expand_xy[-2,-1] 1,0 n[-2,-1] 0,1 +if $10<1 dilate. 3 fi +. a[-3--1] c +rprogress "pack_sprites[-2,-1] 1,100,$9,$10,$11",{$>*100/$6},{($>+1)*100/$6} +channels. 0,1 +} +rprogress 97 +rm[1] +channels. 0 +!=. 0 blend[0,-1] shapeaverage0 *[1] 255 a c +i[0] 100%,100%,1,4 fc[0] $14,$15,$16,$17 +blend alpha +rprogress 100 +} +fx_shapeism_preview : +gui_print_preview "" +50%,50% _fx_shapeism$1. ${2-4} frame. 1,1,0 >=. 50% n. 0,255 r. 100%,100%,1,4 +ri. [0],0,0,0.5,0.5 -| +_fx_shapeism0 : +f 255 skip $* +_fx_shapeism1 : +polygon 3,50%,0,0,100%,100%,100%,1,1 skip $* +_fx_shapeism2 : +shape_circle {w} rm.. skip $* +_fx_shapeism3 : +shape_diamond {w} rm.. skip $* +_fx_shapeism4 : +star3d 3,1 *3d. {0,min(w,h)/2} j3d[0] .,50%,50%,0,1,2,0 k[0] skip $* +_fx_shapeism5 : +star3d 4,1 *3d. {0,min(w,h)/2} j3d[0] .,50%,50%,0,1,2,0 k[0] skip $* +_fx_shapeism6 : +star3d 5 *3d. {0,min(w,h)/2} j3d[0] .,50%,50%,0,1,2,0 k[0] skip $* +_fx_shapeism7 : +star3d $1,$2 *3d. {0,min(w,h)/2} r3d. 0,0,1,$3 j3d[0] .,50%,50%,0,1,2,0 k[0] +fx_sharp_abstract : +ac "rolling_guidance ${1-3}",$4 +fx_sharp_abstract_preview : +gui_split_preview "fx_sharp_abstract $*",${-3--1} +fx_SimpleNoiseCanvas : +CanvasScale={$1} +NoiseAmplitude=$2 +NoiseType=$3 +ThreadHorizLen=$4 +ThreadVertLen=$5 +OverAllBlur=$6 +HighCut=$7 +LowCut=$8 +CanvasMergeChoice=$9 +InvertCanvasColors=$10 +InvertImageColors=$11 +ReverseChoice=$12 +MergeChoice=$13 +PreserveCanvas=$14 +to_rgb[0] +CanvasScale={1.2-$CanvasScale} +(255^255^255) +ri. [0] +r[1] {100*$CanvasScale}%,{100*$CanvasScale}% +if $NoiseType!=2 NoiseAmplitude={$NoiseAmplitude*10} fi +fx_noise[1] $NoiseAmplitude,$NoiseType,0,1,0 +fx_ditheredbw[1] 1,1,0,0,0,0 ++fx_gaussian_blur[1] 0,$ThreadHorizLen,0,1,0,0,0 ++fx_gaussian_blur[1] 0,0,$ThreadVertLen,1,0,0,0 +n[2] 0,255 +n[3] 0,255 +if $CanvasMergeChoice==0 blend[2,3] average +elif $CanvasMergeChoice==1 blend[2,3] multiply +elif $CanvasMergeChoice==2 blend[2,3] darken +elif $CanvasMergeChoice==3 blend_edges[2,3] 0.9 +fi +fx_gaussian_blur[2] $OverAllBlur,0,0,1,0,0,0 +rm[1] +ri[1] [0] +($15^$16^$17) +ri[2] [0] +blend[1,2] multiply +fx_apply_curve {$LowCut},-1,128,-1,128,-1,128,-1,128,-1,128,{$HighCut},1,3,0,0,0 +if $ReverseChoice==1 rv[0,1] fi +if $InvertCanvasColors==1 negate[1] fi +if $InvertImageColors==1 negate[0] fi +if $MergeChoice==0 +blend[1,0] average +elif $MergeChoice==1 +blend[1,0] multiply +elif $MergeChoice==2 +blend[1,0] screen +elif $MergeChoice==3 +blend[1,0] darken +elif $MergeChoice==4 +blend[1,0] lighten +elif $MergeChoice==5 +blend[1,0] difference +elif $MergeChoice==6 +blend[1,0] negation +elif $MergeChoice==7 +blend[1,0] exclusion +elif $MergeChoice==8 +blend[1,0] overlay +elif $MergeChoice==9 +blend[1,0] hardlight +elif $MergeChoice==10 +blend[1,0] softlight +elif $MergeChoice==11 +blend[1,0] dodge +elif $MergeChoice==12 +blend[1,0] colorburn +elif $MergeChoice==13 +blend[1,0] reflect +elif $MergeChoice==14 +blend[1,0] freeze +elif $MergeChoice==15 +blend[1,0] stamp +elif $MergeChoice==16 +blend[1,0] interpolation +elif $MergeChoice==17 +blend[1,0] grainextract +elif $MergeChoice==18 +blend[1,0] grainmerge +elif $MergeChoice==19 +blend[1,0] xor +elif $MergeChoice==20 +blend_edges[1,0] 0.8 +fi +if $ReverseChoice==1 rv[0,1] fi +if $PreserveCanvas==0 rm[1] fi +if $PreserveCanvas==1" && "$MergeChoice!=21 rv[1,2] fi +if $MergeChoice!=21 rm[0] fi +if $MergeChoice!=21" && "$PreserveCanvas==1 rv[0,1] fi +fx_SimpleNoiseCanvasPreview : +gui_split_preview "fx_SimpleNoiseCanvas ${1--2}",$-1 +fx_sketchbw : skip ${16=0} +srand $16 +if $15==4 foreach { +sketchbw ${1-14} blend hardlight } return fi +sketchbw ${1-14} +if $15&1 negate fi +if $15==2 r 100%,100%,1,4 repeat $! { sh[$>] 3 *. -2 +. {2*255} c. 0,255 rm. } +elif $15==3 r 100%,100%,1,4 repeat $! { sh[$>] 3 *. 2 c. 0,255 rm. } +fi +fx_sketchbw_preview : +gui_split_preview "fx_sketchbw $*",${-3--1} +fx_smooth_abstract : +foreach { +split_opacity l[0] { +srgb2rgb +mM:=im,iM +b $4 n. $mM gradient_norm. <=. {50-$5} +inpaint_pde[0] [1],$1%,$2,$3 rm. +rgb2srgb c 0,255 +} +a c +} +fx_smooth_abstract_preview : +gui_split_preview "fx_smooth_abstract $*",${-3--1} +fx_stylize : +init_resolution:=arg(1+$16,8,16,32,64,128,256) +colorspace=${"arg0 $11,all,lrgb,ycbcr,ycbcr,ycbcr_y,ycbcr_cbcr,lab,lab,lab_l,lab_ab"} +match_colors="s c,-3 mv[1] 3 b[-2,-1] 1% negate[-2,-1] n[-2,-1] 0,1" +luma,chroma= +if $11==3" || "$11==7 +luma=_${"arg0 ($11==7),y,l"} +chroma=_${"arg0 ($11==7),cbcr,ab"} +fi +if $10==1 +match_colors=$match_colors" ac[0,1] \"balance_gamma ,\","$colorspace$luma +if narg($chroma) match_colors=$match_colors" ac[0,1] \"balance_gamma ,\","$colorspace$chroma fi +elif $10==2 +match_colors=$match_colors" match_histogram[0] [1],256,"$colorspace$luma +if narg($chroma) match_colors=$match_colors" match_histogram[0] [1],256,"$colorspace$chroma fi +elif $10==3 +match_colors=$match_colors" match_pca[0] [1],"$colorspace$luma" c[0] 0,255" +if narg($chroma) match_colors=$match_colors" match_pca[0] [1],"$colorspace$chroma" c[0] 0,255" fi +fi +if $12==1 match_colors=$match_colors" rgb2ycbcr[0,1] sh[0,1] 1,2 f[-2,-1] 128 rm[-2,-1] ycbcr2rgb[0,1]" +elif $12==2 match_colors=$match_colors" srgb2lab[0,1] sh[0,1] 1,2 f[-2,-1] 0 rm[-2,-1] lab2srgb[0,1]" +elif $12==3 match_colors=$match_colors" rgb2ycbcr[0,1] sh[0,1] 0 f[-2,-1] 128 rm[-2,-1] ycbcr2rgb[0,1]" +elif $12==4 match_colors=$match_colors" srgb2lab[0,1] sh[0,1] 0 f[-2,-1] 50 rm[-2,-1] lab2srgb[0,1]" +fi +match_colors=$match_colors" b[0,1] xy,$13 foreach[0,1] { s c n 0,255 a c } *[-2,-1] {$14*255} a[0,-2] c a[1,-1] c" +patch_penalization=$23 +if $1<2 +if $!<2 error "At least two layers are required in this mode." fi +ind_first:=!$1 ind_style:=$1?-1:0 N:=$!-1 sh[$ind_style] +else +ind_first=0 N=$! ind_style= _fx_stylize {$1-2} +fi +is_window=0 +repeat $N { l[{$ind_first+$>},-1] { +nm={0,n} +if $2 +rr2d[1] {0,[w,h]*arg($2,0.1,0.2,0.3,0.5,0.75,1,1.5,2,2.5,3)},1,2 fi +if $3==1 . +mirror. x +mirror[-2,-1] y a[-4--1] z +elif $3==2 +l. { r {u=max(w,h);[u,u]},1,100%,0,3,0.5,0.5 repeat 3 { +rotate[0] {90*$>},1,3,50%,50% } a z } +elif $3==3 +l. { r {u=max(w,h);[u,u]},1,100%,0,3,0.5,0.5 repeat 7 { +rotate[0] {45*$>},1,3,50%,50% } a z } +fi +if $4 wsiz=${"fitscreen "{0,[w,h]}} w[0] $wsiz is_window={*} fi +stylize[0] .,${5-9},$15,$init_resolution,${17-22},$patch_penalization,${24-26},$match_colors +k[0,1] =>[0] $nm +if $is_window" && "!{*} break fi +} } +rm. +if 0$_output_mode +if narg($ind_style) rm[$ind_style] fi +if $is_window" && "!{*} rm fi +fi +fx_stylize_preview : +if $1<2 +if $!<2 gui_warning_preview "At least two layers are required when specifying a custom style." return fi +ind_first:=!$1 ind_style:=$1?-1:0 N:=$!-1 sh[$ind_style] +else +ind_first=0 N=$! ind_style= _fx_stylize {$1-2} +fi +repeat $N { l[{$ind_first+$>},-1] { +gui_no_preview[0] , ++rr2d[1] {0,[w,h]*2/3},0,2 frame. 1,1,255 frame. 1,1,0,0,0,255 j[0] .,1%,30 rm. to[0] "Style:",1%,0,24 +} } rm. +if narg($ind_style) rm[$ind_style] fi +_fx_stylize : +if isnum($1) +name=${"arg0 $1","landscapenearantwerp,leviaducalestaque,littlebayatlaciotat,themandola","blackcolourpencil,colourpencilsepia,darkcolouredpencil,pencil,sketchingpastel,willowcharcoal","windowsopensimultaneously,portraitdemetzinger,greatwave,squareswithconcentriccircles,yellowredblue","deathandfire,inthestyleofkairouan,orientalpleasuregardenanagoria,polyphony2,redwaistcoat,thekiss","compositionredyellowblue,redtree,graytree,sangiorgiomaggioreatdusk,waterlilypond,wheatstacksendofsummer","scream,udnie,lesdemoisellesdavignon,seatedwoman,reservoirhortadeebro,convergence,summertime9a","almondblossom,irises,starrynight,wheatfieldwithcrows"} +else name="$1" +fi +input_cached img/style_$name.png +fx_vector_painting : +foreach { +split_opacity l[0] { ++luminance b. {10-$1}%,1,1 +f. "dmax = -1; nmax = 0; +for (n = 0, ++n<=8, +p = arg(n,-1,0,1,-1,1,-1,0,1); +q = arg(n,-1,-1,-1,0,0,1,1,1); +d = (j(p,q,0,0,0,1) - i)^2; +d>dmax?(dmax = d; nmax = n):nmax; +)" +blend shapeaverage +} +a c +} +fx_vector_painting_preview : +gui_split_preview "fx_vector_painting $*",${-3--1} +fx_draw_whirl : +foreach { split_opacity draw_whirl[0] $* a c } +fx_draw_whirl_preview : +gui_split_preview "fx_draw_whirl $*",${-3--1} +fx_stencilbw : +stencilbw $1,$2 +if $3||$4 foreach { +split_opacity /[0] 255 i[0] 100%,100%,1,1,$4 i[0] 100%,100%,1,1,$3 a[0-2] c hsv2rgb[0] a c +} fi +fx_stencilbw_preview : +gui_split_preview "fx_stencilbw $*",${-3--1} +fx_blackandwhite : +repeat $! { l. { +split_opacity rv to_rgb. s. c +*... $1 b... $2% +*.. $3 b.. $4% +*. $5 b. $6% ++[-3--1] /. {$1+$3+$5} c. 0,255 +adjust_colors ${7-11},0,255 +if $12||$13||$14 +100%,100% [-1]x2 +noise... 100,$17 b... $16% n... -$12,$12 +noise.. 100,$17 b.. $16% n.. -$13,$13 +noise. 100,$17 b. $16% n. -$14,$14 ++tones[-4] 3 b[-3--1] $15% +*[-6,-3] *[-4,-2] *[-2,-1] ++[-4--1] c. 0,255 +fi +rv a c } mv. 0 } +if $18 normalize_local $18,$19,$20,2%,1,0,255 fi +if $22 n 0,255 fi +if $21 to_pseudogray $21,1 fi +fx_blackandwhite_preview : +gui_split_preview "fx_blackandwhite $*",${-3--1} +fx_charcoal : +foreach { +split_opacity l[0] { +compose_channels max +w,h={w},{h} +if $5 r. 150%,150%,1,1,6 fi +if $4 equalize. n. 0,255 fi +sharpen {$1*3} cut 0,255 +if $6 +ir $7,$8 fi +ir[0] $2,$3 +if !$15 ==[0] 0 fi +-| ++*[0] $10 +*[0] $11 *[0] $9 +a[-3--1] c replace_color 0,0,0,0,0,$12,$13,$14 +r $w,$h,1,100%,2 +} +a c +} +fx_charcoal_preview : +gui_split_preview "fx_charcoal $*",${-3--1} +fx_colorize_interactive : skip "${4=},${5=},${6=}" +N=$! nm={n} +resolution:=arg(1+$3,512,1024,2048,0) +=> "[G"{`39`}"MIC] Colorize" +if [$9][0]==-1" || "[$8]!=[w,h] _gui_control_points= else _gui_control_points=$9 fi +N=$! +arg_palette1=0 l[] { +0 => "$4" ext={x} rm +if same(['$ext'],'gpl',-1,0) input_gpl "$4" arg_palette1=1 fi +onfail rm +} +if $arg_palette1 arg_palette1=[{$!-1}] fi +arg_palette2=0 l[] { +0 => "$5" ext={x} rm +if same(['$ext'],'gpl',-1,0) input_gpl "$5" arg_palette2=1 fi +onfail rm +} +if $arg_palette2 arg_palette2=[{$!-1}] fi +arg_grabber=0 l[] { +0 => "$6" ext={x} rm +i "$6" to_rgb arg_grabber=1 +onfail rm +} +if $arg_grabber arg_grabber=[{$!-1}] fi +repeat $N { +status=${x_colorize[$>]\ $1,$resolution,$2,$arg_palette1,$arg_palette2,$arg_grabber} +} +k[0-{$N-1}] +if $2==1 foreach { channels {s-3},{s-1} } +elif $2>=2 +foreach { +channels {s-3},{s-1} channels.. 0,{0,s-4} } +if $2>=3 split_colors[1] 0,256,8 fi +fi +=>[^] $nm +if !narg($status) status=-1 fi +u \{$1\}\{$2\}\{$3\}\{"$4"\}\{"$5"\}\{"$6"\}\{0\}\{{w},{h}\}\{$status\} +fx_colorize_interactive_preview : skip "${4=},${5=},${6=}" +if $7 +gui_print_preview "No preview\n available",,"(Control points cleared)" +u \{$1\}\{$2\}\{$3\}\{"$4"\}\{"$5"\}\{"$6"\}\{0\}\{{w},{h}\}\{-1\} +else gui_no_preview , +fi +fx_recolorize : +repeat int($!/2) { +if $3 s:=$>,$>+1 else s:=2*$>,2*$>+1 fi +l[$s] rv[0,1] { +channels[0] 0 to_rgb.. +to_rgba. split_opacity. !=. 0 +srgb2rgb[-3,-2] rgb2lab8[-3,-2] channels... 0 channels.. 1,2 ++.. 1 *.. . +gradient_norm... *. -1 watershed... . rm. -.. 1 ++diffusiontensors... $2,1,0.5,0.5 ==.. 0 *. .. rm.. +smooth.. .,{$1*80},0.8,60 rm. +a[-2,-1] c lab82rgb. rgb2srgb. +if $3 rgb2hsv. s. c i[2] 100%,100%,1,1,1 i[3] 100%,100%,1,2,0 a[0-2] c a[^0] c hsv2rgb rv fi +} +} +fx_recolorize_preview : +fx_recolorize $* a x +fx_bwrecolorize : +remove_opacity +if $4 n 0,255 fi +if !$5 +(${9--2}) r. 4,$8,1,1,-1 permute. yzcx +elif $5==1 +(0,255^0,255^0,255^255,255) +elif $5==2 +(255,0^255,0^255,0^255,255) +elif $5==3 +(0,44,115,143,196,244^0,20,84,119,184,235^0,5,44,73,144,200^255,255,255,255,255,255) +else +(0,359^1,1^1,1^255,255) r. 256,1,1,4,3 sh. 0,2 hsv2rgb. rm. +fi +if !$6 r. 256,1,1,4,1 +elif $6==1 r. 256,1,1,4,3 +elif $6==2 r. 256,1,1,4,5 c. 0,255 +else r. 256,1,1,4,6 +fi +if $7==1 sh. 0,2 rgb2hsv. sh. 2 f. x/w hsv2rgb.. rm[-2,-1] fi +l[^-1] { luminance adjust_colors ${1-3} } map[^-1] . rm. +fx_bwrecolorize_preview : +gui_split_preview "fx_bwrecolorize ${^0}",${-3--1} +fx_autofill_lineart : +foreach { +nm=${-gui_layer_name} +is_alpha:=s==2||s==4 +if $is_alpha sh 100% is_alpha:=im<128&&iM>128 rm. fi +if $is_alpha +channels 100% negate. +else +norm fi +n. 0,255 +l. { +repeat 1+$4 { +fact:=2^-$< +nw={0,max(1,round(w*$fact))} +nh={0,max(1,round(h*$fact))} ++r[0] $nw,$nh,1,1,2 if $2 normalize_local. , fi +>=. {min(99.5,$1)}% +if $colors +scale2x[colors] r[colors] .,1 *[colors,-1] rv[-2,-1] +fi +label_fg. 0,1 b.. 0.8 watershed. .. rm.. => colors +} ++area. 0,1 label_maxarea:="P=[xM,yM];i(#-2,P)-1" +if $3>1 +>. {$3*sqrt($3)} *[-2,-1] +b.. 0.8 watershed. .. +else +rm. +fi +rm.. +N:=iM +if $N +-. 1 +srand 0 {iM+1},1,1,3,">[j(-1) + u(135,225),u(0,0.7),u(0.4,0.9)]" +hsv2rgb. round. point. $label_maxarea,0,0,1,255 +map.. . rm. +fi +} +if !$is_alpha gui_set_layer_mode.. multiply fi +gui_set_layer_name. $nm" [colors]" +} +fx_autofill_lineart_preview : +foreach { +fx_autofill_lineart ${1-4} +if $5 k. else rv blend multiply fi +} +fx_colorize_lineart : +if $!<2 return fi +if $1<2 selection=0,1 else selection=0,1,2 fi +l[$selection] { +if !$1 +elif $1==1 rv +elif $1==2 rm[1] +elif $1==3 rm[2] rv +fi ++to_rgba[0] split_opacity. +.. 1 !=. 0 *[-2,-1] ++norm[1] n. 0,1 +histogram. 2,0,1 +if i(0)>i(1) *.. -1 +.. 1 fi rm. +b. $4% watershed.. . rm. +-. 1 +if !$2 rm[0] rv blend[0,1] multiply ind=-1 +elif $2==1 rm[0] rv ind=0 +elif $2==2 rm[0] ind=1 +elif $2==3 rv[1,2] ind=1 +elif $2==4 rv[0,1] ind=2 +fi +if $3" && "$ind>=0 l[$ind] { ++mix_channels (65536,256,1) +if $3==10 do +iM={1,iM} +if $iM>=0 ++==[1] $iM area:=is replace[1] $iM,-1 ++r. 100%,100%,1,3 *. [0] +rv[-2,-1] *. 255 a[-2,-1] c => $area +fi +while $iM>=0 else +label. +if $3<10 %. {$3+1} fi +repeat iM+1 { +==[1] $< area:=is +r. 100%,100%,1,[0] *. [0] rv[-2,-1] *. 255 a[-2,-1] c => $area } +fi +rm[0,1] +sort_list +,n +} fi +} +fx_colorize_lineart_preview : +fx_colorize_lineart $1,0,$3,$4 +fx_colorize_lineart_smart : +_fx_colorize_lineart_smart $*,-1 round +fx_colorize_lineart_smart_preview : +if $1==1" && "$!<2 gui_warning_preview "A top layer with color spots is missing, for this colorization mode." return +elif $1==2" && "$!<2 gui_warning_preview "A bottom color layer is missing, for this colorization mode." return +fi +_fx_colorize_lineart_smart ${1-3},0,${5--1} +_fx_colorize_lineart_smart : +if $1==1" && "$!<2 error "A top layer with color strokes is missing, for this colorization mode." +elif $1==2" && "$!<2 error "A bottom color layer is missing, for this colorization mode." +fi +min_color_area:=$15^2 +repeat $1?1:$! { inds=${arg0\ !!$1,$<,0--1} l[$inds] { +ind_lineart:=$1==1 +nm=${gui_layer_name[$ind_lineart]} =>[$ind_lineart] lineart +if $!>1 ind_colors:=$1!=1 nmc={$ind_colors,n} =>[$ind_colors] colors fi +if $!>=3 rm[2--1] fi +[lineart] +is_alpha:=s==2||s==4 +if $is_alpha sh. 100% is_alpha:=iM-im>64 rm. fi +if $is_alpha channels. 100% +else luminance. negate. fi +>. {255*(1-$2%)} +=> strokes +_keep_keycoords:=!$-1 +[strokes] close_binary. ${9-14},$min_color_area,$16 => new_strokes +if !$-1 ++negate[strokes] *. 255 to_rgb. ++-[new_strokes] [strokes] dilate. 2 +100%,100%,1,3,[0,128,255] j... .,0,0,0,0,1,.. rm[-2,-1] +if narg($keycoords) f[keycoords] "ellipse(#-1,(I)[0,2],3,3,0,1,[255,0,0]);I" rm[keycoords] fi +=> geometry +fi +if $1==1 +to_rgba[$colors] [colors],[colors] +f[colors] "i(#-1) = A<255?0:norm(R,G+0.3,B+0.6);I" +label_fg. 0 {1+iM},1,1,{colors,s+1} +f.. ">I[#-1,i]+=[ I(#"$colors"),1 ];I" +s. c,{-s+1} /[-2,-1] ++l[new_strokes] { * -1 + 1 +b 1% b.. 1 min } +watershed... .,0 rm. map.. . rm. +if !$8 rm[strokes] +else +j[strokes] [new_strokes] distance[strokes] 0 *[strokes] -1 +eq[new_strokes] 0 label_fg[new_strokes] 0,0 +if $min_color_area +area_fg[new_strokes] 0,0 >. $min_color_area *[new_strokes,-1] fi +watershed[new_strokes] [strokes],0 rm[strokes] +srgb2rgb. guided. [new_strokes],{1+$8/5},0 rgb2srgb. +fi +rm[new_strokes] +=> new_colors +elif $1==2 +j[strokes] [new_strokes] distance[strokes] 0 *[strokes] -1 +eq[new_strokes] 0 label_fg[new_strokes] 0,0 +if $min_color_area +area_fg[new_strokes] 0,0 xy_bg:=xM,yM >. $min_color_area *[new_strokes,-1] fi +watershed[new_strokes] [strokes],0 rm[strokes] +to_color[colors] sh[colors] 0,2 rgb2hsv8. rm. blend[colors,new_strokes] shapemedian sh[colors] 0,2 hsv82rgb. rm. +=>[colors] new_colors +else +j[strokes] [new_strokes] distance[strokes] 0 *[strokes] -1 +eq[new_strokes] 0 label_fg[new_strokes] 0,0 +if $min_color_area +area_fg[new_strokes] 0,0 xy_bg:=xM,yM >. $min_color_area *[new_strokes,-1] fi +watershed[new_strokes] [strokes],0 rm[strokes] +label[new_strokes] 0,0 ++histogram[new_strokes] {new_strokes,[iM+1,0,iM]} equalize. 1024 n. 0,240 +ind_bg:=xM +channels. 0,2 srand 0 +f. "[i,u(1,max(3,$6))/255,u(min(252,$7),255)/255]" +. sh. 0 rand. 0,360 rm. +hsi2rgb[-2,-1] *.. $5 *. {1-$5} +[-2,-1] round. +point. $ind_bg,0,0,1,255 point. 0,0,0,1,255 +map[new_strokes] . rm. +=>[new_strokes] new_colors +fi +ind_lineart=$lineart +ind_colors=$new_colors +if $4 +100%,100%,1,1,"const boundary = 1; +J(#"$new_colors",1)!=I(#"$new_colors") || J(#"$new_colors",0,1)!=I(#"$new_colors")" +*. 255 channels. -3,0 sh. 0,2 fc. 255,0,0 rm. +gui_set_layer_name. $nm" [region delimiters]" +mv. {$lineart+1} +fi +if !narg($nmc) gui_set_layer_name[$ind_colors] $nm" [colors]" fi +gui_set_layer_name[$ind_lineart] $nm +if $-1==-1 +if !$is_alpha gui_set_layer_mode[$ind_lineart] multiply fi +if $3 l[{$1==1}] { +if $is_alpha +100%,100%,1,3,255 blend. [0],alpha,1 rgb2hsv. channels. 2 *. 255 negate. +channels.. 0,{0,s-2} s={0,s} luminance[0] to_colormode[0] $s a c +else +s:=s to_rgb rgb2hsv channels 2 * 255 to_colormode $s +fi +} fi +elif !$-1 +if $is_alpha channels[$ind_lineart] 100% negate[$ind_lineart] fi to_rgb[$ind_lineart] +n[$ind_lineart] 180,255 +blend[$ind_lineart,$ind_colors] multiply ++select_color[geometry] 0,255,255,255 ==. 0 j[$ind_lineart] [geometry],0,0,0,0,1,. k[$ind_lineart] +elif $-1==1 +k[$ind_colors] +else +if $is_alpha channels[$ind_lineart] 100% negate[$ind_lineart] fi to_rgb[$ind_lineart] +if $3 l[$ind_lineart] { s:=s to_rgb rgb2hsv channels 2 * 255 to_colormode $s } fi +blend[$ind_lineart,$ind_colors] multiply k[$ind_lineart] +fi +} } +fx_gcd_norm_eq : skip ${1=0.5},${2=0.5},${3=2} +repeat $! l[$>] +split_opacity +l[0] +to_rgb srgb2rgb gcd_gamma $3 +sh 0 sh.. 2 *.. $1 *. $2 k[0] +norm / {sqrt(1+$1^2+$2^2)} +gcd_gamma {1/$3} rgb2srgb +done a c +done done +fx_gcd_norm_eq_preview : +gui_split_preview "fx_gcd_norm_eq ${1--2}",$-1 +fx_ditheredbw : +foreach { +split_opacity l[0] { +luminance adjust_colors ${1-3} b $6 +ditheredbw +if $4" || "$5 / 255 i[0] 100%,100%,1,2 fc[0] $4,{$5%} a c hsv2rgb fi +} +a c +} +fx_ditheredbw_preview : +gui_split_preview "fx_ditheredbw $*",${-3--1} +fx_engrave : +f:=arg(1+$14,1,1.5,2,3) +r:=$f*(0.2+$1) +foreach { +nm=${-gui_layer_name} pos=${-gui_layer_pos} +if $8 [0] fi +l[0] { split_opacity l[0] { +wh:=w,h +norm +if $14 r {100*$f}%,{100*$f}%,1,1,3 fi +if $7>0 [0] fi +l[0] { +amount:=(0.5+$2)^2 +repeat 5 { b $r unsharp $r,{1+$2} c 0,255 } +smooth 100,0.1,1,{$f*$3},{$f*$4} +>= {100-$5}% +} +if $7>0 +gradient_norm[1] b[1] $3 <[1] $7 max[0,1] +fi +if $6<0 area_fg 0,0 > {$f*$6*$6} +elif $6>0 == 0 area_fg 0,0 > {$f*$6*$6} == 0 +fi +* 255 +if $14 r $wh,1,1,2 fi +} a c } +if $!>1 +l[1] { split_opacity l[0] { +f:=arg(1+$14,1,1.5,2,3) +if $14 r {100*$f}%,{100*$f}%,1,100%,3 fi +b {$f*$9} segment_watershed 5 +if $14 r $wh,1,100%,2 fi +repeat $10 { guided 10,{$10*80} } +rgb2hsv s c +... $11 +.. {$12%} +. $13% a c hsv2rgb +} a c } +=>[0] "mode(darken),name("$nm"),pos("$pos")" +=>[1] "name("$nm" [colors]),pos("$pos")" +fi +} +fx_engrave_preview : +foreach { gui_split_preview "=> foo fx_engrave $* gui_merge_layers",${-3--1} } +fx_filaments : +density,length,contour,distortion,smoothness,angle,normalize,is_left,is_right,is_above,is_below,opacity,colormodel=${1-13} +foreach { +lightness. b. {$smoothness/10} g. xy a[-2,-1] c +100%,100%,1,3,"P = I(#-1); n = norm(P); a = atan2(P[1],P[0]) + (90 + $angle)°; [ 1/(1 + n)^0.25,cos(a),sin(a) ]" +rm.. +sh. 0 n. {max(1,100-$contour)%},1 rm. +100%,100% +if $density" && "$length +{$density*(w+h)/10},1,1,1,"* +begin( +const distortion = $distortion/1000; +const dmax = 2*($length%)*norm(w#0,h#0); +const opacity = ($opacity/10)%; +const is_none = !($is_left || $is_right || $is_above || $is_below); +const is_left = is_none || $is_left; +const is_right = is_none || $is_right; +const is_above = is_none || $is_above; +const is_below = is_none || $is_below; +const nb_throw_directions = sum(is_left,is_right,is_above,is_below); +throw_directions = vector(#nb_throw_directions); +k = 0; +is_left?(throw_directions[k++] = 0); +is_right?(throw_directions[k++] = 1); +is_above?(throw_directions[k++] = 2); +is_below?(throw_directions[k] = 3); +); +case = throw_directions[int(u(nb_throw_directions))%nb_throw_directions]; +case==0?(x = 0; y = u(h#0)%h#0; dx = 1; dy = 0.5*v): +case==1?(x = w#0 - 1; y = u(h#0)%h#0; dx = -1; dy = 0.5*v): +case==2?(x = u(w#0)%w#0; y = 0; dx = 0.5*v; dy = 1): +case==3?(x = u(w#0)%w#0; y = h#0 - 1; dx = 0.5*v; dy = -1); +n = norm(dx,dy); dx/=n; dy/=n; +repeat (dmax,dl, +!(inrange(x,0,w#0-1) && inrange(y,0,h#0-1))?break(); +polygon(#1,1,x,y,opacity,255); +u = i(#0,x,y,0,1,1); +v = i(#0,x,y,0,2,1); +dx*u + dy*v<0?(u = -u; v = -v); +dx = lerp(dx,u,distortion); +dy = lerp(dy,v,distortion); +n = norm(dx,dy)/i(#0,x,y,0,0,1); dx/=n; dy/=n; +x+=dx; y+=dy; +)" +fi +k[1] +if $normalize normalize_local. , fi +if $colormodel==1 *. -1 +. 255 c. 0,255 +elif $colormodel==2 i[0] 100%,100%,1,1,255 a c +elif $colormodel==3 i[0] 100%,100% a c +fi +} +fx_freaky_bw : +foreach { +split_opacity l[0] { +to_rgb ++expand_xy 1,0 channels. 0,4 +f. ">if (c!=4,i, +Rx = i(x+1,y,0,0) - i(x,y,0,0); +Ry = i(x,y+1,0,0) - i(x,y,0,0); +Rn = Rx^2 + Ry^2; +Gx = i(x+1,y,0,1) - i(x,y,0,1); +Gy = i(x,y+1,0,1) - i(x,y,0,1); +Gn = Gx^2 + Gy^2; +Bx = i(x+1,y,0,2) - i(x,y,0,2); +By = i(x,y+1,0,2) - i(x,y,0,2); +Bn = Bx^2 + By^2; +n = 1e-5 + max(Rn,Gn,Bn)^"{$2%}"; +val = 0; +Rn>=Gn && Rn>=Bn?(i(x,y,0,3) = Rx/n; val=Ry/n): +Gn>=Rn && Gn>=Bn?(i(x,y,0,3) = Gx/n; val=Gy/n): +(i(x,y,0,3) = Bx/n; val=By/n); +val +)" +channels. 3,4 +luminance[0] ia={0,ia} +s. c +f.. "i - i(x-1,y,0,0)" +f. "i - i(x,y-1,0,0)" ++[-2,-1] +ilaplacian. 0 +shrink_xy. 1 +. $ia n. 0,255 +j[0] [1],0,0,0,0,{$1%} rm. +adjust_colors ${3-5} +} +a c +} +fx_freaky_bw_preview : +gui_split_preview "fx_freaky_bw $*",${-3--1} +fx_ink_wash : +foreach { +split_opacity l[0] { +fx_pencilbw. $1,$2,0,0,0 +if $3==1 continue +elif !$3 fx_smooth_anisotropic. 60,$4,$5,$6,1.1,0.8,30,2,0,1,1,0,1,16 +fi +if $7==1 normalize_local. 2,6,5,24,1,0,255 +elif $7==2 normalize_local. 2,6,5,24,1,0,255 fx_contrast_swm 2,0,0.512 +elif $7==3 fx_normalize_local. $8,$9,$10,$11,1,3,0 +fi +} +a c +} +fx_gcd_layeretch : skip ${1=16},${2=7},${3=14},${4=0.12},${5=100},${6=5},${7=4.65},${8=0},${9=0},${10=3},${11=1},${12=1},${13=0} +repeat $! l[$>] +w={w} h={h} sc=800 ml=$1 wl={min($2,$ml-1)} +nwl={$ml-$wl} nwl={$nwl+($nwl%2==0)} +if !$13 nw=$w nh=$h +elif w>h nw={min($sc,w)} nh={$nw/w*h} +else nh={min($sc,h)} nw={$nh/h*w} fi +to_rgb[0] [0] r[1] $nw,$nh +norm[1] n[1] 0,255 +tones[1] $ml +repeat $ml-1 +[{-$<-1}] [{-$<-2}] done +b[-$ml--1] $4% +repeat $ml +pc={($>+1)/$ml} msk={2+$>} {w},{h},1,1,0 +if $12 ang={$>/$nwl} else ang=$pc fi +if $<>=$wl +noise. {(1-$pc)*$5},2 ==. 1 +blur_linear. {$6+$pc*($7-$6)}%,0,{$ang*360+u(-$9,$9)+$8} +quantize. $3,0 deform. {u*$10+1} +fi +r. $nw,$nh n. 0,255 +*[$msk,-1] progress {$pc*100} +done ++[-$ml--1] c. 0,255 +n. 0,255 negate. apply_gamma. $11 +if $13 r. $w,$h,1,3,5 c. 0,255 fi +k. +done done +fx_pencilbw : +pencilbw $1,$2 +if $3" || "$4 foreach { +split_opacity /[0] 255 i[0] 100%,100%,1,1,$4 i[0] 100%,100%,1,1,$3 a[0-2] c hsv2rgb[0] a c +} fi +fx_pencilbw_preview : +gui_split_preview "fx_pencilbw $*",${-3--1} +fx_pencil_portraitbw : +foreach { +split_opacity l[0] { ++b 2% ++blend divide rm.. luminance. +fx_ink_wash.. 0,167,0,0.5,0.54,2.25,0,2,6,5,20 ++fx_hardsketchbw. 80,32,1.89,0.21,31.46,0,0 ++fx_sketchbw.. 1,$2,180,$1,$3,0.03,0,0.6,0.1,0.6,0.25,1,0,1,0 +blend[0,1] darken +blend[0,1] multiply,0.5 +blend[0,1] lighten,$4 +normalize_local , +to_rgb +fc ${5-7} blend softlight +} +a c +} +fx_pencil_portraitbw_preview : +gui_split_preview "fx_pencil_portraitbw $*",${-3--1} +fx_stamp : +foreach { +split_opacity l[0] { +wh:=w,h +norm +if $7 r 150%,150%,1,1,3 fi +noise $5 +if $1 otsu 256 else >= $2% fi +b {($7?1.5:1)*$3},0 sharpen $4 n 0,255 +apply_curve 1,0,0,101,33,170,229,255,255 +if $7 r $wh,1,1,2 fi +if $6 negate fi +} +a c +} +fx_stamp_preview : +gui_split_preview "fx_stamp $*",${-3--1} +fx_gcd_etch : +skip ${1=125},${2=153},${3=171},${4=185},${5=0.1} skip ${6=50},${7=80},${8=50},${9=10} +skip ${10=15},${11=12},${12=20},${13=0} skip ${14=1},${15=0.3},${16=1},${17=0} +repeat $! l[$>] +w={w} h={h} sc=800 ml=4 +if w>h nw={min($sc,w)} nh={$nw/w*h} else nh={min($sc,h)} nw={$nh/h*w} fi +to_rgb[0] [0] if $16 r[1] $nw,$nh fi +b[1] $5% norm[1] negate[1] n[1] 0,255 ++c[1] 0,{255-$4} +c[1] {255-$3},128 +c[1] {255-$2},192 +c[1] {255-$1},255 n[-3--1] 0,255 +{w},{h},1,1,0 noise. $6,2 ==. 1 deriche. $10,0,x,0 +{w},{h},1,1,0 noise. $7,2 ==. 1 {w},{h},1,3,0 fc. 0,-1,0 smooth.. .,30,30,0 rm. +if $13 mirror. x fi +{w},{h},1,1,0 noise. $8,2 ==. 1 deriche. $11,0,y,0 +{w},{h},1,1,0 noise. $9,2 ==. 1 deriche. $12,0,y,0 +quantize[-$ml--1] 2,0 deform[-$ml--1] $14 +repeat $ml *[{2+$>},-1] done ++[-$ml--1] n. 0,255 rm[1] +negate. apply_gamma. $15 +if $16 r. $w,$h,1,3,5 c. 0,255 fi +if $17 blend[0,1] shapeaverage else k. fi +done done +fx_gcd_etch_preview : +gui_split_preview "fx_gcd_etch ${1--2}",$-1 +fx_color_abstraction : +foreach { +split_opacity l[0] { to_rgb b $1 s c quantize $2,1,0 area 0 ^ $3 n 0,255 } +a c +} +fx_color_abstraction_preview : +gui_split_preview "fx_color_abstraction $*",${-3--1} +fx_apply_haldclut : skip "${2=}" +mode=$1 +filename="$2" +strength,brightness,contrast,gamma,hue,saturation,normalize=${3-9} +if $mode<2 +if $!<2 gui_warning_preview "Input layer with HaldCLUT is missing" return fi +ind_clut:=$mode?$!-1:0 +else +l { +0 => "$2" ext={x} rm. +if lowercase(['$ext'])=='cube' input_cube "$2" +else i "$2" +fi +ind_clut:=$!-1 +onfail gui_warning_preview "Specified HaldCLUT filename not found" return +} +fi +if {$ind_clut,iM>512} /[$ind_clut] 255 fi +if $normalize==1" || "$normalize==3 +foreach { if $>!=$ind_clut split_opacity balance_gamma[0] , a c fi } +fi +repeat $! { if $>!=$ind_clut +map_clut[$>] [$ind_clut] j[$>] .,0,0,0,0,{$strength%} rm. fi } rm[$ind_clut] +adjust_colors $brightness,$contrast,$gamma,$hue,$saturation,0,255 +if $normalize==2" || "$normalize==3 +foreach { split_opacity n[0] 0,255 a c } +fi +fx_apply_haldclut_preview : skip "${2=}" +if $1<2 gui_warning_preview "No preview available in this mode" return fi +gui_split_preview "fx_apply_haldclut $1,\"$2\",${3--2}",${-3--1} +apply_from_clut_set : skip "${1=}" +m "_title : ('\"$""*\"') replace_str. \"_\",\" \" replace_str. \"iii\",\"III\" f. \"(!y || j(0,-1)==32) && +i>=_'a' && i<=_'z'?uppercase(i):i\" u {t} rm." +is_file_error=0 +l[] { +"$1" nb_cluts,ind:=l,($2-1)%l k[$ind] +onfail rm is_file_error=1 +} +if $is_file_error +gui_error_preview "Unable to load specified CLUT set" +else +_title {n} clut_name=${} +decompress_clut. {0$_is_preview?17:33} store. _clut +if 0$_is_preview +foreach { gui_split_preview "_apply_from_clut_set \"$1\",${2--1}",${-3--1} } +to "#"{$ind+1}"/"$nb_cluts":\n"$clut_name,0.01~,1~,5% +else +foreach { _apply_from_clut_set $"*" } +fi +fi +apply_from_clut_set_preview : skip "${1=}" +_is_preview=1 +k[0] apply_from_clut_set $"*" +_apply_from_clut_set : skip "${1=}" +if isin($9,1,3) split_opacity n[0] 0,255 a c fi +$_clut +map_clut.. . rm.. j.. .,0,0,0,0,{$3%} rm. +adjust_colors ${4-8},0,255 +if isin($9,2,3) split_opacity n[0] 0,255 a c fi +fx_adjust_colors : +adjust_colors ${1-5},0,255 +fx_adjust_colors_preview : +gui_split_preview "fx_adjust_colors $*",${-3--1} +fx_boost_chroma : +foreach { +split_opacity l[0] { ++to_rgb +if $2>=2 +srgb2rgb rgb2lab. +if $2==2 sh. 1 sh.. 2 equalize[-2,-1] rm[-2,-1] +else sh. 1,2 equalize. rm. +fi +lab2rgb. rgb2srgb +else +rgb2ycbcr. +if !$2 sh. 1 sh.. 2 equalize[-2,-1] rm[-2,-1] +else sh. 1,2 equalize. rm. +fi +ycbcr2rgb. +fi +j.. .,0,0,0,0,{$1%} rm. +} +a c +} +fx_boost_chroma_preview : +gui_split_preview "fx_boost_chroma $*",${-3--1} +fx_boost_fade : +foreach { +100%,100%,1,3 rand. 0,1 b. {10-10*($1/10)^0.5} n. 0,255 +to_colormode 0 a z +ac "s z match_histogram.. . rm.",${"arg0 $2,ycbcr_cbcr,lab_ab"} +} +fx_boost_fade_preview : +gui_split_preview "fx_boost_fade $1,$2",${-3--1} +#@cli afre_brightness : -300<=amount<=300,0<=smooth<=50 +#@cli : Enhance luminance brightness. +#@cli : Default values: 'amount=50' and 'smooth=0'. +afre_brightness : check "${1=50}>=-300 && ${2=0}>=0 +&& $1<=300 && $2<=50" +if !$1 return fi e[] "[afre]^_^) brightness: Enhance luminance brightness of image$? using amount=$1 and smooth=$2." +repeat $! l[$>] r={[im,iM]} . if $2>0 +afre_gui0_fast. 1,1e10 ++>.. {100-$2}% blend_fade[1,2] . k[0,1] fi +^.. {$1>0?0.5^($1/300):1} n.. $r afre_orien.. 1 ++n. 0,1 f. "begin(const P=2^($1/100)); 1-(1-i)^P" n. $r ++n.. 0,1 f. "begin(const A=0.5; const P=0.05); if(i<=A, +A-A*(i/A)^P,-A+A*((1-i)/A)^P)" n. 0,1 blend_fade[1,2] . k[0,1] +afre_y50. 1 * c $r done done +afre_brightness_preview : +afre_brightness $* +_fx_channel_processing : +adjust_colors ${1-3} b. $4% +if $5==1 c. $6%,$7% +elif $5==2 c. $6%,$7% n. 0,255 +elif $5==3 n. $6%,$7% +elif $5==4 ir. $6%,$7% *. 255 +fi +if $8!=256 quantize. $8,1,0 fi +if $9 equalize. fi +if $10 negate. fi +fx_channel_processing : +repeat $! { +l. { +split_opacity rv to_rgb. +fx_start_mix $11,$12 +ac. "_fx_channel_processing $1,$2,$3,$4,$5,$6,$7,$8,$9,$10",$13,1 +fx_end_mix $11 +if $!!=3 rv a c fi +} +mv. 0 +} +fx_channel_processing_preview : +gui_split_preview "fx_channel_processing $*",${-3--1} +fx_channels2layers : +foreach { +nm=${-gui_layer_name} to_rgb +if !$1 +s[0] c +r[0] 100%,100%,1,3,0,0,0,0,0,0 =>[0] "name("$nm" [red]),mode(add)" +r[1] 100%,100%,1,3,0,0,0,0,0,0.5 =>[1] "name("$nm" [green]),mode(add)" +r[2] 100%,100%,1,3,0,0,0,0,0,1 =>[2] "name("$nm" [blue]),mode(add)" +elif $1==1 +rgb2cmy[0] -[0] 255 s[0] c +r[0] 100%,100%,1,3,0,0,0,0,0,0 =>[0] "name("$nm" [cyan]),mode(difference)" +r[1] 100%,100%,1,3,0,0,0,0,0,0.5 =>[1] "name("$nm" [magenta]),mode(difference)" +r[2] 100%,100%,1,3,0,0,0,0,0,1 =>[2] "name("$nm" [yellow]),mode(difference)" ++[0-2] 255 +i[0] 100%,100%,1,3,255 =>[0] "name("$nm" [base]),mode(difference)" +else +rgb2hsv[0] s[0] c,-2 +r[0] 100%,100%,1,3,0,0 sh[0] 2 f. 1 rm. =>[0] "name("$nm" [color]),mode(normal)" +r[1] 100%,100%,1,3,0,0,0,0,0,1 =>[1] "name("$nm" [value]),mode(value)" +hsv2rgb[0,1] rv[0,1] +fi +} +fx_channels2layers_preview : +foreach { +fx_channels2layers $* +foreach { to "#"{1+$>},1,1,43,7,1,255 } +frame 1,1,0 frame 3,3,255 append_tiles , +} +fx_clut_from_ab : skip "${3=},${4=}" +if $!<2 error "At least two input layers are needed to run this filter." fi +repeat $!-1 { l[$<,-1] { +nm=${gui_layer_name..} +i[0] {a=0$_is_preview?32:64;[a,a,a]},4 f[1] ">I(#0,round(I(#2)*(w#0-1)/255))+=[R,G,B,1]; I" +l[0] { +s c,-3 +max. 1 /[-3,-1] ==. 0 inpaint_pde.. .,75%,1 distance. 0 *. {-1/(1+$5)} exp. +f.. "f = i(#-1); f*I + (1-f)*[x,y,z]*255/(w-1)" rm. +S:=arg(1+$2,16,25,36,49,64,81,100,121,144,169,225,256) if $S!=w r. $S,$S,$S,3,3 fi +c 0,255 +} +if $1==2 +is_png:=str=lowercase(['"$4"']);find(str,'.png')==size(str)-4 +is_cube:=str=lowercase(['"$4"']);find(str,'.cube')==size(str)-5 +if !$is_png" && "!$is_cube $!is_ciube error "Filename extension must be '.cube' or '.png'." fi +if $is_png r[0] {0,r=round(whd^0.5);[r,r]},1,3,-1 o[0] "$3/$4" +else +if {0,w>32} r3dx[0] 32 fi +output_cube[0] "$3/$4" +fi +rm[0] +else +r[0] {0,r=round(whd^0.5);[r,r]},1,3,-1 +if !$1 rm[1] fi +=>[0] "name(CLUT to '"$nm"')" +fi +if 0$_output_mode k[0] fi +} } +fx_clut_from_ab_preview : skip "${3=},${4=}" +if $!<2 gui_warning_preview "At least two input layers are needed to run this filter." return fi +_is_preview,_output_mode=1 fx_clut_from_ab 0,4,0,0,$5 +foreach { +r {a=round(cbrt(wh));[a,a,a]},3,-1 ++r3dx. 24 _fx_clut_from_ab_preview. +S:=arg(1+$2,16,25,36,49,64,81,100,121,144,169,225,256) if $S!=w#0 r[0] $S,$S,$S,3,3 fi +r[0] {0,r=round(whd^0.5);[r,r]},1,3,-1 +rr2d[0] $_preview_area_width,$_preview_area_height,2,1 r2dx. 70% +sh. 100% b. 1% n. 0,255 rm. +blend alpha +} +file_attr:=$1==2?2:1 +u "{$1}{$2}{$3}_"$file_attr"{$4}_"$file_attr"{$5}" +_fx_clut_from_ab_preview : +foreach { +fact:=256/w +pointcloud3d +3d 0.5,0.5,0.5 *3d $fact circles3d {1.25*$fact} o3d {0.004*$fact} +colorcube3d[] +l. { s3d l.. { s y,6 repeat $! { sh[$>] 4,100%,0,0 /. 1.25 rm. } } a y } +p3d. 1 +l. { repeat 8 { o:=a=$>;0.5*[a&1,(a>>1)&1,(a>>2)&1] ++3d[0] $o +-3d[0] $o } +3d } +axes3d 64,64,64,24,R,G,B,0 ++3d +pose3d 1.2451,0.120715,-0.893986,-58.3864,-0.572953,1.28275,-0.62477,-11.6557,0.696784,0.839071,1.08374,-333.008,0,0,217,1 +snapshot3d {max(512,0$_preview_area_width,0$_preview_area_height)},1.22,255,255,255 +autocrop frame 10,10,255 +to_rgba flood 0,0,0,20,1,1,255,255,255,0 +} +iain_cmyk_tone_p: +apply_parallel_overlap "iain_cmyk_tone ${1--2}",0,${-1} +iain_cmyk_tone: +repeat $! l[$>] split_opacity l[0] +rgb2cmyk ++split c ++apply_curve[1] 0,0,$1,128,$2,255,$3 ++apply_curve[2] 0,0,$4,128,$5,255,$6 ++apply_curve[3] 0,0,$7,128,$8,255,$9 ++apply_curve[4] 0,0,$10,128,$11,255,$12 +add[-1,-2,-3,-4] ++apply_curve[1] 0,0,$13,128,$14,255,$15 ++apply_curve[2] 0,0,$16,128,$17,255,$18 ++apply_curve[3] 0,0,$19,128,$20,255,$21 ++apply_curve[4] 0,0,$22,128,$23,255,$24 +add[-1,-2,-3,-4] ++apply_curve[1] 0,0,$25,128,$26,255,$27 ++apply_curve[2] 0,0,$28,128,$29,255,$30 ++apply_curve[3] 0,0,$31,128,$32,255,$33 ++apply_curve[4] 0,0,$34,128,$35,255,$36 +add[-1,-2,-3,-4] ++apply_curve[1] 0,0,$37,128,$38,255,$39 ++apply_curve[2] 0,0,$40,128,$41,255,$42 ++apply_curve[3] 0,0,$43,128,$44,255,$45 ++apply_curve[4] 0,0,$46,128,$47,255,$48 +add[-1,-2,-3,-4] +add[1,5] +add[2,5] +add[3,5] +add[4,5] +a[-1,-2,-3,-4] c ++sub[0,1] ++cmyk2rgb[0] rgb2hsv[-1] split[-1] c remove[-1,-3] mul[-1] 255 +apply_curve[-1] 0,0,$49,64,$50,128,$51,192,$52,255,$53 +compose_multiply[-1,-2] ++sub[0,-1] +if $54==0 +cmyk2rgb +luminance[0] ++luminance[-1] +compose_grainextract[-1,-2] +compose_grainmerge[0,-1] +keep[0] +fi +if $54==1 +keep[-1] +c 0,255 +cmyk2rgb +fi +if $54==2 +keep[-1] +cmyk2rgb +c 0,255 +fi +if $54==3 +keep[-1] +n 0,255 +cmyk2rgb +fi +if $54==4 +keep[-1] +cmyk2rgb +n 0,255 +fi +done a c done done +fx_balance_gamma : +foreach { +split_opacity +if $!>1 +!=. 0 *[0,-1] fi +l[0] { balance_gamma ${1-3} if $4 n 0,255 fi } +a c +} +fx_balance_gamma_preview : +gui_split_preview "fx_balance_gamma $*",${-3--1} +fx_colorblind_preview : +gui_split_preview "colorblind $*",${-3--1} +jl_colorgrading : +if $1>0.01 +map_tones_fast 5%,$1 +fi +_ystr="" +if $2>0 +_mymin={$2} +_mymax={255-$2} +apply_channels "-apply_curve 0,0,$_mymin,255,255",ycbcr_cr,0 +apply_channels "-apply_curve 0,0,0,255,$_mymax",ycbcr_cb,0 +fi +if $2<0 +_mymin={-$2} +_mymax={255+$2} +apply_channels "-apply_curve 0,0,$_mymin,255,255",ycbcr_cb,0 +apply_channels "-apply_curve 0,0,0,255,$_mymax",ycbcr_cr,0 +fi +if $3!=1.0 +fx_equalize_s $3,0 +fi +if $4!=1.0 +apply_channels "-apply_gamma $4",hsv_s,0 +fi +if $5!=0 +_p1={64-$5} +_p2={192+$5} +_ystr=$_ystr" apply_curve 1,0,0,64,$_p1,192,$_p2,255,255" +fi +if $6!=0 +_p3={64-$6} +_ystr=$_ystr" apply_curve 1,0,0,64,$_p3,128,128,192,192,255,255" +fi +if $7!=0 +_p4={192+$7} +_ystr=$_ystr" apply_curve 1,0,0,64,64,128,128,192,$_p4,255,255" +fi +if $8>0 +_ystr=$_ystr" apply_curve 1,$8,0,64,64,255,255" +fi +if $9>0 +_p5=0 +_ystr=$_ystr" apply_curve 0,0,$9,255,255" +fi +if $9<0 +_p5={255+$9} +_ystr=$_ystr" apply_curve 0,0,0,255,$_p5" +fi +if $10>0 +_p6=$10 +_p7={255-$10} +_ystr=$_ystr" apply_curve 0,0,0,$_p6,0,$_p7,255,255,255" +fi +if $10<0 +_p6={-$10} +_p7={255+$10} +_ystr=$_ystr" apply_curve 0,0,$_p6,255,$_p7" +fi +if $11!=1.0 +_ystr=$_ystr" apply_gamma $11" +fi +if '$_ystr'!=0 +apply_channels $_ystr,hsv_v,0 +fi +if $12>0 +to_rgb +rgb2hsl s. c rm.. rm.. *. 255 apply_curve. 1,0,0,63,0,127,255,192,0,255,0 +unsharp[0] 5%,$12,0 c. 0,255 c.. 0,255 rv[-1,-2] a[-1,-2] c blend alpha +fi +if $13>0 +unsharp 1%,$13,0 +c. 0,255 +fi +if $14 +if $16+$22>360 +_shh={($16+$22-360)/360} +else +_shh={($16+$22)/360} +fi +_shs={$21/100} +_shlev={$23} +_midh={$19/360} +_mids={$18/100} +_midlev={$20} +_highh={$16/360} +_highs={$15/100} +_highlev={$17} +_satlev={$24} +color_grade $_shh,$_shs,$_shlev,$_midh,$_mids,$_midlev,$_highh,$_highs,$_highlev,$_satlev +fi +if $24!=1.0 +fx_equalize_s $24,0 +fi +if $25>0 +unsharp 0.5,$25 +c 0,255 +fi +if $26>0 +apply_channels "-denoise_haar $26",ycbcr_cb,0 +apply_channels "-denoise_haar $26",ycbcr_cr,0 +fi +color_grade : +_shadownrgb=${-jl_hsv_to_rgb" "$1,1.0,{$2*0.40}} +_midtonesrgb=${-jl_hsv_to_rgb" "$4,1.0,{$5*0.40}} +_highlightsrgb=${-jl_hsv_to_rgb" "$7,1.0,{$8*0.40}} +_crsh=${-arg" 1,"$_shadownrgb} +_mgsh=${-arg" 2,"$_shadownrgb} +_ybsh=${-arg" 3,"$_shadownrgb} +_shlev=$3 +_crmid=${-arg" 1,"$_midtonesrgb} +_mgmid=${-arg" 2,"$_midtonesrgb} +_ybmid=${-arg" 3,"$_midtonesrgb} +_midlev=$6 +_crhigh=${-arg" 1,"$_highlightsrgb} +_mghigh=${-arg" 2,"$_highlightsrgb} +_ybhigh=${-arg" 3,"$_highlightsrgb} +_highlev=$9 +_satlev=$10 +_lowinred=0 +_hiinred=255 +_lowingreen=0 +_hiingreen=255 +_lowinblue=0 +_hiinblue=255 +_gammared=0. +_gammagreen=0. +_gammablue=0. +_lowoutred=0 +_hioutred=255 +_lowoutgreen=0 +_hioutgreen=255 +_lowoutblue=0 +_hioutblue=255 +if $_crmid>0 +_gammared={$_gammared+0.4*$_crmid/100.} +_gammagreen={$_gammagreen-0.3*$_crmid/100.} +_gammablue={$_gammablue-0.3*$_crmid/100.} +fi +if $_crmid<0 +_gammared={$_gammared+0.3*$_crmid/100.} +_gammagreen={$_gammagreen-0.4*$_crmid/100.} +_gammablue={$_gammablue-0.4*$_crmid/100.} +fi +if $_mgmid>0 +_gammared={$_gammared-0.3*$_mgmid/100.} +_gammagreen={$_gammagreen+0.4*$_mgmid/100.} +_gammablue={$_gammablue-0.3*$_mgmid/100.} +fi +if $_mgmid<0 +_gammared={$_gammared-0.4*$_mgmid/100.} +_gammagreen={$_gammagreen+0.3*$_mgmid/100.} +_gammablue={$_gammablue-0.4*$_mgmid/100.} +fi +if $_ybmid>0 +_gammared={$_gammared-0.3*$_ybmid/100.} +_gammagreen={$_gammagreen-0.3*$_ybmid/100.} +_gammablue={$_gammablue+0.4*$_ybmid/100.} +fi +if $_ybmid<0 +_gammared={$_gammared-0.4*$_ybmid/100.} +_gammagreen={$_gammagreen-0.4*$_ybmid/100.} +_gammablue={$_gammablue+0.3*$_ybmid/100.} +fi +_gammared={$_gammared+1.} +_gammagreen={$_gammagreen+1.} +_gammablue={$_gammablue+1.} +if $_midlev>0 +_gammared={$_gammared+0.4*$_midlev/100.} +_gammagreen={$_gammagreen+0.4*$_midlev/100.} +_gammablue={$_gammablue+0.4*$_midlev/100.} +fi +if $_midlev<0 +_gammared={$_gammared+0.3*$_midlev/100.} +_gammagreen={$_gammagreen+0.3*$_midlev/100.} +_gammablue={$_gammablue+0.3*$_midlev/100.} +fi +_crsh={$_crsh*0.3} +_mgsh={$_mgsh*0.3} +_ybsh={$_ybsh*0.3} +if $_crsh>0 +_lowingreen={$_lowingreen+$_crsh} +_lowinblue={$_lowinblue+$_crsh} +_lowoutred={$_lowoutred+$_crsh} +else +_lowinred={$_lowinred-$_crsh} +_lowoutgreen={$_lowoutgreen-$_crsh} +_lowoutblue={$_lowoutblue-$_crsh} +fi +if $_mgsh>0 +_lowinred={$_lowinred+$_mgsh} +_lowinblue={$_lowinblue+$_mgsh} +_lowoutgreen={$_lowoutgreen+$_mgsh} +else +_lowingreen={$_lowingreen-$_mgsh} +_lowoutred={$_lowoutred-$_mgsh} +_lowoutblue={$_lowoutblue-$_mgsh} +fi +if $_ybsh>0 +_lowinred={$_lowinred+$_ybsh} +_lowingreen={$_lowingreen+$_ybsh} +_lowoutblue={$_lowoutblue+$_ybsh} +else +_lowinblue={$_lowinblue-$_ybsh} +_lowoutred={$_lowoutred-$_ybsh} +_lowoutgreen={$_lowoutgreen-$_ybsh} +fi +if $_shlev>0 +_lowoutred={$_lowoutred+$_shlev} +_lowoutgreen={$_lowoutgreen+$_shlev} +_lowoutblue={$_lowoutblue+$_shlev} +fi +if $_shlev<0 +_lowinred={$_lowinred-$_shlev} +_lowingreen={$_lowingreen-$_shlev} +_lowinblue={$_lowinblue-$_shlev} +fi +_crhigh={$_crhigh*0.3} +_mghigh={$_mghigh*0.3} +_ybhigh={$_ybhigh*0.3} +if $_crhigh>0 +_hiinred={$_hiinred-$_crhigh} +_hioutgreen={$_hioutgreen-$_crhigh} +_hioutblue={$_hioutgreen-$_crhigh} +else +_hiingreen={$_hiingreen+$_crhigh} +_hiinblue={$_hiinblue+$_crhigh} +_hioutred={$_hioutred+$_crhigh} +fi +if $_mghigh>0 +_hiingreen={$_hiingreen-$_mghigh} +_hioutred={$_hioutred-$_mghigh} +_hioutblue={$_hioutblue-$_mghigh} +else +_hiinred={$_hiinred+$_mghigh} +_hiinblue={$_hiinblue+$_mghigh} +_hioutgreen={$_hioutgreen+$_mghigh} +fi +if $_ybhigh>0 +_hiinblue={$_hiinblue-$_ybhigh} +_hioutred={$_hioutred-$_ybhigh} +_hioutgreen={$_hioutgreen-$_ybhigh} +else +_hiinred={$_hiinred+$_ybhigh} +_hiingreen={$_hiingreen+$_ybhigh} +_hioutblue={$_hioutblue+$_ybhigh} +fi +if $_highlev>0 +_hiinred={$_hiinred-$_highlev} +_hiingreen={$_hiingreen-$_highlev} +_hiinblue={$_hiinblue-$_highlev} +fi +if $_highlev<0 +_hioutred={$_hioutred+$_highlev} +_hioutgreen={$_hioutgreen+$_highlev} +_hioutblue={$_hioutblue+$_highlev} +fi +levels $_lowinred,$_hiinred,$_gammared,$_lowoutred,$_hioutred,19 +levels $_lowingreen,$_hiingreen,$_gammagreen,$_lowoutgreen,$_hioutgreen,20 +levels $_lowinblue,$_hiinblue,$_gammablue,$_lowoutblue,$_hioutblue,21 +jl_colorgrading_preview : +gui_split_preview "-jl_colorgrading $*",$-1 +fx_mask_color : +cs=rgb,rgb_r,rgb_g,rgb_b,lrgb,lrgb_r,lrgb_g,lrgb_b,ycbcr_y,ycbcr_cbcr,ycbcr_cb,ycbcr_cr,ycbcr_cg,lab,lab_l,lab_ab,lab_a,lab_b,lch,lch_c,lch_h,hsv,hsv_h,hsv_s,hsv_v,hsi,hsi_i,hsl,hsl_l,cmyk_c,cmyk_m,cmyk_y,cmyk_k,yiq_y,yiq_iq +foreach { +to_rgb nm={n} => ${-gui_layer_name} ++x_mask_color ${arg0\ $1,$cs},$2,$3 +if $4==1 channels. 100% fi +=> $nm rv +} +fx_color_presets : +category=${arg0\ $1,abigailgonzalez,alexjordan,berat,cinematic,cinematic_travel,creative,editingcorp,ericellerbrock,filtergrade,hollywood,inavision,jtsemple,kylerholland,lutifyme,michaelezra,moviz,ohadperetz,oliviosarikas,on1,picturefx,pixelmator,pixlsus,purple11,rocketstock,shamoonabbasi,smallhd,toddblankenship,youssefhossam,others} +presets=${-_fx_cluts_$category} +index:=arg(1+$1,${2-30}) +thumbsize,strength,brightness,contrast,gamma,hue,saturation,normalize=${31-38} +if $normalize==1" || "$normalize==3 +foreach { split_opacity balance_gamma[0] , a c } +fi +if $index>=2 +path_clut=${-path_cache} +name=${arg0\ $index-2,$presets} +clut $name,{0$_is_preview" && "!isfile(['{/${path_clut}clut_$name.cimgz}'])?17:48} +repeat $!-1 { if $strength<100 +map_clut[$>] . j[$>] .,0,0,0,0,{$strength%} rm. else map_clut[$>] . fi } +rm. +adjust_colors $brightness,$contrast,$gamma,$hue,$saturation,0,255 +if $normalize==2" || "$normalize==3 foreach { split_opacity n[0] 0,255 a c } fi +elif $index==1 +adjust_colors $brightness,$contrast,$gamma,$hue,$saturation,0,255 +if $normalize==2" || "$normalize==3 foreach { split_opacity n[0] 0,255 a c } fi +else +foreach { if max(w,h)>$thumbsize rr2d $thumbsize,$thumbsize,0,2 fi } +N=$! +to "Original",1%,1%,7.5%,2 +Np:=narg($presets) +repeat $Np { +clut_name=${arg0\ $>,$presets} +clut $clut_name mv. $N +repeat $N { +if $strength<100 [$>] +map_clut. [$N] j.. .,0,0,0,0,{$strength%} rm. else +map_clut[$>] [$N] fi +adjust_colors. $brightness,$contrast,$gamma,$hue,$saturation,0,255 +if $normalize==2" || "$normalize==3 l. { split_opacity n[0] 0,255 a c } fi +strcapitalize $clut_name clut_name=${} +to. $clut_name,0.01~,0.01~,7.5%,2 +} +rm[$N] +progress {$>*100/($Np-1)} +} +k[$N--1] frame 1,1,0,0,0,255 - 128 append_tiles {s=floor(sqrt($!));w>h?[s,0]:[0,s]} + 128 +fi +fx_color_presets_preview : +_is_preview=1 +index:=arg(1+$1,${2-30}) +if !$index gui_warning_preview "Preview disabled in 'Collage' mode" +else gui_split_preview "fx_color_presets $*",${39-41} +fi +u "{$1}{$2}_"{2*!$1}"{$3}_"{2*($1==1)}"{$4}_"{2*($1==2)}"{$5}_"{2*($1==3)}"{$6}_"{2*($1==4)}"{$7}_"{2*($1==5)}"{$8}_"{2*($1==6)}"{$9}_"{2*($1==7)}"{$10}_"{2*($1==8)}"{$11}_"{2*($1==9)}"{$12}_"{2*($1==10)}"{$13}_"{2*($1==11)}"{$14}_"{2*($1==12)}"{$15}_"{2*($1==13)}"{$16}_"{2*($1==14)}"{$17}_"{2*($1==15)}"{$18}_"{2*($1==16)}"{$19}_"{2*($1==17)}"{$20}_"{2*($1==18)}"{$21}_"{2*($1==19)}"{$22}_"{2*($1==20)}"{$23}_"{2*($1==21)}"{$24}_"{2*($1==22)}"{$25}_"{2*($1==23)}"{$26}_"{2*($1==24)}"{$27}_"{2*($1==25)}"{$28}_"{2*($1==26)}"{$29}_"{2*($1==27)}"{$30}_"{2*($1==28)}"{$31}_"{1+!$index}"{$32}{$33}{$34}{$35}{$36}{$37}{$38}{$39}{$40,$41}""{0}_"{2*($1!=28)}"{0}_"{2*!$1}"{0}_"{2*($1==1)}"{0}_"{2*($1==2)}"{0}_"{2*($1==3)}"{0}_"{2*($1==4)}"{0}_"{2*($1==5)}"{0}_"{2*($1==6)}"{0}_"{2*($1==7)}"{0}_"{2*($1==8)}"{0}_"{2*($1==9)}"{0}_"{2*($1==10)}"{0}_"{2*($1==11)}"{0}_"{2*($1==12)}"{0}_"{2*($1==13)}"{0}_"{2*($1==14)}"{0}_"{2*($1==15)}"{0}_"{2*($1==16)}"{0}_"{2*($1==17)}"{0}_"{2*($1==18)}"{0}_"{2*($1==19)}"{0}_"{2*($1==20)}"{0}_"{2*($1==21)}"{0}_"{2*($1==22)}"{0}_"{2*($1==23)}"{0}_"{2*($1==24)}"{0}_"{2*($1==25)}"{0}_"{2*($1==26)}"{0}_"{2*($1==27)}"{0}" +_fx_cluts_abigailgonzalez : +u blade_runner,blue_house,blue_ice,caribe,cinema,cinema_2,cinema_3,cinema_4,cinema_5,cinema_noir,cinematic_for_flog,day_4nite,eterna_for_flog,filmic,fuji_hdr,goldengate,matrix,monochrome_1,monochrome_2,old_west,science_fiction +_fx_cluts_alexjordan : +u action_magenta_01,action_red_01,adventure_1453,agressive_highligjtes_recovery_5,bleech_bypass_green,bleech_bypass_yellow_01,blue_dark,blue_shadows_01,bright_green_01,brownish,colorful_0209,conflict_01,contrast_with_highlights_protection,contrasty_afternoon,contrasty_green,cross_process_cp_130,cross_process_cp_14,cross_process_cp_15,cross_process_cp_16,cross_process_cp_18,cross_process_cp_3,cross_process_cp_4,cross_process_cp_6,dark_green_02,dark_green_1,dark_place_01,dream_1,dream_85,faded_retro_01,faded_retro_02,film_0987,film_9879,film_high_contrast,flat_30,green_2025,green_action,green_afternoon,green_conflict,green_day_01,green_day_02,green_g_09,green_indoor,green_light,harsh_day,harsh_sunset,highlights_protection,indoor_blue,low_contrast_blue,low_key_01,magenta_day,magenta_day_01,magenta_dream,memories,moonlight_01,mostly_blue,muted_01,night_01,only_red,only_red_and_blue,operation_yellow,orange_dark_4,orange_dark_7,orange_dark_look,orange_underexposed,protect_highlights_01,red_afternoon_01,red_day_01,red_dream_01,retro_brown_01,retro_magenta_01,retro_yellow_01,saturated_blue,smart_contrast,subtle_blue,subtle_green,yellow_55b,yellow_film_01 +_fx_cluts_berat : +u brownbm,cineblue,cinebm4k,goldentime,green_and_orange,monochrome,sevsuz,sunlightlove,western,westernlut2 +_fx_cluts_cinematic : +u deep,dimension,enchanted,flavin,frosted,shine,ultra_water,wipe +_fx_cluts_cinematic_travel : +u blue_cold_fade,bright_teal_orange,bright_warm,clear_teal_fade,cold_clear_blue,cold_clear_blue_1,deep_blue,deep_dark_warm,deep_high_contrast,deep_teal_fade,deep_warm_fade,faded_green,greenish_contrasty,greenish_fade,greenish_fade_1,hard_teal_orange,neutral_teal_orange,neutral_warm_fade,smooth_clear,smooth_green_orange,smooth_teal_orange,teal_fade,very_warm_greenish,warm_dark_contrasty,warm_fade,warm_fade_1,warm_neutral,warm_sunset_red,warm_teal +_fx_cluts_creative : +u anime,bleachbypass_1,bleachbypass_2,bleachbypass_3,bleachbypass_4,candlelight,colornegative,crispwarm,crispwinter,dropblues,edgyember,fallcolors,foggynight,futuristicbleak_1,futuristicbleak_2,futuristicbleak_3,futuristicbleak_4,horrorblue,latesunset,moonlight,nightfromday,redblueyellow,smokey,softwarming,tealmagentagold,tealorange,tealorange_1,tealorange_2,tealorange_3,tensiongreen_1,tensiongreen_2,tensiongreen_3,tensiongreen_4 +_fx_cluts_editingcorp : +u ampio,asistas,atusa,basuco,beati,bisogno,boyado,calidum,colore,convold,cosa,culor,dimmer,ensaya,falua,farkling,fatos,fezzle,filo,foresta,huesio,husmes,huyan,ideo,jarklin,lavark,levex,litore,loro,lotta,maesky,mercato,molti,motus,mucca,nigrum,onda,padre,partia,perso,picola,randas,satid,scala,scrittle,seges,selor,sensum,sino,soldi,strano,stringa,tirare,tutto,upglow,valize,valsky,vita,vubes,wavefire +_fx_cluts_ericellerbrock : +u avalanche,black_star,helios,hydracore,hypnosis,killstreak,nemesis,night_blade_4,paladin,seringe_4,serpent,terra_4,victory,yellowstone +_fx_cluts_filtergrade : +u fgcinebasic,fgcinebright,fgcinecold,fgcinedrama,fgcinetealorange_1,fgcinetealorange_2,fgcinevibrant,fgcinewarm +_fx_cluts_hollywood : +u 12_years_a_slave,1917,ad_astra,aladdin,ant-man,aquaman,avengers_endgame,baby_driver,bad_boys_for_life,beauty_and_the_beast,black_panther,bohemian_rhapsody,bombshell,captain_marvel,city_of_god,creed_2,doctor_strange,dunkirk,fight_club,ford_v_ferrari,green_book,greyhound,i_tonya,inception,jojo_rabbit,joker,jumanji_the_next_level,jurassic_world_fallen_kingdom,justice_league,kingsman_the_golden_circle,knives_out,la_la_land,little_women,logan,mad_max_fury_road,marriage_story,moonlight_2,mother!,no_time_to_die,once_upon_a_time_in_hollywood,parasite,pirates_of_the_caribbean,rocketman,separation,sicario,spider-man_far_from_home,spotlight,star_wars_the_rise_of_skywalker,sully,tenet,the_dark_knight,the_darkest_hour,the_gentelmen,the_grand_budapest_hotel,the_hurt_locker,the_irishman,the_lighthouse,the_lobster,the_martian,the_revenant,the_shape_of_water,the_social_network,the_two_popes,the_way_back,thor_ragnarok,top_gun_maverick,uncut_gems,underwater,venom,war_for_the_planet_of_the_apes,wolf_of_wall_street,wonder_woman,x-men_dark_phoenix,zombieland_double_tap +_fx_cluts_inavision : +u 7drk_21,bc_darkum,brown_mobster,cold_ice,dark_man_x,film_gb-19,formula_b,gremerta,hitman,jwick_21,london_nights,louetta,nightlife,vfb_21,vintage_mob +_fx_cluts_jtsemple : +u brightgreen,crispromance,crushin,frostedbeachpicnic,justpeachy,lateafternoonwanderlust,lushgreensummer,magentacoffee,minimalistcaffeination,mysticpurplesunset,nostalgiahoney,springmorning,toastedgarden,winterlighthouse +_fx_cluts_kylerholland : +u kh1,kh2,kh3,kh4,kh5,kh6,kh7,kh8,kh9,kh10 +_fx_cluts_lutifyme : +u hackmanite,herderite,heulandite,hiddenite,hilutite,howlite,hypersthene +_fx_cluts_michaelezra : +u deepskintones2,deepskintones3 +_fx_cluts_moviz : +u moviz_1,moviz_2,moviz_3,moviz_4,moviz_5,moviz_6,moviz_7,moviz_8,moviz_9,moviz_10,moviz_11,moviz_12,moviz_13,moviz_14,moviz_15,moviz_16,moviz_17,moviz_18,moviz_19,moviz_20,moviz_21,moviz_22,moviz_23,moviz_24,moviz_25,moviz_26,moviz_27,moviz_28,moviz_29,moviz_30,moviz_31,moviz_32,moviz_33,moviz_34,moviz_35,moviz_36,moviz_37,moviz_38,moviz_39,moviz_40,moviz_41,moviz_42,moviz_43,moviz_44,moviz_45,moviz_46,moviz_47,moviz_48 +_fx_cluts_ohadperetz : +u cold_simplicity_2,d_o_1,retro_summer_3,subtle_yellow,teal_moonlight,true_colors_8,vintage_warmth_1 +_fx_cluts_oliviosarikas : +u analog_film_1,atomic_pink,beach_aqua_orange,beach_faded_analog,bw_but_yellow,city_dust,dark_orange_teal,day_to_night_kings_blue,duotone_blue_red,faded_pink-ish,flat_blue_moon,honey_light,infrared_-_dust_pink,neutral_pump,shade_kings_ink,sunset_aqua_orange,sunset_intense_violet_blue,sunset_violet_mood,violet_taste +_fx_cluts_on1 : +u 2-strip-process,aqua,aqua_and_orange_dark,berlin_sky,blues,bw_1,bw_2,bw_3,bw_4,bw_5,bw_6,bw_7,bw_8,bw_9,bw_10,chrome_01,cinematic-1,cinematic-2,cinematic-3,cinematic-4,cinematic-5,cinematic-6,cinematic-7,cinematic-8,cinematic-9,cinematic-10,classic_teal_and_orange,earth_tone_boost,fade_to_green,film_print_01,film_print_02,french_comedy,green_blues,green_yellow,landscape_1,landscape_2,landscape_3,landscape_4,landscape_5,landscape_6,landscape_7,landscape_8,landscape_9,landscape_10,lc_1,lc_2,lc_3,lc_4,lc_5,lc_6,lc_7,lc_8,lc_9,lc_10,moody_1,moody_2,moody_3,moody_4,moody_5,moody_6,moody_7,moody_8,moody_9,moody_10,nw-1,nw-2,nw-3,nw-4,nw-5,nw-6,nw-7,nw-8,nw-9,nw-10,oranges,portrait_1,portrait_2,portrait_3,portrait_4,portrait_5,portrait_6,portrait_7,portrait_8,portrait_9,portrait_10,purple_2,reds,reds_oranges_yellows,studio_skin_tone_shaper,vintage_chrome +_fx_cluts_picturefx : +u 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,faux_infrared_bw_1,faux_infrared_color_p2,faux_infrared_color_p3,faux_infrared_color_r0a,faux_infrared_color_r0b,faux_infrared_color_yp1,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,technicalfx_backlight_filter,zilverfx_bw_solarization,zilverfx_infrared,zilverfx_vintage_bw +_fx_cluts_pixelmator : +u black_white_01,black_white_02,black_white_03,black_white_04,black_white_05,black_white_06,pmcinematic_01,pmcinematic_02,pmcinematic_03,pmcinematic_04,pmcinematic_05,pmcinematic_06,pmcinematic_07,classic_films_01,classic_films_02,classic_films_03,classic_films_04,classic_films_05,landscape_01,landscape_02,landscape_03,landscape_04,landscape_05,modern_films_01,modern_films_02,modern_films_03,modern_films_04,modern_films_05,modern_films_06,modern_films_07,pmnight_01,pmnight_02,pmnight_03,pmnight_04,pmnight_05,urban_01,urban_02,urban_03,urban_04,urban_05,vintage_01,vintage_02,vintage_03,vintage_04,vintage_05 +_fx_cluts_pixlsus : +u amstragram,amstragram+,autumn,cinematic_lady_bird,cinematic_mexico,dark_blues_in_sunlight,delicatessen,expired_69,fadedlook,faded_print,hypressen,magenta_yellow,metropolis,modern_film,newspaper,night_spy,progressen,prussian_blue,seventies_magazine,street,sweet_bubblegum,sweet_gelatto,taiga,tarraco,unknown,uzbek_bukhara,uzbek_marriage,uzbek_samarcande,velvetia,warm_vintage,whiter_whites +_fx_cluts_purple11 : +u good_morning,going_for_a_walk,nah,once_upon_a_time,serenity,passing_by,smooth_sailing,undeniable,undeniable2,urban_cowboy,well_see,you_can_do_it +_fx_cluts_rocketstock : +u arabica_12,ava_614,azrael_93,bourbon_64,byers_11,chemical_168,clayton_33,clouseau_54,cobi_3,contrail_35,cubicle_99,django_25,domingo_145,faded_47,folger_50,fusion_88,hyla_68,korben_214,lenox_340,lucky_64,mckinnon_75,milo_5,neon_770,paladin_1875,pasadena_21,pitaya_15,reeve_38,remy_24,sprocket_231,teigen_28,trent_18,tweed_71,vireo_37,zed_32,zeke_39 +_fx_cluts_shamoonabbasi : +u city_7,coffee_44,date_39,day_for_night,denoiser_simple_40,desert_gold_37,directions_23,drop_green_tint_14,elegance_38,golden_night_softner_43,golden_sony_37,green_15,happyness_133,hlg_1_1,industrial_33,morning_6,morroco_16,night_king_141,rest_33,shadow_king_39,spy_29,thriller_2,turkiest_42,vintage_163,wooden_gold_20 +_fx_cluts_smallhd : +u apocalypse_this_very_moment,bboyz_2,bob_ford,life_giving_tree,moonrise,saving_private_damon,the_matrices +_fx_cluts_others : +u 60s,60s_faded,60s_faded_alt,alien_green,black_and_white,bleach_bypass,blue_mono,cinematic_01,cinematic_02,cinematic_03,color_rich,faded,faded_alt,faded_analog,faded_extreme,faded_vivid,expired_fade,expired_polaroid,extreme,fade,faux_infrared,golden,golden_bright,golden_fade,golden_mono,golden_vibrant,green_mono,hong_kong,instantc,k_tone_vintage_kodachrome,light_blown,lomo,mono_tinted,muted_fade,mute_shift,natural_vivid,nostalgic,orange_tone,pink_fade,purple,retro,rotate_muted,rotate_vibrant,rotated,rotated_crush,smooth_cromeish,smooth_fade,soft_fade,solarized_color,solarized_color_2,summer,summer_alt,sunny,sunny_alt,sunny_warm,sunny_rich,super_warm,super_warm_rich,sutro_fx,vibrant,vibrant_alien,vibrant_contrast,vibrant_cromeish,vintage,vintage_alt,vintage_brighter,warm,warm_highlight,warm_yellow +_fx_cluts_toddblankenship : +u bluearchitecture,bluehour,coldchrome,crispautumn,darkandsomber,hardboost,longbeachmorning,lushgreen,magichour,naturalboost,orangeandblue,softblackandwhite,waves +_fx_cluts_youssefhossam : +u cinematic_forest,city,darkness,hallowen_dark,sea +fx_tk_colortemp : +repeat $! l[$>] if $2==1 +luminance. to_rgb.. +s.. c avb={-2,127.5-ia} avg={-3,127.5-ia} avr={-4,127.5-ia} ++[-4] $avr +... $avg +.. $avb a[-4,-3,-2] c rv compose_luminance fi +fx_mix_lab 1,0,0,1,{if({$1>=0},{$1/4},{$1*0.75})},0,1,$1,0,0,2,0 done done +fx_tk_colortemp_preview : +gui_split_preview "fx_tk_colortemp ${1--2}",$-1 +fx_colorful_blobs : +N=12 +colorspace,bgR,bgG,bgB,bgA,display_controls,x0,y0,rx0,ry0,R0,G0,B0,p_x0,p_y0,p_rx0,p_ry0,x1,y1,rx1,ry1,R1,G1,B1,p_x1,p_y1,p_rx1,p_ry1,x2,y2,rx2,ry2,R2,G2,B2,p_x2,p_y2,p_rx2,p_ry2,x3,y3,rx3,ry3,R3,G3,B3,p_x3,p_y3,p_rx3,p_ry3,x4,y4,rx4,ry4,R4,G4,B4,p_x4,p_y4,p_rx4,p_ry4,x5,y5,rx5,ry5,R5,G5,B5,p_x5,p_y5,p_rx5,p_ry5,x6,y6,rx6,ry6,R6,G6,B6,p_x6,p_y6,p_rx6,p_ry6,x7,y7,rx7,ry7,R7,G7,B7,p_x7,p_y7,p_rx7,p_ry7,x8,y8,rx8,ry8,R8,G8,B8,p_x8,p_y8,p_rx8,p_ry8,x9,y9,rx9,ry9,R9,G9,B9,p_x9,p_y9,p_rx9,p_ry9,x10,y10,rx10,ry10,R10,G10,B10,p_x10,p_y10,p_rx10,p_ry10,x11,y11,rx11,ry11,R11,G11,B11,p_x11,p_y11,p_rx11,p_ry11=${1-138} +if !0$_is_preview display_controls=0 fi +if $1==1 srgb2cs=srgb2rgb cs2srgb=rgb2srgb +elif $1==2 srgb2cs=srgb2lab cs2srgb=lab2srgb +fi +{0,s=min(w,h);[s,s]},1,4 k. 100%,100%,1,1,1e-8 +repeat $N { +rx$>,ry$>:="P = ["${x$>},${y$>}"]; +R = ["${rx$>},${ry$>}"]; +oP = ["${p_x$>},${p_y$>}"]; +oP==[-1,-1]?P + [10,0]:P!=oP?R + P - oP:R" +if !isnan(${x$>}) +x,y,rx,ry,R,G,B:="const w1 = (w - 1)%; const h1 = (h -1)%; "round([${x$>}*w1,${y$>}*h1,${rx$>}*w1,${ry$>}*h1,${R$>},${G$>},${B$>}]) +r:=max(1,round(norm($x-$rx,$y-$ry))) +if $1 ($R^$G^$B) $srgb2cs. R,G,B={^} rm. fi +f. "* +pexp(x) = x<2?(res = 1; px = x^2; res+=-1.17282*px; px*=x; res+=0.683221*px; px*=x; res+=-0.110353*px):0; +const r = 1.2*"($r)"; +dist = norm(x-"$x",y-"$y")/r; +w = pexp(dist); +j(#0,0,0,0) += w*"$R"; +j(#0,0,0,0,1) += w*"$G"; +j(#0,0,0,0,2) += w*"$B"; +i + w; +" +fi +} +sh[0] 0,2 /. [1] if $1 $cs2srgb. fi +f[0] "*begin(bg = [ "$bgR,$bgG,$bgB,$bgA" ]); i(#1)<0.5?bg:[R,G,B,255]" k[0] +repeat $N { +if !isnan(${x$>})" && "$display_controls +x,y,rx,ry,R,G,B:="const w1 = (w - 1)%; const h1 = (h -1)%; "round([${x$>}*w1,${y$>}*h1,${rx$>}*w1,${ry$>}*h1,${R$>},${G$>},${B$>}]) +circle $x,$y,3,0.85,0xFFFFFFFF,{v=avg(crop($x-3,$y-3,7,7))>128?0:255;[v,v,v,255]} +rectangle {"const x = "$rx"; const y = "$ry"; [x-2,y-2,x+2,y+2]"},0.85,0xFFFFFFFF,{v=avg(crop($rx-3,$ry-3,7,7))>128?0:255;[v,v,v,255]} +line $x,$y,$rx,$ry,0.5,0xF0F0F0F0,255 line $x,$y,$rx,$ry,0.5,0x0F0F0F0F,0,0,0,255 +fi +} +if 0$_is_preview +u \{$colorspace\}\{$bgR,$bgG,$bgB,$bgA\}\{$display_controls\}\{$x0,$y0\}\{$rx0,$ry0\}\{$R0,$G0,$B0\}\{$x0,$y0,$rx0,$ry0\}\{$x1,$y1\}\{$rx1,$ry1\}\{$R1,$G1,$B1\}\{$x1,$y1,$rx1,$ry1\}\{$x2,$y2\}\{$rx2,$ry2\}\{$R2,$G2,$B2\}\{$x2,$y2,$rx2,$ry2\}\{$x3,$y3\}\{$rx3,$ry3\}\{$R3,$G3,$B3\}\{$x3,$y3,$rx3,$ry3\}\{$x4,$y4\}\{$rx4,$ry4\}\{$R4,$G4,$B4\}\{$x4,$y4,$rx4,$ry4\}\{$x5,$y5\}\{$rx5,$ry5\}\{$R5,$G5,$B5\}\{$x5,$y5,$rx5,$ry5\}\{$x6,$y6\}\{$rx6,$ry6\}\{$R6,$G6,$B6\}\{$x6,$y6,$rx6,$ry6\}\{$x7,$y7\}\{$rx7,$ry7\}\{$R7,$G7,$B7\}\{$x7,$y7,$rx7,$ry7\}\{$x8,$y8\}\{$rx8,$ry8\}\{$R8,$G8,$B8\}\{$x8,$y8,$rx8,$ry8\}\{$x9,$y9\}\{$rx9,$ry9\}\{$R9,$G9,$B9\}\{$x9,$y9,$rx9,$ry9\}\{$x10,$y10\}\{$rx10,$ry10\}\{$R10,$G10,$B10\}\{$x10,$y10,$rx10,$ry10\}\{$x11,$y11\}\{$rx11,$ry11\}\{$R11,$G11,$B11\}\{$x11,$y11,$rx11,$ry11\} +fi +fx_colorful_blobs_preview : +_is_preview=1 +rm {s=min($_preview_area_width,$_preview_area_height)/2;[s,s]},1,1 +fx_colorful_blobs $* +fx_colormap : +foreach { +split_opacity to_rgb[0] +if $1>=2 +index[0] {$1-2},$2,1 +elif $1==1 +(${5-28}) z. 0,{3*$4-1} +r. 3,{w/3},1,1,-1 permute. yzcx r. $3,1,1,3,3 +index[0] .,$2,1 rm. +else +autoindex[0] $3,$2,{$3<=32} +fi +a c +} +fx_colormap_preview : +gui_split_preview "fx_colormap $*",${-3--1} +is_ad,is_cu:=2*[isbool($1),$1==1] +u "{$1}{$2}""{$3}_"$is_ad"{$4}_"$is_cu"{${5-7}}_"$is_cu"{${8-10}}_"$is_cu"{${11-13}}_"$is_cu"{${14-16}}_"$is_cu"{${17-19}}_"$is_cu"{${20-22}}_"$is_cu"{${23-25}}_"$is_cu"{${26-28}}_"$is_cu"{$29}{$30,$31}" +#@cli afre_contrast : -200<=amount<=200 +#@cli : Enhance luminance contrast. +#@cli : Default value: 'amount=50'. +afre_contrast : check "${1=50}>=-200 && $1<=200" +if !$1 return fi e[] "[afre]^_^) contrast: Enhance luminance contrast of image$? using amount=$1." +repeat $! l[$>] r={[im,iM]} . afre_orien.. 1 +. +n. 0,1 f. "begin(const A=ia; const P=2^($1/100)); +if(i "Color curves" +repeat 5 { __xcc_C$>=0,0,100,100 } +if $4==$1 l[] { ($5) s -,-1 repeat $! { __xcc_C$>={$>,^} } rm } fi +if $3 +_xcc_colorbase=${arg\ {$4+1},rgb,cmy,cmyk,hsi,hsl,hsv,lab,lch,ycbcr} x_color_curves last +else +x_color_curves ${arg\ {$1+1},rgb,cmy,cmyk,hsi,hsl,hsv,lab,lch,ycbcr} +u "{$1}{$2}{$3}{$1}{"$__xcc_C0,-1,$__xcc_C1,-1,$__xcc_C2,-1,$__xcc_C3,-1,$__xcc_C4"}" +fi +if $2 +(0,255) (0;255) (0/255) r[-3--1] 2,2,2 a[-3--1] c +if $2==2 r. 256,256,256,3,3 r. 4096,4096,1,3,-1 +else r. 64,64,64,3,3 r. 512,512,1,3,-1 +fi +x_color_curves. last +fi +fx_curves_interactive_preview : +fx_curves_interactive $1,0,1,$4,"$5" +fx_customize_clut : +if !narg($_N) N=64 else N=$_N fi N1:=$N-1 +$N,$N,$N,4 +if $2 +uniform_distribution {(1+$2)^3},3 +repeat w { point.. {round($N1*I[$>])},1,{255*I[$>]},1 } rm. +fi +$=arg +repeat 24 { +mode=${arg{13+7*$<}} +if $mode +sr=${arg{14+7*$<}} sg=${arg{15+7*$<}} sb=${arg{16+7*$<}} +tr=${arg{17+7*$<}} tg=${arg{18+7*$<}} tb=${arg{19+7*$<}} +xyz:=round(($N1/255)*[$sr,$sg,$sb]) +point. $xyz,1,{$mode==2?[$tr,$tg,$tb]:[$sr,$sg,$sb]},1 +fi +} +s c,-3 +if $1<100 ++distance. 1 +if $1 ^. {1/(0.05+4*$1%)} else f. 0 fi +n. 0,1 => influence mv. -3 +fi +==. 0 inpaint_pde.. .,100%,1,20 rm. c. 0,255 +if $influence +100%,100%,100%,3,[x,y,z] n. 0,255 +j. ..,0,0,0,0,1,... +rm[-3,-2] +fi +if !$3 map_clut[^-1] . +else repeat $!-1 { ++luminance[$>] +map_clut[$>] .. -. [$>] +repeat $3 { guided. ..,2,50 } +[$>,-1] rm. +} fi +adjust_colors ${4-8},0,255 +if $9 foreach { split_opacity n[0] 0,255 a c } fi +if $10 +if $10==2 r. 256,256,256,3,5 c. 0,255 fi +siz:=w^1.5 r. $siz,$siz,1,3,-1 +mv. 0 +else rm. +fi +fx_customize_clut_preview : +if $11<7 gui_split_preview "fx_customize_clut ${1-9},0,0,${12--1}",$11 +elif $11==7 +rm fx_customize_clut ${1-9},1,0,${12--1} +elif $11>=8 +_N:=$11>=9?64:32 +k[0] to_rgb w,h={w},{h} ++fx_customize_clut ${1-9},1,0,${12--1} mv. 1 +r. $_N,$_N,$_N,3,-1 pointcloud3d. o3d. $12 +l[] { +if $2 +uniform_distribution {(1+$2)^3},3 +repeat w { circle3d {0,round($_N*I[$>])},0.75 col3d. {0,255*I[$>]} } rm[0] +fi +$=arg +repeat 24 { +mode=${arg{13+7*$<}} +if $mode +sr=${arg{14+7*$<}} sg=${arg{15+7*$<}} sb=${arg{16+7*$<}} +tr=${arg{17+7*$<}} tg=${arg{18+7*$<}} tb=${arg{19+7*$<}} +xy:=round(($_N/255)*[$sr,$sg]) +z:=round(($_N/255)*$sb)-0.1 +circle3d $xy,$z,0.75 col3d. {$mode==2?[$tr,$tg,$tb]:[$sr,$sg,$sb]} +fi +} +colorcube3d *3d. {$_N/255} o3d. 0.5 col3d. 0 p3d. 1 +} ++3d[2--1] +pose3d. 5.10656,2.04904,2.723,-316.115,-0.0815767,4.97762,-3.59262,-41.7094,-3.40685,2.95212,4.16756,-118.811,0,0,203,1 +if $w>$h +r2dx[0,1] {0,round(w/2)} +to[0] "Before",2,0,13,1,0.75 +to[1] "After",2,0,13,1,0.75 +a[0,1] y r[0] 100%,$h,1,3,0 +else +r2dy[0,1] {0,round(h/2)} +to[0] "Before",2,0,13,1,0.75 +to[1] "After",2,0,13,1,0.75 +a[0,1] x r[0] $w,100%,1,3,0 +fi +snapshot3d. {0,round(1.1*min(w,h))},1.2,64,64,64 +autocrop. -. 64 r. {0,max(w,$w-w)},{0,max(h,$h-h)},1,3,0,0,0.5,0.5 +. 64 +to. "RGB CLUT",2,0,13,1,0.75 +a {`$w>$h?_'x':_'y'`} +fi +#@cli afre_darksky : blend={ 0=softlight | 1=overlay },-100<=_contrast<=100,_smooth_method={ 0=fast_approx | 1=slow_accurate },0<=_smooth_radius<=3 +#@cli : Enhance landscape by darkening the sky. +#@cli : Default values: 'blend=0', 'contrast=0', 'smooth_method=0' and 'smooth_radius=0'. +afre_darksky : check "isbool(${1=0}) && ${2=0}>=-100 && isbool(${3=0}) && ${4=0}>=0 && $2<=100 && $4<=3" +b=${arg\ 1+$1,softlight,overlay} m=${arg\ 1+$3,fast,slow} rd={int($4)} e[] "[afre]^_^) darksky: Darken sky of image$? using blend="$b", contrast=$2, smooth_method="$m" and smooth_radius="$rd"." +repeat $! l[$>] if s<3||s>4 error[] "\n[afre]>_<) darksky: Select RGB images." fi done done +repeat $! l[$>] r0={[im,iM]} n 0,255 +channels 1 +channels.. 2 -[^0] +if $rd&&$3 afre_gui0_fast. $rd,1e0 elif $rd r1={[im,iM]} +median. {$rd*2+1} n. $r1 fi c. 0%,0 +. 127 afre_contrast. {$2} ++afre_y50.. 1 r1={[im,iM]} afre_orien[0] 1 if $1 blend. ..,$b rm.. +else l[-2--1] rv afre_softlight 100 done fi n. $r1 * +n $r0 done done +afre_darksky_preview : +afre_darksky $* +fx_decompose_channels : +if !$2 +if $4 to_rgba else to_rgb fi +foreach { +nm={n} +split_opacity +_s3=A _s4=A +_fx_decompose_channels$1[0] +s[0] c +if !$3 a x => $nm +else nm=${-gui_layer_name} repeat $! { gui_set_layer_name[$>] {``$nm}" ["${_s$>}"]" } +fi +} +else +channels 0 nbc:=3+($1==10) nb:=$nbc+$4 +if $3 repeat int($!/$nb) { l[0-{$nb-1}] { +a[0-{$nbc-1}] c _fx_recompose_channels$1[0] a c +} mv. 0 } +else foreach { s x,$nb a[0-{$nbc-1}] c _fx_recompose_channels$1[0] a c } +fi +fi +fx_decompose_channels_preview : +foreach { +_s3=A _s4=A +fx_decompose_channels $1,$2,1,$4 +if !$2 +fs:=round(min(w,h)*15%) +repeat $! { to[$>] ${_s$>},5,3,$fs,{max(2,round($fs/15))} } +to_rgba +fi +} +append_tiles , +_fx_decompose_channels0 : _s0=R _s1=G _s2=B +_fx_decompose_channels1 : rgb2hsv8 _s0=H _s1=S _s2=V +_fx_decompose_channels2 : rgb2hsl8 _s0=H _s1=S _s2=L +_fx_decompose_channels3 : rgb2hsi8 _s0=H _s1=S _s2=I +_fx_decompose_channels4 : rgb2yuv8 _s0=Y _s1=U _s2=V +_fx_decompose_channels5 : rgb2ycbcr _s0=Y _s1=Cb _s2=Cr +_fx_decompose_channels6 : rgb2xyz8 _s0=X _s1=Y _s2=Z +_fx_decompose_channels7 : rgb2lab8 _s0=L _s1=a _s2=b +_fx_decompose_channels8 : rgb2lch8 _s0=L _s1=c _s2=h +_fx_decompose_channels9 : rgb2cmy _s0=C _s1=M _s2=Y +_fx_decompose_channels10 : rgb2cmyk _s0=C _s1=M _s2=Y _s3=K +_fx_decompose_channels11 : rgb2yiq8 _s0=Y _s1=I _s2=Q +_fx_recompose_channels0 : +_fx_recompose_channels1 : hsv82rgb +_fx_recompose_channels2 : hsl82rgb +_fx_recompose_channels3 : hsi82rgb +_fx_recompose_channels4 : yuv82rgb +_fx_recompose_channels5 : ycbcr2rgb +_fx_recompose_channels6 : xyz82rgb +_fx_recompose_channels7 : lab82rgb +_fx_recompose_channels8 : lch82rgb +_fx_recompose_channels9 : cmy2rgb +_fx_recompose_channels10 : cmyk2rgb +_fx_recompose_channels11 : yiq82rgb +fx_detect_skin : +to_rgb +m "_fx_detect_skin : +if $5 balance_gamma 128,128,128 fi +if $1 detect_skin $2 else detect_skin $2,$6%,$7%,$8% fi +M:=iM b $3% * {255*$M/iM} * $4 c 0,255" +foreach { +if $9 ++_fx_detect_skin a c +if $9>1 sh 100% *. -1 +. 255 rm. fi +else _fx_detect_skin +fi +} +um _fx_detect_skin +fx_detect_skin_preview : +gui_split_preview "fx_detect_skin $*",${-3--1} +to_rgba +if !$1 +circle $6%,$7%,$8%,0.3,0,255,0,255 +circle $6%,$7%,$8%,1,0xFFFFFFFF,0,255,0,255 +line {$6-0.25*$8}%,{$7-0.25*$8}%,{$6+0.25*$8}%,{$7+0.25*$8}%,1,255,255,0,255 +line {$6+0.25*$8}%,{$7-0.25*$8}%,{$6-0.25*$8}%,{$7+0.25*$8}%,1,255,255,0,255 +fi +fx_equalize_hsv : +cs=${"arg0 $1,hsi,hsl,hsv"} +foreach { +split_opacity l[0] { +to_rgb +9,1,1,4,{"V = [${6-30:3}]*pi/180; [cos(V),sin(V)]"},${7-31:3},{"V = [${8-32:3}]; +const sV = size(V); +repeat (sV,k, +v0 = k/sV; +v1 = (k+1)/sV; +V[k]*=(V[k]>0?(1 - v0):v1); +); V"} +r. 256,1,1,4,1 +sh. 3 b. $3 rm. +f. "[ atan2(G,R)*180/pi,B,A,0 ]" channels. 0,2 ++rgb2$cs.. +channels. 100% *. 256 round. map. ... ++[-2,-1] rm.. +channels. 100% ${cs}2rgb.. +if $4 +*. 255 bilateral.. .,$4,{2+$4} +rgb2$cs.. /. 255 j.. .,0,0,0,2 ${cs}2rgb.. +fi +rm. +blend alpha,{$2%} +} +a c +} +fx_equalize_hsv_preview : +if $5 +cs=${"arg0 $1,hsi,hsl,hsv"} +rm {0.8*[${-gui_preview_wh}]},1,3,"$5==1? +(H = S = 0; V = y/(h-1)): +(H = x*360/(w-1); S = y/(h-1); V = y/(h-1)); +[H,S,V]" +${cs}2rgb. +fi +gui_split_preview "fx_equalize_hsv $*",${-3--1} +if $5 r. ${-gui_preview_wh},1,3,0,0,0.5,0.5 fi +fx_hsv_equalizer : +foreach { +to_rgb rgb2hsv s c ++f[0] abs(i-$2)<$3/2|abs(i-$2-360)<$3/2|abs(i-$2+360)<$3/2 ++f[0] abs(i-$7)<$8/2|abs(i-$7-360)<$8/2|abs(i-$7+360)<$8/2 ++f[0] abs(i-$12)<$13/2|abs(i-$12-360)<$13/2|abs(i-$12+360)<$13/2 ++threshold[1,2] 0.01 *[-1,-2] [-1]x2 *[-1,3] *[-1,4] *[-1,5] ++*[3] $4 +*[4] $9 +*[5] $14 +[-1,-2,-3] ++[-1,0] %[0] 360 +if $5>=0 +*[3] -$5 else +*[3] {1/(1+$5)-1} fi +. 1 +if $10>=0 +*[4] -$10 else +*[4] {1/(1+$10)-1} fi +. 1 +if $15>=0 +*[5] -$15 else +*[5] {1/(1+$15)-1} fi +. 1 +*[-1,-2,-3] ^[1,-1] +if $6>=0 +*[3] -$6 else +*[3] {1/(1+$6)-1} fi +. 1 +if $11>=0 +*[4] -$11 else +*[4] {1/(1+$11)-1} fi +. 1 +if $16>=0 +*[5] -$16 else +*[5] {1/(1+$16)-1} fi +. 1 +*[-1,-2,-3] ^[2,-1] +rm[3,4,5] a[0,1,2] c hsv2rgb +} +fx_hsv_equalizer_preview : +l. { +if !$1 fx_hsv_equalizer $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16 +else +to_rgb rgb2hsv s c +(0,359) r. ..,{{0,h}/10},1,1,3 . f. 1 +j[0] [3],0,91% j[1] [4],0,91% j[2] [4],0,91% rm[-1,-2] ++f[0] abs(i-$2)<$3/2|abs(i-$2-360)<$3/2|abs(i-$2+360)<$3/2 ++f[0] abs(i-$7)<$8/2|abs(i-$7-360)<$8/2|abs(i-$7+360)<$8/2 ++f[0] abs(i-$12)<$13/2|abs(i-$12-360)<$13/2|abs(i-$12+360)<$13/2 +-|[-3--1] +. 0.33 /. 1.33 +*[2,-1] a c hsv2rgb +fi +} +gcd_hsl : skip ${1=1},${2=0},${3=0},${4=180},${5=0.2},${6=0},${7=1},${8=1} +repeat $! l[$>] +split_opacity to_rgb[0] rgb2hsv[0] +if $6 ++channels[0] 0 +histogram. 360,0,360 +hue={(xM+180)%360} rm. +else hue=$4 fi +sh[0] 1,1 +if $3 sat={-max(0,ia-0.5)} else sat=$2 fi +-. 0.5 *. $1 +. $sat ++. 0.5 c. 0,1 rm. +hsv2rgb[0] ++channels[0] 0 *. 66 ++channels[0] 1 *. 129 +[-2,-1] ++channels[0] 2 *. 25 +[-2,-1] ++. 128 /. 256 +. 16 +apply_gamma. {max(0.001,$7)} +if $8!=1 -. 128 *. $8 +. 128 fi +c. 0,255 +sh[0] 0,0 sh[0] 1,1 sh[0] 2,2 +($hue^1^1) hsv2rgb. n. {1-$5},1 +*[-4] {@0} *... {@1} *.. {@2} +rm[-4--1] rgb2ycbcr[0] j[0] . rm. +ycbcr2rgb[0] a c +done done +gcd_hsl_preview : +gui_split_preview "gcd_hsl ${1--2}",$-1 +gcd_hsv_select : +skip ${1=0},${2=0.5},${3=1} skip ${4=180},${5=0.5},${6=0.5} +skip ${7=2},${8=2} skip ${9=18},${10=0},${11=0},${12=0} +repeat $! l[$>] +to_rgba[0] remove_opacity[0] +if !$12 [0] fi +l. +gcd_shrink ++rgb2hsv[0] s. c +bh={$1-$4} th={$1+$4} ++ge[1] {360+$bh} +le[1] {$th-360} +ir[1] {max($bh,0)},{min($th,360)} +or[-2,-1] or[1,-1] +ir[2] {$2-$5},{$2+$5} +ir[3] {$3-$6},{$3+$6} +and[-2,-1] and[-2,-1] +meancurvature_flow[0] 3 median[0] 3 ++[0] 1 +gradient_norm[0] +b. 2,1,1 min_patch. $9 +*[0,-1] *. -1 ++*[0] [1] gt[0] 0 negate[1] *[0,1] *[0] 0.5 max[0,-1] ++watershed[0] . k. -. 1 +gcd_unshrink +done +if !$12 +channels. 0 ge. 0 ++area. 0 +le. {($10%*max(w,h))^2} ++negate... *[-2,-1] inpaint... . rm. +le. {($11%*max(w,h))^2} *. .. +inpaint.. . rm. *. 255 +if $7>0 dilate. $7 +elif $7<0 erode. {abs($7)} fi +if $8 b. $8,1,1 fi +a[-2,-1] c +fi +c. 0,255 +done done +iain_hue_light_dark_p: +repeat $! l[$>] +apply_parallel_overlap "iain_hue_light_dark ${1--2}",0,${-1} +done done +iain_hue_light_dark: +repeat $! l[$>] split_opacity l[0] ++l[0] +to_rgb +if $20==0 +rgb2hsv8 +else +rgb2hsl8 +fi +s c ++apply_curve[0] 0,0,{128+$1},16,{128+$2},30,{128+$3},42,{128+$4},60,{128+$5},75,{128+$6},85,{128+$7},105,{128+$8},127,{128+$9},135,{128+$10},150,{128+$11},170,{128+$12},180,{128+$13},195,{128+$14},213,{128+$15},225,{128+$16},240,{128+$17},255,{128+$18} +sub[-1] 128 +add[-1] $19 +add[-1,-2] +a c +if $20==0 +hsv82rgb +else +hsl82rgb +fi +done ++rgb2hsv[0] +s[-1] c +keep[0,1,-1,-2] +mul[-1,-2] 255 +apply_curve[-2] 0,0,0,$22,0,$21,255,255,255 +apply_curve[-1] 0,0,0,$24,0,$23,255,255,255 +mul[-1] [-2] +div[-1] 255 +remove[-2] +c[-1] 0,255 +a[1,2] c +blend[0,1] alpha +if $25==1 +to_gray +fi +done a c done done +#@cli afre_localcontrast : 1<=radius<=10,-100<=_amount<=100 +#@cli : Enhance local contrast. +#@cli : Default values: 'radius=1' and 'amount=50'. +afre_localcontrast : check "${1=1}>=1 && ${2=50}>=-100 && $1<=10 && $2<=100" +if !$2 return fi rd={int($1)} e[] "[afre]^_^) localcontrast: Enhance local contrast of image$? using radius="$rd" and amount=$2." +repeat $! l[$>] r0={[im,iM]} n 0,255 rgb2jzazbz 0 sh 0 r1={[im,iM]} +. +afre_gui0_fast. $1,1e0 n. 0,1 f. "begin(const boundary=1; +const D="$rd"*2+1; const P=4^($2/50)); +ref(crop(x-"$rd",y-"$rd",0,c,D,D,1,1),N); A=avg(i,med(N)); +if(i] +fx_gaussian_blur $2,0,0,1,1,0,0 +luminance +luminance +fx_apply_curve[1] 0,31,111,64,17,110,176,148,75,177,235,186,1,0,0,0,0 +fx_apply_curve[1] 0,31,111,64,17,110,176,148,75,177,235,186,1,0,0,0,0 +rv[0,1] fx_compose_value[0,1] $1,0 +if $3==1 fx_mix_rgb 1,50,0,1,50,0,1,-50,0,0,2,0 +elif $3==2 fx_mix_rgb 1,75,0,1,5,0,1,-25,0,0,2,0 +elif $3==3 fx_mix_rgb 1,70,0,1,40,0,1,-20,0,0,2,0 +elif $3==4 fx_mix_rgb 1,-5,0,1,0,0,1.1,12,0,0,2,0 +fi done done +fx_tk_metallic_preview : +gui_split_preview "fx_tk_metallic ${1--2}",$-1 +fx_mix_cmyk : +foreach { +split_opacity rv to_rgb. +fx_start_mix $13,$14 +rgb2cmyk. s. c +*[-4] $1 +[-4] $2 b[-4] $3% +*... $4 +... $5 b... $6% +*.. $7 +.. $8 b.. $9% +*. $10 +. $11 b. $12% +a[-4--1] c cmyk2rgb. +fx_end_mix $13 +if $!!=3 rv a c fi +} +fx_mix_cmyk_preview : +gui_split_preview "fx_mix_cmyk $*",${-3--1} +fx_mix_hsv : +foreach { +split_opacity rv to_rgb. +fx_start_mix $10,$11 +rgb2hsv. s. c -[-2,-1] 0.5 +*... $1 +... $2 b... $3% +*.. $4 +.. $5 b.. $6% +*. $7 +. $8 b. $9% +%... 360 +[-2,-1] 0.5 c[-2,-1] 0,1 a[-3--1] c hsv2rgb. +fx_end_mix $10 +if $!!=3 rv a c fi +} +fx_mix_hsv_preview : +gui_split_preview "fx_mix_hsv $*",${-3--1} +fx_mix_lab : +foreach { +split_opacity to_rgb[0] +gui_parallel_overlap[0] "_fx_mix_lab $*",0,{3*max($3,$6,$9)} +a c +} +_fx_mix_lab : +fx_start_mix $10,$11 +rgb2lab. s. c +*... $1 +... $2 b... $3% +*.. $4 +.. $5 b.. $6% +*. $7 +. $8 b. $9% +a[-3--1] c lab2rgb. +fx_end_mix $10 +fx_mix_lab_preview : +gui_split_preview "fx_mix_lab $*",${-3--1} +fx_mix_pca : +foreach { split_opacity l[0] { +to_rgb +if [$14]==round(stats()[0,4],0.1) _avg:=[$15][0,3] C:=[$15][3,9] status= +else ++rr2d 256,256,0,2 C=${"covariance_vectors. _avg"} rm. +__status="{$1}{$2}{$3}{$4}""{$5}{$6}{$7}{$8}""{$9}{$10}{$11}{$12}""${13}""{"{round(stats()[0,4],0.1)}"}""{"$_avg,$C"}""{$16}{${17,18}}" +fi +if "$4 || $8 || $12" +l { +f "begin(avg = ["$_avg"]; eig = eig(["$C"]); Pt = eig[3,9]); Pt*(I-avg)" +s c repeat $! { vmax$>={$>,1.1*max(abs(im),abs(iM))} } +rm +} else vmax0,vmax1,vmax2=1 fi +f "begin( +do_gamma(val,vmax,gamma) = (vmax*sign(val)*(abs(val)/vmax)^gamma); +const gamma0 = 10^-($4%); +const gamma1 = 10^-($8%); +const gamma2 = 10^-($12%); +const vmax0 = "$vmax0"; +const vmax1 = "$vmax1"; +const vmax2 = "$vmax2"; +avg = ["$_avg"]; +eig = eig(["$C"]); +for (k = 3, k<12, k+=3, eig[k]<0?copy(eig[k],eig[k,3]*=-1,3)); +Pt = eig[3,9]; +P = transpose(Pt,3); +T = mul(P,diag(10^[$1,$5,$9]),3); +R1 = rot(eig[3,3],$3°); +R2 = rot(eig[6,3],$7°); +R3 = rot(eig[9,3],$11°); +T = mul(R1,mul(R2,mul(R3,T,3),3),3); +avg_shift = avg + $2*eig[3,3] + $6*eig[6,3] + $10*eig[9,3]; +if ("0$_is_preview", +L = [ 2,5,10]*sqrt(1e-5 + eig[0,3]); +run('__cols=',v2s(round([ +avg - L[0]*eig[3,3], +avg + L[0]*eig[3,3], +avg - L[1]*eig[6,3], +avg + L[1]*eig[6,3], +avg - L[2]*eig[9,3], +avg + L[2]*eig[9,3] ]))); +); +); +nI = Pt*(I - avg); +($4 || $8 || $12)?( +nI[0] = do_gamma(nI[0],vmax0,gamma0); +nI[1] = do_gamma(nI[1],vmax1,gamma1); +nI[2] = do_gamma(nI[2],vmax2,gamma2); +); +avg_shift + T*nI" +c 0,255 +} a c } u $__status +fx_mix_pca_preview : +_is_preview=1 +__status= +foreach { +gui_split_preview "fx_mix_pca ${1-13},\"$14\",\"$15\",${16-18}",${-3--1} +if $13 +rr2d ${-gui_preview_wh},0,1 +($__cols) r. 3,6,1,1,-1 permute. yzcx s. x,3 +r[-3--1] {w#0/2},13,1,3,3 c[-3--1] 0,255 +frame[-3--1] 1,1,0 +to[0] Primary,4,2,13,1 j[0] ...,64,4 +to[0] Secondary,4,17,13,1 j[0] ..,64,19 +to[0] Tertiary,4,32,13,1 j[0] .,64,34 +k[0] +fi +} +u $__status +fx_start_mix : +if $1==1 +tones. 3 +[-2,-1] b[-2,-1] $2% ri[-2,-1] ... *. ... mv... $! +elif $1==2 +tones. 3 +[-3,-1] b[-2,-1] $2% ri[-2,-1] ... *.. ... mv... $! +elif $1==3 +tones. 3 +[-3,-2] b[-2,-1] $2% ri[-2,-1] ... *.. ... mv... $! +fi +fx_end_mix : +if $1==1 *[-3,-1] +[-2,-1] +elif $1==2 *[-2,-1] +[-2,-1] +elif $1==3 *[-2,-1] +[-2,-1] +fi +c 0,255 +fx_mix_rgb : +foreach { +split_opacity rv to_rgb. +fx_start_mix $10,$11 +-. 128 s. c +*... $1 +... $2 b... $3% +*.. $4 +.. $5 b.. $6% +*. $7 +. $8 b. $9% +a[-3--1] c +. 128 c. 0,255 +fx_end_mix $10 +if $!!=3 rv a c fi +} +fx_mix_rgb_preview : +gui_split_preview "fx_mix_rgb $*",${-3--1} +fx_mix_ycbcr : +foreach { +split_opacity rv to_rgb. +fx_start_mix $10,$11 +rgb2ycbcr. -. 128 s. c +*... $1 +... $2 b... $3% +*.. $4 +.. $5 b.. $6% +*. $7 +. $8 b. $9% +a[-3--1] c +. 128 c. 0,255 ycbcr2rgb. +fx_end_mix $10 +if $!!=3 rv a c fi +} +fx_mix_ycbcr_preview : +gui_split_preview "fx_mix_ycbcr $*",${-3--1} +fx_random_color_transformation : +if $2" || "$3 srand __seed:=_round(u(100000)) else __seed=$1 fi +random_clut $__seed +amplitude:=$4% +repeat $!-1 { l[$>,-1] { ++map_clut.. . +j... .,0,0,0,0,$amplitude rm. +} } +rm. +adjust_colors ${5-9} +fx_random_color_transformation_preview : +gui_split_preview "fx_random_color_transformation ${1--2}",${-3--1} +to "Seed: \#"$__seed,5,5,5%,2 +u "{"$__seed"}{0}{0}{$4}{$5}{$6}{$7}{$8}{$9}{$10}{$11,$12}" +fx_retinex : +foreach { ++retinex $2,${"arg0 $3,hsi,hsv,lab,lrgb,rgb,ycbcr"},$4,$5,${7--1} +if $6 guided. ..,$6,$6 fi +j[0] .,0,0,0,0,{$1%} rm. +c 0,255 +} +fx_retinex_preview : +gui_split_preview "fx_retinex $*",${-3--1} +fx_retrofade : +foreach { +split_opacity l[0] { ++f 0 +repeat $1 { ++noise[0] $3 c. 0,255 autoindex. $2,0,0 ++[-2,-1] +progress {$>*100/$1} +} +k. n 0,255 +progress 100 +} +a c +} +fx_retrofade_preview : +gui_split_preview "fx_retrofade $*",${-3--1} +iain_rgb_tone: +repeat $! l[$>] split_opacity l[0] +to_rgb ++split c ++apply_curve[1] 0,0,$1,128,$2,255,$3 ++apply_curve[2] 0,0,$4,128,$5,255,$6 ++apply_curve[3] 0,0,$7,128,$8,255,$9 +add[-1,-2,-3] ++apply_curve[1] 0,0,$10,128,$11,255,$12 ++apply_curve[2] 0,0,$13,128,$14,255,$15 ++apply_curve[3] 0,0,$16,128,$17,255,$18 +add[-1,-2,-3] ++apply_curve[1] 0,0,$19,128,$20,255,$21 ++apply_curve[2] 0,0,$22,128,$23,255,$24 ++apply_curve[3] 0,0,$25,128,$26,255,$27 +add[-1,-2,-3] +add[1,4] +add[2,4] +add[3,4] +a[-1,-2,-3] c ++sub[0,1] ++rgb2hsv[0] split[-1] c remove[-1,-3] mul[-1] 255 +apply_curve[-1] 0,0,$28,64,$29,128,$30,192,$31,255,$32 +compose_multiply[-1,-2] ++sub[0,-1] +if $33==0 +luminance[0] ++luminance[-1] +compose_grainextract[-1,-2] +compose_grainmerge[0,-1] +keep[0] +fi +if $33==1 +keep[-1] +c 0,255 +fi +if $33==2 +keep[-1] +n 0,255 +fi +done a c done done +variance_noise : +u {${-std_noise}^2} +Saturation_EQ_p: +repeat $! l[$>] +apply_parallel_overlap "Saturation_EQ ${1-19}", +done done +Saturation_EQ: +repeat $! l[$>] split_opacity l[0] +to_rgb rgb2hsl8 +split[-1] c ++apply_curve[2] .5,0,{128+$1},31,{128+$2},63,{128+$3},95,{128+$4},128,{128+$5},160,{128+$6},192,{128+$7},224,{128+$8},255,{128+$9} +++[0] {((($19/360)*255))*-1} +mod[-1] 255 +apply_curve[-1] .5,0,{128+$10},31,{128+$11},63,{128+$12},95,{128+$13},128,{128+$14},160,{128+$15},192,{128+$16},224,{128+$17},255,{128+$18} +sub[-1,-2] 128 +add[-1,-2] +mul[-1] 2 +add[1,3] +c[1] 0,255 +append c +hsl82rgb +done a c done done +_fx_select_color : +if $1==1 to_rgb +elif $1==2 to_rgb rgb2ycbcr +elif $1==3 channels 0 +elif $1==4 channels 1 +elif $1==5 channels 2 +elif $1==6 to_rgba channels 3 +elif $1==7 to_rgb rgb2ycbcr channels 0 +elif $1==8 to_rgb rgb2ycbcr channels 1,2 +elif $1==9 to_rgb rgb2hsv channels 0 +elif $1==10 to_rgb rgb2hsv channels 1 +fi +fx_select_color : +($5^$6^$7^$8) _fx_select_color. $1 color={^} rm. +foreach { +to_rgba ++_fx_select_color $1 +select_color[1] $2%,$color +if $4 +area. 0,0 <=. {round($4^1.5)} inpaint.. .,0,3 rm. fi +b[1] $3 n[1] 0,255 +if !$9 sh[0] 100% &. [1] +elif $9==1 rm[0] +elif $9==2 -[1] 255 *[1] -1 sh[0] 100% &. [1] +elif $9==3 rm[0] - 255 * -1 +else +/[1] 255 +*[0,1] +*[1] $11 +*[1] $12 +*[1] $13 *[1] $10 a[1,-3--1] c -[1,2] + +fi +k[0] +} +fx_select_color_preview : +gui_split_preview "fx_select_color $*",${-3--1} +fx_selective_desaturation : +foreach { +to_color split_opacity l[0] { ++fc $1,$2,$3 +-[1] [0] norm[1] /[1] {1e-6+iM} +if $4 *[1] -{max(0.01,$5)} +[1] 1 +else >=[1] {5*$5}% +fi +c[1] 0,1 +rgb2hsl[0] s[0] c +mM:=im,iM repeat $6 { guided. [2],1,0.1 } n. $mM +if !$7 *[1,-1] +elif $7==1 ($1^$2^$3) rgb2hsl. *[1] {i[1]} rm[-2,-1] +else rv[1,-1] rm. +fi +a c hsl2rgb +} +a c +} +fx_selective_desaturation_preview : +gui_split_preview "fx_selective_desaturation $*",${-3--1} +fx_sepia : +sepia adjust_colors ${1-3},0,0,0,255 +fx_sepia_preview : +gui_split_preview "fx_sepia $*",${-3--1} +fx_simulate_film : +category=${arg0\ $1,bw,instant_consumer,instant_pro,fujixtransiii,negative_color,negative_new,negative_old,print,colorslide} +presets=${-_fx_cluts_$category} +index:=arg(1+$1,${2-10}) +thumbsize,strength,brightness,contrast,gamma,hue,saturation,normalize=${11-18} +if $normalize==1" || "$normalize==3 +foreach { split_opacity balance_gamma[0] , a c } +fi +if $index>=2 +path_clut=${-path_cache} +name=${arg0\ $index-2,$presets} +clut $name,{0$_is_preview" && "!isfile(['{/${path_clut}clut_$name.cimgz}'])?17:48} +repeat $!-1 { if $strength<100 +map_clut[$>] . j[$>] .,0,0,0,0,{$strength%} rm. else map_clut[$>] . fi } +rm. +adjust_colors $brightness,$contrast,$gamma,$hue,$saturation,0,255 +if $normalize==2" || "$normalize==3 foreach { split_opacity n[0] 0,255 a c } fi +elif $index==1 +adjust_colors $brightness,$contrast,$gamma,$hue,$saturation,0,255 +if $normalize==2" || "$normalize==3 foreach { split_opacity n[0] 0,255 a c } fi +else +foreach { if max(w,h)>$thumbsize rr2d $thumbsize,$thumbsize,0,2 fi } +N=$! +to "Original",1%,1%,7.5%,2,0.5 +Np:=narg($presets) +repeat $Np { +clut_name=${arg0\ $>,$presets} +clut $clut_name mv. $N +repeat $N { +if $strength<100 [$>] +map_clut. [$N] j.. .,0,0,0,0,{$strength%} rm. else +map_clut[$>] [$N] fi +adjust_colors. $brightness,$contrast,$gamma,$hue,$saturation,0,255 +if $normalize==2" || "$normalize==3 l. { split_opacity n[0] 0,255 a c } fi +strcapitalize $clut_name clut_name=${} +to. $clut_name,1%,1%,7.5%,2,0.5 +} +rm[$N] +progress {$>*100/($Np-1)} +} +k[$N--1] frame 1,1,0,0,0,255 - 128 append_tiles {s=floor(sqrt($!));w>h?[s,0]:[0,s]} + 128 +fi +fx_simulate_film_preview : +_is_preview=1 +index:=arg(1+$1,${2-10}) +if !$index gui_warning_preview "Preview disabled in 'Collage' mode" +else gui_split_preview "fx_simulate_film $*",${19-21} +fi +u "{$1}{$2}_"{2*!$1}"{$3}_"{2*($1==1)}"{$4}_"{2*($1==2)}"{$5}_"{2*($1==3)}"{$6}_"{2*($1==4)}"{$7}_"{2*($1==5)}"{$8}_"{2*($1==6)}"{$9}_"{2*($1==7)}"{$10}_"{2*($1==8)}"{$11}_"{1+!$index}"{$12}{$13}{$14}{$15}{$16}{$17}{$18}{$19}{$20,$21}" +_fx_cluts_bw : +u agfa_apx_100,agfa_apx_25,fuji_neopan_1600,fuji_neopan_acros_100,ilford_delta_100,ilford_delta_3200,ilford_delta_400,ilford_fp_4_plus_125,ilford_hp_5_plus_400,ilford_hps_800,ilford_pan_f_plus_50,ilford_xp_2,kodak_bw_400_cn,kodak_hie_hs_infra,kodak_t-max_100,kodak_t-max_3200,kodak_t-max_400,kodak_tri-x_400,polaroid_664,polaroid_667,polaroid_672,rollei_ir_400,rollei_ortho_25,rollei_retro_100_tonal,rollei_retro_80s +_fx_cluts_instant_consumer : +u 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_+,polaroid_px-680_cold_++,polaroid_px-680_cold_++_alt,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 +_fx_cluts_instant_pro : +u fuji_fp-100c_--,fuji_fp-100c_-,fuji_fp-100c,fuji_fp-100c_alt,fuji_fp-100c_+,fuji_fp-100c_++,fuji_fp-100c_++_alt,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_++,fuji_fp-100c_negative_++_alt,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,polaroid_665_--,polaroid_665_-,polaroid_665,polaroid_665_+,polaroid_665_++,polaroid_665_negative_-,polaroid_665_negative,polaroid_665_negative_+,polaroid_665_negative_hc,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_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_++ +_fx_cluts_fujixtransiii : +u fuji_xtrans_iii_acros,fuji_xtrans_iii_acros+g,fuji_xtrans_iii_acros+r,fuji_xtrans_iii_acros+ye,fuji_xtrans_iii_astia,fuji_xtrans_iii_classic_chrome,fuji_xtrans_iii_mono,fuji_xtrans_iii_mono+g,fuji_xtrans_iii_mono+r,fuji_xtrans_iii_mono+ye,fuji_xtrans_iii_pro_neg_hi,fuji_xtrans_iii_pro_neg_std,fuji_xtrans_iii_provia,fuji_xtrans_iii_sepia,fuji_xtrans_iii_velvia +_fx_cluts_negative_color : +u agfa_ultra_color_100,agfa_vista_200,fuji_superia_200,fuji_superia_hg_1600,fuji_superia_reala_100,fuji_superia_x-tra_800,kodak_ektar_100,kodak_elite_100_xpro,kodak_elite_color_200,kodak_elite_color_400,kodak_portra_160_nc,kodak_portra_160_vc,lomography_redscale_100 +_fx_cluts_negative_new : +u fuji_160c_-,fuji_160c,fuji_160c_+,fuji_160c_++,fuji_400h_-,fuji_400h,fuji_400h_+,fuji_400h_++,fuji_800z_-,fuji_800z,fuji_800z_+,fuji_800z_++,ilford_hp_5_-,ilford_hp_5,ilford_hp_5_+,ilford_hp_5_++,kodak_portra_160_-,kodak_portra_160,kodak_portra_160_+,kodak_portra_160_++,kodak_portra_400_-,kodak_portra_400,kodak_portra_400_+,kodak_portra_400_++,kodak_portra_800_-,kodak_portra_800,kodak_portra_800_+,kodak_portra_800_++,kodak_portra_800_hc,kodak_tmax_3200_-,kodak_tmax_3200,kodak_tmax_3200_+,kodak_tmax_3200_++,kodak_tmax_3200_alt,kodak_tri-x_400_-,kodak_tri-x_400,kodak_tri-x_400_+,kodak_tri-x_400_++,kodak_tri-x_400_alt +_fx_cluts_negative_old : +u ilford_delta_3200_-,ilford_delta_3200,ilford_delta_3200_+,ilford_delta_3200_++,fuji_neopan_1600_-,fuji_neopan_1600,fuji_neopan_1600_+,fuji_neopan_1600_++,fuji_superia_100_-,fuji_superia_100,fuji_superia_100_+,fuji_superia_100_++,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_1600_-,fuji_superia_1600,fuji_superia_1600_+,fuji_superia_1600_++,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_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_++ +_fx_cluts_print : +u fuji_3510_constlclip,fuji_3510_constlmap,fuji_3510_cuspclip,fuji_3513_constlclip,fuji_3513_constlmap,fuji_3513_cuspclip,kodak_2383_constlclip,kodak_2383_constlmap,kodak_2383_cuspclip,kodak_2393_constlclip,kodak_2393_constlmap,kodak_2393_cuspclip +_fx_cluts_colorslide : +u agfa_precisa_100,fuji_astia_100f,fuji_fp_100c,fuji_provia_100f,fuji_provia_400f,fuji_provia_400x,fuji_sensia_100,fuji_superia_200_xpro,fuji_velvia_50,fuji_astia_100_generic,fuji_provia_100_generic,fuji_velvia_100_generic,kodak_kodachrome_64_generic,kodak_ektachrome_100_vs_generic,kodak_e-100_gx_ektachrome_100,kodak_ektachrome_100_vs,kodak_elite_chrome_200,kodak_elite_chrome_400,kodak_elite_extracolor_100,kodak_kodachrome_200,kodak_kodachrome_25,kodak_kodachrome_64,lomography_x-pro_slide_200,polaroid_669,polaroid_690,polaroid_polachrome +#@cli afre_softlight : -100<=amount<=100,_reverse_order={ 0 | 1 } +#@cli : Blend image with itself or another image using softlight. +#@cli : Default values: 'amount=50' and 'reverse_order=0'. +afre_softlight : check "${1=50}>=-100 && isbool(${2=0}) && $1<=100" +if !$1 return fi +if $!>2 error[] "\n[afre]>_<) softlight: Select 1-2 images." +elif $!==2&&$2 rv e0=" in reverse order" +elif $!==1 . e1=" itself and" +elif w#0!=w||h#0!=h||s#0!=s error[] "\n[afre]>_<) softlight: Select images with the same dimensions." fi +if s#0!=1?s#0!=3 error[] "\n[afre]>_<) softlight: Select image(s) with 1 or 3 channels (I or RGB)." fi +if $1<0 negate. fi +e[] "[afre]^_^) softlight: Blend image$?"${e0}" using"${e1}" amount=$1." +iM={0,iM} / $iM f.. "begin(const A=0.5*abs($1)/100+0.5); +i#0^((A*2)^(A*(1-2*i#1)))" *.. $iM rm. +afre_softlight_preview : +afre_softlight $* +gcd_hio_levels : skip ${1=1},${2=1},${3=39},${4=0},${5=1},${6=1},${7=0},${8=0},${9=0},${10=0} +if $8 _gcd_hio_levels[0] ${1--4} else _gcd_hio_levels ${1--4} fi +if $10" && "$!>1 rv blend alpha fi +_gcd_hio_levels : skip ${1=1},${2=1},${3=39},${4=0},${5=1},${6=1},${7=0} +repeat $! l[$>] +split_opacity to_rgb[0] +gcd_srgb2luma[0] +if $4!=0 +sh[0] 0 sh[0] 1 sh[0] 2,2 +({$3%360}^1^1) hsv2rgb. max. 0 *. $4 -. {ia} ++[-4] {@0} +... {@1} +.. {@2} rm[-4--1] max[0] 0 +fi +gcd_hue_chroma[0] $3,$1,$2 +gcd_srgb2jpeg[0] j[0] . rm. +max[0] 0 sh[0] 0 srgb={($5!=1" || "$6!=1)" && "$7} +if $srgb srgb2rgb. fi +gcd_gamma. $5 +if $6!=1 +m={iM/2} -. $m +sign. abs.. +gcd_gamma.. $6,1,$m *[-2,-1] +. $m +fi +if $srgb rgb2srgb. fi +rm. gcd_jpeg2srgb[0] a c c 0,255 +done done +gcd_hio_levels_preview : +if $-2==7 gcd_hio_levels ${1--2},1 +else gui_split_preview "gcd_hio_levels $*",$-2 fi +gcd_hue_chroma : skip ${1=0},${2=1},${3=1} +if $2==1" && "$3==1 return fi +repeat $! l[$>] +h={($1%360)/60} x={1-abs($h%2-1)} y={if($x>0,1/$x,0)} h={int($h)+1} +p={arg($h,0,1,1,2,2,0)} s={arg($h,1,0,2,1,0,2)} z={arg($h,2,2,0,0,1,1)} +[0] sh. $p sh.. $s +*.. $x ++le. .. j... ..,0,0,0,0,1,. rm.. +eq. 0 +*.. $y j[-4] .,0,0,0,0,1,.. +rm[-4--1] sh. $z f. 0 rm. +sh. $p +compose_channels[0] min +eq.. 0 +. ... +if $3!=1 ++/[-2,-1] -. 1 r. 100%,100%,1,3 *. [-5] +[0] . ++compose_channels[0] min -[0] . *[0] $3 +[0,-1] -[0,-1] +fi +if $2!=1 +-[-3,-2] *. $2 +[-3,-1] /[-2,-1] -. 1 *[-3,-1] rm. + +else k[0] fi +done done +iain_tone_presets_p: +repeat $! l[$>] +apply_parallel_overlap "iain_tone_presets ${1--2}",0,${-1} +done done +iain_tone_presets: +repeat $! l[$>] split_opacity l[0] +if $1==0 ++iain_rgb_tone 00,10,00,00,00,00,00,00,00,00,00,00,00,10,00,00,00,00,00,20,00,00,20,00,00,00,00,255,0,0,0,0,0 +fi +if $1==1 ++iain_cmyk_tone 00,00,00,00,00,00,-8,-20,00,00,00,-49,00,00,00,00,00,00,00,-25,00,00,17,0,00,00,00,00,00,00,35,-25,17,8,26,31,00,00,00,00,17,00,-9,-31,29,00,00,-9,188,255,181,133,72,1 +fi +if $1==2 ++iain_cmyk_tone 00,-38,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,-164,88,255,00,00,00,00,00,00,00,00,00,65,33,-15,00,00,00,00,00,00,00,00,00,00,00,-25,128,92,62,45,38,1 +fi +if $1==3 ++iain_cmyk_tone -25,50,00,25,00,00,25,00,00,00,00,00,025,25,00,-50,00,00,25,00,00,00,00,00,025,00,00,25,00,00,-50,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,36,178,255,169,94,2 +fi +if $1==4 ++iain_cmyk_tone 25,-50,00,-25,00,00,-25,00,00,00,00,00,-025,-25,00,50,00,00,-25,00,00,00,00,00,-025,00,00,-25,00,00,50,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,17,120,240,255,255,4 +fi +if $1==5 ++iain_cmyk_tone 000,00,00,00,00,00,00,00,00,00,00,-60,000,00,00,00,00,00,00,00,00,-22,40,161,000,00,00,0,00,00,00,00,28,33,33,16,00,00,00,00,00,00,00,00,00,77,-8,-80,255,255,255,255,255,0 +fi +if $1==6 ++iain_cmyk_tone 000,00,00,00,00,00,00,00,00,00,00,00,000,00,00,00,00,00,00,00,00,07,-20,-33,000,00,00,00,00,00,00,00,00,48,-65,-77,000,00,00,00,00,00,00,00,00,45,45,00,255,255,255,255,255,0,0 +fi +if $1==7 ++iain_cmyk_tone 000,20,00,00,08,00,00,00,00,00,-23,00,000,-13,00,0,17,00,00,00,00,-1,29,00,000,00,00,00,00,-12,00,00,00,19,68,18,000,00,00,00,00,00,00,00,00,-5,55,-15,128,255,255,255,255,0,0 +fi ++sub[0,1] +mul[-1] {{$2/100}*-1} ++[0,-1] +keep[0] +if $3==0 +c 0,255 +else +n 0,255 +fi +done a c done done +fx_transfer_histogram : +to_rgb +ref:=$2?0:-1 +match_histogram[^$ref] [$ref],256,$1 +c 0,255 +fx_transfer_histogram_preview : +if $!<2 gui_print_preview "Warning:",,"This filter requires at least two input layers to work properly." return fi +ref:=$2?0:-1 ++store[$ref] _fx_trgb_ref +gui_split_preview[^$ref] "$_fx_trgb_ref fx_transfer_histogram $1,0 rm.",${-3--1} +_fx_trgb_ref= +mv[$ref] $! +repeat $!-1 { l[$>,-1] { +rr2d[0] $_preview_area_width,$_preview_area_height,0,3 rr2d. {0,[w,h]/3},0,3 +to. Reference,2,2,13,1,1,255 frame. 2,2,255 frame. 1,1,0 +j[0] .,$3%,$4% +rm. +} } +fx_gcd_transfer_colors_patch : skip ${1=6},${2=3},${3=5},${4=5},${5=0},${6=0} +ref={if($5,$!-1,0)} n=$! ++gcd_extract_clut[$ref] ${1-4} +map_clut[^-1,$ref] . +if $6>0" || "$n==1 +r,s={arg(max($6,1),64,256)},{arg(max($6,1),512,4096)} +r. $r,$r,$r,3,3 r. $s,$s,1,3,-1 +else rm. fi +fx_gcd_transfer_colors_patch_preview : +fx_gcd_transfer_colors_patch $* +if !$5 rm[0] fi +fx_transfer_pca : +to_rgb +ref:=$2?0:-1 +match_pca[^$ref] [$ref],$1 +c 0,255 +fx_transfer_pca_preview : +if $!<2 gui_print_preview "Warning:",,"This filter requires at least two input layers to work properly." return fi +ref:=$2?0:-1 ++store[$ref] _fx_trgb_ref +gui_split_preview[^$ref] "$_fx_trgb_ref fx_transfer_pca $1,0 rm.",${-3--1} +_fx_trgb_ref= +mv[$ref] $! +repeat $!-1 { l[$>,-1] { +rr2d[0] $_preview_area_width,$_preview_area_height,0,3 rr2d. {0,[w,h]/3},0,3 +to. Reference,2,2,13,1,1,255 frame. 2,2,255 frame. 1,1,0 +j[0] .,$3%,$4% +rm. +} } +fx_transfer_rgb : +to_rgb +ref:=$4?0:-1 +match_rgb[^$ref] [$ref],0.25,$1,$2,{2^(4+$3)},$5,0 +c 0,255 +fx_transfer_rgb_preview : +if $!<2 gui_print_preview "Warning:",,"This filter requires at least two input layers to work properly." return fi +ref:=$4?0:-1 ++store[$ref] _fx_trgb_ref +gui_split_preview[^$ref] "$_fx_trgb_ref fx_transfer_rgb $1,$2,0,0,0 rm.",${-3--1} +_fx_trgb_ref= +mv[$ref] $! +repeat $!-1 { l[$>,-1] { +rr2d[0] $_preview_area_width,$_preview_area_height,0,3 rr2d. {0,[w,h]/3},0,3 +to. Reference,2,2,13,1,1,255 frame. 2,2,255 frame. 1,1,0 +j[0] .,$6%,$7% +rm. +} } +_fx_tune_hsv : +mode_dark,Rdark,Gdark,Bdark,Hdark,Sdark,Vdark,mode_light,Rlight,Glight,Blight,Hlight,Slight,Vlight,mode_avg,Ravg,Gavg,Bavg,Havg,Savg,Vavg,mode_red,Rred,Gred,Bred,Hred,Sred,Vred,mode_yellow,Ryellow,Gyellow,Byellow,Hyellow,Syellow,Vyellow,mode_green,Rgreen,Ggreen,Bgreen,Hgreen,Sgreen,Vgreen,mode_cyan,Rcyan,Gcyan,Bcyan,Hcyan,Scyan,Vcyan,mode_blue,Rblue,Gblue,Bblue,Hblue,Sblue,Vblue,mode_magenta,Rmagenta,Gmagenta,Bmagenta,Hmagenta,Smagenta,Vmagenta,preview_mapping=${1-64} +all_colors=dark,light,avg,red,yellow,green,cyan,blue,magenta +foreach { split_opacity l[0] { +to_rgb +colors,sep= +repeat narg($all_colors) { color=${arg0\ $>,$all_colors} if ${mode_$color} colors.=$sep$color sep=, fi } ++srgb2lab channels. 0 darklight:="I(#-2,xm,ym),I(#-2,xM,yM)" rm. +dark:=[$darklight][0,3] light:=[$darklight][3,3] ++r. 1,1,1,3,2 avg={^} rm. +eval. "> +begin( +red = yellow = green = cyan = blue = magenta = [0,0,0]; +best_red = best_yellow = best_green = best_cyan = best_blue = best_magenta = inf; +test_color(color,tR,tG,tB) = ( +val = norm([tR,tG,tB]-[R,G,B]); +val] +to_rgb[0] +luminance[0] +luminance[0] +luminance[0] +fx_mix_lab[0] $2,{$1*10},0,$3,0,0,$3,0,0,0,2,0 +tk_fx_channel_processing. 1,1,0,0,4,{$4/2.55},100,256,0,1,0,2,0,0 +tk_fx_channel_processing.. 1,1,0,0,4,{$4/2.55},{$5/2.55},256,0,0,0,2,0,0 +tk_fx_channel_processing... 1,1,0,0,4,0,{$5/2.55},256,0,1,0,2,0,0 +to_gray[-1,-2,-3] fx_gaussian_blur[-1,-2,-3] $6,0,0,1,0,0,0 ++fc[0] $7,$8,$9 +fc[0] $11,$12,$13 +fc[0] $15,$16,$17 to_rgba[-1,-2,-3] +s. c rv[-1,-9] compose_multiply[-1,-9] mv[-8] 9 a[-4,-3,-2,-1] c +s.. c rv[-2,-8] compose_multiply[-2,-8] mv[-7] 7 a[-5,-4,-3,-2] c +s... c rv[-3,-7] compose_multiply[-3,-7] mv[-6] 5 a[-6,-5,-4,-3] c ++fc[0] $19,$20,$21 rv[-1,-5] +if $22==0 fx_compose_exclusion[-1,-5] $23 +elif $22==1 fx_compose_overlay[-1,-5] $23 +elif $22==2 fx_compose_softlight[-1,-5] $23 +elif $22==3 fx_compose_multiply[-1,-5] $23 +elif $22==4 fx_compose_screen[-1,-5] $23 +fi +rv[-3,-4] fx_compose_lighten[-3,-4] $10 +rv[-2,-3] fx_compose_overlay[-2,-3] $14 +rv[-1,-2] fx_compose_darken[-1,-2] $18 +if $25!=0 ++fc[0] 255,255,255 fx_frame_round_old. 2,$24,0,0,0,0,0,255,100,0.1,3 +fx_gaussian_blur. {$6*5},0,0,1,0,0,0 +rv[-1,-2] fx_compose_multiply[-1,-2] $25 fi +done done +fx_tk_vintage_preview : +gui_split_preview "fx_tk_vintage ${1--2}",$-1 +fx_zonesystem : +repeat $! l[$>] to_rgb rgb2lab s c n[0] {{$1-1}*10}%,{$2*10}% +a c lab2rgb tk_fx_channel_processing $3,$4,0,0,0,0,100,256,0,0,0,2,7,0 +fx_apply_curve 0,$5,0,$6,255,-1,128,-1,128,-1,128,255,1,7,0,0,0 +done done +fx_zonesystem_preview : +gui_split_preview "fx_zonesystem ${1--2}",$-1 +fx_convolve : skip "${3=1}" +ac "_fx_convolve $1,$2,\"$3\",${4--5}",$-4 +_fx_convolve : +if $1 _fx_convolve$1[] else ($3) fi +if !$4 *. $5 fi +convolve[0--2] .,$2 +if $4 n 0,255 else c 0,255 fi +rm. +_fx_convolve1 : 3,3 f 1 normalize_sum +_fx_convolve2 : 5,5 f 1 normalize_sum +_fx_convolve3 : 7,7 f 1 normalize_sum +_fx_convolve4 : 9,9 f 1 normalize_sum +_fx_convolve5 : (1,0,-1;1,0,-1;1,0,-1) +_fx_convolve6 : (1,1,1;0,0,0;-1,-1,-1) +_fx_convolve7 : (1,0,-1;2,0,-2;1,0,-1) +_fx_convolve8 : (1,2,1;0,0,0;-1,-2,-1) +_fx_convolve9 : a:=0.25*(2-sqrt(2)) b:=0.5*(sqrt(2)-1) ($a,0,-$a;$b,0,-$b;$a,0,-$a) +_fx_convolve10 : a:=0.25*(2-sqrt(2)) b:=0.5*(sqrt(2)-1) ($a,$b,$a;0,0,0;-$a,-$b,-$a) +_fx_convolve11 : (0,1,0;1,-4,1;0,1,0) +_fx_convolve12 : (1,0;0,-1) +_fx_convolve13 : (0,1;-1,0) +_fx_convolve14 : 3,3 f 1 r 7,7,1,1,4,0,0.5,0.5 autocrop normalize_sum +_fx_convolve15 : 3,3 f 1 r 9,9,1,1,4,0,0.5,0.5 autocrop normalize_sum +_fx_convolve16 : 3,3 f 1 r 11,11,1,1,4,0,0.5,0.5 autocrop normalize_sum +fx_convolve_preview : skip "${3=1}" +gui_split_preview "fx_convolve $1,$2,\"$3\",${4--1}",${-3--1} +fx_curvature : +foreach { +split_opacity l[0] { +b $1 iee +if $4 abs fi +c $2%,$3% +if $5 negate fi +n 0,255 +} +a c +} +fx_curvature_preview : +gui_split_preview "fx_curvature ${^0}",${-3--1} +fx_dog : +dog $1%,$2% +if $5 norm fi +c $3%,{100-$3}% +if $4 negate fi +n 0,255 +fx_dog_preview : +gui_split_preview "gui_crop_preview fx_dog ${^0} gui_resize_preview",${-3--1} +fx_distance : +foreach { +split_opacity l[0] { +distance $1,$2 +if !$3 c 0,255 +elif $3==1 n 0,255 +else % $4 n 0,255 +fi +} +a c +} +fx_distance_preview : +gui_split_preview "fx_distance ${^0}",${-3--1} +#@cli afre_edge : method={ 0=gradient | 1=standard_deviation },1<=thinning<=10,0.5<=_recovery<=4,0.5<=_brightness<=4,0.5<=_details<=4 +#@cli : Compute edge of selected images. +#@cli : Default values: 'method=0', 'thinning=1', 'recovery=1', 'brightness=1' and 'details=1'. +afre_edge : check "${2=1}>=1 && ${3=1}>=0.5 && ${4=1}>=0.5 && ${5=1}>=0.5 && +$2<=10 && $3<=4 && $4<=4 && $5<=4" +e[] "[afre]^_^) edge: Compute edge of image$? using method=$1, thinning=$2, recovery=$3, brightness=$4 and details=$5." +repeat $! l[$>] if $1 m "method : afre_sdpatch 1" else m "method : afre_gnorm" fi +method im,ic,iM={[im,ic,iM]} ^ {1/$5} n $im,$iM +repeat $2 +afre_box 1 method. r={[im,iM]} ^. $3 n. $r - done +c $ic,$iM ^ {1/$4} n 0,$iM +done done um method +afre_edge_preview : +afre_edge $* +fx_edges : +to_rgb b $1% edges $2% +if $3 negate fi +n 0,255 +fx_edges_preview : +gui_split_preview "fx_edges ${^0}",${-3--1} +fx_canny : +if $4 norm fi +foreach { split_opacity canny[0] $1,{[max($2,1e-6),max($3,1e-6)]} *[0] 255 a c } +fx_canny_preview : +gui_split_preview "fx_canny $*",${-3--1} +fx_edge_offsets : +repeat $! { +os:=s +b. $1% gradient_norm. >=. $2% skeleton. 0 distance. 1 round. 1 %. $3 >=. {max(1,$3-$4)} +if !$5 negate. fi +n. 0,255 to_colormode. $os +mv. 0 } +fx_edge_offsets_preview : +gui_split_preview "fx_edge_offsets ${^0}",${-3--1} +fx_extract_foreground : +if !$! return fi +resolution:=arg(1+$3,512,1024,2048,0) +foreach { +nm=${-gui_layer_name} +initial_pos=${-gui_layer_pos} +=> "[G"{`39`}"MIC] Interactive Foreground Extraction" +if [$6][0]==-1" || "[$5]!=[w,h] _gui_control_points= else _gui_control_points=$6 fi +status=${x_segment\ $resolution} +sh 3 b. $1% if $2>0 dilate. {1+2*$2} elif $2<0 erode. {1-2*$2} fi +rm. +if $3==1 sh 3 max. 1 rm. +elif $3==2 s c,-3 r. 100%,100%,1,4 rv =>[0] "name(Mask)" =>[1] "name("$nm")" +elif $3==3 +. +sh.. 0,2 +channels... 3,3 >=. 3 *[-2,-1] rm. +sh. 0,2 +channels.. 3,3 <=. {255-3} *[-2,-1] rm. +sh. 3 *. -1 +. 255 rm. +gui_autocrop_layers[0] +pos0=${gui_layer_pos[0]} pos1=${gui_layer_pos[1]} +=>[0] "name("$nm" [foreground]),pos("{``{[$pos0]+[$initial_pos]}}")" +=>[1] "name("$nm" [background]),pos("{``{[$pos1]+[$initial_pos]}}")" +fi +} +if narg($status)>=4 u \{$1\}\{$2\}\{$3\}\{$4\}\{{w},{h}\}\{$status\} else u "" fi +fx_gradient_norm : +b $1 gradient_norm ^ $2 +c $3%,$4% +if $5 negate fi +n 0,255 +fx_gradient_norm_preview : +gui_split_preview "fx_gradient_norm ${^0}",${-3--1} +fx_gradient2rgb : +b $1 gradient2rgb $4 +c $2%,$3% +if $5 negate fi +n 0,255 +fx_gradient2rgb_preview : +gui_split_preview "fx_gradient2rgb ${^0}",${-3--1} +fx_isophotes : +if $3 +topographic_map $1,$2 +else +b $2 isophotes $1 +fi +fx_isophotes_preview : +gui_split_preview "fx_isophotes ${^0}",${-3--1} +fx_laplacian : +b $1 laplacian +if $4 abs fi +c $2%,$3% +if $5 negate fi +n 0,255 +fx_laplacian_preview : +gui_split_preview "fx_laplacian ${^0}",${-3--1} +_fx_local_orientation : +foreach { +split_opacity l[0] { +b $1% gradient_orientation 2 complex2polar rm[0--1:2] +c $2%,$3% +if $4 negate fi +n 0,255 +} +a c +} +fx_local_orientation : +ac "_fx_local_orientation $1,$2,$3,$4",$5,2 +fx_local_orientation_preview : +gui_split_preview "fx_local_orientation ${^0}",${-3--1} +fx_morphological : +ac "_fx_morphological ${1-3},\"$4\",${5-6}",$7,$8 +fx_morphological_preview : +gui_split_preview "fx_morphological ${1-3},\"$4\",${5--1}",${-3--1} +if $2==3 +('"$4"') f. "(i>=_'0' && i<=_'9') || i==_',' || i==_';'?i:-1" +discard. -1 ({t}) rr2d. {0,max(24,w/6)},{0,max(24,h/6)},0,1 >. 0 *. 255 +to_rgba. frame. 1,1,0,0,0,0,255 frame. 1,1,255 frame. 1,1,0,0,0,0,255 +j[^-1] .,2,2,0,0,0.75 rm. +else +fi +_fx_morphological : +('"$4"') f. "(i>=_'0' && i<=_'9') || i==_',' || i==_';'?i:-1" discard. -1 ckernel={t} rm. +if !$2 +m "my_erode: erode $""1" +m "my_dilate: dilate $""1" +m "my_opening : opening $""1" +m "my_closing : closing $""1" +elif $2==1 +m "my_erode: erode_oct $""1" +m "my_dilate: dilate_oct $""1" +m "my_opening : opening_circ $""1" +m "my_closing : closing_circ $""1" +elif $2==2 +m "my_erode: erode_circ $""1" +m "my_dilate: dilate_circ $""1" +m "my_opening : opening_circ $""1" +m "my_closing : closing_circ $""1" +else +m "my_erode : skip $""1 ("$ckernel") erode[^-1] . rm." +m "my_dilate : skip $""1 ("$ckernel") dilate[^-1] . rm." +m "my_opening : skip $""1 ("$ckernel") opening[^-1] . rm." +m "my_closing : skip $""1 ("$ckernel") closing[^-1] . rm." +fi +if !$1 m "my_action : my_erode $3" +elif $1==1 m "my_action : my_dilate $3" +elif $1==2 m "my_action : my_opening $3" +elif $1==3 m "my_action : my_closing $3" +elif $1==4 m "my_action : +my_erode $3 -" +elif $1==5 m "my_action : +my_dilate $3 rv -" +elif $1==6 m "my_action : +my_opening $3 -" +elif $1==7 m "my_action : +my_closing $3 rv -" +elif $1==8 m "my_action : +my_opening $3 +my_closing.. $3 +[-2,-1] /. 2 -" +else m "my_action : +my_opening $3 my_closing.. $3 -" +fi +foreach { +if !$6 split_opacity fi +my_action[0] +a c +} +if $5 foreach { split_opacity negate[0] a c } fi +um my_erode,my_dilate,my_action +fx_segment_watershed : skip ${4=1} +ac "b $2 segment_watershed $1",$3,$4 +fx_segment_watershed_preview : +gui_split_preview "fx_segment_watershed ${^0}",${-3--1} +fx_skeleton : +remove_opacity +b $2% >= 50% +if $1 thinning 1 +else +distance 0 sharpen 1e10 >= 100% +repeat $! { +erode[$>] 2 -[$>,-1] } +fi +* 255 +fx_skeleton_preview : +gui_split_preview "fx_skeleton ${^0}",${-3--1} +fx_superpixels : +foreach { ++srgb2lab slic. ${1-3} +if $4 +blend shapeaverage else +map. 2,2 fi +if $5 +(0,1,0;1,1,1;0,1,0) +dilate[1] . -[1,-1] neq[1] 0 rm. +if $6 dilate_circ[1] $6 fi +[0],[0],1,4 +fc. ${7-10} to_rgba.. j.. .,0,0,0,0,$5,... k.. +else k. +fi +} +fx_superpixels_preview : +gui_split_preview "fx_superpixels ${^0}",${-3--1} +fx_thin_edges : +b $1% gradient_norm >= $2% thinning 1 +if !$3 negate fi +n 0,255 +fx_thin_edges_preview : +gui_split_preview "fx_thin_edges ${^0}",${-3--1} +fx_breaks : +foreach { +if !$5 to_a fi +100%,100%,1,1,"u<($3%)^6" +if $1 +distance. 1 sharpen. 100000 neq. 0 distance. 1 b. $4 g. xy a[-2,-1] c +else +delaunay. 0 label_fg. 0,1 {1+iM},1,1,2 rand. -30,30 point. 0 map.. . rm. +fi +n. -$2,$2 warp[0] .,1,1,$5 rm. +} +fx_custom_deformation : +if !$5 to_a fi +str="const a = $6; const b = $7; const c = $8; const d = $9;" +repeat $! { ++norm. . +f.. $str"($1)" +f. $str"($2)" +a[-2,-1] c warp.. .,$3,$4,$5,1 rm. +mv. 0 } +fx_circle_transform : +foreach { +to_rgba r:=dx=($3-$1)*(w-1)%;dy=($4-$2)*(h-1)%;norm(dx,dy) +if !$7 cond="i(X,Y,z,c,$8,$9)" +elif $7==1 cond="N<$r?i(X,Y,z,c,$8,$9):i" +else cond="N>$r?i(X,Y,z,c,$8,$9):i" +fi +f "U = x - w*$1%; +V = y - h*$2%; +N = sqrt(U*U + V*V); +Nr = N - "$r"; +X = x + $5*Nr*U/N; +Y = y + $6*Nr*V/N; +"$cond +} +fx_circle_transform_preview : +fx_circle_transform $* +if $10 +rr2d ${-gui_preview_wh},0,1 +foreach { +x0,y0:=[$1,$2]*([w,h]-1)% +r:=dx=($3-$1)*(w-1)%;dy=($4-$2)*(h-1)%;norm(dx,dy) +circle $x0,$y0,{$r-1},1,0xFFFFFFFF,0,0,0,255 +circle $x0,$y0,{$r+1},1,0xFFFFFFFF,0,0,0,255 +circle $x0,$y0,$r,1,0xFFFFFFFF,0,255,0,255 +} +fi +fx_conformal_maps : +to_a +expr0="$4" +expr1="z" +expr2="(z+1)/(z-1)" +expr3="cos(z)" +expr4="sin(z)" +expr5="tan(z)" +expr6="exp(z)" +expr7="log(z)" +expr8="1/(4*z^2-1)" +expr9="-5*(z^3/3-z/4)/2" +('${expr$1}') +replace_str. "*","**" +replace_str. "/","//" +replace_str. "^","^^" +replace_str. "exp(","cexp(" +replace_str. "log(","clog(" +replace_str. "cos(","ccos(" +replace_str. "sin(","csin(" +replace_str. "tan(","ctan(" +expr={t} +rm. +foreach { +wh:=$12?[$13,$14]:[w,h] +{(1+$11)*[$wh]},1,100% +f. "begin( +ccos(z) = (iz = [ -z[1],z[0] ]; (cexp(iz) + cexp(-iz)/2)); +csin(z) = (iz = [ -z[1],z[0] ]; (cexp(iz) - cexp(-iz)/2)); +ctan(z) = csin(z)//ccos(z); +boundary = $10; +interpolation = 1; +const f = max(w,h); +const f0 = max(w#0,h#0); +i = [0,1]; +); +z = (2*[ x,y ] - [ w,h ])/f; +z = rot(-$6°)*z; +z-= [ $8, $9 ]; +z/=[ 10^($5 + $7), 10^$5 ]; +z = ("$expr"); +if ($1, z = z^^[$2,$3]); +z = rot($6°)*z; +z = 0.5*(f0*z + [w#0,h#0]); +I(#0,z)" +r. $wh,1,100%,2 +rm.. +} +fx_conformal_maps_preview : +fx_conformal_maps ${1-3},"$4",${5-11},0,0,0 +souphead_droste10 : +_souphead_droste10 ${1-26},0,${28-31} +souphead_droste10_preview : +_souphead_droste10 ${1--1} +_souphead_droste10 : +repeat $! l[$>] +to_a ++f. 0 +sh. 0 +f. "* +begin(InnerRadius = $1; +OuterRadius = $2; +Periodicity = $3; +Strands = $4; +Zoom = $5; +Rotate = $6; +XShift = $7; +YShift = $8; +XCenterShift = $9; +YCenterShift = $10; +StartingLevel = $11; +NumberOfLevels = $12; +LevelFrequency = $13; +ShowBothPoles = $14; +PoleRotation = $15; +PoleLong = $16; +PoleLat = $17; +TilePoles = $18; +HyperDroste = $19; +FractalPoints = $20; +AutoSetPeriodicity = $21; +NoTransparency = $22; +ExternalTransparency = $23; +MirrorEffect = $24; +Untwist = $25; +DoNotFlattenTransparency = $26; +ShowGrid = $27; +ShowFrame = $28; +Antialias = $29; +XEdgeType = $30; +YEdgeType = $31; +r1 = InnerRadius/100; +r2 = OuterRadius/100; +p1 = Periodicity; +p2 = Strands; +xCenterShift = XCenterShift/100; +yCenterShift = YCenterShift/100; +W = (w-1)/2; +H = (h-1)/2; +xShift = (XShift*w/W)/100; +yShift = (YShift*h/H)/100; +tileBasedOnTransparency=!(NoTransparency); +transparentPointsIn=!(ExternalTransparency); +levelsToLookOut=StartingLevel; +levelToShow=LevelFrequency; +retwist=!(Untwist); +if (AutoSetPeriodicity,p1=p2/2*(1+sqrt(1-(log(r2/r1)/pi)^2))); +if (p1>0,rotate=-(pi/180)*Rotate,rotate=(pi/180)*Rotate); +zoom=(Zoom+InnerRadius-1)/100; +epsilon=0.01; +if(retwist,xbounds0=-r2;xbounds1=r2;ybounds0=-r2;ybounds1=r2,ybounds0=0;ybounds1=2.1*pi;xbounds0=-log(r2/r1);xbounds1=-xbounds0); +minDimension=min(w,h); +xymiddle=0.5*(xbounds0+xbounds1); +xymiddlei=0.5*(ybounds0+ybounds1); +xyrangex=xbounds1-xbounds0; +xyrangey=ybounds1-ybounds0; +aspectRatio=w/h; +xyrangex=xyrangey*aspectRatio; +xbounds0=xymiddle-0.5*xyrangex; +xbounds1=xymiddle+0.5*xyrangex; +pLat = (PoleLat*w/W)/100; +pLon = (PoleLong*w/W)/100; +alpha=atan(p2/p1*log(r2/r1)/(2*pi)); +f=cos(alpha); +beta=f*cos(alpha); +betai=f*sin(alpha); +if(p2>0,angle=2*pi*p1,angle=-2*pi*p1); +if(MirrorEffect,angle=angle/Strands); +); +X=x-((w-1)/2); +Y=((h-1)/2)-y; +z=xbounds0+(xbounds1-xbounds0)*(X+w/2)/w; +zi=ybounds0+(ybounds1-ybounds0)*(Y+h/2)/h; +if(retwist, +zinitial=z; +zinitiali=zi; +z=z-xShift; +zi=zi-yShift; +expo=cos(rotate); +expoi=sin(rotate); +zmid=(z-xymiddle)/zoom; +zmidi=(zi-xymiddlei)/zoom; +zx=(zmid*expo+zmidi*expoi); +zy=(zmidi*expo-zmid*expoi); +z=xymiddle+zx; +zi=xymiddlei+zy, +zinitial=r1*exp(z)*cos(zi); +zinitiali=r1*exp(z)*sin(zi); +expo=cos(rotate)*zoom; +expoi=sin(rotate)*zoom; +zx=zinitial*expo-zinitiali*expoi; +zy=zinitial*expoi+zinitiali*expo; +zinitial=zx; +zinitiali=zy +); +if(ShowBothPoles, +theta=(pi/180)*PoleRotation; +xx=z; +yy=zi; +div=0.5*(1+xx^2+yy^2+((1-xx^2-yy^2)*cos(theta))-(2*xx*sin(theta))); +xx=xx*cos(theta)+(0.5*(1-xx^2-yy^2)*sin(theta)); +z=xx/div; +zi=yy/div, +if(HyperDroste, +zx=sin(z)*cosh(zi); +zy=cos(z)*sinh(zi); +z=zx; +zi=zy +); +if(TilePoles, +p=sqrt(z*z + zi*zi)^FractalPoints; +frac=FractalPoints*atan2(zi,z); +z=p*cos(frac); +zi=p*sin(frac); +z=2*z; +zi=2*zi; +p=cos(2*z)+cosh(2*zi); +zx=sin(2*z)/p; +zy=sinh(2*zi)/p; +z=zx; +zi=zy +); +); +z=z+pLat; +zi=zi+pLon; +if(retwist, +za=z/r1; +zb=zi/r1; +zx=0.5*log(za*za+zb*zb); +zy=atan2(zb,za); +z2=zx; +z2i=zy, +z2=z; +z2i=zi +); +p=beta*beta+betai*betai; +z=p1*(z2*beta+z2i*betai)/p; +zi=p1*(z2i*beta-z2*betai)/p; +rotatedscaledlogz=z; +rotatedscaledlogzi=zi; +logz=z2; +logzi=z2i; +zx=r1*exp(z)*cos(zi); +zy=r1*exp(z)*sin(zi); +z=zx; +zi=zy; +if(tileBasedOnTransparency && levelsToLookOut>0, +if(!transparentPointsIn, +ratio=r2/r1*cos(angle); +ratioi=r2/r1*sin(angle), +ratio=r1/r2*cos(angle); +ratioi=-r1/r2*sin(angle) +); +p=sqrt(ratio*ratio+ratioi*ratioi)^levelsToLookOut; +q=atan(ratioi/ratio); +rp=p*cos(levelsToLookOut*q); +rpi=p*sin(levelsToLookOut*q); +zx=z*rp-zi*rpi; +zy=z*rpi+zi*rp; +z=zx; +zi=zy; +); +colorSoFarR=0; +colorSoFarG=0; +colorSoFarB=0; +colorSoFarA=0; +alphaRemaining=1; +ix=minDimension/2*(z+xCenterShift); +iy=minDimension/2*(zi+yCenterShift); +realx=ix+((w-1)/2); +realy=((h-1)/2)-iy; +if(realx<0 || realx>=w, +if(XEdgeType==1, +realx=realx%w; +if(realx<0,realx=w+realx) +); +if(XEdgeType==2, +realx=abs(realx%w); +if(realx=h, +if(YEdgeType==1, +realy=realy%h; +if(realy<0,realy=h+realy) +); +if(YEdgeType==2, +realy=abs(realy%h); +if(realyepsilon,sign=-1); +if(!transparentPointsIn && alphaRemaining>epsilon,sign=1), +radius=sqrt(z*z+zi*zi); +if(radiusr2,sign=1) +); +if(sign<0, +ratio=r2/r1*cos(angle); +ratioi=r2/r1*sin(angle) +); +if(sign>0, +ratio=r1/r2*cos(angle); +ratioi=-r1/r2*sin(angle) +); +if(levelToShow>1, +lograt=levelToShow*0.5*log(ratio*ratio+ratioi*ratioi); +lograti=levelToShow*atan2(ratioi,ratio); +ratio=exp(lograt)*cos(lograti); +ratioi=exp(lograt)*sin(lograti) +); +iteration=StartingLevel; +maxiteration=NumberOfLevels+StartingLevel-1; +while(sign!=0 && iteration=w, +if(XEdgeType==1, +realx=realx%w; +if(realx<0,realx=w+realx) +); +if(XEdgeType==2, +realx=abs(realx%w); +if(realx=h, +if(YEdgeType==1, +realy=realy%h; +if(realy<0,realy=h+realy) +); +if(YEdgeType==2, +realy=abs(realy%h); +if(realyepsilon,sign=-1); +if(!transparentPointsIn && alphaRemaining>epsilon,sign=1), +radius=sqrt(z*z+zi*zi); +colorSoFarR=ColorOutR; +colorSoFarG=ColorOutG; +colorSoFarB=ColorOutB; +colorSoFarA=ColorOutA; +if(radiusr2,sign=1) +); +iteration=iteration+1; +); +ColorOutR=colorSoFarR; +ColorOutG=colorSoFarG; +ColorOutB=colorSoFarB; +ColorOutA=colorSoFarA; +if(ShowGrid, +gridzx=(logz+10*log(r2/r1))%log(r2/r1); +gridzy=(logzi+10*2*pi)%(2*pi); +if(gridzx(log(r2/r1)-epsilon) || gridzy(2*pi-epsilon), +ColorOutR=0; +ColorOutG=1; +ColorOutB=0; +ColorOutA=1; +); +gridzx=(rotatedscaledlogz+10*log(r2/r1))%log(r2/r1); +gridzy=(rotatedscaledlogzi+10*2*pi)%(2*pi); +if(gridzx(log(r2/r1)-epsilon) || gridzy(2*pi-epsilon), +ColorOutR=0; +ColorOutG=0; +ColorOutB=1; +ColorOutA=1; +); +); +if(ShowFrame, +gridzx=zinitial; +gridzy=zinitiali; +if(gridzx<(aspectRatio*r2) && gridzx>-(aspectRatio*r2) && gridzy-r2, +dx=min((aspectRatio*r2)-gridzx,gridzx+(aspectRatio*r2)); +dy=min(r2-gridzy,gridzy+r2); +if(dx<(4*epsilon) || dy<(4*epsilon), +ColorOutR=1; +ColorOutG=1; +ColorOutB=1; +ColorOutA=1 +); +if(dx<(2*epsilon) || dy<(2*epsilon), +ColorOutR=0; +ColorOutG=0; +ColorOutB=0; +ColorOutA=1 +), +ColorOutR=0.75*ColorOutR; +ColorOutG=0.75*ColorOutG; +ColorOutB=0.75*ColorOutB; +ColorOutA=1 +); +); +if(!DoNotFlattenTransparency,ColorOutA=1); +i(#1,x,y,0,1)=ColorOutG*255; +i(#1,x,y,0,2)=ColorOutB*255; +i(#1,x,y,0,3)=ColorOutA*255; +ColorOutR*255" +k.. +done done +fx_crease : +foreach { +if !$3 to_a fi +2,2,1,2,{"const w1 = w#-1-1; const h1 = h#-1 - 1; [ 0,w1,0,w1,0,0,h1,h1 ];"} +r. {0,D=$2*[w,h]%;[max(D[0],1),max(D[1],1)]},1,2,3 noise. $1,1 +r. ..,..,1,2,3 warp.. .,0,1,$3 rm. +} +fx_distort_lens : +if !$6 to_a fi +undistort ${1-3},$4%,$5%,$6 +fx_drop_water : +N:=$!-$1 +if $N<=0 error "At least two layers are required in this mode." fi +repeat $N { l[{$!-$>-1}] { +nm0={n} nm=${-gui_layer_name} +=> img +srand $5 +if $1 +pass[0] 0 to_a. channels. 100% >=. 50% +r. [0],[0],1,1,0,0,0.5,0.5 +else +100%,100% +rmin,rmax:=max(0.1,$3*(1-$4%)),max(0.1,$3) +repeat 10 { +100%,100% +random3d {max(1,$2)} *3d. {-2,w},{-2,h},0 +j3d.. .,0,0,0,1,1,0,0 rm. +b. {$rmin+($rmax-$rmin)*$>/9}%,0,1 +j.. .,0,0,0,0,0.5 rm. +} +>=. 10% +fi +=> shape ++b[shape] 1% n. 0,30 +=> elevation +g[elevation] xy a[-2,-1] c => grad ++*[grad] {grad,$6*max(w,h)/100} *. [shape] b. $15% ++warp[img] .,1,1,1 rm.. => refraction ++*[grad] -1 100%,100%,1,1,1 a[-2,-1] c orientation. +a:=$7*pi/180 ca:=-cos($a) sa:=-sin($a) +mix_channels. ({(1-$10)*$ca},{(1-$10)*$sa},1) c. {100-$8}%,100% n. 0,1 +*. [shape] => spots +mix_channels[grad] ($ca,$sa) +n[grad] 0,1 *[grad] [shape] ++shift[shape] {-$11*$ca}%,{-$11*$sa}%,0,0,1 +-. [shape] >=. 1 b. $13% n. 0,1 +=> shadow +b[shape] $14% n. 0,1 +=>[img] name($nm) +*[shadow] 255 channels[shadow] -1,0 mv[shadow] 1 +=>[shadow] "name("$nm" [shadow]),mode(alpha),opacity("{$12*100}")" +to_a[refraction] sh[refraction] 100% +b[shape] $15% *[-2,-1] rm. +mv[refraction] 2 +=>[refraction] "name("$nm" [refraction]),mode(alpha)" +channels[spots] -1,0 sh[spots] 0 f. 1 rm. *[spots] 255 +=>[spots] "name("$nm" [specular spots]),mode(alpha),opacity("{$9*100}")" +rv[shape,grad] a[grad,shape] c *[grad] 255 b[grad] $15% +=>[grad] "name("$nm" [gradient]),mode(grainmerge)" +rv +if !$16 gui_merge_layers => $nm0 fi +} } +if $1 rm[0] fi +fx_drop_water_preview : +N:=$!-$1 +if $N<=0 gui_warning_preview "At least two layers are required in this mode." return fi +if $1 +repeat $N { l[{$!-$>-1}] { +pass[0] 0 mv. 0 +fx_drop_water $* gui_merge_layers +} } +rm[0] +else foreach { fx_drop_water $* gui_merge_layers } +fi +fx_equirectangular2nadirzenith : +if $1 nadirzenith2equirectangular else equirectangular2nadirzenith fi +fx_euclidean2polar : +if !$4 to_a fi +if $5 polar2euclidean $1%,$2%,$3,$4 else euclidean2polar $1%,$2%,$3,$4 fi +fx_flower : +if !$7 to_a fi +amplitude,angle:=dx=$3-$1;dy=$4-$2;[norm(dx,dy),-atan2(dy,dx)*180/pi] +flower $amplitude,$5,$6%,$angle,$1%,$2%,$7 +fx_flower_preview : +fx_flower $* +line $1%,$2%,$3%,$4%,1,0xF0F0F0F0,0 +line $1%,$2%,$3%,$4%,1,0x0F0F0F0F,255 +fx_rotoidoscope : +if !$5 to_a fi +rotoidoscope $1%,$2%,$3,$4%,$5 +fx_kaleidoscope : +if !$7 to_a fi +shift $3%,$4%,0,0,2 kaleidoscope $1%,$2%,$5,$6,$7 +fx_symmetrizoscope : +if !$3 to_a fi +repeat $1 { +ang:=$2+180*$>/max(1,$1-1) +symmetrize 50%,50%,$ang,$3,0,{$4!=2?$4:$>%2} +} +fx_morph_interactive : +if [$3][0]!=-1 __x_morph_keypoints=$3 fi +rv +x_morph $1,$2 +repeat $! { gui_set_layer_name[$>] "Morphing ""#"$> gui_set_layer_pos[$>] 0,0 } +rv +u "{$1}{$2}{"$__x_morph_keypoints"}" +fx_morph_interactive_preview : +if $!<2 gui_warning_preview "This filter requires at least two input layers!" return fi +rr2d ${-max_wh},0,3 + n 0,255 +if [$3][0]!=-1 gui_warning_preview "No preview available\n\nKeypoints from previous\nrun have been saved" +else gui_warning_preview "No preview available" +fi +fx_warp_perspective : +if !$8 to_a fi +shift $6%,$7%,0,0,2 warp_perspective $1,$2,$3,$4,$5,$8 +fx_transform_polar : +if !$6 to_a fi +if !$1 +transform_polar "$4","$5",$2%,$3%,$6 +elif $1==1 +transform_polar R-r,a,$2%,$3%,$6 +else +transform_polar a*R/(2*pi),r*2*pi/R,$2%,$3%,$6 +fi +fx_quadrangle : +at_quadrangle $1%,$2%,$3%,$4%,$5%,$6%,$7%,$8%,${9-10} +fx_quadrangle_preview : +foreach { +if !$10 to_a fi +if $11 +fx_quadrangle $* rr2d. {0,[w,h]},2,3 fi +polygon[{$11==1}] 4,$1%,$2%,$3%,$4%,$5%,$6%,$7%,$8%,0.25,255 +if $11>=2 +circle[0] $1%,$2%,4,1,0 circle[0] $1%,$2%,3,1,255,0,0 +circle[0] $3%,$4%,4,1,0 circle[0] $3%,$4%,3,1,0,255,0 +circle[0] $5%,$6%,4,1,0 circle[0] $5%,$6%,3,1,64,128,255 +circle[0] $7%,$8%,4,1,0 circle[0] $7%,$8%,3,1,255,255,0 +elif $11>0 +rm[0] +fi +if $!==2 +drgba to[0] Quadrangle to[1] Result frame 1,1,0 ++a x a[0,1] y rr2d ${-gui_preview_wh},0,3 +k[{max(w#0,h#0)<=max(w#1,h#1)}] +fi +} +fx_reflect : +repeat $! { +to_rgba. +rows. {100-$1}%,100% mirror. y water. $7,$8 +s. c +f[-4] "(i*(255-$6) + $6*$3)/255" +f... "(i*(255-$6) + $6*$4)/255" +f.. "(i*(255-$6) + $6*$5)/255" a[-4--1] c +*. '(h^$2-y^$2)/h^$2' a[-2,-1] y +100%,100%,100%,1,$11*$12*(x/w-0.5) +100%,100%,100%,1,$11*$12*(y/h-0.5) +100%,100%,100%,1,"$10*(x/w-0.5) + $9*(y/h-0.5) + $11" +/... . +... 0.5 *... {-3,w} +/[-2,-1] +. 0.5 *. {h} +a[-2,-1] c warp.. .,0,1,0 rm. +mv. 0 } +autocrop 0,0,0,0 +fx_seamcarve : +if $4 +if $!<2 error "Priority mask (top layer) is missing!" fi +_fx_seamcarve +fi +seamcarve $1%,$2%,$4,$5,$3% +if $4 repeat $! { channels[$>] 0,{$>,s-2} } fi +c 0,255 +fx_seamcarve_preview : +if $4 +if $!<2 to_rgb to "Priority mask (top layer) is missing!",5,5,18,2 return fi +_fx_seamcarve +fi +foreach { +w,h={w},{h} +seamcarve $1%,$2%,$4,$5,{max($3,10)}% +if $4 channels 0,{s-2} fi +to_rgba r $w,$h,1,100%,0,0,0.5,0.5 +} +c 0,255 +_fx_seamcarve : +mv[0] $! +l. { s c k[0,1] >[1] [0] !=[0] 0 -[0] [1] *[0] -1 + * 256 } +repeat $!-1 { a[$>] .,c } rm. +fx_map_sphere : +rotate {$8*90} +if $6 +repeat $! { +shift. {round(w/2)},0,0,0,2 +columns. {(1-$7/100)*w/2},{(1+$7/100)*w/2} +100% gaussian. {0.1*w},{h},0 100% 100% a[-3--1] c r. ..,..,1,3 +smooth.. .,$6,5,0 rm. +j.. .,{(1-$7/100)*{-2,w}/2} rm. shift. -{round(w/2)},0,0,0,2 +mv. 0 } +fi +shift $5%,0,0,0,2 to_rgba +if $9 +repeat $! { ++rows[$>] 0 r. 1,1,1,4,2 RGBA$>={^} +r. [$>],[$>],1,4 -[$>,-1] +} +fi +map_sphere $1,$2,$3,$4,$10,$11 +if $9 +repeat $! { +(${RGBA$>}) y. c r. [$>],[$>],1,4 +[$>,-1] +} +fi +fx_map_sphere_preview : +fx_map_sphere {w},{h},${3--1} +fx_spherize : +ratio:=10^$6 +spherize $1%,$2,$3%,$4%,$5%,$ratio,$7,$8 +cut 0,255 +fx_spherize_preview : +cx,cy=${4,5} +if $9 grid 5%,5%,50%,50%,0.6,255 fi +fx_spherize ${1-3},$cx,$cy,${6--1} +fx_square_circle : +mode,interp,boundary,factx,facty,offx,offy=${1-7} +if !$boundary to_a fi +base="const interpolation = "$interp"; +const boundary = "$boundary"; +const offx = "$offx"%; +const offy = "$offy"%; +const factx = 10^-("$factx"%); +const facty = 10^-("$facty"%); +const w2 = int(w/2); +const h2 = int(h/2);" +if !$mode +f $base" +const tst = 2*sqrt(2); +U = (2*x/(w-1) - 1)*factx + offx; +V = (2*y/(h-1) - 1)*facty + offy; +U2 = U^2; +V2 = V^2; +U2mV2 = U2 - V2; +X = 0.5*(sqrt(max(0,2 + tst*U + U2mV2)) - sqrt(max(0,2 - tst*U + U2mV2))); +Y = 0.5*(sqrt(max(0,2 + tst*V - U2mV2)) - sqrt(max(0,2 - tst*V - U2mV2))); +(X+=1)*=w2 - 0.5; +(Y+=1)*=h2 - 0.5; +I(X,Y)" +else +f $base" +X = (2*x/(w-1) - 1)*factx + offx; +Y = (2*y/(h-1) - 1)*facty + offy; +U = X*sqrt(abs(1 - 0.5*Y^2)); +V = Y*sqrt(abs(1 - 0.5*X^2)); +(U+=1)*=w2 - 0.5; +(V+=1)*=h2 - 0.5; +I(U,V)" +fi +fx_square_circle_alt : +mode,centerx,centery,zoom,angle,interpolation,boundary,ratio=${1-8} +if !$boundary to_a fi +f. "const cx = w*$centerx%; +const cy = h*$centery%; +const zoom = 10^($zoom%); +const angle = $angle°; +const interpolation = $interpolation; +const boundary = $boundary; +const fx = $ratio?w:1; +const fy = $ratio?h:1; +x = (x - cx)/fx; +y = (y - cy)/fy; +t = atan2(y,x); +r = norm(x,y); +phi = (t + pi/4)%(pi/2) - pi/4; +nr = ($mode?r*cos(phi):r/cos(phi))/zoom; +t+=angle; +nx = cx + fx*nr*cos(t); +ny = cy + fy*nr*sin(t); +i(nx,ny)" +fx_square_circle_alt_preview : +gui_split_preview "fx_square_circle_alt $*",${-3--1} +fx_project_stereographic : +is_inverse,centerx,centery,radangx,radangy,rechor,lrblur,dilation,mirror,boundary,ocenterx,ocentery=${1-11} +if $centerx!=$ocenterx" || "$centery!=$ocentery +deltax,deltay:=[$radangx,$radangy]-[$ocenterx,$ocentery] +radangx,radangy:=[$centerx,$centery]+[$deltax,$deltay] +fi +status=\{$is_inverse\}\{$centerx,$centery\}\{$radangx,$radangy\}\{$rechor\}\{$lrblur\}\{$dilation\}\{$mirror\}\{$boundary\}\{$centerx,$centery\} +nradangx,nradangy:=[$centerx,$centery]+rot(-90°)*([$radangx,$radangy]-[$centerx,$centery]) +init="const boundary = "$is_inverse?$boundary:2"; +const interpolation = 1; +const dilation = 2^"$dilation"; +const centerx = "$centerx"%*(W-1); +const centery = "$centery"%*(H-1); +const radangx = "$nradangx"%*(W-1) - centerx; +const radangy = "$nradangy"%*(H-1) - centery; +const R = sqrt(radangx^2 + radangy^2); +const theta0 = atan2(radangy,radangx); +const pi2 = 2*pi;" +m "_fx_project_stereographic_mirror : if !$""1 mirror y elif $""1==1 mirror xy elif $""1==3 mirror x fi" +foreach { +if !$boundary to_a fi +if $rechor rotate $rechor,1,3 fi +if $lrblur +100%,1,1,1,!x||x==w-1 shift {round(w/2)},0,0,0,2 b. x,$lrblur% n. 0,1 +b.. x,$lrblur% +r.. .,.,1,1 j... .,0,0,0,0,1,.. k[0] shift {-round(w/2)},0,0,0,2 +fi +if $is_inverse +100%,50%,1,100%,"* +const W = w#0; +const H = h#0; +"$init" +theta = theta0 + x*pi2/w; +phi = (y/h - 0.5)*pi; +z = R*sin(phi); +rho = ((R + z)/(R - z))^(0.5/dilation)*R; +X = centerx + rho*cos(theta); +Y = centery + rho*sin(theta); +I(#0,X,Y)" +_fx_project_stereographic_mirror $mirror +else +_fx_project_stereographic_mirror $mirror +{u=0$_is_preview?min(w,h):max(w,h);[u,u,1,s]},"* +const W = w; +const H = h; +"$init" +X = x - centerx; +Y = y - centery; +theta = atan2(Y,X); +beta = ((X^2 + Y^2)/R^2)^dilation; +z = R*(beta - 1)/(beta + 1); +phi = asin(z/R); +theta = ((theta - theta0)*w#0/pi2)%w#0; +phi = (h#0*(phi/pi + 0.5))%h#0; +I(#0,theta,phi)" +fi +k. } um _fx_project_stereographic +if 0$_is_preview +line $centerx%,$centery%,$radangx%,$radangy%,0.75,0xF0F0F0F0,255,255,255,255 +line $centerx%,$centery%,$radangx%,$radangy%,0.75,0x0F0F0F0F,0,0,0,255 +fi +u $status +fx_project_stereographic_preview : +_is_preview=1 +fx_project_stereographic $"*" +fx_symmetrize : +if !$6 to_a fi +angle:=isnan($3)?$5:atan2($4-$2,$3-$1)*180/pi +symmetrize $1%,$2%,$angle,${6-8} +fx_symmetrize_preview : +fx_symmetrize $* +rr2d ${-gui_preview_wh},0,1 +u,v:=angle=isnan($3)?$5*pi/180:atan2($4-$2,$3-$1);[cos(angle),sin(angle)] +foreach { +x0,y0,x1,y1:=V=[$u,$v];([${1,2},${1,2}]+10000*[V,-V])*([w,h,w,h]-1)% +line $x0,$y0,$x1,$y1,1,0x0F0F0F0F,0,0,0,255 +line $x0,$y0,$x1,$y1,1,0xF0F0F0F0,255 +} +fx_textured_glass : +foreach { +100%,100%,1,1 +if $7 plasma. 1,1,$7 else rand. 0,1 fi +g. xy +if $5 ++gradient_norm... +. 1 b. $6 ^. -$5 +*... . *[-2,-1] +fi +blur_xy[-2,-1] $3,$4 +*.. {-2,$1/max(abs(im),abs(iM))} +*. {$2/max(abs(im),abs(iM))} +a[-2,-1] c +warp.. .,1,1,1 rm. +} +fx_textured_glass_preview : +gui_split_preview "fx_textured_glass $*",${-3--1} +fx_twirl : +if !$4 to_a fi +twirl $1,$2%,$3%,$4 +fx_warp_interactive : +if [$4][0]!=-1 __x_warp_keypoints=$4 fi +x_warp $2,$2,$3,$1 +u "{$1}{$2}{$3}{"$__x_warp_keypoints"}" +fx_warp_interactive_preview : +if [$4][0]!=-1 __x_warp_keypoints=$4 fi +foreach { +rr2d $_preview_area_width,$_preview_area_height,0,3 to_color drgba +if narg($__x_warp_keypoints) ($__x_warp_keypoints) r. 1,{w/4},1,4,-1 +else +nbp,nbq=$2,$2 +1,{$nbp*$nbq},1,4,"const nbp = "$nbp"; const nbq = "$nbq"; +p = y%nbp; +q = int(y/nbp); +x = p*100/(nbp - 1); +y = q*100/(nbq - 1); +[ x,y,x,y ]" +nbc=$3 +if $nbc>0 ++b[0] 0.5 gradient_norm. sqrt. {round([w,h]/4)} gaussian. 20% +1,$nbc,1,4,"> +begin(ref(crop(#-1),gauss)); +st = stats(#-2); +iM = st[1]; +xM = st[8]; +yM = st[9]; +img = vector(#w#-1*h#-1,-iM); +draw(#-2,img,xM - w#-1/2,yM - h#-1/2,0,0,w#-1,h#-1,1,1,-1,gauss); +nxyM = [ xM,yM ]*100/([w#-2,h#-2]-1); +[ nxyM,nxyM ]" +rm[-3,-2] +a[-2,-1] y +fi +fi ++_x_warp_rbf. {0,round([w,h]/4)} *. 4 r. [0],[0],1,100%,3 +. '[x,y]' warp[0] .,0,1,3 rm. +eval. "* +begin( +col1 = [ 64,200,255 ]; +const radius1 = 3; +const radius2 = radius1 + 2; +fact = ([ w#0,h#0 ] - 1)% +); +X = (I)[0,2]*fact; +ellipse(#0,X,radius2,radius2,0,1,0); +ellipse(#0,X,radius1,radius1,0,1,col1); I" +rm. +if narg($__x_warp_keypoints) +0 t. "Keypoints from previous\nrun have been saved",0,0,24,1,255 +frame. 5,5,0 +dilate_circ. 5 a[-2,-1] c blend alpha +fi +} +fx_wind : +if !$5 negate fi +ac "wind ${1-4}",$6,$7 +if !$5 negate fi +fx_wind_preview : +gui_split_preview "fx_wind $*",${-3--1} +fx_zoom : +if !$4" && "$1<1 to_a fi +zoom $1,{$2%},{$3%},0,$4 +fx_simulate_grain : +__fx_simulate_grain ${arg\ {1+$1},${-_fx_simulate_grain}},${2-11},0,0 +_fx_simulate_grain : +u orwo_np20,kodak_tmax400,kodak_tmax3200,kodak_trix1600,unknown +fx_simulate_grain_preview : +gui_split_preview "_fx_simulate_grain_preview $*",$-2 +_fx_simulate_grain_preview : +__fx_simulate_grain ${arg\ {1+$1},${-_fx_simulate_grain}},${2-13} +__fx_simulate_grain : +bm0=alpha bm1=grainmerge bm2=hardlight bm3=overlay bm4=softlight bm5=alpha +input_cached data_film_presets/grain_$1.cimgz +r. $4%,$4%,1,1,6 +if $4>100 b. 1 fi +sharpen. $5 c. 0,255 +repeat $!-1 { l[$>,-1] { +split_opacity[0] ++syntexturize. {0,[w,h]} +if $6 +syntexturize.. {w},{h} +syntexturize... {w},{h} a[-3--1] c fi +c. 0,255 +adjust_colors. ${7-11} +if $13 k[0,-1] rv +else blend[0,-1] ${bm$2},{$2<=4?$3:1} +fi +a[^-1] c +} } rm. +fx_blur_angular : +ac "blur_angular $1%,$2%,$3% sharpen $4",$6,$7 +fx_blur_angular_preview : +fx_blur_angular $* +if $5 +line 0,$3%,100%,$3%,0.5,0xF0F0F0F0,255 line 0,$3%,100%,$3%,0.5,0x0F0F0F0F,0 +line $2%,0,$2%,100%,0.5,0xF0F0F0F0,255 line $2%,0,$2%,100%,0.5,0x0F0F0F0F,0 +fi +fx_blur_bloom : +op=${"arg0 $4,+,max,min"} +if !$7 ac "blur_bloom ${1-3},"$op",${5-6},xy",$9 +else +wh:=w,h +rotate $8,2,1 +ac "blur_bloom ${1-3},"$op",${5-6},x blur_bloom {$1*(1-$7)},${2-3},"$op",${5-6},y",$9 +rotate {-$8},2,1 +r $wh,1,100%,0,0,0.5,0.5 c 0,255 +fi +fx_blur_bloom_preview : +gui_split_preview "fx_blur_bloom $*",${-3--1} +fx_blur_dof : +_$0 ${1-10},0,$12 +fx_blur_dof_preview : +_fx_blur_dof $* +_fx_blur_dof : +if !$3 +foreach { +if $11 drgba fi +split_opacity l[0] { +rmax:=(w*w+h*h)^0.5 R:=$7*$rmax/100 r:=$8*$rmax/100 +t:=$9*pi/180 u:=cos($t) v:=sin($t) +l1:=($rmax/(1e-8+$R))^2 l2:=($rmax/(1e-8+$r))^2 +a:=$l1*($u)^2+$l2*($v)^2 b:=$u*$v*($l1-$l2) c:=$l1*($v)^2+$l2*($u)^2 +100%,100%,1,1,'X=(x-$5*w/100)/max(w,h);Y=(y-$6*h/100)/max(w,h);f=$a*X*X+2*$b*X*Y+$c*Y*Y;exp(-f^$10/2.5)' +-[1] 1 *[1] -$1 ms,Ms:=im,iM +if $11 ++isoline3d[1] {0.1*$1} col3d. 255,255,0 ++isoline3d[1] {0.5*$1} col3d. 255,128,0 ++3d[-2--1] +__fx_dof_blur[0,1] $2,$ms,$Ms,$4 +[0],[0],1,3 j3d. ..,0,0,0,1,1,0,0 rm.. +circle. $5%,$6%,3,1,255,255,255 ++compose_channels. + !=. 0 dilate. 3 +j[0] ..,0,0,0,0,0.5,.,1 rm[-2,-1] +else __fx_dof_blur[0,1] $2,$ms,$Ms,$4 +fi +} +if $11 k[0] fi a c +} +elif $!>1 +luminance. n. 0,1 ^. {10^$12} +repeat $!-1 { +r. {$>,w},{$>,h},1,1,3 l[$>,-1] { +split_opacity[0] __fx_dof_blur[0,-1] $2,0,$1,$4 a c +} } rm. +else drgba to "Depth-of-field (bottom layer) is missing !",2,2,13,2,1,255 +fi +__fx_dof_blur : +n[1] 0,{$1-1} round[1] +[0],[0],1,{0,s+1} +s=0 +repeat $1 { ++==[1] {$4?$<:$>} b. 2% +j.. [0],0,0,0,0,-1,.,1 +j.. .,0,0,0,100%,-1 +rm. +ns:=$2+($3-$2)*($>+1)/($1-1) +b[0] {sqrt($ns^2-$s^2)}% +s=$ns +} +s. c,{-s+1} /[-2,-1] rm[0,1] +_fx_gaussian_blur : +b $1,$4 +if $2>0 repeat $! { l. { s y b $2,$4 a y } mv. 0 } fi +if $3>0 repeat $! { l. { s x b $3,$4 a x } mv. 0 } fi +fx_gaussian_blur : +ac "_fx_gaussian_blur $1,$2,$3,$4",$5,$6 +fx_gaussian_blur_preview : +gui_split_preview "fx_gaussian_blur $*",${-3--1} +fx_glow : +ac "glow $1",$2,$3 +fx_glow_preview : +gui_split_preview "fx_glow $*",${-3--1} +fx_blur_linear : +ac "blur_linear $1%,$2%,$3,$5 sharpen $4",$6,$7 +fx_blur_linear_preview : +gui_split_preview "fx_blur_linear $*",${-3--1} +_fx_blur_multidirectional : +nb_orientations,angle_ref,angle_range,smoothness,kernel,boundary_conditions,sharpness,blend_mode,contrast=${1-9} +foreach { +if $blend_mode<3 +f {$blend_mode?0:inf} fi +repeat $nb_orientations { +angle:=$angle_ref+$angle_range*($>/$nb_orientations-0.5) +$smoothness,1 gaussian. 20%,0.1 +if !$kernel f. "x>w/2?i:0" fi +rotate. $angle,1 ++convolve_fft[0] .,$boundary_conditions rm.. n. 0,255 sharpen. $sharpness +if $blend_mode<3 ${arg0\ $blend_mode,min,max,+}[1,-1] fi +} +rm[0] +if $blend_mode==6 blend_median +elif $blend_mode>2 blend_edges {arg($blend_mode-2,0.5,1,2)} +fi +n 0,255 ac "normalize_local "$contrast,hsl_l +} +fx_blur_multidirectional : +ac "_fx_blur_multidirectional ${1-9}",$10 +fx_blur_multidirectional_preview : +gui_split_preview "fx_blur_multidirectional $*",${-3--1} +fx_blur_radial : +ac "blur_radial $1%,$2%,$3% sharpen $4",$6,$7 +fx_blur_radial_preview : +fx_blur_radial $* +if $5 +line 0,$3%,100%,$3%,0.5,0xF0F0F0F0,255 line 0,$3%,100%,$3%,0.5,0x0F0F0F0F,0 +line $2%,0,$2%,100%,0.5,0xF0F0F0F0,255 line $2%,0,$2%,100%,0.5,0x0F0F0F0F,0 +fi +fx_chromatic_aberrations : +U1:=u=[${1-3}];u/max(1e-8,norm(u)) +U2:=u=[${10-12}];u/max(1e-8,norm(u)) +foreach { +to_color split_opacity l[0] { +100%,100%,1,2,"*begin(U1 = ["$U1"]; U2 = ["$U2"]); +V = I(#0); +d1 = dot(V,U1); V-=d1*U1; +d2 = dot(V,U2); V-=d2*U2; +I(#0) = V; +[ d1,d2 ]" +s. c +_fx_chromatic_aberrations.. ${4-9} +_fx_chromatic_aberrations. ${13-18} +a[-2,-1] c ++[0] '"*begin(U1 = ["$U1"]; U2 = ["$U2"]); i(#1,x,y,0,0)*U1 + i(#1,x,y,0,1)*U2"' +rm. +} +a c +} +_fx_chromatic_aberrations : +if !$1 +100%,100%,1,2,[$2,$3] +elif $1==1 +100%,100%,1,2," +ang = atan2(y - h/2, x - w/2); +U = [ $2*cos(ang), $3*sin(ang) ]" +elif $1==2 +100%,100%,1,2," +ang = atan2(x - w/2, -y + h/2); +U = [ $2*cos(ang), $3*sin(ang) ]" +else +100%,100%,1,2,g s. c n.. 0,$1 n. 0,$2 a[-2,-1] c +fi +if $4 +s. c +m,M:=im#-2,iM#-2 b.. $4 n.. $m,$M +m,M:=im,iM b. $4 n. $m,$M +a[-2,-1] c +fi +if $5 +100%,100% =. 1,50%,50% distance. 1 n. 0,1.4142 c. 0,1 +if $5>0 ^. {0.1+$6} n. {1-$5%},1 +else negate. 1 ^. $6 n. {1+$5%},1 +fi +*[-2,-1] +fi +warp.. .,1,1,1 rm. +fx_chromatic_aberrations_preview : +gui_split_preview "fx_chromatic_aberrations $*",${-3--1} +fx_gcd_crt : skip ${1=1.8},${2=1.8},${3=0},${4=0} +repeat $! l[$>] +to_rgb[0] +expand_xy 12,0 24,14,1,3,0 +f. "if((x-c*4)%12<4,255,0)" +f. "if(x%4==0,0,i)" +f. "if((y%14==0)&&(x%24<12),0,i)" +f. "if(((y-7)%14==0)&&((x+12)%24<12),0,i)" +array. {0,round(w/24)},{0,round(h/14)},2 +z. 0,0,{0,w-1},{0,h-1} +s c repeat 3 blend[-4,-1] shapeaverage0 done a c +n. 0,255 meancurvature_flow. 4 +if $3 +{w},{h},1,1,0 +rectangle. 5%,5%,95%,95%,1,1 +b. 10% *[0,1] +fi +deriche. $1,0,x deriche. $2,0,y +shrink_xy. 12 n. 0,255 +if $4 equalize. 256 fi +done done +fx_dirty : +ac "_fx_dirty ${1-2}",$3,$4 +fx_dirty_preview : +gui_split_preview "fx_dirty ${1--2}",${-3--1} +_fx_dirty : +foreach { +dct 100%,100%,1,{$2?1:s} noise. $1,2 +==. 0 point. 0,0,0,1,1 +* idct c 0,255 +} +fx_flip_blocks : +foreach { +if $5 ac "_fx_flip_blocks ${1-4}",$5 +else _fx_flip_blocks ${1-4} +fi +} +_fx_flip_blocks : +if ($3%2)" && "$1>1 s x,-$1 mirror x a x fi +if ($3>1)" && "$2>1 s y,-$2 mirror y a y fi +if $4!=1" && "$1>1" && "$2>1 +s y,-$2 N=$! +s x,-$1 M:=$!/$N +ap "rotate {($4-1)*90}" +append_tiles $M,$N +fi +fx_flip_blocks_preview : +gui_split_preview "fx_flip_blocks $*",${-3--1} +fx_huffman_glitches : +noise_level,split_mode,split_size,patch_overlap,colorspace,quantization,seed=${1-7} +foreach { +W,H,siz={w},{h},{whds} +cspace=${"arg0 "$colorspace",rgb,cmyk,hcy,hsi,hsl,hsv,jzazbz,lab,lch,oklab,ycbcr,yiq"} +if $colorspace rgb2$cspace fi +s c foreach { im$>,iM$>:=im,iM } n 0,255 a c round +if $quantization +colormap $quantization,0,0 index.. .,0,0 store. colormap fi +huffman_tree mv. 0 +bloc_size:=max(1,round($split_size*max(w,h)%)) +if $split_mode==1 s. y,{-$bloc_size} +elif $split_mode==2 s. x,{-$bloc_size} +elif $split_mode==3 img2patches. $bloc_size,$patch_overlap%,2 s. z +fi +compress_huffman[^0] [0] +eval "srand($seed); +repeat($siz*($noise_level/100)^6, +k = round(u(1,l - 1)); +off = round(u(4,whds#k - 1)); +bit = round(u(0,7)); +val = i[#k,off]; +mask = 1<<(int(u(8))%8); +i[#k,off] = xor(val,mask); +)" +store[0] _tree ap "$_tree decompress_huffman[^-1] . rm." +if $split_mode==1 a y +elif $split_mode==2 a x +elif $split_mode==3 a z patches2img. $W,$H,$patch_overlap% +fi +k. +if $quantization $colormap map.. . rm. fi +s c foreach { n ${im$>},${iM$>} } a c +if $colorspace ${cspace}2rgb c 0,255 fi +} +fx_huffman_glitches_preview : +gui_split_preview "fx_huffman_glitches $*",${-3--1} +u "{$1}{$2}{$3}_"{$2?2:1}"{$4}_"{$2==3?2:1}"{$5}{$6}{$7}{$8}{$9,$10}" +fx_jpeg_artefacts : +base642img[] "MSBmbG9hdCBsaXR0bGVfZW5kaWFuCjggOCA2NCAxICMyMjIyCnic5Vs9q51FEC60kKtWMYpaCirYKCoI767iR6UoSangtdM/EAM2Fgab2FhaWdgIUXO""qVO8sXEHBVDFia6kgCBaCQSyu+5w8c3nv5p55Bg+3uSmGs19nP2Z2Zt752P39/bJ/G8PHF5+qD1y4v77+yNWyeulegPWy9bbW+9pJ7z9XH6s/f3KxdL""BeRr2hjDb0nfR+4OZyxwlw8UbHS4f1nehtBTg66f3kAyOU261OfDTiA/ehEV91ga8T208+cDlg5JNKPiknvR8ykfKwLuRlo7y0k96PegS8MxsB80RAn""ROBRYC9R0AZtxF45o1w+cXz9fHvztTnP7y7nv7z5dLBern1NvTht37/75P17Qt/lOsPPQqwXrbeth6D/6Hv3F2fl2/++WXqMPfyegzmwZz439e9755f""HwbMvTxjHqwFQBlt6MMYjMV/8F/MgbkwJ+bGGlgLa2Jt7AF7wRjMg/+hD3vG3nmGxr0Y5/S+euPGe/XVJ/ZKB+vlBkAZbeh77ctX6re/f1E6WC83AMp""oQ9+Zd++oV6+8WTpYLzcAymhD30+fPlee/e2zqcPcywZAGW3oO6J+aPw437jeuJ9xv+N5xvMCD/d1vABPL3QcdVjjpbcV4rb+2PGK8jsdxx3QjrZCvJ""evOl2A3/c7jTqs8dvbJtKkgK7A/eU+rsMEGoDOpJehjDb0YQzG4j+kpWEuzIm5sQbWwpqkc8NesCfsDXvEXrFn3oGGs+BMOBvOiLPizPgP+fzgW3Gsu""87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4X972r6X4//3fl9gv9nvcP+t7H/FdP/evzv7i8k9""H93fp7Q/6feTf3jgH8T+r+7P5DQ/6febeuHe6wfEvq/Oz9P6P+Tf6l/zXmI0b88/d/dH0jo/031zgtTPxyzfkjo/+78PKH/T/6l/tmof1ajf3r6v7s/""kND/G/XPWT9Q/2yqfwb6vzs/T+j/lfp3o/49+dfo357+7+4PJPT/Rv37oH5QeyT0f3d+ntD/K+cfjfOPyb9m/uHp/+7+QEL/b5x/HNQPxB/2/9H8PKH""/T/7l/Ktx/lXN/MvT/939gYT+3zj/mvUD519N51+B/u/OzxP6/+Rfzj+nHm7mn57+7+4PJPR/9bdcmPqB+S+c/0fz84T+P+cdnH8f8G9C/3f3BxL6/5""x32PqB/Bf2/xF/Wr7b2f9z5/eJ/T+3fsjoD97+QmL/z+XPy3j/z53fJ/b/3Pohqz/s7S8k9v9c/ryM9//c+X1i/8+tH7L6w97+QmL/z+XPy3j/z53fJ""/b/3Pohoz94+wuJ/T+XPy/j/T93fp/Y/3Prh4z+4O0vJPb/XP68jPf/3Pl9Yv/PrR+y+sPe/kJi/8/lT+Pvvf0/d36f2P9z64es/rC3v5DY/3P509Y7""O/t/7vw+sf/n1g8Z/cHbX4j4P5qfZ/vvPf0+0v+j/YGo/ojmF4nf/7nz82z/vaffR/p/tD8Q1R/R/CLx+z93fp7tv/f0+0j/j/YHovojml8kfv/nzs+""z/feefh/p/9H+QFR/RPOLxO//3Pl5tv/e0+8j/T/aH4jqj2h+kfj9nzs/z/bfe/p9pP9H+wNR/RHNLxK//3Pn59n+e0+/j/T/aH8gqj+i+UXi93/u/D""zbf+/p95H+H+0PRPVHNL/4DgTd2gQ=" +=> dct,idct +(16,11,10,16,24,40,51,61;12,12,14,19,26,58,60,55;14,13,16,24,40,57,69,56;14,17,22,29,51,87,80,62;18,22,37,56,68,109,103,77;24,35,55,64,81,104,113,92;49,64,78,87,103,121,120,101;72,92,95,98,112,100,103,99) +f. "const S = $1<50?5000/$1:200-2*$1; max(1,round((S*i+50)/100,1,-1))" +=> Q +repeat $!-3 { l[$>,-3--1] { +l[0] { w,h={w},{h} r {w+(-w%16)},{h+(-h%16)},1,100%,0,3 rgb2ycbcr s c r[-2,-1] 50%,50%,1,1,2 round. } +repeat 3 { +[$>] +f[$>] "begin(boundary = 2; ref(vector64(),res)); +if (!(x%8) && !(y%8), +ref(crop(x,y,8,8),src); +repeat (8,l, repeat (8,k, off = k + 8*l; res[off] = sum(src*crop(#"$dct",0,0,off,8,8,1)))); +draw(#-1,res,x,y,8,8); +); i" +round. ++r[Q] {$>,w},100%,1,1,0,2 /.. . round.. *[-2,-1] +f. "begin(boundary = 2; ref(vector64(),res)); +if (!(x%8) && !(y%8), +ref(crop(x,y,8,8),src); +repeat (8,l, repeat (8,k, off = k + 8*l; res[off] = sum(src*crop(#"$idct",0,0,off,8,8,1)))); +draw(#"$>",res,x,y,8,8); +); i" +rm. +round[$>] +} +l[^3--1] { r ${-max_wh},1,1,1 a c ycbcr2rgb round. r $w,$h,1,3,0 } +} } +rm[dct,idct,Q] +fx_jpeg_artefacts_preview : +gui_split_preview "fx_jpeg_artefacts $*",${-3--1} +fx_lomo : +remove_opacity +foreach { +to_rgb +gaussian {100-$1}%,{100-$1}% n. 0,1 * +s c +f[0] "255*atan((i-128)/128)" +f[1] "255*tan((i-128)/128)" +f[2] "255*atan((i-128)/255)" +a c +sharpen 1 +normalize 0,255 +} +fx_lomo_preview : +gui_split_preview "fx_lomo $*",${-3--1} +fx_mess_with_bits : +ac "_fx_mess_with_bits ${1-7}",$8 +_fx_mess_with_bits : +foreach { ++l { +b {($2/100)^2*100}% if $1 n 0,255 fi * $3 round +if $4==1 f "for (k = res = 0, k<15, ++k, res|=((i>>k)&1)<<(15-k))" +elif $4==2 f "res = ((i>>8)&255) | ((i&255)<<8)" +fi +f "begin( mask = (65535>>(15-max($5,$6))) & (65535<>8,$1&255] +foreach { +if $2 .,.,1,. noise_perlin. {r=2^$4;s=max(w,h)*$3%;[max(1,s/r),max(1,s*r)]},1,$seedx,$seedy *. $2 + fi +if $5 .,.,1,. noise_perlin. {r=2^$7;s=max(w,h)*$6%;[max(1,s/r),max(1,s*r)]},1,$seedx,$seedy *. $5 + fi +if $8 .,.,1,. noise_perlin. {r=2^$10;s=max(w,h)*$9%;[max(1,s/r),max(1,s*r)]},1,$seedx,$seedy *. $8 + fi +if $11 .,.,1,. noise_perlin. {r=2^$13;s=max(w,h)*$12%;[max(1,s/r),max(1,s*r)]},1,$seedx,$seedy *. $11 + fi +} +fx_noise_perlin : +ac "_fx_noise_perlin $*",$-4,1 +fx_noise_perlin_preview : +gui_split_preview "fx_noise_perlin $*",${-3--1} +fx_spread : +ac "spread $1,$2",$3,$4 +fx_spread_preview : +gui_split_preview "fx_spread $*",${-3--1} +fx_stripes_y : +ac "stripes_y $1",$2,$3 +fx_stripes_y_preview : +gui_split_preview "fx_stripes_y $*",${-3--1} +fx_8bits : +remove_opacity +foreach { +w,h={w},{h} +r $1%,$1%,1,100%,2 ++luminance sharpen. $2 otsu. 256 blend[-2,-1] shapeaverage0 +l. { s c quantize $3,1,1 a c } +r. $w,$h,1,100%,1 +} +fx_8bits_preview : +gui_split_preview "fx_8bits $*",${-3--1} +fx_pixelsort : +_fx_pixelsort ${1-8},0 +_fx_pixelsort : +foreach[0-{$4?-1:-2}] { +if !$3 +to_rgb channels. 0 +elif $3==1 +to_rgb channels. 1 +elif $3==2 +to_rgb channels. 2 +elif $3==3 +compose_channels + +elif $3==4 +luminance +elif $3==5 +to_rgb rgb2hsl. channels. 2 +elif $3==6 +to_rgb rgb2hsl. channels. 0 +elif $3==7 +to_rgb rgb2hsl. channels. 1 +elif $3==8 +compose_channels min +elif $3==9 +compose_channels max +else 100%,100%,1,1 rand. 0,100 +fi +if !$4 pass. 0 norm. +elif $4==1 . +elif $4==2 +gradient_norm[0] +else +rand. 0,100 +fi +b. $7% ir. $5%,{$6+0.01}% +if $8 ==. 0 fi +if $9 k. * 255 +else pixelsort[0] {`$1?_'+':_'-'`},{`!$2?'x':$2==1?'y':$2==2?'xy':'yx'`},[1],[2] k[0] +fi +} +fx_pixelsort_preview : +_fx_pixelsort $* +fx_rain : +foreach { +nm=${-gui_layer_name} +100%,100% l. { +noise 300 c 0,255 b 1,0 +c {100-$3}%,100% ++>= 40% blend shapeaverage0 +blur_linear $2,$4,$1 +max n 0,255 apply_gamma $5 +=> "name("$nm"),mode(screen),opacity("{$6*100}")" +} +rv +} +fx_rain_preview : +gui_split_preview "foreach { fx_rain $* rv blend screen,$6 }",${-3--1} +fx_shade_stripes : +ac "shade_stripes $1,$2,$3,$4",$5,$6 +fx_shade_stripes_preview : +gui_split_preview "fx_shade_stripes $*",${-3--1} +fx_rebuild_from_similar_blocks : +foreach { +split_opacity l[0] { +to_rgb w0,h0,S:=w,h,round(min(w,h)*$1%) +r {ceil([w,h]/$S)*$S},1,100%,0,3,0.5,0.5 +M,N:=[w,h]/$S +s yx,-$S a z ++l { b xy,$2% rgb2ycbcr sh. 0 *. $3 rm. } +$M,$N,1,1,-1 +f. ": +i<0?( +ind = x + y*w; +ref(crop(#1,0,0,ind,w#1,h#1,1),S); +kmin = 0; +dmin = inf; +repeat (wh,k, k!=ind?( +d = norm"{1+$4}"(S - crop(#1,0,0,k,w#1,h#1,1)); +d,std$>:=ia#$>,id#$> } a c fi +M=$nsize +S:=max(1,int($M*$stride%)) +Q:=$upscale_factor*$M +if $type==0 +4,12,1,3,[255,60,0] +fc. 0,200,0 +fc. 0,60,255 +r[-3--1] 5,15,1,3,0,0 shift.. 0,5,0,0,2 shift. 0,10,0,0,2 +a[-3--1] x +elif $type==1 +15,15,1,3 circle. 5,5,4,-1,255,0,0 circle. 10,5,4,-1,0,255,0 circle. 7,10,4,-1,0,0,255 +else +(218,65,87;229,255,125;141,247,211;68,36,213) permute. yzcx +r. 200%,4,1,3,0,2 +f. "i*lerp(0.35,1,y/(h-1))" +mirror. y a[-2,-1] y +fi +if $is_transpose transpose. fi +if $smoothness b. $smoothness%,2 fi +if $is_adaptive l. { +w:=w +if $w>8 +r 300%,300% ++l { repeat 5 { 3,3,1,1,1 +dilate.. .,0 rm.. } r $w,$w,1,3,2 b 1,2 n 0,255 a z } +l.. { repeat 5 { 3,3,1,1,1 +erode.. .,0 rm.. } rv rm. r $w,$w,1,3,2 b 1,2 n 0,255 a z } +a z +else +r 100%,100%,15,3 +fi +rgb2hsl f "[ i0, cut(i1*lerp(1,0.5,z/(d-1)),0,1), i2 ]" hsl2rgb +} fi +/. 255 +W,H={0,ceil([w,h]*$Q/$M)} +$W,$H,1,3 +$W,$H,1,1 +{0,ceil([w,h]/$S)},1,3,"* +begin( +const M = $M; +const M2 = int(M/2); +const P = w#1; +const Q = $Q; +iP = vector(#P^2); +iS = expr('x = x - w/2; y = y - h/2; gauss(norm(x,y),0.3*$Q,0)',Q,Q); +); +xM = x*$S; +yM = y*$S; +iM = crop(#0,xM,yM,0,c,M,M,1,1); +icM = iM[M2*(M + 1)]; +riMy = resize(iM,M,M,1,1,M,P,1,1,1); +riM = resize(riMy,M,P,1,1,P,P,1,1,3); +ind = int(icM*d#1/256); +p = int((xM%M)*P/M); +q = int((yM%M)*P/M); +$is_precise?( +off = 0; +repeat (P,n, +repeat (P,m, +ind = int(riM[off]*d#1/256); +iP[off++] = i(#1,p + m, q + n,ind,c,1,2); +); +) +):( +iP = crop(#1,p,q,ind,c,P,P,1,1,2); +); +$is_average?(iP*=avg(riM)):(iP*=riM); +iQ = resize(iP,P,P,1,1,Q,Q,1,1,2); +xQ = int(xM*Q/M); +yQ = int(yM*Q/M); +draw(#-2,iQ,xQ,yQ,0,c,Q,Q,1,1,-1,iS); +!c?draw(#-1,iS,xQ,yQ,0,0,Q,Q,1,1,-1)" +rm. +max. 1e-6 /[-2,-1] +k. +if $is_normalize s c repeat $! { f[$>] ${avg$>}" + (i - ia)/id*"${std$>} } a c fi +c 0,255 +} if $!>1 r. ..,..,1,1 a c fi => $nm } +fx_crt_preview : +if $-1 r. {101-$-1}%,{101-$-1}%,1,100%,0,0,0.5,0.5 fi +gui_split_preview "fx_crt ${1-10}",${-4--2} +pr_sloppymess : skip "${1=0},${2=1},${3=0},${4=0},${5=-1},${6=0},${7=35},${8=-35},${9=2},${10=0},${11=0},${12=3},${13=1},${14=3},${15=100}" +ang,wid,ax,__mir,inter,inv,rang_f,rang_b,bound,cx,cy,def,it,bl,str=$* +arg0 $bl,"add","alpha","and","average","blue","burn","darken","difference","divide","dodge","edges","exclusion","freeze","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lchlightness","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","seamless","seamless_mixed","shapeareamax","shapeareamax0","shapeareamin","shapeareamin0","shapeaverage","shapeaverage0","shapemedian","shapemedian0","shapemin","shapemin0","shapemax","shapemax0","shapeprevalent","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor" +blending_mode=${} +foreach { +n 0,255 +wi,he:=w,h +if $ang>0&&$ang!=360 rotate $ang,0,3 fi +if $ax==0 spins,dir,sli={w/$wid},x,y else spins,dir,sli={h/$wid},y,x fi +if $__mir==0 __mir=x else __mir=y fi +repeat $it ++s. $dir,$spins +if $rang_f||$rang_b +repeat $spins { rotate[{$>+1}] {u($rang_f,$rang_b)},0,$bound,$cx%,$cy% } +fi +l[^0] { +sel=0--1 +if $inv==1 sel..=^ fi +if $inter>1 +ap[$sel:$inter] "mirror $__mir" +elif $inter==-1 +repeat 2 { +step:=floor(u(1,20)) +ap[$sel:$step] "mirror $__mir" +} +fi +} +a[^0] $dir ++gradient_norm. +negate. +pr_deform[^0] $def +blend[^0] edges,0.6 +blend $blending_mode,$str% +done +if $ang>0&&$ang!=360 +rotate. -$ang,0,3 +vx,vy:=floor((w-$wi)/2),floor((h-$he)/2) +vxb,vyb:=$vx+$wi-1,$vy+$he-1 +crop. $vx,$vy,$vxb,$vyb +fi +equalize +n 0,255 +} +pr_sloppymess_preview : +pr_sloppymess $* +fx_streak : +foreach { +to_rgba +if !$4 R,G,B,A=0 else R,G,B,A=${1-4} fi +select_color 0,$R,$G,$B,$A +if $7==3 srgb2rgb.. fi +f.. " +const step = max(1,$5%*min(w,h)); +const angle = $6*pi/180; +const dx = step*cos(angle); +const dy = step*sin(angle); +if (!i(#-1),I, +ixf = xf = x; iyf = yf = y; lf = 0; +if ($7>=1, while (i(#-1,ixf=round(xf),iyf=round(yf)), ++lf; xf-=dx; yf-=dy)); # Forward +ixb = xb = x; iyb = yb = y; lb = 0; +if ($7!=1, while (i(#-1,ixb=round(xb),iyb=round(yb)), ++lb; xb+=dx; yb+=dy)); # Backward +!$7?I(ixb,iyb): +$7==1?I(ixf,iyf): +$7==2?(lf] +nm=${-gui_layer_name} +sharp_radius=$1 +amount=$2 +threshold=$3 +constrant_radius=$4 +overshoot=$5 +channels=$6 +value_action=$7 +apply_channels " +sharp_radius=$1 +amount=$2 +threshold=$3 +constrant_radius=$4 +overshoot=$5 ++dilate_oct[0] $constrant_radius ++erode_oct[0] $constrant_radius +unsharp[0] $sharp_radius,$amount,$threshold +add[1] $overshoot +sub[2] $overshoot +blend[0,1] darken,1,0 +blend[0,1] lighten,1,0 +blend alpha,1,0",$channels,$value_action +nm name($nm) +done done +jeje_dehaze : +apply_channels "dehaze {2*$1+1},$2,$3,$4,$5,$6,$7 if $8 k[1] n 0,255 to_rgb else k[0] fi",rgb,1 +jeje_dehaze_preview : +gui_split_preview "jeje_dehaze $1,$2,$3,$4,$5,$6,$7,$8",$9 +_fx_equalize_details : +foreach { +split_details 5,{max(0.1,$1)},{max(0.1,$2)} +__fx_equalize_details[1] ${3-6},8 +__fx_equalize_details[2] ${7-10},4 +__fx_equalize_details[3] ${11-14},2 +__fx_equalize_details[4] ${15-18},1 ++ c 0,255 +} +__fx_equalize_details : +threshold $1,1 +if !$3 b {$2*$5/2} +elif $3==1 +if $2>0 +m,M:=im,iM n. 0,255 +repeat int($2/5) { bilateral 15,{5*$5} } +bilateral 15,{($2%5)*$5} +*. {($M-$m)/255} +. $m +fi +else smooth {$2*50},0.2,0.8,$5,$5 fi +* {10^$4} +fx_equalize_details : +ac "gui_parallel_overlap \"_fx_equalize_details ${1-18}\",$21,$22",$19,$20 +fx_equalize_details_preview : +gui_split_preview "fx_equalize_details $*",${-3--1} +fx_tk_dri : +repeat $! l[$>] +if $6==1 ++negate +to_rgba[0] +luminance[0] +to_rgba[0] +luminance[0] +fx_gaussian_blur[1] {{{w+h}/20}*{1.1-$1}},0,0,1,0,0,0 to_gray[1] +rv[0,1] fx_compose_softlight[0,1] $1 +fx_gaussian_blur[2] {{w+h}/200},0,0,1,1,0,0 negate[2] to_gray[2] +s[1] c rv[4,5] compose_multiply[4,5] a[1,2,3,4] c rv[0,1] +fx_compose_dodge[0,1] $2 +fx_gaussian_blur[2] {{w+h}/200},0,0,1,1,0,0 to_gray[2] s[1] c +rv[4,5] compose_multiply[4,5] a[1,2,3,4] c rv[0,1] +fx_compose_colorburn[0,1] $3 fi +if $7==1 +map_tones[0] 0.50,0.70,$4,50 ++normalize_local[0] $4,6.00,5.00,1.00 +rv[0,1] fx_compose_value[0,1] $5,0 +rv[0,1] fx_compose_value[0,1] $5,0 fi +done done +fx_tk_dri_preview : +gui_split_preview "fx_tk_dri ${1--2}",$-1 +fx_equalize_local_histograms : +b0="normal" b1="overlay" b2="softlight" +foreach { ++ac "_fx_equalize_local_histograms ${1-6}",$7,1 +blend ${b$2},{$1%} +} +_fx_equalize_local_histograms : ++n 0,511 round. +f. " +begin( +const boundary = 1; +const N = $3; +const sigma = ($6?1:-1)*(0.1+$4); +ref(vector512(),weights); +repeat (size(weights),k, +weights[k] = sigma>=0?exp(-sqr(k/sigma)):1 - exp(-sqr(k/sigma)) +); +); +ref(vector512(0),bins); +repeat (s,c, +ref(crop(x - N,y - N,0,c,2*N + 1,2*N + 1,1,1),V); +repeat (size(V),k, +val = V[k]; +diff = abs(val - V[size(V)/2]); +bins[val]+=weights[diff]; +); +); +sum = 0; +repeat (size(bins),k, +sum+=bins[k]; +bins[k] = sum; +); +bins/=max(1e-5,sum); +P = I; +size(P)==1?(P = bins[P[0]]; 0): +size(P)==2?(P = [ bins[P[0]], bins[P[1]] ]; 0): +size(P)==3?(P = [ bins[P[0]], bins[P[1]], bins[P[2]] ]; 0): +size(P)==4?(P = [ bins[P[0]], bins[P[1]], bins[P[2]], bins[P[3]] ]; 0); +P" +n. 0,255 +if $5 norm.. bilateral. ..,$5,{2+$5} fi +k. +fx_equalize_local_histograms_preview : +gui_split_preview "fx_equalize_local_histograms $*",${-3--1} +fx_freaky_details : +foreach { +split_opacity l[0] { +repeat $3 { +. +-. 255 *. -1 +repeat $1 { bilateral. $2,{1.5*$2} } +blend[-2,-1] vividlight blend overlay +} +} +a c +} +n 0,255 +fx_freaky_details_preview : +gui_split_preview "fx_freaky_details $*",${-3--1} +fx_highpass : +repeat $! l[$>] +to_rgb +negate +if $4==1 to_gray fi +fx_gaussian_blur[1] $1,0,0,1,0,0,0 +compose_interpolation +tk_fx_channel_processing 1,$2,0,0,0,0,100,256,0,0,0,2,0,0 +if $2>=4 tk_fx_channel_processing 1,{$2-3},0,0,0,0,100,256,0,0,0,2,0,0 fi +tk_fx_channel_processing 1,1,0,0,1,50,100,256,0,0,0,2,0,0 +if $3==1 negate fi done done +fx_highpass_preview : +gui_split_preview "fx_highpass ${1--2}",$-1 +_fx_LCE : +SpatialRadius=$1 +Amount=$2 +DarknessLevel=$3 +LightnessLevel=$4 +Threshold=0 ++b. $SpatialRadius +-. .. *. -$Amount ++norm. ge. $Threshold% ri. .. *[-2,-1] ++c. 0,100% c.. -100%,0 *.. $DarknessLevel *. $LightnessLevel +[-2,-1] ++[-2,-1] c. 0,255 +fx_LCE : +ac "_fx_LCE $1,$2,$3,$4",$5,0 +fx_LCE_preview : +gui_split_preview "fx_LCE ${1--2}",$-1 +fx_normalize_local : +ac "normalize_local $1,$2,$3,$4,$5,0,255",$6 +fx_normalize_local_preview : +gui_split_preview "fx_normalize_local $*",${-3--1} +fx_local_processing : +com0="n 0,255" +com1="equalize 256,0,255 n 0,255" +com=${com$1} +if $6 com="s c "$com" a c" fi +foreach { +size:=round(max(8,max(w,h)*$3%)) ++ac "at \""$com"\","$size","$size",1,$4%,$4%",$7 +if $5 +norm[0] bilateral[1] .,{$5/20}%,{2+$5/4} rm. fi +blend alpha,{$2%} +} +fx_local_processing_preview : +gui_split_preview "fx_local_processing $*",${-3--1} +jeje_normalize_local_variance : +apply_channels "normalize_local_variance $1,$2,$3,$4",$5,0 +c 0,255 +jeje_normalize_local_variance_preview : +gui_split_preview "jeje_normalize_local_variance $1,$2,$3,$4,$5",$-1 +fx_magic_details : +ac "_fx_magic_details ${1-5}",$6,1 +_fx_magic_details : +foreach { ++bilateral $2,$3 ++gradient_norm.. +. 1 +^. {$4>=0?3.1-$4:-3.1-$4} +b. $5 n. 1,{1+$1} +-... .. *[-3,-1] + c 0,255 +} +fx_magic_details_preview : +gui_split_preview "fx_magic_details $*",${-3--1} +makeup_full: +to_rgb +sub[-1] 128 *[-1] .5 +[-1] 128 +split c +name[0] red +name[1] green +name[2] blue +sub[green] [red] +bilateral[green] $1,$2 +add[green] [red] +sub[blue] [red] +bilateral[blue] $1,$2 +add[blue] [red] +append[0,1,2] c +-[-1] 128 *[-1] 2 +[-1] 128 +c 0,255 +make_up: +to_rgb +cropwidth={w} +cropheight={h} +resize[0] {w+(2-w%2)},{h+(2-h%2)},1,{s},0,1 +width={w} +height={h} +if $3==1 ++resize 50%,50%,1,3,5 ++makeup_full[1] {$1/2},$2 ++resize[1] 200%,200%,1,3,5 ++compose_grainextract[0,3] +resize[2] {w},{h},1,3,5 ++compose_grainmerge[2,4] +keep[0,-1] +else +if $4==1 ++makeup_full[0] $1,$2 +else +makeup_full[0] $1,$2 +fi +fi +if $4==1 ++rgb2hsl8[1] +split[-1] c remove[-1,-2] ++[-1] 128 +mod[-1] 255 +apply_curve[-1] 0,0,0,130,0,136,255,155,255,160,0,255,0 +median[-1] 3 ++edges[1] 10% n[-1] 0,1 +mul[-1,-2] +a[1,2] c +blend[0,1] alpha +else +keep[-1] +fi +crop 0,0,{$cropwidth-1},{$cropheight-1} +make_up_preview: +gui_split_preview "make_up ${1--2}",$-1 +fx_tk_mask : +repeat $! l[$>] +if $8==1 +to_rgba. rv[-1,-2] fi to_rgb. +if $2==1 channels. 0 +elif $2==2 channels. 1 +elif $2==3 channels. 2 +elif $2==4 rgb2cmy channels. 2 +elif $2==4 rgb2cmy channels. 1 +elif $2==4 rgb2cmy channels. 0 +elif $2==5 rgb2lab channels. 1 +elif $2==6 rgb2lab channels. 2 +fi to_rgb. +if $1==0 luminance. +luminance. +elif $1==1 rgb2hsv. channels. 1 +n. 0,255 . +elif $1==2 rgb2hsv. channels. 0 +n. 0,255 . +elif $1==3 rgb2lab. channels. 0 +n. 0,255 . +fi +c. $3,255 n. 0,255 +f.. "if(i<$4,if(c==0,i,i),0)" +fx_gaussian_blur[-1,-2] $5,0,0,1,0,0,0 +compose_darken +if $8==1 rv[-1,-2] fi +tk_fx_channel_processing. 1,$6,0,0,0,0,100,256,0,0,0,2,0,0 +if $7==1 negate. fi +if $8==1 s.. c rv[-1,-2] +fx_compose_multiply[-1,-2] $9 +a[-4,-3,-2,-1] c +fi done done +fx_tk_mask_preview : +gui_split_preview "fx_tk_mask ${1--2}",$-1 +_fx_mighty_details : ++smooth $3,0,1,0.5,0.5 -[1] [0] ++abs. sign.. M:=iM ^. {2-$2} *. {$M/iM} *[-2,-1] ++diffusiontensors[0] 0,1,0.5,0.5 +repeat $4 { smooth[1] [2],20 } +*[1] {-$1/5} + +fx_mighty_details : +ac "_fx_mighty_details ${1-4}",$5,1 +n 0,255 +fx_mighty_details_preview : +gui_split_preview "fx_mighty_details $*",${-3--1} +fx_tk_portrait : +repeat $! l[$>] to_rgb +if narg($_previewflag)==0 _previewflag=0 fi +if $1==3" || "$1==4 +luminance[0] elif $1==2 +channels[0] 2 fx_unsharp. 0,$21,30,$22,0.00,1.00,0.5,1,0,0,0 fi ++fx_edges[0] $24,$23,0,0 if $23==0 fc. 0 fi +fx_unsharp[0] 0,$21,30,$22,0.00,1.00,0.5,1,0,7,0 +if $_previewflag==4" && "$29==5 +tk_fx_select_color[0] ${12-18},0,0 else +tk_fx_select_color[0] ${12-18},1,0 fi ++fx_split_freq[0] $6 if $19==1 fc. 128,128,128 noise. {$6*2},0 luminance. fi ++fx_split_freq[0] $7 +rm[-2,-4] ++fx_tk_dri[0] {$8/100},{$8/200},{$8/200},0,0,1,0,0 +if $9==0 b. $5 rv[-1,-2] b. $4 b... $3 +elif $9==1 bilateral. $7,$5 rv[-1,-2] bilateral. $6,$4 bilateral... {$3/5},$3 +elif $9==2 smooth. $5 rv[-1,-2] smooth. $4 smooth... $3 +elif $9==3 median. $5 rv[-1,-2] median. $4 median... $3 +fi +if ($_previewflag!=0" && "$_previewflag<=3)" || "($10<=1" && "$_previewflag==0) +fx_compose_freq[-1,-2] rv[-1,-2] fx_compose_freq[-1,-2] +if $11==1 to_rgba. b.. $14 s. c negate. +. [-5] a[-1,-2,-3,-4] c fi rm.. mv. 1 +to_rgba. s. c negate[-1,-5] +. [-5] a[-1,-2,-3,-4] c rm.. if $23==50 fc. 0,0,0,0 fi +if $_previewflag==1" || "$_previewflag==2" || "($10==0" && "$_previewflag==0) +if $1!=0" && "$1!=1 mv.. 0 fi +if $20==1 fx_mix_lab.. $27,$26,0,$28,{if({$25>=0},{$25/4},{$25*0.75})},0,$28,$25,0,0,2,0 +elif $20==2 fx_mix_lab. $27,$26,0,$28,{if({$25>=0},{$25/4},{$25*0.75})},0,$28,$25,0,0,2,0 +elif $20==3 fx_mix_lab[-1,-2] $27,$26,0,$28,{if({$25>=0},{$25/4},{$25*0.75})},0,$28,$25,0,0,2,0 +fi +fx_compose_alpha[-2,-3] {if({$1==0},{$2/100},1)},0 fx_compose_alpha[-1,-2] {if({$1==0},{$2/100},1)},0 +if $23==50 fx_unsharp[0] 0,$21,30,$22,0.00,1.00,0.5,1,0,0,0 fi +if $_previewflag<=1 +if $1==1 fx_glow[0] {$2/10},0,0 +elif $1==2 fx_compose_hardlight[0,1] {$2/100} +elif $1==3 fx_compose_screen[0,1] {$2/100} +elif $1==4 fx_compose_multiply[0,1] {$2/100} +fi +if $20==0 fx_mix_lab[0] $27,$26,0,$28,{if({$25>=0},{$25/4},{$25*0.75})},0,$28,$25,0,0,2,0 fi +fi fi fi done done +fx_tk_portrait_preview : +_previewflag=1 +if $29==1 _previewflag=2 elif $29==2" || "$29==3 _previewflag=3 elif $29>=4 _previewflag=4 fi +if $29>=2 gui_split_preview "fx_tk_portrait ${1--2}",0 +else gui_split_preview "fx_tk_portrait ${1--2}",$-1 fi +if $29==1 k[0] elif $29==2 k[2] elif $29==3 k[0] elif $29==4 k... elif $29==5 k... +elif $29==6 k[-5] negate elif $29==7 k.. elif $29==8 k[0] elif $29==9 k. fi +_previewflag=0 +iain_pyramid_processing: +repeat $! l[$>] +remove_opacity +if $5==0 +colorspace="lab_l" +elif $5==1 +colorspace="ycbcr_y" +elif $5==2 +colorspace="rgb" +fi +ac[0] " ++l +dilate=1 +blur=1 +mix=$3 +noise=$2 +levels=$1 +size={3^$levels} +cropwidth={w} +cropheight={h} +resize {w+($size-w%$size)},{h+($size-h%$size)},{d},{s},0,1 +repeat $levels +l[-1] ++resize[0] 33.33333%,33.33333%,{d},{s},2 ++iain_resize_x3[-1] +blur[-1] 1 +sub[0,-1] +done +done +repeat $!-1 +l[{$>}] ++abs +max={iM} +dilate[-1] $dilate +blur[-1] $blur +max[-1] 0.00000000000000001 ++fill[-1] $max +div[-1] [-2] +cut[-1] -1000000000,$noise +mul[0,-1] +k[0] +done +done +to_rgb +repeat $!-1 +iain_resize_x3[-1] +blur[-1] 1 +add[-1,-2] +done +crop 0,0,{$cropwidth-1},{$cropheight-1} +replace_nan 0 +replace_inf 255 +n 0,255 +done +if $4 +sub[-1] {-1,ia} +mul[-1] $mix +add +c 0,255 +else +mul[0] {1-$mix} +mul[1] $mix +add +fi +c 0,255",$colorspace +done done +fx_sharpen_alpha : +ac "sharpen_alpha {$1%},$2,{$3%},{$4%}",$5,1 +fx_sharpen_alpha_preview : +gui_split_preview "fx_sharpen_alpha $*",${-3--1} +fx_deblur : +ac "gui_parallel_overlap \"deblur ${1-5} c 0,255\",$7,$8",$6,1 +fx_deblur_preview : +gui_split_preview "fx_deblur $*",${-3--1} +fx_unsharp_goldmeinel: +ac "gui_parallel_overlap \"_fx_unsharp_goldmeinel $*\",$7,$8",$6,1 +_fx_unsharp_goldmeinel : +deblur_goldmeinel $* +if $5 c 0,255 else n 0,255 fi +fx_unsharp_goldmeinel_preview: +gui_split_preview "fx_unsharp_goldmeinel $*",${-3--1} +jeje_hessian_sharpen : +repeat $! l[$>] +split_opacity l[0] repeat $3 hessian_sharpen $1,$2 done done a c +if $4 c 0,255 n 0,255 else n 0,255 fi +done done +jeje_hessian_sharpen_preview : +gui_split_preview "jeje_hessian_sharpen $1,$2,$3,$4",$-1 +fx_sharpen_inversediff : +ac "repeat $2 { sharpen $1 c 0,255 }",$3,1 +fx_sharpen_inversediff_preview : +gui_split_preview "fx_sharpen_inversediff $*",${-3--1} +fx_sharpen_multiscale : +ac "_fx_sharpen_multiscale $1,$2",$3 +fx_sharpen_multiscale_preview : +gui_split_preview "fx_sharpen_multiscale $*",${-3--1} +_fx_sharpen_multiscale : +foreach { +N:=max(1,int(log2(min(w,h))-2)) ++l { repeat $N { +r. 50%,50%,1,100%,2 +r. ..,..,1,100%,5 -[-3,-1] } } +guided[0] 4,100 +repeat $!-1 { l[0,{$>+1}] { ++ri[0] [1],2 ++equalize.. 1024 +bilateral. ..,{2*$2%},100 +j[1] .,0,0,0,0,{$1%} +k[0,1] +} } +rm[0] +repeat $!-1 { r. ..,..,1,100%,5 +[-2,-1] } +c 0,255 +} +fx_unsharp_octave : +ac "gui_parallel_overlap \"unsharp_octave $1,$2,$3,$4\",$6,$7",$5,1 +fx_unsharp_octave_preview : +gui_split_preview "fx_unsharp_octave $*",${-3--1} +fx_unsharp_richardsonlucy : +deblur_richardsonlucy $* +if $4 c 0,255 else n 0,255 fi +fx_unsharp_richardsonlucy_preview : +gui_split_preview "fx_unsharp_richardsonlucy $*",${-3--1} +fx_sharpen_shock : +ac "repeat $5 { sharpen $1,$2,$3,$4 c 0,255 }",$6,1 +fx_sharpen_shock_preview : +gui_split_preview "fx_sharpen_shock $*",${-3--1} +fx_sharpen_texture : +ac "_fx_sharpen_texture ${1-2}",$3,1 +_fx_sharpen_texture : +foreach { ++rolling_guidance $2,5,0.5 -. [0] *. $1 - c 0,255 +} +fx_sharpen_texture_preview : +gui_split_preview "fx_sharpen_texture $*",${-3--1} +_fx_unsharp : +repeat $! { repeat $8 { +if !$1 +b. $2 else +bilateral. $2,$3 fi +-. .. *. -$4 ++norm. >=. $5% ri. .. *[-2,-1] +if $9 *. -1 fi ++c. 0,100% c.. -100%,0 *.. $6 *. $7 +[-2,-1] ++[-2,-1] c. 0,255 +} mv. 0 } +fx_unsharp : +ac "_fx_unsharp $1,$2,$3,$4,$5,$6,$7,$8,$9",$10,1 +fx_unsharp_preview : +gui_split_preview "fx_unsharp $*",${-3--1} +jeje_whiten_frequency : +repeat $! l[$>] split_opacity l[0] +whiten_frequency {exp($1/100)-1} +if $2 c 0,255 n 0,255 else n 0,255 fi +done a c done done +jeje_whiten_frequency_preview : +gui_split_preview "jeje_whiten_frequency $1,$2",$-1 +fx_split_details_alpha : +remove_opacity +foreach { +nb_scales_max:=int(log2(min(w,h))) +nb_scales:=$1?$1:$nb_scales_max +repeat $nb_scales-1 { +sigma:=$2?lerp($4,$3,$>/($>+$<)):0.25+2^$> ++_fx_split_details_alpha_blur. $sigma +sub_alpha.. . +} +} +_fx_split_details_alpha_blur : +if $1>=0.1 b. $1 +else +if $1>=0.05 (1,4,7,4,1;4,16,26,16,4;7,26,41,26,7;4,16,26,16,4;1,4,7,4,1) +else (1,2,1;2,4,2;1,2,1) fi +normalize_sum. convolve.. . rm. +fi +fx_split_details_alpha_preview : +foreach { +fx_split_details_alpha ${1-4} +if $5 remove_opacity[^-1] else to_rgba. fi +N:=int(sqrt($!)) N:=round($!/$N,1,1) r2dy {100/$N}% +foreach { 0 text. "#"{1+$>}" ",1,1,24,1,255 +dilate. 5 to_rgba[1] j[0] [1],2,0,0,0,1,[2],255 k[0] } +to_rgba frame 1,1,0 frame 3,3,255 append_tiles , +} +u "{$1}{$2}{$3}_"{$2?2:1}"{$4}_"{$2?2:1}"{$5}" +fx_split_details_gaussian : +remove_opacity +foreach { +nm=${-gui_layer_name} +pos=${-gui_layer_pos} +split_details $1,$2,$3 ++[^0] 128 c[^0] 0,255 round +repeat $!-1 { =>[{1+$>}] "mode(grainmerge), name"($nm" [scale ""#"{1+$>}"]), pos("$pos")" } +=>[0] "name"($nm" [residual]), pos("$pos")" +rv +} +fx_split_details_gaussian_preview : +foreach { +fx_split_details_gaussian $* +if $4 equalize[^-1] 256 fi n[^-1] 0,255 +N:=int(sqrt($!)) N:=round($!/$N,1,1) r2dy {100/$N}% +foreach { 0 text. "#"{1+$>}" ",1,1,24,1,255 +dilate. 5 to_rgba[1] j[0] [1],2,0,0,0,1,[2],255 k[0] } +to_rgba frame 1,1,0 frame 3,3,255 append_tiles , +} +fx_split_details_wavelets : +remove_opacity +foreach { +nm=${-gui_layer_name} +pos=${-gui_layer_pos} +split_details $1,0,0 rv +[^-1] 128 c[^-1] 0,255 round +if $2 to_a[^-1] fi +repeat $!-1 { =>[$>] "mode(grainmerge), name"($nm" [scale ""#"{1+$>}"]), pos("$pos")" } +=> "name"($nm" [residual]), pos("$pos")" +} +fx_split_details_wavelets_preview : +foreach { +fx_split_details_wavelets $1,0 +if $3 equalize[^-1] 256 fi n[^-1] 0,255 +N:=int(sqrt($!)) N:=round($!/$N,1,1) r2dy {100/$N}% +foreach { 0 text. "#"{1+$>}" ",1,1,24,1,255 +dilate. 5 to_rgba[1] j[0] [1],2,0,0,0,1,[2],255 k[0] } +to_rgba frame 1,1,0 frame 3,3,255 append_tiles , +} +jeje_spotify : +apply_channels "spotify $1,$2 apply_gamma $3 if $4 c 0,255 else n 0,255 fi",$5 +jeje_spotify_preview : +gui_split_preview "jeje_spotify $1,$2,$3,$4,$5",$6 +#@cli afre_texture : -100<=coarse<=100,-100<=_medium<=100,-100<=_fine<=100 +#@cli : Enhance texture with detail scales. +#@cli : Default values: 'coarse=0', 'medium=0' and 'fine=0'. +afre_texture : check "${1=0}>=-100 && ${2=0}>=-100 && ${3=0}>=-100 +&& $1<=100 && $2<=100 && $3<=100" +if !$1&&!$2&&!$3 return fi e[] "[afre]^_^) texture: Enhance texture of image$? using coarse=$1, medium=$2 and fine=$3 detail scales." +repeat $! l[$>] r={[im,iM]} +afre_orien 1 +afre_y50.. 1 to_rgb. +afre_details. 4 w1={20^($1/130)} w2={20^($2/100)} w3={20^($3/140)} +if $1>0 *[3] $w1 elif $1<0 f[3] 0 median[2] {abs($1)/100*5} fi +if $2>0 *[4] $w2 elif $2<0 f[4] 0 median[2] {abs($2)/100*9} fi +if $3>0 *[5] $w3 elif $3<0 f[5] 0 median[2] {abs($3)/100*13} fi ++[2--1] c. $r *[^0] c. $r ++n.. 0,1 f. "begin(const M=0.5; const G=0.05); +ref(if(i<=M,M-M*(i/M)^G,-M+M*((1-i)/M)^G),A)" n. 0,1 +blend_fade[0,1] . k[0] +n $r done done +afre_texture_preview : +afre_texture $* +iain_texture_enhance_p: +apply_parallel_overlap "iain_texture_enhance ${1--2}",{$1*2},$-2 +iain_texture_enhance_p_preview : +gui_split_preview "iain_texture_enhance_p ${1--2}",$-1 +iain_texture_enhance: +tic +ac " +if $1%2!=0 ++erode_circ[0] $1 dilate_circ[-1] $1 ++dilate_circ[0] $1 erode_circ[-1] $1 +else ++erode_oct[0] $1 dilate_oct[-1] $1 ++dilate_oct[0] $1 erode_oct[-1] $1 +fi +sub[1] [0] +sub[2] [0] +add[1] [2] +remove[2] +mul[1] $2 ++abs[1] +pt1={min(0,($4-10))} +apply_curve[-1] 0,0,0,$pt1,0,{$4+1},1,255,1 +(0.0579710145,0.1304347826,0.0579710145;0.1304347826,0.2463768116,0.1304347826;0.0579710145,0.1304347826,0.0579710145) +convolve[-2] [-1] +remove[-1] +mul[1] [2] +c[1] {$3*-1},$3 +sub[0] [1] +keep[0]",$5 +c 0,255 +toc +iain_texture_enhance_preview : +gui_split_preview "iain_texture_enhance ${1--2}",$-1 +gcd_tone_enhance : +skip ${1=0},${2=1},${3=0},${4=1},${5=128},${6=0},${7=1} +skip ${8=0.5},${9=0},${10=0},${11=4},${12=0},${13=0} +if $13 repeat $! l[$>] +gcd_srgb2jpeg sh 1,2 median. 5,20 rm. gcd_jpeg2srgb c 0,255 +done done fi +mode=${arg\ 1+$11,hsi_i,hsv_v,lab_l,lrgb,rgb,ycbcr_y} +ac "_gcd_tone_enhance ${1-10}",$mode,{$12+1} +_gcd_tone_enhance : +repeat $! l[$>] +if $9>0 bilateral 1%,$9 c 0,255 fi ++norm +bilateral.. 2%,30 norm. -[-2,-1] ++gradient_norm.. n. 0,1 oneminus. *[-2,-1] +if $10 b. {0.025*$10}% fi ++n.. 0,255 median. 3 bilateral. 2%,30 +gcd_srgb2luma. -. $5 +abs. negate. ++max.. 0 min... 0 abs... +if $8!=0.5 ++n[{$8>0.5?-3:-1}] 0,1 +gcd_ibezier[0] {1-$8} +j[0] .,0,0,0,0,1,.. rm[-2,-1] +fi ++/... {if(iM#-3>0,iM#-3/(1/$2-1),1)} +. 1 ++/... {if(iM#-3>0,iM#-3/(1/$7-1),1)} +. 1 *[-2,-1] ++/.. {if(iM#-2>0,iM#-2/(1/$4-1),1)} +. 1 *[-2,-1] +m={0,iM} /[0] $m ^[0,-1] *[0] $m +n... 0,$1 n.. 0,$6 n. 0,$3 *[-3--1] [-4] rm[-4] + +done done +fx_map_tones : +ac "map_tones ${1-4}",$5,1 +n 0,255 +fx_map_tones_preview : +gui_split_preview "fx_map_tones $*",${-3--1} +fx_map_tones_fast : +ac "map_tones_fast $1,$2",$3,2 +fx_map_tones_fast_preview : +gui_split_preview "fx_map_tones_fast ${^0}",${-3--1} +fx_yag_soften : +Darken=$1 +Soften=$2 ++fx_laplacian[0] 0,0,100,0,0,0 +if $Soften>0 +fx_gaussian_blur[1] {$Soften/10},0,0,1,0,0,0 +fi ++fx_mix_lab[0] 0.5,50,0.2,1,2,1,1,2,1,0,10,0 +if $Darken>0 ++blend[0,2] softlight +blend[0,3] multiply,{$Darken/100} +fi +blend[0,2] hardlight +if $Soften!=100 +blend[0,1] grainextract +elif $Soften==100 +rm[1] +fi +fx_yag_soften_preview : +gui_split_preview "fx_yag_soften ${1--2}",$-1 +fx_droste : +repeat $! { +if $16==1 100%,100%,1,1,'x' 100%,100%,1,1,'y' a[-2,-1] c fi +repeat $9 { +x0,y0,x1,y1,x2,y2,x3,y3:=round([$1*w/100,$2*h/100,$3*w/100,$4*h/100,$5*w/100,$6*h/100,$7*w/100,$8*h/100]) +100%,100%,1,2,-32767 polygon. 4,$x0,$y0,$x1,$y1,$x2,$y2,$x3,$y3,1,-65535 +sh. 0 +f. "i==-65535?( +x03 = "$x0"+(y-"$y0")/("$y3"-"$y0")*("$x3"-"$x0"); +x12 = "$x1"+(y-"$y1")/("$y2"-"$y1")*("$x2"-"$x1"); +(x-x03)/(x12-x03)*(w-1)):i" +rm. +sh. 1 +f. "i==-65535?( +y01 = "$y0"+(x-"$x0")/("$x1"-"$x0")*("$y1"-"$y0"); +y32 = "$y3"+(x-"$x3")/("$x2"-"$x3")*("$y2"-"$y3"); +(y-y01)/(y32-y01)*(h-1)):i" +rm. +xshift,yshift,alpha:=w*$10/100,h*$11/100,-$12*pi/180 +ca,sa,w2,h2:=cos($alpha)/$13,sin($alpha)/$13,w/2,h/2 +f. i==-32767?i:(X=i(x,y,0,0)-$w2;Y=i(x,y,0,1)-$h2;!c?$w2-$xshift+X*$ca-Y*$sa:$h2-$yshift+X*$sa+Y*$ca) +if !$14 sh. 0 f. i==-32767?x:i rm. sh. 1 f. i==-32767?y:i rm. +elif $14==1 sh. 0 f. i==-32767?x:w-1-i rm. sh. 1 f. i==-32767?y:i rm. +elif $14==2 sh. 0 f. i==-32767?x:i rm. sh. 1 f. i==-32767?y:h-1-i rm. +else sh. 0 f. i==-32767?x:w-1-i rm. sh. 1 f. i==-32767?y:h-1-i rm. +fi +if $16<2 warp.. .,0,{!$16},$15 rm. +else ++warp.. .,0,1,$15 rm.. +if $16==3 rv[-2,-1] fi +blend[-2,-1] alpha +fi +} +if $16==1 warp.. .,0,1,1 rm. fi +mv. 0 +} +fx_droste_preview : +if !$17 fx_droste $* else polygon 4,$1%,$2%,$3%,$4%,$5%,$6%,$7%,$8%,0.3,0,0,0,255 fi +polygon 4,$1%,$2%,$3%,$4%,$5%,$6%,$7%,$8%,1,0xFFFFFFFF,0,0,0,255 +fx_frame_blur : +foreach { +to_rgb sx:=$1%*max(w,h) sy:=$2%*max(w,h) ++r {w+$sx},{h+$sy},1,100%,3 b[1] $4% +if $6 balance_gamma[1] ${7-9} fi +if $10==1 n[1] 0,255 elif $10==2 n[1] 0,255 equalize[1] 256 fi +rv +z[1] {$3/2}%,{$3/2}%,{100-$3/2}%,{100-$3/2}% +to_rgba[1] +if $5 r:=1+1/$5 sh[1] 100% f. 1-(abs(x/w-0.5)^$r+abs(y/h-0.5)^$r)^(1/$r) +v:=min(i(w/2,0),i(w-1,h/2),i(w/2,h-1),i(0,h/2)) +c. $v,{$v+0.5/max(w,h)} n. 0,255 rm. fi +s:=$11%*max(w,h) +r[1] {w+$s},{h+$s},1,4,0,0,0.5,0.5 +i[1] 100%,100%,1,3 fc[1] ${12-14} blend[1,2] alpha to_a. +if $5 sh[1] 100% f. 1-(abs(x/w-0.5)^$r+abs(y/h-0.5)^$r)^(1/$r) +v:=min(i(w/2,0),i(w-1,h/2),i(w/2,h-1),i(0,h/2)) +c. $v,{$v+0.5/max(w,h)} n. 0,255 rm. fi +rotate[1] $21,1,0 +r[1] [0],[0],1,4,0,0,$19,$20 ++channels[1] 100% b. $17%,0 c. 0,{max(1,100-$18)}% n. 0,255 +shift. {round(w*$15%)},{round(h*$16%)},0,0,0 /. -255 +. 1 *[0,-1] +blend alpha +} +fx_frame_fuzzy : +foreach { +sx:=$1%*max(w,h)/2 +sy:=$2%*max(w,h)/2 +frame_fuzzy $sx,$sy,${3-8} +} +fx_frame_mirror : +foreach { +{100+2*$1}%,{100+2*$2}%,1,100%," +const boundary = 3; +const offx = (w - w#-1)*$3%; +const offy = (h - h#-1)*$4%; +const f_left = 2^$5; +const f_right = 2^$6; +const f_up = 2^$7; +const f_bottom = 2^$8; +x = x - offx; +y = y - offy; +x<0?(x*=-f_left): +x>=w#-1?(x = w#-1 - 1 - f_right*(x - w#-1)); +y<0?(y*=-f_up): +y>=h#-1?(y = h#-1 - 1 - f_bottom*(y - h#-1)); +I(#-1,x,y)" k. +} +fx_frame_mirror_preview : +foreach { +ws,hs:=w,h fx_frame_mirror $* wd,hd:=w,h +rr2d $_preview_area_width,$_preview_area_height wp,hp:=w,h +ws,hs:=[$ws,$hs]*[$wp,$hp]/[$wd,$hd] +coords:=off=([$wp,$hp]-[$ws,$hs])*[$3,$4]%;[off,off+[$ws,$hs]-1] +split_opacity 100%,100%,1,1,$9 rectangle. $coords,1,1 *[0,-1] a c +rectangle $coords,0.75,0xF0F0F0F0,255 +rectangle $coords,0.75,0x0F0F0F0F,0,0,0,255 +} +fx_frame_painting : +if $14 +repeat $! { +100%,100%,1,4 frame_painting. $1%,$2,$3%,${4-6},$7%,${8-13} +rv[-2,-1] to_a. r. ..,..,1,4,0,0,0.5,0.5 mv[-2,-1] 0 +} +else frame_painting $1%,$2,$3%,${4-6},$7%,${8-13} +fi +fx_frame_painting_preview : +frame_painting $1%,$2,$3%,${4-6},$7%,${8-13} +fx_frame_pattern : +if $2" || "$!==1 repeat $3 { frame_pattern $1,$4 } +else repeat $3 { frame_pattern[^0] $1,[0],$4 } +fi +fx_frame_pattern_preview : +fx_frame_pattern ${1-3},1 +fx_frame : +to_rgba repeat $! { +z. $1%,$3%,$2%,$4% +frame. $11,$11,${12-15} +sx,sy:=[$5%,$6%]*max(w,h) +frame. $sx,$sy,${7-10} +mv. 0 } +cl_reliefFrame: +frameType,frameSize,reliefWidth,reliefAmount,kaleido,frameBlur,frameHue,frameSat,frameLum,unifColor,colorR,colorG,colorB,grainType,grainAmount,grainFrameOn=$* +if $grainType==2 +grainType=3 +fi +foreach { +remove_opacity. +[-1] +if $unifColor==0 +if $kaleido +fx_kaleidoscope. 50,50,0,0,100,10,2 +fi +b. $frameBlur +l. +rgb2hsl split c ++. $frameLum c. 0,1 ++.. $frameSat c.. 0,1 ++... $frameHue %... 360 +a c hsl2rgb +done +elif $unifColor==1 +fill. [$colorR,$colorG,$colorB] +fi +if $grainFrameOn==0 +fx_noise. $grainAmount,$grainType,16,1,0,50,50 +elif $grainFrameOn==1 +fx_noise.. $grainAmount,$grainType,16,1,0,50,50 +fi +100%,100%,1,1,0 +fx_frame_round. $frameSize,20,1,255,255,255,255,0,0,3 +remove_opacity. +n. 0,255 +[-1] +if $frameType>=1 +negate. +fi +if $frameType>=2 +gradient_norm. +fi +if $frameType==3 +negate. +fi +fx_smooth_antialias. 100,10,5,0,50,50 +negate. +l. +b. $reliefWidth +fill. if(abs(i)<1e-10,0,i) +gradient2rgb. 0 n. 0,255 +[-1] +rgb2hsv[-2,-1] split[-2,-1] c +l[-3--1] +[-3] {315} %[-3] 360 done +l[-6--4] +[-3] {135} %[-3] 360 done +l[-3--1] a c hsv2rgb s c done +l[-6--4] a c hsv2rgb s c done +rm[^-6,-3] +negate.. +/ 2 ++. 128 +blend grainmerge,1 +done +to_rgb. +apply_curve. 1,0,{127-$reliefAmount},255,{128+$reliefAmount} +fill[0] i#2*i#1+(255-i#2)*i n[0] 0,255 +rm.. rm.. +blend grainmerge,1 +if $grainFrameOn==2 +fx_noise. $grainAmount,$grainType,16,1,0,50,50 +fi +} +cl_circ : +fill. stroke(d)=cut($4-abs(d/2),0,1);stroke(sqrt((x-$1)^2+(y-$2)^2)-$3) +n. 0,255 +cl_innerCirc : +xC=$1 +yC=$2 +radi=$3 +wid=$4 +nb=$5 +lvl=$6 +if $lvl>0 +angl={pi/$nb} +sinu={sin($angl)} +ra={$radi/(1+1/$sinu)} +ray={$radi/(1+$sinu)} ++fill. 0 +[-1]x{$nb-1} +foreach[1--1] { +num=$> +xA={$ray*cos(2*$num*$angl)} +yA={$ray*sin(2*$num*$angl)} +cl_circ {$xC+$xA},{$yC+$yA},$ra,$wid +cl_innerCirc {$xC+$xA},{$yC+$yA},$ra,$wid,$nb,{$lvl-1} +} +fi +fx_frame_round : +to_rgba frame_round $1%,$2%,$3%,${4-7} +fx_frame_smooth : +foreach { +sx,sy:=[$1%,$2%]*max(w,h) +100%,100%,1,1,0 +if $3 r:=1+1/$3 f. 1-(abs(x/w-0.5)^$r+abs(y/h-0.5)^$r)^(1/$r) +v:=min(i(w/2,0),i(w-1,h/2),i(w/2,h-1),i(0,h/2)) <=. $v +fi +frame $sx,$sy,1 +inpaint_pde[0] [1],100%,1,15 +rm. +} +c 0,255 +fx_old_photo : +vignette ${1-3} old_photo +fx_polaroid : +vignette ${8-10} polaroid $1,$2 drop_shadow $3%,$4%,$5%,$6,$7 rotate $8,1,0 +fx_tunnel : +tunnel $1,$2%,{[${3,4}]%},${5-6} +fx_vignette : +foreach { +to_rgb +to_rgba split_opacity +=. 0 vignette. ${1-3} a c +fc ${4-7} rv blend alpha +} +fx_bandpass : +foreach { split_opacity ac[0] "bandpass $1%,$2%",$3,$4 a c } +fx_bandpass_preview : +gui_split_preview "fx_bandpass $*",${-3--1} +fx_display_fft : +to_rgb display_fft +fx_fourier_transform : +if $1 remove_opacity fi +ind=0 +_preview_error=0 +for $ind<$! { +gui_layer_name[$ind] nm=${} +p:="s=['"$nm"'];find(s,' [FFT Magnitude] | ',size(s)-1,-1)" +if $p>=0 +if $ind+1>=$! +gui_resize_preview_area[$ind] +gui_error_preview[$ind] "Two input layers are required. Please set 'Input Layers' mode accordingly." +ind=$! +_preview_error=1 +else l[$ind,{$ind+1}] { +('$nm') +z. {$p+19},100% a0,b0=${u\ {t}} rm. z. 0,{$p-1} nm={t} rm. +/.. $a0 +.. $b0 +/. {255/(2*pi)} -. {pi} +exp.. -.. 1 ifftpolar +c 0,255 +gui_set_layer_name $nm +ind+=1 +} fi +else l[$ind] { +fftpolar +.. 1 log.. +a0,b0={0,_[255/(iM-im),im]} +-.. $b0 *.. $a0 ++. {pi} *. {255/(2*pi)} +c 0,255 +gui_set_layer_name.. $nm" [FFT Magnitude] | "$a0,$b0 +gui_set_layer_name. $nm" [FFT Phase]" +ind+=2 +} fi +} +fx_fourier_transform_preview : +fx_fourier_transform $* k[0] +if !$_preview_error gui_resize_preview fi +fx_fourier_old : skip ${2=0} +if $2 remove_opacity fi +magic="GMICFFT" i=0 +for $i<$! { +ni:=$i+1 nm={$i,n} is_ifft=0 ++columns[$i] 100% +l. { +mag,m0,M0,m1,M1=${u\ {t}} +if ['$mag']=='$magic' is_ifft=1 fi +onfail +} +rm. +if !$is_ifft +rows[$i] 100% l. { mag,m0,M0,m1,M1=${u\ {t}} if ['$mag']=='$magic' is_ifft=2 fi onfail } rm. fi +if !$is_ifft ++rows[$i] 100% l. { mag,m0,M0=${u\ {t}} if ['$mag']=='$magic' is_ifft=3 fi onfail } rm. +if $is_ifft==3 +is_ifft=0 +rows[$ni] 100% +l. { mag,m1,M1=${u\ {t}} if ['$mag']=='$magic' is_ifft=3 fi onfail } rm. +fi +fi +if !$is_ifft +l[$i] { +fftpolar +.. 1 log.. m0,M0,m1,M1:=im#0,iM#0,im#1,iM#1 n[-2,-1] 0,255 +if !$1 ({'$magic,$m0,$M0,$m1,$M1'},0) y. a x +elif $1==1 ({'$magic,$m0,$M0,$m1,$M1'},0) a y +else ({'$magic,$m0,$M0'},0) a[-3,-1] y ({'$magic,$m1,$M1'},0) a[-2,-1] y +fi +=> $nm +} +else +if $is_ifft==1 columns[$i] 0,{$i,w-2} s[$i] x,2 +elif $is_ifft==2 rows[$i] 0,{$i,h-2} s[$i] y,2 +else rows[$i,$ni] 0,{$i,h-2} +fi +l[$i,{$i+1}] { n[0] $m0,$M0 n[1] $m1,$M1 exp[0] -[0] 1 ifftpolar c 0,255 } +fi +i+=$1<2" || "$is_ifft>2?1:2 +} +fx_fourier_old_preview : +if $2 remove_opacity fi +dfft +fx_watermark_fourier : +watermark_fourier "$1",$2 c 0,255 +fx_align_layers : +to_colormode 0 +r ${-max_wh},1,100%,0,0,0.5,0.5 +if ${4=0} _fx_revert_layers fi +remove_opacity +if $1 register_nonrigid[^-1] .,$2,0.1,$3 +else register_rigid[^-1] .,$2 +fi +fx_align_layers_preview : +fx_align_layers $1,$2,0 blend_edges 0.1 +_fx_revert_layers : +repeat int($!/2) { rv[{2*$>},{2*$>+1}] } +fx_blend_average_all : +if $! to_rgba +N=$! r ${-max_wh},1,100%,0,0,0.5,0.5 +_gb_fwd $1 ++ / $N +_gb_bwd $1 +fi +_gb_fwd : +to_color +if $1==1 foreach { sh 0,2 srgb2rgb. rm. } +elif $1==2 foreach { sh 0,2 srgb2rgb. rgb2lab. rm. } +fi +_gb_bwd : +to_color +if $1==1 foreach { sh 0,2 rgb2srgb. rm. } +elif $1==2 foreach { sh 0,2 lab2rgb. rgb2srgb. rm. } +fi +fx_blend_edges : +repeat int($!/2) { l[$>,{$>+1}] { if $3 rv fi +blend_edges[-2,-1] $2 rm... blend[-2,-1] alpha,$1 } } +fx_blend_fade : +if $!==1 return fi +to_colormode 4 +_gb_fwd $7 +if !$1 [0],[0],1,1,"$11" +else _fx_blend_fade$1 $8,$9,$10 r. [0],[0],1,1,3 +fi +n. {-($!-2)*$3},{($!-2)*(1+$3)} +-. {$2*(1+$3)*($!-2)} +c. 0,{$!-2} +if $6 rv[^-1] fi +if $5 round. 1 +else roundify. $4 +fi +blend_fade[^-1] . rm. +_gb_bwd $7 +c 0,255 +_fx_blend_fade1 : [0],[0],1,1,"a=$1*pi/2; x*cos(a) + y*sin(a)" +_fx_blend_fade2 : [0],[0],1,1,0 =. 1,{($1+1)*50}%,{($2+1)*50}% distance. 1 +_fx_blend_fade3 : [0],[0],1,1,0 =. 1,{($1+1)*50}%,{($2+1)*50}% distance. 1 *. {0.01+$3/2} cos. +_fx_blend_fade4 : [0],[0],1,1,"((x-w*($1+0.5))*(y-h*($2+0.5)))%(0.2*w*h*(1.001+$3))" +fx_blend_median : +_gb_fwd $1 +blend_median +_gb_bwd $1 +fx_blend_seamless : +rv +_gb_fwd $4 +to_a[^0] r[^0] [0],[0],1,100%,0 +repeat $! { pos=${gui_layer_pos[$>]} shift[$>] ${u\ $pos},0,0 } +if $5 ++blend_seamless $1,$2%,$3% +remove_opacity[0,-1] k[0,-1] rv sub_alpha[0] [1],1 +else +blend_seamless $1,$2%,$3% +fi +_gb_bwd $4 +fx_blend_seamless_preview : +fx_blend_seamless ${1-4},0 +fx_blend : +mode=${arg0\ $1,add,alpha,and,average,blue,burn,custom_formula,darken,difference,divide,dodge,edges,exclusion,freeze,grainextract,grainmerge,green,hardlight,hardmix,hue,interpolation,lighten,lightness,linearburn,linearlight,luminance,multiply,negation,or,overlay,pinlight,red,reflect,saturation,shapeareamax,shapeareamax0,shapeareamin,shapeareamin0,shapeaverage,shapeaverage0,shapemedian,shapemedian0,shapemin,shapemin0,shapemax,shapemax0,shapeprevalent,softburn,softdodge,softlight,screen,stamp,subtract,value,vividlight,xor} +m "_blend_custom_formula : f. \"a = i#0/255; b = i#1/255; 255*cut(($5),0,1)\"" +if !$2 repeat int($!/2) { l[$>,{$>+1}] { rv blend $mode,{$3%} } } +elif $2==1" && "$!>1 blend[^0] [0],$mode,{$3%},0 rm[0] +elif $2==2" && "$!>1 blend[^-1] .,$mode,{$3%},1 rm. +fi +um _blend_custom_formula +fx_blend_preview : +fx_blend $"*" +if $4 append_tiles , fi +fx_split_colors : skip ${2=0} +to_rgb +foreach { +nm=${-gui_layer_name} +pos=${-gui_layer_pos} +min_area:=max(1,w*h*$3%) +split_colors $1,$2,$min_area +=>[^] "name("$nm"),pos("$pos")" +if $4 gui_autocrop_layers fi +} +fx_split_colors_preview : +foreach { ++fx_split_colors ${1-4} drgba +foreach { to ${arg\ {1+!!$>},"Original","#"$>},1,1,43,7,1,255 } +frame 1,1,0 frame 3,3,255 to_rgba append_tiles , +} +fx_fade_layers : +if $!<2 return fi +to_colormode 0 +r ${-max_wh},1,100%,0,0,0.5,0.5 +a z r 100%,100%,{(d-1)*$1+1},100%,3 s z +fx_fade_layers_preview : +if $!<2 return fi +to_colormode 0 +r ${-max_wh},1,100%,0,0,0.5,0.5 +k[0,1] + / 2 +fx_append_tiles_preview : +frame 1,1,0,0,0,255 append_tiles $1,$2 +fx_morph_layers : +if ${4=0} _fx_revert_layers fi +to_rgb morph $1,$2,$3 +fx_apply_multiscale : skip "${13=}" +foreach { +w0,h0:=w,h +apply_scales "$13",$1,$2%,$3%,{10^$4},{arg(1+$5,1,3,5,6)} +if $8" || "($9" && "$8!=$12) to_a N=$! repeat $! { +angle:=$9?$8+($12-$8)*$>/max($N-1,1):$8 +rotate[$>] $angle +} fi +if $14 +if $15 siz=$w0,$h0 else siz=${-max_wh} fi +r $siz,1,100%,{arg($14,1,3,5,6)} +c 0,255 +fi +w=${-max_w} h=${-max_h} N=$! +repeat $! { +cx:=$9?$6+($10-$6)*$>/max($N-1,1):$6 +cy:=$9?$7+($11-$7)*$>/max($N-1,1):$7 +gui_set_layer_pos[$>] {$>,($w-w)*$cx},{$>,($h-h)*$cy} +} +} +fx_apply_multiscale_preview : +foreach { +fx_apply_multiscale $"*" +N:=int(sqrt($!)) N:=round($!/$N,1,1) r2dy {100/$N}% +to_rgba +max_wh=${-max_wh} +N=$! foreach { +cx:=$9?$6+($10-$6)*$>/max($N-1,1):$6 +cy:=$9?$7+($11-$7)*$>/max($N-1,1):$7 +r $max_wh,1,100%,0,0,$cx,$cy +0 text. "#"{1+$>}" ",1,1,24,1,255 +dilate. 5 to_rgba[1] j[0] [1],2,0,0,0,1,[2],255 k[0] +} +frame 1,1,0 frame 3,3,255 append_tiles , +} +fx_pack : skip "${8=}" +if $4 to_rgba foreach { +nm0={n} gui_layer_name nm=${} +0 t. {``$nm},3,0,$5,1,1 frame. 1,1,0 +if $6 *. -1 fi +n. 0,255 to_rgba. r. {[w+2,h+1,1,4]},0,0,0,1 +rv a y,{w#0>w?0.5:0} => $nm0 +} fi +if $3 to_a fi +repeat $! { gui_layer_name[$>] nm$>=${} =>[$>] {`lowercase(['${nm$>}'])`} } +c0="w" c1="h" c2="max(w,h)" c3="w*h" c4="n" +pack $2,${c$1} coords=${} +if $7 +repeat 256 { filename "$8/gmic_pack.txt",$> filename=${} if isfile(['{/$filename}']) else break fi } +if !narg($filename) filename="$8/gmic_pack.txt" fi +l[] { repeat narg($coords)/2 { +x,y:=arg(1+2*$>,$coords),arg(2+2*$>,$coords) +('"Image ""#"{1+$>}" ("${nm$>}"): "$x,$y\n') +} a x ot $filename rm } +fi +=> "name(G'MIC packing),pos(0,0),mode(normal)" +if $4 autocrop fi +fx_pack_preview : skip "${8=}" +if !$! return fi +w,h={w},{h} +filled=0 repeat $! { filled={$>,$filled+w*h} } +fx_pack $1,$2,$3,$4,$5,$6,0 +area:=wh +to_rgba rr2d $w,$h,0 +i[0] $w,16,1,4,255 t[0] "Filled: "{round(100*$filled/$area)}%,3,1,14,1,0,0,0,255 +a y,0.5 +u "{$1}{$2}{$3}{$4}""{$5}_"{2*$4}"{$6}_"{2*$4}"{$7}{$8}" +fx_stroke : +to_a +foreach { +nm={n} +if !$26" && "$5 expand_xy $1,0 is_frame1=0 else expand_xy 1,0 is_frame1=1 fi +split_opacity +l. { +b $3 +if $6>=100 +shift $7,$8 +if $6!=100 wh:=w,h r $6%,$6%,1,1,3 r $wh,1,1,0,0,0.5,0.5 fi +else +if $6!=100 wh:=w,h r $6%,$6%,1,1,3 r $wh,1,1,0,0,0.5,0.5 fi +shift $7,$8 +fi +> {99.99-min(99.99,$2)}% +distance $5,$4 +($9^$10^$11^$12) +if $1>1 ($13^$14^$15^$16) a[-2,-1] x r. $1,1,1,4,3 c. 0,255 fi +i.. ($21^$22^$23^$24) ($17^$18^$19^$20) if $5 rv[-3,-1] fi +a[-3--1] x map.. .,1 rm. +} +a[0,1] c +if $is_frame1 shrink_xy 1 fi +if $25 rv fi +=>[^] $nm +} +fx_stroke_preview : +foreach { fx_stroke $* => foo gui_merge_layers } +fx_tiles2layers : +split_tiles $1,$2,$3 +fx_tiles2layers_preview : +split_tiles $1,$2,$3 to_rgba frame 1,1,0,0,0,255 frame 3,3,0,0,0,0 append_tiles , +fx_tones2layers : +sval=$2 eval:=max($2,$3) +remove_opacity +foreach { +nm={n} ++luminance rv +repeat $1-1 { +[1] +val0:=$sval+($eval-$sval)*$>/($1-2) +val1:=$sval+($eval-$sval)*($>+1)/($1-2)-1 ++ir[0] $val0,$val1 +if $5 *. [0] b. $4% n. 0,255 +else b. $4% n. 0,255 +fi +a[-2,-1] c +} +rm[0] rv =>[^] $nm +} +fx_tones2layers_preview : +fx_tones2layers $* rv +r {100/$!}%,{100/$!}%,1,100%,2 +to_rgba frame 1,1,0,0,0,255 frame 3,3,0,0,0,0 append_tiles , +_fx_burn : +foreach { +w,h={w},{h} ++norm +fx_fourier_old. 2 ++rows. 0,{$h-1} r. $2%,$2%,1,100%,0,0,0.5,0.5 b. $3% +j.. .,{($w-w)/2},{($h-h)/2} rm. +fx_fourier_old[-2,-1] 2 +blend overlay,$1 +} +fx_burn : +ac "_fx_burn ${1-3}",$4,$5 +fx_burn_preview : +gui_split_preview "fx_burn ${^0}",${-3--1} +fx_contrast_swm : +foreach { +split_opacity l[0] { ++luminance to_rgb +blur_xy[1] $1,$1 +if !$2 negate[1] fi +rv blend hardlight,$3 +} +a c +} +fx_dodgeburn : +repeat $! l[$>] +luminance if $9==1 +fc[0] 128,128,128,255 fi +tk_fx_channel_processing[1] 1,1,0,$2,4,0,{100-$1},256,0,1,0,2,0,0 +tk_fx_channel_processing[1] 1,1,{-{256-$3}},0,0,0,100,256,0,0,0,2,0,0 +fx_gaussian_blur[1] $4,0,0,1,0,0,0 +luminance[0] +if $9==0 compose_dodge[0,1] else rv[1,2] compose_dodge[1,2] fi +tk_fx_channel_processing. 1,1,0,$6,4,$5,100,256,0,0,0,2,0,0 +tk_fx_channel_processing. 1,1,{256-$7},0,0,0,100,256,0,0,0,2,0,0 +fx_gaussian_blur. $8,0,0,1,0,0,0 +if $9==0 compose_colorburn[0,1] else compose_colorburn[-1,-2] fi +if $9==1 fx_gaussian_blur. $11,0,0,1,0,0,0 fi +if $10==0 if $9==1 rm[0] fi fi done done +fx_dodgeburn_preview : +gui_split_preview "fx_dodgeburn ${1--2}",$-1 +fx_split_freq : +repeat $! ++b. $1 -.. . /.. 2 +.. 128 rv[-2,-1] +mv[-2,-1] 0 done +fx_compose_freq : +repeat int($!/2) +-. 128 *. 2 +[-2,-1] c. 0,255 +mv. 0 done +compose_alpha : +e[^-1] "Compose image$? two-by-two, using alpha blending." +repeat int($!/2) l[$>,{$>+1}] +r. ..,..,..,100%,0,0,0.5,0.5 +to_colormode.. {a1=!({-2,s}%2);a2=!(s%2);max({-2,s}-a1,s-a2)+a1} +to_colormode. {a=max({-2,s},s);a+(a%2)} +if {-2,s==2" || "s==4} +_compose_alpha.. _compose_alpha. +sh. {s-1},{s-1} +*[-3,-1] rm.. +[-3,-2] -[-2,-1] +sh. 0,{s-2} sh.. {-2,s-1},{-2,s-1} +max. 1e-10 /.. . *. 255 rm[-2,-1] +else +sh. 0,{s-2} sh.. {-2,s-1},{-2,s-1} -.. [-4] *[-2,-1] /. 255 rm. +[-2,-1] +fi +done done c 0,255 +_compose_alpha : +sh. 0,{s-2} sh.. {-2,s-1},{-2,s-1} max. 1e-10 /. 255 *[-2,-1] rm. +fx_compose_alpha : +if ${2=0} _fx_revert_layers fi +repeat int($!/2) +to_rgba. sh. 3,3 *. $1 rm. +blend[-2,-1] alpha +mv. 0 done +fx_drop_shadow : +foreach { +drop_shadow $1%,$2%,$3%,$4,$5,$9,1 +to_rgba.. sh.. 0,2 fc. ${6-8} rm. +if $10 rv else blend alpha fi +} +fx_drop_shadow_preview : +fx_drop_shadow ${1-9},0 +fx_drop_shadow3d : +foreach { +_fx_drop_shadow3d $* } +fx_drop_shadow3d_preview : +foreach { +if $13 _fx_drop_shadow3d $* +else +_fx_drop_shadow3d $* rv blend alpha +fi +} +_fx_drop_shadow3d : +point3d 0,0,1 r3d. 1,0,0,$1 r3d. 0,1,0,$2 r3d. 0,0,1,$3 +u,v,w:=i(0,8),i(0,9),i(0,10) rm. +to_a channels 100% if im==iM return fi ++f "X = x/w-0.5; Y = y/h-0.5; A = ($7-$4*$7/100)*$w/(X*$u+Y*$v+$7*$w); A<0?1e8:A" ++*. 'y/h-0.5' *.. 'x/w-0.5' +.. {0.5-$5/100} +. {0.5-$6/100} *.. {w} *. {h} +a[-2,-1] c warp[0] .,0,1,0 rm. +b $8% n 0,$12 i.. ($9^$10^$11) r.. .,.,1,3 a[-2,-1] c +fx_equalize_light : +ac "_fx_equalize_light $1,$2",$3,1 +_fx_equalize_light : +foreach { +split_opacity l[0] { +. +b. {max(0.1,100-$1)}% -[-2,-1] +if $2 match_pca. .. else n. ..,.. fi +rm.. +} +a c +} +fx_equalize_light_preview : +gui_split_preview "fx_equalize_light $*",${-3--1} +fx_equalize_shadow : +foreach { +negate blend softlight,$1 } +fx_equalize_shadow_preview : +gui_split_preview "fx_equalize_shadow $1",${-3--1} +fx_guided_lightrays : +bmode=${"arg0 $12,add,alpha,grainmerge,hardlight,lighten,lchlightness,luminance,overlay,softlight,value"} +if $3 cond="i" else cond="i && !(j(-1) && j(1) && j(0,-1) && j(0,1))" fi +if 0$_is_preview" && "$14 i[1] [0] gui_set_layer_opacity[1] 50 fi +l[0] { +if s==2" || "s==4 channels 100% else compose_channels max fi +ge $6% +100%,100% +eval.. "* +const L = $2<1?$2:$2^5; +const Xl = $7<0?3*$7:$7>100?100+3*($7-100):$7; +const Yl = $8<0?3*$8:$8>100?100+3*($8-100):$8; +const xl = Xl*(w - 1)/100; +const yl = Yl*(h - 1)/100; +"$cond" && u<=$4%?( +u = x - xl; v = y - yl; +polygon(#-1,2,xl,yl,xl + L*u,yl + L*v,-1,255); +)" +equalize. 65536,1,{iM} n. 0,1 power:=10^(-$1%) ^. {max(1e-2,$power)} b. $5% n. 0,255 +i[-2] (${9-11}:cyzx) r.. .,.,1,3 a[-2,-1] c +k. gui_set_layer_mode $bmode gui_set_layer_opacity $13 +} +if 0$_is_preview gui_merge_layers +elif 0$_output_mode k[0] +fi +fx_guided_lightrays_preview : +_is_preview=1 +fx_guided_lightrays $* +fx_illuminate_shape2d : +input_type,output_type,keep_input_bg,preview_shapes,blending_mode,opacity=$1,$2,$7,$10,$16,$17 +blending_mode=${arg0\ $blending_mode,normal,lighten,screen,dodge,add,darken,multiply,burn,overlay,softlight,hardlight,grainmerge} +keep_input_bg&=$!>1 +if $output_type +repeat $!-$keep_input_bg { _fx_illuminate_shape2d[$>] $* } +else +repeat $!-$keep_input_bg { if $keep_input_bg sel=$>,-1 else sel=$> fi l[$sel] { +if !$keep_input_bg" && "$input_type>=2 +_fx_illuminate_shape2d $* +elif $keep_input_bg" && "$input_type>=2 +_fx_illuminate_shape2d[0] $* +elif !$keep_input_bg" && "$input_type<=1 ++_fx_illuminate_shape2d $* rv +else +_fx_illuminate_shape2d[0] $* +fi +if !$preview_shapes" || "0$_is_preview!=1 +gui_set_layer_mode[0] $blending_mode +gui_set_layer_opacity[0] $opacity +if $!>1" && "(!0$_output_mode" || "0$_is_preview==1) +if $keep_input_bg" && "!0$_is_preview . fi +gui_merge_layers[0,1] +else k[0] fi +fi +} } +fi +fx_illuminate_shape2d_preview : +_is_preview=1 +input_type,keep_input_bg,preview_interactive=$1,$7,$-2 +keep_input_bg&=$!>1 +if $preview_interactive fx_illuminate_shape2d_preview_interactive $* fi +if $keep_input_bg +repeat $!-1 { l[$>,-1] { +fx_illuminate_shape2d $* +rv to_colormode 0 a z +gui_split_preview "slices 50%,100%",$-1 +} } +else +gui_split_preview "fx_illuminate_shape2d $*",$-1 +fi +fx_illuminate_shape2d_preview_interactive : +_output_mode=0 +input_type,keep_input_bg=$1,$7 +keep_input_bg&=$!>1 +repeat $!-$keep_input_bg { if $keep_input_bg sel=$>,-1 else sel=$> fi +l[$sel] { +to_rgba ++_fx_illuminate_shape2d[0] $1,2,${3-6},0,1,""$9,0,${11-15},""${16-29},""0,0 +if $!>2 rm[0] elif $input_type>=2 sh[0] 0,2 f. 128 rm. fi +siz=${fitscreen\ {[w,h,1]},256,640} +wsiz0=${fitscreen\ $siz,1,30%,100%} +wsiz=$wsiz0 +r $siz,1,100%,3 +s. c,-3 !=. 0 l.. { - 128 / 127 s c,-2 / } a[-2,-1] c +rv s. c,-3 +(64,96;96,64) r. 24,24 r. ..,..,1,3,0,2 +30,30,1,1 circle. 50%,50%,15%,1,1 b. 4 n. 0,1 +100%,100%,1,3,[255,255,0] +=> normal,rgb,alpha,background,light_alpha,light_rgb +w[] $wsiz,0,0,{rgb,([{*,u},{*,v}]-[$wsiz])/2},"[G'MIC] Illuminate 2D Shape" +cursor 0 +x0,y0,ox,oy,ob,olightz=-1 +lightz=2 clicked=0 +do +x,y,b,mw={rgb,[{*,x},{*,y}]*[w,h]/[{*,w},{*,h}]},{*,b},{*,-o} +lightz:=cut($lightz-0.3*sign($mw)+($y0>=0?3*($y-$y0)/h),0.1,4) +if $x<0 x,y={rgb,ang=$|;(1+[cos(1.4*ang),sin(0.85*ang)])*[w,h]/2} fi +if !$b" || "($b&1) +if $b" && "!$clicked x0,y0=$x,$y +elif !$b x0,y0=-1 +fi +lightx,lighty={rgb,3.5*(2*[$x/w,$y/h]-1)} +if [$ox,$oy,$ob,$olightz]!=[$x,$y,$b,$lightz] ++fx_illuminate_shape2d[normal,rgb] 4,0,${3-6},1,1,""$9,0,${11-15},""${16-25},$lightx,$lighty,$lightz,$29,""0,0 ++j[background] .,0,0,0,0,1,[alpha],255 rm.. ++r2dx[light_alpha,light_rgb] {light_rgb,8+$lightz*(w-8)} j... .,{[$x,$y]-[w,h]/2},0,0,1,.. rm[-2,-1] +r. $wsiz,1,100% to. "Light: ("{``{_round([$lightx,$lighty,$lightz],0.1)}}")",2,2,16 +w. rm. wait 20 +else wait +fi +clicked=$b +elif $b&2 ++j[background] [rgb],0,0,0,0,1,[alpha],255 ++r2dx[light_alpha,light_rgb] {light_rgb,8+$lightz*(w-8)} j... .,{[$x,$y]-[w,h]/2},0,0,1,.. rm[-2,-1] +w. rm. wait +fi +if {*,CTRLLEFT}" && "{*,-D} w[] {1.5*[{*,w},{*,h}]} wsiz={*,w,h} +elif {*,CTRLLEFT}" && "{*,-C} w[] {0.75*[{*,w},{*,h}]} wsiz={*,w,h} +elif {*,CTRLLEFT}" && "{*,-R} w[] $wsiz0 +fi +ox,oy,ob=$x,$y,$b +while {*}" && "!{*,ESC}" && "!{*,Q} +w 0 rm +} } +_fx_illuminate_shape2d : +input_type,output_type,gR,gG,gB,gA,keep_input_bg,keep_output_transparency,min_shape_area,preview_shapes,dilation,shape_smoothness,bump_factor,weight_avg_max,resolution,blending_mode,opacity,ambient,diffuse,specular,shininess,light_smoothness,flatness,linearity,levels,lightx,lighty,lightz,normalize_illumination,preview_interactive,preview_mode=${1-31} +nm={n} +if !$input_type +to_rgba ++channels. 100% >. 0 . +select_color... 0,$gR,$gG,$gB,$gA +mv... $! -[-2,-1] +elif $input_type==1 +to_rgba ++channels. 100% >. 0 *[-2,-1] +if $min_shape_area>1 +quantize_area. {$min_shape_area^2} fi +s. c,-{s-1} >. 0 rv[-2,-1] +if s>1 f. "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm. round. 0.01 fi +label. 0,0 f. "j(1)!=i || j(0,1)!=i" thinning. 1 ==. 0 *. .. +select_color... 0,$gR,$gG,$gB,$gA +mv... $! -[-2,-1] +elif $input_type==2 +to_a +s c,-{s-1} >. 0 *.. . rv s. c S:=$!-1 +[^0] /. $S +elif $input_type==3 ++channels 100% >. 0 *.. . rv +f. "I==vector4(0)?[128,128,255,255]:I" +channels. 0,2 +else ++channels 100% rv +fi +if 0$_is_preview" && "$preview_shapes +if $input_type==3 k[0] else k. fi ++dilate. 3 +label_fg.. 0 srand 0 {-2,iM+1},1,1,3,'!x?[0,0,0]:x==1?[255,255,255]:u([255,255,255])' map... . rm. +*. 255 a c +return +fi +if $input_type<=1 +shape2bump. {arg($resolution,2048,1024,512,256,128,64)},$weight_avg_max,{$dilation%*max(w,h)},$shape_smoothness +fi +if $input_type<=2 +if $input_type==2" && "$shape_smoothness mM:=im,iM guided. ..,$shape_smoothness%,100 n. $mM fi +*. $bump_factor +fi +if $output_type==1 +if $input_type<=2 +if $keep_output_transparency k[-2,-1] n 0,255 rv a c +else k. n 0,255 +fi +else +rm gui_error_preview "Cannot convert a normal map to a bump map." return +fi +elif $output_type==2 +if $input_type<=2 round 0.0001 bump2normal. f. "i(#-2)?I:[128,128,255]" fi +if $keep_output_transparency k[-2,-1] rv *. 255 a c +else k. +fi +else +if $input_type<=2 g. xy a[-2,-1] c +elif $input_type==3 -. 128 /. 127 s. c,-2 /[-2,-1] +fi +f. "* +begin( +const flatness = "$flatness"; +const ka = "$ambient"%; +const kd = "$diffuse"%; +const ks = "$specular"%; +const alpha = "$shininess"; +const m1 = max(1,"$lightz"); +const mwh1 = max(w,h) - 1; +light = [ "m1*$lightx,m1*$lighty,-$lightz" ]; +camera = [ 0,0,-"$lightz" ]; +); +res = i#0?( +P = [ 2*x/mwh1 - 1,2*y/mwh1 - 1,0 ]; +L = light - P; +L/=norm(L); +V = camera - P; +V/=norm(V); +N = -[ i0,i1,flatness ]; +N/=norm(N); +R = 2*dot(N,L)*N - L; +res = ka + kd*dot(L,N) + ks*max(dot(R,V),0)^alpha; +):0; +[ res,0 ]" +channels. 0 *. 255 c. 0,255 +if $light_smoothness" || "$linearity +mM:=im,iM +if $light_smoothness b. $light_smoothness% fi +if $linearity n. 0,1 ^. {10^-($linearity%)} fi +n. $mM +fi +if $levels quantize. $levels,1,1 fi +if $normalize_illumination n. 0,255 fi +rv[-2,-1] *. 255 a[-2,-1] c +=>[^] $nm +if !$keep_output_transparency remove_opacity. fi +fi +=>[^] $nm +_fx_lightglow : +mode=${arg0\ $3,burn,dodge,freeze,grainmerge,hardlight,interpolation,lighten,multiply,overlay,reflect,softlight,stamp,value} +repeat $! { ++gradient_norm. >=. {100-$1}% distance. 1 ^. $2 *. -1 n. 0,255 blend $mode,$4 +mv. 0 } +fx_lightglow : +ac "_fx_lightglow ${1-4}",$5 +fx_lightglow_preview : +gui_split_preview "fx_lightglow $*",${-3--1} +fx_light_leaks : +filename=lightleak_${"padint $1",6}.cimgz +input_cached data_lightleaks/$filename +mode=${arg0\ $7,normal,lighten,screen,dodge,add,darken,multiply,burn,overlay,softlight,hardlight,difference,subtract,grainextract,grainmerge,divide,hue,saturation,value} +mv. 0 +repeat $!-1 { l[0,{1+$<}] { ++r[0] {1,w},{1,h},1,3,5 +rotate. $2,1,1,50%,50% +if $3>1" || "$4>1 f. "w2 = w/2; h2 = h/2; X = x - w2; Y = y - h2; i(w2+X/$3,h2+Y/$4,0,c,1,0)" fi +c. 0,255 +if $5 rgb2hsv. sh. 0 +. $5 rm. hsv2rgb. fi +if $8 +nm=${gui_layer_name[1]} +=> name($nm),opacity({$6*100}),mode($mode) rv[-2,-1] +else blend[1,-1] $mode,$6 fi +} } +rm[0] +fx_light_leaks_preview : +gui_split_preview "fx_light_leaks ${1--5},0",${-3--1} +_fx_light_leaks : +u="" repeat 71 { if narg($u) u=$u, fi u=${u}lightleak_${"padint "$>,6} } +u $u +fx_light_patch : +foreach { split_opacity ac[0] "light_patch $1,$2,$3",$4 a c } +fx_lightrays : skip ${6=255},${7=$6},${8=$6} +foreach { +lightrays $1,$2%,$3%,$4,$5 +if $6 channels -3,0 sh. 0,2 fc. ${7-9} rm. +else 100%,100%,1,3 fc. ${7-9} rv n. 0,1 * +fi +} +fx_pop_shadows : +foreach { +split_opacity l[0] { +.x2 +luminance.. negate.. imM:=im#-2,iM#-2 b.. $2% n.. $imM +blend[0,1] overlay,$1 +max +if $3 n 0,255 fi +} +a c +} +fx_pop_shadows_preview : +gui_split_preview "fx_pop_shadows $*",${-3--1} +fx_light_relief : +b $11% light_relief ${1-5},{[$6,$7]%},${8-10} +fx_shadow_patch : +foreach { split_opacity ac[0] "shadow_patch $1",$2 a c } +fx_slice_luminosity : +remove_opacity +foreach { +to_rgb +_fx_slice_luminosity $* +if $2 i[0] [0] a[-2,-1] c fi +rv +} +fx_slice_luminosity_preview : +remove_opacity +foreach { +to_rgb +_fx_slice_luminosity $* +if !$3 rm[0] channels {s-1} +elif $3==1 100%,100%,1,1,128 a[0,-1] c r. 100%,100%,1,4 blend alpha +elif $3==2 a c +else +. 96 c. 0,255 a c +fi +} +_fx_slice_luminosity : +if !$1 +compose_channels + /. 3 +elif $1==1 +luminance +elif $1==2 +srgb2lab8. channels. 0 +else +compose_channels max +fi +if $4 +apply_curve[1] 0,{$5-$7-0.1},0,$5,255,$6,255,{$6+$8+0.1},0,512,0 fi +if $9 +apply_curve[1] 0,{$10-$12-0.1},0,$10,255,$9,255,{$11+$13+0.1},0,512,0 fi +if $14 +apply_curve[1] 0,{$15-$17-0.1},0,$15,255,$16,255,{$16+$18+0.1},0,512,0 fi +if $19 +apply_curve[1] 0,{$20-$22-0.1},0,$20,255,$21,255,{$21+$23+0.1},0,512,0 fi +rm[1] max[^0] +fx_boxfitting : +boxfitting ${1-4} +if $5 to_rgba replace_color 0,0,0,0,0,255,0,0,0,0 fi +fx_camouflage : +foreach { +split_opacity l[0] { +channels 0 r {w+16},{h+16},1,1,0 rand 0,16 +amp=$3 do smooth {min(50,$amp)},0,1 amp-=50 while $amp>0 +shrink_xy. 8 n 1,$2 round +repeat $1 { +area 0,0 <. {1+2^$>} inpaint[0] [1],0,3 rm. } ++colormap 0 n.. 0,{w-1} +4,1,1,3,"col=[${4-15}];col[3*x,3]" +r. ..,..,1,3,3 rm.. map.. . rm. +} +a c +} +fx_canvas : +repeat $! { l. { +if $4 +({cos($2*pi/180)}^{sin($2*pi/180)}) vector2tensor. r. ..,.. +smooth.. .,$1 rm.. sharpen. $3 c. 0,255 +({cos($6*pi/180)}^{sin($6*pi/180)}) vector2tensor. r. ..,.. smooth... .,$5 rm. sharpen.. $7 c.. 0,255 ++[-2,-1] /. 2 +else +({cos($2*pi/180)}^{sin($2*pi/180)}) vector2tensor. r. ..,.. smooth.. .,$1 rm. sharpen. $3 c. 0,255 +fi +} mv. 0 } +fx_canvas_preview : +gui_split_preview "fx_canvas $*",${-3--1} +jeje_clouds : ++clouds $1%,1,$2 blend alpha +jeje_clouds_preview : +jeje_clouds $1,$2 +fx_cracks : +ac "cracks $1,$2,{$6/255},${3-5},255",$7 +fx_cracks_preview : +gui_split_preview "fx_cracks $*",${-3--1} +fx_crystal : +foreach { +split_opacity l[0] { +s:=s ++gradient_norm >=. {(100-$3)/5} remove_pixels. {100-max(0.1,$1*$3%)}%,{is} * ++norm +if $4 +==. 0 inpaint_pde.. .,{lerp(0,100,$2/2)}%,1 rm. +else +!=. 0 a c +do +sigma:=0.5*(1+$2)^$> ++b. $sigma +sh[0,-1] $s max. .. rm[-2,-1] +f. "W = i(x,y,z,$s); W<0.001 || W>=1?0:c<$s?i/W:1" +if !iM rm[1] break fi +sh. $s +j[0] [1],0,0,0,0,1,[2] k[0] +while 1 +channels 0,{$s-1} +fi +} +a c +} +fx_crystal_preview : +gui_split_preview "fx_crystal $*",${-3--1} +fx_crystal_background : +foreach { +split_opacity l[0] { +N:=2*max(3,round(ispercentage($2)?4*wh*$2:$2)) +if $5 col="u([255,255,255])" else col="u(255)" fi +srand $3 M:=max(w,h) 2,$N +repeat $1 { rand. {-$M/2},{3*$M/2} polygon.. $N,{^},{-$4%},{$col} } +rm. n 0,255 +} +a c +} +jeje_fibers : +100%,100%,1,1,0 +l. +fibers $1,$2%,$3 +gt 0 +n 0,255 +done +r. [0] +max +jeje_fibers_preview : +gui_split_preview "jeje_fibers $1,$2,$3",$-1 +jeje_freqy_pattern : +noise {$1*4} +freqy_pattern {50/$2}%,{$3*2} n 0,255 +jeje_freqy_pattern_preview : +gui_split_preview "jeje_freqy_pattern $1,$2,$3",$4 +fx_halftone : +adjust_colors ${1-3},0,0,0,255 b $4 +foreach { split_opacity halftone[0] ${5-9} a c } +fx_halftone_preview : +gui_split_preview "fx_halftone $*",${-3--1} +fx_generic_halftone : +background,base_shape,max_radius,smoothness,antialiasing,bw_only,shape,shape_layout,shape_density,shape_smoothness,shape_angle=${1-11} +afact:=arg0($antialiasing,1,1.25,1.5,2,2.5) +if $shape sel=^ else sel=^0 fi +foreach[$sel] { +b {$smoothness/50}% +if $bw_only luminance n 0,1 else n 0,1 s c fi +ws,hs:=round([w,h]*$afact) +delta:=max(2,round($afact*(100-$shape_density))) +if !$shape +pass[0] 0 +if {s==2||s==4} channels. 100% else l. { s c + } fi +r. {0,[w,h]},1,1,0,0 r. $ws,$hs,1,1,3 +b. $shape_smoothness ge. 0.5 +(0,1,0;1,1,1;0,1,0) +dilate.. . rm.. rv[-2,-1] -[-2,-1] +if $shape_density distance. 1 round. mod. $delta ==. 0 fi +elif $shape==1 +if !$shape_layout +{round([$ws,$hs]/$delta)},1,1,1 r. $ws,$hs,1,1,4,0,0.5,0.5 +elif $shape_layout==1 +$ws,$hs noise_poissondisk $delta +else +$ws,$hs,1,1,u<0.5*($shape_density%)^4 +fi +elif $shape==2 +$ws,$hs,1,1,"const ang = $shape_angle°; +const ca = cos(ang); +const sa = sin(ang); +!(round(sa*x-ca*y)%$delta)" +elif $shape==3 +++ b. {$shape_smoothness/50}% r. $ws,$hs,1,1,3 otsu. 256 (0,1,0;1,1,1;0,1,0) +dilate.. . rm.. rv[-2,-1] -[-2,-1] +distance. 1 round. mod. $delta ==. 0 +elif $shape==4 +$ws,$hs +eval " +const w2 = w/2; +const h2 = h/2; +const dt = 0.1°; +const A = max(6,$delta)/(2*pi); +const tmax = sqrt(w^2+h^2)/2/A; +for (t = 0, t<=tmax, t+=dt, +tdt = t + dt; +ct = cos(t); +st = sin(t); +ctdt = cos(tdt); +stdt = sin(tdt); +r = A*t; +xt0 = w2 + r*cos(t); +yt0 = h2 + r*sin(t); +xt1 = w2 + r*cos(tdt); +yt1 = h2 + r*sin(tdt); +polygon(2,xt0,yt0,xt1,yt1,1,1); +)" +fi ++distance. 1,0 max_patch. 5 +==.. 0 mul[-2,-1] distance. 1,0 *[-2,-1] +foreach[^-1] { +pass. 1 100%,100%,1,1,{$background?255:0} +eval.. "* +const col = !$background; +i?( +lum = i(#0,round(x*w#0/w),round(y*h#0/h)); +$background?(lum = 1 - lum); +R = round(i*lum*$max_radius%); +$base_shape==1?( +ellipse(#-1,x,y,R,R,0,1,col); +):( +x0 = x - R; y0 = y - R; x1 = x + R; y1 = y + R; +polygon(#-1,4,x0,y0,x1,y0,x1,y1,x0,y1,1,col); +) +)" +r. {0,[w,h]},1,1,2 k. +} +rm. a c +if $antialiasing sqr fi +n 0,255 +} +fx_generic_halftone_preview : +background,base_shape,max_radius,smoothness,antialiasing,bw_only,shape,shape_layout,shape_density,shape_smoothness,shape_angle=${1-11} +if !$shape" && "$!<2 gui_error_preview "Missing top layer with halftoning shape." _persistent= return fi +if "['${1--2}']==['$-1'] && "narg($_persistent) +rm $_persistent +else +fx_generic_halftone $* +if !$shape rm[0] fi ++store _persistent +fi +gui_crop_resize_preview +u "{$1}{$2}{$3}{$4}{$5}{$6}{$7}""{"$shape_layout"}"_{$shape==1?2:0}"{"$shape_density"}""{"$shape_smoothness"}"_{isin($shape,0,3)?2:0}"{"$shape_angle"}"_{isin($shape,2)?2:0}"{${1--2}}" +fx_hearts : +ac "hearts $1",$2 +fx_hearts_preview : +gui_split_preview "fx_hearts $*",${-3--1} +fx_lava : +foreach { +split_opacity l[0] { +norm +100%,100% plasma. 1,1,{16-$1} smooth. $2,0,1,$3,$3,0.8,90 * +gradient_norm n 0,255 +equalize map 3 +sharpen $4 +} +a c +} +fx_lava_preview : +gui_split_preview "fx_lava $*",${-3--1} +fx_marble : +foreach { split_opacity marble[0] {$1/10},{$2/10},$3,$4,$5,$6,$7,$8,$9%,$10% a c } +fx_maze : +foreach { +w,h={w},{h} +r. {100/$1}%,{100/$1}%,1,100%,2 +if !$3 f. 1 +elif $3==1 negate. +fi +maze_mask. $1 dilate. $2 *. 255 +if !$5 negate. fi +if $4 r. $w,$h,100%,100% fi +} +fx_mineral_mosaic : +foreach { +to_rgb ++b $3 segment_watershed. $1 +norm. +area. 0 +<=. {$2^2} inpaint.. . rm. label. ++f[0] "!c?x:y" rv[-2,-1] +blend[-2,-1] shapeaverage,1,1 +-[-3,-1] rm[0,-2] channels. 0,1 +alpha:=$5*pi/180 sh. 0 *. {cos($alpha)} rm. sh. 1 *. {sin($alpha)} rm. compose_channels. + +normalize_local. 1000 n. -$4,$4 ++ c 0,255 +} +fx_mosaic : +ac "foreach { split_opacity mosaic[0] $1 a c }",$2 +fx_mosaic_preview : +gui_split_preview "fx_mosaic $*",${-3--1} +fx_shapes : +if $1 +remove_opacity +foreach { +if !$7 _fx_shapes $* * 255 +elif $7==1 split_opacity to_rgb[0] s[0] c repeat 3 { _fx_shapes[$>] $* } *[0-2] 255 a[0-2] c a c +else +_fx_shapes $* r[0] $3%,$3% r[0] [1],[1] * +fi +} +else +if $!<=$2 +error[] "Command '$0': Some layers are missing in 'Custom layers' mode ("{$2+1}" expected at least, "$!" provided)." fi +to_colormode[0-{$2-1}] ${max_s[0-{$2-1}]} remove_opacity[$2--1] +repeat $!-$2 { l[0-{$2-1},{$2+$>}] { +norm. w,h={w},{h} r. $3%,$3%,1,1,2 +s:=$4*max(round($w/w),round($h/h)) +r0,r1:=$s*[$5,$6]% +repeat $2 { r:=round($r0+$>*($r1-$r0)/($2-1)) if $r +r[$>] $r,$r,1,100%,3 else 1,1 fi } +r[-$2--1] $s,$s,1,100%,0,0,0.5,0.5 +map_sprites[$2--1] $2,$8 +} } rm[0-{$2-1}] +fi +fx_shapes_preview : +if $1 foreach { +w,h={w},{h} +gui_split_preview "fx_shapes ${1-3},1,${5--2}",$-1 +r $w,$h,1,100%,0,0,0.5,0.5 +} else +if $!>$2 repeat $!-$2 { l[0-{$2-1},{$2+$>}] { +w,h={w},{h} ++fx_shapes ${1-3},1,${5--2} rm.. +r. $w,$h,1,100%,0,0,0.5,0.5 +} } rm[0-{$2-1}] +else gui_warning_preview "Missing input layers!" +fi +fi +_fx_shapes : +norm w,h={w},{h} r $3%,$3%,1,1,2 +s:=(1+$10)*$4*max(round($w/w),round($h/h)) +r0,r1:=$s*[$5,$6]% +repeat $2 { r:=round($r0+$>*($r1-$r0)/($2-1)) if $r _fx_shapes{$1-1}[] $r,$s else 1,1 fi } +r[-$2--1] $s,$s,1,1,0,0,0.5,0.5 +if $9 rv[-$2--1] *[-$2--1] -1 +[-$2--1] 1 fi +map_sprites $2,$8 +if $10 r 50%,50%,1,1,2 fi +_fx_shapes0 : +shape_circle $1 +_fx_shapes1 : +$1,$1,1,1,1 +_fx_shapes2 : +$1,$1,1,1 = 1,50%,50% distance 1,1 < {$1/2} +_fx_shapes3 : +$2,$2,1,1,'x+y<=2*$1-1' +_fx_shapes4 : +$2,$1,1,1,1 +_fx_shapes5 : +$1,$2,1,1,1 +_fx_shapes6 : +ball $1,200 n 0,1 +_fx_shapes7 : +shape_heart 65 r $1,$1,1,1,2 >= 50% +_fx_shapes8 : +shape_star $1 +_fx_shapes9 : +arrow3d 0,0,0,1,0,0,15%,40%,30% col3d 1 *3d $1 c3d +$2,$2 j3d. ..,50%,50%,0,1,2,0,0 +rm.. +mirror y max +_fx_shapes10 : +S:=$2+1-($2%2) +$S,$S,1,1,"X=x/(w-1);Y=y/(h-1);r=abs(0.5-sqrt(X^2+Y^2));a=atan2(y,x);r<0.1-0.17*(0.5-$1/$2)*sin(2*a)" ++mirror xy max +_fx_shapes11 : +_fx_shapes0 $* expand_xy 1,0 +erode 3 - +_fx_shapes12 : +_fx_shapes1 $* expand_xy 1,0 +erode 3 - +_fx_shapes13 : +_fx_shapes2 $* expand_xy 1,0 +erode 3 - +_fx_shapes14 : +_fx_shapes3 $* expand_xy 1,0 +erode 3 - +_fx_shapes15 : +_fx_shapes7 $* expand_xy 1,0 +erode 3 - +_fx_shapes16 : +_fx_shapes8 $* expand_xy 1,0 +erode 3 - +_fx_shapes17 : +_fx_shapes9 $* expand_xy 1,0 +erode 3 - +fx_pack_ellipses : +radius_min,radius_max,radius_dilation,isotropy_min,isotropy_max,isotropy_levels,orientation_ellipse,region_analysis,bgR,bgG,bgB,bgA,render_factor,preserve_size=${1-14} +isotropy_min,isotropy_max:="sort([ $isotropy_min,$isotropy_max ])/100" +radius_min,radius_max:="sort([ $radius_min,$radius_max ])" +render_factor+=1 +foreach { +progress -1 +to_rgb +nm={n} => img +1,1,1,3 => set ++structuretensors[img] 1 b. 1% eigen. +f.. "l0 = sqrt(i0); l1 = sqrt(i1); [1 - (l1 - l0)/l1,0]" channels.. 0 +if $isotropy_levels quantize.. $isotropy_levels,0,-1 fi +n.. $isotropy_min,$isotropy_max =>.. isotropy +if !$orientation_ellipse f[isotropy] 1 . +elif $orientation_ellipse==1 +f. "[ atan2(-i0,i1),0 ]" +else +f. "[ atan2(i1,i0),0 ]" +fi +channels. 0 => angles +if $region_analysis +norm[img] b. 0.5% slic. {30*$region_analysis},0 g. xy,1 a[-2,-1] c norm. ge. 5% +else 100%,100% +fi +=> contours ++==[contours] 0 => mask +nb_attempts=0 +repeat inf { +x0,y0,x1,y1:=" +const N = 4*$radius_max; +wm1 = w#$mask - 1; +hm1 = h#$mask - 1; +Pc = round(u([wm1,hm1])); P0 = Pc - N/2; P1 = Pc + N/2; +[ cut(P0[0],0,wm1), cut(P0[1],0,hm1), cut(P1[0],0,wm1), cut(P1[1],0,hm1) ]" ++z[mask] $x0,$y0,$x1,$y1 r. {[w,h]+2},1,1,0,0,0.5,0.5 distance. 0 +x,y,r:=$x0+xM-1,$y0+yM-1,min($radius_max,iM-1.25) rm. +if $r>$radius_min +r2={isotropy,max(1,$r*i($x,$y))} +ellipse[mask] $x,$y,$r,$r2,{angles,rad2deg(i($x,$y))},1,0 +eval "da_push(#$set,[$x,$y,$r])" +nb_attempts=0 +else +if narg($contours) +[mask] [contours] rm[contours] +else nb_attempts+=1 if $nb_attempts>10 break fi +fi +fi +if !($>%100) progress {mask,cut(400*(1-ia)^3,0$progress,100)} fi +} +rm[mask] +da_freeze[set] +W,H={img,[w,h]} +{img,round($render_factor*[w,h])} => mask +eval[set] " +const fact = $render_factor; +r1 = fact*(i2 + $radius_dilation); +r2 = max(1,r1*i(#$isotropy,i0,i1)); +ellipse(#$mask,round(fact*i0),round(fact*i1),r1,r2,i(#$angles,i0,i1),1,y + 1); +I" +r[img] {mask,[w,h]},1,100%,3 +blend[img] [mask],shapeaverage0 +!=[mask] 0 *[mask] 255 +a[img,mask] c +if $preserve_size r[img] $W,$H,1,100%,2 fi +k[img] +100%,100%,100%,4 fc. $bgR,$bgG,$bgB,$bgA rv blend alpha => $nm +progress 100 +} +fx_pack_ellipses_preview : +gui_split_preview "fx_pack_ellipses ${1-12},1,0" +fx_pack_sprites : +if $6 +if $!<2 error[] "Command '$0': Masking requires at least two input layers ! +(please check that 'Input Layers' is correctly set)." fi +foreach[^-1] { to_rgba split_opacity +!=[1] 0 *[0] . a c autocrop 0 } +remove_empty[0--2] +channels. 100% channels. -4,0 mv. 0 +pack_sprites[0--2] ${1-5} +else +foreach { to_rgba split_opacity +!=[1] 0 *[0] . a c autocrop 0 } +remove_empty i[0] $7,$8,1,5 pack_sprites ${1-5} +fi +channels[0] 0,{0,s-2} +fx_paper : +ac "texturize_paper",$1 +fx_paper_preview : +gui_split_preview "fx_paper $*",${-3--1} +jeje_periodic_dots : +tW={max(w,h)/$4} +$tW,$tW +periodic_dots. $* +repeat $4*$4-1 +i . +done +append_tiles[1--1] $4,$4 k. +if $5>0 n 0,255 map {$5-1} fi +jeje_periodic_dots_preview : +jeje_periodic_dots $* +fx_pills : +$=arg n:=$1?4:2 +foreach { +w,h={w},{h} rm +repeat $1?3:1 { +$w,$h,1,1,"begin( +const cyc = "${arg$n}"*pi; +const ang = "${arg{1+$n}}"°; +const M = max(w,h); +R = rot(ang); +); +x0 = lerp(-cyc,cyc,x/M); +y0 = lerp(-cyc,cyc,y/M); +x = x0*R[0] + y0*R[1]; +y = x0*R[2] + y0*R[3]; +sqrt(abs(sin(x + cos(y + sin(x + cos(y)))) * sin(y + cos(x + sin(y + cos(x))))))" +n+=2 +} +n 0,255 +a c +} +fx_pills_preview : +fx_pills $* +u "{$1}""{$2}_"{$1?0:2}"{$3}_"{$1?0:2}"{$4}_"{$1?2:0}"{$5}_"{$1?2:0}"{$6}_"{$1?2:0}"{$7}_"{$1?2:0}"{$8}_"{$1?2:0}"{$9}_"{$1?2:0} +fx_plaid_texture : +foreach { +w,h,s={w},{h},{s} +rows $1% +b $5% sharpen $6 +r $w,$h,1,$s,2 ++rotate[0] $3,1,2,50%,50% +repeat $2-1 { +rotate[0] {$3+$4*($>+1)/($2-1)},1,2,50%,50% +[-2,-1] } rm[0] +/ $2 +} +fx_polka_dots : +to_rgba polka_dots {$1*$2/100},${2--1} +fx_color_ellipses : +color_ellipses $1,$2,$3 +_fx_random_pattern : +if $4 srand _seed:=_round(u(100000)) else _seed=$3 fi +srand $_seed +random_pattern $1,$1,$2 +adjust_colors. ${5-9} +mv. 0 +fx_random_pattern : +if 0$_output_mode rm fi +_fx_random_pattern $* +fx_random_pattern_preview : +_fx_random_pattern {max($_preview_area_width,$_preview_area_height)},${2--1} +k[0] rr2d $_preview_area_width,$_preview_area_height,2,2 +to "Seed: \#"$_seed,5,5,5%,2 +u "{$1}{$2}{"{$4?$_seed:$3}"}{0}{$5}{$6}{$7}{$8}{$9}" +jeje_rays : +foreach { +100%,100% rays. {[w*$1,h*$2]%},$3,$4 gt. {$5*100}% +($6,$9^$7,$10^$8,$11) map.. . rm[0,-1] +} +jeje_rays_preview : +gui_split_preview "jeje_rays $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11",$-1 +fx_syntexturize : +foreach { +if $3 +b {20.5-$3/50}% -[0] [1] fc. ${average_vectors.} + c 0,255 fi +syntexturize $1,$2 +} +fx_syntexturize_preview : +gui_split_preview "fx_syntexturize 100%,100%,$3",${-3--1} +_fx_syntexturize_matchpatch_preview : +foreach { +if $7 +b {20.5-$7/50}% -[0] [1] fc. ${average_vectors.} + c 0,255 fi +w,h={w},{h} +syntexturize_matchpatch 100%,100%,${3--1} +to_rgba r $w,$h,1,4,0,0,0.5,0.5 +} +fx_syntexturize_matchpatch_preview : +gui_split_preview "_fx_syntexturize_matchpatch_preview ${1--2}",${-3--1} +fx_rorschach : +foreach { +remove_opacity +if !$3 norm rorschach $1%,$2 * 255 +elif $3==1 to_rgb rorschach $1%,$2 * 255 +else +norm rorschach. $1%,$2 blend shapeaverage0 +fi +} +fx_satin : +($4,$8^$5,$9^$6,$10^$7,$11) srgb2rgb. r. 256,1,1,4,3 rgb2srgb. +foreach[^-1] { +srand $3 channels 0 f 0 +repeat $1 { +100%,100%,1,1,"begin( +A = u([0,0],[w,h]-1); +B = u([0,0],[w,h]-1); +N = [0,-1,1,0]*(B - A); +D = A + N; +C = B + N; +abc = solve([A,1,B,1,C,1,D,1],[0,255,255,0]); +); +dot(abc,[x,y,1])" +c. 0,255 -- abs +} +b $2% gradient_norm negate n 0,255 +if $12 normalize_local , fi +pass. 1 map.. . rm. +sh. 0,2 adjust_colors. ${13-17} rm. +} +rm. +fx_mad_rorscharchp : +fx_rorschach $1,1,1 ++mirror y +if $2==0 fx_compose_average 1,0 +elif $2==1 fx_compose_grainextract 1,0 +elif $2==1 fx_compose_vividedges 1,1,0.5,1 fi ++fx_plaid_texture $3,2,0,90,$4,$5 +if $6==0 fx_compose_vividedges 1,1,0.5,1 +elif $6==1 fx_compose_average 1,0 +elif $6==2 fx_compose_difference 1,0 +elif $6==3 fx_compose_negation 1,0 +elif $6==4 fx_compose_negation 1,0 +elif $6==5 fx_compose_darkedges 1,1,0.8,1 fi +if $7==0 fx_graphic_novelfxl 0,2,6,5,20,0,0.62,14,0,1,0.5,0.78,1.92,0,0,12,1,1,1,0.5,0.8,1.28,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $7==1 fx_graphic_novelfxl 0,7.2,14.65,5,20,0,1.06,36.14,0,1,0.5,0.85,1.93,0,0,8,1,1,1,0.5,0.95,2.89,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $7==2 fx_graphic_novelfxl 0,7.22892,14.6506,5,20,0,1.6,36.1,0,1,0.5,0.6,3.6,0,0,11,1,1,1,0.5,0.8,2.16,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,7,1,1,1,0.5,0.45,1 +elif $7==3 fx_graphic_novelfxl 0,7.22892,14.6506,5,20,0,1.59036,36.1446,0,1,0.5,0.590361,3.61446,0,1,17,1,1,1,0.5,0.795181,2.16867,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,7,1,1,1,0.5,0.45,1 +elif $7==4 fx_graphic_novelfxl 0,7.22892,14.6506,5,20,0,1.59036,36.1446,0,1,0.5,0.855422,1.92771,0,0,8,1,1,1,0.5,0.373494,2.89157,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $7==5 fx_graphic_novelfxl 1,7.22892,14.6506,5,20,0,1.06024,14,0,1,0.5,0.855422,1.3253,0,0,12,1,1,1,0.5,0.8,1.28,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $7==6 fx_graphic_novelfxl 1,7.22892,14.6506,5,20,0,1.06024,36.1446,0,1,0.5,0.855422,1.92771,0,0,7,1,1,1,0.5,0.951807,1.92771,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $7==7 fx_graphic_novelfxl 1,7.22892,14.6506,5,20,0,1.59036,36.1446,0,1,0.5,0.590361,3.61446,0,1,18,1,1,1,0.5,0.795181,2.16867,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 fi +if $8==1 fx_array_mirror 1,0,0,2,0,$9 +elif $8==2 fx_array_mirror 1,0,0,3,0,$9 fi +fx_seamless_turbulence : +foreach { +wh:=w,h rm +$wh,1,{$6?3:1} rand. 0,255 +$wh rand. {$3*pi/180-$4*10*pi},{$3*pi/180+$4*10*pi} +sin. cos.. a[-2,-1] c +r[-2,-1] 130%,130%,1,100%,0,2,0.5,0.5 b. $2 orientation. +vector2tensor. +smooth.. .,$1,0.5,20 rm. +r. $wh,1,100%,0,0,0.5,0.5 +if $5!=1 ia:=ia - $ia * $5 + $ia fi +} +c 0,255 n 0,255 +_fx_shockwaves : +dct +100%,100%,1,1,1 circle. 0,0,{$2+$3}%,1,{$1+1} circle. 0,0,$2%,1,1 +* idct c 0,255 +fx_shockwaves : +ac "_fx_shockwaves ${1-3}",$4 +fx_shockwaves_preview : +gui_split_preview "fx_shockwaves $*",${-3--1} +fx_sponge : +ac "sponge $1",$2 +fx_sponge_preview : +gui_split_preview "fx_sponge $*",${-3--1} +fx_stained_glass : +foreach { +split_opacity l[0] { +to_rgb +stained_glass $1,$2,$3 +n 0,255 +if $4 equalize. fi +rgb2lab. sh. 1,2 *. $5 rm. lab2rgb. +adjust_colors. ${6-8} +} +a c +} +fx_stained_glass_preview : +gui_split_preview "fx_stained_glass $*",${-3--1} +fx_stars : +foreach { split_opacity stars[0] $1%,$2,$3,$4,$5,$6%,${7-9},{$10/255} a c } +fx_stencil : +if !$5 norm stencil $1,$2,$3 +elif $5==1 stencil $1,$2,$3 +else repeat $! { ++norm. stencil. $1,$2,$3 >=. 50% blend[-2,-1] shapeaverage0 +mv. 0 } fi +if $6 to_rgba replace_color 0,0,0,0,0,255,0,0,0,0 fi +if $4 smooth {30*$4},0,1,1 fi +fx_stencil_preview : +gui_split_preview "fx_stencil $*",${-3--1} +jeje_strip : +theta={pi*$1/180} +f '0.5*i*(1+$4*sin(2*pi*$2*(cos($theta)*x/w+sin($theta)*y/h)+2*pi*$3/180))' +c 0,255 +jeje_strip_preview : +gui_split_preview "jeje_strip $*",$-1 +fx_tetris : +tetris $1 +fx_triangular_pattern : +if !$! 1024,1024,1,3 fi +W,H={0,[w,h]} f:=arg0($14,1,1.5,2,3,4)*100 r[0] $f%,$f%,1,100% +1,1,1,6 +eval " +srand($1); +const pn1 = $3; +const pn2 = $4 + pn1; +const pn3 = $5 + pn2; +const pn4 = $6 + pn3; +const pn5 = $7 + pn4; +C = [ w#0,h#0 ]/2; +da_push([ C,0,h#0-1,0,0 ], +[ C,w#0-1,0,0,0 ], +[ C,w#0-1,0,w#0-1,h#0-1 ], +[ C,0,h#0-1,w#0-1,h#0-1 ]); +repeat($2, +n = int(u(pn5))%pn5; +n = n. $t +f. "u<($4%)^4?i:0" +label_fg. 0,1 voronoi. +if $5<3 +1,1,1,4,"!$5?[0,0,0,255]:$5==1?[255,255,255,255]:$5==2?[128,128,128,0]" +r. [0],[0],1,4 rv[0,-1] rm. +else +blend[0] .,shapeaverage +fi +if $6" && "$10 ++f. "const boundary=1; i!=j(1) || i!=j(0,1)" +dilate. $6 +1,1,1,4,"[${7-9},255]" r. [0],[0],1,4 +j[0] .,0,0,0,0,{$10/255},.. rm[-2,-1] +fi +if $11" && "$15 +1,{iM+1},1,3 eval.. "I[#-1,i]+=[x,y,1]" s. c,-2 /[-2,-1] rm.. +eval. "const r = ($11-1)*arg(1+$16,1,1.5,2,2.5); ellipse(#0,i0,i1,r,r,0,$15/255,[${12-14},255])" +fi +rm. +r $wh,1,100%,2 +} +fx_voronoi_preview : +fx_voronoi ${1-15},{min(1,$16)} +fx_whirls : +ac "whirls $1,$2,$3,$4",$5 +fx_whirls_preview : +gui_split_preview "fx_whirls ${1-5}",${-3--1} +fx_blocks3d : +foreach { +nm=${"-gui_layer_name"} +W,H,M:=w,h,max(w,h) +if w>h r2dx $1 else r2dy $1 fi +w,h,m:=w,h,max(w,h) +if $3>0 mirror y fi +imageblocks3d $3,$2% +-3d. {$w/2},{$h/2} f:=$4*$M/($m*(2-$16)) *3d $f,$f,{$f*abs($3*$1/100)} +if $3>0 r3d 1,0,0,180 fi +r3d 0,0,1,$5 r3d 1,0,0,-$6 +if $16 {2*$M},{2*$M},1,4,-1 else $M,$M,1,4,-1 fi +f3d:=0.5*w/tan($7*pi/360) f3d $f3d +l3d {$10*$f3d},{$11*$f3d},{$12*$f3d} sl3d $13 ss3d $14 +j3d. [0],$8%,$9%,0,1,{$15?3:2},0,1 +sh. 100% +. 1 *. 255 rm. +if $20 +.,.,1,3,-1 +j3d. [0],$8%,$9%,0,1,3,0,1 rm[0] +g. xy,1 +[-2,-1] norm. !=. 0 ++r. 100%,100%,1,3 +sh. 0 *. $17 rm. +sh. 1 *. $18 rm. +sh. 2 *. $19 rm. +j[0] .,0,0,0,0,{$20/255},.. rm[-2,-1] +else rm[0] +fi +replace_color 0,0,-1,-1,-1,0,0,0,0,0 +if $16 r 50%,50%,1,4,2 fi +c 0,255 => "name("$nm")" +} +_fx_coloredobject3d : +to_rgb _fx_coloredobject3d$1$2 ${6-8} col3d. ${3-5} +db3d 0 +fx_coloredobject3d : +_fx_coloredobject3d "_",${1-4,6-8} +repeat $!-1 { ++fx_render3d. {$>,w},{$>,h},$6,${9--1} +sh. 3 *. {$5/255} rm. +blend[$>,-1] alpha +} +rm. +fx_coloredobject3d_preview : +_fx_coloredobject3d "_preview_",${1-4,6-8} +repeat $!-1 { ++fx_render3d. {$>,w},{$>,h},$6,${9--1} +sh. 3 *. {$5/255} rm. +blend[$>,-1] alpha +} rm. +_fx_coloredobject3d_0 : plane3d 1 *3d. $1,$2,1 +_fx_coloredobject3d_1 : box3d 1 *3d. $1,$2,$3 +_fx_coloredobject3d_2 : pyramid3d 1,1 *3d. $1,$2,$3 +_fx_coloredobject3d_3 : sphere3d 1 *3d. 1,{2*$2},{2*$3} +_fx_coloredobject3d_4 : torus3d $1,{$2/2},100,50 *3d. $3,0.5,0.5 +_fx_coloredobject3d_5 : gyroid3d 24 *3d. $1,$2,$3 +_fx_coloredobject3d_6 : weird3d 32 *3d. $1,$2,$3 +_fx_coloredobject3d_7 : cup3d 128 *3d. $1,$2,$3 +_fx_coloredobject3d_preview_0 : plane3d 1 *3d. $1,$2,1 +_fx_coloredobject3d_preview_1 : box3d 1 *3d. $1,$2,$3 +_fx_coloredobject3d_preview_2 : pyramid3d 1,1 *3d. $1,$2,$3 +_fx_coloredobject3d_preview_3 : sphere3d 1 *3d. 1,{2*$2},{2*$3} +_fx_coloredobject3d_preview_4 : torus3d $1,{$2/2},100,50 *3d. $3,0.5,0.5 +_fx_coloredobject3d_preview_5 : gyroid3d 8 *3d. $1,$2,$3 +_fx_coloredobject3d_preview_6 : weird3d 12 *3d. $1,$2,$3 +_fx_coloredobject3d_preview_7 : cup3d 64 *3d. $1,$2,$3 +_fx_elevation3d : +if $3" && "$!>1 +repeat $!-1 { l[0,{1+$>}] { ++ri.. .,3 +n. 0,{abs($1)} *. {sign($1)} b. $2 +elevation3d.. . rm. +} } +else foreach { +norm n. 0,{abs($1)} *. {sign($1)} b. $2 elevation3d.. . rm. } +fi +db3d +fx_elevation3d : +_fx_elevation3d ${1-2},$17 +s0,s1=^,^0 fx_render3d[${s$17}] ${3--1} +fx_elevation3d_preview : +fx_elevation3d ${1-2},{w},{h},${5--1} +if $17 rm[0] fi +_fx_extrude3d : +if $4" && "$!>1 repeat $!-1 { l[0,{$>+1}] { extrude3d. $1,$2,$3% t3d. .. } } +else extrude3d $1,$2,$3% +fi +db3d 0 +fx_extrude3d : +_fx_extrude3d ${1-3},$18 +s0,s1=^,^0 fx_render3d[${s$18}] ${4--1} +fx_extrude3d_preview : +fx_extrude3d ${1-3},{w},{h},${6--1} +if $18 rm[0] fi +_fx_imageobject3d : +to_rgb foreach { _fx_imageobject3d$1$2 } +db3d 0 +fx_imageobject3d : +_fx_imageobject3d "_",$1 fx_render3d ${2--1} +fx_imageobject3d_preview : +w,h={w},{h} _fx_imageobject3d "_preview_",$1 fx_render3d $w,$h,${4--1} +_fx_imageobject3d_0 : imageplane3d +_fx_imageobject3d_1 : imagecube3d +_fx_imageobject3d_2 : imagepyramid3d +_fx_imageobject3d_3 : imagesphere3d 128,64 +_fx_imageobject3d_4 : torus3d 100,30,100,50 t3d. .. rm.. +_fx_imageobject3d_5 : gyroid3d 24 t3d. .. rm.. +_fx_imageobject3d_6 : weird3d 32 t3d. .. rm.. +_fx_imageobject3d_7 : cup3d 128 t3d. .. rm.. +_fx_imageobject3d_8 : imagerubik3d 5,5 +_fx_imageobject3d_preview_0 : imageplane3d +_fx_imageobject3d_preview_1 : imagecube3d +_fx_imageobject3d_preview_2 : imagepyramid3d +_fx_imageobject3d_preview_3 : imagesphere3d 64,32 +_fx_imageobject3d_preview_4 : torus3d 100,30,100,50 t3d. .. rm.. +_fx_imageobject3d_preview_5 : gyroid3d 8 c3d. n3d. t3d. .. rm.. +_fx_imageobject3d_preview_6 : weird3d 12 t3d. .. rm.. +_fx_imageobject3d_preview_7 : cup3d 64 t3d. .. rm.. +_fx_imageobject3d_preview_8 : imagerubik3d 3,3,5,5 +_fx_lathing3d : +if $4" && "$!>1 repeat $!-1 { l[0,{$>+1}] { lathe3d. $1,$2%,$3 t3d. .. } } +else lathe3d $1,$2%,$3 +fi +db3d 0 +fx_lathing3d : +_fx_lathing3d ${1-3},$18 +s0,s1=^,^0 fx_render3d[${s$18}] ${4--1} +=> "pos(0,0),mode(alpha)" +fx_lathing3d_preview : +fx_lathing3d ${1-3},{w},{h},${6--1} +if $18 rm[0] fi +fx_mesh3d : skip "${1=},${2=}" +filename="$1" +old_filename="$2" +xx,xy,yx,yy,sx,sy,cx,cy,ocx,ocy,rotx,roty,rotz,rendering_mode,face_orientation,materials,recR,recG,recB,focale,antialias,lx,ly,reset_pos=${3-26} +R=30 +show_bb:=!$rendering_mode +if $reset_pos xx,xy,yx,yy,sx,sy,cx,cy,ocx,ocy:=50+$R,50,50,50+$R,60,60,50,50,-1,-1 fi +if $! W,H=${-max_wh} else W,H=1024,1024 fi +0 => $filename ext={x} rm. +if e=['$ext'];['$filename']!=0" && "e!='obj'" && "e!='off'" && "e!='gmz' +gui_error_preview "Specified filename '"$filename"' is invalid\n(extension '"$ext"' is not supported)." +return +fi +if $ocx>0" && "[$cx,$cy]!=[$ocx,$ocy] ncx,ncy=$ocx,$ocy else ncx,ncy=$cx,$cy fi +ux,uy,vx,vy,sx,sy:="C = [$ncx,$ncy]; [ [$xx,$xy] - C,[$yx,$yy] - C,[$sx,$sy] - C ]" +Ux,Uy,Uz,Vx,Vy,Vz,Wx,Wy,Wz:=" +const R = $R; +const R2 = 2*R; +coords3d(x,y) = ( +_t = atan2(y,x); _n = norm(x,y); +_s = int(_n/R)%2?1:-1; _mn = _n%R2; _n = _mn0?_U/_nU:[ 0,0,-1 ]; +); +U = coords3d($ux,$uy); +V = coords3d($vx,$vy); +W = cross(U,V); W/=norm(W); +nV = cross(W,U); nV/=norm(nV); +dot(nV,V)<0?(nV*=1); +[ U,nV,W ]" +vx,vy:="($Vz<0?1:2/norm($Vx,$Vy) - 1)*$R*[$Vx,$Vy]" +l[] { +if ['$filename']==['$old_filename']" && "narg($_persistent) $_persistent +elif ['$filename']!=0 $filename +boundingbox3d. +store _persistent +else +torus3d 100,40,32,17 s3d r.. 3,{h#2/3},1,1,-1 f.. y%2?160-20*x:128+50*x y a y +=> "Default Torus" +boundingbox3d. +store _persistent +fi +if $show_bb k. else rm. fi +} +nbv,nbp:=i[6],i[7] +obj_name={b} +fact:=min($W,$H)*norm($sx,$sy)/$R +n3d. c3d. *3d. $fact +if $rotx r3d. 1,0,0,{45*$rotx} fi +if $roty r3d. 0,1,0,{45*$roty} fi +if $rotz r3d. 0,0,1,{45*$rotz} fi +pose3d. $Ux,$Vx,$Wx,0,$Uy,$Vy,$Wy,0,$Uz,$Vz,$Wz,0 +is_double:=$face_orientation==2 +if $face_orientation==1 rv3d. fi +foc:=$fact*$focale% +if $materials<2 p3d. 2 if !$materials col3d. $recR,$recG,$recB fi fi +nlx,nly,nlz:=isnan($lx)?[$W*$cx%,$H*$cy%,-5e8]:[$W*($cx+4*($lx-$cx))%,$H*($cy+4*($ly-$cy))%,-10*$foc] +if 0$_is_preview +j3d[0] .,$cx%,$cy%,0,1,{$rendering_mode>0?$rendering_mode-1:1},$is_double,1,$foc,$nlx,$nly,$nlz rm. +else +afact:=arg0($antialias,1,1.5,2,3,4) +if $afact>1 foc*=$afact *3d. $afact fi +{[$W,$H]*$afact},1,3,-0.1 +j3d. ..,$cx%,$cy%,0,1,{$rendering_mode>0?$rendering_mode-1:1},$is_double,1,$foc,$nlx,$nly,$nlz rm.. +to_rgba. replace_color. 0,0,-0.1,-0.1,-0.1,255,0,0,0,0 r. $W,$H,1,4,2 +if 0$_output_mode>0 k. else blend alpha fi +fi +if 0$_is_preview +line[0] $cx%,$cy%,{$cx+$ux}%,{$cy+$uy}%,1,255,0,0 +line[0] $cx%,$cy%,{$cx+$vx}%,{$cy+$vy}%,1,0,255,0 +line[0] $cx%,$cy%,{$cx+$sx}%,{$cy+$sy}%,1,0xF0F0F0F0,255,128,64 +line[0] $cx%,$cy%,{$cx+$sx}%,{$cy+$sy}%,1,0x0F0F0F0F,128,64,255 +to[0] "[ "$obj_name" ]\nVertices: "$nbv"\nPrimitives: "$nbp,0,0,4% +fi +=>[0] "name("$obj_name"),pos(0,0)" +u "{"$filename"}{"$filename"}""{"{[$cx+$ux,$cy+$uy]}"}{"{[$cx+$vx,$cy+$vy]}"}{"{[$cx+$sx,$cy+$sy]}"}{"$cx,$cy"}{"$cx"}{"$cy"}""{"$rotx"}{"$roty"}{"$rotz"}{"$rendering_mode"}{"$face_orientation"}{"$materials"}""{"$recR,$recG,$recB"}{"$focale"}{"$antialias"}{"$lx,$ly"}{"$reset_pos"}" +fx_mesh3d_preview : skip "${1=},${2=}" +if !$! $_preview_area_width,$_preview_area_height,1,4 +else gui_merge_layers fi +drgba +_is_preview=1 +fx_mesh3d $"*" +fx_random3d : +foreach { +f3d:=0.5*max(w,h)/tan($5*pi/360) f3d $f3d l3d {$6*$f3d},{$7*$f3d},{$8*$f3d} sl3d $9 ss3d $10 +to_rgb ({w},{h},{d},{s}) /. 2 +repeat $2 { +({1,@0}) +. {1,@1} *. $3 /. 100 _fx_random3d$1 {^} rm.. +r3d. 1,1,0,{u(0,360)} +({v}) *. {1,@0} ({v}) *. {1,@1} ++3d... {-2,^},{^},{u(-$4,$4)} rm[-2,-1] +col3d. {u(255)},{u(255)},{u(255)} +} ++3d[2--1] j3d[0] .,50%,50%,0,$12,$11,0,1 k[0] +} +_fx_random3d0 : box3d $1 +_fx_random3d1 : ($1) /. 2 cone3d {^},$1 rm.. +_fx_random3d2 : ($1) /. 2 cylinder3d {^},$1 rm.. +_fx_random3d3 : sphere3d $1,2 +_fx_random3d4 : ($1) /. 3 torus3d $1,{^} rm.. +fx_memoakten_algorithm_a_preview : +fx_memoakten_algorithm_a $* +gui_crop_resize_preview +fx_memoakten_algorithm_a : +seed,point_density,rate_ps,rate_ss,max_occ,centering,msl,Msl,angt,thickness,color_density,antialias,Rf,Gf,Bf,Rb,Gb,Bb,R0,G0,B0,R1,G1,B1,R2,G2,B2,R3,G3,B3=${1-30} +fa:=arg0($antialias,1,1.5,2) +foreach { +nm={n} W,H={w},{h} rm srand $seed +$W,$H noise_poissondisk. {max(8,min(w,h)/max(2,$point_density))} +1,1,1,2 eval.. "begin(da_push(#1,[0,0],[$W - 1,0],[$W - 1,$H - 1],[0,$H - 1])); i?da_push(#1,[x,y])" rm.. +1,1,1,2 +1,{"max(1,round($rate_ps*da_size(#0)%))"},1,1,">"${-math_lib}" +begin( +const mwh = min($W,$H); +da_push(#1,[0,1],[1,2],[2,3],[3,0]); +nb_pts = da_size(#0) +); +do ( +do (p0 = round(u(nb_pts - 1)); p1 = round(u(nb_pts - 1)), p0==p1); +P0 = I[#0,p0]; P1 = I[#0,p1], +!inrange(norm(P0 - P1),mwh*$msl%,mwh*$Msl%) +); +is_valid = 1; +repeat (da_size(#1),k, +S = I[#1,k]; q0 = S[0]; q1 = S[1]; +Q0 = I[#0,q0]; Q1 = I[#0,q1]; +is_valid&=!do_intersect(P0[0],P0[1],P1[0],P1[1],Q0[0],Q0[1],Q1[0],Q1[1]); +!is_valid?break(); +); +is_valid?(da_push(#1,[p0,p1])); +" rm. +channels. 0,2 +1,{"max(1,round($rate_ss*da_size(#1)))*100"},1,1,">"${-math_lib}" +const cmin = lerp(0,0.5,$centering%); +const cmax = lerp(1,0.5,$centering%); +const mwh = min($W,$H); +const angt = 1 - $angt%; +nb_seg = da_size(#1); +do (s0 = round(u(nb_seg - 1)); s1 = round(u(nb_seg - 1)), +s0==s1 || i(#1,0,s0,0,2)>$max_occ || i(#1,0,s1,0,2)>$max_occ); +S0 = I[#1,s0]; S1 = I[#1,s1]; +P0 = I[#0,S0[0]]; P1 = I[#0,S0[1]]; dP = P1 - P0; nP = norm(dP); ndP = dP/nP; +Q0 = I[#0,S1[0]]; Q1 = I[#0,S1[1]]; dQ = Q1 - Q0; nQ = norm(dQ); ndQ = dQ/nQ; +R0 = round(lerp(P0,P1,u(cmin,cmax))); +R1 = round(lerp(Q0,Q1,u(cmin,cmax))); +dR = R1 - R0; nR = norm(dR); ndR = dR/nR; +inrange(nR,mwh*$msl%,mwh*$Msl%) && abs(dot(ndR,ndP))y>=4?(S = I; polygon(#-1,2,$fa*I[#0,S[0]],$fa*I[#0,S[1]],1,0))" +k. +srand $seed ++label_fg. 0,0 +1,{iM+1},1,6,[0,0,y,0,0,0] eval.. ">++i[#-1,i]" sh. 0 area_max:=iM rm. +f. "[ i0*u(0.25,1),i0,y,0,0,0 ]" sort. +,y channels. 1,100% +f. "begin(N = max(1,h*$color_density%)); +y>N || i0<8 || i0>=$area_max?[i0,i1,$Rb,$Gb,$Bb]:( +rand = u; +rand<0.25?[i0,i1,$R0,$G0,$B0]: +rand<0.5?[i0,i1,$R1,$G1,$B1]: +rand<0.75?[i0,i1,$R2,$G2,$B2]: +[i0,i1,$R3,$G3,$B3] +)" +channels. 1,100% sort. +,y channels. 1,100% +point. 0,0,0,1,$Rf,$Gf,$Bf +map.. . rm. +==.. 0 +if $thickness<=3 dilate[0] $thickness else dilate_circ[0] $thickness fi +f. "i(#0)?[$Rf,$Gf,$Bf]:I" rm.. +r $W,$H,1,3,2 => $nm +} +fx_ball : +ball $1,${5-7},${2-4} +if $!>1 mv. 0 =>[0] "name(Ball),pos("{``{0,0.5*([${-max_wh}]-[w,h])}}")" else =>[0] "name(Ball)" fi +fx_ball_preview : +fx_ball $* +if $!>1 rv[-2,-1] blend[-2,-1] alpha fi +fx_circle_art : +if !$2 f 0 return fi +if !$1 +{round(2*($2^1.5))} +rand. -1,1 +rand. -1,1 +rand. -$3,$3 a[-3--1] y +else +{max(1,round($2*$7))} +t0:=$8*2*pi/180 +rows. 0,2 +f. "r = x/(w-1); +t = 2*pi*x/$2; +!y?(r^$11)*cos("$t0"+$13*t): +y==1?(r^$12)*sin("$t0"+$14*t): +max(0,$3*($9+($10-$9)*r))" +fi +l. { +transpose s x,-1 h:=h +i[0] ({'CImg3d'},{2*$h},$h) +++... . -[-4,-2] i .. i[-3,-1] 1,100% a[-6--1] x +1,$h,1,1,5 1,$h,1,1,2*y ++. 1 a[-3--1] x z. 0,5 +3,$h,1,1,1 1,$h,1,1,-1 y a y +} +repeat $!-1 { l[$>,-1] { +s={0,max(w,h)} rm[0] +if $5 {2*$s},{2*$s} +*3d[0] $s +else $s,$s +*3d[0] {$s/2} +fi +j3d[1] [2],50%,50%,0,1,2,0,0 rm[2] +%. $4 +if $6 i.. 100%,100%,1,3 rand.. 0,255 plasma.. 1,1 equalize.. 256 n.. 0,255 blend[-2,-1] shapeaverage fi +rv +} } +rm. +n 0,255 +if $5 r 50%,50%,1,100%,2 fi +fx_equation_parametric : +foreach { +w,h={w},{h} rm +$5,1,1,2,"t = $3 + x*($4-$3)/($5-1); !c?$1:$2" +channels. 0,2 +($8,$11^$9,$12^$10,$13) r. {-2,w},1,1,3,3 a c +display_parametric $w,$h,{$6+$14*1.001},$7,$15,$16 +} +fx_equation_plot : +foreach { +w,h={w},{h} rm +$4,1,1,$5,"X=$2+($3-$2)*x/($4-1);$1" +dg $w,$h,$6,$7,$2,$3 +} +fx_generate_random_portrait : +file_tmp=${-path_tmp}fx_random_portrait.png +if $! rm[0] fi +if isfile(['{/$file_tmp}']) $file_tmp r2dx. $1 delete $file_tmp +else +portrait[] $1 +fi +mv. 0 +fx_generate_random_portrait_preview : +file_tmp=${-path_tmp}fx_random_portrait.png +if $! rm[0] fi ++portrait[] $1 o. $file_tmp mv. 0 +fx_corner_gradient : skip ${17=0} +foreach { +wh:=w,h rm +($1,$5;$9,$13^$2,$6;$10,$14^$3,$7;$11,$15^$4,$8;$12,$16) +_gb_fwd $17 +r. $wh,1,100%,3 +_gb_bwd $17 +} +fx_custom_gradient_preview : skip "${15=}" +foreach { +if $4 ++_fx_custom_gradient1 ${1-14},"$15",${16--1} +erode. 3 -[-2,-1] +dilate. 5 a[-2,-1] c n. 0,255 +fx_custom_gradient[0] ${1-14},"$15",${16--1},-1 blend alpha +else fx_custom_gradient ${1-14},"$15",${16--1},-1 +fi +if $14 ++_fx_custom_gradient0[] ${1-14},"$15",${16--1} r. {{0,w}-16},16,1,4 frame. 1,1,0 j[0] .,8,{0,h-25} rm. +fi +} +fx_custom_gradient : skip "${15=}" +_fx_custom_gradient0 ${1-14},"$15",${16--1} +if $-1>=0" && "narg("$15") +dir_ggr=${-path_gimp}gradients +0 => ${"normalize_filename \"$15\""} name_ggr={b} rm. output_ggr. $dir_ggr/$name_ggr.ggr,"$15" +fi +i.. (0^0^0^0) a[-2,-1] x +repeat $!-1 { l[$>,-1] { +_fx_custom_gradient1[0] ${1-14},"$15",${16--1} ++distance[0] 1,$11 +distance[0] 0,$11 *. -1 +[0] 1 +[0,-2,-1] +m,M={0,[$9%*im,$10%*iM]} +-[0] $m *[0] {1,(w-2)/($M-$m)} +[0] 1 +round[0] map[0] . +} } +rm. +_fx_custom_gradient0 : +if $16 4,8,1,1,${18-56} permute. yzcx +else 8,1,1,3 srand $17 rand. 0,255 to_rgba. +fi +z. 0,{$5-1} +if $13 +r. {200*$6}%,1,1,4,0,2 +__fx_custom_gradient0. $12,$8 +shift. {-round(w*0.5*$7%)},0,0,0,2 z. 0,{w/2-1} +else +__fx_custom_gradient0. $12,$8 +r. {100*$6}%,1,1,4,0,2 shift. {-round(w*$7%)},0,0,0,2 +fi +__fx_custom_gradient0 : +if $1==1 sh. 0,2 rgb2hsv. rm. +elif $1==2 sh. 0,2 srgb2rgb. rgb2lab. rm. +fi +r. {$2*w},1,1,4,3 +if $1==1 sh. 0,2 hsv2rgb. rm. +elif $1==2 sh. 0,2 lab2rgb. rgb2srgb. rm. +fi +_fx_custom_gradient1 : +b $2% +if !$1 +to_a split_opacity +if iM>im+32 +rm.. >=[0] {100-$3}% +else +rm. norm n 0,1 +if ia>0.5 <=[0] $3% else >=[0] {100-$3}% fi +fi +elif $1==1 +remove_opacity norm <= $3% +elif $1==2 +remove_opacity norm >= {100-$3}% +else +to_a channels 100% >= {100-$3}% +fi +fx_line_gradient : skip "${10=}" +_fx_line_gradient $* +if narg("$10") +dir_ggr=${-path_gimp}gradients +0 => ${"normalize_filename \"$10\""} name_ggr={b} rm. output_ggr. $dir_ggr/$name_ggr.ggr,"$10" +fi +r 100%,64,1,100% +fx_line_gradient_preview : +foreach { +to_rgba +if $9 +_fx_line_gradient $* fi +l[0] { +line $1%,$2%,$3%,$4%,1,0xF0F0F0F0,255,255,255,255 +line $1%,$2%,$3%,$4%,1,0x0F0F0F0F,0,0,0,255 +} +if $!>1 r. {{0,w}-32},32,1,4,1 frame. 1,1,0,0,0,255 j[0] [1],16,{{0,h}-48} rm. fi +} +_fx_line_gradient : +at_line $1%,$2%,0,$3%,$4%,0 r {max(0.1,$5)}%,1,1,100%,1 +m "feature1 : channels 0" +m "feature2 : channels 1" +m "feature3 : channels 2" +m "feature4 : to_rgb luminance" +m "feature5 : to_rgb rgb2ycbcr channels 1" +m "feature6 : to_rgb rgb2ycbcr channels 2" +m "feature7 : to_rgb srgb2rgb rgb2lab channels 0" +if $7 foreach { +feature$7 rv a y sort +,x rows 1 } fi +if $6 r $6,1,1,100%,3 fi +if $8 mirror x fi +fx_linear_gradient : skip ${13=0} +foreach { +wh:=w,h rm +($1^$2^$3^$4) ($5^$6^$7^$8) +if $9 rv[-2,-1] fi +r $wh +_gb_fwd $13 +fade_linear $10,$11,$12 +_gb_bwd $13 +} +fx_radial_gradient : skip ${14=0} +foreach { +wh:=w,h rm +($1^$2^$3^$4) ($5^$6^$7^$8) +if $9 rv[-2,-1] fi +r $wh +_gb_fwd $14 +100%,100% =. 1,$12%,$13% distance. 1 _fade $10,$11 +_gb_bwd $14 +} +fx_random_gradient : +foreach { +to_rgba 100%,100% srand $2 +eval "repeat ($1,n, +x = round(u(w-1)); +y = round(u(h-1)); +i(x,y) = 1; +i(#0,x,y,0,0) = round(u(255)); +i(#0,x,y,0,1) = round(u(255)); +i(#0,x,y,0,2) = round(u(255)); +i(#0,x,y,0,3) = $7*255 + (1-$7)*round(u(255)); +)" +if $7!=1 sh.. 100% n. 0,255 rm. fi +==. 0 +sh.. 0,2 srgb2rgb. rm. +inpaint_pde.. [1],100%,1 rm. +b $3% n 0,255 +sh 0,2 rgb2srgb. balance_gamma. ${4-6} rm. +} +gtutor_hairlock : +($4^$5^$6) +rgb2hsl. +hue={i[0]} +sat={0.97*i[1]} +light={i[2]} +opac={$7/255} +var={0.1*$8} +rm. +repeat $! +l[$>] ++diffusiontensors. 1,0,0.1,{8*$1},0 +diffusiontensors.. 0,1,0.1,{20*$1},0 +eigen[-2,-1] +rm. +s. c +rm. +*. -1 ++. +n. 0,1 +mv. 0 +s.. c +rm... +*.. -1 ++.. 1 ++*.. 0 +rv[-1,-2] +a[-3,-2] c +eigen2tensor[-2,-1] +100%,100%,1,3 +_hcolor. $hue,$sat,$light,$var,{0.05+0.5*$2},0.98,1 +dilate_circ. {2+2*$2} ++luminance. +gt. 0.01 +*[-4,-1] +n. 0,255 +replace_color. 0,0,0,0,0,$4,$5,$6 +rv[-2,-1] +repeat 3 +smooth[-3,-2] .,{5+595*$3} +done +rm. +rv[-2,-1] +sharpen. {1.2*(1-$2)} +n. 0,1 ++_hlight. $9,$10,1 +*. ... ++[-3,-1] ++_hlight. $9,$10,$11 +...,...,...,...,255,255,255 +image[-4] .,0,0,0,0,1,.. +k[-4,-3] +n. 0,{51*(1+4*$opac)} +a[-2,-1] c +n. 0,255 +done +done +gtutor_hairlock_preview : +gui_split_preview "gtutor_hairlock ${^0}",$-1 +_hlight : check "${1=45}<=360 && $1>=0 && ${2=0.5}>=0 && ${3=0.5}>=0" +if $2>0 +r2dx. 400%,5 +b. 2,1 +gradient_orientation. 2 +a[-2,-1] c +({cos(2*$1*pi/360)}^{sin(2*$1*pi/360)}) +r. ..,..,.,.,1 +*[-2,-1] +compose_channels. + +cut. {ia},{iM} +n. {195*$3-200},0 +exp. +r2dx. 25%,5 +n. 0,{$2} +else +fill_color. 0 +fi +to_rgb. +#@cli _hcolor : h_mean,s_mean,l_mean,var,density,coverage,is_mod +#@cli : Plot in selected images impulses centered around h,s,l means +/- var +#@cli : at relative 0<=density<=1 wrt 1/2 image area: related to density=1 +#@cli : coverage: wrt image area, relative coverage 0<=coverage<=1 smaller +#@cli : values give rise to unplotted regions around edges equal 1.0-coverage. +#@cli : is_mod, boolean, if true, wraps negative values around to one. +#@cli : Default values: mean=40,var=0,density=0.5,coverage=1,is_mod=True +_hcolor : skip ${1=40},${2=0.5},${3=0.5},${4=0},${5=0.5},${6=1},${7=1} +repeat $! +l[$>] +pcnt={0.5*w*h*$5} +{$pcnt},1,1,1,({0,w}*(1-$6)/2)+{0,w}*$6*u +{$pcnt},1,1,1,({0,h}*(1-$6)/2)+{0,h}*$6*u +{$pcnt},1,1,1 +ra={$1/360.0} +if $7 +{$pcnt},{s},1,1,360.0*($ra+$4*(2*g-1))%1 +{$pcnt},{s},1,1,($2+$4*(2*g-1))%1 +{$pcnt},{s},1,1,($3+$4*(2*g-1))%1 +else +{$pcnt},{s},1,1,360.0*($ra+$4*(2*g-1)) +{$pcnt},{s},1,1,$2+$4*(2*g-1) +{$pcnt},{s},1,1,$3+$4*(2*g-1) +fi +a[^0] y +pointcloud. 0,{-2,w},{-2,h},1,{-2,s} +rm.. +hsl2rgb. +done +done +fx_hypotrochoid : +{0,[w,h]*($10?1.5:1)} +eval " +const M = min(w,h)/2; +const A = M*$2%; +const B = A*$3%; +const H = B*$4%; +const S = M*$5%; +const F = (A - B)/max(1e-5,B); +const AmB = A - B; +hypotrochoid(t) = (_t = t; round([ w/2 + AmB*cos(_t) + H*cos(F*_t), h/2 + AmB*sin(_t) - H*sin(F*_t) ])); +oX = hypotrochoid(t); +dt = 1; +for (t = 0, t<$1*2*pi, +do ( +X = hypotrochoid(t + dt); +dist = abs(X[0] - oX[0]) | abs(X[1] - oX[1]); +!dist?(dt*=2): +dist>1?(dt/=1.25): +(t+=dt), +dist!=1; +); +S<1?(I(X) = $9):ellipse(X,S,S,0,1,$9); +oX = X; +)" +r. [0],[0],1,1,2 +channels. -3,0 sh. 0,2 fc. ${6-8} rm. +blend[0,-1] alpha +fx_lightning : +foreach { +100%,100% +l. { +fact:=max(w,h)/$3*$2% srand $11 +repeat $1 { +if $!<=1 +i=0 +new_level=1 +new_length=$3 +new_x=0 +new_y=0 +new_angle=$14 +else +i:=round(u(1,max(1,($!-1)*$6))) +level={$i,@-2} +angle={$i,@-1} +nb_points={$i,i[6]} +p:=round(($nb_points-2)*u($17%,$18%)) +new_level:=$level+1 +new_length:=max(2,round(($nb_points-$p)*u($19%,$20%))) +new_x={$i,i[8+3*$p]} +new_y={$i,i[9+3*$p]} +new_angle:=$angle+u($21,$22)*(u>0.5?1:-1) +fi +_fx_lightning $new_length,$4,$5 +r3d. 0,0,1,$new_angle ++3d. $new_x,$new_y ++*3d. $fact [0],[0] j3d. ..,$12%,$13%,0,1,1,0,0 rm.. +dilation:=$15*($23>0?1.5:10)^($23*($new_level-1)) +blur:=max(0,-1+(1+$16)*($24>0?2:5)^($24*($new_level-1))) +opacity:=min(1,$10/255*(2^($25*($new_level-1)))) +dilate. $dilation b. $blur% n. 0,1 *. $opacity max[0,-1] +($new_level;$new_angle) a[-2,-1] y +progress {($>*100)/($1-1)} +} +k[0] * 255 i[0] 100%,100%,1,3 fc[0] ${7-9} a c +} +rv +} +fx_lightning_preview : +foreach { fx_lightning $* rv blend alpha } +_fx_lightning : +l[] { +({'CImg3d'},$1,{$1-1}) +1,$1 noise. $2,1 cumulate. b. $3 shift. 0,1 1,100%,1,1,y 1,100% a[-3--1] x +1,{h-1},1,1,2 +f. y ++. 1 a[-3--1] x +4,100%,1,1,1 +y a y +} +fx_lissajous : +foreach { +to_rgba +{w},{h} +f3d {0.5*max(w,h)/tan($4*pi/360)} +lissajous3d $1,$5,$8,$6,$9,$7,$10 +r3d. 0,0,1,$13 r3d. 0,1,0,$12 r3d. 1,0,0,$11 +*3d. {0.5*$2*{-2,w}},{0.5*$3*{-2,h}},{0.5*$4*max({-2,w},{-2,h})} +col3d. 1 j3d.. .,50%,50%,0,1,1,0,0 rm. +distance. 1 >. $14% *.. . ==. 0 +r. 100%,100%,1,4 +sh. 0 *. $15 rm. +sh. 1 *. $16 rm. +sh. 2 *. $17 rm. +sh. 3 *. $18 rm. ++[-2,-1] +} +fx_mandelbrot : +if !narg($_size) _size:=max(w,h) fi +rm $_size,$_size +mandelbrot ${1-4},$6,{$5?[1,$7,$8]:[0,0,0]} +srand $11 $9,1,1,3 rand. 0,255 r. {$9*$10},1,1,3,3 point. 0 map.. .,3 rm. +fx_mandelbrot_preview : +_size:=min(${-gui_preview_wh}) +if "$15 || $16 || $17" +x0,y0,x1,y1:="P0 = [${1,2}]; +dP = [${3,4}] - P0; +C = P0 + [${12,13}]%*dP; +zfact = $14*($15?1:$16?0:-2); +dC = 0.5*dP*(1 - 0.98*zfact); +[C - dC,C + dC]" +status=\{$x0\}\{$y0\}\{$x1\}\{$y1\}\{$5\}\{$6\}\{$7\}\{$8\}\{$9\}\{$10\}\{$11\}\{50,50\}\{$14\}\{0\}\{0\}\{0\}\{$18\} +px,py=50 +else +x0,y0,x1,y1=${1-4} +status= +px,py=${12,13} +fi +fx_mandelbrot $x0,$y0,$x1,$y1,${5--1} +x0r,y0r,x1r,y1r:="C = ["$px,$py"]%*w; dC = 0.5*w*(1 - 0.98*$14); round([C - dC, C + dC - 1])" +rectangle $x0r,$y0r,$x1r,$y1r,0.7,0xF0F0F0F0,255,255,255,255 +rectangle $x0r,$y0r,$x1r,$y1r,0.7,0x0F0F0F0F,0,0,0,255 +if $18 to "Z0 = ( "{_$x0}" , "{_$y0}" )\nZ1 = ( "{_$x1}" , "{_$y1}" )",2,2,16 fi +u $status +fx_neon_lightning : +d:=$13*255 +foreach { +100%,100%,1,4 rm[0] +repeat $7 { +x0:=max(0,min(w,$1+u(-$3,$3))) y0:=max(0,min(h,$2+u(-$3,$3))) +x1:=max(0,min(w,$4+u(-$6,$6))) y1:=max(0,min(h,$5+u(-$6,$6))) +u0,v0,u1,v1:=u([0,0,0,0],[100,100,100,100]) +R:=max(0,min(255,u($10-$d,$10+$d))) +G:=max(0,min(255,u($11-$d,$11+$d))) +B:=max(0,min(255,u($12-$d,$12+$d))) +spline $x0%,$y0%,$u0%,$v0%,$x1%,$y1%,$u1%,$v1%,1,$R,$G,$B,1 +} +s c,-3 +b[0] 3% +distance. 1 *. -1 c. -{$9+1e-5},0 n. 0,1 sqrt. ++b. $8%,1 n. 0,1 sqrt. n[-2,-1] 0,255 max[-2,-1] +. blend[0,1] value +smooth 5,0,1,0.5,2,10,0 +/. 255 ^. $14 *. 255 +a c c 0,255 +} +fx_newton_fractal : skip "${6=},${7=},${8=},${22=},${25=},${28=}" +foreach { +if !narg($_size) _size:=max(w,h) fi +rm +antialias:=arg(1+$33,1,1.5,2,2.5,3,3.5,4) +{$antialias*[$_size,$_size]} +if $5==1 +pz="z^^2 - 1" dpz="2*zn" d2pz="2" +elif $5==2 +pz="z^^3 - 1" dpz="3*z^^2" d2pz="6*z" +elif $5==3 +pz="z^^5 - 1" dpz="5*z^^4" d2pz="20*z^^3" +elif $5==4 +pz="z^^6 + z^^3 - 1" dpz="6*z^^5 + 3*z^^2" d2pz="30*z^^4 + 6*z" +elif $5==5 +pz="z^^8 + 15*z^^4 - 1" dpz="8*z^^7 + 60*z^^3" d2pz="56*z^^6 + 180*z^^2"; +else +pz="$6" dpz="$7" d2pz="$8" +fi +if !narg($pz) pz="[1,0]" fi +if !narg($dpz) dpz="[1,0]" fi +if !narg($d2pz) d2pz="[1,0]" fi +newton_fractal ${1-4},$38,$9,$10,{10^-$11},$pz,$dpz,$d2pz +if $12==1 +channels 100% +srand $15 $13,1,1,3 rand. 0,255 r. {$13*$14},1,1,3,3 point. 0 map.. .,3 rm. +elif $12==2 +f "[ atan2(i1,i0),1,i2 ]" s c n... {[$17,$18]*360%} n. {[$19,$20]%} c. 0,1 a c +${"arg0 $16,hsi,hsl,hsv"}2rgb +else +if $22 +s c,-2 +if $22&1 equalize 1024 fi +if $22&2 /[-2] {-2,max(1e-5,abs(im),abs(iM))} n. 0,1 fi +a c +fi +f "*begin( +p(z) = ("$pz"); +dp(z) = ("$dpz"); +d2p(z) = ("$d2pz"); +); +z = [ i0,i1 ]; +[ (0;$23),(0;$24),(0;$25) ]" +if $26 +s c +if $26&1 equalize 1024 fi +if $26&2 normalize 0,1 fi +a c +fi +* 255 mod 256 +if $21 ${"arg $21,hsi8,hsl8,hsv8,lab8"}2rgb fi +fi +r2dx $_size +if $32 ac "+equalize 1024 j.. .,0,0,0,0,{$32%} rm.",ycbcr_y fi +adjust_colors ${27-31},0,0,0,255 +} +fx_newton_fractal_preview : skip "${6=},${7=},${8=},${22=},${25=},${28=}" +is_custom_expression:=$5?1:2 +is_color_by_custom:=$12?0:2 +is_color_by_iter:=$12==1?2:0 +is_color_by_value:=$12==2?2:0 +_size0:=min(${-gui_preview_wh}) +_size:=$_size0/arg(1+$44,1,1.5,2,2.5,3,3.5,4) +angle=$38 +if "$39 || $40 || $41" +x0,y0,x1,y1:="P0 = [${1,2}]; +dP = [${3,4}] - P0; +M = P0 + 0.5*dP; +C = P0 + [${35,36}]%*dP; +C = M + rot(-$38°)*(C - M); +zfact = $37*($39?1:$40?0:-2); +dC = 0.5*dP*(1 - 0.98*zfact); +[ C - dC, C + dC ]" +px,py=50 +elif $42 +x0,y0,x1,y1=-2,-2,2,2 +px,py=50 +angle=0 +else +x0,y0,x1,y1=${1-4} +px,py=${35,36} +fi +fx_newton_fractal $x0,$y0,$x1,$y1,$5,"$6","$7","$8",${9-22},"$23","$24","$25",${26-32},0,${34-37},$angle,${39--1} +foreach { +r2dx $_size0,1 +x0r,y0r,x1r,y1r:="C = [ "$px,$py" ]%*w; dC = 0.5*w*(1 - 0.98*$37); round([ C - dC, C + dC - 1 ])" +rectangle $x0r,$y0r,$x1r,$y1r,0.7,0xF0F0F0F0,255,255,255,255 +rectangle $x0r,$y0r,$x1r,$y1r,0.7,0x0F0F0F0F,0,0,0,255 +if $43 to "Z0 = ( "{_$x0}" , "{_$y0}" )\nZ1 = ( "{_$x1}" , "{_$y1}" )",2,2,16 fi +} +u "{"$x0"}{"$y0"}{"$x1"}{"$y1"}{$5}""{$6}_"$is_custom_expression"{$7}_"$is_custom_expression"{$8}_"$is_custom_expression"{$9}{$10}{$11}{$12}""{$13}_"$is_color_by_iter"{$14}_"$is_color_by_iter"{$15}_"$is_color_by_iter"{$16}_"$is_color_by_value"{$17}_"$is_color_by_value"{$18}_"$is_color_by_value"{$19}_"$is_color_by_value"{$20}_"$is_color_by_value"{$21}_"$is_color_by_custom"{$22}_"$is_color_by_custom"{$23}_"$is_color_by_custom"{$24}_"$is_color_by_custom"{$25}_"$is_color_by_custom"{$26}_"$is_color_by_custom"{$27}{$28}{$29}{$30}{$31}{$32}{$33}""{$34}"_{$33?2:0}"{"$px,$py"}{$37}{"$angle"}{0}{0}{0}{0}{$43}{$44}" +fx_plasma : skip ${4=0},${5=0} +if $5 to_rgba else to_rgb fi +if $4 rand 0,255 fi +plasma $1,$2,$3 n 0,255 +balance_gamma ${6-8} +fx_quick_copyright : +i[0] 0 t[0] "$1",0,0,$2,1,$3,$4,$5 autocrop[0] 0 r[0] {{0,w}+2*$7},{{0,h}+2*$7},1,3,0,0,0.5,0.5 +i[1] 0 t[1] "$1",0,0,$2,1,1 autocrop[1] 0 r[1] {{1,w}+2*$7},{{1,h}+2*$7},1,1,0,0,0.5,0.5 dilate[1] {1+2*$7} +rotate[0,1] {90*($10-1)} +repeat $!-2 { +if !$8 j. [0],$9,$9,0,0,{$6/255},[1] +elif $8==1 j. [0],{w-1-{0,w}-$9},$9,0,0,{$6/255},[1] +elif $8==2 j. [0],$9,{h-1-{0,h}-$9},0,0,{$6/255},[1] +else j. [0],{w-1-{0,w}-$9},{h-1-{0,h}-$9},0,0,{$6/255},[1] +fi +mv. 2 +} +rm[0,1] +fx_rainbow : +foreach { +100%,100% spline. 0,$1%,100,{-$3}%,100%,$2%,100,$4%,1,1 +flood. 0,0,0,0,0,1,1 flood. {w-1},0,0,0,0,1,1 +distance. 0 c. 0,255 n. 0,{$5*255} +palette rainbow +luminance. c. 0,{min(100,200-$6)}% n. 0,255 a[-2,-1] c +map.. . rm. +if $6<100 sh. 3 *. {$6/100} rm. fi +blend alpha +} +fx_shadebobs : +channels 0 f 0 +foreach { +t=0 +repeat $3 { +repeat $1 { +r:=$6+$5*cos(6*$7*$t)+(1-$5)*sin(6*$8*$t) +a:=(360*sin($7*$t)+30*$6*$>)*pi/180 +ax:=2*$>*pi/$1+$t +cx:=(1+$9*cos($ax)+$r*cos($a))*w/2 +cy:=(1+$9*sin($ax)+$r*sin($a))*h/2 +ellipse. $cx,$cy,$2%,$2%,0,-1,1 +} +t+=$4% +} +} +& 255 if $10 map {$10-1} fi +fx_sine_curve : +preset,previous_preset,resolution,periods,dp,ratx,raty,ratz,mxa,mya,mza,mxb,myb,mzb,oxa,oya,oza,oxb,oyb,ozb,pxa,pya,pza,pxb,pyb,pzb,sxa,sya,sza,sxb,syb,szb,rotx,roty,rotz,zoom,focale,xc,yc,prev_xc,prev_yc,xr,yr,xa,ya,prev_xa,prev_ya,radius1,radius2,opacity,colR,colG,colB,antialiasing,preview_background=${1-55} +if !narg($_is_preview) _is_preview=0 fi +if [$prev_xc,$prev_yc]!=[$xc,$yc] +xr,yr,xa,ya,prev_xa,prev_ya+=d=[$xc,$yc]-[$prev_xc,$prev_yc];[d,d,d] +fi +if [$prev_xa,$prev_ya]!=[$xa,$ya] +delta_a:=" +a = [ "$xa" - "$xc", "$ya" - "$yc" ]; +b = [ "$prev_xa" - "$xc", "$prev_ya" - "$yc" ]; +(atan2(a[1],a[0]) - atan2(b[1],b[0]))*180/pi; +" +xr,yr:=[$xc,$yc]+rot($delta_a°)*[$xr-$xc,$yr-$yc] +else delta_a=0 fi +if [$colR,$colG,$colB]==[0,0,0]" && "$preview_background==1 colR,colG,colB=255 +elif [$colR,$colG,$colB]==[255,255,255]" && "$preview_background==2 colR,colG,colB=0 +fi +update_params=0 +if $preset!=$previous_preset +periods=1 +ratx,raty,ratz=0.5,0.5,0 +mxa,mxb,mya,myb,mza,mzb=1,1,1,1,0,1 +oxa,oxb,oya,oyb,oza,ozb=90,90,0,0,0,0 +pxa,pxb,pya,pyb,pza,pzb=1 +sxa,sxb,sya,syb,sza,szb=0 +rotx,roty,rotz,zoom,focale=0,0,0,2,8 +if !$preset +ratx,raty,ratz=0 zoom=1 +elif $preset==1 +mxa,mxb,mya,myb=1,800,1,800 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 oxa,oxb,oya,oyb=90,90,0,60 +elif $preset==2 +mxa,mxb,mya,myb=1,200,1,150 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +elif $preset==3 +mxa,mxb,mya,myb=9,512,1024,9 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +elif $preset==4 +mxa,mxb,mya,myb=80,1,80,1 pxa,pxb,pya,pyb=1,3,1,3 +elif $preset==5 +ratz=0.8 mza,mzb=7,1024 pza,pzb=1.6,2 rotz=45 zoom=1 focale=4 +elif $preset==6 +mxa,mxb,mya,myb=80,1,1,80 pxa,pxb,pya,pyb=1,3,1,3 +elif $preset==7 +mxa,mxb,mya,myb=150,1,1,100 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +elif $preset==8 +mxa,mxb,mya,myb=1,80,80,80 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +elif $preset==9 +mxa,mxb,mya,myb=2,200,200,1 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +elif $preset==10 +mxa,mxb,mya,myb=1,800,1,800 pxa,pxb,pya,pyb=1,3,1,3 +elif $preset==11 +mxa,mxb,mya,myb=1,10,1,10 +elif $preset==12 +mxa,mxb,mya,myb=1,400,1,200 pxa,pxb,pya,pyb=1,3,1,3 sxa,sxb,sya,syb=1,1,0,0 +elif $preset==13 +mxa,mxb,mya,myb=1,800,800,2 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +elif $preset==14 +mxa,mxb,mya,myb=1,30,1,60 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +elif $preset==15 +mxa,mxb,mya,myb=500,1,1,500 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +elif $preset==16 +mxa,mxb,mya,myb=1,80,80,1 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +elif $preset==17 +mxa,mxb,mya,myb=1,80,1,40 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +elif $preset==18 +ratx=0.6 mxa,mxb,mya,myb=9,400,200,9 pxa,pxb,pya,pyb=1,3,1,4 sxa,sxb,sya,syb=0,1,0,2 +fi +fi +W,H:=w#0?[w#0,h#0]:0$_is_preview" && "0$_preview_area_width?[0$_preview_area_width,0$_preview_area_height]:[1024,1024] +nresolution:=max(1,round($periods*1000000*($resolution%)^2)) +nfocale:=arg($focale,0.05,0.1,0.2,0.3,0.4,0.5,0.75,1,1.25,1.5,1.75,2,3,4,8,16,32,128,1024,16384) +noxa,noxb,noya,noyb,noza,nozb:=[$oxa,$oxb,$oya,$oyb,$oza,$ozb]*pi/180 +nantialiasing:=arg0($antialiasing,1,1.25,1.5,2,3) +rW,rH:=[$W,$H]*$nantialiasing +l[] { +$nresolution,1,1,2,"* +begin( +const is_rot = "$rotx" || "$roty" || "$rotz"; +ref(rot(1,0,0,"$rotx"°),Rx); +ref(rot(0,1,0,"$roty"°),Ry); +ref(rot(0,0,1,"$rotz"°),Rz); +R = mul(Rz,mul(Ry,Rx,3),3); +const ang = atan2("$ya" - "$yc","$xa" - "$xc"); +const cosa = cos(ang); +const sina = sin(ang); +const c = 35; +const dxr0 = "$xr" - "$xc"; +const dyr0 = "$yr" - "$yc"; +const dxr = cosa*dxr0 + sina*dyr0; +const dyr = -sina*dxr0 + cosa*dyr0; +const _dx = abs(dxr)/c; const dx = 2.5*c*(_dx<1?_dx:_dx^3); +const _dy = abs(dyr)/c; const dy = 2.5*c*(_dy<1?_dy:_dy^3); +); +cpow(x,p,s) = ( +ref(x,_x); +(!s?sign(_x):s==1?-sign(_x):s==2?-1:1)*abs(_x)^p +); +t = x/w*2*pi*"$periods"; +X = lerp(cpow(sin("$mxa"*t + "$noxa"),"$pxa","$sxa"), +cpow(sin("$mxb"*t + "$noxb"),"$pxb","$sxb"), +"$ratx"); +Y = lerp(cpow(sin("$mya"*t + "$noya"),"$pya","$sya"), +cpow(sin("$myb"*t + "$noyb"),"$pyb","$syb"), +"$raty"); +Z = lerp(cpow(sin("$mza"*t + "$noza"),"$pza","$sza"), +cpow(sin("$mzb"*t + "$nozb"),"$pzb","$szb"), +"$ratz"); +X*=dx%; +Y*=dy%; +is_rot?(P = R*[ X,Y,Z ]; X = P[0]; Y = P[1]; Z = P[2]); +X*="$nfocale"; +Y*="$nfocale"; +Z = max(1e-5,Z + 1 + "$nfocale"); +pX = X/Z; +pY = -Y/Z; +ang?(X = cosa*pX - sina*pY; pY = sina*pX + cosa*pY; pX = X); +const ax = "$zoom*$rW"; const bx = "$xc*$rW"%; +const ay = "$zoom*$rH"; const by = "$yc*$rH"%; +[ ax*pX + bx, ay*pY + by ]" +$rW,$rH +eval.. "* +const mwh = min(w#-1,h#-1)*5%; +const r1 = max(0.01,mwh*"$radius1"%); +const r2 = max(0.01,mwh*"$radius2"%); +const Mr = max(r1,r2); +const opacity = ("$opacity"%)^3; +X = R; Y = G; +Mr<0?( +i(#-1,X,Y) = lerp(i(#-1,X,Y),1,opacity); +):( +pX = i(x - 1,0,0,0); +pY = i(x - 1,0,0,1); +dX = X - pX; +dY = Y - pY; +ang = atan2(dY,dX)*180/pi; +ellipse(#-1,X,Y,r1,r2,ang°,opacity,255); +); +I" +rm.. +r. $W,$H,1,1,2 n 0,255 +i[0] 100%,100%,1,3 fc[0] $colR,$colG,$colB +a[-2,-1] c +} +if 0$_is_preview +if $!==1 i[0] $W,$H,1,3 fi +if $preview_background [0],[0] f. {$preview_background==1?0:255} to_rgb. rv[0,-1] rm. fi +blend[0,-1] alpha +line. $xc%,$yc%,$xr%,$yr%,0.75,0xF0F0F0F0,238,0,85 +line. $xc%,$yc%,$xr%,$yr%,0.75,0x0F0F0F0F,255 +line. $xc%,$yc%,$xa%,$ya%,0.75,0xF0F0F0F0,238,85,0 +line. $xc%,$yc%,$xa%,$ya%,0.75,0x0F0F0F0F,0 +fi +mv. 0 +if 0$_output_mode k[0] fi +r,m,o,p,s,a:=d=$dp;[!d?2:0,d==1?2:0,d==2?2:0,d==3?2:0,d==4?2:0,d==5?2:0] +u "{"$preset"}{"$preset"}{"$resolution"}{"$periods"}{"$dp"}""{"$ratx"}_"$r"{"$raty"}_"$r"{"$ratz"}_"$r"{"$mxa"}_"$m"{"$mya"}_"$m"{"$mza"}_"$m"{"$mxb"}_"$m"{"$myb"}_"$m"{"$mzb"}_"$m"{"$oxa"}_"$o"{"$oya"}_"$o"{"$oza"}_"$o"{"$oxb"}_"$o"{"$oyb"}_"$o"{"$ozb"}_"$o"{"$pxa"}_"$p"{"$pya"}_"$p"{"$pza"}_"$p"{"$pxb"}_"$p"{"$pyb"}_"$p"{"$pzb"}_"$p"{"$sxa"}_"$s"{"$sya"}_"$s"{"$sza"}_"$s"{"$sxb"}_"$s"{"$syb"}_"$s"{"$szb"}_"$s"{"$rotx"}_"$a"{"$roty"}_"$a"{"$rotz"}_"$a"{"$zoom"}_"$a"{"$focale"}_"$a"{"$xc,$yc"}{"$xc"}{"$yc"}{"$xr,$yr"}{"$xa,$ya"}{"$xa"}{"$ya"}{"$radius1"}{"$radius2"}{"$opacity"}""{"$colR,$colG,$colB"}{"$antialiasing"}""{"$preview_background"}" +fx_sine_curve_preview : +_is_preview=1 +fx_sine_curve $* +k[0] +fx_superformula : +foreach { +to_rgba +{w},{h} +f3d {0.5*max(w,h)/tan($4*pi/360)} +superformula3d $1,${4-7} +r3d. 0,0,1,$10 r3d. 0,1,0,$9 r3d. 1,0,0,$8 +*3d. {0.5*$2*{-2,w}},{0.5*$3*{-2,h}} +col3d. 1 j3d.. .,50%,50%,0,1,1,0,0 rm. +distance. 1 >. $11% *.. . ==. 0 +r. 100%,100%,1,4 +sh. 0 *. $12 rm. +sh. 1 *. $13 rm. +sh. 2 *. $14 rm. +sh. 3 *. $15 rm. ++[-2,-1] +} +fx_symmetric_shape2d : +if !narg($_is_preview) _is_preview=0 fi +foreach { +100%,100%,1,4 _fx_symmetric_shape2d. $* rv +if !0$_is_preview" && "0$_output_mode rm. fi +} +_fx_symmetric_shape2d : +(${10-21}) f. "isnan(i)?-1024:i" discard. -1024 r. 2,{h/2},1,1,-1 permute. cyzx +f. "x = R - $2; y = G - $3; [ atan2(y,x), norm(x,y) ]" +l. { n:=h .x{$1-1} a y f "const pi2 = 2*pi; [ (R + int(y/"$n")*pi2/$1)%pi2, G ]" sort +,y } +f. "[ $2*w#-2,$3*h#-2 ]/100 + [ G*cos(R), G*sin(R) ]*(min(w#-2,h#-2)-1)%" permute. cyzx +coords={^} rm. +if $22 polygon {narg($coords)/2},$coords,1,${23-25},{$26*255%} +else polygon {narg($coords)/2},$coords,1,0xFFFFFFFF,${23-25},{$26*255%} +fi +fx_symmetric_shape2d_preview : +_fx_symmetric_shape2d_preview $* +_fx_symmetric_shape2d_preview : +_is_preview=1 +cx1,cy1,cx2,cy2,cx3,cy3,cx4,cy4,cx5,cy5,cx6,cy6=${10-21} +angx,angy=$6,$7 +if [$2,$3]!=[$4,$5]" || "[$angx,$angy]!=[$8,$9] +dx,dy:=[$2-$4,$3-$5] +repeat 6 { i:=1+$> +cx$i,cy$i:=" +const cx = "${cx$i}"; +const cy = "${cy$i}"; +dang = atan2($7 - $3,$6 - $2) - atan2($9 - $3,$8 - $2); +dsca = norm($6 - $2,$7 - $3)/norm($9 - $3,$8 - $2); +[ $2,$3 ] + dsca*rot(dang)*[ cx - $4, cy - $5 ]" +} +angx,angy:=[$6+$2-$4,$7+$3-$5] +fi +foreach { +r {s=min(w,h);[s,s]},1,100%,0,0,0.5,0.5 +fx_symmetric_shape2d ${1-9},$cx1,$cy1,$cx2,$cy2,$cx3,$cy3,$cx4,$cy4,$cx5,$cy5,$cx6,$cy6,${22-26} +rv blend alpha +eval " +t0 = atan2($7 - $3,$6 - $2); +repeat ($1,k, +const pi2 = 2*pi; +const xc = $2*(w-1)%; +const yc = $3*(h-1)%; +x = xc + (w+h)*cos(t0 + 2*pi*k/$1); +y = yc + (w+h)*sin(t0 + 2*pi*k/$1); +polygon(-2,xc,yc,x,y,0.35,0xF0F0F0F0,255); +polygon(-2,xc,yc,x,y,0.35,0x0F0F0F0F,0); +)" +} +u "{$1}"\ +"{$2,$3}"\ +"{$2,$3}"\ +"{"$angx,$angy"}"\ +"{"$angx,$angy"}"\ +"{"$cx1,$cy1"}"\ +"{"$cx2,$cy2"}"\ +"{"$cx3,$cy3"}"\ +"{"$cx4,$cy4"}"\ +"{"$cx5,$cy5"}"\ +"{"$cx6,$cy6"}"\ +"{$22}"\ +"{$23,$24,$25}"\ +"{$26}" +cl_tangentialCircle: +showBig,radi,dime,wid,nb,lvl,backR,backG,backB,foreR,foreG,foreB,effect=$* +grow=3 +dimens={$radi*$grow} +rectWid={if($dime==1||$dime==2,w,$dimens)} +rectHei={if($dime==1||$dime==2,h,$dimens)} +chanNumb={if($effect,4,3)} +$rectWid,$rectHei,1,$chanNumb,255 +radius={if($dime==2,$radi/300*min(w,h),$radi)} +local. +xC={w/2} +yC={h/2} +if $effect==1 +backR,backG,backB=$foreR,$foreG,$foreB +elif $effect>=7 +backR,backG,backB=255,255,255 +foreR,foreG,foreB=0,0,0 +fi +foreA=255 +backA={if($effect==1,0,255)} +if $showBig==1 +cl_circ. $xC,$yC,$radius,$wid +else +n. 0,255 +fi +cl_innerCirc. $xC,$yC,$radius,$wid,$nb,$lvl +blend screen,1 +n. 0,1 +if $effect<=1 +fill. [i*$foreR+(1-i)*$backR,i*$foreG+(1-i)*$backG,i*$foreB+(1-i)*$backB,i*$foreA+(1-i)*$backA] +elif $effect==2 +fx_rodilius. 15,1,0,$nb,90,0,1,0,0 +n. 0,1 +fill. [i*$foreR+(1-i)*$backR,i*$foreG+(1-i)*$backG,i*$foreB+(1-i)*$backB,i*$foreA+(1-i)*$backA] +n. 0,255 +elif $effect==3 +fx_curvature 10,0,100,0,0 +fx_gradient2rgb 0,0,100,0,0 +apply_curve 1,0,0,16,240,255,255 +fx_smooth_antialias. 15,0,1,0,50,50 +fx_smooth_antialias. 50,50,2.5,0,50,50 +elif $effect==4 +fx_dog 1.4,1.5,0,0,0 +fx_gradient2rgb 0,0,100,0,0 +apply_curve 1,0,0,64,192,255,255 +fx_smooth_antialias. 15,0,1,0,50,50 +fx_smooth_antialias. 50,50,2.5,0,50,50 +elif $effect==5 +dog. 1.4,1.5 +remove_opacity. +n. 0,255 +elif $effect==6 +fx_dog. 1.4,1.5,0,0,0 +apply_curve. 1,0,0,16,0,255,255 +cut. 0,255 +fx_distance. 0,2,1,0 +negate. [-1] [-1] +fx_decompose_channels 8,1,1,0 +l. ++apply_curve. 1,0,0,240,16,255,255 +l. +b. 2.5 +gradient2rgb. 0 n. 0,255 +[-1] +rgb2hsv[-2,-1] split[-2,-1] c +l[-3--1] +[-3] {315} %[-3] 360 done +l[-6--4] +[-3] {135} %[-3] 360 done +l[-3--1] a c hsv2rgb s c done +l[-6--4] a c hsv2rgb s c done +rm[^-6,-3] +negate.. +/ 2 ++. 128 +blend grainmerge,1 +done +to_rgb +blend grainmerge,1 +done +fx_smooth_antialias. 15,0,1,0,50,50 +fx_smooth_antialias. 50,50,2.5,0,50,50 +sharpen 300 +elif $effect>=7 +fill. [i*$foreR+(1-i)*$backR,i*$foreG+(1-i)*$backG,i*$foreB+(1-i)*$backB,i*$foreA+(1-i)*$backA] +remove_opacity. +split. c rm. rm.. ++fx_morphological. 0,2,10,"1,0,1; 0,1,0; 1,0,1",0,0,0,0 ++fx_morphological. 0,2,20,"1,0,1; 0,1,0; 1,0,1",0,0,0,0 +if $effect==8 reverse[-3,-1] fi +a c +fi +done +mv[-1] 0 +if $dime==3 resize[0] {min(w,h)/3}%,{min(w,h)/3}%,1,$chanNumb,5 fi +average_colors : average_vectors +covariance_colors : covariance_vectors +median_color : +u {"expr('med(crop(#-1,0,0,0,y,w#-1,h#-1,d#-1,1))',1,3)"} +gui_rep_tfrac: +srand $35 +if !$2 rep_thorn_fractal $1,${3-14} +else +if $2==1 formulas="$15","$16" +elif $2==2 formulas="$15","$16","$17","$18" +elif $2==3 formulas="$15","$16","$17","$18","$19","$20" +elif $2==4 formulas="$15","$16","$17","$18","$19","$20","$21","$22" +elif $2==5 formulas="$15","$16","$17","$18","$19","$20","$21","$22","$23","$24" +fi +if $25 +if $26 rep_thorn_fractal {-1*$2},${3-14},$formulas,"$27","$28","$29","$30",{$31*($32?-1:1)} +else rep_thorn_fractal {-1*$2},${3-14},$formulas,"$27","$28",{$31*($32?-1:1)} +fi +else rep_thorn_fractal {-1*$2},${3-14},$formulas +fi +fi +if $33==0 n 0,255 +elif $33==1 n 0,360 r 100%,100%,100%,3 f [i0,1,1] hsv2rgb +else n 0,1 $34,1,1,1 f. u(x/w#-1,(x+1)/w#-1) n. 0,16777215 r. 100%,100%,1,3 f. [i0-256*floor(i0/256),floor(i0/256)-256*floor(floor(i0/256)/256),i0/(256^2)] r. 4096,1,100%,100%,5 r[^-1] 100%,100%,100%,3 f[^-1] i(#-1,i0*w#-1,0,z,c,2) rm. +fi +gui_rep_tfrac_preview: +gui_rep_tfrac ${1-14},"$15","$16","$17","$18","$19","$20","$21","$22","$23","$24",$25,$26,"$27","$28","$29","$30",${31-35} +set_a={$2>=1?2:0} +set_b={$2>=2?2:0} +set_c={$2>=3?2:0} +set_d={$2>=4?2:0} +set_e={$2>=5?2:0} +set_f={$2?($25&&abs($31)?2:1)} +set_g={$2?($26&&abs($31)?($25?2:1):1)} +set_h={$2?($25?2:1)} +set_i={$33==2?2:0} +u "{$1}_"{!$2?2:1}"{$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}""{$9}""{$10}""{$11}""{$12}""{$13}""{$14}""{$15}_"$set_a"{$16}_"$set_a"{$17}_"$set_b"{$18}_"$set_b"{$19}_"$set_c"{$20}_"$set_c"{$21}_"$set_d"{$22}_"$set_d"{$23}_"$set_e"{$24}_"$set_e"{$25}_"{$2?2}"{$26}_"$set_f"{$27}_"$set_f"{$28}_"$set_f"{$29}_"$set_g"{$30}_"$set_g"{$31}_"$set_h"{$32}_"$set_h"{$33}""{$34}_"$set_i"{$35}_"$set_i +rep_generate_thorn_fractal_expression_generator: +v1,v2,started=0 +previous_r_choice=-1 +if u<.5 status a symbol,mode=a,0 +else status b symbol,mode=b,1 +fi +do +v2+=1 +if u<$v1||$v2>6 +if $started break fi +else +v1:=$v1+u(-.2,.2) +r:=u(13.1) +r_choice:=int(u(0,4,1,0)) +if $r_choice==$previous_r_choice +if u<.5 r_choice=($r_choice+1)%4 +else r_choice=($r_choice-1)%4 +fi +fi +if $mode symbol,mode=a,0 +else symbol,mode=b,1 +fi +if $r<1 status cos(${}) +elif $r<2 status sin(${}) +elif $r<3 status tan(${}) +elif $r<4 status logabs(${}) +elif $r<5 status norm(${},$symbol) +elif $r<6 status sqr(${}) +elif $r<7 status ${}/${arg\ 1+$r_choice,cos($symbol),sin($symbol),tan($symbol),logabs($symbol)} +elif $r<8 status ${}*${arg\ 1+$r_choice,cos($symbol),sin($symbol),tan($symbol),logabs($symbol)} +elif $r<9 status ${}+${arg\ 1+$r_choice,cos($symbol),sin($symbol),tan($symbol),logabs($symbol)} +elif $r<10 status ${}-${arg\ 1+$r_choice,cos($symbol),sin($symbol),tan($symbol),logabs($symbol)} +elif $r<11 status ${arg\ 1+$r_choice,cos($symbol),sin($symbol),tan($symbol),logabs($symbol)}/${} +elif $r<12 status abs(${}) +elif $r<13 status avg($symbol,${}) +else status (${}) +fi +previous_r_choice=$r_choice +started=1 +fi +while !((u<$v1&&$v2>1)||$v2>6) +('${}') +fill[-1] >"begin( +const _a=_'a'; +const _b=_'b'; +separators='(,)'; +mode=0; +old_char=0; +previous_a_b_char=0; +); +if(isin(i,_a,_b), +back_char=j(-1); +front_char=j(1); +if((back_char==separators[0]||back_char==separators[1])&&(front_char==separators[1]||front_char==separators[2]), +mode?( +check_with_previous_a_b_char=i==previous_a_b_char; +if(check_with_previous_a_b_char, +if(i==_a +,previous_a_b_char=_b;_b; +,previous_a_b_char=_a;_a; +); +,previous_a_b_char=i;i; +); +):( +mode=1; +previous_a_b_char=i; +i; +); +,i); +,i); +" +out={t} +remove[-1] +status $out +_fx_tree: +recursion_depth,random_seed,xratio,yratio,trunk_thickness,base_thickness,trunk_angle,avg_branching,std_branching,avg_leftangle,avg_rightangle,std_angle,avg_length,std_length,avg_thickness,std_thickness,Rt,Gt,Bt,At,Ot,Rl,Gl,Bl,Al,Ol,gammaRGBA,gammaO=${1-28} +W,H,S:=w,h,min(w,h) +l[] { +if $2 srand $2 fi +1,1,1,9," +const h_thickness = "$trunk_thickness"%/2; +const hb_thickness = h_thickness*"$base_thickness"%; +R = rot("$trunk_angle"°); +C = [ 0.5,0 ]; +P0 = C + R*[ -hb_thickness,0 ]; +P1 = C + R*[ hb_thickness,0 ]; +P2 = C + R*[ h_thickness,0.5 ]; +P3 = C + R*[ -h_thickness,0.5 ]; +[ P0,P1,P2,P3,0 ]" +repeat $recursion_depth { +1,8,1,9 +eval.. "> +const dangle = "$avg_rightangle" - "$avg_leftangle"; +ref(I,val); +ref(val[0,2],P0); +ref(val[2,2],P1); +ref(val[4,2],P2); +ref(val[6,2],P3); +ndepth = val[8] + 1; +A = (P0 + P1)/2; +B = (P2 + P3)/2; +AB = B - A; +thickness = norm(B - P2); +N = round(cut("$avg_branching" + v*"$std_branching",1,6)); +Nm1 = N<=1?1:N - 1; +repeat (N,n, +ang = cut("$avg_leftangle" + dangle*n/Nm1 + v*"$std_angle",-90,90); +len = cut("$avg_length" + u(-1,-1)*"$std_length",0,200); +rot = rot(ang°); +nB = B + len%*rot*AB; +orth = (nB - B); +orth/=norm(orth); +orth = [ -orth[1],orth[0] ]; +nthickness = thickness*("$avg_thickness" + v*"$std_thickness")%; +Q0 = nB + nthickness*orth; +Q1 = nB - nthickness*orth; +da_push([ P3,P2,Q1,Q0,ndepth ]); +); +end(resize(#-1,1,da_size(),1,s#-1,0)); val" +} +a y +1,100%,1,4,"[ i0#-1,i2#-1,i4#-1,i6#-1 ]" +1,100%,1,4,"[ i1#-2,i3#-2,i5#-2,i7#-2 ]" +sx,sy:=10^[$xratio,$yratio] +-.. 0.5 *.. {-2,$S*$sx/(2.1*max(abs(iM),abs(im)))} +.. {$W/2} *. {$S*$sy/(1.05*max(iM))} +f... "round([ i0#-2,i0#-1,i1#-2,i1#-1,i2#-2,i2#-1,i3#-2,i3#-1,i8 ])" +rm[-2,-1] +eval "ref(I,T); P0 = T[0,2]; P1 = T[2,2]; P2 = T[4,2]; P3 = T[6,2]; +I[0] = [ lerp(P0,P2,-2),lerp(P1,P2,-2),P2,P3,0 ]" +$W,$H,1,4 +eval.. "> +begin( +RGBAt = [ "$Rt,$Gt,$Bt,$At" ]; +RGBAl = [ "$Rl,$Gl,$Bl,$Al" ]; +const gRGBA = 10^"$gammaRGBA"; +const gO = 10^"$gammaO"; +); +ref(I,val); +t = val[8]/"$recursion_depth"; +RGBA = lerp(RGBAt,RGBAl,t^gRGBA); +O = lerp("$Ot,$Ol",t^gO)%; +polygon(#-1,4,val[0,8],O,RGBA); +(i0==i2 && i1==i3) || (i4==i6 && i5==i7)?polygon(#-1,2,i0,i1,i4,i5,O,RGBA); +val" +mirror xy +rm.. +} +fx_tree : +_fx_tree. $* mv. 0 +if 0$_output_mode k[0] fi +fx_tree_preview : +foreach { _fx_tree $* blend alpha } +fx_turbulence : +remove_opacity turbulence ${^0} +fx_twisted_rays : +xcenter,ycenter,branches,angle,twist,focale,R,G,B,A,is_antialias=${1-11} +foreach { +Mwh,offx,offy:="const Mwh = max(w,h); [ Mwh,(Mwh - w)/2,(Mwh - h)/2 ]" +xc,yc:=[$xcenter,$ycenter]%*[w,h]+[$offx,$offy] ++shape_rays $Mwh,$xc,$yc,$branches,$angle%,{$twist%},{$focale%},$is_antialias r. ..,..,1,100%,0,0,0.5,0.5 +100%,100%,1,4 fc. $R,$G,$B,$A sh. 100% *. ... rm[-3,-1] +blend alpha +} +fx_animate_preview : skip ${4=1},${5=0},${6=$5} +repeat $! { +if $5 width=$5 else width:=w fi +if $6 height=$6 else height:=h fi +if $4 s. x,2 else . fi +-$1.. $2 -$1. $3 +r[-2,-1] {max(w,{-2,w})},{max(h,{-2,h})},1,100%,3 +if !$4 columns.. 0,50% columns. 50%,100% fi +a[-2,-1] x r. $width,$height,1,100%,2 drgba. +line. 50%,0,50%,100%,1,0,0,0,255 +to. "Start",3,-1,13,2,1,255 to. "End",{w-24},{h-18},13,2,1,255 +mv. 0 } +banding_denoise_v2 : +if !$5 _banding_denoise_v2 $* +else +ts:=arg($5,64,128,256,512,1024,2048) +apply_tiles "_banding_denoise_v2 $*",$ts,$ts,1,20%,20%,1,3 +fi +_banding_denoise_v2 : +foreach { split_opacity l[0] { ++bilateral $3,$4 bilateral. $3,$4 -.. . +fftpolar.. +polygon... 4,0,{(h/2)+1},{50-$1}%,{(h/2)+1},{50-$1}%,{(h/2)-1},0,{(h/2)-1} +polygon... 4,{50+$1}%,{(h/2)+1},{w},{(h/2)+1},{w},{(h/2)-1},{50+$1}%,{(h/2)-1} +polygon... 4,{(w/2)+1},0,{(w/2)+1},{50-$2}%,{(w/2)-1},{50-$2}%,{(w/2)-1},0 +polygon... 4,{(w/2)-1},{h},{(w/2)+1},{h},{(w/2)+1},{50+$2}%,{(w/2)-1},{50+$2}% +ifftpolar[-3,-2] ++ c 0,255 +} a c } +banding_denoise_v2_preview : +if $6==0 gui_split_preview "banding_denoise_v2 $*",${-3--1} +else foreach { remove_opacity +banding_denoise_v2 ${1--1} - * 6 + 128 c 0,255 } +fi +banding_denoise: +repeat 2 +bilateral[-1] $3,$4 keep[0,-1] done ++compose_grainextract[0,1] +fftpolar[-1] +polygon[-2] 4,0,{(h/2)+1},{50-$1}%,{(h/2)+1},{50-$1}%,{(h/2)-1},0,{(h/2)-1} +polygon[-2] 4,{50+$1}%,{(h/2)+1},{w},{(h/2)+1},{w},{(h/2)-1},{50+$1}%,{(h/2)-1} +polygon[-2] 4,{(w/2)+1},0,{(w/2)+1},{50-$2}%,{(w/2)-1},{50-$2}%,{(w/2)-1},0 +polygon[-2] 4,{(w/2)-1},{h},{(w/2)+1},{h},{(w/2)+1},{50+$2}%,{(w/2)-1},{50+$2}% +ifftpolar[-1,-2] +compose_grainmerge[1,2] +keep[-1] +banding_denoise_preview: +if $5==0 +banding_denoise ${1--1} +else ++banding_denoise ${1--1} +compose_grainextract[0,1] +-[-1] 128 *[-1] 5 +[-1] 128 +fi +#@cli afre_cleantext : 0<=clean<=10,0.2<=_range<=1,0<=_black<=100,0<=_white<=100 +#@cli : Clean scanned text. +#@cli : Default values: 'clean=8', 'range=1', 'black=80' and 'white=95'. +afre_cleantext : check "${1=8}>=0 && ${2=1}>=0.2 && ${3=80}>=0 && ${4=95}>=0 && +$1<=10 && $2<=1 && $3<=100 && $4<=100" +e[] "[afre]^_^) cleantext: Clean scanned text using clean=$1, range=$2, black=$3 and white=$4." +c={int(11-$1)*2+1} +dilate $c erode. $c - n 0,255 +retinex , norm n 0,1 f 1-gauss(i,$2) +if $3!=$4 c $3%,$4% else c $3%,{$4+0.5}% fi n 0,255 round +afre_cleantext_preview : +afre_cleantext $* +fx_deinterlace : +deinterlace 0 skip ${^0} +fx_deinterlace_preview : +gui_split_preview "fx_deinterlace $*",${-3--1} +gcd_deinterlace2x : skip ${1=40},${2=0},${3=0},${4=2},${5=0},${6=1} +if $3 +ca={if($5,1,h/w)} na={arg($3,1,{4/3},{5/4},{16/9},{1.6},{2.35},{1.85})} +r {$ca*$na*w},100%,1,3,{arg($4+1,3,5,6)} c 0,255 +fi if $2==3 return fi +repeat $! l[$>] +w={w} h={h} d={d} hh={int($h/2)} rgb2yuv s c +l[0] +shift 0,-1 r $w,$hh,$d,1,4 done +l[-2,-1] r $w,2,$d,$hh,-1 +shift 0,0,0,-1 r $w,2,$d,50%,4 r $w,$hh,$d,1,-1 done +a[0,2,3] c a[^0] c yuv2rgb +if $2==0 scale_dcci2x ,,1 r 50%,100%,1,3,4 +elif $2==1 gcd_upscale_edge 2 r 50%,100%,1,3,4 +else +a={2/3} b={-1/12} ($b,$a,$b;$b,$a,$b;0,0,0) +convolve[^-1] . rm... +r 100%,200%,1,3,4 shift[-2,-1] 0,1 +[-3,-1] +[-3,-1] +fi +c 0,255 shift. 0,1 +- +norm. a={-192^-.5/$1} ($a,$a,$a;$a,0,$a;$a,$a,$a) +convolve.. . rm. max. -1 +. 1 *[-2,-1] -[0,-1] rm. +done done +gcd_deinterlace2x_preview : +gcd_deinterlace2x ${1},{if($6,max(2,$2),$2)},${3--1} +fx_denoise : +if $3 delete ${-path_cache}gmic_denoise_cnn.gmz fi +repeat $2 { denoise_cnn $1,64 progress {round(($>+1)/$2*100)} } +fx_denoise_preview : +r2din 280,280,0,0,0.5,0.5 +gui_split_preview "fx_denoise $*",${-3--1} +#@cli afre_denoisesmooth : radius>=1,_amount>=1 +#@cli : Denoise noisy image, or smooth low noise image. +#@cli : \ \ Command is slow when the 'radius' and 'amount' are high. +#@cli : \ \ Start small and increase as appropriate.\n +#@cli : Default values: 'radius=3 and amount=25'. +afre_denoisesmooth : check "${1=3}>=1 && ${2=25}>=1" +e[] "[afre]^_^) denoisesmooth: Denoise noisy image, or smooth low noise image$? using radius=$1 and amount=$2.\n\ * Command is slow when the 'radius' and 'amount' are high.\n\ \ \ Start small and increase as appropriate." +repeat $! l[$>] r={[im,iM]} +. repeat $1 +normp. 1 afre_gui1_fast.. .,{$>+1} rm. done +repeat $2 afre_gui1_fast.. . done rm. +c $r done done +afre_denoisesmooth_preview : +afre_denoisesmooth $* +#@cli afre_denoisesmooth_alt : radius>=1,_amount>=1 +#@cli : Denoise noisy image, or smooth low noise image. +#@cli : \ \ Command is slow when the 'radius' and 'amount' are high. +#@cli : \ \ Start small and increase as appropriate.\n +#@cli : Default values: 'radius=3 and amount=25'. +afre_denoisesmooth_alt : check "${1=3}>=1 && ${2=25}>=1" +e[] "[afre]^_^) denoisesmooth_alt: Denoise noisy image, or smooth low noise image$? using radius=$1 and amount=$2.\n\ * Command is slow when the 'radius' and 'amount' are high.\n\ \ \ Start small and increase as appropriate." +repeat $! l[$>] r={[im,iM]} +. repeat $1 +normp. 1 afre_gui1_fast.. .,{$>+1},,0 rm. done +repeat $2 afre_gui1_fast.. .,,,0 done rm. +c $r done done +afre_denoisesmooth_alt_preview : +afre_denoisesmooth_alt $* +fx_pahlsson_descreen : skip $* +pahlsson_descreen +fx_pahlsson_descreen_preview : +gui_split_preview "fx_pahlsson_descreen 0",$-1 +pahlsson_descreen : +repeat $! l[$>] split_opacity l[0] to_rgb +rgb2cmyk +split c +name[-4] C +pahlsson_descreen_channel[-4] +name... M +pahlsson_descreen_channel... +name.. Y +pahlsson_descreen_channel.. +name. K +pahlsson_descreen_channel. +append c +cmyk2rgb +done a c done done +pahlsson_descreen_channel : +basename={0,b} +name[0] original +crop1=0,0,{original,w-1},{original,h-1},0 +crop2=0,{original,h},100%,100%,0 +float2fft8[original] +name[original] fft +i [fft] +name.. real +name. imaginary +crop[real] $crop1 +crop[imaginary] $crop2 +i [real] +name. mask +dog[mask] 0.5%,0.8% +normalize[mask] 0,255 +threshold[mask] 64 +normalize[mask] 0,255 +negate[mask] +ellipse[mask] 50%,50%,7%,7%,255,255,255,255 +i [mask] +name. blurmask +blur[blurmask] 1.6% +normalize[blurmask] 0,255 +mul[mask,blurmask] +div[mask] 256 +mul[mask,real] +div[real] 256 +append[real] [imaginary],y +name[real] fft +remove[imaginary] +fft82float[fft] +#@cli float2int8 +#@cli : Convert selected float-valued images to 8bits integer representations. +float2int8 : +e[^-1] "Convert float-valued image$? to 8bits integer representations." +repeat $! l[$>] +s c repeat $! l[$>] +m={im} M={iM} quantize 16777216,0,1 ++>> 8 &. 255 +&.. 255 >>... 16 +({'$m,$M'}) a y +done done a c +done done +#@cli int82float +#@cli : Convert selected 8bits integer representations to float-valued images. +int82float : +e[^-1] "Convert 8bits integer representation$? to float-valued image$?." +repeat $! l[$>] +s c repeat $! l[$>] +sh. {h-1},{h-1},0,0 m={t} rm. +rows 0,{h-2} s y,3 *... 65536 *.. 256 -| +skip ${n\ $m} +done done a c +done done +#@cli float2fft8 +#@cli : Convert selected float-valued images to 8bits fourier representations. +float2fft8 : +e[^-1] "Convert float-valued image$? to 8bits fourier representations." +repeat $! l[$>] +fftpolar +.. 1 log.. float2int8[-2,-1] a y +done done +#@cli fft82float +#@cli : Convert selected 8bits fourier representations to float-valued images. +fft82float : +e[^-1] "Convert float-valued image$? to 8bits fourier representations." +repeat $! l[$>] +s y,2 int82float exp.. -.. 1 ifftpolar +done done +gcd_despeckle : skip ${1=15},${2=30} +repeat $! l[$>] +ma={if(!$2,w*h,$2)} ++label. $1,1 nb={1+iM} ++histogram. $nb,0,{$nb-1} +map.. . rm. +le. $ma *. 255 +inpaint.. . rm. +done done +iain_nr_2019_preview: +remove_opacity +images={$!} +gamma=$1 +shadows=$2 +light=$3 +mid_offset=$4 +desaturate=$5 +guide_mix=$6 +soften_guide=$7 +fine=$8 +mid=$9 +large=$10 +lookup=$11 +recovery_choice=$12 +recovery_amount=$13 +preview_shows=$14 +preview_tones_map=$15 +if $images>2 +gui_warning_preview "Too many input images detected. This filter requires 1 or 2 images as input." +quit +fi +if $12==3" && "$images==1 +gui_warning_preview "No guide image detected. Guided Recovery requires two images, please set 'input layers' to 'active and below' or equivilent. The top layer should be the noisy version of the image and the bottom layer should be a denoised version" +quit +fi +if $images==1 +[0] +fi +if $preview_tones_map ++l[-1] +mid_tone_offset={$mid_offset/-5} +luminance +add {$mid_tone_offset*255} +resize 25%,25%,100%,100%,2 +median 5 +line 0,0,0,100%,1,128 +line 0,0,100%,0,1,128 +line 0,100%,100%,100%,1,128 +line 100%,0,100%,100%,1,128 ++gt[0] 85 ++gt[0] 170 +laplacian[1,2] +l[1] ++gt[0] 0 +lt[0] 0 +replace[0] 1,100 +replace[1] 1,1 +max[0,1] +done +l[2] ++gt[0] 0 +lt[0] 0 +replace[0] 1,255 +replace[1] 1,150 +max[0,1] +done +max[-1,-2] ++neq[-1] 0 +replace[-1] 1,255 +append[-1,-2] c +scale2x[-1] +scale2x[-1] +k[-1] +done +fi +l[0,1] +if $preview_shows==0 +fine=$fine +mid=$mid +large=$large ++iain_nr_2019 $gamma,$shadows,$light,$mid_offset,$desaturate,$guide_mix,$soften_guide,$fine,$mid,$large,$lookup,$recovery_choice,$recovery_amount,$preview_shows,$preview_tones_map +k[0,-1] +sub +noise_amp={_round((128/(max(abs(im),iM))),0.1)} +mul $noise_amp +add 128 +c 0,255 +elif $preview_shows==1 +fine=$fine +mid=0 +large=0 ++iain_nr_2019 $gamma,$shadows,$light,$mid_offset,$desaturate,$guide_mix,$soften_guide,$fine,$mid,$large,$lookup,$recovery_choice,$recovery_amount,$preview_shows,$preview_tones_map +k[0,-1] +sub +noise_amp={_round((128/(max(abs(im),iM))),0.1)} +mul $noise_amp +add 128 +c 0,255 +elif $preview_shows==2 +fine=0 +mid=$mid +large=0 ++iain_nr_2019 $gamma,$shadows,$light,$mid_offset,$desaturate,$guide_mix,$soften_guide,$fine,$mid,$large,$lookup,$recovery_choice,$recovery_amount,$preview_shows,$preview_tones_map +k[0,-1] +sub +noise_amp={_round((128/(max(abs(im),iM))),0.1)} +mul $noise_amp +add 128 +c 0,255 +elif $preview_shows==3 +fine=0 +mid=0 +large=$large ++iain_nr_2019 $gamma,$shadows,$light,$mid_offset,$desaturate,$guide_mix,$soften_guide,$fine,$mid,$large,$lookup,$recovery_choice,$recovery_amount,$preview_shows,$preview_tones_map +k[0,-1] +sub +noise_amp={_round((128/(max(abs(im),iM))),0.1)} +mul $noise_amp +add 128 +c 0,255 +elif $preview_shows==4 +iain_nr_2019 $gamma,$shadows,$light,$mid_offset,$desaturate,$guide_mix,$soften_guide,$fine,$mid,$large,$lookup,$recovery_choice,$recovery_amount,$preview_shows,$preview_tones_map +fi +done +blend alpha +text_size=13 +if $images==1 +guide="Internal Guide" +bg_colour=255 +text_colour=0 +else +guide="External Guide" +bg_colour=0 +text_colour=255 +fi +box_size=100% +rectangle 0,0,$box_size,20,0.5,$bg_colour +text $guide,0.1~,4,$text_size,1,$text_colour +if $14!=4 +rectangle {(w/2)-127*($noise_amp/2)},{h-20},{(w/2)+127*($noise_amp/2)},100%,0.5,$bg_colour +text Noise\ amplified\ $noise_amp\ times,0.5~,{h-16},$text_size,1,$text_colour +fi +guide_recovery=0 +if $recovery_choice==0 +do_recovery=0 +elif $recovery_choice==1 +do_recovery=1 +slow=0 +recover_text="Fast Recovery" +elif $recovery_choice==2 +do_recovery=1 +slow=1 +recover_text="Slow Recovery" +elif $recovery_choice==3 +do_recovery=1 +slow=1 +guide_recovery=1 +recover_text="Guide Recovery" +fi +if $recovery_choice!=0 +text $recover_text,0.9~,4,$text_size,1,$text_colour +fi +iain_nr_2019: +images={$!} +if $images>2 +quit +fi +gamma=$1 +shadow=$2 +light=$3 +mid_tone_offset={$4/5} +chroma=$5 +external_guide_strength=$6 +soften_guide=$7 +fine=$8 +mid={$9/3} +large={$10/9} +patch_size=3 +patch_size_b=3 +lookup_size={($11*2)+1} +mid_lookup_size={($11*2)+1} +large_lookup_size={($11*2)+1} +smoothness_fine=0 +smoothness=0 +fast_approx=0 +std_deviation_s=10 +recovery_choice=$12 +recover=$13 +guide_recovery=0 +slow=0 +if $recovery_choice==0 +do_recovery=0 +elif $recovery_choice==1 +do_recovery=1 +elif $recovery_choice==2 +do_recovery=1 +slow=1 +elif $recovery_choice==3 +do_recovery=1 +slow=1 +guide_recovery=1 +fi +remove_opacity +colours={s} +external_guide=1 +if $!==1 +[0] +external_guide=0 +fi +if $guide_recovery==0 +if $external_guide_strength<1 +[0] +mul[1] $external_guide_strength +mul[2] {1-$external_guide_strength} +add[1,2] +fi +l[-1] +if $colours!=1 +if $chroma>0 +redmul=.299 +greenmul=.587 +bluemul=.114 ++split[0] c +mul[1] $redmul mul[2] $greenmul mul[3] $bluemul +add[1-3] +if $chroma==1 +keep[1] +else +split[0] c name[0] red name[1] green name[2] blue name[3] luma ++sub[blue] [luma] name[-1] cb ++sub[red] [luma] name[-1] cr +keep[luma,cb,cr] +mul[cb,cr] {1-$chroma} ++add[cb] [luma] name[-1] blueout ++add[cr] [luma] name[-1] redout +remove[1,2] ++mul[redout] $redmul +mul[blueout] $bluemul +sub[luma] [-1] sub[luma] [-2] +div[luma] $greenmul +remove[-1,-2] +move[2] 0 +append c +fi +fi +fi +sub 127 +div 128 +if $gamma!=1 +add 1 +pow $gamma +sub 1 +fi +sub $mid_tone_offset ++c[0] 0,100 +c[0] -100,0 +l[0] +if $shadow>0 +fill i+($shadow*abs(i)*0.75)^2 +elif $shadow<0 +fill i-(abs(i)^3)*(abs($shadow)) +fi +done +l[1] +if $light>0 +div[0] {(2^$gamma)-1} +fill i-($light*abs(i)*0.75)^2 +mul[0] {(2^$gamma)-1} +elif $light<0 +div[0] {(2^$gamma)-1} +fill i+(abs(i)^3)*(abs($light)) +mul[0] {(2^$gamma)-1} +fi +done +add +add $mid_tone_offset +mul 128 +add 127 +if $soften_guide +l[0] +(0,0.2,0;0.2,0.2,0.2;0,0.2,0) +convolve[0] [1] +rm[1] +done +fi +done ++l[0,1] +levels=2 +size={3^$levels} +cropwidth={w} +cropheight={h} +if $colours>1 to_rgb fi +resize {w+($size-w%$size)},{h+($size-h%$size)},{d},{s},0,1 +if $fine>0 +denoise[0] [1],$std_deviation_s,$fine,$patch_size,$lookup_size,$smoothness_fine,$fast_approx +fi ++resize[0,1] 33.33333%,33.33333%,{d},{s},2 +rm[1] ++iain_resize_x3[-2] +blur[-1] 1 +sub[0,-1] +if $mid>0 +denoise[1] [2],$std_deviation_s,$mid,$patch_size,$mid_lookup_size,$smoothness_fine,$fast_approx +fi +l[1,2] ++resize[0,1] 33.33333%,33.33333%,{-1,d},{-1,s},2 +rm[1] ++iain_resize_x3[-2] +blur[-1] 1 +sub[0,-1] +if $large>0 +denoise[1] [2],$std_deviation_s,$large,$patch_size,$large_lookup_size,$smoothness_fine,$fast_approx +fi +done +rm[-1] +repeat 2 +iain_resize_x3[-1] +blur[-1] 1 +add[-1,-2] +done +crop 0,0,{$cropwidth-1},{$cropheight-1} +c 0,255 +done +rm[1] +fi +if $do_recovery +sub[0] [1] +if $colours!=1 +l[0] split c mul[0] 0.2126 mul[1] 0.7125 mul[2] 0.0722 add done +fi ++blur[0] 10 +sub[0] [-1] +rm[-1] ++abs[0] +noise={-1,ia} +blur[-1] 3 +bilateral[-1] [1],20,$noise +blur[-1] 2 +fill[-1] 5/i +mul[0] [-1] +l[0] +add 128 +resize[0] {w+256},{h+256},1,1,0,2,0.5,0.5 +if $slow +iain_fft_denoise_stack[0] {2-$recover},0.5 +else +iain_fft_denoise[0] {2-$recover},0.5 +fi +crop[0] 128,128,{w-129},{h-129} +sub 128 ++blur 10 +sub +done +div[0] [-1] +rm[-1] +if $colours>1 to_rgb[0] fi +add +else +k[-1] +fi +c 0,255 +iain_fft_denoise_stack: +resize {w+128},{h+128},1,1,0,2,0.5,0.5 +offset1x=24 +offset1y=4 +offset2x=-10 +offset2y=21 +offset3x=27 +offset3y=27 +offset4x=6 +offset4y=38 ++shift[0] $offset1x,$offset1y,0,0 ++shift[0] $offset2x,$offset2y,0,0 ++shift[0] $offset3x,$offset3y,0,0 ++shift[0] $offset4x,$offset4y,0,0 +iain_fft_denoise[0] $1,$2 +iain_fft_denoise[1] $1,$2 +iain_fft_denoise[2] $1,$2 +iain_fft_denoise[3] $1,$2 +iain_fft_denoise[4] $1,$2 +shift[1] {$offset1x*-1},{$offset1y*-1},0,0 +shift[2] {$offset2x*-1},{$offset2y*-1},0,0 +shift[3] {$offset3x*-1},{$offset3y*-1},0,0 +shift[4] {$offset4x*-1},{$offset4y*-1},0,0 +blend_median +crop 64,64,{w-65},{h-65} +iain_fft_denoise: +luminance +cropwidth={w} +cropheight={h} +size={64} +resize {w+($size-w%$size)},{h+($size-h%$size)},{d},{s},0,1 +tilew={w/64} +tileh={h/64} +split_tiles $tilew,$tileh +foreach { fftpolar a z } ++blend_median +mul[-1] $1 +repeat $!-1 +l[$>,-1] +split z ++circle[0] 50%,50%,1,1,0 +blur[-1] 1 +mul[-1] {$1*$2} +lt[-1] [2] +circle[-1] 50%,50%,1,1,0 +mul[-1] [2] +sub[0] [-1] +c[0] 0,1e31 +k[0,1,2,3] +append[0,1] z +append[1,2] z +done +done +rm[-1] +foreach { s z ifftpolar } +append_tiles $tilew,$tileh +c 0,255 +crop 0,0,{$cropwidth-1},{$cropheight-1} +iain_fast_denoise_p: +tic +if $7 +apply_parallel_overlap "iain_fast_denoise ${1--1}",128,0 +else +iain_fast_denoise ${1--1} +fi +toc +iain_fast_denoise: +repeat $! l[$>] nm={0,n} split_opacity l[0] +fastluma1={$1*5000} +fastluma2={$fastluma1*.9} +fastluma3={$fastluma1*.65} +fastluma4={$fastluma1*.44} +fastchroma1={$2*5000} +fastchroma2=$fastchroma1 +fastchroma3={$fastchroma2/2} +fastchroma4={$fastchroma3/2} +despeckle_threshold={($4/25)*100000} +if $3!=1 +scale={255*1000} +ex={$3} +pt1x={$scale*0.025} +pt2x={$scale*0.05} +pt3x={$scale*0.075} +pt4x={$scale*0.1} +pt5x={$scale*0.125} +pt6x={$scale*0.15} +pt7x={$scale*0.175} +pt8x={$scale*0.2} +pt9x={$scale*0.225} +pt10x={$scale*0.25} +pt11x={$scale*0.275} +pt12x={$scale*0.3} +pt13x={$scale*0.325} +pt14x={$scale*0.35} +pt15x={$scale*0.375} +pt16x={$scale*0.4} +pt17x={$scale*0.425} +pt18x={$scale*0.45} +pt19x={$scale*0.475} +pt20x={$scale*0.5} +pt21x={$scale*0.525} +pt22x={$scale*0.55} +pt23x={$scale*0.575} +pt24x={$scale*0.6} +pt25x={$scale*0.625} +pt26x={$scale*0.65} +pt27x={$scale*0.675} +pt28x={$scale*0.7} +pt29x={$scale*0.725} +pt30x={$scale*0.75} +pt31x={$scale*0.775} +pt32x={$scale*0.8} +pt33x={$scale*0.825} +pt34x={$scale*0.85} +pt35x={$scale*0.875} +pt36x={$scale*0.9} +pt37x={$scale*0.925} +pt38x={$scale*0.95} +pt39x={$scale*0.975} +pt40x={$scale*1} +pt1y={(0.025^$ex)*$scale} +pt2y={(0.05^$ex)*$scale} +pt3y={(0.075^$ex)*$scale} +pt4y={(0.1^$ex)*$scale} +pt5y={(0.125^$ex)*$scale} +pt6y={(0.15^$ex)*$scale} +pt7y={(0.175^$ex)*$scale} +pt8y={(0.2^$ex)*$scale} +pt9y={(0.225^$ex)*$scale} +pt10y={(0.25^$ex)*$scale} +pt11y={(0.275^$ex)*$scale} +pt12y={(0.3^$ex)*$scale} +pt13y={(0.325^$ex)*$scale} +pt14y={(0.35^$ex)*$scale} +pt15y={(0.375^$ex)*$scale} +pt16y={(0.4^$ex)*$scale} +pt17y={(0.425^$ex)*$scale} +pt18y={(0.45^$ex)*$scale} +pt19y={(0.475^$ex)*$scale} +pt20y={(0.5^$ex)*$scale} +pt21y={(0.525^$ex)*$scale} +pt22y={(0.55^$ex)*$scale} +pt23y={(0.575^$ex)*$scale} +pt24y={(0.6^$ex)*$scale} +pt25y={(0.625^$ex)*$scale} +pt26y={(0.65^$ex)*$scale} +pt27y={(0.675^$ex)*$scale} +pt28y={(0.7^$ex)*$scale} +pt29y={(0.725^$ex)*$scale} +pt30y={(0.75^$ex)*$scale} +pt31y={(0.775^$ex)*$scale} +pt32y={(0.8^$ex)*$scale} +pt33y={(0.825^$ex)*$scale} +pt34y={(0.85^$ex)*$scale} +pt35y={(0.875^$ex)*$scale} +pt36y={(0.9^$ex)*$scale} +pt37y={(0.925^$ex)*$scale} +pt38y={(0.95^$ex)*$scale} +pt39y={(0.975^$ex)*$scale} +pt40y={(1^$ex)*$scale} +fi +interpolation=1 +tic +to_rgb +mul[0] 1000 +if $3!=1 +apply_curve[0] 0,0,0,$pt1x,$pt1y,$pt2x,$pt2y,$pt3x,$pt3y,$pt4x,$pt4y,$pt5x,$pt5y,$pt6x,$pt6y,$pt7x,$pt7y,$pt8x,$pt8y,$pt9x,$pt9y,$pt10x,$pt10y,$pt11x,$pt11y,$pt12x,$pt12y,$pt13x,$pt13y,$pt14x,$pt14y,$pt15x,$pt15y,$pt16x,$pt16y,$pt17x,$pt17y,$pt18x,$pt18y,$pt19x,$pt19y,$pt20x,$pt20y,$pt21x,$pt21y,$pt22x,$pt22y,$pt23x,$pt23y,$pt24x,$pt24y,$pt25x,$pt25y,$pt26x,$pt26y,$pt27x,$pt27y,$pt28x,$pt28y,$pt29x,$pt29y,$pt30x,$pt30y,$pt31x,$pt31y,$pt32x,$pt32y,$pt33x,$pt33y,$pt34x,$pt34y,$pt35x,$pt35y,$pt36x,$pt36y,$pt37x,$pt37y,$pt38x,$pt38y,$pt39x,$pt39y,$pt40x,$pt40y +fi +redmul=.299 +greenmul=.587 +bluemul=.114 +to_rgb[0] ++split[0] c +mul[1] $redmul +mul[2] $greenmul +mul[3] $bluemul +add[1-3] +split[0] c +name[0] red +name[1] green +name[2] blue +name[3] luma ++sub[blue] [luma] +name[-1] cb ++sub[red] [luma] +name[-1] cr +keep[luma,cb,cr] +if $despeckle_threshold>0 +iain_fast_despeckle[0] {1-$despeckle_threshold} +fi +if $1>0 +iain_fast_denoise_main[0] {$fastluma1},{$fastluma2},{$fastluma3},{$fastluma4},$interpolation +fi +if $2>0 +iain_fast_denoise_main[1] {$fastchroma1},{$fastchroma2},{$fastchroma3},{$fastchroma4},$interpolation +iain_fast_denoise_main[2] {$fastchroma1},{$fastchroma2},{$fastchroma3},{$fastchroma4},$interpolation +fi +name[0] luma +name[1] cb +name[2] cr ++add[cb] [luma] +name[-1] blueout ++add[cr] [luma] +name[-1] redout +remove[1,2] ++mul[redout] $redmul ++mul[blueout] $bluemul +sub[luma] [-1] +sub[luma] [-2] +div[luma] $greenmul +remove[-1,-2] +move[2] 0 +append c +if $5==1 +100%,100%,1,1,0 +noise[-1] 0.7,0 ++laplacian[0] +threshold[-1] 4 +dilate[-1] 3 +mul[-1] -1 +add[-1] 1 +mul[-2] [-1] +remove[-1] +add +fi +if $3!=1 +scale={255*1000} +ex={1/$3} +pt1y={(0.025^$ex)*$scale} +pt2y={(0.05^$ex)*$scale} +pt3y={(0.075^$ex)*$scale} +pt4y={(0.1^$ex)*$scale} +pt5y={(0.125^$ex)*$scale} +pt6y={(0.15^$ex)*$scale} +pt7y={(0.175^$ex)*$scale} +pt8y={(0.2^$ex)*$scale} +pt9y={(0.225^$ex)*$scale} +pt10y={(0.25^$ex)*$scale} +pt11y={(0.275^$ex)*$scale} +pt12y={(0.3^$ex)*$scale} +pt13y={(0.325^$ex)*$scale} +pt14y={(0.35^$ex)*$scale} +pt15y={(0.375^$ex)*$scale} +pt16y={(0.4^$ex)*$scale} +pt17y={(0.425^$ex)*$scale} +pt18y={(0.45^$ex)*$scale} +pt19y={(0.475^$ex)*$scale} +pt20y={(0.5^$ex)*$scale} +pt21y={(0.525^$ex)*$scale} +pt22y={(0.55^$ex)*$scale} +pt23y={(0.575^$ex)*$scale} +pt24y={(0.6^$ex)*$scale} +pt25y={(0.625^$ex)*$scale} +pt26y={(0.65^$ex)*$scale} +pt27y={(0.675^$ex)*$scale} +pt28y={(0.7^$ex)*$scale} +pt29y={(0.725^$ex)*$scale} +pt30y={(0.75^$ex)*$scale} +pt31y={(0.775^$ex)*$scale} +pt32y={(0.8^$ex)*$scale} +pt33y={(0.825^$ex)*$scale} +pt34y={(0.85^$ex)*$scale} +pt35y={(0.875^$ex)*$scale} +pt36y={(0.9^$ex)*$scale} +pt37y={(0.925^$ex)*$scale} +pt38y={(0.95^$ex)*$scale} +pt39y={(0.975^$ex)*$scale} +pt40y={(1^$ex)*$scale} +apply_curve[0] 0,0,0,$pt1x,$pt1y,$pt2x,$pt2y,$pt3x,$pt3y,$pt4x,$pt4y,$pt5x,$pt5y,$pt6x,$pt6y,$pt7x,$pt7y,$pt8x,$pt8y,$pt9x,$pt9y,$pt10x,$pt10y,$pt11x,$pt11y,$pt12x,$pt12y,$pt13x,$pt13y,$pt14x,$pt14y,$pt15x,$pt15y,$pt16x,$pt16y,$pt17x,$pt17y,$pt18x,$pt18y,$pt19x,$pt19y,$pt20x,$pt20y,$pt21x,$pt21y,$pt22x,$pt22y,$pt23x,$pt23y,$pt24x,$pt24y,$pt25x,$pt25y,$pt26x,$pt26y,$pt27x,$pt27y,$pt28x,$pt28y,$pt29x,$pt29y,$pt30x,$pt30y,$pt31x,$pt31y,$pt32x,$pt32y,$pt33x,$pt33y,$pt34x,$pt34y,$pt35x,$pt35y,$pt36x,$pt36y,$pt37x,$pt37y,$pt38x,$pt38y,$pt39x,$pt39y,$pt40x,$pt40y +fi +mul[0] 0.001 +c 0,255 +toc +done a c nm $nm done done +fastblur: +repeat $! +l[$<] +(0.0579710145,0.1304347826,0.0579710145;0.1304347826,0.2463768116,0.1304347826;0.0579710145,0.1304347826,0.0579710145) +convolve[0] [1] +remove[-1] +done +done +iain_fast_despeckle: +(0,0.2,0;0.2,0.2,0.2;0,0.2,0) ++convolve[0] [1] ++sub[-1] [0] +abs[-1] ++convolve[-1] [1] +sub[-1] [-2] +abs[-1] +keep[0,2,-1] +threshold[-1] $1 +mul[-1] 255 +append[1,2] c +blend alpha +iain_fast_denoise_main: +cropwidth={w} +cropheight={h} +resize[0] {w+(8-w%8)},{h+(8-h%8)},1,{s},0,1 +width={w} +height={h} ++resize[0] 50%,50%,{d},{s},2 ++resize[1] $width,$height,{d},{s},$5 +fastblur[-1] +sub[0] [2] +remove[2] ++resize[1] 50%,50%,{d},{s},2 ++resize[2] {$width/2},{$height/2},{d},{s},$5 +fastblur[-1] +sub[1] [3] +remove[3] ++resize[2] 50%,50%,{d},{s},2 ++resize[3] {$width/4},{$height/4},{d},{s},$5 +fastblur[-1] +sub[2] [4] +remove[4] ++resize[3] 50%,50%,{d},{s},2 ++resize[4] {$width/8},{$height/8},{d},{s},$5 +fastblur[-1] +sub[3] [5] +remove[5] +rmsthresh[0] $1 +rmsthresh[1] $2 +rmsthresh[2] $3 +rmsthresh[3] $4 +resize[-1] {3,w},{3,h},{d},{s},$5 +fastblur[-1] +add[-2] [-1] +remove[-1] +resize[-1] {2,w},{2,h},{d},{s},$5 +fastblur[-1] +add[-2] [-1] +remove[-1] +resize[-1] {1,w},{1,h},{d},{s},$5 +fastblur[-1] +add[-2] [-1] +remove[-1] +resize[-1] {0,w},{0,h},{d},{s},$5 +fastblur[-1] +add[-2] [-1] +remove[-1] +crop 0,0,{$cropwidth-1},{$cropheight-1} +rmsthresh: ++abs[0] +fastblur[1] +threshold[1] {$1} +fastblur[1] +mul[0] [1] +keep[0] +iain_fast_denoise_p_preview: +if $-2==0 +iain_fast_denoise ${1--3} +fi +if $-2==1 ++iain_fast_denoise_p $1,0,1,$4,0,0,$7 +compose_grainextract +sub 128 +mul 3 +add 128 +fi +if $-2==2 ++iain_fast_denoise_p 0,$2,1,$4,0,0,$7 +compose_grainextract +sub 128 +mul 3 +add 128 +fi +fx_inpaint_holes : +inpaint_holes {$1^1.5},$2,$3 +fx_inpaint_morpho : +foreach { +R=$1 G=$2 B=$3 A=$4 +if !$A" && "(s==2" || "s==4) split_opacity +!=. 0 *[0,-1] a c R=0 G=0 B=0 fi ++round select_color. 0,{round([$R,$G,$B,$A])} +if $5 dilate. {1+2*$5} fi +inpaint_morpho.. [1] +rm. +} +fx_inpaint_morpho_preview : +fx_inpaint_morpho ${1-4},{1+$5} +fx_inpaint_matchpatch : +foreach { +nm={n} R=$6 G=$7 B=$8 A=$9 +if !$A" && "(s==2" || "s==4) split_opacity +!=. 0 *[0,-1] a c R=0 G=0 B=0 fi ++round select_color. 0,{round([$R,$G,$B,$A])} +if $10 dilate. {1+2*$10} fi +if $11 +visu_size=${fitscreen[]" "{0,[w,h,1]},25%,50%} +w1.. $visu_size,0,"[Preview] G'MIC: Inpaint [multi-scale]" +fi +srand 0 inpaint_matchpatch.. [1],${1-5} +rm. => $nm +} +fx_inpaint_matchpatch_preview : +fx_inpaint_matchpatch ${1-9},{1+$10},0 +_fx_inpaint_patch : +foreach { +R=$9 G=$10 B=$11 A=$12 +if !$A" && "(s==2" || "s==4) split_opacity +!=. 0 *[0,-1] a c R=0 G=0 B=0 fi ++round select_color. 0,{round([$R,$G,$B,$A])} +if $13 dilate. {1+2*$13} fi +inpaint.. [1],$1,{$1*$2},$3,1,{$4*$1},${5-8} +rm. +} +fx_inpaint_patch : +foreach { +if $14 +bs:=max(16,min(w,h)*arg(1+$14,100,75,50,25,10,5,2,1)%) +at "_fx_inpaint_patch $*",$bs,$bs,1,25%,25%,0,2 +else _fx_inpaint_patch $* +fi +} +fx_inpaint_patch_preview : +fx_inpaint_patch ${1-12},{1+$13},0 +fx_inpaint_pde : +foreach { +R=$4 G=$5 B=$6 A=$7 +if !$A" && "(s==2" || "s==4) split_opacity +!=. 0 *[0,-1] a c R=0 G=0 B=0 fi ++select_color 0,$R,$G,$B,$A +if $8 dilate. {1+2*$8} fi +inpaint_pde.. [1],$1%,$2,$3 +rm. +} +c 0,255 +fx_inpaint_pde_preview : +fx_inpaint_pde ${1-7},{1+$8} +local_similarity_mask: +repeat $! l[$>] +nm=${-gui_layer_name} +x_location=$1 +y_location=$2 +keep=$3 +reject=$4 +colour_channel=$5 +if $6==0 +steps=100 +elif $6==1 +steps=25 +elif $6>1 +steps={min($6,($reject-$keep))} +fi +to_rgb +if $colour_channel!=0 +if $colour_channel==1 channels 0 fi +if $colour_channel==2 channels 1 fi +if $colour_channel==3 channels 2 fi +if $colour_channel==4 luminance fi +if $colour_channel==5 rgb2lab[0] channels 1 fi +if $colour_channel==6 rgb2lab[0] channels 2 fi +if $colour_channel==7 rgb2hsv[0] channels 0 fi +if $colour_channel==8 rgb2hsv[0] channels 1 fi +if $colour_channel==9 rgb2hsv[0] channels 2 fi +if $colour_channel==10 rgb2hsl[0] channels 2 fi +if $colour_channel==11 rgb2cmyk[0] channels 0 fi +if $colour_channel==12 rgb2cmyk[0] channels 1 fi +if $colour_channel==13 rgb2cmyk[0] channels 2 fi +if $colour_channel==14 rgb2cmyk[0] channels 3 fi +fi +n 0,255 +mul[0] 0.9 +{w},{h},1,1,0 +step_size={($reject-$keep)/$steps} +repeat $steps ++flood[0] $x_location%,$y_location%,0,{$keep+($>*$step_size)},0,1,255 threshold[-1] 99% +add[-1,-2] +done +keep[-1] +n 0,255 +nm name($nm) +done done +createbc: +(0.5,0.5,0;0,0,0;0,0,0) +(0.5,0,0.5;0,0,0;0,0,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbd: +(0.5,0,0;0,0,0.5;0,0,0) +(0.5,0,0;0,0,0;0,0,0.5) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbe: +(0.5,0,0;0,0,0;0,0.5,0) +(0.5,0,0;0,0,0;0.5,0,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbf: +(0.5,0,0;0.5,0,0;0,0,0) +(0,0.5,0.5;0,0,0;0,0,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbg: +(0,0.5,0;0,0,0.5;0,0,0) +(0,0.5,0;0,0,0;0,0,0.5) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbh: +(0,0.5,0;0,0,0;0,0.5,0) +(0,0.5,0;0,0,0;0.5,0,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbi: +(0,0.5,0;0.5,0,0;0,0,0) +(0,0,0.5;0,0,0.5;0,0,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbj: +(0,0,0.5;0,0,0;0,0,0.5) +(0,0,0.5;0,0,0;0,0.5,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbk: +(0,0,0.5;0,0,0;0.5,0,0) +(0,0,0.5;0.5,0,0;0,0,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbl: +(0,0,0;0,0,0.5;0,0,0.5) +(0,0,0;0,0,0.5;0,0.5,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbm: +(0,0,0;0,0,0.5;0.5,0,0) +(0,0,0;0.5,0,0.5;0,0,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbn: +(0,0,0;0,0,0;0,0.5,0.5) +(0,0,0;0,0,0;0.5,0,0.5) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbo: +(0,0,0;0.5,0,0;0,0,0.5) +(0,0,0;0,0,0;0.5,0.5,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbp: +(0,0,0;0.5,0,0;0,0.5,0) +(0,0,0;0.5,0,0;0.5,0,0) ++convolve[0] [1] ++convolve[0] [2] +keep[0,-1,-2] +iain_median_3_stack[0,1,2] +keep[-1] +createbq: ++createbc[0] ++createbd[0] +iain_median_3_stack[0,1,2] +keep[-1] +createbr: ++createbe[0] ++createbf[0] +iain_median_3_stack[0,1,2] +keep[-1] +createbs: ++createbg[0] ++createbh[0] +iain_median_3_stack[0,1,2] +keep[-1] +createbt: ++createbi[0] ++createbj[0] +iain_median_3_stack[0,1,2] +keep[-1] +createbu: ++createbk[0] ++createbl[0] +iain_median_3_stack[0,1,2] +keep[-1] +createbv: ++createbm[0] ++createbn[0] +iain_median_3_stack[0,1,2] +keep[-1] +createbw: ++createbo[0] ++createbp[0] +iain_median_3_stack[0,1,2] +keep[-1] +createbx: ++createbq[0] ++createbr[0] +iain_median_3_stack[0,1,2] +keep[-1] +createby: ++createbs[0] ++createbt[0] +iain_median_3_stack[0,1,2] +keep[-1] +createbz: ++createbu[0] ++createbv[0] +iain_median_3_stack[0,1,2] +keep[-1] +createca: ++createbx[0] ++createby[0] +iain_median_3_stack[0,1,2] +keep[-1] +createcb: ++createbz[0] ++createbw[0] +iain_median_3_stack[0,1,2] +keep[-1] +megaclean: ++createca[0] ++createcb[0] +iain_median_3_stack[0,1,2] +keep[-1] +cross: ++shift[0] 0,1,0,0,2 ++shift[0] 0,-1,0,0,2 ++shift[0] 1,0,0,0,2 ++shift[0] -1,0,0,0,2 +iain_median_5_stack +ex: ++shift[0] 1,1,0,0,2 ++shift[0] 1,-1,0,0,2 ++shift[0] -1,-1,0,0,2 ++shift[0] -1,1,0,0,2 +iain_median_5_stack +hybrid_median: +ac " +repeat $1 ++cross[0] ++ex[0] +iain_median_3_stack[0,1,2] +done +",$2 +iain_hybrid_median: +repeat $1 ++cross[0] ++ex[0] +iain_median_3_stack[0,1,2] +done +iain_pixel_denoise: +if $1==0 +ac " +repeat $2 +megaclean +done +",$3 +elif $1==1 +hybrid_median[0] $2,$3 +elif $2==1 ++l[0] +(1,1,1;1,0,1;1,1,1) +dilate[0] [1] +rm[1] +done ++l[0] +(1,1,1;1,0,1;1,1,1) +erode[0] [1] +rm[1] +done +min[0,1] +max[0,1] +fi +iain_pixel_denoise_p: +if $5 +if $1==0 +ac " +repeat $2 +apply_parallel_overlap \"megaclean \",4,0 +done +",$3 +elif $1==1 +ac " +apply_parallel_overlap \"iain_hybrid_median[0] $2\",4,0 +",$3 +elif $1==2 +ac " +apply_parallel_overlap \" ++l[0] +(1,1,1;1,0,1;1,1,1) +dilate[0] [1] +rm[1] +done ++l[0] +(1,1,1;1,0,1;1,1,1) +erode[0] [1] +rm[1] +done +min[0,1] +max[0,1] +\",4,0 +",$3 +fi +else +if $1==0 +ac " +repeat $2 +megaclean +done +",$3 +elif $1==1 +ac " +iain_hybrid_median_p[0] $2 +",$3 +elif $1==2 +ac " ++l[0] +(1,1,1;1,0,1;1,1,1) +dilate[0] [1] +rm[1] +done ++l[0] +(1,1,1;1,0,1;1,1,1) +erode[0] [1] +rm[1] +done +min[0,1] +max[0,1] +",$3 +fi +fi +time=$| +iain_pixel_denoise_p_preview: +if $4==0 +iain_pixel_denoise_p ${1--1} +fi +if $4==1 ++iain_pixel_denoise_p ${1--1} +sub[0] [1] +keep[0] +n 0,255 +fi +iain_recursive_median_p: +if $5 +ac " +apply_parallel_overlap \" +repeat $2 median $1 done +\",{$1*2},0 +",$3,0 +else +ac " +repeat $2 median $1 done +",$3,0 +fi +recursive_median: +ac "repeat $3 median $1 done",$2,0 +iain_recursive_median_p_preview: +if $-2==0 +iain_recursive_median_p $1,$2,$3,$4,$5 +fi +if $-2==1 +remove_opacity ++iain_recursive_median_p $1,$2,$3,$4,$5 +sub[0] [1] +keep[0] +mul 2 +add 128 +fi +fx_remove_hotpixels : +remove_hotpixels $1,$2 +fx_remove_hotpixels_preview : +gui_split_preview "fx_remove_hotpixels $*",${-3--1} +jeje_scandoc : +scandoc $1,$2%,$3%,$4% +jeje_scandoc_preview : +gui_split_preview "jeje_scandoc $1,$2,$3,$4",$-1 +fx_smooth_anisotropic : +ac "repeat $11 { smooth $1,$2,$3,$4,$5,$6,$7,$8,$9,$10 }",$12 c 0,255 +fx_smooth_anisotropic_preview : +gui_split_preview "fx_smooth_anisotropic $*",${-3--1} +fx_smooth_antialias : +foreach { ++diffusiontensors 0,1,1,$3,$3 ++gradient_norm.. >=. $2% *[-2,-1] +smooth.. .,{$1^1/3},0.5,120,2,1 rm. +} +fx_smooth_antialias_preview : +gui_split_preview "fx_smooth_antialias $*",${-3--1} +fx_smooth_bilateral : skip ${5=0},${6=0} +ac "repeat $3 { bilateral $1,$2 }",$4 +fx_smooth_bilateral_preview : +gui_split_preview "fx_smooth_bilateral $*",${-3--1} +jeje_denoise_patch_dict : ++denoise_patch_dict {2^($1+2)},$2,$3,$4 +*[0] $5 *[1] {1-$5} + c 0,255 +jeje_denoise_patch_dict_preview : +gui_split_preview "jeje_denoise_patch_dict ${1--2}",$-1 +fx_smooth_diffusion : +ac "gui_parallel_overlap \"smooth $6,$1,$2,$3,$4,$5,0 c 0,255\",$8,$9",$7 +fx_smooth_diffusion_preview : +gui_split_preview "fx_smooth_diffusion $*",${-3--1} +fx_smooth_guided : skip ${6=0},${7=0} +if $1" && "!narg($_guide) +if $!<2 gui_warning_preview "Missing guide layer" return fi +store[{$1==1?0:-1}] _guide +fi +if !$1 +ac "repeat $4 { guided $2,$3 }",$5 +elif $1==1 +ac "$_guide r. ..,..,1,100%,0,0,0.5,0.5 repeat $4 { guided[0] [1],$2,$3 } rm.",$5 +if !narg($_is_preview) $_guide mv. 0 fi +else +ac "$_guide r. ..,..,1,100%,0,0,0.5,0.5 repeat $4 { guided[0] [1],$2,$3 } rm.",$5 +if !narg($_is_preview) $_guide fi +fi +fx_smooth_guided_preview : +if $1" && "!narg($_guide) +if $!<2 gui_warning_preview "Missing guide layer" return fi +store[{$1==1?0:-1}] _guide +fi +_is_preview=1 +gui_split_preview "fx_smooth_guided $*",${-3--1} +jeje_denoise_iuwt : +denoise_iuwt $1,$2,{$3+1} +jeje_denoise_iuwt_preview : +gui_split_preview "jeje_denoise_iuwt $1,$2,$3",$-1 +fx_smooth_meancurvature : +ac "gui_parallel_overlap \"meancurvature_flow $2,$1,$3 c 0,255\",$5,$6",$4 +fx_smooth_meancurvature_preview : +gui_split_preview "fx_smooth_meancurvature $*",${-3--1} +fx_smooth_median : +ac "median $1,$2",$3 +fx_smooth_median_preview : +gui_split_preview "fx_smooth_median $*",${-3--1} +fx_smooth_nlmeans: +foreach { +if s==1 nlmeans $1,$2,$3,-_fx_smooth_nlmeans$4 +else ac "gui_parallel_overlap \"nlmeans $1,$2,$3,-_fx_smooth_nlmeans$4\",$6,$7",$5 +fi +} +_fx_smooth_nlmeans0 : s c abs max +_fx_smooth_nlmeans1 : s c abs + +_fx_smooth_nlmeans2 : norm +_fx_smooth_nlmeans3 : if s>=3 channels 0,2 luminance else norm fi +_fx_smooth_nlmeans4 : if s>=3 channels 0,2 srgb2rgb rgb2lab channels 0 else norm fi +_fx_smooth_nlmeans5 : +fx_smooth_nlmeans_preview: +gui_split_preview "fx_smooth_nlmeans $*",${-3--1} +fx_smooth_patch : +ac "gui_parallel_overlap \"repeat $7 { denoise $1,$2,$3,$4,$5,$6 } c 0,255\",$9,$10",$8 +fx_smooth_patch_preview : +gui_split_preview "fx_smooth_patch $*",${-3--1} +fx_smooth_patchpca : +ac "denoise_patchpca ${1-4} c 0,255",$5 +fx_smooth_patchpca_preview : +gui_split_preview "fx_smooth_patchpca $*",${-3--1} +fx_smooth_peronamalik : +ac "gui_parallel_overlap \"peronamalik_flow $1,$3,$2,$4 c 0,255\",$6,$7",$5 +fx_smooth_peronamalik_preview : +gui_split_preview "fx_smooth_peronamalik $*",${-3--1} +fx_smooth_selective : +ac "gui_parallel_overlap \"repeat $4 { blur_selective $1,$2,$3 } c 0,255\",$6,$7",$5 +fx_smooth_selective_preview : +gui_split_preview "fx_smooth_selective $*",${-3--1} +fx_smooth_skin : +foreach { split_opacity l[0] { +to_rgb +if $5 +balance_gamma 128,128,128 else [0] fi +if !$1 channels. 0 f. 1 elif $1==2 detect_skin. $2 else detect_skin. $2,$6%,$7%,$8% fi +M:=iM b. $3% *. {$M/iM} *. $4 c. 0,1 +split_details[0] 4,$9%,$10% ++_fx_smooth_skin[2] $12,$11 +j[2] .,0,0,0,0,1,.. rm[-2,-1] +*. {10^$13} + c 0,255 +} a c } +_fx_smooth_skin : +if !$1 b {$2/8}% +else +if $2>0 +m,M:=im,iM n 0,255 +repeat int($2/5) { bilateral 3%,{5*3} } +bilateral 3%,{($2%5)*3} +* {($M-$m)/255} + $m +fi +fi +fx_smooth_skin_preview : +if !$14 +gui_split_preview "if $5 balance_gamma 128,128,128 fi if !$1 f 1 elif $1==2 detect_skin $2 ""else detect_skin $2,$6%,$7%,$8% fi M:=iM b $3% * {255*$M/iM} * $4 c 0,255",${-3--1} +elif $14==1 +gui_split_preview "b $9%",${-3--1} +elif $14==2 +gui_split_preview "split_details 4,$9%,$10% k.. n 0,255",${-3--1} +elif $14==3 +gui_split_preview "split_details 4,$9%,$10% k.. _fx_smooth_skin $12,$11 n 0,255",${-3--1} +elif $14==4 +gui_split_preview "split_details 4,$9%,$10% k. n 0,255",${-3--1} +else +gui_split_preview "fx_smooth_skin $*",${-3--1} +fi +if $1==1 +to_rgb +circle $6%,$7%,$8%,0.2,0,255,0 +circle $6%,$7%,$8%,0.4,0xFFFFFFFF,0,255,0 +line {$6-0.25*$8}%,{$7-0.25*$8}%,{$6+0.25*$8}%,{$7+0.25*$8}%,0.8,255,255,0 +line {$6+0.25*$8}%,{$7-0.25*$8}%,{$6-0.25*$8}%,{$7+0.25*$8}%,0.8,255,255,0 +fi +fx_smooth_tv : +ac "gui_parallel_overlap \"tv_flow $2,$1,$3 c 0,255\",$5,$6",$4 +fx_smooth_tv_preview : +gui_split_preview "fx_smooth_tv $*",${-3--1} +fx_smooth_haar : +remove_opacity +ac "gui_parallel_overlap \"denoise_haar $1,$3,$2 c 0,255\",$5,$6",$4 +fx_smooth_haar_preview : +gui_split_preview "fx_smooth_haar $*",${-3--1} +jeje_local_wiener : +ac "local_wiener $1",$2,$3 +jeje_local_wiener_preview : +gui_split_preview "jeje_local_wiener $*",$-1 +fx_solidify_td : +foreach { +to_rgba sh 0,{s-2} if $5 srgb2rgb. fi rm. +if $4 +. sh. 100% if $4>0 erode. {1+2*$4} else dilate. {1-2*$4} fi rm. +solidify. $1%,$2,$3 +rv blend alpha +else +solidify $1%,$2,$3 +fi +if $5 rgb2srgb. fi +} +fx_solidify_td_preview : +gui_split_preview "fx_solidify_td $*",${-3--1} +unpurple : skip ${1=1},${2=0},${3=0},${4=0.33},${5=5},${6=0},${7=0} +intensity=$1 +min_brightness=$2 +min_red_to_blue_ratio=$3 +max_red_to_blue_ratio=$4 +blur_std_variation=$5 +gentle=$6 +precision=$7 +if $gentle +min_brightness=0.8 +min_red_to_blue_ratio=0.15 +fi +repeat $! +local[$>] +if s==3 +has_alpha=0 +elif s==4 +has_alpha=1 +else +error "Unsupported number of image channels "{s} +fi +split c +if $has_alpha +move. 0 +fi +if $precision +max_blue={(1<<$precision)-1} +else +max_blue.={iM} +fi ++fill. "blue=i/"$max_blue"; +threshold="$min_brightness"; +grey_level=max(0,(blue-threshold))*1/(1-threshold); +"$intensity"*grey_level" +blur. $blur_std_variation,0,0 +append[-4,-3,-2,-1] c +fill. "bl=min("$max_blue",("$max_blue"*i3)); +db=max((i2-i1), 0); +dr=max((i0-i1), 0); +mb=min(bl,db); +r_diff=min(dr,mb*"$max_red_to_blue_ratio"); +b_diff=if("$min_red_to_blue_ratio">0,min(mb,r_diff/"$min_red_to_blue_ratio"),mb); +bl=round(bl,0,-1); +r_diff=round(r_diff,0,-1); +b_diff=round(b_diff,0,-1); +[i0-r_diff,i1,i2-b_diff]" +split. c +remove. +if $has_alpha +move[0] 4 +fi +append c +done +done +return +unpurple_preview : +gui_split_preview "unpurple $*",${-3--1} +vis_min_brightness=2 +vis_min_red_to_blue=2 +gentle={$6} +if $gentle +vis_min_brightness=0 +vis_min_red_to_blue=0 +fi +status "{$1}""{$2}"_$vis_min_brightness"{$3}"_$vis_min_red_to_blue"{$4}""{$5}""{$6}""{$7}""{$8}""{$9}" +jeje_unstrip : +unstrip $1,$2,$3 +if $5 tape powerspectrum +else +if -$4 n 0,255 else c 0,255 fi +fi +jeje_unstrip_preview : +gui_split_preview "jeje_unstrip $1,$2,$3,$4,$5",$-1 +fx_scale_dcci2x : skip ${1=1.15},${2=5},${3=0} +foreach { split_opacity scale_dcci2x ${1-3} a c c 0,255 } +fx_scale_dcci2x_preview : +z 25%,25%,75%,75% fx_scale_dcci2x $* +fx_render3d : skip ${14=1} +width,height:=(1+$14)*[$1,$2] +n3d c3d m3d {round($13)} f3d:=0.5*max($width,$height)/tan($7*pi/360) +f3d $f3d l3d {$8*$f3d},{$9*$f3d},{$10*$f3d} sl3d $11 ss3d $12 +foreach { +*3d {$3*max($width,$height)} r3d 0,0,1,{-$6} r3d 0,1,0,{-$5} r3d 1,0,0,{-$4} +$width,$height,1,3,-1 +j3d. ..,50%,50% rm.. +to_rgba replace_color 0,0,-1,-1,-1,255,0,0,0,0 +if $14 +r $1,$2,1,100%,2 s c,-3 +. 1e-5 /[0] [1] *[0] 255 a c +fi +} +fx_upscale_smart : +to_rgb upscale_smart $1,$2,1,$3,$4,$5 c 0,255 +fx_upscale_smart_preview : +repeat $! { ++r. $1,$2,1,1,0 +if w<{-2,w}" || "h<{-2,h} +rm. /. 4 +0 t. "Downscaling is\nnot allowed!",5,5,20,1,255 r. ..,..,1,1,0,0,0.5,0.5 +-|[-2,-1] +else +z.. {50-50*{-2,w}/w}%,{50-50*{-2,h}/h}%,{50+50*{-2,w}/w}%,{50+50*{-2,h}/h}% +rm. fx_upscale_smart. $1,$2,$3,$4,$5 c. 0,255 +fi +mv. 0 } +fx_scalenx : +foreach { +split_opacity +if $2==1 rgb2ycbcr[0] round[0] +elif $2==2 rgb2lab8[0] round[0] +fi +if !$1 scale2x +elif $1==1 scale3x +elif $1==2 scale2x scale2x +elif $1==3 scale3x scale2x +elif $1==4 scale2x scale2x scale2x +elif $1==5 scale3x scale3x +elif $1==6 scale3x scale2x scale2x +elif $1==7 scale2x scale2x scale2x scale2x +elif $1==8 scale3x scale3x scale2x +elif $1==9 scale3x scale3x scale3x +fi +if $2==1 ycbcr2rgb[0] +elif $2==2 lab82rgb[0] +fi +a c +} +fx_scalenx_preview : +z 40%,40%,60%,60% +fx_scalenx $1,$2 +fx_animate_elevation3d : skip "${4=}" +if $3 filename="$4/gmic_elevation3d.png" else filename="" fi +_fx_elevation3d ${5-6},0 +animate fx_render3d,"${7-8},${10-19},$9","${7-8},${20-29},$9",$1,$2,{``$filename} +fx_animate_elevation3d_preview : skip "${4=}" +w,h={w},{h} +_fx_elevation3d ${5-6},0 +fx_animate_preview fx_render3d,$w","$h",${10-19},$9",$w","$h",${20-29},$9",0,$w,$h +fx_animate_extrude3d : skip "${4=}" +if $3 filename="$4/gmic_extrude3d.png" else filename="" fi +_fx_extrude3d ${5-7},0 +animate fx_render3d,"${8-9},${11-20},$10","${8-9},${21-30},$10",$1,$2,{``$filename} +fx_animate_extrude3d_preview : skip "${4=}" +w,h={w},{h} +_fx_extrude3d ${5-7},0 +fx_animate_preview fx_render3d,$w","$h",${11-20},$10",$w","$h",${21-30},$10",0,$w,$h +fx_animate_imageobject3d : skip "${4=}" +if $3 filename="$4/gmic_imageobject3d.png" else filename="" fi +_fx_imageobject3d "_",$5 +animate fx_render3d,"${6-7},${9-18},$8","${6-7},${19-28},$8",$1,$2,{``$filename} +fx_animate_imageobject3d_preview : skip "${4=}" +w,h={w},{h} +_fx_imageobject3d "_preview_",$5 +fx_animate_preview fx_render3d,$w","$h",${9-18},$8",$w","$h",${19-28},$8",0,$w,$h +fx_text_pointcloud3d : +W,H,M:=w,h,round(1.5*max(w,h)) rm +text_pointcloud3d "$2","$3",$4 +col3d. ${5-7} *3d. {0.7*$M} +f3d 4000 db3d 0 m3d +repeat $1 { +rprogress {60*$>/$1} +angle:=$>*360/$1 ++r3d[0] 1,0,1,$angle +$M,$M,1,3,-1 j3d. ..,50%,50%,0,1 rm.. +} +rm[0] a z autocrop -1 to_rgba s z replace_color 0,0,-1,-1,-1,255,0,0,0,0 +if $11 N=$! foreach { +rprogress {60+40*$>/$N} +i[0] 100%,100%,1,4 fc[0] ${8-11} +channels. 3,3 +negate. b[-2,-1] $14% to_rgba. +j[0] .,$12%,$13%,0,0,1,..,255 rm[-2,-1] blend alpha +} fi +if $W>$H r2dx $W else r2dy $H fi +if $15>1 +i[{int($1/2)}] [{int($1/2)}]x{$15-1} +i[0] [0]x{$15-1} +fi +fx_text_pointcloud3d_preview : +fx_text_pointcloud3d 4,"$2","$3",$4,${5-7},${8-11},${12-14},1 drgba +frame 1,1,0 append_tiles 2,2 +fx_transition3d : +f3d $7 +transition3d $1,$2,$3,"$4","$5","$6",$8 +fx_transition3d_preview : +if $!==1 gui_warning_preview "Missing input layer" return fi +f3d $7 +k[0,1] transition3d 4,$2,$3,"$4","$5","$6",$8 +k[1,2] +r[0] 50%,100%,1,100%,0 +r[1] 50%,100%,1,100%,0,0,1 +a x +line 50%,0,50%,100%,1,0,0,0,255 +fx_animate_pencilbw : skip "${4=}" +if $3 filename="$4/gmic_pencilbw.png" else filename="" fi +animate pencilbw,"${5-6}","${7-8}",$1,$2,{``$filename} +fx_animate_pencilbw_preview : skip "${4=}" +fx_animate_preview pencilbw,"${5-6}","${7-8}" +fx_animate_stencilbw : skip "${4=}" +if $3 filename="$4/gmic_stencilbw.png" else filename="" fi +animate stencilbw,"${5-6}","${7-8}",$1,$2,{``$filename} +fx_animate_stencilbw_preview : skip "${4=}" +fx_animate_preview stencilbw,"${5-6}","${7-8}" +fx_animate_cartoon : skip "${4=}" +if $3 filename="$4/gmic_cartoon.png" else filename="" fi +animate cartoon,"${6-10},$5","${11-15},$5",$1,$2,{``$filename} +fx_animate_cartoon_preview : skip "${4=}" +fx_animate_preview cartoon,"${6-10},$5","${11-15},$5" +fx_animate_edges : skip "${4=}" +if $3 filename="$4/gmic_edges.png" else filename="" fi +animate fx_edges,"${6-7},$5","${8-9},$5",$1,$2,{``$filename} +fx_animate_edges_preview : skip "${4=}" +fx_animate_preview fx_edges,"${6-7},$5","${8-9},$5" +fx_fire_edges : +fire_edges ${1-7} rv +fx_fire_edges_preview : +gui_split_preview "fire_edges $1,$2,$3,$4,1,$6,0",${-3--1} +fx_lavalampbw : +if !$! (255;100^64;16^128;0) r. 512,512,1,3,3 fi +foreach { +remove_opacity +w,h={w},{h} ++r $4%,$4%,1,1,0 [-1]x{$1-1} rand[^0] 0,1 stencil[^0] $5,0 +if $3 [1] fi +morph[^0] $2,$6,0 +stencil[^0] $5,0 +r[^0] $w,$h,1,1,3 b[^0] 10 >=[^0] 50% *[^0] 255 +r[^0] 100%,100%,1,4 j[^0] [0] rm[0] +if $3 rm. fi +} +if !$7 foreach { split_opacity n. 0,1 *[^-1] . rm. } fi +fx_lavalampbw_preview : +fx_lavalampbw 2,2,1,$4,$5,$6,$7 k[0] +fx_animate_lissajous : skip "${4=}" +if $3 filename="$4/gmic_lissajous.png" else filename="" fi +animate fx_lissajous,"${5-22}","${23-40}",$1,$2,{``$filename} +fx_animate_lissajous_preview : skip "${4=}" +fx_animate_preview fx_lissajous,"${5-22}","${23-40}",0 +fx_moire : +if 0$_is_preview" && "!narg($_preview_area_width) _preview_area_width,_preview_area_height=512 fi +if $2 repeat $! { if $>" && "{$<,s==2||s==4} blend[$<] [{$<+1}],alpha,1,1 fi } fi +if $4 +skip:=" +l<=6?1:( +const l5 = int(l/5); +const l4 = int(l/4); +const l6 = int(l/6); +5*l5==l?l5: +6*l6==l?l6: +4*l4==l?l4:( +const r6 = abs(6*l6 - l); +const r5 = abs(5*l5 - l); +const r4 = abs(4*l4 - l); +r5<=r4 && r5<=r6?l5: +r6<=r4 && r6<=r5?l6: +l4 +) +)" +k[0--1:$skip] +if $!>6 rm[6--1] fi +fi +N=$! +foreach { if s==2||s==4 drgba 255 fi } +if 0$_is_preview +W,H=$_preview_area_width,$_preview_area_height +if $3 +if $W>$H W:=$H/sqrt(2) else H:=$W*sqrt(2) fi +fW,fH=$W,$H +W,H/=arg($3,4,3,2,1) +fi +elif $3 +W,H,fW,fH:="$3==1?[620,877]:$3==2?[827,1169]:$3==3?[1240,1754]:[2480,3508]",2480,3508 +W,H,fW,fH:=round([$W,$H,$fW,$fH]*0.95) +else +W,H=${-max_wh} +fi +if $3" && "$5 +W,H=$H,$W fW,fH=$fH,$fW +fi +if !narg($fW) fW,fH=$W,$H fi +foreach { +if [w,h]!=[$W,$H] +- 255 +rr2d {(100-$6)%*[$W,$H]},2,2 +r $W,$H,1,100%,0,0,0.5,0.5 ++ 255 +fi +} +if $1 +100%,100%,1,100%,"i(#x%"$N",x,y,z,c)" rm[^-1] +100%,100%,1,1,"x%"$N"?0:255" +else +100%,100%,1,100%,"i(#y%"$N",x,y,z,c)" rm[^-1] +100%,100%,1,1,"y%"$N"?0:255" +fi +if $3 +ir:=round(max($fW/$W,$fH/$H))*100 +r $ir%,$ir%,1,100%,1 +r $fW,$fH,1,100%,0,1,0.5,0.5 +fi +if $7" && "$8 +ax,ay:=a=$7-1;[a%2?0.95:0.05,int(a/2)?0.95:0.05] +0 t. "#"$N,0,0,{0,h*$8%},1,255 autocrop. frame. 5%,15%,0 negate. to_rgb. j[^-1] .,$ax~,$ay~ rm. +fi +=> "name(Merged Frames),pos(0,0),opacity(100),mode(alpha)","name(Mask),pos(0,0),opacity(100),mode(alpha)" +u $N +fx_moire_preview : +_is_preview=1 +fx_moire $* +fx_tk_animateobject : +if $!<=1 return fi +if $15==0 +to_rgb if $9==0 +r {w*{$6/max(w,h)}},{h*{$6/max(w,h)}},1,{s},6 c 0,255 +if $14==0 +[-1,-2] [0] rv[0,1] +blur_xy[0] $11 ir[0] $13,256 n[0] 0,255 +tk_fx_replace_color[0] 1,0,0,0,0,255,0,0,0,0 +blur_xy[0] $12 inpaint[1] [0] +rm[0] rv[-1,-2] +else [0] rv[0,1] rv[-1,-2] +[0] [0] +... . +to_gray[-1,-2] ir[-1,-2] 128,256 n[-1,-2] 0,255 +s[1] c a[1,2,3,-1] c +s[2] c a[2,3,4,-1] c +rv[1,-1] compose_rgba[1,-1] +rv[2,-1] compose_rgba[2,-1] +to_rgb[1,2] +fi +dx={$1/$7} dy={$2/$7} dz=1 repeat $7 +shift[-1,-2] $dx%,$dy% +if $3>=0 dz={$dz+{{$3}/$7}} +else dz={$dz-{{{1-{10.01+$3}/10}}/$7}} fi ++fx_zoom[-1,-2] $dz,$4,$5,0 +to_gray. ir. 128,256 n. 0,255 to_rgb.. +s.. c a[-4,-3,-2,-1] c +if $10!=0 unsharp. {$10/5},{$10/2},0 cut. 0,255 fi +mv. -3 done rm[-1,-2] rv rv[-1,-2] +index={-3} repeat $7 +.. rv[-1,-2] index={$index-1} +rv[-3,$index] compose_rgba[-3,$index] +done rm.. if $8==1 rv fi +else +if $14==0 frames={$!-1} counter={-5} +[-1,-2] ++blur_xy. $11 ir. $13,256 n. 0,255 +tk_fx_replace_color. 1,0,0,0,0,255,0,0,0,0 +blur_xy. $12 +repeat $frames inpaint[$counter] . +counter={$counter-1} done rm[-1,-4] +[-1,-2] +else frames={$!-2} +to_gray. +s... c a[-5,-4,-3,-1] c ++to_gray. +fc. 0,0,0 +rv[-1,-4] compose_rgba[-1,-4] mv. -3 +fi +counter={-6} dx=0 dy=0 dz=1 repeat $frames +[-1,-2] +shift[-1,-2] $dx%,$dy% +if $3>=0 dz={$dz+{{$3}/$frames}} +else dz={$dz-{{{1-{10.01+$3}/10}}/$frames}} fi ++fx_zoom[-1,-2] $dz,$4,$5,0 +to_gray. ir. 128,256 n. 0,255 to_rgb.. +s.. c a[-4,-3,-2,-1] c +if $10!=0 unsharp. {$10/5},{$10/2},0 cut. 0,255 fi +mv. $counter +compose_rgba[$counter,{$counter-1}] +dx={$dx+{$1/$frames}} dy={$dy+{$2/$frames}} +counter={$counter-1} +rm[-1,-2] +done rm[-1,-2,-3,0] +fi +else +to_rgb if $9==0 +r {w*{$6/max(w,h)}},{h*{$6/max(w,h)}},1,{s},6 c 0,255 fi +dx=0 dy=0 dz=1 if $9==0 counter=$7 else counter={$!-1} fi +index={-2} repeat $counter +if $9==0 . mv. $index fi +dx={$dx+{$1/$7}} dy={$dy+{$2/$7}} +shift[$index] $dx%,$dy% +if $3>=0 dz={$dz+{{$3}/$7}} +else dz={$dz-{{{1-{10.01+$3}/10}}/$7}} fi +fx_zoom[$index] $16,$4,$5,0 +fx_zoom[$index] $dz,$4,$5,0 +if $10!=0 unsharp[$index] {$10/5},{$10/2},0 cut[$index] 0,255 fi +index={$index-1} done +if $16!=1 rm. fi fi +fx_tk_animateobject_preview: +if $15==0 start_x={{xM/w}*100} start_y={{yM/h}*100} else start_x=50 start_y=50 fi +fx_tk_animateobject ${1-6},1,${8--1} k[0] +line[0] {$1+$start_x}%,{$2+$start_y-10}%,{$1+$start_x}%,{$2+$start_y+10}%,1,255,0,0 +line[0] {$1+$start_x-10}%,{$2+$start_y}%,{$1+$start_x+10}%,{$2+$start_y}%,1,255,0,0 +line[0] {$4*100}%,0%,{$4*100}%,{{$5*100}-5}%,1,255,255,0 +line[0] {$4*100}%,{{$5*100}+5}%,{$4*100}%,100%,1,255,255,0 +line[0] 0%,{$5*100}%,{{$4*100}-5}%,{$5*100}%,1,255,255,0 +line[0] {{$4*100}+5}%,{$5*100}%,100%,{$5*100}%,1,255,255,0 +fx_animate_rodilius : skip "${4=}" +if $3 filename="$4/gmic_rodilius.png" else filename="" fi +animate rodilius,"${6-10},$5","${11-15},$5",$1,$2,{``$filename} +fx_animate_rodilius_preview : skip "${4=}" +fx_animate_preview rodilius,"${6-10},$5","${11-15},$5" +fx_animate_glow : skip "${4=}" +if $3 filename="$4/gmic_glow.png" else filename="" fi +animate glow,"$5","$6",$1,$2,{``$filename} +fx_animate_glow_preview : skip "${4=}" +fx_animate_preview glow,"$5","$6" +fx_spatial_transition : +to_rgba r ${-max_wh},1,100%,0,0,0.5,0.5 +shape=-1 formula= +if !$3 +elif $3==1 shape=0 +elif $3==2 formula="$4" +elif $3==3 formula="sin(x*0.5*pi/w*(1+100*A))" +elif $3==4 formula="sin(y*0.5*pi/h*(1+100*A))" +elif $3==5 formula="atan2(y-h/2,x-w/2)%((1-A)*2*pi+0.001)" +elif $3==6 formula="R=0.5*sqrt(w*w+h*h);sqrt((y-h/2)^2+(x-w/2)^2)%(0.001+R*(1-A))" +elif $3==7 100%,100% plasma. 1,1,{8/(1+$5)} equalize. 1024 +fi +if narg($formula) +{w},{h},1,1,"A=$5;"$formula fi +if $-1 +if !$6 k[$shape] norm n 0,255 +elif $6==1" && "!$7 rm[$shape] rm. +elif $6==1" && "$7==1 rm[$shape] rm[0] +elif $6==1 +transition[^$shape] [$shape],$1,$2,$7*($1-1) rm[$shape] rm[0--1:2] +else +transition[^$shape] [$shape],{$6*2},$2 rm[$shape] to_rgba +fi +if $!>1 to_rgba frame 2%,2%,0,0,0,0 append_tiles , fi +else +transition[^$shape] [$shape],$1,$2 +rm. +fi +=>[^] "name(transition),pos(0,0)" +if narg($formula) u "{$1}{$2}{$3}{"$formula"}_"{$3==2?2:1}"{$5}{$6}{$7}{0}" fi +fx_spatial_transition_preview : +if ($3<=1" && "$!<3)" || "($3>1" && "$!<2) +gui_print_preview "Warning:",,"This filter requires more input layers to work properly." +return +fi +fx_spatial_transition ${1-3},"$4",${5-7},1 +mc_dragonfly : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_dragonfly {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Dragonfly" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_dragonfly_preview : +mc_dragonfly $* blend[^0] [0],alpha rm[0] +#@cli shape_kookaburra : _size>=0 +#@cli : Input a 2d kookaburra binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_kookaburra , +shape_kookaburra : check "${1=512}>=0" +e[^-1] "Input a $1x$1 kookaburra binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgOTU5IDEgMSAjMTEwNwp4nI2VeWyVRRTFz3TfH6Eo7qLFSDSKgFBKSyGARSgICCggdYni0gaDiSHRhESjiYZocMEqFCioiNWispQlRNPUQsUCLbZQS21tKd33je7net+88nwvmugfv5z55r2Z755778wHH/gYGEDpTXVgHO/DJE7BNEZjOVdgHQ36JAnJTMEGvoKN3IjX+Do2cRPe4Jt4i2/jHb6LzdyM9/g+tnALPuCH+Jhb8QlT8Rm3YTu3I82Shh3cgZ2WnZZdll1IZzp2cw/2KJ/zC3zJvdirfMV92MevkcEM5Rt8y0xkcj/28zt8zwM4wIM4xEPKYRweIYtZyhEcsRzFMR5TjuMET+BH/oRsZiOHOcjlSeQxD6d5GvnMxzkW4jcW4QIv4neWooxlqGAFKlmJy7yMGtaino1oZiva2YFu9qCXfRjgIEgCYoyv+Bp/8TeBEmRCJMSESbhxiMOMktEmUpZgQLJxvSSiS/UGSUCz1XjUSA4i5X6UqYbLTTgnP2uMuTbGXJ7CKY0zT+P8VePM51mNtQAFPG/jLeIFG3OJxlzKSxp3Oco17gqNu5JVGns1qllj469lvXpoQAOb0MRm9dKCFrahje3WUwe70MVu662HvdZfH/st/epzkEMY4jCG1S8pFqExRnyMj3r3FT/jp/79JdAEKM48BEmwCdZchEioCZUwmxMn4RKheI4jTIRbHR5j77n/r97rw+17wkfeH+bW0JG4nOqKMdTWLtgS7NYg9eLy41SnvwD1GTCi/urbz9bfx+bCR3NiDARGbJ6oORvW3A1ZBjWXAxzQnDpz26d57sVVzXm35r5La9DJTkuH1qTd0q41akOrrZVLW7UPWywtto7NWs8mS5NbGy2NWu8GW/d6rX+dpU57oW5Ea21v1GiPXLFcsVRbqm3/VGkflWtflfEPey4uaZ85z0gJS3BRe69Ye7CYxdqLRTivfVloKdQeLcBZ7dczPKN968CwHNfzFoZ+OaoagquShV8YrOfhoPZ3INrlB5ykH5okU/veF/WSYe+CdO7WeyLd4rw30vQOcd4n2/gqKOPxKTdgUKKQypd17ztV16NX7tD59eiRcaop6JTb9T5K0XfcppqMVrlV1yfrGbxF9SU0ys16V72IOrlRn1/QMzlW//c8quU61XWokjG6z3P4U0br/s+iXBzYymdQKmFWSyQYH/FpPMUnkcQkrOVaPME1WKOs5mqs4io8zsewkiuxQu/W5XwUy7gMS7kUS/gIFnMxFnEREpmIhVyIBVygPIz5nI8EJuAhZR7nYS7nYo5lDmZzNmZZZiGe8ZipuHSme+w97/otjnGIVVwaa8feGosZbp2BGMWlMXbs0hhMd+v0/xx7rru2n+feLmK9xrHuZ++x99y/6z89xXn87unfqa6c/K3X1nh6jUa0Mo1TMdXyIKbot9LJZE62TOIDmMiJuJf3YAIn4G7ehfGMQhTHQiRIv69jEMlRiGAossr/As3XmqgxIDI2IDEgMSAjNTMKeJxzZ/BliGJgYIhmMGJIYVBgyGbIB8JshkSGJIZShiIgTASKFjNkAOkChlSGWKBaAORKCL8=" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d kookaburra shape]" v + +mc_kookaburra : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_kookaburra {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Kookaburra" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_kookaburra_preview : +mc_kookaburra $* blend[^0] [0],alpha rm[0] +#@cli shape_rooster : _size>=0 +#@cli : Input a 2d rooster binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_rooster , +shape_rooster : check "${1=512}>=0" +e[^-1] "Input a $1x$1 rooster binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgMTkyOSAxIDEgIzIzODEKeJyFl3l0lsUZxe9k+bInJAJhlUWBIJvSqGjV4gYiaEUxIKvIYgC1Lsj2IftioaKIIjsIiKAUq2VRrFBbq4IisgkIBBISEpZEZAsEmOud+T4CnJ6e/jHn99yZeWeemXlmeRGBCAMDKLU7Y1BMg0o2AiWMQOVyRuIXRiK9nFE4zihUKWc0fhXTxROM9jrEAE4xgCZqp5iX7Ci1EYPTSmXqK9N/e0lH4GYbg5OMxRmvI8M65godq3ZiUep1lHScymJxVsnpTOlSxuFcuY5X2WXd2o8pXjoe55Xv8i7Ij3bejwTpBOk4lQVwUf600xhOMlE6QdqVXcp3fiTKTgI9Y3x+W+9Pw3L9oPovZQas+r8o/9vaBPnTXDpKZYnqr7m+j0Ybm6Ty28Q2eMA+4FNr29qnVvZBfK72ptu2+A8rYY5tJ9bCStsZ/2YdrLVd8U/xX7Yn1rEuvrF9sJ7XY6O4jvXwvfgF62Oz7Yt/sAG2eGZgm31a7TbETzYba8Wd4me8AbvFT8WfbT+xEfbZ/lgj5oir2RgH7ADPPPsMVooHrZvDXvg7m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FTyi+UfVR+91J+kfo6qjm5qOT0YZUd0bvFvWl6q+5RlR/RXXZGfvdW+THpIvl6UvPt9C96vxR6nYI+0sd11zl9IqxPSB/yY6uAvnpfn5Rd4HUqslV+RnPgxl6i+tkqL5U+KH1M7fdTeZl8cfqo6MrP04033vvUz7/Rk70+rO+yFbcHZBfJ7id7v/fF2dW97fy4ZDsf+oftfKWQHev7GhC282Q/q/29X3Pi2n1e+8TZ7psX7HUqj9Z+i8NA7dcCrcEeffOybSJfIvGz7EE6h9z/207N2WDbQmOPCNsBjethjSFG/bbX2B0f09zFyD/HgNhBc+T4kOoFNLY7/L+OW99s7bcicbP6ydbeWqF2n1asL/esoDeIY4reHBGa8yS9N4zWIlFvHscEJCjF6xyKK0+xiNG9ESPGhlNIh1LgCjukA1flhXTgv+r9r3SpfpT+UyL1/xdxRbqs9Res1PL0b3UXFlsxIDE1IDEgMSAjMzMKeJxzZ/BliGJgYChhyAdjPYZkhkyGXIZ0hiqgKABOuAT9" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d rooster shape]" v + +mc_paw : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_paw {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Paw" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_paw_preview : +mc_paw $* blend[^0] [0],alpha rm[0] +#@cli shape_mapleleaf : _size>=0 +#@cli : Input a 2d maple_leaf binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_mapleleaf , +shape_mapleleaf : check "${1=512}>=0" +e[^-1] "Input a $1x$1 maple leaf binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaX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4Bz0c4Ew/YN5VlK3UY3sv+a28P6j/wbrtaObaasjHOyhFqZw+Tnxhn8BD6XcNZE+NML2Sej9BGjHO5jyLwPngrd22areX8i+mv3Oee98Jv8m0Qgfdwfr7o1tJHTC+7R1N+rXYRf8Gtpr8o67Q8nNkNbjHndYx1upW+o1rpavUv9P2uRv/Er8K/j3+A+A6er3ITSH1P7h7/rIS89eBOimmFG0POunOHRbXMjSZXeYw5qiV8l8e5s0/wfbGNcj9gHRv59ng3cB9y1JX7MAr3JhdduS+jms83936+Yd6mzHzXlXuhkzbD8/gP2MV30CbKlMB/Cj7G3ej/GZIW5Zs76lp0MtZa+/+LtjrznLGkbom16GSstU7+v2R9QbfEWnQy1lr7f5+2OvucsaRuif1vnd2mbiZz6rfrv+okDzMxIDE1IDEgMSAjMzMKeJxzZ/BliGJgYChhyAdjPYZkhkyGXIZ0hiqgKABOuAT9" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d maple leaf shape]" v + +mc_rooster : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_rooster {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Rooster" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_rooster_preview : +mc_rooster $* blend[^0] [0],alpha rm[0] +#@cli shape_paw : _size>=0 +#@cli : Input a 2d paw binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_paw , +shape_paw : check "${1=512}>=0" +e[^-1] "Input a $1x$1 paw binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgMjAyNyAxIDEgIzIzNTcKeJyNl3d8V0UWxU8SCKQRFNBF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!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_flip {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Flip" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_flip_preview : +mc_flip $* blend[^0] [0],alpha rm[0] +mc_information : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_information {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Information" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_information_preview : +mc_information $* blend[^0] [0],alpha rm[0] +#@cli shape_flip : _size>=0 +#@cli : Input a 2d flip binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_flip , +shape_flip : check "${1=512}>=0" +e[^-1] "Input a $1x$1 flip binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgMTM3NSAxIDEgIzE3NzgKeJxdlnl0VdUVxr8bKWEqMgoOCIQkICQMFnPfe8l7CSGkSlAxGMQAUWODVFLKAkqRwYYGWUKtVsWpdaFVsOhCRERFREWlCghI0VIZa0WpUgeotra2nt3fOSqL+sdZv+z7Xu67dw/f/pSlrEiRxOm8Ik8DXUKlrlJVbrRqXK3qXL2ucVM01U3XT9x1mu+a1OwWabG7Sbe427TU3al73L1a5u7Xg+4hrXSPaJVbrTVurda5p7TebdBG97w2uZe02b2iLW6btrudet3t0m73pva4t7TP7dcBd0hvu3d02L2rI+59feCO6kP3sT5xx/R396k+c//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d flip shape]" v + +mc_mail : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_mail {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Mail" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_mail_preview : +mc_mail $* blend[^0] [0],alpha rm[0] +#@cli shape_information : _size>=0 +#@cli : Input a 2d information binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_information , +shape_information : check "${1=512}>=0" +e[^-1] "Input a $1x$1 information binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgMTYzOSAxIDEgIzE5MDMKeJxtl3lY1lUWx7+3yXEac0pnbDInH80Ze5pqZlrGabWy0txTJEIy19xN0ywXXFhcEcEFFRAVF0RUEFGUANnk5VVEQVFDRQXXtGemnGrKns6Z7+++P5DMP87zOef78v7ee8/v3HMPuAt3GRiA9usrjdBUWqClPIw20g7t5TE8Lk/iH/I0npUOeE5ewIvyMl6R1/C6vInO0gVdpTt6SE/0lj7oK37wlwC8K4HoL0EYIAMxSAZjiAzFMBmOETISo2UMxso4fCjjMUEmYpJ8jMnyCT6VKZgq0zBdgjFDZmKWzEaIhCJMwjFH5mKezMcCWYgIWYRIWYwoicYSWYqlsgzLJQYrZCVWSSziJB6rJQFrZC3WyjokSiLWywZslE1Iks3YLMnYIinYKtuwXVKRJmm0HUiXnciQXdgtmciUPdgre5ElnyFbcpAjudgneciXfBRIIQqlCPulGB7x0ErglQM4KKU4JGUoox2WIyiXClTIURyTY6iU4zguJ3BSPkeVVNFO4bScQbVU087inJxHjdTQanFBLuKiXMJluYwrchVX5Qtck3m4of64zlxcVz98KSG4pH3wb+aoRnuTs3BWe+Er5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SjV2Kb1RvSef/Hsd3GdTyBVKufrGea1R068ecuq3jm6ujUXRXSbXyqAR3dR4+e4VlNcOnoPnq0ugHjqVdjl/38LHZb/Rzp6D+nR8+TTn84j0yr++jRGtLRa7HnF4wlL7B3xN1GR794R3r0Eu8WJ67jZd4pjn6FXMX4TlxJXq1nttUdOvEXd+AKnl8fi/VaA8ZQ/yVzyKI7cjl53WV7KGva57fDj6zzHPa5Qm2Lm1Z3/Da8L+r81viefjb7a4E+jP/V+63wHc+Az38I39b7Lel76C9hb/wjvuF58PkP0Pdy79H0W7Dv1/m/52xzgH4Ue2pz62dZvxn9g65/P/1S5n0x/fvwtfUj2ZOb4iueF59/L/0y129i/UzeKbl6D/3Drt+Y9+ER6+doI/rlrJUI9vwKy2QyQxdiC8+IwxSekZ2867eS6eQ2no0dvFu280w4TCVTOSOk8WxsJ9N5FhzuJLdyhtjF2k/hHbSb3MJ4D2s+mfFeMon3cZae5j0UzrWcYS8I4/qq2RvCuMdq9pAw5rKaPSaU7+kce1CorfF40suajtUQzmo17G0hnB1q2ftCONPVsjeGcGa4wN4ZgmNkFO++E6zZSManWKsRZDVrdT5Zw5qcy+ddYg2G8/eusVZCuL6v9UveLTNNsE43U3WK+VQnm0k60UzQ8WacjjGjdKQZrsPMUB1iBvEeD+IdH8B730/7ciboZbpzbujCWaITZ4yO+pJ5XjuYZ/Qp8zd9wvxVHzXttK1pra3Mg9rCNNPfmSb6G3O3GvOT3ORseoPz7DXOvxdwlrNypZSjlHN2vmRzLk9HimxEAmf9KM7EM/l/w1gZgn78P+QJaY6WV/4PhbIE3DEgMTUgMSAxICMzMwp4nHNn8GWIYmBgKGHIB2M9hmSGTIZchnSGKqAoAE64BP0=" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d information shape]" v + +mc_phone : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_phone {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Phone" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_phone_preview : +mc_phone $* blend[^0] [0],alpha rm[0] +#@cli shape_shopping_cart : _size>=0 +#@cli : Input a 2d shopping_cart binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_shopping_cart , +shape_shopping_cart : check "${1=512}>=0" +e[^-1] "Input a $1x$1 shopping_cart binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgMTM0NSAxIDEgIzEzNDIKeJytlWlQlXUUxp9jWippabmmuEI5jjlFkFcREC/34kbCVYlAQYGATAkHF1RwQZFFzS1TUzNX3PdtmpxmaiZrpj6UzdQH/aRT5mRZpq3/03Pf+/JyL5Cf+vDM7z3/dz/nOeePVmglEICadj0Ro00qUo0PPmqSzQcd+0xa0PF/XZcWcn2aEz/4OM3E4p62w0QzDMNMDGJMtKVoWzH2WmPc8rnm1zU9F4M8zZW9ulcu6AXqvJy3dU7PUWflrKMzciZEp+W0o1NyKkQn5aStE3qCOi7HHR2TYyE6KkcdHZEjQTqsh+SQo4NyMET1Uh+iA3LA1n7dJ/sceXBD3RYvajf+qwdr9Bb8zNFLFl/Q9dhDttNXLX5n3KQXN02STTd2kz8wfo/nG+nGLvIW4+b04kfy3SDeNp4mTMJO8ifGDdzB+38mtzv04o7NX4zXpgfvkL8yDqUH28i7jBuZjHsm2aYXW7jewPtcD9CLt8nfGQfzDzPGZjI28/4/bf7F9WD+TW7idQ38x4y1OQYbeV4ZBxM6zuZYbAiicD3AsVhPtmK8jnzIZmsdb3Mc3iTbMG6JD5Nr+Yy2FifhCZ1AZuEpxmtY40jGq3U2hlpcAJfF5XCTdVqHCRY3I0NTyF3IZVyrh1HM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Ql+jz9Phiz9Fn6P5J9MIjzsR/3joG4ZnogS8PZLx3h067oYFoj7sa//BfTxjEgMTUgMSAxICMzMwp4nHNn8GWIYmBgKGHIB2M9hmSGTIZchnSGKqAoAE64BP0=" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d shopping_cart shape]" v + +mc_shopping_cart : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_shopping_cart {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Shopping Cart" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_shopping_cart_preview : +mc_shopping_cart $* blend[^0] [0],alpha rm[0] +#@cli shape_mail : _size>=0 +#@cli : Input a 2d mail binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_mail , +shape_mail : check "${1=512}>=0" +e[^-1] "Input a $1x$1 mail binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBpbnQgbGl0dGxlX2VuZGlhbgoxIDE5MzkgMSAxICMyMDIyCnic7ZlpjBVVGoaPxBA1REfHuiHqOC5xQhwNcYkaxyUagriM24i7McZoXGJc47jNqLgjgigCgmyyL80utIA2IrIJooOACAjYgi2INKuIWHe+d85T3Sffvf/0j8n8IC/f+1Sdc6rqVp33nA4tQgj2b58Q/wV0xynlcoP9p6H86/Wf1l5LVPUjpvuhqh81PQBV/ZhpK1T146YHmT5BLT3Y9F/U/zY9FFX9pGkJVf2UaWtU9dOmh5t2opb+yfQZaumfTZ+llh5t+hy19FjT56mlx5m+QC1tY/oStfSvpp2ppSeavkwtbWvahVp6kukr1FJ7HOWu1NLTTF+l7mZ6hml3avlnmr5GLf8s09eppeea9qCWnm/ak/oN03amvajltzftTS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tOZ5t9IrfXAe3ncl1Ot3D8tj/dFdQfT2rx5X0btTMnj/VHd3nRSHq+/uN/j83jdTbnO6n8kdU0er7Mpb+bx+op6tNWXJfWoPF5nUy7O43U05ek8XkdRD7P6oqQemsfrasr9uVsH/L/+3da/1d9zq6n+XvxfihVCRzEgMTUgMSAxICMzOAp4nHNnYGDwBeIoBggoAeJ8JFoPiJOBOBOIc4E4HYiroGoBnXAE/Q==" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d mail shape]" v + +mc_barbed_wire : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_barbedwire {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Barbed Wire" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_barbed_wire_preview : +mc_barbed_wire $* blend[^0] [0],alpha rm[0] +#@cli shape_crosshair : _size>=0 +#@cli : Input a 2d crosshair binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_crosshair , +shape_crosshair : check "${1=512}>=0" +e[^-1] "Input a $1x$1 crosshair binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgMjg5OSAxIDEgIzIyNDMKeJyVmGt0VcUZhj/2hJBAAiQhHBVBFCwolirWglisl4p4AS14oSAEBOQiJCigEQxIFEQuVoF6ARFEUUQF1CjFe0ELCFakSGmlbWxptaVClz9cq13tnj4z+8yZySGB+ONd37MnJ8k5++yZ73tfiSRqIk1EUMGhE6RzfLb0ii+Sy+P+MjAeLMPiUvmXTskRXSpj42L5Ev5CF0lF3Eo+h2t1K6mMW8oB+DNdKDPjFrIP3qcLZC68B/5EN5eFcXP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d1znvO1l7T1yObkx75YnaeWiTEThvnfhs57mN/3Ze3Phy59GNX3fe3fj44ZYj6+/LrL+P7PUI6/sjmwe4bMD4d5cZmPfhsgTzXl3GYD6Pyx7M53eZhLlHY9NZRX/tMgzFfffZRj/tMw+Tf5gs5Fb7XPiM5GJ7L5LsxOQoLlPpo13Wouzz6jKYntpnM+dpn9mYveSynHN0kvHcYfeu+c6S7MfseZcJmfPCZEXT7XmTk8mQzHnnsiVzbrrMqb32WZTpByajmm37TE4muzJ91GVaJUHW1Ur7DKwQuWzM5GQL0plZrk6yNPO8q0zGZvI2xT5Jsrf/BZncv4Os7psgw/s6yPaOBJnfIdaXa5MFmlwwR1boJCM8CK/USXZYCz+lk0zxQJA17g8yyL3pbPI5eHeQWe7KZJm5sh02Ged6XrM1bpbJPk0OWgO/Cr/BustKa4IMdSP8lk6y1XWZzDXJX10WuyrOp98kGe2yuLnNbnfAJsf9SCeZ7qJM1tvC5r4mA/4UnhUX4vVS9P9CmxPX6iQznhwXMW+lmKGKZFxcKkfgw5xZZfEQuS4eIP3iS6R33EO6xO2k8Mj/Ae4IPV8xIDE1IDEgMSAjMzMKeJxzZ/BliGJgYChhyAdjPYZkhkyGXIZ0hiqgKABOuAT9" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d crosshair shape]" v + +mc_crosshair : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_crosshair {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Crosshair" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_crosshair_preview : +mc_crosshair $* blend[^0] [0],alpha rm[0] +#@cli shape_phone : _size>=0 +#@cli : Input a 2d phone binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_phone , +shape_phone : check "${1=512}>=0" +e[^-1] "Input a $1x$1 phone binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgMTU2OSAxIDEgIzEzMzEKeJytl2tQVVUYhj80R9IkTTLUFBUGJURB7sjtYDlZWWlmgefA4S5qkvcbXiC72G0q07KypKvTWDaWZXkp85aXQGH60dTUTDP96ddm/P/t3u8954gcjjPW+GPNs58FrL332mut90P6Sb8oiRJBm3l5sMToMInVERKno+ROHSPxOl4SNFGSdKIka7Kk6GSZolMlXdMlU7MkR3MkT/OlQAukSIvFox60UilFC+dcjRLH9cg8vUm63VKZrwPoj+lAeplG08t1EN2rg+k+HUKv1Bi6X4fSq0DzajyzA6/V4eyv01h6A96jO0jzRo2jL9KR9CU6mm40X4r3NW/SsRy3SePpy3QcfblOoK8AzVdiXsxXgearNYm+BjRfq5Po6zFvIdp9mjWFbjTfpKl0o/kWzG93kOYtmkZvxZzbuK06jb5VM+hbNZP+NGj+jGbTnwXNn9Nc+jbQfJvm0V/AdzMPsFRe1Onsfwnf0vxlLaQbzV/B9+0O0vxVLaEbzbfjG3cHaeNu1xn0HXo3fYfeQ98Jmu/UmfQ3QPM39V76LtB8l86ivxXk23of7/OO3k83mu/WB+hG83d1Nv09fZC+Rx+iG23cPfowvQ00b9M59PdB8w/0EXiA5h/qPLrRcUvAR+G96bjF4Hx4gI5bJB/p4/AAHbcQLIMH6LgFYDl8On6/HJ4PLoAH6Li5uL8XHqDjZuP5fPAsPK8PnglWwDPwPhXwdLxvJTwN718Jn4L5ME7GvPnRn4J59MMnYZ6r4EmY/yp4gryu1fDx8hrouGPxfWvgo7EOauBxWB+18BFYN7Xw4VhXdfBhWG918Bh5Suvht2Cd1sNvls3aAB8oG0HH7Y91vxAehf2wUBZqI/ZhqC3CXuxpjfx5A/ZrvdSz1WEv12JfW6uRGrZq7PsqND/OgVCrxNnQ0yowP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cupid {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Heart" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +} +mv. 0 +fx_cupid_preview : +fx_cupid $* blend[^0] [0],alpha rm[0] +fx_gear : +max_wh:=$!>0?[${-max_wh}]:[512,512] +w,h:=S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)] +l[] { +shape_gear {($11?2:1)*min($w,$h)},${2-5} +if $11 r2dx 50% fi +frame {2.5*$6}%,{2.5*$6}%,0 b $6% * $10 round c 0,255 autocrop +100%,100%,1,3 fc. ${7-9} rv[-2,-1] a c +gui_set_layer_name "Gear" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +} +mv. 0 +fx_gear_preview : +fx_gear $* blend[^0] [0],alpha rm[0] +fx_heart : +max_wh:=$!>0?[${-max_wh}]:[512,512] +w,h:=S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)] +l[] { +shape_heart {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Heart" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +} +mv. 0 +fx_heart_preview : +fx_heart $* blend[^0] [0],alpha rm[0] +mc_paint_splat : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_paint_splat {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Paint Splat" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_paint_splat_preview : +mc_paint_splat $* blend[^0] [0],alpha rm[0] +#@cli shape_barbedwire : _size>=0 +#@cli : Input a 2d barbed wire binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_barbedwire , +shape_barbedwire : check "${1=512}>=0" +e[^-1] "Input a $1x$1 barbed wire binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBpbnQgbGl0dGxlX2VuZGlhbgoxIDY5MSAxIDEgIzk3Mwp4nI2WSWyNURTHP1qvqvpqnh4RNSwIQWtKDAlaNbQUbdASG0QsEGJhQSIRK0OCDZFgIRYskEhEQsJWYowhhmpLa54aauh71//k+33ezUuFxcsv95xz7z3n3P+93ws6BkGgX4cg/AUwWZtyWWJWyv1htpgNbdxJ7CTGxJiYA2MeG5xztt4w/C9duF4JbMTe5MJ1S2Fkb2Zc4tk7i69cuP8c2ED8a88ey7DbuMyz2zpviC+DdeTdxn6fsc9lXh3rJf/hTzH+kuF/xvqZ/nkunPc//jh288+HT2TPz7Bb/FPZu5Kn2Rdgz4yP7I+Jb8+eJ34in7/Zy7E/kr3Lf9grXHgOzejqJ7oQXK74kbgqaHab/9o7pzhxtv5ysYedK+dg8d09f43YW3wrf1/xPfZasY/4TvYB4gfqXyn2t3GG/ZwL5zcyr9XhV1yCcTb5WfwN8v4qDqP+GejYrmBCHCN+d2n9GG+K3dDbaPpTgp5t/RHiJPEH/XL0846417sPI8XprGP9uSfu9/xjxRrxgXjAuy9n4AFxtZ2feJB7Y/bzYk/xuVho+hTXmi7EI9RpdVwUB6LDyfRxg+lTPEFfLO9L4lDqLxN/iVuD8B05zdjiLovvyXMQ9tFwGXVaP66Ih1lvFfsPRN+FjJd48Vep385vdxC+SwWc80LO0+Ku0b8WcZd4QZxI/3t6cdfFQ9S3Qzwrjucc4+RrcXdd+E620DfTwXbxNP1KUncUf5++Wp7HsW8TT6Krn8Q1efO6oJNT5LlFPCZO9eKb0bvlP4q8Z8Ey5pWLR5kX6c7OIUGfh7NOMdwnHhGnUZfFv2W+1TFEfEgfD7UTZ/reJW4U91CP5THY03Mr8e/Yd7u4Rtzp0u9KIki/a9/oh93/ceJmcYW4ibh6/J/xr6fudfTH9J5Hn+x8VotzPH+dOFOsFvsR15V87b1Yi910PVtc7MJ3yfz5GXG59DWffs4VK8VexMXxx+mL6WINbCPPJs5vkafPuLdu9N5Uu/T32I9PuvR72g3avCov3uqv4Dwy41PUX0X/X3rx0fcu15uX5N5F86K8bF5pEH7fOqKTLPQdzYvD9uZNYb9f5N/GOVd5cTH0Xkx8jnc/WhkvJc7e2SJv3e/os4S42+gnWieaH/lvsc80xt9Yp5R1XojVQfp72+LS/5NsbO/SMvpo4wmefTnnZ+NiF77z9ei80rNnodcadGj7F4i11JnDeDDnmeCexb2+FaDnVvTfwH5R/+27av4ixvb97eONX6VCnRVRd1Mq/G5H/kb+90T+ev5HjCH/vMqU+w2wUyNRMSAxNSAxIDEgIzM4Cnicc2dgYPAF4igGCCgB4nwkWg+Ik4E4E4hzgTgdiKugagGdcAT9" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d barbed wire shape]" v + +fx_sierpinski : +foreach { +split_opacity l[0] { +100%,100% sierpinski. ${1-7} ++fc.. $8,$9,$10 j[0] .,0,0,0,0,$11,..,255 rm[-2,-1] +} +a c +} +mc_australia : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_australia {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Australia" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_australia_preview : +mc_australia $* blend[^0] [0],alpha rm[0] +#@cli shape_paint_splat : _size>=0 +#@cli : Input a 2d paint_splat binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_paint_splat , +shape_paint_splat : check "${1=512}>=0" +e[^-1] "Input a $1x$1 paint_splat binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgMTYxNyAxIDEgIzIwNDEKeJx1lnlw1dUVx8/Nvry8bJCNQERKFEIxLAHZBASUFtl3AwQElE5bbGs3hNKRjqV1VxZlrVOnnY4dZ9qqdUpZDUteQgKEBGJEQAJkIXsAGwr39PO7eThMp/3jzPd77j333HPPuZuESIgRI4JEBSIkwkZLjPWJz8ZJXFB8TvdJrI2lL0aisYmyUdiGS5gNk7raMAm3EbKA9k80QvKtX/4BLrIJskcjZYlNkn86TJa9YIHtLvscpoAR92Cq7HeYJgeCuF/DGJcOhjrcp0YW2wzJCEp6EPdht9T1h8syZx8pTzmMcnhQY2S5w1gw7Ws8pHGygvZP1e+wUONlJf6OaCLYQ45pkjxte8kl/LRpN2nC/3qbLc3YX9fu0sI8621/uUnfvzRV2jUafYrc0Qz6Y+Gr5CtsPezE93s2RM7pd+hPkgZ8HbCh6L+QRsYdIp9fwJsZ9yn59Hgr8RXaSGzWMr+f9ig5r+ukQxNoj3b8Br4KqcsF+FfEUUidLsI7NQXuky/xc1vT5DB1qdHtYLxc1h1y1CbKVd0px2w3qdfdUkRdGvVdCZCXVn1PSlj/df2DHLdZ8m99X0ptmZTZE3LCnpSTTk45OWXLpdyeltNOKqTCViJn5IytkipbLdX2nJyzF+SCvSgX7SW5ZC/LN6nXHr0iueRvr9bKYPK7T+tkCHnYrw2SBx7QRocHtVmG0X9QW9DDwTZptx2yjDzt0g5ZTq1+rzdkJfX4o94EU+V97ZRnqMEHegvMpI5R1OaOrNJeUkLubqnCs6RUU8wqvU9OahrYW8o1A7xfKrUH2EfOgM+gn9VMsI9UgU+Dn4ErwWpwBf3V2tPh5+Byh5nmKfx5uMxhD7OUeTwsYN5q5lmsPR3mE1+1ppsFmu70+dStCn02dT1LXDOo+xlwCmuo0FSTCk9DUh3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ko19jQYcfwB+CV4B7wf/0vF46c++uoh9Oe05jgfkFHwAcZyHn8RnjobwJgekjHkjuPvv8EaWso8i2BM3eTePM2c49W/jLS1mXCj3SKPu4l1NJMYdst1ul212m7xj35G37VbZimyxW5DNstlulF/bDbKBP9BtXc5/wftPFMhaxnZovqzhzW7V+fJT3vBmnSPP8a436kz5Ie9+nU6VZ8n/VZ0iq62Xg8nyPeutcxJxh8ku661nHPs1DImU3/Fn+4IzYTUb20julWh5l3/J56yxkzutEr2Rda3Bt3enVbDeJvTnmaMdm9NIM/lex1yt9JU7PY6Yo7CLcnlrcbrnO1xOkF9Pf4Hx9eSwzOl++RX+P+aOb0V/kT+Lx732Lp7o2jeyTo977b/hL/qRs4mX3zre1f4SOeni8fIyefLsvf/ZK/w/Pftm2l8N8ib4a/APwUbvTJHfgPsbxBOrX97gr1rCmjrc2Y2TN53uQ/eR3zjqlEyd45x+BdzidD96DPmOo67J7IkE9Gj2Vhy17tLb2FMXsNtBXUuJr5i+Hfy3TvB2FNO+0/Fk5oqnXv/Nu8H9spt/8v/n3V0cd3kJ/v8XLybuLp4Cj3W8jPYA8e4K8iLycZcfpX474aXMdZi/9zbi8fgi1nE8iCXEehfzWW8xa8onb4EgFrHeJ8nzMdazkNwfBRdQs8PEO586FhLTPOp8iHjmWu//Fy2zuBf2kLOZgf8A3He64TEgMTUgMSAxICMzMwp4nHNn8GWIYmBgKGHIB2M9hmSGTIZchnSGKqAoAE64BP0=" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d paint_splat shape]" v + +fx_barnsley_fern : +foreach { +shape_fern {min(w,h)},$2%,$3,{$4%},$1 *. 255 +100%,100%,1,3,[${5-7}] +rv[-2,-1] a[-2,-1] c +if !$9 blend alpha,{$8/255} +else => "name(Barnsley Fern),opacity("{round($8*100/255)})")" rv[-2,-1] +fi +} +fx_barnsley_fern_preview : +fx_barnsley_fern ${1-8},0 +mc_gum_leaf : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_gumleaf {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Gum Leaf" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_gum_leaf_preview : +mc_gum_leaf $* blend[^0] [0],alpha rm[0] +#@cli shape_australia : _size>=0 +#@cli : Input a 2d australia binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_australia , +shape_australia : check "${1=512}>=0" +e[^-1] "Input a $1x$1 australia binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgMTUxMSAxIDEgIzE5MTQKeJx1Vnlw1tUVPTcJJEBCCBTZF8MyCooga0AQBKt1LFgRpAUBywyDiEV2EJCKYoGmQEcKUgIhbAYISwoiSysYBNl3CVuEIG0KoiJlyZflnZ7fyxeMnekfZ8657/2+t9z7vnsvIhBhMEB4Z0cEIl0UlroIhBiNScI6F4kCcWBPZgwyXALypaewIja6qrjHWEz3OgE/aDzQm6Rv6tt3va6C76RnsJJ0PL4VFzICc71dGTdY1etM7XmXhuusjg+05hxXCws910eKeK5rqG+jsJVxWOEM37Ox1onS/uXwiR+LRRFb6mwx2Ml4rHI9NF8Bf2cC1rpnNVcB/9BeGa6vxgLu43mde0nfV8V6P14NG8Q7+TPdpw926CyZsreLt7h+ZfgBfOxexjbPwXxNjb+Aj1lL3BObWVvjJbzV9fK83f0KfxPvcC/+D/eWb6Owi3WwU2cJ6T67y+jPWBdfKwYX+JLiUN7bV1055DCYL7Ur4Gv29THaw3qyK+FffFl2DD73dizyNB/4Zo++v+6q4d/so3gZsjR/w1WX3/sgU/o7V1O6NzZ5XUv6xbCuLf0CNrI+bjqtwZ7YIH3X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Zo3w5AWm8IB6HVJ5XPh2DpZ5HqU6ew3qOxGLl2GJmIINvYNF9PUL19CHFYi3WcTjms4niFOhhmMdG0muwlkORzIaKYzrWcAhmsoHG05HO3+IPyueBXs1X8b7qwY+6rv9+NQfjPdWtkHywyuvaeherdebB6gNqKo+txHLp6aqtd6TTOAi/V20OdCoHYhqreL2Ur+Bt1e/byuFLOEB9RpzXKeyv/iMW/+Fy3e83eEs9wy35+a/spj0rYJS3l+m+nTFA9g9MxYfKs/2UQ2+qDhXL3x+qFvSWHfQpxaopC1VTemkumC/kB9rD5J9W6PmTsbZ4XjH7XnaBYrRYazyn777VfzsUttt5PU9naYNOys2BXqQ61VHnyOdc7dtSOTgmrB9Ba+0f6IWqfY0U7wXixuL5WrdYcQnG5jDR8x8Vg0TxLPk5qCsh/W6m+owWWi/k884MxaC66kaczvyu/J6g2hKn806Xf6O0bqzO+g5SXUXVi2lIUZ91lVMx1U3BFDcZk4W33CRMchMx0U3ABDce44VxbizGeozBmDACPdqNDmMU3nRveox0Iz1+597ACDfC43X3Ooa74cJrGOaGYagbilfdYAxyA/GKG4D+6huKVbv7qZcr1Lspkr96qfco1H07qh8p0H3bqo8Maa6Vi9P7qY0W6nNu6y01V/9zU+/oIf32G903Xn1knHqcSi4a5XW/WrfU1KpnilIv+1NEqr+NxFn5McLrkvEfuWQ+Qus2LVJX7O1yWjMGMfJfRe1xTXmvifYL+oGm6m1DerdNXVOhCRrrTqVo5BrdR6JLFB5EQ/WwARq4BkJ91Peoh3rqp+p61EGdMGqr96ol1JRParoaqKFeO0H7VRHi1UeX3jlW56ogv0S78kg+9F/vDNGsMSAxNSAxIDEgIzMzCnicc2fwZYhiYGAoYcgHYz2GZIZMhlyGdIYqoCgATrgE/Q==" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d australia shape]" v + +mc_maple_leaf : +max_wh={$!>0?[${-max_wh}]:[512,512]} +w,h={S=[$max_wh]*$1%;[max(S[0],1),max(S[1],1)]} +l[] +shape_mapleleaf {($7?2:1)*min($w,$h)} +if $7 r2dx 50% fi +frame {2.5*$2}%,{2.5*$2}%,0 b $2% * $6 round c 0,255 autocrop +100%,100%,1,3 fc. ${3-5} rv[-2,-1] a c +gui_set_layer_name "Maple Leaf" +gui_set_layer_pos {0.5*([$max_wh]-[w,h])} +done +mv. 0 +mc_maple_leaf_preview : +mc_maple_leaf $* blend[^0] [0],alpha rm[0] +#@cli shape_gumleaf : _size>=0 +#@cli : Input a 2d gum leaf binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_gumleaf , +shape_gumleaf : check "${1=512}>=0" +e[^-1] "Input a $1x$1 gum leaf binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgOTY5IDEgMSAjNTk2CnichdXnVuMwEAXgiUMNvXdC76GFQICE3kkoSahPuu+xr7HPcM/OjGxFArP74zszNgdbVqQrCihIUIKIdf7mCiOBgEXVCJAM1fukrQ3au7UBjczURjQxU5tUs63NaKEW1UqtzNQUpdBGbWindtVBHaqTOtHFTO1S3dSNHupRvdSr+lSf6qd+DNCAGqRBDNGQGlbDaoRGMEqjaozGME7jzNQJmlCTNKnSlGZRTWOKptR0WE0/bc3QjDVLs9YczVnzNG8teP2CWqRFa4mWPMu07FmhlVirtIa1/8hQxrGO9R9s0EZoE5sxtmgrtI3tGFnKsh3sxMjRLna/2cNerDzynn3sf3OAg28OcRgqUIEVUfQc4chzjGPrBCfWKU6tM5xZ5zi3LnBhXeJSXeGKXdM1u8GN5xa3se5w96N73LOv993/c5914/X1d/9rLPFj88fwdTxGCSVVtrWsHvBgPXr9o+cJT+rZ1mergoqqosrc3lzX+yrVUFMveFGveA3V+ze8We94tz7wYX16/WfI7b9e+33ccz7sO6J3umOIxhSNsT5u8y3ud9XC76x6c1KxcxXN3VM4r4/O3Jftb1TS381dU9EauOZ1K2tY1rOsb1nvsv5lP0R7RPZMUfdVQfdYtO9kP+Z530b7Okc53fNZzgTJC8kOyRXJmAznkeSWZJrknGSfZKHkpeSn5KlkrWSw5LNktWS3ZLnk+yCT7JfzoIvPCDk/UnymtPD5ImdPA59HST6fjCSfa4Z77fdJPft+vh+Ez3BrwOdoEPN39370jF9//gJSgJz1MSAxNSAxIDEgIzMzCnicc2fwZYhiYGAoYcgHYz2GZIZMhlyGdIYqoCgATrgE/Q==" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d gum leaf shape]" v + +fx_snowflake : +foreach { +to_color split_opacity +l[0] { +shape_snowflake {min(w,h)},$1 100%,100%,1,3,[${3-5}] +j[0] .,{([w#0,h#0]-[w#1,h#1])/2},0,0,$2,.. k[0] +} +a c +} +fx_dragoncurve : +foreach { +to_color split_opacity +l[0] { +shape_dragon {min(w,h)},$1,$2 100%,100%,1,3,[${4-6}] +j[0] .,{([w#0,h#0]-[w#1,h#1])/2},0,0,$3,.. k[0] +} +a c +} +fx_tk_make3D : +sh={-$2} sw={-$sh-$3} size1={w} size2={h} to_rgb[0] r[0] $size1,$size2 [0] +if $11==0 ++fx_tk_depthmap. $1,$4,$5,$6,$7,$8,$9,0,0,0 r. $size1,$size2 +fx_gaussian_blur. 0,{{w+h}/700},{{w+h}/350},1,0,0,0 +else if $!!=3 +error[] "For individual depth map select input mode ACTIVE AND BELOW" fi +rv[1,-1] to_rgb. luminance. +if $11==1 +if $9!=0 ++fc[0] 128,128,128 +channels[0] 2 negate. c. 0,90 +n. 0,128 rv[-1,-2] compose_darken[-1,-2] ++channels[0] 0 negate. c. 165,255 n. 128,255 rv[-1,-2] +compose_hardlight[-1,-2] rv[-1,-2] +if $11==0 if $1!=20 fx_compose_average[-1,-2] {$9/5} +else fx_compose_value[-1,-2] {$9/5},0 +tk_fx_channel_processing. 1,{$4/25},0,0,0,0,100,256,0,0,0,2,0,0 +fi +else fx_compose_value[-1,-2] {$9/5},0 fi fi +if $8!=0 +fx_highpass[0] 2,2,0,0,0 +tk_fx_replace_color. 5,0,128,128,128,255,0,0,0,255 +fx_morpho. 3,70,0,0,0,1,0 to_gray. av={ia} +ir. $av,255 n. 0,255 blur_xy. 25 +rv[-1,-2] fx_compose_overlay[-1,-2] {$8/5} fi +if $5!=0 +fx_isophotes[0] {{$5*3}+2},0,0,0 +fx_morpho. 3,{5-{$5/2}},0,0,0,1,0 +tk_fx_channel_processing. 1,1,255,0,0,0,100,256,0,0,0,2,0,0 +rv[-1,-2] fx_compose_overlay[-1,-2] {$5/10} ++fx_gradient_norm[0] {$6*2},{1.5-{0.1+{$5/3.6}}},0,100,0,0 +rv[-1,-2] compose_lighten[-1,-2] fx_segment_watershed. $5,$6,0,0 +fi +if $7!=0 +luminance[0] fx_map_tones. 1,{0.25-{$7/20}},0,30,3,0 +rv[-1,-2] fx_compose_overlay[-1,-2] {$7/10} fi +n. 0,255 +fi fi +if $20==1 r {w*{$23/max(w,h)}},{h*{$23/max(w,h)}},1,3,6 c 0,255 fi +if $20==0 +if $13!=15 if $19==0 +if $sw<=0 negate. fi +r. $size1,$size2,1,2 s. c f. 0 n.. 0,$sw a[-1,-2] c +warp.. .,1 shift.. $sh,0 rm. +else +. r[-1,-2] 100%,100%,1,2 +s. c f. 0 n.. 0,{abs($sw/2)} a[-1,-2] c +negate.. s.. c f.. 0 n... 0,{-abs($sw/2)} a[-2,-3] c +warp[-4] ..,1 warp... .,1 +shift... $sh,0 rm[-1,-2] +fi fi +else +if $19==0 +count={$22} dev=0 repeat $count dev={$dev+{$sw/$22}} +[0] rv[-1,-2] +if $sw<=0 negate. fi +r. 100%,100%,1,2 s. c f. 0 +if $21==0 n.. 0,$dev else n.. {-$dev},$dev fi +a[-1,-2] c warp.. .,1 to_gray. n. 0,255 +if $sw<=0 negate. fi +done rm[-1,0] rv +else +count={abs($22/2)} dev=0 +repeat $count dev={$dev+{$sw/$count}} +.. rv[-1,-2] +.. rv[-1,-2] +. r[-1,-2] 100%,100%,1,2 +s. c f. 0 +if $21==0 n.. 0,{abs($dev/2)} +else n.. {-abs($dev/2)},{abs($dev/2)} fi +a[-1,-2] c +negate.. s.. c f.. 0 +if $21==0 n... 0,{-abs($dev/2)} +else n... {-abs($dev/2)},{abs($dev/2)} fi +a[-2,-3] c +warp[-4] ..,1 warp... .,1 rm.. to_gray. n. 0,255 +mv[-4] -1 done rm[-1,-2] mv[0--1:2] -1 rv[0-50%] mv[0] 50% +fi fi +if $20==0 if $18==1 if $13!=15 +if $sh>=0 z[-1,-2] $sh,0,{w},{h} else z[-1,-2] 0,0,{w+$sh},{h} fi +if $19==0 +if $sw>=0 z[-1,-2] $sw,0,{w},{h} else z[-1,-2] 0,0,{w+$sw},{h} fi +else z[-1,-2] {abs($sw/2)},0,{w-abs($sw/2)},{h} +fi fi fi fi +if $12==1 fx_blackandwhite 0.299,0,0.587,0,0.114,0,1,1,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0 fi +if $20==0 +if $13!=14&&$13!=15 +fx_tk_stereoimage[0,1] $13,$10,$14,$15,$16,$17 +elif $13==14 k[0,1] +elif $13==15 k. +fi +fi +if $13==14 apply_gamma $14 tk_fx_channel_processing 1,1,$15,0,0,0,100,256,0,0,1,10,7,0 +fx_mix_lab 1,0,0,$16,0,0,$16,0,0,0,2,0 fi +fx_tk_make3D_preview : +if $20==0 shpre={$2/3} swpre={$3/3} else shpre={$2*{400/$23}} swpre={$3*{400/$23}} fi +if $11==1&&$!!=2 fc[0] 255,0,128,255 k[0] text "For individual depth map",10,80%,20,1,0,0,0,255 +text "select input mode ACTIVE AND BELOW.",10,90%,20,1,0,0,0,255 +else +fx_tk_make3D $1,$shpre,$swpre,${4-12},{if({$20==1},14,$13)},${14-19},0,${21-23} if $13==14||$20==1 k[1] fi +fi +fx_tk_video3D : skip "${15=},${27=}" +sh={-$2} sw={-$sh-$3} size1={w} size2={h} +if narg($_previewflag)==0 _previewflag=0 fi +if $_previewflag!=0 sh={$sh*{400/$22}} sw={$sw*{400/$22}} fi +if $26==0 +if $34!=0||$35!=0 +if $34>=$!-$35" || "$35>=$!-$34 error[] "Fade out of frame range." +fi fi +if $13!=14 channels 0,2 fi +if $_previewflag!=2 frames={$!} else frames=1 fi +counter={$!} index=0 +if $_previewflag!=0 r 400,328 fi +flag3d=0 if $41!=2 +if !($2==0" && "$3==0" && "$1==24" && "$13==14" && "$32!=0) flag3d=1 +repeat $frames +[$index] +if $40==0" || "$40==1 ++fx_tk_depthmap[$index] $1,$4,$5,$6,$7,$8,$9,$38,$39,{w*{$37/1000}} +r. $size1,$size2 fi +if $40==1 +infilec="correction.png" inpathc="$27/"$infilec"" +input. $inpathc +to_rgba[-1,-2] compose_rgba[-1,-2] to_rgb. +elif $40==2 +infilec="depthmap.png" inpathc="$27/"$infilec"" +input. $inpathc +elif $40==3 +if $_previewflag==2 +infilec="depthmap_"$_mapin".png" inpathc="$27/depthmaps/"$infilec"" +else +infilec="depthmap_"{$frames-$index}".png" inpathc="$27/depthmaps/"$infilec"" +fi +input. $inpathc +rv[$index,-2] +fi +if $_previewflag!=0 r 400,328 fi +if $10!=0 +if $_previewflag==2 [0] mv[-4] -1 +compose_difference[-1,-2] luminance. n. 0,255 +ir. 0,{{$37/2}+1} negate. n. 0,255 +else +[$index] [{$index+1}] +compose_difference[-1,-2] luminance. n. 0,255 +ir. 0,{{$37/2}+1} +negate. n. 0,255 +if $index<=$frames-2 +negate. fi +fi +fi +index={$index+1} done +if $10!=0 +if $_previewflag==2 +if $42==0 infile={$29} elif $42==1 infile={$30} elif $42==2 infile={$43} fi +if $infile==2 rv[-1,-2] else if $infile>=$29+2 +compose_difference[-4,-5] luminance[-4] n[-4] 0,255 +ir[-4] 0,1 negate[-4] n[-4] 0,255 +negate[-4] compose_darken[-1,-4] +mv... -1 fi fi +blur_xy.. {w*{$37/1000}} +if $infile!=$29 if $10>=0 fx_compose_lighten[-1,-2] {abs($10)/5} +else negate.. fx_compose_darken[-1,-2] {abs($10)/5} fi fi +else +rm. rm[{$counter+3}] +repeat $frames-2 +mv[{$counter+6}] {$counter+2} +compose_darken[{$counter+2},{$counter+3}] +rv[{$counter+1},{$counter+2}] +blur_xy[{$counter+1}] {w*{$37/1000}} +if $10>=0 +fx_compose_lighten[{$counter+1},{$counter+2}] {abs($10)/5} +else negate[{$counter+1}] +fx_compose_darken[{$counter+1},{$counter+2}] {abs($10)/5} +fi +counter={$counter+2} done +rv[-3,-4] blur_xy[-4] {w*{$37/1000}} +if $10>=0 fx_compose_lighten[-3,-4] {abs($10)/5} +else negate[-4] fx_compose_darken[-3,-4] {abs($10)/5} fi +fi +fi +if $_previewflag==2 if $24!=0 rm.. fi fi +index={-1} repeat $frames +if $13!=15 +if $41==0 if $sw<=0 negate[$index] fi fi +if $_previewflag!=2 +if $34!=0 if -$index<=$34 sw={{{-$index}/$34}*$sw} sh={{{-$index}/$34}*$sh} +fi fi +if $35!=0 if -($index+1)>=$frames-$35 sw={$sw*{{$frames-{-{$index+1}}}/$35}} +sh={$sh*{{$frames-{-{$index+1}}}/$35}} fi fi fi +if $41==0 +r[$index] 100%,100%,1,2 s[$index] c f[$index] 0 n[{$index-1}] 0,$sw +a[$index,{$index-1}] c warp[{$index-1}] [$index],1 +shift[{$index-1}] $sh,0 rm[$index] +else +[$index] +mv. {$frames+{$index+1}} +r[$index,{$frames+{$index+1}}] 100%,100%,1,2 +s[$index] c f[$index] 0 n[{$index-1}] 0,{abs($sw/2)} a[$index,{$index-1}] c +negate[{$frames+{$index+1}}] s[{$frames+{$index+1}}] c +f[{$frames+{$index+2}}] 0 n[{$frames+{$index+1}}] 0,{-abs($sw/2)} +a[{$frames+{$index+1}},{$frames+{$index+2}}] c +warp[{$frames+{$index+0}}] [{$frames+{$index+1}}],1 +warp[{$index-1}] [$index],1 +shift[{$index-1}] $sh,0 +rm[$index,{$frames+{$index+1}}] +fi +fi +sh={-$2} sw={-$sh-$3} +if $_previewflag!=0 sh={$sh*{400/$22}} sw={$sw*{400/$22}} fi +index={$index-1} done +if $13!=15 if $_previewflag!=2 +if $24>=0 repeat $24 rm. [$frames] +mv. $frames done +else counter={1} repeat abs($24) rm[$frames] +[{-$counter}] mv. {-$counter-1} counter={$counter+1} done fi +fi fi +if $20==1 if $13!=15 +if $sh>=0 z $sh,0,{w},{h} else z 0,0,{w+$sh},{h} fi +if $sw>=0 z $sw,0,{w},{h} else z 0,0,{w+$sw},{h} fi +fi fi +fi fi +if $_previewflag!=2 +if $32!=0 if $13!=15 repeat $! l[$>] fx_custom_code "$33",0,0,0 done done fi fi +else +if $32==1 if $13!=15 fx_custom_code[0,1] "$33",0,0,0 fi +elif $32==2 if $13!=15 l[0] fx_custom_code "$33",0,0,0 done fi +elif $32==3 if $13!=15 l[1] fx_custom_code "$33",0,0,0 done fi +fi fi +if $41==2 if $13==14" || "$13==15 error[] "Output format not allowed for image stream alignment" fi fi +if $12==1 ac "fx_blackandwhite 0.3,0,0.6,0,0.1,0,1,1,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0",rgb fi +counter={$frames-1} index={-2} +repeat $frames +if $13!=14" && "$13!=15 +fx_tk_stereoimage[-1,$counter] $13,$11,$16,$17,$18,$19 +elif $13==15 rm[0,$index] +fi counter={$counter-1} index={$index-1} done +if $13==14 apply_gamma $16 tk_fx_channel_processing 1,1,$17,0,0,0,100,256,0,0,1,10,7,0 +fx_mix_lab 1,0,0,$18,0,0,$18,0,0,0,2,0 fi +if $21==1 if $13!=13 +if $23==0 r $22,{$22*0.75},1,{s},6 +elif $23==1 r $22,{{$22*9}/16},1,{s},6 +elif $23==2 r $22,{{$22*2}/3},1,{s},6 +elif $23==3 r $22,{$22*0.5},1,{s},6 +elif $23==4 r $22,{{$22*9}/21},1,{s},6 +elif $23==5 r $22,{$22*{h/w}},1,{s},6 fi +fi fi c 0,255 +if $25==1 rv fi +if $14==1 +if $31==0" || "$13==15 end=".png" else end=".bmp" fi +rv +index={0} name=0 +if $13==14" && "$flag3d==1 +fileleft="$15/frame_left_"{$name+1}$end fileright="$15/frame_right_"{$name+1}$end +else if $13!=15 filename="$15/frame_"{$index+1}$end +else filename="$15/depthmap_"{$index+1}$end fi fi +repeat $frames +if $13==14" && "$flag3d==1 +output[$index] $fileright +output[{$index+$frames}] $fileleft +index={$index+1} name={$name+1} +fileleft="$15/frame_left_"{$name+1}$end fileright="$15/frame_right_"{$name+1}$end +else +output[$index] $filename +index={$index+1} if $13!=15 filename="$15/frame_"{$index+1}$end else filename="$15/depthmap_"{$index+1}$end fi +fi +done rv +fi +else +if $31==0 end=".png" else end=".bmp" fi +infile={$29} inpath="$27/$28"$infile""$end"" outfile={$29} +frames={{$30-$29}+1} counter=1 +if $34!=0" || "$35!=0 +if $34>=$frames-$35" || "$35>=$frames-$34 error[] "Fade out of frame range" +fi fi +if $41==2 +inpathleft="$27/$28""left_"$infile$end inpathright="$27/$28""right_"$infile$end +fi +av=1 var=1 avprev=1 varprev=1 +repeat $frames +if $41!=2 +rm input[0] $inpath +if $24==0 [0] +else infile2={$infile+$24} +if $infile2<=$29 infile2={$29} fi +if $infile2>=$30 infile2={$30} fi +inpath2="$27/$28"$infile2""$end"" +input[1] $inpath2 fi +else +rm input[0] $inpathleft +input[1] $inpathright +fi +size1={w} size2={h} +flag3d=0 if $41==3 flag3d=1 fi if $41!=2" && "$41!=3 +if !($2==0" && "$3==0" && "$1==24" && "$13==14" && "$32!=0) flag3d=1 +if $13!=14 channels[0,1] 0,2 fi +if $40==0" || "$40==1 +av={0,ia} var={0,iv} diffav={{$av-$avprev}/$avprev*100} diffvar={{$var-$varprev}/$varprev*100} +if abs($diffav)>=10" || "abs($diffvar)>=10 scenechange=1 else scenechange=0 fi +if $counter==1" || "$scenechange==1" || "$counter/$36==round($counter/$36,1) ++fx_tk_depthmap[0] $1,$4,$5,$6,$7,$8,$9,$38,$39,{w*{$37/1000}} r. $size1,$size2 +if $av!=0 avprev=$av fi if $var!=0 varprev=$var fi +if $36!=1 filename="$15/depthmap_temp.png" +output. $filename fi +else +filename="$15/depthmap_temp.png" +input. $filename +fi +fi +if $40==1 +infilec="correction.png" inpathc="$27/"$infilec"" +input. $inpathc +compose_rgba[-1,-2] +elif $40==2 +infilec="depthmap.png" inpathc="$27/"$infilec"" +input. $inpathc +elif $40==3 +infilec="depthmap_"$infile".png" inpathc="$27/depthmaps/"$infilec"" +input. $inpathc +fi +if $10!=0 if $infile!=$29 +[0] +infilemov={$infile-1} inpathmov="$27/$28"$infilemov""$end"" +input. $inpathmov +compose_difference[-1,-2] luminance. n. 0,255 +ir. 0,{{$37/2}+1} negate. n. 0,255 +if $infile>=$29+2 +infilemov2={$infile-2} inpathmov2="$27/$28"$infilemov2""$end"" +input. $inpathmov2 +infilemov3={$infile-1} inpathmov3="$27/$28"$infilemov3""$end"" +input. $inpathmov3 +compose_difference[-1,-2] luminance. n. 0,255 +ir. 0,1 n. 0,255 compose_darken[-1,-2] +fi blur_xy. {w*{$37/1000}} rv[-1,-2] +if $10>=0 +fx_compose_lighten[-1,-2] {abs($10)/5} +else +negate.. +fx_compose_darken[-1,-2] {abs($10)/5} +fi +fi fi +if $13!=15 +if $41==0 +if $sw<=0 negate[2] fi +if $34!=0 if $counter<=$34 sw={{$counter/$34}*$sw} sh={{$counter/$34}*$sh} fi fi +if $35!=0 if $counter>=$frames-$35 sw={$sw*{{{$frames-$counter}+1}/$35}} +sh={$sh*{{{$frames-$counter}+1}/$35}} fi fi +r. 100%,100%,1,2 s. c f. 0 n.. 0,$sw a[-1,-2] c +warp.. .,1 shift.. $sh,0 rm. +else +. r[-1,-2] 100%,100%,1,2 +s. c f. 0 n.. 0,{abs($sw/2)} a[-1,-2] c +negate.. s.. c f.. 0 n... 0,{-abs($sw/2)} a[-2,-3] c +warp[-4] ..,1 warp... .,1 +shift... $sh,0 rm[-1,-2] +fi +fi +sh={-$2} sw={-$sh-$3} +if $20==1 if $13!=15 +if $sh>=0 z $sh,0,{w},{h} else z 0,0,{w+$sh},{h} fi +if $sw>=0 z $sw,0,{w},{h} else z 0,0,{w+$sw},{h} fi +fi fi +fi fi +if $41==3 fx_tk_deana[0] $37,{{$38*2}+0.1} to_rgb fi +if $32==1 if $13!=15 fx_custom_code[0,1] "$33",0,0,0 fi +elif $32==2 if $13!=15 l[0] fx_custom_code "$33",0,0,0 done fi +elif $32==3 if $13!=15 l[1] fx_custom_code "$33",0,0,0 done fi +fi +if $12==1 ac[0,1] "fx_blackandwhite 0.3,0,0.6,0,0.1,0,1,1,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0",rgb fi +if $41==2" && "$13==14 error[] "Output format not allowed for image stream alignment" +elif $41==3" && "$13==15 error[] "Output format not allowed for anaglyph video reconstruction" +elif $41==2" && "$13==15 +fx_tk_depth_obtain[0,1] $11,{$37/100},{100-{$38*20}},{$39*20} +if $32!=0 fx_custom_code[0,1,-1] "$33",0,0,0 fi k. +elif $41!=2" && "$13==15 k. +elif $41==3" && "$13==14 k[0,1] +else fx_tk_stereoimage[0,1] $13,$11,$16,$17,$18,$19 fi +if $13==14 apply_gamma $16 tk_fx_channel_processing 1,1,$17,0,0,0,100,256,0,0,1,10,7,0 +fx_mix_lab 1,0,0,$18,0,0,$18,0,0,0,2,0 fi +if $21==1 if $13!=13 +if $23==0 r $22,{$22*0.75},1,{s},6 +elif $23==1 r $22,{{$22*9}/16},1,{s},6 +elif $23==2 r $22,{{$22*2}/3},1,{s},6 +elif $23==3 r $22,{$22*0.5},1,{s},6 +elif $23==4 r $22,{{$22*9}/21},1,{s},6 +elif $23==5 r $22,{$22*{h/w}},1,{s},6 +fi fi fi c 0,255 +if $13==14" && "$flag3d==1 +fileleft="$15/frame_left_"$outfile$end fileright="$15/frame_right_"$outfile$end +else if $13!=15 filename="$15/frame_"$outfile$end +else filename="$15/depthmap_"$outfile$end fi fi +if $13==14" && "$flag3d==1 +output[0] $fileleft output[1] $fileright +else output[0] $filename +fi +outfile={$outfile+1} +infile={$infile+1} inpath="$27/$28"$infile""$end"" +if $41==2 inpathleft="$27/$28""left_"$infile$end inpathright="$27/$28""right_"$infile$end fi +counter={$counter+1} done fi +if $_previewflag==0" && "$26==1 if $36!=1 +if ${-is_windows} path="$15" path=${path}{`92`} +x "cd \""$path"\" && del depthmap_temp.png" +else file="$15/depthmap_temp.png" x "rm -f \"$file\"" fi +fi fi +fx_tk_video3D_preview : skip "${15=},${27=}" +shpre={$2*{400/$22}} swpre={$3*{400/$22}} +if $26==0 +if $!==1 fc[0] 255,0,128,255 k[0] text "Select multiple layer",10,80%,24,1,0,0,0,255 +text "input mode ALL.",10,90%,24,1,0,0,0,255 +elif $41==2 fc[0] 255,0,128,255 k[0] text "Alignment of image streams",10,80%,24,1,0,0,0,255 +text "in BATCH processing mode only!",10,90%,24,1,0,0,0,255 +elif $41==3 fc[0] 255,0,128,255 k[0] text "Anaglyph video reconstruction",10,80%,24,1,0,0,0,255 +text "in BATCH processing mode only!",10,90%,24,1,0,0,0,255 +else +_previewflag=1 +if $40==3 if $42==0 _mapin=1 elif $42==1 _mapin={$!} elif $42==2 _mapin=$43 fi fi +if $42==0 nr=1 pv={-1} elif $42==1 nr={$!} pv={-$!} elif $42==2" || "$42==3 nr=$43 pv={-$43} fi +if $42==2" || "$42==3 if $43>=$! nr={$!} pv={-$!} _mapin={$!} fi fi +if $42!=3 +fx_tk_video3D[$pv] $1,$shpre,$swpre,${4-9},0,${11-13},0,"$15",${16-23},0,${25-26},"$27","$28",${29-32},"$33",0,0,${36-39},0,${41-43} k[$pv] +text[0] "layer "{``$nr},20,75%,{h*0.1},1,255,{if({{$13==2}||{$13==3}||{$13==15}},0,255)},0,255 +if $24!=0 text "For preview with frames offset ",20,70%,{h*0.05},1,255,{if({$13==15},0,255)},{if({$13==15},0,255)},255 +text "use full layer stack preview mode!",20,85%,{h*0.05},1,255,{if({$13==15},0,255)},{if({$13==15},0,255)},255 fi +if $34!=0" || "$35!=0 text "For fade in/out effect preview",20,65%,{h*0.05},1,255,{if({$13==15},0,255)},{if({$13==15},0,255)},255 +text "use full layer stack preview mode!",20,85%,{h*0.05},1,255,{if({$13==15},0,255)},{if({$13==15},0,255)},255 fi +if $40!=0 text "For preview with custom depth correction ",20,60%,{h*0.05},1,255,{if({$13==15},0,255)},{if({$13==15},0,255)},255 +text "use full layer stack preview mode!",20,85%,{h*0.05},1,255,{if({$13==15},0,255)},{if({$13==15},0,255)},255 fi +if $10!=0 text "For preview with motion analyzer ",20,55%,{h*0.05},1,255,{if({$13==15},0,255)},{if({$13==15},0,255)},255 +text "use full layer stack preview mode!",20,85%,{h*0.05},1,255,{if({$13==15},0,255)},{if({$13==15},0,255)},255 fi +if $32==2" || "$32==3 text[0] "Separate stream filtering ignored in layer mode",20,50%,{h*0.05},1,255,255,0,255 fi +else +fx_tk_video3D $1,$shpre,$swpre,${4-13},0,"$15",${16-26},"$27","$28",${29-32},"$33",${34-43} k[$pv] +fi +text[0] "layer "{``$nr},20,75%,{h*0.1},1,255,{if({{$13==2}||{$13==3}||{$13==15}},0,255)},0,255 +if $2==0" && "$3==0" && "$1==24" && "$13==14" && "$32!=0 text[0] "2D filter mode on!",50%,75%,{h*0.075},1,255,255,0,255 fi +if $36!=1 text "Key frame settings ignored in layer processing mode. ",20,50%,{h*0.05},1,255,255,0,255 fi +_previewflag=0 +fi +else +_previewflag=2 +if $42==3 ++fc[0] 255,0,128,255 k. +text "No preview available",20,50,28,1,0,0,0,255 +text "for batch input stack!",20,80,28,1,0,0,0,255 +text "Please select frame to adjust settings.",20,150,16,1,0,0,0,255 +elif $42==2" && "($43<=$29-1" || "$43>=$30+1) fc[0] 255,0,128,255 k[0] +text[0] "Selected frame out of range! ",10,80%,24,1,0,0,0,255 +elif $41==2" && "$13==14 fc[0] 255,0,128,255 k[0] +text[0] "Output format not allowed!",10,80%,24,1,0,0,0,255 +elif $41==3" && "$13==15 fc[0] 255,0,128,255 k[0] +text[0] "Output format not allowed!",10,80%,24,1,0,0,0,255 +else +rm +if $31==0 end=".png" else end=".bmp" fi +if $42==0 infile={$29} +if $34!=0 swpre={{1/$34}*$swpre} shpre={{1/$34}*$shpre} fi +elif $42==1 infile={$30} +if $35!=0 swpre={{1-{1/$35}}*$swpre} shpre={{1-{1/$35}}*$shpre} fi +elif $42==2 infile={$43} +if $34!=0" || "$35!=0} +if $43<=$29+$34 swpre={{$43/$34}*$swpre} shpre={{$43/$34}*$shpre} fi +if $43>=$30-$35 swpre={{$30-$43}*{$swpre/$35}} shpre={{$30-$43}*{$shpre/$35}} fi +fi +fi +if $41!=2 +inpath1="$27/$28"$infile""$end"" +input[0] $inpath1 +if $24!=0 infileoff={$infile+$24} +if $infileoff<=$29 infileoff={$29} fi +if $infileoff>=$30 infileoff={$30} fi +inpathoff="$27/$28"$infileoff""$end"" +input[1] $inpathoff +fi +if $infile!=$29 if $10!=0 +infilemov={$infile-1} inpathmov="$27/$28"$infilemov""$end"" +input. $inpathmov +if $infile>=$29+2 +infilemov2={$infile-2} inpathmov2="$27/$28"$infilemov2""$end"" +input. $inpathmov2 +infilemov3={$infile-1} inpathmov3="$27/$28"$infilemov3""$end"" +input. $inpathmov3 +fi fi fi +else +inpathleft="$27/$28""left_"$infile$end inpathright="$27/$28""right_"$infile$end +rm input[0] $inpathleft +input[1] $inpathright +fi +if $42==0 _mapin=$29 elif $42==1 _mapin=$30 elif $42==2 _mapin=$43 fi +framesn={{$30-$29}+1} +if ($34!=0" || "$35!=0)" && "($34>=$framesn-$35" || "$35>=$framesn-$34) fc[0] 255,0,128,255 k[0] +text "Fade out of frame range! ",10,80%,{h*0.1},1,0,0,0,255 +else +if $41==2" && "$13==15 +fx_tk_depth_obtain[0,1] $11,{$37/100},{100-{$38*20}},{$39*20} +if $32!=0 fx_custom_code[0,1,-1] "$33",0,0,0 fi k. +else +fx_tk_video3D $1,$shpre,$swpre,${4-9},{if({$infile==$29},0,$10)},${11-13},0,"$15",${16-25},0,"$27","$28",${29-31},{if({{$2==0}&&{$3==0}&&{$1==24}&&{$13==14}&&{$32!=0}},2,$32)},"$33",0,0,1,${37-43} +fi to_rgb if $13==14 k. fi +text[0] "frame "{``$infile},20,75%,{h*0.1},1,255,{if({{$13==2}||{$13==3}||{$13==15}},0,255)},0,255 +if $41!=2 if $36!=1 if $40==0" || "$40==1 text[0] "Preview always forced to key frame. ",20,50%,{h*0.05},1,255,255,0,255 else +text[0] "No keyframe computation for individual maps. ",20,64%,{h*0.05},1,255,255,0,255 fi fi fi +if $2==0" && "$3==0" && "$1==24" && "$13==14" && "$32!=0 text[0] "2D filter mode on!",50%,75%,{h*0.075},1,255,255,0,255 fi +fi fi fi +_previewflag=0 +fx_tk_autodepth : +repeat $! l[$>] to_rgb sizew={w} sizeh={h} resize2dx 400,2 +whpos=128 blpos=128 rpos=255 gpos=200 blupos=200 crga=1.5 crmix1=0.5 crmix2=0.5 geocomp1=75 geocomp2=30 +geostr=0.3 focstr=0.3 featsize=60 featpos=128 feattr=35 tr=30 rtr=90 gtr=90 blutr=90 contstr=0.9 +featinfl=1 foctol=5 focmorph=70 focavt=85 focavt2=140 focvart=2000 latinhib=0.5 ++fx_map_tones_fast. 10,0.5,0,0 luminance. +fx_segment_watershed. 0.5,1,0 label. 5,0 ++fx_gradient_norm[0] 0,0.5,0,100,0,0 compose_lighten[-1,-2] +fx_segment_watershed. 0.5,1,0 label. 5,0 n. 0,255 ++luminance[0] ++channels[0] 1 ir. $gtr%,100% +fx_morpho. 2,2,0,0,0,1,0 n. 0,$gpos +tk_fx_replace_color. 1,0,0,0,0,255,0,0,0,0 blend[-1,-2] alpha ++channels[0] 0 ir. $rtr%,100% +fx_morpho. 2,2,0,0,0,1,0 n. 0,$rpos +tk_fx_replace_color. 1,0,0,0,0,255,0,0,0,0 blend[-1,-2] alpha ++channels[0] 2 ir. $blutr%,100% n. 0,$blupos +fx_morpho. 2,2,0,0,0,1,0 +tk_fx_replace_color. 1,0,0,0,0,255,0,0,0,0 +to_rgba. +fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,0,100 +s.. c rv[-1,-2] compose_multiply[-1,-2] to_gray. a[-4,-3,-2,-1] c +blend[-1,-2] alpha ++channels[0] 0 +luminance[0] compose_average[-1,-2] ir. 80%,95% +fx_morpho. 2,2,0,0,0,1,0 n. 0,$whpos +tk_fx_replace_color. 1,0,0,0,0,255,0,0,0,0 blend[-1,-2] alpha ++channels[0] 0 +luminance[0] compose_average[-1,-2] ir. 5%,20% +fx_morpho. 2,2,0,0,0,1,0 n. 0,$blpos +tk_fx_replace_color. 1,0,0,0,0,255,0,0,0,0 blend[-1,-2] alpha ++fx_gradient_norm[0] 0,0.5,0,50,0,0 +. +fx_morpho. 2,$featsize,0,0,0,1,0 +ir. $feattr%,100% +n. 0,$featpos +blur_xy. 2 +fx_compose_lighten[-1,-2] $contstr +blur_xy. 2 +to_rgb[0] rgb2ycbcr[0] +channels[0] 2 ycbcr2rgb[0] +n. 0,255 c. 25%,100% apply_gamma. $crga ++channels[0] 2 negate. c. 0,128 +to_rgba. +fx_linear_gradient. 0,0,0,255,255,255,255,255,0,270,0,100 +s.. c rv[-1,-2] compose_multiply[-1,-2] to_gray. +a[-4,-3,-2,-1] c rv[-1,-2] fx_compose_darken[-1,-2] $crmix1 ++luminance[0] fx_houghsketchbw. 10,5,15,$tr,1,1,0 complex={ia} +if $complex>=$geocomp1 +do tr={$tr+10} rm. +luminance[0] fx_houghsketchbw. 10,5,15,$tr,1,1,0 complex={ia} +while $complex>=$geocomp2" && "$tr<=90 fi +fx_morpho. 3,5,0,0,0,1,0 blur_xy. 1 fx_distance. 255,0,1,1,0 +complex={ia} ++fx_highpass[0] 2,2,0,0,0 +tk_fx_replace_color. $foctol,0,128,128,128,255,0,0,0,255 +fx_morpho. 3,$focmorph,0,0,0,1,0 to_gray. +av={ia} var={iv} +if $av<=$focavt" || "($av>=$focavt" && "$av<=$focavt2" && "$var<=$focvart) +ir. $av,255 n. 0,255 blur_xy. 10 else fc. 128,128,128 fi ++fx_gradient_norm[0] 0,0.5,0,50,0,0 +rm[0] +fx_compose_overlay[-7,-6] 0.5 +fx_compose_overlay[-6,-5] $featinfl +fx_compose_value[-5,-4] $crmix2 +rv[-4,-3] +if $complex!=0 fx_compose_overlay[-4,-3] $geostr else rm... fi +rv[-3,-2] +fx_compose_overlay[-3,-2] $focstr +rv[-2,-1] +fx_compose_lighten[-1,-2] $latinhib +blur_xy. 2 fx_morpho. 3,20,0,0,0,1,0 +fx_segment_watershed. 15,0,0 n. 0,255 +blur_y. 2 blur_x. 1 +resize $sizew,$sizeh,2 +done done +fx_tk_deana : +repeat $! l[$>] to_rgb +s c rm. +to_rgb[-1,-2] rgb2lab[-1,-2] channels[-1,-2] 0 +rgb2lab[0] s[0] c blur_x[1,2] $1 +c[-1,-2] {0,im},{0,iM} +apply_gamma. {($2^({0,ia}/ia)-$2)*$2+1} +apply_gamma.. {($2^({0,ia}/{-2,ia})-$2)*$2+1} +[1,2] rm[0] mv[2] 0 +a[0,1,2] c a[1,2,3] c lab2rgb[0,1] +done done +fx_tk_depthmap : +repeat $! l[$>] to_rgb size1={w} resize2dx 400,2 +if $8!=0 fx_map_tones_fast {$8*4},{$9/5},3,0 fi +if $1==0 +fx_tk_autodepth. ++luminance[0] fx_map_tones. 1,0.25,0,30,3,0 +rv[-1,-2] fx_compose_value[-1,-2] 0.15 +tk_fx_channel_processing. 1,{$2/20},0,0,0,0,100,256,0,0,0,2,0,0 +elif $1==1 +channels[0] 2 +tk_fx_channel_processing. 1,{{$2/25}+0.1},0,0,0,0,100,256,0,1,0,2,0,0 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,0,{100-{$2/1.5}} +rv[-1,-2] fx_compose_lighten[-1,-2] {0.5+{$2/200}} +elif $1==2 +s. c fx_dog. 0.4,0,0,0,0 +negate.. fx_dog... 0.4,0,0,0,0 +fx_compose_alpha[-1,-2] 0.44,0 +fx_compose_alpha[-1,-2] 0.44,0 +tk_fx_channel_processing. 1,{$2/20},0,0,0,0,100,256,0,0,0,2,0,0 +elif $1==3 +luminance. +tk_fx_channel_processing. 1,{$2/25},0,0,0,0,100,256,0,0,0,2,0,0 +elif $1==4 +luminance. negate. +tk_fx_channel_processing. 1,{$2/25},0,0,0,0,100,256,0,0,0,2,0,0 +elif $1==5 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,0,{100-$2} +elif $1==6 ++fx_radial_gradient. 0,0,0,255,255,255,255,255,1,$2,100,50,50 +elif $1==7 ++fx_radial_gradient. 0,0,0,255,255,255,255,255,0,0,{100-$2},50,50 +elif $1==8 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,1,0,$2,100 +elif $1==9 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,1,315,$2,100 +elif $1==10 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,0,0,{100-$2} +elif $1==11 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,45,0,{100-$2} +elif $1==12 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,0,50,{100-{$2/2}} ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,180,50,{100-{$2/2}} +compose_lighten[-1,-2] +elif $1==13 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,1,180,100,{50+{$2/2}} ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,180,{50-{$2/2}},0 +compose_darken[-1,-2] +elif $1==14 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,50,{100-{$2/2}} ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,270,50,{100-{$2/2}} +compose_lighten[-1,-2] +elif $1==15 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,180,50,{100-{$2/2}} ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,50,{100-{$2/2}} +compose_lighten[-1,-2] +elif $1==16 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,0,50,{100-{$2/2}} ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,50,{100-{$2/2}} +compose_lighten[-1,-2] +elif $1==17 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,0,50,{100-{$2/4}} ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,180,50,{100-{$2/4}} +compose_lighten[-1,-2] ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,0,{100-{$2/2}} +compose_lighten[-1,-2] +elif $1==18 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,0,50,{100-{$2/4}} ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,180,50,{100-{$2/4}} +compose_lighten[-1,-2] ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,0,{100-{$2/4}} +compose_lighten[-1,-2] ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,270,50,{100-{$2/4}} +compose_lighten[-1,-2] +elif $1==19 +channels. 0 +tk_fx_channel_processing. 1,{$2/25},0,0,0,0,100,256,0,0,0,2,0,0 ++fx_radial_gradient. 0,0,0,255,255,255,255,255,1,$2,100,50,50 +rv[-1,-2] compose_multiply[-1,-2] +elif $1==20 ++fx_gaussian_blur. $6,0,0,1,0,0,0 +fx_edges. {$4/2},{50-{$2/2}},1,0 ++fx_gradient_norm[0] {$4/2},{1.5-{$2/67}},0,{100-$2},0,0 +rv[-1,-2] compose_lighten[-1,-2] +channels[0] 0 +tk_fx_channel_processing. 1,{{$2/25}+1},0,0,0,0,100,256,0,0,0,2,0,0 +rv[-1,-2] compose_lighten[-1,-2] ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,0,50,{100-{$2/4}} ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,180,50,{100-{$2/4}} +compose_lighten[-1,-2] ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,0,{100-{$2/2}} +compose_lighten[-1,-2] rv[-1,-2] compose_lighten[-1,-2] +elif $1==21 +fx_gaussian_blur. $4,0,0,1,0,0,0 +fx_edges. {$4/2},{50-{$2/2}},1,0 ++fx_gradient_norm[0] {$4/2},{1.5-{$2/67}},0,{100-$2},0,0 +rv[-1,-2] compose_lighten[-1,-2] +channels[0] 0 +tk_fx_channel_processing. 1,{{$2/25}+0.5},0,0,0,0,100,256,0,0,0,2,0,0 +rv[-1,-2] compose_lighten[-1,-2] ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,0,0,{100-$2} ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,180,0,{100-$2} +compose_darken[-1,-2] rv[-1,-2] compose_darken[-1,-2] ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,75,{100-{$2/4}} +rv[-1,-2] fx_compose_lighten[-1,-2] 0.5 +elif $1==22 +fx_gaussian_blur. $4,0,0,1,0,0,0 +fx_edges. {$4/2},{50-{$2/2}},1,0 ++fx_gradient_norm[0] {$4/2},{1.5-{$2/67}},0,{100-$2},0,0 +rv[-1,-2] compose_lighten[-1,-2] +channels[0] 0 +tk_fx_channel_processing. 1,{{$2/25}+0.5},0,0,0,0,100,256,0,0,0,2,0,0 +rv[-1,-2] compose_lighten[-1,-2] +elif $1==23 +channels. 0 +tk_fx_channel_processing. 1,{$2/25},0,0,0,0,100,256,0,0,0,2,0,0 +elif $1==24 +fc. 0,0,0 +fi +if $7!=0 ++fc[0] 128,128,128 +channels[0] 2 negate. c. 0,90 +n. 0,128 rv[-1,-2] compose_darken[-1,-2] ++channels[0] 0 negate. c. 165,255 n. 128,255 rv[-1,-2] +compose_hardlight[-1,-2] rv[-1,-2] +if $1!=19 fx_compose_average[-1,-2] {$7/5} +else fx_compose_value[-1,-2] {$7/5},0 +tk_fx_channel_processing. 1,{$2/25},0,0,0,0,100,256,0,0,0,2,0,0 +fi fi +if $6!=0 +fx_highpass[0] 2,2,0,0,0 +tk_fx_replace_color. 5,0,128,128,128,255,0,0,0,255 +fx_morpho. 3,70,0,0,0,1,0 to_gray. av={ia} +ir. $av,255 n. 0,255 blur_xy. 25 +rv[-1,-2] fx_compose_overlay[-1,-2] {$6/5} fi +if $3!=0 +fx_isophotes[0] {{$3*3}+2},0,0,0 +fx_morpho. 3,{5-{$3/2}},0,0,0,1,0 +tk_fx_channel_processing. 1,1,255,0,0,0,100,256,0,0,0,2,0,0 +rv[-1,-2] fx_compose_overlay[-1,-2] {$3/10} ++fx_gradient_norm[0] {$4*2},{1.5-{0.1+{$3/3.6}}},0,100,0,0 +rv[-1,-2] compose_lighten[-1,-2] fx_segment_watershed. $3,$4,0,0 +fi +blur_y. $10 blur_x. {$10/2} +if $5!=0 +luminance[0] fx_map_tones. 1,{0.25-{$5/20}},0,30,3,0 +rv[-1,-2] fx_compose_overlay[-1,-2] {$5/10} fi +n. 0,255 rm[0] resize2dx $size1,2 done done +fx_tk_depth_obtain : +if $!<=1 return fi +l +to_rgb size1={w} size2={h} resize2dx 400,2 +if $1==1 rv fi +if $3!=100 +fx_frame_round_old 10,{100-$3},$4,0,255,255,255,255,0,0.1,3 +fi +displacement[0] [1],$2 +rm[1] +channels 0 +n 0,255 +r $size1,$size2 done +fx_tk_lenticular : +if $!<=1 return fi +frames={$!} index=0 if $4==0 length=$3 else length={$3/2.54} fi +lenses={$length*$1} lensewidth={w/$lenses} +picstripe={$lensewidth/$frames} x=0 y=0 end={$picstripe} +step={$lensewidth-$picstripe} +if $6==1 +if $picstripe!=int($picstripe) scale={{int($picstripe)+1}/$picstripe} +r {w*$scale},{h*$scale} lensewidth={w/$lenses} picstripe={$lensewidth/$frames} +end={$picstripe} step={$lensewidth-$picstripe} fi fi +to_rgb +fc. 255,255,255 repeat $lenses +if $2==0 +fill. if(x>=$end,0,i) x={$x+$step} end={$end+$step} +fill. if(x>=$end,255,i) x={$x+$picstripe} end={$end+$picstripe} +else +fill. if(y>=$end,0,i) y={$y+$step} end={$end+$step} +fill. if(y>=$end,255,i) y={$y+$picstripe} end={$end+$picstripe} +fi done +repeat $frames-1 +to_gray. ir. 128,256 n. 0,255 +if $2==0 shift. {{$picstripe}*{$frames-{$index+1}}} +else shift. 0,{{$picstripe}*{$frames-{$index+1}}} fi +s[$index] c a[$index,{$index+1},{$index+2},-1] c +index={$index+1} done +repeat $frames-1 rv[0,-2] compose_rgba[0,-2] rv[0,-2] done +if $5==1 to_rgba[0] +if $2==0 shift[0] 0,5 else shift[0] 5,0 fi +negate. rv compose_rgba else rm. fi +fx_tk_stereogram : +repeat $! l[$>] to_gray +fc. 255,255,255 +fx_plasma. $2,$3,8,0,0,128,128,128 +fx_array. 10,10,0,0,0,0 +fx_array_fade. {$5/10},{$5/10},0,0,80,90,3,0 +r. [0],[0] +fx_noise. {w/30},0,3,0,0 ++fx_rorschach. $4,1,0 rv[-1,-2] fx_compose_multiply[-1,-2] 0.5 ++fx_corner_gradient. $6,$7,$8,255,$9,$10,$11,255,$12,$13,$14,255,$15,$16,$17,255 +rv[-1,-2] fx_compose_hardlight[-1,-2] $18 +rv[-1,-2] +r. 100%,100%,1,2 +s. c f. 0 n.. 0,$1 a[-1,-2] c +warp.. .,1 +rm. done done +fx_tk_stereogram_preview : +gui_split_preview "fx_tk_stereogram ${1--2}",$-1 +gcd_stereo_img : skip ${1=0},${2=2},${3=1.2},${4=1},${5=0.25},${6=2},${7=4},${8=1},${9=0} +repeat $! l[$>] +to_rgb[0] b={abs($3%*w*$4)} ++gcd_depth[0] $5,$6,$7,$8 +gcd_stereo[0,1] $1,$2,$3%,$4 +if !$1" && "$9 z. $b,{w-1-$b} fi +done done +gcd_depth : skip ${1=0.25},${2=2},${3=4},${4=1} +repeat $! l[$>] +if w>h if w>700 +r. 700,{h*700/w} else [0] fi +elif {0,h>700} +r. {0,w*700/h},700 else [0] fi +median. 7 gcd_segment_ch0. 1 +if $4 gcd_label. $3 else label. $3,1 fi +c. 0,255 b. 0.45% n. 0,$2 r. [0],[0] +norm[0] n[0] 0,1 +[-2,-1] b. $1% n. 0,255 +done done +gcd_segment_ch0 : check "${1=1}>=0" +repeat $! l[$>] +min={im} + {1+$min} +gradient_norm channels[0] 0 ++f. "if(i<$1 && i0 gcd_balance_anaglyph[0] {2-$2} fi +i[1] [0] warp[0] .,1 *. -1 warp[1] .,1 rm. +if $1 rv[0,1] append[0,1] x else shift[0] {round(-$wfac*$4)} shift[1] {round($wfac*$4)} +channels[0] 0 channels[1] 1,2 append[0,1] c +fi +done +gcd_balance_anaglyph : skip ${1=1},${2=0.43},${3=0.45} +l. sh 0,0 sh[0] 1,1 sh[0] 2,2 +-[2] [1] inv={255^(1-$1)*$2} +if $1>1 +sign. abs.. ^.. $1 *.. $inv *[-2,-1] else *. $2 fi +-[2,3] . *. {1/$2-1} +[1,-1] +*[3] 0.65 -. [1] max. 0 *. $3 +-[3] . *. {1/$3-1} +[1,-1] apply_gamma[1] 1.15 rm[1-3] c 0,255 +done +fx_tk_stereoimage : +if $!<=1 return fi +local to_rgb +if $1==0" || "$1==1" || "$1==2" || "$1==3" || "$1==4" || "$1==5 apply_gamma $3 fi +if $1==0 if $2==0 rv[-1,-2] fi s c +rm[-3,-4,-5] a[-1,-2,-3] c +elif $1==1 if $2==1 rv[-1,-2] fi +apply_gamma. 1.15 apply_gamma.. 1.0 s c +rlr=456 rlg=500 rlb=176 rrr={-43} rrg={-88} rrb={-2} +glr={-40} glg={-38} glb={-16} grr=378 grg=734 grb={-18} +blr={-15} blg={-21} blb={-5} brr={-72} brg={-113} brb=1226 +[0-5] +*... $rlr *.. $rlg *. $rlb *[-6] $rrr *[-5] $rrg *[-4] $rrb ++[-6] [-5] +[-6] [-4] +[-6] ... +[-6] .. +[-6] . rm[-1--5] +/. 1000 n. 0,255 to_gray. +[0-5] +*... $glr *.. $glg *. $glb *[-6] $grr *[-5] $grg *[-4] $grb ++[-6] [-5] +[-6] [-4] +[-6] ... +[-6] .. +[-6] . rm[-1--5] +/. 1000 n. 0,255 to_gray. +[0-5] +*... $blr *.. $blg *. $blb *[-6] $brr *[-5] $brg *[-4] $brb ++[-6] [-5] +[-6] [-4] +[-6] ... +[-6] .. +[-6] . rm[-1--5] +/. 1000 n. 0,255 to_gray. +k[-1--3] a[-1,-2,-3] c +elif $1==2 if $2==0 rv[-1,-2] fi s c +rm[-6,-5,-1] mv[0] 3 a[-1,-2,-3] c +elif $1==3 if $2==1 rv[-1,-2] fi +apply_gamma. 0.9 apply_gamma.. 1.25 s c +rrr=1062 rrg={-205} rrb=299 rlr={-16} rlg={-123} rlb={-17} +grr={-26} grg=908 grb=68 glr=6 glg=62 glb={-17} +brr={-38} brg={-173} brb=22 blr=94 blg=185 blb=911 +[0-5] +*... $rlr *.. $rlg *. $rlb *[-6] $rrr *[-5] $rrg *[-4] $rrb ++[-6] [-5] +[-6] [-4] +[-6] ... +[-6] .. +[-6] . rm[-1--5] +/. 1000 n. 0,255 to_gray. +[0-5] +*... $glr *.. $glg *. $glb *[-6] $grr *[-5] $grg *[-4] $grb ++[-6] [-5] +[-6] [-4] +[-6] ... +[-6] .. +[-6] . rm[-1--5] +/. 1000 n. 0,255 to_gray. +[0-5] +*... $blr *.. $blg *. $blb *[-6] $brr *[-5] $brg *[-4] $brb ++[-6] [-5] +[-6] [-4] +[-6] ... +[-6] .. +[-6] . rm[-1--5] +/. 1000 n. 0,255 to_gray. +k[-1--3] a[-3,-2,-1] c +elif $1==4 if $2==0 rv[-1,-2] fi s c +rm[-1,-3,-5] mv. -2 a[-3,-2,-1] c +elif $1==5 if $2==1 rv[-1,-2] fi s c +apply_gamma. 1 apply_gamma.. 1.15 s c +rrr={-62} rrg={-158} rrb={-39} rlr={529} rlg={705} rlb={24} +grr={284} grg=668 grb=143 glr={-16} glg={-15} glb={-65} +brr={-15} brg={-27} brb=21 blr=9 blg=75 blb=937 +[0-5] +*... $rlr *.. $rlg *. $rlb *[-6] $rrr *[-5] $rrg *[-4] $rrb ++[-6] [-5] +[-6] [-4] +[-6] ... +[-6] .. +[-6] . rm[-1--5] +/. 1000 n. 0,255 to_gray. +[0-5] +*... $glr *.. $glg *. $glb *[-6] $grr *[-5] $grg *[-4] $grb ++[-6] [-5] +[-6] [-4] +[-6] ... +[-6] .. +[-6] . rm[-1--5] +/. 1000 n. 0,255 to_gray. +[0-5] +*... $blr *.. $blg *. $blb *[-6] $brr *[-5] $brg *[-4] $brb ++[-6] [-5] +[-6] [-4] +[-6] ... +[-6] .. +[-6] . rm[-1--5] +/. 1000 n. 0,255 to_gray. +k[-1--3] a[-3,-2,-1] c +elif $1==6 if $2==1 rv[-1,-2] fi +r[-1,-2] 50%,50%,1,3,6 a[-1,-2] x +elif $1==7 if $2==1 rv[-1,-2] fi a[-1,-2] x +elif $1==8 if $2==1 rv[-1,-2] fi a[-1,-2] y +elif $1==9 if $2==1 rv[0,1] fi +r[0,1] 50%,100%,1,3,6 a[0,1] x +elif $1==10 if $2==1 rv[0,1] fi +r[0,1] 100%,50%,1,3,6 a[0,1] y +elif $1==11 to_rgba[0,1] +if $2==1 rv[0,1] fi +fill[0] if(y%2==0,0,i) rv[0,1] compose_rgba[0,1] to_rgb +elif $1==12 to_rgba[0,1] +if $2==1 rv[0,1] fi +fill[0] if(x%2==0,0,i) rv[0,1] compose_rgba[0,1] to_rgb +elif $1==13 +if $2==1 rv[0,1] fi +r[0,1] 1920,1080,1,3,6 +fc. 0,0,0 r. 1920,45 +rv[-1,-2] a[-1,-2] y a[-1,-2] y +fi c 0,255 +if $1==6" || "$1==7" || "$1==8" || "$1==9" || "$1==10" || "$1==11" || "$1==12" || "$1==13 +apply_gamma $3 fi +fx_mix_lab 1,0,0,$5,0,0,$5,0,0,0,2,0 +if $1==0" || "$1==1 fx_mix_rgb 1,$6,0,1,0,0,1,0,0,0,2,0 fi +if $1==2" || "$1==3 fx_mix_rgb 1,0,0,1,0,0,1,$6,0,0,2,0 fi +if $1==4 fx_mix_rgb 1,0,0,1,$6,0,1,0,0,0,2,0 fi +if $1==5 fx_mix_rgb 1,0,0,1,$6,0,1,{if({$6>=0},$6,0)},0,0,2,0 fi +done +gcd_unstereo : skip ${1=5},${2=0.1},${3=0},${4=1},${5=1},${6=1},${7=0},${8=0} +repeat $! l[$>] +if $4" && "$8 pr=1 else pr=$1 fi +to_rgb[0] split_tiles[0] $5,$6 +repeat $! l[$>] +s[0] c +equalize[0,1] 256 ++displacement.. .,$2,$pr +if $3 sh. 1,1 f. 0 rm. fi +/. 2 warp[1,2] .,1 *. -1 warp[0] .,1 +k[0-2] a c c[0] 0,255 +done done +append_tiles $5,$6 +done done +gcd_unstereo_preview : +gui_split_preview "gcd_unstereo ${1--1},1",$-1 +#@cli afre_contrastfft : 1<=strength<=100,0<=_amount<=100,1<=_iterations<=10 +#@cli : Enhance contrast for selected images with Fourier transform. +#@cli : Default values: 'strength=75', 'amount=50' and 'iterations=1'. +afre_contrastfft : check "${1=75}>=1 && ${2=50}>=0 && ${3=1}>=1 && +$1<=100 && $2<=100 && $3<=10" +e[] "[afre]^_^) contrastfft: Enhance contrast for image$? with Fourier transform using strength=$1, amount=$2 and iterations=$3." +repeat $! l[$>] repeat $3 ++fftpolar ^.. {($1-0.5)/100} ifftpolar[^0] afre_softlight $2 +done done done +afre_contrastfft_preview : +afre_contrastfft $* +#@cli afre_denoise : radius>=1 +#@cli : Denoise selected images. +#@cli : Default value: 'radius=1'. +afre_denoise : check ${1=1}>=1 +e[] "[afre]^_^) denoise: Denoise image$? using radius=$1." +repeat $! l[$>] r={[im,iM]} +. repeat 4 +. repeat $1 afre_gui0_fast. {$>+1},1e0 done n. {0,[im,iM]} ++laplacian.. abs. n. 0,1 +^. {.2+.2*($>+1)} blend_fade[1,2] . k[0,1] +done +afre_gui1_fast. ..,1,0 rm.. +c $r done done +afre_denoise_preview : +afre_denoise $* +#@cli ::Features +#@cli afre_norm : _keep_channels={ 0 | 1 } +#@cli : Compute normalized norms of selected images. +#@cli : Default value: 'keep_channels=1'. +afre_norm : skip ${1=1} +l[] if isnum("$1") k={$1?1} elif ["'$1'"]!=',' noarg k=1 fi done +s1="s" e[] "[afre]^_^) norm: Compute normalized norm"${s{$!>1}}" of image$? using keep_channels="$k"." +repeat $! l[$>] s={s} if $s>1 +sqr s c + sqrt / {sqrt($s)} if $k r 100%,100%,100%,$s fi +fi done done +#@cli afre_y50 : colour_space={ 0=Rec.709 | 1=Rec.2020 } +#@cli : Compute luminance (D50) of selected images. +#@cli : Default value: 'colour_space=1'. +afre_y50 : check isbool(${1=1}) +if $1 Y="Rec.2020" else Y="Rec.709" fi +e[] "[afre]^_^) y50: Compute luminance (D50 "$Y") of image$?." +repeat $! l[$>] +if s==3 sh 0 sh[0] 1 sh[0] 2 +if $1 *[1] 0.2790177 *[2] 0.6753402 *[3] 0.0456377 +else *[1] 0.22248840 *[2] 0.71690369 *[3] 0.06060791 +fi +[1-3] rm[1] channels 0 +elif s!=1 r={[im,iM]} norm n $r fi +done done +#@cli afre_orien : _mode={ 0=norm | 1=Rec.709 | 2=Rec.2020 } +#@cli : Compute orientation of selected images. +#@cli : Default value: 'mode=0'. +afre_orien : skip ${1=0} +l[] if isnum("$1") m={inrange($1,0,2)?int($1):0} elif ["'$1'"]!=',' noarg m=0 fi done +s0,s$m="norm" s1="luminance Rec.709 D50" s2="luminance Rec.2020 D50" e[] "[afre]^_^) orien: Compute orientation of image$? using "${s$m}"." +repeat $! if $m +afre_y50[$>] {$m-1} else +afre_norm[$>] fi +replace. 0,1 /[$>,-1] done +#@cli afre_gradientnorm : _keep_channels={ 0 | 1 },_keep_range={ 0 | 1 } +#@cli : Compute normalized gradient norms of selected images. +#@cli : Default values: 'keep_channels=1' and 'keep_range=0'. +afre_gradientnorm : skip ${1=1},${2=0} +l[] if isnum("$1")&&isnum("$2") k={$1?1} r={$2?1} elif ["'$1'"]!=',' noarg k,r=1,0 fi done +s1="s" e[] "[afre]^_^) gradientnorm: Compute normalized gradient norm"${s{$!>1}}" of image$? using keep_channels="$k" and keep_range="$r"." +repeat $! l[$>] iM,s={[iM,s]} +g sqr s c + sqrt / {iM/($r?$iM:1)} if $k r 100%,100%,100%,$s fi +done done +#@cli afre_hessiannorm : _keep_channels={ 0 | 1 },_keep_range={ 0 | 1 } +#@cli : Compute normalized hessian norms of selected images. +#@cli : Default values: 'keep_channels=1' and 'keep_range=0'. +afre_hessiannorm : skip ${1=1},${2=0} +l[] if isnum("$1")&&isnum("$2") k={$1?1} r={$2?1} elif ["'$1'"]!=',' noarg k,r=1,0 fi done +s1="s" e[] "[afre]^_^) hessiannorm: Compute normalized hessian norm"${s{$!>1}}" of image$? using keep_channels="$k" and keep_range="$r"." +repeat $! l[$>] iM,s={[iM,s]} +hessian sqr s c + sqrt / {iM/($r?$iM:1)} if $k r 100%,100%,100%,$s fi +done done +#@cli afre_gnorm +#@cli : Compute custom gradient norm of selected images. +afre_gnorm : +e[] "[afre]^_^) gnorm: Compute custom gradient norm of image$?." +repeat $! l[$>] nm={b} ++gradient_norm r={[im,iM]} +afre_hnorm[0] afre_gui1_fast[2] [0] rm[0] +c. 20%,100% n 0,1 *. 0.75 max n $r +nm $nm done done +#@cli afre_hnorm +#@cli : Compute Hessian norm of selected images. +afre_hnorm : +e[] "[afre]^_^) hnorm: Compute Hessian norm of image$?." +repeat $! l[$>] hessian sqr s c + sqrt done done +#@cli afre_sdpatch : radius>=1 +#@cli : Compute local standard deviation of selected images. +#@cli : Default value: 'radius=1'. +afre_sdpatch : skip ${1=1} +rd={int($1)} e[] "[afre]^_^) sdpatch: Compute local standard deviation of image$? using radius="$rd"." +repeat $! l[$>] +gradient_norm r={[im,iM]} rm. ++sqr afre_box_fast $rd sqr.. rv - max 0 sqrt +n $r done done +#@cli afre_jchz +#@cli : Convert selected images from RGB to JzCzhz. +afre_jchz : +e[] "[afre]^_^) jchz: Convert image$? from RGB to JzCzhz." +rgb2jzazbz 0 r 100%,100%,100%,3 repeat $! l[$>] +s c complex2polar[-2,-1] a c +done done +#@cli afre_ijchz +#@cli : Convert selected images from JzCzhz to RGB. +afre_ijchz : +e[] "[afre]^_^) ijchz: Convert image$? from JzCzhz to RGB." +r 100%,100%,100%,3 repeat $! l[$>] +s c polar2complex[-2,-1] a c +done done jzazbz2rgb 0 +#@cli ::Filtering +#@cli afre_conv : [kernel] +#@cli : Convolve selected images with a custom kernel. +afre_conv : check ${is_image_arg\ $1} +repeat $! pass$1 0 +e[] "[afre]^_^) conv: Convolve image$? using ["${"-pass$1 -1"}"]." +l[$>,-1] +f[0] 1 mv. 1 ++rows. 50% columns.. 50% +convolve[1] [2] convolve[4] [3] +convolve[0] [2] convolve[0] [3] k[0,4] / done +done +#@cli afre_box : radius>=1,_gaussian={ 0 | 1 } +#@cli : Blur selected images with a soft box filter. +#@cli : Default values: 'radius=1' and 'gaussian=1'. +afre_box : check "${1=1}>=1 && isbool(${2=1})" +rd={int($1)} if $2 g="soft box" else g="box" fi w={$rd*2+1} +e[] "[afre]^_^) box: Blur image$? with a "${w}"x"${w}" "$g" filter." +repeat $! l[$>] +$w,$w f. 1 if $2 gaussian. {100/3}% fi afre_conv.. . rm. +done done +#@cli afre_box_fast : radius>=1 +#@cli : Blur selected images with a soft box filter. Faster version. +#@cli : Default value: 'radius=1'. +afre_box_fast : check ${1=1}>=1 +rd={int($1)} w={$rd*2+1} e[] "[afre]^_^) box: Blur image$? with a "${w}"x"${w}" soft box filter." +repeat $! l[$>] boxfilter $w,0,1,3 done done +#@cli afre_gui0 : radius>=1,_smoothing>=0,0<=_structure<=10 +#@cli : Blur selected images with a custom self-guided filter. +#@cli : Default values: 'radius=1', 'smoothing=1e-2' and 'structure=10'.\n +#@cli : - Use orders of magnitude for 'smoothing'. +#@cli : - Reduce 'structure' to soften edges and artifacts. +#@cli : * Improvement of "K He, J Sun, X Tang. Guided image filtering. TPAMI, 35(6):1397-1409, 2013". +afre_gui0 : check "${1=1}>=1 && ${2=1e-2}>=0 && ${3=10}>=0 && $3<=10" +rd={int($1)} kwh={sqr($rd*2+1)} str={1e{-$3+2}} +e[] "[afre]^_^) gui0: Blur image$? with a custom self-guided filter using radius="$rd", smoothing=$2 and structure=$3." +repeat $! l[$>] nm={b} iM={iM} / $iM +. +sqr. afre_box[^0] $rd nm I,mI,mII ++sqr[mI] *. -1 +. [mII] rm[mII] => vI ++l[vI] abs s c + done *. $kwh +. $str ^. -1 *. $str => W +++[vI] {vI,$2*ia+1e-6} /[vI] . rm. =>[vI] a ++*[a] [mI] *. -1 +. [mI] rm[mI] => b +*[a,b] [W] afre_box[^0] $rd =>[^0] ma,mW,mb +*[I] [ma] +[I] [mb] /[I] [mW] k[I] +* $iM nm $nm done done +#@cli afre_gui1 : [guide],_radius>=1,_smoothing>=0,0<=_structure<=10 +#@cli : Blur selected images with a custom guided filter. +#@cli : Default values: 'radius=1', 'smoothing=0' and 'structure=5'.\n +#@cli : - Use orders of magnitude for 'smoothing'. +#@cli : - Reduce 'structure' to soften edges and artifacts. +#@cli : * Improvement of "K He, J Sun, X Tang. Guided image filtering. TPAMI, 35(6):1397-1409, 2013". +afre_gui1 : check ${is_image_arg\ $1}" && ${2=1}>=1 && ${3=0}>=0 && ${4=5}>=0 && $4<=10" +rd={int($2)} kwh={sqr($rd*2+1)} str={1e{-$4+2}} +e[] "[afre]^_^) gui1: Blur image$? with a custom guided filter using guide=["${"-pass$1 -1"}"], radius="$rd", smoothing=$3 and structure=$4." +pass$1 0 to_colormode 0 +repeat $! if $>!=$! nm$>={$>,b} fi iM$>={$>,iM} /[$>] ${iM$>} done +repeat $!-1 l[$>,-1] +if w#0!=w#1||h#0!=h#1||d#0!=d#1 error[] "\n[afre]>_<) gui1: Image$? and guide ["${"-pass$1 -1"}"] must have the same width, height and depth." fi +. rv +*[1] [2] +sqr[1] afre_box[^0] $rd nm I,mI,mp,mIp,mII ++*[mI] [mp] *. -1 +. [mIp] rm[mIp] => cIp ++sqr[mI] *. -1 +. [mII] rm[mII] => vI ++normp[vI] 1 *. $kwh +. $str ^. -1 *. $str => W +++[vI] {vI,$3*ia+1e-6} /[cIp] . rm[vI,-1] =>[cIp] a ++*[a] [mI] *. -1 +. [mp] rm[mI,mp] => b +*[a,b] [W] afre_box[^0] $rd =>[^0] ma,mW,mb +*[ma] [I] +[ma] [mb] /[ma] [mW] k[I,ma] +=>[ma] ${nm$>} rv +done done rm. +repeat $! *[$>] ${iM$>} done +#@cli afre_gui0c : [kernel],_smoothing>=0,0<=_structure<=10 +#@cli : Convolve selected images with a custom self-guided filter. +#@cli : Default values: 'smoothing=1e-2' and 'structure=10'.\n +#@cli : - Use orders of magnitude for 'smoothing'. +#@cli : - Reduce 'structure' to soften edges and artifacts. +#@cli : * Improvement of "K He, J Sun, X Tang. Guided image filtering. TPAMI, 35(6):1397-1409, 2013". +afre_gui0c : check ${is_image_arg\ $1}" && ${2=1e-2}>=0 && ${3=10}>=0 && $3<=10" +e[] "[afre]^_^) gui0c: Convolve image$? with a custom self-guided filter using kernel=["${"-pass$1 -1"}"], smoothing=$2 and structure=$3." +str={1e{-$3+2}} +repeat $! pass$1 0 kwh={wh} l[$>,-1] nm={0,b} iM={0,iM} /[0] $iM +[0] +sqr. afre_conv[^0-1] [1] nm I,k,mI,mII ++sqr[mI] *. -1 +. [mII] rm[mII] => vI ++l[vI] abs s c + done *. $kwh +. $str ^. -1 *. $str => W +++[vI] {vI,$2*ia+1e-6} /[vI] . rm. =>[vI] a ++*[a] [mI] *. -1 +. [mI] rm[mI] => b +*[a,b] [W] afre_conv[^0-1] [k] =>[^0-1] ma,mW,mb +*[I] [ma] +[I] [mb] /[I] [mW] k[I] +* $iM nm $nm done done +#@cli afre_gui1c : [guide],[kernel],_smoothing>=0,0<=_structure<=10 +#@cli : Convolve selected images with a custom guided filter. +#@cli : Default values: 'smoothing=0' and 'structure=5'.\n +#@cli : - Use orders of magnitude for 'smoothing'. +#@cli : - Reduce 'structure' to soften edges and artifacts. +#@cli : * Improvement of "K He, J Sun, X Tang. Guided image filtering. TPAMI, 35(6):1397-1409, 2013". +afre_gui1c : check ${is_image_arg\ $1}" && "${is_image_arg\ $2}" && ${3=0}>=0 && ${4=5}>=0 && $4<=10" +e[] "[afre]^_^) gui1c: Convolve image$? with a custom guided filter using guide=["${"-pass$1 -1"}"], kernel=["${"-pass$2 -1"}"], smoothing=$3 and structure=$4." +pass$1 0 to_colormode 0 str={1e{-$4+2}} +repeat $! if $>!=$! nm$>={$>,b} fi iM$>={$>,iM} /[$>] ${iM$>} done +repeat $!-1 pass$2 0 kwh={wh} l[$>,-2--1] +if w#0!=w#1||h#0!=h#1||d#0!=d#1 error[] "\n[afre]>_<) gui1c: Image$? and guide ["${"-pass$1 -1"}"] must have the same width, height and depth." fi +[1] rv +*[2] [3] +sqr[2] afre_conv[^0-1] [1] nm I,k,mI,mp,mIp,mII ++*[mI] [mp] *. -1 +. [mIp] rm[mIp] => cIp ++sqr[mI] *. -1 +. [mII] rm[mII] => vI ++normp[vI] 1 *. $kwh +. $str ^. -1 *. $str => W +++[vI] {vI,$3*ia+1e-6} /[cIp] . rm[vI,-1] =>[cIp] a ++*[a] [mI] *. -1 +. [mp] rm[mI,mp] => b +*[a,b] [W] afre_conv[^0-1] [k] =>[^0-1] ma,mW,mb +*[ma] [I] +[ma] [mb] /[ma] [mW] k[I,ma] +=>[ma] ${nm$>} rv +done done rm. +repeat $! *[$>] ${iM$>} done +#@cli afre_gui0_fast : radius>=1,_smoothing>=0,0<=_structure<=10 +#@cli : Blur selected images with a custom self-guided filter. Faster version. +#@cli : Default values: 'radius=1', 'smoothing=1e-2' and 'structure=10'.\n +#@cli : - Use orders of magnitude for 'smoothing'. +#@cli : - Reduce 'structure' to soften edges and artifacts. +#@cli : * Improvement of "K He, J Sun, X Tang. Guided image filtering. TPAMI, 35(6):1397-1409, 2013". +afre_gui0_fast : check "${1=1}>=1 && ${2=1e-2}>=0 && ${3=10}>=0 && $3<=10" +rd={int($1)} kwh={sqr($rd*2+1)} str={1e{-$3+2}} +e[] "[afre]^_^) gui0_fast: Blur image$? with a custom self-guided filter using radius="$rd", smoothing=$2 and structure=$3. Faster version." +repeat $! l[$>] nm={b} iM={iM} / $iM +. +sqr. afre_box_fast[^0] $rd nm I,mI,mII ++sqr[mI] *. -1 +. [mII] rm[mII] => vI ++l[vI] abs s c + done *. $kwh +. $str ^. -1 *. $str => W +++[vI] {vI,$2*ia+1e-6} /[vI] . rm. =>[vI] a ++*[a] [mI] *. -1 +. [mI] rm[mI] => b +*[a,b] [W] afre_box_fast[^0] $rd =>[^0] ma,mW,mb +*[I] [ma] +[I] [mb] /[I] [mW] k[I] +* $iM nm $nm done done +#@cli afre_gui1_fast : [guide],_radius>=1,_smoothing>=0,0<=_structure<=10 +#@cli : Blur selected images with a custom guided filter. Faster version. +#@cli : Default values: 'radius=1', 'smoothing=0' and 'structure=5'.\n +#@cli : - Use orders of magnitude for 'smoothing'. +#@cli : - Reduce 'structure' to soften edges and artifacts. +#@cli : * Improvement of "K He, J Sun, X Tang. Guided image filtering. TPAMI, 35(6):1397-1409, 2013". +afre_gui1_fast : check ${is_image_arg\ $1}" && ${2=1}>=1 && ${3=0}>=0 && ${4=5}>=0 && $4<=10" +rd={int($2)} kwh={sqr($rd*2+1)} str={1e{-$4+2}} +e[] "[afre]^_^) gui1_fast: Blur image$? with a custom guided filter using guide=["${"-pass$1 -1"}"], radius="$rd", smoothing=$3 and structure=$4. Faster version." +pass$1 0 to_colormode 0 +repeat $! if $>!=$! nm$>={$>,b} fi iM$>={$>,iM} /[$>] ${iM$>} done +repeat $!-1 l[$>,-1] +if w#0!=w#1||h#0!=h#1||d#0!=d#1 error[] "\n[afre]>_<) gui1_fast: Image$? and guide ["${"-pass$1 -1"}"] must have the same width, height and depth." fi +. rv +*[1] [2] +sqr[1] afre_box_fast[^0] $rd nm I,mI,mp,mIp,mII ++*[mI] [mp] *. -1 +. [mIp] rm[mIp] => cIp ++sqr[mI] *. -1 +. [mII] rm[mII] => vI ++normp[vI] 1 *. $kwh +. $str ^. -1 *. $str => W +++[vI] {vI,$3*ia+1e-6} /[cIp] . rm[vI,-1] =>[cIp] a ++*[a] [mI] *. -1 +. [mp] rm[mI,mp] => b +*[a,b] [W] afre_box_fast[^0] $rd =>[^0] ma,mW,mb +*[ma] [I] +[ma] [mb] /[ma] [mW] k[I,ma] +=>[ma] ${nm$>} rv +done done rm. +repeat $! *[$>] ${iM$>} done +#@cli afre_dilateg : [mask],size>=2 +#@cli : Compute geodesic dilation of selected images. +#@cli : Default value: 'size=3'. +afre_dilateg : check ${is_image_arg\ $1}" && ${2=3}>=2" +e[] "[afre]^_^) dilateg: Compute geodesic dilation of image$? using mask=["${"pass$1\ -1"}"] and size=$2." +pass$1 0 repeat $!-1 l[$>,-1] repeat 1000 +ia={ia} +dilate. $2 +min[0,-1] rm[2--2] if $ia==ia break fi +done rm[0] rv done done rm. +#@cli afre_erodeg : [mask],size>=2 +#@cli : Compute geodesic erosion of selected images. +#@cli : Default value: 'size=3'. +afre_erodeg : check ${is_image_arg\ $1}" && ${2=3}>=2" +e[] "[afre]^_^) erodeg: Compute geodesic erosion of image$? using mask=["${"pass$1\ -1"}"] and size=$2." +pass$1 0 repeat $!-1 l[$>,-1] repeat 1000 +ia={ia} +erode. $2 +max[0,-1] rm[2--2] if $ia==ia break fi +done rm[0] rv done done rm. +#@cli afre_openg : size>=2 +#@cli : Compute geodesic opening of selected images. +#@cli : Default value: 'size=3'. +afre_openg : check ${1=3}>=2 +e[] "[afre]^_^) openg: Compute geodesic opening of image$? using size=$1." ++erode $1 repeat 1000 +ia={ia} dilate. $1 +min rm.. if $ia==ia break fi +done k. +#@cli afre_closeg : size>=2 +#@cli : Compute geodesic closing of selected images. +#@cli : Default value: 'size=3'. +afre_closeg : check ${1=3}>=2 +e[] "[afre]^_^) closeg: Compute geodesic closing of image$? using size=$1." ++dilate $1 repeat 1000 +ia={ia} erode. $1 +max rm.. if $ia==ia break fi +done k. +#@cli ::Utilities +#@cli afre_maxmin +#@cli : Return the maximum of channel minimums. +afre_maxmin : +repeat s sh. $> im.={`$>?','`}{im} rm. done u {max($im)} +#@cli afre_minmax +#@cli : Return the minimum of channel maximums. +afre_minmax : +repeat s sh. $> iM.={`$>?','`}{iM} rm. done u {min($iM)} +#@cli afre_compare : crop={ 1=once | 2=twice },_layout={ x | y | z | tile },_normalize={ 0 | 1 } +#@cli : Crop then compare selected images interactively. +#@cli : Default values: 'crop=1', 'layout=x' and 'normalize=1'.\n +#@cli : 1. Interactive Crop +#@cli : \ - Click and drag to select crop. +#@cli : \ - Use scroll button to browse images. +#@cli : \ * Click once or close window to exit command.\n +#@cli : 2. Comparison Window +#@cli : \ - Regular display behaviour. +#@cli : \ - Close window to make another comparison. +afre_compare : check "${1=1}>=1 && $1<=2 && (s='${2=x}';s=='x'||s=='y'||s=='z'||s=='tile') && "isbool(${3=1}) +n={$!-1} if $n<1 error[] "\n[afre]>_<) compare: Please select 2 or more images." fi +repeat $!-1 if w#0!=w#{$>+1}||h#0!=h#{$>+1} error[] "\n[afre]>_<) compare: Please select images with the same width and height." fi done +repeat $! if d#$>!=1 e[] "[afre]>_<) compare: *Slices in image ["$>"] will be considered separate images." fi done +e[] "[afre]^_^) compare: Crop then compare image$? interactively." +e[] "\n 1. Interactive Crop\n +\ - Click and drag to select crop.\n +\ - Use scroll button to browse images.\n +\ * Click once or close window to exit command.\n\n +2. Comparison Window\n +\ - Regular display behaviour.\n +\ - Close window to make another comparison.\n" +to_colormode 0 if $3 n 0,255 fi +do +l =>[0] Compare +a z repeat $1 xz b={w} if $b==1 break fi done +b={w} if '$2'!='z' s z if '$2'!='tile' a $2 else append_tiles 0 fi fi +if $b==1 break else v - d v + fi +done k[0-$n] while $b!=1 v - d[] +#@cli afre_reorder : order,_order2,... +#@cli : Reposition images according to a list of values of any length. +afre_reorder : +e[] "[afre]^_^) reorder: Reposition images according to list $*." +z 0,0,0,100%,100%,1 mirror z f z==0?1e6:i +l ($*) onfail error[] "\n[afre]>_<) reorder: Parameter must be a list of numbers; e.g. 0,2,4,1,3." done +repeat min(w,$!-1) f[$>] z==0?{i($>)}:i done +sort_list[0-{min(w,$!-1)-1}] + rm. z 0,0,1,100%,100%,1 +#@cli afre_log2 : direction={ 0=inverse | 1=forward } +#@cli : Transform selected images into or back from log2 space. +#@cli : Default value: 'direction=1'. +afre_log2 : check isbool(${1=1}) +if $1 d="into" else d="back from" fi +e[] "[afre]^_^) log2: Transform image$? "$d" log2 space." +if $1 + 1 log2 else f exp(i*log(2)) - 1 fi +#@cli afre_section : 1<=xy_sections<=50 +#@cli : Section selected images into numbered regions. +#@cli : Default value: 'xy_sections=20'. +afre_section : check "${1=20}>=1 && $1<=50" +m=min(w,h) err=int($m/25) if $err<$1 error[] "\n[afre]>_<) section: Section image$? into no more than "{max(sqr($err),1)}" ("{max($err,1)}"x"{max($err,1)}") regions." fi +e[] "[afre]^_^) section: Section image$? into "{sqr($1)}" ($1x$1) numbered regions." +repeat $! l[$>] +im,iM={[im,iM]} s yx,$1 repeat $! +t[$>] {$>+1},0.5~,0.5~,{$m*0.55},0.9,$im t[$>] {$>+1},0.5~,0.5~,{$m*0.56},0.9,$iM +done append_tiles $1 +grid {100/$1}%,{100/$1}%,,,0.2,$im +grid {100/$1}%,{100/$1}%,-1,-1,0.2,$iM +done done +#@cli afre_cleanphoto : 2<=size<=10,1<=_recovery<=100,-50<=_xy_sections<=50,_maskN>=1,... +#@cli : Clean dust and scratches from photos. +#@cli : Default values: 'size=3', 'recovery=10', 'xy_sections=1' and 'maskN=1'.\n +#@cli : - 'xy_sections' sections image into MxM labeled regions. +#@cli : \ \ \ For global processing, set 'xy_sections' to 1. +#@cli : \ \ \ To visualize these regions with labels, use a negative number. +#@cli : - 'maskN' is a comma separated list of regions to be processed. +afre_cleanphoto : check "${1=3}>=2 && ${2=10}>=1 && ${3=1}>=-50 && +$1<=10 && $2<=100 && $3<=50" skip ${4=1} +m=min(w,h) err=int($m/25) if $err<$3 error[] "\n[afre]>_<) cleanphoto: Section image$? into no more than "{max(sqr($err),1)}" ("{max($err,1)}"x"{max($err,1)}") regions." fi +m "ip : p=$1,,,{iM} ++erode_threshold $p dilate_threshold. $p afre_gui1_fast. .. c. 0,100% ++afre_edge.. 1,1,4,4 afre_box. 1 c. 0,$2% n. 0,1 +blend_fade[0,1] . k[0,-1] ++gaussian. {[w,h]*0.3} c. 0,50% n. 0,1 blend_fade[0,1] . k[0]" +e[] "[afre]^_^) cleanphoto: Clean dust and scratches from image$? using size=$1, recovery=$2, xy_sections=$3 and masks=${4--1}." +repeat $! l[$>] if $3>1 +iM={iM} w0,h0={[w,h]} w,h={[w,h]/$3} 100%,100%,1,3 l. (${4--1}) +c. 1,{sqr($3)} round. sort. discard. unroll. x +repeat w v={i($>)} i={$v%$3?$v%$3:$3} j={($v+$3-$i)/$3} +r={[$w*$i-$w,$h*$j-$h,$w*$i-1,$h*$j-1]} rectangle[0] $r,1,$iM +done rm. label_fg 0 r {[$w0,$h0]+2},1,3,0,0,0.5,0.5 +repeat iM +==[0] {$>+1} coord=${" +w={w} h={h} val={i(w-1,h-1)} +=. {1+$val},100%,100%,100% +autocrop. =. $val,100%,100%,100% x0={$w-w} y0={$h-h} rm. ++autocrop. x1={$x0+w-1} y1={$y0+h-1} rm. u $x0,$y0,$x1,$y1 +"} rm. ($coord) done +a[^0] y done r[0] {[$w0,$h0]+2},1,3,0,0,0.5,0.5 +repeat h x0,y0,x1,y1={@{[0,1,2,3]+4*$>}} +z[0,1] $x0,$y0,$x1,$y1 ++ip.. f. i#4?i#5:i#3 j[0] .,$x0,$y0 rm[-3--1] +done k[0] r {[$w0,$h0]},1,3,0,0,0.5,0.5 +else ip +fi done done um ip +#@cli afre_cleanphoto1 : 1<=radius<=10,1<=_xy_sections<=50,_maskN>=1,... +#@cli : Clean dust and scratches from photos. +#@cli : Default values: 'radius=3', 'xy_sections=1' and 'maskN=1'.\n +#@cli : - 'xy_sections' sections image into MxM labeled regions. +#@cli : \ \ For global processing, set 'xy_sections' to 1. +#@cli : - 'maskN' is a comma separated list of regions to be processed. +#@cli : \ \ Use 'afre_section' to determine region labels. +afre_cleanphoto1 : check "${1=3}>=1 && ${2=1}>=1 && +$1<=10 && $2<=50" skip ${3=1} +rd={int($1)} m=min(w,h) err=int($m/25) if $err<$2 error[] "\n[afre]>_<) cleanphoto: Section image$? into no more than "{max(sqr($err),1)}" ("{max($err,1)}"x"{max($err,1)}") regions." fi +m "ip : s={"$rd"*2+1} +l +erode_oct $s dilate_oct. $s - c 0,100% ^ 2 +c 5%,10% dilate_oct 3 n 0,1 done +inpaint_pde.. . rm.. ++gaussian. {[w,h]*0.3} c. 0,50% n. 0,1 blend_fade[0,1] . k[0]" +e[] "[afre]^_^) cleanphoto: Clean dust and scratches from image$? using radius="$rd", xy_sections=$2 and maskN=${3--1}." +repeat $! l[$>] if $2>1 +iM={iM} w0,h0={[w,h]} w,h={[w,h]/$2} 100%,100%,1,3 l. (${3--1}) +c. 1,{sqr($2)} round. sort. discard. unroll. x +repeat w v={i($>)} i={$v%$2?$v%$2:$2} j={($v+$2-$i)/$2} +r={[$w*$i-$w,$h*$j-$h,$w*$i-1,$h*$j-1]} rectangle[0] $r,1,$iM +done rm. label_fg 0 r {[$w0,$h0]+2},1,3,0,0,0.5,0.5 +repeat iM +==[0] {$>+1} coord=${" +w={w} h={h} val={i(w-1,h-1)} +=. {1+$val},100%,100%,100% +autocrop. =. $val,100%,100%,100% x0={$w-w} y0={$h-h} rm. ++autocrop. x1={$x0+w-1} y1={$y0+h-1} rm. u $x0,$y0,$x1,$y1 +"} rm. ($coord) done +a[^0] y done r[0] {[$w0,$h0]+2},1,3,0,0,0.5,0.5 +repeat h x0,y0,x1,y1={@{[0,1,2,3]+4*$>}} +z[0,1] $x0,$y0,$x1,$y1 ++ip.. f. i#4?i#5:i#3 j[0] .,$x0,$y0 rm[-3--1] +done k[0] r {[$w0,$h0]},1,3,0,0,0.5,0.5 +else ip +fi done done um ip +#@cli search_dichotomic : "increasing_fn",target_y,_precision>0 +#@cli : Find parameter for function such that 'target_y' is met in image. +#@cli : Default value: 'precision=1e-3'.\n +#@cli : - Return 'nan' if search fails. +#@cli : * Credit: David Tschumperle. +search_dichotomic : check ${3=1e-3}>0 +m "_sdc : $1" target_value,epsilon=$2,$3 mpos,nb_attempts=-1,20 +do mvalue=${_sdc\ $mpos} if $mvalue<$target_value break fi mpos*=2 +nb_attempts-=1 while $nb_attempts if !$nb_attempts u nan return fi +Mpos,nb_attempts=1,20 +do Mvalue=${_sdc\ $Mpos} if $Mvalue>$target_value break fi Mpos*=2 +nb_attempts-=1 while $nb_attempts if !$nb_attempts u nan return fi +nb_attempts=100 +do +cpos={($mpos+$Mpos)/2} cvalue=${_sdc\ $cpos} +if abs($cvalue-$target_value)<$epsilon u $cpos return +elif $cvalue<$target_value mpos=$cpos else Mpos=$cpos fi +nb_attempts-=1 +while $nb_attempts u {$nb_attempts?$cpos:nan} +#@cli afre_details : n_scales>=2 +#@cli : Split image into detail scales. +#@cli : Default value: 'n_scales=2'. +afre_details : check ${1=2}>=2 +e[] "[afre]^_^) details: Split image$? into $1 detail scales." +repeat $! l[$<] +repeat $1-1 +afre_gui0_fast. 1,1e10 -.. . rv[-2,-1] done +done done +afre_details_preview : +afre_details $* +n 0,255 append_tiles 0 +fx_gamify : +if $3 n 0,255 fi +afre_jchz +s c n... $1,100 *.. $2 a c +afre_ijchz +split_details 2 +l.. adjust_colors 0,{-$4/1.5*20} done +*. $4 ++ c 0,255 +fx_gamify_preview : +gui_split_preview "fx_gamify $*",$-1 +#@cli afre_gleam : 2<=smooth<=100,10<=_threshold<=90 +#@cli : Add gleam effect to selected images. +#@cli : Default values: 'smooth=3' and 'threshold=50'. +afre_gleam : check "${1=3}>=2 && ${2=50}>=10 && $1<=100 && $2<=90" +e[] "[afre]^_^) gleam: Add gleam effect to image$? using smooth=$1 and threshold=$2." +repeat $! l[$>] ++afre_y50 1 >. {100-$2}% b. $1% sqrt. +afre_softlight 100 rm.. max +done done +afre_gleam_preview : +afre_gleam $* +#@cli afre_halfhalf : match_size={ 0 | 1 } +#@cli : Stitch left and right halves of 2 images, respectively. +#@cli : Default value: 'match_size=0'. +afre_halfhalf : check isbool(${1=0}) +if $!!=2 error[] "\n[afre]>_<) halfhalf: Please select 2 images." fi +e[] "[afre]^_^) halfhalf: Stitch left and right halves of 2 images using match_size=$1." ++f[{w#0>w#1?0:1}] 0 mv. 0 s[1,2] x,2 rm[2,3] +if w#1=1,_spacing>=0,0<=_matte_colour={[R,G,B]}<=255 +#@cli : Generate montage without resizing. +#@cli : Default values: 'max_per_row=5', 'spacing=1', 'matte_colour=230,255,230'. +afre_montagex : check "${1=5}>=1 && ${2=1}>=0 && inrange(${3=230},0,255) && inrange(${4=255},0,255) && inrange(${5=230},0,255)" +e[] "[afre]^_^) montagex: Generate montage without resizing image$? using max_per_row=$1, spacing=$2 and matte_colour=(${3-5})." +to_colormode 0 a=$1 b,c=int($!/$a),{$!%$a} ++ 1 frame {[$2,$2]*min(${-max_w},${-max_h})*0.01},0 +repeat $b a[{$a*$<}-{$a*$<+($a-1)}] x,0.5 done +if $c a[-$c--1] x,0.5 fi a y,0.5 +- 1 replace_color 0,0,-1,-1,-1,$3,$4,$5 +afre_montagex_preview : +afre_montagex $* +#@cli afre_portraitmontage : size={ 0=small | 1=large },_spacing>=1,_matte_shape={ 0=none | 1=circle | 2=polygon | 3=star },0<=_matte_colour={[R,G,B]}<=255 +#@cli : Generate portrait montage with resizing. +#@cli : Default values: 'size=1','spacing=1', 'matte_shape=0', 'matte_colour=230,255,230'.\n +#@cli : \- Centre subjects for best results. +afre_portraitmontage : check "isbool(${1=1}) && ${2=1}>=1 && inrange(${3=0},0,3) && inrange(${4=230},0,255) && inrange(${5=255},0,255) && inrange(${6=230},0,255)" +if $3==0 s=none elif $3<2 s=circle elif $3<3 s=polygon t=8 +elif $3<4 s=star t=24,0.9 fi +e[] "[afre]^_^) portraitmontage: Generate portrait montage of resized image$? using size=$1, spacing=$2, matte_shape="$s" and matte_colour=(${4-6})." +rr2d {`$1?'${-max_w},${-max_h},':'${-min_w},${-min_h},1'`},2 to_rgb +repeat $! l[$>] if $3 +f. -1 shape_$s {min(w,h)},$t to_rgb. +ri. ..,0,0,0.5,0.5 negate. j... ..,0,0,0,0,1,. k... autocrop fi ++ 1 done done f=min(${-max_w},${-max_h}) frame {[$2,$2]*$f*0.01},0 +append_tiles 0 frame {[$2,$2]*$f*0.01},0 - 1 replace_color 0,0,-1,-1,-1,$4,$5,$6 +afre_portraitmontage_preview : +afre_portraitmontage $* +#@cli afre_queryprimary : mode={ 0=min | 1=max | 2=med },_skip_last_channel={ 0 | 1 } +#@cli : Query pixel minima, maxima or medians of selected images. +#@cli : Default values: 'mode=1' and 'skip_last_channel=0'. +afre_queryprimary : check "inrange(${1=1},0,2) && isbool(${2=0})" +mode,s={`$1>1?'med,medians':$1>0?'max,maxima':'min,minima'`} if $2 skip=", skipping the last channel" fi e[] "[afre]^_^) queryprimary: Query pixel "$s" of image$?"$skip"." +repeat $! l[$>] if $2 sh 0,{s-2} fi l. ++s c $mode[^0] +== rm.. * +done if $2 rm. fi done done +afre_queryprimary_preview : +afre_queryprimary $* +#@cli afre_sharpenfft : 1<=strength<=50,1<=_size<=10 +#@cli : Sharpen selected images with Fourier transform. +#@cli : Default values: 'strength=15' and 'size=1'. +afre_sharpenfft : check "${1=15}>=1 && ${2=1}>=1 && $1<=50 && $2<=10" +e[] "[afre]^_^) sharpenfft: Sharpen image$? with Fourier transform using strength=$1 and size=$2." +repeat $! l[$>] iM={iM} +periodize_poisson -.. . l. +l +fftpolar +gaussian.. {100/$2}% negate. *[^1] ifftpolar * $1 +done + c 0,$iM done + c 0,$iM done done +afre_sharpenfft_preview : +afre_sharpenfft $* +#@cli afre_vigcirc : 50<=size<=150,-500<=_strength<=500,0<=_position_x<=100,0<=_position_y<=100 +#@cli : Add circular vignette of selected images. Negative strength will brighten periphery. +#@cli : Default values: 'size=90', 'strength=75', 'position_x=50' and 'position_y=50'. +afre_vigcirc : check "${1=90}>=50 && ${2=75}>=-500 && ${3=50}>=0 && ${4=50}>=0 && +$1<=150 && $2<=500 && $3<=100 && $4<=100" +e[] "[afre]^_^) vigcirc: Add circular vignette of image$? using size=$1, strength=$2, position_x=$3 and position_y=$4." +repeat $! l[$>] iM={iM} min={min(w,h)} ++f 1 circle. $3%,$4%,{($min/2-2)/100*$1} +distance. 0 b. 1 -. {im} *. {$2/100} - +c 0,$iM done done +afre_vigcirc_preview : +afre_vigcirc $* +#@cli afre_vigrect : 1<=size<=100,-500<=_strength<=500,1<=_blur<=50,0<=_position_x<=100,0<=_position_y<=100 +#@cli : Add rectangular vignette of selected images. Negative strength will brighten periphery. +#@cli : Default values: 'size=50', 'strength=75', 'blur=10', 'position_x=50' and 'position_y=50'. +afre_vigrect : check "${1=50}>=1 && ${2=75}>=-500 && ${3=10}>=1 && ${4=50}>=0 && ${5=50}>=0 && +$1<=100 && $2<=500 && $3<=50 && $4<=100 && $5<=100" +e[] "[afre]^_^) vigrect: Add rectangular vignette of image$? using size=$1, strength=$2, blur=$3, position_x=$4 and position_y=$5." +repeat $! l[$>] iM={iM} min={min(w,h)} s={$min/100*(50.5-$1/2)} +tx={$min/100*($4-50)} ty={$min/100*($5-50)} ++f x<$s+$tx||x>w-$s+$tx||y<$s+$ty||y>h-$s+$ty +distance. 0 b. {$min/100*$3} -. {im} *. {$2/100} - +c 0,$iM done done +afre_vigrect_preview : +afre_vigrect $* +_fx_remove_scratches : +repeat $! l[$>] to_rgba +sh 0,2 +sh.. 3 +<. {$1*255%} +if $4>=1 erode. $2 fi +if $4>=2 dilate. $3 fi +if $4<3 k... channels 3 * 255 +else inpaint_matchpatch.. . k... channels 0,2 +fi +done done +fx_remove_scratches : +_fx_remove_scratches ${1-3},3 +fx_remove_scratches_preview : +gui_split_preview "_fx_remove_scratches $*",$-1 +fx_corvo_painting_5 : ++polygonize $1,$2,$3,10,10 ++blend[0,1] alpha,$4 +-texturize_canvas[2] $5,0.5,0.6 +-smooth[2] $7,0.4,0.7,$8,$9 ++plasma[2] 0.7,100,8 n 0,255 +-blend[3,2] grainmerge,$6 +-bilateral[0,2] 10,7 +-blend[0,2] alpha,$10 +rm. +fx_morpho : +ac "__fx_morpho ${^0}",$5,$6 +fx_morpho_preview : +gui_split_preview "fx_morpho ${^0}",$-1 +__fx_morpho : +if $4==1 suf="_oct" elif $4==0 suf="" else suf="_circ" fi +if $1==0 erode$suf $2 +elif $1==1 dilate$suf $2 +elif $1==2 erode$suf $2 dilate$suf $2 +elif $1==3 dilate$suf $2 erode$suf $2 +elif $1==4 repeat $! +erode$suf $2 -[-2,-1] mv. 0 done +elif $1==5 repeat $! +dilate$suf $2 rv[-2,-1] -[-2,-1] mv. 0 done +elif $1==6 repeat $! +erode$suf $2 dilate$suf. $2 -[-2,-1] mv. 0 done +else repeat $! +dilate$suf $2 erode$suf. $2 rv[-2,-1] -[-2,-1] mv. 0 done +fi +if $3 repeat $! l[$>] split_opacity negate[0] a c done done fi +gcd_anti_alias : skip ${1=10},${2=0.3},${3=10} +foreach { split_opacity l[0] { ++smooth[0] $1,0,1,1.6,1.1,0.8,30,0.6 ++gradient_norm[0] +n. 0,$3 +[0,-1] +^. $2 n. 0,255 ++gradient_norm. ^. $2 n. 0,255 +blend[-2,-1] overlay append[-2,-1] c +blend[0,1] alpha c 0,255 +} a c } +gcd_anti_alias_preview : +gui_split_preview "gcd_anti_alias ${1--2}",$-1 +gcd_srgb2jpeg : +repeat $! l[$>] +if s<3 continue fi +if s==4 split_opacity fi +mix_rgb[0] 0.299,0.587,0.114,-0.1687,-0.3313,0.5,0.5,-0.4187,-0.0813 +sh[0] 1,2 +. 128 rm. a c +done done +gcd_jpeg2srgb : +repeat $! l[$>] +if s<3 continue fi +if s==4 split_opacity fi +sh[0] 1,2 -. 128 rm. +mix_rgb[0] 1,0,1.402,1,-0.34414,-0.71414,1,1.772,0 a c +done done +gcd_srgb2luma : +repeat $! l[$>] +remove_opacity +if s!=3 continue fi +sh[0] 0,0 sh[0] 1,1 sh[0] 2,2 +*[1] 0.299 *[2] 0.587 *[3] 0.114 ++[1-3] rm[1] channels[0] 0 +done done +gcd_srgb2luminance : +repeat $! l[$>] +remove_opacity +if s!=3 continue fi +srgb2rgb[0] sh[0] 0,0 sh[0] 1,1 sh[0] 2,2 +*[1] 0.2126 *[2] 0.7152 *[3] 0.0722 ++[1-3] rm[1] channels[0] 0 +done done +gcd_gamma : skip ${1=1},${2=0},${3=255} +if $1==1 return fi +repeat $! l[$>] +if !$2 g={1/max($1,0.001)} -^ $g * {$3^(1-$g)} +else * -1 + $3 max 0 -^ $1 * {-$3^(1-$1)} + $3 fi +done done +gcd_sbezier : skip ${1=0.5},${2=255} +repeat $! l. / $2 +sqr *. {1-2*$1} *.. {2*$1} + * $2 done done +gcd_ibezier : skip ${1=0.5},${2=255} +if $1==0.5 return fi +repeat $! l. +d={1-2*$1} e={$1/$d} / {$2*$d} + {$e*$e} +sqrt. * {$1>0.5?-1:1} - $e * $2 +done done +gcd_label : skip ${1=4},${2=0.067} +repeat $! l[$>] +label. $1,1 nb={1+iM} ++histogram. $nb,0,{$nb-1} ++map.. . rm.. +le. {$2%*w*h} *. 255 +inpaint.. . rm. +done done +gcd_shrink : +_gcd_w={0,w} _gcd_h={0,h} +repeat $! l[$>] if max(w,h)>700 rr2d. 700,700,0,1 fi done done +gcd_unshrink : +repeat $! l[$>] r $_gcd_w,$_gcd_h done done +gcd_fix_alpha : +repeat $! l[$>] if s==2||s==4 +sh 0,{s-2} sh[0] 100%,100% max. 1 +neq. 1 *[-3,-1] -k[0] +fi done done +#@cli gcd_noalpha +#@cli : Remove any gimp alpha channel and zero transparencies +gcd_noalpha : +e[^-1] "Remove gimp alpha channel from image$?." +repeat $! l[$>] if s==2||s==4 +m={s-2} sh 0,$m sh.. 100% neq. 0 *.. . -k[0] channels 0,$m +fi done done +#@cli gcd_splitalpha +#@cli : Split any gimp alpha channel and zero transparencies +gcd_splitalpha : +e[^-1] "Split gimp alpha channel from image$?." +repeat $! l[$>] if s==2||s==4 +m={s-2} sh 0,$m sh.. 100% . neq.. 0 *[1,2] -k[^1] channels.. 0,$m +fi done done +#@cli gcd_force_rgb +#@cli : Force selected gimp images to be in RGB mode. +gcd_force_rgb : +e[^-1] "Force gimp image$? to be in RGB mode." +repeat $! l[$>] +if s>4 error[] "Command 'gcd_force_rgb': Image ["$>"] is not a G,GA,RGB or RGBA image ("{s}" channels)." +elif s==4 sh 0,2 sh.. 3 neq. 0 *.. . -k[0] channels 0,2 +elif s==2 sh 0 sh.. 1 neq. 0 *.. . -k[0] channels 0 r 100%,100%,100%,3 +elif s==1 r 100%,100%,100%,3 +fi +done done +#@cli gcd_force_rgba +#@cli : Force selected gimp images to be in RGBA mode. +gcd_force_rgba : +e[^-1] "Force gimp image$? to be in RGBA mode." +repeat $! l[$>] +if s>4 error[] "Command 'gcd_force_rgba': Image ["$>"] is not a G,GA,RGB or RGBA image ("{s}" channels)." +elif s==4 +channels 3 neq. 0 * +elif s==3 channels 0,3 sh. 3 f. 255 rm. +elif s==2 +channels 1 neq. 0 * r 100%,100%,100%,4 sh. 2 f. .. rm. +elif s==1 r 100%,100%,100%,4 sh. 3 f. 255 rm. +fi +done done +#@cli gcd_force_a +#@cli : Force selected gimp images to have an alpha channel. +gcd_force_a : +e[^-1] "Force gimp image$? to have an alpha channel." +repeat $! l[$>] +if s==1||s==3 channels 0,{s} sh. {s-1} f. 255 rm. +elif s==2||s==4 +channels 100% neq. 0 * fi +done done +#@cli gcd_srgb2rgb +#@cli : Convert from sRGB gamma to RGB by fast approximate. +gcd_srgb2rgb : +e[^-1] "Convert image$? from sRGB gamma to RGB by fast approximate." +c 0,255 * 257 round 1 (0,255) r. 65536,1,1,1,3 srgb2rgb. map[^-1] . rm. +#@cli gcd_rgb2srgb +#@cli : Convert from RGB to sRGB gamma by fast approximate. +gcd_rgb2srgb : +e[^-1] "Convert image$? from RGB to sRGB gamma by fast approximate." +c 0,255 * 257 round 1 (0,255) r. 65536,1,1,1,3 rgb2srgb. map[^-1] . rm. +#@cli gcd_extract_clut : _resolution_root,_smoothness,_nb_iterations>=0,_nb_randoms>=0 +#@cli : Extract color LUT from selected images. +gcd_extract_clut : skip ${1=8},${2=3},${3=5},${4=5} +e[^-1] "Extract color LUT from image$?." +to_rgb b={int($1)^2} s={$b^1.5} +(0,1;0,1/0,1;0,1^0,0;1,1/0,0;1,1^0,0;0,0/1,1;1,1) +*. 255 r. $b,$b,$b,3,3 r. $s,$s,1,3,-1 +repeat $!-1 l[$>,-1] nm="[CLUT: "{0,n}"]" ++matchpatch. ..,1,1,1,$3,$4 warp[0] .,0 +rm. r.. $b,$b,$b,3,-1 b.. $2 =>.. $nm +done done rm. +#@cli gcd_geometric_median : size>=0,_nb_iter>=0 +#@cli : Apply geometric median filter on vector-valued images. +#@cli : Default values: 'size=3' and 'nb_iter=12'. +#@cli : $ image.jpg +gcd_geometric_median 3 +gcd_geometric_median : skip ${1=3},${2=12} +e[^-1] "Apply geometric median filter of size $1, on image$?." +repeat $! l[$>] +[0] +boxfilter. {$1+1-$1%2} sh. 0 +f. "* +begin( +const boundary = 1; +const N = int($1/2); +const W = N+1; +weightedSum = I(#1); +totalDist = weightedSum; +); +Y = I(#2,x,y); # centroid +for (iters = 0, iters<$2, ++iters, +weightedSum = 0; +totalDist = 0; +distSum = 0; +flag = 0; +for (j = -N, j0,_value,_max_iters>0 +#@cli : Add poisson disk sampling noise to selected images. +#@cli : Default values: 'radius=8', 'value=1' and 'max_iters=30'. +gcd_poisson_disk : check "${1=8}>0 && ${3=30}>0" skip ${2=1} +e[^-1] "Add noise points to image$?, with specified minimum distance." +repeat $! l[$>] +R={${"is_percent $1"}?max(w,h,d)*$1:$1} +dim={d>1?3:h>1?2:1} cw={0.999*$R/sqrt($dim)} +({[w,h,d,1]}) y. c +{[ceil(I/$cw)]} +r[1] 1,1,1,$dim,-1 +1,1,1,$dim 1,1,1,1 +{vector$dim(2*ceil(sqrt($dim))+1)} r. 100%,100%,100%,2 +f. "P=[x,y,z]-int([w/2,h/2,d/2]);[sum(sqr(P)),dot(P,[1,w#2,w#2*h#2])]" +r. {[whd,s,1,1,-1]} sort. +,x z. 0,1,100%,100% y. c +=>[1] dims =>[2] grid =>[3] samples =>[4] active =>[5] prox +eval ${-math_lib}${-dar_lib}" +const N = "$dim"; +const radius = "$R"; +const grid_cw = "$cw"; +const max_sample_attempts = $3; +mag2(vec) = (sum(sqr(vec))); +prox = I#5; +lim = I#1; +dar_insert(#3,I#1,0); # dummy sample to simplify bounds checks +dar_insert(#3,u(I#1),1); # add initial sample to list +dar_insert(#4,1,0); # add its index to active list +I(#2,int(I[#3,1]/grid_cw)) = 1; # add its index to grid cell +I(#0,I[#3,1]) = $2; # draw the point +while (dar_size(#4)>0, +R = int(u(dar_size(#4)-1e-4)); # choose a random active list index +P = i[#4,R]; # get the index of that sample +T = I[#3,P]; # position vector of that sample +for (attempts=0, attempts < max_sample_attempts, ++attempts, +do (S=4*(u(vectorN(1))-0.5); M=mag2(S), M <= 1 || M > 4); +X = T + radius * S; +if (min(X)<0 || min(lim-X)<0, continue()); +G = int(X/grid_cw); +GI = dot(G,[1,w#2,w#2*h#2]); # grid cell direct buffer index +for (K=0;rejected=0, K0 && mag2(I[#3,V]-X)=0[%],_boundary_conditions,_kernel +#@cli : Blur selected images using a binary inclusion mask. +#@cli : See 'help blur' for full parameters description. +#@cli : $ image.jpg to_rgb +to_a circle 50%,50%,80,1,0 gcd_blur_masked 2% +gcd_blur_masked : +e[^-1] "Blur image$? with binary inclusion masking." +repeat $! l[$>] +to_a split_opacity mo={iM} +ge. 1 *[0] . +eq. 0 b[0,-1] $* *. .. *. -1 +. 1 /[0,-1] *[0] . +*. $mo a c +done done +#@cli gcd_boxfilter_local : [reference_image] +#@cli : Blur selected images by a per-pixel box filter (2D SAT implementation). +#@cli : Local window sizes are specified by the reference image. +#@cli : $ sample +gaussian 20%,20% n. 0,50 gcd_boxfilter_local.. . +gcd_boxfilter_local : check ${"is_image_arg $1"} +pass$1 0 max. 1 +repeat $!-1 l[$>,-1] +av={ia#0} sub.. $av cumulate.. xy # bias to improve precision +f.. " +begin( +const boundary=1; +const interpolation=1; +const W=w-1; const H=h-1; +T(X,Y)=Y>1?i(X,Y-1):Y*i(X,0); +B(X,Y)=Y1?T(X-1,Y):X*T(0,Y); +E(X,Y)=X1?B(X-1,Y):X*B(0,Y); +G(X,Y)=X,-1] +av={ia#0} sub.. $av # bias to improve precision +f.. " +begin( +const boundary=1; +ref(crop(#0),img); # 64bit buffer +const W=w-1; const H=h-1; +px(x,y) = (img[x + y*w#0 + c*wh#0]); +qx(x,y) = ( +xA=floor(x); +xB=ceil(x); +yA=floor(y); +yB=ceil(y); +lx=x-xA; +lerp( +lerp(px(xA,yA),px(xB,yA),lx), +lerp(px(xA,yB),px(xB,yB),lx), +y-yA +) +); +T(X,Y)=Y>1?qx(X,Y-1):Y*qx(X,0); +B(X,Y)=Y1?T(X-1,Y):X*T(0,Y); +E(X,Y)=X1?B(X-1,Y):X*B(0,Y); +G(X,Y)=X=1 +#@cli : Compute the 2D cumulative inverse function of specified image data. +#@cli : $ sample cumulate xy gcd_decumulate 1 +gcd_decumulate : check "${1=1}>=1" +f "begin( +const boundary=1; +const interpolation=1; +const W=w-1; const H=h-1; +T(X,Y)=Y>1?i(X,Y-1):Y*i(X,0); +B(X,Y)=Y1?T(X-1,Y):X*T(0,Y); +E(X,Y)=X1?B(X-1,Y):X*B(0,Y); +G(X,Y)=X] +i $msk mul.. . +distance. 1 mul. 2 +gcd_boxfilter_local_hp[0,1] . rm. ++eq. 0 add[-2,-1] div +done done +#@cli gcd_inpaint_pyramid : [mask] +#@cli : Inpaint selected images by specified mask. +#@cli : $ image.jpg 100%,100% circle. 50%,50%,50,1,1 gcd_inpaint_pyramid.. . +gcd_inpaint_pyramid : check ${"is_image_arg $1"} +pass$1 0 ge. 1 store. msk +repeat $! l[$>] +L,D,X,Y,W,H={L=ceil(log(max(w,h))/log(2));D=2^L;X=ceil((D-w)/2);Y=ceil((D-h)/2);[L,2^L,X,Y,w,h]} +i $msk z {[-$X,-$Y,$D-$X-1,$D-$Y-1]},1 +eq. 0 mul.. . +repeat $L ++r[-2,-1] 50%,50%,100%,100%,2 ++eq. 0 add. .. div[-3,-1] gt. 0 +done +i[0] (0.0625,0.125,0.0625;0.125,0.25,0.125;0.0625,0.125,0.0625) +repeat $L +l[0,-4--1] rm. +r. [1],[1],[1],[1],1 convolve. [0] +eq[2] 0 j[1] .,0,0,0,0,1,[2] rm. +done +done +rm[0,-1] z {[$X,$Y,$X+$W-1,$Y+$H-1]},1 +done done +#@cli gcd_inpaint_flat : [mask] +#@cli : Inpaint selected images by specified mask using flat fill. +#@cli : $ image.jpg 100%,100% circle. 50%,50%,50,1,1 gcd_inpaint_flat.. . +gcd_inpaint_flat : check ${"is_image_arg $1"} +img=$! pass$1 0 lt. 1 mul[^-1] . => mask ++boxfilter[mask] 3 eq[mask] 0 => xmask ++gt[xmask] 0 => bound ++eq[xmask] 0 add[xmask] . +j. [mask] label. 0 add. 1 mul. [mask] => segs +repeat $img { +l[$>,mask,xmask,bound,segs] { +[0],[0],[0],{s#0+1} +j. [bound] j. [0],0,0,0,1 => inp +sh[inp] 1,100% boxfilter. 3 div. [xmask] rm. +{segs,iM+1},1,1,[inp] => hist +eval[segs] "I[#6,i]+=I#5" +sh[hist] 1,100% sh[hist] 0 ++eq. 0 add[-2,-1] div[-2,-1] +rm. channels. 1,100% +channels[inp] 0 j[inp] [segs] map[inp] [hist] +j[0] [inp],0,0,0,0,1,[mask] rm[inp,hist] +} +} +rm[mask,xmask,bound,segs] +#@cli gcd_dither_srgb : _nb_levels>=2 +#@cli : Dither selected sRGB images. +#@cli : Default values: 'nb_levels=2'. +#@cli : $ image.jpg gcd_dither_srgb 6 round +gcd_dither_srgb : check "isint(${1=2}) && $1>=2" +repeat $! l[$>] +s c (0,255) r. $1,1,1,1,3 +srgb2rgb index[^-1] .,1,1 rm. a c rgb2srgb +done done +#@cli gcd_shuffle +#@cli : Shuffle vectors of selected images with Fisher-Yates algorithm. +#@cli : $ uniform_distribution 8,3 gcd_shuffle +gcd_shuffle : f "=2 +#@cli : Return all primes not greater than the specified limit as a 1xN image. +#@cli : Default values: 'limit=97'. +#@cli : $ gcd_primes 1000 +gcd_primes : check "isint(${1=97}) && $1>1" +e[^-1] "Compute prime numbers not greater than $1." +1,{$1+1},1,1,y +eval "i[1]=0;for(N=2,N<=sqrt($1),++N,i[N]?for(P=N*N,P<=$1,P+=N,i[P]=0))" +discard. 0 +#@cli gcd_mean_transfer_curve : +#@cli : Calculate mean transfer curve between selected pair of images. +#@cli : Image values will be indexes to an output map per channel. +#@cli : Each map contains original and mapped values. +#@cli : $ image.jpg +negate noise. 50% gcd_mean_transfer_curve dg[^0] +gcd_mean_transfer_curve : +e[0] "Index and calculate mean transfer curve for image$?." +if $!!=2 error "Two images are required for $0" fi +l[-2,-1] +s0={s#0} r. 100%,100%,100%,$s0 s c +repeat $s0 l[{[$<,$<+$s0]}] +dims={0,[w,h,d]} +$dims,3,[x,y,z] r. 1,{0,whd},1,3,-1 +y[0,1] a c sort +,y $dims,1 1,1,1,2 +eval " +col=I[#0,0]; +V=col[0]; S=col[1]; N=1; +i(#-2,col[2,3])=0; +for(P=1;Q=0,P=1,_[mask],_boundary_conditions +#@cli : Solve for 2D [kernel] in 'convolve[selection] [kernel] = [target]'. +#@cli : 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default values: 'size=1' and 'boundary_conditions=1'. +#@cli : $ image.jpg +laplacian +gcd_solve_kernel.. . +gcd_solve_kernel : skip ${3=1},${4=1} check ${"is_image_arg $1"}" && isint(${2=1})" +e[^-1] "Solve kernel for image$? with convolution target $1 +and "${"arg 1+$4,dirichlet,neumann,periodic,mirror"}" boundary conditions." +pass$1 K:=$2*2+1 => target +if ${"is_image_arg $3"} +pass$3 0 => mask +repeat $!-2 { +l[$>,target,mask] { +nm={0,n}"_kernel" 0 => patches 0 => points +eval[mask] "begin(const boundary=$4;const K=$K); +if(i>=1, +da_push(#-2,crop(#0,x-$2,y-$2,z,c,K,K,1,1)); +da_push(#-1,i(#1,x,y)); +); +end(set('H',da_size()-1));" +if h==0 error[0] "Command 'gcd_solve_kernel': mask image is empty." fi +permute[patches] cyxz +z[patches,points] 0,0,100%,$H +invert[patches] 1,1e-6 =>[patches] inv mmul[inv,points] +mirror[inv] y r[inv] $K,$K,1,1,-1 rm[0] mv[inv] 0 +=>[inv] $nm +} +} rm[mask] +else +repeat $!-1 { +l[$>,target] { +nm={0,n}"_kernel" 0 => patches 0 => points +eval[0] "begin(const boundary=$4;const K=$K); +da_push(#-2,crop(#0,x-$2,y-$2,z,c,K,K,1,1)); +da_push(#-1,i(#1,x,y)); +end(set('H',da_size()-1));" +permute[patches] cyxz +z[patches,points] 0,0,100%,$H +invert[patches] 1,1e-6 =>[patches] inv mmul[inv,points] +mirror[inv] y r[inv] $K,$K,1,1,-1 rm[0] mv[inv] 0 +=>[inv] $nm +} +} +fi +rm[target] +#@cli gcd_solve_nonnegative : [image] +#@cli : Non-negative least squares using FNNLS algorithm. +#@cli : Solve Ax = b : xi>0 for selected A matrix and specified b vector. +#@cli : $ (7,0,5;5,7,7;9,3,10) (1;5;2) +gcd_solve_nonnegative.. . +gcd_solve_nonnegative : check ${"is_image_arg $1"} +e[^-1] "Solve non-negative least squares for image$?." +pass$1 0 => B +repeat $!-1 { l[$>,-1] { +M,N:=[h#0,w#0] act=$N best:=inf +1,$N,1,1 => X . => S . => W +f. y => ind ++transpose[0] . mmul.. [0] mmul. [B] =>.. AtA => AtB +for $act>0 { +j[W] [AtB] +mmul[AtA] [X] sub[W,-1] +1,$act,1,1,"i[#$W,i[#$ind,y]]" => Wact +new:=iM +if $new<1e-6" || "$new>=$best rm[Wact] break fi +best=$new +eval " +a_index = yM; +w_index = i[#$ind,a_index]; +copy(i[#$ind,a_index],i[#$ind,a_index+1],$N-1-a_index); +i[#$ind,$N-1] = w_index;" +rm[Wact] act:=$act-1 +for 1 { +part:=$N-$act +sh[ind] $act,100%,0,0 => psv +$part,$part,1,1,"i(#$AtA,i[#$psv,x],i[#$psv,y])" => Apsv +1,$part,1,1,"i[#$AtB,i[#$psv,y]]" => Bpsv ++solve[Bpsv] [Apsv] => Spsv +eval[S] "i[i[#$ind,y]]=y<$act?0:i[#$Spsv,y-$act]" +rm[Apsv,Bpsv] +if im>0 rm[psv,Spsv] break fi +1,$part,1,1,"i[#$X,i[#$psv,y]]" => Xpsv +1,$part,1,1,"XP=i[#$Xpsv,y];XP==0?0:XP/(XP-i[#$Spsv,y])" => ratio +eval[Spsv] " +begin(MR=inf;MP=-1); +CR=i[#$ratio,y]; +if(i<=0&&CR0?$2:{*,u}-1,$3>0?$3:{*,v}]} +cursor[0] 0 font={max(13,sqrt($w*$h)/48)} +info,hq,fs,cmdon,refresh,pid,wide,start={[1,0,1,0,1,0,0,0.5]} +path_current path=${} +gcd_parentdir {``$path} files2img 1,${} => dirs +gcd_currentdir {``$path} gcd_argnum[dirs] ${} +dlim,dpos={dirs,[h,${}]} 0 => imgfiles 0 => vwimg +$w,$h,1,3 => screen +1 store. cid +1 store. pid +do +if $refresh +rm[imgfiles] +gcd_filelist {``$path},$filespec +=> imgfiles lim,pos={imgfiles,[h,1]} +refresh={!$refresh} +fi +if $lim>0 +rm[vwimg] gcd_imgarg[imgfiles] $pos i ${} +dim={`string(w,'x',h,'x',s)`} +details="dim: "$dim" "{x}": "{b} => vwimg +else +rm[vwimg] 1,1,1,3 => vwimg details="no images" +fi +if $cmdon +l[vwimg] _gcd_tmp_cmd +if 1!=$! error "Exactly one image must be returned by custom commands" fi +nm vwimg +done +fi +to_rgb[vwimg] gcd_resize_for_fs[vwimg] $w,$h,$hq,$wide +f[screen] 0 j[screen] [vwimg],0.5~,$start~ +if $info +if $hq fe="edge " else fe="" fi if $cmdon fe.="cmd " fi +0 t. $path,0,0,$font,1,255,255,255 j[screen] . +0 t. $dpos"/"$dlim,0,0,{$font*2},1,255,0,255 j[screen] .,0,{h#-2} rm[-2,-1] +0 t. $details,0,0,$font,1,255,255,255 j[screen] .,0,{{screen,h}-h} rm. +0 t. $fe$pos"/"$lim,0,0,{$font*2},1,0,255,0 j[screen] .,{{screen,w}-w} rm. +fi +w[screen] 100%,100%,0,$fs,"Image Browser" cursor[0] 0 wait +if {*,PAGEUP}" && "$pos>1 pos-=1 wait -1 fi +if {*,PAGEDOWN}" && "$pos<$lim pos+=1 wait -1 fi +if {*,HOME} pos=1 wait -1 elif {*,END} pos=$lim wait -1 fi +if {*,E} hq={!$hq} wait -1 elif {*,SPACE} cmdon={!$cmdon} wait -1 fi +if {*,F} fs={!$fs} if $fs w[] 100%,100%,0,1 fi wait -1 fi +if {*,I} info={!$info} wait -1 fi +if {*,W} wide={!$wide} wait -1 fi +if {*,Z} start={min($start+0.25,1)} wait -1 fi +if {*,A} start={max($start-0.25,0)} wait -1 fi +if {*,ARROWLEFT} +i $cid eval "da_push("$dpos")" store. cid +i $pid eval "S=da_size();V=i[S-1]; S>0?da_remove(); V" nxt=${} store. pid +gcd_parentdir {``$path} path=${} +rm[dirs] gcd_parentdir {``$path} files2img 1,${} => dirs +if $nxt==0 gcd_currentdir {``$path} gcd_argnum[dirs] ${} nxt=${} fi +dlim,dpos={dirs,[h,max($nxt,1)]} +refresh=1 wait -1 +fi +if {*,ARROWRIGHT}" && "$dlim>0 +files2img 1,{``$path} => subdirs +if h>0 +i $pid eval "da_push("$dpos")" store. pid +i $cid eval "S=da_size();V=i[S-1]; S>0?da_remove(); V" nxt=${} store. cid +rm[dirs] =>[subdirs] dirs +dlim,dpos={dirs,[h,max($nxt,1)]} +gcd_imgarg[dirs] $dpos path.=${}"/" +refresh=1 wait -1 +else rm[subdirs] fi +fi +if {*,ARROWUP}" && "$dpos>1 +1 store. cid +dpos-=1 gcd_parentdir {``$path} path=${} +gcd_imgarg[dirs] $dpos path.=${}"/" +refresh=1 wait -1 +fi +if {*,ARROWDOWN}" && "$dpos<$dlim +1 store. cid +dpos+=1 gcd_parentdir {``$path} path=${} +gcd_imgarg[dirs] $dpos path.=${}"/" +refresh=1 wait -1 +fi +while {*}" && "!{*,Q}" && "!{*,ESC} +um _gcd_tmp_cmd cursor[0] 1 w 0 +e $path e $details rm[dirs,imgfiles,vwimg,screen] +#@cli gcd_imgarg : n>=1 +#@cli : Return the n-th argument of the specified string list image. +gcd_imgarg : skip ${1=1} u {``{`I[$1-1]`}} +#@cli gcd_argnum : "search_str" +#@cli : Return the index of the first matching argument in the specified string list image. +gcd_argnum : +num,sz={[0,s]} ++l. +s y ({'"$1"'}:y) r. 1,$sz,1,1,0 neq[^-1] . rm. discard 0 +repeat $! if {$>,whds}==0 num={$>+1} break fi done rm +done u $num +#@cli gcd_parentdir : "path" +#@cli : Return the parent directory path of the specified directory path. +gcd_parentdir : +if size(['"$1"'])<3 u "$1" return fi +('"$1"') replace_str. "\\","/" +l. +if i[#-1,h-1]!='/' ('/') a[-2,-1] y fi +s +,y,47 rm[-2,-1] a y +done u {t} rm. +#@cli gcd_currentdir : "path" +#@cli : Return the last directory name of the specified directory path. +gcd_currentdir : +if size(['"$1"'])<2 u "/" return fi +('"$1"') replace_str. "\\","/" +l. s -,y,47 k. done u {t} rm. +#@cli gcd_filelist : "path",_arg1,...,_argN +#@cli : Return the list of files within the specified directory path. +gcd_filelist : +path="$1" globs=${2--1} num={$#-1} +repeat $num +arg {$>+1},$globs glob=${} +files2img 3,{``$path}$glob +done a[-$num--1] y +#@cli gcd_resize_for_fs : width,_height,_is_filtered_edge +#@cli : Resize image for fullscreen display. +gcd_resize_for_fs : skip ${1=1920},${2=1080},${3=0},${4=0} +repeat $! l[$>] +w,h={[w,h]} mx={[im,iM]} +if $4 +if $w>=$1" || "$3==0 r2dx $1,3 else gcd_upscale_edge {$1/$w},1 fi +else +if $h>=$2" || "$3==0 r2dy $2,3 else gcd_upscale_edge {$2/$h},1 fi +fi +gcd_noalpha c $mx +done done +gcd_auto_balance : skip ${1=30},${2=0},${3=0},${4=1},${5=0} +mode=${arg\ 1+$3,hsi_i,hsv_v,lab_l,lrgb,rgb,ycbcr_y} +if $2>0 bilateral 1%,$2 c 0,255 fi +if $4!=0 ac "gcd_rgb_balance",rgb fi +if $5 ac "gcd_tonemap_inplace $1",$mode,2 +else ac "gcd_tonemap $1",$mode,2 fi +gcd_tonemap : skip ${1=100},${2=255} +repeat $! l[$>] +/ $2 +boxfilter $1% ++-. 0.5 sign. *. -1 ++*.. -2 +. 1 /[1] . ++eq. 0 +[-2,-1] /[0,-1] ++sqr.. +[0,-1] max[0] 0 +sqrt[0] *[0,-1] - * $2 +done done +gcd_tonemap_inplace : skip ${1=100},${2=255} +repeat $! l[$>] +/ $2 +boxfilter $1% +f[0] "*A=i(#-1,x,y,z,c);B=1-2*A;Bx=A/B;-sign(A-0.5)*sqrt(i/B+Bx^2)-Bx;" +rm. * $2 +done done +gcd_rgb_balance : +repeat $! l[$>] +m={iM} s c n 0,$m a c [0] +r. 1,1,1,100%,2 +repeat s#1 sh[1] $> -. {2,i[$>]+$m/2} rm. done +rm. n. 0,$m +/[0] $m +^. 3 compose_channels. + /. -3 +. 1 +compose_channels.. max *[-2,-1] j[0] ..,0,0,0,0,1,. k[0] +done done +gcd_blend_feather : skip ${1=100},${2=0.5},${3=2},${4=0},${5=0} +r[^-1] .,.,1,100%,0,0,0.5,0.5 +if $5 ++gcd_blend_maxdelta ${1-4} +to_a[0] split_opacity[0] rv[1,-1] a[1,-1] c rm[0] +else gcd_blend_maxdelta ${1-4} fi +gcd_blend_maxdelta : skip ${1=100},${2=0.5},${3=2},${4=0} +if $!>1 repeat $!-1 l[0,1] +to_a split_opacity /[1,3] 255 +=>[0] upper =>[1] alpha =>[2] lower =>[3] mask ++r[lower] 1,1,1,100%,2 +++[upper] 0.1 *. [alpha] +s. c discard[-3--1] 0 a[-3--1] c +r. 1,1,1,100%,2 r[-2,-1] [upper] +*[-2,-1] $2 -[upper,-1] +[upper,-1] c[upper] 0,255 ++distance[alpha] 0 => dist +eq[mask] 0 *[mask] {dist,iM} max[dist] [mask] +if $4>0 +[upper] [alpha] a[-2,-1] c +gcd_fgmask. {20-$4} b. 3 *[alpha,-1] +fi ++n[dist] 0,$3 c. 0,1 *. [alpha] +gcd_srgb2jpeg[upper,lower] sh[upper,lower] 1,2 +j. ..,0,0,0,0,1,... rm[-3--1] +gcd_jpeg2srgb[upper,lower] +n[dist] 0,{255*$1%} ++-[upper] [lower] *. [alpha] ++sign. abs.. min[dist,-2] *[dist,-1] ++[lower] [dist] k[lower] c 0,255 +done done fi +gcd_fgmask : skip ${1=0} +repeat $! l[$>] +to_a expand_xy 20,0 split_opacity gt. 0 ++distance. 0 max_patch. 3 *. 2 ++erode[1] 20 *[-2,-1] dilate. $1 ++gradient_norm.. gt. 0 +gradient_norm[0] +eq. 0 *[0,-1] +max[-2,-1] *[0,1] *[0] -1 +watershed. .. rm.. +shrink_xy 20 - 1 +done done +fx_gcd_blend_multiscale : skip ${1=5} +if 2!=$! error "This filter requires two input layers to function" fi +l[-2,-1] { name={0,n} +to_a[0] remove_opacity[1] +split_opacity[0] n[1] 0,1 mv[1] 0 ++oneminus[0] gcd_inpaint_pyramid[1] . rm. +K=3 A=1 B=2 +repeat $1 { +K:=2^($>+2)+1 +boxfilter[0] $K n[0] 0,1 ++boxfilter[$A,$B] $K +sub[$A] .. sub[$B] . +mul[$A] [0] negate[0] mul[$B] [0] negate[0] +if ($>)>0 add[1,3] add[2,3] else A+=2 B+=2 fi +} +mul[$A] [0] negate[0] mul[$B] [0] +add[1,3] add[2,3] add[1,2] k. nm $name +} +fx_gcd_canny : +foreach { +split_opacity +gcd_canny[0] $1,{[max($2,1e-6),max($3,1e-6)]} +*[0] 255 a c +} +#@cli gcd_canny : sigma,_low_threshold,_high_threshold +#@cli : Locate image edges using canny edge detector. +#@cli : Default values: 'sigma=1', '_low_threshold=0.05' and 'high_threshold=0.15'. +#@cli : $ image.jpg gcd_canny 1.5 +gcd_canny : skip ${1=1},${2=0.05},${3=0.15} +e[^-1] "Apply canny edge detection for image$?, with sigma $1." +foreach { +low,high:=[$2*$3,$3] +b $1 +(1,2,1;0,0,0;-1,-2,-1) ++convolve[0] . transpose.. convolve[0] .. rm.. ++atan2.. . sqr[0,1] +[0,1] sqrt.. +mul. {4/pi} round. 1 mod. 4 +f.. " +A=i#1; +Y=A<1?max(j(0,-1),j(0,1)):A<2?max(j(-1,-1),j(1,1)):A<3?max(j(-1),j(1)):max(j(-1,1),j(1,-1)); +i>=Y?i:0 +" rm. +div {iM} +ge $high ge.. $low +f. ">max(crop(x-1,y-1,z,c,3,3,1,1))&&i#0?1:i" +f. "] +remove_opacity. ++to_gray[0] edges. 14.5% n. {100-$4}%,100% +if {0,s>1" && "$5} ++ac[0] "median 5",ycbcr_cbcr +image[0] .,0,0,0,0,1,.. rm. +fi +if $1==0 {w},{h},1,1,255 *[-2,-1] else +{w},{h},1,1,0 +grid. $gsz,$gsz,0,0,1,255 +if $2>=2 grid. $gsz,$gsz,1,1,1,255 fi +if $2==3 grid. $gsz,$gsz,-1,-1,1,255 fi +b. $3,0 *[-2,-1] +fi +i.. [0] append[-2,-1] c +smooth[1] {100*$6+100},0.6,0.3 +blend[0,1] alpha +if !$6 sharpen. 20 fi +done done +gcd_comp_blur_preview : +gui_split_preview "gcd_comp_blur ${1--2}",$-1 +fx_gcd_crmt_tile : +to_a +m "_crmt_tile_C : [$""1]" +m "_crmt_tile_R : rotate. $""1 autocrop." +m "_crmt_tile_Fo : mirror. x" +m "_crmt_tile_Fi : mirror. y" +macros="sind(A)=sin(A/180*pi);cosd(A)=cos(A/180*pi);tand(A)=tan(A/180*pi);" +('"_crmt_tiling_command : $1 {``$2},1,4 => _crmt_render $3"') +replace_str. "C","_crmt_tile_C " +replace_str. "Fo","_crmt_tile_Fo " +replace_str. "Fi","_crmt_tile_Fi " +replace_str. "R","_crmt_tile_R " +replace_str. "T","_crmt_tile_T " +replace_str. "[","{"$macros"[" +replace_str. "]","]}" +m {t} +rm. +_crmt_tiling_command k[_crmt_render] +if $4 ++channels[0] 100% negate. dilate. 3 +inpaint[0] .,0,0 rm. +fi +uncommand _crmt_tiling_command +_crmt_tile_T : skip ${1=0},${2=0} +f. ":i3>0?I(#"{``${_crmt_render}}",$1+x,$2+y)=I;i" rm. +fx_gcd_cumul_math : skip ${1=0},${2=1},${3=1},${4=0} +op=${arg\ 1+$1,"add","or","xor","and","mod"} +ac "gcd_cumul_math $2,$3,"$op",$4",rgb replace_nan 255 +gcd_cumul_math : skip ${1=1},${2=1},${3="add"},${4=0} +repeat $! l[$>] +100%,100%,100%,1,1 (0,$2) if $4 z. 1,1 fi ++*. $1 shift[1] {^} rm. m={^} rm. [0] +repeat $1 +shift. $m +*. [1] $3[0,-1] rm.. done k[0] mod 256 +done done +fx_gcd_cumul_math_preview : +gui_split_preview "fx_gcd_cumul_math ${1--2}",$-1 +fx_gcd_blur_deblur_texture : skip ${1=4},${2=1},${3=0.5},${4=0},${5=2},${6=0} +repeat $! l[$>] +mode=${arg\ 1+$5,rgb,lrgb,ycbcr_y,ycbcr_cbcr} +if $6 r=$2% else r=$2 fi +if $4 ac "repeat $1 gcd_blur_texture "$r",$3 done",$mode,1 +else ac "repeat $1 +l +gcd_blur_texture "$r",$3 norm - done + done",$mode,1 fi +done done +fx_gcd_blur_deblur_texture_preview : +gui_split_preview "fx_gcd_blur_deblur_texture $*",${-3--1} +#@cli gcd_blur_texture : std_deviation>=0[%],0<=edge_exponent<=1 +#@cli : Edge preserving smooth. +#@cli : Default values: 'std_deviation=1' and 'edge_exponent=1'. +#@cli : $ image.jpg gcd_blur_texture 1 +gcd_blur_texture : skip ${1=1},${2=1} +e[^-1] "Apply blur texture filter of size $1, on image$?." +repeat $! l[$>] +[0] +sqr. b[-2,-1] $1 +sqr.. -[-2,-1] +max. 0 +eq. 0 +[-2,-1] sqrt. ^. -$2 +j[0] ..,0,0,0,0,1,. k[0] +done done +gcd_depth_blur : skip ${1=0},${2=15},${3=0.25},${4=2},${5=4},${6=0},${7=1} +repeat $! l[$>] +sa={$2*max(w,h)/1000} +to_rgb[0] ++gcd_depth[0] $3,$4,$5 +if $7 negate. fi +threshold. $1%,1 n. 0,255 +if $6 k. else +{w},{h},1,1,0 .. a[-3--1] c +smooth.. .,$sa,30,0 rm. +c. 0,255 +fi +done done +fx_gcd_dither_srgb : skip ${1=2},${2=1} +repeat $! l[$>] +split_opacity +if $2 gcd_srgb2luma[0] fi +gcd_dither_srgb[0] $1 round[0] a c +done done +gcd_emboss : skip ${1=128} +repeat $! l[$>] ++norm +bilateral[0] 2%,30 norm. -[-2,-1] ++n[0] 0,255 median. 3 bilateral. 2%,30 +gcd_srgb2luma. -. $1 ++abs. negate. ++max.. 0 min... 0 abs... +pde_flow[1] 20,7,iee ++n... 0,2 *. [1] +[0,-1] ++n. 0,2 *. [1] +[0,-1] ++n.. 0,2 *. [1] +[0,-1] ++[0,2] -[0,3] k[0] +gcd_srgb2luminance c 0,255 +done done +gcd_emboss_preview : +gui_split_preview "gcd_emboss ${1--2}",$-1 +gcd_geometric_balance : skip ${1=0} +repeat $! l[$>] +split_opacity +l[0] to_rgb +s c n 0,255 a c +srgb2rgb rgb2xyz +m={[im,iM]} n 0.002,0.998 log +r 1,1,1,100%,2 +gm={$1>0?log(min(max($1,0.002),0.998)):i[#1,1]} +repeat s#1 sh[0] $> *. {$gm/i[#1,$>]} rm. done rm. exp n $m +xyz2rgb rgb2srgb +s c n 0,255 a c +done a c +done done +fx_gcd_gradient_exponent : skip ${1=0.5},${2=0} +mode=${arg\ 1+$2,rgb,hsi_i,hsv_v,ycbcr_y,lab_l} +foreach { ac "gcd_gradient_exponent $1",$mode } +#@cli gcd_gradient_exponent : exponent +#@cli : Adjust gradient ratios via laplacian inversion. +#@cli : Default values: 'exponent=0.5'. +#@cli : $ image.jpg gcd_gradient_exponent 0.5 +gcd_gradient_exponent : skip ${1=0.5} +e[^-1] "Adjust gradient ratios for image$?, with exponent $1." +foreach { +repeat s { sh $> l. { +m={[im,iM]} g xy,1,2 +foreach { +abs ^. $1 sign.. * } +g.. x,-1,2 g. y,-1,2 + ilaplacian 0 n $m +} rm. } +} +gcd_infomap : +repeat $! l[$>] to_rgb +if $1>3 gcd_std_score_patch 3 n 0,255 +elif $1>2 ++dilate 3 +erode.. 3 eq[-2,-1] compose_channels. min +orientation.. * n 0,255 +elif $1>1 gcd_srgb2jpeg channels 1,2 equalize 256 gcd_detail +elif $1 gcd_detail else gcd_spectral fi +done done +gcd_detail : +repeat $! l[$>] +bilateral 2%,30 norm - n 0,255 done done +gcd_spectral : +repeat $! l[$>] +to_rgb gcd_srgb2luma - 128 ++max 0 +min[0] 0 abs[^-2] negate[0] a c n 0,255 +done done +gcd_std_score_patch : skip ${1=3} +repeat $! l[$>] ++gcd_variance_patch $1 sqrt. ++boxfilter.. $1 -[0,-1] +eq. 0 +[-2,-1] / +done done +gcd_variance_patch : skip ${1=3} +repeat $! l[$>] +sqr boxfilter $1 sqr.. rv - max 0 done done +fx_gcd_clone_inpaint : skip ${1=0},${2=1},${3=10},${4=1} +foreach { +S:=max(3,round(0.25*max(w,h)*$3%)) +if $1 transpose fi +to_rgba sh 100% eq. 100% mul +_gcd_clone_patch_sources $S,{arg0($2,1,0.5,0)} ++_gcd_clone_draw_inpaint_patches.. .,$S +split_opacity[0] +if $4 +neq[1] 0 rv[1,-1] _gcd_clone_inner_blend[0,1,-1] k[0] c 0,255 +else +eq[1] 0 j[0] .,0,0,0,0,1,[1] k[0] +fi +if $1 transpose fi +} +_gcd_clone_patch_sources : skip ${1=20},${2=0.5},${3=2} +sh 100% => alpha +4,1,1,1 1,[0],1,1 1,[0],1,1 +eval[alpha] " +begin(xmin=w#0; xmax=-1; ymin=h#0; ymax=-1); +if(x==0, L=w#0; R=-1); +if(i==0, +xxmax?xmax=R; +); +i[#-2,y]=L; i[#-1,y]=R; +end(i[#-3,0]=xmin;i[#-3,1]=xmax;i[#-3,2]=ymin;i[#-3,3]=ymax;) +" +rm[alpha] +K:=$1*2+1 erode.. $K dilate. $K -.. 1 +. 1 +ymin,ymax:=[i[#-3,2],i[#-3,3]] +xtopL,xtopR:=[i[#-2,$ymin],i[#-1,$ymin]] +xbotL,xbotR:=[i[#-2,$ymax],i[#-1,$ymax]] +f.. "y<$ymin?$xtopL:y>$ymax?$xbotL:i" +f. "y<$ymin?$xtopR:y>$ymax?$xbotR:i" +rm[-3] D:=round($1/$3)*2 +{ceil([w#0/$D,h#0/$D,d#0])},1," +begin( +const S=$1; const K=$1*2+1; +const EL=K-1; const ER=w#0-2-K; +const D=$D; +); +X=x*D; Y=y*D; +L=i[#1,Y]; +R=i[#2,Y]; +LX=X-L; RX=R-X; +L>EL&&(LX/(LX+RX)<$2||R>ER)?-LX-S:RX+S; +" +rm[1,2] +_gcd_clone_draw_inpaint_patches : skip ${2=8},${3=2} +pass$1 0 => points +repeat $!-1 l[$>,-1] { +split_opacity[0] +P:=$2 Q:=round($2/$3) J:=$P*2+1 K:=$Q*2+1 C:=$P-$Q +$J,$J,1,1 $K,$K,1,1,1 j.. .,$C,$C rm. +distance. 1 n. 0,1 *. -1 +. 1 f. "i*i*i*(i*(i*6-15)+10)" +[0] f[0] 0 +eval[points] " +begin(const S=$2; const K=S*2+1; const D=$Q*2; ref(crop(#-2),M)); +X=x*D; Y=y*D; +U=i-S+X; V=Y-S; +ref(crop(#-1,U,V,K,K),patch); +ref(crop(#1,U,V,K,K),W); +draw(#0,patch,X-S,Y-S,0,0,K,K,1,s#0,1,M*W); +" +rm[1,-2,-1] +} done rm. +_gcd_clone_inner_blend : +dim:=max(w,h) +[0],[0],[0],[0] +[1],[1],[1],[1] +[2],[2],[2],[2] +repeat 12 { +K:=round($dim/2^$>) +if $K<=1 break fi +j[-3] [0] j[-2] [1] j[-1] [2] +l[-3] { +neq 0 boxfilter $K +eq. 0 +[-2,-1] /[0,-1] } +l[-2] { +neq 0 boxfilter $K +eq. 0 +[-2,-1] /[0,-1] } +dilate. $K neq. [2] *.. -1 +.. [1] +.. ... +j[0] ..,0,0,0,0,1,. +} +gcd_ebwarp : skip ${1=0.5},${2=1} +repeat $! l[$>] +b={w*$1*$2} c={w*$2} d={2*$c-4*$b} +e={(4*$b-$c)/(2*$d)} se={sqr($e)} +{w},{h},1,1,x +if $1==0.5 *. {1/$c} else +/. $d +. $se +if $1>1 abs. fi +sqrt. +if $1>0.5 *. -1 fi +-. $e +fi +*. {w} {w},{h},1,1,y a[^0] c +warp[0] .,0,2,0 rm. c 0,255 +done done +gcd_jpeg_smooth : skip ${1=1},${2=1},${3=0} +repeat $! l[$>] +if $1 gcd_comp_blur. 2,3,1,100,1 fi +if $3 r. 140%,140%,1,3,5 c. 0,255 fi +if $2 gcd_anti_alias. 10,0.3,10 fi +done done +gcd_jpeg_smooth_preview : +gui_split_preview "gcd_jpeg_smooth ${1--2}",$-1 +gcd_layers : skip ${1=100},${2=0},${3=1},${4=50},${5=50},${6=0},${7=0},${8=0},${9=1},${10=1},${11=0},${12=0},${13=0} +one={$!<2} +l[${arg\ 1+$one,0-1,0}] +if $3" && "!$one" && "$1>100 r2dx. {w/$1%},{if($-1,2,6)} c. 0,255 fi +w={w} h={h} gcd_force_a[0] +l[0] +if $11 mirror ${arg\ $11,x,y,xy} fi +if !$3" || "$one" || "$1<100 r2dx {w*$1%},{if($-1,2,6)} c 0,255 fi +if $2 split_opacity rotate. $2,{2-($-1)} rotate.. $2,{2-($-1)},1 a c c 0,255 fi +if $6" || "$7 +sh 100% +gt. 1 expand_xy. 1,0 distance. 0 gt. {1+$6}% shrink_xy. 1 +*. .. if $8" && "$7 pde_flow. $7,30,iee,0 max. 0 fi min[-2,-1] rm. +fi +if !$8" && "$7 sh 100% b. {$7/10}%,1,{!$-1} rm. fi +done +pos={round(($w-w#0)/2+$w*$4%)},{round(($h-h#0)/2-$h*$5%)} # ** POSITION +if $-1" || "$12 i[0] $w,$h,1,{0,s} j[0] [1],$pos rm[1] pos=,pos(0,0) +else pos=,pos($pos) fi +mode=${arg\ 1+$10,alpha,add,burn,darken,difference,divide,dodge,grainextract,grainmerge,hardlight,hue,lighten,multiply,overlay,saturation,softlight,screen,subtract,value} +if $-1 if $!>1 rv blend $mode,$9 else sh 100% *. $9 rm. fi +else =>[0] mode($mode),opacity({$9*100})$pos fi +done +gcd_layers_preview : +gcd_layers $*,1 +gcd_balance_lms : skip ${1=1},${2=1},${3=1},${4=0},${5=0},${6=0} +repeat $! l[$>] split_opacity l[0] +if $5 s c n 0,255 a c fi srgb2rgb rgb2xyz 1 +mix_channels (0.7328,0.4296,-0.1624;-0.7036,1.6975,0.0061;0.0030,0.0136,0.9834) +if $6 +m={[im,iM]} +r 1,1,1,100%,2 +n.. 0.002,0.998 log. gm={ia} +r. 1,1,1,100%,2 +repeat s#2 sh[2] $> *. {$gm/i[#3,$>]} rm. done +rm. exp. n. $m r. 1,1,1,100%,2 /[-2,-1] +else (1^1^1) fi +($1^$2^$3) n={L=$4?[0.454369,0.473533,0.072098]:[1,1,1];dot(L,I#1)/dot(L,I#2)} +repeat s#1 sh[0] $> *. {$n*i[#2,$>]/i[#1,$>]} rm. done k[0] +mix_channels (1.096124,-0.278869,0.182745;0.454369,0.473533,0.072098;-0.009628,-0.005698,1.015326) +xyz2rgb 1 rgb2srgb +done a c done done +gcd_fx_local_fmean : skip ${1=15},${2=0},${3=0},${4=5},${5=0} +mode=${arg\ 1+$4,hsi_i,hsv_v,lab_l,lrgb,rgb,gcd_luminance,ycbcr_y} +if $5 ac "r={[im,iM]} n 0.002,0.998 gcd_fmean_local $1%,{$3-1},$2 n $r",$mode,2 +else ac "/ 255 gcd_fmean_local $1%,{$3-1},$2 * 255",$mode,1 +fi u "{$1}{$2}_"{2-($3>1" && "$5==1)}"{$3}{$4}{$5}" +#@cli gcd_fmean_local : std_deviation>=0[%],-1<=_mean_type<=2,_target>=0 +#@cli : Map local f-mean to match global or target. +#@cli : Value range is assumed to be 0 <= input <= 1. +#@cli : When target is zero, it will be set to the global f-mean. +#@cli : Default values: 'std_deviation=1', '_mean_type=0' and '_target=0'. +#@cli : $ image.jpg n 0,1 gcd_fmean_local 1% +gcd_fmean_local : check "${1=1}>=0 && isint(${2=0}) && $2>=-1 && $2<=2 && ${3=0}>=0" +e[^-1] "Map local f-mean of image$?." +func=${arg\ 2+$2,hmean,gmean,mean,qmean} +_gcd_$func m _gcd_func:$_gcd_f m _gcd_finv:$_gcd_i +repeat $! l[$>] ++neq. 0 +eq. 0 +[0] . zs={is} b. $1 *. .. *. -1 +. 1 ($3) +_gcd_func[0,-1] *[0] [1] +d={0,$3==0?is/(whds-$zs):i#-1} rm. # d = global(f(X)) ++b[0] $1 +eq. 0 +[-2,-1] /[-2,-1] +*[0] $d *[0,-1] +_gcd_finv[0] * +done done +uncommand _gcd_func,_gcd_finv +_gcd_qmean : _gcd_f="sqr" _gcd_i="sqrt" +_gcd_mean : _gcd_f="skip 0" _gcd_i="skip 0" +_gcd_gmean : _gcd_f="log" _gcd_i="exp" +_gcd_hmean : _gcd_f="^ -1 - 1" _gcd_i="+ 1 ^ -1" +_ac_gcd_luminance : +_p="to_color" +_f="srgb2rgb rgb2xyz8 sh 1 a c" +_b="s c,{1-s} sh.. 1 +eq. 0 +[-2,-1] /[-2,-1] * xyz82rgb rgb2srgb" +_s=3 +tran_multi_threshold : skip ${1=50},${2=100},${3=150},${4=200} +repeat $! l[$>] +split_opacity +rgb2ycbcr[0] channels. 0 fc[0] ${5-7} ++fc[0] ${8-10} +ge.. $1 j[0] ..,0,0,0,0,1,. rm[-2,-1] ++fc[0] ${11-13} +ge.. $2 j[0] ..,0,0,0,0,1,. rm[-2,-1] ++fc[0] ${14-16} +ge.. $3 j[0] ..,0,0,0,0,1,. rm[-2,-1] ++fc[0] ${17-19} +ge.. $4 j[0] ..,0,0,0,0,1,. rm[-2,-1] +rm. a c +done done +gcd_normalize_brightness : skip ${1=0},${2=10},${3=0},${4=3},${5=0},${6=0} +mode=${arg\ 1+$4,hsi_i,hsv_v,lab_l,ycbcr_y,rgb} +if $3>0 bilateral 1%,$3 c 0,255 fi +if $5==0 ac "gcd_tonemap_area $2,$1,$6",$mode,2 +else +ac "gcd_tonemap_area $2,$1,$6",$mode,2 blend ${arg\ $5,darken,lighten} fi +gcd_tonemap_area : skip ${1=100},${2=0},${3=0} +repeat $! l[$>] ++ 0.5 m={iM+1} / $m +if $3 a={$2/4.001+0.5} else +^. $2 a={is} rm. +^. {$2-1} a={$a/is} rm. fi +H={1/$a-1} +oneminus /. .. b. $1% ^. -1 *. $H ++oneminus. *. [0] +[-2,-1] / * $m - 0.5 +done done +gcd_pqct : +repeat $! l[$>] +({w*.1},{h*.2};{w*.2},{h*.6};{w*.2},{h*.9};{w*.5},{h*.1};{w*.6},{h*.8};{w*.9},0;{w*.85},{h*.4};{w},{h*.75}) +transpose. 9,2,1,1 +repeat 2 +sh[2] $>,$>,0,0 sh[1] $>,$>,0,0 +k={"k=(i[1]+i[3]+i[4]+i[6])/4; i(#-2,0)=k; +i(#-2,1)=(i[6]-i[1])/2; i(#-2,2)=(i[3]-i[4])/2; +i(#-2,3)=(i[6]+i[1])/2-k; i(#-2,4)=(i[3]+i[4])/2-k; +i(#-2,5)=(i[2]+i[5]-i[0]-i[7])/4; +i(#-2,6)=(i[0]+i[5]-i[2]-i[7])/4+(i[4]-i[3])/2; +i(#-2,7)=(i[5]+i[7]-i[0]-i[2])/4+(i[1]-i[6])/2; +i(#-2,8)=(i[0]+i[2]+i[5]+i[7])/4-k;0"} +rm[-2,-1] +done ++f[0] 0 r. 100%,100%,1,2,-1 sh[0] 0 +f. "begin(cx0=i(#2,0);cx1=i(#2,1);cx2=i(#2,2);cx3=i(#2,3); +cx4=i(#2,4);cx5=i(#2,5);cx6=i(#2,6);cx7=i(#2,7);cx8=i(#2,8); +cy0=i(#2,0,1);cy1=i(#2,1,1);cy2=i(#2,2,1);cy3=i(#2,3,1); +cy4=i(#2,4,1);cy5=i(#2,5,1);cy6=i(#2,6,1);cy7=i(#2,7,1);cy8=i(#2,8,1)); +s=(2*x/w-1); t=-(2*y/h-1); s2=s*s; t2=t*t; +i(#3,x,y,0,0)=cx8*s2*t2+cx7*s*t2+cx6*s2*t+cx5*s*t+cx4*t2+cx3*s2+cx2*t+cx1*s+cx0; +i(#3,x,y,0,1)=cy8*s2*t2+cy7*s*t2+cy6*s2*t+cy5*s*t+cy4*t2+cy3*s2+cy2*t+cy1*s+cy0; i" +rm[-4,-3,-1] round. [0],[0],[0],[0] sh[0] 0 px="" +repeat {0,s} px=$px;i(#2,a,b,0,$>)=i$>#0 done +f. 'a=i#1;b=i1#1$px' rm. j[0] . k[0] +done done +fx_gcd_quicktone : skip ${1=1},${2=4},${3=20},${4=0},${5=3},${6=1} +mode=${arg\ 1+$5,hsi_i,hsv_v,lab_l,ycbcr_y} +if $4>0 r={[im,iM]} bilateral 1%,$4 c $r fi +ac "+gcd_tonemap_gamma $2% +bilateral. $2%,{(iM#0-im#0)*$3/100} -[-2,-1] *. $1 +",$mode,{$6+1} +#@cli gcd_tonemap_gamma +#@cli : Map tones by local adjustment of geometric mean. +gcd_tonemap_gamma : skip ${1=100} +repeat $! l[$>] m={[im,iM]} n 0.002,0.998 log +b $1 *.. {0,is/whds} / exp n $m done done +gcd_recol : +repeat int($!/2) l[$>,{$>+1}] +rv[-2,-1] +channels.. 0 to_rgb.. +to_rgba. split_opacity. neq. 0 +srgb2rgb[-3,-2] rgb2lab8[-3,-2] channels... 0 channels.. 1,2 ++.. 1 *.. . ++meancurvature_flow... 3 median. 3 +gradient_norm. *. -1 watershed... . rm. -.. 1 +rm. a[-2,-1] c lab82rgb. rgb2srgb. +rgb2hsv. s c +equalize[2] 512 n. $1,$2 +[0,-1] %[0] 360 a c hsv2rgb. +done done +gcd_sharpen_gradient : skip ${1=0.5},${2=2},${3=0} +repeat $! l[$>] +split_opacity ++norm[0] +bilateral[0] $2%,30 norm. -[-2,-1] ++gradient_norm[0] negate. n. 0,$1 *[-2,-1] +[0,-1] +if $3 ac[0] "n 0,255",ycbcr_y else c[0] 0,255 fi +a c +done done +gcd_sharpen_gradient_preview : +gui_split_preview "gcd_sharpen_gradient ${1--2}",$-1 +gcd_sharpen_tones : skip ${1=1},${2=128},${3=0} +repeat $! l[$>] +split_opacity ++norm[0] +bilateral[0] 2%,30 norm. -[-2,-1] ++gradient_norm[0] n. 0,1 oneminus. *[-2,-1] ++n[0] 0,255 median. 3 bilateral. 2%,30 +gcd_srgb2luma. -. $2 ++max. 0 min.. 0 abs.. +n[-2,-1] 0,$1 *[-2,-1] ... rm... +[0,-2,-1] +if $3 ac[0] "n 0,255",ycbcr_y else c[0] 0,255 fi +a c +done done +gcd_sharpen_tones_preview : +gui_split_preview "gcd_sharpen_tones ${1--2}",$-1 +gcd_simple_dehaze : skip ${1=0.75},${2=1},${3=0.75} +foreach { +split_opacity +l[0] { +srgb2rgb div 255 ++gcd_erode_vw $3% compose_channels. min => msk ++mul[msk] $1 sub[0,-1] max[0] 0 mul[0] $2 +mul[msk] -$2 add[msk] 1 max[msk] 0 ++eq[msk] 0 add[msk,-1] ++compose_channels[0] max +max[msk,-1] div[0,msk] +mul 255 rgb2srgb +} +a c +} +#@cli gcd_erode_vw : size>=0[%],_tolerance>=0 +#@cli : Filter selected images by variance weighted erosion of specified size. +#@cli : Default values: 'size=3' and 'tolerance=1e-6'. +#@cli : $ image.jpg gcd_erode_vw 5 +gcd_erode_vw : skip ${1=3},${2=1e-6} +foreach { +C,R:=H=iM-im;[H/2+im,H] - $C / $R ++sqr boxfilter $1 +sqr.. -[-2,-1] +++. $2 sqrt. -[0,-1] r. 100%,100%,100%,1,2 +max. $2 ^. -1 *[0] . boxfilter $1 +eq. 0 +[-2,-1] / +c -0.5,0.5 * $R + $C +} +#@cli gcd_dilate_vw : size>=0[%],_tolerance>=0 +#@cli : Filter selected images by variance weighted dilation of specified size. +#@cli : Default values: 'size=3' and 'tolerance=1e-6'. +#@cli : $ image.jpg gcd_dilate_vw 5 +gcd_dilate_vw : skip ${1=3},${2=1e-6} +foreach { +C,R:=H=iM-im;[H/2+im,H] - $C / $R ++sqr boxfilter $1 +sqr.. -[-2,-1] +++. $2 sqrt. +[0,-1] r. 100%,100%,100%,1,2 +max. $2 ^. -1 *[0] . boxfilter $1 +eq. 0 +[-2,-1] / +c -0.5,0.5 * $R + $C +} +gcd_srotate : skip ${1=0},${2=50},${3=50},${4=1},${5=1},${6=6},${7=0.6},${8=0} +repeat $! l[$>] +rotate $1,{$4+1},1,$2%,$3% c 0,255 split_opacity +l[0] +{w},{h},1,1,1 rotate. $1,0,0,$2%,$3% +eq. 0 +area. 0 *. .. +ps={max(round(iM^0.5/6),4)} rm. +if $8 ++inpaint[0] .,$ps,{$ps*$6},$7,{9-$5*2},{$ps*1.2},0,0.08 +rv[-2,-1] a[-2,-1] c blend_seamless 0,0,25% +else +inpaint[0] .,$ps,{$ps*$6},$7,{9-$5*2},{$ps*1.2},0,0.08 rm. +fi +done a c +done done +fx_gcd_geometric_median : +ac "gcd_geometric_median $1,$2",$3 +fx_gcd_geometric_median_preview : +gui_split_preview "fx_gcd_geometric_median $*",${-3--1} +gcd_splitobj : skip ${1=50},${2=3},${3=3},${4=0},${5=0},${6=0},${7=40},${8=0},${9=0} +if $!<2 return fi +repeat int($!/2) l[$>,{$>+1}] +if w!={0,w}" || "h!={0,h} continue fi +to_rgba . s[1] c,-3 ge[2] $1% luminance[1] +meancurvature_flow[1] $2 median[1] $3 *[1,2] +channels[0] 0,1 s[0] c gt[0,1] 50% *[{$4!=0}] 2 +[0,1] +gradient_norm[1] *[1] -1 watershed[0] [1] -[0] 1 rm[1] +if $5>0 erode[0] $5 elif $5<0 dilate[0] {abs($5)} fi +if $6 b[0] $6,1,1 c[0] 0,1 fi +[1] sh. 3,3 *. [0] rm. oneminus[0] +if $8>0 +le[0] 80% +area[0] 0 *. [0] +ps={max(round(iM^0.5/6),4)} rm. n[0] 0,255 +inpaint[1] [0],$ps,{$ps*6},1,{9-$8*2},{$ps*1.2},0,0.08,10,1 +else sh[1] 3,3 *. [0] rm. fi +rm[0] gcd_fix_alpha =>[1] opacity($7) +if $9 blend alpha,{$7/100} fi +done done +gcd_splitobj_preview : +gcd_splitobj ${1--2},1 +gcd_stereo_vid : +1 l. +i "$1" st_folder={f} st_file={b} st_ext={x} ({'$st_file'}) cpx={w} +do cpx={$cpx-1} dgt={i($cpx)} isnum={($dgt>47)&&($dgt<58)} while ($isnum)&&($cpx>0) +if $cpx>0 +z. 0,$cpx fsname={t} rm. else fsname="" fi +z. {$cpx+{!$isnum}},100% dgts={w} fsnum={{t}} rm. +1 => "$2" en_file={b} ({'$en_file'}) cpx={w} +do cpx={$cpx-1} dgt={i($cpx)} isnum={($dgt>47)&&($dgt<58)} while ($isnum)&&($cpx>0) +z. {$cpx+{!$isnum}},100% fenum={{t}} rm[-2,-1] +bufsz=$11 ttlbuf={$bufsz*2} ttlimg={$fenum-$fsnum+1} +scene=1 scframe=0 ov={iv} oa={ia} +repeat $ttlimg +if $scene" && "$>==$scframe +k. scene=0 +repeat min($ttlbuf,$ttlimg-$scframe-1) +curnum={$fsnum+$scframe+$>+1} curnum=${gcd_add0\ $curnum,$dgts} +i ""${st_folder}${fsname}${curnum}.${st_ext}"" +vr={iv} av={ia} pvr={abs($vr-$ov)/$vr} pav={abs($av-$oa)/$av} +ov=$vr oa=$av +if $12&&($pvr>0.1" || "$pav>0.1) scene=1 scframe={$scframe+$>+1} break +fi +done ++l[0--{1+$scene}] ap "gcd_depth $7,$8,$9,$10" ++[0--1] a[0--2] z done +mv. 0 mv. 1 a[2--{1+$scene}] z +fi ++slices[2] 0 +/[0] {1,d} gcd_stereo[-2,-1] $4,$5,$6% +curnum={$fsnum+$>} curnum=${gcd_add0\ $curnum,$dgts} +if ${-is_windows} o. "$3"""{`92`}${fsname}${curnum}.${st_ext}"" +else o. "$3"""{`47`}${fsname}${curnum}.${st_ext}"" fi +progress {($>+1)/$ttlimg*100} +rm. slices[2] 1,100% +if !$scene" && "($>>=($scframe+$bufsz))" && "($><($ttlimg-$bufsz-1)) +curnum={$fsnum+$>+$bufsz+1} curnum=${gcd_add0\ $curnum,$dgts} +i ""${st_folder}${fsname}${curnum}.${st_ext}"" +vr={iv} av={ia} pvr={abs($vr-$ov)/$vr} pav={abs($av-$oa)/$av} +ov=$vr oa=$av +if $12&&($pvr>0.1" || "$pav>0.1) scene=1 scframe={$>+$bufsz+1} +else ++gcd_depth. $7,$8,$9,$10 +[0] . a[1,-1] z a[2,-1] z ++slices[1] 0 -[0,-1] slices[1] 1,100% +fi +fi +done +rm +done +gcd_stereo_vid_preview : skip "${1=}","${2=}" +l i "$1" onfail 100,100,1,3,0 t. "Select\nStart\nImage ",0,0,32,1,255 done +l i "$2" onfail 100,100,1,3,0 t. "Select\nEnd\nImage ",0,0,32,1,255 done +k[-2,-1] a[0,1] x to_rgb[0] +gcd_depth. $7,$8,$9,$10 gcd_stereo $4,$5,$6% +gcd_add0 : +({'"$1"'}) if w<$2 {$2-w},1,1,1,48 rv[-2,-1] a[-2,-1] x fi u {t} rm. +fx_gcd_color_target : +foreach { +split_opacity +src:=I(#0,$1/100*w#0,$2/100*h#0) ++gcd_srgb_curve_target[0] $3,$4,$5,$src +if $6 ++_gcd_chromacity_distance[0] $src *. -1 +. 1 +if $6>1 pow. 3 fi +j[0] ..,0,0,0,0,1,. rm[-2,-1] +else j[0] . rm. fi +a c +} +_gcd_chromacity_distance : +if ${"is_image_arg $1"} pass$1 1 else i 1,1,1,3,${^0} fi ++mix_channels. (0,0.5,0.5;0.5,0,0.5;0.5,0.5,0) -[-2,-1] store. cmp +foreach { ++mix_channels (0,0.5,0.5;0.5,0,0.5;0.5,0.5,0) +- i $cmp repeat {0,s} { sh[0] $> -. {-2,i[$>]} rm. } rm. +sqr r 100%,100%,100%,1,2 sqrt n 0,1 +} +#@cli gcd_srgb_curve_target : colRt,colGt,colBt,colRs,colGs,colBs +#@cli : Make source sRGB values match target using color curves. +#@cli : Default values: 'colN=128'. +#@cli : $ image.jpg gcd_srgb_curve_target 100,130,160 +gcd_srgb_curve_target : skip ${1=128},${2=128},${3=128},${4=128},${5=128},${6=128} +e[^-1] "Apply curves changing ($4,$5,$6) to ($1,$2,$3) for image$?." +foreach { +m={iM} repeat {0,s} { sh $> n. 0,$m rm. } +($4^$5^$6) ($1^$2^$3) +mix_channels (0,0.5,0.5;0.5,0,0.5;0.5,0.5,0) +srgb2rgb / $m +*[1,2] -[1,2] . rm. /[1,2] +repeat {0,s} { A:=i[$>] sh[0] $> +*. {1-$A} +. $A /[-2,-1] rm. } +k[0] * $m rgb2srgb +mix_channels (-1,1,1;1,-1,1;1,1,-1) c 0,$m +} +gcd_temp_balance : skip ${1=0},${2=0},${3=1},${4=0} +repeat $! l[$>] +split_opacity to_rgb[0] +gcd_srgb2luma[0] +if $4<2 +m={if($4,360,90)} $m,1,1,1 +r[0] 32,32,100%,100%,2 +repeat $m +gcd_hue_level. $> =... {ia},$> rm. done +rm. h={xM} rm. +else h=39 fi +if $2!=0 ++l[0] sh[0] 0 sh[0] 1 sh[0] 2 +({$h%360}^1^1) hsv2rgb. max. 0 *. $2 -. {ia} ++[-4] {@0} +... {@1} +.. {@2} rm[-4--1] max[0] 0 +done ++compose_channels[0] max n. 0,1 +j[0] ..,0,0,0,0,1,. rm[-2,-1] +fi +gcd_hue_chroma[0] $h,{($1+1)*$3},$3 +gcd_srgb2jpeg[0] j[0] . rm. +gcd_jpeg2srgb[0] round 1 a c c 0,255 +done done +gcd_hue_level : skip ${1=0} +repeat $! l[$>] +h={($1%360)/60} x={1-abs($h%2-1)} y={if($x>0,1/$x,0)} h={int($h)+1} +p={arg($h,0,1,1,2,2,0)} s={arg($h,1,0,2,1,0,2)} z={arg($h,2,2,0,0,1,1)} +sh. $p sh.. $s +*.. $x ++le. .. j... ..,0,0,0,0,1,. rm.. +eq. 0 +*.. $y j[-4] .,0,0,0,0,1,.. +rm[-4--1] sh. $z f. 0 rm. +done done +fx_gcd_color_spot_matching : skip ${1=50},${2=50},${3=50},${4=60},${5=1},${6=0},${7=0} +if 2!=$! error "This filter requires two input layers to function" fi +if $7 rv fi +l[0,1] { +if $6>1 +x0:=$3/100*w#0 y0:=$4/100*h#0 +x1:=$1/100*w#1 y1:=$2/100*h#1 +elif $6>0 +p:=(w#0+w#1) q:=max(h#0,h#1) +x0:=min($3/100*$p,w#0) y0:=min($4/100*$q,h#0) +x1:=max($1/100*$p-w#0,0) y1:=min($2/100*$q,h#1) +else +p:=max(w#0,w#1) q:=(h#0+h#1) +x0:=min($3/100*$p,w#0) y0:=min($4/100*$q,h#0) +x1:=min($1/100*$p,w#1) y1:=max($2/100*$q-h#0,0) +fi +to_a =>[0] T =>[1] S split_opacity +l[T,S] { +trg:=I(#0,$x0,$y0) src:=I(#1,$x1,$y1) ++gcd_srgb_curve_target[0] $src,$trg +if $5 ++_gcd_chromacity_distance[0] $trg *. -1 +. 1 +if $5>1 pow. 3 fi +j[0] ..,0,0,0,0,1,. rm[-2,-1] +else j[0] . rm. fi +} +a[0,1] c a[-2,-1] c +} +fx_gcd_color_spot_matching_preview : +fx_gcd_color_spot_matching $* +if $6>1 rv blend alpha elif $6>0 a x else a y fi +fx_gcd_undo_unsharp : skip ${1=3},${2=0.5},${3=1} +repeat $! l[$>] +split_opacity gcd_reverse_unsharp[0] ${1-3} a c +done done +fx_gcd_undo_unsharp_preview : +gui_split_preview "fx_gcd_undo_unsharp ${1-3}",${-3--1} +#@cli gcd_reverse_unsharp : std_deviation>=0[%],_amount>0,_type +#@cli : Apply a reverse unsharp mask to selected images. +#@cli : Values will be restricted to input image range. +#@cli : 'type' can be { 0=boxfilter | 1=gaussian }. +#@cli : Default values: 'std_deviation=3', 'amount=1' and 'type=1'. +#@cli : $ image.jpg unsharp 2,3 c 0,255 +gcd_reverse_unsharp 2,3 c 0,255 +gcd_reverse_unsharp : skip ${1=3},${2=1},${3=1} +e[^-1] "Apply reverse unsharp on image$?, with std_deviation $1." +repeat $! l[$>] +if $3 cmd=b else cmd=boxfilter fi +m={[im,iM]} +$cmd $1 mul. $2 add div {1+$2} c $m +done done +gcd_unquantize : skip ${1=6},${2=1},${3=1},${4=5},${5=15} +repeat $! l[$>] +gcd_srgb2jpeg s c +if $1>0 ++edges[0] 14.5% n. {1-$2},1 +if $3" && "$!>2 +a[1,2] c +apo[1] "median 5",3 +j[1] .,0,0,0,0,1,.. rm. +fi +{w},{h},1,1,0 grid. 8,8,0,0,1,1 grid. 8,8,-1,-1,1,1 +b. 1,0 *[-2,-1] n. 0,1 +pde_flow[0] $1,30,iee,0 +j[0] .,0,0,0,0,1,.. rm[-2,-1] +fi +if $4>0 ++median[0] 3 -. [0] +abs. ge. $5 +dilate. 3 n. 0,1 ++apo[0] "pde_flow "$4",7,iee,0",8 +j[0] .,0,0,0,0,1,.. rm[-2,-1] +fi +a c gcd_jpeg2srgb c 0,255 +done done +fx_gcd_upscale_edge : skip ${1=1},${2=1},${3=1},${4=1} +mx={[im,iM]} +gcd_upscale_edge {$1==0?$2:$1+1},$3 +if $4==1 c $mx elif $4==2 n $mx fi +u "{$1}{$2}_"{2*($1==0)}"{$3}{$4}" +fx_gcd_upscale_edge_preview : +A,B={P=0.5/($1==0?$2:$1+1);[-P,P]*100+50} +z $A%,$A%,$B%,$B% fx_gcd_upscale_edge $* +#@cli gcd_upscale_edge : factor>=1,_interpolation={ 0=linear | 1=bicubic } +#@cli : Upscale selected images with an edge-sharpening algorithm. +#@cli : Default values: 'factor=2' and 'interpolation=0'. +#@cli : $ image.jpg gcd_upscale_edge 2 +gcd_upscale_edge : skip ${1=2},${2=0} +e[^-1] "Upscale image$? by a factor of $1." +t={arg0($2,3,5)} +repeat $! l[$>] +nw,nh,ms,bs={[w,h,1.75,1.5]*$1} ++r $nw,$nh,100%,100%,$t +gcd_smooth_variance. $ms ++ri. [0],2 -[0,-1] ri[0] . +boxfilter.. $bs + +done done +#@cli gcd_resize_vw : width[%],_height[%],_depth[%] +#@cli : Resize selected images with variance weighted bilinear interpolation. +#@cli : Default values: 'height=100%' and 'depth=100%'. +#@cli : $ image.jpg r2dx 25%,2 +gcd_resize_vw 400%,400% +gcd_resize_vw : skip ${2=100%},${3=100%} +e[^-1] "Resize image$? to $1x$2x$3, with variance weighted bilinear interpolation." +repeat $! l[$>] +if d==1 +(0.0625,0.125,0.0625;0.125,0.25,0.125;0.0625,0.125,0.0625) +else +(0.015625,0.03125,0.015625;0.03125,0.0625,0.03125;0.015625,0.03125,0.015625/0.03125,0.0625,0.03125;0.0625,0.125,0.0625;0.03125,0.0625,0.03125/0.015625,0.03125,0.015625;0.03125,0.0625,0.03125;0.015625,0.03125,0.015625) +fi +[0]x2 sqr.. convolve[-2,-1] [1] rm[1] sqr. -[-2,-1] max. 0 +compose_channels. + /. 3 +. 1e-6 ^. -1 +*.. . r $1,$2,$3,100%,3 / +done done +#@cli gcd_resize_vw_aligned : width[%],_height[%],_depth[%] +#@cli : Resize selected images with pixel aligned variance weighted bilinear interpolation. +#@cli : Default values: 'height=100%' and 'depth=100%'. +#@cli : $ image.jpg r2dx 25%,2 +gcd_resize_vw_aligned 400%,400% +gcd_resize_vw_aligned : skip ${2=100%},${3=100%} +e[^-1] "Resize image$? to $1x$2x$3, with variance weighted bilinear interpolation." +repeat $! l[$>] +if d==1 +(0.0625,0.125,0.0625;0.125,0.25,0.125;0.0625,0.125,0.0625) +else +(0.015625,0.03125,0.015625;0.03125,0.0625,0.03125;0.015625,0.03125,0.015625/0.03125,0.0625,0.03125;0.0625,0.125,0.0625;0.03125,0.0625,0.03125/0.015625,0.03125,0.015625;0.03125,0.0625,0.03125;0.015625,0.03125,0.015625) +fi +[0]x2 sqr.. convolve[-2,-1] [1] rm[1] sqr. -[-2,-1] max. 0 +compose_channels. + /. 3 +. 1e-6 ^. -1 +*.. . gcd_resize_aligned $1,$2,$3 / +done done +#@cli gcd_resize_aligned : width[%],_height[%],_depth[%] +#@cli : Resize selected images with pixel aligned bilinear interpolation. +#@cli : Default values: 'height=100%' and 'depth=100%'. +#@cli : $ image.jpg +gcd_resize_aligned 400%,400% r2dx 25%,2 +gcd_resize_aligned : skip ${2=100%},${3=100%} +e[^-1] "Resize image$? to $1x$2x$3, with bilinear interpolation." +foreach { +$1,$2,$3,3,"[w#0*(x+0.5)/w-0.5,h#0*(y+0.5)/h-0.5,d#0*(z+0.5)/d-0.5]" +warp.. .,0 rm. +} +#@cli gcd_smooth_variance : size>=0[%],_tolerance>=0 +#@cli : Filter selected images by variance smoothing of specified size. +#@cli : Default values: 'size=3' and 'tolerance=1e-6'. +#@cli : $ image.jpg gcd_smooth_variance 5 +gcd_smooth_variance : skip ${1=3},${2=1e-6} +e[^-1] "Apply variance smoothing to image$?." +foreach { +C,R:=H=iM-im;[H/2+im,H] - $C / $R +[0]x2 sqr.. boxfilter[1,2] $1 +sqr. sub[-2,-1] r. 100%,100%,100%,1,2 +max. $2 ^. -1 *[0] . +boxfilter $1 +eq. 0 +[-2,-1] / +c -0.5,0.5 * $R + $C +} +gcd_upscale_noise : skip ${1=16},${2=2} +gcd_scale_noise $1,$2 c 0,255 +gcd_upscale_noise_preview : +z 25%,25%,75%,75% gcd_upscale_noise $* +gcd_scale_noise : skip ${1=16},${2=2} +repeat $! l[$>] +200%,200%,100%,100% gcd_random. $1 +repeat $2 +ri. ..,2 -. [0] ri. .. boxfilter. 3 -[1,2] done rm.. +done done +gcd_random : skip ${1=1},"${2=?}" +f u if isnum("$2") n $1,$2 else n 0,$1 fi +fx_gcd_upscale_recursive2x : skip ${1=4},${2=0.05},${3=0.01} +foreach { +split_opacity +gcd_upscale_recursive2x[0] {[$1,1-$2,0.25,round(1/log(1+$3))]} +if $!>1 +(0.0625,0.125,0.0625;0.125,0.25,0.125;0.0625,0.125,0.0625) +r[1] 200%,200%,100%,100%,1 convolve[1] . rm. a c +fi +} +fx_gcd_upscale_recursive2x_preview : +fx_gcd_upscale_recursive2x 1,${2--1} +#@cli gcd_upscale_recursive2x : search_size>0,0<=_sharpening<=1,0<=_smoothing<=1,_noise_divisor>0 +#@cli : Double image size using processed recursive expansion. +#@cli : Default values: 'search_size=4', 'sharpening=0.9', 'smoothing=0.25' and 'noise_divisor=100'. +#@cli : $ image.jpg gcd_upscale_recursive2x 4 +gcd_upscale_recursive2x : skip ${1=4},${2=0.95},${3=0.25},${4=100} +e[^-1] "Double xy-dimensions of image$?, using Recursive2x algorithm." +foreach { +m={0,[im,iM]} =>[0] small +wh:=[w,h]*2 r {[w+w%2,h+h%2]},100%,100%,0,1 +gcd_midrange_exponent $2 c $m ++gcd_proximity_ssu2x[0] $1 => large +gcd_box_texture[large] 2,$3 ++gcd_random[large] {X=iM-im;[-X,X]/$4} +[large,-1] ++ri[large] [small],2 sub. [small] ri. [large] +(0.0625,0.125,0.0625;0.125,0.25,0.125;0.0625,0.125,0.0625) +convolve.. . rm. sub[large,-1] +rm[small] c[large] $m mv[large] 0 +r $wh,100%,100%,0 +} +#@cli gcd_proximity_ssu2x : search_size>0 +#@cli : Double image size using self-similar upscaling. +#@cli : Default values: 'search_size=4'. +#@cli : $ image.jpg gcd_proximity_ssu2x 4 +gcd_proximity_ssu2x : skip ${1=4} +e[^-1] "Double xy-dimensions of image$?, using ssu2x algorithm." +foreach { +[0],[0],[0],2 ++r2dx[0] 50%,2 +if $1>0 +K:=$1*2+1 +$K,$K,1,2,"X=[x,y]-$1;sign(X)*X*X" +s. c y[-2,-1] x +eval[0] ": +begin( +const boundary=0; +const interpolation=0; +L=crop(#-2); +M=crop(#-1); +const S=w#-1; +); +X=floor(x/2); +Y=floor(y/2); +V=X; W=Y; D=inf; +P=crop(x-1,y-1,3,3); +for(K=0,K=0[%],0<=edge_exponent<=1 +#@cli : Edge preserving smooth. +#@cli : Default values: 'size=3' and 'edge_exponent=0.5'. +#@cli : $ image.jpg gcd_box_texture 3 +gcd_box_texture : skip ${1=3},${2=0.5} +e[^-1] "Apply box texture filter of size $1, on image$?." +foreach { +[0] +sqr. boxfilter[-2,-1] $1 +sqr.. -[-2,-1] +max. 0 +eq. 0 +[-2,-1] sqrt. ^. -$2 +j[0] ..,0,0,0,0,1,. k[0] +} +fx_gcd_upscale_solver2x : skip ${1=4},${2=0},${3=1},${4=1} +foreach { +split_opacity +if $2 gcd_reverse_unsharp[0] $3,$4 fi +gcd_upscale_solver2x[0] $1 +if $!>1 +(0.0625,0.125,0.0625;0.125,0.25,0.125;0.0625,0.125,0.0625) +r[1] 200%,200%,100%,100%,1 convolve[1] . rm. a c +fi +} +fx_gcd_upscale_solver2x_preview : +fx_gcd_upscale_solver2x 1,${2--1} +#@cli gcd_upscale_solver2x : _size>=1,_kernels_only={ 0 | 1 } +#@cli : Double image size using anisotropic kernel solver interpolation. +#@cli : Default values: 'size=4' and 'kernels_only=0'. +#@cli : $ image.jpg +gcd_upscale_solver2x 3 +gcd_upscale_solver2x : skip ${1=4},${2=0} +foreach { +nm:=n m:=[im,iM] ++z[0] 0,0,{floor([w,h]/2)*2-1} => crop ++r. 50%,50%,100%,100%,2 ri. .. => dnup +rv[-2,-1] ++r[0] 100%,100%,100%,1,2 +(0,-0.25,-0.25;0.25,0,-0.25;0.25,0.25,0) ++convolve.. . mirror.. x convolve... .. +rm.. atan2.. . rm. +/. {pi/2} round. 1 mod. 4 -. {im} D:=iM+1 => dirs ++r[dirs] [crop],[crop],[crop],100%,0 => cdirs +r[dnup,crop] 100%,100%,100%,1,2 +repeat $D { +progress {100*$>/$D} ++eq[cdirs] $> ++gcd_solve_kernel[dnup] [crop],$1,[-1] +rm.. +} +rm[dnup,crop,cdirs] +if $2 k[-$D--1] return fi +i[1] [0] =>[1] small +r[0,dirs] 200%,200%,100%,100%,1 +i[1] [0] =>[1] target +repeat $D { ++convolve[0] [-{$<+1}] ++eq[dirs] $> +j[target] ..,0,0,0,0,1,. +rm[-2,-1] +} +k[small,target] ++ri[target] [small],2 sub. [small] +ri. [target] sub[target,-1] rm[small] +k[target] c $m => $nm +} +gcd_warpmap : skip ${1=5},${2=0},${3=0},${4=0},${5=0} +repeat int($!/2) l[$>,{$>+1}] +if $5 rv fi +if $4==3 bm=0 i[0] . else bm=$4 fi +if $2 +gcd_warp[-2,-1] $1,$3 rm... rv[-2,-1] gcd_warp[-2,-1] $2,0,$bm +else gcd_warp[-2,-1] $1,$3,$bm fi +if $4==3 rv fi +done done +gcd_warp : skip ${1=5},${2=0},${3=0} +repeat int($!/2) l[$>,{$>+1}] +wfac={$1%*w} to_rgba[-2,-1] +norm. +blur_xy. $2%,$2% n. 0,255 g. xy a[-2,-1] c +*. -1 n. -$wfac,$wfac warp[0] .,1 rm. +if $3==0 rm. break fi +if $3==1 blend multiply,1,1 else blend softlight,1,1 fi +done done +gcd_wiremap : skip ${1=100},${2=100},${3=0.5},${4=0.5},${5=0} +dm={$!>1" && "$5%2} +l[${arg\ 1+$dm,0,0-1}] +if $dm op=0 +if s==2||s==4 split_opacity. rv[^0] op=1 remove_opacity[0] +elif {0,s==2||s==4} split_opacity[0] op=1 fi +else split_opacity op={$!>1} fi ++norm[0] b. $3% n. 0,$2 *. -1 w={w/2} h={h/2} +r. $1,{round(h/w*$1)},1,3,2 v={w*h} p={(w-1)*h+(h-1)*w} ln={h} +sh. 0 f. x n. -$w,$w rm. +sh. 1 f. y n. -$h,$h rm. permute. cxyz y. +(67.5;73.5;109.5;103.5;51.5;100.5) +($v;$p) +{($1-1)*2},$ln,1,1,if(x%2,-1,2) {($1-1)*2},$ln,1,1,"y*$1+round(x/2)" +a[-2,-1] c permute. cxyz discard. -1 +{($ln-1)*2},$1,1,1,if(x%2,-1,2) {($ln-1)*2},$1,1,1,"round(x/2)*$1+y" +a[-2,-1] c permute. cxyz discard. -1 a[-2,-1] y +if $5%2 ++r[{$dm?$dm+$op:0}] $1,{0,round(h/w*$1)},1,3,3 +z. 0,0,100%,{h-2} +permute. cyxz z.. 0,0,{-2,w-2},100% permute.. cxyz y[-2,-1] a[-2,-1] y +else 1,{$p*3},1,1,255 fi +if $op ++r[1] $1,{0,round(h/w*$1)},1,1,3 gt. 1 +z. 0,0,100%,{h-2} permute. cyxz +z.. 0,0,{-2,w-2},100% permute.. cxyz y[-2,-1] a[-2,-1] y rm[1] +else 1,$p,1,1,1 fi +mv[-6] -3 a[-6--1] y +if $5>1 +f[0] 0 to_a[0] sh[0] 100% f. 255 +j3d[0] ..,50%,50%,{$2*$4},1,1,1,0 negate. rm[-2,-1] +else f[0] 0 j3d[0] .,50%,50%,{$2*$4},1,1,1,0 rm. fi +done +gcd_xbr2x : +repeat $! l[$>] to_rgb[0] +(-1,-1;0,-1;1,-1;-1,0;0,0;1,0;-1,1;0,1;1,1;-1,-2;0,-2;1,-2;-2,-1;-2,0;-2,1;2,-1;2,0;2,1;-1,2;0,2;1,2) +pa_=0 pb_=1 pc_=2 pd_=3 pe_=4 pf_=5 pg_=6 ph_=7 pi_=8 +a1_=9 b1_=10 c1_=11 a0_=12 d0_=13 g0_=14 +c4_=15 f4_=16 i4_=17 g5_=18 h5_=19 i5_=20 +e0=21 e1=22 e2=23 e3=24 +($pe_,$pi_,$ph_,$pf_,$pg_,$pc_,$pd_,$pb_,$f4_,$i4_,$h5_,$i5_,$e1,$e2,$e3;$pe_,$pc_,$pf_,$pb_,$pi_,$pa_,$ph_,$pd_,$b1_,$c1_,$f4_,$c4_,$e0,$e3,$e1;$pe_,$pa_,$pb_,$pd_,$pc_,$pg_,$pf_,$ph_,$d0_,$a0_,$b1_,$a1_,$e2,$e1,$e0;$pe_,$pg_,$pd_,$ph_,$pa_,$pi_,$pb_,$pf_,$h5_,$g5_,$d0_,$g0_,$e3,$e0,$e2) +*[1] -1 +repeat 21 +shift[0] {1,round(i(0,$>))},{1,round(i(1,$>))},0,0,1 done +[0] [0] [0] [0] +=>[0] orig mv[0] $! rm[0] =>[0] kern mv[0] $! +repeat 4 +pe={kern,i(0,$>)} pi={kern,i(1,$>)} ph={kern,i(2,$>)} +pf={kern,i(3,$>)} pg={kern,i(4,$>)} pc={kern,i(5,$>)} +pd={kern,i(6,$>)} pb={kern,i(7,$>)} f4={kern,i(8,$>)} +i4={kern,i(9,$>)} h5={kern,i(10,$>)} i5={kern,i(11,$>)} +n1={kern,i(12,$>)} n2={kern,i(13,$>)} n3={kern,i(14,$>)} ++gcd_eq[$pe,$pf] +gcd_eq[$pe,$ph] or[-2,-1] eq. 0 => lvl1 ++gcd_yuv[$pe,$pc] +gcd_yuv[$pe,$pg] +[-2,-1] ++gcd_yuv[$pi,$h5] +[-2,-1] +gcd_yuv[$pi,$f4] +[-2,-1] ++gcd_yuv[$ph,$pf] *. 4 +[-2,-1] +=> red ++gcd_yuv[$ph,$pd] +gcd_yuv[$ph,$i5] +[-2,-1] ++gcd_yuv[$pf,$i4] +[-2,-1] +gcd_yuv[$pf,$pb] +[-2,-1] ++gcd_yuv[$pe,$pi] *. 4 +[-2,-1] +=> blue ++gcd_yuv[$pe,$pf] +gcd_yuv[$pe,$ph] le[-2,-1] ++image[$ph] [$pf],0,0,0,0,1,. => px rm.. ++lt[red,blue] ++gcd_neq[$pf,$i4] +gcd_neq[$ph,$i5] and[-2,-1] +gcd_eq[$pe,$pi] and[-2,-1] ++gcd_neq[$pf,$pb] +gcd_neq[$ph,$pd] and[-2,-1] or[-2,-1] ++gcd_eq[$pe,$pg] or[-2,-1] +gcd_eq[$pe,$pc] or[-2,-1] +and[-2,-1] => lvl2 ++gcd_yuv[$pf,$pg] => lver ++gcd_yuv[$ph,$pc] => uver ++*[lver] 2 le. [uver] ++gcd_neq[$pg,$pe] +gcd_neq[$pg,$pd] and[-2,-1] +and[-2,-1] and. [lvl2] image[$n3] [px],0,0,0,0,1,. ++*[uver] 2 lt. [lver] ++gcd_neq[$pc,$pe] +gcd_neq[$pc,$pb] and[-2,-1] +and[-2,-1] and. [lvl2] image[$n3] [px],0,0,0,0,1,. +rm[-2,-1,lver,uver] +rm[red,blue,lvl1,lvl2,px] +done +{orig,w},{orig,h},1,1,1 r2dx. {orig,w*2},4 => msk +r2dx[orig,$e0,$e1,$e2,$e3] {orig,w*2},1 +image[orig] [$e0],0,0,0,0,1,[msk] shift[msk] 1 +image[orig] [$e1],0,0,0,0,1,[msk] shift[msk] -1,1 +image[orig] [$e2],0,0,0,0,1,[msk] shift[msk] 1 +image[orig] [$e3],0,0,0,0,1,[msk] +k[orig] +done done +gcd_eq : l[-2,-1] -[-2,-1] norm. eq. 0 done +gcd_neq : l[-2,-1] -[-2,-1] norm. neq. 0 done +gcd_yuv : l[-2,-1] -[-2,-1] abs. rgb2yuv. abs. s. c *... 48 *.. 7 *. 6 +[-3--1] done +fx_gb_cfx : +if $5==1 +noise[0] {$1/1},4 ++fx_bwrecolorize 1,1,0,0,0,1,0,5,0,0,0,255,47,106,121,255,209,136,49,255,228,207,191,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 +fx_compose_edges 0.9,0.5 +else +if $4==1 +fx_bwrecolorize 1,1,0,0,0,1,0,6,0,0,0,255,27,25,55,255,137,152,189,255,191,217,228,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 ++noise[0] {$1/1},4 +compose_interpolation +else +if $3==1 +sepia ++fc[0] 0,65,00 to_rgba[0] +compose_interpolation +noise[0] {$1/1},4 +compose_grainmerge +else +if $2==0 +sepia ++noise[0] $1,4 +compose_grainmerge +else +sepia ++fc[0] 0,0,255 to_rgba[0] +compose_interpolation +noise[0] {$1/2},4 +compose_grainmerge +fi +fi +fi +fi +fx_gb_cfx_preview : +gui_split_preview "fx_gb_cfx ${1--2}",$-1 +gui_gb_about : +fx_logo "GB\'s Filters" +fx_gb_lb : +spread 3 +heat_flow $1 +dilate_circ $2 +compose_lighten +fx_gb_lb_preview : +gui_split_preview "fx_gb_lb ${1--2}",$-1 +fx_gb_pp : +rv +gtutor_blur_img : +l[-2,-1] +if s>3 +remove_opacity. +fi +range={700*$1+700} +rgb2hsl. +s. c +*. $2 +rv[-2,-1] +negate. +*. .. +rv[-3,-1] +/. 360 +*. {2*pi} ++sin. +cos.. +a[-4,-3] c +a[-2,-1] c +eigen2tensor[-2,-1] +repeat 3 +smooth.. .,$range +done +rm. +done +gtutor_blur_img_preview : +gtutor_blur_img ${^0} +#@cli colorwheel : _size>0,_cclock={ 0 | 1 },_angle +#@cli : Generates a square colorwheel in clockface orientation, with zero +#@cli : degrees on top, corresponding to red, and colors transitioning +#@cli : clockwise through green (120 degrees) and blue (240 degrees). size: +#@cli : colorwheel edges, in pixels. cclock, boolean, if true generates a +#@cli : counterclockwise colorwheel, and angle, degrees, rotates the wheel +#@cli : clockwise (negative: counterclockwise) from its reference orientation. +#@cli : Default values: _size=512, _cclock=0, _angle=0 +colorwheel : check ${1=512}>=1 skip ${2=0},${3=0} +e[^-1] "Input colorwheel $1 pixels square; cclockwise=$2; oriented $3 degrees" +$1,$1,1,1,'x=x-w/2;y=y-h/2;((1-2*!!$2)*(atan2(y,x)*180/pi+90-$3))%360' +100%,100%,1,2,1 a[-2,-1] c hsv2rgb. => [colorwheel] +gtutor_hedcut_preview : +gui_split_preview "hedcut ${^0}",$-1 +#@cli hedcut : _contrast=0.5, _lumlevel=0.5, _patsmooth=0.5, _patsize=0.0, _patstep=0.5, _patquality=0 (low=0,high=1), _forcegray=1 (no=0,yes=1) +#@cli : Make a hedcut with a faux intaglio etch pattern. Unless noted, all +#@cli : arguments are floats that range from 0.0 to 1.0. contrast: larger +#@cli : values increase contrast. lumlevel: larger values increases +#@cli : brightness. patsmooth: larger values forces pattern to follow +#@cli : geometry; lower induces turbulence. patsize: larger values increases +#@cli : pattern size. patstep: values alter pattern geometry. Adjust to +#@cli : taste. patquality: Boolean flag. 1=True/On/Yes. Renders oversize for +#@cli : quality. Longer rendering time and more memory will be required (2 +#@cli : GiB minimum for 3000x3000). forcegray: Boolean +#@cli : flag. 1=True/On/Yes. RGB input will be forced to single channel +#@cli : grayscale before processing and returned to RGB after. Output: image +#@cli : in 0-255 range. Channels match input. +hedcut : check "${1=0.5}<=1 && $1>=0 && ${2=0.5}<=1 && $2>=0 && ${3=0.5}<=1 && $3>=0 && ${4=0.0}<=1 && $4>=0 && ${5=0.5}<=1 && $5>=0 && isbool(${6=0}) && isbool(${7=1})" +e[^-1] "Applying faux intaglio etch to selected images. Contrast: "{$1}". Lumenance Level: "$2". Pattern smoothing: "$3". Pattern size: "$4". Pattern stepping: "$5". Quality (low=0,1=high): "$6". Force gray (0=no,1=yes):"$7"." +con={(9.0^$1)} +llv={round(20000*(0.5-$2))/100} +smt={(round((100*(10^$3)/2))/100)+4*$4} +psz={0.0001*(1+99*(1-$4))} +del={$psz+round(1000*(10^(-$4-2)))/1000} +stp={round(2+10*$5)} +qfc={$6} +gry={$7} +tol=30 +spn=0 +repeat $! +l[$>] +remove_opacity. +if $gry +luminance. +fi +s. c +repeat $! +l[$>] +if $qfc ++r2dx. 400%,5 +else +. +fi +spn={(iM-im)/2} +mv. 0 +_multigrad. $stp,$tol,$smt +bandpass. {$psz},{$del} +orientation. +if $qfc +r. ..,..,.,.,5,1 +b. {$con},1,1 +else +b. {$con/4},1,1 +fi +n[-2,-1] {-$spn},{$spn} ++. .. +n. -{(iM-im)/2},{(iM-im)/2} +rm.. +threshold. {$llv} +if $qfc +r2dx. 25%,5 +fi +n. 0,255 +done +done +a c +if $gry +to_rgb +fi +done +done +#@cli _multigrad : _stepsize=5 _tolerance=10 _smooth=5 +_multigrad : skip ${1=50},${2=10},${3=5} +smt=$3 +stp=$1 +tol=$2 +repeat $! +l[$>] +b {$smt} +normalize_local 3,32,4%,2%,1,0,255 +gradient_norm. +ld={log(iM)} ++. 1e-10 +log. +/. {$ld} +cut. 0,1 ++ge. $tol% +if round($smt) +erode_circ. {round(1.5*$smt)} +dilate_circ. {round(1.5*$smt)} +fi +negate.. +n.. 0,1 ++distance. 1,..,0 +rm... +round. 2 +mod. {1+$stp} +threshold 90% ++[-2,-1] +*. -1 ++. 1 +done +done +#@cli tiletex : _texscale=8 autoangle=-1 _keepimag=0 +#@cli : Renders a tilable texture on selected images, taking polar formatted +#@cli : (magnitude, phase angle) seed values from pairs of selected, +#@cli : alternating "Magnitude" and "Angle" images or, if these are constant +#@cli : black, then from internally generated random values. Unless +#@cli : 'autoangle' is positive, input images must form "Magnitude" and +#@cli : "Angle" pairs and each pair must have an equal number of +#@cli : channels. Produces "real" and "imaginary" output images (But note +#@cli : _keepimag, below). 'texscale' sets the size of a square window around +#@cli : the spectral origin where random seeds are set. Larger 'texscales' +#@cli : settings admit higher frequency coefficients, giving rise to finer +#@cli : output details. 'texscale' ranges from 1 upward and defaults to 8. It +#@cli : is ignored if the user has preset coefficients within the input +#@cli : images. Setting 'autoangle' to a positive value in the range [0, 255] +#@cli : eliminates the need for providing "Angle" input images. The provided +#@cli : argument is applied as a default phase angle to all "Magnitude" data +#@cli : and input images are taken to be "Magnitude" data only. 'keepimag' is +#@cli : a trivalued flag: 0, 1 or 2. '0' requests both "Real" and "Imaginary" +#@cli : output pairs and is the default. '1' requests the "Real" output image +#@cli : only; '2' requests the "Imaginary" output image only. +#@cli : Output images are unnormalized and range from negative to positive +#@cli : values, Normalize data accordingly for use with bitmap editors. +tiletex : check "${1=8}>0 && isnum(${2=-1.0}) && ${3=0}>=0 && ${3}<3" +if $2>=0 +addenda2="Common default angle: $2." +else +addenda2="Explicit angles from provided images." +fi +addenda3="Real and imaginary" +if $3!=0 +if $3==1 +addenda3="Real" +else +addenda3="Imaginary" +fi +fi +e[^-1] "Rendering tilable texture on $? at window size $1 "$addenda2". "$addenda3" output to be provided." +rsz={$1} +impla={2*pi*$2/255.0} +all={$3} +iszed=1 +ccc={0,s} +badccc="Selected images have different number of channels. Have you accidently included alpha channels in some (but not all) images?" +repeat $! +if {$>,round(ia)!=0" || "round(iM-im)!=0} +iszed=0 +break +fi +done +if $iszed +repeat $! +l[$<] +if {$<,$ccc!=s} +error $badccc +fi +. +a[-2,-1] c +{2*$rsz+1},{2*$rsz+1},1,{s},(2*u-1)*{wh} +image.. .,{({-2,w}-w)/2},{({-2,h}-h)/2},0,0,1 +rm. +done +done +else +if $impla<0 +if $!%2!=0 +error "Selected images contain data, but selection count is odd. Cannot determine angles for some coefficients. Consider setting an implied angle or providing an even number of images." +fi +repeat $!/2 +l[{2*$<},{2*$<+1}] +if $ccc!={$<,s}" || "$ccc!={{$<+1},s} +error $badccc +fi +s[-2,-1] c +repeat $!/2 +l[{$>},{$!/2+$>}] +/[0,1] 255 +*[1] {2*pi} +polar2complex[0,1] +done +done +a[0--1] c +done +done +else +repeat $! +l[$<] +if $ccc!={$<,s} +error $badccc +fi +[0] +s[-2,-1] c +repeat $!/2 +l[{$>},{$!/2+$>}] +/[0,1] 255 +*[0] {cos($impla)} +*[1] {sin($impla)} +done +done +a[0--1] c +done +done +fi +fi +repeat $! +l[$<] +shift. {-round(w/2)},{-round(h/2)},0,0,2 +s. c,2 +ifft[-2,-1] +if $all!=0 +if $all==1 +rm. +else +rm.. +fi +fi +done +done +gtutor_rectangular_tiling_preview : +gui_split_preview "gtutor_tileit ${2},${1},${3},${8},${4},${7},${5},${6}",0 +is_fc={2*(1-$6)} +u "{$1}{$2}{$3}{$4}{$5}{$6}""{$7}_"$is_fc"{$8}_"$is_fc +_rec_tileit: +gtutor_tileit ${2},${1},${3},${8},${4},${7},${5},${6} +#@cli gtutor_tileit : 0<=_disrupt<=10,0.05<_tsize,0.25<=_spread,0<=_soft,_fillholes:True,-180<=_lightangle<=180,2<=_ccount<=32,_fcolor:False +#@cli : Generate a mosaic from an image. Works best with line art cartoons with flat color. +#@cli : disrupt=5 Rotates, scales and displaces tiles. Suggest 0-10. +#@cli : tsize=1.0 Tile size relative to image. 1.0 → tile diagonal is 2.5% of the image diagonal. +#@cli : spread=1.5 Increasing promotes dropped tiles, gaps at junctions and runs. Suggest 0-3. +#@cli : soft=0.5 Soften and dull shadows and highlights. Suggest 0-5. +#@cli : fillholes=1 True: Fill gaps and holes. No alpha channel. +#@cli : False: Leave gaps and holes. Image has alpha channel. +#@cli : lightangle=45° Degrees: -180° – 180°. Lighting angle. +#@cli : 45°: Light appears to stream from viewer's upper left. +#@cli : ccount=4 Set number of dominant colors, taken from those most frequently occuring in source. +#@cli : fcolor=0 True: Flat color tiling without lighting and shading. +#@cli : False: Do tile lighting and shading. +gtutor_tileit : -check "${1=5}>=0 && $1<=10 && ${2=1.0}>=0.05 && ${3=1.5}>=0.25 && ${4=0.5}>=0 && isbool(${5=1}) && ${6=45}>=-180 && ${6}<=180 && ${7=4}>=2 && ${7}<=32 && isbool(${8=0})" +-echo[^-1] "Applying faux tiling to selected images. Disruption: "${1}". Tile size: "${2}". Tile spread: "${3}". Highlight softening: "${4}". Holes: "${arg\ 1+!$5,filling,leaving}". Light angle: "${6}"°. Color count: "${7}", and "${arg\ 1+!$8,unshaded,shaded}" color." +disrupt=$1 +tsize=$2*0.025*sqrt(w^2+h^2) +spread=$3 +soft=$4 +fillholes=$5 +lightangle=$6 +ccount=$7 +fcolor=$8 +-repeat $! +-local[$>] +-remove_opacity. ++colormap. ${ccount},1,2 +-index.. .,0,1 +-round 1 +1 +-append[-2,-1] x +-name. pallette +-move[pallette] 0 +-name. qcolor ++luminance[qcolor] +-name. qlumin +-normalize[qlumin] 0.6,1 +-input 100%,100%,1,1,'I(#-2,x,y)==I(#-3,0,0)?1:0' +-fill. ">abs( +i-j(1,1,0,0,0,1) +)>iv? +1: +abs( +i-j(1,0,0,0,0,1) +)>iv? +1:0" +-name[-1] outline +-input 100%,100%,1,1 +-name[-1] cost +-plasma[cost] 4,4,{$disrupt} +-normalize[cost] 0,{$disrupt/4.0} ++distance[outline] 1,[cost],1 +-name. distvar ++distance[outline] 1 ++add[-1,-2] +-remove[-3,-2] +[-1] +-name[-1] truedistance +-name[-2] orienter +-gradient[cost] xy +-append[-4,-3] c +-blur[-3] 1,1,1 +-normalize... {-1.5*$disrupt},{1.5*$disrupt} +-name... warper +-round[truedistance] {$spread*$tsize} +-fill[truedistance] "> +abs(i-j(1,1,0,0,0,1))>"{0.5*$spread*$tsize}"? +1: +abs(i-j(1,0,0,0,0,1))>"{0.5*$spread*$tsize}"? +1:0 +" +-gradient[orienter] xy +-append[-3,-2] c +-orientation[orienter] +[-1],[-1],1,4,'[-1,-1,-1,0]' +-name. plottingfield +-fill[plottingfield] ">if( +0=127?255:0' +-fill. 'i>0.05?1:0' +-fill. 'i#-2==0?0:i' +-if $fcolor +-if $fillholes +-fill[plottingfield] 'i#-2==0?I#-5*i#-4:I' +-remove[-2] +-else +-append[-3,-2] c +-fi +-keep[plottingfield] +-else +-distance[heightmap] 1 +-normalize[heightmap] 0,1 +-pow. 0.25 +-blur. 0.875,1,1 +-normalize[heightmap] 0,1 +-if {$fillholes==0} +-fill[heightmap] 'i#-2==0?0:i' +-else +-fill[plottingfield] 'i#-2==0?I#-5*i#-4:I' +-fi +-remove[qcolor,qlumin] +-normalize[plottingfield] 0,1 ++gradient[heightmap] xy +-append[-2,-1] c +({cos($lightangle*pi/180)}^{sin($lightangle*pi/180)}) +-resize. [-2],[-2],[-1],[-1],1 ++mul[-2,-1] +-compose_channels. add +-name. light +-cut. {ia},{iM} +-normalize. 0,1 +-pow. 0.5 +if $soft>0 +-blur. {$soft},1,1 +fi +-mul.. -1 +-mul[-3,-2] +-compose_channels.. add +-name.. shadow +-cut.. {ia#-2},{iM#-2} +-normalize.. 0,1 +-oneminus.. +-pow.. 2 +-mul[plottingfield,shadow] +-mul[light] '{iM#0}' +-add[plottingfield,light] +-normalize[plottingfield] 0,255 +-if {$fillholes==0} +-append[-3,-2] c +-else +-remove.. +-fi +-keep[0] +-fi +-done +-done +iain_2d_scopes: +repeat $! l[$>] +remove_opacity +y_axis=$1 +x_axis=$2 +plot_type=$3 +resolution=$4 +plot_size=$5 +max_samples=$6 +chart_type=$7 +test_pattern=$8 +mirror_y=$9 +mirror_x=$10 +rotate_deg={$11*90} +if $plot_type==3 +remove_duplicates=0 +else +remove_duplicates=1 +fi +luma_sort=1 +if $test_pattern +rm +cube_d={2^$resolution} +$cube_d,$cube_d,$cube_d +to_rgb +split c +fill[0] x +fill[1] y +fill[2] z +n 0,255 +append c +split z +append_tiles 0,0 +split y +append x +fi +split y +append x +if w>$max_samples +resize $max_samples,1 +fi +bsr[0] {8-$resolution} +if $remove_duplicates ++to_rgb[-1] +l[-1] +split c +bsl[1] 8 +bsl[2] 16 +add +done +reverse +append y +sort +,x +discard x +rows 1 +fi +if $luma_sort ++luminance[-1] +reverse +append y +sort +,x +rows 1 +fi +bsl {8-$resolution} ++l[0] +if $x_axis==0 +rgb2yuv8[0] +channels[0] 0 +elif $x_axis==1 +rgb2yuv8[0] +channels[0] 1 +elif $x_axis==2 +rgb2yuv8[0] +channels[0] 2 +elif $x_axis==3 +rgb2hsv8[0] +channels[0] 0 +elif $x_axis==4 +rgb2hsv8[0] +channels[0] 1 +elif $x_axis==5 +rgb2hsv8[0] +channels[0] 2 +elif $x_axis==6 +rgb2lab8[0] +channels[0] 0 +elif $x_axis==7 +rgb2lab8[0] +channels[0] 1 +elif $x_axis==8 +rgb2lab8[0] +channels[0] 2 +elif $x_axis==9 +rgb2lch8[0] +channels[0] 1 +elif $x_axis==10 +rgb2lch8[0] +channels[0] 2 +elif $x_axis==11 +rgb2cmyk[0] +channels[0] 0 +elif $x_axis==12 +rgb2cmyk[0] +channels[0] 1 +elif $x_axis==13 +rgb2cmyk[0] +channels[0] 2 +elif $x_axis==14 +rgb2cmyk[0] +channels[0] 3 +elif $x_axis==15 +channels[0] 0 +elif $x_axis==16 +channels[0] 1 +elif $x_axis==17 +channels[0] 2 +fi +done ++l[0] +if $y_axis==0 +rgb2yuv8[0] +channels[0] 0 +elif $y_axis==1 +rgb2yuv8[0] +channels[0] 1 +elif $y_axis==2 +rgb2yuv8[0] +channels[0] 2 +elif $y_axis==3 +rgb2hsv8[0] +channels[0] 0 +elif $y_axis==4 +rgb2hsv8[0] +channels[0] 1 +elif $y_axis==5 +rgb2hsv8[0] +channels[0] 2 +elif $y_axis==6 +rgb2lab8[0] +channels[0] 0 +elif $y_axis==7 +rgb2lab8[0] +channels[0] 1 +elif $y_axis==8 +rgb2lab8[0] +channels[0] 2 +elif $y_axis==9 +rgb2lch8[0] +channels[0] 1 +elif $y_axis==10 +rgb2lch8[0] +channels[0] 2 +elif $y_axis==11 +rgb2cmyk[0] +channels[0] 0 +elif $y_axis==12 +rgb2cmyk[0] +channels[0] 1 +elif $y_axis==13 +rgb2cmyk[0] +channels[0] 2 +elif $y_axis==14 +rgb2cmyk[0] +channels[0] 3 +elif $y_axis==15 +channels[0] 0 +elif $y_axis==16 +channels[0] 1 +elif $y_axis==17 +channels[0] 2 +fi +done +mul[-1,-2] {$plot_size/256} +$plot_size,$plot_size,1,1,0 +to_rgb[-1] +fill[-1] -1 +repeat {0,w} +if $plot_type==0 +point[-1] {1,i($>)},{2,i($>)},0,1,{0,i($>,0,0,0)},{0,i($>,0,0,1)},{0,i($>,0,0,2)} +elif $plot_type==1 +circle[-1] {1,i($>)},{2,i($>)},0.3%,1,{0,i($>,0,0,0)},{0,i($>,0,0,1)},{0,i($>,0,0,2)} +elif $plot_type==2 +circle_size={max({$<*(1/{0,w})},0.15)} +circle[-1] {1,i($>)},{2,i($>)},$circle_size%,1,{0,i($>,0,0,0)},{0,i($>,0,0,1)},{0,i($>,0,0,2)} +elif $plot_type==3 +l[0] +rgb2hsv split c fill[-1] 1 append c hsv2rgb +done +circle_size={1} +circle[-1] {1,i($>)},{2,i($>)},$circle_size%,0.1,{0,i($>,0,0,0)},{0,i($>,0,0,1)},{0,i($>,0,0,2)} +fi +done +k[-1] +if $chart_type!=0 +100%,100%,1,1 +fill[-1] x +n[-1] 0,255 +l[-1] +if $x_axis==0 ++fill[0] {255/2} ++fill[0] {255/2} +append c +yuv82rgb +elif $x_axis==1 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 2 +append c +yuv82rgb +elif $x_axis==2 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 3 +append c +yuv82rgb +elif $x_axis==3 ++fill[0] {255} ++fill[0] {255} +append c +hsv82rgb +elif $x_axis==4 ++fill[0] {255} ++fill[0] {255} +move[0] 2 +append c +hsv82rgb +elif $x_axis==5 ++fill[0] {0} ++fill[0] {0} +move[0] 3 +append c +hsv82rgb +elif $x_axis==6 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 1 +append c +lab82rgb +elif $x_axis==7 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 2 +append c +lab82rgb +elif $x_axis==8 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 3 +append c +lab82rgb +elif $x_axis==9 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 2 +append c +lch82rgb +elif $x_axis==10 ++fill[0] 180 ++fill[0] 128 +move[0] 3 +append c +lch82rgb +elif $x_axis==11 ++fill[0] {0} ++fill[0] {0} ++fill[0] {0} +move[0] 1 +append c +cmyk2rgb +elif $x_axis==12 ++fill[0] {0} ++fill[0] {0} ++fill[0] {0} +move[0] 2 +append c +cmyk2rgb +elif $x_axis==13 ++fill[0] {0} ++fill[0] {0} ++fill[0] {0} +move[0] 3 +append c +cmyk2rgb +elif $x_axis==14 ++fill[0] {0} ++fill[0] {0} ++fill[0] {0} +move[0] 4 +append c +cmyk2rgb +elif $x_axis==15 ++fill[0] {0} ++fill[0] {0} +move[0] 1 +append c +elif $x_axis==16 ++fill[0] {0} ++fill[0] {0} +move[0] 2 +append c +elif $x_axis==17 ++fill[0] {0} ++fill[0] {0} +move[0] 3 +append c +fi +done +100%,100%,1,1 +fill[-1] y +n[-1] 0,255 +l[-1] +if $y_axis==0 ++fill[0] {255/2} ++fill[0] {255/2} +append c +yuv82rgb +elif $y_axis==1 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 2 +append c +yuv82rgb +elif $y_axis==2 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 3 +append c +yuv82rgb +elif $y_axis==3 ++fill[0] {255} ++fill[0] {255} +append c +hsv82rgb +elif $y_axis==4 ++fill[0] {255} ++fill[0] {255} +move[0] 2 +append c +hsv82rgb +elif $y_axis==5 ++fill[0] {0} ++fill[0] {0} +move[0] 3 +append c +hsv82rgb +elif $y_axis==6 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 1 +append c +lab82rgb +elif $y_axis==7 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 2 +append c +lab82rgb +elif $y_axis==8 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 3 +append c +lab82rgb +elif $y_axis==9 ++fill[0] {255/2} ++fill[0] {255/2} +move[0] 2 +append c +lch82rgb +elif $y_axis==10 ++fill[0] 180 ++fill[0] 128 +move[0] 3 +append c +lch82rgb +elif $y_axis==11 ++fill[0] {0} ++fill[0] {0} ++fill[0] {0} +move[0] 1 +append c +cmyk2rgb +elif $y_axis==12 ++fill[0] {0} ++fill[0] {0} ++fill[0] {0} +move[0] 2 +append c +cmyk2rgb +elif $y_axis==13 ++fill[0] {0} ++fill[0] {0} ++fill[0] {0} +move[0] 3 +append c +cmyk2rgb +elif $y_axis==14 ++fill[0] {0} ++fill[0] {0} ++fill[0] {0} +move[0] 4 +append c +cmyk2rgb +elif $y_axis==15 ++fill[0] {0} ++fill[0] {0} +move[0] 1 +append c +elif $y_axis==16 ++fill[0] {0} ++fill[0] {0} +move[0] 2 +append c +elif $y_axis==17 ++fill[0] {0} ++fill[0] {0} +move[0] 3 +append c +fi +done +if $chart_type==1 +100%,100% +100%,100% +linethick[-1] 50%,0,50%,100%,{$plot_size*.01},1,1 +linethick[-2] 0%,50%,100%,50%,{$plot_size*.01},1,1 +mul[1,3] +mul[2,3] +fi +blend[-1,-2] average +if $chart_type==1 +l[-1] ++l[0] split c max done +gt[-1] 0 +replace[-1] 1,128 +laplacian[-1] +abs +max +done +fi ++eq[0] -1 +l[-1] split c min erode_circ {round($plot_size*.1)} blur {$plot_size*.025} done +mul[-1,-2] +fi +max +if $mirror_y +mirror y +fi +if $mirror_x +mirror x +fi +rotate $rotate_deg +done done +iain_smooth_tutorial: +amplitude=$1 +sharpness=$2 +anisotropy=$3 +gradient_smoothness=$4 +tensor_smoothness=$5 +quiver=$6 +remove_opacity ++l[0] +p1={if(0,0.5,1)*max($sharpness,1e-2)} +p2={$p1/(1e-7+1-$anisotropy)} +b $gradient_smoothness n 0,255 structuretensors 0 b $tensor_smoothness +eigen max.. 0 +if s==2 s.. c +[-3,-2] +.. 1 +^.. -$p1 ^... -$p2 a[-3,-1] c +else s.. c +[-4--2] +.. 1 +^.. -$p1 r. 100%,100%,100%,2 ^... -$p2 a[-3,-1] c +fi ++l +l[-1] +split[-1] c ++abs[0] +fill[0] acos(i) +add[0] {pi/2} +mod[0] {pi} +fill[0] cos(i) +rm[1] ++fill[0] 0 +append c +done +l[-2] +split c +add +pow $sharpness +done +to_rgb +mul +resize[0] 400%,400% +100%,100%,1,1,255 ++quiver[1] [0],24,3,0,1 +k[-1] +resize 25%,25%,100%,100%,2 +done +l[-3] +split[0] c +fill[0] 0 +c[1] 1,10 +append[0,1] c +done +l[-2,-3] +eigen2tensor +done +smooth[-1] [-2],5 +rm[-2] +luminance +negate +[0] +blur[-1] 3 +max[-1] 0.1 +fill[-1] 10/i +mul[0] [1] +negate +n 0,255 +c 120,255 +n 0,255 +k[0] +done +if $7 +blur[0] $gradient_smoothness +n[0] 0,255 +else +smooth[0] $amplitude,$sharpness,$anisotropy,$gradient_smoothness,$tensor_smoothness +fi +if $quiver==1 +ac[0] " sub 128 mul 0.5 add 128",ycbcr_y +n[1] 0,1 +mul +elif $quiver==2 +k[1] +else +k[0] +fi +c 0,255 +iain_auto_wb_preview: +iain_auto_wb[0] $1,$2,$3,$4,$5,$6 +rectangle[0] $1%,$2%,$3%,$4%,1,0xffff,255 +iain_auto_wb: +repeat $! l[$>] +remove_opacity +norm_out=$5 +repeats=15 +display_text=0 +rm_outliers=1 +max_pixels={2^16} +lower_limit=5 +upper_limit=200 ++l[0] +target_pixel_number={2^16} +crop $1%,$2%,$3%,$4% ++l[0] split c max done +fill[-1] if(i<$lower_limit||i>$upper_limit,0,1) +good_pixels={-1,is} +pixel_retention_ratio={$good_pixels/{wh}} +scale_factor={sqrt((($target_pixel_number/$pixel_retention_ratio)/{wh}))} +if $scale_factor<1 +resize {w*$scale_factor},{h*$scale_factor},100%,100%,2 +fi +gt[-1] 0 +add[0] 1 +mul[0] [-1] +sub[0] 1 +rm[-1] +split c +unroll[0] x +unroll[1] x +unroll[2] x +discard[0,1,2] x,-1 +append[0,1,2] c ++to_rgb[-1] +l[-1] +split c +bsl[1] 8 +bsl[2] 16 +add +done +reverse +append y +sort +,x +discard x +rows 1 +append c +done ++l[1] +rgb2hsv channels 0 +add[-1] 180 mod[-1] 360 +hv_old={min({0,iv},{1,iv})} +rm +done +hv_old_b=$hv_old +hv_new_A_plus_B_plus=0 +hv_new_A_plus_B_minus=0 +hv_new_A_minus_B_plus=0 +hv_new_A_minus_B_minus=0 +shift_a=0 +shift_b=0 +step_size=3 +repeat $repeats +shift_a_top=$shift_a ++l[1] +iain_rgb_mix_wb[0] {$shift_a+$step_size},{$shift_b+$step_size} +rgb2hsv channels 0 +add[-1] 180 mod[-1] 360 +hv_new_A_plus_B_plus={min({0,iv},{1,iv})} +rm +done ++l[1] +iain_rgb_mix_wb[0] {$shift_a+$step_size},{$shift_b-$step_size} +rgb2hsv channels 0 +add[-1] 180 mod[-1] 360 +hv_new_A_plus_B_minus={min({0,iv},{1,iv})} +rm +done ++l[1] +iain_rgb_mix_wb[0] {$shift_a-$step_size},{$shift_b+$step_size} +rgb2hsv channels 0 +add[-1] 180 mod[-1] 360 +hv_new_A_minus_B_plus={min({0,iv},{1,iv})} +rm +done ++l[1] +iain_rgb_mix_wb[0] {$shift_a-$step_size},{$shift_b-$step_size} +rgb2hsv channels 0 +add[-1] 180 mod[-1] 360 +hv_new_A_minus_B_minus={min({0,iv},{1,iv})} +rm +done +hv_max={max($hv_old,$hv_new_A_plus_B_plus,$hv_new_A_plus_B_minus,$hv_new_A_minus_B_plus,$hv_new_A_minus_B_minus)} +if $hv_old==$hv_max +elif $hv_new_A_plus_B_plus==$hv_max +shift_a={$shift_a+$step_size} +shift_b={$shift_b+$step_size} +hv_old=$hv_new_A_plus_B_plus +elif $hv_new_A_plus_B_minus==$hv_max +shift_a={$shift_a+$step_size} +shift_b={$shift_b-$step_size} +hv_old=$hv_new_A_plus_B_minus +elif $hv_new_A_minus_B_plus==$hv_max +shift_a={$shift_a-$step_size} +shift_b={$shift_b+$step_size} +hv_old=$hv_new_A_minus_B_plus +elif $hv_new_A_minus_B_minus==$hv_max +shift_a={$shift_a-$step_size} +shift_b={$shift_b-$step_size} +hv_old=$hv_new_A_minus_B_minus +fi +step_size={$step_size/2} +red_mul={round((2^$shift_a),0.1,0)} +blue_mul={round((2^$shift_b),0.1,0)} +done +iain_rgb_mix_wb[0] $shift_a,$shift_b +k[0] +if $norm_out +n 0,255 +fi +c 0,255 +if $6 +negate +fi +done +done +iain_rgb_mix_wb: +remove_opacity +split c +mul[0] {2^$1} +mul[2] {2^$2} +append c +automixer: +to_rgb ++split[-1] c +if $2==1 +crop[-1,-2,-3] 40%,40%,60%,60% +fi +bluenoise=${-variance_noise} +remove[-1] +greennoise=${-variance_noise} +remove[-1] +rednoise=${-variance_noise} +remove[-1] +greennoise={$greennoise*0.5} +redadjust={$greennoise/$rednoise} +blueadjust={$greennoise/$bluenoise} +to_rgb ++split[0] c +mul[1] {$redadjust/($redadjust+1+$blueadjust)} +mul[2] {1/($redadjust+1+$blueadjust)} +mul[3] {$blueadjust/($redadjust+1+$blueadjust)} +add[1-3] +if $1==0 +keep[-1] +else ++compose_grainextract +remove[0] +fi +med3stack16: +blend_median +med5stack16: +blend_median +cross16: ++shift[0] 0,1,0,0,2 ++shift[0] 0,-1,0,0,2 ++shift[0] 1,0,0,0,2 ++shift[0] -1,0,0,0,2 +blend_median +ex16: ++shift[0] 1,1,0,0,2 ++shift[0] 1,-1,0,0,2 ++shift[0] -1,-1,0,0,2 ++shift[0] -1,1,0,0,2 +blend_median +hybrid16: ++cross16[0] ++ex16[0] +blend_median +autonr2: ++crop 30%,30%,70%,70% +noise0=${-variance_noise} +remove[-1] +cropwidth={w} +cropheight={h} +resize[0] {w+(64-w%64)},{h+(64-h%64)},1,{s},0,1 +width={w} +height={h} +if $noise0>$2 +denoise[-1] 10,{$noise0*$1},3,5,0,1 +denoise[-1] 10,{$noise0*$1},3,5,0,1 +fi ++resize[0] {$width/2},{$height/2},1,{s},2,1 ++resize[-1] $width,$height,1,{s},3,1 +sub[0] [-1] +remove[-1] +noise1=${-variance_noise} +if $noise1>$2 +denoise[-1] 10,{$noise1*$1},3,5,0,0 +fi ++resize[-1] {$width/4},{$height/4},1,{s},2,1 ++resize[-1] {$width/2},{$height/2},1,{s},3,1 +sub[1] [-1] +remove[-1] +noise2=${-variance_noise} +if $noise2>$2 +denoise[-1] 10,{$noise2*$1},3,5,0,1 +fi ++resize[-1] {$width/8},{$height/8},1,{s},2,1 ++resize[-1] {$width/4},{$height/4},1,{s},3,1 +sub[2] [-1] +remove[-1] +noise3=${-variance_noise} +if $noise3>$2 +denoise[-1] 10,{$noise3*$1},3,5,0,1 +fi +resize[-1] {$width/4},{$height/4},1,{s},3,1 +add[-2] [-1] +remove[-1] +resize[-1] {$width/2},{$height/2},1,{s},3,1 +add[-2] [-1] +remove[-1] +resize[-1] {$width/1},{$height/1},1,{s},3,1 +add[-2] [-1] +remove[-1] +crop 0,0,{$cropwidth-1},{$cropheight-1} +fft_tile3_fft: ++fftpolar[0] +100%,100%,1,1,1 +ellipse[-1] 50%,50%,50%,50%,0,1,$4 +ellipse[-1] 50%,50%,15%,15%,0,1,$5 +ellipse[-1] 50%,50%,5%,5%,0,1,$6 ++add[1] [-1] +threshold[-1] $1 +set[-1] 1,50%,50% +mul[1] [-1] ++ifftpolar[1,2] +remove[0,1,2] +keep[-1] +fft_tile3_clean: +tc={round(w/$2)} tr={round(h/$2)} +split_tiles $tc,$tr +repeat $! local[$>] +fft_tile3_fft[0--1] $1,$2,$3,$4,$5,$6 +done done +append_tiles $tc,$tr +c 0,255 +fft_tile3: ++resize[0] {w+$2},{h+$2},1,1,0,1,1,1 +resize[-1] {w+$2},{h+$2},1,1,0,1,0,0 +fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] $2,$2,{w-$2-1},{h-$2-1} +push={round($2*1.5)} +pull={$2-$push} ++resize[0] {w+$push},{h+$2},1,1,0,1,1,1 +resize[-1] {w+$pull},{h+$2},1,1,0,1,0,0 +fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$push},{$2},{w-$pull-1},{h-($2)-1} ++resize[0] {w+$2},{h+$push},1,1,0,1,1,1 +resize[-1] {w+$2},{h+$pull},1,1,0,1,0,0 +fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] $2,{$push},{w-$2-1},{h-$pull-1} +dia1={round($2/3)} +dia2={$2-$dia1} ++resize[0] {w+$dia1},{h+$dia1},1,1,0,1,1,1 +resize[-1] {w+$dia2},{h+$dia2},1,1,0,1,0,0 +fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$dia1},{$dia1},{w-$dia2-1},{h-$dia2-1} ++resize[0] {w+$dia2},{h+$dia2},1,1,0,1,1,1 +resize[-1] {w+$dia1},{h+$dia1},1,1,0,1,0,0 +fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$dia2},{$dia2},{w-$dia1-1},{h-$dia1-1} +remove[0] +blend_median +nr3: +mul 256 +radius={0.05*(min(h,w))} +[0] +rectangle[-1] 0,0,100%,$radius,1,{ia} +rectangle[-1] 0,0,$radius,100%,1,{ia} +rectangle[-1] 0,100%,100%,{h-$radius},1,{ia} +rectangle[-1] {w-$radius},100%,100%,0,1,{ia} +blur[-1] {$radius/2} +xmin={xm} +ymin={ym} +remove[-1] ++crop[0] {$xmin-$radius},{$ymin-$radius},{$xmin+$radius},{$ymin+$radius} +minnoise=${-variance_noise} +remove[-1] ++sub[0] {250*256} +abs[-1] +rectangle[-1] 0,0,100%,$radius,1,{ia} +rectangle[-1] 0,0,$radius,100%,1,{ia} +rectangle[-1] 0,100%,100%,{h-$radius},1,{ia} +rectangle[-1] {w-$radius},100%,100%,0,1,{ia} +blur[-1] {$radius/2} +xmax={xm} +ymax={ym} ++crop[0] {$xmax-$radius},{$ymax-$radius},{$xmax+$radius},{$ymax+$radius} +maxnoise=${-variance_noise} +remove[-1] ++sub[0] {128*256} +abs[-1] +rectangle[-1] 0,0,100%,$radius,1,{ia} +rectangle[-1] 0,0,$radius,100%,1,{ia} +rectangle[-1] 0,100%,100%,{h-$radius},1,{ia} +rectangle[-1] {w-$radius},100%,100%,0,1,{ia} +blur[-1] {$radius/2} +xave={xm} +yave={ym} +remove[-1] ++crop[0] {$xave-$radius},{$yave-$radius},{$xave+$radius},{$yave+$radius} +midnoise=${-variance_noise} +text[-1] $midnoise,0,0,25,1,{iM} ++sub[0] {64*256} +abs[-1] +rectangle[-1] 0,0,100%,$radius,1,{ia} +rectangle[-1] 0,0,$radius,100%,1,{ia} +rectangle[-1] 0,100%,100%,{h-$radius},1,{ia} +rectangle[-1] {w-$radius},100%,100%,0,1,{ia} +blur[-1] {$radius/2} +xshadow={xm} +yshadow={ym} +remove[-1] ++crop[0] {$xshadow-$radius},{$yshadow-$radius},{$xshadow+$radius},{$yshadow+$radius} +shadownoise=${-variance_noise} ++sub[0] {192*256} +abs[-1] +rectangle[-1] 0,0,100%,$radius,1,{ia} +rectangle[-1] 0,0,$radius,100%,1,{ia} +rectangle[-1] 0,100%,100%,{h-$radius},1,{ia} +rectangle[-1] {w-$radius},100%,100%,0,1,{ia} +blur[-1] {$radius/2} +xbright={xm} +ybright={ym} +remove[-1] ++crop[0] {$xbright-$radius},{$ybright-$radius},{$xbright+$radius},{$ybright+$radius} +brightnoise=${-variance_noise} +shadows={(($minnoise/$shadownoise)*64)} +mids={(($minnoise/$midnoise)*64)} +brights={(($minnoise/$brightnoise)*64)} +whites={(($minnoise/$maxnoise)*64)} +point1={$shadows+32} +point2={$mids+$shadows+32} +point3={$brights+$mids+$shadows+32} +point4={$whites+$brights+$mids+$shadows+32} +keep[0] +cropwidth={w} +cropheight={h} +resize[0] {w+(64-w%64)},{h+(64-h%64)},1,{s},0,1 +width={w} +height={h} +apply_curve[0] 0,0,0,{32*256},{32*256},{96*256},{$point1*256},{160*256},{$point2*256},{223*256},{$point3*256},{287*256},{$point4*256} +sub {128*256} mul .5 add {128*256} ++hybrid16[0] +autonr2[-1] $1,$2 +autonr2[-1] $1,$2 ++sub[0] [1] +add[-1] {128*256} +remove[0] +div[-1] 256 +fft_tile3[-1] {2000-$3},48,0,$4,$5,$6,1 +mul[-1] 256 +sub[-1] {128*256} mul[-1] $7 add[-1] {128*256} +unsharp[0] $8,$9,$10 +unsharp[1] $11,$12,$13 +sub[1] {128*256} +add[0] [1] +remove[1] +sub {128*256} mul 2 add {128*256} +apply_curve[0] 0,0,0,{32*256},{32*256},{$point1*256},{96*256},{$point2*256},{160*256},{$point3*256},{223*256},{$point4*256},{287*256} +div 256 +c 0,255 +crop 0,0,{$cropwidth-1},{$cropheight-1} +iain_brown_spot_clean: +red_radius={($1*2)+1} +green_radius={($1*2)+1} +blue_radius={($2*2)+1} +to_rgb ++l +split c +l[0] +median $red_radius +median $red_radius +median $red_radius +done +l[1] +median $green_radius +median $green_radius +median $green_radius +done +l[2] +median $blue_radius +median $blue_radius +median $blue_radius +done +append c +done +sub[0] [1] +add[0] 128 ++l[0] +rgb2hsv8 +split c +keep[0] +apply_curve 0,0,0,11,0,13,255,65,255,67,0,255,0 +lt 1 +done +sub[0] 128 +mul[0,2] +add +c 0,255 +nozip: +remove_opacity ++l[0] +(1;-1) +convolve[0] [1] +rm[1] +abs +split c +max +done ++l[1] +(1,-1) +convolve[0] [1] +rm[1] +abs +split c +max +done ++l[0] ++l +split c +add +div 3 +done +sub +abs +split c +max +done ++l[1] ++l +split c +add +div 3 +done +sub +abs +split c +max +done +mul[-1,-2] $1 +add[2,4] +add[3,4] +l[-1,-2] +blur 2 +sub +gt 0 +mul 255 +done +append[1,2] c +blend alpha,1,0 +iain_CA_correction: +to_rgb +longest_side={max(w,h)} +split c +l[0] +$longest_side,$longest_side +50%,1 +fill[-1] 1-(x/w) ++mirror[-1] x +mul[-2] -1 +append[-1,-2] x +resize[-1] {1,w},{1,h},1,1,1 +[-1] +rotate[-1] 90 +append[-1,-2] c +rm[1] +resize[1] {0,w},{0,h},{d},{s},0,0,0.5,0.5 +mul[-1] $2 +warp[0] [1],1,$3,1 +keep[0] +done +l[2] +$longest_side,$longest_side +50%,1 +fill[-1] 1-(x/w) ++mirror[-1] x +mul[-2] -1 +append[-1,-2] x +resize[-1] {1,w},{1,h},1,1,1 +[-1] +rotate[-1] 90 +append[-1,-2] c +rm[1] +resize[1] {0,w},{0,h},{d},{s},0,0,0.5,0.5 +mul[-1] $1 +warp[0] [1],1,$3,1 +keep[0] +done +append c +c 0,255 +iain_CA_correction_pr: +to_rgb +x_mul={w/max(w,h)} +y_mul={h/max(w,h)} +if $-1==0 +rx_shift={$2*-1*$x_mul} +ry_shift={$2*-1*$y_mul} +bx_shift={$1*-1*$x_mul} +by_shift={$1*-1*$y_mul} +elif $-1==1 +rx_shift={$2*$x_mul} +ry_shift={$2*-1*$y_mul} +bx_shift={$1*$x_mul} +by_shift={$1*-1*$y_mul} +elif $-1==2 +rx_shift={$2*$x_mul} +ry_shift={$2*$y_mul} +bx_shift={$1*$x_mul} +by_shift={$1*$y_mul} +elif $-1==3 +rx_shift={$2*-1*$x_mul} +ry_shift={$2*$y_mul} +bx_shift={$1*-1*$x_mul} +by_shift={$1*$y_mul} +fi +split c +l[0] +[0] +[0] +fill[1] $rx_shift +fill[2] $ry_shift +append[1,2] c +warp[0] [1],1,$3,1 +keep[0] +done +l[2] +[0] +[0] +fill[1] $bx_shift +fill[2] $by_shift +append[1,2] c +warp[0] [1],1,$3,1 +keep[0] +done +append c +if $-2 +rgb2hsv +split c +fill[-1] .5 +append c +hsv2rgb +sub 128 +mul 2 +add 128 +c 0,255 +fi +iain_detect_moire_preview: ++moire_2018_2[0] $1,$2,$3 +laplacian[-1] +abs[-1] +l[0] +split c +l[1] +(0,1) +resize[-1] [0],0,2 ++mul[0] [1] +eq[1] 0 ++mul[0] [1] +k[2,3] +done +(0.25,0.5,0.25;0.5,1,0.5;0.25,0.5,0.25) +convolve[0,1,2,3] [-1] +rm[-1] +add[1,2] +mul[1] 0.5 +append c +adjust_colors 0,0,0,0,$4,0,255 +done +remove_opacity +add +c 0,255 +iain_detect_moire: +skip $1,$2,$3 +channels 1 ++l[0] +(1,0,1;0,-4,0;1,0,1) +convolve[0] [1] +rm[1] +abs +done ++l[0] +(1,0,-2,0,1) +convolve[0] [1] +rm[1] +abs +done ++l[0] +(1;0;-2;0;1) +convolve[0] [1] +rm[1] +abs +done +add[-1,-2] +rm[0] +sub[0] [1] +k[0] +c 0,255 +l[0] ++l[0] +(1,0,1;1,0,1;1,0,1) +dilate[0] [1] +rm[1] +done ++l[0] +(1,0,1;1,0,1;1,0,1) +erode[0] [1] +rm[1] +done +min[0,1] +max[0,1] +done +mul 10 +c 0,255 +thickness=5 +linethick 0%,0%,100%,0%,$thickness,1,0 +linethick 0%,0%,0%,100%,$thickness,1,0 +linethick 100%,0%,100%,100%,$thickness,1,0 +linethick 0%,100%,100%,100%,$thickness,1,0 +blur $2 +gt $1 +mul 255 +if $3>0 +dilate $3 +fi +if $3<0 +erode {$3*-1} +fi +iain_easy_skin_retouch: +repeat $! l[$>] split_opacity l[0] +str1=$1 +str2={$str1*$3} +str3={$str2*$3} +str4={$str3*$3} +str5={$str4*$3} +str6={$str5*$3} +str7={$str6*$3} +str8={$str7*$3} ++l[0] +repeat $2 +cropwidth={w} +cropheight={h} +resize[0] {w+(256-w%256)},{h+(256-h%256)},1,{s},0,1 +width={w} +height={h} +if $str1!=0 +denoise[0] 10,$str1,3,5,0,1 +fi ++resize[0] {$width/2},{$height/2},1,{s},2,1 ++resize[-1] $width,$height,1,{s},3,1 +blur[-1] .5 +compose_grainextract[0,-1] +if $str2!=0 +denoise[-1] 10,$str2,3,5,0,1 +fi ++resize[-1] {$width/4},{$height/4},1,{s},2,1 ++resize[-1] {$width/2},{$height/2},1,{s},3,1 +blur[-1] .5 +compose_grainextract[1,-1] +if $str3!=0 +denoise[-1] 10,$str3,3,5,0,1 +fi ++resize[-1] {$width/8},{$height/8},1,{s},2,1 ++resize[-1] {$width/4},{$height/4},1,{s},3,1 +blur[-1] .5 +compose_grainextract[2,-1] +if $str4!=0 +denoise[-1] 10,$str4,3,5,0,1 +fi ++resize[-1] {$width/16},{$height/16},1,{s},2,1 ++resize[-1] {$width/8},{$height/8},1,{s},3,1 +blur[-1] .5 +compose_grainextract[3,-1] +if $str5!=0 +denoise[-1] 10,$str5,3,5,0,1 +fi ++resize[-1] {$width/32},{$height/32},1,{s},2,1 ++resize[-1] {$width/16},{$height/16},1,{s},3,1 +blur[-1] .5 +compose_grainextract[4,-1] +if $str6!=0 +denoise[-1] 10,$str6,3,5,0,1 +fi ++resize[-1] {$width/64},{$height/64},1,{s},2,1 ++resize[-1] {$width/32},{$height/32},1,{s},3,1 +blur[-1] .5 +compose_grainextract[5,-1] +if $str7!=0 +denoise[-1] 10,$str7,3,5,0,1 +fi ++resize[-1] {$width/128},{$height/128},1,{s},2,1 ++resize[-1] {$width/64},{$height/64},1,{s},3,1 +blur[-1] .5 +compose_grainextract[6,-1] +if $str8!=0 +denoise[-1] 10,$str8,3,5,0,1 +fi ++resize[-1] {$width/256},{$height/256},1,{s},2,1 ++resize[-1] {$width/128},{$height/128},1,{s},3,1 +blur[-1] .5 +compose_grainextract[7,-1] +resize[-1] {$width/128},{$height/128},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/64},{$height/64},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/32},{$height/32},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/16},{$height/16},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/8},{$height/8},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/4},{$height/4},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/2},{$height/2},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/1},{$height/1},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +crop 0,0,{$cropwidth-1},{$cropheight-1} +done +done +if $4==1 ++compose_grainextract[0,-1] ++rgb2hsv8[-1] +split[-1] c +remove[-1,-2] +add[-1] 30 +mod[-1] 255 +ge[-1] 40 +n[-1] 0,255 +negate[-1] +blur[-1] 4 ++split[-2] c +remove[-1,-2] +move[-1] -2 +append[-2,-1] c ++blend[-1,-2] alpha +remove[-2] +mul[-1] {$10} +mul[-2] {1-$10} +add[-1] [-2] +remove[-2] +l[-1] ++fftpolar[0] +100%,100%,1,1,1 +ellipse[-1] 50%,50%,50%,50%,0,1,$5 +ellipse[-1] 50%,50%,25%,25%,0,1,$6 +ellipse[-1] 50%,50%,12%,12%,0,1,$7 +ellipse[-1] 50%,50%,6%,6%,0,1,$8 +ellipse[-1] 50%,50%,3%,3%,0,1,$9 +ellipse[-1] 50%,50%,0.1%,0.1%,0,1,1 +set[-1] 1,50%,50% +mul[1] [-1] +ifftpolar[1,2] +keep[1] +c 0,255 +done +remove[0] +if $11==0 +compose_grainmerge[-1,-2] +fi +else +keep[-1] +fi +done a c done done +iain_easy_skin_retouch_preview: +iain_easy_skin_retouch ${1--1} +exfuse: +cropwidth={w} +cropheight={h} ++mul[0] {2*$1} ++mul[0] {4*$1} +c 0,255 ++fx_ExposureWeightMap[0] $2,$3,$4,$5,0 ++fx_ExposureWeightMap[1] $2,$3,$4,$5,0 ++fx_ExposureWeightMap[2] $2,$3,$4,$5,0 +parallel " +freq_pyramid[0]"," +freq_pyramid[1]"," +freq_pyramid[2]"," +dumb_pyramid[3]"," +dumb_pyramid[4]"," +dumb_pyramid[5]" +parallel "blur[-1] $6","blur[-2] $6","blur[-3] $6" +replace[-1,-2,-3] 0,0.000000001 ++add[-1,-2,-3] +div[-2] [-1] +div[-3] [-1] +div[-4] [-1] +rm[-1] +parallel " +mul[0] [3]"," +mul[1] [4]"," +mul[2] [5]" +add[0,1,2] +keep[0] +ifreq_pyramid[0] +crop 0,0,{$cropwidth-1},{$cropheight-1} +c 0,255 +dumb_pyramid: +cropwidth={w} +cropheight={h} +resize {w+(1024-w%1024)},{h+(1024-h%1024)},1,3,0,1 +newwidth={w} ++resize[-1] 50%,50%,{d},{s},2 ++resize[-1] 50%,50%,{d},{s},2 ++resize[-1] 50%,50%,{d},{s},2 ++resize[-1] 50%,50%,{d},{s},2 ++resize[-1] 50%,50%,{d},{s},2 +append x +resize {$newwidth*2},100%,1,3,0,0 +ifreq_pyramid: +split x,2 +split[1] x,2 +split[2] x,2 +split[3] x,2 +split[4] x,2 +crop[1] 0,0,100%,{0,h/2-1} +crop[2] 0,0,100%,{0,h/4-1} +crop[3] 0,0,100%,{0,h/8-1} +crop[4] 0,0,100%,{0,h/16-1} +crop[5] 0,0,{4,w/2-1},{0,h/32-1} +resize[-1] {-2,w},{-2,h},{d},{s},3 +add[-1,-2] +resize[-1] {-2,w},{-2,h},{d},{s},3 +add[-1,-2] +resize[-1] {-2,w},{-2,h},{d},{s},3 +add[-1,-2] +resize[-1] {-2,w},{-2,h},{d},{s},3 +add[-1,-2] +resize[-1] {-2,w},{-2,h},{d},{s},3 +add[-1,-2] +freq_pyramid: +cropwidth={w} +cropheight={h} +resize {w+(1024-w%1024)},{h+(1024-h%1024)},1,3,0,1 +newwidth={w} ++resize[-1] 50%,50%,{d},{s},2 ++resize[-1] {-2,w},{-2,h},{d},{s},3 +sub[-3,-1] ++resize[-1] 50%,50%,{d},{s},2 ++resize[-1] {-2,w},{-2,h},{d},{s},3 +sub[-3,-1] ++resize[-1] 50%,50%,{d},{s},2 ++resize[-1] {-2,w},{-2,h},{d},{s},3 +sub[-3,-1] ++resize[-1] 50%,50%,{d},{s},2 ++resize[-1] {-2,w},{-2,h},{d},{s},3 +sub[-3,-1] ++resize[-1] 50%,50%,{d},{s},2 ++resize[-1] {-2,w},{-2,h},{d},{s},3 +sub[-3,-1] +append x +resize {$newwidth*2},100%,1,3,0,0 +exfusion: +cropwidth={w} +cropheight={h} +resize {w+(1024-w%1024)},{h+(1024-h%1024)},1,3,0,1 +repeat 10 +l[-1--4] ++l[0,1,2,3] ++resize[0] 50%,50%,1,3,2 ++resize[-1] 200%,200%,1,3,3 +sub[0,-1] ++resize[1] 50%,50%,1,3,2 ++resize[-1] 200%,200%,1,3,3 +sub[1,-1] ++resize[2] 50%,50%,1,3,2 ++resize[-1] 200%,200%,1,3,3 +sub[2,-1] ++resize[3] 50%,50%,1,3,2 ++resize[-1] 200%,200%,1,3,3 +sub[3,-1] +done ++iain_weightmap[0] 1,$1 ++iain_weightmap[1] 1,$1 ++iain_weightmap[2] 1,$1 ++iain_weightmap[3] 1,$1 ++add[-1,-2,-3,-4] +replace[-1,-2,-3,-4,-5] 0,0.0000000000001 +div[-2] [-1] +div[-3] [-1] +div[-4] [-1] +div[-5] [-1] +rm[-1] +mul[4,12] +mul[5,12] +mul[6,12] +mul[7,12] +add[4,5,6,7] +rm[0,1,2,3] +done +done +l[-1,-2,-3,-4] +parallel " ++iain_weightmap[0] 4,$1"," ++iain_weightmap[1] 4,$1"," ++iain_weightmap[2] 4,$1"," ++iain_weightmap[3] 4,$1" ++add[-1,-2,-3,-4] +replace[-1,-2,-3,-4,-5] 0,0.00000000000001 +div[-2] [-1] +div[-3] [-1] +div[-4] [-1] +div[-5] [-1] +rm[-1] +mul[0,4] +mul[1,4] +mul[2,4] +mul[3,4] +add +done +repeat $!-1 +resize[-1] {-2,w},{-2,h},1,3,3 +add[-1,-2] +done +crop 0,0,{$cropwidth-1},{$cropheight-1} ++l[0] +resize 5%,5%,1,3,2 +done +min={1,im} +max={1,iM} +c[0] $min,$max +keep[0] +n 0,255 +exfusion3: +cropwidth={w} +cropheight={h} +maxlevels={round(log2(min(w,h))+0.5)+$5} +size={2^$maxlevels} +resize {w+($size-w%$size)},{h+($size-h%$size)},1,3,0,1 +repeat $maxlevels +l[-1--3] ++l[0,1,2] ++resize[0] 50%,50%,1,3,2 ++resize[-1] 200%,200%,1,3,5 +sub[0,-1] ++resize[1] 50%,50%,1,3,2 ++resize[-1] 200%,200%,1,3,5 +sub[1,-1] ++resize[2] 50%,50%,1,3,2 ++resize[-1] 200%,200%,1,3,5 +sub[2,-1] +done +[0] +fx_ExposureWeightMap[-1] $1,$2,$3,$4,0 +[1] +fx_ExposureWeightMap[-1] $1,$2,$3,$4,0 +[2] +fx_ExposureWeightMap[-1] $1,$2,$3,$4,0 +rm[0,1,2] ++add[-1,-2,-3] +replace[-1,-2,-3,-4] 0,0.0000000000001 +div[-2] [-1] +div[-3] [-1] +div[-4] [-1] +rm[-1] +mul[0,6] +mul[1,6] +mul[2,6] +add[0,1,2] +done +done +l[-1,-2,-3] +if $6 +iain_fast_median_stack +else +[0] +[1] +[2] +parallel " +fx_ExposureWeightMap[-1] $1,$2,$3,$4,0"," +fx_ExposureWeightMap[-2] $1,$2,$3,$4,0"," +fx_ExposureWeightMap[-3] $1,$2,$3,$4,0" ++add[-1,-2,-3] +replace[-1,-2,-3,-4] 0,0.0000000000001 +div[-2] [-1] +div[-3] [-1] +div[-4] [-1] +rm[-1] +mul[0,3] +mul[1,3] +mul[2,3] +add +fi +done +repeat $!-1 +resize[-1] {-2,w},{-2,h},1,3,5 +add[-1,-2] +done +crop 0,0,{$cropwidth-1},{$cropheight-1} ++l[0] +resize 5%,5%,1,3,2 +done +min={1,im} +max={1,iM} +c[0] $min,$max +keep[0] +n 0,255 +exfusion5: +images=$! +cropwidth={w} +cropheight={h} +maxlevels={round(log2(min(w,h))+0.5)+0} +size={2^$maxlevels} +remove_opacity +resize {w+($size-w%$size)},{h+($size-h%$size)},1,3,0,1,0.5,0.5 ++l[0-{$images-1}] +repeat $! local[$>] +fx_ExposureWeightMap[0] $1,$2,$3,$4,0 +done done +done +l[-1--$images] ++add +replace 0,0.0000000000001 +repeat $!-1 +div[$<] [-1] +done +rm[-1] +done +repeat $maxlevels +l[-1--{$images*2}] ++l[0-{$images-1}] +repeat $! local[$>] ++resize[0] 50%,50%,1,3,2 +resize[-1] 200%,200%,1,3,5,0 +sub[0,-1] +done done +done +l[-1--{$images*2}] +repeat $images local[$>,{$>+$images}] +mul[-1] [-2] +done done +done +l[-1--$images] +add +done +move[-1] 0 +l[-1--{$images*2}] +repeat $! local[$>] +resize[0] 50%,50%,1,3,2 +done done +done +done +done +l[-1--{$images*2}] +if 1 +repeat $images local[$>,{$>+$images}] +mul[-1] [-2] +done done +keep[-1--$images] +add +else +keep[0--{$images-1}] +add +div $images +fi +done +repeat $!-1 +resize[-1] {-2,w},{-2,h},1,3,5,0 +add[-1,-2] +done +resize $cropwidth,$cropheight,1,3,0,1,0.5,0.5 +n 0,255 +mul 1000 +apply_curve 1,0,0,128000,{($6*1000)+128000},255000,255000 +mul 0.001 ++iain_fast_denoise $5,$5,1,{$5/100},0 +sub[1] [0] +mul[1] -1 ++add +c 0,255 +rm[1] +reverse +rgb2lch +split c +keep[0,4,5] +append c +lch2rgb +iain_fast_formula: +256,1 +fill[-1] x +local[1] +$1 +done +crv0={1,[0]} +crv1={1,[1]} +crv2={1,[2]} +crv3={1,[3]} +crv4={1,[4]} +crv5={1,[5]} +crv6={1,[6]} +crv7={1,[7]} +crv8={1,[8]} +crv9={1,[9]} +crv10={1,[10]} +crv11={1,[11]} +crv12={1,[12]} +crv13={1,[13]} +crv14={1,[14]} +crv15={1,[15]} +crv16={1,[16]} +crv17={1,[17]} +crv18={1,[18]} +crv19={1,[19]} +crv20={1,[20]} +crv21={1,[21]} +crv22={1,[22]} +crv23={1,[23]} +crv24={1,[24]} +crv25={1,[25]} +crv26={1,[26]} +crv27={1,[27]} +crv28={1,[28]} +crv29={1,[29]} +crv30={1,[30]} +crv31={1,[31]} +crv32={1,[32]} +crv33={1,[33]} +crv34={1,[34]} +crv35={1,[35]} +crv36={1,[36]} +crv37={1,[37]} +crv38={1,[38]} +crv39={1,[39]} +crv40={1,[40]} +crv41={1,[41]} +crv42={1,[42]} +crv43={1,[43]} +crv44={1,[44]} +crv45={1,[45]} +crv46={1,[46]} +crv47={1,[47]} +crv48={1,[48]} +crv49={1,[49]} +crv50={1,[50]} +crv51={1,[51]} +crv52={1,[52]} +crv53={1,[53]} +crv54={1,[54]} +crv55={1,[55]} +crv56={1,[56]} +crv57={1,[57]} +crv58={1,[58]} +crv59={1,[59]} +crv60={1,[60]} +crv61={1,[61]} +crv62={1,[62]} +crv63={1,[63]} +crv64={1,[64]} +crv65={1,[65]} +crv66={1,[66]} +crv67={1,[67]} +crv68={1,[68]} +crv69={1,[69]} +crv70={1,[70]} +crv71={1,[71]} +crv72={1,[72]} +crv73={1,[73]} +crv74={1,[74]} +crv75={1,[75]} +crv76={1,[76]} +crv77={1,[77]} +crv78={1,[78]} +crv79={1,[79]} +crv80={1,[80]} +crv81={1,[81]} +crv82={1,[82]} +crv83={1,[83]} +crv84={1,[84]} +crv85={1,[85]} +crv86={1,[86]} +crv87={1,[87]} +crv88={1,[88]} +crv89={1,[89]} +crv90={1,[90]} +crv91={1,[91]} +crv92={1,[92]} +crv93={1,[93]} +crv94={1,[94]} +crv95={1,[95]} +crv96={1,[96]} +crv97={1,[97]} +crv98={1,[98]} +crv99={1,[99]} +crv100={1,[100]} +crv101={1,[101]} +crv102={1,[102]} +crv103={1,[103]} +crv104={1,[104]} +crv105={1,[105]} +crv106={1,[106]} +crv107={1,[107]} +crv108={1,[108]} +crv109={1,[109]} +crv110={1,[110]} +crv111={1,[111]} +crv112={1,[112]} +crv113={1,[113]} +crv114={1,[114]} +crv115={1,[115]} +crv116={1,[116]} +crv117={1,[117]} +crv118={1,[118]} +crv119={1,[119]} +crv120={1,[120]} +crv121={1,[121]} +crv122={1,[122]} +crv123={1,[123]} +crv124={1,[124]} +crv125={1,[125]} +crv126={1,[126]} +crv127={1,[127]} +crv128={1,[128]} +crv129={1,[129]} +crv130={1,[130]} +crv131={1,[131]} +crv132={1,[132]} +crv133={1,[133]} +crv134={1,[134]} +crv135={1,[135]} +crv136={1,[136]} +crv137={1,[137]} +crv138={1,[138]} +crv139={1,[139]} +crv140={1,[140]} +crv141={1,[141]} +crv142={1,[142]} +crv143={1,[143]} +crv144={1,[144]} +crv145={1,[145]} +crv146={1,[146]} +crv147={1,[147]} +crv148={1,[148]} +crv149={1,[149]} +crv150={1,[150]} +crv151={1,[151]} +crv152={1,[152]} +crv153={1,[153]} +crv154={1,[154]} +crv155={1,[155]} +crv156={1,[156]} +crv157={1,[157]} +crv158={1,[158]} +crv159={1,[159]} +crv160={1,[160]} +crv161={1,[161]} +crv162={1,[162]} +crv163={1,[163]} +crv164={1,[164]} +crv165={1,[165]} +crv166={1,[166]} +crv167={1,[167]} +crv168={1,[168]} +crv169={1,[169]} +crv170={1,[170]} +crv171={1,[171]} +crv172={1,[172]} +crv173={1,[173]} +crv174={1,[174]} +crv175={1,[175]} +crv176={1,[176]} +crv177={1,[177]} +crv178={1,[178]} +crv179={1,[179]} +crv180={1,[180]} +crv181={1,[181]} +crv182={1,[182]} +crv183={1,[183]} +crv184={1,[184]} +crv185={1,[185]} +crv186={1,[186]} +crv187={1,[187]} +crv188={1,[188]} +crv189={1,[189]} +crv190={1,[190]} +crv191={1,[191]} +crv192={1,[192]} +crv193={1,[193]} +crv194={1,[194]} +crv195={1,[195]} +crv196={1,[196]} +crv197={1,[197]} +crv198={1,[198]} +crv199={1,[199]} +crv200={1,[200]} +crv201={1,[201]} +crv202={1,[202]} +crv203={1,[203]} +crv204={1,[204]} +crv205={1,[205]} +crv206={1,[206]} +crv207={1,[207]} +crv208={1,[208]} +crv209={1,[209]} +crv210={1,[210]} +crv211={1,[211]} +crv212={1,[212]} +crv213={1,[213]} +crv214={1,[214]} +crv215={1,[215]} +crv216={1,[216]} +crv217={1,[217]} +crv218={1,[218]} +crv219={1,[219]} +crv220={1,[220]} +crv221={1,[221]} +crv222={1,[222]} +crv223={1,[223]} +crv224={1,[224]} +crv225={1,[225]} +crv226={1,[226]} +crv227={1,[227]} +crv228={1,[228]} +crv229={1,[229]} +crv230={1,[230]} +crv231={1,[231]} +crv232={1,[232]} +crv233={1,[233]} +crv234={1,[234]} +crv235={1,[235]} +crv236={1,[236]} +crv237={1,[237]} +crv238={1,[238]} +crv239={1,[239]} +crv240={1,[240]} +crv241={1,[241]} +crv242={1,[242]} +crv243={1,[243]} +crv244={1,[244]} +crv245={1,[245]} +crv246={1,[246]} +crv247={1,[247]} +crv248={1,[248]} +crv249={1,[249]} +crv250={1,[250]} +crv251={1,[251]} +crv252={1,[252]} +crv253={1,[253]} +crv254={1,[254]} +crv255={1,[255]} +apply_curve[0] 0,0,$crv0,1,$crv1,2,$crv2,3,$crv3,4,$crv4,5,$crv5,6,$crv6,7,$crv7,8,$crv8,9,$crv9,10,$crv10,11,$crv11,12,$crv12,13,$crv13,14,$crv14,15,$crv15,16,$crv16,17,$crv17,18,$crv18,19,$crv19,20,$crv20,21,$crv21,22,$crv22,23,$crv23,24,$crv24,25,$crv25,26,$crv26,27,$crv27,28,$crv28,29,$crv29,30,$crv30,31,$crv31,32,$crv32,33,$crv33,34,$crv34,35,$crv35,36,$crv36,37,$crv37,38,$crv38,39,$crv39,40,$crv40,41,$crv41,42,$crv42,43,$crv43,44,$crv44,45,$crv45,46,$crv46,47,$crv47,48,$crv48,49,$crv49,50,$crv50,51,$crv51,52,$crv52,53,$crv53,54,$crv54,55,$crv55,56,$crv56,57,$crv57,58,$crv58,59,$crv59,60,$crv60,61,$crv61,62,$crv62,63,$crv63,64,$crv64,65,$crv65,66,$crv66,67,$crv67,68,$crv68,69,$crv69,70,$crv70,71,$crv71,72,$crv72,73,$crv73,74,$crv74,75,$crv75,76,$crv76,77,$crv77,78,$crv78,79,$crv79,80,$crv80,81,$crv81,82,$crv82,83,$crv83,84,$crv84,85,$crv85,86,$crv86,87,$crv87,88,$crv88,89,$crv89,90,$crv90,91,$crv91,92,$crv92,93,$crv93,94,$crv94,95,$crv95,96,$crv96,97,$crv97,98,$crv98,99,$crv99,100,$crv100,101,$crv101,102,$crv102,103,$crv103,104,$crv104,105,$crv105,106,$crv106,107,$crv107,108,$crv108,109,$crv109,110,$crv110,111,$crv111,112,$crv112,113,$crv113,114,$crv114,115,$crv115,116,$crv116,117,$crv117,118,$crv118,119,$crv119,120,$crv120,121,$crv121,122,$crv122,123,$crv123,124,$crv124,125,$crv125,126,$crv126,127,$crv127,128,$crv128,129,$crv129,130,$crv130,131,$crv131,132,$crv132,133,$crv133,134,$crv134,135,$crv135,136,$crv136,137,$crv137,138,$crv138,139,$crv139,140,$crv140,141,$crv141,142,$crv142,143,$crv143,144,$crv144,145,$crv145,146,$crv146,147,$crv147,148,$crv148,149,$crv149,150,$crv150,151,$crv151,152,$crv152,153,$crv153,154,$crv154,155,$crv155,156,$crv156,157,$crv157,158,$crv158,159,$crv159,160,$crv160,161,$crv161,162,$crv162,163,$crv163,164,$crv164,165,$crv165,166,$crv166,167,$crv167,168,$crv168,169,$crv169,170,$crv170,171,$crv171,172,$crv172,173,$crv173,174,$crv174,175,$crv175,176,$crv176,177,$crv177,178,$crv178,179,$crv179,180,$crv180,181,$crv181,182,$crv182,183,$crv183,184,$crv184,185,$crv185,186,$crv186,187,$crv187,188,$crv188,189,$crv189,190,$crv190,191,$crv191,192,$crv192,193,$crv193,194,$crv194,195,$crv195,196,$crv196,197,$crv197,198,$crv198,199,$crv199,200,$crv200,201,$crv201,202,$crv202,203,$crv203,204,$crv204,205,$crv205,206,$crv206,207,$crv207,208,$crv208,209,$crv209,210,$crv210,211,$crv211,212,$crv212,213,$crv213,214,$crv214,215,$crv215,216,$crv216,217,$crv217,218,$crv218,219,$crv219,220,$crv220,221,$crv221,222,$crv222,223,$crv223,224,$crv224,225,$crv225,226,$crv226,227,$crv227,228,$crv228,229,$crv229,230,$crv230,231,$crv231,232,$crv232,233,$crv233,234,$crv234,235,$crv235,236,$crv236,237,$crv237,238,$crv238,239,$crv239,240,$crv240,241,$crv241,242,$crv242,243,$crv243,244,$crv244,245,$crv245,246,$crv246,247,$crv247,248,$crv248,249,$crv249,250,$crv250,251,$crv251,252,$crv252,253,$crv253,254,$crv254,255,$crv255 +keep[0] +iain_fast_median_stack: +if $!>2 +if $!%2!=0 +repeat $!/2 +repeat $!-1 +l[$>,{$>+1}] ++max[0,1] +min[0,1] +done +done +progress {($>/$!)*200} +done +keep[{round(($!/2)-.5)}] +else +repeat ($!/2)+1 +repeat $!-1 +l[$>,{$>+1}] ++max[0,1] +min[0,1] +done +done +progress {($>/$!)*200} +done +keep[{round(($!/2)-.5)},{round({$!/2}-.5)-1}] +add +mul .5 +fi +elif $!==2 +add +mul .5 +elif $!==1 +fi +iain_median_3_stack: +iain_fast_median_stack +iain_median_4_stack: +iain_fast_median_stack +iain_median_5_stack: +iain_fast_median_stack +fft_tile_fft: ++fftpolar[0] ++threshold[1] $1 +set[-1] 1,50%,50% +mul[1] [-1] ++ifftpolar[1,2] +keep[-1] +fft_tile_clean: +tc={round(w/$2)} tr={round(h/$2)} +split_tiles $tc,$tr +repeat $! local[$>] +fft_tile_fft[0--1] $1 +done done +append_tiles $tc,$tr +c 0,255 +fft_tile: ++resize[0] {w+$2},{h+$2},1,1,0,1,1,1 +resize[-1] {w+$2},{h+$2},1,1,0,1,0,0 +fft_tile_clean[-1] $1,$2 +crop[-1] $2,$2,{w-$2-1},{h-$2-1} +if $3==0 +push={round($2*1.5)} +pull={$2-$push} ++resize[0] {w+$push},{h+$2},1,1,0,1,1,1 +resize[-1] {w+$pull},{h+$2},1,1,0,1,0,0 +fft_tile_clean[-1] $1,$2 +crop[-1] {$push},{$2},{w-$pull-1},{h-($2)-1} ++resize[0] {w+$2},{h+$push},1,1,0,1,1,1 +resize[-1] {w+$2},{h+$pull},1,1,0,1,0,0 +fft_tile_clean[-1] $1,$2 +crop[-1] $2,{$push},{w-$2-1},{h-$pull-1} +dia1={round($2/3)} +dia2={$2-$dia1} ++resize[0] {w+$dia1},{h+$dia1},1,1,0,1,1,1 +resize[-1] {w+$dia2},{h+$dia2},1,1,0,1,0,0 +fft_tile_clean[-1] $1,$2 +crop[-1] {$dia1},{$dia1},{w-$dia2-1},{h-$dia2-1} ++resize[0] {w+$dia2},{h+$dia2},1,1,0,1,1,1 +resize[-1] {w+$dia1},{h+$dia1},1,1,0,1,0,0 +fft_tile_clean[-1] $1,$2 +crop[-1] {$dia2},{$dia2},{w-$dia1-1},{h-$dia1-1} +fi +remove[0] +if $3==0 +blend_median +fi +fft_tile_preview: +fft_tile $1,$2,$3 +n 0,255 +fill_holes: +ac " +if $5==0 +if $6==1 ++dilate[-1] $1 +erode[-1] $2 +compose_lighten +dilate[-1] $3 +erode[-1] $3 +fi +if $6==0 ++dilate_circ[-1] $1 +erode_circ[-1] $2 +compose_lighten +dilate_circ[-1] $3 +erode_circ[-1] $3 +fi +fi +c 0,255 +if $5==1 +if $6==1 ++erode[-1] $1 +dilate[-1] $2 +compose_darken +erode[-1] $3 +dilate[-1] $3 +fi +if $6==0 ++erode_circ[-1] $1 +dilate_circ[-1] $2 +compose_darken +erode_circ[-1] $3 +dilate_circ[-1] $3 +fi +fi +c 0,255 +",$4 +fill_holes_preview: +fill_holes $1,$2,$3,$4,$5,$6 +iain_descreen2: +channels 0 +fftpolar ++blur[0] $1% +sub[-1] [0] +gt[-1] $2 +circle[-1] 50%,50%,$3%,1,1 +mul[0] [-1] +keep[0,1] +ifftpolar +c 0,255 +iain_halftone_shapes: +warp_it=$7 +remove_opacity +scale=$1 +luminance +if $4==1 +resize 400%,400%,1,1,3 +scale={$scale*4} +fi +if $3==0 +sx1=353 +sx2=515 +sx3=677 +sx4=1000 +sx5=1323 +sx6=1485 +sx7=1647 +sx8=1485 +sx9=1323 +sx10=1000 +sx11=677 +sx12=515 +sy1=1000 +sy2=1280 +sy3=1560 +sy4=1560 +sy5=1560 +sy6=1280 +sy7=1000 +sy8=720 +sy9=440 +sy10=440 +sy11=440 +sy12=720 +level=19 +luminance ++l +rm +2000,2000,1,1,0 +repeat 19 +polygon 12,$sx1,$sy1,$sx2,$sy2,$sx3,$sy3,$sx4,$sy4,$sx5,$sy5,$sx6,$sy6,$sx7,$sy7,$sx8,$sy8,$sx9,$sy9,$sx10,$sy10,$sx11,$sy11,$sx12,$sy12,1,$level +sy3={$sy3-(78/16)} +sy5={$sy5-(78/16)} +sy9={$sy9+(78/16)} +sy11={$sy11+(78/16)} +sx1={$sx1+(90/16)} +sx3={$sx3+(45/16)} +sx5={$sx5-(45/16)} +sx7={$sx7-(90/16)} +sx9={$sx9-(45/16)} +sx11={$sx11+(45/16)} +level={$level+10} +done +radius={560} +level=209 +repeat 57 +circle 50%,50%,$radius,1,$level +radius={$radius-10} +level={$level+10} +done +n 0,255 ++shift[0] 972,560,0,0 ++shift[0] 972,-560,0,0 ++shift[0] -972,560,0,0 ++shift[0] -972,-560,0,0 +add +crop 29,440,1972,1560 +done +resize[1] 194,112,1,1,2 +equalize[1] 65555 +resize[1] $scale%,$scale%,1,1,3 +if $2==1 +negate[1] +fi +fi +if $3==1 +sx1=50 +sx2=194 +sx3=281 +sx4=511 +sx5=742 +sx6=829 +sx7=972 +sx8=829 +sx9=742 +sx10=511 +sx11=281 +sx12=192 +sy1=450 +sy2=633 +sy3=849 +sy4=817 +sy5=849 +sy6=633 +sy7=450 +sy8=267 +sy9=50 +sy10=83 +sy11=50 +sy12=267 +level=10 +luminance ++l +rm +2000,2000,1,1,0 +repeat 128 +polygon 12,$sx1,$sy1,$sx2,$sy2,$sx3,$sy3,$sx4,$sy4,$sx5,$sy5,$sx6,$sy6,$sx7,$sy7,$sx8,$sy8,$sx9,$sy9,$sx10,$sy10,$sx11,$sy11,$sx12,$sy12,1,$level +sx2={$sx2+(40/16)} +sx6={$sx6-(40/16)} +sx8={$sx8-(40/16)} +sx12={$sx12+(40/16)} +sy2={$sy2-(23/16)} +sy4={$sy4-(47/16)} +sy6={$sy6-(23/16)} +sy8={$sy8+(23/16)} +sy10={$sy10+(47/16)} +sy12={$sy12+(23/16)} +level={$level+12} +done +n 0,255 +resize 200,200,1,1,3 ++shift[0] -69,-40,0,0 ++shift[0] -69,40,0,0 ++shift[0] 69,-40,0,0 ++shift[0] 69,40,0,0 +add +crop 5,5,142,84 +done +resize[1] 194,112,1,1,2 +equalize[1] 65555 +resize[1] $scale%,$scale%,1,1,3 +if $2==1 +negate[1] +fi +fi +if $3==2 +sx1=161 +sx2=1000 +sx3=1839 +sy1=273 +sy2=1727 +sy3=273 +level=10 +luminance ++l +rm +2000,2000,1,1,0 +repeat 375 +polygon 3,$sx1,$sy1,$sx2,$sy2,$sx3,$sy3,1,$level +sx1={$sx1+2.21} +sx3={$sx3-2.21} +sy1={$sy1+1.28} +sy2={$sy2-2.56} +sy3={$sy3+1.28} +level={$level+1} +done ++rotate[0] 180 ++shift[1] {840+2} +shift[1] -840 +add +crop 160,{216+56},1842,1727 +n 0,255 +done +equalize[1] 256 +resize[1] 168,145,1,1,2 +resize[1] $scale%,$scale%,1,1,3 +if $2==1 +negate[1] +fi +fi +if $3==3 +luminance ++l +rm +l +190,190,1,1,0 +circle 50,50,50,1,10 +circle 140,50,50,1,10 +polygon 5,10,80,50,50,140,50,180,80,95,190,1,10 +resize[-1] {0,w+2},{0,h+2},1,1,0,0,0.5,0.5 ++resize[0] 95%,95%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 90%,90%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 85%,85%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 75%,75%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 65%,65%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 55%,55%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 50%,50%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 45%,45%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 40%,40%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 35%,35%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 30%,30%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 25%,25%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 20%,20%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 15%,15%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 10%,10%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 5%,5%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 +add +done +[0] +append y +resize 200%,100%,1,1,0,0,0.5,0.5 ++shift[0] 160,100,0,0 ++shift[0] -160,100,0,0 +add +crop 30,190,350,100% +n 0,255 +done +resize[-1] $scale,$scale,1,1,2 +if $2==1 +negate[1] +fi +fi +width={w} +height={h} +w_tiles={round({0,w}/$width)} +h_tiles={round({0,h}/$height)} +total_tiles=$h_tiles*$w_tiles +[-1]x{$total_tiles-1} +append_tiles[1--1] $w_tiles,$h_tiles +equalize[-1] 256 +if $warp_it +rotate[-1] $5,1,2,50%,50% +twirl[-1] $6,.5,.5,2 +fi +blend alpha,0.5,1 +gt 128 +mul 255 +if $4==1 +resize 25%,25%,1,1,3 +fi +iain_hearttone: +if $2>0 ++iain_fast_denoise[0] $2,0,1,0,0 +sub[1] [0] +mul[1] -1 +add +n 0,255 +fi +luminance ++l +rm +l +190,190,1,1,0 +circle 50,50,50,1,10 +circle 140,50,50,1,10 +polygon 5,10,80,50,50,140,50,180,80,95,190,1,10 +resize[-1] {0,w+2},{0,h+2},1,1,0,0,0.5,0.5 ++resize[0] 95%,95%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 90%,90%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 85%,85%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 75%,75%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 65%,65%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 55%,55%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 50%,50%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 45%,45%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 40%,40%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 35%,35%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 30%,30%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 25%,25%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 20%,20%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 15%,15%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 10%,10%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 ++resize[0] 5%,5%,1,1,2 +resize[-1] {0,w},{0,h},1,1,0,0,0.5,0.5 +add +done +[0] +append y +resize 200%,100%,1,1,0,0,0.5,0.5 ++shift[0] 160,100,0,0 ++shift[0] -160,100,0,0 +add +crop 30,190,350,100% +n 0,255 +done +resize[-1] $1,$1,1,1,2 +width={w} +height={h} +w_tiles={0,round(w/$width)} +h_tiles={0,round(h/$height)} +total_tiles=$h_tiles*$w_tiles +[-1]x{$total_tiles-1} +append_tiles[1--1] $w_tiles,$h_tiles +equalize[-1] 256 +blend alpha,0.5,1 +gt 128 +mul 255 +iain_2x: +repeat $! local[$>] +resize[0] 200%,200%,1,3,4 +split c +repeat $! local[$>] ++l[0] +(0,0,0.5;0,1,0;0.5,0,0) +convolve[0] [1] +remove[1] +done ++l[0] +(0.5,0,0;0,1,0;0,0,0.5) +convolve[0] [1] +remove[1] +done +remove[0] ++l[0] +(0,0,0.5;0,-1,0;0.5,0,0) +convolve[0] [1] +remove[1] +abs +done ++l[1] +(0.5,0,0;0,-1,0;0,0,0.5) +convolve[0] [1] +remove[1] +abs +done +dilate[-1,-2] 3 +sub[-2] [-1] +remove[-1] +l[-1] ++lt[0] 0 ++gt[0] 0 +fill[0] 0 +sub[0] [1] +add[0] [-1] +keep[0] +add[0] 1 +mul[0] 127.5 +done +append[1,2] c +blend alpha,1,0 ++l[0] +(0.5,1,0.5) +convolve[0] [1] +remove[1] +done ++l[0] +(0.5;1;0.5) +convolve[0] [1] +remove[1] +done +remove[0] ++l[0] +(0.5,-1,0.5) +convolve[0] [1] +remove[1] +abs +done ++l[1] +(0.5;-1;0.5) +convolve[0] [1] +remove[1] +abs +done +blur[-1,-2] 3 +sub[-2] [-1] +remove[-1] +l[-1] ++lt[0] 0 ++gt[0] 0 +fill[0] 0 +sub[0] [1] +add[0] [-1] +keep[0] +add[0] 1 +mul[0] 127.5 +done +append[1,2] c +blend alpha,1,0 +done done +append c +done done +iain_demosiac: +to_rgb +add 1000 +rgb2bayer $1,1 +replace 0,0.0000000001 ++l[0] +replace 0,0.000000001 ++l[0] +to_rgb ++split[0] c +split[0] c +name[0] red +name[1] green +name[2] blue +name[-3] redblur +name[-2] greenblur +name[-1] blueblur +(0.25,.5,0.5,.5,0.25) +convolve[redblur] [-1] +convolve[blueblur] [-1] +remove[-1] +(1;1) +convolve[redblur] [-1] +convolve[blueblur] [-1] +remove[-1] +(0.5,1,0.5) +convolve[greenblur] [-1] +remove[-1] ++div[greenblur] [redblur] ++div[greenblur] [blueblur] +name[-1] bluemul +name[-2] redmul +remove[redblur,greenblur,blueblur] +mul[red] [redmul] +mul[blue] [bluemul] +keep[red,green,blue] +add +c -100000000,100000000 +done +l[0] +to_rgb ++split[0] c +split[0] c +name[0] red +name[1] green +name[2] blue +name[-3] redblur +name[-2] greenblur +name[-1] blueblur +(0.25;.5;0.5;.5;0.25) +convolve[redblur] [-1] +convolve[blueblur] [-1] +remove[-1] +(1,1) +convolve[redblur] [-1] +convolve[blueblur] [-1] +remove[-1] +(0.5;1;0.5) +convolve[greenblur] [-1] +remove[-1] ++div[greenblur] [redblur] ++div[greenblur] [blueblur] +name[-1] bluemul +name[-2] redmul +remove[redblur,greenblur,blueblur] +mul[red] [redmul] +mul[blue] [bluemul] +keep[red,green,blue] +add +c -100000000,100000000 +done +(1,-2,1) ++convolve[1] [-1] +abs[-1] +remove[-2] +(1;-2;1) ++convolve[0] [-1] +abs[-1] +remove[-2] ++add[-2] [-1] +div[-2] [-1] +remove[-1,-3] +lt[-1] 0.5 +mul[-1] 255 +blur[-1] 1 +append[0,-1] c +blend alpha,1,1 +done +split[0] c +remove[1] +reverse[1,2] +(0.25,0.5,0.25;0.5,1,0.5;0.25,0.5,0.25) +convolve[0] [-1] +convolve[2] [-1] +remove[-1] ++resize 50%,50%,{d},{s},2 +sub[-1] [-2] +sub[-3] [-2] +remove[-2] +resize[-1,-2] {0,w},{0,h},{d},{s},3 +remove[0,2] +add[1] [0] +add[2] [0] +reverse[0,1] +append c +sub 1000 +c 0,255 +iain_denoise_2019_beta3_preview: +images={$!} +if $images>2 +k[0] +fill 128 +text "too many input images",12,12,50,1,0 +text "too many input images",10,10,50,1,255 +quit +fi +if $images==1 +[0] +fi +if $15 ++l[-1] +mid_tone_offset={$4/-5} +luminance +add {$mid_tone_offset*255} +resize 25%,25%,100%,100%,2 +median 5 +line 0,0,0,100%,1,128 +line 0,0,100%,0,1,128 +line 0,100%,100%,100%,1,128 +line 100%,0,100%,100%,1,128 ++gt[0] 85 ++gt[0] 170 +laplacian[1,2] +l[1] ++gt[0] 0 +lt[0] 0 +replace[0] 1,100 +replace[1] 1,1 +max[0,1] +done +l[2] ++gt[0] 0 +lt[0] 0 +replace[0] 1,255 +replace[1] 1,150 +max[0,1] +done +max[-1,-2] ++neq[-1] 0 +replace[-1] 1,255 +append[-1,-2] c +scale2x[-1] +scale2x[-1] +k[-1] +done +fi +l[0,1] +if $14==0 +fine=$8 +mid=$9 +large=$10 ++iain_denoise_2019_beta3 $1,$2,$3,$4,$5,$6,$7,$fine,$mid,$large,$11,$12,$13,$14,$15 +k[0,-1] +sub +noise_amp={_round((128/(max(abs(im),iM))),0.1)} +mul $noise_amp +add 128 +c 0,255 +elif $14==1 +fine=$8 +mid=0 +large=0 ++iain_denoise_2019_beta3 $1,$2,$3,$4,$5,$6,$7,$fine,$mid,$large,$11,$12,$13,$14,$15$15 +k[0,-1] +sub +noise_amp={_round((128/(max(abs(im),iM))),0.1)} +mul $noise_amp +add 128 +c 0,255 +elif $14==2 +fine=0 +mid=$9 +large=0 ++iain_denoise_2019_beta3 $1,$2,$3,$4,$5,$6,$7,$fine,$mid,$large,$11,$12,$13,$14,$15 +k[0,-1] +sub +noise_amp={_round((128/(max(abs(im),iM))),0.1)} +mul $noise_amp +add 128 +c 0,255 +elif $14==3 +fine=0 +mid=0 +large=$10 ++iain_denoise_2019_beta3 $1,$2,$3,$4,$5,$6,$7,$fine,$mid,$large,$11,$12,$13,$14,$15 +k[0,-1] +sub +noise_amp={_round((128/(max(abs(im),iM))),0.1)} +mul $noise_amp +add 128 +c 0,255 +elif $14==4 +iain_denoise_2019_beta3 $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15 +fi +done +blend alpha +text_size=13 +if $images==1 +guide="Internal Guide" +bg_colour=255 +text_colour=0 +else +guide="External Guide" +bg_colour=0 +text_colour=255 +fi +if $14!=4 +box_size=100% +else +box_size=100% +fi +rectangle 0,0,$box_size,20,0.5,$bg_colour +text $guide,0.1~,4,$text_size,1,$text_colour +if $14!=4 +rectangle {(w/2)-127*($noise_amp/2)},{h-20},{(w/2)+127*($noise_amp/2)},100%,0.5,$bg_colour +text Noise\ amplified\ $noise_amp\ times,0.5~,{h-16},$text_size,1,$text_colour +fi +guide_recovery=0 +if $12==0 +do_recovery=0 +elif $12==1 +do_recovery=1 +slow=0 +recover_text="Fast Recovery" +elif $12==2 +do_recovery=1 +slow=1 +recover_text="Slow Recovery" +elif $12==3 +do_recovery=1 +slow=1 +guide_recovery=1 +recover_text="Guide Recovery" +fi +if $12!=0 +text $recover_text,0.9~,4,$text_size,1,$text_colour +fi +iain_denoise_2019_beta3: +images={$!} +if $images>2 +quit +fi +gamma=$1 +shadow=$2 +light=$3 +mid_tone_offset={$4/5} +chroma=$5 +external_guide_strength=$6 +soften_guide=$7 +fine=$8 +mid={$9/3} +large={$10/9} +patch_size=3 +patch_size_b=3 +lookup_size={($11*2)+1} +mid_lookup_size=$11 +large_lookup_size=$11 +smoothness_fine=0 +smoothness=0 +fast_approx=0 +std_deviation_s=10 +recover=$13 +guide_recovery=0 +slow=0 +if $12==0 +do_recovery=0 +elif $12==1 +do_recovery=1 +elif $12==2 +do_recovery=1 +slow=1 +elif $12==3 +do_recovery=1 +slow=1 +guide_recovery=1 +fi +remove_opacity +external_guide=1 +if $!==1 +[0] +external_guide=0 +fi +if $guide_recovery==0 +if $external_guide_strength<1 +[0] +mul[1] $external_guide_strength +mul[2] {1-$external_guide_strength} +add[1,2] +fi +l[-1] +if $chroma>0 +redmul=.299 +greenmul=.587 +bluemul=.114 ++split[0] c +mul[1] $redmul mul[2] $greenmul mul[3] $bluemul +add[1-3] +if $chroma==1 +keep[1] +else +split[0] c name[0] red name[1] green name[2] blue name[3] luma ++sub[blue] [luma] name[-1] cb ++sub[red] [luma] name[-1] cr +keep[luma,cb,cr] +mul[cb,cr] {1-$chroma} ++add[cb] [luma] name[-1] blueout ++add[cr] [luma] name[-1] redout +remove[1,2] ++mul[redout] $redmul +mul[blueout] $bluemul +sub[luma] [-1] sub[luma] [-2] +div[luma] $greenmul +remove[-1,-2] +move[2] 0 +append c +fi +fi +sub 127 +div 128 +if $gamma!=1 +add 1 +pow $gamma +sub 1 +fi +sub $mid_tone_offset ++c[0] 0,100 +c[0] -100,0 +l[0] +if $shadow>0 +fill i+($shadow*abs(i)*0.75)^2 +elif $shadow<0 +fill i-(abs(i)^3)*(abs($shadow)) +fi +done +l[1] +if $light>0 +div[0] {(2^$gamma)-1} +fill i-($light*abs(i)*0.75)^2 +mul[0] {(2^$gamma)-1} +elif $light<0 +div[0] {(2^$gamma)-1} +fill i+(abs(i)^3)*(abs($light)) +mul[0] {(2^$gamma)-1} +fi +done +add +add $mid_tone_offset +mul 128 +add 127 +if $soften_guide +l[0] +(0,0.2,0;0.2,0.2,0.2;0,0.2,0) +convolve[0] [1] +rm[1] +done +fi +done ++l[0,1] +levels=2 +size={3^$levels} +cropwidth={w} +cropheight={h} +to_rgb +resize {w+($size-w%$size)},{h+($size-h%$size)},{d},{s},0,1 +if $fine>0 +denoise[0] [1],$std_deviation_s,$fine,$patch_size,$lookup_size,$smoothness_fine,$fast_approx +fi ++resize[0,1] 33.33333%,33.33333%,{d},{s},2 +rm[1] ++iain_resize_x3[-2] +blur[-1] 1 +sub[0,-1] +if $mid>0 +denoise[1] [2],$std_deviation_s,$mid,$patch_size,$mid_lookup_size,$smoothness_fine,$fast_approx +fi +l[1,2] ++resize[0,1] 33.33333%,33.33333%,{-1,d},{-1,s},2 +rm[1] ++iain_resize_x3[-2] +blur[-1] 1 +sub[0,-1] +if $large>0 +denoise[1] [2],$std_deviation_s,$large,$patch_size,$large_lookup_size,$smoothness_fine,$fast_approx +fi +done +rm[-1] +repeat 2 +iain_resize_x3[-1] +blur[-1] 1 +add[-1,-2] +done +crop 0,0,{$cropwidth-1},{$cropheight-1} +c 0,255 +done +rm[1] +fi +if $do_recovery +sub[0] [1] +l[0] split c mul[0] 0.2126 mul[1] 0.7125 mul[2] 0.0722 add done ++blur[0] 10 +sub[0] [-1] +rm[-1] ++abs[0] +noise={-1,ia} +blur[-1] 3 +bilateral[-1] [1],20,$noise +blur[-1] 2 +fill[-1] 5/i +mul[0] [-1] +l[0] +add 128 +resize[0] {w+256},{h+256},1,1,0,2,0.5,0.5 +if $slow +iain_tiletest4_stack[0] {2-$recover},0.5 +else +iain_tiletest4[0] {2-$recover},0.5 +fi +crop[0] 128,128,{w-129},{h-129} +sub 128 ++blur 10 +sub +done +div[0] [-1] +rm[-1] +to_rgb[0] +add +else +k[-1] +fi +c 0,255 +time=$| +name name($time) +iain_resize_x3: +resize[0] {(w*3)-2},{(h*3)-2},{d},{s},5,0 +resize[0] {w+2},{h+2},{d},{s},0,1,0.5,0.5 +iain_tiletest4_stack: +resize {w+128},{h+128},1,1,0,2,0.5,0.5 +offset1x=24 +offset1y=4 +offset2x=-10 +offset2y=21 +offset3x=27 +offset3y=27 +offset4x=6 +offset4y=38 ++shift[0] $offset1x,$offset1y,0,0 ++shift[0] $offset2x,$offset2y,0,0 ++shift[0] $offset3x,$offset3y,0,0 ++shift[0] $offset4x,$offset4y,0,0 +iain_tiletest4[0] $1,$2 +iain_tiletest4[1] $1,$2 +iain_tiletest4[2] $1,$2 +iain_tiletest4[3] $1,$2 +iain_tiletest4[4] $1,$2 +shift[1] {$offset1x*-1},{$offset1y*-1},0,0 +shift[2] {$offset2x*-1},{$offset2y*-1},0,0 +shift[3] {$offset3x*-1},{$offset3y*-1},0,0 +shift[4] {$offset4x*-1},{$offset4y*-1},0,0 +blend_median +crop 64,64,{w-65},{h-65} +iain_tiletest4: +remove_opacity +luminance +cropwidth={w} +cropheight={h} +size={64} +resize {w+($size-w%$size)},{h+($size-h%$size)},{d},{s},0,1 +tilew={w/64} +tileh={h/64} +split_tiles $tilew,$tileh +apply_parallel " +fftpolar +append z +k[0] +" ++blend_median +mul[-1] $1 +repeat $!-1 +l[$>,-1] +split z ++circle[0] 50%,50%,1,1,0 +blur[-1] 1 +mul[-1] {$1*$2} +lt[-1] [2] +circle[-1] 50%,50%,1,1,0 +mul[-1] [2] +sub[0] [-1] +c[0] 0,999999999999999 +k[0,1,2,3] +append[0,1] z +append[1,2] z +done +done +rm[-1] +apply_parallel " +split z +ifftpolar +" +append_tiles $tilew,$tileh +c 0,255 +crop 0,0,{$cropwidth-1},{$cropheight-1} +iain_remove_pattern: +remove_opacity ++l ++blur[0] $1 +guided[0] [1],$2,$3 +k[0] +done +if $4 +sub[0] [1] +add[0] 128 +iain_remove_pattern_tiles_stack[0] $5,$5,$6,1,$7 +sub[0] 128 +to_rgb +add +else +k[-1] +fi +c 0,255 +iain_remove_pattern_preview: +if $8==0 +iain_remove_pattern[0] $1,$2,$3,$4,$5,$6,$7 +elif $8==1 +to_rgb display_fft +elif $8==2 +iain_remove_pattern[0] $1,$2,$3,$4,$5,$6,$7 +to_rgb display_fft +elif $8==3 ++iain_remove_pattern[0] $1,$2,$3,$4,$5,$6,$7 +sub +to_rgb display_fft +fi +iain_remove_pattern_tiles_stack: +offset={round($3/3)} +remove_opacity +luminance ++l +if $5>0 ++shift[0] $offset,$offset,0,0 +iain_remove_pattern_tiles[-1] $1,$2,$3 +shift[-1] {$offset*-1},{$offset*-1},0,0,1 ++shift[0] {$offset*-1},{$offset*-1},0,0 +iain_remove_pattern_tiles[-1] $1,$2,$3 +shift[-1] $offset,$offset,0,0,1 +fi +if $5>1 ++shift[0] $offset,0,0,0 +iain_remove_pattern_tiles[-1] $1,$2,$3 +shift[-1] {$offset*-1},0,0,0,1 ++shift[0] 0,$offset,0,0 +iain_remove_pattern_tiles[-1] $1,$2,$3 +shift[-1] 0,{$offset*-1},0,0,1 +fi +if $5>2 ++shift[0] {$offset*-1},0,0,0 +iain_remove_pattern_tiles[-1] $1,$2,$3 +shift[-1] $offset,0,0,0,1 ++shift[0] 0,{$offset*-1},0,0 +iain_remove_pattern_tiles[-1] $1,$2,$3 +shift[-1] 0,$offset,0,0,1 +fi +iain_remove_pattern_tiles[0] $1,$2,$3 +blend_median +done +if $4 +sub +add 128 +else +k[1] +fi +iain_remove_pattern_tiles: +l[0] +size=$3 +offset={$size/3} +cropwidth1={w} +cropheight1={h} +resize[0] {w+($size-w%$size)},{h+($size-h%$size)},{d},{s},0,0 +tc={round(w/$size)} tr={round(h/$size)} +split_tiles $tc,$tr +apply_parallel "iain_remove_pattern_fft $1,$2,$3" +append_tiles $tc,$tr +crop 0,0,{$cropwidth1-1},{$cropheight1-1} +done +iain_remove_pattern_fft: +luminance +fftpolar ++log[0] +blur[-1] 10 +exp[-1] ++l[-1] +fill[0] $1 +circle[-1] 50%,50%,14%,1,$2 +done +mul[-2,-1] ++lt[-1] [0] +circle[-1] 50%,50%,{w*.005},1,1 +mul[0] [-1] +k[0,1] +ifftpolar +c 0,255 +iain_star_burst: +repeat $! l[$>] split_opacity l[0] +width={w} +height={h} +resize {w+($2*2)},{h+($2*2)},1,3,0,0,0.5,0.5 ++gt[0] $1 +mul[1] 255 +skeleton[1] 0 +if $6 +rgb2hsl +split c +[0] +reverse[3,-1] +rm[-1] +append[0,1,2] c +append[1,2,3] c +hsl2rgb +fi +mul[1] 255 +l[1] +{$2*5},{$2*5},1,1,0 +set[-1] 1,50%,50% +l[-1] +repeat $5 ++blur_linear[0] $2,.5,{$4+((180/$5)*($>+1))} +done +rm[0] +add +done +convolve_fft[0] [1] +done +mul[1] {1/$5} +mul[1] {$3*10} +if $7 +keep[1] +else +max +fi +c 0,255 +crop {$2},{$2},{$width+$2-1},{$height+$2-1} +done a c done done +iain_unindex: +amplitude=$1 +sharpness=.3 +anisotropy=1 +gradient_smoothness=.6 +tensor_smoothness=1 +spatial_precision=0.8 +angular_precision=30 +value_precision=2 +interpolation=0 +fast_approx=1 +to_rgb ++smooth[0] $amplitude,$sharpness,$anisotropy,$gradient_smoothness,$tensor_smoothness,$spatial_precision,$angular_precision,$value_precision,$interpolation,$fast_approx ++luminance[-1] +laplacian[-1] +abs[-1] +blur[-1] .5 +threshold[-1] $2 +mul[-1] -1 +add[-1] 1 +mul[-1] 255 +append[1,2] c +blend alpha,1,0 +keep[-1] +iain_unindex_preview: +iain_unindex $1,$2 +if $3==1 +topleftx={$4-25} +toplefty={$5-25} +botleftx={$4+25} +botlefty={$5+25} +crop $topleftx%,$toplefty%,$botleftx%,$botlefty% +fi +iain_weightmap: +split c +max +255,1 +set[-1] 255,128,0 +blur[-1] $2 +n[-1] 0,255 ++map[0] [1] +rm[1] +laplacian[0] +mul[0] $1 +abs[0] +add +iain_iains_nr: +repeat $! l[$>] nm={0,n} split_opacity l[0] +lnr=$1 +cnr=$2 +despek=$3 +highs=$4 +shadow=$5 +recovery_choice=$6 +detail_recovery={5000-($7*500)} +fast=1 +fine_det=$8 +med_det=$9 +large_det=$10 +det_emphasis=$11 +sharp=$12 +to_rgb +apply_gamma {1/1.3} +mul 900 +apply_curve 1,0,0,32000,{32000-$shadow},160000,{160000-$shadow},256000,{256000-$highs-$shadow} +div 2000 +iain_rgb2ycbcr +split c +if $lnr>0 +if $recovery_choice==0 +iains_nr_patchb[0] 10,$lnr,3,3,0,$fast,1,$despek,.5,.4,.2,0,1,1,2,0 +unsharp[0] .7,$sharp,0 +fi +if $recovery_choice==1 ++iains_nr_patchb[0] 10,$lnr,3,3,0,$fast,1,$despek,.5,.4,.2,0,1,1,2,0 ++sub[0] [-1] +add[-1] {128} +remove[0] +unsharp[2] .7,$sharp,0 +resize[-1] {w+48},{h+48},{d},{s},0,0,0,0 +resize[-1] {w+48},{h+48},{d},{s},0,0,1,1 +rectangle[-1] 0,0,100%,48,1,128 +rectangle[-1] 0,0,48,100%,1,128 +rectangle[-1] 0,100%,100%,{h-48},1,128 +rectangle[-1] {w-48},100%,100%,0,1,128 +iains_nr_fft_tile3[-1] {$detail_recovery},48,0,$fine_det,$med_det,$large_det,1,3 +crop[-1] 48,48,{w-49},{h-49} +sub[-1] {128} +mul[-1] $det_emphasis +add[2] [-1] +remove[-1] +move[-1] 0 +fi +if $recovery_choice==2 ++iains_nr_patchb[0] 10,$lnr,3,3,0,$fast,1,$despek,.5,.4,.2,0,1,1,2,0 ++sub[0] [-1] +add[-1] {128} +remove[0] +unsharp[2] .7,$sharp,0 +resize[-1] {w+48},{h+48},{d},{s},0,0,0,0 +resize[-1] {w+48},{h+48},{d},{s},0,0,1,1 +rectangle[-1] 0,0,100%,48,1,128 +rectangle[-1] 0,0,48,100%,1,128 +rectangle[-1] 0,100%,100%,{h-48},1,128 +rectangle[-1] {w-48},100%,100%,0,1,128 +iains_nr_fft_tile3[-1] {$detail_recovery},48,0,$fine_det,$med_det,$large_det,1,3 +crop[-1] 48,48,{w-49},{h-49} +sub[-1] 128 +mul[-1] $det_emphasis +add[-1] 128 +move[-2] 0 +fi +fi +if $cnr>0 +add[1,2] 300 +iains_nr_patchb[1] 10,$cnr,3,3,0,1,1,4,.5,.4,.2,0,1,1,2,0 +iains_nr_patchb[2] 10,$cnr,3,3,0,1,1,4,.5,.4,.2,0,1,1,2,0 +sub[1,2] 300 +fi +append[0,1,2] c +iain_ycbcr2rgb[0] +mul[0] 2000 +apply_curve[0] 1,0,0,{32000-$shadow},32000,{160000-$shadow},160000,{256000-$highs-$shadow},256000 +div[0] 900 +apply_gamma[0] 1.3 +c 0,255 +done a c nm $nm done done +iains_nr_med3stack16: +blend_median +iains_nr_med5stack16: +blend_median +iains_nr_fft_tile3_fft: ++fftpolar[0] +100%,100%,1,1,1 +ellipse[-1] 50%,50%,50%,50%,0,1,$4 +ellipse[-1] 50%,50%,15%,15%,0,1,$5 +ellipse[-1] 50%,50%,5%,5%,0,1,$6 ++add[1] [-1] +threshold[-1] $1 +set[-1] 1,50%,50% +mul[1] [-1] ++ifftpolar[1,2] +remove[0,1,2] +keep[-1] +iains_nr_fft_tile3_clean: +tc={round(w/$2)} tr={round(h/$2)} +split_tiles $tc,$tr +repeat $! local[$>] +iains_nr_fft_tile3_fft[0--1] $1,$2,$3,$4,$5,$6 +done done +append_tiles $tc,$tr +c 0,255 +iains_nr_fft_tile3: ++resize[0] {w+$2},{h+$2},1,1,0,1,1,1 +resize[-1] {w+$2},{h+$2},1,1,0,1,0,0 +iains_nr_fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] $2,$2,{w-$2-1},{h-$2-1} +if $8>2 +push={round($2*1.5)} +pull={$2-$push} ++resize[0] {w+$push},{h+$2},1,1,0,1,1,1 +resize[-1] {w+$pull},{h+$2},1,1,0,1,0,0 +iains_nr_fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$push},{$2},{w-$pull-1},{h-($2)-1} ++resize[0] {w+$2},{h+$push},1,1,0,1,1,1 +resize[-1] {w+$2},{h+$pull},1,1,0,1,0,0 +iains_nr_fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] $2,{$push},{w-$2-1},{h-$pull-1} +fi +if $8>1 +dia1={round($2/3)} +dia2={$2-$dia1} ++resize[0] {w+$dia1},{h+$dia1},1,1,0,1,1,1 +resize[-1] {w+$dia2},{h+$dia2},1,1,0,1,0,0 +iains_nr_fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$dia1},{$dia1},{w-$dia2-1},{h-$dia2-1} ++resize[0] {w+$dia2},{h+$dia2},1,1,0,1,1,1 +resize[-1] {w+$dia1},{h+$dia1},1,1,0,1,0,0 +iains_nr_fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$dia2},{$dia2},{w-$dia1-1},{h-$dia1-1} +fi +remove[0] +if $8==3 +blend_median +fi +if $8==2 +blend_median +fi +iains_nr_patchb_smoothing: +repeat $7 denoise $1,$2,$3,$4,$5,$6 done +iains_nr_patchb_2: ++resize[0] 50%,50%,1,{s},2 ++iains_nr_patchb_smoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 ++resize[1] {0,w},{0,h},1,{s},5 ++sub[0] [3] +resize[2] {0,w},{0,h},1,{s},5 ++add[2] [4] +keep[-1] +iains_nr_patchb_3: ++resize[0] 25%,25%,1,{s},2 ++iains_nr_patchb_smoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 ++resize[1] {0,w},{0,h},1,{s},5 ++sub[0] [3] +resize[2] {0,w},{0,h},1,{s},5 ++add[2] [4] +keep[-1] +iains_nr_patchb_4: ++resize[0] 12.5%,12.5%,1,{s},2 ++iains_nr_patchb_smoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 ++resize[1] {0,w},{0,h},1,{s},5 ++sub[0] [3] +resize[2] {0,w},{0,h},1,{s},5 ++add[2] [4] +keep[-1] +iains_nr_patchb_5: ++resize[0] 6.125%,6.125%,1,{s},2 ++iains_nr_patchb_smoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 ++resize[1] {0,w},{0,h},1,{s},5 ++sub[0] [3] +resize[2] {0,w},{0,h},1,{s},5 ++add[2] [4] +keep[-1] +iains_nr_patchb: +apply_gamma {1/$14} +if $8==1 +hybrid_median[-1] 1,0,0 +fi +if $8==2 +hybrid_median[-1] 3,0,0 +fi +if $8==3 +median[-1] 3 +fi +if $8==4 +median[-1] 3 +median[-1] 3 +median[-1] 3 +fi +repeat $15 +if $8<4 +if $13==1 +iains_nr_patchb_smoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 +fi +fi +iains_nr_patchb_2 $1,{$2*$9},$3,$4,$5,$6,$7,$8 +iains_nr_patchb_3 $1,{$2*$10},$3,$4,$5,$6,$7,$8 +iains_nr_patchb_4 $1,{$2*$11},$3,$4,$5,$6,$7,$8 +iains_nr_patchb_5 $1,{$2*$12},$3,$4,$5,$6,$7,$8 +done +apply_gamma $14 +iain_rgb2ycbcr: +redmul=.299 +greenmul=.587 +bluemul=.114 +to_rgb[0] ++split[0] c +mul[1] $redmul +mul[2] $greenmul +mul[3] $bluemul +add[1-3] +split[0] c +name[0] red +name[1] green +name[2] blue +name[3] luma ++sub[blue] [luma] +name[-1] cb ++sub[red] [luma] +name[-1] cr +keep[luma,cb,cr] +append[luma,cb,cr] c +iain_ycbcr2rgb: +redmul=.299 +greenmul=.587 +bluemul=.114 +split c +name[0] luma +name[1] cb +name[2] cr ++add[cb] [luma] +name[-1] blueout ++add[cr] [luma] +name[-1] redout +remove[1,2] ++mul[redout] $redmul ++mul[blueout] $bluemul +sub[luma] [-1] +sub[luma] [-2] +div[luma] $greenmul +remove[-1,-2] +move[2] 0 +append c +iain_iains_nr_preview: +if $-1==0 +iain_iains_nr ${1--2} +fi +if $-1==1 ++iain_iains_nr $1,0,$3,$4,$5,$6,$7,$8,$9,$10,1.3,0 +compose_grainextract +sub 128 +mul 3 +add 128 +fi +if $-1==2 ++iain_iains_nr 0,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,0 +compose_grainextract +sub 128 +mul 3 +add 128 +fi +if $-1==3 +iain_iains_nr $1,$2,$3,$4,$5,2,$7,$8,$9,$10,$11,0 +keep[-1] +sub 128 +mul 3 +add 128 +fi +iain_highlight_synthesis: +red_wb={$1/max($1,$2,$3)} +green_wb={$2/max($1,$2,$3)} +blue_wb={$3/max($1,$2,$3)} +srgb=$4 +smoothness=2 +smoothness2=2 +smoothness3=2 +-remove_opacity ++crop 0,0,500,500 +sum={is} ++rgb2bayer[1] 0,1 b_sum0={is} -rm[-1] +rgb2bayer[1] 1,1 b_sum1={is} -rm[-1] +rgb2bayer[1] 2,1 b_sum2={is} -rm[-1] +rgb2bayer[1] 3,1 b_sum3={is} -rm[-1] +-if {$sum==$b_sum0} b_pat=0 -elif {$sum==$b_sum1} b_pat=1 -elif {$sum==$b_sum2} b_pat=2 -elif {$sum==$b_sum3} b_pat=3 -fi +-k[0] +rgb2bayer $b_pat,1 +-split c +-l[1] +(1,0,0;0,-1,0;0,0,0) +(0,1,0;-1,0,0;0,0,0) ++convolve[0] [1] ++convolve[0] [2] +-rm[1,2] +(0.25,0.5,0.25;0.5,1,0.5;0.25,0.5,0.25) +-convolve[1,2] [-1] +-rm[-1] +-complex2polar[-1,-2] +-rm[-2] +-mod[1] {pi} +-median[-1] 3 +-inrange[-1] 0,{pi/2} +(0.5,1,0.5) +(0.5;1;0.5) ++convolve[0] [2] ++convolve[0] [3] +-rm[0,2,3] +-mul[1] [0] +-negate[0] +-mul[2] [0] +-add[1,2] +-k[1] +-done +-l[0] +(0.25,0.5,0.25;0.5,1,0.5;0.25,0.5,0.25) +-convolve[0] [-1] +-rm[-1] +-done +-l[2] +(0.25,0.5,0.25;0.5,1,0.5;0.25,0.5,0.25) +-convolve[0] [-1] +-rm[-1] +-done +-append c +-cut 0,255 +-split c ++local ++min[0,1,2] ++blend_median[0,1,2] ++max[0,1,2] +-rm[0,1,2] +-l[0] +-repeat 4 ++fill[0] >" +far = j(-1)+(j(-1)-j(-2))*0.99; +near = 255+(255-j(-1))*0.99; +predict = if(far<255,near,far); +if(i>254,predict,i) +" +-rotate[0] 90 +-done +-rotate[2] -90 +-rotate[3] -180 +-rotate[4] 90 +-min[-1,-2,-3,-4] ++gt[0] 254 +-distance[-1] 0 +-cut[-1] 0,50 +-repeat $smoothness +-gcd_boxfilter_local[1] [2] +-sub[2] 0.25 +-cut[2] 0,50 +-done +-cut[1] 0,{255*(2^2)} +-keep[1] +-done ++blur[0] 0.5 -laplacian[-1] -abs[-1] +-line[-1] 0,0,100%,0,1,500 +-line[-1] 0,0,0,100%,1,500 +-line[-1] 100%,0,100%,100%,1,500 +-line[-1] 0,100%,100%,100%,1,500 +-negate[-1] +-blur[-1] 0.5 ++lt[1] 254 +-erode[-1] 3 +-sub[1] [0] ++mul[1] [-1] +-watershed[-1] [3] ++distance[-2] 1 +-erode[-1] 3 +-c[-1] 0,20 +-repeat $smoothness2 +-gcd_boxfilter_local[-2] [-1] +-done +-rm[-1] +-mul[1] [-2] +-negate[-2] +-mul[-1,-2] +-add[1,-1] +-add[1] [0] +-add[0,1] +-mul[0] 0.5 ++lt[1] 254 +-erode[-1] 3 +-sub[1] [0] ++mul[1] [-1] +-watershed[-1] [2] ++distance[-2] 1 +-erode[-1] 3 +-c[-1] 0,20 +-repeat $smoothness2 +-gcd_boxfilter_local[-2] [-1] +-done +-rm[-1] +-mul[1] [-2] +-negate[-2] +-mul[-1,-2] +-add[1,-1] +-add[1] [0] +-mul[1] 0.5 +-add[0,1] +-mul[0] {1/1.5} +-remove[-1] +-done ++blur[-1] 0.5 -laplacian[-1] -abs[-1] +-line[-1] 0,0,100%,0,1,500 +-line[-1] 0,0,0,100%,1,500 +-line[-1] 100%,0,100%,100%,1,500 +-line[-1] 0,100%,100%,100%,1,500 +-negate[-1] +-blur[-1] 0.5 ++lt[0] 254 +-erode[-1] 3 +-mul[0] $red_wb +-sub[0] [3] ++add[0] 1000 +-mul[-1] [-2] +-watershed[-1] [4] ++distance[-2] 1 +-erode[-1] 3 +-c[-1] 0,20 +-repeat $smoothness2 +-gcd_boxfilter_local[-2] [-1] +-done +-rm[-1] +-sub[-1] 1000 +-mul[0] [-2] +-negate[-2] +-mul[-1,-2] +-add[0,-1] +-add[0] [3] ++lt[1] 254 +-erode[-1] 3 +-mul[1] $green_wb +-sub[1] [3] ++add[1] 1000 +-mul[-1] [-2] +-watershed[-1] [4] ++distance[-2] 1 +-erode[-1] 3 +-c[-1] 0,20 +-repeat $smoothness2 +-gcd_boxfilter_local[-2] [-1] +-done +-rm[-1] +-sub[-1] 1000 +-mul[1] [-2] +-negate[-2] +-mul[-1,-2] +-add[1,-1] +-add[1] [3] ++lt[2] 254 +-erode[-1] 3 +-mul[2] $blue_wb +-sub[2] [3] ++add[2] 1000 +-mul[-1] [-2] +-watershed[-1] [4] ++distance[-2] 1 +-erode[-1] 3 +-c[-1] 0,20 +-repeat $smoothness2 +-gcd_boxfilter_local[-2] [-1] +-done +-rm[-1] +-sub[-1] 1000 +-mul[2] [-2] +-negate[-2] +-mul[-1,-2] +-add[2,-1] +-add[2,3] +-append[0,1,2] c +-keep[0] +-cut[0] 0,1000000 +-n 0,255 +-if $srgb -rgb2srgb -fi +iain_iid_demosaic: +pattern=$1 +chroma_diff=1.5 +chroma_radius=5 +clamp_radius1=$2 +repeat $! l[$>] +if $5 apply_gamma 2 fi ++l +l +to_rgb ++iain_iid_demosaic_vertical[0] $pattern,$clamp_radius1 +iain_iid_demosaic_horizontal[0] $pattern,$clamp_radius1 ++l ++l[0] +(1,-1) +convolve[0] [1] +k[0] +abs +blur 1 +split c +add +done ++l[1] +(1;-1) +convolve[0] [1] +k[0] +abs +blur 1 +split c +add +done +sub[-1,-2] ++l[0] ++split c +add[-1,-2,-3] +mul[-1] {1/3} +sub ++blur $chroma_radius +sub +abs +blur 1 +split c +add +done ++l[1] ++split c +add[-1,-2,-3] +mul[-1] {1/3} +sub ++blur $chroma_radius +sub +abs +blur 1 +split c +add +done +sub[-1,-2] +mul[-1] $chroma_diff +add[-1,-2] +gt[-1] 0 +line[-1] 0,0,100%,0%,1,0 +line[-1] 0,100%,100%,100%,1,0 +line[-1] 0,0,0%,100%,1,1 +line[-1] 100%,0%,100%,100%,1,1 ++eq[-1] 0 +mul[0,-1] +mul[1,-1] +max +done +done +done +l[0,-1] +if $3>0 +iain_luma_guided_demosaic $1,$3,$2 +else +k[1] +fi +done +if $4 +l[-1,-2] +l[0] +rgb2yuv +split c +fill[0] 0.5 +append c +yuv2rgb +done +l[1] +rgb2yuv +split c +fill[0] 0.5 +append c +yuv2rgb +done +iain_min_fft3_1 128 +done +rgb2yuv +split c +k[0,-1,-2] +append c +yuv2rgb +else +k[0] +fi +if $5 apply_gamma 0.5 fi +done done +iain_min_fft3_1: ++l[0,1] +append z +size=$1 +cropwidth={w} +cropheight={h} +resize {w+($size-w%$size)},{h+($size-h%$size)},{d},{s},0,0 +h_tile={h/$1} +v_tile={w/$1} +split_tiles $v_tile,$h_tile +apply_parallel " +l[0] +split z +rgb2yuv +fftpolar +min[0,2] +min[1,2] +ifftpolar +yuv2rgb +done +" +append_tiles $v_tile,$h_tile +crop 0,0,{$cropwidth-1},{$cropheight-1} +c 0,255 +done +k[-1] +iain_iid_demosaic_vertical: +resize {w+8},{h+8},{d},{s},0,0,0.5,0.5 ++l +rgb2bayer $1,1 ++l[0] +to_rgb +channels 1 +(-0.1;0;0.6;1;0.6;0;-0.1) +convolve[0] [1] +remove[-1] +done ++iain_demosaic_clamp[0] $2 +rm[2] +min[1,2] +max[1,2] ++to_rgb[1] +rgb2bayer[-1] $1,1 +split[0] c +split[-1] c +sub[0] [4] +sub[2] [6] +append[0,1,2] c +add[0] 128 +rgb2bayer[0] $1,1 +split[0] c +k[0,2,3] +reverse[1,2] ++l[0,1] +reverse +iain_guided_fillgrid +done ++l[1,2] +iain_guided_fillgrid +done +rm[0,2] +reverse[0,1] +sub[0,2] 128 +add[0] [1] +add[2] [1] +append c +c 0,255 +done +k[1] +crop 4,4,{w-5},{h-5} +iain_iid_demosaic_horizontal: +resize {w+8},{h+8},{d},{s},0,0,0.5,0.5 ++l +rgb2bayer $1,1 ++l[0] +to_rgb +channels 1 +(-0.1,0,0.6,1,0.6,0,-0.1) +convolve[0] [1] +remove[-1] +done ++iain_demosaic_clamp[0] $2 +rm[2] +min[1,2] +max[1,2] ++to_rgb[1] +rgb2bayer[-1] $1,1 +split[0] c +split[-1] c +sub[0] [4] +sub[2] [6] +append[0,1,2] c +add[0] 128 +rgb2bayer[0] $1,1 +split[0] c +k[0,2,3] +reverse[1,2] ++l[0,1] +reverse +iain_guided_fillgrid +done ++l[1,2] +iain_guided_fillgrid +done +rm[0,2] +reverse[0,1] +sub[0,2] 128 +add[0] [1] +add[2] [1] +append c +c 0,255 +done +k[1] +crop 4,4,{w-5},{h-5} +iain_demosaic_clamp: +channels 1 ++l +if $1>2 ++shift[0] 3,-2,0,0 ++shift[0] -3,-2,0,0 ++shift[0] -2,3,0,0 ++shift[0] -2,-3,0,0 ++shift[0] 3,0,0,0 ++shift[0] -3,0,0,0 ++shift[0] 0,3,0,0 ++shift[0] 0,-3,0,0 +fi +if $1>1 ++shift[0] 1,2,0,0 ++shift[0] -1,2,0,0 ++shift[0] 2,1,0,0 ++shift[0] 2,-1,0,0 ++shift[0] 1,-2,0,0 ++shift[0] -1,-2,0,0 ++shift[0] -2,1,0,0 ++shift[0] -2,-1,0,0 +fi ++shift[0] 1,0,0,0 ++shift[0] -1,0,0,0 ++shift[0] 0,1,0,0 +shift[0] 0,-1,0,0 ++min[0--1] +max[0--2] +done +add[1] [0] +add[2] [0] +iain_luma_guided_demosaic: +resize {w+8},{h+8},{d},{s},0,0,0.5,0.5 +remove_opacity +repeat $2 ++l ++split[1] c +add[-1,-2,-3] +mul[-1] .33333333333333333 +rm[1] +sub[0] [1] +add[0] 255 +rgb2bayer[0] $1,1 +reverse +split[1] c ++iain_guided_diagonal_interpolation[0,1] ++iain_guided_diagonal_interpolation[0,3] +rm[1,3] +reverse[1,2] ++iain_guided_straight_interpolation[0,1] ++iain_guided_straight_interpolation[0,2] ++iain_guided_straight_interpolation[0,3] +rm[1,2,3] +sub[1,2,3] 255 +append[1,2,3] c +to_rgb +add +c 0,255 +done +rm[1] +if $3>0 +fi +done +k[1] +crop 4,4,{w-5},{h-5} +fft_tile2_fft: ++fftpolar[0] +100%,100%,1,1,1 +ellipse[-1] 50%,50%,50%,50%,0,1,$4 +ellipse[-1] 50%,50%,15%,15%,0,1,$5 +ellipse[-1] 50%,50%,5%,5%,0,1,$6 +box_blur[-1] {$2*0.01} ++add[1] [-1] +threshold[-1] {$1/(128/$2)} +set[-1] 1,50%,50% +mul[1] [-1] ++ifftpolar[1,2] +keep[-1] +fft_tile2_clean: +tc={round(w/$2)} tr={round(h/$2)} +split_tiles $tc,$tr +repeat $! local[$>] +fft_tile2_fft[0--1] $1,$2,$3,$4,$5,$6 +done done +append_tiles $tc,$tr +c 0,255 +fft_tile2: ++resize[0] {w+$2},{h+$2},1,1,0,1,1,1 +resize[-1] {w+$2},{h+$2},1,1,0,1,0,0 +fft_tile2_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] $2,$2,{w-$2-1},{h-$2-1} +if $3==0 +push={round($2*1.5)} +pull={$2-$push} ++resize[0] {w+$push},{h+$2},1,1,0,1,1,1 +resize[-1] {w+$pull},{h+$2},1,1,0,1,0,0 +fft_tile2_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$push},{$2},{w-$pull-1},{h-($2)-1} ++resize[0] {w+$2},{h+$push},1,1,0,1,1,1 +resize[-1] {w+$2},{h+$pull},1,1,0,1,0,0 +fft_tile2_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] $2,{$push},{w-$2-1},{h-$pull-1} +dia1={round($2/3)} +dia2={$2-$dia1} ++resize[0] {w+$dia1},{h+$dia1},1,1,0,1,1,1 +resize[-1] {w+$dia2},{h+$dia2},1,1,0,1,0,0 +fft_tile2_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$dia1},{$dia1},{w-$dia2-1},{h-$dia2-1} ++resize[0] {w+$dia2},{h+$dia2},1,1,0,1,1,1 +resize[-1] {w+$dia1},{h+$dia1},1,1,0,1,0,0 +fft_tile2_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$dia2},{$dia2},{w-$dia1-1},{h-$dia1-1} +fi +remove[0] +if $3==0 +iain_median_5_stack +fi +luminance_nr_two: +ac " +mul 9.99 +apply_curve 0,0,0,510,{510-$17},1020,{1020-$17-$18},1530,{1530-$17-$18-$19},2040,{2040-$17-$18-$19-$20},2550,{2550-$17-$18-$19-$20-$21},2550,2550 +mul 0.1 +if $22==1 ++median[0] 3 +ms_patch_smooth[-1] 10,$1,3,3,0,$2,$3,0,{$1*$4},{$1*$5},{$1*$6},{$1*$7},{$1*$8},{$1*$9},1 +fi +if $22==0 ++ms_patch_smooth[0] 10,$1,3,3,0,$2,$3,0,{$1*$4},{$1*$5},{$1*$6},{$1*$7},{$1*$8},{$1*$9},1 +fi +if $16==1 ++compose_grainextract +fft_tile2[-1] $10,$11,3,$13,$14,$15 +compose_grainmerge[1,2] +fi +keep[-1] +mul 9.99 +apply_curve 0,0,0,{510-$17},510,{1020-$17-$18},1020,{1530-$17-$18-$19},1530,{2040-$17-$18-$19-$20},2040,{2550-$17-$18-$19-$20-$21},2550,2550,2550 +mul 0.1 +",7 +c 0,255 +iain_minimum_chroma_demosaic: +rgb2bayer $1,1 +cropwidth={w} +cropheight={h} +resize {w+16},{h+16},{d},{s},0,0,0.5,0.5 ++l +if $3==0 ++iain_horizontal_interpolate[0] $1,1 +iain_vertical_interpolate[0] $1,1 +elif $3==1 ++iain_tuned_horizontal[0] $1 +iain_tuned_vertical[0] $1 +fi +l[0] +rgb2yuv +split c +fill[0] .5 +append c +yuv2rgb +done +l[1] +rgb2yuv +split c +fill[0] .5 +append c +yuv2rgb +done +append z +levels={$2+1} +size={3^$levels} +cropwidth2={w} +cropheight2={h} +resize {w+($size-w%$size)},{h+($size-h%$size)},{d},{s},0,1 +repeat $levels +l[-1] ++resize[0] 33.33333%,33.33333%,{d},{s},2 ++iain_resize_x3[-1] +sub[0,-1] +done +done +repeat $!-1 l[{$<}] +split z ++abs +gt[-1] [-2] +rm[-2] ++eq[-1] 0 +mul[0,2] +mul[1,2] +add +done done +l[-1] +split z +k[1] +done +repeat $!-1 +iain_resize_x3[-1] +add[-1,-2] +done +crop 0,0,{$cropwidth2-1},{$cropheight2-1} +c 0,255 +done +iain_chroma_guide $1,1 +crop 8,8,{$cropwidth+7},{$cropheight+7} +iain_chroma_guide: +to_rgb +rgb2bayer[0] $1,1 ++l[0,1] +split[-1] c +split[0] c +name[0] red name[1] green name[2] blue +name[-3] redblur name[-2] greenblur name[-1] blueblur ++sub[greenblur] [redblur] ++sub[greenblur] [blueblur] +name[-1] bluemul name[-2] redmul +remove[redblur,greenblur,blueblur] +add[red] [redmul] +add[blue] [bluemul] +keep[red,green,blue] +append c +rgb2bayer $1,1 +split c +add +done +rm[1] ++to_rgb[1] +rgb2bayer[-1] $1,1 +split[0] c +split[-1] c +sub[0] [4] +sub[2] [6] +append[0,1,2] c +add[0] 128 +rgb2bayer[0] $1,1 +split[0] c +rm[1,-1,-2,-3] ++l[0,2] +reverse +iain_guided_fillgrid +done +rm[0] ++l[0,1] +reverse +iain_guided_fillgrid +done +rm[0] +reverse[0,1] +sub[0,2] 128 +add[0] [1] +add[2] [1] +append c +c 0,255 +iain_resize_x3: +resize[0] {(w*3)-2},{(h*3)-2},{d},{s},5,0 +resize[0] {w+2},{h+2},{d},{s},0,1,0.5,0.5 +iain_vertical_interpolate: +rgb2bayer[0] $1,1 ++l[0] +channels 1 +(-0.1;0;0.6;1;0.6;0;-0.1) +convolve[0] [-1] +rm[-1] +done +c 0,255 ++to_rgb[1] +rgb2bayer[-1] $1,1 +split[0] c +split[-1] c +sub[0] [4] +sub[2] [6] +append[0,1,2] c +add[0] 128 +rgb2bayer[0] $1,1 +split[0] c +rm[1,-1,-2,-3] ++l[0,2] +reverse +iain_guided_fillgrid +done +rm[0] ++l[0,1] +reverse +iain_guided_fillgrid +done +rm[0] +reverse[0,1] +sub[0,2] 128 +add[0] [1] +add[2] [1] +append c +c 0,255 +iain_horizontal_interpolate: +rgb2bayer[0] $1,1 ++l[0] +channels 1 +(-0.1,0,0.6,1,0.6,0,-0.1) +convolve[0] [-1] +rm[-1] +done +c 0,255 ++to_rgb[1] +rgb2bayer[-1] $1,1 +split[0] c +split[-1] c +sub[0] [4] +sub[2] [6] +append[0,1,2] c +add[0] 128 +rgb2bayer[0] $1,1 +split[0] c +rm[1,-1,-2,-3] ++l[0,2] +reverse +iain_guided_fillgrid +done +rm[0] ++l[0,1] +reverse +iain_guided_fillgrid +done +rm[0] +reverse[0,1] +sub[0,2] 128 +add[0] [1] +add[2] [1] +append c +c 0,255 +iain_guided_fillgrid: +channels 0 +l[0] +(1,0;0,-1) ++convolve[0] [1] +rm[1] +(0,1;-1,0) ++convolve[0] [2] +rm[2] +l[-1,-2] +abs +blur 1 ++max +eq[0] [-1] +keep[0] +mul 255 +done +done ++l[2] ++l[0] +(0,0,0.5;0,1,0;0.5,0,0) +convolve[0] [1] +remove[1] +done +l[0] +(0.5,0,0;0,1,0;0,0,0.5) +convolve[0] [1] +remove[1] +done +done +move[1] 5 +append[-1,-2] c +blend[-1,-2] alpha,1,0 +rm[1] +l[0] +(1,-1) ++convolve[0] [1] +rm[1] +(1;-1) ++convolve[0] [2] +rm[2] +l[-1,-2] +abs +blur 1 ++max +eq[0] [-1] +keep[0] +mul 255 +done +done ++l[2] ++l[0] +(0.5;1;0.5) +convolve[0] [1] +remove[1] +done +l[0] +(0.5,1,0.5) +convolve[0] [1] +remove[1] +done +done +move[1] 5 +append[-1,-2] c +blend[-1,-2] alpha,1,0 +k[-1] +iain_tuned_horizontal: +remove_opacity +l[0] ++fill[0] 1 +rgb2bayer[1] $1,1 ++l[0] +split c +add +(-0.025,0.1,-0.225,0.4,0.5,0.4,-0.225,0.1,-0.025) +convolve[0] [1] +rm[1] +done ++l[1,2] +shift[0] 1,0,0,0,2 +mul +done +add[-1] [0] +channels[-1] 1 +k[0,-1] +to_rgb +iain_luma_guide $1,1,0 +done +iain_tuned_vertical: +remove_opacity +l[0] ++fill[0] 1 +rgb2bayer[1] $1,1 ++l[0] +split c +add +(-0.025;0.1;-0.225;0.4;0.5;0.4;-0.225;0.1;-0.025) +convolve[0] [1] +rm[1] +done ++l[1,2] +shift[0] 1,0,0,0,2 +mul +done +add[-1] [0] +channels[-1] 1 +k[0,-1] +to_rgb +iain_luma_guide $1,1,0 +done +iain_luma_guide: +remove_opacity +if $3 +mul {1/255} +pow 2.2 +mul 255 +fi +repeat $2 ++l ++split[1] c +add[-1,-2,-3] +mul[-1] .33333333333333333 +rm[1] +sub[0] [1] +add[0] 255 +rgb2bayer[0] $1,1 +reverse +split[1] c ++iain_guided_diagonal_interpolation[0,1] ++iain_guided_diagonal_interpolation[0,3] +rm[1,3] +reverse[1,2] ++iain_guided_straight_interpolation[0,1] ++iain_guided_straight_interpolation[0,2] ++iain_guided_straight_interpolation[0,3] +rm[1,2,3] +sub[1,2,3] 255 +append[1,2,3] c +to_rgb +add +c 0,255 +done +rm[1] +done +keep[1] +if $3 +mul {1/255} +pow {1/2.2} +mul 255 +fi +iain_guided_diagonal_interpolation: ++l[0] +(1,0;0,-1) ++convolve[0] [1] +rm[1] +(0,1;-1,0) ++convolve[0] [2] +rm[2] +l[-1,-2] +abs +blur 1.5 ++min +eq[0] [-1] +keep[0] +done +rm[-2] +done +l[1] ++l[0] +(0,0,0.5;0,1,0;0.5,0,0) +convolve[0] [1] +remove[1] +done +l[0] +(0.5,0,0;0,1,0;0,0,0.5) +convolve[0] [1] +remove[1] +done +done +rm[0] ++eq[-1] 0 +mul[0,2] +mul[1,2] +add +iain_guided_straight_interpolation : ++l[0] +(1,-1) ++convolve[0] [1] +rm[1] +(1;-1) ++convolve[0] [2] +rm[2] +l[-1,-2] +abs +blur 1.5 ++min +eq[0] [-1] +keep[0] +done +rm[-2] +done +l[1] ++l[0] +(0.5;1;0.5) +convolve[0] [1] +remove[1] +done +l[0] +(0.5,1,0.5) +convolve[0] [1] +remove[1] +done +done ++eq[-1] 0 +mul[1,3] +mul[2,3] +add[1,2] +keep[1] +iain_moire_removal: +tile_size=256 +overlap=16 +cropwidth={w} +cropheight={h} +if $cropwidth%$tile_size>0 +resize[0] {w+($tile_size-w%$tile_size)},100%,1,{s},0,1 +fi +if $cropheight%$tile_size>0 +resize[0] 100%,{h+($tile_size-h%$tile_size)},1,{s},0,1 +fi +h_tiles={w/$tile_size} +v_tiles={h/$tile_size} +repeat $v_tiles v_count=$> +repeat $h_tiles h_count=$> ++crop[0] {($h_count*$tile_size)-$overlap},{($v_count*$tile_size)-$overlap},{($h_count*$tile_size)+($tile_size+$overlap-1)},{($v_count*$tile_size)+($tile_size+$overlap-1)},1 +done +done +rm[0] +repeat $! l[$>] +if iM!=im +[0] +apply_parallel_channels[1] " +l[0] +repeat 3 +l[-1] +repeat 2 +denoise[0] 10,{$1/($>+1)},5,5,0,{min($>,1)} +done ++resize[0] 50%,50%,{d},{s},2 ++resize[-1] 200%,200%,{d},{s},3 +sub[0,-1] +done +done +repeat $!-1 +resize[-1] {-2,w},{-2,h},{d},{s},3 +add[-1,-2] +done +done +" +if $3<2 +sub[0] [1] +l[0] +fftpolar[0] +if $3==1 +append[0,1] x +split[0] c +min +split[0] x,2 +elif $3==0 +fill[1] if(max(i(x,y,z,0),i(x,y,z,1),i(x,y,z,2))-min(i(x,y,z,0),i(x,y,z,1),i(x,y,z,2))<$2,min(i(x,y,z,0),i(x,y,z,1),i(x,y,z,2)),(i(x,y,z,c))) +fi +ifftpolar[0,1] +keep[0] +done +to_rgb +add +else +keep[1] +fi +c 0,255 +fi +done +progress {($>/$!)*100} +done +repeat $! l[$>] +crop $overlap,$overlap,{$tile_size+$overlap-1},{$tile_size+$overlap-1} +done +done +append_tiles $h_tiles,$v_tiles +crop 0,0,{$cropwidth-1},{$cropheight-1} +iain_moire_removal_NP: +tile_size=256 +overlap=16 +cropwidth={w} +cropheight={h} +if $cropwidth%$tile_size>0 +resize[0] {w+($tile_size-w%$tile_size)},100%,1,{s},0,1 +fi +if $cropheight%$tile_size>0 +resize[0] 100%,{h+($tile_size-h%$tile_size)},1,{s},0,1 +fi +h_tiles={w/$tile_size} +v_tiles={h/$tile_size} +repeat $v_tiles v_count=$> +repeat $h_tiles h_count=$> ++crop[0] {($h_count*$tile_size)-$overlap},{($v_count*$tile_size)-$overlap},{($h_count*$tile_size)+($tile_size+$overlap-1)},{($v_count*$tile_size)+($tile_size+$overlap-1)},1 +done +done +rm[0] +repeat $! l[$>] +if iM!=im +[0] +l[1] +l[0] +repeat 3 +l[-1] +repeat 2 +denoise[0] 10,{$1/($>+1)},5,5,0,{min($>,1)} +done ++resize[0] 50%,50%,{d},{s},2 ++resize[-1] 200%,200%,{d},{s},3 +sub[0,-1] +done +done +repeat $!-1 +resize[-1] {-2,w},{-2,h},{d},{s},3 +add[-1,-2] +done +done +done +if $3<2 +sub[0] [1] +l[0] +fftpolar[0] +if $3==1 +append[0,1] x +split[0] c +min +split[0] x,2 +elif $3==0 +fill[1] if(max(i(x,y,z,0),i(x,y,z,1),i(x,y,z,2))-min(i(x,y,z,0),i(x,y,z,1),i(x,y,z,2))<$2,min(i(x,y,z,0),i(x,y,z,1),i(x,y,z,2)),(i(x,y,z,c))) +fi +ifftpolar[0,1] +keep[0] +done +to_rgb +add +else +keep[1] +fi +c 0,255 +fi +done +progress {($>/$!)*100} +done +repeat $! l[$>] +crop $overlap,$overlap,{$tile_size+$overlap-1},{$tile_size+$overlap-1} +done +done +append_tiles $h_tiles,$v_tiles +crop 0,0,{$cropwidth-1},{$cropheight-1} +ms_nlmeans_c_noise2_p_preview: +if $16 +remove_opacity ++ms_nlmeans_c_noise2[0] ${1--1} +sub +mul 2 +add 128 +c 0,255 +else +ms_nlmeans_c_noise2[0] ${1--1} +fi +ms_nlmeans_c_noise2_p: +ms_nlmeans_c_noise2[0] ${1--1} +ms_nlmeans_c_noise2: +remove_opacity +hf_strength={2^$1} +lf_strength={2^$2} +hf_patch=$9 +hf_search=$10 +lf_patch=$11 +lf_search=$12 +sc_rb=$13 +sc_g=$14 +blacks={2^$3} +shadows={2^$4} +midtones={2^$5} +highlights={2^$6} +whites={2^$7} +smooth=$8 +shadow={2^$3} +highlight={2^$4} +levels=1 +size={3^$levels} +cropwidth={w} +cropheight={h} +resize {w+($size-w%$size)},{h+($size-h%$size)},{d},{s},0,1 ++l[0] +split c +if $sc_rb +median[0,2] 4 +fi +if $sc_g +l[1] ++l[0] +(1,1,1;1,0,1;1,1,1) +dilate[0] [1] +rm[1] +done ++l[0] +(1,1,1;1,0,1;1,1,1) +erode[0] [1] +rm[1] +done +min[0,1] +max[0,1] +done +fi +append c +luminance +done +if $11 ++c_noise[0] 1.6 +else +[1] +to_rgb[-1] +negate[-1] +add[-1] .1 +mul[-1] .1 +blur[-1] 2 +fi ++l[1] +255,1,1,1,1 +line[-1] 0,0,50,0,1,$blacks +line[-1] 51,0,100,0,1,$shadows +line[-1] 101,0,152,0,1,$midtones +line[-1] 153,0,204,0,1,$highlights +line[-1] 205,0,255,0,1,$whites +blur[-1] $smooth +map[0] [1] +keep[0] +done +mul[2,-1] ++l[0,1,2] +mul[-1] $hf_strength +f[-1] '-3.0/i' nlmeans_core[0] [1],[2],$hf_patch,$hf_search +keep[0] +done +reverse[0,-1] +rm[-1] ++l[0,1,2] +resize[0,1,2] 33.33333%,33.33333%,{d},{s},2 +mul[-1] $lf_strength +f[-1] '-3.0/i' nlmeans_core[0] [1],[2],$lf_patch,$lf_search +keep[0] +done +rm[1,2] ++resize[0] 33.33333%,33.33333%,{d},{s},2 +linear_x3[-1] +sub[0,-1] +linear_x3[-1] +add +c 0,255 +crop 0,0,{$cropwidth-1},{$cropheight-1} +c 0,255 +c_noise: +width={w} +height={h} ++l[0] ++shift[0] 0,1,0,0,2 ++shift[0] 0,-1,0,0,2 +blend_median +done +sub +abs +add .1 +pow $1 +resize 25%,25%,1,3,2 +median 3 +resize $width,$height,1,3,3 +create_luma_mix: ++split[0] c +mul[1] {$1/($1+$2+$3)} +mul[2] {$2/($1+$2+$3)} +mul[3] {$3/($1+$2+$3)} +add[1-3] +keep[-1] +to_gray[-1] +ms_patch_c: +to_rgb ++create_luma_mix[0] $11,$12,$13 +name[-1] luma +if $2==1 +median[0] 3 +median[0] 3 +fi +repeat $3 +ms_patch_smooth[0] 10,$1,3,5,0,1,1,0,$4,$5,$6,$7,$8,$9,$10 +done ++create_luma_mix[0] $11,$12,$13 +sub[0] [-1] +add[0] [1] +keep[0] +c 0,255 +ms_patch_c_preview: +if $-1==0 +ms_patch_c ${1--2} +fi +if $-1==1 ++ms_patch_c ${1--2} +sub[0] [1] +keep[0] +mul 2 +add 128 +fi +linear_x3: +resize 300%,300%,{d},{s},4,1,.5,.5,0 +(.11111,.22222,.33333,.22222,.11111;.22222,.44444,.66666,.44444,.22222;.33333,.66666,1,.66666,.33333;.22222,.44444,.66666,.44444,.22222;.11111,.22222,.33333,.22222,.11111) +convolve[0] [1],0 +rm[1] +MS_Patch_NR: +if $1!=1 +apply_parallel_overlap "div 255 pow $1 mul 255" +fi +cropwidth={w} +cropheight={h} +resize[0] {w+(90-w%90)},{h+(90-h%90)},1,{s},0,1 +l[0] +width={w} +height={h} +if $2>0 +apply_parallel_overlap[-1] "denoise 10,{$2/10},$5,$6,0,0",16 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +if $3>0 +apply_parallel_overlap[-1] "denoise 10,{$3/10},$5,$6,0,0",16 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +if $4>0 +apply_parallel_overlap[-1] "denoise 10,{$4/10},$5,$6,0,0",16 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +linear_x3[-1] +add[-1,-2] +linear_x3[-1] +add[-1,-2] +linear_x3[-1] +add[-1,-2] +done +crop 0,0,{$cropwidth-1},{$cropheight-1} +if $1!=1 +apply_parallel_overlap "div 255 pow {1/$1} mul 255" +fi +c 0,255 +MS_Patch_NR3_p: +to_rgb +MS_Patch_NR3[0] $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12 +n 0,255 +linear_x3: +resize 300%,300%,{d},{s},4,1,.5,.5,0 +(.11111,.22222,.33333,.22222,.11111;.22222,.44444,.66666,.44444,.22222;.33333,.66666,1,.66666,.33333;.22222,.44444,.66666,.44444,.22222;.11111,.22222,.33333,.22222,.11111) +convolve[0] [1],0 +rm[1] +MS_Patch_NR3: +apply_parallel_overlap[-1] " +if $1!=1 +div 255 pow $1 mul 255 +fi +if $8==1 +iain_pixel_denoise_p 1,1,0,0,1 +elif $8==2 +iain_pixel_denoise_p 2,1,0,0,1 +elif $8==3 +hybrid16 hybrid16 hybrid16 +fi +cropwidth={w} +cropheight={h} +resize[0] {w+(90-w%90)},{h+(90-h%90)},1,{s},0,1 +rgb2yuv8 +split c +l[0] +width={w} +height={h} +if $2>0 +denoise 10,{$2/10},$5,$6,0,$7 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +if $3>0 +denoise 10,{$3/10},$5,$6,0,$7 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +if $4>0 +denoise 10,{$4/10},$5,$6,0,$7 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +linear_x3[-1] +add[-1,-2] +linear_x3[-1] +add[-1,-2] +linear_x3[-1] +add[-1,-2] +done +l[1] +width={w} +height={h} +if $10>0 +denoise 10,{$10/10},$5,$6,0,$7 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +if $11>0 +denoise 10,{$11/10},$5,$6,0,$7 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +if $12>0 +denoise 10,{$12/10},$5,$6,0,$7 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +linear_x3[-1] +add[-1,-2] +linear_x3[-1] +add[-1,-2] +linear_x3[-1] +add[-1,-2] +done +l[2] +width={w} +height={h} +if $10>0 +denoise 10,{$10/10},$5,$6,0,$7 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +if $11>0 +denoise 10,{$11/10},$5,$6,0,$7 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +if $12>0 +denoise 10,{$12/10},$5,$6,0,$7 +fi ++resize[-1] 33.333333333%,33.3333333333%,{d},{s},2 ++linear_x3[-1] +sub[-3,-1] +linear_x3[-1] +add[-1,-2] +linear_x3[-1] +add[-1,-2] +linear_x3[-1] +add[-1,-2] +done +append c +yuv82rgb +crop 0,0,{$cropwidth-1},{$cropheight-1} +if $1!=1 +div 255 pow {1/$1} mul 255 +fi +if $9==1 +iain_pixel_denoise_p 1,1,0,0,1 +elif $9==2 +iain_pixel_denoise_p 2,1,0,0,1 +elif $9==3 +hybrid16 hybrid16 hybrid16 +fi +c 0,255 +",64 +ms_patch_smoothsmoothing: +ac "repeat $7 denoise $1,$2,$3,$4,$5,$6 done",$8 c 0,255 +ms_patch_smooth: +lvl2=2 +lvl3=3 +lvl4=4 +lvl5=5 +lvl6=6 +lvl7=8 +apply_gamma {1/$15} +ms_patch_smoothsmoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 +name[0] full ++resize[full] {full,w/$lvl2},{full,h/$lvl2},1,{s},2 name[1] level2 ++ms_patch_smoothsmoothing[level2] $1,$9,$3,$4,$5,$6,$7,$8 name[2] level2clean ++resize[level2] {0,w},{0,h},1,{s},5 name[3] low2 ++sub[full] [low2] name[4] level2high +remove[level2,low2] ++resize[level2clean] {full,w/$lvl3},{full,h/$lvl3},1,{s},2 name[3] level3 ++ms_patch_smoothsmoothing[level3] $1,$10,$3,$4,$5,$6,$7,$8 name[4] level3clean ++resize[level3] {level2clean,w},{level2clean,h},1,{s},5 name[5] low3 ++sub[level2clean] [low3] name[6] level3high +remove[level3,low3] ++resize[level3clean] {full,w/$lvl4},{full,h/$lvl4},1,{s},2 name[5] level4 ++ms_patch_smoothsmoothing[level4] $1,$11,$3,$4,$5,$6,$7,$8 name[6] level4clean ++resize[level4] {level3clean,w},{level3clean,h},1,{s},5 name[7] low4 ++sub[level3clean] [low4] name[8] level4high +remove[level4,low4] ++resize[level4clean] {full,w/$lvl5},{full,h/$lvl5},1,{s},2 name[-1] level5 ++ms_patch_smoothsmoothing[level5] $1,$12,$3,$4,$5,$6,$7,$8 name[-1] level5clean ++resize[level5] {level4clean,w},{level4clean,h},1,{s},5 name[-1] low5 ++sub[level4clean] [low5] name[-1] level5high +remove[level5,low5] ++resize[level5clean] {full,w/$lvl6},{full,h/$lvl6},1,{s},2 name[-1] level6 ++ms_patch_smoothsmoothing[level6] $1,$13,$3,$4,$5,$6,$7,$8 name[-1] level6clean ++resize[level6] {level5clean,w},{level5clean,h},1,{s},5 name[-1] low6 ++sub[level5clean] [low6] name[-1] level6high +remove[level6,low6] +name[-2] base +resize[base] {level6high,w},{level6high,h},1,{s},5 +add[base] [level6high] +remove[level6high] +resize[base] {level5high,w},{level5high,h},1,{s},5 +add[base] [level5high] +remove[level5high] +resize[base] {level4high,w},{level4high,h},1,{s},5 +add[base] [level4high] +remove[level4high] +resize[base] {level3high,w},{level3high,h},1,{s},5 +add[base] [level3high] +remove[level3high] +resize[base] {level2high,w},{level2high,h},1,{s},5 +add[base] [level2high] +remove[level2high] +keep[-1] +c 0,255 +apply_gamma {$15} +c 0,255 +ms_patch_smooth_preview: +if $-1==0 +ms_patch_smooth ${1--2} +fi +if $-1==1 ++ms_patch_smooth ${1--2} +sub[0] [1] +keep[0] +mul 2 +add 128 +fi +luminance_nr: +apply_gamma {1/$12} +ac" ++ms_patch_smooth[0] 10,$1,3,3,0,$2,$3,0,$4,$5,$6,$7,$8,$9,1 ++compose_grainextract +fft_tile[-1] $10,$11,0 +compose_grainmerge[1,2] +keep[-1] +",7 +apply_gamma $12 +ms_smoothsmoothing: +smooth {$1*5},0.7,0.7,0.6,$2,0.8,30,2,0,1 +ms_smooth: +if $8==0 +lvl2=2 +lvl3=3 +lvl4=4 +lvl5=5 +lvl6=6 +fi +if $8==1 +lvl2=2 +lvl3=4 +lvl4=8 +lvl5=16 +lvl6=32 +fi +repeat $9 +if $1>0 +ms_smoothsmoothing[-1] $1,$7 +fi +name[0] full ++resize[full] {full,w/$lvl2},{full,h/$lvl2},1,{s},2 name[1] level2 +if $2>0 ++ms_smoothsmoothing[level2] $2,$7 +else [level2] +fi +name[2] level2clean ++resize[level2] {0,w},{0,h},1,{s},5 name[3] low2 ++sub[full] [low2] name[4] level2high +remove[level2,low2] ++resize[level2clean] {full,w/$lvl3},{full,h/$lvl3},1,{s},2 name[3] level3 +if $3>0 ++ms_smoothsmoothing[level3] $3,$7 +else [level3] +fi +name[4] level3clean ++resize[level3] {level2clean,w},{level2clean,h},1,{s},5 name[5] low3 ++sub[level2clean] [low3] name[6] level3high +remove[level3,low3] ++resize[level3clean] {full,w/$lvl4},{full,h/$lvl4},1,{s},2 name[5] level4 +if $4>0 ++ms_smoothsmoothing[level4] $4,$7 +else [level4] +fi +name[6] level4clean ++resize[level4] {level3clean,w},{level3clean,h},1,{s},5 name[7] low4 ++sub[level3clean] [low4] name[8] level4high +remove[level4,low4] ++resize[level4clean] {full,w/$lvl5},{full,h/$lvl5},1,{s},2 name[-1] level5 +if $5>0 ++ms_smoothsmoothing[level5] $5,$7 +else [level5] +fi +name[-1] level5clean ++resize[level5] {level4clean,w},{level4clean,h},1,{s},5 name[-1] low5 ++sub[level4clean] [low5] name[-1] level5high +remove[level5,low5] ++resize[level5clean] {full,w/$lvl6},{full,h/$lvl6},1,{s},2 name[-1] level6 +if $6>0 ++ms_smoothsmoothing[level6] $6,$7 +else [level6] +fi +name[-1] level6clean ++resize[level6] {level5clean,w},{level5clean,h},1,{s},5 name[-1] low6 ++sub[level5clean] [low6] name[-1] level6high +remove[level6,low6] +name[-2] base +resize[base] {level6high,w},{level6high,h},1,{s},5 +add[base] [level6high] +remove[level6high] +resize[base] {level5high,w},{level5high,h},1,{s},5 +add[base] [level5high] +remove[level5high] +resize[base] {level4high,w},{level4high,h},1,{s},5 +add[base] [level4high] +remove[level4high] +resize[base] {level3high,w},{level3high,h},1,{s},5 +add[base] [level3high] +remove[level3high] +resize[base] {level2high,w},{level2high,h},1,{s},5 +add[base] [level2high] +remove[level2high] +keep[-1] +c 0,255 +c 0,255 +done +ms_smooth_preview: +if $-1==0 +ms_smooth $1,$2,$3,$4,$5,$6,$7,$8,$9 +fi +if $-1==1 ++ms_smooth $1,$2,$3,$4,$5,$6,$7,$8,$9 +sub[0] [1] +keep[0] +mul 2 +add 128 +fi +med3stack16: +blend_median +med5stack16: +blend_median +fft_tile3_fft: ++fftpolar[0] +100%,100%,1,1,1 +ellipse[-1] 50%,50%,50%,50%,0,1,$4 +ellipse[-1] 50%,50%,15%,15%,0,1,$5 +ellipse[-1] 50%,50%,5%,5%,0,1,$6 ++add[1] [-1] +threshold[-1] $1 +set[-1] 1,50%,50% +mul[1] [-1] ++ifftpolar[1,2] +remove[0,1,2] +keep[-1] +fft_tile3_clean: +tc={round(w/$2)} tr={round(h/$2)} +split_tiles $tc,$tr +repeat $! local[$>] +fft_tile3_fft[0--1] $1,$2,$3,$4,$5,$6 +done done +append_tiles $tc,$tr +c 0,255 +fft_tile3: ++resize[0] {w+$2},{h+$2},1,1,0,1,1,1 +resize[-1] {w+$2},{h+$2},1,1,0,1,0,0 +fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] $2,$2,{w-$2-1},{h-$2-1} +if $8>2 +push={round($2*1.5)} +pull={$2-$push} ++resize[0] {w+$push},{h+$2},1,1,0,1,1,1 +resize[-1] {w+$pull},{h+$2},1,1,0,1,0,0 +fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$push},{$2},{w-$pull-1},{h-($2)-1} ++resize[0] {w+$2},{h+$push},1,1,0,1,1,1 +resize[-1] {w+$2},{h+$pull},1,1,0,1,0,0 +fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] $2,{$push},{w-$2-1},{h-$pull-1} +fi +if $8>1 +dia1={round($2/3)} +dia2={$2-$dia1} ++resize[0] {w+$dia1},{h+$dia1},1,1,0,1,1,1 +resize[-1] {w+$dia2},{h+$dia2},1,1,0,1,0,0 +fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$dia1},{$dia1},{w-$dia2-1},{h-$dia2-1} ++resize[0] {w+$dia2},{h+$dia2},1,1,0,1,1,1 +resize[-1] {w+$dia1},{h+$dia1},1,1,0,1,0,0 +fft_tile3_clean[-1] $1,$2,$3,$4,$5,$6 +crop[-1] {$dia2},{$dia2},{w-$dia1-1},{h-$dia1-1} +fi +remove[0] +if $8==3 +blend_median +fi +if $8==2 +blend_median +fi +nr5: +luma_strength=$1 +colour_strength=$2 +recovery=$3 +detail_recovery={5000-($4*500)} +fine_detials=$13 +medium_detials=$14 +large_details=$15 +detail_radius=$5 +detail_amount=$6 +detail_threshold=$7 +edge_radius=$8 +edge_amount=$9 +edge_threshold=$10 +quality=3 +if $16==1 +mul[0] 256 +radius={0.05*(min(h,w))} +[0] +rectangle[-1] 0,0,100%,$radius,1,{ia} +rectangle[-1] 0,0,$radius,100%,1,{ia} +rectangle[-1] 0,100%,100%,{h-$radius},1,{ia} +rectangle[-1] {w-$radius},100%,100%,0,1,{ia} +blur[-1] {$radius/2} +xmin={xm} +ymin={ym} +remove[-1] ++crop[0] {$xmin-$radius},{$ymin-$radius},{$xmin+$radius},{$ymin+$radius} +minnoise=${-variance_noise} +remove[-1] ++sub[0] {250*256} +abs[-1] +rectangle[-1] 0,0,100%,$radius,1,{ia} +rectangle[-1] 0,0,$radius,100%,1,{ia} +rectangle[-1] 0,100%,100%,{h-$radius},1,{ia} +rectangle[-1] {w-$radius},100%,100%,0,1,{ia} +blur[-1] {$radius/2} +xmax={xm} +ymax={ym} ++crop[0] {$xmax-$radius},{$ymax-$radius},{$xmax+$radius},{$ymax+$radius} +maxnoise=${-variance_noise} +remove[-1] ++sub[0] {128*256} +abs[-1] +rectangle[-1] 0,0,100%,$radius,1,{ia} +rectangle[-1] 0,0,$radius,100%,1,{ia} +rectangle[-1] 0,100%,100%,{h-$radius},1,{ia} +rectangle[-1] {w-$radius},100%,100%,0,1,{ia} +blur[-1] {$radius/2} +xave={xm} +yave={ym} +remove[-1] ++crop[0] {$xave-$radius},{$yave-$radius},{$xave+$radius},{$yave+$radius} +midnoise=${-variance_noise} +text[-1] $midnoise,0,0,25,1,{iM} ++sub[0] {64*256} +abs[-1] +rectangle[-1] 0,0,100%,$radius,1,{ia} +rectangle[-1] 0,0,$radius,100%,1,{ia} +rectangle[-1] 0,100%,100%,{h-$radius},1,{ia} +rectangle[-1] {w-$radius},100%,100%,0,1,{ia} +blur[-1] {$radius/2} +xshadow={xm} +yshadow={ym} +remove[-1] ++crop[0] {$xshadow-$radius},{$yshadow-$radius},{$xshadow+$radius},{$yshadow+$radius} +shadownoise=${-variance_noise} ++sub[0] {192*256} +abs[-1] +rectangle[-1] 0,0,100%,$radius,1,{ia} +rectangle[-1] 0,0,$radius,100%,1,{ia} +rectangle[-1] 0,100%,100%,{h-$radius},1,{ia} +rectangle[-1] {w-$radius},100%,100%,0,1,{ia} +blur[-1] {$radius/2} +xbright={xm} +ybright={ym} +remove[-1] ++crop[0] {$xbright-$radius},{$ybright-$radius},{$xbright+$radius},{$ybright+$radius} +brightnoise=${-variance_noise} +shadows={(($minnoise/$shadownoise)*64)} +mids={(($minnoise/$midnoise)*64)} +brights={(($minnoise/$brightnoise)*64)} +whites={(($minnoise/$maxnoise)*64)} +point1={$shadows+32} +point2={$mids+$shadows+32} +point3={$brights+$mids+$shadows+32} +point4={$whites+$brights+$mids+$shadows+32} +keep[0] +apply_curve[0] 0,0,0,{32*256},{32*256},{96*256},{$point1*256},{160*256},{$point2*256},{223*256},{$point3*256},{287*256},{$point4*256} +div[0] 256 +else +apply_gamma {1/$17} +fi +rgb2ycbcr +split c +if $1>0 +if $11==0 ++denoise_haar[0] $luma_strength,0,{$quality*10} +fi +if $11==1 ++ms_patch[0] 10,{$luma_strength*2.5},3,5,0,1,1,0,{$luma_strength*.75},{$luma_strength*.5},{$luma_strength*0},{$luma_strength*0},1,1,1,0 +fi +if $11==2 ++autonr2[0] $luma_strength,1 +fi +if $11==3 ++median[0] 3 +ms_patch[-1] 10,{$luma_strength*2.5},3,5,0,1,1,0,{$luma_strength*.75},{$luma_strength*.5},{$luma_strength*0},{$luma_strength*0},1,1,1,0 +fi +if $11==4 ++msmed2[0] 3 +repeat $1 +msmed2[-1] 3 +done +fi ++sub[0] [-1] +add[-1] {128} +remove[0] +if $recovery==1 +resize[-1] {w+48},{h+48},{d},{s},0,0,0,0 +resize[-1] {w+48},{h+48},{d},{s},0,0,1,1 +rectangle[-1] 0,0,100%,48,1,128 +rectangle[-1] 0,0,48,100%,1,128 +rectangle[-1] 0,100%,100%,{h-48},1,128 +rectangle[-1] {w-48},100%,100%,0,1,128 +fft_tile3[-1] {$detail_recovery},48,0,$fine_detials,$medium_detials,$large_details,1,$quality +crop[-1] 48,48,{w-49},{h-49} +else +fill[-1] 128 +fi +unsharp[-1] $detail_radius,$detail_amount,$detail_threshold +unsharp[2] $edge_radius,$edge_amount,$edge_threshold +sub[-1] {128} +add[2] [-1] +remove[-1] +else +move[0] 3 +fi +if $2>0 +median[0,1] 3 +median[0,1] 3 +if $12==1 +ms_patch[0] 10,1,3,5,0,1,1,0,{$colour_strength*1},{$colour_strength*.5},{$colour_strength*.25},{$colour_strength*0},0,1,1,0 +ms_patch[1] 10,1,3,5,0,1,1,0,{$colour_strength*1},{$colour_strength*.5},{$colour_strength*.25},{$colour_strength*0},0,1,1,0 +fi +if $12==0 +denoise_haar[0] $colour_strength,0,{$quality*3} +denoise_haar[1] $colour_strength,0,{$quality*3} +fi +fi +move[-1] 0 +append c +ycbcr2rgb +if 16==1 +mul[0] 256 +apply_curve[0] 0,0,0,{32*256},{32*256},{$point1*256},{96*256},{$point2*256},{160*256},{$point3*256},{223*256},{$point4*256},{287*256} +div[0] 256 +else +apply_gamma $17 +fi +c 0,255 +ms_patch_smoothing: +ac "repeat $7 denoise $1,$2,$3,$4,$5,$6 done",$8,0 c 0,255 +ms_patch_2: ++resize[0] 50%,50%,1,{s},2 ++ms_patch_smoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 ++resize[1] {0,w},{0,h},1,{s},5 ++sub[0] [3] +resize[2] {0,w},{0,h},1,{s},5 ++add[2] [4] +keep[-1] +c 0,255 +ms_patch_3: ++resize[0] 25%,25%,1,{s},2 ++ms_patch_smoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 ++resize[1] {0,w},{0,h},1,{s},5 ++sub[0] [3] +resize[2] {0,w},{0,h},1,{s},5 ++add[2] [4] +keep[-1] +c 0,255 +ms_patch_4: ++resize[0] 12.5%,12.5%,1,{s},2 ++ms_patch_smoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 ++resize[1] {0,w},{0,h},1,{s},5 ++sub[0] [3] +resize[2] {0,w},{0,h},1,{s},5 ++add[2] [4] +keep[-1] +c 0,255 +ms_patch_5: ++resize[0] 6.125%,6.125%,1,{s},2 ++ms_patch_smoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 ++resize[1] {0,w},{0,h},1,{s},5 ++sub[0] [3] +resize[2] {0,w},{0,h},1,{s},5 ++add[2] [4] +keep[-1] +c 0,255 +ms_patch: +apply_gamma {1/$14} +repeat $15 +if $13==1 +ms_patch_smoothing[-1] $1,$2,$3,$4,$5,$6,$7,$8 +fi +if $9>0.1 +ms_patch_2 $1,$9,$3,$4,$5,$6,$7,$8 +fi +if $10>0.1 +ms_patch_3 $1,$10,$3,$4,$5,$6,$7,$8 +fi +if $11>0.1 +ms_patch_4 $1,$11,$3,$4,$5,$6,$7,$8 +fi +if $12>0.1 +ms_patch_5 $1,$12,$3,$4,$5,$6,$7,$8 +fi +done +apply_gamma $14 +c 0,255 +msmed2: +medlvl2=2 +medlvl3=3 +medlvl4=4 +medlvl5=6 +medlvl6=6 +medlvl7=7 +median $1 +median $1 +name[0] full ++resize[full] {full,w/$medlvl2},{full,h/$medlvl2},1,{s},2 +name[-1] level2 ++resize[level2] {0,w},{0,h},1,{s},3,1 +name[-1] low2 ++compose_grainextract[full,low2] +name[-1] level2high +remove[low2] +median[level2] $1 +median[level2] $1 +name[1] level2 ++resize[level2] {full,w/$medlvl3},{full,h/$medlvl3},1,{s},2 +name[-1] level3 ++resize[level3] {level2,w},{level2,h},1,{s},3,1 +name[-1] low3 ++compose_grainextract[level2,low3] +name[-1] level3high +remove[1,low3] +median[2] $1 +median[2] $1 +name[2] level3 ++resize[level3] {full,w/$medlvl4},{full,h/$medlvl4},1,{s},2 +name[-1] level4 ++resize[level4] {level3,w},{level3,h},1,{s},3,1 +name[-1] low4 ++compose_grainextract[level3,low4] +name[-1] level4high +remove[2,low4] +median[-2] $1 +median[-2] $1 +name[-2] base +resize[base] {level4high,w},{level4high,h},1,{s},3,1 +compose_grainmerge[-1,-2] +name[-1] base +resize[base] {level3high,w},{level3high,h},1,{s},3,1 +compose_grainmerge[-1,-2] +resize[-1] {full,w},{full,h},1,{s},3,1 +compose_grainmerge[-1,-2] +keep[-1] +nr5_preview: +if $-1==0 +nr5 $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17 +fi +if $-1==1 ++nr5 $1,$2,$3,$4,$5,0,$7,$8,0,$10,$11,$12,$13,$14,$15,$16,$17 +sub[0] [1] +keep[0] +mul 2 +add 128 +fi +iain_png_processing: +repeat $! l[$>] +nm=${-gui_layer_name} +dither_pattern=$3 +do_smooth=$4 +smooth_radius=$5 +smooth_amount=$6 +do_sharp=$7 +sharp_radius=$8 +sharp_amount=$9 +sharp_threshold=$10 +constrant_radius=$11 +overshoot=$12 +do_median=$13 +median_radius=$14 +median_repeat=$15 +remove_opacity +if $do_smooth +bilateral[0] $smooth_radius,$smooth_amount +fi +if $do_sharp +iain_constrained_sharpen[0] $sharp_radius,$sharp_amount,$sharp_threshold,$constrant_radius,$overshoot,0,1 +fi ++colormap $1,$2,1 +if $dither_pattern==2 ++index[0] [1],1,0 +elif $dither_pattern!=2 ++index[0] [1],0,0 +fi ++map[-1] [-2] +if $dither_pattern<=1 ++sub[0] [-1] +abs[-1] ++add[0] [4] ++sub[0] [4] +index[-1] [1],0,0 +index[-2] [1],0,0 +l[-1,-2] +if $dither_pattern==1 +(0,255;255,0) +elif $dither_pattern==0 +(0;255) +fi +resize_as_image[-1] [0],0,2 +channels[-1] 0 +append[-1,-2] c +blend alpha +done +if $do_median +repeat $median_repeat +l[-1] +repeat ($median_radius*2)+1 +amount={$>-$median_radius} +if $amount!=0 ++shift[0] $amount,0,0,0,0 +fi +done +blend_median +done +done +fi ++map[-1] [1] +k[-1] +else +rm[-1] +if $do_median +repeat $median_repeat +horiz_median[-1] $median_radius +done +fi ++map[-1] [1] +k[-1] +fi +nm name($nm) +done done +iain_savenoiseprint_p: +if $1==0 +text "creating noiseprint",0,0,50,1,255 +elif $1==1 +iain_savenoiseprint[0,1] $1,$2,$3 +fi +iain_savenoiseprint: +remove_opacity +rgb2yuv8 +split c +remove[-1,-2] +l[0,3] +apply_parallel_overlap[0] "mul {1/255} pow $3 mul 255 ",0,0 +apply_parallel_overlap[1] "mul {1/255} pow $3 mul 255 ",0,0 ++sub[1] [0] +add[-1] 128 +l[-1] +if $1==0 ++l +size=48 +cropwidth={w} +cropheight={h} +resize[0] {w+($size-w%$size)},{h+($size-h%$size)},1,{s},0,1 +tc={round(w/$size)} tr={round(h/$size)} +l[0] +split_tiles $tc,$tr +repeat $! local[$>] +fftpolar[0] +append[0,1] z +done done +median_median +done +o noiseprint.cimg +rm +done +elif $1==1 +size=48 +cropwidth={w} +cropheight={h} +resize[0] {w+($size-w%$size)},{h+($size-h%$size)},1,{s},0,1 +tc={round(w/$size)} tr={round(h/$size)} +i noiseprint.cimg +mul[-1] $2 ++l[0,1] +split_tiles[0] $tc,$tr +repeat $!-1 +l[$>,-1] +[-1] +l[0,1] +fftpolar[0] +l[0,-1] +split[1] z +rm[-1] ++gt[0] [1] +circle[-1] 50%,50%,1%,1,1 +mul[0] [-1] +keep[0] +done +ifftpolar +done +done +done +rm[-1] +append_tiles $tc,$tr +done ++l[0,1] +shift[0] 16,16,0,0 +split_tiles[0] $tc,$tr +repeat $!-1 +l[$>,-1] +[-1] +l[0,1] +fftpolar[0] +l[0,-1] +split[1] z +rm[-1] ++gt[0] [1] +circle[-1] 50%,50%,1%,1,1 +mul[0] [-1] +keep[0] +done +ifftpolar +done +done +done +rm[-1] +append_tiles $tc,$tr +shift[0] -16,-16,0,0 +done +l[0,1] +shift[0] 32,32,0,0 +split_tiles[0] $tc,$tr +repeat $!-1 +l[$>,-1] +[-1] +l[0,1] +fftpolar[0] +l[0,-1] +split[1] z +rm[-1] ++gt[0] [1] +circle[-1] 50%,50%,1%,1,1 +mul[0] [-1] +keep[0] +done +ifftpolar +done +done +done +rm[-1] +append_tiles $tc,$tr +shift[0] -32,-32,0,0 +done +iain_fast_median_stack +crop 0,0,{$cropwidth-1},{$cropheight-1} +c 0,255 +fi +done +sub[-1] 128 +add[0] [-1] +keep[0] +apply_parallel_overlap[0] "mul {1/255} pow {1/$3} mul 255 ",0,0 +done +append c +yuv82rgb +c 0,255 +if $1==0 +rm +fi +median_median: +repeat $!/3-($!%3) +l[$>,{$>+1},{$>+2}] +iain_fast_median_stack +done +done +repeat $!/3-($!%3) +l[$>,{$>+1},{$>+2}] +iain_fast_median_stack +done +done +repeat $!/3-($!%3) +l[$>,{$>+1},{$>+2}] +iain_fast_median_stack +done +done +num=$! +add +div $num +simplelocalcontrast_p: +to_rgb +[0] +apply_parallel_overlap[1] " +simplelocalcontrast[0] ${1-6}",{30+$3},$12 ++luminance[-1] +apply_curve[-1] 0,0,$7,64,$8,128,$9,196,$10,255,$11 +mul[-1] 255 +append[1,2] c +blend alpha,1,0 +simplelocalcontrast: +str1=$1 +str2={$str1*0.7} +str3={$str2*0.7} +str4={$str3*0.7} +str5={$str4*0.7} +str6={$str5*0.7} +str7={$str6*0.7} +str8={$str7*0.7} +apply_gamma $5 +conttest4 $4,$str1,$str2,$str3,$str4,$str5,$str6,$str7,$str8,$2,$3,$3,$3,$3,$3,$3,2,1 +apply_gamma $6 +n 0,255 +conttest4: +to_rgb +if $1==1 ++luminance ++smoothbase4[-1] $2,$3,$4,$5,$6,$7,$8,$9,$10 ++compose_grainextract[-1,-2] +ms_smooth[-1] $11,$12,$13,$14,$15,$16,$17,$18,1 +remove[1,2] +sub[-1] 128 mul[-1] 2 add[-1] 128 ++compose_grainmerge +remove[0,1] +else ++smoothbase4 $2,$3,$4,$5,$6,$7,$8,$9,$10 ++compose_grainextract +ms_smooth[-1] $11,$12,$13,$14,$15,$16,$17,$18,1 +remove[1] +sub[-1] 128 mul[-1] 2 add[-1] 128 ++compose_grainmerge +remove[1] +rgb2hsv +split c +remove[1,2,3] +append c +hsv2rgb +fi +smoothbase4: +repeat $9 +cropwidth={w} +cropheight={h} +resize[0] {w+(256-w%256)},{h+(256-h%256)},1,{s},0,1 +width={w} +height={h} +if $1!=0 +denoise[0] 10,$1,3,5,0,1 +fi ++resize[0] {$width/2},{$height/2},1,{s},2,1 ++resize[-1] $width,$height,1,{s},3,1 +blur[-1] .5 +compose_grainextract[0,-1] +if $2!=0 +denoise[-1] 10,$2,3,5,0,1 +fi ++resize[-1] {$width/4},{$height/4},1,{s},2,1 ++resize[-1] {$width/2},{$height/2},1,{s},3,1 +blur[-1] .5 +compose_grainextract[1,-1] +if $3!=0 +denoise[-1] 10,$3,3,5,0,1 +fi ++resize[-1] {$width/8},{$height/8},1,{s},2,1 ++resize[-1] {$width/4},{$height/4},1,{s},3,1 +blur[-1] .5 +compose_grainextract[2,-1] +if $4!=0 +denoise[-1] 10,$4,3,5,0,1 +fi ++resize[-1] {$width/16},{$height/16},1,{s},2,1 ++resize[-1] {$width/8},{$height/8},1,{s},3,1 +blur[-1] .5 +compose_grainextract[3,-1] +if $5!=0 +denoise[-1] 10,$5,3,5,0,1 +fi ++resize[-1] {$width/32},{$height/32},1,{s},2,1 ++resize[-1] {$width/16},{$height/16},1,{s},3,1 +blur[-1] .5 +compose_grainextract[4,-1] +if $6!=0 +denoise[-1] 10,$6,3,5,0,1 +fi ++resize[-1] {$width/64},{$height/64},1,{s},2,1 ++resize[-1] {$width/32},{$height/32},1,{s},3,1 +blur[-1] .5 +compose_grainextract[5,-1] +if $7!=0 +denoise[-1] 10,$7,3,5,0,1 +fi ++resize[-1] {$width/128},{$height/128},1,{s},2,1 ++resize[-1] {$width/64},{$height/64},1,{s},3,1 +blur[-1] .5 +compose_grainextract[6,-1] +if $8!=0 +denoise[-1] 10,$8,3,5,0,1 +fi ++resize[-1] {$width/256},{$height/256},1,{s},2,1 ++resize[-1] {$width/128},{$height/128},1,{s},3,1 +blur[-1] .5 +compose_grainextract[7,-1] +resize[-1] {$width/128},{$height/128},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/64},{$height/64},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/32},{$height/32},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/16},{$height/16},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/8},{$height/8},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/4},{$height/4},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/2},{$height/2},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +resize[-1] {$width/1},{$height/1},1,{s},3,1 +blur[-1] .5 +compose_grainmerge[-1,-2] +crop 0,0,{$cropwidth-1},{$cropheight-1} +done +iain_fx_skin_mask_pr: +if $6==0 +iain_skin_mask $1,$2,$3,$4,$5 +elif $6==1 ++iain_skin_mask $1,$2,$3,$4,1 +n[-1] 0.6,1 +mul +fi +iain_fx_skin_mask: +tic +apply_parallel_overlap[0] "iain_skin_mask[0] ${1--1}",0,0 +toc +iain_skin_mask: +dark={$1} +pale={255-$2} +red={255-$3} +yellow={255-$4} +to_rgb +[0] +[0] +[0] +l[1] +if $3>0 +red={255-$3} +fill if(i(x,y,z,0)-i(x,y,z,1)<{$red},i,0) +gt 0 +else +fill 1 +fi +done +l[2] +rgb2cmyk +dark={$1} +pale={255-$2} +fill if(i(x,y,z,2)>i(x,y,z,1),if(i(x,y,z,2)-i(x,y,z,1)<{$dark},if((i(x,y,z,0)+{$pale})0 +yellow={255-$4} +rgb2hsv +split c +keep[0] +add[0] 180 +mod[0] 360 +lt[0] $yellow +else +fill 1 +fi +done +mul[1,2,3] +mul[1] 255 +channels[1] 0 +if $5 +keep[1] +else +append c +fi +iain_smartdemos: +cropwidth={w} +cropheight={h} +resize[0] {w+(64-w%64)},{h+(64-h%64)},{d},{s},0,2 +apply_parallel_overlap " +to_rgb +add 1000 +rgb2bayer[0] $1,1 ++l[0] ++l[0] +split c +l[0,2] +(0,0,.5;0,1,0;0.5,0,0) +convolve[0] [-1] +convolve[1] [-1] +rm[-1] +(0,0,.25;0,.5,0;0.25,0,0) +convolve[0] [-1] +convolve[1] [-1] +rm[-1] +done +done +split[0] c +name[0] red name[1] green name[2] blue +name[3] redblur name[4] greenblur name[5] blueblur ++div[redblur] [blueblur] +replace_nan 0 ++mul[blue] [-1] +add[-1] [red] ++div[blueblur] [redblur] +replace_nan 0 ++mul[red] [-1] +add[-1] [blue] +keep[1,-1,-3] +reverse[0,1] +append c +done +l[0] ++l[0] +split c +l[0,2] +(0.5,0,0;0,1,0;0,0,0.5) +convolve[0] [-1] +convolve[1] [-1] +rm[-1] +(0.25,0,0;0,.5,0;0,0,0.25) +convolve[0] [-1] +convolve[1] [-1] +rm[-1] +done +done +split[0] c +name[0] red name[1] green name[2] blue +name[3] redblur name[4] greenblur name[5] blueblur ++div[redblur] [blueblur] +replace_nan 0 ++mul[blue] [-1] +add[-1] [red] ++div[blueblur] [redblur] +replace_nan 0 ++mul[red] [-1] +add[-1] [blue] +keep[1,-1,-3] +reverse[0,1] +append c +done ++l[0] +(.33,0,0,0,0;0,.66,0,0,0;0,0,-2,0,0;0,0,0,.66,0;0,0,0,0,.33) +convolve[0] [1] +rm[1] +abs +split c +rm[1] +max +done ++l[1] +(0,0,0,0,.33;0,0,0,.66,0;0,0,-2,0,0;0,.66,0,0,0;.33,0,0,0,0) +convolve[0] [1] +rm[1] +abs +split c +rm[1] +max +done +blur[-1,-2] 2 +sub[-1,-2] +gt[-1] 0 +mul[-1] 255 +append[1,2] c +blend alpha,1,0 ++l[0] +split[0] c +add[0,2] +mul[0] 0.5 +reverse +=>[0] green =>[1] magenta +[0] [1] +=>[-2] greenblur =>[-1] mblur +(0.25;.5;0.5;.5;0.25) +convolve[mblur] [-1] rm[-1] +(0.5;1;0.5) +convolve[greenblur] [-1] +rm[-1] ++div[greenblur] [mblur] +replace_nan 0 +=>[-1] mmul +rm[greenblur,mblur] +mul[magenta] [mmul] +keep[green,magenta] +add +done ++l[0] +split[0] c +add[0,2] +mul[0] 0.5 +reverse +=>[0] green =>[1] magenta +[0] [1] +=>[-2] greenblur =>[-1] mblur +(0.25,.5,0.5,.5,0.25) +convolve[mblur] [-1] rm[-1] +(0.5,1,0.5) +convolve[greenblur] [-1] +rm[-1] ++div[greenblur] [mblur] +replace_nan 0 +=>[-1] mmul +rm[greenblur,mblur] +mul[magenta] [mmul] +keep[green,magenta] +add +done +sub 1000 +c 0,255 ++l[0,1] +rgb2bayer[0] $1,1 ++to_rgb[1] +rgb2bayer[-1] $1,1 +split[0] c +split[-1] c +sub[0] [4] +sub[2] [6] +(0.25,0.5,0.25;0.5,1,0.5;0.25,0.5,0.25) +convolve[0] [-1] +convolve[2] [-1] +remove[-1] +add[0] [3] +add[2] [3] +remove[1,4,5,6] +reverse[1,2] +append c +done +l[0,2] +rgb2bayer[0] $1,1 ++to_rgb[1] +rgb2bayer[-1] $1,1 +split[0] c +split[-1] c +sub[0] [4] +sub[2] [6] +(0.25,0.5,0.25;0.5,1,0.5;0.25,0.5,0.25) +convolve[0] [-1] +convolve[2] [-1] +remove[-1] +add[0] [3] +add[2] [3] +remove[1,4,5,6] +reverse[1,2] +append c +done +rm[1] +replace_inf 255 +replace_nan 0 +reverse +l[0] ++blur $2 +sub[0] [1] +add[0] 128 +done +l[2] ++blur $2 +sub[0] [1] +add[0] 128 +done +l[0,2] +nozip $3 +done +l[-1,-2] ++l[0] ++l +split c +add +div 3 +done +sub ++blur 3 +sub +abs +split c +max +done ++l[1] ++l +split c +add +div 3 +done +sub ++blur 3 +sub +abs +split c +max +done +l[-1,-2] +blur 2 +sub +gt 0 +mul 255 +done +append[1,2] c +blend alpha,1,0 +done +sub[0] 128 +add +c 0,255 +",16,0 +crop 0,0,{$cropwidth-1},{$cropheight-1} +time=$| +iain_split_orientation_preview: +if $7 +iain_draw_angle $1,$2,$5 +else +iain_split_orientation $1,$2,$3,$4,$5,$6,$7,$8,$9 +iain_draw_angle $1,$2,$5 +fi +iain_split_orientation: +residual=$4 +snap=$5 +cutoff_steepness=$6 +x_point={($1-50)/100} +y_point={($2-50)/100} +angle_rad={-1*(atan($x_point/$y_point))} +if $8 +angle_rad={$angle_rad+(pi/2)} +fi +angle_deg={$angle_rad/pi*180} +angle_deg_snap={round(($angle_deg+180),$snap)-180} +angle_rad_snap={$angle_deg_snap/180*pi} +radians={$angle_rad_snap+(pi/2)} +width={($3/180)*pi} +if $8 +width={((180-$3)/180)*pi} +fi +remove_opacity ++blur[0] $residual +sub[0] [-1] +100%,100% +fill[-1] ($radians+atan((0.5-(x/w))/(0.5-(y/h)))-$width/2)%pi +low_angle={pi-$width} +high_angle={pi+$width} +fill[-1] if($high_angle>i&&i>$low_angle,1,0) +radians=$radians+($width) ++fftpolar[0] +blur_angular[2] $cutoff_steepness +c[2] 0,1 +mul[3] [2] +rm[2] +ifftpolar[-1,-2] +sub[0] [-1] +add[0,1] +reverse +if $9==0 +k[0] +add[0] 128 +elif $9==1 +add[0] 128 +=>[0] "mode(grainmerge), name" +elif $9==2 +k[1] +fi +iain_draw_angle: +repeat $! +l[$<] +snap=$3 ++l[0] +remove_opacity +fill 0 +x_point={($1-50)/100} +y_point={($2-50)/100} +angle_rad={-1*(atan($x_point/$y_point))} +angle_deg={$angle_rad/pi*180} +angle_deg_snap={round(($angle_deg+180),$snap)-180} +angle_rad_snap={$angle_deg_snap/180*pi} +if (sin($angle_rad))==0 angle_rad=0$angle_rad+.0001 fi +if (cos($angle_rad))==0 angle_rad=0$angle_rad+.0001 fi +hypotenuse_x={$x_point/(sin($angle_rad))} +hypotenuse_y={$y_point/(cos($angle_rad))} +line_x={((sin($angle_rad)*$hypotenuse_x)+0.5)*w} +line_y={((cos($angle_rad)*$hypotenuse_y)+0.5)*h} +line_x_snap={((sin($angle_rad_snap)*($hypotenuse_x))+0.5)*w} +line_y_snap={((cos($angle_rad_snap)*($hypotenuse_y))+0.5)*h} +text_hyp_x={$hypotenuse_x+(sign($hypotenuse_x)*0.05)} +text_hyp_y={$hypotenuse_y+(sign($hypotenuse_y)*0.05)} +text_x={((sin($angle_rad_snap)*($text_hyp_x))+0.5)*w} +text_y={((cos($angle_rad_snap)*($text_hyp_y))+0.5)*h} +poly_hyp_x={sign($hypotenuse_x)} +poly_hyp_y={sign($hypotenuse_y)} +poly_x1={((sin($angle_rad_snap)*($poly_hyp_x))+0.5)*w} +poly_y1={((cos($angle_rad_snap)*($poly_hyp_y))+0.5)*h} +poly_x2={((sin($angle_rad)*($poly_hyp_x))+0.5)*w} +poly_y2={((cos($angle_rad)*($poly_hyp_y))+0.5)*h} +100%,100%,1,1,0 +rm[0] +circle[-1] 50%,50%,{abs($hypotenuse_x)*w},1,255,255,255,255 +circle[-1] 50%,50%,{(abs($hypotenuse_x)*w)-2},1,0,0,0,255 +100%,100%,1,1,0 +polygon[-1] 3,50%,50%,$poly_x1,$poly_y1,$poly_x2,$poly_y2,1,1 +mul[-1] [-2] +rm[-2] +[-1] ++iain_draw_conical_lines[-1] 6,3 +mul[-1,-3] +mul[-1] {80/255} +to_rgb[-2] +append[-1,-2] c +100%,100%,1,1,0 +linethick[-1] 50%,50%,$line_x,$line_y,2,1,255 +linethick[-1] 50%,50%,$line_x_snap,$line_y_snap,2,1,255 ++iain_draw_radial_lines[-1] 8,4 +mul[-1,-2] +100%,100%,1,1,0 +linethick[-1] 50%,50%,$line_x,$line_y,2,1,80 +linethick[-1] 50%,50%,$line_x_snap,$line_y_snap,2,1,160 +to_rgb[-2] +append[-1,-2] c +max +text[-1] {round($angle_deg_snap,1)},$text_x,$text_y,17,1,255 +done +blend alpha +done +done +iain_draw_conical_lines: +100%,100%,1,1 +rm[0] +radians=0 +width=0 +fill[0] ($radians+atan((0.5-(x/w))/(0.5-(y/h)))-$width/2)/pi*360 +mod $1 +lt $2 +iain_draw_radial_lines: +100%,100%,1,1 +rm[0] +set 1,50%,50% +distance 1 +mod $1 +lt $2 +star_tone: +sx1=50 +sx2=194 +sx3=281 +sx4=511 +sx5=742 +sx6=829 +sx7=972 +sx8=829 +sx9=742 +sx10=511 +sx11=281 +sx12=192 +sy1=450 +sy2=633 +sy3=849 +sy4=817 +sy5=849 +sy6=633 +sy7=450 +sy8=267 +sy9=50 +sy10=83 +sy11=50 +sy12=267 +level=10 +luminance ++l +rm +2000,2000,1,1,0 +repeat 8 +polygon 12,$sx1,$sy1,$sx2,$sy2,$sx3,$sy3,$sx4,$sy4,$sx5,$sy5,$sx6,$sy6,$sx7,$sy7,$sx8,$sy8,$sx9,$sy9,$sx10,$sy10,$sx11,$sy11,$sx12,$sy12,1,$level +sx2={$sx2+40} +sx6={$sx6-40} +sx8={$sx8-40} +sx12={$sx12+40} +sy2={$sy2-23} +sy4={$sy4-47} +sy6={$sy6-23} +sy8={$sy8+23} +sy10={$sy10+47} +sy12={$sy12+23} +level={$level+25} +done +n 0,255 +resize 200,200,1,1,3 ++shift[0] -69,-40,0,0 ++shift[0] -69,40,0,0 ++shift[0] 69,-40,0,0 ++shift[0] 69,40,0,0 +add +crop 5,5,142,84 +done +resize[-1] $1,$1,1,1,2 +width={w} +height={h} +w_tiles={0,round(w/$width)} +h_tiles={0,round(h/$height)} +total_tiles=$h_tiles*$w_tiles +[-1]x{$total_tiles-1} +append_tiles[1--1] $w_tiles,$h_tiles +equalize[-1] 256 +blend alpha,0.5,1 +gt 128 +mul 255 +iain_sub_cast: +repeat $! l[$>] +srgb2rgb ++median[0] 3 +bilateral[0] [1],10,$1 +rm[1] ++resize[0] 10%,10%,100%,100%,2 +dilate[1] 21 +split[1] c +fill[1] {1,ia} +fill[2] {2,ia} +fill[3] {3,ia} +append[1,2,3] c +resize[1] [0] +sub[0] [1] +k[0] +n[0] 0,255 +c[0] $2,$3 +n 0,255 +rgb2srgb +nm name($nm) +done done +iain_turbulent_halftone: +repeat $! local[$>] +if $8>0 ++iain_fast_denoise $8,0,1,0,0 +sub[1] [0] +mul[1] -1 +add +fi +if $7==1 +rgb2cmyk +elif $7==2 +luminance +fi +split c +repeat $! local[$>] ++l[0] +channels 0 +tsize={min($5,w,h)} +xtile={(round(w/$tsize))+1} +ytile={(round(h/$tsize))+1} +$tsize,$tsize +fx_seamless_turbulence[-1] $1,$2,$3,$4,.25,0 +[-1]x{$xtile*$ytile} +append_tiles[1--1] $xtile,$ytile +remove[-1] +crop[-1] 0,0,{0,w},{0,h} +keep[-1] +done +blur[-1] $6 +l[-1] +blur 10 sub done +n[-1] 0,255 +equalize[-1] 256 +if $9 +resize 400%,400%,100%,100%,3 +fi +blend alpha,0.5,1 +gt 128 +mul 255 +done done +append c +if $7==1 +cmyk2rgb +fi +if $9 +resize 25%,25%,100%,100%,3 +fi +done done +iain_turbulent_halftone_preview: +iain_turbulent_halftone $1,$2,$3,$4,{0,w},$6,$7,$8,$9 +jeje_render3d : +W={0,w} +1,2,1,4 f. $9,$13,$10,$14,$11,$15,$12,$16 r. {0,w},{0,h},1,4,5 +blend alpha +i "$1" a[1--1] z +l. +if $17 display_volume $2,$3,$4 else jeje_boundingbox3d 20 fi +r3d 0,0,1,$7 +r3d 0,1,0,$6 +r3d 1,0,0,$5 +c3d n3d *3d {3*$W*$8/4} +done +object3d[0] [1],50%,50%,0,1 +n 0,255 +rm[1] +jeje_render3d_preview : +jeje_render3d $"*" +jeje_deconvolve : +if $2==1 +deconvolve_goldmeinel[0] [1],$1 n[0] 0,255 +else +deconvolve_richardsonlucy[0] [1],$1 n[0] 0,255 +fi +jeje_deconvolve_preview : +gui_split_preview "jeje_deconvolve $1,$2,$3",$4 +jeje_zernike : +zernike {$1*w/100},{$2*h/100},{$3*w/100},${4-18} +n 0,255 +if $19 f '100*((i/$20)%1)<$21' n 0,255 fi +jeje_zernike_preview : +gui_split_preview "jeje_zernike $*",$-1 +jpr_about : fx_logo "@jayprich filters" +#@cli jpr_colourillusion : +#@cli : Use -d0 ( or -w -1,-1,0 -d ) to avoid normalisation of colours +#@cli : optical illusion involving color spirals +#@cli : visual "green arm" and "blue arm" contain the same color +jpr_colourillusion : +arm={$1*1.5-1} +{w},{h},1,1,A=10+atan2(x-{w/2},y-{h/2})*$arm/pi;R=sqrt((x-{w/2})^2+(y-{h/2})^2)/$2+A;(int(A+R/$arm)+int(R*6-A/$arm)%2)%3 +(250,200,0^20,200,190^160,100,150) +map.. . +k.. +#@cli jpr_coltexindex : +#@cli : Enrich colour with local analysis of luminance and index the image. +#@cli : $ sp swan jpr_coltexindex 8,250,250,15,150,1,0,0,0,10,20,3,1,3,0.25 +jpr_coltexindex : skip ${7=1} +e[^-1] "Index colour and texture of image$? with $1 types ($2,$3) v ($4,$5) x $6 and Smoothness $8 Black $9 Mid $10 White $11" +repeat $! +l[$<] +rgb2yuv s c ++b... $8 ++ge. $10 ++le.. $11 +ge... $9 +b[-5,-4] $12 +if $13 +gradient[-6] xy,4 +a[-7,-6] c +norm[-6] +b[-6] $14 +else ++b[-6] {$14*0.5} +-[-7,-1] +sqr[-6] +b[-6] {$14} +sqrt[-6] +fi +n[-6] 0,1 +*[-6] $15 ++-[-6] {-6,i(0.01*w*$2,0.01*h*$3)} +*. {i(0.01*w*$4,0.01*h*$5)} ++-[-6] {-6,i(0.01*w*$2,0.01*h*$3)} +*. {i(0.01*w*$4,0.01*h*$5)} ++[-2,-1] ++-[-5] {-5,i(0.01*w*$2,0.01*h*$3)} +*. {i(0.01*w*$4,0.01*h*$5)} ++[-2,-1] +/. {i(0.01*w*$4,0.01*h*$5)+0.00001} +c. 0,1 +*. $6 +a[-7--5,-1] c +-[-4] 2 +*[-4,-1] ++... 2 +*[-3,-2] ++colormap.. $1,1,1 +index... . +rm. +*.. 2 ++[-2,-1] +n 0,255 +to_rgb +if $7 +circle $2%,$3%,1%,1,,64,128,255 +circle $4%,$5%,1%,1,,255,64,128 +fi +done +done +#@cli jpr_decimate : +#@cli : Rescale in linear RGB space by cropping the frequency domain weighted +#@cli : to decrease high frequency akin to Lanczos window on Sinc lobes +#@cli : This filter discards the alpha channel +#@cli : High sharpness just crops frequency and gives bad halo +#@cli : $ sp swan > 185 * 255 +jpr_decimate 0.6,1.3 jpr_decimate.. 0.6,1.9 - + 128 +jpr_decimate : skip ${1=0.375},${2=5} +e[^-1] "Decimate scale $1 sharpness $2" +srgb2rgb +repeat $! +l[$<] +nw={round($1*w/2)} +nh={round($1*h/2)} +sc={4*$nw/w*$nh/h} +mid={round(0.5/$1-0.5)} +shift -$mid,-$mid +fft +shift $nw,$nh,0,0,2 +z 0,0,{2*$nw-1},{2*$nh-1} +shift -$nw,-$nh,0,0,2 +f i*min(1,abs(2*x/w-1)*$2)*min(1,abs(2*y/h-1)*$2) +ifft +rm. +* $sc +done +done +rgb2srgb +#@cli :: Input / Output +#@cli tiff3d +#@cli : Input a 3D tif as a 3D image +#@cli : Note: This is useful for loading several 3D image stack +tiff3d : e[^-1] "Load the file $1 as a 3D image." +n=$! +i $1 a[{$n}--1] z +#@cli toff3d +#@cli : Output a 3D tif as a 3D image +toff3d : e[^-1] "Save the 3D image as a tiff file." +repeat $! +o[$>] ${"filename \"$1\","$>} +done +#@cli :: 3D Rendering +#@cli jeje_boundingbox3d : _separation +#@cli : Bounding box of a 3D volume +#@cli : $ 100,100,100 jeje_boundingbox3d +jeje_boundingbox3d : skip ${1=10} +e[^-1] "3D Bounding box." +repeat $! l[$>] +box3d {0,w},{0,h},{0,d} p3d. 1 o3d. 1 +if $1>0 +plane3d {0,w},{0,h},$1,{round({0,h}/{0,w}*$1)} p3d. 1 o3d. .1 +fi +rm[0] +3d +done done +#@cli render_volume : _size,_quality,_opacity +#@cli : Pseudo volumic rendering +#@cli : $ 100,100,100 noise 1 b 10,0 max 0 r 100%,100%,100%,3,0 n 0,100 f 'if(c==0,z*i(x,y,z,0),if(c==1,i(x,y,z,0)*(100-z),0))' render_volume +render_volume : check "${1=8}>3&${2=5}>2&${3=.1}>0" +repeat $! l[$>] +mirror x ++tones {$2+1} rm[1,2] r[1--1] 100%,100%,100%,{0,s} *[1--1] [0] rm[0] +rv +repeat $! i=$< l[$<] +if im!=iM +pointcloud3d gaussians3d $1,{$3*($i+1)/$2} +else +rm +fi +done done ++3d md3d -1 +3d .5,.5,.5 +done done +#@cli display_volume : _size,_quality,_opacity +#@cli : Display the volume with black background, a bounding box +#@cli : and a volumic rendering of the data. +#@cli : $ 100,100,100 noise 1 b 10,0 max 0 r 100%,100%,100%,3,0 n 0,100 f 'if(c==0,z*i(x,y,z,0),if(c==1,i(x,y,z,0)*(100-z),0))' display_volume 8,5,.1 +display_volume : check "${1=8}>3&${2=5}>2&${3=.1}>0" +e[^-1] "Display_volume with size $1 quality $2 and opactiy $3." +repeat $! l[$>] ++jeje_boundingbox3d 20 +render_volume[0] $1,$2,$3 ++3d +done done +d3d_black : 1 d3d[0--2] . rm. +#@cli view3d : _angle1,_angle2 +#@cli : Apply a 3D view defined by two angles +#@cli : $ 50,50,50,3 noise 10 b 5 max 0 n 0,255 display_volume 32,5,1 view3d +view3d : skip ${1=25},${2=-120} +e[^-1] "Apply 3D view." +repeat $! l[$>] +r3d 0,0,1,$1 r3d 1,0,0,$2 +done done +#@cli colordepth +#@cli : Color depth coding +#@cli : $ 100,100,100 noise 1 b 10,0 max 0 colordepth 5 +colordepth : skip ${1=5} +e[^-1] "Colordepth coding with LUT $1." +repeat $! l[$>] +colordepth_volume $1 s z + +done done +#@cli colordepth_volume +#@cli : Make a 3D volume of the same size, color it, resize orignal in color and multiply +colordepth_volume : skip ${1=5} +repeat $! l[$>] +i [0] f. 'z/(d-1)*255' map. $1 r[0] 100%,100%,100%,3 * +done done +colordepth_scale : skip ${1=5} +10,{0,h-10} f. '(h-y)/(h-1)*255' map. $1 frame. 5,5,0,0,0 +#@cli make_axis : _xmin,_xmax,_ymin,_ymax +#@cli : Display an axis around an image +#@cli : $ image.jpg make_axis 0,1,0,1 +make_axis : +e[^-1] "Add axis." +repeat $! l[$>] +frame 1,1,0 +100%,24,1,3,255 axes. $1,$2,{-1},{-1} +24,{0,h},1,3,255 axes. {w},{w},$4,$3 24,24,1,3,255 a[-1,-2] y +a[0,1] y rv a[0,1] x +frame 12,12,255 100%,5,1,3,255,255,255 rv a y +done done +#@cli xlabel : _label +#@cli : Add a label to the x-axis (see make_axis) +#@cli : $ image.jpg make_axis 0,1,0,1 xlabel "x-axis" +xlabel : +e[^-1] "Add a x label." +repeat $! l[$>] +0 t. "$1",0,0,18,1,255,255,255 negate. +lt. 90% +j[0] ..,{{0,w}/2+12-{1,w}/2},{{0,h}-{1,h}},0,0,1,. k[0] +done done +#@cli ylabel : _label +#@cli : Add a label to the y-axis (see make_axis) +#@cli : $ image.jpg make_axis 0,1,0,1 ylabel "y-axis" +ylabel : +e[^-1] "Add a y label." +repeat $! l[$>] +0 t. "$1",0,0,18,1,255,255,255 negate. +rotate. -90 +lt. 90% +j[0] ..,0,{{0,h}/2-12-{1,h/2}},0,0,1,. k[0] +done done +#@cli title : _label +#@cli : Add a title (see make_axis) +#@cli : $ image.jpg make_axis 0,1,0,1 title "title" +title : +e[^-1] "Add a title." +repeat $! l[$>] +0 t. "$1",0,0,18,1,255,255,255 negate. +lt. 90% +j[0] ..,{{0,w}/2-{1,w}/2},0,0,0,1,. k[0] +done done +#@cli :: Feature detections +#@cli jeje_dog : scale1, scale2 +#@cli : Difference of Gaussian filter +#@cli : $ sp 1 jeje_dog +jeje_dog : skip ${1=1},${2=2} +e[^-1] "Difference of Gaussian." +repeat $! l[$>] +b $2 b.. $1 - done done +#@cli quiver2d +#@cli : Display a sequence 2D vector field on a 2D image sequence +#@cli : both being represented az a 3D stack +quiver2d : +e[^-1] "Cumulative sum along z-axis." +s z repeat $!/2 l[$>,{$>+$!/2}] quiver[0] [1],10,1,1,1,255 done done rm[{$!/2}--1] a z +#@cli warp2d : [field] +#@cli : Warp a 2D image stack using a vector field +warp2d : +e[^-1] "Warp a 3d stack using a displacement field." +pass$1 0 repeat $!-1 l[$>,-1] +s z repeat $!/2 l[$>,{$>+$!/2}] +warp[0] [1],1,1,1 +done done rm[{$!/2}--1] a z +done done +#@cli lucas_kanade: scale,smoothing +#@cli : Motion estimation using lucas and kanade approach +#@cli : Works on 2D+t image stacks/ has side effect +#@cli : [vx vy] = [Ixx Ixy; Ixy Iyy]^-1 [Ixt Iyt] +#@cli : $ image.jpg repeat 20 +shift. 1,0,0,0,2 done a z +lucas_kanade 2 n 0,255 frame 2 a x +#@cli : $ image.jpg repeat 20 +shift. 1,1,0,0,2 done a z +lucas_kanade 2 s z repeat $!/2 l[$>,{$>+$!/2}] quiver[0] [1] done done rm[{$!/2}--1] a z +lucas_kanade : skip ${1=2},${2=1} +e[^-1] "Motion estimation with Lucas et Kanade algorithm." +repeat $! l[$>] +blur_xy $2 structuretensors 0 blur_xy $1,$1,0 ++l s c rm[0,-1] *[1,2] *[0,2] rv - done ++l[0] s c rm[3,5] *[0,3] *[1,2] - done +l[0] s c rm[2,4,5] *[0,2] sqr[1] - done +/[1,2] [0] rm[0] a c +done done +#@cli unwarp2d : iteration,scales,smoothness,keep_field +#@cli : Unwarp a 2D+T volume +#@cli : $ image.jpg repeat 20 +shift. 1,0,0,0,2 done a z unwarp2d 10,20 +unwarp2d : skip ${1=5},${2=5},${3=1},${4=0} +e[^-1] "Unwarp a 2D+t volume with $1 iterations, $2 scales and smoothing $3." +repeat $! l[$>] +[0] 100%,100%,100%,2,0 +repeat $1 +k=$> +repeat $2 +if $>==($2-1) s=1 else s={($>+1)/$2} fi scale={$s*100}% ++e $k" "$>" "$s" "$scale" "{1/$s}" "{$3*$s} ++l[1] +norm +r $scale,$scale,100%,1 +lucas_kanade {max(.75,$3*$s)} +* {1/$s} cumulate z +done +r. ..,5 +[-1,-2] ++warp2d[0] [2] rm[1] rv[-1,-2] +done +done +if $4==0 rm[0,2] else rm[0,1] fi +done done +#@cli estimate_shift_core [image] +#@cli : Estimate a translation with a reference images with sub-pixel accuray +#@cli : image.jpg luminance +shift {u},{u},0,0,2 estimate_shift[1] [0] +estimate_shift_core : +e[^-1] "Translation estimation with Lucas et Kanade algorithm." +pass$1 0 repeat $!-1 l[$>,-1] +blur_xy 1 +g[0] xy,0 -[0,1] +sqr[1,2] +*[1,2] [0] *[1,2] rm[0] +Ixy={0,ia} Ixx={1,ia} Iyy={2,ia} Ixt={3,ia} Iyt={4,ia} +vx={-($Iyy*$Ixt-$Ixy*$Iyt)/max(1e-6,$Ixx*$Iyy-$Ixy*$Ixy)} +vy={-($Ixx*$Iyt-$Ixy*$Ixt)/max(1e-6,$Ixx*$Iyy-$Ixy*$Ixy)} +rm 1,2,1,1,$vx,$vy +done done +#@cli multi_resolution_pyramide : _number_of_scales +#@cli : Build a multi-resolution pyramid +multi_resolution_pyramide : +repeat $! l[$<] +repeat $1-1 +r. 50%,50%,50%,100%,2 done rv +done done +#@cli shift_subpixel : [image] +#@cli : Shift an image with subpixel translation +#@cli : $ image.jpg 1,2,1,1,5,10.1 +shift_subpixel[0] [1] +shift_subpixel : +pass$1 0 repeat $!-1 l[$>,-1] +{0,w},{0,h},1,2 f. 'if(c==0,{1,i(0)},{1,i(0,1)})' +warp[0] [2],1,2,1 rm[1,2] +done done +#@cli estimate_shift [image] +#@cli : Estimate a translations between image and ref image [image] +#@cli : using a multi-resolution scheme +#@cli : $ image.jpg luminance +shift 2,3 crop 5%,5%,95%,95% estimate_shift[1] [0],3 +estimate_shift : +e[^-1] "Estimate translation between images and image [$1]." +pass$1 0 repeat $!-1 l[$>,-1] +N={round(log2(min({0,w},{0,h}))-2,1,-1)} +multi_resolution_pyramide $N +1,2 +repeat 3 repeat $N ++*. {-2.0^(-($N-$>-1))} +shift_subpixel[{$N+$>}] . rm.. +estimate_shift_core. [$>] +*. {2.0^($N-$>-1)} ++[-1,-2] +done done +k. *. -1 +done done +#@cli unshift : iterations,number_of_scales +#@cli : Correct drift along Z in a 3D volume (video stabilization) +#@cli : $ image.jpg luminance repeat 10 +shift. {2*u},{2*u},0,0,2 done a z +unshift 1 a x +unshift : skip ${1=1} +e[^-1] "Unshift image stack." +repeat $! l[$>] +repeat $1 +s z repeat $!-1 l[$>,{$>+1}] ++estimate_shift[1] [0] *. -1 +shift_subpixel[1] . rm. +done done +a z +done +done done +#@cli register_lucas_kanade : _iterations, _scale +#@cli : Register images using lucas kanade motion estimation +register_lucas_kanade : skip ${1=10},${2=10} ++lucas_kanade $2 cumulate. z +warp2d +repeat $1 +lucas_kanade. $2 cumulate. z +[-1,-2] +warp2d +done +#@cli detect_events : _scale_xy,_scale_t,_threshold +#@cli : Detect space time events using space time interest points +#@cli : $ 100,100,100 noise 1 b 2 +detect_events , pointscoordinates. r[0] 100%,100%,100%,3,1 n[0] 0,255 circles[0] [1] k[0] +detect_events : skip ${1=1},${2=1},${3=9} +e[^-1] "Detect events with scale_xy $1 scale_z $2 and threshold $3." +repeat $! l[$>] +blur_xy $1 blur_z $2 structuretensors blur_xy $1 blur_z $2 +s z apply_parallel "eigen k[0] s c k[2]" a z +sqrt +thres={{0,ia}+$3*sqrt({0,iv})} ++max_patch[0] 8 threshold[0] $thres * +done done +#@cli detect_spots : _scale,_threshold +#@cli : Detect spots in the image +#@cli : $ 100,100 noise .2,2 b 1 n 0,255 noise 5 +detect_spots , pointscoordinates. r[0] 100%,100%,1,3,1 circles[0] [1] k[0] +detect_spots : skip ${1=1},${2=4} +e[^-1] "Detect events with scale $1 and threshold $2." +repeat $! l[$>] +b $1 +b $1 - thres={$2*${-mad[0]}} ++max_patch[0] 3 +threshold[0] $thres * +done done +#@cli measure_colocalization: +#@cli : Colocalization analysis +#@cli : Overlap RG/R RG/G RG/R+G MOC M1 and M2 +#@cli : $ 256,256,1,2 noise 3 b 5 measure_colocalization +measure_colocalization : +repeat $! l[$>] +if {0,s==2} +s c +gt 0 +sqr[0,1] +*[0] [1] +*[2] [3] +or[2] [3] +O1={{7,is}/{2,is}} +O2={{7,is}/{3,is}} +O={{7,is}/{8,is}} +*[2] [1] *[3] [0] +MOC={{6,is}/sqrt({4,is}*{5,is})} +M1={{3,is}/{0,is}} +M2={{2,is}/{1,is}} +rm 1,6,1,1,$O1,$O2,$O,$MOC,$M1,$M2 +else +e "Needs images with two channels" +1,6,1,1,0,0 +fi +done done +#@cli measure_colocalization_object: +#@cli : Compute the number of intersecting objects +#@cli : in each channels versus the number of objects +#@cli : $ 256,256,1,2 noise 3 b 5 gt 0 measure_object_colocalization +measure_object_colocalization : +repeat $! l[$>] +if {0,s==2} +gt 0 s c label_fg .1 +n1=0 repeat {0,iM} ++eq[0] {$>+1} *. [1] +if iM>0 n1={$n1+1} fi +rm. +done +n1={0,100*$n1/iM} +n2=0 repeat {1,iM} ++eq[1] {$>+1} *. [0] +if iM>0 n2={$n2+1} fi +rm. +done +n2={1,100*$n2/iM} +rm +1,2,1,1,$n1,$n2 +else +e "Needs images with two channels" +1,6,1,1,0,0 +fi +done done +#@cli local_moments : _scale +#@cli : Compute local second order moments tensor +#@cli : http://en.wikipedia.org/wiki/Image_moment +#@cli : $ image.jpg +local_moments 1 +local_moments : skip ${1=1} +repeat $! l[$>] +norm +if d==1 ++*[0] 'x' +*[0] 'y' +*[0] 'x*x' ++*[0] 'x*y' +*[0] 'y*y' b $1 ++sqr[1] /. [0] -[3,-1] /[3] [0] ++*[1,2] /. [0] -[4,-1] /[4] [0] ++sqr[2] /. [0] -[5,-1] /[5] [0] +k[3-5] a c +else ++*[0] 'x' +*[0] 'y' +*[0] 'z' +*[0] 'x*x' ++*[0] 'x*y' +*[0] 'x*z' +*[0] 'y*y' +*[0] 'y*z' ++*[0] 'z*z' b $1 ++sqr[1] /. [0] -[4,-1] /[4] [0] ++*[1,2] /. [0] -[5,-1] /[5] [0] ++*[1,3] /. [0] -[6,-1] /[6] [0] ++sqr[2] /. [0] -[7,-1] /[7] [0] ++*[2,3] /. [0] -[8,-1] /[8] [0] ++sqr[3] /. [0] -[9,-1] /[9] [0] +k[4-9] a c +fi +done done +#@cli smooth_moments : _scale,_iterations,_dt +#@cli : Anisotropic diffusion using local moment tensors +#@cli : $ image.jpg +noise 10 +smooth_moments. 1,10,1 print_psnr +smooth_moments : check "${1=1}>0&${2=100}>0&${3=1}>0" +repeat $! l[$>] ++local_moments. $1 smooth[0] [1],$2,$3,0 k[0] +done done +#@cli pointscoordinates +#@cli : Return the list of points in the image as 3xN or 2xN columns vector +#@cli : $ 100,100 noise .1,2 ==. 1 +pointscoordinates +pointscoordinates : +e[^-1] "Return the list of points in the image." +repeat $! l[$>] +if d>1 +if iM>0 pointcloud3d s3d k[2] s y,{h/3} a x else 0 fi +else +if iM>0 pointcloud3d s3d k[2] s y,{h/3} a x else 0 fi +rows 0,1 +fi +done done +#@cli circles : [x,y,radius,opacity,color,..] || [x,y,z,radius,opacity,color,..] +#@cli : Draw circles on an image +#@cli : $ 512,512,1,3 10,7 noise. 1 n. 0,512 circles[0] [1] k[0] +circles : skip ${2=3},${3=1} +e[^-1] "Draw circles on the image." +pass$1 0 repeat $!-1 l[$>,-1] +if {0,d>1} +if {1,h<4} r[1] 100%,{5+{0,s}},1,1,0 l[1] s y f[3] $2 f[4] $3 f[5--1] 255 a y done fi +repeat {1,w} +x={1,i($>,0)} y={1,i($>,1)} z={1,i($>,2)} r={1,i($>,3)} o={1,i($>,4)} i=$> +repeat {0,s} +if $z>=0&$z<{0,d}-1 +sh[0] $z,$z,$> ellipse. $x,$y,$r,$r,0,$o,0xFFFFFF,{1,i($i,5+$>)} +rm. +fi +done +done +else +if {1,h<3} r[1] 100%,{4+{0,s}},1,1,0 l[1] s y f[2] $2 f[3] $3 f[4--1] 255 a y done fi +repeat {1,w} +x={1,i($>,0)} y={1,i($>,1)} r={1,i($>,2)} o={1,i($>,3)} i=$> col={1,i($>,4)} +repeat {0,s} +sh[0] 0,0,$> ellipse. $x,$y,$r,$r,0,$o,0xFFFFFF,{1,i($i,{4+$>})} +rm. +done +done +fi +done done rm. +#@cli labels : [image] +#@cli : Draw labels on the image +#@cli : The labels are defined by image as +#@cli : in 2D [x,y,label,font_size,opacity,color] +#@cli : in 3D [x,y,z,label,font_size,opacity,color] +#@cli : $ 512,512,1,3 10,2 noise. 1 n. 0,512 labels[0] [1] +labels : +e[^-1] "Draw labels on the image." +pass$1 0 repeat $!-1 l[$>,-1] +if {0,d>1} +if {1,h<4} +r[1] 100%,{6+{0,s}},1,1,0 +l[1] s y f[3] 'x' f[4] 13 f[5] 1 f[6--1] 255 a y done +fi +repeat {1,w} +x={1,i($>,0)} y={1,i($>,1)} z={1,i($>,2)} r={1,i($>,3)} f={1,i($>,4)} o={1,i($>,5)} i=$> +repeat {0,s} +if $z>=0&$z<{0,d} +sh[0] $z,$z,$> t. $r,$x,$y,$f,$o,{1,i($i,6+$>)} +rm. +fi +done +done +else +if {1,h<3} +r[1] 100%,{5+{0,s}},1,1,0 l[1] s y f[2] 'x' f[3] 13 f[4] 1 f[5--1] 255 a y done +fi +repeat {1,w} +x={1,i($>,0)} y={1,i($>,1)} r={1,i($>,2)} f={1,i($>,3)} o={1,i($>,4)} i=$> +repeat {0,s} +sh[0] 0,0,$> t. $r,$x,$y,$f,$o,{1,i($i,5+$>)} +rm. +done +done +fi +rm. +done done +#@cli croparound : [x,y,dx,dy] || [x,y,z,dx,dy,dz] +#@cli : Draw circles on an image +#@cli : $ 512,512,1,3 10,7 noise. 1 n. 0,512 circles[0] [1] k[0] +croparound : skip ${2=3},${3=3},${4=3} +e[^-1] "Crop image at coordinates." +pass$1 0 repeat $!-1 l[$>,-1] +if {0,d>1} +if {1,h<6} +r[1] 100%,6,1,1,0 +l[1] s y f[3] $2 f[4] $3 f[5] $4 a y done +fi +repeat {1,w} +x={1,i($>,0)} y={1,i($>,1)} z={1,i($>,2)} dx={1,i($>,3)} dy={1,i($>,4)} dz={1,i($>,5)} i=$> ++crop[0] {$x-$dx},{$y-$dy},{$z-$dz},{$x+$dx},{$y+$dy},{$z+$dz} +done +else +if {1,h<4} r[1] 100%,4,1,1,0 l[1] s y f[2] $2 f[3] $3 a y done fi +repeat {1,w} +x={1,i($>,0)} y={1,i($>,1)} dx={1,i($>,2)} dy={1,i($>,3)} i=$> ++crop[0] {$x-$dx},{$y-$dy},{$x+$dx},{$y+$dy} +done +fi +done done rm[0,1] +#@cli random_walks : width,height,length,number,speed +#@cli : Generate random walks tracks (list of coordinates x,y,t as a Nx3 image.) +#@cli : $ 100,100,20 random_walks 100,100,20,5,1 circles[0] [1] k[0] blur_xy 1 s z max +#@cli : $ 100,100,20 random_walks 100,100,20,10,1 circles[0] [1] k[0] b 1 n 0,255 display_volume 8,10,1 r3d 0,0,1,25 r3d 1,0,0,-120 snapshot3d 600,1,0,0,0 autocrop +random_walks : +number=$4 width=$1 height=$2 length=$3 speed=$5 +$number,3 +l. +noise 1,1 +sh 0,0,0,0 n. 1,{$width-1} rm. +sh 1,1,0,0 n. 1,{$height-1} rm. +sh 2,2,0,0 f. 0 rm. +repeat $length-1 +l. +noise 1 +sh 0,0,0,0 c. 1,{$width-2} rm. +sh 1,1,0,0 c. 1,{$height-2} rm. +sh 2,2,0,0 f. '$>+1' rm. +done done a x +done +#@cli fibers: number,length,curvature +#@cli : Draw a serie of fibers in 2D or 3D +#@cli : $ 600,400 fibers 10,200,10 +fibers : +repeat $! l[$>] +$2,$1,1,{if(d>1,3,2)} +l. noise. 10 blur_x. $3 +norm / done +if {0,d>1} s. c *[3] {0,2*d/(w+h)} a[1--1] c fi +cumulate. x s. y +repeat $!-1 +l[0,{$>+1}] +s c ++[1] {0,w/2} ++[2] {0,h/2} +if $!>3 +[3] {0,d/2} fi +a[1--1] y +circles[0] [1],0,-1 +done +done +k[0] +done done +#@cli :: Filtering and deconvolution +#@cli movavg : _size>=1 +#@cli : moving average of image list with a box filter of size _size +#@cli : $ 11 f 'x>w/2' +l. s x movavg 9 a x done +b[0] 1.2 a c display_graph +movavg : check "$1>=1" +e[^-1] "Moving average with size $1." +n={$1-1} +repeat $n +repeat $!-1 ++[{$>},{$>+1}] *. .5 rm[$>] mv. $> done +rv +done +if $n%2!=0 rv fi +#@cli zmean +#@cli : average along z-axis +zmean : +repeat $! l[$>] +n={0,d} s z + / $n +done done +#@cli zstd +#@cli : standard deviation along z-axis +zstd : +repeat $! l[$>] ++zmean sqr. +l[0] sqr zmean done +-- sqrt +done done +#@cli zmax +#@cli : maximum along z-axis +zmax : +repeat $! l[$>] s z max done done +#@cli zmin +#@cli : maximum along z-axis +zmin : +repeat $! l[$>] s z min done done +#@cli kymoline +#@cli : interactively select a line and extract a line profile +kymoline : ++select 1 +x1={i(0,0)} y1={i(0,1)} x2={i(0,3)} y2={i(0,4)} +d={sqrt(($x2-$x1)^2+($y2-$y1)^2)} +u={($x2-$x1)/$d} v={($y2-$y1)/$d} +rm. +f 'if(x<=$d&&y==0,i($x1+x*$u,$y1+x*$v,z,c,1),5)' +crop 0,0,{int($d-1)},0 +#@cli fftshift +#@cli : Shift a image so that the fft has it center in the middle +#@cli : $ image.jpg fftshift +fftshift : +repeat $! l[$>] +shift {-int(w/2)},{-int(h/2)},{-int(d/2)},0,2 +done done +#@cli whiten_frequency : _alpha +#@cli : Whitening filter (equalize the frequency of the image; nothing todo with color) +#@cli : $ image.jpg whiten_frequency +whiten_frequency : check "${1=.25}>=0" +e[^-1] "Whiten the frequency with parameter $1." +repeat $! l[$>] +fft +a c norm. pow. $1 max. 1e-12 /. {ia} /[0-1] [2] rm[2] ifft k[0] +done done +#@cli deblur_upscale_goldmeinel : sigma>=0, _nb_iter>=0, _acceleration>=0, _kernel_type={ 0=quasi-gaussian (faster) | 1=gaussian },zoom=2 +#@cli : Deblur and zoom x2 selected images using Gold-Meinel algorithm +#@cli : Default values: 'nb_iter=8', 'acceleration=1' and 'kernel_type=1'. +deblur_upscale_goldmeinel : check "$1>=0 && ${2=8}>=0 && ${3=1}>=0" skip ${4=1} skip ${5=1} skip ${6=2} skip ${7=0} +e[^-1] "Deblur image$? using Gold-Meinel algorithm, with sigma $1, $2 iterations, acceleration $3 and "${arg\ 1+!$4,"",quasi-}"gaussian kernel, zoom $5 and regularization $6." +repeat $! l[$>] +ux={if(w>1,round($5*w),1)} uy={if(h>1,round($5*h),1)} uz={if(d>1,round($5*d),1)} ++r. $ux,$uy,$uz,100%,6 max 0 +repeat $2 ++b. {$1*$5},1,{$4!=0} r. [0] +/[0,-1] rm.. -^. $3 r. $ux,$uy,$uz,100%,6 *[-1,-2] max 0 +done rm[0] +done done +#@cli deblur_upscale_richardsonlucy : sigma>=0, nb_iter>=0, _kernel_type={ 0=quasi-gaussian (faster) | 1=gaussian }, zoom=2 +#@cli : Deblur and zoom selected images using Richardson-Lucy algorithm. +#@cli : Default values: 'nb_iter=50' and 'kernel_type=1'. +deblur_upscale_richardsonlucy : check "$1>=0 && ${2=50}>=0" skip ${3=1} skip ${4=1} +e[^-1] "Deblur image$? using Richardson-Lucy algorithm, with sigma $1, $2 iterations and "${arg\ 1+!$3,"",quasi-}"gaussian kernel, zoom=$4." +repeat $! l[$>] +ux={if(w>1,round($4*w),1)} uy={if(h>1,round($4*h),1)} uz={if(d>1,round($4*d),1)} ++r $ux,$uy,$uz,100%,6 +repeat $2 ++b. {$1*$5},1,{$3!=0} r. [0] +/[0,-1] rm.. r. $ux,$uy,$uz,100%,6 b. $1,1,{$3!=0} *[-1,-2] max 0 +done rm[0] +done done +#@cli correlate_fft +#@cli : Convolve selected images with image [$1] +#@cli : $ image.jpg 100%,100% gaussian. 20,1,45 +correlate_fft[0] [1] +correlate_fft : +e[^-1] "Correlate image with image [$1]." +pass$1 0 repeat $!-1 l[$>,-1] +w2={int({0,w}/2)} h2={int({0,h}/2)} d2={int({0,d}/2)} +r[1] [0],[0],[0],1,0,0,0.5,0.5,0.5,0.5 shift[1] -$w2,-$h2,-$d2,0,2 +fft[0] fft[2] *[3] -1 ++*[-4] . +*[-4] ... +[-2,-1] +*[-5,-3] *[-3,-2] -[-3,-2] +ifft rm. +done done +#@cli deconvolve_richardsonlucy : filter,nb_iter>=1, acceletation>=0 +#@cli : Deconvolve images using the first one as a blur operator (PSF) +#@cli : $ image.jpg 16,16 gaussian. 2,1,45 +convolve_fft[0] [1] deconvolve_richardsonlucy. [1],100 +deconvolve_richardsonlucy : check ${is_image_arg\ $1}" && ${2=5}>=1" +e[^-1] "Deblur image using Richardson-Lucy algorithm with filter [$1]." +pass$1 0 +repeat $!-1 l[$>,-1] +r[1] {0,w},{0,h},{0,d},100%,0,0,.5,.5,.5 normalize_sum[1] [0] +repeat $2 ++convolve_fft. [1] max. 1e-6 +/[0] . rm.. +correlate_fft. [1] *[-1,-2] +done rm[0,1] +done done +#@cli deconvolve_goldmeinel : filter,nb_iter>=1,acceleration>=0 +#@cli : Deblur and zoom selected images using Gold-Meinel algorithm +#@cli : Default values: 'nb_iter=8', 'acceleration=1' and 'kernel_type=1'. +#@cli : $ image.jpg 100%,100% gaussian. 5,1,45 +convolve_fft[0] [1] +deconvolve_goldmeinel. [2],5 +deconvolve_goldmeinel : check ${is_image_arg\ $1}" && ${2=5}>=1 && ${3=1}>=1" +e[^-1] "Deblur image using Gold-Meinel algorithm with filter $1, $2 iterationsand acceleration $3." +pass$1 0 +repeat $!-1 l[$>,-1] +r[1] {0,w},{0,h},{0,d},100%,0,0,.5,.5,.5 normalize_sum[1] ++b[0] 0.75 +repeat $2 ++convolve_fft. [1] max. 1e-6 +/[0] . rm.. +-^. $3 *[-1,-2] +done rm[0,1] +done done +#@cli deconvolve_richardsonlucy_blind : nb_iter>=1,acceleration>=0 +#@cli : Deblur and zoom selected images using Gold-Meinel algorithm +#@cli : Default values: 'nb_iter=8', 'acceleration=1' and 'kernel_type=1'. +deconvolve_richardsonlucy_blind : check "${1=5}>=1" +e[^-1] "Deblur image using richardsonlucy algorithm with $1 iterations." +repeat $! l[$>] +- {im-1} +avg={0,ia} ++b 0.75 ++l.. autocorrelate threshold 10%,1 normalize_sum done +repeat $1 ++convolve_fft[1] [2] max. 1e-6 +/[0] . rm.. +correlate_fft. [2] +*[1,3] +*[1] {1,$avg/ia} +l[1] +iee *. 0.01 + done ++convolve_fft[2] [1] max. 1e-6 +/[0] . rm.. +correlate_fft. [1] +*[2,3] +normalize_sum[2] ++l +powerspectrum n 0,255 append_tiles , t $> w rm done +done rm[0] +done done +#@cli blend_sharpness +#@cli : Blend images in the list according to their sharpness +blend_sharpness : +e[^-1] "Blend images according to their sharpness (gradient norm)." +N=$! +gradient_norm +++[$N--1] max[$N--1] .01 /[$N--2] . rm. a[$N--1] z d. s. z +a[0-{$N-1}] x a[1--1] x * s x,$N + +#@cli reconstruct_laplacian : param +#@cli : Reconstruct an image from its laplacian +#@cli : $ image.jpg +laplacian reconstruct_laplacian. , +reconstruct_laplacian : skip ${1=0} +e[^-1] "Reconstruct an image from its laplacian." +repeat $! l[$>] +s c repeat $! l[$>] +fft a={0,i(0,0)} b={1,i(0,0)} +100%,100%,1,1,'-(4-2*cos(2*x*pi/w)-2*cos(2*y*pi/h))' +=. 1 +. $1 +/[0,1] . k[0,1] =[0] $a =[1] $b ifft k[0] +done done a c +done done +#@cli local_variance : _radius,_robust +#@cli : Local variance filter +#@cli : $ image.jpg +local_variance +local_variance : skip ${1=2},${2=0} +e[^-1] "Estimate local variance with scale "$1" and robustness $2." +repeat $! l[$>] +if $2==0 ++b $1,1,1 - sqr b $1,1,1 +else ++median {2*$1+1} - abs median {2*$1+1} * 1.4826 sqr +fi +done done +#@cli local_noise_variance : _radius,_robust +#@cli : Local noise variance filter +#@cli : $ image.jpg +local_variance +local_noise_variance : skip ${1=2},${2=0} +e[^-1] "Estimate local variance with scale $1 and robustness $2." +repeat $! l[$>] +laplacian if d==1 * {1/sqrt(20)} else * {1/sqrt(42)} fi local_variance $1,$2 +done done +#@cli normalize_local_variance : _amplitude,_radius,_threshold,_repeat +#@cli : Local variance normalization +#@cli : $ image.jpg +normalize_local_variance +normalize_local_variance : skip ${1=50},${2=2},${3=25},${4=1} +e[^-1] "Normalize local variance with amplitude $1, scale $2, threshold $3 (x$4 times)." +repeat $! l[$>] +repeat $4 ++local_variance $2 sqrt. max. $3 ++b[0] $2,1,1 +-[0,-1] /. [1] *. $1 +[-2,-1] k. +done +done done +#@cli local_wiener : _radius +#@cli : Local Wiener filtering +#@cli : http://en.wikipedia.org/wiki/Wiener_filter +#@cli : $ image.jpg +noise 10 +local_wiener. 1 print_psnr +local_wiener : skip ${1=2} +e[^-1] "Local Wiener filtering." +repeat $! l[$>] +sigma=${-noise_std} ++b $1 ++local_variance[0] $1 +-. {$sigma*$sigma} rv[-1,-2] /[-1,-2] ++-[0,1] +*[-1,-2] +[-1,-2] k. +done done +#@cli periodize +#@cli : Periodization of the image +#@cli : $ image.jpg periodize +periodize : +e[^-1] "Periodize." +repeat $! l[$>] +if w>1 +mirror x a x fi +if h>1 +mirror y a y fi +if d>1 +mirror z a z fi +done done +#@cli tape +#@cli : Apply a Hann window (e.g. to compute a power spectrum) +#@cli : $ image.jpg tape +tape : +e[^-1] "Apply a Hann tapering window." +repeat $! l[$>] +if w>1 f 'i*sin(pi*x/(w-1))^2' fi +if h>1 f 'i*sin(pi*y/(h-1))^2' fi +if d>1 f 'i*sin(pi*z/(d-1))^2' fi +done done +#@cli powerspectrum : +#@cli : Compute power spectrum +#@cli : $ image.jpg powerspectrum +powerspectrum : +e[^-1] "Compute power spectrum." +repeat $! l[$>] display_fft k[0] done done +#@cli fouriermix : [image],_cut_of_frequency +#@cli : Mix two images using their respectives low and high frequencies +fouriermix : skip ${2=10%} +e[^-1] "Fourier mix images." +pass$1 0 repeat $!-1 l[$>,-1] +fft[0] fft[2] fftshift +100%,100% circle. 50%,50%,$2,1,1 b. 1,1,1 n. 0,1 d +*[0,1] . negate. *[2,3] . rm. +[0,2] +[1,2] fftshift +ifft +done done rm. +#@cli blend_fft : [image] +#@cli : blend images using strongest frequencies +blend_fft : skip ${2=2} +pass$1 0 ++l. +tape powerspectrum b 1 +b 2 - +max '{ia+$2*sqrt(iv)}' circle 50%,50%,20,1,@{0,im} n 0,1 d +fftshift +done fft.. *[-2,-3] . negate. +repeat $!-3 l[$>,-1,-2,-3] +fft[0] *[0,1] . +[0] [2] +[1] [3] ifft[0,1] rm[1] +done done rm[-1,-2,-3] +#@cli denoise_fft : _threshold +#@cli : Illustrate the thresholding of Fourier coefficients +#@cli : $ 256,256 f '128+128*sin(x+y)' +noise 50 +denoise_fft. 70% +denoise_fft : skip ${1=1} +e[^-1] "Threshold Fourier coefficients with threshold $1." +repeat $! l[$>] ++l. tape powerspectrum threshold $1 fftshift done +fft[0] *[0] . *[1] . rm. ifft k[0] +n 0,255 +done done +#@cli unstrip : _smoothness,_scale,_threshold +#@cli : Remove stripes in an image +#@cli : $ image.jpg f '.5*i*(1+.25*sin(x))' +unstrip +unstrip : skip ${1=25},${2=20},${3=4} +e[^-1] "Remove stripes." +repeat $! l[$>] ++l. +tape powerspectrum norm detect_spots 1,$3 dilate_circ $2 gt 0 +n 0,1 negate circle 50%,50%,$2,1,1 +if im<.9 +active=1 b $1 n 0,1 fftshift if iM==0 f 1 fi +else +active=0 +fi +done +if $active==1 +fft[0] *[0] . *[1] . rm. ifft +fi +k[0] +done done +#@cli autocorrelate +#@cli : Autocorrelation using fourier transform +#@cli : $ image.jpg autocorrelate +autocorrelate : +e[^-1] "Compute autocorrelation." +repeat $! l[$>] fft sqr + sqrt ifft k[0] fftshift done done +#@cli spotify : _scale>0,_nb_iter>0, +#@cli : Make everything look like a spot +#@cli : Default values '_nb_iter=1, _scale=1' +#@cli : $ image.jpg +spotify 1,10 +#@cli : $ image.jpg +spotify 1,20 norm. gt. 5% b 1 * +spotify : check "${1=1}>0 && ${2=1}>0" +e[^-1] "Spotify with scale $1 with $2 iterations." +repeat $! l[$>] +if {0,im!=iM} +s={0,ia} +repeat $2 +b $1 +b {2*$1} - max 0 * '{0,$s/ia}' +done +fi +done done +#@cli mapblur : _levels +#@cli : Blur the image with a map +#@cli : $ image.jpg +f '10*x/w' mapblur +mapblur : check "${1=10}>0" +e[^-1] "Blur images using a blur map (works using pairs of images)." +repeat $!/2 l[{2*$>},{2*$>+1}] +smin={1,im} smax={1,iM} +l[0] repeat $1 +b[0] {$smin+$>*($smax-$smin)/($1)} done rm[0] a z done +l[1] tones $1 gt 0 b 1 a z done +* s z + +done done +#@cli vesselness : _scale>0,coefA,coefB,coefC +#@cli : Frangi's vesselness filter based on the eigen value of the Hessian +#@cli : Reference: +#@cli : A. F. Frangi, W. J. Niessen, K. . L. Vincken, M. A. Viergever, +#@cli : "Multiscale vessel enhancement filtering" +#@cli : Medical Image Computing and Computer Assisted Intervention MICCAI'98, +#@cli : vol. 1496, pp. 130 137, 1998. +vesselness : skip ${1=1},${2=1},${3=1},${4=1} +e[^-1] "Tubeness with scale $1." +repeat $! l[$>] +b $1 +s c repeat $! l[$>] +hessian a c eigen k[0] +sign abs.. sort.. +,c * +norm a c +if d>1 +f 'if(i(x,y,z,1)<0&&i(x,y,z,2)<0,exp(-0.5/$2^2*(i(x,y,z,1)/i(x,y,z,2))^2)*exp(-0.5/$3^2*(i(x,y,z,0)^2/abs(i(x,y,z,1)*i(x,y,z,2))))*(1-exp(-0.5/$4^2*i(x,y,z,3)^2)),0)' +else +f 'if(i(x,y,z,1)<0,exp(-0.5/($2)^2*(i(x,y,z,0)/i(x,y,z,1))^2)*(1-exp(-0.5/($3)^2*i(x,y,z,2)^2)),0)' +fi +done done a c +done done +#@cli _hessian_eigen_min : scale +#@cli : Compute the min eigen value of the Hessian matrix +_hessian_eigen_min : skip ${1==1} +e[^-1] "Compute Hessian min eigen value." +repeat $! l[$>] b $1 s c repeat $! l[$>] +hessian a c eigen k[0] channels {s-1} +done done a c done done +#@cli hessian_sharpen : nscales,strength +#@cli : Sharpen the image +hessian_sharpen : +e[^-1] "Sharpen the image using its Hessian with $1 scales and strength $2." +repeat $! l[$>] +repeat $1 +_hessian_eigen_min[0] {2^$>} * {2^$>/($1-1)} done +[1--1] *. {-$2} + +done done +#@cli smurf : zoom,iter,scale,strength +#@cli : enhance linear structures +#@cli : $ 1024,1024 fibers 20,2000,50 gt 0 dilate_circ 3 +dilate_circ 3 - n 0,255 negate +b 3 r. 50%,50% +smurf. 2,8,0.25,5 r[0,1] [2] +#@cli : sp duck +smurf. 1,1,1,10 c 0,255 +smurf : +e[^-1] "Smurf." +repeat $! l[$>] factor={exp(log($1)/($2*$3))} sigma=$3 avg={ia} +repeat $2*$3 ++l _hessian_eigen_min $sigma +_hessian_eigen_min {3*$sigma} - +threshold {0.1*sqrt(iv)},1 * {-$4} done + +r. {round(w*$factor)},{round(h*$factor)},100%,100%,6 max 0 * {$avg/ia} +sigma={$sigma*$factor} +done +done done +#@cli bgsubstract : _length>0 +#@cli : Substract the background using a temporal top-hat filter +#@cli : $ 100,100,100 noise 1 b 1 +bgsubstract 10 +bgsubstract : check "${1=5}>0" +e[^-1] "Temporal background substraction with length $1." +repeat $! l[$>] +1,1,$1 f. 1 +erode[0] [1] -[0] . rm[1,-1] +done done +#@cli schizo : _amplitude,_amplitude_normal,_nb_iterations,_strength +#@cli : Schizo filter gives either a furry image or a smoothed image +#@cli : Default values '_amplitude=100,amplitude_normal=-50 _nb_iter=5,_strength=.75' +#@cli : $ image.jpg +schizo 100,-50 +schizo[0] -50,100 max 0 +schizo : skip ${1=100},${2=-50},${3=5},${4=.75} +e[^-1] "Schizo filter smoothing with // $1 and T $2 and $3 iterations." +repeat $! l[$>] +[0] +repeat $3 +l. ++iee *. {$1/(0.0001+max(abs(im),abs(iM)))} ++inn[0] *. {$2/(0.0001+max(abs(im),abs(iM)))} ++ +done +*. $4 +*[0] {1-$4} +[-1,-2] +done rm[0] +done done +#@cli scandoc : _smooth,_background,_black,_white +#@cli : improve scanned document +#@cli : $ image.jpg scandoc +scandoc : skip ${1=3},${2=100},${3=10%},${4=90%} +repeat $! l[$>] split_opacity l[0] +median $1 +b $2 - min 0 +s c n 0,1 a c c $3,$4 n 0,255 +done a c done done +#@cli warp_affine [3x3 affine matrix] +#@cli : Warp the image [0] using an 2D affine field defined by a 3x3 matrix +#@cli : $ image.jpg 3,1,1,1,1 diagonal. noise. .1 +warp_affine[0] [1] +warp_affine : +e[^-1] "Warp image using affine transform defined by 3x3 image [$1]." +pass$1 0 repeat $!-1 l[$>,-1] +params=({1,i(0,0)},{1,i(1,0)},{1,i(2,0)};{1,i(0,1)},{1,i(1,1)},{1,i(2,1)};{1,i(0,2)},{1,i(1,2)},{1,i(2,2)}) +{0,w},{0,h},1,1,1 +f. x +f. y a[-3--1] c +mix_channels. $params +channels. 1,2 +warp[0] .,0,2,0 rm. +done done rm. +#@cli solve_least_square: X +#@cli : Solves $|Ax-b|^2$ +#@cli : $ (1,1,1,1;1,2,1,2;1,1,2,2) (-1,1,0;-2,0,1) m*[1] [0] solve_least_square[0] [1] +solve_least_square : +e[^-1] "Solves least square." +pass$1 0 repeat $!-1 l[$>,-1] ++transpose +m*[0,2] +m*[0,3] +k[-1,-2] invert[0] m* transpose +done done +#@cli calibrate_affine_transform : image +calibrate_affine_transform : +e[] "Interactive affine transformation calibration between image and image $1" +e[] "- Use mouse button 1 to select matching points on the two images." +e[] "- Use mouse button 2 to remove points in the list" +e[] "- Press Space to re-init the list of points" +e[] "- Close the window to finish\n" +pass$1 0 repeat $!-1 l[$>,-1] rv +0 0 (1,0,0;0,1,0;0,0,1) Z=0 +do +x1={*1,x} y1={*1,y} +x2={*2,x} y2={*2,y} +if $x1>=0 +if {*1,b}&1 +(1;{$x1/{*1,w}*{0,w}};{$y1/{*1,h}*{0,h}}) +if {2,h>1} a[2,-1] x else rm[2] mv. 2 fi +else +if {*1,b}&2 +if {2,w>1} columns[2] 0,{2,w-2} else rm[2] 0 mv. 2 fi +fi +fi +fi +if $x2>=0 +if {*2,b}&1 +(1;{$x2/{*2,w}*{1,w}};{$y2/{*2,h}*{1,h}}) +if {3,h>1} a[3,-1] x else rm[3] mv. 3 fi +else +if {*2,b}&2 +if {3,w>1} columns[3] 0,{3,w-2} else rm[3] 0 mv. 3 fi +fi +fi +fi +if {*0,SPACE}" || "{*1,SPACE}" || "{*2,SPACE} rm[2,3,4] 0 0 (1,0,0;0,1,0;0,0,1) fi +if {*1,o} Z={max(0,min({0,d}-1,$Z+{*1,o}))} wait -1 fi +if {*2,o} Z={max(0,min({0,d}-1,$Z+{*2,o}))} wait -1 fi +if {*3,o} Z={max(0,min({0,d}-1,$Z+{*3,o}))} wait -1 fi +N={min({2,w},{3,w})} +if {2,h}>1" && "{3,h}>1 +if $N<=3 +rm[4] +l[2,3] +rows 1,2 columns 0,{$N-1} - s x + / $N +(1,0,0;{-i(0,0)},1,0;{-i(0,1)},0,1) rm.. +done +else +rm[4] +l[2,3] columns 0,{$N-1} solve_least_square[0] [1] rm[1] done +fi +fi ++l[0,2] +if {0,d>1} slices[0] $Z fi +r[0] 200%,200%,1,1,5 +r[0] 100%,100%,1,3,0 grid[0] 10%,10%,0,0,.3,0xCCCCCCCC,255,128,32 +if {1,h>1} rows[1] 1,2 *[1] 2 +1,5,1,1,2,1,255,0,0 r. {0,w},100%,1,1,1 circles[0] [1] +labels[0] [1] +fi +w1[0] -1,-1,-1,-1,"First image (n="{1,w}")" rm +done ++l[1,3] +if {0,d>1} slices[0] $Z fi +r[0] 200%,200%,1,1,5 +r[0] 100%,100%,1,3,0 shift[0] 0,0,0,1 grid[0] 10%,10%,0,0,.3,0xCCCCCCCC,255,128,32 +if {1,h>1} rows[1] 1,2 *[1] 2 +1,5,1,1,2,1,255,0,0 r. {0,w},100%,1,1,1 circles[0] [1] +labels[0] [1] +fi +w2[0] -1,-1,-1,-1,"Second image (n="{1,w}")" rm +done ++l[0,1,4] +if {0,d>1} slices[0,1] $Z fi +warp_affine[1] [2] rm[2] a c +r[0] 200%,200%,1,100%,5 +grid[0] 10%,10%,0,0,.3,0xCCCCCCCC,255,128,32 +w3 -1,-1,-1,-1,"merge "$N" Z="$Z rm +done +wait +while {*1}" && "!{*1,Q}" && "!{*1,ESC}" && "{*2} +w1[] 0 w2[] 0 w3[] 0 +k. +done done +#@cli vobs : _scale +#@cli : Motion quantity (Normal motion) h * (|Ixy|^2 |It|/|Ixy|) / h * Ixy^2 +#@cli : Irani, Michal and Rousso, Benny and Peleg, Shmuel, Detecting and tracking multiple moving objects using temporal integration, ECCV'92. +#@cli : $ 100,100,10 noise 1 b 1 +vobs +vobs : check "${1=1}>0 && ${2=3}>0" +e[^-1] "Motion quantity with scale $1." +repeat $! l[$>] +g a[0,1] c norm[0] abs[1] *[1] [0] sqr[0] b $1,1,1 rv max[1] 5% / +done done +#@cli display_vobs +#@cli : Display local diffusion coefficient +#@cli : $ 200,100 noise .7,2 ==. 1 b 2,1,1 repeat 20 +l. +laplacian *. .05 + done done a z display_vobs +display_vobs : ++vobs 1 A={round(im,0.001)} B={round(iM,0.001)} *. '{128/max(im,iM)}' +. 128 map. 5 +r[0] 100%,100%,100%,3,1 apply_gamma[0] 1.5 n[0] 0,255 +l[0] s z frame 5,12,64 shift 0,5,0,0,2 t "Original sequence",5,0,13,1,255 a z done +l[1] s z repeat $! l[$>] 1,100% f. 'h-y' n 0,255 map. 5 r. 5,{0,h},1,3,5 frame. 3,0,64 r. 100%,{0,h},1,3,5 a x +frame 5,12,64 shift 0,5,0,0,2 +t "Vobs ["$A":"$B"]",5,0,13,1,255 done done a z done +a x +#@cli display_pseudocolor : predefined_palette +#@cli : Display an indexed image in pseudocolors using a palette +#@cli : $ image.jpg luminance display_pseudocolor +display_pseudocolor : skip ${1=5} +e[^-1] "Display an indexed image in pseudocolors using map $1." +repeat $! l[$>] +A={round(im,0.0001)} B={round(iM,0.0001)} +n. 0,255 map. $1 +rectangle {w-50-5},{h/4-5},{w-5},{h-h/4+5},.5,0,0,0 +add_colorbar. {w-50},{h/4},{w-40},{h-h/4},$A,$B,6,255 +done done +#@cli display_colordepth : _dz +display_colordepth : +e[^-1] "Display the 3D image with a depth color coded." +repeat $! l[$>] +H={d*$1} colordepth , a z min {ia+10*sqrt(iv)} n 0,255 s z +rectangle {w-50-5},{h/4-5},{w-5},{h-h/4+5},.5,0,0,0 +add_colorbar. {w-50},{h/4},{w-40},{h-h/4},0,$H,6,255 +done done +#@cli map_hilo +#@cli : Map a grascale image to a RGB with maw in red and min in blue +#@cli : This help to check if images are saturated +map_hilo : +repeat $! l[$>] +round m={0,im} - $m +1,1,1,3,0,0,{0,iM} {0,iM-1},1,1,3,'x+1' 1,1,1,3,{0,iM},0,0 a[1,2,3] x +map[0] [1] ++ $m rm[1] +done done +#@cli add_colorbar : x0,y0,x1,y1,_min,_max,_ntics,color,colormap +#@cli : Add a colorbar +#@cli : $ image.jpg luminance map 5 add_colorbar {w-40},20,{w-30},{h-20},0,255,6,255,5 +add_colorbar : skip ${5=0},${6=255},${7=6},${8=255},${9=""},${10=5} +e[^-1] "Add a colorbar." +repeat $! l[$>] +{$3-$1},{$4-$2} l. f 'h-y' n 0,255 map $10 done +frame[1] 1,1,$8 j[0] [1],$1,$2,0,0,1 k[0] +repeat $7 +val={round($5+$>/($7-1)*($6-$5),.001)} +t "- "$val" "$9,{$3+1},{$4-$>*($4-$2-5)/($7-1)-10},13,1,$8 +done +done done +#@cli local_diffusion_coefficient : _scale,_threshold +#@cli : Estimate local diffusion coefficient It - D (Ixx+Iyy)=0 using D=It/(Ixx+Iyy) +#@cli : $ 100,100 noise .7,2 ==. 1 b 2,1,1 repeat 20 +l. +laplacian *. .05 + done done a z local_diffusion_coefficient 2,.5 +local_diffusion_coefficient : check "${1=2}>0 && ${2=.5}>=0" +e[^-1] "Local diffusion coefficient estimation using scale $1 and threshold $2." +repeat $! l[$>] ++l[0] s z laplacian a z done ++l[0] s z gradient_norm a z sqr done +g[0] z,1 +l[0,1] +R={1,ia+$2*sqrt(iv)} +a c f 'b=i(x,y,z,0);a=i(x,y,z,1);if(abs(a)>abs(b),b/a,if(abs(b)>$R,1/(b/a),0))' +channels 0 +done +*[0] [1] b $1,1,1 max[1] {1,ia+$2*sqrt(iv)} / +channels 0 +done done +ldc : +local_diffusion_coefficient $* +ldc_residuals : ++l[0] s z laplacian a z done +g[0] z,1 +*[1,2] +-- abs b 1 +#@cli display_ldc : +#@cli : Display local diffusion coefficient +#@cli : $ 200,100 noise .7,2 ==. 1 b 2,1,1 repeat 20 +l. +laplacian *. .05 + done done a z display_ldc +display_ldc : ++ldc 2,3 A={round(im,0.001)} B={round(iM,0.001)} *. '{128/max(im,iM)}' +. 128 map. 5 +r[0] 100%,100%,100%,3,1 apply_gamma[0] 1.5 n[0] 0,255 +l[0] s z frame 5,12,64 shift 0,5,0,0,2 t "Original sequence",5,0,13,1,255 a z done +l[1] s z repeat $! l[$>] 1,100% f. 'h-y' n 0,255 map. 5 r. 5,{0,h},1,3,5 frame. 3,0,64 +r. 100%,{0,h},1,3,5 a x +frame 5,12,64 shift 0,5,0,0,2 +t "Local diffusion coefficient ["$A":"$B"]",5,0,13,1,255 done done a z done +a x +#@cli print_psnr : _max_value +#@cli : Display the psnr on the image list taking the first one as a reference +#@cli : $ image.jpg +noise 20 +b. 1 print_psnr +print_psnr : skip ${1=255} +e[^-1] "Compute PSNR with image 0 and print it on the other images." ++psnr $1 +repeat $!-2 to[{$>+1}] "PSNR:"{round(i(0,$>+1),.01)}"dB",5,5,30,1 done +rm. +#@cli noise_std +#@cli : Estimate the noise variance +#@cli : $ image.jpg noise 10 sigma={round(${-noise_std},.1)} to "Noise std:"$sigma,5,5,30,1 +noise_std : +e[^-1] "Compute noise std." ++laplacian if {0,d==1} u {${-mad.}/sqrt(20.0)} else u {${-mad.}/sqrt(42.0)} fi rm. +#@cli pca +#@cli : Principal component analysis +#@cli : $ image.jpg +l split_tiles 64,64 y y a x pca k. s x r 8,8,1,1,-1 n 0,255 frame 1,1,255 append_tiles , r. 400%,400% frame 0,20 title dictionary done +pca : +e[^-1] "Principal component analysis." +repeat $! l[$>] +n={w} - {ia} +transpose. m*[-2,-1] / $n eigen +done done +spca : skip ${2=20} +repeat $! l[$>] +repeat $2 +p={sqrt(h)} ++l +pca k[0,-1] rv transpose[0] +m* threshold. $1,1 rm[1] transpose[0] m* done +*[0] .25 *[1] .75 + +done +pca +done done +#@cli denoise_karmuen_loeve : _number_of_components +#@cli : Denoise with a bloc Karumen-Loeve transform +#@cli : http://en.wikipedia.org/wiki/Karhunen%E2%80%93Lo%C3%A8ve_theorem +denoise_karmuen_loeve : +repeat $! l[$>] +split_tiles 64,64 oW={0,w} oH={0,h} oS={0,s} +y y a x +pca k[0,-1] rv crop[0] 0,$1 +transpose[0] +m* rm[1] transpose[0] m* s x +r $oW,$oH,1,$oS,-1 append_tiles , +done done +#@cli denoise_patch_dict : _patch_size,_nb_of_shifts,_thres_comp,_thres_coef +#@cli : Denoising using a dictionnary of patches learned on the image +#@cli : $ image.jpg +noise 10 +denoise_patch_dict[1] , print_psnr +denoise_patch_dict : skip ${1=8},${2=8},${3=1.1},${4=1.1} +e[^-1] "Denoising using a dictionnary of "$1"x"$1" patches with "$2" shifts, threshold $3x(noise std) for components and $4x(std) for coefficients." +repeat $! l[$>] +Sigma=${-noise_std[0]} ++crop 0,0,$1,100% mirror. x rv +crop. {w-$1-1},0,100%,100% mirror. x a x ++crop 0,0,100%,$1 mirror. y rv +crop. 0,{h-$1-1},100%,100% mirror. y a y +oW={0,w} oH={0,h} oS={0,s} nW={$1*round($oW/$1,1,1)} nH={$1*round($oH/$1,1,1)} ++crop {2*$oW-$nW},0,100%,100% mirror. x a x ++crop 0,{2*$oH-$nH},100%,100% mirror. y a y +NtileX={round($nW/$1)} NtileY={round($nH/$1)} ++l. +repeat $2 +if $2>1 dx={round(u(0,$1))} dy={round(u(0,$1))} else dx=0 dy=0 fi ++shift[0] $dx,$dy,0,0,2 +split_tiles. $NtileX,$NtileY pW={1,w} pH={1,h} +done rm[0] +y y a x n={w} - 'ia' +transpose. m*[-2,-1] / $n eigen +l.. unroll x sqrt gt {$3*$Sigma} f 'abs(i(x+1)-i(x))' T={[xM,yM,zM,cM]} 4 f. $T T={i(0)} done +if $T==0 T=100% fi k. columns 0,$T +done +repeat $2 +if $2>1 dx={round(u(0,$1))} dy={round(u(0,$1))} else dx=0 dy=0 fi ++shift[0] $dx,$dy,0,0,2 +l[1,-1] +l[1] split_tiles $NtileX,$NtileY unroll y a x done +transpose[0] +m* +t=${-mad.} +f. 'if(abs(i)<$4*$t,0,i)' +rm[1] transpose[0] +m* rm.. +done +l. +s x r $pW,$pH,1,$oS,-1 +append_tiles $NtileX,$NtileY +shift {-$dx},{-$dy},0,0,2 +done +done +rm[0,1] ++ / $2 +crop {$1+1},{$1+1},{$oW-$1-2},{$oH-$1-2} +done done +std_noise : ++laplacian. u {${-mad.}/sqrt(if(d==1,20,42))} rm. +#@cli iuwt : _nlevels>2,_spline>1 +#@cli : Compute the "isotropic undecimated wavelet transform" using +#@cli : a trou algorithm for the B3-Spline wavelet. +#@cli : The inverse is obtained as the sum of all coefficients +#@cli : $ image.jpg iuwt 4,1 n 0,255 append_tiles +#@cli : $ image.jpg iuwt 3,1 + +iuwt : skip ${1=3},${2=3} +e[^-1] "Compute isotropic undecimated wavelet transform." +repeat $! l[$<] +50 +l. +f 'if(x==w/2|x==w/2-1,1,0)' i [0] +repeat $2 convolve. [0] done +k. autocrop 0 / {ia*w} +done +repeat $1-1 +l[-1,-2] ++convolve[0] [1] +y[1] y convolve. [1] ++-[0] . rm[0] rv +done +l. y y 100% a x s y s x rm. a x done +done +rm. rv +done done +#@cli iuwt_std : _nlevels>2,_spline>1 +#@cli : Compute noise at each level of the iuwt +#@cli : $ image.jpg iuwt_std 10,10 +iuwt_std : +repeat $! l[$>] +sigma=${-noise_std} +if 1 +f 1 noise $sigma iuwt $1,$2 +repeat $! l[$>] +x={sqrt(iv)} rm 1 f $x +done done a x +else rm +50 +l. +f 'if(x==w/2|x==w/2-1,1,0)' i [0] +repeat $2 convolve. [0] done +k. autocrop 0 / {ia*w} +done +sqr +alpha={is} rm +$1,1,1,1,'$sigma*sqrt((1+$alpha)*$alpha^(w-x-1))' +fi +done done +#@cli denoise_iuwt :_threshold>0,_nlevels>2,_spline>1 +#@cli : Denoising by thresholding the coefficients of the +#@cli : "isotropic undecimated wavelet transform" +#@cli : $ image.jpg +noise 10 +denoise_iuwt. , print_psnr +denoise_iuwt : check "${1=1.4}>0&&${2=4}>1&&${3=1}>0" +e[^-1] "Denoise using the isotropic undecimated B$3 spline wavelet transform." +repeat $! l[$>] ++iuwt_std[0] $2,$3 rv +iuwt. $2,$3 +repeat $!-2 threshold[{$>+2}] {0,$1*i($>+1)},1 done ++[1--1] +rm[0] +done done +#@cli noise_poisson_gaussian : gain,offset,noise_std +camera_noise : +repeat $! l[$>] +noise 0,3 * $1 + $2 noise $3 +done done +#@cli analyze_camera_noise : +analyze_camera_noise : +repeat $! l[$>] ++local_noise_variance $1 b[0] $1 y a c +display_parametric 800,600,.0,1,1,0,signal,noise +done done +#@cli dehaze : scale,gamma1,min_va,max_val,gamma2 +#@cli : Dehaze an image using Dark Channel Prior appraoch +#@cli : return the dehazed image and a transmittance image +dehaze : skip ${1=5},${2=1},${3=.2},${4=1},${5=0},${6=0},${7=0} +repeat $! l[$>] ++l ++l s c min b 10 erode_circ $1 dilate_circ $1 done +gt. 80% * +s c aR={0,iM} aG={1,iM} aB={2,iM} rm +done ++l +s c /[0] $aR /[1] $aG /[2] $aB +repeat 10 median 3 erode_circ $1 dilate_circ $1 done +min f 'max($3,min($4,1-0.95*i))' +done +pow[1] $2 +s[0] c -[0] $aR -[1] $aG -[2] $aB +/[0-2] [3] ++[0] $aR +[1] $aG +[2] $aB a[0-2] c +c[0] 0,255 +adjust_colors[0] $5,$6,$7 +done done +#@cli :: Segmentation +#@cli contour2d : _tolerance +#@cli : Draw a 2D contour of regions with tolerance _tolerance +#@cli : Default value _tolerance=.1 +#@cli : $ image.jpg norm b 1 gt 50% +contour2d +contour2d : skip ${1=.1} +f 'if(abs(i-j(1,1))>$1||abs(i-j(1,0))>$1,1,0)' +#@cli segment_snake : _nb_iter,_time_step,_lambda,_threshold,_smoothness +#@cli : Segment an image using an adaptation of Chan and Vese's method. +#@cli : Default values _nb_iter=10,_time_step=1,_smoothness=100,_threshold=50% +#@cli : Reference Chan and L. Vese,Active contours without edges, IEEE transactions on image processing 10(2) (2001), pp. 266-277 +#@cli : $ 256,128 t "GMIC",40,10,100,1,255 b 1 noise 20 +segment_snake , contour2d. , r. 100%,100%,1,3,0 n 0,255 + +segment_snake : skip ${1=100},${2=1},${3=.1},${4=.1},${5=10},${6=0} +e[^-1] "Segment the image using active contours without edges using $1 iterations and time step $2, smoothness $3 and initialize with threshold of $4." +repeat $! l[$>] +if s>1 luminance fi ++b $5 gt. {ia+$4*sqrt(iv)} +l. +distance 0 negate[0] distance[0] 0 *[0] -1 + done +repeat $1 ++lt. 0 b. 1 +*[0,-1] swx={ia} sw={-2,ia} M1={$swx/$sw} +sqr. swx2={ia} S1={max(1e-3,$swx2/$sw^2-$M1^2)} rm[-1,-2] ++gt. 0 b. 1 +*[0,-1] swx={ia} sw={-2,ia} M2={$swx/$sw} +sqr. swx2={ia} S2={max(1e-3,$swx2/$sw^2-$M2^2)} rm[-1,-2] ++iee. ++f[0] '(1.0/$3)*(((i(x,y)-$M1)^2)/$S1-((i(x,y)-$M2)^2)/$S2)' ++[-2,-1] +*. {$2/(0.0001+max(abs(im),abs(iM)))} ++[-2,-1] +if $6==1 ++l gt[1] 0 contour2d[1] , n 0,1 -a c t $>,0,0,13,1,{iM} w wait 10 rm done +fi +done +b. 1 gt. 0 rm[0] +done done +#@cli segment_cells : scale1,scale2,threshold,size_threshold +#@cli : Cell segmentation using watershed +#@cli : $ 256,256 noise .05,2 ==. 1 b 10,1,1 min 80% noise 5% +segment_cells 2,10% contour2d. , r. 100%,100%,1,3,0 n 0,255 + +segment_cells : skip ${1=3},${2=10},${3=1},${4=3} +e[^-1] "Cell segmentation using difference of Gaussians and watershed." +repeat $! l[$>] +jeje_dog $1,$2 +gt {ia+$3*${-mad}} area_fg 0 gt $4 +distance[1] 0 +max_patch[0] {round($4,1,1)} *[0] [1] label[0] 0 watershed[0] [2] rm. * +done done +#@cli zernike : +zernike : +skip ${4=0},${5=0},${6=0},${7=0},${8=0},${9=0},${10=0},${11=0},${12=0},${13=0},${14=0},${15=0},${16=0},${17=0},${18=0} +f 'r=sqrt((x-$1)^2+(y-$2)^2);if(r<$3,a=atan2(y-$2,x-$1);$4+$5*2*r*sin(a)+$6*r*cos(a)+$7*sqrt(6)*r^2*sin(2*a)+$8*sqrt(3)*(2*r^2-1)+$9*sqrt(6)*r^2*cos(2*a)+$10*sqrt(8)*r^3*sin(3*a)+$11*sqrt(8)*(3*r^3-2*r)*sin(a)+$12*sqrt(8)*(3*r^3-2*r)*cos(a)+$13*sqrt(8)*r^3*cos(3*a)+$14*sqrt(10)*r^4*sin(4*a)+$15*sqrt(10)*(4*r^4-3*r^2)*sin(2*a)+$16*sqrt(5)*(6*r^4-3*r^2)*cos(2*a)+$17*sqrt(10)*(4*r^4-3*r^2)*cos(2*a)+$18*sqrt(10)*r^4*cos(4*a),0)' +#@cli :: Patterns +_challenge : +108,86,1,3 l. fractional_brownian_motion .25 n 0,128 +norm gt. 60% * r 1080,860,1,3,1 +l. b 10 shift. 10,10 done max crop 10,10,100%,100% negate done n 0,255 +#@cli periodic_dots : _nb_angles,_scale,_start_angle +#@cli : Generate a peridic dot pattern with 'nb angles', 'scale' and 'start angle'. +#@cli : Default values 'nb angle=6', 'scale=4' and 'start_angle=0' +periodic_dots : skip ${1=6},${2=4},${3=.5} +e[^-1] "Generate a periodic dot pattern with $1 angles, scale $2, and orientation $3." +repeat $! l[$>] +s c repeat $! l[$>] ++r {max(w,h)},{max(w,h)},100%,100%,0 +l. +f 0 +repeat $1 +circle {w*(.5+.5/$2*cos(2*pi*($>+$3/180*pi)/$1))},{w*(.5+.5/$2*sin(2*pi*($>+$3/180*pi)/$1))},0,1,255 +done +fft a c norm fftshift n 0,255 +done +ri. [0],0 +k. +done done a c +done done +#@cli turing_pattern : iter,dt,a,b,q,r,D +#@cli : Generate Turing pattern using a rection-diffusion equation +#@cli : du/dt = au(1-qv²) + v(1-ru) +#@cli : dv/dt = v(b-aquv) + u(-a+rv) +#@cli : the two parameters q and r are dictating the pattern final shape +#@cli : the diffusivity parameter influcences the scale +#@cli : http://www.dna.caltech.edu/courses/cs191/paperscs191/turing.pdf +#@cli : http://eprints.maths.ox.ac.uk/430/1/102.pdf +turing_pattern : skip ${1=2000},${2=.1},${3=0.855},${4=-0.95},${5=2},${6=.1},${7=.5},${8=0} +repeat $! l[$>] +r 100%,100%,100%,2 b 1 n 0,1 +repeat $1 +progress {$>/$1*100} ++laplacian[0] mix_channels. ($7,0;0,1) ++f[0] 'u=i(x,y,z,0);v=i(x,y,z,1);a=$3;b=$4;q=$5;r=$6;if(c==0,a*u*(1-q*v*v)+v*(1-r*u),v*(b+a*q*u*v)+u*(-a+r*v))' ++[-1,-2] +*. {$2/(1+max(abs(im),abs(iM)))} ++ +if $8==1 +l s c n 0,1 a c t $> w rm done fi +done +s c n 0,1 a c +done done +#@cli rays : _center_x,_center_y,_scale,_phase +#@cli : Generate rays patterns +#@cli : $ image.jpg +rays 155,127,10,10 n. 0,1 * +rays : +e[^-1] "Generate a ray pattern centered in ($1,$2)." +f 't=atan2(y-$2,x-$1);sin($3*t+$4)' +#@cli fractional_brownian_motion : 0<=_hurst_index<=1,_epsilon>0 +#@cli : Generate fractional brownian motion nd signal +#@cli : Using a power low of the form (eps+|f|)^(-2^H-1) +#@cli : where f is the module of the frequency, H the husrt index and eps _epsilon. +#@cli : (see also 'clouds') +#@cli : $ 400,300 fractional_brownian_motion +fractional_brownian_motion : skip ${1=.5},${2=1} check "$1>=0&&$1<=1" check "$2>0" +e[^-1] "Generate pseudo fractional brownian motion." +repeat $! l[$>] +f 0 noise 1 +fft fftshift +if {0,d==1} +f 'rx=x-w/2;ry=y-h/2;i*($2+sqrt(rx*rx+ry*ry))^(-2*$1-1)' +else +f 'rx=x-w/2;ry=y-h/2;rz=z-d/2;i*($2+sqrt(rx*rx+ry*ry+rz*rz))^(-2*$1-1)' +fi +fftshift ifft +k[0] +done done +#@cli clouds : _density_of_blue_sky>0,_amplitude,0<=_hurst_index<=1,_epsilon>0 +#@cli : Generate clouds on the image (see also 'fractional_brownian_motion') +#@cli : $ 64,64 repeat 3 +clouds {10+20*$>}% done rm[0] +clouds : skip ${1=50%},${2=1},${3=.5},${4=1} +e[^-1] "Generate a cloud." +repeat $! l[$>] +channels 0 +fractional_brownian_motion $3,$4 negate min $1 negate r 100%,100%,1,4 +n 0,255 s c n[0-2] 190,255 n[3] 0,255 a c +done done +#@cli clearbluesky : +#@cli : Generate a Clear Blue Sky +#@cli : $ 400,300,1,3 clearbluesky +clouds 50% blend alpha +clearbluesky : +e[^-1] "Generate a blue sky." +repeat $! l[$>] +1,2,1,3 f. '63,70,120,144,190,215' r. [0],5 k. +done done +#@cli mm_mozaic : size +#@cli : Create a mozaic image from the selected image +#@cli : sp ? mm_mozaic +mm_mozaic : skip ${1=1} +repeat $! l[$>] ++gradient_norm negate. ++l. b. .75 +ge $1 max_patch.. 3 d * done to_rgb. *[0,2] d +watershed.. . rm. +done done +segment_watershed2 : check "${1=2}>=0" +e[^-1] "Apply watershed segmentation on image$?, with edge threshold $1." +repeat $! l[$>] +min={im} ++ {1+$min} +gradient_norm +if d>1 +f. "if(i<$1 && i] +fftpolar +gaussian $1 *[0] [2] rm. ifftpolar rm. n 0,{$2*pi} sin +done done +#@cli :: Colors +#@cli wavelength_color : _wavelength +#@cli : Convert a wavelength [380,780] to RGB color +#@cli : from http://scienceprimer.com +#@cli : $ 1,1,1,1,1 repeat 100 +wavelength_color[0] {380+3*$>} done rm[0] a x +wavelength_color : +if $1>=380&$1<440 +R={-1*($1-440)/(440-380)} +G=0 +B=1 +elif $1>=440&$1<490 +R=0 +G={($1-440)/(490-440)} +B=1 +elif $1>=490&$1<510 +R=0 +G=1 +B={-1*($1-510)/(510-490)} +elif $1>=510&$1<580 +R={($1-510)/(580-510)} +G=1 +B=0 +elif $1>=580&$1<645 +R=1 +G={-1*($1-645)/(645-580)} +B=0 +elif $1>=645&$1<780 +R=1 +G=0 +B=0 +else +R=0 +G=0 +B=0 +fi +repeat $! l[$>] +mix_channels ($R;$G;$B) +done done +#@cli :: GIMP +#@cli jpr_gradient_smooth : +#@cli : image and its gradient in x y are treated as solid angles +#@cli : and locally smoothed on the surface of a sphere +#@cli : which can retain bright/dark/bright sequences +jpr_gradient_smooth: +repeat $! +l[$>] +norm ++g xy,0 +n[0] {$1-1},{$1+1} +a c +repeat 25 ++norm +/[0,1] +b {w*$2/500} +done +f atan2(i,abs(i(x,y,0,0))) +channels 1,2 +done +r 100%,100%,1,3,0,1 +n 0,255 +done +#@cli jpr_line_edges : Angles,Blurring,AntiAlias +#@cli : Similar in concept to a Hough Transform and voting +#@cli : here multiple orientations are blurred a little +#@cli : this augments line segments along the blur and suppresses +#@cli : noise improving edge detection by finding +#@cli : max gradient orthogonal to each linear blur +#@cli : $ image.jpg jpr_line_edges 5,5,1 +jpr_line_edges : skip ${1=5},${2=5},${3=1},${4=1} +e[^-1] "Find edges in image$? using $1 angles per quadrant with $2 blurring and $3 anti-alias" +repeat $! l[$>] +norm +fft +100%,100%,1,1,x-w/2 +100%,100%,1,1,y-h/2 +shift[2,3] {-round(w/2)},{-round(h/2)},0,0,2 +100%,100%,1,1 +repeat $1 +ac={3*cos(($>+0.5)*pi/$1/2)/sqrt(pi)*$2/w} +as={3*sin(($>+0.5)*pi/$1/2)/sqrt(pi)*$2/w} ++*[2] $ac ++*[3] $as ++[-2,-1] ++sqr. +*. -1 +exp. +*[-2,-1] ++mirror. x +*. -1 +[1]x1 +*. -1 +[0]x1 +*[-2,-1] [-4] +rm[-4] +ifft[-2,-1] +rm. +[1]x1 +*. -1 +[0]x1 +*[-2,-1] [-4] +rm[-4] +ifft[-2,-1] +rm. +abs[-2,-1] +max[-2,-1] $3 +ac={round(1.45*cos(($>+0.5)*pi/$1/2))} +as={round(1.45*sin(($>+0.5)*pi/$1/2))} ++shift.. {-$ac},{-$as} ++shift... {$ac},{$as} ++shift... {$ac},{-$as} ++shift[-4] {-$ac},{$as} +if $4 ++max[-6,-4,-3] ++min[-7,-5,-4] +-[-2,-1] ++[-5,-4] +*[-4] 0.5 +-[-6,-4] +/[-5,-1] +-[-4] 0.1 +max[-4] 0 +*[-4] 2 +-[4,-4] ++max[-3,-2,-1] ++min[-4,-3,-2] +-[-2,-1] ++[-3,-2] +*.. 0.5 +-[-3,-2] +/[-2,-1] +-. 0.1 +max. 0 +*. 2 +-[4,-1] +else +max[-4,-3] +gt[-5,-3] +-[4,-4] +max[-2,-1] +gt[-2,-1] +-[4,-1] +fi +done +rm[0,1,2,3] +n 0,255 +done done +#@cli jpr_orientedthinning: +#@cli : Skeleton of a shape against a zero-value (pure-black) background using locally oriented local maxima to find only relevant ridges - not micro ridges from a noisy boundary. +#@cli : $ sp swan +b 22 < jpr_orientedthinning 0.5,1.5,3.5,0,2 +jpr_orientedthinning : +e[^-1] "Oriented Thinning image$? with Pre-Smooth $1, Propagate Direction $2, Threshold Width $3" +repeat $! +l[$<] +norm ++b $1 +structuretensors. 0 +mix_channels. (1,0,-1) +b. $2 +le. 0 +if $4 +rm.. +* 255 +else +(1.1,0^0,1.1) +map.. . +rm. +distance.. 0,$5 +max.. $3 ++warp.. .,1 +*.. -1 ++warp... ..,1 +rm... +max[-2,-1] +gt[-2,-1] +* 255 +fi +done +done +#@cli jpr_phasecongruence : +#@cli : Edge detection via Phase Congruence method relies on low noise source and uses FFT to compute local energy along a vector. +#@cli : Multipe orientations are applied to a grayscale version of the image and combined. +#@cli : $ sp swan jpr_phasecongruence 7,17,130,1 +jpr_phasecongruence : +e[^-1] "Phase Congruence image$? with StartAngle $1, Directions $2, Threshold $3, IsLines $4" +repeat $! +l[$<] +norm +100%,100%,1,1,0 +repeat $2 +[0]x1 +t={($1/180+$w/2,x-w,x);sy=if(y>h/2,y-h,y);if(abs($a*sx+$b*sy)>0.7,sign($a*sx+$b*sy),0) +*[3] -1 +*[2,3] [4] +rm[4] +ifft[2,3] +rm[3] +c={max(abs($a),abs($b))*.8} +abs[2] +max[2] $3 +if $4 +a={$a/$c} +b={$b/$c} +f[2] i>i(x+$a,y+$b)&i>i(x-$a,y-$b) +fi ++[1,2] +done +rm[0] +n 0,255 +done +done +#@cli jpr_remove_blocks1 : _spatial,_amplitude,_strength +#@cli : remove block artefacts from smooth areas +#@cli : spatial drives the size of blocks to try and fit +#@cli : amplitude set to a minimum to catch only noise blocks +#@cli : strength expect 70 but fine tune up or down +jpr_remove_blocks1 : +repeat $! l[$<] +k[0] +spatial=$1 +amplitude=$2 +strength=$3 ++b[0] {$spatial*1.2} +b[0] {$spatial*0.8} -[1,2] [0] +c[1,2] {-$amplitude},{$amplitude} ++==[1,2] {-$amplitude} ++==[1,2] {$amplitude} or[3,4,5,6] +wh={w},{h} +shift[1] 2,2 +r[1,2] {w/$spatial},{h/$spatial},1,3,2 +r[1,2] $wh +shift[1] -2,-2 +c[1,2] {-$amplitude/2},{$amplitude/2} ++==[1,2] {-$amplitude/2} ++==[1,2] {$amplitude/2} or[3,4,5,6,7] +compose_channels[3] or +blur[3] {2*$spatial} threshold[3] 0.1 +blur[3] {2*$spatial} +-[3] 1 ++[1] [2] rm[2] +*[1] [2] rm[2] +*[1] {0.01*$strength} +-[0] [1] rm[1] +done done +#@cli jpr_shapes_gradient : +#@cli : convert an image to local patches with some gradient +#@cli : patch shape is via watershed algorithm +#@cli : pre-blur,threshold,grad-flatten,grad-cap +#@cli : e.g. 2,0.5,0.01,100 +jpr_shapes_gradient: +repeat $! l[$<] +100%,100%,1,1,0.1*(x-w/2) ++norm[0] +b. $1 +segment_watershed. $2,0 ++blend[1,-1] shapeaverage0 +-[1,-1] ++sqr[1] +..x1 +blend[-2,-1] shapeaverage0 ++. $3 +sqrt. +/[1,-1] ++blend[0,-1] shapeaverage0 +*[0] ... +blend[0,-2] shapeaverage0 +c[0] -$4,$4 +*[0,1] ++[0,1] +c 0,255 +done done +#@cli jpr_specularbumps : +#@cli : Specular highlights as if the image has bumps based on luminance. Ignores and deletes alpha channel. +#@cli : $ sp swan jpr_specularbumps 145,1,25,26,15,0.07,0.17,0 +jpr_specularbumps : +e[^-1] "Specular highlights image$? with GradientAngle $1, Pre-Smooth $2, GradientRange $3, AdjustAngle $4, IlluminationOffset $5, HighlightSize $6, Roughness $7, OutputType $8" +t={$1*pi/180} +a={cos($t)} +b={sin($t)} +repeat $! +l[$<] +to_rgb ++b $2 +l. +norm +gradient xy +a c +mix_channels ($a,$b;{-$b},$a) +div $3 +c 0,1 ++norm +f. "0.1/(0.1+i)" +a c ++norm +div[-2,-1] +b 2 ++norm +div[-2,-1] +wh={w},{h},1,3 +({cos((45+$4)*pi/180)*sin($5*pi/180)}^{sin((45+$4)*pi/180)*sin($5*pi/180)}^{cos($5*pi/180)}) +r $wh +- +norm +c $6,{$6+$7} +* -1 +n 0,255 +done +if $8==0 +rm.. +else +if $8==1 +rm.. +100%,100%,1,3,255 +mv. -2 +a[-2,-1] c +else +blend dodge +fi +fi +done +done +#@cli jpr_warpfromthreshold : +#@cli : test trying to create a patch local warp effect +jpr_warpfromthreshold: +repeat $! +l[$>] +norm ++g xy +a[1,2] c +ge[0] $1 +b[0] $2 +ge[0] 0.5 +f[0] i!=i(x+1,y)|i!=i(x,y+1) +repeat $3 ++norm[1] +*[2] [0] +a[1,2] c +f[1] if(i(x,y,0,2)==0,i,i/i(x,y,0,2)) +channels[1] 0,1 +b[1] $4 +done +rm[0] +s c +n 0,100 +a c +100,100,1,3,((x/2)%4)==0|(c==2&((y/2)%4)==0) +warp[1] [0] +rm[0] +n 0,255 +done +done +fx_charred_plastic: +if $4 ++dog $2%,$3% +else ++dog $2,$3 +fi +*. $1 ++.. . +rm. +ac "_fx_noise $5,$6",$7 +c 0,255 +normalize_local ${8-13} +fx_charred_plastic_preview: +fx_charred_plastic $* +fx_dreamy_abstraction : +-m "MergeChoice : $""=_mode" -MergeChoice "add","alpha","and","average","blue","burn","darken","difference","divide","dodge","exclusion","freeze","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor","edges","error" +MergingOption1=$3 +Opacity1=$4 +MergingOption2=$8 +Opacity2=$9 +if $4>=0 ++fx_segment_watershed $1,$2,1,1 blend ${_mode{$MergingOption1+1}},$Opacity1 +fi +if $5>=0 ++fc 0,0,0 -to_rgb +if $6==5 +ac. "spread {([$5,$5]/100)*max(w,h)}",$7,1 +else +ac. "_jr_fx_noise {255*$5/100},$6",$7,1 +fi +blend ${_mode{$MergingOption2+1}},$Opacity2 +if $10>=0 +_fx_gaussian_blur $10,0,0,1 +fi +fi +radius={$10*$11*2} +amount={$10*$12*2} +cradius={$10*$14*2} +overshoot={$10*$15/10} +iain_constrained_sharpen $radius,$amount,$13,$cradius,$overshoot,$16,$17 +if $18>=0 +fx_smooth_antialias {$18+(5*$10)},0,{($18+(5*$10))/20} +fi +fx_dreamy_abstraction_preview: +gui_split_preview "-fx_dreamy_abstraction $*",${-3--1} +fx_dreamy_watercolour : +repeat $! l[$>] +to_rgb +if $6 ++b $1 +l[1] gradient_norm c 0,255 ^ $2 +c $3%,$4% +if $5 negate fi +n 0,255 +if $9!=0||$10!=100 +fx_smooth_antialias ${7-9} +fi +done +fi +fx_jr_deform[0] 0,${28-34} +fx_dreamy_abstraction[0] ${10-27} +if $6 n[1] 0,255 negate[1] blend[0,1] multiply,$6 fi +-m "MergeChoice : $""=_mode" -MergeChoice "add","alpha","and","average","blue","burn","darken","difference","divide","dodge","exclusion","freeze","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor","edges","error" +100%,100%,1,3 +CF={$37*20*$38} +l[1] if $43 z {-$CF},{-$CF},{w+$CF},{h+$CF} fi fx_plasma ${35-42} if $43 z {$CF},{$CF},{w-$CF},{h-$CF} fi done +if $44 fx_transfer_rgb ${45-49} fi +if $52 rv fi +blend ${_mode{$50+1}},$51 +fx_normalize_local ${53-58} +if $59 +100%,100%,1,3 fc[1] 127,127,127 jr_fx_noise[1] {(2^($59*0.2))*($59*20)},${60-62} +blend ${_mode{$63+1}},$64 +fi +done done +fx_dreamy_watercolour_preview : +fx_dreamy_watercolour $* +fx_hard_painting : skip ${4=0},${5=0} +repeat $! l[$>] +to_colormode {max(3,s)} split_opacity +l[0] +repeat $1 fx_normalize_local 10,6,5,20,1,11 done +fx_smooth_anisotropic {100*$2},0.2,1,$2,{2*$2},0.8,90,2,0,1,1,2,1,16 +fx_mix_lab 1,0,0,$3,0,0.5,$3,0,0.5,0,2,0 +if $5 fx_segment_watershed 10,1,0 fi +smooth. $4,0,1,1,1 +split_opacity l[0] +repeat max(0,$6) +if $7==0 fx_normalize_local $8,$9,$10,$11,1,3,0 fi +if $12==0 +fx_pencilbw $13,$14,0,0,0 fi +if $15==1 k[-1] break fi +if $16==1 fx_smooth_anisotropic[-1] 60,$17,$18,$19,1.1,0.8,30,2,0,1,1,0 fi +if $20==1 k[-1] break fi +if $21==1 rv fi +if $22==0 fx_compose_overlay $23,0 +elif $22==1 fx_compose_multiply $23,0 +elif $22==2 fx_compose_softlight $23,0 +elif $22==3 fx_compose_colorburn $23,0 +elif $22==4 fx_compose_darken $23,0 +elif $22==5 fx_compose_stamp $23,0 +elif $22==6 fx_compose_hardlight $23,0 +elif $22==7 fx_compose_value $23,1 +elif $22==8 fx_compose_grainmerge $23,0 +elif $22==9 fx_compose_freeze $23,0 +elif $22==10 fx_compose_lightness $23,1 +elif $22==11 fx_compose_luminance $23,1 +elif $22==12 fx_compose_colordoping $23,0 +elif $22==13 fx_compose_comix_color $23,0,$24 +elif $22==14 fx_compose_graphicolor $23,0,$24 +elif $22==15 fx_compose_graphixcolor $23,0 +elif $22==16 fx_compose_vividedges $23,0.50,0,$24 +elif $22==17 fx_compose_darkedges $23,0.50,0,$24 +elif $22==18 fx_compose_vividscreen $23,0,$24 +elif $22==19 fx_compose_darkscreen $23,0,$24 +elif $22==20 fx_compose_interpolation $23,0 fi +if $25==1 fx_smooth_anisotropic 60,$26,$27,$28,1.1,0.8,30,2,0,1,1,0 fi +done +done +done +a c +done +done +fx_hard_painting_preview : +gui_split_preview "fx_hard_painting $*",${-3--1} +fx_neon : +repeat $! l[$>] ++fc 0,0,0 rv blend alpha +to_rgb rgb2hsl8 s c +*.. {$12^2.5} c 0,255 +a[0-2] c hsl82rgb +if $11 +[0] l[1] +b $6 +if $1==1 ++hessian xx sqr. ++hessian.. yy sqr. +[-2,-1] +hessian.. zz sqr.. +[-2,-1] +s={s} s. c +[-$s--1] sqrt. +elif $1==2 +laplacian abs to_gray to_rgb +elif $1==3 +gradient xyz abs blend add to_gray to_rgb +elif $1==4 +afre_edge ${2-5} * 4 +else +gradient_norm replace_inf 1 replace_nan 0 +fi +c 0,255 +^ $7 +c $8%,$9% +if $10 negate fi +n 0,255 +if $14!=0||$15!=100 +fx_smooth_antialias ${14-16} +fi +done +if $13 +b[0] {$13}% +fi +blend multiply,$11 +fi ++b[0] {$17%*100},1 *[1] {$18*sqrt($17%)*10} -[1] {(($18*sqrt($17%)*128)-1)^(sqrt($19))} ++b[0] {$21%*100},1 *[2] {$22*sqrt($21%)*10} -[2] {(($22*sqrt($21%)*128)-1)^(sqrt($19))} ++b[0] $25,1 *[3] {($18+$22)*$25*($26^2.5)} +rgb2hsl[1-3] s[1-3] c +*[2] {$20^2.5} +*[5] {$24^2.5} +*[8] 0 +a[1-3] c a[2-4] c a[3-5] c hsl2rgb[1-3] +replace_inf 1 replace_nan 0 +blend add +if $27 +rgb2ycbcr s c b[1,2] {$27%*100} a c ycbcr2rgb +fi +if $28 +rgb2hsv8 100%,100%,1,1 f[1] "((j(#0,0,0,0,2)/255)^(1/$25))*255*$30" f[0] "[i0,i1,255]" hsv82rgb[0] a c +fi +done done +fx_neon_preview : +gui_split_preview "fx_neon ${1-30}",${-3--1} +u "{$1}""{$2}"_{$1==4?2:0}"{$3}"_{$1==4?2:0}"{$4}"_{$1==4?2:0}"{$5}"_{$1==4?2:0}"{$6}""{$7}""{$8}""{$9}""{$10}""{$11}""{$12}""{$13}""{$14}""{$15}""{$16}""{$17}""{$18}""{$19}""{$20}""{$21}""{$22}""{$23}""{$24}""{$25}""{$26}""{$27}""{$28}""{$29}""{$30}""{$31,$32}""{$33}" +fx_neon_alpha : +repeat $! l[$>] +to_rgba ++split_opacity +rm[1] +fx_solidify_td[0] 100,0,10,2,0 +invert_rgb[0] +blend[1,2] difference +fx_gradient_norm[1] ${1-4},0 +if $7!=1 +l[0] to_rgb[0] rgb2hsl[0] s[0] c +*[1] {$7^2.5} +a[0-2] c hsl2rgb[0] +done fi +if $6 +b[0] $6 +fi +[0] [1] a[2,3] c b[2] $8,1 *[2] {$9*sqrt($8)} -[2] {(($9*sqrt($8)*128)-1)^(sqrt($10))} +[0] [1] a[3,4] c b[3] $12,1 *[3] {$13*sqrt($12)} -[3] {(($13*sqrt($12)*128)-1)^(sqrt($14))} +split_opacity[2,3] +l[2] to_rgb[0] rgb2hsv[0] s[0] c +*[1] {$11^2.5} ++[2] 1 +a[0-2] c hsv2rgb[0] done +l[4] to_rgb[0] rgb2hsv[0] s[0] c +*[1] {$15^2.5} ++[2] 1 +a[0-2] c hsv2rgb[0] done +blend[3,5] average +blend[2,4] add +b[2] {$9*13} ++blend[0,2] add rm[0] mv[3] 0 +[1] +a[0,1] c a[1,2] c [1] mv[3] 0 +blend[0,1] alpha blend[0,1] add +done done +fx_neon_alpha_preview : +fx_neon_alpha $* +fx_otsu_hessian_blend : +-m "MergeChoice : $""=_mode" -MergeChoice "add","alpha","and","average","blue","burn","darken","difference","divide","dodge","exclusion","freeze","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor","edges","error" +MergingOption=$4 +Opacity=$5 +ReverseOrder={!$6} ++l otsu $1 afre_hnorm n $2,$3 done +* blend ${_mode{$MergingOption+1}},$Opacity,$ReverseOrder +fx_otsu_hessian_blend_preview : +repeat max(0,l) +fx_otsu_hessian_blend[$>] $* +done +fx_whirling_lines : +b $1 f "round(i,$2)" +if $3==1 +b $4 ++hessian xx sqr. ++hessian.. yy sqr. +[-2,-1] +hessian.. zz sqr.. +[-2,-1] b $4 +s={s} s. c +[-$s--1] sqrt. +elif $3==2 +b $4 laplacian abs to_gray to_rgb +elif $3==3 +b $4 gradient xyz abs blend add to_gray to_rgb +else +b $4 gradient_norm +fi +c 0,255 +^ $5 +c $6%,$7% +n 0,255 +if $8>=0 +dilate_circ $8 +elif $8<=0 +erode {-$8} +fi +if $9 negate fi +if $10!=0||$11!=100 +fx_smooth_antialias ${10-12} +fi +if $13==1 c 0,255 elif $13==2 n 0,255 elif $13==3 c 0,255 n 0,255 fi +fx_whirling_lines_preview : +fx_whirling_lines $* +csswap: +scfrom=$1 +csto=$2 +if ('$scfrom'!='$csto') +list=srgb,cmy,ryb,ohta8,ohta,yes8,yes,k18,k1,lab8,lab,oklab,luv,jzazbz,yiq8,yiq,yuv8,yuv,ycbcr,ycbcrglic,ycbcrjpeg,ydbdr,xyz8,xyz,hsv8,hsv,hsl8,hsl,hsi8,hsi,lch8,lch,jzczhz,hcy +repeat $! l[$>] split_opacity l[0] to_rgb +if ('$scfrom'!='rgb')&&('$scfrom'!='0') +if isnum($scfrom) +scfrom=${arg\ $scfrom,$list} +else +strlowercase $scfrom +scfrom=${} +fi +m "sc: comm="$scfrom" u $comm{/2rgb}" +${"-sc"} +um sc +fi +if ('$csto'!='rgb')&&('$csto'!='0') +if isnum($csto) +csto=${arg\ $csto,$list} +else +strlowercase $csto +csto=${} +fi +m "cs: comm="$csto" u {/rgb2}$comm" +${"-cs"} +um cs +fi +to_rgb done a c done done +fi +csswap_preview : +gui_split_preview "csswap $*",${-3--1} +fx_cubehelix : +sh=((1-$11)/3)+1 +ramp=$21*-1.7889532707703687 +rang={0.083166763586+($22/180)*pi} +gamp=$23*-0.952442057555209 +gang={2.8296965485317932+($24/180)*pi} +bamp=$25*1.97294 +bang={(0.5+$26/180)*pi} +gs=$18^2 +ge=$19^2 +scv=-$20 +rotb={2^($13^2)} +satb={2^($14^2)} +gamb={2^($17^2)} +repeat $! l[$>] +to_rgba split_opacity l[0] +if $1==1 luminance[0] to_rgb elif $1==2 f "(i0+i1+i2)/3" fi +abs c 0,255 c $2%,$3% if $4 n 0,255 fi *. {1/255} +f "begin(scale=([${8-10}]-[${5-7}])/255; +colstart=([${5-7}])/255; +const sh="$sh"; +const gs="$gs";const ge="$ge"; const scv="$scv"; +rotb="$rotb";satb="$satb";gamb="$gamb"; +const ramp="$ramp";const rang="$rang"; +const gamp="$gamp";const gang="$gang"; +const bamp="$bamp";const bang="$bang"); +angle=(2*pi*(sh+$12*(I^(rotb))));fract=gs+(I^(gamb))*(ge-gs);amp=(($15+($16-$15)*I^(satb))*fract*(1-fract)*0.5); +helix=(amp*[ramp*sin(rang-angle[0]),gamp*sin(gang-angle[1]),bamp*sin(bang-angle[2])]); +(colstart)-scv*(fract*scale+helix)+(1+scv)*(fract+(helix*sign(scale)))*scale" +c 0,1 +*. 255 +done a c +done done +fx_cubehelix_preview : +if $27 +rm 256,256,1,3,"x" +fx_cubehelix $* +else +gui_split_preview "fx_cubehelix $*",${-3--1} +fi +fx_frequency_representation: +repeat $! l[$>] +to_rgba split_opacity rv +csswap[^0] 0,$5 +if $3 s. c fi +repeat $!-1 l[{$>+1}] +s z +repeat $! l[$>] +repeat $1 ++histogram $2 b. {($4/100)^2*100}% +f[^-1] "i(#-1,i,y,z,c,1,2)" +k[^-1] +n 0,{$2-1} +done +done done +a z +done done +n[^0] 0,255 +a[^0] c csswap[^0] $5,0 rv a c +done done +fx_frequency_representation_preview: +fx_frequency_representation $* +jr_desaturate : +repeat $! l[$>] split_opacity l[0] to_rgb if $1 srgb2rgb fi +f "avg(i0*$2,i1*$3,i2*$4)" if $5 n 0,255 fi c 0,255 +done a c done done +jr_desaturate_preview : +gui_split_preview "jr_desaturate $*",${-3--1} +#@cli rgb2ycbcrglic : convert from rgb to ycbcrglic +rgb2ycbcrglic : +split_opacity l[0] to_rgb +f "R=i0;G=i1;B=i2; +[0.2988390*R+0.5868110*G+0.1143500*B,-0.168736*R-0.3312640*G+0.5000000*B+127.5,0.5000000*R-0.4186880*G-0.0813120*B+127.5]" +done a c +#@cli ycbcrglic2rgb : convert from ycbcrglic to rgb +ycbcrglic2rgb : +split_opacity l[0] to_rgb +f "Y=i0;Cb=i1-127.5;Cr=i2-127.5; +[Y+1.402*Cr,Y-0.344136*Cb-0.714136*Cr,Y+1.772000*Cb]" +done a c +fx_satellite : +c 0,255 +luminance +f "255*((i/255)^(2^($2^2)))" +cut {$3}%,{$4}% if $5 n $6,$7 fi +to_rgb +255,1,1,3 f. "x" +l. +if $1==0 +f "((i>=0)&&(i<48))?[0,0,0]+(i-0)*[0,0,0]/47: +((i>=48)&&(i<52))?[8,8,8]+(i-48)*[0,0,0]/3: +((i>=52)&&(i<56))?[20,20,20]+(i-52)*[0,0,0]/3: +((i>=56)&&(i<60))?[28,28,28]+(i-56)*[0,0,0]/3: +((i>=60)&&(i<64))?[40,40,40]+(i-60)*[0,0,0]/3: +((i>=64)&&(i<68))?[52,52,52]+(i-64)*[0,0,0]/3: +((i>=68)&&(i<72))?[60,60,60]+(i-68)*[0,0,0]/3: +((i>=72)&&(i<76))?[72,72,72]+(i-72)*[0,0,0]/3: +((i>=76)&&(i<80))?[84,84,84]+(i-76)*[0,0,0]/3: +((i>=80)&&(i<84))?[92,92,92]+(i-80)*[0,0,0]/3: +((i>=84)&&(i<88))?[104,104,104]+(i-84)*[0,0,0]/3: +((i>=88)&&(i<92))?[112,112,112]+(i-88)*[0,0,0]/3: +((i>=92)&&(i<96))?[124,124,124]+(i-92)*[0,0,0]/3: +((i>=96)&&(i<100))?[136,136,136]+(i-96)*[0,0,0]/3: +((i>=100)&&(i<104))?[144,144,144]+(i-100)*[0,0,0]/3: +((i>=104)&&(i<108))?[156,156,156]+(i-104)*[0,0,0]/3: +((i>=108)&&(i<112))?[168,168,168]+(i-108)*[0,0,0]/3: +((i>=112)&&(i<116))?[176,176,176]+(i-112)*[0,0,0]/3: +((i>=116)&&(i<120))?[188,188,188]+(i-116)*[0,0,0]/3: +((i>=120)&&(i<124))?[196,196,196]+(i-120)*[0,0,0]/3: +((i>=124)&&(i<128))?[208,208,208]+(i-124)*[0,0,0]/3: +((i>=128)&&(i<132))?[220,220,220]+(i-128)*[0,0,0]/3: +((i>=132)&&(i<136))?[228,228,228]+(i-132)*[0,0,0]/3: +((i>=136)&&(i<140))?[240,240,240]+(i-136)*[0,0,0]/3: +((i>=140)&&(i<144))?[252,252,252]+(i-140)*[0,0,0]/3: +((i>=144)&&(i<148))?[0,156,244]+(i-144)*[0,0,0]/3: +((i>=148)&&(i<152))?[0,152,236]+(i-148)*[0,0,0]/3: +((i>=152)&&(i<156))?[0,148,228]+(i-152)*[0,0,0]/3: +((i>=156)&&(i<160))?[0,144,220]+(i-156)*[0,0,0]/3: +((i>=160)&&(i<164))?[0,140,212]+(i-160)*[0,0,0]/3: +((i>=164)&&(i<168))?[0,136,208]+(i-164)*[0,0,0]/3: +((i>=168)&&(i<172))?[0,132,200]+(i-168)*[0,0,0]/3: +((i>=172)&&(i<176))?[0,128,192]+(i-172)*[0,0,0]/3: +((i>=176)&&(i<180))?[0,124,184]+(i-176)*[0,0,0]/3: +((i>=180)&&(i<184))?[0,120,176]+(i-180)*[0,0,0]/3: +((i>=184)&&(i<188))?[160,160,0]+(i-184)*[0,0,0]/3: +((i>=188)&&(i<192))?[188,188,0]+(i-188)*[0,0,0]/3: +((i>=192)&&(i<196))?[220,220,0]+(i-192)*[0,0,0]/3: +((i>=196)&&(i<200))?[248,248,0]+(i-196)*[0,0,0]/3: +((i>=200)&&(i<204))?[252,180,0]+(i-200)*[0,0,0]/3: +((i>=204)&&(i<208))?[232,160,0]+(i-204)*[0,0,0]/3: +((i>=208)&&(i<212))?[216,140,0]+(i-208)*[0,0,0]/3: +((i>=212)&&(i<216))?[196,120,0]+(i-212)*[0,0,0]/3: +((i>=216)&&(i<220))?[232,0,0]+(i-216)*[0,0,0]/3: +((i>=220)&&(i<224))?[248,0,0]+(i-220)*[0,0,0]/3: +((i>=224)&&(i<250))?[88,88,88]+(i-224)*[0,0,0]/25: +((i>=250)&&(i<256))?[255,255,255]+(i-250)*[0,0,0]/5" +elif $1==1 +f "((i>=0)&&(i<59))?[0,0,0]+(i-0)*[0,0,0]/58: +((i>=59)&&(i<68))?[6,6,6]+(i-59)*[56,56,56]/8: +((i>=68)&&(i<97))?[75,75,75]+(i-68)*[180,180,180]/28: +((i>=97)&&(i<175))?[112,112,112]+(i-97)*[92,92,92]/77: +((i>=175)&&(i<188))?[64,64,64]+(i-175)*[0,0,0]/12: +((i>=188)&&(i<199))?[112,112,112]+(i-188)*[0,0,0]/10: +((i>=199)&&(i<209))?[160,160,160]+(i-199)*[0,0,0]/9: +((i>=209)&&(i<215))?[0,0,0]+(i-209)*[0,0,0]/5: +((i>=215)&&(i<221))?[255,255,255]+(i-215)*[0,0,0]/5: +((i>=221)&&(i<226))?[136,136,136]+(i-221)*[0,0,0]/4: +((i>=226)&&(i<256))?[88,88,88]+(i-226)*[0,0,0]/29" +elif $1==2 +f "((i>=0)&&(i<44))?[0,0,0]+(i-0)*[0,0,0]/43: +((i>=44)&&(i<152))?[20,20,20]+(i-44)*[196,196,196]/107: +((i>=152)&&(i<184))?[100,100,0]+(i-152)*[148,148,0]/31: +((i>=184)&&(i<204))?[0,0,120]+(i-184)*[0,252,132]/19: +((i>=204)&&(i<216))?[84,0,0]+(i-204)*[168,0,0]/11: +((i>=216)&&(i<224))?[252,80,80]+(i-216)*[0,60,60]/7: +((i>=224)&&(i<237))?[0,252,0]+(i-224)*[252,0,252]/12: +((i>=237)&&(i<253))?[252,252,252]+(i-237)*[0,0,0]/15: +((i>=253)&&(i<256))?[255,255,255]+(i-253)*[0,0,0]/2" +elif $1==3 +f "((i>=0)&&(i<4))?[0,0,0]+(i-0)*[0,0,0]/3: +((i>=4)&&(i<8))?[28,0,28]+(i-4)*[0,0,0]/3: +((i>=8)&&(i<12))?[60,0,60]+(i-8)*[0,0,0]/3: +((i>=12)&&(i<16))?[92,0,92]+(i-12)*[0,0,0]/3: +((i>=16)&&(i<20))?[124,0,124]+(i-16)*[0,0,0]/3: +((i>=20)&&(i<24))?[156,0,156]+(i-20)*[0,0,0]/3: +((i>=24)&&(i<28))?[188,0,188]+(i-24)*[0,0,0]/3: +((i>=28)&&(i<32))?[220,0,220]+(i-28)*[0,0,0]/3: +((i>=32)&&(i<36))?[252,0,252]+(i-32)*[0,0,0]/3: +((i>=36)&&(i<40))?[224,0,236]+(i-36)*[0,0,0]/3: +((i>=40)&&(i<44))?[196,0,220]+(i-40)*[0,0,0]/3: +((i>=44)&&(i<48))?[168,0,208]+(i-44)*[0,0,0]/3: +((i>=48)&&(i<52))?[140,0,192]+(i-48)*[0,0,0]/3: +((i>=52)&&(i<56))?[112,0,180]+(i-52)*[0,0,0]/3: +((i>=56)&&(i<60))?[84,0,164]+(i-56)*[0,0,0]/3: +((i>=60)&&(i<64))?[56,0,152]+(i-60)*[0,0,0]/3: +((i>=64)&&(i<68))?[28,0,136]+(i-64)*[0,0,0]/3: +((i>=68)&&(i<72))?[0,0,124]+(i-68)*[0,0,0]/3: +((i>=72)&&(i<76))?[0,28,136]+(i-72)*[0,0,0]/3: +((i>=76)&&(i<80))?[0,56,152]+(i-76)*[0,0,0]/3: +((i>=80)&&(i<84))?[0,84,164]+(i-80)*[0,0,0]/3: +((i>=84)&&(i<88))?[0,112,180]+(i-84)*[0,0,0]/3: +((i>=88)&&(i<92))?[0,140,192]+(i-88)*[0,0,0]/3: +((i>=92)&&(i<96))?[0,168,208]+(i-92)*[0,0,0]/3: +((i>=96)&&(i<100))?[0,196,220]+(i-96)*[0,0,0]/3: +((i>=100)&&(i<104))?[0,224,236]+(i-100)*[0,0,0]/3: +((i>=104)&&(i<108))?[0,252,252]+(i-104)*[0,0,0]/3: +((i>=108)&&(i<112))?[0,236,224]+(i-108)*[0,0,0]/3: +((i>=112)&&(i<116))?[0,220,196]+(i-112)*[0,0,0]/3: +((i>=116)&&(i<132))?[92,92,92]+(i-116)*[12,12,12]/15: +((i>=132)&&(i<144))?[112,112,112]+(i-132)*[8,8,8]/11: +((i>=144)&&(i<156))?[128,128,128]+(i-144)*[8,8,8]/11: +((i>=156)&&(i<168))?[144,144,144]+(i-156)*[8,8,8]/11: +((i>=168)&&(i<180))?[160,160,160]+(i-168)*[8,8,8]/11: +((i>=180)&&(i<184))?[176,176,176]+(i-180)*[0,0,0]/3: +((i>=184)&&(i<188))?[184,184,184]+(i-184)*[0,0,0]/3: +((i>=188)&&(i<192))?[192,192,192]+(i-188)*[0,0,0]/3: +((i>=192)&&(i<196))?[200,200,200]+(i-192)*[0,0,0]/3: +((i>=196)&&(i<200))?[208,208,208]+(i-196)*[0,0,0]/3: +((i>=200)&&(i<202))?[216,216,216]+(i-200)*[0,0,0]/1: +((i>=202)&&(i<215))?[60,0,0]+(i-202)*[195,60,60]/12: +((i>=215)&&(i<226))?[255,71,71]+(i-215)*[0,119,119]/10: +((i>=226)&&(i<246))?[101,0,101]+(i-226)*[121,201,121]/19: +((i>=246)&&(i<256))?[0,0,0]+(i-246)*[0,0,0]/9" +elif $1==4 +f "((i>=0)&&(i<2))?[0,0,0]+(i-0)*[0,0,0]/1: +((i>=2)&&(i<26))?[235,0,0]+(i-2)*[-235,0,0]/23: +((i>=26)&&(i<51))?[0,0,0]+(i-26)*[0,0,0]/24: +((i>=51)&&(i<62))?[12,12,12]+(i-51)*[3,3,3]/10: +((i>=62)&&(i<68))?[23,23,23]+(i-62)*[38,38,38]/5: +((i>=68)&&(i<69))?[75,75,75]+(i-68)*[0,0,0]/0: +((i>=69)&&(i<81))?[76,76,76]+(i-69)*[84,84,84]/11: +((i>=81)&&(i<111))?[161,161,161]+(i-81)*[79,79,79]/29: +((i>=111)&&(i<131))?[226,226,226]+(i-111)*[14,14,14]/19: +((i>=131)&&(i<171))?[160,255,255]+(i-131)*[-40,-135,-135]/39: +((i>=171)&&(i<256))?[50,50,150]+(i-171)*[50,50,70]/84" +elif $1==5 +f "((i>=0)&&(i<151))?[255,255,255]+(i-0)*[-255,-255,-255]/150: +((i>=151)&&(i<256))?[0,0,0]+(i-151)*[0,0,0]/104" +elif $1==6 +f "((i>=0)&&(i<13))?[255,255,255]+(i-0)*[-24,-24,-24]/12: +((i>=13)&&(i<126))?[228,228,228]+(i-13)*[-228,-228,-228]/112: +((i>=126)&&(i<256))?[0,0,0]+(i-126)*[0,0,0]/129" +elif $1==7 +f "((i>=0)&&(i<42))?[255,255,255]+(i-0)*[0,0,0]/41: +((i>=42)&&(i<191))?[253,253,253]+(i-42)*[-253,-253,-253]/148: +((i>=191)&&(i<256))?[0,0,0]+(i-191)*[0,0,0]/64" +elif $1==8 +f "((i>=0)&&(i<4))?[0,0,0]+(i-0)*[0,0,0]/3: +((i>=4)&&(i<8))?[28,0,28]+(i-4)*[0,0,0]/3: +((i>=8)&&(i<12))?[60,0,60]+(i-8)*[0,0,0]/3: +((i>=12)&&(i<16))?[92,0,92]+(i-12)*[0,0,0]/3: +((i>=16)&&(i<20))?[124,0,124]+(i-16)*[0,0,0]/3: +((i>=20)&&(i<24))?[156,0,156]+(i-20)*[0,0,0]/3: +((i>=24)&&(i<28))?[188,0,188]+(i-24)*[0,0,0]/3: +((i>=28)&&(i<32))?[220,0,220]+(i-28)*[0,0,0]/3: +((i>=32)&&(i<36))?[252,0,252]+(i-32)*[0,0,0]/3: +((i>=36)&&(i<40))?[224,0,236]+(i-36)*[0,0,0]/3: +((i>=40)&&(i<44))?[196,0,220]+(i-40)*[0,0,0]/3: +((i>=44)&&(i<48))?[168,0,208]+(i-44)*[0,0,0]/3: +((i>=48)&&(i<52))?[140,0,192]+(i-48)*[0,0,0]/3: +((i>=52)&&(i<56))?[112,0,180]+(i-52)*[0,0,0]/3: +((i>=56)&&(i<60))?[84,0,164]+(i-56)*[0,0,0]/3: +((i>=60)&&(i<64))?[56,0,152]+(i-60)*[0,0,0]/3: +((i>=64)&&(i<68))?[28,0,136]+(i-64)*[0,0,0]/3: +((i>=68)&&(i<72))?[0,0,124]+(i-68)*[0,0,0]/3: +((i>=72)&&(i<76))?[0,28,136]+(i-72)*[0,0,0]/3: +((i>=76)&&(i<80))?[0,56,152]+(i-76)*[0,0,0]/3: +((i>=80)&&(i<84))?[0,84,164]+(i-80)*[0,0,0]/3: +((i>=84)&&(i<88))?[0,112,180]+(i-84)*[0,0,0]/3: +((i>=88)&&(i<92))?[0,140,192]+(i-88)*[0,0,0]/3: +((i>=92)&&(i<96))?[0,168,208]+(i-92)*[0,0,0]/3: +((i>=96)&&(i<100))?[0,196,220]+(i-96)*[0,0,0]/3: +((i>=100)&&(i<104))?[0,224,236]+(i-100)*[0,0,0]/3: +((i>=104)&&(i<108))?[0,252,252]+(i-104)*[0,0,0]/3: +((i>=108)&&(i<112))?[0,236,224]+(i-108)*[0,0,0]/3: +((i>=112)&&(i<116))?[0,220,196]+(i-112)*[0,0,0]/3: +((i>=116)&&(i<120))?[0,208,168]+(i-116)*[0,0,0]/3: +((i>=120)&&(i<124))?[0,192,140]+(i-120)*[0,0,0]/3: +((i>=124)&&(i<128))?[0,180,112]+(i-124)*[0,0,0]/3: +((i>=128)&&(i<132))?[0,164,84]+(i-128)*[0,0,0]/3: +((i>=132)&&(i<136))?[0,152,56]+(i-132)*[0,0,0]/3: +((i>=136)&&(i<140))?[0,136,28]+(i-136)*[0,0,0]/3: +((i>=140)&&(i<144))?[0,124,0]+(i-140)*[0,0,0]/3: +((i>=144)&&(i<148))?[28,136,0]+(i-144)*[0,0,0]/3: +((i>=148)&&(i<152))?[56,152,0]+(i-148)*[0,0,0]/3: +((i>=152)&&(i<156))?[84,164,0]+(i-152)*[0,0,0]/3: +((i>=156)&&(i<160))?[112,180,0]+(i-156)*[0,0,0]/3: +((i>=160)&&(i<164))?[140,192,0]+(i-160)*[0,0,0]/3: +((i>=164)&&(i<168))?[168,208,0]+(i-164)*[0,0,0]/3: +((i>=168)&&(i<172))?[196,220,0]+(i-168)*[0,0,0]/3: +((i>=172)&&(i<176))?[224,236,0]+(i-172)*[0,0,0]/3: +((i>=176)&&(i<180))?[252,252,0]+(i-176)*[0,0,0]/3: +((i>=180)&&(i<184))?[236,224,0]+(i-180)*[0,0,0]/3: +((i>=184)&&(i<188))?[220,196,0]+(i-184)*[0,0,0]/3: +((i>=188)&&(i<192))?[208,168,0]+(i-188)*[0,0,0]/3: +((i>=192)&&(i<196))?[192,140,0]+(i-192)*[0,0,0]/3: +((i>=196)&&(i<200))?[180,112,0]+(i-196)*[0,0,0]/3: +((i>=200)&&(i<204))?[164,84,0]+(i-200)*[0,0,0]/3: +((i>=204)&&(i<208))?[152,56,0]+(i-204)*[0,0,0]/3: +((i>=208)&&(i<212))?[136,28,0]+(i-208)*[0,0,0]/3: +((i>=212)&&(i<216))?[124,0,0]+(i-212)*[0,0,0]/3: +((i>=216)&&(i<220))?[160,0,0]+(i-216)*[0,0,0]/3: +((i>=220)&&(i<224))?[192,0,0]+(i-220)*[0,0,0]/3: +((i>=224)&&(i<228))?[216,0,0]+(i-224)*[0,0,0]/3: +((i>=228)&&(i<232))?[252,0,0]+(i-228)*[0,0,0]/3: +((i>=232)&&(i<236))?[252,252,252]+(i-232)*[0,0,0]/3: +((i>=236)&&(i<256))?[0,0,0]+(i-236)*[255,255,255]/19" +elif $1==9 +f "((i>=0)&&(i<61))?[0,0,0]+(i-0)*[120,120,120]/60: +((i>=61)&&(i<91))?[3,3,3]+(i-61)*[87,87,87]/29: +((i>=91)&&(i<101))?[91,91,91]+(i-91)*[9,9,9]/9: +((i>=101)&&(i<145))?[103,103,103]+(i-101)*[145,145,145]/43: +((i>=145)&&(i<155))?[250,250,250]+(i-145)*[-59,-250,5]/9: +((i>=155)&&(i<171))?[191,0,255]+(i-155)*[-191,0,0]/15: +((i>=171)&&(i<191))?[0,12,242]+(i-171)*[0,243,-242]/19: +((i>=191)&&(i<201))?[25,255,0]+(i-191)*[230,0,0]/9: +((i>=201)&&(i<211))?[255,229,0]+(i-201)*[0,-229,0]/9: +((i>=211)&&(i<221))?[229,0,0]+(i-211)*[-229,0,0]/9: +((i>=221)&&(i<246))?[20,20,20]+(i-221)*[235,235,235]/24: +((i>=246)&&(i<256))?[255,255,255]+(i-246)*[0,0,0]/9" +elif $1==10 +f "((i>=0)&&(i<130))?[0,0,0]+(i-0)*[0,0,0]/129: +((i>=130)&&(i<165))?[255,160,90]+(i-130)*[-255,-160,-90]/34: +((i>=165)&&(i<183))?[0,0,0]+(i-165)*[255,255,255]/17: +((i>=183)&&(i<198))?[255,255,255]+(i-183)*[-255,-175,-125]/14: +((i>=198)&&(i<206))?[0,80,130]+(i-198)*[0,70,20]/7: +((i>=206)&&(i<214))?[160,150,0]+(i-206)*[90,-100,0]/7: +((i>=214)&&(i<222))?[150,0,220]+(i-214)*[100,0,0]/7: +((i>=222)&&(i<230))?[0,0,226]+(i-222)*[0,0,-92]/7: +((i>=230)&&(i<256))?[255,255,255]+(i-230)*[0,0,0]/25" +elif $1==11 +f "((i>=0)&&(i<110))?[0,0,0]+(i-0)*[0,0,0]/109: +((i>=110)&&(i<142))?[255,0,0]+(i-110)*[0,251,3]/31: +((i>=142)&&(i<172))?[247,243,8]+(i-142)*[-244,-243,158]/29: +((i>=172)&&(i<192))?[15,12,170]+(i-172)*[240,243,85]/19: +((i>=192)&&(i<219))?[246,250,246]+(i-192)*[-245,-143,-245]/26: +((i>=219)&&(i<255))?[1,110,7]+(i-219)*[3,137,241]/35: +((i>=255)&&(i<256))?[255,255,255]" +elif $1==12 +f "((i>=0)&&(i<154))?[0,0,0]+(i-0)*[255,255,255]/153: +((i>=154)&&(i<174))?[0,255,255]+(i-154)*[0,-255,-140]/19: +((i>=174)&&(i<187))?[0,0,115]+(i-174)*[0,255,-115]/12: +((i>=187)&&(i<197))?[0,255,0]+(i-187)*[255,0,0]/9: +((i>=197)&&(i<207))?[255,255,0]+(i-197)*[0,-255,0]/9: +((i>=207)&&(i<216))?[255,0,0]+(i-207)*[-255,0,0]/8: +((i>=216)&&(i<225))?[0,0,0]+(i-216)*[230,230,230]/8: +((i>=225)&&(i<237))?[242,114,195]+(i-225)*[-115,-114,-68]/11: +((i>=237)&&(i<256))?[255,255,0]+(i-237)*[0,0,255]/18" +elif $1==13 +f "((i>=0)&&(i<154))?[0,0,0]+(i-0)*[255,255,255]/153: +((i>=154)&&(i<174))?[0,255,255]+(i-154)*[0,-255,-140]/19: +((i>=174)&&(i<187))?[0,0,115]+(i-174)*[0,255,-115]/12: +((i>=187)&&(i<197))?[0,255,0]+(i-187)*[255,0,0]/9: +((i>=197)&&(i<207))?[255,255,0]+(i-197)*[0,-255,0]/9: +((i>=207)&&(i<216))?[255,0,0]+(i-207)*[-255,0,0]/8: +((i>=216)&&(i<225))?[0,0,0]+(i-216)*[230,230,230]/8: +((i>=225)&&(i<237))?[242,114,195]+(i-225)*[-115,-114,-68]/11: +((i>=237)&&(i<255))?[255,255,0]+(i-237)*[-128,-220,35]/17: +((i>=255)&&(i<256))?[255,255,255]" +elif $1==14 +f "((i>=0)&&(i<154))?[0,0,0]+(i-0)*[255,255,255]/153: +((i>=154)&&(i<174))?[0,255,255]+(i-154)*[0,-255,-140]/19: +((i>=174)&&(i<187))?[0,0,115]+(i-174)*[0,255,-115]/12: +((i>=187)&&(i<197))?[0,255,0]+(i-187)*[255,0,0]/9: +((i>=197)&&(i<207))?[255,255,0]+(i-197)*[0,-255,0]/9: +((i>=207)&&(i<216))?[255,0,0]+(i-207)*[-255,0,0]/8: +((i>=216)&&(i<225))?[0,0,0]+(i-216)*[230,230,230]/8: +((i>=225)&&(i<237))?[242,114,195]+(i-225)*[-115,-114,-68]/11: +((i>=237)&&(i<255))?[255,255,0]+(i-237)*[-255,-255,0]/17: +((i>=255)&&(i<256))?[255,255,255]" +elif $1==15 +f "((i>=0)&&(i<154))?[0,0,0]+(i-0)*[0,255,255]/153: +((i>=154)&&(i<174))?[0,255,255]+(i-154)*[0,-255,-140]/19: +((i>=174)&&(i<187))?[0,0,115]+(i-174)*[0,255,-115]/12: +((i>=187)&&(i<197))?[0,255,0]+(i-187)*[255,0,0]/9: +((i>=197)&&(i<207))?[255,255,0]+(i-197)*[0,-255,0]/9: +((i>=207)&&(i<216))?[255,0,0]+(i-207)*[-255,0,0]/8: +((i>=216)&&(i<225))?[0,0,0]+(i-216)*[230,230,230]/8: +((i>=225)&&(i<237))?[242,114,195]+(i-225)*[-115,-114,-68]/11: +((i>=237)&&(i<256))?[255,255,0]+(i-237)*[0,0,255]/18" +elif $1==16 +f "((i>=0)&&(i<154))?[0,0,0]+(i-0)*[0,255,255]/153: +((i>=154)&&(i<174))?[0,255,255]+(i-154)*[0,-255,-140]/19: +((i>=174)&&(i<187))?[0,0,115]+(i-174)*[0,255,-115]/12: +((i>=187)&&(i<197))?[0,255,0]+(i-187)*[255,0,0]/9: +((i>=197)&&(i<207))?[255,255,0]+(i-197)*[0,-255,0]/9: +((i>=207)&&(i<216))?[255,0,0]+(i-207)*[-255,0,0]/8: +((i>=216)&&(i<225))?[0,0,0]+(i-216)*[230,230,230]/8: +((i>=225)&&(i<237))?[242,114,195]+(i-225)*[-115,-114,-68]/11: +((i>=237)&&(i<255))?[255,255,0]+(i-237)*[-128,-220,35]/17: +((i>=255)&&(i<256))?[255,255,255]" +elif $1==17 +f "((i>=0)&&(i<154))?[0,0,0]+(i-0)*[0,255,255]/153: +((i>=154)&&(i<174))?[0,255,255]+(i-154)*[0,-255,-140]/19: +((i>=174)&&(i<187))?[0,0,115]+(i-174)*[0,255,-115]/12: +((i>=187)&&(i<197))?[0,255,0]+(i-187)*[255,0,0]/9: +((i>=197)&&(i<207))?[255,255,0]+(i-197)*[0,-255,0]/9: +((i>=207)&&(i<216))?[255,0,0]+(i-207)*[-255,0,0]/8: +((i>=216)&&(i<225))?[0,0,0]+(i-216)*[230,230,230]/8: +((i>=225)&&(i<237))?[242,114,195]+(i-225)*[-115,-114,-68]/11: +((i>=237)&&(i<255))?[255,255,0]+(i-237)*[-255,-255,0]/17: +((i>=255)&&(i<256))?[255,255,255]" +fi +if $8 rgb2srgb fi +done +f[^-1] "I[#-1,i]" +rm. +fx_satellite_preview : +if $9 +rm 256,256,1,1,"x" fx_satellite $* +else +gui_split_preview "fx_satellite $*",${-3--1} +fi +jr_dir2rgb : +v - channels 0,1 repeat $! l[$>] nm={0,n} +s c complex2polar round.. 0.001 +*. {180/pi} %. 360 100%,100%,1,1,1 mv... $! +c 0,360 if im!=iM n. 0,1 else f. 1 fi +a c hsv2rgb +nm $nm done done v + +jr_gradient_norm : +b $1 gradient_norm replace_inf 1 replace_nan 0 ^ $2 +c $3%,$4% +if $5 negate fi +n 0,255 +fx_jr_gradient_norm : +repeat $! l[$>] +if $9==3 +inter=5 +else +inter={1+$9} +fi +if $7!=1||$8!=1 +ww={w} +hh={h} +shift -0.5,-0.5,0,0,1 +r {max(1,$7*w)},{max(1,$8*h)},100%,100%,$inter +fi +if $6 ++l luminance gradient append c +blur $1 orientation +jr_dir2rgb +done rm[1] +if $5 +l[1] +rgb2hsv8 100%,100%,1,1 f[1] "j(#0,0,0,0,2)" f[0] "[i0,i1,255]" hsv82rgb[0] a c +if $6==2 +fx_solidify_td 100,0,10,2,0 +fi +rgb2hsv8 f "[i0,i1,255]" hsv82rgb +done +fi +fi +jr_gradient_norm[0] ${1-5} +if $7!=1||$8!=1 +r $ww,$hh,100%,100%,$inter +fi +if $6 blend multiply fi +if $6==1 c 0,255 f "I==[255,255,255]?[0,0,0]:I" fi +if $10 rgb2hsv8 100%,100%,1,1 if $6 [1] f[2] "j(#0,0,0,0,1)" f[0] "[i0,255,i2]" fi f[1] "j(#0,0,0,0,2)" f[0] "[i0,i1,255]" hsv82rgb[0] if $6 blend[1,2] multiply fi a c fi +done done +fx_jr_gradient_norm_preview : +gui_split_preview "fx_jr_gradient_norm $*",${-3--1} +fx_auto_gnarl: +repeat $! l[$>] ++fx_jr_gradient_norm ${1-5},0,${6-8},0 +100%,100%,1,2 f. "u(-1,1)" +b. $14 +normalize_local. ${9-13},-1,1 +n. -1,1 +*. .. rm.. *. {1/255} round. {$15^4} +*. {$16^3} +warp.. .,1,$17,$18 +rm. +done done +fx_auto_gnarl_preview: +fx_auto_gnarl $* +#@cli symmetrize_jr : _x[%],_y[%],_angle,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror },_is_antisymmetry={ 0 | 1 },_swap_sides={ 0 | 1 },_interpolation={ 0=none | 1=linear | 2=bicubic } +#@cli : Symmetrize selected images regarding specified axis. +#@cli : Default values: 'x=y=50%', 'angle=90', 'boundary_conditions=3', 'is_antisymmetry=0', 'swap_sides=0' and 'interpolation=1'. +#@cli : $ image.jpg +symmetrize 50%,50%,45 +symmetrize[-1] 50%,50%,-45 +symmetrize_jr : skip ${1=50%},${2=50%},${3=90},${4=3},${5=0},${6=0},${7=1} +e[^-1] "Symmetrize image$?, regarding axis ($1,$2,$3 deg.)." +v - +theta={$3*pi/180} u={cos($theta)} v={sin($theta)} +if $6 symmetry_cond=A<0 else symmetry_cond=A>0 fi +repeat $! l[$>] +x0={if(${is_percent\ $1},w*$1,$1)} +y0={if(${is_percent\ $2},h*$2,$2)} +if $5 f 'A=($y0-y)*$u-($x0-x)*$v;X=x+2*($x0-x);Y=y+2*($y0-y);if($symmetry_cond,i(X,Y,z,c,$7,$4),i)' +else f 'A=($y0-y)*$u-($x0-x)*$v;X=x-2*$v*A;Y=y+2*$u*A;if($symmetry_cond,i(X,Y,z,c,$7,$4),i)' +fi +done done +#@cli jr_deform : _amplitude>=0,_interpolation,_matrix_density[%]>=0,_matrix_interpolation,_mode,-100<=_character<=100,_boundary +#@cli : Apply random smooth deformation on selected images. An upgrade to the existing deform command. +#@cli : 'interpolation' can be { 0=none | 1=linear | 2=bicubic }. +#@cli : 'matrix_interpolation' can be { 0=linear | 1=bicubic }. +#@cli : 'mode' can be { 0=noise | 1=spread_noise }. +#@cli : 'boundary' can be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. +#@cli : Default value: 'amplitude=10'. +#@cli : $ image.jpg +deform[0] 10 +deform[0] 20 +jr_deform : skip ${1=10},${2=1},${3=2%},${4=1},${5=0},${6=0},${7=1} +e[^-1] "Apply random smooth deformation on image$?, with amplitude $1." +v - repeat $! l[$>] +R={max(1,${"is_percent $3"}?$3*max(w,h):$3)} +P={$4==0?3:5} +if $5==1 +r. {$R},{$R},1,4 spread. {max(w,h)*($6+100)/200},{max(w,h)*($6+100)/200} +else {$R},{$R},1,4 noise. $1 +fi +ac. "adjust_colors 0,$6,0,0,0",rgba r. ..,..,1,4,$P warp.. .,1,$2,$7 rm. +done done v + +_fx_buffer_destroyer : +repeat $! l[$>] +to_rgba split_opacity +if $1 a c fi +l[0] +ow={w} +oh={h} +dimx1={int($2/100*w)} +dimy1={int($3/100*h)} +cs1={$4/100*wh} +cl1={$5/100*wh} +shift1={$6/100*$cl1} +bound1=$7 +crit={1+$16} +_fx_virtual_buffer_resize {$dimx1*$dimy1},1,$cs1,$cl1,$shift1,$bound1 +_fx_shredder $8,$9,$1,${10-12},0,0,0,0,0 +$dimx1,$dimy1,100%,100% +f. ">begin(index=-1);index+=1;I[#0,index]" +k. +_fx_pixelsort ${13-15},{$crit},${17-21} +_fx_shifter $22,$1,{(($23/10)^3)*10},$24,{(($25/10)^3)*10},${26-29} +if $30 +_fx_virtual_buffer_resize $ow,$oh,0,{wh},{-$shift1},$bound1 +else +dimx2={int($31/100*w)} +dimy2={int($32/100*h)} +cs2={$33/100*wh} +cl2={$34/100*wh} +shift2={$35/100*$cl2} +bound2=$36 +_fx_virtual_buffer_resize $dimx2,$dimy2,$cs2,$cl2,$shift2,$bound2 +fi +done a c +done done +fx_buffer_destroyer: +_fx_buffer_destroyer ${2-37} +fx_buffer_destroyer_preview : +gui_split_preview "fx_buffer_destroyer $*",${-3--1} +_fx_virtual_buffer : +r {wh},1,100%,100%,-1,0 +_fx_virtual_buffer_resize : +owh={int(wh)} +dimx={max(1,int($1))} +dimy={max(1,int($2))} +cs={int($3)} +cl={int($4)} +shift={int($5)} +bound=$6 +_fx_virtual_buffer shift {-$cs},0,0,0,2 crop 0,$cl,2 shift {$shift},0,0,0,2 if $bound resize {$dimx*$dimy},1,100%,100%,0,2 fi +$dimx,$dimy,100%,100% +f. ">begin(index=-1);index+=1;I[#0,index]" +k. +fx_buffer_error : +repeat $! l[$>] +dimx={int($1/100*w)} +dimy={int($2/100*h)} +cs={$3/100*wh} +cl={$4/100*wh} +shift={$5/100*$cl} +bound=$6 +_fx_virtual_buffer_resize $dimx,$dimy,$cs,$cl,$shift,$bound +done done +fx_buffer_error_preview : +gui_split_preview "fx_buffer_error $*",${-3--1} +fx_jr_klc: +num=$1 +mrot={$2/180*pi} +rrot={$4/180*pi} +if $5 rrot/={max($num,1)} fi +if !$3 rrot-=$mrot fi +symm=$10 +lcd=$11 +lcmode=$13 +if $lcmode==1 +lcang={$12/(180*$lcd)*pi} +elif $lcmode==2 +lcang={$12/(180*(max($num,1)))*pi} +elif $lcmode==3 +lcang={$12/(180*$lcd*(max($num,1)))*pi} +else +lcang={$12/180*pi} +fi +scale=$14*0.01 +aa=$15*0.25 +inter=$16 +bound=$17 +repeat $! l[$>] +ox=$6*w*0.01 +oy=$7*h*0.01 +cx=$8*w*0.01 +cy=$9*h*0.01 +f "begin(const num="$num";const cx="$cx";const cy="$cy";const ox="$ox";const oy="$oy";const aa="$aa";const rrot="$rrot"; +num==0?(const awidth=8*pi;const mrot=0;const symm=1):(const awidth=pi/num;const mrot="$mrot";const symm="$symm");const interpolation="$inter";const boundary="$bound";const scale="$scale";const lcd="$lcd"; +lcd==0?(const ilcang="$lcang"):(const ilcang="$lcang");const diag=sqrt(w^2+h^2)); +vx=x-cx;vy=y-cy; +iang=atan2(vy,vx)-rrot-mrot; +irad=norm(vx,vy); +lnum=max((irad/diag*2-(4*aa/diag))*lcd*scale,0); +lnumint=floor(lnum); +ang=iang-(((lcd==0?(irad/diag*2-(4*aa/diag))*scale:(lnumint))+[0,1])*ilcang); +mult=ang/awidth - 1; +multint=floor(mult); +multintaa = floor(mult+min((aa*0.5*num)/(irad),irad*0.5/(pi*num))); +kfunc=[min(((mult[0]-multintaa[0])*irad/(aa*num)+0.5),1),min(((mult[1]-multintaa[1])*irad/(aa*num)+0.5),1)]; +lcfunc=min((lnumint+1-lnum)/(aa*(lcd==0?(abs(ilcang)):(lcd))*scale)*diag*0.125,1); +angle0=ang-multintaa*awidth; +angle1=ang-(multintaa+1)*awidth; +for(i=0,i<2,i++, +symm==1?(angle1[i]=angle1[i]):symm==2?(angle0[i]=awidth-angle0[i];angle1[i]=awidth-angle1[i]): +((multint[i]%2==1)?(multintaa[i]>multint[i]?(angle1[i]=awidth-angle1[i]):(angle0[i]=awidth-angle0[i])):(multintaa[i]>multint[i]?(angle0[i]=awidth-angle0[i]):(angle1[i]=awidth-angle1[i]))); +isnan(kfunc[i])?kfunc[i]=1); +angle0+=mrot; +angle1+=mrot; +frad=irad*scale; +xwarp00=frad*cos(angle0[0])+ox; +ywarp00=frad*sin(angle0[0])+oy; +xwarp01=frad*cos(angle1[0])+ox; +ywarp01=frad*sin(angle1[0])+oy; +xwarp10=frad*cos(angle0[1])+ox; +ywarp10=frad*sin(angle0[1])+oy; +xwarp11=frad*cos(angle1[1])+ox; +ywarp11=frad*sin(angle1[1])+oy; +(I(xwarp00,ywarp00)*(1-kfunc[0])+I(xwarp01,ywarp01)*(kfunc[0]))*(lcfunc)+(I(xwarp10,ywarp10)*(1-kfunc[1])+I(xwarp11,ywarp11)*(kfunc[1]))*(1-lcfunc)" +done done +fx_jr_klc_preview: +fx_jr_klc $* +c 0,255 +fx_layer_cake : +repeat $! l[$>] +iter=$1 +angle=$2 +if $3 angle*=$iter fi +size=$4/2 +to_rgba split_opacity to_rgb +repeat 2 +part={1-$>} +l[$part] +repeat $iter +[0] rotate[-1] {$angle/$iter*($>+1)},$8,$7,$5%,$6% +100%,100%,1,1 ellipse. $5%,$6%,{$size/$iter*($iter-$>)}%,{$size/$iter*($iter-$>)}%,0,1,255 +if $13!=2 ellipse. $5%,$6%,{$size/$iter*($iter-1-$>)}%,{$size/$iter*($iter-1-$>)}%,0,1,1 fi +blur. {$9/$iter} +fx_smooth_antialias. ${10-12} +blend[-1,-2] multiply +done +if !$13 blend[^0] add fi +if $13!=2 100%,100%,1,1 fc. 255,255,255 ellipse. $5%,$6%,{$size}%,{$size}%,0,1,0 +blur. {$9/$iter} +fx_smooth_antialias. ${9-11} +blend[-1,0] multiply fi +if !$13 blend add fi +if $part to_gray fi +done +done +list={int($!/2)} +repeat $list a[$>,$list] c done +skip {$13==0} +if $13 rv fi +done +done +fx_layer_cake_preview: +if !$13 gui_split_preview "fx_layer_cake $*",${-3--1} else fx_layer_cake ${1-12},0 fi +fx_layer_cake_2 : +num=$1 +inter=$6 +bound=$7 +if $3 +ang={$2*2*pi/360} +else +ang={$2*2*pi/(($num)*360)} +fi +repeat $! l[$>] +xc=$4% +yc=$5% +if $9 +aa={$8*norm(w,h)/100} +else +aa={$8/25*$num} +fi +if $10 +to_rgba +100%,100%,100%,100%,(0) +repeat ceil($num*(1+max(norm(w/2-$xc,h/2-$yc)/norm(w,h)*2,1))) +[1] +done +inuma=0 +inumb=0 +eval[0] "begin(ang=("$ang");xoff=w*"$xc";yoff=h*"$yc";num="$num";aa="$aa";inter="$inter";bound="$bound"); +vx=x-xoff+0.5;vy=y-yoff+0.5; +lnum=max((norm(vx,vy))/norm(w,h)*2*num-(0.5*aa/norm(w,h)),0); +lnumint=floor(lnum); +run("inuma=lnumint+1 +inumb=lnumint+2"); +angle=((ang*lnumint)%(2*pi)); +pa=I(#0,vx*cos(angle)+vy*sin(angle)+xoff-0.5,vy*cos(angle)-vx*sin(angle)+yoff-0.5,z,inter,bound); +pb=I(#0,vx*cos(angle+ang)+vy*sin(angle+ang)+xoff-0.5,vy*cos(angle+ang)-vx*sin(angle+ang)+yoff-0.5,z,inter,bound); +func=min((lnumint+1-lnum)*norm(w,h)/aa,1); +I(#"$3")=(pb*(1-func)); +I(#"{$3+2}")=(pa*(func)) +" +else +f "begin(ang=("$ang");xoff=w*"$xc";yoff=h*"$yc";num="$num";aa="$aa";inter="$inter";bound="$bound"); +vx=x-xoff+0.5;vy=y-yoff+0.5; +lnum=max((norm(vx,vy))/norm(w,h)*2*num-(0.5*aa/norm(w,h)),0); +lnumint=floor(lnum); +angle=((ang*lnumint)%(2*pi)); +pa=I(vx*cos(angle)+vy*sin(angle)+xoff-0.5,vy*cos(angle)-vx*sin(angle)+yoff-0.5,z,inter,bound); +angle+=ang; +pb=I(vx*cos(angle)+vy*sin(angle)+xoff-0.5,vy*cos(angle)-vx*sin(angle)+yoff-0.5,z,inter,bound); +func=min((lnumint+1-lnum)*norm(w,h)/aa,1); +I=(pa*(func)+pb*(1-func))" +fi +done done +fx_layer_cake_2_preview : +fx_layer_cake_2 $* +fx_powertwirl: +if $8 +f "begin(amp=$1;offset=$2;xoff=$3*w/100;yoff=$4*h/100;power=$5;interpolation=$6;boundary=$7); +vx=x-xoff+0.5;vy=y-yoff+0.5; +ang=(2*pi*((offset/360)+(amp*((norm(vx,vy)/(norm(w,h)/2))^power))))%(2*pi); +I=I(vx*cos(ang)+vy*sin(ang)+xoff-0.5,vy*cos(ang)-vx*sin(ang)+yoff-0.5,z,interpolation,boundary)" +else +euclidean2polar $3%,$4%,$6,$7 repeat $! +[$>],[$>],1,1,$1*0.75*(((x/w)^$5))*w channels. -1,0 warp[$>] .,1,1,2 rm. +done polar2euclidean $3%,$4%,$6,$7 +fi +fx_powertwirl_preview: +fx_powertwirl $* +fx_jr_deform : +repeat $! l[$>] +jr_deform ${2-8} +done done +fx_jr_deform_preview : +gui_split_preview "fx_jr_deform $*",${-3--1} +rays_from_image: +fx_transform_polar 0,$2,$3,"(R-a)*(4^(($1)-5))*$1/5","a",3 +fx_rays_from_image: +repeat max(0,l) +ac[$>] "rays_from_image $*",$-2,$-1 +done +_fx_shifter: +repeat $! l[$>] +to_rgba split_opacity +if $2 a c fi +l[0] +if $1 +csswap 0,{$1-1} s c +fi +repeat $! l[$>] +100%,100%,1,3 [1] fc[1,2] 0 +rectexture[1] $4,0,$7,$8,2,0 +rectexture[2] $6,0,$7,$8,2,0 +to_gray[^0] +f[1] "$3*510*(0.25-abs(0.5-i/255))" +f[2] "$5*510*(0.25-abs(0.5-i/255))" +a[^0] c +if $9==0 +f={u(0,3)} +elif $9==1 +f={u(0,2)+1} +else +f={($9)-2} +fi +warp.. .,1,0,{int($f)} +rm. +done done +done +a c +if $1 +csswap {$1-1},0 +fi +done done +fx_shifter: +_fx_shifter ${2-10} +fx_shifter_preview: +gui_split_preview "fx_shifter $*",${-3--1} +fx_jr_spiral_transform: +repeat $! l[$>] +if $4 permute yxzc fi +spiralbw {[w,h]},0 +if $2 mirror[1] x fi +if $3 mirror[1] y fi +if $5 f[1] "iM-i" fi +[0] +if $1 +f[2] "I(#0,i0#1%w,floor(i0#1/w),0)=I" +else +f[0] "I(i#1%w,floor(i#1/w))" +fi +k[0] +if $4 permute yxzc fi +done done +fx_jr_spiral_transform_preview: +fx_jr_spiral_transform $* +ultrawarptwo : +repeat $! l[$>] to_rgba split_opacity +iter=$1 +sc=$2 +xfc=$3 +xfr=$4 +yfc=$5 +yfr=$6 +xoffc=$7 +xoffr=$8 +yoffc=$9 +yoffr=$10 +corr=$11 +inter=$12 +bound=$13 +chann=$14 +alpha=$15 +cs=$16 +rn=$17 +rpo=$18 +vil=$19 +hfc=$20 +hfr=$21 +sfc=$22 +sfr=$23 +vilfc=$24 +vilfr=$25 +afc=$26 +afr=$27 +hoffc=$28 +hoffr=$29 +soffc=$30 +soffr=$31 +viloffc=$32 +viloffr=$33 +aoffc=$34 +aoffr=$35 +repeat $iter +if $alpha +opacity=2 +else +opacity=1 +fi +repeat $opacity +if $sc==0 +frgbt={floor(u(0,25))} +else +frgbt={$sc-1} +fi +if $cs==0 +trgbf={floor(u(0,25))} +else +trgbf={$cs-1} +fi +if $>==0 +csswap[$>] 0,$frgbt +fi +if $>==1||$chann!=0 +if $chann==1 +channel={floor(u(2,37))} +else +channel=$chann +fi +if $channel==0 +channels=0 +elif $channel>=2 +channels={$channel-1} +elif $channel>=6 +channels=$channel +else +channels={$channel-2} +fi +if $corr==2 +correl=round(u) +else +correl=$corr +fi +if $inter==2 +interp=round(u) +else +interp=$inter +fi +if $bound==4 +bounds={floor(u(4))} +elif $bound==5 +bounds={floor(u(3))+1} +else +bounds=$bound +fi +xf={($xfc+u(-$xfr,$xfr))} +yf={($yfc+u(-$yfr,$yfr))} +xoff={($xoffc+u(-$xoffr,$xoffr))} +yoff={($yoffc+u(-$yoffr,$yoffr))} +xff={sign($xf)*w*0.00002*(abs($xf)^2)} +yff={sign($yf)*h*0.00002*(abs($yf)^2)} +xofff={sign($xoff)*w*0.00002*(abs($xoff)^2)} +yofff={sign($yoff)*w*0.00002*(abs($yoff)^2)} +fx_warp_by_intensity[$>] $xff,$yff,$xofff,$yofff,$correl,$interp,$bounds,$channels,0 +fi +if $>==0 +csswap[$>] $trgbf,0 +fi +if $rn +if round(u) +negate[$>] +fi +fi +done +if $>==($iter-1)||$rpo +hf={$hfc+u(-$hfr,$hfr)} +sf={$sfc+u(-$sfr,$sfr)} +vilf={$vilfc+u(-$vilfr,$vilfr)} +af={$afc+u(-$afr,$afr)} +hoff={$hoffc+u(-$hoffr,$hoffr)} +soff={$soffc+u(-$soffr,$soffr)} +viloff={$viloffc+u(-$viloffr,$viloffr)} +aoff={$aoffc+u(-$aoffr,$aoffr)} +l[0] if $vil==1 rgb2hsi8 elif $vil==2 rgb2hsl8 else rgb2hsv8 fi +s c +*[0] $hf +[0] {$hoff*max(1,abs($hf))} %[0] 255 +*[1] $sf +[1] {$soff*max(1,abs($sf))} +*[2] $vilf +[2] {$viloff*max(1,abs($vilf))} +a c +if $vil==1 hsi82rgb elif $vil==2 hsl82rgb else hsv82rgb fi +done +*[1] $af +[1] {$aoff*max(1,abs($af))} +fi +done +to_rgb[0] +to_gray[1] +a c +done +done +fx_ultrawarptwo : +ultrawarptwo ${2--1} +fx_ultrawarptwo_preview: +fx_ultrawarptwo $* +ultrawarp4plus: +hue_min={$30} +hue_max={$31} +sat_min={$32} +sat_max={$33} +val_min={$34} +val_max={$35} +j={min($hue_min,$hue_max)+(u*(max($hue_min,$hue_max)-min($hue_min,$hue_max)))} +k={min($sat_min,$sat_max)+(u*(max($sat_min,$sat_max)-min($sat_min,$sat_max)))} +l={min($val_min,$val_max)+(u*(max($val_min,$val_max)-min($val_min,$val_max)))} +if $1 +if $2 ch=0 else ch=2 fi +ac "rr={round(u*255)} +gg={round(u*255)} +bb={round(u*255)} +fx_plasma 0.5,0,{$2},1,1,{$rr},{$gg},{$bb} +if $3 to_rgba else ch=2 to_rgb fi",{$ch} fi +fx_gaussian_blur {$7},0,0,1,2,0,0 +n_min=$14 +n_max=$15 +if $n_min>$n_max +n_min=$n_min + $n_max +n_max=$n_min - $n_max +n_min=$n_min - $n_max +fi +noise_exp={max(0,$n_min+(u*($n_max-$n_min)))} +n_amt={(2^($noise_exp-3))*$noise_exp} +if $4 fx_segment_watershed {$5},{$6},0,2,0 fi +if $8 +p_min={$9} +p_max={$10} +h_min={$11} +h_max={$12} +if $p_min>$p_max +p_min=$p_min + $p_max +p_max=$p_min - $p_max +p_min=$p_min - $p_max +fi +if $h_min>$h_max +h_min=$h_min + $h_max +h_max=$h_min - $h_max +h_min=$h_min - $h_max +fi +ac "noise "$n_amt",$13",$16,1 +fx_quadtree 0,{max(2,round($p_min+(u*($p_max-$p_min))))},{max(0,round($h_min+(u*($h_max-$h_min))))},0,3,1.5,1,1,0 +fi +ac "noise "$n_amt",$13",$16,1 +f={$17} +i={$18} +m={$19} +s={$27} +v={$28} +repeat max(0,$f) +if $20 +scale_x=w/10 +a={((2^($18-5))*$18)*(u-0.5)*$scale_x*0.025} +else +scale_x=1 +a={((2^($18-5))*$18)*(u-0.5)} +fi +if $22 +scale_y=h/10 +b={((2^($18-5))*$18)*(u-0.5)*$scale_y*0.025} +else +scale_y=1 +b={((2^($18-5))*$18)*(u-0.5)} +fi +c=(u-0.5)*$m*sign($m)*$scale_x +d=(u-0.5)*$m*sign($m)*$scale_y +g={round((u*33.98)-0.49)} +h={u(-100,100)} +o={u(-100,100)} +if $22==1 +e=0 +elif $22==2 +e=1 +else +e={round(u)} +fi +if $23==0 +f={round((u*2.98)-0.49)} +elif $23==1 +f={round((u*2.98)+0.51)} +else +f={($23)-2} +fi +ac "_fx_warp_by_intensity "{$a}","{$b}","{$c}","{$d}","{$e}",0,"{$f}"",{$24},0 +if $25 +nn={round(u)} +if $nn +if $26==0 +nch={round((u*33.98)-0.49)} +ac "negate",{$nch} +else +ac "negate",{$26} +fi +fi +fi +fx_adjust_colors 0,0,{$h},{$o},0,0 +if $29 +ac "n 0,255",3 +fi +done +if $36==-180 +hh=((u-0.5)*360) +else +hh={$36} +fi +if $37==-8.01 +ss=((u-0.5)*2) +else +ss={$37} +fi +if $38==-20.01 +vv=((u-0.5)*2) +else +vv={$38} +fi +fx_mix_hsv {$j},{$hh},0,{$k},{$ss},0,{$l},{$vv},0,0,2,0 +if $-2 +ac "n 0,255",{$-1} +fi +fx_ultrawarp4plus: +repeat $! l[$>] +ac "ultrawarp4plus ${2--3}",$-2,$-1 +fx_adjust_colors 0,0,0,{(u-0.5)*200},0,0 +done done +fx_ultrawarp4plus_preview: +variablelist=${1--1} +fx_ultrawarp4plus $variablelist +fx_blur_bloom_glare : +op=${"arg 1+$4,+,max,min"} +if !$7 +ac "blur_bloom ${1-3},"$op",${5-6},xy",$11 +else +wh={[w,h]} +repeat $9 +ang={(180/$9)*($>)+$8} ++rotate[0] $ang,2,1 +ac. "blur_bloom ${1-3},"$op",${5-6},x",$11 +rotate. {-$ang},2,1 +r. $wh,1,100%,0,0,0.5,0.5 +c. 0,255 +done +repeat $9 +blend[0,-1] screen,$10 +done +fi +fx_blur_bloom_glare_preview : +gui_split_preview "fx_blur_bloom_glare $*",$-1 +_blend_bomb : +to_rgba +$1,$2,1,4 noise. 255 +if $8 ac. "noise 255",rgba_a fi +r. 256,256 n. 0,255 blur. {$3^2}% +l. if $4==0 +f "val = i/255; (val-0.5+(atan((val-0.5)*($5/10)^3)/pi)+0.5)*255" n 0,255 +elif $4==1 +c {($5-1/255)/2}%,{100-($5-1/255)/2}% n 0,255 +elif $4==2 +f "val = (2*i/255)-1; (val*(abs(val)^(0-($5/100)))+1)*255/2" +fi done +rv +fx_mesh_blend 0,1,$6,$7,$8,$10 +if $9 ac "n 0,255",rgba fi +blend_bomb : +if $1==0 repeat int($!/2) l[$>,{$>+1}] _blend_bomb ${2--1} done done +elif $1==1 repeat $! l[$>] [0] _blend_bomb ${2--1} done done fi +fx_blend_bomb : +blend_bomb ${2--1} +fx_blend_bomb_preview : +fx_blend_bomb $* +fx_texture_afre_broken: +repeat $! l[$>] +n 0,255 +if $3 +l fi ++l ++l +if $1 gradient_orientation 2 n 0,1 + y50_afre 0 gradient_norm +else gradient_norm fi +b 1,1,1 +done +*. {255*$2/iM} + +n 0,255 +done ++l.. n 0,1 f gauss(i-.5) n 0,1 done +blend_fade[0,1] . k[0] +if $3 blend difference fi +done done +fx_texture_afre_broken_preview : +fx_texture_afre_broken $* +_bwbp_prepare : +f. "begin(scale=max(w,h,d);ol=$2^3;oh=$5^3;ql=(2-2/(($3+1)^2));qh=(2-2/(($6+1)^2));rsl=scale*log2(scale)/(2^$1);rsh=scale*log2(scale)/(2^$4)); +vx=(x-w/2)/scale;vy=(y-h/2)/scale;vz=(z-d/2)/scale;rad=(vx^2+vy^2+vz^2)^0.5; +fl=rad*rsl; +fh=(rad*rsh)^-1; +ol=$2^3; +oh=$5^3; +func=(1/((1-ql*(fl)^(ol/2)+(fl)^(ol))^0.5)); +func*=(1/((1-qh*(fh)^(oh/2)+(fh)^(oh))^0.5));func" +_butterworth_bp : +v - +100%,100%,100% +_bwbp_prepare ${1-6} +shift. {int(w/2)},{int(h/2)},{int(d/2)},0,2 +fft.. *... . *[-2,-1] ifft rm[-1] +v + +fx_butterworth_bp: +repeat $! l[$>] +if !$8 split_opacity fi +l[0] +gain={iM} csswap 0,$7 +_butterworth_bp ${1-6} +csswap $7,0 if $9 abs fi if $10 * {$gain/iM} fi +done +if !$8 a c fi +done done +fx_butterworth_bp_preview : +if $11 +rm +4000,1,1 _bwbp_prepare ${1-6} +columns 50%,100% +1000,500,1,1 +f. "cut((i(#-2,2^(x*log2(w)/w-1),0,0,0,2,1)*(255)-y)*127.5,0,255)" +mirror y +r. 50%,100% +k[-1] +else +fx_butterworth_bp ${1-10} +fi +fx_self_glitching_cascade : +skip "${25=skip ,}","${26=skip ,}" +shift {$4-50}%,{$5-50}%,0,0,$6,0 +repeat $! l[$>] if !$3 split_opacity fi l[0] to_rgb +if $2 +if $1==0 rgb2srgb +elif $1==1 rgb2cmy +elif $1==2 rgb2hsv8 +elif $1==3 rgb2hsl8 +elif $1==4 rgb2hsi8 +elif $1==5 rgb2lch8 +elif $1==6 rgb2lab8 +elif $1==7 rgb2ycbcrglic +elif $1==8 rgb2yiq8 +elif $1==9 rgb2yuv8 +elif $1==10 rgb2hcy +elif $1==11 rgb2xyz8 +fi else +if $1==1 rgb2cmyk +elif $1==2 rgb2hsv +elif $1==3 rgb2hsl +elif $1==4 rgb2hsi +elif $1==5 rgb2lch +elif $1==6 rgb2lab +elif $1==7 rgb2ycbcr +elif $1==8 rgb2yiq +elif $1==9 rgb2yuv +elif $1==10 rgb2bayer 0 +elif $1==11 rgb2xyz +fi fi +if $11 stype=$7 else stype=1 fi +repeat $7 ++shift[0] {((([w,h]-1)*([$12,$13]-[$9,$10]+[u(-1,1),u(-1,1)]*sqrt((($12-$9)^2)+(($13-$10)^2))*($14^3)))/$stype)/100},0,0,$15 +f.. "begin( +const sign = $18?-1:1; +); +operate(mode,s1,s2,mult,power) = +(mode==0?(s1 + s2): +mode==1?(s1 * s2): +mode==2?(s1 & s2): +mode==3?(s1 | s2): +mode==4?xor(s1,s2): +mode==5?(s1^(s2*0.01)): +mode==6?(s2^(s1*0.01)): +mode==7?(s1%s2): +mode==8?(s2%s1): +mode==9?(s1 / s2): +mode==10?(s2 / s1): +mode==11?(s2 - s1): +mode==12?(s1 - s2): +mode==13?(s1 << s2): +mode==14?(s2 << s1): +mode==15?(s1 >> s2): +mode==16?(s2 >> s1): +mode==17?for(n=0,n<(s2%32),n++,rol(s1)): +mode==18?for(n=0,n<(s1%32),n++,rol(s2)): +mode==19?for(n=0,n<(s2%32),n++,ror(s1)): +mode==20?for(n=0,n<(s1%32),n++,ror(s2)): +mode==21?avg(s2,s1): +mode==22?round(s1,s2,0): +mode==23?round(s2,s1,0): +mode==24?s2*sin(s1*2*pi/mult): +mode==25?s1*sin(s2*2*pi/mult): +mode==26?sign*s2*cos(s1*2*pi/mult): +mode==27?sign*s1*cos(s2*2*pi/mult): +mode==28?s2*tan(s1*pi/mult): +mode==29?s1*tan(s2*pi/mult): +mode==30?s2*sin(mult/(s1*2*pi)): +mode==31?s1*sin(mult/(s2*2*pi)): +mode==32?sign*s2*cos(mult/(s1*2*pi)): +mode==33?sign*s1*cos(mult/(s2*2*pi)): +mode==34?s2*tan(mult/(s1*pi)): +mode==35?s1*tan(mult/(s2*pi)): +mode==36?mult*var(s1,s2): +mode==37?abs(s2 - s1): +mode==38?min(s2,s1): +mode==39?max(s2,s1): +mode==40?0.005*s2*(((j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power))+s1): +mode==41?0.005*s1*((j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)+s2): +mode==42?0.1*s2*(j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)*s1: +mode==43?0.1*s2*(j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)/s1: +mode==44?0.1*s1*(j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)/s2: +mode==45?0.001*s2*((j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)-s1): +mode==46?0.001*s1*((j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)-s2): +mode==47?0.001*s2*(s1-(j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)): +mode==48?0.001*s1*(s2-(j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)): +mode==49?0.001*s2*abs((j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)-s1): +mode==50?0.001*s1*abs((j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)-s2): +mode==51?0.00001*mult*var(s1,s2,(j(#-1,0,0,0,(c+1)%(s(#0)-1)+1)*2^power)): +mode==52?(255-((255-s1)*(255-s2))): +mode==53?(s1/(255-s2)): +mode==54?(s2/(255-s1)): +mode==55?((255-s2)/s1*255): +mode==56?((255-s1)/s2*255): +mode==57?((((s1)/255)^2)^(2*(0.5-(s2/255))))*255: +mode==58?((((s2)/255)^2)^(2*(0.5-(s1/255))))*255: +mode==59?sqrt(abs(s1*s2)): +mode==60?(if((s1+s2)>=255,255,0)): +(if((s1+s2)<=255,0,255))); +val = sign*((2^$16)*j(#-1) + $17);operate($19,val,i,$20,$16); +" rm. +if $8 +*. $20 +. $21 if $22==2 if $23 %. $23 fi else if $23 modf $22,$23,100%,0 fi fi *. $24 +. $25 +fi +done +if !$8 +*. $20 +. $21 if $22==2 if $23 %. $23 fi else if $23 modf $22,$23,100%,0 fi fi *. $24 +. $25 +fi +if $2 +if $1==0 srgb2rgb +elif $1==1 cmy2rgb +elif $1==2 hsv82rgb +elif $1==3 hsl82rgb +elif $1==4 hsi82rgb +elif $1==5 lch82rgb +elif $1==6 lab82rgb +elif $1==7 ycbcrglic2rgb +elif $1==8 yiq82rgb +elif $1==9 yuv82rgb +elif $1==10 hcy2rgb +elif $1==11 xyz82rgb +fi else +if $1==1 cmyk2rgb +elif $1==2 hsv2rgb +elif $1==3 hsl2rgb +elif $1==4 hsi2rgb +elif $1==5 lch2rgb +elif $1==6 lab2rgb +elif $1==7 ycbcr2rgb +elif $1==8 yiq2rgb +elif $1==9 yuv2rgb +elif $1==10 bayer2rgb 0,0,0 +elif $1==11 xyz2rgb +fi fi +done a c done done +fx_self_glitching_cascade_preview : +repeat max(0,l) +ac[$>] "-fx_self_glitching_cascade $*",$26 +done +fx_dct_fsu: +repeat $! l[$>] +if !$11 split_opacity fi +l[0] +csswap $10,0 dct +shift $4%,$5%,0,0,2 +f " +begin(op="$1"; ox=round("$2"*w/100); oy=round("$3"*h/100)); +(op==0)?(((x<=ox)&&(y<=oy))?i:0): +(op==1)?(((x<=ox)||(y<=oy))?i:0): +(op==2)?(((x<=ox)||(y<=oy))?0:i): +(op==3)?(((x<=ox)&&(y<=oy))?0:i): +(op==4)?(((x==ox)&&(y==oy))?i:0): +(op==5)?(((x==ox)||(y==oy))?i:0): +(op==6)?((((x==ox)||(y==oy))&&((x<=ox)&&(y<=oy)))?i:0): +(op==7)?((((x==ox)||(y==oy))&&((x>=ox)&&(y>=oy)))?i:0): +(op==8)?(j(round(ox*u(-1,1)^45),round(oy*u(-1,1)^45),0,0,0,2)): +(op==9)?(j(round(ox*u(-1,1)^5),round(oy*u(-1,1)^5),0,0,0,2)) +" +shift $6%,$7%,0,0,2 +idct +csswap 0,$10 +if $8 abs fi +if $9 n 0,255 fi +done +if !$11 a c fi +done done +fx_dct_fsu_preview: +gui_split_preview "fx_dct_fsu $*",${-3--1} +fx_jfif_fake : +glitch=(0.25^(10-$3))*$3/4 +cd=$4 +te=$5 +ste=$6 +base642img "MSBmbG9hdCBsaXR0bGVfZW5kaWFuCjggOCA2NCAxICMyMjIyCnic5Vs9q51FEC60kKtWMYpaCirYKCoI767iR6UoSangtdM/EAM2Fgab2FhaWdgIUXOqVO8sXEHBVDFia6kgCBaCQSyu+5w8c3nv5p55Bg+3uSmGs19nP2Z2Zt752P39/bJ/G8PHF5+qD1y4v77+yNWyeulegPWy9bbW+9pJ7z9XH6s/f3KxdLBeRr2hjDb0nfR+4OZyxwlw8UbHS4f1nehtBTg66f3kAyOU261OfDTiA/ehEV91ga8T208+cDlg5JNKPiknvR8ykfKwLuRlo7y0k96PegS8MxsB80RAnROBRYC9R0AZtxF45o1w+cXz9fHvztTnP7y7nv7z5dLBern1NvTht37/75P17Qt/lOsPPQqwXrbeth6D/6Hv3F2fl2/++WXqMPfyegzmwZz439e9755fHwbMvTxjHqwFQBlt6MMYjMV/8F/MgbkwJ+bGGlgLa2Jt7AF7wRjMg/+hD3vG3nmGxr0Y5/S+euPGe/XVJ/ZKB+vlBkAZbeh77ctX6re/f1E6WC83AMpoQ9+Zd++oV6+8WTpYLzcAymhD30+fPlee/e2zqcPcywZAGW3oO6J+aPw437jeuJ9xv+N5xvMCD/d1vABPL3QcdVjjpbcV4rb+2PGK8jsdxx3QjrZCvJevOl2A3/c7jTqs8dvbJtKkgK7A/eU+rsMEGoDOpJehjDb0YQzG4j+kpWEuzIm5sQbWwpqk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3fl9gv9nvcP+t7H/FdP/evzv7i8k9H93fp7Q/6feTf3jgH8T+r+7P5DQ/6febeuHe6wfEvq/Oz9P6P+Tf6l/zXmI0b88/d/dH0jo/031zgtTPxyzfkjo/+78PKH/T/6l/tmof1ajf3r6v7s/kND/G/XPWT9Q/2yqfwb6vzs/T+j/lfp3o/49+dfo357+7+4PJPT/Rv37oH5QeyT0f3d+ntD/K+cfjfOPyb9m/uHp/+7+QEL/b5x/HNQPxB/2/9H8PKH/T/7l/Ktx/lXN/MvT/939gYT+3zj/mvUD519N51+B/u/OzxP6/+Rfzj+nHm7mn57+7+4PJPR/9bdcmPqB+S+c/0fz84T+P+cdnH8f8G9C/3f3BxL6/5x32PqB/Bf2/xF/Wr7b2f9z5/eJ/T+3fsjoD97+QmL/z+XPy3j/z53fJ/b/3Pohqz/s7S8k9v9c/ryM9//c+X1i/8+tH7L6w97+QmL/z+XPy3j/z53fJ/b/3Pohoz94+wuJ/T+XPy/j/T93fp/Y/3Prh4z+4O0vJPb/XP68jPf/3Pl9Yv/PrR+y+sPe/kJi/8/lT+Pvvf0/d36f2P9z64es/rC3v5DY/3P509Y7O/t/7vw+sf/n1g8Z/cHbX4j4P5qfZ/vvPf0+0v+j/YGo/ojmF4nf/7nz82z/vaffR/p/tD8Q1R/R/CLx+z93fp7tv/f0+0j/j/YHovojml8kfv/nzs+z/feefh/p/9H+QFR/RPOLxO//3Pl5tv/e0+8j/T/aH4jqj2h+kfj9nzs/z/bfe/p9pP9H+wNR/RHNLxK//3Pn59n+e0+/j/T/aH8gqj+i+UXi93/u/Dzbf+/p95H+H+0PRPVHNL/4DgTd2gQ=" +=>[-2,-1] dct,idct +(16,11,10,16,24,40,51,61;12,12,14,19,26,58,60,55;14,13,16,24,40,57,69,56;14,17,22,29,51,87,80,62;18,22,37,56,68,109,103,77;24,35,55,64,81,104,113,92;49,64,78,87,103,121,120,101;72,92,95,98,112,100,103,99) => Q +f. "const S = $1<50?5000/$1:200-2*$1; max(1,round((S*i+50)/100,1,-1))" +repeat $!-3 l[$>,-3--1] +l[0] w,h={[w,h]} r {w+(-w%16)},{h+(-h%16)},1,100%,0,3 rgb2ycbcr s c +if $2==1 r[-2,-1] 100%,50%,1,1,2 elif $2==2 r[-2,-1] 50%,100%,1,1,2 elif $2==3 r[-2,-1] 50%,50%,1,1,2 fi round. done +repeat 3 +[$>] +f[$>] "begin(boundary = 2; res = vector64(); chance = "$glitch"; val = 1; errtile = 0; tt=-1; const tlen = "$te"; const sticky = "$ste"; stuck = 0; cold = "$cd"); +if (!(x%8) && !(y%8), +src = crop(x,y,8,8); +for (l = 0, l<8, ++l, for (k = 0, k<8, ++k, off = k + 8*l; u<=chance?(val+=(u(-cold,cold)/10);tt=u(1,tlen);(u<=sticky?stuck=1:stuck=0)); stuck==0?errtile=0; tt>=1?(errtile=u(0,64)); res[off] = sum(val*src*crop(#"$dct",0,0,(off+errtile)%64,8,8,1)))); +draw(#-1,res,x,y,8,8); tt-=1; +); i" +round. ++r[Q] {$>,w},100%,1,1,0,2 /.. . round.. *[-2,-1] +f. "begin(boundary = 2; res = vector64(); chance = "$glitch"; val = 0; errtile = 0; tt=-1; const tlen = "$te"; const sticky = "$ste"; stuck = 0; cold = "$cd"); +if (!(x%8) && !(y%8), +src = crop(x,y,8,8); +for (l = 0, l<8, ++l, for (k = 0, k<8, ++k, off = k + 8*l; u<=chance?(val+=(u(-cold,cold)/10);tt=u(1,tlen);(u<=sticky?stuck=1:stuck=0)); stuck==0?errtile=0; tt>=1?(errtile=u(0,64)); res[off] = sum(val+src*crop(#"$idct",0,0,(off+errtile)%64,8,8,1)))); +draw(#"$>",res,x,y,8,8); tt-=1; +); i" +rm. +round[$>] +done +l[^3--1] r ${-max_wh},1,1,1 a c ycbcr2rgb round. r $w,$h,1,3,0 done +done done +rm[dct,idct,Q] +rm. +fx_jfif_fake_preview : +gui_split_preview "fx_jfif_fake $*",${-3--1} +_scanlines : skip ${1=60},${2=2},${3=0},${4=0},${5=0} +v - +theta={$4*pi/180} C={cos($theta)} S={-sin($theta)} +repeat $! l[$>] +100%,100%,1,1,"x" -. {w/2-$5} 100%,100%,1,1,'y' +-. {h/2-$5} *.. $S *. $C +[-2,-1] +_ripple$3. $1,$2 +n. {-$1},$1 ++ cut 0,255 +done done v + +_qam_glitch : +100%,100%,1,1 _scanlines. ${7-9},{(90+$4+$10)},$11 b. $12 +*. 2 -. $7 +f.. "line=i(#-1\,x\,y\,z\,0);ang=(90+$4)*pi/180;(i+(((1+line*5*$13/255)*($1*i/255+$5))*(i*sin(((x-w/2)*cos(ang)+(y-h/2)*sin(ang))/$2+($3+(line*$2*$14/10)/255*360)*pi/180))+($6*($1)-($1*i/2)))-i/255)%255" +rm. +fx_qam_glitch : +repeat $! l[$>] +to_rgba +cs=$7 +if $12 negate fi +csswap 0,$cs +counter=0 +if $8 sh[0] 0 fi +if $9 sh[0] 1 fi +if $10 sh[0] 2 fi +if $11 sh[0] 3 fi +repeat $!-1 l[{$>+1}] +_qam_glitch ${1-6},${13-20} +done done +k[0] +csswap $cs,0 +if $12 negate fi +done done +fx_qam_glitch_preview : +gui_split_preview "fx_qam_glitch $*",${-3--1} +_fx_jfif_bomb : +repeat $! l[$>] +if $12 ++fx_solidify_td ${13-17} +negate. rv blend alpha +fi +ww={w} +hh={h} +r {$7*100}%,{$8*100}%,100%,100%,$9 +fx_jpeg_artefacts $1 +blend_bomb 1,${2-6},0,0,0,${10-11} +r $ww,$hh,100%,100%,$9 +done done +fx_jfif_bomb: +_fx_jfif_bomb ${2--1} +fx_jfif_bomb_preview : +fx_jfif_bomb $* +jr_fx_noise : +ac "_fx_noise $1,$2",$3,$4 +_jr_fx_noise : +repeat $! l[$>] split_opacity l[0] noise $1,$2 done a c done done +jr_fx_noise_preview : +gui_split_preview "jr_fx_noise $*",${-3--1} +fx_jfif : +cd={$4^2.5} +gl=$5 +ve=$6 +es=$7 +ste=$8 +bias={2^(6-($9*12))} +ts={$10^2} +base642img "MSBmbG9hdCBsaXR0bGVfZ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+c/0fz84T+P+cdnH8f8G9C/3f3BxL6/5x32PqB/Bf2/xF/Wr7b2f9z5/eJ/T+3fsjoD97+QmL/z+XPy3j/z53fJ/b/3Pohqz/s7S8k9v9c/ryM9//c+X1i/8+tH7L6w97+QmL/z+XPy3j/z53fJ/b/3Pohoz94+wuJ/T+XPy/j/T93fp/Y/3Prh4z+4O0vJPb/XP68jPf/3Pl9Yv/PrR+y+sPe/kJi/8/lT+Pvvf0/d36f2P9z64es/rC3v5DY/3P509Y7O/t/7vw+sf/n1g8Z/cHbX4j4P5qfZ/vvPf0+0v+j/YGo/ojmF4nf/7nz82z/vaffR/p/tD8Q1R/R/CLx+z93fp7tv/f0+0j/j/YHovojml8kfv/nzs+z/feefh/p/9H+QFR/RPOLxO//3Pl5tv/e0+8j/T/aH4jqj2h+kfj9nzs/z/bfe/p9pP9H+wNR/RHNLxK//3Pn59n+e0+/j/T/aH8gqj+i+UXi93/u/Dzbf+/p95H+H+0PRPVHNL/4DgTd2gQ=" +=>[-2,-1] dct,idct +(16,11,10,16,24,40,51,61;12,12,14,19,26,58,60,55;14,13,16,24,40,57,69,56;14,17,22,29,51,87,80,62;18,22,37,56,68,109,103,77;24,35,55,64,81,104,113,92;49,64,78,87,103,121,120,101;72,92,95,98,112,100,103,99) => Q +f. "const S = $1<50?5000/$1:200-2*$1; max(1,round((S*i+50)/100,1,-1))" +repeat $!-3 l[$>,-3--1] +gp={(0.25^((10-$3)*log(wh(#0))/30))*$3/10} +ww={w(#0)} +hh={h(#0)} +if $11==1 +mirror[0] x +elif $11==2 +mirror[0] y +elif $11==3 +mirror[0] xy +fi +if $12 +rotate[0] {$12*90},0 +fi +if $13 +www={w(#0)} +hhh={h(#0)} +r[0] {$www*$19},{$hhh*$20},100%,100%,$21 +fi +{w(#0)},{h(#0)},1,1 => G +f[$G] ">begin(chance = "$gp"; tlmax="$gl"; tt=-1; val=0; sticky="$ste"); +if (!(x%16) && !(y%16),for (l = 0, l<2, ++l, for (k = 0, k<2, ++k, (u<=chance?((val=1);tt=round(u(1,tlmax))):tt>=0?(val=0;--tt):(u<=sticky?(val=-2):val=-1)); j(k*8,l*8)=val)),0)" +l[0] w,h={[w,h]} r {w+(-w%16)},{h+(-h%16)},1,100%,0,3 rgb2srgb gcd_srgb2jpeg s c +if $2==1 r[-2,-1] 100%,50%,1,1,2 elif $2==2 r[-2,-1] 50%,100%,1,1,2 elif $2==3 r[-2,-1] 50%,50%,1,1,2 fi round. done +bw,bh=8 +repeat 3 +if $>==1 +if $2==1 bh=16 elif $2==2 bw=16 elif $2==3 bh,bw=16 fi +fi +[$>] +f[$>] ">begin(boundary = 2; res = vector64(); gres = vector64(); const cbw="$bw"; const cbh="$bh"; const cbwh=cbw*cbh; glitch=0; const cold="$cd"; gval=1; const errval="$ve"; const bias = "$bias"; const strength="$es"); +if (!(x%(128/cbw)) && !(y%(128/cbh)),for (ll = 0, ll<(16/cbw), ++ll, for (kk = 0, kk<(16/cbh), ++kk, +src = crop(x+(ll*8),y+(kk*8),8,8); +gpunch=crop(#"$G",cbw/8*(x+(ll*8)),cbh/8*(y+(ll*8)),cbw,cbh); +max(gpunch)==1?(glitch=1); +glitch==1?(gval=cut(gval+(u(-cold,cold)/15),-1,5);errnum=u(1,errval);for (ve=0,ve,w},100%,1,1,0,2 /.. . round.. *[-2,-1] +dispw={w(#1)} +f. ">begin(boundary = 2; res = vector64(); const cbw="$bw"; const cbh="$bh"; const cbwh=cbw*cbh; glitch=0; const cold="$cd"; gval=0; const dispwidth="$dispw";disp=0;shift="$ts"); +if (!(x%(128/cbw)) && !(y%(128/cbh)),for (ll = 0, ll<(16/cbw), ++ll, for (kk = 0, kk<(16/cbh), ++kk, +src = crop((x+(ll*8+cbw*disp))%(dispwidth/cbw*16),y+(kk*8)+cbh*floor((x+cbw*disp)/(dispwidth/cbw*16)),8,8); +gpunch=crop(#"$G",cbw/8*(x+(ll*8)),cbh/8*(y+(ll*8)),cbw,cbh); +max(gpunch)==1?(glitch=1); +glitch==1?((u<=shift?++disp);gval=cut(gval+(u(-cold,cold)/5),-1,5)); +for (l = 0, l<8, ++l, for (k = 0, k<8, ++k, off = k + 8*l; res[off] = int(sum(gval+src*crop(#"$idct",0,0,off,8,8,1))))); +draw(#"$>",res,x+(ll*8),y+(kk*8),8,8); +min(gpunch)<=-1?(glitch=0;errnum=0;min(gpunch)==-1?gres=vector64(0))))); i" +rm. +l[$>] r {w*($bw/8)},{h*($bh/8)},1,1,1 done +round[$>] +done +rm[$G] +l[^4--1] a c gcd_jpeg2srgb srgb2rgb round. r $w,$h,1,3,0 +if $13 blend_bomb 1,${14-18},0,0,0,${22-23} +r $www,$hhh,100%,100%,$21 fi +if $12 +rotate[0] {-$12*90},0 +fi +if $11==1 +mirror[0] x +elif $11==2 +mirror[0] y +elif $11==3 +mirror[0] xy +fi +done +done done +rm[$dct,$idct,$Q] +fx_jfif_preview : +gui_split_preview "fx_jfif $*",${-3--1} +fx_jfif_xt: +ww={w} +hh={h} +qu=$1/100 +sx=$2 +sy=$3 +to_rgb +csswap rgb,ycbcrjpeg +minl=0.05*wh +maxl=0.1*wh +diffx={-w%$sx} +diffy={-h%$sy} +w,h={[w,h]} r {w+$diffx},{h+$diffy},1,100%,0,3 +www={w} +hhh={h} +split_tiles -$sx,-$sy +dct f "I*cut(1+(("$sx"+"$sy")*"$qu"-(x+y)),0,1)" +append_tiles {$www/$sx} +f ">begin(const minl="$minl";const maxl="$maxl";cd=round(u(minl,maxl))); +cd-=1; +(cd<=0)?(cd=round(u(minl,maxl));J[0]=[u*50000,u*50000,u*50000]):(J[0])" +split_tiles -$sx,-$sy +idct +append_tiles {$www/$sx} +r {w-$diffx},{h-$diffy},1,100%,0,3 +csswap ycbcrjpeg,rgb +fx_jfif_xt_preview: +fx_jfif_xt $* +fx_jpeg : +to_rgb +inum=$! +q=$1 +cs=$2 +($3,$5,$7;$4,$6,$8;0,0,0;$9,$11,$13;$10,$12,$14) +nm. params +eval. "begin(index=0;list=transpose(crop(0,0,3,2),3);foundlist=vector6(0)); +for(n=0,n<3,++n, +pos=n*2; +cp=list[pos,2]; +(find(foundlist,cp,0,2)==-1)?( +index=find(foundlist,[0,0],0,2); +foundlist[index]=cp[0]; +foundlist[index+1]=cp[1]); +i(n,2)=find(foundlist,cp,0,2)*0.5 +);" +tcount=0 +repeat 3 +tnum={i(#$params,$>,2)} +if $tnum==$tcount +tw={i(#$params,$>,0)} +th={i(#$params,$>,1)} +dct_tileset $tw,$th +idct_tileset $tw,$th +tcount+=1 +fi +done +repeat $inum l[$>,{(-2*$tcount)-1}--1] +csswap[0] 0,$cs s[0] c +repeat 3 +cw={w(#0)} +ch={h(#0)} +tw={i(#$params,$>,0)} +th={i(#$params,$>,1)} +tn={i(#$params,$>,2)} +ox={-i(#$params,$>,3)%$tw} +oy={-i(#$params,$>,4)%$th} +imax=0 +imin=0 +l[$>] +imax={iM} +imin={im} +if $imax!=$imin +- $imin * {1/($imax-$imin)} +else ++ {1-$imax} +fi +done +z[$>] {-$ox},{-$oy},{$cw+((-$cw)%$tw)-1-$ox},{$ch+((-$ch)%$th)-1-$oy},3 +[$>] +f[$>] :" +begin(const tw="$tw";const th="$th";const twh=tw*th;const tn="$tn";const tileset=(tn-"$tcount")*2-1); +if (!(x%tw) && !(y%th), +res=vector(#twh,0); +ref(crop(x,y,tw,th),src); +for (l = 0, l",res,x,y,tw,th); +); i" +rm. +l[$>] +if $imax!=$imin +* {($imax-$imin)} + $imin +else ++ {$imax-1} +fi +done +z[$>] $ox,$oy,{$cw-1+$ox},{$ch-1+$oy},3 +done +a[0-2] c csswap[0] $cs,0 +done done +rm[{(-2*$tcount)-1}--1] +fx_jpeg_preview: +if $9 +o0,o1,o2,o3,o4,o5=${10-15} +else +repeat 6 +o$>=0 +done +fi +fx_jpeg ${1-8},$o0,$o1,$o2,$o3,$o4,$o5 +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}""{$9}""{"$o0"}_"{$9?2:0}"{"$o1"}_"{$9?2:0}"{"$o2"}_"{$9?2:0}"{"$o3"}_"{$9?2:0}"{"$o4"}_"{$9?2:0}"{"$o5"}_"{$9?2:0}##################### +#@cli :: User Karo's PINK-library operators +#@cli _xpink : pink_cmd, p1, ... , pn +#@cli : Packs the list of parameters to a string with spaces, generates the pink input image in tmp, executes the pink executable pink_cmd and loads the result image. The pink_cmd parameter can have options separated by ':' from the pink_cmd, actually only 'if' to specify, force the input file format of the executable. E.g. 'asf:if-uint8' would force the generated input pnk file to be of unsigned character type. Only 'uint8' 'uint' 'float' are allowed. Other options will possibly follow. +#@cli : To examine the parameters and to control existence of the program, type in a system shell 'pink_cmd', e.g. $ asf rspw. $ pink.asf ! +#@cli : If $GMIC_PINK_VERBOSE is true the command and sysout is printed +#@cli : If $GMIC_PINK_NO_RM is true temporary files are not removed +#@cli : Outfiles with 'P'(==80) as first char are considerd as images, everything else is considered as list +_xpink : +na={-1,n} +filename=${-filename_rand} +x_filename={/$filename} +if 0$GMIC_PINK_VERBOSE verb=" 2>&1" +else if ${-is_windows} verb=" >nul 2>&1" else verb=" >/dev/null 2>&1" fi fi +if 0$GMIC_PINK_NO_RM no_rm=1 else no_rm=0 fi +('$1') replace_str. ":","," replace_str. "-","," pc={t} rm. pink_cmd=${arg\ 1,$pc} +if ['${arg\ 2,$pc}']==['if'] ifo=,${arg\ 3,$pc} else ifo="" fi +if ${-kr_is_exec\ pink.${pink_cmd}}==0 fpin_cmd=pink.$pink_cmd +elif ${-kr_is_exec\ ${pink_cmd}}==0 fpin_cmd=$pink_cmd +elif ${-kr_is_exec\ ${pink_cmd}.exe}==0 fpin_cmd=${pink_cmd}.exe +else error "Executable (pink.)"$pink_cmd"(.exe) not found in PATH, status = "${}"!! Returning!!" fi +if 0$GMIC_PINK_VERBOSE +e "\n"$fpin_cmd" "${x_filename}".pnk $2 "${x_filename}"_o.pnk" fi +o ${x_filename}.pnk$ifo x ${fpin_cmd}\ ${x_filename}".pnk $2 "${x_filename}"_o.pnk"$verb +_status=${} +if !$no_rm delete ${x_filename}.pnk fi +if {"$_status!=0 && same(['$pink_cmd'],['seuilauto'],9)!=0"} error "Exec status is "$_status"." +elif isfile(['{/${filename}_o.pnk}']) +input_pinktest ${filename}_o.pnk +if ${}==80 i ${filename}_o.pnk else input_pinklist ${filename}_o.pnk fi +k. => $na +if !$no_rm delete ${x_filename}_o.pnk fi +else error "Exec error "$_status"!!" +fi +#@cli _xpinks : pink_cmd,parameter_string(with spaces!!) +#@cli : Splits c channel if necessary and executes "_xpink pink_cmd,parameter_string". +_xpinks : +foreach { +s:=s s. c +foreach { _xpink $1,"$2" k. } +if $s>1 a c fi +} +#@cli pink : eq. to 'pink_new'. +pink : pink_new $* +#@cli pink_new : pink_cmd,p1,...,pn +#@cli : Pink wrapper (requires the PINK library to be installed), see https://perso.esiee.fr/~coupriem/pinktutorial/ (in French) and https://perso.esiee.fr/~coupriem/Pink/doc/html/index.html (in English) +#@cli : Shortcut: pink +#@cli : - Prepares input, calls external "pink_cmd input p1...pn output" and reads output (/tmp) and replaces positional IMAGE parameters bei temp. files. These images are not splitted and merged. They have to have the necessary format for the respectice pink executable. Only Pink routines with input file(s) and ONE output file can be called. Images with spectral channels (s>1) are splitted, processed one by one and merged. +#@cli : - ATTENTION positional image parameter are never spitted and merged in contrast to selected (input) and output images. Positional image parameter should already have the needed format for the selected pink binary! +#@cli : - pink_new prepares selected images and image parameter as pnk files in auto mode and creates a command string. File format of generated input pnk file can be forced by an option attached to the "pink_cmd" by "pink_cmd:if-", e.g. "asf:if-uint8", overwriting auto mode. Images (splitted if spectrum s > 1) are processed one by one and are written as pnk files to temporary space, outfile is a pnk file name pointing to temporary space too. The executed call looks like\n"pink_cmd infile p1 ... (px)imagefile ... pn outfile". +#@cli : - For help of pink executable "pink_new help,pink_cmd" calls the executive command\n"open https://perso.esiee.fr/~coupriem/pinktutorial/_8c.html" instead of a pink binary. +#@cli : OS variables: +#@cli : GMIC_PINK_NO_RM == true: created files in temporary space are not removed +#@cli : GMIC_PINK_VERBOSE == true: created cmd string and pink messages are printed +#@cli : $ sp tiger +pink_new. asfr,5 pink_new.. asf,5 +#@cli : $ sp tiger +blur 2 round. pink_new maxima,4 +#@cli : $ sp to_gray ir. 0,50% +pink_new. distc,3 +negate.. +pink_new... dist,3 pink_new[1] bisector,[0] pink_new[3] bisector,[2] k[1,3] a c +#@cli : $ sp 2 +pink_new. dilatballnum,5 +- +#@cli : $ sp 2 +pink_new. asf,5 - +#@cli : $ sp boats ir. 0,50% +pink_new. dilatballnum,10 +pink_new.. distgeo,.,4 +#@cli : $ sp barbara +pink_new. seuilauto,128,max,3 +#@cli : $ sp 1,512,512 colorwheel 512 +pink_new. average,.. +pink_new : +$=pp +if $#>1 +np="" +repeat $#-1 { +if ${is_image_arg\ ${pp{$>+2}}} +pass${pp{$>+2}} +filename$>=${-filename_rand} +o. ${filename$>}.pnk rm. +np=${np}\ ${filename$>}.pnk +else np=${np}\ ${pp{$>+2}} fi +} +else np=" " fi +if ${-strcontains\ $1,help} x "open https://perso.esiee.fr/~coupriem/Pink/doc/html/"${pp2}"_8c.html" +else +v + e[^-1] "Call pink package on image$? with execute cmd: \"$1 [imgin]"$np" [imgout]\"." v - +_xpinks $1,$np +if !0$GMIC_PINK_NO_RM +repeat $#-1 { +if ${strlen\ ${filename$>}}>0 delete ${filename$>}.pnk fi +} +fi +fi +#@cli pink_grayskel : _connectivity(4), _lambda(0) +#@cli : () +#@cli : Grayscale homotopic skeleton (requires the PINK library to be installed). +#@cli : Default values: 'connectivity=4' and 'lambda=0' (actually only connex=4 implemented). +#@cli : $ sp tiger +pink_grayskel , +pink_grayskel[0] ,10 +pink_grayskel[0] ,100 append_tiles 2 +pink_grayskel : skip "${1=4},${2=0}" +e[^-1] "Call pink package on image$? with execute cmd: grayskel [imgin] 4 $2 [imgout]" +check "${1=4}==4" +pink grayskel:if-uint8,null,$1,$2 +#@cli pink_heightmaxima : _connectivity={ 4 | 8 | 6 | 26 },_height=1 +#@cli : () +#@cli : Heightmaxima filtering (requires the PINK library to be installed). +#@cli : Default values: 'connectivity=4' and 'height=1'. +#@cli : $ sp car +blur 2 round +pink_heightminima ,15 round[0,1] +pink_heightmaxima[0,1] ,15 -[-3,-1] -[-3,-1] k[-1,-2] +pink_heightmaxima : check "isin(${1=4},4,8,6,26)" skip ${2=1} +e[^-1] "Call pink package on image$? with execute cmd: heightmaxima [imgin] $1 $2 [imgout]" +pink heightmaxima:if-uint8,$1,$2 +#@cli pink_heightminima : _connectivity={ 4 | 8 | 6 | 26 },_height=1 +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/heightminima_8c.html) +#@cli : Heightminima filtering (requires the PINK library to be installed). +#@cli : Default values: 'connectivity=4' and 'height=1'. +#@cli : $ sp car +blur 2 round +pink_heightminima ,15 round[0,1] +pink_heightmaxima[0,1] ,15 -[-3,-1] -[-3,-1] k[-1,-2] +pink_heightminima : check "isin(${1=4},4,8,6,26)" skip ${2=1} +e[^-1] "Call pink package on image$? with execute cmd: heightminima [imgin] $1 $2 [imgout]" +pink heightminima:if-uint8,$1,$2 +#@cli pink_htkern : _connectivity={ 4 | 8 | 6 | 26 }, _type={"" | u} +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/htkern_8c.html) +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/htkernu_8c.html) +#@cli : Grayscale ultimate homotopic thinning/thickening without condition (requires the PINK library to be installed). +#@cli : Default values: 'connectivity=4' and 'type=""'. +#@cli : $ sp tiger +pink_htkern ,u +pink_htkern[0] , +-[-1,-2] remove[0] +pink_htkern : check "isin(${1=4},4,8,6,26) && isin(_'${2=}',0,117)" +e[^1] "Call pink package on image$? with execute cmd: htkern$2 [imgin] null $1 [imgout]" +pink htkern${2}:if-uint8,null,$1 +#@cli pink_lvkern : _connectivity={ 4 | 8 | 6 | 26 }, _type={"" | u} +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/lvkern_8c.html) +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/lvkernu_8c.html) +#@cli : Grayscale ultimate leveling thinning/thickening without condition (requires the PINK library to be installed). +#@cli : Default values: 'connectivity=4' and 'type=""'. +#@cli : $ sp tiger pink_lvkern ,u +pink_lvkern : check "isin(${1=4},4,8,6,26) && isin(_'${2=}',0,117)" +e[^1] "Call pink package on image$? with execute cmd: lvkern$2 [imgin] null $1 [imgout]" +pink lvkern${2}:if-uint8,null,$1 +#@cli pink_reg_minima : _connectivity={ 0 | 4 | 8 | 6 | 18 | 26 | 14} +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/minima_8c.html) +#@cli : Regional minima (requires the PINK library to be installed). +#@cli : Default values: 'connectivity=4'. +#@cli : $ sp tiger +blur 2 round. pink_reg_minima , +pink_reg_minima : check "isin(${1=4},0,4,8,6,18,26,14)" +e[^1] "Call pink package on image$? with execute cmd: minima [img] $1 [img]" +foreach { +if iM<256 tt=uint8 else tt=uint32 fi +pink minima:if-$tt,$1 +} +#@cli pink_reg_maxima : _connectivity={ 0 | 4 | 8 | 6 | 18 | 26 | 14} +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/maxima_8c.html) +#@cli : Regional maxima (requires the PINK library to be installed). +#@cli : Default values: 'connectivity=4'. +#@cli : $ sp tiger +blur 2 round. pink_reg_maxima , +pink_reg_maxima : check "isin(${1=4},0,4,8,6,18,26,14)" +e[^1] "Call pink package on image$? with execute cmd: maxima [imgin] $1 [imgout]" +foreach { +if iM<256 tt=uint8 else tt=uint32 fi +pink maxima:if-$tt,$1 +} +#@cli pink_skelcurv : _prio={prio image|0|1|2|3|4|8|6|18|26|5},_connectivity={ 4 | 8 | 6 | 26 },_inhibit={""|inhibit image} +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/skelcurv_8c.html) +#@cli : Curvilinear binary skeleton guided by a priority function or image (requires the PINK library to be installed). +#@cli : Default values: 'prio=0', 'connectivity=4' and 'inhibit=""'. +#@cli : $ sp tiger threshold 50% {w},{h} fill. 'if(x>w/2,255,0)' tp=${-path_tmp} output. ${tp}/inhibit.pgm remove. +pink_skelcurv[0] , +pink_skelcurv[0] ,,${tp}/inhibit.pgm exec "rm "${tp}"/inhibit.pgm" +#@cli : $ sp tiger threshold 50% +pink_skelcurv , +pink_skelcurv.. ,8 +pink_skelcurv : check ${is_image_arg\ ${1=0}}" || isin($1,0,1,2,3,4,8,6,18,26,5) && isin(${2=4},4,8,6,26)" skip "${3=}" +e[^1] "Call pink package on image$? with execute cmd: skelcurv [img] $1 $2 $3 [img]" +if ${is_image_arg\ $3} pink skelcurv:if-uint8,$1,$2,$3 else pink skelcurv:if-uint8,$1,$2 fi +#@cli pink_skelend : _connectivity={ 4 | 8 | 6 | 26 },_n=0 +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/skelend_8c.html) +#@cli : Homotopic skeleton of a 2d or 3d binary image with dynamic detection of end points (requires the PINK library to be installed). +#@cli : Default values: 'connectivity=4' and 'n=0'. +#@cli : $ sp tiger threshold 50% +pink_skelend , +pink_skelend.. ,-1 +pink_skelend : check "isin(${1=4},4,8,6,26)" skip "${2=0}" +e[^1] "Call pink package on image$? with execute cmd: skelend [imgin] $1 $2 [imgout]" +if $2==0 pink skelend:if-uint8,$1 else pink skelend:if-uint8,$1,$2 fi +#@cli pink_skeleton : _prio={0|1|2|3|4|8|6|26},_connectivity={ 4 | 8 | 6 | 26 },_inhibit="" +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/skeleton_8c.html) +#@cli : Ultimate binary skeleton guided by a priority image (requires the PINK library to be installed). +#@cli : Default values: 'prio=0', 'connectivity=4' and 'inhibit=-1'. +#@cli : $ sp tiger threshold 50% +pink_skeleton. , +pink_skeleton : check ${is_image_arg\ ${1=0}}" || isin($1,0,1,2,3,4,8,6,26) && isin(${2=4},4,8,6,26)" skip "${3=-1}" +e[^1] "Call pink package on image$? with execute cmd: skeleton [imgin] $1 $2 [$3] [imgout]" +pink skeleton:if-uint8,$1,$2,$3 +#@cli pink_skelpar : _algorithm={0...31},_nsteps=_1,_inhibit="" +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/skelpar_8c.html) +#@cli : Parallel binary skeleton (requires the PINK library to be installed). +#@cli : Default values: 'algorithm=4', 'nsteps=-1' and 'inhibit=""'. +#@cli : For most of the implemented algorithsm an inhibit image is not implemented! +#@cli : $ sp tiger threshold 50% +pink_skelpar. 0 +pink_skelpar. 2 +pink_skelpar : check "${1=4}>=0 && $1<=31" skip "${2=-1} ${3=''}" +e[^1] "Call pink package on image$? with execute cmd: skelpar [imgin] $1 $2 $3 [imgout]" +karo_frame 2 if ${-is_image_arg\ $3} pink skelpar:if-uint8,$1,$2,$3 else pink skelpar:if-uint8,$1,$2 fi +#@cli pink_wshed : _connectivity={ 4 | 8 | 6 | 26 },_inverse={ 0 | 1 },_height=0 +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/wshedtopo_8c.html) +#@cli : Watershed (requires the PINK library to be installed). +#@cli : Default values: 'connectivity=4', 'inverse=0' and 'height=0'. +#@cli : $ sp car +pink_wshed ,1,5 pink_wshed[0] ,,5 +pink_wshed : check "isin(${1=4},4,8,6,26)" skip "${2=0},${3=0}" +if $3==0 e[^-1] "Call from Pink package: wshedtopo $1 "${"arg 1+!$2,inverted.,."} +else e[^-1] "Call from Pink package: heightminima $1 $3 wshedtopo $1 "${"arg 1+!$2,inverted.,."} fi +foreach { +s:=s if $s>1 s. c fi +if d==1 +check "$1==4 || $1==8" +foreach { +f max(min(i,255),0) +if $2!=0 negate 255 fi +if $3>0 pink heightminima:if-uint8,$1,$3 fi +pink wshedtopo:if-uint8,$1 +if $2!=0 negate 255 fi +} +else +check "$1==6 || $1==26" +foreach { +f max(min(i,255),0) +if $2!=0 negate 255 fi +if $3>0 pink heightminima:if-uint8,$1,$3 fi +pink wshedtopo:if-uint8,$1 +if $2!=0 negate 255 fi +} +fi +if $s>1 a[-$s--1] c fi +} +#@cli output_pinklist : filename, _type +#@cli : write an (c,n) image with c=1..4 colums and n lines to a pink list file +#@cli : Automatic type: c==1 => e, c==2 => b c==3 => B, c==4 => N +#@cli : Manual type possible: c==2 => s, c==3 => n +#@cli : Default value: 'type=" "' (space) +#@cli : List formats according PINK format description +#@cli : ~~~ +#@cli : e s b n B N +#@cli : x1 x1 v1 x1 y1 x1 y1 v1 x1 y1 z1 x1 y1 z1 v1 +#@cli : x2 or x2 v2 or x2 y2 or x2 y2 v2 or x2 y2 z2 or z2 x2 y2 v2 +#@cli : ... ... ... ... ... ... +#@cli : xn xn vn xn yn xn yn vn xn yn z3 z3 xn yn vn +#@cli : ~~~ +output_pinklist : +skip "${2=\ }" +itp={'$2'} +ltyp={'ebBN'} +if w>4 error "Image wrong colums" fi +typ={typ=vector4($ltyp);typ[w-1]} +if $typ==_'b'&&$itp==_'s' typ=$itp +elif $typ==_'B'&&$itp==_'n' typ=$itp fi +e[^-1] "Write pinklist typ "{`$typ`}" with "{h}" lines to "{``$1} +($typ,32,{'{h}'}) +o.. asc:$1 rm.. +i raw:$1,uint8 s. +,{'\n'} y rm[1] a y +o raw:$1,uint8 rm +u $typ +#@cli pink_delaunay : _mode +#@cli : Prepare the delaunay triangulation from a list of coordimates (vertices) +#@cli : using the external program pink.delaunay, no test for external delaunay +#@cli : mode == 0 a 3d object or +#@cli : mode != 0 the vertice, hull, edge lists and the adjacency matrix +#@cli : Default value: 'mode=0' +#@cli : $ 2,50,1,1 rand 0,512 pink_delaunay. 0 +pink_delaunay : skip ${1=0} +e[^-1] "Prepare Delaunay triangulation from$? to 3d object or set of lists ($1)" +filename_rand nn=${} +output_pinklist. $nn".tmp" +x 0,"pink.delaunay "$nn".tmp "$nn".del" +input_pinklist[] $nn".del",$1 +delete $nn.tmp +delete $nn.del +#@cli pink_asflin : _dir(x|y|z), _rad(5), _radmax(0) +#@cli : 'asflin' filter workaround for 2D images! +#@cli : 'asflin' works only in 3D images (d>1) +#@cli : 'asflin' is called with dir,rad or if radmax>rad with dir,rad,radmax +#@cli : (https://perso.esiee.fr/~coupriem/Pink/doc/html/asflin_8c.html) +#@cli : pink_asflin (requires the PINK library to be installed). +#@cli : $ sp tiger +pink_asflin. , +pink_asflin.. y,5 +pink_asflin : +check "isin(_'${1=x}',['xyz']) && ${2=5}>0 && ${3=0}>=0" +foreach { d_alt=0 +if d==1 . a z d_alt=1 fi +if $3<=$2 pink asflin,$1,$2 else pink asflin,$1,$2,$3 fi +if $d_alt==1 s z k. fi +} +#@cli pink_karo_zerleg : eq. to 'karo_zerleg'. +pink_karo_zerleg : karo_zerleg $* +#@cli karo_zerleg : +#@cli : Partition of binary image zero areas +#@cli : using pink watershed (https://perso.esiee.fr/~coupriem/Pink/doc/html/wshedtopo_8c.html) +#@cli : Author : KaRo. Latest update : 2017/11/30. +#@cli : $ follic pink seuilauto,254,min,5 n 0,1 karo_open 3 +not karo_zerleg. not. a c +#@cli : $ sp 6 to_gray +threshold 140 +karo_zerleg. a[-1,-2] c +karo_zerleg : +e[^1] "Partition of binary image"$?" with pink watershed" +foreach { ++distance. 1 round. pink_wshed. 8,1 f. "j(0,0)!=j(1,1) || j(1,0)!=j(0,1)" skeleton. , or[0,-1] +} +#@cli :: User KaRo's CLI I/O functions +#@cli osteo : +#@cli : Load osteoblast cell image (transmitted light) +#@cli : $ osteo ++osteo : +e[^-1] "Load osteoblast nucleus example image" +l[] { base642img "MiB1aW50OCBsaXR0bGVfZW5kaWFuCjEyOCAxMjggMSAxICMxMTA1MAp4nC17V5Mk15ndv1NsSLGUQlotKIoUl7vcBUguQRgCg3E""9076895VZlWWybJdrOzM9GO8w3V2V3nYDUoRCD3pQhB71pnNuAYOZ6KquynvvZ853PnPt0Hds2zYc07dsWzccx7QMy7Mc3zEs/O""eYju+armm7jusYrmVb+LxpXweG43q6Y1lBGPBjtm+5vuE616Hj+Y7j2rYVup7lXoe2xXd+9Fzbc50b18eCvu3gY17o2x6+Z2B5m""18wLVO3sbSHnw3ftd3QsFzDdV0by+q+7zq25jgOnmRdO7rpBwa27HM/lhuEnu/buou94gMh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QuJxw+ebNhYgivrNiidPkrDwHvmzWecQIMBiQJpCIXrFezmD+z0IwB7bE5DUeZyE8""eywYu0LIULou5qQQJHW8YCPRXfeRxB0tHtt2ly+X78jMxBF0ypwXCHjNhJcpPQCIuOmEzQJbOflAOxX3IWFVOp3Q0YiKABpP1wn""iwvIYpEnqwdicn9n6uoQnYpiY5LeEwdgvr3QW+lnaMwxRZeA0AAk4g42o9wNuHBY9bEFTWaPVPHEXGxYWrEc0RJXS1ERY4mkobm""G7hHRWedfgxm0LVoNwzQ3QYzVH3CcSDUdOAYpZN96TETM/zDJE94ESB2nXeJXJ5KHZiOEuDPIVU1TQXOvj0v35cgnHBqgjj5wXf""5313WThixy3gw2ytEXjNMmCxEU+HCPQEIyXwsBsjl8irJEAAEUN3j1lycZnoQRBT0xk+WRxrIpA6je+tgIK0IJ/ZtaOSNPWICaM""lJkmnQNAZ3PCjBHbIeFYp1ZAB+xbzF+vr6+TkS9pV0xBgFSsxLngwpxBJQkjY2Zl2BSXH5ieIIaZAgbW2EyW6noam9m8/sdb4yz""p65z04G50MfgoOi+ccxJf5yUOQLb3/wEmr00PMSAxMCAxIDEgIzE4Cnicc/eNYsgvLknNZwAAEQsDGQ==" +} +#@cli osteo_ : +#@cli : Load osteoblast cell image and cell mask (transmitted light) +#@cli : $ osteo_ ++osteo_ : +e[^-1] "Load osteoblast nucleus example image and mask" +l[] { osteo base642img "MiBpbnQxNiBsaXR0bGVfZW5kaWFuCjEgMTYzIDEgMSAjMjIzCnicVdDLSoJRGIXh5cCxgyYJCgUFlVigRZGZpuXhrrwCRzYpqEF""QUVFUUqkdsCztbpo0flv+RSibBzZ78H1r7ZpqCvnIel8hQUQNJrVHTAdM6YgZHTOnUzsnqUsWdUVKt6TVZEV3rOqBNbVYV4eMHt""nQE5t6thfy6lLQq71RDPTY1jsl9SkHBlQCn1T/jN6rY++DMeX/Gb9K+mDHs0cVvXu4t+AcW5Z3ppwN82WdNaO2c7ec/95dmiy7V""0o3ds2SuyZ1QUJnLNi8Tpj1f0zrkLj2iWqXCdUJK/v9A/ovmeIxIDExIDEgMSAjMjcKeJxzZ/BliGJgYMhnKGYoYUgF0vFAHgAp""xAN4" +decompress_rle. => osteo_ +} +#@cli follic : +#@cli : Load follicle cells sample image from thyroid (transmitted light) from internet or local storage. +#@cli : For frequent usage do "gmic follic o ${_path_rc}follic.pgm" to store the image locally, follic looks there first! +#@cli : $ follic ++follic : +if isfile(['{/${_path_rc}follic.pgm}']) +e[^-1] "Load thyroid follicle nuclei example image from local storage" +i ${_path_rc}follic.pgm +else e[^-1] "Load thyroid follicle nuclei example image from http://karo03.bplaced.net/gmic/Repo/follic.pgm" +i http://karo03.bplaced.net/gmic/Repo/follic.pgm fi => follic +#@cli follic_ : +#@cli : Load follicle cells image and masks from thyroid (transmitted light) from internet or local storage. +#@cli : $ follic_ ++follic_ : +e[^-1] "Load thyroid follicle nuclei and mask example image" +l[] { follic +base642img "MiBzaG9ydCBsaXR0bGVfZW5kaWFuCjEgMTMwMyAxIDEgIzE0NDkKeJx1lttP3FUQx4eqvclNYBeW3eW3Ny7+E+qTlydj4oOJ""11Yf9dEnL21Nm4q2RaS0NlqVmGgtjZaAtUUqrYkWUFsuC1SslFYbtRcFCuyyy/6OnzO7lCWNyf5yZr7nnO/MmZkzZ6VACviJ8""LVMrZciUyplplwGzV2SNgXyqPHKGNhjpkomjEceN9XyG98Txi8XTY08aYJyyTjyFPJlE5Kn+X7PG58xEbkJz03GZ/nmTLG4Ji""zPmajMw+uyxsoLpgzZUTlhKsSAb0JOYtPim0xMUqYS3JHNKletkl3s2/VpfDP4ZHmW8PF2OYIcYH0gJwfBA/gWlgwcWTkEnpW""bicNITnfheNdskFHkJTCDrRZTiB7AblZv5UxjrFvW93GuceOTRXQXP/dxnvOcI4k9g5406+RTYjwOnlCskr2lcoS5GeJmsH/d""3EOswuz3YrdMvoBvDrvXzUb5V/d4wD1yFHsLxPequUOu6foKvkrpwJ+EKZFhzuvClWF/J+dehGtEsRKNR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dW9uqb/4n2JC859yhu""+06b9uNK3hWv9keblzbtSVW8Q17tL7aftGmv8cGf7Wd27cfaa/zU1jIWBqvUN2cFi4B5lGda1wcV+4jasT1yOveu2z7zIeez7""+lMHnaAGpxfhcVkF3Zm8/Td8K3otbLnf3RX+/2y7tde7JLrd7CT1atVb8rprv7/qM/pAY1TJqfP6LxHa2WP6va/R7m+R9afGY""1h9p7sUr1G3+Nkzv9p9Aw5X2DubdWDnLOAdSF6mUP8AvIHa3Yi38Cvy+g70K08RRy3s/4a/k3i0xv48je5uoA/25j/k7xPUBO""vM39F/6cUyyvMXcJ+nPf6ZbBJ3vf7wM9zZ7aO/QedweGnMSAxNyAxIDEgIzM5Cnicc2fwZYhiYGBIY8hnyAHCTIZkhniGXAY9""hgKGdCDNwAAAZYIFpg==" +decompress_rle. => follic_ +} +#@cli sincos : _w(512), _h(512), _new(0) +#@cli : Generation of a simple sine cosine testimage +#@cli : Default value: 'w=h=512', 'new=1' +#@cli : $ sincos , +shift. 50%,0,0,0,2 +shift.. 0,50%,0,0,2 a c +#@cli : $ sincos , sincos ,,1 +- f. 'if(i<-1,0,i)' ++sincos : +skip "${1=512},${2=$1},${3=1}" +e[^-1] "Sine/cosine testimage ${1-3}!" +l[] { +if {"!(!$3 && $_version>=298)"} $1,$2,1,1,'begin(a=pi*w;b=pi*h);i=sin(a/(x+1))*cos(b/(y+1));if(i<=0,i+=1,i);i*255' +else +$1,$2,1,1,'begin(a=pi*w;b=pi*h);sin(a/(x+1))*cos(b/(y+1))' ++f. 'sign(i)' eq. 1 +neq. 1 *[1] ... *. ... n[-1,-2] 0,255 +f[-1,-2] 'if(i==255,0,i)' +[-1,-2] rm.. +fi +=> sincos } +#@cli kr_spect : _size=512, _force_native(=0) +#@cli : Generate example spectrum image prepared with 'distance' or if existant external pink executable 'dist' and not forced! +#@cli : $ kr_spect ,1 ++kr_spect : skip "${1=512},${2=0}" +l[] { +$1,$1 = 255,{{w}/2},{{h}/2} +if ((${-kr_is_exec\ pink.dist}==0)||(${-kr_is_exec\ dist}==0)||(${-kr_is_exec\ dist.exe}==0))&&(!$2) +e[^-1] "Generate spectrum example using external PINK 'dist'" +pink. dist,0 +else +e[^-1] "Generate spectrum example using native 'distance'" +not. distance. 0 fi +f. (iM-i)/iM*100 [-1] +f. x +f. (i/$1-0.5)*200 ++transpose. +*. -1 +a[-1--3] c +lab2rgb. +} +#@cli kr_testimage : _sizex(256),_sizey(_sizex) +#@cli : Another simple spectrum image for tests +#@cli : $ kr_testimage , ++kr_testimage : skip "${1=256},${2=$1}" +l[] { $1,$2,1,3 fill. "if(c==0,x/w*255,if(c==1,y/h*255,if(c==2,(((x/w*255+y/h*255)-256)^2)^0.5,0)))" } +#@cli karo_read_bd : name,_verbosity(=0),_append_type(=z) {z|c|x|y},_no_delete(=0) +#@cli : Read biodata with external bfconvert from OME +#@cli : bftools directory has to be in the PATH +#@cli : http://www.openmicroscopy.org/site/support/bio-formats5/users/comlinetools/conversion.html +#@cli : Default values: 'verbosity=0', 'append_type=z', 'no_delete=0' ++karo_read_bd : skip "${2=0},${3=z},${4=0}" ina=$1 +e[^-1] "Read biodata with OME bftool bfconvert (name=\""$ina"\", verbosity=$2, append_type=$3, no_delete=$4)." +ona=${-path_tmp}${-file_slash}gmic_bd_$_pid.tif +if $2<2 postf=" >/dev/null 2>&1" else postf="" fi +cmd="bfconvert merge overwrite -no-upgrade "${ina}" "${ona} +if ${-is_windows}==0 cmd=${cmd}${postf} else +e $(cmd) fi +if isfile(['{/$ina}']) +if $2!=0 +e $cmd fi x $cmd if $2!=0 fi +if isfile(['{/$ona}']) l[] { +i ${ona} if $!>0 if '"$3"'=='z' a z elif '"$3"'=='c' a c elif '"$3"'=='x' a x elif '"$3"'=='y' a y fi fi +if $4==0 delete $ona else e "File "$ona" not deleted!" fi } +else e "File "$ona" not found!" fi +else e "File "$ina" not found!" fi +#@cli gwyddionread : _filename +#@cli : Read gwyddion ASCII file and produce image. +#@cli : For gwyddion files see http://gwyddion.net . +#@cli : Data beginning after "Start of Data:" are imported +#@cli : [x-length, y-length, x-offset, y-offset, header lines] are returned in ${} +#@cli : gwyddion Example header +#@cli : |# File Format = ASCII +#@cli : |# Created by Gwyddion 2.48 +#@cli : |# Original file: gwyddion_Example.asc +#@cli : |# x-pixels = 640 +#@cli : |# y-pixels = 480 +#@cli : |# x-length = 313789.96127244376 +#@cli : |# y-length = 235219.70492879587 +#@cli : |# x-offset = 0 +#@cli : |# y-offset = 0 +#@cli : |# Bit2nm = 1.0 +#@cli : |# Start of Data: ++gwyddionread : skip "${1=gwyddion_Example.asc}" +e[^-1] "Read gwyddion ASCII text data: "$1 +l[] { +i raw:"$1",uint8 nm={b} +s +,{'\n'} +size_x,size_y,len_x,len_y,offs_x,offs_y,bit2nm,hend=-1 +foreach { +if same(['{$>,t}'],'"# x-pixels ="',12) rows[$>] 12,100% size_x={{$>,t}} +elif same(['{$>,t}'],'"# y-pixels ="',12) rows[$>] 12,100% size_y={{$>,t}} +elif same(['{$>,t}'],'"# x-length ="',12) rows[$>] 12,100% len_x={{$>,t}} +elif same(['{$>,t}'],'"# y-length ="',12) rows[$>] 12,100% len_y={{$>,t}} +elif same(['{$>,t}'],'"# x-offset ="',12) rows[$>] 12,100% offs_x={{$>,t}} +elif same(['{$>,t}'],'"# y-offset ="',12) rows[$>] 12,100% offs_y={{$>,t}} +elif same(['{$>,t}'],'"# Bit2nm ="',10) rows[$>] 10,100% bit2nm={{$>,t}} +elif same(['{$>,t}'],'"# Start of Data:"',16) hend=$> break +fi +} +if $hend>0 +rm[0-{$hend+1}] a y +discard 13 +file_tmp=${-filename_rand} +if $!>1 o.. raw:$file_tmp,uint8 rm.. i dlm:$file_tmp => $nm +o.. raw:${file_tmp}_,uint8 rm.. i dlm:${file_tmp}_ => ${nm}_ delete ${file_tmp}_ +else o raw:$file_tmp,uint8 rm i dlm:$file_tmp => $nm fi +delete $file_tmp +else rm fi +u [$len_x,$len_y,$offs_x,$offs_y,$bit2nm] +} +#@cli wykoread : _filename +#@cli : Read Wyko/Bruker/Vision ASCII file and produce image(s) +#@cli : For Wyko files see also under http://gwyddion.net . +#@cli : Data preceded by "RAW_DATA" and/or "Intensity" are imported +#@cli : Wyko Example header +#@cli : |Wyko ASCII Data File Format 0 1 1 +#@cli : |X Size 640 +#@cli : |Y Size 480 +#@cli : |Block Name Type Length Value +#@cli : |Wavelength 7 4 71.992500 +#@cli : |Aspect 7 4 1.000000 +#@cli : |Pixel_size 7 4 0.000985 +#@cli : |Magnification 8 8 10.050000 +#@cli : |ScannerSpeed 7 4 2.315832 +#@cli : |RAW_DATA 3 1228800 +#@cli : Default value: 'filename=Wyko_Example.ASC' ++wykoread : skip "${1=Wyko_Example.ASC}" +e[^-1] "Read Vision surface profilometry OPD text data: "$1 +l[] { +i raw:"$1",uint8 nm={b} +s +,{'\n'} +size_x,size_y,hend,rend=-1 +foreach { +if same(['{$>,t}'],'"X Size"',6) rows[$>] 6,100% size_x={{$>,t}} +elif same(['{$>,t}'],'"Y Size"',6) rows[$>] 6,100% size_y={{$>,t}} +elif same(['{$>,t}'],'"RAW_DATA"',8) hend=$> +elif same(['{$>,t}'],'"Intensity"',9) rend=$> break +fi +} +if $hend>0 +rm[0-{$hend+1}] +if $rend>$hend a[0-{$rend-$hend-3}] y rm[1,2] a[1--1] y else a y fi +replace_str "Bad","nan" +discard 13 +file_tmp=${-filename_rand} +if $!>1 o.. raw:$file_tmp,uint8 rm.. i dlm:$file_tmp => $nm +o.. raw:${file_tmp}_,uint8 rm.. i dlm:${file_tmp}_ => ${nm}_ delete ${file_tmp}_ +else o raw:$file_tmp,uint8 rm i dlm:$file_tmp => $nm +fi +delete $file_tmp +rotate -90,0 +else rm fi +} +#@cli karo_dtpread : filename,_bit0 +#@cli : Read dtp image file format +#@cli : (512 byte header, col[22-24] x row[25-27] byte image) +#@cli : with _bit0 != 0 bit level 1 is extracted as binary mask +#@cli : and bit level 1 in the gray image is randomized. +#@cli : Default value: 'bit0=0' +#@cli : Ex.: karo_dtpread Images/Beispiele/tra005.cel,1 ++karo_dtpread : check isfile(['{/$1}']) check "${2=0}>=0" +e[^-1] "Read dtp image file from "$1"." +i raw:$1,uint8 +({@22-24}) x={t} rm. +({@25-27}) y={t} rm. +({@0-79}) _dtph={t} rm. +crop. 0,512,0,{h} +resize. $x,$y,1,1,-1 +if $2 +and. 1 and.. 254 f.. "i+(u>0.5)" fi +_wrbytepnk : +output_pink3d ${1}.pnk +#@cli output_pink3d : filename,_type +#@cli : Save selected images as type-coded (P5,P8,P9) PNK files (PINK extension for 3d volumetric images). +#@cli : +#@cli : Other file types are listed for info only! +#@cli : +#@cli : Pink file formats (from PINK source) +#@cli : P4: raw binary ; P1: ascii binary (2D: standard ; 3D: extension Pink) NOT YET SUPPORTED +#@cli : P5: raw byte ; P2: ascii gray (2D: standard ; 3D: extension Pink) +#@cli : P6: raw byte rgb ; P3: ascii rgb (2D: standard ; 3D: NOT YET SUPPORTED) +#@cli : P8: raw long 2d-3d (extension Pink) +#@cli : P9: raw float 2d-3d (extension Pink) +#@cli : PA: ascii float 2d-3d (extension Pink) +#@cli : PB: ascii long 2d-3d (extension Pink) +#@cli : PC: raw double 2d-3d (extension Pink) +#@cli : PD: ascii double 2d-3d (extension Pink) +#@cli : PE: raw single precision complex 2d-3d (extension Pink) +#@cli : PF: ascii single precision complex 2d-3d (extension Pink) +#@cli : +#@cli : Images +#@cli : +#@cli : FILE ::= 'P2' \\* \ \ \\* FILE ::= 'P5' \\* \ \ \\* +#@cli : COMMENT ::= '#' char\* newline COMMENT ::= '#' char\* newline +#@cli : DIMENSIONS ::= \ \ | \ \ \ DIMENSIONS ::= \ \ | \ \ \ +#@cli : RS ::= ascii_coded_integer RS ::= ascii_coded_integer +#@cli : CS ::= ascii_coded_integer CS ::= ascii_coded_integer +#@cli : DS ::= ascii_coded_integer DS ::= ascii_coded_integer +#@cli : VALMAX ::= ascii_coded_integer VALMAX ::= ascii_coded_integer +#@cli : PIXEL ::= ascii_coded_integer8 PIXEL ::= binary_coded_integer8 +#@cli : +#@cli : FILE ::= 'P8' \\* \ \ \\* FILE ::= 'P9' \\* \ \ \\* +#@cli : COMMENT ::= '#' char\* newline COMMENT ::= '#' char\* newline +#@cli : DIMENSIONS ::= \ \ | \ \ \ DIMENSIONS ::= \ \ | \ \ \ +#@cli : RS ::= ascii_coded_integer RS ::= ascii_coded_integer +#@cli : CS ::= ascii_coded_integer CS ::= ascii_coded_integer +#@cli : DS ::= ascii_coded_integer DS ::= ascii_coded_integer +#@cli : VALMAX ::= ascii_coded_integer [unused] VALMAX ::= ascii_coded_integer [unused] +#@cli : PIXEL ::= binary_coded_integer32 PIXEL ::= binary_coded_float +#@cli : +#@cli : FILE ::= 'PA' \\* \ \ \\* FILE ::= PB \\* \ \ \\* +#@cli : COMMENT ::= '#' char\* newline COMMENT ::= '#' char\* newline +#@cli : DIMENSIONS ::= \ \ | \ \ \ DIMENSIONS ::= \ \ | \ \ \ +#@cli : RS ::= ascii_coded_integer RS ::= ascii_coded_integer +#@cli : CS ::= ascii_coded_integer CS ::= ascii_coded_integer +#@cli : DS ::= ascii_coded_integer DS ::= ascii_coded_integer +#@cli : VALMAX ::= ascii_coded_integer [unused] VALMAX ::= ascii_coded_integer [unused] +#@cli : PIXEL ::= ascii_coded_float PIXEL ::= ascii_coded_integer32 +#@cli : +#@cli : FILE ::= 'PC' \\* \ \ \\* FILE ::= 'PD' \\* \ \ \\* +#@cli : COMMENT ::= '#' char\* newline COMMENT ::= '#' char\* newline +#@cli : DIMENSIONS ::= \ \ | \ \ \ DIMENSIONS ::= \ \ | \ \ \ +#@cli : RS ::= ascii_coded_integer RS ::= ascii_coded_integer +#@cli : CS ::= ascii_coded_integer CS ::= ascii_coded_integer +#@cli : DS ::= ascii_coded_integer DS ::= ascii_coded_integer +#@cli : VALMAX ::= ascii_coded_integer [unused] VALMAX ::= ascii_coded_integer [unused] +#@cli : PIXEL ::= binary_coded_double PIXEL ::= ascii_coded_double +#@cli : +#@cli : FILE ::= 'PE' \\* \ \ (\ \)\* FILE ::= 'PF' \\* \ \ (\ \)\* +#@cli : COMMENT ::= '#' char\* newline COMMENT ::= '#' char\* newline +#@cli : DIMENSIONS ::= \ \ | \ \ \ DIMENSIONS ::= \ \ | \ \ \ +#@cli : RS ::= ascii_coded_integer RS ::= ascii_coded_integer +#@cli : CS ::= ascii_coded_integer CS ::= ascii_coded_integer +#@cli : DS ::= ascii_coded_integer DS ::= ascii_coded_integer +#@cli : VALMAX ::= ascii_coded_integer [unused] VALMAX ::= ascii_coded_integer [unused] +#@cli : RE ::= binary_coded_float RE ::= ascii_coded_float +#@cli : IM ::= binary_coded_float IM ::= ascii_coded_float +#@cli : +#@cli : Default value: 'type=P5' +output_pink3d : skip ${2=P5} +e[^-1] "Output image$? as file '$1' (in 3d pink extension of "$2"-coded PNK format)." +if $!==1 filename0="$1" +else foreach { filename$>=${filename\ "\"$1\"",$>} } fi +tp="$2" +foreach { +if ['$tp']=='P5'&&iM>=256 tp="P8" fi +if ['$tp']=='P5' o. pnk:${filename$>},uint8 +elif ['$tp']=='P8' o. pnk:${filename$>},uint +elif ['$tp']=='P9' o. pnk:${filename$>},float +else error "Type $tp not implemented!" fi +} +#@cli input_pinktest : file_name +#@cli : Test file type for pnk (pink) and pnm (portable anymap) file type. +#@cli : Routine returns the first character from the first non comment line in status. If status == 'P'( == 80) a pnk/pnm file is expected! For pink everything else is considered as pink list or non-pink-file. +input_pinktest : +i[0] raw:"$1",uint8 s[0] -,{'\n'} i=0 +do u {$i,@0} i={$i+1} while ${}==35&&$i<$! +rm +#@cli pink_setorigin : pink_file, _orig_x, _orig_y, _orig_z +#@cli : Call of pink routine setorigin to make an image file as structuring element usable +#@cli : Default values: 'orig_x=orig_y=orig_z=0' +pink_setorigin : skip "${2=0},${3=0},${4=0}" +input_pinktest $1 if ${}!=80 error "Not a pnk file: "$1 fi +if ${-is_windows} x "setorigin $1 $2 $3 $4" +else +x 0,"type setorigin" +if ${}==0 x "setorigin $1 $2 $3 $4" +else +x 0,"type pink.setorigin" +if ${}==0 x "pink.setorigin $1 $2 $3 $4" +else error "setorigin not found!" fi +fi +fi +#@cli input_pinklist : file_name, _mode +#@cli : Read a pink list file +#@cli : spec. type G from pink.delaunay) at file_name and prepare +#@cli : _mode == 0 a 3d object or +#@cli : _mode != 0 the vertice, hull, edge list images and the adjacency matrix +#@cli : _mode only valid for graph lists type G, all other list types return only an image. All list (image) sizes are returned in status! +#@cli : Default value: 'mode=0' +#@cli : +#@cli : Summary of Pink list formats read: +#@cli : ~~~ +#@cli : Type e s b n B N \nvalues x1 x1 v1 x1 y1 x1 y1 v1 x1 y1 z1 x1 y1 z1 v1 \n... x2 x2 v2 x2 y2 x2 y2 v2 x2 y2 z2 z2 x2 y2 v2 \n... ... ... ... ... ... ... \n... xn xn vn xn yn xn yn vn xn yn z3 z3 xn yn vn \n\nType G \nvalues x1 y1[ v1] ec1 ns1 s11 s12 ... s1ns1 \n... x2 y2[ v2] ec2 ns2 s21 s22 ... s1ns2 \n... ... \n... xn yn[ vn] ecn nsn sn1 sn2 ... s1nsn \n\nSplines \n2D case: \nType c n+1 (where n+1 denotes the number of control points) \nx1 y1 \n... \nxn+1 yn+1 \nC0X1 C0Y1 C1X1 C1Y1 C2X1 C2Y1 C3X1 C3Y1 \n... \nC0Xn C0Yn C1Xn C1Yn C2Xn C2Yn C3Xn C3Yn \n\n3D case: \nType C n+1 (where n+1 denotes the number of control points) \nx1 y1 z1 \n... \nxn+1 yn+1 zn+1 \nC0X1 C0Y1 C0Z1 C1X1 C1Y1 C1Z1 C2X1 C2Y1 C2Z1 C3X1 C3Y1 C3Z1 \n... \nC0Xn C0Yn C0Zn C1Xn C1Yn C1Zn C2Xn C2Yn C2Zn C3Xn C3Yn C3Zn \n\nThe xi yi zi are the coordinates of the control points. \nThe C?Xi C?Yi C?Zi are the coefficient of the polynoms of the ith cubic spline. \nThe ith segment (starting with i=0) of the parametric curve P is then defined by: \nx(t) = C3Xi * t^3 + C2Xi * t^2 + C1Xi * t + C0Xi \ny(t) = C3Yi * t^3 + C2Yi * t^2 + C1Yi * t + C0Yi \nz(t) = C3Zi * t^3 + C2Zi * t^2 + C1Zi * t + C0Zi \nwith t in [i,i+1] +#@cli : ~~~ +#@cli : where _xi, yi_ are the coordinates of the _i_ -th vertex, _vi_ is the associated value (if given in the input file), _eci_ is a int which indicates whether the vertex _i_ belongs to the convex hull, _nsi_ denotes the number of adjacent vertices, and _si1 si2 ... sins1_ is the list of the indexes of the adjacent vertices (counted from 0) (see ). ++input_pinklist : +skip ${2=0} +e[^-1] "Read pinklist $1" +l[] { +i[0] raw:"$1",uint8 s[0] -,{'\n'} +if i(#0,0)=='G' e[^1] "Delaunay graph list file mode "{0,t}" vertices" +rows[0] 2,100% n={0,t} rm[0] +3,$n,1,1 => vertices +1,$n,1,1 => vhull +0 => edges +repeat $!-3 { l[{$>},vertices,vhull,edges] { +s[0] -,{'\ '} +=[vertices] {0,t},0,$> =[vertices] {1,t},1,$> =[vertices] {2,t},2,$> +=[vhull] {3,t},0,$> {{4,t}*3},1,1,1 p=$> +repeat {4,t} { =. 2,{$>*3} =. $p,{$>*3+1} =. {{$>+5},t},{$>*3+2} } +a[edges] .,x rm[1-4,-1] +} } +k[vhull,vertices,edges] mv[vhull] 0 +ver={vertices,h} +edg={edges,{w/3}} +nhull={vhull,is} +if $2==0 +if {vhull,is} repeat {vertices,h} { +if {vhull,@{$>}} (1,$>) a[edges] .,x rm. edg+=1 fi +} fi +({'CImg3d'}) mv. -3 +($ver,$edg) mv. -3 +(255^255^255) r. {$edg-$nhull} +(0,0,255) .x{$nhull-1} a[-1--$nhull] x +(0.6) r. {$edg-$nhull} +(1) .x{$nhull-1} a[-1--$nhull] x +unroll y a[-1--8] y rm.. +else +$ver,$ver +repeat {edges,w/3} { +=. 1,{edges,@{$>*3+1}},{edges,@{$>*3+2}} +} +fi +u $ver,$edg,$nhull +elif i(#0,0)=='e' e[^1] "1d list file mode e "{0,t} +s -,{'\ '} n={{1,t}} rm[0,1] +1,$n,1,1 => vertices +if $!-1<$n s[0] -,{'\ '} fi +repeat $!-1 { l[{$>},vertices] { +=[vertices] {0,t},0,$> +} } +k[vertices] +ver={vertices,h} +u $ver +elif i(#0,0)=='s' e "1d list file mode s "{0,t} +rows[0] 2,100% n={{0,t}} rm[0] +1,$n,1,1 => vertices +1,$n,1,1 => vhull +repeat $!-2 { l[{$>},vertices,vhull] { +s[0] -,{'\ '} +=[vertices] {0,t},0,$> +=[vhull] {1,t},0,$> +} } +k[vertices,vhull] a x +ver={vertices,h} +u $ver +elif i(#0,0)=='b' e "2d list file mode b "{0,t} +rows[0] 2,100% n={{0,t}} rm[0] +2,$n,1,1 => vertices +repeat $!-1 { l[{$>},vertices] { +s[0] -,{'\ '} +=[vertices] {0,t},0,$> =[vertices] {1,t},1,$> +} } +k[vertices] +ver={vertices,h} +u $ver +elif i(#0,0)=='n' e "2d vertice list file mode n "{0,t} +rows[0] 2,100% n={{0,t}} rm[0] +2,$n,1,1 => vertices +1,$n,1,1 => vhull +repeat $!-2 { l[{$>},vertices,vhull] { +s[0] -,{'\ '} +=[vertices] {0,t},0,$> =[vertices] {1,t},1,$> +=[vhull] {2,t},0,$> +} } +k[vertices,vhull] a x +ver={vertices,h} +u $ver +elif i(#0,0)=='B' e "3d list file mode B "{0,t} +rows[0] 2,100% n={{0,t}} rm[0] +3,$n,1,1 => vertices +repeat $!-1 { l[{$>},vertices] { +s[0] -,{'\ '} +=[vertices] {0,t},0,$> =[vertices] {1,t},1,$> =[vertices] {2,t},2,$> +} } +k[vertices] +ver={vertices,h} +u $ver +elif i(#0,0)=='N' e "3d vertice list file mode N "{0,t} +rows[0] 2,100% n={{0,t}} rm[0] +3,$n,1,1 => vertices +1,$n,1,1 => vhull +repeat $!-2 { l[{$>},vertices,vhull] { +s[0] -,{'\ '} +=[vertices] {0,t},0,$> =[vertices] {1,t},1,$> =[vertices] {2,t},2,$> +=[vhull] {3,t},0,$> +} } +k[vertices,vhull] a x +ver={vertices,h} +u $ver +elif i(#0,0)=='c' e "2d spline list file mode c "{0,t} +rows[0] 2,100% n={{0,t}} rm[0] +2,$n,1,1 => controlp +8,{$n-1},1,1 => coeff +repeat $n { l[{$>},controlp] { +s[0] -,{'\ '} +=[controlp] {0,t},0,$> =[controlp] {1,t},1,$> +} } +repeat $n-1 { ii=$> l[{$>+$n},coeff] { ++s[0] -,{'\ '} +repeat 8 { =[coeff] {{-8+$>},t},$>,$ii } +rm[-1--8] +} } +k[controlp,coeff] a y +ver={controlp,h} +u $ver +elif i(#0,0)=='C' e "3d spline list file mode C "{0,t} +rows[0] 2,100% n={{0,t}} rm[0] +3,$n,1,1 => controlp +12,{$n-1},1,1 => coeff +repeat $n { l[{$>},controlp] { +s[0] -,{'\ '} +=[controlp] {0,t},0,$> =[controlp] {1,t},1,$> =[controlp] {2,t},2,$> +} } +repeat $n-1 { ii=$> l[{$>+$n},coeff] { ++s[0] -,{'\ '} +repeat 12 { =[coeff] {{-12+$>},t},$>,$ii } +rm[-1--12] +} } +k[controlp,coeff] a y +ver={controlp,h} +u $ver +else error "File type "{i(#0,0)}"/'"{`i(#0,0)`}"' not implemented! "{0,t} fi +} +#@cli pink_input_pnk: filename +#@cli : Read pgm P2 extended (pink) ascii files via pink exec pgm2list anything else with pink type in 'esbnBNcCdDG' with input_pinklist and the rest with standard gmic input function. ++pink_input_pnk : skip "${1=}" +l[] { tres=${-pink_input_test\ $1} +if $tres"==_'Q'" +fn=${-filename_rand} +if ${-kr_is_exec\ pink.pgm2list}==0 x "pink.pgm2list $1 N "$fn +elif ${-kr_is_exec\ pgm2list}==0 x "pgm2list $1 N "$fn +else "error pink exec pgm2list not found!" fi ++input_pinklist $fn +delete $fn ++s x,4 {iM#-4+1},{iM#-3+1},{iM#-2+1} rm[-2--5] +eval "repeat(h#0,ni,i(#-1,i(#0,0,ni),i(#0,1,ni),i(#0,2,ni))=i(#0,3,ni))" +rm[0] +elif "isin("$tres",['esbnBNcCdDG'])" +input_pinklist $1 +else i $1 fi u $tres +} +#@cli pink_input_test : file_name +#@cli : Test file type of file_name for pnk (pink) and pnm (portable anymap) file type. +#@cli : Routine returns the first character from the first non comment line in status. Only ['PQesSbnBNcCdDG#'] are allowed, +#@cli : 'P'=80 is returned for pgm files with type <> P1/P2/P3/PA/PB/PD/PF (not ascii pgm), \n'Q'=81 is returned for pgm files with type == P1/P2/P3/PA/PB/PD/PF. \n['esbnBNcCdDG'] is returned for PINK list files where the second char is ' '. \n'#'=35 is returned otherwise. +pink_input_test : +l[] { +i raw:"$1",uint8 s -,{'\n'} i=0 +do z1={$i,@0} z2={$i,@1} i={$i+1} while $z1==35&&$i<$! +rm +if $z1"==_'P'" if "isin("$z2",['123ABDF'])" z1={_'Q'} fi +elif "isin("$z1",['esbnBNcCdDG']) && "$z2"==_' '" +else z1={_'#'} fi +u $z1 +} +#@cli cimg2tiff : filenamein, _pathout(=pathin), _type(=integer) +#@cli : File Converter gmic cimg* to tiff e.g. for ImageJ with <_pathout>.tif. Type can be _type='integer'(size dep. uint8(<256)|uint16(<65536)|uint32(4294967296)|float32) or any other numrical gmic types. Usage is thought for multipage tiff files of 2/3/4d multi-channel data. In case of tiff float files, value ranges other than [0,1] deliver often problems. Best to use (not only in ImageJ) bio-formats package (https://www.openmicroscopy.org/bio-formats/) +#@cli : Default values: 'pathout={f}' (file path from input file), 'type=integer' +#@cli : Ex.: gmic cimg2tiff Step\ 3/_wt_Time_0.cimgz +#@cli : Ex.: gmic cimg2tiff \"Step 3/_wt_Time_0.cimgz\",\"./\" +cimg2tiff : +i "${1=}" +skip "${2={f}},${3=integer}" +if ['$3']=='integer' +if iM<256 ty=uint8 +elif iM<65536 ty=uint16 +elif iM<4294967296 ty=uint32 +else ty=float32 fi +else ty=$3 fi v + +o ${2}{b}".tif",$ty +rm +#@cli :: User Karo's CLI Utilities +#@cli karos_about +#@cli : Logo for gui and errors +#@cli : $ karos_about +karos_about : +if $_version<270 osteo gui_print_preview "G'MIC version "$_version,32,"KaRo's tests",22 +else +if $!==0 osteo fi r. 600,600,1,3 +[0] *. 0 +text. "g'mic",0.5~,0.15~,36,1,255,255,0 +text. "\n\nversion "$_version,0.5~,0.2~,18,1,255,255,0 +text. "KaRo's",0.5~,0.4~,57,1,255,0,255 +text. "Tests",0.5~,0.55~,57,1,200,0,200 ++to_gray. skeleton. , n[-1--2] 0,255 dilate.. 2 -[-1--2] + n 0,255 +text. "http://karo03.bplaced.net/gmic/html/",0.5~,0.7~,37,1,200,0,200 +fi +#@cli karos_error : "message" +#@cli : Message in karos_about image for gui +#@cli : $ karos_error Test +karos_error : +karos_about +text. "${1=Error}",0.5~,0.8~,36,1,200,0,200 +#@cli kr_is_exec : executable_name +#@cli : Look for 'executable_name' with 'type' (unix/MacOS) or 'where' (windows) +#@cli : Return unix/Macos/Windows status==0 found! +kr_is_exec : +if ${-is_windows} if !($^<=1) x "where $1" else x "where $1 >nul 2>&1" fi +else if !($^<=1) x "type $1" else x "type $1 >/dev/null 2>&1" fi fi +#@cli kr_draw_vars : _type(0) +#@cli : If _type==0 Draw with text several variable and function values Else Draw PATH variable into an image +#@cli : Default value; 'type=0' +#@cli : $ 0 kr_draw_vars +kr_draw_vars : skip ${1=0} +if !$1 text " $_host os: "$_host" "$_os"\n"" $_pid: "$_pid"\n"" $_cpus: "$_cpus"\n"" $_path_rc: "{/$_path_rc}"\n"" $_path_user: "{/$_path_user}"\n"" is_macos: "${-is_macos}"\n"" is_windows: "${-is_windows}"\n"" path_cache: "{/${-path_cache}}"\n"" path_tmp: "{/${-path_tmp}}"\n"" path_gimp: "{/${-path_gimp}},0.2~,0.1~,14,1,255 +else text " PATH:\n"${-_kr_path},0.2~,0.1~,14,1,255 +fi +#@cli kr_help : _command, _gmic_file(=$_path_rc/update$_version.gmic) +#@cli : Display help (parse_cli ascii,command) optionally from _gmic_file (e. g. external files). +#@cli : Default _command="" _gmic_file=$_path_rc/update$_version.gmic +kr_help : skip "${1=''},${2=$_path_rc/update$_version.gmic}" +if isfile(['$2']) +l[] { cimgz:$2 k[0] +onfail l[] { raw:$2,uint8 k[0] onfail } +} +if $! k. fi +fi +if !$! return fi +y a y +parse_cli ascii,$1 +rm v 0 q +#@cli _xframe : +#@cli : Set 1 bit border to 0 (e.g. for pink skeleton) +_xframe : +f "i=y==0?0:x==0?0:y==h-1?0:x==w-1?0:i" +#@cli karo_frame : _width, _border +#@cli : Delete a border of width or delete the inner part +#@cli : _width : thickness of border +#@cli : _border ==false : border is set 0, inner region copied +#@cli : _border ==true : border is copied, inner region is set 0 +#@cli : Default values: 'width=1', 'border=0' +#@cli : $ osteo +negate karo_frame 5,0 +karo_frame : +skip "${1=1},${2=0}" +if $2 e[^2] "Copy border/Delete inner: width $1." +else e[^2] "Delete border/Copy inner: width $1." fi +foreach { ni=$> s={s} s c +repeat $s { nis=$> l[$nis] { +if $2 f 'begin(bb=$1);i=y=h-bb?i:x>=w-bb?i:0' +else f 'begin(bb=$1);i=y=h-bb?0:x>=w-bb?0:i' fi +} } +a c } +_kr_path : ('{/{/$PATH}}') +if ${-is_windows} ss=";" else ss=":" fi +fill "i=="{'$ss'}"?"{'\n'}":i" +u {t} rm. +#@cli karo_li2st : p1,p2,...,pn +#@cli : Convert comma separated list to space separated string. +karo_li2st : +u "" if $#>=1 ({"'${1--1}'"}) replace. {','},{"' '"} u {t} rm. fi +#@cli _kr_ac_list : number (actually 38 in gmic_stdlib, fully 64) +#@cli : return alpha channel mode string from number in status. +#@cli : Ex. repeat 64 { _kr_ac_list \$\> +e \$\>,\${} } +#@cli : Ex. sp 0 repeat 38 { +ac[0] \"karo_morpho 2,1,10\",$>,2 _ac_list $> text. ${},0,0,56,1,255 } append_tiles 5 r 25%,25%,1,100% +_kr_ac_list : +if isnum($1) +arg 1+round($1),all,rgba,rgb,rgb_r,rgb_g,rgb_b,rgba_a,lrgb,lrgb_r,lrgb_g,lrgb_b,ycbcr_y,ycbcr_cbcr,ycbcr_cb,ycbcr_cr,ycbcr_cg,lab_l,lab_ab,lab_a,lab_b,lch_ch,lch_c,lch_h,hsv_h,hsv_s,hsv_v,hsi_i,hsl_l,cmyk_c,cmyk_m,cmyk_y,cmyk_k,yiq_y,yiq_iq,ryb,ryb_r,ryb_y,ryb_b,rgba_r,rgba_g,rgba_b,srgb,srgb_r,srgb_g,srgb_b,ycbcr,ycbcr_y,lab,lch,lch_l,hsv,hsi,hsi_h,hsi_s,hsl,hsl_h,hsl_s,cmy,cmy_c,cmy_m,cmy_y,cmyk,yiq,yiq_i,yiq_q +else u "$1" fi +#@cli karo_xcimg : programname, parameterlist : +#@cli : Call external CImg Example 'programname' +#@cli : which has to be found in PATH by external call by +#@cli : 'programname' image_in 'parameterlist' image_out +#@cli : with writing image_in and reading after execution image_out +#@cli : $ sp lena karo_xcimg pde_TschumperleDeriche2d,-iter\ 50\ -visu\ 0\ -ns +- +karo_xcimg : +filename=${-filename_rand} +if ${-kr_is_exec\ $1}!=0 +error "executable $1 not found in PATH, status = "${}"!! Returning!!\n" +{w},{h} karos_error "exec Error !!" return +fi +o ${filename}.cimg +x "$1 -i "${filename}".cimg $2 -o "${filename}".cimg" +if ${} v + e "Status is "${}"." v - {w},{h} karos_error "exec Error !!" +else i ${filename}.cimg fi +delete ${filename}.cimg +#@cli karo_skeleton : _p1,..,p2n : (-median,0,-inv,0|1,-t,-0.3,-curve,0|1,-corr,0|1,-dlt,1) +#@cli : Execute use_skeleton (CImg demo) external. +#@cli : For help execute in terminal shell "use_skeleton -help" +#@cli : ~~~ +#@cli : use_skeleton: Compute the skeleton of a shape, using Hamilton-Jacobi equations (Aug 11 2021, 20:46:01) +#@cli : +#@cli : Input/Output options +#@cli : -------------------- +#@cli : -i img/milla.bmp Input (black&white) image +#@cli : -median 0 Apply median filter +#@cli : -inv false Invert image values +#@cli : -o 0 Output skeleton image +#@cli : -visu true Display results +#@cli : Skeleton computation parameters +#@cli : ------------------------------- +#@cli : -t -0.3 Threshold +#@cli : -curve false Create medial curve +#@cli : Torsello correction parameters +#@cli : ------------------------------ +#@cli : -corr false Torsello correction +#@cli : -dlt 1 Discrete step +#@cli : ~~~ +#@cli : $ sp car otsu 256 +karo_skeleton "-median,5,-inv,1" +karo_skeleton : if $#>0 karo_li2st ${1--1} p=${} else p="" fi +e[^1] "Compute \"use_skeleton\" exec with options \'"$p"\' on"$? +foreach { +s={s} if $s>1 s. c fi +foreach { karo_xcimg use_skeleton,${p}" -visu 0" mv. 0 k[0] } +if $s>1 a[-$s--1] c fi +} +#@cli karo_nlmeans : _p1,..,pn=-zoom,1,-ng,0|1,-nu,0|1,-ns,0|1,-p,1,-lambda,-1,-sigma,-1,-alpha,3,-sampling,1 +#@cli : Execute use_nlmeans (CImg demo) external. (see also q-nlmeans p=4,lambda=4,sigma=10) +#@cli : For help execute in terminal shell "use_nlmeans -help" +#@cli :~~~ +#@cli : use_nlmeans: Non-local means denoising algorithm. +#@cli : [1] Buades, A. Coll, B. and Morel, J.: A review of image denoising algorithms, with a new one. Multiscale Modeling and Simulation: A SIAM Interdisciplinary Journal 4 (2004) 490-530 +#@cli : [2] Gasser, T. Sroka,L. Jennen Steinmetz,C. Residual variance and residual pattern nonlinear regression. Biometrika 73 (1986) 625-659 +#@cli : Build : (Aug 11 2021, 20:45:21) +#@cli : +#@cli : -i img/milla.bmp Input image +#@cli : -o 0 Output file +#@cli : -zoom 1 Image magnification +#@cli : -ng 0 Add gauss noise before aplying the algorithm +#@cli : -nu 0 Add uniform noise before applying the algorithm +#@cli : -ns 0 Add salt&pepper noise before applying the algorithm +#@cli : -visu 1 Visualization step (0=no visualization) +#@cli : -p 1 Half size of the patch (2p+1)x(2p+1) +#@cli : -lambda -1 Bandwidth as defined in [1] (-1 : automatic bandwidth) +#@cli : -sigma -1 Noise standard deviation (-1 : robust estimation) +#@cli : -alpha 3 Neighborhood size (3) +#@cli : -sampling 1 Sampling of the patch (1: slow, 2: fast) +#@cli :~~~ +#@cli : $ osteo +karo_nlmeans -p,2 +- +karo_nlmeans : if $#>0 karo_li2st ${1--1} p=${} else p="" fi +e[^1] "Compute \"use_nlmeans\" exec with options "${p}" on"$? +foreach { +s={s} if $s>1 s. c fi +foreach { karo_xcimg use_nlmeans,${p}" -visu 0" mv. 0 k[0] } +if $s>1 a[-$s--1] c fi +} +#@cli :: User KaRo's CLI functions +#@cli karo_rndbit0 : +#@cli : Randomize in [0..255] (byte) image$? bit level 0. wow randomize numbers to even and odd" +#@cli : $ osteo +karo_rndbit0 +- +karo_rndbit0 : +e[^-1] "Randomize in [0..255] (byte) image$? bit level 0." +foreach { and 254 f "i+(u>0.5)" } +#@cli kr_circular_mean : +#@cli : Calculation of the mean (and SD) for angles (radian), especially for mean and sd of hue angles. Returned in status and a global variabale _kr_circular_mean +kr_circular_mean : ++sin. +cos.. +_kr_circular_mean={[atan2(ia#-2,ia#-1),sqrt(-2*log(sqrt(ia#-2^2+ia#-1^2)))]} +rm[-1,-2] +u $_kr_circular_mean +#@cli pseudo_c : +#@cli : Pseudo coloring of greyscale images +#@cli : $ follic_ k. label 0 +pseudo_c +pseudo_c : +if s!=1 to_gray. fi {iM},1,1,3,u(255) round. map.. . rm. +#@cli karo_luminance : _type = [itur1990 | itur1990-2 | gmic | gmic-2] +#@cli : Compute luminance of selected RGB images according +#@cli : itur1990 | itur1990-2 sqr/sqrt | gmic luminance | sqr/sqrt gmic luminance. +#@cli : sRGB to RGB and back only with gmic and gmic-2! +#@cli : Default value: 'type=itur1990' +#@cli : $ sp tiger +karo_luminance , +karo_luminance : skip ${1=itur1990} +e[^-1] "Compute luminance $1 of image$?." +remove_opacity +foreach { +if s==3 +if ['$1']=='gmic' luminance +elif ['$1']=='gmic-2' srgb2rgb sh 0 sh[0] 1 sh[0] 2 +sqr *[1] 0.22248840 *[2] 0.71690369 *[3] 0.06060791 +[1-3] sqrt rm[1] rgb2srgb +elif ['$1']=='itur1990-2' sh 0 sh[0] 1 sh[0] 2 +sqr *[1] 0.212655 *[2] 0.715158 *[3] 0.072187 +[1-3] sqrt rm[1] +else sh 0 sh[0] 1 sh[0] 2 *[1] 0.212655 *[2] 0.715158 *[3] 0.072187 +[1-3] rm[1] fi +elif s!=1 norm n 0,255 +fi } +channels 0 +#@cli karo_close : _size>0, _shape={0|1|2} (square|octagon|circle),_invert={0|1}, scale={0|1|2}, Value action none | cut | normalize, channel=>0 see color_channels in apply_channels +#@cli : Morphological closing (dilate and erode) of given size (only 2d) +#@cli : with fx_morpho_v2 and implicitly apply_channels! +#@cli : Default values: 'size=5', 'shape=invert=scale=channel=0' +#@cli : $ sp tiger,400 +karo_close 21 +karo_close[0] 21,1 +karo_close[0] 21,2 rm[0] +karo_close : +e[^1] "Compute closing image"$?", with size "$1" (only 2d)." +skip "${1=5},${2=0},${3=0},${4=0},${5=0}" check $2<3 +if $4 negate fi +ac "karo_morpho 3,$2,$1",$5,$4 +if $4 negate fi +#@cli karo_open : _size>0,_shape=0|1|2 (square|octagon|circle), _invert=0|1, +#@cli : '_scale=0|1|2','_channel' see value action, color_channels in 'apply_channels' +#@cli : Morphological opening (erode and dilate) of given size (only 2d) +#@cli : with fx_morpho_v2 and implicitly apply_channels! +#@cli : Default values: 'size=5', 'shape=invert=scale=channel=0' +#@cli : $ sp tiger,400 +karo_open 15 +karo_open[0] 15,1 +karo_open[0] 15,2 rm[0] +karo_open : +e[^1] "Compute opening image"$?", with size "$1" (only 2d)." +skip "${1=5},${2=0},${3=0},${4=0},${5=0}" check $2<3 +if $4 negate fi +ac "karo_morpho 2,$2,$1",$5,$4 +if $4 negate fi +#@cli karo_doc : _size>0,_shape=0|1|2 (square|octagonal|circular), +#@cli : _channel see color_channels in 'apply_channels' +#@cli : compute difference of open+close and original (only 2d) +#@cli : Default values: 'size=5', 'shape=1', 'channel=0' +#@cli : $ sp tiger +karo_doc 15,2,5 replace. 0,{im} +karo_doc : +e[^1] "Compute difference of open/close and original image"$?", with window size "$1" (only 2d)." +skip "${1=5},${2=1},${3=0}" +foreach { ++karo_open[0] $1,$2,0,0,$3 +karo_close[0] $1,$2,0,0,$3 ++[-2,-1] /. 2 - +} +#@cli karo_doo : _size1>0,_size2>0,_type=0..3 (ero/dil/open/close),_shape=0|1|2 (sqaure|octagon|circle),_scale=0|1,_scale,_channel see value action, color_channels in apply_channels +#@cli : Compute difference of math. morph operation type on selected images (only 2d). +#@cli : Default values: 'size1=5', 'size2=7', 'type=2', 'shape=1', 'scale=channel=0' +#@cli : $ sp tiger +karo_doo 10,15,2,2,0,0 +karo_doo : skip "${1=5},${2=7},${3=2},${4=1},${5=0},${6=0}" +e[^-1] "Compute difference of math. morph. operator \'"${arg\ {$3+1},Erosion,Dilation,Opening,Closing}"\' on image"$?", with sizes "$1" and "$2" (only 2d)." +foreach { ++ac. "karo_morpho $3,$4,$1",$6,0 +ac.. "karo_morpho $3,$4,$2",$6,0 +if (${3}&1)==0 rv[-2,-1] fi +-[-2,-1] +if $5 n. 0,255 fi +} +#@cli karo_label_sort : +#@cli : Rearrange a label image (the selected image) according to region size +#@cli : $ 400,400 srand 12345 rand 0,1 b 3 ge 50% label_fg 0,1 +karo_label_sort dh 400,200,{iM-1},1,{iM} +#@cli : Author : KaRo and David Tsch.. Latest update : 2013/04/07. +karo_label_sort : +e[^-1] "Sort labelled image"$?" by region size." +foreach { if im=0,is_high_connectivity={ 0 | 1 }, _sort={ 0 | 1} +#@cli : Label connected components in selected images and possibly sort by region size. +#@cli : Default values: 'is_high_connectivity=sort=0' +#@cli : $ follic_ k. +karo_label 0,,1 +dh. {w},{h},{iM},1 +#@cli : Author : KaRo and David Tsch.. Latest update : 2013/04/07. +karo_label : check "$1>=0" skip "${2=0},${3=0}" +e[^-1] "Label connected components on image"$?", with tolerance "$1", "${arg\ 1+!$2,high,low}" connectivity and "${arg\ 1+!$3,sorted,unsorted}" by size" +foreach { +label. $1,$2 +if $3 +nb={1+iM} +histogram. $nb,0,{iM} +100%,1,1,1,x a[-2,-1] y sort. -,x rows. 1 +100%,1,1,1,x a[-2,-1] y sort. +,x rows. 1 +map.. . rm. +fi +} +#@cli karo_bin_fill : +#@cli : Fill holes in binary pattern. A 1-bit border is deleted to ensure background detection. +#@cli : $ follic otsu 256 +karo_bin_fill. +karo_bin_fill : foreach { if iM>0 +neq 0 f "x==0||x==(w-1)||y==0||y==(h-1)?0:i" ++eq 0 label_fg. 0 +f. "x==0||x==(w-1)||y==0||y==(h-1)?i:0" histogram. {iM#-2},1,{iM#-2} +repeat w { if i($>)!=0 +neq.. {$>+1} *... . rm. fi } rm. neq. 0 or fi +} +#@cli karo_bin_rand_del : _thickness(=1) _typ={0=all | 1=top/right | 2=bottom/left} +#@cli : Delete border (defined by _thickness) touching 4-connected objects/regions in binary pattern either around, at top/right or at bottom/left borders. The latter two serve for unbiased sampling/counting of object sets in limited test areas, the "forbidden line algorithm". +#@cli : $ follic threshold 18.6% negate[-1] +karo_bin_rand_del[-1] , +karo_bin_rand_del[-2] ,1 +karo_bin_rand_del[-3] ,2 a[-1--3] c +karo_bin_rand_del : skip "${1=1},${2=0}" check "$1>0 && $2>=0 && $2<3" +foreach { if iM>0 +neq 0 +label_fg. 0 +if $2==1 +f. "x>=(w-$1)||y<$1?i:0" +elif $2==2 +f. "x<$1||y>=(h-$1)?i:0" +else +f. "x<$1||x>=(w-$1)||y<$1||y>=(h-$1)?i:0" fi +histogram. {iM#-2},1,{iM#-2} +repeat w { +if i($>)!=0 +neq.. {$>+1} *... . rm. fi +} +rm. neq. 0 and +fi } +#@cli karo_bin_max : +#@cli : Select maximum 4-connected region in binary +#@cli : $ follic_ k. +karo_bin_max a c +karo_bin_max : foreach { if iM>0 +label_fg 0 +karo_label_sort +eq 1 +fi } +#@cli karo_segmentarea : low +#@cli : Get all 4-connected non-zero (foreground) regions of area>=low +#@cli : Delete small regions +#@cli : Number of remaining objects in status +#@cli : $ 400,400 srand 12345 rand 0,1 b 3 ge 50% +karo_segmentarea 50 a c +karo_segmentarea : +check "$1>0" +foreach { +neq. 0 label_fg. 0,0 +histogram. {iM+1} =. 0,0 ge. $1 +map.. . u {is} rm. +} +#@cli karo_threshold : _method={ triangle | yen | otsu | _otsu | bgt | intermeans | intera | rats | fixnnn | huang | huang2 | li | moments | minerrori | maxentropy | mean | renyientropy | shanbhag | bgt2 },_delclass>0,_smooth>0 +#@cli : Calculate threshold (methods derived from ImageJ) in range [0,255] using histogram evaluation, evtl. normalization necessary. Methods 'otsu','_otsu' and 'rats' base on image evaluation in contrast to the other methods. For help do 'gmic help otsu' or '... _karo__otsu' or '... rats'. Method 'fixnnn' allows to apply a fixed threshold 'nnn' calling '_karo_fix nnn'. Method 'intera' calls the internal function 'x_threshold' in interactive mode +#@cli : For each method the user function _karo_'method' is called! +#@cli : If {_delclass > 0} delete cluster {_delclass-1}. +#@cli : If {_smooth > 0} blur_x histogram with amplitude _smooth. +#@cli : No histogram processing for otsu, rats and intera! +#@cli : No test for existence of method! +#@cli : Default values: 'method=triangle', 'delclass=smooth=0' +#@cli : $ sp tiger luminance. +karo_threshold. otsu karo_threshold.. triangle +karo_threshold : skip ${1="triangle"} skip "${2=0},${3=0}" +e[^-1] "Calculate \'"$1"\' thresholded mask from images"$?" with histogram in range [0,255] and binsize 1." +if ${strcontains\ $1,fix} meth=fix +else meth=$1 fi +if ['$meth']=='otsu' otsu 256 +elif ['$meth']=='rats' karo_rats , +elif ['$meth']=='intera' st={[im,iM]} x_threshold u {st=[$st];round(${}*(st[1]-st[0])+st[0])} +else foreach { +if ['$meth']=='fix' _karo_fix ,,$1 +else +histogram. 256,0,255 +if $2>0 =. 0,{$2-1} fi +if $3!=0 tot={is} /. $tot blur_x. $3 /. {is} *. $tot round. fi ++_karo_$meth. 0,1 rm. +fi +th=${} +threshold[0] $th +if $>==0 sres=$th else sres=$sres,$th fi +} u $sres fi +#@cli karo_threshold_demo : +#@cli : Display 4x4 different threshold methods applied to selected image +#@cli : $ follic karo_threshold_demo , negate. +#@cli : $ sp to_gray karo_threshold_demo +karo_threshold_demo : skip ${1=0} +if !$! error "No image selected!" fi +e[^1] "Display several threshold methods" +repeat 16 { i=$> +arg {$i+1},bgt,huang,huang2,intermeans,li,maxentropy,mean,minerrori,bgt2,moments,otsu,rats,renyientropy,shanbhag,triangle,yen +meth=${} ++karo_threshold[0] $meth,,$1 thresh=${} +text_outline. \ $meth:\ {round($thresh)},0,0,9%,3,1,1,1,1 +e[^1] {$i+1},$meth,$thresh +} append_tiles[1-16] 4 +#@cli karo_rats : _pow(0.5) +#@cli : 'R'obust 'a'utomatic 't'hreshold 's'election (Kittler et al. 1985) +#@cli : Input image (not histogram similar otsu!) +#@cli : Default value: 'pow=0.5' +#@cli : $ osteo +karo_rats +karo_rats : +check ${1=0.5}>0 +e[^-1] "Calculate rats threshold from image$? with power "$1"." +foreach { ++gradient_norm. pow. $1 gr={is} *. .. gri={is} res={$gri/$gr} rm. +threshold. $res +if $>==0 sres=$res else sres=$sres\,$res fi +} +u $sres +#@cli _karo_triangle : _minval,_bins +#@cli : Calculate triangle threshold (from ImageJ auto thresholder) +#@cli : tested only with 256 classes from 0 to 255 +#@cli : $ sp tiger luminance +histogram 256,0,255 _karo_triangle. , +threshold[0] ${} +_karo_triangle : skip "${1=0},${2=1}" +e[^-1] "Calculate triangle threshold from 1d histogram"$?" in range ["$1","{$1+(w-1)*$2}"]." +foreach { +ac=${-autocrop_coords.} wd={w} +min={${arg\ 1,$ac}} if $min==1" && "{@0}!=0 min=0 fi +if $min>0 min={$min-1} fi +min2={${arg\ 4,$ac}} if $min2<$wd-1 min2={$min2+1} fi +dmax={iM} max={xM} +if $max-$min<$min2-$max +inverted=1 mirror[0] x min={$wd-1-$min2} max={$wd-1-$max} +else inverted=0 fi +if $min==$max split=$min else +nx={i($max)} ny={$min-$max} +d={sqrt($nx*$nx+$ny*$ny)} +nx={$nx/$d} ny={$ny/$d} +d={$nx*$min+$ny*i($min)} ++f. x *. $nx *.. $ny +[-1,-2] -. $d +crop. {$min+1},$max +if $inverted split={$wd-(xM+$min)} else split={xM+$min+1} fi +fi +res={$1+$split*$2} +if $>==0 sres=$res else sres=$sres\,$res fi +rm[0] +} u $sres +#@cli _karo_yen : _minval,_bins +#@cli : Calculate yen threshold (from ImageJ auto thresholder) +_karo_yen : skip "${1=0},${2=1}" +foreach { +if $> r_yen=${} fi +autocrop_coords. 0 range=${} mn=${arg\ 1,$range} mx=${arg\ 4,$range} +/. {is} ++cumulate. ++sqr.. cumulate. ++mirror... x sqr. cumulate. mirror[-1,-4] x +*[-1,-2] log. replace_inf. {iM} *. -1 ++*.. -1.0 +. 1.0 *[-1,-3] log.. replace_inf.. {iM} *.. 2.0 ++[-1,-2] k. +if $mn>0 repeat $mn { =. 0,$> } fi +if $mx<(w-1) repeat w-$mx { =. 0,{$mx+$>} } fi +res={xM*$2+$1} +rm. +if $> u $r_yen,$res else u $res fi +} +#@cli _karo__otsu : _minval(0) _bins(1) +#@cli : Calculate otsu threshold from a histogram +#@cli : with class o = _minval and bin size = _bins +#@cli : Threshold is stored in status +#@cli : $ sp tiger to_gray +histogram 256,0,255 _karo__otsu , threshold ${} +_karo__otsu : skip "${1=0},${2=1}" +l. { +/. {is} ++cumulate. x +++. -1. negate. ++f. "x" +*[0] . rm.. cumulate. x +++. {-iM} negate. +/.. [-4] +/. ... +-[-2,-1] sqr. +*[-1--3] replace_nan. 0.0 +u {xM*$2+$1} +rm +} +#@cli _karo_bgt : _minval,_bins +#@cli : Autothreshold using SD from whole image starting from the mode of the histogram (image range 0,255) +_karo_bgt : skip "${1=0},${2=1}" fact=1.5 +l. { +hft=${-hist_feature\ -2} mn=${arg\ 5,$hft} mx=${arg\ 6,$hft} sd=${arg\ 4,$hft} md=${arg\ 1,$hft} +if $mx-$md<=$md-$mn res={$md-$fact*$sd} +else res={$md+$fact*$sd} fi +u {$res*$2+$1} rm +} +#@cli _karo_bgt2 : _minval,_bins +#@cli : Threshold using SD from mode left or right distribution mirrored of the histogram (image range 0,255) +#@cli : Estimate from mirrored estimated background peak, derived from mode to left or to right +_karo_bgt2 : skip "${1=0},${2=1},${3=2.5}" fact=$3 +l. { +hft=${-hist_feature\ -2} +mn=${arg\ 5,$hft} mx=${arg\ 6,$hft} mean=${arg\ 3,$hft} sd=${arg\ 4,$hft} md=${arg\ 1,$hft} +if $md>$mean +. eval. "md=$md;for(ih=0,ih1" || "d>1" || "s>1 u "?" else +split={" +min=0; while(i(min)==0,min++); +max=w; while(i(max)==0,max--); +if(min>=max,res=w/2, +mvI=min; +do(sum1=sum2=sum3=sum4=0.0; +for(id=min,id<=mvI,id++,sum1+=id*i(id);sum2+=i(id)); +for(id=mvI+1,id<=max,id++,sum3+=id*i(id);sum4+=i(id)); +res=(sum1/sum2+sum3/sum4)/2.0;mvI++, +(mvI+1)<=res && mvI<(max-1))); +round(res)"} rm +u {$1+$split*$2} fi +} +_karo_huang : skip "${1=0},${2=1}" +huang={" +threshold=-1; +first_bin=0; +for(ih=0,ih=first_bin,if(i(ih)!=0,last_bin=ih;break());ih--); +term = 1.0 / ( last_bin - first_bin ); +mu_0=["{^}"]; +sum_pix = num_pix = 0; +for ( ih = first_bin, ih < w, sum_pix += ih * i(ih); num_pix += i(ih); +mu_0[ih] = sum_pix / num_pix; ih++ ); +mu_1 = mu_0; +sum_pix = num_pix = 0; +for (ih = last_bin, ih > 0, sum_pix+=ih*i(ih); +num_pix += i(ih); +mu_1[ih-1] = sum_pix / num_pix; ih-- ); +min_ent = 1e31; +for (it = 0, it < w, +ent = 0.0; +for (ih = 0,ih<=it, +mu_x = 1.0 / ( 1.0 + term * abs(ih - mu_0[it])); +if (!((mu_x < 1e-06) || (mu_x > 0.999999)), +ent += i(ih) * ( -mu_x * log ( mu_x ) - ( 1.0 - mu_x ) * log ( 1.0 - mu_x ))); +ih++); +for (ih = it + 1, ih < w, +mu_x = 1.0 / ( 1.0 + term * abs (ih - mu_1[it])); +if (!((mu_x < 1e-06) || (mu_x > 0.999999)), +ent += i(ih) * ( -mu_x * log ( mu_x ) - ( 1.0 - mu_x ) * log ( 1.0 - mu_x ))); +ih++); +if (ent < min_ent, min_ent = ent; threshold = it; _(print(min_ent,threshold))); +it++ ); +threshold"} +u {$huang*$2+$1} rm +_karo_huang2 : skip "${1=0},${2=1}" +huang2={" +for(first=0,firstfirst && i(last)==0,last--); +if(first==last,break()); +S=["{^}"]; W=S; +S[0]=i(0); +for(ii=max(1,first),ii<=last,S[ii]=S[ii-1]+i(ii);W[ii]=W[ii-1]+ii*i(ii);ii++); +C=last-first; +Smu=S; +for(ii=1,ii<(C+1),mu=1/(1+ii/C);Smu[ii]=-mu*log(mu)-(1-mu)*log(1-mu);ii++); +bestThreshold = 0; +bestEntropy = 1e31; +for(threshold=first,threshold<=last, +entropy=0; mu=round(W[threshold]/S[threshold]); +for(ii=first,ii<=threshold,entropy+=Smu[abs(ii-mu)]*i(ii);ii++); +mu=round((W[last] - W[threshold]) / (S[last] - S[threshold])); +for(ii=threshold+1,ii<=last,entropy+=Smu[abs(ii-mu)]*i(ii);ii++); +if(bestEntropy>entropy,bestEntropy=entropy;bestThreshold=threshold); +threshold++); +bestThreshold"} +u {$huang2*$2+$1} rm +_karo_li : skip "${1=0},${2=1}" +li={" +tolerance=0.5; +num_pixels=0; +mean = 0.0; +for (ih = 0, ih < w, ih++, num_pixels += i(ih);mean += ih * i(ih)); +mean /= num_pixels; +new_thresh = mean; +do( +old_thresh = new_thresh; +threshold = int(old_thresh+0.5); +sum_back = 0; +num_back = 0; +for ( ih = 0, ih<=threshold, ih++, +sum_back += ih * i(ih); +num_back += i(ih)); +if(num_back == 0,mean_back=0.0,mean_back=(sum_back/num_back)); +sum_obj = 0; +num_obj = 0; +for ( ih = threshold + 1, ih < w, ih++, +sum_obj += ih * i(ih); +num_obj += i(ih)); +if(num_obj == 0,mean_obj=0.0,mean_obj=(sum_obj/num_obj)); +temp = ( mean_back - mean_obj ) / ( log ( mean_back ) - log ( mean_obj ) ); +if (temp < -2.220446049250313e-16, new_thresh=int(temp - 0.5),new_thresh=int(temp + 0.5)), +abs(new_thresh-old_thresh)>tolerance); +threshold"} +u {$li*$2+$1} rm +_karo_moments : skip "${1=0},${2=1}" +/ {is} moments={" +m0=1.0; m1=0.0; m2 =0.0; m3 =0.0; sum =0.0; p0=0.0; +threshold = -1; +for(ih=0, ihp0, threshold = ih; break()) ); +threshold"} +u {$moments*$2+$1} rm +_karo_mean : skip "${1=0},${2=1}" +m0={is} +cumulate +f.. "x*i(x)" cumulate. m1={iM} +u {int($m1/$m0)*$2+$1} rm +_karo_minerrori : skip "${1=0},${2=1}" +m0={is} +cumulate +f.. "x*i(x)" cumulate. m1={iM} +f... "x*x*i(x)" cumulate. a y +minerrori={" +threshold=int($m1/$m0); +Tprev=-2; +ll=0; +while(threshold!=Tprev&&ll++<1000, +mu=i(threshold,2)/i(threshold,1); +nu=(i(w-1,2)-i(threshold,2))/(i(w-1,1)-i(threshold,1)); +p=i(threshold,1)/i(w-1,1); +q=(i(w-1,1)-i(threshold,1))/i(w-1,1); +sigma2=i(threshold,3)/i(threshold,1)-(mu*mu); +tau2=(i(w-1,3)-i(threshold,3))/(i(w-1,1)-i(threshold,1))-(nu*nu); +w0 = 1.0/sigma2-1.0/tau2; +w1 = mu/sigma2-nu/tau2; +w2 = (mu*mu)/sigma2 - (nu*nu)/tau2 + log10((sigma2*(q*q))/(tau2*(p*p))); +sqterm = (w1*w1)-w0*w2; +if(sqterm<0,echo('MinError(I):not converging.');break()); +Tprev = threshold; +temp = (w1+sqrt(sqterm))/w0; +if(isnan(temp),echo('MinError(I):NaN,not converging.');threshold=Tprev,threshold=floor(temp)); +); +threshold"} +u {$minerrori*$2+$1} rm +_karo_maxentropy : skip "${1=0},${2=1}" ++/. {is} +cumulate. +*. -1 +. 1.0 a y +maxentropy={" +first_bin=0; for(ih=0,ih=first_bin,ih--,if(!(abs(i(ih,3))<2.220446049250313e-16),last_bin=ih;break())); +max_ent=-1.E16; +for(it=first_bin,it<=last_bin,it++, +ent_back=0.0; for(ih=0,ih<=it,ih++,if(i(ih,0)!=0,ent_back-=(i(ih,1)/i(it,2)) * log(i(ih,1)/i(it,2)))); +ent_obj=0.0; for(ih=it+1,ih=first_bin,ih--,if(!(abs(i(ih,3))<2.220446049250313e-16),last_bin=ih;break())); +threshold=0; +max_ent = 0.0; +for(it=first_bin,it<=last_bin,it++, +ent_back = 0.0; +for(ih=0,ih<=it,ih++,if(i(ih,0)!=0,ent_back-=(i(ih,1)/i(it,2)) * log(i(ih,1)/i(it,2)))); +ent_obj = 0.0; +for(ih=it+1,ih 0.0 ? log ( ent_back * ent_obj ) : 0.0); +if(tot_ent>max_ent,max_ent=tot_ent;threshold=it); +); +t_star1 = threshold; +threshold = 0; +max_ent = 0.0; +alpha = 2.0; +term = 1.0 / ( 1.0 - alpha ); +for(it=first_bin,it<=last_bin,it++, +ent_back = 0.0; +for(ih=0,ih<=it,ih++,ent_back+=(i(ih,1)*i(ih,1))/(i(it,2)*i(it,2))); +ent_obj = 0.0; +for(ih=it+1,ih 0.0 ? log(ent_back * ent_obj ): 0.0 ); +if(tot_ent>max_ent,max_ent=tot_ent;threshold=it); +); +t_star3 = threshold; +if(t_star2=first_bin,ih--,if(!(abs(i(ih,3))<2.220446049250313e-16),last_bin=ih;break())); +threshold =-1; +min_ent = 4503599627370496.0; +for(it=first_bin,it<=last_bin,it++, +ent_back = 0.0; +term = 0.5 / i(it,2); +for(ih=1,ih<=it,ih++,ent_back-=i(ih,1)*log(1.0-term*i(ih-1,2))); +ent_back *= term; +ent_obj = 0.0; +term = 0.5 / i(it,3); +for(ih=it+1,ih0[%],_value0[%],_value1[%] +#@cli : Computes the histogram and returns in status the value of first class +#@cli : and the bin size per image. +#@cli : Default values: 'nb_levels=256', '_value0=0%', '_value1=100%' +#@cli : $ sp barbara /. 2 +. 32 _kr_histogram , e ${} dg 600,300,3 +_kr_histogram : skip "${1=256},${2=0%},${3=100%}" +e[^-1] "Calculate histgram with $1 classes in range [${2-3}] from image$?." +foreach { +if ${-is_percent\ $2} mn={im+(iM-im)*$2} else mn=$2 fi +if ${-is_percent\ $3} mx={im+(iM-im)*$3} else mx=$3 fi +if $>==0 st=$mn,{($mx-$mn)/($1-1)} else st=$st,$mn,{($mx-$mn)/($1-1)} fi +histogram. $1,$mn,$mx +} u $st +#@cli _kr_histogram8 : _nb_levels>0[%],_value0[%],_value1[%] +#@cli : same as _kr_histogram, still defaults to byte data (256,0,255) instead of (256,0%,100%) +#@cli : $ sp dog _kr_histogram8 {iM-im+1},{im},{iM} e ${} dg 600,300,3 +_kr_histogram8 : skip "${1=256},${2=0},${3=255}" +e[^-1] "Calculate histgram with $1 classes in range [${2-3}] from image$?." +foreach { _kr_histogram. ${1-3} } +#@cli hist_percentile : _nth[%],_zero={0|1},_min0,_stepw +#@cli : Estimation of _nth percentiles (lower & upper) from histogram and returning value(s) in status (${}) +#@cli : _zero Class 0 is zeroed if !=0 +#@cli : _min0 value of class 0 +#@cli : _stepw value of class width (bin size) +#@cli : Default values: 'nth=25%', '_zero=0', '_min0=0', '_stepw=1' +#@cli : $ sp tiger luminance +dh ,,256,0,255 histogram.. 256,0,255 hist_percentile.. , rm.. t=${} to_rgb text $t,40,5,23,1,255,0,0 +hist_percentile : +check "${1=25%}>=0" +skip ${2=0},${3=0},${4=1} +e[^-1] "Calculate $1 percentile from 1d histogram$?." +foreach { +if h>1" || "d>1" || "s>1 v + e[^-1] "Image "$>" seemingly not 1d!" v - continue fi +if $2!=0 set. 0,0 fi +m0={is} +N={if(${"-is_percent $1"},$m0*$1,$1)} +if ($m0*$1)==0 N=1 O=$m0 else O={$m0-$N} fi ++cumulate. ++ge. $N mn={${arg\ 1,{[xM,yM,zM,cM]}}*$4+$3} rm. ++ge. $O mx={${arg\ 1,{[xM,yM,zM,cM]}}*$4+$3} rm[-1,-2] +res=$mn\,$mx +if $>==0 sres=$res else sres=$sres\,$res fi +} u $sres +#@cli karo_morpho : action, _kernel(0), _size(5), _ckernel("1,0,1; 0,1,0; 1,0,1") +#@cli : Mathematical morphology filter +#@cli : action={0=Ero | 1=Dil | 2=Open | 3=Close | 4=Ori-Ero | 5=Dil-Ori | 6=Ori-Open | 7=Close-Ori | 8=(Ori*2-(Open+Close))*0.5 | 9=Close-Open} +#@cli : _kernel={0=Square | 1=Octogon | 2=Circle | 3=Custom} +#@cli : _size>=2(5) +#@cli : _ckernel (custom kernel only if _kernel==3) +#@cli : Default values: 'kernel=0', 'size=5','ckernel=1,0,1;0,1,0;1,0,1' +#@cli : Derived from D. Tschumperle's older fx_morpho (formerly gmic_stdlib) and extended by action 4..9 +#@cli : $ osteo +karo_morpho 4,3,,"0\,1\,0\;1\,1\,1\;0\,1\,0" +karo_morpho : +skip "${2=0},${3=5},${4='1,0,1;0,1,0;1,0,1'}" +ac=Ero,Dil,Open,Close,"Ori-Ero","Dil-Ori","Ori-Open","Close-Ori","(Ori*2-(Open+Close))*0.5","Close-Open" +ke=Square,Octagon,Circle,Custom +e[^-1] "Math. morph. filter "${arg\ {$1+1},$ac}" with kernel "${arg\ {$2+1},$ke}" and size "$3 +({'"$4"'}) f. "(i>=_'0' && i<=_'9') || i==_',' || i==_';'?i:-1" discard. -1 ckernel={t} rm. +if $2==0 m "my_erode: erode $""1" m "my_dilate: dilate $""1" +elif $2==1 m "my_erode: erode_oct $""1" m "my_dilate: dilate_oct $""1" +elif $2==2 m "my_erode: erode_circ $""1" m "my_dilate: dilate_circ $""1" +else +m "my_erode : ("$ckernel") erode[^-1] . skip $""1"" rm." +m "my_dilate : ("$ckernel") dilate[^-1] . skip $""1"" rm." +fi +if $1==0 m "my_action : my_erode $3" +elif $1==1 m "my_action : my_dilate $3" +elif $1==2 m "my_action : my_erode $3 my_dilate $3" +elif $1==3 m "my_action : my_dilate $3 my_erode $3" +elif $1==4 m "my_action : +my_erode $3 -" +elif $1==5 m "my_action : +my_dilate $3 rv -" +elif $1==6 m "my_action : +my_erode $3 my_dilate. $3 -" +elif $1==7 m "my_action : +my_dilate $3 my_erode. $3 rv -" +elif $1==8 m "my_action : +my_erode $3 my_dilate. $3 +- rm.. +my_dilate.. $3 my_erode. $3 rv[-1,-3] -[-1,-3] rv - / 2" +elif $1==9 m "my_action : +my_erode $3 my_dilate. $3 my_dilate.. $3 my_erode.. $3 -" +else m "my_action : +my_dilate $3 my_erode. $3 rv -" +fi +foreach { +my_action[0] +} +um my_erode,my_dilate,my_action +#@cli hist_feature : _nofeature>=-2,_nth>0,_zero={0|1},_min0,_stepw,_percent[%]>0 +#@cli : Estimation from histogram (frequency dist, 1d image) the features +#@cli : 'mode','sum' (m0),'mean' (m1),'SD' (m2),'min','max','median','iqr' (hiq-loq+1),'loq','hiq' returned in status (${}). +#@cli : nofeature=-2 mode,m0,m1,m2,min,max,med,iqr,loq,hiq, +#@cli : -1 mode,0 sum,1 mean,2 SD,3 min,4 max,5 median, +#@cli : 6 iqr (interquantile range),7 loq (lower quantile),8 hiq (higer qunatile) +#@cli : nth extreme value (nth+1 occurence!) +#@cli : zero Class 0 is zeroed if !=0 +#@cli : min0 value of class 0 +#@cli : stepw value of class width (bin size) +#@cli : percent quantile +#@cli : Default valalues: '_nofeature=-2', '_nth=1', '_zero=0', '_min0=0', '_stepw=1', '_percent=25%' +#@cli : Updated 140314 (smoothing replaced by nth selection) +#@cli : Updated 100817 (percent parameter and iqr,loq,hiq feature added) +#@cli : $ sp tiger luminance +histogram 256,0,255 dh.. ,,256,0,255 hist_feature , repeat 8 { t={_arg($>+1${})} text $t,40,{$>*25+5},23,1,128 } rm. +hist_feature : +check ${1=-2}>=-2" && "$1<=8" && "isint($1)" && "isint(${2=1})" && "$2>0 +skip ${3=0},${4=0},${5=1},${6=25%} +e[^-1] "Calculate md,m0,m1,m2,$2.min,$2.max,med,iqr,loq,hiq from 1d histogram$?." +foreach { +if h>1" || "d>1" || "s>1 v + e[^-1] "Data["$>"] seemingly not 1d!" v - continue fi +if $3!=0 =. 0,0 fi +md={xM*$5+$4} +m0={is} ++*. 'x*$5+$4' m1={is/$m0} rm. ++*. '(x*$5+$4)^2' m2={sqrt(is/$m0-$m1^2)} rm. +mn={"l=0; su=i(0); while(su<$2 && l=0,l--; su+=i(l)); l*$5+$4"} +med1={"l=0; su=0; while(su<=(is/2) && l=0, l--; su+=i(l)); l"} +med={($med1+$med2)/2*$5+$4} +hist_percentile. $6,$3,$4,$5 qu=${} +hiq=${arg\ 2,$qu} +loq=${arg\ 1,$qu} +iqr={${arg\ 2,$qu}-${arg\ 1,$qu}+1} +if $iqr<-1 iqr-=2 fi +res=$md\,$m0\,$m1\,$m2\,$mn\,$mx\,$med\,$iqr\,$loq\,$hiq +if $1>-2 res=${arg\ {$1+2},$res} fi +if $>==0 sres=$res else sres=$sres\,$res fi +} u $sres +#@cli hist_feature_demo : Parameters like in hist_feature +#@cli : (Plot) of features in blue into the histogram with Gaussian in green +#@cli : $ sp 0 luminance +threshold 40 * histogram 256,0,255 = 0,0 hist_feature_demo , dg 600,300,3 +hist_feature_demo : +check ${1=-2}>=-2" && "$1<=8" && "isint($1)" && "isint(${2=1})" && "$2>0 +skip ${3=0},${4=0},${5=1},${6=25%} +e[^-1] "Plot features from hist_feature into 1d histogram$?." +l. { +hist_feature. -2,${2-6} vv=${} +md=${arg\ 1,$vv} m0=${arg\ 2,$vv} m1=${arg\ 3,$vv} m2=${arg\ 4,$vv} +mn=${arg\ 5,$vv} mx=${arg\ 6,$vv} med=${arg\ 7,$vv} +lo=${arg\ 9,$vv} hi=${arg\ 10,$vv} ++gaussian. $m2,0,0 shift. {-w/2+$m1} *. {$m0/is} round. 1 +v={iM#-2} ++*. 0 +=. $v,$md =. $v,$m1 =. {$v*0.25},$mn =. {$v*0.25},$mx =. $v,$med +=. {$v*(1-$6)},$lo =. {$v*(1-$6)},$hi +a c +u $vv +} +#@cli karo_nth_max : _n(1),_ind(=0) +#@cli : Return in the status the _n-th max or the index of the n-th max of an image +#@cli : Possibility to fetch the index instead of the value (_ind=1) +#@cli : Default values: 'n=1', 'ind=0' +karo_nth_max : check isint(${1=1})" && "$1>0 skip ${2=0} +e[^-1] "Return in the status the $1-th max of image$?." +foreach { +if $2 eval argkth(-$1,{^}) u {${}-1} else eval kth(-$1,{^}) fi mx=${} +if $>==0 mx1=$mx else mx1=$mx1,$mx fi +} u $mx1 +#@cli karo_nth_min : _n(1),_ind(=0) +#@cli : Return in the status the _n-th min of an image or the index of the _n-th min of an image +#@cli : Possibility to fetch the index instead of the value (_ind!=1) +#@cli : Default values: 'n=1', 'ind=0' +karo_nth_min : check isint(${1=1})" && "$1>0 skip ${2=0} +e[^-1] "Return in the status the $1-th min of image$?." +foreach { +if $2 eval argkth($1,{^}) u {${}-1} else eval kth($1,{^}) fi mn=${} +if $>==0 mn1=$mn else mn1=$mn1,$mn fi +} u $mn1 +#@cli karo_VST : _inverse(=0) +#@cli : Variance Stabilizing Transformation +#@cli : following http://hal.archives-ouvertes.fr/docs/00/51/08/66/PDF/Burst_Hal.pdf +#@cli : $ sp tiger v1=${-std_noise},2,2 +karo_VST. 0 v2=${-std_noise},2,2 +karo_VST. 1 text... $v1 text.. $v2 +#@cli : Default values: 'inverse=0' +karo_VST : +skip ${1=0} if $1 inv=" (inverse)." else inv="." fi +e[^-1] "Variance Stabilizing Transformation"$inv +foreach { +if $1 /[0] 2 sqr[0] -[0] {3/8} else +[0] {3/8} sqrt[0] *[0] 2 fi +} +#@cli pearson_correlation : +#@cli : Compute pearson-correlation using two-by-two selected images. +#@cli : $ sp tiger +shift -30,-20 pearson_correlation text. {_${}},0,0,20%,1,255,255,255 +pearson_correlation : +e[^-1] "Compute pearson-correlation using two-by-two image"$?"." +repeat int($!/2) { l[{$>*2},{$>*2+1}] { ++-[0] {0,ia} +-[1] {1,ia} +*[2,3] +sqr[2,3] +r={ia/sqrt({2,ia}*{3,ia})} +if $>==0 u $r else u ${},$r fi +rm[2-4] +} } +#@cli karo_extinction : _whitevalue[%] +#@cli : Convert (integer) transmission image into extinction with _whitevalue. +#@cli : Default value: 'whitevalue=100%' +#@cli : $ osteo +karo_extinction +karo_extinction : check "${1=100%}>0" +e[^-1] "Convert transmission image"$?" into extinction with white value "$1"." +foreach { +if ${-is_percent\ $1} WW={iM*$1} else WW=$1 fi +c. 1,{iM} /. $WW log10. *. -1 +} +#@cli region_feature : [labelimage],_region_label(1),_feature({wh}) +#@cli : Return feature for a specified region in status. Selected image is unchanged, only one is evaluated. Argument '_feature' is a string that corresponds to the way the feature would be requested for the entire image in math. processor syntax without \{\}. +#@cli : $ 200,256 follic +threshold. 18.6% negate. label_fg. 0,1 repeat 10 { region_feature.. .,{$>+1},"ia,h" text[0] {``$>\ ${}},5,{$>*14+14},13,1,255 } +region_feature : check ${-is_image_arg\ $1} skip "${2=1},${3="wh"},${4=0}" +e[^-1] "Calculate region feature(s) \"$3\" for label==$2 in "$1" from data$?." +pass$1 l[-2,-1] { ++extract_region[0] [1],0,$2 rm[1] +u {[$3]} rm. +} +#@cli region_feature_example : _sample={follic | sample name/number},_number +#@cli : Illustrate region_feature +#@cli : $ region_feature_example 40,15 f. if(i,i*2+100,0) +region_feature_example : skip "${1=follic},${2=-1}" +if ['$1']==['follic'] $1 +threshold. 18.6% +else sp "$1" luminance. +otsu. 256 karo_open. 3 fi +negate. i[0] 200,{h} +karo_bin_rand_del. , +to_rgb.. +karo_label. 0,0,1 +repeat $2==-1?(iM>20?20:iM):(iM>$2?$2:iM) { +region_feature.. .,{$>+1},"h,ia" rf=${} +text[0] ${-padint\ {$>+1},3}\ {``$rf},5,{$>*14+14},13,1,255 ++eq. {$>+1} +karo_shape_moments. +_sm=${} +text.. {"sm=["$_sm"];["$>"+1,sm[1]+0.5,sm[2]+0.5,10,1,255,0,0]"} +draw={"sm=["$_sm"]; +ellipse(#-2,sm[1]+0.5,sm[2]+0.5,1,1,0,1,0,255,0,0); +if("$_version"<298,ellipse(#-2,sm[1]+0.5,sm[2]+0.5,-sm[13]/2,-sm[14]/2,sm[3]*180/pi+90,1,0xf0f0f0f0,255,255,0), +ellipse(#-2,sm[1]+0.5,sm[2]+0.5,-sm[13]/2,-sm[14]/2,sm[3]+pi/2,1,0xf0f0f0f0,255,255,0))"} +} +#@cli karo_feat_eval_n : [maskimage],_high_connectivity,_oneo +#@cli : Compute features from selected transmission (grey) image and multi-component maskimage. +#@cli : if _oneo is true, mask is considered as one-component maskimage +#@cli : Features: centroid (x,y), area, mean extincton, sd extinction. +#@cli : follic_ loads an example image and mask +#@cli : $ follic_ karo_feat_eval_n.. . run "repeat h#-2 { =. 2,{i(#-2,0,$>)},{i(#-2,1,$>)} }" +ge. 2 delaunay3d. n.. 0,255 j3d.. .,0,0,0,0.5,1 rm. +karo_feat_eval_n : check ${-is_image_arg\ $1} check "${2=1}>=0" skip ${3=0} +e[^-1] "Compute features from transmission image$? and multi-component mask image "$1"." +repeat $! { pass$1 0 l[$>,-1] { +if !$3 +label_fg. 0,$2 else +neq. 0 fi +mode=${"_karo_mode... ,"} if $mode<=160 mode={iM#-3} fi ++karo_extinction... $mode +l[-1,-2] { o={iM#0} 6,$o +repeat iM#0 { ++eq[0] {$>+1} nn={is} ++barycenter. cc0={@0} cc1={@1} rm. ++*[1,-1] su={is/$nn} ++. $su -sqr. *. .. su2={sqrt(is/($nn-1))} +rm[-1--2] +=. $cc0,0,$> +=. $cc1,1,$> +=. $nn,2,$> +=. $su,3,$> +=. $su2,4,$> +=. $mode,5,$> +} +} k. +} } +#@cli _karo_mode : _blur(=3), low(=-1), hig(=-1), _binsize(=1), _nodel(=0) +#@cli : Estimate mode (most frequent value) of image histogram from selected image after evtl. histogram smoothing between _low and _hig with _low==-1 min and hig=-1 max from the image. +#@cli : If _binsize<0 it represents neg. number of cluster (classes) +#@cli : If _nodel==true the histogram is kept +_karo_mode : +check ${1=3}>=0 skip "${2=-1},${3=-1},${4=1},${5=0}" +if $2==-1 low={im} else low=$2 fi +if $3==-1 hig={iM} else hig=$3 fi +if $4<0 clust={abs($4)} binsize={($hig-$low+1)/$clust} +else clust={round(($hig-$low+$4)/$4)} binsize=$4 fi +if $1>0 e[^-1] "Extract mode of image$? after smoothing $1 between "{_$low}" and "{_$hig}" binsize "$binsize" cluster "$clust +else e[^-1] "Extract mode of image$? between "{_$low}" and "{_$hig}" binsize "$binsize" cluster "$clust fi ++histogram. $clust,$low,$hig +if $1>0 b. $1 fi +u {xM*$binsize+$low} +if !$5 rm. fi +#@cli descriptive_feature : +#@cli : Estimation of features number(sum,m0),mean(m1),SD(m2),skewness(m3),kurtosis(m4),min,max,median +#@cli : from skalar images. +#@cli : See custom function example_descriptive_feature +descriptive_feature : +e[^-1] "Calculate m0,m1,m2,m3,m4,min,max,med from data$?." +foreach { +if s>1 e[^-1] "Data ["$>"] seemingly not skalar! Break!" continue fi +if $_version>=216 res={" +ff=stats(); ff[3]=sqrt(ff[3]); _(print(ff)); +m3=0;m4=0;for(ip=0,ip==0 sres=$res else sres=$sres\,$res fi +} u $sres +#@cli example_descriptive_feature : [region],_all(false),_background(false),_verbose_draw(true),_verbose_text(false) +#@cli : Example for feature extraction from a selected grey image and a [region] mask or label image using 'extract_region' and 'descriptive_feature'. More than 9 regions are truncated if _all == false. Background region (label == 0) is only calculated if _background == true. Graphical display of feature with _verbose_draw ==true and textual display only with _verbose_text == true. +#@cli : The list of features is returned in status, label,area,mean,SD,curtosis,excess,min,max,median for each region. +#@cli : 'osteo_' and 'follic_' in the examples are transmission image examples from microscopic cells with region masks +#@cli : $ osteo_ example_descriptive_feature.. . e ${} +#@cli : $ follic_ karo_extinction.. , label_fg. 0 example_descriptive_feature.. . +example_descriptive_feature : +check ${"is_image_arg $1"}" && isbool(${2=0}) && isbool(${3=0}) && isbool(${4=1}) && isbool(${5=0})" +pass$1 => Region +im={im} +if $3==0&&$im==0 im+=1 fi +num={iM-$im+1} +fe="Area","Mean","SD","Curtosis","Excess","Min","Max","Median" +m "_MC : $""=_M" +st_ff="" +nmax={$2?$num:9} +if $num>9&&$2==0 warn[0--3] "More than 9 regions! Not processed!" fi +repeat $num { ii=$> ++extract_region[0] [1],0,{$im+$ii} +if h==0 rm. warn[0--3] "Empty region "{$im+$ii}"! Not processed!" continue fi +descriptive_feature. rm. temp_ff=${} _MC ${} +u {$im+$ii},$temp_ff temp_ff=${} +if $4 128,128,1,3 text. "Features label: "{$im+$ii},0,0,12,1,255,255,0 fi +if $5 +e[] "Features label: "{$im+$ii} fi +repeat 8 { +ff=${arg\ {$>+1},$fe}\ =\ {_${_M{$>+1}}} +if $5 +e[] $ff fi +if $4 text. $ff,0,{($>+2)*12},12,1,255,255,0 fi +} +if ${strlen\ $st_ff}>0 st_ff=$st_ff,$temp_ff else st_ff=$temp_ff fi +nmax-=1 if !$nmax break fi +} rm[Region] uncommand _MC +if $4 if $num>3 append_tiles[1--1] 3 fi fi +u $st_ff +#@cli kr_mean_lch : _mode(0..4) +#@cli : Calculate LCH color features from selected RGB image after application of rgb2lch [ mean l(uminance), c(hromaticity), h(hue), sd l, c, h ] returned in status and global variable _kr_mean_lch. Mean and sd of h is the circular mean and sd of hue (angles)! There is no test of image mode RGB! +#@cli : mode==0 return original (default) +#@cli : mode==1 return original and image generated from original l(uminance) and mean c, mean h +#@cli : mode==2 return original and const. image generated from mean l(uminance), mean c, mean h +#@cli : mode==3 return original and image generated from l(uminance), c, mean h +#@cli : mode==4 return original and image generated from l(uminance), mean c, h +#@cli : Default value: 'mode=0' +#@cli : $ sp wall kr_mean_lch. 1 (${}) s. x,2 rm. +#@cli : $ sp +luminance threshold. 50% karo_close. 15,1 +extract_region.. .,0,1 kr_mean_lch. 0 (${}) rm.. +rgb2lch... s. c f.. {-4,@1} f. {-4,@2} a[-1--3] c lch2rgb. rm.. f. I=i#-2?I:I#-3 # Replace region with mean chromaticity amd mean hue +kr_mean_lch : +check "isnum(${1=0}) && $1>=0 && $1<5" ++rgb2lch. s. c +hmsd=${-kr_circular_mean.} hm=${-arg\ 1,$hmsd} hsd=${-arg\ 2,$hmsd} +_kr_mean_lch={[ia#-3,ia#-2,$hm,sqrt(iv#-3),sqrt(iv#-2),$hsd]} +lm={ia#-3} cm={ia#-2} +if $1==1 f.. i=$cm f. i=$hm +elif $1==2 f... i=$lm f.. i=$cm f. i=$hm +elif $1==3 f. i=$hm +elif $1==4 f.. i=$cm +else k[0] fi +if $1>0&&$1<=4 a[-1--3] c lch2rgb. round. fi +u $_kr_mean_lch +#@cli karo_shape_moments +#@cli : selected image considered as binary or skalar pattern with pixle values==0 outside the pattern or region and either ==1 (for binary) or !=0 for skalar pattern. Calculation of shape moments and other features returned in status. With mean==1 input was binary otherwise skalar! Moments m00=sum, m10,m01 centroid, orientation=theta, mean, h1-h7 Hu's moment invariants, with length. +#@cli : Result in status: +#@cli : sum centroid_x,y theta eccenticity mean Hu_moments_1-7 main_axis_lengths +#@cli : 0-14 m00 m10 m01 theta excent mean h1 h2 h3 h4 h5 h6 h7 width length +#@cli : Result in global variable _karo_shape_moments: moments, centered and normalized moments m, my, eta, Hu's moment invariants h1-h7, orientation, eigenvalues, eccentricity and extension: +#@cli : 0-15 [[$m00,$m01,$my02,$my03],[$m10,$my11,$my12,0],[$my20,$my21,0,0],[$my30,0,0,0]], +#@cli : 16-31 [[$eta00,$eta01,$eta02,$eta03],[$eta10,$eta11,$eta12,0],[$eta20,$eta21,0,0],[$eta30,0,0,0]], +#@cli : 32-39 [$h1,$h2,$h3,$h4,$h5,$h6,$h7,0], +#@cli : 40-47 [$theta,$lambda1,$lambda2,$excent,0,0,0,0] +#@cli : $ osteo_ k. +karo_shape_moments _sm=${} to_rgb n 0,255 circle ${arg\ 2,$_sm},${arg\ 3,$_sm},1%,1,255,0,0 +#@cli : $ osteo_ * +karo_shape_moments _sm=${} to_rgb n 0,255 circle ${arg\ 2,$_sm},${arg\ 3,$_sm},1%,1,255,0,0 +karo_shape_moments : +l. { ++extract[0] "i!=0",1 extract[0] "i!=0",2 +s[1] c rm[3] +*[1,2] [0] +m00,m10,m01={[is#0,is#3/is#0,is#4/is#0]} rm[3,4] ++[1] {-$m10} ++[2] {-$m01} ++sqr[1,2] ++*[3,4] [1] ++*[3,4] [2] ++*[1,2] +*[1-9] [0] +my11,my20,my02,my21,my12,my30,my03={[is#9,is#3,is#4,is#7,is#6,is#5,is#8]} +eta00,eta10,eta11,eta01,eta20,eta21,eta02,eta12,eta30,eta03={[$m00/h#1,0,$my11/$m00^2,0,$my20/$m00^2,$my21/$m00^2.5,$my02/$m00^2,$my12/$m00^2.5,$my30/$m00^2.5,$my03/$m00^2.5]} +h1,h2,h3,h4,h5,h6,h7={[$eta20+$eta02,sqr($eta20-$eta02)+4*sqr($eta11),sqr($eta30-3*$eta12)+sqr(3*$eta21-$eta03),sqr($eta30+$eta12)+sqr($eta21+$eta03),($eta30-3*$eta12)*($eta30+$eta12)*(sqr($eta30+$eta12)-3*sqr($eta21+$eta03))+(3*$eta21-$eta03)*($eta21+$eta03)*(3*sqr($eta30+$eta12)-sqr($eta21+$eta03)),($eta20-$eta02)*(sqr($eta30+$eta12)-sqr($eta21+$eta03))+4*$eta11*($eta30+$eta12)*($eta21+$eta03),(3*$eta21-$eta03)*($eta30+$eta12)*(sqr($eta30+$eta12)-3*sqr($eta21+$eta03))-($eta30-3*$eta12)*($eta21+$eta03)*(3*sqr($eta30+$eta12)-sqr($eta21+$eta03)^2)]} +theta,lambda1,lambda2={[0.5*atan2(2*$my11,$my20-$my02),0.5*($my20+$my02)/$m00+0.5*sqrt(4*($my11/$m00)^2+($my20/$m00-$my02/$m00)^2),0.5*($my20+$my02)/$m00-0.5*sqrt(4*($my11/$m00)^2+($my20/$m00-$my02/$m00)^2)]} +excent={sqrt(1-$lambda2/$lambda1)} +_karo_shape_moments={[[[$m00,$m10,$my20,$my30],[$m01,$my11,$my21,0],[$my02,$my12,0,0],[$my03,0,0,0]],[[$eta00,$eta10,$eta20,$eta30],[$eta01,$eta11,$eta21,0],[$eta02,$eta12,0,0],[$eta03,0,0,0]],[$h1,$h2,$h3,$h4,$h5,$h6,$h7,0],[$theta,$lambda1,$lambda2,$excent,0,0,0,0]]} +rm +} +l. { +rotate. {-$theta/pi*180},1,0,$m10,$m01 +extract. "i!=0",1 s c +min10,max10,min01,max01={[im#-3,iM#-3,im#-2,iM#-2]} +wid,len={[min($max10-$min10,$max01-$min01),max($max10-$min10,$max01-$min01)]} +rm +} +u $m00,$m10,$m01,$theta,$excent,$eta00,$h1,$h2,$h3,$h4,$h5,$h6,$h7,$wid,$len +#@cli karo_shape_moments_example : +#@cli : Any selected skalar image is evaluated for all pixels != 0 +#@cli : $ osteo_ k. karo_shape_moments_example +karo_shape_moments_example : ++karo_shape_moments. +_sm=${} to_rgb. n. 0,255 +ellipse. {sm=[$_sm];[sm[1]+0.5,sm[2]+0.5,sm[13]/2,sm[14]/2,(sm[3]<0?sm[3]+pi/2:sm[3])/pi*180]},1,0xf0f0f0f0,255,0,0 +circle. {sm=[$_sm];[sm[1]+0.5,sm[2]+0.5]},1%,1,255,0,0 +e[^1] {sm=[$_karo_shape_moments];sm[40]=(sm[40]<0?sm[40]+pi/2:sm[40])/pi*180;sm[40,4]} +#@cli :: User Karo's GIMP/gui Custom functions +#@cli fx_karo_mm_diff : _size,_size2,_operation,_shape,_channel,_scale +#@cli : Compute difference of math. morph. operation with two sizes on selected images. +#@cli : _size = int(5,1,25) +#@cli : _size2 = int(7,1,25) +#@cli : _operation = choice(2,"Erosion","Dilation","Open","Close") +#@cli : _shape = choice(1,"Square","Octagon","Circle") +#@cli : _channel = choice(0,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]", +#@cli : "Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]", +#@cli : "YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]", +#@cli : "YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]", +#@cli : "Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]", +#@cli : "HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]", +#@cli : "CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@cli : _scale = bool(true) +#@cli : Arithmetical difference of a morphological operation of size and size2. +#@cli : Author : KaRo. Latest update : 2019/09/03. +fx_karo_mm_diff : +skip "${1=5},${2=7},${3=2},${4=1},${5=0},${6=1}" +if $2<=$1 s2={$1+2} else s2=$2 fi +e[^-1] "Compute difference of math. morph. operation with two sizes "$1","$2" on selected images$?." +karo_doo $1,${s2},$3,$4,$6,$5 +to_rgb +fx_karo_mm_diff_preview : +gui_split_preview "fx_karo_mm_diff ${1-6}",${-3--1} +#@cli fx_karo_cimg_nlmeans : add_Gauss_noise(0),add_uniform_noise(0),add_salt_pepper(0),patch_size(0),lambda(-1),noise_sd(-1),alpha(3),steps(2) +#@cli : Execute use_nlmeans (CImg demo) external. +fx_karo_cimg_nlmeans : +skip "${1=0},${2=0},${3=0},${4=1},${5=-1},${6=-1},${7=3},${8=2}" +e[^-1] "Compute non-local means on selected images$?. CImg example \"use_nlmeans\" " +e[^-1] "with -ng "$1" -nu "$2" -ns "$3" -p "$4" -lambda "$5" -sigma "$6" -alpha "$7" -sampling "$8" -visu 03" +karo_nlmeans -ng,$1,-nu,$2,-ns,$3,-p,$4,-lambda,$5,-sigma,$6,-alpha,$7,-sampling,$8 +fx_karo_cimg_nlmeans_preview : +gui_split_preview "fx_karo_cimg_nlmeans ${1-8}",${-3--1} +#@cli fx_karo_cimg_skel : auto_thresh(1),thresh(50%),median(0),invert(0),thresh_flux(-0.3),medial_curve(0),Torsello corr(0),steps(1) +#@cli : Execute use_skeleton (CImg demo) external. +fx_karo_cimg_skel : +skip "${1=1},${2=50},${3=0},${4=0},${5=-0.3},${6=0},${7=0},${8=1}" +if $1 e[^-1] "Compute skeleton on selected images$? binarized with \"otsu 256\"" +else e[^-1] "Compute skeleton on selected images$? binarized with \"threshold "$2"%\"" fi +e[^-1] "CImg example \"use_skeleton\" with -median "$3" -inv "$4" -t "$5" -curve "$6" -corr "$7" -dlt "$8" -visu 0" +if $1 otsu 256 else threshold ${2}% fi +karo_skeleton median,$3,-inv,$4,-t,$5,-curve,$6,-corr,$7,-dlt,$8 n 0,255 +fx_karo_cimg_skel_preview : +gui_split_preview "fx_karo_cimg_skel ${1-8}",${-3--1} +#@cli fx_karo_oc_diff : _size,_shape,_channel,_scale +#@cli : Compute difference of math. morph opening and closing on selected images. +#@cli : _size = int(5,1,25) +#@cli : _shape = choice(1,"Square","Octagon","Circle") +#@cli : _channel = choice(0,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]", +#@cli : "Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]", +#@cli : "YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]", +#@cli : "YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]", +#@cli : "Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]", +#@cli : "HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]", +#@cli : "CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@cli : _scale = bool(true) +#@cli : Arithmetical difference of a morphological operation of size and size2. +#@cli : Author : KaRo. Latest update : 2019/09/03. +fx_karo_oc_diff : +skip "${1=5},${2=1},${3=0},${4=1}" +apply_channels "karo_doc $1,$2,0",$3,$4 +to_rgb +fx_karo_oc_diff_preview : +gui_split_preview "fx_karo_oc_diff ${1-4}",${-3--1} +#@cli fx_karo_pink : _operator(=11), _connect(=0), _smooth(=0), _param(=5), _channel(=0) +#@cli : _operator = 0..19 ("wshedtopo","wshedtopo inv","minima","maxima","heightminima","heightmaxima","grayskel","htkern","htkernu","lvkern","lvkernu","saliency","asf","asflin","asfr","asft","asftmed","asftndg","dilatballnum","erosballnum","lintophat") +#@cli : _connect = 0..1 ("Four/x","Eight/y") +#@cli : _smooth = 0.. +#@cli : _param = 0..25 +#@cli : _channel = choice(0,"All","RGBA [All]","RGB [All]","RGB [Red]","RGB [Green]","RGB [Blue]","RGBA [Alpha]","Linear RGB [All]","Linear RGB [Red]","Linear RGB [Green]","Linear RGB [Blue]","YCbCr [Luminance]","YCbCr [Blue-Red Chrominances]","YCbCr [Blue Chrominance]","YCbCr [Red Chrominance]","YCbCr [Green Chrominance]","Lab [Lightness]","Lab [ab-Chrominances]","Lab [a-Chrominance]","Lab [b-Chrominance]","Lch [ch-Chrominances]","Lch [c-Chrominance]","Lch [h-Chrominance]","HSV [Hue]","HSV [Saturation]","HSV [Value]","HSI [Intensity]","HSL [Lightness]","CMYK [Cyan]","CMYK [Magenta]","CMYK [Yellow]","CMYK [Key]","YIQ [Luma]","YIQ [Chromas]","RYB [All]","RYB [Red]","RYB [Yellow]","RYB [Blue]") +#@cli : $ sp tiger +fx_karo_pink , +- +#@cli : $ sp tiger +fx_karo_pink. 12,1,0.582524,10,0,0 +fx_karo_pink.. 12,0,0.582524,10,0,0 +[-1,-2] # asflin in x and y +fx_karo_pink : +skip "${1=12},${2=0},${3=0},${4=5},${5=0}" +coms="pink heightminima,{($2+1)*4},$4 pink wshedtopo,{($2+1)*4}","pink heightmaxima,{($2+1)*4},$4 pink wshedtopo,{($2+1)*4},i","pink minima,{($2+1)*4}","pink maxima,{($2+1)*4}","pink heightminima,{($2+1)*4},$4","pink heightmaxima,{($2+1)*4},$4","pink grayskel,null,4,$4","pink htkern,null,{($2+1)*4}","pink htkernu,null,{($2+1)*4}","pink lvkern,null,{($2+1)*4}","pink lvkernu,null,{($2+1)*4}","pink saliency,6b","pink asf,$4","[0]x2 a z if $2==0 pink asflin,x,$4 else pink asflin,y,$4 fi s z k.","pink asfr,$4","pink asft,null,null,{($2+1)*4},$4","pink asftmed,{($2+1)*4},$4","pink asftndg,null,null,{($2+1)*4},$4","pink dilatballnum,$4","pink erosballnum,$4","pink lintophat,$4" +if $1>=0&&$1<20 arg {$1+1},$coms else arg 1,$coms} fi com=${} +if $3>0 apply_channels "b $3 round "$com,$5,0 else apply_channels "round "$com,$5,0 fi +fx_karo_pink_preview : +gui_split_preview "fx_karo_pink ${^0}",${-3--1} +fx_karo_pink_bin : +skip "${1=1},${2=50},${3=3},${4=0},${5=5},${6=4},${7=0}" +coms="karo_frame 2 pink skelpar,$6,$5","karo_frame 2 pink skelend,{$4?8:4},$5","pink skelcurv,$6,{$4?8:4}","karo_frame 2 pink_skeleton $6,{$4?8:4}","pink barycentre,{$4?8:4}","pink border,{$4?8:4}","pink closeball,$5,$6","pink openball,$5,$6","pink convexhull,3","pink dist,$6","pink distc,$6","pink label,{($4+1)*4},pla","pink lantuejoul,$6" +if $3>=0&&$3<13 arg {$3+1},$coms else arg 1,$coms} fi com=${} +apply_channels "if $1 otsu 256 else threshold ${2}% fi "$com" n 0,255",$7,0 +fx_karo_pink_bin_preview : +gui_split_preview "fx_karo_pink_bin ${^0}",${-3--1} +#@cli fx_karo_pink_bianca : Pink test operator bianca +#@cli : ASF smooth size = int(5,1,10) +#@cli : Threshold (%) = int(60,0,100) +#@cli : Watershed height min = int(5,0,20) +#@cli : Opening radius = int(1,0,10) +#@cli : Invert = bool(0) +#@cli : Use G instead of B = bool(0) +#@cli : Pink test operator Bianca for RGB image; only B used. +#@cli : Pink executables in search PATH or C:\\Pink\\bin\\ for Windows +#@cli : Author : KaRo. Latest update : 2012/11/18 +#@cli : note = link("https://perso.esiee.fr/~coupriem/Pink/doc/html/files.html") +fx_karo_pink_bianca : +skip "${1=5},${2=60},${3=5},${4=1},${5=0},${6=0}" +if !${-is_windows} exe="label" else exe="C:\Pink\bin\label" fi +if $5 negate fi +s c if $6 k.. else k. fi ++round +pink. asf,$1 +- k[-1,-3] threshold. $2% ++round.. +pink_wshed. ,1,$3 +pink. $exe,4,max threshold. 1 +erode_oct.. {$4*2+1} dilate_oct.. {$4*2+1} ++*[-1,-2] negate.. n[-1,-2] 0,255 a[-1,-2,-4] c k[0] +fx_karo_pink_bianca_preview : +gui_split_preview "fx_karo_pink_bianca ${^0}",${-3--1} +fx_jr_multi_mosaic: +to_rgba +repeat $! l[$>] +repeat $1 +l[0] ++gradient_norm n. 0,1 b. $5 +100%,100%,100%,2,'u/max(1,($1-1))))*0.01))^4?[u,1]' s. c +distance. 1 *. -1 watershed.. . rm[1,3] +blend shapeaverage +1,1,1,3,([$6,$7,$8]) rgb2lch8. f. "I+[u(-255,255)*$9%,u(-255,255)*$10%,u(-255,255)*$11%]" lch82rgb. fx_balance_gamma.. {I(#-1,0,0,0)},0 rm. ++to_rgb. +fx_gradient_norm. ${13-16},0 dilate_circ $17 to_rgba. 1,1,1,3,([$18,$19,$20]) rgb2lch8. f. "I+[u(-255,255)*$21%,u(-255,255)*$22%,u(-255,255)*$23%]" lch82rgb. f.. "[I(#-1,0,0,0),($12<0?255-i0:i0)*abs($12)]" rm. +blend alpha +done done +rm[0] +if $24 blend_edges $25 fi +smooth ${26-31},0 +done done +fx_normalize_local ${32-37} +fx_jr_multi_mosaic_preview : +fx_jr_multi_mosaic ${2-38} +rgb2lms : +wx=95.047 +wy=100 +wz=108.883 +wrx=95.047 +wry=100 +wrz=108.883 +sr=0.2 +la=(10^2) +yb=1 +factor={min((0.8+$sr),1)} +adapt=($factor*(1-(exp(-($la+42)/92))/3.6)) +kmm=(1/((5*$la)+1)) +flmm=($kmm^4*$la+0.1*(1-$kmm^4)^2*(5*$la)^1/3) +1,1,1,3,"["$wx","$wy","$wz"]*0.01" +1,1,1,3,"["$wrx","$wry","$wrz"]*0.01" +(0.7328,0.4296,-0.1624;-0.7036,1.6975,0.0061;0.003,0.0136,0.9384) +invert. ++mix_channels[-4,-3] [-1] +lumcorr={i(#-6,0,0,0,1)/i(#-5,0,0,0,1)} +lmult={i(#-1,0,0,0,0)/i(#-2,0,0,0,0)} +mmult={i(#-1,0,0,0,1)/i(#-2,0,0,0,1)} +smult={i(#-1,0,0,0,2)/i(#-2,0,0,0,2)} +rm[-2,-1] +to_rgb[0] rgb2xyz[0] 1 f[0] "I/[0.95047,1,1.08883]" +mix_channels[0] [-2] +f[0] "begin(n=("$lumcorr"*["$lmult","$mmult","$smult"]*"$adapt")+1-"$adapt");n*I" +mix_channels[0] [-1] +(0.38971,0.68898,-0.07868;-0.22981,1.1834,0.04641;0,0,1) +mix_channels[0] [-1] +rm. +f[0] "temp=("$flmm"*abs(I))^0.42; +sign(I)*400*(temp/(temp+27.13))+0.1" +rm[^0] +lms2rgb : +wx=95.047 +wy=100 +wz=108.883 +wrx=95.047 +wry=100 +wrz=108.883 +sr=0.2 +la=(10^2) +yb=1 +factor={min((0.8+$sr),1)} +adapt=($factor*(1-(exp(-($la+42)/92))/3.6)) +kmm=(1/((5*$la)+1)) +flmm=($kmm^4*$la+0.1*(1-$kmm^4)^2*(5*$la)^1/3) +1,1,1,3,"["$wx","$wy","$wz"]*0.01" +1,1,1,3,"["$wrx","$wry","$wrz"]*0.01" +(0.7328,0.4296,-0.1624;-0.7036,1.6975,0.0061;0.003,0.0136,0.9384) +invert. ++mix_channels[-4,-3] [-1] +lumcorr={i(#-6,0,0,0,1)/i(#-5,0,0,0,1)} +lmult={i(#-1,0,0,0,0)/i(#-2,0,0,0,0)} +mmult={i(#-1,0,0,0,1)/i(#-2,0,0,0,1)} +smult={i(#-1,0,0,0,2)/i(#-2,0,0,0,2)} +rm[-2,-1] +f[0] "(sign(I-0.1)*(1/"$flmm")*((27.13*abs(I-0.1))/(400-abs(I-0.1)))^(1/0.42))" +(0.38971,0.68898,-0.07868;-0.22981,1.1834,0.04641;0,0,1) invert. +mix_channels[0] [-1] +rm. +mix_channels[0] [-2] +f[0] "begin(n=("$lumcorr"*["$lmult","$mmult","$smult"]*"$adapt")+1-"$adapt");I/n" +mix_channels[0] [-1] +f[0] "I*[0.95047,1,1.08883]" xyz2rgb[0] 1 +rm[^0] +dct_tileset: +{$1^2},{$2^2},1,1 +f. :"begin(const tw=$1;const th=$2;const stw=sqrt(tw);const sth=sqrt(th);const itw=1/tw;const ith=1/th;const istw=sqrt(itw);const isth=sqrt(ith);const s2=sqrt(2)); +px=x%tw; +py=y%th; +tx=(x-(px))*itw; +ty=(y-(py))*ith; +cx=cos((tx*0.5+((tx+0.5)*x*itw))*pi)*istw; +cy=cos((ty*0.5+((ty+0.5)*y*ith))*pi)*isth; +px!=0?(cx*=s2); +py!=0?(cy*=s2); +val=cx*cy; +val; +" +idct_tileset: +{$1^2},{$2^2},1,1 +f. :"begin(const tw=$1;const th=$2;const stw=sqrt(tw);const sth=sqrt(th);const itw=1/tw;const ith=1/th;const istw=sqrt(itw);const isth=sqrt(ith);const s2=sqrt(2)); +px=x%tw; +py=y%th; +tx=(x-(px))*itw; +ty=(y-(py))*ith; +cx=cos((x+0.5)*tx*pi*itw)*istw; +cy=cos((y+0.5)*ty*pi*ith)*isth; +tx!=0?(cx*=s2); +ty!=0?(cy*=s2); +val=-cx*cy*(((tx+ty)%2)*2-1); +val; +" +rgb2ycbcrjpeg : +rgb2srgb gcd_srgb2jpeg +ycbcrjpeg2rgb : +gcd_jpeg2srgb srgb2rgb +rgb2jzczhz : +afre_jchz +jzczhz2rgb : +afre_ijchz +pseudo_ecb: +ww={w+4} +hh={h+4} +total_image_minus_one={$!-1} +if $total_image_minus_one&&$30 expand_xy 4,$31 a x _pseudo_ecb ${1-29} s x,{$total_image_minus_one+1} shrink_xy 4 rv +else _pseudo_ecb ${1-29} fi +_pseudo_ecb: +csswap $1,0 +repeat $! l[$>] +repeat $20+1 +pseudo_ecb_generate ${2-19},${21-29} +done +done +csswap 0,$1 +done +pseudo_ecb_generate: +-m "MergeChoice : $""=_mode" -MergeChoice "add","alpha","and","average","blue","burn","darken","difference","divide","dodge","exclusion","freeze","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor","edges","error" ++ac "ecb_gradient_base[0] $6,$7,$8",rgb +if $2==1 _pseudo_c[1] fi +local[1] +if $5==1 +ac "ecb_gradient_base[0] $9,$10,$11",rgb +_pseudo_c[1] +blend ${_mode{$12+1}},$13 if $1==1 equalize fi fi +done +local[0] +sharpen $14 +if $2==1 +_pseudo_c[0] +elif $2==1 [0] fi ++fx_blend_bomb[0] 0,1,$15,$15,0,0,$16,0,0,0,1,0 +blend ${_mode{$19+1}},$20 +done +fx_blend_bomb[1] 0,1,$17,$17,0,0,$18,0,0,0,0,0 +if $1==1 equalize[1] fi +blend ${_mode{$21+1}},$22 +if $1==1 +equalize blend ${_mode{$3+1}},$4 fi +if $1==0 [0] blend ${_mode{$3+1}},$4 fi +if $23==1 [0] if $24==1 equalize[1] fi if $25==1 _pseudo_c[1] fi blend ${_mode{$26+1}},$27 +fi +ecb_gradient_base: +f "ang=pi*$2/180;G=x*cos(ang)+y*sin(ang);G%$1" n 0,255 +if $3==1 mul -1 abs fi +_pseudo_c : v - if s!=1 to_gray. fi {max(1,round(iM,1,1))},1,1,3,u(255) round. map.. . rm. v + +_pseudo_ecb_preview : +gui_split_preview "pseudo_ecb $*",${-3--1} +fx_row_shift : +repeat $! l[$>] +z 0,0,{w+1},{h+1},2 +inv={($7*-2)+1} +opt={int(($1-1)*$inv)} +if $opt==-1 +f "j((y-h*$3)*$2*"$inv",0,0,0,$6,2)" +f "j(0,(x-w*$5)*$4*"$inv",0,0,$6,2)" +elif $opt==1 +f "j(0,(x-w*$5)*$4*"$inv",0,0,$6,2)" +f "j((y-h*$3)*$2*"$inv",0,0,0,$6,2)" +else +if $inv==1 +f "j((y-h*$3)*$2*"$inv",(x-w*$5)*$4*"$inv",0,0,$6,2)" +elif $inv==-1 +f "j((y-h*$3)*$2*"$inv",(x-w*$5)*$4*"$inv",0,0,$6,2)" +fi +fi +z 0,0,{w-1},{h-1} +done done +fx_row_shift_preview : +fx_row_shift $* +sawtoother_cmy_k : +repeat $! l. split_opacity rv to_rgb. +fx_start_mix $26,$27 +if $19 rgb2cmyk. else rgb2cmy. fi s. c +index=0 +if $19 index=-1 if $23 b[-1] $22% +[-1] $25 %[-1] {256/$20} *[-1] $20 %[-1] 256 *[-1] $24 +[-1] $21 else *[-1] $20 +[-1] {$21*$20} b[-1] $22% fi fi +if $4 b[{$index-3}] $3% +[{$index-3}] $6 %[{$index-3}] {256/$1} *[{$index-3}] $1 %[{$index-3}] 256 *[{$index-3}] $5 +[{$index-3}] $2 else *[{$index-3}] $1 +[{$index-3}] {$2*$1} b[{$index-3}] $3% fi +if $10 b[{$index-2}] $9% +[{$index-2}] $12 %[{$index-2}] {256/$7} *[{$index-2}] $7 %[{$index-2}] 256 *[{$index-2}] $11 +[{$index-2}] $8 else *[{$index-2}] $7 +[{$index-2}] {$8*$7} b[{$index-2}] $9% fi +if $16 b[{$index-1}] $15% +[{$index-1}] $18 %[{$index-1}] {256/$13} *[{$index-1}] $13 %[{$index-1}] 256 *[{$index-1}] $17 +[{$index-1}] $14 else *[{$index-1}] $13 +[{$index-1}] {$14*$13} b[{$index-1}] $15% fi +c 0,255 a[{$index-3}--1] c +if $19 cmyk2rgb. else cmy2rgb. fi +fx_end_mix $26 +if $!!=3 rv a c fi done mv. 0 done +sawtoother_cmy_k_preview : +sawtoother_cmy_k $* +sawtoother_hsx : +repeat $! l. split_opacity rv to_rgb. +fx_start_mix $20,$21 +if $13==1 rgb2hsi. elif $13==2 rgb2hsl. else rgb2hsv. fi +s. c +if $4 +[-3] $6 %[-3] {360/($1)^2} *[-3] $1 %[-3] 360 *[-3] {$5*$1} +[-3] {$2} else *[-3] $1 +[-3] {$2*$1} fi %[-3] 360 +if $10 b[-2] $9% +[-2] $12 %[-2] {(1+(1/255))/$7} *[-2] {$7} %[-2] {(1+(1/255))} *[-2] $11 +[-2] {$8} else *[-2] $7 +[-2] {$8*$7} b[-2] $9% fi +if $17 b[-1] $16% +[-1] $19 %[-1] {(1+(1/255))/$14} *[-1] {$14} %[-1] {(1+(1/255))} *[-1] $18 +[-1] {$15} else *[-1] $14 +[-1] {$15*$14} b[-1] $16% fi +c[-2,-1] 0,1 a[-3--1] c +if $13==1 hsi2rgb. elif $13==2 hsl2rgb. else hsv2rgb. fi +if $3 l[-1] +b $3% rgb2hsv[0,1] f.. "[i0(#1),i1,i2]" rm. hsv2rgb done fi +fx_end_mix $20 +if $!!=3 rv a c fi done mv. 0 done +sawtoother_hsx_preview : +gui_split_preview "sawtoother_hsx $*",$-1 +sawtoother_lab8 : +repeat $! l. split_opacity rv to_rgb. +fx_start_mix $19,$20 +rgb2lab8. s. c +if $4 b[-3] $3% +[-3] $6 %[-3] {256/$1} *[-3] $1 %[-3] 256 *[-3] $5 +[-3] $2 else *[-3] $1 +[-3] {$2*$1} b[-3] $3% fi +if $10 b[-2] $9% +[-2] $12 %[-2] {256/$7} *[-2] $7 %[-2] 256 *[-2] $11 +[-2] $8 else *[-2] $7 +[-2] {$8*$7} b[-2] $9% fi +if $16 b[-1] $15% +[-1] $18 %[-1] {256/$13} *[-1] $13 %[-1] 256 *[-1] $17 +[-1] $14 else *[-1] $13 +[-1] {$14*$13} b[-1] $15% fi +a[-3--1] c lab82rgb. +fx_end_mix $19 +if $!!=3 rv a c fi done mv. 0 done +sawtoother_lab8_preview : +sawtoother_lab8 $* +sawtoother_lch8 : +repeat $! l. split_opacity rv to_rgb. +fx_start_mix $19,$20 +rgb2lch8. +s. c +if $4 +[-3] $6 %[-3] {256/$1} *[-3] $1 %[-3] 256 *[-3] $5 +[-3] $2 else *[-3] $1 +[-3] {$2*$1} b[-3] $3% fi +if $10 b[-2] $9% +[-2] $12 %[-2] {256/$7} *[-2] $7 %[-2] 256 *[-2] $11 +[-2] $8 else *[-2] $7 +[-2] {$8*$7} b[-2] $9% fi +if $16 b[-1] $15% +[-1] $18 %[-1] {256/($13)^2} *[-1] $13 %[-1] 256 *[-1] {$17*$13} +[-1] {$14} else *[-1] $13 +[-1] {$14*$13} b[-1] $15% fi %[-1] 256 +a[-3--1] c c. 0,255 lch82rgb. +if $3 l[-1] +b $3% rgb2lch8[0,1] f.. "[i0,i1,i2(#1)]" rm. lch82rgb done fi +fx_end_mix $19 +if $!!=3 rv a c fi done mv. 0 done +sawtoother_lch8_preview : +sawtoother_lch8 $* +sawtoother_rgb : +repeat $! l. split_opacity rv to_rgb. +fx_start_mix $19,$20 +s. c ++[-2,-1] 0.5 +if $4 b[-3] $3% +[-3] $6 %[-3] {256/$1} *[-3] $1 %[-3] 256 *[-3] $5 +[-3] $2 else *[-3] $1 +[-3] {$2*$1} b[-3] $3% fi +if $10 b[-2] $9% +[-2] $12 %[-2] {256/$7} *[-2] $7 %[-2] 256 *[-2] $11 +[-2] $8 else *[-2] $7 +[-2] {$8*$7} b[-2] $9% fi +if $16 b[-1] $15% +[-1] $18 %[-1] {256/$13} *[-1] $13 %[-1] 256 *[-1] $17 +[-1] $14 else *[-1] $13 +[-1] {$14*$13} b[-1] $15% fi +a[-3--1] c c. 0,255 +fx_end_mix $19 +if $!!=3 rv a c fi done mv. 0 done +sawtoother_rgb_preview : +gui_split_preview "sawtoother_rgb $*",$-1 +sawtoother_srgb : +repeat $! l. split_opacity rv to_rgb. +fx_start_mix $19,$20 +rgb2srgb. s. c ++[-2,-1] 0.5 +if $4 b[-3] $3% +[-3] $6 %[-3] {256/$1} *[-3] $1 %[-3] 256 *[-3] $5 +[-3] $2 else *[-3] $1 +[-3] {$2*$1} b[-3] $3% fi +if $10 b[-2] $9% +[-2] $12 %[-2] {256/$7} *[-2] $7 %[-2] 256 *[-2] $11 +[-2] $8 else *[-2] $7 +[-2] {$8*$7} b[-2] $9% fi +if $16 b[-1] $15% +[-1] $18 %[-1] {256/$13} *[-1] $13 %[-1] 256 *[-1] $17 +[-1] $14 else *[-1] $13 +[-1] {$14*$13} b[-1] $15% fi +a[-3--1] c c. 0,255 srgb2rgb. +fx_end_mix $19 +if $!!=3 rv a c fi done mv. 0 done +sawtoother_srgb_preview : +sawtoother_srgb $* +sawtoother_xyz8 : +repeat $! l. split_opacity rv to_rgb. +fx_start_mix $19,$20 +rgb2xyz8. s. c ++[-2,-1] 0.5 +if $4 b[-3] $3% +[-3] $6 %[-3] {256/$1} *[-3] $1 %[-3] 256 *[-3] $5 +[-3] $2 else *[-3] $1 +[-3] {$2*$1} b[-3] $3% fi +if $10 b[-2] $9% +[-2] $12 %[-2] {256/$7} *[-2] $7 %[-2] 256 *[-2] $11 +[-2] $8 else *[-2] $7 +[-2] {$8*$7} b[-2] $9% fi +if $16 b[-1] $15% +[-1] $18 %[-1] {256/$13} *[-1] $13 %[-1] 256 *[-1] $17 +[-1] $14 else *[-1] $13 +[-1] {$14*$13} b[-1] $15% fi +a[-3--1] c c. 0,255 xyz82rgb. +fx_end_mix $19 +if $!!=3 rv a c fi done mv. 0 done +sawtoother_xyz8_preview : +gui_split_preview "sawtoother_xyz8 $*",$-1 +sawtoother_ycbcr : +repeat $! l. split_opacity rv to_rgb. +fx_start_mix $20,$21 +if $1==1 rgb2ycbcrglic. elif $1==2 rgb2srgb. gcd_srgb2jpeg. else rgb2ycbcr. fi s. c ++[-2,-1] 0.5 +if $5 b[-3] $4% +[-3] $7 %[-3] {256/$2} *[-3] $2 %[-3] 256 *[-3] $6 +[-3] $3 else *[-3] $2 +[-3] {$3*$2} b[-3] $4% fi +if $11 b[-2] $10% +[-2] $13 %[-2] {256/$8} *[-2] $8 %[-2] 256 *[-2] $12 +[-2] $9 else *[-2] $8 +[-2] {$9*$8} b[-2] $10% fi +if $17 b[-1] $16% +[-1] $19 %[-1] {256/$14} *[-1] $14 %[-1] 256 *[-1] $18 +[-1] $15 else *[-1] $14 +[-1] {$15*$14} b[-1] $16% fi +a[-3--1] c c. 0,255 if $1==1 ycbcrglic2rgb. elif $1==2 gcd_jpeg2srgb. srgb2rgb. else ycbcr2rgb. fi +fx_end_mix $20 +if $!!=3 rv a c fi done mv. 0 done +sawtoother_ycbcr_preview : +gui_split_preview "sawtoother_ycbcr $*",$-1 +sawtoother_yiq8 : +repeat $! l. split_opacity rv to_rgb. +fx_start_mix $19,$20 +rgb2yiq8. s. c ++[-2,-1] 0.5 +if $4 b[-3] $3% +[-3] $6 %[-3] {256/$1} *[-3] $1 %[-3] 256 *[-3] $5 +[-3] $2 else *[-3] $1 +[-3] {$2*$1} b[-3] $3% fi +if $10 b[-2] $9% +[-2] $12 %[-2] {256/$7} *[-2] $7 %[-2] 256 *[-2] $11 +[-2] $8 else *[-2] $7 +[-2] {$8*$7} b[-2] $9% fi +if $16 b[-1] $15% +[-1] $18 %[-1] {256/$13} *[-1] $13 %[-1] 256 *[-1] $17 +[-1] $14 else *[-1] $13 +[-1] {$14*$13} b[-1] $15% fi +a[-3--1] c c. 0,255 yiq82rgb. +fx_end_mix $19 +if $!!=3 rv a c fi done mv. 0 done +sawtoother_yiq8_preview : +gui_split_preview "sawtoother_yiq8 $*",$-1 +sawtoother_yuv8 : +repeat $! l. split_opacity rv to_rgb. +fx_start_mix $19,$20 +rgb2yuv8. s. c ++[-2,-1] 0.5 +if $4 b[-3] $3% +[-3] $6 %[-3] {256/$1} *[-3] $1 %[-3] 256 *[-3] $5 +[-3] $2 else *[-3] $1 +[-3] {$2*$1} b[-3] $3% fi +if $10 b[-2] $9% +[-2] $12 %[-2] {256/$7} *[-2] $7 %[-2] 256 *[-2] $11 +[-2] $8 else *[-2] $7 +[-2] {$8*$7} b[-2] $9% fi +if $16 b[-1] $15% +[-1] $18 %[-1] {256/$13} *[-1] $13 %[-1] 256 *[-1] $17 +[-1] $14 else *[-1] $13 +[-1] {$14*$13} b[-1] $15% fi +a[-3--1] c c. 0,255 yuv82rgb. +fx_end_mix $19 +if $!!=3 rv a c fi done mv. 0 done +sawtoother_yuv8_preview : +gui_split_preview "sawtoother_yuv8 $*",$-1 +_fx_shredder : +repeat $! l[$>] +xming={$4/100} +xmaxg={$5/100} +strengthx={($6^4)} +yming={$7/100} +ymaxg={$8/100} +strengthy={($9^4)} +to_rgba split_opacity to_rgb.. to_gray. +l[0] +if $2 +csswap 0,{($2)-1} +fi +done +if $3 a c fi +l[0] +if $10==1 +mirror[0] x +elif $10==2 +mirror[0] y +elif $10==3 +mirror[0] xy +fi +if $11 +rotate[0] {$11*90},0 +fi +[0] +f[0] ">begin((!$1)?(col=0;row=0):(col=u*w^2;row=u*h^2);countx=(u("$xming","$xmaxg")^3)*wh+1;county=(u("$yming","$ymaxg")^3)*wh+1); +countx-=1; +county-=1; +countx<=0?(col=(u*w);countx=(u("$xming","$xmaxg")^3)*wh+1); +county<=0?(row=(u*h);county=(u("$yming","$ymaxg")^3)*wh+1); +(!$2)?J(#-1,"$strengthx"*col,"$strengthy"*row,0,0,2) +:j(#-1,"$strengthx"*col,"$strengthy"*row,0,0,0,2)" +rm[1] +if $11 +rotate[0] {-$11*90},0 +fi +if $10==1 +mirror[0] x +elif $10==2 +mirror[0] y +elif $10==3 +mirror[0] xy +fi +if $2>=1 +s[0] c +if $3 a[^-1] c else a c fi +l[0] +if $2 +csswap {($2)-1},0 +fi +done +fi +done +a c +done done +fx_shredder : +_fx_shredder ${2--1} +fx_shredder_preview : +fx_shredder $* +_jr_smooth_eq_prepare : +f. "begin(scale=((w^2+h^2+d^2)^0.5)/2;ol=$2^3;oh=$25^3;ql=(2-2/(($3+1)^2));qh=(2-2/(($26+1)^2));rsl=1/(2^$1);rsh=1/(2^$24);ol=$2^3;oh=$25^3; +order1=$5^3;band1=$6^2;gain1=$7; +order2=$9^3;band2=$10^2;gain2=$11; +order3=$13^3;band3=$14^2;gain3=$15; +order4=$17^3;band4=$18^2;gain4=$19; +order5=$21^3;band5=$22^2;gain5=$23); +vx=(x-w/2);vy=(y-h/2);vz=(z-d/2);rad=((vx^2+vy^2+vz^2)^0.5)*scale/16; +fl=rad*rsl; +fh=(rad*rsh)^-1; +func=(1/((1-ql*(fl)^(ol/2)+(fl)^(ol))^0.5)); +func*=2^(gain1/sqrt(1+2*abs(log2(rad/(2^"$4"))/(band1))^order1)); +func*=2^(gain2/sqrt(1+2*abs(log2(rad/(2^"$8"))/(band2))^order2)); +func*=2^(gain3/sqrt(1+2*abs(log2(rad/(2^"$12"))/(band3))^order3)); +func*=2^(gain4/sqrt(1+2*abs(log2(rad/(2^"$16"))/(band4))^order4)); +func*=2^(gain5/sqrt(1+2*abs(log2(rad/(2^"$20"))/(band5))^order5)); +func*=(1/((1-qh*(fh)^(oh/2)+(fh)^(oh))^0.5)); +func" +_jr_smooth_eq : +v - +100%,100%,100% +_jr_smooth_eq_prepare ${1-26} +shift. {int(w/2)},{int(h/2)},{int(d/2)},0,2 +fft.. *... . *[-2,-1] ifft rm[-1] +v + +fx_jr_smooth_eq : +repeat $! l[$>] +if !$28 split_opacity fi +l[0] +gain={iM} csswap 0,$27 +_jr_smooth_eq ${1-26} +csswap $27,0 if $29 abs fi if $30 * {$gain/iM} fi +done +if !$28 a c fi +done done +fx_jr_smooth_eq_preview : +if $31 +rm +4000,1,1 _jr_smooth_eq_prepare ${1-26} +columns 50%,100% +1000,500,1,1 +f. "cut((i(#-2,2^(x*log2(w)/w-1),0,0,0,2,1)*(255)-y)*127.5,0,255)" +mirror y +r. 50%,100% +k[-1] +else +fx_jr_smooth_eq ${1-30} +fi +_superstreak : +repeat $! l[$>] +to_rgba +if !$5 T,R,G,B,A=0 else T,R,G,B,A=${1-5} fi +select_color $T,$R,$G,$B,$A +f.. " +const step = max(1,$6%*min(w,h)); +const angle = $7*pi/180; +const dx = step*cos(angle); +const dy = step*sin(angle); +if (!i(#-1),I, +ixf = xf = x; iyf = yf = y; lf = 0; if ($8>=1, while (i(#-1,ixf=round(xf),iyf=round(yf)), ++lf; xf-=dx; yf-=dy)); +ixb = xb = x; iyb = yb = y; lb = 0; if ($8!=1, while (i(#-1,ixb=round(xb),iyb=round(yb)), ++lb; xb+=dx; yb+=dy)); +$8==0?I(ixb%w,iyb%h): +$8==1?I(ixf%w,iyf%h): +$8==2?(lf] +srand {int(u*65535)} +repeat $2 +a=((u($4,$5)^2)*512) +b={round(u(0,255))} +c={round(u(0,255))} +d={round(u(0,255))} +e={round(u(0,255))} +f={u($6,$7)} +g={u(0,360)} +_superstreak {$a},{$b},{$c},{$d},{$e},{$f},{$g},$3 +done +done done +fx_superstreak_preview : +fx_superstreak $* +_fx_uw3: +[0] +if $5 f.. "ni = norm(R,G,B); I(#0) = J(#1,(ni)*$1-$3,(ni)*$2-$4,0,2,3)" +else f.. "i(#0)=j(#1,(i)*$1-$3,(i)*$2-$4,0,0,2,3)" +fi +rm[1] +fx_ultrawarp3: +if $1!=-1 srand $1 fi +num=$2 +wm=$3 +wmr=$4 +wa={$5*pi/180} +war={$6*pi/180} +om=$7 +omr=$8 +oa={$9*pi/180} +oar={$10*pi/180} +cc=$11 +inter=$12 +bound=$13 +cs=$14 +channels=$15 +csswap 0,$14 +repeat $! l[$>] +om*={norm(w,h)*0.001} +omr*={norm(w,h)*0.001} +srand {int(u*65535)} +repeat $2 +wmag={((($wm+(u-0.5)*$wmr)*0.1)^2)*10} +omag={((($om+(u-0.5)*$omr)*0.1)^2)*10} +wangle={$wa+(u-0.5)*$war} +oangle={$oa+(u-0.5)*$oar} +wx={$wmag*sin(-$wangle%(2*pi))} +wy={$wmag*cos(-$wangle%(2*pi))} +ox={$omag*sin(-$oangle%(2*pi))} +oy={$omag*cos(-$oangle%(2*pi))} +ac " +_fx_uw3 "$wx","$wy","$ox","$oy","$cc","$inter","$bound"",$channels +done +csswap $14,0 +done done +fx_ultrawarp3_preview : +fx_ultrawarp3 ${2-16} +fx_jr_rep_cubism: +to_gray +rotac=$9 +rotar=$10 +rotxxc=$11 +rotxxr=$12 +rotxyc=$13 +rotxyr=$14 +rotxzc=$15 +rotxzr=$16 +aa=$17 +repeat $! l[$>] +ww={w} +hh={h} +dd={d} +xoffc=$3*0.01*$ww +xoffr=$4*0.01*$hh +yoffc=$5*0.01*$dd +yoffr=$6*0.01*$ww +zoffc=$7*0.01*$hh +zoffr=$8*0.01*$dd ++gradient_norm +100%,100%,100%,2,'begin(n=-1);ubegin(randm=u(100,200);randa=u(1,3));srand((x+(randa)+(u))*(randm+y));u(-1,1)" +eval. "begin(multvec=["$xoffr","$yoffr","$zoffr","$rotar","$rotxxr","$rotxyr","$rotxzr"]; +addvec=["$xoffc","$yoffc","$zoffc","$rotac","$rotxxc","$rotxyc","$rotxzc"]); +for(n=0,n0))?( +dist=i(#3,x,y,z,0); +xdist=i(#3,x,y,z,1)*dist; +ydist=i(#3,x,y,z,2)*dist; +zdist=i(#3,x,y,z,3)*dist; +idlist=vector(#8,-1); +freqlist=vector(#8,0); +idnum=0; +xint=floor(xdist);yint=floor(ydist);zint=floor(zdist); +xo=xdist-xdist;yo=ydist-ydist;zo=zdist-zdist; +gridmult=[(1-xo)*(1-yo)*(1-zo),xo*(1-yo)*(1-zo),(1-xo)*yo*(1-zo),xo*yo*(1-zo),(1-xo)*(1-yo)*zo,xo*(1-yo)*zo,(1-xo)*yo*zo,xo*yo*zo]; +for(pz=0,pz<2,pz++, +for(py=0,py<2,py++, +for(px=0,px<2,px++, +curr=i(#1,x+xint+px,y+yint+py,z+zint+pz,0,1,0); +pos=find(idlist,curr); +pos==-1?(idnum+=1;pos=find(idlist,-1);idlist[pos]=curr); +freqlist[pos]+=gridmult[(pz*4)+(py*2)+px]; +); +); +); +val=0; +for(n=0,n-{$>+7}] +repeat 8 +iter=$> +l[$>] +if $3==0 +/ {2^$iter} cut 0,1 round 0,1 * {2^$iter} +elif $3==1 +cut 0,1 round 0,1 * {2^$iter} +elif $3==2 +/ 255 cut 0,1 round 0,1 * {2^$iter} +fi +done done ++ +done done +else +repeat 8 +[0] +&[-1] {2^$>} +if $3==1 +/[-1] {2^$>} +elif $3==2 +/[-1] {2^$>/255} +fi +if !$2 a[^0] z fi +done +rm[0] +fi +fx_bitplane8_preview : +fx_bitplane8 $* +fx_jr_bilinear: +repeat $! l[$>] +to_rgba +ac " +repeat $1 +. +repeat $2 bilateral.. $3,$4 done +-. .. +*. {2^($5*0.5)} ++. .. +rm.. +done +",$6 +done done +fx_jr_bilinear_preview: +gui_split_preview "fx_jr_bilinear $*",${-3--1} +bitplane8 : +100%,100%,8,100%,"(i(#-1,x,y,0,c)>>z)&1" rm[0] +debitplane8 : +f "a=0;for(k=0,k<8,++k,a+=i(x,y,k)*2^k)" +_fx_mesh_blend : +r. 256,256,100%,100%,$1 +if $4 to_rgba else to_rgb fi +if $2 rv[0,1] fi +f[$3] "i(#2,i(#0),256-i(#1))" +if !$5 rm[2] fi +if $3 rm[0] else rm[1] fi +fx_mesh_blend : +if $1==0 repeat int($!/3) l[$>-{$>+2}] rv _fx_mesh_blend ${2-6} done done +elif $1==1 repeat $! l[$>] [0]x2 _fx_mesh_blend ${2-6} done done fi +fx_mesh_blend_preview : +fx_mesh_blend $* +_crazy_texture : +to_rgb fc 0,0,0 +ms1=0 if $10==1 ms1={0.125*max(w,h)/($2^0.375)} else ms1=$10 fi +ms2=0 if $15==1 ms2={0.625*max(w,h)/($2^0.25)} else ms2=$15 fi +CF={$8*$13*$19} +if $18 expand_xy {$CF} fi +noise_poissondisk $1,$2 +fx_edge_offsets ${3-7} +jr_deform $8,$9,$ms1,$11,0,$12,1 +jr_deform $13,$14,$ms2,$16,0,$17,1 +if $18 shrink_xy {$CF} fi +fx_crazy_texture: +_crazy_texture ${2-20} +fx_crazy_texture_preview : +fx_crazy_texture $* +rectexture: +split_opacity l[0] +if $2==0 +fill_color[-1] ${-RGB} +elif $2==1 +fill_color[-1] ${-RGB} +elif $2==2 +fill_color[-1] ${-RGB} +else +rr={255*round(u)} +fill_color[-1] $rr,$rr,$rr +fi +repeat max(0,$1) ++fill_color 0,0,0 +if $2==0 +rectangle[-1] {u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,1,${-RGB} +blend[-1,-2] difference +elif $2==1 +rectangle[-1] {u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,1,${-RGB} +blend[-1,-2] difference +elif $2==2 +rectangle[-1] {u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,1,${-RGB} +blend[-1,-2] difference +else +rectangle[-1] {u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,1,255,255,255 +blend[-1,-2] difference +fi +done +if $4==0 +f={u(0,3)} +elif $4==1 +f={u(0,2)+1} +else +f={($4)-2} +fi +fx_warp_by_intensity {$3*(u(2)-1)},{$3*(u(2)-1)},{w*$3*(u(2)-1)},{h*$3*(u(2)-1)},0,0,{$f},0,0 +if $2==1 +normalize 0,{u(5,20)*pi} sin[-1] -n 0,255 +fi +if $2==2 +normalize 0,{u(5,20)*pi} sin[-1] -n 0,255 +mults=u(0,2.5) +multv=u(0,2.5) +fx_mix_hsv {(2^u(0,2.5))-1},{u(-180,180)},0,{(2^$mults)-1},{max(0,2-(2^$mults))*u(-1,1)},0,{(2^$multv)-1},{max(0,2-(2^$multv))*u(-1,1)},0,0,2,0 +fi +done a c +fx_rectexture: +repeat $! l[$>] +ac "rectexture ${2-5}",$-2,$-1 +done done +fx_blend_shapeaverage : +if ${3=0} _fx_revert_layers fi +to_rgb +repeat int($!/2) +rv[-2,-1] +if $1 i[0] . fi +blend[-2,-1] shapeaverage0 +if $1 *[0,-1] /[0] 255 mv[0] $! fi +if $2 to_rgba. replace_color. 0,0,0,0,0,255,0,0,0,0 fi +mv. 0 done +Lylejk_Luma_Invert : +fx_decompose_channels[-1] 5,0,1,0 +negate[-3] +if $1==1 +fx_decompose_channels[-1,-2,-3] 5,1,1,0 +else +pow[-3] $1 +n[-3] 0,255 +fx_decompose_channels[-1,-2,-3] 5,1,1,0 +fi +Lylejk_Luma_Invert_preview : +gui_split_preview "Lylejk_Luma_Invert $*",$-1 +Lylejk_Quantize_Wicker : +quantize $1,1,1 +if $4==1 shift $2%,$3%,0,0,2,1 fi +fx_superpixels $5,$6,$7,$8,$9,1,$10,$11,$12,$13 +dilate $14 +if $4==1 shift {-$2}%,{-$3}%,0,0,2,1 fi +resize {w/2},{h/2} +c 0,255 +Lylejk_Wicker $15,$16,$17,150,0.42,0.85,0.6,7.83,0.68,19,2.64,0,1,1,0,0.5,10.5,100,0,0,0.5,10.5,100,0,1.15,5,1,0.68,0.5,10.5,100,0,1,1,10,1,0,0 +if $18==1 deblur ${19-23} c 0,255 fi +Lylejk_Quantize_Wicker_preview : +gui_split_preview "Lylejk_Quantize_Wicker $*",$-1 +Lylejk_Ribbon: +Largeur_Origine={w} +Hauteur_Origine={h} +if $36==1||$36==2 +split_opacity +scale_dcci2x ${37-39} +append c +cut 0,255 +fi +repeat $11 +smooth $1,$2,$3,$4,$5,$6,$7,$8,$9,$10 +done +fx_diffusiontensors $12,$13,$14,$15,$16,$17,$18,$19 +repeat $30 +smooth $20,$21,$22,$23,$24,$25,$26,$27,$28,$29 +done +blur $31 +gradient_norm ^ $32 +cut $33%,$34% +if $35 +negate +fi +normalize 0,255 +if $36==2 +resize $Largeur_Origine,$Hauteur_Origine +c 0,255 +fi +Lylejk_Ribbon_preview : +gui_split_preview "Lylejk_Ribbon $*",$-1 +lylejk_test_TRW : +if $3==0 shift $1%,$2%,0,0,2,1 fi +fx_superpixels $4,$5,$6,$7,$8,1,$9,$10,$11,$12 +if $3==1 shift $1%,$2%,0,0,2,1 fi +if !$16 to_a fi +euclidean2polar $13%,$14%,$15,$16 +fx_superpixels $4,$5,$6,$7,$8,1,$9,$10,$11,$12 +if !$16 to_a fi +polar2euclidean $13%,$14%,$15,$16 +shift {-$1}%,{-$2}%,0,0,2,1 +resize {w/2},{h/2} +c 0,255 +Lylejk_Wicker $17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$53 +lylejk_test_TRW_preview : +gui_split_preview "lylejk_test_TRW $*",$-1 +Lylejk_Wicker : skip ${33=0},${34=1},${35=10},${36=1},${37=0} +if $33 +apply_channels "repeat $34 b $36 unsharp $36,$35 c 0,255 mv[-1] 0 done",$37,0 +fi +rodilius $1,$2,$3,5,30,1 +smooth 10,0,1,1,1,0.8,45 +sharpen 30 +cut 0,255 +repeat $14 +smooth $4,$5,$6,$7,$8,$9,$10,$11,$12,$13 +done +blur $15 +gradient_norm ^ $16 +cut $17%,$18% +if $19 +negate +fi +normalize 0,255 +blur $20 +gradient_norm ^ $21 +cut $22%,$23% +if $24 +negate +fi +normalize 0,255 +split_opacity +scale_dcci2x ${25-27} +append c +cut 0,255 +blur $28 +gradient_norm ^ $29 +cut $30%,$31% +if $32 +negate +fi +normalize 0,255 +Lylejk_Wicker_preview : skip ${33=0},${34=1},${35=10},${36=1},${37=0} +gui_split_preview "Lylejk_Wicker $*",$-1 +Lylejk_Woven : +if $48==1 quantize $49,1,1 fi +if $46 blur $47 fi +ripple $1,$2,$3,$4,$5 +ripple $6,$7,$8,$9,$10 +fx_superpixels $11,$12,$13,1,$14,$15,$16,$17,$18,$19 +mirror x +ripple $20,$21,$22,$23,$24 +mirror x +mirror x +ripple $25,$26,$27,$28,$29 +mirror x +repeat $40 +smooth $30,$31,$32,$33,$34,$35,$36,$37,$38,$39 +done +blur $41 +gradient_norm ^ $42 +cut $43%,$44% +if $45 +negate +fi +normalize 0,255 +Lylejk_Woven_preview : +gui_split_preview "Lylejk_Woven $*",$-1 +fx_lylejk_stencil : +apply_channels "repeat $1 b $3 unsharp $3,$2 c 0,255 mv. 0 done",$4,0 +Lylejk_Wicker_2 : +if $33==2 i [-1] i [-1] fi +if $54==1 quantize[-1] $55,1,1 fi +if $3==1 +shift[-1] $1%,$2%,0,0,2,1 +if $56==1 if !$7 to_a[-1] fi euclidean2polar[-1] $4%,$5%,$6,$7 fi +fx_superpixels[-1] $8,$9,$10,$11,$12,1,$13,$14,$15,$16 +fi +if $3==0 +if $56==1 if !$7 to_a[-1] fi euclidean2polar[-1] $4%,$5%,$6,$7 fi +fx_superpixels[-1] $8,$9,$10,$11,$12,1,$13,$14,$15,$16 +fi +if $56==1 if !$7 to_a[-1] fi polar2euclidean[-1] $4%,$5%,$6,$7 fi +if $3==1 shift[-1] {-$1}%,{-$2}%,0,0,2,1 fi +repeat $27 +smooth[-1] $17,$18,$19,$20,$21,$22,$23,$24,$25,$26 +done +blur[-1] $28 +gradient_norm[-1] ^[-1] $29 +cut[-1] $30%,$31% +if $32 +negate[-1] +fi +normalize[-1] 0,255 +if $33==1 +deblur[-1] ${34-38} c[-1] 0,255 +elif $33==2 +repeat $41 bilateral[-2] $39,$40 done +samj_blend_20220419[-2,-3] grainextract +repeat $52 +smooth[-2] $42,$43,$44,$45,$46,$47,$48,$49,$50,$51 +done +samj_blend_20220419[-1,-2] grainmerge,$53,1 +fi +Lylejk_Wicker_2_preview : +gui_split_preview "Lylejk_Wicker_2 $*",$-1 +garagecoder_lylejk_samj_points_outlines : +Choice_Filter=$1 +Less_Than_Staroutline=$2 +Shapecloud_Staroutline=$3 +Less_Than_Pointoutline=$4 +Determination_Contours=$5 +Type_Rendu=$6 +Dilatation={2+$7} +if $Choice_Filter==0 +normalize[-1] 0,255 +blur[-1] 2 +isophotes[-1] 6 +100%,100%,1,1 +noise[-1] 0.5,1 +lt[-1] {$Less_Than_Staroutline-0.5} +mul[-1,-2] +shape_star , +garagecoder_example_shapecloud[-2] [-1],$Shapecloud_Staroutline +rm[-1] +elif $Choice_Filter==1 +normalize[-1] 0,255 +blur[-1] 2 +isophotes[-1] 6 +100%,100%,1,1 +noise[-1] 0.5,1 +lt. {$Less_Than_Pointoutline-0.5} +mul[-1,-2] +_circle 5 +dilate[-2] [-1] +rm. +elif $Choice_Filter==2 +if $Determination_Contours==0 +blur[-1] 2 +isophotes[-1] 6 +elif $Determination_Contours==1 +n[-1] 128,255 +to_pseudogray[-1] 5,1,8 +blur[-1] 2 +isophotes[-1] 6 +elif $Determination_Contours==2 +tones[-1] 3 +isophotes[-1,-2] 3 +samj_blend_20220419[-1,-2] alpha +samj_blend_20220419[-1,-2] alpha +mul[-1] 255 +isophotes[-1] 3 +fi +{w},{h},1,4 +repeat (w+h)/1.5 +line[-2] 50%,50%,{u(100)}%,{u(100)}%,1,0,0,0,0 +done +repeat (w+h)/2 +line[-1] {u(100)}%,{u(100)}%,{u(100)}%,{u(100)}%,1,255,255,255,255 +done +repeat (w+h)/5 +point {u(100)}%,{u(100)}%,0,1,255,255,255,255 +done +and[-1,-2] +if $Type_Rendu==0 +dilate_circ[-1] $Dilatation +elif $Type_Rendu==1 +i [-1] +i [-1] +dilate_circ[-3] $Dilatation +dilate[-2] 6,1 +dilate[-1] 1,6 +samj_blend_20220419[-1,-2,-3] alpha +elif $Type_Rendu==2 +dilate_circ[-1] $Dilatation +sponge[-1] 5 +fi +fi +garagecoder_lylejk_samj_points_outlines_preview : +gui_split_preview "garagecoder_lylejk_samj_points_outlines $*",$-1 +garagecoder_example_shapecloud : check ${"is_image_arg $1"}" && isnum(${2=9})" +repeat $! pass$1 0 l[$>,-1] +kw={$2+1-$2%2} r. $kw,$kw,1,1,5 n. 0,1 ++gt[0,1] 0 convolve[-2] [-1] rm. +convolve[0] [1] rm[1] +eq. 0 +[-2,-1] / +done done +mc_film_grain : +__mc_film_grain 0,{max(w,h)},{min(w,h)},$"*" + +mc_film_grain_preview : +long_side={max(w,h)} +short_side={min(w,h)} +gui_crop_preview +__mc_film_grain 1,$long_side,$short_side,$"*" +__mc_film_grain_usage : +msg.="1.Load a grain pattern file with sample grain to be added to an image\n" +msg.="2.A grain file can be either a crop (usually 1000x1000 px) of a digitised 24Mp\n" +msg.=" 35mm film frame, or the whole full 35mm frame digitised at any resolution\n" +msg.=" if the file is at least 6Mp (3000x2000 px).\n" +msg.="3.Select desired blend options (tip: grain merge usually gives better results).\n" +msg.="4.Select grain size options:\n" +msg.="- \"Film Format\" may shrink or enlarge the grain to better emulate the look of\n" +msg.=" film grain at the chosen format\n" +msg.="- \"Scale\" allows further tuning of grain size on top of the selected Film Format.\n" +msg.="- \"Micrograin\" attempts to add a little bit of small-sized grain to the mix for\n" +msg.=" better-looking texture at larger grain sizes.\n" +msg.="5.Change grain appearance to taste by altering the grain sharpness, contrast \n" +msg.=" and gamma.\n" +msg.="6.Normalisation will fit the grain pixel values between a range of low and high\n" +msg.=" values. This affects the grain blending result, and can be used to bring more\n" +msg.=" grain into the highlights, change the overal blending effect, etc.\n" +msg.="7.Adjust a couple of properties of the input image:\n" +msg.="- \"Blur/Sharpen\" can affect the interplay of image details and the applied grain.\n" +msg.=" Film grain may sometimes look more natural when applied to a softer image.\n" +msg.="- \"Highlight Compression\" will bring down the highlights, including blown-out\n" +msg.=" areas, making some more grain visible in the highlights.\n" +msg.="8.You can enable the preview of the grain alone to better assess the effect of\n" +msg.=" the above filter parameters on the grain.\n" +msg.="\n" + +msg.="$1" + +gui_print_preview "Usage:",,$msg + +__mc_film_grain : + +is_preview,img_long_side,img_short_side,grain_file_path,texture_type,blend_mode_opt,blend_opacity,film_fmt_opt,\ +scale_pct,micrograin,gr_sharpness,gr_contrast,gr_gamma,gr_norm_opt,gr_norm_low,gr_norm_high,img_sharpness,img_highl_compress,\ +preview_opt,show_usage=$"*" + +print_debug={$preview_opt>1} +preview_grain={{$preview_opt==1}||{$preview_opt==3}} + +blend_modes=alpha,grainmerge,overlay,softlight,hardlight,alpha + +local { +input $grain_file_path +normalize. 0,255 +onfail +if $is_preview +__mc_film_grain_usage "(Error loading grain pattern file)" +fi +return +} +if "$is_preview && $show_usage" +__mc_film_grain_usage "(Click anywhere to dismiss usage tips...)" +return +fi + +debug_msg.="Image size: "{$img_long_side}"x"{$img_short_side}" ("{f2ui($img_long_side*$img_short_side/1000000)}"Mp)\n" +debug_msg.="Preview size: "{$_preview_width}"x"{$_preview_height}"\n" +debug_msg.="Grain sample file: "$grain_file_path"\n" + +aspect={$img_long_side/$img_short_side} +if $film_fmt_opt==1 scale_pct/=0.75 +elif $film_fmt_opt==2 scale_pct/=0.54 +elif $film_fmt_opt==3 +if "$aspect<1.355 && $aspect>1.34" +scale_pct/=1.77 +else +scale_pct/=2.33 +fi +elif $film_fmt_opt==4 +if $aspect>=3 +scale_pct/=0.3958 +else +scale_pct/=0.6958 +fi +fi +ref_frame_long=6000 +ref_frame_short=4000 +if "max(w,h) > 3000 && min(w,h) > 2000" +ref_frame_long={max(w,h)} +ref_frame_short={min(w,h)} +debug_msg.="Grain file as: Full-Frame\n" +crop. {w/2-500},{h/2-500},{w/2+499},{h/2+499} +else +debug_msg.="Grain file as: Crop\n" +fi +debug_msg.="Grain full-frame size: "{$ref_frame_long}"x"{$ref_frame_short}" ("{f2ui($ref_frame_long*$ref_frame_short/1000000)}"Mp)\n" +debug_msg.="Grain patch size: "{-1,w}"x"{-1,h}"\n" + +foreach[^-1] { +split_opacity +pass. 0 +total_scale_pct={_$scale_pct*$img_short_side/$ref_frame_short} +resize2dx. {w*$total_scale_pct/100.0},5 +debug_msg.="Total grain scaling: "{f2ui($total_scale_pct)}"%\n" +debug_msg.="Scaled grain patch size: "{-1,w}"x"{-1,h}"\n" +if "$total_scale_pct>66 && $micrograin" +debug_msg.="Micrograin: enabled (intensity="{$micrograin}")" ++resize2dx. {w/3},5 +syntexturize. {-2,w},{-2,h} +blend[-1,-2] overlay,{0.2+0.8*$micrograin/10} +fi +if $texture_type==0 ++syntexturize. {0,max(10,w)},{0,max(10,h)} +else ++syntexturize_matchpatch. {0,max(10,w)},{0,max(10,h)} +fi +if $gr_sharpness>0 +sharpen. {$gr_sharpness*10},1 +elif $gr_sharpness<0 +blur. {-1*$gr_sharpness/4} +fi +adjust_colors. 0,$gr_contrast,$gr_gamma,0,0 c. 0,255 +if $gr_norm_opt==1 +normalize. $gr_norm_low,$gr_norm_high +elif $gr_norm_opt==2 +cut. $gr_norm_low,$gr_norm_high +fi +resize {0,w},{0,h},1,100%,5 c. 0,255 +if "$preview_grain && $is_preview" +keep[0,-1] +reverse +else +if $img_sharpness>0 +sharpen[0] {$img_sharpness*10} +elif $img_sharpness<0 +blur[0] {-1*$img_sharpness/5} +fi +if $img_highl_compress +apply_curve[0] 0.4,0,0,192,{192-3*$img_highl_compress/4},255,{255-3*$img_highl_compress} +fi + +blend[0,-1] ${arg\ {$blend_mode_opt+1},$blend_modes},{if($blend_mode_opt>0,$blend_opacity/100,1)} +if $img_highl_compress +apply_curve[0] 0.4,0,0,192,{192+2*$img_highl_compress/4},255,{255+2*$img_highl_compress} +fi +fi +if "$is_preview && $print_debug" +text_outline $debug_msg,2,2,20,2,1,255,255,0 +fi + +append[^-1] c +remove. +} +remove. +fx_hue_overlay_masks : +100%,100%,1,1,"R#0/2-(G#0+B#0)/4+128" +100%,100%,1,1,"G#0/2-(R#0+B#0)/4+128" +100%,100%,1,1,"B#0/2-(R#0+G#0)/4+128" +=>... "name(Red), mode(overlay)" +=>.. "name(Green),mode(overlay)" +=>. "name(Blue),mode(overlay)" +if $1==1 +if iM#1-128>128-im#1 +f[1] '(i-128)/abs(iM-128)*128+128' +else +f[1] '(i-128)/abs(im-128)*128+128' +fi +if iM#2-128>128-im#2 +f[2] '(i-128)/abs(iM-128)*128+128' +else +f[2] '(i-128)/abs(im-128)*128+128' +fi +if iM#3-128>128-im#3 +f[3] '(i-128)/abs(iM-128)*128+128' +else +f[3] '(i-128)/abs(im-128)*128+128' +fi +fi +move[1] 0 +move[2] 1 +move[3] 2 +fx_hue_overlay_masks_preview : +fx_hue_overlay_masks $* +r2dx 50% to[0] "Red" to[1] "Green" to[2] "Blue" to[3] "Original" +to_rgba frame 1,1,0,0,0,255 frame 3,3,255 append_tiles , +fx_AbstractFlood : +Prep=$1 +SpatialVariance=$2 +ValueVariance=$3 +Iterations=$4 +ActivateFlood=$5 +Repeats=$6 +Tolerance=$7 +FloodBaseStep=$8 +CanvasR=$9 +CanvasG=$10 +CanvasB=$11 +Opacity=$12 +ActivateCubism=$13 +CubismIterations=$14 +Blocsize=$15 +Angle=$16 +CubismOpacity=$17 +Smoothness=$18 +StepThreshold={$19+0.1} +Step=$FloodBaseStep +Delta=1 +DeltaOrg=$Delta +to_rgba[0] +if $Prep==1 +fx_smooth_bilateral[0] $SpatialVariance,$ValueVariance,$Iterations,0,0 +fi +({$CanvasR}^{$CanvasG}^{$CanvasB}^0) +to_rgba[1] +ri[1] [0] +X={(w)/2} +Y={(h)/2} +ImageH={(h)} +ImageW={(w)} +DoLoop=0 +IsGood=0 +if $ActivateFlood==1 +repeat $Repeats +flood[0] {100*$X/w}%,{100*$Y/h}%,0,$Tolerance,0,1,{0,i($X,$Y,0,0)},{0,i($X,$Y,0,1)},{0,i($X,$Y,0,2)},{0,i($X,$Y,0,3)} ++fx_select_color[0] 0,1,0,{0,i($X,$Y,0,0)},{0,i($X,$Y,0,1)},{0,i($X,$Y,0,2)},{0,i($X,$Y,0,3)},0,0 +if $ActivateCubism==1 +cubism[2] $CubismIterations,$Blocsize,$Angle,$CubismOpacity,$Smoothness +fi +blend[1,2] alpha +do +Rstep={$Step+$Delta} +theta={u(360)} +Xnew={int($X+$Rstep*cos($theta))} +Ynew={int($Y+$Rstep*sin($theta))} +if $Xnew>0" && "$Xnew<$ImageW" && "$Ynew>0" && "$Ynew<$ImageH +X=$Xnew +Y=$Ynew +if {1,i($X,$Y,0,3)>$StepThreshold} +Delta={min({$Delta+$Delta*2},{max($ImageW,$ImageH)/5})} +fi +if {1,i($X,$Y,0,3)<$StepThreshold} +IsGood=10 +fi +if $DoLoop>100 +IsGood=10 +fi +fi +DoLoop=$DoLoop+1 +while $IsGood<1 +IsGood=0 +DoLoop=0 +Delta=$DeltaOrg +done +fi +({$CanvasR}^{$CanvasG}^{$CanvasB}^{$Opacity}) +ri[2] [0] +rv[1,2] +blend[1,2] alpha +if $ActivateFlood==1 +k[1] +elif $ActivateFlood==0 +k[0] +fi +fx_AbstractFlood_Preview : +gui_split_preview "fx_AbstractFlood ${1--2}",$-1 +fx_bwfilmsimulate : +Choice=$1 +P1=$2 +P2=$3 +P3=$4 +P4=$5 +P5=$6 +P6=$7 +P7=$8 +P8=$9 +P9=$10 +P10=$11 +P11=$12 +P12=$13 +P13=$14 +P14=$15 +P15=$16 +P16=$17 +P17=$18 +P18=$19 +P19=$20 +P20=$21 +if $Choice==1 P1={18/255} P3={41/255} P5={41/255} fi +if $Choice==2 P1={25/255} P3={39/255} P5={36/255} fi +if $Choice==3 P1={21/255} P3={40/255} P5={39/255} fi +if $Choice==4 P1={20/255} P3={41/255} P5={39/255} fi +if $Choice==5 P1={21/255} P3={42/255} P5={37/255} fi +if $Choice==6 P1={22/255} P3={42/255} P5={36/255} fi +if $Choice==7 P1={31/255} P3={36/255} P5={33/255} fi +if $Choice==8 P1={28/255} P3={41/255} P5={31/255} fi +if $Choice==9 P1={23/255} P3={37/255} P5={40/255} fi +if $Choice==10 P1={33/255} P3={36/255} P5={31/255} fi +if $Choice==11 P1={36/255} P3={31/255} P5={33/255} fi +if $Choice==12 P1={21/255} P3={42/255} P5={37/255} fi +if $Choice==13 P1={24/255} P3={37/255} P5={39/255} fi +if $Choice==14 P1={37/255} P3={36/255} P5={37/255} fi +if $Choice==15 P1={25/255} P3={35/255} P5={40/255} fi +repeat $! +l. split_opacity rv to_rgb. s. c +*... $P1 b... $P2% +*.. $P3 b.. $P4% +*. $P5 b. $P6% ++[-3--1] /. {$P1+$P3+$P5} c. 0,255 +apply_gamma. $P7 +-. 128 *. $P8 +. 128 +. $P9 c. 0,255 +100%,100% .x2 +noise... 100,$P17 b... $P16% n... -$P12,$P12 +noise.. 100,$P17 b.. $P16% n.. -$P13,$P13 +noise. 100,$P17 b. $P16% n. -$P14,$P14 ++tones[-4] 3 b[-3--1] $P15% +*[-6,-3] *[-4,-2] *[-2,-1] ++[-4--1] c. 0,255 +if $P10" || "$P11 +/. 255 +i.. 100%,100%,1,1,$P11 +i... 100%,100%,1,1,$P10 +a[-3--1] c hsv2rgb. +fi +rv a c done mv. 0 done +normalize_local $P18,$P19,$P20,2%,1,0,255 +fx_bwfilmsimulate_preview : +gui_split_preview "fx_bwfilmsimulate ${1--2}",$-1 +fx_blockism: +XSize={int($1/100*w)} +if $XSize==0 XSize=1 fi +Ratio=$2 +Variance={int($3*$XSize)} +Randomness=-1,1 +Repeats={int($4/100*max(w,h))} +Opacity=$5 +FlipTol=$6 +ReverseFlip=$7 +LAB=1-$8 +YSize={int($Ratio*$XSize)} +MaxXSize={int($XSize+$Variance)} +MaxYSize={int($MaxXSize*$Ratio)} +to_rgb[0] +if $LAB +rgb2lab[0] +s[0] c +fi +repeat $! +. +repeat $Repeats +X={int(u(-1,w))} +Y={int(u(-1,h))} +if $ReverseFlip==0 +if i($X,$Y,0,0)>$FlipTol +BW={int(abs($XSize+($MaxXSize-$XSize)*(u($Randomness))))} +BH={int(abs($YSize+($MaxYSize-$YSize)*(u($Randomness))))} +fi +if i($X,$Y,0,0)<=$FlipTol +BH={int(abs($XSize+($MaxXSize-$XSize)*(u($Randomness))))} +BW={int(abs($YSize+($MaxYSize-$YSize)*(u($Randomness))))} +fi +fi +if $ReverseFlip==1 +if i($X,$Y,0,0)<$FlipTol +BW={int(abs($XSize+($MaxXSize-$XSize)*(u($Randomness))))} +BH={int(abs($YSize+($MaxYSize-$YSize)*(u($Randomness))))} +fi +if i($X,$Y,0,0)>=$FlipTol +BH={int(abs($XSize+($MaxXSize-$XSize)*(u($Randomness))))} +BW={int(abs($YSize+($MaxYSize-$YSize)*(u($Randomness))))} +fi +fi +x0={int($X-$BW/2)} +y0={int($Y-$BH/2)} +x1={int($x0+$BW)} +y1={int($y0+$BH)} +rectangle.. $x0,$y0,$x1,$y1,$Opacity,{i($X,$Y,0,0)},{i($X,$Y,0,1)},{i($X,$Y,0,2)},{i($X,$Y,0,3)} +done +rm. +mv. 0 +done +if $LAB +a[-3,-2,-1] c +lab2rgb. +fi +fx_blockism_preview : +gui_split_preview "fx_blockism $1,$2,$3,{$4*10},$5,$6,$7,$8",$-1 +sub_thumbnailabstraction : +to_rgb[0] +IWidth={0,w} +IHeight={0,w} +if $IWidth>=$IHeight +ScaleByWidth=1 +fi +if $ScaleByWidth==1 ++resize2dx[0] 200,5 +b. 2 +resize2dx. 1024,5 +fx_segment_watershed. 0.5,5,0,0 +elif ++resize2dy[0] 200,5 +b. 2 +resize2dy. 1024,5 +fx_segment_watershed. 0.5,5,0,0 +fi +resize. [0] ++rgb2lab[0] +s. c +rm[-1,-2] +b. 10% +n. 0,255 +blend[-1,-2] hardlight,1,1 +k. +sub_colors_and_lines : +image_width={0,w} +image_height={0,h} +resize2dx 1024 +luminance[0] +n 0,255 +to_rgb[0] +fx_smooth_bilateral[0] 2,15,2,0,0,24,0 +fx_colormap[0] 0,0,3,3,0,0,0,255,255,255,255,0,0,0,255,0,0,0,255,255,255,0,255,0,255,0,255,255,0 ++fx_smooth_anisotropic[0] 300,0.1,1,0,10,1,1,1,0,1,1,0,0,24,0 +fx_gradient_norm. 0,0.5,0,100,1,0 +blend[0,1] multiply,1 +resize. $image_width,$image_height,1,3,5,1 +fx_CompositionAnalysis : +method=$1 +if $method==0 sub_thumbnailabstraction fi +if $method==1 sub_colors_and_lines fi +fx_dodgesketch: +to_rgb[0] +Power=$1 +SpatialVariance=$2 +ValueVariance=$3 +Iterations=$4 +Colored=$5 ++fx_mix_hsv[0] 1,0,0,0,-1,0,1,0,0,0,2,0 ++fx_smooth_bilateral. $SpatialVariance,$ValueVariance,$Iterations,0,0 +negate. +blend[-1,-2] alpha,0.5,0 +. ++blend[-1,-2] dodge,1,0 +k[0,-1] +repeat $Power +. +blend[-1,-2] multiply +done +if $Colored==1 ++blend[-1,-2] hardlight +rm.. +fx_transfer_colors[-1,-2] 0,0 +fi +k. +fx_dodgesketchpreview : +gui_split_preview "fx_dodgesketch ${1--2}",$-1 +Sub_Contrast_Bias: +/. 255 +to_gray. +laplacian. +abs. +Sub_Saturation_Bias: +/. 255 ++s[0] c +blend[-1,-2,-3] average +s[0] c ++-[0] [1] +rm[1] ++-[0] [1] +rm[1] ++-[0] [1] +rm[1] +rm[0] +^[0] 2 +^[1] 2 +^[2] 2 ++[1] [2] +rm[2] ++[0] [1] +rm[1] +/[0] 3 +sqrt[0] +Sub_Exposure_Bias : +/[0] 255 +-[0] 0.5 +^[0] 2 +/[0] {2*$1*$1} +*[0] -1 +exp[0] +s[0] c +*[0] [2] +rm[2] +*[0] [1] +rm[1] +Sub_BlurPyramid : +size={0,min(w,h)} +levels={round(log($size)/log(5))} +Deviation=1 +b[0] $Deviation,1,1 +repeat $levels-1 ++resize. 50%,50%,5,1 +b. $Deviation,1,1 +done +blndalpha=0.5 +repeat $levels-1 +index={-($<+1)} +resize[$index] [0],5,1 +blend[0,$index] alpha,$blndalpha,0 +blndalpha={$blndalpha/2} +done +fx_ExposureWeightMap : +wc=$1 +ws=$2 +sigma=$3 +we=$4 +BlurMap=$5 +to_rgb[0] ++Sub_Contrast_Bias[0] ++Sub_Saturation_Bias[0] ++Sub_Exposure_Bias[0] $sigma +rm[0] +^[0] $wc +^[1] $ws +^[2] $we ++[0] [1] ++[0] [2] +k[0] +n[0] 0,255 +if $BlurMap==1 +sub_BlurPyramid[0] +fi +fx_ExposureWeightMapPreview : +gui_split_preview "fx_ExposureWeightMap ${1--2}",$-1 +fx_StructureTensors: +structuretensors abs ^ $1 +n 0,255 +fx_StructureTensorsPreview : +gui_split_preview "fx_StructureTensors ${1--2}",$-1 +fx_import_image_16 : +ProcessTo=$2 +Gamma=$3 +Brightness=$4 +Contrast=$5 +Equalize=$6 +AB=$7 +A=$8 +B=$9 +CutHigh=$10 +CutLow=$11 +rm i +"$1" +to_rgb +if $ProcessTo!=3 +resize2dx 520,1 +fi +apply_gamma $Gamma +if {0,iM>256} +if $Equalize ++equalize 65535 +blend alpha,{$Equalize/2} +fi +/ 65535 +rgb2lab +s c +if $Brightness ++... $Brightness +fi +if $Contrast!=1 +*... $Contrast +fi +if $AB +*.. $AB +*. $AB +fi +if $A +*.. {1+$A} +fi +if $B +*. {1+$B} +fi +a c +lab2rgb +if $CutHigh!=100" || "$CutLow!=0 +Range=1 +HighValue={$CutHigh/100*$Range} +LowValue={$CutLow/100*$HighValue} +c $LowValue,$HighValue +n 0,1 +fi +* 255 +c 0,255 +if $ProcessTo==1 ++display_histogram {0,w},{0,h},255,0,254,0 +blend lighten,0.7 +fi +if $ProcessTo==2 ++display_histogram {0,w},{0,h},255,0,254,0,log(1+i)-1 +blend lighten,0.7 +fi +fi +intersect_images: ++lt[0] [1] +*. 255 ++lt[1] [0] +*. 255 +-[0] . +-[1] .. +rm[-1,-2] +c[0] 0,255 +c[1] 0,255 ++[0] [1] +rm[1] +create_base_levels: +Levels=$1 +repeat $Levels-1 ++*[2] {$>+1} ++-[1] . +rm.. +c. 0,255 +done +repeat $Levels-1 ++*[1] {$>+1} ++-[2] . +rm.. +c. 0,255 +done +reorder_stack : +Levels=$1 +mv[3] 1 +if $Levels>1 +rv[2,3] +mv[2] {-$Levels+1} +fi +reduce_overlap : +Levels=$1 +repeat $Levels-1 +-[{2+$>}] [{3+$>}] +c[{2+$>}] 0,255 +done +repeat $Levels-1 +-[{-$Levels+$>}] [{-$Levels+$>+1}] +c[{-$Levels+$>}] 0,255 +done +-[1] [{-$Levels-1}] +-[1] . +c[1] 0,255 +fx_split_luminance: +Levels=$1 +AlphaOutput=$2 +ReduceOverlap=$3 +KeepCustom=$4 +KeepText=$5 +to_rgb ++rgb2lab +s. c +rm[-1,-2] +n. 0,255 ++negate. ++intersect_images[-1,-2] +if $ReduceOverlap==0 +n. 0,255 +fi +create_base_levels $Levels +reorder_stack $Levels +if $ReduceOverlap==1" && "$Levels>1 +reduce_overlap $Levels +fi +repeat $!-1 ++[{$>+1}] 1 +c[$>] 0,255 +done +if $AlphaOutput +repeat $!-1 ++a[0,1] c +rm[1] +done +fi +if $ReduceOverlap==1" && "$Levels>1 +rm[2] +fi +rm[0] +if $KeepCustom +$KeepText +fi +fx_OldSquiggly : ++fx_spread[0] $1,$1,0,0 +fx_segment_watershed[1] $2,$3,0,0 ++fx_gradient_norm[1] $4,$5,0,100,0,0 ++blend[2,1] multiply +fx_mix_ycbcr[3] 1,0,0,$6,0,0,$6,0,0,0,2,0 +fx_map_tones[0] $7,$8,0.1,30,0,0 +blend[0,3] darken +rm[1,2] ++fx_plasma 0.5,10,8,0 +fx_blackandwhite[1] 0.299,0,0.587,0,0.114,0,1,1,0,0,0,0,0,0,2,0,0,0,16,4,0,0,0 +fx_apply_curve[1] $9,-1,128,-1,128,-1,128,-1,128,-1,128,$10,1,3,0,0,0 +fx_apply_curve[0] 0,$11,128,-1,128,-1,128,-1,128,-1,128,255,1,3,0,0,0 +*[0] {0.5*(1+$12)} +*[1] {0.5*(1-$12)} +++[0] [1] ++blend[0,2] softlight +rm[0,1,2] +fx_MappedSmooth : +MapType=$1 +fi={$2*3.1415/180} +ZeroOffset=$3 +Amplitude=$4 +LMult=$5 +ShowQuiver=$6 +if $MapType==0 ++fx_local_orientation 0.5,0,100,0,4,0 +fi +cosfi={cos($fi)} +sinfi={sin($fi)} +to_rgb[-2,-1] +-. {128+$ZeroOffset} +s. c +*[3] 0 ++*[1] $cosfi ++*[2] $sinfi +-[4] [5] +rm[5] ++*[1] $sinfi ++*[2] $cosfi ++[5] [6] +rm[6] +rm[1,2] +rm[1] +100%,100%,100%,1,0 +a[1,2,3] c +/. {128/$LMult} +channels. 0,1 +if $ShowQuiver==0 +vector2tensor. +smooth.. .,$Amplitude +fi +if $ShowQuiver==1 +quiver.. .,10,{$Amplitude/20},1,0.8,255 +fi +rm. +fx_fix_HDR_black: +to_rgb[0] +X1=$1 +Y1=$2 +X2=$3 +Y2=$4 +ShowMask=$5 ++fx_smooth_bilateral. 4,8,6,4,0 +fx_smooth_haar. 0.6,5,2,3,1,24 ++rgb2lab. +s. c +rm[-1,-2] +fx_apply_curve. 0,$X1,$Y1,$X2,$Y2,-1,128,-1,128,-1,128,255,1,0,0,21,0 +if $ShowMask==0 +negate. +a[-2,-1] c +to_rgba. +blend[0,-1] alpha +k[0] +fi +fx_fix_HDR_black_preview : +gui_split_preview "fx_fix_HDR_black ${1--2}",$-1 +fx_noisepainting : +DegrLarge=$1 +DegrSmall=$2 +Channel=$3 +Abstr=$4 +Details=$5 +Color=$6 +Smooth=$7 +Sharp=$8 +to_rgb[0] +if $Channel Channel=3 else Channel=0 fi +if $PreProcess fx_segment_watershed $EdgeThresh,$WaterSmooth,0,0 fi +if $DegrLarge!=0 fx_spread $DegrLarge,$DegrLarge,0,0 fi +if $DegrSmall!=0 fx_noise $DegrSmall,2,$Channel,0,0 fi +fx_painting $Abstr,$Details,$Color,$Smooth,$Sharp,0 +fx_noisepainting_preview : +gui_split_preview "fx_noisepainting ${1--2}",$-1 +fx_SmoothSketch : +UsmRadius=5 +CreateSketch=$1 +UsmAmount=$1 +Sharpness=$2 +Anisotropy=$3 +SmScale=$4 +SmAccuracy={$5} +Amplitude=$6 +fi=$7 +Density=$8 +BlurLength=$9 +Style=$10 +BgOpacity=$11 +PostGamma=$12 +OptimizedResult=$13 +if $OptimizedResult +OriginalWidth={0,w} +resize2dx 1024 +fx_smooth_selective. 5,0.5,5,1,0,0,24,0 +fi +if $CreateSketch==1 +fx_unsharp. 0,$UsmRadius,30,$UsmAmount,0,1,1,1,0,0,0 ++gradient_norm. +negate. +n. 0,255 +fi +(255;255;255) +ri. .. +fx_noise. $Density,0,3,0,0 +if $Style==0 +fx_blur_linear. $BlurLength,0,135,500,1,3,0,0 +fi +if $Style==1 +fx_blur_angular. $BlurLength,1.2,1.2,0,0,0 +fi +if $Style==2 +fx_blur_linear. $BlurLength,0,135,500,1,3,0,0 +deform. {$Density/5} +fi +if $Style==3 +fx_blur_angular. $BlurLength,1.2,1.2,0,0,0 +deform. {$Density/5} +fi +blend[-1,-2] multiply,$BgOpacity,0 +n. 0,255 ++diffusiontensors[0] $Sharpness,$Anisotropy,0.6,1.1,0 +rotation3d 0,0,1,{$fi} +mix_channels.. ({@0-2};{@3-5};{@6-8}) +rm. +*. {$SmScale/max(abs(iM),abs(im))} +noise. {$SmAccuracy*max(abs(iM),abs(im))} +rv[-1,-2] +smooth. ..,$Amplitude +k. +apply_gamma. $PostGamma +if $OptimizedResult +resize2dx $OriginalWidth +fi +fx_SmoothSketch_preview : +gui_split_preview "fx_SmoothSketch ${1--2}",$-1 +fx_DemoVecRot : +angle=$1 +to_rgb[0] +[0] +to_rgb. +s. c +-.. 128 +-... 128 +a[-3,-2,-1] c +channels. 0,1 +/. 128 +rotation3d 0,0,1,$angle +z. 0,0,1,1 +mix_channels.. ({@0-1};{@2-3}) +rm. +quiver.. .,10,10,1,0.8,255 +k.. +fx_WarpTest : +MapType=$1 +fi={$2*3.1415/180} +ZeroOffset=$3 +LMult=$4 +ShowQuiver=$5 +if $MapType==0 ++fx_local_orientation 0.5,0,100,0,4,0 +fi +cosfi={cos($fi)} +sinfi={sin($fi)} +to_rgb[-2,-1] +-. {128+$ZeroOffset} +s. c +*[3] 0 ++*[1] $cosfi ++*[2] $sinfi +-[4] [5] +rm[5] ++*[1] $sinfi ++*[2] $cosfi ++[5] [6] +rm[6] +rm[1,2] +rm[1] +100%,100%,100%,1,0 +a[1,2,3] c +/. {128/$LMult} +channels. 0,1 +if $ShowQuiver==0 +warp.. .,1,1,0 +fi +if $ShowQuiver==1 +quiver.. .,10,{$LMult/100},1,0.8,255 +fi +rm. +fx_jobs_colors : +n 0,255 if $2 equalize 256 fi +luminance apply_gamma {10^$1} n 0,9 round +(22,187,20,36,235,240,245,243,247,209^18,97,147,157,79,110,121,142,170,200^19,158,192,60,67,65,64,64,64,185) +map[^-1] . rm. +fx_jobs_colors_preview : +gui_split_preview "fx_jobs_colors $*",$-1 +fx_steampen : +repeat $! l[$>] split_opacity l[0] +fx_pencilbw $1,$2,0,0,0 +fx_kuwahara $3,$4,0,0 +blur_xy $5 +if $6==1 fx_normalize_local 4.8,22,6.89,20,1,3,0 +elif $6==2 fx_contrast_swm 2,0,1 +elif $6==3 fx_contrast_swm 2,1,1 +elif $6==4 fx_map_tones_fast 3,0.5,3, fi +if $7==1 equalize 255 fi +if $8==1 fx_smooth_anisotropic 60,$9,$10,$11,1.1,0.8,30,2,0,1,1,0 fi +done a c done done +fx_steampen_preview : +gui_split_preview "fx_steampen ${1--2}",$-1 +fx_compose_boostscreen : +repeat $! l[$>] +fx_compose_screen $1,$2 . fx_compose_grainmerge $3,0 +done done +fx_compose_colordoping : +reverse fx_compose_lightness 1,$2 [^] fx_compose_multiply $1,0 +fx_colorsketchbw : ++b $3 hardsketchbw. $1,$2,$4,$5,$6 +if $7 negate. fi +quantize.. $8 to_rgb blur_xy.. $9,$9 +if $10==0 fx_compose_colordoping $11,0 +elif $10==1 fx_compose_darken $11,0 +elif $10==2 fx_compose_hardlight $11,1 +elif $10==3 fx_compose_grainmerge $11,1 +elif $10==4 fx_compose_lightness $11,1 +elif $10==5 fx_compose_multiply $11,0 +elif $10==6 fx_compose_value $11,1 fi +fx_colorsketchbw_preview : +gui_split_preview "fx_colorsketchbw ${1--2}",$-1 +fx_colorstamp : +repeat $! l[$>] split_opacity l[0] ++norm +if $1 otsu. 256 else threshold. $2% fi +n. 0,255 +apply_curve. 1,0,0,101,33,170,229,255,255 +if $3==1 quantize.. $4 to_rgb blur_xy.. $5 +fx_compose_darken 1,0 fi +done a c done done +fx_colorstamp_preview : +gui_split_preview "fx_colorstamp ${1--2}",$-1 +fx_compose_comix_color : +rv fx_compose_lightness $1,$2 [^] fx_compose_grainmerge $3,0 +fx_compose_darkedges : +fx_compose_edges $1,$2,$3 [^] fx_compose_multiply $4,0 +fx_compose_darkscreen : +repeat $! l[$>] +fx_compose_screen $1,$2 . fx_compose_multiply $3,0 +done done +fx_graphic_boost : +repeat $! l[$>] split_opacity l[0] +fx_unsharp 1,$1,30,3,0,$2,0.40,1,0,0,0 +if $3==1 break fi ++fx_pencilbw $4,$5,0,0,0 +if $6==1 k. break fi +if $7==1 fx_smooth_anisotropic[1] 60,$8,$9,$10,1.1,0.8,30,2,0,1,1,0 fi +if $11==1 k. break fi +if $12==1 reverse fi +if $13==0 fx_compose_hardlight $14 +elif $13==1 fx_compose_grainmerge $14 +elif $13==2 fx_compose_multiply $14 +elif $13==3 fx_compose_colorburn $14 +elif $13==4 fx_compose_overlay $14 +elif $13==5 fx_compose_value $14,0 +elif $13==6 fx_compose_darken $14 +elif $13==7 fx_compose_stamp $14 fi +if $15==1 fx_smooth_anisotropic 60,$16,$17,$18,1.1,0.8,30,2,0,1,1,0 fi +done a c done done +fx_graphic_boost_preview : +gui_split_preview "fx_graphic_boost ${1--2}",$-1 +fx_compose_graphicolor : +reverse +fx_compose_luminance $1,$2, rm.. fx_compose_softlight $3,0 +fx_novelfx : +repeat $! l[$>] split_opacity l[0] +if $1==0 fx_normalize_local $2,$3,$4,$5,1,3,0 fi +if $6==0 +fx_pencilbw $7,$8,0,0,0 fi +if $9==1 k. break fi +if $10==1 fx_smooth_anisotropic. 60,$11,$12,$13,1.1,0.8,30,2,0,1,1,0 fi +if $14==1 k. break fi +if $15==1 reverse fi +if $16==0 fx_compose_overlay[-1,0] $17 +elif $16==1 fx_compose_multiply[-1,0] $17 +elif $16==2 fx_compose_softlight[-1,0] $17 +elif $16==3 fx_compose_colorburn[-1,0] $17 +elif $16==4 fx_compose_darken[-1,0] $17 +elif $16==5 fx_compose_stamp[-1,0] $17 +elif $16==6 fx_compose_hardlight[-1,0] $17 +elif $16==7 reverse[1,0] fx_compose_value[-1,0] $17,0 +elif $16==8 fx_compose_grainmerge[-1,0] $17 +elif $16==8 fx_compose_freeze[-1,0] $17 fi +if $18==1 fx_smooth_anisotropic 60,$19,$20,$21,1.1,0.8,30,2,0,1,1,0 fi +done a c done done +fx_novelfx_preview : +gui_split_preview "fx_novelfx ${1--2}",$-1 +fx_compose_graphixcolor : +reverse +fx_compose_value 1,$2 k[-1,-3] fx_compose_grainmerge $1,0 +fx_compose_heavyscreen : +repeat $! l[$>] +fx_compose_screen $1,$2 . fx_compose_colorburn $3,0 +done done +fx_metalgrain : ++Couleurs_Metalliques 1,1,19.86,0,0,0,7.4,11,3.96,20,1,0,0,1,1.9,10.2,1,0,0 +fx_compose_overlay $1,$2 +fx_metalgrain_preview : +gui_split_preview "fx_metalgrain ${1--2}",$-1 +fx_metallicstencils : ++Couleurs_Metalliques 0,1,22,0,0,1,7.8,9,7.6,16.6,1,0,0,1,2.4,8.2,1,0 ++fx_lylejk_stencil[0] 4,26.7045,2.41477,0 +rm[0] +if $1==0 fx_compose_darken 1,0 +elif $1==1 fx_compose_lighten 1,0 +elif $1==2 fx_compose_overlay 1,0 fi +fx_metallicstencils_preview : +gui_split_preview "fx_metallicstencils ${1--2}",$-1 +compose_average : +e[^-1] "Compose image$? two-by-two, using average mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 + +done done / 2 +compose_colorburn : +e[^-1] "Compose image$? two-by-two, using colorburn mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 -.. 255 +. 0.1 / +done done * 256 + 255 c 0,255 +compose_darken : +e[^-1] "Compose image$? two-by-two, using darken mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 min +done done +compose_difference : +e[^-1] "Compose image$? two-by-two, using difference mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 - +done done abs +compose_divide : +e[^-1] "Compose image$? two-by-two, using divide mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 *.. 256 +. 1 / +done done c 0,255 +compose_dodge : +e[^-1] "Compose image$? two-by-two, using dodge mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 -. 255.1 / +done done * -256 c 0,255 +compose_edges : check {$1>=0} +e[^-1] "Compose image$? using edge mode, with smoothness $1." +if $!>1 - to_rgb r[^0] {0,[w,h,d,s]},0,0,0.5,0.5 repeat $! l[$>] ++gradient_norm +. 1 b. $1 n. 1,10 sqr. s.. c *[-4--2] . a[-4--1] c +done done r[^0] {0,[w,h,d,s]},0,0,0.5,0.5 + s. c /[-4--2] . rm. a[-3--1] c fi +compose_exclusion : +e[^-1] "Compose image$? two-by-two, using exclusion mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 +*.. . /. -128 + +done done +compose_fade : +e[^-1] "Compose image$? using fading mode." +r[^0] ${-max_whd},100%,3 +r[1--2] 100%,100%,100%,${-max_s} channels. 0 +repeat $!-1 +-. $> abs. -. 1 *. -1 max. 0 *[$>,-1] done +rm. + +compose_freeze : +e[^-1] "Compose image$? two-by-two, using freeze mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 -.. 255 sqr.. +. 0.1 / +done done - 255 * -1 c 0,255 +compose_grainextract : +e[^-1] "Compose image$? two-by-two, using grain extract mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 - +done done + 128 c 0,255 +compose_grainmerge : +e[^-1] "Compose image$? two-by-two, using grain merge mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 + +done done - 128 c 0,255 +compose_hardlight : +e[^-1] "Compose image$? two-by-two, using hard light mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 ++ge. 128 +*... .. /. 128 +-[-4,-3] 255 *[-4,-3] /... 128 -... 255 *... -1 +*... .. *.. -1 +.. 1 *[-2,-1] + +done done +compose_hue : +e[^-1] "Compose image$? two-by-two, using hue mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 to_rgba sh 0,2 +rgb2hsv[-2,-1] sh.. 0,0 j.. . rm[-5,-3,-1] hsv2rgb. rm. +done done +compose_interpolation : +e[^-1] "Compose image$? two-by-two, using interpolation mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 * 0.012271846 cos / -4 + +done done + 0.5 * 256 +compose_lighten : +e[^-1] "Compose image$? two-by-two, using lighten mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 max +done done +compose_lightness : +e[^-1] "Compose image$? two-by-two, using lightness mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 to_rgba sh 0,2 +rgb2lab[-2,-1] sh.. 0,0 j.. .,0,0,0,0 rm[-5,-3,-1] lab2rgb. rm. +done done +compose_luminance : +e[^-1] "Compose image$? two-by-two, using luminance mode." +repeat int($!/2) +to_colormode[-2,-1] 0 ri. ..,0,0,0.5,0.5 to_rgba[-2,-1] sh[-2,-1] 0,2 +rgb2ycbcr[-2,-1] sh.. 0,0 j.. .,0,0,0,0 rm[-5,-3,-1] ycbcr2rgb. rm. +mv. 0 done +compose_median : +e[^-1] "Compose image$? using median mode." +if $!==1 return fi +r[^0] [0],0,0,0.5,0.5 a z permute zxyc s y,-64 +repeat $! l[$>] +r 100%,{w*100}% +s z median {w} w={w} columns {int(w/2)} r 1,{h/$w} a z +done done a y permute yzxc +compose_multiply : +e[^-1] "Compose image$? two-by-two, using multiply mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 * +done done / 255 +compose_negation : +e[^-1] "Compose image$? two-by-two, using negation mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 + +done done - 255 abs - 255 * -1 +compose_overlay : +e[^-1] "Compose image$? two-by-two, using overlay mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 ++ge.. 128 ++*... .. /. 128 +-[-4,-3] 255 *[-4,-3] /... 128 -... 255 *... -1 +*... .. *.. -1 +.. 1 *[-2,-1] + +done done +compose_reflect : +e[^-1] "Compose image$? two-by-two, using reflect mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 sqr.. -. 255.1 / +done done * -1 c 0,255 +compose_rgba : +e[^-1] "Compose image$? two-by-two, using alpha blending." +to_rgb[0--1:2] compose_alpha +compose_saturation : +e[^-1] "Compose image$? two-by-two, using saturation mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 to_rgba sh 0,2 +rgb2hsv[-2,-1] sh.. 1,1 j.. .,0,0,0,1 rm[-5,-3,-1] hsv2rgb. rm. +done done +compose_screen : +e[^-1] "Compose image$? two-by-two, using screen mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 - 255 * +done done / 256 - 255 * -1 +compose_shapeaverage : +e[^-1] "Compose image$? two-by-two, using shape average mode." +repeat int($!/2) l[-2,-1] nm={0,n} +channels. 0 ge. 50% label_fg. 0 nb={iM+1} *. 256 +rv[-2,-1] m={im} M={iM} n. 0,255 s. c +[^0] [0] +repeat $!-1 +histogram. {$nb*256},0,{$nb*256-1} +i.. 256,1,1,1,'x' r.. {w},1,1,1,0,2 *.. . r[-2,-1] $nb,1,1,1,2 max. 1 /[-2,-1] +mv. 1 done +/[0] 256 a[^0] c *. {($M-$m)/256} +. $m point. 0,0,0,1,0 map[0] . rm. +nm $nm,1 done mv. 0 done +compose_softlight : +e[^-1] "Compose image$? two-by-two, using soft light mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 / 256 +*.. . *. 2 sqr... *.. ... *.. -2 + +done done * 256 +compose_stamp : +e[^-1] "Compose image$? two-by-two, using stamp mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 *. 2 + +done done - 255 c 0,255 +compose_value : +e[^-1] "Compose image$? two-by-two, using value mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 to_rgba sh 0,2 +rgb2hsv[-2,-1] sh.. 2,2 j.. .,0,0,0,2 rm[-5,-3,-1] hsv2rgb. rm. +done done +compose_xor : +e[^-1] "Compose image$? two-by-two, using xor mode." +repeat int($!/2) l[$>,{$>+1}] +to_colormode 0 ri. ..,0,0,0.5,0.5 xor +done done +_fx_compose : +repeat int($!/2) +compose_$1[-2,-1] rm... to_rgba. sh. 3,3 *. $2 rm. compose_alpha[-2,-1] mv. 0 done +_fx_revert_layers : +repeat int($!/2) rv[{2*$>},{2*$>+1}] done +fx_compose_average : +if ${2=0} _fx_revert_layers fi +_fx_compose average,$1 +fx_compose_colorburn : +if ${2=0} _fx_revert_layers fi +_fx_compose colorburn,$1 +fx_compose_darken : +if ${2=0} _fx_revert_layers fi +_fx_compose darken,$1 +fx_compose_difference : +if ${2=0} _fx_revert_layers fi +to_rgb _fx_compose difference,$1 +fx_compose_divide : +if ${2=0} _fx_revert_layers fi +_fx_compose divide,$1 +fx_compose_dodge : +if ${2=0} _fx_revert_layers fi +_fx_compose dodge,$1 +fx_compose_edges : +if ${3=0} _fx_revert_layers fi +repeat int($!/2) +compose_edges[-2,-1] $2 rm... to_rgba. sh. 3,3 *. $1 rm. compose_alpha[-2,-1] mv. 0 done +fx_compose_exclusion : +if ${2=0} _fx_revert_layers fi +to_rgb _fx_compose exclusion,$1 +fx_compose_fade : +if $!==1 return fi +to_colormode 4 +if $1==0 [0],[0],1,1,"$10" +else _fx_compose_fade$1 $7,$8,$9 r. [0],[0],1,1,3 +fi +n. {-($!-2)*$3},{($!-2)*(1+$3)} +-. {$2*(1+$3)*($!-2)} +c. 0,{$!-2} +if $6 rv[^-1] fi +if $5 round. 1 +else roundify. $4 +fi +compose_fade +c 0,255 +_fx_compose_fade1 : [0],[0],1,1,"a=$1*pi/2; x*cos(a) + y*sin(a)" +_fx_compose_fade2 : [0],[0],1,1,0 -=. 1,{($1+1)*50}%,{($2+1)*50}% distance. 1 +_fx_compose_fade3 : [0],[0],1,1,0 -=. 1,{($1+1)*50}%,{($2+1)*50}% distance. 1 *. {0.01+$3/2} cos. +_fx_compose_fade4 : [0],[0],1,1,"((x-w*($1+0.5))*(y-h*($2+0.5)))%(0.2*w*h*(1.001+$3))" +fx_compose_freeze : +if ${2=0} _fx_revert_layers fi +_fx_compose freeze,$1 +fx_compose_grainextract : +if ${2=0} _fx_revert_layers fi +_fx_compose grainextract,$1 +fx_compose_grainmerge : +if ${2=0} _fx_revert_layers fi +_fx_compose grainmerge,$1 +fx_compose_hardlight : +if ${2=0} _fx_revert_layers fi +_fx_compose hardlight,$1 +fx_compose_hue : skip ${2=0} +if ${2=0} _fx_revert_layers fi +_fx_compose hue,$1 +fx_compose_interpolation : +if ${2=0} _fx_revert_layers fi +_fx_compose interpolation,$1 +fx_compose_lighten : +if ${2=0} _fx_revert_layers fi +_fx_compose lighten,$1 +fx_compose_lightness : skip ${2=0} +if ${2=0} _fx_revert_layers fi +_fx_compose lightness,$1 +fx_compose_luminance : skip ${2=0} +if ${2=0} _fx_revert_layers fi +_fx_compose luminance,$1 +fx_compose_multiply : +if ${2=0} _fx_revert_layers fi +_fx_compose multiply,$1 +fx_compose_negation : +if ${2=0} _fx_revert_layers fi +to_rgb _fx_compose negation,$1 +fx_compose_overlay : +if ${2=0} _fx_revert_layers fi +_fx_compose overlay,$1 +fx_compose_reflect : +if ${2=0} _fx_revert_layers fi +_fx_compose reflect,$1 +fx_compose_saturation : skip ${2=0} +if ${2=0} _fx_revert_layers fi +_fx_compose saturation,$1 +fx_compose_screen : +if ${2=0} _fx_revert_layers fi +_fx_compose screen,$1 +fx_compose_shapeaverage : +if ${3=0} _fx_revert_layers fi +to_rgb +repeat int($!/2) +rv[-2,-1] +if $1 i[0] . fi +compose_shapeaverage[-2,-1] +if $1 *[0,-1] /[0] 255 mv[0] $! fi +if $2 to_rgba. replace_color. 0,0,0,0,0,255,0,0,0,0 fi +mv. 0 done +fx_compose_softlight : +if ${2=0} _fx_revert_layers fi +_fx_compose softlight,$1 +fx_compose_stamp : +if ${2=0} _fx_revert_layers fi +_fx_compose stamp,$1 +fx_compose_value : skip ${2=0} +if ${2=0} _fx_revert_layers fi +_fx_compose value,$1 +fx_compose_xor : +if ${2=0} _fx_revert_layers fi +to_rgb _fx_compose xor,$1 +fx_phoenix : ++fx_pencilbw $1,$2,0,0,0 +fx_kuwahara[1] $3,$4,0,0 +to_rgb. blur_xy[1] $5 +if $6==0 remove[0] return fi +if $8==0 reverse fx_compose_value $9,$7 +elif $8==1 reverse fx_compose_lightness $9,$7 +elif $8==2 reverse fx_compose_luminance $9,$7 +elif $8==3 fx_compose_colordoping $9,$7 +elif $8==4 fx_compose_comix_color $9,$7,$10 +elif $8==5 fx_compose_graphicolor $9,0,$7 +elif $8==6 fx_compose_graphixcolor $9,$7 +elif $8==7 fx_compose_vividedges $9,0.50,$7,$10 +elif $8==8 fx_compose_darkedges $9,0.50,$7,$10 +elif $8==6 fx_compose_multiply $9,$7 +elif $8==7 fx_compose_colorburn $9,$7 +elif $8==8 fx_compose_darken $9,$7 +elif $8==9 fx_compose_lighten $9,$7 +elif $8==10 fx_compose_screen $9,$7 +elif $8==11 fx_compose_hardlight $9,$7 +elif $8==12 fx_compose_softlight $9,$7 +elif $8==13 fx_compose_overlay $9,$7 +elif $8==14 fx_compose_grainmerge $9,$7 +elif $8==15 fx_compose_edges $9,0.80,$7 +elif $8==16 fx_compose_interpolation $9,$7 fi +fx_phoenix_preview : +gui_split_preview "fx_phoenix ${1--2}",$-1 +fx_psyglass : +repeat $! l[$>] split_opacity l[0] +if $1==0 +b 0.1 stained_glass $2,$3,$4 n 0,255 +elif $1==1 +negate b 0.1 stained_glass $2,$3,$4 n 0,255 negate +fi +if $5 equalize 256 fi ++b 0.9 +if $6==0 fx_compose_grainmerge $7 +elif $6==1 fx_compose_hardlight $7 +elif $6==2 fx_compose_softlight $7 +elif $6==3 fx_compose_overlay $7 +elif $6==4 fx_compose_colorburn $7 +elif $6==5 fx_compose_multiply $7 +fi +if $8==1 fx_contrast_swm 2,0,1,0 fi +if $9==1 fx_normalize_local 2,6,5,20,1,3,0 fi +if $10 +if $15==1 mirror x +elif $15==2 mirror y +elif $15==3 rotate 90 +elif $15==4 rotate 180 +elif $15==5 rotate 270 +fi +array_mirror $11,$14,$16 +shift -$12%,-$13%,0,0,2 +fi +done a c done done +fx_psyglass_preview : +gui_split_preview "fx_psyglass ${1--2}",$-1 +fx_scaledown3 : +if $1==0" && "$4==0 blur_xy {w/$5},{h/$6} +elif $1==0" && "$4==1 blur_xy {w/$5},{w/$6} +elif $1==0" && "$4==2 blur_xy {h/$5},{w/$6} +elif $1==1" && "$4==0 blur_xy $2 ,$3 +elif $1==1" && "$4==1 blur_xy $2 ,$3 +elif $1==1" && "$4==2 blur_xy $2 ,$3 +fi +if $4==0 +r $5,$6,2 +elif $4==1 +r2dx $5,2 +elif $4==2 +r2dy $6,2 +fi +if $7==0 +fx_unsharp 0,1.25,30,$8,0,$9,{$9/3},1,0,$10 +fi +fx_scaledown3_preview : +gui_split_preview "fx_scaledown3 ${1--2}",$-1 +fx_viral : +fx_rorschach $1,1,1 ++mirror y +if $2==0 blend average +elif $2==1 blend grainextract +elif $2==2 blend vividlight,0.5 +elif $2==3 blend difference +elif $2==4 blend exclusion +elif $2==5 blend negation fi ++fx_array_mirror 1,0,0,2,0,0 +if $3==0 blend vividlight,0.5 +elif $3==1 fx_compose_average 1,0 +elif $3==2 fx_compose_difference 1,0 +elif $3==3 fx_compose_negation 1,0 +elif $3==4 blend darken,0.8 fi +if $4==0 fx_graphic_novelfxl 0,2,6,5,20,0,0.62,14,0,1,0.5,0.78,1.92,0,0,12,1,1,1,0.5,0.8,1.28,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $4==1 fx_graphic_novelfxl 0,7.2,14.65,5,20,0,1.06,36.14,0,1,0.5,0.85,1.93,0,0,8,1,1,1,0.5,0.95,2.89,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $4==2 fx_graphic_novelfxl 0,7.22892,14.6506,5,20,0,1.6,36.1,0,1,0.5,0.6,3.6,0,0,11,1,1,1,0.5,0.8,2.16,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,7,1,1,1,0.5,0.45,1 +elif $4==3 fx_graphic_novelfxl 0,7.22892,14.6506,5,20,0,1.59036,36.1446,0,1,0.5,0.590361,3.61446,0,0,8,1,1,1,0.5,0.373494,2.89157,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $4==4 fx_graphic_novelfxl 0,7.22892,14.6506,5,20,0,1.59036,36.1446,0,1,0.5,0.855422,1.92771,0,0,8,1,1,1,0.5,0.373494,2.89157,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $4==5 fx_graphic_novelfxl 1,7.22892,14.6506,5,20,0,1.06024,14,0,1,0.5,0.855422,1.3253,0,0,12,1,1,1,0.5,0.8,1.28,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $4==6 fx_graphic_novelfxl 1,7.22892,14.6506,5,20,0,1.06024,36.1446,0,1,0.5,0.855422,1.92771,0,0,7,1,1,1,0.5,0.951807,1.92771,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 +elif $4==7 fx_graphic_novelfxl 1,7.22892,14.6506,5,20,0,1.59036,36.1446,0,1,0.5,0.590361,3.61446,0,1,18,1,1,1,0.5,0.795181,2.16867,1.25,2,0,0.15,14,0,1,0.5,0.45,2,0,1,0,1,1,1,0.5,0.45,1 fi +if $5==1 fx_array_mirror 1,0,0,2,0,$6 +elif $5==2 fx_array_mirror 1,0,0,3,0,$6 fi +fx_compose_vivid_color : +reverse fx_compose_lightness $1,$2 [^] fx_compose_softlight $3,0 +fx_compose_vividedges : +fx_compose_edges $1,$2,$3 [^] fx_compose_overlay $4,0 +fx_compose_vividscreen : +repeat $! l[$>] +fx_compose_screen $1,$2 . fx_compose_overlay $3,0 +done done +fx_m_l_unsharp2 : ++unsharp $1,$2,0 +unsharp $3,$4,0 [1] reverse fx_compose_darken $5 ++unsharp $3,$4,0 reverse fx_compose_lighten $6 +if $7==1 fx_smooth_anisotropic 60,$8,$9,$10,1.1,0.8,30,2,0,1,1,0 fi +blend overlay +fx_m_l_unsharp2_preview : +gui_split_preview "fx_m_l_unsharp2 ${1--2}",$-1 +pr_chanshuff : skip "${1=100},${2=0},${3=0},${4=1},${5=0},${6=10},${7=101},${8=100},${9=0},${10=0}" +foreach { +fac=$1 +arg0 $3,"x","y" axis=${} +arg0 $4,"rv","u","xm","ym","zm","cm","xM","yM","zM","cM","R","G","B","A","im","iM","ia","iv","id","is","ip","ic","in","w","h","z" +sort=${} +arg0 $5,"+","-" order=${} +wi,he:=w,h +if $3 +if $1>$he fac=$he fi sli={0,floor(h/$fac)} +else +if $1>$wi fac=$wi fi sli={0,floor(w/$fac)} +fi +if $2>0&&$2!=360 rotate $2,0,0 fi ++s c +cc:=$!-1 +if $1 +s[^0] $axis,$sli +if $4>0 sort_list[^0] $order,$sort else rv[^0] fi +repeat $cc { a[{$>+1}-{$sli+$>}] $axis } +else +N:=floor(u(2,50)) +repeat $cc { l[{$>+1}] { +pr_rnd_split $N,$3 +if $4>0 sort_list[^0] $order,$sort else rv[^0] fi +a $axis +} +} +fi +a[^0] c keep. +if $2>0&&$2!=360 +rotate. -$2,0,0 +vx,vy:=floor([w-$wi,h-$he]*0.5) +vxb,vyb:=$vx+$wi-1,$vy+$he-1 +crop. $vx,$vy,$vxb,$vyb +fi +} +pr_chanshuff_preview : +pr_chanshuff $* +pr_rnd_split : skip "${1=10},${2=0}" +foreach { +N=$1 +l. { +if $2 D=h else D=w fi +{$N+1},1,1,1,>u+j(-1) n. 0,{-2,$D} round. discard. +repeat h-1 { +param=1,[i[$>],i[$>+1]-1] +if $2 +rows[0] {$param} else +columns[0] {$param} fi +} +rm[0,1] +} +} +pr_iris_gui : +pr_iris ${1--1} +#@cli pr_iris : _resolution,_double_res,_iris_lines_width,_pupil_height,_pupil_width,_fire_ring_height,_fire_ring_width,_defect_width,_ring_width,_seed,_colorA1,...,_colorA3,_colorB1,..,_colorB3,_colorC1,..,_colorC3,_variation +#@cli : WORK IN PROGRESS : Draws an eye's iris and pupil in a new image +#@cli : Default value: 'resolution=800', 'double_res=0', 'iris_lines_size=10', 'Pupil_height=0.4', 'pupil_width=0.4', 'defect_width=120', 'ring_width=80', 'seed=0' 'colorA=100,100,0]', 'colorB=30,150,200', 'colorC=255,150,0','variation=20' +#@cli : $ pr_iris 800,1 +#@cli : pr_iris 800,,10,0.8,0.1,100,30,777 +#@cli : pr_iris 800,1,10,0.3,0.3,10,120,0,0,100,250,0,100,100,255,200,0,100 +pr_iris : +check "${1=800}>=800 && ${2=1}>=0 && ${3=10}>0 && ${4=0.4}>=0 && ${5=0.4}>=0 && ${6=20}>=0 && ${7=20}>=0 && ${8=130}>=0 && ${9=80}>=0 && ${10=0}>=0 && ${11=100}>=0 && ${12=100}>=0 && ${13=0}>=0 && ${14=30}>=0 && ${15=150}>=0 && ${16=150}>=0 && ${17=255}>=0 && ${18=100}>=0 && ${19=0}>=0 && ${20=20}>=0" +res,dbl,th,puph,pupw,fireh,firew,def,ring,seed,ra,ga,ba,rb,gb,bb,rc,gc,bc,var=${1--1} +to_rgba +r $res,$res,100%,100%,0 +foreach { +wh=255,255,255 bk=0,0,0 +if $def $def%,$def%,1,4,$bk,0 fi +to_a if $dbl r2dx 200%,0 fi +foreach { +r:=(w*0.5)-10 R:=$r+$def +RGB:=u([$ra,$ga,$ba],[$ra+u(-$var,$var),$ga+u(-$var,$var),$ba+u(-$var,$var)]) +repeat 180 { ch:=u(5) if $ch>=1 col=$RGB else col=$bk fi thickline 50%,50%,$th*{w*cos($>)},$th*{w*sin($>)},$th*2,0.9,$col } +pr_deform. 2,$seed,1,1,1,3 +repeat w/($th*0.5) { +ch:=u(5) if $ch>=3 +st:=$>*$th sx,sy,ex,ey:=$st,0,w-$st,h +RGB:=u([$rb,$gb,$bb],[$rb+u(-$var,$var),$gb+u(-$var,$var),$bb+u(-$var,$var)]) +sh=1.5 +thickline {[$sx-$sh,$sy-$sh,$ex-$sh,$ey-$sh,u($th)]},0.7,$RGB +sx,sy,ex,ey:=0,$st,w,h-$st +thickline {[$sx-$sh,$sy-$sh,$ex-$sh,$ey-$sh,u($th)]},0.7,$RGB +fi +} +sh. 3 fc. $bk +ellipse. 50%,50%,{[$R*$pupw,$R*$puph]},0,1,$wh +rm. +} +flower. {[4,13,0,u(150)]} pr_deform. 20,$seed,1,1,1,3 +repeat 2 +pr_deform[0] 4,{$seed*$>+1},5,1,3,3 sh. 3 gaussian. 50% n. 0,255 rm. done +repeat 3 pr_deform.. 3,{$seed*$>+1},{$>+1},1,3,3 done +mirror. y +blend[-1,0] alpha +mul. 3 blend[-1,0] overlay +if $def ++adjust_colors. ,,70 r2dx. 105% expand_xy. 100 +dilate. {$def/2} b. 15 +adjust_colors.. -25 +rv[-1,-2] blend[-2,-1] alpha spread. 15 +blend overlay,0.9 +fi +srand $seed +plasma , to_graya. blend add,0.3 +.,.,1,4,$bk,0 . +l.. { ellipse. 50%,50%,$firew%,$fireh%,0,1,$rc,$gc,$bc +sh. 3 ellipse. 50%,50%,{$firew-3}%,{$fireh-3}%,0,1,$bk rm. } +l. { ellipse. 50%,50%,{$firew+3}%,{$fireh+3}%,0,1,{[$rc+100,$gc+100,$bc]} +sh. 3 ellipse. 50%,50%,{$firew-3}%,{$fireh-3}%,0,1,$bk rm. } +blend[-1,-2] alpha +flower. {[4,13,0,u(150)]} pr_deform. 40,$seed,3,1,1,3 blur_radial. 1.6% sharpen. 3000 blend alpha,0.4 +r,th:=(w*0.5)-10,20 +.,.,1,4,$bk,0 +l. { +circle 50%,50%,{$r+10},1,$wh +circle 50%,50%,{$r-$ring},1,$wh,0 b {$ring*0.2} +sh 0,2 negate. rm. +. repeat 3 { N:=$>+1 flower. {[$N*0.5,$N*u(200,300),0,u(350)]},50%,50%,0 } +pr_deform. 2,$seed,6,0 blend grainmerge +} +blend[0,-1] alpha +R:=$r*$puph +.,.,.,.,$bk,0 +sh. 3 +ellipse. 50%,50%,{[$r*$pupw,$r*$puph]},0,1,$wh +rm. +repeat 3 N:=$>+1 flower. {[$N*0.5,$N*80,0,u(150)]} done +pr_deform. 8,$seed,6,0 +blur_radial. 0.4% +blend alpha +sh 3 fc. $bk circle. 50%,50%,$r,1,$wh erode. {$ring*0.2} b. 5 rm. +if $dbl r2dx 50%,5 fi +pr_deform 1.5,$seed,2,1 +c 0,255 +} +#@cli pr_dcm8 : _strength,_interpolation +#@cli : Quickly pixelize an image while keeping dimensions +#@cli : Default value: 'strength=50', 'interpolation=1' +#@cli : pr_dcm8 80 +pr_dcm8 : skip ${1=50},${2=1} +foreach { +wi,he:=w,h +if $1 +r {w/$1},{h/$1},100%,100%,1 +r $wi,$he,100%,100%,$2 +if $2==4 autocrop r $wi,$he,100%,100%,1 fi +fi +} +pr_linespam : skip "${1=30},${2=3},${3=1.02},${4=0.8},${5=-1},${6=10},${7=101},${8=100},${9=0},${10=0},${11=255,85,0,255},${12=0},${13=0},${14=0},${15=5},${16=10},${17=0.8},${18=1},${19=0}" +foreach { +if ${-1} to_rgba fc 0,0,0,0 else [0] to_rgba. fc. 0,0,0,0 fi +l. { +bthick=$2 +repeat 4 { +repeat $-2 { +iter,thick,tscale,opac,sx,sy,ex,ey,def,style,colr,colg,colb,cola,cvar,rcol,aa,amp,edg,smoo,spam=${1--2} +c={$>+1} +repeat $iter { +if $rcol==1 +col:={[u($colr-50,$colr+50),u($colg-50,$colg+50),u($colb-50,$colb+50)]},255 +else +col=$colr,$colg,$colb,255 +fi +if $style==0 A,B=$>,$< elif $style==1 A,B:=[$<,$>]*[2,.5] elif $style==2 A,B=$< else A,B:=$>/2 fi +thickline. {$sx*$c+$bthick}%,{$A*$sy}%,{$B+$ex}%,{$ey-$A*$B}%,$thick,$opac,$col +thick*=$tscale +if inrange($colr+$cvar,0,255,0,0) colr+=$cvar fi +if inrange($colg+$cvar,0,255,0,0) colg+=$cvar fi +if inrange($colb+$cvar,0,255,0,0) colb+=$cvar fi +} +} +if $def pr_deform $def fi +rotate. 90,0,0 +} +if $aa fx_smooth_antialias $amp,$edg,$smoo fi +n 0,255 +} +if $!>1 blend alpha,1 fi +} +pr_linespam_preview : +pr_linespam $* +pr_lilboxy_gui : +pr_lilboxy $* +#@cli pr_lilboxy : decimate,dilate_X,dilate_Y,erode_X,erode_Y,angle,color1--color3,alpha +#@cli : Quickly pixelize an image while keeping dimensions +#@cli : Default value: 'strength=50', 'interpolation=1' +#@cli : pr_lilboxy 50,80,160,8,16,255,80,160,255 +pr_lilboxy : skip ${1=20},${2=40},${3=60},${4=2},${5=2},${6=0},${7=0},${8=0},${9=0},${10=255} +foreach { +wi,he:=w,h +to_rgba +if $6>0&&$6!=360 rotate $6,0,0 fi +if $1 pr_dcm8 $1,4 fi +if $2||$3 dilate $2,$3 fi +sharpen 100000 +if $4||$5 erode $4,$5 fi +if $6>0&&$6!=360 +rotate. -$6,0,0 +autocrop +fi ++fc $7,$8,$9,$10 +rv blend alpha +} +#@cli :: Reptorian's CLI Commands +#@cli rep_decompose_bitplanes: _number_of_bits>0 +#@cli : Decompose images into bitplanes. +#@cli : Default values: '_number_of_bits=8' +#@cli : Author : Reptorian. +rep_decompose_bitplanes: +l[] { +check "${1=8}>1 && isint(${1=8})" +$=arg +onfail +if isnum($1) +if !isint($1)||$1<1 error inv_num_inp fi +else +noarg arg1=8 +fi +} +d_bpi={$arg1-1} +foreach { repeat $d_bpi { +>>[-1] 1 &[-2] 1 } &[-1] 1 } +#@cli rep_compose_bitplanes: _number_of_bits>0 +#@cli : Compose bitplanes into images. +#@cli : Default values: '_number_of_bits=8' +#@cli : Author : Reptorian. +rep_compose_bitplanes: +l[] { +check "${1=8}>1 && isint(${1=8})" +$=arg +onfail +if isnum($1) +if !isint($1)||$1<1 error inv_num_inp fi +else +noarg arg1=8 +fi +} +d_bpi={$arg1-1} +P,Q=-1,-2 +repeat inf { +repeat $d_bpi { <<[$P] 1 |[$P,$Q] } +if ($>+1)==$! break fi +P,Q-=1 +} +#@cli utf8str2vint: string +#@cli : Return vector of integer representation of UTF-8 string. +#@cli : Author : Reptorian. +utf8str2vint: +skip "${1=}" +if !$# status "" return fi +eval " +str='$1'; +const size_str=size(str); +num_set=vector(#size_str,0); +pos=num_of_chars=0; +while(pos>4; +current_binary<8?( +++pos; +num_set[num_of_chars]=1; +): +current_binary<=13?( +pos+=2; +num_set[num_of_chars]=2; +): +current_binary==14?( +pos+=3; +num_set[num_of_chars]=3; +): +current_binary==15?( +pos+=4; +num_set[num_of_chars]=4; +); +++num_of_chars; +); +if(pos!=size_str,run('error not_a_UTF-8_string!');); +const N=0xff; +const M=N>>2; +pos=0; +repeat(num_of_chars,k, +size_of_ints_per_char=num_set[k]; +size_of_ints_per_char==4?( +num_set[k]=(str[pos]&(N>>5))<<18|(str[pos+1]&M)<<12|(str[pos+2]&M)<<6|(str[pos+3]&M); +): +size_of_ints_per_char==3?( +num_set[k]=(str[pos]&(N>>4))<<12|(str[pos+1]&M)<<6|(str[pos+2]&M); +): +size_of_ints_per_char==2?( +num_set[k]=(str[pos]&(N>>3))<<6|(str[pos+1]&M); +):( +num_set[k]=str[pos]; +); +pos+=size_of_ints_per_char; +); +set('num_of_chars',num_of_chars); +num_set; +" +status {([${}])[0,$num_of_chars]} +#@cli vint2utf8str: int_a>=0,... +#@cli : Return corresponding integer(s) representation of UTF-8 as a string. +#@cli : Author : Reptorian. +vint2utf8str: +skip "${1=}" +if !$# status "" return fi +eval " +list_of_ints=[$*]; +if(min(list_of_ints)<0||max(list_of_ints)>0x10ffff,run('error range_exc');); +const list_size=size(list_of_ints); +const init_size=list_size<<2; +new_list=vector(#init_size,0); +const M=1<<7; +const N=0xff; +const S=N>>2; +const X1=xor(N,S); +const X2=xor(N,S>>1); +const X3=xor(N,S>>2); +final_size=0; +repeat(list_size,k, +cv=list_of_ints[k]; +cv>0x10000?(LS=3;XC=X3;): +cv>0x800?( LS=2;XC=X2;): +cv>0x80?( LS=1;XC=X1;): +( LS=0; ); +LS?( +for(ind=final_size+LS,ind>final_size,--ind, +new_list[ind]=M|(cv&S); +cv>>=6; +); +new_list[final_size]=XC|cv; +):( +new_list[final_size]=cv; +); +final_size+=LS+1; +); +set('final_size',final_size); +new_list; +" +status {`([${}])[0,$final_size]`} +#@cli rep_nonexistent_colors_pal: number_of_new_colors, _appended_into_palette={ 0=do_not_append | 1=append into palette },_method={ 0=random | 1=farthest (slow) },0<_mask_factor[%]<=1,_cube_size>=7 +#@cli : Generates a palette of non-existent colors on each images. Either, appended onto the image, or as a new palette. +#@cli : '_appended_into_palette=1','_method=0','_mask_factor=1','_cube_size=16' +rep_nonexistent_colors_pal: +skip ${2=1},${3=0},${4=1},${5=64} +check "isint($1)&&$1>=1" +number_of_new_colors,append_into_pal,cube_size=$1,$2,$5 +if isint($3) far_mode={$3&1} +else +r,rand,random,aleatoria=0 far,farthest,distant,lejos=1 +far_mode=$$3 if !narg($far_mode) error inval_arg fi +fi +if $far_mode +mask_factor={1-$4} +if !inrange($4,0,1,0,1) +error 0<\$\4<=1==F +fi +if !isint($cube_size)||!inrange($cube_size,7,256,1,1) +error inv_inp_\$\5 +fi +if $cube_size==256 +initial_code=i(#-1,I)=1 +xyz_code=[xM,yM,zM] +m "rep_nonexistent_colors_pal_insert_new_color: point 0,$""1,0,1,$""2,$""3,$""4" +else +d_cube_size={$cube_size-1} +initial_code=i(#-1,I*{$d_cube_size/255})=1 +xyz_code=round([xM,yM,zM]) +m "rep_nonexistent_colors_pal_insert_new_color: point 0,$""1,0,1,{round([$""2,$""3,$""4]*"{255/$d_cube_size}")}" +fi +if $mask_factor +m "rep_nonexistent_colors_pal_generate_pal: +current_number_of_colors=$""1 +if "$append_into_pal" +1,{"$number_of_new_colors"+$current_number_of_colors},1,1,y +map[-1] [-3] +rm[-3] +else +1,"$number_of_new_colors",1,{s#-2} +rm[-3] +current_number_of_colors=0 +fi ++fill[-2] :\"const max_coords="$d_cube_size";!i?(inrange(x,0,max_coords,0,0)&&inrange(y,0,max_coords,0,0)&&inrange(z,0,max_coords,0,0));\" ++inpaint_pde[-3] [-1],100%,0 +remove[-2] +erode_circ. 2,1,1 blur. 2 +. 1 ^. "$mask_factor" +repeat "$number_of_new_colors" { ++distance... 1,2 *. .. xyz:="$xyz_code" rm. +point... $xyz,1,1 +rep_nonexistent_colors_pal_insert_new_color.. $current_number_of_colors,$xyz +current_number_of_colors+=1 +} +remove[-3,-1] +" +else +m "rep_nonexistent_colors_pal_generate_pal: +current_number_of_colors=$""1 +if "$append_into_pal" +1,{"$number_of_new_colors"+$current_number_of_colors},1,1,y +map[-1] [-3] +rm[-3] +else +1,"$number_of_new_colors",1,{s#-2} +rm[-3] +current_number_of_colors=0 +fi +repeat "$number_of_new_colors" { ++distance.. 1,2 xyz:="$xyz_code" rm. +point.. $xyz,1,1 +rep_nonexistent_colors_pal_insert_new_color. $current_number_of_colors,$xyz +current_number_of_colors+=1 +} +remove[-2] +" +fi +fi +foreach { +current_number_of_colors:=whd +if $far_mode +if s!=3 error inv_chans_num fi +{vector3($cube_size)},1 +eval[-2] $initial_code +rep_nonexistent_colors_pal_generate_pal $current_number_of_colors +else +if !inrange(1,6,1,1) +error inv_chans_num +fi +if $append_into_pal +1,{$number_of_new_colors+$current_number_of_colors},1,1,y +map[-1] [-2] +rm[-2] +1,1,1,100% +else +1,1,1,100%x2 +fi +eval " +const number_of_new_colors=$number_of_new_colors; +const number_of_channels=s#0; +const current_number_of_colors=$current_number_of_colors; +const append_into_pal=$append_into_pal; +const maximum_integer_value=256^number_of_channels; +bitshift_factors=expr('x?1<<(2+x)',number_of_channels); +convert_color2int(color_values)=sum(color_values<>bitshift_factors)&0xff; +min_pos_val=-1; +max_pos_val=inf; +state_check=mode=0; +old_value=middle_pivot=pivot_value=-1; +repeat(current_number_of_colors,p, +current_color=I[#0,p]; +current_value=convert_color2int(current_color); +mode==3?( +state_check=0; +current_value==min_pos_val||current_value==max_pos_val||current_value==pivot_value||current_value==old_value?( +continue(); +):( +old_value=current_value; +current_valuemax_pos_val?( +max_pos_val=current_value; +da_push(#-1,current_color); +): +current_value>pivot_value?( +for(q=middle_pivot+1,qcurrent_value?( +break(); +): +test_value==current_value?( +state_check=1; +break(); +); +); +if(state_check +,continue(); +,da_insert(#-1,q,current_color); +); +):( +for(q=middle_pivot-1,q>0,--q, +test_value=convert_color2int(I[#-1,q]); +current_value>test_value?( +break(); +): +test_value==current_value?( +state_check=1; +break(); +); +); +if(state_check +,continue(); +,da_insert(#-1,q+1,current_color); +); +); +middle_pivot=da_size(#-1)>>1; +pivot_value=convert_color2int(I[#-1,middle_pivot]); +); +): +mode==2?( +if(!state_check, +min_pos_val=convert_color2int(I[#-1,0]); +max_pos_val=convert_color2int(I[#-1,1]); +state_check=1; +); +current_value==min_pos_val||current_value==max_pos_val?( +continue(); +):( +middle_pivot=1; +mode=3; +state_check=0; +current_valuemax_pos_val?( +pivot_value=max_pos_val; +max_pos_val=current_value; +da_push(#-1,current_color); +); +); +): +mode?( +current_value>old_value?( +da_push(#-1,current_color); +old_value=current_value; +mode=2; +): +current_value=last_rn?++q),q=convert_color2int(I[#-1,q])?( +++selec_u; +):(break();); +); +new_color=convert_int2color(selec_u); +da_insert(#-1,q,new_color); +insert_new_color(new_color); +last_rn=selec_u; +); +if(!append_into_pal,da_freeze(#-2);); +" +keep[{!$append_into_pal}] +fi +} +um rep_nonexistent_colors_pal_insert_new_color,rep_nonexistent_colors_pal_generate_pal +#@cli rep_van_neumann_condition_tiling: width,height,whole_number_count_starting_from_zero>=4 +#@cli : Generate random tiles which meets van neumann condition. ++rep_van_neumann_condition_tiling: +check "$3>=2&&isint($3)" +${1-2},1,1,>"begin( +const Ws=$3; +rn_exlc(arg...)=( +ref([arg],excl_num); +repeat(size(excl_num),p, +sel_rn>=excl_num[p]?( +++sel_rn; +):(break();); +); +sel_rn; +); +temp_num_a=temp_num_b=0; +); +paint_using_x=x?1; +paint_using_y=y?1; +if(paint_using_x,temp_num_a=j(-1,0);); +if(paint_using_y,temp_num_b=j(0,-1);); +if(paint_using_x&&paint_using_y,paint_using_y=temp_num_a!=temp_num_b); +paint_using_x&&paint_using_y?( +if(temp_num_b=0,p = find(s,_',',++p), +s[p]=k%w?_',':k%wh?_';':k%whd?_'/':_'^'; +++k; +); +s; +); +s=v2s(crop(),-1); +put_sep(s,1); +"`}) +} +#@cli rep_python_print_files_dir: +#@cli : Print existing files in current directory. +#@cli : As the 'python' denotes, this command requires Python. Python Version Requirement: 3.6+ +rep_python_print_files_dir: +exec 1,"python -c \"import os; d=os.listdir(); c=','; print(f'\\n[gmic][python]-"$^"./ {c.join(d)}')\"" +#@cli rep_cin: '_message' +#@cli : Allows users to type output number into status. Only numbers, A-Z english letters, comma, period, minus sign, and space are accepted! Maximum string length is 1024! +#@cli : Default values: '_message=G'MIC rep_cin output:' +rep_cin: +skip "${1=}" +screen_w,screen_h={*,u},{*,v} +screen_h>>=1 +started,stack_point=0 +current_str_0="" +max_stack_size:=(1<<10)+1 +if narg("$1") +message="$1" +else +message="G'MIC rep_cin output: " +fi +do +if {*,BACKSPACE} +if $stack_point>0 +stack_point-=1 +if $stack_point<0 stack_point=0 fi +o=${current_str_$stack_point} +fi +w[] $screen_w,1,0,0,$message$o +wait 250 +elif {*,ENTER}" || "{*,ESC} +break +else +key={*,k} +in_char_set:=inrange($key,188,190,1,1) +if $stack_point<$max_stack_size +if inrange($key,_'0',_'9',1,1)||inrange($key,_'A',_'Z',1,1)||$key==_'\ '||$in_char_set +stack_point+=1 +if $in_char_set o.={`(',-.')[$key-188]`} +else o.={`$key`} +fi +current_str_$stack_point=$o +fi +fi +if $started w[] $screen_w,1,0,0,$message$o +else +w[] $screen_w,1,0,0,0,$screen_h,$message$o +started=1 +fi +fi +wait +while {*} +status $o +#@cli rep_closest_number_in_ordered_list_of_numbers: number_to_search,number_a,number_b.... +#@cli : Find closest number in list of number +rep_closest_number_in_ordered_list_of_numbers: +eval " +const number_to_search=$1; +vn=sort([${2--1}]); +const size_vn=size(vn); +const last_index=size_vn-1; +diff(a,b)=abs(a-b); +number_to_search==inf?( +last_index; +): +number_to_search==-inf?( +0; +): +number_to_search>vn[last_index]?( +vn[last_index]; +): +number_to_searchnumber_to_search, +if(p, +a=diff(number_to_search,value); +b=diff(number_to_search,old_value); +return_number=a0 +#@cli : For use in images with large color blobs, this simplifies a image. +rep_color_region: +skip ${1=25%},${2=0%},${3=6} +check "inrange($1,0,1,0,1)&&inrange($2,0,1,1,1)&&$3>=0" +area_threshold,stray_threshold,color_distance_threshold=${1-3} +foreach { ++round ++colormap. 0,,1 ++index[-2] [-1],0,0 ++area. 0,0 +ge. {ia*$area_threshold} +*.. . +negate. +-.. . +rm. +colormap. 0,,1 +if xM discard. -1 +else crop. 1,100% +fi +map. .. +if $color_distance_threshold +if h>1 dimensions=1,100% +else 100%,1 +fi +$dimensions,1,1,">begin( +const color_distance_threshold=$color_distance_threshold; +position=0; +test_color=vector(#s#-1,-inf); +); +distance=norm(I#-1-test_color); +if(distance>color_distance_threshold&&distance!=inf, +++position; +); +test_color=I#-1; +position;" +blend[-2,-1] shapeaverage colormap. 0 +fi +rm.. +index.. .,0,1 +rm. rv +if $2 +100%,100%,100%,1 +1,1,1,2 +eval[0] >" +begin( +off_place=[-1,1]; +); +pixel_in_place=0; +repeat(4,position, +xp=off_place[position&1]; +yp=off_place[position>>1]; +pixel_in_place=(I==J(xp,0,0,0,1))&&(I==J(0,yp,0,0,1)); +if(pixel_in_place,break();); +); +if(!pixel_in_place, +pixel_position=[x,y]; +i(#-2,pixel_position)=1; +da_push(#-1,pixel_position); +); +I;" +if !iM#-2 keep[0] continue fi ++label[0] 0,0 +area. 0,0 +le. {$stray_threshold*iM} +*[-3,-1] +if !iM#-2 keep[0] continue fi +eval " +size_da=da_size(#-1); +point=size_da-1; +repeat(size_da, +if(!i(#-2,I[#-1,point],0,1),da_remove(#-1,point);); +--point; +); +da_freeze(#-1); +" +eval. :"begin( +a_coordinates=[-1,0,1,-1,1,-1,0,1]; +b_coordinates=[-1,-1,-1,0,0,1,1,1]; +); +number_of_valid_pixels=0; +difference_vector=vector(#4,inf); +repeat(8,position, +offset_a=a_coordinates[position]; +offset_b=b_coordinates[position]; +offset=[offset_a,offset_b]; +test_pixel_position=I+offset; +if(!i(#3,test_pixel_position,1), +difference_vector[position]=norm(I(#0,I,0,1),I(#1,test_pixel_position,0,1)); +++number_of_valid_pixels; +); +); +if(number_of_valid_pixels, +position=argmin(difference_vector); +offset_a=a_coordinates[position]; +offset_b=b_coordinates[position]; +offset=[offset_a,offset_b]; +pixel_position=I+offset; +I(#0,I)=I(#0,pixel_position,0,1); +);" +fi +keep[0] +} +#@cli rep_two_dimension_set_indices: +#@cli : Return images containing indexes +rep_two_dimension_set_indices: +num_of_imgs:=$! +repeat $num_of_imgs { +width:=w#$> +height:=h#$> +if narg(${image_dimension_${width}_${height}}) +eval da_push(#${image_dimension_${width}_${height}},$>) +else +1 => image_dimension_${width}_${height} +eval da_push(#-1,$>) +fi +} +foreach[$num_of_imgs--1] { eval da_freeze(#-1) } +#@cli rep_sort_images_by_images_name_order: name_a,name_b +#@cli Sort images accordingly to images name. Duplicates images name are not accepted! +#@cli : $ sample portrait2,duck,fruits,portrait1,portrait2,duck,duck,fruits rep_sort_images_by_images_name_order duck,portrait2,fruits,portrait1 +rep_sort_images_by_images_name_order: +imgs_moved=0 +$=arg +for $imgs_moved<$! { +named[$imgs_moved--1] 0,${arg{$>+1}} +t_arg:=narg(${}) +if $t_arg +move[${}] $imgs_moved +imgs_moved+=$t_arg +else error missing_image_name +fi +} +#@cli rep_sort_images_by_order: number_a,number_b,.... +#@cli : Sort images accordingly to numerical arguments. The number of numerical arguments has to be equal to the number of images, and they have to be positive integer number starting from 0 until number that is equal to number of arguments minus one. +#@cli : $ sample cat,dog,lena,david,house,flower,waterfall,tiger name {expr('x',$!)} rep_sort_images_by_order 5,1,7,0,4,2,3,6 +rep_sort_images_by_order: +if $#!=$! error invalid_image_count fi +input_v=[{[$*]%$#}] +sorted_v=[{expr('x',$#)}] +if $input_v==$sorted_v return +elif $input_v==reverse($sorted_v) reverse +else +$#,1,1,1 +$#,1,1,1,>"begin( +const max_index=w-1; +index_counter=vector(#w,0); +order=[$*]; +); +value_index=order[x]%w; +if(++index_counter[value_index]>1,run('error dup_ind_inp');); +off_position=value_index-i(#-1,value_index); +polygon(#-1,2,value_index,0,max_index,0,-1,1); +off_position+x; +" +remove[-2] +repeat $# { +move[{i(#-1,$>)}] $> +} +remove[-1] +fi +#@cli rep_tuppers_self_K: apply_pre_negation={ 0=false | 1=true } +#@cli : Generate K values from images. Also, threshold image for users to check what it would look like. +#@cli : Default values: 'apply_pre_negation=1' +rep_tuppers_self_K: +skip ${1=1} +n0={'0'} +foreach { +if !(s&1) to_graya s c /. 255 * +else to_gray +fi +if !iv?($1?im:!im) +if $> out.=,0 +else out=0 +fi +continue +fi +height={h} +if $height<2 error inv_dimension_[$>] fi +gt {(im+iM)/2} ++store. image +if $1 xor 1 fi +rotate 90 +unroll x +crop {xM},100% +rep_binimg2decimg +fill <"begin( +const height=$height; +carry_over=0; +); +n=carry_over+i*height; +carry_over=int(n/10); +n%10; +end( +set('carry_over',carry_over); +);" ++ $n0 +if $carry_over +('$carry_over') +reverse +append x +fi +if $> out.=,{t} +else out={t} +fi +rm $image +} +status $out +#@cli rep_tuppers_self: _K>=h,_apply_negate={ 0=false | 1=true } +#@cli : Generates output of K onto a single image. +#@cli : Note: _K must be a integer number equal or greater to the height of image. +#@cli : Default values: '_K=96093937991.....','apply_negate=1' +rep_tuppers_self: +skip ${1=960939379918958884971672962127852754715004339660129306651505519271702802395266424689642842174350718121267153782770623355993237280874144307891325963941337723487857735749823926629715517173716995165232890538221612403238855866184013235585136048828693337902491454229288667081096184496091705183454067827731551705405381627380967602565625016981482083418783163849115590225610003652351370343874461848378737238198224849863465033159410054974700593138339226497249461751545728366702369745461014655997933798537483143786841806593422227898388722980000748404719},${2=1} +if $!!=1 error n_imgs_inv fi +if d>1 error imgs_dims_inv fi +if $1=h +fill y+x*h mirror. x ++rep_posdec2base_img ${rep_BIGINT_division\ $1,{h}},base_float +{24*(w-1)+int(log2(i[#-1,0]))+1} +eval[-2] " +const mx=w-1; +xp=mx-x; +point=xp*24; +digit=i; +while(digit, +i(#-1,point++)=digit&1; +digit>>=1; +); +i; +" +map[-3] [-1] rm[-2,-1] +else fill 0 +fi +if $2 negate fi +#@cli rep_bin2dec: +#@cli : Convert binary numbers to digit representation using the carry-over method. Large binary number is supported here. +#@cli : $ echo ${rep_bin2dec_dd\ 111111111111000000000001011111111111111100000000000011111111111111111111111111111111111111111111100000000000000000000000000001111111111111111111111111110000000000000000} +rep_bin2dec: +$=arg +n0={_'0'} +res,sep= +repeat $# { +p:=$>+1 +('${arg$p}') +if im<_'0'||iM>_'1' error inv_char_det fi +crop. {xM},100% +-. {'0'} + +if w<=53 +eval[-1] 1 error not_bin fi +1 +eval[-2] >"begin( +da_push(#-1,0); +); +max_index=da_size(#-1)-1; +carry_over=0; +repeat(da_size(#-1),pos, +dec_digit_pos=max_index-pos; +new_number=(i[#-1,dec_digit_pos]<<1)+carry_over; +carry_over=int(new_number/10); +i[#-1,dec_digit_pos]=new_number%10; +); +if(carry_over,da_insert(#-1,0,1);); +if(i,++i[#-1,da_size(#-1)-1]); +end( +resize(#-1,da_size(#-1),1,1,1,-1); +);" +rm.. +} +#@cli rep_nearest_ratio: value_a>0,value_b>0,_maximum_proposition_number>0,_output_whether_true_ratio={ 0=False | 1=True } +#@cli : Return nearest ratio from 2 different values +#@cli : Default value: '_maximum_divisor=0' +rep_nearest_ratio: +skip ${3=0},${4=0} +check "!(find([${1-2}]>0,0,0,1)+1)&&isint($3)&&$3>=0" +eval " +const nv=2+($4&1); +const max_prop_num=$3; +v=[${1-2}]; +a=min(v); +b=max(v); +common_number=gcd(a,b); +c=b/common_number; +true_ratio=0; +!max_prop_num||cv[1]?[b,a]:[a,b]; +):( +ratio=a/b; +proposition_number=round(ratio*max_prop_num); +common_number=gcd(proposition_number,max_prop_num); +b=max_prop_num/common_number; +proposition_number/=common_number; +a=proposition_number; +ans=v[0]>v[1]?[b,a]:[a,b]; +); +vectornv(ans,true_ratio); +" +#@cli rep_red_acrylic_filter: [source_image],_luminosity_blend_factor>=0%,_green_cut>=0%,_green_visibility>=0% +#@cli : Alter a image so that target image would be visible using a red acrylic plastic sheet as cover. +rep_red_acrylic_filter: +skip ${1=},${2=0%},${3=0%},${4=100%} +n_imgs,blend_factor,boost,green_chroma={$!},{cut($2,0,1)},{cut(abs($3),0,1)*255},{cut($4,0,1)} +import_img=${is_image_arg\ $1} +if $import_img||($n_imgs&1) +eval " +start_vector=[w#0,h#0,d#0]; +same_dim=1; +repeat($n_imgs-1,p, +q=p+1; +if([w#q,h#q,d#q]!=start_vector,same_dim=0;break();); +); +same_dim;" +eq_dims=${} +if $import_img +pass$1 0 +fi +if s&1 +to_gray[-1] +else +to_graya[-1] +split[-1] c +/. 255 +*[-2,-1] +fi +if $!-$n_imgs>1 error inv_imp_count fi +if $eq_dims +target_dim={[w#0,h#0]} +rep_aspect_crop_2d[-1] $target_dim +resize[-1] $target_dim,100%,100%,3 +name[-1] channel +repeat $!-1 { +local[$>,channel] { +if s#0&1 to_gray.. +else +to_graya.. +split.. c +fi +100%,100%,100%,100% ++negate[0] 255 +a[0,-2,-1] c +image[0] [channel],0,0,0,1 +if $!==3 append[0,1] c fi +shared[0] 0 shared[0] 1 +if $blend_factor +image[-1] [-2],0,0,0,0,$blend_factor +fi +if $boost +cut[-1] $boost,255 +fi +if $green_chroma<1 +*[-1] $green_chroma +fi +rm[-2,-1] +} +} +rm[channel] +else +store. channel +foreach { +contain_alpha=0 +target_dim={[w,h]} +if s&1 +to_gray +else +to_graya +split c +contain_alpha=1 +fi +$channel +rep_aspect_crop_2d. $target_dim +resize. $target_dim,100%,100%,3 ++negate[0] 255 +if $blend_factor +image.. [0],0,0,0,0,$blend_factor +fi +if $boost +cut.. $boost,255 +fi +if $green_chroma<1 +mul.. $green_chroma +fi +if $contain_alpha +append[0,2,3] c +fi +append c +} +fi +else +source_pos,target_pos={[1,0]} +repeat $!>>1 { +contain_alpha,current_source_pos=0,$source_pos +target_dim={[w#$target_pos,h#$target_pos]} +if s#$source_pos&1 +to_gray[$source_pos] +else +to_graya[$source_pos] +split[$source_pos] c +/. 255 +*[$source_pos,{$source_pos+1}] +fi +if s#$target_pos&1 +to_gray[$target_pos] +else +to_graya[$target_pos] +split[$target_pos] c +contain_alpha,current_source_pos+=1 +fi +rep_aspect_crop_2d[$current_source_pos] $target_dim +resize[$current_source_pos] $target_dim,100%,100%,3 ++negate[$target_pos] 255 +if $blend_factor +image[$current_source_pos] [$target_pos],0,0,0,0,$blend_factor +fi +if $boost +cut[$current_source_pos] $boost,255 +fi +if $green_chroma<1 +*[$current_source_pos] $green_chroma +fi +append[$target_pos,$current_source_pos] c +append[$target_pos,-1] c +if $contain_alpha +append[$target_pos,{$target_pos+1}] c +fi +source_pos,target_pos+=1 +} +fi +#@cli rep_lavander_binary_map: _size_of_arr_by_power_of_two>0,_mode={ -1=custom | 0=and | 1=or | 2=xor },_bin_a,_bin_b,_shift>0,custom_expression +#@cli : Create a texture that does the following steps: +#@cli : 1) Create an array of integer that matches index with size of 2^n. +#@cli : 2) Create another array which is the count of 'bin_a' in binary representation of the previous array. +#@cli : 3) Count sort the array of integer with the count of binary number array. +#@cli : 4) Delete all other array other than the sorted array. +#@cli : 5) Generate a surface with row and column the same size as the primary array, and use formula which takes values from the sorted value, and then find the count of 'bin_b' in binary representation of the found value. +#@cli : - Built-in Macros - +#@cli : flip(v) - Flips the bitwise values of number +#@cli : and(a,b) - a & b +#@cli : or(a,b) - a | b +#@cli : - End of Built-in Macros - +#@cli : Note : The idea comes from Lavander at discord/generative. Based on a Python code. +#@cli : Default values: '_size_of_arr_by_power_of_two=11','_mode=2','_bin_a=01','_bin_b','_shift=0', ++rep_lavander_binary_map: +skip ${1=11},${2=2},${3=01},${4=10},${5=0},${6=} +check "$1>0&&($1==int($1))&&(isint($2)||('-'=='$2'))" +a6={size('$6')} +shift,length,mode,str_code={int(abs($5))},{2^$1},{v='$2'=='-';n=isint($2)?$2:0;v?0:(n>=0?n%3+1:-((abs(n)-1)%3+1));},0 +size_of_arr={int(log2($length+$shift-1))+1} +str_code_2=n=init_num() +act_arr_sortclass={$mode>-1} +if !$mode&&!$a6 error custom_formula_required fi +if $act_arr_sortclass +$length,1,1,1,x +if v='$3';max(v)>49||min(v)<48 error inv_char_arg_3 fi ++f. :"begin( +const size_binary_arr=$size_of_arr; +init_bin_arr=vector(#size_binary_arr,-1); +bin_search_arr='$3'-47; +const bin_search_arr_size=size(bin_search_arr); +const max_pos=size_binary_arr-bin_search_arr_size+1; +); +count=p=0; +n=i+$shift; +bin_arr=init_bin_arr; +rf=int(log2(n))+1; +mk=rf-1; +repeat(rf,k, +bin_arr[mk-k]=(n>>k)&1; +); +++bin_arr; +while(bin_arr[p]&&pbegin(n=0;);i?(v=n;n+=i;v;); +f.. >v=i(#-1,i);++i(#-1,i);v; +{w#-2},1,1,1 +eval... i(#-1,i)=i(#-4,x); +rm[-4--2] +fi +if $act_arr_sortclass?(v='$4';):(v='$3';);max(v)>49||min(v)<48 error inv_char_arg_4 fi +if !$mode +str_code=ix=max_index-x;iy=max_index-y;int($6) +str_code_2..=ix=max_index-x;iy=max_index-y; +$length,$length,1,1,:" +begin( +const max_index=w-1; +flip(v)=xor((1<<(int(log2(v))+1))-1,v); +and(a,b)=a&b; +or(a,b)=a|b; +x()=i(#-1,x,0,0,0,0,2); +y()=i(#-1,y,0,0,0,0,2); +ix()=i(#-1,max_index-x,0,0,0,0,2); +iy()=i(#-1,max_index-y,0,0,0,0,2); +); +"$str_code"; +" +size_of_arr={int(log2(iM#-1))+1} +rm. +fi +if $act_arr_sortclass bin_search_arr={'$4'-47} +else bin_search_arr={'$3'-47} +fi +$length,$length,1,1,:"begin( +const shift_factor=$shift; +const max_index=w-1; +const size_binary_arr=$size_of_arr; +init_bin_arr=vector(#size_binary_arr,-1); +bin_search_arr=["$bin_search_arr"]; +const bin_search_arr_size=size(bin_search_arr); +const mode=$mode; +flip(v)=xor((1<<(int(log2(v))+1))-1,v); +and(a,b)=a&b; +or(a,b)=a|b; +x()=i(#-1,x,0,0,0,0,2); +y()=i(#-1,y,0,0,0,0,2); +ix()=i(#-1,max_index-x,0,0,0,0,2); +iy()=i(#-1,max_index-y,0,0,0,0,2); +mode==3?( +init_num()=xor(i(#-1,x,0,0),i(#-1,y,0,0)); +): +mode==2?( +init_num()=i(#-1,x,0,0)|i(#-1,y,0,0); +): +mode==1?( +init_num()=i(#-1,x,0,0)&i(#-1,y,0,0); +): +mode==-1?( +shift_factor?( +init_num()=(x+shift_factor)&(y+shift_factor); +):( +init_num()=x&y; +); +): +mode==-2?( +shift_factor?( +init_num()=(x+shift_factor)|(y+shift_factor); +):( +init_num()=x|y; +); +): +mode==-3?( +shift_factor?( +init_num()=xor(x+shift_factor,y+shift_factor); +):( +init_num()=xor(x,y); +); +):( +init_num()=int("$6"); +); +const max_pos=size_binary_arr-bin_search_arr_size+1; +); +count=p=0; +"$str_code_2"; +bin_arr=init_bin_arr; +rf=int(log2(n))+1; +mk=rf-1; +repeat(rf,k, +bin_arr[mk-k]=(n>>k)&1; +); +++bin_arr; +while(bin_arr[p]&&p0 +m "vibrance_ych_adj: +f \"begin( +const vibrance_factor="$vibrance_factor_ych"; +); +v=vibrance_factor*(0.63235455751419067^vibrance_factor-i^vibrance_factor); +chroma_factor=max(0,1+v); +i*chroma_factor; +\" +" +else +vibrance_factor_ych={1-abs($vibrance_factor_ych)} +m "vibrance_ych_adj: * "$vibrance_factor_ych"" +fi +m "cmd_vibrance: +f. 255*((I/255)^1.5) +rgb2yuv. +shared. 1,2 +f. [norm(I),atan2(i1,i0)] +shared. 0 +vibrance_ych_adj. +rm. +f. [i0*cos(i1),i0*sin(i1)] +rm. +yuv2rgb. +f. 255*((I/255)^0.66666666666666666) +" +remove_shared=0 +foreach { +if inrange(s,3,4,1,1) +if s==4 +shared. 0,2 +remove_shared=1 +fi +cmd_vibrance. +if $remove_shared +remove. +remove_shared=0 +fi +fi +} +uncommand cmd_vibrance,vibrance_ych_adj +#@cli rep_import_pdn_txt: file_a...file_z...,_discard_alpha={ 0=keep | 1=discard_alpha | 2=auto } +#@cli : Import PDN Palette (.txt) +#@cli : There can be as many files. This import file relative to your current directory. +#@cli : Default values: '_discard_alpha=2' ++rep_import_pdn_txt: +if narg($-1)&&$#>1 alpha_mode={$-1%3} +else alpha_mode=2 +fi +0 +newline,commentary={'\n'},{';'} +local[-1] { +if $#>1 it ${1--2} else it $1 fi +rm[0] +foreach { +split -,$newline +foreach { +if i==$commentary +rm +else +if h<8 rm continue fi +eval " +const commentary=$commentary; +o=-1; +is_hex_character(character)= +inrange(character,_'0',_'9',1,1)|| +inrange(character,_'a',_'f',1,1)|| +inrange(character,_'A',_'F',1,1); +repeat(w#-1,p, +char=i(#-1,0,p); +if(char==commentary,break();); +if(is_hex_character(char), +o=p; +break(); +); +); +o;" +if ${}==-1 +rm +else +crop 0,${},0,{${}+7} +(${rep_hex2int8\ {t}}) +permute. cyzx +rm.. +fi +fi +} +remove_duplicates +a x +shift 0,0,0,-1,2,0 +if $alpha_mode +if $alpha_mode==2 +sh. 3 +if !iv#-1 +rm. +channels 0,2 +s x remove_duplicates a x +else rm. +fi +else channels 0,2 +fi +fi +} +} +#@cli rep_correct_exp_ne: string +#@cli : Return corrected file name for exporting files. +#@cli : Note: Every single arguments applied to this command counts as a single string. +rep_correct_exp_ne: +str_inp="$*" +str_stoi=[{'$str_inp'}] +str_length:=size($str_stoi) +if $str_length>255 error str_length<256==F fi +if $str_length==3 +if find('AUXCONNULPRN',$str_stoi,0,3)+1 +error "Cannot use Windows reserved filename" +fi +elif $str_length==4 +if (find('COMLPT',($str_stoi)[0,3],0,3)+1)&&inrange(($str_stoi)[3],_'0',_'9',1,1) +error "Cannot use Windows reserved filename" +fi +fi +(0) => temporary_string_image +eval " +const string_to_process=$temporary_string_image; +inv_chars='#<>:/?*\"'; +da_push(#string_to_process,"{'$str_inp'}"); +end_ind=da_size(#string_to_process)-1; +for(p=end_ind,p>-1,--p, +v=i[#string_to_process,p]; +find(inv_chars,v,0,1)+1?( +da_remove(#string_to_process,p); +); +v=='~'?( +I[#string_to_process,p]='-'; +): +v=='.'?( +I[#string_to_process,p]='_'; +); +); +end(da_freeze(#string_to_process););" +if h==3 +if find('AUXCONNULPRN',crop(#$temporary_string_image),0,3)+1 +error "Cannot use Windows reserved filename" +fi +elif h==4 +if (find('COMLPT',(crop(#$temporary_string_image))[0,3],0,3)+1)&&inrange(i(#$temporary_string_image,0,3),_'0',_'9',1,1) +error "Cannot use Windows reserved filename" +fi +fi +u {t} +rm. +#@cli rep_find_factors_of: num_0... +#@cli : Return the factors found in all numbers at once. +#@cli : +#@cli : Author : Reptorian. +#@cli : $ echo ${rep_find_factors_of\ 256} +#@cli : $ echo ${rep_find_factors_of\ 256,100} +#@cli : $ echo ${rep_find_factors_of\ 256,100,50} +rep_find_factors_of: +if !$# error ("\$\#">0)==F fi +if $#==1 +v=$1 +if $v<0 error inv_inp +elif $v>5000000000000000 error exc_lim +elif $v!=int($v) error inv_inp +elif $v<2 u $v return +fi +else +if $#>2 v=${rep_gcd_multiple_numbers\ $*} +else v={gcd(${1-2})} +fi +if $v<2 u $v return fi +fi +1,1,1,3 +eval " +start_v=v=$v; +square=int(sqrt(v)); +for(n=2,n<=square&&n<=v,++n, +isPrime=1; +for(p=0,pn, +break(); +); +if(!(n%prime), +isPrime=0; +break(); +); +); +if(isPrime, +count=0; +while(!(v%n), +++count; +v/=n; +); +if(count, +da_push(#-1,[n,count,0]); +diff=(da_back(#-1))[0]-n; +if(diff,I[#-1,da_size(#-1)-1]=[n,count,diff]); +square=int(sqrt(v)); +); +); +); +if(v!=1, +da_push(#-1,[v,1,0]); +diff=(da_back(#-1))[0]-v; +if(diff,I[#-1,da_size(#-1)-1]=[v,1,diff]); +); +output=da_size(#-1)==1&&v==start_v?v:0; +da_freeze(#-1); +if(output, +set('pv',v); +); +output; +" +if ${} +remove. +status 1,$pv +else +{prod(crop(0,0,0,1,1,h,1,1)+1)},1,1,1,"begin( +const num_of_primes=h#-1; +primes_freq_choices=crop(#-1,0,0,0,1,1,num_of_primes,1,1)+1; +primes_list=crop(#-1,0,0,0,0,1,num_of_primes,1,1)-crop(#-1,0,0,0,2,1,num_of_primes,1,1); +modulo_list=vector(#num_of_primes,0); +modulo_list[0]=tv=1; +repeat(num_of_primes-1,p, +tv*=primes_freq_choices[p]; +modulo_list[p+1]=tv; +); +result=vector(#w,0); +); +m=int(x/modulo_list)%primes_freq_choices; +result[x]=prod(primes_list^m); +end( +merge(result,+); +set('{}',v2s(sort(result))); +);" +remove[-2,-1] +fi +rep_gcd_multiple_numbers: +eval >" +arr=[$*]; +const size_arr=size(arr); +v=arr[0]; +for(n=1,n1,num_of_repeats>1,_muldiv_coeff_a,_muldiv_coeff_b,_muldiv_oper_a={ 0=mul | 1=div},muldiv_oper_b={ 0=mul | 1=mul},use_old_x={ 0=false | 1=true },_sublevel>=0,_seed,auto_norm,_sym_mode={0=mode_0 | 1=mode_1} +#@cli : Generates Circle Fractal. Serendipitous Circle was originally written in 6800 assembly by William F. Galway in December 1976. +#@cli : Note: The output of this command is 2 channel. The first channel is value from the Serendipitous Circle, and the second channel is the alpha value ranging from 0-1. +#@cli : Default values: '_sublevel=0','_seed=n/a' +rep_serendipitous_circle: +skip ${3=2},${4=2},${5=1},${6=1},${7=0},${8=0},${9=},${10=0},${11=1} +pts,num_of_repeats,muldiv_coeff_a,muldiv_coeff_b,muldiv_oper_a,muldiv_oper_b,use_old_x,sublevel,seed,auto_norm,sym_mode=${1-4},{$5%2},{$6%2},{$7%2},{abs($8)+1},$9,{int(abs($10))},{($11%2)*3} +command "rep_sercirc_autonorm: auto_norm=$""1 +erode. $auto_norm +dilate.. $auto_norm cut[-3] {iM#-2},{im#-1} rm[-2,-1]" +pts*=$sublevel +if $muldiv_coeff_a!=0 +if $muldiv_oper_a +if $muldiv_coeff_a<0 +calc_xn_part=+yi/{abs($muldiv_coeff_a)} +else +calc_xn_part=-yi/$muldiv_coeff_a +fi +else +if $muldiv_coeff_a<0 +calc_xn_part=+yi*{abs($muldiv_coeff_a)} +else +calc_xn_part=-yi*$muldiv_coeff_a +fi +fi +else +if ('$muldiv_coeff_a')[0]==45 +calc_xn_part=+yi +else +calc_xn_part=-yi +fi +fi +if $use_old_x +old_x_expr=xo=xi; +yn_part=xo +else +yn_part=xn +fi +if $muldiv_coeff_b!=0 +if $muldiv_oper_b +if $muldiv_coeff_b<0 +calc_yn_part=-$yn_part/{abs($muldiv_coeff_b)} +else +calc_yn_part=+$yn_part/$muldiv_coeff_b +fi +else +if $muldiv_coeff_b<0 +calc_yn_part=-$yn_part*{abs($muldiv_coeff_b)} +else +calc_yn_part=+$yn_part*$muldiv_coeff_b +fi +fi +else +if ('$muldiv_coeff_b')[0]==45 +calc_yn_part=-$yn_part +else +calc_yn_part=+$yn_part +fi +fi +{ceil((w+1)/2)*$sublevel},{ceil((h+1)/2)*$sublevel},1,2 rm.. +ratio={max(w,h)/min(w,h)} +$pts,1,1,1,:"begin_t( +if(narg($seed),srand($seed+t);); +const ratio=$ratio; +const sqr_ratio=sqr(ratio); +const inv_ratio=1/ratio; +const max_dimension=max(w#-1,h#-1)*ratio; +); +point=[int(u(0,max_dimension,1,0)),int(u(0,max_dimension,1,0))]; +xi=point[0]; +yi=point[1]; +repeat($num_of_repeats, +i(#-1,int(xi/sqr_ratio),int(yi/sqr_ratio),0,0)++; +i(#-1,int(xi/sqr_ratio),int(yi/sqr_ratio),0,1)=1; +"$old_x_expr" +xn=(xi"$calc_xn_part")%max_dimension; +yn=(yi"$calc_yn_part")%max_dimension; +xi=xn; +yi=yn; +);" +rm. s. c +r.. {ceil(w/$sublevel)},{ceil(h/$sublevel)},1,1,2 +r. {w#-2},{h#-2},1,1,5 +f.. i/(i#-1?i#-1:1) +if $auto_norm +rep_sercirc_autonorm.. $auto_norm +fi +a[-2,-1] c +rep_symmetrize_xy. $sym_mode +#@cli rep_mitchell_concatenation: startnum_a,startnum_b,_base,_base_2,_method_a={ 0=sub | 1=add | 2=mul},_method_b={ 0=sub | 1=add | 2=mul},_pixel_size,[palette],[palette],_auto_resize_pal,_shape_id,_shape_ratio,_shape_angle,shape_dir,shape_repeat_mode,shape_fit,_shape_sub,_shape_option_1..._shape_option_n +#@cli : Generates Kerry Mitchell Concatenation Art. Detailed explanation can be found at - http://www.kerrymitchell.art/spacefilling-blog/2013/11/concatenations.html +#@cli : Default values: '_int_base=10','_method_a=0','_method_b=1','_palette=n/a','hex_bg_col=n/a','_shape=n/a' +rep_mitchell_concatenation: +skip ${1=},${2=},${3=},${4=},${5=},${6=},${7=1},${8=},${9=},${10=1},${11=},${12=1},${13=0},${14=0},${15=0},${16=1},${17=1},${18=} +if narg($1)&&narg($2) +startnum_a,startnum_b={max(1,int(abs($1)))},{max(1,int(abs($2)))} +elif narg($1)||narg($2) +if narg($1) +startnum_a,startnum_b={max(1,int(abs($1)))},{max(1,int(abs($1)))} +else +startnum_a,startnum_b={max(1,int(abs($2)))},{max(1,int(abs($2)))} +fi +else +startnum_a,startnum_b=1,1 +fi +if narg($3)&&narg($4) +base_a,base_b={max(2,int(abs($3)))},{max(2,int(abs($4)))} +elif narg($3)||narg($4) +if narg($3) +base_a,base_b={max(2,int(abs($3)))} +else +base_b,base_b={max(2,int(abs($4)))} +fi +else base_a,base_b=10 fi +if narg($5)&&narg($6) +method_a,method_b={abs(int($5))},{abs(int($6))} +elif narg($5)||narg($6) +if narg($5) +method_a,method_b={abs(int($5))} +else +method_a,method_b={abs(int($6))} +fi +else method_a,method_b=1,1 fi +startnum_diff,base_diff,method_diff,shape_size={$startnum_a!=$startnum_b},{$base_a!=$base_b},{$method_a!=$method_b},{max(1,int(abs($7)))} +use_shape,double_concatenation_mode,use_different_dimensions,num_of_images={narg($11)?($shape_size>=4?1:0):0},{$startnum_diff||$base_diff||$method_diff},{$!>1?(use_diff=0;start_dim=[w#0,h#0];repeat($!-1,p,q=p+1;if([w#q,h#q]!=start_dim,use_diff=1;break();););use_diff;):0},{$!} +if $use_different_dimensions +dim_list=[{expr('p=int(x/2);x%2?ceil(h#p/$shape_size)*$shape_size:ceil(w#p/$shape_size)*$shape_size',$!*2,1,1,1)}] +fi +width,height=${-max_w},${-max_h} +rm +{ceil($width/$shape_size)},{ceil($height/$shape_size)},1,2,vector(#2,-1) +if $use_shape +ratio:=cut(abs($12),0,1) +if $ratio +shape_ang,mirror,tile_boundary,fit_size=$13,{$14%3},{$15%4},$17 +if ${is_image_arg\ $11} +pass$11 0 +if s<=4&&s>1 +if s==3 to_gray. +else +s. c,{arg(int(s/2,-3,-1)} +fi +elif s==5 +s. c,-4 cmyk2rgb.. to_gray.. *[-2,-1] +elif s>5 error inv_chans_count +fi +else +shape_sub:=abs($16)+1 +sid="$11" +if isnum($11) if isint($11) +sid=${"-arg "1+$sid"","australia,barbedwire,circle,crosshair,cupid,diamond,dragon,dragonfly,fern,flip,gear,gumleaf,heart,information,kookaburra,mail,mapleleaf,paint_splat,paw,phone,polygon,rooster,shopping_cart,snowflake,star"} +fi fi +if $#>17 shape_$sid {$shape_size*$shape_sub},${18--1} +else shape_$sid {$shape_size*$shape_sub} +fi +r. {ceil(w/$shape_size)*$shape_size},{ceil(h/$shape_size)*$shape_size},100%,100%,0,0,.5,.5 +fi +if $shape_ang-360*floor($shape_ang/360) rotate. $shape_ang fi +if $mirror==1 mirror. x +elif $mirror==2 mirror. y +fi +n. 0,1 autocrop. 0 +shape_dimensions_length={round($shape_size*$ratio)} +if $fit_size +resize2din. $shape_dimensions_length,$shape_dimensions_length,5 +else +resize. $shape_dimensions_length,$shape_dimensions_length,100%,100%,5 +fi +resize. $shape_size,$shape_size,100%,100%,0,0,.5,.5 +cut. 0,1 n. 0,1 +avgc={ia#-1} +if $tile_boundary +if $tile_boundary==1 ++mirror. x +a[-2,-1] z +elif $tile_boundary==2 ++mirror. y +a[-2,-1] z +else ++mirror. x ++mirror.. y ++mirror. x +a[-4--1] z +fi +fi +store. shape +fi +fi +if $double_concatenation_mode +if $base_b!=10 rep_concat_conset_fill_alt_base $startnum_b,$base_b +else rep_concat_conset_fill $startnum_b +fi +if $base_a!=10 +rep_concat_conset_fill_alt_base. $startnum_a,$base_a +else +rep_concat_conset_fill $startnum_a +fi +out_method_a=${arg\ $method_a+1,sub_concat_conset,add_concat_conset,mul_concat_conset} +out_method_b=${arg\ $method_b+1,sub_concat_conset,add_concat_conset,mul_concat_conset} +rep_index_based_$out_method_a[-2] $startnum_a,$base_a +rep_index_based_$out_method_b[-1] $startnum_b,$base_b +a[-2,-1] z +if ${is_image_arg\ $8} +pass$8 0 +if h#-1>1||d#-1>1 +num_of_chans={s#-1} +permute. cxyz +unroll. x +{w#-1/$num_of_chans},1,1,$num_of_chans,crop(#-1,x*$num_of_chans,0,0,0,$num_of_chans,1,1,1) +rm.. +elif w#-1==1 error inv_dims +fi +if $10 r. $base_a,1,1,100%,5 fi +fi +if ${is_image_arg\ $9} +pass$9 0 +if h#-1>1||d#-1>1 +num_of_chans={s#-1} +permute. cxyz +unroll. x +{w#-1/$num_of_chans},1,1,$num_of_chans,crop(#-1,x*$num_of_chans,0,0,0,$num_of_chans,1,1,1) +rm.. +elif w#-1==1 error inv_dims +fi +if $10 r. $base_b,1,1,100%,5 fi +fi +if $use_shape +$shape +{w#0*$shape_size},{h#0*$shape_size},1,{s#-2+1} +img_count={$!} +{w#0},{h#0},1,1,:"begin( +const shape_size=$shape_size; +const tile_boundary=$tile_boundary; +const num_chan=s#1; +const tchan=num_chan+1; +const alpha_size=sqr(shape_size); +const tile_size=alpha_size*num_chan; +empty_vec=[-1,-1]; +filled_alpha=vector(#alpha_size,255); +find_tile_mode()=(sv[0]>-1)&&(sv[1]>-1); +$img_count==5?( +generate_color_a()=I(#1,i(#0,x,y,0,0),0,0,0,2); +generate_color_b()=I(#2,i(#0,x,y,1,0),0,0,0,2); +): +$img_count==4?( +generate_color_a()=I(#1,i(#0,x,y,0,0),0,0,0,2); +generate_color_b()=I(#1,i(#0,x,y,1,0),0,0,0,2); +):( +generate_color_a()=[sv[0]]; +generate_color_b()=[sv[1]]; +); +tile_boundary==3?( +shape_0=crop(#-2,0,0,0,0,shape_size,shape_size,1,1); +shape_1=crop(#-2,0,0,1,0,shape_size,shape_size,1,1); +shape_2=crop(#-2,0,0,2,0,shape_size,shape_size,1,1); +shape_3=crop(#-2,0,0,3,0,shape_size,shape_size,1,1); +tile_v0=resize(shape_0,tile_size,0,2); +tile_v1=resize(shape_1,tile_size,0,2); +tile_v2=resize(shape_2,tile_size,0,2); +tile_v3=resize(shape_3,tile_size,0,2); +const mx=w-1; +const my=h-1; +const startnum=$startnum_a; +find_pos()=1+sum((mx-x)%2,2*((my-y+startnum)%2)); +generate_tile_b()=( +shape_tile=arg(find_pos(),tile_v0,tile_v1,tile_v2,tile_v3); +color_tile=vc_0+vc_1*shape_tile; +tile=[color_tile,filled_alpha]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +); +generate_tile_a()=( +shape_alp=arg(find_pos(),shape_0,shape_1,shape_2,shape_3); +sv[0]>=0?( +color=generate_color_a(); +color_tile=resize(color,tile_size,1,0); +tile=[color_tile,shape_alp*255]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +):( +color=generate_color_b(); +color_tile=resize(color,tile_size,1,0); +tile=[color_tile,(1-shape_alp)*255]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +); +); +): +tile_boundary?( +shape_0=crop(#-2,0,0,0,0,shape_size,shape_size,1,1); +shape_1=crop(#-2,0,0,1,0,shape_size,shape_size,1,1); +tile_v0=resize(shape_0,tile_size,0,2); +tile_v1=resize(shape_1,tile_size,0,2); +const max_index=(tile_boundary%2)?w-1:h-1; +tile_boundary%2?( +find_pos()=(max_index-x)%2; +):( +const startnum=$startnum_a; +find_pos()=(max_index-y+startnum)%2; +); +generate_tile_b()=( +shape_tile=find_pos()?tile_v1:tile_v0; +color_tile=vc_0+vc_1*shape_tile; +tile=[color_tile,filled_alpha]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +); +generate_tile_a()=( +shape_alp=find_pos()?shape_1:shape_0; +sv[0]>=0?( +color=generate_color_a(); +color_tile=resize(color,tile_size,1,0); +tile=[color_tile,shape_alp*255]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +):( +color=generate_color_b(); +color_tile=resize(color,tile_size,1,0); +tile=[color_tile,(1-shape_alp)*255]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +); +); +):( +shape_alp=crop(#-2,0,0,0,0,shape_size,shape_size,1,1); +alp_tile=resize(shape_alp,tile_size,0,2); +generate_tile_b()=( +color_tile=vc_0+vc_1*alp_tile; +tile=[color_tile,filled_alpha]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +); +generate_tile_a()=( +sv[0]>=0?( +color=generate_color_a(); +color_tile=resize(color,tile_size,1,0); +tile=[color_tile,shape_alp*255]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +):( +color=generate_color_b(); +color_tile=resize(color,tile_size,1,0); +tile=[color_tile,(1-shape_alp)*255]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +); +); +); +); +sv=[i(#0,x,y,0,0),i(#0,x,y,1,0)]; +if(sv!=empty_vec, +find_tile_mode()?( +c0=generate_color_b(); +c1=generate_color_a(); +diff=c1-c0; +vc_0=resize(c0,tile_size,1,0); +vc_1=resize(diff,tile_size,1,0); +generate_tile_b(); +):( +generate_tile_a(); +); +); +" +k.. +if $num_of_images>1 +r. 100%,100%,$num_of_digits,100%,1 +fi +if $num_of_images>1 s. z fi +if $use_different_dimensions +repeat $num_of_images { +new_width_height:=($dim_list)[$>*2,2] +r[$>] $new_width_height,1,100%,0,0,1,1 +} +fi +else +if $!==2 +{w#-2},{h#-2},2,{s#-1+1},"v=i(#-2,x,y,z,0); +v>=0?[I(#-1,v,0,0,2,1),255]:vector(#s,0);" +rm[-3,-2] +elif $!==3 +{w#-3},{h#-3},2,{s#-1+1},"v=i(#-3,x,y,z,0); +z?(v>=0?[I(#-2,v,0,0,2,1),255]:vector(#s,0);): +(v>=0?[I(#-1,v,0,0,2,1),255]:vector(#s,0););" +rm[0,-3,-2] +display +elif $!>3 error only_one_pal +fi +if ($shape_size>1)||($num_of_images>1) +r. {w#-1*$shape_size},{h#-1*$shape_size},{2*$num_of_images},100%,1 +fi +if $num_of_images s. z,-2 fi +if $use_different_dimensions +repeat $num_of_images { +new_width_height:=($dim_list)[$>*2,2] +r[$>] $new_width_height,2,100%,0,0,1,1 +} +fi +fi +else +if $base_a!=10 rep_concat_conset_fill_alt_base $startnum_a,$base_a +else rep_concat_conset_fill $startnum_a +fi +out_method=${arg\ $method_a+1,sub_concat_conset,add_concat_conset,mul_concat_conset} +rep_index_based_$out_method $startnum_a,$base_a +if ${is_image_arg\ $8} +pass$8 0 +if h#-1>1||d#-1>1 +num_of_chans={s#-1} +permute. cxyz +unroll. x +{w#-1/$num_of_chans},1,1,$num_of_chans,crop(#-1,x*$num_of_chans,0,0,0,$num_of_chans,1,1,1) +rm.. +elif w#-1==1 error inv_dims +fi +if $10 r. $base_a,1,1,100%,5 fi +fi +if ${is_image_arg\ $9} +pass$9 0 +if h#-1>1||d#-1>1 +num_of_chans={s#-1} +permute. cxyz +unroll. x +{w#-1/$num_of_chans},1,1,$num_of_chans,crop(#-1,x*$num_of_chans,0,0,0,$num_of_chans,1,1,1) +rm.. +elif w#-1==1 error inv_dims +fi +if $10 r. $base_a,1,1,100%,5 fi +fi +if $use_shape +$shape +if $!>3 error only_one_pal +else +{w#0*$shape_size},{h#0*$shape_size},1,{s#-2+1} +img_count={$!} +eval[0] :"begin( +const shape_size=$shape_size; +const tile_boundary=$tile_boundary; +const num_chan=s#1; +const tchan=num_chan+1; +const tile_size=sqr(shape_size)*num_chan; +$img_count==4?( +generate_color()=I(#-3,i,0,0,0,2); +):( +generate_color()=[i]; +); +tile_boundary==3?( +alpha_0=crop(#-2,0,0,0,0,shape_size,shape_size,1,1)*255; +alpha_1=crop(#-2,0,0,1,0,shape_size,shape_size,1,1)*255; +alpha_2=crop(#-2,0,0,2,0,shape_size,shape_size,1,1)*255; +alpha_3=crop(#-2,0,0,3,0,shape_size,shape_size,1,1)*255; +const mx=w-1; +const my=h-1; +const startnum=$startnum_a; +find_pos()=1+sum((mx-x)%2,2*((my-y+startnum)%2)); +generate_tile()=( +alpha=arg(find_pos(),alpha_0,alpha_1,alpha_2,alpha_3); +color=generate_color(); +color_tile=resize(color,tile_size,1); +tile=[color_tile,alpha]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +); +): +tile_boundary?( +alpha_0=crop(#-2,0,0,0,0,shape_size,shape_size,1,1)*255; +alpha_1=crop(#-2,0,0,1,0,shape_size,shape_size,1,1)*255; +const max_index=(tile_boundary%2)?w-1:h-1; +tile_boundary%2?( +find_pos()=(max_index-x)%2; +):( +const startnum=$startnum_a; +find_pos()=(max_index-y+startnum)%2; +); +generate_tile()=( +alpha=find_pos()?alpha_1:alpha_0; +color=generate_color(); +color_tile=resize(color,tile_size,1); +tile=[color_tile,alpha]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +); +):( +alpha=crop(#-2,0,0,0,0,shape_size,shape_size,1,1)*255; +generate_tile()=( +color=generate_color(); +color_tile=resize(color,tile_size,1); +tile=[color_tile,alpha]; +draw(#-1,tile,x*shape_size,y*shape_size,0,0,shape_size,shape_size,1,tchan); +); +); +); +if(i>=0,generate_tile(););" +fi +k. +else +if $!==2 +{w#-2},{h#-2},1,{s#-1+1},"v=i(#-2,x,y,z,0); +v>=0?[I(#-1,v,0,0,2,1),255]:vector(#s,0);" +rm[-3,-2] +elif $!>2 error only_one_pal +fi +if ($shape_size>1)||($num_of_images>1) +r. {w#-1*$shape_size},{h#-1*$shape_size},$num_of_images,100%,1 +fi +fi +if $num_of_images>1 s. z fi +if $use_different_dimensions +repeat $num_of_images { +new_width_height:=($dim_list)[$>*2,2] +r[$>] $new_width_height,1,100%,0,0,1,1 +} +fi +fi +rep_index_based_mul_concat_conset: +skip ${2=10} ++channels 0 +1,{h},1,1,:"begin( +const length=w#-1; +const hh=h#-1-1; +const startnum=int(abs($1)); +const start_x=length-1; +const start_pos=start_x-1; +const base=int(abs($2)); +logb(n)=log(n)/log(base); +concat_consec_digits_count(n)=n>=base?(t=floor(logb(n));n+(n+1)*t+(base*(1-base^t))/(base-1)):n; +); +N=hh-y+startnum; +num_of_digits=concat_consec_digits_count(N); +tx=max(0,length-num_of_digits); +for(p=start_pos,p>=tx,--p, +multiplier=i(#-2,p,y,0,1); +off=0; +carry_over=0; +secondary_carry_over=0; +multiplier?( +for(q=start_x,q>=tx,--q, +partial_result=multiplier*i(#-2,q,y,0,0)+carry_over; +remainder=partial_result%base; +carry_over=int(partial_result/base); +new_num=max(0,i(#-1,p-off,y,0,0))+remainder+secondary_carry_over; +secondary_remainder=new_num%base; +secondary_carry_over=int(new_num/base); +i(#-1,p-off,y,0,0)=secondary_remainder; +++off; +if((p-off)<0,continue();); +); +):(continue();); +if(secondary_carry_over&&(q!=0), +new_num=max(0,i(#-1,p-off,y,0,0))+secondary_remainder+secondary_carry_over; +secondary_carry_over=int(new_num/base); +secondary_remainder=new_num%base; +i(#-1,p-off,y,0,0)=secondary_remainder; +); +if(p==tx&&(partial_result>base)&&(tx!=0),i(#-1,p-off,y,0,0)=int(partial_result/base);); +);" +rm[-3,-1] +rep_index_based_sub_concat_conset: +skip ${2=10} +{w},{h},1,1,-1 +1,{h},1,1,:"begin( +const length=w#-1; +const hh=h#-1-1; +const startnum=int(abs($1)); +const start_x=length-1; +const base=int(abs($2)); +logb(n)=log(n)/log(base); +concat_consec_digits_count(n)=n>=base?(t=floor(logb(n));n+(n+1)*t+(base*(1-base^t))/(base-1)):n; +zero_fill=vector(#length,0); +); +N=hh-y+startnum; +num_of_digits=concat_consec_digits_count(N); +tx=max(0,length-num_of_digits); +minuend=-1; +if(num_of_digits>1, +ux=tx; +repeat(length, +vd=I(#-2,ux,y); +if(vd[1]>vd[0],minuend=1;break();); +if(vd[0]>vd[1],minuend=0;break();); +++ux; +); +if(minuend!=-1, +subtrahend=1-minuend; +ix=start_x; +repeat(num_of_digits, +vd=I(#-2,ix,y); +if(ix==tx,if(vd[minuend]==vd[subtrahend],break(););); +if(vd[minuend]=base?(t=floor(logb(n));n+(n+1)*t+(base*(1-base^t))/(base-1)):n; +); +ix=start_x; +carry_over=0; +loop_break=0; +N=hh-y+startnum; +num_of_digits=concat_consec_digits_count(N); +tx=max(0,length-num_of_digits); +repeat(min(length,num_of_digits+ds_size), +init_num_vec=I(#-2,ix,y); +if(ix=w#0 +startnum,string_a={max($maxnum_a,1)},"" +break +fi +} +repeat inf { +string_a..=$maxnum_b +({size('$maxnum_b')}) +if $> a[-2,-1] x fi +maxnum_b-=1 +if $maxnum_b<$startnum break fi +} +ts,digits={is#-1},0 +repeat inf { +string_b..={$>+1} +digits+={size('{$>+1}')} +if $digits>=$ts||$digits>w#0 break fi +} +('$string_a') ('$string_b') -[-2,-1] 48 +repeat h#0 { +ns={w#-2-i(#-3,$>)} +if w#-2>w#-1 +j[0] [-2],1~,$>,0,0 +j[0] [-1],1~,$>,0,1 +else +r. {w#-2},100%,100%,100%,0,0,1 +j[0] [-2],1~,$>,0,0 +j[0] [-1],1~,$>,0,1 +fi +if $ns r.. $ns,100%,100%,100%,-1 +else break +fi +} +rm[-3--1] +rep_concat_conset_fill_alt_base: +check $!==1 +startnum={max(abs($1),1)} +maxnum_a,maxnum_b=$startnum,{$startnum+(h-1)} +repeat inf { ++rep_num2altbase $maxnum_a,$2 +if $> a[-2,-1] x fi +maxnum_a-=1 +if $maxnum_a<=1||w#-1>=w#0 +startnum={max($maxnum_a,1)} +rm. +break +fi +} +repeat inf { ++rep_num2altbase $maxnum_b,$2 +nv={w#-1} +if $> rv[-3,-1] a[-3,-1] x fi +($nv) +if $> a[-2,-1] x fi +maxnum_b-=1 +if $maxnum_b<$startnum break fi +} +ts={is#-1} +repeat inf { ++rep_num2altbase {$>+1},$2 +if $> rv[-2,-1] a[-2,-1] x fi +if w#-1>=$ts||w#-1>w#0 break fi +} +repeat h#0 { +ns={w#-3-i(#-2,$>)} +if w#-3>w#-1 +j[0] [-3],1~,$>,0,0 +j[0] [-1],1~,$>,0,1 +else +r. {w#-3},100%,100%,100%,0,0,1 +j[0] [-3],1~,$>,0,0 +j[0] [-1],1~,$>,0,1 +fi +if $ns r... $ns,100%,100%,100%,-1 +else break +fi +} +rm[-3--1] +#@cli rep_BIGINT_division: decimal_number>=0,1<=divisor<=9007199254740992 +#@cli : Perform division on decimal number, then return the value. Supports 1000+ digits positive integer number for decimal_number only! +rep_BIGINT_division: +check "isint($2)&&$1>=0&&inrange($2,1,1<<53,1,1)" +if $1<(1<<53) status {int($1/$2)} +else +if $2>$1 status 0 return +elif $2==1 +if v='$1';min(v)<_'0'||max(v)>_'9'; error inv_char_det fi +status $1 +else +('$1') +if im<_'0'||iM>_'9' error inv_char_det fi +eval " +const _0=_'0'; +const divisor=$2; +const init_shift_num=int(log10(divisor)); +const start_digits_count=init_shift_num+1; +const LenDecStr=w#-1; +start_num=0; +repeat(start_digits_count,p, +start_num=start_num*10+i[#-1,p]-_0; +); +start_num>=divisor?( +tmp=int(start_num/divisor); +i[#-1,0]=tmp+_0; +remainder=start_num-tmp*divisor; +shift_num=init_shift_num; +):( +shift_num=init_shift_num+1; +remainder=start_num; +); +for(p,p=0,1_'9' error inv_char_det fi +-. {_'0'} +return +fi +if $1<(1<<53) +{1+int(log($1)/log($base))},1,1,1,<"begin( +const base=$base; +n=$1; +); +remainder=n%base; +n=int(n/base); +remainder; +" +else +if $base>10 +('$1') -. {_'0'} +if im#-1<0||iM#-1>9 error inv_char_det fi +eval " +const base=$base; +const init_shift_num=int(log10(base)); +const start_digits_count=init_shift_num+1; +const start_LenDecStr=w#-1; +LenDecStr=start_LenDecStr; +remainders_count=0; +while(LenDecStr>15, +start_num=0; +repeat(start_digits_count,p, +start_num=start_num*10+i[#-1,p]; +); +start_num>=base?( +i[#-1,0]=int(start_num/base); +remainder=start_num-i[#-1,0]*base; +shift_num=init_shift_num; +):( +shift_num=init_shift_num+1; +remainder=start_num; +); +for(p,p input +if im#-1<0||iM#-1>9 error inv_char_det fi +1 +eval " +const base=$base; +const input=$input; +LenDecStr=w#input; +while(LenDecStr>15, +shift_num=i[#input,0]=1&&$1<=3999)&&($1==int($1))" +thousands:=int($1/1000) +hundreds:=int($1%1000/100) +tens:=int($1%100/10) +ones:=int($1%10) +u ${arg\ $thousands+1,,M,MM,MMM}${arg\ $hundreds+1,,C,CC,CCC,CD,D,DC,DCC,DCCC,CM}${arg\ $tens+1,,X,XX,XXX,XL,L,LX,LXX,LXXX,XC}${arg\ $ones+1,,I,II,III,IV,V,VI,VII,VIII,IX} +#@cli rep_roman2int: roman_numeral_string,is_strict={ 0=false | 1= true } +#@cli : Return Roman Numeral as integer number. +rep_roman2int: +skip ${2=1} +struppercase $1 +roman_num=${} +eval " +started=char_changed=old_char=old_pos=ans=num=0; +const is_strict=$2?1; +roman_chars=['IVXLCDM']; +const chars_count=size(roman_chars); +num_vals=expr('(x&1?5:1)*10^(x>>1)',chars_count); +char_freq_list=vector(#chars_count,0); +roman_num='"${}"'; +const roman_num_length=size(roman_num); +const dec_roman_num_length=roman_num_length-1; +last_char=roman_num[dec_roman_num_length]; +repeat(roman_num_length,p, +char=roman_num[dec_roman_num_length-p]; +if(started&&!char_changed,char_changed=char!=old_char;); +old_char=char; +pos=find(roman_chars,char,0,1); +if(is_strict, +if(pos-old_pos<-2, +run('error inv_char_gap'); +); +); +old_pos=pos; +if(pos==-1,run('error inv_char')); +encounters=++char_freq_list[pos]; +if(encounters>(3+char_changed), +run('error excess_char'); +); +num=num_vals[pos]; +if(num<<23999,run('error exc_val');); +if(is_strict, +thousands=int(ans/1000); +hundreds=int(ans%1000/100); +tens=int(ans%100/10); +ones=ans%10; +place=0; +test_vector=vector(#roman_num_length,0); +if(thousands, +copy(test_vector[0],'MMM',thousands); +place+=thousands; +); +if(hundreds, +hundreds==9||hundreds==4?( +copy(test_vector[place],(hundreds>5?'CM':'CD'),2); +place+=2; +): +hundreds>4?( +num_of_char=hundreds-4; +copy(test_vector[place],'DCCC',num_of_char); +place+=num_of_char; +):( +num_of_char=hundreds; +copy(test_vector[place],'CCC',num_of_char); +place+=num_of_char; +); +); +if(tens, +tens==9||tens==4?( +copy(test_vector[place],(tens>5?'XC':'XL'),2); +place+=2; +): +tens>4?( +num_of_char=tens-4; +copy(test_vector[place],'LXXX',num_of_char); +place+=num_of_char; +):( +num_of_char=tens; +copy(test_vector[place],'XXX',num_of_char); +place+=num_of_char; +); +); +if(ones, +ones==9||ones==4?( +copy(test_vector[place],(ones>5?'IX':'IV'),2); +place+=2; +): +ones>4?( +num_of_char=ones-4; +copy(test_vector[place],'VIII',num_of_char); +place+=num_of_char; +):( +num_of_char=ones; +copy(test_vector[place],'III',num_of_char); +place+=num_of_char; +); +); +if(roman_num!=test_vector,run('error inv_char_set');); +); +ans;" +#@cli rep_output_jasc: filename +#@cli : Output selected image JASC-PAL files(s).(.pal) +rep_output_jasc: +e[^-1] "Output palettes$? as JASC-PAL palette files(s).(.pal)" +header=JASC-PAL\n0100\n +repeat $! { +if $!>1 filename=${"filename \"$1\",$>"} +else filename="$1" fi +0 => $filename folder,basename,num_of_cols={f},{b},{whd#0} +rm. +output=$num_of_cols\n +to_rgb[0] +permute[0] cxyz +unroll[0] x +repeat $num_of_cols { +r={i(#0,$>*3,0,0)} +g={i(#0,$>*3+1,0,0)} +b={i(#0,$>*3+2,0,0)} +output.=$r" "$g" "$b\n +} +('$header$output') +ot. $folder$basename.pal +rm[0,-1] +} +#@cli rep_output_pdn_pal: filename +#@cli : Output selected images as Paint.NET palette file(s).(.txt) +rep_output_pdn_pal: +e[^-1] "Attempting to output palettes$? as Paint.NET palette file(s).(.txt)" +header="; paint.net Palette File: " +repeat $! { +if $!>1 filename=${"filename \"$1\",$>"} else filename="$1" fi +0 => $filename folder,basename,num_of_cols,palname={f},{b},{whd#0},{0,n} rm. +if $num_of_cols>96 continue e[^-1] "Palette Limit Exceeded!Skipping!" fi +start_header=$header$palname +start_header.=\n"; Color Format - AARRGGBB"\n"; Colors: "$num_of_cols +pal_info="\n" +mp={$num_of_cols-1} +to_rgba[0] +permute[0] cxyz +unroll[0] x +visited=0 +repeat 96 { +p=$> +if $p<$num_of_cols +rgba={crop(#0,$>*4,0,0,0,4,1,1,1)} +rgb={([$rgba])[0,3]} +alp={([$rgba])[3]} +rgba=$alp,$rgb +hex_rgba=${rep_int82hex\ $rgba} +struppercase $hex_rgba +pal_info.=${} +else +if !$visited pal_info.="; End of Palette List"\n visited=1 fi +pal_info.=00808080 +fi +if $p<95 pal_info.="\n" fi +} +('$start_header$pal_info') +e[^-1] "Output palette"[$>]" as Paint.NET palette file(s).(.txt)" +header="; paint.net Palette File: " +ot. $folder$basename.txt +rm[0,-1] +} +rm +#@cli rep_output_gpl: filename +#@cli : Output selected images as GIMP palette file(s).(.gpl) +rep_output_gpl: +e[^-1] "Output palettes$? as GIMP palette file(s).(.gpl)" +init_header="GIMP Palette\n\#Palette Name: " +init_colors_info="\n#Colors: " +repeat $! { +if $!>1 filename=${"filename \"$1\",$>"} else filename="$1" fi +0 => $filename folder,basename,num_of_cols,palname,ss={f},{b},{whd#0},{0,n},{s#0} rm. +header_info=$init_header$palname +colors_info=$init_colors_info$num_of_cols +start_header=$header_info$colors_info +pal_info="\n" +mp={$num_of_cols-1} +permute[0] cxyz unroll[0] x +if $ss==3||$ss==4 +repeat $num_of_cols { +p=$> +rgb={(crop(#0,$>*$ss,0,0,0,$ss,1,1,1))[0,3]} +hex_rgb=${rep_int82hex\ $rgb} +r={([$rgb])[0]} +g={([$rgb])[1]} +b={([$rgb])[2]} +pal_info.=$r" "$g" "$b" "$hex_rgb +if $p<$mp pal_info.="\n" fi +} +elif s#0<3 +repeat $num_of_col { +p=$> +gray={(crop(#0,$>*$ss,0,0,0,$ss,1,1,1))[0]} +hex_rgb=${rep_int82hex\ vector3($gray)} +r,g,b=$gray +pal_info.=$r" "$g" "$b" "$hex_rgb +if $p<$mp pal_info.="\n" fi +} +else +e[^-1] "Invalid channels, skipping!" +rm[0] continue +fi +('$start_header$pal_info') +ot. $folder$basename.gpl +rm[0,-1] +} +#@cli +rep_split_gradient : number_of_colors,splits,colors_per_split,_axis,_seed,_reverse_internal,_reverse_all,min_value_a...,maxvalue_a... +#@cli : Create split gradients +#@cli : Author : Reptorian. +#@cli : Default values: '_axis=x','_seed=n/a','_reverse_internal=0','_reverse_all=0' ++rep_split_gradient: +skip ${4=0},${5=},${6=0},${7=0} +$=p +if isnum($4) axis={$4%3} +else axis={_'$4'-_'x'} +fi +dir_axis=${arg\ $axis+1,x,y,z} +len_axis=${arg\ $axis+1,w,h,d} +ncol,u_string={narg(${8--1})/2},"" +if $ncol>1 u_string.=[ fi +repeat $ncol { +k=$> +u_string.=u(${p{8+$k}}, +u_string.=${p{8+$k+1}}) +if $k<($ncol-1) u_string.=, fi +} +if $ncol>1 u_string.=] fi +{arg($axis+1,[$1,1,1],[1,$1,1],[1,1,$1])},1 +s. $dir_axis,$2 +f[-$2--1] "begin(const scale=("$len_axis"#"-$2"-1)/($3-1););"$dir_axis"/scale" +$3,1,1,$ncol +repeat $2 { +q=$> +f. begin(if(narg($5),srand($5+$q);););[$u_string] +if $6 mirror. $dir_axis fi +rep_cubic_map[-{2+$q}] [-1],2 +} +rm. +a[-$2--1] $dir_axis +if $7 mirror. $dir_axis fi +#@cli rep_hitomezashi : "str_a","str_b",_upscale_pixel>=1,[colors_a palette],[colors_b stray_palette],_shift_color,_boundary={ 0=Periodic | 1=Continuous },0<=_symmetry_mode<=3,_stray_color_seed,stray_col_a,...stray_col_n,border_size,border_col_a,...,border_col_n,frames : "str_a","str_b",upscale_pixel>=1,colors_a={ hex | value~ },colors_b={ hex | value~ },0<=_symmetry_mode<=3,border_size,border_col_a,...border_col_n +#@cli : Create Hitomezashi Stitch Pattern. +#@cli : +#@cli : Note: The number of stray_color and number of border color depends on the number of channels to be used. For example, in the case of palette, it depends on number of channels per palette. In case of hex, then it depends on number of characters divided by two. Finally, if you insert wave at the end, there is only one. +#@cli : +#@cli : Author : Reptorian. +#@cli : Default value : '_upscale_pixel=1','colors_a=n/a','colors_b=n/a','_shift_color=0','_boundary=0','_stray_color_seed=n/a','_symmetry_mode=n/a' ++rep_hitomezashi: +skip ${3=1},"${4=}","${5=}","${6=}","${7=}","${8=}","${9=}" +$=argpos +pixel_size,colors_a,colors_b,use_remove_image={max(int($3)*100,100)}%,${4-5},1 +use_rescale={$pixel_size!=1} +command "generate_border : +if narg($""*)>1 out_color=[$""*] +else out_color=$""1 +fi +eval.. :\"begin( +const pixel_size="$pixel_size"; +const border_size=$_border_size; +const ip=floor(border_size/2); +const iq=ceil(border_size/2); +color=\"$out_color\"; +const iex=w#-1-1; +const iey=h#-1-1; +const bpe=max(0,(border_size-1)); +const xbpe=w#-1-1-bpe; +const ybpe=h#-1-1-bpe; +); +ix=x*pixel_size-ip; +iy=y*pixel_size-ip; +sx=(x+1)*pixel_size-ip; +sy=(y+1)*pixel_size-ip; +ex=(x+1)*pixel_size+max(iq-1,0); +ey=(y+1)*pixel_size+max(iq-1,0); +if(i!=j(1,0,0,0,0,1), +polygon(#-1,4, +sx,iy, +ex,iy, +ex,ey, +sx,ey, +1,color); +); +if(i!=j(0,1,0,0,0,1), +polygon(#-1,4, +ix,sy, +ex,sy, +ex,ey, +ix,ey, +1,color); +); +\"" +command "generate_border_depth : +if narg($""*)>1 out_color=[$""*] +else out_color=$""1 +fi +eval.. :\"begin( +const pixel_size="$pixel_size"; +const border_size=$_border_size; +const l_length=(pixel_size+border_size); +const depth=d#-1; +const length=l_length*border_size*depth*s#-1; +const edge_x_length=w#-1*border_size*depth*s#-1; +const edge_y_length=h#-1*border_size*depth*s#-1; +const ip=floor(border_size/2); +const iq=ceil(border_size/2); +color=\"$out_color\"; +const iex=w#-1-1; +const iey=h#-1-1; +const bpe=max(0,(border_size-1)); +const xbpe=w#-1-1-bpe; +const ybpe=h#-1-1-bpe; +vcol=resize(color,length,1,0); +edge_x=resize(color,edge_x_length,1,0); +edge_y=resize(color,edge_y_length,1,0); +); +ix=x*pixel_size-ip; +iy=y*pixel_size-ip; +sx=(x+1)*pixel_size-ip; +sy=(y+1)*pixel_size-ip; +if(i!=j(1,0,0,0,0,1),draw(#-1,vcol,sx,iy,0,0,border_size,l_length,depth,s#-1,1)); +if(i!=j(0,1,0,0,0,1),draw(#-1,vcol,ix,sy,0,0,l_length,border_size,depth,s#-1,1)); +\"" ++rep_binary_hitomezashi "$1","$2" +if ${is_image_arg\ $colors_a}||${is_image_arg\ $colors_b} +shift_colors,boundary,sym_mode,seed=${6-9} +np=0 +if narg($colors_a) pass$colors_a 1 np+=1 fi +if narg($colors_b) pass$colors_b 1 np+=1 fi +if narg(${argpos{10+s#-1}}) _border_size={($pixel_size)>1?min(max(0,($pixel_size)-1),abs(${argpos{10+s#-1}})):0} +else _border_size=0 +fi +if narg(${argpos{11+s#-1*2}}) depth=${argpos{11+s#-1*2}} +else depth=1 +fi +stray_color="" +border_color="" +sid={s#-1-1} +repeat s#-1 { +n=$> +stray_color.=${argpos{10+$>}} +border_color.=${argpos{11+s#-1+$>}} +if $n<$sid +stray_color.=, +border_color.=, +fi +} +if $np==2 ++_rep_colorize_binary_hitomezashi... [-2],[-1],$shift_colors,$boundary,$seed,$depth +rm[-3,-2] +if narg($sym_mode) rep_symmetrize_xy[-2,-1] $sym_mode fi +r. {w#-1*$pixel_size},{h#-1*$pixel_size},{d#-1},{s#-1},1 +if $_border_size +if $depth>1 generate_border_depth $border_color +else generate_border $border_color +fi +fi +else ++_rep_colorize_binary_hitomezashi.. [-1],,$shift_colors,$boundary,$seed,$stray_color,$depth +rm.. +if narg($sym_mode) rep_symmetrize_xy[-2,-1] $sym_mode fi +r. {w#-1*$pixel_size},{h#-1*$pixel_size},{d#-1},{s#-1},1 +if $_border_size +if $depth>1 generate_border_depth $border_color +else generate_border $border_color +fi +fi +fi +elif narg($colors_a)||narg($colors_b) +sym_mode,_border_size=$6,{($pixel_size)>1?min(max(0,($pixel_size)-1),(narg($7)?abs($7))):0} +if narg($sym_mode) rep_symmetrize_xy. $sym_mode fi +wave_check_a={narg($colors_a)?${rep_contains_wave_at_end\ $colors_a}:0} +wave_check_b={narg($colors_b)?${rep_contains_wave_at_end\ $colors_b}:0} +wave_mode={$wave_check_a+$wave_check_b} +if $wave_mode==2 +('$colors_a') r. {w#-1-1} a={t} +('$colors_b') r. {w#-1-1} b={t} +rm[-2,-1] ++f. i?$b:$a +if $use_rescale resize2dx. $pixel_size,1 fi +if $_border_size +v=$8 +generate_border $v +fi +elif $wave_mode==1 +if $wave_check_a ('$colors_a') r. {w#-1-1} a={t} fi +if $wave_check_b ('$colors_b') r. {w#-1-1} a={t} fi +rm. +if $use_rescale {w*$pixel_size},{h*$pixel_size},1,1,$a fi +if $_border_size +v=$8 +generate_border $v +fi +else +na={narg($colors_a)+narg($colors_b)} +if $na==2 +rgb_a=${rep_hex2int8\ $colors_a} +rgb_b=${rep_hex2int8\ $colors_b} +check narg($rgb_a)==narg($rgb_b) +{w},{h},1,{narg($rgb_a)},i#-1?[$rgb_b]:[$rgb_a] +if $use_rescale resize2dx. $pixel_size,1 fi +if $_border_size +vc=${8--1} +generate_border $vc +fi +else +if narg($colors_a) rgb=${rep_hex2int8\ $colors_a} fi +if narg($colors_b) rgb=${rep_hex2int8\ $colors_b} fi +{w*$pixel_size},{h*$pixel_size},1,{narg($rgb)},[$rgb] +if !$_border_size error no_border fi +if $_border_size +vc=${8--1} +generate_border $vc +fi +fi +fi +else +sym_mode=$6 +use_remove_image=0 +if narg($sym_mode) rep_symmetrize_xy. $sym_mode fi +if $use_rescale resize2dx. $pixel_size,1 fi +fi +if $use_remove_image rm.. fi +uncommand generate_border,generate_border_depth ++_rep_colorize_binary_hitomezashi: +skip "${1=}","${2=}","${3=0}","${4=0}","${5=}","${6=}" +if $!>1 error inv_img_cnt fi +ml={norm(w,h)} ++label. +{iM#-1+1},1,1,3,[x,0,0] sh. 1,2 +{w#-2},1,1,1,$ml +eval[-4] >" +i(#-2,i,0,0,0)=i(#-1,i,0,0)=min(norm(x,y),i(#-1,i,0,0)); +++i(#-2,i,0,0,1);" +rm[-2,-1] +sh. 1 pixelsort.. +,x,[-1] rm. +=> ref_ind +sh. 1,2 +ni=0 +if ${is_image_arg\ $1} +pass$1 1 +ni+=1 +else no_pal_available fi +if ${is_image_arg\ $2} +pass$2 1 +ni+=1 +fi +if $ni==2 +if s#-2!=s#-1 error inv_chnl_cnt fi +frame_count={narg($6)?$6:1} +eval " +if(narg($5),srand($5);); +const length=w#-3; +const nc=w#-1; +pos=0; +t=-1; +tv=inf; +ind=-1; +while(pos0),$tf_max_id-z,z} +{w#1},{h#1},$tf,{s#-1},I(#-1,i(#1,x,y,0,0),0,$direction) +rm[1--2] +fi +#@cli rep_binary_hitomezashi : string_a,string_b,[_rules] +#@cli : Create a hitomezashi image. Strings inserted as argument are treated as unicode converted to binary based on rules. Rules has been pre-defined already. +#@cli : +#@cli : Note : Original Source Code is at found at the spreadsheet link within this link - https://aperiodical.com/2020/12/mobile-numbers-hitomezashi-stitching/ +#@cli : +#@cli : Author: Reptorian. ++rep_binary_hitomezashi: +skip "${3=}" +if ${is_image_arg\ $3} +pass$3 0 +gt[-1] {ia} +else +(1,0,0,0,0,0,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,0,0,1,0,0,1,0,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1) +fi +('"$1"') +('"$2"') +map[-2,-1] [-3] +{w#-1},1,1,1,>begin(v=0;);v=x?(j(#-1,-1)+v)%2:0; rm.. # Process first column. Creates auxilatory surface and then remove reference surface. +{w#-2},{w#-1},1,1 # Create a 2D surface to write on +eval.. " +v=i(#-1,0,x)=i; +row=x+1; +repeat(w#-3-1,p, +v=i(#-1,p+1,x)=sum(v,i(#-3,p,0),row,1)%2; +);" +rm[-4--2] +#@cli rep_contains_wave_at_end : "str" +#@cli : Return whether it contains a wave at end. +#@cli : Author: Reptorian. +rep_contains_wave_at_end: skip "${1=}" if narg($1) u {a=['$1'];(a)[size(a)-1]==_'~'} else u 0 fi +#@cli rep_random_binary: num_of_chars +#@cli : Return randomly generated binary number based on number of characters. +#@cli : +#@cli : Author : Reptorian. +rep_random_binary: {max(2,abs($1))},1,1,1,int(u(0,2,1,0))+_'0' u {t} rm. +#@cli rep_sym_xy: eq. to 'rep_symmetrize_xy'. +rep_sym_xy: rep_symmetrize_xy $1 +#@cli rep_symmetrize_xy: 0<=mode<=3 +#@cli : Create copies and then append images to generate symmetry alongside xy-axis. +#@cli : +#@cli : Author: Reptorian. +rep_symmetrize_xy: +mode={int($1)%4} +resize_end={([0,0,1,1,0,1,1,0])[$mode*2,2]} +if $mode==3 +crop_a_0,crop_a_1,crop_a_2,crop_a_3=1,0,1,2 +image_a=,1~,1~ +image_b=,0~,1~ +crop_b=1,h#0-1,w#0-1,h#0-1 +crop_c=0,0,0,h#0-2 +elif $mode==2 +crop_a_0,crop_a_1,crop_a_2,crop_a_3=0,1,2,1 +image_b=,1~ +image_c=,1~,1~ +crop_b=0,0,w#0-2,0 +crop_c=w#0-1,1,w#0-1,h#0-1 +elif $mode==1 +crop_a_0,crop_a_1,crop_a_2,crop_a_3=1,1,1,1 +image_a=,0~,1~ +image_c=,1~ +crop_b=1,0,w#0-1,0 +crop_c=0,1,0,h#0-1 +else +crop_a_0,crop_a_1,crop_a_2,crop_a_3=0,0,2,2 +image_a=,1~ +image_b=,1~,1~ +image_c=,0~,1~ +crop_b=0,h#0-1,w#0-2,h#0-1 +crop_c=w#0-1,0,w#0-1,h#0-2 +fi +if $mode<2 +mirror_a,mirror_b,mirror_c=x,y,x +else +mirror_a,mirror_b,mirror_c=y,x,y +fi +if $mode&1 +image_d=0 +else +image_d=1~ +fi +if !($mode%3) +image_e=,1~ +fi +foreach { ++crop[0] $crop_a_0,$crop_a_1,{w-$crop_a_2},{h-$crop_a_3} ++resize[0] {w#0+w#-1},{h#0+h#-1},100%,100%,0,0,$resize_end +mirror[-2] $mirror_a +image[-1] [-2]$image_a +mirror[-2] $mirror_b +image[-1] [-2]$image_b +mirror[-2] $mirror_c +image[-1] [-2]$image_c +rm[-2] ++crop[0] {[$crop_b]} +mirror[-1] x +image[-2] [-1],$image_d,.5~ +rm[-1] +crop[0] {[$crop_c]} +mirror[-2] y +image[-1] [-2],.5~$image_e +rm[-2] +} +#@cli rep_cellular_automata : int_rule,_min_arr_size +#@cli : Default values: '_min_arr_size=n/a' +rep_cellular_automata: +skip ${2=} +channels 0 +rule_decimal,min_arr_size=${1-2} +dec2bin $1 ('${}') -. 48 +=> rules +if narg($min_arr_size) +if w<$min_arr_size +r. $2,1,1,1,0,0,1 +fi +fi +repeat $!-1 { +local[$>,-1] { +ow,oh={w#0},{h#0} +unroll[0] x +iter={ceil(w#0/w#-1)} +$ow,1,1,1,int(u(0,2,1,0)) +repeat $iter { +p=$> +pos={$p*w} +if !iv#-1 f. int(u(0,2,1,0)) fi +{w},1,1,1,"begin( +state(n)=i(#-1,n,0,0,0); +); +k=4*state((x-1+w)%w)+2*state(x)+state((x+1)%w); +i(#-2,k,0,0,0);" +j[0] [-1],$pos,0 +rm.. +} +r[0] $ow,$oh,1,1,-1 +rm. +} +} +rm. +#@cli rep_er : eq. to 'rep_emboss_relief' +rep_er : rep_emboss_relief $* +#@cli rep_emboss_relief : int_radius>=4,-360>=_ang>=360,_sigma>0,_scale>0,_output={ 0=emboss | 1=relief },_color_out={ 0=gray | 1=color },_bias>0,_use_cmyka={ 0=non_cmyka_mode | 1=cmyka_mode } +#@cli : Generates effect of embossing onto image via convolution. +#@cli : Default values: '_ang=45','_sigma=.5','_scale=2','_output=1','_bias=128','_color_out=1','_use_cmyka=0' +rep_emboss_relief: +skip ${2=45},${3=.5},${4=2},${5=1},${6=1},${7=128},${8=0} +radius,angle,sigma,scale,relief_mode,gray_mode,bias,max_alp_ind=${1-5},{!$6},$7,{$8?4:3} +convolution_main_setting=$radius,$angle,$sigma,$scale,$gray_mode +if $gray_mode +command "process_emboss_alpha_case : split_opacity process_emboss_filter.. a c" +command "end_relief : +.. . rm." +else +command "process_emboss_alpha_case : sh 0,{s-2} process_emboss_filter. rm." +command "end_relief : add" +fi +if $relief_mode +command "process_emboss_filter : +_rep_steerable_gaussian_convolve "$convolution_main_setting" end_relief" +else +command "process_emboss_filter : +_rep_steerable_gaussian_convolve "$convolution_main_setting" +. "$bias" k." +fi +foreach { +if s==2||s>$max_alp_ind process_emboss_alpha_case +else process_emboss_filter +fi +} +uncommand process_emboss_alpha_case,process_emboss_filter,end_relief ++_rep_steerable_gaussian_convolve: +sg,theta,sigma,M={max(5,int(abs($1)))},{deg2rad($2)},$3,{3*$3} +$sg,1,1,2,"begin( +const center_index=(w-1)/2; +const sigma_exp=2*$sigma^2; +const sqrsig=$sigma*sqrt(2*pi); +); +nx=(x-center_index)/center_index*$M; +g=exp(-(nx^2)/sigma_exp)/sqrsig; +gp=(nx/$sigma^2)*g; +[g,gp];" +sh. 0 ts={is#-1/$4} rm. /. $ts ++rotate. 90 +s[-2,-1] c ++convolve[0] [-4] +convolve. [-2] ++convolve[0] [-3] +convolve. [-5] +*. {cos($theta)} +*.. {sin($theta)} +add.. . +k[0,-2] +if $5 ss={s} compose_channels. + /. $ss fi +#@cli rep_hsl2ryb2rgb +#@cli : Convert color representation of selected image from HSL to RYB to RGB +rep_hsl2ryb2rgb: +e[^-1] "Convert color representation of image$? from HSL to RYB to RGB." +f "H=(i0/60)%6;C=(1-abs(2*i2-1))*i1;X=C*(1-abs(H%2-1)); +m=i2-C/2; +RYB=arg(1+int(H),[C,X,0],[X,C,0],[0,C,X],[0,X,C],[X,0,C],[C,0,X]); +RYB+=m*=255; +red=RYB[0]; +yellow=RYB[1]; +blue=RYB[2]; +white=min(RYB); +red-=white; +yellow-=white; +blue-=white; +maxyellow=max(red,yellow,blue); +green=min(yellow,blue); +yellow-=green; +blue-=green; +blue>0&&green>0?( +blue*=2; +green*=2 +); +red+=yellow; +green+=yellow; +maxgreen = max(red,green,blue); +maxgreen>0?( +N=maxyellow/maxgreen; +red*=N; +green*=N; +blue*=N; +); +red+=white; +green+=white; +blue+=white; +[red,green,blue];" +#@cli +rep_color_harmony_palette: -360<=ang<=360,0<=_saturation<=1,-100[%]<=shade_tint<=100[%],0<=choice<=10,ryb_mode={ 0=rgb | 1=ryb | 2=hsl+rgb | 3=hsl+ryb } +#@cli : Create a harmony palette. In other word, create a palette based on the color wheel. ++rep_color_harmony_palette: +ang,saturation,shade_tint,choice,ryb_mode=${1-5} +{arg(1+$choice%11,6,6,6,2,3,3,4,3,4,5,6)},1,1,3,">begin( +fmod(a)=a-360*floor(a/360); +const start_ang=fmod($ang); +const saturation=cut($saturation,0,1); +const shade_tint=cut((1+$shade_tint)/2,0,1); +const choice=$choice%11; +ang=start_ang; +choice<3?( +const add_ang=arg(choice+1,8,15,30); +new_ang()=x?(ang+=add_ang;ang=fmod(ang);); +): +choice==3?( +new_ang()=x?ang=fmod(ang+180); +): +choice==4?( +new_ang()=x==2?(ang+=60;ang=fmod(ang);):x==1?(ang+=150;ang=fmod(ang);); +): +choice==5?( +new_ang()=x?ang=fmod(ang+120); +): +choice==6?( +new_ang()=x?ang=fmod(ang+90); +): +choice==7?( +new_ang()=x?(ang=fmod(start_ang+(x%2?90:-90))); +): +choice==8?( +new_ang()=x?(ang=fmod(ang+arg(x%2+1,120,60));); +): +choice==9?( +new_ang()=x?(x==1?(ang=fmod(ang+120);):(ang=fmod(ang+arg(x%2+1,30,60)));); +):( +new_ang()=x?(ang=fmod(ang+(x%2?30:90));); +); +); +new_ang(); +[ang,saturation,shade_tint];" +if $ryb_mode>1 +if $ryb_mode%2 +rep_hsl2ryb2rgb. else +hsl2rgb. fi +else +if $ryb_mode rep_hsl2ryb2rgb. else hsl2rgb. fi +fi +round. +#@cli rep_cubic_map: [image],_mode={ 0=neumann | 1=periodic | 2=periodic_smooth | 3=continuous } +#@cli : Map palette into image with cubic interpolation. +#@cli : Argument for mode can also use string. The valid strings are next to equal sign. +#@cli : Source for base of code - https://www.paulinternet.nl/?page=bicubic +#@cli : Author: Reptorian. +#@cli : Default values: '_mode=2' +rep_cubic_map: +skip ${2=2} +init_imgs={$!} +pass$1 1 +if $!>$init_imgs+1 error inv_img_arg fi +length,threading_threshold={[whd,sqr(256)]} +if isint($2) mode={int($2)%4} +else +neumann,periodic,periodic_smooth,continuous=0,1,2,3 +mode=$$2 if !narg($mode) error invalid_arg fi +fi +repeat $!-1 { +if !s#$> continue fi +reference_spectrum_size={s#$>} +if whd#$>>$threading_threshold ps_mode=: +else ps_mode=> +fi +{w#$>},{h#$>},{d#$>},{s*$reference_spectrum_size},$ps_mode" +begin( +const reference_spectrum_size=$reference_spectrum_size; +const img_pos=$>; +const length=$length; +const mi=length-1; +const smi=mi-1; +const mode=$mode; +cubic_interpolation(p0,p1,p2,p3,v)=( +(-.5*p0+1.5*p1-1.5*p2+.5*p3)*v^3 ++(p0-2.5*p1+2*p2-.5*p3)*v^2 ++(-.5*p0+.5*p2)*v ++p1 +); +cubic_map()=cubic_interpolation( +I[#-1,p_s], +I[#-1,p_0], +I[#-1,p_1], +I[#-1,p_e], +interp +); +mode?( +calc()=cubic_map(); +):( +calc()=( +inrange(pref,0,smi,1,1)?( +cubic_map(); +):( +pref>0?I[#-1,mi]:I[#-1,0]; +); +); +); +mode==3?( +const double_length=mi*2; +calc_ps()=( +a=[pref-1,pref,pref+1,pref+2]%double_length; +mi-abs(mi-a); +); +): +mode>1?( +calc_ps()=[pref-1,pref,pref+1,pref+2]%length; +):( +calc_ps()=[pref-1,pref,pref+1,pref+2]; +); +reference_spectrum_size>1?( +const pal_spectrum_size=s#-1; +const new_spectrum_size=pal_spectrum_size*reference_spectrum_size; +mode==1?( +calc_vp()=( +v=i(#img_pos,x,y,z,channel_position); +mv=v%mi; +vp=!mv?v>0?mi:mv; +); +):( +calc_vp()=i(#img_pos,x,y,z,channel_position); +); +output()=( +color_output=vector(#new_spectrum_size,0); +repeat(reference_spectrum_size,channel_position, +vp=calc_vp(); +pref=floor(vp); +interp=vp-pref; +ps=calc_ps(); +p_s=ps[0]; +p_0=ps[1]; +p_1=ps[2]; +p_e=ps[3]; +copy(color_output[channel_position*pal_spectrum_size],calc(),s); +); +color_output; +); +):( +mode==1?( +calc_vp()=( +v=i(#img_pos,x,y,z,0); +mv=v%mi; +vp=!mv?v>0?mi:mv; +); +):( +calc_vp()=i(#img_pos,x,y,z,0); +); +output()=( +vp=calc_vp(); +pref=floor(vp); +interp=vp-pref; +ps=calc_ps(); +p_s=ps[0]; +p_0=ps[1]; +p_1=ps[2]; +p_e=ps[3]; +calc(); +); +); +); +output();" +reverse[$>,-1] +remove[-1] +} +remove[-1] +#@cli rep_tco_anim: eq. to 'rep_three_coupled_oscillators_animation' +rep_tco_anim: rep_three_coupled_oscillators_animation $* +#@cli rep_three_coupled_oscillators_animation: _max_iter>0,-2pi<=_k_a_1<=2pi,-2pi<=_k_b_1<=2pi,-2pi<=_k_a_2<=2pi,-2pi<=_k_b_2<=2pi,_sublevel>=0,-360<=_ang_a<=360,-360<=_ang_b<=360,_ox_a,_oy_a,_ox_b,_oy_b,_axis_scale_a>0,_axis_scale_b>0 +#@cli : Animation-based version of Bifurcation diagram for two-parameters of torus-map or three-coupled oscillators. [1] +#@cli : +#@cli : --- Citation --- +#@cli : 1) C. Baesens, J. Guckenheimer, S. Kim, R.S. MacKay +#@cli : Three coupled oscillators: mode-locking, global bifurcations and toroidal chaos +#@cli : Physica D: Nonlinear Phenomena, Volume 49, Issue 3, 1991, Pages 387-475, ISSN 0167-2789 +#@cli : ------ +#@cli : +#@cli : _max_iter is the number of iterations within the bifurcation diagram. +#@cli : _k_a_1 is the a-variable that influence the output for first frame. +#@cli : _k_b_1 is the b-variable that influence the output for first frame. +#@cli : _k_a_2 is the a-variable that influence the output for last frame. +#@cli : _k_b_2 is the b-variable that influence the output for last frame. +#@cli : _sublevel defines the degree of subpixel processing. 0 means no subpixel sampling. Negative number in here means it will not be resized (Useful for mapping before downsizing to original image size.). +#@cli : _ang_a defines the angle of function for first frame. +#@cli : _ang_b defines the angle of function for last frame. +#@cli : _ox_a defines the x-offset of function for first frame. +#@cli : _oy_a defines the y-offset of function for first fraime. +#@cli : _ox_b defines the x-offset of function for last frame. +#@cli : _oy_b defines the y-offset of function for last frame. +#@cli : _axis_scale_a defines the scale of each axis for first frame. +#@cli : _axis_scale_b defines the scale of each axis for last frame. +#@cli : +#@cli : Author: Reptorian. +#@cli : Default values: '_max_iter=50','_k_a_1=u(-2*pi,2*pi)','_k_b_1=u(-2*pi,2*pi)','_k_a_2=u(-2*pi,2*pi)','_k_b_2=u(-2*pi,2*pi)','_sublevel=1','_ang_a=0','_ang_b=0','_ox_a=0','_oy_a=0','_ox_b=0','_oy_b=1','_axis_scale_a=1','_axis_scale_b=1' +rep_three_coupled_oscillators_animation: +skip ${1=50},${2=},${3=},${4=},${5=},${6=1},${7=0},${8=180},{$9=0},${10=0},${11=0},${12=0},${13=1},${14=1} +check ${-max_d}>1 +_rep_three_coupled_oscillators ${1-14} +#@cli rep_tco: eq. to 'rep_three_coupled_oscillators' +rep_tco: rep_three_coupled_oscillators $* +#@cli rep_three_coupled_oscillators: _max_iter>0,-2pi<=_k_a<=2pi,-2pi<=_k_b<=2pi,_sublevel>=0,-360<=_ang<=360,_ox,_oy,_axis_scale>0 +#@cli : Bifurcation diagram for two-parameters of torus-map or three-coupled oscillators. [1] +#@cli : +#@cli : --- Citation --- +#@cli : 1) C. Baesens, J. Guckenheimer, S. Kim, R.S. MacKay +#@cli : Three coupled oscillators: mode-locking, global bifurcations and toroidal chaos +#@cli : Physica D: Nonlinear Phenomena, Volume 49, Issue 3, 1991, Pages 387-475, ISSN 0167-2789 +#@cli : ------ +#@cli : +#@cli : _max_iter is the number of iterations within the bifurcation diagram. +#@cli : _k_a is a variable that influence the output. +#@cli : _k_b is a variable that influence the output. +#@cli : _sublevel defines the degree of subpixel processing. 0 means no subpixel sampling. Negative number in here means it will not be resized (Useful for mapping before downsizing to original image size.). +#@cli : _ang defines the angle of function. +#@cli : _ox defines the x-offset of function. +#@cli : _oy defines the y-offset of function. +#@cli : _axis_scale defines the scale of each axis. +#@cli : +#@cli : Author: Reptorian. +#@cli : Default values: '_max_iter=50','_k_a=u(-2*pi,2*pi)','_k_b=u(-2*pi,2*pi)','_sublevel=1','_ang=0','_ox=0','_oy=0','_axis_scale=1' +rep_three_coupled_oscillators: +skip ${1=50},${2=},${3=},${4=1},${5=0},${6=0},${7=0},${8=1} +check ${-max_d}==1 +_rep_three_coupled_oscillators ${1-8} +_rep_three_coupled_oscillators: +skip ${1=50},${2=},${3=},${4=},${5=} +check "abs($1)!=0&&$8!=0" +animation_mode=0 +if ${-max_d}>1 animation_mode=1 if $!>1 error "One image only for animation mode!" fi fi +tau={pi*2} +if $animation_mode +if narg($2) __k_a_1=$2 +else __k_a_1={u(-$tau,$tau)} +fi +if narg($3) __k_a_2=$3 +else __k_b_1={u(-$tau,$tau)} +fi +if narg($4) __k_b_1=$4 +else __k_a_2={u(-$tau,$tau)} +fi +if narg($5) __k_b_2=$5 +else __k_b_2={u(-$tau,$tau)} +fi +rescale_back={$6>0} +__sub={abs($6)+1} +command "generate_three_coupled: +_rep_three_coupled_oscillators_animation $1,$__k_a_1,$__k_b_1,$__k_a_2,$__k_b_2,$__sub,${7-14}" +else +if narg($2) __k_a=$2 +else __k_a={u(-$tau,$tau)} +fi +if narg($3) __k_b=$3 +else __k_b={u(-$tau,$tau)} +fi +rescale_back={$4>0} +__sub={abs($4)+1} +command "generate_three_coupled: +_rep_three_coupled_oscillators_static_out $1,$__k_a,$__k_b,$__sub,${5-8}" +fi +foreach { +generate_three_coupled +if $rescale_back r. {w#0},{h#0},100%,100%,6 fi +rm.. +} +uncommand generate_three_coupled ++_rep_three_coupled_oscillators_animation: +check "$13!=0&&$14!=0" +{w*$6},{h*$6},{d},1,"*begin( +const max_iter=abs($1); +const ww=w-1; +const hh=h-1; +const dd=d-1; +const sd=max(ww,hh)/min(ww,hh); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +const cx=ww/2; +const cy=hh/2; +const ox_a=($9+1)*cx; +const oy_a=($10+1)*cx; +const ox_b=(($11*-1)+1)*cy; +const oy_b=(($12*-1)+1)*cy; +const axis_scale_a=$13; +const axis_scale_b=$14; +const cxsx=cx/sx; +const cysy=cy/sy; +const cxsx_a=cxsx/axis_scale_a; +const cxsx_b=cxsx/axis_scale_b; +const cysy_a=cysy/axis_scale_a; +const cysy_b=cysy/axis_scale_b; +const ang_a=-$7; +const ang_b=-$8; +set_cos_ang=vectord(); +set_sin_ang=set_cos_ang; +fill(set_cos_ang,p,cos(deg2rad(lerp(ang_a,ang_b,p/dd)))); +fill(set_sin_ang,p,sin(deg2rad(lerp(ang_a,ang_b,p/dd)))); +const tau=2*pi; +const k_a_1=$2; +const k_b_1=$3; +const k_a_2=$4; +const k_b_2=$5; +const tc=.7/tau; +rot_x(a,b,c)=a*set_cos_ang[c]-b*set_sin_ang[c]; +rot_y(a,b,c)=a*set_sin_ang[c]+b*set_cos_ang[c]; +oscil_a(a,b,c)=a+c-tc*sin(tau*b); +oscil_b(a,b,c)=a+c-tc*sin(tau*b); +); +zp=z/dd; +ix=(x-lerp(ox_a,ox_b,zp))/lerp(cxsx_a,cxsx_b,zp); +iy=(y-lerp(oy_a,oy_b,zp))/lerp(cysy_a,cysy_b,zp); +xp=rot_x(ix,iy,z); +yp=rot_y(ix,iy,z); +k_a=lerp(k_a_1,k_b_1,zp); +k_b=lerp(k_a_2,k_b_2,zp); +repeat(max_iter, +txp=xp; +xp=oscil_a(xp,yp,k_a); +yp=oscil_b(yp,txp,k_b); +); +norm(xp,yp);" ++_rep_three_coupled_oscillators_static_out: +check "$8!=0" +{w*$4},{h*$4},1,1,*"begin( +const max_iter=abs($1); +const ww=w-1; +const hh=h-1; +const sd=max(ww,hh)/min(ww,hh); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +const cx=ww/2; +const cy=hh/2; +const ox=($6+1)*cx; +const oy=(($7*-1)+1)*cy; +const axis_scale=abs($8); +const cxsx=cx/sx/axis_scale; +const cysy=cy/sy/axis_scale; +const ang=-($5/180)*pi; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +const tau=2*pi; +const k_a=$2; +const k_b=$3; +const tc=.7/tau; +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +oscil_a(a,b)=a+k_a-tc*sin(tau*b); +oscil_b(a,b)=a+k_b-tc*sin(tau*b); +); +ix=(x-ox)/cxsx; +iy=(y-oy)/cysy; +xp=rot_x(ix,iy); +yp=rot_y(ix,iy); +repeat(max_iter, +txp=xp; +xp=oscil_a(xp,yp); +yp=oscil_b(yp,txp); +); +norm(xp,yp);" +#@cli rep_permutations: init_num,_axis={x,y,z} +#@cli : Return all the permutations of set of numbers as a image. +#@cli : +#@cli : Finding the next permutation has been adapted from this link -> https://www.techiedelight.com/find-permutations-string-cpp-java-iterative/ +#@cli : Finding the permutation at point index within this code is of the author. +#@cli : Author : Reptorian. +#@cli : Default values: '_axis=x' ++rep_permutations: +skip ${2=x} +check "inrange($1,0,10,1,1)&&$1==int($1)&&inrange(('$2')[0],_'x',_'z',1,1)" +if $1==1 1 return fi +axis,fact_size={_'$2'-_'x'},{fact($1)} +out_dim={v=vector(#3,1);v[$axis]=$fact_size;v} +if $1>8 mode=: else mode=> fi +$out_dim,$1,$mode" +begin_t( +const max_index=s-1; +const dec_max_index=max_index-1; +const axis=$axis; +axis==2?(index()=z;): +axis==1?(index()=y;): +index()=x; +reverse_array_starting_from(a)=( +start=a; +end=max_index; +while(start=permutation[fn],--fn;if(!fn,break(););); +while(b>fn&&permutation[b]<=permutation[fn-1],--b;); +swap(permutation[fn-1],permutation[b]); +reverse_array_starting_from(fn); +):( +index=index(); +if(index, +fn=max_index; +init_array_size=s; +init_permutation=permutation; +repeat(fn,iter, +division_number=fact(fn); +pos=int(index/division_number); +permutation[iter]=init_permutation[pos]; +copy(init_permutation[pos],init_permutation[pos+1],init_array_size-pos); +index-=pos*division_number; +--init_array_size; +--fn; +); +permutation[iter]=init_permutation[0]; +); +started=1; +); +permutation;" +#@cli rep_permutation_index2list: number_of_item,permutation_number +#@cli : Return permutation order at index permutation_number. +rep_permutation_index2list: +num_of_items={max(1,int(abs($1)))} +if $num_of_items==1 u 0 +else +permutation_number={$2%fact($num_of_items)} +1,{$num_of_items+1},1,1,y +eval " +const num_of_items=$num_of_items; +new_arr=vector(#num_of_items,0); +fn=num_of_items-1; +permutation_position=$permutation_number; +repeat(fn,iter, +division_number=fact(fn); +pos=int(permutation_position/division_number); +new_arr_num=i[#-1,pos]; +new_arr[iter]=new_arr_num; +da_remove(#-1,pos); +permutation_position-=pos*division_number; +--fn; +); +new_arr[iter]=i[#-1,0]; +new_arr;" +rm. +fi +#@cli rep_permutation_list2index: number_list +#@cli : Return the lexicographic index in which this permutation is found within a list of all possible permutation. +#@cli : +#@cli : number_list must be in the form of 0,1,2,3.... , but can be in any order. +#@cli : +#@cli : Note: Not the derived source code, but really close to the original one and can be inferred to be operating on the same logic. Arguably the same after inspection. - https://www.geeksforgeeks.org/lexicographic-rank-of-a-string/ . Derived source code author is unknown. +rep_permutation_list2index: +if $#>1 +if sort([$*])==expr('x',$#) +if [$*]==expr('x',$#) u 0 +else +eval " +const fn=$#-1; +iv=[$*]; +p=0; +repeat(fn,k, +v=iv[k]; +repeat(k,m, +if(iv[m]=$2&&$1>0&&isint($1))&&($2>0&&isint($2))&&inrange(_'$3',_'x',_'z',1,1)" +if [${1-2}]==[1,1] 1 return fi +num_of_combinations,axis={permut($2,$1,1)},{_'$3'-_'x'} +if $axis==2 out_dim=1,1,$num_of_combinations +elif $axis==1 out_dim=1,$num_of_combinations,1 +else out_dim=$num_of_combinations,1,1 +fi +if $2==1 $out_dim,1,${arg\ $axis+1,x,y,z} return fi +$out_dim,$2,>"begin( +const edge=s-1; +const n=$1; +const dec_n=n-1; +const axis=$axis; +axis==2?( +axis()=z; +): +axis==1?( +axis()=y; +):( +axis()=x; +); +output=expr('x',n); +reverse_array_starting_from(a)=( +start=a; +end=dec_n; +while(start=output[j]),++j;); +j=0 && output[i]>=output[i+1],--i;); +j=dec_n; +while(j>i && (output[i]>=output[j]),--j;); +swap(output[i],output[j]); +reverse_array_starting_from(i+1); +); +); +(output)[0,s]; +" +#@cli rep_npr_permutation_index2list: number_of_item,selected_items_count,permutation_number +#@cli : Return permutation order at index permutation_number. +rep_npr_permutation_index2list: +check "$2<=$1&&$1>0&&$2>0" +if $1==1 status 0 +elif $2==1 status {$3%$1} +else +permutation_number={$3%permut($2,$1,1)} +1,{$1+1},1,1,y +{1+($1==$2?$1-2:min($1-1,$2-1))},1,1,1,>"begin( +const m=($1==$2?1:$1-$2)+1; +v=m; +); +x>1?v=v*(m+x-1):(x?v:1);" +eval " +new_arr=vector(#$2,0); +divisor_position=w#-1-1; +permutation_number=$permutation_number; +repeat(w#-1,iter, +division_number=i[#-1,divisor_position]; +pos=int(permutation_number/division_number); +new_arr_num=i[#-2,pos]; +new_arr[iter]=new_arr_num; +da_remove(#-2,pos); +permutation_number%=division_number; +--divisor_position; +); +new_arr[iter]=i[#-2,0]; +new_arr; +" +remove[-2--1] +fi +#@cli rep_npr_permutation_list2index: number_of_items,number_list +#@cli : Return the lexicographic index in which this permutation is found within a list of all possible permutations. +#@cli : +#@cli : number_list must be in the form of 0,1,2,3.... , but can be in any order. However, the size of it must be less than or equal to number_of_items. That means you can exclude some numbers. +rep_npr_permutation_list2index: +check "$1>0&&($#-1)<=$1" +n_items,n_list_size={[$1>1,$#-1]} +if $#==2&&$n_items status {$2%#1} +elif $#>2&&$n_items +eval " +const limit=$1-1; +counters=vector(#$1,0); +test_vector=[${2--1}]; +repeat(size(test_vector),p, +v=test_vector[p]; +if(!isint(v),run('error all_todo_ints==F');); +if(!inrange(v,0,limit,1,1),run('error int_lim_exc');); +if(++counters[v]>1,run('error dups_found');); +); +" +{1+($1==$n_list_size?$1-2:min($1-1,$n_list_size-1))},1,1,1,>"begin( +const m=($1==$n_list_size?1:$1-$n_list_size)+1; +v=m; +); +x>1?v=v*(m+x-1):(x?v:1);" +eval " +const n_list_size=min($n_list_size,$1-1); +iv=[${2--1}]; +p=0; +repeat(n_list_size,k, +v=iv[k]; +repeat(k,m, +if(iv[m]0, occurance_per_items,_axis={ x|y|z} +#@cli : Create image representing permutations with repeating numbers. ++rep_r_permutations: +skip ${3=x} +check "($1&&isint($1))&&isint($2)>0&&inrange(_'$3',_'x',_'z',1,1)" +mode,ss,num_of_permutations,axis={pm=$1>0;[pm,pm?[$2,$1^$2]:[abs($1),$2^abs($1)],_'$3'-_'x']} +if $num_of_permutations>131072 p_mode=: else p_mode=> fi +out_dim={v=[1,1,1];v[$axis]=$num_of_permutations;v;} +$out_dim,$ss,$p_mode" +begin( +const axis=$axis; +const mode=$mode; +const d_s=s-1; +mode?( +const mod_factor=$1; +v=reverse(expr('$1^x',$2)); +):( +const mod_factor=$2; +v=reverse(expr('$2^x',abs($1))); +); +const d_mode_factor=mod_factor-1; +axis==2?(index()=z;): +axis==1?(index()=y;): +index()=x; +started=0; +); +started?( +p=d_s; +while(v[p]==d_mode_factor, +v[p]=0; +--p; +); +++v[p]; +):( +v=int(index()/v)%mod_factor; +started=1; +); +v;" +#@cli rep_r_permutation_index2list: times_items_can_repeat, repetition, position : -number_of_items, occurance_per_items, position +#@cli : Return the list of numbers which correspond to the index provided based on permutations with repetition. +rep_r_permutation_index2list: +check "v=[$*];size(v)==$#&&sum(isint(v))==3&&min((v)[0,2])&&$2>0;" +eval " +const mode=$1>0; +mode?( +const mod_factor=$1; +const size_of_list=$1^$2; +div_list=reverse(expr('$1^x',$2)); +):( +const mod_factor=$2; +const size_of_list=$2^abs($1); +div_list=reverse(expr('$2^x',abs($1))); +); +const position=$3%size_of_list; +int(position/div_list)%mod_factor;" +#@cli rep_r_permutation_list2index: number_of_items/occurance, item_index_a,item_index_b +#@cli : Return the lexicographic index in which the list of numbers corresponds to the lexicographically-ordered list of permutations with repetitions. Note that number_of_items and occurance is exchangeable. +rep_r_permutation_list2index: +check "sum(isint([$*]))==$#&&sum([$*]>=0)==$#" +eval " +inp_v=[${2--1}]; +const mod_factor=$1; +mul_list=reverse(expr('$1^x',size(inp_v))); +sum(mul_list*([${2--1}]%mod_factor));" +#@cli rep_ncr_combinations: number_of_items>0,choices>0,_axis={x,y,z} : choices>0, number_of_items>0,_axis={x,y,z} +#@cli : Generates all combinations that fits nCr. The algorithm used for this is based on Algorithm 515 (Buckles and Lybanon 1977) which allows index-based generation of combinations. +#@cli : +#@cli : Code has been adapted from sleeepjack's Python 2 code executing Algorithm 515 - https://github.com/sleeepyjack/alg515/blob/master/python/alg515.py +#@cli : +#@cli : Note: If $2 is greater than $1, then $2 is number of items and $1 is choices. Only positive integer numbers are accepted! +#@cli : Default values: '_axis=x' ++rep_ncr_combinations: +skip ${3=x} +check "($1>0&&$2>0)&&(isint($1)&&isint($2))&&inrange(_'$3',_'x',_'z',1,1)" +if $1==$2 1,1,1,$1,c return fi +if $1>$2 n_items,choices=$1,$2 +else n_items,choices=$2,$1 +fi +if $choices==1 $n_items,1,1,1,x return fi +num_combs,axis={permut($choices,$n_items,0)},{_'$3'-_'x'} +if $num_combs>33554432 error excess_combs fi +if $axis==2 out_dim=1,1,$num_combs +elif $axis==1 out_dim=1,$num_combs,1 +else out_dim=$num_combs,1,1 +fi +if $num_combs>(768*$_cpus) mode=: fi +$out_dim,$choices,$mode" +begin( +const n_items=$n_items; +const max_value=n_items-1; +const dec_max_value=max_value-1; +const axis=$axis; +const max_index=s-1; +const dec_max_index=max_index-1; +const IR=permut(max_index,n_items-1,0); +axis==2?(index()=z;): +axis==1?(index()=y;): +index()=x; +started=0; +comb=vector(#s,0); +ref_comb=expr('x+1',n_items-1); +copy(comb[1],ref_comb[0],s-1); +); +started?( +comb[max_index]==max_value?( +K=dec_max_value; +for(R=dec_max_index,comb[R]==K,K--;--R;); +copy(comb[R],ref_comb[comb[R]],s-R); +):(++comb[max_index];); +):( +index=index(); +if(index, +V=1; +R=IR; +K=R; +while(K<=index, +++V; +R=permut(max_index,n_items-V,0); +K+=R; +); +K-=R; +comb[0]=V-1; +for(p=2,p0&&$2>0)&&(isint($1)&&isint($2))" +if $1==$2 u {expr('x',$1)} return fi +if $1>$2 n_items,choices=$1,$2 +else n_items,choices=$2,$1 +fi +num_combs={permut($choices,$n_items,0)} +index={$3%$num_combs} +eval " +const n_items=$n_items; +const choices=$choices; +const index=$index; +comb=vector(#choices,0); +V=1; +R=permut(choices-1,n_items-V,0); +K=R; +while(K<=index, +++V; +R=permut(choices-1,n_items-V,0); +K+=R; +); +K-=R; +comb[0]=V-1; +for(p=2,p0,choices>0,_axis={x,y,z} +#@cli : Create image representing combinations given number of items and choices with repeating numbers. Empty item is a item by itself. +#@cli : Code to find combinations given index is taken from Joseph Wood at codereview.stackexchange - https://codereview.stackexchange.com/questions/285415/find-the-list-of-combination-with-repetition-given-rank-and-number-of-items/287944#287944 +#@cli : Author : Reptorian. ++rep_r_combinations: +skip ${3=x} +check "($1>0&&$2>0)&&(isint($1)&&isint($2))&&inrange(_'$3',_'x',_'z',1,1)" +n_items,choices=$1,$2 +num_combs,axis={permut($choices,$n_items+$choices-1,0)},{_'$3'-_'x'} +if $axis==2 out_dim=1,1,$num_combs +elif $axis==1 out_dim=1,$num_combs,1 +else out_dim=$num_combs,1,1 +fi +if $num_combs>131072 mode=: fi +$out_dim,$choices,$mode" +begin( +const n_items=$n_items; +const max_ind=s-1; +const axis=$axis; +axis==2?(index()=z;): +axis==1?(index()=y;): +index()=x; +comb=vector(#s,0); +started=0; +); +started?( +if(++comb[max_ind]==n_items, +for(p=max_ind-1,p>-1,--p, +if(++comb[p]2,temp=int(temp/(m_items+m_choices-1));); +comb[k]=item_choice; +--m_choices; +); +); +started=1; +); +comb;" +#@cli rep_r_combination_index2list: n,k,index +#@cli : Return the list of numbers which correspond to the index provided based on a list of all possible combinations with repetition. +#@cli : Code is taken from Joseph Wood at codereview.stackexchange - https://codereview.stackexchange.com/questions/285415/find-the-list-of-combination-with-repetition-given-rank-and-number-of-items/287944#287944 +#@cli : Author : Reptorian. +rep_r_combination_index2list: +check "sum(isint([${1-2}]))==2&&$1>1&&$2>0&&$#==3" +eval " +m_items=$1; +m_choices=$2; +m_index=$3%permut(m_choices,m_items+m_choices-1,0); +output_list=vector(#$2,0); +temp=permut(m_choices-1,m_items+m_choices-2,0); +--m_choices; +item_choice=0; +repeat($2,k, +while(temp<=m_index, +m_index-=temp; +temp*=m_items-1; +temp=int(temp/(m_items+m_choices-1)); +--m_items; +++item_choice; +); +temp*=m_choices; +if((m_items+m_choices)>2,temp=int(temp/(m_items+m_choices-1));); +output_list[k]=item_choice; +--m_choices; +); +output_list;" +#@cli rep_r_combination_list2index: number_of_items,index_a,index_b,... +#@cli : Return the index which correspond to the list of numbers provided based on a list of all possible combinations with repetition. +#@cli : Note: All numbers must be in range [0,number_of_items). They must be in integer only. +#@cli : Author : Reptorian. +rep_r_combination_list2index: +check "const v=$#;sum(isint([$*]))==v&&$1>-1&&(sum(inrange([${2--1}],0,$1,1,0))==v-1)" +if !$1 +status nan return +elif $#-1==1 +status {$2%$1} return +elif !sum(${2--1}) +status 0 return +fi +eval " +const n_items=$1; +const max_ind=n_items-1; +const kv=$#-1; +series_of_indexes=sort([${2--1}]); +Tc=kv; +index=0; +a=permut(kv,n_items+kv-1,0); +repeat(kv-1,p, +v_ind_p=series_of_indexes[p]; +diff=kv-v_ind_p; +sum_nd=n_items+diff-p; +b=permut(Tc,sum_nd-1,0); +index+=a-b; +if(v_ind_p==max_ind,break();); +a=b-permut(Tc,sum_nd-2,0); +--Tc; +); +index+=series_of_indexes[kv-1]-series_of_indexes[kv-2]; +index;" +#@cli rep_cartesian_product: number_of_items_a,number_of_items_b,...,_axis : -number_of_items,occurance_per_items,_axis : number_of_items,_axis +#@cli : Output image representing cartesian product based on input. +#@cli : Default values: '_axis=x' ++rep_cartesian_product: +skip ${2=x} +if isnum($-1)&&isint($-1) +axis,user_xyz=0 +elif inrange(_'$-1',_'x',_'z',1,1) +axis,user_xyz={_'$-1'-_'x'},1 +else +error invalid_char +fi +vars2chk={$#-$user_xyz} +v_list={abs(([$*])[0,$vars2chk])} +n_vars_isint,all_valid={v=[$v_list];[sum(isint(v)),min(v)]} +if !$all_valid error var_0_error fi +if $n_vars_isint!=$vars2chk invalid_var_inp fi +dims,s_size={v=[$v_list];[prod(v),size(v)];} +if $dims>33554432 error dims_lim_exc fi +if int($dims/$_cpus)>131072 p_mode=: else p_mode=> fi +dims={v=vector(#3,1);v[$axis]=$dims;v;} +if max($v_list)==1 1,1,1,$s_size return +elif $s_size==1 $dims,1,${arg\ $axis+1,x,y,z} return +fi +$dims,$s_size,$p_mode" +begin( +const axis=$axis; +const mode=$mode; +const d_s=s-1; +const dec_d_s=d_s-1; +items_list=["$v_list"]; +div_list=vector(#s,1); +tv=1; +repeat(d_s,p, +div_list[dec_d_s-p]=tv*=items_list[d_s-p]; +); +axis==2?(index()=z;): +axis==1?(index()=y;): +index()=x; +started=0; +v=vector(#s,0); +); +started?( +p=d_s; +while(v[p]==items_list[p], +v[p]=0; +--p; +); +++v[p]; +):( +v=int(index()/div_list)%(items_list--); +started=1; +); +v;" +#@cli rep_cartesian_product_index2list: number_of_items_a,number_of_items_b,...,index +#@cli : Return the list of numbers which correspond to the index provided. Every arguments must be a integer. +rep_cartesian_product_index2list: +check "sum(isint([$*]))==$#" +max_int={max(abs([${1--2}]))} +if $max_int==1 +status {vector(#($#-1),0)} return +elif !$max_int +error var_0_error +fi +eval " +const size_of_array=$#-1; +const d_s=size_of_array-1; +const dec_d_s=d_s-1; +items_list=abs([${1--2}]); +position=$-1%prod(items_list); +div_list=vector(#size_of_array,1); +tv=1; +repeat(d_s,p, +div_list[dec_d_s-p]=tv*=items_list[d_s-p]; +); +int(position/div_list)%items_list;" +#@cli rep_cartesian_product_list2index: number_of_items_a,number_of_items_b,...,coordinate_a,coordinate_b,... +#@cli : Return the index in which the coordinates is seen in a box of size number_of_items_a*number_of_items_b.... +rep_cartesian_product_list2index: +if $#&1 error inv_args_count fi +eval " +const half_list_size=$#>>1; +const dec_half_list_size=half_list_size-1; +mul_items=int(abs(([${1--1}])[0,half_list_size])); +position=int(abs(([${1--1}])[half_list_size,half_list_size])); +position%=mul_items; +mul_items=shift(mul_items,-1,0); +++mul_items[dec_half_list_size]; +tv=1; +repeat(half_list_size,p, +tv=mul_items[dec_half_list_size-p]*=tv; +); +sum(mul_items*position);" +#@cli rep_string_permutations: string,_axis,_sort_string={ 0=do_not_sort_string | 1=sort_string | 2=logical_sort_string } +#@cli : Return all the unique permutations of characters of string as a image with values representing the unicode representation of characters in input string. Permutations is dependent on character appearance order. +#@cli : +#@cli : Algorithm is based on the implementation of Narayana Pandita's algorithm by PM 2Ring at stackoverflow. +#@cli : Implementation of Narayana Pandita's algorithm - https://stackoverflow.com/questions/8306654/finding-all-possible-permutations-of-a-given-string-in-python +#@cli : Description of Narayana Pandita's algorithm - https://en.wikipedia.org/wiki/Permutation#Generation_in_lexicographic_order +#@cli : Author : Reptorian. +#@cli : Default values: '_axis=x','_sort_string=0' ++rep_string_permutations: +skip ${2=x},${3=0} +check "inrange(_'$2',_'x',_'z',1,1)" +1,1,1,2 +eval " +const sort_string=$3%3; +reference_information='$1'; +sort_string==2?( +const str_size=size(reference_information); +sort_indexes=[242,243,0,1,2,3,4,26,27,244,245,84,56,246,5,6,7,8,51,52,53,54,55,247,248,249,250,251,252,253,254,18,96,70,89,99,17,85,74,88,62,63,77,80,90,81,91,92,108,109,110,111,112,113,114,115,116,117,94,95,64,83,65,73,97,119,127,128,130,132,137,138,139,140,145,146,147,148,149,151,158,159,160,161,163,165,170,171,172,173,175,58,93,59,76,57,86,176,184,185,187,188,193,194,195,196,201,202,203,204,205,207,215,216,217,218,220,222,227,228,229,230,233,60,75,61,69,255,107,28,162,29,30,31,32,34,35,24,36,37,38,40,41,42,39,43,44,48,33,45,46,47,49,50,9,10,11,12,13,14,238,71,19,21,22,20,239,25,118,15,237,66,68,240,16,100,98,82,105,106,87,23,241,234,235,104,236,67,101,102,103,72,120,121,122,123,124,125,126,129,133,134,135,136,141,142,143,144,131,150,152,153,154,155,156,78,157,166,167,168,169,174,164,219,177,178,179,180,181,182,183,186,189,190,191,192,197,198,199,200,213,206,208,209,210,211,212,79,214,223,224,225,226,231,221,232]; +sort_reference=resize(reference_information,str_size<<1,1,0); +repeat(str_size,ind, +pos=ind<<1; +current_char=sort_reference[pos]; +sort_reference[pos]=sort_indexes[current_char]; +); +sort_reference=sort(sort_reference,1,str_size,2); +reference_information=(sort_reference)[1,str_size,2]; +): +sort_string==1?( +reference_information=sort(reference_information); +); +char_position=vector(#256,-1); # Enable O(1) index retrieval as G'MIC lack Python-like dictionary. +ind=0; +fill(reference_information,char_ind, +char=reference_information[char_ind]; +is_char_found=char_position[char]>-1; +if(is_char_found +,pos=char_position[char];++i(#-1,0,pos,0,1); +,pos=char_position[char]=ind++;da_push(#-1,[char,1]); +); +pos; +); +da_freeze(#-1); +set('size_of_string',size(reference_information)); +sort(reference_information); +" +axis,number_of_string_permutations={v=crop(#-1,0,0,0,1,1,h,1,1);[_'$2'-_'x',fact(sum(v))/prod(fact(v))]} +out_dim={v=vector(#3,1);v[$axis]=$number_of_string_permutations;v} +if $number_of_string_permutations>(1<<24) error exc_permut_val:$number_of_string_permutations fi +$out_dim,$size_of_string,>"begin( +unicode=crop(#-1,0,0,0,0,1,h#-1,1,1); +out_vector=["${}"]; +const max_index=s-1; +const dec_max_index=max_index-1; +started=0; +reverse_array_starting_from(a)=( +start=a; +end=max_index; +while(start-1,--jp, +if(out_vector[jp]jp,--kp, +if(v-1?( +++i[#-2,pos=char_position[char]]; +):( +pos=char_position[char]=ind++; +da_push(#-2,1); +da_push(#-1,char); +); +values_of_chars_in_string[char_ind]=pos; +); +size_of_last_array=da_size(#-1); +da_freeze(#-1); +dividier=1; +repeat(da_size(#-2),ind, +dividier*=fact(i[#-2,ind]); +); +level_length=fact(size_of_info)/dividier; +index=$2%level_length; +max_index=level_length-1; +if(!sort_string,values_of_chars_in_string=sort(values_of_chars_in_string);); +!index?( +values_of_chars_in_string; +): +index==max_index?( +reverse(values_of_chars_in_string); +):( +repeat(size_of_info,ind, +da_push(#-3,values_of_chars_in_string[ind]); +); +size_of_last_array==size_of_info?( +fn=size_of_info-1; +repeat(size_of_info,iter, +division_number=fact(fn); +pos=int(index/division_number); +values_of_chars_in_string[iter]=i[#-3,pos]; +da_remove(#-3,pos); +index-=pos*division_number; +--fn; +); +):( +repeat(size_of_info,ind, +section_size=level_length/da_size(#-3); +selected_indice=int(index/section_size); +char=i[#-3,selected_indice]; +da_remove(#-3,selected_indice); +level_length=section_size*i[#-2,char]; +--i[#-2,char]; +for(count_of_letters_index=0,count_of_letters_index-1?( +++i[#-1,char_position[char]]; +):( +char_position[char]=ind++; +da_push(#-1,1); +); +); +test_string==reverse(reference_information)?( +dividier=1; +repeat(da_size(#-1),ind, +dividier*=fact(i[#-1,ind]); +); +fact(size_ref_str)/dividier-1; +):( +fill(test_string,char_ind, +new_val=char_position[test_string[char_ind]]; +if(new_val<0,run('error inval_char');); +if(--i[#-1,new_val]==-1,run('error exec_chars_det');); +new_val; +); +str_index=0; +repeat(size_ref_str,ind, +count_of_less_index_value=0; +for(alt_ind=ind+1,alt_indtest_string[alt_ind],++count_of_less_index_value;); +); +if(count_of_less_index_value, +for(alt_ind=ind,alt_ind1 +ordered={expr('x',$#)} +if sort([$*])==[$ordered] +if [$*]==[$ordered] u $ordered +else +($*) +{$#} +eval.. i(#-1,i)=x +u {crop(#-1)} +rm[-2,-1] +fi +else error inv_args +fi +else u 0 +fi +#@cli rep_inverse_permute_str: permutation_string +#@cli : Return the inverse permutation_string for command permute +#@cli : 'permutation_string' is a combination of the character set {x|y|z|c}, +#@cli : e.g. 'xycz', 'cxyz', ... +rep_inverse_permute_str: +status {`" +start_string='xyzc'; +input_string='$1'; +start_string==input_string?( +start_string; +):( +if(size(input_string)!=4,run('error inv_str_len_det');); +const _c=_'c'; +const _x=_'x'; +const _z=_'z'; +const d_x=_x-1; +xyz_counter=vector(#3,0); +c_counter=0; +new_string=vector(#4,0); +repeat(4,ind, +char=input_string[ind]; +inrange(char,_x,_z,1,1)?( +if(xyz_counter[p=char-_x]++,run('error exc_char_det');); +): +char==_c?( +if(c_counter++,run('error exc_char_det');); +p=3; +):( +run('error inv_char_det'); +); +new_string[p]=start_string[ind]; +); +new_string; +);"`} +#@cli rep_chars_repetition: str_containing_chars,char_1_repeat,char_2_repeat,... +#@cli : Generate string with characters to repeat and number of repeat per characters. The number of repetition must be integer! +#@cli : $ echo ${rep_chars_repetition\ ABC,5,2,3} +rep_chars_repetition: +size_of_str:=size('$1') +{sum(vector$size_of_str(${2--1}))},1,1,1,">begin( +characters='$1'; +number_of_repeats=vector$size_of_str(${2--1}); +if(!(isint(number_of_repeats)==number_of_repeats>0), +run('error inval_repet_num'); +); +current_index=position=0; +); +char=characters[current_index]; +++position; +if(position==number_of_repeats[current_index], +++current_index; +position=0; +); +char; +" +status {t} rm. +#@cli rep_generate_all_images_combinations:[images] +#@cli : Generates all combinations of images. +rep_find_all_images_combinations: +if $!==1 return +elif !$! error no_imgs +else timg={$!} +fi +if ${-max_d}>1 error inv_dim_d fi +eval " +valid_dim=1; +refer_dim=[w#-1,h#-1]; +repeat($timg-1,p, +[w#p,h#p]!=refer_dim?(valid_dim=0;break();); +); +valid_dim;" +if !${} error inv_dims fi +a z ++rep_r_permutations $timg,$timg,z +permute. cyzx +{w#0*d#0},{h#0},{d#-1},{s#0} +eval.. " +const img_w=w#0; +const img_h=h#0; +const img_s=s#0; +crop_image=crop(#0,0,0,i,0,img_w,img_h,1,img_s); +draw(#-1,crop_image,img_w*x,0,z,0,img_w,img_h,1,img_s,1); +" +k[-1] s z +#@cli rep_rrd: eq. to 'rep_random_rectangular_division' +rep_rrd: rep_random_rectangular_division $* +#@cli rep_random_rectangular_division: split>1,_additional_thickness>=0,_max_iter>=2,_probability[%]>0,_loop_limit>1,0<=_border[%]>=100%,_seed,_normalize,border_color,palette_mode +#@cli : Generate random division of rectangle as in random number of division and varying thickness within rectangle. +#@cli : _additional_thickness refers to the excess pixel thickness. +#@cli : _max_iter limits the number of iterations per rectangle. +#@cli : _probability determines the probability that a rectangle will be permitted to be utilized for further iteration. +#@cli : _loop_limit limits the number of time the process of subdivision is done. +#@cli : _seed generates the output based on defined parameter. +#@cli : Default values: '_gen_thick=0','_max_iter=5','_probability[%]=95%','_loop_limit=5000','_border=0%','_seed=n/a' +rep_random_rectangular_division: +skip ${2=0},${3=5},${4=95%},${5=5000},${6=0},${7=},${8=0},${9=},${10=},${11=},${12=},${13=} +check "$4>0" +foreach { _rep_random_rectangular_division $* } +_rep_random_rectangular_division: +skip ${2=0},${3=5},${4=95%},${5=5000},${6=0},${7=},${8=0},${9=},${10=},${11=},${12=},${13=} +border_size={max(0,round(abs($2)*cut($6,0,1)))} +contain_palette=0 +dims={w},{h} +ns=1 +col=0 +activate_code_block=1 +if narg($10) +ms=3 +contain_palette=1 +if '$10'=='pal' +elif ${is_image_arg\ $10} pass$10 0 ms={s#-1} rm. +else contain_palette=0 +fi +fi +if narg($10) +ms=3 +contain_palette=1 +if '$10'=='pal' +elif ${is_image_arg\ $10} pass$10 0 ms={s#-1} rm. +else +contain_palette=0 +if !narg($11)||(narg($11)?abs($11)==0) +activate_code_block=0 +if narg($9)&&$border_size +col=${rep_hex2int8\ $9} +ns={narg($col)} +col=vector(#$ns,$col) +else +ns=3 +fi +fi +fi +else +if narg($9)&&$border_size +col=${rep_hex2int8\ $9} +ns={narg($col)} +col=vector(#$ns,$col) +fi +fi +rm. +$dims,1,$ns,$col +1,1,1,5 +1,1,1,5 +eval " +if(narg($7),srand($7);); +const ww=w#-3-1; +const hh=h#-3-1; +const max_split=max(1,int(abs($1))); +const internal_space=int(abs($2)); +const test_boundary=internal_space?(internal_space+1); +const max_iter=max(2,round(abs($3))); +const odd=cut($4,0,1); +const arr_limit=round(abs($5)); +diff_check(a)=( +mri=max_split; +ds=a/mri; +if(mri>1&&ds<1, +while(mri>1&&ds<1, +--mri; +ds=a/mri; +); +); +ds>1; +); +width_check=diff_check(ww-internal_space*2); +height_check=diff_check(hh-internal_space*2); +!(width_check||height_check)?run('error inv_dim'); +da_push(#-2,[0,ww,0,hh,0]); +sub_column(v,point)=( +ri=int(u(1,max_split,1,0))+1; +mri=ri-1; +sx=v[0]+test_boundary; +ex=v[1]-test_boundary; +diff=ex-sx; +bound_check=diff>test_boundary; +skip=0; +da_remove(#-2,point); +if(bound_check, +ds=diff/mri; +if(mri>1&&ds<=test_boundary, +while(mri>1&&ds<=test_boundary, +--ri; +--mri; +ds=diff/mri; +); +); +if(test_boundary||diff?(ds>test_boundary):1, +py=[v[2],v[3]]; +iter=v[4]+1; +p=v[0]; +repeat(ri,ri_ind, +rb=odd<1?u(0,1)>odd; +ri_ind==mri?( +if(p>v[1], +p=v[1]; +if(!(v[3]-v[2]),rb=1;); +); +(rb||(iter==max_iter))?( +da_push(#-1,[p,v[1],py,iter]); +):( +da_push(#-2,[p,v[1],py,iter]); +); +): +!ri_ind?( +mx=sx+ds; +np=min(max(sx,round(u(p,mx))),ex); +vp=[p,np]; +(rb||(iter==max_iter))?( +da_push(#-1,[vp,py,iter]); +):( +da_push(#-2,[vp,py,iter]); +); +p=np+1; +if(p>=ex,skip=1;); +):( +if(skip,continue();); +mx+=ds; +np=min(max(p+internal_space,round(u(p,mx))),ex); +vp=[min(p,ex),np]; +(rb||(iter==max_iter))?( +da_push(#-1,[vp,py,iter]); +):( +da_push(#-2,[vp,py,iter]); +); +p=np+1; +); +); +,da_push(#-1,v); +); +,da_push(#-1,v); +); +); +sub_row(v,point)=( +ri=int(u(1,max_split,1,0))+1; +mri=ri-1; +sy=v[2]+test_boundary; +ey=v[3]-test_boundary; +diff=ey-sy; +bound_check=diff>test_boundary; +skip=0; +da_remove(#-2,point); +if(bound_check, +ds=diff/mri; +if(mri>1&&ds<=test_boundary, +while(mri>1&&ds<=test_boundary, +--ri; +--mri; +ds=diff/mri; +); +); +if(test_boundary||diff?(ds>test_boundary):1, +px=[v[0],v[1]]; +iter=v[4]+1; +p=v[2]; +repeat(ri,ri_ind, +rb=odd<1?u(0,1)>odd; +ri_ind==mri?( +if(p>v[3], +p=v[3]; +if(!(v[1]-v[0]),rb=1;); +); +(rb||(iter==max_iter))?( +da_push(#-1,[px,p,v[3],iter]); +):( +da_push(#-2,[px,p,v[3],iter]); +); +): +!ri_ind?( +my=sy+ds; +np=min(max(sy,round(u(p,my))),ey); +vp=[p,np]; +(rb||(iter==max_iter))?( +da_push(#-1,[px,vp,iter]); +):( +da_push(#-2,[px,vp,iter]); +); +p=np+1; +if(p>=ey,skip=1;); +):( +if(skip,continue();); +my+=ds; +np=min(max(p+internal_space,round(u(p,my))),ey); +vp=[min(p,ey),np]; +(rb||(iter==max_iter))?( +da_push(#-1,[px,vp,iter]); +):( +da_push(#-2,[px,vp,iter]); +); +p=np+1; +); +); +,da_push(#-1,v); +); +,da_push(#-1,v); +); +); +v=I[#-2,0]; +width_check&&height_check?( +u(0,1)<=.5?( +sub_row(v,0); +):( +sub_column(v,0); +); +): +width_check?( +sub_column(v,0); +): +height_check?( +sub_row(v,0); +); +arr_point=0; +while(da_size(#-2), +p_ind=int(u(da_size(#-2))); +cv=I[#-2,p_ind]; +u(0,1)<.5?( +sub_row(cv,p_ind); +):( +sub_column(cv,p_ind); +); +++arr_point; +if(arr_point>=arr_limit,break()); +); +da_freeze(#-2); +da_freeze(#-1);" +a[-2,-1] y +eval. :"begin_t( +const ww=w#-2-1; +const hh=h#-2-1; +const border_size=$border_size; +const b_a=floor(border_size/2); +const b_b=ceil(border_size/2); +const contain_border=$border_size?1; +hsv2rgb(I)=( +ref(I,_I); +_I[0]%=360; +_I[1]=cut(_I[1],0,1); +_I[2]=cut(_I[2],0,1); +_c=_I[2]*_I[1]; +_x=_c*(1-abs((_I[0]/60)%2-1)); +(arg(1 + int(_I[0]/60),[_c,_x,0],[_x,_c,0],[0,_c,_x],[0,_x,_c],[_x,0,_c],[_c,0,_x])+=_I[2] - _c)*=255; +); +$8&&!narg($10)?( +$ns>1?( +const rescale_factor=(h-1)/255; +calc_out()=vector(#$ns,y/rescale_factor); +):( +const rescale_factor=(h-1+contain_border)/255; +calc_out()=vector(#$ns,(y+contain_border)/rescale_factor); +); +):( +$activate_code_block?( +calc_out=calc_out()=y+contain_border; +):( +if(narg($12),srand($12+t);); +$10==1?( +calc_out()=hsv2rgb(vector(#3,u(360),u(1),u(1))); +):( +calc_out()=vector(#3,u(255),u(255),u(255)); +); +); +); +convert2coords(c)=( +sx=c[0]+(!(c[0]==0)?b_a); +sy=c[2]+(!(c[2]==0)?b_a); +ex=c[1]-(!(c[1]==ww)?b_b); +ey=c[3]-(!(c[3]==hh)?b_b); +tl=[sx,sy]; +tr=[ex,sy]; +bl=[sx,ey]; +br=[ex,ey]; +[tl,tr,br,bl]; +); +); +polygon(#-2,4,convert2coords(I),1,calc_out()); +end( +if(contain_border, +const sub_border=border_size-1; +const bh=hh-sub_border; +const bw=ww-sub_border; +col="$col"; +polygon(#-2,4,[0,0, ww,0, ww,sub_border, 0,sub_border],1,col); +polygon(#-2,4,[0,border_size,sub_border,border_size,sub_border,hh,0,hh],1,col); +polygon(#-2,4,[bw,border_size,ww,border_size,ww,hh,bw,hh],1,col); +polygon(#-2,4,[border_size,bh,bw,bh,bw,hh,border_size,hh],1,col); +); +);" +rm. +if narg($10)&&$activate_code_block +if $contain_palette +orientation=0 +if $border_size +col=${rep_hex2int8\ $9} +1,1,1,$ms,vector(#3,$col); +if '$10'=='pal' ++pal $11 +if narg($12) +{w},1,1,1,begin(srand($12););u +pixelsort.. +,x,[-1] +rm. +fi +elif ${is_image_arg\ $10} +pass$10 1 +if h>w orientation=1 fi +if narg($11) +if $orientation +{h},1,1,1,begin(srand($11););u +pixelsort.. +,y,[-1] +rm. +else +{w},1,1,1,begin(srand($11););u +pixelsort.. +,x,[-1] +rm. +fi +fi +fi +r. {iM#-3-1},1,1,3,0,2 +if $orientation +r. 1,{iM#-3-1},1,3,0,2 +a[-2,-1] y +else +r. {iM#-3-1},1,1,3,0,2 +a[-2,-1] x +fi +else +if '$10'=='pal' ++pal $11 +if narg($12) +{w},1,1,1,begin(srand($12););u +pixelsort.. +,x,[-1] +rm. +fi +elif ${is_image_arg\ $10} +pass$10 1 +if h>w orientation=1 fi +if narg($11) +if $orientation +{h},1,1,1,begin(srand($11););u +pixelsort.. +,y,[-1] +rm. +else +{w},1,1,1,begin(srand($11););u +pixelsort.. +,x,[-1] +rm. +fi +fi +fi +if $orientation +r. 1,{iM#-2-1},1,3,0,2 +else +r. {iM#-2-1},1,1,3,0,2 +fi +fi +else +if $border_size +col=${rep_hex2int8\ $9} +1,1,1,3,vector(#3,$col); +if $10==1 +{narg($11)?max(abs($11),2):iM#-2-1},1,1,3,${-math_lib}begin(if(narg($12),srand($12);););hsv2rgb(vector(#3,u(360),u(1),u(1))); +else +{narg($11)?max(abs($11),2):iM#-2-1},1,1,3,begin(if(narg($12),srand($12);););vector(#3,u(255),u(255),u(255)); +fi +if narg($11) r. {iM#-3-1},100%,100%,100%,0,2 fi +a[-2,-1] x +else +if $10==1 +{narg($11)?max(abs($11),2):iM#-1-1},1,1,3,${-math_lib}begin(if(narg($12),srand($12);););hsv2rgb(vector(#3,u(360),u(1),u(1))); +else +{narg($11)?max(abs($11),2):iM#-1-1},1,1,3,begin(if(narg($12),srand($12);););vector(#3,u(255),u(255),u(255)); +fi +if narg($11) r. {iM#-2-1},100%,100%,100%,0,2 fi +fi +fi +map.. . +rm. +fi +#@cli rep_custom_map: _shift_value>0,_negate={ 0=no_negation | 1=negate },_[palette],_seed_a... +#@cli : Custom mapping function with more options than default map. +#@cli : _shift_value defines the shift of base values used for mapping of color. This can be either percentage of integer. +#@cli : _[palette] is used to map into image. +#@cli : _seed defines the seed per image. Note: If you had inserted no argument, but a comma before, then it will pick random. If there is no argument and no comma, then it will use default map method. If this is your only argument, then the seed will defines the output. Sequentive arguments will also be used as seed for output for each images. +#@cli : Default values: '_shift_value=n/a','_[palette]','_seed=n/a' +#@cli : +#@cli : Author: Reptorian. +rep_custom_map: +skip "${1=}","${2=0}","${3=}","${4=}" +check narg($1)||(narg(${2--1})>1) +if narg($1) +if ispercentage($1) +f "begin( +const num_val=iM+1; +const shift_val=round(iM*$1); +nv=expr('x',num_val); +shift(nv,-shift_val,2); +); +nv[i];" +else +f "begin( +const num_val=iM+1; +nv=expr('x',num_val); +shift(nv,-$1,2); +); +nv[i];" +fi +fi +if $2 negate fi +if narg($3) +if ${is_image_arg\ $3} +pass$3 0 +check "w#-1==1||h#-1==1" +store. ordered +if narg($*)==4 +if narg($4) +$ordered +if w>h +{w#-1},1,1,1,begin(if(narg($4),srand($4)));u +pixelsort.. +,x,[-1] +else +1,{h#-1},1,1,begin(if(narg($4),srand($4)));u +pixelsort.. +,y,[-1] +fi +map[0--3] [-2],2 +rm[-2,-1] +else +repeat $! { +$ordered +if w>h +{w#-1},1,1,1,u +pixelsort.. +,x,[-1] +else +1,{h#-1},1,1,u +pixelsort.. +,y,[-1] +fi +map[$>] [-2],2 +rm[-2,-1] +} +fi +elif narg($*)>4 +$=seed +repeat $! { +$ordered +if w>h +{w#-1},1,1,1,begin(srand(${seed{4+$>}}));u +pixelsort.. +,x,[-1] +else +1,{h#-1},1,1,begin(srand(${seed{4+$>}}));u +pixelsort.. +,y,[-1] +fi +map[$>] [-2],2 +rm[-2,-1] +} +else +$ordered map[^-1] [-1] rm. +fi +else error \$\2!=[img] +fi +fi +#@cli rep_exp_sig_adj : eq. to 'rep_exponential_sigmoid_adjustment' +rep_exp_sig_adj: rep_exponential_sigmoid_adjustment $* +#@cli rep_exponential_sigmoid_adjustment: -1>=midpoint_shift>=1,sigmoid_level>=0,_sigmoid_shift,_endval +#@cli : Assign exponential-sigmoid function into image. +#@cli : +#@cli : midpoint_shift defines the center value point. If it at .5, then the center value point will between the largest value and the middle value. +#@cli : sigmoid_level influence how much S-Curve will be applied. If 0, then there is no sigmoid function. +#@cli : _sigmoid_shift shifts value +#@cli : _endval determines the maximum value of output. Negative value will return a image where the maximum image is the positive value of the negative input. Positive value will return a image where the maximum value is the maximum value multiplied by it input. +#@cli : +#@cli : Default values: '_sigmoid_shift=0','_endval=1' +#@cli : +#@cli : Author: Reptorian. +rep_exponential_sigmoid_adjustment: +skip ${2=0},${3=0},${4=1} +check {abs($4)!=0} +sig_scale={abs($2)} +check_sig_scale={$sig_scale==0} +if ($1!=0)||($2!=0)||($3!=0) +f ":begin( +const sig_scale=$sig_scale; +const midpoint_shift=min(1-abs($1),1); +const maxval_mul_by_factor=$4>0?iM*$4:abs($4); +$1>=0?( +calc_exp_shift(n)=n^midpoint_shift; +):( +calc_exp_shift(n)=1-((1-n)^midpoint_shift); +); +$check_sig_scale?( +calc(n)=calc_exp_shift(n); +):( +sigmoid_curve(a)=(ne=e^a;ne/(ne+1)); +$3==0?( +change_slope(a)=(a-.5)*sig_scale; +const start_point=change_slope(0); +const val_ref=(e^start_point)/(e^start_point+1); +const min_height=abs(val_ref); +const max_height=1-2*min_height; +):( +const shift_point=-.5+$3; +change_slope(a)=(a+shift_point)*sig_scale; +const start_point=change_slope(0); +const start_ref=(e^start_point)/(e^start_point+1); +const end_point=change_slope(1); +const end_ref=(e^end_point)/(e^end_point+1); +const min_height=abs(start_ref); +const max_height=end_ref-start_ref; +); +calc(n)=( +new_curve=calc_exp_shift(n); +(sigmoid_curve(change_slope(new_curve))-min_height)/max_height; +); +); +); +start_slope=I/iM; +calc(start_slope)*maxval_mul_by_factor;" +fi +#@cli rep_ekb: eq. to 'rep_ellsworth_board' +rep_ekb: rep_ellsworth_kelly_board $* +#@cli rep_ellsworth_board: sqr_size,_border_size[%],_border_value[%],_distribution,_{pal_id,[image]},_background_hex,fit_mode,_color_space,_exterior_border_color... +#@cli : Outputs a color board based on colored square tiles art made by Ellsworth Kelly with transparent areas. +#@cli : +#@cli : (eq. to 'rep_ekb') +#@cli : sqr_size defines the painted square size. +#@cli : _border_size defines the size of border. Negative number will take away areas from the painted squares. Positive number will separate painted areas by this amount. +#@cli : _border_value defines the gray level of border. +#@cli : _distribution defines the probability of a square to be painted. +#@cli : _{pal_id,[image]} defines the color. If you choose a name of a existing palette, then this will be the base of the colors of the square. Otherwise, it will be based off the palette. +#@cli : _background_hex defines the background color. This is based on RGB-Hex value. +#@cli : _fit_mode defines whether the resulting board should exceed the size of the original image. +#@cli : _color_space defines the color space of the board. +#@cli : _border_color defines the color of the border. Dependent on color space. +#@cli : Default values: '_border_size=10%','_border_value=50%','_distribution=50%','{pal_id,[image]}=120','_background_hex=n/a',_fit_mode=0,'_color_space=0','_exterior_border_color=n/a' +#@cli : +#@cli : Author: Reptorian +rep_ellsworth_kelly_board: +skip "${2=10%},${3=50%},${4=50%},${5=120},${6=},${7=0},${8=0},${9=}" +check "($1==int(abs($1)))&&(int(abs($1))>=1)&&$4>0" +cs={$8%17} +convert_colors_fwd=${arg\ $cs+1,error,rgb2ryb,rgb2cmy,rgb2cmyk,rgb2hcy,rgb2hsi,rgb2hsl,rgb2hsv,rgb2lab,rgb2lch,rgb2ycbcr,rgb2ycbcrglic,rgb2yiq,rgb2yuv,rgb2xyz,rgb2yes} +convert_colors_bwd=${arg\ $cs+1,error,ryb2rgb,cmy2rgb,cmyk2rgb,hcy2rgb,hsi2rgb,hsl2rgb,hsv2rgb,lab2rgb,lch2rgb,ycbcr2rgb,ycbcrglic2rgb,yiq2rgb,yuv2rgb,xyz2rgb,yes2rgb} +ref_sqr_size={abs($1)} +mode=1 +border_direction={$2>=0} +('$2') +if i(#-1,w-1)==37 use_percent=1 else use_percent=0 fi +rm. +if $border_direction&&$ref_sqr_size>1 +if $use_percent border_size={round(($ref_sqr_size)*abs($2))} +else border_size={round(abs($2))} +fi +if $border_size>0 +sqr_size={$ref_sqr_size+$border_size} +else +sqr_size=$ref_sqr_size +fi +elif !$border_direction||$ref_sqr_size==1 +if $use_percent border_size={round(($ref_sqr_size-1)*abs($2))} +else border_size={min(round(abs($2)),$ref_sqr_size-1)} +fi +sqr_size=$ref_sqr_size +else +border_size=0 +sqr_size=$ref_sqr_size +fi +border_value={cut($3,0,1)} +if ${is_image_arg\ $5} +pass$5 0 +if !((w>1&&h==1)||(w==1&&h>1)) error dim_inv fi +local[-1] { +if w>h +s x +else +s y +fi +remove_duplicates +a x +} +else ++pal $5 +cs=0 +fi +if w#-1<5 error min_cols>=5==F fi +if narg($6) +test_color=${rep_hex2int8\ $6} +1,1,1,{s},"vectors("$test_color")" +if $8 $convert_colors_fwd. fi +eval.. "begin(test_color=I(#-1,0,0,0););if(I==test_color,run('error inval_bant'));" +empty_color=[{[crop(#-1),255]}] +rm. +else +empty_color=vector(#s,0) +fi +if $border_size +condition_text=condition=(nx>=border_size)&&(ny>=border_size); +result=condition?color:border_color +else +result=color +fi +mode={$7%2} +border_value={cut($3,0,1)} +if ${is_image_arg\ $5} +1,1,1,3,[{vector3($border_value*255)}] +if $cs $convert_colors_fwd. fi +init_border_color={crop(#-1)} +rm. +else init_border_color={vector3($border_value*255)} +fi +use_bg_color=0 +if narg($9)&&!$mode bg_color=${9--1},255 use_bg_color=1 fi +repeat $!-1 l[$>,-1] +if $mode +mini_w={ceil(w#0/$sqr_size)} +mini_h={ceil(h#0/$sqr_size)} +else +mini_w={int(w#0/$sqr_size)} +mini_h={int(h#0/$sqr_size)} +fi +large_w={$mini_w*$sqr_size+$border_size} +large_h={$mini_h*$sqr_size+$border_size} +if $mode +if ($large_w-$sqr_size)>w#0 +large_w-=$sqr_size +mini_w-=1 +fi +if ($large_h-$sqr_size)>h#0 +large_h-=$sqr_size +mini_h-=1 +fi +else +if $large_w>w#0 +large_w-=$sqr_size +mini_w-=1 +fi +if $large_h>h#0 +large_h-=$sqr_size +mini_h-=1 +fi +fi +$mini_w,$mini_h,1,1,"begin( +const probability=cut($4,0,1); +if(probability==1, +calc_result()=int(u(w#-1));, +calc_result()=u(1)"begin( +const num_of_colors=w#-2; +const mx=w-1; +const my=h-1; +find_new_color()=( +new_col_id=int(u(num_of_colors)); +do(++new_col_id;,cols[new_col_id%num_of_colors]); +new_col_id%num_of_colors; +); +); +cols=vector(#num_of_colors,0); +(i+1)?( +(x==0&&y==0)?( +(j(1,0)+1)?cols[j(1,0)]=1; +(j(0,1)+1)?cols[j(0,1)]=1; +find_new_color(); +): +(x==mx&&y==0)?( +(j(-1,0)+1)?cols[j(-1,0)]=1; +(j(0,1)+1)?cols[j(0,1)]=1; +find_new_color(); +): +(x==0&&y==my)?( +(j(1,0)+1)?cols[j(1,0)]=1; +(j(0,-1)+1)?cols[j(0,-1)]=1; +find_new_color(); +): +(x==mx&&y==my)?( +(j(-1,0)+1)?cols[j(-1,0)]=1; +(j(0,-1)+1)?cols[j(0,-1)]=1; +find_new_color(); +): +(x==0)?( +(j(1,0)+1)?cols[j(1,0)]=1; +(j(0,1)+1)?cols[j(0,1)]=1; +(j(0,-1)+1)?cols[j(0,-1)]=1; +find_new_color(); +): +(x==mx)?( +(j(-1,0)+1)?cols[j(-1,0)]=1; +(j(0,1)+1)?cols[j(0,1)]=1; +(j(0,-1)+1)?cols[j(0,-1)]=1; +find_new_color(); +): +(y==0)?( +(j(0,1)+1)?cols[j(0,1)]=1; +(j(1,0)+1)?cols[j(1,0)]=1; +(j(-1,0)+1)?cols[j(-1,0)]=1; +find_new_color(); +): +(y==my)?( +(j(0,-1)+1)?cols[j(0,-1)]=1; +(j(1,0)+1)?cols[j(1,0)]=1; +(j(-1,0)+1)?cols[j(-1,0)]=1; +find_new_color(); +):( +(j(1,0)+1)?cols[j(1,0)]=1; +(j(-1,0)+1)?cols[j(-1,0)]=1; +(j(0,1)+1)?cols[j(0,1)]=1; +(j(0,-1)+1)?cols[j(0,-1)]=1; +find_new_color(); +); +):-1" +$large_w,$large_h,1,{s#-2+1},*"begin( +const col_s=s#-2; +const border_size=$border_size; +modv(a)=a-int(a/$sqr_size)*$sqr_size; +mini(a)=int(a/$sqr_size); +border_color=["$init_border_color",255]; +empty_color="$empty_color"; +); +nx=modv(x); +ny=modv(y); +mx=mini(x); +my=mini(y); +"$condition_text" +color_pos=i(#-1,mx,my,0,0); +color=(color_pos+1)?[I(#-2,color_pos,0,0),255]:empty_color; +"$result";" +if $use_bg_color +{w#0},{h#0},1,{s#-3+1},"["$bg_color"]" +j[-1] [-2],.5~,.5~ +rv[0,-1] +rm[-3--1] +else +if !$mode +r. {w#0},{h#0},1,100%,0,0,.5,.5 +fi +rv[0,-1] +rm[-2--1] +fi +if $cs +if $cs!=3 +$convert_colors_bwd[0] +else +if s#0==5 +s[0] c,-4 cmyk2rgb[0] a[0,1] c +else +cmyk2rgb[0] +fi +fi +fi +done done +rm. +#@cli rep_compb : eq. to 'rep_complexion_burst' +rep_compb: rep_complexion_burst $* +#@cli rep_complexion_burst: _points>0,_density>0,_H,_K,_zoom,_rotation_angle,_origin_x,_origin_y,_numbers_extraction_mode={ 0=Individual | 1=Additive },_mode={ 0=C-4 | C=C-6},_f1={ 0=csin | 1=ccos | 2=ctan | 3=clog},... +#@cli : Complex-Plane adaptation of the Pickover Popcorn Fractal. Discovered By Reptorian.\n +#@cli : _points defines the maximum number of points to be added on image based on pixel location. +#@cli : _density defines the frequency of points to be added along row and height of image. A value of one implies n points to be added per pixel. +#@cli : _H is the function multiplier used to subtract from the new found values from each iteration. Use "[H_A,H_B]" and replace +#@cli : _K is the inner multiplier for the inside function. Use "[K_A,K_B]" and replace each K_ with a number. See popcorn_x(a,b), and popcorn_y(a,b) embedded within the code of rep_popcorn_fractal for more information. +#@cli : _zoom defines the magnification of image. A negative value will "shrink" the structure of generated fractal. +#@cli : _rotation_angle defines the function angle of fractal. +#@cli : _origin_x defines the position of fractal. Center of image row will be treated as zero, and the ranges for image row are treated as -1,1. +#@cli : _origin_y defines the position of fractal. Center of image column will be treated as zero, and the ranges for image column are treated as -1,1. +#@cli : _mode defines whether to use 4 trigonometric functions or 6 complex-plane trigonometric functions. Each halves of functions are used on 2 functions used by different axis. +#@cli : _fn defines individual function used for the popcorn fractal.\n +#@cli : Author: Reptorian. +#@cli : Default values: '_points=50','density=1','H=[.05,1]','_K=[3,1]','_rotation_angle=0','_origin_x=0','_origin_y=0','_mode=0',...\n +#@cli : \ \ \ \ If _mode=0: ... = '_f1=_f3=0','_f2=_f4=2' +#@cli : \ \ \ \ If _mode=1: ... = '_f1=_f4=0','_f2=_f5=1','_f3=_f6=2'\n +rep_complexion_burst: +skip ${1=50},${2=1},${3=[.05,1]},${4=[3,1]},${5=.25},${6=0},${7=0},${8=0},${9=0},${10=1},${11=0},${12=},${13=},${14=},${15=},${16=},${17=} +if $9 +xnew_text=(plane_a+plane_b)[0] +ynew_text=(plane_a+plane_b)[1] +else +xnew_text=(plane_a)[0] +ynew_text=(plane_b)[1] +fi +if ($6-360*floor($6/360))?1 +fvx=((rot_x($xnew_text,$ynew_text)-osx)*icx_zoom+cxsx)/sx +fvy=((rot_y($xnew_text,$ynew_text)-osy)*icy_zoom+cysy)/sy +else +fvx=(($xnew_text-osx)*icx_zoom+cxsx)/sx +fvy=(($ynew_text-osy)*icy_zoom+cysy)/sy +fi +tmx={w-1} +tmy={h-1} +channels. 0 f. 0 +{int(w*abs($2))},{int(h*abs($2))},1,1,":begin_t( +const max_x=w-1; +const max_y=h-1; +const target_max_x=$tmx; +const target_max_y=$tmy; +const icx=target_max_x/2; +const icy=target_max_y/2; +const pts=$1; +H=$3; +K=$4; +const zoom=1/$5; +const ang=($6/180)*pi; +const origin_x=$7*-1*zoom; +const origin_y=$8*zoom; +const sd=max(w,h)/min(w,h); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +const sx_zoom=sx*zoom; +const sy_zoom=sy*zoom; +const cx=(max_x-1)/2; +const cy=(max_y-1)/2; +const osx=origin_x*sx; +const osy=origin_y*sy; +const icx_zoom=icx/zoom; +const icy_zoom=icy/zoom; +const cxsx=icx*sx; +const cysy=icy*sy; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +$10?( +if(narg($11), +const argpos10=$11%4; +argpos10==0?func_a(a)=csin(a): +argpos10==1?func_a(a)=ccos(a): +argpos10==2?func_a(a)=ctan(a): +argpos10==3?func_a(a)=clog(a); +,func_a(a)=csin(a); +); +if(narg($12), +const argpos11=$12%4; +argpos11==0?func_b(a)=csin(a): +argpos11==1?func_b(a)=ccos(a): +argpos11==2?func_b(a)=ctan(a): +argpos11==3?func_b(a)=clog(a); +,func_b(a)=ccos(a); +); +if(narg($13), +const argpos12=$13%4; +argpos12==0?func_c(a)=csin(a): +argpos12==1?func_c(a)=ccos(a): +argpos12==2?func_c(a)=ctan(a): +argpos12==3?func_c(a)=clog(a); +,func_c(a)=ctan(a); +); +if(!narg($14), +if(narg($11), +argpos10==0?func_d(a)=csin(a): +argpos10==1?func_d(a)=ccos(a): +argpos10==2?func_d(a)=ctan(a): +argpos10==3?func_d(a)=clog(a); +,func_d(a)=csin(a); +);, +const argpos13=$14%4; +argpos13==0?func_d(a)=csin(a): +argpos13==1?func_d(a)=ccos(a): +argpos13==2?func_d(a)=ctan(a): +argpos13==3?func_d(a)=clog(a); +); +if(!narg($15), +if(narg($12), +argpos11==0?func_e(a)=csin(a): +argpos11==1?func_e(a)=ccos(a): +argpos11==2?func_e(a)=ctan(a): +argpos11==3?func_e(a)=clog(a); +,func_e(a)=ccos(a); +);, +const argpos14=$15%4; +argpos14==0?func_e(a)=csin(a): +argpos14==1?func_e(a)=ccos(a): +argpos14==2?func_e(a)=ctan(a): +argpos14==3?func_e(a)=clog(a); +); +if(!narg($16), +if(narg($13), +argpos12==0?func_f(a)=csin(a): +argpos12==1?func_f(a)=ccos(a): +argpos12==2?func_f(a)=ctan(a): +argpos12==3?func_f(a)=clog(a); +,func_f(a)=ctan(a); +);, +const argpos15=$16%4; +argpos15==0?func_f(a)=csin(a): +argpos15==1?func_f(a)=ccos(a): +argpos15==2?func_f(a)=ctan(a): +argpos15==3?func_f(a)=clog(a); +); +popcorn_x(a,b)=(Kb=K**b;a-H**func_a(b+func_b(Kb+func_c(Kb)))); +popcorn_y(a,b)=(Ka=K**a;b-H**func_d(a+func_e(Ka+func_f(Ka)))); +):( +if(narg($11), +const argpos10=$11%4; +argpos10==0?func_a(a)=csin(a): +argpos10==1?func_a(a)=ccos(a): +argpos10==2?func_a(a)=ctan(a): +argpos10==3?func_a(a)=clog(a); +,func_a(a)=csin(a); +); +if(narg($12), +const argpos11=$12%4; +argpos11==0?func_b(a)=csin(a): +argpos11==1?func_b(a)=ccos(a): +argpos11==2?func_b(a)=ctan(a): +argpos11==3?func_b(a)=clog(a); +,func_b(a)=ctan(a); +); +if(!narg($13), +if(narg($11), +argpos10==0?func_c(a)=csin(a): +argpos10==1?func_c(a)=ccos(a): +argpos10==2?func_c(a)=ctan(a): +argpos10==3?func_c(a)=clog(a); +,func_c(a)=csin(a); +);, +const argpos12=$13%4; +argpos12==0?func_c(a)=csin(a): +argpos12==1?func_c(a)=ccos(a): +argpos12==2?func_c(a)=ctan(a): +argpos12==3?func_c(a)=clog(a); +); +if(!narg($14), +if(narg($12), +argpos11==0?func_d(a)=csin(a): +argpos11==1?func_d(a)=ccos(a): +argpos11==2?func_d(a)=ctan(a): +argpos11==3?func_d(a)=clog(a); +,func_d(a)=ctan(a); +);, +const argpos13=$14%4; +argpos13==0?func_d(a)=csin(a): +argpos13==1?func_d(a)=ccos(a): +argpos13==2?func_d(a)=ctan(a): +argpos13==3?func_d(a)=clog(a); +); +popcorn_x(a,b)=a-H**func_a(b+func_b(K**b)); +popcorn_y(a,b)=b-H**func_c(a+func_d(K**a)); +); +); +real=sx_zoom*(x-cx)/cx; +imag=sy_zoom*(y-cy)/cy; +real+=origin_x; +imag+=origin_y; +z_plane_a=[real,0]; +z_plane_b=[0,imag]; +repeat(pts, +plane_a=popcorn_x(z_plane_a,z_plane_b); +plane_b=popcorn_y(z_plane_a,z_plane_b); +zn=sum(sqr((plane_a)[0]),sqr((plane_b)[1])); +plane_a/=zn; +plane_b/=zn; +real_val="$fvx"; +imag_val="$fvy"; +rpos=round(real_val); +ipos=round(imag_val); +i(#-1,rpos,ipos)++; +z_plane_a=plane_a; +z_plane_b=plane_b; +);" +rm. +#@cli rep_rainbowify: -360<_hue_shift<360,-360<_gradient_angle<360,_gradient_scale[%]>0 +#@cli : Apply rainbowify effect into image. Inspired by Rainbowify effect made by Jonathan Frech. The original source of the Rainbowify effect is found in the following URL - https://blog.jfrech.com/180/. +#@cli : Default values: '_hue_shift=0','_gradient_angle=0','_gradient_angle=100%' +#@cli : Author: Reptorian. +rep_rainbowify: +skip ${1=0},${2=0},${3=100%} +foreach { +if s>4 continue fi +if s==4 sh 0,2 fi +if s<3 +command "rainbowify : {w},{h},100%,{s==2?4:3},\"$""1\"" +command "end_out : k." +calc_v="i(#0,x,y,z,0)" +else +command "rainbowify : fill. \"$""1\"" +command "end_out : k[0]" +calc_v=avg(I) +fi +if s==2 calc_rainbow="[hue2rgb(fmod(v+pos+shift_hue)),i(#0,x,y,z,1)]" +else calc_rainbow=hue2rgb(fmod(v+pos+shift_hue)) +fi +rainbowify. "begin( +const shift_hue=$1+180; +const ang=($2/180)*pi; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +rot_y(a,b)=a*sin_ang+b*cos_ang; +const sd=max(w,h)/min(w,h); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +const ww=w-1; +const hh=h-1; +const cx=ww/2; +const cy=hh/2; +const cxsx=cx/sx; +const cysy=cy/sy; +const m=360/255; +const rescale_pos=180*$3; +fmod(a)=a-360*floor(a/360); +hue2rgb(h)=( +H=(h/60)%6; +K=(1-abs(H%2-1))*255; +arg(1+int(H),[255,K,0],[K,255,0],[0,255,K],[0,K,255],[K,0,255],[255,0,K]); +); +); +px=(x-cx)/cxsx; +py=(y-cy)/cysy; +pos=rot_y(px,py)*rescale_pos; +v="$calc_v"*m; +"$calc_rainbow"; +" +end_out +uncommand rainbowify,end_out +} +#@cli rep_w_rgb82gray: eq. to 'rep_weighted_rgb82gray' +rep_w_rgb82gray: rep_weighted_rgb82gray $* +#@cli rep_weighted_rgb82gray: 0%<=red_weight<=100%,0%<=green_weight<=100%,0%<=blue_weight<=100%,_use_weighted_ratio={ 0=no | 1= yes },0<=_minval_weight[%]<=100%,,0<=_maxval_weight[%]<=100%,,0<=_balance_minmax<=1,0<=_endvaladj<=255,-1<=_midgrayadj<=1 +#@cli : Convert images to grayscale image based on different weights, the usage of min/max val, and post-process value adjustment. +#@cli : Default values: '_use_weighted_ratio=1','_minval_weight=0%','_maxval_weight=0%','_balance_minmax=50%','_endvaladj=0','_midgrayadj=0' +#@cli : Author: Reptorian. +#@cli : $ sp car rep_weighted_rgb82gray 10%,50%,70%,,,,,,-.25 +rep_weighted_rgb82gray: +skip ${4=1},${5=0%},${6=0%},${7=50%},${8=0},${9=0} +use_merge_back=0 +single_channel_mode=0 +foreach { +if s==4 +split_opacity +store. alpha_image +use_merge_back=1 +elif s==2 +split_opacity +store. alpha_image +use_merge_back=1 +elif s>4 continue +fi +if s==1 +command "calc_gray_image : fill. \"$""1\"" +single_channel_mode=1 +else +command "calc_gray_image : {w},{h},100%,1,\"$""1\"" +fi +calc_gray_image " +begin( +const red_weight_init=$1; +const green_weight_init=$2; +const blue_weight_init=$3; +const total_weight=red_weight_init+green_weight_init+blue_weight_init; +if($4, +const red_weight=red_weight_init/total_weight; +const green_weight=green_weight_init/total_weight; +const blue_weight=blue_weight_init/total_weight; +, +const red_weight=red_weight_init; +const green_weight=green_weight_init; +const blue_weight=blue_weight_init; +); +rescale_color=[red_weight,green_weight,blue_weight]; +(!$5&&!$6)?( +calc_gray()=sum(I#-1*rescale_color); +): +$5&&$6?( +calc_gray()=( +col_ref=I#-1; +start_col_ref=col_ref*rescale_color; +minval=cut(lerp(sum(start_col_ref),min(col_ref),$5),0,255); +maxval=cut(lerp(sum(start_col_ref),max(col_ref),$6),0,255); +balval=lerp(minval,maxval,$7); +); +):( +$6?( +calc_gray()=( +col_ref=I#-1; +start_col_ref=col_ref*rescale_color; +maxval=cut(lerp(sum(start_col_ref),max(col_ref),$6),0,255); +); +):( +calc_gray()=( +col_ref=I#-1; +start_col_ref=I#-1*rescale_color; +minval=cut(lerp(sum(start_col_ref),min(col_ref),$5),0,255); +); +); +); +abs($9)?( +calc_gray_output()=cut(calc_gray(),0,255); +):( +calc_gray_output()=cut(calc_gray()+$8,0,255); +); +); +calc_gray_output();" +if abs($9) +if $9>0 +f. "begin( +const expf=cut(1-abs($9),0,1); +); +cut(((i/255)^expf)*255+$8,0,255)" +else +f. "begin( +const expf=cut(1-abs($9),0,1); +); +cut(255-(((255-i)/255)^expf)*255+$8,0,255)" +fi +fi +if !$single_channel_mode +k. +if $use_merge_back +$alpha_image a c +fi +fi +use_merge_back=0 +uncommand calc_gray_image +} +#@cli rep_hex8args2pal: hex_a,hex_b... +#@cli : Convert 8-bit hexadecimal arguments into palette representation. ++rep_hex8args2pal: +if size('$-1')==1 +axis,axis_arg={_'$-1'-_'x'},1 +if $#==1 error no_hex_arg fi +else +axis,axis_arg=0,0 +fi +('$*') +{L=$#-$axis_arg;v=[1,1,1];v[$axis]=L;[v,size('$1')>>1]},>"begin( +const length_of_hex_str=s<<1; +const separator_point=length_of_hex_str+1; +const _0=_'0'; +const _9=_'9'; +const _a=_'a'; +const _f=_'f'; +const _A=_'A'; +const _F=_'F'; +const sub_a=_a-10; +const sub_A=_A-10; +color=vector(#3,0); +position()="${arg\ $axis+1,x,y,z}"; +); +str=crop(#-1,separator_point*position(),0,0,0,length_of_hex_str,1,1,1); +repeat(length_of_hex_str,ind, +channel=ind>>1; +char=str[ind]; +inrange(char,_0,_9,1,1)?( +v=char-_0; +): +inrange(char,_a,_f,1,1)?( +v=char-sub_a; +): +inrange(char,_A,_F,1,1)?( +v=char-sub_A; +):( +run('error inv_args'); +); +ind&1?( +color[channel]+=v; +):( +color[channel]=v<<4; +); +); +color;" +remove[-2] +#@cli rep_int8args2hexargs: num_of_hexadecimal_numbers_per_values,value_1,value_2,.... +#@cli : Return the hexadecimal representations of numberical arguments. +#@cli : +#@cli : Author: Reptorian. +#@cli : $ echo ${rep_int8args2hexargs\ 3,250,100,220,255,85,110} +#@cli : $ echo ${rep_int8args2hexargs\ 2,250,100,220,255,85,110} +#@cli : $ echo ${rep_int8args2hexargs\ 1,250,100,220,255,85,110} +rep_int8args2hexargs: +check "$#>2&&isint($1)&&$1>0" +number_of_int_args={$#-1} +if $number_of_int_args%$1 error !(narg(\$\{2--1\})%"$"1)==F fi +{($number_of_int_args<<1)+int($number_of_int_args/$1)-1},1,1,1,"begin( +const color_size=$1; +const separator_position=color_size<<1; +const section_size=separator_position+1; +const comma=_','; +const _0=_'0'; +const char_ref_val=_'a'-10; +vints=[${2--1}]; +if(min(vints)<0||max(vints)>0xff,run('error inval_num');); +to_char(v)=if(inrange(v,0,9,1,1),_0+v,char_ref_val+v); +); +color_section=int(x/section_size); +val_pos=x%section_size; +val_pos!=separator_position?( +num_arg_pos=(val_pos>>1)+color_section*color_size; +decimal_number=vints[num_arg_pos]; +val_pos&1?to_char(decimal_number%16):to_char(decimal_number>>4); +):comma; +" +status {t} rm. +#@cli rep_hex2int8: hexadecimal_string +#@cli : Convert a hexadecimal argument into 8-bit representation, and then return the converted value. +#@cli : +#@cli : Author: Reptorian. +rep_hex2int8: +eval " +str_hex='$1'; +const s_str_hex=size(str_hex); +if(min(str_hex)==_'-'||s_str_hex&1, +run('error inv_inp'); +); +bitshift_factors=reverse(expr('x*8',s_str_hex>>1)); +(0x$1>>bitshift_factors)&0xff;" +#@cli rep_int82hex: 0<=8-bit_value<=255... +#@cli : Convert 8-bit numberical argument(s) into hexadecimal representation. +#@cli : +#@cli : Author: Reptorian. +rep_int82hex: +{narg($*)<<1},1,1,1,"begin( +const _0=_'0'; +const char_ref_val=_'a'-10; +vchar=[$*]; +if(min(vchar)<0||max(vchar)>255,run('error invalid_number');); +to_char(v)=if(inrange(v,0,9,1,1),_0+v,char_ref_val+v); +); +p=x>>1; +x&1?( +to_char(vchar[p]%16); +):( +to_char(vchar[p]>>4); +);" +u {t} rm. +#@cli rep_mlfrac_anim: eq. to 'rep_markus_lyapunov_fractal_animation +rep_mlfrac_anim: rep_markus_lyapunov_fractal_animation $* +#@cli rep_markus_lyapunov_fractal_animation: abc_string,abc_string_repeats,_sublevel>=0,0%<_view_size[%]<=100%,0%<=_pos_x[%]<=100%,0%<=_pos_y[%]<=100%,0%<=_pos_z_a[%]<=100%,0%<=_pos_z_b[%]<=100%,additional_arguments(see below) +#@cli : Generate an animation of Markus-Lyapunov Fractal or in other words, creates an animation demonstrating mapping of Lyapunov exponent within three values. Each frame represent a cross-section of a 3D Markus-Lyapunov Fractal. +#@cli : +#@cli : [1] http://charles.vassallo.pagesperso-orange.fr/en/lyap_art/lyapdoc.html +#@cli : +#@cli : (eq. to 'rep_mlfrac_anim') +#@cli : Note: Input for abc_string is case-insensitive. Only valid characters are A,a,B,b,C,c. +#@cli : Additional note: Depth of target image defines number of frames. +#@cli : +#@cli : --- Information on 'additional_arguments' --- +#@cli : The following set of arguments are accepted as additional arguments for the command: +#@cli : +#@cli : 1 - use_inversion={ 0=do_not_use_inversion | 1=use_inversion } +#@cli : 2* - hex_color_a,hex_color_b +#@cli : 3** - 'u',color_count>0,color_space={ 0=hsl | 1=lab | 2=lch } +#@cli : 4** - 'u','u',n_colors_a>0,n_colors_b>0,cs={ 0=hsl | 1=lab | 2=lch } +#@cli : 5*** - [image],order={ 0=default | 1=random | 2=mirrored },color_count +#@cli : 6*** - [image],[image],order_a={ 0=default | 1=random | 2=mirrored },use_randomize_b={ 0=default | 1=random | 2=mirrored },color_count_a,color_count_b +#@cli : +#@cli : * = No special characters or space! Only 0-9 and a-f case-insensitive. +#@cli : ** = 'u' means that the input you assigned is exactly 'u'. +#@cli : *** = If you assign a image with width and height both larger than 1, then you need to assign color_count in the respective place. use_randomize is used to randomize the colors in palette. +#@cli : +#@cli : Notes: See examples for usage of these additional variables. +#@cli : +#@cli : --- End of Information on 'additional_arguments' --- +#@cli : Default values: '_sublevel=1','_view_size=100%','_pos_x=50%','_pos_y=50%' +#@cli : +#@cli : Author: Reptorian. +#@cli : $ 50,50,50 rep_markus_lyapunov_fractal_animation abc,50,.5,100%,50%,50%,0%,100%,1 +#@cli : $ 50,50,50 rep_markus_lyapunov_fractal_animation abc,50,.5,100%,50%,50%,0%,100%,0000ff,ffff00 +#@cli : $ 50,50,50 rep_markus_lyapunov_fractal_animation abc,50,.5,100%,50%,50%,0%,100%,u,8,1 +#@cli : $ 50,50,50 rep_markus_lyapunov_fractal_animation abc,50,.5,100%,50%,50%,0%,100%,u,u,5,8,2 +#@cli : $ 50,50,50 +pal 71 rep_markus_lyapunov_fractal_animation[0] abc,50,.5,100%,50%,50%,0%,100%,[1],0 rm. +#@cli : $ 50,50,50 +pal 20 +pal 50 rep_markus_lyapunov_fractal_animation[0] abc,50,.5,100%,50%,50%,0%,100%,[1],[2],0,0 rm[-2,-1] +#@cli : $ 50,50,50 sp cat rep_markus_lyapunov_fractal_animation[0] abc,50,.5,100%,50%,50%,0%,100%,[1],0,9 rm. +#@cli : $ 50,50,50 sp cat sp lena rep_markus_lyapunov_fractal_animation[0] abc,50,.5,100%,50%,50%,0%,100%,[-2],[-1],1,1,8,8 rm[-2,-1] +rep_markus_lyapunov_fractal_animation: +skip "${3=1}","${4=100%}","${5=50%}","${6=50%}","${7=0%}","${8=100%}","${9=0}","${10=}","${11=}","${12=}","${13=}","${14=}" +check (abs($4)!=0)&&($!==1)&&(w#-1>1&&h#-1>1&&d#-1>1) +strlowercase $1 +ab_string=${} +a:=_'a' +('$ab_string') -. $a +include_a,include_b,include_c={[im==0,find(crop(#-1),1,0,1)!=-1,iM==2]} +if im#-1<0||iM#-1>2 error invalid_char_found! fi +if !($include_a&&$include_b&&$include_c) error invalid_string fi +ab_string={crop(#-1)} +rm. +mode,use_double_u,use_hex_mode,sub=0,{abs($3)+1} +ow,oh,od,nw,nh={[w,h,d,round([w,h]*$sub)]} +if narg($9)||narg($10) +if ${is_image_arg\ $9} mode+=1 +pass$9 0 +fi +if ${is_image_arg\ $10} mode+=1 +pass$10 0 +fi +if $mode==2 +if w#-2>1&&h#-2>1 +colormap.. $13 +if ($11%3)==1 +{w#-2},1,1,1,u(0,1) +pixelsort... +,x,[-1] +rm. +elif ($11%3)==2 +mirror.. x +fi +find_color_a=I(#-1,lyapunov_surface/minv*v_length_b,0,0,1); +else +if w#-2>1 +if ($11%3)==1 +{w#-2},1,1,1,u(0,1) +pixelsort... +,x,[-1] +rm. +elif ($11%3)==2 +mirror.. x +fi +find_color_a=I(#-1,lyapunov_surface/minv*v_length_b,0,0,1); +else +if ($11%3)==1 +1,{h#-2},1,1,u(0,1) +pixelsort... +,y,[-1] +rm. +elif ($11%3)==2 +mirror.. y +fi +find_color_a=I(#-1,0,lyapunov_surface/minv*v_length_b,0,1); +fi +fi +if w#-1>1&&h#-1>1 +colormap. $14 +if ($12%3)==1 +{w},1,1,1,u(0,1) +pixelsort.. +,x,[-1] +rm. +elif ($12%3)==2 +mirror. x +fi +find_color_b=I(#-2,lyapunov_surface/maxv*v_length_a,0,0,1); +else +if w#-1>1 +if ($12%3)==1 +{w},1,1,1,u(0,1) +pixelsort.. +,x,[-1] +rm. +elif ($12%3)==2 +mirror. x +fi +find_color_b=I(#-2,lyapunov_surface/maxv*v_length_a,0,0,1); +else +if ($12%3)==1 +1,{h},1,1,u(0,1) +pixelsort.. +,y,[-1] +rm. +elif ($12%3)==2 +mirror. y +fi +find_color_b=I(#-2,0,lyapunov_surface/maxv*v_length_a,0,1); +fi +fi +store. ref_colors_b +store. ref_colors_a +elif $mode==1 +if w>1&&h>1 +colormap. $11 +if ($10%3)==1 +{w},1,1,1,u(0,1) +pixelsort.. +,x,[-1] +rm. +elif ($10%3)==2 +mirror. x +fi +find_color_a=I(#-1,lyapunov_surface,0,0,1) +else +if w>1 +if ($10%3)==1 +{w},1,1,1,u(0,1) +pixelsort.. +,x,[-1] +rm. +elif ($10%3)==2 +mirror. x +fi +find_color_a=I(#-1,lyapunov_surface,0,0,1) +else +if ($10%3)==1 +1,{h},1,1,u(0,1) +pixelsort.. +,y,[-1] +rm. +elif ($10%3)==2 +mirror. y +fi +find_color_a=I(#-1,0,lyapunov_surface,0,1) +fi +fi +store. ref_gradient +else +if ('$9'=='u')&&('$10'=='u') +mode=3 +use_double_u=1 +if narg($11)&&narg($12) +if narg($13) +if ($13%3)==2 command "cs_out: lch82rgb" +elif ($13%3)==1 command "cs_out: lab82rgb" +else command "cs_out: hsl82rgb" +fi +else command "cs_out: hsl82rgb" +fi +$11,1,1,3,u(0,255) +$12,1,1,3,u(0,255) +store. ref_rand_col_a +store. ref_rand_col_b +else error needs size_arg +fi +else +if ('$9'=='u')||('$10'=='u') +mode=3 +if narg($11) +if ($11%3)==2 command "cs_out: lch82rgb" +elif ($11%3)==1 command "cs_out: lab82rgb" +else command "cs_out: hsl82rgb" +fi +else command "cs_out: hsl82rgb" +fi +if narg($12) srand $12 fi +if '$9'=='u' +$10,1,1,3,u(0,255) +store. ref_colors +else +$9,1,1,3,u(0,255) +store. ref_colors +fi +else +if (!(size('$9')%2))&&(!(size('$10')%2)) +use_hex_mode=1 +hex_color_a=${rep_hex2int8\ $9} +hex_color_b=${rep_hex2int8\ $10} +fi +fi +fi +fi +fi +out_lyapunov=limit +if !$mode&&!$use_hex_mode if $9 out_lyapunov=-limit fi fi +$nw,$nh,100%,1,":begin( +const sqr_size=cut(abs($4),0,1); +const gap=1-sqr_size; +const px=cut($5,0,1)*gap; +const py=cut($6,0,1)*gap; +const pz_a_init=cut($7,0,1); +const pz_b_init=cut($8,0,1); +const pz_a=min(pz_a_init,pz_b_init)*2+2; +const pz_b=max(pz_a_init,pz_b_init)*2+2; +const lx=px*2+2; +const ly=py*2+2; +const rx=(px+sqr_size)*2+2; +const ry=(py+sqr_size)*2+2; +const inc_w=w+1; +const inc_h=h+1; +const inc_d=d+1; +v_sequence=["$ab_string"]; +const seqsize=size(v_sequence); +const vsize=round(max(1,abs($2))*seqsize); +); +ix=lerp(lx,rx,(x+1)/inc_w); +iy=lerp(ry,ly,(y+1)/inc_h); +iz=lerp(pz_a,pz_b,(z+1)/inc_d); +vn=0.5; +limit=0; +repeat(vsize,n, +sp = n % seqsize; +rn=arg(v_sequence[sp]+1,ix,iy,iz); +vn=rn*vn*(1-vn); +limit+=log(abs(rn*(1-2*vn))); +); +"$out_lyapunov"; +" +if $mode==3 +if $use_double_u +$ref_rand_col_a +$ref_rand_col_b +$nw,$nh,$od,3,"begin_t( +const minv=im#-3; +const maxv=iM#-3; +const ww_a=w#-2-1; +const ww_b=w#-1-1; +); +lyapunov_surface=i0#-3; +use_b=lyapunov_surface>=0; +use_b?(I(#-1,lyapunov_surface/maxv*ww_b,0,0,1);) +:(I(#-2,lyapunov_surface/minv*ww_a,0,0,1););" +cs_out. +else +$ref_colors +$nw,$nh,$od,3,"begin( +const minv=im#-2; +const maxv=iM#-2; +const vs=w#-1-1; +const diff=(maxv-minv)/vs; +); +lyapunov_surface=(i0#-2-minv)/diff; +I(#-1,lyapunov_surface,0,0,1);" +cs_out. +fi +elif $mode==2 +$ref_colors_a +$ref_colors_b +$nw,$nh,$od,{max(s#-2,s#-1)},"begin_t( +const minv=im#-3; +const maxv=iM#-3; +const v_length_a=max(w#-2-1,h#-2-1); +const v_length_b=max(w#-1-1,h#-2,-1); +); +lyapunov_surface=i0#-3; +use_b=lyapunov_surface>=0; +use_b?("$find_color_b") +:("$find_color_a");" +elif $mode==1 +$ref_gradient +$nw,$nh,$od,{s#-1},"begin_t( +const minv=im#-2; +const maxv=iM#-2; +const v_length=max(w#-1-1,h#-1-1); +const diff=(maxv-minv)/v_length; +); +lyapunov_surface=(i0#-2-minv)/diff; +"$find_color_a";" +elif $use_hex_mode +$nw,$nh,$od,3,"begin_t( +hex_a=["$hex_color_a"]; +hex_b=["$hex_color_b"]; +const minv=im#-1; +const maxv=iM#-1; +const hpi=pi/2; +contrast(a)=( +b=a*pi-hpi; +.5*a^2+.5*(sin(b)+1)/2; +); +); +v=i0#-1; +shade=v>=0?v/maxv:contrast((1-(v/minv)^(1/2)))^2; +col=v>=0?hex_a:hex_b; +col*shade;" +fi +k. +s z r $ow,$oh,1,100%,6 +uncommand cs_out +#@cli rep_mlfrac: eq. to 'rep_markus_lyapunov_fractal +rep_mlfrac: rep_markus_lyapunov_fractal $* +#@cli rep_markus_lyapunov_fractal: abc_string,abc_string_repeats,_sublevel>=0,0%<_view_size[%]<=100%,0%<=_pos_x[%]<=100%,0%<=_pos_y[%]<=100%,0%<=_pos_z[%]<=100%,additional_arguments(see below) +#@cli : Generate Markus-Lyapunov Fractal or in other words, creates a mapping of Lyapunov exponent within two or three values.[1] Discovered by Mario Markus of the Max Planck Institute for Nutrition. Alexander Lyapunov was the one that discovered Lyapunov exponent. +#@cli : +#@cli : [1] http://charles.vassallo.pagesperso-orange.fr/en/lyap_art/lyapdoc.html +#@cli : +#@cli : (eq. to 'rep_mlfrac') +#@cli : Note: Input for abc_string is case-insensitive. Only valid characters are A,a,B,b,C,c. +#@cli : +#@cli : --- Information on 'additional_arguments' --- +#@cli : The following set of arguments are accepted as additional arguments for the command: +#@cli : +#@cli : 1 - use_inversion={ 0=do_not_use_inversion | 1=use_inversion } +#@cli : 2* - hex_color_a,hex_color_b +#@cli : 3** - 'u',color_count>0,color_space={ 0=hsl | 1=lab | 2=lch } +#@cli : 4** - 'u','u',n_colors_a>0,n_colors_b>0,cs={ 0=hsl | 1=lab | 2=lch } +#@cli : 5*** - [image],order={ 0=default | 1=random | 2=mirrored },color_count +#@cli : 6*** - [image],[image],order_a={ 0=default | 1=random | 2=mirrored },use_randomize_b={ 0=default | 1=random | 2=mirrored },color_count_a,color_count_b +#@cli : +#@cli : * = No special characters or space! Only 0-9 and a-f case-insensitive. +#@cli : ** = 'u' means that the input you assigned is exactly 'u'. +#@cli : *** = If you assign a image with width and height both larger than 1, then you need to assign color_count in the respective place. use_randomize is used to randomize the colors in palette. +#@cli : +#@cli : Notes: See examples for usage of these additional variables. +#@cli : +#@cli : --- End of Information on 'additional_arguments' --- +#@cli : Default values: '_sublevel=1','_view_size=100%','_pos_x=50%','_pos_y=50%' +#@cli : +#@cli : Author: Reptorian. +#@cli : $ 500,500 rep_markus_lyapunov_fractal ab,50,3,100%,50%,50%,50%,1 +#@cli : $ 500,500 rep_markus_lyapunov_fractal ab,50,3,100%,50%,50%,50%,0000ff,ffff00 +#@cli : $ 500,500 rep_markus_lyapunov_fractal ab,50,3,100%,50%,50%,50%,u,8,1 +#@cli : $ 500,500 rep_markus_lyapunov_fractal ab,50,3,100%,50%,50%,50%,u,u,5,8,2 +#@cli : $ 500,500 +pal 71 rep_markus_lyapunov_fractal[0] ab,50,3,100%,50%,50%,50%,[1],0 rm. +#@cli : $ 500,500 +pal 20 +pal 50 rep_markus_lyapunov_fractal[0] ab,50,3,100%,50%,50%,50%,[1],[2],0,0 rm[-2,-1] +#@cli : $ 500,500 sp cat rep_markus_lyapunov_fractal[0] ab,50,3,100%,50%,50%,50%,[1],0,9 rm. +#@cli : $ 500,500 sp cat sp lena rep_markus_lyapunov_fractal[0] ab,50,3,100%,50%,50%,50%,[-2],[-1],1,1,8,8 rm[-2,-1] +rep_markus_lyapunov_fractal: +skip "${3=1}","${4=100%}","${5=50%}","${6=50%}","${7=50%}","${8=0}","${9=}","${10=}","${11=}","${12=}","${13=}" +check "abs($4)!=0" +strlowercase $1 +ab_string=${} +a:=_'a' +('$ab_string') -. $a +if im<0||iM>2 error invalid_char_found! fi +include_a,include_b,include_c={[im==0,find(crop(#-1),1,0,1)!=-1,iM==2]} +case_d1={!($include_a&&$include_b)} +case_dn={!(!$case_d1&&$include_c)} +ab_string={crop(#-1)} +rm. +mode,use_double_u,use_hex_mode=0 +sub={abs($3)+1} +if narg($8)||narg($9) +if ${is_image_arg\ $8} mode+=1 +pass$8 0 +fi +if ${is_image_arg\ $9} mode+=1 +pass$9 0 +fi +if $mode==2 +if w#-2>1&&h#-2>1 +colormap.. $12 +if ($10%3)==1 +{w#-2},1,1,1,u(0,1) +pixelsort... +,x,[-1] +rm. +elif ($10%3)==2 +mirror.. x +fi +find_color_a=I(#-1,lyapunov_surface/minv*v_length_b,0,0,1); +else +if w#-2>1 +if ($10%3)==1 +{w#-2},1,1,1,u(0,1) +pixelsort... +,x,[-1] +rm. +elif ($10%3)==2 +mirror.. x +fi +find_color_a=I(#-1,lyapunov_surface/minv*v_length_b,0,0,1); +else +if ($10%3)==1 +1,{h#-2},1,1,u(0,1) +pixelsort... +,y,[-1] +rm. +elif ($10%3)==2 +mirror.. y +fi +find_color_a=I(#-1,0,lyapunov_surface/minv*v_length_b,0,1); +fi +fi +if w#-1>1&&h#-1>1 +colormap. $13 +if ($11%3)==1 +{w},1,1,1,u(0,1) +pixelsort.. +,x,[-1] +rm. +elif ($11%3)==2 +mirror. x +fi +find_color_b=I(#-2,lyapunov_surface/maxv*v_length_a,0,0,1); +else +if w#-1>1 +if ($11%3)==1 +{w},1,1,1,u(0,1) +pixelsort.. +,x,[-1] +rm. +elif ($11%3)==2 +mirror. x +fi +find_color_b=I(#-2,lyapunov_surface/maxv*v_length_a,0,0,1); +else +if ($11%3)==1 +1,{h},1,1,u(0,1) +pixelsort.. +,y,[-1] +rm. +elif ($11%3)==2 +mirror. y +fi +find_color_b=I(#-2,0,lyapunov_surface/maxv*v_length_a,0,1); +fi +fi +store. ref_colors_b +store. ref_colors_a +elif $mode==1 +if w>1&&h>1 +colormap. $10 +if ($9%3)==1 +{w},1,1,1,u(0,1) +pixelsort.. +,x,[-1] +rm. +elif ($9%3)==2 +mirror. x +fi +find_color_a=I(#-1,lyapunov_surface,0,0,1) +else +if w>1 +if ($9%3)==1 +{w},1,1,1,u(0,1) +pixelsort.. +,x,[-1] +rm. +elif ($9%3)==2 +mirror. x +fi +find_color_a=I(#-1,lyapunov_surface,0,0,1) +else +if ($9%3)==1 +1,{h},1,1,u(0,1) +pixelsort.. +,y,[-1] +rm. +elif ($9%3)==2 +mirror. y +fi +find_color_a=I(#-1,0,lyapunov_surface,0,1) +fi +fi +store. ref_gradient +else +if ('$8'=='u')&&('$9'=='u') +mode=3 +use_double_u=1 +if narg($10)&&narg($11) +if narg($12) +if ($12%3)==2 command "cs_out: lch82rgb" +elif ($12%3)==1 command "cs_out: lab82rgb" +else command "cs_out: hsl82rgb" +fi +else command "cs_out: hsl82rgb" +fi +$10,1,1,3,u(0,255) +$11,1,1,3,u(0,255) +store. ref_rand_col_a +store. ref_rand_col_b +else error needs size_arg +fi +else +if ('$8'=='u')||('$9'=='u') +mode=3 +if narg($10) +if ($10%3)==2 command "cs_out: lch82rgb" +elif ($10%3)==1 command "cs_out: lab82rgb" +else command "cs_out: hsl82rgb" +fi +else command "cs_out: hsl82rgb" +fi +if narg($11) srand $11 fi +if '$8'=='u' +$9,1,1,3,u(0,255) +store. ref_colors +else +$8,1,1,3,u(0,255) +store. ref_colors +fi +else +if (!(size('$8')%2))&&(!(size('$9')%2)) +use_hex_mode=1 +hex_color_a=${rep_hex2int8\ $8} +hex_color_b=${rep_hex2int8\ $9} +fi +fi +fi +fi +fi +out_lyapunov=limit +if !$mode&&!$use_hex_mode if $8 out_lyapunov=-limit fi fi +foreach { +ow,oh,od={[w,h,d]} +nw,nh={round([w,h]*$sub)} +nd={d>1?d*$sub:1} +if d>1 +if $case_dn error "At least one of the abc character is not found!" fi +pz_text="const pz=cut($7,0,1)*gap;" +lz_text="const lz=pz*2+2;" +rz_text="const rz=(pz+sqr_size)*2+2;" +inc_d="const inc_d=d+1;" +calc_iz_text="iz=lerp(lz,rz,(z+1)/inc_d);" +else +if $case_d1 error "At least one of the ab character is not found!" fi +const_iz_text="const iz=lerp(2+1/(max(w,h,d)+1),2+max(w,h,d)/(max(w,h,d)+1)*2,$7);" +fi +$nw,$nh,$nd,1,":begin_t( +const sqr_size=cut(abs($4),0,1); +const gap=1-sqr_size; +const px=cut($5,0,1)*gap; +const py=cut($6,0,1)*gap; +"$pz_text" +const lx=px*2+2; +const ly=py*2+2; +"$lz_text" +const rx=(px+sqr_size)*2+2; +const ry=(py+sqr_size)*2+2; +"$rz_text" +const inc_w=w+1; +const inc_h=h+1; +"$inc_d" +"$const_iz_text" +v_sequence=["$ab_string"]; +const seqsize=size(v_sequence); +const vsize=round(max(1,abs($2))*seqsize); +); +ix=lerp(lx,rx,(x+1)/inc_w); +iy=lerp(ry,ly,(y+1)/inc_h); +"$calc_iz_text" +vn=0.5; +limit=0; +repeat(vsize,n, +sp = n % seqsize; +rn=arg(v_sequence[sp]+1,ix,iy,iz); +vn=rn*vn*(1-vn); +limit+=log(abs(rn*(1-2*vn))); +); +"$out_lyapunov"; +" +if $mode==3 +if $use_double_u +$ref_rand_col_a +$ref_rand_col_b +$nw,$nh,$nd,3,"begin_t( +const minv=im#-3; +const maxv=iM#-3; +const ww_a=w#-2-1; +const ww_b=w#-1-1; +); +lyapunov_surface=i0#-3; +use_b=lyapunov_surface>=0; +use_b?(I(#-1,lyapunov_surface/maxv*ww_b,0,0,1);) +:(I(#-2,lyapunov_surface/minv*ww_a,0,0,1);); +" +cs_out. +else +$ref_colors +$nw,$nh,$nd,3,"begin( +const minv=im#-2; +const maxv=iM#-2; +const vs=w#-1-1; +const diff=(maxv-minv)/vs; +); +lyapunov_surface=(i0#-2-minv)/diff; +I(#-1,lyapunov_surface,0,0,1); +" +cs_out. +fi +elif $mode==2 +$ref_colors_a +$ref_colors_b +$nw,$nh,$nd,{max(s#-2,s#-1)},"begin_t( +const minv=im#-3; +const maxv=iM#-3; +const v_length_a=max(w#-2-1,h#-2-1); +const v_length_b=max(w#-1-1,h#-2,-1); +); +lyapunov_surface=i0#-3; +use_b=lyapunov_surface>=0; +use_b?("$find_color_b") +:("$find_color_a"); +" +elif $mode==1 +$ref_gradient +$nw,$nh,$nd,{s#-1},"begin_t( +const minv=im#-2; +const maxv=iM#-2; +const v_length=max(w#-1-1,h#-1-1); +const diff=(maxv-minv)/v_length; +); +lyapunov_surface=(i0#-2-minv)/diff; +"$find_color_a"; +" +elif $use_hex_mode +$nw,$nh,$nd,3,"begin_t( +hex_a=["$hex_color_a"]; +hex_b=["$hex_color_b"]; +const minv=im#-1; +const maxv=iM#-1; +const hpi=pi/2; +contrast(a)=( +b=a*pi-hpi; +.5*a^2+.5*(sin(b)+1)/2; +); +); +v=i0#-1; +shade=v>=0?v/maxv:contrast((1-(v/minv)^(1/2)))^2; +col=v>=0?hex_a:hex_b; +col*shade; +" +fi +r. $ow,$oh,$od,100%,6 +k. +pz_text="" +lz_text="" +rz_text="" +inc_d="" +calc_iz_text="" +const_iz_text="" +} +uncommand cs_out +status {$include_c+1} +#@cli rep_randgradbar : eq. to 'rep_random_gradient_bars' +rep_randgradbar:rep_random_gradient_bars $* +#@cli rep_random_gradient_bars: width>0,spacing>0,-360<=_angle<=360,-90<_skew_angle<90,-1<=_pos_x<=1,-1<=_pos_y<=1,_sublevel>=0,_gradient_shift,_gradient_mul_a,gradient_mul_b,_bar_modulo={ -1=random | 0=cut | 1=periodic | 2=continuous },_random_modulo_out={ 0=cut_and_periodic | 1=cut_and_continuous | 2=periodic_and_continuous },_gradient_color={ 0=B&W | 1=Duotone | 2=Rand-RGB | 3=Rand-HSV },_space_color={ 0=Alpha | 1=Binary Duotone | 2=Gradient Duotone },_symmetry_mode={ 0=none | 1=sym_a | 2=sym_b },_inversion_mode={ 0=n/a | 1=random-inverse | 2=complete-inverse},_bar_hex_rgb_color_a,_bar_hex_rgb_color_b : width>0,spacing>0,-360<=_angle<=360,-90<_skew_angle<90,-1<=_pos_x<=1,-1<=_pos_y<=1,_sublevel>=0,_gradient_shift,_gradient_mul_a,gradient_mul_b,_bar_modulo={ -1=random | 0=cut | 1=periodic | 2=continuous },_random_modulo_out={ 0=cut_and_periodic | 1=cut_and_continuous | 2=periodic_and_continuous },_gradient_color={ 0=B&W | 1=Duotone | 2=Rand-RGB | 3=Rand-HSV },_space_color={ 0=Alpha | 1=Binary Duotone | 2=Gradient Duotone },_symmetry_mode={ 0=none | 1=sym_a | 2=sym_b },_inversion_mode={ 0=n/a | 1=random-inverse | 2=complete-inverse},red_1,green_1,blue_1,red_2,green_2,blue_3 +#@cli : Create image filled with random bars. +#@cli : +#@cli : (eq. to 'rep_randgradbar') +rep_random_gradient_bars: +skip ${3=0},${4=0},${5=0},${6=0},${7=1},${8=0},${9=1},${10=100},${11=-1},${12=},${13=0},${14=0},${15=0},${16=0},${17=000000},${18=ffffff} +check "(abs($4)<90)&&((narg($*)==22)||(narg($*)==18))" +sub={abs($7)+1} +if narg(${17--1})==2 +color_a=${rep_hex2int8\ $17} +color_b=${rep_hex2int8\ $18} +else +color_a=${17-19} +color_b=${20-22} +fi +foreach { +ow,oh={[w,h]} +{w*$sub},{h*$sub},1,{$13?4:2},"*begin( +const ww=w-1; +const hh=h-1; +const sd=max(ww,hh)/min(ww,hh); +const sx=ww>hh?sd:1; +const sy=ww>hh?1:sd; +eucl_norm(a,b)=sqrt(a^2+b^2); +const diag_img=eucl_norm(ww,hh); +const ww_div_sx=ww/sx; +const hh_div_sy=hh/sy; +const cx=ww/2; +const cy=hh/2; +const ox=cx-(ww*-$5); +const oy=cy-(hh*$6); +const skew_ang=-($4/180)*pi; +const mdist=tan(skew_ang)*diag_img; +const ang=-($3/180)*pi; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +const cut_ang=atan2(cy,cx); +const cut_ang2=pi-cut_ang; +const symmetry_mode=$15%3; +const inversion_mode=($16+2)%3; +ispercentage($1)?( +const bar_width=max($sub,round((abs($1)*diag_img/4))); +):( +const bar_width=max($sub,round(abs($1)*$sub)); +); +ispercentage($2)?( +const space_width=abs($2)>0?max($sub,round((abs($2)*diag_img/4))); +):( +const space_width=round(abs($2)*$sub); +); +const total_width=bar_width+space_width; +const half_total_width=total_width>1?int(total_width/2); +(bar_width==1&&space_width<2)?( +const spacing=space_width>0?.5:0; +abs(space_width)?(calc_spacing()=int(point_x)%2?1;):(calc_spacing()=1;); +):( +const spacing=1-(space_width/(total_width-1)); +calc_spacing()=abs(1-fmod(point_x,total_width)/total_width-.5)*2<=spacing; +); +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +fmod(a,b)=a-b*floor(a/b); +fmod_cont(a,b)=floor(a/b)%2?b-fmod(a,b):fmod(a,b); +fcut(a,b)=(cut(a,-b,b)+b)/2; +const number_of_bars=ceil(eucl_norm(ww,hh)/total_width); +const shift_bars=int(number_of_bars/2); +symmetry_mode==1?(calc_bar()=(-1*abs(floor(point_x/total_width))+shift_bars)%number_of_bars;): +symmetry_mode==2?(calc_bar()=(abs(floor(point_x/total_width))+shift_bars)%number_of_bars;): +(calc_bar()=(floor(point_x/total_width)+shift_bars)%number_of_bars;); +v_mult=expr('u($9,$10)',number_of_bars,1,1,1); +$8!=0?v_shift=expr('u(-$8,$8)',number_of_bars,1,1,1):v_shift=vectornumber_of_bars(0); +v_use_invert=expr('round(u(0,1))',number_of_bars,1,1,1); +inversion_mode==1?(v_use_invert=vectornumber_of_bars(0);):( +inversion_mode==2?(v_use_invert=vectornumber_of_bars(1););); +const use_only_one_mode=$11>=0; +use_only_one_mode?( +const modulo_out=$11%3; +v_modulo_mode=vectornumber_of_bars(modulo_out); +):( +narg($12)?( +const modulo_out=$12%3; +modulo_out==0?(v_modulo_mode=expr('round(u(0,1))',number_of_bars,1,1,1);): +modulo_out==1?(v_modulo_mode=expr('round(u(0,1))*2',number_of_bars,1,1,1);): +(v_modulo_mode=expr('round(u(0,1))+1',number_of_bars,1,1,1);); +):( +v_modulo_mode=expr('round(u(0,2))',number_of_bars,1,1,1); +); +); +rgb2hsv(a)=( +R=a[0]; +G=a[1]; +B=a[2]; +M = max(R,G,B); +C = M - min(R,G,B); +H = 60*(C==0?0:M==R?((G - B)/C)%6:M==G?(B - R)/C + 2:(R - G)/C + 4); +S = M<=0?0:C/M; +[H,S,M/255]; +); +($14||$13==1)?( +color_a=["$color_a"]; +color_b=["$color_b"]; +$13==3?( +color_a=rgb2hsv(color_a); +color_b=rgb2hsv(color_b); +); +); +const bc=$13%4; +const sc=$14%3; +bc==3?( +v_hue=expr('u(0,360,1,0)',number_of_bars,1,1,1); +sc==2?( +calc_gradient()=spaces?[v_hue[bar],1,final_gradient,255]:[lerp(color_b,color_a,cut(gradient*2+.5,0,1)),255]; +): +sc==1?( +calc_gradient()=spaces?[v_hue[bar],1,final_gradient,255]:[gradient>=0?color_a:color_b,255]; +):( +calc_gradient()=[v_hue[bar],1,final_gradient,255*spaces]; +); +): +bc==2?( +v_rgb_r=expr('u(0,255)',number_of_bars,1,1,1); +v_rgb_g=expr('u(0,255)',number_of_bars,1,1,1); +v_rgb_b=expr('u(0,255)',number_of_bars,1,1,1); +sc==2?( +calc_gradient()=spaces?[final_gradient*v_rgb_r[bar],final_gradient*v_rgb_g[bar],final_gradient*v_rgb_b[bar],255]:[lerp(color_b,color_a,cut(gradient*2+.5,0,1)),255]; +): +sc==1?( +calc_gradient()=spaces?[final_gradient*v_rgb_r[bar],final_gradient*v_rgb_g[bar],final_gradient*v_rgb_b[bar],255]:[gradient>=0?color_a:color_b,255]; +):( +calc_gradient()=[final_gradient*v_rgb_r[bar],final_gradient*v_rgb_g[bar],final_gradient*v_rgb_b[bar],255*spaces]; +); +): +bc==1?( +sc==2?( +calc_gradient()=spaces?[lerp(color_a,color_b,final_gradient),255]:[lerp(color_b,color_a,cut(gradient*2+.5,0,1)),255]; +): +sc==1?( +calc_gradient()=spaces?[lerp(color_a,color_b,final_gradient),255]:[gradient>=0?color_a:color_b,255]; +):( +calc_gradient()=[lerp(color_a,color_b,final_gradient),255*spaces]; +); +):( +sc==2?( +calc_gradient()=spaces?[final_gradient,255]:[cut(gradient*2+.5,0,1),255]; +): +sc==1?( +calc_gradient()=spaces?[final_gradient,255]:[gradient>=0,255] +):( +calc_gradient()=[final_gradient,255*spaces]; +); +); +); +initial_x=(x-ox)/ww*sx; +initial_y=(y-oy)/hh*sy; +gradient=-rot_y(initial_x,initial_y)*hh_div_sy/diag_img; +point_x=rot_x(initial_x,initial_y)*ww_div_sx+gradient*mdist+half_total_width; +bar=calc_bar(); +spaces=calc_spacing(); +new_gradient=gradient*v_mult[bar]+v_shift[bar]; +use_modulo_out=v_modulo_mode[bar]; +use_modulo_out==2?(final_gradient=v_use_invert[bar]?1-fmod_cont(new_gradient,1):fmod_cont(new_gradient,1);): +use_modulo_out==1?(final_gradient=v_use_invert[bar]?1-fmod(new_gradient,1):fmod(new_gradient,1);): +(final_gradient=v_use_invert[bar]?1-fcut(new_gradient,1):fcut(new_gradient,1);); +calc_gradient();" +rm.. +if $13==3 hsv2rgb. fi +if $sub!=1 r. $ow,$oh,100%,100%,5 fi +} +#@cli rep_skew: angle,-100%<=_position_skew[%]<=100%,_axis={x|y|z},_boundary={0= 0=dirichlet | 1=neummann | 2=periodic | 3=mirror},_interpolation={ 0=nearest | 1=linear | 2=cubic },_enlarged_mode={ 0=preserve | 1=enlarge } +#@cli : Skew Image Based on angle. Note that axis==z condition has not been tested! +#@cli : Default values: _position_skew[%]=0%,_axis=0 +rep_skew: +skip ${2=0},${3=0},${4=3},${5=1},${6=1} +check (abs($1)<90)&&(abs($2)<=1)&&((($3==0)||($3==1)||($3==2))||(('$3'=='x')||('$3'=='y')||('$3'=='z'))) +if $1==0 return fi +if $6 +ang={($1/180)*pi} +tang={tan($ang)} +foreach { +if '$3'=='z'||$3==2 +echo[] "TODO: Add depth. Possible TODO: zx,zy,xz,zy" return +elif '$3'=='y'||$3==1 +dist={abs(w*$tang)} +new_height={h+$dist} +100%,$new_height,100%,100%,"begin( +const ang=$ang*-1; +const offpos=(h-h#-1)/2; +const ww=w-1; +const half_w=(w-1)/2; +const dist=ww*tan(ang); +); +ypos=(x-half_w)/ww*dist-offpos; +I(#-1,x,y+ypos,z,$5,$4);" +elif '$3'=='x'||$3==0 +dist={abs(h*$tang)} +new_width={w+$dist} +$new_width,100%,100%,100%,"begin( +const ang=$ang; +const offpos=(w-w#-1)/2; +const hh=h-1; +const half_h=(h-1)/2; +const dist=hh*tan(ang); +); +xpos=(y-half_h)/hh*dist-offpos; +I(#-1,x+xpos,y,z,$5,$4);" +else +error "Invalid input!" +fi +k. +} +else +if '$3'=='z'||$3==2 +echo[] "Untested! Possible TODO: zx,zy,xz,zy" +f "begin( +const ang=($1/180)*pi; +const dd=d-1; +const pz=dd*($2*.5+.5); +const dist=dd*tan(ang); +); +zpos=(z-pz)/dd; +J(0,0,lerp(0,dist,zpos),$5,$4);" +elif '$3'=='y'||$3==1 +f "begin( +const ang=($1/180)*pi*-1; +const ww=w-1; +const px=ww*($2*.5+.5); +const dist=ww*tan(ang); +); +xpos=(x-px)/ww; +J(0,lerp(0,dist,xpos),0,$5,$4);" +elif '$3'=='x'||$3==0 +f "begin( +const ang=($1/180)*pi; +const hh=h-1; +const py=hh*(-$2*.5+.5); +const dist=hh*tan(ang); +); +ypos=(y-py)/hh; +J(lerp(0,dist,ypos),0,0,$5,$4);" +else +error "Invalid input!" +fi +fi +#@cli rep_hpd: eq. to 'rep_henon_phase_diagram' +rep_hpd:rep_henon_phase_diagram $* +#@cli rep_henon_phase_diagram: a,_scale>0,-180>=_rotation>=180,_posx,_posy,_lines>0,1<_pts_per_line<=500,_start_x0,_end_x0,_steps_x0,_multiple_map +#@cli : Creates Henon Phase Diagram on existing image. Multiple Map option is used to make it easier to create more interesting image via coding. +#@cli : +#@cli : (eq. to 'rep_hpd')\n +#@cli : TODO: Add more description here. +rep_henon_phase_diagram: +skip ${2=1},${3=0},${4=50%},${5=50%}${6=600},${7=1750},${8=-.5},${9=.5},${10=8},${11=0} +if $2==0 error "$"2!=0==F fi +output_mode={$11%4} +if $1!=0 +if s#-1!=1&&d#-1!=1 100%,100%,1,1,-1 +else +if !iv#-1&&iM#-1!=-1 f. -1 fi +fi +if ($3-360*floor($3/360))?1 +out_xi=rot_x(xi,yi) +out_yi=rot_y(xi,yi) +else +out_xi=xi +out_yi=yi +fi +steps={round((max(1,abs($10))-1))} +lines={max(1,round(abs($6)))} +if $output_mode==3 calc_out=i(#-1,cx,cy)=1 +else calc_out=cv=i(#-1,cx,cy);i(#-1,cx,cy)=max(cv,y) +fi +$steps,$lines,1,1,":begin_t( +const a=$1; +const c=cos(a); +const s=sin(a); +const pts=max(1,round(abs($7))); +const ex=w#-1-1; +const ey=h#-1-1; +const posx=ex*$4; +const posy=ey*$5; +const hex=ex/2; +const hey=ey/2; +const dist=min(hex,hey)*abs($2); +const tau=2*pi; +const start_x0=$8; +const end_x0=$9; +const ang=($3/180)*pi*-1; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +if(abs($10) +,const end_step=w-1; +,const end_step=1; +); +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +); +t=lerp(start_x0,end_x0,x/end_step); +xi=t; +yi=y/h*tau; +repeat(pts, +m=xi; +n=yi-sqr(xi); +xn=xi*c-n*s; +yn=xi*s+n*c; +if(xn==inf||yn==inf||xn==-inf||yn==-inf,break()); +xi=xn;yi=yn; +if(m!=t, +cx=round(posx+"$out_xi"/2*dist); +cy=round(posy-"$out_yi"/2*dist); +"$calc_out"; +); +); +" +rm. +if $output_mode==2 ++eq. -1 ++negate. +elif $output_mode==1 ++gt. -1 +fi +else +f. 0 +fi +#@cli rep_mode_color: _outmode={ 0=blend | 1=mode_per_layer },_color_position +#@cli : Fill image with mode of colors. +#@cli : +#@cli : 'outmode' determines whether to blend images or fill images with mode of itself. If images are to be blended, then it is possible nan values will occur due to the absence of mode or more than one mode. +#@cli : '_color_position' determines the mode to use if it is 0 or over +#@cli : +#@cli : Author: Reptorian. +#@cli : Default values: '_outmode=0','_color_position=-1' +rep_mode_color: +skip ${1=0},${2=-1} +if $!>2&&!$1 ++a z colormap. 0 +a[^-1] c +{w#0},{h#0},{d#0},{s#1},"begin( +const vs=w#1; +const ss=s#1; +const css=s#0/ss; +endnan=vectors(nan); +); +nmaxfreq=0; +vfreq=vectorvs(-1); +vp=I#0; +repeat(css,pos, +curcol=vp[pos*ss,ss]; +repeat(vs,posfreq, +coltestpos=I(#1,posfreq,0,0); +if(curcol==coltestpos,++vfreq[posfreq];); +); +); +maxfreqcount=max(vfreq); +if(maxfreqcount+1, +posmaxfreqcol=find(vfreq,maxfreqcount,0,1); +repeat(vs,fs,if(vfreq[fs]==maxfreqcount,++nmaxfreq;);); +if(nmaxfreq==1,I(#1,posmaxfreqcol,0,0);,endnan); +,endnan; +);" +k. +elif $!==2&&!$1 +f. "begin(endnan=vectors(nan););I==I#0?I:endnan;" rm.. +else +foreach { +if s>4 error "Unsupported number of channels" fi +ls={s} +minv={im} +- $minv +repeat s { +sh. $> +bsize$>={iM+1} +rm. +} +if s==1 +$bsize0,1,1,1 eval.. ++i(#-1,i,0,0,0) {w},1,1,1,x +u {"freq=0; +repeat(w#-2,n, +if(i(#-2,n)==iM#-2,++freq;); +); +(freq)"} +maxfreq={${}} +echo $maxfreq ++.. $minv +pixelsort. -,x,[-2] +if $1<0 +if $maxfreq==1 +f... i(#-1,0,0,0) +fi +k... +else +pos={$1%$maxfreq} +f... i(#-1,$pos,0,0) +k... +fi +else +if s==2 $bsize0,$bsize1,1,1 eval.. ++i(#-1,[I,0]) dins=[x,y] +elif s==3 $bsize0,$bsize1,$bsize2,1 eval.. ++i(#-1,I) dins=[x,y,z] +elif s==4 $bsize0,$bsize1,$bsize2,$bsize3 eval.. ++i(#-1,I) dins=[x,y,z,c] +fi +1,1,1,$ls 1,1,1,1 +eval... :${-math_lib}${-dar_lib}"begin( +const ls=$ls; +); +if(i, +dar_insert(#-2,"$dins"); +dar_insert(#-1,i-1); +); +end( +resize(#-2,1,dar_size(#-2),1,s(#-2),0); +resize(#-1,1,dar_size(#-1),1,s(#-1),0); +); +" ++.. $minv +pixelsort.. -,y,[-1] +sort. - +u {"freq=0; +repeat(h#-1,n, +if(i(#-1,0,n)==iM,++freq,break();); +); +(freq)"} +maxfreq={${}} +if $2<0 +if $maxfreq==1 +f[-4] I(#-2,0,0,0) +fi +else +pos={int($2)%$maxfreq} +f[-4] I(#-2,0,$posfreq,0) +fi +k[-4] +fi +} +fi +#@cli rep_dynamic_contrast: -64<=amount<=64,0<=_threshold<=255,0<=_intensity<=255 +#@cli : Apply dynamic contrast using formula found by Remake at forums.getpaint.net. Original source code - https://forums.getpaint.net/topic/117538-dynamic-contrast/?tab=comments#comment-578867 . It is similar to Photoshop's Dynamic Contrast. +#@cli : +#@cli : Author: Reptorian. +#@cli : Default values: '_threshold=128','_intensity=255' +rep_dynamic_contrast: +skip ${2=128},${3=255} +repeat $! { +sh[$>] {s#$>>=3?[0,2]:0} +if s>=3 calcval=v=I;lum=0.296875*v[0]+0.5859375*v[1]+0.11328125*v[2];(I-sqrt(abs(threshold-lum))*(lum>threshold?na:a))*fi+I*ifi; +else calcval=(i-sqrt(abs(threshold-i))*(i>threshold?na:a))*fi+i*ifi +fi +f. "begin( +const a=$1; +const threshold=$2; +const intensity=$3; +const na=1-a; +const fi=intensity/255; +const ifi=1-fi; +); +"$calcval" +" +cut. 0,255 +rm. +} +#@cli rep_cstdmap: eq. to 'rep_chirikov_taylor' +rep_cstdmap:rep_chirikov_taylor $* +#@cli rep_chirikov_taylor: size!=0,_lines>0,_pts_per_line>0,_k,_chirikov_mode={ 0=standard | 1=chirikov_karimov },_offmode={ 0=default | 1=center },_orientation={ 0=xy | 1=yx },_use_parallel={ 0=serial | 1=parallel } +#@cli : Creates Chirikov discrete map. Chirikov map can be the standard version which is created by Boris Chirikov or modification done by Artur I. Karimov.\n +#@cli : (eq. to 'rep_cstdmap')\n +#@cli : 'size' can be either in percent or integer. It can be negative or positive. Percentage mode is always based on the size of image. Positive values will lead to square value regardless of initial image. Negative value will create a new image based on whether the width or height is smaller, and scale based on the ratio of max dim vs min dim. +#@cli : '_lines' defines the number of lines created within image. It defaults to 1 if the user inputs a value in which the absolute of value is less than 1. +#@cli : '_pts_per_line' defines how much points is generated per lines. +#@cli : '_k' can be considered distortion factor. It can be negative. +#@cli : '_chirikov_mode' defines whether to apply a symmetric modification to the original version of chirikov standard map. The symmetric modification is based on the paper 'The Study of the Modified Chirikov Map' by Artur I.Karimov, Denis N. Butusov,Vyacheslav G. Rybin, Timur I.Karimov within Department of Computer Aided Design at Saint Petersburg Electrotechnical University. +#@cli : '_offmode' defines whether the main rotor will be centered. +#@cli : '_orientation' defines whether to switch axis for generation of chirikov map. +#@cli : +#@cli : Author: Reptorian. +#@cli : Default values: '_lines=500','_pts_per_line=5000','_k=1','_chirikov_mode=0','_offmode=0','_orientation=0','_use_parallel=1' +rep_chirikov_taylor: +skip ${2=500},${3=5000},${4=1},${5=0},${6=0},${7=0},${8=1} +if ispercentage($1) +if $! +if $1>0 +mw=${-max_w} +mh=${-max_h} +md={max($mw,$mh)} +chirikov_w,chirikov_h={$md*$1} +else +mw=${-max_w} +mh=${-max_h} +sd={max($mw,$mh)/min($mw,$mh)} +if $mh>$mw +chirikov_w={$mw*abs($1)} +chirikov_h={$sd*$chirikov_w} +else +chirikov_h={$mh*abs($1)} +chirikov_w={$sd*$chirikov_h} +fi +fi +else error \$\!>0==F +fi +else +if $1>0 +chirikov_w,chirikov_h=$1 +elif $1<0 +if $! +mw=${-max_w} +mh=${-max_h} +sd={max($mw,$mh)/min($mw,$mh)} +if $mh>$mw +chirikov_w={abs($1)} +chirikov_h={$sd*$chirikov_w} +else +chirikov_h={abs($1)} +chirikov_w={$sd*$chirikov_h} +fi +else error \$\!>0==F +fi +else error \$\1!=0==F +fi +fi +if $5 +chirikov_mode=txi=fmod(xi+.5*yi);yi=fmod(yi-k*sin(txi));xi=fmod(txi+.5*yi) +else +chirikov_mode=yi=fmod(yi+k*sin(xi));xi=fmod(xi+yi) +fi +if $7 +coordinates=[round(yi/tau*width),round(xi/tau*height)] +else +coordinates=[round(xi/tau*width),round(yi/tau*height)] +fi +lines={min(100*$chirikov_h,abs($2))+1} +$chirikov_w,$chirikov_h,1,1 +$lines,1,1,1,"begin(const ww=w-1;const tau=2*pi;);x/w*tau;" +if $8 start_char=: +else start_char=> +fi +f. $start_char" +begin( +const width=w#-2; +const height=h#-2; +const pts=max(1,abs(round($3))); +const k=$4; +const tau=2*pi; +fmod(a)=a-tau*floor(a/tau); +xi=0; +); +yi=i; +px=x+1; +repeat(pts, +"$chirikov_mode"; +coordinates="$coordinates"; +cv=i(#-2,coordinates[0],coordinates[1]); +i(#-2,coordinates[0],coordinates[1])=max(cv,px); +);" +rm. +if $6 +if $7 +if $5 +s. y,2 rv[-2,-1] a[-2,-1] y a[-2,-1] x +else s. x,2 rv[-2,-1] a[-2,-1] x +fi +else +if $5 +s. x,2 rv[-2,-1] a[-2,-1] x a[-2,-1] y +else s. y,2 rv[-2,-1] a[-2,-1] y +fi +fi +fi +#@cli rep_rd : eq. to 'rep_reverse_digits' +rep_rd: rep_reverse_digits ${1-3} +#@cli rep_reverse_digits: base>0,number_bounary_mode={ 0=regular | 1=periodic | 2=mirror },max_number_boundary>0 +#@cli : Reverse digits of image. +#@cli : (eq. to 'rep_rd') +#@cli : Default values: 'base=10','number_boundary_mode=0','max_number_boundary=255' +rep_reverse_digits: +skip ${1=10},${2=0},${3=255} +check "(isint($1)&&$1>1)&&(isint($3)&&$3>0)" +num_of_imgs={$!} +$num_of_imgs,1,1,2,min_val=im#x;[min_val,min_val<0?x:-1]; s. c +abs_min_img_val={min_img_val=im#-2;min_img_val<0?abs(min_img_val)} +if $abs_min_img_val +discard[-1] -1 +neg_img_list_pos,inc_neg_img_list_pos,number_of_negatives={neg_img_pos=$!-1;[neg_img_pos,neg_img_pos+1,h#-1]} +neg_img_list={crop(#-1)} ++lt[$neg_img_list] 0 ++store[$inc_neg_img_list_pos--1] negative_images +repeat $number_of_negatives { +img_pos={i(#$neg_img_list_pos,0,$>)} +-[$img_pos] [$inc_neg_img_list_pos] +remove[$inc_neg_img_list_pos] +} +store[-1] neg_img_list +else +remove[-1] +fi +$num_of_imgs,1,1,2,"begin( +const abs_min_img_val=$abs_min_img_val; +); +min_img_val=i(#-1); +max_img_val=iM#x; +if(abs(min_img_val)>max_img_val +,[0,abs_min_img_val] +,[max(0,min_img_val),max_img_val] +);" +diff={ceil(iM-im+1)} +rm[-2] +$diff,1,1,1,"begin( +const min_val=int(im#-1); +const base=$1; +const number_boundary_choice=int($2)%3; +number_boundary_choice?( +const boundary_number=$3; +number_boundary_choice==2?( +const m2_boundary_number=boundary_number<<1; +output(v)=( +va=v%m2_boundary_number; +boundary_number-abs(boundary_number-va); +); +):( +output(v)=v%boundary_number; +); +):( +output(v)=v; +); +); +rv=0; +n=x+min_val; +while(n, +rv=int(rv)*base+n%base; +n=int(n/base); +); +output(int(rv)); +" +-[^-2,-1] {im#-2} +remove[-2] +map[^-1] [-1],3 +remove[-1] +if $abs_min_img_val +$neg_img_list +neg_img_list_pos,inc_neg_img_list_pos={[$neg_img_list_pos,$inc_neg_img_list_pos]-1} +$negative_images +(1,-1) +map[$inc_neg_img_list_pos--2] [-1] +rm[-1] +repeat $number_of_negatives { +img_pos={i(#$neg_img_list_pos,0,$>)} +*[$img_pos] [$inc_neg_img_list_pos] +remove[$inc_neg_img_list_pos] +} +remove[-1] +fi +#@cli rep_tz: eq. to 'rep_tiled_zoom' +rep_tz:rep_tiled_zoom $* +#@cli rep_tiled_zoom: sqr_w>=0,_sqr_h>=0,_scale>=1,_boundary={ 0=none | 1=neumann | 2=periodic | 3=mirror } +#@cli : Zoom per tiles using information that exists.\n +#@cli : (eq. to 'rep_tz')\n +#@cli : Author: Reptorian\n +#@cli : Default values: '_sqr_h=sqr_w','_scale=2','_boundary=3' +rep_tiled_zoom: +skip ${2=$1},${3=2},${4=3} +sqr_w={max(round(abs($1)),1)} +sqr_h={max(round(abs($2)),1)} +sd={max(1,abs($3))} +if $sd!=1 +foreach { +columns={ceil(w/$sqr_w)} +rows={ceil(h/$sqr_h)} +offx={($sqr_w*$columns)-w} +offy={($sqr_h*$rows)-h} +offx/=2 +offy/=2 +offx=int($offx) +offy=int($offy) +f "begin( +px=expr('begin(const cen=(w-1)/2;);cv=x-cen;nv=cv*$sd;nv-cv;',$sqr_w); +py=expr('begin(const cen=(w-1)/2;);cv=x-cen;nv=cv*$sd;nv-cv;',$sqr_h); +const boundary=abs($4)%4; +); +coords=[px[(x+$offx)%$sqr_w],py[(y+$offy)%$sqr_h]]; +J(coords[0],coords[1],0,2,boundary);" +} +fi +#@cli rep_hsx_p_i: eq. to 'rep_hsx_poster_index' +rep_hsx_p_i:rep_hsx_poster_index $* +#@cli rep_hsx_poster_index: if $4<0 <=hue_bands<=360,saturation_bands,luminosity_bands,n/a,_colorspace={ 0=hsi | 1=hsl | 2=hsv | 3=hcy } : else 0<=hue_bands<=360,saturation_bands,luminosity_bands,0<=_dithering<=1,0<=start_hue<360,_colorspace={ 0=hsi | 1=hsl | 2=hsv | 3=hcy } +#@cli : Posterize images using indexing and several variants of hsx models.\n +#@cli : (eq. to 'rep_hsx_p_i')\n +#@cli : Author: Reptorian\n +#@cli : Default values: '_dithering=50%','start_hue=0','_colorspace=3' +rep_hsx_poster_index: +skip ${4=50%},${5=0},${6=2} +check "last_args=[${2-3}];inrange($1,2,360,1,1)&&!isin(0,(isint(last_args)&last_args>1))" +hue_scale,sat_scale,lum_scale,dithering,start_hue,cs_mode={[360/$1,[${2-3}]-1,cut($4,0,1),$5%360,int($6)%4+1]} +convert_colors_fwd=${arg\ $cs_mode,rgb2hsi,rgb2hsl,rgb2hsv,rgb2hcy} +convert_colors_bwd=${arg\ $cs_mode,hsi2rgb,hsl2rgb,hsv2rgb,hcy2rgb} +if $4 +fs_1R0D,fs_1L1D,fs_M01D,fs_1R1D={([7,3,5,1]/16)*$dithering} +foreach { +if !(s==3||s==4) continue fi +$convert_colors_fwd +if $start_hue +shared. 0 +-. $start_hue +%. 360 +rm. +fi +if s==4 shared 0,2 fi +fill. >"begin( +const width=w; +const height=h; +const hue_scale=$hue_scale; +const sat_scale=$sat_scale; +const lum_scale=$lum_scale; +const fs_1R0D=$fs_1R0D; +const fs_1L1D=$fs_1L1D; +const fs_M01D=$fs_M01D; +const fs_1R1D=$fs_1R1D; +); +old_color=I; +new_hue=round(old_color[0]/hue_scale)*hue_scale; +new_sat=round((old_color[1]*sat_scale))/sat_scale; +new_lum=round((old_color[2]*lum_scale))/lum_scale; +new_color=[new_hue,new_sat,new_lum]; +diff_color=old_color-new_color; +J(#-1, 1,0)+=diff_color*fs_1R0D; +J(#-1,-1,1)+=diff_color*fs_1L1D; +J(#-1, 0,1)+=diff_color*fs_M01D; +J(#-1, 1,1)+=diff_color*fs_1R1D; +new_color; +" +keep[0] +if $start_hue +shared 0 ++. $start_hue +%. 360 +rm. +fi +$convert_colors_bwd +} +else +360,1,1,1,x +if $1!=360 +/. $hue_scale +round. +*. $hue_scale +fi +store. hue_bands +foreach { +if !(s==3||s==4) continue fi +$convert_colors_fwd +repeat 3 { +if $> +scale_val=${arg\ $>,$sat_scale,$lum_scale} +shared $> +*. $scale_val +round. +/. $scale_val +rm. +else +shared 0 +$hue_bands +if $start_hue +-.. $start_hue +%.. 360 +fi +map.. . +if $start_hue ++.. $start_hue +%.. 360 +fi +rm[-2,-1] +fi +} +$convert_colors_bwd +} +fi +#@cli rep_mj_prn : eq. to 'rep_mj_pseudorandom_noise' +rep_mj_prn:rep_mj_pseudorandom_noise $* +#@cli rep_mj_pseudorandom_noise : _k1,_k2,_internal_shift,_ang,_px_size,_cx,_cy,_color_output,_kmode,_grid,_gridcol,_axis_thickness +#@cli : Render regular noise. Filter is a extended version of MadJik's Regular Noise PDN plugin and based off MadJik's code. The G'MIC version has been extended.\n +#@cli : (eq. to 'rep_mj_prn').\n +#@cli : '_k1' defines value for k-1 +#@cli : '_k2' defines value for k-2 +#@cli : '_internal_shift' shift rows based on this value. The more, the more distortion there will be. +#@cli : '_ang' defines the color/shade angle. +#@cli : '_px_size' defines how big the pixels are. +#@cli : '_cx' refers to the x-position of center based on world coordinate of -1,1 +#@cli : '_cy' refers to the y-position of center based on world coordinate of -1,1 +#@cli : '_color_output' is the function used to color the output. +#@cli : '_kmode' defines how the noise will be processed. +#@cli : '_grid' option is used to whether to output a grid. +#@cli : '_gridcol' defines the value of grid. Only gray color is supported. +#@cli : '_axis_thickness' defines whether the axis has 2 pixel instead of 1.\n +#@cli : Default values: '_k1=8','_k2=2','_internal_shift=1','_ang=0','_px_size=1','_cx=0','_cy=0','_coloroutput=1','_grid=0','_gridcol=0','_axis_thickness=0'\n +#@cli : Author: Reptorian. +#@cli : $ 512,512 rep_mj_pseudorandom_noise 8,2,1,95,4,0,0,1,0,,,0 +#@cli : $ 1024,1024 rep_mj_pseudorandom_noise 34,2,30,95,4,0,0,2 +rep_mj_pseudorandom_noise: +skip ${1=8},${2=2},${3=1},${4=0},${5=1},${6=0},${7=0},${8=1},${9=0},${10=0},${11=0},${12=0} +r 100%,100%,1,{$8?3:1} +3000,100,1,1,round((1-(x*(x^2*15731+789221)+1376312589&2147483647)/1073741824)*100000)/100000; +if $8%4==2 +outmode=i(#-1,num+($4/180*3000),0,0,0,0,2) +formulachoice=DoubleToColorRGB(noise_gen) +else +outmode=i(#-1,num%3000,0,0,0,0,2) +if $8%4==3 formulachoice=DoubleToColorTan(noise_gen)%256 +elif $8%4==1 formulachoice=formulachoice=DoubleToColorSin(noise_gen) +else formulachoice=(((ang/pi*256)+noise_gen)/3000*256)%256 +fi +fi +if $10 +tempval={abs($5)+1} +if $8 gridcol=[$11,$11,$11] +else gridcol=$11 +fi +temp_formulachoice=((x%$tempval)&&(y%$tempval))? +temp_formulachoice.=$formulachoice:$gridcol +formulachoice=$temp_formulachoice +fi +f[0--2] " +begin( +const ww=w/2; +const halfh=h/2; +const zoom=1/round(abs(abs($5)+($10?1:0))); +if($9 +,const k_one=$1/2; +,const k_one=$1/10; +); +if($9 +,const k_two=$2/4; +,const k_two=($2*-1)/10; +); +noise2d(nx,ny)=( +a=int(nx);b=int(ny); +num=abs(a+b*$3)%3000; +"$outmode"; +); +const ang=$4/180*pi; +smoothnoise(nx,ny)=( +a=int(nx);b=int(ny); +num=(noise2d(a-1,b-1)*4)/$1; +num2=(noise2d(a-1,b)*4)/k_one; +num3=noise2d(a,b)/k_two; +num4=num+num2+num3; +num4*256; +); +DoubleToColorSin(v)=( +num=ceil((v*1/pi*10^3))/10^3; +num2=int(128+127*sin(num+ang)); +num3=int(128+127*sin(pi/2+num+ang)); +num4=int(128+127*sin(pi+num+ang)); +[num4,num3,num2]; +); +DoubleToColorRGB(t)=( +num=int(t*65536.0); +num2=(num&16711680)>>16; +num3=(num&65280)>>8; +num4=num&255; +[num4,num3,num2]; +); +DoubleToColorTan(w)=( +num=ceil((w*1/pi)*10^3)/10^3; +num2=int(128+127*tan(num+ang)); +num3=int(128+127*tan(num+pi/2+ang)); +num4=int(128+127*tan(num+pi+ang)); +[num4,num3,num2]; +); +); +xx=abs(int(zoom*(x+0.5))); +yy=abs(int(zoom*(y+0.5))); +noise_gen=smoothnoise(xx,yy); +"$formulachoice";" +if $12&&(($6!=-1)||($7!=-1)) +if $10 +f[0--2] "begin( +const sfx=int(($6*.5+.5)*w)+($10?1:0); +const sfy=int(($7*.5+.5)*h)+($10?1:0); +); +psfx=x-sfx; +psfy=y-sfy; +i( +psfx>=0?x-sfx:x-sfx-1, +psfy>=0?y-sfy:y-sfy-1,z,c,0,3 +);" +else +f[0--2] "begin( +const sfx=($6*.5+.5)*w+($10?1:0); +const sfy=($7*.5+.5)*h+($10?1:0); +); +i(x-sfx,y-sfy,z,c,0,3);" +fi +elif $6!=-1||$7!=-1 +f[0--2] "begin( +const gridfix=($10?1:0); +const pxlsize=abs($5)+gridfix; +const errfix=abs($5)==1?!(pxlsize%2):1-gridfix; +const sw=int(w-pxlsize); +const sfx=int(($6*.5+.5)*sw); +const sh=int(h-pxlsize); +const sfy=int(($7*.5+.5)*sh); +const errfix2=abs($5)==1; +); +psfx=x-sfx; +psfy=y-sfy; +i( +psfx>=0?psfx+errfix2:psfx*-1+pxlsize-errfix, +psfy>=0?psfy+errfix2:psfy*-1+pxlsize-errfix, +z,c, +0,2 +);" +fi +rm. +#@cli rep_dla : eq. to 'rep_diffusion_limited_aggregation' +rep_dla: rep_diffusion_limited_aggregation $* +#@cli rep_diffusion_limited_aggregation: _attempts>1,_mode,0<=_spread_factor<=1,_stem_color={ 0=dark | 1=light },_border,_initial_point_mode={ 0=less_dense | 1=more_dense },_preserve_silhouette={ 0=maskless | 1=mask } +#@cli : Generate Diffusion Limited Aggregation +#@cli : (eq. to 'rep_dla'). +#@cli : +#@cli : '_attempts' defines how much attempts on filling the aggregation form before finishing. +#@cli : '_mode' defines how particles aggregate on the aggregation form. +#@cli : '_spread_factor' defines how much times a particle will be created upon appending. The algorithm for this may not be the correct implementation, but it works for what it describes. +#@cli : '_stem_color' defines where the aggregation form will fill on. +#@cli : '_border' is only applicable if there is a planting seed map. It is used to limit particles based on proximity away from existing structure. +#@cli : '_initial_point_mode' defines whether to use less dense or more dense point coordinates map. +#@cli : '_preserve_silhouette' is only applicable on images with variance. +#@cli : +#@cli : Author: Reptorian. +#@cli : Default values: '_attempts=100','_mode=0','_spread_factor=0','_stem_color=0','_border=0','_initial_point_mode=0','_preserve_silhouette=1' +rep_diffusion_limited_aggregation: +skip ${1=100},${2=0},${3=0},${4=0},${5=0},${6=0},${7=1} +maximum_iterations,pixel_detection_mode,spread_factor,stem_color,border_size,initial_coordinates_map_mode,preserve_silhouette_mode={[abs($1),int($2)%4,cut(abs($3),0,1),!$4,round(abs($5)),$6?1,$7?1]} +inv_stem_color,use_altern_text,n_threads={[!$stem_color,$pixel_detection_mode==3]},$_cpus +command "dla_target_1s: +ge {avg(iM,im)} +" +command "dla_target_2s: +normalize 0,1 +split[-1] c * +ge {avg(iM,im)} +" +command "dla_target_3s: +normalize 0,1 +split c +add / 3 +ge {avg(iM,im)} +" +command "dla_target_4s: +normalize 0,1 +ts={s-1} +split c +add[^-1] +/[-1] $ts * +ge {avg(iM,im)} +" +command "dla_target: +if s==1 dla_target_1s +elif s==2 dla_target_2s +elif s==3 dla_target_3s +else dla_target_4s +fi +" +command "dla_check_variance: +tv=0 +repeat s { +shared $> +tv+={iv#-1} +rm. +if $tv +break +fi +} +status {$tv?1:0} +" +command "dla_clear_image: +{w#0},{h#0},1,1,"$stem_color" +rv[-1,0] +rm. +" +if $use_altern_text +altern_text_a=altern=int(u(0,2,1,0)) +altern_text_b=altern=++altern%2 +fi +foreach { +if s>4||d#0>1 continue fi ++dla_create_coordinate_map $initial_coordinates_map_mode +gcd_shuffle. +use_dla_map=${dla_check_variance[0]} +if $use_dla_map +dla_target[0] +if $border_size ++distance.. $inv_stem_color,2 +1,{h#-2},1,1,v=i(#-1,I(#-2));v?(v<=$border_size?y:-1):-1 +discard. -1 +map. ... +1,100%,1,1,i(#2,I(#-1)) +rm[-4,-3] +pixelsort.. +,y,. +rm. +1,100%,1,1,:"begin_t(const n_threads=$n_threads;n=t;);v=n;n+=n_threads;v;" +map. .. +rm.. +if !$preserve_silhouette_mode +if $stem_color +replace[0] 0,.999 +else +*[0] .001 +fi +fi +else +if $stem_color val_check=>.999 +else val_check=<.001 +fi +1,{h},1,1,y +eval.. :if(!(i(#0,I)$val_check),i(#-1,0,y)=-1;);I; +discard. -1 +map. .. +rm.. ++distance[-2] $inv_stem_color,2 +1,{h#-2},1,1,i(#-1,I(#-2)) +rm[-2] +pixelsort[-2] +,y,[-1] +rm[-1] +1,100%,1,1,:"begin_t(const n_threads=$n_threads;n=t;);v=n;n+=n_threads;v;" +map. .. +rm.. +if !$preserve_silhouette_mode +if $stem_color +replace[0] 0,.999 +else +*[0] .001 +fi +fi +fi +else +center_x,center_y={[(w#0-1)>>1,(h#0-1)>>1]} +minimum_circle_radius={norm($center_x,$center_y)} +1,{h},1,2,"begin( +const sqrt_of_two=sqrt(2); +const minimum_circle_radius=$minimum_circle_radius; +const center_x=$center_x; +const center_y=$center_y; +); +distance_from_center=norm(I#-1-[$center_x,$center_y]); +distance_from_center<=minimum_circle_radius?( +relative_position=distance_from_center/minimum_circle_radius; +valid_point=lerp(1,u^.625,relative_position)>=relative_position?y:-1; +):( +valid_point=-1; +); +[distance_from_center,valid_point]; +" +split[-1] c +discard[-1] -1 +[-1] +repeat 2 { map[{$>-2}] [{$>-4}] } +remove[-4,-3] +pixelsort[-2] +,y,[-1] +remove[-1] +1,100%,1,1,:"begin_t(const n_threads=$n_threads;n=t;);v=n;n+=n_threads;v;" +map[-1] [-2] +remove[-2] +dla_clear_image +set[0] $inv_stem_color,50%,50% +fi +a[^0] y +eval[1] :"begin_t( +const width=w#0; +const height=h#0; +const spread_factor=$spread_factor; +const use_spread=spread_factor?1; +const limit_of_attempts=$maximum_iterations; +const pixel_detection_mode=$pixel_detection_mode; +const target_mode=$inv_stem_color; +new_pos_x=[-1, 0, 1, +-1, 1, +-1, 0, 1]; +new_pos_y=[-1,-1,-1, +0, 0, +1, 1, 1]; +if(!target_mode +,det_px(pixel)=pixel<1; +,det_px(pixel)=pixel; +); +pixel_detection_mode==3?( +pixel_detected(xp,yp)= +altern?( +det_px(i(#0,xp-1,yp-1,0,0,0,2))|| +det_px(i(#0,xp-1,yp+1,0,0,0,2))|| +det_px(i(#0,xp+1,yp-1,0,0,0,2))|| +det_px(i(#0,xp+1,yp+1,0,0,0,2)) +):( +det_px(i(#0,xp-1,yp,0,0,0,2))|| +det_px(i(#0,xp+1,yp,0,0,0,2))|| +det_px(i(#0,xp,yp-1,0,0,0,2))|| +det_px(i(#0,xp,yp+1,0,0,0,2)) +); +): +pixel_detection_mode==2?( +pixel_detected(xp,yp)= +det_px(i(#0,xp-1,yp-1,0,0,0,2))|| +det_px(i(#0,xp-1,yp+1,0,0,0,2))|| +det_px(i(#0,xp+1,yp-1,0,0,0,2))|| +det_px(i(#0,xp+1,yp+1,0,0,0,2))|| +det_px(i(#0,xp-1,yp,0,0,0,2))|| +det_px(i(#0,xp+1,yp,0,0,0,2))|| +det_px(i(#0,xp,yp-1,0,0,0,2))|| +det_px(i(#0,xp,yp+1,0,0,0,2)); +): +pixel_detection_mode==1?( +pixel_detected(xp,yp)= +det_px(i(#0,xp-1,yp,0,0,0,2))|| +det_px(i(#0,xp+1,yp,0,0,0,2))|| +det_px(i(#0,xp,yp-1,0,0,0,2))|| +det_px(i(#0,xp,yp+1,0,0,0,2)); +):( +pixel_detected(xp,yp)= +det_px(i(#0,xp-1,yp-1,0,0,0,2))|| +det_px(i(#0,xp-1,yp+1,0,0,0,2))|| +det_px(i(#0,xp+1,yp-1,0,0,0,2))|| +det_px(i(#0,xp+1,yp+1,0,0,0,2)); +); +"$altern_text_a" +); +temp_vec=I; +xp=temp_vec[0]; +yp=temp_vec[1]; +repeat(limit_of_attempts, +pv=int(u(0,8,1,0)); +xp+=new_pos_x[pv]; +yp+=new_pos_y[pv]; +if(pixel_detected(xp,yp), +i(#0,xp%width,yp%height)=target_mode; +if(use_spread, +txp=xp; +typ=yp; +if(u>1} +1,{$row_a*$counts_per_row_a+$row_b*$counts_per_row_b},1,2,:"begin( +const row_length=w#-1; +const half_row_length=row_length>>1; +); +pos_y=int(y/half_row_length); +ny=y<<1; +pos_x=pos_y&1?(ny%row_length):((ny+1)%row_length); +[pos_x,pos_y]; +" +else +1,{(w>>1)*(ceil(h/2))},1,2,:"begin( +const row_length=w#-1; +const half_row_length=row_length>>1; +); +y_pos=int(y/half_row_length)<<1; +[(y<<1)%row_length,y_pos]; +" +fi +#@cli rep_blur_splinter: _length,_duplicates,_angle,_thickness,-1<=_balance<=1,_contrast,_boundary={ 0=None | 1=Neumann | 2=Periodic | 3=Mirror },_bisided={ 0=one-line | two-line } +#@cli : Apply Splinter Blur to Image. Based off observation from using Splinter Blur plugin within Paint.NET made by Ed Harvey, and it is inspired by this filter. Note that convolution result is different. +#@cli : Default values: '_length=10%','_duplicates=5','_angle=0','_thickness=0','_balance=0','_contrastr=0','_boundary=1','_bisided=0' +rep_blur_splinter: +skip ${1=10%},${2=5},${3=0},${4=0},${5=0},${6=0},${7=2},${8=0} +if $2<3 error \$\2>2==F fi +start_ang={$3} +angs_per_dups={360/$2} +command "average_output: ti=$! add / $ti" +if $5==-1 command "output_splinter : min" +elif $5<0&&$5>-1 command "output_splinter : +average_output +min[^-1] f. lerp(i#-2,i,abs($5)) k." +elif $5==0 command "output_splinter : average_output" +elif $5>0&&$5<1 command "output_splinter : +average_output +max[^-1] f. lerp(i#-2,i,$5) k." +elif $5==1 command "output_splinter : max" +else error (-1<=\$\6<=1)=F +fi +foreach { +half_img_diag={norm(w,h)/2} +if ispercentage($1) length={round(abs($1)*$half_img_diag)} +else length={round(abs($1))} +fi +if ispercentage($4) thickness={round(abs($4)*$half_img_diag)} +else thickness={round(abs($4))} +fi +img_dims={w},{h} +repeat $2 { +ang={$start_ang+$angs_per_dups*$>} +rep_splinter_blur_convolve_map[^0--1] $length,$thickness,$ang,$6,$8,$img_dims ++convolve_fft[0] [-1],$7 +rm.. +} +rm[0] +output_splinter +} +uncommand output_splinter +#@cli rep_splinter_blur_convolve_map: _length,_thickness,_angle,_contrast,_bisided={ 0=one-line | two-line } +#@cli : Create a convolve map for directional blur. This enables one to create a convolve map for one-direction motion blur. +#@cli : Default values: '_length=10%','_thickness=5%','_angle=0','_bisided=1' +rep_splinter_blur_convolve_map : skip ${1=10%},${2=5%},${3=0},${4=0},${5=1},${6=w},${7=h} +ang={($3/180)*pi*-1} +cos_ang={cos($ang)}; +sin_ang={sin($ang)}; +diag={norm($6,$7)/2} +if ispercentage($1) length={round($1*$diag)} else length={round($1)} fi +if ispercentage($2) thickness={max(round($2*$diag),1)} else thickness={max(round($2),1)} fi +point_b_x=0 +point_b_y={$length/2} +point_c_x={$thickness/2} +max_dim={max($point_b_y,$point_c_x)} +min_dim={min($point_b_y,$point_c_x)} +point_c_y={sqrt(sqr($max_dim)-sqr($min_dim))} +point_a_x=-$point_c_x +point_a_y=$point_c_y +n_pax={abs($point_a_x*$cos_ang+$point_a_y*$sin_ang)} +n_pay={abs($point_a_x*$sin_ang+$point_a_y*$cos_ang)} +n_pbx={abs($point_b_x*$cos_ang+$point_b_y*$sin_ang)} +n_pby={abs($point_b_x*$sin_ang+$point_b_y*$cos_ang)} +n_pcx={abs($point_c_x*$cos_ang+$point_c_y*$sin_ang)} +n_pcy={abs($point_c_x*$sin_ang+$point_c_y*$cos_ang)} +rect_width={ceil(max($n_pax,$n_pbx,$n_pcx)*2)} +rect_height={ceil(max($n_pay,$n_pby,$n_pcy)*2)} +{max(1,$rect_width)},{max(1,$rect_height)},1,1," +begin( +const strokelength=$length; +const sx=w/strokelength; +const sy=h/strokelength; +const sides=$5; +const thickness=$thickness; +const hw=(w-1)/2; +const hh=(h-1)/2; +const ang=($3/180)*pi*-1; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +cutval(v)=v<0?0:v; +maxcutval(v)=v>1?1:v; +); +xx=(x/w-.5)*sx; +yy=(y/h-.5)*sy; +lx=x-hw; +ly=y-hh; +radial_grad=1-norm(xx,yy)*2; +radial_grad=cutval(radial_grad); +line=1-maxcutval(abs(rot_x(lx,ly))/thickness); +sides?(line?radial_grad*line):(rot_y(lx,ly)<=0?(line?radial_grad*line)); +" +/. {is} +if $4 +avgstat={ia} ++*. 2 -. $avgstat +f.. lerp(i,i#1,min(1,min(abs($4),1))) +rm. +fi +#@cli rep_bgfill: eq. to 'rep_fill_background' +rep_bgfill: rep_fill_background $* +#@cli rep_fill_background: color,alpha,max_alp +#@cli : Fill image with values.\n +#@cli : (eq. to 'rep_bgfill')\n +#@cli : For RGBA images, 3 values are used in place of color. That means 5 values are to be inserted. +#@cli : For GA Image, only 1 value are used in place of color. That means 3 values are to be used. +rep_fill_background: +if $-2>0 +$!,1,1,1,s#x +val_test={iv#-1} +rm. +if !$val_test +foreach { +if s==2||s>3 +sh 0,{s-2} +sh.. {s} +f.. I*(i0#-1/$-1)*($-2/$-1)+I*(1-($-2/255))+[${1--3}]*(1-i0#-1/$-1) +f. $-1*(i/$-1*$-2/$-1)+i*(1-$-2/$-1)+$-2*(1-i/$-1) +rm[-2,-1] +fi +} +else error !var(chans)==F +fi +fi +#@cli rep_pfrac_t_rs : eq. to 'rep_popcorn_fractal_transformative_regular_and_swirling' +rep_pfrac_t_rs: rep_popcorn_fractal_transformative_regular_and_swirling $* +#@cli rep_popcorn_fractal_transformative: _points>0,_density>0,_H,_K,_zoom,_rotation_angle,_origin_x,_origin_y,_trig_mode={ 0=Trig-4 | 1=Trig-6 },set_arg_a,set_arg_b +#@cli : Generates Swirling Hall which is forked from Transformative Pickover Popcorn Fractal. Discovered by T.Gangopadhyay at XLRI in C.H.Area(E),Jamshedpur,India in 2012. +#@cli : +#@cli : Source: International Journal of Computer Applications(0975-8887) Volume 50-No.8, July 2012. +#@cli : +#@cli : _points defines the maximum number of points to be added on image based on pixel location. Negative Mode +#@cli : _density defines the frequency of points to be added along row and height of image. A value of one implies n points to be added per pixel. +#@cli : _H is the function multiplier used to subtract from the new found values from each iteration. +#@cli : _K is the inner multiplier for the inside function. See popcorn_x(a,b), and popcorn_y(a,b) embedded within the code of rep_popcorn_fractal for more information. +#@cli : _zoom defines the magnification of image. A negative value will "shrink" the structure of generated fractal. +#@cli : _rotation_angle defines the function angle of fractal. +#@cli : _origin_x defines the position of fractal. Center of image row will be treated as zero, and the ranges for image row are treated as -1,1. +#@cli : _origin_y defines the position of fractal. Center of image column will be treated as zero, and the ranges for image column are treated as -1,1. +#@cli : _set_arg defines complex trigometric functions to utilize to define the complex popcorn fractal. +#@cli : +#@cli : Note: See below note for more details on _set_arg +#@cli : +#@cli : ---- Set of arguments for each _set_arg ----- +#@cli : +#@cli : There can be up to 6 set of arguments. If any of first two set of arguments are specified, then the default arguments for the first two set of arguments are overrided with the first two set of arguments. If any of the last two arguments are not specified, then it will take the last two set of arguments before it, otherwise, it will override it with the specified arguments. +#@cli : +#@cli : Note: Use the examples provided to make it easier to generate. See examples for clarification on what is meant by set of arguments. +#@cli : +#@cli : if _set_arg_n_1==0: 0,_function +#@cli : +#@cli : Output - func_a(v) +#@cli : _function={0=sin|1=sinh|2=cos|3=cosh|4=tan|5=tanh} +#@cli : +#@cli : elif _set_arg_n_1==1: 1,_function_a,_function_b +#@cli : +#@cli : Output - func_a(v)+func_b(v) +#@cli : _function_a={0=v|1=sin|2=sinh|3=cos|4=cosh|5=tan|6=tanh} +#@cli : _function_b={0=v|1=sin|2=sinh|3=cos|4=cosh|5=tan|6=tanh} +#@cli : +#@cli : elif _set_arg_n_1==2: 2,_function_a,_function_b,_include_v +#@cli : +#@cli : Output - func_a((include_v?v:0)+func_b(v)) +#@cli : _function_a={0=sin|1=sinh|2=cos|3=cosh|4=tan|5=tanh} +#@cli : _function_b={0=sin|1=sinh|2=cos|3=cosh|4=tan|5=tanh} +#@cli : _include_v={0=FALSE|1=TRUE} +#@cli : +#@cli : fi +#@cli : +#@cli : ---- End ---- +#@cli : +#@cli : Author: Reptorian. +#@cli : Default values: '_points=50','density=1','H=.05','_K=3','zoom=.5','_rotation_angle=45','_origin_x=0','_origin_y=0' +#@cli : $ set_arg_a=0,0 set_arg_b=0,4 512,512 rep_popcorn_fractal_transformative_regular_and_swirling 50,2,.05,3,.5,45,0,0,0,$set_arg_a,$set_arg_b cut 0,1000 +#@cli : $ set_arg_a=2,1,4,1 set_arg_b=1,4,2 set_arg_c=0,4 512,512 rep_popcorn_fractal_transformative_regular_and_swirling 50,2,.05,3,.5,45,0,0,1,$set_arg_a,$set_arg_b,$set_arg_c cut 0,1000 +rep_popcorn_fractal_transformative_regular_and_swirling: +skip ${1=50},${2=1},${3=.05},${4=3},${5=.5},${6=45},${7=0},${8=0},${9=0},${10=},${11=},${12=},${13=},${14=},${15=},${16=},${17=},${18=},${19=},${20=},${21=},${22=},${23=},${24=},${25=} +use_default={!(narg($10)&&narg(${11-1}))} +if ($6-360*floor($6/360))?1 +fvx=((rot_x(ix,iy)-osx)*icx_zoom+cxsx)/sx +fvy=((rot_y(ix,iy)-osy)*icy_zoom+cysy)/sy +else +fvx=((ix-osx)*icx_zoom+cxsx)/sx +fvy=((iy-osy)*icy_zoom+cysy)/sy +fi +if !$use_default +$=funarg +fp,argval=10,{$10%3} +if $argval==0 +fp+=2 +fun_a=${rep_pfrac_t_and_swrlhall_str_a\ $11} +elif $argval==1 +fp+=3 +fun_a=${rep_pfrac_t_and_swrlhall_str_b\ $11,$12} +else +fp+=4 +fun_a=${rep_pfrac_t_and_swrlhall_str_c\ ${11-13}} +fi +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_2={$tv%3} +if $mode_2==0 +fun_b=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_2==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_b=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_b=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +elif !$use_default +mode_2={$10%3} +if $mode_2==0 +fun_b=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_2==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_b=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_b=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +echo $fun_b +fi +if $9 +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_3={$tv%3} +if $mode_3==0 +fun_c=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_3==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_c=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_c=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +mode_3={$10%3} +if $mode_3==0 +fun_c=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_3==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_c=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_c=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +fi +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_4={$tv%3} +if $mode_4==0 +fun_d=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_4==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_d=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_d=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +fp+={arg($mode_3+1,2,3,4)} +fun_d=$fun_a +fi +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_5={$tv%3} +if $mode_5==0 +fun_e=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_5==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_e=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_e=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +fp+={arg($mode_4+1,2,3,4)} +fun_e=$fun_b +fi +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_6={$tv%3} +if $mode_5==0 +fun_f=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +elif $mode_6==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_f=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_f=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +fun_f=$fun_c +fi +all_func=fun_a(v)=$fun_a;fun_b(v)=$fun_b;fun_c(v)=$fun_c;fun_d(v)=$fun_d;fun_e(v)=$fun_e;fun_f(v)=$fun_f +else +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_3={$tv%3} +if $mode_3==0 +fun_c=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_3==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_c=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_c=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +fp+={arg($mode_2+1,2,3,4)} +fun_c=$fun_a +fi +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_4={$tv%3} +if $mode_4==0 +fun_d=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +elif $mode_4==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_d=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_d=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +fun_d=$fun_b +fi +all_func=fun_a(v)=$fun_a;fun_b(v)=$fun_b;fun_c(v)=$fun_c;fun_d(v)=$fun_d +fi +else +all_func=fun_a(v)=sin(v);fun_b(v)=tan(v);fun_c(v)=sin(v);fun_d(v)=tan(v) +fi +iw,ih={w-1},{h-1} +channels. 0 f. 0 +if $1>0 +output=ix=nx/zn;iy=ny/zn +else +output=nx/=zn;ny/=zn;r=norm(nx,ny);t=2*atan(ny/nx);ix=r*cos(t);iy=r*sin(t) +fi +{int(w*abs($2))},{int(h*abs($2))},1,1,":begin_t( +const nw=w-1; +const nh=h-1; +const ww=$iw; +const hh=$ih; +const icx=ww/2; +const icy=hh/2; +const sd=max(w,h)/min(w,h); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +const cx=(nw-1)/2; +const cy=(nh-1)/2; +const cxsx=icx*sx; +const cysy=icy*sy; +const pts=abs($1); +const H=$3; +const K=$4; +const zoom=1/$5; +const ang=($6/180)*pi; +const origin_x=$7*-1*zoom; +const origin_y=$8*zoom; +const sx_zoom=sx*zoom; +const sy_zoom=sy*zoom; +const osx=origin_x*sx; +const osy=origin_y*sy; +const icx_zoom=icx/zoom; +const icy_zoom=icy/zoom; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +cnorm(a,b)=sum(sqr(a),sqr(b)); +"$all_func"; +$9?( +out_x(a,b)=(Kb=K*b;a-H*fun_a(b+fun_b(Kb+fun_c(Kb)))); +out_y(a,b)=(Ka=K*a;b-H*fun_d(a+fun_e(Ka+fun_f(Ka)))); +):( +out_x(a,b)=a-H*fun_a(b+fun_b(K*b)); +out_y(a,b)=b-H*fun_c(a+fun_d(K*a)); +); +); +ix=sx_zoom*(x-cx)/cx; +iy=sy_zoom*(y-cy)/cy; +ix+=origin_x; +iy+=origin_y; +repeat(pts, +nx=out_x(ix,iy); +ny=out_y(ix,iy); +zn=cnorm(nx,ny); +"$output"; +xval="$fvx"; +yval="$fvy"; +xpos=round(xval); +ypos=round(yval); +i(#-1,xpos,ypos)++; +);" +rm. +rep_popcorn_fractal_transformative_regular_and_swirling_animated: +fvx=((rot_x(ix,iy)-osx)*icx_zoom+cxsx)/sx +fvy=((rot_y(ix,iy)-osy)*icy_zoom+cysy)/sy +$=funarg +fp=16 +argval={$16%3} +if $argval==0 +fp+=2 +fun_a=${rep_pfrac_t_and_swrlhall_str_a\ $17} +elif $argval==1 +fp+=3 +fun_a=${rep_pfrac_t_and_swrlhall_str_b\ $17,$18} +else +fp+=4 +fun_a=${rep_pfrac_t_and_swrlhall_str_c\ ${17-19}} +fi +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_2={$tv%3} +if $mode_2==0 +fun_b=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_2==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_b=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_b=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +mode_2={$16%3} +if $mode_2==0 +fun_b=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_2==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_b=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_b=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +fi +if $15 +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_3={$tv%3} +if $mode_3==0 +fun_c=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_3==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_c=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_c=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +mode_3={$16%3} +if $mode_3==0 +fun_c=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_3==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_c=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_c=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +fi +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_4={$tv%3} +if $mode_4==0 +fun_d=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_4==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_d=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_d=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +fp+={arg($mode_3+1,2,3,4)} +fun_d=$fun_a +fi +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_5={$tv%3} +if $mode_5==0 +fun_e=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_5==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_e=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_e=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +fp+={arg($mode_4+1,2,3,4)} +fun_e=$fun_b +fi +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_6={$tv%3} +if $mode_5==0 +fun_f=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +elif $mode_6==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_f=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_d=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +fun_f=$fun_c +fi +all_func=fun_a(v)=$fun_a;fun_b(v)=$fun_b;fun_c(v)=$fun_c;fun_d(v)=$fun_d;fun_e(v)=$fun_e;fun_f(v)=$fun_f +else +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_3={$tv%3} +if $mode_3==0 +fun_c=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +fp+=2 +elif $mode_3==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_c=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_c=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +fp+={arg($mode_2+1,2,3,4)} +fun_c=$fun_a +fi +if narg(${funarg{$fp}}) +tv=${funarg{$fp}} +mode_4={$tv%3} +if $mode_4==0 +fun_d=${rep_pfrac_t_and_swrlhall_str_a\ ${funarg{$fp+1}}} +elif $mode_4==1 +args=${funarg{$fp+1}},${funarg{$fp+2}} +fun_d=${rep_pfrac_t_and_swrlhall_str_b\ $args} +fp+=3 +else +args=${funarg{$fp+1}},${funarg{$fp+2}},${funarg{$fp+3}} +fun_d=${rep_pfrac_t_and_swrlhall_str_c\ $args} +fp+=4 +fi +else +fun_d=$fun_b +fi +all_func=fun_a(v)=$fun_a;fun_b(v)=$fun_b;fun_c(v)=$fun_c;fun_d(v)=$fun_d +fi +iw,ih={w-1},{h-1} +channels. 0 f. 0 +if $1>0 +output=ix=nx/zn;iy=ny/zn +else +output=nx/=zn;ny/=zn;r=norm(nx,ny);t=2*atan(ny/nx);ix=r*cos(t);iy=r*sin(t) +fi +{int(w*abs($2))},{int(h*abs($2))},{d},1,":begin_t( +const nw=w-1; +const nh=h-1; +const ww=$iw; +const hh=$ih; +const icx=ww/2; +const icy=hh/2; +const sd=max(w,h)/min(w,h); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +const cx=(nw-1)/2; +const cy=(nh-1)/2; +const cxsx=icx*sx; +const cysy=icy*sy; +const zz=d-1; +const pts=abs($1); +const H_a=$3; +const H_b=$4; +const K_a=$5; +const K_b=$6; +const zoom_a=1/$7; +const zoom_b=1/$8; +const ang_a=($9/180)*pi; +const ang_b=($10/180)*pi; +const origin_x_a=$11*-1*zoom_a; +const origin_y_a=$12*zoom_a; +const origin_x_b=$13*-1*zoom_b; +const origin_y_b=$14*zoom_b; +const sx_zoom_a=sx*zoom_a; +const sy_zoom_a=sy*zoom_a; +const sx_zoom_b=sx*zoom_b; +const sy_zoom_b=sy*zoom_b; +const osx_a=origin_x_a*sx; +const osy_a=origin_y_a*sy; +const osx_b=origin_x_b*sx; +const osy_b=origin_y_b*sy; +const icx_zoom_a=icx/zoom_a; +const icy_zoom_a=icy/zoom_a; +const icx_zoom_b=icx/zoom_b; +const icy_zoom_b=icy/zoom_b; +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +cnorm(a,b)=sum(sqr(a),sqr(b)); +"$all_func"; +$15?( +out_x(a,b)=(Kb=K*b;a-H*fun_a(b+fun_b(Kb+fun_c(Kb)))); +out_y(a,b)=(Ka=K*a;b-H*fun_d(a+fun_e(Ka+fun_f(Ka)))); +):( +out_x(a,b)=a-H*fun_a(b+fun_b(K*b)); +out_y(a,b)=b-H*fun_c(a+fun_d(K*a)); +); +); +pz=z/zz; +H=lerp(H_a,H_b,pz); +K=lerp(K_a,K_b,pz); +zoom=lerp(zoom_a,zoom_b,pz); +origin_x=lerp(origin_x_a,origin_x_b,pz); +origin_y=lerp(origin_y_a,origin_y_b,pz); +sx_zoom=lerp(sx_zoom_a,sx_zoom_b,pz); +sy_zoom=lerp(sy_zoom_a,sy_zoom_b,pz); +osx=lerp(osx_a,osx_b,pz); +osy=lerp(osy_a,osy_b,pz); +icx_zoom=lerp(icx_zoom_a,icx_zoom_b,pz); +icy_zoom=lerp(icy_zoom_a,icy_zoom_b,pz); +ang=lerp(ang_a,ang_b,pz); +cos_ang=cos(ang); +sin_ang=sin(ang); +ix=sx_zoom*(x-cx)/cx; +iy=sy_zoom*(y-cy)/cy; +ix+=origin_x; +iy+=origin_y; +repeat(pts, +nx=out_x(ix,iy); +ny=out_y(ix,iy); +zn=cnorm(nx,ny); +"$output"; +xval="$fvx"; +yval="$fvy"; +xpos=round(xval); +ypos=round(yval); +i(#-1,xpos,ypos,z)++; +);" +rm. +rep_pfrac_t_and_swrlhall_str_a: +skip ${1=0} +mode={str='$1';str[0]==45} +argval={abs($1)%6} +str_out=${arg\ $argval+1,sin(v),sinh(v),cos(v),cosh(v),tan(v),tanh(v)} +if $mode str_out..=- fi +u $str_out +rep_pfrac_t_and_swrlhall_str_b: +skip ${1=1},${2=3} +modes=[{str_a='$1';str_b='$2';[str_a[0]==45,str_b[0]==45]}] +argval={abs($1)%7} +str_out=${arg\ $argval+1,v,sin(v),sinh(v),cos(v),cosh(v),tan(v),tanh(v)} +if ($modes)[0] str_out..=- fi +argval={abs($2)%7} +add_str_out=${arg\ $argval+1,v,sin(v),sinh(v),cos(v),cosh(v),tan(v),tanh(v)} +if ($modes)[1] +add_str_out..=- +else +add_str_out..=+ +fi +str_out.=$add_str_out +u $str_out +rep_pfrac_t_and_swrlhall_str_c: +skip ${1=1},${2=0},${3=1} +modes=[{str_a='$1';str_b='$2';str_c='$3';[str_a[0]==45,str_b[0]==45,str_c[0]==45]}] +argval={abs($1)%6} +str_out=${arg\ $argval+1,sin(,sinh(,cos(,cosh(,tan(,tanh(} +if ($modes)[0] str_out..=- fi +if $3 +add_str_out=v +if ($modes)[2] add_str_out..=- fi +argval={abs($2)%6} +add_str_out_2=${arg\ $argval+1,sin(v)),sinh(v)),cos(v)),cosh(v)),tan(v)),tanh(v))} +if ($modes)[1] add_str_out_2..=- else add_str_out_2..=+ fi +add_str_out.=$add_str_out_2 +else +argval={abs($2)%6} +add_str_out=${arg\ $argval+1,sin(v)),sinh(v)),cos(v)),cosh(v)),tan(v)),tanh(v))} +if ($modes)[1] add_str_out..=- fi +fi +str_out.=$add_str_out +u $str_out +#@cli rep_pfrac : eq. to 'rep_popcorn_fractal' +rep_pfrac: rep_popcorn_fractal $* +#@cli rep_popcorn_fractal: _points>0,_density>0,_H,_K,_zoom,_rotation_angle,_origin_x,_origin_y,_mode,_f1={ 0=sin | 1=cos | 2=tan | 3=atan},... +#@cli : Generates Pickover Popcorn Fractal. Code was adapted from Paul Bourke's c code, and extended for more possibilities. Fractal is attributed to Clifford Pickover.\n +#@cli : _points defines the maximum number of points to be added on image based on pixel location. +#@cli : _density defines the frequency of points to be added along row and height of image. A value of one implies n points to be added per pixel. +#@cli : _H is the function multiplier used to subtract from the new found values from each iteration. +#@cli : _K is the inner multiplier for the inside function. See popcorn_x(a,b), and popcorn_y(a,b) embedded within the code of rep_popcorn_fractal for more information. +#@cli : _zoom defines the magnification of image. A negative value will "shrink" the structure of generated fractal. +#@cli : _rotation_angle defines the function angle of fractal. +#@cli : _origin_x defines the position of fractal. Center of image row will be treated as zero, and the ranges for image row are treated as -1,1. +#@cli : _origin_y defines the position of fractal. Center of image column will be treated as zero, and the ranges for image column are treated as -1,1. +#@cli : _mode defines whether to use 4 trigonometric functions or 6 trigonometric functions. Each halves of functions are used on 2 functions used by different axis. +#@cli : _fn defines individual function used for the popcorn fractal.\n +#@cli : Author: Reptorian. +#@cli : Default values: '_points=50','density=1','H=.05','_K=3','zoom=1','_rotation_angle=0','_origin_x=0','_origin_y=0','_mode=0',...\n +#@cli : \ \ \ \ If _mode=0: ... = '_f1=_f3=0','_f2=_f4=2' +#@cli : \ \ \ \ If _mode=1: ... = '_f1=_f4=0','_f2=_f5=1','_f3=_f6=2'\n +rep_popcorn_fractal: +skip ${1=50},${2=1},${3=.05},${4=3},${5=1},${6=0},${7=0},${8=0},${9=0},${10=},${11=},${12=},${13=},${14=},${15=} +if ($6-360*floor($6/360))?1 +fvx=((rot_x(xnew,ynew)-osx)*icx_zoom+cxsx)/sx +fvy=((rot_y(xnew,ynew)-osy)*icy_zoom+cysy)/sy +else +fvx=((xnew-osx)*icx_zoom+cxsx)/sx +fvy=((ynew-osy)*icy_zoom+cysy)/sy +fi +iw={w-1} +ih={h-1} +channels. 0 f. 0 +{int(w*abs($2))},{int(h*abs($2))},1,1,":begin_t( +const nw=w-1; +const nh=h-1; +const ww=$iw; +const hh=$ih; +const icx=ww/2; +const icy=hh/2; +const pts=$1; +const H=$3; +const K=$4; +const zoom=1/$5; +const ang=($6/180)*pi; +const origin_x=$7*-1*zoom; +const origin_y=$8*zoom; +const sd=max(w,h)/min(w,h); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +const sx_zoom=sx*zoom; +const sy_zoom=sy*zoom; +const cx=(nw-1)/2; +const cy=(nh-1)/2; +const osx=origin_x*sx; +const osy=origin_y*sy; +const icx_zoom=icx/zoom; +const icy_zoom=icy/zoom; +const cxsx=icx*sx; +const cysy=icy*sy; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +$9?( +if(narg($10), +const argpos10=$10%4; +argpos10==0?func_a(a)=sin(a): +argpos10==1?func_a(a)=cos(a): +argpos10==2?func_a(a)=tan(a): +argpos10==3?func_a(a)=atan(a); +,func_a(a)=sin(a); +); +if(narg($11), +const argpos11=$11%4; +argpos11==0?func_b(a)=sin(a): +argpos11==1?func_b(a)=cos(a): +argpos11==2?func_b(a)=tan(a): +argpos11==3?func_b(a)=atan(a); +,func_b(a)=cos(a); +); +if(narg($12), +const argpos12=$12%4; +argpos12==0?func_c(a)=sin(a): +argpos12==1?func_c(a)=cos(a): +argpos12==2?func_c(a)=tan(a): +argpos12==3?func_c(a)=atan(a); +,func_c(a)=tan(a); +); +if(!narg($13), +if(narg($10), +argpos10==0?func_d(a)=sin(a): +argpos10==1?func_d(a)=cos(a): +argpos10==2?func_d(a)=tan(a): +argpos10==3?func_d(a)=atan(a); +,func_d(a)=sin(a); +);, +const argpos13=$13%4; +argpos13==0?func_d(a)=sin(a): +argpos13==1?func_d(a)=cos(a): +argpos13==2?func_d(a)=tan(a): +argpos13==3?func_d(a)=atan(a); +); +if(!narg($14), +if(narg($11), +argpos11==0?func_e(a)=sin(a): +argpos11==1?func_e(a)=cos(a): +argpos11==2?func_e(a)=tan(a): +argpos11==3?func_e(a)=atan(a); +,func_e(a)=cos(a); +);, +const argpos14=$14%4; +argpos14==0?func_e(a)=sin(a): +argpos14==1?func_e(a)=cos(a): +argpos14==2?func_e(a)=tan(a): +argpos14==3?func_e(a)=atan(a); +); +if(!narg($15), +if(narg($12), +argpos12==0?func_f(a)=sin(a): +argpos12==1?func_f(a)=cos(a): +argpos12==2?func_f(a)=tan(a): +argpos12==3?func_f(a)=atan(a); +,func_f(a)=tan(a); +);, +const argpos15=$15%4; +argpos15==0?func_f(a)=sin(a): +argpos15==1?func_f(a)=cos(a): +argpos15==2?func_f(a)=tan(a): +argpos15==3?func_f(a)=atan(a); +); +popcorn_x(a,b)=(Kb=K*b;a-H*func_a(b+func_b(Kb+func_c(Kb)))); +popcorn_y(a,b)=(Ka=K*a;b-H*func_d(a+func_e(Ka+func_f(Ka)))); +):( +if(narg($10), +const argpos10=$10%4; +argpos10==0?func_a(a)=sin(a): +argpos10==1?func_a(a)=cos(a): +argpos10==2?func_a(a)=tan(a): +argpos10==3?func_a(a)=atan(a); +,func_a(a)=sin(a); +); +if(narg($11), +const argpos11=$11%4; +argpos11==0?func_b(a)=sin(a): +argpos11==1?func_b(a)=cos(a): +argpos11==2?func_b(a)=tan(a): +argpos11==3?func_b(a)=atan(a); +,func_b(a)=tan(a); +); +if(!narg($12), +if(narg($10), +argpos10==0?func_c(a)=sin(a): +argpos10==1?func_c(a)=cos(a): +argpos10==2?func_c(a)=tan(a): +argpos10==3?func_c(a)=atan(a); +,func_c(a)=sin(a); +);, +const argpos12=$12%4; +argpos12==0?func_c(a)=sin(a): +argpos12==1?func_c(a)=cos(a): +argpos12==2?func_c(a)=tan(a): +argpos12==3?func_c(a)=atan(a); +); +if(!narg($13), +if(narg($11), +argpos11==0?func_d(a)=sin(a): +argpos11==1?func_d(a)=cos(a): +argpos11==2?func_d(a)=tan(a): +argpos11==3?func_d(a)=atan(a); +,func_d(a)=tan(a); +);, +const argpos13=$13%4; +argpos13==0?func_d(a)=sin(a): +argpos13==1?func_d(a)=cos(a): +argpos13==2?func_d(a)=tan(a): +argpos13==3?func_d(a)=atan(a); +); +popcorn_x(a,b)=a-H*func_a(b+func_b(K*b)); +popcorn_y(a,b)=b-H*func_c(a+func_d(K*a)); +); +); +xx=sx_zoom*(x-cx)/cx; +yy=sy_zoom*(y-cy)/cy; +xx+=origin_x; +yy+=origin_y; +repeat(pts, +xnew=popcorn_x(xx,yy); +ynew=popcorn_y(xx,yy); +xval="$fvx"; +yval="$fvy"; +++i(#-1,xval,yval); +xx=xnew; +yy=ynew; +);" +rm. +#@cli rep_x_graphical_tiling: [Images],_insertion_rate,_back_r,_back_g,_back_b +#@cli : Launch the interactive graphical tiling window.\n +#@cli : Details: The main purpose of this filter is to stimulate graphical tiling glitch observed in older operating system and computers. However, you can also use it to tile images by hand to artistic purpose.\n +#@cli : '[Images]' are images to be assigned to be tiled. +#@cli : '_insertion_rate' defines the rate of insertion per milliseconds. +#@cli : '_back_' defines the background color in the one of the preview mode. +#@cli : Default values: '_insertion_rate=0','_back_r=0','_back_g=0','_back_b=0' +rep_x_graphical_tiling: +skip ${2=0},${3=0},${4=0},${5=0} +is_windows_tileset=${"is_image_arg $1"} +e[] "\n Instruction on how to work with interactive windows.\n +\ ---------------------------------------------------------\n\n +\ - All Modes -\n\n +\ * O: Change Preview Mode\n +\ * SPACE: Switch Mode\n +\ * ESC: End Interactive Window\n\n +\ Important Note: Check the message in the title bar.\n\n +\ - Image Placement Mode -\n\n +\ * D: Display Overlay Image\n +\ * H: Flip Image Horizontally\n +\ * V: Flip Image Vertically\n +\ * Mouse Click: Move/Place Image\n +\ * ARROW UP/DOWN:Change Tiling Image\n +\ * ARROW LEFT/RIGHT:Rotate Image\n +\ - Tiling Mode - \n\n +\ * Mouse Move: Place Tile at Insertion Rate\n +\ * ARROW UP/DOWN: Add/Subtract Insertion Rate by 100 ms\n +\ * ARROW LEFT/RIGHT: Add/Subtract Insertion Rate by 10 ms\n\n +\ Additional Note: Type in 'h rep_x_graphical_tiling' for more information.\n\n +\ ---------------------------------------------------------" +insertion_rate={max(0,$2)} +__r_back={max(0,abs($3))} +__g_back={max(0,abs($4))} +__b_back={max(0,abs($5))} +if $!!=1 error imgs!=1 fi +if !$is_windows_tileset error tile_imgs>0==F fi +pass$1 0 +timg={$!} +ms=${-max_s} +if $ms>=3&&$ms<5 to_rgba +elif $ms==1&&$ms<3 to_graya +else error max_chan<5==F +fi +tnimg={$timg-1} +u {expr('w#(x+1)',$tnimg-1)} vec_w=[${}] +u {expr('h#(x+1)',$tnimg-1)} vec_h=[${}] +r {w#0},{h#0},100%,100%,0 +{w},{h},1,{s},0 +__w={w#0} +__h={h#0} +cx={w#0/2} +cy={h#0/2} +px=$cx +py=$cy +cpx=$cx +cpy=$cy +nx=0 +ny=0 +__display_mode=0 +display_overlay_image=1 +util_insertion=0 +__ci=1 +command "pass2endimage : pass[{$__ci}] 0 shift. $""1,$""2 blend alpha" +paint_mode=0 +insert_duplicate_start=1 +move_window=0 +old_window=0 +start_move=0 +current_image=0 +start=0 +ex=-1 +ey=-1 +do +if {*,SPACE} +if $paint_mode paint_mode=0 +else paint_mode=1 +fi +wait 50 +fi +activate_preview=0 +if {*,O} __display_mode+=1 __display_mode={$__display_mode%3} activate_preview=1 wait 200 fi +if !$start activate_preview=1 fi +x,y,b,ww,wh={*,x,y,b,w,h} +window_title="" +if $paint_mode +window_title.="Painting Mode [ Press SPACE TO Escape Painting Mode]" +window_title.="- Insertion Rate - " +window_title.=$insertion_rate +window_title.=" ms" +if {*,ARROWUP}" || "{*,ARROWRIGHT} +if {*,ARROWUP} insertion_rate+=100 +else insertion_rate+=10 +fi +elif {*,ARROWDOWN}" || "{*,ARROWLEFT} +if {*,ARROWDOWN} insertion_rate-=100 +else insertion_rate-=10 +fi +insertion_rate={max(0,$insertion_rate)} +fi +else +if $display_overlay_image +window_title.="Window Overlay Mode [ON]" +else +window_title.="Window Overlay Mode [OFF]" +fi +if {*,D} display_overlay_image+=1 display_overlay_image={$display_overlay_image%2} fi +if {*,ARROWUP}" || "{*,ARROWDOWN} +if {*,ARROWUP} current_image+=1 +else current_image-=1 +fi +current_image={$current_image%($timg-1)} +__ci={$current_image+1} +wait 50 +activate_preview=1 +elif {*,ARROWLEFT}" || "{*,ARROWRIGHT} +activate_preview=1 +r[$__ci] {($vec_w)[$__ci-1]},{($vec_h)[$__ci-1]},100%,100%,0 +if {*,ARROWRIGHT} +rotate[$__ci] 90 +else +rotate[$__ci] -90 +fi +temp1={($vec_w)[$__ci-1]} +temp2={($vec_h)[$__ci-1]} +vec_w=[{"v=["$vec_w"];v["$__ci"-1]="$temp2";v"}] +vec_h=[{"v=["$vec_h"];v["$__ci"-1]="$temp1";v"}] +r[$__ci] {w#0},{h#0},100%,100%,0 +elif {*,H}" || "{*,V} +r[$__ci] {($vec_w)[$__ci-1]},{($vec_h)[$__ci-1]},100%,100%,0 +if {*,H} mirror[$__ci] x +elif {*,V} mirror[$__ci] y +fi +r[$__ci] {w#0},{h#0},100%,100%,0 +fi +fi +if {*,b} +move_window+=1 move_window={$move_window%2} +wait 50 +if !$start_move ox={$x} oy={$y} start_move=1 tpx=$px tpy=$py fi +fi +if !$paint_mode +if $move_window +if {*,C} tpx=$cx tpy=$cy ox={$x} oy={$y} fi +else +if {*,C} cpx=$cx cpy=$cy px=$cx py=$py fi +fi +fi +if $move_window +cpx={$tpx+$x-$ox} +cpy={$tpy+$y-$oy} +activate_preview=1 +fi +if !$move_window&&$old_window +px=$cpx +py=$cpy +start_move=0 +paint_mode=0 +fi +old_window=$move_window +if $paint_mode +if ($ex!=$x)||($ey!=$y) +spx={$cpx-(($vec_w)[$__ci-1]/2)} +spy={$cpy-(($vec_h)[$__ci-1]/2)} +pass2endimage[-1] $spx,$spy +activate_preview=1 +wait $insertion_rate +fi +if $activate_preview +if $__display_mode==0 ++blend[0,-1] alpha drgba. +elif $__display_mode==1 ++drgba. $__r_back,$__g_back,$__b_back +else ++drgba. +fi +w[-1] {w#0},{h#0},0,$window_title +k[0-$timg] +fi +ex=$x +ey=$y +else +if $activate_preview +spx={$cpx-(($vec_w)[$__ci-1]/2)} +spy={$cpy-(($vec_h)[$__ci-1]/2)} +if $display_overlay_image ++shift[{$__ci}] $spx,$spy +if $__display_mode==0 ++blend[0,-2,-1] alpha drgba. +elif $__display_mode==1 ++blend[-2,-1] alpha drgba. $__r_back,$__g_back,$__b_back +else ++blend[-2,-1] alpha drgba. +fi +else +if $__display_mode==0 ++blend[0,-1] alpha drgba. +elif $__display_mode==1 ++drgba. $__r_back,$__g_back,$__b_back +else ++drgba. +fi +fi +w[-1] {w#0},{h#0},0,$window_title +k[0-$timg] +fi +fi +insert_duplicate_start=1 +start=1 +activate_preview=0 +wait +while {*}" && "!{*,ESC} +uncommand pass2endimage k[-1] +#@cli rep_bitplane_shuffle: direction={ 0=backward | 1=forward },color_channel_only={ 0=all_channels | 1=color_channel_only },index_0...index_inf +#@cli : Shuffle Bit Planes according to the order of index specified by user. +rep_bitplane_shuffle: +skip ${2=0} +number_of_images={$!} +if !$number_of_images error no_imgs fi +num_of_ind,direction,all_channels={$#-2},{$1&1},{!$2} +size_of_map={1<<$num_of_ind} +whole_numbers=[{expr('x',$num_of_ind)}] +order=[${3--1}] +if $#<=3 error insuf_args fi +if sort($order)!=$whole_numbers error inv_ind_args fi +if $order==$whole_numbers return fi +if !$direction order=[${rep_inverse_permutation\ ${3--1}}] fi +eval " +const size_of_map=$size_of_map; +const nimg=$number_of_images; +if(nimg==1, +use_map=whds>size_of_map; +, +use_map=sum=0; +repeat(nimg,img_index, +sum+=whds#img_index; +if(sum>size_of_map, +use_map=1; +break(); +); +); +); +set('use_map',use_map); +" +if $use_map +$size_of_map,1,1,1,sum((x>>$whole_numbers&1)<<$order); +if $all_channels +map[^-1] [-1] +rm. +else +store. bin_map +foreach { +if !(s&1) sh 0,{s-2} fi +$bin_map +map[-2] [-1] +k[0] +} +fi +else +if $all_channels f sum((i>>$whole_numbers&1)<<$order); +else +foreach { +if !(s&1) sh 0,{s-2} fi +f. sum((i>>$whole_numbers&1)<<$order); +k[0] +} +fi +fi +#@cli rep_edgefade: radius>0,_exponential_factor>0 : radius>0,_exponential_factor>0,_nl_amplitude>0,0<_n_smooth<=1,0<_a_smooth<=1 +#@cli : Fade edges on alpha. Only applicable for images with 2 channels or 4+ channels. The last channel is the alpha channel.\n +#@cli : Note: Execute 'gmic h normalize_local' for more information on '_nl_amplitude','_n_smooth', and '_a_smooth'. nl is short for normalize_local.\n +#@cli : Default values: '_exponential_factor=0','_nl_amplitude=0','_n_smooth=4%','_a_smooth=5%' +rep_edgefade: +skip ${2=1},${3=0},${4=4%},${5=2%} +percent_mode=0 if ispercentage($1) percent_mode=1 fi +foreach { +if s==2||s>=4 +sh. {s-1} Mval={iM#-1} +n. 0,1 +rm. ++channels {s-1} +r2dx. 200%,3 +local[-1] { +if $3 ++normalize_local. $3,{$1*200%},$4,$5,1,0,1 +n. 0,1 +fi ++f. i?1 ++distance[{$3?1:0}] 0,2 +if $percent_mode +f. "begin(const valcheck=min(abs($1),1)*iM#-1;);i>=valcheck?1" +else +f. "begin(const valcheck=min(abs($1)*2,iM#-1););i>=valcheck?1" +fi ++f[{$3?1:0}] i#0!=0?(i#-2!=i#-1?1):0 +inpaint_pde.. [-1] +f.. i^$2 +replace_nan.. 0 +f[0] i*i#-2 +k[0] +r2dx 50%,3 +} +sh[0] {s#0-1} +*. .. *. $Mval rm[-2,-1] +fi +} +#@cli rep_kodl: eq. to 'rep_keep_original_dimension_and_or_layer' +rep_kodl: +_gmic_s="$?" v + _rep_keep_original_dimension_and_or_layer $"*" +#@cli rep_keep_original_dimension_and_or_layer: "command",_mode={ 0=old_dim | 1=old_dim_and_layer | 2=new_dim_and_layer},_interpolation, _boundary_conditions, _ax, _ay, _az +#@cli : Apply command to image(s), then have the option to preserve dimensions and/or resized layer. +#@cli : (eq. to 'rep_kodl').\n +#@cli : Default values: _preserve_resized_layer=0,_interpolation=0,_boundary_conditions=3,_ax=0.5,_ay=0.5,_az=0\n +#@cli : Author: Reptorian. +rep_keep_original_dimension_and_or_layer: +_gmic_s="$?" v + _$0 $"*" +_rep_keep_original_dimension_and_or_layer: +skip ${2=0},${3=0},${4=3},${5=.5},${6=.5},${7=0} +if $2==0||$2==1 +image_count={$!*3} +dimensions_info=[{expr('p=int(x/3);arg(x%3+1,w#p,h#p,d#p);',$image_count);}] +fi +command "apply_filter:$1" +if abs($2)>=0&&abs($2)<=2 +foreach { +if abs($2)>=1 ++apply_filter +r[0] {w#-1},{h#-1},{d#-1},100%,${3-7} +fi +if abs($2)==1||!$2 +if !$2 apply_filter fi +r {($dimensions_info)[$<*3+0]},{($dimensions_info)[$<*3+1]},{($dimensions_info)[$<*3+2]},100%,${3-7} +fi +} +fi +uncommand apply_filter +#@cli rep_lpasc_ordith: 'eq to. rep_loupasc_ordered_dither' +rep_lpasc_ordith: rep_loupasc_ordered_dither $* +#@cli rep_loupasc_ordered_dither : _dither_method={ 0=checkerboard | 1=dispersed | 2=arcade | 3=ordered | 4=lines | 5=custom | 6=random }, _palette={ 0=Binary | 1= EGA | 2= Web-safe | 3=12-bit } +#@cli: Color reduction with dithering using algorithm provided by Pascal Ollive. +rep_loupasc_ordered_dither: +f "begin( +color_count=[2,4,6,16]; +custom_matrix=[34,14,3,22,6,27,21,8,26,13,30,1,29,18,33,5,20,12,9,0,19,28,10,32,16,31,7,17,2,25,4,24,15,35,23,11]; +line_matrix=[8,9,6,7,1,0,3,2,4,5,9,8,2,3,0,1,4,5,7,6,1,0,3,2,4,5,8,9,6,7,0,1,4,5,7,6,9,8,2,3,4,5,8,9,6,7,1,0,3,2,7,6,9,8,2,3,0,1,4,5,6,7,1,0,3,2,4,5,8,9,2,3,0,1,4,5,7,6,9,8,3,2,4,5,8,9,6,7,1,0,4,5,7,6,9,8,2,3,0,1]; +mat_rev(n)=( +v = (n & 0x55555555) << 1 | (n >> 1) & 0x55555555; +v = (v & 0x33333333) << 2 | (v >> 2) & 0x33333333; +v = (v & 0x0f0f0f0f) << 4 | (v >> 4) & 0x0f0f0f0f; +v = (v << 24) | ((v & 0xff00) << 8) | ((v >> 8) & 0xff00) | (v >> 24); +v; +); +orddith(ipx,cc,coefcount,ditherpattern)=int((((cc-1)*coefcount+1)*ipx+255*ditherpattern-1)/(255*coefcount)); +randdit(ipx,cc,nx,ny)=( +sd=(mat_rev(ny)>>23)<<22|mat_rev(nx)>>10; +ditp=(48271*sd)%2147483647; +int(((cc - 1) * ipx + (ditp / 8421506)) / 255); +); +$1==0?appdit(ipx,cc,nx,ny)=orddith(ipx,cc,2,xor(nx,ny)&0x1): +$1==1?appdit(ipx,cc,nx,ny)=orddith(ipx,cc,4,((xor(nx,ny)&0x1)<<1)|(ny&0x1)): +$1==2?appdit(ipx,cc,nx,ny)=orddith(ipx,cc,8,2+(ny&0x3)): +$1==3?appdit(ipx,cc,nx,ny)=orddith(ipx,cc,5,line_matrix[20*(ny%5)+2*(nx%5)]>>1): +$1==4?appdit(ipx,cc,nx,ny)=orddith(ipx,cc,10,line_matrix[10*(ny%10)+(nx%10)]): +$1==5?appdit(ipx,cc,nx,ny)=orddith(ipx,cc,36,custom_matrix[6*(ny%6)+(nx%6)]): +appdit(ipx,cc,nx,ny)=randdit(ipx,cc,nx,ny); +cc=color_count[$2]; +cs=255/(cc-1); +); +appdit(i,cc,x,y)*cs; +" +#@cli rep_sptbwgp_recpoltrans: eq. to 'rep_shift_pixel_to_boundary_with_group_pixels_with_rectangular_polar_transformation' +rep_sptbwgp_recpoltrans: rep_shift_pixel_to_boundary_with_group_pixels_with_rectangular_polar_transformation $* +#@cli rep_shift_pixel_to_boundary_with_group_pixels_with_rectangular_polar_transformation: -1<=_fxy_position<=1,0<=_influence_factor<=1, _threshold>=0,-1>=_ptxy_xpos<=1,-1>=_ptxy_ypos<=1,'_channel_mode=' +#@cli : Apply 'rep_shift_pixel_to_boundary_with_group_pixels' effect with 'rep_rectangular_polar_transformation'\n +#@cli : (eq. to 'rep_sptbwgp_recpoltrans').\n +#@cli : '_fx_position' determines the location of pixel relative to ptxy points. +#@cli : '_influence_factor' determines how much influence the effect have on pixels. +#@cli : '_threshold' is used to eliminate alpha below the value. +#@cli : '_ptxy_xpos' assigns the location on point of influence +#@cli : '_ptxy_ypos' assigns the location on point of influence +#@cli : '_channel_mode' is a special variable. See 'gmic h rep_sptbwgp' for more information.\n +#@cli : Default values: '_fxy_position=-1','_influence_factor=1','_threshold=0','_ptxy_xpos=0','_ptxy_ypos=0','_channel_mode=N/A'\n +#@cli : Author: Reptorian. +rep_shift_pixel_to_boundary_with_group_pixels_with_rectangular_polar_transformation: +skip ${1=-1},${2=1},${3=0},${4=0},${5=0},${6=} +point,tcr={[$4,$5,3]} +if narg($6) +if $6>=0 +tcr+=1 +else +any_channels=1 +fi +fi +foreach { +if h>w orientation=1 +else orientation=0 +fi +if s==2||s>$tcr sh. {s-1} mina={im#-1} maxa={iM#-1} rm. fi +rep_recpoltrans $point,-3 +if s==2||s>$tcr sh. {s-1} n. $mina,$maxa rm. fi +rep_sptbwgp {$1*-1},1,$2,$3,$6 +rep_recpoltrans $point,2,$orientation +} +#@cli rep_tiler_n: eq. to 'rep_tiler_nonisometric' +rep_tiler_n: +skip ${4=16},${5=16},${6=},${7=0},${8=},${9=},${10=},${11=0},${12=50} +include_tileset_image=${"is_image_arg $1"} +include_tile_img=${"is_image_arg $6"} +if $include_tile_img&&$include_tileset_image pass$1 0 pass$6 0 rep_tiler_nonisometric[0] [-2],${2-5},[-1],${7--1} rm[-2,-1] +elif $include_tileset_image pass$1 0 rep_tiler_nonisometric[0] [-1],${2--1} rm. +elif $include_tile_img pass$6 0 rep_tiler_nonisometric[0] ${1-5},[-1],${7--1} rm. +else rep_tiler_nonisometric $* +fi +#@cli rep_tiler_nonisometric: { filename | [tileset] },min_tile>=3,increment>=0,_tileset_iw_width>=1,_tileset_ih_width>=1,{ _filename | [placed_tiles] },_preserve_bgout={ 0=eliminate_bg | 1=preserve_bg },_drgba_r>=0,_drgba_g>=0,_drgba_b>=0,_gridcol>=0,_trackpadcol>=0 +#@cli : Launch the interactive non-isometric tiling toolkit. Mandatory variables are the first 3 ones! +#@cli : More info: The interactive non-isometric tiling toolkit is a near final version. Final version will have tiledata import and export. Perhaps with a master developer editor to make overworld art.\n +#@cli : (eq. to 'rep_tiler_n').\n +#@cli : Note: This is meant to enable artists to make artwork based on non-isometric RPG games or even world. It is not meant to be a tool to aid into making RPG games. If you want that, then you need to look into other solutions. Of course, there might be the off-chance that this tool is suitable for you.\n +#@cli : '{ filename | [tileset] }' can be either location of the tileset in text form, or as a image argument. If using image argument, you must do rep_tiler_nonisometric[target] [tile] to make it work. +#@cli : '__min_tile' defines the size of tiles. +#@cli : 'increment' defines the maximum possible selection length by number of tiles added by 1. 0 means maximum possible selection length by tile within axis is exactly 1. +#@cli : '_tileset_iw_width' defines the width of tileset visible within interactive window. +#@cli : '_tileset_ih_width' defines the width of tileset visible within interactive window. +#@cli : '_preserve_bgout' can be used to keep or erase image after painting tiles. +#@cli : '{ filename | [placed_tiles] }' can be either location of the tile in text form, or as a image argument. If using image argument, you must do rep_tiler_nonisometric[target] [tile] to make it work. +#@cli : '_dbrga_r' is the color of transparent background. If a value is assigned to this, then transparent areas are replaced with colored background instead of a checkerboard. +#@cli : '_dbrga_g' is the color of transparent background. If a value is assigned to this, then transparent areas are replaced with colored background instead of a checkerboard. +#@cli : '_dbrga_b' is the color of transparent background. If a value is assigned to this, then transparent areas are replaced with colored background instead of a checkerboard. +#@cli : '_gridcol' defines the color of grid within interactive window. Only grayscale value. +#@cli : '_trackpadcol' defines the color of tracker pad within interactive window. Only grayscale value.\n +#@cli : Default values: '_tileset_iw_width=16','_tileset_ih_width=16','_filename=""','_preserve_bgout=0','_drgba_r=','_drgba_g=','_drgba_b=','_gridcol=0','_trackpadcol=0'\n +#@cli : Author: Reptorian +rep_tiler_nonisometric: +skip ${4=16},${5=16},${6=},${7=0},${8=},${9=},${10=},${11=0},${12=50} +include_tileset_image=${"is_image_arg $1"} +include_tile_img=${"is_image_arg $6"} +__min_tile={abs($2)} +if $__min_tile<3 error "$"2>=3==F"" fi +max_increment={abs($3)} +tile_width=$__min_tile +tile_height=$__min_tile +gridcol={abs($11)} +trackpadcol={abs($12)} +__trackpadcol_alt=$trackpadcol +if narg($8)||narg($9)||narg($10) +if narg($8) __r_col={min(abs($8),255)} else __r_col=0 fi +if narg($9) __g_col={min(abs($9),255)} else __g_col=0 fi +if narg($10) __b_col={min(abs($10),255)} else __b_col=0 fi +command "xalp : drgba $__r_col,$__g_col,$__b_col" +else +command "xalp : drgba" +fi +command "xalpa: xalp to_a" +command "out2display : skip ${""1=},${""2=},${""3=},${""4=1},${""5=1},${""6=},${""7=},${""8=},${""9=},${""10=} if narg($""1) if $""1 $__bg rv blend alpha fi fi xalp if narg($""6) if narg($""2)&&narg($""3)&&narg($""4)&&narg($""5) {$""4},{$""5},1,{s#0},i(#-1,$""2+x,$""3+y) f. begin(ww=w-1;hh=h-1;);(x<(2+narg($""7))||x>ww-2)||(y<(2+narg($""7))||y>hh-2)?(xor($""6,i)>128?0:255):i j[0] [-1],$""2,$""3 rm. if narg($""8)&&narg($""9)&&narg($""10) if $""8==0||$""8>2 {$""4},{$""5},1,{s#0},i(#0,$__nw+($__min_tile*$""9)-$""2+x-$""4,$""3+y) f. begin(ww=w-1;hh=h-1;);(x<(2+narg($""7))||x>ww-2)||(y<(2+narg($""7))||y>hh-2)?(xor($""6,i)>128?0:255):i j[0] [-1],{$__nw+($__min_tile*$""9)-$""2-$""4},$""3 rm. fi if $""8==1||$""8>2 {$""4},{$""5},1,{s#0},i(#0,$""2+x,$__nh+($__min_tile*$""10)-$""3+y-$""5) f. begin(ww=w-1;hh=h-1;);(x<(2+narg($""7))||x>ww-2)||(y<(2+narg($""7))||y>hh-2)?(xor($""6,i)>128?0:255):i j[0] [-1],$""2,{$__nh+($__min_tile*$""10)-$""3-$""5} rm. fi if $""8==2||$""8>2 {$""4},{$""5},1,{s#0},i(#0,$__nw+($__min_tile*$""9)-$""2+x-$""4,$__nh+($__min_tile*$""10)-$""3+y-$""5) f. begin(ww=w-1;hh=h-1;);(x<(2+narg($""7))||x>ww-2)||(y<(2+narg($""7))||y>hh-2)?(xor($""6,i)>128?0:255):i j[0] [-1],{$__nw+($__min_tile*$""9)-$""2-$""4},{$__nh+($__min_tile*$""10)-$""3-$""5} rm. fi fi fi fi if narg($""7) f[0] begin(ww=w-1;hh=h-1;);(x%$__min_tile==0||y%$__min_tile==0)||(x==ww||y==hh)?$""7:i fi" +command "pass2tile : skip ${""4=2} pass$""1 $""4 f[0] i(#-1,$""2+x,$""3+y) rm." +command "tile2canvas : skip ${""4=0} pass$""1 0 +f. i(#0,$""2+x,$""3+y) if !$""4 rv[-2,-1] fi blend[-2,-1] alpha j[0] [-1],$""2,$""3 rm." +command "tile2canvas_r : +f. 0 j[0] [-1],$""1,$""2 rm. tile2canvas[0] [-1],$""1,$""2,$""3" +if $!==1 +ttw={ceil(w#0/$__min_tile)} +tth={ceil(h#0/$__min_tile)} +isw={$ttw} +ish={$tth} +$ttw,1,1,1 iscl={$ttw-1} store. __isc +$tth,1,1,1 isrl={$tth-1} store. __isr +__nw={$ttw*$__min_tile} +__nh={$tth*$__min_tile} +ttw-=2 +tth-=2 +to_a r $__nw,$__nh,100%,100%,0,0,.5,.5 ++store[0] obg +xalpa +cs={s#-1} ++store[0] __bg +if narg($6) +if $include_tile_img pass$6 0 +else i $6 +fi +if ((w#-1!=w#-2)||(h#-1!=h#-2)) error "Invalid Tile Image!" fi +rm[0] +to_a. +start=1 +else +f 0 +start=0 +fi ++store[0] current_image ++store[0] undo_image +else +error "$!==1=F" +fi +command "tile2canvas_sym : pass$""1 0 +f. i(#0,$""2+x,$""3+y) if $""8==0||$""8==3 [1] if $""7 mirror. x fi +f. i(#0,$__nw+($__min_tile*$""9)-$""4-$""2+x,$""3+y) fi if $""8==1||$""8==3 [1] if $""7 mirror. y fi +f. i(#0,$""2+x,$__nh+($__min_tile*$""10)-$""5-$""3+y) fi if $""8==2||$""8==3 [1] if $""7 rotate. 180 fi +f. i(#0,$__nw+($__min_tile*$""9)-$""4-$""2+x,$__nh+($__min_tile*$""10)-$""5-$""3+y) fi if $""8==3 if !$""6 rv[-8,-7] rv[-6,-5] fi blend[-8,-7] alpha blend[-6,-5] alpha fi if !$""6 rv[-4,-3] rv[-2,-1] fi blend[-4,-3] alpha blend[-2,-1] alpha if $""8==3 j[0] [-4],$""2,$""3 j[0] [-3],{$__nw+($__min_tile*$""9)-$""4-$""2},$""3 j[0] [-2],$""2,{$__nh+($__min_tile*$""10)-$""5-$""3} j[0] [-1],{$__nw+($__min_tile*$""9)-$""4-$""2},{$__nh+($__min_tile*$""10)-$""5-$""3} k[0] else j[0] [-2],$""2,$""3 if $""8==0 j[0] [-1],{$__nw+($__min_tile*$""9)-$""4-$""2},$""3 elif $""8==1 j[0] [-1],$""2,{$__nh+($__min_tile*$""10)-$""5-$""3} elif $""8==2 j[0] [-1],{$__nw+($__min_tile*$""9)-$""4-$""2},{$__nh+($__min_tile*$""10)-$""5-$""3} fi rm[-2,-1] fi" +command "tile2canvas_r_sym : +f. 0 j[0] [-1],$""1,$""2 if $""6==3||$""6==0 j[0] [-1],{$__nw+($__min_tile*$""7)-$""3-$""1},$""2 fi if $""6==3||$""6==1 j[0] [-1],$""1,{$__nh+($__min_tile*$""8)-$""4-$""2} fi if $""6==3||$""6==2 j[0] [-1],{$__nw+($__min_tile*$""7)-$""3-$""1},{$__nh+($__min_tile*$""8)-$""4-$""2} fi rm. if $""5&&($""6==3||$""6==0) +mirror[1] x fi if $""5&&($""6==3||$""6==1) +mirror[1] y fi if $""5&&($""6==3||$""6==2) +rotate[1] 180 fi if $""6==3 tile2canvas[0] [{$""5?-4:1}],$""1,$""2 tile2canvas[0] [{$""5?-3:1}],{$__nw+($__min_tile*$""7)-$""3-$""1},$""2 tile2canvas[0] [{$""5?-2:1}],$""1,{$__nh+($__min_tile*$""8)-$""4-$""2} tile2canvas[0] [{$""5?-1:1}],{$__nw+($__min_tile*$""7)-$""3-$""1},{$__nh+($__min_tile*$""8)-$""4-$""2} k[0,1] else tile2canvas[0] [1],$""1,$""2 if $""6==0 tile2canvas[0] [{$""5?2:1}],{$__nw+($__min_tile*$""7)-$""3-$""1},$""2 elif $""6==1 tile2canvas[0] [{$""5?2:1}],$""1,{$__nh+($__min_tile*$""8)-$""4-$""2} elif $""6==2 tile2canvas[0] [{$""5?2:1}],{$__nw+($__min_tile*$""7)-$""3-$""1},{$__nh+($__min_tile*$""8)-$""4-$""2} fi k[0,1] fi" +command "addsym2display : tlx={w#0/2+($""2/2)*$""3-2} tly={h#0/2+($""2/2)*$""4-2} if $""1<2 if $""1==0 4,{h#0},1,{s#0},begin(ww=w-1;dp=$""1<2?0:1;lp=dp+1;);x==0||x==ww?dp:lp elif $""1==1 {w#0},4,1,{s#0},begin(hh=h-1;dp=$""1<2?0:1;lp=dp+1;);y==0||y==hh?dp:lp fi *. 255 if $""1==0 j[0] [-1],$tlx,0 else j[0] [-1],0,$tly fi k[0] else ntlx={$tlx+3} ntly={$tly+3} f[0] ((x>=$tlx&&x<=$ntlx)||(y>=$tly&&y<=$tly+3))?((x==$tlx||x==$ntlx)||(y==$tly||y==$ntly)?0:255):i fi" +command "filter_to_selected_row_column: if $__altmode_orientation $__isr f[0] i(#-1,floor((y+$__pmin*$__min_tile)/$__min_tile),0,0,0)?i:0 else $__isc f[0] i(#-1,floor((x+$__pmin*$__min_tile)/$__min_tile),0,0,0)?i:0 fi k[0]" +command "out2display_alt : skip ${""1=},${""2=},${""3=},${""4=},${""5=} if $__altmode_orientation?$__vmax_y:$__vmax_x sh {s-1} if $__altmode_orientation $__isr f.. i(#-1,floor(y/$__min_tile),0,0,0)?i:i*.625 else $__isc f.. i(#-1,floor(x/$__min_tile),0,0,0)?i:i*.625 fi rm[-2,-1] fi if narg($""1) if $""1 $__bg rv blend alpha fi fi xalp if narg($""2) if $__altmode_orientation $__isr {w#0},{h#0},1,1,i(#-1,floor(y/$__min_tile),0,0,0)?1:0 else $__isc {w#0},{h#0},1,1,i(#-1,floor(x/$__min_tile),0,0,0)?1:0 fi f. ($__altmode_orientation?i(#-2,floor(y/$__min_tile),0,0,0):i(#-2,floor(x/$__min_tile),0,0,0))?!(i&&(j(-2,-2,0,0)&&j(-2,-1,0,0)&&j(-2,0,0,0)&&j(-2,1,0,0)&&j(-2,2,0,0)&&j(-1,-2,0,0)&&j(-1,-1,0,0)&&j(-1,0,0,0)&&j(-1,1,0,0)&&j(-1,2,0,0)&&j(1,-2,0,0)&&j(1,-1,0,0)&&j(1,0,0,0)&&j(1,1,0,0)&&j(1,2,0,0)&&j(2,-2,0,0)&&j(2,-1,0,0)&&j(2,0,0,0)&&j(2,1,0,0)&&j(2,2,0,0)&&j(0,-2,0,0)&&j(0,-1,0,0)&&j(0,1,0,0)&&j(0,2,0,0))) if narg($""3) f. !($__altmode_orientation?i(#-2,floor(x/$__min_tile),0,0,0):i(#-2,floor(y/$__min_tile),0,0,0))?(i?(j(-1,0)||j(0,-1))):i fi rm.. f[0] i(#-1,x,y,z,0)?(xor(i(#-1,x,y,z,0)*$__trackpadcol_alt,i)>128?0:255):i rm. fi if narg($""4)||narg($""5) if $__altsymmetry_mode if $__altmode_orientation {w#0},{$__min_tile},1,{s#0},i(#0,x,$""5+y) {w#0},{$__min_tile},1,{s#0},i(#0,x,$__nh+($__altsymmetry_posy-1)*$__min_tile-$""5+y) f[-2,-1] begin(ww=w-1;hh=h-1;);(x<(2+narg($""3))||x>ww-2)||(y<(2+narg($""3))||y>hh-2)?(xor($__trackpadcol_alt,i)>128?0:255):i j... [-2],0,$""5 j... [-1],0,{h#0+($__altsymmetry_posy-1)*$__min_tile-$""5} else {$__min_tile},{h#0},1,{s#0},i(#0,$""4+x,y) {$__min_tile},{h#0},1,{s#0},i(#0,$__nw+($__altsymmetry_posx-1)*$__min_tile-$""4+x,y) f[-2,-1] begin(ww=w-1;hh=h-1;);(x<(2+narg($""3))||x>ww-2)||(y<(2+narg($""3))||y>hh-2)?(xor($__trackpadcol_alt,i)>128?0:255):i j... [-2],$""4,0 j... [-1],{w#0+($__altsymmetry_posx-1)*$__min_tile-$""4},0 fi rm[-2,-1] else if $__altmode_orientation {w#0},{$__min_tile},1,{s#0},i(#0,x,$""5+y) f. begin(ww=w-1;hh=h-1;);(x<(2+narg($""3))||x>ww-2)||(y<(2+narg($""3))||y>hh-2)?(xor($__trackpadcol_alt,i)>128?0:255):i j.. [-1],0,$""5 else {$__min_tile},{h#0},1,{s#0},i(#0,$""4+x,y) f. begin(ww=w-1;hh=h-1;);(x<(2+narg($""3))||x>ww-2)||(y<(2+narg($""3))||y>hh-2)?(xor($__trackpadcol_alt,i)>128?0:255):i j.. [-1],$""4,0 fi rm. fi fi if narg($""3) f. begin(ww=w-1;hh=h-1;);(x%$__min_tile==0||y%$__min_tile==0)||(x==ww||y==hh)?$""3:i fi" +command "out2display_alt_perp : skip ${""3=},${""4=} if narg($""3) if $""3 $__bg rv blend alpha fi fi xalp if $__altmode_orientation $__isr {w#0},{$__pdiff*$__min_tile},1,{s#0},i(#-1,floor(y/$__min_tile)+$__pmin,0,0,0) f. i?(!(j(-2,-2)&&j(-2,-1)&&j(-2,0)&&j(-2,1)&&j(-2,2)&&j(-1,-2)&&j(-1,-1)&&j(-1,0)&&j(-1,1)&&j(-1,2)&&j(0,-2)&&j(0,-1)&&j(0,1)&&j(0,2)&&j(1,-2)&&j(1,-1)&&j(1,0)&&j(1,1)&&j(1,2)&&j(2,-2)&&j(2,-1)&&j(2,0)&&j(2,1)&&j(2,2))?(xor($__trackpadcol_alt,i(#0,x,$""2+y))>128?0:255):i(#0,x,$""2+y)):i(#0,x,$""2+y); j[0] [-1],0,$""2 else $__isc {$__pdiff*$__min_tile},{h#0},1,{s#0},i(#-1,floor(x/$__min_tile)+$__pmin,0,0,0) f. i?(!(j(-2,-2)&&j(-2,-1)&&j(-2,0)&&j(-2,1)&&j(-2,2)&&j(-1,-2)&&j(-1,-1)&&j(-1,0)&&j(-1,1)&&j(-1,2)&&j(0,-2)&&j(0,-1)&&j(0,1)&&j(0,2)&&j(1,-2)&&j(1,-1)&&j(1,0)&&j(1,1)&&j(1,2)&&j(2,-2)&&j(2,-1)&&j(2,0)&&j(2,1)&&j(2,2))?(xor($__trackpadcol_alt,i(#0,$""1+x,y))>128?0:255):i(#0,$""1+x,y)):i(#0,$""1+x,y); j[0] [-1],$""1,0 fi rm[-2,-1] if narg($""4) f. begin(ww=w-1;hh=h-1;);(x%$__min_tile==0||y%$__min_tile==0)||(x==ww||y==hh)?$""4:i fi" +command "keeperase_rowcolumn : if $__altmode_orientation $__isr if $""1 f.. i(#-1,floor(y/$__min_tile),0,0,0)?i:0 else f.. i(#-1,floor(y/$__min_tile),0,0,0)?0:i fi else $__isc if $""1 f.. i(#-1,floor(x/$__min_tile),0,0,0)?i:0 else f.. i(#-1,floor(x/$__min_tile),0,0,0)?0:i fi fi rm." +command "shift_rowcolumn : if $__altmode_orientation $__isr if !($__shiftboundary>0&&$__shiftboundary<4) f[0] i(#-1,floor(y/$__min_tile),0,0,0)?j(-$""1,0,0,0,0,$__shiftboundary-($__shiftboundary?2)):i; else f[0] begin(ww=w-1;);i(#-1,floor(y/$__min_tile),0,0,0)?i(x-$""1>ww?((w-$__min_tile)+($__shiftboundary==3?(floor((x-$""1-w)/$__min_tile)%2?(x-w)%$__min_tile:$__min_tile-(x-w)%$__min_tile-1):(($__shiftboundary-1)?($__min_tile-(x-w)%$__min_tile-1):(x-w)%$__min_tile))):(x-$""1>=0?x-$""1:($__shiftboundary==3?(floor((x-$""1)/$__min_tile)%2?($__min_tile-x%$__min_tile):x%$__min_tile):(($__shiftboundary-1)?($__min_tile-x%$__min_tile):x%$__min_tile))),y):i; fi else $__isc if !($__shiftboundary>0&&$__shiftboundary<4) f[0] i(#-1,floor(x/$__min_tile),0,0,0)?j(0,-$""2,0,0,0,$__shiftboundary-($__shiftboundary?2)):i; else f[0] begin(hh=h-1;);i(#-1,floor(x/$__min_tile),0,0,0)?i(x,y-$""2>hh?((h-$__min_tile)+($__shiftboundary==3?(floor((y-$""2-h)/$__min_tile)%2?(y-h)%$__min_tile:$__min_tile-(y-h)%$__min_tile-1):(($__shiftboundary-1)?($__min_tile-(y-h)%$__min_tile-1):(y-h)%$__min_tile))):(y-$""2>=0?y-$""2:($__shiftboundary==3?(floor((y-$""2)/$__min_tile)%2?($__min_tile-y%$__min_tile):y%$__min_tile):(($__shiftboundary-1)?($__min_tile-y%$__min_tile):y%$__min_tile)))):i; fi fi rm." +command "place_rowcolumn : if $__altmode_orientation if $__altplace_replacemode $__isr pass$""1 0 {w#-1},{h#-1},1,1,i(#-2,floor(y/$__min_tile)+$__pmin,0,0,0) j[0] [-2],0,$""3,0,0,1,[-1],1 else pass$""1 0 {w#0},{h#0},1,{s#0},j(#-1,0,-$""3) rm.. if $__altplacebackmode rv fi blend alpha fi else if $__altplace_replacemode $__isc pass$""1 0 {w#-1},{h#-1},1,1,i(#-2,floor(x/$__min_tile)+$__pmin,0,0,0) j[0] [-2],$""2,0,0,0,1,[-1],1 else pass$""1 0 {w#0},{h#0},1,{s#0},j(#-1,-$""2,0) rm.. if $__altplacebackmode rv fi blend alpha fi fi k[0]" +command "fill_tiles2canvas : if $__fill_boundary==0 f[0] i(#-1,x%w#-1,y%h#-1) elif $__fill_boundary==1 f[0] i(#-1,int(x/w#-1)%2?w#-1-1-x%w#-1:x%w#-1,int(y/h#-1)%2?h#-1-1-y%h#-1:y%h#-1) elif $__fill_boundary==2 f[0] i(#-1,int(x/w#-1)%2?w#-1-1-x%w#-1:x%w#-1,y%h#-1) elif $__fill_boundary==3 f[0] i(#-1,x%w#-1,int(y/h#-1)%2?h#-1-1-y%h#-1:y%h#-1) fi" +v + +e[] "\n Instruction on how to work with interactive windows.\n +\ ---------------------------------------------------------\n\n +\ Press Escape on Canvas Window to exit!\n\n +\ *** MAIN EDITING MODE ***\n\n +\ - On any window - \n +\ * D: Switch between Place/Eraser Mode\n +\ * R: Activate Replace Mode\n +\ * W: Restore All Windows\n +\ * SPACEBAR: Switch Mode\n\n +\ - On Canvas window - \n +\ * C: Activate Copy Mode On/Off\n +\ * X: Activate Cut Mode On/Off\n +\ * Z: Undo Canvas Changes\n +\ * F: Activate/Deactivate Background Tile Layering Mode\n +\ * G: Activate Canvas Grid Mode On/Off\n +\ * Q: Remove/Restore Background\n +\ * A: Enable/Disable Tracker\n +\ * S: Activate Symmetry Mode\n\n +\ -- On Canvas [Symmetry Mode] --\n +\ * 1: Switch Symmetry Axis to X-Axis\n +\ * 2: Switch Symmetry Axis to Y-Axis\n +\ * 3: Switch Symmetry Axis to Cross XY-Axis\n +\ * 4: Switch Symmetry Axis to Mirror XY-Axis\n +\ * ARROWKEY: Move Symmetry Line\n +\ * B: Switch Axis in Symmetry Mode\n +\ * M: Switch between Periodic/Mirror boundary mode in Symmetry Mode\n +\ * J: Symmetry Line(s) to Center\n +\ * S: Deactivate Symmetry Mode\n\n +\ - On Tileset window - \n +\ * G: Activate Tileset Grid Mode On/Off\n +\ * CTRL+ARROWKEY: Resize Tile Selection Box\n +\ * ARROWKEY: Scroll through tileset\n\n +\ - On Tile window - \n +\ * CTRL+ARROWKEY: Mirror alongside axis\n +\ * ARROWKEY: Rotate Tile\n +\ * MOUSE BUTTON: Switch between Place/Eraser Mode\n\n +\ -- On Tile [No Symmetry Mode] --\n +\ * 1: Switch Fill Boundary to Periodic\n +\ * 2: Switch Fill Boundary to Mirror\n +\ * 3: Switch Fill Boundary to Mirror X\n +\ * 4: Switch Fill Boundary to Mirror Y\n +\ * B: Increment Fill Boundary Mode\n\n +\ *** ROW/COLUMN EDITING MODE ***\n\n +\ - On any window - \n +\ * W: Restore All Windows\n +\ * SPACEBAR: Switch Mode\n\n +\ - On Canvas window - \n +\ * Z: Undo Canvas Changes\n +\ * T: Enable Row/Column Shifting Mode\n +\ * E: Activate Place Mode\n +\ * G: Activate Canvas Grid Mode On/Off\n +\ * Q: Remove/Restore Background\n +\ * A: Enable/Disable Tracker\n +\ * S: Activate Symmetrical Selection Mode\n\n +\ -- On Canvas [Selection Mode] --\n +\ * C: Keep Selected Row/Column\n +\ * X: Delete Selected Row/Column\n +\ * D: Select/Deselect Row/Column\n +\ * R: Clear Selection\n +\ * V: View Selection Box/Hide Selection Box\n +\ * Mouse Button: Select or Deselect\n +\ * ARROWKEY: Switch between Row/Column Selection Mode\n\n +\ -- On Canvas [Selection Mode](Symmetry Mode)--\n +\ * J: Symmetry Line to Center\n +\ * ARROWKEY: Move Symmetry Line\n +\ * S: Deactivate Symmetrical Selection Mode\n\n +\ -- On Canvas [Row/Column Shifting Mode] --\n +\ * Mouse Button (First Click): Activate Shifting\n +\ * Mouse Button (Second Click): Finalize Shifting\n +\ * 0: Shift Boundary Mode - None\n +\ * 1: Shift Boundary Mode - Neumann (Periodic)\n +\ * 2: Shift Boundary Mode - Neumann (Mirror)\n +\ * 3: Shift Boundary Mode - Neumann (Alternating)\n +\ * 4: Shift Boundary Mode - Periodic\n +\ * 5: Shift Boundary Mode - Mirror\n +\ * ARROWKEY: Switch between row/column\n +\ * T: Disable Row/Column Shifting Mode\n\n +\ -- On Canvas [Place Mode] --\n +\ * Mouse Button: Place Row/Column\n +\ * B: Switch between Replacement/Placement Mode\n +\ * F: In Placement Mode, switch between background/foreground placement mode\n +\ * E: Deactivate Place Mode\n\n +\ -- On Tile window - \n +\ * ARROWKEY: Flip Row/Column\n +\ ---------------------------------------------------------\n" +v - +if $include_tileset_image +pass$1 0 +else +i $1 +fi +local[-1] { +xr={ceil(w#-1/(abs($4)*$__min_tile))} +yr={ceil(h#-1/(abs($5)*$__min_tile))} +split_tiles. {-abs($4)*$__min_tile},{-abs($5)*$__min_tile} +mw=${-max_w} +mh=${-max_h} +tsw={$mw-$__min_tile} +tsh={$mh-$__min_tile} +ti={$!} +} +$__min_tile,$__min_tile,1,4,0 +fti={$!} +$__bg ++xalp. +dw0c={w#0} +dh0c={h#0} +dwm0=0 +dwm1=0 +dwm2=0 +d2rw=196 +w[-1] {w#0},{h#0},0,"Canvas" +rm[-2,-1] ++xalp[1] +w1[-1] {w#1},{h#1},0,"Tileset" rm. +w2[-1] $d2rw,$d2rw,0,"Tile" ++store. switchmode_tile +fti={$!} +mode=0 +icx=0 +icy=0 +ci=0 +lr=0 +tb=0 +tbc=0 +ni=1 +cutcopymode=0 +erasemode=0 +replacemode=0 +editmode=0 +symmetrymode=0 +symmetryaxis=0 +symmetrybound=0 +symmetry_posx=0 +symmetry_posy=0 +canvas_background=1 +canvas_gridmode=0 +canvas_tracker=1 +tileset_gridmode=0 +temp_tileset_gridmode=0 +select_from_tileset=0 +resize_tile_from_tileset=0 +resize_tile_from_canvas=0 +transform_tile=0 +switch_tile_set=0 +tile_placement_mode=0 +current_csx=-1 +current_csy=-1 +optinsert=1 +__fill_boundary=0 +__corner_fill=0 +activated_switched_twice=0 +modeswitched=0 +mainaltmode=1 +viewselectionbox=1 +selectionboxmode=0 +deselectmode=0 +activate_deselect_select=0 +movemode=0 +delmode=0 +transfermode=0 +rowcolumnshiftmode=0 +shiftplacecount=0 +__shiftboundary=1 +altrcx1=-1 +altrcy1=-1 +altrcx2=-1 +altrcx2=-1 +current_acsx=-1 +current_acsy=-1 +altx=-1 +alty=-1 +tempaltx=-1 +tempalty=-1 +activate_altpreview=0 +activate_altpass2tile=0 +__altsymmetry_mode=0 +__altsymmetry_posx=0 +__altsymmetry_posy=0 +__altmode_orientation=0 +__vmax_x=0 +__vmax_y=0 +pmax=0 +__pmin=0 +__pdiff=0 +place_rowcolumn_mode=0 +__altplacebackmode=0 +__altplace_replacemode=1 +do +main_w_title="Canvas" +if $start +if $mode main_w_title.=" [Row/Column Editing Mode]" +else main_w_title.=" [Main Editing Mode] -" fi +fi +modeswitched=0 +if {*,SPACE}" || "{*1,SPACE}" || "{*2,SPACE}" && "$start mode+=1 mode={$mode%2} modeswitched=1 wait 100 fi +if $modeswitched ++store. temp_switch_tile +$switchmode_tile +rv[-2,-1] +rm. +$temp_switch_tile +store. switchmode_tile +if $mode ++out2display. , w2[-1] {w#-1},{h#-1},-1,-1,"Tile" rm. +w1[] 0 +else ++out2display. , w2[-1] {$d2rw+($d2rw*$icx)},{$d2rw+($d2rw*$icy)} rm. ++out2display[$ni] , w1[-1] {w#$ni+$dwm1*w#$ni},{h#$ni+$dwm1*h#$ni} rm. +fi +fi +if $start&&$mode +if {*,G} canvas_gridmode+=1 canvas_gridmode={$canvas_gridmode%2} wait 100 activate_altpreview=1 fi +if {*,Q} canvas_background+=1 canvas_background={$canvas_background%2} wait 100 activate_altpreview=1 fi +if {*,A} canvas_tracker+=1 canvas_tracker={$canvas_tracker%2} wait 100 activate_altpreview=1 fi +if {*,S} __altsymmetry_mode+=1 __altsymmetry_mode={$__altsymmetry_mode%2} wait 200 activate_altpreview=1 fi +if {*,E} mainaltmode+=1 mainaltmode={$mainaltmode%2} wait 200 activate_altpreview=1 fi +if {*,V} viewselectionbox+=1 viewselectionbox={$viewselectionbox%2} wait 200 activate_altpreview=1 fi +if $mainaltmode if {*,D} deselectmode+=1 deselectmode={$deselectmode%2} wait 200 activate_altpreview=1 activate_deselect_select=1 fi fi +undo_state=0 +if {*,Z} undo_state=1 fi +if $undo_state ++store[0] temp_undo +$undo_image +rv[0,-1] +rm. +activate_altpreview=1 +$temp_undo +store. undo_image +fi +if {*,T} rowcolumnshiftmode+=1 rowcolumnshiftmode={$rowcolumnshiftmode%2} wait 200 activate_altpreview=1 if $shiftplacecount shiftplacecount=0 fi fi +if $rowcolumnshiftmode +if {*,0} __shiftboundary=0 wait 200 activate_altpreview=1 fi +if {*,1} __shiftboundary=1 wait 200 activate_altpreview=1 fi +if {*,2} __shiftboundary=2 wait 200 activate_altpreview=1 fi +if {*,3} __shiftboundary=3 wait 200 activate_altpreview=1 fi +if {*,4} __shiftboundary=4 wait 200 activate_altpreview=1 fi +if {*,5} __shiftboundary=5 wait 200 activate_altpreview=1 fi +if {*,M} __shiftboundary+=1 __shiftboundary={$__shiftboundary%6} wait 200 activate_altpreview=1 fi +fi +if {*,W} w[] 1 w2[] 1 fi +if {*2,ARROWLEFT}" || "{*2,ARROWRIGHT} mirror. x transform_tile=1 wait 100 +elif {*2,ARROWUP}" || "{*2,ARROWDOWN} mirror. y transform_tile=1 wait 100 +fi +if $transform_tile ++out2display. , w2[-1] rm. +transform_tile=0 +fi +if !$mainaltmode +if {*,B} __altplace_replacemode+=1 __altplace_replacemode={$__altplace_replacemode%2} wait 200 activate_altpreview=1 fi +if !$__altplace_replacemode&&{*,F} __altplacebackmode+=1 __altplacebackmode={$__altplacebackmode%2} wait 200 activate_altpreview=1 fi +fi +if {*,R} +if $__altmode_orientation +$__isr f. 0 store. __isr __vmax_y=0 +else +$__isc f. 0 store. __isc __vmax_x=0 +fi +activate_altpreview=1 +fi +if $mainaltmode&&!$rowcolumnshiftmode +if $__altsymmetry_mode +if $__altmode_orientation +if {*,ARROWUP} __altsymmetry_posy-=1 __altsymmetry_posy={max(-$tth,$__altsymmetry_posy)} activate_altpreview=1 wait 200 fi +if {*,ARROWDOWN} __altsymmetry_posy+=1 __altsymmetry_posy={min($tth,$__altsymmetry_posy)} activate_altpreview=1 wait 200 fi +if {*,ARROWLEFT}||{*,ARROWRIGHT} __altmode_orientation=0 activate_altpreview=1 wait 200 fi +if {*,J} __altsymmetry_posy=0 activate_altpreview=1 wait 200 fi +else +if {*,ARROWLEFT} __altsymmetry_posx-=1 __altsymmetry_posx={max(-$ttw,$__altsymmetry_posx)} activate_altpreview=1 wait 200 fi +if {*,ARROWRIGHT} __altsymmetry_posx+=1 __altsymmetry_posx={min($ttw,$__altsymmetry_posx)} activate_altpreview=1 wait 200 fi +if {*,ARROWUP}||{*,ARROWDOWN} __altmode_orientation=1 activate_altpreview=1 wait 200 fi +if {*,J} __altsymmetry_posx=0 activate_altpreview=1 wait 200 fi +fi +else +if {*,ARROWLEFT}||{*,ARROWRIGHT}||{*,ARROWUP}||{*,ARROWDOWN} __altmode_orientation+=1 __altmode_orientation={$__altmode_orientation%2} activate_altpreview=1 wait 200 fi +fi +elif $mainaltmode&&$rowcolumnshiftmode +if {*,ARROWLEFT}||{*,ARROWRIGHT} __altmode_orientation+=1 __altmode_orientation={$__altmode_orientation%2} activate_altpreview=1 wait 200 fi +fi +if $mainaltmode&&!$rowcolumnshiftmode +if $deselectmode main_w_title.=" - [Deselection]" +else main_w_title.=" - [Selection]" +fi +elif $mainaltmode&&$rowcolumnshiftmode +main_w_title.=" - [Shift] (Boundary Condition - " +if $__shiftboundary==0 main_w_title.="None)" +elif $__shiftboundary==1 main_w_title.="Neumann (Periodic))" +elif $__shiftboundary==2 main_w_title.="Neumann (Mirror))" +elif $__shiftboundary==3 main_w_title.="Neumann (Alternating))" +elif $__shiftboundary==4 main_w_title.="Periodic)" +else main_w_title.="Mirror)" +fi +else +main_w_title.=" - [Place] " +if $__altplace_replacemode +main_w_title.="(Replacement Mode)" +else +if $__altplacebackmode main_w_title.="(Background)" +else main_w_title.="(Foreground)" +fi +fi +fi +if $viewselectionbox&&$canvas_gridmode +canvas_set=$canvas_background,$viewselectionbox,$gridcol, +elif $viewselectionbox +canvas_set=$canvas_background,$viewselectionbox,, +elif $canvas_gridmode +canvas_set=$canvas_background,,$gridcol, +fi +x,y,b,ww,wh={*,x,y,b,w,h} +if $b" && "$x>=0" && "$y>=0" && "$x0:$__vmax_x>0 +if $activate_altpass2tile +if !$__altmode_orientation +r. {$__pdiff*$__min_tile},{h#0} +pass2tile. [0],{$__pmin*$__min_tile},0 +else +r. {w#0},{$__pdiff*$__min_tile} +pass2tile. [0],0,{$__pmin*$__min_tile} +fi +filter_to_selected_row_column. ++out2display. , w2[-1] {w#-1},{h#-1},-1,-1,"Tile" rm. +fi +activate_altpass2tile=0 +if {*,K}||{*,C} ++store[0] undo_image +keeperase_rowcolumn[0] 1 +wait 200 +activate_altpreview=1 +fi +if {*,X} ++store[0] undo_image +keeperase_rowcolumn[0] 0 +wait 200 +activate_altpreview=1 +fi +else +r. 1,1 +f. 0 ++out2display. , w2[-1] {$d2rw},{$d2rw},-1,-1,"Tile" rm. +mainaltmode=1 +rowcolumnshiftmode=0 +deselectmode=0 +fi +if $mainaltmode +if !$rowcolumnshiftmode +if $x>=0" && "$y>=0" && "$x=0" && "$y>=0" && "$x=0" && "$y>=0" && "$x=0?min($ttw,$symmetry_posx):max(-$ttw,$symmetry_posx)} +symmetry_posy={$symmetry_posy>=0?min($tth,$symmetry_posy):max(-$tth,$symmetry_posy)} +else +if {*2,1} __fill_boundary=0 wait 200 +elif {*2,2} __fill_boundary=1 wait 200 +elif {*2,3} __fill_boundary=2 wait 200 +elif {*2,4} __fill_boundary=3 wait 200 +fi +if {*2,B} __fill_boundary={($__fill_boundary+1)%4} wait 200 fi +fi +if $canvas_gridmode +if $canvas_tracker canvas_endset=,$trackpadcol,$gridcol, +else canvas_endset=,,$gridcol, +fi +else +if $canvas_tracker canvas_endset=,$trackpadcol, +else canvas_endset=",," +fi +fi +if {*,C}" || "{*,X} +if {*,X} cutcopymode=1 +else cutcopymode=2 +fi +fi +if {*,D}" || "{*1,D}" || "{*2,D} +erasemode+=1 +erasemode={$erasemode%2} +if $erasemode +f. 0 w2[-1] {$d2rw+($d2rw*$icx)},{$d2rw+($d2rw*$icy)} rm. +else +out2display. , w2[-1] {$d2rw+($d2rw*$icx)},{$d2rw+($d2rw*$icy)} rm. +fi +optinsert=1 +fi +if {*1,G} tileset_gridmode+=1 tileset_gridmode={$tileset_gridmode%2} wait 200 temp_tileset_gridmode=1 fi +x,y,b,ww,wh={*,x,y,b,w,h} +x1,y1,b1,ww1,wh1={*1,x,y,b,w,h} +x2,y2,b2,ww2,wh2={*2,x,y,b,w,h} +if $start +if $undo_state ++store[0] temp_undo +$undo_image +rv[0,-1] +rm. +$temp_undo +store. undo_image +fi +if {{*2,CTRLLEFT}" || "{*2,CTRLRIGHT}}" && "{{*2,ARROWLEFT}" || "{*2,ARROWRIGHT}} +mirror. x transform_tile=1 +wait 100 +elif {{*2,CTRLLEFT}" || "{*2,CTRLRIGHT}}" && "{{*2,ARROWUP}" || "{*2,ARROWDOWN}} +mirror. y transform_tile=1 +wait 100 +elif {*2,ARROWLEFT}||{*2,ARROWRIGHT} +temp_tile_width=$tile_width +temp_tile_height=$tile_height +temp_icx=$icx +temp_icy=$icy +icx=$temp_icy +icy=$temp_icx +tile_width=$temp_tile_height +tile_height=$temp_tile_width +if {*2,ARROWRIGHT} rotate. 90 else rotate. -90 fi +transform_tile=1 +wait 100 +fi +if {*2,O}" && "!$symmetrymode ++store[0] undo_image +fill_tiles2canvas +wait 100 +fi +if $transform_tile ++out2display. , w2[-1] {$d2rw+($d2rw*$icx)},{$d2rw+($d2rw*$icy)} rm. +transform_tile=0 +optinsert=1 +fi +if {{{*1,CTRLLEFT}" || "{*1,CTRLRIGHT}}" && "{*1,ARROWRIGHT}} +if $select_from_tileset +icx+=1 +icx={min($icx,$max_increment)} +tile_width={$__min_tile+($icx*$__min_tile)} +fi +if $select_from_tileset resize_tile_from_tileset=1 fi +wait 500 +elif {{{*1,CTRLLEFT}" || "{*1,CTRLRIGHT}}" && "{*1,ARROWLEFT}} +if $select_from_tileset +icx-=1 +icx={max($icx,0)} +tile_width={$__min_tile+($icx*$__min_tile)} +fi +if $select_from_tileset resize_tile_from_tileset=1 fi +wait 500 +elif {{{*1,CTRLLEFT}" || "{*1,CTRLRIGHT}}" && "{*1,ARROWDOWN}} +if $select_from_tileset +icy+=1 +icy={min($icy,$max_increment)} +tile_height={$__min_tile+($icy*$__min_tile)} +fi +if $select_from_tileset resize_tile_from_tileset=1 fi +wait 500 +elif {{{*1,CTRLLEFT}" || "{*1,CTRLRIGHT}}" && "{*1,ARROWUP}} +if $select_from_tileset +icy-=1 +icy={max($icy,0)} +tile_height={$__min_tile+($icy*$__min_tile)} +fi +if $select_from_tileset resize_tile_from_tileset=1 fi +wait 500 +elif {*1,ARROWRIGHT} +select_from_tileset=0 +lr+=1 +lr={$lr%$xr} +ci={($lr+$tb)%$ti} +ni={$ci+1} +switch_tile_set=1 +tsw={w#$ni-$__min_tile} +tsh={h#$ni-$__min_tile} +wait 625 +elif {*1,ARROWLEFT} +select_from_tileset=0 +lr-=1 +lr={$lr%$xr} +ci={($lr+$tb)%$ti} +ni={$ci+1} +tsw={w#$ni-$__min_tile} +tsh={h#$ni-$__min_tile} +switch_tile_set=1 +wait 625 +elif {*1,ARROWDOWN} +select_from_tileset=0 +tbc+=1 +tbc={$tbc%$yr} +tb={$tbc*$xr} +ci={($lr+$tb)%$ti} +ni={$ci+1} +tsw={w#$ni-$__min_tile} +tsh={h#$ni-$__min_tile} +switch_tile_set=1 +wait 625 +elif {*1,ARROWUP} +select_from_tileset=0 +tbc-=1 +tbc={$tbc%$yr} +tb={$tbc*$xr} +ci={($lr+$tb)%$ti} +ni={$ci+1} +tsw={w#$ni-$__min_tile} +tsh={h#$ni-$__min_tile} +switch_tile_set=1 +wait 625 +fi +if $switch_tile_set ++out2display[$ni] , w1[-1] {w#$ni+$dwm1*w#$ni},{h#$ni+$dwm1*h#$ni} rm. +switch_tile_set=0 +fi +if $resize_tile_from_tileset +r. $tile_width,$tile_height,100%,100%,0 +tsx={min($tsx,$tsw-($icx*$__min_tile))} tsy={min($tsy,$tsh-($icy*$__min_tile))} +pass2tile. [$ni],$tsx,$tsy ++out2display. , w2[-1] {$d2rw+($d2rw*$icx)},{$d2rw+($d2rw*$icy)} rm. +if $tileset_gridmode ++out2display[$ni] 0,$tsx,$tsy,$tile_width,$tile_height,$trackpadcol,$gridcol +else ++out2display[$ni] 0,$tsx,$tsy,$tile_width,$tile_height,$trackpadcol +fi +w1[-1] rm. +resize_tile_from_tileset=0 +fi +if $b" && "$x>=0" && "$y>=0" && "$x=0" && "$y1>=0" && "$x1=0" && "$y>=0" && "$x12 error narg(\$"13")<13==F fi fi +max_width=${-max_w} +max_height=${-max_h} +if $!>1 $max_width,$max_height,1,1 else channels 0 f 0 fi +cv_0={narg($4)?$4:u(0,1)} +cv_1={narg($5)?$5:u(0,1)} +cv_2={narg($6)?$6:u(0,1)} +cv_3={narg($7)?$7:u(0,1)} +cv_4={narg($8)?$8:u(0,1)} +cv_5={narg($9)?$9:u(0,1)} +cv_6={narg($10)?$10:u(0,1)} +cv_7={narg($11)?$11:u(0,1)} +cv_8={narg($12)?$12:u(0,1)} +1,1,1,1 +eval ${-math_lib}" +interpolate(a,b)=a*-b+(1-a)*b; +eucl_norm(a,b)=sqrt(a^2+b^2); +const use_run=$13; +const mw=w#-2; +const mh=h#-2; +const cenx=mw/2; +const ceny=mh/2; +const cenf=(eucl_norm(cenx,ceny)/2.5)*$3; +xc=yc=zc=0; +const cv_0=$cv_0; +const cv_1=$cv_1; +const cv_2=$cv_2; +const cv_3=$cv_3; +const cv_4=$cv_4; +const cv_5=$cv_5; +const cv_6=$cv_6; +const cv_7=$cv_7; +const cv_8=$cv_8; +if($1<=4, +const a=interpolate(cv_0,3); +const b=interpolate(cv_1,3); +if($1!=3&&$1<4, +const c=interpolate(cv_2,3); +const d=interpolate(cv_3,3); +, +const c=interpolate(cv_2,3); +const d=interpolate(cv_3,3); +const e=interpolate(cv_4,3); +const f=interpolate(cv_5,3); +); +if($1<2,xc=-.5;yc=-.5;, +if($1==2,xc=-1; +); +); +, +if($1==5, +const a=interpolate(cv_0,2); +const b=interpolate(cv_1,2); +const c=interpolate(cv_2,2); +const d=interpolate(cv_3,2); +const e=interpolate(cv_4,2); +const f=interpolate(cv_5,2); +const l=interpolate(cv_6,2); +const h=interpolate(cv_7,2); +const j=interpolate(cv_8,2); +, +const a=interpolate(cv_0,3); +const b=interpolate(cv_1,3); +const c=interpolate(cv_2,3); +const d=interpolate(cv_3,3); +const e=interpolate(cv_4,3); +const f=interpolate(cv_5,3); +); +); +if($1==0, +xnf(cx,cy)=sin(cy*b)+c*sin(b*cx); +ynf(cx,cy)=sin(a*cx)+d*sin(a*cy);, +if($1==1, +xnf(cx,cy)=sin(cy*a)+cos(c*cx); +ynf(cx,cy)=sin(c*cx)-cos(d*cy);, +if($1==2, +xnf(cx,cy)=abs(sin(cy*a)^3)+cos(c*cx); +ynf(cx,cy)=abs(sin(c*cx)^2)-cos(d*cy)^2;, +if($1==3, +xnf(cx,cy)=sin(cy*a)+cos(a*cx); +ynf(cx,cy)=sin(b*cx)-cos(b*cy);, +if($1==4, +xnf_3d(cx,cy,cz)=cy*sin(a*cx)+sin(b*cy); +ynf_3d(cx,cy,cz)=cz*cos(c*cy)-cos(d*cz); +znf_3d(cx,cy,cz)=cx*sin(e*cz)+cos(f*cx);, +if($1==5, +xnf_3d(cx,cy,cz)=cy*sin(a*cx)+cos(b*cy)+sin(c*cz); +ynf_3d(cx,cy,cz)=cz*sin(d*cx)+cos(e*cy)+sin(f*cz); +znf_3d(cx,cy,cz)=cx*sin(l*cx)+cos(h*cy)+sin(j*cz);, +xnf_3d(cx,cy,cz)=cz*sin(a*cx)+cos(b*cy); +ynf_3d(cx,cy,cz)=cx*sin(c*cy)+cos(d*cz); +znf_3d(cx,cy,cz)=cy*sin(e*cz)+cos(f*cx); +); +); +); +); +); +); +const td=abs($2)*10^6; +pixcount=0; +if($1<4, +repeat(td,n, +xn=xnf(xc,yc); +yn=ynf(xc,yc); +xc=xn; +yc=yn; +nx=xn*cenf*.75; +ny=yn*cenf*.75; +fnx=nx>=0?nx:mw+nx; +fny=ny>=0?ny:mh+ny; +if(!i(#-2,fnx,fny),++pixcount;); +i(#-2,fnx,fny)+=1; +if(use_run,if(!(n%200000),run('progress ',100*(n/td)));); +); +, +repeat(td,n, +xn=xnf_3d(xc,yc,zc); +yn=ynf_3d(xc,yc,zc); +zn=znf_3d(xc,yc,zc); +xc=xn; +yc=yn; +zc=zn; +nx=xn*cenf*1; +ny=yn*cenf*1; +fnx=nx>=0?nx:mw+nx; +fny=ny>=0?ny:mh+ny; +if(!i(#-2,fnx,fny),++pixcount;); +i(#-2,fnx,fny)+=1; +if(use_run,if(!(n%200000),run('progress ',100*(n/td)));); +); +); +pixcount; +" +shift.. 50%,50%,0,0,2 rm. +#@cli rep_tg3: eq. to 'rep_trigonometry_three_channel_gradient' +rep_tg3: rep_trigonometry_three_channel_gradient $* +#@cli rep_trigonometry_three_channel_gradient: _resolution,_chan_order={ 0=0,1,2 | 1=0,2,1 | 2=1,0,2 | 3=1,2,0 | 4=2,0,1 | 5=2,1,0 },_chan_form_a={ 0=sinusoidal | 1=cosinusoidal | 2=cubic-sinusoidal | 3=cubic-cosinusoidal | 4=cubic-sinusoidal-cosinusoidal },_multiplier_a>0,_valueshift_a,0>=_midgray_expf_a>=1,_lightness_merge_factor_a>=1,_lightness_end_expf_a>0,0>=_gray2col_end_a>=1,_chan_form_b={ 0=sinusoidal | 1=cosinusoidal | 2=cubic-sinusoidal | 3=cubic-cosinusoidal | 4=cubic-sinusoidal-cosinusoidal },_multiplier_b>0,_valueshift_b,0>=_midgray_expf_b>=1,_lightness_merge_factor_b>=1,_lightness_end_expf_b>0,0>=_gray2col_end_b>=1,_chan_form_c={ 0=sinusoidal | 1=cosinusoidal | 2=cubic-sinusoidal | 3=cubic-cosinusoidal | 4=cubic-sinusoidal-cosinusoidal },_multiplier_c>0,_valueshift_c,0>=_midgray_expf_c>=1,_lightness_merge_factor_c>=1,_lightness_end_expf_c>0,0>=_gray2col_end_c>=1 +#@cli : Creates trigonometry gradients or map images with trigonometry coloring. +#@cli : (eq. to 'rep_tg3').\n +#@cli : '_resolution' defines the length of gradient or the way it is going to be mapped. See below for more information on _resolution. +#@cli : '_chan_order' defines the order of channel of gradient +#@cli : '_chan_form' refers to the formula each channels use +#@cli : '_multiplier' defines the multiplication of base gradient used to map formula based on trigonometry. +#@cli : '_valueshift' refers to the value shift of base gradient +#@cli : '_midgray_expf' refers to the middle-point of base gradient used to map formula based on trigonometry relative to middle. +#@cli : '_lightness_merge_factor' refers to the merging of lightness gradient with color gradient. Used to add white and black to gradient ends. +#@cli : '_lightness_end_expf' defines the magnitude of shades and tind of each end of end gradient +#@cli : '_gray2col_end' defines how much the end gradient overrides the base gradient\n +#@cli : '_resolution' values and processing info +#@cli : ----- +#@cli : Info #1: If '_resolution' is a number: If _resolution is negative, create a 3-channel trigonometry vertical gradient, else create 3-channel trigonometry horizontal gradient. +#@cli : Info #2: If '_resolution' is "8i", then map trigonometry function by first dividing by 255, then perform trigonometry function, finally multiply by 255. +#@cli : Info #3: If '_resolution' is "8il", then image will be converted into RGBA luminosity format, then perform trigonometry function, finally multiply by 255. +#@cli : Info #4: If '_resolution' is empty, then directly map trigonometry function. +#@cli : -----\n +#@cli : Default values: 'resolution=256','_chan_order=0','_chan_form_a=0','_multiplier_a=1','_valueshift_a=0','_midgray_expf_a=1','_lightness_merge_factor_a=1','_lightness_end_expf_a=0','_gray2col_end_a=1','_chan_form_b=_chan_form_a','_multiplier_b=_multiplier_a','_valueshift_b=_valueshift_a','_midgray_expf_b=_midgray_expf_a','_lightness_merge_factor_b=_lightness_merge_factor_a','_lightness_end_expf_b=_lightness_end_expf_a','_gray2col_end_b=_gray2col_end_a','_chan_form_c=_chan_form_b','_multiplier_c=_multiplier_b','_valueshift_c=_valueshift_b','_midgray_expf_c=_midgray_expf_b','_lightness_merge_factor_c=_lightness_merge_factor_b','_lightness_end_expf_c=_lightness_end_expf_b','_gray2col_end_c=_gray2col_end_b'\n +#@cli : Author: Reptorian. +rep_trigonometry_three_channel_gradient: +echo "Map trigonometry function within image"("s")"" +skip ${1=},${2=0},${3=},${4=},${5=},${6=},${7=},${8=},${9=},${10=},${11=},${12=},${13=},${14=},${15=},${16=},${17=},${18=},${19=},${20=},${21=},${22=},${23=} +v + e "\nMap trigonometry function within image"("s")"" v - +if narg($3) channel_formula_a=$3 else channel_formula_a=0 fi +if narg($4) multiplier_a=$4 else multiplier_a=1 fi +if narg($5) valueshift_a=$5 else valueshift_a=0 fi +if narg($6) midgray_expf_a=$6 else midgray_expf_a=1 fi +if narg($7) lightness_merge_factor_a=$7 else lightness_merge_factor_a=1 fi +if narg($8) lightness_end_expf_a=$8 else lightness_end_expf_a=0 fi +if narg($9) gray2col_end_a=$9 else gray2col_end_a=1 fi +if narg($10) channel_formula_b=$10 else channel_formula_b=$channel_formula_a fi +if narg($11) multiplier_b=$11 else multiplier_b=$multiplier_a fi +if narg($12) valueshift_b=$12 else valueshift_b=$valueshift_a fi +if narg($13) midgray_expf_b=$13 else midgray_expf_b=$midgray_expf_a fi +if narg($14) lightness_merge_factor_b=$14 else lightness_merge_factor_b=$lightness_merge_factor_a fi +if narg($15) lightness_end_expf_b=$15 else lightness_end_expf_b=$lightness_end_expf_a fi +if narg($16) gray2col_end_b=$16 else gray2col_end_b=$gray2col_end_a fi +if narg($17) channel_formula_c=$17 else channel_formula_c=$channel_formula_b fi +if narg($18) multiplier_c=$18 else multiplier_c=$multiplier_b fi +if narg($19) valueshift_c=$19 else valueshift_c=$valueshift_b fi +if narg($20) midgray_expf_c=$20 else midgray_expf_c=$midgray_expf_b fi +if narg($21) lightness_merge_factor_c=$21 else lightness_merge_factor_c=$lightness_merge_factor_b fi +if narg($22) lightness_end_expf_c=$22 else lightness_end_expf_c=$lightness_end_expf_b fi +if narg($23) gray2col_end_c=$23 else gray2col_end_c=$gray2col_end_b fi +channel_formula=[$channel_formula_a,$channel_formula_b,$channel_formula_c] +multiplier=[$multiplier_a,$multiplier_b,$multiplier_c] +valueshift=[$valueshift_a,$valueshift_b,$valueshift_c] +midgray_expf=[$midgray_expf_a,$midgray_expf_b,$midgray_expf_c] +lightness_merge_factor=[$lightness_merge_factor_a,$lightness_merge_factor_b,$lightness_merge_factor_c] +lightness_end_expf=[$lightness_end_expf_a,$lightness_end_expf_b,$lightness_end_expf_c] +gray2col_end=[$gray2col_end_a,$gray2col_end_b,$gray2col_end_c] +channel_order=${arg\ $2+1,\"[0,1,2]\",\"[0,2,1]\",\"[1,0,2]\",\"[1,2,0]\",\"[2,0,1]\",\"[2,1,0]\"} +repeat $! { +img_id=$> +if s#$img_id<3||s#$img_id>4 error s#$img_id>2&&s#$img_id<4==F fi +} +if isnum($1) +if $1>0 $1,1,1,3,"begin(ww=w-1;);x/ww" +elif $1<0 1,abs($1),1,3,"begin(hh=h-1;);y/hh" +else error _$1!=0==F +fi +repeat 3 { +sh. {($channel_order)[$>]} +rep_trigmap. ,{($channel_formula)[$>]+5*$>},{($multiplier)[$>]},{($valueshift)[$>]},{($midgray_expf)[$>]},{($lightness_merge_factor)[$>]},{($lightness_end_expf)[$>]},{($gray2col_end)[$>]} +rm. +} +else +if narg($1) +if '$1'=='8i' +foreach { +repeat 3 { +sh. {($channel_order)[$>]} +rep_trigmap_8i. {($channel_formula)[$>]+5*$>},{($multiplier)[$>]},{($valueshift)[$>]},{($midgray_expf)[$>]},{($lightness_merge_factor)[$>]},{($lightness_end_expf)[$>]},{($gray2col_end)[$>]} +rm. +} +} +elif '$1'=='8il' +foreach { +if s==3 to_gray to_rgb +else to_graya to_rgba +fi +repeat 3 { +sh. {($channel_order)[$>]} +rep_trigmap_8i. {($channel_formula)[$>]+5*$>},{($multiplier)[$>]},{($valueshift)[$>]},{($midgray_expf)[$>]},{($lightness_merge_factor)[$>]},{($lightness_end_expf)[$>]},{($gray2col_end)[$>]} +rm. +} +} +else error ""(""$"1==8i")"||"(""$"1==8il")"==F" +fi +else +foreach { +repeat 3 { +sh. {($channel_order)[$>]} +rep_trigmap. ,{($channel_formula)[$>]+5*$>},{($multiplier)[$>]},{($valueshift)[$>]},{($midgray_expf)[$>]},{($lightness_merge_factor)[$>]},{($lightness_end_expf)[$>]},{($gray2col_end)[$>]} +rm. +} +} +fi +fi +#@cli rep_trigmap: eq. to 'rep_trigonometry_map' +rep_trigmap: rep_trigonometry_map $* +#@cli rep_trigonometry_map: _image_value_divide,_chan_form={ 0=sinusoidal | 1=cosinusoidal | 2=cubic-sinusoidal | 3=cubic-cosinusoidal | 4=cubic-sinusoidal-cosinusoidal },_multiplier>0,_valueshift,0>=_midgray_expf>=1,_lightness_merge_factor>=1,_lightness_end_expf>0,0>=_gray2col_end>=1 +#@cli : Map trigonometry function into image. +#@cli : +#@cli : (eq. to 'rep_trigmap'). +#@cli : +#@cli : '_image_value_divide' defines how much the image should be divided by. Of course, 0 is not valid. +#@cli : '_chan_form' refers to the formula each channels use. Number higher than 4 will use a slight different formula, but still follow the pattern of formulas named above. +#@cli : '_multiplier' defines the multiplication of base gradient used to map formula based on trigonometry. +#@cli : '_valueshift' refers to the value shift of base gradient +#@cli : '_midgray_expf' refers to the middle-point of base gradient used to map formula based on trigonometry relative to middle. +#@cli : '_lightness_merge_factor' refers to the merging of lightness gradient with color gradient. Used to add white and black to gradient ends. +#@cli : '_lightness_end_expf' defines the magnitude of shades and tind of each end of end gradient +#@cli : '_gray2col_end' defines how much the end gradient overrides the base gradient +#@cli : +#@cli : Note: Add 5 or 10 to '_chan_form' for another variation of the specified formula. +#@cli : Default values: '_image_value_divide=1','_multiplier_mode=1','_valueshift=0','_midgray_expf=1','_lightness_merge_factor=1','_lightness_end_expf=0','_gray2col_end=1'\n +#@cli : Author: Reptorian. +rep_trigonometry_map: +skip ${1=1},${2=0},${3=1},${4=0},${5=1},${6=1},${7=0},${8=1} +if $1==0 error ""$"1!=0==f" fi +f "begin( +const trigmode=$2%15; +trigmode==0? chan_form(a)=(sin(a*pi)+1)/2: +trigmode==1? chan_form(a)=(cos(a*pi)+1)/2: +trigmode==2? chan_form(a)=(sin(a*pi+pi)^3+1)/2: +trigmode==3? chan_form(a)=(cos(a*pi+pi)^3+1)/2: +trigmode==4? chan_form(a)=((cos(a*pi+pi/2)*sin(a*pi+pi/2))^3+.125)*4: +trigmode==5? chan_form(a)=(sin(a*pi+pi/2)+1)/2: +trigmode==6? chan_form(a)=(cos(a*pi+pi/2)+1)/2: +trigmode==7? chan_form(a)=(sin(a*pi+pi/2)^3+1)/2: +trigmode==8? chan_form(a)=(cos(a*pi+pi/2)^3+1)/2: +trigmode==9? chan_form(a)=((cos(a*pi+pi/4)*sin(a*pi+pi/4))^3+.125)*4: +trigmode==10?chan_form(a)=(sin(a*pi+pi)+1)/2: +trigmode==11?chan_form(a)=(cos(a*pi+pi)+1)/2: +trigmode==12?chan_form(a)=(sin(a*pi)^3+1)/2: +trigmode==13?chan_form(a)=(cos(a*pi)^3+1)/2: +trigmode==14?chan_form(a)=((cos(a*pi)*sin(a*pi))^3+.125)*4; +); +slope=i/$1; +midslope=(max(1-slope,slope)-.5)*2; +col_chan_zero=chan_form($3*(slope^$5+$4)); +mul_chan_zero=lerp(col_chan_zero,lerp(slope*col_chan_zero,slope,midslope^(abs($7+1))),midslope^(abs($7+1))*$6); +lerp(slope,mul_chan_zero,$8)*$1;" +#@cli rep_trigmap_8i: eq. to 'rep_trigonometry_map_8bit_integer' +rep_trigmap_8i: rep_trigonometry_map 255,${1-7} +#@cli rep_trigonometry_map_8bit_integer: _level_formula={ 0=sinusoidal | 1=cosinusoidal | 2=cubic-sinusoidal | 3=cubic-cosinusoidal | 4=cubic-sinusoidal-cosinusoidal },_multiplier>0,_valueshift,0>=_midgray_expf>=1,_lightness_merge_factor>=1,_lightness_end_expf>0,0>=_gray2col_end>=1 +#@cli : Map trigonometry function using 8-bit values. Remove _8i for non-8 bit values. +#@cli : (eq. to rep_trigmap_8i).\n +#@cli : Note: Add 5 or 10 to '_level_formula' for another variation of the specified formula. +#@cli : Default values: '_multiplier_a=1','_valueshift_a=0','_midgray_expf_a=1','_lightness_merge_factor_a=1','_lightness_end_expf_a=0','_gray2col_end_a=1' +rep_trigonometry_map_8bit_integer: rep_trigonometry_map 255,${1-7} +#@cli rep_lerp_rgb_gray: eq. to rep_linear_interpolation_rgb_gray +rep_lerp_rgb_gray: rep_linear_interpolation_rgb_gray $* +#@cli rep_linear_interpolation_rgb_gray: 0%>=_red_factor(%)<=100%,0%>=_green_factor(%)<=100%,0%>=_blue_factor(%)<=100%,_gray_mode={ 0=luminosity | 1=luminosity_alternative | 2=lightness | 3=minimum_channel | 4=maximum_channel | 5=average } : 0%>=_red_factor(%)<=100%,0%>=_green_factor(%)<=100%,0%>=_blue_factor(%)<=100%,_red_weight,green_weight,blue_weight\n +#@cli : Author: Reptorian. +rep_linear_interpolation_rgb_gray: +skip ${4=0},${5=},${6=} +total_arg=0 +if isnum($1) total_arg+=1 fi +if isnum($2) total_arg+=1 fi +if isnum($3) total_arg+=1 fi +if isnum($4) total_arg+=1 fi +if isnum($5) total_arg+=1 fi +if isnum($6) total_arg+=1 fi +if $total_arg==5 error "valid_args!=5=F" fi +if abs($1)>2 error "|"$"1|<=2=F" fi +if abs($2)>2 error "|"$"2|<=2=F" fi +if abs($3)>2 error "|"$"3|<=2=F" fi +f "begin( +const rlvl=abs($1); +const glvl=abs($2); +const blvl=abs($3); +if(narg($*)>5, +const tw=abs($4)+abs($5)+abs($6); +const c1f=abs($4)/tw; +const c2f=abs($5)/tw; +const c3f=abs($6)/tw; +graymode(a,b,c)=a*c1f+b*c2f+c*c3f; +, +$4==0?graymode(a,b,c)=a*0.22248840+b*0.71690369+c*0.06060791: +$4==1?graymode(a,b,c)=a*0.2990+b*0.5870+c*0.1140: +$4==2?graymode(a,b,c)=(max(a,b,c)+min(a,b,c))/2: +$4==3?graymode(a,b,c)=min(a,b,c): +$4==4?graymode(a,b,c)=max(a,b,c): +graymode(a,b,c)=avg(a,b,c); +); +); +gl=graymode(i0,i1,i2); +[lerp(gl,i0,rlvl),lerp(gl,i1,glvl),lerp(gl,i2,blvl)];" +#@cli rgb2ohta8 +#@cli : Convert color representation of selected images from RGB to Ohta8. +#@cli : Source: https://hbfs.wordpress.com/2018/04/24/ohta-colorspaces-iii/#more-6335 +#@cli : $ image.jpg rgb2ohta split c +rgb2ohta8: +e[^-1] "Convert color representation of image$? from RGB to Ohta8." +f [avg(i0,i1,i2),(i0-i2+255)/2,(-i0+i1-i2+255)/3] +#@cli ohta82rgb +#@cli : Convert color representation of selected images from Ohta8 to RGB. +#@cli : Source: https://hbfs.wordpress.com/2018/04/24/ohta-colorspaces-iii/#more-6335 +#@cli : $ image.jpg ohta82rgb split c +ohta82rgb: +e[^-1] "Convert color representation of image$? from Ohta8 to RGB." +f c0=i0*3;c1=i1*2-255;c2=i2*3-255;[.25*c0+.5*c1-.25*c2,.5*c0+.5*c2,.25*c0-.5*c1-.25*c2] +#@cli rgb2ohta +#@cli : Convert color representation of selected images from RGB to Ohta. +#@cli : Source: https://hbfs.wordpress.com/2018/04/24/ohta-colorspaces-iii/#more-6335 +#@cli : $ image.jpg rgb2ohta split c +rgb2ohta: +e[^-1] "Convert color representation of image$? from RGB to Ohta." +f [i0+i1+i2,i0-i2,-i0+i1-i2] +#@cli ohta2rgb +#@cli : Convert color representation of selected images from Ohta to RGB. +#@cli : Source: https://hbfs.wordpress.com/2018/04/24/ohta-colorspaces-iii/#more-6335 +#@cli : $ image.jpg ohta2rgb split c +ohta2rgb: +e[^-1] "Convert color representation of image$? from Ohta to RGB." +f [.25*i0+.5*i1-.25*i2,.5*i0+.5*i2,.25*i0-.5*i1-.25*i2] +#@cli rgb2ydbdr +#@cli : Convert color representation of selected images from RGB to YDbDr. +#@cli : Source: https://hbfs.wordpress.com/2018/05/15/ydbdr-colorspaces-vi/#more-6355 +#@cli : $ image.jpg rgb2ydbdr split c +rgb2ydbdr: +e[^-1] "Convert color representation of image$? from RGB to YDbDr." +f [.299*i0+.587*i1+.114*i2,-.45*i0-.883*i1+1.333*i2,1.333*i0-1.109*i1-.217*i2] +#@cli rgb2ydbdr +#@cli : Convert color representation of selected images from YDbDr to RGB. +#@cli : Source: https://hbfs.wordpress.com/2018/05/15/ydbdr-colorspaces-vi/#more-6355 +#@cli : $ image.jpg rgb2ydbdr split c +ydbdr2rgb: +e[^-1] "Convert color representation of image$? from YDbDr to RGB." +f [1*i0+.525*i2,1*i0-.129*i1-.268*i2,1*i0+.665*i1] +#@cli rgb2k1 +#@cli : Convert color representation of selected images from RGB to Kodak 1. +#@cli : Source: https://hbfs.wordpress.com/2018/04/10/kodak-1-colorspaces-i/ +#@cli : $ image.jpg rgb2k1 split c +rgb2k1: +e[^-1] "Convert color representation of image$? from RGB to Kodak 1." +f begin(third=1/3;);r=third*i0;g=third*i1;b=third*i2;[r+g+b,b-r-g,r-g-b] +#@cli k12rgb +#@cli : Convert color representation of selected images from Kodak 1 to RGB. +#@cli : Source: https://hbfs.wordpress.com/2018/04/10/kodak-1-colorspaces-i/ +#@cli : $ image.jpg k12rgb split c +k12rgb: +e[^-1] "Convert color representation of image$? from Kodak 1 to RGB." +f [1.5*i0+1.5*i2,-1.5*i1-1.5*i2,1.5*i0+1.5*i1]; +#@cli rgb2k18 +#@cli : Convert color representation of selected images from RGB to Kodak 1 in 8I. +#@cli : Source: https://hbfs.wordpress.com/2018/04/10/kodak-1-colorspaces-i/ +#@cli : $ image.jpg rgb2k18 split c +rgb2k18: +e[^-1] "Convert color representation of image$? from RGB to Kodak 1 - 8I." +f begin(third=1/3;);r=third*i0;g=third*i1;b=third*i2;[r+g+b,(b-r-g)+170,(r-g-b)+170] +#@cli k182rgb +#@cli : Convert color representation of selected images from Kodak 1 in 8I to RGB. +#@cli : Source: https://hbfs.wordpress.com/2018/04/10/kodak-1-colorspaces-i/ +#@cli : $ image.jpg k182rgb split c +k182rgb: +e[^-1] "Convert color representation of image$? from Kodak 1 - 8I to RGB." +f c1=i1-170;c2=i2-170;[1.5*i0+1.5*c2,-1.5*c1-1.5*c2,1.5*i0+1.5*c1]; +#@cli rgb2yes +#@cli : Convert color representation of selected images from RGB to YES. +#@cli : Source: Xerox Color Encoding Standard, (tech rep?) XNSS 289005 (1989?) ; https://hbfs.wordpress.com/2018/05/01/xerox-yes-colorspaces-iv/ +#@cli : $ image.jpg rgb2yes split c +rgb2yes: +e[^-1] "Convert color representation of image$? from RGB to YES." +f [.253*i0+.684*i1+.063*i2,.5*i0-.5*i1,.25*i0+.25*i1-.5*i2] +#@cli yes2rgb +#@cli : Convert color representation of selected images from RGB to YES. +#@cli : Source: Xerox Color Encoding Standard, (tech rep?) XNSS 289005 (1989?) ; https://hbfs.wordpress.com/2018/05/01/xerox-yes-colorspaces-iv/ +#@cli : $ image.jpg yes2rgb split c +yes2rgb: +e[^-1] "Convert color representation of image$? from YES to RGB." +f [i0+1.431*i1+.126*i2,i0-.569*i1+.126*i2,i0+.431*i1-1.874*i2] +#@cli rgb2yes8 +#@cli : Convert color representation of selected images from RGB to Yes8. +#@cli : Source: Xerox Color Encoding Standard, (tech rep?) XNSS 289005 (1989?) ; https://hbfs.wordpress.com/2018/05/01/xerox-yes-colorspaces-iv/ +#@cli : $ image.jpg rgb2yes8 split c +rgb2yes8: +e[^-1] "Convert color representation of image$? from RGB to Yes8." +f [.253*i0+.684*i1+.063*i2,(.5*i0-.5*i1)+127.5,(.25*i0+.25*i1-.5*i2)+127.5] +#@cli yes82rgb +#@cli : Convert color representation of selected images from Yes8 to RGB. +#@cli : Source: Xerox Color Encoding Standard, (tech rep?) XNSS 289005 (1989?) ; https://hbfs.wordpress.com/2018/05/01/xerox-yes-colorspaces-iv/ +#@cli : $ image.jpg yes82rgb split c +yes82rgb: +e[^-1] "Convert color representation of image$? from Yes8 to RGB." +f [i0+1.431*(i1-127.5)+.126*(i2-127.5),i0-.569*(i1-127.5)+.126*(i2-127.5),i0+.431*(i1-127.5)-1.874*(i2-127.5)] +#@cli rgb2ycocgr: +#@cli : Convert color representation of selected images from RGB to YCoCg-R. +#@cli : Source: https://en.wikipedia.org/wiki/YCoCg +#@cli : $ image.jpg rgb2ohta split c +rgb2ycocgr: +e[^-1] "Convert color representation of image$? from RGB to YCoCg-R." +f " +Co=i0-i2; +tmp=B+Co/2; +Cg=i1-tmp; +Y=tmp+Cg/2; +[Y,Co,Cg]; +" +#@cli ycocgr2rgb: +#@cli : Convert color representation of selected images from YCoCg-R to RGB. +#@cli : Source: https://en.wikipedia.org/wiki/YCoCg +#@cli : $ image.jpg rgb2ohta split c +ycocgr2rgb: +e[^-1] "Convert color representation of image$? from YCoCg-R To RGB." +f " +tmp=i0-i2/2; +G=i2+tmp; +B=tmp-i1/2; +[B+i1,G,B]; +" +#@cli rgb2ycocg: +#@cli : Convert color representation of selected images from RGB to YCoCg. +#@cli : Source: https://en.wikipedia.org/wiki/YCoCg +#@cli : $ image.jpg rgb2ohta split c +rgb2ycocg: +e[^-1] "Convert color representation of image$? from RGB to YCoCg." +f [i0/4+i1/2+i2/4,i0/2-i2/2,-i0/4+i1/2-i2/4] +#@cli ycocg2rgb: +#@cli : Convert color representation of selected images from YCoCg to RGB. +#@cli : Source: https://en.wikipedia.org/wiki/YCoCg +#@cli : $ image.jpg rgb2ohta split c +ycocg2rgb: +e[^-1] "Convert color representation of image$? from YCoCg To RGB." +f [i0+i1-i2,i0+i2,i0-i1-i2] +#@cli rep_rbtt: eq. to 'rep_rotate_by_torus_top' +rep_rbtt: rep_rotate_by_torus_top $* +#@cli rep_rotate_by_torus_top: 0<=_torus_circu_min_dimension_percent_1(%)<=100,0<=_torus_circu_min_dimension_percent_2(%)<=100,_distort_ang,_mode_1={ 0=softmode | 1=midmode | 2=hardmode | 3=hardmode_alt | 4=distroymode | 5=invdistroymode | 6=quadextrudemode | 7=hexextrudemode },_mode_2={ 0=softmode | 1=midmode | 2=hardmode | 3=hardmode_alt | 4=distroymode | 5=invdistroymode | 6=quadextrudemode | 7=hexextrudemode },0<=_mode_percent_comb(%)<=100,_offx(%),_offy(%),_off_dup={ 0=no_duplicate_dist | 1=duplicate_dist },_bgremove={ 0=keep_background | 1=remove_background },_cent_isolat_torus_mode={ 0=do_not_center | 1=center },_interpolation={ 0=nearest | 1=linear },_boundary={ 0=none | 1=neumann | 2=periodic | 3=mirror } +#@cli : Inspired by the Donut Distortion plugin made by MadJik for Paint.NET, this version of donut distortion adds new features such as more modes, mode blending, isolated torus mode. +#@cli : (eq. to 'rep_rbtt')\n +#@cli : _torus_circu_min_dimension_percent_1 refers to the primary circumference of circle relative to the minimum image dimension. +#@cli : _torus_circu_min_dimension_percent_2 refers to the secondary circumference of circle relative to the minimum image dimension. +#@cli : _distort_ang refers to the maximum angle of distortion. +#@cli : _mode_1 refers to the first mode of donut distortion. +#@cli : _mode_1 refers to the second mode of donut distortion. +#@cli : _mode_percent_comb refers to the weighed average of combination of modes. This only works if and only if _mode_1 and _mode_2 are specified! +#@cli : _offx refers to the offset of donut distortion relative to the center in -1,1 x-coordinates. 100% means the center will be located in 1. +#@cli : _offy refers to the offset of donut distortion relative to the center in -1,1 y-coordinates. 100% means the center will be located in 1. +#@cli : _off_dup option defines whether distortion will wrap around when it reach out of bound. +#@cli : _bgremove defines whether the background is removed. +#@cli : _cent_isolat_torus_mode is a special mode used to aid into creating torus from image. This only works if _bgremove is active. +#@cli : _interpolation defines the smoothness of the image. +#@cli : _boundary defines how out-of-range values are wrapped as. +#@cli : Default values: '_torus_circu_min_dimension_percent_1=1','_torus_circu_min_dimension_percent_2=.5','_distort_ang=45','_mode_1=0','_mode_2=','_mode_percent_comb=50%','_offx=0%','_offy=0%','_off_dup=1','_bgremove=0','_cent_isolat_torus_mode=0','_interpolation=1','_boundary=2' +rep_rotate_by_torus_top: +skip ${1=1},${2=0},${3=45},${4=0},${5=},${6=.5},${7=0},${8=0},${9=1},${10=1},${11=0}${12=1},${13=2} +if $1==$2 error ""$"1!="$"2=F" fi +if ($1>1||$1<0)||($2>1||$2<0) error "(0>="$"1<=1)||(0>="$"2<=1)=F" fi +if $4<0||$4>7 error "0<="$"4<=7=F" fi +if narg($5) if $5<0||$5>7 error "0<="$"5<=7=F" fi fi +if $6<0||$6>1 error "0<="$"6<=1=f" fi +mode_1=${arg\ $4+1,(cos(v*(2*pi)-pi)+1)/2,abs(cos(v*pi+pi/2)),sqrt(1-(abs(v-.5)*2)^2),(1-(abs(v-.5)*2)^2)^(1/(2+(1-v))),cos(v*pi)*boundary,(cos(v*pi)*-1)*boundary,1-abs(v-.5)*2,(r=(1-abs(v-.5)*2)*2;r>1?1:r)} +if narg($5) +mode_2=${arg\ $5+1,(cos(v*(2*pi)-pi)+1)/2,abs(cos(v*pi+pi/2)),sqrt(1-(abs(v-.5)*2)^2),(1-(abs(v-.5)*2)^2)^(1/(2+(1-v))),cos(v*pi)*boundary,(cos(v*pi)*-1)*boundary,1-abs(v-.5)*2,(r=(1-abs(v-.5)*2)*2;r>1?1:r)} +fi +include_alp_cut={$10&&(s==2||s>3)} +if $include_alp_cut +vnull=[vectors(0)] +outcolor=vnull +else outcolor=I +fi +if $12>0 +boundary=avg(bndcut(radial_gradient_v[0]),bndcut(radial_gradient_v[1]),bndcut(radial_gradient_v[2]),bndcut(radial_gradient_v[3])) +calc_antialias=ox=sur_x(start_x(x+.5));oy=sur_y(start_y(y+.5));radial_gradient_v=[nm(norm(xx,yy)),nm(norm(ox,yy)),nm(norm(xx,oy)),nm(norm(ox,oy))]; +else +boundary=bndcut(radial_gradient) +fi +f " +begin( +boundary=0; +const s_id=s-1; +const sd=max(w,h)/min(w,h); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +const ww=w-1; +const hh=h-1; +const cx=ww/2; +const cy=hh/2; +const offx=cx*$7*-1; +const offy=cy*$8; +const eps=10^-10; +const interpolation=abs($12)?2:0; +const outboundary=$13; +vallim_x(v)=v-ww*floor(v/(ww+eps)); +vallim_y(v)=v-hh*floor(v/(hh+eps)); +if($9, +start_x(v)=vallim_x(v+offx); +start_y(v)=vallim_y(v+offy); +, +start_x(v)=v+offx; +start_y(v)=v+offy; +); +const torus_val_1=$1; +const torus_val_2=$2; +const new_min=min(torus_val_1,torus_val_2); +const new_max=max(torus_val_1,torus_val_2); +const end_diff=(1/(new_max-new_min)); +nm(v)=(v-new_min)*end_diff; +limcut(v)=max(min(1,v),0); +bndcut(v)=v>1||v<0?0:1; +const iang=$3*-1; +ang2rad(v)=pi*(v/180); +const maxang=ang2rad(iang); +rot_x(a,b,c)=a*cos(c)-b*sin(c); +rot_y(a,b,c)=a*sin(c)+b*cos(c); +sur_x(v)=(v/ww-.5)*2*sx; +sur_y(v)=(v/hh-.5)*2*sy; +unsur_x(v)=(v/(2*sx)+.5)*ww; +unsur_y(v)=(v/(2*sy)+.5)*hh; +if(narg($5), +if($6==0||$6==1 +,if($6,mode(v)="$mode_2";,mode(v)="$mode_1";); +,mode(v)=lerp("$mode_1","$mode_2",$6); +); +, +mode(v)="$mode_1"; +); +if($include_alp_cut +,out(a,b)=[vectors_id(J(a,b,z,interpolation,$13)),j(a,b,z,s_id,0,outboundary)*boundary];vnull="$vnull"; +,out(a,b)=lerp(I,J(a,b,z,interpolation,outboundary),boundary); +); +); +nxx=start_x(x); +nyy=start_y(y); +xx=sur_x(nxx); +yy=sur_y(nyy); +"$calc_antialias" +radial_gradient=nm(norm(xx,yy)); +norm_gradient=limcut(radial_gradient); +boundary="$boundary"; +z_depth=mode(norm_gradient)*maxang; +XX=rot_x(xx,yy,z_depth); +YY=rot_y(xx,yy,z_depth); +XX=unsur_x(XX); +YY=unsur_y(YY); +diff_x=XX-nxx; +diff_y=YY-nyy; +out(diff_x,diff_y);" +if $11&&$10 +offx={($7/2)*100*-1} +offy={($8/2)*100} +foreach { +if s==2||s>3 +shift $offx%,$offy%,0,0,2,0 +fi +} +fi +#@cli rep_pxpush: eq. to 'rep_pixel_push' +rep_pxpush: rep_pixel_push $* +#@cli rep_pixel_push: -1<=_push_x<=1,-1<=_push_y<=1 +#@cli : Pushes pixel relative to coordinate from the center. CLI filter is recreated from source code to TR's Pixel Push plugin for Paint.NET. Currently only Bezier option is supported until the secondary option is figured out. +#@cli : (eq. to 'rep_pxpush')\n +#@cli : Default values: '_push_x=0','_push_y=0'\n +#@cli : Author: Reptorian. +rep_pixel_push: +f "begin( +const ww=w-1; +const hh=h-1; +cx=cut( ($1+1)/2 ,0,1); +cy=cut( ($2+1)/2 ,0,1); +); +spanx=x/ww; +spany=y/hh; +nx=(1-((cx*(1-spanx))*spanx+(1-spanx)*(cx*spanx+(1-spanx))))*ww; +ny=(1-((cy*(1-spany))*spany+(1-spany)*(cy*spany+(1-spany))))*hh; +I(nx,ny,z,2);" +#@cli rep_pw: eq. to 'rep_point_warp' +rep_pw: rep_point_warp $* +#@cli rep_point_warp: 0%<=_pointwidth(%)<=100%,0%<=_distance(%)<=100%,0%,_radialInfluence<=100%,-1>=_distortion_center_x>=1,-1>=_distortion_center_y>=1,-360>=_distortion_angle>=360,_boundary={ 0=none | 1=neumann | 2=periodic | 3=mirror } +#@cli : Distorts image around a point. If you're using large radius, radialInfluence is not recommended to be set to 100%. +#@cli : (eq. to 'rep_pw')\n +#@cli : Default values: '_pointwidth=10%','_distance=10%','_radialInfluence=0%','_distortion_center_x=0','_distortion_center_y=0','_distortion_angle=0','_boundary=3' +rep_point_warp: +skip ${1=10},${2=10},${3=0},${4=0},${5=0},${6=0},${7=3} +f "begin( +eucl_norm(a,b)=sqrt(a^2+b^2); +const scaled_img_diagonal=eucl_norm(w,h)*$2; +const radius=log2((10^(abs($3)*300))*1000)*e; +const lograd=log(radius^($1*(.25*min(w,h)))); +const hw=w/2; +const hh=h/2; +const angle=($6/180)*pi+pi; +const ox=cos(angle)*scaled_img_diagonal; +const oy=sin(angle)*scaled_img_diagonal; +const dx=$4*hw; +const dy=$5*hh; +); +xd=x-dx; +yd=y+dy; +radinf=radius^(-(((xd-hw)/lograd)^2+((yd-hh)/lograd)^2)^2); +rx=(ox*radinf)+x; +ry=(oy*radinf)+y; +I(rx,ry,z,2,$7);" +#@cli rep_rand_sqrrecfill: eq. to 'rep_random_square_rectangle_fill' +rep_rand_sqrrecfill: rep_random_square_rectangle_fill $* +#@cli rep_random_square_rectangle_fill: _palette,square_dimension>0,_rectangle_max_length_1>0,_rectangle_max_length_2>0,_erode,_output={ 0=none | 1=line },_reduce_nonrectangles={ 0=do_not_reduce_nonrectagles | 1=reduce_nonrectangles },_remove_black_from_palette={ 0=preserve | 1=remove },_seed,_colourspace, +#@cli : Create texture with aligned rectangle and squares with colors being optional. +#@cli : (eq. to 'rep_rand_sqrrecfill') +#@cli : Default values: '_palette=0','_rectangle_length_2=1','_frequency_of_rectangle=1','_erode=0','_output=1','_reduce_nonrectangles=1','_remove_black_from_palette=1','_seed=','_colourspace=6', +#@cli : Author: Reptorian. +rep_random_square_rectangle_fill: +skip ${1=0},${3=2},${4=1},${5=1},${6=0},${7=1},${8=1},${9=1},${10=},${11=0} +cs2rgb=${arg\ 1+$11,,ryb2rgb,hsi82rgb,hsl82rgb,hsv82rgb,lab82rgb,lch82rgb,yiq82rgb,yuv82rgb} +bool_state_pal=0 +rand_pal=0 +if narg($1) +if isint($1)&&isnum($1) +if $1>0||$1<0 +bool_state_pal=1 +text_mode=0 +fi +else +if narg($1) +bool_state_pal=1 +text_mode=1 +fi +fi +fi +rep_rand_sqrrectex ${2-6},{$bool_state_pal?(($1>0||$1<0)&&abs($7)?3:1):2},$8,$10 +if $bool_state_pal +if narg($10) srand $10 fi +r. 100%,100%,100%,3 +if $text_mode ++pal $1 +else +if $1<0 {iM},1,1,3,u(0,255) +if $11 $cs2rgb fi +rand_pal=1 +else +pal $1 +fi +fi +if $9 +local[-1] { +s x +foreach { if !{ia} rm fi } +a x +} +fi +if !$rand_pal +{w#-1},1,1,1,u(0,1) +pixelsort.. +,x,. +rm. +fi +if !$7 +.. 1 fi +f.. i0?i(#-1,i0-1,y,0,c,0,2) +rm. +fi +#@cli rep_rand_sqrrecart: eq. to 'rep_random_square_rectangle_texture' +rep_rand_sqrrecart: rep_random_square_rectangle_artistic $* +#@cli rep_random_square_rectangle_artistic: square_dimension>0,_rectangle_max_length_1>0,_rectangle_max_length_2>0,_frequency_of_rectangle>0,_erode,_output={ 0=none | 1=line },_reduce_nonrectangles={ 0=do_not_reduce_nonrectagles | 1=reduce_nonrectangles },_distance_mode={ 0=regular_output | 1=distance_output },_seed,_output_resized={ 0=do_not_output_resized_original | 1=output_resized },_colourspace +#@cli : Create artistic rendering of image with aligned rectangle and squares. +#@cli : (eq. to 'rep_rand_sqrrecart') +#@cli : Default values: '_rectangle_max_length_1=2','_rectangle_length_2=1','_frequency_of_rectangle=1','_erode=0','_output=2','_reduce_nonrectangles=0','_seed=','_output_resized=0',_colourspace=0' +#@cli : Author: Reptorian. +rep_random_square_rectangle_artistic: +skip ${2=2},${3=1},${4=1},${5=0},${6=1},${7=1},${8=0},${9=},${10=0},${11=0} +convert_back=0 +tcr=3 +different_dimension=0 +converts_colors_fwd=${arg\ $11,rgb2ryb,error,rgb2hcy,rgb2hsl,rgb2hsv,rgb2lab,rgb2lch,rgb2ycbcr,rgb2ycbcrglic,rgb2yiq,rgb2yuv,rgb2xyz} +if $!>1 +cw={w#1} +ch={h#1} +iter=1 +do +iter-=1 +if (w#$iter!=$cw)||(h#$iter!=$ch) different_dimension=1 fi +iter+=2 +cw={w#$iter} +ch={h#$iter} +while !$different_dimension&&$iter<$! +fi +if $different_dimension +foreach { rep_rand_sqrrectex ${1-5},{$6?2:1},$7,$9 } +else +rep_rand_sqrrectex ${1-5},{$6?2:1},$7,$9 +rep_aspect_crop_2d[^-1] {w#-1},{h#-1} +r[^.] {w#-1},{h#-1},100%,100%,2,2,.5,.5 +if $8 ++distance.. 0 ++blend[-2,-1] shapemax0 +/.. . +rm. +store. distance +fi +store. art_shape +repeat $! { +local [$<] { +if (s==3||s==4)&&$11 +convert_back=1 +if $11!=2 +sh 0,2 +$convert_colors_fwd. +rm. +else +if s==3 rgb2cmyk tcr+=1 +elif s==4 s c,-3 rgb2cmyk.. a c +fi +fi +fi +if $10 +store output_resized fi +$art_shape +} +} +fi +#@cli rep_rand_sqrrectex: eq. to 'rep_random_square_rectangle_texture' +rep_rand_sqrrectex: rep_random_square_rectangle_texture $* +#@cli rep_random_square_rectangle_texture: square_dimension>0,_rectangle_max_length_1>0,_rectangle_max_length_2>0,_frequency_of_rectangle>0,_erode,_output={ 0=none | 1=filled_gray | 2=filled_line | 3=labeled_filled_line },_reduce_nonrectangles={ 0=do_not_reduce_nonrectagles | 1=reduce_nonrectangles },_seed +#@cli : Create a texture with aligned rectangle and squares. +#@cli : (eq. to 'rep_rand_sqrrectex') +#@cli : Note: '_reduce_nonrectangles' cannot be used to completely clear vectors of nonrectangle due to the algorithm provided, and no solution in context of vector exist as of now. +#@cli : Default values: '_rectangle_max_length=1','_rectangle_max_length=2','_frequency_of_rectangle=1','_erode=0','_output=2','_reduce_nonrectangles','_seed=' +#@cli : Author: Reptorian. +rep_random_square_rectangle_texture: +skip ${2=2},${3=1},${4=1},${5=0},${6=2},${7=1},${8=} +if narg($8) srand $8 fi +square_size=$1 +rf=0 +if abs($5) +if $5>0 square_size+={abs($5)} +else square_size+=1 +fi +fi +if $1<2 error ""$"1>1==F" fi +mw=${-max_w} +mh=${-max_h} +nvw={ceil($mw/$square_size)} +nvh={ceil($mh/$square_size)} +$nvw,$nvh,1,1,"x+y*w" +if abs(round($2))==1&&abs(round($3))==1 error ""$"2>1||"$"3>1==F" fi +msize={abs($2)+sqr(round(abs($3)))} +if $1<2 error ""$"2>1==F" fi +freq={int(avg(1/$msize,$4,.5)*(iM+1))} +val={iM+1} +repeat round($freq) { +orientation={round(u(0,1))} +nsl_1={round(u(1,abs($2)))} +nsl_2={round(u(1,abs($3)))} +min_nsl={min($nsl_1,$nsl_2)} +max_nsl={max($nsl_1,$nsl_2)} +if $min_nsl==1&&$max_nsl==1 max_nsl={round(u(2,abs(max($2,$3))))} fi +px={round(u(0,w#-1-1))} +py={round(u(0,h#-1-1))} +if $orientation $min_nsl,$max_nsl,1,1,$val j.. .,$px,$py rm. +else $max_nsl,$min_nsl,1,1,$val j.. .,$px,$py rm. +fi +val+=1 +} +label. 0,0 +if $7&&($2>1&&$3>1) +if max($2,$3)>2 +rf={max($2,$3)-2} +fi +repeat 2+$rf { +mirror. x +f. " +topleft = j(-1,-1); +topmiddle = j(0,-1); +topright = j(1,-1); +middleleft = j(-1,0); +middle = i; +middleright = j(1,0); +bottomleft = j(-1,1); +bottommiddle = j(0,1); +bottomright = j(1,1); +F=i; +if( +( (avg(topmiddle,middleleft)==middle) +|| (avg(topmiddle,middleright)==middle) +|| (avg(bottommiddle,middleleft)==middle) +|| (avg(bottommiddle,middleright)==middle) +) +|| +( (avg(middleleft,topmiddle,middleright)==middle) +|| (avg(middleleft,bottommiddle,middleright)==middle) +|| (avg(bottommiddle,middleleft,topmiddle)==middle) +|| (avg(bottommiddle,middleright,topmiddle)==middle) +) +|| +( (avg(bottommiddle,bottomright,middleright)==middle) +|| (avg(bottommiddle,bottomleft,middleleft)==middle) +|| (avg(topmiddle,topright,middleright)==middle) +|| (avg(topmiddle,topleft,middleleft)==middle) +) +,F*=-1; +); +F;" +label. 0,0 +} +fi +if $6 +{$nvw*$square_size+2},{$nvh*$square_size+2},1,1,i(#-1,floor(x/$square_size),floor(y/$square_size),z,0,0,1) rm.. r. {w-1},{h-1} +if $6>1 r2dx {(($1+1)/$1)*100}%,1 fi +if $6>1 f. "(x!=0&&x!=w-1&&y!=0&&y!=h-1)?(i(x-1,y-1,z,c,0,1)==i(x,y))*((i(x-1,y,z,c,0,1)==i(x,y))&&(i(x,y-1,z,c,0,1)==i(x,y))):0" +if $5 erode. {$5<0?(abs($5)>$1?$1:abs($5)):abs($5)} expand_xy. {int(abs($5)/2)},1 if !($5%2) r. {w-1},{h-1} fi fi +fi +if $6>2 label_fg. 0,0 fi +if $6<2 r. {w-1},{h-1} fi +fi +#@cli rep_gradf: eq. to 'rep_graduated_filter' +rep_gradf: rep_graduated_filter $* +#@cli rep_graduated_filter: 00,_xpan,_ypan,_colrange>0,_factor_a,_factor_b,_factor_c,_factor_d,_expf>0,_depth>0,_bgfreq>0,-360<=_colang<360,_alternate_colfunc={ 0=Regular | 1=Alternate },_symmetry={ 0=Regular | 1=Symmetrical },_alternate_channels +#@cli : Near direct conversion of MadJik's Newton Fractal Paint.NET plugin. This is a early beta filter. Unlike Paint.NET version, every variables are float-based except for last two. +#@cli : (eq. to 'rep_mj_newf') +#@cli : Default values: '_zoom=16','_xpan=0','_ypan=0','_colrange=128','_factor_a=9','_factor_b=0','_factor_c=75','_factor_d=5','_expf=10','_depth=50','_bgfreq=50','_colang=45','_alternate_colfunc=0','_symmetry=0' +rep_madjik_newton_fractal: +skip ${1=16},${2=0},${3=0},${4=128},${5=9},${6=0},${7=75},${8=5},${9=10},${10=50},${11=50},${12=45},${13=0},${14=0},${15=0} +foreach { +ww,hh={[w,h]} +r {max(w,h)*2},{max(w,h)*2},1,3 +f " +begin( +const zoom=$1/100; +const fvar_b=8/9+$6/1000; +const fvar_c=$7/10; +const fvar_d=$8/10; +const afc=fvar_c*$5; +const afd=afc*fvar_d; +const bgfreq=$11/100; +const ang=$12/180*pi; +const fexp=10^-$9; +funcb(w,t)=128+$4*sin(($15?(2-c)/2:c/2)*pi+(bgfreq*(ang+t+w*pi/180))); +func(w,t)=128+$4*sin(($15?(2-c)/2:c/2)*pi+(bgfreq*(ang+(t+w)*pi/180))); +); +ex=sqr((x-w/2)-$2/100); +ey=sqr((y-h/2)-$3/100); +ix=(x-w/2)*100/(zoom*w)-$2/100; +iy=(y-h/2)*100/(zoom*h)-$3/100; +for(k=1,k<$10,++k, +ix_2=ix*ix; +ix_3=ix_2*ix; +ix_4=ix_3*ix; +ix_5=ix_4*ix; +ix_6=ix_5*ix; +ix_7=ix_6*ix; +ix_8=ix_7*ix; +iy_2=iy*iy; +iy_3=iy_2*iy; +iy_4=iy_3*iy; +iy_5=iy_4*iy; +iy_6=iy_5*iy; +iy_7=iy_6*iy; +iy_8=iy_7*iy; +endval=(ix_2+iy_2)/2; +repeat(3,m,endval*=endval;); +ny=fvar_b*iy-($5*ix_7*iy-afc*ix_5*iy_3+afc*ix_3*iy_5-$5*ix*iy_7)/endval; +nx=fvar_b*ix+(ix_8-afd*ix_6*iy_2+2.5*afd*ix_4*iy_4-afd*ix_2*iy_6+iy_8)/endval; +if((abs(nx-ix)1,_mode={ 0=soft_regular | 1=soft_average_channels | 2=hard_regular | 3=hard_average_channels },_colourspace,_alpha +#@cli : Calculate whether to erode or dilate pixels using average. +#@cli : (eq. to 'rep_major_t').\n +#@cli : Custom Colour Space values can be specified with negative number for $3\n +#@cli : Primary Source: https://web.archive.org/web/20080214191501/http://interstices.info/display.jsp?id=c_27035 +#@cli : Secondary Source: https://forums.getpaint.net/topic/3978-majority-color-effect-ymd100726/\n +#@cli : Default values: '_mode=0','_colourspace=0','_alpha=0' +#@cli : Author: Reptorian. +rep_majority: +skip ${2=0},${3=0},${4=0} +if ($3>=0&&$3<=4)||($3==13||$3==14) colour="0,255" +elif $3>=5||$3<=8 colour="0,360,0,1,0,1" +elif $3==9 colour="0,100,-100,100,-100,100" +elif $3==10 colour="0,100,0,100,-pi,pi" +elif $3==11 colour="0,255,-100,100,-100,100" +elif $3==12 colour="0,1,-1,1,-1,1" +elif $3==15 colour="0,1,0,1,0,1" +elif $3==16 colour="0,255,-127.5,127.5,-127.5,127.5" +elif $3==17 colour="0,255,-170,85,-170,85" +elif $3==18 colour="0,765,-255,255,-510,255" +elif $colour<0 colour=${5--1} +fi +tcr=3 +mergeback=0 +convert_colors_fwd=${arg\ 1+$3,rgb,rgb2srgb,rgb2ryb,rgb2cmy,rgb2cmyk,rgb2hcy,rgb2hsi,rgb2hsl,rgb2hsv,rgb2lab,rgb2lch,rgb2yiq,rgb2yuv,rgb2ycbcr,rgb2xyz,rgb2yes,rgb2k1,rgb2ohta} +convert_colors_bwd=${arg\ 1+$3,rgb,srgb2rgb,ryb2rgb,cmy2rgb,cmyk2rgb,hcy2rgb,hsi2rgb,hsl2rgb,hsv2rgb,lab2rgb,lch2rgb,yiq2rgb,yuv2rgb,ycbcr2rgb,xyz2rgb,yes2rgb,k12rgb,ohta2rgb} +foreach { +ss={s} +if (s==3||s==4)&&$3 +convert_back=1 +if $3!=4 +$convert_colors_fwd. +else +if s==3 rgb2cmyk tcr+=1 +elif s==4 s c,-3 rgb2cmyk.. a c +fi +fi +fi +if $4&&(s>$tcr||s==2) s c,-{s-1} mergeback=1 fi +l[0] { ++boxfilter[0] $1 +if $2==1||$2==3 compose_channels. add /. $ss fi ++erode[0] $1 ++dilate[0] $1 +if $2==3 f[0] "begin(const ts=s*2;if("$4",mm=vectorts("$colour",0,255);,mm=vectorts("$colour");););i=2,0<=tolerance[%]<=100,_booldir={ 0=less_than | 1=greater_than },_alpha,_mode={ 0=soft | 1=hard },_colorspace +#@cli : Calculate whether to erode or dilate based on specified threshold. +#@cli : (eq. to 'rep_major_t').\n +#@cli : Custom Colour Space values can be specified with negative number for $6\n +#@cli : Primary Source: https://web.archive.org/web/20080214191501/http://interstices.info/display.jsp?id=c_27035 +#@cli : Secondary Source: https://forums.getpaint.net/topic/3978-majority-color-effect-ymd100726/\n +#@cli : Default values: '_booldir=0','_mode=1','_alpha','_colourspace', +rep_majority_threshold: +skip ${3=0},${4=1},${5=0},${6=0} +remove_image=0 +if $1<2 error ""$1">2==F" fi +if ($5>=0&&$5<=4)||($5==13||$5==14) colour="0,255" +elif $5>=5||$5<=8 colour="0,360,0,1,0,1" +elif $5==9 colour="0,100,-100,100,-100,100" +elif $5==10 colour="0,100,0,100,-pi,pi" +elif $5==11 colour="0,255,-100,100,-100,100" +elif $5==12 colour="0,1,-1,1,-1,1" +elif $5==15 colour="0,1,0,1,0,1" +elif $5==16 colour="0,255,-127.5,127.5,-127.5,127.5" +elif $5==16 colour="0,255,-127.5,127.5,-127.5,127.5" +elif $5==17 colour="0,255,-170,85,-170,85" +elif $5==18 colour="0,765,-255,255,-510,255" +elif $5<0 colour=${7--1} +fi +if $5<0 if $#<6 error ""$#">6==F" fi fi +tcr=3 +if $5 +convert_colors_fwd=${arg\ $5,rgb2srgb,rgb2ryb,rgb2cmy,error,rgb2hcy,rgb2hsi,rgb2hsl,rgb2hsv,rgb2lab,rgb2lch,rgb2yiq,rgb2yuv,rgb2ycbcr,rgb2ycbcrglic,rgb2xyz,rgb2yes,rgb2k1,rgb2ohta} +convert_colors_bwd=${arg\ $5,srgb2rgb,ryb2rgb,cmy2rgb,error,hcy2rgb,hsi2rgb,hsl2rgb,hsv2rgb,lab2rgb,lch2rgb,yiq2rgb,yuv2rgb,ycbcr2rgb,ycbcrglic2rgb,xyz2rgb,yes2rgb,k12rgb,ohta2rgb} +fi +foreach { +if (s==3||s==4)&&$5 +convert_back=1 +if $5!=4 +$convert_colors_fwd. +else +if s==3 rgb2cmyk tcr+=1 +elif s==4 s c,-3 rgb2cmyk.. a c +fi +fi +fi +if !$6&&(s>$tcr||s==2) sh. 0,{s-2} remove_image=1 fi +f. "begin( +const dc=($1-1)/2; +const kern=dc*2+1; +const ts=s*2; +NEW_COL=vectors(0); +if($6,mm=vectorts("$colour",0,255);,mm=vectorts("$colour");); +skip=1; +); +repeat(s,ss, +N=crop(x-dc,y-dc,0,ss,kern,kern,1,1,1); +min_val=min(mm[ss*2],mm[ss*2+1]); +max_val=max(mm[ss*2],mm[ss*2+1]); +tolerance=$2*(max_val-min_val)+min_val; +if(skip, +if($3, +if($4 +,calc_newcol()=i(x,y,z,ss)tolerance?min_val:max_val; +,calc_newcol()=i(x,y,z,ss)>tolerance?min(N):max(N); +); +); +--skip; +); +NEW_COL[ss]=calc_newcol(); +); +NEW_COL; +end(if(!skip, +if($3, +if($4 +,calc_newcol()=i(x,y,z,ss)tolerance?min_val:max_val; +,calc_newcol()=i(x,y,z,ss)>tolerance?min(N):max(N); +); +); +); +);" +if $remove_image rm. fi +if $convert_back +if $5!=4 +$convert_colors_bwd. +else +if s==4 cmyk2rgb tcr-=1 +elif s==5 s c,-4 cmyk2rgb.. a c +fi +fi +fi +} +#@cli rep_pstrk: eq. to 'rep_perspective_streak' +rep_pstrk: rep_perspective_streak $* +#@cli rep_perspective_streak: -1<=_xpos<=1,-1<=_ypos<=1,-1<=_alpha_exponential_factor,0<_distance_threshold<=1,0<_distance_start<=1,_direction={ 0=in | 1=out },_streak_mode={ 0=color | 1=gray | 2=binary | 3=gray+binary },_preserve_edges={ 0=do_not_preserve_edges | 1=preserve_edges },_alpval +#@cli : Create perspective streak effect. _preserve_details only is applicable on non-binary mode. +#@cli : (eq. to 'rep_pstrk').\n +#@cli : Default values: '_xpos=0','_ypos=0','_alpha_exponential_factor=1','_distance_threshold=1','_distance_start=0','_direction=0','_streak_mode=0','_preserve_edges=1','_alpval'\n +#@cli : Author: Reptorian. +rep_perspective_streak: +skip ${1=0},${2=0},${3=0},${4=1},${5=0},${6=0},${7=0},${8=1},${9=} +point={[$1,$2]} +if !$4 error "$4|"$"4>0" fi +foreach +if s!=3 +echo "Applying perspective streak at coordinate point $point!" +if h>w orientation=1 +else orientation=0 +fi +if s>1 +sh. 0,{s-2} +sh.. {s} +f. ":begin( +const cols=s#-2; +); +targ=0; +!i?( +v=vectorcols(0); +vb=J(#-2,0,-1); +vd=J(#-2,-1,0); +vf=J(#-2,1,0); +vh=J(#-2,0,1); +j(0,-1)?(++targ;v+=vb;); +j(-1,0)?(++targ;v+=vd;); +j(1,0)?(++targ;v+=vf;); +j(0,1)?(++targ;v+=vh;); +targ?(v/=targ;I(#-2)=v;); +0; +):i;" +rm[-2,-1] +fi +rep_recpoltrans $point,-3 +if $5>0&&$5<1 f begin(sy=1/(((1-$5)*h)/h););i(x,y*sy,z,c,2); fi +if $7||s==1 +channels {s-1} +if $8 +if $7==3||$7==1 . n. 0,1 l. +f 1 rv a c done store. details +else echo "Details cannot be preserved using binary mode!" +fi +fi +rep_axis_streak 1,!$6,$3,$9 +if $4>0&&$4<1 +f i>(1-$4)?i:(1-$4) +n 0,1 +fi +if $7==2 f i>0?1:0 +elif $7==3 +f i>0?1:0 a c fi +if $8 +if $7==3||$7==1 +$details +s. c,-{s-1} +j[-3] [-2],0,0,0,0,1,[-1],1 +rm[-2,-1] +fi +fi +else +if $8 +store details fi +if $4>0&&$4<1 ++channels {s-1} +rep_axis_streak. 1,!$6,$3,$9 +f. i>(1-$4)?i:(1-$4) +f. i>im#-1?1:0 +fi +rep_axis_streak[0] 1,!$6,$3,$9 +if $4>0&&$4<1 +sh[0] {s#0-1} +f. i0#-2*i +k[0] +fi +if $8 +$details +s. c,-{s-1} +j[-3] [-2],0,0,0,0,1,[-1],{iM#-1} +rm[-2,-1] +fi +fi +rep_recpoltrans $point,2,$orientation +else echo "Not applicable to images with 3 channels!" +fi +done +#@cli rep_axis_streak: orientation,direction,_alpha_exponential_factor,_maxval>0_cmykmode={ 0=non-cmyk | 1=cmyka_mode } +#@cli : Streaks pixels based on distance away from center and placement of visible objects. +#@cli : '_alpha_exponential_factor' is used to manipulate the alpha mixing within pixels. The more power that is assigned to the alpha, the more mixing there would be. +#@cli : '_maxval' divides the alpha channel internally to normalize ranges to 0-1. A error will appear if not normalized. By default, it used the max alpha channel value. +#@cli : '_cmykmode' is only used in case of using only cmyk images. Not needed in normal cases at all. +#@cli : Default values: '_alpha_exponential_factor=0','_maxalp=n/a','_cmykmode=0' +#@cli : +#@cli : Author: Reptorian. +rep_axis_streak: +skip ${3=0},${4=},${5=0} +foreach { +if s==1 rep_axis_streak_distance $* +else rep_axis_streak_color $* +fi +} +#@cli rep_axis_streak_distance: orientation,direction,_alpha_exponential_factor,_maxval +#@cli : Extract the alpha, then streaks pixels based on distance away from center and placement of visible objects. +#@cli : '_alpha_exponential_factor' is used to manipulate the alpha mixing within pixels. The more power that is assigned to the alpha, the more mixing there would be. +#@cli : '_maxval' divides the alpha channel internally to normalize ranges to 0-1. A error will appear if not normalized. By default, it used the max alpha channel value. +#@cli : Default values: '_alpha_exponential_factor=0','_maxalp=n/a' +#@cli : +#@cli : Author: Reptorian. +rep_axis_streak_distance: +skip ${3=0},${4=} +foreach { +sh {s-1} +if !iv#-1 rm. break else rm. fi +if s>1 channels {s-1} fi +if narg($4) alp={abs($4)} +else alp={iM#-1} +fi +/ $alp +if iM>1||im<0 error alpval(valid)==F fi +if $3<=-1 exp_f=-{1-10^-8} else exp_f=$3 fi +f i^(1+$exp_f) +if $1 +outdata_dim={w},1,{d},1 +outdata_coords=x,yy,z +outdata_dimref=hh +outdata_pos=yy +if $2 +direction=yy=hh,yy>0,--yy +end_level=yy +else +direction=yy=0,yy0,--xx +end_level=xx +fi +fi +$outdata_dim,":begin( +const ww=w#0-1; +const hh=h#0-1; +); +mode=0; +for("$direction", +imgval=i(#-1,"$outdata_coords"); +!mode?(imgval?mode=1;); +mode==1?(z_level="$outdata_dimref";mode=2;alp=imgval;); +mode==2?( +alp=alp+(1-alp)*imgval; +z_level="$end_level"*imgval+(1-imgval)*z_level; +i(#-1,"$outdata_coords")="$end_level"/z_level*alp; +); +);" +rm. +} +#@cli rep_axis_streak_color: orientation,direction,_alpha_exponential_factor,_maxval>0,_add2new={ 0=add2old | 1=add2new },_cmykmode={ 0=non-cmyk | 1=cmyka_mode } +#@cli : Streaks colored pixels taking into account of opacity. +#@cli : '_alpha_exponential_factor' is used to manipulate the alpha mixing within pixels. The more power that is assigned to the alpha, the more mixing there would be. +#@cli : '_maxval' divides the alpha channel internally to normalize ranges to 0-1. A error will appear if not normalized. By default, it used the max alpha channel value. +#@cli : '_add2new' defines whether to streak data on old image or to streak pixel data onto a new image. Used for Perspective Streak. +#@cli : '_cmykmode' is only used in case of using only cmyk images. Not needed in normal cases at all. +#@cli : Default values: '_alpha_exponential_factor=0','_maxalp=n/a','_cmykmode=0' +#@cli : +#@cli : Author: Reptorian. +rep_axis_streak_color: +skip ${3=0},${4=},${5=0},${6=0} +tcr=3 +if $6 tcr+=1 fi +if narg($4) if $4==0 return fi fi +foreach { +if s==1||s==$tcr break fi +vv=0 +repeat s { +sh $> +vv+={iv#-1} +rm. +} +if !$vv break fi +sh. 0,{s-2} +sh.. {s} +f.. i#-1?I +if narg($4) alp={abs($4)} +else alp={iM#-1} +fi +/. $alp +if iM#-1>1||im#-1<0 error alpval(valid)==F fi +if $3<=-1 exp_f=-{1-10^-8} else exp_f=$3 fi +f. i^(1+$exp_f) +if $1 +outdata_dim={w},1,{d},{s#0} +outdata_coords=x,yy +if $2 direction=yy=hh-1,yy>=0,--yy +else direction=yy=0,yy=0,--xx +fi +fi +if $5 {w#0},{h#0},{d#0},{s#0} +col_info=-3 +alp_info=-2 +targ_info=#-1 +outdata_gen_1=I($targ_info,$outdata_coords,z)=temp; +else +col_info=-2 +alp_info=-1 +targ_info=#0 +outdata_gen_0=I($targ_info,$outdata_coords,z)=temp; +fi +$outdata_dim,":begin( +const ww=w#0; +const hh=h#0; +); +start_val=1; +for("$direction", +start_val?( +start_val=0; +col=I(#"$col_info","$outdata_coords",z); +alp=i(#"$alp_info","$outdata_coords",z,0); +temp=[col,alp]; +):( +newcol=I(#"$col_info","$outdata_coords",z); +newalp=i(#"$alp_info","$outdata_coords",z,0); +newinfo=[newcol,newalp]; +!newalp?(I("$targ_info","$outdata_coords",z)=temp;): +newalp==1?(temp=newinfo; +):( +"$outdata_gen_1" +col=newcol*newalp+(1-newalp)*col; +alp=alp+newalp*(1-alp); +temp=[col,alp]; +"$outdata_gen_0" +); +); +);" +if $5 rm[^-2] +else rm[1-3] +fi +sh. {s-1} +*. $alp +rm. +} +#@cli rep_mn: eq. to 'rep_multinormalize' +rep_mn: rep_multinormalize $* +#@cli rep_multinormalize: values +#@cli : Normalize based on channels using values. +#@cli : (eq. to 'rep_mn').\n +#@cli : Author: Reptorian. +rep_multinormalize: +$=a +foreach { +repeat s { +val_a=${a{$>*2+1}} +val_b=${a{$>*2+2}} +sh $> +normalize. $val_a,$val_b +rm. +} +} +#@cli rep_mc: eq. to 'rep_multicut' +rep_mc: rep_multicut $* +#@cli rep_multicut: values +#@cli : Cut based on channels using values. +#@cli : (eq. to 'rep_mc').\n +#@cli : Author: Reptorian. +rep_multicut: +$=a +foreach { +repeat s { +val_a=${a{$>*2+1}} +val_b=${a{$>*2+2}} +sh $> +cut. $val_a,$val_b +rm. +} +} +#@cli rep_cr: eq. to 'rep_cr'. +rep_cr: rep_channels_range +#@cli rep_channels_range: +#@cli : Return the minimal and maximum values per channels in a image.\n +#@cli : Author: Reptorian. +rep_channels_range: +if $!>1 error "Cannot be used on more than 1 images!" fi +num_chans={s} +repeat $num_chans { shared[0] $> } +u {expr('p=1+(x>>1);x&1?iM#p:im#p;',$num_chans<<1)} +rm[-$num_chans--1] +#@cli rep_ol: eq. to 'rep_orientation_list'. +#@cli : Return dimensions of selected images. +rep_ol: rep_orientation_list +#@cli rep_orientation_list: +#@cli : Return orientation of selected images. +#@cli : (eq. to rep_ol). +rep_orientation_list: u {expr('h#x>w#x',$!)} +#@cli rep_recpoltrans: eq. to 'rep_rectangular_polar_transformation'. +rep_recpoltrans: rep_rectangular_polar_transformation $* +#@cli rep_rectangular_polar_transformation : -1>=_xpos<=1,-1>=_ypos<=1,_from_to={ -3=to_inverted_rectangular_polar_preserved_details | -2=from_rectangular_polar_preserved_details_to_cartesian | -1=to_inverted_rectangular_polar | 0=to_rectangular_polar | 1=to_rectangular_polar_preserved_details| 2=from_preserved_details_inverted_rectangular_polar },orientation_0={ 0=landscape | 1=portrait },...,orientation_n +#@cli : Converts images to inversion of rectangular polar format or to rectangular polar format. Adapted for development of perspective filters. The first two variables defines the coordinates of revolution based on -1,1 ranges. 1,1 means the point of revolution is on top-right part of the image. +#@cli : (eq. to rep_recpoltrans).\n +#@cli : Note: When using 2 for $3, you need to define the orientation of every images. For every images, insert one argument per image after $3. +#@cli : Default values: '_xpos=0','_ypos=0','_from_to=0' +#@cli : +#@cli : Author: Reptorian. +rep_rectangular_polar_transformation: +skip ${1=0},${2=0},${3=0} +if $1<-1||$1>1 error "($1>=-1&&$1<=1)=0" fi +if $2<-1||$2>1 error "($2>=-1&&$2<=1)=0" fi +foreach { +ov=${-rep_cr} +if $3==-3 +maxlength={max(w,h)} +perimeter={(w+h)*2} +{$perimeter*2},{$maxlength*2},{d},{s},":begin( +const ww=w#0; +const hh=h#0; +const point_x=(($1*-1)*.5+.5)*ww; +const point_y=($2*.5+.5)*hh; +const inv_point_x=ww-point_x; +const inv_point_y=hh-point_y; +const cut_ang_s0=abs(atan2(inv_point_y,inv_point_x)*180/pi); +const cut_ang_s1=180-abs(atan2(inv_point_y,point_x)*180/pi); +const cut_ang_s2=180+abs(atan2(point_y,point_x)*180/pi); +const cut_ang_s3=360-abs(atan2(point_y,inv_point_x)*180/pi); +distanceaway(value)=( +value==0?ww-point_x: +value==1?hh-point_y: +value==2?point_x: +point_y; +); +); +surface_angle=(x/w)*360; +surface_angle>cut_ang_s0&&surface_angle<=cut_ang_s1?side=1: +surface_angle>cut_ang_s1&&surface_angle<=cut_ang_s2?side=2: +surface_angle>cut_ang_s2&&surface_angle<=cut_ang_s3?side=3: +side=0; +mdist=abs(side%2?1/sin((surface_angle/180)*pi):1/cos((surface_angle/180)*pi)); +dix=(point_x+cos((surface_angle/180)*pi)*distanceaway(side)*mdist*y/h)*((ww-1)/ww); +diy=(point_y+sin((surface_angle/180)*pi)*distanceaway(side)*mdist*y/h)*((hh-1)/hh); +I(#0,ww-(dix+1),hh-(diy+1),z,2); +" +k. +elif $3==-1||$3==-2 +f ":begin( +const point_x=(($1*-1)*.5+.5)*w; +const point_y=($2*.5+.5)*h; +const inv_point_x=w-point_x; +const inv_point_y=h-point_y; +const cut_ang_s0=abs(atan2(inv_point_y,inv_point_x)*180/pi); +const cut_ang_s1=180-abs(atan2(inv_point_y,point_x)*180/pi); +const cut_ang_s2=180+abs(atan2(point_y,point_x)*180/pi); +const cut_ang_s3=360-abs(atan2(point_y,inv_point_x)*180/pi); +distanceaway(value)=( +value==0?ww-point_x: +value==1?hh-point_y: +value==2?point_x: +point_y; +); +); +surface_angle=(x/w)*360; +surface_angle>cut_ang_s0&&surface_angle<=cut_ang_s1?side=1: +surface_angle>cut_ang_s1&&surface_angle<=cut_ang_s2?side=2: +surface_angle>cut_ang_s2&&surface_angle<=cut_ang_s3?side=3: +side=0; +mdist=abs(side%2?1/sin((surface_angle/180)*pi):1/cos((surface_angle/180)*pi)); +dix=(point_x+cos((surface_angle/180)*pi)*distanceaway(side)*mdist*y/h)*((w-1)/w); +diy=(point_y+sin((surface_angle/180)*pi)*distanceaway(side)*mdist*y/h)*((h-1)/h); +I(w-(dix+1),h-(diy+1),z,2); +" +if $3<-1 r2dx 50%,6 fi +elif $3==0||$3==1 +if $3>0 r2dx 200%,6 fi +f ":begin( +const ww=w-1; +const hh=h-1; +const sd=max(w,h)/min(w,h); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +const cx=.5+$1*.5; +const cy=.5+$2*.5; +const px=cx*w; +const py=(1-cy)*h; +const sxl=(w/2)/px; +const sxr=(w/2)/(w-px); +const syt=(h/2)/py; +const syb=(h/2)/(h-py); +); +atx=(x/ww-cx)*sx; +aty=(y/hh-(1-cy))*sy; +sur_atan=(atan2(aty,atx)+pi)/(2*pi); +xl=-1+(x/ww)*2*sxl; +xr=1-(1-x/ww)*2*sxr; +yt=-1+(y/hh)*2*syt; +yb=1-(1-y/hh)*2*syb; +xx=x>=px?xr:xl; +yy=y>=py?yb:yt; +sur_max=max(abs(xx),abs(yy)); +I(sur_atan*w,sur_max*h,z,2,2); +" +if $3>0 sharpen 2 fi +elif $3==2 +$=val +orientation=${val{$>+4}} +half_perimeter={w/2} +length_1={$half_perimeter-h} +length_2={$half_perimeter-$length_1} +if $orientation +width={min($length_1,$length_2)} +height={max($length_1,$length_2)} +else +width={max($length_1,$length_2)} +height={min($length_1,$length_2)} +fi +$width,$height,{d},{s},":begin( +const ww=w#0; +const hh=h#0; +const ox=$width; +const oy=$height; +const sd=max(ox,oy)/min(ox,oy); +if(w>h, +const sxf=ox>oy?sd:1; +const syf=ox>oy?1:sd; +, +const sxf=oxpx?xr:xl; +nyy=yy>py?yb:yt; +ay=max(abs(nxx),abs(nyy)); +ax=(atan2((yy/hh-(1-cy))*syf,(xx/ww-cx)*sxf)+pi)/(2*pi); +I(#0,abs(ax*ww),abs(ay*hh),z,2,1); +" +r2dx. 50%,6 +k. +else error "$3|"$"3!=intnum[-3,2]" +fi +rep_multicut $ov +} +#@cli rep_sd: eq. to 'rep_spiral_distort'. +rep_sd: rep_spiral_distort $* +#@cli rep_spiral_distort: _revolution!=0,_height!=0,_refraction>0,_direction={ 0=clockwise | 1=counterclockwise },_angle,_continuous_spiral={ 0=periodic | 1=continuous },-1<=_preshift_x<=1,-1<=_preshift_y<=1,_preshift_boundary={ 0=periodic | 1=mirror },_skew_x,_skew_y,_skew_m,_scale_coord_x,_scale_coord_y,_offx,_offy,_spiral_boundary={ 0=none | 1=neumann | 2=periodic | 3=mirror },_interpolation={ 0=nearest | 1=average | 2=linear | 3=bicubic | 4=lanczos } +#@cli : Transform images into spiral by using spiral gradient for x coordinate, and radial gradient for y coordinate. +#@cli : (eq. to 'rep_sd').\n +#@cli : '_revolution' defines the number of revolution within the spiral assuming coordinates range of [-1,1]. +#@cli : '_height' is the height of spiral. The higher the height of the spiral, the more duplicates will repeat within one revolution. +#@cli : '_refraction' refers to the logarithmic distortion within spiral. +#@cli : '_direction' determines if it clockwise or counter-clockwise. +#@cli : '_angle' determines the function angle. +#@cli : '_continuous_spiral' determines whether the spiral distortion is continuous or not. +#@cli : '_preshift_x' shifts the images before the spiral distortion along the x-axis. +#@cli : '_preshift_y' shifts the image before the spiral distortion along the y-axis. +#@cli : '_preshift_boundary' determines the boundary within the preliminary shift. +#@cli : '_skew_x' skews the distortion alongside the x-axis. It is recommended to keep ranges to -100% to 100%. +#@cli : '_skew_y' skews the distortion alongside the y-axis. It is recommended to keep ranges to -100% to 100%. +#@cli : '_skew_m' is the multiplier for skewing. +#@cli : '_scale_x' scales the coordinates alongside the x-axis. +#@cli : '_scale_y' scales the coordinates alongside the y-axis. +#@cli : '_offx' determines the offset-placement of the distortion alongside the x-axis. It is recommended to keep ranges to -100% to 100%. +#@cli : '_offy' determines the offset-placement of the distortion alongside the y-axis. It is recommended to keep ranges to -100% to 100%. +#@cli : '_spiral_boundary' determines how the out-of-bound values is to be evaluated. +#@cli : '_interpolation' determines the interpolation of the spiral distortion.\n +#@cli : Default values: '_frequency=1','_height=1','_refraction=0','_direction=0','_angle=0','_continuous_spiral=0','_preshift_x=0','_preshift_y=0','_preshift_boundary=0','_skew_x=0','_skew_y=0','_skew_m=1','_scale_x=1','_scale_y=1','_offx=0','_offy=0','_spiral_boundary=3','_interpolation=4'\n +#@cli : Author: Reptorian. +#@cli : $ sp car rep_spiral_distort 1,2,2,1,30,1,50%,50%,1,1,.25 +rep_spiral_distort: +skip ${1=1},${2=1},${3=0},${4=0},${5=0},${6=0},${7=0},${8=0},${9=0},${10=0},${11=0},${12=1},${13=1},${14=1},${15=0},${16=0},${17=3},${18=4} +if !$! v + error "No images to perform spiral distortion on" v - fi +if $1==0 v + error ""$"1/_revolution cannot be 0!" v - fi +if $2==0 v + error ""$"2/_height cannot be 0!" v - fi +if $3==-1 v + error ""$"3/_refraction cannot be -1!" v - fi +if !$13||!$14 v + error ""$"13/_scale_x and "$"14/_scale_y cannot be 0!" v - fi +v - +skew_m={abs(2*$12)} +direction=${arg\ $4+1,counterclockwise,clockwise} +spiral_mode=${arg\ $6+1,continuous,periodic} +periodic_boundary=${arg\ (abs($9)?1)+1,mirror,periodic} +spiral_boundary=${arg\ abs($17)+1,none,neumann,periodic,mirror} +interpolation=${arg\ abs($18)+1,nearest,average,linear,bicubic,lanczos} +if abs($7)||abs($8) preshift="Preshift of {$7*100}% alongside the x-axis, and {$8*100}% alongside the y-axis has been applied before the distortion using "$preshift_boundary" boundary condition." +else preshift="" +fi +v + +e[] "Apply spiral distortion at coordinates $15,$16 with scale factor of $13 within x-axis and $14 within y-axis and skew-"$skew_m" distortion utilizing factor of $10 within x-axis and factor of $11 within y-axis to images using "$direction" "$spiral_mode" spiral with revolution of $1, height of $2, refraction factor of $3 using "$spiral_boundary" boundary condition and "$interpolation" interpolation. "$preshift"" +v + +if abs($18)>1 r2dx 200%,{abs($18)>2?abs($18)+2:abs($18)+1} fi +if abs($7)||abs($8) +e[] "Apply of {$7*100}% alongside the x-axis, and {$8*100}% alongside the y-axis" +f "begin( +const offx=(w/2)*$7*-1; +const offy=(h/2)*$8; +const interpolation=abs($18)>2?2:abs($18); +const boundary=(abs($9)+2); +); +J(offx,offy,z,interpolation,boundary);" +fi +if $4 mirror x fi +f "begin( +const sd=max(w,h)/min(w,h); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +const ang=pi*($5*-1/180); +const skew_x=($10*-1)/abs($13); +const skew_y=$11/abs($14); +const skew_m=abs(2*$12); +const offx=-.5+($15*-1/2); +const offy=-.5+($16*-1/2); +const nw=abs(w*sin(ang))+abs(h*cos(ang)); +const nh=abs(w*cos(ang))+abs(h*sin(ang)); +const cos_ang=cos(ang); +const sin_ang=sin(ang); +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +const interpolation=abs($18)>2?2:abs($18); +const boundary=abs($17); +); +XX=(x/w+offx)*sx*$13; +YY=(y/h+offy)*sy*$14; +xx=(rot_x(XX,YY)*(skew_m^(rot_x(XX,YY)*skew_x)))*2; +yy=(rot_y(XX,YY)*(skew_m^(rot_y(XX,YY)*skew_y)))*2; +radial=norm(xx,yy); +if($4,sur_atan=1-(atan2(xx,yy)+pi)/(2*pi);,sur_atan=(atan2(xx,yy)+pi)/(2*pi);); +es=sur_atan+radial*$1; +es=es-floor(es); +if($6,es=(es>.5?1-es:es)*2;); +I((es^(1+$3))*w*$2,radial*h,z,interpolation,boundary);" +if abs($18)>1 r2dx 50%,{abs($18)>2?abs($18)+2:abs($18)+1} fi +v - +#@cli rep_fibo_fill: eq. to 'rep_fibonacci_fill' +rep_fibo_fill: rep_fibonacci_fill $* +#@cli rep_fibonacci_fill: stack={ 0= top-left | 1= top-right | 2= bottom-left | 3= bottom-right },output_mode={ 0=corner | 1=spiral }, _initial_orientation={ 0=landscape | 1=portrait },_iteration>=0,_int_scale>0,{ boundary={0=periodic | 1=mirror} | -1<=spiral_location_x<=1 },{ append_mode={ 0=x | 1=y } | -1<=spiral_location_y<=1 },_palette_cycle,negate,_[palette],_seed_a... +#@cli : Generated filled image of fibonacci. If you need a complete fibonacci to use as a base, then execute 'gmic h +rep_fibonacci' for more information. +#@cli : +#@cli : (eq. to 'rep_fibo_fill') +#@cli : 1) stack defines the stacking of the fibonacci spiral. The options that are provided represent initial vector or orientation of the fibonacci spiral. +#@cli : 2) output_mode defines the style of stacking of the fibonacci base. If it is 1, then it's a spiral, otherwise, corner stacking. +#@cli : 3) _initial_orientation defines the initial stacking of the first two iteration of the fibonacci. +#@cli : 4) _iteration defines the number of iteration. 0 will automatically find the number of iterations requires for the maximum 2 dimensions to fit in. +#@cli : 5) If _iteration==0, and _output_mode==1, this option would be spiral_location_x. Otherwise, it would become boundary which is only applicable for _iteration>0. +#@cli : 6) If _iteration==0, and _output_mode==1, this option would be spiral_location_y. Otherwise, it would become append_mode which is only applicable for _iteration>0. +#@cli : 7) _palette_cycle* defines the shift of palette. +#@cli : 8) _negate defines whether to invert the order of palette. +#@cli : 9) _[palette]* defines the palette to be used for filling the fibonacci. +#@cli : 10) _seed* would define the seed to be used for generating order. +#@cli : +#@cli : *=See rep_custom_map for more details on how these options would work. +#@cli : Default values: '_initial_orientation=0','_iteration=0','{ boundary={0=periodic | 1=mirror} | -1<=spiral_location_x<=1 }=0','{ append_mode={ 0=x | 1=y } | -1<=spiral_location_y<=1 }}=0','_palette_cycle=n/a','_[palette]=n/a','seed=n/a' +#@cli : +#@cli : Author: Reptorian +rep_fibonacci_fill: +skip ${3=1},${4=0},${5=1},${6=0},${7=0},${8=},${9=0},${10=} +check $!>0 +r 100%,100%,100%,1,-1 +timg={$!} +mw=${-max_w} +mh=${-max_h} ++rep_fibonacci ${1-5} +fibo_id={$!-1} +if $4 +if narg(${10--1})>1 +. +pass$10 0 +rep_custom_map[-3,-2] ${8--1} +rm. +else ++negate. +if $7<0 rv[-2,-1] fi +if narg($8,$9) rep_custom_map[-2,-1] $8,$9 fi +fi +if $6 +r.. 200%,200%,1,100%,0,3,1,1 +r. 200%,200%,1,100%,0,3,1,0 +fi +if ($7+($7<0))%2 a[-2,-1] x +else a[-2,-1] y +fi +nw={ceil($mw/w#-1)*w#-1} +nh={ceil($mh/h#-1)*h#01} +r. $nw,$nh,100%,100%,0,2,.5,.5 +repeat $!-1 { ++r. {w#$>},{h#$>},100%,100%,0,0,.5,.5 +rv[$>,-1] +rm. +} +else +if $2 +f[^-1] "begin( +const ww=w-1; +const hh=h-1; +const ox=(1+cut($6,-1,1))/2; +const oy=(1+cut($7,-1,1))/2; +const center_point=int($5/2); +const px=int(xm#-1+center_point-ww*ox); +const py=int(ym#-1+center_point-hh*oy); +); +i(#-1,px+x,py+y,z,0);" +else +if $1==0 j[^-1] [-1],0~,0~ +elif $1==1 j[^-1] [-1],1~,0~ +elif $1==2 j[^-1] [-1],0~,1~ +else j[^-1] [-1],1~,1~ +fi +fi +if narg(${8--1}) +if narg($10) +pass$10 0 +rep_custom_map[0--3] $8,$9,[-1],${11--1} +rm. +else +rep_custom_map[^-1] $8,$9 +fi +fi +fi +rm. +#@cli +rep_fibonacci: stack={ 0= top left | 1= top right | 2= bottom left | 3= bottom right }, output_mode={ 0=corner | 1=spiral }, _start_orientation={ 0=landscape | 1=portrait },_iteration>=0,int_scale>0 +#@cli : stack defines the way that the fibonacci generator will stack within iterations. +#@cli : output_mode defines the style of stacking. +#@cli : _start_orientation defines the orientation of the first two iteration. +#@cli : _iteration defines the number of iteration. 0 means it will auto-find the number of generation. +#@cli : +#@cli : Author: Reptorian ++rep_fibonacci: +skip ${3=0},${4=0},${5=1} +check "$5&&($5==int($5))" +dir={$1%4} +if $4==1 1 return fi +use_dim_lim={!$4} +if $4 +iter_lim=$4 +else +iter_lim=inf +mw=${-max_w} +mh=${-max_h} +fi +__size_n=2 +size_1=1 +size_2=2 +__iter=2 +command "swap: rv[-2,-1]" +command "join: a[-2,-1] $""1" +center_point={$5>1?int($5/2)} +if $5>1 +command "ins_north: ns={$__size_n*$5} $ns,$ns,1,1,$__iter swap join y" +command "ins_south: ns={$__size_n*$5} $ns,$ns,1,1,$__iter join y" +command "ins_west: ns={$__size_n*$5} $ns,$ns,1,1,$__iter swap join x" +command "ins_east: ns={$__size_n*$5} $ns,$ns,1,1,$__iter join x" +else +command "ins_north: $__size_n,$__size_n,1,1,$__iter swap join y" +command "ins_south: $__size_n,$__size_n,1,1,$__iter join y" +command "ins_west: $__size_n,$__size_n,1,1,$__iter swap join x" +command "ins_east: $__size_n,$__size_n,1,1,$__iter join x" +fi +na={$2?4:2} +if $3 +if $2 +if $1%2 1,2,1,1,1-y +else 1,2,1,1,y +fi +if $5>1 r2dx. {$5*100}%,1 fi +if $dir==0 ins_arg=ins_west,ins_south,ins_east,ins_north +elif $dir==1 ins_arg=ins_west,ins_north,ins_east,ins_south +elif $dir==2 ins_arg=ins_east,ins_south,ins_west,ins_north +else ins_arg=ins_east,ins_north,ins_west,ins_south +fi +else +if $dir<2 1,2,1,1,y +else 1,2,1,1,1-y +fi +if $5>1 r2dx. {$5*100}%,1 fi +if $dir==0 ins_arg=ins_east,ins_south +elif $dir==1 ins_arg=ins_west,ins_south +elif $dir==2 ins_arg=ins_east,ins_north +else ins_arg=ins_west,ins_north +fi +fi +else +if $2 +if $1%2 2,1,1,1,x +else 2,1,1,1,1-x +fi +if $5>1 r2dx. {$5*100}%,1 fi +if $dir==0 ins_arg=ins_north,ins_west,ins_south,ins_east +elif $dir==1 ins_arg=ins_north,ins_east,ins_south,ins_west +elif $dir==2 ins_arg=ins_south,ins_west,ins_north,ins_east +else ins_arg=ins_south,ins_east,ins_north,ins_west +fi +else +if $1%2 2,1,1,1,1-x +else 2,1,1,1,x +fi +if $5>1 r2dx. {$5*100}%,1 fi +if $dir==0 ins_arg=ins_south,ins_east +elif $dir==1 ins_arg=ins_south,ins_west +elif $dir==2 ins_arg=ins_north,ins_east +else ins_arg=ins_north,ins_west +fi +fi +fi +do +if $__iter==$iter_lim break fi +if $use_dim_lim +if w#-1>$mw&&h#-1>$mh +if $2 +if {" +center_point=$center_point; +mw=$mw; +mh=$mh; +xp=xm#-1+center_point; +yp=ym#-1+center_point; +lxp=xp-mw; +rxp=xp+mw; +typ=yp-mh; +byp=yp+mh; +cond_a=i(#-1,lxp,typ,0,0,0,0); +cond_b=i(#-1,rxp,typ,0,0,0,0); +cond_c=i(#-1,lxp,byp,0,0,0,0); +cond_d=i(#-1,rxp,byp,0,0,0,0); +cond_a&&cond_b&&cond_c&&cond_d; +"} break fi +else break +fi +fi +fi +${arg\ ($__iter%$na)+1,$ins_arg} +__size_n={$size_1+$size_2} +size_1=$size_2 +size_2=$__size_n +__iter+=1 +while $__iter<$iter_lim +uncommand swap,join,ins_north,ins_south,ins_west,ins_east +#@cli rep_gv: eq. to 'rep_glass_vignette'. +rep_gv: rep_glass_vignette $* +#@cli rep_glass_vignette: refraction,_refraction_power,_len_size=1,_chromatic_aberration,-100%<=_preliminary_shift_x<=100%,-100%<=_preliminary_shift_y<=100%,_image_additional_zoom>0,-360<=_image_angle<=360,_distortion_scale_x,_distortion_scale_y,_distortion_scale_xy>0,-360<=_distortion_angle<=360,_distortion_offset_x,_distortion_offset_y,_subpixel>0,0<=_colorspace<=1,_boundary={ 0=none | 1=neumann | 2=periodic | 3=mirror },_interpolation={ 0=nearest | 1=average | 2=linear | 3=grid | 4=bicubic | 5=lanczos } +#@cli : Distorts images as if it is based from the view of a bulged car mirror or camera len. This G'MIC filter is a heavily extended version of TR's Glass Vignette plugin made for Paint.NET by TechnoRobbo. It can also be used for generating abstract art as well. +#@cli : (eq. to 'rep_gv'). +#@cli : +#@cli : 'refraction' defines the strength of distortion. The farther the values from 0, the greater the distortion is. It is recommended to use percentage alongside a number. +#@cli : '_refraction_power' defines the distortion factor within the refraction. The farther the values from 0, the greater the distortion is. It is recommended to use percentage alongside a number. +#@cli : '_len_size' is the size of distortion accordingly to the terminal ends of the lens distortion. +#@cli : '_chromatic_aberration' is the degree of aberration within channels. The farther the values from 0, the greater the distortion per channels would be. It is recommended to use percentage alongside a number. +#@cli : '_preliminary_shift_x' is the preshift of images before the distortion effect. This is used in the original plugin. It is recommended to use percentage alongside a number. +#@cli : '_preliminary_shift_y' is the preshift of images before the distortion effect. This is used in the original plugin. It is recommended to use percentage alongside a number. +#@cli : '_image_additional_zoom' defines the scaling based on scaling of coordinates of image within the distortion effect. 0 starts with scaling of 1x, and 1 means scaling of 2x. +#@cli : '_image_angle' defines the angle of image within the distortion. +#@cli : '_distortion_scale_x' is the scaling of distortion within the x-axis. When this is set to 0, the ratio of image is used instead. 0 starts with scaling of 1x, and 1 means scaling of 2x. +#@cli : '_distortion_scale_y' is the scaling of distortion within the y-axis. When this is set to 0, the ratio of image is used instead. 0 starts with scaling of 1x, and 1 means scaling of 2x. +#@cli : '_distortion_scale_xy' is the scaling of distortion within the x and y axis at the same time. +#@cli : '_distortion_angle' is the angle of distortion effect. 0 starts with scaling of 1x, and 1 means scaling of 2x. +#@cli : '_distortion_offset_x' is the displacement of distortion within the x-axis. It is recommended to use percentage alongside a number. +#@cli : '_distortion_offset_y' is the displacement of distortion within the y-axis. It is recommended to use percentage alongside a number. +#@cli : '_subpixel' is the level of subpixel sampling to be used. +#@cli : '_colorspace' defines the color space of the image to process distortion on. +#@cli : '_boundary' defines how the out-of-bound areas is to be behave. +#@cli : '_interpolation' defines the interpolation within distortion. +#@cli : Default values: '_refraction_power=0','_lensize=1','_chromatic_aberration=0','_preliminary_shift_x=0','_preliminary_shift_y=0','_image_zoom=0','_image_angle=0','_distortion_scale_x=1','_distortion_scale_y=1','_distortion_scale_xy=1','_distortion_angle=0','_distortion_offset_x=0','_distortion_offset_y=0','_subpixel=1','_colorspace=0','_boundary=3','_interpolation=5', +#@cli : +#@cli : Author: Reptorian. +rep_glass_vignette: +skip ${1=100%},${2=0%},${3=100%},${4=0%},${5=0},${6=0},${7=0},${8=0},${9=100%},${10=100%},${11=100%},${12=0},${13=100%},${14=100%},,${15=1}${16=0},${17=3},${18=2} +convert_colors_fwd=${arg\ 1+$16,,rgb2srgb,rgb2ryb,rgb2cmy,,rgb2hcy,rgb2hsi,rgb2hsl,rgb2hsv,rgb2lab,rgb2lch,rgb2yiq,rgb2yuv,rgb2ycbcr,rgb2ycbcrglic,rgb2xyz,rgb2yes,rgb2k1} +convert_colors_bwd=${arg\ 1+$16,,srgb2rgb,ryb2rgb,cmy2rgb,,hcy2rgb,hsi2rgb,hsl2rgb,hsv2rgb,lab2rgb,lch2rgb,yiq2rgb,yuv2rgb,ycbcr2rgb,ycbcrglic2rgb,xyz2rgb,yes2rgb,k12rgb} +convert_back=0 +sub={1+abs($15)} +foreach { +v + +e[^-1] "Distorts image at angle of $12 with refraction factor of $1, chromatic aberration of $4, zoom factor of $7, preliminary shift of $5, preliminary shift of $6, scale x-axis distortion by $9 multiplied by $11, scale y-axis distortion by $10 multiplied by $11, refraction index by power of $2 placed at $13,$14 at angle of $8." +v - +if (s==3||s==4)&&$16 +convert_back=1 +if $16!=4 +$convert_colors_fwd. +else +if s==3 rgb2cmyk +elif s==4 s c,-3 rgb2cmyk.. a c +fi +fi +fi +shift $5,$6,0,0,$17 +r2dx {$sub*100}%,1 +f "*begin( +const abr=((1-$1)-.001)/.999; +const aberate=sqr(1*abr+(1-$4)*(1-abr)); +const offset_x=w/2*(1-$13); +const offset_y=h/2*(1-$14); +$9&&$10?( +const mx=1/($9*(1/$11)); +const my=1/($10*(1/$11)); +):( +w>h?( +const mx=1/(1*(1/$11)); +const my=1/((h/w)*(1/$11)); +):( +const mx=1/((w/h)*(1/$11)); +const my=1/(1*(1/$11)); +); +); +const ang=pi*($8/180); +const dang=pi*($12/180); +const distrad=1*10^($2/10); +const cos_ang=cos(ang); +const sin_ang=sin(ang); +const cos_dang=cos(dang); +const sin_dang=sin(dang); +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +dist_rot_x(a,b)=a*cos_dang-b*sin_dang; +dist_rot_y(a,b)=a*sin_dang+b*cos_dang; +const sd=max(w,h)/min(w,h); +const sx=w>h?sd:1; +const sy=w>h?1:sd; +rx(a)=((a/2+.5*sx)/sx)*w; +ry(a)=((a/2+.5*sy)/sy)*h; +eucl_norm(a,b)=sqrt(a^2+b^2); +const cv=(eucl_norm(rot_x(sx,sy)/2,rot_y(sx,sy)/2))*(pi/2)*(max(w,h)/min(w,h))*$3; +off_x_primary(a,b)=cos(a)*b*(abs($7)+1); +off_y_primary(a,b)=sin(a)*b*(abs($7)+1); +off_secondary(a,b,c)=a*(1-c)+b*c; +const interpolation=min(abs($18),2); +const mxsx=mx*sx; +const mysy=my*sy; +const expf=1-$1; +s==1?result()=vectors(i(avg_fax_fbx,avg_fay_fby,z,1,interpolation,$17)): +s==2?result()=vectors(i(fbx,fby,z,0,interpolation,$17),i(avg_fax_fbx,avg_fay_fby,z,1,interpolation,$17)): +s==3?result()=vectors(i(fbx,fby,z,0,interpolation,$17),i(avg_fax_fbx,avg_fay_fby,z,1,interpolation,$17),i(fax,fay,0,2,interpolation,$17)): +s==4?result()=vectors(i(fbx,fby,z,0,interpolation,$17),i(avg_fax_fbx,avg_fay_fby,z,1,interpolation,$17),i(fax,fay,0,2,interpolation,$17),i(avg_fax_fbx,avg_fay_fby,z,3,interpolation,$17)): +result()=vectors(i(fbx,fby,z,0,interpolation,$17),i(avg_fax_fbx,avg_fay_fby,z,1,interpolation,$17),i(fax,fay,0,2,interpolation,$17),i(avg_fax_fbx,avg_fay_fby,z,3,interpolation,$17),i(avg_fax_fbx,avg_fay_fby,z,4,interpolation,$17)); +); +XX=((x+offset_x)/w-.5)*2; +YY=((y+offset_y)/h-.5)*2; +xx=dist_rot_x(XX,YY); +yy=dist_rot_y(XX,YY); +xx*=mxsx; +yy*=mysy; +XX=rot_x(xx,yy); +YY=rot_y(xx,yy); +far=norm(XX,YY); +rad=atan2(YY*distrad,XX); +eff=far/cv; +RB=far^expf; +RA=RB*aberate; +off_xS=off_x_primary(rad,far); +off_xA=off_x_primary(rad,RA); +off_xB=off_x_primary(rad,RB); +off_yS=off_y_primary(rad,far); +off_yA=off_y_primary(rad,RA); +off_yB=off_y_primary(rad,RB); +offxA=off_secondary(off_xS,off_xA,eff); +offyA=off_secondary(off_yS,off_yA,eff); +offxB=off_secondary(off_xS,off_xB,eff); +offyB=off_secondary(off_yS,off_yB,eff); +fax=rx(offxA); +fay=ry(offyA); +fbx=rx(offxB); +fby=ry(offyB); +avg_fax_fbx=avg(fax,fbx); +avg_fay_fby=avg(fay,fby); +result();" +r2dx {(1/$sub)*100}%,{abs($18%6)+1} +if $convert_back +if $16!=4 +$convert_colors_bwd. +else +if s==4 cmyk2rgb +elif s==5 s c,-4 cmyk2rgb.. a c +fi +fi +fi +} +#@cli rep_cube2equi: eq. to 'rep_cube_map_to_equirectangular_panorama'. +rep_cube2equi: rep_cube_map_to_equirectangular_panorama $* +#@cli rep_cube_map_to_equirectangular_panorama: 0<=_top_face_placement<=3,0<=_bottom_face_placement<=3 +#@cli : An extension of a code provided by 'Bartosz' at stackoverflow to solve conversion from cube map to equirectangular panorama. Source: https://stackoverflow.com/questions/34250742/converting-a-cubemap-into-equirectangular-panorama +#@cli : (eq. to 'rep_cube2equi').\n +#@cli : Default values: '_top_face_placement=1','_bottom_face_placement=_top_face_placement'\n +#@cli : Author: Reptorian. +rep_cube_map_to_equirectangular_panorama: +skip ${1=1} +if $#>2 error narg(\$\*)<3==F fi +if $1<0||$-1<0||$1>3||$-1>3||!isint($1)||!isint($-1) error intargs(\$\*)==F\ ||\ (\ (\$"1"<3==F||\$"2"<3==F)\ ||\ absargs(\$\*)==F\ ) fi +foreach { +v + e[^-1] "Convert cube map to equirectangular panorama using face $1 for top placement and face $-1 for bottom placement!" v - +ratio={h/w} +if $ratio<1.5 r {w},{.75*w},100%,100%,5 +else r {1.5*h},{h},100%,100%,5 +fi +f "begin( +const a1=$1; +const a2=$1+1; +const b1=$-1; +const b2=$-1+1; +const edge=h/3; +const tl_edge=edge*a1; +const tr_edge=edge*a2; +const bl_edge=edge*b1; +const br_edge=edge*b2; +const bottom_edge=edge*2; +); +(y>=edge&&y=tl_edge&&x=bl_edge&&x2 error narg(\$\*)<3==F fi +if $1<0||$-1<0||$1>3||$-1>3||!isint($1)||!isint($-1) error intargs(\$\*)==F\ ||\ (\ (\$"1"<3==F||\$"2"<3==F)\ ||\ absargs(\$\*)==F\ ) fi +v + e[^-1] "Convert equirectangular panorama to cube map using face $1 for top placement and face $-1 for bottom placement!" v - +foreach { +ratio={w/h} +if $ratio<2 r {w},{.5*w},100%,100%,5 +else r {2*h},{h},100%,100%,5 +fi +{w},{.75*w},100%,100%,"begin( +edge=w/4; +outImgToXYZ(xc,yc,face,edge)=( +a=2*xc/edge;b=2*yc/edge; +if(face==0,ret=[-1,1-a,3-b];); +if(face==1,ret=[a-3,-1,3-b];); +if(face==2,ret=[1,a-5,3-b];); +if(face==3,ret=[7-a,1,3-b];); +if($1==0,if(face==4,ret=[1-b,1-a,1];); +,if($1==1,if(face==4,ret=[a-3,1-b,1];); +,if($1==2,if(face==4,ret=[b-1,a-5,1];); +,if($1==3,if(face==4,ret=[7-a,b-1,1];); +); +); +); +); +if($-1==0,if(face==5,ret=[b-5,1-a,-1;]); +,if($-1==1,if(face==5,ret=[a-3,b-5,-1;]); +,if($-1==2,if(face==5,ret=[5-b,a-5,-1;]); +,if($-1==3,if(face==5,ret=[7-a,5-b,-1;]); +); +); +); +); +ret; +); +); +face2=int(x/edge); +if(yedge*2,face2=5;); +coord3=outImgToXYZ(x,y,face2,edge); +theta=atan2(coord3[1],coord3[0]); +r=norm(coords3[0],coords3[1]); +phi=atan2(coord3[2],r); +uf=((theta+pi)/pi)*edge*2; +vf=((pi/2-phi)/pi)*edge*2; +if($1==$-1,if((x>=edge*$1&&x=edge&&y=edge*$1&&x=edge&&y=edge*$-1&&x=edge&&y=0,_type= { 0=Photo | 1= Horizontal | 2= Vertical | 3= One-Axis Angle | 4= Two-Axis Angle | 5= Two-Axis Disconnected},-360<=_sharpening_angle_a<=360,-360<=_sharpening_angle_b<=360 +#@cli : Extended version of the original TR's Pixel Sharpener for Paint.NET. Some code were changed to make more sense or is more practical. Negative values are enabled for first variable in the G'MIC version. The original code this was based on was created by TechnoRobbo. Source code - https://forums.getpaint.net/topic/26783-trs-pixel-sharpener-plugin-v20-dec-21-2014/ +#@cli : (eq. to 'rep_trps').\n +#@cli : Default values: '_internal_blur=0','_blur_type=0','_sharpening_angle=0'\n +#@cli : Author: Reptorian. +rep_tr_pixel_sharpener: +skip ${2=0},${3=0},${4=0},${5=0} +f "begin( +const ang=pi*($4/180); +const ang2=pi*($5/180); +const cos_ang=cos(ang); +const sin_ang=sin(ang); +const cos_ang2=cos(ang2); +const sin_ang2=sin(ang2); +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +rot_y_alt(a,b)=a*sin_ang2+b*cos_ang2; +const blur=(round(abs($2)+1)-1)*2+3; +const qblur=sqr(blur); +const eblur=floor(blur/2); +const sblur=floor(blur/-2); +const coeff=$1/100; +const mult=qblur*coeff+eblur/round(abs($2)+1); +const choice=abs($3)<=2?abs($3):0; +$3==5?( +fnx()=x+rot_x(j,k); +fny()=y+rot_y_alt(j,k); +): +$3==4?( +fnx()=x+rot_x(j,k); +fny()=y+rot_y(j,k); +): +$3==3?( +fnx()=x+rot_x(j,0); +fny()=y+rot_y(j,0); +): +$3==2?( +fnx()=x; +fny()=y+k; +): +$3==1?( +fnx()=x+j; +fny()=y; +):( +fnx()=x+j; +fny()=y+k; +); +); +sum=i*mult; +for(k=int(sblur),k<=eblur,++k, +for(j=int(sblur),j<=eblur,++j, +if(k!=0&j!=0, +nx=fnx(); +ny=fny(); +nfcalc=i(nx,ny,z,c,0,1); +sum-=nfcalc*coeff; +); +); +); +sum;" +#@cli rep_trif: eq. to 'rep_technorobbo_intense_filtration'. +rep_trif: rep_technorobbo_intense_filtration $* +#@cli rep_technorobbo_intense_filtration: 0<=hue<=360,_gain,_mix,_style_based_on={ 0=Original | 1=Grayscale | 2=Hue },_use_255={ 0=1 | 1=255 } +#@cli : This command is a color filter and augmenter. The code is based from TechnoRobbo's Intense Filtration source code - https://forums.getpaint.net/topic/30148-trs-intense-filtration-v-13-oct-092014/ +#@cli : (eq. to 'rep_trif').\n +#@cli : Warning: This command only works on images with 3 or 4 channel image. It doesn't discriminate between CMYK and RGBA image! So, make sure they're all RGB/RGBA images before using this command!\n +#@cli : 'hue' defines the color to augment. +#@cli : '_gain' defines the coefficient of image or number to multiple on data based on original image. +#@cli : '_mix' defines the strength of the filter. +#@cli : '_style_based_on' defines the style output of the filter based on corresponding name for number defined by filter. +#@cli : '_use_255' defines the maximum value for RGB image. If using float values from 0-1 range, then set to 0, else set to 1.\n +#@cli : Default values: '_gain=2','_mix=1','_style_based_on=0','_use_255=1'\n +#@cli : Author: Reptorian. +rep_technorobbo_intense_filtration: +skip ${2=2},${3=1},${4=0},${5=1} +hue={abs($1)-floor(abs($1)/360)*360} +($hue^1^1) +hsv2rgb. /. 255 +repeat $!-1 { +if s#$>==3||s#$>==4 +sh[$>] 0,2 +f. "begin( +endval(a,b)=(a*mix+(b-b*mix)); +const mv=$5?255:1; +const mixval=abs($3)>1?1:abs($3); +const mix=1-mixval; +const thresh=abs($2)>1?mv/2:mv; +const himax=mv*abs($2)-thresh; +$4==2?result()=endval(gv,tmpv): +$4==1?result()=endval(gray,tmpv): +result()=endval(cv,tmpv); +); +tmpv=i*abs($2)*i(#-2,0,0); +tmpv=tmpv>mv?mv:tmpv; +gray=((i0+i1+i2)/3)*abs($2); +gray=gray>mv?mv:gray; +cv=i*abs($2); +cv=cv>thresh?(cv-thresh)*(mv-thresh)/himax+thresh:cv; +graymix=gray/mv; +gv=i(#-2,0,0)*graymix*mv*abs($2); +gv>mv?mv:gv; +result()" +rm. +else v + error "Image \["$>"\] contains "{s#$>}" channels which does not meet the requirement of 3 or 4 channels!" v - +fi +} +rm. +#@cli rep_colmt: eq. to 'rep_color_modulo_texture'. +rep_colmt: rep_color_modulo_texture $* +#@cli rep_color_modulo_texture: colorspace={ 0=rgb | 1=ryb | 2=cmy | 3=cmyk | 4=hsi | 5=hsl | 6=hsv | 7=lab | 8=lch | 9=yiq | 10=yuv | 11=ycbcr | 12=ycbcrglic | 13=xyz | 14=yes },_include_alpha={ 0=no_alpha | 1=alpha},0<=_channel_order<{ 6 | 24 },_flip_diagonal={ 0=do_not_flip | 1=flip },sublevel>=0,interpolation>=0,_modulo_method_1= { 0=Mod | 1=Reflected Mod | 2=Divmod | 3=Reflected Divmod },_modulo_value_a_1>0,_modulo_value_b_1>0,_angle_1<=360,_value_shift_1>0,_centered_1= { 0=Not centered | 1=Centered },_negate_mod_1= { 0=Not Negated | 1=Negated },_normalize_bool_1= { 0=Do not Normalize | 1=Normalize }..._negate_mod_3 +#@cli : Inspired by MadJik's Color Modulo Texture for Paint.NET, this is a extension of that filter converted into G'MIC form. New features is being able to change color space, allow alpha, and anti-aliasing. +#@cli : (eq. to 'rep_colmt').\n +#@cli : '_modulo_method' defines what method of modulo operation would be applied to each channel. +#@cli : '_modulo_value_a' and 'modulo_value_b' is value used for calculation of modulo of function per channel. +#@cli : '_angle' defines the function angle. +#@cli : '_centered' defines if the function are centered. +#@cli : '_value_shift' adds value to function before modulo calculation. +#@cli : '_centered' is used to define whether the modulo is center. +#@cli : '_negate_mod' negates the end modulo value. +#@cli : '_normalize_bool' is used to normalize values. Note - This can be used to make the filter behave similar to Madjik's Color Modulo Texture filter. +#@cli : '_diagonal_flip' is used to flip diagonal function. +#@cli : '_colorspacemode' defines the color space of modulo. +#@cli : '_contain_alpha' adds alpha value to modulo. In the case of CMYK, this option is nullified, and K is used to replace alpha instead. +#@cli : '_subpixel_processing_level' defines the subpixel processing level. +#@cli : '_interpolation' defines the method of interpolation. +#@cli : '_channel_num' defines the order of channel. +#@cli : Default values: '_include_alpha=0','_channel_order=0','_flip_diagonal=0','_sublevel=1','_interpolation=1','_modulo_method_n=3','_modulo_value_a_n=196','_modulo_value_b_n=255','_angle_n=0','_value_shift_n=0','_center_n=0','_negate_n=0','_normalize_n=0' +rep_color_modulo_texture: +skip ${2=0},${3=0},${4=0},${5=1},${6=5},${7=},${8=},${9=},${10=},${11=},${12=},${13=},${14=},${15=},${16=},${17=},${18=},${19=},${20=},${21=},${22=},${23=},${24=},${25=},${26=},${27=},${28=},${29=},${30=},${31=},${32=},${33=},${34=},${35=},${36=},${37=},${38=} +if narg($7) modulo_method_0={$7%4} else modulo_method_0=3 fi +if narg($8) modvalue_a_0={abs($8)} else modvalue_a_0=196 fi +if narg($9) modvalue_b_0={abs($9)} else modvalue_b_0=255 fi +if narg($10) angle_0=$10 else angle_0=0 fi +if narg($11) value_shift_0=$11 else value_shift_0=0 fi +if narg($12) center_0=$12 else center_0=1 fi +if narg($13) negate_0=$13 else negate_0=0 fi +if narg($14) normalize_0=$14 else normalize_0=0 fi +if narg($15) modulo_method_1={$15%4} else modulo_method_1=$modulo_method_0 fi +if narg($16) modvalue_a_1={abs($16)} else modvalue_a_1=$modvalue_a_0 fi +if narg($17) modvalue_b_1={abs($17)} else modvalue_b_1=$modvalue_b_0 fi +if narg($18) angle_1=$18 else angle_1=$angle_0 fi +if narg($19) value_shift_1=$19 else value_shift_1=$value_shift_0 fi +if narg($20) center_1=$20 else center_1=$center_0 fi +if narg($21) negate_1=$21 else negate_1=$negate_0 fi +if narg($22) normalize_1=$22 else normalize_1=$normalize_0 fi +if narg($23) modulo_method_2={$23%4} else modulo_method_2=$modulo_method_1 fi +if narg($24) modvalue_a_2={abs($24)} else modvalue_a_2=$modvalue_a_1 fi +if narg($25) modvalue_b_2={abs($25)} else modvalue_b_2=$modvalue_b_1 fi +if narg($26) angle_2=$26 else angle_2=$angle_1 fi +if narg($27) value_shift_2=$27 else value_shift_2=$value_shift_1 fi +if narg($28) center_2=$28 else center_2=$center_1 fi +if narg($29) negate_2=$29 else negate_2=$negate_1 fi +if narg($30) normalize_2=$30 else normalize_2=$normalize_1 fi +if narg($31) modulo_method_3={$31%4} else modulo_method_3=$modulo_method_2 fi +if narg($32) modvalue_a_3={abs($32)} else modvalue_a_3=$modvalue_a_2 fi +if narg($33) modvalue_b_3={abs($33)} else modvalue_b_3=$modvalue_b_2 fi +if narg($34) angle_3=$34 else angle_3=$angle_2 fi +if narg($35) value_shift_3=$35 else value_shift_3=$value_shift_2 fi +if narg($36) center_3=$36 else center_3=$center_2 fi +if narg($37) negate_3=$37 else negate_3=$negate_2 fi +if narg($38) normalize_3=$38 else normalize_3=$normalize_2 fi +modnum_0={min($modvalue_a_0,$modvalue_b_0)} +modnum_1={min($modvalue_a_1,$modvalue_b_1)} +modnum_2={min($modvalue_a_2,$modvalue_b_2)} +modnum_3={min($modvalue_a_3,$modvalue_b_3)} +maxmodnum_0={max($modvalue_a_0,$modvalue_b_0)} +maxmodnum_1={max($modvalue_a_1,$modvalue_b_1)} +maxmodnum_2={max($modvalue_a_2,$modvalue_b_2)} +maxmodnum_3={max($modvalue_a_3,$modvalue_b_3)} +check "$maxmodnum_0>1||$maxmodnum_1>1||$maxmodnum_2>1||$maxmodnum_3>1" +flip_diag={$4%2} +sublevel={abs($5)+1} +interpolation={max(1,abs($6)+(abs($6)>3?1))} +cs={$1%15} +kalp={$2||$cs==3} +if $cs bwd_cs=${arg\ $cs,ryb2rgb,cmy2rgb,cmyk2rgb,hsi82rgb,hsl82rgb,hsv82rgb,lab82rgb,lch82rgb,yiq82rgb,yuv82rgb,ycbcr2rgb,ycbcrglic2rgb,xyz82rgb,yes82rgb} fi +if $flip_diag d_a=2 d_b=3 +else d_b=3 d_a=2 +fi +if $kalp +channel_ord=[{([0,1,2,3,0,1,3,2,0,2,1,3,0,2,3,1,0,3,1,2,0,3,2,1,1,0,2,3,1,0,3,2,1,2,0,3,1,2,3,0,1,3,0,2,1,3,2,0,2,0,1,3,2,0,3,1,2,1,0,3,2,1,3,0,2,3,0,1,2,3,1,0,3,0,1,2,3,0,2,1,3,1,0,2,3,1,2,0,3,2,0,1,3,2,1,0])[($3%24)*4,4]}] +else +channel_ord=[{([0,1,2,0,2,1,1,0,2,1,2,0,2,0,1,2,1,0])[($3%6)*3,3]}] +fi +ts={size($channel_ord)} +command "axis_func: f \"begin( +const ww=w-1; +const hh=h-1; +const cx=ww/2; +const cy=hh/2; +const ang=$""1°; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +const axis_mode=$""2; +const sublevel=$""3; +const value_shift=$""5*($""6?1:-1); +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +$""4?( +calc_ix(a)=($""6?ww-a:a)-cx+value_shift; +calc_iy(a)=($""6?hh-a:a)-cy+value_shift; +):( +calc_ix(a)=x+value_shift; +calc_iy(a)=y+value_shift; +); +axis_mode?( +surface()=rot_x(ix,iy); +):( +surface()=rot_y(ix,iy); +); +); +ix=calc_ix(x); +iy=calc_iy(y); +surface=surface()/sublevel;\"" +command "diagonal_func: f \"begin( +const ww=w-1; +const hh=h-1; +const cx=ww/2; +const cy=hh/2; +const ang=$""1°; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +const diag_mode=$""2; +const sublevel=$""3; +rot_x(a,b)=a*cos_ang-b*sin_ang; +rot_y(a,b)=a*sin_ang+b*cos_ang; +$""4?( +calc_ix(a)=a-cx; +calc_iy(a)=a-cy; +):( +calc_ix(a)=x; +calc_iy(a)=y; +); +diag_mode?( +mod_base(a,b)=abs(abs(a)-abs(b)); +):( +mod_base(a,b)=abs(abs(a)+abs(b)); +); +); +ix=calc_ix(x); +iy=calc_iy(y); +xx=rot_x(ix,iy); +yy=rot_y(ix,iy); +mod_base(xx,yy)/sublevel;\" ++. $""5" +foreach { +ow,oh={[w,h]} +{w*$sublevel},{h*$sublevel},1,$ts rm.. +repeat $ts { +pos={($channel_ord)[$>]} +sh. $pos +if !($>>=2) +axis_func. ${angle_$>},$>,$sublevel,${center_$>},${value_shift_$>},${negate_$>} +else +if $flip_diag diagonal_func. ${angle_$>},{$>%2},$sublevel,${center_$>},${value_shift_$>} +else diagonal_func. ${angle_$>},{$>%2+1},$sublevel,${center_$>},${value_shift_$>} +fi +fi +modf. ${modulo_method_$>},${maxmodnum_$>},{(${maxmodnum_$>}-${modnum_$>})} +if ${normalize_$>} /. {${maxmodnum_$>}/255} fi +if ${negate_$>} f. max(iM#-1,255)-i fi +rm. +} +if $cs $bwd_cs fi +if $sublevel r $ow,$oh,1,100%,$interpolation fi +} +uncommand diagonal_func,axis_func +#@cli rep_shape_brick: brick_width>0,brick_height>0,_mortar_width>0,_mortar_height>0,_outline>=0,_bevel>=0,_bevel_style= { 0=round | 1=inverse_round | 2=diamond },-1>=_shift_val>=1,_shift_direction= { 0=horizontal | 1=vertical },_flip_offset= { 0= Do Not Flip | 1= Flip },_subpixel_processing_level>=0 +#@cli : 'brick_width' - Width of brick(s) +#@cli : 'brick_height' - Height of brick(s) +#@cli : '_mortar_width' - Filling width between brick(s) +#@cli : '_mortar_height' - Filling height between brick(s) +#@cli : '_outline' - Thickness of outline of brick(s) +#@cli : '_bevel' - Beveling of corners of brick(s) +#@cli : '_bevel_style' - Form of beveling of brick(s) +#@cli : '_shift_val' - Shift of bricks +#@cli : '_shift_direction' - Direction of shift +#@cli : '_flip_offset' - Determines which order the offset from original, to original. +#@cli : '_subpixel_level' - Degree of antialiasing of brick(s)\n +#@cli : Default values: '_mortar_width','_mortar_height','_outline'\n +#@cli : Author: Reptorian. +rep_shape_brick: +skip ${3=10},${4=10},${5=0},${6=0},${7=0},${8=1},${9=0},${10=0},${11=0} +v - +sublevel={abs($11)} +sublevel+=1 +brick_width={abs($1)*$sublevel} +brick_height={abs($2)*$sublevel} +mortar_width={abs($3)*$sublevel} +mortar_height={abs($4)*$sublevel} +outline={abs($5)*$sublevel} +bevel={abs($6)*$sublevel} +bevel_style={abs($7)>2?2:abs($7)} +shift_val=$8 +shift_direction=$9 +flip_offset=$10 +if $bevel_style==2 brick_bevel_style="Diamond" +elif $bevel_style==1 brick_bevel_style="Inverse-Round" +else brick_bevel_style="Round" +fi +if $shift_direction dir="Every two column has displacement of" +else dir="Every two row has displacement of" +fi +if abs($shift_val) no={$shift_val*100} offset=""$dir" "$no""%" from original point." +else offset="" +fi +if $outline linethick={abs($5)} linethick=" with outline of "$linethick" px" +else linethick="" +fi +v + +e[] "Generate brick of "$brick_width" px and "$brick_height" px with mortar width of "$mortar_width" px and mortar height "$mortar_height" px"$linethick". "$offset"" +v + +if !(($brick_width&&$brick_height)||$bevel) v + error "Brick Area must be greater than 0!" v - fi +if $bevel +if $bevel_style==0||$bevel_style==1 shape_circle {$bevel*2} +else shape_diamond {$bevel*2} fi +*. 2 +if $outline +if $bevel_style==0||$bevel_style==1 shape_circle {($bevel+$outline)*2} +else shape_diamond {floor($bevel+($outline*(cos(45/180*pi)+sin(45/180*pi))))*2} r. {($bevel+$outline)*2},{($bevel+$outline)*2},100%,100%,0,0,.5,.5 fi +j[-1] [-2],.5~,.5~,0,0,.5,[-2] +rm.. +fi +s. x,2 +s[-2,-1] y,2 +fi +{$brick_width<$bevel*2?$bevel*2:$brick_width},{$brick_height<$bevel*2?$bevel*2:$brick_height},1,1,1 +if $outline expand_xy. $outline,0 fi +. 1 +if $bevel if $bevel_style==1 negate[-5--2] +f[-5--2] i==2?0:1 fi fi +if $bevel +if $bevel_style==1 +j[-5] [-9],1~,1~,0,0,1,[-4] +j[-5] [-8],1~,0~,0,0,1,[-3] +j[-5] [-7],0~,1~,0,0,1,[-2] +j[-5] [-6],0~,0~,0,0,1,[-1] +rm[-4--1] +else +j[-1] [-5],0~,0~ +j[-1] [-4],0~,1~ +j[-1] [-3],1~,0~ +j[-1] [-2],1~,1~ +fi +rm[-5--2] +fi +r. {w+$mortar_width},{h+$mortar_height},100%,100%,0,0,{!$flip_offset},{!$flip_offset} +if $shift_val +if $shift_direction +shift. 0,{($shift_val/2)*100}%,0,0,2 a[-2,-1] x if $flip_offset mirror. x fi +else +shift. {($shift_val/2)*100}%,0,0,0,2 a[-2,-1] y if $flip_offset mirror. y fi +fi +fi +if $sublevel-1 r2dx. {(1/$sublevel)*100}%,5 fi +v - +#@cli rep_z_render: _reverse_z_layer={ 0=first_layer | last_layer },_z_depth_value>0,_mirror_order={ 0=do_not_mirror | 1=mirror },_color_z_render={ 0=image_z_per_luminosity | 1=image_z_per_channel } +#@cli : Generates the resulting image based on z-map layer.\n +#@cli : '_reverse_z_layer' determines whether the first or last layer should be used to determine the "frame" to use. +#@cli : '_z_depth_value' can be described as how smooth the transition between images should be +#@cli : '_mirror_order' can be used to reorder the image transition +#@cli : '_color_z_render' sets whether the transition are separated by channels or not. +#@cli : Note: Try to use gradient as the z-layer.\n +#@cli : Default values: '_reverse_layer=0','_z_depth_value=255','_mirror_order=0','_color_z_render=0'\n +#@cli : Author: Reptorian. +rep_z_render: +skip ${1=0},${2=255},${3=0},${4=0} +if $!<3 v + error "You need at least 3 images!" v - fi +if $1 rv[0,-1] rv[0,-2] fi +if !$4 to_gray[0] fi +a[^0] z +n[0] 0,$2 +r[^0] 100%,100%,$2,100%,3 +if $3 negate[0] fi +r[0] 100%,100%,100%,{s#-1} +f[0] i(#-1,x,y,i,c,3,1) +k[0] +#@cli rep_acb: (eq. to rep_autofill_coloring_book) +rep_acb: rep_autofill_coloring_book $* +#@cli rep_autofill_coloring_book: 0=0,_color_mode={ 0=hard | 1= soft },0<=_alpha_threshold<1,_seed +#@cli : rep_autofill_coloring_book is used for automatically coloring pictures with lines.\n +#@cli : _threshold defines the value that is to be split into binary values. If it over _threshold, then it becomes 1. +#@cli : _dilate_erode defines the increase/decrease in line. Values over 0 implies increase in thickness while values less than 1 implies decrease in thickness. +#@cli : _color_mode defines whether the black line is going to be black or smooth. +#@cli : _alpha threshold defines the value of alpha to be cutoff by percentage +#@cli : _seed can be seen as premade random result.\n +#@cli : Default values: '_threshold=128','_dilate_erode=0','_color_mode=1','_alpha_threshold=0','_seed=' +rep_autofill_coloring_book: +skip ${2=0},${3=1},${4=0},${5=} +if narg($5) srand $5 fi +foreach { +sh 0,2 +if s#0==4 sh.. {s} vv={iv#-1} fi +rep_acb_color[1] ${1-3} +if s#0==4 +if ($4>0&&$4<1)&&$vv f. i>(iM*$4)?255:0 fi +fi +k[0] +} +rep_acb_color: +if $1<=0 v + error "threshold must be greater than 0" v - fi +if $1>=1 v + error "threshold must be less than 1" v - fi +to_gray n 0,1 +if !iv#-1 v + error "Invalid Image!" v - fi +if $3 +store line fi +f i>=$1?1:0 +if abs($2) +if $2<0 dilate {abs($2)} +else erode {abs($2)} +fi +fi +label_fg 0,1 +cv={iM} +min_t=1 +max_t={round(16777215/$cv)} +nt={$min_t} +ntt={$max_t} +1 +repeat $cv { +1,1,1,1,round(u($nt,$ntt)) +nt={iM#-1+1} +ntt={$nt+$max_t} +a[-2,-1] x +} +repeat $cv { +temp_1={i(round(u(1,$cv)))} +temp_2={i(round(u(1,$cv)))} +if $temp_1!=$temp_2 +f. i==$temp_1?$temp_2:(i==$temp_2?$temp_1:i) +fi +} +{w},1,1,3,[i0#-1%256,floor(i0#-1/256)%256,floor(i0#-1/(256^2))] +map... . rm[-2,-1] +if $3 ++select_color 0,0,0 +inpaint_pde [1],0,0,0 +rm. +$line +f.. i*i0#-1 +rm. +fi +#@cli rep_recc: eq. to 'rep_reverse_engineer_color_curves'. +rep_recc: rep_reverse_engineer_color_curves $* +#@cli rep_reverse_engineer_color_curves: _array_size>0 +#@cli : Automatically reverse engineer color curves. All images after [0] will be converted into color curve map while [0] is the reference image. +#@cli : (eq. to 'rep_recc'). +#@cli : '_array_size' is used to define the depth of gradient map, if you're using float, then you need to scale image to something higher than 256. If array size is not inserted, then this filter will automatically find the array size. +#@cli : Default values: '_array_size=n/a' +#@cli : +#@cli : Author: Reptorian. +rep_reverse_engineer_color_curves: +skip ${1=} +if !$!>1 error n(imgs)>2==F fi +ww={w#0} +hh={h#0} +dd={d#0} +ss={s#0} +if narg($1) +if im#0<0 mv={abs(im#0)+abs($1)} -[0] {im#0} +else mv={abs($1)} fi +else +if im#0<0 -[0] {im#0} fi +mv={iM#0} +fi +store[0] refimg +repeat $! { +img_id=$> +pos={$img_id+1} +if w#$img_id!=$ww||h#$img_id!=$hh||d#$img_id!=$dd||s#$img_id!=$ss error dims(#$pos)!=dims(ref) fi +} +foreach { +$refimg +_rep_recc[0,-1] $mv +} +_rep_recc: +rv +$1,1,1,100% . +repeat s { +sh $> +rm[-4--1] +f[-4] i(#-2,i,0,0)+=i#-3-i#-4;i(#-1,i,0,0)+=1;i +} ++eq. 0 ++.. . +/... .. +rm.. +repeat s { +sh.. $> +sh.. $> +inpaint_pde.. . +rm[-2,-1] +} +f.. i+x +cut.. 0,{$1-1} +k.. +#@cli rep_regm: eq. to 'rep_reverse_engineer_gradient_map'. +rep_regm: rep_reverse_engineer_gradient_map $* +#@cli rep_reverse_engineer_gradient_map: _array_size>0,_norm={ 0=do_not_norm | 1=norm } +#@cli : Automatically reverse engineer gradient map. All images after [0] will be converted into gradient map while [0] is the gray reference. +#@cli : (eq. to 'rep_regm'). +#@cli : '_array_size' is used to define the depth of gradient map, if you're using float, then you need to scale image to something higher than 256. If array size is not inserted, then this filter will automatically find the array size. +#@cli : '_normalize' is used to normalize image to max array id number. Useful when using float as reference. +#@cli : Default values: '_array_size=n/a','_normalize=0' +#@cli : +#@cli : Author: Reptorian, Garagecoder. +rep_reverse_engineer_gradient_map: +skip ${1=},${2=0} +if !$!>1 error n(imgs)>2==F fi +ww={w#0} +hh={h#0} +dd={d#0} +if s#0==2 s[0] c rm[1] +elif s#0==3 to_rgb[0] rgb2hsl8[0] channels[0] 2 +elif s#0==4 s[0] c,-3 to_rgb[0] rm[1] rgb2hsl8[0] channels[0] 2 +fi +if narg($1) +if im#0<0 mv={abs(im#0)+abs($1)} -[0] {im#0} +else mv={abs($1)} fi +else +if im#0<0 -[0] {im#0} fi +mv={iM#0} +fi +if $2&&narg($1) n[0] 0,{$mv-1} fi +store[0] refimg +repeat $! { +pos={$>+1} +if w#$>!=$ww||h#$>!=$hh||d#$>!=$dd error dims(#$pos)!=dims(ref) fi +} +foreach { +$refimg +gcd_regm[0,-1] $mv +} +gcd_regm: +rv +round.. 1 +$1,1,1,{s#-1} +f[0] "I[#-1,i]+=I(#1,x,y,z);i" ++histogram[0] $1,0,$1 ++eq. 0 +add[-2] [-1] +div[-3,-2] +inpaint_pde.. . +rm[-4,-3,-1] +#@cli rep_primelist: +#@cli : Return vector of boolean values up to the maximum image value rounded. Values are found by whether the argument number within vector is a prime. +rep_primelist: +maxn=0 +repeat $! maxn={ceil(max($maxn,max(abs(im#$>),iM#$>)))} done +u {" +const mv="$maxn"; +prime=vectormv(1); +prime[0]=prime[1]=0; +for(p=2,sqr(p)<=mv,++p, +if(prime[p], +for(v=sqr(p),v<=mv,v+=p, +prime[v]=0; +); +); +); +(prime)"} +#@cli rep_isprime: +#@cli : Values of image are changed to either 1 or 0 depending on the value is a prime number. +rep_isprime: +f "begin(prime=["${-rep_primelist}"];); +prime[round(abs(i))];" +#@cli rep_prime_surface: _width,_height,_negate= { 0=do_not_negate | 1=negate },_mirror +#@cli : Creates a simple prime surface by combining rep_primelist and spiralbw. +#@cli : Default values: '_width=last_image_width','_height=last_image_height' +rep_prime_surface: +skip ${1=w},${2=h},${3=1},${4=0} +spiralbw {abs($1)},{abs($2)} +local[-1] { +if $3 negate. fi +if abs($4)==1 mirror. x +elif abs($4)==2 mirror. y +fi +f "begin(prime=["${-rep_primelist}"];); +prime[round(abs(i))];" +} +#@cli rep_ced8: eq. to 'rep_color_existence_distribution_rgb8'. +rep_ced8: rep_color_existence_distribution_rgb8 $* +#@cli rep_color_existence_distribution_rgb8: _bool_found= { 0=colour_nonexistence | colour_existence } +#@cli : This cli command is used to find which colors exist within the color lookup table generated from 8-bit positive-only colors that ranges from 0-255. Millions of colors that does not exist within a image can be picked from a image generated with this command. +#@cli : (eq. to 'rep_ced8').\n +#@cli : Author: Reptorian. +rep_color_existence_distribution_rgb8: +nk=$1 +nk_1={$nk?255:0} +nk_2={$nk?0:255} +foreach { +256,256,256 eval.. "++i(#-1,R,G,B)" k. +4096,4096,1,4,[x%256,y%256,floor(x/256)+(floor(y/256)*16),i(#-1,x%256,y%256,floor(x/256)+(floor(y/256)*16))?$nk_1:$nk_2] +k. +} +#@cli rep_sdaxy: eq. to 'rep_shift_distance_angle_xy'. +rep_sdaxy: rep_shift_distance_angle_xy $* +#@cli rep_shift_distance_angle_xy: _offset>0,_angle,_boundary_condition={ 0=None | 1=Neumann | 2=Periodic | 3=Mirror },_interpolation={ 0=nearest_neighbor | 1=linear } +#@cli : Offset images at angle and distance. +#@cli : (eq. to 'rep_sdaxy').\n +#@cli : _offset refers to the displacement of image.\n +#@cli : Default value: 'boundary_condition=3','interpolation=1'\n +#@cli : Author: Reptorian. +rep_shift_distance_angle_xy: +skip ${3=3},${4=1} +rad_ang={$2/180*pi} +shift {cos($rad_ang)*$1},{sin($rad_ang)*$1},0,0,$3,$4 +#@cli rep_dupsdaxy: eq. to 'rep_duplicate_by_shift_distance_angle_xy'. +rep_dupsdaxy: rep_duplicate_by_shift_distance_angle_xy $* +#@cli rep_duplicate_by_shift_distance_angle_xy: duplicates_count>=2,_radius_offset>0,_offset_angle,_keep_original={ 0=remove_original | 1=keep_original },_boundary_condition={ 0=None | 1=Neumann | 2=Periodic | 3=Mirror },_interpolation={ 0=nearest_neighbor | 1=linear } +#@cli : Creates copies of image at a distance from original point. +#@cli : (eq. to 'rep_dupsdaxy').\n +#@cli : _radius_offset refers to the distance the duplicates are from the original image. Each circular duplicates are of the same distance. radius_offset can be in percentage form, or in integer form. When it is in percentage form, the length of each duplicates offset is equal to the percentage of diagonal of image. +#@cli : _offset_angle refers to the starting angle the original duplicate is at. The primary duplicate starts from the right.\n +#@cli : Default value: '_radius_offset={sqrt(w^2+h^2)*.05}','_offset_angle=0','_keep_original=0','_boundary_condition=0','_interpolation=1'\n +#@cli : Author: Reptorian. +rep_duplicate_by_shift_distance_angle_xy: +skip ${2={norm(w,h)*.05}},${3=0},${4=0},${5=1},${6=1} +if $1<2 v + error "Invalid duplicate numbers!" fi +aang={360/$1} +repeat $1 { +rep_shift_distance_angle_xy[0] $2,{$>*$aang+$3},$5,$6 } +if !$4 rm[0] fi +#@cli rep_frblur: eq. to 'rep_fragment_blur'. +rep_frblur: rep_fragment_blur $* +#@cli rep_fragment_blur: duplicates_count>=2,_radius_offset>0,_offset_angle,_keep_original={ 0=remove_original | 1=keep_original },_boundary_condition={ 0=None | 1=Neumann | 2=Periodic | 3=Mirror },_interpolation={ 0=nearest_neighbor | 1=linear },_color_space={ 0=RGB | 1=SRGB | 2=RYB | 3=CMYK | 4=HCY | 5=HSI | 6=HSL | 7=HSV | 8=LAB | 9=LCH } +#@cli : Fragment Blur is a effect that originated from the Windows software named Paint.NET. Copies or "fragments" of images are superimposed over their respective images. Copies are redrawn at a distance, and starting copy starts from the right at 0. +#@cli : (eq. to 'rep_frblur').\n +#@cli : _radius_offset refers to the distance the duplicates are from the original image. Each circular duplicates are of the same distance. radius_offset can be in percentage form, or in integer form. When it is in percentage form, the length of each duplicates offset is equal to the percentage of diagonal of image. +#@cli : _offset_angle refers to the starting angle the original duplicate is at. The primary duplicate starts from the right. +#@cli : _keep_original options is to keep the original image as a duplicate without offsetting it.\n +#@cli : Default values: '_radius_offset=5%','_offset_angle=0','_keep_original=0','_boundary_condition=1','_interpolation=1','_color_space=0'\n +#@cli : Author: Reptorian. +rep_fragment_blur: +skip ${2=5%},${3=0},${4=0},${5=1},${6=0},${7=0} +convert_colors_fwd=${arg\ 1+$7,,rgb2srgb,rgb2ryb,,rgb2hcy,rgb2hsi,rgb2hsl,rgb2hsv,rgb2lab,rgb2lch} +convert_colors_bwd=${arg\ 1+$7,,srgb2rgb,ryb2rgb,,hcy2rgb,hsi2rgb,hsl2rgb,hsv2rgb,lab2rgb,lch2rgb} +_frblur_iter_ang,_frblur_shift_ang,_ti,_frblur_dist={(2*pi)/$1},{deg2rad($3)},{abs($1)+($4?1)},1 +if $6 +command "rep_frblur_sdaxy_add : +100%,100%,100%,100% . +$1,1,1,2,\"begin( +const iter_ang=$_frblur_iter_ang; +const shift_ang=$_frblur_shift_ang; +); +[cos(x*iter_ang+shift_ang)*$""1,sin(x*iter_ang+shift_ang)*$""1];\" +repeat $1 { +j.. [0] +shift.. {I(#-1,$>)},0,0,$5,1 +add... .. +} +if $4 k[0,-3] add else k... fi +" +else +if $5 +command "rep_frblur_sdaxy_add : +dist={ceil($""1)} +100%,100%,100%,100% ++expand_xy[0] $dist,$5 +$1,1,1,2,\"begin( +const offset=$dist; +const iter_ang=$_frblur_iter_ang; +const shift_ang=$_frblur_shift_ang; +); +[round(cos(x*iter_ang+shift_ang)*$""1-offset),round(sin(x*iter_ang+shift_ang)*$""1-offset)];\" +repeat $1 { j[1] [-2],{I(#-1,$>)},0,0,-1 } +if $4 +k[0,1] +add +else +k[1] +fi +" +else +command "rep_frblur_sdaxy_add : +100%,100%,100%,100% +$1,1,1,2,\"begin( +const iter_ang=$_frblur_iter_ang; +const shift_ang=$_frblur_shift_ang; +); +[round(cos(x*iter_ang+shift_ang)*$""1),round(sin(x*iter_ang+shift_ang)*$""1)];\" +repeat $1 { j[1] [0],{I(#-1,$>)},0,0,-1 } +if $4 k[0,1] add else k[1] fi" +fi +fi +command "rep_frblur_alp : +sh 0,{s-2} +sh.. {s} +maxa={iM#-1} +/. $maxa +*.. . +rm[-2,-1] +rep_frblur_sdaxy_add $""1 +sh 0,{s-2} sh.. {s} f.. I/(i0#-1?i0#-1:1) *. {$maxa/iM#-1} rm[-2,-1]" +command "rep_frblur_nalp : rep_frblur_sdaxy_add $""1 / $_ti" +foreach { +if ispercentage($2) dist={abs($2)*norm(w,h)/2} +else dist={abs($2)} fi +tcr,convert_back=3,0 +if (s==3||s==4)&&$7 +convert_back=1 +if $7!=3 +$convert_colors_fwd. +else +if s==3 tcr+=1 rgb2cmyk +elif s==4 s c,-3 rgb2cmyk.. a c +fi +fi +fi +if !(s==1||s==$tcr) +rep_frblur_alp $dist +else +rep_frblur_nalp $dist +fi +if $convert_back +if $7!=3 +$convert_colors_bwd. +else +if s==4 cmyk2rgb +elif s==5 s c,-4 cmyk2rgb.. a c +fi +fi +fi +} +uncommand rep_frblur_sdaxy_add,rep_frblur_alp,rep_frblur_nalp +#@cli rep_ncee: _distance>0,0<=_angle<=360,boundary_condition={ 0=none | 1=neumann | 2=periodic | 3=mirror },_interpolation={ 0=nearest_neighbor | 1=linear },_contrast>=0,_process_alpha={ 0=do_not_process_alpha | 1=process_alpha },_color_space,_blend_mode,0<=_blend_opacity[%]<=1 +#@cli : Default value: 'boundary_condition=3','interpolation=1','contrast=1','process_alpha=1','color_space=0','blend_mode=1','blend_opacity=100%'\n +#@cli : Author: Reptorian. +rep_ncee: +skip ${3=3},${4=1},${5=1},${6=1},${7=0},${8=1},${9=1} +convert_colors_fwd=${arg\ $7+1,,rgb2ryb,rgb2cmy,rgb2cmyk,rgb2hsi8,rgb2hsl8,rgb2hsv8,rgb2lab8,rgb2lch8,rgb2yiq8,rgb2yuv8,rgb2xyz8,rgb2yes8,rgb2k18,rgb2ohta8} +convert_colors_bwd=${arg\ $7+1,,ryb2rgb,cmy2rgb,cmyk2rgb,hsi82rgb,hsl82rgb,hsv82rgb,lab82rgb,lch82rgb,yiq82rgb,yuv82rgb,xyz82rgb,yes82rgb,k182rgb,ohta82rgb} +-command "MergeChoice : $""=_mode" -MergeChoice "add","alpha","and","average","blue","burn","darken","difference","divide","dodge","exclusion","freeze","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor","edges","error" +to_a +split_opacity +local[0] { +$convert_colors_fwd +[0] +local[1] { +rep_dupsdaxy 2,$1,$2,0,$3,$4 +tci={$!} +f. "255-i" +add / $tci +- 127.5 +* {2*$5} ++ 127.5 +cut 0,255 +} +if $7!=3 +blend ${_mode{$8+1}},$9 +$convert_colors_bwd +elif $7==3 +s c +repeat 4 { +local[$>,{$!-1}] { +to_rgb +blend ${_mode{$8+1}},$9 +} +} +a c +cmyk2rgb +fi +} +local[1] { +if $6 rep_dupsdaxy 0,2,$1,$2,$3,$4 tai={$!} add / $tai fi +} +a c +#@cli pal: 0<="palette_id"<=384 : * +#@cli : Inserts pre-made user-made palette or palette that are based off older consoles or software or old paintings. +#@cli : Note 1 : Duplicate inputs can be ignored by inserting a '-' in the very beginning of arguments. +#@cli : Note 2 : +pal * generates every single palettes that are available for this command. +#@cli : +#@cli : \- The following list contains valid inputs directly next to their name, but anything after dashes is only for information purpose. Equal sign means that the commands are identical. - +#@cli : +#@cli : +pal 0 = +pal bw -- Black & White +#@cli : +pal 1 = +pal rgb -- Red-Green-Blue +#@cli : +pal 2 = +pal b_rgb -- Black with Red-Green-Blue +#@cli : +pal 3 = +pal bw_rgb -- Black & White with Red-Green-Blue +#@cli : +pal 4 = +pal cmy -- Cyan-Magenta-Yellow +#@cli : +pal 5 = +pal cmyk -- Cyan-Magenta-Yellow-Black +#@cli : +pal 6 = +pal wcmyk -- White-Cyan-Magenta-Yellow-Black +#@cli : +pal 7 = +pal rgbcmy -- Red-Green-Blue with Cyan-Magenta-Yellow +#@cli : +pal 8 = +pal 1bitrgb -- 1-Bit RGB +#@cli : +pal 9 = +pal aurora -- Aurora by GrafxKid +#@cli : +pal 10 = +pal zenit -- Zenit-241 by Zenit40 +#@cli : +pal 11 = +pal gbg -- Game Builder Garage: Texture-Sprite Editor Palette +#@cli : +pal 12 = +pal duel -- Duel by Arilyn +#@cli : +pal 13 = +pal hocuspocus -- Hocus Pocus Palette by Apogee Software,Ltd. +#@cli : +pal 14 = +pal playpal -- PLAYPAL by id Tech 1 | DOOM Engine +#@cli : +pal 15 = +pal srb2 -- Sonic Robo Blast 2 +#@cli : +pal 16 = +pal uzebox -- Uzebox from Uzebox console +#@cli : +pal 17 = +pal kens16 -- Andrew Kensler - 16 by Andrew Kensler +#@cli : +pal 18 = +pal kens32 -- Andrew Kensler - 32 by Andrew Kensler +#@cli : +pal 19 = +pal kens54 -- Andrew Kensler - 54 by Andrew Kensler +#@cli : +pal 20 = +pal aap12 -- AAP-Micro 12 by Adigun A. Polack +#@cli : +pal 21 = +pal aap16 -- AAP-16 by Adigun A. Polack +#@cli : +pal 22 = +pal aap64 -- AAP-64 by Adigun A. Polack +#@cli : +pal 23 = +pal aap96 -- AAP-RadiantPLUS by Adigun A. Polack +#@cli : +pal 24 = +pal aap128 -- AAP-SPLENDOR128 by Adigun A. Polack +#@cli : +pal 25 = +pal aap_dga16 -- AAP-DGA16 by Adigun A. Polack +#@cli : +pal 26 = +pal cheerful -- Cheerful-32 by SoundsDotZip +#@cli : +pal 27 = +pal db8 -- DB8 by DawnBringer +#@cli : +pal 28 = +pal db16 -- DB16 by DawnBringer +#@cli : +pal 29 = +pal db32 -- DB32 by DawnBringer +#@cli : +pal 30 = +pal db_iso22 -- DB-ISO22 by DawnBringer +#@cli : +pal 31 = +pal dimwid17 -- DimWiddy 17 by DimWiddy +#@cli : +pal 32 = +pal dimwid23 -- DimWiddy 23 by DimWiddy +#@cli : +pal 33 = +pal edg4 -- Endesga-4 by Endesga +#@cli : +pal 34 = +pal edg8 -- Endesga-8 by Endesga +#@cli : +pal 35 = +pal edg16 -- Endesga-16 by Endesga +#@cli : +pal 36 = +pal edg32 -- Endesga-32 by Endesga +#@cli : +pal 37 = +pal edg36 -- Endesga-36 by Endesga +#@cli : +pal 38 = +pal edg64 -- Endesga-64 by Endesga +#@cli : +pal 39 = +pal famicube -- Famicube by Arne +#@cli : +pal 40 = +pal juicy32 -- Juicy-32 by Real Juice +#@cli : +pal 41 = +pal juicy56 -- Juicy-56 by Real Juice +#@cli : +pal 42 = +pal xaiue -- XAIUE-22 by xaiue +#@cli : +pal 43 = +pal 15pdx -- 15P-DX by GrafxKid +#@cli : +pal 44 = +pal 20pdx -- 20P-DX by GrafxKid +#@cli : +pal 45 = +pal 24pdx -- 24P-DX by GrafxKid +#@cli : +pal 46 = +pal cabana -- Cabana-64 by Crabby +#@cli : +pal 47 = +pal fant16 -- Fantasy 16 by Brettybooop +#@cli : +pal 48 = +pal fant24 -- Fantasy 24 by Gabriel C. +#@cli : +pal 49 = +pal tf23 -- Tranquil Fantasy 23 by windfall.apples +#@cli : +pal 50 = +pal tfp39 -- Tranquility Plus 39 by windfall.apples +#@cli : +pal 51 = +pal faraway -- Faraway 48 by Igor Ferreira. +#@cli : +pal 52 = +pal fleja -- Fleja Master Palette by Fleja +#@cli : +pal 53 = +pal koni -- Koni32 by Konic +#@cli : +pal 54 = +pal linearbasic -- Linear Color Palette Basic by GrafxKid +#@cli : +pal 55 = +pal legowiki -- LEGO colors from LEGO wiki +#@cli : +pal 56 = +pal lego2021 -- Lego Colours 2021 by Six Pies +#@cli : +pal 57 = +pal vinelinear -- Vines Flexible Linear Ramps by Vine 2D +#@cli : +pal 58 = +pal arcade -- Arcade Standard 29 by GrafxKid +#@cli : +pal 59 = +pal arq -- ARQ16 by Endesga +#@cli : +pal 60 = +pal atom -- Atom-8 by polyphrog +#@cli : +pal 61 = +pal blk36 -- BLK 36 by BlackedIRL. +#@cli : +pal 62 = +pal blkneo -- BLK-NEO by BlackedIRL. +#@cli : +pal 63 = +pal brokefac -- Broken Facility by telepathic-melon +#@cli : +pal 64 = +pal bubblegum -- Bubblegum-16 by PineTreePizza +#@cli : +pal 65 = +pal cpcboy -- CPC BOY by Arne Niklas Jansson +#@cli : +pal 66 = +pal cade -- Cade 15 by MonstersGoBoom +#@cli : +pal 67 = +pal calder -- Calder 8 by Philip Dodderige +#@cli : +pal 68 = +pal cdbac -- CD-BAC by DimWiddy +#@cli : +pal 69 = +pal cgarne -- CG Arne by Arne Niklas Jansson +#@cli : +pal 70 = +pal dinoknight -- DinoKnight 16 by Retrospec +#@cli : +pal 71 = +pal 4l -- ||||-22 by |||| +#@cli : +pal 72 = +pal fzt -- FZT Ethereal 16 by Fusionnist +#@cli : +pal 73 = +pal indecision -- Indecision by Nelson SMG +#@cli : +pal 74 = +pal island -- Island Joy 16 by Kerrie Lake +#@cli : +pal 75 = +pal journey -- Journey by PineTreePizza +#@cli : +pal 76 = +pal shallowmarsh -- Shallowmarsh26 by archer +#@cli : +pal 77 = +pal lago_nenufar -- Lago Nenufar (Lake Water Lily) by Popxel Art +#@cli : +pal 78 = +pal juicy -- Juicy 17 by JerryPie +#@cli : +pal 79 = +pal chocolateganache -- ChocolateGanache by Ladybug +#@cli : +pal 80 = +pal brightwinter1 -- Bright Winter 1 by Nai +#@cli : +pal 81 = +pal brightwinter2 -- Bright Winter 2 by Nai +#@cli : +pal 82 = +pal kawaii -- Kawaii16 by Arisuki +#@cli : +pal 83 = +pal xdb -- 0xdb-01 by 0xDB +#@cli : +pal 84 = +pal gzxp -- GZXP by GrafxKid +#@cli : +pal 85 = +pal chromatic -- Chromatic16 by DragonDePlatino +#@cli : +pal 86 = +pal piet_code -- Piet Coding Language +#@cli : +pal 87 = +pal boltbait_matrix -- Matrix by BoltBait +#@cli : +pal 88 = +pal material_design -- Material Design by Ruchir L. Sharma +#@cli : +pal 89 = +pal thehamster_rainbow -- Rainbow by thehamster +#@cli : +pal 90 = +pal boltbait_rainbow -- Rainbow by BoltBait +#@cli : +pal 91 = +pal scrj -- SCRJ-XXXVI by StudioCRJ +#@cli : +pal 92 = +pal pxls -- Pxls Default from pxls.space +#@cli : +pal 93 = +pal lospec -- Lospec500 by the Lospec community +#@cli : +pal 94 = +pal moderna -- Moderna by yedamameday +#@cli : +pal 95 = +pal oak -- Oak21 by Dan Oak +#@cli : +pal 96 = +pal nature -- Nature's Embrace 55 by GrafxKid +#@cli : +pal 97 = +pal rbypgo -- RBYPGO by Marilynx +#@cli : +pal 98 = +pal new_worlds -- New Worlds 46 by Count Moriarty +#@cli : +pal 99 = +pal nauris -- Nauris-16 by Nauris +#@cli : +pal 100 = +pal dynamite -- Dynamite by Pixi +#@cli : +pal 101 = +pal interstate -- Interstate 28 by maine +#@cli : +pal 102 = +pal downgraded -- Downgraded 32 by daniel +#@cli : +pal 103 = +pal pear -- Pear 36 by PineTreePizza +#@cli : +pal 104 = +pal pineapple -- Pineapple 32 by PineTreePizza +#@cli : +pal 105 = +pal peachy -- Peachy Pop 16 by Kerrie Lake +#@cli : +pal 106 = +pal resurrect -- Resurrect 32 by Kerrie Lake +#@cli : +pal 107 = +pal rosy42 -- Rosy 42 by PineTreePizza +#@cli : +pal 108 = +pal slso -- SLSO-CLR17 by Luis Miguel Maldonado +#@cli : +pal 109 = +pal softy -- Softy 15 by Eggy +#@cli : +pal 110 = +pal spec -- SPEC12 by Smalls +#@cli : +pal 111 = +pal roarin80s -- The Roarin 80's by Malo +#@cli : +pal 112 = +pal starmancer -- Starmancer by Ominux Games +#@cli : +pal 113 = +pal superfuture -- SuperFuture25 by Endesga +#@cli : +pal 114 = +pal sunshine -- SUNSHINE 35 by mysunnyrose +#@cli : +pal 115 = +pal sweetie -- Sweetie 16 by GrafxKid +#@cli : +pal 116 = +pal calm -- Calm 48 by Xina +#@cli : +pal 117 = +pal optimism -- Optimism by mingapur +#@cli : +pal 118 = +pal taffy -- Taffy 16 by PineTreePizza +#@cli : +pal 119 = +pal todayland -- Todayland Palette V2 by GrafxKid +#@cli : +pal 120 = +pal trirampo -- TriRampo by ANoob +#@cli : +pal 121 = +pal reddit_place_2022 -- r|place 2022 +#@cli : +pal 122 = +pal tropical -- Tropical Cone 24 by yedamameday +#@cli : +pal 123 = +pal vivid -- Vivid-17 by Irenaart +#@cli : +pal 124 = +pal shido -- SHIDO50+ by Shidoengie +#@cli : +pal 125 = +pal intacto -- Intacto14 by Anoob +#@cli : +pal 126 = +pal itatsi -- Itatsi by SoundsDotZip +#@cli : +pal 127 = +pal enos -- ENOS16 by Endesga +#@cli : +pal 128 = +pal grixel -- Grixel Grotto by Northernite +#@cli : +pal 129 = +pal superb -- Superb 8 by BigPotato +#@cli : +pal 130 = +pal undertones -- Undertones-17 by Irenaart +#@cli : +pal 131 = +pal tango -- Tango by Duck +#@cli : +pal 132 = +pal cheese -- Cheese Palette by Gors +#@cli : +pal 133 = +pal equpix15 -- Equpix 15 by Night +#@cli : +pal 134 = +pal zughy -- Zughy 32 by Zughy +#@cli : +pal 135 = +pal voodo -- Voodo34 by Shamaboy +#@cli : +pal 136 = +pal franzston -- Franzston 30 by Virus610 +#@cli : +pal 137 = +pal night -- Night 16 by Night +#@cli : +pal 138 = +pal star29 -- Star 29 by Starlane +#@cli : +pal 139 = +pal star34 -- Star 34 by Starlane +#@cli : +pal 140 = +pal still_life -- Still-Life by cure +#@cli : +pal 141 = +pal simjpc -- SimpleJPC-16 by Adigun A. Polack +#@cli : +pal 142 = +pal acid -- Acid 15 by pyrometal +#@cli : +pal 143 = +pal battery -- Battery 24 by Battery Jellyfish +#@cli : +pal 144 = +pal clump -- Clumpy 18 by windfall.apples +#@cli : +pal 145 = +pal cthul -- Cthulhu by Starlane +#@cli : +pal 146 = +pal crimso11 -- Crimso 11 by Crimso +#@cli : +pal 147 = +pal coptec -- Copper-Tech by Arne Niklas Jansson +#@cli : +pal 148 = +pal drz -- DRZ15A by Drazille +#@cli : +pal 149 = +pal eggy -- Eggy 15 by Eggy +#@cli : +pal 150 = +pal europa -- Europa 16 by Starlane +#@cli : +pal 151 = +pal greyt -- GreyT-bit by Sam Keddy +#@cli : +pal 152 = +pal jewel -- Jewel by AprilSundae +#@cli : +pal 153 = +pal polar -- Polar 11 by Smalls +#@cli : +pal 154 = +pal sheltzy -- Sheltzy 32 by NatTorpedia +#@cli : +pal 155 = +pal wyrm -- Wyrm 24 by FrogWyrm +#@cli : +pal 156 = +pal yume_nikki -- Yume Nikki by Space Sandwich +#@cli : +pal 157 = +pal rube_goldberg -- Rube-Goldberg +#@cli : +pal 158 = +pal boomboom -- BoomBoom by Salman_Shh +#@cli : +pal 159 = +pal g8 -- Generic-8 by GrafxKid +#@cli : +pal 160 = +pal crayola -- Crayola Blind +#@cli : +pal 161 = +pal funky -- FunkyFuture8 by ShamaBoy +#@cli : +pal 162 = +pal golden_wall -- The Golden Wall Palette by Hans Hofmann +#@cli : +pal 163 = +pal matriax -- Matriax8c by Davit Masia +#@cli : +pal 164 = +pal nt1h -- NT1H by NatTorpedia +#@cli : +pal 165 = +pal jerrypie -- JerryPie 22 by JerryPie +#@cli : +pal 166 = +pal nineties_nine -- Nineties Nine by Cubby Crazes +#@cli : +pal 167 = +pal on70 -- On70 by By8Bits +#@cli : +pal 168 = +pal anb -- ANB16 by Anoob +#@cli : +pal 169 = +pal retrocal -- Retrocal-8 by polyphrog +#@cli : +pal 170 = +pal punolit -- Punolit by Punoli +#@cli : +pal 171 = +pal luap -- Luap 40 by Luap +#@cli : +pal 172 = +pal autum_villan -- Autum Villan 6 by Chase Stemel +#@cli : +pal 173 = +pal au15 -- Autum 15 by jok +#@cli : +pal 174 = +pal au15y -- Autum 15 [Yellow] by jok +#@cli : +pal 175 = +pal galaxy_flame -- Galaxy Flame by Rhoq +#@cli : +pal 176 = +pal cretaceous -- Cretaceous-16 by Joao Vasconcelos +#@cli : +pal 177 = +pal antiquity -- Antiquity16 by ILTA +#@cli : +pal 178 = +pal mushroom -- Mushroom by Jimison3 +#@cli : +pal 179 = +pal aerugo -- Aerugo by Lizalot +#@cli : +pal 180 = +pal hotel_paintings -- Hotel Paintings 6 by Chase Stemel +#@cli : +pal 181 = +pal nopal -- Nopal-12 by BlackedIRL. +#@cli : +pal 182 = +pal gpy -- Brightness GPY by rickthepalette +#@cli : +pal 183 = +pal blessing -- Blessing by Maruki +#@cli : +pal 184 = +pal fairydust -- Fairydust 8 by Yousurname +#@cli : +pal 185 = +pal milkshake -- Vanilla MilkShake by Space Sandwich +#@cli : +pal 186 = +pal fuzz -- Fuzzy Four by P-Tux7 +#@cli : +pal 187 = +pal fairy -- Fairy Tales by lollige +#@cli : +pal 188 = +pal naji -- Naji 16 by Naji +#@cli : +pal 189 = +pal easter -- Easter Island by skamocore +#@cli : +pal 190 = +pal pastel_and_darks -- Pastel and Darks 58 Palette by Glxss +#@cli : +pal 191 = +pal pastel_irena -- 17 Pastels by Irenaart +#@cli : +pal 192 = +pal nostalgia -- NOSTALGIA15 by Arisuki +#@cli : +pal 193 = +pal ocaso -- Ocaso by Minord +#@cli : +pal 194 = +pal pastel_starlitsunset -- Oh Hell, Pastel by StarlitSunset +#@cli : +pal 195 = +pal pollen -- Pollen-8 by Conker +#@cli : +pal 196 = +pal kule -- KULE-16 by Cuymacu +#@cli : +pal 197 = +pal hydrangea -- Hydrangea 11 by Dinchen's Art +#@cli : +pal 198 = +pal fluffy -- Fluffy8 by vee +#@cli : +pal 199 = +pal st8rb -- ST 8 R&B Remake by Skiller Thomson +#@cli : +pal 200 = +pal neon -- Neon Space by Jimison3 +#@cli : +pal 201 = +pal cyclope -- Cyclope6 by Royal_Naym +#@cli : +pal 202 = +pal sy -- Sy17 by xaiue +#@cli : +pal 203 = +pal syz -- Syz15 by Fusionnist +#@cli : +pal 204 = +pal tui -- TUI-15 by Jeremy +#@cli : +pal 205 = +pal cave -- Cave by PineTreePizza +#@cli : +pal 206 = +pal psygnosia -- Psygnosia by Arne Niklas Jansson +#@cli : +pal 207 = +pal marshmellow -- MarshMellow32 by FormalPrejudice +#@cli : +pal 208 = +pal lost_century -- Lost Century 24 by CalmRadish +#@cli : +pal 209 = +pal finlal -- Finlal 11 by Finlal +#@cli : +pal 210 = +pal industrial -- Industrial Factory 16 by Toby_Yasha +#@cli : +pal 211 = +pal murder_mystery -- Murder Mystery 16 by Toby_Yasha +#@cli : +pal 212 = +pal fate_and_destiny -- Fate & Destiny 12 by Toby_Yasha +#@cli : +pal 213 = +pal vinik -- Vinik 24 by Vinik +#@cli : +pal 214 = +pal ykb -- YKB-22 by yahkehbu +#@cli : +pal 215 = +pal halloween -- Halloween by Mememellow +#@cli : +pal 216 = +pal graveyard -- Graveyard-21 by AprilSundae +#@cli : +pal 217 = +pal steamlords -- Steam Lords by Slynyrd +#@cli : +pal 218 = +pal frostical -- Frostical by yedamameday +#@cli : +pal 219 = +pal deuterospill -- DeuteroSpill by Royal_Naym +#@cli : +pal 220 = +pal cool_bone -- Cool Bone 7 by Chase Stemel +#@cli : +pal 221 = +pal muted_ally -- Muted Ally 6 by Chase Stemel +#@cli : +pal 222 = +pal ephemera -- EPHEMERA by K C +#@cli : +pal 223 = +pal ink -- Ink by AprilSundae +#@cli : +pal 224 = +pal violet_dreams -- Violet Dreams by Solitaire +#@cli : +pal 225 = +pal tinyfolks -- Tinyfolks by Pierr Vandermaesan +#@cli : +pal 226 = +pal old_gold -- Old Gold 7 by Chase Stemel +#@cli : +pal 227 = +pal rosemoss -- Rosemoss-8 by polyphrog +#@cli : +pal 228 = +pal aaprad -- AAP-RadiantXV by Adigun A. Polack +#@cli : +pal 229 = +pal aapmaj -- AAP-Majesty XVII by Adigun A. Polack +#@cli : +pal 230 = +pal dead_weight -- Dead Weight-8 by polyphrog +#@cli : +pal 231 = +pal mojave -- Mojave20 by magodellepercussioni +#@cli : +pal 232 = +pal pet8 -- Petite-8 by Adigun A. Polack +#@cli : +pal 233 = +pal pet8d -- Petite-8 Afterdark by Adigun A. Polack +#@cli : +pal 234 = +pal xaiue_rad -- XAIUE-Radiant by xaiue +#@cli : +pal 235 = +pal daruda -- Daruda 22 by daruda +#@cli : +pal 236 = +pal firestorm -- Firestorm by theartistjulian +#@cli : +pal 237 = +pal borkfest -- Borkfest by まるき +#@cli : +pal 238 = +pal spicy -- Spicy 07 by green guy +#@cli : +pal 239 = +pal rust -- Rust-6 by Blue Phoenix +#@cli : +pal 240 = +pal apricot -- Apricot by Chase Stemel +#@cli : +pal 241 = +pal supernova -- SuperNova 7 by Blue Phoenix +#@cli : +pal 242 = +pal pastry -- Pastry by MirruTatep +#@cli : +pal 243 = +pal sandy -- Sandy 06 by green guy +#@cli : +pal 244 = +pal illumination -- Illumination by MirruTatep +#@cli : +pal 245 = +pal nyx -- NYX8 by Javier Guerrero +#@cli : +pal 246 = +pal dreamhaze -- Dream Haze 8 by Klafooty +#@cli : +pal 247 = +pal oil -- OIL6 by GrafxKid +#@cli : +pal 248 = +pal regal -- Regal10 by JRiggles +#@cli : +pal 249 = +pal softdemon -- Soft Demon 7 by Chase Stemel +#@cli : +pal 250 = +pal sgm -- SGM-Palette 2 by s.g.m +#@cli : +pal 251 = +pal midnight_ablaze -- Midnight ablaze by Inkpendude +#@cli : +pal 252 = +pal black_cherry -- Black Cherry by MirruTatep +#@cli : +pal 253 = +pal sunset_red -- Sunset Red by Cabezinu +#@cli : +pal 254 = +pal inkpink -- INKPINK by Inkpendude +#@cli : +pal 255 = +pal brash_pink -- Brash Pink by ItzFred +#@cli : +pal 256 = +pal pink_neon_sign -- Pink Neon Sign 6 by Chase Stemel +#@cli : +pal 257 = +pal enchanted_purple -- Enchanted Purple by Kaiburn +#@cli : +pal 258 = +pal arch -- Arch by Poltergasm +#@cli : +pal 259 = +pal spaceyeaster -- Spacey Easter by Spark Norris +#@cli : +pal 260 = +pal fornaxvoid1 -- Fornax Void I by Fornax Void +#@cli : +pal 261 = +pal fornaxvoid2 -- Fornax Void II by Fornax Void +#@cli : +pal 262 = +pal pixelwave -- Pixelwave by Reptorian +#@cli : +pal 263 = +pal s1 -- S1-6 by Blyzz +#@cli : +pal 264 = +pal berry_nebula -- Berry Nebula by LostInIndigo +#@cli : +pal 265 = +pal abyss -- ABYSS-9 by Jusiv +#@cli : +pal 266 = +pal moonlight -- Moonlight 15 by Tofu +#@cli : +pal 267 = +pal moon39 -- Moonlit-39 by theartistjulian +#@cli : +pal 268 = +pal h2o -- H2O by maine +#@cli : +pal 269 = +pal magic_waters -- Magic Waters 9 by Chase Stemel +#@cli : +pal 270 = +pal bluemold -- Bluem0ld by warpixel +#@cli : +pal 271 = +pal moss -- Moss by Zetomis +#@cli : +pal 272 = +pal deep_maze -- DEEP MAZE by Ryosuke +#@cli : +pal 273 = +pal toxic_slime -- Toxic Slime by MirruTatep +#@cli : +pal 274 = +pal lush_green -- Lush Green by EerieJam +#@cli : +pal 275 = +pal tsunami -- Tsunami by MirruTatep +#@cli : +pal 276 = +pal cryptic_ocean -- Cryptic Ocean by Klafooty +#@cli : +pal 277 = +pal marsh_madness -- Marsh Madness by MirruTatep +#@cli : +pal 278 = +pal oxyd -- OXYD by ItzFred +#@cli : +pal 279 = +pal pinkgreen -- Pink&Green by q1 +#@cli : +pal 280 = +pal woodwalk -- Walking in the Woods 8 by Chase Stemel +#@cli : +pal 281 = +pal paper -- Paper 8 by Frosty Rabbid +#@cli : +pal 282 = +pal sahara_pastell -- Sahara Pastell by wermz +#@cli : +pal 283 = +pal sunflower -- Sunflower Painting 7 by Chase Stemel +#@cli : +pal 284 = +pal arthoe -- Art Hoe Aesthetic 7 by Chase Stemel +#@cli : +pal 285 = +pal sky -- Sky5 by MiniTe +#@cli : +pal 286 = +pal ocean_glass -- Ocean Glass by Solitaire +#@cli : +pal 287 = +pal royal -- RoyalGuard by Royal_Naym +#@cli : +pal 288 = +pal eulbink -- Eulbink by Inkpendude +#@cli : +pal 289 = +pal winter_wonderland -- Winter Wonderland by Jimison3 +#@cli : +pal 290 = +pal moon_squid -- Moon Squid 7 by Chase Stemel +#@cli : +pal 291 = +pal stratus -- Stratus by MirruTatep +#@cli : +pal 292 = +pal arctic_dust -- Arctic Dust by MirruTatep +#@cli : +pal 293 = +pal clouds_sunset -- CL8UDS by _Nicola +#@cli : +pal 294 = +pal lilac_skies -- Lilac Skies 5 by Chase Stemel +#@cli : +pal 295 = +pal sea_of_fire -- Sea of Fire by TATA-PIXEL +#@cli : +pal 296 = +pal autochrome3 -- Autochrome 3 by Reptorian +#@cli : +pal 297 = +pal autochrome5 -- Autochrome 5 by Reptorian +#@cli : +pal 298 = +pal gb_d_1 -- GB Default 1 +#@cli : +pal 299 = +pal gb_d_2 -- GB Default 2 +#@cli : +pal 300 = +pal gb_andrade -- GB Andrade by Andrade +#@cli : +pal 301 = +pal gb_blue -- GB Blue Seni by WildLeoKnight +#@cli : +pal 302 = +pal gb_bz -- GB Blackzone +#@cli : +pal 303 = +pal gb_suburb -- GB Suburb by Poppysalmon +#@cli : +pal 304 = +pal gb_crimson -- GB Crimson by WildLeoKnight +#@cli : +pal 305 = +pal gb_didi -- GB Didi by DidiGameboy +#@cli : +pal 306 = +pal gb_dirty -- GB Dirty by WildLeoKnight +#@cli : +pal 307 = +pal gb_arne -- GB Arne by Arne +#@cli : +pal 308 = +pal gb_easy -- GB Easy by GrafxKid +#@cli : +pal 309 = +pal gb_forest -- GB Forest +#@cli : +pal 310 = +pal gb_hg -- GB Harsh Green by WildLeoKnight +#@cli : +pal 311 = +pal gb_lg -- GB Light Green by WildLeoKnight +#@cli : +pal 312 = +pal gb_nostalgia -- GB Nostalgia by WildLeoKnight +#@cli : +pal 313 = +pal gb_platinum -- GB Platinum by WildLeoKnight +#@cli : +pal 314 = +pal gb_kirokaze -- GB Kirokaze by Kirokaze +#@cli : +pal 315 = +pal gb_cyber -- GB Cyber +#@cli : +pal 316 = +pal gb_wish -- GB Wish by Kerrie Lake +#@cli : +pal 317 = +pal gb_grapefruit -- GB Grapefruit by GrafxKid +#@cli : +pal 318 = +pal gb_ice_cream -- GB Ice Cream by Kerrie Lake +#@cli : +pal 319 = +pal gb_rb -- GB Red_Blue +#@cli : +pal 320 = +pal gb_gold -- Gold GB by Isa +#@cli : +pal 321 = +pal gb_choco -- GB Chocolate by GrafxKid +#@cli : +pal 322 = +pal gb_gray -- GB Gray by GrafxKid +#@cli : +pal 323 = +pal gb_space -- GB Spacehaze by WildLeoKnight +#@cli : +pal 324 = +pal gb_purpdawn -- GB Purple Dawn by WildLeoKnight +#@cli : +pal 325 = +pal moon_crystal -- Moon Crystal by Doph +#@cli : +pal 326 = +pal arne -- ARNE4 by Arne +#@cli : +pal 327 = +pal autumn_chill -- Autumn Chill by Doph +#@cli : +pal 328 = +pal cherrymelon -- CherryMelon by WildLeoKnight +#@cli : +pal 329 = +pal hal4 -- HallowPumpkin by WildLeoKnight +#@cli : +pal 330 = +pal hollow -- Hollow by Poltergasm +#@cli : +pal 331 = +pal lavender -- Lavender4 by Solitaire +#@cli : +pal 332 = +pal maw -- MAW by bloo +#@cli : +pal 333 = +pal voltage_warning -- Voltage Warning by Wuchta +#@cli : +pal 334 = +pal tritanopia -- Tritanopia by Allappini +#@cli : +pal 335 = +pal rabbit -- Rabbit 7 by GrafxKid +#@cli : +pal 336 = +pal amiga2600ntsc -- Amiga 2600 NTSC +#@cli : +pal 337 = +pal amiga2600pal -- Amiga 2600 PAL +#@cli : +pal 338 = +pal amiga2600secam -- Amiga 2600 SECAM +#@cli : +pal 339 = +pal amiga7800mess -- Amiga 7800 M.E.S.S by Nabuko78 +#@cli : +pal 340 = +pal amiga7800 -- Amiga 7800 +#@cli : +pal 341 = +pal amstrad_cpc -- Amstrad CPC +#@cli : +pal 342 = +pal apple -- Apple II +#@cli : +pal 343 = +pal atari -- Atari 8-Bit Series - GTIA by PixelCrunch +#@cli : +pal 344 = +pal cga -- CGA +#@cli : +pal 345 = +pal cga00 -- CGA Mode 0 [Low] +#@cli : +pal 346 = +pal cga01 -- CGA Mode 0 [High] +#@cli : +pal 347 = +pal cga10 -- CGA Mode 1 [Low] +#@cli : +pal 348 = +pal cga11 -- CGA Mode 1 [High] +#@cli : +pal 349 = +pal cga20 -- CGA Mode 2 [Low] +#@cli : +pal 350 = +pal cga21 -- CGA Mode 2 [High] +#@cli : +pal 351 = +pal c64_pepto -- Commodore 64 - Pepto +#@cli : +pal 352 = +pal c64_colodore -- Commodore 64 - Colodore +#@cli : +pal 353 = +pal com_vic_20 -- Commodore VIC-20 +#@cli : +pal 354 = +pal colecovision -- Colecovision +#@cli : +pal 355 = +pal jmp -- Japanese Machine Palette by Arne Niklas Jansson +#@cli : +pal 356 = +pal mac2 -- Macintosh II +#@cli : +pal 357 = +pal mac8 -- Macintosh 8-Bit System Palette +#@cli : +pal 358 = +pal msx -- MSX +#@cli : +pal 359 = +pal nes -- NES +#@cli : +pal 360 = +pal pico -- PICO-8 by Lexaloffle Games +#@cli : +pal 361 = +pal risc -- RISC OS +#@cli : +pal 362 = +pal samcoupe -- SAM Coupe +#@cli : +pal 363 = +pal mo5 -- Thomson MO5 +#@cli : +pal 364 = +pal trs80 -- TRS-80 Color Computer Palette +#@cli : +pal 365 = +pal virtualboy -- Virtual Boy interpreted by Bruno Weinberger +#@cli : +pal 366 = +pal vga -- VGA +#@cli : +pal 367 = +pal win95 -- Win 95 +#@cli : +pal 368 = +pal zx -- ZX Spectrum +#@cli : +pal 369 = +pal gnome -- GNOME 32 +#@cli : +pal 370 = +pal elc -- Electronic Crayon 22 +#@cli : +pal 371 = +pal chip16 -- Chip16 +#@cli : +pal 372 = +pal deluxepaint -- Deluxe Paint +#@cli : +pal 373 = +pal flat -- FlatUI from flat ui colors website +#@cli : +pal 374 = +pal makecode -- MakeCode Arcade Palette +#@cli : +pal 375 = +pal oekaki -- Oekaki from Oekaki.nl +#@cli : +pal 376 = +pal lms -- Legacy Paint +#@cli : +pal 377 = +pal msxp -- XP Paint +#@cli : +pal 378 = +pal vista -- Vista Paint +#@cli : +pal 379 = +pal piet -- Piet Palette by Piet Mondrain +#@cli : +pal 380 = +pal japwood -- Japanese Woodblock Palette by Polyducks +#@cli : +pal 381 = +pal humanfaces -- Human Faces by Romney57 +#@cli : +pal 382 = +pal hues -- HSV Palette by MadJik +#@cli : +pal 383 = +pal christmas -- ST24 Christmas by Skiller Thomson +#@cli : +pal 384 = +pal ladybugreds -- Reds by Ladybug +#@cli : +#@cli : Author: Reptorian. ++pal: +v - _gmic_s=$? v + +_$0 $* ++_pal: +if '$1'=='*' +if $#>1 error ambiguous_args fi +_pal_385_pals +v + e[^-1] "Create palette(s) '"${}"'." v - +return +fi +$=var +if ('$1')[0]==_'-' +rd,var1=1,{`str='$1';(str)[1,size(str)-1]`} +else rd=0 +fi +n_bw,p_bw,n_rgb,p_rgb,n_b_rgb,p_b_rgb,n_bw_rgb,p_bw_rgb,n_cmy,p_cmy,n_cmyk,p_cmyk,n_wcmyk,p_wcmyk,n_rgbcmy,p_rgbcmy,n_1bitrgb,p_1bitrgb,n_aurora,p_aurora,n_zenit,p_zenit,n_gbg,p_gbg,n_duel,p_duel,n_hocuspocus,p_hocuspocus,n_playpal,p_playpal,n_srb2,p_srb2,n_uzebox,p_uzebox,n_kens16,p_kens16,n_kens32,p_kens32,n_kens54,p_kens54,n_aap12,p_aap12,n_aap16,p_aap16,n_aap64,p_aap64,n_aap96,p_aap96,n_aap128,p_aap128,n_aap_dga16,p_aap_dga16,n_cheerful,p_cheerful,n_db8,p_db8,n_db16,p_db16,n_db32,p_db32,n_db_iso22,p_db_iso22,n_dimwid17,p_dimwid17,n_dimwid23,p_dimwid23,n_edg4,p_edg4,n_edg8,p_edg8,n_edg16,p_edg16,n_edg32,p_edg32,n_edg36,p_edg36,n_edg64,p_edg64,n_famicube,p_famicube,n_juicy32,p_juicy32,n_juicy56,p_juicy56,n_xaiue,p_xaiue,n_15pdx,p_15pdx,n_20pdx,p_20pdx,n_24pdx,p_24pdx,n_cabana,p_cabana,n_fant16,p_fant16,n_fant24,p_fant24,n_tf23,p_tf23,n_tfp39,p_tfp39,n_faraway,p_faraway,n_fleja,p_fleja,n_koni,p_koni,n_linearbasic,p_linearbasic,n_legowiki,p_legowiki,n_lego2021,p_lego2021,n_vinelinear,p_vinelinear,n_arcade,p_arcade,n_arq,p_arq,n_atom,p_atom,n_blk36,p_blk36,n_blkneo,p_blkneo,n_brokefac,p_brokefac,n_bubblegum,p_bubblegum,n_cpcboy,p_cpcboy,n_cade,p_cade,n_calder,p_calder,n_cdbac,p_cdbac,n_cgarne,p_cgarne,n_dinoknight,p_dinoknight,n_4l,p_4l,n_fzt,p_fzt,n_indecision,p_indecision,n_island,p_island,n_journey,p_journey,n_shallowmarsh,p_shallowmarsh,n_lago_nenufar,p_lago_nenufar,n_juicy,p_juicy,n_chocolateganache,p_chocolateganache,n_brightwinter1,p_brightwinter1,n_brightwinter2,p_brightwinter2,n_kawaii,p_kawaii,n_xdb,p_xdb,n_gzxp,p_gzxp,n_chromatic,p_chromatic,n_piet_code,p_piet_code,n_boltbait_matrix,p_boltbait_matrix,n_material_design,p_material_design,n_thehamster_rainbow,p_thehamster_rainbow,n_boltbait_rainbow,p_boltbait_rainbow,n_scrj,p_scrj,n_pxls,p_pxls,n_lospec,p_lospec,n_moderna,p_moderna,n_oak,p_oak,n_nature,p_nature,n_rbypgo,p_rbypgo,n_new_worlds,p_new_worlds,n_nauris,p_nauris,n_dynamite,p_dynamite,n_interstate,p_interstate,n_downgraded,p_downgraded,n_pear,p_pear,n_pineapple,p_pineapple,n_peachy,p_peachy,n_resurrect,p_resurrect,n_rosy42,p_rosy42,n_slso,p_slso,n_softy,p_softy,n_spec,p_spec,n_roarin80s,p_roarin80s,n_starmancer,p_starmancer,n_superfuture,p_superfuture,n_sunshine,p_sunshine,n_sweetie,p_sweetie,n_calm,p_calm,n_optimism,p_optimism,n_taffy,p_taffy,n_todayland,p_todayland,n_trirampo,p_trirampo,n_reddit_place_2022,p_reddit_place_2022,n_tropical,p_tropical,n_vivid,p_vivid,n_shido,p_shido,n_intacto,p_intacto,n_itatsi,p_itatsi,n_enos,p_enos,n_grixel,p_grixel,n_superb,p_superb,n_undertones,p_undertones,n_tango,p_tango,n_cheese,p_cheese,n_equpix15,p_equpix15,n_zughy,p_zughy,n_voodo,p_voodo,n_franzston,p_franzston,n_night,p_night,n_star29,p_star29,n_star34,p_star34,n_still_life,p_still_life,n_simjpc,p_simjpc,n_acid,p_acid,n_battery,p_battery,n_clump,p_clump,n_cthul,p_cthul,n_crimso11,p_crimso11,n_coptec,p_coptec,n_drz,p_drz,n_eggy,p_eggy,n_europa,p_europa,n_greyt,p_greyt,n_jewel,p_jewel,n_polar,p_polar,n_sheltzy,p_sheltzy,n_wyrm,p_wyrm,n_yume_nikki,p_yume_nikki,n_rube_goldberg,p_rube_goldberg,n_boomboom,p_boomboom,n_g8,p_g8,n_crayola,p_crayola,n_funky,p_funky,n_golden_wall,p_golden_wall,n_matriax,p_matriax,n_nt1h,p_nt1h,n_jerrypie,p_jerrypie,n_nineties_nine,p_nineties_nine,n_on70,p_on70,n_anb,p_anb,n_retrocal,p_retrocal,n_punolit,p_punolit,n_luap,p_luap,n_autum_villan,p_autum_villan,n_au15,p_au15,n_au15y,p_au15y,n_galaxy_flame,p_galaxy_flame,n_cretaceous,p_cretaceous,n_antiquity,p_antiquity,n_mushroom,p_mushroom,n_aerugo,p_aerugo,n_hotel_paintings,p_hotel_paintings,n_nopal,p_nopal,n_gpy,p_gpy,n_blessing,p_blessing,n_fairydust,p_fairydust,n_milkshake,p_milkshake,n_fuzz,p_fuzz,n_fairy,p_fairy,n_naji,p_naji,n_easter,p_easter,n_pastel_and_darks,p_pastel_and_darks,n_pastel_irena,p_pastel_irena,n_nostalgia,p_nostalgia,n_ocaso,p_ocaso,n_pastel_starlitsunset,p_pastel_starlitsunset,n_pollen,p_pollen,n_kule,p_kule,n_hydrangea,p_hydrangea,n_fluffy,p_fluffy,n_st8rb,p_st8rb,n_neon,p_neon,n_cyclope,p_cyclope,n_sy,p_sy,n_syz,p_syz,n_tui,p_tui,n_cave,p_cave,n_psygnosia,p_psygnosia,n_marshmellow,p_marshmellow,n_lost_century,p_lost_century,n_finlal,p_finlal,n_industrial,p_industrial,n_murder_mystery,p_murder_mystery,n_fate_and_destiny,p_fate_and_destiny,n_vinik,p_vinik,n_ykb,p_ykb,n_halloween,p_halloween,n_graveyard,p_graveyard,n_steamlords,p_steamlords,n_frostical,p_frostical,n_deuterospill,p_deuterospill,n_cool_bone,p_cool_bone,n_muted_ally,p_muted_ally,n_ephemera,p_ephemera,n_ink,p_ink,n_violet_dreams,p_violet_dreams,n_tinyfolks,p_tinyfolks,n_old_gold,p_old_gold,n_rosemoss,p_rosemoss,n_aaprad,p_aaprad,n_aapmaj,p_aapmaj,n_dead_weight,p_dead_weight,n_mojave,p_mojave,n_pet8,p_pet8,n_pet8d,p_pet8d,n_xaiue_rad,p_xaiue_rad,n_daruda,p_daruda,n_firestorm,p_firestorm,n_borkfest,p_borkfest,n_spicy,p_spicy,n_rust,p_rust,n_apricot,p_apricot,n_supernova,p_supernova,n_pastry,p_pastry,n_sandy,p_sandy,n_illumination,p_illumination,n_nyx,p_nyx,n_dreamhaze,p_dreamhaze,n_oil,p_oil,n_regal,p_regal,n_softdemon,p_softdemon,n_sgm,p_sgm,n_midnight_ablaze,p_midnight_ablaze,n_black_cherry,p_black_cherry,n_sunset_red,p_sunset_red,n_inkpink,p_inkpink,n_brash_pink,p_brash_pink,n_pink_neon_sign,p_pink_neon_sign,n_enchanted_purple,p_enchanted_purple,n_arch,p_arch,n_spaceyeaster,p_spaceyeaster,n_fornaxvoid1,p_fornaxvoid1,n_fornaxvoid2,p_fornaxvoid2,n_pixelwave,p_pixelwave,n_s1,p_s1,n_berry_nebula,p_berry_nebula,n_abyss,p_abyss,n_moonlight,p_moonlight,n_moon39,p_moon39,n_h2o,p_h2o,n_magic_waters,p_magic_waters,n_bluemold,p_bluemold,n_moss,p_moss,n_deep_maze,p_deep_maze,n_toxic_slime,p_toxic_slime,n_lush_green,p_lush_green,n_tsunami,p_tsunami,n_cryptic_ocean,p_cryptic_ocean,n_marsh_madness,p_marsh_madness,n_oxyd,p_oxyd,n_pinkgreen,p_pinkgreen,n_woodwalk,p_woodwalk,n_paper,p_paper,n_sahara_pastell,p_sahara_pastell,n_sunflower,p_sunflower,n_arthoe,p_arthoe,n_sky,p_sky,n_ocean_glass,p_ocean_glass,n_royal,p_royal,n_eulbink,p_eulbink,n_winter_wonderland,p_winter_wonderland,n_moon_squid,p_moon_squid,n_stratus,p_stratus,n_arctic_dust,p_arctic_dust,n_clouds_sunset,p_clouds_sunset,n_lilac_skies,p_lilac_skies,n_sea_of_fire,p_sea_of_fire,n_autochrome3,p_autochrome3,n_autochrome5,p_autochrome5,n_gb_d_1,p_gb_d_1,n_gb_d_2,p_gb_d_2,n_gb_andrade,p_gb_andrade,n_gb_blue,p_gb_blue,n_gb_bz,p_gb_bz,n_gb_suburb,p_gb_suburb,n_gb_crimson,p_gb_crimson,n_gb_didi,p_gb_didi,n_gb_dirty,p_gb_dirty,n_gb_arne,p_gb_arne,n_gb_easy,p_gb_easy,n_gb_forest,p_gb_forest,n_gb_hg,p_gb_hg,n_gb_lg,p_gb_lg,n_gb_nostalgia,p_gb_nostalgia,n_gb_platinum,p_gb_platinum,n_gb_kirokaze,p_gb_kirokaze,n_gb_cyber,p_gb_cyber,n_gb_wish,p_gb_wish,n_gb_grapefruit,p_gb_grapefruit,n_gb_ice_cream,p_gb_ice_cream,n_gb_rb,p_gb_rb,n_gb_gold,p_gb_gold,n_gb_choco,p_gb_choco,n_gb_gray,p_gb_gray,n_gb_space,p_gb_space,n_gb_purpdawn,p_gb_purpdawn,n_moon_crystal,p_moon_crystal,n_arne,p_arne,n_autumn_chill,p_autumn_chill,n_cherrymelon,p_cherrymelon,n_hal4,p_hal4,n_hollow,p_hollow,n_lavender,p_lavender,n_maw,p_maw,n_voltage_warning,p_voltage_warning,n_tritanopia,p_tritanopia,n_rabbit,p_rabbit,n_amiga2600ntsc,p_amiga2600ntsc,n_amiga2600pal,p_amiga2600pal,n_amiga2600secam,p_amiga2600secam,n_amiga7800mess,p_amiga7800mess,n_amiga7800,p_amiga7800,n_amstrad_cpc,p_amstrad_cpc,n_apple,p_apple,n_atari,p_atari,n_cga,p_cga,n_cga00,p_cga00,n_cga01,p_cga01,n_cga10,p_cga10,n_cga11,p_cga11,n_cga20,p_cga20,n_cga21,p_cga21,n_c64_pepto,p_c64_pepto,n_c64_colodore,p_c64_colodore,n_com_vic_20,p_com_vic_20,n_colecovision,p_colecovision,n_jmp,p_jmp,n_mac2,p_mac2,n_mac8,p_mac8,n_msx,p_msx,n_nes,p_nes,n_pico,p_pico,n_risc,p_risc,n_samcoupe,p_samcoupe,n_mo5,p_mo5,n_trs80,p_trs80,n_virtualboy,p_virtualboy,n_vga,p_vga,n_win95,p_win95,n_zx,p_zx,n_gnome,p_gnome,n_elc,p_elc,n_chip16,p_chip16,n_deluxepaint,p_deluxepaint,n_flat,p_flat,n_makecode,p_makecode,n_oekaki,p_oekaki,n_lms,p_lms,n_msxp,p_msxp,n_vista,p_vista,n_piet,p_piet,n_japwood,p_japwood,n_humanfaces,p_humanfaces,n_hues,p_hues,n_christmas,p_christmas,n_ladybugreds,p_ladybugreds="Black & White","(0,255^0,255^0,255)","Red-Green-Blue","(255,0,0^0,255,0^0,0,255)","Black with Red-Green-Blue","(0,255,0,0^0,0,255,0^0,0,0,255)","Black & White with Red-Green-Blue","(0,255,255,0,0^0,255,0,255,0^0,255,0,0,255)","Cyan-Magenta-Yellow","(0,255,255^255,0,255^255,255,0)","Cyan-Magenta-Yellow-Black","(0,255,255,0^255,0,255,0^255,255,0,0)","White-Cyan-Magenta-Yellow-Black","(255,0,255,255,0^255,255,0,255,0^255,255,255,0,0)","Red-Green-Blue with Cyan-Magenta-Yellow","(255,0,0,0,255,255^0,255,0,255,0,255^0,0,255,255,255,0)","1-Bit RGB","(255,0,255,0,0,0,255,255^255,0,0,255,0,255,0,255^255,0,0,0,255,255,255,0)","Aurora by GrafxKid","(0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,0,63,0,191,129,0,63,0,15,127,191,245,253,255,255,255,191,127,85,127,191,255,255,255,255,191,127,0,63,0,175,0,0,75,188,203,166,126,110,126,160,192,208,225,235,245,246,245,127,87,115,142,171,199,227,248,227,196,143,115,59,65,115,143,162,181,199,218,237,199,171,142,115,88,70,25,35,59,80,59,87,115,100,143,162,225,180,171,135,80,15,30,35,59,100,143,171,199,190,171,168,143,87,87,59,15,31,59,73,87,115,118,143,171,208,227,171,143,115,87,60,70,114,143,171,171,235,255,227,225,215,199,200,195,75,50,40,64,98,165,218,213,255,245,255,246,255,215,218,180,160,95,83,98,140,172,177,230,255,255,200,155,150,115,106,60,40,32,12,20,10,20,125,75,0,5,28,18,18,6,0,45,60,106,145,85,125,8,16,5,22,15,0,50,0,24,35,105,74,144,90,190,120,74,98,60,16,0,35,12,80,96,135,156,189,185,215,215,248,230,255,218,189,189,140,90,100,65,50,85,160,200,255,255,250,252,230,189,152,145^0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,127,191,255,255,129,0,63,0,15,0,63,0,129,192,129,0,63,0,20,63,127,127,191,255,255,191,127,127,191,255,255,191,127,125,175,170,160,148,130,110,105,120,138,155,170,185,200,225,0,59,65,85,115,143,171,210,199,158,115,87,45,65,115,143,162,181,199,218,237,227,199,190,143,125,80,30,80,87,100,115,143,171,192,199,216,248,238,227,180,125,105,45,65,115,171,199,227,241,210,199,185,171,143,115,87,25,31,59,73,87,110,118,143,171,218,227,143,87,87,59,35,50,64,87,87,115,172,220,199,185,160,143,125,90,40,22,10,24,24,20,32,82,60,90,98,189,165,155,110,90,75,50,80,98,128,148,177,213,213,234,255,240,220,200,168,110,52,70,92,150,215,230,255,240,197,180,140,56,152,196,222,235,254,255,235,230,215,222,156,90,44,55,74,100,82,106,120,157,164,176,197,185,110,90,65,60,28,16,16,33,16,16,50,65,98,145,165,195,198,115,82,32,41,16,20,24,20,0,10,25,25,0,80,106,160,58,30,16,52,20^0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,127,191,255,255,255,255,191,127,80,127,191,245,255,203,129,0,63,0,20,0,63,0,129,191,0,63,0,0,63,0,175,255,255,200,192,137,144,148,135,96,95,114,116,125,140,155,175,210,255,59,60,85,115,143,171,218,171,115,87,59,31,35,59,87,85,114,143,171,199,171,143,85,87,62,50,15,55,59,80,73,87,115,130,143,162,250,202,197,142,95,70,35,70,115,171,199,227,241,240,227,220,199,199,143,115,45,59,87,115,143,170,202,199,227,248,255,199,199,143,115,60,70,114,143,171,171,225,245,227,210,190,185,160,145,55,35,30,17,0,10,16,74,10,50,98,49,60,15,10,0,5,20,10,0,90,0,10,90,16,74,65,70,25,5,5,20,5,8,12,5,10,10,115,90,20,80,78,50,128,145,106,168,165,205,255,255,240,213,222,92,82,125,156,150,246,189,220,195,255,255,255,250,240,255,246,245,218,189,148,72,176,208,210,255,255,255,255,250,252,255,255,224,255,197,190,123,100,98,70,55,130,120,191,197,185,140,120,57,77,55)","Zenit-241 by Zenit40","(18,49,80,114,154,194,226,201,168,132,95,66,37,66,99,130,176,209,238,224,202,159,118,86,54,84,125,169,202,225,248,234,194,147,111,79,46,84,126,181,219,245,251,255,242,197,138,87,51,87,138,189,255,255,240,242,240,204,150,101,58,101,149,196,226,255,255,227,181,142,109,74,43,72,100,135,174,209,240,225,204,171,143,102,61,97,140,181,225,255,255,225,185,153,123,90,61,106,150,193,233,249,250,232,206,170,130,89,53,78,105,134,170,207,225,194,155,123,94,67,46,69,107,143,179,210,235,196,145,104,73,45,23,39,59,86,124,166,210,161,85,46,27,15,10,17,24,37,50,117,190,135,98,63,47,27,13,17,23,33,45,98,182,101,18,22,19,9,7,32,48,74,106,140,186,130,81,39,36,23,16,32,53,73,106,147,199,161,112,79,60,40,25,38,60,88,118,166,217,171,132,92,63,42,24,56,89,124,165,205,228,191,158,120,88,62,35,54,80,109,147,189,225,182,134,98,65,41,19,39,57,87,120,166,204,167,130,92,64,37,18^14,43,67,99,135,177,211,173,125,85,58,38,20,31,50,75,107,148,194,155,115,83,61,33,16,35,53,78,113,151,188,140,93,55,39,22,9,19,31,38,74,120,172,125,72,37,15,15,11,27,36,47,99,153,197,151,98,47,32,20,12,14,31,50,89,141,191,144,105,75,50,31,18,40,66,97,134,171,211,177,127,87,54,40,27,37,62,92,136,187,228,194,149,115,81,55,31,43,66,102,149,199,239,189,146,105,73,47,33,56,85,113,150,192,224,193,150,116,86,60,39,58,88,126,167,217,255,224,184,148,115,74,43,66,99,128,166,207,244,230,214,171,125,77,43,69,107,148,201,255,255,199,161,117,84,54,31,55,92,138,191,249,254,241,209,147,94,57,27,62,95,132,176,219,243,220,176,132,86,50,22,46,75,105,150,198,235,203,148,98,60,37,15,35,59,91,126,162,202,153,114,79,56,34,14,27,40,53,91,136,183,149,116,87,64,44,23,47,71,103,139,181,222,184,141,103,71,47,22,47,70,104,141,185,225,194,156,119,87,58,31^20,48,71,97,126,169,207,163,123,94,73,57,39,63,87,108,135,156,191,152,123,102,78,55,49,74,100,128,159,198,237,245,212,184,138,97,49,89,137,177,208,211,205,193,170,137,98,74,47,68,87,104,133,153,179,128,96,65,55,43,27,24,28,38,65,112,153,111,91,66,50,30,16,26,47,65,89,120,153,106,63,44,34,28,20,20,25,33,47,85,136,102,74,51,34,20,12,9,10,11,7,47,107,62,45,40,30,21,19,35,52,72,96,120,164,135,98,72,55,37,20,17,26,33,46,87,142,83,46,37,31,24,16,32,50,66,93,120,164,115,41,39,27,31,28,51,71,81,98,136,174,135,111,82,67,48,36,61,91,115,148,185,220,214,200,160,113,79,37,70,105,138,173,203,234,227,213,182,153,111,51,64,89,117,158,202,243,255,255,189,153,92,41,66,102,138,184,219,255,207,173,125,94,71,41,88,138,189,232,242,238,179,152,128,102,75,45,60,88,120,158,200,231,199,155,115,82,56,28,48,70,99,130,170,187,150,114,89,65,45,23)","Game Builder Garage: Texture-Sprite Editor Palette","(0,48,72,108,144,181,217,237,255,255,255,255,255,204,128,77,128,216,254,255,254,254,204,128,77,127,217,255,255,255,254,204,127,77,128,190,246,230,214,170,143,84,61,137,196,204,153,102,0,0,0,31,88,134,230,179,134,0,5,0,31,107,152,230,205,133,0,5,1,55,91,152,230,180,132,14,0,0,32,64,152,233,208,161,20,38,7,59,101,178,244,220,199,136,82,42,91,132,187,254,251,249,242,194,122,75,125,214,255,255,255,255,204,128,77,127,216^0,48,72,108,144,181,217,237,255,230,179,133,0,2,0,32,64,87,241,211,184,106,84,52,50,92,179,253,250,246,238,189,119,75,125,187,255,255,255,255,217,128,77,153,217,255,255,255,217,154,89,51,129,190,255,255,255,254,204,128,77,153,217,251,247,234,213,170,106,71,122,205,242,214,190,128,95,60,52,94,182,229,204,153,0,31,0,58,98,174,229,180,133,1,0,0,81,109,151,230,179,133,0,0,1,30,64,152,230,179,132,1,1,0,32,83,153^0,48,72,108,144,181,217,237,255,229,179,133,0,18,0,31,64,87,230,179,133,0,0,0,31,64,152,230,179,133,0,3,0,50,90,134,230,179,133,3,0,0,31,108,152,210,170,127,36,25,13,35,96,144,250,240,231,207,163,102,67,144,204,255,255,255,255,204,128,77,128,217,255,255,255,255,204,127,77,128,217,255,255,255,255,180,78,78,130,217,255,255,255,255,153,77,103,153,217,255,255,255,255,204,127,77,128,217,245,223,204,149,119,75,58,109,190)","Duel by Arilyn","(0,34,67,98,130,166,205,245,98,133,158,174,187,204,234,255,88,115,136,154,173,213,251,255,0,0,0,11,0,50,36,136,102,148,182,205,227,249,255,255,40,58,97,122,134,150,199,198,0,0,23,34,47,81,125,166,24,35,37,54,49,65,82,116,26,47,56,50,65,73,85,145,94,130,182,228,255,255,255,255,45,72,91,115,132,171,186,235,59,90,138,174,199,216,236,255,49,74,94,114,126,158,192,221,46,73,102,151,185,193,219,248,0,0,0,0,0,0,0,0,69,97,126,153,178,204,232,251,95,110,144,167,189,206,237,237,50,74,100,120,142,156,184,220,67,113,159,217,248,255,255,255,73,99,124,152,172,193,210,229,32,47,73,97,124,150,180,208,98,117,133,158,186,209,232,255,38,59,86,117,145,179,207,254,29,46,57,76,88,107,120,127,55,83,120,148,169,191,215,244,45,71,91,113,135,138,169,224,0,3,7,16,20,64,85,109,85,118,151,185,213,235,255,253,29,60,88,121,149,169,186,209,38,40,45,61,81,82,108,131,73,94,119,145,173,181,212,255,114,156,191,233,255,255,255,247^0,35,69,104,139,174,210,247,93,117,140,161,175,195,219,243,49,61,80,98,110,141,170,206,39,56,77,102,111,140,174,214,43,54,77,94,120,155,188,233,43,69,95,119,144,178,214,236,34,50,74,89,105,136,164,204,31,50,70,107,142,178,210,245,51,63,81,92,116,137,182,218,7,33,60,92,118,155,187,219,49,71,92,115,135,174,199,240,48,60,82,107,130,159,197,250,34,53,70,90,108,138,165,191,16,40,54,84,109,120,153,198,46,64,81,107,130,160,191,222,49,74,97,121,144,169,203,234,9,36,70,96,125,151,182,212,53,82,101,119,140,155,174,212,23,43,59,74,93,125,166,205,37,52,75,89,111,126,141,154,41,79,93,115,131,154,170,204,42,59,79,101,136,170,210,246,35,56,80,104,122,151,175,223,44,61,77,95,113,132,158,189,36,57,76,93,109,126,147,163,75,101,123,149,174,193,209,250,27,49,72,93,118,151,177,204,71,93,116,140,163,189,213,247,29,49,74,100,133,150,171,189,36,51,61,80,101,116,130,147,33,65,83,96,121,139,174,226,28,51,90,134,177,207,240,244^0,35,73,113,152,186,218,250,84,101,121,137,164,177,201,214,38,59,65,76,81,107,132,127,53,80,94,127,137,167,214,255,41,58,70,70,64,78,78,73,74,104,132,153,178,217,255,255,25,33,27,24,12,34,45,52,47,77,107,138,184,227,255,253,44,56,64,64,85,96,125,161,17,29,53,95,118,168,199,255,54,77,105,127,149,190,219,246,60,69,88,96,108,117,129,171,42,60,70,81,84,110,136,154,38,61,89,117,145,170,191,218,73,81,98,109,121,135,163,218,37,60,68,81,98,110,130,163,38,52,71,87,100,112,124,147,88,128,157,193,226,239,255,255,41,59,82,105,128,175,197,255,28,50,71,90,110,122,122,124,0,8,0,8,30,38,51,50,0,9,18,32,46,57,75,79,61,85,111,110,123,131,142,177,67,71,60,51,44,45,36,57,35,58,73,79,88,99,116,128,71,90,105,125,142,150,193,235,64,95,124,162,192,234,241,255,105,115,136,147,154,157,155,134,33,81,127,186,241,236,247,254,80,93,114,131,174,197,196,195,41,74,91,106,132,148,170,207,3,39,62,39,8,5,43,191)","Hocus Pocus Palette by Apogee Software,Ltd.","(6,25,233,206,181,158,132,120,210,187,164,141,118,94,72,54,75,67,58,50,41,33,24,29,130,114,101,86,73,57,45,34,162,149,133,120,104,91,75,71,162,146,130,114,98,82,66,55,202,179,158,138,114,94,73,62,141,123,109,94,79,65,50,37,232,209,186,164,142,119,97,76,21,18,15,13,10,7,5,2,56,41,31,21,14,8,3,22,249,214,182,151,119,88,56,28,237,195,157,122,91,63,36,37,250,222,194,170,142,118,90,68,228,203,181,156,133,108,86,80,228,203,178,155,130,108,82,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,20,19,18,17,16,15,14,13,12,11,10,10,9,8,7,229,215,204,193,182,171,160,151,163,150,137,128,118,106,96,88,0,0,0,0,0,0,0,21,250,226,202,178,154,130,106,87,21,21,21,21,21,21,21,41,250,222,198,174,150,126,102,80,231,232,233,235,236,238,239,241,240,216,195,175,154,134,113,95,1,13,30,49,65,81,98,117,133,149,166,185,201,217,234,252^0,20,227,187,143,102,59,37,121,106,93,81,65,53,40,29,9,8,7,6,6,5,4,16,149,133,117,102,86,70,55,40,111,98,86,78,69,57,48,47,127,115,103,91,78,66,54,43,151,134,118,102,86,71,55,49,136,121,104,90,74,57,44,32,152,132,115,98,82,69,53,56,199,187,157,129,104,76,48,27,179,150,121,96,75,55,35,42,241,196,152,115,83,55,28,11,216,176,140,107,78,53,28,31,244,187,137,95,61,34,11,3,0,0,0,0,0,0,0,16,192,163,137,112,90,71,50,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,20,19,18,17,16,15,14,13,12,11,10,10,9,8,7,229,215,204,193,182,171,160,149,142,131,120,113,105,95,87,81,21,19,17,14,12,10,8,7,21,19,17,15,13,11,9,7,246,220,196,169,146,119,96,88,228,203,181,159,137,115,93,73,193,179,166,153,143,130,117,100,11,13,14,16,17,18,20,21,1,13,30,49,65,81,98,117,133,149,166,185,201,217,234,252^19,29,150,108,70,40,17,15,126,110,98,82,69,53,41,29,212,189,166,144,121,98,76,68,168,148,132,112,96,76,60,46,112,99,87,79,69,57,48,53,184,164,148,131,111,95,78,63,163,144,128,112,92,76,57,55,188,167,148,127,108,86,68,51,140,121,105,92,76,63,50,37,20,17,13,10,7,5,3,1,250,229,208,187,166,145,124,115,220,180,140,107,78,53,28,11,228,195,166,137,107,78,49,20,0,0,0,0,0,0,0,0,2,21,21,20,20,20,19,19,19,18,18,18,17,17,17,16,35,246,242,234,230,226,222,218,214,210,206,202,198,194,190,186,182,178,173,166,162,158,154,150,146,142,138,134,130,126,122,118,131,126,119,115,111,107,103,99,95,91,87,83,79,75,71,67,251,242,236,231,225,220,214,208,197,190,186,183,179,175,172,168,229,207,185,163,145,123,101,79,21,19,17,15,13,11,9,7,0,0,0,0,0,0,0,21,250,222,198,174,150,126,102,80,0,1,3,4,6,7,8,30,240,216,195,175,154,134,113,95,1,13,30,49,65,81,98,117,133,149,166,185,201,217,234,252)","PLAYPAL by id Tech 1 | DOOM Engine","(0,31,23,75,255,27,19,11,7,47,35,23,15,79,71,63,255,247,243,235,231,223,219,211,203,199,191,187,179,175,167,163,155,151,143,139,131,127,119,115,107,103,95,91,83,79,71,67,255,255,255,255,255,255,255,255,255,247,239,231,223,215,207,203,191,179,171,163,155,143,135,127,119,107,95,83,75,63,51,43,239,231,223,219,211,203,199,191,183,179,171,167,159,151,147,139,131,127,119,111,107,99,91,87,79,71,67,59,55,47,39,35,119,111,103,95,91,83,75,67,63,55,47,39,31,23,19,11,191,183,175,167,159,155,147,139,131,123,119,111,103,95,87,83,159,143,131,119,103,91,79,67,123,111,103,91,83,71,63,55,255,235,215,195,175,155,135,115,255,255,255,255,255,255,255,255,239,227,215,203,191,179,167,155,139,127,115,103,91,231,199,171,143,115,83,55,27,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,243,235,223,215,203,195,183,175,255,255,255,255,255,255,255,167,159,147,135,79,67,55,47,0,0,0,0,0,0,255,255,255,255,207,159,111,167^0,23,15,75,255,27,19,11,7,55,43,31,23,59,51,43,183,171,163,151,143,135,123,115,107,99,91,87,79,71,63,59,51,47,43,35,31,27,23,19,15,11,7,7,7,0,0,0,235,227,219,211,207,199,191,187,179,171,163,155,147,139,131,127,123,115,111,107,99,95,87,83,79,71,67,63,55,47,43,35,239,231,223,219,211,203,199,191,183,179,171,167,159,151,147,139,131,127,119,111,107,99,91,87,79,71,67,59,55,47,39,35,255,239,223,207,191,175,159,147,131,115,99,83,67,51,35,23,167,159,151,143,135,127,123,115,107,99,95,87,83,75,67,63,131,119,107,95,83,71,59,51,127,115,107,99,87,79,71,63,255,219,187,155,123,91,67,43,219,187,155,123,95,63,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,231,199,171,143,115,83,55,27,0,0,0,0,0,0,0,0,235,215,199,179,163,143,127,115,111,103,95,87,79,71,67,255,255,255,255,255,255,255,63,55,47,35,59,47,35,27,0,0,0,0,0,0,159,231,123,0,0,0,0,107^0,11,7,75,255,27,19,11,7,31,15,7,0,43,35,27,183,171,163,151,143,135,123,115,107,99,91,87,79,71,63,59,51,47,43,35,31,27,23,19,15,11,7,7,7,0,0,0,223,211,199,187,179,167,155,147,131,123,115,107,99,91,83,79,75,71,67,63,59,55,51,47,43,39,35,31,27,23,19,15,239,231,223,219,211,203,199,191,183,179,171,167,159,151,147,139,131,127,119,111,107,99,91,87,79,71,67,59,55,47,39,35,111,103,95,87,79,71,63,55,47,43,35,27,23,15,11,7,143,135,127,119,111,107,99,91,87,79,75,67,63,55,51,47,99,83,75,63,51,43,35,27,99,87,79,71,59,51,43,39,115,87,67,47,31,19,7,0,219,187,155,123,95,63,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,227,203,179,155,131,107,83,219,187,155,123,91,59,27,23,15,15,11,7,0,0,0,215,179,143,107,71,35,0,0,0,0,0,39,27,19,11,71,59,47,35,23,11,67,75,255,255,207,155,107,107)","Sonic Robo Blast 2","(255,247,239,231,223,215,207,199,191,183,175,167,159,151,143,135,127,119,111,103,95,87,79,71,63,55,47,39,31,23,15,7,0,191,183,175,167,159,150,142,134,126,117,109,101,93,84,76,67,191,179,171,163,155,143,135,127,119,107,95,83,75,63,51,43,255,255,255,255,255,255,255,255,255,247,239,231,223,215,207,203,255,255,255,255,255,255,255,255,243,229,216,203,190,177,164,151,255,255,255,255,255,255,255,255,255,207,175,143,111,79,47,15,255,235,215,195,175,155,135,115,255,255,255,255,255,255,255,255,239,223,207,191,175,159,143,127,111,95,79,63,47,31,15,255,243,231,219,203,191,179,167,142,134,126,117,109,101,93,85,119,112,105,97,90,82,75,67,60,53,45,38,30,23,15,7,222,199,173,149,124,100,74,50,0,0,0,0,0,0,0,0,255,255,223,191,159,127,95,63,233,196,157,119,84,65,46,27,213,191,170,149,128,106,85,63,55,47,39,31,0,0,0,0,231,198,173,140,115,82,49,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,207,183,159,135,111,87,63,39^255,247,239,231,223,215,207,199,191,183,175,167,159,151,143,135,127,119,111,103,95,87,79,71,63,55,47,39,31,23,15,7,0,167,160,152,144,137,129,121,114,106,98,90,83,75,67,60,51,123,115,111,107,99,95,87,83,79,71,67,63,55,47,43,35,235,227,219,211,207,199,191,187,179,171,163,155,147,139,131,127,238,220,203,185,168,151,134,117,109,101,93,85,77,69,61,54,255,255,255,255,255,255,255,255,255,207,175,143,111,79,47,15,255,219,187,155,123,91,67,43,223,191,159,127,95,63,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,183,163,143,123,107,91,79,63,46,39,32,25,18,11,5,0,255,240,224,208,192,176,160,144,128,112,96,80,64,48,32,15,255,228,200,173,146,119,90,63,255,223,191,159,127,95,63,31,111,0,0,0,0,0,0,0,233,196,157,119,84,65,46,27,241,235,227,221,214,207,200,191,157,143,119,95,191,127,95,63,231,198,173,140,115,82,49,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,127,111,95,79,63,47,31,15^255,247,239,231,223,215,207,199,191,183,175,167,159,151,143,135,127,119,111,103,95,87,79,71,63,55,47,39,31,23,15,7,0,143,136,128,120,113,105,97,90,82,74,66,59,51,43,36,27,75,71,67,63,59,55,51,47,43,39,35,31,27,23,19,15,223,211,199,187,179,167,155,147,131,123,115,107,99,91,83,79,220,185,151,117,85,54,25,0,0,0,0,0,0,0,0,0,239,207,175,143,111,79,47,15,0,0,0,0,0,0,0,0,115,87,67,47,31,19,7,0,223,191,159,127,95,63,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,183,163,143,123,107,91,79,63,0,0,0,0,0,0,0,0,79,75,70,65,60,55,50,45,40,35,30,25,20,15,10,4,168,148,128,107,88,68,48,29,0,0,0,0,0,0,0,0,255,255,223,191,159,127,95,63,243,225,206,187,167,131,92,52,255,255,255,255,255,255,255,255,223,191,159,127,191,127,95,63,255,255,255,255,255,255,255,255,255,231,206,181,156,132,107,82,79,63,55,39,31,15,7,255,207,183,159,135,111,87,63,39)","Uzebox from Uzebox console","(0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255,0,36,72,109,145,182,218,255^0,0,0,0,0,0,0,0,36,36,36,36,36,36,36,36,72,72,72,72,72,72,72,72,109,109,109,109,109,109,109,109,145,145,145,145,145,145,145,145,182,182,182,182,182,182,182,182,218,218,218,218,218,218,218,218,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,36,36,36,36,36,36,36,36,72,72,72,72,72,72,72,72,109,109,109,109,109,109,109,109,145,145,145,145,145,145,145,145,182,182,182,182,182,182,182,182,218,218,218,218,218,218,218,218,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,36,36,36,36,36,36,36,36,72,72,72,72,72,72,72,72,109,109,109,109,109,109,109,109,145,145,145,145,145,145,145,145,182,182,182,182,182,182,182,182,218,218,218,218,218,218,218,218,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,36,36,36,36,36,36,36,36,72,72,72,72,72,72,72,72,109,109,109,109,109,109,109,109,145,145,145,145,145,145,145,145,182,182,182,182,182,182,182,182,218,218,218,218,218,218,218,218,255,255,255,255,255,255,255,255^0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255)","Andrew Kensler - 16 by Andrew Kensler","(0,255,201,110,232,239,106,25,22,50,5,63,186,255,227,122^0,255,143,78,2,227,137,86,237,193,127,50,170,148,14,36^0,255,76,35,0,5,39,72,117,195,193,174,255,157,194,61)","Andrew Kensler - 32 by Andrew Kensler","(214,254,161,250,251,230,153,71,5,79,45,0,111,8,42,6,0,74,142,183,255,172,130,90,174,247,244,155,86,17,81,8^160,59,44,47,159,28,47,1,17,2,105,166,235,162,102,54,0,73,123,192,255,190,124,59,101,170,234,149,98,150,225,253^144,30,50,122,218,247,124,31,85,236,203,238,255,154,106,25,0,87,164,255,255,156,112,28,7,48,92,0,4,59,19,204)","Andrew Kensler - 54 by Andrew Kensler","(5,50,56,0,28,42,45,0,80,162,132,170,205,5,73,47,56,120,187,142,31,37,114,164,245,223,168,54,36,127,71,147,151,229,213,221,242,238,158,78,91,94,126,162,224,255,255,223,171,238,193,248,234,161^254,175,114,0,51,82,132,183,254,209,146,186,255,220,159,109,148,206,198,140,100,71,98,141,184,111,49,16,18,35,26,39,104,126,48,56,128,41,40,33,80,77,117,175,245,251,255,185,140,193,144,203,121,94^193,135,97,0,42,25,48,22,52,142,108,179,241,221,170,130,215,248,236,253,244,126,159,181,244,241,238,227,103,135,58,78,119,163,157,90,113,17,31,26,88,40,26,34,63,198,255,186,118,145,41,26,36,48)","AAP-Micro 12 by Adigun A. Polack","(4,28,71,108,227,216,161,78,154,240,249,138^3,22,65,140,210,128,61,40,64,212,245,143^3,24,107,80,69,56,59,46,126,114,239,196)","AAP-16 by Adigun A. Polack","(7,51,119,204,153,221,255,255,85,17,68,51,85,85,170,255^7,34,68,136,51,119,221,255,170,85,238,136,68,85,187,255^8,34,51,85,17,17,85,51,68,34,187,221,170,119,187,255)","AAP-64 by Adigun A. Polack","(6,20,59,115,180,223,250,249,255,255,214,156,89,20,26,36,18,20,40,36,32,166,255,254,250,245,232,188,121,64,36,34,50,113,187,219,244,218,179,139,109,74,51,66,91,142,186,233,227,185,132,88,71,35,50,93,146,205,228,199,160,121,90,66^6,16,23,23,32,62,106,163,213,252,242,219,193,160,122,82,32,52,92,159,214,252,255,243,214,160,106,74,58,51,34,28,43,65,117,164,210,224,185,147,117,84,57,36,49,82,117,181,230,191,155,141,125,103,132,175,220,247,210,176,134,103,78,57^8,19,37,45,42,35,10,27,65,64,100,67,53,46,62,59,32,100,196,222,199,219,255,192,184,151,115,155,128,83,52,26,40,59,71,99,156,234,209,175,141,98,65,51,56,82,106,163,255,251,228,190,133,78,100,141,186,226,170,139,98,85,68,52)","AAP-RadiantPLUS by Adigun A. Polack","(1,12,39,85,137,195,241,255,255,241,191,131,72,36,9,18,43,84,144,206,251,253,221,152,100,60,33,18,28,23,17,16,146,255,234,178,108,53,31,41,83,140,200,236,255,255,255,255,242,229,255,255,255,255,244,225,169,108,63,29,25,57,107,169,233,255,255,255,252,215,140,73,124,181,231,254,255,255,254,235,204,140,81,33,24,42,69,104,157,208,240,255,246,213,140,82^1,6,13,28,58,95,147,197,240,199,143,92,48,24,8,27,54,94,152,208,240,255,252,225,161,96,51,21,45,99,163,229,252,255,254,237,195,138,81,29,38,60,105,174,225,247,232,187,133,63,107,171,210,174,115,45,9,12,13,11,15,22,32,41,63,111,242,219,145,93,54,32,66,117,178,236,251,236,205,162,108,61,32,15,22,39,70,118,179,226,248,250,226,179,109,64^1,6,11,19,27,29,25,57,7,5,13,17,16,10,9,13,14,20,22,22,69,225,98,7,13,14,11,62,130,139,151,146,148,254,254,254,250,243,207,117,184,238,255,254,255,233,209,157,104,149,124,109,131,79,0,3,9,26,27,17,37,68,110,119,71,41,169,109,86,55,34,19,28,33,51,131,191,171,142,109,66,46,31,17,22,48,91,146,191,226,240,229,190,145,98,80)","AAP-SPLENDOR128 by Adigun A. Polack","(5,14,45,97,185,241,252,255,255,255,248,232,176,103,39,76,133,211,248,213,173,127,88,51,24,41,71,97,143,196,208,151,89,66,61,39,20,27,43,39,66,115,241,201,138,69,73,120,156,206,250,238,212,144,23,55,105,178,226,246,252,236,203,166,128,89,50,79,140,198,214,180,114,69,97,147,198,239,181,134,93,72,44,23,44,70,100,138,175,220,184,136,94,72,40,70,105,154,197,230,238,227,191,135,86,50,54,101,150,192,212,234,241,221,189,136,89,51,178,225,248,255,253,246,226,178,100,42^4,12,27,39,69,100,165,224,255,240,197,138,91,57,31,61,95,151,246,220,184,142,99,60,28,63,114,165,208,241,255,237,207,164,111,65,18,36,78,137,191,239,242,212,161,114,65,100,139,170,214,181,128,82,21,51,91,139,178,216,247,235,198,158,123,87,50,52,91,133,168,117,75,42,104,148,184,221,231,198,155,104,59,24,52,84,135,196,233,234,204,163,113,82,44,71,102,151,199,231,230,205,165,115,79,47,40,73,104,144,184,224,235,206,164,110,77,39,148,191,227,233,201,162,114,82,54,30^3,12,30,33,29,31,112,183,255,137,58,54,44,49,27,46,57,65,68,29,52,68,53,36,25,33,56,63,50,41,234,202,147,89,67,45,29,71,149,205,232,232,255,253,246,227,130,198,219,237,255,156,187,188,22,52,89,120,126,150,190,231,193,154,122,87,50,47,62,86,81,56,44,27,58,70,88,145,203,154,121,89,57,25,56,86,140,195,223,238,216,188,142,98,60,98,130,185,221,240,234,223,201,143,91,53,43,86,136,169,184,221,219,191,153,106,77,42,118,137,152,227,201,168,133,102,75,35)","AAP-DGA16 by Adigun A. Polack","(1,3,16,23,114,108,178,184,74,11,155,115,232,255,254,255^1,27,140,187,12,28,81,176,72,99,206,245,158,123,242,255^1,117,0,211,10,158,22,168,66,196,0,213,0,219,85,254)","Cheerful-32 by SoundsDotZip","(14,43,76,138,194,255,102,46,31,23,15,15,22,140,255,255,242,230,179,128,89,51,102,191,255,255,255,230,179,107,64,43^17,45,80,147,201,249,204,138,71,32,77,153,217,255,255,213,121,34,0,13,9,10,10,0,51,128,187,138,83,43,21,15^18,51,89,153,204,242,255,230,153,77,56,50,22,25,77,0,0,0,30,32,36,51,71,112,153,149,153,92,36,21,13,15)","DB8 by DawnBringer","(0,85,100,215,80,100,230,220^0,65,105,115,140,185,200,245^0,95,100,85,215,100,110,255)","DB16 by DawnBringer","(20,68,48,78,133,52,208,117,89,210,133,109,210,109,218,222^12,36,52,74,76,101,70,113,125,125,149,170,170,194,212,238^28,52,109,78,48,36,72,97,206,44,161,44,153,202,94,214)","DB32 by DawnBringer","(0,34,69,102,143,223,217,238,251,153,106,55,75,82,50,63,48,91,99,95,203,255,155,132,105,89,118,172,217,215,143,138^0,32,40,57,86,113,160,195,242,229,190,148,105,75,60,63,96,110,155,205,219,255,173,126,106,86,66,50,87,123,151,111^0,52,60,49,59,38,102,154,54,80,48,110,47,36,57,116,130,225,255,228,252,255,183,135,106,82,138,50,99,186,74,48)","DB-ISO22 by DawnBringer","(12,76,112,188,206,228,144,105,77,38,44,60,85,116,240,207,182,132,85,116,107,147^8,65,80,95,145,218,196,142,97,50,75,115,141,186,250,182,124,90,84,102,123,147^22,56,58,78,72,108,70,52,60,60,115,115,222,234,255,144,116,120,97,88,137,136)","DimWiddy 17 by DimWiddy","(20,103,117,135,139,119,14,41,87,240,177,179,221,248,254,242,173^4,16,75,123,157,202,103,48,125,121,111,60,128,204,201,254,211^21,16,55,86,83,115,63,101,172,163,185,111,34,1,175,255,254)","DimWiddy 23 by DimWiddy","(0,250,224,226,186,185,235,195,228,187,113,81,137,203,166,58,56,158,171,24,93,30,7^0,232,205,225,183,171,167,190,114,102,137,154,127,70,72,109,102,31,44,55,32,22,6^0,233,242,92,169,250,80,33,81,227,229,75,127,103,135,105,44,113,41,118,62,71,13)","Endesga-4 by Endesga","(251,229,66,32^247,176,110,40^243,131,93,61)","Endesga-8 by Endesga","(253,211,218,230,40,45,123,27^253,39,125,218,198,147,83,28^248,52,34,41,65,221,173,51)","Endesga-16 by Endesga","(228,184,116,63,158,229,251,255,99,50,25,79,175,255,44,4^166,111,63,40,40,59,146,231,198,115,61,103,191,255,232,132^114,80,57,50,53,68,43,98,77,69,63,129,210,255,244,209)","Endesga-32 by Endesga","(190,215,234,228,184,115,62,162,228,247,254,254,99,62,38,25,18,0,44,255,192,139,90,58,38,24,255,104,181,246,232,194^74,118,212,166,111,62,39,38,59,118,174,231,199,137,92,60,78,153,232,255,203,155,105,68,43,20,0,56,80,117,183,133^47,67,170,114,80,57,49,51,68,34,52,97,77,72,66,62,137,219,245,255,220,180,136,102,68,37,68,108,136,122,150,105)","Endesga-36 by Endesga","(219,163,103,78,57,38,20,123,80,46,26,15,13,15,14,19,65,240,229,197,148,98,70,151,229,247,251,254,237,196,120,53,77,127,180,227^224,172,112,83,58,36,16,207,155,106,69,39,47,77,130,178,243,210,174,129,85,53,33,67,112,172,223,151,82,44,31,20,35,59,94,141^231,190,139,113,86,58,32,92,75,66,59,56,109,163,206,242,252,175,120,88,66,48,31,42,40,55,107,155,89,54,44,40,82,134,179,214)","Endesga-64 by Endesga","(255,19,27,39,61,93,133,180,255,199,146,101,66,42,26,14,28,57,93,138,191,230,246,249,237,224,198,142,255,237,255,255,255,211,153,90,51,30,19,12,0,0,0,0,12,148,253,243,219,122,48,12,3,59,98,147,202,200,246,245,234,196,137,87^0,19,27,39,61,93,133,180,255,207,161,115,76,47,25,7,18,31,44,72,111,156,202,230,171,116,69,37,80,118,162,200,235,252,230,197,152,111,76,46,57,105,152,205,241,253,210,137,63,9,3,2,25,20,36,56,82,80,129,85,50,36,30,28^64,19,27,39,61,93,133,180,255,221,185,146,110,78,50,27,28,33,40,54,74,105,159,207,80,56,36,29,0,20,20,37,87,126,95,79,75,80,76,68,109,170,220,249,255,255,237,245,253,250,217,147,63,67,97,143,201,134,135,93,60,48,43,39)","Famicube by Arne","(0,224,255,215,168,123,52,21,13,65,113,189,37,10,0,0,32,88,19,0,23,55,106,140,190,238,182,147,204,255,255,246,173,35,92,174,197,226,79,130,218,225,245,255,255,207,135,163,204,213,254,226,166,106,90,33,61,98,155,152,91,10,2,0^0,60,255,215,168,123,52,21,32,93,166,255,226,152,82,96,181,211,157,78,40,109,180,214,235,255,193,151,143,187,231,143,78,23,60,108,151,215,21,60,101,130,183,233,130,60,22,40,105,156,201,201,117,49,25,22,52,100,160,220,168,137,74,23^0,40,255,215,168,123,52,21,48,102,161,202,205,172,128,75,98,50,8,0,8,3,23,18,113,169,33,23,21,49,55,55,26,18,13,55,130,181,7,61,94,137,132,197,206,113,70,179,228,252,237,255,254,202,145,64,165,220,239,255,255,255,202,125)","Juicy-32 by Real Juice","(51,102,153,204,255,229,178,127,61,7,79,135,216,255,255,178,80,37,16,10,18,56,107,184,255,145,53,62,25,91,165,211^14,36,76,137,204,114,53,24,6,0,31,77,157,199,235,214,178,124,84,57,29,71,122,197,255,224,130,106,40,53,82,116^34,53,76,124,181,57,53,75,61,14,27,54,97,89,140,96,71,73,72,71,53,102,153,216,242,204,130,178,102,130,139,132)","Juicy-56 by Real Juice","(0,255,200,165,120,85,55,25,20,15,15,65,115,220,178,140,90,55,255,245,230,195,140,65,125,170,215,240,255,255,190,100,35,15,15,130,65,20,20,15,15,60,100,160,230,255,75,130,180,230,255,255,230,190,150,110^0,255,225,190,145,100,65,30,70,115,165,205,255,155,98,60,20,10,210,165,110,65,35,0,0,20,45,105,170,230,215,165,125,85,50,255,215,160,105,55,15,30,45,65,90,140,20,10,35,80,140,205,155,105,70,40^5,255,235,205,165,125,90,60,90,115,105,115,115,120,71,50,35,20,165,110,70,45,35,65,65,60,45,35,50,90,45,30,20,25,35,225,215,205,195,155,105,140,180,215,230,200,60,100,110,120,140,180,150,115,95,80)","XAIUE-22 by xaiue","(252,135,8,55,91,159,107,179,175,77,75,181,229,224,112,61,43,29,109,182,206,243^250,116,6,46,77,126,205,214,176,140,76,69,139,218,176,127,64,24,67,102,152,215^228,105,11,35,33,43,99,239,233,211,183,55,55,44,60,79,75,62,105,166,155,189)","15P-DX by GrafxKid","(110,187,223,236,131,39,23,4,23,129,253,199,135,70,32^50,87,146,210,168,114,59,104,161,219,249,178,113,63,23^50,53,69,116,22,36,71,148,169,205,241,149,91,60,8)","20P-DX by GrafxKid","(23,71,120,177,235,104,169,217,235,82,129,188,235,14,4,1,85,23,90,177^13,71,120,185,255,41,68,126,208,60,96,139,205,76,110,163,222,121,178,227^32,87,118,166,218,62,0,0,0,20,49,87,147,88,146,195,183,71,23,41)","24P-DX by GrafxKid","(23,72,137,201,252,111,192,238,255,76,142,204,247,13,32,102,201,0,0,111,99,183,255,255^15,69,122,183,245,36,70,131,196,44,83,140,199,65,121,182,226,113,171,221,44,70,121,189^7,66,108,156,232,29,14,0,45,53,64,88,139,87,73,50,81,157,196,213,83,108,134,169)","Cabana-64 by Crabby","(0,167,103,71,48,58,90,195,241,253,255,255,240,224,178,130,255,255,169,109,69,104,149,218,242,255,255,255,221,192,144,96,74,210,163,97,51,63,97,143,210,242,218,150,57,34,52,34,16,105,162,113,67,44,8,27,91,182,209,170,76,28,13,10^0,154,84,53,32,22,38,104,110,164,226,216,157,105,78,51,255,252,128,71,45,11,28,72,118,175,245,118,57,34,12,1,74,204,146,84,47,13,24,75,145,237,255,218,174,116,58,20,16,132,188,159,86,50,67,116,190,255,255,255,212,131,57,37^0,95,31,19,26,3,11,10,3,20,44,135,81,38,44,20,255,219,90,52,37,118,188,221,255,252,246,147,57,20,71,25,74,243,212,118,58,118,148,236,255,255,254,255,255,255,241,120,16,156,197,147,85,51,57,74,97,140,204,216,148,147,111,99)","Fantasy 16 by Brettybooop","(142,81,51,20,70,166,211,231,238,217,117,20,4,28,67,96^109,58,39,19,24,60,123,188,238,213,115,33,4,27,80,161^52,24,16,12,32,30,30,79,250,91,32,15,5,47,99,143)","Fantasy 24 by Gabriel C.","(31,57,165,239,239,171,24,239,239,165,119,114,42,57,104,146,39,239,69,60,155,54,85,48^36,87,140,172,216,92,63,105,183,98,52,65,29,42,76,126,100,58,35,159,26,23,15,15^10,28,39,40,161,28,57,47,117,67,33,19,13,28,60,106,104,12,13,156,10,12,10,10)","Tranquil Fantasy 23 by windfall.apples","(165,201,209,162,131,99,65,40,58,95,134,172,212,151,101,58,34,80,133,223,172,124,76^45,109,202,157,107,73,51,34,59,99,149,194,237,181,132,89,58,59,91,185,220,168,110^39,69,128,107,63,44,37,31,61,103,152,195,237,138,92,65,48,104,105,202,241,213,173)","Tranquility Plus 39 by windfall.apples","(82,120,165,201,204,207,227,247,217,199,141,87,40,65,99,131,162,151,101,58,32,32,58,95,134,172,212,172,124,76,62,55,51,88,114,133,177,223,234^30,24,45,109,165,194,231,225,182,151,91,50,34,51,73,107,157,181,132,89,55,44,59,99,149,194,237,220,168,110,61,42,20,38,64,91,139,185,220^46,38,39,69,98,129,171,188,145,125,87,34,31,37,44,63,107,138,92,65,45,17,61,103,152,195,237,241,213,173,138,94,77,79,74,105,154,202,230)","Faraway 48 by Igor Ferreira.","(13,34,61,173,217,255,255,214,143,22,28,13,13,0,0,0,0,8,89,170,69,37,2,25,16,9,21,46,86,160,200,237,247,247,241,231,209,158,115,77,36,28,16,32,88,169,210,241^7,9,5,24,79,152,249,246,250,158,93,56,29,25,49,100,141,196,223,232,197,149,89,58,20,13,21,38,46,58,101,175,200,243,228,204,158,109,50,38,23,18,17,34,97,176,214,242^9,21,24,24,12,14,89,104,55,38,42,34,31,31,56,87,109,159,176,202,217,207,153,145,56,25,56,77,115,158,143,185,217,206,175,147,113,79,46,48,32,22,18,35,98,176,215,241)","Fleja Master Palette by Fleja","(31,43,65,104,144,182,255,252,181,138,92,201,222,255,255,252,180,81,48,35,38,35,65,76,99,148,184,60,70,130,247,194,133^24,46,72,113,161,203,255,191,128,80,58,48,106,173,229,249,214,196,156,109,79,54,114,147,194,210,253,41,39,100,164,113,45^51,66,89,122,168,207,255,138,87,62,65,56,56,59,150,96,69,63,99,122,110,99,145,173,201,212,255,64,92,129,139,130,102)","Koni32 by Konic","(0,11,22,34,43,48,52,73,164,255,242,204,245,166,153,115,77,70,140,242,255,179,112,64,31,33,39,65,109,137,187,255^0,10,21,38,64,101,168,242,255,242,165,122,64,58,83,55,42,52,46,97,168,223,165,124,80,62,47,69,112,139,189,255^0,13,36,64,87,102,112,90,99,64,63,71,37,58,72,88,73,106,184,218,212,255,250,255,204,166,102,88,120,140,191,255)","Linear Color Palette Basic by GrafxKid","(14,95,153,220,247,159,98,143,197,238,252,218,250,151,75,61,49,65,73,114,86,89,71,129,194,240,253,211,170,119,72^12,45,57,74,134,41,35,64,96,142,203,78,203,218,167,115,65,112,167,214,152,86,53,86,120,179,247,191,141,92,59^12,86,112,123,151,78,47,41,37,46,163,56,62,63,71,79,82,137,144,206,204,189,121,170,208,221,237,169,122,85,58)","LEGO colors from LEGO wiki","(255,217,214,255,0,255,0,0,0,168,71,255,5,149,153,94,141,0,0,95,128,244,91,156,76,228,135,222,238,255,44,245,48,170,70,104,211,160,205,226,245,119,150^255,187,114,0,0,255,0,153,204,61,140,102,157,185,0,116,116,37,51,130,8,155,28,146,81,228,192,55,157,255,21,193,15,125,155,195,242,110,164,249,243,119,185^255,123,64,0,255,0,0,0,0,21,198,0,158,11,102,140,82,65,0,101,27,0,12,145,86,218,234,139,195,153,119,137,6,85,195,226,234,185,222,154,215,78,59)","Lego Colours 2021 by Six Pies","(255,175,89,33,106,255,137,51,144,222,124,166,223,243,247,247,255,179,227,255,46,0,16,118,0,204,20,0,51,66,179,255,200,181,177,136,95,90,159,97^255,181,93,33,14,99,53,0,116,198,144,202,238,224,209,186,126,84,160,175,85,100,203,162,138,255,48,87,153,192,0,187,112,41,140,94,38,113,195,175^255,199,96,33,21,71,29,0,80,156,81,85,165,85,23,48,20,8,91,125,67,46,49,144,128,255,68,166,255,251,6,255,128,82,191,158,131,132,233,255)","Vines Flexible Linear Ramps by Vine 2D","(21,40,54,104,180,244,244,255,12,3,9,17,87,185,26,41,94,143,244,254,14,27,34,70,42,125,34,47,67,116,175,248,25,36,37,58,86,151^10,11,16,24,35,104,192,253,19,40,73,131,197,237,17,25,28,23,93,181,9,24,45,91,192,242,12,19,30,52,93,153,16,30,49,92,161,219^31,38,39,36,19,11,71,240,39,43,63,55,43,94,46,69,90,103,146,139,47,83,129,231,242,207,39,22,30,26,35,58,46,68,94,133,191,210)","Arcade Standard 29 by GrafxKid","(241,255,159,255,240,241,201,151,87,114,35,10,48,47,105,51,50,40,201,108,255,229,23,150,88,42,185,126,65^240,77,30,196,108,194,126,63,20,203,133,75,197,126,222,165,89,35,92,52,170,93,25,165,108,55,165,99,47^238,77,49,56,0,132,79,63,46,37,49,77,173,131,255,255,226,123,209,157,188,172,27,171,121,71,136,82,47)","ARQ16 by Endesga","(255,255,174,77,233,16,81,5,241,130,255,90,255,125,235,30^255,209,181,128,56,8,30,68,137,62,169,225,233,62,108,138^255,157,189,201,65,32,67,148,45,44,169,80,71,191,130,76)","Atom-8 by polyphrog","(179,255,255,108,0,0,64,136^0,128,255,217,128,0,64,136^0,0,170,0,0,0,128,136)","BLK 36 by BlackedIRL.","(0,18,41,70,107,144,193,255,255,229,193,140,102,63,41,65,100,140,185,165,90,65,53,54,10,15,20,34,66,140,255,255,204,135,216,255^0,23,50,75,116,158,217,255,204,149,106,75,51,35,23,40,52,81,145,230,185,133,74,39,42,74,102,137,188,255,224,150,82,42,56,104^0,61,104,140,178,221,242,255,208,159,125,99,75,60,76,102,153,204,242,255,229,216,178,127,51,76,91,110,127,155,145,95,80,56,67,102)","BLK-NEO by BlackedIRL.","(0,18,41,70,107,144,193,255,255,242,195,153,114,63,178,229,255,255,140,66,34,20,15,10,29,50,53,62,80,140,180,133,93,67,255,255,255,178,114,165,221,255,120,39,0,0^0,23,50,75,116,158,217,255,204,159,114,76,51,31,46,66,110,165,255,188,137,102,74,42,26,45,74,131,185,218,131,76,47,30,224,170,105,60,28,38,55,102,250,211,170,135^0,61,104,140,178,221,242,255,208,170,137,105,82,60,105,134,175,213,155,127,110,91,76,51,89,137,178,209,235,255,239,191,140,102,145,110,90,64,47,57,69,117,230,203,165,130)","Broken Facility by telepathic-melon","(36,137,173,204,249,86,131,163,181,202,77,152,209,221,243,200,216,232,242,248,23,72,122,164,205,80,94,127,157,202,32,63,119,185,203,237,243,219,233,213^33,131,169,202,248,55,87,114,150,184,28,25,36,75,121,104,153,192,219,241,96,140,189,207,222,68,156,198,226,241,44,45,38,40,81,167,190,235,221,196^30,119,158,196,247,53,72,84,105,128,45,30,36,99,226,38,63,79,137,198,31,54,64,65,94,186,204,206,223,234,86,109,115,79,53,216,221,235,232,223)","Bubblegum-16 by PineTreePizza","(22,127,214,255,255,250,255,255,148,67,35,104,191,16,0,0^23,6,36,132,209,253,128,38,33,0,73,174,255,210,120,40^26,34,17,38,0,255,164,116,106,103,117,212,60,117,153,89)","CPC BOY by Arne Niklas Jansson","(0,27,53,102,85,127,188,192,223,27,27,30,121,128,145,201,227,248,53,53,53,127,173,141,225,228,255,238,172,118,63,36^0,27,53,30,51,53,53,70,109,101,110,121,95,128,148,127,155,120,175,183,193,201,200,225,198,221,255,234,181,132,80,49^0,101,201,37,97,201,53,110,155,27,131,229,27,128,223,53,141,248,53,143,215,53,170,199,67,154,255,224,107,72,63,55)","Cade 15 by MonstersGoBoom","(16,53,68,76,4,28,92,124,56,142,188,250,212,255,226^15,22,98,186,85,153,74,142,16,2,70,125,146,215,241^12,92,188,255,36,36,108,141,0,50,4,97,12,80,210)","Calder 8 by Philip Dodderige","(213,12,4,226,235,0,8,33,253,117,128^4,37,121,201,73,95,164,67,170,29,123^7,165,55,6,29,168,132,203,29,107,115)","CD-BAC by DimWiddy","(0,218,127,196,244,199,119,49,55,142,214,245,253,206,93,48^0,131,55,196,251,240,226,152,54,100,151,206,245,63,9,20^0,92,16,102,74,220,142,63,141,227,255,230,249,80,41,33)","CG Arne by Arne Niklas Jansson","(0,94,34,76,12,108,68,123,138,235,92,226,170,255,181,255^0,96,52,129,126,217,170,226,54,138,46,61,92,217,181,255^0,110,209,251,69,71,204,249,34,96,120,105,61,63,181,255)","DinoKnight 16 by Retrospec","(15,41,83,149,241,197,141,81,236,234,205,124,48,0,71,31^21,39,88,146,241,141,82,61,213,119,61,63,66,131,164,97^27,50,103,143,234,101,66,61,109,48,61,140,113,200,77,67)","||||-22 by ||||","(250,70,92,87,97,107,153,181,135,166,180,13,18,78,113,76,22,173,227,235,255,248^249,59,87,98,115,151,11,97,135,164,180,13,22,64,96,126,156,101,102,148,193,226^249,82,90,122,81,85,45,114,116,156,180,13,130,166,186,216,120,95,37,136,146,0)","FZT Ethereal 16 by Fusionnist","(243,249,184,94,162,194,143,193,108,0,0,221,0,7,0,5^243,194,112,13,158,89,39,0,96,71,168,180,73,134,195,28^243,164,14,36,180,223,184,43,111,237,243,17,82,92,125,37)","Indecision by Nelson SMG","(255,143,68,40,47,75,69,242,212,227,148,87,156,209,180,109,44^244,204,148,87,43,59,124,182,110,66,53,37,101,180,186,140,27^224,203,137,99,92,156,214,61,51,98,61,59,108,140,71,50,46)","Island Joy 16 by Kerrie Lake","(13,79,130,197,240,251,255,190,123,116,65,50,42,125,193,232^8,43,91,145,189,223,249,187,178,173,128,83,35,56,108,153^13,36,49,84,119,155,228,178,78,187,160,95,73,64,91,115)","Journey by PineTreePizza","(5,17,59,105,156,212,245,255,255,255,214,148,66,34,16,37,61,115,189,237,255,255,198,119,66,44,21,5,14,12,3,20,72,120,176,250,199,146,91,57,36,14,19,26,16,40,61,248,240,207,143,82,15,53,100,155,212,237,255,212,156,105,69,45^9,5,6,23,50,100,161,207,122,65,26,0,0,0,7,8,17,38,64,123,184,245,216,176,144,100,60,33,4,11,39,68,139,215,255,255,212,143,83,41,20,15,34,70,144,192,255,255,194,150,87,41,2,0,0,14,30,76,151,102,52,27,12,0^20,36,58,73,71,83,93,142,125,125,136,122,78,41,38,44,50,61,53,57,74,64,49,42,88,94,74,55,33,66,105,145,212,255,241,255,225,184,125,70,44,44,67,107,142,116,110,184,151,140,101,75,46,59,76,62,60,64,87,47,26,34,40,46)","Shallowmarsh26 by archer","(16,41,61,77,100,94,140,203,154,131,84,77,79,80,255,255,255,247,219,178,121,81,139,210,251,255^15,41,61,89,105,142,198,219,172,128,87,104,135,177,252,238,213,156,112,75,79,58,86,107,162,214^16,45,61,74,95,110,118,196,182,138,93,138,166,182,246,199,108,63,85,86,74,64,146,181,180,203)","Lago Nenufar (Lake Water Lily) by Popxel Art","(244,231,154,255,208,143,202,98,50,25,255,1,54,26,63,59,112,33,68^163,120,63,211,171,99,219,154,132,90,243,92,178,208,126,37,45,31,40^20,48,27,180,152,88,251,255,146,122,235,15,32,107,105,122,151,52,59)","Juicy 17 by JerryPie","(225,37,84,55,60,99,215,160,163,130,114,198,209,233,215,117,72^246,34,180,79,114,228,233,113,172,132,89,148,198,157,80,78,216^210,44,60,122,82,116,91,77,166,132,151,168,170,70,60,59,206)","ChocolateGanache by Ladybug","(0,222,255,255,247,74,90,247,206,247,107,99,58,49,173,123,90,33,115,74,181,90,107,173,140,107,115,99,247,148,123,58,132,115,107,99,123,74,189,58,115,99,74,90,107,90,115,239,206,239,222,41,214,197,255,197,74,247,255,222,255,197,206,206,115,206,66,132,82,33,41,33,115,41,33,132,115,206,58,222,214,99,206,222,247,255,247,247,247,230,255,247,247,255,247,247^0,222,255,230,156,33,33,90,49,74,41,41,16,8,140,66,33,8,66,25,115,49,41,132,99,66,58,41,230,115,90,41,82,66,58,58,66,49,165,33,82,66,41,58,66,49,66,230,197,222,206,25,197,132,247,189,66,247,255,222,255,197,206,222,181,214,90,173,90,181,197,197,197,99,25,107,25,58,41,140,66,41,173,58,189,66,173,90,165,140,140,123,107,82,74,58^0,222,255,230,156,33,33,90,49,66,33,33,8,0,132,49,16,0,49,8,90,33,16,115,82,49,33,16,222,99,74,33,58,41,33,33,33,33,148,16,58,41,16,33,33,16,25,222,189,206,189,8,173,33,230,165,41,239,247,206,230,173,132,41,33,197,41,115,82,33,115,206,206,181,189,156,189,222,58,189,148,58,181,99,197,90,181,107,173,148,148,132,115,90,82,66)","Bright Winter 1 by Nai","(0,64,63,255,255,182,76,0,0,0,0,0,72,178,255,255,0,128,112,255,127,91,38,0,0,0,0,0,33,87,127,127,160,226,239,86,234,218,165,127,127,127,127,127,161,214,255,255,192,255,255,68,183,109,82,63,63,63,63,63,80,107,127,127,99,76,112,244,142,112,100,196,255,160^132,64,39,173,251,255,255,255,255,255,148,38,0,0,0,0,163,128,81,123,106,127,127,127,127,127,74,19,0,0,0,0,160,59,203,175,190,255,255,255,255,255,201,146,127,127,127,127,192,66,219,50,148,127,127,127,127,127,100,73,63,63,63,63,99,50,211,85,114,112,69,235,251,130^0,64,39,73,221,0,0,33,144,255,255,255,255,255,220,110,0,128,81,0,0,0,0,14,70,127,127,127,127,127,110,55,160,59,162,247,107,127,127,142,197,255,255,255,255,255,237,182,192,66,172,15,84,63,63,71,98,127,127,127,127,127,118,91,99,18,211,112,65,112,31,239,181,73)","Bright Winter 2 by Nai","(0,64,255,255,255,182,76,0,0,0,0,0,72,178,255,255,255,128,127,127,127,91,38,0,0,0,0,0,33,87,127,127,30,17,224,239,255,0,0,255,249,247,91,255,225,255,78,61,127,127,127,109,82,63,63,63,63,63,80,107,127,28,107,0,255,0,0,160,25,10,206,226,255,88,249,255,255,15,255,255,99,0,0^0,64,0,106,216,255,255,255,255,255,148,38,0,0,0,0,255,128,0,51,106,127,127,127,127,127,74,19,0,0,0,0,30,17,224,239,250,28,18,228,217,247,42,234,222,245,0,33,63,89,116,127,127,127,127,127,100,73,63,63,63,28,83,61,253,74,89,32,25,10,47,226,245,61,243,213,206,15,246,245,61,51,40^0,64,0,0,0,0,0,33,144,255,255,255,255,255,220,110,255,128,0,0,0,0,0,14,70,127,127,127,127,127,110,55,30,17,224,239,229,20,13,96,72,201,0,181,219,236,0,0,63,63,63,63,63,71,98,127,127,127,127,127,118,28,37,6,247,0,84,32,25,10,47,226,198,17,167,159,147,15,147,209,27,4,3)","Kawaii16 by Arisuki","(101,181,220,248,184,255,252,236,255,249,123,142,89,215,116,29^71,112,171,216,170,245,165,70,163,250,193,211,137,147,81,23^30,117,128,171,170,245,194,70,34,147,136,248,163,250,142,60)","0xdb-01 by 0xDB","(32,64,150,220,255,156,217,242,247,82,195,48,99,157,74,153,255^32,64,150,220,255,31,122,187,237,202,217,153,226,182,82,54,89^64,96,150,192,230,46,70,104,124,100,76,156,212,255,194,151,136)","GZXP by GrafxKid","(0,173,243,159,218,170,232,0,14,31,68^0,155,234,37,98,124,202,106,175,29,88^0,168,215,63,82,20,0,20,3,175,214)","Chromatic16 by DragonDePlatino","(0,144,255,128,255,160,255,255,255,32,64,0,48,0,160,255^0,176,255,0,0,80,128,192,255,172,255,48,112,208,0,96^0,176,255,24,0,0,0,128,0,0,0,112,176,255,224,255)","Piet Coding Language","(0,255,255,255,192,255,255,192,192,0,0,192,0,0,192,0,0,255,255,192^0,255,192,0,0,255,255,192,255,255,192,255,255,192,192,0,0,192,0,0^0,255,192,0,0,192,0,0,192,0,0,255,255,192,255,255,192,255,255,192)","Matrix by BoltBait","(18,18,18,43,107,108,108,107,107,44,18,18,30,153,53,170,0,0,0,49,176,176,176,175,175,52,0,0,51,173,73,197,0,0,0,66,234,233,234,233,234,69,0,0,71,193,94,208,0,0,0,66,255,255,255,255,255,76,0,0,91,214,114,235,88,87,86,134,255,255,255,255,255,135,86,86,112,234,135,237,145,145,145,176,255,255,255,254,255,178,145,146,132,255,158,240^106,92,50,18,18,18,18,52,105,107,108,108,30,153,34,109,173,147,64,0,0,0,0,67,172,176,176,176,51,173,47,136,229,194,85,0,0,0,0,88,229,233,234,233,71,193,61,147,248,212,93,0,0,0,0,93,246,255,255,255,91,214,74,185,251,226,148,87,86,87,87,150,251,254,255,255,112,234,87,199,252,236,185,145,145,144,145,185,252,255,255,255,132,255,100,212^108,107,108,107,107,53,22,18,18,18,50,92,30,153,32,100,176,177,176,176,176,70,8,0,0,0,64,146,51,173,44,125,234,234,233,233,234,93,11,0,0,0,85,194,71,193,56,133,252,255,255,249,255,106,12,0,0,0,85,208,91,214,68,175,255,255,255,255,255,154,94,86,87,85,148,226,112,234,81,189,255,255,255,255,255,188,150,144,144,145,185,236,132,255,93,197)","Material Design by Ruchir L. Sharma (@aguynamedruchir)","(244,233,156,103,63,33,3,0,0,76,139,205,255,255,255,121,255,245,213,101,61,41,0,0,29,0,118,198,255,255,255,109,183,136,74,49,26,13,1,0,0,27,51,130,245,255,230,62,211,194,123,81,48,25,2,0,0,56,104,175,251,255,245,93,229,240,186,149,121,100,79,77,77,129,174,220,255,255,255,161,255,248,225,209,197,187,179,178,178,200,220,240,255,255,255,215^67,30,39,58,81,150,169,188,150,175,195,220,235,193,152,85,23,0,0,31,90,121,176,229,233,230,255,255,234,196,145,76,28,14,20,27,35,71,87,96,77,94,105,119,127,111,81,39,47,24,31,45,63,118,136,151,121,142,159,180,192,160,124,64,115,98,104,117,134,181,195,208,182,199,213,231,241,213,183,136,205,187,190,196,202,222,229,235,223,230,237,244,249,236,224,204^54,99,176,183,181,243,244,212,136,80,74,57,59,7,0,72,68,87,249,255,254,255,255,255,182,118,3,0,0,0,0,65,28,79,140,146,126,161,155,100,64,32,30,23,23,0,0,35,47,91,162,168,159,210,209,167,107,60,56,43,45,0,0,55,115,146,200,205,203,246,247,225,172,132,129,117,118,79,77,127,210,208,231,233,233,251,252,242,219,201,200,195,196,179,178,200)","Rainbow by thehamster","(0,127,127,127,127,91,38,0,0,0,0,0,33,87,127,127,51,204,255,255,255,187,76,0,0,0,0,0,63,174,255,255,102,153,255,255,255,200,112,50,50,50,50,50,98,187,255,255,255,255,255,214,150,102,102,102,102,102,204,255,255,255,255,255,227,185,153,153,153,153,153,221,255,255,255,255,255,255,241,220,204,204,204,204,204,238,255,255^0,127,0,51,106,127,127,127,127,127,74,19,0,0,0,0,51,204,0,102,212,255,255,255,255,255,148,38,0,0,0,0,102,153,50,132,221,255,255,255,255,255,170,81,50,50,50,50,102,160,229,255,255,255,255,255,191,127,102,102,102,153,192,238,255,255,255,255,255,212,169,153,153,153,255,204,223,246,255,255,255,255,255,233,212,204,204,204^0,127,0,0,0,0,0,14,70,127,127,127,127,127,110,55,51,204,0,0,0,0,0,25,140,255,255,255,255,255,220,110,102,153,50,50,50,50,50,68,159,255,255,255,255,255,227,139,102,102,102,102,102,114,181,255,255,255,255,234,170,153,153,153,153,153,159,204,255,255,255,255,241,198,255,204,204,204,204,204,206,229,255,255,255,255,248,226)","Rainbow by BoltBait","(255,255,255,255,255,193,137,76,255,255,255,255,255,188,132,79,216,168,119,58,0,0,0,0,216,168,119,58,0,0,0,0,247,237,227,215,204,150,106,63,216,168,119,58,0,0,0,0,255,255,255,255,255,188,132,79,216,168,119,58,0,0,0,0,255,255,255,255,255,224,183,135,250,246,240,237,235,208,197,170,255,255,255,255,255,191,127,73,224,192,160,128,96,64,32,0^216,168,119,58,0,0,0,0,216,168,119,58,0,0,0,0,255,255,255,255,255,191,135,81,216,168,119,58,0,0,0,0,255,255,255,255,255,188,132,79,241,224,207,186,165,119,82,47,255,255,255,255,255,188,132,79,255,255,255,255,255,186,130,68,243,232,219,206,195,172,140,103,243,224,212,199,185,147,136,109,226,208,182,157,119,89,59,33,224,192,160,128,96,64,32,0^216,168,119,58,0,0,0,0,255,255,255,255,255,188,132,79,223,184,144,94,0,35,24,14,255,255,255,255,255,191,135,81,216,168,119,58,0,0,0,0,255,255,255,255,255,183,127,71,216,168,119,58,0,0,0,0,255,255,255,255,255,186,130,68,204,158,102,48,0,0,0,0,236,218,197,189,175,133,125,100,204,168,119,71,0,0,0,0,224,192,160,128,96,64,32,0)","SCRJ-XXXVI by StudioCRJ","(15,54,119,185,237,58,132,208,233,237,77,142,203,226,237,26,29,52,151,197,23,32,44,57,143,24,31,50,101,161,55,106,170,226,139,217^16,60,134,202,243,21,35,69,153,211,43,75,138,195,226,68,131,195,230,235,51,91,152,209,235,29,46,100,165,208,24,42,100,165,42,93^26,87,172,231,255,55,80,90,148,209,36,39,60,93,158,76,83,62,114,193,93,143,187,218,234,77,139,205,239,247,96,192,235,247,174,234)","Pxls Default from pxls.space","(0,34,85,136,205,255,255,255,182,119,252,252,253,255,190,112,49,11,39,50,136,36,18,38,139,210,255,255,255,240,177,116^0,34,85,136,205,255,213,183,109,67,117,168,232,244,255,221,161,95,126,182,255,181,92,41,47,76,89,169,100,37,18,12^0,34,85,136,205,255,188,131,61,31,16,14,23,145,64,19,23,53,108,159,243,254,199,96,168,233,239,217,116,35,6,0)","Lospec500 by the Lospec community","(16,44,107,172,236,148,222,233,243,77,110,162,206,218,232,247,30,0,38,90,157,0,98,166,211,62,56,51,54,109,94,140,176,222,154,200,204,250,255,255,246,255^18,30,38,40,39,73,93,133,168,53,76,109,146,177,210,243,64,101,133,181,230,139,164,203,238,59,89,136,197,234,91,120,167,206,77,120,153,110,162,209,232,255^28,49,67,71,63,58,58,55,51,51,48,63,72,99,130,183,68,84,76,82,78,139,119,150,211,101,179,222,244,214,140,165,184,237,118,175,255,121,172,213,224,255)","Moderna by yedamameday","(130,179,255,255,255,239,125,32,15,18,32,60,126,216,168,118,69,38,32,83,168,204,242,255^6,8,49,144,207,255,255,217,166,103,156,230,255,255,199,140,82,42,15,21,79,125,200,242^108,91,81,88,108,164,114,126,141,192,223,255,248,250,195,137,80,42,115,166,230,229,155,203)","Oak21 by Dan Oak","(248,179,98,174,238,255,177,82,24,32,37,116,86,62,56,129,163,69,110,175,255^135,73,26,57,141,244,211,127,40,67,118,241,149,76,18,74,119,75,120,188,255^61,91,142,172,255,159,110,85,58,74,119,235,217,146,50,84,95,78,128,197,255)","Nature's Embrace 55 by GrafxKid","(27,254,226,168,105,255,231,190,122,208,151,90,255,235,205,104,37,27,123,56,41,37,94,32,38,48,163,120,84,239,182,116,67,255,234,175,117,235,177,227,177,116,62,223,156,97,42,184,117,82,253,204,145,93,56^20,147,83,36,27,191,130,83,50,128,78,48,201,138,224,178,125,78,236,170,119,68,215,150,98,51,204,141,88,161,108,68,47,178,109,64,34,113,65,196,142,100,63,221,170,123,78,216,157,106,245,193,134,91,56^30,90,34,36,40,137,90,64,28,88,73,63,92,6,66,41,44,68,191,145,126,108,239,205,171,134,255,222,192,206,190,141,101,178,157,127,74,113,92,176,142,127,100,154,116,71,50,209,169,152,241,190,146,110,76)","RBYPGO by Marilynx","(255,255,255,255,255,255,255,255,255,229,203,177,151,125,99,73,255,255,255,255,255,255,255,255,255,229,203,177,151,125,99,73,255,255,255,255,255,255,255,255,255,229,203,177,151,125,99,73,208,182,156,130,78,52,26,0,0,0,0,0,0,0,0,208,182,156,130,104,78,52,0,26,0,0,0,0,0,0,232,219,206,193,180,167,154,141,128,115,102,89,76,63,50,37^255,208,182,156,130,78,52,26,0,0,0,0,0,0,0,0,226,211,196,181,166,151,136,121,106,95,84,73,62,51,40,29,255,255,255,255,255,255,255,255,255,229,203,177,151,125,99,73,232,219,206,193,167,154,141,128,115,102,89,76,63,50,37,214,192,170,148,126,104,82,38,60,34,30,26,22,18,14,208,182,156,130,104,78,52,26,0,0,0,0,0,0,0,0^255,208,182,156,130,78,52,26,0,0,0,0,0,0,0,0,208,182,156,130,104,78,52,26,0,0,0,0,0,0,0,0,208,182,156,130,104,78,52,26,0,0,0,0,0,0,0,0,208,182,156,130,78,52,26,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,229,203,177,151,125,99,232,219,206,193,180,167,154,141,128,115,102,89,76,63,50,37)","New Worlds 46 by Count Moriarty","(110,150,205,226,230,244,248,219,200,171,130,91,51,38,0,18,33,51,76,119,157,203,226,255,249,253,243,155,89,53,42,70,64,52,65,143,79,53,38,29,27,51,102,199,226,238^39,38,36,93,129,170,205,174,144,111,80,55,33,25,0,16,33,52,80,126,161,203,226,255,255,255,246,210,179,130,86,101,137,197,238,200,153,119,90,53,37,26,42,86,132,190^39,38,36,38,39,65,124,101,80,59,46,40,28,24,0,23,44,67,91,134,164,203,226,255,183,144,71,77,65,58,65,115,142,163,149,214,186,163,134,94,78,59,113,190,208,209)","Nauris-16 by Nauris","(140,88,62,154,215,245,192,100,228,157,210,112,126,52,23,31^143,69,33,99,155,237,199,125,148,48,100,55,196,133,67,14^174,99,55,72,125,186,65,52,58,59,113,127,193,157,75,28)","Dynamite by Pixi","(249,243,232,157,107,110,163,244,249,252,253,251,249,166,111,74,89,96,174,215,191,126,0,39,48,49,40,2,127,192,222,188,123,102,80,110,163,244,249,252^189,121,9,39,43,66,84,96,165,210,226,197,159,116,81,86,125,177,206,230,230,205,175,124,85,84,122,170,202,229,191,125,17,43,45,67,87,101,167,211^180,102,74,76,67,50,42,6,68,163,164,70,10,44,51,79,100,118,124,190,199,142,151,116,87,101,145,207,170,213,196,136,139,110,84,88,118,154,144,200)","Interstate 28 by maine","(254,244,244,237,187,144,111,161,218,242,232,193,148,99,35,52,70,90,120,87,58,39,31,71,85,137,161,182^254,234,213,176,94,58,21,25,69,132,103,65,42,22,25,46,83,128,204,163,113,66,42,66,99,149,185,227^223,163,101,72,37,37,25,32,60,108,106,102,94,73,45,76,116,144,185,134,108,75,44,20,46,76,116,179)","Downgraded 32 by daniel","(123,161,199,227,242,211,175,128,91,65,92,136,184,220,255,182,137,114,92,78,70,68,61,98,148,199,224,242,252,177,128,101^51,77,115,160,203,123,93,64,51,32,72,125,180,218,255,245,217,182,139,102,73,53,0,23,44,66,107,165,239,212,184,141^76,85,105,132,155,134,139,133,116,81,106,141,178,201,224,219,217,207,168,121,105,93,61,72,75,79,81,97,141,128,120,120)","Pear 36 by PineTreePizza","(94,140,186,242,255,207,143,60,61,50,50,71,75,77,102,255,194,126,96,67,39,62,87,150,227,255,255,235,176,115,66,90,128,189,255,255^49,63,97,166,228,255,222,163,110,62,41,59,91,166,255,255,194,126,96,67,39,35,41,66,105,181,145,86,48,39,36,38,54,72,107,181^91,93,86,94,120,112,93,112,112,79,71,120,171,255,227,235,209,143,112,79,54,71,75,83,86,112,102,75,92,92,69,94,107,130,151,181)","Pineapple 32 by PineTreePizza","(67,137,217,255,255,199,115,52,3,39,69,156,255,255,209,124,49,131,235,255,255,191,109,41,4,3,28,119,255,255,192,96^0,0,36,97,183,110,57,17,7,59,130,185,216,130,64,25,12,63,156,218,255,195,138,59,21,62,146,214,224,136,59,23^42,39,60,87,98,70,46,31,16,45,57,59,50,59,31,26,27,52,110,172,228,198,141,73,40,94,167,193,220,169,148,97)","Peachy Pop 16 by Kerrie Lake","(253,255,251,206,143,83,173,159,86,10,39,12,172,255,255,255^255,134,71,24,11,3,109,185,127,84,140,231,252,236,167,64^255,134,113,106,95,75,234,255,235,123,127,167,173,109,99,64)","Resurrect 32 by Kerrie Lake","(255,251,232,131,195,240,246,252,227,171,150,98,62,11,11,30,145,251,251,205,158,122,107,144,168,234,143,77,77,72,48,143^255,107,59,28,36,79,129,167,200,148,108,85,53,94,138,188,219,255,185,104,69,48,62,94,132,173,211,155,101,74,225,248^255,29,59,93,84,120,129,144,150,122,108,101,70,101,143,115,105,134,84,61,57,69,117,169,243,237,255,230,180,119,185,226)","Rosy 42 by PineTreePizza","(33,59,125,171,207,240,255,200,99,59,47,40,27,43,58,76,79,146,245,223,163,104,64,44,20,75,105,156,204,255,255,255,230,173,120,79,41,61,82,143,189,255^24,32,56,81,117,181,238,212,171,125,87,53,31,43,63,104,164,232,255,224,167,111,73,53,24,29,36,42,47,82,194,137,69,47,29,29,29,41,51,77,106,174^27,39,51,48,43,65,131,93,63,79,83,64,33,69,94,133,184,192,232,232,194,153,115,77,46,82,100,112,123,119,161,51,57,69,79,76,43,54,63,87,98,112)","SLSO-CLR17 by Luis Miguel Maldonado","(46,62,85,116,65,42,59,36,86,198,243,196,181,97,143,234,193^44,65,96,125,222,164,119,147,190,222,194,101,65,64,61,97,229^59,95,125,136,149,170,166,55,68,120,32,28,49,122,167,157,234)","Softy 15 by Eggy","(217,241,34,62,190,208,156,14,159,189,101,153,21,64,92^246,218,23,201,211,168,179,168,184,102,113,17,96,19,52^234,4,44,238,220,65,26,74,174,102,64,156,144,109,17)","SPEC12 by Smalls","(15,145,214,217,219,168,120,142,50,47,48,217^8,140,217,209,110,45,28,217,186,99,24,190^8,137,208,93,59,45,38,89,59,189,143,147)","The Roarin 80's by Malo","(164,212,223,78,9,51,1,245^0,62,137,112,23,0,0,193^56,31,46,38,126,67,14,197)","Starmancer by Ominux Games","(27,41,31,37,42,46,50,29,43,71,105,136,170,222,52,81,120,162,190,233,250,77,128,186,228,234,255,255,10,13,7,10,14,8,8,16,21,18,14,12,18,33,38,64,101,132,168,200,221,9,25,83^32,51,68,97,129,162,187,24,32,45,60,70,86,115,19,25,32,40,53,69,106,36,66,95,137,178,227,245,35,64,97,128,158,200,231,32,50,76,112,157,203,233,41,65,106,141,176,205,227,7,26,85^55,98,125,165,203,235,248,38,55,88,129,160,185,223,26,34,41,40,34,37,57,22,39,28,20,8,69,108,31,53,70,87,94,116,123,48,66,93,121,148,175,193,51,76,115,144,179,207,227,17,35,94)","SuperFuture25 by Endesga","(16,24,96,183,255,44,150,219,248,192,28,54,112,255,77,97,210,255,228,255,0,0,69,156,255^8,30,111,217,255,25,80,147,218,192,51,105,195,255,77,27,53,128,187,0,255,128,16,9,0^32,51,171,238,255,35,57,87,172,192,45,67,59,0,77,50,47,0,64,64,225,255,126,204,255)","SUNSHINE 35 by mysunnyrose","(57,88,70,138,235,113,184,207,255,95,164,23,143,66,179,47,9,87,63,204,255,130,236,186,238,169,247,239,251,224,252,131,214,250,255^12,27,85,156,218,68,153,152,221,82,165,92,172,187,240,73,180,60,160,101,176,44,83,48,93,52,93,101,167,109,142,57,133,203,255^20,31,68,115,141,28,61,31,61,26,30,69,43,92,182,131,172,143,211,184,168,123,161,58,131,38,100,68,78,52,38,29,51,103,255)","Sweetie 16 by GrafxKid","(26,87,177,238,255,160,56,39,41,64,79,134,244,147,85,50^28,41,65,123,208,240,184,110,54,91,164,236,244,182,113,64^44,86,86,88,121,114,110,123,111,208,247,248,244,193,133,86)","Calm 48 by Xina","(201,158,99,64,28,66,125,189,235,250,181,108,49,28,21,14,27,45,108,42,55,81,127,85,53,44,30,39,65,117,161,207,252,232,199,122,255,247,235,222,171,204,250,209,158,104,50,16^52,35,27,22,14,28,46,75,126,177,189,168,131,77,52,34,107,150,189,108,158,213,240,198,143,97,58,28,26,30,32,60,134,86,46,32,217,182,134,91,60,91,239,188,139,96,50,16^38,47,51,42,18,27,30,30,23,60,43,35,47,63,54,41,78,86,42,108,128,152,217,198,176,153,112,64,74,109,122,138,142,137,104,74,173,116,87,71,60,53,230,184,146,107,56,18)","Optimism by mingapur","(255,255,245,242,230,245,237,123,88,171,104,70,37,217,184,99,66,34,193,91,3,21,0,45,60,24,68,146,196,165,112,143^249,228,170,191,141,96,57,53,15,108,76,50,23,139,72,51,47,32,214,202,131,63,161,112,84,63,105,158,190,140,93,119^201,130,33,133,79,55,21,38,11,92,60,32,11,144,105,95,74,56,214,217,191,148,147,116,87,57,39,10,18,39,31,89)","Taffy 16 by PineTreePizza","(34,98,163,250,255,255,220,63,68,43,167,255,245,219,166,54^37,117,192,255,171,108,67,72,141,219,245,235,137,75,61,53^51,186,230,252,123,122,91,194,231,114,71,51,49,61,87,77)","Todayland Palette V2 by GrafxKid","(20,49,90,148,237,94,174,227,244,69,126,198,240,27,33,52,152,33,38,30,108,68,142,228,242^20,56,103,168,239,22,36,112,191,35,66,119,183,56,103,176,232,35,75,143,213,28,48,98,180^20,61,108,170,239,50,50,23,66,35,58,66,132,69,95,111,138,99,164,222,228,92,127,154,183)","TriRampo by ANoob","(112,204,232,255,218,93,37,75,47,44,122,174^48,49,125,206,240,212,162,86,50,32,135,194^117,132,67,107,209,119,168,235,143,61,153,194)","r|place 2022","(109,190,255,255,255,255,0,0,126,0,0,0,36,54,81,73,106,148,129,180,228,222,255,255,109,156,255,0,81,137,212,255^0,0,69,168,214,248,163,204,237,117,158,204,80,144,233,58,92,179,30,74,171,16,56,153,72,105,180,0,82,141,215,255^26,57,0,0,53,184,104,120,86,111,170,192,164,234,244,193,255,255,159,192,255,127,129,170,47,38,112,0,82,144,217,255)","Tropical Cone 24 by yedamameday","(13,46,112,158,242,255,82,135,207,255,255,133,39,20,8,7,21,10,14,16,255,145,91,47^1,2,3,5,66,134,17,65,138,189,255,199,173,120,72,36,4,42,151,206,253,161,106,52^3,19,45,58,27,28,4,7,10,74,115,58,29,67,77,66,56,148,196,227,227,159,115,64)","Vivid-17 by Irenaart","(7,45,60,74,129,49,85,247,226,255,200,149,241,120,83,98,170^8,39,73,74,97,145,246,255,190,223,107,39,89,85,111,149,231^24,71,101,168,197,231,255,224,87,49,54,74,169,55,97,60,93)","SHIDO50+ by Shidoengie","(0,1,11,15,92,191,3,2,23,50,109,172,72,105,134,172,215,255,139,176,210,238,176,219,255,72,112,169,222,255,255,146,182,224,255,53,93,134,178,217,255,185,220,20,19,32,44,65,121,51,90,117,181,255,224,183,148,114,75,40,1,31,61,90,127,166,209,166,127,90,55,21^43,77,114,158,208,255,43,76,114,156,205,250,25,42,65,95,138,189,67,101,142,193,105,156,218,0,10,18,87,152,198,28,52,105,165,21,26,45,76,123,188,82,128,24,54,87,137,191,250,97,150,197,250,255,212,168,134,101,64,31,0,31,63,97,135,178,219,179,141,105,66,33^35,60,64,52,66,101,52,75,98,112,151,193,38,48,65,95,127,164,59,80,109,155,62,67,55,39,58,48,50,47,104,61,66,92,127,80,107,120,144,166,205,117,142,80,125,153,179,208,235,153,179,208,242,255,206,165,135,105,70,38,1,49,73,105,141,179,218,167,131,97,64,32)","Intacto14 by Anoob","(34,75,135,203,98,86,91,214,242,237,171,82,55,140^21,85,155,245,180,96,41,69,115,187,99,33,173,222^41,97,163,239,222,214,166,98,92,142,117,82,162,140)","Itatsi by SoundsDotZip","(0,30,65,133,190,255,160,105,76,48,110,194,230,255,255,196,143,99,51,57,72,132,196^0,30,69,124,194,249,222,160,81,34,47,78,136,171,216,148,91,60,40,71,115,158,196^0,36,67,123,184,240,218,199,133,64,77,78,85,172,158,124,76,44,31,46,85,92,135)","ENOS16 by Endesga","(250,212,157,75,249,234,249,231,154,88,141,68,195,149,186,148^250,212,157,75,211,175,147,89,209,174,237,197,167,105,181,142^250,212,157,75,129,77,138,82,249,238,167,91,225,200,170,130)","Grixel Grotto by Northernite","(9,59,29,121,69,94,115,158,49,50,126,224,168,184,232,255^87,140,171,194,73,113,138,174,114,151,168,243,145,167,218,246^18,80,62,103,156,235,255,255,212,214,230,255,13,59,127,189)","Superb 8 by BigPotato","(246,238,237,61,8,119,230,0^250,234,196,156,145,107,40,8^255,24,149,9,205,125,0,0)","Undertones-17 by Irenaart","(20,65,58,53,143,94,69,220,255,255,204,161,164,244,194,129,188^25,65,127,227,217,187,131,211,254,208,146,92,47,91,73,88,176^35,104,167,227,112,73,82,123,229,53,69,62,59,122,152,141,194)","Tango by Duck","(252,237,196,252,245,206,233,193,143,138,115,78,114,50,32,255,173,117,92,239,204,164,238,211,186,136,85,46^233,212,160,175,121,92,185,125,89,226,210,154,159,101,74,255,127,80,53,41,0,0,238,215,189,138,87,52^79,0,0,62,0,0,110,17,2,52,22,6,207,164,135,255,168,123,102,41,0,0,236,207,182,133,83,54)","Cheese Palette by Gors","(57,247,255,255,168,221,255,255,192,214,254,64,111,117,145,178,197,223,33,42,103,136,108,240,239,12,62,91^21,178,216,245,34,73,119,150,82,139,192,91,120,70,117,148,188,214,62,102,145,172,14,27,70,49,98,138^19,59,96,148,0,0,0,20,54,103,125,62,68,36,53,92,160,202,72,113,133,151,0,15,46,2,0,44)","Equpix 15 by Night","(82,42,62,132,56,92,16,178,212,85,128,236,139,255,255^60,42,84,84,96,122,16,126,78,168,172,138,208,204,248^78,58,66,92,124,86,36,86,82,148,64,75,186,104,192)","Zughy 32 by Zughy","(71,94,122,160,191,238,244,182,113,57,60,48,90,125,160,207,223,138,40,57,57,57,86,142,205,255,244,244,230,169,130,79^45,54,68,91,121,161,204,213,170,123,89,44,83,112,147,198,246,235,204,120,71,49,64,71,96,174,180,126,72,59,112,84^60,67,74,83,88,96,161,60,52,68,86,46,83,113,142,184,245,241,223,168,120,75,100,140,147,182,27,27,46,59,148,107)","Voodo34 by Shamaboy","(17,55,98,131,189,28,45,90,141,51,106,164,236,41,20,85,160,58,128,244,107,198,248,254,199,225,232,242,58,101,134,122,185,248^20,61,103,142,208,33,66,119,201,39,68,103,152,72,157,191,231,195,243,251,24,34,66,149,45,93,147,216,34,50,82,98,137,208^38,95,137,168,239,83,128,185,242,93,138,195,247,74,99,65,114,144,181,248,48,78,132,205,30,44,31,51,34,35,52,64,104,148)","Franzston 30 by Virus610","(243,174,154,90,49,254,214,186,125,73,250,186,125,80,36,204,126,86,56,32,130,102,68,71,45,223,147,51,55,43^232,141,86,56,29,241,179,134,83,44,251,194,118,81,36,231,178,154,90,49,190,180,162,114,69,243,170,104,84,58^237,153,118,69,35,223,147,98,36,2,222,142,68,56,19,208,144,117,58,29,216,210,190,120,73,254,214,178,125,89)","Night 16 by Night","(15,255,12,72,121,176,101,63,185,255,221,154,100,51,118,197^15,248,33,88,160,206,127,69,157,221,148,81,75,48,112,163^30,188,51,109,176,157,73,54,106,145,91,66,72,51,136,179)","Star 29 by Starlane","(142,241,83,44,13,27,37,45,54,92,255,179,116,68,32,186,236,123,81,50,108,211,63,33,96,175,53,34,17^36,34,31,18,18,29,49,71,109,196,255,179,122,76,40,93,129,57,37,22,50,60,38,24,163,239,109,68,31^54,60,40,29,25,70,105,141,192,249,255,225,165,108,56,47,47,42,32,21,150,242,104,57,61,73,50,43,25)","Star 34 by Starlane","(13,27,63,108,211,240,255,241,142,83,44,37,45,54,92,179,116,68,32,50,81,123,170,217,238,255,245,236,186,17,34,53,96,175^18,29,38,50,60,104,255,34,36,31,18,49,71,109,196,179,122,76,40,22,37,57,100,153,202,206,158,129,93,31,68,109,163,239^25,70,104,150,242,125,255,60,54,40,29,105,141,192,249,225,165,108,56,21,32,42,57,90,146,95,63,47,47,25,43,50,61,73)","Still-Life by cure","(63,122,209,224,93,104,179,18,81,40,155,168,204,199^40,34,59,127,133,193,232,38,49,111,139,228,130,181^17,34,39,138,58,39,104,21,85,184,255,212,24,129)","SimpleJPC-16 by Adigun A. Polack","(5,34,84,155,225,245,254,139,124,103,49,64,161,165,154,234^4,31,53,110,176,238,254,225,194,143,111,74,77,104,147,145^3,49,22,45,71,155,254,224,100,203,35,104,63,212,183,130)","Acid 15 by pyrometal","(23,64,143,211,128,55,227,244,28,9,28,33,201,181,192^3,7,30,96,128,190,218,249,13,68,81,151,130,215,248^38,61,64,54,128,161,120,210,89,64,130,59,155,55,175)","Battery 24 by Battery Jellyfish","(248,51,87,120,143,166,217,224,230,232,232,226,252,118,58,201,181,65,70,76,73,70,66,48^255,36,55,68,71,76,87,70,99,152,203,237,255,232,224,250,242,196,179,144,119,98,74,48^186,49,82,101,106,108,124,70,76,81,88,130,222,86,86,117,107,124,142,161,145,135,112,66)","Clumpy 18 by windfall.apples","(112,178,224,236,236,179,123,96,73,38,70,86,120,181,231,219,184,153^26,42,132,188,229,203,130,26,17,24,32,76,127,197,232,192,131,78^106,121,172,210,255,255,254,188,115,29,27,56,83,155,183,158,71,46)","Cthulhu by Starlane","(29,165,240,82,43,30,59,82,125,199,184,126,143,229,206,133^37,229,250,165,98,48,66,123,193,255,203,141,169,222,160,71^49,197,253,147,103,58,81,146,193,243,216,161,144,187,97,49)","Crimso 11 by Crimso","(255,243,191,118,203,142,122,94,142,134,69,61,53,35,65,17^255,215,150,154,94,57,73,69,195,118,110,98,61,46,41,11^227,98,81,85,49,61,98,49,207,150,81,134,90,50,45,17)","Copper-Tech by Arne Niklas Jansson","(0,38,53,96,137,90,145,255,244,191,197,158,95,220,110,22^0,33,82,116,137,168,217,255,205,181,136,91,67,57,169,81^0,68,120,138,137,178,243,255,114,136,67,71,81,45,44,221)","DRZ15A by Drazille","(20,57,102,165,216,242,255,255,81,83,128,133,164,255,207^20,47,72,93,114,154,227,255,90,127,130,171,219,191,238^25,71,81,82,114,128,91,238,142,59,126,221,114,252,247)","Eggy 15 by Eggy","(46,14,70,73,240,202,60,196,158,246,43,234,175,221,249^64,12,9,82,242,30,155,27,126,52,207,157,216,212,217^61,27,161,102,208,15,135,227,116,104,242,24,126,203,85)","Europa 16 by Starlane","(255,117,49,40,26,46,79,164,236,148,59,32,81,164,220,240^255,206,122,55,27,53,102,188,248,212,120,50,32,62,125,204^255,234,215,133,53,78,120,194,96,70,80,46,49,75,94,144)","GreyT-bit by Sam Keddy","(87,132,207,248,141,105,209,255^67,136,211,200,219,207,179,142^104,211,193,104,52,239,255,101)","Jewel by AprilSundae","(50,102,184,210,242,240,223,188,121,86,74,77,115,116,156^30,36,40,106,197,232,183,123,65,96,143,193,227,130,172^45,49,28,18,60,156,127,98,107,148,169,179,123,161,186)","Polar 11 by Smalls","(10,171,209,245,245,135,153,95,51,45,47^10,41,105,202,241,140,194,148,157,98,43^10,41,31,47,237,129,78,72,181,150,107)","Sheltzy 32 by NatTorpedia","(140,69,131,201,70,21,44,34,86,139,204,255,204,163,104,0,56,102,139,156,94,57,128,195,255,189,236,255,255,255,244,255^255,184,151,236,198,137,91,42,106,171,226,219,172,109,60,0,0,59,114,216,150,83,12,75,148,31,97,164,246,218,176,255^222,179,64,133,87,104,109,92,137,191,225,165,104,62,52,0,44,147,222,252,221,192,83,145,179,63,74,104,174,112,60,255)","Wyrm 24 by FrogWyrm","(27,64,131,188,209,233,255,81,104,110,151,216,246,31,51,73,127,195,121,186,86,162,209,251^2,47,63,110,96,145,220,48,71,30,29,53,165,44,64,90,130,198,101,168,73,142,198,245^3,50,57,90,63,78,148,76,99,62,40,44,122,55,89,111,133,187,70,98,82,141,183,220)","Yume Nikki by Space Sandwich","(255,232,0,89,185,236,240,255,187,132,68,19,27,58,108,174,236,135,104,62,11,47,86,98^255,22,0,40,69,104,163,201,162,103,53,21,21,49,80,151,208,97,54,17,54,66,116,209^255,35,0,62,98,124,210,197,211,166,85,35,22,51,80,99,95,33,43,28,11,64,44,220)","Rube-Goldberg","(225,243,203,240,206,240,4,84,35^225,215,190,189,108,52,176,160,39^223,84,173,138,55,40,216,79,34)","BoomBoom by Salman_Shh","(0,36,255,190,68,49,27^0,36,255,38,137,162,38^0,35,255,51,26,242,50)","Generic-8 by GrafxKid","(28,237,161,243,238,45,64,37^17,236,59,127,150,83,169,166^33,233,59,154,26,101,51,197)","Crayola Blind","(142,202,255,252,147,181,2,0,255^49,52,145,214,223,179,164,70,255^121,53,164,103,184,92,211,140,255)","FunkyFuture8 by ShamaBoy","(43,171,255,255,255,255,51,73^15,31,79,247,129,218,104,231^84,101,105,248,66,69,220,236)","The Golden Wall Palette by Hans Hofmann Interpreted by Reptorian","(167,217,67,134,239,203,248^201,112,94,79,207,107,241^75,21,159,37,26,139,233)","Matriax8c by Davit Masia","(240,250,16,0,210,160,115,16^240,200,200,160,64,105,100,24^220,0,64,200,64,75,100,32)","NT1H by NatTorpedia","(255,172,70,21,34,66,101,143,189,171,139,86,56,255,237,222,194,75,138,188,228,255,156,94,57,25^255,246,198,137,47,93,144,185,223,209,171,106,58,241,198,153,94,0,0,19,54,154,216,150,83,21^255,147,87,104,70,105,139,172,204,210,191,137,99,141,96,60,34,59,71,52,54,112,252,221,192,127)","JerryPie 22 by JerryPie","(30,36,55,156,220,196,147,121,82,157,118,41,52,64,114,83,207,224,210,53,25,85^36,81,150,198,239,215,121,65,60,125,68,71,119,213,178,137,190,110,57,41,23,46^49,104,155,217,248,164,70,34,32,174,110,45,80,142,69,71,91,54,28,29,22,65)","Nineties Nine by Cubby Crazes","(30,111,175,161,99,44,18,201,192^28,112,179,136,67,44,133,125,34^33,120,184,192,141,201,35,44,81)","On70 by By8Bits","(105,125,143,163,179,194,210,99,112,125,140,153,166,179,87,102,117,133,150,163,176,29,42,47,61,75,96,117,45,50,57,61,83,94,114^6,16,29,44,61,79,100,33,45,57,73,89,104,121,33,50,73,98,125,142,165,30,50,63,91,114,142,169,97,112,130,143,163,168,184^83,89,88,92,96,100,113,33,45,57,73,89,104,121,15,23,36,50,69,85,104,97,112,117,133,150,168,186,26,38,49,64,95,110,135)","ANB16 by Anoob","(10,105,223,247,212,120,232,242,255,136,63,55,72,113,158,77^8,117,233,170,104,44,53,130,199,196,158,52,84,153,82,37^13,148,245,168,154,150,98,92,110,77,89,97,168,217,82,54)","Retrocal-8 by polyphrog","(110,42,116,252,198,47,119,238^184,88,163,255,80,20,68,156^168,79,63,192,90,47,72,93)","Punolit by Punoli","(202,114,68,46,30,20,7,9,18,47,75,145,230,220,183,153,107,49,58,110,151^235,154,96,56,24,8,1,24,55,107,151,185,226,205,131,81,44,14,33,63,87^224,161,119,80,46,26,9,32,53,78,79,91,158,147,107,84,64,37,64,95,108)","Luap 40 by Luap","(89,109,134,181,224,240,230,217,196,189,140,115,102,51,67,70,84,102,130,161,194,245,218,191,163,136,109,81,54,26,51,64,87,115,179,217,230,217,201,191^112,161,191,217,230,235,204,159,115,85,63,52,41,26,48,74,103,153,181,213,242,245,218,191,163,136,109,81,54,26,41,51,70,95,147,184,212,184,143,105^128,138,143,163,195,192,161,130,108,95,82,83,76,51,87,115,153,204,217,230,242,245,218,191,163,136,109,81,54,26,31,38,57,75,116,152,195,173,143,121)","Autum Villan 6 by Chase Stemel","(73,137,242,169,94,35^17,88,244,146,80,32^28,97,243,125,63,26)","Autum 15 by jok","(102,0,51,85,136,170,187,255,255,85,153,102,187,68,17^102,17,17,0,34,102,153,221,255,85,153,119,221,51,34^119,34,17,0,17,34,119,187,238,51,68,170,255,68,68)","Autum 15 [Yellow] by jok","(85,136,204,221,255,221,153,85,255,187,102,102,68,34,17^0,34,136,187,221,204,153,85,255,221,119,102,51,51,17^0,17,68,153,187,119,68,51,238,255,170,119,68,85,34)","Galaxy Flame by Rhoq","(105,58,43,17,21,29,49,79,154,237,245,232,182,112,64,21^159,112,69,18,29,50,78,93,159,230,216,178,131,77,35,16^173,142,79,21,26,48,63,66,135,203,147,111,76,43,30,21)","Cretaceous-16 by Joao Vasconcelos","(49,50,69,58,124,103,98,81,121,113,158,153,172,166,180,188^52,62,75,95,69,82,80,107,108,130,128,133,144,162,171,183^50,66,75,59,69,57,85,67,100,69,92,121,134,150,143,165)","Antiquity16 by ILTA","(32,45,69,109,177,232,232,93,142,112,138,229,241,210,222,232^32,33,41,61,107,159,190,117,146,123,167,93,134,103,154,216^32,30,35,41,74,110,130,87,87,136,172,77,108,48,40,165)","Mushroom by Jimison3","(46,69,122,153,205,251,242,176,153,102,68,87,120,169^34,41,48,61,104,185,236,169,127,89,56,96,138,178^47,63,69,65,61,84,139,135,115,100,70,105,135,162)","Aerugo by Lizalot","(47,79,114,149,199,231,147,162,200,245,107,129,170,255,209,186,137,104,85,60,52,135,100,70,47,36,27,170,145,134,113,94^30,51,54,57,85,109,78,102,125,169,139,163,195,255,208,183,138,100,77,61,50,209,161,100,72,46,32,156,127,98,91,72^26,34,39,44,51,70,40,60,64,91,140,142,158,255,206,178,138,97,75,59,48,239,194,128,92,53,38,138,109,74,72,53)","Hotel Paintings 6 by Chase Stemel","(246,247,245,242,132,60^189,237,202,132,165,55^96,226,195,130,157,68)","Nopal-12 by BlackedIRL.","(226,197,168,146,255,251,241,204,241,228,202,171^228,207,181,146,236,212,180,163,234,219,193,164^223,196,174,156,237,210,180,163,182,160,138,123)","Brightness GPY by rickthepalette","(170,237,235^212,168,224^179,162,133)","Blessing by Maruki","(116,150,247,255,216^86,251,255,179,191^155,199,174,203,216)","Fairydust 8 by Yousurname","(240,227,196,99,100,43,147,240^218,154,93,75,97,169,212,246^177,172,159,125,194,180,181,232)","Vanilla MilkShake by Space Sandwich","(40,108,217,249,176,172,179,254,135,176,233,255,222,255,255,255^40,86,200,130,169,204,227,170,168,235,245,230,163,195,247,247^46,113,191,132,228,228,218,228,137,147,157,198,139,132,160,228)","Fuzzy Four by P-Tux7","(48,255,0,255^35,55,250,253^135,150,172,175)","Fairy Tales by lollige","(14,210,77,255,75,131,112,173^48,0,217,230,49,96,143,184^166,0,40,0,89,111,77,112)","Naji 16 by Naji","(16,61,100,72,63,106,116,89,183,141,100,192,200,220,242,230^26,14,17,46,66,52,67,85,62,109,150,113,146,162,201,209^58,38,61,105,90,101,74,121,98,156,124,159,108,134,102,213)","Easter Island by skamocore","(246,230,134,121,245,237,204,202,57,141,129,104,157,126,86,5^246,209,134,71,225,195,141,101,212,188,132,96,192,167,120,22^191,209,145,101,122,141,134,126,185,210,171,134,133,136,100,37)","Pastel and Darks 58 Palette by Glxss","(248,231,165,119,76,44,247,234,165,119,77,234,166,121,76,44,33,243,225,156,110,69,39,29,196,127,58,28,4,0,130,46,22,148,101,66,48,24,5,121,74,24,9,0,3,130,74,54,28,190,159,95,64,237,217,152,109,36^183,134,71,34,17,3,197,165,89,62,35,212,141,97,60,34,26,247,234,165,120,78,44,33,247,235,167,119,77,43,235,165,121,225,204,144,105,65,36,179,147,88,59,35,0,118,64,46,22,163,123,61,38,193,148,97,58,7^181,130,66,30,14,0,165,121,39,27,9,134,53,15,4,0,0,217,160,90,35,15,0,0,213,163,94,58,29,15,221,150,108,246,233,166,121,77,33,247,234,165,119,77,43,234,165,120,76,248,234,167,121,248,234,166,121,42)","17 Pastels by Irenaart","(55,104,94,37,17,105,239,248,163,109,161,249,200,247,155,28,89^50,53,107,113,171,246,240,229,231,68,101,139,76,145,156,134,177^84,111,130,140,190,191,215,116,92,66,87,183,102,82,130,109,94)","NOSTALGIA15 by Arisuki","(239,246,248,239,199,80,113,151,117,128,196,116,24,70,136^208,217,161,99,85,23,50,94,91,143,187,168,111,164,175^174,55,83,97,94,51,60,94,108,170,184,162,94,95,146)","Ocaso by Minord","(75,126,207,243,250,185,126,82,76,118,98,203,254,255,191,152,146^65,89,104,147,218,199,182,166,119,109,87,129,142,249,240,184,153^74,86,90,106,109,115,120,126,104,109,96,119,143,187,240,209,173)","Oh Hell, Pastel by StarlitSunset","(252,252,250,255,247,163,128,87,81,112,109,88,132,190,222^153,189,230,247,246,217,217,207,192,165,116,68,89,87,118^119,144,170,213,166,106,155,201,219,212,207,120,201,194,165)","Pollen-8 by Conker","(115,171,238,255,255,255,114,52^70,86,106,167,224,231,220,172^76,117,124,165,126,214,187,186)","KULE-16 by Cuymacu","(41,117,174,229,233,255,255,255,242,124,56,62,101,198,248,176^20,51,95,105,142,159,185,205,241,227,217,161,98,119,167,156^13,85,80,78,112,43,134,44,213,252,137,216,189,234,212,184)","Hydrangea 11 by Dinchen's Art","(65,111,152,192,212,234,201,144,111,98,87^54,87,111,144,190,228,212,192,145,119,95^82,126,156,167,184,221,184,160,156,140,126)","Fluffy8 by vee","(147,255,255,255,212,150,118,68^58,149,196,236,213,179,121,56^99,177,207,240,246,253,219,122)","ST 8 R&B Remake by Skiller Thomson","(26,77,179,242,133,51,20,10^9,19,36,97,177,92,31,10^8,19,45,116,242,204,102,26)","Neon Space by Jimison3","(223,254,255,255,255,11,1,1,62,53^7,84,158,208,253,255,203,136,50,42^114,111,125,128,255,230,207,165,100,85)","Cyclope6 by Royal_Naym","(65,99,50,11,14,48^29,27,83,138,175,225^49,52,95,143,155,185)","Sy17 by xaiue","(253,37,128,187,111,57,62,76,153,218,193,179,102,2,68,144,198^253,42,128,191,160,114,93,143,191,213,162,112,64,2,64,95,141^248,140,128,221,192,190,88,73,105,115,167,182,150,7,34,63,65)","Syz15 by Fusionnist","(14,157,242,176,201,216,82,14,104,141,18,83,34,18,34^12,31,140,86,173,225,180,79,6,90,111,38,20,47,52^25,47,140,33,35,169,102,56,47,136,126,154,82,112,33)","TUI-15 by Jeremy","(29,19,23,70,120,16,21,162,43,240,178,197,240,124,226^13,34,55,58,77,66,112,109,161,176,162,180,194,219,231^13,66,39,49,48,172,155,61,195,63,131,208,152,207,249)","Cave by PineTreePizza","(0,16,54,68,143,199,156,245^0,0,29,63,86,144,228,245^0,41,35,79,179,101,199,245)","Psygnosia by Arne Niklas Jansson","(0,27,54,68,82,100,115,119,158,203,224,162,0,8,84,81^0,30,39,63,82,100,97,120,164,232,139,50,51,74,106,108^0,41,71,65,76,124,80,91,167,247,121,78,8,60,0,191)","MarshMellow32 by FormalPrejudice","(43,58,87,140,63,85,118,164,89,115,140,184,193,175,144,113,60,84,161,182,226,178,124,75,60,78,110,143,32,35,45,94^63,83,121,166,62,87,127,171,50,65,80,122,188,164,123,85,60,74,98,130,181,178,124,80,58,60,77,97,65,91,128,179^65,86,125,151,32,53,69,121,52,65,77,102,172,145,103,74,60,68,59,65,95,178,124,83,63,92,126,154,91,124,166,188)","Lost Century 24 by CalmRadish","(182,210,198,188,184,147,105,81,73,91,113,136,154,97,141,170,175,138,102,81,75,171,132,108^92,201,164,133,99,78,67,62,52,69,98,131,155,92,121,143,179,153,132,108,90,155,120,89^95,165,130,99,67,72,67,69,61,95,125,152,167,80,78,104,129,109,95,94,87,142,117,92)","Finlal 11 by Finlal","(23,83,34,175,59,35,159,136,189,203,228^20,12,53,52,102,132,132,158,160,201,229^25,30,85,81,136,51,116,183,188,144,241)","Industrial Factory 16 by Toby_Yasha","(222,151,103,182,177,151,144,94,129,95,129,104,83,61,47,0^206,182,135,168,134,119,84,74,135,93,144,101,74,68,44,0^180,193,130,123,82,96,77,72,101,79,77,68,59,59,39,0)","Murder Mystery 16 by Toby_Yasha","(222,156,128,83,224,161,120,62,187,122,75,187,141,94,121,99^206,171,128,74,155,125,92,43,143,98,65,100,62,41,146,96^180,177,120,59,77,55,59,34,107,96,88,58,41,47,64,46)","Fate & Destiny 12 by Toby_Yasha","(223,139,114,65,166,74,94,213,191,120,74,0^216,195,133,67,170,151,109,169,106,61,65,0^192,202,130,90,98,92,44,58,50,53,38,0)","Vinik 24 by Vinik","(0,111,154,197,139,195,165,102,154,194,124,65,141,190,104,56,110,147,110,85,157,126,93,67^0,103,154,204,85,136,147,96,79,141,161,106,98,149,172,112,105,161,170,112,159,158,104,52^0,118,151,184,128,144,165,146,80,117,192,163,104,92,169,128,98,103,120,100,127,153,114,85)","YKB-22 by yahkehbu","(207,156,40,72,128,184,210,210,231,128,116,104,74,83,165,141,71,64,174,207,138,169^207,156,37,46,74,146,183,194,229,120,91,74,104,161,199,169,126,72,134,157,95,119^201,151,42,43,62,134,174,174,209,104,65,69,93,112,135,174,136,89,178,185,103,119)","Halloween by Mememellow","(23,41,59,88,89,153,162^19,27,29,54,88,139,163^24,23,54,57,77,116,220)","Graveyard-21 by AprilSundae","(133,163,190,138,118,27,48,69,91,117,143,166,141,118,101,79,108,123,131,159,189^122,138,181,105,91,26,45,60,77,99,122,147,127,116,104,85,111,132,135,168,201^104,121,144,102,98,31,51,73,94,118,141,160,152,136,111,79,101,122,152,179,206)","Steam Lords by Slynyrd","(33,58,79,161,119,119,96,59,23,47,67,79,101,124,160,192^59,96,119,159,116,92,59,33,14,33,58,82,115,148,185,209^37,74,84,124,79,79,58,55,25,59,96,119,140,161,186,204)","Frostical by yedamameday","(88,56,35,16,2,47,104,136,176,215,70,96,130,152,33,66,135,168^132,85,53,25,1,50,120,159,192,221,70,105,146,176,21,44,96,133^132,96,67,41,7,98,156,179,201,223,84,123,165,193,56,91,144,168)","DeuteroSpill by Royal_Naym","(21,24,29,69,109,127,150,172,203^52,60,73,88,110,128,153,178,213^87,92,97,93,70,104,142,177,252)","Cool Bone 7 by Chase Stemel","(44,139,196,75,34,18,42^73,151,196,79,39,17,19^88,156,196,77,37,19,30)","Muted Ally 6 by Chase Stemel","(44,122,150,127,217,235^44,122,176,106,199,231^57,147,179,98,180,229)","EPHEMERA by K C","(57,74,90,98,115,131,131,164,197,213,222,230^44,60,85,105,129,137,145,157,178,190,214,234^49,74,90,106,123,139,139,164,189,205,222,238)","Ink by AprilSundae","(31,65,89,150,234^31,58,96,162,240^41,66,112,179,216)","Violet Dreams by Solitaire","(237,212,168,94,35,19,1,0^233,191,113,64,27,37,28,0^213,186,131,94,69,51,28,0)","Tinyfolks by Pierr Vandermaesan","(255,139,77,48,31^255,149,83,51,31^255,109,60,41,31)","Old Gold 7 by Chase Stemel","(52,74,133,168,185,88,62^52,74,127,159,170,54,20^50,72,92,104,148,68,55)","Rosemoss-8 by polyphrog","(10,85,171,177,200,100,88,45^13,40,59,116,172,108,74,41^17,4,30,61,147,94,23,28)","AAP-RadiantXV by Adigun A. Polack","(7,33,82,138,193,234,160,83,66,89,107,184,121,87,148^5,25,58,107,156,219,179,124,60,111,185,170,112,98,91^5,25,42,62,77,116,53,68,86,175,182,176,126,122,40)","AAP-Majesty XVII by Adigun A. Polack","(244,177,109,49,15,118,173,212,234,151,88,43,56,44,108,118,196^243,137,83,35,12,38,80,147,207,171,120,64,78,153,220,56,84^222,97,79,44,15,38,35,34,90,57,42,36,150,204,213,88,113)","Dead Weight-8 by polyphrog","(73,138,222,164,144,36,93,144^84,142,191,101,46,23,69,124^53,72,137,62,41,27,62,104)","Mojave20 by magodellepercussioni","(220,200,174,145,96,64,56,75,121,158,190,164,113,69,63,46,23,84,208,251^209,180,176,150,96,63,53,68,98,134,150,104,90,62,41,21,9,30,60,166^184,150,178,160,106,74,62,76,93,118,104,72,59,42,38,21,12,19,50,76)","Petite-8 by Adigun A. Polack","(10,24,39,71,123,197,239,248^10,27,47,83,128,175,217,244^16,34,59,78,70,99,141,228)","Petite-8 Afterdark by Adigun A. Polack","(7,13,22,39,75,119,160,187^8,15,28,43,74,97,124,154^16,17,32,41,39,49,67,103)","XAIUE-Radiant by xaiue","(241,222,199,140,124,108,69,44,106,173,222,163,204,123,73,22,45,62,118,169,161,95^239,215,164,123,90,71,56,30,103,139,213,121,188,108,71,18,47,79,130,172,148,102^183,92,57,38,38,43,29,18,58,69,170,99,142,92,63,18,59,128,158,183,143,121)","Daruda 22 by daruda","(222,15,35,64,86,112,109,129,146,159,176,185,191,207,213,224,232,232,231,231,232,231^229,14,10,0,0,13,41,50,61,74,83,105,129,146,166,188,207,227,232,160,169,181^217,19,41,45,44,26,28,33,19,20,2,21,9,19,39,37,80,111,141,121,163,198)","Firestorm by theartistjulian","(27,70,249,253,236,255,255,253,255^32,52,94,75,103,132,161,222,236^50,74,62,53,86,95,95,133,179)","Borkfest by まるき","(223,235,243,255,202,150,58,32^215,194,153,120,90,60,40,34^133,117,73,49,46,60,2,21)","Spicy 07 by green guy","(237,222,210,192,165,123,78^205,146,91,55,32,14,12^110,61,26,22,23,16,22)","Rust-6 by Blue Phoenix","(35,113,165,225,240,255^0,47,73,136,187,226^0,48,50,102,156,198)","Apricot by Chase Stemel","(59,115,183,228,255,255^37,80,107,131,159,255^36,68,83,98,114,213)","SuperNova 7 by Blue Phoenix","(26,61,84,119,167,207,255^8,32,50,58,82,120,206^14,59,70,77,82,98,156)","Pastry by MirruTatep","(249,231,208,160,91^241,196,147,94,49^195,126,62,44,37)","Sandy 06 by green guy","(231,227,206,101,52,14^217,186,129,48,20,7^156,102,44,25,14,5)","Illumination by MirruTatep","(240,231,128,84,32^242,196,114,65,23^202,136,131,88,43)","NYX8 by Javier Guerrero","(8,15,32,246,195,153,129,78^20,42,57,214,163,117,98,73^30,63,79,189,138,119,113,95)","Dream Haze 8 by Klafooty","(60,110,160,206,214,221,234,244^66,81,101,121,143,162,196,223^196,200,205,210,184,163,174,190)","OIL6 by GrafxKid","(39,73,139,198,242,251^39,77,109,159,211,245^68,126,156,165,171,239)","Regal10 by JRiggles","(232,222,190,136,96,223,198,162,122,43^193,158,119,75,44,132,81,62,54,32^112,65,43,43,44,165,151,140,123,66)","Soft Demon 7 by Chase Stemel","(244,229,212,169,126,47,54^208,220,160,92,24,36,57^111,222,167,92,17,44,59)","SGM-Palette 2 by s.g.m","(17,51,68,102,102,119,187,221,255,255,255,255,255,187,119,170,221^17,17,34,68,85,136,187,221,238,238,204,136,51,68,68,102,153^17,51,85,119,187,255,255,255,255,153,102,119,136,102,85,102,136)","Midnight ablaze by Inkpendude","(255,213,124,70,49,31,19^130,60,24,14,5,5,2^116,106,60,43,30,16,8)","Black Cherry by MirruTatep","(217,177,122,82,43^93,47,31,25,18^69,58,58,53,37)","Sunset Red by Cabezinu","(13,40,107,175,238^16,26,35,39,36^27,45,65,71,61)","INKPINK by Inkpendude","(255,254,208,135,69,38^255,108,55,40,36,13^255,144,145,106,89,52)","Brash Pink by ItzFred","(63,104,223,246,255^7,0,60,106,148^55,117,179,159,241)","Pink Neon Sign 6 by Chase Stemel","(49,81,112,158,204,239^61,73,86,102,119,135^89,107,123,149,175,195)","Enchanted Purple by Kaiburn","(22,58,77,96,116,128,145,152,197,225,245,252^37,66,78,90,111,113,122,119,148,168,193,207^74,120,143,158,179,181,194,197,230,250,255,255)","Arch by Poltergasm","(50,63,76,97,117,146,160,217,253,254,253^51,72,87,111,122,136,151,183,197,231,253^72,115,151,174,178,189,196,216,198,213,255)","Spacey Easter by Spark Norris","(32,79,207,101,127,225,125,54,154,78,171,229,182,66,53,132,65^28,75,42,54,123,77,72,48,26,43,162,109,133,25,24,201,132^52,88,131,125,141,157,152,66,95,97,191,174,207,47,68,245,175)","Fornax Void I by Fornax Void","(122,117,112,108,103,99,94,89,85,80,76,71,66,62,57,53,47,55,63,70,78,86,93,101,109,116,124,132,139,147,155,162,0,7,13,20,26,32,39,45,52,58,64,71,77,84,90,96,240,224,208,192,176,160,144,128,112,96,80,64,48,32,16,0,255,242,230,218,206,194,181,169,157,145,133,120,108,96,84,72,243,231,219,208,196,185,173,161,150,138,127,115,103,92,80,69,255,255,255,255,255,255,255,255,224,192,160,128,96,64,48,32,216,196,176,157,137,117,98,78,58,39,19,0,0,0,0,0,255,238,221,204,187,170,153,136,119,102,85,68,51,34,17,0,0,5,9,13,18,22,26,30,35,39,43,47,52,56,60,64,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,238,221,204,187,170,153,136,119,102,85,68,51,34,17,0,0,16,31,46,61,76,91,106,122,137,152,167,182,197,212,227,255,242,229,217,204,192,176,160,128,96,80,64,48,40,32,16,166,178,189,200,211,222,233,244,255,218,182,145,109,72,36,0,227,211,196,181,166,151,136,121,105,90,75,60,45,30,15,0^37,42,47,51,56,60,65,70,74,79,83,88,93,97,102,106,222,214,206,198,190,182,174,166,158,150,142,134,126,118,110,102,204,195,186,177,168,160,151,142,133,124,116,107,98,89,80,72,240,233,226,220,213,206,200,193,186,180,173,166,160,153,146,140,255,242,230,218,206,194,181,169,157,145,133,120,108,96,84,72,142,136,130,124,118,112,106,100,94,88,82,76,70,64,58,53,216,194,172,150,128,96,64,0,0,0,0,0,0,0,0,0,216,196,176,157,137,117,98,78,58,39,19,0,0,0,0,0,43,40,38,36,34,32,30,28,25,23,21,19,17,15,13,11,0,5,9,13,18,22,26,30,35,39,43,47,52,56,60,64,255,240,225,210,195,180,165,150,136,121,106,91,76,61,46,32,160,157,155,153,151,149,147,145,142,140,138,136,134,132,130,128,0,9,18,27,36,45,54,63,72,81,90,99,108,117,126,134,192,172,153,134,115,96,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,211,196,181,166,151,136,121,105,90,75,60,45,30,15,0^255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,235,242,249,255,255,255,255,255,255,255,255,255,255,255,255,255,204,208,211,215,218,221,225,228,232,235,238,242,245,249,252,255,240,233,226,220,213,206,200,193,186,180,173,166,160,153,146,140,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,224,192,160,128,96,64,48,32,255,247,240,232,225,217,210,202,195,187,180,173,145,118,91,64,255,246,238,229,221,212,204,195,187,178,170,161,153,144,136,128,0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,255,240,225,210,195,180,165,150,136,121,106,91,76,61,46,32,255,246,238,229,221,212,204,195,187,178,170,161,153,144,136,128,0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,255,255,255,255,255,255,255,255,232,208,192,128,96,80,64,48,255,223,191,159,127,95,63,31,0,10,19,28,37,46,55,64,255,240,225,210,195,180,165,150,136,121,106,91,76,61,46,32)","Fornax Void II by Fornax Void","(32,48,64,96,128,160,192,224,255,255,255,255,255,255,255,255,16,32,40,48,64,80,96,128,160,176,192,204,217,229,242,255,69,80,92,103,115,127,138,150,161,173,185,196,208,219,231,243,255,238,221,204,187,170,153,136,119,102,85,68,51,34,17,0,32,64,128,192,255,255,255,255,0,0,0,0,1,128,192,232,0,0,0,0,32,64,128,160,192,216,36,72,109,145,182,218,0,0,0,0,0,1,32,64,128,192,224,255,0,0,0,0,0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255^0,0,0,0,0,0,0,0,0,64,96,128,150,172,194,216,0,0,0,0,0,0,0,0,0,48,96,115,134,153,172,192,53,58,64,70,76,82,88,94,100,106,112,118,124,130,136,142,154,155,156,158,159,161,162,163,165,166,168,169,170,172,173,175,0,0,0,0,0,128,192,232,32,64,128,192,255,255,255,255,0,0,0,0,32,64,128,160,192,216,0,0,0,0,0,0,32,64,128,192,224,255,32,64,128,192,224,255,25,51,76,102,0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255^32,48,64,96,128,160,192,224,255,255,255,255,255,255,255,255,48,64,80,96,128,192,208,232,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,244,238,233,227,221,216,210,204,199,193,187,182,176,170,0,0,0,0,0,128,192,232,0,0,0,0,0,128,192,232,64,128,192,255,255,255,255,255,255,255,219,183,146,110,73,37,32,64,128,192,224,255,0,0,0,0,0,0,230,205,179,154,0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255)","Pixelwave by Reptorian","(28,82,136,166,145,117,90,82,123,171,213,255^5,14,23,37,59,82,105,131,163,196,225,255^41,117,194,249,255,255,255,255,255,255,255,255)","S1-6 by Blyzz","(255,55,0,89,0,46^255,255,169,22,10,0^255,255,228,255,236,161)","Berry Nebula by LostInIndigo","(108,108,109,110,111,79,46,13^237,185,133,81,29,20,10,0^237,201,165,129,92,70,48,26)","ABYSS-9 by Jusiv","(0,31,58,84,84,98,127,160,221^0,18,30,41,99,170,227,245,248^0,58,126,194,217,221,220,198,208)","Moonlight 15 by Tofu","(3,7,9,9,8,13,10,38,54,58,131,99,61,46,31^2,9,15,30,50,47,76,132,181,255,193,164,130,103,75^6,24,51,77,83,135,160,206,245,251,111,96,78,73,67)","Moonlit-39 by theartistjulian","(126,159,188,42,42,44,38,131,52,36,54,33,40,26,54,32,71,125,88,76,61,56,63,21,113,112,104,127,101,53,128,103,66,40,36,17,104,137,39^177,211,221,129,106,90,103,204,166,75,105,65,79,51,61,63,71,219,110,103,104,96,112,84,184,181,172,205,169,119,209,178,129,98,84,54,179,221,72^213,249,244,152,152,122,103,194,196,103,73,89,107,70,84,86,76,206,103,108,110,98,122,80,161,157,156,173,154,105,174,155,124,107,103,82,156,181,97)","H2O by maine","(9,24,41,36,49,59,81,146,130,239^9,23,51,68,92,130,154,176,204,215^9,60,41,87,61,113,89,168,146,230)","Magic Waters 9 by Chase Stemel","(93,79,79,114,112,109,146,148,162^81,94,117,140,160,179,201,226,250^121,133,155,145,148,156,177,165,163)","Bluem0ld by warpixel","(25,41,87,153^27,66,156,201^26,87,154,179)","Moss by Zetomis","(16,27,36,89,141^64,68,102,179,217^64,89,102,156,185)","DEEP MAZE by Ryosuke","(242,154,56,0,0,8,0^255,240,216,190,154,85,29^102,137,142,145,152,98,42)","Toxic Slime by MirruTatep","(165,91,48,37,27^238,220,171,116,75^167,112,87,80,74)","Lush Green by EerieJam","(70,58,65,63,60,57^156,135,112,91,76,66^88,94,112,105,99,92)","Tsunami by MirruTatep","(157,106,54,39,22^236,185,134,71,30^207,185,150,104,60)","Cryptic Ocean by Klafooty","(42,63,68,76,105,149^23,44,63,92,128,197^59,95,123,135,158,172)","Marsh Madness by MirruTatep","(183,154,117,54,28^169,147,126,89,49^138,106,78,64,44)","OXYD by ItzFred","(157,159,59,55,50,37,41,50^157,114,110,87,62,48,37,25^107,73,100,105,89,81,67,55)","Pink&Green by q1","(218,197,157,117,58,28,17,3^192,154,129,119,98,64,48,24^192,139,99,69,72,75,47,30)","Walking in the Woods 8 by Chase Stemel","(186,203,209,219,207,174,129,82^194,212,221,235,207,150,83,50^177,194,194,192,173,133,85,73)","Paper 8 by Frosty Rabbid","(31,101,168,209,246,182,96,60^36,64,96,166,231,207,174,107^75,83,93,126,156,142,123,100)","Sahara Pastell by wermz","(26,28,161,218,255,255,200^18,89,102,232,254,255,187^54,140,102,160,227,255,112)","Sunflower Painting 7 by Chase Stemel","(44,26,8,169,251,249,247^53,92,131,229,245,212,179^60,107,155,187,177,110,44)","Art Hoe Aesthetic 7 by Chase Stemel","(40,84,223,255,206,127,47^42,77,208,243,253,163,72^42,70,118,153,255,172,88)","Sky5 by MiniTe","(199,219,223,236,142,118,98^172,216,213,236,179,143,112^91,121,158,210,175,163,135)","Ocean Glass by Solitaire","(193,136,104,69,67,30,29,4^208,181,145,109,107,68,53,0^193,162,125,90,109,79,80,64)","RoyalGuard by Royal_Naym","(66,59,54,0,111,192^48,63,82,114,152,197^48,63,82,129,155,201)","Eulbink by Inkpendude","(255,12,0,30,32,37,32^255,230,152,87,53,36,21^255,242,219,156,98,70,51)","Winter Wonderland by Jimison3","(32,44,56,139,255,214,167,115^40,74,117,202,255,225,188,141^78,120,161,221,255,233,201,157)","Moon Squid 7 by Chase Stemel","(129,109,78,47,113,200,234^178,152,112,72,111,175,205^197,186,137,88,113,167,194)","Stratus by MirruTatep","(231,200,168,125,103^244,228,205,152,101^231,233,230,191,154)","Arctic Dust by MirruTatep","(233,177,158,141,107^247,226,189,148,115^217,212,187,150,123)","CL8UDS by _Nicola ","(252,239,214,180,165,143,154,165^176,157,147,141,151,160,171,183^140,127,138,146,161,191,201,212)","Lilac Skies 5 by Chase Stemel","(196,215,228,155,168^158,177,197,141,153^188,198,213,186,194)","Sea of Fire by TATA-PIXEL","(164,109,54,163,133,71^222,181,132,61,34,9^215,173,123,54,27,5)","Autochrome 3 by Reptorian","(88,31,223^66,106,85^147,56,41)","Autochrome 5 by Reptorian","(88,31,223,126,13^66,106,85,141,203^147,56,41,227,163)","GB Default 1","(51,166,214,247^30,55,142,231^80,37,73,198)","GB Default 2","(8,52,136,224^24,104,192,248^32,86,112,208)","GB Andrade by Andrade","(32,94,174,227^32,103,186,238^32,69,137,192)","GB Blue Seni by WildLeoKnight","(208,112,60,28^244,176,52,8^248,192,104,32)","GB Blackzone","(46,56,87,126^70,93,123,132^61,73,70,22)","GB Suburb by Poppysalmon","(69,123,255,255^39,150,190,246^83,232,179,229)","GB Crimson by WildLeoKnight","(27,122,186,239^3,28,80,249^38,75,68,214)","GB Didi by DidiGameboy","(33,58,119,220^11,101,175,254^46,90,104,207)","GB Dirty by WildLeoKnight","(196,139,77,31^207,149,83,31^161,109,60,31)","GB Arne by Arne","(36,63,118,172^49,80,132,181^55,63,72,107)","GB Easy by GrafxKid","(0,13,161,235^67,136,188,221^51,51,0,119)","GB Forest","(90,107,123,255^57,140,198,255^33,66,123,181)","GB Harsh Green by WildLeoKnight","(23,55,106,190^40,109,180,235^8,3,23,113)","GB Light Green by WildLeoKnight","(244,104,30,5^251,207,145,36^208,104,120,31)","GB Nostalgia by WildLeoKnight","(208,160,112,64^208,168,128,80^88,64,40,16)","GB Platinum by WildLeoKnight","(24,80,168,224^48,120,192,240^48,104,176,232)","GB Kirokaze by Kirokaze","(51,70,148,226^44,135,227,243^80,143,68,228)","GB Cyber","(16,66,111,206^37,103,158,206^51,142,223,206)","GB Wish by Kerrie Lake","(98,117,96,139^46,80,143,229^76,232,207,255)","GB Grapefruit by GrafxKid","(101,183,244,255^41,101,178,245^108,145,107,221)","GB Ice Cream by Kerrie Lake","(124,235,249,255^63,107,168,246^88,111,117,211)","GB Red_Blue","(24,132,247,255^16,115,181,239^16,156,140,255)","Gold GB by Isa","(33,77,157,207^11,34,101,171^27,44,76,81)","GB Chocolate by GrafxKid","(255,220,169,66^228,164,96,41^194,86,76,54)","GB Gray by GrafxKid","(43,112,168,224^43,107,159,219^38,102,148,205)","GB Spacehaze by WildLeoKnight","(11,107,204,248^6,31,52,227^48,177,149,196)","GB Purple Dawn by WildLeoKnight","(0,45,154,238^27,117,123,253^46,126,188,237)","Moon Crystal by Doph","(255,217,141,117^226,167,137,95^219,198,199,156)","ARNE4 by Arne","(0,0,184,175^0,81,75,216^0,156,18,79)","Autumn Chill by Doph","(218,213,194,44^211,136,58,30^175,99,115,116)","CherryMelon by WildLeoKnight","(252,255,38,1^222,77,89,40^234,109,53,36)","HallowPumpkin by WildLeoKnight","(48,96,248,248^0,40,144,240^48,120,32,136)","Hollow by Poltergasm","(15,86,198,250^15,90,183,251^27,117,190,246)","Lavender4 by Solitaire","(84,127,187,205^43,98,173,221^96,163,106,147)","MAW by bloo","(42,0,203,235^0,82,183,235^42,60,50,235)","Voltage Warning by Wuchta","(28,99,211,212^20,86,174,201^18,80,33,195)","Tritanopia by Allappini","(221,244,255,45,25^68,128,220,103,75^68,128,220,111,79)","Rabbit 7 by GrafxKid","(212,232,236,79,170,59,92^117,196,236,164,211,50,97^100,152,224,165,149,74,130)","Amiga 2600 NTSC","(252,232,208,184,160,132,100,68,44,76,104,132,156,180,204,224,200,180,156,132,108,80,52,20,0,32,64,92,116,140,164,184,164,144,124,104,80,56,28,0,0,28,56,80,104,124,144,164,164,144,124,104,80,56,28,0,0,28,56,80,104,124,144,164,188,168,148,124,104,76,48,20,72,96,120,140,160,180,196,212,236,220,208,192,176,160,140,120,136,156,176,192,208,224,236,252,252,236,224,208,192,172,152,132,112,132,152,172,188,204,220,232,252,232,208,184,160,132,100,68,0,64,108,144,176,200,220,236^224,204,180,156,132,104,72,40,48,80,112,140,168,192,212,236,252,228,204,180,152,124,92,56,60,92,124,156,180,208,228,252,252,228,208,180,156,124,92,64,44,76,104,132,156,180,204,224,200,180,156,136,112,84,56,24,0,32,64,92,116,140,164,184,180,160,136,112,88,60,32,0,0,32,60,88,112,132,156,176,176,156,132,112,88,60,32,0,0,32,60,88,112,136,160,180,188,168,148,128,104,80,52,24,40,68,92,120,140,160,180,204,252,232,208,184,160,132,100,68,0,64,108,144,176,200,220,236^140,124,108,88,68,48,24,0,0,28,52,76,100,120,136,156,164,144,124,104,80,56,28,0,0,32,64,92,116,140,164,184,212,192,172,148,128,100,72,44,92,120,144,172,192,212,232,252,252,236,220,204,188,168,144,124,136,156,176,192,208,224,236,252,252,236,224,208,192,172,152,132,120,144,164,184,204,220,236,252,224,208,192,176,156,136,116,92,0,32,60,88,112,136,160,180,148,128,112,92,72,48,24,0,0,20,40,60,76,92,104,124,104,92,80,64,52,36,16,0,0,64,108,144,176,200,220,236)","Amiga 2600 PAL","(112,136,160,180,200,220,236,252,224,208,196,180,168,148,132,112,88,108,128,148,164,180,196,212,200,184,168,148,128,108,84,60,0,32,60,88,112,132,156,176,164,144,124,104,80,56,28,0,0,28,56,80,104,124,144,164,176,156,132,112,88,60,32,0,0,32,60,88,112,132,156,176,212,192,176,160,140,116,92,68,128,148,168,188,204,220,236,252,252,236,220,200,180,160,136,112,0,64,108,144,176,200,220,236^0,32,60,88,112,132,156,176,176,156,132,112,88,60,32,0,0,32,60,88,112,132,156,176,176,156,132,112,88,60,32,0,0,32,60,88,112,132,156,176,200,180,160,136,116,88,60,32,60,88,116,140,164,184,204,224,236,220,200,184,164,140,116,92,100,128,152,176,196,216,232,252,252,232,212,192,172,144,120,92,88,112,132,156,172,192,208,224,212,192,172,152,132,104,80,52,0,64,108,144,176,200,220,236^20,52,80,108,132,156,180,200,224,208,192,176,156,136,116,92,112,136,160,180,200,220,236,252,252,236,220,204,188,168,148,128,136,156,176,192,208,224,236,252,252,236,220,200,180,160,136,112,112,136,160,180,200,220,236,252,236,220,200,184,164,140,116,92,20,52,80,108,132,156,180,200,176,156,132,112,88,60,32,0,0,32,60,88,112,132,156,176,176,156,132,112,88,60,32,0,0,64,108,144,176,200,220,236)","Amiga 2600 SECAM","(0,33,240,255,127,127,255,255^0,33,60,80,255,255,255,255^0,255,121,255,0,255,63,255)","Amiga 7800 M.E.S.S by Nabuko78","(1,46,61,89,119,132,160,183,205,216,221,224,234,240,246,255,255,254,255,254,255,255,255,255,255,255,216,187,153,119,84,65,71,114,160,179,200,228,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,243,231,212,191,176,157,122,95,75,127,179,200,223,237,251,252,254,255,255,255,255,255,255,255,254,255,255,255,255,251,239,228,215,202,187,170,149,129,103,74,73,92,101,122,146,157,166,177,188,196,206,213,218,222,225,230,205,192,176,159,152,144,128,113,101,90,79,68,37,9,6,5,12,32,54,70,87,97,109,123,137,145,157,167,178,187,195,211,208,195,175,155,147,141,112,86,77,73,51,29,29,30,29,29,2,2,1,2,2,2,1,1,27,62,101,118,138,155,177,199,208,200,182,162,134,125,115,82,78,55,40,25,15,4,0,0,22,28,35,40,46,58,71,81,93,113,133,141,151,165,184,185,242,232,219,206,194,184,171,158,139,121,108,96,72,69,57,44,70,76,85,109,144,172,194,209,223,231,238,247,253,255,255,255,254,254,254,254,252,249,237,225,208,191,181,171,141,113,88,65^1,46,61,89,119,132,160,183,205,216,221,224,234,240,246,255,255,255,249,244,230,216,208,197,171,145,128,104,79,55,40,32,25,30,37,57,81,106,130,140,153,174,196,197,198,214,228,231,218,209,194,178,164,152,138,121,110,98,78,54,47,43,36,31,23,26,29,33,37,60,82,96,112,127,144,158,170,185,200,202,184,175,165,157,141,126,114,103,90,77,61,45,24,3,1,1,3,4,14,35,59,69,79,90,101,109,118,131,144,156,170,182,211,203,190,178,170,160,146,131,117,104,90,76,61,48,38,30,8,28,49,66,83,93,105,119,133,141,152,164,175,184,193,209,237,233,228,223,220,216,198,182,169,154,134,113,92,73,56,41,76,93,112,132,153,171,188,207,220,225,231,234,237,240,243,246,255,255,255,255,236,227,217,205,186,164,147,127,117,107,84,72,64,83,102,120,140,152,165,175,187,207,227,235,245,255,255,255,255,252,239,225,214,204,191,178,159,141,127,113,86,82,68,53,58,63,70,88,118,140,161,176,190,198,205,218,230,242,249,249,212,203,198,193,183,173,160,147,133,119,100,81,58,37,31,26^1,46,61,89,119,132,160,183,205,216,221,224,234,240,246,255,172,153,120,86,81,77,60,29,29,30,23,24,16,6,1,0,4,17,30,33,34,32,31,37,45,56,84,89,109,136,162,171,209,196,179,158,139,125,105,85,75,63,43,36,15,16,13,14,4,13,23,25,28,57,85,97,99,126,143,159,173,190,206,222,236,234,232,230,226,218,206,195,182,169,154,137,116,96,75,55,109,136,145,166,190,201,210,221,232,240,249,255,255,254,254,255,255,255,255,255,255,255,255,255,255,255,237,222,213,202,165,131,121,141,163,179,196,207,218,232,247,254,255,255,254,255,255,255,255,254,254,254,254,255,254,255,236,217,207,199,172,147,119,92,90,111,132,156,182,202,221,244,255,254,255,254,255,255,255,254,208,200,182,162,134,125,115,82,77,55,39,25,15,4,0,0,0,0,1,1,0,12,25,35,47,67,87,95,105,150,151,151,171,121,108,84,83,73,60,47,28,10,1,0,0,0,0,0,9,10,9,9,8,11,32,47,61,69,77,101,125,164,197,212,152,131,113,96,92,89,78,68,58,48,39,31,19,8,5,3)","Amiga 7800","(0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,255,255,247,230,213,196,179,162,145,128,111,94,77,60,43,26,49,66,83,100,117,134,151,168,185,202,219,236,253,255,255,255,255,255,255,255,249,232,215,198,181,164,147,130,113,96,79,62,63,80,97,114,131,148,165,182,199,216,233,250,255,255,255,255,255,255,255,255,238,221,204,187,170,153,136,119,102,85,68,51,29,46,64,81,98,115,132,149,166,183,200,217,233,251,255,255,255,240,223,206,189,172,155,138,121,104,87,70,53,36,19,2,0,0,8,25,42,59,76,93,110,127,144,161,178,195,212,229,206,189,172,155,138,121,104,87,70,53,36,19,2,0,0,0,0,0,0,0,6,23,40,57,74,91,108,125,142,159,176,193,192,175,158,141,124,107,90,73,56,39,22,5,0,0,0,0,0,0,0,0,16,33,50,67,84,101,118,135,152,169,186,203,225,208,191,174,157,140,123,106,89,72,55,38,21,4,0,0,0,14,31,48,65,82,99,116,133,150,167,184,201,218,235,252,255,255,246,229,212,195,178,161,144,127,110,93,76,59,42,25^0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,247,245,228,211,194,177,160,143,126,109,92,75,58,41,24,7,0,6,23,40,57,74,91,108,125,142,159,176,193,210,227,244,229,212,195,178,161,144,127,110,93,76,59,42,25,8,0,0,0,0,0,15,32,49,66,83,100,117,134,151,168,185,202,219,216,199,182,165,148,131,114,97,80,63,46,29,12,0,0,0,0,0,0,16,33,50,67,84,101,118,135,152,169,186,203,220,232,215,198,181,164,147,130,113,96,79,62,45,28,11,0,0,0,10,27,44,61,78,95,112,129,146,163,180,197,214,231,248,255,248,231,214,197,180,163,146,129,112,95,78,61,44,27,10,26,43,60,77,94,111,128,145,162,179,196,213,230,247,255,255,255,255,255,240,223,206,189,172,155,138,121,104,87,70,53,36,39,56,73,90,107,124,141,158,175,192,209,226,243,255,255,255,255,255,255,239,222,205,188,171,154,137,120,103,86,69,52,35,23,40,57,74,91,108,125,142,159,176,193,210,227,244,255,255,255,245,228,211,194,177,160,143,126,109,92,75,58,41,24,7^0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,151,131,111,94,77,60,43,26,9,0,0,0,0,0,0,0,0,0,0,0,0,0,10,27,44,61,78,95,112,133,156,178,218,196,174,152,131,115,98,81,64,47,30,13,0,0,0,0,3,15,27,43,60,77,94,111,128,145,162,179,200,222,239,244,243,238,233,228,228,211,194,177,160,143,126,109,92,76,65,53,92,104,116,132,149,166,183,200,217,234,235,235,236,235,239,244,248,247,247,247,247,247,247,242,225,208,191,174,157,140,125,113,104,124,144,161,178,195,212,229,246,255,255,255,255,255,255,255,255,255,255,255,255,255,245,228,211,194,177,160,143,121,99,77,38,60,82,104,124,141,158,175,192,209,226,243,255,255,255,255,253,241,229,213,196,179,162,145,128,111,94,77,56,34,16,11,12,17,22,27,27,44,61,78,95,112,129,146,163,179,191,203,163,151,139,122,105,88,71,54,37,20,19,19,19,19,16,10,7,8,8,8,8,8,8,13,30,47,64,81,98,115,130,142,150,130,111,94,77,60,43,26,9,0,0,0,0,0,0,0)","Amstrad CPC","(0,128,255,128,255,255,255,255,255,128,0,0,128,128,0,0,0,128,0,0,128,128,255,255,255,128,0^0,128,255,0,0,128,128,255,255,128,128,255,255,255,255,128,255,255,128,0,0,128,128,0,0,0,0^0,128,255,0,0,128,0,128,0,0,0,0,0,128,128,128,255,255,255,128,255,255,255,255,128,128,255)","Apple II","(0,81,132,234,81,232,245,0,0,145,201,0,152,200,255^0,92,61,125,72,93,183,103,200,145,209,166,219,193,255^0,22,82,39,136,239,201,82,44,145,153,240,201,247,255)","Atari 8-Bit Series - GTIA by PixelCrunch","(0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,9,25,41,58,74,90,107,123,140,156,172,189,205,222,238,255,48,61,75,89,103,117,130,144,158,172,186,199,213,227,241,255,75,87,99,111,122,135,147,159,171,182,195,207,219,230,243,255,85,96,107,119,130,141,153,164,175,187,198,209,221,232,243,255,76,87,99,111,123,135,147,159,171,183,195,207,219,231,243,255,48,59,73,87,101,114,128,142,156,169,183,197,211,224,238,252,10,26,42,59,75,91,108,124,140,156,173,189,206,222,238,255,0,12,27,42,57,72,87,102,116,131,146,161,176,191,206,221,0,12,25,38,50,63,76,88,101,114,126,139,152,164,177,190,0,9,21,32,44,55,66,78,89,101,112,124,135,146,158,169,0,11,22,34,45,57,68,80,91,103,114,126,137,149,160,172,0,12,25,38,51,64,76,89,102,115,128,140,153,166,179,192,0,15,30,45,60,75,90,105,121,136,151,166,181,196,211,227,13,29,45,61,77,93,109,125,142,158,174,190,206,222,238,255,51,64,78,91,105,119,132,146,159,173,187,200,214,227,241,255^0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,25,40,55,71,86,101,117,132,147,163,178,193,209,224,239,255,0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,0,15,30,46,61,77,92,107,123,138,154,169,184,200,215,231,0,14,28,42,56,70,84,98,113,127,141,155,169,183,197,212,0,13,27,40,54,67,81,94,108,121,135,148,162,175,189,203,0,11,25,39,52,66,80,93,107,121,134,148,162,175,189,203,0,14,29,44,58,73,88,103,117,132,147,162,176,191,206,221,0,13,30,46,62,78,94,110,126,143,159,175,191,207,223,239,14,30,46,62,78,94,110,126,142,158,174,190,206,222,238,255,36,48,63,77,92,106,121,135,150,164,179,193,208,223,237,252,50,63,77,91,104,118,132,145,159,173,186,200,214,227,241,255,52,65,79,92,106,119,133,146,160,173,187,200,214,227,241,255,42,56,70,84,98,113,127,141,155,169,184,198,212,226,240,255,23,38,53,69,84,100,115,131,146,162,177,193,208,224,239,255,0,16,33,50,67,84,101,118,134,151,168,185,202,219,236,253^0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255,0,6,13,20,27,34,41,48,54,61,68,75,82,89,96,103,0,8,17,25,34,42,51,59,68,76,85,93,102,110,119,128,0,12,24,36,48,60,73,85,97,109,121,134,146,158,170,183,0,16,33,50,67,84,101,118,135,152,169,186,203,220,237,254,71,83,95,107,120,132,144,156,169,181,193,205,218,230,242,255,126,133,141,150,159,167,176,184,193,201,210,219,227,236,244,253,151,157,164,171,178,185,192,199,206,213,220,227,234,241,248,255,142,148,156,163,171,178,186,193,201,208,216,223,230,238,245,253,100,110,120,131,141,151,162,172,182,193,203,213,224,234,244,255,34,46,61,76,90,105,120,134,149,164,178,193,208,222,237,252,0,14,28,43,57,72,86,100,115,129,144,158,172,187,201,216,0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,151,0,7,14,22,29,36,44,51,59,66,73,81,88,96,103,111,0,6,13,20,27,34,41,48,55,62,69,76,83,90,97,104,0,8,17,26,35,44,53,62,70,79,88,97,106,115,124,133)","CGA","(0,85,170,255,0,85,0,85,0,85,170,255,170,255,170,255^0,85,170,255,0,85,170,255,170,255,0,85,0,85,85,255^0,85,170,255,170,255,0,85,170,255,0,85,170,255,0,85)","CGA Mode 0 [Low]","(0,0,170,170^0,170,0,85^0,0,0,0)","CGA Mode 0 [High]","(0,85,255,255^0,255,85,255^0,85,85,85)","CGA Mode 1 [Low]","(0,170,0,170^0,0,170,170^0,170,170,170)","CGA Mode 1 [High]","(0,255,85,255^0,85,255,255^0,255,255,255)","CGA Mode 2 [Low]","(0,170,0,170^0,0,170,170^0,0,170,170)","CGA Mode 2 [High]","(0,255,85,255^0,85,255,255^0,85,255,255)","Commodore 64 - Pepto","(0,98,137,173,255,159,203,109,161,201,154,92,106,136,80,160^0,98,137,173,255,78,126,84,104,212,226,171,191,126,69,87^0,98,137,173,255,68,117,18,60,135,155,94,198,203,155,163)","Commodore 64 - Colodore","(0,74,123,178,255,129,196,85,142,237,169,86,117,112,46,142^0,74,123,178,255,51,108,56,80,241,255,172,206,109,44,60^0,74,123,178,255,56,113,0,41,113,159,77,200,235,155,151)","Commodore VIC-20","(0,255,168,233,119,182,133,197,168,233,85,146,66,126,189,255^0,255,115,178,45,104,212,255,95,157,158,223,52,112,204,255^0,255,74,135,38,98,220,255,180,245,74,135,139,202,113,176)","Colecovision","(0,33,66,41,90,156,57,214,255,222,214,24,214,206,255^0,173,214,49,115,41,231,57,115,231,214,123,49,206,255^0,24,90,214,255,24,247,33,90,41,123,16,231,206,255)","Japanese Machine Palette by Arne Niklas Jansson","(0,25,70,161,69,118,131,158,220,225,214,233,33,211,175,245^0,16,175,214,62,100,49,194,83,141,185,216,108,101,170,244^0,40,69,133,120,254,41,232,75,121,123,161,75,200,185,235)","Macintosh II","(255,255,255,220,255,54,0,0,0,0,101,151,185,134,69,0^255,255,101,0,0,0,0,151,168,101,54,101,185,134,69,0^255,0,0,0,151,151,202,255,0,0,0,54,185,134,69,0)","Macintosh 8-Bit System Palette","(0,11,34,68,85,119,136,170,187,221,238,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,34,68,85,119,136,170,187,221,238,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255^0,11,34,68,85,119,136,170,187,221,238,0,0,0,0,0,0,0,0,0,0,11,34,68,85,119,136,170,187,221,238,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,51,51,51,51,51,102,102,102,102,102,102,153,153,153,153,153,153,204,204,204,204,204,204,255,255,255,255,255,255,0,0,0,0,0,0,51,51,51,51,51,51,102,102,102,102,102,102,153,153,153,153,153,153,204,204,204,204,204,204,255,255,255,255,255,255,0,0,0,0,0,0,51,51,51,51,51,51,102,102,102,102,102,102,153,153,153,153,153,153,204,204,204,204,204,204,255,255,255,255,255,255,0,0,0,0,0,0,51,51,51,51,51,51,102,102,102,102,102,102,153,153,153,153,153,153,204,204,204,204,204,204,255,255,255,255,255,255,0,0,0,0,0,0,51,51,51,51,51,51,102,102,102,102,102,102,153,153,153,153,153,153,204,204,204,204,204,204,255,255,255,255,255,255,0,0,0,0,0,0,51,51,51,51,51,51,102,102,102,102,102,102,153,153,153,153,153,153,204,204,204,204,204,204,255,255,255,255,255,255^0,11,34,68,85,119,136,170,187,221,238,11,34,68,85,119,136,170,187,221,238,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255,0,51,102,153,204,255)","MSX","(0,202,255,183,217,254,202,221,60,64,115,89,126,100,181^0,202,255,94,100,135,193,206,160,182,206,85,117,218,101^0,202,255,81,89,124,94,133,66,74,124,223,240,238,179)","NES","(0,252,248,188,124,164,60,0,0,184,104,0,0,216,152,104,68,248,248,216,148,248,248,228,168,240,248,248,168,252,252,228,136,248,248,172,80,216,184,0,0,184,88,0,0,184,88,0,0,0,0,0,0,248,120^0,252,248,188,124,228,188,120,0,184,136,88,0,184,120,68,40,184,120,0,0,164,88,0,0,208,120,56,16,224,160,92,20,216,184,124,48,248,248,184,120,248,216,168,104,248,248,168,88,252,232,136,64,216,120^0,252,248,188,124,252,252,248,252,248,252,248,188,248,248,252,188,248,248,204,132,192,152,88,32,176,88,0,0,168,68,16,0,120,0,0,0,120,24,0,0,184,84,0,0,216,152,68,0,252,216,136,88,248,120)","PICO-8 by Lexaloffle Games","(0,95,194,255,255,255,255,171,255,255,131,126,41,29,0,0^0,87,195,241,236,163,204,82,119,0,118,37,173,43,135,228^0,79,199,232,39,0,170,54,168,77,156,83,255,83,81,54)","RISC OS","(255,220,185,151,118,85,54,0,0,237,5,220,237,85,255,4^255,220,185,151,118,85,54,0,69,237,202,0,237,134,185,185^255,220,185,151,118,85,54,0,151,4,0,0,185,0,0,255)","SAM Coupe","(0,0,73,73,0,0,73,73,36,36,109,109,36,36,109,109,0,0,73,73,0,0,73,73,36,36,109,109,36,36,109,109,146,146,219,219,146,146,219,219,182,182,255,255,182,182,255,255,146,146,219,219,146,146,219,219,182,182,255,255,182,182,255,255,0,0,73,73,0,0,73,73,36,36,109,109,36,36,109,109,0,0,73,73,0,0,73,73,36,36,109,109,36,36,109,109,146,146,219,219,146,146,219,219,182,182,255,255,182,182,255,255,146,146,219,219,146,146,219,219,182,182,255,255,182,182,255,255^0,0,0,0,73,73,73,73,36,36,36,36,109,109,109,109,0,0,0,0,73,73,73,73,36,36,36,36,109,109,109,109,0,0,0,0,73,73,73,73,36,36,36,36,109,109,109,109,0,0,0,0,73,73,73,73,36,36,36,36,109,109,109,109,146,146,146,146,219,219,219,219,182,182,182,182,255,255,255,255,146,146,146,146,219,219,219,219,182,182,182,182,255,255,255,255,146,146,146,146,219,219,219,219,182,182,182,182,255,255,255,255,146,146,146,146,219,219,219,219,182,182,182,182,255,255,255,255^0,73,0,73,0,73,0,73,36,109,36,109,36,109,36,109,146,219,146,219,146,219,146,219,182,255,182,255,182,255,182,255,0,73,0,73,0,73,0,73,36,109,36,109,36,109,36,109,146,219,146,219,146,219,146,219,182,255,182,255,182,255,182,255,0,73,0,73,0,73,0,73,36,109,36,109,36,109,36,109,146,219,146,219,146,219,146,219,182,255,182,255,182,255,182,255,0,73,0,73,0,73,0,73,36,109,36,109,36,109,36,109,146,219,146,219,146,219,146,219,182,255,182,255,182,255,182,255)","Thomson MO5","(0,187,255,221,238,255,221,0,119,0,187,255,255,221,0,119^0,187,0,119,187,255,221,255,221,255,255,255,0,119,0,119^0,187,0,119,0,0,119,0,119,255,255,255,255,238,255,221)","TRS-80 Color Computer Palette","(0,0,255,255^0,128,128,255^0,255,0,255)","Virtual Boy interpreted by Bruno Weinberger","(255,120,45,0^0,0,0,0^0,0,0,0)","VGA","(0,0,0,0,170,170,170,170,85,85,85,85,255,255,255,255,16,32,53,69,101,117,138,154,186,202,223,239,0,65,130,190,255,255,255,255,255,255,255,255,255,190,130,65,1,1,1,1,1,0,0,0,130,158,190,223,255,255,255,255,255,255,255,255,255,223,190,158,130,130,130,130,130,130,130,130,186,202,223,239,255,255,255,255,255,255,255,255,255,239,223,202,186,186,186,186,186,186,186,186,0,28,57,85,113,113,113,113,113,113,113,113,113,85,57,28,0,0,0,0,0,0,0,0,57,69,85,97,113,113,113,113,113,113,113,113,113,97,85,69,57,57,57,57,57,57,57,57,81,89,97,105,113,113,113,113,113,113,113,113,113,105,97,89,81,81,81,81,81,81,81,81,0,16,32,49,65,65,65,65,65,65,65,65,65,49,32,16,0,0,0,0,0,0,0,0,32,40,49,57,65,65,65,65,65,65,65,65,65,57,49,40,32,32,32,32,32,32,32,32,45,49,53,61,65,65,65,65,65,65,65,65,65,61,53,49,45,45,45,45,45,45,45,45^0,0,170,170,0,0,85,170,85,85,255,255,85,85,255,255,16,32,53,69,101,117,138,154,186,202,223,239,0,0,0,0,0,0,0,0,0,65,130,190,255,255,255,255,255,255,255,255,255,190,130,65,130,130,130,130,130,130,130,130,130,158,190,223,255,255,255,255,255,255,255,255,255,223,190,158,186,186,186,186,186,186,186,186,186,202,223,239,255,255,255,255,255,255,255,255,255,239,223,202,0,0,0,0,0,0,0,0,0,28,57,85,113,113,113,113,113,113,113,113,113,85,57,28,57,57,57,57,57,57,57,57,57,69,85,97,113,113,113,113,113,113,113,113,113,97,85,69,81,81,81,81,81,81,81,81,81,89,97,105,113,113,113,113,113,113,113,113,113,105,97,89,0,0,0,0,0,0,0,0,0,16,32,49,65,65,65,65,65,65,65,65,65,49,32,16,32,32,32,32,32,32,32,32,32,40,49,57,65,65,65,65,65,65,65,65,65,57,49,40,45,45,45,45,45,45,45,45,45,49,53,61,65,65,65,65,65,65,65,65,65,61,53,49^0,170,0,170,0,170,0,170,85,255,85,255,85,255,85,255,16,32,53,69,101,117,138,154,186,202,223,239,255,255,255,255,255,190,130,65,0,0,0,0,0,0,0,0,0,65,130,190,255,255,255,255,255,255,255,255,255,223,190,158,130,130,130,130,130,130,130,130,130,158,190,223,255,255,255,255,255,255,255,255,255,239,223,202,186,186,186,186,186,186,186,186,186,202,223,239,255,255,255,255,113,113,113,113,113,85,57,28,0,0,0,0,0,0,0,0,0,28,57,85,113,113,113,113,113,113,113,113,113,97,85,69,57,57,57,57,57,57,57,57,57,69,85,97,113,113,113,113,113,113,113,113,113,105,97,89,81,81,81,81,81,81,81,81,81,89,97,105,113,113,113,113,65,65,65,65,65,49,32,16,0,0,0,0,0,0,0,0,0,16,32,49,65,65,65,65,65,65,65,65,65,57,49,40,32,32,32,32,32,32,32,32,32,40,49,57,65,65,65,65,65,65,65,65,65,61,53,49,45,45,45,45,45,45,45,45,45,49,53,61,65,65,65,65)","Win 95-256","(0,128,0,128,0,128,0,192,192,166,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,204,255,51,102,153,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,42,42,42,42,42,42,42,42,42,255,160,128,255,0,255,0,255,0,255^0,0,128,128,0,0,128,192,220,202,63,63,95,95,95,95,127,127,127,127,159,159,159,159,191,191,191,191,223,223,223,223,255,255,255,255,0,0,0,0,31,31,31,31,63,63,63,63,95,95,95,95,127,127,127,127,159,159,159,159,191,191,191,191,223,223,223,223,255,255,255,255,0,0,0,0,31,31,31,31,63,63,63,63,95,95,95,95,127,127,127,127,159,159,159,159,191,191,191,191,223,223,223,223,255,255,255,255,0,0,0,0,31,31,31,31,63,63,63,63,95,95,95,95,127,127,127,127,159,159,159,159,191,191,191,191,223,223,223,223,255,255,255,255,0,0,0,0,31,31,31,31,63,63,63,63,95,95,95,95,127,127,127,127,159,159,159,159,191,191,191,191,223,223,223,223,255,255,255,255,0,0,31,31,31,31,63,63,63,63,95,95,95,95,127,127,127,127,159,159,159,159,191,191,191,191,223,223,223,223,255,255,204,204,255,255,255,255,127,127,127,127,159,159,159,159,191,191,191,191,223,223,223,223,255,255,0,0,0,0,31,31,31,31,63,63,251,160,128,0,255,255,0,0,255,255^0,0,0,0,128,128,128,192,192,240,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,85,170,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,85,170,255,255,255,255,255,255,0,85,170,255,0,85,170,255,0,85,170,255,0,85,170,255,85,170,0,85,170,255,0,85,170,255,0,85,240,164,128,0,0,0,255,255,255,255)","ZX Spectrum","(0,255,255,0,0,255,255,0,192,0,0,192,192,0,192^0,255,0,255,0,255,0,255,0,192,0,192,0,192,192^0,255,0,0,255,0,255,255,0,0,192,0,192,192,192)","GNOME 32","(234,186,128,86,197,131,93,68,224,193,136,102,173,136,98,73,157,117,75,49,239,224,179,130,223,153,238,209,70,38,255,0^232,181,125,82,210,166,117,86,182,102,70,56,167,127,91,64,184,144,105,78,224,195,145,102,66,0,214,148,160,119,255,0^227,171,116,72,200,127,85,50,175,90,49,34,200,163,129,102,210,174,131,108,205,158,105,71,30,0,128,12,70,38,255,0)","Electronic Crayon 22","(0,85,168,255,168,254,168,254,254,168,255,4,6,4,6,0,0,0,118,168,254,254^0,69,168,255,0,0,85,118,168,168,255,168,255,168,255,118,0,0,0,0,0,0^0,85,168,255,0,0,0,0,118,0,4,0,4,168,255,255,168,255,255,168,255,118)","Chip16","(214,58,0,83,112,6,99,142,89,124,86,234,196,111,229,216^75,35,0,140,198,62,114,55,142,182,83,200,133,26,229,162^97,51,20,193,229,76,114,55,51,73,73,121,78,113,229,162)","Deluxe Paint","(0,170,101,223,207,223,207,138,81,65,32,0,0,0,0,0,48,69,69,48,138,69,207,223,211,178,146,113,81,65,32,0,227,195,178,146,130,0,0,0,0,0,113,81,65,48,32,0,0,0,0,0,0,243,227,211,195,178,162,243,227,211,211,195,178,178,162,146,130,113,97,81,65,146,130,113,97,81,65,48,32,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,227,195,178,146,227,195,178,146,130,97,81,65,243,243,243,243,243,243,243,243,243,243,227,227,211,211,195,227,195,178,146,130,113,81,65,178,178,162,162,146,211,195,178,162,146,130,113,97,130,130,113,113,97,97,81,211,178,146,130,97,65,32,1,65,48,32,1,0,0,0,0,243,243,130,130,130,178,243,0,0,0,0,0,0,195,195,195,195,195,146,113,65,211,178,146,113,81,65,32,1,32,32,32,32,32,32,32,32,1,0,0,0,0,0,0,0,81,130,178,195,195,195,243^0,170,101,223,48,138,223,138,178,178,162,146,130,113,97,81,138,223,223,138,138,48,48,138,211,178,146,130,97,65,32,0,227,195,178,146,130,0,0,0,0,0,113,81,65,48,32,0,0,0,0,0,0,0,0,0,0,0,0,211,178,146,113,81,65,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,211,178,146,113,81,65,32,178,146,113,81,65,32,0,162,146,130,113,97,97,81,65,0,0,0,0,0,0,0,0,243,243,243,243,243,243,243,243,227,211,195,178,178,162,146,211,195,162,146,130,97,81,65,130,113,113,97,81,243,243,243,243,227,195,178,146,65,48,48,32,32,16,16,243,243,243,243,243,243,243,243,16,0,0,227,211,195,178,162,178,243,243,243,130,130,130,146,130,113,97,81,65,32,65,113,146,195,195,195,195,243,243,243,243,243,243,243,243,195,195,195,195,162,113,81,32,227,195,178,146,130,113,81,65,32,32,32,32,32,32,243^0,170,101,223,69,69,69,48,243,243,243,243,227,195,178,146,69,69,207,207,223,207,207,207,243,243,243,243,243,243,243,243,227,195,178,146,130,227,211,195,178,162,113,81,65,48,32,146,130,113,97,81,65,0,0,0,0,0,0,243,243,243,243,243,243,243,243,0,0,0,0,0,0,227,195,178,146,130,113,81,65,211,178,146,113,81,65,32,243,243,243,243,243,243,243,81,65,32,0,0,0,0,0,227,195,178,146,130,113,81,65,211,178,146,113,81,65,32,0,211,195,178,162,146,146,130,0,0,0,0,0,0,0,0,113,97,97,81,65,81,65,32,0,0,0,0,0,48,48,32,32,16,16,16,211,178,146,113,81,65,32,0,0,0,0,0,0,0,0,0,130,130,130,243,243,243,243,0,0,0,0,0,0,32,32,32,32,32,32,32,32,243,243,243,243,243,243,243,243,48,81,130,178,195,195,195,195,227,195,178,146,130,113,81,65,195,195,195,162,130,81,243)","FlatUI from flat ui colors website","(26,22,46,39,52,41,155,142,52,44,241,243,230,211,231,192,236,189,149,127^188,160,204,174,152,128,89,68,73,62,196,156,126,84,76,57,240,195,165,140^156,133,113,96,219,185,182,173,94,80,15,18,34,0,60,43,241,199,166,141)","MakeCode Arcade Palette","(255,255,255,255,255,36,120,0,135,142,164,92,229,145,0^255,33,147,129,246,156,220,63,242,46,131,64,205,70,0^255,33,196,53,9,163,82,173,255,196,159,108,196,61,0)","Oekaki from Oekaki.nl","(0,144,230,255,154,60,56,36,56,77,143,240,255,217,144,76,107,164,201,241^0,144,228,255,195,142,66,49,77,125,179,203,220,125,100,67,11,49,108,168^0,144,213,255,224,231,161,61,81,35,50,105,199,60,45,52,72,63,127,202)","Legacy Paint","(0,126,190,255,126,254,4,6,255,126,0,0,126,254,4,6^0,126,190,255,0,0,126,255,255,126,0,0,0,0,126,255^0,126,190,255,0,0,0,4,4,0,126,255,126,255,126,255)","XP Paint","(0,128,192,255,128,255,128,255,0,0,0,0,0,0,128,255,128,255,0,0,0,128,0,128,128,255,128,255^0,128,192,255,0,0,128,255,128,255,128,255,0,0,0,0,128,255,64,255,128,255,64,128,0,0,64,128^0,128,192,255,0,0,0,0,0,0,128,255,128,255,128,255,64,128,64,128,255,255,128,255,255,128,0,64)","Vista Paint","(0,70,120,180,220,255,153,156,237,255,255,229,255,245,255,255,168,211,34,157,0,153,77,112,47,84,111,181^0,70,120,180,220,255,0,90,28,163,126,170,194,228,242,249,230,249,177,187,183,217,109,154,54,109,49,165^0,70,120,180,220,255,48,60,36,177,0,122,14,156,0,189,29,188,76,97,239,234,243,209,153,142,152,213)","Piet Palette by Piet Mondrain","(224,212,240,14,1^229,18,206,39,74^231,26,6,33,151)","Japanese Woodblock Palette by Polyducks","(43,98,217,227,36,93,92,177,176,212,224,62^40,76,172,207,61,114,139,165,58,128,200,105^33,60,139,180,92,117,147,141,72,77,114,88)","Human Faces by Romney57","(227,187,144,100,33,25,13,241,220,200,129,76,178,118,100,0,230,212,192,158,249,255,255,255,255,255,255,255,255,255,255,255,251,255,255,255,255,239,229,255,255,244,240,236,237,209,179,149,255,239,215,188,161,141,121,109,93,78,62,50,38,27,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,255,255,255,236,207,176,144,120,96,84,69,55,38,44,33,12,0^242,222,202,181,150,118,71,248,237,230,199,175,255,255,221,200,238,225,202,157,251,249,245,236,241,224,213,243,224,204,183,167,233,204,171,138,205,154,115,82,23,143,98,64,231,196,157,117,255,235,204,170,136,110,85,76,64,52,39,25,14,0,34,46,57,69,80,92,103,114,126,138,149,161,172,184,195,206,218,229,239,216,190,164,144,125,110,90,71,50,44,33,12,0^253,251,249,246,243,210,161,233,200,201,132,80,89,3,23,83,156,87,51,36,231,196,157,179,118,130,79,224,178,128,77,38,231,188,145,101,210,154,115,82,68,177,146,122,246,233,219,205,255,233,200,164,127,99,72,65,55,46,35,17,4,0,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200,241,220,197,174,156,139,122,100,79,56,44,33,12,0)","HSV Palette by MadJik","(255,255,255,255,255,255,255,255,255,255,255,255,248,235,223,211,199,187,175,163,150,138,126,114,102,90,77,65,53,41,29,17,4,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7,19,31,43,55,68,80,92,104,117,129,141,154,166,178,190,203,215,227,240,252,255^5,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,13,26,38,50,62,74,86,98,111,123,135,147,159,171,184,196,208,220,232,244,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,245^116,129,141,153,165,177,189,201,213,225,237,249,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,252,240,228,216,203,191,179,167,154,142,130,118,105,93,81,69,56,44,32,19,7,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)","ST24 Christmas by Skiller Thomson","(26,51,77,115,140,166,204,229,242,242,242,255,216,184,152,122,93,80,58,47,35,31,27,22^13,20,23,32,42,50,71,101,136,170,206,255,242,242,217,204,179,153,128,102,77,64,51,38^15,22,23,29,35,41,51,69,97,133,182,255,194,145,119,92,71,61,45,36,27,26,23,19)","Reds by Ladybug","(255,250,255,124,237,205,194,234,178,150,128,164,234,126,255,180,210,202,191,66,184,94,141,147^255,138,36,10,41,92,24,17,34,0,0,90,60,25,168,55,31,52,10,13,15,25,2,58^255,114,170,2,57,92,7,95,34,24,0,82,83,27,170,87,60,51,48,9,10,20,41,22)" +repeat $# { +m=${var{$>+1}} +if isnum($m) +if isint($m) +m=${arg\ 1+$m,bw,rgb,b_rgb,bw_rgb,cmy,cmyk,wcmyk,rgbcmy,1bitrgb,aurora,zenit,gbg,duel,hocuspocus,playpal,srb2,uzebox,kens16,kens32,kens54,aap12,aap16,aap64,aap96,aap128,aap_dga16,cheerful,db8,db16,db32,db_iso22,dimwid17,dimwid23,edg4,edg8,edg16,edg32,edg36,edg64,famicube,juicy32,juicy56,xaiue,15pdx,20pdx,24pdx,cabana,fant16,fant24,tf23,tfp39,faraway,fleja,koni,linearbasic,legowiki,lego2021,vinelinear,arcade,arq,atom,blk36,blkneo,brokefac,bubblegum,cpcboy,cade,calder,cdbac,cgarne,dinoknight,4l,fzt,indecision,island,journey,shallowmarsh,lago_nenufar,juicy,chocolateganache,brightwinter1,brightwinter2,kawaii,xdb,gzxp,chromatic,piet_code,boltbait_matrix,material_design,thehamster_rainbow,boltbait_rainbow,scrj,pxls,lospec,moderna,oak,nature,rbypgo,new_worlds,nauris,dynamite,interstate,downgraded,pear,pineapple,peachy,resurrect,rosy42,slso,softy,spec,roarin80s,starmancer,superfuture,sunshine,sweetie,calm,optimism,taffy,todayland,trirampo,reddit_place_2022,tropical,vivid,shido,intacto,itatsi,enos,grixel,superb,undertones,tango,cheese,equpix15,zughy,voodo,franzston,night,star29,star34,still_life,simjpc,acid,battery,clump,cthul,crimso11,coptec,drz,eggy,europa,greyt,jewel,polar,sheltzy,wyrm,yume_nikki,rube_goldberg,boomboom,g8,crayola,funky,golden_wall,matriax,nt1h,jerrypie,nineties_nine,on70,anb,retrocal,punolit,luap,autum_villan,au15,au15y,galaxy_flame,cretaceous,antiquity,mushroom,aerugo,hotel_paintings,nopal,gpy,blessing,fairydust,milkshake,fuzz,fairy,naji,easter,pastel_and_darks,pastel_irena,nostalgia,ocaso,pastel_starlitsunset,pollen,kule,hydrangea,fluffy,st8rb,neon,cyclope,sy,syz,tui,cave,psygnosia,marshmellow,lost_century,finlal,industrial,murder_mystery,fate_and_destiny,vinik,ykb,halloween,graveyard,steamlords,frostical,deuterospill,cool_bone,muted_ally,ephemera,ink,violet_dreams,tinyfolks,old_gold,rosemoss,aaprad,aapmaj,dead_weight,mojave,pet8,pet8d,xaiue_rad,daruda,firestorm,borkfest,spicy,rust,apricot,supernova,pastry,sandy,illumination,nyx,dreamhaze,oil,regal,softdemon,sgm,midnight_ablaze,black_cherry,sunset_red,inkpink,brash_pink,pink_neon_sign,enchanted_purple,arch,spaceyeaster,fornaxvoid1,fornaxvoid2,pixelwave,s1,berry_nebula,abyss,moonlight,moon39,h2o,magic_waters,bluemold,moss,deep_maze,toxic_slime,lush_green,tsunami,cryptic_ocean,marsh_madness,oxyd,pinkgreen,woodwalk,paper,sahara_pastell,sunflower,arthoe,sky,ocean_glass,royal,eulbink,winter_wonderland,moon_squid,stratus,arctic_dust,clouds_sunset,lilac_skies,sea_of_fire,autochrome3,autochrome5,gb_d_1,gb_d_2,gb_andrade,gb_blue,gb_bz,gb_suburb,gb_crimson,gb_didi,gb_dirty,gb_arne,gb_easy,gb_forest,gb_hg,gb_lg,gb_nostalgia,gb_platinum,gb_kirokaze,gb_cyber,gb_wish,gb_grapefruit,gb_ice_cream,gb_rb,gb_gold,gb_choco,gb_gray,gb_space,gb_purpdawn,moon_crystal,arne,autumn_chill,cherrymelon,hal4,hollow,lavender,maw,voltage_warning,tritanopia,rabbit,amiga2600ntsc,amiga2600pal,amiga2600secam,amiga7800mess,amiga7800,amstrad_cpc,apple,atari,cga,cga00,cga01,cga10,cga11,cga20,cga21,c64_pepto,c64_colodore,com_vic_20,colecovision,jmp,mac2,mac8,msx,nes,pico,risc,samcoupe,mo5,trs80,virtualboy,vga,win95,zx,gnome,elc,chip16,deluxepaint,flat,makecode,oekaki,lms,msxp,vista,piet,japwood,humanfaces,hues,christmas,ladybugreds} +fi +fi +${p_$m} => ${n_$m} +if $> out.=,$m +else out=$m +fi +if $rd p_$m,n_$m=continue, fi +} +v + e[^-1] "Create palette(s) '"$out"'." v - +status $out +#@cli rep_transfer_color_reduced: [palette],0<=_dither<=1,_pixel_ratio_w>=0,_pixel_ratio_h>=0,_windows_width>=0,_window_height>=0,_color_restriction_per_window>=0,_color_restriction_per_whole>=0,_number_of_alpha>=0,_alpha_dithering>=0,_alpha_mode={ 0=index | 1=window-index | 2=ordered },_alpha_restrict>=0 : { bit_depth | bit_a:...:bit_z | :[palette] },0<=_dither<=1,_pixel_ratio_w>=0,_pixel_ratio_h>=0,_color_restriction_per_whole>=0,_number_of_alpha>=0,_alpha_dithering>=0,_alpha_mode={ 0=index | 1=ordered } +#@cli : Change images to look as if it was reduced. Can be used to emulate old hardware. +rep_transfer_color_reduced: +skip ${3=1},${4=1},${5=1},${6=},${7=},${8=},${9=},${10=},${11=},${12=},${13=},${14=},${15=} +if ${is_image_arg\ $1} mode=0 +else mode={(find('$1',':',0,1)!=-1)||isint($1)} +fi +if $mode +location_of_bracket={find('$1','[',0,1)} +if $location_of_bracket!=-1 +('$1') +crop. $location_of_bracket,{w#-1-1} +img_arg={t} +rm. +pass$img_arg 0 +_rep_transfer_color_reduced[^-1] $mode,[-1],${2-10} +rm. +else _rep_transfer_color_reduced $mode,${1-10} +fi +else +pass$1 0 +_rep_transfer_color_reduced[^-1] $mode,[-1],${2-14} +rm. +fi +_rep_transfer_color_reduced: +skip ${3=1},${4=1},${5=1},${6=},${7=},${8=},${9=},${10=},${11=},${12=},${13=},${14=},${15=} +num_of_images,mode,special_effect={$!},$1,0 +if isnum($3)||ispercentage($3) +dither={cut($3,0,1)} +else +dither,special_effect={[$mode?.25,1]} +('$3') +split_point=-{w#-1-2} +split. x,$split_point +eff_factor={{-2,t}} +dither*=$eff_factor +ov={I(#-1,0)=='c'?4+(I(#-1,1)=='l'):(2*(I(#-1,0)=='l')+(I(#-1,1)=='v'))} +rm[-2,-1] +fi +pixel_ratio_w,pixel_ratio_h,rescale_back_w,rescale_back_h={pixel_ratio=vmax([1,1],int(abs([$4,$5])));[pixel_ratio,pixel_ratio*100]} +return_index_values={$mode?(narg($11)?$11%3:0):(narg($15)?$15%3:0)} +out_color={!$return_index_values} +number_of_alpha,alpha_dithering={$mode?(narg($8)?int(abs($8))):(narg($10)?int(abs($10)))},{$mode?(narg($9)?cut($9,0,1)):(narg($11)?cut($11,0,1))} +alpha_mode={$number_of_alpha?($mode?($10&1)*2+1:$12%3+1)} +color_restriction_per_window,color_restriction_whole={!$mode?(narg($8)?$8:0)},{$mode?(narg($7)?int(abs($7))):(narg($9)?int(abs($9)))} +if !$mode&&($color_restriction_whole?($color_restriction_whole<=$color_restriction_per_window)) color_restriction_per_window=0 fi +decrement_color_restriction_whole={$color_restriction_whole-1} +pixel_ratio_gcd={gcd($pixel_ratio_w,$pixel_ratio_h)} +if $pixel_ratio_gcd>1 pixel_ratio_w,pixel_ratio_h/=$pixel_ratio_gcd fi +if $pixel_ratio_w==1||$pixel_ratio_h==1 +initial_rescale_w,initial_rescale_h={bd=max($pixel_ratio_w,$pixel_ratio_h);100*($pixel_ratio_w>$pixel_ratio_h?vector(#2,1)/[bd,1]:vector(#2,1)/[1,bd])} +else +min_dimension,max_dimension={min($pixel_ratio_w,$pixel_ratio_h)},{max($pixel_ratio_w,$pixel_ratio_h)} +recip_rd={1/($max_dimension/$min_dimension)} +initial_rescale_w,initial_rescale_h={100*($pixel_ratio_w>$pixel_ratio_h?[$recip_rd,1]:[1,$recip_rd])} +fi +if $mode +threshold_map_level,alpha_threshold_map={narg($6)?$6:3} +alpha_restrict=$number_of_alpha +else +window_width,window_height,alpha_restrict,alpha_threshold_map={int(abs([narg($6)?int(abs($6)),narg($7)?int(abs($7))]))},{narg($13)?int(abs($13))},{narg($14)?$14:3} +if $window_width==1&&$window_height==1 color_restriction_per_window=0 fi +if $window_width&&!$window_height window_height+=1 fi +if $window_height&&!$window_width window_width+=1 fi +fi +use_images=0 +if ${is_image_arg\ $2} +pass$2 0 => palette +if !(s%2) error pal_cont_alp fi +if h#-1>1&&d#-1==1 rotate. -90 +elif h#-1>1&&d#-1>1 colormap. 0,,0 +fi +if $color_restriction_whole>=w#-1 color_restriction_whole=0 fi +if !$color_restriction_per_window color_restriction_per_window={w#-1} fi +store. img_palette +use_images+=1 +fi +if $alpha_mode?($alpha_mode<($mode?2:3)) +$number_of_alpha,1,1,1,"begin( +const dividier=(w-1)/255; +); +x/dividier;" +=> alpha +use_images+=1 +fi +if $use_images==2 +images="$>",-1 +v_col_info,v_alpha=[palette],[alpha] +elif $use_images==1 +images="$>",-1 +if ${is_image_arg\ $2} +v_col_info,v_alpha=[palette],$number_of_alpha +else +v_col_info,v_alpha=$2,[alpha] +fi +else +images="$>" +v_col_info,v_alpha=$2,$number_of_alpha +fi +contain_pal=${is_image_arg\ $v_col_info} +repeat $num_of_images { +local[{[$images]}] { +if s#0>4||!s#0 continue fi +targ_img_alp,con_img_palette={!(s#0%2)},0 +resize[0] $initial_rescale_w%,$initial_rescale_h%,100%,100%,3 +if $contain_pal +$img_palette +con_img_palette=1 +use_color_space_conversion,min_col_pos={s0=s#0;s0-=!(s0%2);csc=s0!=s#-1;s#-1>s0?[csc,-1]:[csc,0];} +if $use_color_space_conversion +if $min_col_pos==-1 to_gray[-1] +else +cs_convert=${arg\ s#0-1,to_gray,to_graya,to_rgb} +$cs_convert[0] +fi +fi +fi +if $targ_img_alp?$out_color +sh[0] 0,{s#0-2} +if $color_restriction_whole&&$con_img_palette ++index[-1] [palette],1,0 +histogram. 100% +{w},1,1,1,x +pixelsort. -,x,.. +crop. 0,0,$decrement_color_restriction_whole,0 +map. [palette] +if $special_effect _rep_transfer_color_reduced_special_effect[-3] $ov,$eff_factor fi +if $mode rep_ordered_dithering[-3] [-1],$dither,$threshold_map_level,$out_color,1 +else rep_index_by_window_and_color_restriction[-3] [-1],$dither,$color_restriction_per_window,$window_width,$window_height,1,$out_color +fi +rm[-2,-1] +else +if $special_effect _rep_transfer_color_reduced_special_effect[-1] $ov,$eff_factor fi +if $mode rep_ordered_dithering[-1] $v_col_info,$dither,$threshold_map_level,$out_color,1 +else rep_index_by_window_and_color_restriction[-1] $v_col_info,$dither,$color_restriction_per_window,$window_width,$window_height,1,$out_color +fi +fi +rm. +if $alpha_mode +sh[0] {s#0-1} +if $alpha_mode==3 rep_ordered_dithering[-1] $v_alpha,$alpha_dithering,$alpha_threshold_map,$out_color,1 +elif $alpha_mode==2 rep_index_by_window_and_color_restriction[-1] $v_alpha,$alpha_dithering,$alpha_restrict,$window_width,$window_height,1,$out_color +else index[-1] $v_alpha,$alpha_dithering,1 +fi +rm. +fi +else +if $targ_img_alp split_opacity[0] fi +if $color_restriction_whole&&$con_img_palette ++index[0] [palette],1,0 +histogram. 100% +{w},1,1,1,x +pixelsort. -,x,.. +crop. 0,0,$decrement_color_restriction_whole,0 +map. [palette] +if $mode rep_ordered_dithering[0] [-1],$dither,$threshold_map_level,$out_color,1 +else rep_index_by_window_and_color_restriction[0] [-1],$dither,$color_restriction_per_window,$window_width,$window_height,1,$out_color +fi +rm[-2,-1] +else +if $mode rep_ordered_dithering[0] $v_col_info,$dither,$threshold_map_level,$out_color,1 +else rep_index_by_window_and_color_restriction[0] $v_col_info,$dither,$color_restriction_per_window,$window_width,$window_height,1,$out_color +fi +fi +if $targ_img_alp +if $return_index_values +if $alpha_mode==3 rep_ordered_dithering[1] $v_alpha,$alpha_dithering,$alpha_threshold_map,$out_color,1 +elif $alpha_mode==2 rep_index_by_window_and_color_restriction[1] $v_alpha,$alpha_dithering,$alpha_restrict,$window_width,$window_height,1,$out_color +else index[1] $v_alpha,$alpha_dithering,$out_color +fi +a[0,1] c +else rm[1] +fi +fi +fi +if $con_img_palette rm[palette] fi +if $return_index_values!=2 resize[0] $rescale_back_w%,$rescale_back_h%,100%,100%,1 fi +} +} +remove_named alpha +_rep_transfer_color_reduced_special_effect: +if $1>3 +f ":begin( +const eff_factor=cut($2,0,1)/4; +const overlay_value=($1&1)*255; +arr_overlay=vector(#s,overlay_value); +); +((x+y)&1)?lerp(I,arr_overlay,eff_factor):I;" +else +f ":begin( +const overlay_value=(int($1/2)%2)*255; +const eff_factor=cut($2,0,1)/4; +const direction=$1%2; +arr_overlay=vector(#s,overlay_value); +direction?( +eff_app()=x%2?(lerp(I,arr_overlay,eff_factor);):I; +):( +eff_app()=y%2?(lerp(I,arr_overlay,eff_factor);):I; +); +); +eff_app();" +fi +#@cli rep_index_by_window_and_color_restriction:[palette],0<=_dithering<=1,_color_restriction>2,_window_width,_window_height,_window_depth,_map_palette={ 0 | 1 } +#@cli : Index images per window +rep_index_by_window_and_color_restriction: +skip ${2=1},${3=},${4=1},${5=1},${6=1},${7=1} +dithering,wi_w,wi_h,wi_d,map_palette,timg={cut($2,0,1)},{vmax(vector(#3,1),int(abs([${4-6}])))},{$7%2},{$!} +pass$1 1 +if h#-1>1&&d#-1==1 +rm. pass$1 0 +rotate. -90 +elif h#-1>1&&d#-1>1 +rm. pass$1 0 +colormap. 0,,0 +fi +col_res={narg($3)?cut(int(abs($3)),2,w#-1):w#-1} +dec_col_res={$col_res-1} +if $dithering +jjn_1R0D,jjn_2R0D,jjn_2L1D,jjn_1L1D,jjn_M01D,jjn_1R1D,jjn_2R1D,jjn_2L2D,jjn_1L2D,jjn_M02D,jjn_1R2D,jjn_2R2D={([7,5,3,5,7,5,3,1,3,5,3,1]/48)*$dithering} +fi +eval " +const spectrum_size=s#-1; +const rf=$timg; +valid_spec=1; +repeat(rf,id, +if(s#id!=spectrum_size,valid_spec=0;break();); +); +valid_spec; +" +if !${} error incompatible_img_pal fi +if $col_res>=w#-1 +index[^-1] [-1],$dithering,$map_palette +rm. +return +fi +repeat $timg { +local[$>,-1] { +ow,oh,od,tw,th,td,nw,nh,nd={od=[w#0,h#0,d#0];wd=vmin([w#0,h#0,d#0],[$wi_w,$wi_h,$wi_d]);td=ceil(od/wd);nd=td*wd;[od,td,nd]} +if [$tw,$th,$td]==vector(#3,1) ++index[0] [1],1,0 +histogram. 100% +{w},1,1,1,x +pixelsort. -,x,.. +crop. 0,0,$dec_col_res,0 +map. ... +index[0] .,$dithering,$map_palette +else +r[0] $nw,$nh,$nd,100%,0,3,.5,.5,.5 ++index[0] [1],{$dithering?.75},0 +$tw,$th,$td,1,*"begin( +const nb_cols=w#1; +const spectrum_size=s#1; +const inc_spectrum_size=spectrum_size+1; +const nb_restrict=$col_res; +const dec_nb_restrict=nb_restrict-1; +const res_y_spec=nb_restrict*spectrum_size; +const wi_w=$wi_w; +const wi_h=$wi_h; +const wi_d=$wi_d; +const dec_wi_w=wi_w-1; +const dec_wi_h=wi_h-1; +const dec_wi_d=wi_d-1; +const box_dim=wi_w*wi_h*wi_d; +init_freq_y_ind=expr('(x%2)?int(x/2);',nb_cols*2); +init_sel_res_pal_dist_arr=vector(#nb_restrict,0); +const dithering_mode=$dithering; +const map_palette=$map_palette; +dithering_mode?( +const jjn_1R0D=$jjn_1R0D; +const jjn_2R0D=$jjn_2R0D; +const jjn_2L1D=$jjn_2L1D; +const jjn_1L1D=$jjn_1L1D; +const jjn_M01D=$jjn_M01D; +const jjn_1R1D=$jjn_1R1D; +const jjn_2R1D=$jjn_2R1D; +const jjn_2L2D=$jjn_2L2D; +const jjn_1L2D=$jjn_1L2D; +const jjn_M02D=$jjn_M02D; +const jjn_1R2D=$jjn_1R2D; +const jjn_2R2D=$jjn_2R2D; +v_col()=I(#2,pos_x,pos_y,pos_z); +map_palette?( +result_img_part()=( +old_color=I(#0,pos_x,pos_y,pos_z); +new_color=I(#1,res_col_id[argmin(sqrt(res_color_sum))],0,0); +I(#0,pos_x,pos_y,pos_z)=new_color; +); +):( +result_img_part()=( +old_color=I(#0,pos_x,pos_y,pos_z); +new_color_pos=res_col_id[argmin(sqrt(res_color_sum))]; +new_color=I(#1,new_color_pos,0,0); +i(#0,pos_x,pos_y,pos_z,0)=new_color_pos; +); +); +result_img()=( +result_img_part(); +diff_color=old_color-new_color; +use_strip_1D=(pos_y+1)min_out_of_boundary_offset_pos[0]?( +use_strip_1D?( +I(#0,pos_x-2,pos_y+1,pos_z)+=diff_color*jjn_2L1D; +); +use_strip_2D?( +I(#0,pos_x-2,pos_y+2,pos_z)+=diff_color*jjn_2L2D; +); +); +(pos_x-1)>min_out_of_boundary_offset_pos[0]?( +use_strip_1D?( +I(#0,pos_x-1,pos_y+1,pos_z)+=diff_color*jjn_1L1D; +); +use_strip_2D?( +I(#0,pos_x-1,pos_y+2,pos_z)+=diff_color*jjn_1L2D; +); +); +(pos_x+1)0,0<=dither<=1,threshold_map_iter>0,map_pal={ 0 | 1 },_use_previous_threshold_map={ 0 | 1 } : +#@cli : level_a>0:.:level_z>0,0<=dither<=1,threshold_map_iter>0,map_pal={ 0 | 1 },_use_previous_threshold_map={ 0 | 1 } : +#@cli : [palette],0<=dither<=1,threshold_map_iter>0,map_pal={ 0 | 1 },_use_previous_threshold_map={ 0 | 1 } : +#@cli : level<0,0<=dither<=1,threshold_map_iter>0,spread,_use_previous_threshold_map={ 0 | 1 } +#@cli : +#@cli : Apply ordered dithering effect onto image. +#@cli : +#@cli : Note A: depth_a:.:depth_z implies that the first argument is a set of arguments joined by the ':' char. This is used for separating bit depth channels. +#@cli : Note B: Negative value is used to alter values of images without indexing, and that is useful for generating windows-based ordered-dithering with the use of rep_index_by_window_and_color_restriction command. +rep_ordered_dithering: +skip ${4=1},${5=0} +check "($2?($2>=0&&$3>0):1)" +dithering,iteration={cut(abs($2),0,1)},{int(abs($3))} +if ${is_image_arg\ $1} use_pal_image=1 +else use_pal_image=0 +fi +command "convert_first_arg_to_mul_args : +('$1') +local[-1] { +split. -,{':'} +foreach[^-1] { +(',') +a y +} +a y +} +_bit_depths={t} rm. +u $_bit_depths" +command "index_from_bitmaps : +t_bit_depths:=[$_bit_depths]+1 +foreach { +if s>$_narg_bit_depths +sh. 0,{$_narg_bit_depths-1} +fi +if s==3 +dims:=vector3($t_bit_depths,1,1) +$dims,{s},:\"begin( +const mxi=w-1; +const myi=h-1; +const mzi=d-1 +); +[x/mxi,y/myi,z/mzi]*255;\" +elif s==2 +dims:=vector3(vector2($t_bit_depths),1,1) +$dims,{s},:\"begin( +const mxi=w-1; +const myi=h-1; +); +[x/mxi,y/myi]*255;\" +else +dims:=vector1(vector2($t_bit_depths),1,1) +$dims,{s},\"begin( +const mxi=w-1; +); +x/mxi*255;\" +fi +index[-2] [-1],0,1 +k[0] +}" +if isnum($1) +if $1<0 +if $#!=4 error inv_arg_cnt fi +if $-1==0 error inv_spr fi ++rep_bayer_threshold_map $iteration,,$5 +f[^-1] "begin( +const n=w#-1-1; +const dithering=$dithering*abs($-1); +); +thres_x=x&n; +thres_y=y&n; +threshold_map=i(#-1,thres_x,thres_y,0,0); +new_color=(I+threshold_map*dithering);" +rm. +return +fi +fi +if $use_pal_image +pass$1 0 ++rep_bayer_threshold_map $iteration,,$5 +repeat $!-2 { +local[$>,-2,-1] { +{w#0},{h#0},100%,1," +v_col=I#0; +color_sum=vector(#w#-2,0); +repeat(s#-2,k, +color_sum+=sqr(crop(#-2,0,0,0,k,w#-2,1,1,1)-v_col[k]); +); +color_sum=sqrt(color_sum); +p=argmin(color_sum); +color_sum[p]; +" +spread:=ic#-1*2 +rm. +if $spread +f[0] "begin( +const n=w#-1-1; +const scale=$dithering*$spread; +); +thres_x=x&n; +thres_y=y&n; +threshold_map=i(#-1,thres_x,thres_y,0,0); +v_col=cut((I+threshold_map*scale),0,255);" +index[0] [1],0,$4 +fi +} +} +rm[-2,-1] +else +if $dithering +_bit_depths=${-convert_first_arg_to_mul_args} +var_bit_depths:=var($_bit_depths) +if !$var_bit_depths&&narg($_bit_depths)>0 +_bit_depths:=([$_bit_depths])[0] +fi +if isint($_bit_depths) ++rep_bayer_threshold_map $iteration,,$5 +f[^-1] "begin( +const n=w#-1-1; +const bit_depth=max(1,int(abs($_bit_depths))); +const scale=255/bit_depth; +const end_scale=$4?scale:1; +const dithering=$dithering; +const internal_scale=scale*dithering; +const power_level=s>1?2^(1/(bit_depth+.5)):1; +); +thres_x=x&n; +thres_y=y&n; +threshold_map=i(#-1,thres_x,thres_y,0,0); +new_color=(I+internal_scale*threshold_map)/scale; +inew_color=int(new_color); +exp_dist_from_inew_color=abs(new_color-inew_color)^power_level; +cut(round(lerp(new_color,exp_dist_from_inew_color+inew_color,dithering))*end_scale,0,255);" +rm. +else +_narg_bit_depths:=narg($_bit_depths) +if $_narg_bit_depths>3 error excess_args fi ++rep_bayer_threshold_map $iteration +f[^-1] "begin( +const n=w#-1-1; +const dithering=$dithering; +_bit_depths=vector(#s,"$_bit_depths"); +scale=255/_bit_depths; +internal_scale=scale*dithering; +power_level=2^(1/_bit_depths); +); +thres_x=x&n; +thres_y=y&n; +threshold_map=i(#-1,thres_x,thres_y,0,0); +new_color=(I+internal_scale*threshold_map*dithering);" +rm. +index_from_bitmaps +fi +else +if isint($1) +f "begin( +const bit_depth=max(1,int(abs($1))); +const scale=255/bit_depth; +); +round(I/scale)*scale;" +else +_bit_depths=${-convert_first_arg_to_mul_args} +_narg_bit_depths:=narg($_bit_depths) +if $_narg_bit_depths>3 error excess_args fi +index_from_bitmaps +fi +fi +fi +uncommand convert_first_arg_to_mul_args,index_from_bitmaps +#@cli +rep_bayer_threshold_map: iteration,_normalize,_load_preserved_map +#@cli : Create Bayer Threshold Map ++rep_bayer_threshold_map: +skip ${2=1},${3=0} +if narg($_bayer_threshold_map)&&$3 +$_bayer_threshold_map +else +ws=2 +(0,2;3,1) ++store. initial_map +repeat $1 { +ws*=2 +$initial_map +$ws,$ws +eval[-2] "begin( +const ws=$ws; +const half_ws=ws>>1; +initial=crop(#-3); +); +M_Surface=initial*4; +M_Surface+=i; +draw(#-1,M_Surface,x*half_ws,y*half_ws,0,0,half_ws,half_ws,1,1); +" +rm[-3,-2] +} +if $2 ++. 1 +/. {4^($1+1)} +-. {ia#-1} +fi ++store. _bayer_threshold_map +fi +#@cli modf: eq. to 'modular_formula'. +modf: +skip ${2=255},${3=100%} +max_img_ind={$!-1} +modf_arg2,modf_arg3=${2-3} +if ${is_image_arg\ $2} +pass$2 1 +name[-1] max_channel_image +modf_arg2=[$max_channel_image] +fi +if ${is_image_arg\ $3} +pass$3 1 +name[-1] channel_values_image +modf_arg3=[$channel_values_image] +fi +modular_formula[0-$max_img_ind] $1,$modf_arg2,$modf_arg3 +keep[0-$max_img_ind] +#@cli modular_formula : operation,max_channel_value={ float_value | [image] },_channel_values={ float_value(%) | [image] } +#@cli : Apply modular formulas into selected images. 'channel_value' can be values outside the channel ranges of image. +#@cli : When using a image argument to max_channel_value, the dimension should be equal to the spectrum of target images. +#@cli : When using a image argument to channel_value, it can be single spectrum or equal to the spectrum of target images. +#@cli : (eq. to 'modf'). +#@cli : operation can be { 0=modulo | 1=modulo_continuous | 2=divisive | 3=divisive_continuous | 4=additive | 5=additive_continuous} +#@cli : In addition, the operation variable can be the corresponding string as argument. +#@cli : Author: Reptorian. +#@cli : Default value: '_channel_value=100%' +modular_formula: +skip ${2=255},${3=100%} +if isint($1) +modular_mode={int($1)%6} +else +modulo,modulo_continuous,divisive,divisive_continuous,additive,additive_continuous=0,1,2,3,4,5 +modular_mode=$$1 +if !narg($modular_mode) error invalid_input fi +fi +max_images_index,utilize_max_channel_image,utilize_channel_values_image={$!-1},0,0 +if ${is_image_arg\ $2} +pass$2 1 +name[-1] max_channel_image +if find(crop(#-1),0,0,1)+1 error invalid_max_chan_val_set fi +utilize_max_channel_image=1 +if s==1 max_channel={i} fi +else +if !$2 error invalid_max_chan_val fi +fi +if ${is_image_arg\ $3} +pass$3 1 +name[-1] channel_values_image +utilize_channel_values_image=1 +else +use_percent_mode:=ispercentage($3) +if !$3 +if $modular_mode==2||$modular_mode>3 return +else +foreach { 100%,100%,100%,100% rm.. } return +fi +fi +fi +fill[0-$max_images_index] "begin( +const modular_mode=$modular_mode; +const epsilon=1E-13; +const utilize_max_channel_image=$utilize_max_channel_image; +if(utilize_max_channel_image, +const max_channel_reference=$max_channel_image; +whds#max_channel_reference==1?( +const max_channel=$max_channel; +const max_channel_mod=max_channel+epsilon; +const double_max_channel=max_channel*2; +const use_max_channel_array=0; +):( +max_channel=crop(#max_channel_reference); +max_channel_mod=max_channel+epsilon; +double_max_channel=max_channel*2; +const use_max_channel_array=1; +); +, +const max_channel=$2; +const max_channel_mod=max_channel+epsilon; +const double_max_channel=max_channel*2; +const use_max_channel_array=0; +); +if($utilize_channel_values_image, +const channel_values_reference=$channel_values_image; +const spectrum_size_of_channel_values_reference=s#channel_values_reference; +const multispectrum_mode=spectrum_size_of_channel_values_reference>1; +multispectrum_mode?( +multiplier()=( +channels_values=I#channel_values_reference; +nonzero_values=!!channels_values; +zero_values=!channels_values; +channels_values+=zero_values; +result_multiplier(); +);0; +):( +multiplier()=( +channel_value=i(#channel_values_reference,x,y,z,0); +channel_value?max_channel/channels_values; +);0; +); +modular_mode==0?( +multispectrum_mode?( +modular_output()=( +channels_values=abs(I#channel_values_reference); +multiplier=!!channels_values; +(I%(channels_values+epsilon)*multiplier)%max_channel_mod; +); +):( +modular_output()=( +channel_value=i(#channel_values_reference,x,y,z,0); +channel_value?I%(channel_value+epsilon)%max_channel_mod; +); +); +): +modular_mode==1?( +multispectrum_mode?( +modular_output()=( +channels_values=I#channel_values_reference; +multiplier=!!channels_values; +channels_values+=epsilon*(1-multiplier); +a=I%(channels_values*2)%max_channel_mod; +multiplier*(channels_values-abs(channels_values-a)); +); +):( +modular_output()=( +channel_value=i(#channel_values_reference,x,y,z,0); +channel_value?( +double_channel_value=channel_value*2; +a=I%double_channel_value; +channel_value-abs(channel_value-a); +); +); +); +): +modular_mode==2?( +multispectrum_mode?( +result_multiplier()=nonzero_values*(max_channel/channels_values)+zero_values; +modular_output()=(I*multiplier())%max_channel_mod; +):( +modular_output()=( +channel_value=i(#channel_values_reference,x,y,z,0); +channel_value?( +(I*(max_channel/channel_value))%max_channel_mod; +):I; +); +); +): +modular_mode==3?( +multispectrum_mode?( +result_multiplier()=nonzero_values*(max_channel/channels_values); +modular_output()=( +a=(I*multiplier())%double_max_channel; +max_channel-abs(max_channel-a); +); +):( +modular_output()=( +channel_value=i(#channel_values_reference,x,y,z,0); +channel_value?( +a=(I*(max_channel/channel_value))%double_max_channel; +max_channel-abs(max_channel-a); +); +); +); +): +modular_mode==4?( +multispectrum_mode?( +modular_output()=(I+I#channel_values_reference)%max_channel_mod; +):( +modular_output()=(I+i(#channel_values_reference,x,y,z,0))%max_channel_mod; +); +):( +multispectrum_mode?( +modular_output()=( +a=(I+I#channel_values_reference)%double_max_channel; +max_channel-abs(max_channel-a); +); +):( +modular_output()=( +a=(I+i(#channel_values_reference,x,y,z,0))%double_max_channel; +max_channel-abs(max_channel-a); +); +); +); +, +const use_percent_mode=$use_percent_mode; +const divisive_mode=inrange(modular_mode,2,3,1,1); +if(divisive_mode, +use_percent_mode?( +const multiplier=1/$3; +):( +utilize_max_channel_image?( +multiplier=max_channel/$3; +):( +const multiplier=max_channel/$3; +); +); +, +use_percent_mode?( +use_max_channel_array?( +channels_values=max_channel*$3; +if(modular_mode&1, +double_channels_values=channels_values*2; +); +sum_channels_values_eps=channels_values+epsilon; +):( +const channels_values=max_channel*$3; +if(modular_mode&1, +const double_channels_values=channels_values; +); +const sum_channels_values_eps=channels_values+epsilon; +); +):( +use_max_channel_array?( +channels_values=vector(#s,$3); +if(modular_mode&1, +double_channels_values=channel_values*2; +); +sum_channels_values_eps=channels_values+epsilon; +):( +const channels_values=$3; +if(modular_mode&1, +const double_channels_values=channels_values*2; +); +const sum_channels_values_eps=channels_values+epsilon; +); +); +); +modular_mode==0?( +modular_output()=I%sum_channels_values_eps%max_channel_mod; +): +modular_mode==1?( +modular_output()=( +a=I%double_channels_values; +channels_values-abs(channels_values-a); +); +): +modular_mode==2?( +modular_output()=(I*multiplier)%max_channel_mod; +): +modular_mode==3?( +modular_output()=( +a=(I*multiplier)%double_max_channel; +max_channel-abs(max_channel-a); +); +): +modular_mode==4?( +modular_output()=(I+channels_values)%max_channel_mod; +):( +modular_output()=( +a=(I+channels_values)%double_max_channel; +max_channel-abs(max_channel-a); +); +); +); +); +modular_output(); +" +keep[0-$max_images_index] +#@cli rep_bchstatfunc: eq. to 'rep_by_channel_statistical_function'. +rep_bchstatfunc : rep_by_channel_statistical_function $* +#@cli rep_by_channel_statistical_function: _variable,_resize_bool={ 0=Do not resize | 1= Resize to 1x1 } +#@cli : Creates 1x1 image based on defined variables that depends on image value (minimum, maximum, average, variance, sum, product and median) +#@cli : (eq. to 'rep_bchstatfunc').\n +#@cli : Default value: 'resize_bool=0' +rep_by_channel_statistical_function: +v - _gmic_s="$?" v + +_$0 $"*" +_rep_by_channel_statistical_function: +skip ${2=1} +v - mvcma="$1" +if isnum("$1") if isint("$1") mvcma=${arg\ 1+$1,min,max,avg,var,sum,pro,med} fi fi +foreach { v - _rep_bchstatfunc_$mvcma $2 } +_rep_bchstatfunc_im : _rep_bchstatfunc_min $1 +_rep_bchstatfunc_minimum : _rep_bchstatfunc_min $1 +_rep_bchstatfunc_min : repeat s sh $> f. im#-1 rm. done if $1 r 1,1,1,{s},0 fi +_rep_bchstatfunc_iM : _rep_bchstatfunc_max $1 +_rep_bchstatfunc_maximum : _rep_bchstatfunc_max $1 +_rep_bchstatfunc_max : repeat s sh $> f. iM#-1 rm. done if $1 r 1,1,1,{s},0 fi +_rep_bchstatfunc_ia : _rep_bchstatfunc_avg $1 +_rep_bchstatfunc_average : _rep_bchstatfunc_avg $1 +_rep_bchstatfunc_avg : repeat s sh $> f. ia#-1 rm. done if $1 r 1,1,1,{s},0 fi +_rep_bchstatfunc_iv : _rep_bchstatfunc_var $1 +_rep_bchstatfunc_variance : _rep_bchstatfunc_var $1 +_rep_bchstatfunc_var : repeat s sh $> f. iv#-1 rm. done if $1 r 1,1,1,{s},0 fi +_rep_bchstatfunc_is : _rep_bchstatfunc_sum $1 +_rep_bchstatfunc_total : _rep_bchstatfunc_sum $1 +_rep_bchstatfunc_sum : repeat s sh $> f. is#-1 rm. done if $1 r 1,1,1,{s},0 fi +_rep_bchstatfunc_ip : _rep_bchstatfunc_pro $1 +_rep_bchstatfunc_product : _rep_bchstatfunc_pro $1 +_rep_bchstatfunc_pro : repeat s sh $> f. ip#-1 rm. done if $1 r 1,1,1,{s},0 fi +_rep_bchstatfunc_ic : _rep_bchstatfunc_med $1 +_rep_bchstatfunc_median : _rep_bchstatfunc_med $1 +_rep_bchstatfunc_med : repeat s sh $> f. ic#-1 rm. done if $1 r 1,1,1,{s},0 fi +#@cli rep_lbchstatfunc_to_pal: eq. to 'rep_layers_by_channel_statistical_function_to_palette'. +rep_lbchstatfunc_to_pal: rep_layers_by_channel_statistical_function_to_palette $* +#@cli rep_layers_by_channel_statistical_function_to_palette: _variable +#@cli : Converts layers to palette using statistical function by channels per layers into 1x1 tile, then append them. +#@cli : (eq. to 'rep_layers_by_channel_statistical_function_to_palette'). +rep_layers_by_channel_statistical_function_to_palette: rep_bchstatfunc $1 a x +#@cli rep_photomosaic : {foldername|[images_arg]},_tile_width>=0,_tile_height>=0,_dithering<=1,0<=_interpolation<=5,_palette={ 0=average, 1=median},_autocrop,_maxalp +#@cli : Generates mosaic using multiple pictures using indexing methodology, and uses either average or median to determine the mapping based on colors. Tile_Width and Tile_Height cannot be both zero!\n +#@cli : Author: Reptorian. +#@cli : Default value: 'tile_height=0', 'interpolation=5', 'autocrop=0' +rep_photomosaic: +skip ${3=0},${4=.5},${5=0},${6=0},${7=0},${8=255} +include_image_as_arg=${"is_image_arg $1"} +tile_width={round(abs($2))} +tile_height={round(abs($3))} +half_perimeter={$tile_width*$tile_height} +non_zero_length={$tile_width+$tile_height} +total_target_img={$!} +if !$tile_width&&!$tile_height error "($"1>0")"&&"($"2>0")"==F fi +e[^-1] "Generating Mosaic!" +if $include_image_as_arg +pass$1 0 +else +ig $1 +fi +total_end_img={$!} +if ($!-$total_target_img<2) error "_"#"imports>=2==F" fi +diff={$total_end_img-$total_target_img} +if ${-max_s}==4 to_rgba +elif ${-max_s}==3 to_rgb +elif ${-max_s}==2 to_graya +elif ${-max_s}==1 to_gray +fi +if s==2||s>3 contain_alpha=1 +else contain_alpha=0 +fi +endchan={s-2} +if $tile_width&&$tile_height +if $7 autocrop[$total_target_img--1] fi +rep_aspect_crop_2d[$total_target_img--1] $tile_width,$tile_height +if $contain_alpha +sh[$total_target_img--1] 0,{s-2} +if $5==1 +rep_lbchstatfunc_to_pal[$total_end_img--1] median +else +rep_lbchstatfunc_to_pal[$total_end_img--1] average +fi +rm[$total_end_img--2] +else +if $5==1 +rep_lbchstatfunc_to_pal[$total_target_img--1] median +else +rep_lbchstatfunc_to_pal[$total_target_img--1] average +fi +fi +repeat $total_target_img { +mini_width={ceil(w#$>/$tile_width)} +mini_height={ceil(h#$>/$tile_height)} +r[$>] {$mini_width*$tile_width},{$mini_height*$tile_height},100%,100%,0,1,.5,.5 +r[$>] $mini_width,$mini_height,100%,100%,{abs($6)+1} +if $contain_alpha +sh[$>] 0,$endchan +index. [-2],$4,1 +f. "begin( +const length=w#-2; +); +repeat(length,v, +if(I==I(#-2,v,0),break();); +); +v+$total_target_img;" +rm. +else +index[$>] [-1],$4,1 +f[$>] "begin( +const length=w#-1; +); +repeat(length,v, +if(I==I(#-1,v,0),break();); +); +v+$total_target_img;" +fi +} +rm. +r[$total_target_img--1] $tile_width,$tile_height,100%,100%,{abs($6)+1} +r[0-{$total_target_img-1}] {$tile_width*100}%,{$tile_height*100}%,100%,100%,1 +if $contain_alpha +f[0-{$total_target_img-1}] c1 +continue_loop=1 +count=1 +do +if (w#0==w#$count)&&(h#0==h#$count) +same_dim=1 +else +same_dim=0 +continue_loop=0 +fi +count+=1 +while $count<$total_target_img&&$continue_loop +fi +if $total_target_img==1||$same_dim +temp_tile_width={floor(w#0>h#0?$non_zero_length:w#0/h#0*$non_zero_length)} +temp_tile_height={floor(h#0>w#0?$non_zero_length:h#0/w#0*$non_zero_length)} +tile_width={$temp_tile_width} +tile_height={$temp_tile_height} +mini_width={ceil(w#0/$tile_width)} +mini_height={ceil(h#0/$tile_height)} +if $7 autocrop[$total_target_img--1] fi +rep_aspect_crop_2d[$total_target_img--1] $tile_width,$tile_height +if $contain_alpha +sh[$total_target_img--1] 0,{s-2} +if $5==1 +rep_lbchstatfunc_to_pal[$total_end_img--1] median +else +rep_lbchstatfunc_to_pal[$total_end_img--1] average +fi +rm[$total_end_img--2] +else +if $5==1 +rep_lbchstatfunc_to_pal[$total_target_img--1] median +else +rep_lbchstatfunc_to_pal[$total_target_img--1] average +fi +fi +r[0-{$total_target_img-1}] {$mini_width*$tile_width},{$mini_height*$tile_height},100%,100%,0,3,.5,.5 +r[0-{$total_target_img-1}] $mini_width,$mini_height,100%,100%,{abs($6)+1} +repeat $total_target_img { +if $contain_alpha +sh[$>] 0,$endchan +index. [-2],$4,1 +f. "begin(const length=w#-2;); +repeat(length,v, +if(I==I(#-2,v,0),break();); +); +v+$total_target_img;" +rm. +else +index[$>] [-1],$4,1 +f[$>] "begin(const length=w#-1;); +repeat(length,v, +if(I==I(#-1,v,0),break();); +); +v+$total_target_img;" +fi +} +rm. +r[$total_target_img--1] $tile_width,$tile_height,100%,100%,{abs($6)+1} +r[0-{$total_target_img-1}] {$tile_width*100}%,{$tile_height*100}%,100%,100%,1 +if $contain_alpha +f[0-{$total_target_img-1}] c>h#$>?$non_zero_length:w#$>/h#$>*$non_zero_length)} +temp_tile_height={floor(h#$>>w#$>?$non_zero_length:h#$>/w#$>*$non_zero_length)} +tile_width={$temp_tile_width} +tile_height={$temp_tile_height} +mini_width={ceil(w#$>/$tile_width)} +mini_height={ceil(h#$>/$tile_height)} ++rep_aspect_crop_2d[$total_target_img--1] $tile_width,$tile_height +if $contain_alpha +local[$total_end_img--1] { +endid={$!} +sh 0,{s-2} +if $5==1 +rep_lbchstatfunc_to_pal[$endid--1] median +else +rep_lbchstatfunc_to_pal[$endid--1] average +fi +rm[$endid--2] +} +else +if $5==1 +rep_lbchstatfunc_to_pal[$total_end_img--1] median +else +rep_lbchstatfunc_to_pal[$total_end_img--1] average +fi +fi +r[$>] {$mini_width*$tile_width},{$mini_height*$tile_height},100%,100%,0,3,.5,.5 +r[$>] $mini_width,$mini_height,100%,100%,{abs($6)+1} +if $contain_alpha +sh[$>] 0,$endchan +index. [-2],$4,1 +f. "begin(const length=w#-2;); +repeat(length,v, +if(I==I(#-2,v,0),break();); +); +v+$total_end_img; +" +rm. +else +index[$>] [-1],$4,1 +f[$>] "begin(const length=w#-1;); +repeat(length,v,if(I==I(#-1,v,0),break(););); +v+$total_end_img;" +fi +rm. +r[$total_end_img--1] $tile_width,$tile_height,100%,100%,{abs($6)+1} +r[$>] {$tile_width*100}%,{$tile_height*100}%,100%,100%,1 +if $contain_alpha +f[$>] c] i(#i,x%$tile_width,y%$tile_height,z,c) +fi +k[0-{$total_end_img-1}] +} +k[0-{$total_target_img-1}] +fi +fi +#@cli rep_aspect_crop_2d: width_ratio>0,height_ratio>0,-1<=_shift_factor[%]<=1 +#@cli : Crop images based on specified aspect ratio. +#@cli : Code for finding new dimension was provided by Sumruv in discord/generative. The code that was provided applies only in the case of ratio not equal to 1. +#@cli : Default value: 'shift_factor=0' +#@cli : Author: Reptorian. +rep_aspect_crop_2d: +skip ${3=0},${4=} +_glob_auto_use_same_shift_factors={narg($4)?1:0} +check "$1>0&&$2>0" +_glob_aspect_crop_ratio_2d_w,_glob_aspect_crop_ratio_2d_h,_glob_aspect_crop_2d_crop_shift_factor_a,_glob_aspect_crop_2d_crop_shift_factor_b=${1-2},{(cut(($_glob_auto_use_same_shift_factors?[$3,$4]:vector2($3)),-1,1)+1)/2} +_glob_aspect_crop_2d_crop_shift_factor,_glob_arc2d_crop_ratio={[$_glob_aspect_crop_2d_crop_shift_factor_a,$_glob_aspect_crop_ratio_2d_h/$_glob_aspect_crop_ratio_2d_w]} +if $_glob_aspect_crop_ratio_2d_w==$_glob_aspect_crop_ratio_2d_h +command "cmd_arc_2d_crop : +if w==h return fi +if w>h +start_point={int($_glob_aspect_crop_2d_crop_shift_factor_a*(w-h))} +crop $start_point,0,{$start_point+h-1},{h-1} +else +start_point={int($_glob_aspect_crop_2d_crop_shift_factor_b*(h-w))} +crop 0,$start_point,{w-1},{$start_point+w-1} +fi +" +else +command "cmd_arc_2d_crop : +ratio={h/w} +if $ratio==$_glob_arc2d_crop_ratio return fi +new_dim,mode={b=[w,h];aspect_ratio=$_glob_arc2d_crop_ratio;ny=min(b[0]*aspect_ratio,b[1]);ny0,_main_surf_x_factor>0,_main_surf_y_factor>0,-100<=_x_center[%]<=100,-100<=_y_center[%]<=100,0<=_fxyangle<=360,_wave,0<=_lighting_angle<=360,_disturbance>=0,_distx,_disty,0<=_distangle<=360,_disturbance_mode={ 0= do_not_scale | 1=scale_by_axisfact },_color={ 0=gray | 1=color },_alpha_base={ 0=None | 1=hard_light | 2=hard_shade | 3=soft_light | 4=soft_light },_subpixelevel>=0,subpixelprocessingmethod={ 0=Average | 1=Linear | 2=Grid | 3=Bicubic | 4=Lanczos } +#@cli : Creates a Nebulous texture inspired by its Paint.NET plugin equivalent made by MadJik.\n +#@cli : '_main_surf_xy_factor' - Amount of waves by xy-axis. +#@cli : '_main_surf_x_factor' - Amount of waves by x-axis. +#@cli : '_main_surf_y_factor' - Amount of waves by y-axis. +#@cli : '_x_center' - Placement of Nebulous texture relative to the center by x-axis. +#@cli : '_y_center' - Placement of Nebulous texture relative to the center by y-axis. +#@cli : '_fxyangle' - Function angle of Nebulous texture. +#@cli : '_wave' - Amount of waves within waves. +#@cli : '_lighting_angle' - Shifts color output within waves +#@cli : '_disturbance' - Multiplier for distortion. +#@cli : '_distx' - Distorts function by x-axis. +#@cli : '_disty' - Distorts function by y-axis. +#@cli : '_distangle' - Distortion function Angle +#@cli : '_disturbance_mode' - Influences how the distortion result is calculated. +#@cli : '_color' - Color Output +#@cli : '_alpha_base' - determines the alpha based on waves angle. +#@cli : '_subpixelevel' - Subpixel processing level +#@cli : '_subpixelprocessingmethod' - Subpixel processing method. Only applicable when '_subpixelevel' is greater than 0.\n +#@cli : Default value: '_main_surf_x_factor=10','_main_surf_y_factor=10','_x_center[%]=0','_y_center[%]=0','_fxangle=0','_wave=1','_lighting_angle=0','_disturbance=0','_distx=100','_disty=100','_distangle=0','_disturbance_mode=0','_color=1','_alpha_base=0','_subpixellevel=1','_subpixelprocessingmethod=1'\n +#@cli : Author: Reptorian. +#@cli : $ 640,480,1,1 rep_nebulous 10,,,,,45,,,750,100,100,15,0,1,3 n 0,255 drgba +rep_nebulous: +skip ${2=10},${3=10},${4=0},${5=0},${6=0},${7=1},${8=0},${9=0},${10=100},${11=100},${12=0},${13=0},${14=1},${15=0},${16=0},${17=1} +if $1==0||$2==0||$3==0 v + error "Variable 1 to 3 cannot be zero!" v - fi +if $9<0 v + error "Disturbance factor cannot be less than 0!" v - fi +use_sub={abs($16)} +sublevel={$use_sub+1} +spec_count={!14?0+($15?1:0):3+($15?1:0)} +foreach { +iw,ih={[w,h]} +{$use_sub?w*$sublevel:w},{$use_sub?h*$sublevel:h},1,$spec_count,"begin( +const sd=w/h; +const shx=($4*w)/2; +const shy=($5*h)/2; +const sx=w>h?1:1/sd; +const sy=w>h?sd:1; +const sx2=2/sx; +const sy2=2/sy; +const ang=-pi*$6/180; +const cos_ang=cos(ang); +const sin_ang=sin(ang); +const distlvl=$9*$1; +const dist=pi/(distlvl/100); +const disth=$10; +const distv=$11; +const dang=-pi*$12/180; +const cos_dang=cos(dang); +const sin_dang=sin(dang); +const k=pi+((-pi+(pi*$7))*10)/10; +const ld=-($8-$6)*pi/180; +const IX_mul=$2*4; +const IY_mul=$3*4; +const cx_mul=$13?$2:1; +const cy_mul=$13?$3:1; +const iml=1.5*($1*10); +const angld=ang+ld; +const hpi=pi/2; +); +ix=(((x+shx)/w-.5)*iml)/sx; +iy=(((y+shy)/h-.5)*iml)/sy; +IX=ix*cos_ang-iy*sin_ang; +IY=ix*sin_ang+iy*cos_ang; +IX*=IX_mul; +IY*=IY_mul; +if(distlvl, +dix=(x/w-.5)*sx2; +diy=(y/h-.5)*sy2; +DIX=dix*cos_dang-diy*sin_dang; +DIY=dix*sin_dang+diy*cos_dang; +cx=DIX*cx_mul; +cy=DIY*cy_mul; +fsd=sin(((cx+cy)/2)/dist); +fcd=cos(((cy-cx)/2)/dist); +IX+=disth*(fsd-fcd); +IY-=distv*(fsd+fcd); +); +t=atan2(IY,IX); +r=norm(IX,IY)/100; +ti=sin(t)*cos(r)*k+r+angld; +$15?( +cg=[sin(pi+ti),sin(hpi+ti),sin(ti)]; +g=sum(cg); +alp=$15>2?($15==3?g:g*-1):($15==2?(g*-1<0?-1:1):(g<0?-1:1)); +$14?[cg,alp]:[g,alp]; +):( +$14?[sin(pi+ti),sin(hpi+ti),sin(ti)]:sin(ti)+sin(hpi+ti)+sin(pi+ti); +);" +rm.. +if $use_sub r $iw,$ih,1,{s},{$17+2} fi +} +#@cli rep_sptbwgp: eq. to 'rep_shift_pixel_to_boundary_with_group_pixels' +rep_sptbwgp: rep_shift_pixel_to_boundary_with_group_pixels $* +#@cli rep_shift_pixel_to_boundary_with_group_pixels: 1<=_position<=1,_axis={ x,0=Horizontal | y,1=Vertical },0%<_influence_factor[%]<=100%,0<=_threshold<=100%,channel_mode +#@cli : Shifts pixels to boundary by percentage using grouped pixels. position less than .5 means shift will be negative, and position greater than .5 means shift will be positive. +#@cli : If 'channel_mode' is position, cmyk mode is assumed. If negative, RGB is assumed. If negative, then always last channel would be used. +#@cli : Default values: '_position=-1','_axis=1','_influence_factor=1','_threshold=0','_channel_mode=0' +rep_shift_pixel_to_boundary_with_group_pixels: +skip ${1=-1},${2=0},${3=1},${4=0},${5=0} +position,axis,influence,threshold,tcr={[cut(($1+1)/2,0,1),isnum($2)?[$2]:'$2'-'x',cut([$3,$4],0,1),$5>0?4:$5==0?3]} +if !$influence return fi +if $axis==1 +position={1-$position} +src_img=x,pos +if $influence<1 dst_img=x,round(lerp(pos,insert_pos++,$influence)) +else dst_img=x,insert_pos++ +fi +permute_arg=xczy +elif $axis==0 +src_img=pos,y +if $influence<1 dst_img=round(lerp(pos,insert_pos++,$influence)),y +else dst_img=insert_pos++,y +fi +permute_arg=cyzx +else error invalid_arg_2 +fi +if $threshold +command cmd_process_alpha:"ge {"$threshold"*iM#-1} permute "$permute_arg +else +command cmd_process_alpha:"gt 0 permute "$permute_arg +fi +foreach { +if s==2||s>$tcr ++channels {s-1} +if iv#-1 +cmd_process_alpha[1] +{w#0},{h#0},{d#0},{s#0} +fill[1] :"begin( +const position=$position; +const length=s; +position==1?( +insert_pos_point()=length-number_of_points; +): +!position?( +insert_pos_point()=0; +):( +insert_pos_point()=round(lerp(0,length-number_of_points,position)); +); +); +points=I; +number_of_points=sum(points); +if(number_of_points, +insert_pos=insert_pos_point(); +repeat(length,pos, +if(points[pos], +I(#-1,"$dst_img")=I(#0,"$src_img"); +--number_of_points; +); +if(!number_of_points,break();); +); +); +points;" +keep[-1] +else +remove[-1] +fi +fi +} +uncommand cmd_process_alpha +#@cli rep_sinowaterdist: (eq. to rep_sinusoidal_water_distortion) +rep_sinowaterdist: rep_sinusoidal_water_distortion $* +#@cli rep_sinusoidal_distortion: _xbalance>0,_ybalance>0,_scale>=0,_interpolation,_boundary_condition +#@cli : Shift by sinusoidal distortion formula. +rep_sinusoidal_water_distortion: +skip ${4=2},${5=1} +f " +balanceY=y*sin(180)/$3*10; +balanceX=x*cos(180)/$3*10; +vx=x+cos(balanceY)*$1; +vy=y+sin(balanceX)*$2; +i(vx,vy,z,c,$4,($5?3:2));" +#@cli rep_binaltquad: eq. to 'rep_binary_alterating_quad_texture'. +rep_binaltquad: rep_binary_alterating_quad_texture $* +#@cli rep_binary_alterating_quad_texture: _style={ 0 = Horizontal , 1 = Diagonal , 2 = Simple },_variable_1>=0,_variable_2>=0,_variable_3>=0,0<=_operand<=2,0<=_angle<=360,_x_dir= { 0 = normal | 1 = inverted },_y_dir= { 0=normal | 1 = inverted },_modnum>0 +#@cli : Generates a texture full of alternating quadrilateral shapes using binary logic. Converted, and extended from Asmageddon Quaddro Bumperoo/Inverto Paint.NET source code. +#@cli : (eq. to 'rep_binaltquad').\n +#@cli : Author: Reptorian. +rep_binary_alterating_quad_texture: +skip ${4=128},${5=2},${6=0},${7=0},${8=0},${9=256},${10=255},${11=1} +channels 0 +style=$1 +var_1=$2 +var_2=$3 +var_3=$4 +operand={$1!=2?$5:2} +angle=$6 +x_dir=$7 +y_dir=$8 +modnum=$9 +normalize=$10 +allow_normal=$11 +f begin(ang=pi*($angle/180);sd=w/h;);ix=((x/w)-.5)/(h>w?1/sd:1);iy=((y/h)-.5)/(w>h?sd:1);IX=ix*cos(ang)-iy*sin(ang);IY=ix*sin(ang)+iy*cos(ang);ix=IX;iy=IY;ix+=.5/(h>w?1/sd:1);iy+=.5/(w>h?sd:1);ix=(w>h?ix*w:ix*h);iy=(w>h?iy*w:iy*h);ix=round(ix)+1;iy=round(iy)+1;$style==2?((!$x_dir?xor(ix,$var_1):xor(w-ix,$var_1))+(!$y_dir?xor(iy,$var_2):xor(h-iy,$var_2)))%$modnum:(int(((($style==1?($operand?($operand==1?(((($x_dir?w-ix:ix)|int($var_1))+(($y_dir?h-iy:iy)|int($var_2)))%$modnum):(xor(($x_dir?w-ix:ix),int($var_1))+xor(($y_dir?h-iy:iy),int($var_2)))%$modnum):((($x_dir?w-ix:ix)&int($var_1))+(($y_dir?h-iy:iy)&int($var_2)))):($operand?($operand==1?(((-($x_dir?w-ix:ix)|int($var_1))+(-($y_dir?h-iy:iy)|int($var_2)))%$modnum):(xor(-($x_dir?w-ix:ix),int($var_1))+xor(-($y_dir?h-iy:iy),int($var_2)))%$modnum):((-($x_dir?w-ix:ix)&int($var_1))+(-($y_dir?h-iy:iy)&int($var_2)))))/(int($operand!=2?$var_3:-$var_3)*2))-int(($style==1?($operand?($operand==1?(((($x_dir?w-ix:ix)|int($var_1))+(($y_dir?h-iy:iy)|int($var_2)))%$modnum):(xor(($x_dir?w-ix:ix),int($var_1))+xor(($y_dir?h-iy:iy),int($var_2)))%$modnum):((($x_dir?w-ix:ix)&int($var_1))+(($y_dir?h-iy:iy)&int($var_2)))):($operand?($operand==1?(((-($x_dir?w-ix:ix)|int($var_1))+(-($y_dir?h-iy:iy)|int($var_2)))%$modnum):(xor(-($x_dir?w-ix:ix),int($var_1))+xor(-($y_dir?h-iy:iy),int($var_2)))%$modnum):((-($x_dir?w-ix:ix)&int($var_1))+(-($y_dir?h-iy:iy)&int($var_2)))))/(int($operand!=2?$var_3:-$var_3)*2)))*($style==1?($operand?($operand==1?(((($x_dir?w-ix:ix)|int($var_1))+(($y_dir?h-iy:iy)|int($var_2)))%$modnum):(xor(($x_dir?w-ix:ix),int($var_1))+xor(($y_dir?h-iy:iy),int($var_2)))%$modnum):((($x_dir?w-ix:ix)&int($var_1))+(($y_dir?h-iy:iy)&int($var_2)))):($operand?($operand==1?(((-($x_dir?w-ix:ix)|int($var_1))+(-($y_dir?h-iy:iy)|int($var_2)))%$modnum):(xor(-($x_dir?w-ix:ix),int($var_1))+xor(-($y_dir?h-iy:iy),int($var_2)))%$modnum):((-($x_dir?w-ix:ix)&int($var_1))+(-($y_dir?h-iy:iy)&int($var_2))))))=0,_variable_2>=0,_variable_3>=0,_style={ 0 = Horizontal | 1 = Diagonal },0<=_operand<=2,0<=_angle<=360,_x_dir= { 0 = normal | 1 = inverted },_y_dir= { 0=normal | 1 = inverted }, _variable_1>=0,_variable_2>=0,_variable_3>=0,_style={ 0 = Horizontal | 1 = Diagonal },0<=_operand<=2,0<=_angle<=360,_x_dir= { 0 = normal | 1 = inverted },_y_dir= { 0=normal | 1 = inverted }, _variable_1>=0,_variable_2>=0,_variable_3>=0,_style={ 0 = Horizontal | 1 = Diagonal },0<=_operand<=2,0<=_angle<=360,_x_dir= { 0 = normal | 1 = inverted },_y_dir= { 0=normal | 1 = inverted }, _variable_1>=0,_variable_2>=0,_variable_3>=0,_style={ 0 = Horizontal | 1 = Diagonal },0<=_operand<=2,0<=_angle<=360,_x_dir= { 0 = normal | 1 = inverted },_y_dir= { 0=normal | 1 = inverted }, _variable_1>=0,_variable_2>=0,_variable_3>=0,_style={ 0 = Horizontal | 1 = Diagonal },0<=_operand<=2,0<=_angle<=360,_x_dir= { 0 = normal | 1 = inverted },_y_dir= { 0=normal | 1 = inverted } +#@cli : Generates a texture full of alternating quadrilateral shapes using binary logic. Converted, and extended from Asmageddon Quaddro Bumperoo/Inverto Paint.NET source code. +#@cli : (eq. to 'rep_binaltquadc'). +rep_binary_alterating_quad_c: +skip ${7=0},${8=0},${9=0},${10=0},${11=0},${12=0},${13=0},${14=0},${15=0},${16=0},${17=0},${18=0},${19=0},${20=0},${21=0},${22=0},${23=0},${24=0},${25=0},${26=0},${27=0},${28=0},${29=0},${30=0},${31=0},${32=0},${33=0},${34=0},${35=0},${36=0},${37=0},${38=0},${39=0},${40=0},${41=0},${42=0},${43=0},${44=0},${45=0},${46=0},${47=0},${48=0},${49=0} +foreach { +cs_mode=$1 +cmyk_mode={$cs_mode==3?4:3} +contain_alpha={$2?1:0} +bitmode=$3 +tch={$cmyk_mode+$contain_alpha} +channels 0 +r 100%,100%,100%,$tch +if $tch==3 ($4,$5,$6) +elif $tch==4 ($4,$5,$6,$7) +elif $tch==5 ($4,$5,$6,$7,$8) +fi +tc={w#1} s. x remove_duplicates tw={$!-1} if $tw<$tc v + error "Invalid Channel Order!" v - fi +a[^0] x rv +($*) +if ($cs_mode==3||(($cs_mode>8&&$cs_mode<11)||$cs_mode<3))||$bitmode (256,256,256,256,255) +else +if $cs_mode>3&&$cs_mode<7 (361,101,101,256) +elif $cs_mode==7 (101,201,201,256) +elif $cs_mode==8 (101,129,{ceil((pi)*200)},256) +elif $cs_mode==11 (301,301,301,256) +elif $cs_mode==12 (256,301,301,256) +elif $cs_mode==13 (301,301,301,256) +fi +fi +fact=9 +repeat $tch { +sh[1] {i(#0,$>,0)} +rep_binaltquad. {i(#2,8+$fact*$>,0)},{i(#2,9+$fact*$>,0)},{i(#2,10+$fact*$>,0)},{i(#2,11+$fact*$>,0)},{i(#2,12+$fact*$>,0)},{i(#2,13+$fact*$>,0)},{i(#2,14+$fact*$>,0)},{i(#2,15+$fact*$>,0)},{i(#3,$>,0)},{i(#3,$>,0)-1},{i(#2,16+$fact*$>,0)} +rm. +} +k[1] +if $cs_mode==3 +if $contain_alpha +s c +a[0-{$!-2}] c +cmyk2rgb.. +*.. {255/254} +a c +else +cmyk2rgb +* {255/254} +fi +else +if ($cs_mode>8&&$cs_mode<11)||$cs_mode<3 +if $cs_mode==1 ac "ryb2rgb",rgb +elif $cs_mode==2 ac "cmy2rgb",rgb +elif $cs_mode==9 ac "ycbcr2rgb",rgb +elif $cs_mode==10 ac "ycbcrglic2rgb",rgb +fi +cut 0,255 +else +if $bitmode +if $cs_mode==1 ac "ryb2rgb",rgb +elif $cs_mode==4 ac "hsi82rgb",rgb +elif $cs_mode==5 ac "hsv82rgb",rgb +elif $cs_mode==6 ac "hsl82rgb",rgb +elif $cs_mode==7 ac "lab82rgb",rgb +elif $cs_mode==8 ac "lch82rgb",rgb +elif $cs_mode==11 ac "yiq82rgb",rgb +elif $cs_mode==12 ac "yuv82rgb",rgb +elif $cs_mode==13 ac "xyz82rgb",rgb +fi +cut 0,255 +else +if $cs_mode>3&&$cs_mode<7 +f s<4?[i0,i1/100,i2/100,i3]:[i0,i1/100,i2/100] +if $cs_mode==4 hsi2rgb +elif $cs_mode==5 hsv2rgb +elif $cs_mode==6 hsl2rgb +fi +cut 0,255 +elif $cs_mode==7 +f s<4?[i0,i1-100,i2-100,i3]:[i0,i1-100,i2-100] +lab2rgb +elif $cs_mode==8 +f s<4?[i0,i1,((i2-314.5)*(pi/3.145)/100),i3]:[i0,i1,((i2-314.5)*(pi/3.145)/100)] +sh 0,2 +lch2rgb. +rm. +elif $cs_mode==11 +f s<4?[i0,i1-150,i2-150,i3]:[i0,i1-150,i2-150] +yiq2rgb +elif $cs_mode==12 +f s<4?[i0/255,(i1-150)/150,(i2-150)/150,i3]:[i0/255,(i1-150)/150,(i2-150)/150] +yuv2rgb +elif $cs_mode==13 +f s<4?[i0/300,i1/300,i2/300,i3]:[i0/300,i1/300,i2/300] +xyz2rgb +fi +fi +fi +fi +} +#@cli rep_strbul: eq. to 'rep_strange_bulger'. +rep_strbul: rep_strange_bulger $* +#@cli rep_strange_bulger : 0<=_angle<=360,_axis={ 0 = X-Axis | 1 = Y-Axis },_interpolation,_boundary_condition +#@cli : Performs a bulge effect found in Strange Bulger Series made by Asmageddon for Paint.NET. +#@cli : (eq. to 'rep_strbul').\n +#@cli : _angle refers to the angle of distortion. +#@cli : _axis_of_bulge refers to the axis that is the distortion is based from.\n +#@cli : Author: Reptorian. +rep_strange_bulger: +f "begin( +const BulgeAng=$1*(pi/180); +const cX=w/2; +const cY=h/2; +); +vx=$2?x:cX-x; +vy=$2?cY-y:y; +vx=(vx^2)/cX; +vy=(vy^2)/cY; +vx=(x+(x-vx)*cos(BulgeAng)+(y-vy)*sin(BulgeAng)); +vy=(y+(x-vx)*sin(BulgeAng)+(y-vy)*cos(BulgeAng)); +i(vx,vy,z,c,$3,($4?3:2));" +#@cli rep_strbulkal: eq. to 'rep_strange_bulger_kaleidoscope'. +rep_strbulkal:rep_strange_bulger_kaleidoscope $* +#@cli rep_strange_bulger_kaleidoscope: 0<=_bulge_ang<=360,_axis_of_bulge= { 0=horizontal | 1=vertical },_scale>0,-1<_offset_main_x<=1,-1<_offset_main_y<=1,-1<_offset_kaleido_x<=1,-1<_offset_kaleido_y,-360<=surface_ang<=360,_mirror_placement= { 0=inside-out | 1=outside-in },_boundary_condition= { 0=Periodic | 1=Mirror },1<=_interpolation<=5,_dimension_reference>0 +#@cli : Distorts image using bulge effect found in Strange Bulger Series made by Asmageddon for Paint.NET. This is the Kaleidoscope version of Strange Bulger. +#@cli : (eq. to 'rep_strbulkal').\n +#@cli : _bulge_ang refers to the angle of distortion. +#@cli : _axis_of_bulge refers to the axis that is the distortion is based from. +#@cli : _scale refers to the scaling of the distortion. The larger the _scale value is, the more areas is revealed. +#@cli : _offset_main_x refers to the horizontal displacement of the initial image +#@cli : _offset_main_y refers to the vertical displacement of the initial image +#@cli : _offset_kaleido_x refers to the horizontal displacement of the center of the distortion +#@cli : _offset_kaleido_y refers to the vertical displacement of the center of the distortion +#@cli : _surface_ang refers to the angle of distortion +#@cli : _mirror_placement refers to whether the displacement is mirror from the center or not. +#@cli : _dimension_reference refers to the base dimension used for calculation of bulging, it uses the biggest dimension as a reference for scaling. The PDN version of Strange Bulger Kaleidoscope does not have a dimension reference which means that bulges are dependent on the image size. This is to ensure that preview stays consistent with the end result. What you see is what you get as _dimension_reference variable is a internal dimension processing variable.\n +#@cli : Author: Reptorian. +rep_strange_bulger_kaleidoscope: +skip ${4=0},${5=0},${6=0},${7=0},${8=0},${9=0},${10=0},${11=3},${12=1024} +if $3<10^-8 v + error "Scale cannot be 0 or less than 0!" v - fi +if $12==0 v + error "dimension_reference cannot be 0!" v - fi +shift {50*$4}%,{50*$5}%,0,0,3,1 +f "begin( +const BulgeAng=pi*((h>w?360-$1:$1)/180); +const ang=pi*($8/180); +const sd=w/h; +const iox=$6/(h>w?1/sd:1); +const ioy=($7*-1)/(w>h?sd:1); +const cos_ang=cos(ang); +const sin_ang=sin(ang); +const ox=iox*cos_ang-ioy*sin_ang; +const oy=iox*sin_ang+ioy*cos_ang; +const ed=abs(int($12)); +const id=w>h?ed/w:ed/h; +const iw=w*id; +const ih=h*id; +const cx=iw/2; +const cy=ih/2; +); +ix=((x/w)-.5)/(h>w?1/sd:1); +iy=((y/h)-.5)/(w>h?sd:1); +IX=ix*cos_ang-iy*sin_ang; +IY=ix*sin_ang+iy*cos_ang; +ix=IX; +iy=IY; +ix+=.5/(h>w?1/sd:1); +iy+=.5/(w>h?sd:1); +ix*=ed; +iy*=ed; +xx=sqrt(abs(ix-cx-ox*(cx>cy?cx:cy))); +yy=sqrt(abs(iy-cy-oy*(cx>cy?cx:cy))); +xx*=$3*ed; +yy*=$3*ed; +xx/=100; +yy/=100; +vx=(w>h?$2:!$2)?xx:cx-xx; +vy=(w>h?$2:!$2)?cy-yy:yy; +vx=vx^2/cx; +vy=vy^2/cy; +vx=(xx+(xx-vx)*cos(BulgeAng)+(yy-vy)*sin(BulgeAng)); +vy=(yy+(xx-vx)*sin(BulgeAng)+(yy-vy)*cos(BulgeAng)); +vx*=w/ed; +vy*=h/ed; +i(vx,vy,z,c,$11,($10?3:2));" +if $9 shift 50%,50%,0,0,3,1 fi +#@cli rep_logpindis: eq. to 'rep_logarithmic_pinching_distortion'. +rep_logpindis: rep_logarithmic_pinching_distortion $* +#@cli rep_logarithmic_pinching_distortion: _distortion_main>=0,-1<=_preshift_x<=1,-1<=_preshift_y<=1,-1<=_effposition_x<=1,-1<=_effposition_y<=1,_prescale_x,_prescale_y,_afterscale_x,_afterscale_y,0<=_angle<=360,_mirror_placement= { 0=outside-in | 1=inside-out },_lx_axis= { 0=different axis | 1=same axis},_ly_axis= { 0=different axis | 1=same axis},ix_dir={ 0=negative | 1=positive },iy_dir={ 0=negative | 1=positive },_boundary= { 0=Periodic | 1=Mirror },1<=_interpolation<=5,_dimension_ref>0 +#@cli : (eq. to 'rep_logpindis').\n +#@cli : Author: Reptorian. +rep_logarithmic_pinching_distortion: +skip ${2=0},${3=0},${4=0},${5=0},${6=1},${7=1},${8=1},${9=1},${10=0},${11=0},${12=1},${13=0},${14=1},${15=0},${16=0},${17=5},${18=1024} +if $6==0||$7==0||$8==0||$9==0 v + error "Scale cannot be 0!" v - fi +if $17<1 v + error "interpolation cannot be less than 1" v - fi +shift {50*$2}%,{50*$3}%,0,0,3,1 +f "begin( +const sd=w/h; +const ang=pi*($10/180); +const cos_ang=cos(ang); +const sin_ang=sin(ang); +const iox=($4*-1)/(h>w?1/sd:1); +const ioy=$5/(w>h?sd:1); +const ox=iox*cos_ang-ioy*sin_ang; +const oy=iox*sin_ang+ioy*cos_ang; +const ed=int(abs($18))/2; +const dx=$14?1:-1; +const dy=$15?1:-1; +const iend=$16?3:2; +); +ix=((x/w)-.5)/(h>w?1/sd:1); +iy=((y/h)-.5)/(w>h?sd:1); +IX=ix*cos_ang-iy*sin_ang; +IY=ix*sin_ang+iy*cos_ang; +ix=IX; +iy=IY; +ix=abs(ix+ox/2)*$6; +iy=abs(iy+oy/2)*$7; +ix*=ed; +iy*=ed; +lx=ix==0||iy==0?log(1^-8)*$1:log($12?iy^2:ix*iy)*$1; +ly=ix==0||iy==0?log(1^-8)*$1:log($13?ix^2:ix*iy)*$1; +ix-=lx*dx; +iy-=ly*dy; +ix*=w/ed; +iy*=h/ed; +ix*=$8; +iy*=$9; +i(ix,iy,z,c,$17,iend);" +if $11 shift 50%,50%,0,0,3,1 fi +#@cli rep_sqrlogpindis: eq. to rep_square_root_logarithmic_pinching_distortion +rep_sqrlogpindis: rep_square_root_logarithmic_pinching_distortion $* +#@cli rep_square_root_logarithmic_pinching_distortion: _distortion_main>=0,-1<=_preshift_x<=1,-1<=_preshift_y<=1,-1<=_effposition_x<=1,-1<=_effposition_y<=1,_prescale_x,_prescale_y,_afterscale_x,_afterscale_y,0<=_angle<=360,_mirror_placement= { 0=outside-in | 1=inside-out },_lx_axis= { 0=different axis | 1=same axis},_ly_axis= { 0=different axis | 1=same axis},ix_dir={ 0=negative | 1=positive },iy_dir={ 0=negative | 1=positive },_boundary= { 0=Periodic | 1=Mirror },1<=_interpolation<=5,_dimension_ref>0 +#@cli : (eq. to 'rep_sqrlogpindis').\n +#@cli : Author: Reptorian. +rep_square_root_logarithmic_pinching_distortion: +skip ${2=0},${3=0},${4=0},${5=0},${6=1},${7=1},${8=1},${9=1},${10=0},${11=0},${12=1},${13=0},${14=1},${15=0},${16=0},${17=5},${18=1024} +if $6==0||$7==0||$8==0||$9==0 v + error "Scale cannot be 0!" v - fi +if $17<1 v + error "interpolation cannot be less than 1" v - fi +shift {50*$2}%,{50*$3}%,0,0,3,1 +f "begin( +const ed=int(abs($18)); +const sd=w/h; +const ang=pi*($10/180); +ox=$4; +oy=$5*-1; +ox/=h>w?1/sd:1; +oy/=w>h?sd:1; +OX=ox*cos(ang)-oy*sin(ang); +OY=ox*sin(ang)+oy*cos(ang); +ox=OX; +oy=OY; +); +ix=((x/w)-.5)/(h>w?1/sd:1); +iy=((y/h)-.5)/(w>h?sd:1); +IX=ix*cos(ang)-iy*sin(ang); +IY=ix*sin(ang)+iy*cos(ang); +ix=IX; +iy=IY; +ix+=.5/(h>w?1/sd:1); +iy+=.5/(w>h?sd:1); +iw=w/(h>w||w==h?1/sd:1); +ih=h/(w>h||w==h?1:1/sd); +id=ed/w; +iw*=id; +ih*=id; +cx=iw/2; +cy=ih/2; +ix*=1; +iy*=1; +xx=sqrt(abs(ix*ed-cx-cx*ox))*$6; +yy=sqrt(abs(iy*ed-cy-cx*oy))*$7; +vx=xx*100; +vy=yy*100; +lx=xx==0||yy==0?log(1^-8)*$1:log($12?yy^2:xx*yy)*$1; +ly=xx==0||yy==0?log(1^-8)*$1:log($13?xx^2:xx*yy)*$1; +vx+=($14?-1:1)*lx; +vy+=($15?-1:1)*ly; +vx*=w/ed; +vy*=h/ed; +vx*=$8; +vy*=$9; +i(vx,vy,z,c,$17,($16?3:2));" +if $11 shift 50%,50%,0,0,3,1 fi +#@cli rep_stitch: { offset[%]>=0% | offset>=0 },{ thickness[%]>=0% | thickness>=0 },_modulo,_offset_iter_rand={ 0=single | 1= multiple },_strip_iter_rand={ 0=none | 1=single | 2=multiple },_seed_offset,_seed_strip,_boundary={ 0=none | 1=neumann | 2=periodic | 3=mirror },_sublevel>=0,_interpolation={ 0=nearest | 1=average | 2=linear | 3=bicubic | 4=lanczos },angle_0...angle_inf +#@cli : Stitches images. +#@cli : $ sp rep_stitch 15%,1%,,,,,,,,,45,135 +rep_stitch: +skip ${3=0},${4=0},${5=0},${6=},${7=},${8=3},${9=1},${10=2},${11=} +modulo_mode,random_offset_mode,random_strip_mode,seed_off,seed_strip,boundary,sublevel,interpolation,diff_dim_mode,timg,max_img_ind,has_strip_seed,has_off_seed={int($3)},{$4%2},{$5%3},${6-7},{$8%4},{abs($9)+1},{v=abs($10)+1;v==4?++v:v;},0,{$!},{$!-1},0,0 +if narg($seed_strip) has_strip_seed=1 fi +if narg($seed_off) has_off_seed=1 fi +if ispercentage($1) use_perc_off=1 +else +use_perc_off,offset=0,{abs($1)*$sublevel} +if !$offset return fi +fi +if ispercentage($2) use_perc_thk=1 +else +use_perc_thk,thickness=0,{max(1,int(abs($2)*$sublevel))} +fi +modulo,modulo_mode={abs_mod=abs($modulo_mode);[abs_mod,abs_mod==2||$modulo_mode>=-1]} +if $modulo if $modulo<2 error "$3">1==F fi fi +if narg($11) ang_args=${11--1} +else ang_args=45,135 +fi ++rep_find_nonduplicate_angles $ang_args => rad_ang +num_angs={w#-1} +if $num_angs==1 +random_offset_mode=0 +if $random_strip_mode==2 random_strip_mode=0 fi +fi +if $!>2 +eval " +diff=0; +const ti=$timg; +initial_dimensions=[w#0,h#0,d#0]; +for(p=1,p fi +ow,oh={[w#$>,h#$>]} +if $diff_dim_mode r[$>] {round($ow*$sublevel)},{round($oh*$sublevel)},100%,100%,1 +else r[0--2] {round(w#0*$sublevel)},{round(h#0*$sublevel)},100%,100%,1 +fi +nw,nh={[w#$>,h#$>]} +length={norm($nw,$nh)/2} +if $use_perc_off offset={$length*$1} fi +if $use_perc_thk thickness={max($sublevel,round($length*$2))} fi +if $offset ++f. "begin( +const sublevel=$sublevel; +const thickness=$thickness; +const half_thickness=thickness>>1; +const modulo=$modulo; +const hpi=pi/2; +const nw=$nw; +const nh=$nh; +modulo?( +const img_width=nw; +const img_height=nh; +const hypotenuse=sqrt(img_width^2+img_height^2); +const pt_0=atan2(img_height,img_width); +const pt_1=atan2(img_width,img_height); +calc_nbars(v)=min( modulo, int((v+half_thickness)/thickness) ); +):( +const cx=(nw-1)/2; +const cy=(nh-1)/2; +const hypotenuse=sqrt(cx^2+cy^2); +const pt_0=atan2(cy,cx); +const pt_1=atan2(cx,cy); +calc_nbars(v)=int((v+half_thickness)/thickness); +); +); +angle=i; +quadrant_01=xor(inrange(angle,-hpi,hpi,1,0),angle>=0); +angle%=hpi; +distance=quadrant_01?cos(pt_0-angle)*hypotenuse:cos(angle-pt_1)*hypotenuse; +calc_nbars(distance);" +=> number_of_bars +total_number_of_bars,max_nbar={is#-1},{iM#-1} +if $random_offset_mode +if $has_off_seed +$total_number_of_bars,1,1,{$modulo?1:2},>"begin( +seed=$seed_off; +srand(seed); +num_of_bars_arr=crop(#$number_of_bars); +const arr_length=w#-1; +pos_bars=vectorarr_length(0); +t=0; +repeat(w#-1,p, +t+=num_of_bars_arr[p]; +pos_bars[p]=t; +); +k=0; +activate_place_length=1; +const modulo=$modulo; +modulo?( +output()=( +if(x==pos_bars[k], +++k; +srand(++seed); +); +u(-1,1)*$offset; +); +):( +output()=( +if(x==pos_bars[k], +++k; +activate_place_length=1; +srand(++seed); +); +a=u(-1,1)*$offset; +b=u(-1,1)*$offset; +ov=int(u(0,2))?[b,a]:[a,b]; +if(activate_place_length, +activate_place_length=0; +[ov[0],num_of_bars_arr[k]]; +,ov;); +); +); +); +output();" +else +{is#-1},1,1,{$modulo?1:2},"begin( +const offset=$offset; +const modulo=$modulo; +if(modulo +,output()=u(-1,1)*offset; +,output()=[u(-1,1),u(-1,1)]*offset; +); +); +output();" +eval.. i(#-1,i,0,0,1)=i; +fi +else +{$modulo?max(2,iM#-1+1):iM#-1},1,1,{$modulo?1:2},>"begin( +const offset=$offset; +if($has_off_seed,srand($seed_off);); +); +a=u(-1,1)*offset; +b=u(-1,1)*offset; +ov=int(u(0,2))?[b,a]:[a,b]; +x? ov : [ ov[0],w ];" +fi +f[$img_targets] " +begin( +const has_strip_seed=$has_strip_seed; +if(has_strip_seed,srand($seed_strip);); +const modulo=$modulo; +const modulo_mode=$modulo_mode; +const shift_mod_pos=modulo>>1; +const boundary=$boundary; +const max_x=w-1; +const max_y=h-1; +const cx=max_x/2; +const cy=max_y/2; +const random_offset_mode=$random_offset_mode; +const random_strip_mode=$random_strip_mode; +const length=$total_number_of_bars; +const sub_length=length-1; +const num_angs=$num_angs; +const thickness=$thickness; +const half_thickness=thickness>>1; +vector_of_number_of_bars=crop(#$number_of_bars); +const strip_length=w#-1; +const max_nbar_arr=$max_nbar; +angs=crop(#$rad_ang); +cos_ang=cos(angs); +sin_ang=sin(angs); +rot_x(a,b,c)=a*cos_ang[c]-b*sin_ang[c]; +rot_y(a,b,c)=a*sin_ang[c]-b*cos_ang[c]; +modulo?( +offset_strip=crop(#-1); +random_offset_mode?( +offset_pos=[0,(vector_of_number_of_bars)[0,num_angs-1]]; +t=offset_pos[1]; +for(p=2,p=0?pos_off[(bar_pos+offset_pos[ind])%strip_length]:neg_off[(abs(bar_pos)+offset_pos[ind])%strip_length]; +off_x=cos_ang[ind]*offset; +off_y=sin_ang[ind]*offset; +[off_x,off_y]; +); +):( +find_offset(bar_pos)=( +offset=bar_pos>=0?pos_off[bar_pos%strip_length]:neg_off[abs(bar_pos)%strip_length]; +off_x=cos_ang[ind]*offset; +off_y=sin_ang[ind]*offset; +[off_x,off_y]; +); +); +); +random_strip_mode==2?( +modulo?( +const multi_strip_length=$total_number_of_bars; +has_strip_seed?( +rand_v=expr('>begin(seed=$seed_strip;srand(seed);tbars=crop(#$number_of_bars);vector_of_number_of_bars=vector(#size(tbars),0);t=0;repeat(size(vector_of_number_of_bars),pos,vector_of_number_of_bars[pos]=t+=tbars[pos]);const num_angs=$num_angs;const ina=num_angs+1;k=0;);if(x==vector_of_number_of_bars[k]&&k2, +t=nbars_k_pos[0]; +for(k=1,kbegin(seed=$seed_strip+1;srand(seed);tbars=crop(#$number_of_bars);vector_of_number_of_bars=vector(#size(tbars),0);t=0;repeat(size(vector_of_number_of_bars),pos,vector_of_number_of_bars[pos]=t+=tbars[pos]);const num_angs=$num_angs;const ina=$num_angs+1;k=0;);if(x==vector_of_number_of_bars[k]&&kbegin(seed=$seed_strip-3;srand(seed);const ina=$num_angs+1;int(u(0,ina)););int(u(0,ina));',num_angs); +rand_v=vectormulti_strip_length(); +place=extract_pos=0; +repeat(num_angs,k, +number_of_bars=vector_of_number_of_bars[k]; +copy(rand_v[place],neg_v[extract_pos],number_of_bars); +place+=number_of_bars; +rand_v[place]=middle[k]; +++place; +copy(rand_v[place],pos_v[extract_pos],number_of_bars); +place+=number_of_bars; +extract_pos+=number_of_bars; +); +):( +rand_v=expr('begin(const ina=$num_angs+1;);int(u(0,ina));',multi_strip_length); +); +non_zero_pos=(vector_of_number_of_bars)[0,num_angs-1]<<1; +++non_zero_pos; +if(num_angs>2, +t=non_zero_pos[0]; +for(k=1,k1?( +nbars_k_pos=(vector_of_number_of_bars)[0,num_angs-1]; +t=nbars_k_pos[0]; +for(k=1,kbegin(if($has_strip_seed,srand($seed_strip+1););const ina=$num_angs+1;);int(u(0,ina,1,0));',max_nbar_arr); +middle=int(u(0,num_angs+1,1,0)); +rand_v=[neg_v,middle,pos_v]; +off_out(v)=rand_v[v+vector_of_number_of_bars[k]]; +); +):( +off_out(v)=v%2; +); +modulo?( +modulo_mode?( +calc_t()=(floor((rot_y(xx,yy,k)+half_thickness)/thickness)+shift_mod_pos)%modulo; +):( +const new_modulo=modulo+(modulo-2); +const max_modulo_index=modulo-1; +calc_t()=( +nv=(floor((rot_y(xx,yy,k)+half_thickness)/thickness)+shift_mod_pos)%new_modulo; +nv>max_modulo_index?new_modulo-nv:nv; +); +); +):( +calc_t()=floor((rot_y(xx,yy,k)+half_thickness)/thickness); +); +); +xx=x-cx; +yy=y-cy; +current_bar=vector(#num_angs,0); +ind=0; +repeat(num_angs,k, +t=calc_t(); +current_bar[k]=t; +ind+=off_out(t); +); +ind%=num_angs; +J(find_offset(current_bar[ind]),0,boundary); +" +r[$img_targets] $ow,$oh,100%,100%,$interpolation +rm[-2,-1] +fi +} +rm. +#@cli +rep_find_nonduplicate_angles: angle_0,angle_1,....,angle_n +#@cli : Return all non-duplicate angles in radian form as a image. ++rep_find_nonduplicate_angles: +($*) (0) +eval[-2] " +res_to_0_180(angle)=(angle%180)/180; +if(x, +not_found=1; +test_value=res_to_0_180(i); +for(p=0,p0,_radial_cut_repeat>0,_angle,-1<=_shift_x<=1,-1<=_shift_y<=1,_flip_x= { 0=Original | 1=Flipped },_flip_y= { 0=Original | 1=Flipped },_edge_x= { 0=Repeat | 1=Alternating },0<=_edge_y<=2,_radial_fit_dimension= { 0=Minimum | 1=Maximum },_conical_start_ang= { 0=90 | 1=0 },_sublevel>0,0<_interpolation<=5 +#@cli : _angle_cut_repeat refers to the amount of time a image will repeat along the center. +#@cli : _radial_cut_repeat refers to the amount of time a image will repeat from the center. +#@cli : _angle refers to the angle of the filter function. +#@cli : _shift_x refers to the horizontal distance distance from the center in relative to the center of the target image(s) +#@cli : _shift_y refers to the verticla distance of the center in relative to the center of the target image(s). +#@cli : _flip_x mirrors the image horizontally prior to the polar effect. +#@cli : _flip_y mirrors the image vertically prior to the polar effect. +#@cli : _radial_fit_dimension fits the end of radius cut to the min or max dimension. +#@cli : _conical_start_ang starts the polar image from the standard interpretation or straight up. +#@cli : _sublevel refers to the antialiasing degree of the polar effect. +#@cli : Default value: '_angle_cut_repeat=2','_radial_cut_repeat=1','_angle=0','_shift_x=0','_shift_y=0','_flip_x=0','_flip_y=0','_edge_x=1','_edge_y=1','_radial_fit_dimension=0','_conical_start_ang=0','_sublevel=.5','_interpolation=2'\n +#@cli : Author: Reptorian. +rep_polar_kaleidoscope: +skip ${1=2},${2=1},${3=0},${4=0},${5=0},${6=0},${7=0},${8=1},${9=1},${10=0},${11=0},${12=.5},${13=2} +if $1==0 v + error "Invalid Number - Variable 1" v - fi +if $2==0 v + error "Invalid Number - Variable 2" v - fi +if $4<-1||$4>1 v + error "Invalid Number - Variable 3" v - fi +if $5<-1||$5>1 v + error "Invalid Number - Variable 4" v - fi +if $12<0 v + error "Invalid Number - Variable" 12 v - fi +if $13<=0 v + error "Invalid Number - Variable" 13 v - fi +r2dx {($12+1)*100}%,$13 +f "begin( +const dr=max(w,h)/min(w,h); +const ang=pi*(($3*-1)/180); +); +xx=((x-$4*w/2)/w-.5)*2; +yy=((y+$5*h/2)/h-.5)*2; +xx*=w>h?dr:1; +yy*=w>h?1:dr; +XX=xx*cos(ang)-yy*sin(ang); +YY=xx*sin(ang)+yy*cos(ang); +xx=XX; +yy=YY; +xs=($11?atan2(yy,xx)+pi:atan2(xx,yy)+pi)/(2*pi); +xs*=$1; +ys=norm(xx,yy)/($10?dr/1:1); +ys*=$2; +xs=$8?(int(xs)%2!=0?1-(xs-floor(xs)):xs-floor(xs)):xs-floor(xs); +ys=$9?($9-1?(int(ys)%2!=0?1-(ys-floor(ys)):ys-floor(ys)):ys-floor(ys)):ys; +xs=$6?1-xs:xs; +ys=$7?1-ys:ys; +polkal_a=i(abs(xs*w),ys*h,z,c,0,0); +polkal_b=i(xs*w,ys*h,z,c,1,1); +$9?polkal_b:polkal_a;" +r2dx {(1/($12+1))*100}%,$13 +#@cli rep_objvf: eq. to 'rep_objvolumefilt' +rep_objvf: rep_objvolumefilt $* +#@cli rep_objvolumefilt: 0<=_v1<=100%,0<=_v2<=100%,_mode={ -2=preserve_exterior_filter_max_out || -1=preserve_interior_filter_max_out || 0=preserve_interior || 1=preserve_exterior },_colour1... +#@cli : _v1 and _v2 refers to boundary in percent. By default, this command use alpha as reference unless all channel values are specified next to mode. +#@cli : (eq. to 'rep_objvf').\n +#@cli : Default value: '_mode=1'\n +#@cli : Author: Reptorian. +rep_objvolumefilt: +skip ${3=0},${4=} +if $1<0||$2<0||$1>1||$2>1 error ""(""$"1>=0&&"$"1"<=1)"&&"(""$"2>=0&&"$"2"<=1)==F"" fi +if (max($1,$2)-min($1,$2))==1 error "max"(""$"1,"$"2")"-min"(""$"1,"$"2")"<1==F" fi +if ($1!=$2) +foreach { +ssize={s} +if narg(${4--1})&&s>1 +if (narg(${4--1})<($ssize-1)) error "{narg(${4--1})}>={$ssize-1}==F" fi +if narg(${4--1})<$ssize +channels {s-1} colormap. 0,1,2 alp={i(#-1,0,0)} rm. fi +100%,100%,100%,1,"begin( +const ss=$ssize-1; +ref_color=vectorss(${4--1}); +); +vectorss(I#0)!=ref_color?1:0" +if narg(${4--1})<$ssize End={vector$ssize(${4--1},$alp)} +else End={vector$ssize(${4--1})} +fi +else ++channels {s-1} +End={vector$ssize(0)} +fi +if !iv#-1 error "Variance>0==F" fi +f. i?1 area_fg. 0,1 +if $3<0 f. i==iM?0:i fi ++f. i==0?iM:i +newmin={im#-1} +rm. +MM={iM#-1-$newmin} +area_1={$1*$MM} +area_2={$2*$MM} +area_1+=$newmin +area_2+=$newmin +minarea={min($area_1,$area_2)} +maxarea={max($area_1,$area_2)} +if $3>=0 +if $3 f.. !(i0#-1>=$minarea&&i0#-1<=$maxarea)?I:[$End] +else f.. i0#-1>=$minarea&&i0#-1<=$maxarea?I:[$End] +fi +else +if $3<-1 f.. if(i0#-1,(!(i0#-1>=$minarea&&i0#-1<=$maxarea)?I:[$End]),I) +else f.. if(i0#-1,(i0#-1>=$minarea&&i0#-1<=$maxarea?I:[$End]),I) +fi +fi +rm. +vv=0 +repeat s { +sh $> +vv+={iv#-1} +rm. +} +if !$vv error "Final Variance>0==F" fi +} +fi +#@cli rep_form_pixel: form_id,form_quad_lx!=0,form_quad_ly!=0,_form_ratio[%]!=0,_angle, 0<=_reflect_dir<=2,_sublevel,_tile_boundary={ 0=periodic | 1=mirror_x | 2=mirror_y | 3=mirror_xy },_image_boundary={ 0=neumann | 1=periodic | 2=mirror},_abs_zconvf>=0,_zconv_boundary={0=periodic | 1= mirror},_interpolation={ 0=nearest | 1=average | 2=grid | 3=linear | 4=bicubic | 5=lanczos},cs_mode={ 0=rgb | 1=ryb | 2=cmyk | 3=hcy | 4=hsi | 5=hsl | 6=hsv | 7=lab | 8=lch },_fit_tile={ 0=squash_to_fit | 1=resize_to_fit },_kdol={ 0=new_dim | 1=new_layer_new_dim | 2=new_layer | 3=new_layer_old_dim },shape_option_1..._shape_option_n +#@cli : _form_id refers to the id or name of shape. circle is a valid form id, and any integer number that is 0-24 inclusive is a form id. You can also use image as an argument, so you can use any arbitrary shapes. +#@cli : _form_quad_lx refers to the size of the tile in pixel form. It cannot be 0 unless you want to use _form_quad_ly variable to define the tile width. +#@cli : _form_quad_ly refers to the size of the tile in pixel form. It cannot be 0 unless you want to use _form_quad_lx variable to define it tile height. +#@cli : _form_ratio refers to the how much the shape fills each tile. +#@cli : _angle refers to the rotation of shapes per tile +#@cli : _reflect_dir refers to the mirroring of each shape. 1,2 means the mirroring is applied. +#@cli : _sublevel refers to the initial size of the shape to be scaled down to fit tiles. +#@cli : _tile_boundary refers to how the tiles are repeated within the canvas +#@cli : _image_boundary refers to how the pixels are treated when out-of-range of original canvas before generating tiles +#@cli : _abs_zconvf defines the contrast level of each tiles using z-convolution within a small color tile reference 3D image. +#@cli : _zconv_boundary defines how out-of-range value within z-convolution kernet are treated. +#@cli : _interpolation refers to the interpolation of the scaling of shapes to fit each tile. See 'gmic h resize' _interpolation. +#@cli : _cs_mode refers to the color processing space that form_pixel filter utilize. +#@cli : _fit_tile is a parameter used for whether to fit tile into specified tile width and height or to use stretch resize =method. +#@cli : _kdol can be used to resize the generated result to original dimension and/or to create new layer on top of existing image. +#@cli : _shape_option are used to define the behavior of shapes when available. +#@cli : +#@cli : -- form_id -- +#@cli : string | shape_name_id | shape_options +#@cli : +#@cli : [image] ---- image_as_shape +#@cli : 0 - australia +#@cli : 1 - barbedwire +#@cli : 2 - circle +#@cli : 3 - crosshair +#@cli : 4 - cupid +#@cli : 5 - diamond +#@cli : 6 - dragon ------ dragon_recursion>=0,-360<=dragon_curve_rotation_angle>=360 +#@cli : 7 - dragonfly +#@cli : 8 - fern - size>=0,density[%]>=0,ang,0<=opacity<=1,type={ 0=Black Spleenwort | 1=Marsh } +#@cli : 9 - flip +#@cli : 10 - gear ------- teeth>0,00 +#@cli : 21 - rooster +#@cli : 22 - shopping_cart +#@cli : 23 - snowflake ------- 1<=recursion<=6 +#@cli : 24 - star ------- branches>3,thickness[%] +#@cli : +#@cli : -- end of form_id -- +#@cli : +#@cli : Note: _shape_option_1 can be empty. n refers to corresponding shape option. +#@cli : +#@cli : Author: Reptorian. +#@cli : $ sp landscape +rep_form_pixel star,20,,90%,45,0,1,1,2,75%,0,5,2,0,0 +#@cli : $ sp dog +rep_form_pixel star,15,,80%,20,0,100%,1,0,250% +rep_form_pixel: +skip ${2=0},${3=0},${4=1},${5=0},${6=0},${7=1},${8=0},${9=1},${10=100%},${11=0},${12=5},${13=0},${14=1},${15=0} +form_ratio,ang,mirror,sub,tile_boundary,image_boundary,z_convolve,z_convolve_boundary,interpolation,cs_mode,fit_tile,var_kodl={[cut(abs($4),0,1),$5,int(abs($6))%3,abs($7)+1,int(abs($8))%4,int(abs($9))%3+1,abs($10),abs($11)%2+1,int(abs($12))+1,int(abs($13))%9,$14&1,int(abs($15))%4]} +convert_colors_fwd=${arg\ 1+$cs_mode,none,rgb2ryb,cs_error,rgb2hcy,rgb2hsi,rgb2hsl,rgb2hsv,rgb2lab,rgb2lch} +convert_colors_bwd=${arg\ 1+$cs_mode,none,ryb2rgb,cs_error,hcy2rgb,hsi2rgb,hsl2rgb,hsv2rgb,lab2rgb,lch2rgb} +if $cs_mode>2 +if $cs_mode>=3&&$cs_mode<7 cutf_vals=0,360,0,100,0,1,0,255 +elif $cs_mode==7 cutf_vals=0,100,-176,176,-176,176,0,255 +else cutf_vals=0,100,0,255,{-pi},{pi},0,255 +fi +fi +if $z_convolve +offpixel,onpixel={z_convolve=$z_convolve;[z_convolve*-1,z_convolve*2+1]} +($offpixel/$onpixel/$offpixel) +store. zmap +fi +tile_w,tile_h={round(abs([$2,$3]))} +if $tile_w?$tile_w<4 tile_w=4 fi +if $tile_h?$tile_h<4 tile_h=4 fi +if !($tile_w||$tile_h) error "\$tile_w||\$tile_h==F" fi +tile_w={!$tile_w?$tile_h:$tile_w} +tile_h={!$tile_h?$tile_w:$tile_h} +tile_wh={$tile_w*$tile_h} +tile_dim=[$tile_w,$tile_h] +if ${is_image_arg\ $1} +pass$1 0 +if s<=4&&s>1 +if s==3 +to_gray. +else +s. c,{if(s==4,-3,if(s==2,-1,-s))} +to_gray.. +*[-2,-1] +fi +elif s==5 +s. c,-4 cmyk2rgb.. to_gray.. *[-2,-1] +fi +else +sid=$1 +if isnum($1) if isint($1) +sid=${"-arg "1+$sid"","australia,barbedwire,circle,crosshair,cupid,diamond,dragon,dragonfly,fern,flip,gear,gumleaf,heart,information,kookaburra,mail,mapleleaf,paint_splat,paw,phone,polygon,rooster,shopping_cart,snowflake,star"} +fi fi +if $#>15 shape_$sid {max($tile_w,$tile_h)*$sub},${16--1} +else shape_$sid {max($tile_w,$tile_h)*$sub} +fi +resize. {ceil(w/$tile_w)*$tile_w},{ceil(h/$tile_h)*$tile_h},100%,100%,0,0,.5,.5 +fi +if $ang-360*floor($ang/360) rotate. $ang,1 fi +if $mirror==1 mirror. x +elif $mirror==2 mirror. y +fi +n. 0,1 autocrop. 0 +if $fit_tile +resize2din. {round([$tile_w,$tile_h]*$form_ratio)},$interpolation +else +resize. {round([$tile_w,$tile_h]*$form_ratio)},100%,100%,$interpolation +fi +resize. $tile_w,$tile_h,100%,100%,0,0,.5,.5 +cut. 0,1 n. 0,1 +avgc={ia#-1} +repeat $!-1 { +local[$<,-1] { +ntw,nth,rw,rh={tile_dim=$tile_dim;new_tile=ceil([w#0,h#0]/tile_dim);[new_tile,new_tile*tile_dim]} +if $var_kodl>1 +if $var_kodl==3 +store[0] kodl_image fi +ow,oh={[w#0,h#0]} +resize[0] $rw,$rh,100%,100%,0,$image_boundary,.5,.5 +elif $var_kodl==1 +resize[0] $rw,$rh,100%,100%,0,$image_boundary,.5,.5 ++store[$<] kodl_image +else +resize[0] $rw,$rh,100%,100%,0,$image_boundary,.5,.5 +fi +if $cs_mode&&(s#0>=3) +if $cs_mode!=2 +$convert_colors_fwd[0] +else +if s#$<==3 rgb2cmyk[0] +else +local[0] { +split c,-3 +rgb2cmyk.. +append c +} +fi +fi +fi +$ntw,$nth,2,{s#0},:"begin( +const avg_c=$avgc; +const tw=$tile_w; +const th=$tile_h; +const wwhh=$tile_wh; +const w_avg=wwhh*avg_c; +const iw_avg=wwhh-w_avg; +const tile_boundary=$tile_boundary; +tile_boundary>2?( +find_pos()=1+x%2+y%2*2; +ti_0=crop(#-1,0,0,0,0,tw,th,1,1); +ti_1=crop(#-1,tw,0,0,0,tw,th,1,1,3); +ti_2=crop(#-1,0,th,0,0,tw,th,1,1,3); +ti_3=crop(#-1,tw,th,0,0,tw,th,1,1,3); +i_ti_0=1-ti_0; +i_ti_1=1-ti_1; +i_ti_2=1-ti_2; +i_ti_3=1-ti_3; +generate_color_a()=( +if(z +,sum(crop_area*i_ti_0)/iw_avg; +,sum(crop_area*ti_0)/w_avg; +); +); +generate_color_b()=( +if(z +,sum(crop_area*i_ti_1)/iw_avg; +,sum(crop_area*ti_1)/w_avg; +); +); +generate_color_c()=( +if(z +,sum(crop_area*i_ti_2)/iw_avg; +,sum(crop_area*ti_2)/w_avg; +); +); +generate_color_d()=( +if(z +,sum(crop_area*i_ti_3)/iw_avg; +,sum(crop_area*ti_3)/w_avg; +); +); +generate_color()=arg(find_pos(),generate_color_a(),generate_color_b(),generate_color_c(),generate_color_d()); +): +tile_boundary?( +ti_0=crop(#-1,0,0,0,0,tw,th,1,1); +tile_boundary==2?( +find_pos()=y%2; +ti_1=crop(#-1,0,th,0,0,tw,th,1,1,3); +):( +find_pos()=x%2; +ti_1=crop(#-1,tw,0,0,0,tw,th,1,1,3); +); +i_ti_0=1-ti_0; +i_ti_1=1-ti_1; +generate_color()=( +find_pos()?( +if(z +,sum(crop_area*i_ti_1)/iw_avg; +,sum(crop_area*ti_1)/w_avg; +); +):( +if(z +,sum(crop_area*i_ti_0)/iw_avg; +,sum(crop_area*ti_0)/w_avg; +); +); +); +):( +ti_0=crop(#-1,0,0,0,0,tw,th,1,1); +i_ti_0=1-ti_0; +generate_color()=( +if(z +,sum(crop_area*i_ti_0)/iw_avg; +,sum(crop_area*ti_0)/w_avg; +); +); +); +); +crop_area=crop(#0,x*tw,y*th,0,c,tw,th,1,1); +generate_color(); +" +if $z_convolve +$zmap +convolve.. .,$z_convolve_boundary +rm. +fi +if $cs_mode>=2&&(s#-1>=3) +if $cs_mode!=2 +sh. 0,2 +if $z_convolve rep_mc. $cutf_vals fi +$convert_colors_bwd. +rm. +else +if s#-1==4 +cmyk2rgb. +channels[0] 0,2 +else +s. c,-4 +cmyk2rgb.. +a[-2,-1] c +channels[0] 0,3 +fi +if $z_convolve cut. 0,255 fi +fi +else +if $cs_mode $convert_colors_bwd. fi +if $z_convolve cut. 0,255 fi +fi +$ntw,$nth,1,1,:"begin( +const tw=$tile_w; +const th=$tile_h; +const tile_boundary=$tile_boundary; +const ss=s#-1; +const length=$tile_wh*ss; +nv()=vc_0+vc_1*tile_v; +tile_boundary==3?( +find_pos()=1+x%2+y%2*2; +ti_0=crop(#-2,0,0,0,0,tw,th,1,1); +ti_1=crop(#-2,tw,0,0,0,tw,th,1,1,3); +ti_2=crop(#-2,0,th,0,0,tw,th,1,1,3); +ti_3=crop(#-2,tw,th,0,0,tw,th,1,1,3); +tile_v0=resize(ti_0,length,0,2); +tile_v1=resize(ti_1,length,0,2); +tile_v2=resize(ti_2,length,0,2); +tile_v3=resize(ti_3,length,0,2); +generate_tile()=( +tile_v=arg(find_pos(),tile_v0,tile_v1,tile_v2,tile_v3); +nv=nv(); +draw(#0,nv,x*tw,y*th,0,0,tw,th,1,ss); +); +): +tile_boundary?( +ti_0=crop(#-2,0,0,0,0,tw,th,1,1); +tile_boundary==2?( +find_pos()=y%2; +ti_1=crop(#-2,0,th,0,0,tw,th,1,1,3); +):( +find_pos()=x%2; +ti_1=crop(#-2,tw,0,0,0,tw,th,1,1,3); +); +tile_v0=resize(ti_0,length,0,2); +tile_v1=resize(ti_1,length,0,2); +generate_tile()=( +tile_v=find_pos()?tile_v1:tile_v0; +nv=nv(); +draw(#0,nv,x*tw,y*th,0,0,tw,th,1,ss); +); +):( +ti=crop(#-2,0,0,0,0,tw,th,1,1); +tile_v=resize(ti,length,0,2); +generate_tile()=( +nv=nv(); +draw(#0,nv,x*tw,y*th,0,0,tw,th,1,ss); +); +); +); +c0=J(#-1,0,0,1); +c1=I(#-1); +diff_colors=c1-c0; +vc_0=resize(c0,length,1,0); +vc_1=resize(diff_colors,length,1,0); +generate_tile();" +if $var_kodl +local[0] { +if $var_kodl&1 +$kodl_image +reverse +fi +if $var_kodl>1 +resize $ow,$oh,100%,100%,0,0,.5,.5 +fi +} +fi +remove[-2,-1] +} +} +remove[-1] +#@cli rep_tfrac: eq. to 'rep_thorn_fractal' +rep_tfrac: rep_thorn_fractal $* +#@cli rep_thorn_fractal: -inf<=style<=57,_escape>0,_iteration>0,_subsampling_level>=1,_dx,_dy,_r_xy>0,_r_x>0,_r_y>0,_r_pi= { 0=r_xy multiplied by 1 | 1=r_xy multiplied by pi },_o_x,_o_y,_function_angle,_vx,_vy,..._vx_n,vy_n : \ : \ -inf<=style<=47,_escape>0,_iteration>0,_subsampling_level>=1,_dx,_dy,_r_xy>0,_r_x>0,_r_y>0,_r_pi= { 0=r_xy multiplied by 1 | 1=r_xy multiplied by pi },_o_x,_o_y,_function_angle,_vx,_vy,..._vx_n,vy_n,ovx,ovy,overload_freq>=1 : \ : \ -inf<=style<=47,_escape>0,_iteration>0,_subsampling_level>=1,_dx,_dy,_r_xy>0,_r_x>0,_r_y>0,_r_pi= { 0=r_xy multiplied by 1 | 1=r_xy multiplied by pi },_o_x,_o_y,_function_angle,_vx,_vy,..._vx_n,vy_n,ovx,ovy,cfa,cfb,overload_freq>=1 +#@cli : Thorn Fractal is the fractal attributed to Andrew Wayne Graff, alternatively named the "Secant Sea". The code was adapted from Sample C source code provided by Adam Majewski. +#@cli : +#@cli : Source - http://paulbourke.net/fractals/thorn/#dane +#@cli : +#@cli : Alternating Chaos Formula are alternating formula founded by MadJik and are originally implemented in Fractal Attractor Plugin for Paint.NET. They use overload functions rather than a simple switch. +#@cli : +#@cli : (eq. to 'rep_tfrac'). +#@cli : 'style' variable is used to define how the thorn fractal will look like with predefined formula. Use a integer value less than 0 to use custom formula, and use a integer value less than -1 to use custom alternating formula. See lists of available style and their corresponding id below. +#@cli : 'escape' variable is used to define the minimum value to escape from the iterative loop. +#@cli : 'iteration' variable defines how much repetition of loop used to find the end value. +#@cli : 'subsampling_level' defines the subsampling level of image. +#@cli : 'dx' is a number used to add to a variable involving distortion within the x-axis during the loop used for fractal generation. +#@cli : 'dy' is a number used to add to a variable involving distortion within the y-axis during the loop used for fractal generation. +#@cli : 'r_xy' defines how much the general infinite line boundary will repeat within the xy axis. +#@cli : 'r_x' defines how much the general infinite line boundary will repeat within the x axis. +#@cli : 'r_y' defines how much the general infinite line boundary will repeat within the y axis. +#@cli : 'r_pi' is used as a multiple to r_xy or to normalize the xmin and xmax to pi ranges. +#@cli : 'o_x' offset the resulting image within the x-direction. +#@cli : 'o_y' offset the resulting image within the y-direction. +#@cli : 'ang' defines the function angle of the thorn fractal. +#@cli : 'vx' variable is used to define custom formula for vx variable for the thorn fractal formula by default. +#@cli : 'vy' variable is used to define custom formula for vy variable for the thorn fractal formula by default. +#@cli : 'vx_n' variable defines a custom formula used for vx variable depending on altern number. +#@cli : 'vy_n' variable defines a custom formula used for vy variable depending on altern number. +#@cli : 'ovx' variable defines a custom formula to be used when the altern is greater than the range of cardinality of set of set[vx,vy]. 'o' in ovx stands for overload. +#@cli : 'ovx' variable defines a custom formula to be used when the altern is greater than the range of cardinality of set of set[vx,vy]. 'o' in ovx stands for overload. +#@cli : 'cfa' variable defines a variable that is used by overload formulas. Used as a temporary constant for each number that exceed the cardinality of set of set[vx,vy]. +#@cli : 'cfb' variable defines a variable that is used by overload formulas. Used as a temporary constant for each number that exceed the cardinality of set of set[vx,vy]. +#@cli : 'overload_freq' defines how much the ovx,and ovy formula will be applied when altern is greater than the range of cardinality of set of set[vx,vy]. +#@cli : - Note on custom formula usage -\n +#@cli : Available adjustible variable: v,vx,vy,dx,dy,a,b,cfa,cfb\n +#@cli : 'v' is the iteration number within loop. +#@cli : 'vx' is the output of distortion function for x-axis. +#@cli : 'vy' is the output of distortion function for y-axis. +#@cli : 'dx' is the distortion-x number. +#@cli : 'dy' is the distortion-y number. +#@cli : 'a' defines result of number defined by vx equation based on the number of repeats needed to escape from the iterative loop to check when resulting value is greater than escape number. +#@cli : 'b' defines result of number defined by vy equation based on the number of repeats needed to escape from the iterative loop to check when resulting value is greater than escape number. +#@cli : 'cfa' is the output of overload function for x-axis. +#@cli : 'cfb' is the output of overlload function for x-axis. +#@cli : +#@cli : Multiple expressions are supported, and they are separated by the character semicolon-[;]. Furthermore, the usage of commas-[,] requires you to wrap them around with quotation marks-["]. See example of usage with commas. If it the only expression, then it would be used for calculation of vx or vy. Otherwise, the first expression may be the only one used for calculation of vx or vy. +#@cli : +#@cli : - End of Note on custom formula usage - +#@cli : +#@cli : - Style List - +#@cli : +#@cli : List here below contains all the list of style. The 'asterisk' or * means the line contains a note. +#@cli : +#@cli : n<-1* = Custom Alternating Formula +#@cli : -1 = Custom Formula +#@cli : 0 = Normal +#@cli : 1 = Normal Inverted +#@cli : 2 = Arcangent +#@cli : 3 = Tangent +#@cli : 4 = Tanh Stroke +#@cli : 5 = Asymphological Vibrato +#@cli : 6 = Asymphological Basic +#@cli : 7 = Asymphological Basic 2 +#@cli : 8 = Asymphochaos +#@cli : 9 = Petallian +#@cli : 10 = Semi-Thorny Petallian +#@cli : 11 = Thorny Petal +#@cli : 12 = Thorny Petal 2 +#@cli : 13 = Inflation +#@cli : 14 = Inflation 2 +#@cli : 15 = Chaotic Creation +#@cli : 16 = Earthing +#@cli : 17 = Acrylic Earthing +#@cli : 18 = Unearthing Origami +#@cli : 19 = Cubic Unearthing +#@cli : 20 = Webbing Cubic Unearthing +#@cli : 21 = Unearthing Chaotic Hooks +#@cli : 22 = Chaotic Hooks +#@cli : 23 = Sinusoidal Liquid +#@cli : 24 = Cosinusoidal Liquid +#@cli : 25 = Echo Wide +#@cli : 26 = Echo Squircle +#@cli : 27 = Echo Hall +#@cli : 28 = Echo Hall 2 +#@cli : 29 = Liquid Parabolic +#@cli : 30 = Chaos-Vibrato +#@cli : 31 = Chaos Deep-Vibrato +#@cli : 32 = Chaos Spacetime +#@cli : 33 = Parabolic +#@cli : 34 = Parabolic Chaos +#@cli : 35 = Cubic-Diamond Chaos +#@cli : 36 = C-Line +#@cli : 37 = Contour Chaos +#@cli : 38 = Spiderweb-Diamond +#@cli : 39 = Acrylica +#@cli : 40 = Refractive Space +#@cli : 41 = Smooth-Artistry +#@cli : 42 = Ferrofluid +#@cli : 43 = Triangular Interweaving +#@cli : 44 = Fabric Chaos +#@cli : 45 = Reverse Tangent Division +#@cli : 46 = Chaotic Tangent +#@cli : 47 = Alternating Chaos 0 +#@cli : 48 = Alternating Chaos 1 (Legacy) +#@cli : 49 = Alternating Chaos 2 (Legacy) +#@cli : 50 = Alternating Chaos 3 (Legacy) +#@cli : 51 = Alternating Chaos 4 (Legacy) +#@cli : 52 = Alternating Chaos 5 (Legacy) +#@cli : 53 = Alternating Chaos 1 +#@cli : 54 = Alternating Chaos 2 +#@cli : 55 = Alternating Chaos 3 +#@cli : 56 = Alternating Chaos 4 +#@cli : 57 = Alternating Chaos 5 +#@cli : +#@cli : * = The absolute of value is the numbers of vx,vy next to '_function_angle'. Per loop, every two different functions are assigned instead. +#@cli : +#@cli : - End Style List - +#@cli : +#@cli : Author: Reptorian. +#@cli : Default values: '_escape=50000','_iteration=255','_subsampling_level=4','_dx=0','_dy=0','_r_xy=1','_r_x=1','_r_y=1','_r_pi=1','_o_x=0','_o_y=0','_function_angle=0','_custom_x=','_custom_y=' +#@cli : $ 1024,1024 rep_thorn_fractal -1,10000,255,4,2.544,-5.2424,1,1,1/2,1,0,0,30,atan2(a"^"2\,b"^"2)/cos(b),b/sin(a) +rep_thorn_fractal: +skip ${2=50000},${3=255},${4=4},${5=0},${6=0},${7=1},${8=1},${9=1},${10=1},${11=0},${12=0},${13=0},${14=},${15=} +if $1<0 +if !(narg($14)&&narg($15)) error "When using custom formula, there must be an arguments into custom_x and custom_y variables" +fi +fi +if $1>57 error "$"1<57==F fi +if $2<=0 error "$"2>0==F fi +if $3<1 error "$"3>0==F fi +if $4<1 error "$"4>0==F fi +if !(($7>0&&$8>0)&&$9>0) error "Repeat variables cannot be 0!" fi +if $1>52 +chaos_a=a/cfb +chaos_b=b/cfa +else +chaos_a=a +chaos_b=b +fi +if $1<0 +bounds:=abs($1)*2 +if narg($*)==18+$bounds activate_overload=2 +elif narg($*)==16+$bounds activate_overload=1 +else activate_overload=0 +fi +else activate_overload=0 +fi +if $activate_overload!=2&&$1<0 +repeat narg(${14--1}) { +$=t +it=${t{$>+14}} +n={$>+14} +strcontains $it,cfa +if ${} error \$\-1!=2?!incl(\$$n,cfa):T==F fi +strcontains $it,cfb +if ${} error \$\-1!=2?!incl(\$$n,cfb):T==F fi +if ('$it'=='cfa')||('$it'=='cfb') error overload!=2?str_incl(cfa):T==F fi +} +fi +if $activate_overload==2 +fta=$-3 +ftb=$-2 +if $-1>0 ovf_place_pos=if(use_altlim,if(altern==altlim,cfa=fta();cfb=ftb(););); +elif $-1<0 ovf_place_neg=if(use_altlim,if(altern==altlim,cfa=fta();cfb=ftb(););); +else activate_overload=0 +fi +else +fta=atan(vx) +ftb=atan(vy) +if $1>52 ovf_place_pos=if(use_altlim,if(altern==altlim,cfa=fta();cfb=ftb(););); fi +fi +foreach { +ww,hh={[w,h]} +iw,ih={int($4*[$ww,$hh])} +if !($iw%2) iw+=1 fi +if !($ih%2) ih+=1 fi +rm +$iw,$ih,1,1,"begin( +altern=0; +const half_width=w/2; +const half_height=h/2; +const sd=max(w,h)/min(w,h); +w>h?( +const sx=half_width/sd; +const sy=half_height; +):( +const sx=half_width; +const sy=half_height/sd; +); +const rf=int(abs($3)); +const chaos=$1>46; +const ang=pi*($13/180); +const cos_ang=cos(ang); +const sin_ang=sin(ang); +const dx=$5; +const dy=$6; +const rpi=($10?pi:1); +const ox=$11*rpi; +const oy=$12*rpi; +const srpi=rpi*$7; +const szx=$8*srpi; +const szy=$9*srpi; +const overload=$activate_overload; +const activate_alt_bool=chaos||$1<-1||($1==-1&&overload); +const use_altlim=($1<0&&(overload==2))||$1>52; +chaos?(const altlim=3;) +:(use_altlim?( +const max_vec_pos=(overload?($-1<0?0:1):1); +const altlim=abs($1)-max_vec_pos; +const overlim=altlim+max_vec_pos; +):( +const altlim=abs($1)-1; +const overlim=altlim+1; +); +); +cfa=cfb=1; +vx=vy=0; +fta()="$fta"; +ftb()="$ftb"; +logabs(v)=log(abs(v)); +logabs_zero_inf(v)=log(abs(v)+1); +concat(arg...)=( +ref([arg],numbers); +additional_numbers=size(numbers)-1; +first_number=numbers[0]; +a=abs(first_number); +use_negative=first_number<0; +repeat(additional_numbers,pos, +num_pos=pos+1; +b=abs(numbers[num_pos]); +num_digits=(b>0?int(log10(b)))+1; +if(num_pos!=additional_numbers +,a=int(a*10^num_digits+b); +,a=int(a*10^num_digits)+b; +); +); +use_negative?-a:a; +); +overload?( +const count_overload=abs($-1); +):( +const count_overload=0; +); +chaos?( +const ff=use_altlim? $1-49 : $1-44 ; +):( +const ff=abs($1)-1+count_overload; +); +($1<-1||($1==-1&&overload))?( +overload?( +use_altlim?( +vxf(a,b)=arg(min(altern,overlim)+1,${14--4:2}); +vyf(a,b)=arg(min(altern,overlim)+1,${15--4:2}); +):( +vxf(a,b)=arg(min(altern,overlim)+1,${14--2:2}); +vyf(a,b)=arg(min(altern,overlim)+1,${15--2:2}); +); +):( +vxf(a,b)=arg(altern+1,${14--1:2}); +vyf(a,b)=arg(altern+1,${15--1:2}); +); +): +$1==-1?( +vxf(a,b)=$14; +vyf(a,b)=$15; +): +$1==0?( +vxf(a,b)=a/cos(b); +vyf(a,b)=b/sin(a); +): +$1==1?( +vxf(a,b)=a/sin(b); +vyf(a,b)=b/cos(a); +): +$1==2?( +vxf(a,b)=a/atan(b); +vyf(a,b)=b/atan(a); +): +$1==3?( +vxf(a,b)=a/tan(b); +vyf(a,b)=b/tan(a); +): +$1==4?( +vxf(a,b)=a/cos(b)*sin(b); +vyf(a,b)=b/sin(a)*cos(a); +): +$1==5?( +vxf(a,b)=a*tan(a*b)/sin(b); +vyf(a,b)=b*tan(a*b)/cos(a); +): +$1==6?( +vxf(a,b)=(a+tan(a*b))/sin(b); +vyf(a,b)=(b+tan(a*b))/cos(a); +): +$1==7?( +vxf(a,b)=(a-tan(a*b))/sin(b); +vyf(a,b)=(b-tan(a*b))/cos(a); +): +$1==8?( +vxf(a,b)=a/cos(b)+a/sin(b); +vyf(a,b)=b/cos(a)+b/sin(a); +): +$1==9?( +vxf(a,b)=a/(cos(b)*sin(b)); +vyf(a,b)=b/(sin(a)*cos(a)); +): +$1==10?( +vxf(a,b)=a/(cos(tan(b))*sin(tan(b))); +vyf(a,b)=b/(sin(tan(a))*cos(tan(a))); +): +$1==11?( +vxf(a,b)=(tan(a)+b)/(cos(tan(b))*sin(tan(b))); +vyf(a,b)=(tan(b)+a)/(sin(tan(a))*cos(tan(a))); +): +$1==12?( +vxf(a,b)=(a+tan(a)+tan(b))/(cos(tan(b))*sin(tan(b))); +vyf(a,b)=(b+tan(a)+tan(b))/(sin(tan(a))*cos(tan(a))); +): +$1==13?( +vxf(a,b)=(a+tan(a)+tan(b))/cos(a); +vyf(a,b)=(b+tan(a)+tan(b))/sin(a); +): +$1==14?( +vxf(a,b)=(a+tan(a)+tan(b))/sin(b); +vyf(a,b)=(b+tan(a)+tan(b))/cos(a); +): +$1==15?( +vxf(a,b)=a/sin(cos(b)*sin(b)); +vyf(a,b)=b/cos(sin(a)*cos(a)); +): +$1==16?( +vxf(a,b)=(a+tan(a)/tan(b))/cos(a); +vyf(a,b)=(b+tan(a)/tan(b))/sin(b); +): +$1==17?( +vxf(a,b)=(b+tan(a)/tan(b))/cos(a); +vyf(a,b)=(a+tan(a)/tan(b))/sin(b); +): +$1==18?( +vxf(a,b)=(b+tan(b)/tan(a))/cos(a); +vyf(a,b)=(a+tan(a)/tan(b))/sin(b); +): +$1==19?( +vxf(a,b)=(b+tan(b)/tan(a))/cos(a); +vyf(a,b)=(a+tan(b)/tan(a))/sin(b); +): +$1==20?( +vxf(a,b)=(b+tan(a)/tan(a))/cos(a); +vyf(a,b)=(a+tan(b)/tan(a))/sin(b); +): +$1==21?( +vxf(a,b)=b+tan(a)/a/cos(b)+a/sin(b); +vyf(a,b)=a+tan(b)/b/cos(a)+b/sin(a); +): +$1==22?( +vxf(a,b)=b+tan(a)/(a/cos(b))+a/sin(b); +vyf(a,b)=a+tan(b)/(b/cos(a))+b/sin(a); +): +$1==23?( +vxf(a,b)=a+3*sin(b)-pi; +vyf(a,b)=a+b+3*sin(a)-pi; +): +$1==24?( +vxf(a,b)=a+3*cos(b)-pi; +vyf(a,b)=a+b+3*cos(a)-pi; +): +$1==25?( +vxf(a,b)=a/sin(a/sin(b)); +vyf(a,b)=b/cos(b/cos(a)); +): +$1==26?( +vxf(a,b)=a/cos(a/sin(b)); +vyf(a,b)=b/sin(b/cos(a)); +): +$1==27?( +vxf(a,b)=a/cos(a/atan(sin(b))); +vyf(a,b)=b/sin(b/atan(cos(a))); +): +$1==28?( +vxf(a,b)=a/sin(a/atan(cos(b))); +vyf(a,b)=b/cos(b/atan(sin(a))); +): +$1==29?( +vxf(a,b)=a/atan(cos(b)); +vyf(a,b)=b/atan(sin(a)); +): +$1==30?( +vxf(a,b)=(a+tanh(a*b))/cos(b); +vyf(a,b)=(b+tanh(a*b))/sin(a); +): +$1==31?( +vxf(a,b)=b+tan(b)/(a/(cos(b)))+a/(sin(a)); +vyf(a,b)=a+tan(a)/(b/(cos(a)))+b/(sin(b)); +): +$1==32?( +vxf(a,b)=(a+tanh(a+b))/cos(b); +vyf(a,b)=(b+tanh(a+b))/sin(a); +): +$1==33?( +vxf(a,b)=a/sin(b)/tan(b); +vyf(a,b)=b/cos(a)/tan(a); +): +$1==34?( +vxf(a,b)=a/(tan(b)*cos(b)*sin(b)); +vyf(a,b)=b/(tan(a)*cos(a)*sin(a)); +): +$1==35?( +vxf(a,b)=a/tan(cos(b)); +vyf(a,b)=b/tan(sin(a)); +): +$1==36?( +vxf(a,b)=(a+tanh(a*b))/(cos(b)*sin(a)); +vyf(a,b)=(b+tanh(a*b))/(sin(b)*cos(a)); +): +$1==37?( +vxf(a,b)=(a+tan(cos(a)*sin(b)))/cos(a); +vyf(a,b)=(b+tan(sin(a)*cos(b)))/sin(b); +): +$1==38?( +vxf(a,b)=(tan(a+b)*b)/cos(b); +vyf(a,b)=(tan(a-b)*a)/sin(a); +): +$1==39?( +vxf(a,b)=a/cos(b)*sin(a); +vyf(a,b)=b/sin(a)*cos(b); +): +$1==40?( +vxf(a,b)=a/tan(cos(b)+sin(b)); +vyf(a,b)=b/tan(cos(a)+sin(a)); +): +$1==41?( +vxf(a,b)=a+(tanh(a+b)/cos(b)); +vyf(a,b)=b+(tanh(a+b)/sin(a)); +): +$1==42?( +vxf(a,b)=(a/(cos(b)))/(b/(sin(a))); +vyf(a,b)=(b/(cos(a)))/(a/(sin(b))); +): +$1==43?( +vxf(a,b)=(a*tan(a+b))/sin(b); +vyf(a,b)=(b*tan(a+b))/cos(a); +): +$1==44?( +vxf(a,b)=a/(atan2(b^2,a^2)*tan(b)); +vyf(a,b)=b/(atan2(b^2,a^2)*tan(a)); +): +$1==45?( +vxf(a,b)=tan(a)/b; +vyf(a,b)=tan(b)/a; +): +$1==46?( +vxf(a,b)=a/atan(b/cos(a/sin(a))); +vyf(a,b)=b/atan(a/sin(b/cos(b))); +): +$1>46?( +vxf(a,b)=altern>3?"$chaos_a":arg(altern+1,a/cos(b),a/sin(b),a/tan(b),a/atan(b)); +vyf(a,b)=altern>3?"$chaos_b":arg(altern+1,b/sin(a),b/cos(a),b/tan(a),b/atan(a)); +); +); +xx=(x-half_width)/sx; +yy=(y-half_height)/sy; +zx=szx*((xx*cos_ang-yy*sin_ang))+ox; +zy=szy*((xx*sin_ang+yy*cos_ang))+oy; +zx&&zy?( +vx=zx; +vy=zy; +repeat(rf,v, +a=vx; +b=vy; +"$ovf_place_neg" +vx=vxf(a,b); +vy=vyf(a,b); +"$ovf_place_pos" +vx+=dx; +vy+=dy; +if(activate_alt_bool, +++altern; +if(altern>ff,altern=0); +); +if((vx*vx+vy*vy)>$2,break()); +); +v; +):(0);" +r $ww,$hh,1,1,6 +} +fx_rep_modo: +if ($1>=0&&$1<4)||$1>=9 color_id=[{vector3(255)}] +elif $1==4 color_id=[{vector4(255)}] +elif $1<9 color_id=[360,1,1] +fi +if $1==4 v_n={$2?(!$37&&$11):(!$16&&$15)},{$2?(!$38&&$11):(!$21&&$20)},{$2?(!$39&&$11):(!$26&&$25)},{$2?(!$40&&$11):(!$31&&$30)},{$2?(!$41&&$11):(!$36&&$35)} +else v_n={$2?(!$37&&$11):(!$16&&$15)},{$2?(!$38&&$11):(!$21&&$20)},{$2?(!$39&&$11):(!$26&&$25)},{$2?(!$41&&$11):(!$36&&$35)} +fi +use_negate=max($v_n) +v_n=[$v_n] +color_channels={$1==4?4:3} +convert_colors_fwd=${arg\ $1+1,,rgb2srgb,rgb2ryb,rgb2cmy,,rgb2hcy,rgb2hsi,rgb2hsl,rgb2hsv,rgb2lab8,rgb2lch8,rgb2yiq8,rgb2yuv8,rgb2ycbcr,rgb2ycbcrglic,rgb2xyz8,rgb2yes8,rgb2k18,rgb2ohta8} +convert_colors_bwd=${arg\ $1+1,,srgb2rgb,ryb2rgb,cmy2rgb,,hcy2rgb,hsi2rgb,hsl2rgb,hsv2rgb,lab82rgb,lch82rgb,yiq82rgb,yuv82rgb,ycbcr2rgb,ycbcrglic2rgb,xyz82rgb,yes82rgb,k182rgb,ohta82rgb} +if $1 +foreach { +if $1!=4 +$convert_colors_fwd. +else +if s==3 rgb2cmyk +elif s==4 s c,-3 rgb2cmyk.. a c +fi +u cmyk +fi +} +fi +if $color_channels==3 +modo_variables={$2?$8:$12},{($color_id)[0]},{$2?($37?-2:($10?-1:$9%)):($16?-2:($14?-1:$13%))},{$2?$8:$17},{($color_id)[1]},{$2?($38?-2:($10?-1:$9%)):($21?-2:($19?-1:$18%))},{$2?$8:$22},{($color_id)[2]},{$2?($39?-2:($10?-1:$9%)):($26?-2:($24?-1:$23%))},$32,255,{($2?$41:$36)?-2:($34?-1:$33%)} +else +modo_variables={$2?$8:$12},{($color_id)[0]},{$2?($37?-2:($10?-1:$9%)):($16?-2:($14?-1:$13%))},{$2?$8:$17},{($color_id)[1]},{$2?($38?-2:($10?-1:$9%)):($21?-2:($19?-1:$18%))},{$2?$8:$22},{($color_id)[2]},{$2?($39?-2:($10?-1:$9%)):($26?-2:($24?-1:$23%))},{$2?$8:$27},{($color_id)[3]},{$2?($40?-2:($10?-1:$9%)):($31?-2:($29?-1:$28%))},$32,255,{($2?$41:$36)?-2:($34?-1:$33%)} +fi +rep_modo_mc $modo_variables +if $use_negate +foreach { +ss={s-1} +repeat s { +if $>!=$ss if ($v_n)[$>] sh. $> f. ($color_id)[$>]-i rm. fi +else if ($v_n)[$>] sh. $> f. 255-i rm. fi +fi +} +} +fi +if $1 +foreach { +if $1!=4 +$convert_colors_bwd. +else +if s==4 cmyk2rgb +elif s==5 s c,-4 cmyk2rgb.. a c +fi +fi +} +fi +if !$3 rv fi +if '$_host'=='paintdotnet' k[0] fi +fx_rep_modo_preview: +two_plus_layer={$!>1} +ms=${-max_s} +rv gui_split_preview "fx_rep_modo ${1-41}",${-3--1} +contain_alpha={$ms>3} +activate_individual_channels={!$2?2} +mode_0={$contain_alpha&&$2?2} +mode_1={!$contain_alpha&&!$2?2} +mode_2={$1!=4?(($contain_alpha&&!$2)?2):((!$contain_alpha&&!$2)?2)} +mode_3={!$2?(($1==4&&$contain_alpha)?2)} +use_channel_1_a={$5==0?2} +use_channel_1_b={$6==0?2} +use_channel_1_c={$7==0?2} +use_channel_2_a={$5==1?2} +use_channel_2_b={$6==1?2} +use_channel_2_c={$7==1?2} +use_channel_3_a={$5==2?2} +use_channel_3_b={$6==2?2} +use_channel_3_c={$7==2?2} +activate_a={!$2?(($mode_1?$use_channel_1_a:($mode_2?$use_channel_1_b:$use_channel_1_c))?2)} +activate_b={($mode_1?$use_channel_2_a:($mode_2?$use_channel_2_b:$use_channel_2_c))?2} +activate_c={($mode_1?$use_channel_3_a:($mode_2?$use_channel_3_b:$use_channel_3_c))?2} +activate_d={$1==4?($mode_2?($6==3?2):($mode_3?($7==3?2)))} +activate_e={$2?($mode_0?($4==1?2)):($contain_alpha?($1!=4?($mode_2?($6==3?2):($7==4?2)):($mode_3?$7==4?2)))} +activate_csm={$2&&!$4?2} +activate_bottom_sec={$2?2} +u "{$1}""{$2}""{$3}""{$4}_"{$mode_0}"{$5}_"{$mode_1}"{$6}_"{$mode_2}"{$7}_"{$mode_3}"{$8}_"{$activate_csm}"{$9}_"{$activate_csm}"{$10}_"{$two_plus_layer?$activate_csm}"{$11}_"{$activate_csm}"{$12}_"{$activate_a}"{$13}_"{$activate_a}"{$14}_"{$two_plus_layer?$activate_a}"{$15}_"{$activate_a}"{$16}_"{$activate_a}"{$17}_"{$activate_b}"{$18}_"{$activate_b}"{$19}_"{$two_plus_layer?$activate_b}"{$20}_"{$activate_b}"{$21}_"{$activate_b}"{$22}_"{$activate_c}"{$23}_"{$activate_c}"{$24}_"{$two_plus_layer?$activate_c}"{$25}_"{$activate_c}"{$26}_"{$activate_c}"{$27}_"{$activate_d}"{$28}_"{$activate_d}"{$29}_"{$two_plus_layer?$activate_d}"{$30}_"{$activate_d}"{$31}_"{$activate_d}"{$32}_"{$activate_e}"{$33}_"{$activate_e}"{$34}_"{$two_plus_layer?$activate_e}"{$35}_"{$activate_e}"{$36}_"{!$2?$activate_e}"{$37}_"{$activate_bottom_sec}"{$38}_"{$activate_bottom_sec}"{$39}_"{$activate_bottom_sec}"{$40}_"{$2?($1==4?2)}"{$41}_"{($2&&$contain_alpha)?2}"{$42}""{$43,$44}" +fx_OOBS: +-m "MergeChoice : $""=_mode" -MergeChoice "add","alpha","and","average","burn","darken","difference","divide","dodge","exclusion","freeze","grainextract","grainmerge","hardlight","hardmix","interpolation","lighten","linearburn","linearlight","multiply","normal","negation","or","overlay","pinlight","reflect","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","vividlight","xor","edges","error" +split_opacity +local[0] +if $2==0 +if $1==1 rgb2hsv +elif $1==2 rgb2hsl +elif $1==3 rgb2hsi +elif $1==4 rgb2lch +elif $1==5 rgb2lab +elif $1==6 rgb2ycbcr +elif $1==7 rgb2yiq +elif $1==8 rgb2yuv +elif $1==9 rgb2xyz +fi +elif $2==1 +if $1==0 rgb2srgb +elif $1==1 rgb2hsv8 +elif $1==2 rgb2hsl8 +elif $1==3 rgb2hsi8 +elif $1==4 rgb2lch8 +elif $1==5 rgb2lab8 +elif $1==6 rgb2ycbcrglic +elif $1==7 rgb2yiq8 +elif $1==8 rgb2yuv8 +elif $1==9 rgb2xyz8 +fi fi +s c +if $3==1 +if $4==1 local[0] +oobs_edit[0] $8,$9,$10 -blend[0,1] ${_mode{$11+1}},$12/100 done fi +if $5==1 local[1] +oobs_edit[0] $8,$9,$10 -blend[0,1] ${_mode{$11+1}},$12/100 done fi +if $6==1 local[2] +oobs_edit[0] $8,$9,$10 -blend[0,1] ${_mode{$11+1}},$12/100 done fi +elif $3==0 +if $4==1 local[0] +oobs_edit[0] $13,$14,$15 -blend[0,1] ${_mode{$16+1}},$17/100 done fi +if $5==1 local[1] +oobs_edit[0] $18,$19,$20 -blend[0,1] ${_mode{$21+1}},$22/100 done fi +if $6==1 local[2] +oobs_edit[0] $23,$24,$25 -blend[0,1] ${_mode{$26+1}},$27/100 done fi +fi +a c +if $2==0 +if $1==1 hsv2rgb +elif $1==2 hsl2rgb +elif $1==3 hsi2rgb +elif $1==4 lch2rgb +elif $1==5 lab2rgb +elif $1==6 ycbcr2rgb +elif $1==7 yiq2rgb +elif $1==8 yuv2rgb +elif $1==9 xyz2rgb +fi +elif $2==1 +if $1==0 srgb2rgb +elif $1==1 hsv82rgb +elif $1==2 hsl82rgb +elif $1==3 hsi82rgb +elif $1==4 lch82rgb +elif $1==5 lab82rgb +elif $1==6 ycbcrglic2rgb +elif $1==7 yiq82rgb +elif $1==8 yuv82rgb +elif $1==9 xyz82rgb +fi fi +done +local[1] +if $3==1 if $7==1 +oobs_edit[0] $8,$9,$10 -blend[0,1] ${_mode{$11+1}},$12/100 fi +elif $3==0 if $7==1 +oobs_edit[0] $28,$29,$30 -blend[0,1] ${_mode{$31+1}},$32/100 fi +fi +done +a c +oobs_edit : +if $1==0 -overblur_overline[0] 0,$2,$3 fi +if $1==1 -overblur_overline[0] 1,$2,$3 fi +if $1==2 -blur[0] {$2*$3} fi +if $1==3 -sharpen[0] {$2*$3} fi +overblur_overline : +if $1==0 +blur[0] $2 +elif $1==1 +sharpen[0] $2 +fi ++blend[0,1] difference +mul[2] $3 +remove[1] +-blend[0,1] add +_fx_OOBS_preview : +gui_split_preview "fx_OOBS ${1--2}",$-1 +pr_papercuts : +foreach { +simp,ln,lay,col,cr,cg,cb,cvar,sort,order,shb,sho,sx,ang,mulay,ind,def,seed,cvs,cstr,down=$* +arg0 $9,"none","rv","u","xm","ym","zm","cm","xM","yM","zM","cM","R","G","B","A","im","iM","ia","iv","id","is","ip","ic","in","w","h","z" +sort=${} +arg0 $10,"+","-" order=${} +arg0 $14,"0","45","90","135","180","225","270","315","360" ang=${} +to_rgb +wi,he:=w,h +if $down<100 r $down%,$down%,100%,100%,3 coeff:=$down/100 simp,ln,shb,def*=$coeff else coeff=1 fi +to_rgb n 0,255 +if $ln normalize_local $ln,$ln fi +if $simp +b {$simp/5} +bilateral {[$simp*2,$simp*2]},0,0 +fi +autoindex $lay,$ind,0 +split_colors 20,$lay,32 np=$! +if $def pr_deform $def,$seed,2 fi +sh 3 b[$np--1] {0.8*$coeff} rm[$np--1] +sh 0,2 +if $col==0&&$cvar ap[$np--1] "adjust_colors ,,,{[u(-$8,$8),u(-$8)]},0,255" fi +if $col==1 ap[$np--1] "fc $5,$6,$7,255 adjust_colors ,,,{[u(-$8,$8),u(-$8)]},0,255" fi +if $col==2 ap[$np--1] "fc ${-rgb},255" fi +dilate_circ 1.5 +rm[$np--1] +if $9>1 sort_list $order,$sort fi +if $9==1 rv fi +if $col==1 foreach { mul {0.97^$<} } fi +$wi,$he,1,3,[255,255,255] +if $cvs +foreach { +if $cstr pr_canvas $cstr,{u(20,30)},0 fi ++rep_emboss_relief 5,$ang,1,2,1,0,1 blend alpha ++b $shb spread. {$shb/4} +sh. 0,2 fc. 0,0,0 rm. +if $sho<1 mul. $sho fi +if $sx +sx*=$coeff +if $ang==0||$ang==360 coords=-$sx,0 +elif $ang==45 coords=-$sx,$sx +elif $ang==90 coords=0,$sx +elif $ang==135 coords=$sx,$sx +elif $ang==180 coords=$sx,0 +elif $ang==225 coords=$sx,-$sx +elif $ang==270 coords=0,-$sx +elif $ang==315 coords=-$sx,-$sx +fi +shift. $coords +fi +shrink_xy {$>*$coeff} +mv. 0 blend alpha +if $down<100 r $wi,$he,100%,100%,1 fi +normalize_local 0.3,0.3,0,0,1 +} +fi +to_rgb. negate. +mv. 0 if $mulay +blend alpha rv n 0,255 else blend alpha n 0,255 fi +} +pr_papercuts_preview : +tic +if $-1<100&&$-1!=50 pr_papercuts $* else pr_papercuts ${1--2},50 fi +toc to ${} +#@cli pr_thickspline : x0[%],y0[%],u0[%],v0[%],x1[%],y1[%],u1[%],v1[%],_lines_count,_spacing,_opacity,_color1,... +#@cli : Draw a number of specified colored spline curves on selected images (cubic hermite spline). +#@cli : Default values: 'lines_count=3' 'spacing=2', 'opacity=1' and 'color1=0'. +#@cli : $ 400,400,1,3 repeat 30 { pr_thickspline {u([w,h,1000,1000,w,h,1000,1000,10,10])},0.5,${-rgb} } +e[^-1] "Draw a number $9 of splines ($1,$2) - ($5,$6) on image$?, with spacing $10, opacity $11 and color (${12--1})." +pr_thickspline : skip ${9=3},${10=2},${11=1},${12=0} +if $10<=1 spline ${1-8},${11--1} +else foreach { +x0={if(${"is_percent $1"},$1*(w-1),$1)} +y0={if(${"is_percent $2"},$2*(h-1),$2)} +u0={if(${"is_percent $3"},$3*(w-1),$3)} +v0={if(${"is_percent $4"},$4*(h-1),$4)} +x1={if(${"is_percent $5"},$5*(w-1),$5)} +y1={if(${"is_percent $6"},$6*(h-1),$6)} +u1={if(${"is_percent $7"},$7*(w-1),$7)} +v1={if(${"is_percent $8"},$8*(h-1),$8)} +th=$10 +eval +it=0;${-math_lib}"repeat ( $9,spline(#0,["$x0-it","$y0-it"],["$u0-it*1","$v0+it*1"],["$x1-it","$y1-it"],["$u1-it*1","$v1+it*1"],$11,[${12--1}]);it+=$th )" +} fi +pr_canvas : skip "${1=1},${2=0.5},${3=0},${4=255},${5=255},${6=255},${7=255}" +foreach { +nm REND +to_a ++fc 255,255,255 noise. 50,2 to_gray. . . +if $2 +__wat,__watb=water.,water.. +__watv=$2,1,45 +else +__wat,__watb,__watv=b.,b..,0 +fi +blur_x. 30 $__wat $__watv sharpen. 50 spread. 1.7 +blur_y.. 30 $__watb $__watv sharpen.. 50 spread.. 1.7 +*. .. keep[0,-1] +n. 0,255 +gradient. xy,1 -a[-2,-1] c *. {$1/100} +if $3 +warp[REND] .,3,1,3,1 ++fc[REND] $4,$5,$6,$7 +move[-1] 0 blend[0,REND] alpha +nm[0] REND +else +sh[REND] 0,2 warp. ..,3,1,3,1 rm. +fi +keep[REND] +} +pr_canvas_preview : +pr_canvas $* +pr_sickpaint : +foreach { +div:=h/$4 +Rstep,Gstep,Bstep:=sqrt(([${13-15}]-[${10-12}])^2)/($div*1.5) +repeat $1 { +sx,sy,ex,ey:=u($2),u($3),u($2),u($3) +Rs,Gs,Bs=$10,$11,$12 +if $8<1 o:=u($8,$7) else o=1 fi +do +ls,d:=u($6)/($>+1)*2,u($9) +ex,ey+=u($4),u($5) +thickline {[u($sx)*3,u($sy)*3,$ex+u($>*2),$ey+u($>*2),u($ls)]},$o,$Rs,$Gs,$Bs +thickline $sx,$sy,$ex,$ey,$ls,$o,0,0,0 +circle $sx,$sy,{$ls*0.3},$o,$Rs,$Gs,$Bs +cx,cy:=u($>*100),u($>*100) +circle {[$sx+$cx,$sy+$cy,$ls*0.3]},$o,$Rs,$Gs,$Bs +circle {[$sx+u($>)*2,$sy+u($>)*2,u(5),u(0.5)]},0,0,0 +pr_thickspline {[$sx+$>,$sy+$>,u(-$d,$d),0,$ex+$>,$ey+$>,u(-$d,$d),0,u(10,30),u(2,50),$o,$Rs,$Gs,$Bs]} +pr_thickspline {[$sx-$>,$sy-$>,u(-$d,$d),u(-$d,$d),$ex-$>,$ey-$>,u(-$d,$d),u(-$d,$d),u(10,30),u(2,50),$o,0,0,0]} +if $10>$13 Rs-=$Rstep else Rs+=$Rstep fi +if $11>$14 Gs-=$Gstep else Gs+=$Gstep fi +if $12>$15 Bs-=$Bstep else Bs+=$Bstep fi +sx,sy=$ex,$ey +while $ey<=h||$ex<=w +if $ey>=h||$ex>=w +repeat 1 { +rotate {[g,0,0,u(150)%,u(150)%]} +s x,$16 foreach { nm {$>/100} } sort_list -,u +mirror[{round(u($!-1))},0,-1] x +mirror[{round(u($!-1))},0,-1] y +shift[1] {[[u(-10,10),u(-10,10)],0,0,floor(u(3.9))]},0 +spread[1] {u(0.8)} pr_deform[1] {u(2.8)},0,2,0 +sort_list -,n +a x +} +fi +} +sharpen 1800 +smooth 40,0,1,1,2 +rep_emboss_relief 5,0,0.5,1,1,0,1 +} +pr_sickpaint_preview : +tic pr_sickpaint $* toc to ${} +#@cli calispline : x0[%],y0[%],u0[%],v0[%],x1[%],y1[%],u1[%],v1[%],_rad0,rad1,_ang,_opacity,_color1,... +#@cli : Draw specified colored calligraphic line, tracing an underlying cubic +#@cli : hermite spline, on selected images. Default values: 'rad0=rad1=3', +#@cli : 'ang=0', 'opacity=1' and 'color1=0'. +#@cli : $ image.jpg repeat 30 { calispline {u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},{u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},0.6,255 } +calispline : skip ${9=3},${10=3},${11=0},${12=1},${13=0} +e[^-1] "Draw a calligraphic spline from ($1,$2) tangent: [$3,$4] to ($5,$6) tangent: [$7,$8] on image$?, ""with pen shape: $9-$10, angle $11, opacity: $12 and color (${13--1})." +foreach { +x0={if(${"is_percent $1"},$1*(w-1),$1)} +y0={if(${"is_percent $2"},$2*(h-1),$2)} +u0={if(${"is_percent $3"},$3*(w-1),$3)} +v0={if(${"is_percent $4"},$4*(h-1),$4)} +x1={if(${"is_percent $5"},$5*(w-1),$5)} +y1={if(${"is_percent $6"},$6*(h-1),$6)} +u1={if(${"is_percent $7"},$7*(w-1),$7)} +v1={if(${"is_percent $8"},$8*(h-1),$8)} +r0,r1,ang,opac=${9-12} +eval ${-mysplines}"calispline(#0,["$x0","$y0"],["$u0","$v0"],["$x1","$y1"],["$u1","$v1"],$r0,$r1,$ang,$opac,[${13--1}])" +} +mysplines : +status " +calispline(ind,P0,T0,P1,T1,rad0,rad1,ang,opacity,color) = ( +unref(_ds_color); +unref(_ds_mask); +_P0 = P0; +_P1 = P1; +_rad0 = rad0; +_rad1 = rad1; +_ang = ang; +_opacity = opacity; +_ds_color = resize(color,s#ind)*=abs(_opacity); +_omopacity = 1 - max(_opacity,0); +_C = hermite_coef(_P0,T0,P1,T1); +_dt = _dtmin = 1/max(abs(_P1 - _P0)); +_P0 = inf; +for (_t = 0, _t<=1, _t+=_dt, +_P = round(mul([_t^3,_t^2,_t,1],_C,2)); +_dP = abs(mul([3*_t^2,2*_t,1,0],_C,2)); +_dt = min(_dtmin,0.75/max(_dP)); +if (_P0!=_P, +ellipse(#ind,_P[0],_P[1],_rad0,_rad1,ang,_opacity,_ds_color); +); +_P0 = _P; +); +nan; +); +hermite_coef(P0,T0,P1,T1) = ( +C=mul([ 2,-2,1,1,-3,3,-2,-1,0,0,1,0,1,0,0,0 ],[ P0,P1,T0,T1 ],2); +); +" +#@cli splinefun : [palette],curve_plot_count,complexity_level,thickness,pen_width,pen_angle +splinefun : -check ${"is_image_arg $1"} +-check "${2=64}>0 && ${3=3}>0 && ${3}<12 && ${4=4}>2 && ${5=45} && ${6=0.25}>=0 && ${6}<=1" +-pass$1 1 +-name. palette +foreach[^palette] { +nm={0,n} +-name. canvas +-pass$1 +-name. palette +crvcnt={w#$palette} +res=$2 +lvl={2^$3} +thick=$4 +ang={deg2rad($5)} +opacity=$6 +-input $lvl,1,1,4,[u($crvcnt),u($res),u(-1,1),u(-1,1)] +-rbf. $crvcnt,$res +-name. plotcoords +-sub[plotcoords] {ia} +-mul[plotcoords] {1.75/(iM-im)} +-fill[plotcoords] "begin( +sw=min(w#$canvas,h#$canvas)/2; +id=eye(3); +id[0]=sw; +id[2]=sw; +id[4]=-sw; +id[5]=sw +); +(id*[I(x,y),1])[0,2]" +-permute[plotcoords] cyzx +-split[plotcoords] c +lc=0 +-name[^canvas,palette] plot +-foreach[plot] { +-name. plots ++mirror[plots] y +-permute. cyzx +-fill. begin(OFS=cexp([log($thick),$ang]));I(#-1,x,y)+OFS +-permute. cyzx +-append[-2,-1] y +-pass[canvas] 1 +-pass[palette] 1 +-eval "PV=crop(#$plots); +polygon(#$canvas,size(PV)/2,PV,$opacity,I(#$palette,$lc,0))" +-rm +lc+=1 +} +-keep[canvas] +-name[canvas] $nm +} +-rm[palette] +#@cli pr_da@b: image_1,image_2,... +#@cli : Create alpha-blended images using existing images and insert onto the last list. If no arguments are specified, all images are blended as a new layer. +pr_dab : +if $!>1 +if $#>1 +blend[$*] alpha +else +blend alpha +fi +fi +display +#@cli pr_deform : _amplitude>=0,_seed>=0,_scale>0.3,_interpolation,_mode,_boundary_conditions +#@cli : "Apply random or seeded smooth deformation on images. +#@cli : 'seed' can be { 0=random) | >0=fixed seed }. +#@cli : 'interpolation' can be { 0=none | 1=linear | 2=bicubic }. +#@cli : 'mode' can be { 0:backward-absolute | 1:backward-relative | 2:forward-absolute | 3:forward-relative }. +#@cli : 'boundary_conditions' can be { 0:dirichlet | 1:neumann | 2:periodic | 3:mirror }. +#@cli : Default value: 'amplitude=10', 'seed=0', 'scale=1', 'interpolation=2', 'mode=1', 'boundary_conditions=1' +#@cli : $ image.jpg +pr_deform[0] 10 +pr_deform[0] 20,777,5,2,3,3 +pr_deform : skip ${1=10},${2=0},${3=1},${4=2},${5=1},${6=1} +e[^-1] "Apply random smooth deformation on image$?, with amplitude $1, seed $2, scale $3, interpolation $4, mode $5 and boundary conditions $6" +if $3<=0 dim=0.3 else dim=$3 fi +foreach { $dim%,$dim%,1,2 if $2 srand $2 fi noise. $1 r. ..,..,1,2,6 warp.. .,$5,$4,$6 rm. } +pr_streeze : skip "${1=10},${2=20},${3=20},${4=80},${5=80},${6=20},${7=80},${8=120},${9=0},${10=2},${11=0},${12=1}" +foreach { +vx,vy:=w,h +if $9==0||$9==2 axis,rx,ry,rxb,ryb=x,$5,100,$8,100 fi +if $9==1 axis,rx,ry,rxb,ryb=y,100,$5,100,$8 fi +repeat 2 { +repeat $1 { +s $axis,$2 +l[0%-$3%,$4%-100%] { r $rx%,$ry%,100%,100%,{$10+1},1 } +l[$6%-$7%] { r $rxb%,$ryb%,100%,100%,{$10+1},1 } +a $axis r $vx,$vy,100%,100%,{$10+1},1 +if $11 w wait $12 fi +} +if $9==2 axis,rx,ry,rxb,ryb=y,100,$5,100,$8 else break fi +} +} +pr_streeze_preview : +pr_streeze $* +uglify : +com,origres,procres,dccires,preset,bst,bstsharp,bstblur,locnorm,filt,dist,distblur,distmerge,diststr,wc,bilsize,bilrep,fuzz,fuzzblur,fuzstr,plsmseed,plsmsat,plsmblur,plasmerge,plastr,cracks,sckrad,sck,lgtone,lgttwo,lgthree,sketch,sklike,cutmin,cutmax,linthick,linestr,brkstr,wl,wldef,skmerge,noistr,cnvs,cvmod,cvr,cvg,cvb,cva,post,emboss,huestr,bri,con,gam,hue,sat=${1-56} +arg0 $distmerge,"add","and","average","blue","burn","darken","difference","divide","dodge","exclusion","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor" +distmerge=${} +arg0 $plasmerge,"add","and","average","blue","burn","darken","difference","divide","dodge","exclusion","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor" +plasmerge=${} +arg0 $skmerge,"add","and","average","blue","burn","darken","difference","divide","dodge","exclusion","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor" +skmerge=${} +foreach { +to_rgba +nm[0] ORIG +__ORIGW={0,w} +__ORIGH={0,h} +if !$origres res=$procres,$procres rr2d[ORIG] $res,0,6 fi +n 0,255 +if $bst +if $bstblur b $bstblur fi +if $bstsharp sharpen $bstsharp fi +if $locnorm normalize_local $locnorm,$locnorm fi +fi +[ORIG] nm. REND +if $filt +if $diststr +[ORIG] nm. FILT +l[REND,FILT] { +usrmod=$dist,$distblur +if [$usrmod]!=[0,0] +if $dist apc. "pr_deform $dist" fi +if $distblur b. $distblur fi +blend[REND,FILT] $distmerge,$diststr +n[REND] 0,255 +fi +} +fi +fi +if $wc +if $plastr +[ORIG] nm. PLAS +l[PLAS] { +if $plsmseed>-1 srand $plsmseed fi +plasma 1,2,5 +if $plsmsat!=0 adjust_colors 0,0,0,0,$plsmsat fi +if $plsmblur>0 b $plsmblur fi +} +blend[REND,PLAS] $plasmerge,$plastr +fi +if $fuzz +[ORIG] nm. FUZZ +l[FUZZ] { +fc 255,255,255 +rectangle $fuzz%,$fuzz%,{100-$fuzz}%,{100-$fuzz}%,1,0 +if $fuzzblur b $fuzzblur,0 fi +repeat 10 { +pr_deform $fuzz +spread {[$fuzz/2,$fuzz/2]} +} +if $fuzstr!=1 mul $fuzstr fi +} +blend_median[REND,FUZZ] fi +fi +local[REND] +if $cracks +if $sckrad pr_deform 1.5 sharpen $sckrad,$sck dilate_oct 1.5 sharpen $sckrad,$sck fi +if $lgtone +repeat 3 { +fx_light_relief $lgtone,$lgttwo,$lgthree,0,0.2,50,50,20,0.084,0,0 +b 2 erode_oct 3 sharpen $sckrad +} +fi +fi +if $wc +if $bilrep>0 +repeat $bilrep { +pr_deform {0,w/1000} bilateral $bilsize,$bilsize,$bilsize,$bilsize +} +fi +fi +done +if $post +if $huestr +[ORIG] nm. HUE +[ORIG] nm. SAT +b[HUE,SAT] 5 +blend[HUE,REND] hue,$huestr +blend[SAT,REND] saturation,$huestr +fi +fi +if $sketch +if $linestr>0 +[ORIG] nm. LINE +l[LINE] { +if $__ORIGW/2>1500 r 50%,50%,100%,100%,6 fi +pr_deform {0,w/2000} rolling_guidance {31-$sklike},20,0 +if $__ORIGW/2>1500 r 200%,200%,100%,100%,6 fi +gradient_norm negate +if $brkstr>0 +. repeat 2 fx_breaks. 1,5,20,0,3 done +blend[-1,-2,LINE] multiply,$brkstr +fi +if $linthick +erode_circ. {$linthick/2} +spread. {$linthick/10} +dilate_circ. {$linthick/10} +b. {$linthick/5} +if $linthick/5>=3 sharpen. {$linthck*100} else sharpen. 100 fi +fi +adjust_colors. ,$cutmin,$cutmax,, n. 0,255 spread. 0.5 ++store. line +} +split[REND] c a[1,2,3] c +blend[LINE,REND] $skmerge,$linestr +if $wl>0 +$line negate. erode_circ. {$linthick/2} +if $wldef pr_deform. $wldef fi +. blend[REND,LINE] or,$wl blend[-1,-2] add,1 +fi +a[REND] [-1],c +fi +fi +n[REND] 0,255 +keep[REND] +if $post +usrmod=$bri,$con,$gam,$hue,$sat +if [$usrmod]!=[0,0,0,0,0] adjust_colors[REND] $bri,$con,$gam,$hue,$sat fi +fi +if $dccires repeat $dccires { r 200%,200%,100%,100%,6 } fi +if $noistr fx_noise $noistr,0,11,1,0,50,50 fi +if $cnvs pr_canvas[REND] $cnvs,$cvmod,1,$cvr,$cvg,$cvb,$cva fi +if $post +if $emboss rep_emboss_relief 5,0,0.5,$emboss,1,0,1 fi +fi +if $com +expand_y 35,0 +shift 0,35 +text "${1--1}",10,30,12,1,255 +text $distmerge" "$plasmerge" "$skmerge,10,50,20,1,255 +fi +} +uglify_preview : +__output=${1--2} +preset,old_preset={[$5,${-1}]} +if $preset==1 +variables=0,1,1000,0,1,0,0,0,0,0,0,0,13,0,0,0,0,0,0,0,-1,-100,0,23,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,22,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0 +elif $preset==2 +variables=0,1,1000,0,2,1,0,2,0,1,20,10,7,0.4,1,12,2,127,42,0.365,-1,0,0,11,0.5,1,1,0,0.01,0.02,0.02,1,30,0,0,5,1,0,1,4,22,6,0,0,255,255,255,255,1,0,0.8,0,0,9,0,0 +elif $preset==3 +variables=0,1,1000,0,3,0,0,0,0.3,1,3,3,13,0.5,1,12,1,0,20,0.5,-1,-100,0,37,0.755,1,500,1,0.027,0.02,0.02,1,25,0,0,2,1,0.9,1,4,22,6,0.3,0,255,255,255,255,1,1.5,1,0,0,31,0,0 +elif $preset==4 +variables=0,1,1000,0,0,1,500,0,0.366,0,3,3,13,0.5,1,10,0,0,0,0.5,-1,80,0,7,0.2,1,0,1,0.134,0.02,0.02,1,29,0,0,0,0.707,0,1,1.6,19,6,0.61,11,255,255,255,255,1,1.1,0,0,0,0,0,-100 +elif $preset==5 +variables=0,1,1000,0,0,1,308,0,2.3736,1,3,3,0,0.5,1,23,2,350,1,0.5,-1,100,0,10,1,1,0,1,0.2,0.02,0.02,1,29,0,0,2,0.9,1,1,1.6,22,6,1,19,134,110,71,255,1,1,0,0,0,13.4,0,-100 +elif $preset==6 +variables=0,1,1000,0,0,0,0,0,0.3,0,3,3,13,0.5,1,12,0,0,20,0.5,437767,-100,19.75,37,1,1,500,0,0.021,0.02,0.02,1,20,0,0,4,1,1,1,4,13,0,0,16,125,125,125,255,1,0.965,1,0,-47.6,0,0,0 +fi +if $preset +if $preset==$old_preset +if [$__output]!=[$variables] +__output=${1-4},0,${6--2} +fi +else +__output=$variables +fi +fi +com,origres,procres,dccires,preset,bst,bstsharp,bstblur,locnorm,filt,dist,distblur,distmerge,diststr,wc,bilsize,bilrep,fuzz,fuzzblur,fuzstr,plsmseed,plsmsat,plsmblur,plasmerge,plastr,cracks,sckrad,sck,lgtone,lgttwo,lgthree,sketch,sklike,cutmin,cutmax,linthick,linestr,brkstr,wl,wldef,skmerge,noistr,cnvs,cvmod,cvr,cvg,cvb,cva,post,emboss,huestr,bri,con,gam,hue,sat=$__output +uglify $__output +u "{"$com"}""{"$origres"}""{"$procres"}""{"$dccires"}""{"$preset"}""{"$bst"}""{"$bstsharp"}""{"$bstblur"}""{"$locnorm"}""{"$filt"}""{"$dist"}""{"$distblur"}""{"$distmerge"}""{"$diststr"}""{"$wc"}""{"$bilsize"}""{"$bilrep"}""{"$fuzz"}""{"$fuzzblur"}""{"$fuzstr"}""{"$plsmseed"}""{"$plsmsat"}""{"$plsmblur"}""{"$plasmerge"}""{"$plastr"}""{"$cracks"}""{"$sckrad"}""{"$sck"}""{"$lgtone"}""{"$lgttwo"}""{"$lgthree"}""{"$sketch"}""{"$sklike"}""{"$cutmin"}""{"$cutmax"}""{"$linthick"}""{"$linestr"}""{"$brkstr"}""{"$wl"}""{"$wldef"}""{"$skmerge"}""{"$noistr"}""{"$cnvs"}""{"$cvmod"}""{"$cvr,$cvg,$cvb,$cva"}""{"$post"}""{"$emboss"}""{"$huestr"}""{"$bri"}""{"$con"}""{"$gam"}""{"$hue"}""{"$sat"}""{"$preset"}" +fx_rep_array_random_jumble_by_px: +if narg($_persistent) +remove +$_persistent +else +fx_rep_array_random_jumble_by_px_preview $* +fi +fx_rep_array_random_jumble_by_px_preview: +contain_persistent,link_dimensions={narg($_persistent)},$5 +if $contain_persistent +list_of_widths_factors=$11 +list_of_heights_factors=$12 +list_of_widths_and_heights_factors=$13 +number_of_widths_factors,number_of_heights_factors,number_of_widths_and_heights_factors=${14-16} +else +list_of_widths={expr('w#x',$!)} +list_of_heights={expr('h#x',$!)} +list_of_widths_and_heights=$list_of_widths,$list_of_heights +list_of_widths_factors=${rep_find_factors_of\ $list_of_widths} +list_of_heights_factors=${rep_find_factors_of\ $list_of_heights} +list_of_widths_and_heights_factors=${rep_find_factors_of\ $list_of_widths_and_heights} +number_of_widths_factors:=narg($list_of_widths_factors) +number_of_heights_factors:=narg($list_of_heights_factors) +number_of_widths_and_heights_factors:=narg($list_of_widths_and_heights_factors) +fi +enforce_factors={$contain_persistent?$6} +if $enforce_factors +tile_w,tile_h=${1-2} +if $link_dimensions +if $number_of_widths_and_heights_factors==1 error no_common_factors fi +if $tile_w!=$tile_h +tile_dim:=u(0,1,0,0)<.5?$tile_h:$tile_w +elif $tile_w!=$3 +tile_dim=$tile_w +elif $tile_h!=$4 +tile_dim=$tile_h +else +tile_dim=$tile_w +fi +tile_dim=${rep_closest_number_in_ordered_list_of_numbers\ $tile_dim,$list_of_widths_and_heights_factors} +tile_w,tile_h=$tile_dim +else +tile_w=${rep_closest_number_in_ordered_list_of_numbers\ $tile_w,$list_of_widths_factors} +tile_h=${rep_closest_number_in_ordered_list_of_numbers\ $tile_h,$list_of_heights_factors} +fi +else +if $link_dimensions +if $1!=$3 +tile_w,tile_h=$1 +elif $2!=$4 +tile_w,tile_h=$2 +else +tile_w,tile_h={$1==$2?$1:(u(0,1,1,0)<.5?$1:$2)} +fi +else +tile_w,tile_h=${1-2} +fi +fi +shuffle_images={$7||($tile_w!=$3)||($tile_h!=$4)||!$contain_persistent} +tile_dims=$tile_w,$tile_h +if $shuffle_images +foreach { +mini_image_width,mini_image_height={ceil([w,h]/[$tile_dims])} +if $mini_image_width==1&&$mini_image_height==1 continue fi +new_image_width,new_image_height={[$mini_image_width,$mini_image_height]*[$tile_dims]} +refit_image={$new_image_width!=w||$new_image_height!=h} +if $refit_image +ow,oh={[w,h]} +resize $new_image_width,$new_image_height,100%,100%,0,2,.5,.5 +fi +$new_image_width,$new_image_height,100%,100% +$mini_image_width,$mini_image_height,1,2,"begin( +const mini_w=$tile_w; +const mini_h=$tile_h; +); +cx=x*mini_w; +cy=y*mini_h; +[cx,cy];" +gcd_shuffle[-1] +eval[-1] :"begin( +const mini_w=$tile_w; +const mini_h=$tile_h; +const depth=d#0; +const spectrum=s#0; +); +tile=crop(#0,i0,i1,0,0,mini_w,mini_h,depth,spectrum); +draw(#1,tile,x*mini_w,y*mini_h,0,0,mini_w,mini_h,depth,spectrum); +I;" +keep[1] +if $refit_image +start_x,start_y:=int(([$new_image_width,$new_image_height]-[$ow,$oh])>>1) +end_x,end_y:=[$start_x,$start_y]+([$ow,$oh]-1) +crop $start_x,$start_y,$end_x,$end_y +fi +} +store _persistent +else +remove +fi +$_persistent +if '$_host'!='$cli' +crop $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1 +fi +factors_display_mode={1+!$link_dimensions} +u "{"$tile_w"}""{"$tile_h"}""{"$tile_w"}""{"$tile_h"}""{$5}""{"$enforce_factors"}""{0}""{"$list_of_widths_factors"}_"$factors_display_mode"{"$list_of_heights_factors"}_"$factors_display_mode"{"$list_of_widths_and_heights_factors"}""{"$list_of_widths_factors"}""{"$list_of_heights_factors"}""{"$list_of_widths_and_heights_factors"}""{"$number_of_widths_factors"}""{"$number_of_heights_factors"}""{"$number_of_widths_and_heights_factors"}" +fx_rep_trsa: +skip ${18=0},${19=1} +local[-1] { +ww={w} hh={h} +channels 0 f 0 +r2dx {$17*100}% +rep_trsa $1,{$2*$17},${3-12},$19 +u {${}/wh#-1} +n 0,1 +if $14 r 100%,100%,100%,2 fi +if $14<1 f [i^(1/$15)] +else f i^(1/$15) +fi +r $ww,$hh,1,{s},2 +* 255 * $16 +} +fx_rep_trsa_preview: +param1,param2,param3,param4,param5,param6,param7,param8,param9=$4,$5,$6,$7,$8,$9,$10,$11,$12 +if $13 +param1,param2,param3,param4,param5,param6,param7,param8,param9={[u(-1,1),u(-1,1),u(-1,1),u(-1,1),u(-1,1),u(-1,1),u(-1,1),u(-1,1),u(-1,1)]} +fi +fx_rep_trsa ${1-3},$param1,$param2,$param3,$param4,$param5,$param6,$param7,$param8,$param9,0,${14-17},,0 +fill_decimal={${}} +fill_perc={round($fill_decimal*10000)/100} +if $18 to $fill_perc"%" fi +a={$1!=3?2} +b={$1>3?2} +c={$1==5?2} +u "{$1}""{$2}""{$3}""{"$param1"}""{"$param2"}""{"$param3"}_"$a"{"$param4"}_"$a"{"$param5"}_"$b"{"$param6"}_"$b"{"$param7"}_"$c"{"$param8"}_"$c"{"$param9"}_"$c"{0}""{$14}""{$15}""{$16}""{$17}""{$18}" +gui_rep_acb: rep_acb {$1/255},$2,$3,{$4/255},$5 +gui_rep_acb_preview: +gui_split_preview "gui_rep_acb $*",${-3--1} +gui_axis_streak: +if $1 rep_axis_streak $1,!$3,$4%,255 +else rep_axis_streak $1,$2,$4%,255 +fi +gui_axis_streak_preview: +gui_split_preview "gui_axis_streak ${1-4}",${-3--1} +u "{$1}""{$2}"_{$1?0:2}"{$3}"_{$1?2:0}"{$4}""{$5,$6}""{$7}" +rep_binary_quaddro_basic_gui: +if $1==0 rep_binaltquad ${2-12} % 256 +elif $1==1 +foreach { +rep_binaltquad ${2-9},${13-14},1 % 361 ++f 1 +[-1] +a c +hsv2rgb +} +elif $1==2 +foreach { ++rep_binaltquad ${2-9},{w*h-1},{w*h-1} +f.. I[i#1] +k.. +} +fi +rep_binary_quaddro_basic_gui_preview: +rep_binary_quaddro_basic_gui $* +a={$2!=2?2:0} +b={$1==0?2:0} +c={$1==1?2:0} +u "{$1}""{$2}""{$3}""{$4}""{$5}_"$a"{$6}_"$a"{$7}""{$8}""{$9}""{$10}_"$b"{$11}_"$b"{$12}_"$b"{$13}_"$c"{$14}_"$c +rep_binary_quaddro_mc_gui: +cs_mode=$1 +cmyk_mode={$cs_mode==3?4:3} +contain_alpha={$2?1:0} +tch={$cmyk_mode+$contain_alpha} +if $tch==3 rep_binary_alterating_quad_c $1,$2,$3,$4,$5,$6,${14-42} +elif $tch==4 rep_binary_alterating_quad_c $1,$2,$3,$7,$8,$9,$10,${15-51} +else rep_binary_alterating_quad_c $1,$2,$3,$11,$12,$13,$14,$15,${16-60} +fi +rep_binary_quaddro_mc_gui_preview: +cs_mode=$1 +cmyk_mode={$1==3?4:3} +contain_alpha={$2?1:0} +tch={$cmyk_mode+$contain_alpha} +rep_binary_quaddro_mc_gui $* +set_a={$tch==3?2:0} +set_b={$tch==4?2:0} +set_c={$tch==5?2:0} +set_d={$16!=2?2:0} +set_e={$24!=2?2:0} +set_f={$34!=2?2:0} +set_g={$tch>=4?2:0} +set_h={$tch>=4?($43!=2?2:0):0} +set_i={$tch>=5?($43!=2?2:0):0} +set_j={$tch>=5?2:0} +u "{$1}""{$2}""{$3}_"{(($cs_mode>8&&$cs_mode<11)||$cs_mode<=3)?0:2}"{$4}_"$set_a"{$5}_"$set_a"{$6}_"$set_a"{$7}_"$set_b"{$8}_"$set_b"{$9}_"$set_b"{$10}_"$set_b"{$11}_"$set_c"{$12}_"$set_c"{$13}_"$set_c"{$14}_"$set_c"{$15}_"$set_c"{$16}""{$17}""{$18}""{$19}_"$set_d"{$20}_"$set_d"{$21}""{$22}""{$23}""{$24}""{$25}""{$26}""{$27}""{$28}_"$set_e"{$29}_"$set_e"{$30}""{$31}""{$32}""{$33}""{$34}""{$35}""{$36}""{$37}_"$set_f"{$38}_"$set_f"{$39}""{$40}""{$41}""{$42}""{$43}_"$set_g"{$44}_"$set_g"{$45}_"$set_g"{$46}_"$set_h"{$47}_"$set_h"{$48}_"$set_g"{$49}_"$set_g"{$50}_"$set_g"{$51}_"$set_g"{$52}_"$set_j"{$53}_"$set_j"{$54}_"$set_j"{$55}_"$set_i"{$56}_"$set_i"{$57}_"$set_j"{$58}_"$set_j"{$59}_"$set_j"{$60}_"$set_j +fx_rep_bitplane_shuffle: +skip "$*" +if narg($_persistent) +if $3 +if $2 * 257 fi +$_persistent channels. $1 +map[^-1] [-1] rm. +if $2 / 257 fi +else +$_persistent channels. $1 store. _persistent +foreach { +if !(s&1) sh 0,{s-2} fi +if $2 *. 257 fi +$_persistent +map[-2] [-1] rm. +if $2 /. 257 fi +k[0] +} +fi +else rep_bitplane_shuffle {![$1,$3]},$cli_base +fi +fx_rep_bitplane_shuffle_preview: +skip "${4=}" +cli_base="$5" +activate_randomize=$58 +use_reverse_permutation,mode_16,mode_alpha,index_8,index_16,old_mode_16,old_index_8=${1-3},$6,$8,$59,$7 +if narg($_persistent) visited_8,visited_16=$60,$61 +else visited_8,visited_16=0 +fi +plane_8_series=plane_8_0,plane_8_1,plane_8_2,plane_8_3,plane_8_4,plane_8_5,plane_8_6,plane_8_7 +plane_16_series=plane_16_0,plane_16_1,plane_16_2,plane_16_3,plane_16_4,plane_16_5,plane_16_6,plane_16_7,plane_16_8,plane_16_9,plane_16_a,plane_16_b,plane_16_c,plane_16_d,plane_16_e,plane_16_f +$plane_8_series=${10-17} +$plane_16_series=${26-41} +persistent_change,depth_changed=0,{$mode_16!=$old_mode_16} +if $mode_16 +activate_randomize|=!$visited_16?!$index_16 +shift_plane={"a=[${26-41}]; +b=[${42-57}]; +diff_mode=a!=b; +if(diff_mode, +const use_swap_mode=$9; +diff_pos=argmax(abs(a-b)); +use_swap_mode?( +swap_pos=find(b,a[diff_pos],0,1); +swap(b[diff_pos],b[swap_pos]); +set('order',v2s(b-1)); +):( +position_start=b[diff_pos]; +position_final=a[diff_pos]; +differential=position_final=$index_16;); +order=${rep_permutation_index2list\ 16,$index_16} +elif $shift_plane +index_16=${rep_permutation_list2index\ $order} +elif $depth_changed||!$visited_16 +order={[${26-41}]-1} +inverse_order=${rep_inverse_permutation\ $order} +fi +if $persistent_change +$plane_16_series:=[$order]+1 +inverse_order=${rep_inverse_permutation\ $order} +cli_base=$order +fi +if $persistent_change||$depth_changed||!$visited_16 +65536,1,1,2,sum((x>>[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]&1)<<(c?[$inverse_order]:[$order])) +store. _persistent +cli_base=$order +fi +visited_16=1 +else +activate_randomize|=!$visited_8?!$index_8 +index_change:=$index_8!=$old_index_8 +shift_plane={"a=[${10-17}]; +b=[${18-25}]; +diff_mode=a!=b; +if(diff_mode, +const use_swap_mode=$9; +diff_pos=argmax(abs(a-b)); +use_swap_mode?( +swap_pos=find(b,a[diff_pos],0,1); +swap(b[diff_pos],b[swap_pos]); +set('order',v2s(b-1)); +):( +position_start=b[diff_pos]; +position_final=a[diff_pos]; +differential=position_final=$index_8;); +index_change=1 +fi +if $index_change +order=${rep_permutation_index2list\ 8,$index_8} +elif $shift_plane +index_8=${rep_permutation_list2index\ $order} +elif $depth_changed||!$visited_8 +order={[${10-17}]-1} +inverse_order=${rep_inverse_permutation\ $order} +fi +if $persistent_change +$plane_8_series:=[$order]+1 +inverse_order=${rep_inverse_permutation\ $order} +cli_base=$order +fi +if $persistent_change||$depth_changed||!$visited_8 +256,1,1,2,sum((x>>[0,1,2,3,4,5,6,7]&1)<<(c?[$inverse_order]:[$order])) +store. _persistent +cli_base=$order +fi +visited_8=1 +fi +cli_text=image.jpg\ rep_bitplane_shuffle\ {![$use_reverse_permutation,$mode_alpha]},$cli_base +if $mode_16?$index_16:$index_8 +gui_split_preview " +round 0 +if "$mode_16" * 257 fi +if !"$mode_alpha"&&(!(s&1)) shared 0,{s-2} fi +$_persistent +channels. "$use_reverse_permutation" +map[-2] [-1] +k[0] +if "$mode_16" / 257 fi +",${-3--1} +else gui_split_preview "skip \"$*\"",${-3--1} +fi +visible_8,visible_16:=[!$mode_16,$mode_16]<<1; +u "{"$use_reverse_permutation"}""{"$mode_16"}""{$3}""{"$cli_text"}""{"$cli_base"}""{"$index_8"}_"$visible_8"{"$index_8"}""{"$index_16"}""{$9}""{"$plane_8_0"}_"$visible_8"{"$plane_8_1"}_"$visible_8"{"$plane_8_2"}_"$visible_8"{"$plane_8_3"}_"$visible_8"{"$plane_8_4"}_"$visible_8"{"$plane_8_5"}_"$visible_8"{"$plane_8_6"}_"$visible_8"{"$plane_8_7"}_"$visible_8"{"$plane_8_0"}""{"$plane_8_1"}""{"$plane_8_2"}""{"$plane_8_3"}""{"$plane_8_4"}""{"$plane_8_5"}""{"$plane_8_6"}""{"$plane_8_7"}""{"$plane_16_0"}_"$visible_16"{"$plane_16_1"}_"$visible_16"{"$plane_16_2"}_"$visible_16"{"$plane_16_3"}_"$visible_16"{"$plane_16_4"}_"$visible_16"{"$plane_16_5"}_"$visible_16"{"$plane_16_6"}_"$visible_16"{"$plane_16_7"}_"$visible_16"{"$plane_16_8"}_"$visible_16"{"$plane_16_9"}_"$visible_16"{"$plane_16_a"}_"$visible_16"{"$plane_16_b"}_"$visible_16"{"$plane_16_c"}_"$visible_16"{"$plane_16_d"}_"$visible_16"{"$plane_16_e"}_"$visible_16"{"$plane_16_f"}_"$visible_16"{"$plane_16_0"}""{"$plane_16_1"}""{"$plane_16_2"}""{"$plane_16_3"}""{"$plane_16_4"}""{"$plane_16_5"}""{"$plane_16_6"}""{"$plane_16_7"}""{"$plane_16_8"}""{"$plane_16_9"}""{"$plane_16_a"}""{"$plane_16_b"}""{"$plane_16_c"}""{"$plane_16_d"}""{"$plane_16_e"}""{"$plane_16_f"}""{0}""{"$mode_16"}""{"$visited_8"}""{"$visited_16"}""{$-3}""{$-2,$-1}" +fx_rep_blur_splinter: +rep_blur_splinter $1%,$2,$3,$4%,{$6%},{$5%},$7,$8 cut 0,255 +fx_rep_blur_splinter_preview: +gui_split_preview "fx_rep_blur_splinter ${1-8}",${-3--1} +gui_rep_shape_brick: +-m "MergeChoice : $""=_mode" -MergeChoice "add","alpha","and","average","blue","burn","darken","difference","divide","dodge","exclusion","freeze","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor","edges","error" +foreach { +to_a +rep_shape_brick $1,$2,$3,$4,$5,$9,$10,$6%,$7,$8,$26 +n. 0,1 +r. {w#-2},{h#-2},100%,{s#-2},0,2,0,0 +if $5 ($19,$15,$11^$20,$16,$12^$21,$17,$13^$22,$18,$14) +else ($19,$11^$20,$12^$21,$13^$22,$14) +fi +r. {($26+1)*100}%,100%,100%,100%,3 +f.. i(#-1,(w#-1-1)*i,0,z,c,3) rm. +if $23 blend ${_mode{$24+1}},{$25%} +else k. +fi +} +fx_rep_cstdmap: +srand $15 +if $10==4 $14,1,1,1,u(0,1) store. randorder fi +ww={w} +hh={h} +ld={w>h} +md={max(w,h)} +ti={$!-1} +rep_cstdmap {$9?-1*$8*100:$8*100}%,${1-7} ++f. i?1 store. chan +if $10==0 +if $11 +eq. 0 negate. -.. 1 *.. . n.. 0,255 *. 255 a[-2,-1] c +else n. 0,255 +fi +elif $10==1 -. 1 *. {359.999999/iM#-1} $chan . if $11 . *. 255 fi a[^0-$ti] c +if $12==0 sh. 2 *. .5 rm. hcy2rgb. +elif $12==1 hsi2rgb. +elif $12==2 hsv2rgb. +fi +elif $10==2 r. 100%,100%,1,3,1 pal {$13+1} f.. i0?i(#-1,(i-1)%w#-1,0) rm. if $11 $chan *. 255 a[-2,-1] c fi +elif $10==3 r. 100%,100%,1,3,1 $14,1,1,3,u(0,255) f.. i0?i(#-1,(i-1)%w#-1,0) rm. if $11 $chan *. 255 a[-2,-1] c fi +elif $10==4 +channels[0] 0,2 +colormap. $14,0,0 rm.. $randorder pixelsort.. +,x,[-1] rm. r.. 100%,100%,1,3 f.. i0?i(#-1,(i-1)%w#-1,0) rm. if $11 $chan *. 255 a[-2,-1] c fi +fi +if $8<1 +if $ld r. {$ww*($6?($4&&$5?2:1):1)},{max($hh,$md)*($6?($4&&$5?2:1):1)},100%,100%,0,2,.5,.5 +else r. {max($ww,$md)*($6?($4&&$5?2:1):1)},{$hh*($6?($4&&$5?2:1):1)},100%,100%,0,2,.5,.5 +fi +elif $8>1 +if !$9 r. {$md*($6?($4&&$5?2:1):1)},{$md*($6?1:($4&&$5?2:1))},100%,100%,6 +else r. {$ww*($6?($4&&$5?2:1):1)},{$hh*($6?1:($4&&$5?2:1))},100%,100%,6 +fi +fi +mv. 0 +if '$host'=='paintdotnet' k[0] fi +fx_rep_cstdmap_preview: +fx_rep_cstdmap $* +set_a={(($10==3)||($10==4))?2:0} +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}""{$9}""{$10}""{$11}""{$12}_"{$10==1?2:0}"{$13}_"{$10==2?2:0}"{$14}_"$set_a"{$15}_"$set_a +fx_rep_color_harmonies_preview: +_hsl_h,_hsl_s,_hsl_l,_rgb_0_r,_rgb_0_g,_rgb_0_b,_rgb_1_r,_rgb_1_g,_rgb_1_b,_rgb_2_r,_rgb_2_g,_rgb_2_b,_rgb_3_r,_rgb_3_g,_rgb_3_b,_rgb_4_r,_rgb_4_g,_rgb_4_b,_rgb_5_r,_rgb_5_g,_rgb_5_b,_rgb_0_r_alt,_rgb_0_g_alt,_rgb_0_b_alt,_rgb_1_r_alt,_rgb_1_g_alt,_rgb_1_b_alt,_rgb_2_r_alt,_rgb_2_g_alt,_rgb_2_b_alt,_rgb_3_r_alt,_rgb_3_g_alt,_rgb_3_b_alt,_rgb_4_r_alt,_rgb_4_g_alt,_rgb_4_b_alt,_rgb_5_r_alt,_rgb_5_g_alt,_rgb_5_b_alt,_hsl_0_h,_hsl_0_s,_hsl_0_l,_hsl_1_h,_hsl_1_s,_hsl_1_l,_hsl_2_h,_hsl_2_s,_hsl_2_l,_hsl_3_h,_hsl_3_s,_hsl_3_l,_hsl_4_h,_hsl_4_s,_hsl_4_l,_hsl_5_h,_hsl_5_s,_hsl_5_l,_point_x_0,_point_y_0,folder_name,basename,console_message,console_mode,old_preview_area_width,old_preview_area_height=${1-3},${6-23},${30-65},$24,$25,"$74","$75","$78",${79-81} +use_persistence={narg($_persistent)&&([$2,$4,$26,$27]==[$49,$66,$68,$69])&&([$_preview_area_width,$_preview_area_height]==[$old_preview_area_width,$old_preview_area_height])} +rm +if !$use_persistence $_preview_area_width,$_preview_area_height fi +command "draw_points : +eval[1] \"begin( +const radius=9; +const colsize=sqr(radius)*3; +blkcol=vector(#colsize,128); +circle_alpha_component=expr('begin( +const ww=w-1; +const hh=h-1; +const cx=ww/2; +const cy=hh/2; +); +xx=(x-cx)/cx; +yy=(y-cy)/cy; +inrange(norm(xx,yy),.4,1,1);' +,radius,radius,1,1); +); +m=(I/100)*[w#0,h#0]; +if(x, +draw(#0,blkcol,round(m[0])-6,round(m[1])-6,0,0,radius,radius,1,3,1,circle_alpha_component,1); +); +\" +" +command "gen_pt_info : +width,height={w#0},{h#0} +local[-2] { +lightness={i(#-1,0,0,0,2)} +{w},{h},{d},2,\"begin( +const scale=$27%; +const lightness=($lightness+100)/200; +const width=$width; +const height=$height; +const ww=width-1; +const hh=height-1; +const cx=ww/2; +const cy=hh/2; +const ref_dim=min(cx,cy); +const max_length=ref_dim*scale; +const min_length=max_length*$26/100; +const length=lerp(min_length,max_length,lightness); +); +rad_ang=((360-i(#-1,x,0,0,0))-90)°; +center=[cx,cy]; +off=[cos(rad_ang)*length,sin(rad_ang)*length]; +point=center+off; +point[0]/=ww; +point[1]/=hh; +point*=100;\" +_point_x_0,_point_y_0={I(#-1,0)} +rv +} +draw_points " +command "g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_hsl_1_l,_hsl_2_l,_hsl_3_l,_hsl_4_l={crop(#-2)} +_rgb_0_r,_rgb_1_r,_rgb_2_r,_rgb_3_r,_rgb_4_r,_rgb_0_g,_rgb_1_g,_rgb_2_g,_rgb_3_g,_rgb_4_g,_rgb_0_b,_rgb_1_b,_rgb_2_b,_rgb_3_b,_rgb_4_b={crop(#-1)} +_rgb_0_r_alt,_rgb_1_r_alt,_rgb_2_r_alt,_rgb_3_r_alt,_rgb_4_r_alt,_rgb_0_g_alt,_rgb_1_g_alt,_rgb_2_g_alt,_rgb_3_g_alt,_rgb_4_g_alt,_rgb_0_b_alt,_rgb_1_b_alt,_rgb_2_b_alt,_rgb_3_b_alt,_rgb_4_b_alt={crop(#-1)} +elif w==6 +_hsl_0_h,_hsl_1_h,_hsl_2_h,_hsl_3_h,_hsl_4_h,_hsl_5_h,_hsl_0_s,_hsl_1_s,_hsl_2_s,_hsl_3_s,_hsl_4_s,_hsl_5_s,_hsl_0_l,_hsl_1_l,_hsl_2_l,_hsl_3_l,_hsl_4_l,_hsl_5_l={crop(#-2)} +_rgb_0_r,_rgb_1_r,_rgb_2_r,_rgb_3_r,_rgb_4_r,_rgb_5_r,_rgb_0_g,_rgb_1_g,_rgb_2_g,_rgb_3_g,_rgb_4_g,_rgb_5_g,_rgb_0_b,_rgb_1_b,_rgb_2_b,_rgb_3_b,_rgb_4_b,_rgb_5_b={crop(#-1)} +_rgb_0_r_alt,_rgb_1_r_alt,_rgb_2_r_alt,_rgb_3_r_alt,_rgb_4_r_alt,_rgb_5_r_alt,_rgb_0_g_alt,_rgb_1_g_alt,_rgb_2_g_alt,_rgb_3_g_alt,_rgb_4_g_alt,_rgb_5_g_alt,_rgb_0_b_alt,_rgb_1_b_alt,_rgb_2_b_alt,_rgb_3_b_alt,_rgb_4_b_alt,_rgb_5_b_alt={crop(#-1)} +fi" +console_mode=1 +if ([${1-3}]!=[${48-50}])||($4!=$66)||($5!=$67) +if $use_persistence $_persistent +else +rep_create_hsl_color_select $2%,{$26/100},$4,{$27/100} ++store. _persistent +fi ++rep_color_harmony_palette $1,{$2/100},{$3/100},$5,{$4+2} +sh.. 2 *. 200 -. 100 sh... 1 *. 100 rm[-2,-1] +gen_col_info gen_pt_info +elif [${6-23}]!=[${30-47}] +eval " +vec_a=[${6-23}]; +vec_b=[${30-47}]; +repeat(arg(1+$5,6,6,6,2,3,3,4,3,4,5,6),p, +a=(vec_a)[3*p,3]; +b=(vec_b)[3*p,3]; +a!=b?( +v=p; +set('col_a',v2s(a)); +set('col_b',v2s(b)); +break(); +); +); +v;" +1,1,1,3,([${6-23}])[3*${},3] +1,1,1,3,([${30-47}])[3*${},3] +if $4 +rgb2ryb[-2,-1] +rgb2hsl[-2,-1] +else +rgb2hsl[-2,-1] +fi +hsl_base={" +fmod(a)=a-360*floor(a/360); +rescale_lightness(a)=(a+100)/200; +new_col=crop(#-2); +old_col=crop(#-1); +diff=new_col-old_col; +out_hsl=[${1-3}]; +out_hsl[1]/=100; +out_hsl[2]=rescale_lightness(out_hsl[2]); +out_hsl+=diff; +out_hsl[2]=cut(out_hsl[2]*2-1,-1,1); +out_hsl[1]=cut(out_hsl[1],0,1); +out_hsl; +"} +if $use_persistence $_persistent +else +rep_create_hsl_color_select $2%,{$26/100},$4,{$27/100} ++store. _persistent +fi ++rep_color_harmony_palette $hsl_base,$5,{$4+2} +sh.. 2 *. 200 -. 100 sh... 1 *. 100 rm[-2,-1] +_hsl_h,_hsl_s,_hsl_l={I(#-2,0)} +gen_col_info gen_pt_info +elif [${24-25}]!=[${28-29}] +if $use_persistence $_persistent +else +rep_create_hsl_color_select $2%,{$26/100},$4,{$27/100} ++store. _persistent +fi +hsl_base={" +const scale=$27%; +const mx=w-1; +const my=h-1; +const cx=mx/2; +const cy=my/2; +const ref_dim=min(cx,cy); +const max_length=ref_dim*scale; +const min_length=max_length*$26/100; +const length=max_length-min_length; +const pos_x=mx*$24%; +const pos_y=my*$25%; +const dx=pos_x-cx; +const dy=pos_y-cy; +const hue=(atan2(dx,dy)+pi)/((pi*2)/360); +const dist=2*((cut(sqrt(dx^2+dy^2),min_length,max_length)-min_length)/length)-1; +[hue,$2/100,dist]; +"} ++rep_color_harmony_palette $hsl_base,$5,{$4+2} +sh.. 2 *. 200 -. 100 sh... 1 *. 100 rm[-2,-1] +_hsl_h,_hsl_s,_hsl_l={I(#-2,0)} +gen_col_info gen_pt_info +else +if $use_persistence $_persistent +else +rep_create_hsl_color_select $2%,{$26/100},$4,{$27/100} ++store. _persistent +fi ++rep_color_harmony_palette $1,{$2/100},{$3/100},$5,{$4+2} +sh.. 2 *. 200 -. 100 rm. +gen_pt_info +console_mode=0 +fi +num_of_col={w+1} +uncommand draw_points,gen_pt_info,gen_pt_info_alt,gen_col_info +k[0,-1] +if $77 +format_choice=${arg\ $76+1,gpl,pdn_pal,jasc} +=> "Generated by G'MIC Color Harmonies" +rep_output_$format_choice. $folder_name/$basename +console_mode=2 +fi +if $console_mode==2 +console_message="File has been exported!" +elif $console_mode==1 +console_message="Changed Input!" +elif $console_mode==0 +console_message="Standby Mode" +else +console_message="Initialized" +fi +u "{"$_hsl_h"}""{"$_hsl_s"}""{"$_hsl_l"}""{$4}""{$5}""{"$_rgb_0_r","$_rgb_0_g","$_rgb_0_b"}""{"$_rgb_1_r","$_rgb_1_g","$_rgb_1_b"}""{"$_rgb_2_r","$_rgb_2_g","$_rgb_2_b"}_"{3<$num_of_col?2}"{"$_rgb_3_r","$_rgb_3_g","$_rgb_3_b"}_"{4<$num_of_col?2}"{"$_rgb_4_r","$_rgb_4_g","$_rgb_4_b"}_"{5<$num_of_col?2}"{"$_rgb_5_r","$_rgb_5_g","$_rgb_5_b"}_"{6<$num_of_col?2}"{"$_point_x_0","$_point_y_0"}""{$26}""{$27}""{"$_point_x_0","$_point_y_0"}""{"$_rgb_0_r_alt","$_rgb_0_g_alt","$_rgb_0_b_alt"}""{"$_rgb_1_r_alt","$_rgb_1_g_alt","$_rgb_1_b_alt"}""{"$_rgb_2_r_alt","$_rgb_2_g_alt","$_rgb_2_b_alt"}""{"$_rgb_3_r_alt","$_rgb_3_g_alt","$_rgb_3_b_alt"}""{"$_rgb_4_r_alt","$_rgb_4_g_alt","$_rgb_4_b_alt"}""{"$_rgb_5_r_alt","$_rgb_5_g_alt","$_rgb_5_b_alt"}""{"$_hsl_0_h"}""{"$_hsl_0_s"}""{"$_hsl_0_l"}""{"$_hsl_1_h"}""{"$_hsl_1_s"}""{"$_hsl_1_l"}""{"$_hsl_2_h"}""{"$_hsl_2_s"}""{"$_hsl_2_l"}""{"$_hsl_3_h"}""{"$_hsl_3_s"}""{"$_hsl_3_l"}""{"$_hsl_4_h"}""{"$_hsl_4_s"}""{"$_hsl_4_l"}""{"$_hsl_5_h"}""{"$_hsl_5_s"}""{"$_hsl_5_l"}""{$4}""{$5}""{$26}""{$27}""{$70}""{$71}""{$72}""{$73}""{$74}""{$75}""{$76}""{0}""{"$console_message"}""{"$console_mode"}""{"$_preview_area_width"}""{"$_preview_area_height"}" +rep_create_hsl_color_select: +skip ${2=.25},${3=0},${4=.9} +ow,oh={w#0},{h#0} +rm +$ow,$oh,1,3,"*begin( +const ww=w-1; +const hh=h-1; +const cx=ww/2; +const cy=hh/2; +const sd=max(w,h)/min(w,h); +const scaling=1/$4; +const sx=(w>h?sd:1)*scaling; +const sy=(w>h?1:sd)*scaling; +const cxsx=cx/sx; +const cysy=cy/sy; +const pt=$2; +const ipt=1/(1-pt); +const res_atan_end=(2*pi)/360; +const saturation=$1; +rescale_radial(a)=(a-pt)*ipt; +rescale_atan2(a)=(a+pi)/res_atan_end; +hsl2rgb(hue,saturation,lightness)=( +H=(hue/60)%6; +C=(1-abs(2*lightness-1))*saturation; +X=C*(1-abs(H%2-1)); +m=lightness-C/2; +RGB=arg(1 + int(H),[C,X,0],[X,C,0],[0,C,X],[0,X,C],[X,0,C],[C,0,X]); +(RGB+=m)*=255; +); +hsl2ryb2rgb(hue,saturation,lightness)=( +H=(hue/60)%6; +C=(1-abs(2*lightness-1))*saturation; +X=C*(1-abs(H%2-1)); +m=lightness-C/2; +RYB=arg(1+int(H),[C,X,0],[X,C,0],[0,C,X],[0,X,C],[X,0,C],[C,0,X]); +RYB+=m*=255; +red=RYB[0]; +yellow=RYB[1]; +blue=RYB[2]; +white=min(RYB); +red-=white; +yellow-=white; +blue-=white; +maxyellow=max(red,yellow,blue); +green=min(yellow,blue); +yellow-=green; +blue-=green; +blue>0&&green>0?( +blue*=2; +green*=2 +); +red+=yellow; +green+=yellow; +maxgreen = max(red,green,blue); +maxgreen>0?( +N=maxyellow/maxgreen; +red*=N; +green*=N; +blue*=N; +); +red+=white; +green+=white; +blue+=white; +[red,green,blue]; +); +if($3 +,calc(hue,saturation,lightness)=hsl2ryb2rgb(hue,saturation,lightness); +,calc(hue,saturation,lightness)=hsl2rgb(hue,saturation,lightness); +); +ev_light=vector(#3,255); +ev_dark=vector(#3,0); +); +xx=(x-cx)/cxsx; +yy=(y-cy)/cysy; +radial_gradient=rescale_radial(norm(xx,yy)); +inrange(radial_gradient,0,1,1,1)?( +conical_gradient=rescale_atan2(atan2(xx,yy)); +calc(conical_gradient,saturation,radial_gradient); +):( +radial_gradient>.5?ev_light:ev_dark; +); +" +gui_rep_colmt: +cs=$1 +alp=$2 +tc={$cs!=3?3+$alp:4} +pos={$tc==4?$3:$4} +argset=${1-2},$pos,$6,${49-50} +if $5 rep_color_modulo_texture $argset,${17-48} +else rep_color_modulo_texture $argset,${7-14} +fi +gui_rep_colmt_preview: +gui_rep_colmt $* +cs=$1 +alp={$2?1} +tc={$cs!=3?3+$alp:4} +set_a={!$5?2:0} +set_b={$5?($tc==4?($15==0?2:0):($16==0?2:0)):0} +set_c={$5?($tc==4?($15==1?2:0):($16==1?2:0)):0} +set_d={$5?($tc==4?($15==2?2:0):($16==2?2:0)):0} +set_e={$5?($tc==4?($15==3?2:0):0):0} +u "{$1}""{$2}_"{$1==3?0:2}"{$3}_"{$tc==4?2:0}"{$4}_"{$tc==3?2:0}"{$5}""{$6}""{$7}_"$set_a"{$8}_"$set_a"{$9}_"$set_a"{$10}_"$set_a"{$11}_"$set_a"{$12}_"$set_a"{$13}_"$set_a"{$14}_"$set_a"{$15}_"{$5&&$tc==4?2:0}"{$16}_"{$5&&$tc==3?2:0}"{$17}_"$set_b"{$18}_"$set_b"{$19}_"$set_b"{$20}_"$set_b"{$21}_"$set_b"{$22}_"$set_b"{$23}_"$set_b"{$24}_"$set_b"{$25}_"$set_c"{$26}_"$set_c"{$27}_"$set_c"{$28}_"$set_c"{$29}_"$set_c"{$30}_"$set_c"{$31}_"$set_c"{$32}_"$set_c"{$33}_"$set_d"{$34}_"$set_d"{$35}_"$set_d"{$36}_"$set_d"{$37}_"$set_d"{$38}_"$set_d"{$39}_"$set_d"{$40}_"$set_d"{$41}_"$set_e"{$42}_"$set_e"{$43}_"$set_e"{$44}_"$set_e"{$45}_"$set_e"{$46}_"$set_e"{$47}_"$set_e"{$48}_"$set_e"{$49}""{$50}" +fx_rep_color_region: +if narg($_persistent) +remove $_persistent +else +rep_color_region $1%,$2%,$3 +fi +fx_rep_color_region_preview: +imgs={$!} +if [${1-3}]!=[${4-6}]||!narg($_persistent) ++rep_color_region $1%,$2%,$3 +store[-$imgs--1] _persistent +fi +gui_split_preview "remove $_persistent keep[0]",${-3--1} +u "{$1}""{$2}""{$3}"{!$1?2}"{$1}""{$2}""{$3}""{$7}""{$8,$9}" +#@cli :: Reptorian's Base64 Image Codes +#@cli rep_tileset_n: eq. to 'rep_tileset_nonisometric' : (+) +rep_tileset_n: rep_tileset_nonisometric $* +#@cli rep_tileset_nonisometric : 0<=_tileset_id<=6 +#@cli : Inserts pre-made nonisometric tileset.\n +#@cli : Note: Some tileset has been optimized.\n +#@cli : - The following list contains available arguments. Anything after the dashes is not part of it and are used to credit the main tileset author, and equal sign implies the two arguments generates the same result. -\n +#@cli : 0 = lpc_interior -- (Edited)[LPC] House Interior and Decorations by Lanea Zimmerman/Sharm,Tuomo Untinen authored by Reemax +#@cli : 1 = generic_platform -- (Edited)Generic Platformer by surt authored by tebruno99 +#@cli : 2 = metroid_like -- Metroid Like by chipmunk +#@cli : 3 = omegateam -- Omega Team by surt +#@cli : 4 = classic -- Classic RPG by jestan +#@cli : 5 = dungeon -- Dungeon by stealthix +#@cli : 6 = happyland -- Happyland by Buch +#@cli : Default values: "_tileset_id=?"\n +#@cli : Author: Reptorian. +rep_tileset_nonisometric: +v - _gmic_s="$?" v + +_$0 $"*" +_rep_tileset_nonisometric: +skip ${1=} +tileset="$1" +if isnum("$1")&&{isint("$1")}||!narg($1) +if narg($1) choice=$1 else choice={round(u(0,6))} fi +tileset=${arg\ 1+$choice,lpc_interior,generic_platform,metroid_like,omegateam,classic,dungeon,happyland} +fi +v 0 e[^-1] "Create '"$tileset"' tileset." +_rep_tileset_nonisometric_$tileset +_rep_tileset_nonisometric_lpc_interior: base642img MiB1bnNpZ25lZF9jaGFyIGxpdHRsZV9lbmRpYW4KMjU2IDI1NiAxIDQgIzMyNjgzCnic1L0JeBRVvvBduI2OBmM6hADZNOkgi21ijAgTEEKI0pjQbAKDUQkORFokE9lCQuw3YzDIEnSUJGJEHJaIggQEBGVNIGFxRnFGGXGHJOgsd7773TvfPPe+z5PvLLWcc+pUndPpSpj8A91VdXqp3387W9XpmprQRMFSVKQY0tAKpAFv3wNlFRTwuBk9Ug8NjHgZKVZlwYIF1MYCVRSBjBVIzblzB6zk3LlzNXblUBB8TkNRUYOBX5QDRD2gk4LHzTQ6UgfSFSHFtHgXaNALKE0skOavshXAb0cH+W3xEX+OUtTaajhAUU4RkBx8oGhVkc5vUK/avHnVPZsxfxMlAUoAvy4Ev74vwx8Af/AhUBXQt6u0Z2h/K8Jzqv1tNYC+JCenqSlH/0pPDjBqQ4OHsD+2PNbFZk0J6KCIv1hl1fkZdUjwBzB8QN8iHuztf07O/hA5x2N8pwf6v7rPeD7OAsHwGwFvBALhDbL8pFQZD8j+Ng5QY1du8CNpwHmvgfp+HXfVPfdouXCzxr9Zkp+K+GLCG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b_rgb,bw_rgb,cmy,cmyk,wcmyk,rgbcmy,1bitrgb,aurora,zenit,gbg,duel,hocuspocus,playpal,srb2,uzebox,kens16,kens32,kens54,aap12,aap16,aap64,aap96,aap128,aap_dga16,cheerful,db8,db16,db32,db_iso22,dimwid17,dimwid23,edg4,edg8,edg16,edg32,edg36,edg64,famicube,juicy32,juicy56,xaiue,15pdx,20pdx,24pdx,cabana,fant16,fant24,tf23,tfp39,faraway,fleja,koni,linearbasic,legowiki,lego2021,vinelinear,arcade,arq,atom,blk36,blkneo,brokefac,bubblegum,cpcboy,cade,calder,cdbac,cgarne,dinoknight,4l,fzt,indecision,island,journey,shallowmarsh,lago_nenufar,juicy,chocolateganache,brightwinter1,brightwinter2,kawaii,xdb,gzxp,chromatic,piet_code,boltbait_matrix,material_design,thehamster_rainbow,boltbait_rainbow,scrj,pxls,lospec,moderna,oak,nature,rbypgo,new_worlds,nauris,dynamite,interstate,downgraded,pear,pineapple,peachy,resurrect,rosy42,slso,softy,spec,roarin80s,starmancer,superfuture,sunshine,sweetie,calm,optimism,taffy,todayland,trirampo,reddit_place_2022,tropical,vivid,shido,intacto,itatsi,enos,grixel,superb,undertones,tango,cheese,equpix15,zu,voodo,franzston,night,star29,star34,still_life,simjpc,acid,battery,clump,cthul,crimso11,coptec,drz,eggy,europa,greyt,jewel,polar,sheltzy,wyrm,yume_nikki,rube_goldberg,boomboom,g8,crayola,funky,golden_wall,matriax,nt1h,jerrypie,nineties_nine,on70,anb,retrocal,punolit,luap,autum_villan,au15,au15y,galaxy_flame,cretaceous,antiquity,mushroom,aerugo,hotel_paintings,nopal,gpy,blessing,fairydust,milkshake,fuzz,fairy,naji,easter,pastel_and_darks,pastel_irena,nostalgia,ocaso,pastel_starlitsunset,pollen,kule,hydrangea,fluffy,st8rb,neon,cyclope,sy,syz,tui,cave,psygnosia,marshmellow,lost_century,finlal,industrial,murder_mystery,fate_and_destiny,vinik,ykb,halloween,graveyard,steamlords,frostical,deuterospill,cool_bone,muted_ally,ephemera,ink,violet_dreams,tinyfolks,old_gold,rosemoss,aaprad,aapmaj,dead_weight,mojave,pet8,pet8d,xaiue_rad,daruda,firestorm,borkfest,spicy,rust,apricot,supernova,pastry,sandy,illumination,nyx,dreamhaze,oil,regal,softdemon,sgm,midnight_ablaze,black_cherry,sunset_red,inkpink,brash_pink,pink_neon_sign,enchanted_purple,arch,spaceyeaster,fornaxvoid1,fornaxvoid2,pixelwave,s1,berry_nebula,abyss,moonlight,moon39,h2o,magic_waters,bluemold,moss,deep_maze,toxic_slime,lush_green,tsunami,cryptic_ocean,marsh_madness,oxyd,pinkgreen,woodwalk,paper,sahara_pastell,sunflower,arthoe,sky,ocean_glass,royal,eulbink,winter_wonderland,moon_squid,stratus,arctic_dust,clouds_sunset,lilac_skies,sea_of_fire,autochrome3,autochrome5,gb_d_1,gb_d_2,gb_andrade,gb_blue,gb_bz,gb_suburb,gb_crimson,gb_didi,gb_dirty,gb_arne,gb_easy,gb_forest,gb_hg,gb_lg,gb_nostalgia,gb_platinum,gb_kirokaze,gb_cyber,gb_wish,gb_grapefruit,gb_ice_cream,gb_rb,gb_gold,gb_choco,gb_gray,gb_space,gb_purpdawn,moon_crystal,arne,autumn_chill,cherrymelon,hal4,hollow,lavender,maw,voltage_warning,tritanopia,rabbit,amiga2600ntsc,amiga2600pal,amiga2600secam,amiga7800mess,amiga7800,amstrad_cpc,apple,atari,cga,cga00,cga01,cga10,cga11,cga20,cga21,c64_pepto,c64_colodore,com_vic_20,colecovision,jmp,mac2,mac8,msx,nes,pico,risc,samcoupe,mo5,trs80,virtualboy,vga,win95,zx,gnome,elc,chip16,deluxepaint,flat,makecode,oekaki,lms,msxp,vista,piet,japwood,humanfaces,hues,christmas,ladybugreds +#@cli unpurple : intensity, min_brightnes, min_red_to_blue, max_red_to_blue, blur_std_deviation, gentle_mode +#@cli : Unpurple removes purple fringing +#@cli : Based on https://github.com/mjambon/purple-fringe by Martin Jambon. +#@cli : This implementation works with RGB and RGBA images in any bit depth. +#@cli : Note: the minimum brightness and intensity are relative to the maximum blue value. +#@cli : Ported to G'MIC by Stanislav Paskalev +#@cli : $ image.jpg +unpurple +#@cli : +fx_rep_compb: +ox={(($9-50)/100)*2} +oy={(($10-50)/100)*-2} +setarg=${1-2},"[${3-4}]","[${5-6}]",${7-8},$ox,$oy +midpoint_shift={1-abs($24)} +if $13 +if $12 setarg2=${20-22} +else setarg2=$20,$22 +fi +else +if $12 setarg2=${14-19} +else setarg2=$14,$16,$17,$19 +fi +fi +local[0] { +rep_complexion_burst $setarg,$11,$12,$setarg2 +val_max={iM} +if ($23%)<1 cut 0,{iM*$23%} fi +n 0,1 +if $24>=0 f i^$midpoint_shift +else f 1-((1-i)^$midpoint_shift) +fi +if $26 n 0,255 +else * {$25*$val_max} +fi +} +fx_rep_compb_preview: +fx_rep_compb ${1-26} +if $27 ++f[0] i>0?1 +fillperc={ia*100} rm. +fillperc_l={int($fillperc)} +fillperc_r={int(($fillperc-$fillperc_l)*100)} +fillratio=$fillperc_l +fillratio.=. +fillratio.=$fillperc_r +fillratio.=% +to[0] $fillratio,.5~,.5~,18% +fi +k[0] +a={!$13?2:0} +b={$13?2:0} +c={!$13?($12?2:0):0} +d={$13?($12?2:0):0} +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}""{$9,$10}""{$11}""{$12}""{$13}""{$14}_"$a"{$15}_"$c"{$16}_"$a"{$17}_"$a"{$18}_"$c"{$19}_"$a"{$20}_"$b"{$21}_"$d"{$22}_"$b"{$23}""{$24}""{$25}_"{$26?1:2}"{$26}""{$27}" +_cons_turb : +foreach { cons_turb $* } +cons_turb : +-m "MergeChoice : $""=_mode" -MergeChoice "add","alpha","and","average","blue","burn","darken","difference","divide","dodge","exclusion","freeze","grainextract","grainmerge","green","hardlight","hardmix","hue","interpolation","lighten","lightness","linearburn","linearlight","luminance","multiply","negation","or","overlay","pinlight","red","reflect","saturation","screen","shapeaverage","softburn","softdodge","softlight","stamp","subtract","value","vividlight","xor","edges","error" +fill_color 0,0,0 +turbulence ${1-3},0,$4 +balance_gamma ${5-7} +remove_opacity +if $10<=4 ac "_fx_noise $8,$9",{$10+2},$11 +else ac "_fx_noise $8,$9",{$10+3},$11 +fi +remove_opacity ++jr_desaturate ${12-16} +blend normal,$17/100 ++cons_self_blend $18,$19 +blend ${_mode{$20+1}},$21/100 +if $22==1 cut $23,$24 +elif $22==2 n $23,$24 +fi +if $25 ac "equalize",rgb fi +if $26 negate fi +fx_make_seamless 256 +fx_warp_by_intensity ${27-34} +if $36 +if !$37 +blur $35 +fx_butterworth_bp ${38-44},0,${45-46} +if $45==1 ++rep_emboss_relief ${48-51},0,$52 +fi +else ++fx_butterworth_bp ${38-44},0,${45-46} +blur[0] $35 +if $47==1 +rep_emboss_relief[1] ${48-51},0,$52 +fi +fi +else +blur $35 +if $47 ++rep_emboss_relief ${48-51},0,$52 +fi +fi +if $47 if $53 blend grainmerge,{$54/100} else blend grainextract,{$54/100} fi fi +cons_self_blend : +-m "MergeChoice : $""=_mode" -MergeChoice "add","burn","dodge","exclusion","freeze","grainextract","grainmerge","hardlight","hardmix","interpolation","linearburn","linearlight","luminance","multiply","negation","overlay","pinlight","reflect","screen","shapeaverage","softburn","softdodge","softlight","stamp","vividlight","edges","error" +[0] +blend ${_mode{$1+1}},$2/100 +_cons_turb_preview : +gui_split_preview "_cons_turb $*",${-3--1} +fx_rep_detailed_info_preview: +skip "$*" +if narg($_persistent)&&($2==$3) +$_persistent +str_inform={t} +rm. +else +s="Host: "$_host\n"Operating System: "$_os\n"Flags: "$_flags\n"Process ID: "$_pid +foreach { +w,h={[w,h]} +s.=\n\n"- Image \#"{$>+1}" -" +s.=\n"Dimensions: "$w{`120`}$h +a,b,true_ratio=${rep_nearest_ratio\ $w,$h,$2,1} +if $true_ratio +s.=\n"Aspect Ratio: "$a{`58`}$b +else +s.=\n"Aspect Ratio (Approximated): "$a{`58`}$b +s.=\n"Error Margin for approximated ratio: "{abs(w/h-$a/$b)} +fi +s.=\n"Minimum Value: "{im} +s.=\n"Maximum Value: "{iM} +s.=\n"Average Value: "{ia} +s.=\n"Variance Value: "{iv} +s.=\n"Summation Value: "{is} +s.=\n"Product Value: "{ip} +s.=\n"Median Value: "{ic} +s.=\n"L2-Norm Vlaue: "{in} +} +('$s') +str_inform={t} +store. _persistent +fi +u "{"$str_inform"}""{$2}""{$2}" +fx_rep_dla: +skip $* +rm $_persistent +fx_rep_dla_preview: +status_changed={[${1-8}]!=[${10-17}]} +if narg($_persistent)?(!$9&&!$status_changed) +crop $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1 +gui_split_preview "rm $_persistent k[0] crop $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1",${-3--1} +else ++store original_images +if $8 foreach { +if s==2||s==4 +shared 0,{s-2} +negate. +rm. +fi +} +fi +rep_diffusion_limited_aggregation ${1-2},{$5%},${3-4},${6-7} +* 255 +store _persistent +$original_images +crop $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1 +gui_split_preview "rm $_persistent k[0] crop $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1",${-3--1} +fi +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}""{0}""{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}""{$18}""{$19,$20}" +fx_rep_dungeon_floor: +ww={w} +hh={h} +sub={abs($3)+1} +f. 0 channels. 0 +r. {$sub*w},{$sub*h},100%,100%,-1 +{w},{h},1,1,"begin( +const cx=(w-1)/2; +const cy=(h-1)/2; +const scaleP=$1?1:.5; +const wx=.043333; +const wy=.053333; +const a=.7; +const TWO_PI=pi*2; +const off_x=cx*($1==0?((1-$2%2)?1)); +const off_y=cy*($1==0?($2>1?1)); +); +xx=scaleP*x/w; +yy=scaleP*y/h; +for(n=0,n<10,++n, +newx=xx+wx-a/(TWO_PI*sin(TWO_PI*yy)); +newy=yy+wy-a/(TWO_PI*sin(TWO_PI*xx)); +xx=(newx+off_x)%w; +yy=(newy+off_y)%h; +i(#0,xx,yy)++; +);" +rm.. +if $3!=0 r. $ww,$hh,100%,100%,2 fi +n. 0,255 +fx_rep_dungeon_floor_preview: +fx_rep_dungeon_floor $* +u "{$1}""{$2}_"{!$1?2:1}"{$3}" +rep_dynamic_contrast_preview: gui_split_preview "rep_dynamic_contrast ${1-3}",${-3--1} +fx_rep_edgefade: +if $3 +rep_edgefade $2%,${4-5},$6%,$7% +else +diag={round((norm(w,h)/2)*($1/100))} +rep_edgefade $diag,${4-5},$6%,$7% +fi +fx_rep_edgefade_preview: +gui_split_preview "fx_rep_edgefade ${1-7}",${-3--1} +u "{$1}_"{!$3?2}"{$2}_"{$3?2}"{$3}""{$4}""{$5}""{$6}_"{$5?2:1}"{$7}_"{$5?2:1}"{$8}""{$9,$10}" +fx_rep_ekb: +to_rgba +convert_colors_fwd=${arg\ $18+1,error,rgb2ryb,rgb2cmy,rgb2cmyk,rgb2hcy,rgb2hsi,rgb2hsl,rgb2hsv,rgb2lab,rgb2lch,rgb2ycbcr,rgb2ycbcrglic,rgb2yiq,rgb2yuv,rgb2xyz,rgb2yes} +square_size={round(min(w,h)/2*$1%)} +if $4 +border_size=$3 +else +border_size=$2% +fi +main_arg=$square_size,$border_size,$15%,$5% +if !$10 ufc=${rep_int82hex\ ${7-9}} fi +second_set_arg=$6,$18 +if !$14 +if $18&&$15 +1,1,1,3,[${11-13}] +$convert_colors_fwd. +second_set_arg.=,{crop(#-1)} +rm. +else +second_set_arg.=,${11-13} +fi +fi +if $16 +mimg={$!-1} +if $18<4||$18==11 vcol=[u(255),u(255),u(255)] +elif $18<8 vcol=[u(359.999),u(1),u(1)] +elif $18==8 vcol=[u(0,100),u(-128,182),u(-155,155)] +elif $18==9 vcol=[u(0,100),u(240),u(-pi,pi)] +elif $18==10 vcol=[u(16.5,236),u(16.9375,240.0625),u(16.9375,240.0625)] +elif $18==12 vcol=[u(255),u(-151.90757751464844,151.90757751464844),u(-133.26069641113281,133.26069641113281)] +elif $18==13 vcol=[u(1),u(-.436,.436),u(-.615,.615)] +elif $18==14 vcol=[u(1),u(1),u(1)] +elif $18==15 vcol=[u(255),u(-127.5,127.5),u(-127.5,127.5)] +fi +$17,1,1,{$18==3?4:3},begin(srand($21));$vcol +srand $20 +rep_ellsworth_kelly_board[0-$mimg] $main_arg,[-1],$ufc,$second_set_arg +rm. +else +ppc=${arg\ $19+1,bw_rgb,wcmyk,rgbcmy,1bitrgb,aurora,zenit,gbg,duel,hocuspocus,playpal,srb2,uzebox,kens16,kens32,kens54,aap12,aap16,aap64,aap96,aap128,aap_dga16,cheerful,db8,db16,db32,db_iso22,dimwid17,dimwid23,edg8,edg16,edg32,edg36,edg64,famicube,juicy32,juicy56,xaiue,15pdx,20pdx,24pdx,cabana,fant16,fant24,tf23,tfp39,faraway,fleja,koni,linearbasic,legowiki,lego2021,vinelinear,arcade,arq,atom,blk36,blkneo,brokefac,bubblegum,cpcboy,cade,calder,cdbac,cgarne,dinoknight,4l,fzt,indecision,island,journey,shallowmarsh,lago_nenufar,juicy,chocolateganache,brightwinter1,brightwinter2,kawaii,xdb,gzxp,chromatic,piet_code,boltbait_matrix,material_design,thehamster_rainbow,boltbait_rainbow,scrj,pxls,lospec,moderna,oak,nature,rbypgo,new_worlds,nauris,dynamite,interstate,downgraded,pear,pineapple,peachy,resurrect,rosy42,slso,softy,spec,roarin80s,starmancer,superfuture,sunshine,sweetie,calm,optimism,taffy,todayland,trirampo,reddit_place_2022,tropical,vivid,shido,intacto,itatsi,enos,grixel,superb,undertones,tango,cheese,equpix15,zughy,voodo,franzston,night,star29,star34,still_life,simjpc,acid,battery,clump,cthul,crimso11,coptec,drz,eggy,europa,greyt,jewel,polar,sheltzy,wyrm,yume_nikki,rube_goldberg,boomboom,g8,crayola,funky,golden_wall,matriax,nt1h,jerrypie,nineties_nine,on70,anb,retrocal,punolit,luap,autum_villan,au15,au15y,galaxy_flame,cretaceous,antiquity,mushroom,aerugo,hotel_paintings,nopal,blessing,fairydust,milkshake,fairy,naji,easter,pastel_and_darks,pastel_irena,nostalgia,ocaso,pastel_starlitsunset,pollen,kule,hydrangea,fluffy,st8rb,neon,cyclope,sy,syz,tui,cave,psygnosia,marshmellow,lost_century,finlal,industrial,murder_mystery,fate_and_destiny,vinik,ykb,halloween,graveyard,steamlords,frostical,deuterospill,cool_bone,muted_ally,ephemera,ink,violet_dreams,tinyfolks,old_gold,rosemoss,aaprad,aapmaj,dead_weight,mojave,pet8,pet8d,xaiue_rad,daruda,firestorm,borkfest,spicy,rust,apricot,supernova,pastry,sandy,illumination,nyx,dreamhaze,oil,regal,softdemon,sgm,midnight_ablaze,black_cherry,sunset_red,inkpink,brash_pink,pink_neon_sign,enchanted_purple,arch,spaceyeaster,fornaxvoid1,fornaxvoid2,pixelwave,s1,berry_nebula,abyss,moonlight,moon39,h2o,magic_waters,moss,deep_maze,toxic_slime,lush_green,tsunami,cryptic_ocean,marsh_madness,oxyd,pinkgreen,woodwalk,paper,sahara_pastell,sunflower,arthoe,sky,ocean_glass,royal,eulbink,winter_wonderland,moon_squid,stratus,arctic_dust,clouds_sunset,lilac_skies,sea_of_fire,autochrome5,tritanopia,rabbit,amiga2600ntsc,amiga2600pal,amiga2600secam,amiga7800mess,amiga7800,amstrad_cpc,apple,atari,cga,c64_pepto,c64_colodore,com_vic_20,colecovision,jmp,mac2,mac8,msx,nes,pico,risc,samcoupe,mo5,vga,win95,zx,gnome,elc,chip16,deluxepaint,flat,makecode,oekaki,lms,msxp,vista,piet,japwood,humanfaces,hues,christmas,ladybugreds} +srand $20 +rep_ellsworth_kelly_board $main_arg,$ppc,$ufc,$second_set_arg +fi +fx_rep_ekb_preview: +fx_rep_ekb $* +a={$16?2:0} +u "{$1}""{$2}"_{!$4?2:0}"{$3}"_{$4?2:0}"{$4}""{$5}""{$6}""{$7,$8,$9}"_{!$10?2:1}"{$10}""{$11,$12,$13}"_{$6?0:!$14?2:1}"{$14}"_{$6?0:2}"{$15}"_{(($4?$3:$2)!=0)?2:1}"{$16}""{$17}"_$a"{$18}"_$a"{$19}"_{!$16?2:0}"{$20}""{$21}"_{$16?2:0} +fx_emboss_relief: +if !$7 remove_opacity fi +rep_emboss_relief ${1-6} +fx_emboss_relief_preview: gui_split_preview "fx_emboss_relief ${1-7}",${-3--1} +fx_rep_fibonacci: +if $1 +if $11 +pal {$11-1} +rep_fibonacci_fill[^-1] ${3-5},0,$10,{($6-50)/100*2},{($7-50)/100*2},$12%,$16,[-1],$13 +rm. +else +rep_fibonacci_fill ${3-5},0,$10,{($6-50)/100*2},{($7-50)/100*2},$12%,$16 +n 0,255 +fi +else +if $11 +pal {$11-1} +rep_fibonacci_fill[^-1] ${3-5},$2,$10,$8,$9,$12%,$16,[-1],$14,$15 +rm. +else +rep_fibonacci_fill ${3-5},$2,$10,$8,$9,$12%,$16 +n 0,255 +fi +fi +u "{$1}""{$2}_"{$1?0:2}"{$3}""{$4}""{$5}""{$6,$7}_"{$1?($4?2:0):0}"{$8}_"{$1?0:2}"{$9}_"{$1?0:2}"{$10}""{$11}""{$12}""{$13}_"{$1?($11?2:1):0}"{$14}_"{$1?0:($11?2:1)}"{$15}_"{$1?0:($11?2:1)}"{$16}" +gui_rep_frblur: rep_frblur $2,$3%,$4,$5,$6,$7,$1 +gui_rep_frblur_preview: gui_split_preview "gui_rep_frblur $*",${-3--1} +fx_rep_blur_cs: +tcr=3 +convert_colors_fwd=${arg\ 1+$5,none,rgb2srgb,rgb2ryb,rgb2cmy,cs_error,rgb2hcy,rgb2hsi,rgb2hsl,rgb2hsv,rgb2lab,rgb2lch} +convert_colors_bwd=${arg\ 1+$5,none,srgb2rgb,ryb2rgb,cmy2rgb,cs_error,hcy2rgb,hsi2rgb,hsl2rgb,hsv2rgb,lab2rgb,lch2rgb} +foreach { +if $5 +if $5!=4 +$convert_colors_fwd. +else +if s==3 rgb2cmyk tcr+=1 +elif s==4 s c,-3 rgb2cmyk.. a c +fi +fi +fi +_fx_gaussian_blur $1,$2,$3,$4 +if $5 +if $5!=4&&$5 +$convert_colors_bwd. +else +if s==4 cmyk2rgb tcr-=1 +elif s==5 s c,-4 cmyk2rgb.. a c +fi +fi +fi +} +fx_rep_blur_cs_preview: +gui_split_preview "fx_rep_blur_cs ${1-5}",${-3--1} +gui_rep_gv: rep_gv $1%,$2%,$3%,$4%,{$5-50}%,{$6-50}%,$7%,$8,$9%,$10%,$11%,$12,{$13+50}%,{$14+50}%,$18,${15-17} +gui_rep_gv_preview: gui_split_preview "gui_rep_gv ${1-18}",${-3--1} +fx_rep_graduated_filter: rep_graduated_filter $1%,$2%,$3%,$4,,${5-7} +fx_rep_graduated_filter_preview: gui_split_preview "fx_rep_graduated_filter ${1-7}",${-3--1} +fx_rep_x_graphical_tiling: +if !$6 rv fi +if $5 autocrop[^0] +else autocrop_components[^0] 0%,0%,1,1 +fi +if $7 +rep_x_graphical_tiling[0] [1--1],$1,${2-4} k[0,-1] if $7==2 blend alpha fi +else rep_x_graphical_tiling[0] [1--1] k[0] +fi +fx_rep_x_graphical_tiling_preview: +if !$6 rv fi +if $5 autocrop[1] +else autocrop_components[1] 0%,0%,1,1 +fi +k[0,1] +r. {w#0},{h#0},1,{s#0},0,0,.5,.5 +r. 100%,100%,$11,100%,0,1 +f. "begin( +const offx=(100-$9-50)%; +const offy=(100-$10-50)%; +); +j(offx*w*(z/(d-1)),offy*h*(z/(d-1)));" +if $8 k. fi +s. z +if $8!=1 blend alpha +else blend alpha drgba ${2-4} +fi +if $12 +if s==2||s==4 sh. 0,{s-2} fi +text="Interactive Filter" to. $text,.5~,.5~,10% +rm. +fi +fx_rep_sptbwgp: +rep_sptbwgp {$1%},$4,{vec_arg=[${2-3}]/100} +fx_rep_sptbwgp_preview: +gui_split_preview "fx_rep_sptbwgp ${1-4}",${-3--1} +fx_rep_sptbwgp_full: +if !$12 return fi +if narg($_persistent) +imgs={$!} +src_image={$imgs+1} +$_persistent +if $4 keep_named[$src_image--1] result_y +else keep_named[$src_image--1] result_x +fi +repeat w#$alpha_indexes_list { +img_pos:=i(#$alpha_indexes_list,$>) +reverse[$img_pos,$src_image] +rm[$src_image] +} +rm[-1] +else +position,axis,threshold,influence={[$1%,$4,$3%*255,$2%]} +rep_sptbwgp $position,$axis,$influence,$threshold +fi +fx_rep_sptbwgp_preview_full: +max_image_index,threshold,old_axis,contain_alpha,started,changes,minimum_alpha_index,has_activated_post_changes:=[$!-1,$3%,$11,$12,0,0,$13,$14] +old_x_shift,old_x_influence,old_x_threshold,old_y_shift,old_y_influence,old_y_threshold=${5-10} +if $2 +if narg($_persistent) +if $contain_alpha +eval " +const post_changes_mode=$has_activated_post_changes; +const axis=$4; +post_changes_mode?( +user_input=[${1-3}]; +vector_equality=user_input-(axis?[${8-10}]:[${5-7}]); +):( +user_input=[${1-4}]; +vector_equality=user_input-(axis?[${8-10},$old_axis]:[${5-7},$old_axis]); +); +pos_unequal=find(vector_equality,0,0,1); +changes=pos_unequal!=-1; +[changes,vector_equality[2]?1]; +" +changes,threshold_change=${} +if $changes +has_activated_post_changes=1 +$_persistent +contain_result_x,contain_result_y=narg($result_x),narg($result_y) +if $contain_result_x remove[result_x] fi +if $contain_result_y remove[result_y] fi +contain_thresholded_map:=narg($y_axis_generated_thresholded_map)||narg($x_axis_generated_thresholded_map) +activate_create_thresholded_map=0 +if !$contain_thresholded_map&&$3 +activate_create_thresholded_map=1 +elif $threshold_change&&$3 +remove[x_axis_generated_thresholded_map,y_axis_generated_thresholded_map] +activate_create_thresholded_map=1 +fi +if $activate_create_thresholded_map +repeat w#$alpha_indexes_list { +img_pos,max_alp_val:=I(#$alpha_indexes_list,$>) +y_axis_alpha_list_index:=$alpha_indexes_list+1+(2*$>) +x_axis_alpha_list_index:=$y_axis_alpha_list_index+1 +shared[$img_pos] {s#$img_pos-1} +{w#$y_axis_alpha_list_index},1,1,{s#$y_axis_alpha_list_index},"begin( +const ref_y_img_index=$y_axis_alpha_list_index; +const num_of_points=s; +const dec_num_of_points=num_of_points-1; +const threshold=$threshold*$max_alp_val; +empty_vector=vector(#num_of_points,0); +); +new_vector=empty_vector; +info=I#ref_y_img_index; +insertion_pos=0; +repeat(info[0],p, +pos=info[p+1]; +if(i(#-1,x,pos,0,0)>=threshold, +++new_vector[0]; +new_vector[++insertion_pos]=pos; +); +); +new_vector; +" +name[-1] y_axis_generated_thresholded_map +1,{h#$x_axis_alpha_list_index},1,{s#$x_axis_alpha_list_index},"begin( +const ref_x_img_index=$x_axis_alpha_list_index; +const num_of_points=s; +const dec_num_of_points=num_of_points-1; +const threshold=$threshold*$max_alp_val; +empty_vector=vector(#num_of_points,0); +); +new_vector=empty_vector; +info=I#ref_x_img_index; +insertion_pos=0; +repeat(info[0],p, +pos=info[p+1]; +if(i(#-2,pos,y,0,0)>=threshold, +++new_vector[0]; +new_vector[++insertion_pos]=pos; +); +); +new_vector; +" +name[-1] x_axis_generated_thresholded_map +shared[-2,-1] 0 +max_x_alpha_count:=iM#-1 +max_y_alpha_count:=iM#-2 +remove[-5,-2,-1] +crop[-1] 0,0,0,0,0,{h#-1-1},0,$max_x_alpha_count +crop[-2] 0,0,0,0,{w#-2-1},0,0,$max_y_alpha_count +} +contain_thresholded_map=1 +fi +if $3 +repeat w#$alpha_indexes_list { +img_pos:=i(#$alpha_indexes_list,$>) +y_axis_thresholded_map_index:=$x_axis_alpha_list+1+(2*$>) +x_axis_thresholded_map_index:=$y_axis_thresholded_map_index+1 +{w#$img_pos},{h#$img_pos},1,{s#$img_pos} +if $4 name[-1] result_y +{w#$y_axis_thresholded_map_index},1,1,1,:"begin( +const src_img_index=$img_pos; +const dst_img_index=$result_y; +const ref_map=$y_axis_thresholded_map_index; +const height=h#src_img_index; +const influence_factor=$2%; +const shift_position=(-1*$1)/200+.5; +const use_alternative_shift_point=shift_position<1; +); +number_of_points=i(#ref_map); +if(number_of_points, +start_pos=height-number_of_points; +if(use_alternative_shift_point, +start_pos=int(lerp(0,start_pos,shift_position)); +); +repeat(number_of_points,rf, +rf_pos=rf+1; +src_point_position=i(#ref_map,x,0,0,rf_pos); +dst_point_position=round(lerp(src_point_position,start_pos++,influence_factor)); +I(#dst_img_index,x,dst_point_position)=I(#src_img_index,x,src_point_position); +); +);" +else name[-1] result_x +1,{h#$x_axis_thresholded_map_index},1,1,:"begin( +const src_img_index=$img_pos; +const dst_img_index=$result_x; +const ref_map=$x_axis_thresholded_map_index; +const width=w#src_img_index; +const influence_factor=$2%; +const shift_position=$1/200+.5; +const use_alternative_shift_point=shift_position<1; +); +number_of_points=i(#ref_map); +if(number_of_points, +start_pos=width-number_of_points; +if(use_alternative_shift_point, +start_pos=int(lerp(0,start_pos,shift_position)); +); +repeat(number_of_points,rf, +rf_pos=rf+1; +src_point_position=i(#ref_map,0,y,0,rf_pos); +dst_point_position=round(lerp(src_point_position,start_pos++,influence_factor)); +I(#dst_img_index,dst_point_position,y)=I(#src_img_index,src_point_position,y); +); +);" +fi +remove[-1] +} +else +repeat w#$alpha_indexes_list { +img_pos:=i(#$alpha_indexes_list,$>) +y_axis_alpha_list_pos:=$alpha_indexes_list+1+(2*$>) +x_axis_alpha_list_pos:=$y_axis_alpha_list_pos+1 +{w#$img_pos},{h#$img_pos},1,{s#$img_pos} +if $4 name[-1] result_y +{w#$y_axis_alpha_list_pos},1,1,1,:"begin( +const src_img_index=$img_pos; +const dst_img_index=$result_y; +const ref_map=$y_axis_alpha_list_pos; +const height=h#src_img_index; +const influence_factor=$2%; +const shift_position=(-1*$1)/200+.5; +const use_alternative_shift_point=shift_position<1; +); +number_of_points=i(#ref_map); +if(number_of_points, +start_pos=height-number_of_points; +if(use_alternative_shift_point, +start_pos=int(lerp(0,start_pos,shift_position)); +); +repeat(number_of_points,rf, +rf_pos=rf+1; +src_point_position=i(#ref_map,x,0,0,rf_pos); +dst_point_position=round(lerp(src_point_position,start_pos++,influence_factor)); +I(#dst_img_index,x,dst_point_position)=I(#src_img_index,x,src_point_position); +); +);" +else name[-1] result_x +1,{h#$x_axis_alpha_list_pos},1,1,:"begin( +const src_img_index=$img_pos; +const dst_img_index=$result_x; +const ref_map=$x_axis_alpha_list_pos; +const width=w#src_img_index; +const influence_factor=$2%; +const shift_position=$1/200+.5; +const use_alternative_shift_point=shift_position<1; +); +number_of_points=i(#ref_map); +if(number_of_points, +start_pos=width-number_of_points; +if(use_alternative_shift_point, +start_pos=int(lerp(0,start_pos,shift_position)); +); +repeat(number_of_points,rf, +rf_pos=rf+1; +src_point_position=i(#ref_map,0,y,0,rf_pos); +dst_point_position=round(lerp(src_point_position,start_pos++,influence_factor)); +I(#dst_img_index,dst_point_position,y)=I(#src_img_index,src_point_position,y); +); +);" +fi +remove[-1] +} +fi +if narg($y_axis_generated_thresholded_map)||narg($x_axis_generated_thresholded_map) +if $4 store[alpha_indexes_list,y_axis_alpha_list,x_axis_alpha_list,y_axis_generated_thresholded_map,x_axis_generated_thresholded_map,result_y] _persistent +else store[alpha_indexes_list,y_axis_alpha_list,x_axis_alpha_list,y_axis_generated_thresholded_map,x_axis_generated_thresholded_map,result_x] _persistent +fi +else +if $4 store[alpha_indexes_list,y_axis_alpha_list,x_axis_alpha_list,result_y] _persistent +else store[alpha_indexes_list,y_axis_alpha_list,x_axis_alpha_list,result_x] _persistent +fi +fi +fi +fi +else +started,has_activated_post_changes=1,0 +to_automode +num_of_imgs={$!} +1 => temp_alpha_indexes_list +eval " +const temp_alpha_indexes_list=$temp_alpha_indexes_list; +contain_alpha=0; +repeat($num_of_imgs,p, +if(!(s#p&1), +contain_alpha=1; +da_push(#temp_alpha_indexes_list,p); +); +); +if(contain_alpha,da_freeze(#temp_alpha_indexes_list);); +contain_alpha; +" +contain_alpha=${} +if $contain_alpha +1,1,1,2 => alpha_indexes_list +contain_alpha=0 +repeat h#$temp_alpha_indexes_list { +img_pos:=i(#$temp_alpha_indexes_list,0,$>) +shared[$img_pos] {s#$img_pos-1} +if iv#-1 +eval da_push(#$alpha_indexes_list,[$img_pos,{iM#-1}]) +contain_alpha=1 +fi +remove[-1] +} +if $contain_alpha eval da_freeze(#$alpha_indexes_list) fi +remove[temp_alpha_indexes_list] +fi +if $contain_alpha +minimum_alpha_index:=im#-1 +resize[$alpha_indexes_list] {w#$alpha_indexes_list},1,100%,100%,-1 +repeat w#$alpha_indexes_list { +img_pos:=i(#$alpha_indexes_list,$>) +shared[$img_pos] {s#$img_pos-1} +{w#-1},1,1,{h#-1+1},:" +alpha_info=vector(#s,0); +insertion_pos=0; +repeat(h#-1,pixel_position, +alpha_value=i(#-1,x,pixel_position,0,0); +if(alpha_value, +++alpha_info[0]; +alpha_info[++insertion_pos]=pixel_position; +); +); +alpha_info;" +name[-1] y_axis_alpha_list +1,{h#-2},1,{w#-2+1},:" +alpha_info=vector(#s,0); +insertion_pos=0; +repeat(w#-2,pixel_position, +alpha_value=i(#-2,pixel_position,y,0,0); +if(alpha_value, +++alpha_info[0]; +alpha_info[++insertion_pos]=pixel_position; +); +); +alpha_info;" +name[-1] x_axis_alpha_list +shared[-2,-1] 0 +max_x_alpha_count:=iM#-1 +max_y_alpha_count:=iM#-2 +remove[-5,-2,-1] +crop[-1] 0,0,0,0,0,{h#-1-1},0,$max_x_alpha_count +crop[-2] 0,0,0,0,{w#-2-1},0,0,$max_y_alpha_count +} +if $threshold +repeat w#$alpha_indexes_list { +img_pos,max_alp_val:=I(#$alpha_indexes_list,$>) +y_axis_alpha_list_index:=$alpha_indexes_list+1+(2*$>) +x_axis_alpha_list_index:=$y_axis_alpha_list_index+1 +shared[$img_pos] {s#$img_pos-1} +{w#$y_axis_alpha_list_index},1,1,{s#$y_axis_alpha_list_index},"begin( +const ref_y_img_index=$y_axis_alpha_list_index; +const num_of_points=s; +const dec_num_of_points=num_of_points-1; +const threshold=$threshold*$max_alp_val; +empty_vector=vector(#num_of_points,0); +); +new_vector=empty_vector; +info=I#ref_y_img_index; +insertion_pos=0; +repeat(info[0],p, +pos=info[p+1]; +if(i(#-1,x,pos,0,0)>=threshold, +++new_vector[0]; +new_vector[++insertion_pos]=pos; +); +); +new_vector; +" +name[-1] y_axis_generated_thresholded_map +1,{h#$x_axis_alpha_list_index},1,{s#$x_axis_alpha_list_index},"begin( +const ref_x_img_index=$x_axis_alpha_list_index; +const num_of_points=s; +const dec_num_of_points=num_of_points-1; +const threshold=$threshold*$max_alp_val; +empty_vector=vector(#num_of_points,0); +); +new_vector=empty_vector; +info=I#ref_x_img_index; +insertion_pos=0; +repeat(info[0],p, +pos=info[p+1]; +if(i(#-2,pos,y,0,0)>=threshold, +++new_vector[0]; +new_vector[++insertion_pos]=pos; +); +); +new_vector; +" +name[-1] x_axis_generated_thresholded_map +shared[-2,-1] 0 +max_x_alpha_count:=iM#-1 +max_y_alpha_count:=iM#-2 +remove[-5,-2,-1] +crop[-1] 0,0,0,0,0,{h#-1-1},0,$max_x_alpha_count +crop[-2] 0,0,0,0,{w#-2-1},0,0,$max_y_alpha_count +} +repeat w#$alpha_indexes_list { +img_pos:=i(#$alpha_indexes_list,$>) +y_axis_thresholded_map_index:=$x_axis_alpha_list+1+(2*$>) +x_axis_thresholded_map_index:=$y_axis_thresholded_map_index+1 +{w#$img_pos},{h#$img_pos},1,{s#$img_pos} . +name[-2] result_y +name[-1] result_x +{w#$y_axis_thresholded_map_index},1,1,1,:"begin( +const src_img_index=$img_pos; +const dst_img_index=$result_y; +const ref_map=$y_axis_thresholded_map_index; +const height=h#src_img_index; +const influence_factor=$2%; +const shift_position=(-1*$1)/200+.5; +const use_alternative_shift_point=shift_position<1; +); +number_of_points=i(#ref_map); +if(number_of_points, +start_pos=height-number_of_points; +if(use_alternative_shift_point, +start_pos=int(lerp(0,start_pos,shift_position)); +); +repeat(number_of_points,rf, +rf_pos=rf+1; +src_point_position=i(#ref_map,x,0,0,rf_pos); +dst_point_position=round(lerp(src_point_position,start_pos++,influence_factor)); +I(#dst_img_index,x,dst_point_position)=I(#src_img_index,x,src_point_position); +); +);" +rm[-1] +1,{h#$x_axis_thresholded_map_index},1,1,:"begin( +const src_img_index=$img_pos; +const dst_img_index=$result_x; +const ref_map=$x_axis_thresholded_map_index; +const width=w#src_img_index; +const influence_factor=$2%; +const shift_position=$1/200+.5; +const use_alternative_shift_point=shift_position<1; +); +number_of_points=i(#ref_map); +if(number_of_points, +start_pos=width-number_of_points; +if(use_alternative_shift_point, +start_pos=int(lerp(0,start_pos,shift_position)); +); +repeat(number_of_points,rf, +rf_pos=rf+1; +src_point_position=i(#ref_map,0,y,0,rf_pos); +dst_point_position=round(lerp(src_point_position,start_pos++,influence_factor)); +I(#dst_img_index,dst_point_position,y)=I(#src_img_index,src_point_position,y); +); +);" +rm[-1] +} +else +repeat w#$alpha_indexes_list { +img_pos:=i(#$alpha_indexes_list,$>) +y_axis_alpha_list_pos:=$alpha_indexes_list+1+(2*$>) +x_axis_alpha_list_pos:=$y_axis_alpha_list_pos+1 +{w#$img_pos},{h#$img_pos},1,{s#$img_pos} . +name[-2] result_y +name[-1] result_x +{w#$y_axis_alpha_list_pos},1,1,1,:"begin( +const src_img_index=$img_pos; +const dst_img_index=$result_y; +const ref_map=$y_axis_alpha_list_pos; +const height=h#src_img_index; +const influence_factor=$2%; +const shift_position=(-1*$1)/200+.5; +const use_alternative_shift_point=shift_position<1; +); +number_of_points=i(#ref_map); +if(number_of_points, +start_pos=height-number_of_points; +if(use_alternative_shift_point, +start_pos=int(lerp(0,start_pos,shift_position)); +); +repeat(number_of_points,rf, +rf_pos=rf+1; +src_point_position=i(#ref_map,x,0,0,rf_pos); +dst_point_position=round(lerp(src_point_position,start_pos++,influence_factor)); +I(#dst_img_index,x,dst_point_position)=I(#src_img_index,x,src_point_position); +); +);" +rm[-1] +1,{h#$x_axis_alpha_list_pos},1,1,:"begin( +const src_img_index=$img_pos; +const dst_img_index=$result_x; +const ref_map=$x_axis_alpha_list_pos; +const width=w#src_img_index; +const influence_factor=$2%; +const shift_position=$1/200+.5; +const use_alternative_shift_point=shift_position<1; +); +number_of_points=i(#ref_map); +if(number_of_points, +start_pos=width-number_of_points; +if(use_alternative_shift_point, +start_pos=int(lerp(0,start_pos,shift_position)); +); +repeat(number_of_points,rf, +rf_pos=rf+1; +src_point_position=i(#ref_map,0,y,0,rf_pos); +dst_point_position=round(lerp(src_point_position,start_pos++,influence_factor)); +I(#dst_img_index,dst_point_position,y)=I(#src_img_index,src_point_position,y); +); +);" +rm[-1] +} +fi +if narg($y_axis_generated_thresholded_map)||narg($x_axis_generated_thresholded_map) +store[alpha_indexes_list,y_axis_alpha_list,x_axis_alpha_list,y_axis_generated_thresholded_map,x_axis_generated_thresholded_map,result_y,result_x] _persistent +else +store[alpha_indexes_list,y_axis_alpha_list,x_axis_alpha_list,result_y,result_x] _persistent +fi +else +rm[-1] +0 store. _persistent +fi +fi +fi +if $contain_alpha&&$2 +keep[$minimum_alpha_index] +crop $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1 +if $4 gui_split_preview "$_persistent keep[result_y] keep[0] crop $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1",${-3--1} +else gui_split_preview "$_persistent keep[result_x] keep[0] crop $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1",${-3--1} +fi +else +if $contain_alpha keep[$minimum_alpha_index] fi +crop $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1 +gui_split_preview "return",${-3--1} +fi +if $started +old_x_shift,old_x_influence,old_x_threshold,old_y_shift,old_y_influence,old_y_threshold=${1-3},${1-3} +else +if $4 +old_y_shift,old_y_influence,old_y_threshold=${1-3} +else +old_x_shift,old_x_influence,old_x_threshold=${1-3} +fi +fi +old_axis=$4 +u "{$1}""{$2}""{$3}""{$4}""{"$old_x_shift"}""{"$old_x_influence"}""{"$old_x_threshold"}""{"$old_y_shift"}""{"$old_y_influence"}""{"$old_y_threshold"}""{"$old_axis"}""{"$contain_alpha"}""{"$minimum_alpha_index"}""{"$has_activated_post_changes"}""{$-3}""{$-2,$-1}" +fx_rep_henon_phase_diagram: +init_sub={abs($11)} +sub={$init_sub+1} +ww={w} hh={h} +{w*$sub},{h*$sub},1,1,-1 +rm.. +setarg=$1,$7,$8,$9%,$10%,${2-6} +if $12==0 +if $13 +rep_henon_phase_diagram $setarg,{$14==2?3:2} +if $14==2 {w},{h},1,1,255 rv[-2,-1] a[-2,-1] c r. $ww,$hh,100%,100%,2 sh. 1 n. 0,255 rm. +else +inpaint_pde[-3] [-2],1,0,0,1 rm[-2] a[-2,-1] c r. $ww,$hh,100%,100%,2 +if $14 sh. 0 *. $15 cut. 0,255 rm. sh. 1 n. 0,255 rm. +else sh. 0 sh.. 1 n[-2,-1] 0,255 rm[-2,-1] +fi +fi +else +rep_henon_phase_diagram $setarg,{$14>1?3} +r. $ww,$hh,100%,100%,2 +if $14==1 +*. $15 cut. 0,255 +else +n. 0,255 +fi +fi +elif $12==1 +if $13 +rep_henon_phase_diagram $setarg,2 +n... 0,360 +inpaint_pde[-3] [-2],1,0,0,1 rm[-2] +l.. { {w},{h},100%,2,1 a[-2,-1] c } +if $16==0 hcy2rgb.. +elif $16==1 hsi2rgb.. +elif $16==2 hsv2rgb.. +fi +a[-2,-1] c +r. $ww,$hh,100%,100%,2 +sh. 3 n. 0,255 rm. +else +rep_henon_phase_diagram $setarg,1 +n.. 0,360 +r. 100%,100%,100%,2 +a[-2,-1] c +if $16==0 hcy2rgb. +elif $16==1 hsi2rgb. +elif $16==2 hsv2rgb. +fi +r. $ww,$hh,100%,100%,2 +fi +elif $12==2 ++pal {$17+1} +if $13 +rep_henon_phase_diagram[-2] $setarg,2 +*[-4] {(w#-1-1)/iM#-4} +vmin={im#-4} +{w#-4},{h#-4},1,3,pos=i(#-4,x,y,0,0);pos!=$vmin?I(#-1,pos,0,0,1); +inpaint_pde[-1] [-4],1,0,0,1 +rv[-1,-3] a[-1,-3] c +rm[-4,-3,-1] +r. $ww,$hh,100%,100%,2 +sh. 3 n. 0,255 rm. +else +rep_henon_phase_diagram[-2] $setarg +*[-2] {(w#-1-1)/iM#-2} +vmin={im#-2} +{w#-2},{h#-2},1,3,pos=i(#-2,x,y,0,0);pos!=$vmin?I(#-1,pos,0,0,1); +rm[-3,-2] +r. $ww,$hh,100%,100%,2 +fi +fi +fx_rep_henon_phase_diagram_preview: +fx_rep_henon_phase_diagram $* +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}""{$9,$10}""{$11}""{$12}""{$13}""{$14}_"{!$12?2}"{$15}_"{!$12?($14==1?2)}"{$16}_"{$12==1?2}"{$17}_"{$12==2?2}"{$18}"\ +"{$19}"\ +"{$20}" +fx_rep_hitomezashi: +skip "${10=}","${11=}","${12=}" +k[0] +ow,oh={[w,h]} +if $3 +if $4 +length_w={ceil((w-$2)/($2*2))} +length_h={ceil((h-$2)/($2*2))} +else +length_w={floor((w-$2)/($2*2))} +length_h={floor((h-$2)/($2*2))} +fi +else +if $4 +length_w={ceil(w/$2)} +length_h={ceil(h/$2)} +else +length_w={floor(w/$2)} +length_h={floor(h/$2)} +fi +fi +stray_seed,split_count=$51,$35 +if $1 +if !$14&&!$16 +if size('"$11"')>1 +if size('"$11"')<=2 +('"$11"') +r. $length_w,1,1,1,0,2 +bin_str_a={t} +rm. +else +bin_str_a="$11" +fi +else +bin_str_a=${rep_random_binary\ $length_w} +fi +else +bin_str_a=${rep_random_binary\ $length_w} +fi +if !$15&&!$16 +if size('"$12"')>1 +if size('"$12"')<=2 +('"$12"') +r. $length_h,1,1,1,0,2 +bin_str_b={t} +rm. +else +bin_str_b="$12" +fi +else +bin_str_b=${rep_random_binary\ $length_h} +fi +else +bin_str_b=${rep_random_binary\ $length_h} +fi +if !$4 +('$bin_str_a') +r. $length_w,100%,100%,100%,0,2 +bin_a={t} +rm. +('$bin_str_b') +r. $length_h,100%,100%,100%,0,2 +bin_b={t} +rm. +else +bin_a=$bin_str_a +bin_b=$bin_str_b +fi +else +max_length={max($length_w,$length_h)} +if !$13 +if size('"$10"')>1 +if size('"$10"')<=2 +('"$10"') +r. $max_length,1,1,1,0,2 +bin_str_0={t} +rm. +else +bin_str_0="$10" +fi +else +bin_str_0=${rep_random_binary\ $max_length} +fi +else +bin_str_0=${rep_random_binary\ $max_length} +fi +if !$4 +('$bin_str_0') +r. $length_w,100%,100%,100%,0,2 +bin_a={t} +rm. +('$bin_str_0') +r. $length_h,100%,100%,100%,0,2 +bin_b={t} +rm. +else +bin_a=$bin_str_0 +bin_b=$bin_str_0 +fi +fi +if $17==4 +if $29==2 +if $30 col=[u(360),u(1),u(1)] +else col=[u(255),u(255),u(255)] +fi +$34,1,1,3 +if $39 seed_b={int(u(0,200001,1,0))} +else seed_b=$38 +fi +local[-1] { +split_count={$35<$34?$35:$34} +if $split_count>1 s x,$split_count fi +f begin(length=(w-1)/$36;);x/length +$36,1,1,1 +repeat $split_count { +f. begin(srand($seed_b+$>););$col +if $42 mirror. x fi +rep_cubic_map[$>] [-1],2 +} +rm. +a x +if $30 hsl2rgb. fi +if $43 mirror. x fi +} +elif $29==1 +if $39 seed_a={int(u(0,200001,1,0))} +else seed_a=$37 +fi +if $30 $34,1,1,3,begin(srand($seed_a););[u(360),u(1),u(1)] hsl2rgb. +else $34,1,1,3,begin(srand($seed_a););[u(255),u(255),u(255)] +fi +if $44 mirror. x fi +else +if $31 pal $33 +else palette $32 +fi +if $44 mirror. x fi +fi +if $45 +if $52 +stray_seed={int(u(200001))} +fi +if $45==2 +$50,1,1,3,begin(srand($stray_seed););[u(255),u(255),u(255)] +else +pal $49 +fi +if $54 mirror. x fi +if $3 +rep_hitomezashi $bin_a,$bin_b,$2,[-2],[-1],{int($41/100*w#-2)},$40,{$3-1},$stray_seed,${46-48},{round($55/100*$2)},${57-59} +else +rep_hitomezashi $bin_a,$bin_b,$2,[-2],[-1],{int($41/100*w#-2)},$40,,$stray_seed,${46-48},{round($55/100*$2)},${57-59} +fi +rm[-3,-2] +else +if $3 +rep_hitomezashi $bin_a,$bin_b,$2,[-1],,{int($41/100*w#-1)},$40,{$3-1},$stray_seed,${46-48},{round($55/100*$2)},${57-59} +else +rep_hitomezashi $bin_a,$bin_b,$2,[-1],,{int($41/100*w#-1)},$40,,$stray_seed,${46-48},{round($55/100*$2)},${57-59} +fi +rm.. +fi +elif $17==3 +color_a=${rep_int82hex\ ${23-25}} +color_b=${rep_int82hex\ ${26-28}} +if $3 +rep_hitomezashi $bin_a,$bin_b,$2,$color_a,$color_b,{$3-1},{round($55/100*$2)},${57-59} +else +rep_hitomezashi $bin_a,$bin_b,$2,$color_a,$color_b,,{round($55/100*$2)},${57-59} +fi +elif $17==2 +bgcol=${rep_int82hex\ ${20-22}} +if $3 +rep_hitomezashi $bin_a,$bin_b,$2,$bgcol,,{$3-1},{round($55/100*$2)},${57-59} +else +rep_hitomezashi $bin_a,$bin_b,$2,$bgcol,,,{round($55/100*$2)},${57-59} +fi +elif $17==1 +if $3 +rep_hitomezashi $bin_a,$bin_b,$2,$18~,$19~,{$3-1},{round($55/100*$2)},$56 +else +rep_hitomezashi $bin_a,$bin_b,$2,$18~,$19~,,{round($55/100*$2)},$56 +fi +else +if $3 +rep_hitomezashi $bin_a,$bin_b,$2,,,{$3-1} +else +rep_hitomezashi $bin_a,$bin_b,$2 +fi +*. 255 +fi +k. +if !$4 +if $17>1 $ow,$oh,1,{s},[${7-9}] +else +val={$17?$6:$5?($5<<8)-1} +$ow,$oh,1,{s},$val +fi +j[1] [0],.5~,.5~ +rm.. +fi +u $bin_str_0,$bin_str_a,$bin_str_b,$seed_a,$seed_b,$stray_seed,$split_count +fx_rep_hitomezashi_preview: +skip "${10=}","${11=}","${12=}" +fx_rep_hitomezashi $"*" +bin_str_0,bin_str_a,bin_str_b,seed_a,seed_b,stray_seed,split_count=${} +point_x,point_y,started={[$-4,$-3,$-1]} +if !isnan($point_x) +point_x,point_y:=($-2||$started)?[100*(50%*w+1)/w,100*(50%*h)/h]:cut([$-4,$-3],0,100) +eval " +points=[$point_x,$point_y]%; +trim_out_width=min($_preview_width,w); +trim_out_height=min($_preview_height,h); +trimmed_width=w-trim_out_width; +trimmed_height=h-trim_out_height; +x0=ceil(trimmed_width*points[0]); +y0=ceil(trimmed_height*points[1]); +x1=x0+trim_out_width-1; +y1=y0+trim_out_height-1; +[x0,y0,x1,y1];" +crop ${} +started=0 +fi +u "{$1}""{$2}""{$3}""{$4}""{$5}"_{!$17?!$4?2}"{$6}"_{$17==1?!$4?2}"{$7,$8,$9}"_{$17>1?!$4?2}"{"$bin_str_0"}"_{!$1?2}"{"$bin_str_a"}"_{$1?2}"{"$bin_str_b"}"_{$1?2}"{0}"_{!$1?2}"{0}"_{$1?2}"{0}"_{$1?2}"{0}"_{$1?2}"{$17}""{$18}"_{$17==1?2}"{$19}"_{$17==1?2}"{$20,$21,$22}"_{$17==2?2}"{$23,$24,$25}"_{$17==3?2}"{$26,$27,$28}"_{$17==3?2}"{$29}"_{$17==4?2}"{$30}"_{$17==4?($29?2)}"{$31}"_{$17==4?(!$29?2)}"{$32}"_{$17==4?(!$29?!$31?2)}"{$33}"_{$17==4?(!$29?$31?2)}"{$34}"_{$29&&$17==4?2}"{"$split_count"}"_{$17==4?($29==2?2)}"{$36}"_{$17==4?($29==2?2)}"{"$seed_a"}"_{$17==4?($29==1?2)}"{"$seed_b"}"_{$17==4?($29==2?2)}"{0}"_{$17==4?($29?2)}"{$40}"_{$17==4?2}"{$41}"_{$17==4?2}"{$42}"_{$17==4?($29==2?2)}"{$43}"_{$17==4?($29==2?2)}"{$44}"_{$17==4?($29==1?2)}"{$45}"_{$17==4?2}"{$46,$47,$48}"_{$17==4?(!$45?2)}"{$49}"_{$17==4?($45==1?2)}"{$50}"_{$17==4?($45==2?2)}"{"$stray_seed"}"_{$17==4?($45?2)}"{0}"_{$17==4?($45?2)}"{$53}"\ +"{$54}"_{$17==4?($45?2)}"{$55}"_{$17?2}"{$56}"_{$17==1?2}"{$57,$58,$59}"_{$17>1?2}"{"$point_x","$point_y"}""{0}"_{!isnan($-4)+1}"{"$started"}" +fx_rep_p_i: +rep_hsx_poster_index ${1-3},{$4%},${5-6} +fx_rep_p_i_preview: +gui_split_preview "fx_rep_p_i ${1-6}",${-3--1} +fx_find_factors_of_images_preview: +skip "$*" +check "isint($2)" +n_imgs={$!} +act_mult_imgs_mode={$n_imgs>1} +index_pos,index={[$1,$2%$n_imgs]} +if narg($_persistent) +if $act_mult_imgs_mode +if $1!=$7 +index={round(($n_imgs-1)*$1%)} +index_pos={$index/($n_imgs-1)*100} +elif $2!=$8 +index_pos={$index/($n_imgs-1)*100} +fi +$_persistent +width_start_point:=i(#$width_factors_start_indexes,$index) +width_end_point:=$width_start_point+i(#$number_of_width_factors,$index) +height_start_point:=i(#$height_factors_start_indexes,$index) +height_end_point:=$height_start_point+i(#$number_of_height_factors,$index) +width_and_height_start_point:=i(#$width_and_height_factors_start_indexes,$index) +width_and_height_end_point:=$width_and_height_start_point+i(#$number_of_width_and_height_factors,$index) +crop[$width_factors_img] $width_start_point,{$width_end_point-1} +crop[$height_factors_img] $height_start_point,{$height_end_point-1} +crop[$width_and_height_factors_img] $width_and_height_start_point,{$width_and_height_end_point-1} +width_factors={crop(#$width_factors_img)} +height_factors={crop(#$height_factors_img)} +width_height_factors={crop(#$width_and_height_factors_img)} +text_box={t} +remove[-10--1] +else +$_persistent +width_factors={crop(#-4)} +height_factors={crop(#-3)} +width_height_factors={crop(#-2)} +text_box={t} +remove[-4--1] +fi +else +text_box="" +index_pos={$index/($n_imgs-1)*100} +foreach { +if $act_mult_imgs_mode +if $> text_box.=\n fi +text_box.="Image "{`35`}$>\n +text_box.=-----------------------\n +fi +w,h={[w,h]} +temp_width_factors=${rep_find_factors_of\ $w} +temp_height_factors=${rep_find_factors_of\ $h} +temp_width_height_factors=${rep_find_factors_of\ $w,$h} +if $>==$index +width_factors=$temp_width_factors +height_factors=$temp_height_factors +width_height_factors=$temp_width_height_factors +fi +if $act_mult_imgs_mode +($temp_width_factors) => width_factors_img +($temp_height_factors) => height_factors_img +($temp_width_height_factors) => width_and_height_factors_img +fi +text_box.="Image Width: "$w\n +text_box.="Image Height: "$h\n +text_box.="Image Dimensions: "$w{`120`}$h\n +text_box.=\n"Factors of Width: "$temp_width_factors\n +text_box.=\n"Factors of Height: "$temp_height_factors\n +text_box.=\n"Factors of Width and Height: "$temp_width_height_factors +if $act_mult_imgs_mode +text_box.=\n-----------------------\n +fi +} +if $act_mult_imgs_mode +local[width_factors_img] { +$!,1,1,1,w#x => number_of_width_factors +{w},1,1,1,>begin(v=0;);p=v;v+=i(#-1);p; => width_factors_start_indexes +append[^-2--1] x +} +local[height_factors_img] { +$!,1,1,1,w#x => number_of_height_factors +{w},1,1,1,>begin(v=0;);p=v;v+=i(#-1);p; => height_factors_start_indexes +append[^-2--1] x +} +local[width_and_height_factors_img] { +$!,1,1,1,w#x => number_of_width_and_height_factors +{w},1,1,1,>begin(v=0;);p=v;v+=i(#-1);p; => width_and_height_factors_start_indexes +append[^-2--1] x +} +fi +('$text_box') +text_box={t} +if $act_mult_imgs_mode +store[width_factors_img,height_factors_img,width_and_height_factors_img,number_of_width_factors,number_of_height_factors,number_of_width_and_height_factors,width_factors_start_indexes,height_factors_start_indexes,width_and_height_factors_start_indexes,-1] _persistent +else +($width_factors) +($height_factors) +($width_height_factors) +move[-4] {$!} +store[-4--1] _persistent +fi +fi +keep[$index] +act_mult_imgs_mode<<=1 +u "{"$index_pos"}_"$act_mult_imgs_mode"{"$index"}_"$act_mult_imgs_mode"{"$width_factors"}""{"$height_factors"}""{"$width_height_factors"}""{"$text_box"}""{"$index_pos"}""{"$index"}" +gui_rep_polkal: rep_polkal ${1-3},{($4-50)*2}%,{($5-50)*-2}%,${6--1} +fx_rep_lavander_binary_map: +skip "$*" +img_width,img_height={[w#0,h#0]} +if !narg($_persistent) error uninitialized fi +$_persistent +keep[output] +if !$1&&$12 resize $img_width,$img_height,100%,100%,0,{$12+1},.5,.5 fi +fx_rep_lavander_binary_map_preview: +skip "$*" +started,use_persistent,max_img_ind,timg,neq_form,color_mode_change,cont_base_map,ind_col_change,previous_status_of_random,previous_state_of_symmetry,current_num_of_colors,_num_of_colors=$89,{narg($_persistent)?1},{[$!-1,$!]},0,{$32?($32!=$116?1:0):($32!=$116)},0,0,$80,$110,$117,$33 +status_of_random={$32?$previous_status_of_random} +seed_change={$76!=$159} +act_rand_map={$32?(($status_of_random==2?$78)||$seed_change||$77)} +previous_shade,previous_lightness,previous_darkness=${154-156} +cli_command_text="$82" +cli_command_text_with_slash={/"$83"} +_color_info="$84" +mapping_info={/"$85"} +_fx_rep_lavander_binary_map_seed={$77?int(u(24000+1)):$76} +if !narg($_persistent) started=0 fi +if $70||$77||$78 _num_of_colors=$33 fi +if $act_rand_map +command "fx_rep_lavander_binary_map_create_palette: +$_num_of_colors,1,1,3,\"begin( +srand($_fx_rep_lavander_binary_map_seed); +const max_index=w-1; +const half_max_index=max_index>>1; +const expf=1-abs($71)/100; +const rand_light=$72%; +const rand_dark=$73%; +rand_dark||rand_light?( +v_shade=expr('begin(srand($_fx_rep_lavander_binary_map_seed));u(1)',w); +); +rand_dark&&rand_light?( +gen_base_shade()=x>half_max_index?lerp(0,1,lerp(x/max_index,v_shade[x],rand_light)):lerp(0,1,lerp(x/max_index,v_shade[x],rand_dark)); +): +rand_light?( +gen_base_shade()=x>half_max_index?lerp(0,1,lerp(x/max_index,v_shade[x],rand_light)):lerp(0,1,x/max_index); +): +rand_dark?( +gen_base_shade()=x>half_max_index?lerp(0,1,x/max_index):lerp(0,1,lerp(x/max_index,v_shade[x],rand_dark)); +):( +gen_base_shade()=lerp(0,1,x/max_index); +); +$71?( +$71<0?( +gen_shade()=1-(1-gen_base_shade())^expf; +):( +gen_shade()=gen_base_shade()^expf; +); +):( +gen_shade()=gen_base_shade(); +); +); +shade=gen_shade(); +[u(360),u(1),shade]; +\" +hsl2rgb. +if $_num_of_colors==5 _color_info=({round(I(#-1,0))};{round(I(#-1,1))};{round(I(#-1,2))};{round(I(#-1,3))};{round(I(#-1,4))}) +elif $_num_of_colors==4 _color_info=({round(I(#-1,0))};{round(I(#-1,1))};{round(I(#-1,2))};{round(I(#-1,3))}) +elif $_num_of_colors==3 _color_info=({round(I(#-1,0))};{round(I(#-1,1))};{round(I(#-1,2))}) +fi +" +else +if $32 +if $_num_of_colors==5 _color_info=(${55-57};${58-60};${61-63};${64-66};${67-69}) +elif $_num_of_colors==4 _color_info=(${43-45};${46-48};${49-51};${52-54}) +elif $_num_of_colors==3 _color_info=(${34-36};${37-39};${40-42}) +fi +command fx_rep_lavander_binary_map_create_palette:$_color_info +else command "fx_rep_lavander_binary_map_create_palette: 0" +fi +fi +img_width,img_height={[w#0,h#0]} +color_0_0_r,color_0_0_g,color_0_0_b,color_0_1_r,color_0_1_g,color_0_1_b,color_0_2_r,color_0_2_g,color_0_2_b,color_1_0_r,color_1_0_g,color_1_0_b,color_1_1_r,color_1_1_g,color_1_1_b,color_1_2_r,color_1_2_g,color_1_2_b,color_1_3_r,color_1_3_g,color_1_3_b,color_2_0_r,color_2_0_g,color_2_0_b,color_2_1_r,color_2_1_g,color_2_1_b,color_2_2_r,color_2_2_g,color_2_2_b,color_2_3_r,color_2_3_g,color_2_3_b,color_2_4_r,color_2_4_g,color_2_4_b,old_color_0_0_r,old_color_0_0_g,old_color_0_0_b,old_color_0_1_r,old_color_0_1_g,old_color_0_1_b,old_color_0_2_r,old_color_0_2_g,old_color_0_2_b,old_color_1_0_r,old_color_1_0_g,old_color_1_0_b,old_color_1_1_r,old_color_1_1_g,old_color_1_1_b,old_color_1_2_r,old_color_1_2_g,old_color_1_2_b,old_color_1_3_r,old_color_1_3_g,old_color_1_3_b,old_color_2_0_r,old_color_2_0_g,old_color_2_0_b,old_color_2_1_r,old_color_2_1_g,old_color_2_1_b,old_color_2_2_r,old_color_2_2_g,old_color_2_2_b,old_color_2_3_r,old_color_2_3_g,old_color_2_3_b,old_color_2_4_r,old_color_2_4_g,old_color_2_4_b=${34-69},${118-153} +if ($32?([${34-69}]!=[${118-153}]))||$70 +status_of_random=2 +color_mode_change=1 +_num_of_colors=$33 +ind_col_change=1 +fi +if $act_rand_map +color_mode_change=1 +status_of_random=1 +_num_of_colors=$33 +previous_shade,previous_lightness,previous_darkness=${71-73} +fi +if $32?([${71-73}]!=[$previous_shade,$previous_lightness,$previous_darkness])||($33!=$_num_of_colors) status_of_random=2 fi +if $32 previous_status_of_random=$status_of_random fi +if !$started||!narg($_persistent)||!$114 auto_size,auto_size_sym={v=int(log2(min($img_width,$img_height)));[v,v-1]} +else auto_size,auto_size_sym={[$114,$115]} +fi +if $1 +if $1&&!$90 +pw2size,user_defined_size=$112 +else +pw2size,user_defined_size=$2 +fi +elif !$started +user_defined_size,pw2size=$auto_size +else +pw2size={$10?$auto_size_sym:$auto_size} +user_defined_size=$112 +fi +size_changed={$pw2size!=$113} +bin_a=$4 +bin_b=$5 +bin_c=$6 +if v='$bin_a';max(v)>49||min(v)<48 error inv_bin_str_a fi +if v='$bin_b';max(v)>49||min(v)<48 error inv_bin_str_b fi +if v='$bin_c';max(v)>49||min(v)<48 error inv_bin_str_c fi +bin_a_size,bin_b_size,bin_c_size,neq_bin_a,neq_bin_b,neq_bin_c={bin_a='$4';bin_b='$5';bin_c='$6';[size(bin_a),size(bin_b),size(bin_c),bin_a!='$92',bin_b!='$93',bin_c!='$94']} +neq_bin={$neq_bin_a||$neq_bin_b||$neq_bin_c} +if !$bin_a_size error absen_bin_a fi +if !$bin_b_size error absen_bin_b fi +if !$bin_c_size error absen_bin_c fi +if $bin_a_size>4 error exces_bin_a fi +if $bin_b_size>4 error exces_bin_b fi +if $bin_c_size>4 error exces_bin_c fi +num_of_rand_bin_a_digits,num_of_rand_bin_b_digits,num_of_rand_bin_c_digits,binary_string_a_ind_0,binary_string_a_ind_1,binary_string_a_ind_2,binary_string_a_ind_3,binary_string_b_ind_0,binary_string_b_ind_1,binary_string_b_ind_2,binary_string_b_ind_3,binary_string_c_ind_0,binary_string_c_ind_1,binary_string_c_ind_2,binary_string_c_ind_3=${13-27} +if $28||$29||$30||$31 +if $28||$30 +if $num_of_rand_bin_a_digits==1 +bin_a,binary_string_a_ind_0={!$binary_string_a_ind_0} +else +index=${arg\ $num_of_rand_bin_a_digits,${16-19}} +binary_string_a_ind_{$num_of_rand_bin_a_digits-1},temp={a=int(u(0,2^$num_of_rand_bin_a_digits,1,0));a==$index?(a+1)%(2^$num_of_rand_bin_a_digits):a;} +(${rep_r_permutation_index2list\ 2,$num_of_rand_bin_a_digits,$temp}) ++. 48 +bin_a={t} +rm. +fi +fi +if $29||$30 +if $num_of_rand_bin_b_digits==1 +bin_b,binary_string_b_ind_0={!$binary_string_b_ind_0} +else +index=${arg\ $num_of_rand_bin_b_digits,${20-23}} +binary_string_b_ind_{$num_of_rand_bin_b_digits-1},temp={b=int(u(0,2^$num_of_rand_bin_b_digits,1,0));b==$index?(b+1)%(2^$num_of_rand_bin_b_digits):b;} +(${rep_r_permutation_index2list\ 2,$num_of_rand_bin_b_digits,$temp}) ++. 48 +bin_b={t} +rm. +fi +fi +if $31 +if $num_of_rand_bin_c_digits==1 +bin_c,binary_string_c_ind_0={!$binary_string_c_ind_0} +else +index=${arg\ $num_of_rand_bin_c_digits,${24-27}} +binary_string_c_ind_{$num_of_rand_bin_c_digits-1},temp={c=int(u(0,2^$num_of_rand_bin_c_digits,1,0));c==$index?(c+1)%(2^$num_of_rand_bin_c_digits):c;} +(${rep_r_permutation_index2list\ 2,$num_of_rand_bin_c_digits,$temp}) ++. 48 +bin_c={t} +rm. +fi +fi +neq_bin:=('$bin_a'!='$92')||('$bin_b'!='$93')||('$bin_c'!='$94') +elif $neq_bin +if $neq_bin_a +num_of_rand_bin_a_digits=$bin_a_size +binary_string_a_ind_{$num_of_rand_bin_a_digits-1}=${rep_r_permutation_list2index\ 2,{['$4']-48}} +fi +if $neq_bin_b +num_of_rand_bin_b_digits=$bin_b_size +binary_string_b_ind_{$num_of_rand_bin_b_digits-1}=${rep_r_permutation_list2index\ 2,{['$5']-48}} +fi +if $neq_bin_c +num_of_rand_bin_c_digits=$bin_c_size +binary_string_c_ind_{$num_of_rand_bin_c_digits-1}=${rep_r_permutation_list2index\ 2,{['$6']-48}} +fi +else +if $started&&([${16-27}]!=[${95-106}]) +$=arg_pos_ +if $3>2 +repeat 8 { +left_arg=${arg_pos_{$>+16}} +right_arg=${arg_pos_{$>+95}} +ab_pos,bin_group_pos={[int($>/4),$>%4]} +a_b=${arg\ $ab_pos+1,a,b} +num_of_digits={$bin_group_pos+1} +if !$bin_group_pos +if $left_arg!=$right_arg +num_of_rand_bin_$a_b"_digits"=$num_of_digits +bin_$a_b,binary_string_$a_b"_ind_"$bin_group_pos=$left_arg +neq_bin=1 +break +fi +else +if $left_arg!=$right_arg +(${rep_r_permutation_index2list\ 2,$num_of_digits,$left_arg}) ++. 48 +bin_$a_b={t} +num_of_rand_bin_$a_b"_digits"=$num_of_digits +binary_string$a_b"_ind_"$bin_group_pos=$left_arg +neq_bin=1 +rm. break +fi +fi +} +else +repeat 4 { +left_arg=${arg_pos_{$>+24}} +right_arg=${arg_pos_{$>+103}} +num_of_digits={$>+1} +if $left_arg!=$right_arg +(${rep_r_permutation_index2list\ 2,$num_of_digits,$left_arg}) ++. 48 +bin_c={t} +num_of_rand_bin_c_digits=$num_of_digits +binary_string_c_ind_$>=$left_arg +neq_bin=1 +rm. break +fi +} +fi +elif !$started +num_of_rand_bin_a_digits=$bin_a_size +binary_string_a_ind_{$num_of_rand_bin_a_digits-1}=${rep_r_permutation_list2index\ 2,{['$4']-48}} +num_of_rand_bin_b_digits=$bin_b_size +binary_string_b_ind_{$num_of_rand_bin_b_digits-1}=${rep_r_permutation_list2index\ 2,{['$5']-48}} +num_of_rand_bin_c_digits=$bin_c_size +binary_string_c_ind_{$num_of_rand_bin_c_digits-1}=${rep_r_permutation_list2index\ 2,{['$6']-48}} +fi +fi +form_b=$108 +if $3==6 +neq_form:='$8'!='$108' +form_b=$8 +fi +switch_use_sym={($10?1)!=($110?1)} +act_sym_switch={$10!=$110} +sym_mode={$switch_use_sym||$act_sym_switch} +if ([$3,$7]!=[$91,$107])||$neq_form||$neq_bin||$size_changed||!$started +use_persistent,color_mode_change={[0,1]} +if $3<6 formula_mode={$3>2?$3-3:-($3+1)} +else formula_mode=- +fi +if $3>2 ++rep_lavander_binary_map $pw2size,$formula_mode,$bin_a,$bin_b,$7,"$8" => base_map +base_cli_command="+rep_lavander_binary_map "$pw2size,$formula_mode,$bin_a,$bin_b,$7, +else ++rep_lavander_binary_map $pw2size,$formula_mode,$bin_c,,$7,"$8" => base_map +base_cli_command="+rep_lavander_binary_map "$pw2size,$formula_mode,$bin_c,,$7, +fi +cli_command_text=$base_cli_command\"$8\" +cli_command_text_with_slash=$base_cli_command{`92`}\"$8{`92`}\" +keep[base_map] +if $10 rep_symmetrize_xy {$10-1} => base_map fi +cont_base_map=1 +if $sym_mode sym_mode=0 fi +fi +if $sym_mode +use_persistent=0 +if $110?$10&&$110:$10 +$_persistent keep[-2,-1] +if $110 +eval " +const pw2size=2^$pw2size; +const pos=max(0,$110-1); +init_v=[1,pw2size]-1; +off_x=(pw2size-1)*(pos&1); +off_y=(pw2size-1)*(pos%3?1); +xc=init_v+off_x; +yc=init_v+off_y; +[xc[0],yc[0],xc[1],yc[1]]; +" +crop[-2,-1] ${} +fi +else +eval " +const pw2size=2^$pw2size; +const pos=max(0,$110)-1; +init_v=[1,pw2size]-1; +off_x=(pw2size-1)*(pos&1); +off_y=(pw2size-1)*(pos%3?1); +xc=init_v+off_x; +yc=init_v+off_y; +[xc[0],yc[0],xc[1],yc[1]]; +" +$_persistent keep[-2,-1] +crop[-2,-1] ${} +fi +if $10 rep_symmetrize_xy {$10-1} fi +name[-2,-1] base_map,output ++store[-2,-1] _persistent +keep[output] +if !$1&&$12 resize $img_width,$img_height,100%,100%,0,{$12+1},.5,.5 fi +fi +if $color_mode_change +use_persistent=0 +if !$cont_base_map +if narg($_persistent) +$_persistent +keep[base_map] +fi +fi +size_val_arr_base_map={iM#$base_map+1} +if $32 +current_num_of_colors=$_num_of_colors +mi={$_num_of_colors-1} +fx_rep_lavander_binary_map_create_palette => ref_col +if $_num_of_colors==5 +3,1,1,1 +4,1,1,1 +elif $_num_of_colors==4 +3,1,1,1 +5,1,1,1 +elif $_num_of_colors==3 +4,1,1,1 +5,1,1,1 +fi +if !$act_rand_map permute[-3] yzcx fi +f[-2--1] lerp(0,$mi,x/(w-1)) +rep_cubic_map[-2--1] [-3] +sort_list[-3--1] +,w +$size_val_arr_base_map,1,1,1,lerp(0,$mi,x/(w-1)) +rep_cubic_map[-1] [ref_col] ++map[base_map] [-1] rm.. => output ++store[$base_map,-1] _persistent +a[-4--2] x +round.. +cut.. 0,255 +permute[-2] cxyz +color_0_0_r,color_0_0_g,color_0_0_b,color_0_1_r,color_0_1_g,color_0_1_b,color_0_2_r,color_0_2_g,color_0_2_b,color_1_0_r,color_1_0_g,color_1_0_b,color_1_1_r,color_1_1_g,color_1_1_b,color_1_2_r,color_1_2_g,color_1_2_b,color_1_3_r,color_1_3_g,color_1_3_b,color_2_0_r,color_2_0_g,color_2_0_b,color_2_1_r,color_2_1_g,color_2_1_b,color_2_2_r,color_2_2_g,color_2_2_b,color_2_3_r,color_2_3_g,color_2_3_b,color_2_4_r,color_2_4_g,color_2_4_b={crop(#-2)} +old_color_0_0_r,old_color_0_0_g,old_color_0_0_b,old_color_0_1_r,old_color_0_1_g,old_color_0_1_b,old_color_0_2_r,old_color_0_2_g,old_color_0_2_b,old_color_1_0_r,old_color_1_0_g,old_color_1_0_b,old_color_1_1_r,old_color_1_1_g,old_color_1_1_b,old_color_1_2_r,old_color_1_2_g,old_color_1_2_b,old_color_1_3_r,old_color_1_3_g,old_color_1_3_b,old_color_2_0_r,old_color_2_0_g,old_color_2_0_b,old_color_2_1_r,old_color_2_1_g,old_color_2_1_b,old_color_2_2_r,old_color_2_2_g,old_color_2_2_b,old_color_2_3_r,old_color_2_3_g,old_color_2_3_b,old_color_2_4_r,old_color_2_4_g,old_color_2_4_b={crop(#-2)} +if $32!=$116||!$started mapping_info=" "{`123`}iM+1{`125`},1,1,1,lerp(0,{`123`}w#-2-1{`125`},x/(w-1))" "rep_cubic_map[-1]" "[-3]" "map[-2]" "[-1]" "rm[-3,-1] fi +else ++n. 0,255 => output ++store[-2,-1] _persistent +mapping_info=" n[-1] 0,255" +fi +keep[output] +if !$1&&$12 resize $img_width,$img_height,100%,100%,0,{$12+1},.5,.5 fi +fi +if $use_persistent +$_persistent +keep[output] +if !$1&&$12 resize $img_width,$img_height,100%,100%,0,{$12+1},.5,.5 fi +fi +uncommand fx_rep_lavander_binary_map_create_palette +if $86 selectable_cli_command_text=$cli_command_text_with_slash +else selectable_cli_command_text=$cli_command_text +fi +if $10 selectable_cli_command_text.=" rep_symmetrize_xy[-1] "{$10-1} fi +if $32 +selectable_cli_command_text..=$_color_info" permute[-1] yzcx " +fi +selectable_cli_command_text.=$mapping_info +u "{$1}""{"$pw2size"}_"{$1+1}"{$3}""{"$bin_a"}_"{$3>2?2}"{"$bin_b"}_"{$3>2?2}"{"$bin_c"}_"{$3<3?2}"{$7}""{$8}_"{($3==6)+1}"{$9}""{$10}""{$11}""{$12}_"{!$1*2}"{"$num_of_rand_bin_a_digits"}_"{$3>2?2}"{"$num_of_rand_bin_b_digits"}_"{$3>2?2}"{"$num_of_rand_bin_c_digits"}_"{$3<3?2}"{"$binary_string_a_ind_0"}_"{$3>2?$num_of_rand_bin_a_digits==1?2}"{"$binary_string_a_ind_1"}_"{$3>2?$num_of_rand_bin_a_digits==2?2}"{"$binary_string_a_ind_2"}_"{$3>2?$num_of_rand_bin_a_digits==3?2}"{"$binary_string_a_ind_3"}_"{$3>2?$num_of_rand_bin_a_digits==4?2}"{"$binary_string_b_ind_0"}_"{$3>2?$num_of_rand_bin_b_digits==1?2}"{"$binary_string_b_ind_1"}_"{$3>2?$num_of_rand_bin_b_digits==2?2}"{"$binary_string_b_ind_2"}_"{$3>2?$num_of_rand_bin_b_digits==3?2}"{"$binary_string_b_ind_3"}_"{$3>2?$num_of_rand_bin_b_digits==4?2}"{"$binary_string_c_ind_0"}_"{$3<3?$num_of_rand_bin_c_digits==1?2}"{"$binary_string_c_ind_1"}_"{$3<3?$num_of_rand_bin_c_digits==2?2}"{"$binary_string_c_ind_2"}_"{$3<3?$num_of_rand_bin_c_digits==3?2}"{"$binary_string_c_ind_3"}_"{$3<3?$num_of_rand_bin_c_digits==4?2}"{0}_"{$3>2?2}"{0}_"{$3>2?2}"{0}_"{$3>2?2}"{0}_"{$3<3?2}"{$32}""{$33}_"{$32?2}"{"$color_0_0_r","$color_0_0_g","$color_0_0_b"}_"{$32?($33==3?2)}"{"$color_0_1_r","$color_0_1_g","$color_0_1_b"}_"{$32?($33==3?2)}"{"$color_0_2_r","$color_0_2_g","$color_0_2_b"}_"{$32?($33==3?2)}"{"$color_1_0_r","$color_1_0_g","$color_1_0_b"}_"{$32?($33==4?2)}"{"$color_1_1_r","$color_1_1_g","$color_1_1_b"}_"{$32?($33==4?2)}"{"$color_1_2_r","$color_1_2_g","$color_1_2_b"}_"{$32?($33==4?2)}"{"$color_1_3_r","$color_1_3_g","$color_1_3_b"}_"{$32?($33==4?2)}"{"$color_2_0_r","$color_2_0_g","$color_2_0_b"}_"{$32?($33==5?2)}"{"$color_2_1_r","$color_2_1_g","$color_2_1_b"}_"{$32?($33==5?2)}"{"$color_2_2_r","$color_2_2_g","$color_2_2_b"}_"{$32?($33==5?2)}"{"$color_2_3_r","$color_2_3_g","$color_2_3_b"}_"{$32?($33==5?2)}"{"$color_2_4_r","$color_2_4_g","$color_2_4_b"}_"{$32?($33==5?2)}"{0}_"{$32?(($33!=$current_num_of_colors)+1)}"{$71}_"{$32?2}"{$72}_"{$32?2}"{$73}_"{$32?2}"{$74}""{$75}""{"$_fx_rep_lavander_binary_map_seed"}_"{$32?2}"{0}_"{$32?2}"{0}_"{$32?$status_of_random}"{"$status_of_random"}""{"$previous_status_of_random"}""{"$selectable_cli_command_text"}""{"$cli_command_text"}""{"$cli_command_text_with_slash"}""{"$_color_info"}""{"$mapping_info"}""{$86}""{$88}""{$88}""{1}""{$1}""{$3}""{"$bin_a"}""{"$bin_b"}""{"$bin_c"}""{"$binary_string_a_ind_0"}""{"$binary_string_a_ind_1"}""{"$binary_string_a_ind_2"}""{"$binary_string_a_ind_3"}""{"$binary_string_b_ind_0"}""{"$binary_string_b_ind_1"}""{"$binary_string_b_ind_2"}""{"$binary_string_b_ind_3"}""{"$binary_string_c_ind_0"}""{"$binary_string_c_ind_1"}""{"$binary_string_c_ind_2"}""{"$binary_string_c_ind_3"}""{$7}""{"$form_b"}""{$9}""{$10}""{$111}""{"$user_defined_size"}""{"$pw2size"}""{"$auto_size"}""{"$auto_size_sym"}""{$32}""{"$current_num_of_colors"}""{"$old_color_0_0_r","$old_color_0_0_g","$old_color_0_0_b"}""{"$old_color_0_1_r","$old_color_0_1_g","$old_color_0_1_b"}""{"$old_color_0_2_r","$old_color_0_2_g","$old_color_0_2_b"}""{"$old_color_1_0_r","$old_color_1_0_g","$old_color_1_0_b"}""{"$old_color_1_1_r","$old_color_1_1_g","$old_color_1_1_b"}""{"$old_color_1_2_r","$old_color_1_2_g","$old_color_1_2_b"}""{"$old_color_1_3_r","$old_color_1_3_g","$old_color_1_3_b"}""{"$old_color_2_0_r","$old_color_2_0_g","$old_color_2_0_b"}""{"$old_color_2_1_r","$old_color_2_1_g","$old_color_2_1_b"}""{"$old_color_2_2_r","$old_color_2_2_g","$old_color_2_2_b"}""{"$old_color_2_3_r","$old_color_2_3_g","$old_color_2_3_b"}""{"$old_color_2_4_r","$old_color_2_4_g","$old_color_2_4_b"}""{"$previous_shade"}""{"$previous_lightness"}""{"$previous_darkness"}""{$157}""{$158}""{"$_fx_rep_lavander_binary_map_seed"}""{$160}" +rep_logpindis_gui: +rep_logpindis $1,{(($2/100)-.5)*2},{(($3/100)-.5)*-2},{(($4/100)-.5)*2},{(($5/100)-.5)*-2},${6-18} +rep_logpindis_gui_preview: +gui_split_preview "rep_logpindis_gui $*",${-3--1} +gui_rep_majority: +rep_major $3,$4,$1,$2 +if $5 to_graya fi +gui_rep_majority_preview: +gui_split_preview "gui_rep_majority ${1-5}",${-3--1} +gui_rep_majority_threshold: +rep_major_t $3,$4%,$5,$6,$1,$2 +if $7 to_graya fi +gui_rep_majority_threshold_preview: +gui_split_preview "gui_rep_majority_threshold ${1-7}",${-3--1} +fx_rep_mlfrac: +skip "${39=}","${40=}","${41=}" +srand $19 +set_main_arg=${1-3},$4%,$5%,{100-$6}%,$7% +timg={$!} +if $8==0 +rep_markus_lyapunov_fractal[0] $set_main_arg,$9 n 0,255 if $timg>1 f[^0] I#0 fi +elif $8==1 +hex_col_a=${rep_int82hex\ ${10-13}} +hex_col_b=${rep_int82hex\ ${14-17}} +rep_markus_lyapunov_fractal[0] $set_main_arg,$hex_col_a,$hex_col_b +if $timg>1 f[^0] I#0 fi +elif $8==2 +if $18 rep_markus_lyapunov_fractal[0] $set_main_arg,u,u,${21-23} +else rep_markus_lyapunov_fractal[0] $set_main_arg,u,$20,$23 +fi +if $timg>1 f[^0] I#0 fi +elif $8==3 +if $18 ++pal $26 ++pal $28 +rep_markus_lyapunov_fractal[0] $set_main_arg,[-2],[-1],$27,$29 +rm[-2,-1] +if $timg>1 f[^0] I#0 fi +else ++pal $24 +rep_markus_lyapunov_fractal[0] $set_main_arg,[-1],$25 +rm. +if $timg>1 f[^0] I#0 fi +fi +else +if $timg==2||$timg==3 +if $36 rv fi +if $timg==2 +rep_markus_lyapunov_fractal[0] $set_main_arg,[1],$31,$30 +else +if $37 rv[^0] fi +rep_markus_lyapunov_fractal[0] $set_main_arg,[1],[2],$33,$35,$32,$34 +fi +else +error "Invalid number of layer(s) for this mode. 2 or 3 Layers Only!" +fi +fi +use_time=${} +set_a_1={$8==1?2} +set_a_2={$8==2?2} +set_a_3={$8==2&&$18==1?2} +set_b_1={($8==2&&$18==0)?2} +set_b_2={($8==2&&$18==1)?2} +set_c_1={($8==3&&$18==0)?2} +set_c_2={($8==3&&$18==1)?2} +set_d_1={$8==4&&$timg==2?2} +set_d_2={$8==4&&$timg==3?2} +u "{$1}""{$2}""{$3}""{$4}""{$5,$6}""{$7}_"$use_time"{$8}""{$9}_"{!$8?2}"{$10,$11,$12,$13}_"$set_a_1"{$14,$15,$16,$17}_"$set_a_1"{$18}_"{$8>1&&$8<4?2}"{$19}_"{$8==2?2:$8==3?($18?(($27==1||$29==1)?2:1):($25==1?2:1)):$8==4?($timg==3?(($33==1||$35==1)?2:1):($31==1?2:1))}"{$20}_"{$8==2&&$18==0?2}"{$21}_"$set_a_3"{$22}_"$set_a_3"{$23}_"$set_a_2"{$24}_"$set_c_1"{$25}_"$set_c_1"{$26}_"$set_c_2"{$27}_"$set_c_2"{$28}_"$set_c_2"{$29}_"$set_c_2"{$30}_"$set_d_1"{$31}_"$set_d_1"{$32}_"$set_d_2"{$33}_"$set_d_2"{$34}_"$set_d_2"{$35}_"$set_d_2"{$36}_"{$8==4?2}"{$37}_"$set_d_2"{$38}""{$39}""{$40}""{$41}""{$42}""{$43}""{$44}""{$45}""{$46}""{$47}""{$48}""{$49}" +fx_rep_mitchell_concatenation: +_fx_rep_mitchell_concatenation_base $* +fx_rep_mitchell_concatenation_preview: +niw,nih,ms=$_preview_width,${-max_h},${-max_h} +rm +$niw,$nih,1,$ms +_fx_rep_mitchell_concatenation_base $* +r 100%,$_preview_height,100%,100%,0,0,.5,.5 +_fx_rep_mitchell_concatenation_base: +original_dimension:=[w,h] +multiple_images:=$!>1 +pixels:=max(1,round(h*$2%)) +enabl_mode_double_concatenation:=$pixels>=4 +ini_double_concatenation_mode:=$enabl_mode_double_concatenation?$1 +double_concatenation_mode=0 +start_0=$4 +if $105 +start_0:=max(1,($8^($102+1))-int(h/($pixels*2))) +fi +start_a,start_b=${5-6} +if $7&&$ini_double_concatenation_mode +if $5!=$109 start_a,start_b=$5 fi +if $6!=$110 start_a,start_b=$6 fi +fi +base_a,base_b=${9-10} +if $11&&$ini_double_concatenation_mode +if $9!=$111 base_a,base_b=$9 fi +if $10!=$112 base_a,base_b=$10 fi +fi +method_a,method_b=${13-14} +if $15&&$ini_double_concatenation_mode +if $13!=$113 method_a,method_b=$13 fi +if $14!=$114 method_a,method_b=$14 fi +fi +if $ini_double_concatenation_mode +double_concatenation_mode:=(($start_a!=$start_b)||($base_a!=$base_b)||($method_a!=$method_b))?1 +fi +if $double_concatenation_mode +diff:=int(h/($pixels*2)) +if $106||$108 +start_a:=max(1,($base_a^($103+1))-$diff) +fi +if $107||$108 +start_b:=max(1,($base_b^($104+1))-$diff) +fi +if $ini_double_concatenation_mode +double_concatenation_mode:=(($start_a!=$start_b)||($base_a!=$base_b)||($method_a!=$method_b))?1 +fi +fi +if $81 +if $double_concatenation_mode&&$16 +if sum(abs([${39-59}]-[${136-156}]))?1 +col_0_r_0,col_0_g_0,col_0_b_0,col_0_r_1,col_0_g_1,col_0_b_1,col_0_r_2,col_0_g_2,col_0_b_2,col_0_r_3,col_0_g_3,col_0_b_3,col_0_r_4,col_0_g_4,col_0_b_4,col_0_r_5,col_0_g_5,col_0_b_5,col_0_r_6,col_0_g_6,col_0_b_6=${39-59} +col_a_r_0,col_a_g_0,col_a_b_0,col_a_r_1,col_a_g_1,col_a_b_1,col_a_r_2,col_a_g_2,col_a_b_2,col_a_r_3,col_a_g_3,col_a_b_3,col_a_r_4,col_a_g_4,col_a_b_4,col_a_r_5,col_a_g_5,col_a_b_5,col_a_r_6,col_a_g_6,col_a_b_6=${39-59} +col_b_r_0,col_b_g_0,col_b_b_0,col_b_r_1,col_b_g_1,col_b_b_1,col_b_r_2,col_b_g_2,col_b_b_2,col_b_r_3,col_b_g_3,col_b_b_3,col_b_r_4,col_b_g_4,col_b_b_4,col_b_r_5,col_b_g_5,col_b_b_5,col_b_r_6,col_b_g_6,col_b_b_6=${39-59} +elif sum(abs([${60-80}]-[${157-177}]))?1 +col_0_r_0,col_0_g_0,col_0_b_0,col_0_r_1,col_0_g_1,col_0_b_1,col_0_r_2,col_0_g_2,col_0_b_2,col_0_r_3,col_0_g_3,col_0_b_3,col_0_r_4,col_0_g_4,col_0_b_4,col_0_r_5,col_0_g_5,col_0_b_5,col_0_r_6,col_0_g_6,col_0_b_6=${60-80} +col_a_r_0,col_a_g_0,col_a_b_0,col_a_r_1,col_a_g_1,col_a_b_1,col_a_r_2,col_a_g_2,col_a_b_2,col_a_r_3,col_a_g_3,col_a_b_3,col_a_r_4,col_a_g_4,col_a_b_4,col_a_r_5,col_a_g_5,col_a_b_5,col_a_r_6,col_a_g_6,col_a_b_6=${60-80} +col_b_r_0,col_b_g_0,col_b_b_0,col_b_r_1,col_b_g_1,col_b_b_1,col_b_r_2,col_b_g_2,col_b_b_2,col_b_r_3,col_b_g_3,col_b_b_3,col_b_r_4,col_b_g_4,col_b_b_4,col_b_r_5,col_b_g_5,col_b_b_5,col_b_r_6,col_b_g_6,col_b_b_6=${60-80} +else +col_0_r_0,col_0_g_0,col_0_b_0,col_0_r_1,col_0_g_1,col_0_b_1,col_0_r_2,col_0_g_2,col_0_b_2,col_0_r_3,col_0_g_3,col_0_b_3,col_0_r_4,col_0_g_4,col_0_b_4,col_0_r_5,col_0_g_5,col_0_b_5,col_0_r_6,col_0_g_6,col_0_b_6=${18-38} +col_a_r_0,col_a_g_0,col_a_b_0,col_a_r_1,col_a_g_1,col_a_b_1,col_a_r_2,col_a_g_2,col_a_b_2,col_a_r_3,col_a_g_3,col_a_b_3,col_a_r_4,col_a_g_4,col_a_b_4,col_a_r_5,col_a_g_5,col_a_b_5,col_a_r_6,col_a_g_6,col_a_b_6=${39-59} +col_b_r_0,col_b_g_0,col_b_b_0,col_b_r_1,col_b_g_1,col_b_b_1,col_b_r_2,col_b_g_2,col_b_b_2,col_b_r_3,col_b_g_3,col_b_b_3,col_b_r_4,col_b_g_4,col_b_b_4,col_b_r_5,col_b_g_5,col_b_b_5,col_b_r_6,col_b_g_6,col_b_b_6=${60-80} +fi +else +if sum(abs([${18-38}]-[${115-135}]))?1 +col_0_r_0,col_0_g_0,col_0_b_0,col_0_r_1,col_0_g_1,col_0_b_1,col_0_r_2,col_0_g_2,col_0_b_2,col_0_r_3,col_0_g_3,col_0_b_3,col_0_r_4,col_0_g_4,col_0_b_4,col_0_r_5,col_0_g_5,col_0_b_5,col_0_r_6,col_0_g_6,col_0_b_6=${18-38} +col_a_r_0,col_a_g_0,col_a_b_0,col_a_r_1,col_a_g_1,col_a_b_1,col_a_r_2,col_a_g_2,col_a_b_2,col_a_r_3,col_a_g_3,col_a_b_3,col_a_r_4,col_a_g_4,col_a_b_4,col_a_r_5,col_a_g_5,col_a_b_5,col_a_r_6,col_a_g_6,col_a_b_6=${18-38} +col_b_r_0,col_b_g_0,col_b_b_0,col_b_r_1,col_b_g_1,col_b_b_1,col_b_r_2,col_b_g_2,col_b_b_2,col_b_r_3,col_b_g_3,col_b_b_3,col_b_r_4,col_b_g_4,col_b_b_4,col_b_r_5,col_b_g_5,col_b_b_5,col_b_r_6,col_b_g_6,col_b_b_6=${18-38} +else +col_0_r_0,col_0_g_0,col_0_b_0,col_0_r_1,col_0_g_1,col_0_b_1,col_0_r_2,col_0_g_2,col_0_b_2,col_0_r_3,col_0_g_3,col_0_b_3,col_0_r_4,col_0_g_4,col_0_b_4,col_0_r_5,col_0_g_5,col_0_b_5,col_0_r_6,col_0_g_6,col_0_b_6=${18-38} +col_a_r_0,col_a_g_0,col_a_b_0,col_a_r_1,col_a_g_1,col_a_b_1,col_a_r_2,col_a_g_2,col_a_b_2,col_a_r_3,col_a_g_3,col_a_b_3,col_a_r_4,col_a_g_4,col_a_b_4,col_a_r_5,col_a_g_5,col_a_b_5,col_a_r_6,col_a_g_6,col_a_b_6=${39-59} +col_b_r_0,col_b_g_0,col_b_b_0,col_b_r_1,col_b_g_1,col_b_b_1,col_b_r_2,col_b_g_2,col_b_b_2,col_b_r_3,col_b_g_3,col_b_b_3,col_b_r_4,col_b_g_4,col_b_b_4,col_b_r_5,col_b_g_5,col_b_b_5,col_b_r_6,col_b_g_6,col_b_b_6=${60-80} +fi +fi +else +col_0_r_0,col_0_g_0,col_0_b_0,col_0_r_1,col_0_g_1,col_0_b_1,col_0_r_2,col_0_g_2,col_0_b_2,col_0_r_3,col_0_g_3,col_0_b_3,col_0_r_4,col_0_g_4,col_0_b_4,col_0_r_5,col_0_g_5,col_0_b_5,col_0_r_6,col_0_g_6,col_0_b_6=${18-38} +col_a_r_0,col_a_g_0,col_a_b_0,col_a_r_1,col_a_g_1,col_a_b_1,col_a_r_2,col_a_g_2,col_a_b_2,col_a_r_3,col_a_g_3,col_a_b_3,col_a_r_4,col_a_g_4,col_a_b_4,col_a_r_5,col_a_g_5,col_a_b_5,col_a_r_6,col_a_g_6,col_a_b_6=${39-59} +col_b_r_0,col_b_g_0,col_b_b_0,col_b_r_1,col_b_g_1,col_b_b_1,col_b_r_2,col_b_g_2,col_b_b_2,col_b_r_3,col_b_g_3,col_b_b_3,col_b_r_4,col_b_g_4,col_b_b_4,col_b_r_5,col_b_g_5,col_b_b_5,col_b_r_6,col_b_g_6,col_b_b_6=${60-80} +fi +if $double_concatenation_mode +if $16 +dyn_single_palette,dyn_dual_palette=0,2 +($col_a_r_0,$col_a_g_0,$col_a_b_0) +($col_a_r_1,$col_a_g_1,$col_a_b_1) +($col_a_r_2,$col_a_g_2,$col_a_b_2) +($col_a_r_3,$col_a_g_3,$col_a_b_3) +($col_a_r_4,$col_a_g_4,$col_a_b_4) +($col_a_r_5,$col_a_g_5,$col_a_b_5) +($col_a_r_6,$col_a_g_6,$col_a_b_6) +a[-7--1] y permute. cyzx rotate. 90 +($col_b_r_0,$col_b_g_0,$col_b_b_0) +($col_b_r_1,$col_b_g_1,$col_b_b_1) +($col_b_r_2,$col_b_g_2,$col_b_b_2) +($col_b_r_3,$col_b_g_3,$col_b_b_3) +($col_b_r_4,$col_b_g_4,$col_b_b_4) +($col_b_r_5,$col_b_g_5,$col_b_b_5) +($col_b_r_6,$col_b_g_6,$col_b_b_6) +a[-7--1] y permute. cyzx rotate. 90 +if $84&&$multiple_images +use_shape=1 +rep_mitchell_concatenation[0--4] $start_a,$start_b,$base_a,$base_b,$method_a,$method_b,$pixels,[-2],[-1],1,[-3],{$85/100},${86-89},1 +else +use_shape=2 +set_arg=1 +if $83==6 set_arg.=,${90-91} +elif $83==8 set_arg.=,$93%,0,1,$92 +elif $83==10 set_arg.=,${94-97} +elif $83==20 set_arg.=,$98 +elif $83==23 set_arg.=,$99 +elif $83==24 set_arg.=,$100,{$101/100} +fi +rep_mitchell_concatenation[0--3] $start_a,$start_b,$base_a,$base_b,$method_a,$method_b,$pixels,[-2],[-1],1,$83,{$85/100},${86-89},$set_arg +fi +rm[-2,-1] +else +dyn_single_palette,dyn_dual_palette=2,0 +($col_0_r_0,$col_0_g_0,$col_0_b_0) +($col_0_r_1,$col_0_g_1,$col_0_b_1) +($col_0_r_2,$col_0_g_2,$col_0_b_2) +($col_0_r_3,$col_0_g_3,$col_0_b_3) +($col_0_r_4,$col_0_g_4,$col_0_b_4) +($col_0_r_5,$col_0_g_5,$col_0_b_5) +($col_0_r_6,$col_0_g_6,$col_0_b_6) +a[-7--1] y permute. cyzx rotate. 90 +if $84&&$multiple_images +use_shape=1 +rep_mitchell_concatenation[0--3] $start_a,$start_b,$base_a,$base_b,$method_a,$method_b,$pixels,[-1],,1,[-2],{$85/100},${86-89},1 +else +use_shape=2 +set_arg=1 +if $83==6 set_arg.=,${90-91} +elif $83==8 set_arg.=,$93%,0,1,$92 +elif $83==10 set_arg.=,${94-97} +elif $83==20 set_arg.=,$98 +elif $83==23 set_arg.=,$99 +elif $83==24 set_arg.=,$100,{$101/100} +fi +rep_mitchell_concatenation[0--2] $start_a,$start_b,$base_a,$base_b,$method_a,$method_b,$pixels,[-1],,1,$83,{$85/100},${86-89},$set_arg +fi +rm. +fi +else +dyn_single_palette,dyn_dual_palette=2,0 +($col_0_r_0,$col_0_g_0,$col_0_b_0) +($col_0_r_1,$col_0_g_1,$col_0_b_1) +($col_0_r_2,$col_0_g_2,$col_0_b_2) +($col_0_r_3,$col_0_g_3,$col_0_b_3) +($col_0_r_4,$col_0_g_4,$col_0_b_4) +($col_0_r_5,$col_0_g_5,$col_0_b_5) +($col_0_r_6,$col_0_g_6,$col_0_b_6) +a[-7--1] y permute. cyzx rotate. 90 +if $82 +if $84&&$multiple_images +use_shape=1 +rep_mitchell_concatenation[0--3] $start_0,$start_0,$8,$8,$12,$12,$pixels,[-1],,1,[-2],{$85/100},${86-89},1 +else +use_shape=2 +set_arg=1 +if $83==6 set_arg.=,${90-91} +elif $83==8 set_arg.=,$93%,0,1,$92 +elif $83==10 set_arg.=,${94-97} +elif $83==20 set_arg.=,$98 +elif $83==23 set_arg.=,$99 +elif $83==24 set_arg.=,$100,{$101/100} +fi +rep_mitchell_concatenation[0--2] $start_0,$start_0,$8,$8,$12,$12,$pixels,[-1],,1,$83,{$85/100},${86-89},$set_arg +fi +else +use_shape=0 +rep_mitchell_concatenation[0--2] $start_0,$start_0,$8,$8,$12,$12,$pixels,[-1] +fi +rm. +fi +if $3 r $original_dimension,100%,100%,0,0,1,.5 fi +enabl_duo_opt:=$pixels>=4?2:1 +cond_ini_double_concatenation:=$ini_double_concatenation_mode?2 +cond_not_ini_double_concatenation:=!$ini_double_concatenation_mode?2 +cond_double_concatenation:=$double_concatenation_mode?2 +cond_not_double_concatenation:=!$double_concatenation_mode?2 +use_foreground:=$dyn_dual_palette?(!$17?2) +use_background:=$dyn_dual_palette?($17?2) +cond_mul_img:=$multiple_images?2 +act_use_shape:=$use_shape?2 +enab_dyn_shape:=$use_shape==2 +use_dragon_curve:=$enab_dyn_shape?$83==6?2 +use_fern:=$enab_dyn_shape?$83==8?2 +use_gear:=$enab_dyn_shape?$83==10?2 +use_polygon:=$enab_dyn_shape?$83==20?2 +use_snowflake:=$enab_dyn_shape?$83==23?2 +use_star:=$enab_dyn_shape?$83==24?2 +u "{$1}_"$enabl_duo_opt"{$2}""{$3}""{"$start_0"}_"$cond_not_ini_double_concatenation"{"$start_a"}_"$cond_ini_double_concatenation"{"$start_b"}_"$cond_ini_double_concatenation"{$7}_"$cond_ini_double_concatenation"{$8}_"$cond_not_ini_double_concatenation"{"$base_a"}_"$cond_ini_double_concatenation"{"$base_b"}_"$cond_ini_double_concatenation"{$11}_"$cond_ini_double_concatenation"{$12}_"$cond_not_ini_double_concatenation"{"$method_a"}_"$cond_ini_double_concatenation"{"$method_b"}_"$cond_ini_double_concatenation"{$15}_"$cond_ini_double_concatenation"{$16}_"$cond_double_concatenation"{$17}_"$dyn_dual_palette"{"$col_0_r_0","$col_0_g_0","$col_0_b_0"}_"$dyn_single_palette"{"$col_0_r_1","$col_0_g_1","$col_0_b_1"}_"$dyn_single_palette"{"$col_0_r_2","$col_0_g_2","$col_0_b_2"}_"$dyn_single_palette"{"$col_0_r_3","$col_0_g_3","$col_0_b_3"}_"$dyn_single_palette"{"$col_0_r_4","$col_0_g_4","$col_0_b_4"}_"$dyn_single_palette"{"$col_0_r_5","$col_0_g_5","$col_0_b_5"}_"$dyn_single_palette"{"$col_0_r_6","$col_0_g_6","$col_0_b_6"}_"$dyn_single_palette"{"$col_a_r_0","$col_a_g_0","$col_a_b_0"}_"$use_foreground"{"$col_a_r_1","$col_a_g_1","$col_a_b_1"}_"$use_foreground"{"$col_a_r_2","$col_a_g_2","$col_a_b_2"}_"$use_foreground"{"$col_a_r_3","$col_a_g_3","$col_a_b_3"}_"$use_foreground"{"$col_a_r_4","$col_a_g_4","$col_a_b_4"}_"$use_foreground"{"$col_a_r_5","$col_a_g_5","$col_a_b_5"}_"$use_foreground"{"$col_a_r_6","$col_a_g_6","$col_a_b_6"}_"$use_foreground"{"$col_b_r_0","$col_b_g_0","$col_b_b_0"}_"$use_background"{"$col_b_r_1","$col_b_g_1","$col_b_b_1"}_"$use_background"{"$col_b_r_2","$col_b_g_2","$col_b_b_2"}_"$use_background"{"$col_b_r_3","$col_b_g_3","$col_b_b_3"}_"$use_background"{"$col_b_r_4","$col_b_g_4","$col_b_b_4"}_"$use_background"{"$col_b_r_5","$col_b_g_5","$col_b_b_5"}_"$use_background"{"$col_b_r_6","$col_b_g_6","$col_b_b_6"}_"$use_background"{$81}""{$82}_"$cond_not_double_concatenation"{$83}_"$use_shape"{$84}_"$cond_mul_img"{$85}_"$act_use_shape"{$86}_"$act_use_shape"{$87}_"$act_use_shape"{$88}_"$act_use_shape"{$89}_"$act_use_shape"{$90}_"$use_dragon_curve"{$91}_"$use_dragon_curve"{$92}_"$use_fern"{$93}_"$use_fern"{$94}_"$use_gear"{$95}_"$use_gear"{$96}_"$use_gear"{$97}_"$use_gear"{$98}_"$use_polygon"{$99}_"$use_snowflake"{$100}_"$use_star"{$101}_"$use_star"{$102}_"$cond_not_double_concatenation"{$103}_"$cond_double_concatenation"{$104}_"$cond_double_concatenation"{0}_"$cond_not_double_concatenation"{0}_"$cond_double_concatenation"{0}_"$cond_double_concatenation"{0}_"$cond_double_concatenation"{"$start_a"}""{"$start_b"}""{"$base_a"}""{"$base_b"}""{"$method_a"}""{"$method_b"}""{"$col_0_r_0","$col_0_g_0","$col_0_b_0"}""{"$col_0_r_1","$col_0_g_1","$col_0_b_1"}""{"$col_0_r_2","$col_0_g_2","$col_0_b_2"}""{"$col_0_r_3","$col_0_g_3","$col_0_b_3"}""{"$col_0_r_4","$col_0_g_4","$col_0_b_4"}""{"$col_0_r_5","$col_0_g_5","$col_0_b_5"}""{"$col_0_r_6","$col_0_g_6","$col_0_b_6"}""{"$col_a_r_0","$col_a_g_0","$col_a_b_0"}""{"$col_a_r_1","$col_a_g_1","$col_a_b_1"}""{"$col_a_r_2","$col_a_g_2","$col_a_b_2"}""{"$col_a_r_3","$col_a_g_3","$col_a_b_3"}""{"$col_a_r_4","$col_a_g_4","$col_a_b_4"}""{"$col_a_r_5","$col_a_g_5","$col_a_b_5"}""{"$col_a_r_6","$col_a_g_6","$col_a_b_6"}""{"$col_b_r_0","$col_b_g_0","$col_b_b_0"}""{"$col_b_r_1","$col_b_g_1","$col_b_b_1"}""{"$col_b_r_2","$col_b_g_2","$col_b_b_2"}""{"$col_b_r_3","$col_b_g_3","$col_b_b_3"}""{"$col_b_r_4","$col_b_g_4","$col_b_b_4"}""{"$col_b_r_5","$col_b_g_5","$col_b_b_5"}""{"$col_b_r_6","$col_b_g_6","$col_b_b_6"}" +fx_rep_nebulous: +convert_colors=${arg\ 1+$1,to_rgb,ryb2rgb,hsi82rgb,hsl82rgb,hsv82rgb,lab82rgb,lch82rgb,yiq82rgb,yuv82rgb,xyz82rgb,yes82rgb,k182rgb,ohta82rgb,ycocgr2rgb} +foreach { +rep_nebulous ${2-8},{$1>4&&$1<9?$9+180:$9},{$10*$11},${12-16},{$1>4&&$1<9?$17!=0?($17>=3?3+(4-$17):1+(2-$17)):$17},{$18+1},$19 + 1 * 127.5 +if $1&&$16 +$convert_colors. +fi +if $16==1 +s c,{if(s==4,-3,if(s==2,-1,-s))} +if $!==2 +to_gray.. a c +else +to_gray +fi +fi +} +fx_rep_nebulous_preview: +fx_rep_nebulous $* +fx_ncee: +foreach { rep_ncee $3,$2,$5,$6,{$4/100},$7,$1,$8,{$9/100} } +fx_ncee_preview: +gui_split_preview "fx_ncee $*",${-3--1} +fx_rep_rpgtiler_noniso: +skip ${3=""} +ww={w} +hh={h} +if '$_host'=='paintdotnet' if $20 +store. pdnimage fi fi +if $2 fileloc="$3" fi +if $16 if $8 rv[^0] else rv fi fi +if $8 blend[^0] alpha +else blend alpha +fi +if $2 i $fileloc +else rep_tileset_n $1 +fi +if $8 +if $10 rep_tiler_n[-2] [-1],${4-7},[0],$9,${11-15} +else rep_tiler_n[-2] [-1],${4-7},[0],$9,,,,${14-15} +fi +k[-2] +else +if $10 rep_tiler_n[-2] [-1],${4-7},,$9,${11-15} +else rep_tiler_n[-2] [-1],${4-7},,$9,,,,${14-15} +fi +k[-2] +fi +if '$_host'=='paintdotnet' if $20 filename="$21/$22" o[0] $filename rm $pdnimage +else +r $ww,$hh,100%,100%,0,0,.5,.5 +fi fi +fx_rep_rpgtiler_noniso_preview: +skip ${3=""} +if $2 fileloc="$3" fi +ww={w} +hh={h} +if $16 rv fi +if $17 f 0 fi +blend alpha +if !$19 +store. bg +if $2 i $fileloc +else rep_tileset_n $1 +fi +tw={w#-1} +th={h#-1} +r. $ww,$hh,100%,100%,0,0 +shift. {floor((w/$4)/2)*$4-(floor($tw/$4/2)-(!$tw%2?1))*$4},{floor((h/$4)/2)*$4-(floor($th/$4/2)-($th%2?1))*$4} +if !$17 $bg rv blend alpha fi +fi +if $10 +drgba ${11-13} +else +drgba +fi +if $18 +f " +begin( +const psx=floor((w/2)/$4)*$4; +const psy=floor((h/2)/$4)*$4; +const border=2; +const border_left=psx+border; +const border_right=psx+$4-border; +const border_up=psy+border; +const border_down=psy+$4-border; +const boundx=psx+$4; +const boundy=psy+$4; +); +tracker=(x>psx&&xpsy&&y=border_right)||(y<=border_up||y>=border_down)?(xor($15,i)>128?0:255):i):i; +grid=!(((x%$4)==0||(y%$4)==0)||(x==(w-1)||y==(h-1)))?tracker:$14; +" +fi +if '$_host'=='paintdotnet' pdn=1 else pdn=0 fi +u "{$1}_"{!$2?2:1}"{$2}""{$3}_"{$2?2:1}"{$4}""{$5}""{$6}""{$7}""{$8}""{$9}""{$10}""{$11,$12,$13}_"{$10?2:1}"{$14}""{$15}""{$16}_"{!$pdn?2:0}"{$17}""{$18}""{$19}""{$20}_"{$pdn?2:0}"{$21}_"{$pdn?($20?2:1):0}"{$22}_"{$pdn?($20?2:1):0} +gui_rep_sptbwgp_recpoltrans: +position={$1%} +influence={$2%} +threshold={$3%*255} +px={(($4-50)*2)/100} +py={(($5-50)*-2)/100} +rep_sptbwgp_recpoltrans $position,$influence,$threshold,$px,$py +gui_rep_sptbwgp_recpoltrans_preview: +gui_split_preview "gui_rep_sptbwgp_recpoltrans ${1-5}",${-3--1} +gui_rep_objvf: +if $7 preserve_choice={($6+1)*-1} +else preserve_choice=$5 +fi +if !$1 +foreach { +colour={vectors(${8-11})} +if s==2||s>3 +ss={s-1} +colour={vector$ss(${8-11})} +sh {s-1} +maxalp={iM#-1} ++f. i#-1?1 +sumnalp={1-(is#-1/wh#-1)} +rm. +if $sumnalp>$2% +rm. +rep_objvf $3%,$4%,$preserve_choice +else +if !iv#-1 +alp=$maxalp +else +alp=0 +fi +rm. +rep_objvf $3%,$4%,$preserve_choice,$colour,$alp +fi +else +colour={vectors(${8-11})} +rep_objvf $3%,$4%,$preserve_choice,$colour +fi +} +elif $1==1 +rep_objvf $3%,$4%,$preserve_choice +else +colour={vectors(${8-11})} +rep_objvf $3%,$4%,$preserve_choice,$colour +fi +gui_rep_objvf_preview: +show_colour,current_layer=0 +if !$1 +do +local[$current_layer] { +if s==2||s>3 +{w},{h},100%,1,i(#-1,x,y,z,s-1)?1 +sumnalp={1-(is#-1/wh#-1)} +if $1>$2% show_colour=1 fi +rm. +fi +} +current_layer+=1 +while !$show_colour&&$current_layer<$! +elif $1==2 show_colour=1 +fi +if $16==2 channels {s-1} +elif $16==1 channels 0,{s-2} +else +if $12 ++gui_rep_objvf ${1-11} +f begin(ss={s-1};);if(i(x,y,z,ss),i,0); +f.. I!=I#-1?[${13-15},255]:I +else +gui_rep_objvf ${1-11} +fi +fi +u "{$1}""{$2}"_{!$1?2:0}"{$3}""{$4}""{$5}"_{!$7?2:0}"{$6}"_{$7?2:0}"{$7}""{$8,$9,$10,$11}"_{$show_colour?2:0}"{$12}"_{!$16?2:1}"{$13,$14,$15}"_{($12&&!$16)?2:1}"{$16}""{$17}"_0 +fx_rep_loupasc_ordered_dither: +foreach { +if $3 +to_graya sh. 0 rep_loupasc_ordered_dither. $1,$2 rm. +else +sh. 0,2 rep_loupasc_ordered_dither. $1,$2 rm. +fi +} +fx_rep_loupasc_ordered_dither_preview: +gui_split_preview "fx_rep_loupasc_ordered_dither ${1-3}",${-3--1} +rep_fx_shift: f "begin(const ox=($1-50)/100*(w-1);const oy=($2-50)/100*(h-1);); +i(x-ox,y-oy,z,c,$4,$3);" +rep_fx_shift_preview: gui_split_preview "rep_fx_shift ${1-4}",${-3--1} +gui_rep_perspective_streak: +px={(($1-50)*2)/100} +py={(($2-50)*-2)/100} +if $px<-1 px=-1 +elif $px>1 px=1 +fi +if $py<-1 px=-1 +elif $py>1 px=1 +fi +rep_pstrk $px,$py,$3%,$4%,$5%,$6,$7,$8,255 +if $7 * 255 fi +gui_rep_perspective_streak_preview: +gui_split_preview "gui_rep_perspective_streak ${1-8}",${-3--1} +u "{$1,$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}_"{$7!=2?2:1}"{$9,$10}""{$11}" +fx_rep_photomosaic: +fileloc="$2" +filename="$12/$13" +ww={w} +hh={h} +if '$_host'=='paintdotnet' +k[0] ig $fileloc rep_photomosaic[0] [^0],$4,$5,{$6/100},${7-9} k[0] +if $11==0||$11==2 o[0] $filename fi +if $11 r $ww,$hh,100%,100%,0,0,.5,.5 fi +else +if ($!>2)&&!$1 +if $3 rv fi rep_photomosaic[0] [^0],$4,$5,{$6/100},${7-9} if !$3 k[0] fi +else +imgs={$!} ig $fileloc rep_photomosaic[0-{$imgs-1}] [$imgs--1],$4,$5,{$6/100},${7-9} k[0-{$imgs-1}] +fi +if $10 r $ww,$hh,100%,100%,0,0,.5,.5 fi +fi +fx_rep_photomosaic_preview: +if '$_host'=='paintdotnet' pdn=1 else pdn=0 fi +imgs={$!} +fx_rep_photomosaic $1,"$2",${3-11},"$12","$13" +a={$pdn?($11==0||$11==2?2:1)} +u "{$1}_"{!$pdn?($imgs<2?1:2)}"{$2}_"{!$pdn?($imgs>2?($1?2:1):2):2}"{$3}_"{!$pdn?($imgs>2?(!$1?2:1):2)}"{$4}""{$5}""{$6}""{$7}""{$8}""{$9}""{$10}_"{!$pdn?2}"{$11}_"{$pdn?2}"{$12}_"$a"{$13}_"$a +fx_rep_pxpush: rep_pxpush {($1/100-.5)*2},{($2/100-.5)*2} +fx_pxpush_preview: gui_split_preview "fx_rep_pxpush $*",${-3--1} +gui_rep_pw: +rep_pw $1%,$2%,$3%,{($4/100-.5)*2},{($5/100-.5)*-2},$6,$7 +gui_rep_pw_preview: +gui_split_preview "gui_rep_pw ${1-7}",${-3--1} +fx_rep_pfrac: +ox={(($7-50)/100)*2} +oy={(($8-50)/100)*-2} +setarg=${1-6},$ox,$oy +midpoint_shift={1-abs($20)} +if $10 +if $9 setarg2=${17-19} +else setarg2=$17,$19 +fi +else +if $9 setarg2=${11-16} +else setarg2=$11,$13,$14,$16 +fi +fi +local[0] { +rep_pfrac $setarg,$9,$setarg2 +val_max={iM} +n 0,1 +if $20>=0 f i^$midpoint_shift +else f 1-((1-i)^$midpoint_shift) +fi +if $22 n 0,255 +else * {$21*$val_max} +fi +} +fx_rep_pfrac_preview: +fx_rep_pfrac ${1-22} +if $23 ++f[0] i>0?1 +fillperc={ia*100} rm. +fillperc_l={int($fillperc)} +fillperc_r={int(($fillperc-$fillperc_l)*100)} +fillratio=$fillperc_l +fillratio.=. +fillratio.=$fillperc_r +fillratio.=% +to[0] $fillratio,.5~,.5~,18% +fi +k[0] +a={!$10?2:0} +b={$10?2:0} +c={!$10?($9?2:0):0} +d={$10?($9?2:0):0} +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7,$8}""{$9}""{$10}""{$11}_"$a"{$12}_"$c"{$13}_"$a"{$14}_"$a"{$15}_"$c"{$16}_"$a"{$17}_"$b"{$18}_"$d"{$19}_"$b"{$20}""{$21}_"{$22?1:2}"{$22}""{$23}" +fx_rep_pfrac_t_rs: +if $10 +if $11 +if $26==2 set_arg_a=$26,${30-32} +elif $26==1 set_arg_a=$26,${28-29} +else set_arg_a=${26-27} +fi +if $33==2 set_arg_b=$33,${37-39} +elif $33==1 set_arg_b=$33,${35-36} +else set_arg_b=${33-34} +fi +if $40==2 set_arg_c=$40,${44-46} +elif $40==1 set_arg_c=$40,${42-43} +else set_arg_c=${40-41} +fi +set_arg_d=$set_arg_a +set_arg_e=$set_arg_b +set_arg_f=$set_arg_c +else +if $62==2 set_arg_a=$62,${66-68} +elif $62==1 set_arg_a=$62,${64-65} +else set_arg_a=${62-63} +fi +if $69==2 set_arg_b=$69,${73-75} +elif $69==1 set_arg_b=$69,${71-72} +else set_arg_b=${69-70} +fi +if $76==2 set_arg_c=$76,${80-82} +elif $76==1 set_arg_c=$76,${78-79} +else set_arg_c=${76-77} +fi +if $97==2 set_arg_d=$97,${101-103} +elif $97==1 set_arg_d=$97,${99-100} +else set_arg_d=${97-98} +fi +if $104==2 set_arg_e=$104,${108-110} +elif $104==1 set_arg_e=$104,${106-107} +else set_arg_e=${104-105} +fi +if $111==2 set_arg_f=$111,${115-117} +elif $111==1 set_arg_f=$111,${113-114} +else set_arg_f=${111-112} +fi +fi +form_args=$set_arg_a,$set_arg_b,$set_arg_c,$set_arg_d,$set_arg_e,$set_arg_f +else +if $11 +if $12==2 set_arg_a=$12,${16-18} +elif $12==1 set_arg_a=$12,${14-15} +else set_arg_a=${12-13} +fi +if $19==2 set_arg_b=$19,${23-25} +elif $19==1 set_arg_b=$19,${21-22} +else set_arg_b=${19-20} +fi +set_arg_c=$set_arg_a +set_arg_d=$set_arg_b +else +if $48==2 set_arg_a=$48,${52-54} +elif $48==1 set_arg_a=$48,${50-51} +else set_arg_a=${48-49} +fi +if $55==2 set_arg_b=$48,${59-61} +elif $55==1 set_arg_b=$48,${57-58} +else set_arg_b=${55-56} +fi +if $83==2 set_arg_c=$83,${87-89} +elif $83==1 set_arg_c=$83,${85-86} +else set_arg_c=${83-84} +fi +if $90==2 set_arg_d=$90,${94-96} +elif $90==1 set_arg_d=$90,${92-93} +else set_arg_d=${90-91} +fi +fi +form_args=$set_arg_a,$set_arg_b,$set_arg_c,$set_arg_d +fi +rep_popcorn_fractal_transformative_regular_and_swirling[0] {$9?-$1:$1},${2-6},{($7-50)/50},{((100-$8)-50)/50},$10,$form_args +if $118!=100 cut[0] 0,{iM*$118%} fi +rep_exponential_sigmoid_adjustment[0] ${119-121},{$123?-255:$122} +if $124 cut[0] 0,255 negate fi +t4_xy:=!$10&&$11?2 +t6_xy:=$10&&$11?2 +t4_sxy:=!$10&&!$11?2 +t6_sxy:=$10&&!$11?2 +t4_sxy_x:=$t4_sxy&&!$47?2 +t4_sxy_y:=$t4_sxy&&$47?2 +t6_sxy_x:=$t6_sxy&&!$47?2 +t6_sxy_y:=$t6_sxy&&$47?2 +t4_xy_expr_a_mode_0:=$t4_xy?$12==0?2 +t4_xy_expr_a_mode_1:=$t4_xy?$12==1?2 +t4_xy_expr_a_mode_2:=$t4_xy?$12==2?2 +t4_xy_expr_b_mode_0:=$t4_xy?$19==0?2 +t4_xy_expr_b_mode_1:=$t4_xy?$19==1?2 +t4_xy_expr_b_mode_2:=$t4_xy?$19==2?2 +t6_xy_expr_a_mode_0:=$t6_xy?$26==0?2 +t6_xy_expr_a_mode_1:=$t6_xy?$26==1?2 +t6_xy_expr_a_mode_2:=$t6_xy?$26==2?2 +t6_xy_expr_b_mode_0:=$t6_xy?$33==0?2 +t6_xy_expr_b_mode_1:=$t6_xy?$33==1?2 +t6_xy_expr_b_mode_2:=$t6_xy?$33==2?2 +t6_xy_expr_c_mode_0:=$t6_xy?$40==0?2 +t6_xy_expr_c_mode_1:=$t6_xy?$40==1?2 +t6_xy_expr_c_mode_2:=$t6_xy?$40==2?2 +t4_x_expr_a_mode_0:=$t4_sxy_x?$48==0?2 +t4_x_expr_a_mode_1:=$t4_sxy_x?$48==1?2 +t4_x_expr_a_mode_2:=$t4_sxy_x?$48==2?2 +t4_x_expr_b_mode_0:=$t4_sxy_x?$55==0?2 +t4_x_expr_b_mode_1:=$t4_sxy_x?$55==1?2 +t4_x_expr_b_mode_2:=$t4_sxy_x?$55==2?2 +t6_x_expr_a_mode_0:=$t6_sxy_x?$62==0?2 +t6_x_expr_a_mode_1:=$t6_sxy_x?$62==1?2 +t6_x_expr_a_mode_2:=$t6_sxy_x?$62==2?2 +t6_x_expr_b_mode_0:=$t6_sxy_x?$69==0?2 +t6_x_expr_b_mode_1:=$t6_sxy_x?$69==1?2 +t6_x_expr_b_mode_2:=$t6_sxy_x?$69==2?2 +t6_x_expr_c_mode_0:=$t6_sxy_x?$76==0?2 +t6_x_expr_c_mode_1:=$t6_sxy_x?$76==1?2 +t6_x_expr_c_mode_2:=$t6_sxy_x?$76==2?2 +t4_y_expr_a_mode_0:=$t4_sxy_y?$83==0?2 +t4_y_expr_a_mode_1:=$t4_sxy_y?$83==1?2 +t4_y_expr_a_mode_2:=$t4_sxy_y?$83==2?2 +t4_y_expr_b_mode_0:=$t4_sxy_y?$90==0?2 +t4_y_expr_b_mode_1:=$t4_sxy_y?$90==1?2 +t4_y_expr_b_mode_2:=$t4_sxy_y?$90==2?2 +t6_y_expr_a_mode_0:=$t6_sxy_y?$97==0?2 +t6_y_expr_a_mode_1:=$t6_sxy_y?$97==1?2 +t6_y_expr_a_mode_2:=$t6_sxy_y?$97==2?2 +t6_y_expr_b_mode_0:=$t6_sxy_y?$104==0?2 +t6_y_expr_b_mode_1:=$t6_sxy_y?$104==1?2 +t6_y_expr_b_mode_2:=$t6_sxy_y?$104==2?2 +t6_y_expr_c_mode_0:=$t6_sxy_y?$111==0?2 +t6_y_expr_c_mode_1:=$t6_sxy_y?$111==1?2 +t6_y_expr_c_mode_2:=$t6_sxy_y?$111==2?2 +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7,$8}""{$9}""{$10}""{$11}""{$12}_"$t4_xy"{$13}_"$t4_xy_expr_a_mode_0"{$14}_"$t4_xy_expr_a_mode_1"{$15}_"$t4_xy_expr_a_mode_1"{$16}_"$t4_xy_expr_a_mode_2"{$17}_"$t4_xy_expr_a_mode_2"{$18}_"$t4_xy_expr_a_mode_2"{$19}_"$t4_xy"{$20}_"$t4_xy_expr_b_mode_0"{$21}_"$t4_xy_expr_b_mode_1"{$22}_"$t4_xy_expr_b_mode_1"{$23}_"$t4_xy_expr_b_mode_2"{$24}_"$t4_xy_expr_b_mode_2"{$25}_"$t4_xy_expr_b_mode_2"{$26}_"$t6_xy"{$27}_"$t6_xy_expr_a_mode_0"{$28}_"$t6_xy_expr_a_mode_1"{$29}_"$t6_xy_expr_a_mode_1"{$30}_"$t6_xy_expr_a_mode_2"{$31}_"$t6_xy_expr_a_mode_2"{$32}_"$t6_xy_expr_a_mode_2"{$33}_"$t6_xy"{$34}_"$t6_xy_expr_b_mode_0"{$35}_"$t6_xy_expr_b_mode_1"{$36}_"$t6_xy_expr_b_mode_1"{$37}_"$t6_xy_expr_b_mode_2"{$38}_"$t6_xy_expr_b_mode_2"{$39}_"$t6_xy_expr_b_mode_2"{$40}_"$t6_xy"{$41}_"$t6_xy_expr_c_mode_0"{$42}_"$t6_xy_expr_c_mode_1"{$43}_"$t6_xy_expr_c_mode_1"{$44}_"$t6_xy_expr_c_mode_2"{$45}_"$t6_xy_expr_c_mode_2"{$46}_"$t6_xy_expr_c_mode_2"{$47}_"{!$11?2}"{$48}_"$t4_sxy_x"{$49}_"$t4_x_expr_a_mode_0"{$50}_"$t4_x_expr_a_mode_1"{$51}_"$t4_x_expr_a_mode_1"{$52}_"$t4_x_expr_a_mode_2"{$53}_"$t4_x_expr_a_mode_2"{$54}_"$t4_x_expr_a_mode_2"{$55}_"$t4_sxy_x"{$56}_"$t4_x_expr_b_mode_0"{$57}_"$t4_x_expr_b_mode_1"{$58}_"$t4_x_expr_b_mode_1"{$59}_"$t4_x_expr_b_mode_2"{$60}_"$t4_x_expr_b_mode_2"{$61}_"$t4_x_expr_b_mode_2"{$62}_"$t6_sxy_x"{$63}_"$t6_x_expr_a_mode_0"{$64}_"$t6_x_expr_a_mode_1"{$65}_"$t6_x_expr_a_mode_1"{$66}_"$t6_x_expr_a_mode_2"{$67}_"$t6_x_expr_a_mode_2"{$68}_"$t6_x_expr_a_mode_2"{$69}_"$t6_sxy_x"{$70}_"$t6_x_expr_b_mode_0"{$71}_"$t6_x_expr_b_mode_1"{$72}_"$t6_x_expr_b_mode_1"{$73}_"$t6_x_expr_b_mode_2"{$74}_"$t6_x_expr_b_mode_2"{$75}_"$t6_x_expr_b_mode_2"{$76}_"$t6_sxy_x"{$77}_"$t6_x_expr_c_mode_0"{$78}_"$t6_x_expr_c_mode_1"{$79}_"$t6_x_expr_c_mode_1"{$80}_"$t6_x_expr_c_mode_2"{$81}_"$t6_x_expr_c_mode_2"{$82}_"$t6_x_expr_c_mode_2"{$83}_"$t4_sxy_y"{$84}_"$t4_y_expr_a_mode_0"{$85}_"$t4_y_expr_a_mode_1"{$86}_"$t4_y_expr_a_mode_1"{$87}_"$t4_y_expr_a_mode_2"{$88}_"$t4_y_expr_a_mode_2"{$89}_"$t4_y_expr_a_mode_2"{$90}_"$t4_sxy_y"{$91}_"$t4_y_expr_b_mode_0"{$92}_"$t4_y_expr_b_mode_1"{$93}_"$t4_y_expr_b_mode_1"{$94}_"$t4_y_expr_b_mode_2"{$95}_"$t4_y_expr_b_mode_2"{$96}_"$t4_y_expr_b_mode_2"{$97}_"$t6_sxy_y"{$98}_"$t6_y_expr_a_mode_0"{$99}_"$t6_y_expr_a_mode_1"{$100}_"$t6_y_expr_a_mode_1"{$101}_"$t6_y_expr_a_mode_2"{$102}_"$t6_y_expr_a_mode_2"{$103}_"$t6_y_expr_a_mode_2"{$104}_"$t6_sxy_y"{$105}_"$t6_y_expr_b_mode_0"{$106}_"$t6_y_expr_b_mode_1"{$107}_"$t6_y_expr_b_mode_1"{$108}_"$t6_y_expr_b_mode_2"{$109}_"$t6_y_expr_b_mode_2"{$110}_"$t6_y_expr_b_mode_2"{$111}_"$t6_sxy_y"{$112}_"$t6_y_expr_c_mode_0"{$113}_"$t6_y_expr_c_mode_1"{$114}_"$t6_y_expr_c_mode_1"{$115}_"$t6_y_expr_c_mode_2"{$116}_"$t6_y_expr_c_mode_2"{$117}_"$t6_y_expr_c_mode_2"{$118}""{$119}""{$120}""{$121}""{$122}_"{$123?1:2}"{$123}""{$124}" +fx_rep_premade_palette: +xpos,ypos,split_width,scaling,flip_row,rotation_angle,mir_x,mir_y,pal_to_img={$2/2}~,{$3/2}~,${4-6},{((3-$7)-1)*(90*(($8!=$9)?-1:1))},${8-9},$10 ++pal $1 +to_rgba +local[-1] { +s x,-$split_width +if $flip_row&&$!>1 mirror[1--1:2] x fi +a y +} +rotate. $rotation_angle +if $mir_x mirror. x fi +if $mir_y mirror. y fi +r2dx. {w*$scaling},1 +split_opacity. to_rgba.. +store[-2,-1] palette_img +foreach { +if !$pal_to_img {w},{h},1,100% rm.. fi +$palette_img +j[-3] [-2],$xpos,$ypos,0,0,1,[-1],255 +rm[-2,-1] +} +fx_rep_premade_palette_preview: +fx_rep_premade_palette ${1-10} +message_out,act_exp="Available for Export!",$15 +format_choice=${arg\ $13+1,gpl,pdn_pal,jasc} +use_pdn:=['$format_choice']==['pdn_pal'] +enable_export=2 ++pal $1 +if $1!=$-1 +output_name={-1,n} +else +output_name="$12" +fi +rep_correct_exp_ne $output_name +new_out=${} +if $act_exp +rep_output_$format_choice. "$11"/$new_out +if $use_pdn +if whd#-1>96 message_out="Export failed! 96 or less color only for PDN Palette." fi +else message_out="Successfully Exported!" +fi +elif $use_pdn&&whd#-1>96 +enable_export=1 +message_out="96 Colors Restriction Exceeded! Disabled Export!" +fi +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}""{$9}""{$10}""{$11}""{"$new_out"}""{$13}""{"$message_out"}""{0}_"$enable_export"{$1}" +gui_rep_prime_surface: +rep_prime_surface {w},{h},$1,$2 k. n 0,255 +fx_rep_mj_prn: +pos_x={min(max(($7/100-.5)*2,-1),1)} +pos_y={min(max(($8/100-.5)*2,-1),1)} +rep_mj_prn ${1-2},${4-6},$pos_x,$pos_y,$9,$3,${11-12},$10 +fx_rep_mj_prn_preview: +fx_rep_mj_prn $* +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7,$8}""{$9}""{$10}""{$11}""{$12}_"{$11?2:1} +fx_rep_rainbowify: rep_rainbowify ${1-2},$3% +fx_rep_rainbowify_preview: +gui_split_preview "fx_rep_rainbowify ${1-3}",${-3--1} +fx_rep_randgradbar: +srand $1 +foreach { +if $12==0&&$13==0 rep_random_gradient_bars $2%,$3%,$4,$5,{$6/100-.5},{(100-$7)/100-.5},${8-11},-1,,$17,$14,${15-16},$18,$19,$20,$21,$22,$23 +else rep_random_gradient_bars $2%,$3%,$4,$5,{$6/100-.5},{(100-$7)/100-.5},${8-11},{$12-1},{$13-1},$17,$14,${15-16},$18,$19,$20,$21,$22,$23 +fi +if $17==0 sh. 0 n. 0,255 rm. fi +} +fx_rep_randgradbar_preview: +fx_rep_randgradbar ${1-23} +use_color={$17==0?1:($17==1?2:(($3>0&&$14)?2:1))} +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7,$8}""{$9}""{$10}""{$11}""{$12}""{$13}_"{!$12?2:1}"{$14}_"{$3?2:1}"{$15}""{$16}""{$17}""{$18,$19,$20}_"$use_color"{$21,$22,$23}_"$use_color"{$24}""{$25}""{$26}" +fx_rep_rrd: +border_size={max(0,round($2*$7/100))} +rgb_col=${rep_int82hex\ ${14-16}} +if $8==2 +if $12 rep_random_rectangular_division ${1-3},$4%,$5,$7%,$6,$9,$rgb_col,${11-13} +else rep_random_rectangular_division ${1-3},$4%,$5,$7%,$6,$9,$rgb_col,$11,,$13 +fi +elif $8==1 +rep_random_rectangular_division ${1-3},$4%,$5,$7%,$6,$9,$rgb_col,pal,$10,$13 +else +rep_random_rectangular_division ${1-3},$4%,$5,$7%,$6,$9,$rgb_col +fi +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}""{$9}"_{!$8?2}"{$10}"_{$8==1?2}"{$11}"_{$8==2?2}"{$12}"_{$8==2?2}"{$13}"_{$8?2}"{$14,$15,$16}"_{$border_size?2:1} +fx_rep_rand_sqrrecfill: +ww={w} +hh={h} +if $-1!=1 +square_size=$3 +if $8 +if abs($7) +if $7>0 square_size+={abs($5)} +else square_size+=1 +fi +fi +fi +rw={w-$square_size*2} +rh={h-$square_size*2} +nw={floor($rw/($square_size*($8?(($3+1)/$3):1)))*$square_size} +nh={floor($rh/($square_size*($8?(($3+1)/$3):1)))*$square_size} +if $-1==2 r $nw,$nh,100%,100% fi +fi +if $2 rep_rand_sqrrecfill -1,${3--2} +else +rep_rand_sqrrecfill $1,${3--3} +if $1==0 n. 0,255 fi +fi +if $-1!=1 if $-1==2 f. 255-i fi r. $ww,$hh,100%,100%,0,0,.5,.5 if $-1==2 f. 255-i fi fi +k. +u "{$1}_"{$2?1:2}"{$2}""{$3}""{$4}""{$5}""{$6}""{$7}_"{(($1==0&&$2==0)?0:$8)?2:1}"{$8}_"{$1==0&&$2==0?1:2}"{$9}""{$10}"_{!($1==0&&$2!=1)?2:1}"{$11}""{$12}_"{$2?2:1}"{$13}" +fx_rep_red_acrylic_filter: +skip "${2=}","${9=}" +n_images,cond_import_image,cond_refer_image,ref_image_id,luma_fact,verd_green_min_pt,verd_green_visil,previo_cond_import_image,previo_cond_refer_image,previo_ref_image_id,previo_luma_fact,previo_verd_green_min_pt,previo_verd_green_visil={$!},$1,${3-8},${10-14} +args:=[$luma_fact,$verd_green_min_pt,$verd_green_visil]/100 +if $cond_import_image +if narg("$2") +image_loc="$2" +previo_image_loc="$9" +if !narg($_persistent)||('$image_loc'!='$previo_image_loc') i $image_loc +store. _persistent +else $_persistent +fi +rep_red_acrylic_filter[0--2] [-1],$args +rm[-1] +fi +else +if $n_images&1||$cond_refer_image +if $ref_image_id rep_red_acrylic_filter[0--2] [-1],$args +else rep_red_acrylic_filter[1--1] [0],$args +fi +else +rv rep_red_acrylic_filter ,$args +fi +fi +fx_rep_red_acrylic_filter_preview: +skip "${2=}","${9=}" +n_images:=$! +fx_rep_red_acrylic_filter $* +u "{$1}""{$2}_"{$1?2:1}"{$3}_"{!$1?2}"{$4}_"{!$1?$n_images&1||$1?2}"{$5}""{$6}""{$7}""{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}" +fx_rep_rd: +if $1 +convert_colors_fwd=${arg\ $1,rgb2srgb,rgb2ryb,rgb2cmy,error,rgb2hsi8,rgb2hsl8,rgb2hsv8,rgb2lab8,rgb2lch8,rgb2ycbcr,rgb2yiq8,rgb2yuv8,rgb2yes8,rgb2k18,rgb2ohta8} +convert_colors_bwd=${arg\ $1,srgb2rgb,ryb2rgb,cmy2rgb,error,hsi82rgb,hsl82rgb,hsv82rgb,lab82rgb,lch82rgb,ycbcr2rgb,yiq82rgb,yuv82rgb,yes82rgb,k182rgb,ohta82rgb} +fi +not_cmyk={$1!=4} +foreach { +tcr,convert_back,contain_alpha=3,0,{s==2||s==4} +if (s==3||s==4)&&$1 +convert_back=1 +if $not_cmyk +$convert_colors_fwd +else +if s==3 tcr=4 rgb2cmyk +elif s==4 tcr=4 s c,-3 rgb2cmyk.. a c +fi +fi +fi +if $contain_alpha&&!$2 shared 0,{s-2} fi +rep_reverse_digits. ${3-4} +if $5&&!$4 cut. 0,255 fi +rm. +if $convert_back +if $not_cmyk +$convert_colors_bwd +else +if s==4 cmyk2rgb +elif s==5 s c,-4 cmyk2rgb.. a c +fi +fi +fi +} +fx_rep_rd_preview: +gui_split_preview "fx_rep_rd ${1-5}",${-3--1} +u "{$1}""{$2}""{$3}""{$4}""{$5}_"{1+!$4}"{$6}""{$7,$8}" +gui_rep_recc: error "Use Export Button to export color curve map! This filter does nothing on host!" +gui_rep_recc_preview: +filename="$3/$4" +remove_opacity +if $2 mv. 0 fi +if $5 +rep_recc 256 +r 100%,$1 +o $filename +to "Exported!",.5~,.5~,50%,2,255 +else +rep_recc 256 +r 100%,$1 +if $6 a y fi +fi +u "{$1}""{$2}""{$3}""{$4}""{0}""{$6}" +gui_rep_regm: error "Use Export Button to export gradient! This filter does nothing on host!" +gui_rep_regm_preview: +filename="$4/$5" +if $2 mv. 0 fi +if $6 +rep_reverse_engineer_gradient_map 256,$3 +r 100%,$1 +o $filename +remove_opacity to "Exported!",.5~,.5~,50%,2,255 +else +rep_reverse_engineer_gradient_map 256,$3 +r 100%,$1 +if $7 a y fi +fi +u "{$1}""{$2}""{$3}""{$4}""{$5}""{0}""{$7}" +fx_rep_lerp_rgb_gray: +if $1==6 +if $2 rep_lerp_rgb_gray $6%,$7%,$8%,${9-11} +else rep_lerp_rgb_gray $3%,$4%,$5%,${9-11} +fi +else +if $2 rep_lerp_rgb_gray $6%,$7%,$8%,$1 +else rep_lerp_rgb_gray $3%,$4%,$5%,$1 +fi +fi +fx_rep_lerp_rgb_gray_preview: +if $2 r1,g1,b1,r2,g2,b2={[$6<100?$6:$3,$7<100?$7:$4,$8<100?$8:$5,$6,$7,$8]} +else r1,g1,b1,r2,g2,b2={[$3,$4,$5,$3,$4,$5]} +fi +gui_split_preview "fx_rep_lerp_rgb_gray ${1-11}",${-3--1} +a={$2?0:2} +b={$2?2:0} +c={$1==6?2:0} +u "{$1}""{$2}""{"$r1"}_"$a"{"$g1"}_"$a"{"$b1"}_"$a"{"$r2"}_"$b"{"$g2"}_"$b"{"$b2"}_"$b"{$9}_"$c"{$10}_"$c"{$11}_"$c"{$12}""{$13,$14}" +fx_rep_rbtt: +to_a +if $8 rep_rbtt {$1/100},{$2/100},$3,$5,$6,{$7/100},{($9/100-.5)*2},{($10/100-.5)*-2},$11,$12,$13,$14,$15 +else rep_rbtt {$1/100},{$2/100},$3,$4,,,{($9/100-.5)*2},{($10/100-.5)*-2},$11,$12,$13,$14,$15 +fi +fx_rep_rbtt_preview: gui_split_preview "fx_rep_rbtt ${1-13},{$14*-1},$15",${-3--1} +a={$8?2:1} +u "{$1}""{$2}""{$3}""{$4}_"{!$8?2:1}"{$5}_"$a"{$6}_"$a"{$7}_"$a"{$8}""{$9,$10}""{$11}""{$12}""{$13}_"{$12?2:1}"{$14}""{$15}""{$16}""{$17,$18}" +fx_rep_serendipitous_circle: +ow,oh={w},{h} +if $10 +coeff_a,coeff_b=${3-4} +if !$7 +if $3!=$-2 coeff_a,coeff_b=$3 fi +if $4!=$-1 coeff_a,coeff_b=$4 fi +else +coeff_a,coeff_b=0 +fi +else +coeff_a,coeff_b=${3-4} +if $3!=$16 coeff_a=$3 fi +if $4!=$17 coeff_b=$4 fi +if $7 coeff_a=0 fi +if $8 coeff_b=0 fi +fi +if $coeff_a==0 if $5 coeff_a..=- fi fi +if $coeff_b==0 if $6 coeff_b..=- fi fi +seed={$17?round(u(0,1000000)):$16} +rep_serendipitous_circle ${1-2},$coeff_a,$coeff_b,${11-14},$seed,$18,$15 +sh. 0 sh.. 1 +if $19 +rep_exp_sig_adj.. ${20-22},-255 +n. 0,255 +else +n[-2,-1] 0,255 +fi +rm[-2,-1] +r. $ow,$oh,100%,100%,0,0,.5,.5 +u "{$1}""{$2}""{"$coeff_a"}""{"$coeff_b"}""{$5}_"{$coeff_a?1:2}"{$6}_"{$coeff_b?1:2}"{0}_"{!$10?2}"{0}_"{!$10?2}"{0}_"{$10?2}"{$10}""{$11}""{$12}""{$13}""{$14}""{$15}""{"$seed"}""{0}""{$18}""{$19}""{$20}_"{$19?2:1}"{$21}_"{$19?2:1}"{$22}_"{$19?2:1}"{"$coeff_a"}""{"$coeff_b"}" +rep_sinowaterdist_gui: +rep_sinowaterdist $1,$2,{($3/100)*(w>h?w:h)},$4,$5 +rep_sinowaterdist_gui_preview: +gui_split_preview "rep_sinowaterdist_gui $*",${-3--1} +fx_rep_skew: +rep_skew $1,$2%,${3-6} +rep_skew_preview: +gui_split_preview "fx_rep_skew ${1-6}",${-3--1} +gui_rep_sd: rep_sd ${1-6},{($7-50)*2}%,{($8-50)*2}%,$9,{($10-50)*2}%,{($11-50)*-2}%,$12,{($15-50)*2}%,{($16-50)*2}%,{($13-50)*2}%,{($14-50)*2}%,$17,$18 +gui_rep_sd_preview: gui_split_preview "gui_rep_sd ${1-18}",${-3--1} +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7,$8}""{$9}_"{(($7!=50)||($8!=50))?2:1}"{$10,$11}""{$12}_"{($10!=50)||($11!=50)?2:1}"{$13,$14}""{$15}""{$16}""{$17}""{$18}""{$19}""{$20,21}" +rep_sqrlogpindis_gui: +rep_sqrlogpindis $1,{(($2/100)-.5)*2},{(($3/100)-.5)*-2},{(($4/100)-.5)*2},{(($5/100)-.5)*-2},${6-18} +rep_sqrlogpindis_gui_preview: +gui_split_preview "rep_sqrlogpindis_gui $*",${-3--1} +fx_rep_bchstatfunc_average: +convert_colors_fwd=${arg\ 1+$1,none,rgb2srgb,rgb2ryb,rgb2lab} +convert_colors_bwd=${arg\ 1+$1,none,srgb2rgb,ryb2rgb,lab2rgb} +use_alpha={!$2} +foreach { +if s>=3 +if $1 +sh. 0,2 +$convert_colors_fwd. +rep_bchstatfunc[$use_alpha] ia,0 +$convert_colors_bwd. +rm. +else +sh. 0,2 +rep_bchstatfunc[$use_alpha] ia,0 +rm. +fi +else +if s==2 +sh. 1 +rep_bchstatfunc[$use_alpha] ia,0 +rm. +else +rep_bchstatfunc ia,0 +fi +fi +} +fx_rep_bchstatfunc_average_preview: +gui_split_preview "fx_rep_bchstatfunc_average ${1-2}",${-3--1} +fx_rep_stitch: +if $12 angles={expr('$13+x/w*180',$14);} +else angles={([${16-27}])[0,$15]} +fi +cli_args=$1%,$2%,{$3>1?($4?-$3:$3)},${6-9},$5,${10-11},$angles +rep_stitch $cli_args +u "rep_stitch "$cli_args +fx_rep_stitch_preview: +gui_split_preview "fx_rep_stitch ${1-27}",${-3--1} +more_than_one_ang=!$12?$15>1:1 +if !$12 ++rep_find_nonduplicate_angles {([${16-27}])[0,$15]} +if w#-1==1 more_than_one_ang=0 fi +rm. +fi +activate_nonsym:=$12*2 +activate_sym:=!$activate_nonsym*2 +u "{$1}""{$2}""{$3}""{$4}_"{($3>1)+1}"{$5}""{$6}_"{($more_than_one_ang?1)+1}"{$7}_"{($more_than_one_ang?1)+1}"{$8}""{$9}_"{($more_than_one_ang&&$7?1)+1}"{$10}""{$11}_"{($10?1)+1}"{$12}""{$13}_"$activate_nonsym"{$14}_"$activate_nonsym"{$15}_"$activate_sym"{$16}_"{2*($activate_sym&&$15>0)}"{$17}_"{2*($activate_sym&&$15>1)}"{$18}_"{2*($activate_sym&&$15>2)}"{$19}_"{2*($activate_sym&&$15>3)}"{$20}_"{2*($activate_sym&&$15>4)}"{$21}_"{2*($activate_sym&&$15>5)}"{$22}_"{2*($activate_sym&&$15>6)}"{$23}_"{2*($activate_sym&&$15>7)}"{$24}_"{2*($activate_sym&&$15>8)}"{$25}_"{2*($activate_sym&&$15>9)}"{$26}_"{2*($activate_sym&&$15>10)}"{$27}_"{2*($activate_sym&&$15>11)}"{$28}""{$29,$30}" +rep_strbul_preview: +gui_split_preview "rep_strbul $*",${-3--1} +rep_strbulkal_gui: +rep_strbulkal ${1-3},{(($4/100)-.5)*2},{(($5/100)-.5)*-2},{(($6/100)-.5)*2},{(($7/100)-.5)*-2},${8-12} +rep_strbulkal_gui_preview: +gui_split_preview "rep_strbulkal_gui $*",${-3--1} +fx_rep_tco: +tau={2*pi} +ow={w} +oh={h} +mode={$14+1} +ti=$! +local[0] { +rep_three_coupled_oscillators $1,{$tau*$2%},{$tau*$3%},-$4,$5,{($6-50)/50},{($7-50)/-50},$8 +if $9==0 +if $-1!=1 +if $-1>1 +n 0,{255*$-1} +if $-2!=0 + {$-2*255} fi +modf {$-4?3:2},255,100% +else +n 0,{255*$-1} +fi +else +n 0,255 +fi +if $-2!=0&&(!($-1>1)) ++ {$-2*255} +modf {$-4?3:2},255,100% +fi +if $-3 negate fi +elif $9==1 ++pal $10 +n.. 0,{$-1*(w#-1-1)} +if $-3 negate.. fi +if $-2!=0 +.. {(w#-1-1)*$-2} fi +rep_cubic_map.. [-1],$mode +rm. +fi +if $9!=2 r $ow,$oh,100%,100%,6 fi +} +if $9==2 +if $12 convert_colors_bwd=${arg\ $12,hsi2rgb,hcy2rgb,lab2rgb} fi +ti={$!} +if $ti>1 +rm[^0] +[-1]x{$ti-1} +fi +foreach { +if $12==3 $11,1,1,3,begin(srand($13+$>););[u(0,100),u(-128.014,182.136),u(-155.5,155.5)]; +elif $12 $11,1,1,3,begin(srand($13+$>););[u(0,359.999999),u(0,1),u(0,1)]; +else $11,1,1,3,begin(srand($13););u(255); +fi +n.. 0,{$-1*(w#-1-1)} +if $-3 negate.. fi +if $-2!=0 +.. {(w#-1-1)*$-2} fi +rep_cubic_map.. [-1],$mode +rm. +if $12 $convert_colors_bwd. fi +r $ow,$oh,100%,100%,6 +} +else +k. +if $ti>1 +[-1]x{$ti-1} done +fi +fi +rand_col_set={$9==2?2} +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6,$7}""{$8}""{$9}""{$10}"_{$9==1?2}"{$11}"_$rand_col_set"{$12}"_$rand_col_set"{$13}"_$rand_col_set"{$14}""{$15}""{$16}""{$17}" +gui_rep_form_pixel: +use_dynamic=0 +ti={$!} +if $3 rv fi +if $2==7 +form_id=dragon +form_var=${17-18} +use_dynamic=1 +elif $2==9 +form_id=fern +form_var=$20%,0,1,$19 +use_dynamic=1 +elif $2==11 +form_id=gear +form_var=${21-24} +use_dynamic=1 +elif $2==21 +form_id=polygon +form_var=$25 +use_dynamic=1 +elif $2==24 +form_id=snowflake +form_var=$26 +use_dynamic=1 +elif $2==25 +form_id=star +form_var=$27,{$28/100} +use_dynamic=1 +else +form_id={$2-1} +fi +if !$2 +if $ti==1 . fi +rep_form_pixel[^0] [0],${4-5},$6%,${7-9},${13-14},$10%,${11-12},$1,${15-16} +else +if $use_dynamic +rep_form_pixel $form_id,${4-5},$6%,${7-9},${13-14},$10%,${11-12},$1,${15-16},$form_var +else +rep_form_pixel $form_id,${4-5},$6%,${7-9},${13-14},$10%,${11-12},$1,${15-16} +fi +fi +if !$2 rv fi +if ('$_host'=='paintdotnet')&&!$2 rm[0] fi +gui_rep_form_pixel_preview: +if $3 rv fi +if !$2 +if $!==1 +store _ref +else store[0] _ref +fi +fi +if $3 rv fi +if !$2 +if $!==1 +store _ref +else store[0] _ref +fi +fi +gui_split_preview "if !$2 $_ref rv fi gui_rep_form_pixel ${1-28}",${-3--1} +set_a={$2==7?2} +set_b={$2==9?2} +set_c={$2==11?2} +set_d={$2==25?2} +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}""{$8}""{$9}""{$10}""{$11}_"{$10?2:1}"{$12}""{$13}""{$14}""{$15}""{$16}""{$17}_"$set_a"{$18}_"$set_a"{$19}_"$set_b"{$20}_"$set_b"{$21}_"$set_c"{$22}_"$set_c"{$23}_"$set_c"{$24}_"$set_c"{$25}_"{$2==21?2}"{$26}_"{$2==24?2}"{$27}_"$set_d"{$28}_"$set_d"{$29}""{$30,$31}" +fx_rep_tz: +half_img_diag={norm(w,h)/2} +sw={$1%*$half_img_diag} +sh={$2%*$half_img_diag} +rep_tiled_zoom $sw,$sh,$3,$4 +fx_rep_tz_preview: +gui_split_preview "fx_rep_tz ${1-4}",${-3--1} +gui_rep_trif: rep_trif $1,$2%,$3%,$4 +gui_rep_trif_preview: gui_split_preview "gui_rep_trif ${1-4}",${-3--1} +gui_rep_trps: ac "rep_tr_pixel_sharpener ${1-5}",$6 +gui_rep_trps_preview: gui_split_preview "gui_rep_trps ${1-6}",${-3--1} +u "{$1}""{$2}""{$3}""{$4}_"{$3>2?2:0}"{$5}_"{$3>4?2:0}"{$6}""{$7}""{$8}" +fx_rep_transfer_color_reduced: +skip ${20=""},${1326=""} +if $1330==1 error inv_inp fi +if $1330==2 error import_mode_err fi +use_pal={$1?!$5:1} +img_cont_alp={sum(1-expr('s#x',$!)&1)} +if $img_cont_alp +img_cont_alp=0 +foreach { +if s&1 continue fi +sh. {s#-1-1} +if iv#-1 rm. img_cont_alp=1 break +else rm. +fi +} +fi +if $1318&&$img_cont_alp +if $1 alpha_args=$1319,{$1320/100},$1322 +else alpha_args=$1319,{$1320/100},$1321,$1323,$1324 +fi +else +alpha_args=0 +fi +if $use_pal +if $6==3 +(${29-1308}) +split. x,-5 +a[-256--1] y +permute. yzcx +channels. 0,2 +crop. 0,{$22-1} +store. palette +fi +else +if $7 +if $17 tcrc_arg={2^$13} +else tcrc_arg={2^$14}:{2^$15}:{2^$16} +fi +else +if $12 tcrc_arg=$8 +else tcrc_arg=$9:$10:$11 +fi +fi +fi +fx_rep_tcrc_windows_width,fx_rep_tcrc_window_height=${arg\ $1314+1,$1313,w},${arg\ $1316+1,$1315,h} +if $3&&$4 +fx_rep_tcrc_dither=$4%${arg\ $3,dh,dv,lh,lv,cd,cl} +else +fx_rep_tcrc_dither={$2/100} +fi +foreach { +od={[w-1,h-1]} +if $use_pal +if $6==3 +$palette +if $1 rep_transfer_color_reduced.. :[-1],$fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$alpha_args +else rep_transfer_color_reduced.. [-1],$fx_rep_tcrc_dither,$1311,$1312,$fx_rep_tcrc_windows_width,$fx_rep_tcrc_window_height,$25,$24,$alpha_args +fi +elif $6==1 +if s>2 sh[0] 0,2 +else sh[0] 0 +fi ++colormap. $23,0 rm.. +if $1 rep_transfer_color_reduced.. :[-1],$fx_rep_tcrc_dither,$1311,$1312,$1317,0,$_alpha_args +else rep_transfer_color_reduced.. [-1],$fx_rep_tcrc_dither,$1311,$1312,$fx_rep_tcrc_windows_width,$fx_rep_tcrc_window_height,$25,0,$alpha_args +fi +else ++pal $18 +if $1 rep_transfer_color_reduced.. :[-1],$fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$alpha_args +else rep_transfer_color_reduced.. [-1],$fx_rep_tcrc_dither,$1311,$1312,$fx_rep_tcrc_windows_width,$fx_rep_tcrc_window_height,$25,$24,$alpha_args +fi +fi +rm. +else rep_transfer_color_reduced $tcrc_arg,$fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$alpha_args +fi +if $1330==3 crop 0,0,$od fi +} +fx_rep_transfer_color_reduced_preview: +skip ${20=""},${1326=""} +original_width,original_height={[w#0,h#0]} +imgs,dec_imgs,use_pal,imported={$!},{$!-1},{$1?!$5:1},$1327 +use_custom_pal,num_of_colors,pal_method={$use_pal&&($6>1?1:!$6?$19)},$22,$6 +text_box="$1325" +img_cont_alp={sum(1-expr('s#x',$!)&1)} +if $img_cont_alp +img_cont_alp=0 +foreach { +if s&1 continue fi +sh. {s#-1-1} +if iv#-1 rm. img_cont_alp=1 break +else rm. +fi +} +fi +if $pal_method!=1 +z $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1 +r $_preview_width,$_preview_height,1,100% +fi +if $1309 num_of_colors+=1 fi +if $1314&&$1316 tcrc_windows_width_check,tcrc_windows_height_check,_fx_rep_tcrc_windows_width,_fx_rep_tcrc_window_height=0,0,$1313,$1315 +else tcrc_windows_width_check,tcrc_windows_height_check,_fx_rep_tcrc_windows_width,_fx_rep_tcrc_window_height=$1314,$1316,${arg\ $1314+1,$1313,w},${arg\ $1316+1,$1315,h} +fi +if $1318&&$img_cont_alp +if $1 _alpha_args=$1319,{$1320/100},$1322 +else _alpha_args=$1319,{$1320/100},$1321,$1323,$1324 +fi +else +_alpha_args=0 +fi +if $3&&$4 +_fx_rep_tcrc_dither=$4%${arg\ $3,dh,dv,lh,lv,cd,cl} +else +_fx_rep_tcrc_dither={$2/100} +fi +if narg($_persistent)&&!$use_custom_pal +($_persistent) +repeat 256 { +q={$>*3} +color_$>:=crop(#-1,$q,3) +} +rm. +elif !$use_custom_pal +(${29-1306}) +repeat 256 { +q={$>*5} +color_$>:=crop(#-1,$q,3) +} +_persistent=$color_0,$color_1,$color_2,$color_3,$color_4,$color_5,$color_6,$color_7,$color_8,$color_9,$color_10,$color_11,$color_12,$color_13,$color_14,$color_15,$color_16,$color_17,$color_18,$color_19,$color_20,$color_21,$color_22,$color_23,$color_24,$color_25,$color_26,$color_27,$color_28,$color_29,$color_30,$color_31,$color_32,$color_33,$color_34,$color_35,$color_36,$color_37,$color_38,$color_39,$color_40,$color_41,$color_42,$color_43,$color_44,$color_45,$color_46,$color_47,$color_48,$color_49,$color_50,$color_51,$color_52,$color_53,$color_54,$color_55,$color_56,$color_57,$color_58,$color_59,$color_60,$color_61,$color_62,$color_63,$color_64,$color_65,$color_66,$color_67,$color_68,$color_69,$color_70,$color_71,$color_72,$color_73,$color_74,$color_75,$color_76,$color_77,$color_78,$color_79,$color_80,$color_81,$color_82,$color_83,$color_84,$color_85,$color_86,$color_87,$color_88,$color_89,$color_90,$color_91,$color_92,$color_93,$color_94,$color_95,$color_96,$color_97,$color_98,$color_99,$color_100,$color_101,$color_102,$color_103,$color_104,$color_105,$color_106,$color_107,$color_108,$color_109,$color_110,$color_111,$color_112,$color_113,$color_114,$color_115,$color_116,$color_117,$color_118,$color_119,$color_120,$color_121,$color_122,$color_123,$color_124,$color_125,$color_126,$color_127,$color_128,$color_129,$color_130,$color_131,$color_132,$color_133,$color_134,$color_135,$color_136,$color_137,$color_138,$color_139,$color_140,$color_141,$color_142,$color_143,$color_144,$color_145,$color_146,$color_147,$color_148,$color_149,$color_150,$color_151,$color_152,$color_153,$color_154,$color_155,$color_156,$color_157,$color_158,$color_159,$color_160,$color_161,$color_162,$color_163,$color_164,$color_165,$color_166,$color_167,$color_168,$color_169,$color_170,$color_171,$color_172,$color_173,$color_174,$color_175,$color_176,$color_177,$color_178,$color_179,$color_180,$color_181,$color_182,$color_183,$color_184,$color_185,$color_186,$color_187,$color_188,$color_189,$color_190,$color_191,$color_192,$color_193,$color_194,$color_195,$color_196,$color_197,$color_198,$color_199,$color_200,$color_201,$color_202,$color_203,$color_204,$color_205,$color_206,$color_207,$color_208,$color_209,$color_210,$color_211,$color_212,$color_213,$color_214,$color_215,$color_216,$color_217,$color_218,$color_219,$color_220,$color_221,$color_222,$color_223,$color_224,$color_225,$color_226,$color_227,$color_228,$color_229,$color_230,$color_231,$color_232,$color_233,$color_234,$color_235,$color_236,$color_237,$color_238,$color_239,$color_240,$color_241,$color_242,$color_243,$color_244,$color_245,$color_246,$color_247,$color_248,$color_249,$color_250,$color_251,$color_252,$color_253,$color_254,$color_255 +rm. +fi +if $use_pal +if $use_custom_pal||($6==2?('"$1326"'!='"$20"')) +(${29-1308}) +split. x,-5 +a[-256--1] y +permute. yzcx +fi +if $6==3 +if $27 +sh. 4 +num_of_colors-={is#-1} +t_sub_col={is#-1} +if $t_sub_col +if $num_of_colors +area_fg. 0 +$num_of_colors,1,1,3,"I(#-2,x+i(#-1,x));" +rm.. +else +rm. +num_of_colors=2 +2,1,1,3,vector(#3,x); +fi +else +rm. ++crop. 0,0,0,0,{$num_of_colors-1},0,0,2 +fi +else +sh. 3 +max_val:=iM +pos:=xM +rm. +if $max_val +if $pos==($num_of_colors-1) ++crop. 0,0,0,0,{$num_of_colors-2},0,0,2 +elif !$pos ++crop. 1,0,0,0,{$num_of_colors-1},0,0,2 +else ++crop. 0,0,0,0,{$pos-1},0,0,2 ++crop.. {$pos+1},0,0,0,{$num_of_colors-1},0,0,2 +a[-2,-1] x +fi +num_of_colors-=1 +else ++crop. 0,0,0,0,{$num_of_colors-1},0,0,2 +fi +fi +image.. . +store. _palette +channels. 0,2 +repeat 256 { color_$>={I(#-1,$>)} } +rm. +if $1 +gui_split_preview "$_palette rep_transfer_color_reduced[^-1] :[-1],$_fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$_alpha_args rm.",${-3--1} +text_out="rep_transfer_color_reduced[^-1] :[-1]",$_fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$_alpha_args +else +gui_split_preview "$_palette rep_transfer_color_reduced[^-1] [-1],$_fx_rep_tcrc_dither,$1311,$1312,$_fx_rep_tcrc_windows_width,$_fx_rep_tcrc_window_height,$25,$24,$_alpha_args rm.",${-3--1} +text_out="rep_transfer_color_reduced[^-1] [-1]",$_fx_rep_tcrc_dither,$1311,$1312,$_fx_rep_tcrc_windows_width,$_fx_rep_tcrc_window_height,$25,$24,$_alpha_args +fi +elif $6==2 +apply_preview_image=0 +if narg($20)?(('$1326'!='$20')||($imported?$21)) +apply_preview_image,imported=1 +num_of_images={$!} +i $20 +if $!>($num_of_images+1) error excess_imgs fi +if whd#-1<2 error inv_pal_dim fi +if w#-1>1&&(h#-1>1||d#-1>1) colormap. 0 +elif w#-1==1&&h#-1>1 rotate. 90 +fi +image.. . +num_of_colors={w#-1} +store. _palette +channels. 0,2 +repeat 256 { color_$>={I(#-1,$>)} } +pal_method=3 +fi +k[0-$dec_imgs] +if $apply_preview_image +if $1 +gui_split_preview "$_palette rep_transfer_color_reduced[^-1] :[-1],$_fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$_alpha_args rm.",${-3--1} +text_out="rep_transfer_color_reduced[^-1] :[-1]",$_fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$_alpha_args +else +gui_split_preview "$_palette rep_transfer_color_reduced[^-1] [-1],$_fx_rep_tcrc_dither,$1311,$1312,$_fx_rep_tcrc_windows_width,$_fx_rep_tcrc_window_height,$25,$24,$_alpha_args rm.",${-3--1} +text_out="rep_transfer_color_reduced[^-1] [-1]",$_fx_rep_tcrc_dither,$1311,$1312,$_fx_rep_tcrc_windows_width,$_fx_rep_tcrc_window_height,$25,$24,$_alpha_args +fi +else +foreach { +sh. 0,2 +100%,100%,100%,4 drgba. blend[-2] [-1],normal,.5 rm. +text_outline. "Awaiting\n palette",.5~,.5~,10% +rm. +} +fi +elif $6==1 +if s>2 sh[0] 0,2 +else sh[0] 0 +fi ++colormap. $23,0 +store. _palette +rm. +z $_preview_x0,$_preview_y0,$_preview_x1,$_preview_y1 +r $_preview_width,$_preview_height,1,100% +if $1 +gui_split_preview "$_palette rep_transfer_color_reduced[^-1] :[-1],$_fx_rep_tcrc_dither,$1311,$1312,$1317,0,$_alpha_args rm.",${-3--1} +text_box="+colormap $23 rep_transfer_color_reduced[^-1] :[-1]",$_fx_rep_tcrc_dither,$1311,$1312,$1317,0,$_alpha_args +else +gui_split_preview "$_palette rep_transfer_color_reduced[^-1] [-1],$_fx_rep_tcrc_dither,$1311,$1312,$_fx_rep_tcrc_windows_width,$_fx_rep_tcrc_window_height,$25,0,$_alpha_args rm.",${-3--1} +text_box="+colormap $23 $_palette rep_transfer_color_reduced[^-1] [-1]",$_fx_rep_tcrc_dither,$1311,$1312,$_fx_rep_tcrc_windows_width,$_fx_rep_tcrc_window_height,$25,0,$_alpha_args +fi +else ++pal $18 +if $19 +num_of_colors:=whd#-1 +channels.. 0,2 +image.. . +repeat 256 { color_$>={I(#-2,$>)} } +rm.. +pal_method=3 +fi +store. _palette +if $1 +gui_split_preview "$_palette rep_transfer_color_reduced[^-1] :[-1],$_fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$_alpha_args rm.",${-3--1} +text_box="rep_transfer_color_reduced[^-1] :[-1]",$_fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$_alpha_args +else +gui_split_preview "$_palette rep_transfer_color_reduced[^-1] [-1],$_fx_rep_tcrc_dither,$1311,$1312,$_fx_rep_tcrc_windows_width,$_fx_rep_tcrc_window_height,$25,$24,$_alpha_args rm.",${-3--1} +text_box="rep_transfer_color_reduced[^-1] [-1]",$_fx_rep_tcrc_dither,$1311,$1312,$_fx_rep_tcrc_windows_width,$_fx_rep_tcrc_window_height,$25,$24,$_alpha_args +fi +fi +else +if $7 +if $17 _tcrc_arg={2^$13} +else _tcrc_arg={2^$14}:{2^$15}:{2^$16} +fi +else +if $12 _tcrc_arg=$8 +else _tcrc_arg=$9:$10:$11 +fi +fi +gui_split_preview "rep_transfer_color_reduced $_tcrc_arg,$_fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$_alpha_args",${-3--1} +text_box="rep_transfer_color_reduced "$_tcrc_arg,$_fx_rep_tcrc_dither,$1311,$1312,$1317,$24,$_alpha_args +fi +out_status=4 +message_out="" +status_color=${1331-1333} +if $pal_method!=2 +if $1328 +pixel_width,pixel_height=${1311-1312} +pixel_ratio_gcd={gcd($pixel_width,$pixel_height)} +if $pixel_ratio_gcd>1 pixel_width,pixel_height/=$pixel_ratio_gcd fi +if min($pixel_width,$pixel_height)>1 out_status=1 +else +f_w={$original_width/$pixel_width} +f_h={$original_height/$pixel_height} +if ($f_w!=int($f_w))||($f_h!=int($f_h)) out_status=3 fi +fi +fi +else out_status=2 +fi +if $out_status==4 +message_out="Pass!" +status_color=62,205,0 +elif $out_status==3 +message_out="Output Trimmed. Proceed Anyway." +status_color=255,194,0 +else +if $out_status==2 message_out="Exit out of Import Mode to proceed with output" +else message_out="Will not output!" +fi +status_color=170,43,0 +fi +display_palette:=$use_pal&&($pal_method==3) +u "{$1}""{$2}_"{$3?1:2}"{$3}""{$4}_"{$3?2:1}"{$5}_"{$1?2}"{"$pal_method"}_"{$1?(!$5?2):2}"{$7}_"{$1&&$5?2}"{$8}_"{$1&&$5&&!$7?($12?2)}"{$9}_"{$1&&$5&&!$7?(!$12?2)}"{$10}_"{$1&&$5&&!$7?(!$12?2)}"{$11}_"{$1&&$5&&!$7?(!$12?2)}"{$12}_"{$1&&$5&&!$7?2}"{$13}_"{$1&&$5&&$7?($17?2)}"{$14}_"{$1&&$5&&$7?(!$17?2)}"{$15}_"{$1&&$5&&$7?(!$17?2)}"{$16}_"{$1&&$5&&$7?(!$17?2)}"{$17}_"{$1&&$5&&$7?2}"{$18}_"{$1?(!$5?(!$pal_method?2)):(!$pal_method?2)}"{0}_"{$1?(!$5?(!$pal_method?2)):(!$pal_method?2)}"{$20}_"{$1?(!$5?($pal_method==2?2)):($pal_method==2?2)}"{0}_"{$1?(!$5?($pal_method==2?2)):($pal_method==2?($imported?2:1))}"{"$num_of_colors"}_"{$1?(!$5?($pal_method==3?2)):($pal_method==3?2)}"{$23}_"{$1?(!$5?($pal_method==1?2)):($pal_method==1?2)}"{$24}_"{$1?(!$5?($pal_method!=1?2)):($pal_method!=1?2)}"{$25}_"{!$1?2}"{$26}_"{$display_palette?2}"{$27}_"{$26&&$display_palette?2}"{0}_"{$26&&$display_palette&&$27?2}"{"$color_0"}_"{$26&&$display_palette&&(0<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(0<$num_of_colors)?(!$27?1+($num_of_colors!=2))}"{0}_"{$26&&$display_palette&&(0<$num_of_colors)?($27?2)}"{"$color_1"}_"{$26&&$display_palette&&(1<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(1<$num_of_colors)?(!$27?1+($num_of_colors!=2))}"{0}_"{$26&&$display_palette&&(1<$num_of_colors)?($27?2)}"{"$color_2"}_"{$26&&$display_palette&&(2<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(2<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(2<$num_of_colors)?($27?2)}"{"$color_3"}_"{$26&&$display_palette&&(3<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(3<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(3<$num_of_colors)?($27?2)}"{"$color_4"}_"{$26&&$display_palette&&(4<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(4<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(4<$num_of_colors)?($27?2)}"{"$color_5"}_"{$26&&$display_palette&&(5<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(5<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(5<$num_of_colors)?($27?2)}"{"$color_6"}_"{$26&&$display_palette&&(6<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(6<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(6<$num_of_colors)?($27?2)}"{"$color_7"}_"{$26&&$display_palette&&(7<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(7<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(7<$num_of_colors)?($27?2)}"{"$color_8"}_"{$26&&$display_palette&&(8<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(8<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(8<$num_of_colors)?($27?2)}"{"$color_9"}_"{$26&&$display_palette&&(9<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(9<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(9<$num_of_colors)?($27?2)}"{"$color_10"}_"{$26&&$display_palette&&(10<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(10<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(10<$num_of_colors)?($27?2)}"{"$color_11"}_"{$26&&$display_palette&&(11<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(11<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(11<$num_of_colors)?($27?2)}"{"$color_12"}_"{$26&&$display_palette&&(12<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(12<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(12<$num_of_colors)?($27?2)}"{"$color_13"}_"{$26&&$display_palette&&(13<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(13<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(13<$num_of_colors)?($27?2)}"{"$color_14"}_"{$26&&$display_palette&&(14<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(14<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(14<$num_of_colors)?($27?2)}"{"$color_15"}_"{$26&&$display_palette&&(15<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(15<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(15<$num_of_colors)?($27?2)}"{"$color_16"}_"{$26&&$display_palette&&(16<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(16<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(16<$num_of_colors)?($27?2)}"{"$color_17"}_"{$26&&$display_palette&&(17<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(17<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(17<$num_of_colors)?($27?2)}"{"$color_18"}_"{$26&&$display_palette&&(18<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(18<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(18<$num_of_colors)?($27?2)}"{"$color_19"}_"{$26&&$display_palette&&(19<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(19<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(19<$num_of_colors)?($27?2)}"{"$color_20"}_"{$26&&$display_palette&&(20<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(20<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(20<$num_of_colors)?($27?2)}"{"$color_21"}_"{$26&&$display_palette&&(21<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(21<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(21<$num_of_colors)?($27?2)}"{"$color_22"}_"{$26&&$display_palette&&(22<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(22<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(22<$num_of_colors)?($27?2)}"{"$color_23"}_"{$26&&$display_palette&&(23<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(23<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(23<$num_of_colors)?($27?2)}"{"$color_24"}_"{$26&&$display_palette&&(24<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(24<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(24<$num_of_colors)?($27?2)}"{"$color_25"}_"{$26&&$display_palette&&(25<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(25<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(25<$num_of_colors)?($27?2)}"{"$color_26"}_"{$26&&$display_palette&&(26<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(26<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(26<$num_of_colors)?($27?2)}"{"$color_27"}_"{$26&&$display_palette&&(27<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(27<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(27<$num_of_colors)?($27?2)}"{"$color_28"}_"{$26&&$display_palette&&(28<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(28<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(28<$num_of_colors)?($27?2)}"{"$color_29"}_"{$26&&$display_palette&&(29<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(29<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(29<$num_of_colors)?($27?2)}"{"$color_30"}_"{$26&&$display_palette&&(30<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(30<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(30<$num_of_colors)?($27?2)}"{"$color_31"}_"{$26&&$display_palette&&(31<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(31<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(31<$num_of_colors)?($27?2)}"{"$color_32"}_"{$26&&$display_palette&&(32<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(32<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(32<$num_of_colors)?($27?2)}"{"$color_33"}_"{$26&&$display_palette&&(33<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(33<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(33<$num_of_colors)?($27?2)}"{"$color_34"}_"{$26&&$display_palette&&(34<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(34<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(34<$num_of_colors)?($27?2)}"{"$color_35"}_"{$26&&$display_palette&&(35<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(35<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(35<$num_of_colors)?($27?2)}"{"$color_36"}_"{$26&&$display_palette&&(36<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(36<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(36<$num_of_colors)?($27?2)}"{"$color_37"}_"{$26&&$display_palette&&(37<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(37<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(37<$num_of_colors)?($27?2)}"{"$color_38"}_"{$26&&$display_palette&&(38<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(38<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(38<$num_of_colors)?($27?2)}"{"$color_39"}_"{$26&&$display_palette&&(39<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(39<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(39<$num_of_colors)?($27?2)}"{"$color_40"}_"{$26&&$display_palette&&(40<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(40<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(40<$num_of_colors)?($27?2)}"{"$color_41"}_"{$26&&$display_palette&&(41<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(41<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(41<$num_of_colors)?($27?2)}"{"$color_42"}_"{$26&&$display_palette&&(42<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(42<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(42<$num_of_colors)?($27?2)}"{"$color_43"}_"{$26&&$display_palette&&(43<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(43<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(43<$num_of_colors)?($27?2)}"{"$color_44"}_"{$26&&$display_palette&&(44<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(44<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(44<$num_of_colors)?($27?2)}"{"$color_45"}_"{$26&&$display_palette&&(45<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(45<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(45<$num_of_colors)?($27?2)}"{"$color_46"}_"{$26&&$display_palette&&(46<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(46<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(46<$num_of_colors)?($27?2)}"{"$color_47"}_"{$26&&$display_palette&&(47<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(47<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(47<$num_of_colors)?($27?2)}"{"$color_48"}_"{$26&&$display_palette&&(48<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(48<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(48<$num_of_colors)?($27?2)}"{"$color_49"}_"{$26&&$display_palette&&(49<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(49<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(49<$num_of_colors)?($27?2)}"{"$color_50"}_"{$26&&$display_palette&&(50<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(50<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(50<$num_of_colors)?($27?2)}"{"$color_51"}_"{$26&&$display_palette&&(51<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(51<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(51<$num_of_colors)?($27?2)}"{"$color_52"}_"{$26&&$display_palette&&(52<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(52<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(52<$num_of_colors)?($27?2)}"{"$color_53"}_"{$26&&$display_palette&&(53<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(53<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(53<$num_of_colors)?($27?2)}"{"$color_54"}_"{$26&&$display_palette&&(54<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(54<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(54<$num_of_colors)?($27?2)}"{"$color_55"}_"{$26&&$display_palette&&(55<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(55<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(55<$num_of_colors)?($27?2)}"{"$color_56"}_"{$26&&$display_palette&&(56<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(56<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(56<$num_of_colors)?($27?2)}"{"$color_57"}_"{$26&&$display_palette&&(57<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(57<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(57<$num_of_colors)?($27?2)}"{"$color_58"}_"{$26&&$display_palette&&(58<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(58<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(58<$num_of_colors)?($27?2)}"{"$color_59"}_"{$26&&$display_palette&&(59<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(59<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(59<$num_of_colors)?($27?2)}"{"$color_60"}_"{$26&&$display_palette&&(60<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(60<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(60<$num_of_colors)?($27?2)}"{"$color_61"}_"{$26&&$display_palette&&(61<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(61<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(61<$num_of_colors)?($27?2)}"{"$color_62"}_"{$26&&$display_palette&&(62<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(62<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(62<$num_of_colors)?($27?2)}"{"$color_63"}_"{$26&&$display_palette&&(63<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(63<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(63<$num_of_colors)?($27?2)}"{"$color_64"}_"{$26&&$display_palette&&(64<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(64<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(64<$num_of_colors)?($27?2)}"{"$color_65"}_"{$26&&$display_palette&&(65<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(65<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(65<$num_of_colors)?($27?2)}"{"$color_66"}_"{$26&&$display_palette&&(66<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(66<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(66<$num_of_colors)?($27?2)}"{"$color_67"}_"{$26&&$display_palette&&(67<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(67<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(67<$num_of_colors)?($27?2)}"{"$color_68"}_"{$26&&$display_palette&&(68<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(68<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(68<$num_of_colors)?($27?2)}"{"$color_69"}_"{$26&&$display_palette&&(69<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(69<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(69<$num_of_colors)?($27?2)}"{"$color_70"}_"{$26&&$display_palette&&(70<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(70<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(70<$num_of_colors)?($27?2)}"{"$color_71"}_"{$26&&$display_palette&&(71<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(71<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(71<$num_of_colors)?($27?2)}"{"$color_72"}_"{$26&&$display_palette&&(72<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(72<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(72<$num_of_colors)?($27?2)}"{"$color_73"}_"{$26&&$display_palette&&(73<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(73<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(73<$num_of_colors)?($27?2)}"{"$color_74"}_"{$26&&$display_palette&&(74<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(74<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(74<$num_of_colors)?($27?2)}"{"$color_75"}_"{$26&&$display_palette&&(75<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(75<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(75<$num_of_colors)?($27?2)}"{"$color_76"}_"{$26&&$display_palette&&(76<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(76<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(76<$num_of_colors)?($27?2)}"{"$color_77"}_"{$26&&$display_palette&&(77<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(77<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(77<$num_of_colors)?($27?2)}"{"$color_78"}_"{$26&&$display_palette&&(78<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(78<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(78<$num_of_colors)?($27?2)}"{"$color_79"}_"{$26&&$display_palette&&(79<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(79<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(79<$num_of_colors)?($27?2)}"{"$color_80"}_"{$26&&$display_palette&&(80<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(80<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(80<$num_of_colors)?($27?2)}"{"$color_81"}_"{$26&&$display_palette&&(81<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(81<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(81<$num_of_colors)?($27?2)}"{"$color_82"}_"{$26&&$display_palette&&(82<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(82<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(82<$num_of_colors)?($27?2)}"{"$color_83"}_"{$26&&$display_palette&&(83<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(83<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(83<$num_of_colors)?($27?2)}"{"$color_84"}_"{$26&&$display_palette&&(84<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(84<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(84<$num_of_colors)?($27?2)}"{"$color_85"}_"{$26&&$display_palette&&(85<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(85<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(85<$num_of_colors)?($27?2)}"{"$color_86"}_"{$26&&$display_palette&&(86<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(86<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(86<$num_of_colors)?($27?2)}"{"$color_87"}_"{$26&&$display_palette&&(87<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(87<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(87<$num_of_colors)?($27?2)}"{"$color_88"}_"{$26&&$display_palette&&(88<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(88<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(88<$num_of_colors)?($27?2)}"{"$color_89"}_"{$26&&$display_palette&&(89<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(89<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(89<$num_of_colors)?($27?2)}"{"$color_90"}_"{$26&&$display_palette&&(90<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(90<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(90<$num_of_colors)?($27?2)}"{"$color_91"}_"{$26&&$display_palette&&(91<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(91<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(91<$num_of_colors)?($27?2)}"{"$color_92"}_"{$26&&$display_palette&&(92<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(92<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(92<$num_of_colors)?($27?2)}"{"$color_93"}_"{$26&&$display_palette&&(93<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(93<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(93<$num_of_colors)?($27?2)}"{"$color_94"}_"{$26&&$display_palette&&(94<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(94<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(94<$num_of_colors)?($27?2)}"{"$color_95"}_"{$26&&$display_palette&&(95<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(95<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(95<$num_of_colors)?($27?2)}"{"$color_96"}_"{$26&&$display_palette&&(96<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(96<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(96<$num_of_colors)?($27?2)}"{"$color_97"}_"{$26&&$display_palette&&(97<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(97<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(97<$num_of_colors)?($27?2)}"{"$color_98"}_"{$26&&$display_palette&&(98<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(98<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(98<$num_of_colors)?($27?2)}"{"$color_99"}_"{$26&&$display_palette&&(99<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(99<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(99<$num_of_colors)?($27?2)}"{"$color_100"}_"{$26&&$display_palette&&(100<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(100<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(100<$num_of_colors)?($27?2)}"{"$color_101"}_"{$26&&$display_palette&&(101<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(101<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(101<$num_of_colors)?($27?2)}"{"$color_102"}_"{$26&&$display_palette&&(102<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(102<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(102<$num_of_colors)?($27?2)}"{"$color_103"}_"{$26&&$display_palette&&(103<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(103<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(103<$num_of_colors)?($27?2)}"{"$color_104"}_"{$26&&$display_palette&&(104<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(104<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(104<$num_of_colors)?($27?2)}"{"$color_105"}_"{$26&&$display_palette&&(105<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(105<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(105<$num_of_colors)?($27?2)}"{"$color_106"}_"{$26&&$display_palette&&(106<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(106<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(106<$num_of_colors)?($27?2)}"{"$color_107"}_"{$26&&$display_palette&&(107<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(107<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(107<$num_of_colors)?($27?2)}"{"$color_108"}_"{$26&&$display_palette&&(108<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(108<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(108<$num_of_colors)?($27?2)}"{"$color_109"}_"{$26&&$display_palette&&(109<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(109<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(109<$num_of_colors)?($27?2)}"{"$color_110"}_"{$26&&$display_palette&&(110<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(110<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(110<$num_of_colors)?($27?2)}"{"$color_111"}_"{$26&&$display_palette&&(111<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(111<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(111<$num_of_colors)?($27?2)}"{"$color_112"}_"{$26&&$display_palette&&(112<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(112<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(112<$num_of_colors)?($27?2)}"{"$color_113"}_"{$26&&$display_palette&&(113<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(113<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(113<$num_of_colors)?($27?2)}"{"$color_114"}_"{$26&&$display_palette&&(114<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(114<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(114<$num_of_colors)?($27?2)}"{"$color_115"}_"{$26&&$display_palette&&(115<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(115<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(115<$num_of_colors)?($27?2)}"{"$color_116"}_"{$26&&$display_palette&&(116<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(116<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(116<$num_of_colors)?($27?2)}"{"$color_117"}_"{$26&&$display_palette&&(117<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(117<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(117<$num_of_colors)?($27?2)}"{"$color_118"}_"{$26&&$display_palette&&(118<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(118<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(118<$num_of_colors)?($27?2)}"{"$color_119"}_"{$26&&$display_palette&&(119<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(119<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(119<$num_of_colors)?($27?2)}"{"$color_120"}_"{$26&&$display_palette&&(120<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(120<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(120<$num_of_colors)?($27?2)}"{"$color_121"}_"{$26&&$display_palette&&(121<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(121<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(121<$num_of_colors)?($27?2)}"{"$color_122"}_"{$26&&$display_palette&&(122<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(122<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(122<$num_of_colors)?($27?2)}"{"$color_123"}_"{$26&&$display_palette&&(123<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(123<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(123<$num_of_colors)?($27?2)}"{"$color_124"}_"{$26&&$display_palette&&(124<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(124<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(124<$num_of_colors)?($27?2)}"{"$color_125"}_"{$26&&$display_palette&&(125<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(125<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(125<$num_of_colors)?($27?2)}"{"$color_126"}_"{$26&&$display_palette&&(126<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(126<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(126<$num_of_colors)?($27?2)}"{"$color_127"}_"{$26&&$display_palette&&(127<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(127<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(127<$num_of_colors)?($27?2)}"{"$color_128"}_"{$26&&$display_palette&&(128<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(128<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(128<$num_of_colors)?($27?2)}"{"$color_129"}_"{$26&&$display_palette&&(129<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(129<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(129<$num_of_colors)?($27?2)}"{"$color_130"}_"{$26&&$display_palette&&(130<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(130<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(130<$num_of_colors)?($27?2)}"{"$color_131"}_"{$26&&$display_palette&&(131<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(131<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(131<$num_of_colors)?($27?2)}"{"$color_132"}_"{$26&&$display_palette&&(132<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(132<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(132<$num_of_colors)?($27?2)}"{"$color_133"}_"{$26&&$display_palette&&(133<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(133<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(133<$num_of_colors)?($27?2)}"{"$color_134"}_"{$26&&$display_palette&&(134<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(134<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(134<$num_of_colors)?($27?2)}"{"$color_135"}_"{$26&&$display_palette&&(135<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(135<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(135<$num_of_colors)?($27?2)}"{"$color_136"}_"{$26&&$display_palette&&(136<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(136<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(136<$num_of_colors)?($27?2)}"{"$color_137"}_"{$26&&$display_palette&&(137<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(137<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(137<$num_of_colors)?($27?2)}"{"$color_138"}_"{$26&&$display_palette&&(138<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(138<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(138<$num_of_colors)?($27?2)}"{"$color_139"}_"{$26&&$display_palette&&(139<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(139<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(139<$num_of_colors)?($27?2)}"{"$color_140"}_"{$26&&$display_palette&&(140<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(140<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(140<$num_of_colors)?($27?2)}"{"$color_141"}_"{$26&&$display_palette&&(141<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(141<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(141<$num_of_colors)?($27?2)}"{"$color_142"}_"{$26&&$display_palette&&(142<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(142<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(142<$num_of_colors)?($27?2)}"{"$color_143"}_"{$26&&$display_palette&&(143<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(143<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(143<$num_of_colors)?($27?2)}"{"$color_144"}_"{$26&&$display_palette&&(144<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(144<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(144<$num_of_colors)?($27?2)}"{"$color_145"}_"{$26&&$display_palette&&(145<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(145<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(145<$num_of_colors)?($27?2)}"{"$color_146"}_"{$26&&$display_palette&&(146<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(146<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(146<$num_of_colors)?($27?2)}"{"$color_147"}_"{$26&&$display_palette&&(147<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(147<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(147<$num_of_colors)?($27?2)}"{"$color_148"}_"{$26&&$display_palette&&(148<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(148<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(148<$num_of_colors)?($27?2)}"{"$color_149"}_"{$26&&$display_palette&&(149<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(149<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(149<$num_of_colors)?($27?2)}"{"$color_150"}_"{$26&&$display_palette&&(150<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(150<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(150<$num_of_colors)?($27?2)}"{"$color_151"}_"{$26&&$display_palette&&(151<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(151<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(151<$num_of_colors)?($27?2)}"{"$color_152"}_"{$26&&$display_palette&&(152<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(152<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(152<$num_of_colors)?($27?2)}"{"$color_153"}_"{$26&&$display_palette&&(153<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(153<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(153<$num_of_colors)?($27?2)}"{"$color_154"}_"{$26&&$display_palette&&(154<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(154<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(154<$num_of_colors)?($27?2)}"{"$color_155"}_"{$26&&$display_palette&&(155<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(155<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(155<$num_of_colors)?($27?2)}"{"$color_156"}_"{$26&&$display_palette&&(156<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(156<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(156<$num_of_colors)?($27?2)}"{"$color_157"}_"{$26&&$display_palette&&(157<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(157<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(157<$num_of_colors)?($27?2)}"{"$color_158"}_"{$26&&$display_palette&&(158<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(158<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(158<$num_of_colors)?($27?2)}"{"$color_159"}_"{$26&&$display_palette&&(159<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(159<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(159<$num_of_colors)?($27?2)}"{"$color_160"}_"{$26&&$display_palette&&(160<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(160<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(160<$num_of_colors)?($27?2)}"{"$color_161"}_"{$26&&$display_palette&&(161<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(161<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(161<$num_of_colors)?($27?2)}"{"$color_162"}_"{$26&&$display_palette&&(162<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(162<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(162<$num_of_colors)?($27?2)}"{"$color_163"}_"{$26&&$display_palette&&(163<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(163<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(163<$num_of_colors)?($27?2)}"{"$color_164"}_"{$26&&$display_palette&&(164<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(164<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(164<$num_of_colors)?($27?2)}"{"$color_165"}_"{$26&&$display_palette&&(165<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(165<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(165<$num_of_colors)?($27?2)}"{"$color_166"}_"{$26&&$display_palette&&(166<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(166<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(166<$num_of_colors)?($27?2)}"{"$color_167"}_"{$26&&$display_palette&&(167<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(167<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(167<$num_of_colors)?($27?2)}"{"$color_168"}_"{$26&&$display_palette&&(168<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(168<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(168<$num_of_colors)?($27?2)}"{"$color_169"}_"{$26&&$display_palette&&(169<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(169<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(169<$num_of_colors)?($27?2)}"{"$color_170"}_"{$26&&$display_palette&&(170<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(170<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(170<$num_of_colors)?($27?2)}"{"$color_171"}_"{$26&&$display_palette&&(171<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(171<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(171<$num_of_colors)?($27?2)}"{"$color_172"}_"{$26&&$display_palette&&(172<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(172<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(172<$num_of_colors)?($27?2)}"{"$color_173"}_"{$26&&$display_palette&&(173<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(173<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(173<$num_of_colors)?($27?2)}"{"$color_174"}_"{$26&&$display_palette&&(174<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(174<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(174<$num_of_colors)?($27?2)}"{"$color_175"}_"{$26&&$display_palette&&(175<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(175<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(175<$num_of_colors)?($27?2)}"{"$color_176"}_"{$26&&$display_palette&&(176<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(176<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(176<$num_of_colors)?($27?2)}"{"$color_177"}_"{$26&&$display_palette&&(177<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(177<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(177<$num_of_colors)?($27?2)}"{"$color_178"}_"{$26&&$display_palette&&(178<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(178<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(178<$num_of_colors)?($27?2)}"{"$color_179"}_"{$26&&$display_palette&&(179<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(179<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(179<$num_of_colors)?($27?2)}"{"$color_180"}_"{$26&&$display_palette&&(180<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(180<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(180<$num_of_colors)?($27?2)}"{"$color_181"}_"{$26&&$display_palette&&(181<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(181<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(181<$num_of_colors)?($27?2)}"{"$color_182"}_"{$26&&$display_palette&&(182<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(182<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(182<$num_of_colors)?($27?2)}"{"$color_183"}_"{$26&&$display_palette&&(183<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(183<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(183<$num_of_colors)?($27?2)}"{"$color_184"}_"{$26&&$display_palette&&(184<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(184<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(184<$num_of_colors)?($27?2)}"{"$color_185"}_"{$26&&$display_palette&&(185<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(185<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(185<$num_of_colors)?($27?2)}"{"$color_186"}_"{$26&&$display_palette&&(186<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(186<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(186<$num_of_colors)?($27?2)}"{"$color_187"}_"{$26&&$display_palette&&(187<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(187<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(187<$num_of_colors)?($27?2)}"{"$color_188"}_"{$26&&$display_palette&&(188<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(188<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(188<$num_of_colors)?($27?2)}"{"$color_189"}_"{$26&&$display_palette&&(189<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(189<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(189<$num_of_colors)?($27?2)}"{"$color_190"}_"{$26&&$display_palette&&(190<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(190<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(190<$num_of_colors)?($27?2)}"{"$color_191"}_"{$26&&$display_palette&&(191<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(191<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(191<$num_of_colors)?($27?2)}"{"$color_192"}_"{$26&&$display_palette&&(192<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(192<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(192<$num_of_colors)?($27?2)}"{"$color_193"}_"{$26&&$display_palette&&(193<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(193<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(193<$num_of_colors)?($27?2)}"{"$color_194"}_"{$26&&$display_palette&&(194<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(194<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(194<$num_of_colors)?($27?2)}"{"$color_195"}_"{$26&&$display_palette&&(195<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(195<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(195<$num_of_colors)?($27?2)}"{"$color_196"}_"{$26&&$display_palette&&(196<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(196<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(196<$num_of_colors)?($27?2)}"{"$color_197"}_"{$26&&$display_palette&&(197<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(197<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(197<$num_of_colors)?($27?2)}"{"$color_198"}_"{$26&&$display_palette&&(198<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(198<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(198<$num_of_colors)?($27?2)}"{"$color_199"}_"{$26&&$display_palette&&(199<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(199<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(199<$num_of_colors)?($27?2)}"{"$color_200"}_"{$26&&$display_palette&&(200<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(200<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(200<$num_of_colors)?($27?2)}"{"$color_201"}_"{$26&&$display_palette&&(201<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(201<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(201<$num_of_colors)?($27?2)}"{"$color_202"}_"{$26&&$display_palette&&(202<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(202<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(202<$num_of_colors)?($27?2)}"{"$color_203"}_"{$26&&$display_palette&&(203<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(203<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(203<$num_of_colors)?($27?2)}"{"$color_204"}_"{$26&&$display_palette&&(204<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(204<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(204<$num_of_colors)?($27?2)}"{"$color_205"}_"{$26&&$display_palette&&(205<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(205<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(205<$num_of_colors)?($27?2)}"{"$color_206"}_"{$26&&$display_palette&&(206<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(206<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(206<$num_of_colors)?($27?2)}"{"$color_207"}_"{$26&&$display_palette&&(207<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(207<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(207<$num_of_colors)?($27?2)}"{"$color_208"}_"{$26&&$display_palette&&(208<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(208<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(208<$num_of_colors)?($27?2)}"{"$color_209"}_"{$26&&$display_palette&&(209<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(209<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(209<$num_of_colors)?($27?2)}"{"$color_210"}_"{$26&&$display_palette&&(210<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(210<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(210<$num_of_colors)?($27?2)}"{"$color_211"}_"{$26&&$display_palette&&(211<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(211<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(211<$num_of_colors)?($27?2)}"{"$color_212"}_"{$26&&$display_palette&&(212<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(212<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(212<$num_of_colors)?($27?2)}"{"$color_213"}_"{$26&&$display_palette&&(213<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(213<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(213<$num_of_colors)?($27?2)}"{"$color_214"}_"{$26&&$display_palette&&(214<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(214<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(214<$num_of_colors)?($27?2)}"{"$color_215"}_"{$26&&$display_palette&&(215<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(215<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(215<$num_of_colors)?($27?2)}"{"$color_216"}_"{$26&&$display_palette&&(216<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(216<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(216<$num_of_colors)?($27?2)}"{"$color_217"}_"{$26&&$display_palette&&(217<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(217<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(217<$num_of_colors)?($27?2)}"{"$color_218"}_"{$26&&$display_palette&&(218<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(218<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(218<$num_of_colors)?($27?2)}"{"$color_219"}_"{$26&&$display_palette&&(219<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(219<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(219<$num_of_colors)?($27?2)}"{"$color_220"}_"{$26&&$display_palette&&(220<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(220<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(220<$num_of_colors)?($27?2)}"{"$color_221"}_"{$26&&$display_palette&&(221<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(221<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(221<$num_of_colors)?($27?2)}"{"$color_222"}_"{$26&&$display_palette&&(222<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(222<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(222<$num_of_colors)?($27?2)}"{"$color_223"}_"{$26&&$display_palette&&(223<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(223<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(223<$num_of_colors)?($27?2)}"{"$color_224"}_"{$26&&$display_palette&&(224<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(224<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(224<$num_of_colors)?($27?2)}"{"$color_225"}_"{$26&&$display_palette&&(225<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(225<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(225<$num_of_colors)?($27?2)}"{"$color_226"}_"{$26&&$display_palette&&(226<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(226<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(226<$num_of_colors)?($27?2)}"{"$color_227"}_"{$26&&$display_palette&&(227<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(227<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(227<$num_of_colors)?($27?2)}"{"$color_228"}_"{$26&&$display_palette&&(228<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(228<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(228<$num_of_colors)?($27?2)}"{"$color_229"}_"{$26&&$display_palette&&(229<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(229<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(229<$num_of_colors)?($27?2)}"{"$color_230"}_"{$26&&$display_palette&&(230<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(230<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(230<$num_of_colors)?($27?2)}"{"$color_231"}_"{$26&&$display_palette&&(231<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(231<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(231<$num_of_colors)?($27?2)}"{"$color_232"}_"{$26&&$display_palette&&(232<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(232<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(232<$num_of_colors)?($27?2)}"{"$color_233"}_"{$26&&$display_palette&&(233<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(233<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(233<$num_of_colors)?($27?2)}"{"$color_234"}_"{$26&&$display_palette&&(234<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(234<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(234<$num_of_colors)?($27?2)}"{"$color_235"}_"{$26&&$display_palette&&(235<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(235<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(235<$num_of_colors)?($27?2)}"{"$color_236"}_"{$26&&$display_palette&&(236<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(236<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(236<$num_of_colors)?($27?2)}"{"$color_237"}_"{$26&&$display_palette&&(237<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(237<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(237<$num_of_colors)?($27?2)}"{"$color_238"}_"{$26&&$display_palette&&(238<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(238<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(238<$num_of_colors)?($27?2)}"{"$color_239"}_"{$26&&$display_palette&&(239<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(239<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(239<$num_of_colors)?($27?2)}"{"$color_240"}_"{$26&&$display_palette&&(240<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(240<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(240<$num_of_colors)?($27?2)}"{"$color_241"}_"{$26&&$display_palette&&(241<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(241<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(241<$num_of_colors)?($27?2)}"{"$color_242"}_"{$26&&$display_palette&&(242<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(242<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(242<$num_of_colors)?($27?2)}"{"$color_243"}_"{$26&&$display_palette&&(243<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(243<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(243<$num_of_colors)?($27?2)}"{"$color_244"}_"{$26&&$display_palette&&(244<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(244<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(244<$num_of_colors)?($27?2)}"{"$color_245"}_"{$26&&$display_palette&&(245<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(245<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(245<$num_of_colors)?($27?2)}"{"$color_246"}_"{$26&&$display_palette&&(246<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(246<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(246<$num_of_colors)?($27?2)}"{"$color_247"}_"{$26&&$display_palette&&(247<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(247<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(247<$num_of_colors)?($27?2)}"{"$color_248"}_"{$26&&$display_palette&&(248<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(248<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(248<$num_of_colors)?($27?2)}"{"$color_249"}_"{$26&&$display_palette&&(249<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(249<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(249<$num_of_colors)?($27?2)}"{"$color_250"}_"{$26&&$display_palette&&(250<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(250<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(250<$num_of_colors)?($27?2)}"{"$color_251"}_"{$26&&$display_palette&&(251<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(251<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(251<$num_of_colors)?($27?2)}"{"$color_252"}_"{$26&&$display_palette&&(252<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(252<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(252<$num_of_colors)?($27?2)}"{"$color_253"}_"{$26&&$display_palette&&(253<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(253<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(253<$num_of_colors)?($27?2)}"{"$color_254"}_"{$26&&$display_palette&&(254<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(254<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(254<$num_of_colors)?($27?2)}"{"$color_255"}_"{$26&&$display_palette&&(255<$num_of_colors)?2}"{0}_"{$26&&$display_palette&&(255<$num_of_colors)?(!$27?2)}"{0}_"{$26&&$display_palette&&(255<$num_of_colors)?($27?2)}"{0}_"{$26&&$display_palette?2}"{0}_"{$26&&$display_palette&&$27?2}"{$1311}""{$1312}""{$1313}_"{!$1?((!$25||$tcrc_windows_width_check)?1:2)}"{"$tcrc_windows_width_check"}_"{!$1?(!$25?1:2)}"{$1315}_"{!$1?((!$25||$tcrc_windows_height_check)?1:2)}"{"$tcrc_windows_height_check"}_"{!$1?(!$25?1:2)}"{$1317}_"{$1?2}"{$1318}_"{$img_cont_alp?2}"{$1319}_"{$img_cont_alp?($1318?2:1)}"{$1320}_"{$img_cont_alp?($1318?2:1)}"{$1321}_"{$img_cont_alp?($1318?(!$1?2):(!$1?1))}"{$1322}_"{$img_cont_alp?($1318?($1?2):($1?1))}"{$1323}_"{$img_cont_alp?($1318?(!$1&&$1321==1?2):(!$1&&$1321==1?1))}"{$1324}_"{$img_cont_alp?($1318?(!$1?($1321==2?2:0)):(!$1?($1321==2?1:0)))}"{"$text_box"}""{$20}""{"$imported"}""{$1328}""{"$message_out"}""{"$out_status"}""{"$status_color"}""{$1334}""{$1335,$1336}" +fx_rep_tg3: +if $1 +convert_colors_fwd=${arg\ $1,rgb2ryb,rgb2cmy,rgb2hsi8,rgb2hsl8,rgb2hsv8,rgb2lab8,rgb2lch8,rgb2yiq8,rgb2yuv8,rgb2xyz8,rgb2yes8,rgb2ohta8,rgb2k18} +convert_colors_bwd=${arg\ $1,ryb2rgb,cmy2rgb,hsi82rgb,hsl82rgb,hsv82rgb,lab82rgb,lch82rgb,yiq82rgb,yuv82rgb,xyz82rgb,yes82rgb,ohta82rgb,k182rgb} +fi +foreach { +if s==4 s c,-3 +store.. color store. alpha contain_alpha=1 +elif s<2 continue +else +store color contain_alpha=0 +fi +sh. 0,2 +if $1 $convert_colors_fwd. fi +if $2 rep_tg3. 8il,$4,${11-31} +else rep_tg3. 8i,$4,${11-31} +fi +if $1 $convert_colors_bwd. fi +cut. 0,255 +rm. +if $3 $color blend luminance fi +if $contain_alpha $alpha a c fi +} +fx_rep_tg3_preview: +cc1,cc2,cc3,cc4,cc5,cc6=$5,$6,$7,$8,$9,$10 +cc=[$cc1,$cc2,$cc3,$cc4,$cc5,$cc6] +cc={($cc)[$4]} +cc1,cc2,cc3,cc4,cc5,cc6={[$cc,$cc,$cc,$cc,$cc,$cc]} +gui_split_preview "fx_rep_tg3 ${1-31}",${-3--1} +a={((($4==0&&$5==0)||($4==1&&$6==0))||(($4==2&&$7==0)||($4==3&&$8==0)))||(($4==4&&$9==0)||($4==5&&$10==0))?2:0} +b={((($4==0&&$5==1)||($4==1&&$6==1))||(($4==2&&$7==1)||($4==3&&$8==1)))||(($4==4&&$9==1)||($4==5&&$10==1))?2:0} +c={((($4==0&&$5==2)||($4==1&&$6==2))||(($4==2&&$7==2)||($4==3&&$8==2)))||(($4==4&&$9==2)||($4==5&&$10==2))?2:0} +u "{$1}""{$2}""{$3}""{$4}""{"$cc1"}_"{$4==0?2:0}"{"$cc2"}_"{$4==1?2:0}"{"$cc3"}_"{$4==2?2:0}"{"$cc4"}_"{$4==3?2:0}"{"$cc5"}_"{$4==4?2:0}"{"$cc6"}_"{$4==5?2:0}"{$11}_"$a"{$12}_"$a"{$13}_"$a"{$14}_"$a"{$15}_"$a"{$16}_"$a"{$17}_"$a"{$18}_"$b"{$19}_"$b"{$20}_"$b"{$21}_"$b"{$22}_"$b"{$23}_"$b"{$24}_"$b"{$25}_"$c"{$26}_"$c"{$27}_"$c"{$28}_"$c"{$29}_"$c"{$30}_"$c"{$31}_"$c"{$32}""{$33,$34}" +fx_rep_self_referential_formula: +skip "$*" rm $_persistent +if $1 remove_named tuppers_image_mode_0 +else remove_named tuppers_self_image_base keep[0] +fi +* 255 +fx_rep_self_referential_formula_preview: +skip "$*" +mode_K_a=$1 +mode_K_b=$2 +k_a=$5 +k_b=$6 +predefined_K=$8 +copy_from_stored_value=$9 +negate_after_using_k_input_a=$10 +negate_after_using_k_input_b=$11 +k_value_from_images="$13" +pre_negation_a=$14 +pre_negation_b=$15 +allow_example=$16 +allow_mode_switch=$17 +started=$18 +user_mode_a={$allow_example?$3} +user_mode_b={$allow_example?$4} +mode_K_diff,K_diff,negate_after_K_input_diff,user_diff,pre_negation_diff,copy_from_stored_K_value={[$mode_K_a!=$mode_K_b,'$k_a'!='$k_b',$negate_after_using_k_input_a!=$negate_after_using_k_input_b,$user_mode_a!=$user_mode_b,$pre_negation_a!=$pre_negation_b,$9]} +activate_changes={$mode_K_a?$pre_negation_diff:($mode_K_diff||$K_diff||$negate_after_K_input_diff||$user_diff||$copy_from_stored_K_value)} +if $started&&narg($_persistent) +if $activate_changes +if $mode_K_a +rm $_persistent +rep_tuppers_self_K[tuppers_self_image_base] $pre_negation_a +store _persistent +('${}') +if !$allow_mode_switch +replace_str ",","\n\n" +fi +k_value_from_images={t} +rm +else +if $negate_after_K_input_diff +rm $_persistent +negate[tuppers_image_mode_0] +store _persistent +else +width,height={[w,h]} +rm $_persistent +store temporary_image +$width,$height +if $user_diff||$mode_K_diff +if $user_mode_a +predefined_K=${arg\ $user_mode_a,960939379918958884971672962127852754715004339660129306651505519271702802395266424689642842174350718121267153782770623355993237280874144307891325963941337723487857735749823926629715517173716995165232890538221612403238855866184013235585136048828693337902491454229288667081096184496091705183454067827731551705405381627380967602565625016981482083418783163849115590225610003652351370343874461848378737238198224849863465033159410054974700593138339226497249461751545728366702369745461014655997933798537483143786841806593422227898388722980000748404719,395237837253173619377196292693949302406153931873024916260538490717335936871532361396117451541392229602948889604348128275446264586897474193776400465275167777832622157773372879463606146128022620285693891540788235229239672405060120203686774511468011972485984983535894919421543461759499096362152894616017344239642743391778941134500105852623176726707340602287941750635663845779675174278129608159631247023276032,1162909606774227786762360554904656873467005634722346243123857684508335800080212296528535403972500597220234608121734983386023291518966099546891430040655179625172067449629161883859511896818291049959507502002794829515164438990867773160767189319641778161093019870270482668056135958042158788515967843798733586173623987894941361961956503217167249393827582112256509171868414221167242597679368110852891933106118102448936895420986905619254557683605421985950220457144259359231632456877367983992190446749365022925067669913265323579719756925062086656,1843812769630219797102194898630589042838024531800431544407803208699762220759288686771851688175304525277287596637929619481851566234761209320517998687008822582390183399326187543197624279014134019615905245154166656477378450656137074612544163896000320136805982694616420881365676363963235184229519627621212049120298076086417612215067181351396556381877005473113076180736051591032787133962681831575450591579944470027127255325865144199772221608835705143631909500064802696725673323645838019575905814384115925441812137010043170716647424} +rep_tuppers_self $predefined_K,$negate_after_using_k_input_a +else +rep_tuppers_self $k_a,$negate_after_using_k_input_a +fi +fi +if $K_diff +rep_tuppers_self $k_a,$negate_after_using_k_input_a +fi +if $copy_from_stored_K_value +rep_tuppers_self $k_value_from_images,$negate_after_using_k_input_a +k_a=$k_value_from_images +fi +name tuppers_image_mode_0 +$temporary_image +temporary_image,activate_changes=0 +store _persistent +fi +fi +fi +else +n_imgs={$!} +mode_K_a=1 +negate_after_using_k_input=$pre_negation_a +if $!>1 +allow_mode_switch=0 +reverse +fi +eval " +standard_image_size=[106,17]; +allow_example=1; +repeat($n_imgs,img_id, +if([w#img_id,h#img_id]!=standard_image_size, +allow_example=0; +break(); +); +); +allow_example; +" +allow_example=${} +rep_tuppers_self_K $pre_negation_a +name tuppers_self_image_base +store _persistent +if $allow_mode_switch +k_a,k_b,k_value_from_images=${} +else +('${}') +replace_str ",","\n\n" +k_value_from_images={t} +rm +fi +fi +rm $_persistent +if $mode_K_a +remove_named tuppers_image_mode_0 +if !$allow_mode_switch +append y +fi +else +remove_named tuppers_self_image_base +fi +* 255 +u "{"$mode_K_a"}_"{$allow_mode_switch*2}"{"$mode_K_a"}""{"$user_mode_a"}_"{!$mode_K_a?$allow_example*2}"{"$user_mode_a"}""{"$k_a"}_"{2*(!$mode_K_a&&!$user_mode_a)}"{"$k_a"}""{"$predefined_K"}_"{(!$mode_K_a&&$user_mode_a)*2}"{"$predefined_K"}""{0}_"{!$mode_K_a?(!$user_mode_a?1+('$k_a'!='$k_value_from_images'))}"{"$negate_after_using_k_input_a"}_"{2*!$mode_K_a}"{"$negate_after_using_k_input_a"}""{"$k_value_from_images"}_"{$mode_K_a?2}"{"$k_value_from_images"}""{"$pre_negation_a"}_"{$mode_K_a?2}"{"$pre_negation_a"}""{"$allow_example"}""{"$allow_mode_switch"}""{1}" +fx_rep_vibrance_ych: +rep_vibrance_ych {$1/100} +fx_rep_vibrance_ych_preview: +gui_split_preview "fx_rep_vibrance_ych $1",${-3--1} +fx_vibrato: +split_opacity +local[0] +if $1==1 rgb2cmy +elif $1==2 rgb2hsi8 +elif $1==3 rgb2hsl8 +elif $1==4 rgb2hsv8 +elif $1==5 rgb2lab8 +elif $1==6 rgb2lch8 +elif $1==7 rgb2ycbcr +elif $1==8 rgb2ycbcrglic +elif $1==9 rgb2yuv8 +elif $1==10 rgb2yiq8 +elif $1==11 rgb2xyz8 +elif $1==12 rgb2bayer 0 +fi +s c +if $2==1 +if $3==1 -vibrato[0] $8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22 fi +if $4==1 -vibrato[1] $8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22 fi +if $5==1 -vibrato[2] $8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22 fi +elif $2==0 +if $23==1 -vibrato[0] $24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38 fi +if $39==1 -vibrato[1] $40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$53,$54 fi +if $55==1 -vibrato[2] $56,$57,$58,$59,$60,$61,$62,$63,$64,$65,$66,$67,$68,$69,$70 fi +fi +a c +if $1==1 cmy2rgb +elif $1==2 hsi82rgb +elif $1==3 hsl82rgb +elif $1==4 hsv82rgb +elif $1==5 lab82rgb +elif $1==6 lch82rgb +elif $1==7 ycbcr2rgb +elif $1==8 ycbcrglic2rgb +elif $1==9 yuv82rgb +elif $1==10 yiq82rgb +elif $1==11 xyz82rgb +elif $1==12 bayer2rgb 0,0,0 +fi +done +if $2==1 +if $6==1 -vibrato[1] $8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$7,$19,$20,$21,$22 fi +elif $2==0 +if $71==1 -vibrato[1] $72,$73,$74,$75,$76,$77,$78,$79,$80,$81,$82,$83,$84,$85,$86 fi +fi +a c +vibrato: +foreach { +n 0,255 +f " +q=($8/100)*w; +l=($9/100)*h; +X=(($1?w-x+q:x+q)/w-.5) * 2 * 1/$5 * 1/$7; +Y=(($2?h-y+l:y+l)/h-.5) * 2 * 1/$6 * 1/$7; +U=sqrt($3); +V=sqrt($4); +Z=((X-Y) * (X-U) * (X+U) * (Y-V) * (Y+V))+ $10; +C=(Z+((1-i/255)/(($3>1?$3:1/$3)*($4>1?$4:1/$4)))*$14)*(Z+((1-i/255)/(($3>1?$3:1/$3)*($4>1?$4:1/$4)))*$14); +F=abs(C)>1?C-int(C):C; +A=$12?F:1-F; +B=$11?(i*A):A*200; +E=$13/100*B+(1-$13/100)*i; +" +n 0,255 +mul $15 +mod 256 +} +_fx_vibrato_preview : +gui_split_preview "fx_vibrato ${1--2}",$-1 +fx_rep_w_rgb82gray: +rep_weighted_rgb82gray $1%,$2%,$3%,$4,$5%,$6%,$7,$8,$9 +fx_rep_w_rgb82gray_preview: +gui_split_preview "fx_rep_w_rgb82gray ${1-9}",${-3--1} +u "{$1}""{$2}""{$3}""{$4}""{$5}""{$6}""{$7}_"{$5&&$6?2:1}"{$8}""{$9}""{$10}""{$11,$12}" +plasma_transition: check "isint(${4=42}) && isint(${2=5}) && ${1=0.5}>=0 && $1<=1 && $2>=0 && ${3=1}>=0" +repeat int($!/2) +local[{$>},{$>+1}] +if $!<2 return fi +r ${-max_whds},3 +100%,100% srand $4 plasma. 1,0,$2 n. 0,1 ++<=. $1 b. $3 +rm.. +j... ..,0,0,0,0,1,. +k... +done +done +randomwaves : check "isint(${1=84}) && ${2=80}>=0 && $2<=100 && ${3=1.2}>0. && isint(${4=42})" +srand $4 +(0,1,0;1,0,1;0,1,0) /. 2 +=> matconv +{0,w},{0,h},1,1 set. 255,{u(100)}%,{u(100)}% +. +repeat $1 +. +if ${2}>=u(100) +circle. {u(100)}%,{u(100)}%,{u(3)},,255 +fi +convolve. [matconv] /. $3 -. ... +rm... +done +rm[-2,matconv] +g. a[-1,-2] c -warp[0] .,1 rm. +fx_adjust_orientation : +repeat $! +M={max(w,h)} ++gradient_norm. ge. $1% ++*. '1+y' *.. '1+x' a[-2,-1] c +r. {w*h},2,1,1,-1 sort. +,x autocrop. 0 +/. $M +r. 1,2,1,1,2 r. .. -[-2,-1] ++transpose. m*[-2,-1] +eigen. rm.. z. 0,0 +if i<0 *. -1 fi +theta={180*atan2(i(0,1),i)/pi} +rm. +if w>h rotate. {-$theta},1,0,50%,50% +else rotate. {-$theta+90},1,0,50%,50% +fi +mv. 0 done +fx_blur_quad : +mode=${"arg 1+$6,add,alpha,and,average,blue,burn,darken,difference,divide,dodge,edges,exclusion,freeze,grainextract,grainmerge,green,hardlight,hardmix,hue,interpolation,lighten,lightness,linearburn,linearlight,luminance,multiply,negation,or,overlay,pinlight,red,reflect,saturation,softburn,softdodge,softlight,screen,stamp,subtract,value,vividlight,xor"} +repeat $! l[$>] +100%,100%,1,3 +100%,100%,1,[0]," +begin( +const interpolation = 1; +const boundary = 1; +const w1 = w - 1; +const h1 = h - 1; +x0 = $8*w1%; y0 = $9*h1%; +x1 = $10*w1%; y1 = $11*h1%; +x2 = $12*w1%; y2 = $13*h1%; +x3 = $14*w1%; y3 = $15*h1%; +); +xw1 = x/w1; +yh1 = y/h1; +xl = lerp(x0,x3,yh1); +yl = lerp(y0,y3,yh1); +xr = lerp(x1,x2,yh1); +yr = lerp(y1,y2,yh1); +xc = lerp(xl,xr,xw1); +yc = lerp(yl,yr,xw1); +I(#1,round(xc),round(yc))+=[ x,y,1 ]; +I(#0,xc,yc)" +f.. "B?[ R,G,0 ]/B:[ -1,-1,0 ]" channels.. 0,1 +blur_xy. $1%,$2% +adjust_colors. ${3-5},0,0,0,255 +to_a. +100%,100%,1,1,1 a[-2,-1] c +warp. ..,0,1,0 rm.. +sh. 100% mul[-2,-1] channels. 0,{s-2} +blend[-2,-1] $mode,$7% +done done +fx_blur_quad_preview : +fx_blur_quad $* +polygon 4,$8%,$9%,$10%,$11%,$12%,$13%,$14%,$15%,0.5,0xCCCCCCCC,0,0,0,255 +polygon 4,$8%,$9%,$10%,$11%,$12%,$13%,$14%,$15%,0.5,0x33333333,255 +#@cli frame_round_old : _sharpness>0,_size>=0,_smoothness,_shading,_R,_G,_B,_A +#@cli : Draw RGBA-colored round frame in selected images. +#@cli : Default values: 'sharpness=10', 'size=10', 'smoothness=0', 'shading=0' and 'R=G=B=A=255'. +#@cli : $ image.jpg frame_round 10 +frame_round_old : skip ${1=10},${2=10},${3=0},${4=0},${5=255},${6=$5},${7=$6},${8=255} +e[^-1] "Draw round frame on image$?, with sharpness $1, size $2, smoothness $3, shading $4 and +RGBA color ($5,$6,$7,$8)." +to_rgba +foreach { +nm={n} +100%,100%,1,1,"-(abs(x/w-0.5)^$1 + abs(y/h-0.5)^$1)^(1/$1)" >=. $2% +if $4 distance. 1 n. 0,1 *. -1 +. 1 ^. {1/$4} fi +b. $3 i... 100%,100%,1,4 fc... $5,$6,$7,$8 blend_fade[0,1] . rm. +=> $nm +} +fx_apply_curve : +ac "_fx_apply_curve ${1-13}",$14,$15 +_fx_apply_curve : +apply_curve $13,0,$1,${"if $2>=0 u $2,$3, else u \"\" fi"}${"if $4>=0 u $4,$5, else u \"\" fi"}${"if $6>=0 u $6,$7, else u \"\" fi"}${"if $8>=0 u $8,$9, else u \"\" fi"}${"if $10>=0 u $10,$11, else u \"\" fi"}255,$12 +fx_apply_curve_preview : +function1d $13,0,$1,${"if $2>=0 u $2,$3, else u \"\" fi"}${"if $4>=0 u $4,$5, else u \"\" fi"}${"if $6>=0 u $6,$7, else u \"\" fi"}${"if $8>=0 u $8,$9, else u \"\" fi"}${"if $10>=0 u $10,$11, else u \"\" fi"}255,$12 +mv. 0 +repeat $!-1 ++gui_split_preview. "fx_apply_curve $*",$-1 +100%,100% axes. 0,255,255,0,13,1,255 +dilate. 3 r.. ... j... ..,0,0,0,0,1,.,255 rm[-2,-1] +grid. 10%,10%,0,0,0.3,0xCCCCCCCC,255 +line. 0,100%,100%,0,0.3,0xCCCCCCCC,255 +if $-2 +.,. to_gray... histogram... 256,0,255 graph. ...,3,0,0,0,1,1 -!=. 0 *. 255 rm... ++xor[-2,-1] j... .,0,0,0,0,$16,..,255 rm[-2,-1] +else rm.. fi +100%,100% graph. [0],1,0,255,0,1,255 +dilate. 3 r.. ... j... ..,0,0,0,0,1,.,255 rm[-2,-1] +_fx_apply_curve_preview 0,$1,0 _fx_apply_curve_preview $2,$3,1 +_fx_apply_curve_preview $4,$5,2 _fx_apply_curve_preview $6,$7,3 +_fx_apply_curve_preview $8,$9,4 _fx_apply_curve_preview $10,$11,5 +_fx_apply_curve_preview 255,$12,6 +mv. 1 done rm[0] +_fx_apply_curve_preview : +if $1>=0 +x={$1*100/255}% y={100-$2*100/255}% +ellipse. $x,$y,3,3,0,1,0xFFFFFFFF,0,0,0 ellipse. $x,$y,2,2,0,1,0,255,0 +t. $3,$x,{$y*h-20},13,1,255 +fi +fx_apply_Labcurve : skip $1 +fx_apply_Labcurve_configfile +repeat $!-1 l[$>,-1] +to_colormode[0] {max(3,s)} sh[0] 0,2 rgb2lab. rm. +sh[0] 0 *. 2.55 _fx_apply_Labcurve. {-2,@0-12} /. 2.55 rm. +sh[0] 1 +. 86 *. 1.38587 _fx_apply_Labcurve. {-2,@13-25} /. 1.38587 -. 86 rm. +sh[0] 2 +. 108 *. 1.25616 _fx_apply_Labcurve. {-2,@26-38} /. 1.25616 -. 108 rm. +sh[0] 0,2 lab2rgb. rm. +done done +rm. +_fx_apply_Labcurve : +apply_curve $13,0,$1,${"if $2>=0 u $2,$3, else u \"\" fi"}${"if $4>=0 u $4,$5, else u \"\" fi"}${"if $6>=0 u $6,$7, else u \"\" fi"}${"if $8>=0 u $8,$9, else u \"\" fi"}${"if $10>=0 u $10,$11, else u \"\" fi"}255,$12 +c 0,255 +fx_apply_Lcurve_preview : +fx_apply_Labcurve_configfile +sh. 0,0,0,0 f. ${1--3} rm. +fx_apply_Labcurve_preview[^-1] {^},0,${-2,-1} rm. +fx_apply_acurve_preview : +fx_apply_Labcurve_configfile +sh. 1,1,0,0 f. ${1--3} rm. +fx_apply_Labcurve_preview[^-1] {^},1,${-2,-1} rm. +fx_apply_bcurve_preview : +fx_apply_Labcurve_configfile +sh. 2,2,0,0 f. ${1--3} rm. +fx_apply_Labcurve_preview[^-1] {^},2,${-2,-1} rm. +fx_apply_Labcurve_configfile : +filename=${-path_tmp}.gmic_Labcurve.dlm +if isfile(['{/$filename}']) $filename else (0,-1,128,-1,128,-1,128,-1,128,-1,128,255,1) r. 100%,3 fi +fx_apply_Labcurve_preview : +(${1--3}) r. 13,3,1,1,-1 o. ${-path_tmp}.gmic_Labcurve.dlm rm. +function1d $13,0,$1,${"if $2>=0 u $2,$3, else u \"\" fi"}${"if $4>=0 u $4,$5, else u \"\" fi"}${"if $6>=0 u $6,$7, else u \"\" fi"}${"if $8>=0 u $8,$9, else u \"\" fi"}${"if $10>=0 u $10,$11, else u \"\" fi"}255,$12 +function1d $26,0,$14,${"if $15>=0 u $15,$16, else u \"\" fi"}${"if $17>=0 u $17,$18, else u \"\" fi"}${"if $19>=0 u $19,$20, else u \"\" fi"}${"if $21>=0 u $21,$22, else u \"\" fi"}${"if $23>=0 u $23,$24, else u \"\" fi"}255,$25 +function1d $39,0,$27,${"if $28>=0 u $28,$29, else u \"\" fi"}${"if $30>=0 u $30,$31, else u \"\" fi"}${"if $32>=0 u $32,$33, else u \"\" fi"}${"if $34>=0 u $34,$35, else u \"\" fi"}${"if $36>=0 u $36,$37, else u \"\" fi"}255,$38 +a[-3--1] y mv. 0 +repeat $!-1 ++gui_split_preview. "fx_apply_Labcurve 0",$-1 +axes. 0,255,255,0,13,1,255 +100%,100% axes. 0,255,255,0,13,1,255 +dilate. 3 r.. ... j... ..,0,0,0,0,1,.,255 rm[-2,-1] +grid. 10%,10%,0,0,0.3,0xCCCCCCCC,255 +line. 0,100%,100%,0,0.3,0xCCCCCCCC,255 +if $-2 +.,.,1,1,-{$-2*255/100} to_gray... histogram... 256,0,255 graph. ...,3,0,0,0,1,0 +rm... +. {$-2*255/100} +[-2,-1] c. 0,255 +else rm.. fi +line. 0,100%,100%,0,0.3,0xCCCCCCCC,255 +sh[0] 0,0,0,0 +graph.. .,1,0,255,0,1,255,255,255 -. 1 +graph.. .,1,0,255,0,0.5,200,200,200 rm. +sh[0] 1,1,0,0 +graph.. .,1,0,255,0,1,255,128,128 -. 1 +graph.. .,1,0,255,0,0.5,200,0,0 rm. +sh[0] 2,2,0,0 +graph.. .,1,0,255,0,1,128,128,255 -. 1 +graph.. .,1,0,255,0,0.5,0,0,200 rm. +if $40==0 +_fx_apply_curve_preview 0,$1,0 _fx_apply_curve_preview $2,$3,1 +_fx_apply_curve_preview $4,$5,2 _fx_apply_curve_preview $6,$7,3 +_fx_apply_curve_preview $8,$9,4 _fx_apply_curve_preview $10,$11,5 +_fx_apply_curve_preview 255,$12,6 +elif $40==1 +_fx_apply_curve_preview 0,$14,0 _fx_apply_curve_preview $15,$16,1 +_fx_apply_curve_preview $17,$18,2 _fx_apply_curve_preview $19,$20,3 +_fx_apply_curve_preview $21,$22,4 _fx_apply_curve_preview $23,$24,5 +_fx_apply_curve_preview 255,$25,6 +else +_fx_apply_curve_preview 0,$27,0 _fx_apply_curve_preview $28,$29,1 +_fx_apply_curve_preview $30,$31,2 _fx_apply_curve_preview $32,$33,3 +_fx_apply_curve_preview $34,$35,4 _fx_apply_curve_preview $36,$37,5 +_fx_apply_curve_preview 255,$38,6 +fi +mv. 1 done rm[0] +cracks_old : skip ${1=0.2},${2=40},${3=0} +e[^-1] "Add random cracks to image$?, with density $1." +v - repeat $! l[$>] +({im},{iM}) ..,..,1,1 noise. $1,2 ==. 1 distance. 1 sharpen. 10000 +if $3 g. xy +[-2,-1] n. -1,1 else n. 0,1 fi +*. $2 +[-3,-1] c.. {^} rm. +done done v + +fx_cracks_old : +ac "-cracks_old $1,$2,$3",$4 +negative : +e[^-1] "Compute negative of image$?." +v - repeat $! l[$>] - {iM} done done * -1 v + +transfer_colors : skip ${2=0} +e[^-1] "Transfer colors of image $1 to image$?." +v - pass$1 0 mv. 0 to_rgb[0] to_colormode[^0] {max(3,${-max_s})} c 0,255 +repeat $! l[$>] split_opacity rgb2ycbcr[0] a c done done +l[0] s c histogram_cumul 256,1,0,255 a c * 255 done +repeat $!-1 l[0,{$<+1}] +if $2 repeat 3 sh[0,1] $> equalize. 256,0,255 index. ..,0,0 rm[-2,-1] done +else repeat 2 sh[0,1] {$>+1} equalize. 256,0,255 index. ..,0,0 rm[-2,-1] done +fi +done done rm[0] +repeat $! l[$>] split_opacity ycbcr2rgb[0] a c done done +c 0,255 +v + +_transfer_colors : +repeat $! l[$>] rgb2ycbcr s c histogram 256,0,255 a c -dg 300,200 done done +is_bwclut : +to_clutname "$1" name=${} l[] +if narg($GMIC_SYSTEM_PATH) g_path_unix=$GMIC_SYSTEM_PATH +else g_path_unix=/usr/lib/gimp/2.0/plug-ins/ +fi +path_test0=$path_clut +path_test1=$_path_rc +path_test2=${-path_gimp}plug-ins/ +path_test3=${-path_gimp}plug-ins/gmic_gimp_qt/ +path_test4=$g_path_unix +repeat 5 file_clut=${path_test$>}/gmic_cluts.gmz +l[] $file_clut onfail done if $! break fi +done +if !$! +i https://gmic.eu/gmic_cluts.gmz o ${path_clut}gmic_cluts.gmz +fi +k[${"nmd 1,"$name}] +u {s==4} +rm done +mproj : check ${"is_image_arg $1"}" && isint(${2=0}) && $2>=0 && isint(${3=0}) && $3>=0 && ${4=1e-5}>=0" +s0,s1="ces","x" +if !$2 +e[^-1] "Project matri"${s{$!==1}}" onto dictionnary $1, using orthogonal projection." +pass$1 solve[^-1] . rm. return +elif $2==1 +m="Matching Pursuit" +elif $2==2 +m="Matching Pursuit + orthogonal projection" +else +m="Orthogonal Matching Pursuit, with ortho-projection every "{$2-2}" iterations." +fi +e[^-1] "Project matri"${s{$!==1}}" onto dictionnary $1, using "$m"." +pass$1 0 1,{w},1,1,"max(1e-8,norm(crop(#-1,y,1)))" /.. . +repeat $!-2 l[$>,-2,-1] s[0] x +repeat $!-2 l[$>,-2] +if $2<3 +1,{1,w} +eval " +const nmax = $3?$3:w#1; +ref(crop(#0),S); +residual = inf; +for (n = 0, n$4, ++n, +lmax = -1; +absdotmax = dotmax = 0; +for (l = 0, labsdotmax?( +absdotmax = absdot; +dotmax = dot; +lmax = l; +); +); +i[#2,lmax] += dotmax; +S-=(crop(#1,lmax,1)*=dotmax); +residual = norm(S)/size(S); +)" +if $2==2 +f[2] i?y+1:0 +discard[2] 0 transpose. -. 1 ++r[1] 100%,1,1,{1,h},-1 warp. .. r. 100%,{0,h},1,1,-1 ++solve[0] . +eval[3] i[#2,i]=i[#-1,x] +rm[3--1] +fi +else +1,{1,w} +[0] +eval " +orthoproj() = ( +run('f[2] i?y+1:0 +discard[2] 0 transpose. -. 1 ++r[1] 100%,1,1,{1,h},-1 warp. .. r. 100%,{0,h},1,1,-1 ++solve[0] . eval[4] i[#2,i]=i[#-1,x] rm... +m*[-2,-1] +j[3] [0] -[3,-1]'); +); +const nmax = $3?$3:w#1; +ref(crop(#0),S); +residual = inf; +is_orthoproj = 0; +for (n = 0, n$4, ++n, +lmax = -1; +absdotmax = dotmax = 0; +for (l = 0, labsdotmax?( +absdotmax = absdot; +dotmax = dot; +lmax = l; +); +); +!n || (n%($2-2))?( +i[#2,lmax] += dotmax; +S-=(crop(#1,lmax,1)*=dotmax); +residual = norm(S)/size(S); +is_orthoproj = 0; +):( +i[#2,lmax] = 1; # Only used as a mark +orthoproj(); +S = crop(#3); +residual = norm(S)/size(S); +is_orthoproj = 1; +); +); +!is_orthoproj?orthoproj(); +" +rm. +fi +rv[0,-1] rm. +done done +/[^-2,-1] . a[^-2,-1] x +done done +rm[-2,-1] +dodoc : +it $HOME/work/src/gmic/src/gmic_stdlib.gmic +parse_cli list +list=${} +ind={N=narg($list);int(u(0,N))%N} +e[] "\nDocument command : '"${"arg "$ind,$list}"'\n" +q +fx_apply_RGBcurve : skip $1 +fx_apply_RGBcurve_configfile +repeat $!-1 l[$>,-1] +to_colormode[0] {max(3,s)} +sh[0] 0 _fx_apply_RGBcurve. {-2,@0-12} rm. +sh[0] 1 _fx_apply_RGBcurve. {-2,@13-25} rm. +sh[0] 2 _fx_apply_RGBcurve. {-2,@26-38} rm. +done done +rm. +_fx_apply_RGBcurve : +apply_curve $13,0,$1,${"if $2>=0 u $2,$3, else u \"\" fi"}${"if $4>=0 u $4,$5, else u \"\" fi"}${"if $6>=0 u $6,$7, else u \"\" fi"}${"if $8>=0 u $8,$9, else u \"\" fi"}${"if $10>=0 u $10,$11, else u \"\" fi"}255,$12 +c 0,255 +fx_apply_Rcurve_preview : +fx_apply_RGBcurve_configfile +sh. 0,0,0,0 f. ${1--3} rm. +fx_apply_RGBcurve_preview[^-1] {^},0,${-2,-1} rm. +fx_apply_Gcurve_preview : +fx_apply_RGBcurve_configfile +sh. 1,1,0,0 f. ${1--3} rm. +fx_apply_RGBcurve_preview[^-1] {^},1,${-2,-1} rm. +fx_apply_Bcurve_preview : +fx_apply_RGBcurve_configfile +sh. 2,2,0,0 f. ${1--3} rm. +fx_apply_RGBcurve_preview[^-1] {^},2,${-2,-1} rm. +fx_apply_RGBcurve_configfile : +filename=${-path_tmp}.gmic_RGBcurve.dlm +if isfile(['{/$filename}']) $filename else (0,-1,128,-1,128,-1,128,-1,128,-1,128,255,1) r. 100%,3 fi +fx_apply_RGBcurve_preview : +(${1--3}) r. 13,3,1,1,-1 o. ${-path_tmp}.gmic_RGBcurve.dlm rm. +function1d $13,0,$1,${"if $2>=0 u $2,$3, else u \"\" fi"}${"if $4>=0 u $4,$5, else u \"\" fi"}${"if $6>=0 u $6,$7, else u \"\" fi"}${"if $8>=0 u $8,$9, else u \"\" fi"}${"if $10>=0 u $10,$11, else u \"\" fi"}255,$12 +function1d $26,0,$14,${"if $15>=0 u $15,$16, else u \"\" fi"}${"if $17>=0 u $17,$18, else u \"\" fi"}${"if $19>=0 u $19,$20, else u \"\" fi"}${"if $21>=0 u $21,$22, else u \"\" fi"}${"if $23>=0 u $23,$24, else u \"\" fi"}255,$25 +function1d $39,0,$27,${"if $28>=0 u $28,$29, else u \"\" fi"}${"if $30>=0 u $30,$31, else u \"\" fi"}${"if $32>=0 u $32,$33, else u \"\" fi"}${"if $34>=0 u $34,$35, else u \"\" fi"}${"if $36>=0 u $36,$37, else u \"\" fi"}255,$38 +a[-3--1] y mv. 0 +repeat $!-1 ++gui_split_preview. "fx_apply_RGBcurve 0",$-1 +100%,100% axes. 0,255,255,0,13,1,255 +dilate. 3 r.. ... j... ..,0,0,0,0,1,.,255 rm[-2,-1] +grid. 10%,10%,0,0,0.3,0xCCCCCCCC,255 +line. 0,100%,100%,0,0.3,0xCCCCCCCC,255 +if $-2 +.,.,1,1,-{$-2*255/100} to_gray... histogram... 256,0,255 graph. ...,3,0,0,0,1,0 +rm... +. {$-2*255/100} +[-2,-1] c. 0,255 +else rm.. fi +line. 0,100%,100%,0,0.3,0xCCCCCCCC,255 +sh[0] 0,0,0,0 +graph.. .,1,0,255,0,1,255,128,128 -. 1 +graph.. .,1,0,255,0,0.5,200,0,0 rm. +sh[0] 1,1,0,0 +graph.. .,1,0,255,0,1,128,255,128 -. 1 +graph.. .,1,0,255,0,0.5,0,200,0 rm. +sh[0] 2,2,0,0 +graph.. .,1,0,255,0,1,128,128,255 -. 1 +graph.. .,1,0,255,0,0.5,0,0,200 rm. +if $40==0 +_fx_apply_curve_preview 0,$1,0 _fx_apply_curve_preview $2,$3,1 +_fx_apply_curve_preview $4,$5,2 _fx_apply_curve_preview $6,$7,3 +_fx_apply_curve_preview $8,$9,4 _fx_apply_curve_preview $10,$11,5 +_fx_apply_curve_preview 255,$12,6 +elif $40==1 +_fx_apply_curve_preview 0,$14,0 _fx_apply_curve_preview $15,$16,1 +_fx_apply_curve_preview $17,$18,2 _fx_apply_curve_preview $19,$20,3 +_fx_apply_curve_preview $21,$22,4 _fx_apply_curve_preview $23,$24,5 +_fx_apply_curve_preview 255,$25,6 +else +_fx_apply_curve_preview 0,$27,0 _fx_apply_curve_preview $28,$29,1 +_fx_apply_curve_preview $30,$31,2 _fx_apply_curve_preview $32,$33,3 +_fx_apply_curve_preview $34,$35,4 _fx_apply_curve_preview $36,$37,5 +_fx_apply_curve_preview 255,$38,6 +fi +mv. 1 done rm[0] +fx_apply_YCbCrcurve : skip $1 +fx_apply_YCbCrcurve_configfile +repeat $!-1 l[$>,-1] +to_colormode[0] {max(3,s)} sh[0] 0,2 rgb2ycbcr. rm. +sh[0] 0 _fx_apply_YCbCrcurve. {-2,@0-12} rm. +sh[0] 1 _fx_apply_YCbCrcurve. {-2,@13-25} rm. +sh[0] 2 _fx_apply_YCbCrcurve. {-2,@26-38} rm. +sh[0] 0,2 -ycbcr2rgb. rm. +done done +rm. +_fx_apply_YCbCrcurve : +apply_curve $13,0,$1,${"if $2>=0 u $2,$3, else u \"\" fi"}${"if $4>=0 u $4,$5, else u \"\" fi"}${"if $6>=0 u $6,$7, else u \"\" fi"}${"if $8>=0 u $8,$9, else u \"\" fi"}${"if $10>=0 u $10,$11, else u \"\" fi"}255,$12 +c 0,255 +fx_apply_Ycurve_preview : +fx_apply_YCbCrcurve_configfile +sh. 0,0,0,0 f. ${1--3} rm. +fx_apply_YCbCrcurve_preview[^-1] {^},0,${-2,-1} rm. +fx_apply_Cbcurve_preview : +fx_apply_YCbCrcurve_configfile +sh. 1,1,0,0 f. ${1--3} rm. +fx_apply_YCbCrcurve_preview[^-1] {^},1,${-2,-1} rm. +fx_apply_Crcurve_preview : +fx_apply_YCbCrcurve_configfile +sh. 2,2,0,0 f. ${1--3} rm. +fx_apply_YCbCrcurve_preview[^-1] {^},2,${-2,-1} rm. +fx_apply_YCbCrcurve_configfile : +filename=${-path_tmp}.gmic_YCbCrcurve.dlm +if isfile(['{/$filename}']) $filename else (0,-1,128,-1,128,-1,128,-1,128,-1,128,255,1) r. 100%,3 fi +fx_apply_YCbCrcurve_preview : +(${1--3}) r. 13,3,1,1,-1 o. ${-path_tmp}.gmic_YCbCrcurve.dlm rm. +function1d $13,0,$1,${"if $2>=0 u $2,$3, else u \"\" fi"}${"if $4>=0 u $4,$5, else u \"\" fi"}${"if $6>=0 u $6,$7, else u \"\" fi"}${"if $8>=0 u $8,$9, else u \"\" fi"}${"if $10>=0 u $10,$11, else u \"\" fi"}255,$12 +function1d $26,0,$14,${"if $15>=0 u $15,$16, else u \"\" fi"}${"if $17>=0 u $17,$18, else u \"\" fi"}${"if $19>=0 u $19,$20, else u \"\" fi"}${"if $21>=0 u $21,$22, else u \"\" fi"}${"if $23>=0 u $23,$24, else u \"\" fi"}255,$25 +function1d $39,0,$27,${"if $28>=0 u $28,$29, else u \"\" fi"}${"if $30>=0 u $30,$31, else u \"\" fi"}${"if $32>=0 u $32,$33, else u \"\" fi"}${"if $34>=0 u $34,$35, else u \"\" fi"}${"if $36>=0 u $36,$37, else u \"\" fi"}255,$38 +a[-3--1] y mv. 0 +repeat $!-1 ++gui_split_preview. "fx_apply_YCbCrcurve 0",$-1 +axes. 0,255,255,0,13,1,255 +100%,100% axes. 0,255,255,0,13,1,255 +dilate. 3 r.. ... j... ..,0,0,0,0,1,.,255 rm[-2,-1] +grid. 10%,10%,0,0,0.3,0xCCCCCCCC,255 +line. 0,100%,100%,0,0.3,0xCCCCCCCC,255 +if $-2 +.,.,1,1,-{$-2*255/100} to_gray... histogram... 256,0,255 graph. ...,3,0,0,0,1,0 +rm... +. {$-2*255/100} +[-2,-1] c. 0,255 +else rm.. fi +line. 0,100%,100%,0,0.3,0xCCCCCCCC,255 +sh[0] 0,0,0,0 +graph.. .,1,0,255,0,1,255,255,255 -. 1 +graph.. .,1,0,255,0,0.5,200,200,200 rm. +sh[0] 1,1,0,0 +graph.. .,1,0,255,0,1,128,128,255 -. 1 +graph.. .,1,0,255,0,0.5,0,0,200 rm. +sh[0] 2,2,0,0 +graph.. .,1,0,255,0,1,255,128,128 -. 1 +graph.. .,1,0,255,0,0.5,200,0,0 rm. +if $40==0 +_fx_apply_curve_preview 0,$1,0 _fx_apply_curve_preview $2,$3,1 +_fx_apply_curve_preview $4,$5,2 _fx_apply_curve_preview $6,$7,3 +_fx_apply_curve_preview $8,$9,4 _fx_apply_curve_preview $10,$11,5 +_fx_apply_curve_preview 255,$12,6 +elif $40==1 +_fx_apply_curve_preview 0,$14,0 _fx_apply_curve_preview $15,$16,1 +_fx_apply_curve_preview $17,$18,2 _fx_apply_curve_preview $19,$20,3 +_fx_apply_curve_preview $21,$22,4 _fx_apply_curve_preview $23,$24,5 +_fx_apply_curve_preview 255,$25,6 +else +_fx_apply_curve_preview 0,$27,0 _fx_apply_curve_preview $28,$29,1 +_fx_apply_curve_preview $30,$31,2 _fx_apply_curve_preview $32,$33,3 +_fx_apply_curve_preview $34,$35,4 _fx_apply_curve_preview $36,$37,5 +_fx_apply_curve_preview 255,$38,6 +fi +mv. 1 done rm[0] +fx_faded_mirror : +repeat $! l[$>] +if $1==0 +100%,1,1,1,"a=1/(1-w*$2%);b=-a*(w-1);a*x+b" c. 0.01,1 *.. . +r. 100%,.. a c r {2*w-w*$3%},100%,1,100%,0 +mirror x +else +1,100%,1,1,"a=1/(1-h*$2%);b=-a*(h-1);a*y+b" c. 0.01,1 r. ..,100% *.. . +a c r 100%,{2*h-h*$3%},1,100%,0 +mirror y +fi ++ s. c,-{s-1} /[-2,-1] +done done +fx_frame_round_old : +frame_round ${1-8} +if $9 frame_blur $1,{min(99,$1+$9)},$3,$10,$11% fi +view_surfels3d : +nm={n} ++distance. 0 *. -1 +. 1 *. .. +distance.. 1 +[-2,-1] round. 0.1 +l[0] { expand_xyz. 1,0 b. 4,0 g xyz,0,0 shrink_xyz 1 a c n 0,255 } +a c +=> img +m:=round(0.75*min({*,u,v})) w[] $m,$m,0,$nm" ("{img,w}x{img,h}x{img,d}")" +axes3d 60 => axes3d +(1,0,0,0;0,1,0,0;0,0,1,0) store. pose3d +posx,posy,zoom_factor=50,50,1 +T=1 +do +if !0$img3d +if {img,s==1} +f[img] 164 [img] lfacts=0.75,1,1.25 +elif {img,s==3} [img] +norm. gt. 0 *. -inf lfacts=0.9,1,1.1 +else +s[img] c,-{img,s-1} lfacts=0.9,1,1.1 +fi +lt. $T *[-2,-1] +to_rgb. surfels3d. $lfacts +l. { s3d. c.. 0,255 a y } +box3d {img,[w,h,d]} -3d. 0.5,0.5,0.5 col3d. 255,255,255 p3d. 1 o3d. 0.25 +3d[-2,-1] +=> img3d +fi +update_bg:=!0$bg +if 0$bg" && "{0$bg,[w,h]!=[{*,w,h}]} update_bg=1 fi +if $update_bg +(0,0,0;0,0,100;100,0,50) permute. cyzx r. {*,w,h},1,3,3 +=> bg +fi ++-3d[img3d] {img,[w,h,d]/2} *3d. {img,0.65*$zoom_factor*min({*,w,h})/max(w,h,d)} +$pose3d p={^} rm. +pose3d. $p +j3d[bg] .,$posx%,$posy%,0,1,2,1,1 rm.. ++pose3d[axes3d] $p j3d.. .,{-2,[80,h-80]},0,0.75,3,0,0,200 rm. +to. "Threshold: "{_$T},,,3% +w. rm. +if {*,-ARROWUP} T+=0.2 rmn img3d +elif {*,-ARROWDOWN} T-=0.2 rmn img3d +elif {*,-PAGEUP} T+=5 rmn img3d +elif {*,-PAGEDOWN} T-=5 rmn img3d +fi +T={_round($T,0.1)} +mx,my,mb={*,x,y,b} +is_CTRL={{*,CTRLLEFT}" || "{*,CTRLRIGHT}} +if $mx>=0 +if $mb +if !narg($mx0) mx0,my0,mx1,my1=$mx,$my,$mx,$my else mx1,my1=$mx,$my fi +else +if narg($mx0) rmn render fi +mx0,my0,mx1,my1= +fi +fi +if narg($mx1)" && "($mx0!=$mx1" || "$my0!=$my1) +if $mb&1" && "!$is_CTRL +rotation3d[] {" +const w2 = "{*,w}"/2; +const h2 = "{*,h}"/2; +const R = 0.375*min("{*,w,h}"); +const u0 = "$mx0" - w2; +const v0 = "$my0" - h2; +const u1 = "$mx1" - w2; +const v1 = "$my1" - h2; +n0 = norm(u0,v0); +nu0 = n0>R?u0*R/n0:u0; +nv0 = n0>R?v0*R/n0:v0; +nw0 = sqrt(max(0,R^2 - nu0^2 - nv0^2)); +n1 = norm(u1,v1); +nu1 = n1>R?u1*R/n1:u1; +nv1 = n1>R?v1*R/n1:v1; +nw1 = sqrt(max(0,R^2 - nu1^2 - nv1^2)); +u = nv0*nw1 - nw0*nv1; +v = nw0*nu1 - nu0*nw1; +w = nv0*nu1 - nu0*nv1; +n = norm(u,v,w); +[ u,v,w,-asin(n/R^2)*180/pi ]"} +$pose3d m*[-2,-1] store. pose3d +mx0,my0=$mx1,$my1 +elif $mb&4" || "($mb&1" && "$is_CTRL) +posx,posy={" +const px = "$mx1-$mx0+$posx*{*,w}%"; +const py = "$my1-$my0+$posy*{*,h}%"; +cut([ px*100/"{*,w}", py*100/"{*,h}" ],0,100)"} +mx0,my0=$mx1,$my1 +elif $mb&2 +fact={1+($my0-$my1)/100} +zoom_factor*=$fact +mx0,my0=$mx1,$my1 +fi +fi +if {*,o} +fact={1+{*,-o}/10} +zoom_factor*=$fact +fi +wait +while {*}" && "!{*,ESC} +rm +d2d : +_gmic_s="$?" v + _display2d 0,1 +_d2d_core : +_gmic_s="$?" _d2d_core=1 v + _display2d $1,1 +display2d : +_gmic_s="$?" v + _$0 0,1 +_display2d : check "isbool(${1=0}) && isint(${2=1}) && $2>=0" +e[0--3] "Start interactive display of 2D image"$_gmic_s"." +m "_d2d_format : +if $""#>8 u {_([$""*])[0,4]:\\ }\\ ...\\ {_([$""*])[$""#-4,4]:\\ } +else ('\"$""*\"') replace. {','},32 u {t} rm. +fi" +p +foreach { +('{n}') if s=crop();find(s,_'.',size(s)-1,-1)>0 nm={-2,b}.{-2,x} else nm={-2,b} fi rm. +=> img +if !w v - d v + break fi +if d>10 +error[0--6] "Command 'display2d': Input image has "{d}" slices, cannot manage more than 10 simultaneous views." +fi +is_multiview:=d>1 +is_moderate_ratio={0,D=[w,h];max(D)/min(D)<6} +may_have_alpha:=s==2||s>=4 +alpha_mode,axes_mode,fullscreen_mode,ratio_mode={s==1||s==3},1,0,$is_moderate_ratio +normalization_mode={{*}?!!{*,n}:$2} +posx,posy,sizx,sizy={0,[0,0,w,h]} +is_bottom_text,wait_event,mx,my,omb=0,1,-1,-1,0 +xsel0,ysel0,xsel1,ysel1,notification= +wnormalization0={*,n} +fontsize,fontsize_notif= +if $is_multiview" && "!${-is_macos} +if d==2 if {*,u}/w>={*,v}/h wsiz0={r={*,u}*0.48;round([r,r*h/w])} else wsiz0={r={*,v}*0.40;round([r*w/h,r])} fi +elif d<=4 wsiz0=${fitscreen\ .,,45%} +else wsiz0=${fitscreen\ .,,30%} +fi +wsiz0=${fitscreen\ $wsiz0,1,,90%} +else wsiz0=${fitscreen\ .} +fi +if $is_multiview +if narg($_d2d_names) l[] { $_d2d_names repeat $! { wname$>={$>,t} } rm } fi +com_iskey,com_flushkey,com_isvisible,com_isresized,com_idisp,sep= +repeat {img,d} { +if narg($_d2d_names) w$>[] {{*$>,w}?[-1,-1]:[$wsiz0]},0,${wname$>}" ("{w}x{h}x{d}x{s}")" +else w$>[] {{*$>,w}?[-1,-1]:[$wsiz0]},0,$nm" ("{w}x{h}x{d}x{s}")-#"$> +fi +com_iskey.=$sep"{*"$>",$""1}" +com_flushkey.=$sep"{*"$>",-$""1}" +com_isvisible.=$sep"{*"$>"}" +com_isresized.=$sep"{*"$>",r}" +com_idisp.=$sep"{*"$>",x}" +sep=, +} +m "iskey : u {max("$com_iskey")}"\n"flushkey : skip "$com_flushkey\n"isvisible : u {min("$com_isvisible")}"\n"isresized : u {max("$com_isresized")}"\n"idisp : u {argmax("$com_idisp")}" +if !${-is_macos} +ww,wh={[$wsiz0]+[8,40]} +if d==2 +if {*,u}/$ww>{*,v}/$wh +ox,oy={round([max(0,{*,u}-2*$ww),max(0,{*,v}-$wh)]/2)} +w0[] -1,-1,-1,-1,$ox,$oy +w1[] -1,-1,-1,-1,{$ox+$ww},$oy +else +ox,oy={round([{*,u}-$ww,{*,v}-2*$wh]/2)} +w0[] -1,-1,-1,-1,$ox,$oy +w1[] -1,-1,-1,-1,$ox,{$oy+$wh} +fi +elif d<=4 +ox,oy={round([max(0,{*,u}-2*$ww),max(0,{*,v}-2*$wh)]/2)} +ww,wh+=$ox,$oy +w0[] -1,-1,-1,-1,$ox,$oy +w1[] -1,-1,-1,-1,$ww,$oy +w2[] -1,-1,-1,-1,$ox,$wh +if d==4 w3[] -1,-1,-1,-1,$ww,$wh fi +else +ox,oy={round([max(0,{*,u}-3*$ww),max(0,{*,v}-(d>6?3:2)*$wh)]/2)} +ww2,wh2={2*[$ww,$wh]+[$ox,$oy]} +ww,wh+=$ox,$oy +w0[] -1,-1,-1,-1,$ox,$oy +w1[] -1,-1,-1,-1,$ww,$oy +w2[] -1,-1,-1,-1,$ww2,$oy +w3[] -1,-1,-1,-1,$ox,$wh +w4[] -1,-1,-1,-1,$ww,$wh +if d>5 w5[] -1,-1,-1,-1,$ww2,$wh fi +if d>6 w6[] -1,-1,-1,-1,$ox,$wh2 fi +if d>7 w7[] -1,-1,-1,-1,$ww,$wh2 fi +if d>8 w8[] -1,-1,-1,-1,$ww2,$wh2 fi +fi +fi +else +w[] {{*,w}?[-1,-1]:[$wsiz0]},0,$nm" ("{w}x{h}x{d}x{s}")" +m "iskey : u {*,$""1}"\n"flushkey : skip {*,-$""1}"\n"isvisible : u {*}"\n"isresized : u {*,r}"\n"idisp : u 0" +fi +repeat {img,d} { cursor[$>] 0 } +for ${-isvisible}" && "!${"iskey ESC"}" && "!((${"iskey CTRLLEFT"}" || "${"iskey CTRLRIGHT"})" && "${"iskey W"}) { +if $ratio_mode" && "$sizx>16" && "$sizy>16 +nposx,nposy,nsizx,nsizy=$posx,$posy,$sizx,$sizy +repeat 2 { +if {*,w}/$sizx<{*,h}/$sizy +nposy,nsizy={nsizy=$nsizx*{*,h}/{*,w};round([$nposy-(nsizy-$nsizy)/2,nsizy])} +else +nposx,nsizx={nsizx=$nsizy*{*,w}/{*,h};round([$nposx-(nsizx-$nsizx)/2,round(nsizx)])} +fi +if $<" && "$nsizx>w#0" && "$nsizy>h#0 nposx,nposy,nsizx,nsizy={[0,0,w#0,h#0]} fi +} +if [$nposx,$nposy,$nsizx,$nsizy]!=[$posx,$posy,$sizx,$sizy] +posx,posy,sizx,sizy=$nposx,$nposy,$nsizx,$nsizy +rmn baseview +fi +fi +if !narg($baseview) +($posx,{$posx+$sizx}) ($posy;{$posy+$sizy}) r[-2,-1] 2,2 a[-2,-1] c +r. {[{*,w,h}]+1},1,2,3 z. 0,0,{[w,h]-2} round. 1,-1 ind_warp={$!-1} ++channels[0] {0,[0,min(3,s-1)]} warp. ..,0,0,1 +if $is_multiview repeat {img,d-1} { +slices[img] {1+$>} warp. [$ind_warp],0,0,1 } a[-{img,d}--1] z fi +rm.. +if s>($alpha_mode?4:3) channels. 0,{$alpha_mode?3:2} fi ++r[0] 1,1,1,1,2 is_infnan={isnan(i)||isinf(i)} rm. +if $normalization_mode +if $is_infnan +eval[0] "*begin(m = inf; M = -inf); +!isinf(i) && !isnan(i)?(m = min(i,m); M = max(i,M)); +end( +merge(m,min); +merge(M,max); +run('im,iM=',m,',',M) +)" +vim,viM={[$im-abs($im),$iM+abs($iM)]} +f. "isnan(i)?"$vim":isinf(i)?(i<0?"$vim":"$viM"):i" +else +im,iM={0,[im,iM]} +fi +else +im,iM=0,255 +if $is_infnan f. "isnan(i)?"$im":isinf(i)?(i<0?"$im":"$iM"):i" fi +fi +if $normalization_mode==1 +sh. 0,{s-($alpha_mode" && "$may_have_alpha?2:1)} +if $is_multiview repeat {img,d} { +slices. $> n. 0,255 j.. .,0,0,$> rm. } else n. 0,255 fi +rm. +elif $normalization_mode==2 +sh. 0,{s-($alpha_mode" && "$may_have_alpha?2:1)} +if $is_multiview repeat d*s { z,c={[$>%d,int($>/d)]} sh. $z,$z,$c n. 0,255 rm. } +else repeat s { sh. $> n. 0,255 rm. } +fi +rm. +fi +if $posx<0" || "$posy<0" || "$posx+$sizx>=w#0" || "$posy+$sizy>=h#0 +100%,100% +rectangle. {A=-[$posx,$posy]*[w,h]/[$sizx,$sizy];B=A+[w#0,h#0]*[w,h]/[$sizx,$sizy]-1;[ceil(A),floor(B)]},1,1 +*[-2,-1] +fi +if $alpha_mode +coords={A=-[$posx,$posy]*[w,h]/[$sizx,$sizy];B=A+[w#0,h#0]*[w,h]/[$sizx,$sizy]-1;[ceil(A),floor(B)]} +if !$may_have_alpha +100%,100%,1,1,64 rectangle. $coords,1,255 r. 100%,100%,.. a[-2,-1] c +else +sh. 100% 100%,100%,1,1,64 rectangle. $coords,1,0 r. 100%,100%,.. +[-2,-1] rm. +fi +fi +if $alpha_mode +(128,160;160,128) r. 32,32,1,{-2,s-1} r. ..,..,..,100%,0,2,0.5,0.5 sh.. 100% j.. ...,0,0,0,0,1,.,255 rm[-3,-1] +elif s==1 r. 100%,100%,100%,3 +elif s==2 r. 100%,100%,100%,3,0 +fi +=> baseview +rmn view +fi +if narg($notification) +wait_event=0 +if !isnum($notification) +rmn notification_gfx +ofs,fs={narg($fontsize_notif)?0$fontsize_notif:32} +do +0 t. {``$notification},0,0,$fs,1,255 +if narg($fontsize_notif) break +elif {baseview,"(w#-1>0.7*w || h#-1>0.25*h) && "$fs>13" && "$ofs>=$fs} +ofs,fs=$fs,{max(13,round($fs/1.25))} rm. +elif {baseview,"w#-1<0.3*w && h#-1<0.25*h && "$fs<64" && "$ofs<=$fs} +ofs,fs=$fs,{min(64,round($fs*1.25))} rm. +else +fontsize_notif=$fs break +fi +while 1 +r. {[w+12,h+8]},1,1,0,0,0.5,0.5 rectangle. 0,0,100%,100%,1,0xFFFFFFFF,255 to_rgb. +=> notification_gfx +notification=$| +else +if $|>$notification+1 rm[notification_gfx] wait_event=1 notification= fi +rmn view +fi +fi +if !narg($view) +[baseview] +if $mx>=0 +posmx,posmy={floor([$posx,$posy]+[$mx,$my]*[$sizx,$sizy]/[{*,w,h}])} +is_selection_a_point={[0$xsel0,0$ysel0]==[0$xsel1,0$ysel1]} +if narg($xsel0)" && "!$is_selection_a_point +dselx,dsely={[$xsel1-$xsel0,$ysel1-$ysel0]} +ofs,fs={narg($fontsize)?0$fontsize:32} +do +0 t. " Box ( "{``{[min($xsel0,$xsel1),min($ysel0,$ysel1)]}}" ) - ""( "{``{[max($xsel0,$xsel1),max($ysel0,$ysel1)]}}" ) \n"" Size = ( "{``{abs([$dselx,$dsely]+1)}}" ), ""Length = "{_norm($dselx,$dsely)}" \n"" Angle = "{_atan2($dsely,$dselx)*180/pi}"\260 ",1,0,$fs,1,1 +if narg($fontsize) break +elif {baseview,"(w#-1>0.7*w || h#-1>0.45*h) && "$fs>13" && "$ofs>=$fs} +ofs,fs=$fs,{max(13,round($fs/1.25))} rm. +elif {baseview,"w#-1<0.3*w && h#-1<0.45*h && "$fs<64" && "$ofs<=$fs} +ofs,fs=$fs,{min(64,round($fs*1.25))} rm. +else +fontsize=$fs break +fi +while 1 +n. 0,255 +dilate. 3 *. -1 n. 0,80 +[-2,-1] r. 100%,100%,..,.. +j.. .,0,$is_bottom_text~,0,0,0.85 rm. +fi +if $mx>=0 +if $posmx>=0" && "$posmx=0" && "$posmy);(s>=1" || "s<=4)" && "min(isint(P))" && "min(P)>=0" && "max(P)<=255} +hexstr="= \#"{img,`"digit(x) = (x<10?_'0' + x:_'A' + x - 10);P = I("$posmx,$posmy,$>");[ digit(P[0]>>4),digit(P[0]&15),s<2?0:digit(P[1]>>4),s<2?0:digit(P[1]&15),s<3?0:digit(P[2]>>4),s<3?0:digit(P[2]&15),s<4?0:digit(P[3]>>4),s<4?0:digit(P[3]&15) ]"`}" " +else hexstr= fi +ofs,fs={narg($fontsize)?0$fontsize:32} +do +0 t. " Point ( "$posmx","$posmy" ) = [ "${_d2d_format\ {img,_I($posmx,$posmy,$>)}}" ] "$hexstr,1,0,$fs,1,1 +if narg($fontsize) break +elif {baseview,"(w#-1>0.7*w || h#-1>0.15*h) && "$fs>13" && "$ofs>=$fs} +_ofs,fs=$fs,{max(13,round($fs/1.25))} rm. +elif {baseview,"w#-1<0.3*w && h#-1<0.15*h && "$fs<64" && "$ofs<=$fs} +ofs,fs=$fs,{min(64,round($fs*1.25))} rm. +else +fontsize=$fs break +fi +while 1 +n. 0,255 +dilate. 3 *. -1 n. 0,80 +[-2,-1] r. 100%,100%,1,.. +j.. .,0,$is_bottom_text~,$>,0,0.85 rm. +} +fi +x0,y0,x1,y1={[round([$posmx-$posx,$posmy-$posy]*[{*,w,h}]/[$sizx,$sizy]),round([$posmx-$posx+1,$posmy-$posy+1]*[{*,w,h}]/[$sizx,$sizy])-1]} +if $x1-$x0>=8" && "$y1-$y0>=8 +repeat d==1?1:d*s { +if d==1 sh. else sh. {z=$>%d;[z,z,int($>/d)]} fi +rectangle. $x0,$y0,$x1,$y1,1,0x55555555,0 +rectangle. $x0,$y0,$x1,$y1,1,0xAAAAAAAA,255 +rm. +} +fi +fi +if $axes_mode +repeat d==1?1:d*s { +if d==1 sh. else sh. {z=$>%d;[z,z,int($>/d)]} fi +line. $mx,0,$mx,100%,0.5,0xFF00FF00,255 +line. $mx,0,$mx,100%,0.5,0x00FF00FF,0 +line. 0,$my,100%,$my,0.5,0xFF00FF00,255 +line. 0,$my,100%,$my,0.5,0x00FF00FF,0 +rm. +} +fi +fi +if narg($xsel0) +x0,y0,x1,y1={xm=min($xsel0,$xsel1);xM=max($xsel0,$xsel1);ym=min($ysel0,$ysel1);yM=max($ysel0,$ysel1);[[xm-$posx,ym-$posy]*[{*,w,h}]/[$sizx,$sizy],[xM+1-$posx,yM+1-$posy]*[{*,w,h}]/[$sizx,$sizy]-1]} +repeat d==1?1:d*s { +if d==1 sh. else sh. {z=$>%d;[z,z,int($>/d)]} fi +rectangle. $x0,$y0,$x1,$y1,0.2,0 +rectangle. $x0,$y0,$x1,$y1,0.9,0x55555555,0 +rectangle. $x0,$y0,$x1,$y1,0.9,0xAAAAAAAA,255 +rm. +} +if $xsel0>$xsel1 x0,x1=$x1,$x0 fi +if $ysel0>$ysel1 y0,y1=$y1,$y0 fi +if $xsel0!=$xsel1" && "$ysel0!=$ysel1 +x0,y0,x1,y1={[(0.5+[$xsel0-$posx,$ysel0-$posy])*[{*,w,h}]/[$sizx,$sizy],(0.5+[$xsel1-$posx,$ysel1-$posy])*[{*,w,h}]/[$sizx,$sizy]]} +repeat d==1?1:d*s { +if d==1 sh. else sh. {z=$>%d;[z,z,int($>/d)]} fi +line. $x0,$y0,$x1,$y1,0.9,0x33333333,0 +line. $x0,$y0,$x1,$y1,0.9,0xCCCCCCCC,255 +rm. +} +fi +fi +fi +if $notification_gfx ++r[notification_gfx] 100%,100%,. j.. .,{[w#-2-w-4,4]},0,0,{sqrt(max(0,1-($|-$notification)))} rm. +fi +=> view +if $is_multiview repeat d { +slices[view] $> w$>. rm. } else w. fi +fi +if $wait_event wait else wait 40 fi +idisp=${-idisp} +wait_event=1 +old_mx,old_my=$mx,$my +nposx,nposy,nsizx,nsizy=$posx,$posy,$sizx,$sizy +is_CTRL,mb,mx,my,mo={${"iskey CTRLLEFT"}" || "${"iskey CTRLRIGHT"}},{*$idisp,b,x,y,-o} +if !($mb&4)" && "!($is_CTRL" && "($mb&1)) pan_mx,pan_my,pan_posx,pan_posy= fi +if {view,$my<0" || "$my>=h-16} is_bottom_text=0 +elif $my<16 is_bottom_text=1 +fi +if ${-isresized} +repeat {img,d} { +w=$> if {*$w,r} +w$w[] {*$w,d,e} +if $is_multiview repeat {img,d} { w$>[] {*$w,w,h} } fi +if $nsizx>w#0" && "$nsizy>h#0 nposx,nposy,nsizx,nsizy={[0,0,w#0,h#0]} fi +break +fi +} +fontsize,fontsize_notif= +rmn baseview +elif $is_CTRL" && "${"iskey D"}" && "{*$idisp,d}<{*$idisp,u}" && "{*$idisp,e}<{*$idisp,v} +w$idisp[] {round([{*$idisp,w,h}]*1.25)} +if $is_multiview repeat {img,d} { w$>[] {*$idisp,w,h} } fi +notification="Increase Window Size" +fontsize,fontsize_notif= +flushkey D rmn baseview +elif $is_CTRL" && "${"iskey C"}" && "{*$idisp,d}>64" && "{*$idisp,e}>64 +w$idisp[] {round([{*$idisp,w,h}]/1.25)} +if $is_multiview repeat {img,d} { w$>[] {*$idisp,w,h} } fi +notification="Decrease Window Size" +fontsize,fontsize_notif= +flushkey C rmn baseview +elif $is_CTRL" && "${"iskey R"} +nposx,nposy,nsizx,nsizy={0,[0,0,w,h]} +repeat {img,d} { w$>[] $wsiz0 } +notification="Reset Window Size" +fontsize,fontsize_notif= +flushkey R rmn baseview +fi +if !$is_CTRL" && "$mb&1" && "$mx>0 +xsel,ysel={X=[$nposx,$nposy]+[$mx,$my]*[$nsizx,$nsizy]/[{*,w,h}];floor([max(0,min(X[0],w#0-1)),max(0,min(X[1],h#0-1))])} +if !narg($xsel0)" && "!($omb&1) xsel0,ysel0,xsel1,ysel1=$xsel,$ysel,$xsel,$ysel +elif narg($xsel0) xsel1,ysel1=$xsel,$ysel +fi +if $mx<=16 nposx-={$nsizx/64} wait_event=0 xzoom,yzoom= +elif $mx>={*,w}-17 nposx+={$nsizx/64} wait_event=0 xzoom,yzoom= +fi +if $my<=16 nposy-={$nsizy/64} wait_event=0 xzoom,yzoom= +elif $my>{*,h}-17 nposy+={$nsizx/64} wait_event=0 xzoom,yzoom= +fi +wait_event=0 +rmn view +elif !($mb&1) +if narg($xsel0) +if "p0 = ["$xsel0,$ysel0]"; p1 = ["$xsel1,$ysel1"]; +siz = max("$sizx,$sizy"); +p0==p1 || (siz>128 && norm1(p1-p0)<=siz/100)" +if $1" && "$nsizx>=w#0" && "$nsizy>=h#0 break fi +nposx,nposy,nsizx,nsizy={0,[0,0,w,h]} +else +nposx,nposy,nsizx,nsizy={[min($xsel0,$xsel1),min($ysel0,$ysel1),abs([$xsel1-$xsel0,$ysel1-$ysel0])+1]} +fi +xzoom,yzoom= mb={$mb&6} +rmn view +fi +xsel0,ysel0,xsel1,ysel1= +fi +if ${"iskey ARROWLEFT"} nposx-={$nsizx/($is_CTRL?4:16)} xzoom,yzoom= +elif ${"iskey ARROWRIGHT"} nposx+={$nsizx/($is_CTRL?4:16)} xzoom,yzoom= +elif ${"iskey ARROWUP"} nposy-={$nsizy/($is_CTRL?4:16)} xzoom,yzoom= +elif ${"iskey ARROWDOWN"} nposy+={$nsizy/($is_CTRL?4:16)} xzoom,yzoom= +elif $is_CTRL" && "${"iskey O"} +n=0 do filename gmic.gmz,$n n+=1 while isfile(['{/${}}']) +if $is_multiview +slices[img] $idisp o. ${} rm. else o[img] ${} fi +notification="Save Copy:\n"${} +flushkey O +elif $is_CTRL" && "${"iskey S"} +n=0 do filename gmic.png,$n n+=1 while isfile(['{/${}}']) +if $is_multiview +slices[baseview] $idisp o. ${} rm. else o[baseview] ${} fi +notification="Save Screenshot:\n"${} +flushkey S +elif $is_CTRL" && "${"iskey SPACE"} +nposx,nposy,nsizx,nsizy={0,[0,0,w,h]} +notification="Center View" +flushkey SPACE +elif $is_CTRL" && "${"iskey N"} +normalization_mode={($normalization_mode+1)%3} +notification=${"s0=Disable s1=Enable s2=\"Enable C.by.C\" u ${s"$normalization_mode"}"}" Normalization" +flushkey N rmn baseview +elif $is_CTRL" && "${"iskey A"} +alpha_mode={!$alpha_mode} +notification=${"s0=Disable s1=Enable u ${s"$alpha_mode"}"}" Alpha" +flushkey A rmn baseview +elif $is_CTRL" && "${"iskey F"} +fullscreen_mode={!$fullscreen_mode} +if $fullscreen_mode +fullscreen_wsize={*,w,h} fullscreen_params=$nposx,$nposy,$nsizx,$nsizy +w[] {*,u,v},0,1 +else +nposx,nposy,nsizx,nsizy=$fullscreen_params +w[] $fullscreen_wsize,0,0 +fi +repeat {img,d} { cursor[$>] {!$axes_mode} } +notification=${"s0=Disable s1=Enable u ${s"$fullscreen_mode"}"}" Fullscreen" +flushkey F rmn baseview +elif $is_CTRL" && "${"iskey X"} +repeat {img,d} { cursor[$>] $axes_mode } axes_mode={!$axes_mode} +notification=${"s0=Hide s1=Show u ${s"$axes_mode"}"}" Axes" +flushkey X rmn view +elif $is_CTRL" && "${"iskey Z"}" && "$is_moderate_ratio +ratio_mode={!$ratio_mode} +notification=${"s0=Release s1=Hold u ${s"$ratio_mode"}"}" Aspect Ratio" +if !$ratio_mode nposx,nposy,nsizx,nsizy={0,[0,0,w,h]} fi +flushkey Z rmn baseview +elif $mx>=0" && "($mb&4" || "($is_CTRL" && "$mb&1)) +if !narg($pan_mx) pan_mx,pan_my,pan_posx,pan_posy=$mx,$my,$posx,$posy fi +nposx,nposy={shiftx=($mx-$pan_mx)*$nsizx/{*,w};shifty=($my-$pan_my)*$nsizy/{*,h};[$pan_posx-shiftx,$pan_posy-shifty]} +xzoom,yzoom= +elif ${"iskey PADSUB"}" || "($mx>=0" && "$mo<0) +if $nsizx>=w#0" && "$nsizy>=h#0 +nposx,nposy,nsizx,nsizy={[$nposx/2,$nposy/2,w#0,h#0]} +else +if !narg($xzoom) +xzoom,yzoom={X=$mx<0?[$nposx,$nposy]+[$nsizx,$nsizy]/2:[$nposx,$nposy]+[$mx,$my]*[$nsizx,$nsizy]/[{*,w,h}];[max(0,min(X[0],w#0-1)),max(0,min(X[1],h#0-1))]} +fi +nposx,nposy,nsizx,nsizy={[[$xzoom,$yzoom]+[$nposx-$xzoom,$nposy-$yzoom]/0.75,min(w#0,round($nsizx/0.75)),min(h#0,round($nsizy/0.75))]} +if $nsizx>w#0" && "$nsizy>h#0 nsizx,nsizy={[w#0,h#0]} fi +fi +elif ($nsizx>2" || "$nsizy>2)" && "(${"iskey PADADD"}" || "($mx>=0" && "$mo>0)) +xzoom,yzoom={X=$mx<0?[$nposx,$nposy]+[$nsizx,$nsizy]/2:[$nposx,$nposy]+[$mx,$my]*[$nsizx,$nsizy]/[{*,w,h}];[max(0,min(X[0],w#0-1)),max(0,min(X[1],h#0-1))]} +nposx,nposy,nsizx,nsizy={[[$xzoom,$yzoom]+0.75*[$nposx-$xzoom,$nposy-$yzoom],round(0.75*[$nsizx,$nsizy])]} +fi +if $nposx>=w#0-0.5*$nsizx nposx={w#0-1-0.5*$nsizx} +elif $nposx<=-0.5*$nsizx nposx={1-0.5*$nsizx} +fi +if $nposy>=h#0-0.5*$nsizy nposy={h#0-1-0.5*$nsizy} +elif $nposy<=-0.5*$nsizy nposy={1-0.5*$nsizy} +fi +if [$nposx,$nposy,$nsizx,$nsizy]!=[$posx,$posy,$sizx,$sizy] +posx,posy,sizx,sizy=$nposx,$nposy,$nsizx,$nsizy +rmn baseview +fi +if [$mx,$my]!=[$old_mx,$old_my] rmn view fi +omb=$mb +} +k[0] +if narg($_d2d_core) w[] -1,-1,$wnormalization0 +else +if $is_multiview repeat d { w$>[] 0 } else w[] 0 fi +fi +=> $nm um iskey,flushkey,isvisible,isresized,idisp +} +um _d2d_format v -1 d[] +dp : +_gmic_s="$?" v + _display_parallel 1 +display_parallel : +_gmic_s="$?" v + _$0 1 +_display_parallel : check ${1=0}>=0 +e[0--3] "Display image$? in parallel." +print +is_d2d_compatible={"res = l<=10; repeat (l,k, res&=(w#k==w && h#k==h && d#k==1 && s#k==s))"} +if $is_d2d_compatible +N=$! +repeat $! { +if s=['{$>,n}'];find(s,_'.',size(s)-1,-1)>0 nm={$>,b}.{$>,x} else nm={$>,b} fi +('$nm':;) +} +store[-$N--1] _d2d_names +a z _display2d 0,$1 s z +_d2d_names= +else +if $!<=1 v - d v + return fi +14,$! eval. "!x?copy(i(),[[',d['],v2s(y,10,10),_']'])" =. 0 discard. 0 str={t} rm. +m "__dp : parallel "$str __dp um __dp +fi +v -1 d[] +dp0 : +_gmic_s="$?" v + _display_parallel 0 +display_parallel0 : +_gmic_s="$?" v + _display_parallel 0 +default_display : +_gmic_s="$?" v + _display "",1,$[] +#@cli d3d : eq. to 'display3d'. +d3d : skip "${1=},${2=0}" +l[] { is_image_arg=${"is_image_arg $1"} is_arg={$is_image_arg" || isnum($1)"} onfail is_arg=0 } +if $is_arg arg=$is_image_arg,$2 if $is_image_arg pass$1 1 _d3d_wh={[w,h]} store. _d3d_background fi +else arg=0,0 noarg fi +v + _display3d $arg +#@cli display3d : _[background_image],_exit_on_anykey={ 0 | 1 } : _exit_on_anykey={ 0 | 1 } +#@cli : Display selected 3D objects in an interactive viewer (use the instant display window [0] if opened). +#@cli : (eq. to 'd3d'). +#@cli : Default values: '[background_image]=(default)' and 'exit_on_anykey=0'. +display3d : skip "${1=},${2=0}" +l[] { is_image_arg=${"is_image_arg $1"} is_arg={$is_image_arg" || isnum($1)"} onfail is_arg=0 } +if $is_arg arg=$is_image_arg,$2 if $is_image_arg pass$1 1 _d3d_wh={[w,h]} store. _d3d_background fi +else arg=0,0 noarg fi +v + _$0 $arg +_display3d : +is_user_background,exit_on_anykey=$1,$2 +if !$! e[0--3] "Display 3D object []." return fi +foreach { +l. { check3d 1 onfail l[] { ({'${}'}) s +,{'"'check3d': "'} k. msg={t} rm } error[] "Command 'display3d': "$msg } +nm={n} bnm={b} l. { if ['{x}']!=0 bnm.=.{x} fi onfail bnm.=.{x} } +nbv,nbp:=f2ui([i[6],i[7]]) +e[0--4] "Display 3D object ["{arg(1+$>,$[])}"] = '"$nm"' ("$nbv" vertices, "$nbp" primitives)." +if ['$_d3d_title']==0 disp_title=$bnm" ("$nbv" vertices, "$nbp" primitives)" else disp_title=$_d3d_title fi +if !{*} +if narg($_d3d_wh) w[] ${fitscreen\ $_d3d_wh,1,128,1024},0,$disp_title +else w[] ${fitscreen\ {[0.5,0.6]*[{*,u,v}]},1,128,1024},0,$disp_title +fi +else disp_normalization={*,n} w[] -1,-1,0,$disp_title fi +disp_size0={*,w,h} +(1,0,0,0;0,1,0,0;0,0,1,0) store. pose3d +posx,posy,zoom_factor=50,50,1 +is_fullscreen,is_zbuffer,is_axes3d,is_outline,is_boundingbox,is_animate,is_outvideo={*,f},1,1,0,0,0,0 +mode_render:=isint($_mode3d)?$_mode3d:4 +mode_drender:=isint($_moded3d)?$_moded3d:-1 +mode_background={$is_user_background?7:5} +mode_orientation:=!isbool($_double3d)?2:$_double3d==1?2:0; +mode_animate=1 +speed_animate=1 +focale:=isnum($_focale3d)?$_focale3d:800 +mx0,my0,mx1,my1= +notification= fontsize_notif= +wait_event=1 +axes3d 40,40,40,20,X,Y,Z,0 col3d. 0,255,0 l. { s3d a[0-3] y off_axes={0,h} a y } => axes3d +do +is_motion={narg($mx0)} +if $is_animate" || "$is_outvideo rmn render fi +if !narg($background) +if $mode_background<3 {*,w,h},1,3,{arg(1+$mode_background,0,255,128)} +elif $mode_background==3 3,2,1,1,"16,16,48,44,96,76" permute. cyzx r. {*,w,h},1,3,3 round. +elif $mode_background==4 3,2,1,1,"0,0,0,0,64,96" permute. cyzx r. {*,w,h},1,3,3 round. +elif $mode_background==5 3,3,1,1,"0,0,0,0,0,100,100,0,50" permute. cyzx r. {*,w,h},1,3,3 round. +elif $mode_background==6 2,2,1,1,110,90,90,110 r. 64,64,1,3 r. {*,w,h},1,3,0,2,0.5,0.5 +else $_d3d_background r. {*,w,h},1,3,1 +fi +w. => background +rmn object3d +fi +if !narg($object3d) ++c3d[0] n3d. *3d. {background,$zoom_factor*0.65*min(w,h)} +if $mode_orientation==1 rv3d. fi +rmn boundingbox3d +if $is_boundingbox +boundingbox3d. o3d. 0.2 => boundingbox3d +3d.. . rv[-2,-1] fi +=> object3d +rmn render +fi +if !narg($render) +$pose3d +if $is_animate" || "$is_outvideo l. { +da={$speed_animate*($is_animate?20*($|-$time_animate):1)} +if $mode_animate==0 rotation3d 1,0,0,$da rv +elif $mode_animate==1 rotation3d 0,1,0,$da rv +elif $mode_animate==2 rotation3d 0,0,1,$da rv +else +dax,day,daz={[0.75,0.82,0.97]*$da} +rotation3d 0,1,0,$dax rotation3d 1,0,0,$day rotation3d 0,0,1,$daz rv +fi +m* 1,3,1,1 j.. .,3 rm. +store. pose3d +time_animate=$| +} fi +p={^} rm. +m={$is_motion?$mode_drender:$mode_render} +[background] => render +if $m<0 +if !narg($boundingbox3d) +boundingbox3d[object3d] o3d. 0.35 => boundingbox3d fi ++pose3d[boundingbox3d] $p +j3d[render] .,$posx%,$posy%,0,1,1,0,0,$focale rm. +else ++pose3d[object3d] $p +if $is_outline +{render,[w,h]},1,3,-1 +j3d. ..,$posx%,$posy%,0,1,$m,{$mode_orientation==2},$is_zbuffer,$focale ++channels. 0 !=. -1 ++dilate. 5 r. 100%,100%,1,3 j[render] .,0,0,0,0,0.8,. rm. +j[render] ..,0,0,0,0,1,. rm[-2,-1] +else +j3d[render] .,$posx%,$posy%,0,1,$m,{$mode_orientation==2},$is_zbuffer,$focale +fi +rm. +fi +if $is_axes3d ++pose3d[axes3d] $p +eval " +const off = "$off_axes"; +ref([ 255,0,0 ],col); +i[13]>0?copy(i[off],col,3); +i[19]>0?copy(i[off + 3],col,3); +i[25]>0?copy(i[off + 6],col,3); +" +j3d[render] .,50,{-2,h-50},0,0.75,1,0,0,150 rm. +fi +rmn view +if $is_outvideo +o[render] $filename_outvideo,20,0,1 +nb_frames={int(360/$speed_animate)} +if $is_outvideo>=$nb_frames +o[] $filename_outvideo,20,0,0 +is_outvideo=0 +notification="Output Video:\nDone!" +else +is_outvideo+=1 +notification="Output Video:\nFrame "{$is_outvideo-1}/$nb_frames +fi +fi +fi +if narg($notification) +wait_event=0 +if !isnum($notification) +rmn notification_gfx +ofs,fs={narg($fontsize_notif)?0$fontsize_notif:32} +do +0 t. {``$notification},0,0,$fs,1,255 +if narg($fontsize_notif) break +elif {background,"(w#-1>0.7*w || h#-1>0.25*h) && "$fs>13" && "$ofs>=$fs} +ofs,fs=$fs,{max(13,round($fs/1.25))} rm. +elif {background,"w#-1<0.3*w && h#-1<0.25*h && "$fs<64" && "$ofs<=$fs} +ofs,fs=$fs,{min(64,round($fs*1.25))} rm. +else +fontsize_notif=$fs break +fi +while 1 +r. {[w+12,h+8]},1,1,0,0,0.5,0.5 rectangle. 0,0,100%,100%,1,0xFFFFFFFF,255 to_rgb. +=> notification_gfx +notification=$| +else +if $|>$notification+1 rm[notification_gfx] wait_event=1 notification= fi +rmn view +fi +fi +if !narg($view) +if $notification_gfx ++j[render] [notification_gfx],0.99~,5,0,0,{sqrt(max(0,1-($|-$notification)))} +else [render] +fi +=> view w. -1,-1,0,$is_fullscreen,$disp_title +fi +if $is_motion" || "$is_animate wait_event=0 fi +if $wait_event wait elif !$is_outvideo wait 20 fi +if $exit_on_anykey" && "{*,k} break fi +if $is_outvideo continue fi +mx,my,mb={*,x,y,b} +is_CTRL={{*,CTRLLEFT}" || "{*,CTRLRIGHT}} +if {*,-F1} +mode_render,mode_drender={M=0;m=$mode_render;wasbbox=$mode_drender<0;[M,m!=M?(wasbbox?-1:M):(wasbbox?M:-1)]} +notification="Render: Dots" if $mode_drender<0 notification.=" + Box" fi +rmn render +elif {*,-F2} +mode_render,mode_drender={M=1;m=$mode_render;wasbbox=$mode_drender<0;[M,m!=M?(wasbbox?-1:M):(wasbbox?M:-1)]} +notification="Render: Wireframe" if $mode_drender<0 notification.=" + Box" fi +rmn render +elif {*,-F3} +mode_render,mode_drender={M=2;m=$mode_render;wasbbox=$mode_drender<0;[M,m!=M?(wasbbox?-1:M):(wasbbox?M:-1)]} +notification="Render: Flat" if $mode_drender<0 notification.=" + Box" fi +rmn render +elif {*,-F4} +mode_render,mode_drender={M=3;m=$mode_render;wasbbox=$mode_drender<0;[M,m!=M?(wasbbox?-1:M):(wasbbox?M:-1)]} +notification="Render: Flat-Shaded" if $mode_drender<0 notification.=" + Box" fi +rmn render +elif {*,-F5} +mode_render,mode_drender={M=4;m=$mode_render;wasbbox=$mode_drender<0;[M,m!=M?(wasbbox?-1:M):(wasbbox?M:-1)]} +notification="Render: Gouraud-Shaded" if $mode_drender<0 notification.=" + Box" fi +rmn render +elif {*,-F6} +mode_render,mode_drender={M=5;m=$mode_render;wasbbox=$mode_drender<0;[M,m!=M?(wasbbox?-1:M):(wasbbox?M:-1)]} +notification="Render: Phong-Shaded" if $mode_drender<0 notification.=" + Box" fi +rmn render +elif {*,-F7}" && "($focale>100" || "!$focale) +if !$focale focale=2000 else focale-=100 fi +notification="Focale: "$focale +rmn render +elif {*,-F8}" && "$focale +if $focale>=2000 focale=0 notification="Focale: Inf" else focale+=100 notification="Focale: "$focale fi +rmn render +elif {*,-F9} +mode_animate={($mode_animate+1)%4} +n0,n1,n2,n3="X-Axis","Y-Axis","Z-Axis","XYZ-Axes" notification="Animation Mode: "${n$mode_animate} +rmn render +elif {*,-F10} +speed_animate={max(1,($speed_animate+1)%9)} +notification="Animation Speed: X"$speed_animate +elif {*,-SPACE} +is_animate,time_animate={!$is_animate},$| +n0,n1="Off","On" notification="Animation: "${n$is_animate} +rmn render +fi +if $is_CTRL +if {*,-A} +is_axes3d={!$is_axes3d} +n0,n1="Off","On" notification="3D Axes: "${n$is_axes3d} +rmn render +elif {*,-B} +mode_background={($mode_background+1)%($is_user_background?8:7)} +n0,n1,n2,n3,n4,n5,n6,n7="Black","White","Gray","Gradient \#1","Gradient \#2","Gradient \#3","Checkerboard","User-Defined" +notification="Background: "${n$mode_background} +rmn background +elif {*,-C}" && "{*,w}>128" && "{*,h}>128 w[] {0.8*[{*,w,h}]} +notification="Decrease Window Size" fontsize_notif= +rmn background +elif {*,-D}" && "{*,w}<0.8*{*,u}" && "{*,h}<0.8*{*,v} w[] {1.25*[{*,w,h}]} +notification="Increase Window Size" fontsize_notif= +rmn background +elif {*,-F} +is_fullscreen={!$is_fullscreen} +if $is_fullscreen w[] {*,u,v} else w[] {0.75*[{*,u,v}]} fi +n0,n1="Off","On" notification="Fullscreen: "${n$is_fullscreen} fontsize_notif= +rmn background +elif {*,-G} +n=0 do filename gmic.obj,$n n+=1 while isfile(['{/${}}']) +notification="Save Copy:\n"${} +o[0] ${} +elif {*,-L} +is_outline={!$is_outline} +n0,n1="Off","On" notification="Outline: "${n$is_outline} +rmn render +elif {*,-O} +n=0 do filename gmic.gmz,$n n+=1 while isfile(['{/${}}']) +o[0] ${} +notification="Save Copy:\n"${} +elif {*,-P} +$pose3d v 0 e " > 3D Pose = [ "{^}" ]." rm. +elif {*,-R} +w[] $disp_size0 +notification="Reset Window Size" fontsize_notif= +rmn background +elif {*,-S} +n=0 do filename gmic.png,$n n+=1 while isfile(['{/${}}']) +o[render] ${} +notification="Save Screenshot:\n"${} +elif {*,-T} +mode_orientation={($mode_orientation+1)%3} +n0,n1,n2="Forward","Backward","Double-Sided" notification="Orientation: "${n$mode_orientation} +if $mode_orientation rv3d[object3d] fi +rmn render +elif {*,-V} +is_outvideo={!$is_outvideo} +is_animate=0 +n=0 do filename gmic.mp4,$n n+=1 while isfile(['{/${}}']) +filename_outvideo=${} +elif {*,-X} +is_boundingbox={!$is_boundingbox} +n0,n1="Off","On" notification="Bounding Box: "${n$is_boundingbox} +rmn object3d +elif {*,-Z} +is_zbuffer={!$is_zbuffer} +n0,n1="Off","On" notification="Z-Buffer: "${n$is_zbuffer} +rmn render +fi +fi +if {*,-r} rmn background fontsize_notif= fi +if $mx>=0 +if $mb +if !narg($mx0) mx0,my0,mx1,my1=$mx,$my,$mx,$my else mx1,my1=$mx,$my fi +else +if narg($mx0) rmn render fi +mx0,my0,mx1,my1= +fi +fi +if narg($mx1)" && "($mx0!=$mx1" || "$my0!=$my1) +rmn render +if $mb&1" && "!$is_CTRL +rotation3d[] {" +const w2 = "{*,w}"/2; +const h2 = "{*,h}"/2; +const R = 0.375*min("{*,w,h}"); +const u0 = "$mx0" - w2; +const v0 = "$my0" - h2; +const u1 = "$mx1" - w2; +const v1 = "$my1" - h2; +n0 = norm(u0,v0); +nu0 = n0>R?u0*R/n0:u0; +nv0 = n0>R?v0*R/n0:v0; +nw0 = sqrt(max(0,R^2 - nu0^2 - nv0^2)); +n1 = norm(u1,v1); +nu1 = n1>R?u1*R/n1:u1; +nv1 = n1>R?v1*R/n1:v1; +nw1 = sqrt(max(0,R^2 - nu1^2 - nv1^2)); +u = nv0*nw1 - nw0*nv1; +v = nw0*nu1 - nu0*nw1; +w = nv0*nu1 - nu0*nv1; +n = norm(u,v,w); +[ u,v,w,-asin(n/R^2)*180/pi ]"} +$pose3d m*[-2,-1] store. pose3d +mx0,my0=$mx1,$my1 +elif $mb&4" || "($mb&1" && "$is_CTRL) +posx,posy={" +const px = $mx1 - $mx0 + $posx*"{*,w}"%; +const py = $my1 - $my0 + $posy*"{*,h}"%; +[px,py]*100/["{*,w,h}"]"} +mx0,my0=$mx1,$my1 +elif $mb&2 +fact={1+($my0-$my1)/100} +zoom_factor*=$fact +*3d[object3d] $fact if narg($boundingbox3d) *3d[boundingbox3d] $fact fi +mx0,my0=$mx1,$my1 +fi +fi +if {*,o} +fact={1+{*,-o}/10} +zoom_factor*=$fact +*3d[object3d] $fact if narg($boundingbox3d) *3d[boundingbox3d] $fact fi +rmn render +fi +while {*}" && "!{*,ESC}" && "!($is_CTRL" && "{*,W}) +k[0] +} +if narg($disp_normalization) w[] -1,-1,$disp_normalization else w[] 0 fi +v -1 d[] +#@cli lezoray3d : out_filename.png,nb_frames>0 +#@cli : Generate a 3D animation from a set of two 3D meshes. +#@cli : Output frames are 1024x512 RGBA images. +#@cli : $ gmic mesh1.obj mesh2.obj lezoray3d out.png,180 (silent mode) +#@cli : $ gmic mesh1.obj mesh2.obj w[] lezoray3d out.png,180 (with display). +lezoray3d : check "isint(${2=180}) && $2>0" skip "${1=out.png}" +basename {0,n} nm0=${} +basename {1,n} nm1=${} +e[^-1] "Generate 3D animation of 3D meshes '"$nm0"' and '"$nm1"', with output filename '$1' and $2 frames.\n" +c3d n3d *3d 400 +if {*} w[] ${"fitscreen 1024,512"},0 fi +repeat $2 { +e "\r - Frame \#"{$>+1}/$2 ++r3d[0,1] 0,1,0,{$>*360/$2} +1024,512,1,3,-1 +j3d. ...,25%,50%,0,1,4,1,1 +j3d. ..,75%,50%,0,1,4,1,1 +to_rgba. replace_color. 0,0,-1,-1,-1,255,0,0,0,0 +filename $1,$> file=${} +o. $file +if {*} drgba. to. "Frame \#"{$>+1}/$2,0,0,5% w. fi +k[0,1] +} +rm +e "\r - Done! " +is_percent : +u {"s=['$1'];s[size(s)-1]==_'%'"} +dar_lib : +u " +dar_size(ind) = i[#ind,h(#ind) - 1]; +dar_Back(ind) = I[#ind,dar_size(#ind) - 1]; +dar_back(ind) = i[#ind,dar_size(#ind) - 1]; +dar_insert(ind,elt,pos) = ( +ref(pos,_dar_pos); +ref(elt,_dar_elt); +_dar_siz = dar_size(#ind); +ref(max(1,s(#ind),size(_dar_elt)),_dar_sizelt); +if (_dar_pos<=_dar_siz, +_dar_siz>=h(#ind) - 1?resize(#ind,1,_dar_siz*2 + 2,1,_dar_sizelt,0); +for (_dar_c = 0, _dar_c<_dar_sizelt, ++_dar_c, +copy(i(#ind,_dar_pos + 1,0,0,_dar_c),i(#ind,_dar_pos,0,0,_dar_c),_dar_siz - _dar_pos) +); +copy(i[#ind,_dar_pos],_dar_elt,_dar_sizelt,h(#ind),1); +i[#ind,h(#ind) - 1] = ++_dar_siz; +); +); +dar_insert(ind,elt) = ( +ref(elt,_dar_elt); +_dar_siz = dar_size(#ind); +ref(max(1,s(#ind),size(_dar_elt)),_dar_sizelt); +_dar_siz>=h(#ind) - 1?resize(#ind,1,_dar_siz*2 + 2,1,_dar_sizelt,0); +copy(i[#ind,_dar_siz],_dar_elt,_dar_sizelt,h(#ind),1); +i[#ind,h(#ind) - 1] = ++_dar_siz; +); +dar_remove(ind,pos) = ( +ref(pos,_dar_pos); +_dar_siz = dar_size(#ind); +if (_dar_pos<_dar_siz, +_dar_siz = --dar_size(#ind); +for (_dar_c = 0, _dar_c0?--dar_size(#ind); +);" +gaap_test : +b $1 +u \{{$1+10}\}\{$2,$3,255\} +fx_gca : +channel={1+$6} +repeat $! l[$>] to_color split_opacity l[0] ++fc $1,$2,$3 +-[1] [0] norm[1] /[1] {1e-6+iM} *[1] -1 +[1] 1 ^[1] $4 +rgb2hsl[0] s[0] c +if $5==0 *[$channel,-1] +elif $5==1 ($1^$2^$3) rgb2hsl. *[$channel] {i[$channel]} rm[-2,-1] +else rv[$channel,-1] rm. +fi +a c hsl2rgb +done a c done done +fx_gca_preview : +gui_split_preview "fx_gca $*",$-1 +fx_grain : +repeat $! l[$>] apply_channels "_fx_grain ${1-13}",$4,0 done done +_fx_grain : +if !$1 return fi +s={s} +luminance +if $5 +100%,100%,1,$s noise. 1,$3 b. $6 *. {(1-$7)/max(abs(im),abs(iM))} +100%,100%,1,1 noise. 1,$3 b. $6 *. {$7/max(abs(im),abs(iM))} ++[-2,-1] +ir[1] 0,85 b. $2 n. 0,1 *[-2,-1] *. $5 +fi +if $8 +100%,100%,1,$s noise. 1,$3 b. $9 *. {(1-$10)/max(abs(im),abs(iM))} +100%,100%,1,1 noise. 1,$3 b. $9 *. {$10/max(abs(im),abs(iM))} ++[-2,-1] +ir[1] 86,169 b. $2 n. 0,1 *[-2,-1] *. $8 +fi +if $11 +100%,100%,1,$s noise. 1,$3 b. $12 *. {(1-$13)/max(abs(im),abs(iM))} +100%,100%,1,1 noise. 1,$3 b. $12 *. {$13/max(abs(im),abs(iM))} ++[-2,-1] +ir[1] 170,256 b. $2 n. 0,1 *[-2,-1] *. $11 +fi +rm[1] +[-3--1] n. -$1,$1 + c 0,255 +fx_grain_preview : +gui_split_preview "fx_grain $*",$-1 +fx_krita : +text="Krita helper:\n""Image size = "{w}x{h}x{d}x{s}"\n""Minimal value = "{im}"\n""Maximal value = "{iM}"\n""Average value = "{_round(ia,0.1)}"\n\n\n""* We love Krita! *" +n 0,255 drgba r 512,512,1,3 +to $text,3,3,5% +gui_layer_info : +repeat $! l[$<] nm={n} +animate b,0,10,$1 +=> $nm +done done +repeat $! l[$>] +0 t. "Layer indice: ""#"$>"\nLayer name: "${-gui_layer_name}"\nBlending mode: "${-gui_layer_mode}"\nOpacity : "${-gui_layer_opacity}"\nPosition: "${-gui_layer_pos},0,0,40,1,255 +to_rgba[0] expand_xy. 8,0 +dilate. 8 to_colormode[1] {0,s} j[0] [1],20,20,0,0,1,[2],255 +k[0] +done done +gui_layer_info_preview : +gui_layer_info $1 +gui_preview +fx_perspective_scale : +repeat $! l[$<] to_rgba +w={w} h={h} +f=100 repeat $1-1 f={$f*$2%} +r[0] $f%,$f%,1,4,2 done +repeat $!-1 l[{$>+1}] +sx={round(($>+1)*$w*$3%/($1-1))} +sy={round(($>+1)*$h*$4%/($1-1))} +r $w,$h,1,4,0,0,0.5,0.5 shift. $sx,$sy,0,0,0 +done done +if !$5 repeat $!-1 blend[0,1] alpha,1,1 done fi +done done +fx_perspective_scale_preview : +fx_perspective_scale ${1-4},0 +dt_segment_shaded : +repeat $! l[$>] +b $3 segment_watershed $1,1 ++g xy,1 a[-2,-1] c norm. !=. 0 distance[1] 1 normalize_local. 1000 +n. 0,1 ^. {max(1e-5,$2)} n. 0,255 +blend value +done done +samj_about : +Dim=1024 +rm +$Dim,$Dim,1,3 +samj_Marbre 1,1,8,5,0.1,10,0,1,0,0,255,0,3,1 +fx_cupid 100,0,0,0,0,255,1 +image[-2] [-1],0,0,0,0 +rm[-1] +expand_x {{$Dim-{w}}/2},0 ++samj_Marbre 1,1,8,5,0.1,10,0,1,255,255,0,0,3,1 +rv +blend alpha +to_rgb +text "Bonjour!",{{min(w,h)}/40},{{min(w,h)}/40},{{min(w,h)}/10},1,25,94,183,255 +samj_rien_arrays_and_tiles : +Je_passe_l_hiver_en_Floride[-1] +Annular_Steiner_Chain_Round_Tile: +Dimension_Finale=$1 +Supprimer_Calque_Origine=$2 +X={round({w*{$3/100}})} +Y={round({h*{$4/100}})} +Dimension_Image=$5 +Decalage_Angle_Images_Contour=$6 +Image_Contour_Dimension=$7 +Nb_Circles_Surrounding=$8 +Angle_inclinaison=$9 +Activer_Couleurs_Formes=$10 +R_Contours=$11 +V_Contours=$12 +B_Contours=$13 +A_Contours=$14 +Affichage_Contours=$15 +R_c=$16 +V_c=$17 +B_c=$18 +A_c=$19 +R_d=$20 +V_d=$21 +B_d=$22 +A_d=$23 +Couleurs_aleatoires=$24 +Largeur_Origine={w} +Hauteur_Origine={h} +Angle_Theta={pi/$Nb_Circles_Surrounding} +Rayon_Cercle_Exterieur_Final={$Dimension_Finale/2} +Rayon_Cercle_Centre_Final={{$Rayon_Cercle_Exterieur_Final*{1-{sin($Angle_Theta)}}}/{{1+{sin($Angle_Theta)}}}} +Rayon_Cercles_Ext_Final={{$Rayon_Cercle_Exterieur_Final-$Rayon_Cercle_Centre_Final}/2} +Rayon_Centres_C_Ext_Final={$Rayon_Cercle_Centre_Final+$Rayon_Cercles_Ext_Final} +Rayon_Tang_Final={{{$Rayon_Centres_C_Ext_Final*$Rayon_Centres_C_Ext_Final}-{$Rayon_Cercles_Ext_Final*$Rayon_Cercles_Ext_Final}}^0.5} +Fin_X={round({{w-$X}*$Dimension_Image/{100}})} +Fin_Y={round({{h-$Y}*$Dimension_Image/{100}})} +if $Fin_X>$Fin_Y +Rayon_Cercle_Centre_Origine={$Fin_Y/2} +else +Rayon_Cercle_Centre_Origine={$Fin_X/2} +fi +to_rgb[-1] +{$Rayon_Cercles_Ext_Final*2*$Image_Contour_Dimension/100},{$Rayon_Cercles_Ext_Final*2*$Image_Contour_Dimension/100},1,4 +fill_color[-1] 0,0,0,0 +circle[-1] 50%,50%,{w/2},1,0,0,0,255 ++Je_passe_l_hiver_en_Floride[0] +crop[-1] $X,$Y,{$X+{$Rayon_Cercle_Centre_Origine*2}},{$Y+{$Rayon_Cercle_Centre_Origine*2}} +resize2dy[-1] {$Rayon_Cercles_Ext_Final*2*$Image_Contour_Dimension/100} +samj_blend_20220419[-1,-2] alpha +{$Rayon_Cercle_Centre_Final*2},{$Rayon_Cercle_Centre_Final*2},1,4 +fill_color[-1] 0,0,0,0 +circle[-1] 50%,50%,{w/2},1,0,0,0,255 ++Je_passe_l_hiver_en_Floride[0] +crop[-1] $X,$Y,{$X+{$Rayon_Cercle_Centre_Origine*2}},{$Y+{$Rayon_Cercle_Centre_Origine*2}} +resize2dy[-1] {$Rayon_Cercle_Centre_Final*2} +samj_blend_20220419[-1,-2] alpha,1,1 +expand_xy[-1] {$Rayon_Cercle_Exterieur_Final-$Rayon_Cercle_Centre_Final},0 +Nb_boucles=0 +X_ext=0 +Y_ext=0 +Angle=0 +Dimension_Img_pivotee=0 +X_Deplacement=0 +Y_Deplacement=0 +repeat $Nb_Circles_Surrounding +Angle={$Nb_boucles*(360/$Nb_Circles_Surrounding)} +X_ext={$Rayon_Cercle_Exterieur_Final+($Rayon_Centres_C_Ext_Final*(cos((pi/180*($Angle+$Angle_inclinaison)))))} +Y_ext={$Rayon_Cercle_Exterieur_Final+($Rayon_Centres_C_Ext_Final*(sin((pi/180*($Angle+$Angle_inclinaison)))))} +Nb_boucles+=1 +if $Couleurs_aleatoires==1 +R_c={round(u)*255} +V_c={round(u)*255} +B_c={round(u)*255} +R_d={round(u)*255} +V_d={round(u)*255} +B_d={round(u)*255} +fi +if $Activer_Couleurs_Formes==1 +if ($Nb_Circles_Surrounding%2)==0 +if ($Nb_boucles%2)==0 +ellipse[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext_Final,$Rayon_Cercles_Ext_Final,0,1,$R_c,$V_c,$B_c,$A_c +else +ellipse[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext_Final,$Rayon_Cercles_Ext_Final,0,1,$R_d,$V_d,$B_d,$A_d +fi +else +ellipse[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext_Final,$Rayon_Cercles_Ext_Final,0,1,$R_c,$V_c,$B_c,$A_c +fi +if $Affichage_Contours>0 +ellipse[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext_Final,$Rayon_Cercles_Ext_Final,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +fi ++Je_passe_l_hiver_en_Floride[-2] +rotate[-1] {$Angle+$Decalage_Angle_Images_Contour} +crop[-1] {{w-{$Rayon_Cercles_Ext_Final*2}}/2},{{h-{$Rayon_Cercles_Ext_Final*2}}/2},{{{w-{$Rayon_Cercles_Ext_Final*2}}/2}+{$Rayon_Cercles_Ext_Final*2}},{{{h-{$Rayon_Cercles_Ext_Final*2}}/2}+{$Rayon_Cercles_Ext_Final*2}} +X_Deplacement={$X_ext-$Rayon_Cercles_Ext_Final} +Y_Deplacement={$Y_ext-$Rayon_Cercles_Ext_Final} +crop[-1] {-$X_Deplacement},{-$Y_Deplacement},{{2*$Rayon_Cercle_Exterieur_Final}-$X_Deplacement-1},{{2*$Rayon_Cercle_Exterieur_Final}-$Y_Deplacement-1},0 +samj_blend_20220419[-1,-2] alpha,1,1 +done +if $Activer_Couleurs_Formes==1 +if $Affichage_Contours==1||$Affichage_Contours==2||$Affichage_Contours==3||$Affichage_Contours==4||$Affichage_Contours==5 +ellipse[-1] 50%,50%,$Rayon_Cercle_Exterieur_Final,$Rayon_Cercle_Exterieur_Final,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Affichage_Contours==1||$Affichage_Contours==2||$Affichage_Contours==3||$Affichage_Contours==4||$Affichage_Contours==6 +ellipse[-1] 50%,50%,$Rayon_Cercle_Centre_Final,$Rayon_Cercle_Centre_Final,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Affichage_Contours==2||$Affichage_Contours==3 +ellipse[-1] 50%,50%,$Rayon_Centres_C_Ext_Final,$Rayon_Centres_C_Ext_Final,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Affichage_Contours==3||$Affichage_Contours==4 +ellipse[-1] 50%,50%,$Rayon_Tang_Final,$Rayon_Tang_Final,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +fi +rm[-2] +if $Supprimer_Calque_Origine==1 +rm[0] +else +rv[0,-1] +fi +samj_Bulles_Colorees : +Couleur_Limite_r=$1 +Couleur_Limite_v=$2 +Couleur_Limite_b=$3 +Couleur_Limite_a=$4 +Resolution=$5 +Variation_L=$6 +Variation_H=$7 +Grossissement_A=$8 +Grossissement_B=$9 +Angle_Validation=$10 +Angle_Variation=$11 +Rendu=$12 +Flou_Contours=$13 +Couleur_Fond_r=$14 +Couleur_Fond_v=$15 +Couleur_Fond_b=$16 +Couleur_Fond_a=$17 +Largeur_Origine={w} +Hauteur_Origine={h} +couleur_pixel=0 +rouge_pixel=0 +vert_pixel=0 +bleu_pixel=0 +alpha_pixel=$Couleur_Limite_a +Moyenne_couleur=0 +Coeff_bulle=0 +Angle_Origine=$Angle_Variation +KL=0 +KH=0 +Hauteur=$Resolution +Largeur=$Resolution +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] $Couleur_Fond_r,$Couleur_Fond_v,$Couleur_Fond_b,$Couleur_Fond_a +repeat $Largeur_Origine/($Resolution+$Resolution) +repeat $Hauteur_Origine/($Resolution+$Resolution) +couleur_pixel=${at_ancien[0]\ {$Largeur},{$Hauteur}} +rouge_pixel=${arg\ 1,$couleur_pixel} +vert_pixel=${arg\ 2,$couleur_pixel} +bleu_pixel=${arg\ 3,$couleur_pixel} +Moyenne_couleur={{$rouge_pixel+$vert_pixel+$bleu_pixel}/$Grossissement_A} +KL={$Grossissement_B+(($Moyenne_couleur+$Variation_L)/512)} +KH={$Grossissement_B+(($Moyenne_couleur+$Variation_H)/512)} +if $Angle_Validation==0 +Angle_Variation=$Angle_Origine +else +Angle_Variation={$Angle_Origine+(($rouge_pixel+$vert_pixel+$bleu_pixel)/(255*3)*180)} +fi +if $Rendu==0 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +ellipse[-1] $Largeur,$Hauteur,{$Resolution*$KL},{$Resolution*$KH},$Angle_Variation,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +elif $Rendu==1 +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +ellipse[-1] $Largeur,$Hauteur,{$Resolution*$KL},{$Resolution*$KH},$Angle_Variation,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +elif $Rendu==2 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +ellipse[-1] $Largeur,$Hauteur,{$Resolution*$KL},{$Resolution*$KH},$Angle_Variation,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +ellipse[-1] $Largeur,$Hauteur,{$Resolution*$KL},{$Resolution*$KH},$Angle_Variation,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +fi +Hauteur+=$Resolution+$Resolution +done +Largeur+=$Resolution+$Resolution +Hauteur=$Resolution +done +rm[0] +if $Flou_Contours>0 blur[-1] $Flou_Contours,0 fi +samj_Carres_Noirs : +Limite=$1 +Resolution_Largeur=$2 +Trait_Largeur=$3 +Dilatation=$4 +R_a=$5 +V_a=$6 +B_a=$7 +A_a=$8 +Flou=$9 +R_b=$10 +V_b=$11 +B_b=$12 +A_b=$13 +VA=$14 +R_c=$15 +V_c=$16 +B_c=$17 +A_c=$18 +Ajout_Isophotes=$19 +Flou_Isophotes=$20 +Ajout_Couleur=$21 +Largeur={w} +Hauteur={h} +to_rgba[-1] +if $Ajout_Isophotes==1 ++Je_passe_l_hiver_en_Floride[-1] +fi +luminance[-1] +to_rgba[-1] +n[-1] 0,255 +c[-1] 0,$Limite +n[-1] 0,255 +c[-1] {255-$Limite},255 +n[-1] 0,255 ++Je_passe_l_hiver_en_Floride[-1] +samj_Lignes_Epaisseur_Variable[-1] 0,$Resolution_Largeur,$Trait_Largeur,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0.5,0.5,1.8,0,0 +samj_Lignes_Epaisseur_Variable[-2] 1,$Resolution_Largeur,$Trait_Largeur,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0.5,0.5,1.8,0,0 +samj_blend_20220419[-1,-2] alpha +if $Dilatation>0 +dilate[-1] $Dilatation +fi +resize[-1] $Largeur,$Hauteur +to_rgba[-1] ++Je_passe_l_hiver_en_Floride[-1] +replace_color[-1] 0%,0,0,0,0,255,$R_b,$V_b,$B_b,$A_b +blur[-1] $Flou +shift[-1] $VA,$VA,0,0,0 +crop[-1] 0,0,{w-1},{h-1} +replace_color[-2] 0%,0,0,0,0,255,$R_a,$V_a,$B_a,$A_a +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +{w},{h},1,4 +fill_color[-1] $R_c,$V_c,$B_c,$A_c +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +if $Ajout_Isophotes==1 +blur[-2] $Flou_Isophotes +isophotes[-2] 8 +n[-2] 0,255 +if $Ajout_Couleur==0 +to_graya[-2] +fi +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +fi +Cercles_Concentriques_A: +Dimension_Finale=$1 +Supprimer_Calque_Origine=$2 +Nb_Circles={$3+1} +Type_Variation_Dimensions_Cercles=$4 +Angle_Variation_Origine=$5 +Angle_Variation_Fin=$6 +Coef_Variation=$7 +Sens_Rotation_Horaire=$8 +Decalage_Cercles={$9-50} +Conserver_Exterieur_Cercles=$10 +Activer_Rayons_De_Couleurs=$11 +R_Contours=$12 +V_Contours=$13 +B_Contours=$14 +A_Contours=$15 +Affichage_Contours=$16 +Dilate_Contours=$17 +Flou_Contours=$18 +Sharpen_Contours=$19 +Repetition_Couleurs=$20 +Angle_Decalage_Couleurs=$21 +R_a=$22 +V_a=$23 +B_a=$24 +A_a=$25 +R_b=$26 +V_b=$27 +B_b=$28 +A_b=$29 +R_c=$30 +V_c=$31 +B_c=$32 +A_c=$33 +R_d=$34 +V_d=$35 +B_d=$36 +A_d=$37 +R_e=$38 +V_e=$39 +B_e=$40 +A_e=$41 +Couleurs_aleatoires=$42 +Melange_Couleurs_Contours=$43 +Filtre_Symmetrizoscope=$44 +Iterations_Symmetrizoscope=$45 +Angle_Symmetrizoscope=$46 +Symmetry_Sides=$47 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_boucles=0 +Rayon_Cercle_Final={round({{$Dimension_Finale/2}-1})} +Rayon_Cercle_En_Cours=0 +Rayon_Cercle_Precedent=0 +Rayon_Dernier_Cercle=0 +Rayon_De_Couleur={round({1+{$Dimension_Finale*{2^0.5}}})} +Decrement_Rayon=0 +Angle_Rayon_De_Couleur={72/$Repetition_Couleurs} +Angle_Rayon_De_Couleur_En_Cours=0 +Angle_Rayon_De_Couleur_En_Cours_Fin=0 +Nb_De_Rayon_De_Couleur=0 +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,0 +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,0 +if $Activer_Rayons_De_Couleurs==0 ++Je_passe_l_hiver_en_Floride[0] +if $Largeur_Origine>$Hauteur_Origine +crop[-1] {{$Largeur_Origine-$Hauteur_Origine}/2},0,{{{$Largeur_Origine-$Hauteur_Origine}/2}+$Hauteur_Origine-1},$Hauteur_Origine +elif $Largeur_Origine<$Hauteur_Origine +crop[-1] 0,{{$Hauteur_Origine-$Largeur_Origine}/2},$Largeur_Origine,{{{$Hauteur_Origine-$Largeur_Origine}/2}+$Largeur_Origine-1} +fi +resize[-1] $Dimension_Finale,$Dimension_Finale +to_rgba[-1] +fi +if $Activer_Rayons_De_Couleurs==1 +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,255 +fi +if $Sens_Rotation_Horaire==1 +Angle_Decalage_Couleurs_En_Cours={$Angle_Decalage_Couleurs_En_Cours+{$Angle_Decalage_Couleurs+{$Angle_Rayon_De_Couleur/2}}} +else +Angle_Decalage_Couleurs_En_Cours={{$Angle_Decalage_Couleurs_En_Cours+{$Angle_Decalage_Couleurs+{$Angle_Rayon_De_Couleur/2}}}+{$Angle_Rayon_De_Couleur/2}} +fi +repeat $Repetition_Couleurs +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +R_b={round(u)*255} +V_b={round(u)*255} +B_b={round(u)*255} +R_c={round(u)*255} +V_c={round(u)*255} +B_c={round(u)*255} +R_d={round(u)*255} +V_d={round(u)*255} +B_d={round(u)*255} +R_e={round(u)*255} +V_e={round(u)*255} +B_e={round(u)*255} +fi +Nb_De_Rayon_De_Couleur={$Nb_De_Rayon_De_Couleur+1} +Angle_Rayon_De_Couleur_En_Cours={{$Angle_Rayon_De_Couleur*$Nb_De_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_En_Cours} +Angle_Rayon_De_Couleur_En_Cours_Fin={$Angle_Rayon_De_Couleur+{$Angle_Rayon_De_Couleur*$Nb_De_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_En_Cours} +if $Activer_Rayons_De_Couleurs==1 +polygon[-1] 3,50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin})}}},1,$R_a,$V_a,$B_a,$A_a +fi +if $Affichage_Contours==1||$Affichage_Contours==2 +line[-2] 50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},1,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +Nb_De_Rayon_De_Couleur={$Nb_De_Rayon_De_Couleur+1} +Angle_Rayon_De_Couleur_En_Cours={{$Angle_Rayon_De_Couleur*$Nb_De_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_En_Cours} +Angle_Rayon_De_Couleur_En_Cours_Fin={$Angle_Rayon_De_Couleur+{$Angle_Rayon_De_Couleur*$Nb_De_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_En_Cours} +if $Activer_Rayons_De_Couleurs==1 +polygon[-1] 3,50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin})}}},1,$R_b,$V_b,$B_b,$A_b +fi +if $Affichage_Contours==1||$Affichage_Contours==2 +line[-2] 50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},1,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +Nb_De_Rayon_De_Couleur={$Nb_De_Rayon_De_Couleur+1} +Angle_Rayon_De_Couleur_En_Cours={{$Angle_Rayon_De_Couleur*$Nb_De_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_En_Cours} +Angle_Rayon_De_Couleur_En_Cours_Fin={$Angle_Rayon_De_Couleur+{$Angle_Rayon_De_Couleur*$Nb_De_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_En_Cours} +if $Activer_Rayons_De_Couleurs==1 +polygon[-1] 3,50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin})}}},1,$R_c,$V_c,$B_c,$A_c +fi +if $Affichage_Contours==1||$Affichage_Contours==2 +line[-2] 50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},1,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +Nb_De_Rayon_De_Couleur={$Nb_De_Rayon_De_Couleur+1} +Angle_Rayon_De_Couleur_En_Cours={{$Angle_Rayon_De_Couleur*$Nb_De_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_En_Cours} +Angle_Rayon_De_Couleur_En_Cours_Fin={$Angle_Rayon_De_Couleur+{$Angle_Rayon_De_Couleur*$Nb_De_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_En_Cours} +if $Activer_Rayons_De_Couleurs==1 +polygon[-1] 3,50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin})}}},1,$R_d,$V_d,$B_d,$A_d +fi +if $Affichage_Contours==1||$Affichage_Contours==2 +line[-2] 50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},1,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +Nb_De_Rayon_De_Couleur={$Nb_De_Rayon_De_Couleur+1} +Angle_Rayon_De_Couleur_En_Cours={{$Angle_Rayon_De_Couleur*$Nb_De_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_En_Cours} +Angle_Rayon_De_Couleur_En_Cours_Fin={$Angle_Rayon_De_Couleur+{$Angle_Rayon_De_Couleur*$Nb_De_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_En_Cours} +if $Activer_Rayons_De_Couleurs==1 +polygon[-1] 3,50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin})}}},1,$R_e,$V_e,$B_e,$A_e +fi +if $Affichage_Contours==1||$Affichage_Contours==2 +line[-2] 50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*$Angle_Rayon_De_Couleur_En_Cours})}}},1,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +done +Rayon_Cercle_En_Cours=$Rayon_Cercle_Final +Rayon_Cercle_Precedent=$Rayon_Cercle_Final +Nb_boucles=0 +repeat $Nb_Circles +if $Type_Variation_Dimensions_Cercles==0 +if $Nb_Circles-$Nb_boucles>1 +Decrement_Rayon={abs({{{$Rayon_Cercle_Precedent*{cos({pi/180*{$Angle_Variation_Fin}})}}-{$Rayon_Cercle_Precedent*{cos({pi/180*{$Angle_Variation_Origine}})}}}/$Nb_Circles})} +else +Decrement_Rayon={$Rayon_Cercle_Final-$Rayon_Cercle_En_Cours} +fi +elif $Type_Variation_Dimensions_Cercles==1 +if $Nb_Circles-$Nb_boucles>1 +Decrement_Rayon={abs({{{$Rayon_Cercle_Precedent*{-1+{cos({pi/180*{$Angle_Variation_Fin}})}}}-{$Rayon_Cercle_Precedent*{1+{cos({pi/180*{$Angle_Variation_Origine}})}}}}/$Nb_Circles})} +else +Decrement_Rayon={$Rayon_Cercle_Final-$Rayon_Cercle_En_Cours} +fi +elif $Type_Variation_Dimensions_Cercles==2 +Decrement_Rayon={abs({{{$Rayon_Cercle_Final*{1+{cos({pi/180*{$Angle_Variation_Fin}})}}}-{$Rayon_Cercle_Final*{1+{cos({pi/180*{$Angle_Variation_Origine}})}}}}/$Nb_Circles})} +fi +if $Sens_Rotation_Horaire==1 +Angle_Decalage_Couleurs_En_Cours={{$Decalage_Cercles*$Angle_Rayon_De_Couleur/100}+$Angle_Decalage_Couleurs_En_Cours+{$Angle_Decalage_Couleurs+{$Angle_Rayon_De_Couleur/2}}} +else +Angle_Decalage_Couleurs_En_Cours={{$Decalage_Cercles*$Angle_Rayon_De_Couleur/100*-1}+$Angle_Decalage_Couleurs_En_Cours-{$Angle_Decalage_Couleurs+{$Angle_Rayon_De_Couleur/2}}} +fi +if $Coef_Variation>0 +Rayon_Cercle_En_Cours={$Rayon_Cercle_En_Cours-{$Decrement_Rayon*$Coef_Variation}} +else +Rayon_Cercle_En_Cours={$Rayon_Cercle_En_Cours-{$Decrement_Rayon*{abs($Coef_Variation)}/{$Nb_boucles+1}}} +fi ++Je_passe_l_hiver_en_Floride[-1] +rotate[-1] {$Angle_Decalage_Couleurs_En_Cours} +crop[-1] {{w-$Dimension_Finale}/2},{{h-$Dimension_Finale}/2},{{{w-$Dimension_Finale}/2}+$Dimension_Finale-1},{{{h-$Dimension_Finale}/2}+$Dimension_Finale-1} +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,255 +circle[-1] 50%,50%,$Rayon_Cercle_Precedent,1,255,0,0,255 +circle[-1] 50%,50%,$Rayon_Cercle_En_Cours,1,0,0,0,255 +replace_color[-1] 0%,0,255,0,0,255,0,0,0,0 +samj_blend_20220419[-1,-2] alpha,1,1 +replace_color[-1] 0%,0,0,0,0,255,0,0,0,0 +samj_blend_20220419[-1,-2] alpha,1,1 +if $Affichage_Contours>0 +rv[-1,-2] +$Dimension_Finale,$Dimension_Finale,1,4 ++Je_passe_l_hiver_en_Floride[-2] +rotate[-1] $Angle_Decalage_Couleurs_En_Cours +crop[-1] {{w-$Dimension_Finale}/2},{{h-$Dimension_Finale}/2},{{{w-$Dimension_Finale}/2}+$Dimension_Finale-1},{{{h-$Dimension_Finale}/2}+$Dimension_Finale-1} +circle[-1] 50%,50%,$Rayon_Cercle_En_Cours,1,0,0,0,0 +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,255 +circle[-1] 50%,50%,$Rayon_Cercle_Precedent,1,0,0,0,0 +samj_blend_20220419[-1,-2] alpha,1,1 +replace_color[-1] 0%,0,0,0,0,255,0,0,0,0 +samj_blend_20220419[-1,-2] alpha,1,1 +if $Affichage_Contours==1||$Affichage_Contours==3 +ellipse[-1] 50%,50%,$Rayon_Cercle_En_Cours,$Rayon_Cercle_En_Cours,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +samj_blend_20220419[-1,-4] alpha,1,0 +rv[-1,-2] +fi +Rayon_Dernier_Cercle=$Rayon_Cercle_Precedent +Rayon_Cercle_Precedent=$Rayon_Cercle_En_Cours +Nb_boucles={$Nb_boucles+1} +done +rm[-2] +if $Affichage_Contours==1||$Affichage_Contours==3 +ellipse[-2] 50%,50%,$Rayon_Cercle_Final,$Rayon_Cercle_Final,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Dilate_Contours>1 dilate_circ[-2] $Dilate_Contours fi +if $Flou_Contours>0 blur[-2] $Flou_Contours,0 fi +if $Sharpen_Contours>0 sharpen[-2] $Sharpen_Contours fi +if $Filtre_Symmetrizoscope==1 +fx_symmetrizoscope[-1,-2] $Iterations_Symmetrizoscope,$Angle_Symmetrizoscope,0,$Symmetry_Sides +Conserver_Exterieur_Cercles=0 +fi +if $Conserver_Exterieur_Cercles==0 +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 255,0,0,255 +circle[-1] 50%,50%,$Rayon_Cercle_Final,1,0,0,0,255 +replace_color[-1] 0%,0,255,0,0,255,0,0,0,0 +rv[-1,-2] +samj_blend_20220419[-2,-1] add,1,0 +fi +if $Supprimer_Calque_Origine==1 +rm[0] +if $Melange_Couleurs_Contours==1 +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha,1,0 +else +rv[-1,-2] +fi +else +if $Melange_Couleurs_Contours==1 +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha,1,0 +rv[-1,-2] +else +rv[-1,-2,-3] +fi +fi +samj_Coeurs_Hearts_002 : +Resolution=$1 +Remplissage=$2 +Angle_Rotation_Motif=$3 +flou=$4 +Coeurs_Hearts=$5 +Interpolation=$6 +R_Couleur=$7 +V_Couleur=$8 +B_Couleur=$9 +A_Couleur=$10 +Gris=$11 +Boost=$12 +Type_Avant_Plan=$13 +Mode_blend=$14 +Opacity_blend=$15 +if $Type_Avant_Plan==1 ++Je_passe_l_hiver_en_Floride[-1] +to_rgb[-2] +negate[-2] +fi +to_rgb[-1] +negate[-1] +if $Interpolation==0 +resize[-1] {w/$Resolution},{h/$Resolution} +c[-1] 0,255 +elif $Interpolation==1 +resize[-1] {w/$Resolution},{h/$Resolution},1,3,3 +c[-1] 0,255 +elif $Interpolation==2 +resize[-1] {w/$Resolution},{h/$Resolution} +n[-1] 0,255 +elif $Interpolation==3 +resize[-1] {w/$Resolution},{h/$Resolution},1,3,3 +n[-1] 0,255 +fi +if $Type_Avant_Plan==1 +resize[-2] {w*$Resolution},{h*$Resolution} +rm[-1] +else +resize[-1] {w*$Resolution},{h*$Resolution} +fi +if $Gris==1 +to_gray[-1] +fi +c[-1] 0,255 +if $Boost==1 +balance_gamma[-1] 128,128,128,1 +n[-1] 0,255 +fi +negate[-1] +to_rgba[-1] +$Resolution,$Resolution,1,4 +fill_color[-1] 0,0,0,0 +if $Coeurs_Hearts==1 +(0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0;0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0;0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0;1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0;0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0;0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0;0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0;0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0;0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0;0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0;0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0;0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0;0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0) +else +(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0;1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0;1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0;1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0;1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0;1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0;1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0;1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0;0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1;0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1;0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1;0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1) +fi +if $Angle_Rotation_Motif>0 +rotate[-1] $Angle_Rotation_Motif,0,0 +autocrop[-1] 0 +fi +resize[-1] {$Resolution*$Remplissage/100},{$Resolution*$Remplissage/100} +samj_blend_20220419[-1,-2] alpha +resize[-1] [-2],[-2],1,1,0,2 +to_rgba[-1] +replace_color[-1] 0%,0,0,0,0,255,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +replace_color[-1] 0%,0,1,1,1,255,0,0,0,0 +gimp_blend_1651[-2,-1] $Mode_blend,2,$Opacity_blend,0 +if $flou>0 +blur[-1] $flou,0 +fi +samj_rien_atistic : +Je_passe_l_hiver_en_Floride[-1] +samj_Tiles_Deconstruction : +Hauteur={h} +Largeur={w} +if $1>$Hauteur||$1>$Largeur Tuiles={min($Largeur,$Hauteur)} else Tuiles=$1 fi +rotate 90 +mirror x +resize {round($Largeur/$Tuiles)*$Tuiles},{round($Hauteur/$Tuiles)*$Tuiles} +split y,$Tuiles +split x,$Tuiles +append y +append x +split y,$Tuiles +append x +resize $Largeur,$Hauteur +if $2>0 to_rgba fi +if $2==1||$2==2 +IncX={w/$Tuiles} +Xorg=0 +Yorg=0 +Xfin=0 +Yfin={h} +repeat $1 +line $Xorg,$Yorg,$Xfin,$Yfin,1,$3,$4,$5,$6 +Xorg+=$IncX +Xfin+=$IncX +done +fi +if $2==1||$2==3 +IncY={h/$Tuiles} +Xorg=0 +Yorg=0 +Xfin={w} +Yfin=0 +repeat $1 +line $Xorg,$Yorg,$Xfin,$Yfin,1,$3,$4,$5,$6 +Yorg+=$IncY +Yfin+=$IncY +done +fi +samj_Ellipses_Colorees : +Couleur_Limite_r=$1 +Couleur_Limite_v=$2 +Couleur_Limite_b=$3 +Couleur_Limite_a=$4 +Rayon_L=$5 +Rayon_H=$6 +Rendu=$7 +Flou_Contours=$8 +Couleur_Fond_r=$9 +Couleur_Fond_v=$10 +Couleur_Fond_b=$11 +Couleur_Fond_a=$12 +Largeur_Origine={w} +Hauteur_Origine={h} +couleur_pixel=0 +rouge_pixel=0 +vert_pixel=0 +bleu_pixel=0 +alpha_pixel=$Couleur_Limite_a +Hauteur=$Rayon_H +Largeur=$Rayon_L +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] $Couleur_Fond_r,$Couleur_Fond_v,$Couleur_Fond_b,$Couleur_Fond_a +repeat $Largeur_Origine/($Rayon_L+$Rayon_L) +repeat $Hauteur_Origine/($Rayon_H+$Rayon_H) +couleur_pixel=${at_ancien[0]\ {$Largeur},{$Hauteur}} +rouge_pixel=${arg\ 1,$couleur_pixel} +vert_pixel=${arg\ 2,$couleur_pixel} +bleu_pixel=${arg\ 3,$couleur_pixel} +if $Rendu==0 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +ellipse[-1] $Largeur,$Hauteur,$Rayon_L,$Rayon_H,0,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +elif $Rendu==1 +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +ellipse[-1] $Largeur,$Hauteur,$Rayon_L,$Rayon_H,0,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +elif $Rendu==2 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +ellipse[-1] $Largeur,$Hauteur,$Rayon_L,$Rayon_H,0,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +ellipse[-1] $Largeur,$Hauteur,$Rayon_L,$Rayon_H,0,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +fi +Hauteur+=$Rayon_H+$Rayon_H +done +Largeur+=$Rayon_L+$Rayon_L +Hauteur=$Rayon_H +done +rm[0] +if $Flou_Contours>0 blur[-1] $Flou_Contours,0 fi +samj_Filtres_Sur_Tuiles : +foreach { +Haut={h} +Larg={w} +if $1>{min($Larg,$Haut)/4} Decoup={round(min($Larg,$Haut)/4)} else Decoup=$1 fi +resize {round($Larg/$Decoup)*$Decoup},{round($Haut/$Decoup)*$Decoup} +split y,$Decoup +split x,$Decoup +to_rgba +$3 +append x +split x,$Decoup +append y +resize $Larg,$Haut +if $2==1 $4 fi +} +samj_Filtres_Sur_Tuiles_V2 : +foreach { +to_a +Larg={w} +Haut={h} +img2patches $1,$4%,$6 +foreach { $3 } +patches2img $Larg,$Haut,$4%,$5% +if $2==1 $7 fi +} +samj_Flouter : +blur $1 +sharpen $2 +if $3>0 autoindex {$3+1} fi +{w},{h},1,3 +fill_color[-1] 255,255,255 +imagegrid[-1] $4,$4 +negate[-1] +to_rgba +replace_color[-1] 1,0,255,255,255,255,0,0,0,0 +blend alpha +replace_color 0,0,0,0,0,255,0,0,0,0 +if $5==0 dilate {$6+$4} else dilate_circ {{$6+$4}*1.5} fi +if $7==1 n 0,255 fi +to_rgb +samj_Losanges_Colores : +Couleur_Limite_r=$1 +Couleur_Limite_v=$2 +Couleur_Limite_b=$3 +Couleur_Limite_a=$4 +Resolution=$5 +Inclinaison_Quadrilataire=$6 +Variation_L=$7 +Variation_H=$8 +Grossissement_A=$9 +Grossissement_B=$10 +Dimension_Variation=$11 +Rendu=$12 +Flou_Contours=$13 +Couleur_Fond_r=$14 +Couleur_Fond_v=$15 +Couleur_Fond_b=$16 +Couleur_Fond_a=$17 +Contours_Polygones=$18 +Largeur_Origine={w} +Hauteur_Origine={h} +couleur_pixel=0 +rouge_pixel=0 +vert_pixel=0 +bleu_pixel=0 +alpha_pixel=$Couleur_Limite_a +Moyenne_couleur=0 +Coeff_bulle=0 +Dimension_Origine={$Dimension_Variation*$Resolution} +KL=0 +KH=0 +Hauteur=$Resolution +Largeur=$Resolution +X_a=0 +Y_a=0 +X_b=0 +Y_b=0 +X_c=0 +Y_c=0 +X_d=0 +Y_d=0 +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] $Couleur_Fond_r,$Couleur_Fond_v,$Couleur_Fond_b,$Couleur_Fond_a +repeat $Largeur_Origine/($Resolution+$Resolution) +repeat $Hauteur_Origine/($Resolution+$Resolution) +couleur_pixel=${at_ancien[0]\ {$Largeur},{$Hauteur}} +rouge_pixel=${arg\ 1,$couleur_pixel} +vert_pixel=${arg\ 2,$couleur_pixel} +bleu_pixel=${arg\ 3,$couleur_pixel} +Moyenne_couleur={{$rouge_pixel+$vert_pixel+$bleu_pixel}/$Grossissement_A} +KL={$Grossissement_B+(($Moyenne_couleur+$Variation_L)/512)} +KH={$Grossissement_B+(($Moyenne_couleur+$Variation_H)/512)} +Dimension_Variation={$Dimension_Origine*(1+(($rouge_pixel+$vert_pixel+$bleu_pixel)/(255*3)))} +if $Inclinaison_Quadrilataire==0 +X_a={$Largeur-($Dimension_Variation*$KL)} +Y_a=$Hauteur +X_b=$Largeur +Y_b={$Hauteur+($Dimension_Variation*$KH)} +X_c={$Largeur+($Dimension_Variation*$KL)} +Y_c=$Hauteur +X_d=$Largeur +Y_d={$Hauteur-($Dimension_Variation*$KH)} +else +X_a={$Largeur-($Dimension_Variation*$KL)} +Y_a={$Hauteur+($Dimension_Variation*$KH)} +X_b={$Largeur+($Dimension_Variation*$KL)} +Y_b={$Hauteur+($Dimension_Variation*$KH)} +X_c={$Largeur+($Dimension_Variation*$KL)} +Y_c={$Hauteur-($Dimension_Variation*$KH)} +X_d={$Largeur-($Dimension_Variation*$KL)} +Y_d={$Hauteur-($Dimension_Variation*$KH)} +fi +if $Rendu==0 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +elif $Rendu==1 +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +elif $Rendu==2 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +fi +if $Contours_Polygones==1 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,0xFFFFFFFF,$Couleur_Fond_r,$Couleur_Fond_v,$Couleur_Fond_b,$Couleur_Fond_a +elif $Contours_Polygones==2 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,0xFFFFFFFF,255,255,255,$alpha_pixel +elif $Contours_Polygones==3 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,0xFFFFFFFF,{{$rouge_pixel+$vert_pixel+$bleu_pixel}/3},{{$rouge_pixel+$vert_pixel+$bleu_pixel}/3},{{$rouge_pixel+$vert_pixel+$bleu_pixel}/3},$alpha_pixel +elif $Contours_Polygones==4 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,0xFFFFFFFF,{$rouge_pixel*0.5},{$vert_pixel*0.5},{$bleu_pixel*0.5},$alpha_pixel +fi +Hauteur+=$Resolution+$Resolution +done +Largeur+=$Resolution+$Resolution +Hauteur=$Resolution +done +rm[0] +if $Flou_Contours>0 blur[-1] $Flou_Contours,0 fi +samj_Moirage_Spline : +Couleur_Ar=$1 +Couleur_Av=$2 +Couleur_Ab=$3 +Couleur_Aa=$4 +Resolution_A=$5 +Decalage_A=$6 +Spline_A_u0=$7 +Spline_A_v0=$8 +Spline_A_u1=$9 +Spline_A_v1=$10 +Orientation_A=$11 +Dilate_A={round($12/100*$Resolution_A)} +Couleur_Br=$13 +Couleur_Bv=$14 +Couleur_Bb=$15 +Couleur_Ba=$16 +Resolution_B=$17 +Decalage_B=$18 +Spline_B_u0=$19 +Spline_B_v0=$20 +Spline_B_u1=$21 +Spline_B_v1=$22 +Orientation_B=$23 +Dilate_B={round($24/100*$Resolution_B)} +Largeur_Origine={w} +Hauteur_Origine={h} +Nouvelle_Dimension={round({{{{$Largeur_Origine^2}+{$Hauteur_Origine^2}}^0.5}+1})} +Nouvelle_Dimension+=max(abs($Nouvelle_Dimension/100*$Spline_A_u0),abs($Nouvelle_Dimension/100*$Spline_B_u0))+max(abs($Nouvelle_Dimension/100*$Spline_A_u1),abs($Nouvelle_Dimension/100*$Spline_B_u1)) +XA_origine={round($Resolution_A/100*$Decalage_A)} +YA_origine=0 +XA_fin=$XA_origine +YA_fin=$Nouvelle_Dimension +XB_origine=0 +YB_origine={round($Resolution_B/100*$Decalage_B)} +XB_fin=$Nouvelle_Dimension +YB_fin=$XB_origine +$Nouvelle_Dimension,$Nouvelle_Dimension,1,4 +repeat $Nouvelle_Dimension/$Resolution_A +spline[-1] $XA_origine,$YA_origine,{$Nouvelle_Dimension/100*$Spline_A_u0},{$Nouvelle_Dimension/100*$Spline_A_v0},$XA_fin,$YA_fin,{$Nouvelle_Dimension/100*$Spline_A_u1},{$Nouvelle_Dimension/100*$Spline_A_v1},1,$Couleur_Ar,$Couleur_Av,$Couleur_Ab,$Couleur_Aa +XA_origine+=$Resolution_A +YA_origine=0 +XA_fin=$XA_origine +YA_fin=$Nouvelle_Dimension +done +if $Orientation_A>0 rotate[-1] {$Orientation_A} fi +crop[-1] {{w-$Largeur_Origine}/2},{{h-$Hauteur_Origine}/2},{{{w-$Largeur_Origine}/2}+$Largeur_Origine-1},{{{h-$Hauteur_Origine}/2}+$Hauteur_Origine-1} +if $Dilate_A>1 dilate_circ[-1] $Dilate_A fi +$Nouvelle_Dimension,$Nouvelle_Dimension,1,4 +repeat $Nouvelle_Dimension/$Resolution_B +spline[-1] $XB_origine,$YB_origine,{$Nouvelle_Dimension/100*$Spline_B_u0},{$Nouvelle_Dimension/100*$Spline_B_v0},$XB_fin,$YB_fin,{$Nouvelle_Dimension/100*$Spline_B_u1},{$Nouvelle_Dimension/100*$Spline_B_v1},1,$Couleur_Br,$Couleur_Bv,$Couleur_Bb,$Couleur_Ba +XB_origine=0 +YB_origine+=$Resolution_B +XB_fin=$Nouvelle_Dimension +YB_fin=$YB_origine +done +if $Orientation_B>0 rotate[-1] {$Orientation_B} fi +crop[-1] {{w-$Largeur_Origine}/2},{{h-$Hauteur_Origine}/2},{{{w-$Largeur_Origine}/2}+$Largeur_Origine-1},{{{h-$Hauteur_Origine}/2}+$Hauteur_Origine-1} +if $Dilate_B>1 dilate_circ[-1] $Dilate_B fi +samj_blend_20220419[-1,-2] alpha,1,1 +rv[-1,-2] +samj_Moirage_Spline_XY : +Couleur_Ar=$1 +Couleur_Av=$2 +Couleur_Ab=$3 +Couleur_Aa=$4 +Resolution_A=$5 +Decalage_A=$6 +Spline_A_u0=$7 +Spline_A_v0=$8 +Spline_A_u1=$9 +Spline_A_v1=$10 +Dilate_A={round($11/100*$Resolution_A)} +Couleur_Br=$12 +Couleur_Bv=$13 +Couleur_Bb=$14 +Couleur_Ba=$15 +Resolution_B=$16 +Decalage_B=$17 +Spline_B_u0=$18 +Spline_B_v0=$19 +Spline_B_u1=$20 +Spline_B_v1=$21 +Dilate_B={round($22/100*$Resolution_B)} +Choix_Calques_Visibles=$23 +Largeur_Origine={w} +Hauteur_Origine={h} +XA_origine={round({{$Resolution_A/100*$Decalage_A}-{$Largeur_Origine/2}})} +YA_origine=0 +XA_fin={round({{$Resolution_A/100*$Decalage_A}+{$Largeur_Origine*1.5}})} +YA_fin=$Hauteur_Origine +Iterations_A={round({{{abs($XA_origine)}+$XA_fin}/$Resolution_A})} +XB_origine=0 +YB_origine={round({{$Resolution_B/100*$Decalage_B}-{$Hauteur_Origine/2}})} +XB_fin=$Largeur_Origine +YB_fin={round({{$Resolution_B/100*$Decalage_B}+{$Hauteur_Origine*1.5}})} +Iterations_B={round({{{abs($YB_origine)}+$YB_fin}/$Resolution_B})} +if $Choix_Calques_Visibles==0||$Choix_Calques_Visibles==1 +$Largeur_Origine,$Hauteur_Origine,1,4 +repeat $Iterations_A +XA_origine+=$Resolution_A +XA_fin=$XA_origine +spline[-1] $XA_origine,$YA_origine,{$Largeur_Origine/100*$Spline_A_u0},{$Largeur_Origine/100*$Spline_A_v0},$XA_fin,$YA_fin,{$Largeur_Origine/100*$Spline_A_u1},{$Largeur_Origine/100*$Spline_A_v1},1,$Couleur_Ar,$Couleur_Av,$Couleur_Ab,$Couleur_Aa +done +if $Dilate_A>1 dilate_circ[-1] $Dilate_A fi +fi +if $Choix_Calques_Visibles==0||$Choix_Calques_Visibles==2 +$Largeur_Origine,$Hauteur_Origine,1,4 +repeat $Iterations_B +YB_origine+=$Resolution_B +YB_fin=$YB_origine +spline[-1] $XB_origine,$YB_origine,{$Hauteur_Origine/100*$Spline_B_u0},{$Hauteur_Origine/100*$Spline_B_v0},$XB_fin,$YB_fin,{$Hauteur_Origine/100*$Spline_B_u1},{$Hauteur_Origine/100*$Spline_B_v1},1,$Couleur_Br,$Couleur_Bv,$Couleur_Bb,$Couleur_Ba +done +if $Dilate_B>1 dilate_circ[-1] $Dilate_B fi +fi +if $Choix_Calques_Visibles==0 +samj_blend_20220419[-1,-2] alpha,1,1 +fi +rv[-1,-2] +samj_dt_montage_sur_une_page : +W,H=$1,$2 +Grille={round($!^0.5)} +if {$!^0.5}>$Grille Grille+=1 fi +Grille+=$5 +if $Grille<2 Grille=2 fi +Fra=$3 +Frb=$4 +taille={{$W-{{$Fra+$Frb}*2*$Grille}}/$Grille} +r2dx $taille to_rgb frame $Fra,$Fra,255 frame $Frb,$Frb,0 +ind,go_on=0,1 +for $ind<$! +indx,x=$ind,0 +for $go_on" && "$x+w#$ind<$W { +indy,y=$ind,0 +for $y+h#$ind<$H { y,ind+=h#$ind,1 if $ind>=$! go_on=0 break fi } +a[$indy-{$ind-1}] y +ind:=$indy+1 +x+=w#$indy +} +a[$indx-{$ind-1}] x,0.5 +ind:=$indx+1 +} +r $W,$H,1,100%,0,0,0.5,0.5 +samj_Montage_Annular_Steiner_Chain: +Dimension_Finale=$1 +Nb_Circles_Surrounding=$2 +InvSelect=$3 +Rf=$4 +Vf=$5 +Bf=$6 +Af=$7 +varx=$8 +vary=$9 +Dimension_Image={101-$10} +Shift_X=$11 +Shift_Y=$12 +Decalage_Angle_Images_Contour=$13 +RotAng=$14 +Image_Contour_Dimension=$15 +Angle_inclinaison=$16 +Agr=$17 +Shift_Xe=$18 +Shift_Ye=$19 +if $InvSelect==1 rv fi +NbImg=$! +NbImgMont={$Nb_Circles_Surrounding+1} +if $!>$NbImgMont rm[-{$NbImgMont+1}--$!] fi +NbImg=$! +Index=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +$Wtemp,$Htemp,1,4 +fill_color[-1] 255,255,255,255 +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +done +to_rgb +Wsrc={w} +Hsrc={h} +WHsrc={$Wsrc/$Hsrc} +HWsrc={$Hsrc/$Wsrc} +NbImg=$! +if $NbImg<4 +repeat {4-$NbImg} ++Je_passe_l_hiver_en_Floride[-$NbImg] +done +fi +NbImg=$! +if $Nb_Circles_Surrounding>{$NbImg-1} Nb_Circles_Surrounding={$NbImg-1} fi +Angle_Theta={pi/$Nb_Circles_Surrounding} +Rayon_Cercle_Exterieur_Final={round($Dimension_Finale/2)} +Rayon_Cercle_Centre_Final={round({{$Rayon_Cercle_Exterieur_Final*{1-{sin($Angle_Theta)}}}/{{1+{sin($Angle_Theta)}}}})} +Rayon_Cercles_Ext_Final={round({{$Rayon_Cercle_Exterieur_Final-$Rayon_Cercle_Centre_Final}/2})} +Rayon_Centres_C_Ext_Final={round($Rayon_Cercle_Centre_Final+$Rayon_Cercles_Ext_Final)} +Rayon_Tang_Final={round({{{$Rayon_Centres_C_Ext_Final*$Rayon_Centres_C_Ext_Final}-{$Rayon_Cercles_Ext_Final*$Rayon_Cercles_Ext_Final}}^0.5})} +Dim_Img_Ext={round({{$Rayon_Centres_C_Ext_Final-$Rayon_Cercle_Centre_Final}*2*$Agr})} +X={round({$Wsrc*{$varx/100}})} +Y={round({$Hsrc*{$vary/100}})} +Fin_X={round({{$Wsrc-$X}*$Dimension_Image/{100}})} +Fin_Y={round({{$Hsrc-$Y}*$Dimension_Image/{100}})} +if $Fin_X>$Fin_Y +Rayon_Cercle_Centre_Origine={$Fin_Y/2} +else +Rayon_Cercle_Centre_Origine={$Fin_X/2} +fi +{$Rayon_Cercle_Centre_Final*2},{$Rayon_Cercle_Centre_Final*2},1,4 +fill_color[-1] 0,0,0,0 +circle[-1] 50%,50%,{w/2},1,0,0,0,255 +shift[-2] $Shift_X%,$Shift_Y%,0,0,2 ++Je_passe_l_hiver_en_Floride[-2] +crop[-1] $X,$Y,{$X+{$Rayon_Cercle_Centre_Origine*2}},{$Y+{$Rayon_Cercle_Centre_Origine*2}} +resize2dy[-1] {$Rayon_Cercle_Centre_Final*2} +samj_blend_20220419[-1,-2] alpha,1,1 +expand_xy[-1] {$Rayon_Cercle_Exterieur_Final-$Rayon_Cercle_Centre_Final},0 +rm[-2] +Nb_boucles=0 +X_ext=0 +Y_ext=0 +Angle=0 +Dimension_Img_pivotee=0 +X_Deplacement=0 +Y_Deplacement=0 +repeat $Nb_Circles_Surrounding +Angle={$Nb_boucles*(360/$Nb_Circles_Surrounding)} +X_ext={$Rayon_Cercle_Exterieur_Final+($Rayon_Centres_C_Ext_Final*(cos((pi/180*($Angle+$Angle_inclinaison)))))} +Y_ext={$Rayon_Cercle_Exterieur_Final+($Rayon_Centres_C_Ext_Final*(sin((pi/180*($Angle+$Angle_inclinaison)))))} +Nb_boucles+=1 +{$Rayon_Cercles_Ext_Final*2*$Image_Contour_Dimension/100},{$Rayon_Cercles_Ext_Final*2*$Image_Contour_Dimension/100},1,4 +fill_color[-1] 0,0,0,0 +circle[-1] 50%,50%,{w/2},1,0,0,0,255 ++Je_passe_l_hiver_en_Floride[-3] +if w>h +resize[-1] {w/h*$Dim_Img_Ext},$Dim_Img_Ext +else +resize[-1] $Dim_Img_Ext,{h/w*$Dim_Img_Ext} +fi +shift[-1] $Shift_Xe%,$Shift_Ye%,0,0,2 +samj_blend_20220419[-1,-2] alpha +rm[-3] +if $RotAng==1 rotate[-1] {$Angle+$Decalage_Angle_Images_Contour} fi +crop[-1] {{w-{$Rayon_Cercles_Ext_Final*2}}/2},{{h-{$Rayon_Cercles_Ext_Final*2}}/2},{{{w-{$Rayon_Cercles_Ext_Final*2}}/2}+{$Rayon_Cercles_Ext_Final*2}},{{{h-{$Rayon_Cercles_Ext_Final*2}}/2}+{$Rayon_Cercles_Ext_Final*2}} +X_Deplacement={$X_ext-$Rayon_Cercles_Ext_Final} +Y_Deplacement={$Y_ext-$Rayon_Cercles_Ext_Final} +crop[-1] {-$X_Deplacement},{-$Y_Deplacement},{{2*$Rayon_Cercle_Exterieur_Final}-$X_Deplacement-1},{{2*$Rayon_Cercle_Exterieur_Final}-$Y_Deplacement-1},0 +samj_blend_20220419[-1,-2] alpha,1,1 +done +if {$Rf+$Vf+$Bf+$Af}>0 +replace_color[-1] 1,0,0,0,0,0,$Rf,$Vf,$Bf,$Af +fi +c 0,255 +samj_Montage_Annular_Steiner_Chain_Preview : +samj_Montage_Annular_Steiner_Chain 1200,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19 +samj_Montage_Cercle_Spirale : +NbImg=$! +NbImgMont=6 +if $NbImg<$NbImgMont +repeat {$NbImgMont-$NbImg} ++Je_passe_l_hiver_en_Floride[-$NbImg] +done +fi +samj_montage_row_GUI $2,$3,1,{$1*4},0,0,0,0,0,0,0 +if $4==0 +samj_pseudo_trans_c[-1] 3,$4,{$1*2.304},{$1*2.304},100,1,0,0 +else +samj_pseudo_trans_c[-1] 3,$4,{$1*1.945},{$1*1.945},100,1,0,0 +fi +replace_color[-1] 1,0,0,0,0,0,$5,$6,$7,$8 +if $9==1 +mirror[-1] x permute[-1] yx +elif $9==2 +permute[-1] yxzc mirror[-1] x +elif $9==3 +mirror[-1] x mirror[-1] y +fi +samj_Montage_Cercle_Spirale_preview : +samj_Montage_Cercle_Spirale 800,$2,$3,$4,$5,$6,$7,$8,$9 +samj_pseudo_trans_c : +skip ${1=2} +skip ${2=0} +Larg={w} +Haut={h} +to_rgba +if $2>0 +samj_Ecraser_Etirer 12,2,0,0,100,0 +samj_inclinaison_h $2,$Haut +fi +expand_y {$Haut*$1},0,0 +shift 0,{$Haut*{$1-1}} +map_sphere $3,$4,$5,$6,$7,$8 +{w},{h},1,4 +blend alpha +autocrop +samj_Montage_Figures_Geometriques : +Limite=$1 +Col=$2 +ColToRow=$3 +MontType=$4 +RBg=$5 +VBg=$6 +BBg=$7 +ABg=$8 +Select=$9 +ImgCar=$10 +ShiftX=$11 +ShiftY=$12 +Agr=$13 +Padd=$14 +RPad=$15 +VPad=$16 +BPad=$17 +NbCotPoly=$18 +RotPoly=$19 +EffLig=$20 +IntLig=$21 +ForOeuf=$22 +AngOeuf=$23 +to_rgba +NbImg=$! +Index=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +if $ImgCar==1 +if {$Wtemp}>{$Htemp} +crop[$Index] {{{$Wtemp}-{$Htemp}}/2},0,{{$Htemp}+{{{$Wtemp}-{$Htemp}}/2}-1},{{$Htemp}-1} +elif {$Wtemp}<{$Htemp} +crop[$Index] 0,{{{$Htemp}-{$Wtemp}}/2},{{$Wtemp}-1},{{$Wtemp}+{{{$Htemp}-{$Wtemp}}/2}-1} +fi +fi +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +$Wtemp,$Htemp,1,4 +fill_color[-1] 255,255,255,255 +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +done +shift $ShiftX%,$ShiftY%,0,0,2 +if $ColToRow==1 mirror y permute yx fi +if $Select==0 rv fi +NbImg=$! +if $Col==0 +NbCol={round($NbImg^0.5)} +if {$NbImg%$NbCol}!=0 NbCol+=1 fi +else +NbCol=$Col +fi +NbLig={round($NbImg/$NbCol)} +if {{$NbImg%$NbCol}!=0}&&{$Col>1} NbLig+=1 fi +DimMax={$Limite/max($NbCol,$NbLig)} +W,H=${-max_wh} +if {{max($W,$H)}>$DimMax} +if $DimMax<50 +DimMax=50 +fi +fi +if {$MontType==1&&$ImgCar==1} Agr={$Agr-0.18} fi +if {$MontType==3&&$ImgCar==1} Agr={$Agr-0.18} fi +if {$MontType==4&&$ImgCar==1} Agr={$Agr-0.17} fi +if {$MontType==5&&$ImgCar==1} Agr={$Agr-0.24} fi +rr2d {$DimMax*$Agr},{$DimMax*$Agr},2,1 +if $MontType==0 +Hor={h/$Agr} +Wor={w/$Agr} +crop {{w-$Wor}/2},{{h-$Hor}/2},$Wor,$Hor +autocrop +frame_xy $Padd,$Padd,$RPad,$VPad,$BPad,255 +elif $MontType==1 +to_rgb +Index=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +DimW={{min($Htemp,$Wtemp)}/$Agr} +DimH=$DimW +Ang={$RotPoly+(360/$NbCotPoly)} +$DimW,$DimH,1,4 +samj_dessiner_un_polygone[-1] $NbCotPoly,50,50,$Ang,40,50,1,0,0,0,0,0,0,0,0,0,0,255,0,0,255,0,0,0,127,127,127,0,0,0,0,0,255,255,255,0,0,0,0,1,255,0,0,0,1 +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +{$DimW+{3*$Padd}},{$DimH+{3*$Padd}},1,4 +samj_dessiner_un_polygone[-1] $NbCotPoly,50,50,$Ang,40,50,1,$RPad,$VPad,$BPad,0,0,0,0,0,0,0,255,0,0,255,0,0,0,127,127,127,0,0,0,0,0,255,255,255,0,0,0,0,1,255,0,0,0,1 +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +replace_color[$Index] 2,0,0,0,0,0,0,0,0,0 +autocrop[$Index] +done +elif $MontType==2 +to_rgb +Index=0 +repeat $NbImg +Index-=1 +autocrop[$Index] +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +Hor={{h(#$Index)}/$Agr} +Wor={{w(#$Index)}/$Agr} +crop[$Index] {{$Wtemp-$Wor}/2},{{$Htemp-$Hor}/2},$Wor,$Hor +samj_Des_Lignes_002[$Index] {{$Htemp+$Wtemp}/2/abs($IntLig)*$Agr},0,0,255,255,255,255,0,$EffLig,1,50,50,0,0,0,0,1 +to_rgba[$Index] +frame_xy[$Index] $Padd,$Padd,$RPad,$VPad,$BPad,255 +done +RBg=255 +VBg=255 +BBg=255 +ABg=255 +elif $MontType==3 +to_rgb +Index=0 +repeat $NbImg +Index-=1 +autocrop[$Index] +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +Hor={$Htemp/$Agr} +Wor={$Wtemp/$Agr} +RotOeuf=$AngOeuf +if {$Wor<$Hor}&&{$AngOeuf<0} +RotOeuf={$AngOeuf-90} +fi +$Wor,$Hor,1,4 +samj_Egg_Oeuf_Rosillo[-1] 50,50,40,200,$ForOeuf,$RotOeuf,255,255,255,255,1,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,1 +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +{$Wor+{3*$Padd}},{$Hor+{3*$Padd}},1,4 +samj_Egg_Oeuf_Rosillo[-1] 50,50,40,200,$ForOeuf,$RotOeuf,255,255,255,255,1,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,1 +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +replace_color[$Index] 2,0,0,0,0,0,0,0,0,0 +autocrop[$Index] +done +elif $MontType==4 +to_rgb +Index=0 +repeat $NbImg +Index-=1 +autocrop[$Index] +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +Hor={$Htemp/$Agr} +Wor={$Wtemp/$Agr} +$Wor,$Hor,1,4 +samj_kiss_curve[-1] +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +{$Wor+{3*$Padd}},{$Hor+{3*$Padd}},1,4 +samj_kiss_curve[-1] +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +replace_color[$Index] 2,0,0,0,0,0,0,0,0,0 +autocrop[$Index] +done +elif $MontType==5 +to_rgb +Index=0 +repeat $NbImg +Index-=1 +autocrop[$Index] +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +Hor={$Htemp/$Agr} +Wor={$Wtemp/$Agr} +$Wor,$Hor,1,4 +samj_Spirographe_Fleur[-1] +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +{$Wor+{3*$Padd}},{$Hor+{3*$Padd}},1,4 +samj_Spirographe_Fleur[-1] +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +replace_color[$Index] 2,0,0,0,0,0,0,0,0,0 +autocrop[$Index] +done +fi +append_tiles $Col +replace_color[-1] 1,0,0,0,0,0,$RBg,$VBg,$BBg,$ABg +if $ColToRow==1 mirror x permute yx fi +samj_kiss_curve : +X={round(w/2)} +Y={round(h/2)} +Valeur_A={round({{w+h}*0.2})} +Valeur_B={$Valeur_A*2} +Valeur_C={$Valeur_A*3} +Angle=0 +X_Kiss_A_Imprimer=0 +Y_Kiss_A_Imprimer=0 +X_Kiss_A_Imprimer_Precedent={$X+($Valeur_A*(cos(pi/180*$Angle)))} +Y_Kiss_A_Imprimer_Precedent={$Y+(($Valeur_B-($Valeur_A*(cos(pi/180*$Angle))))/($Valeur_C-($Valeur_A*(cos(pi/180*$Angle))))*($Valeur_A*(sin(pi/180*$Angle))))} +Nb_boucles=0 +repeat 720 +Nb_boucles+=1 +Angle={$Nb_boucles/2} +X_Kiss_A_Imprimer={$X+($Valeur_A*(cos(pi/180*$Angle)))} +Y_Kiss_A_Imprimer={$Y+($Valeur_A*((sin(pi/180*$Angle))^3))} +polygon 3,$X,$Y,$X_Kiss_A_Imprimer_Precedent,$Y_Kiss_A_Imprimer_Precedent,$X_Kiss_A_Imprimer,$Y_Kiss_A_Imprimer,1,255,255,255,255 +X_Kiss_A_Imprimer_Precedent=$X_Kiss_A_Imprimer +Y_Kiss_A_Imprimer_Precedent=$Y_Kiss_A_Imprimer +done +samj_Spirographe_Fleur : +theta=0 +Rayon_1={w*300/{1000}} +Rayon_2={w*30/{1000}} +Position_Stylo={w*8/{1000}} +X={round(w/2)} +Y={round(h/2)} +Ancien_point_X=$X +Nouveau_point_X=$Y +Ancien_point_Y=$X +Nouveau_point_Y=$Y +repeat 720 +Nouveau_point_X={$X+((($Rayon_1+$Rayon_2)*(cos(pi/180*$theta)))-(($Rayon_2+$Position_Stylo)*(cos((($Rayon_1+$Rayon_2)/$Rayon_2)*(pi/180*$theta)))))} +Nouveau_point_Y={$Y+((($Rayon_1+$Rayon_2)*(sin(pi/180*$theta)))-(($Rayon_2+$Position_Stylo)*(sin((($Rayon_1+$Rayon_2)/$Rayon_2)*(pi/180*$theta)))))} +polygon 3,$X,$Y,$Ancien_point_X,$Ancien_point_Y,$Nouveau_point_X,$Nouveau_point_Y,1,255,255,255,255 +Ancien_point_X=$Nouveau_point_X +Ancien_point_Y=$Nouveau_point_Y +theta+=0.5 +done +samj_montage_multi_rows_GUI : +DimensionMini=4 +NbTotalCalques=$! +if $NbTotalCalques<4 +repeat {4-$NbTotalCalques} ++Je_passe_l_hiver_en_Floride[-$NbTotalCalques] +done +fi +if $3==0 rv fi +if $!>$1 rm[-{$1+1}--$!] fi +NbCalques=$! +Reste={$NbCalques%$2} +NbImgParRow={{$NbCalques-$Reste}/$2} +NbRow={{$NbCalques-$Reste}/$NbImgParRow} +if {$NbImgParRow*{2*{$6+$7}+$DimensionMini}}>$5 +samj_erreur_montage_multi_rows_GUI +else +NbImg=$! +Index=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +$Wtemp,$Htemp,1,4 +fill_color[-1] 255,255,255,255 +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +done +Index=0 +Hmax=0 +Wmax=0 +Htot=0 +Wtot=0 +repeat $NbCalques +Index-=1 +Htemp={h(#$Index)} +Htot+=$Htemp +if $Htemp>$Hmax +Hmax=$Htemp +fi +Wtemp={w(#$Index)} +Wtot+=$Wtemp +if $Wtemp>$Wmax +Wmax=$Wtemp +fi +Wliste$AbsInd=$Wtemp +Hliste$AbsInd=$Htemp +done +H_moyen={round($Htot/$NbCalques)} +W_moyen={round($Wtot/$NbCalques)} +H_max=$Hmax +W_max=$Wmax +if $Reste>0 +repeat {$NbImgParRow-$Reste} +$W_moyen,$W_moyen,1,3 +fill_color[-1] 255,255,255 +done +NbRow+=1 +fi +Itr= +Idb=0 +repeat $NbRow +repeat $NbImgParRow +Idb-=1 +Itr=$Itr,$Idb +done +samj_montage_row[$Itr] $4,$5,$6,$7,$8,0 +Itr= +Idb+=$NbImgParRow-1 +done +append y +if $9==1 mirror x permute yx fi +fi +samj_erreur_montage_multi_rows_GUI : +rm +1000,1000,1,3 +fill_color 255,255,255 +text[-1] "Erreur!",20,20,20,1,255,0,0 +text[-1] "Solutions possibles :",20,60,20,1,255,0,0 +text[-1] "Diminuer 1 - Images",20,90,20,1,0,0,0 +text[-1] "Diminuer 2 - Lignes/Rows",20,120,20,1,0,0,0 +text[-1] "Diminuer 6 - Contours Pixels et/ou 7 - Espacement/Padding Pixels",20,150,30,1,0,0,0 +text[-1] "Error!",20,220,20,1,255,0,0 +text[-1] "Possible solutions :",20,260,20,1,255,0,0 +text[-1] "Decrease 1 - Images",20,290,20,1,0,0,0 +text[-1] "Decrease 2 - Lignes/Rows",20,320,20,1,0,0,0 +text[-1] "Decrease 6 - Contours Pixels and/or 7 - Espacement/Padding Pixels",20,350,30,1,0,0,0 +samj_Montage_Pappus_Chain : +X=$1 +Y=$1 +Rayon_Cercle_Exterieur=$1 +Rayon_Premier_Cercle={round($Rayon_Cercle_Exterieur*$6/100)} +Angle_inclinaison=$2 +InvSelect=$3 +Angle_Images=$4 +Rayon_Premier_Cercle={round($Rayon_Cercle_Exterieur*$5/100)} +Agr=$6 +Shift_X=$7 +Shift_Y=$8 +R_CE=$9 +V_CE=$10 +B_CE=$11 +A_CE=$12 +R_Im=$13 +V_Im=$14 +B_Im=$15 +A_Im=$16 +X_Cb={{$Rayon_Cercle_Exterieur-$Rayon_Premier_Cercle}*{cos(pi/180*$Angle_inclinaison)}} +Y_Cb={{$Rayon_Cercle_Exterieur-$Rayon_Premier_Cercle}*{sin(pi/180*$Angle_inclinaison)}} +X_Cc={$Rayon_Premier_Cercle*(cos((pi/180*($Angle_inclinaison+180))))} +Y_Cc={$Rayon_Premier_Cercle*(sin((pi/180*($Angle_inclinaison+180))))} +R_Cc={$Rayon_Cercle_Exterieur-$Rayon_Premier_Cercle} +R_Pappus={$R_Cc/$Rayon_Cercle_Exterieur} +n_Pappus=1 +b_Pappus={$R_Cc} +a_Pappus={$Rayon_Premier_Cercle} +R_Cercle_d={{$a_Pappus*$b_Pappus*{$a_Pappus+$b_Pappus}}/{{$n_Pappus*$a_Pappus*$a_Pappus}+{$b_Pappus*{$a_Pappus+$b_Pappus}}}} +Va={$R_Cc+$R_Cercle_d} +Vb={$Rayon_Premier_Cercle+$R_Cercle_d} +d_x={$X_Cb-$X_Cc} +d_y={$Y_Cb-$Y_Cc} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cc+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cc+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_da={$c_x2+$o_rx} +Y_Cercle_da={$c_y2+$o_ry} +X_Cercle_db={$c_x2-$o_rx} +Y_Cercle_db={$c_y2-$o_ry} +R_Pappus={$R_Cc/$Rayon_Cercle_Exterieur} +n_Pappus=4 +b_Pappus={$R_Cc} +a_Pappus={$Rayon_Premier_Cercle} +R_Cercle_e={{$a_Pappus*$b_Pappus*{$a_Pappus+$b_Pappus}}/{{$n_Pappus*$a_Pappus*$a_Pappus}+{$b_Pappus*{$a_Pappus+$b_Pappus}}}} +Vb={$R_Cc+$R_Cercle_e} +Va={$R_Cercle_d+$R_Cercle_e} +d_x={$X_Cc-$X_Cercle_da} +d_y={$Y_Cc-$Y_Cercle_da} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_da+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_da+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_eb={$c_x2-$o_rx} +Y_Cercle_eb={$c_y2-$o_ry} +d_x={$X_Cc-$X_Cercle_db} +d_y={$Y_Cc-$Y_Cercle_db} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_db+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_db+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_ea={$c_x2+$o_rx} +Y_Cercle_ea={$c_y2+$o_ry} +R_Pappus={$R_Cc/$Rayon_Cercle_Exterieur} +n_Pappus=9 +b_Pappus={$R_Cc} +a_Pappus={$Rayon_Premier_Cercle} +R_Cercle_f={{$a_Pappus*$b_Pappus*{$a_Pappus+$b_Pappus}}/{{$n_Pappus*$a_Pappus*$a_Pappus}+{$b_Pappus*{$a_Pappus+$b_Pappus}}}} +Vb={$R_Cc+$R_Cercle_f} +Va={$R_Cercle_e+$R_Cercle_f} +d_x={$X_Cc-$X_Cercle_ea} +d_y={$Y_Cc-$Y_Cercle_ea} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_ea+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_ea+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_fa={$c_x2+$o_rx} +Y_Cercle_fa={$c_y2+$o_ry} +d_x={$X_Cc-$X_Cercle_eb} +d_y={$Y_Cc-$Y_Cercle_eb} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_eb+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_eb+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_fb={$c_x2-$o_rx} +Y_Cercle_fb={$c_y2-$o_ry} +R_Pappus={$R_Cc/$Rayon_Cercle_Exterieur} +n_Pappus=16 +b_Pappus={$R_Cc} +a_Pappus={$Rayon_Premier_Cercle} +R_Cercle_g={{$a_Pappus*$b_Pappus*{$a_Pappus+$b_Pappus}}/{{$n_Pappus*$a_Pappus*$a_Pappus}+{$b_Pappus*{$a_Pappus+$b_Pappus}}}} +Vb={$R_Cc+$R_Cercle_g} +Va={$R_Cercle_f+$R_Cercle_g} +d_x={$X_Cc-$X_Cercle_fa} +d_y={$Y_Cc-$Y_Cercle_fa} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_fa+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_fa+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_ga={$c_x2+$o_rx} +Y_Cercle_ga={$c_y2+$o_ry} +d_x={$X_Cc-$X_Cercle_fb} +d_y={$Y_Cc-$Y_Cercle_fb} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_fb+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_fb+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_gb={$c_x2-$o_rx} +Y_Cercle_gb={$c_y2-$o_ry} +if $InvSelect==1 rv fi +NbImg=$! +NbImgMont=10 +if $NbImg>$NbImgMont rm[-{$NbImgMont+1}--$!] fi +NbImg=$! +Index=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +$Wtemp,$Htemp,1,4 +fill_color[-1] 255,255,255,255 +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +done +to_rgb +if $NbImg<$NbImgMont +repeat {$NbImgMont-$NbImg} ++Je_passe_l_hiver_en_Floride[-$NbImg] +done +fi +{$X*2},{$Y*2},1,4 +Nb_boucles=0 +repeat 10 +Nb_boucles+=1 +if $Nb_boucles==1 +Ray={round($Rayon_Premier_Cercle)} +DepX={round($X+$X_Cb)} +DepY={round($Y+$Y_Cb)} +elif $Nb_boucles==2 +Ray={round($R_Cc)} +DepX={round($X+$X_Cc)} +DepY={round($Y+$Y_Cc)} +elif $Nb_boucles==3 +Ray={round($R_Cercle_d)} +DepX={round($X+$X_Cercle_da)} +DepY={round($Y+$Y_Cercle_da)} +elif $Nb_boucles==4 +Ray={round($R_Cercle_d)} +DepX={round($X+$X_Cercle_db)} +DepY={round($Y+$Y_Cercle_db)} +elif $Nb_boucles==5 +Ray={round($R_Cercle_e)} +DepX={round($X+$X_Cercle_ea)} +DepY={round($Y+$Y_Cercle_ea)} +elif $Nb_boucles==6 +Ray={round($R_Cercle_e)} +DepX={round($X+$X_Cercle_eb)} +DepY={round($Y+$Y_Cercle_eb)} +elif $Nb_boucles==7 +Ray={round($R_Cercle_f)} +DepX={round($X+$X_Cercle_fa)} +DepY={round($Y+$Y_Cercle_fa)} +elif $Nb_boucles==8 +Ray={round($R_Cercle_f)} +DepX={round($X+$X_Cercle_fb)} +DepY={round($Y+$Y_Cercle_fb)} +elif $Nb_boucles==9 +Ray={round($R_Cercle_g)} +DepX={round($X+$X_Cercle_ga)} +DepY={round($Y+$Y_Cercle_ga)} +elif $Nb_boucles==10 +Ray={round($R_Cercle_g)} +DepX={round($X+$X_Cercle_gb)} +DepY={round($Y+$Y_Cercle_gb)} +fi +Index=-3 +{$X*2},{$Y*2},1,4 +fill_color[-1] 0,0,0,0 +circle[-1] $DepX,$DepY,$Ray,1,0,0,0,255 +Wimg={w(#$Index)} +Himg={h(#$Index)} +RayD={$Ray*2} +if $Wimg>$Himg +resize[-3] {$Wimg/$Himg*$RayD},$RayD +else +resize[-3] $RayD,{$Himg/$Wimg*$RayD} +fi +if $Agr!=100 resize[-3] $Agr%,$Agr% fi +if $Angle_Images==1 +mirror[-3] x permute[-3] yx +elif $Angle_Images==2 +permute[-3] yxzc mirror[-3] x +elif $Angle_Images==3 +mirror[-3] x mirror[-3] y +fi +shift[-3] $Shift_X,$Shift_Y,0,0,2 +Wimg={w(#$Index)} # màj +Himg={h(#$Index)} # màj +DepXi={$DepX-$Ray-(($Wimg-$RayD)/2)} +DepYi={$DepY-$Ray-(($Himg-$RayD)/2)} +if $DepXi<0 DepXi=0 fi +if $DepYi<0 DepYi=0 fi +expand_x[$Index] $DepXi,0 +expand_y[$Index] $DepYi,0 +crop[$Index] 0,0,{{$X*2}-1},{{$Y*2}-1},0 ++Je_passe_l_hiver_en_Floride[-3] +samj_blend_20220419[-1,-2] alpha +rm[-3] +samj_blend_20220419[-1,-2] alpha +done +if {$R_CE+$V_CE+$B_CE+$A_CE}>0 +{$X*2},{$Y*2},1,4 +ellipse[-1] $X,$Y,$Rayon_Cercle_Exterieur,$Rayon_Cercle_Exterieur,0,1,$R_CE,$V_CE,$B_CE,$A_CE +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +fi +if {$R_Im+$V_Im+$B_Im+$A_Im}>0 +{$X*2},{$Y*2},1,4 +fill_color[-1] $R_Im,$V_Im,$B_Im,$A_Im +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +fi +samj_Montage_Pappus_Chain_Preview : +samj_Montage_Pappus_Chain 400,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16 +samj_montage_row_GUI : +Type_Proportions_Finales=$2 +DimensionMini=4 +if $2==0 rv fi +if $!>$1 rm[-{$1+1}--$!] fi +if {{$1*{$5+$6+$DimensionMini}}>$4} +samj_erreur_montage_row_GUI +else +samj_montage_row $3,$4,$5,$6,$7,0 +if $9==1 +mirror x permute yx +expand_x {w/2} +ripple {w/2},{h},{$10+1},0,{h/100*$11} +permute yxzc mirror x +autocrop +fi +if $8==1 +mirror x permute yx +fi +fi +samj_montage_row_GUI_preview : +DimensionMini=4 +if $2==0 rv fi +if $!>$1 rm[-{$1+1}--$!] fi +if $!<$1 NbImg=$! else NbImg=$1 fi +if {{$NbImg*{2*{$5+$6}+$DimensionMini}}>$4} +samj_erreur_montage_row_GUI +else +samj_montage_row $3,$4,$5,$6,$7,0 +if $9==1 +mirror x permute yx +expand_x {w/2} +ripple {w/2},{h},{$10+1},0,{h/100*$11} +permute yxzc mirror x +autocrop +fi +if $8==1 +mirror x permute yx +fi +DimReduite=1000 +resize $DimReduite,{h/w*$DimReduite},1,3 +fi +samj_erreur_montage_row_GUI : +rm +1000,1000,1,3 +fill_color 255,255,255 +text "Erreur!",20,20,36,1,255,0,0 +text "Diminuer 5 - Contours Pixels et/ou 6 - Espacement/Padding Pixels",20,60,20,1,255,0,0 +text "Error!",20,100,36,1,255,0,0 +text "Decrease 5 - Contours Pixels and/or 6 - Espacement/Padding Pixels",20,140,20,1,255,0,0 +samj_Montage_Zigzag : +DH=$4 +if $3==0 rv fi +if $!>$2 rm[-{$2+1}--$!] fi +NbImg=$! +Index=0 +Wmax=0 +Wtot=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +if $Htemp>$Wtemp Wtemp=$DH else Wtemp={$Wtemp/$Htemp*$DH} fi +Wtot+=round($Wtemp) +done +if $Wtot>$1 DH={round($DH/$Wtot*$1)} fi +Index=0 +repeat $NbImg +Index-=1 +if {abs($Index+$5)%2}==0 +samj_inclinaison_h[$Index] 0,$DH +Wtemp={w(#$Index)} +Htemp={h(#$Index)} +if $6>0 +smooth[$Index] $6 +polygon[$Index] 3,0,0,{$Wtemp-1},0,0,{$DH-1},1,0,0,0,0 +polygon[$Index] 3,1,{$Htemp-1},{$Wtemp-1},$DH,{$Wtemp-1},{$Htemp-1},1,0,0,0,0 +fi +else +samj_inclinaison_h[$Index] 1,$DH +Wtemp={w(#$Index)} +Htemp={h(#$Index)} +if $6>0 +smooth[$Index] $6 +polygon[$Index] 3,1,0,{$Wtemp-1},0,{$Wtemp-1},{$DH-1},1,0,0,0,0 +polygon[$Index] 3,0,$DH,{$Wtemp-1},{$Htemp-1},0,{$Htemp-1},1,0,0,0,0 +fi +fi +done +append x +replace_color[-1] 1,0,0,0,0,0,$7,$8,$9,$10 +samj_inclinaison_h : +skip ${1=2} +skip ${2=128} +to_rgba +if {$1%2}==0 ++samj_demi_haut $2 +rv +samj_demi_bas[-1] $2 +append y +else +mirror y ++samj_demi_haut $2 +rv +samj_demi_bas[-1] $2 +append y +mirror y +fi +samj_demi_haut : +skip ${1=256} +Haut=$1 +if h>w resize $Haut,$Haut else resize {w/h*$Haut},$Haut fi +split x,$Haut +Index=0 +Decalage=1 +repeat $Haut +Index-=1 +shift[$Index] 0,$Decalage,0,0,0 +Decalage+=1 +done +append x +samj_demi_bas : +skip ${1=256} +Haut=$1 +if h>w resize $Haut,$Haut else resize {w/h*$Haut},$Haut fi +split x,$Haut +Index=0 +Decalage=$Haut +mirror y +repeat {$Haut-1} +Index-=1 +shift[$Index] 0,$Decalage,0,0,0 +Decalage-=1 +done +append x +mirror y +samj_Pixelisation_Contours : +Flou=$1 +Forme=$2 +Pixelisation=$3 +TM_Levels=$4 +TM_Smoothness=$5 +VA=$6 +Type_Rendu=$7 +V_Amplitude=$8 +V_Edge_Threshold=$9 +V_Smoothness=$10 +Largeur={w} +Hauteur={h} +blur[-1] $Flou +if $Forme==0 +pixelize[-1] {$Largeur/$Pixelisation},{$Hauteur/$Pixelisation} +elif $Forme==1 +imagegrid_hexagonal[-1] {round(2*$Largeur/$Pixelisation)},0 +elif $Forme==2 +imagegrid_triangular[-1] {round($Largeur/$Pixelisation)},{round({$Largeur/$Pixelisation/{2^0.5}})},0,0 +elif $Forme==3 +imagegrid_triangular[-1] {round($Largeur/$Pixelisation)},{round({$Largeur/$Pixelisation/{2^0.5}})},1,0 +elif $Forme==4 +imagegrid_triangular[-1] {round($Largeur/$Pixelisation)},{round({$Largeur/$Pixelisation/{2^0.5}})},2,0 +elif $Forme==5 +imagegrid_triangular[-1] {round($Largeur/$Pixelisation)},{round({$Largeur/$Pixelisation/{2^0.5}})},3,0 +elif $Forme==6 +imagegrid_triangular[-1] {round($Largeur/$Pixelisation)},{round({$Largeur/$Pixelisation/{2^0.5}})},4,0 +elif $Forme==7 +imagegrid_triangular[-1] {round($Largeur/$Pixelisation)},{round({$Largeur/$Pixelisation/{2^0.5}})},5,0 +fi +topographic_map[-1] $TM_Levels,$TM_Smoothness ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +if $Type_Rendu==1 +shift[-1] 0,$VA,0,0,0 +shift[-2] $VA,0,0,0,0 +shift[-3] $VA,$VA,0,0,0 +elif $Type_Rendu==2 +shift[-1] 0,$VA,0,0,0 +shift[-2] $VA,$VA,0,0,0 +shift[-3] $VA,0,0,0,0 +elif $Type_Rendu==3 +shift[-1] $VA,0,0,0,0 +shift[-2] 0,$VA,0,0,0 +shift[-3] $VA,$VA,0,0,0 +elif $Type_Rendu==4 +shift[-1] $VA,0,0,0,0 +shift[-2] $VA,$VA,0,0,0 +shift[-3] 0,$VA,0,0,0 +elif $Type_Rendu==5 +shift[-1] $VA,$VA,0,0,0 +shift[-2] $VA,0,0,0,0 +shift[-3] 0,$VA,0,0,0 +elif $Type_Rendu==6 +shift[-1] $VA,$VA,0,0,0 +shift[-2] 0,$VA,0,0,0 +shift[-3] $VA,0,0,0,0 +fi +crop[-1,-2,-3] 0,0,{$Largeur-1-$VA},{$Hauteur-1-$VA} +samj_blend_20220419[-1,-2,-3,-4] edges +fx_smooth_antialias[-1] $V_Amplitude,$V_Edge_Threshold,$V_Smoothness +samj_Pointes_De_Diamants_Colorees : +Couleur_Limite_r=$1 +Couleur_Limite_v=$2 +Couleur_Limite_b=$3 +Couleur_Limite_a=$4 +Resolution=$5 +Variation_L=$6 +Variation_H=$7 +Grossissement_A=$8 +Grossissement_B=$9 +Angle_Variation=$10 +Rendu=$11 +Flou_Contours=$12 +Couleur_Fond_r=$13 +Couleur_Fond_v=$14 +Couleur_Fond_b=$15 +Couleur_Fond_a=$16 +Contours_Polygones=$17 +Largeur_Origine={w} +Hauteur_Origine={h} +couleur_pixel=0 +rouge_pixel=0 +vert_pixel=0 +bleu_pixel=0 +alpha_pixel=$Couleur_Limite_a +Moyenne_couleur=0 +Coeff_bulle=0 +Angle_Origine={45+$Angle_Variation} +KL=0 +KH=0 +Hauteur=$Resolution +Largeur=$Resolution +X_a=0 +Y_a=0 +X_b=0 +Y_b=0 +X_c=0 +Y_c=0 +X_d=0 +Y_d=0 +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] $Couleur_Fond_r,$Couleur_Fond_v,$Couleur_Fond_b,$Couleur_Fond_a +repeat $Largeur_Origine/($Resolution+$Resolution) +repeat $Hauteur_Origine/($Resolution+$Resolution) +couleur_pixel=${at_ancien[0]\ {$Largeur},{$Hauteur}} +rouge_pixel=${arg\ 1,$couleur_pixel} +vert_pixel=${arg\ 2,$couleur_pixel} +bleu_pixel=${arg\ 3,$couleur_pixel} +Moyenne_couleur={{$rouge_pixel+$vert_pixel+$bleu_pixel}/$Grossissement_A} +KL={$Grossissement_B+(($Moyenne_couleur+$Variation_L)/512)} +KH={$Grossissement_B+(($Moyenne_couleur+$Variation_H)/512)} +Angle_Variation={$Angle_Origine+(($rouge_pixel+$vert_pixel+$bleu_pixel)/(255*3)*180)} +X_a={$Largeur-(($Resolution*$KL)*(cos(pi/180*$Angle_Variation)))} +Y_a=$Hauteur +X_b=$Largeur +Y_b={$Hauteur+(($Resolution*$KH)*(sin(pi/180*$Angle_Variation)))} +X_c={$Largeur+(($Resolution*$KL)*(cos(pi/180*$Angle_Variation)))} +Y_c=$Hauteur +X_d=$Largeur +Y_d={$Hauteur-(($Resolution*$KH)*(sin(pi/180*$Angle_Variation)))} +if $Rendu==0 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +elif $Rendu==1 +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +elif $Rendu==2 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +fi +if $Contours_Polygones==1 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,0xFFFFFFFF,$Couleur_Fond_r,$Couleur_Fond_v,$Couleur_Fond_b,$Couleur_Fond_a +elif $Contours_Polygones==2 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,0xFFFFFFFF,255,255,255,$alpha_pixel +elif $Contours_Polygones==3 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,0xFFFFFFFF,{{$rouge_pixel+$vert_pixel+$bleu_pixel}/3},{{$rouge_pixel+$vert_pixel+$bleu_pixel}/3},{{$rouge_pixel+$vert_pixel+$bleu_pixel}/3},$alpha_pixel +elif $Contours_Polygones==4 +polygon[-1] 4,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,0xFFFFFFFF,{$rouge_pixel*0.5},{$vert_pixel*0.5},{$bleu_pixel*0.5},$alpha_pixel +fi +Hauteur+=$Resolution+$Resolution +done +Largeur+=$Resolution+$Resolution +Hauteur=$Resolution +done +rm[0] +if $Flou_Contours>0 blur[-1] $Flou_Contours,0 fi +samj_reptile : +Texture_Forme=$1 +Texture_Resolution=$2 +Texture_Spread=$3 +Texture_Color=$4 +Texture_Orientation=$5 +Texture_Light=$6 +Opacity=$7 +Largeur_Origine={w} +Hauteur_Origine={h} +Coeff_Echelle_L=1 +Coeff_Echelle_H=1 ++Je_passe_l_hiver_en_Floride[-1] +fx_isophotes[-1] 8,2,1,0 +if $Largeur_Origine<10*$Texture_Resolution +Coeff_Echelle_L={{10*$Texture_Resolution}/$Largeur_Origine} +fi +if $Hauteur_Origine<10*$Texture_Resolution +Coeff_Echelle_H={{10*$Texture_Resolution}/$Hauteur_Origine} +fi +if $Coeff_Echelle_L+$Coeff_Echelle_H>2 +if $Coeff_Echelle_L>$Coeff_Echelle_H +resize[-1,-2] {round($Largeur_Origine*$Coeff_Echelle_L)},{round($Hauteur_Origine*$Coeff_Echelle_L)} +else +resize[-1,-2] {round($Largeur_Origine*$Coeff_Echelle_H)},{round($Hauteur_Origine*$Coeff_Echelle_H)} +fi +fi +to_rgb[-1,-2] +if $Texture_Forme==0 +fx_imagegrid_hexagonal[-1] $Texture_Resolution,0.1,1 +elif $Texture_Forme==1 +imagegrid[-1] {round(w/$Texture_Resolution)},{round(h/$Texture_Resolution)} +elif $Texture_Forme==2 +fx_imagegrid_triangular {round(w/$Texture_Resolution)},{round(1.8*w/$Texture_Resolution)},0,0,0,0,255 +Texture_Spread/=2 +elif $Texture_Forme==3 +fx_imagegrid_triangular {round({h/{1.8*$Texture_Resolution}})},{round(h/$Texture_Resolution)},0,0,0,0,255 +Texture_Spread/=2 +elif $Texture_Forme==4 +fx_imagegrid_triangular {round(w/$Texture_Resolution)},{round(1.8*w/$Texture_Resolution)},1,0,0,0,255 +Texture_Spread/=2 +elif $Texture_Forme==5 +fx_imagegrid_triangular {round({h/{1.8*$Texture_Resolution}})},{round(h/$Texture_Resolution)},1,0,0,0,255 +Texture_Spread/=2 +fi +fx_spread {{w*$Texture_Spread}/{100*$Texture_Resolution}},{{h*$Texture_Spread}/{100*$Texture_Resolution}},0,0,0 +fx_boost_fade[-1] $Texture_Color,0 ++Je_passe_l_hiver_en_Floride[-1] +fx_local_orientation[-1] $Texture_Orientation,0,100,0,16,0 +blend[-1,-2] 14,0,1,1,"0" +fx_lightglow[-1] $Texture_Light,0.5,8,0.8,0,0 +blend[-1,-2] grainmerge,1,$Opacity +samj_Scintillements_Colores : +Couleur_Limite_r=$1 +Couleur_Limite_v=$2 +Couleur_Limite_b=$3 +Couleur_Limite_a=$4 +Resolution_L=$5 +Resolution_H=$6 +Dimension_Variation=$7 +Variation_Couleur=$8 +Scintillement=$9 +Angle_Decalage=$10 +Variation_Aleatoire=$11 +Rendu=$12 +Flou_Contours=$13 +Couleur_Fond_r=$14 +Couleur_Fond_v=$15 +Couleur_Fond_b=$16 +Couleur_Fond_a=$17 +Largeur_Origine={w} +Hauteur_Origine={h} +couleur_pixel=0 +rouge_pixel=0 +vert_pixel=0 +bleu_pixel=0 +alpha_pixel=$Couleur_Limite_a +Hauteur=$Resolution_H +Largeur=$Resolution_L +Rayon_Scintillement_Origine={{$Resolution_H+$Resolution_L}*$Dimension_Variation} +Rayon_Scintillement=0 +Angle_Variation={360/$Scintillement} +Angle_Variation_En_Cours=0 +Coeff_Variation_Aleatoire=0 +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] $Couleur_Fond_r,$Couleur_Fond_v,$Couleur_Fond_b,$Couleur_Fond_a +repeat $Largeur_Origine/($Resolution_L+$Resolution_L) +repeat $Hauteur_Origine/($Resolution_H+$Resolution_H) +couleur_pixel=${at_ancien[0]\ {$Largeur},{$Hauteur}} +rouge_pixel=${arg\ 1,$couleur_pixel} +vert_pixel=${arg\ 2,$couleur_pixel} +bleu_pixel=${arg\ 3,$couleur_pixel} +Moyenne_couleur={1+{{$rouge_pixel+$vert_pixel+$bleu_pixel}/$Variation_Couleur}} +Rayon_Scintillement={$Rayon_Scintillement_Origine*$Moyenne_couleur} +Angle_Variation_En_Cours=0 +if $Rendu==0 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +repeat $Scintillement +Angle_Variation_En_Cours+=$Angle_Variation+$Angle_Decalage +if $Variation_Aleatoire==0 +line[-1] $Largeur,$Hauteur,{$Largeur+{$Rayon_Scintillement*{cos(pi/180*$Angle_Variation_En_Cours)}}},{$Hauteur+{$Rayon_Scintillement*{sin(pi/180*$Angle_Variation_En_Cours)}}},1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +else +Coeff_Variation_Aleatoire={1+{{round(u)*$Variation_Aleatoire}/100}} +line[-1] $Largeur,$Hauteur,{$Largeur+{$Rayon_Scintillement*$Coeff_Variation_Aleatoire*{cos(pi/180*$Angle_Variation_En_Cours*$Coeff_Variation_Aleatoire)}}},{$Hauteur+{$Rayon_Scintillement*$Coeff_Variation_Aleatoire*{sin(pi/180*$Angle_Variation_En_Cours*$Coeff_Variation_Aleatoire)}}},1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +done +fi +elif $Rendu==1 +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +repeat $Scintillement +Angle_Variation_En_Cours+=$Angle_Variation+$Angle_Decalage +if $Variation_Aleatoire==0 +line[-1] $Largeur,$Hauteur,{$Largeur+{$Rayon_Scintillement*{cos(pi/180*$Angle_Variation_En_Cours)}}},{$Hauteur+{$Rayon_Scintillement*{sin(pi/180*$Angle_Variation_En_Cours)}}},1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +else +Coeff_Variation_Aleatoire={1+{{round(u)*$Variation_Aleatoire}/100}} +line[-1] $Largeur,$Hauteur,{$Largeur+{$Rayon_Scintillement*$Coeff_Variation_Aleatoire*{cos(pi/180*$Angle_Variation_En_Cours*$Coeff_Variation_Aleatoire)}}},{$Hauteur+{$Rayon_Scintillement*$Coeff_Variation_Aleatoire*{sin(pi/180*$Angle_Variation_En_Cours*$Coeff_Variation_Aleatoire)}}},1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +done +fi +elif $Rendu==2 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +repeat $Scintillement +Angle_Variation_En_Cours+=$Angle_Variation+$Angle_Decalage +if $Variation_Aleatoire==0 +line[-1] $Largeur,$Hauteur,{$Largeur+{$Rayon_Scintillement*{cos(pi/180*$Angle_Variation_En_Cours)}}},{$Hauteur+{$Rayon_Scintillement*{sin(pi/180*$Angle_Variation_En_Cours)}}},1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +else +Coeff_Variation_Aleatoire={1+{{round(u)*$Variation_Aleatoire}/100}} +line[-1] $Largeur,$Hauteur,{$Largeur+{$Rayon_Scintillement*$Coeff_Variation_Aleatoire*{cos(pi/180*$Angle_Variation_En_Cours*$Coeff_Variation_Aleatoire)}}},{$Hauteur+{$Rayon_Scintillement*$Coeff_Variation_Aleatoire*{sin(pi/180*$Angle_Variation_En_Cours*$Coeff_Variation_Aleatoire)}}},1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +done +fi +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +repeat $Scintillement +Angle_Variation_En_Cours+=$Angle_Variation+$Angle_Decalage +if $Variation_Aleatoire==0 +line[-1] $Largeur,$Hauteur,{$Largeur+{$Rayon_Scintillement*{cos(pi/180*$Angle_Variation_En_Cours)}}},{$Hauteur+{$Rayon_Scintillement*{sin(pi/180*$Angle_Variation_En_Cours)}}},1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +else +Coeff_Variation_Aleatoire={1+{{round(u)*$Variation_Aleatoire}/100}} +line[-1] $Largeur,$Hauteur,{$Largeur+{$Rayon_Scintillement*$Coeff_Variation_Aleatoire*{cos(pi/180*$Angle_Variation_En_Cours*$Coeff_Variation_Aleatoire)}}},{$Hauteur+{$Rayon_Scintillement*$Coeff_Variation_Aleatoire*{sin(pi/180*$Angle_Variation_En_Cours*$Coeff_Variation_Aleatoire)}}},1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +done +fi +fi +Hauteur+=$Resolution_H+$Resolution_H +done +Largeur+=$Resolution_L+$Resolution_L +Hauteur=$Resolution_H +done +rm[0] +if $Flou_Contours>0 blur[-1] $Flou_Contours,0 fi +if $18>0 deform[-1] $18 fi +samj_Angoisse : +iterations=$1 +dog_sigma1=$2 +dog_sigma2={$3/10} +sw_threshold=$4 +smooth_amplitude=$5 +noise_amplitude=$6 +noise_type=$7 +opacite=$8 +sharpen_amplitude=$9 +to_rgb[-1] ++Je_passe_l_hiver_en_Floride[-1] +repeat $iterations +dog[-1] $dog_sigma1%,$dog_sigma2% +segment_watershed[-1] $sw_threshold,1 +smooth[-1] $smooth_amplitude,0,1,1,3 +n[-1] 0,255 +if $noise_amplitude>0 noise[-1] $noise_amplitude,$noise_type fi +to_rgb[-1] +fx_decompose_channels[-1] 4,0,1,0 +remove[-1,-2] +done +to_rgb[-1] +gimp_blend_1651[-1,-2] 28,0,$opacite,0,1 +if $sharpen_amplitude>0 sharpen[-1] $sharpen_amplitude fi +samj_Barbouillage_Paint_Daub : +iterations=$1 +amplitude=$2 +sharpness=$3 +anisotropy=$4 +sigma=$5 +dl=$6 +egaliser=$7 +Couleurs_Plasma=$8 +Scale_Plasma=$9 +to_rgb[-1] +if $Couleurs_Plasma>0 +{w},{h},1,3 +fill_color[-1] 0,0,0 +plasma[-1] 1,1,$Scale_Plasma +n[-1] 0,255 +if $Couleurs_Plasma==1 +fx_decompose_channels[-1,-2] 2,0,1,0 remove[-2,-3,-4] fx_decompose_channels 2,1,1,0 +elif $Couleurs_Plasma==2 +fx_decompose_channels[-1,-2] 2,0,1,0 remove[-1,-5,-6] fx_decompose_channels[-3,-2,-1] 2,1,1,0 +fi +n[-1] 0,255 +to_rgb[-1] +fi ++Je_passe_l_hiver_en_Floride[-1] +repeat $iterations +gradient_norm[-1] +n[-1] 0,255 +equalize[-1] +done +engrave_modifie[-1] 4,0.5,4,0,8,40,0,25,1 +samj_blend_20220419[-1,-2] add +repeat $amplitude +smooth[-1] $sharpness,$anisotropy,1,$sigma,$dl +done +n[-1] 0,255 +if $egaliser==1 equalize[-1] fi +samj_chalkitup : +Abstraction=$1 +Details_scale=$2 +Color=$3 +Smoothness=$4 +Sharpen_shades=$5 +Action=$6 +Size=$7 +Invert_colors=$8 +Shape=$9 +Channel_morpho=$10 +X_variations=$11 +Y_variations=$12 +Channel_spread=$13 +foreach { +remove_opacity[-1] +fx_painting[-1] $Abstraction,$Details_scale,$Color,$Smoothness,$Sharpen_shades +ancien_gimp_morpho[-1] $Action,$Size,$Invert_colors,$Shape,$Channel_morpho,0 +fx_spread[-1] $X_variations,$Y_variations,$Channel_spread,0 +} +samj_chalkitup_preview : +gui_split_preview "samj_chalkitup ${1--2}",$-1 +samj_Color_EdgesO_Engrave : ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +pow[-2] $12 +fx_edge_offsets[-2] $1,$2,$3,$4,0 +fx_engrave[-1,-2] $5,$6,$7,$8,$9,$10,$11,0,10,1,0,0,0,1 +samj_blend_20220419[-1,-2] multiply,1,1 +if $13==1 negate[-1] fi +if $14>0 fx_segment_watershed[-2] $14,1,16,0,0 fi +samj_blend_20220419[-1,-2] multiply,1,1 +if $15==1 +Je_passe_l_hiver_en_Floride[-1] samj_blend_20220419[-1,-2] add,1,1 fi +samj_Contour_Drawings_en : +V_Isophotes=$1 +Flou=$2 +V_Dilate=$3 +V_Color_Autoindex=$4 +V_To_Gray=$5 +V_Amplitude=$6 +V_Edge_Threshold=$7 +V_Smoothness=$8 +BG=$9 +BG_Color=$10 +BG_Variation=$11 +Chalk=$12 +V_Spread=$13 +Largeur={w} +Hauteur={h} +to_rgba[-1] +if $BG==1 ++Je_passe_l_hiver_en_Floride[-1] +fi +blur[-1] $Flou +isophotes[-1] $V_Isophotes ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +shift[-1] 1,1,0,0,0 +shift[-2] 0,1,0,0,0 +shift[-3] 1,0,0,0,0 +crop[-1,-2,-3] 0,0,{$Largeur-1},{$Hauteur-1} +samj_blend_20220419[-1,-2,-3,-4] alpha +dilate[-1] $V_Dilate +if $V_Color_Autoindex>0 +autoindex[-1] {$V_Color_Autoindex+1},1,1 +to_rgba[-1] +fi +fx_smooth_antialias[-1] $V_Amplitude,$V_Edge_Threshold,$V_Smoothness +if $V_To_Gray==1 +to_graya[-1] +n[-1] 64,255 +to_rgba[-1] +fi +if $Chalk==1 +spread[-1] $V_Spread +BG_Color=0 +fi +if $BG==1 +if $BG_Color<1 +to_gray[-2] +fi +blur[-2] {{w+h}/$BG_Variation} +pow[-2] $BG_Color +samj_blend_20220419[-1,-2] alpha +fi +samj_Contour_Epais : +Iterations=$1 +Flou=$2 +V_Edges=$3 +Valider_Isophotes=$4 +V_Isophotes=$5 +V_Amplitude=$6 +V_Edge_Threshold=$7 +V_Smoothness=$8 +Epaisseur=$9 +Type_Rendu=$10 +Largeur={w} +Hauteur={h} +to_rgba[-1] ++Je_passe_l_hiver_en_Floride[-1] +repeat $Iterations +blur[-1] $Flou +edges[-1] $V_Edges% +n[-1] 0,255 +if $Valider_Isophotes==0 +to_rgba[-1] +replace_color[-1] 0%,0,255,255,255,255,0,0,0,0 +fi +done +if $Valider_Isophotes==0 +to_rgba[-1] +c[-1] 0,{$Epaisseur+1} +Epaisseur={abs($Epaisseur-2)} +else +isophotes $V_Isophotes +fi +n[-1] 0,255 ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +shift[-1] 0,1,0,0,0 +shift[-2] 1,0,0,0,0 +shift[-3] 1,1,0,0,0 +crop[-1,-2,-3] 0,0,{$Largeur-1},{$Hauteur-1} +samj_blend_20220419[-1,-2,-3,-4] alpha +blur[-1] 1 +sharpen[-1] 10 +if $Valider_Isophotes==0 +rv[-1,-2] +samj_blend_20220419[-1,-2] edges +pixelize[-1] {$Largeur/4},{$Hauteur/4} +else +samj_blend_20220419[-1,-2] edges +fi +repeat $Epaisseur ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +if $Type_Rendu==1 +shift[-1] 0,1,0,0,0 +shift[-2] 1,0,0,0,0 +shift[-3] 1,1,0,0,0 +elif $Type_Rendu==2 +shift[-1] 0,1,0,0,0 +shift[-2] 1,1,0,0,0 +shift[-3] 1,0,0,0,0 +elif $Type_Rendu==3 +shift[-1] 1,0,0,0,0 +shift[-2] 0,1,0,0,0 +shift[-3] 1,1,0,0,0 +elif $Type_Rendu==4 +shift[-1] 1,0,0,0,0 +shift[-2] 1,1,0,0,0 +shift[-3] 0,1,0,0,0 +elif $Type_Rendu==5 +shift[-1] 1,1,0,0,0 +shift[-2] 1,0,0,0,0 +shift[-3] 0,1,0,0,0 +elif $Type_Rendu==6 +shift[-1] 1,1,0,0,0 +shift[-2] 0,1,0,0,0 +shift[-3] 1,0,0,0,0 +fi +crop[-1,-2,-3] 0,0,{$Largeur-1},{$Hauteur-1} +samj_blend_20220419[-1,-2,-3,-4] alpha +done +fx_smooth_antialias[-1] $V_Amplitude,$V_Edge_Threshold,$V_Smoothness +samj_Couleurs_Rayees : +Lumin=$1 +Pixelisation=$2 +Flou=$3 +PA=$4 +DeformA=$5 +DeformB=$6 +Couleur=$7 +Iterations=$8 +Puissance=$9 +Egaliser=$10 +to_rgba[-1] ++Je_passe_l_hiver_en_Floride[-1] +if $Lumin==1 +luminance[-1] +n[-1] 0,255 +equalize[-1] +fi +to_rgb[-1] +ditheredbw[-1] +pixelize[-1] $Pixelisation +blur[-1] $Flou +ditheredbw[-1] +to_rgba[-1] +replace_color[-1] 0%,0,255,255,255,255,0,0,0,0 +replace_color[-1] 0%,0,0,0,0,255,$Couleur,$Couleur,$Couleur,255 +samj_blend_20220419[-1,-2] alpha +repeat $Iterations +smooth[-1] $PA,0.2,1,$DeformA,$DeformB +done +pow[-1] $Puissance +n[-1] 0,255 +if $Egaliser==1 equalize[-1] fi +samj_Couleurs_Rayees_2 : ++Je_passe_l_hiver_en_Floride[-1] +samj_Gris_Raye[-1] $1,$2,$3,$4,$5,$6,$7,$8 +samj_blend_20220419[-1,-2] luminance +samj_Test_Cubisme_A : +foreach { +if $1==1 +dilate {{w+h}/$2} dilate[-2] {{w+h}/$3} blend edges fi +if $4==1 imagegrid_triangular $5,$6,$7,0,0,0,0 fi +if $8==1 srand 123 spread $9 noise {$9*2.5} to_rgb blur $10 fi +if $11==1 polygonize $12,$13,$14,$15,$16 fi +if $17==1 repeat $18 kuwahara $19 done fi +if $20>0 drawing 200 smooth 300 fi +n 0,255 +if $21==1 +$24,$24,1,3 +fill_color[-1] 0,0,0 +rectangle[-1] 1,1,{w-3},{h-3},1,127,127,127 +srand 123 +noise[-1] 2,2 +if $25==1 negate[-1] fi +n[-1] 0,255 +srand 123 +brushify[0] [-1],$22,,4,,{$23%} +rm[-1] +fi +if $26==1 to_pseudogray 10,1,8 fi +} +samj_Test_Cubisme_B : +foreach { +to_rgba ++samj_Decoupage_Triangle $1,$2,$3,$4,$5 +samj_Decoupage_Triangle[-2] $6,$7,$8,$9,$10 +mode=${arg\ 1+$12,add,alpha,and,average,blue,burn,darken,difference,,divide,dodge,edges,exclusion,freeze,grainextract,grainmerge,green,hardlight,,hardmix,hue,interpolation,lighten,lightness,linearburn,linearlight,luminance,,multiply,negation,or,overlay,pinlight,red,reflect,saturation,seamless,seamless_mixed,,screen,shapeareamax,shapeareamax0,shapeareamin,shapeareamin0,shapeaverage,shapeaverage0,,shapemedian,shapemedian0,shapemin,shapemin0,shapemax,shapemax0,softburn,softdodge,,softlight,stamp,subtract,value,vividlight,xor} +if $11==1 rv[-1,-2] fi +samj_blend_20220419[-1,-2] $mode,$13 +n 0,255 +if $14==1 +$17,$17,1,3 +fill_color[-1] 0,0,0 +rectangle[-1] 1,1,{w-3},{h-3},1,127,127,127 +srand 123 +noise[-1] 2,2 +if $18==1 negate[-1] fi +n[-1] 0,255 +srand 123 +brushify[0] [-1],$15,,4,,{$16%} +rm[-1] +fi +if $19==1 to_pseudogray 10,1,8 fi +} +samj_Decoupage_Triangle : +skip ${1=2},${2=5},${3=0},${4=0},${5=0} +Haut={h} +Larg={w} +shift $4,$5,0,0,2 +resize {round($Larg/$1)*$1},{round($Haut/$1)*$1} +split y,$1 +split x,$1 +if $2<6 +imagegrid_triangular {w},{h},$2,0,0,0,0 +else +NbImg=$! +Index=0 +repeat $NbImg +Index-=1 +imagegrid_triangular[$Index] {w},{h},{$Index%6},0,0,0,0 +done +fi +if $3>0 spread $3 fi +append x +split x,$1 +append y +resize $Larg,$Haut +shift[-1] -$4,-$5,0,0,2 +samj_Diff_Tensors_Blend : +DT_Resolution=$1 +DT_Size=$2 +DT_Colormode=1 +DT_Outline=$3 +DT_Sharpness=$4 +DT_Anisotropy=$5 +DT_Gradientsmoothness=$6 +DT_Tensorsmoothness=$7 +Iterations=$8 +Flou=$9 +Mode_blend=$10 +Opacity_blend=$11 ++Je_passe_l_hiver_en_Floride[-1] +to_rgba[-1,-2] +repeat $Iterations +fx_diffusiontensors[-1] $DT_Resolution,$DT_Size,$DT_Colormode,$DT_Outline,$DT_Sharpness,$DT_Anisotropy,$DT_Gradientsmoothness,$DT_Tensorsmoothness +done +blur[-2] $Flou +gimp_blend_1651[-2,-1] $Mode_blend,2,$Opacity_blend,0 +samj_Edges_And_LIC : +Rendu=$1 +Val_Lic=$2 +Val_Dilate_Circ=$3 +Val_Sharpen=$4 +Val_Blur=$5 +Val_Edges=$6 +Val_Pow=$7 +N_min=$8 +N_max=$9 +Gray=$10 +Valider_Abstraction=$11 +Smoothness_Abstraction=$12 +Levels_Abstraction=$13 +Contrast_Abstraction=$14 +Valider_Blend=$15 +mode=${arg\ 1+$16,add,alpha,and,average,blue,burn,darken,difference,divide,dodge,edges,exclusion,freeze,grainextract,grainmerge,green,hardlight,hardmix,hue,interpolation,lighten,lightness,linearburn,linearlight,luminance,multiply,negation,or,overlay,pinlight,red,reflect,saturation,shapeareamax,shapeareamax0,shapeareamin,shapeareamin0,shapeaverage,shapeaverage0,shapemin,shapemin0,shapemax,shapemax0,softburn,softdodge,softlight,screen,stamp,subtract,value,vividlight,xor} +Inverser_Blend=$17 +to_rgb[-1] +samj_Wavelet_Sharpen_Test_en[-1] 1,0 +if $Valider_Blend==1 ++Je_passe_l_hiver_en_Floride[-1] +fi ++Je_passe_l_hiver_en_Floride[-1] +edges[-1] $Val_Edges% +pow[-1] $Val_Pow +n[-1] $N_min,$N_max +rv[-1,-2] +if $Rendu==0 +lic[-1] $Val_Lic,3 +if $Val_Dilate_Circ>0 dilate_circ[-1] {$Val_Dilate_Circ+1} fi +if $Val_Sharpen>0 sharpen[-1] $Val_Sharpen fi +if $Val_Blur>0 blur[-1] $Val_Blur fi +fi +if $Rendu==1 +mirror[-1] x +lic[-1] $Val_Lic,3 +if $Val_Dilate_Circ>0 dilate_circ[-1] {$Val_Dilate_Circ+1} fi +if $Val_Sharpen>0 sharpen[-1] $Val_Sharpen fi +if $Val_Blur>0 blur[-1] $Val_Blur fi +mirror[-1] x +fi +if $Rendu==2 ++Je_passe_l_hiver_en_Floride[-1] +lic[-1] $Val_Lic,3 +if $Val_Dilate_Circ>0 dilate_circ[-1] {$Val_Dilate_Circ+1} fi +if $Val_Sharpen>0 sharpen[-1] $Val_Sharpen fi +if $Val_Blur>0 blur[-1] $Val_Blur fi +rv[-1,-2] +mirror[-1] x +lic[-1] $Val_Lic,3 +if $Val_Dilate_Circ>0 dilate_circ[-1] {$Val_Dilate_Circ+1} fi +if $Val_Sharpen>0 sharpen[-1] $Val_Sharpen fi +if $Val_Blur>0 blur[-1] $Val_Blur fi +mirror[-1] x +samj_blend_20220419[-1,-2] average +fi +if $Gray==0 +fx_decompose_channels[-1] 7,0,1,0 +remove[-1,-2] +elif $Gray==1 +fx_decompose_channels[-1] 2,0,1,0 +remove[-3,-2] +elif $Gray==2 +fx_decompose_channels[-1] 7,0,1,0 +remove[-3,-2] +elif $Gray==3 +fx_decompose_channels[-1] 2,0,1,0 +remove[-3,-1] +elif $Gray==4 +fx_decompose_channels[-1] 7,0,1,0 +remove[-1,-3] +elif $Gray==5 +fx_decompose_channels[-1] 2,0,1,0 +remove[-1,-2] +elif $Gray==6 +to_gray[-1] +fi +n[-1] 0,255 +to_rgb[-1] +samj_blend_20220419[-1,-2] average +n[-1] 0,255 +if $Valider_Abstraction==1 +fx_color_abstraction[-1] $Smoothness_Abstraction,$Levels_Abstraction,$Contrast_Abstraction +fi +if $Valider_Blend==1 +if $Inverser_Blend==1 rv[-1,-2] fi +samj_blend_20220419[-1,-2] $mode +fi +samj_Flamboyance_Test: +foreach { +HS_Amplitude=$1 +HS_Density=$2 +Flou_HS=$3 +HS_Opacity=$4 +HS_Edge=$5 +HS_Fast_Approximation=$6 +Couleur_HS=$7 +SB_Spatial_Variance=$8 +SB_Value_Variance=$9 +SB_Iterations=$10 +Blend_Grain_Type=$11 +Iterations_Blend_Grain=$12 +Blend_Grain_Proportion=$13 +Interruption_Flamboyance=$14 +S_Amplitude=$15 +S_Sharpness=$16 +S_Anisotropy=$17 +S_Gradient_smoothness=$18 +S_Tensor_smoothness=$19 +S_Spatial_precision=$20 +S_Angular_precision=$21 +S_Value_precision=$22 +S_Interpolation=$23 +S_Fast_approximation=$24 +S_Color_Variation=$25 +C_Smoothness=$26 +C_Sharpening=$27 +C_Edge_threshold=$28 +C_Edge_thickness=$29 +C_Color_strength=$30 +C_Color_quantization=$31 +C_Color_Variation=$32 +Blend_Mode=$33 +Blend_Opacity=$34 +Blend_Reverse=$35 +Sharpen_Origine=$36 +Bruit=$37 +Spread_X=$38 +Spread_Y=$39 +to_rgba[-1] +spread[-1] $Spread_X,$Spread_Y,0 +if $Bruit>0 +Je_passe_l_hiver_en_Floride[-1] noise_hurl[-1] {$Bruit+1} samj_blend_20220419[-1,-2] alpha fi +sharpen[-1] $Sharpen_Origine ++Je_passe_l_hiver_en_Floride[-1] +blur[-1] $Flou_HS ++hardsketchbw[-1] $HS_Amplitude,$HS_Density,$HS_Opacity,$HS_Edge,$HS_Fast_Approximation +samj_blend_20220419[-1,-2] hardlight +to_rgb[-1] +negate[-1] +n[-1] 0,255 +to_graya[-1] +mul[-1] $Couleur_HS +c[-1] 0,255 +to_rgba[-1] +repeat $SB_Iterations +bilateral[-2] $SB_Spatial_Variance,$SB_Value_Variance +done +to_rgba[-2] +if $Blend_Grain_Type==0 ++Je_passe_l_hiver_en_Floride[-1,-2] +samj_blend_20220419[-1,-2] grainextract,$Blend_Grain_Proportion,1 +repeat $Iterations_Blend_Grain ++Je_passe_l_hiver_en_Floride[-2] +samj_blend_20220419[-1,-2] grainextract,$Blend_Grain_Proportion,1 +done +elif $Blend_Grain_Type==1 ++Je_passe_l_hiver_en_Floride[-1,-2] +samj_blend_20220419[-1,-2] grainextract,$Blend_Grain_Proportion,1 +repeat $Iterations_Blend_Grain ++Je_passe_l_hiver_en_Floride[-2] +samj_blend_20220419[-1,-3] grainextract,$Blend_Grain_Proportion,1 +done +elif $Blend_Grain_Type==2 ++Je_passe_l_hiver_en_Floride[-1,-2] +samj_blend_20220419[-1,-2] grainmerge,$Blend_Grain_Proportion,1 +repeat $Iterations_Blend_Grain ++Je_passe_l_hiver_en_Floride[-2] +samj_blend_20220419[-1,-2] grainmerge,$Blend_Grain_Proportion,1 +done +elif $Blend_Grain_Type==3 ++Je_passe_l_hiver_en_Floride[-1,-2] +samj_blend_20220419[-1,-2] grainmerge,$Blend_Grain_Proportion,1 +repeat $Iterations_Blend_Grain ++Je_passe_l_hiver_en_Floride[-2] +samj_blend_20220419[-1,-3] grainmerge,$Blend_Grain_Proportion,1 +done +fi +if $Interruption_Flamboyance==1 +rm[-2,-3] +else +rm[-2] +smooth[-1] $S_Amplitude,$S_Sharpness,$S_Anisotropy,$S_Gradient_smoothness,$S_Tensor_smoothness,$S_Spatial_precision,$S_Angular_precision,$S_Value_precision,$S_Interpolation,$S_Fast_approximation +mul[-1] $S_Color_Variation +c[-1] 0,255 +cartoon[-1] $C_Smoothness,$C_Sharpening,$C_Edge_threshold,$C_Edge_thickness,$C_Color_strength,$C_Color_quantization +mul[-1] $C_Color_Variation +if $Blend_Reverse==0 rv[-1,-2] fi +gimp_blend_1651[-2,-1] $Blend_Mode,2,$Blend_Opacity,0 +fi +} +samj_Flamboyance_Test_preview : +gui_split_preview "samj_Flamboyance_Test $*",$-1 +samj_fond_broderie : +Levels_topographic_map=$1 +Smoothness_topographic_map=$2 +Curviness_gimp_skeleton=$3 +Activer_fx_LCE=$4 +Activer_gimp_frame_blur=$5 +topographic_map[0] $Levels_topographic_map,$Smoothness_topographic_map ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +fx_local_orientation[-1] 0,0,100,0,0,0 +fx_color_abstraction[-1] 2,10,0.5,0 +fx_skeleton[-1] 0,$3,0,0,0 +fx_skeleton[-2] 0,$3,0,0,0 +samj_blend_20220419[-2,-1] add,1,0 +samj_blend_20220419[-2,-1] and,1,0 +if $Activer_fx_LCE==1 +fx_LCE[-1] 80,0.5,1,1,3,0 +fi +if $Activer_gimp_frame_blur==1 +fx_frame_blur[-1] 30,30,0,5,0,0,128,128,128,0,5,255,255,255,2,2,1,0,0.5,0.5,0 +fi +samj_Fond_Brosse : +Brosse=$1 +Couleur=$2 +repeat $Brosse +fx_local_orientation[-1] 0,0,100,0,25,0 +pow[-1] $Couleur +done +fx_smooth_anisotropic[-1] 60,0.7,0.3,4,10,2,180,2,1,1,1,2,0 +fx_normalize_local[-1] 2,6,5,20,1,11,0 +samj_fx_sketchbw_modifie : +samj_fonction_fx_sketchbw_modifie $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17 +if $18 +repeat $19 +smooth $20,$21,1,$22,$23 +done +n 0,255 +if $24==1 equalize fi +fi +samj_fx_sketchbw_modifie_preview : +gui_split_preview "samj_fx_sketchbw_modifie $*",$-1 +samj_fonction_fx_sketchbw_modifie : +if $16==0 srand $17 fi +if $15==4 foreach { +sketchbw ${1-14} blend hardlight } return fi +sketchbw ${1-14} +if $15&1 negate fi +if $15==2 r 100%,100%,1,4 repeat $! sh[$>] 3 *. -2 +. {2*255} c. 0,255 rm. done +elif $15==3 r 100%,100%,1,4 repeat $! sh[$>] 3 *. 2 c. 0,255 rm. done +fi +samj_Texture_Granuleuse : +foreach { +Smoothness_Gradient_RGB=$1 +Max_threshold_Gradient_RGB=$2 +Amplitude_Noise=$3 +Colors=$4 +Automatic_color_balance=$5 ++Je_passe_l_hiver_en_Floride[-1] +fx_gradient2rgb[-1] $Smoothness_Gradient_RGB,0,$Max_threshold_Gradient_RGB,0,0 +{w},{h},1,3 +fill_color[-1] 255,255,255 +to_rgb[-1] +fx_noise[-1] $Amplitude_Noise,0,2,0 +samj_blend_20220419[-1,-2] negation,1,1 +ancien_Tom_Keil_Colortemp[-1] $Colors,$Automatic_color_balance +fx_local_orientation[-1] 0,0,100,0,11 +fx_normalize_local[-1] 0,6,5,20,1,2 +samj_blend_20220419[0,-1] grainmerge,1,1 +} +samj_Texture_Granuleuse_preview : +gui_split_preview "samj_Texture_Granuleuse $*",$-1 +samj_Gris_Raye : +Lumin=$1 +Pixelisation=$2 +Flou=$3 +PA=$4 +DeformA=$5 +DeformB=$6 +Limite=$7 +Iterations=$8 +if $Lumin==1 +luminance[-1] +n[-1] 0,255 +equalize[-1] +fi +to_rgb[-1] +ditheredbw[-1] +pixelize[-1] $Pixelisation +blur[-1] $Flou +ditheredbw[-1] +repeat $Iterations +smooth[-1] $PA,0.2,1,$DeformA,$DeformB +done +n[-1] 0,255 +c[-1] 0,$Limite +n[-1] 0,255 +c[-1] {255-$Limite},255 +n[-1] 0,255 +samj_Hallucinogen : +Larg={w} +Haut={h} +to_rgb +n 0,255 +samj_HallucinoGenerator $1,$2,$3,$4,$5,$6 +if $7==1 samj_HallucinoGenerator $1,$2,$3,$4,$5,$6 fi +if $8==1 +$11,$11,1,3 +fill_color[-1] 0,0,0 +rectangle[-1] 1,1,{w-3},{h-3},1,127,127,127 +srand 123 +noise[-1] 2,2 +if $6==1 negate[-1] fi +n[-1] 0,255 +srand 123 +brushify[0] [-1],$9,,4,,{$10%} +rm[-1] +fi +samj_HallucinoGenerator: +skip ${1=80},${2=2},${3=80},${4=1.5},${5=2},${6=0} +if $1>1 autoindex $1 fi +blur $2 +pow {0.4+{$3/10000}} +mod $4 +repeat $5 smooth 100,0.7,0.3,0.6 done +if $6==1 negate fi +n 0,255 +samj_Hallucinogen_b : +if $18==0 +if $1==1 polygonize $2,$3,$4,$5,$6 fi +samj_Hallucinogen $7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17 +else +if $1==1 ++polygonize $2,$3,$4,$5,$6 +samj_Hallucinogen[-1] $7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17 +else ++samj_Hallucinogen[-1] $7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17 +fi +if $19==1 rv[-1,0] fi +mode=${arg\ 1+$20,add,alpha,and,average,blue,burn,darken,difference,,divide,dodge,edges,exclusion,freeze,grainextract,grainmerge,green,hardlight,,hardmix,hue,interpolation,lighten,lightness,linearburn,linearlight,luminance,,multiply,negation,or,overlay,pinlight,red,reflect,saturation,seamless,seamless_mixed,,screen,shapeareamax,shapeareamax0,shapeareamin,shapeareamin0,shapeaverage,shapeaverage0,,shapemedian,shapemedian0,shapemin,shapemin0,shapemax,shapemax0,softburn,softdodge,,softlight,stamp,subtract,value,vividlight,xor} +blend $mode,$21 +fi +samj_Impressions : +Spread_fond=$1 +X_amplitude=$2 +Y_amplitude=$3 +X_smoothness=$4 +Y_smoothness=$5 +Edge_attenuation=$6 +Edge_influence=$7 +Noise_scale=$8 +iterations=$9 +dog_sigma1=$10 +dog_sigma2={$11/10} +sw_threshold=$12 +smooth_amplitude=$13 +noise_amplitude=$14 +noise_type=$15 +opacite=$16 +sharpen_amplitude=$17 +Couleurs=$18 +spread[-1] $Spread_fond +fx_textured_glass[-1] $X_amplitude,$Y_amplitude,$X_smoothness,$Y_smoothness,$Edge_attenuation,$Edge_influence,$Noise_scale +to_rgb[-1] ++Je_passe_l_hiver_en_Floride[-1] +repeat $iterations +dog[-1] $dog_sigma1%,$dog_sigma2% +segment_watershed[-1] $sw_threshold,1 +smooth[-1] $smooth_amplitude,0,1,1,3 +n[-1] 0,255 +if $noise_amplitude>0 noise[-1] $noise_amplitude,$noise_type fi +to_rgb[-1] +fx_decompose_channels[-1] 4,0,1,0 +remove[-1,-2] +done +to_rgb[-1] +gimp_blend_1651[-1,-2] 28,0,$opacite,0,1 +if $sharpen_amplitude>0 sharpen[-1] $sharpen_amplitude fi +fx_custom_transform[-1] "i",i*$Couleurs,"i","i","i","i",0 +samj_Isophotes_Vers_Aquarelle : +Nb_Decomposition_Couleurs=$1 +Variation_Flou=$2 +Nb_Isophotes=$3 +Dilatation=$4 +Segmentation=$5 +S_E=$6 +S_S=$7 +S_C=$8 +S_V=$9 +Flou=$10 +Couleurs=$11 +Fond=$12 +F_A_N=$13 +F_D_H=$14 +F_S_V=$15 +F_A_W=$16 +F_R=$17 +F_V=$18 +F_B=$19 +F_O=$20 +Nb_Boucles=0 +n[-1] 0,255 ++Je_passe_l_hiver_en_Floride[-1] +repeat $Nb_Decomposition_Couleurs +if $Nb_Boucles>0 +blur[-1] {$Nb_Boucles*$Variation_Flou} +equalize[-1] {$Nb_Boucles+4},0,100 +fi +isophotes[-1] $Nb_Isophotes +if $Nb_Boucles>0 +if $Dilatation>0 dilate_circ[-1] {$Dilatation+1} fi +samj_blend_20220419[-1,-2] alpha +fi +Nb_Boucles+=1 ++Je_passe_l_hiver_en_Floride[-2] +done +rm[-1,-3] +if $Segmentation>0 fx_segment_watershed[-1] $S_E,$S_S,$S_C,$S_V fi +if $Flou>0 blur[-1] $Flou fi +if $Couleurs>0 +mul[-1] $Couleurs +elif $Couleurs<0 +pow[-1] {abs($Couleurs)} +fi +if $Fond==1 +{w},{h},1,3 +samj_Texture_Aquarelle_1[-1] $F_A_N,$F_D_H,$F_S_V,$F_A_W,$F_R,$F_V,$F_B,$F_O +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +fi +samj_Plasmic : +Flou=$1 +Puissance=$2 +Edge_threshold=$3 +Couper_Cut=$4 +Dilate_Contours=$5 +Valeur_Plasma=$6 +Deformation=$7 +Degradation_Spread=$8 +Largeur_Origine={w} +Hauteur_Origine={h} +if $Flou>0 blur[-1] $Flou fi +if $Valeur_Plasma>0 +$Largeur_Origine,$Hauteur_Origine,1,3 +plasma[-1] $Valeur_Plasma,$Valeur_Plasma +n[-1] 0,255 +rv[-1,-2] +else ++Je_passe_l_hiver_en_Floride[0] +fi +to_rgb[-1,-2] +pow[-1] $Puissance +c[-1] 0,255 +fx_segment_watershed[-1] $2,1,0,2,0 +fx_gradient_norm[-1] 0,0.5,0,100,0,0 +c[-1] $Couper_Cut,255 +n[-1] 0,255 +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Dilate_Contours>1 dilate_circ[-1,-2] $Dilate_Contours fi +if $Degradation_Spread>1 spread[-1,-2] $Degradation_Spread fi +samj_blend_20220419[-2,-1] darken,1,0 +samj_Plasmic_V2 : +Valeur_Plasma=$1 +Epaisseur=$2 +Precision=$3 +Coeff_Precision_Pixelise=$4 +Coeff_Precision_Flou=$5 +Nb_Isophotes=$6 +Deformation=$7 +Dilate_Contours=$8 +Degradation_Spread=$9 +R_a=$10 +V_a=$11 +B_a=$12 +A_a=$13 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_Boucles=0 +to_rgba[-1] ++Je_passe_l_hiver_en_Floride[-1] +repeat $Epaisseur +pixelize[-1] {1+round({$Precision+$Epaisseur-$Nb_Boucles}*$Coeff_Precision_Pixelise)},{1+round({$Precision+$Epaisseur-$Nb_Boucles}*$Coeff_Precision_Pixelise)} +blur[-1] {{$Precision+$Epaisseur+$Nb_Boucles}*$Coeff_Precision_Flou} +isophotes[-1] $Nb_Isophotes +if $Nb_Boucles>0 samj_blend_20220419[-1,-2] alpha fi +Nb_Boucles+=1 ++Je_passe_l_hiver_en_Floride[-2] +done +rm[-1,-3] +if {abs($Valeur_Plasma)}>0 +$Largeur_Origine,$Hauteur_Origine,1,3 +plasma[-1] {abs($Valeur_Plasma)},{abs($Valeur_Plasma)} +n[-1] 0,255 +else ++Je_passe_l_hiver_en_Floride[-1] +fi +rv[-1,-2] +if $Deformation>0 samj_Random_Small_Deformations[-1,-2] $Deformation,5,3 fi +if $Dilate_Contours>1 dilate_circ[-1,-2] $Dilate_Contours fi +if $Degradation_Spread>1 spread[-1,-2] $Degradation_Spread fi +if $Deformation<0 samj_Random_Small_Deformations[-1,-2] {abs($Deformation)/10},5,3 fi +if $Valeur_Plasma<0 +samj_Texture_Granuleuse[-1,-2] 0.5,20,80,0,0 +fi +rv[-1,-2] +samj_blend_20220419[-2,-1] alpha +{w},{h},1,4 +fill_color[-1] $R_a,$V_a,$B_a,$A_a +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +samj_Pointillisme : +Intensite=$1 +Densite=$2 +Dimension=$3 +Rond=$4 +Variation=$5 +Fond_Transparent=$6 +R_a=$7 +V_a=$8 +B_a=$9 +A_a=$10 +to_rgba[-1] ++Je_passe_l_hiver_en_Floride[-1] +mul[-1] $Variation +sharpen[-1] {2000*$Intensite} +noise[-1] {1+$Densite} +warp[-2] [-1],1,0,0 +rm[-1] +if $Rond==1 +dilate_circ[-1] $Dimension +else +dilate[-1] $Dimension +fi +if $Fond_Transparent==0 +{w},{h},1,4 +fill_color[-1] $R_a,$V_a,$B_a,$A_a +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +fi +samj_Pointillisme_B : +Variation=$1 +Dilatation=$2 +Pixels=$3 +Dimension=$4 +Rond=$5 +Fond_Transparent=$6 +R_a=$7 +V_a=$8 +B_a=$9 +A_a=$10 +mul[-1] $Variation +if $Dilatation>0 dilate[-1] {$Dilatation+1} fi +remove_pixels[-1] 90% +to_rgba[-1] +replace_color[-1] 0%,0,0,0,0,255,0,0,0,0 +if $Dimension>0 +if $Rond==1 +dilate_circ[-1] {$Dimension+1} +else +dilate[-1] {$Dimension+1} +fi +fi +if $Fond_Transparent==0 +{w},{h},1,4 +fill_color[-1] $R_a,$V_a,$B_a,$A_a +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +fi +samj_Posterize_B: +if $15>0&&$10==1 +blur[-1] $1 n[-2] 0,{255-{$16/$15}} else blur[-1] $1 fi +autoindex[-1] $2 +inpaint_holes[-1] {w/100*$3},1 +repeat $4 smooth[-1] $5,{$6%},1,$7,{2*$7} done +if $8>0 sharpen[-1] $8 fi +if $9==1 n[-1] 0,255 fi +if $10==1 +luminance[-1] +if $11==0 +shift[-1] 1,1,0,0,0 +elif $11==1 +shift[-1] 1,-1,0,0,0 +elif $11==2 +shift[-1] -1,1,0,0,0 +elif $11==3 +shift[-1] -1,-1,0,0,0 +elif $11==4 +shift[-1] 0,1,0,0,0 +elif $11==5 +shift[-1] 1,0,0,0,0 +elif $11==6 +shift[-1] 0,-1,0,0,0 +elif $11==7 +shift[-1] -1,0,0,0,0 +fi +samj_blend_20220419[-1,-2] difference +n[-1] 0,255 +negate[-1] +erode_circ[-1] $12 +round +if $13==1 ditheredbw[-1] fi +if $14>0 grid[-1] {18-$14},{18-$14},0,0,255,255 fi +if $15==1 to_rgb[-1,-2] samj_blend_20220419[-1,-2] vividlight +elif $15==2 ++[-2] to_rgb[-1,-2,-3] repeat 2 samj_blend_20220419[-1,-2] vividlight done +elif $15==3 ++[-2] ++[-3] to_rgb[-1,-2,-3,-4] repeat 3 samj_blend_20220419[-1,-2] vividlight done +fi +if $17==1 to_gray[-1] round select_color[-1] 0,255 n[-1] 0,255 fi +if $18==1 negate[-1] fi +fi +samj_ripple_houghsketchbw : +foreach { +autocrop +blur $1 +ripple {round({w}/$2)},$3,{$4+2},$5,$6 +if $12 ++samj_houghsketchbw_20230528 $7,$8,$9,$10,$11% +mode=${arg\ 1+$13,add,alpha,and,average,blue,burn,darken,difference,,divide,dodge,edges,exclusion,freeze,grainextract,grainmerge,green,hardlight,,hardmix,hue,interpolation,lighten,lightness,linearburn,linearlight,luminance,,multiply,negation,or,overlay,pinlight,red,reflect,saturation,seamless,seamless_mixed,,screen,shapeareamax,shapeareamax0,shapeareamin,shapeareamin0,shapeaverage,shapeaverage0,,shapemedian,shapemedian0,shapemin,shapemin0,shapemax,shapemax0,softburn,softdodge,,softlight,stamp,subtract,value,vividlight,xor} +if $15 rv fi +blend $mode,$14 +else +samj_houghsketchbw_20230528 $7,$8,$9,$10,$11% +fi +c 0,255 +} +samj_ripple_houghsketchbw_preview : +gui_split_preview "samj_ripple_houghsketchbw $*",$-1 +samj_houghsketchbw_20230528 : check "${1=100}>=0 && ${2=3}>=0 && ${3=100}>=0 && $3<=100 && ${4=0.1}>=0 && $4<=1 && ${5=100%}>0" +e[^-1] "Apply hough B&W sketch effect on image$?, with density $1, radius $2, threshold $3, opacity $4 +and votesize $5." +luminance +foreach { +nm={n} +res={round(if(${is_percent\ $5},$5*max(w,h),$5))} w={w} h={h} rhomax={sqrt(w^2+h^2)/2} +hough $res,$res n 0,255 +normalize_local. $1,$2 >=. $3% pointcloud3d. +s3d. rm[-6--5,-3--1] r. 3,{h/3},1,1,-1 columns. 0,1 +s. x,2 +*.. {2*pi/$res} +*. {$rhomax/$res} ++cos.. *. .. +. {$w/2} ++sin... *. ... +. {$h/2} +rm... +i... ... +cos[-4] sin... *[-4,-3] 10000 +++.. ... ++-.. [-5] +-[-4] [-5] ++... [-6] +rm[-6,-5] +i... 1,{h} 1,{h} a[-6--1] x +i.. ('CImg3d') i.. ({2*h},{h}) +1,{h},1,1,2 1,{h},1,1,2*y ++. 1 a[-3--1] x +3,{h},1,1,0 1,{h},1,1,$4 +y[-6--1] a[-6--1] y +$w,$h,1,1,255 j3d. ..,0,0,0,1,1,0,0 rm.. => $nm +} +samj_Test_Skeletik: +Iterations=$1 +Val_Skeleton=$2 +Deformation=$3 +Dilate_Contours=$4 +Degradation_Spread=$5 +mode=${arg\ 1+$6,add,alpha,and,average,blue,burn,darken,difference,divide,dodge,edges,exclusion,freeze,grainextract,grainmerge,green,hardlight,hardmix,hue,interpolation,lighten,lightness,linearburn,linearlight,luminance,multiply,negation,or,overlay,pinlight,red,reflect,saturation,shapeareamax,shapeareamax0,shapeareamin,shapeareamin0,shapeaverage,shapeaverage0,shapemin,shapemin0,shapemax,shapemax0,softburn,softdodge,softlight,screen,stamp,subtract,value,vividlight,xor} +Couleur=$7 +R_a=$8 +V_a=$9 +B_a=$10 +A_a=$11 +Nb_Boucles=0 ++Je_passe_l_hiver_en_Floride[-1] +if $Deformation>0 samj_Random_Small_Deformations[-1] $Deformation,5,3 fi +to_rgb[-1] +repeat $Iterations +Ancien_skeleton[-1] {$Val_Skeleton+$Nb_Boucles} +n[-1] 0,255 +to_rgba[-1] +replace_color[-1] 0%,0,0,0,0,255,0,0,0,0 +if $Nb_Boucles>0 samj_blend_20220419[-1,-2] alpha fi +Nb_Boucles+=1 ++Je_passe_l_hiver_en_Floride[-2] +done +rm[-1] +if $Degradation_Spread>1 spread[-1] $Degradation_Spread fi +if $Dilate_Contours>1 dilate_circ[-1] $Dilate_Contours fi +to_graya[-1] +rv[-1,-2] +samj_blend_20220419[-1,-2] $mode +mul[-1] $Couleur +{w},{h},1,4 +fill_color[-1] $R_a,$V_a,$B_a,$A_a +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +Ancien_skeleton : check ${1=0}>=0 +e[^-1] "Compute skeleton of binary image$?." +->= 50% distance 0 b $1 sharpen 1e10 ->= 100% +repeat $! +erode[$>] 2 --[$>,-1] done +samj_TensorTest : +DT_Sharpness=$1 +DT_Anisotropy=$2 +DT_Alpha=$3 +DT_Sigma=$4 +DT_Is_Sqrt=$5 +Absolu=$6 +SizeX=$7 +Size_Factor=$8 +Ellipse_Size=$9 +Color_Mode=$10 +Outline=$11 +Couleur=$12 +Type_Resize=$13 +Largeur_Origine={w} +Hauteur_Origine={h} +to_rgb[-1] +diffusiontensors[-1] $DT_Sharpness,$DT_Anisotropy,$DT_Alpha,$DT_Sigma,$DT_Is_Sqrt +if $Absolu==1 +abs +fi +resize2dx[-1] $SizeX +display_tensors[-1] $Size_Factor,{$Ellipse_Size/10},$Color_Mode,$Outline +if $Couleur>0 +pow[-1] $Couleur +fi +n[-1] 0,255 +if $Type_Resize==0 +to_rgba[-1] +elif $Type_Resize==1 +to_rgb[-1] +resize[-1] $Largeur_Origine,$Hauteur_Origine,5,3,3 +elif $Type_Resize==2 +to_rgba[-1] +resize[-1] $Largeur_Origine,$Hauteur_Origine,5,4,3 +fi +samj_texture_coloree : +Type=$1 +sharpness=$2 +rf=$3 +vf=$4 +bf=$5 +AmplitudeA=$6 +AmplitudeB=$7 +Angle=$8 +AmplitudeS=$9 +Iterations_Blend=$10 +Opacite_Blend=$11 +if $Type==0 +anisotropy=0 +alpha=0 +sigma=0 +is_sqrt=1 +elif $Type==1 +anisotropy=0 +alpha=4 +sigma=0 +is_sqrt=1 +elif $Type==2 +sharpness=0.5 +anisotropy=0.3 +alpha=4 +sigma=2 +is_sqrt=1 +elif $Type==3 +anisotropy=0 +alpha=0 +sigma=0 +is_sqrt=0 +elif $Type==4 +anisotropy=0 +alpha=4 +sigma=0 +is_sqrt=0 +elif $Type==5 +sharpness=0.5 +anisotropy=0.3 +alpha=4 +sigma=2 +is_sqrt=0 +fi +diffusiontensors[-1] $sharpness,$anisotropy,$alpha,$sigma,$is_sqrt +n[-1] 0,255 +equalize[-1] +fx_decompose_channels[-1] 4,0,1,0 +remove[-1,-2] +to_rgb[-1] +fx_8bits[-1] 100,10000,256 +{w},{h},1,3 +fill_color[-1] $rf,$vf,$bf +samj_blend_20220419[-1,-2] add +to_rgb[-1] +repeat $Iterations_Blend ++Je_passe_l_hiver_en_Floride[-1] +done +blur_linear[-1] $AmplitudeA,{$AmplitudeB*$AmplitudeA/100},$Angle,1 +sharpen[-1] $AmplitudeS +to_rgb[-1] +repeat $Iterations_Blend +fx_blend_edges[-1,-2] $Opacite_Blend,5,0 +done +samj_texture_coloree_en : +samj_texture_coloree $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11 +if $13>0 +deblur_richardsonlucy[-1] $12,$13,$14 +if $15 c[-1] 0,255 else n[-1] 0,255 fi +fi +samj_rien_black_and_white : +Je_passe_l_hiver_en_Floride[-1] +Engrave_colore : +Examples=$1 +Radius=$2 +Densite_A=$3 +Edges=$4 +Coherence=$5 +Threshold=$6 +Minimal_Area=$7 +Repetition=$8 +Anti_Aliasing=$9 +Choix_Couleur=$10 +R_C1=$11 +V_C1=$12 +B_C1=$13 +R_C2=$14 +V_C2=$15 +B_C2=$16 +if $Examples==1 +Radius={0.475+{$Radius/20}} +Densite_A={3.8+{$Densite_A/20}} +Edges/=20 +Coherence={10-{$Coherence/20}} +Threshold={38+{$Threshold/20}} +Minimal_Area/=20 +Repetition={55-{$Repetition/10}} +Anti_Aliasing=1 +elif $Examples==2 +Radius={0.275+{$Radius/20}} +Densite_A={2.3+{$Densite_A/20}} +Edges/=20 +Coherence={10-{$Coherence/20}} +Threshold={38+{$Threshold/20}} +Minimal_Area/=20 +Repetition={55-{$Repetition/10}} +Anti_Aliasing=1 +elif $Examples==3 +Radius={0.475+{$Radius/20}} +Densite_A={3.8+{$Densite_A/20}} +Edges/=20 +Coherence={7-{$Coherence/20}} +Threshold={48+{$Threshold/20}} +Minimal_Area=-100 +Repetition={20-{$Repetition/10}} +Anti_Aliasing=1 +elif $Examples==4 +Radius={0.175+{$Radius/20}} +Densite_A={12-{$Densite_A/2}} +Edges/=20 +Coherence={10-{$Coherence/20}} +Threshold={38+{$Threshold/20}} +Minimal_Area/=20 +Repetition={30-{$Repetition/10}} +Anti_Aliasing=3 +elif $Examples==5 +Radius={1.975+{$Radius/20}} +Densite_A={1.8+{$Densite_A/20}} +Edges/=20 +Coherence={2-{$Coherence/20}} +Threshold={18+{$Threshold/20}} +Minimal_Area=-100 +Repetition={55-{$Repetition/10}} +Anti_Aliasing=2 +elif $Examples==6 +Radius={0.975+{$Radius/20}} +Densite_A={2.3+{$Densite_A/20}} +Edges/=20 +Coherence={10-{$Coherence/20}} +Threshold={28+{$Threshold/20}} +Minimal_Area/=20 +Repetition={55-{$Repetition/10}} +Anti_Aliasing=1 +elif $Examples==7 +Radius={0.475+{$Radius/20}} +Densite_A={3.8+{$Densite_A/20}} +Edges/=20 +Coherence={10-{$Coherence/20}} +Threshold={38+{$Threshold/20}} +Minimal_Area/=20 +Repetition={-5+{$Repetition/10}} +Anti_Aliasing=1 +fi +f={arg(1+$Anti_Aliasing,1,1.5,2,3)} +r={$f*$Radius} +nm=${-gui_layer_name} +pos=${-gui_layer_pos} +C1_blanc=0 +Blend_final=0 +to_rgb[-1] +if $Choix_Couleur==0 +Blend_final=0 +elif $Choix_Couleur==1 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 8,2 +Blend_final=1 +elif $Choix_Couleur==2 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 16,2 +Blend_final=1 +elif $Choix_Couleur==3 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 32,2 +Blend_final=1 +elif $Choix_Couleur==4 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 64,2 +Blend_final=1 +elif $Choix_Couleur==5 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 8,2 +dilate_circ[-2] 2 +blur[-2] 2 +Blend_final=1 +elif $Choix_Couleur==6 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 16,2 +dilate_circ[-2] 4 +blur[-2] 2 +Blend_final=1 +elif $Choix_Couleur==7 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 32,2 +dilate_circ[-2] 8 +blur[-2] 2 +Blend_final=1 +elif $Choix_Couleur==8 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 64,2 +dilate_circ[-2] 16 +blur[-2] 2 +Blend_final=1 +elif $Choix_Couleur==9 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 8,2 +dilate_circ[-2] 2 +blur[-2] 2 +Blend_final=2 +elif $Choix_Couleur==10 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 16,2 +dilate_circ[-2] 4 +blur[-2] 2 +Blend_final=2 +elif $Choix_Couleur==11 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 32,2 +dilate_circ[-2] 8 +blur[-2] 2 +Blend_final=2 +elif $Choix_Couleur==12 ++Je_passe_l_hiver_en_Floride[-1] +topographic_map[-2] 64,2 +dilate_circ[-2] 16 +blur[-2] 2 +Blend_final=2 +fi +if $R_C1+$V_C1+$B_C1==765 +C1_blanc=1 +B_C1=254 +fi +l[-1] +split_opacity[-1] +l[-1] +wh={w},{h} +norm[-1] +if $Anti_Aliasing +r[-1] {100*$f}%,{100*$f}%,1,1,3 +fi +l[-1] +repeat $Repetition +b[-1] $r +unsharp[-1] $r,{$Densite_A} +c[-1] 0,255 +done +smooth[-1] 100,0.1,1,{$f*$Edges},{$f*$Coherence} +->=[-1] {100-$Threshold}% +done +if $Minimal_Area<0 +area_fg[-1] 0,0 +gt[-1] {$f*$Minimal_Area*$Minimal_Area} +elif $Minimal_Area>0 +-==[-1] 0 +area_fg[-1] 0,0 +gt[-1] {$f*$Minimal_Area*$Minimal_Area} +-==[-1] 0 +fi +n[-1] 0,255 +to_rgb[-1] +if $Blend_final==0 +replace_color[-1] 0,0,0,0,0,$R_C1,$V_C1,$B_C1 +replace_color[-1] 0,0,255,255,255,$R_C2,$V_C2,$B_C2 +if $C1_blanc==1 +replace_color[-1] 0,0,255,255,254,255,255,255 +fi +fi +if $Anti_Aliasing +r[-1] $wh,1,3,2 +else +r[-1] $wh +fi +done +a[-1] c +done +if $Blend_final==1 +samj_blend_20220419[-1,-2] add +replace_color[-1] 0,0,255,255,255,$R_C2,$V_C2,$B_C2 +elif $Blend_final==2 +$wh,1,3 +to_rgb[-1] +replace_color[-1] 0,0,0,0,0,$R_C2,$V_C2,$B_C2 +=>[-3] mode(add),name($nm" [couleurs]"),pos($pos) +=>[-2] name($nm" [gravure]"),pos($pos) +fi +engrave_modifie : +Examples=$1 +Radius=$2 +Densite_A=$3 +Edges=$4 +Coherence=$5 +Threshold=$6 +Minimal_Area=$7 +Repetition=$8 +Anti_Aliasing=$9 +if $Examples==1 +Radius={0.475+{$Radius/20}} +Densite_A={3.8+{$Densite_A/20}} +Edges/=20 +Coherence={10-{$Coherence/20}} +Threshold={38+{$Threshold/20}} +Minimal_Area/=20 +Repetition={55-{$Repetition/10}} +Anti_Aliasing=1 +elif $Examples==2 +Radius={0.275+{$Radius/20}} +Densite_A={2.3+{$Densite_A/20}} +Edges/=20 +Coherence={10-{$Coherence/20}} +Threshold={38+{$Threshold/20}} +Minimal_Area/=20 +Repetition={55-{$Repetition/10}} +Anti_Aliasing=1 +elif $Examples==3 +Radius={0.475+{$Radius/20}} +Densite_A={3.8+{$Densite_A/20}} +Edges/=20 +Coherence={7-{$Coherence/20}} +Threshold={48+{$Threshold/20}} +Minimal_Area=-100 +Repetition={20-{$Repetition/10}} +Anti_Aliasing=1 +elif $Examples==4 +Radius={0.175+{$Radius/20}} +Densite_A={12-{$Densite_A/2}} +Edges/=20 +Coherence={10-{$Coherence/20}} +Threshold={38+{$Threshold/20}} +Minimal_Area/=20 +Repetition={30-{$Repetition/10}} +Anti_Aliasing=3 +elif $Examples==5 +Radius={1.975+{$Radius/20}} +Densite_A={1.8+{$Densite_A/20}} +Edges/=20 +Coherence={2-{$Coherence/20}} +Threshold={18+{$Threshold/20}} +Minimal_Area=-100 +Repetition={55-{$Repetition/10}} +Anti_Aliasing=2 +elif $Examples==6 +Radius={0.975+{$Radius/20}} +Densite_A={2.3+{$Densite_A/20}} +Edges/=20 +Coherence={10-{$Coherence/20}} +Threshold={28+{$Threshold/20}} +Minimal_Area/=20 +Repetition={55-{$Repetition/10}} +Anti_Aliasing=1 +elif $Examples==7 +Radius={0.475+{$Radius/20}} +Densite_A={3.8+{$Densite_A/20}} +Edges/=20 +Coherence={10-{$Coherence/20}} +Threshold={38+{$Threshold/20}} +Minimal_Area/=20 +Repetition={-5+{$Repetition/10}} +Anti_Aliasing=1 +fi +f={arg(1+$Anti_Aliasing,1,1.5,2,3)} +r={$f*$Radius} +nm=${-gui_layer_name} +pos=${-gui_layer_pos} +l[0] +split_opacity +l[0] +wh={w},{h} +norm +if $Anti_Aliasing +r {100*$f}%,{100*$f}%,1,1,3 +fi +l[0] +repeat $Repetition +b $r +unsharp $r,{$Densite_A} +c 0,255 +done +smooth 100,0.1,1,{$f*$Edges},{$f*$Coherence} +->= {100-$Threshold}% +done +if $Minimal_Area<0 +area_fg 0,0 +gt {$f*$Minimal_Area*$Minimal_Area} +elif $Minimal_Area>0 +-== 0 +area_fg 0,0 +gt {$f*$Minimal_Area*$Minimal_Area} +-== 0 +fi +* 255 +if $Anti_Aliasing +r $wh,1,1,2 +fi +done +a c +done +samj_Grid_BW_Color : +Index=0 +repeat $! +Index-=1 +samj_Base_Grid_BW_Color[$Index] $1,$2,$3,$4,$5,$6,$7,$8,$9,$10 +done +samj_Base_Grid_BW_Color : +n[-1] 0,255 +if $9==1 ++Je_passe_l_hiver_en_Floride[-1] +if $3==4 Larg={w} Haut={h} resize[-2] {$Larg/$4},{$Haut/$5} resize[-2] $Larg,$Haut fi +fi +blur[-1] $1 +to_rgba[-1] +if $3==4 Larg={w} Haut={h} resize[-1] {$Larg/$4},{$Haut/$5} resize[-1] $Larg,$Haut fi +map[-1] hocuspocus,1 +smooth[-1] $2 +split[-1] c +rm[-1--11] +c[-1] 0,$6 +if $7==1 negate[-1] fi +autoindex[-1] $8 +if $3==1 +imagegrid[-1] $4,$5 +elif $3==2 +imagegrid_triangular[-1] {$4+2},{$5+2},0,1,0,0,0,255 +elif $3==3 +imagegrid_hexagonal[-1] {round(w/{6+$4})},0.1,1 +elif $3==5 +imagegrid_triangular[-1] {$4+2},{$5+2},0,0,0,0,0,255 +elif $3==6 +imagegrid_hexagonal[-1] {round(w/{6+$4})},0,1 +fi +n[-1] 0,255 +if $9==1 +autoindex[-2] {$10} +if $3==1 +imagegrid[-2] $4,$5 +elif $3==2 +imagegrid_triangular[-2] {$4+2},{$5+2},0,1,0,0,0,255 +elif $3==3 +imagegrid_hexagonal[-2] {round(w/{6+$4})},0.1,1 +elif $3==5 +imagegrid_triangular[-2] {$4+2},{$5+2},0,0,0,0,0,255 +elif $3==6 +imagegrid_hexagonal[-2] {round(w/{6+$4})},0,1 +fi +rv[-1,-2] +samj_blend_20220419[-1,-2] grainmerge +fi +XY_hardsketchbw_samj : +XY=$1 +Amplitude=$2 +Density=$3 +Smoothness=$4 +Opacity=$5 +Edge=$6 +Fast_approximation=$7 +Negative=$8 +Calques=$9 +Octave_Sharpening=$10 +R_Transparence=$11 +V_Transparence=$12 +B_Transparence=$13 +A_Transparence=$14 +Remplir=$15 +Largeur={w} +Hauteur={h} +to_rgba[-1] ++Je_passe_l_hiver_en_Floride[-1] +if $Calques==1 +Je_passe_l_hiver_en_Floride[-1] fi +if $Largeur>$Hauteur +Grande_dimension={$Largeur*1.5} +else +Grande_dimension={$Hauteur*1.5} +fi +Origine_X={round({{{$Grande_dimension}-$Largeur}/2})} +Origine_Y={round({{{$Grande_dimension}-$Hauteur}/2})} +expand_x[-1] $Origine_X,2 +expand_y[-1] $Origine_Y,2 +twirl_ancien_euclidean2polar_ancien_polar2euclidean[-1] $XY,0.5,0.5,1 +fx_hardsketchbw[-1] $Amplitude,$Density,$Smoothness,$Opacity,$Edge,$Fast_approximation,$Negative +twirl_ancien_euclidean2polar_ancien_polar2euclidean[-1] -$XY,0.5,0.5,1 +expand_x[-2] $Origine_X,2 +expand_y[-2] $Origine_Y,2 +twirl_ancien_euclidean2polar_ancien_polar2euclidean[-2] -$XY,0.5,0.5,1 +fx_hardsketchbw[-2] $Amplitude,$Density,$Smoothness,$Opacity,$Edge,$Fast_approximation,$Negative +twirl_ancien_euclidean2polar_ancien_polar2euclidean[-2] $XY,0.5,0.5,1 +samj_blend_20220419[-1,-2] average,1,0 +crop[-1] $Origine_X,$Origine_Y,{$Largeur+$Origine_X-1},{$Hauteur+$Origine_Y-1} +if $Octave_Sharpening==1 +fx_unsharp_octave 4,5,3,0,0,0,24,0 +fi +if $Calques==1 +fx_hardsketchbw[-2] $Amplitude,$Density,$Smoothness,$Opacity,$Edge,$Fast_approximation,$Negative +rv[-1,-2] +fi +if $Remplir==1 +$Largeur,$Hauteur,1,4 +fill_color[-1] $R_Transparence,$V_Transparence,$B_Transparence,$A_Transparence +if $Calques==1 +rv[-1,-2] +fi +samj_blend_20220419[-1,-2] screen,1,1 +if $Calques==1 +rv[-1,-2] +fi +fi +samj_rien_colors : +Je_passe_l_hiver_en_Floride[-1] +samj_Masques_Noir_Et_Blanc : +to_graya +blur $1 +replace_color $2%,0,255,255,0,0 +replace_color {100-$2}%,0,0,255,0,255 ++negate +samj_Masques_Noir_Et_Blanc_Preview : +samj_Masques_Noir_Et_Blanc $1,$2 +blend alpha +samj_NB_EdgesO_Engrave : ++Je_passe_l_hiver_en_Floride[-1] +pow[-2] $12 +fx_edge_offsets[-2] $1,$2,$3,$4,0 +fx_engrave[-1,-2] $5,$6,$7,$8,$9,$10,$11,0,10,1,0,0,0,1 +samj_blend_20220419[-1,-2] multiply,1,1 +samj_scintillements : +Exemple=$1 +dog_sigma1=$2 +dog_sigma2={$3/10} +dog_Iterations=$4 +Variation_noise=$5 +Type_noise=$6 +Amplitude_circle=$7 +AmplitudeA=$8 +AmplitudeB=$9 +Angle=$10 +Amplitude_ln=$11 +Radius_ln=$12 +Neighborhood_smoothness_ln=$13 +Average_smoothness_ln=$14 +Constrain_values_ln=$15 +Channel_ln=$16 +Inverser_couleur=$17 +Degradation_pow={1+{$18/100}} +to_rgb[-1] +if $Exemple==1 +Variation_noise=70 +Amplitude_circle=3 +Angle=0 +elif $Exemple==2 +Variation_noise=70 +Amplitude_circle=3 +Angle=40 +elif $Exemple==3 +Variation_noise=70 +Amplitude_circle=3 +Angle=80 +elif $Exemple==4 +fill_color[-1] 0,0,0 +noise[-1] $Variation_noise,$Type_noise +norm[-1] +elif $Exemple==5 +Variation_noise=2 +fill_color[-1] 0,0,0 +noise[-1] $Variation_noise,$Type_noise +norm[-1] +elif $Exemple==6 +fill_color[-1] 0,0,0 +noise[-1] $Variation_noise,$Type_noise +norm[-1] +Amplitude_circle+=25 +fi +repeat $dog_Iterations +dog[-1] $dog_sigma1%,$dog_sigma2% +done +{w},{h},1 +noise[-1] $Variation_noise,$Type_noise +r[-1] [-2] +n[-1] 0,1 +*[-1,-2] +_circle_1610 $Amplitude_circle +dilate[-2] [-1] +rm[-1] ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +blur_linear[-1] $AmplitudeA,{$AmplitudeB*$AmplitudeA/100},$Angle,1 +blur_linear[-2] $AmplitudeA,{$AmplitudeB*$AmplitudeA/100},{$Angle+120},1 +blur_linear[-3] $AmplitudeA,{$AmplitudeB*$AmplitudeA/100},{$Angle+240},1 +n[-1,-2,-3] 0,255 +fx_blend_average_all[-1,-2,-3] 2 +fx_normalize_local[-1] $Amplitude_ln,$Radius_ln,$Neighborhood_smoothness_ln,$Average_smoothness_ln,$Constrain_values_ln,$Channel_ln +if $Degradation_pow!=1 +pow[-1] $Degradation_pow +n[-1] 0,255 +fi +if $Inverser_couleur==1 negate[-1] fi +_circle_1610 : +if $1%2==0 +i 2,2 +else +i 1 +fi ++[-1] 1 +r[-1] $1,$1,1,1,0,0,0.5,0.5 +distance[-1] 1 +n[-1] 0,1 +sqrt[-1] +c[-1] 0.85,0.86 +*[-1] -1 +n[-1] 0,1 +samj_64_Couleurs_Max: +to_rgb +blur $3 +sharpen $4 +if $6==0 +index=0 +srand $1 +{$2*16},{$2*16},1,3 +fx_array_color[-1] $2,1,1 +elif $6==1 ++colormap $2 +elif $6==2 +16,16,1,3 +fill_color[-1] 0,0,0 +16,16,1,3 +fill_color[-1] 255,255,255 +append_tiles[-1,-2] 2,1 +elif $6==3 +16,16,1,3 +fill_color[-1] 255,255,255 +16,16,1,3 +fill_color[-1] 0,0,0 +append_tiles[-1,-2] 2,1 +elif $6==4 +{$2*16},{$2*16},1,1,4 +fx_linear_gradient[-1] $7,$8,$9,255,$10,$11,$12,255,0,0,0,100,2 +elif $6==5 +{$2*16},{$2*16},1,1,4 +fx_linear_gradient[-1] $7,$8,$9,255,$10,$11,$12,255,1,0,0,100,2 +fi +resize[-1] 64,1 +if $5==1 to_gray[0] fi +n[0] 0,255 +to_rgb +map_clut[0] [-1] +rm[-1] +autoindex[0] $2 +n 0,255 +samj_test_9_colors : +if $28>0 blur $28 fi +if $29>0 sharpen $29 fi +samj9colorsV2 $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27 +samj9colorsV2: +skip ${1=0},${2=0},${3=0},${4=0},${5=128},${6=0},${7=0},${8=255},${9=0},${10=173},${11=245},${12=47},${13=255},${14=255},${15=0},${16=255},${17=218},${18=0},${19=255},${20=165},${21=0},${22=255},${23=0},${24=0},${25=255},${26=255},${27=255} +to_gray +to_rgba +index=0 +repeat 16 +replace_color 1,0,$index,$index,$index,255,$1,$2,$3,255 +index+=1 +done +repeat 32 +replace_color 1,0,$index,$index,$index,255,$4,$5,$6,255 +index+=1 +done +repeat 32 +replace_color 1,0,$index,$index,$index,255,$7,$8,$9,255 +index+=1 +done +repeat 32 +replace_color 1,0,$index,$index,$index,255,$10,$11,$12,255 +index+=1 +done +repeat 32 +replace_color 1,0,$index,$index,$index,255,$13,$14,$15,255 +index+=1 +done +repeat 32 +replace_color 1,0,$index,$index,$index,255,$16,$17,$18,255 +index+=1 +done +repeat 32 +replace_color 1,0,$index,$index,$index,255,$19,$20,$21,255 +index+=1 +done +repeat 32 +replace_color 1,0,$index,$index,$index,255,$22,$23,$24,255 +index+=1 +done +repeat 16 +replace_color 1,0,$index,$index,$index,255,$25,$26,$27,255 +index+=1 +done +samj_At06A_2017_VarCouleurs : +to_rgba[-1] +pow[-1] $1 +n[-1] 0,{{iM}-{im}} +c[-1] {{iM}/100*$2},{iM} +n[-1] 0,{iM} +c[-1] 0,{{iM}/100*$3} +n[-1] 0,255 +if $4==1 +to_graya[-1] +elif $4==2 ++Je_passe_l_hiver_en_Floride[-1] +fx_decompose_channels[-1] 7,0,1,0 +remove[-1,-2] +samj_blend_20220419[-1,-2] alpha +fi +if $5==1 n[-1] 0,255 fi +to_rgba[-1] +samj_Color_Palettes : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Angle_inclinaison=$3 +Rayon_Cercle_Centre={round({w*$4/{100}})} +Nb_Circles_Surrounding=$5 +Angle_Decalage=$6 +Variation_Increment_Anneaux=$7 +R_val=$8 +G_val=$9 +B_val=$10 +Remplir_Couleur_Base=$11 +Matrices_RGB=$12 +XYZ_Tristimulus=$13 +Choix=0 +Outline_Reference_Color=$14 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_Anneaux={2*4} +R_val_comp={255-$R_val} +G_val_comp={255-$G_val} +B_val_comp={255-$B_val} +L_origine=${"samj_RGB_to_LCH_or_Lab[] 1,"{/$R_val}","{/$G_val}","{/$B_val}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""} +C_origine=${"samj_RGB_to_LCH_or_Lab[] 2,"{/$R_val}","{/$G_val}","{/$B_val}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""} +H_origine=${"samj_RGB_to_LCH_or_Lab[] 3,"{/$R_val}","{/$G_val}","{/$B_val}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""} +L_origine25={$L_origine+25} +if $L_origine25>100 L_origine25-=100 fi +L_origine50={$L_origine+50} +if $L_origine50>100 L_origine50-=100 fi +L_origine75={$L_origine+75} +if $L_origine75>100 L_origine75-=100 fi +L_origine_comp=${"samj_RGB_to_LCH_or_Lab[] 1,"{/$R_val_comp}","{/$G_val_comp}","{/$B_val_comp}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""} +C_origine_comp=${"samj_RGB_to_LCH_or_Lab[] 2,"{/$R_val_comp}","{/$G_val_comp}","{/$B_val_comp}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""} +H_origine_comp=${"samj_RGB_to_LCH_or_Lab[] 3,"{/$R_val_comp}","{/$G_val_comp}","{/$B_val_comp}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""} +L_origine_comp25={$L_origine_comp+25} +if $L_origine_comp25>100 L_origine_comp25-=100 fi +L_origine_comp50={$L_origine_comp+50} +if $L_origine_comp50>100 L_origine_comp50-=100 fi +L_origine_comp75={$L_origine_comp+75} +if $L_origine_comp75>100 L_origine_comp75-=100 fi +to_rgba[-1] +if $Remplir_Couleur_Base==1 fill_color[-1] $R_val,$G_val,$B_val,255 fi +Angle_Theta={pi/$Nb_Circles_Surrounding} +if $Rayon_Cercle_Centre<10 +Rayon_Cercle_Centre=10 +fi +Rayon_Cercle_Exterieur={$Rayon_Cercle_Centre*((1+(sin($Angle_Theta))))/(1-(sin($Angle_Theta)))} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre+$Rayon_Cercles_Ext} +Rayon_Tang={{{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}}^0.5} +Nb_boucles=0 +X_ext=0 +Y_ext=0 +Angle=0 +Angle_Decalage_En_Cours=0 +Nb_boucles_anneaux=0 +Rayon_Cercle_Centre_En_Cours=0 +R_en_cours=0 +G_en_cours=0 +B_en_cours=0 +A_en_cours=255 +L_val=0 +L_val_comp=0 +repeat $Nb_Anneaux +Nb_boucles=0 +Angle_Decalage_En_Cours={360/$Nb_Circles_Surrounding*$Angle_Decalage*$Nb_boucles_anneaux} +if $Nb_boucles_anneaux==0 +Rayon_Cercle_Centre_En_Cours={$Rayon_Cercle_Centre} +else +Rayon_Cercle_Centre_En_Cours={$Rayon_Tang+($Rayon_Cercles_Ext*(0.865+$Variation_Increment_Anneaux/100))} +fi +Rayon_Cercle_Exterieur=$Rayon_Cercle_Centre_En_Cours*{{1+{sin($Angle_Theta)}}}/{1-{sin($Angle_Theta)}} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre_En_Cours}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre_En_Cours+$Rayon_Cercles_Ext} +Rayon_Tang={{{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}}^0.5} +repeat $Nb_Circles_Surrounding +Erreur_Couleur=0 +Angle={$Nb_boucles*(360/$Nb_Circles_Surrounding)} +X_ext={$X+($Rayon_Centres_C_Ext*(cos((pi/180*($Angle+$Angle_inclinaison+$Angle_Decalage_En_Cours)))))} +Y_ext={$Y+($Rayon_Centres_C_Ext*(sin((pi/180*($Angle+$Angle_inclinaison+$Angle_Decalage_En_Cours)))))} +if {$Nb_boucles_anneaux%2}==0 +H_val={$H_origine+$Angle} +if $Nb_boucles_anneaux==0 +L_val=$L_origine75 +elif $Nb_boucles_anneaux==2 +L_val=$L_origine50 +elif $Nb_boucles_anneaux==4 +L_val=$L_origine25 +elif $Nb_boucles_anneaux==6 +L_val=$L_origine +fi +R_en_cours={int(${"samj_LCH_or_Lab_to_RGB[] 1,"{/$L_val}","{/$C_origine}","{/$H_val}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +G_en_cours={int(${"samj_LCH_or_Lab_to_RGB[] 2,"{/$L_val}","{/$C_origine}","{/$H_val}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +B_en_cours={int(${"samj_LCH_or_Lab_to_RGB[] 3,"{/$L_val}","{/$C_origine}","{/$H_val}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +else +H_val_comp={$H_origine_comp+$Angle} +if $Nb_boucles_anneaux==1 +L_val_comp=$L_origine_comp75 +elif $Nb_boucles_anneaux==3 +L_val_comp=$L_origine_comp50 +elif $Nb_boucles_anneaux==5 +L_val_comp=$L_origine_comp25 +elif $Nb_boucles_anneaux==7 +L_val_comp=$L_origine_comp +fi +R_en_cours={int(${"samj_LCH_or_Lab_to_RGB[] 1,"{/$L_val_comp}","{/$C_origine_comp}","{/$H_val_comp}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +G_en_cours={int(${"samj_LCH_or_Lab_to_RGB[] 2,"{/$L_val_comp}","{/$C_origine_comp}","{/$H_val_comp}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +B_en_cours={int(${"samj_LCH_or_Lab_to_RGB[] 3,"{/$L_val_comp}","{/$C_origine_comp}","{/$H_val_comp}","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +fi +if $R_en_cours<0 Erreur_Couleur=1 fi +if $R_en_cours>255 Erreur_Couleur=1 fi +if $G_en_cours<0 Erreur_Couleur=1 fi +if $G_en_cours>255 Erreur_Couleur=1 fi +if $B_en_cours<0 Erreur_Couleur=1 fi +if $B_en_cours>255 Erreur_Couleur=1 fi +if $Erreur_Couleur==0 circle[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext,1,$R_en_cours,$G_en_cours,$B_en_cours,$A_en_cours fi +if $Nb_boucles==0&&$Nb_boucles_anneaux==6&&$Outline_Reference_Color==1 +circle[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext,1,0xFFFFFFFF,0,0,0,255 +circle[-1] $X_ext,$Y_ext,{$Rayon_Cercles_Ext/2},1,$R_val,$G_val,$B_val,$A_en_cours +circle[-1] $X_ext,$Y_ext,{$Rayon_Cercles_Ext/2},1,0xFFFFFFFF,255,255,255,255 +fi +Nb_boucles+=1 +done +Nb_boucles_anneaux+=1 +done +samj_rien_contours : +Je_passe_l_hiver_en_Floride[-1] +Couleurs_Metalliques : +Transparence=$1 +Rendu=$2 +Amplitude=$3 +Noise_type=$4 +Noise_Channel=7 +Value_range=$5 +Double_effet=$6 +Local_normalization_Amplitude=$7 +Radius=$8 +Neighborhood_smoothness=$9 +Average_smoothness=$10 +Constrain_values=$11 +Local_normalization_Channel=$12 +boost_fade_Amplitude=$13 +Utiliser_Photocomix_Options=$14 +Pencilbw_Size=$15 +Pencilbw_Amplitude=$16 +Blend_soft_light_Opacity=$17 +Blend_soft_light_Revert_layers=$18 +foreach { +if $Rendu==0 +Rendu_local_orientation_channels=11 +elif $Rendu==1 +Rendu_local_orientation_channels=16 +elif $Rendu==2 +Rendu_local_orientation_channels=25 +elif $Rendu==3 +Rendu_local_orientation_channels=27 +elif $Rendu==4 +Rendu_local_orientation_channels=7 +elif $Rendu==5 +Rendu_local_orientation_channels=2 +elif $Rendu==6 +Rendu_local_orientation_channels=2 +fi +if $Transparence==1 +remove_opacity[-1] +fi +if $Utiliser_Photocomix_Options==1 ++pencilbw[-1] $Pencilbw_Size,$Pencilbw_Amplitude +if $Double_effet==1 +fx_normalize_local[-2] $Local_normalization_Amplitude,$Radius,$Neighborhood_smoothness,$Average_smoothness,$Constrain_values,$Local_normalization_Channel +fi +fx_noise[-2] $Amplitude,$Noise_type,$Noise_Channel,$Value_range +fx_local_orientation[-2] 0,0,100,0,$Rendu_local_orientation_channels +fx_normalize_local[-2] $Local_normalization_Amplitude,$Radius,$Neighborhood_smoothness,$Average_smoothness,$Constrain_values,$Local_normalization_Channel +if $boost_fade_Amplitude>0 +fx_boost_fade[-2] $boost_fade_Amplitude +fi +samj_blend_20220419[-2,-1] softlight,$Blend_soft_light_Opacity,$Blend_soft_light_Revert_layers +else +if $Double_effet==1 +fx_normalize_local[-1] $Local_normalization_Amplitude,$Radius,$Neighborhood_smoothness,$Average_smoothness,$Constrain_values,$Local_normalization_Channel +fi +fx_noise[-1] $Amplitude,$Noise_type,$Noise_Channel,$Value_range +fx_local_orientation[-1] 0,0,100,0,$Rendu_local_orientation_channels +fx_normalize_local[-1] $Local_normalization_Amplitude,$Radius,$Neighborhood_smoothness,$Average_smoothness,$Constrain_values,$Local_normalization_Channel +if $boost_fade_Amplitude>0 +fx_boost_fade[-1] $boost_fade_Amplitude +fi +fi +} +Couleurs_Metalliques_preview : +gui_split_preview "Couleurs_Metalliques ${1--2}",$-1 +samj_Dorure: +if $12==1 +Largeur={w} +Hauteur={h} +if w>h +resize 800,{h/w*800} +else +resize {w/h*800},800 +fi +fi +if $10==1 negate fi +samj_Fond_Or $13,$14,$15,$16,$17,$18 +fx_light_relief $1,$2,$3,$4,$5,$6,$7,$8,$9,0,0 +if $11>100 smooth 100,0.7,0.3,0.6 smooth {$11-100},0.7,0.3,0.6 else smooth $11,0.7,0.3,0.6 fi +if $12==1 resize $Largeur,$Hauteur smooth 100,0.7,0.3,0.6 sharpen 50 fi +samj_Fond_Or: +skip ${1=0},${2=0},${3=45},${4=64},${5=255},${6=0} +blur $1 +sharpen $2 +n 0,255 ++fx_linear_gradient 255,208,170,255,220,92,1,255,0,$3,0,100,0 +autoindex[-1] $4 +autoindex[0] $5 +if $6==1 to_gray[0] fi +resize[-1] 64,1 +to_rgb +n 0,255 +negate[0] +map_clut[0] [-1] +rm[-1] +samj_Remplir_Fill_Flood : +foreach { +to_rgba +flood $1%,$2%,0,$7,0,1,$3,$4,$5,$6 +} +samj_test_shapeprevalent : +foreach { ++blur. $1 +quantize. $2,1,1 +quantize_area. $3 +n. 0,255 +blend shapeprevalent +} +samj_Topographie_Eliminate_Contour_Lines : +foreach { +to_rgba ++dilate_circ $1 +erode_circ. $1 +replace_color. $5%,0,$2,$3,$4,255,0,0,0,0 +replace_color. $9%,0,255,255,255,255,$6,$7,$8,255 +replace_color. 0,0,0,0,0,0,$2,$3,$4,255 +replace_color.. $13%,0,$10,$11,$12,255,0,0,0,0 +replace_color.. $17%,0,$14,$15,$16,255,0,0,0,0 +replace_color.. $21%,0,$18,$19,$20,255,0,0,0,0 +replace_color.. $25%,0,$22,$23,$24,255,0,0,0,0 +rv +blend alpha +if $26 +dilate_circ 2 +erode_circ 2 +fi +} +samj_Topographie_Eliminate_Contour_Lines_preview : +gui_split_preview "samj_Topographie_Eliminate_Contour_Lines $*",$-1 +samj_Valeur_Moyenne_LCH : +Echantillon=$1 +Matrices_RGB=$2 +XYZ_Tristimulus=$3 +filename="$4//$5" +Choix=0 ++resize[-1] $Echantillon,{h/w*$Echantillon} +quantize[-1] 1,1,0 +Val_R={i0} +Val_V={i1} +Val_B={i2} +Valeur_L={round(${"samj_RGB_to_LCH_or_Lab[] 1,"$Val_R","$Val_V","$Val_B","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +Valeur_C={round(${"samj_RGB_to_LCH_or_Lab[] 2,"$Val_R","$Val_V","$Val_B","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +Valeur_H={round(${"samj_RGB_to_LCH_or_Lab[] 3,"$Val_R","$Val_V","$Val_B","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +rm[-1] +200,200,1,4 +fill_color[-1] $Val_R,$Val_V,$Val_B,255 +echo_file $filename,L{$Valeur_L}C{$Valeur_C}H{$Valeur_H} +text_outline[-1] R{round($Val_R)}V{round($Val_V)}B{round($Val_B)},2,2,23,2,1,255 +text_outline[-1] L{$Valeur_L}C{$Valeur_C}H{$Valeur_H},2,22,23,2,1,255 +rv[-2,-1] +samj_Valeur_Moyenne_LCH_Preview : +Echantillon=$1 +Matrices_RGB=$2 +XYZ_Tristimulus=$3 +Choix=0 ++resize[-1] $Echantillon,{h/w*$Echantillon} +quantize[-1] 1,1,0 +Val_R={i0} +Val_V={i1} +Val_B={i2} +Valeur_L={round(${"samj_RGB_to_LCH_or_Lab[] 1,"$Val_R","$Val_V","$Val_B","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +Valeur_C={round(${"samj_RGB_to_LCH_or_Lab[] 2,"$Val_R","$Val_V","$Val_B","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +Valeur_H={round(${"samj_RGB_to_LCH_or_Lab[] 3,"$Val_R","$Val_V","$Val_B","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +to_rgba[-1,-2] +samj_blend_20220419[-2,-1] alpha,1,1 +text_outline[-1] "Attention Couleur Selon Apercu",2,22,23,2,1,255 +samj_Valeur_Moyenne_LCH_CSV : +Echantillon=$1 +Matrices_RGB=$2 +XYZ_Tristimulus=$3 +filename="$4//$5" +Img=$6 +Choix=0 ++resize[-1] $Echantillon,{h/w*$Echantillon} +quantize[-1] 1,1,0 +Val_R={i0} +Val_V={i1} +Val_B={i2} +Valeur_L={round(${"samj_RGB_to_LCH_or_Lab[] 1,"$Val_R","$Val_V","$Val_B","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +Valeur_C={round(${"samj_RGB_to_LCH_or_Lab[] 2,"$Val_R","$Val_V","$Val_B","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +Valeur_H={round(${"samj_RGB_to_LCH_or_Lab[] 3,"$Val_R","$Val_V","$Val_B","{/$Matrices_RGB}","{/$XYZ_Tristimulus}","{/$Choix}""})} +echo_file $filename,$Img,{$Valeur_L},{$Valeur_C},{$Valeur_H} +rm[-1] +samj_Variations_RVB : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Angle_inclinaison=$3 +Rayon_Cercle_Centre={round({w*$4/{100}})} +Angle_Decalage=$5 +Variation_Increment_Anneaux=$6 +R_val=$7 +G_val=$8 +B_val=$9 +Remplir_Couleur_Base=$10 +Outline_Reference_Color=$11 +Type_Variation=$12 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_Circles_Surrounding=32 +Nb_Anneaux=8 +to_rgba[-1] +if $Remplir_Couleur_Base==1 fill_color[-1] $R_val,$G_val,$B_val,255 fi +Angle_Theta={pi/$Nb_Circles_Surrounding} +if $Rayon_Cercle_Centre<10 +Rayon_Cercle_Centre=10 +fi +Rayon_Cercle_Exterieur={$Rayon_Cercle_Centre*((1+(sin($Angle_Theta))))/(1-(sin($Angle_Theta)))} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre+$Rayon_Cercles_Ext} +Rayon_Tang={{{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}}^0.5} +Nb_boucles=0 +X_ext=0 +Y_ext=0 +Angle=0 +Angle_Decalage_En_Cours=0 +Nb_boucles_anneaux=0 +Rayon_Cercle_Centre_En_Cours=0 +R_en_cours=$R_val +G_en_cours=$G_val +B_en_cours=$B_val +A_en_cours=255 +Variation_RVB=0 +repeat $Nb_Anneaux +Nb_boucles=0 +Angle_Decalage_En_Cours={360/$Nb_Circles_Surrounding*$Angle_Decalage*$Nb_boucles_anneaux} +if $Nb_boucles_anneaux==0 +Rayon_Cercle_Centre_En_Cours={$Rayon_Cercle_Centre} +else +Rayon_Cercle_Centre_En_Cours={$Rayon_Tang+($Rayon_Cercles_Ext*(0.865+$Variation_Increment_Anneaux/100))} +fi +Rayon_Cercle_Exterieur=$Rayon_Cercle_Centre_En_Cours*{{1+{sin($Angle_Theta)}}}/{1-{sin($Angle_Theta)}} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre_En_Cours}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre_En_Cours+$Rayon_Cercles_Ext} +Rayon_Tang={{{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}}^0.5} +repeat $Nb_Circles_Surrounding +Angle={$Nb_boucles*(360/$Nb_Circles_Surrounding)} +X_ext={$X+($Rayon_Centres_C_Ext*(cos((pi/180*($Angle+$Angle_inclinaison+$Angle_Decalage_En_Cours)))))} +Y_ext={$Y+($Rayon_Centres_C_Ext*(sin((pi/180*($Angle+$Angle_inclinaison+$Angle_Decalage_En_Cours)))))} +if $Type_Variation==0 +R_en_cours={abs($R_val-$Variation_RVB)} +G_en_cours={abs($G_val-$Variation_RVB)} +B_en_cours={abs($B_val-$Variation_RVB)} +elif $Type_Variation==1 +R_en_cours={abs($R_val-$Variation_RVB)} +elif $Type_Variation==2 +B_en_cours={abs($G_val-$Variation_RVB)} +elif $Type_Variation==3 +B_en_cours={abs($B_val-$Variation_RVB)} +elif $Type_Variation==4 +R_en_cours={abs($R_val-$Variation_RVB)} +G_en_cours={abs($G_val-$Variation_RVB)} +elif $Type_Variation==5 +R_en_cours={abs($R_val-$Variation_RVB)} +B_en_cours={abs($B_val-$Variation_RVB)} +elif $Type_Variation==6 +G_en_cours={abs($G_val-$Variation_RVB)} +B_en_cours={abs($B_val-$Variation_RVB)} +elif $Type_Variation==7 +R_en_cours={$R_val-$Variation_RVB} +G_en_cours={$G_val-$Variation_RVB} +B_en_cours={$B_val-$Variation_RVB} +elif $Type_Variation==8 +R_en_cours={$R_val-$Variation_RVB} +elif $Type_Variation==9 +B_en_cours={$G_val-$Variation_RVB} +elif $Type_Variation==10 +B_en_cours={$B_val-$Variation_RVB} +elif $Type_Variation==11 +R_en_cours={$R_val-$Variation_RVB} +G_en_cours={$G_val-$Variation_RVB} +elif $Type_Variation==12 +R_en_cours={$R_val-$Variation_RVB} +B_en_cours={$B_val-$Variation_RVB} +elif $Type_Variation==13 +G_en_cours={$G_val-$Variation_RVB} +B_en_cours={$B_val-$Variation_RVB} +elif $Type_Variation==14 +R_en_cours={$R_val+$Variation_RVB} +G_en_cours={$G_val+$Variation_RVB} +B_en_cours={$B_val+$Variation_RVB} +elif $Type_Variation==15 +R_en_cours={$R_val+$Variation_RVB} +elif $Type_Variation==16 +B_en_cours={$G_val+$Variation_RVB} +elif $Type_Variation==17 +B_en_cours={$B_val+$Variation_RVB} +elif $Type_Variation==18 +R_en_cours={$R_val+$Variation_RVB} +G_en_cours={$G_val+$Variation_RVB} +elif $Type_Variation==19 +R_en_cours={$R_val+$Variation_RVB} +B_en_cours={$B_val+$Variation_RVB} +elif $Type_Variation==20 +G_en_cours={$G_val+$Variation_RVB} +B_en_cours={$B_val+$Variation_RVB} +fi +if $R_en_cours<0 R_en_cours=0 fi +if $R_en_cours>255 R_en_cours=255 fi +if $G_en_cours<0 G_en_cours=0 fi +if $G_en_cours>255 G_en_cours=255 fi +if $B_en_cours<0 B_en_cours=0 fi +if $B_en_cours>255 B_en_cours=255 fi +circle[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext,1,$R_en_cours,$G_en_cours,$B_en_cours,$A_en_cours +if $Nb_boucles==0&&$Nb_boucles_anneaux==0&&$Outline_Reference_Color==1 +circle[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext,1,0xFFFFFFFF,0,0,0,255 +circle[-1] $X_ext,$Y_ext,{$Rayon_Cercles_Ext/2},1,0xFFFFFFFF,255,255,255,255 +fi +Nb_boucles+=1 +Variation_RVB+=1 +done +Nb_boucles_anneaux+=1 +done +samj_Carte_De_Repoussage : +if $3>0 blur $3 fi +if $1==0 +(0,1,-1;0,1,-1;0,1,-1) +elif $1==1 +(-1,-1,-1;1,1,1;0,0,0) +elif $1==2 +(-1,1,0;-1,1,0;-1,1,0) +elif $1==3 +(0,0,0;1,1,1;-1,-1,-1) +elif $1==4 +(0,1,0;0,0,0;0,-1,0) +elif $1==5 +(0,0,0;1,0,-1;0,0,0) +elif $1==6 +(0,-1,0;0,0,0;0,1,0) +elif $1==7 +(0,0,0;-1,0,1;0,0,0) +elif $1==8 +(1,0,0;0,0,0;0,0,-1) +elif $1==9 +(0,0,-1;0,0,0;1,0,0) +elif $1==10 +(-1,0,0;0,0,0;0,0,1) +elif $1==11 +(0,0,1;0,0,0;-1,0,0) +elif $1==12 +(2,0,0;0,-1,0;0,0,-1) +elif $1==13 +(0,0,-1;0,-1,0;2,0,0) +elif $1==14 +(-1,0,0;0,-1,0;0,0,2) +elif $1==15 +(0,0,2;0,-1,0;-1,0,0) +elif $1==16 +(1,1,-1;1,3,-1;1,-1,-1) +elif $1==17 +(-1,-1,-1;1,3,-1;1,1,1) +elif $1==18 +(-1,-1,1;-1,3,1;-1,1,1) +elif $1==19 +(1,1,1;-1,3,1;-1,-1,-1) +elif $1==20 +(-2,-1,0;-1,1,1;0,1,2) +elif $1==21 +(0,1,2;-1,1,1;-2,-1,0) +elif $1==22 +(2,1,0;1,1,-1;0,-1,-2) +elif $1==23 +(0,-1,-2;1,1,-1;2,1,0) +elif $1==24 +(1,0,0,0,0;0,1,0,0,0;0,0,0,0,0;0,0,0,-1,0;0,0,0,0,-1) +elif $1==25 +(0,0,0,0,1;0,0,0,1,0;0,0,0,0,0;0,-1,0,0,0;-1,0,0,0,0) +elif $1==26 +(-1,0,0,0,0;0,-1,0,0,0;0,0,0,0,0;0,0,0,1,0;0,0,0,0,1) +elif $1==27 +(0,0,0,0,-1;0,0,0,-1,0;0,0,0,0,0;0,1,0,0,0;1,0,0,0,0) +elif $1==28 +(0,1,0,0,0;0,0,1,0,0;0,0,0,0,0;0,0,-1,0,0;0,0,0,-1,0) +elif $1==29 +(0,0,0,0,0;0,0,0,0,1;0,-1,0,1,0;-1,0,0,0,0;0,0,0,0,0) +elif $1==30 +(0,1,0,0,0;0,0,1,0,0;0,0,0,0,0;0,0,-1,0,0;0,0,0,-1,0) +elif $1==31 +(0,0,0,0,0;0,0,0,0,1;0,-1,0,1,0;-1,0,0,0,0;0,0,0,0,0) +elif $1==32 +(1,0,0,0,0,0,0;0,1,0,0,0,0,0;0,0,1,0,0,0,0;0,0,0,0,0,0,0;0,0,0,0,-1,0,0;0,0,0,0,0,-1,0;0,0,0,0,0,0,-1) +elif $1==33 +(0,0,0,0,0,0,1;0,0,0,0,0,1,0;0,0,0,0,1,0,0;0,0,0,0,0,0,0;0,0,-1,0,0,0,0;0,-1,0,0,0,0,0;-1,0,0,0,0,0,0) +elif $1==34 +(-1,0,0,0,0,0,0;0,-1,0,0,0,0,0;0,0,-1,0,0,0,0;0,0,0,0,0,0,0;0,0,0,0,1,0,0;0,0,0,0,0,1,0;0,0,0,0,0,0,1) +elif $1==35 +(0,0,0,0,0,0,-1;0,0,0,0,0,-1,0;0,0,0,0,-1,0,0;0,0,0,0,0,0,0;0,0,1,0,0,0,0;0,1,0,0,0,0,0;1,0,0,0,0,0,0) +elif $1==36 +(-1,0,0;0,1,0;0,0,0) +elif $1==37 +(0,0,0;0,1,0;-1,0,0) +elif $1==38 +(0,0,0;0,1,0;0,0,-1) +elif $1==39 +(0,0,-1;0,1,0;0,0,0) +elif $1==40 +(-1,-1,-1,-1,0;-1,-1,-1,0,1;-1,-1,0,1,1;-1,0,1,1,1;0,1,1,1,1) +elif $1==41 +(0,1,1,1,1;-1,0,1,1,1;-1,-1,0,1,1;-1,-1,-1,0,1;-1,-1,-1,-1,0) +elif $1==42 +(1,1,1,1,0;1,1,1,0,-1;1,1,0,-1,-1;1,0,-1,-1,-1;0,-1,-1,-1,-1) +elif $1==43 +(0,-1,-1,-1,-1;1,0,-1,-1,-1;1,1,0,-1,-1;1,1,1,0,-1;1,1,1,1,0) +elif $1==44 +(-1,-1,0;-1,0,1;0,1,1) +elif $1==45 +(0,1,1;-1,0,1;-1,-1,0) +elif $1==46 +(1,1,0;1,0,-1;0,-1,-1) +elif $1==47 +(0,-1,-1;1,0,-1;1,1,0) +elif $1==48 +(-1,0,0;0,0,0;0,0,1) +elif $1==49 +(0,0,1;0,0,0;-1,0,0) +elif $1==50 +(1,0,0;0,0,0;0,0,-1) +elif $1==51 +(0,0,-1;0,0,0;1,0,0) +elif $1==52 +(-2,-1,0;-1,0,1;0,1,2) +elif $1==53 +(0,1,2;-1,0,1;-2,-1,0) +elif $1==54 +(2,1,0;1,0,-1;0,-1,-2) +elif $1==55 +(0,-1,-2;1,0,-1;2,1,0) +elif $1==56 +(1,1,0,0,0;0,1,1,0,0;1,1,0,-1,-1;0,0,-1,-1,0;0,0,0,-1,-1) +elif $1==57 +(0,0,-1,0,-1;0,0,-1,-1,-1;0,1,0,-1,0;1,1,1,0,0;1,0,1,0,0) +elif $1==58 +(-1,-1,0,0,0;0,-1,-1,0,0;-1,-1,0,1,1;0,0,1,1,0;0,0,0,1,1) +elif $1==59 +(0,0,1,0,1;0,0,1,1,1;0,-1,0,1,0;-1,-1,-1,0,0;-1,0,-1,0,0) +fi +convolve[-2] [-1] +k[-2] +if $4>0 sharpen {$4*100} fi +n 0,255 +if $2==1 to_gray fi +samj_Colored_Outlines : +Axe_blur=$1 +Valeur_blur=$2 +Valeur_isophotes=$3 +Iterations_smooth=$4 +Valeur_dilate=$5 +Couleur_Fond_r=$6 +Couleur_Fond_v=$7 +Couleur_Fond_b=$8 +Couleur_Fond_a=$9 +Largeur_Origine={w} +Hauteur_Origine={h} +to_rgba[-1] +if $Axe_blur==0 +blur[-1] xy,{$Valeur_blur} +elif $Axe_blur==1 +blur[-1] x,{$Valeur_blur} +elif $Axe_blur==2 +blur[-1] y,{$Valeur_blur} +fi +isophotes[-1] $Valeur_isophotes +if $Iterations_smooth>0 fx_smooth_diffusion[-1] 0.7,0.3,0.6,1.1,15,$Iterations_smooth,2,0,24 fi +dilate_circ[-1] $Valeur_dilate +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] $Couleur_Fond_r,$Couleur_Fond_v,$Couleur_Fond_b,$Couleur_Fond_a +gimp_blend_1651[-2,-1] 1,0,1,0,1 +samj_Coloriage: +Dimension_Max=$1 +Limite=$2 +Flou_Lissage=$3 +Isophotes_Nb_Levels=$4 +Dilatation=$5 +R_a=$6 +V_a=$7 +B_a=$8 +A_a=$9 +Dimensions_Origine=$10 +Largeur_Origine={w} +Hauteur_Origine={h} +OrigineH=0 +OrigineV=-1 +couleur_pixel=0 +rouge_pixel=0 +vert_pixel=0 +bleu_pixel=0 +alpha_pixel=0 +if $Hauteur_Origine>$Largeur_Origine +Largeur_A={round($Largeur_Origine/$Hauteur_Origine*$Dimension_Max)} +Hauteur_A=$Dimension_Max +else +Largeur_A=$Dimension_Max +Hauteur_A={round($Hauteur_Origine/$Largeur_Origine*$Dimension_Max)} +fi +resize[-1] $Largeur_A,$Hauteur_A +n[-1] 0,255 +c[-1] 0,$Limite +n[-1] 0,255 +c[-1] {255-$Limite},255 +n[-1] 0,255 +blur[-1] $Flou_Lissage +isophotes[-1] $Isophotes_Nb_Levels +dilate[-1] $Dilatation +repeat $Hauteur_A +OrigineH=0 +OrigineV+=1 +repeat $Largeur_A +couleur_pixel={I($OrigineH,$OrigineV)} +alpha_pixel={arg(4,$couleur_pixel)} +if $alpha_pixel>0 +point[-1] $OrigineH,$OrigineV,0,1,$R_a,$V_a,$B_a,$A_a +fi +OrigineH+=1 +done +done +if $Dimensions_Origine==1 resize[-1] $Largeur_Origine,$Hauteur_Origine fi +samj_Coloriage_preview : +samj_Coloriage[-1] 256,$2,$3,$4,$5,$6,$7,$8,$9,0 +samj_Contours_Arrondis : +Iterations=$1 +Val_Quantize=$2 +Val_Blur=$3 +Val_Isophotes=$4 +RGBA=$5 +Val_Dilate_Circ=$6 +to_rgb[-1] +repeat $Iterations +quantize[-1] $Val_Quantize +blur[-1] {$Val_Blur/10} +n[-1] 0,255 +done +isophotes[-1] $Val_Isophotes +if $RGBA==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Val_Dilate_Circ>1 dilate_circ[-1] $Val_Dilate_Circ fi +samj_rien_deformations : +Je_passe_l_hiver_en_Floride[-1] +samj_Contours_Blancs : +i [-1] +if $1==1 +blur[-1,-2] $3 +quantize[-1] $2,1,1 +elif $1==2 +blur[-1,-2] $3 +quantize[-2] $2,1,1 +elif $1==3 +blur[-1,-2] $3 +quantize[-1,-2] $2,1,1 +fi +fx_gradient_norm[-1] $4,$5,$6,$7,$8 +isophotes[-1] 8 +to_graya[-1] +repeat $9 +i [-1] +samj_blend_20220419[-1,-2] add +done +fx_segment_watershed[-2] $10,$11,$12,$13 +fx_edge_offsets[-2] $14,$15,$16,$17,1 +to_rgba[-1,-2] +replace_color[-1,-2] 0%,0,0,0,0,255,0,0,0,0 +samj_blend_20220419[-1,-2] alpha +samj_Contours_Blancs_preview : +gui_split_preview "samj_Contours_Blancs $*",$-1 +samj_Contours_Coins_Vifs : +foreach { +autoindex $1 dilate $2 +if $3==1 +isophotes 40 isophotes {$1*2} +else ++erode[-1] 2 dilate[-1] 3 isophotes 40 blend alpha isophotes {$1*2} dilate $3 +fi +if $4==0 +if $6>0 ++pow {1+$5} c[-1] 0,255 dilate[-2] {$6} spread[-2] 1 blur[-2] 2 n[-2] 64,192 pow[-2] {1+$7} blend alpha +else +pow {1+$5} c 0,255 +fi +elif $4==1||$4==2 +repeat 128 +- blend add done +if $4==2 replace_color[-1] 1,0,255,255,255,255,0,0,0,255 fi +if $6>0 ++- dilate[-2] {$6} spread[-2] 1 blur[-2] 2 n[-2] 64,192 pow[-2] {1+$7} blend alpha +fi +fi +if {$8+$9+$10+$11}>0 {w},{h},1,4 fill_color[-1] $8,$9,$10,$11 rv blend alpha fi +} +samj_Contours_Colores : +Puissance=$1 +Edge_threshold=$2 +Couper_Cut=$3 +Dilate_Contours=$4 +Degradation_Spread=$5 +pow[-1] $Puissance +c[-1] 0,255 +fx_segment_watershed[-1] $2,1,0,2,0 ++Je_passe_l_hiver_en_Floride[-1] +fx_gradient_norm[-1] 0,0.5,0,100,0,0 +c[-1] $Couper_Cut,255 +n[-1] 0,255 +if $Dilate_Contours>1 dilate_circ[-1,-2] $Dilate_Contours fi +if $Degradation_Spread>1 spread[-1,-2] $Degradation_Spread fi +samj_blend_20220419[-2,-1] darken,1,0 +samj_Edges_Offsets_Dots : +foreach { ++fx_edge_offsets $1,$2,$3,1,0,2,50,50 +to_rgba[-1] +replace_color[-1] 1,0,255,255,255,255,0,0,0,0 +{w},{h},1,4 +fill_color[-1] 0,0,0,0 +Diam={$4*2} +Dens={6-$5} +IndX=$4 +PosX=0 +PosY=$4 +IncrX={$Diam+$Dens} +repeat {h/$Diam} +repeat w +PosX=$IndX ++crop[-2] $PosX,$PosY,$PosX,$PosY,0 +if {iM}==0 AppliForme=0 else AppliForme=1 fi +rm[-1] +if $AppliForme==1 ++crop[-3] $PosX,$PosY,$PosX,$PosY,0 +circle[-2] $PosX,$PosY,$4,1,{I(#-1)},255 +rm[-1] +IndX+=$IncrX +else +IndX+=$Dens +fi +if $IndX>w break fi +done +IndX=$4 +PosY+=$Diam+$4 +done +mirror x permute yx +IndX=$4 +PosX=0 +PosY=$4 +repeat {h/$Diam} +repeat w +PosX=$IndX ++crop[-2] $PosX,$PosY,$PosX,$PosY,0 +if {iM}==0 AppliForme=0 else AppliForme=1 fi +rm[-1] +if $AppliForme==1 ++crop[-3] $PosX,$PosY,$PosX,$PosY,0 +circle[-2] $PosX,$PosY,$4,1,{I(#-1)},255 +rm[-1] +IndX+=$IncrX +else +IndX+=$Dens +fi +if $IndX>w break fi +done +IndX=$4 +PosY+=$Diam+$4 +done +permute yxzc mirror x +dilate_circ[-1] 3 +rm[-2,-3] +if $6!=5 pow {1+$6} c 0,255 fi +if {$7+$8+$9+$10}>0 {w},{h},1,4 fill_color[-1] $7,$8,$9,$10 rv blend alpha fi +} +samj_Quelques_Isophotes : +Epaisseur=$1 +Precision=$2 +Coeff_Precision_Pixelise=$3 +Coeff_Precision_Flou=$4 +Nb_Isophotes=$5 +Nb_Boucles=0 ++Je_passe_l_hiver_en_Floride[-1] +repeat $Epaisseur +pixelize[-1] {1+round({$Precision+$Epaisseur-$Nb_Boucles}*$Coeff_Precision_Pixelise)},{1+round({$Precision+$Epaisseur-$Nb_Boucles}*$Coeff_Precision_Pixelise)} +blur[-1] {{$Precision+$Epaisseur+$Nb_Boucles}*$Coeff_Precision_Flou} +isophotes[-1] $Nb_Isophotes +if $Nb_Boucles>0 samj_blend_20220419[-1,-2] alpha fi +Nb_Boucles+=1 ++Je_passe_l_hiver_en_Floride[-2] +done +rm[-1,-3] +samj_Quelques_Isophotes_B : +if $3==2 ++Je_passe_l_hiver_en_Floride[-1] +samj_Fonction_Quelques_Isophotes_B[-1] $1,$2,0,$4,$5 +rv[-1,-2] +samj_Fonction_Quelques_Isophotes_B[-1] $1,$2,1,$4,$5 +samj_blend_20220419[-1,-2] alpha +else +samj_Fonction_Quelques_Isophotes_B $1,$2,$3,$4,$5 +fi +samj_Fonction_Quelques_Isophotes_B : +Nb_Decomposition_Couleurs=$1 +Variation_Couleurs=$2 +Type_Variation_Couleurs=$3 +Dilatation=$4 +Nb_Isophotes=$5 +Val_min={im} +Val_max={iM} +Variation_Par_Boucle={{{iM}-{im}}/{$Nb_Decomposition_Couleurs*$Variation_Couleurs}} +Nb_Boucles=0 ++Je_passe_l_hiver_en_Floride[-1] +repeat $Nb_Decomposition_Couleurs +if $Type_Variation_Couleurs==0 +c {$Val_min+{$Variation_Par_Boucle*$Nb_Boucles}},$Val_max +elif $Type_Variation_Couleurs==1 +c $Val_min,{$Val_max-{$Variation_Par_Boucle*$Nb_Boucles}} +fi +n 0,255 +isophotes[-1] $Nb_Isophotes +if $Nb_Boucles>0 +if $Dilatation>0 dilate_circ[-1] {$Dilatation+1} fi +samj_blend_20220419[-1,-2] alpha +fi +Nb_Boucles+=1 ++Je_passe_l_hiver_en_Floride[-2] +done +rm[-1,-3] +samj_Quelques_Isophotes_C : +blur $1 +n $2,$3 +c $4,$5 +n 0,255 +isophotes $6 +repeat $7 ++- +shift[-1] $8,0 +blend alpha ++- +shift[-1] 0,$9 +blend alpha +if $8>-1&&$9>-1 shift[-1] -$8,-$9 fi +if $8<0&&$9<0 shift[-1] {abs($8)},{abs($9)} fi +if $8<0&&$9>-1 shift[-1] {abs($8)},-$9 fi +if $8>-1&&$9<0 shift[-1] -$8,{abs($9)} fi +done +if $10==1 wind $11,$12,$13,$14 fi +samj_shapeprevalent_contours : +foreach { +samj_shapeprevalent_degradations $1,$2,$3,$4,$5,$6,$7,$8 ++gradient_norm. +dilate_circ. $10 +to_rgba. +n. 0,255 +replace_color. 1%,0,0,0,0,255,0,0,0,0 +c. 0,128 +replace_color. 50%,0,128,128,128,255,0,0,0,255 +replace_color. 50%,0,192,192,192,255,0,0,0,255 +if $11 fx_smooth_antialias. 5,0,0,0,50,50 fi +if $12 +rm.. +else +if $9!=1 to_rgb.. mul.. $9 c.. 0,255 fi +to_rgba.. blend[-1,-2] alpha +fi +} +samj_shapeprevalent_contours_preview : +gui_split_preview "samj_shapeprevalent_contours $*",$-1 +samj_Scintillements_Colores_Contours : +Val_Flou=$1 +Val_Isophotes=$2 +Val_Dilate=$3 +Resolution_L=$4 +Resolution_H=$5 +Dimension_Variation=$6 +Variation_Couleur=$7 +Scintillement=$8 +Angle_Decalage=$9 +Variation_Aleatoire=$10 +Flou_Contours=$11 +Mode_Overlay=$12 +Couleur_Fond_r=$13 +Couleur_Fond_v=$14 +Couleur_Fond_b=$15 +Couleur_Fond_a=$16 +Largeur_Origine={w} +Hauteur_Origine={h} +couleur_pixel=0 +rouge_pixel=0 +vert_pixel=0 +bleu_pixel=0 +alpha_pixel=0 +Hauteur=$Resolution_H +Largeur=$Resolution_L +Rayon_Scintillement_Origine={{$Resolution_H+$Resolution_L}*$Dimension_Variation} +Rayon_Scintillement=0 +Angle_Variation={360/$Scintillement} +Angle_Variation_En_Cours=0 +Coeff_Variation_Aleatoire=0 +blur[-1] $Val_Flou +to_rgba[-1] +isophotes[-1] $Val_Isophotes +dilate_circ[-1] $Val_Dilate +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] $Couleur_Fond_r,$Couleur_Fond_v,$Couleur_Fond_b,$Couleur_Fond_a +repeat $Largeur_Origine/($Resolution_L+$Resolution_L) +repeat $Hauteur_Origine/($Resolution_H+$Resolution_H) +couleur_pixel=${at_ancien[-2]\ {$Largeur},{$Hauteur}} +rouge_pixel=${arg\ 1,$couleur_pixel} +vert_pixel=${arg\ 2,$couleur_pixel} +bleu_pixel=${arg\ 3,$couleur_pixel} +alpha_pixel=${arg\ 4,$couleur_pixel} +Moyenne_couleur={1+{{$rouge_pixel+$vert_pixel+$bleu_pixel}/$Variation_Couleur}} +Rayon_Scintillement={$Rayon_Scintillement_Origine*$Moyenne_couleur} +Angle_Variation_En_Cours=0 +if $alpha_pixel>1 +repeat $Scintillement +Angle_Variation_En_Cours+=$Angle_Variation+$Angle_Decalage +if $Variation_Aleatoire==0 +line[-1] $Largeur,$Hauteur,{$Largeur+{$Rayon_Scintillement*{cos(pi/180*$Angle_Variation_En_Cours)}}},{$Hauteur+{$Rayon_Scintillement*{sin(pi/180*$Angle_Variation_En_Cours)}}},1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +else +Coeff_Variation_Aleatoire={1+{{round(u)*$Variation_Aleatoire}/100}} +line[-1] $Largeur,$Hauteur,{$Largeur+{$Rayon_Scintillement*$Coeff_Variation_Aleatoire*{cos(pi/180*$Angle_Variation_En_Cours*$Coeff_Variation_Aleatoire)}}},{$Hauteur+{$Rayon_Scintillement*$Coeff_Variation_Aleatoire*{sin(pi/180*$Angle_Variation_En_Cours*$Coeff_Variation_Aleatoire)}}},1,$rouge_pixel,$vert_pixel,$bleu_pixel,$alpha_pixel +fi +done +fi +Hauteur+=$Resolution_H+$Resolution_H +done +Largeur+=$Resolution_L+$Resolution_L +Hauteur=$Resolution_H +done +rm[-2] +if $Flou_Contours>0 blur[-1] $Flou_Contours,0 fi +if $Mode_Overlay==1 ++Je_passe_l_hiver_en_Floride[-1] +samj_blend_20220419[-2,-1] overlay,1,0 +fi +samj_Skeletation : +Skeletation=$1 +Variation_SmoothnessA={$2/$Skeletation/100} +Variation_SmoothnessB={$3/$Skeletation/100} +Valider_Blend=$4 +Mode_blend=$5 +Opacity_blend=$6 +Smoothness=0 +index=0 ++Je_passe_l_hiver_en_Floride[-1] +repeat $Skeletation ++Je_passe_l_hiver_en_Floride[0] +fx_skeleton[-1] 0,$Smoothness,0,0,0 +if $index>0 samj_blend_20220419[-2,-1] add,1,0 fi +Smoothness+=$Variation_SmoothnessA +index+=1 +done +fx_local_orientation[-2] 0,0,100,0,0,0 +Smoothness=0 +index=0 +repeat $Skeletation ++Je_passe_l_hiver_en_Floride[1] +fx_skeleton[-1] 0,$Smoothness,0,0,0 +if $index>0 samj_blend_20220419[-2,-1] add,1,0 fi +Smoothness+=$Variation_SmoothnessB +index+=1 +done +samj_blend_20220419[-2,-1] add,1,0 +rm[-2] +if $Valider_Blend==0 +rm[0] +else +gimp_blend_1651[0,-1] $Mode_blend,2,$Opacity_blend,0 +fi +samj_Test_Mauvais_Contours: +mode=${arg\ 1+$12,add,alpha,and,average,blue,burn,darken,difference,divide,dodge,edges,exclusion,freeze,grainextract,grainmerge,green,hardlight,hardmix,hue,interpolation,lighten,lightness,linearburn,linearlight,luminance,multiply,negation,or,overlay,pinlight,red,reflect,saturation,shapeareamax,shapeareamax0,shapeareamin,shapeareamin0,shapeaverage,shapeaverage0,shapemin,shapemin0,shapemax,shapemax0,softburn,softdodge,softlight,screen,stamp,subtract,value,vividlight,xor} +if $11==1 +Je_passe_l_hiver_en_Floride[-1] fi ++Je_passe_l_hiver_en_Floride[-1] +if $1<0 spread[-1] {abs($1/4)},{abs($1/4)} fi +if $1>0 segment_watershed[-1] {int($1)} fi +if $2>0 samj_Random_Small_Deformations[-1] $2,5,3 fi +if $3>0 samj_Random_Small_Deformations[-2] $3,5,3 fi +samj_blend_20220419[-1,-2] edges +gradient_norm[-1] +n[-1] 0,255 +repeat $4 ++Je_passe_l_hiver_en_Floride[-1] +samj_blend_20220419[-1,-2] add +pow[-1] $5 +n[-1] $6,$7 +c[-1] $8,$9 +done +n[-1] 0,255 +if $10>0 negate[-1] fi +if $11==1 +if $13==1 rv[-1,-2] fi +samj_blend_20220419[-1,-2] $mode +fi +samj_Beigne : +foreach { +Carre=0 +Diff=0 +to_rgba +if $8==1 +frame_xy $9,$10,$11,$12,$13,$14 +fi +if $3==1 +mirror x permute yx +elif $3==2 +permute yxzc mirror x +elif $3==3 +mirror x mirror y +fi +Larg={w} +Haut={h} +if $Larg<$Haut +Carre=$Haut +Diff={$Carre-w} +expand_x $Diff,0,0 +crop 0,0,{w-$Diff-1},{h-1} +fi +if $1>0 +expand_y {$Haut*$1/200},1,0 +Carre={$Haut*{100+$1}/100} +Diff={$Carre-w} +if $Diff>0 +expand_x $Diff,0,0 +crop 0,0,{w-$Diff-1},{h-1} +fi +fi +fill "i(((w-(2*x))^2+(h-(2*y))^2)^0.5)" +if $15==1 +fx_symmetrizoscope 3,45,0,0 +rotate 45,2,0 +autocrop +fi +if $2==1 +fx_square_circle 0,1,0,0,0,0,0 +fi +replace_color 1,0,0,0,0,0,$4,$5,$6,$7 +} +samj_Cercle_Polaire: +Repetitions=$1 +Angle_Rotation=$2 +Type_Raccord=$3 +Iterations_AM=$4 +X_offset_AM=$5 +Y_offse_AM=$6 +Array_mode_AM=$7 +Initialization_AM=$8 +Expand_size_AM=$9 +Crop_AM=$10 +X_center_PTE=$11 +Y_center_PTE=$12 +Expension=0 +Securite=4000 +to_rgba[-1] +repeat $Repetitions +if $Type_Raccord==1||$Type_Raccord==3 +if w>h +Expension={round({{w-h}/2})} +expand_y[-1] $Expension,1 +elif w$Securite||h>$Securite +if w>h +resize[-1] $Securite,{$Securite/w*h} +else +resize[-1] {$Securite/h*w},$Securite +fi +fi +fx_array_mirror[-1] 1,$X_offset_AM,$Y_offse_AM,$Array_mode_AM,$Initialization_AM,$Expand_size_AM,$Crop_AM +done +if w>$Securite||h>$Securite +if w>h +resize[-1] $Securite,{$Securite/w*h} +else +resize[-1] {$Securite/h*w},$Securite +fi +fi +polar2euclidean[-1] $X_center_PTE%,$Y_center_PTE%,1,1 +if $Type_Raccord==2||$Type_Raccord==3 +if w>h +Expension={round({{w-h}/2})} +expand_y[-1] $Expension,1 +elif w0 +if $Type_Raccord==2||$Type_Raccord==3||$Type_Raccord==4 +rotate[-1] $Angle_Rotation,0,1 +fi +if $Type_Raccord==0||$Type_Raccord==1 +rotate[-1] $Angle_Rotation,0,0 +fi +fi +autocrop[-1] 0 +if w>$Securite||h>$Securite +if w>h +resize[-1] $Securite,{$Securite/w*h} +else +resize[-1] {$Securite/h*w},$Securite +fi +fi +done +samj_rien_degradations : +Je_passe_l_hiver_en_Floride[-1] +samj_Ecraser_Etirer : +NbSplit=$1 +Effet=$2 +Step={$5/$NbSplit} +Loop=1 +Largeur_Origine={w} +Hauteur_Origine={h} +if $4==1 permute yxzc fi +split y,$NbSplit +repeat $NbSplit +if $Effet==0 +resize[-$Loop] 100%,{$Step*$Loop}% +elif $Effet==1 +resize[-{$NbSplit+1-$Loop}] 100%,{$Step*$Loop}% +elif $Effet==2 +resize[-$Loop] 100%,{100+{$Step*$Loop}}% +elif $Effet==3 +resize[-{$NbSplit+1-$Loop}] 100%,{100+{$Step*$Loop}}% +fi +Loop+=1 +done +append y +if $3==1 resize $Largeur_Origine,$Hauteur_Origine fi +if $4==1 permute yxzc fi +samj_Ecraser_Etirer_preview : +gui_split_preview "samj_Ecraser_Etirer $*",$-1 +samj_Ecraser_Etirer_V2 : +Pourcentage_Decoupe=$5 +Largeur_Origine={w} +Hauteur_Origine={h} +if $2==0||$2==1 ++Je_passe_l_hiver_en_Floride[-1] +crop[-1] 100%,$Pourcentage_Decoupe% +mirror[-2] x +crop[-2] 100%,{100-$Pourcentage_Decoupe}% +mirror[-2] x +if $2==1 mirror[-1,-2] x fi +samj_Ecraser_Etirer[-1] $1,0,0,1,$4 +samj_Ecraser_Etirer[-2] $1,1,0,1,$4 +if $2==1 mirror[-1,-2] x fi +append[-1,-2] x +elif $2==2||$2==3 +permute[-1] yxzc ++Je_passe_l_hiver_en_Floride[-1] +crop[-1] 100%,$Pourcentage_Decoupe% +mirror[-2] x +crop[-2] 100%,{100-$Pourcentage_Decoupe}% +mirror[-2] x +if $2==3 mirror[-1,-2] x fi +samj_Ecraser_Etirer[-1] $1,0,0,1,$4 +samj_Ecraser_Etirer[-2] $1,1,0,1,$4 +if $2==3 mirror[-1,-2] x fi +append[-1,-2] x +permute[-1] yxzc +fi +if $3==1 resize $Largeur_Origine,$Hauteur_Origine fi +samj_Ecraser_Etirer_V2_preview : +gui_split_preview "samj_Ecraser_Etirer_V2 $*",$-1 +samj_Random_Small_Deformations : +Val_Bruit=$1 +Val_Dilate=$2 +Val_Flou=$3 +Val_Expand={round($Val_Bruit+$Val_Dilate+$Val_Flou)*2} +to_rgba[-1] +expand_xy[-1] $Val_Expand,0 +100%,100%,1,2 +noise[-1] $Val_Bruit +dilate[-1] $Val_Dilate +blur[-1] $Val_Flou +warp[-2] [-1],1,0,0 +rm[-1] +autocrop[-1] +samj_Random_Small_Deformations_B : +skip ${1=10},${2=5},${3=3},${4=0} +foreach { +Larg={w} +Haut={h} ++blur {$1*$4/100} +samj_Random_Small_Deformations.. $1,$2,$3 +resize $Larg,$Haut rv blend alpha +} +samj_deformation_20230712 : +foreach { +to_rgba. +repeat $1 +if $5>0 srand $5 fi +deform. $2 +done ++gradient_norm. +blend grainextract,$3 +repeat 2 +smooth. 2,100,0.2,1,4 +done +if $4 n. 0,255 else c. 0,255 fi +} +samj_Zones_Grises : +Iterations_Contours=$1 +Choice_Contours=$2 +Variations_Contours=$3 +Iterations_Blend=$4 +Opacite_Blend=$5 +to_rgb[-1] +repeat $Iterations_Blend ++Je_passe_l_hiver_en_Floride[-1] +done +repeat $Iterations_Contours +if $Choice_Contours==0 +fx_curvature[-1] $Variations_Contours,0,100,0,0,0 +elif $Choice_Contours==1 +dog[-1] {5000/$Variations_Contours},0 +elif $Choice_Contours==2 +fx_edges[-1] 0,{2*$Variations_Contours},0,0 +fi +done +equalize[-1] +fx_decompose_channels[-1] 4,0,1,0 +remove[-1,-2] +to_rgb[-1] +repeat $Iterations_Blend +fx_blend_edges[-1,-2] $Opacite_Blend,5,0 +done +samj_Ellipses_Inpaint : +Couleur_Limite_r=$1 +Couleur_Limite_v=$2 +Couleur_Limite_b=$3 +Rayon_L=$4 +Rayon_H=$5 +Rendu=$6 +Flou_Effet_Sponge=$7 +Valeur_Effet_Sponge=$8 +Largeur_Origine={w} +Hauteur_Origine={h} +couleur_pixel=0 +rouge_pixel=0 +vert_pixel=0 +bleu_pixel=0 +Hauteur=$Rayon_H +Largeur=$Rayon_L +to_rgba[-1] +$Largeur_Origine,$Hauteur_Origine,1,4 +repeat $Largeur_Origine/($Rayon_L+$Rayon_L) +repeat $Hauteur_Origine/($Rayon_H+$Rayon_H) +couleur_pixel=${at_ancien[0]\ {$Largeur},{$Hauteur}} +rouge_pixel=${arg\ 1,$couleur_pixel} +vert_pixel=${arg\ 2,$couleur_pixel} +bleu_pixel=${arg\ 3,$couleur_pixel} +if $Rendu==0 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +ellipse[-1] $Largeur,$Hauteur,$Rayon_L,$Rayon_H,0,1,255 +fi +elif $Rendu==1 +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +ellipse[-1] $Largeur,$Hauteur,$Rayon_L,$Rayon_H,0,1,255 +fi +elif $Rendu==2 +if $rouge_pixel-$Couleur_Limite_r>=0&&$vert_pixel-$Couleur_Limite_v>=0&&$bleu_pixel-$Couleur_Limite_b>=0 +ellipse[-1] $Largeur,$Hauteur,$Rayon_L,$Rayon_H,0,1,255 +fi +if $rouge_pixel-$Couleur_Limite_r<0&&$vert_pixel-$Couleur_Limite_v<0&&$bleu_pixel-$Couleur_Limite_b<0 +ellipse[-1] $Largeur,$Hauteur,$Rayon_L,$Rayon_H,0,1,255 +fi +fi +Hauteur+=$Rayon_H+$Rayon_H +done +Largeur+=$Rayon_L+$Rayon_L +Hauteur=$Rayon_H +done +if $Flou_Effet_Sponge==1 sponge[-1] $Valeur_Effet_Sponge fi +inpaint[-2] [-1] +rm[-1] +samj_Wavelet_Sharpen_Test[-1] 1 +samj_Image_Segments_Degrades : +foreach { +if $11==1 Densite={round($1/4)} else Densite=$1 fi +if $9>0 srand $9 fi +to_rgba +{w},{h},1,4 +fill_color. 0,0,0,255 +repeat $Densite +X1p={round(u*{w})} +Y1p={round(u*{h})} +if $11 +X2p={$X1p+round(u*$2/100*{w})+1} +Y2p={$Y1p-round(u*$2/100*{h})+1} +line. $X1p,$Y1p,$X2p,$Y2p,1,0,0,0,0 +X2p={$X1p-round(u*$2/100*{w})+1} +Y2p={$Y1p-round(u*$2/100*{h})+1} +line. $X1p,$Y1p,$X2p,$Y2p,1,0,0,0,0 +X2p={$X1p-round(u*$2/100*{w})+1} +Y2p={$Y1p+round(u*$2/100*{h})+1} +line. $X1p,$Y1p,$X2p,$Y2p,1,0,0,0,0 +fi +X2p={$X1p+round(u*$2/100*{w})+1} +Y2p={$Y1p+round(u*$2/100*{h})+1} +line. $X1p,$Y1p,$X2p,$Y2p,1,0,0,0,0 +done +if $3>1 erode_circ. $3 fi +blend alpha +if $4 replace_color. 1%,0,0,0,0,255,0,0,0,0 {w},{h},1,4 fill_color. $5,$6,$7,$8 rv blend alpha fi +if $10 dilate. {$3+1} deform $10 fi +} +samj_Image_Vers_Segments : +foreach { +if $9>0 srand $9 fi +to_rgba +{w},{h},1,4 +rv +repeat $1 +X1p={round(u*{w})} +Y1p={round(u*{h})} +X2p={$X1p+round(u*$2/100*{h})+1} +Y2p={$Y1p+round(u*$2/100*{h})+1} +Pixel={I($X1p,$Y1p)} +Rp={arg(1,$Pixel)} +Vp={arg(2,$Pixel)} +Bp={arg(3,$Pixel)} +Ap={arg(4,$Pixel)} +if $2>0 +line.. $X1p,$Y1p,$X2p,$Y2p,1,$Rp,$Vp,$Bp,$Ap +else +X2p={$X1p+round(u/100*{h})+1} +Y2p={$Y1p+round(u/100*{h})+1} +a_Ligne={{$Y2p-$Y1p}/{$X2p-$X1p}} +b_Ligne={$Y2p-($a_Ligne*$X2p)} +X_Ex_a=0 +Y_Ex_a=$b_Ligne +X_Ex_b={{w}-1} +Y_Ex_b={{$a_Ligne*$X_Ex_b}+$b_Ligne} +if $Y_Ex_b>=0 line.. $X_Ex_a,$Y_Ex_a,$X_Ex_b,$Y_Ex_b,1,$Rp,$Vp,$Bp,$Ap fi +fi +done +if $3>1 dilate_circ.. $3 fi +rm. +if $4 {w},{h},1,4 fill_color. $5,$6,$7,$8 rv blend alpha fi +if $10 dilate. {$3+1} deform $10 fi +} +samj_Degradations_Path_Solidify : +Val_Pixelise=$1 +Val_Spread=$2 +Val_Deform=$3 +Val_Isophotes=$4 +Val_Blur=$5 +Patch_Type=$6 +Valeur_Patch=$7 +Dilate_Type=$8 +Valeur_Dilate=$9 +Valeur_Erode=$10 +Valider_Solidify=$11 +smoothness=$12 +diffusion_type=$13 +diffusion_iter=$14 +to_rgb[-1] ++Je_passe_l_hiver_en_Floride[-1] +if $Val_Pixelise>0 pixelize[-1] {$Val_Pixelise+1},{$Val_Pixelise+1} fi +if $Val_Spread>0 spread[-1] $Val_Spread fi +if $Val_Deform>0 deform[-1] $Val_Deform fi +if $Val_Isophotes>0 isophotes[-1] {$Val_Isophotes+2} replace_color[-1] 0%,0,0,0,0,0,0,0,0,255 fi +if $Val_Blur>0 blur[-1] $Val_Blur fi +to_rgb[-1] +if $Patch_Type==2 ++Je_passe_l_hiver_en_Floride[-1] +max_patch[-1] $Valeur_Patch +min_patch[-2] $Valeur_Patch +samj_blend_20220419[-1,-2] add +elif $Patch_Type==1 +min_patch[-1] $Valeur_Patch +elif $Patch_Type==0 +max_patch[-1] $Valeur_Patch +fi +n[-1] 0,255 +to_rgba[-1] +if $Valeur_Dilate>0 +if $Dilate_Type==0 +dilate_circ[-1] {$Valeur_Dilate+1} +elif $Dilate_Type==1 +dilate[-1] {$Valeur_Dilate+1} +fi +fi +if $Valeur_Erode>0 erode[-1] $Valeur_Erode fi +replace_color[-1] 0%,0,0,0,0,255,0,0,0,0 +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +if $Valider_Solidify==1 solidify[-1] $smoothness,$diffusion_type,$diffusion_iter fi +samj_Random_Plasma : +Melange=$1 +Flou=$2 ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +blur[-1] {{w+h}/$Flou} ++Je_passe_l_hiver_en_Floride[-1] +plasma[-1] 1,1,10 +blur[-1] {{w+h}/$Flou} +blend_seamless[-2,-1] 1,0,25% +if $Melange==0 +_gb_bwd_version_1_7_8[-1] 1 +elif $Melange==1 +_gb_bwd_version_1_7_8[-1] 2 +elif $Melange==2 +_gb_bwd_version_1_7_8[-1,-2] 1 +elif $Melange==3 +_gb_bwd_version_1_7_8[-1,-2] 2 +fi +blend_edges[-2,-1] 5 +samj_blend_20220419[-1,-2] alpha +_gb_bwd_version_1_7_8 : +to_color +if $1==1 foreach { sh 0,2 rgb2srgb. rm. } +elif $1==2 foreach { sh 0,2 lab2rgb. rgb2srgb. rm. } +fi +samj_rien_details : +Je_passe_l_hiver_en_Floride[-1] +samj_rotate_flip_image : +foreach { +to_rgba +if $1 +if $5 rotate $2,$3,$4 else rotate $2,$3,$4,50%,50% fi +fi +if $6 +if $7==0 mirror x else mirror y fi +fi +if $8 {w},{h},1,4 fill_color. $9,$10,$11,$12 rv blend alpha fi +} +samj_Selection_Ellipse : +foreach { +to_rgba +if $6 +ellipse $1%,$2%,$3%,$4%,$5,1,0,0,0,0 +else +c 0,254.99 +{w},{h},1,4 +fill_color. 257,257,257,257 +ellipse. $1%,$2%,$3%,$4%,$5,1,0,0,0,0 +blend add +c 0,255 +replace_color 0,0,255,255,255,255,0,0,0,0 ++ellipse $1%,$2%,$3%,$4%,$5,1,255,255,255,255 +rv +blend alpha +fi +if $6==0&&$8==1 rotate {-$5},2,0 +elif $6==0&&$8==2 rotate {-$5-90},2,0 +elif $6==0&&$8==3 rotate {-$5+90},2,0 +elif $6==0&&$8==4 rotate {-$5+180},2,0 +fi +if $7 autocrop fi +} +samj_Selection_Ellipse_preview : +samj_Selection_Ellipse $1,$2,$3,$4,$5,$6,$7,$8 +if $9&&$8==0&&$7==0 +line 0,0,{{w}-1},{{h}-1},1,$11,$11,$11,255 +line 0,{{h}-1},{{w}-1},0,1,$11,$11,$11,255 +GrX={{w}/$10} +GrY={{h}/$10} +Ind=0 +repeat {$10-1} +Ind+=1 +line {$Ind*$GrX},0,{$Ind*$GrX},{{h}-1},1,$11,$11,$11,255 +line 0,{$Ind*$GrY},{{w}-1},{$Ind*$GrY},1,$11,$11,$11,255 +done +fi +samj_Selection_Hermite_Spline : +foreach { +to_rgba +c 0,254.99 ++- +x_spline. +to_rgba. +replace_color. 0,0,0,0,0,255,258,258,258,258 +blend add +c 0,255 +replace_color 0,0,255,255,255,255,0,0,0,0 +if $1 autocrop fi +} +samj_Selection_Polygone : +foreach { +point1_X={{w}*$2/100} +point1_Y={{h}*$3/100} +point2_X={{w}*$4/100} +point2_Y={{h}*$5/100} +point3_X={{w}*$6/100} +point3_Y={{h}*$7/100} +point4_X={{w}*$8/100} +point4_Y={{h}*$9/100} +point5_X={{w}*$10/100} +point5_Y={{h}*$11/100} +point6_X={{w}*$12/100} +point6_Y={{h}*$13/100} +point7_X={{w}*$14/100} +point7_Y={{h}*$15/100} +point8_X={{w}*$16/100} +point8_Y={{h}*$17/100} +to_rgba +if $18 +if $1==3 +polygon 3,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,1,0,0,0,0 +elif $1==4 +polygon 4,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,1,0,0,0,0 +elif $1==5 +polygon 5,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,1,0,0,0,0 +elif $1==6 +polygon 6,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,$point6_X,$point6_Y,1,0,0,0,0 +elif $1==7 +polygon 7,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,$point6_X,$point6_Y,$point7_X,$point7_Y,1,0,0,0,0 +elif $1==8 +polygon 8,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,$point6_X,$point6_Y,$point7_X,$point7_Y,$point8_X,$point8_Y,1,0,0,0,0 +fi +else +c 0,254.99 +{w},{h},1,4 +fill_color. 257,257,257,257 +if $1==3 +polygon. 3,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,1,0,0,0,0 +elif $1==4 +polygon. 4,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,1,0,0,0,0 +elif $1==5 +polygon. 5,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,1,0,0,0,0 +elif $1==6 +polygon. 6,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,$point6_X,$point6_Y,1,0,0,0,0 +elif $1==7 +polygon. 7,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,$point6_X,$point6_Y,$point7_X,$point7_Y,1,0,0,0,0 +elif $1==8 +polygon. 8,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,$point6_X,$point6_Y,$point7_X,$point7_Y,$point8_X,$point8_Y,1,0,0,0,0 +fi +blend add +c 0,255 +replace_color 0,0,255,255,255,255,0,0,0,0 +if $1==3 ++polygon 3,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,1,255,255,255,255 +elif $1==4 ++polygon 4,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,1,255,255,255,255 +elif $1==5 ++polygon 5,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,1,255,255,255,255 +elif $1==6 ++polygon 6,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,$point6_X,$point6_Y,1,255,255,255,255 +elif $1==7 ++polygon 7,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,$point6_X,$point6_Y,$point7_X,$point7_Y,1,255,255,255,255 +elif $1==8 ++polygon 8,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,$point6_X,$point6_Y,$point7_X,$point7_Y,$point8_X,$point8_Y,1,255,255,255,255 +fi +rv +blend alpha +fi +if $19 autocrop fi +} +samj_Selection_Polygone_preview : +samj_Selection_Polygone $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19 +if $20&&$19==0 +line 0,0,{{w}-1},{{h}-1},1,$22,$22,$22,255 +line 0,{{h}-1},{{w}-1},0,1,$22,$22,$22,255 +GrX={{w}/$21} +GrY={{h}/$21} +Ind=0 +repeat {$21-1} +Ind+=1 +line {$Ind*$GrX},0,{$Ind*$GrX},{{h}-1},1,$22,$22,$22,255 +line 0,{$Ind*$GrY},{{w}-1},{$Ind*$GrY},1,$22,$22,$22,255 +done +fi +samj_Selection_Rectangle : +foreach { +Xo={{w}*$1/100} +Yo={{h}*$2/100} +Ca={{{{{w}^2}+{{h}^2}}^0.5}*$3/100} +Cb={{{{{w}^2}+{{h}^2}}^0.5}*$4/100} +Ray={{{{{$Ca}^2}+{{$Cb}^2}}^0.5}/2} +Angle={asin($Cb/$Ray/2)/pi*180} +point1_X={$Xo+{$Ray*{cos(pi/180*{$Angle+$5})}}} +point1_Y={$Yo+{$Ray*{sin(pi/180*{$Angle+$5})}}} +point2_X={$Xo+{$Ray*{cos(pi/180*{180-$Angle+$5})}}} +point2_Y={$Yo+{$Ray*{sin(pi/180*{180-$Angle+$5})}}} +point3_X={$Xo+{$Ray*{cos(pi/180*{180+$Angle+$5})}}} +point3_Y={$Yo+{$Ray*{sin(pi/180*{180+$Angle+$5})}}} +point4_X={$Xo+{$Ray*{cos(pi/180*{-$Angle+$5})}}} +point4_Y={$Yo+{$Ray*{sin(pi/180*{-$Angle+$5})}}} +to_rgba +if $6 +polygon 4,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,1,0,0,0,0 +else +c 0,254.99 +{w},{h},1,4 +fill_color. 257,257,257,257 +polygon. 4,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,1,0,0,0,0 +blend add +c 0,255 +replace_color 0,0,255,255,255,255,0,0,0,0 ++polygon 4,$point1_X,$point1_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$point4_X,$point4_Y,1,255,255,255,255 +rv +blend alpha +fi +if $6==0&&$8==1 rotate {-$5},2,0 +elif $6==0&&$8==2 rotate {-$5-90},2,0 +elif $6==0&&$8==3 rotate {-$5+90},2,0 +elif $6==0&&$8==4 rotate {-$5+180},2,0 +fi +if $7 autocrop fi +} +samj_Selection_Rectangle_preview : +samj_Selection_Rectangle $1,$2,$3,$4,$5,$6,$7,$8 +if $9&&$8==0&&$7==0 +line 0,0,{{w}-1},{{h}-1},1,$11,$11,$11,255 +line 0,{{h}-1},{{w}-1},0,1,$11,$11,$11,255 +GrX={{w}/$10} +GrY={{h}/$10} +Ind=0 +repeat {$10-1} +Ind+=1 +line {$Ind*$GrX},0,{$Ind*$GrX},{{h}-1},1,$11,$11,$11,255 +line 0,{$Ind*$GrY},{{w}-1},{$Ind*$GrY},1,$11,$11,$11,255 +done +fi +samj_Selection_Spline_Rounded : +foreach { +point1_X={{w}*$3/100} +point1_Y={{h}*$4/100} +point2_X={{w}*$5/100} +point2_Y={{h}*$6/100} +point3_X={{w}*$7/100} +point3_Y={{h}*$8/100} +point4_X={{w}*$9/100} +point4_Y={{h}*$10/100} +point5_X={{w}*$11/100} +point5_Y={{h}*$12/100} +point6_X={{w}*$13/100} +point6_Y={{h}*$14/100} +point7_X={{w}*$15/100} +point7_Y={{h}*$16/100} +point8_X={{w}*$17/100} +point8_Y={{h}*$18/100} +to_rgba +c 0,254.99 +{w},{h},1,4 +fill_color. 257,257,257,257 +samj_Bezier_Quatre_Points. $point1_X,$point1_Y,$point2_X,$point2_Y,$point2_X,$point2_Y,$point3_X,$point3_Y,$1,255,255,255,255 +samj_Bezier_Quatre_Points. $point3_X,$point3_Y,$point4_X,$point4_Y,$point4_X,$point4_Y,$point5_X,$point5_Y,$1,255,255,255,255 +if $2 +samj_Bezier_Quatre_Points. $point5_X,$point5_Y,$point6_X,$point6_Y,$point6_X,$point6_Y,$point7_X,$point7_Y,$1,255,255,255,255 +samj_Bezier_Quatre_Points. $point7_X,$point7_Y,$point8_X,$point8_Y,$point8_X,$point8_Y,$point1_X,$point1_Y,$1,255,255,255,255 +if $19 +flood. {{$point1_X+$point3_X+$point5_X+$point7_X}/4},{{$point1_Y+$point3_Y+$point5_Y+$point7_Y}/4},0,0,0,1,0,0,0,0 +else +flood. {{$point2_X+$point4_X+$point6_X+$point8_X}/4},{{$point2_Y+$point4_Y+$point6_Y+$point8_Y}/4},0,0,0,1,0,0,0,0 +fi +else +samj_Bezier_Quatre_Points. $point5_X,$point5_Y,$point6_X,$point6_Y,$point6_X,$point6_Y,$point1_X,$point1_Y,$1,255,255,255,255 +if $19 +flood. {{$point1_X+$point3_X+$point5_X}/3},{{$point1_Y+$point3_Y+$point5_Y}/3},0,0,0,1,0,0,0,0 +else +flood. {{$point2_X+$point4_X+$point6_X}/3},{{$point2_Y+$point4_Y+$point6_Y}/3},0,0,0,1,0,0,0,0 +fi +fi +if $20 +replace_color. 0,0,0,0,0,0,258,258,258,258 +replace_color. 0,0,257,257,257,257,0,0,0,0 +replace_color. 0,0,255,255,255,255,0,0,0,258 +replace_color 0,0,255,255,255,255,0,0,0,0 +else +replace_color. 0,0,255,255,255,255,0,0,0,255 +fi +blend add +c 0,255 +replace_color 0,0,255,255,255,255,0,0,0,0 +if $21 autocrop fi +} +samj_Selection_Spline_Rounded_preview : +samj_Selection_Spline_Rounded $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21 +if $22&&$21==0 +line 0,0,{{w}-1},{{h}-1},1,$24,$24,$24,255 +line 0,{{h}-1},{{w}-1},0,1,$24,$24,$24,255 +GrX={{w}/$23} +GrY={{h}/$23} +Ind=0 +repeat {$23-1} +Ind+=1 +line {$Ind*$GrX},0,{$Ind*$GrX},{{h}-1},1,$24,$24,$24,255 +line 0,{$Ind*$GrY},{{w}-1},{$Ind*$GrY},1,$24,$24,$24,255 +done +fi +samj_shapeprevalent_degradations : +foreach { ++- +repeat $8 +blur. $1 +sharpen. $2 +smooth. $3,0.2,1,4,4 +quantize. $4,1,1 +dilate_circ. $5 +erode_circ. $6 +quantize_area. $7 +done +blend shapeprevalent +} +samj_shapeprevalent_degradations_preview : +gui_split_preview "samj_shapeprevalent_degradations $*",$-1 +samj_Antialias_Wavelet : +Flou=$1 +Trait=$2 +Cut_Bas=$3 +Cut_Haut=$4 +Dilate_Circle_W=$5 +Nettete=$6 +Dilate_Circle_R=$7 +Normaliser=$8 +Iterations_Contours=$9 +repeat $Iterations_Contours +fx_split_details_wavelets[-1] 2,0,0 +blur[-2] $Flou +if $Trait>0 add[-2] $Trait fi +c[-2] $Cut_Bas,$Cut_Haut +if $Dilate_Circle_W>1 dilate_circ[-1] $Dilate_Circle_W fi +samj_blend_20220419[-1,-2] grainmerge +sharpen[-1] $Nettete +done +if $Dilate_Circle_R>1 dilate_circ[-1] $Dilate_Circle_R fi +if $Normaliser==1 n[-1] 0,255 fi +gui_set_layer_mode[-1] normal +samj_Wavelet_Sharpen_Test_en : +repeat $2+1 +if $1==0 +fx_split_details_wavelets[-1] 2,0,0 ++Je_passe_l_hiver_en_Floride[-2] +samj_blend_20220419[-1,-3] grainmerge +samj_blend_20220419[-1,-2] grainmerge +elif $1==1 +fx_split_details_wavelets[-1] 6,0,0 ++Je_passe_l_hiver_en_Floride[-6] +samj_blend_20220419[-1,-7] grainmerge +samj_blend_20220419[-6,-5] grainmerge ++Je_passe_l_hiver_en_Floride[-3] +samj_blend_20220419[-1,-6] grainmerge +samj_blend_20220419[-5,-4] grainmerge +samj_blend_20220419[-4,-3] grainmerge +samj_blend_20220419[-3,-2] grainmerge +samj_blend_20220419[-1,-2] grainmerge +fi +done +gui_set_layer_mode[-1] normal +samj_rien_frames : +Je_passe_l_hiver_en_Floride[-1] +samj_Wavelet_Sharpen_Test : +Repetition=$1 +repeat $Repetition +fx_split_details_wavelets[-1] 2,0,0 ++Je_passe_l_hiver_en_Floride[-2] +samj_blend_20220419[-1,-3] grainmerge +samj_blend_20220419[-1,-2] grainmerge +done +gui_set_layer_mode[-1] normal +samj_At06A_2017_frame_painting: +Blend_Mode=$14 +Blend_Opacity=$15 +Blend_Reverse=$16 +Largeur={w} +Hauteur={h} +to_rgba[-1] +$Largeur,$Hauteur,1,4 +frame_painting[-1] $1%,$2,$3%,${4-6},$7%,${8-13} +resize[-1] $Largeur,$Hauteur +pow[-1] $17 +n[-1] 0,{{iM}-{im}} +c[-1] {{iM}/100*$18},{iM} +n[-1] 0,{iM} +c[-1] 0,{{iM}/100*$19} +n[-1] 0,255 +if $Blend_Reverse==0 rv[-1,-2] fi +gimp_blend_1651[-2,-1] $Blend_Mode,2,$Blend_Opacity,0 +samj_rien_layers : +Je_passe_l_hiver_en_Floride[-1] +samj_rien_lights_and_shadows : +Je_passe_l_hiver_en_Floride[-1] +samj_Ombre_Portee : +QuA=$1 +FlA=$2 +InvC=$3 +Limite=$4 +Dilatation=$5 +R_a=$6 +V_a=$7 +B_a=$8 +A_a=$9 +R_b=$10 +V_b=$11 +B_b=$12 +A_b=$13 +VA=$14 +Type_Rendu=$15 +R_c=$16 +V_c=$17 +B_c=$18 +A_c=$19 +Flou=$20 +Largeur_Origine={w} +Hauteur_Origine={h} +if $QuA>0 quantize[-1] {$QuA+7},1,1 fi +blur[-1] $FlA +if $InvC==1 negate[-1] fi +to_rgba[-1] +luminance[-1] +to_rgba[-1] +n[-1] 0,255 +c[-1] 0,$Limite +n[-1] 0,255 +c[-1] {255-$Limite},255 +n[-1] 0,255 +ditheredbw[-1] +dilate[-1] {$Dilatation+1} +to_rgba[-1] +replace_color[-1] 0%,0,255,255,255,255,0,0,0,0 ++Je_passe_l_hiver_en_Floride[-1] +replace_color[-1] 0%,0,0,0,0,255,$R_a,$V_a,$B_a,$A_a +replace_color[-2] 0%,0,0,0,0,255,$R_b,$V_b,$B_b,$A_b +if $Type_Rendu==1 +shift[-2] 0,0,0,0,0 +elif $Type_Rendu==2 +shift[-2] $VA,0,0,0,0 +elif $Type_Rendu==3 +shift[-2] 0,$VA,0,0,0 +elif $Type_Rendu==4 +shift[-2] $VA,$VA,0,0,0 +elif $Type_Rendu==5 +shift[-2] {-$VA},0,0,0,0 +elif $Type_Rendu==6 +shift[-2] 0,{-$VA},0,0,0 +elif $Type_Rendu==7 +shift[-2] {-$VA},{-$VA},0,0,0 +fi +crop[-2] 0,0,{w-1},{h-1} +if $Flou>0 blur[-1] $Flou blur[-2] {$Flou+1} fi +samj_blend_20220419[-1,-2] alpha +{w},{h},1,4 +fill_color[-1] $R_c,$V_c,$B_c,$A_c +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +samj_rien_patterns : +Je_passe_l_hiver_en_Floride[-1] +samj_Ombre_Portee_B : +Resolution=$1 +Limite=$2 +Supprimer_Noir=$3 +Contour=$4 +Variation_Contour=$5 +Clair_Fonce=$6 +Precision_Blanc=$7 +Precision_Noir=$8 +R_a=$9 +V_a=$10 +B_a=$11 +A_a=$12 +Dilatation=$13 +Flou=$14 +VA=$15 +Type_Rendu=$16 +R_b=$17 +V_b=$18 +B_b=$19 +A_b=$20 +Largeur_A={round(w/$Resolution)} +Hauteur_A={round(h/$Resolution)} +OrigineH=0 +OrigineV={-$Resolution} +couleur_pixel=0 +rouge_pixel=0 +vert_pixel=0 +bleu_pixel=0 +alpha_pixel=0 +to_rgba[-1] +resize[-1] $Largeur_A,$Hauteur_A +resize[-1] {$Largeur_A*$Resolution},{$Hauteur_A*$Resolution} +luminance[-1] +to_rgba[-1] +n[-1] 0,255 +c[-1] 0,$Limite +n[-1] 0,255 +c[-1] {255-$Limite},255 +n[-1] 0,255 +replace_color[-1] 100,$Precision_Blanc,255,255,255,255,0,0,0,0 +if $Supprimer_Noir==1 +replace_color[-1] 100,$Precision_Noir,0,0,0,255,0,0,0,0 +fi +mul[-1] $Clair_Fonce +{$Largeur_A*$Resolution},{$Hauteur_A*$Resolution},1,4 +rv[-1,-2] +repeat $Hauteur_A +OrigineH=0 +OrigineV+=$Resolution +repeat $Largeur_A +couleur_pixel={I($OrigineH,$OrigineV)} +rouge_pixel={arg(1,$couleur_pixel)} +vert_pixel={arg(2,$couleur_pixel)} +bleu_pixel={arg(3,$couleur_pixel)} +alpha_pixel={arg(4,$couleur_pixel)} +if $alpha_pixel>0 +rectangle[-2] $OrigineH,$OrigineV,{$OrigineH+$Resolution},{$OrigineV+$Resolution},1,$R_a,$V_a,$B_a,$A_a +if $Contour==1 +rectangle[-1] $OrigineH,$OrigineV,{$OrigineH+$Resolution-1},{$OrigineV+$Resolution-1},1,0xFFFFFFFF,{{$rouge_pixel/2}+$Variation_Contour},{{$vert_pixel/2}+$Variation_Contour},{{$bleu_pixel/2}+$Variation_Contour},255 +fi +fi +OrigineH+=$Resolution +done +done +dilate[-2] $Dilatation +blur[-2] $Flou +if $Type_Rendu==1 +shift[-2] 0,0,0,0,0 +elif $Type_Rendu==2 +shift[-2] $VA,0,0,0,0 +elif $Type_Rendu==3 +shift[-2] 0,$VA,0,0,0 +elif $Type_Rendu==4 +shift[-2] $VA,$VA,0,0,0 +elif $Type_Rendu==5 +shift[-2] {-$VA},0,0,0,0 +elif $Type_Rendu==6 +shift[-2] 0,{-$VA},0,0,0 +elif $Type_Rendu==7 +shift[-2] {-$VA},{-$VA},0,0,0 +fi +crop[-2] 0,0,{w-1},{h-1} +samj_blend_20220419[-1,-2] alpha +{$Largeur_A*$Resolution},{$Hauteur_A*$Resolution},1,4 +fill_color[-1] $R_b,$V_b,$B_b,$A_b +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +samj_Ombre_Portee_C : +isophotes[-1] $1 +dilate_circ[-1] $2 +samj_Ombre_Portee_B[-1] $3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22 +samj_Ombre_Portee_D : +Resolution=$1 +Detection_A=$2 +Detection_B=$3 +Flou_Lissage=$4 +Couleur=$5 +Isophotes_AP=$6 +Dilate_AP=$7 +Contour=$8 +Variation_Contour=$9 +Dilatation_ombre=$10 +Couleur_Ombre=$11 +Flou_Ombre=$12 +VA=$13 +Type_Rendu=$14 +R_a=$15 +V_a=$16 +B_a=$17 +A_a=$18 +Largeur_A={round(w/$Resolution)} +Hauteur_A={round(h/$Resolution)} +OrigineH=0 +OrigineV={-$Resolution} +couleur_pixel=0 +rouge_pixel=0 +vert_pixel=0 +bleu_pixel=0 +alpha_pixel=0 +blur $Flou_Lissage +c[-1] 0,255 +n[-1] 0,255 +c[-1] $Detection_A,{255-$Detection_B} +n[-1] 0,255 +mul[-1] $Couleur +isophotes[-1] $Isophotes_AP +dilate[-1] $Dilate_AP +resize[-1] $Largeur_A,$Hauteur_A +resize[-1] {$Largeur_A*$Resolution},{$Hauteur_A*$Resolution} +repeat $Hauteur_A +OrigineH=0 +OrigineV+=$Resolution +repeat $Largeur_A +couleur_pixel={I($OrigineH,$OrigineV)} +rouge_pixel={arg(1,$couleur_pixel)} +vert_pixel={arg(2,$couleur_pixel)} +bleu_pixel={arg(3,$couleur_pixel)} +alpha_pixel={arg(4,$couleur_pixel)} +if $alpha_pixel>0 +rectangle[-1] $OrigineH,$OrigineV,{$OrigineH+$Resolution-1},{$OrigineV+$Resolution-1},1,$rouge_pixel,$vert_pixel,$bleu_pixel,255 +if $Contour==1 +rectangle[-1] $OrigineH,$OrigineV,{$OrigineH+$Resolution-1},{$OrigineV+$Resolution-1},1,0xFFFFFFFF,{{$rouge_pixel/2}+$Variation_Contour},{{$vert_pixel/2}+$Variation_Contour},{{$bleu_pixel/2}+$Variation_Contour},255 +fi +fi +OrigineH+=$Resolution +done +done ++Je_passe_l_hiver_en_Floride[-1] +to_graya[-1] +dilate[-1] $Dilatation_ombre +mul[-1] $Couleur_Ombre +blur[-1] $Flou_Ombre +if $Type_Rendu==1 +shift[-1] 0,0,0,0,0 +elif $Type_Rendu==2 +shift[-1] $VA,0,0,0,0 +elif $Type_Rendu==3 +shift[-1] 0,$VA,0,0,0 +elif $Type_Rendu==4 +shift[-1] $VA,$VA,0,0,0 +elif $Type_Rendu==5 +shift[-1] {-$VA},0,0,0,0 +elif $Type_Rendu==6 +shift[-1] 0,{-$VA},0,0,0 +elif $Type_Rendu==7 +shift[-1] {-$VA},{-$VA},0,0,0 +fi +crop[-1] 0,0,{w-1},{h-1} +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +{$Largeur_A*$Resolution},{$Hauteur_A*$Resolution},1,4 +fill_color[-1] $R_a,$V_a,$B_a,$A_a +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +samj_Posterize_Relief: +foreach { +blur $1 +autoindex $2 +inpaint_holes {w/100*$3},1 +repeat $4 smooth $5,{$6%},1,$7,{2*$7} done +if $8>0 sharpen $8 fi +n 0,255 +fx_light_relief $9,0,0,$10,$11,$12,0,0,0,0,0 +} +samj_Contours_Gros_Pixels : +Flou=$1 +Isophotes_Nb_Levels=$2 +Dilatation=$3 +Gros_Pixels_X=$4 +Gros_Pixels_Y=$5 +Quantize_Levels=$6 +Couleur=$7 +Transparence=$8 +Valider_Edges=$9 +Threshold_Edges=$10 +Colorisation=$11 +Alpha_Colorisation=$12 +Mode_blend=$13 +Opacity_blend=$14 +to_rgb[-1] +blur[-1] $Flou +isophotes[-1] $Isophotes_Nb_Levels +if $Dilatation>0 +dilate_circ[-1] $Dilatation +fi +if $Valider_Edges==1 +if $Colorisation==1 ++Je_passe_l_hiver_en_Floride[-1] +pow[-2] $Couleur +dilate_circ[-2] $Dilatation +fi +fi +wh={w},{h},1,{s} r $Gros_Pixels_X%,$Gros_Pixels_Y%,10%,100%,2 n[-1] 0,255 quantize[-1] $Quantize_Levels,1,0 r $wh +pow[-1] $Couleur +if $Transparence==1 +to_rgba[-1] +else +to_rgb[-1] +fi +if $Valider_Edges==1 +edges[-1] $Threshold_Edges% +n[-1] 0,255 +to_rgb[-1] +if $Colorisation==1 +n[-2] 0,255 +if $Alpha_Colorisation==0 +to_rgb[-2] +fi +gimp_blend_1651[-2,-1] $Mode_blend,2,$Opacity_blend,0 +fi +fi +samj_Degrades_HSL_TSL : +Type_Degrade=$1 +Dimensions=$2 +Ra=$3 +Ga=$4 +Ba=$5 +Aa=$6 +Rb=$7 +Gb=$8 +Bb=$9 +Ab=$10 +Decalage_H=$11 +Decalage_S=$12 +Decalage_L=$13 +Variation_H=$14 +Variation_S=$15 +Variation_L=$16 +Valider_Variations_Canal_A=$17 +Degrades_aleatoires=$18 +H_Min_Ded_Alea=$19 +H_Max_Ded_Alea=$20 +S_Min_Ded_Alea=$21 +S_Max_Ded_Alea=$22 +L_Min_Ded_Alea=$23 +L_Max_Ded_Alea=$24 +Inverser_Degrade=$25 +Variations_Formes=$26 +Parametre_Forme_A=$27 +Parametre_Forme_B=$28 +Nb_Boucles=0 +Inc_H=0 +Inc_S=0 +Inc_L=0 +Inc_A=0 +Diff=0 +Temp=0 +if $Variations_Formes==1 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +elif $Variations_Formes==2 +if $Type_Degrade==0 +Type_Degrade=1 +elif $Type_Degrade==2 +Type_Degrade=3 +elif $Type_Degrade==4 +Type_Degrade=5 +elif $Type_Degrade==6 +Type_Degrade=7 +fi +elif $Variations_Formes==3 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +Valider_Variations_Canal_A=0 +elif $Variations_Formes==4 +if $Type_Degrade==0 +Type_Degrade=1 +elif $Type_Degrade==2 +Type_Degrade=3 +elif $Type_Degrade==4 +Type_Degrade=5 +elif $Type_Degrade==6 +Type_Degrade=7 +fi +Valider_Variations_Canal_A=0 +elif $Variations_Formes==5 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +elif $Variations_Formes==6 +if $Type_Degrade==0 +Type_Degrade=1 +elif $Type_Degrade==2 +Type_Degrade=3 +elif $Type_Degrade==4 +Type_Degrade=5 +elif $Type_Degrade==6 +Type_Degrade=7 +fi +elif $Variations_Formes==7 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +elif $Variations_Formes==8 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +elif $Variations_Formes==9 +if $Type_Degrade==0 +Type_Degrade=1 +elif $Type_Degrade==2 +Type_Degrade=3 +elif $Type_Degrade==4 +Type_Degrade=5 +elif $Type_Degrade==6 +Type_Degrade=7 +fi +elif $Variations_Formes==10 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +elif $Variations_Formes==11 +if $Type_Degrade==0 +Type_Degrade=1 +elif $Type_Degrade==2 +Type_Degrade=3 +elif $Type_Degrade==4 +Type_Degrade=5 +elif $Type_Degrade==6 +Type_Degrade=7 +fi +elif $Variations_Formes==12 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +fi +var_Ra={$Ra/255} +var_Ga={$Ga/255} +var_Ba={$Ba/255} +var_Mina={min($var_Ra,$var_Ga,$var_Ba)} +var_Maxa={max($var_Ra,$var_Ga,$var_Ba)} +var_diffa={$var_Maxa-$var_Mina} +if $var_Maxa==$var_Mina +Ha=0 +elif $var_Maxa==$var_Ra +Ha={{{$var_Ga-$var_Ba}/$var_diffa}%6} +elif $var_Maxa==$var_Ga +Ha={{$var_Ba-$var_Ra}/$var_diffa+2} +else +Ha={{$var_Ra-$var_Ga}/$var_diffa+4} +fi +Ha*=60 +if $Ha<0 +Ha+=360 +fi +La={{$var_Maxa+$var_Mina}/2} +if $var_diffa==0 +Sa=0 +else +Sa={$var_diffa/(1-(abs(2*$La-1)))} +fi +Sa*=100 +La*=100 +var_Rb={$Rb/255} +var_Gb={$Gb/255} +var_Bb={$Bb/255} +var_Minb={min($var_Rb,$var_Gb,$var_Bb)} +var_Maxb={max($var_Rb,$var_Gb,$var_Bb)} +var_diffb={$var_Maxb-$var_Minb} +if $var_Maxb==$var_Minb +Hb=0 +elif $var_Maxb==$var_Rb +Hb={{{$var_Gb-$var_Bb}/$var_diffb}%6} +elif $var_Maxb==$var_Gb +Hb={{$var_Bb-$var_Rb}/$var_diffb+2} +else +Hb={{$var_Rb-$var_Gb}/$var_diffb+4} +fi +Hb*=60 +if $Hb<0 +Hb+=360 +fi +Lb={{$var_Maxb+$var_Minb}/2} +if $var_diffb==0 +Sb=0 +else +Sb={$var_diffb/(1-(abs(2*$Lb-1)))} +fi +Sb*=100 +Lb*=100 +rm[-1] +if $Type_Degrade==0||$Type_Degrade==1||$Type_Degrade==2||$Type_Degrade==3 +if $Type_Degrade==2||$Type_Degrade==3 +Ha=$Hb +Sa=$Sb +La=$Lb +Aa=$Ab +fi +Nb_Boucles=0 +Inc_H={$Variation_H/$Dimensions} +Sa+=$Decalage_S +if $Sa>100 Sa-=100 fi +La+=$Decalage_L +if $La>100 La-=100 fi +$Dimensions,$Dimensions,1,4 +repeat $Dimensions +if $Degrades_aleatoires==1 +if {{{$Nb_Boucles+1}%{round(u(2,{$Dimensions/{2+$Type_Degrade}}))}}==0} +if $H_Max_Ded_Alea>$H_Min_Ded_Alea Ha={round(u($H_Min_Ded_Alea,$H_Max_Ded_Alea))} else Ha={round(u($H_Max_Ded_Alea,$H_Min_Ded_Alea))} fi +if $S_Max_Ded_Alea>$S_Min_Ded_Alea Sa={round(u($S_Min_Ded_Alea,$S_Max_Ded_Alea))} else Sa={round(u($S_Max_Ded_Alea,$S_Min_Ded_Alea))} fi +if $L_Max_Ded_Alea>$L_Min_Ded_Alea La={round(u($L_Min_Ded_Alea,$L_Max_Ded_Alea))} else La={round(u($L_Max_Ded_Alea,$L_Min_Ded_Alea))} fi +fi +fi +if $Inverser_Degrade==0 +Ha_c={$Ha+$Decalage_H+($Nb_Boucles*$Inc_H)} +else +Ha_c={$Ha+$Decalage_H-($Nb_Boucles*$Inc_H)} +fi +if $Ha_c>359 Ha_c-=359 fi +if $Ha_c<0 Ha_c+=359 fi +Sa_c=$Sa +La_c=$La +if $Ha_c>=360 Ha_c=359 fi +if $Sa_c>100 Sa_c=100 fi +if $La_c>100 La_c=100 fi +if $Ha_c<0 Ha_c=0 fi +if $Sa_c<0 Sa_c=0 fi +if $La_c<0 La_c=0 fi +Sa_c/=100 +La_c/=100 +Ca={{1-{abs(2*$La_c-1)}}*$Sa_c} +hha={$Ha_c/60} +Xa={$Ca*(1-(abs($hha%2-1)))} +Ra_c=0 +Ga_c=0 +Ba_c=0 +if $hha>=0&&$hha<1 +Ra_c=$Ca +Ga_c=$Xa +elif $hha>=1&&$hha<2 +Ra_c=$Xa +Ga_c=$Ca +elif $hha>=2&&$hha<3 +Ga_c=$Ca +Ba_c=$Xa +elif $hha>=3&&$hha<4 +Ga_c=$Xa +Ba_c=$Ca +elif $hha>=4&&$hha<5 +Ra_c=$Xa +Ba_c=$Ca +else +Ra_c=$Ca +Ba_c=$Xa +fi +ma={$La_c-$Ca/2} +Ra_c={{$Ra_c+$ma}*255} +Ga_c={{$Ga_c+$ma}*255} +Ba_c={{$Ba_c+$ma}*255} +if $Type_Degrade==0||$Type_Degrade==2 +line[-1] $Nb_Boucles,0,$Nb_Boucles,{$Dimensions-1},1,$Ra_c,$Ga_c,$Ba_c,$Aa +elif $Type_Degrade==1||$Type_Degrade==3 +line[-1] 0,$Nb_Boucles,{$Dimensions-1},$Nb_Boucles,1,$Ra_c,$Ga_c,$Ba_c,$Aa +fi +Nb_Boucles+=1 +done +fi +if $Type_Degrade==4||$Type_Degrade==5||$Type_Degrade==6||$Type_Degrade==7 +Nb_Boucles=0 +if $Type_Degrade==4||$Type_Degrade==5 +if $Inverser_Degrade==0 +Inc_H={{$Ha-$Hb}/$Dimensions} +Inc_S={{$Sa-$Sb}/$Dimensions} +Inc_L={{$La-$Lb}/$Dimensions} +Inc_A={{$Aa-$Ab}/$Dimensions} +else +Inc_H={-1*{{$Ha-$Hb}/$Dimensions}} +Inc_S={-1*{{$Sa-$Sb}/$Dimensions}} +Inc_L={-1*{{$La-$Lb}/$Dimensions}} +Inc_A={-1*{{$Aa-$Ab}/$Dimensions}} +fi +else +if $Inverser_Degrade==0 +Inc_H={-1*{{$Ha-$Hb}/$Dimensions}} +Inc_S={-1*{{$Sa-$Sb}/$Dimensions}} +Inc_L={-1*{{$La-$Lb}/$Dimensions}} +Inc_A={-1*{{$Aa-$Ab}/$Dimensions}} +else +Inc_H={{$Ha-$Hb}/$Dimensions} +Inc_S={{$Sa-$Sb}/$Dimensions} +Inc_L={{$La-$Lb}/$Dimensions} +Inc_A={{$Aa-$Ab}/$Dimensions} +fi +fi +$Dimensions,$Dimensions,1,4 +repeat $Dimensions +if $Degrades_aleatoires==1 +if {{{$Nb_Boucles+1}%{round(u(2,{$Dimensions/10}))}}==0} +if $H_Max_Ded_Alea>$H_Min_Ded_Alea Ha={round(u($H_Min_Ded_Alea,$H_Max_Ded_Alea))} else Ha={round(u($H_Max_Ded_Alea,$H_Min_Ded_Alea))} fi +if $S_Max_Ded_Alea>$S_Min_Ded_Alea Sa={round(u($S_Min_Ded_Alea,$S_Max_Ded_Alea))} else Sa={round(u($S_Max_Ded_Alea,$S_Min_Ded_Alea))} fi +if $L_Max_Ded_Alea>$L_Min_Ded_Alea La={round(u($L_Min_Ded_Alea,$L_Max_Ded_Alea))} else La={round(u($L_Max_Ded_Alea,$L_Min_Ded_Alea))} fi +fi +fi +if $Valider_Variations_Canal_A==1 +Aa+=$Inc_A +if $Aa>255 Aa=255 Inc_A={-1*$Inc_A} fi +if $Aa<0 Aa=0 Inc_A={-1*$Inc_A} fi +fi +Ha_c={$Ha+$Decalage_H+($Nb_Boucles*$Inc_H)} +if $Ha_c>359 Ha_c-=359 fi +if $Ha_c<0 Ha_c+=359 fi +Sa_c={$Sa+$Decalage_S+($Nb_Boucles*$Inc_S)} +if $Sa_c>100 Sa_c-=100 fi +if $Sa_c<0 Sa_c+=100 fi +La_c={$La+$Decalage_L+($Nb_Boucles*$Inc_L)} +if $La_c>100 La_c-=100 fi +if $La_c<0 La_c+=100 fi +if $Ha_c>=360 Ha_c=359 fi +if $Sa_c>100 Sa_c=100 fi +if $La_c>100 La_c=100 fi +if $Ha_c<0 Ha_c=0 fi +if $Sa_c<0 Sa_c=0 fi +if $La_c<0 La_c=0 fi +Sa_c/=100 +La_c/=100 +Ca={{1-{abs(2*$La_c-1)}}*$Sa_c} +hha={$Ha_c/60} +Xa={$Ca*(1-(abs($hha%2-1)))} +Ra_c=0 +Ga_c=0 +Ba_c=0 +if $hha>=0&&$hha<1 +Ra_c=$Ca +Ga_c=$Xa +elif $hha>=1&&$hha<2 +Ra_c=$Xa +Ga_c=$Ca +elif $hha>=2&&$hha<3 +Ga_c=$Ca +Ba_c=$Xa +elif $hha>=3&&$hha<4 +Ga_c=$Xa +Ba_c=$Ca +elif $hha>=4&&$hha<5 +Ra_c=$Xa +Ba_c=$Ca +else +Ra_c=$Ca +Ba_c=$Xa +fi +ma={$La_c-$Ca/2} +Ra_c={{$Ra_c+$ma}*255} +Ga_c={{$Ga_c+$ma}*255} +Ba_c={{$Ba_c+$ma}*255} +if $Type_Degrade==4||$Type_Degrade==6 +line[-1] $Nb_Boucles,0,$Nb_Boucles,{$Dimensions-1},1,$Ra_c,$Ga_c,$Ba_c,$Aa +elif $Type_Degrade==5||$Type_Degrade==7 +line[-1] 0,$Nb_Boucles,{$Dimensions-1},$Nb_Boucles,1,$Ra_c,$Ga_c,$Ba_c,$Aa +fi +Nb_Boucles+=1 +done +fi +if $Variations_Formes==1 +fx_custom_deformation[-1] "(w+h)/"{20+$Parametre_Forme_A}" * cos(y*"{10+$Parametre_Forme_B}"/h)","1",1,1,1 +elif $Variations_Formes==2 +fx_custom_deformation[-1] "1","(w+h)/"{20+$Parametre_Forme_A}" * sin(x*"{10+$Parametre_Forme_B}"/w)",1,1,1 +elif $Variations_Formes==3 +if $Parametre_Forme_A<50 Parametre_Forme_A={{$Parametre_Forme_A+50}/100} else Parametre_Forme_A={{$Parametre_Forme_A-50}/100} fi +if $Parametre_Forme_B<50 Parametre_Forme_B={{$Parametre_Forme_B+50}/100} else Parametre_Forme_B={{$Parametre_Forme_B-50}/100} fi +fx_euclidean2polar[-1] $Parametre_Forme_A,$Parametre_Forme_B,1,1,1 +elif $Variations_Formes==4 +if $Parametre_Forme_A<50 Parametre_Forme_A={{$Parametre_Forme_A+50}/100} else Parametre_Forme_A={{$Parametre_Forme_A-50}/100} fi +if $Parametre_Forme_B<50 Parametre_Forme_B={{$Parametre_Forme_B+50}/100} else Parametre_Forme_B={{$Parametre_Forme_B-50}/100} fi +fx_euclidean2polar[-1] $Parametre_Forme_A,$Parametre_Forme_B,1,1,1 +elif $Variations_Formes==5 +fx_normalize_local[-1] {$Parametre_Forme_A+6},6,5,20,1,{{$Parametre_Forme_B+3}%23} +elif $Variations_Formes==6 +fx_normalize_local[-1] {$Parametre_Forme_A+6},6,5,20,1,{{$Parametre_Forme_B+3}%23} +elif $Variations_Formes==7 +fx_plaid_texture[-1] 50,2,0,90,0,300 +elif $Variations_Formes==8 +fx_symmetrizoscope[-1] 5,0,1,0 +elif $Variations_Formes==9 +fx_symmetrizoscope[-1] 5,0,1,0 +elif $Variations_Formes==10 +fx_warp_perspective[-1] 1.73,0,1,50,50,$Parametre_Forme_A,0,2 +elif $Variations_Formes==11 +fx_map_sphere[-1] {min($Dimensions,$Dimensions)},{min($Dimensions,$Dimensions)},90,0.5,0,0,20,0,0,0,0.5 +elif $Variations_Formes==12 +fx_map_sphere[-1] {min($Dimensions,$Dimensions)},{min($Dimensions,$Dimensions)},90,0.5,0,0,20,0,0,0,0.5 +fi +Denim_samj : +Dimension_Motif=$1 +Dilatation=$2 +Retourner_motif=$3 +Deformation_1=$4 +Deformation_2=$5 +Amplitude_Bruit=$6 +Amplitude_Bruit_2=$7 +Nettete=$8 +R_Couleur_Denim=$9 +V_Couleur_Denim=$10 +B_Couleur_Denim=$11 +A_Couleur_Denim=$12 +Largeur={w} +Hauteur={h} +$Largeur,$Hauteur,1,4 +fill_color[-1] $R_Couleur_Denim,$V_Couleur_Denim,$B_Couleur_Denim,$A_Couleur_Denim +to_rgba[-1] +fx_noise[-1] $Amplitude_Bruit,0,11,0 +$Dimension_Motif,$Dimension_Motif,1,4 +if $Retourner_motif==0 +line[-1] 0,$Dimension_Motif,$Dimension_Motif,0,1,0,0,0,255 +else +line[-1] 0,0,$Dimension_Motif,$Dimension_Motif,1,0,0,0,255 +fi +resize[-1] [-2],[-2],1,100%,0,2 +dilate_circ[-1] $Dilatation +samj_blend_20220419[-1,-2] alpha,1,1 +water[-1] {$Deformation_1/1000},{$Deformation_2/100} +fx_noise[-1] $Amplitude_Bruit_2,0,26,0 +sharpen[-1] $Nettete +rv[-2,-1] +rm[-1] +samj_EPPE_Transform : +X_Centre=$1 +Y_Centre=$2 +Rendu=$3 +euclidean2polar[-1] $X_Centre%,$Y_Centre%,1,1 +if $Rendu==0 +imagegrid[-1] $4,$5 +elif $Rendu==1 +imagegrid_hexagonal[-1] $6,$7 +elif $Rendu==2 +imagegrid_triangular[-1] $8,$9,$10,{1-($14/255)},$11,$12,$13 +elif $Rendu==3 +boxfitting[-1] $15,$16,$17,3 +fi +polar2euclidean[-1] $X_Centre%,$Y_Centre%,1,1 +samj_Formes_Couleurs_Variees_Dans_Image : +Variations_Formes=$1 +Parametre_Forme_A=$2 +Parametre_Forme_B=$3 +Parametre_Forme_C=$4 +Parametre_Forme_D=$5 +Canal_R=$6 +Canal_V=$7 +Canal_B=$8 +Canal_A=$9 +Valider_Variations_Canal_R=$10 +Valider_Variations_Canal_V=$11 +Valider_Variations_Canal_B=$12 +Valider_Variations_Canal_A=$13 +Type_Variations=$14 +Decalage=$15 +Etendue=$16 +Couleurs_aleatoires=$17 +Flou=$18 +Deformation=$19 +Bruit=$20 +Canal_Alpha=$21 +Largeur_Origine={w} +Hauteur_Origine={h} +Total_Boucles=0 +Nb_Boucle=0 +Val_R=$Canal_R +Val_V=$Canal_V +Val_B=$Canal_B +Val_A=$Canal_A +R_imp=0 +V_imp=0 +B_imp=0 +A_imp=0 +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] 0,0,0,255 +if $Variations_Formes==0||$Variations_Formes==2||$Variations_Formes==4||$Variations_Formes==6||$Variations_Formes==8||$Variations_Formes==10||$Variations_Formes==11||$Variations_Formes==13||$Variations_Formes==14 +Total_Boucles=$Largeur_Origine +elif $Variations_Formes==1||$Variations_Formes==3||$Variations_Formes==5||$Variations_Formes==7||$Variations_Formes==9||$Variations_Formes==12||$Variations_Formes==15 +Total_Boucles=$Hauteur_Origine +fi +repeat $Total_Boucles +if $Couleurs_aleatoires==1 +if $Decalage==0 +if $Nb_Boucle%round(u(1,255))==0 +Canal_R={round(u(0,255))} +Canal_V={round(u(0,255))} +Canal_B={round(u(0,255))} +Val_R=$Canal_R +Val_V=$Canal_V +Val_B=$Canal_B +fi +else +if $Nb_Boucle%$Decalage==0 +Canal_R={round(u(0,255))} +Canal_V={round(u(0,255))} +Canal_B={round(u(0,255))} +Val_R=$Canal_R +Val_V=$Canal_V +Val_B=$Canal_B +fi +fi +fi +if $Valider_Variations_Canal_R==1 +if $Type_Variations==0 +Val_R={$Val_R+1} +if $Val_R>{$Canal_R+$Decalage} Val_R=$Canal_R fi +R_imp={{$Val_R+$Decalage}%$Etendue} +elif $Type_Variations==1 +Val_R={$Val_R-1} +if $Val_R<{$Canal_R-$Decalage} Val_R=$Canal_R fi +R_imp={{$Val_R-$Decalage}%$Etendue} +elif $Type_Variations==2 +Val_R={$Val_R+1} +if $Val_R>255 Val_R=$Canal_R fi +R_imp={{$Val_R+$Decalage}%$Etendue} +elif $Type_Variations==3 +Val_R={$Val_R-1} +if $Val_R<0 Val_R=$Canal_R fi +R_imp={{$Val_R-$Decalage}%$Etendue} +elif $Type_Variations==4 +Val_R+={round(u(0,3))} +if $Val_R>255 Val_R=$Canal_R fi +R_imp={{$Val_R+$Decalage}%$Etendue} +elif $Type_Variations==5 +Val_R-={round(u(0,3))} +if $Val_R<0 Val_R=$Canal_R fi +R_imp={{$Val_R-$Decalage}%$Etendue} +fi +else +R_imp=$Canal_R +fi +if $Valider_Variations_Canal_V==1 +if $Type_Variations==0 +Val_V+=1 +if $Val_V>{$Canal_V+$Decalage} Val_V=$Canal_V fi +V_imp={{$Val_V+$Decalage}%$Etendue} +elif $Type_Variations==1 +Val_V-=1 +if $Val_V<{$Canal_V-$Decalage} Val_V=$Canal_V fi +V_imp={{$Val_V-$Decalage}%$Etendue} +elif $Type_Variations==2 +Val_V+=1 +if $Val_V>255 Val_V=$Canal_V fi +V_imp={{$Val_V+$Decalage}%$Etendue} +elif $Type_Variations==3 +Val_V-=1 +if $Val_V<0 Val_V=$Canal_V fi +V_imp={{$Val_V-$Decalage}%$Etendue} +elif $Type_Variations==4 +Val_V+={round(u(0,3))} +if $Val_V>255 Val_V=$Canal_V fi +V_imp={{$Val_V+$Decalage}%$Etendue} +elif $Type_Variations==5 +Val_V-={round(u(0,3))} +if $Val_V<0 Val_V=$Canal_V fi +V_imp={{$Val_V-$Decalage}%$Etendue} +fi +else +V_imp=$Canal_V +fi +if $Valider_Variations_Canal_B==1 +if $Type_Variations==0 +Val_B+=1 +if $Val_B>{$Canal_B+$Decalage} Val_B=$Canal_B fi +B_imp={{$Val_B+$Decalage}%$Etendue} +elif $Type_Variations==1 +Val_B-=1 +if $Val_B<{$Canal_B-$Decalage} Val_V=$Canal_B fi +B_imp={{$Val_B-$Decalage}%$Etendue} +elif $Type_Variations==2 +Val_B+=1 +if $Val_B>255 Val_B=$Canal_B fi +B_imp={{$Val_B+$Decalage}%$Etendue} +elif $Type_Variations==3 +Val_B-=1 +if $Val_B<0 Val_V=$Canal_B fi +B_imp={{$Val_B-$Decalage}%$Etendue} +elif $Type_Variations==4 +Val_B+={round(u(0,3))} +if $Val_B>255 Val_B=$Canal_B fi +B_imp={{$Val_B+$Decalage}%$Etendue} +elif $Type_Variations==5 +Val_B-={round(u(0,3))} +if $Val_B<0 Val_V=$Canal_B fi +B_imp={{$Val_B-$Decalage}%$Etendue} +fi +else +B_imp=$Canal_B +fi +if $Valider_Variations_Canal_A==1 +if $Type_Variations==0 +Val_A+=1 +if $Val_A>{$Canal_A+$Decalage} Val_A=$Canal_A fi +A_imp={{$Val_A+$Decalage}%$Etendue} +elif $Type_Variations==1 +Val_A-=1 +if $Val_A<{$Canal_A-$Decalage} Val_A=$Canal_A fi +A_imp={{$Val_A-$Decalage}%$Etendue} +elif $Type_Variations==2 +Val_A+=1 +if $Val_A>255 Val_A=$Canal_A fi +A_imp={{$Val_A+$Decalage}%$Etendue} +elif $Type_Variations==3 +Val_A-=1 +if $Val_A<0 Val_A=$Canal_A fi +A_imp={{$Val_A-$Decalage}%$Etendue} +elif $Type_Variations==4 +Val_A+={round(u(0,3))} +if $Val_A>255 Val_A=$Canal_A fi +A_imp={{$Val_A+$Decalage}%$Etendue} +elif $Type_Variations==5 +Val_A-={round(u(0,3))} +if $Val_A<0 Val_A=$Canal_A fi +A_imp={{$Val_A-$Decalage}%$Etendue} +fi +else +A_imp=$Canal_A +fi +if $Variations_Formes==0||$Variations_Formes==2||$Variations_Formes==4||$Variations_Formes==6||$Variations_Formes==8||$Variations_Formes==10||$Variations_Formes==11||$Variations_Formes==13||$Variations_Formes==14 +line[-1] $Nb_Boucle,0,$Nb_Boucle,{$Hauteur_Origine-1},1,$R_imp,$V_imp,$B_imp,$A_imp +elif $Variations_Formes==1||$Variations_Formes==3||$Variations_Formes==5||$Variations_Formes==7||$Variations_Formes==9||$Variations_Formes==12||$Variations_Formes==15 +line[-1] 0,$Nb_Boucle,{$Largeur_Origine-1},$Nb_Boucle,1,$R_imp,$V_imp,$B_imp,$A_imp +fi +Nb_Boucle+=1 +done +if $Variations_Formes==0 +fx_custom_deformation[-1] "(w+h)/"{20+$Parametre_Forme_A}" * cos(y*"{10+$Parametre_Forme_B}"/h)","1",1,1,1 +elif $Variations_Formes==1 +fx_custom_deformation[-1] "1","(w+h)/"{20+$Parametre_Forme_A}" * sin(x*"{10+$Parametre_Forme_B}"/w)",1,1,1 +elif $Variations_Formes==2 +if $Parametre_Forme_A<50 Parametre_Forme_A={{$Parametre_Forme_A+50}/100} else Parametre_Forme_A={{$Parametre_Forme_A-50}/100} fi +if $Parametre_Forme_B<50 Parametre_Forme_B={{$Parametre_Forme_B+50}/100} else Parametre_Forme_B={{$Parametre_Forme_B-50}/100} fi +fx_euclidean2polar[-1] $Parametre_Forme_A,$Parametre_Forme_B,1,1,1 +elif $Variations_Formes==3 +if $Parametre_Forme_A<50 Parametre_Forme_A={{$Parametre_Forme_A+50}/100} else Parametre_Forme_A={{$Parametre_Forme_A-50}/100} fi +if $Parametre_Forme_B<50 Parametre_Forme_B={{$Parametre_Forme_B+50}/100} else Parametre_Forme_B={{$Parametre_Forme_B-50}/100} fi +fx_euclidean2polar[-1] $Parametre_Forme_A,$Parametre_Forme_B,1,1,1 +elif $Variations_Formes==6 +fx_normalize_tiles[-1] {$Parametre_Forme_A+4},1,{$Parametre_Forme_B/100*255},{{$Parametre_Forme_C-100}/100*-255},{{$Parametre_Forme_D+3}%22} +elif $Variations_Formes==7 +fx_normalize_tiles[-1] 1,{$Parametre_Forme_A+4},{$Parametre_Forme_B/100*255},{{$Parametre_Forme_C-100}/100*-255},{{$Parametre_Forme_D+3}%22} +elif $Variations_Formes==8 +fx_normalize_local[-1] {$Parametre_Forme_A+6},6,5,20,1,{{$Parametre_Forme_B+3}%23} +elif $Variations_Formes==9 +fx_normalize_local[-1] {$Parametre_Forme_A+6},6,5,20,1,{{$Parametre_Forme_B+3}%23} +elif $Variations_Formes==10 +fx_plaid_texture[-1] 50,2,0,90,0,300 +elif $Variations_Formes==11 +fx_symmetrizoscope[-1] 5,0,1,0 +elif $Variations_Formes==12 +fx_symmetrizoscope[-1] 5,0,1,0 +elif $Variations_Formes==13 +fx_warp_perspective[-1] 1.73,0,1,50,50,$Parametre_Forme_A,0,2 +elif $Variations_Formes==14 +fill_color[-2] 0,0,0,0 +fx_map_sphere[-1] {min($Largeur_Origine,$Hauteur_Origine)},{min($Largeur_Origine,$Hauteur_Origine)},90,0.5,0,0,20,0,0,0,0.5 +autocrop[-1] +elif $Variations_Formes==15 +fill_color[-2] 0,0,0,0 +fx_map_sphere[-1] {min($Largeur_Origine,$Hauteur_Origine)},{min($Largeur_Origine,$Hauteur_Origine)},90,0.5,0,0,20,0,0,0,0.5 +fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 apply_channels[-1] "fx_noise "$Bruit",0,22,1",1 fi +samj_blend_20220419[-2,-1] alpha,1,0 +samj_Lignes_H_ou_V_Colorees : +R_a=$1 +V_a=$2 +B_a=$3 +R_b=$4 +V_b=$5 +B_b=$6 +R_c=$7 +V_c=$8 +B_c=$9 +R_d=$10 +V_d=$11 +B_d=$12 +R_e=$13 +V_e=$14 +B_e=$15 +R_f=$16 +V_f=$17 +B_f=$16 +R_g=$19 +V_g=$20 +B_g=$21 +R_h=$22 +V_h=$23 +B_h=$25 +R_i=$25 +V_i=$26 +B_i=$27 +R_j=$28 +V_j=$29 +B_j=$30 +R_k=$31 +V_k=$32 +B_k=$33 +R_l=$34 +V_l=$35 +B_l=$36 +Transparence=$37 +Largeur=$38 +Nombre_De_Lignes=$39 +Hauteur_De_Une_Ligne=$40 +Rotation=$41 +Boucles=$42 +Position_H=0 +$Largeur,{$Nombre_De_Lignes*$Hauteur_De_Une_Ligne},1,4 +repeat $Nombre_De_Lignes +repeat $Hauteur_De_Une_Ligne +if $Boucles%12==0 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_a,$V_a,$B_a,$Transparence +elif $Boucles%12==1 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_b,$V_b,$B_b,$Transparence +elif $Boucles%12==2 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_c,$V_c,$B_c,$Transparence +elif $Boucles%12==3 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_d,$V_d,$B_d,$Transparence +elif $Boucles%12==4 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_e,$V_e,$B_e,$Transparence +elif $Boucles%12==5 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_f,$V_f,$B_f,$Transparence +elif $Boucles%12==6 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_g,$V_g,$B_g,$Transparence +elif $Boucles%12==7 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_h,$V_h,$B_h,$Transparence +elif $Boucles%12==8 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_i,$V_i,$B_i,$Transparence +elif $Boucles%12==9 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_j,$V_j,$B_j,$Transparence +elif $Boucles%12==10 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_k,$V_k,$B_k,$Transparence +elif $Boucles%12==11 +line[-1] 0,$Position_H,$Largeur,$Position_H,1,$R_l,$V_l,$B_l,$Transparence +fi +Position_H+=1 +done +Boucles+=1 +done +if $Rotation==1 permute[1] yxzc fi +rv[-2,-1] +samj_Marbre : +Plasma_alpha=$1 +Plasma_beta=$2 +Plasma_scale=$3 +Flou=$4 +Gris=$5 +Bruit_Spread=$6 +Attenuation=$7 +Colorisation=$8 +R_a=$9 +V_a=$10 +B_a=$11 +Blend_Image=$12 +Mode_blend=$13 +Opacity_blend=$14 +if $Blend_Image==1 ++Je_passe_l_hiver_en_Floride[-1] +fi +plasma[-1] $Plasma_alpha,$Plasma_beta,$Plasma_scale +blur[-1] $Flou +structuretensors[-1] +abs[-1] +spread[-1] $Bruit_Spread +pow[-1] $Gris +to_gray[-1] +blur[-1] $Attenuation +n[-1] 0,255 +to_rgb[-1] +if $Colorisation==1 +{w},{h},1,3 +fill_color[-1] $R_a,$V_a,$B_a +blend_median[-1,-2] +fi +if $Blend_Image==1 +to_rgb[-2] +gimp_blend_1651[-2,-1] $Mode_blend,2,$Opacity_blend,0 +fi +samj_Mosaic_A : +foreach { +if $5==1 mirror x elif $5==2 mirror y elif $5==3 mirror x mirror y fi +c 0,255 +add 1 +fx_superpixels $1,50,5,1,1,1,255,255,255,255 +to_rgba ++- +replace_color[-1] 0%,0,255,255,255,255,0,0,0,0 +replace_color[-1] 99%,0,127,127,127,255,255,255,255,255 +erode[-1] $2 +replace_color[-1] 0%,0,0,0,0,0,0,0,0,255 +replace_color[-1] 0%,0,255,255,255,255,0,0,0,0 +blend alpha +replace_color 0%,0,0,0,0,255,0,0,0,0 +if $3==1 +fx_smooth_antialias 5,10,0.8,0,50,50 +samj_Reptorian_fx_emboss_relief_20210508 {$4*36},20,165,500,2,0,1,1,100,0,50,50 +if $6==1 ++samj_Barbouillage_Paint_Daub 2,2,100,0.2,1,4,1,0,8 +rv +fx_blend[-1,-2] 6,0,100,1,"1/2 - 1/4*cos(pi*a) - 1/4*cos(pi*b)" +fi +fi +if $5==1 mirror x elif $5==2 mirror y elif $5==3 mirror x mirror y fi +c 0,255 +} +samj_Reptorian_fx_emboss_relief_20210508 : +to_a foreach { split_opacity if $8 +samj_Reptorian_em[0] {$6?$2+180:$2},{$1?$4/100:$3/100},$5 samj_blend_20220419[^1] grainmerge,{$9/100} else samj_Reptorian_em[0] {$6?$2+180:$2},{$1?$4/100:$3/100},$5 fi if $7 a c else k[0] fi } +samj_Reptorian_em : +samj_Reptorian_emboss_image $* +samj_Reptorian_emboss_image : +-skip ${2=1},${3=0} +l[0] +luminance +fx_gradient2rgb $3,0,100,0,0 +[0] +repeat 2 l[$>] rgb2hsv s c l[0] + {$1+($>*180)} % 360 done a c hsv2rgb to_rgb s c rm[1,2] done done +l[0] n 128,255 done l[1] negate n 0,128 done ++fill_color[0] 128,128,128,255 rv blend grainmerge - 128 mul $2 + 128 cut 0,255 +done +samj_Mosaic_B : +foreach { +to_rgba. +sharpen. $2 +deform. $3 +blur. {round({{{{w}+{h}}}*$4/10000})} +mosaic. $1 +n. 0,255 +if $5>0 ++isophotes. {round({iM}/2)+1} +dilate_circ. $5 +replace_color. 255,0,127,127,127,255,0,0,0,255 +blend alpha +fi +if $6==1 +if $8==1 mirror. x elif $8==2 mirror. y elif $8==3 mirror. x mirror. y fi +fx_smooth_antialias. 5,10,0.8,0,50,50 +samj_Reptorian_fx_emboss_relief_20210508. {$7*36},20,165,500,2,0,1,1,100,0,50,50 +if $9==1 ++samj_Barbouillage_Paint_Daub. 2,2,100,0.2,1,4,1,0,8 +rv +fx_blend[-1,-2] 6,0,100,1,"1/2 - 1/4*cos(pi*a) - 1/4*cos(pi*b)" +fi +if $8==1 mirror. x elif $8==2 mirror. y elif $8==3 mirror. x mirror. y fi +fi +} +samj_Motif_Plasma : +Details=$1 +PlasmaA=$2 +PlasmaB=$3 +Flou=$4 +Melange_Mode=$5 +Melange_Pourcent=$6 +Graine=$7 +Boucle=0 +Larg={w} +Haut={h} +rm[0] +repeat $Details +repeat 2 +$Larg,$Haut,1,3 +Boucle+=1 +if $Graine>0 srand {$Graine*$Boucle} fi +plasma[-1] $PlasmaA,$PlasmaB +blur[-1] {round($Larg/$Flou)} +c[-1] 0,255 +done +blend_seamless $Melange_Mode,0,$Melange_Pourcent +done +samj_Motifs_7200 : +Details=$1 +Plasma_Bruit=$2 +PlasmaA=$3 +PlasmaB=$4 +Flou=$5 +Melange_Mode=$6 +Melange_Pourcent=$7 +Graine=$8 +Effet=$9 +R_a=$10 +V_a=$11 +B_a=$12 +A_a=$13 +Ajouter_Rolling_Guidance=$14 +Ajouter_Mess_With_Bits=$15 +Ajouter_CeKoaSa_004=$16 +Boucle=0 +Larg={w} +Haut={h} +rm[0] +repeat $Details +repeat 2 +$Larg,$Haut,1,3 +Boucle+=1 +if $Graine>0 srand {$Graine*$Boucle} fi +if $Plasma_Bruit==1 +noise[-1] {$Larg*$Haut*$Boucle},1 +blur[-1] {16+$PlasmaA+$PlasmaB+$Boucle+{{round($Larg/512)}}} +else +plasma[-1] $PlasmaA,$PlasmaB +blur[-1] {round($Larg/$Flou)} +fi +c[-1] 0,255 +done +blend_seamless $Melange_Mode,0,$Melange_Pourcent +done +if $Ajouter_Mess_With_Bits==1 fx_mess_with_bits[-1] 1,15,1,1,0,15,100,0,0,50,50 fi +if $Effet==1 +fx_color_abstraction[-1] 10,10,0.2,0,50,50 +elif $Effet==2 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +elif $Effet==3 +fx_color_abstraction[-1] 10,10,0.2,0,50,50 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +elif $Effet==4 ++samj_Soft_Random_Shades_7200[-1] $R_a,$V_a,$B_a,$A_a,1,66,0.1 +fx_blend_seamless[-1,-2] 1,0,85,2,0 +fx_color_abstraction[-1] 10,10,0.2,0,50,50 +elif $Effet==5 ++samj_Soft_Random_Shades_7200[-1] $R_a,$V_a,$B_a,$A_a,1,66,0.1 +fx_blend_seamless[-1,-2] 1,0,85,2,0 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +elif $Effet==6 ++samj_Soft_Random_Shades_7200[-1] $R_a,$V_a,$B_a,$A_a,1,66,0.1 +fx_blend_seamless[-1,-2] 1,0,85,2,0 +fx_color_abstraction[-1] 10,10,0.2,0,50,50 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +elif $Effet==7 +samj_Barbouillage_Paint_Daub[-1] 2,2,100,0.2,1,4,1,0,8 +elif $Effet==8 +samj_Barbouillage_Paint_Daub[-1] 2,2,100,0.2,1,4,1,0,8 ++samj_Soft_Random_Shades_7200[-1] $R_a,$V_a,$B_a,$A_a,1,66,0.1 +fx_blend_seamless[-1,-2] 1,0,85,2,0 +elif $Effet==9 +samj_Barbouillage_Paint_Daub[-1] 2,2,100,0.2,1,4,1,0,8 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +elif $Effet==10 +samj_Barbouillage_Paint_Daub[-1] 2,2,100,0.2,1,4,1,0,8 ++samj_Soft_Random_Shades_7200[-1] $R_a,$V_a,$B_a,$A_a,1,66,0.1 +fx_blend_seamless[-1,-2] 1,0,85,2,0 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +fi +if $Ajouter_Rolling_Guidance==1 rolling_guidance[-1] {u(3,5)},{u(8,12)},{u(0.3,0.6)} fi +if $Ajouter_CeKoaSa_004==1 samj_CeKoaSa_004 30,0,0,0.8,0,0 fi +samj_Soft_Random_Shades_7200 : +R_a=$1 +V_a=$2 +B_a=$3 +A_a=$4 +Variation_A=$5 +Variation_B=$6 +Variation_C=$7 +Largeur={w} +Hauteur={h} +srand {1+$R_a+$V_a+$B_a+$A_a} +{$Largeur},{$Hauteur},1,4 +{$Largeur},{$Hauteur},1,4 +rm[-3] +fill_color[-1,-2] $R_a,$V_a,$B_a,$A_a +samj_Random_Plasma_7200[-1] $Variation_A,$Variation_B +blend[-1,-2] luminance +if $Variation_C==0 +else +{$Largeur},{$Hauteur},1,4 +{$Largeur},{$Hauteur},1,4 +fill_color[-1,-2] $R_a,$V_a,$B_a,$A_a +samj_Random_Plasma_7200[-1] $Variation_A,$Variation_B +blend[-1,-2] luminance +blend[-1,-2] edges,{0.5+$Variation_C},0 +fi +crop[-1] 0,0,{$Largeur-8},{$Hauteur-1} +resize[-1] {$Largeur},{$Hauteur} +samj_Random_Plasma_7200 : +Melange=$1 +Flou=$2 ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +blur[-1] {{w+h}/$Flou} ++Je_passe_l_hiver_en_Floride[-1] +srand {1+$Melange+$Flou} +plasma[-1] 1,1,10 +blur[-1] {{w+h}/$Flou} +blend_seamless[-2,-1] 1,0,25% +if $Melange==0 +samj_7200_gb_bwd_version_1_7_8[-1] 1 +elif $Melange==1 +samj_7200_gb_bwd_version_1_7_8[-1] 2 +elif $Melange==2 +samj_7200_gb_bwd_version_1_7_8[-1,-2] 1 +elif $Melange==3 +samj_7200_gb_bwd_version_1_7_8[-1,-2] 2 +fi +blend_edges[-2,-1] 5 +blend[-1,-2] alpha +samj_7200_gb_bwd_version_1_7_8 : +to_color +if $1==1 foreach { sh 0,2 rgb2srgb. rm. } +elif $1==2 foreach { sh 0,2 lab2rgb. rgb2srgb. rm. } +fi +samj_Motifs_7200_VarianteA : +Details=$1 +Plasma_Bruit=$2 +PlasmaA=$3 +PlasmaB=$4 +Flou=$5 +Melange_Mode=$6 +Melange_Pourcent=$7 +Graine=$8 +Effet=$9 +R_a=$10 +V_a=$11 +B_a=$12 +A_a=$13 +Ajouter_Rolling_Guidance=$14 +Ajouter_Mess_With_Bits=$15 +Ajouter_CeKoaSa_004=$16 +Boucle=0 +Larg={w} +Haut={h} +rm[0] +repeat $Details +repeat 2 +$Larg,$Haut,1,4 +fill_color[-1] $R_a,$V_a,$B_a,$A_a +$Larg,$Haut,1,4 +Boucle+=1 +if $Graine>0 srand {$Graine*$Boucle} fi +if $Plasma_Bruit==1 +noise[-1] {$Larg*$Haut*$Boucle},1 +blur[-1] {16+$PlasmaA+$PlasmaB+$Boucle+{{round($Larg/512)}}} +else +plasma[-1] $PlasmaA,$PlasmaB +blur[-1] {round($Larg/$Flou)} +fi +c[-1] 0,255 +blend[-1,-2] edges,0.5,0 +$Larg,$Haut,1,4 +fill_color[-1] $R_a,$V_a,$B_a,$A_a +blend[-1,-2] luminance +blur[-1] {round($Larg/$Flou)} +done +blend_seamless $Melange_Mode,0,$Melange_Pourcent +done +if $Ajouter_Mess_With_Bits==1 fx_mess_with_bits[-1] 1,15,1,1,0,15,100,0,0,50,50 fi +if $Effet==1 +fx_color_abstraction[-1] 10,10,0.2,0,50,50 +elif $Effet==2 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +elif $Effet==3 +fx_color_abstraction[-1] 10,10,0.2,0,50,50 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +elif $Effet==4 ++samj_Soft_Random_Shades_7200[-1] $R_a,$V_a,$B_a,$A_a,1,66,0.1 +fx_blend_seamless[-1,-2] 1,0,85,2,0 +fx_color_abstraction[-1] 10,10,0.2,0,50,50 +elif $Effet==5 ++samj_Soft_Random_Shades_7200[-1] $R_a,$V_a,$B_a,$A_a,1,66,0.1 +fx_blend_seamless[-1,-2] 1,0,85,2,0 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +elif $Effet==6 ++samj_Soft_Random_Shades_7200[-1] $R_a,$V_a,$B_a,$A_a,1,66,0.1 +fx_blend_seamless[-1,-2] 1,0,85,2,0 +fx_color_abstraction[-1] 10,10,0.2,0,50,50 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +elif $Effet==7 +samj_Barbouillage_Paint_Daub[-1] 2,2,100,0.2,1,4,1,0,8 +elif $Effet==8 +samj_Barbouillage_Paint_Daub[-1] 2,2,100,0.2,1,4,1,0,8 ++samj_Soft_Random_Shades_7200[-1] $R_a,$V_a,$B_a,$A_a,1,66,0.1 +fx_blend_seamless[-1,-2] 1,0,85,2,0 +elif $Effet==9 +samj_Barbouillage_Paint_Daub[-1] 2,2,100,0.2,1,4,1,0,8 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +elif $Effet==10 +samj_Barbouillage_Paint_Daub[-1] 2,2,100,0.2,1,4,1,0,8 ++samj_Soft_Random_Shades_7200[-1] $R_a,$V_a,$B_a,$A_a,1,66,0.1 +fx_blend_seamless[-1,-2] 1,0,85,2,0 +fx_brushify[-1] 8,0.25,4,64,25,12,0,2,4,0.2,0.5,30,1,1,1,5,0,0.2,1 +fi +if $Ajouter_CeKoaSa_004==1 samj_CeKoaSa_004 30,0,0,0.8,0,0 fi +if $Ajouter_Rolling_Guidance==1 rolling_guidance[-1] {u(3,5)},{u(8,12)},{u(0.3,0.6)} fi +$Larg,$Haut,1,4 +samj_Soft_Random_Shades[-1] $R_a,$V_a,$B_a,255,1,66,0.1 +blend[-1,-2] seamless +if $Ajouter_Mess_With_Bits==1 $Larg,$Haut,1,4 samj_Soft_Random_Shades[-1] $R_a,$V_a,$B_a,255,1,66,0.1 fx_blend[-2,-1] 6,0,100,1,"1/2 - 1/4*cos(pi*a) - 1/4*cos(pi*b)" fi +n[-1] 0,255 +samj_Motifs_7200_VarianteB : +Details=$1 +Bruit=$2 +Deformation=$3 +Dispersion=$19 +Cut_vs_Norm=$20 +Seamless_vs_Edges=$21 +Boucle=0 +Larg={w} +Haut={h} +rm[0] +repeat $Details +Boucle+=1 +$Larg,$Haut,1,3 +noise[-1] {{$Dispersion*$Boucle*$Bruit}+$Larg*$Haut*{round(u(1,32))}},1 +blur[-1] {round(u({16*{1+{$Larg/512}}},{32*{1+{$Larg/512}}}))} +if $$Deformation>0 deform[-1] {$Deformation*{$DispersionDeform+$Boucle}} fi +if $Cut_vs_Norm==1 c 0,255 else n 0,255 fi +done +if $Seamless_vs_Edges==1 blend seamless else blend edges fi +fx_sketchbw[-1] $4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18 +samj_Motifs_7200_VarianteC : +Details=$1 +Bruit=$2 +FlouA=$3 +Deformation=$4 +Seamless_vs_EdgesA=$5 +FlouB=$6 +R_a=$7 +V_a=$8 +B_a=$9 +Seamless_vs_EdgesB=$10 +Etendue_Couleurs=$11 +Ajouter_Degrade=$12 +Larg={w} +Haut={h} +rm[0] +repeat $Details +$Larg,$Haut,1,3 +noise[-1] {$Larg*$Haut*{round(u(1,$Bruit))}},1 +blur[-1] {round(u(10,$FlouA))} +deform[-1] {round(u(0,$Deformation))} +if $Etendue_Couleurs==0 c[-1] 0,255 n[-1] 0,255 elif $Etendue_Couleurs==1 c[-1] 0,255 elif $Etendue_Couleurs==2 n[-1] 0,255 fi +done +if $Seamless_vs_EdgesA==1 blend seamless else blend edges fi +blur[-1] {round(u(1,$FlouB))} +rolling_guidance {u(3,5)},{u(8,12)},{u(0.3,0.6)} +$Larg,$Haut,1,3 +fill_color[-1] $R_a,$V_a,$B_a +if $Seamless_vs_EdgesB==1 rv[-1,-2] blend seamless else blend edges fi +fx_color_abstraction[-1] 10,10,0.2,0,50,50 +if $Ajouter_Degrade==1 +to_rgba[-1] +$Larg,$Haut,1,4 +samj_Linear_Gradient_CIE_Lab[-1] $13,$14,$15,$16,$17,$18,$19,$20,$21,$22 +fx_blend_average_all $23 +fi +samj_Motifs_Aleatoires_Symetriques_Degrades : +Type_Degrade=$1 +Dimensions=$2 +Forme=$3 +Boundary=$4 +Symetrie=$5 +Utiliser_Gimp_Feltpen=$6 +Angle={180/$Forme} +Inc_Angle=$Angle +if $Type_Degrade==0 +samj_Degrades_XYZ_CIE[-1] 6,$Dimensions,240,240,40,255,120,40,240,255,0,0,0,100,64,64,0,0,1,0,100,-128,128,-128,128,0,5,0,0 +elif $Type_Degrade==1 +samj_Degrades_XYZ_CIE[-1] 0,$Dimensions,0,0,0,255,0,0,0,255,0,0,0,100,64,64,0,{round(u(0,2))},1,0,100,-128,128,-128,128,0,{round(u(0,2))},0,0 +elif $Type_Degrade==2 +samj_Degrades_HSL_TSL[-1] 4,$Dimensions,240,240,40,255,120,40,240,255,0,0,0,360,100,100,0,1,0,718,75,100,0,100,0,0,0,0 +elif $Type_Degrade==3 +rm[-1] +$Dimensions,$Dimensions,1,4 +samj_Formes_Couleurs_Variees_Dans_Image 4,0,0,0,0,192,128,64,255,1,1,1,0,3,127,255,1,0,0,0,1 +fi +fx_euclidean2polar[-1] 0.5,0.5,1,1,0 +repeat $Forme +symmetrize[-1] 50%,50%,$Angle,$Boundary,0,0 +Angle+=$Inc_Angle +done +if $Utiliser_Gimp_Feltpen==1 +fx_feltpen[-1] 1000,50,1,0.1,1,2 +fi +if $Symetrie==1 +symmetrize[-1] 50%,50%,180,1,0,0 +elif $Symetrie==2 +symmetrize[-1] 50%,50%,180,1,0,0 +symmetrize[-1] 50%,50%,90,1,0,0 +fi +samj_Degrades_XYZ_CIE : +Type_Degrade=$1 +Dimensions=$2 +Ra=$3 +Ga=$4 +Ba=$5 +Aa=$6 +Rb=$7 +Gb=$8 +Bb=$9 +Ab=$10 +Decalage_L=$11 +Decalage_a=$12 +Decalage_b=$13 +Variation_L=$14 +Variation_a=$15 +Variation_b=$16 +Valider_Variations_Canal_A=$17 +Trou_Noir=$18 +Degrades_aleatoires=$19 +L_Min_Ded_Alea=$20 +L_Max_Ded_Alea=$21 +a_Min_Ded_Alea=$22 +a_Max_Ded_Alea=$23 +b_Min_Ded_Alea=$24 +b_Max_Ded_Alea=$25 +Inverser_Degrade=$26 +Variations_Formes=$27 +Parametre_Forme_A=$28 +Parametre_Forme_B=$29 +Nb_Boucles=0 +Inc_L=0 +Inc_a=0 +Inc_b=0 +Inc_Alpha=0 +nt_Ra={$Ra/255} +nt_Ga={$Ga/255} +nt_Ba={$Ba/255} +if $nt_Ra>0.04045 +nt_Ra={({{$nt_Ra+0.055}/1.055})^2.4} +else +nt_Ra/=12.92 +fi +if $nt_Ga>0.04045 +nt_Ga={({{$nt_Ga+0.055}/1.055})^2.4} +else +nt_Ga/=12.92 +fi +if $nt_Ba>0.04045 +nt_Ba={({{$nt_Ba+0.055}/1.055})^2.4} +else +nt_Ba/=12.92 +fi +nt_Ra*=100 +nt_Ga*=100 +nt_Ba*=100 +Xa={$nt_Ra*0.4124564+$nt_Ga*0.3575761+$nt_Ba*0.1804375} +Ya={$nt_Ra*0.2126729+$nt_Ga*0.7151522+$nt_Ba*0.0721750} +Za={$nt_Ra*0.0193339+$nt_Ga*0.1191920+$nt_Ba*0.9503041} +Xca=$Xa +Yca=$Ya +Zca=$Za +ref_Xa=95.047 +ref_Ya=100.000 +ref_Za=108.883 +nt_Xa={$Xca/$ref_Xa} +nt_Ya={$Yca/$ref_Ya} +nt_Za={$Zca/$ref_Za} +if $nt_Xa>0.008856 +nt_Xa={($nt_Xa)^{1/3}} +else +nt_Xa={{7.787*$nt_Xa}+{16/116}} +fi +if $nt_Ya>0.008856 +nt_Ya={($nt_Ya)^{1/3}} +else +nt_Ya={{7.787*$nt_Ya}+{16/116}} +fi +if $nt_Za>0.008856 +nt_Za={($nt_Za)^{1/3}} +else +nt_Za={{7.787*$nt_Za}+{16/116}} +fi +CIE_La={{116*$nt_Ya}-16} +CIE_aa={500*{$nt_Xa-$nt_Ya}} +CIE_ba={200*{$nt_Ya-$nt_Za}} +nt_Ra={$Rb/255} +nt_Ga={$Gb/255} +nt_Ba={$Bb/255} +if $nt_Ra>0.04045 +nt_Ra={({{$nt_Ra+0.055}/1.055})^2.4} +else +nt_Ra/=12.92 +fi +if $nt_Ga>0.04045 +nt_Ga={({{$nt_Ga+0.055}/1.055})^2.4} +else +nt_Ga/=12.92 +fi +if $nt_Ba>0.04045 +nt_Ba={({{$nt_Ba+0.055}/1.055})^2.4} +else +nt_Ba/=12.92 +fi +nt_Ra*=100 +nt_Ga*=100 +nt_Ba*=100 +Xb={$nt_Ra*0.4124564+$nt_Ga*0.3575761+$nt_Ba*0.1804375} +Yb={$nt_Ra*0.2126729+$nt_Ga*0.7151522+$nt_Ba*0.0721750} +Zb={$nt_Ra*0.0193339+$nt_Ga*0.1191920+$nt_Ba*0.9503041} +Xca=$Xb +Yca=$Yb +Zca=$Zb +ref_Xa=95.047 +ref_Ya=100.000 +ref_Za=108.883 +nt_Xa={$Xca/$ref_Xa} +nt_Ya={$Yca/$ref_Ya} +nt_Za={$Zca/$ref_Za} +if $nt_Xa>0.008856 +nt_Xa={($nt_Xa)^{1/3}} +else +nt_Xa={{7.787*$nt_Xa}+{16/116}} +fi +if $nt_Ya>0.008856 +nt_Ya={($nt_Ya)^{1/3}} +else +nt_Ya={{7.787*$nt_Ya}+{16/116}} +fi +if $nt_Za>0.008856 +nt_Za={($nt_Za)^{1/3}} +else +nt_Za={{7.787*$nt_Za}+{16/116}} +fi +CIE_Lb={{116*$nt_Ya}-16} +CIE_ab={500*{$nt_Xa-$nt_Ya}} +CIE_bb={200*{$nt_Ya-$nt_Za}} +if $Variations_Formes==1 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +elif $Variations_Formes==2 +if $Type_Degrade==0 +Type_Degrade=1 +elif $Type_Degrade==2 +Type_Degrade=3 +elif $Type_Degrade==4 +Type_Degrade=5 +elif $Type_Degrade==6 +Type_Degrade=7 +fi +elif $Variations_Formes==3 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +Valider_Variations_Canal_A=0 +elif $Variations_Formes==4 +if $Type_Degrade==0 +Type_Degrade=1 +elif $Type_Degrade==2 +Type_Degrade=3 +elif $Type_Degrade==4 +Type_Degrade=5 +elif $Type_Degrade==6 +Type_Degrade=7 +fi +Valider_Variations_Canal_A=0 +elif $Variations_Formes==5 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +elif $Variations_Formes==6 +if $Type_Degrade==0 +Type_Degrade=1 +elif $Type_Degrade==2 +Type_Degrade=3 +elif $Type_Degrade==4 +Type_Degrade=5 +elif $Type_Degrade==6 +Type_Degrade=7 +fi +elif $Variations_Formes==7 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +elif $Variations_Formes==8 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +elif $Variations_Formes==9 +if $Type_Degrade==0 +Type_Degrade=1 +elif $Type_Degrade==2 +Type_Degrade=3 +elif $Type_Degrade==4 +Type_Degrade=5 +elif $Type_Degrade==6 +Type_Degrade=7 +fi +elif $Variations_Formes==10 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +elif $Variations_Formes==11 +if $Type_Degrade==0 +Type_Degrade=1 +elif $Type_Degrade==2 +Type_Degrade=3 +elif $Type_Degrade==4 +Type_Degrade=5 +elif $Type_Degrade==6 +Type_Degrade=7 +fi +elif $Variations_Formes==12 +if $Type_Degrade==1 +Type_Degrade=0 +elif $Type_Degrade==3 +Type_Degrade=2 +elif $Type_Degrade==5 +Type_Degrade=4 +elif $Type_Degrade==7 +Type_Degrade=6 +fi +fi +rm[-1] +if $Type_Degrade==0||$Type_Degrade==1||$Type_Degrade==2||$Type_Degrade==3 +if $Type_Degrade==2||$Type_Degrade==3 +CIE_La=$CIE_Lb +CIE_aa=$CIE_ab +CIE_ba=$CIE_bb +Aa=$Ab +fi +Nb_Boucles=0 +Inc_L={$Variation_L/$Dimensions} +Inc_a={$Variation_a/$Dimensions} +Inc_b={$Variation_b/$Dimensions} +$Dimensions,$Dimensions,1,4 +repeat $Dimensions +if $Degrades_aleatoires==1 +if {{$Nb_Boucles+1}%{round(u(2,{$Dimensions/{2+$Type_Degrade}}))}}==0 +if $L_Max_Ded_Alea>$L_Min_Ded_Alea CIE_La={round(u($L_Min_Ded_Alea,$L_Max_Ded_Alea))} else CIE_La={round(u($L_Max_Ded_Alea,$L_Min_Ded_Alea))} fi +if $a_Max_Ded_Alea>$a_Min_Ded_Alea CIE_aa={round(u($a_Min_Ded_Alea,$a_Max_Ded_Alea))} else CIE_aa={round(u($a_Max_Ded_Alea,$a_Min_Ded_Alea))} fi +if $b_Max_Ded_Alea>$b_Min_Ded_Alea CIE_ba={round(u($b_Min_Ded_Alea,$b_Max_Ded_Alea))} else CIE_ba={round(u($b_Max_Ded_Alea,$b_Min_Ded_Alea))} fi +fi +fi +if $Inverser_Degrade==0 +CIE_Lca={$CIE_La+$Decalage_L+($Nb_Boucles*$Inc_L)} +CIE_aca={$CIE_aa+$Decalage_a+($Nb_Boucles*$Inc_a)} +CIE_bca={$CIE_ba+$Decalage_b+($Nb_Boucles*$Inc_b)} +else +CIE_Lca={$CIE_La+$Decalage_L-($Nb_Boucles*$Inc_L)} +CIE_aca={$CIE_aa+$Decalage_a-($Nb_Boucles*$Inc_a)} +CIE_bca={$CIE_ba+$Decalage_b-($Nb_Boucles*$Inc_b)} +fi +if $Trou_Noir==0 +if $CIE_Lca>100 CIE_Lca=100 fi +if $CIE_Lca<0 CIE_Lca=0 fi +if $CIE_aca>127 CIE_aca=127 fi +if $CIE_aca<-128 CIE_aca=-128 fi +if $CIE_bca>127 CIE_bca=127 fi +if $CIE_bca<-128 CIE_bca=-128 fi +elif $Trou_Noir==1 +if $CIE_Lca>100 Inc_L={-1*$Inc_L} CIE_Lca=100 fi +if $CIE_Lca<0 Inc_L={-1*$Inc_L} CIE_Lca=0 fi +if $CIE_aca>127 Inc_a={-1*$Inc_a} CIE_aca=0 fi +if $CIE_aca<-128 Inc_a={-1*$Inc_a} CIE_aca=0 fi +if $CIE_bca>127 Inc_b={-1*$Inc_b} CIE_bca=0 fi +if $CIE_bca<-128 Inc_b={-1*$Inc_b} CIE_bca=0 fi +elif $Trou_Noir==2 +if $CIE_Lca>100 CIE_Lca-=100 fi +if $CIE_Lca<0 CIE_Lca+=100 fi +if $CIE_aca>127 CIE_aca-=255 fi +if $CIE_aca<-128 CIE_aca+=255 fi +if $CIE_bca>127 CIE_bca-=255 fi +if $CIE_bca<-128 CIE_bca+=255 fi +fi +nt_Yca={{$CIE_Lca+16}/116} +nt_Xca={$CIE_aca/500+$nt_Yca} +nt_Zca={$nt_Yca-$CIE_bca/200} +if {($nt_Yca)^3}>0.008856 +nt_Yca={($nt_Yca)^3} +else +nt_Yca={{$nt_Yca-16/116}/7.787} +fi +if {($nt_Xca)^3}>0.008856 +nt_Xca={($nt_Xca)^3} +else +nt_Xca={{$nt_Xca-16/116}/7.787} +fi +if {($nt_Zca)^3}>0.008856 +nt_Zca={($nt_Zca)^3} +else +nt_Zca={{$nt_Zca-16/116}/7.787} +fi +ref_Xca=95.047 +ref_Yca=100.000 +ref_Zca=108.883 +Xca={$ref_Xca*$nt_Xca} +Yca={$ref_Yca*$nt_Yca} +Zca={$ref_Zca*$nt_Zca} +vcXa=$Xca +vcYa=$Yca +vcZa=$Zca +nt_X={$vcXa/100} +nt_Y={$vcYa/100} +nt_Z={$vcZa/100} +nt_R={$nt_X*3.2404542+$nt_Y*-1.5371385+$nt_Z*-0.4985314} +nt_G={$nt_X*-0.9692660+$nt_Y*1.8760108+$nt_Z*0.0415560} +nt_B={$nt_X*0.0556434+$nt_Y*-0.2040259+$nt_Z*1.0572252} +if $nt_R>0.0031308 +nt_R={1.055*{($nt_R)^{1/2.4}}-0.055} +else +nt_R={12.92*$nt_R} +fi +if {$nt_G>0.0031308} +nt_G={1.055*{($nt_G)^{1/2.4}}-0.055} +else +nt_G={12.92*$nt_G} +fi +if $nt_B>0.0031308 +nt_B={1.055*{($nt_B)^{1/2.4}}-0.055} +else +nt_B={12.92*$nt_B} +fi +Rconv={$nt_R*255} +Gconv={$nt_G*255} +Bconv={$nt_B*255} +if $Rconv>255 Rconv=255 fi +if $Rconv<0 Rconv=0 fi +if $Gconv>255 Gconv=255 fi +if $Gconv<0 Gconv=0 fi +if $Bconv>255 Bconv=255 fi +if $Bconv<0 Bconv=0 fi +if $Type_Degrade==0||$Type_Degrade==2 +line[-1] $Nb_Boucles,0,$Nb_Boucles,{$Dimensions-1},1,$Rconv,$Gconv,$Bconv,$Aa +elif $Type_Degrade==1||$Type_Degrade==3 +line[-1] 0,$Nb_Boucles,{$Dimensions-1},$Nb_Boucles,1,$Rconv,$Gconv,$Bconv,$Aa +fi +Nb_Boucles+=1 +done +fi +if $Type_Degrade==4||$Type_Degrade==5||$Type_Degrade==6||$Type_Degrade==7 +Nb_Boucles=0 +Inc_L={{$CIE_La-$CIE_Lb}/$Dimensions} +Inc_a={{$CIE_aa-$CIE_ab}/$Dimensions} +Inc_b={{$CIE_ba-$CIE_bb}/$Dimensions} +Inc_Alpha={{$Ab-$Aa}/$Dimensions} +$Dimensions,$Dimensions,1,4 +repeat $Dimensions +if $Degrades_aleatoires==1 +if {{$Nb_Boucles+1}%{round(u(2,{$Dimensions/{2+$Type_Degrade}}))}}==0 +if $L_Max_Ded_Alea>$L_Min_Ded_Alea CIE_La={round(u($L_Min_Ded_Alea,$L_Max_Ded_Alea))} else CIE_La={round(u($L_Max_Ded_Alea,$L_Min_Ded_Alea))} fi +if $a_Max_Ded_Alea>$a_Min_Ded_Alea CIE_aa={round(u($a_Min_Ded_Alea,$a_Max_Ded_Alea))} else CIE_aa={round(u($a_Max_Ded_Alea,$a_Min_Ded_Alea))} fi +if $b_Max_Ded_Alea>$b_Min_Ded_Alea CIE_ba={round(u($b_Min_Ded_Alea,$b_Max_Ded_Alea))} else CIE_ba={round(u($b_Max_Ded_Alea,$b_Min_Ded_Alea))} fi +fi +fi +if $Inverser_Degrade==0 +CIE_Lca={$CIE_La+$Decalage_L+($Nb_Boucles*$Inc_L)} +CIE_aca={$CIE_aa+$Decalage_a+($Nb_Boucles*$Inc_a)} +CIE_bca={$CIE_ba+$Decalage_b+($Nb_Boucles*$Inc_b)} +fi +if $Inverser_Degrade==1||$Type_Degrade==6||$Type_Degrade==7 +CIE_Lca={$CIE_La+$Decalage_L-($Nb_Boucles*$Inc_L)} +CIE_aca={$CIE_aa+$Decalage_a-($Nb_Boucles*$Inc_a)} +CIE_bca={$CIE_ba+$Decalage_b-($Nb_Boucles*$Inc_b)} +fi +if $Valider_Variations_Canal_A==1 +Aa+=$Inc_Alpha +if {$Aa>255} Aa=255 fi +if {$Aa<0} Aa=0 fi +fi +if $Trou_Noir==0 +if $CIE_Lca>100 CIE_Lca=100 fi +if $CIE_Lca<0 CIE_Lca=0 fi +if $CIE_aca>127 CIE_aca=127 fi +if $CIE_aca<-128 CIE_aca=-128 fi +if $CIE_bca>127 CIE_bca=127 fi +if $CIE_bca<-128 CIE_bca=-128 fi +elif $Trou_Noir==1 +if $CIE_Lca>100 Inc_L={-1*$Inc_L} CIE_Lca=$CIE_Lb fi +if $CIE_Lca<0 Inc_L={-1*$Inc_L} CIE_Lca=$CIE_La fi +if $CIE_aca>127 Inc_a={-1*$Inc_a} CIE_aca=0 fi +if $CIE_aca<-128 Inc_a={-1*$Inc_a} CIE_aca=0 fi +if $CIE_bca>127 Inc_b={-1*$Inc_b} CIE_bca=0 fi +if $CIE_bca<-128 Inc_b={-1*$Inc_b} CIE_bca=0 fi +elif $Trou_Noir==2 +if $CIE_Lca>100 CIE_Lca-=100 fi +if $CIE_Lca<0 CIE_Lca+=100 fi +if $CIE_aca>127 CIE_aca-=255 fi +if $CIE_aca<-128 CIE_aca+=255 fi +if $CIE_bca>127 CIE_bca-=255 fi +if $CIE_bca<-128 CIE_bca+=255 fi +fi +nt_Yca={{$CIE_Lca+16}/116} +nt_Xca={$CIE_aca/500+$nt_Yca} +nt_Zca={$nt_Yca-$CIE_bca/200} +if {($nt_Yca)^3}>0.008856 +nt_Yca={($nt_Yca)^3} +else +nt_Yca={{$nt_Yca-16/116}/7.787} +fi +if {($nt_Xca)^3}>0.008856 +nt_Xca={($nt_Xca)^3} +else +nt_Xca={{$nt_Xca-16/116}/7.787} +fi +if {($nt_Zca)^3}>0.008856 +nt_Zca={($nt_Zca)^3} +else +nt_Zca={{$nt_Zca-16/116}/7.787} +fi +ref_Xca=95.047 +ref_Yca=100.000 +ref_Zca=108.883 +Xca={$ref_Xca*$nt_Xca} +Yca={$ref_Yca*$nt_Yca} +Zca={$ref_Zca*$nt_Zca} +vcXa=$Xca +vcYa=$Yca +vcZa=$Zca +nt_X={$vcXa/100} +nt_Y={$vcYa/100} +nt_Z={$vcZa/100} +nt_R={$nt_X*3.2404542+$nt_Y*-1.5371385+$nt_Z*-0.4985314} +nt_G={$nt_X*-0.9692660+$nt_Y*1.8760108+$nt_Z*0.0415560} +nt_B={$nt_X*0.0556434+$nt_Y*-0.2040259+$nt_Z*1.0572252} +if $nt_R>0.0031308 +nt_R={1.055*{($nt_R)^{1/2.4}}-0.055} +else +nt_R={12.92*$nt_R} +fi +if $nt_G>0.0031308 +nt_G={1.055*{($nt_G)^{1/2.4}}-0.055} +else +nt_G={12.92*$nt_G} +fi +if $nt_B>0.0031308 +nt_B={1.055*{($nt_B)^{1/2.4}}-0.055} +else +nt_B={12.92*$nt_B} +fi +Rconv={$nt_R*255} +Gconv={$nt_G*255} +Bconv={$nt_B*255} +if $Rconv>255 Rconv=255 fi +if $Rconv<0 Rconv=0 fi +if $Gconv>255 Gconv=255 fi +if $Gconv<0 Gconv=0 fi +if $Bconv>255 Bconv=255 fi +if $Bconv<0 Bconv=0 fi +if $Type_Degrade==4||$Type_Degrade==6 +line[-1] $Nb_Boucles,0,$Nb_Boucles,{$Dimensions-1},1,$Rconv,$Gconv,$Bconv,$Aa +elif $Type_Degrade==5||$Type_Degrade==7 +line[-1] 0,$Nb_Boucles,{$Dimensions-1},$Nb_Boucles,1,$Rconv,$Gconv,$Bconv,$Aa +fi +Nb_Boucles+=1 +done +fi +if $Variations_Formes==1 +fx_custom_deformation[-1] "(w+h)/"{20+$Parametre_Forme_A}" * cos(y*"{10+$Parametre_Forme_B}"/h)","1",1,1,1 +elif $Variations_Formes==2 +fx_custom_deformation[-1] "1","(w+h)/"{20+$Parametre_Forme_A}" * sin(x*"{10+$Parametre_Forme_B}"/w)",1,1,1 +elif $Variations_Formes==3 +if $Parametre_Forme_A<50 Parametre_Forme_A={{$Parametre_Forme_A+50}/100} else Parametre_Forme_A={{$Parametre_Forme_A-50}/100} fi +if $Parametre_Forme_B<50 Parametre_Forme_B={{$Parametre_Forme_B+50}/100} else Parametre_Forme_B={{$Parametre_Forme_B-50}/100} fi +fx_euclidean2polar[-1] $Parametre_Forme_A,$Parametre_Forme_B,1,1,1 +elif $Variations_Formes==4 +if $Parametre_Forme_A<50 Parametre_Forme_A={{$Parametre_Forme_A+50}/100} else Parametre_Forme_A={{$Parametre_Forme_A-50}/100} fi +if $Parametre_Forme_B<50 Parametre_Forme_B={{$Parametre_Forme_B+50}/100} else Parametre_Forme_B={{$Parametre_Forme_B-50}/100} fi +fx_euclidean2polar[-1] $Parametre_Forme_A,$Parametre_Forme_B,1,1,1 +elif $Variations_Formes==5 +fx_normalize_local[-1] {$Parametre_Forme_A+6},6,5,20,1,{{$Parametre_Forme_B+3}%23} +elif $Variations_Formes==6 +fx_normalize_local[-1] {$Parametre_Forme_A+6},6,5,20,1,{{$Parametre_Forme_B+3}%23} +elif $Variations_Formes==7 +fx_plaid_texture[-1] 50,2,0,90,0,300 +elif $Variations_Formes==8 +fx_symmetrizoscope[-1] 5,0,1,0 +elif $Variations_Formes==9 +fx_symmetrizoscope[-1] 5,0,1,0 +elif $Variations_Formes==10 +fx_warp_perspective[-1] 1.73,0,1,50,50,$Parametre_Forme_A,0,2 +elif $Variations_Formes==11 +fx_map_sphere[-1] {min($Dimensions,$Dimensions)},{min($Dimensions,$Dimensions)},90,0.5,0,0,20,0,0,0,0.5 +elif $Variations_Formes==12 +fx_map_sphere[-1] {min($Dimensions,$Dimensions)},{min($Dimensions,$Dimensions)},90,0.5,0,0,20,0,0,0,0.5 +fi +samj_Lignes_Perpendiculaires : +Boucle=0 +{w},{h},1,4 +repeat $6 +rotate[-1] 90 +srand {$8+$Boucle} +stripes_y[-1] $5 +rotate[-1] -90 +srand {$9+$Boucle} +stripes_y[-1] $5 +Boucle=$Boucle+1 +done +dilate[-1] $7 +n[-1] 0,255 +{w},{h},1,4 +fill_color[-1] $1,$2,$3,$4 +samj_blend_20220419[-1,-2] average +if $10==0 +rm[0] +else +to_rgba[0] +mode=${arg\ 1+$11,add,alpha,and,average,blue,burn,darken,difference,,divide,dodge,edges,exclusion,freeze,grainextract,grainmerge,green,hardlight,,hardmix,hue,interpolation,lighten,lightness,linearburn,linearlight,luminance,,multiply,negation,or,overlay,pinlight,red,reflect,saturation,seamless,seamless_mixed,,screen,shapeareamax,shapeareamax0,shapeareamin,shapeareamin0,shapeaverage,shapeaverage0,,shapemedian,shapemedian0,shapemin,shapemin0,shapemax,shapemax0,softburn,softdodge,,softlight,stamp,subtract,value,vividlight,xor} +blend $mode,$12 +fi +samj_Points_Aleatoires_001 : +Iterations=$1 +R_Point=$2 +V_Point=$3 +B_Point=$4 +A_Point=$5 +Mode=$6 +Couleurs_Aleatoires=$7 +Continuite=$8 +Choix=0 +Cavalier=0 +Largeur_Origine={w} +Hauteur_Origine={h} +Position_X={round(u(0,{$Largeur_Origine-1}))} +Position_Y={round(u(0,{$Hauteur_Origine-1}))} +{w},{h},1,4 +fill_color[-1] 0,0,0,0 +rm[-2] +repeat $Iterations +if $Couleurs_Aleatoires==1 +R_Point={round(u(0,255))} +V_Point={round(u(0,255))} +B_Point={round(u(0,255))} +A_Point=255 +fi +if $Continuite==0 +Position_X={round(u(0,{$Largeur_Origine-1}))} +Position_Y={round(u(0,{$Hauteur_Origine-1}))} +fi +repeat $Largeur_Origine+$Hauteur_Origine +Choix={round(u(0,1))} +if $Mode==0 +Inc_X={{round(u(0,2))}-1} +Inc_Y={{round(u(0,2))}-1} +elif $Mode==1 +Inc_X={{round(u(0,2))}-1} +Inc_Y={{round(u(0,{$|}))%3}-1} +elif $Mode==2 +Inc_X={{round(u(0,{$|}))%3}-1} +Inc_Y={{round(u(0,2))}-1} +elif $Mode==3 +if $Choix==0 +Cavalier={round(u(0,7))} +else +Cavalier={round(u(0,4095)%8)} +fi +if $Cavalier==0 +Inc_X=-1 +Inc_Y=2 +elif $Cavalier==1 +Inc_X=1 +Inc_Y=2 +elif $Cavalier==2 +Inc_X=2 +Inc_Y=1 +elif $Cavalier==3 +Inc_X=2 +Inc_Y=-1 +elif $Cavalier==4 +Inc_X=1 +Inc_Y=-2 +elif $Cavalier==5 +Inc_X=-1 +Inc_Y=-2 +elif $Cavalier==6 +Inc_X=-2 +Inc_Y=-1 +elif $Cavalier==7 +Inc_X=-2 +Inc_Y=1 +fi +elif $Mode==4 +Inc_X={{round(u(0,8))}-{round(u(0,8))}} +if $Choix==0 +Inc_Y=$Inc_X +else +Inc_Y={0-$Inc_X} +fi +elif $Mode==5 +if {$Choix==0} +Inc_X={{round(u(0,8))}-{round(u(0,8))}} +Inc_Y=0 +else +Inc_X=0 +Inc_Y={{round(u(0,8))}-{round(u(0,8))}} +fi +elif $Mode==6 +Choix={round(u(0,3))} +if $Choix==0 +Inc_X={{round(u(0,8))}-{round(u(0,8))}} +Inc_Y=$Inc_X +elif $Choix==1 +Inc_X={{round(u(0,8))}-{round(u(0,8))}} +Inc_Y=0 +elif $Choix==2 +Inc_X=0 +Inc_Y={{round(u(0,8))}-{round(u(0,8))}} +elif $Choix==3 +Inc_X={{round(u(0,8))}-{round(u(0,8))}} +Inc_Y={0-$Inc_X} +fi +fi +Position_X+=$Inc_X +if {$Position_X<0} +Position_X={$Largeur_Origine-1} +fi +if $Position_X>{$Largeur_Origine-1} +Position_X=0 +fi +Position_Y+=$Inc_Y +if $Position_Y<0 +Position_Y={$Hauteur_Origine-1} +fi +if $Position_Y>{$Hauteur_Origine-1} +Position_Y=0 +fi +point[-1] $Position_X,$Position_Y,0,1,$R_Point,$V_Point,$B_Point,$A_Point +done +done +samj_pouring : +Largeur_Origine={w} +Hauteur_Origine={h} +to_rgb +if $1==0 +pixelsort -,x +elif $1==1 +pixelsort -,y +elif $1==2 +pixelsort +,x +elif $1==3 +pixelsort +,y +elif $1==4 +pixelsort -,xy +elif $1==5 +pixelsort -,yx +elif $1==6 +pixelsort +,xy +elif $1==7 +pixelsort +,yx +fi +if $4>0 +crop {w*$4%},{h*$4%},{w*{100-$4}%},{h*{100-$4}%} +resize $Largeur_Origine,$Hauteur_Origine +fi +twirl $2,50%,50%,3 +if $3==0 +fx_custom_deformation "(w+h)/20 * cos(y*20/h)","(w+h)/20 * sin(x*20/w)",1,1,3 +elif $3==1 +fx_kaleidoscope 50,50,0,0,100,0,3 +elif $3==2 +fx_custom_deformation "(w+h)/20 * cos(y*20/h)","(w+h)/20 * sin(x*20/w)",1,1,3 +fx_array_mirror 1,0,0,2,0,0,0 +elif $3==3 +fx_kaleidoscope 50,50,0,0,100,0,3 +fx_array_mirror 1,0,0,2,0,0,0 +elif $3==5 +fx_array_mirror 1,0,0,2,0,0,0 +fi +samj_Pseudo_Vitrail : +foreach { +repeat {$10+1} samj_Base_Pseudo_Vitrail $1,$2,$3,$4,$5,$6,$7,$8,$9 done +pow {1+$11} +} +samj_Base_Pseudo_Vitrail : +if $1>0 autoindex {$1+1} fi +mosaic $2 +if $3==1 fx_voronoi 160,1,0,50,3,0,0,0,0,0,0,0,0,0,0,0 fi +blur $4 ++isophotes {iM} +if $5>1 dilate[-1] $5 fi +replace_color[-1] 255,0,127,127,127,255,0,0,0,255 +replace_color[-1] 1,0,0,0,0,255,$6,$7,$8,$9 +blend alpha +samj_Motifs_Rapides: +srand $1 fx_array_color {round({w/100*{20.01-$2}})+1},{round({h/100*{20.01-$2}})+1},1 +if $4>0 srand $3 deform {{w+h}/1000*$4} fi +if $5>0 Larg={w} Haut={h} resize {round(w/$6)*$6},{round(h/$6)*$6} split y,$6 split x,$6 append y append x split y,$6 append x resize $Larg,$Haut fi +if $8>0 srand $7 spread $8 fi +if $9==1 blur $10 fi +if $11==1 {w},{h},1,4 fill_color[-1] $12,$13,$14,$15 blend average fi +if $16==1 symmetrize 50%,50%,180 symmetrize 50%,50%,90 fi +if $17==1 resize {w/2},{h/2} +mirror x +mirror y append_tiles 2,2 fi +samj_Motifs_Rapides_B : +Hauteur={h} +Largeur={w} +srand $2 +rm[0] +if $1==1 {$Largeur/$3},1,1,3,u([256,256,256]) else {$Hauteur/$3},1,1,3,u([256,256,256]) rotate 90 fi +n 0,255 +resize $Largeur,$Hauteur +if $4==1 shift 50%,50%,0,0,2 resize {round($Largeur/$5)*$5},{round($Hauteur/$5)*$5} split y,$5 split x,$5 append y append x split y,$5 append x resize $Largeur,$Hauteur fi +samj_Courtepointe : +Cossin=$1 +Cossin_Deux=$2 +Repetition=$3 +Croix=$4 +Texture=$5 +Courbes_Interactives_Couleurs=$6 +rorschach[-1] {$Cossin}%,1 +if $Cossin_Deux==1 +n[-1] 64,192 +fi +n[-1] 0,255 +repeat $Repetition +fx_array_mirror[-1] 1,0,0,2,0,0 +done +if $Croix==1 +fx_symmetrizoscope[-1] 5,0,1,0 +fi +if {$Texture==1} +samj_Texture_Granuleuse[-1] 0.5,20,80,0,0 +fi +if $Courbes_Interactives_Couleurs==0 +x_color_curves[-1] rgb +elif $Courbes_Interactives_Couleurs==1 +x_color_curves[-1] cmy +elif $Courbes_Interactives_Couleurs==2 +x_color_curves[-1] cmyk +elif $Courbes_Interactives_Couleurs==3 +x_color_curves[-1] hsi +elif $Courbes_Interactives_Couleurs==4 +x_color_curves[-1] hsl +elif $Courbes_Interactives_Couleurs==5 +x_color_curves[-1] hsv +elif $Courbes_Interactives_Couleurs==6 +x_color_curves[-1] lab +elif $Courbes_Interactives_Couleurs==7 +x_color_curves[-1] lch +elif $Courbes_Interactives_Couleurs==8 +x_color_curves[-1] ycbcr +fi +samj_Rays_Of_Colors : +Color_Intensity=$1 +Color_Density=($2/512*w) +Radius=$3 +Border_smoothness=$4 +Border_width=$5 +Merge_Layers=$6 +R_a=$7 +V_a=$8 +B_a=$9 +to_rgb[-1] ++Je_passe_l_hiver_en_Floride[-1] +fill_color[-1] $R_a,$V_a,$B_a +repeat $Color_Intensity +R_Couleur={round(u)*255} +V_Couleur={round(u)*255} +B_Couleur={round(u)*255} +X_point={round(u*w)} +Y_point={round(u*h)} +polygon[-1] 4,$X_point,$Y_point,$X_point,{$Y_point+$Color_Density},{$X_point+$Color_Density},{$Y_point+$Color_Density},{$X_point+$Color_Density},$Y_point,1,$R_Couleur,$V_Couleur,$B_Couleur,255 +done +fx_textured_glass[-1] 40,40,1,1,0,2,0 +fx_map_sphere[-1] {w},{h},$Radius,0.5,0,$Border_smoothness,$Border_width,0,0,100,3 +fill_color[-2] $R_a,$V_a,$B_a +repeat $Color_Intensity +R_Couleur={round(u)*255} +V_Couleur={round(u)*255} +B_Couleur={round(u)*255} +X_point={round(u*w)} +Y_point={round(u*h)} +polygon[-2] 4,$X_point,$Y_point,$X_point,{$Y_point+$Color_Density},{$X_point+$Color_Density},{$Y_point+$Color_Density},{$X_point+$Color_Density},$Y_point,1,$R_Couleur,$V_Couleur,$B_Couleur,255 +done +fx_textured_glass[-2] 40,40,1,1,0,2,0 +fx_map_sphere[-2] {w},{h},$Radius,0.5,0,$Border_smoothness,$Border_width,0,0,100,3 +if $Merge_Layers==1 +samj_blend_20220419[-2,-1] add +fi +samj_Soft_Random_Shades : +R_a=$1 +V_a=$2 +B_a=$3 +A_a=$4 +Variation_A=$5 +Variation_B=$6 +Variation_C=$7 +Largeur={w} +Hauteur={h} +{$Largeur},{$Hauteur},1,4 +{$Largeur},{$Hauteur},1,4 +rm[-3] +fill_color[-1,-2] $R_a,$V_a,$B_a,$A_a +samj_Random_Plasma[-1] $Variation_A,$Variation_B +samj_blend_20220419[-1,-2] luminance +if $Variation_C==0 +else +{$Largeur},{$Hauteur},1,4 +{$Largeur},{$Hauteur},1,4 +fill_color[-1,-2] $R_a,$V_a,$B_a,$A_a +samj_Random_Plasma[-1] $Variation_A,$Variation_B +samj_blend_20220419[-1,-2] luminance +samj_blend_20220419[-1,-2] edges,{0.5+$Variation_C},0 +fi +crop[-1] 0,0,{$Largeur-8},{$Hauteur-1} +resize[-1] {$Largeur},{$Hauteur} +samj_rien_rendering : +Je_passe_l_hiver_en_Floride[-1] +samj_Steps_V2 : +Pixelise_X=$1 +Pixelise_Y=$2 +Area_Valeur=$3 +Area_is_high_connectivity=$4 +Isophotes_Valeur=$5 +Dilate_Circle_Valeur=$6 +Smoothness=$7 +BG=$8 +BG_Color=$9 +BG_Variation=$10 ++Je_passe_l_hiver_en_Floride[-1] +to_rgba[-1] +if $BG==1 ++Je_passe_l_hiver_en_Floride[-1] +fi +pixelize[-1,-2] $Pixelise_X,$Pixelise_Y +area[-1] $Area_Valeur,$Area_is_high_connectivity +c[-1] 0,255 +n[-1] 0,255 +isophotes[-1] $Isophotes_Valeur +dilate_circ[-1] $Dilate_Circle_Valeur +to_graya[-1] +fx_blend_edges[-1,-2] 1,$Smoothness,0 +if $BG==1 +blur[-2] {{w+h}/$BG_Variation} +pow[-2] $BG_Color +pixelize[-2] $Pixelise_X,$Pixelise_Y +samj_blend_20220419[-1,-2] alpha +fi +samj_Tissu_Fond_Flou : +X_Origine={round(w/100*$1)} +Y_Origine={round(h/100*$2)} +X_Fin={round(w/100*$3)} +Y_Fin={round(h/100*$4)} +Deplacement_A=$5 +Tissu=$6 +Forme=$7 +Blend_0pacity=$8 +Inversion=$9 +Angle_Rotation=$10 +Deplacement_B=$11 +Flou=$12 +Coeff_Flou=$13 +Largeur={w} +Hauteur={h} +at_line[-1] $X_Origine,$Y_Origine,0,$X_Fin,$X_Fin,0 +resize[-1] $Largeur,$Hauteur +to_rgb[-1] +if $Tissu==1 ++Je_passe_l_hiver_en_Floride[-1] +if $Forme==0 +permute[-1] yxzc +elif $Forme==1 +permute[-1] yxzc +mirror[-1] y +elif $Forme==2 +mirror[-2] x +permute[-1] yxzc +mirror[-1] y +elif $Forme==3 +mirror[-2] x +permute[-1] yxzc +fi +resize[-1] $Largeur,$Hauteur +if $Deplacement_B>0 shift[-1] 0,$Deplacement_B%,0,0,2 fi +if $Deplacement_A>0 shift[-2] $Deplacement_A%,0,0,0,2 fi +if $Inversion==1 rv[-2,-1] fi +samj_blend_20220419[-1,-2] average,$Blend_0pacity,0 +else +if $Deplacement_A>0 shift[-1] $Deplacement_A%,0,0,0,2 fi +fi +if $Angle_Rotation>0 rotate[-1] $Angle_Rotation,1,2,50%,50% fi +if $Flou>0 blur[-1] {$Flou*{10^$Coeff_Flou}} fi +samj_Tissu_Fond_Flou_preview : +foreach { +samj_Tissu_Fond_Flou[-1] $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13 +to_rgba +l[0] +line $1%,$2%,$3%,$4%,1,0xF0F0F0F0,255,255,255,255 +line $1%,$2%,$3%,$4%,1,0x0F0F0F0F,0,0,0,255 +circle $1%,$2%,4,1,255,0,0,255 +circle $3%,$4%,4,1,0,0,255,255 +circle $1%,$2%,4,1,0xFFFFFFFF,0,0,0,255 +circle $3%,$4%,4,1,0xFFFFFFFF,0,0,0,255 +done +} +samj_Variation_Stained_Glass : +to_rgba[-1] ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +stained_glass[-1] $6,{$7/1000},$8 +to_rgba[-1] +n[-1,-2] 0,255 +samj_Colored_Outlines[-2] $1,$2,$3,$4,$5,0,0,0,0 +samj_blend_20220419[-1,-2] alpha +blur[-2] {{w+h}/$10} +pow[-2] $9 +samj_blend_20220419[-1,-2] alpha +samj_Adjacent_Annular_Steiner_Chains : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Angle_inclinaison=$3 +Canal_Alpha=$4 +if $5>0 +Rayon_Cercle_Centre={round({w*$5/{100}})} +else +Rayon_Cercle_Centre={round({-h*$5/{100}})} +fi +Nb_Circles_Surrounding=$6 +Nb_Anneaux=$7 +Angle_Decalage=$8 +Variation_Increment_Anneaux=$9 +R_a=$10 +V_a=$11 +B_a=$12 +A_a=$13 +R_b=$14 +V_b=$15 +B_b=$16 +A_b=$17 +R_c=$18 +V_c=$19 +B_c=$20 +A_c=$21 +R_d=$22 +V_d=$23 +B_d=$24 +A_d=$25 +R_e=$26 +V_e=$27 +B_e=$28 +A_e=$29 +R_f=$30 +V_f=$31 +B_f=$32 +A_f=$33 +R_g=$34 +V_g=$35 +B_g=$36 +A_g=$37 +Rendu=$38 +Variations_Des_Couleurs=$39 +Couleurs_aleatoires=$40 +Affichage_Contours=$41 +R_Contours=$42 +V_Contours=$43 +B_Contours=$44 +A_Contours=$45 +Dilate_Contours=$46 +Flou_Contours=$47 +Sharpen_Contours=$48 +Largeur_Origine={w} +Hauteur_Origine={h} +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] 0,0,0,0 +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] 0,0,0,0 +Angle_Theta={pi/$Nb_Circles_Surrounding} +if $Rayon_Cercle_Centre<1 +Rayon_Cercle_Centre=1 +fi +Rayon_Cercle_Exterieur={$Rayon_Cercle_Centre*((1+(sin($Angle_Theta))))/(1-(sin($Angle_Theta)))} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre+$Rayon_Cercles_Ext} +Rayon_Tang={{{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}}^0.5} +Nb_boucles=0 +X_ext=0 +Y_ext=0 +Angle=0 +Angle_Decalage_En_Cours=0 +Nb_boucles_anneaux=0 +Rayon_Cercle_Centre_En_Cours=0 +Ra_en_cours=0 +Va_en_cours=0 +Ba_en_cours=0 +Aa_en_cours=0 +Suite_Couleurs=0 +if $Couleurs_aleatoires==1 +R_CE={round(u)*255} +V_CE={round(u)*255} +B_CE={round(u)*255} +R_PC={round(u)*255} +V_PC={round(u)*255} +B_PC={round(u)*255} +fi +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +R_b={round(u)*255} +V_b={round(u)*255} +B_b={round(u)*255} +R_c={round(u)*255} +V_c={round(u)*255} +B_c={round(u)*255} +R_d={round(u)*255} +V_d={round(u)*255} +B_d={round(u)*255} +R_e={round(u)*255} +V_e={round(u)*255} +B_e={round(u)*255} +R_f={round(u)*255} +V_f={round(u)*255} +B_f={round(u)*255} +R_g={round(u)*255} +V_g={round(u)*255} +B_g={round(u)*255} +fi +repeat $Nb_Anneaux +Nb_boucles=0 +Suite_Couleurs=0 +if $Couleurs_aleatoires==2 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +R_b={round(u)*255} +V_b={round(u)*255} +B_b={round(u)*255} +R_c={round(u)*255} +V_c={round(u)*255} +B_c={round(u)*255} +R_d={round(u)*255} +V_d={round(u)*255} +B_d={round(u)*255} +R_e={round(u)*255} +V_e={round(u)*255} +B_e={round(u)*255} +R_f={round(u)*255} +V_f={round(u)*255} +B_f={round(u)*255} +R_g={round(u)*255} +V_g={round(u)*255} +B_g={round(u)*255} +fi +Angle_Decalage_En_Cours={360/$Nb_Circles_Surrounding*$Angle_Decalage/100*$Nb_boucles_anneaux} +if $Nb_boucles_anneaux==0 +Rayon_Cercle_Centre_En_Cours={$Rayon_Cercle_Centre} +else +Rayon_Cercle_Centre_En_Cours={$Rayon_Tang+($Rayon_Cercles_Ext*(0.865+$Variation_Increment_Anneaux/100))} +fi +Rayon_Cercle_Exterieur=$Rayon_Cercle_Centre_En_Cours*{{1+{sin($Angle_Theta)}}}/{1-{sin($Angle_Theta)}} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre_En_Cours}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre_En_Cours+$Rayon_Cercles_Ext} +Rayon_Tang={{{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}}^0.5} +repeat $Nb_Circles_Surrounding +if $Couleurs_aleatoires==3 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +R_b={round(u)*255} +V_b={round(u)*255} +B_b={round(u)*255} +R_c={round(u)*255} +V_c={round(u)*255} +B_c={round(u)*255} +R_d={round(u)*255} +V_d={round(u)*255} +B_d={round(u)*255} +R_e={round(u)*255} +V_e={round(u)*255} +B_e={round(u)*255} +R_f={round(u)*255} +V_f={round(u)*255} +B_f={round(u)*255} +R_g={round(u)*255} +V_g={round(u)*255} +B_g={round(u)*255} +fi +if $Rendu==6 +if ($Nb_boucles%7)==0&&$Suite_Couleurs==0 +Ra_en_cours=$R_a +Va_en_cours=$V_a +Ba_en_cours=$B_a +Aa_en_cours=$A_a +Suite_Couleurs=1 +fi +if ($Nb_boucles%7)==1&&$Suite_Couleurs==1 +Ra_en_cours=$R_b +Va_en_cours=$V_b +Ba_en_cours=$B_b +Aa_en_cours=$A_b +Suite_Couleurs=2 +fi +if ($Nb_boucles%7)==2&&$Suite_Couleurs==2 +Ra_en_cours=$R_c +Va_en_cours=$V_c +Ba_en_cours=$B_c +Aa_en_cours=$A_c +Suite_Couleurs=3 +fi +if ($Nb_boucles%7)==3&&$Suite_Couleurs==3 +Ra_en_cours=$R_d +Va_en_cours=$V_d +Ba_en_cours=$B_d +Aa_en_cours=$A_d +Suite_Couleurs=4 +fi +if ($Nb_boucles%7)==4&&$Suite_Couleurs==4 +Ra_en_cours=$R_e +Va_en_cours=$V_e +Ba_en_cours=$B_e +Aa_en_cours=$A_e +Suite_Couleurs=5 +fi +if ($Nb_boucles%7)==5&&$Suite_Couleurs==5 +Ra_en_cours=$R_f +Va_en_cours=$V_f +Ba_en_cours=$B_f +Aa_en_cours=$A_f +Suite_Couleurs=6 +fi +if ($Nb_boucles%7)==6&&$Suite_Couleurs==6 +Ra_en_cours=$R_g +Va_en_cours=$V_g +Ba_en_cours=$B_g +Aa_en_cours=$A_g +Suite_Couleurs=0 +fi +fi +if $Rendu<6 +if ($Nb_boucles%2)==0 +Ra_en_cours=$R_a +Va_en_cours=$V_a +Ba_en_cours=$B_a +Aa_en_cours=$A_a +fi +if ($Nb_boucles%2)==1 +Ra_en_cours=$R_b +Va_en_cours=$V_b +Ba_en_cours=$B_b +Aa_en_cours=$A_b +fi +if ($Nb_boucles%3)==2&&$Rendu>0 +Ra_en_cours=$R_c +Va_en_cours=$V_c +Ba_en_cours=$B_c +Aa_en_cours=$A_c +fi +if ($Nb_boucles%4)==3&&$Rendu>1 +Ra_en_cours=$R_d +Va_en_cours=$V_d +Ba_en_cours=$B_d +Aa_en_cours=$A_d +fi +if ($Nb_boucles%5)==4&&$Rendu>2 +Ra_en_cours=$R_e +Va_en_cours=$V_e +Ba_en_cours=$B_e +Aa_en_cours=$A_e +fi +if ($Nb_boucles%6)==5&&$Rendu>3 +Ra_en_cours=$R_f +Va_en_cours=$V_f +Ba_en_cours=$B_f +Aa_en_cours=$A_f +fi +if ($Nb_boucles%7)==6&&$Rendu>4 +Ra_en_cours=$R_g +Va_en_cours=$V_g +Ba_en_cours=$B_g +Aa_en_cours=$A_g +fi +fi +Angle={$Nb_boucles*(360/$Nb_Circles_Surrounding)} +X_ext={$X+($Rayon_Centres_C_Ext*(cos((pi/180*($Angle+$Angle_inclinaison+$Angle_Decalage_En_Cours)))))} +Y_ext={$Y+($Rayon_Centres_C_Ext*(sin((pi/180*($Angle+$Angle_inclinaison+$Angle_Decalage_En_Cours)))))} +Nb_boucles+=1 +ellipse[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext,$Rayon_Cercles_Ext,0,1,$Ra_en_cours,$Va_en_cours,$Ba_en_cours,$Aa_en_cours +if $Affichage_Contours==1||$Affichage_Contours==2 +ellipse[-2] $X_ext,$Y_ext,$Rayon_Cercles_Ext,$Rayon_Cercles_Ext,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if {$Affichage_Contours==4||$Affichage_Contours==5}&&($Nb_boucles%2)==1 +ellipse[-2] $X_ext,$Y_ext,$Rayon_Cercles_Ext,$Rayon_Cercles_Ext,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +done +Nb_boucles_anneaux+=1 +done +if $Affichage_Contours==1||$Affichage_Contours==3||$Affichage_Contours==5 +ellipse[-2] $X,$Y,{$Rayon_Centres_C_Ext+$Rayon_Cercles_Ext},{$Rayon_Centres_C_Ext+$Rayon_Cercles_Ext},0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Dilate_Contours>1 dilate_circ[-2] $Dilate_Contours fi +if $Flou_Contours>0 blur[-2] $Flou_Contours,0 fi +if $Sharpen_Contours>0 sharpen[-2] $Sharpen_Contours fi +if $Variations_Des_Couleurs<0 *[-1] {abs($Variations_Des_Couleurs)} c[-1] 0,255 fi +samj_blend_20220419[-2,-1] alpha,1,1 +if $Variations_Des_Couleurs>0 *[-1] $Variations_Des_Couleurs c[-1] 0,255 fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Rectangles_Adjacents : +X_Haut_Gauche=$1 +Y_Haut_Gauche=$2 +X_Bas_Droite=$3 +Y_Bas_Droite=$4 +Type_Contact=$5 +Position_Contact=$6 +Nb_Rectangles=$7 +Type_n=$8 +Angle_inclinaison=$9 +R_Contours=$10 +V_Contours=$11 +B_Contours=$12 +A_Contours=$13 +Affichage_Contours=$14 +R_a=$15 +V_a=$16 +B_a=$17 +A_a=$18 +R_b=$19 +V_b=$20 +B_b=$21 +A_b=$22 +Couleurs_aleatoires=$23 +Inversions=$24 +Flou=$25 +Dilatation=$26 +Deformation=$27 +Bruit=$28 +Ombre=$29 +X_Ombre=$30 +Y_Ombre=$31 +Smoothness_Ombre=$32 +Curvature_Ombre=$33 +Compensation_Decalage_Ombre_X=$34 +Compensation_Decalage_Ombre_Y=$35 +Canal_Alpha=$36 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_boucles=0 +Dimension_Image_Rotation={round({{{{$Largeur_Origine*$Largeur_Origine}+{$Hauteur_Origine*$Hauteur_Origine}}^0.5}+2})} +Decalage_X={round({{$Dimension_Image_Rotation-$Largeur_Origine}/2})} +Decalage_Y={round({{$Dimension_Image_Rotation-$Hauteur_Origine}/2})} +X_H_G_origine={$Decalage_X+(round(($Largeur_Origine*($X_Haut_Gauche/100))))} +Y_H_G_origine={$Decalage_Y+(round(($Hauteur_Origine*($Y_Haut_Gauche/100))))} +Largeur_Rectangle_origine={round({$Largeur_Origine*{$X_Bas_Droite/100}})} +Hauteur_Rectangle_origine={round({$Hauteur_Origine*{$Y_Bas_Droite/100}})} +Largeur_A_Imprimer=$Largeur_Rectangle_origine +Hauteur_A_Imprimer=$Hauteur_Rectangle_origine +if $Type_Contact==0 +X_Contact={$X_H_G_origine+(round(($Largeur_Rectangle_origine*($Position_Contact/100))))} +Y_Contact=$Y_H_G_origine +elif $Type_Contact==1 +X_Contact={$X_H_G_origine+(round(($Largeur_Rectangle_origine*($Position_Contact/100))))} +Y_Contact={$Y_H_G_origine+$Hauteur_Rectangle_origine} +elif $Type_Contact==2 +X_Contact=$X_H_G_origine +Y_Contact={$Y_H_G_origine+(round(($Hauteur_Rectangle_origine*($Position_Contact/100))))} +elif $Type_Contact==3 +X_Contact={$X_H_G_origine+$Largeur_Rectangle_origine} +Y_Contact={$Y_H_G_origine+(round(($Hauteur_Rectangle_origine*($Position_Contact/100))))} +fi +X_H_G_A_Imprimer=$X_H_G_origine +Y_H_G_A_Imprimer=$Y_H_G_origine +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Affichage_Contours==1 +$Dimension_Image_Rotation,$Dimension_Image_Rotation,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Dimension_Image_Rotation-1},0,{$Dimension_Image_Rotation-1},{$Dimension_Image_Rotation-1},0,{$Dimension_Image_Rotation-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Dimension_Image_Rotation,$Dimension_Image_Rotation,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Dimension_Image_Rotation-1},0,{$Dimension_Image_Rotation-1},{$Dimension_Image_Rotation-1},0,{$Dimension_Image_Rotation-1},1,0xFFFFFFFF,0,0,0,1 fi +repeat $Nb_Rectangles +Nb_boucles+=1 +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +R_b={round(u)*255} +V_b={round(u)*255} +B_b={round(u)*255} +fi +if ($Nb_boucles%2)==0 +polygon[-1] 4,$X_H_G_A_Imprimer,$Y_H_G_A_Imprimer,{$X_H_G_A_Imprimer+$Largeur_A_Imprimer},$Y_H_G_A_Imprimer,{$X_H_G_A_Imprimer+$Largeur_A_Imprimer},{$Y_H_G_A_Imprimer+$Hauteur_A_Imprimer},$X_H_G_A_Imprimer,{$Y_H_G_A_Imprimer+$Hauteur_A_Imprimer},1,$R_a,$V_a,$B_a,$A_a +else +polygon[-1] 4,$X_H_G_A_Imprimer,$Y_H_G_A_Imprimer,{$X_H_G_A_Imprimer+$Largeur_A_Imprimer},$Y_H_G_A_Imprimer,{$X_H_G_A_Imprimer+$Largeur_A_Imprimer},{$Y_H_G_A_Imprimer+$Hauteur_A_Imprimer},$X_H_G_A_Imprimer,{$Y_H_G_A_Imprimer+$Hauteur_A_Imprimer},1,$R_b,$V_b,$B_b,$A_b +fi +if $Affichage_Contours==1 +polygon[-2] 4,$X_H_G_A_Imprimer,$Y_H_G_A_Imprimer,{$X_H_G_A_Imprimer+$Largeur_A_Imprimer},$Y_H_G_A_Imprimer,{$X_H_G_A_Imprimer+$Largeur_A_Imprimer},{$Y_H_G_A_Imprimer+$Hauteur_A_Imprimer},$X_H_G_A_Imprimer,{$Y_H_G_A_Imprimer+$Hauteur_A_Imprimer},1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Type_n==0 +Largeur_A_Imprimer={$Largeur_Rectangle_origine/($Nb_boucles+1)} +Hauteur_A_Imprimer={$Hauteur_Rectangle_origine/($Nb_boucles+1)} +elif $Type_n==1 +Largeur_A_Imprimer*=0.9 +Hauteur_A_Imprimer*=0.9 +elif $Type_n==2 +Largeur_A_Imprimer*=0.8 +Hauteur_A_Imprimer*=0.8 +elif $Type_n==3 +Largeur_A_Imprimer*=0.7 +Hauteur_A_Imprimer*=0.7 +elif $Type_n==4 +Largeur_A_Imprimer*=u(0.7,0.9) +Hauteur_A_Imprimer*=u(0.7,0.9) +elif $Type_n==5 +Largeur_A_Imprimer={$Largeur_Rectangle_origine/($Nb_boucles+1)} +Hauteur_A_Imprimer*=0.9 +elif $Type_n==6 +Largeur_A_Imprimer*=0.9 +Hauteur_A_Imprimer={$Hauteur_Rectangle_origine/($Nb_boucles+1)} +fi +if $Type_Contact==0 +X_H_G_A_Imprimer={$X_Contact-($Largeur_A_Imprimer/2)} +Y_H_G_A_Imprimer=$Y_Contact +elif $Type_Contact==1 +X_H_G_A_Imprimer={$X_Contact-($Largeur_A_Imprimer/2)} +Y_H_G_A_Imprimer={$Y_Contact-$Hauteur_A_Imprimer} +elif $Type_Contact==2 +X_H_G_A_Imprimer=$X_Contact +Y_H_G_A_Imprimer={$Y_Contact-($Hauteur_A_Imprimer/2)} +elif $Type_Contact==3 +X_H_G_A_Imprimer={$X_Contact-$Largeur_A_Imprimer} +Y_H_G_A_Imprimer={$Y_Contact-($Hauteur_A_Imprimer/2)} +fi +done +if $Affichage_Contours==1 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +if $Angle_inclinaison>0 rotate[-1] $Angle_inclinaison,1,0,{w/2},{h/2} fi +crop[-1] {{w-$Largeur_Origine}/2},{{h-$Hauteur_Origine}/2},{$Largeur_Origine+{{w-$Largeur_Origine-1}/2}-1},{$Hauteur_Origine+{{h-$Hauteur_Origine-1}/2}-1} +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Annular_Steiner_Chains : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +if $3>0 +Rayon_Cercle_Exterieur={round({w*$3/{100}})} +else +Rayon_Cercle_Exterieur={round({-h*$3/{100}})} +fi +Nb_Circles_Surrounding=$4 +Angle_inclinaison=$5 +R_Contours=$6 +V_Contours=$7 +B_Contours=$8 +A_Contours=$9 +Affichage_Contours=$10 +R_CE=$11 +V_CE=$12 +B_CE=$13 +A_CE=$14 +R_PC=$15 +V_PC=$16 +B_PC=$17 +A_PC=$18 +R_c=$19 +V_c=$20 +B_c=$21 +A_c=$22 +R_d=$23 +V_d=$24 +B_d=$25 +A_d=$26 +Couleurs_aleatoires=$27 +Inversions=$28 +Flou=$29 +Dilatation=$30 +Deformation=$31 +Bruit=$32 +Ombre=$33 +X_Ombre=$34 +Y_Ombre=$35 +Smoothness_Ombre=$36 +Curvature_Ombre=$37 +Compensation_Decalage_Ombre_X=$38 +Compensation_Decalage_Ombre_Y=$39 +Canal_Alpha=$40 +Largeur_Origine={w} +Hauteur_Origine={h} +Angle_Theta={pi/$Nb_Circles_Surrounding} +Rayon_Cercle_Centre={{$Rayon_Cercle_Exterieur*{1-{sin($Angle_Theta)}}}/{{1+{sin($Angle_Theta)}}}} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre+$Rayon_Cercles_Ext} +Rayon_Tang={{{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}}^0.5} +Nb_boucles=0 +X_ext=0 +Y_ext=0 +Angle=0 +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Couleurs_aleatoires==1 +R_CE={round(u)*255} +V_CE={round(u)*255} +B_CE={round(u)*255} +R_PC={round(u)*255} +V_PC={round(u)*255} +B_PC={round(u)*255} +fi +if $Affichage_Contours>0 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +if $Affichage_Contours==1||$Affichage_Contours==2||$Affichage_Contours==3||$Affichage_Contours==4||$Affichage_Contours==5 +ellipse[-1] $X,$Y,$Rayon_Cercle_Exterieur,$Rayon_Cercle_Exterieur,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Affichage_Contours==1||$Affichage_Contours==2||$Affichage_Contours==3||$Affichage_Contours==4||$Affichage_Contours==6 +ellipse[-1] $X,$Y,$Rayon_Cercle_Centre,$Rayon_Cercle_Centre,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Affichage_Contours==2||$Affichage_Contours==3 +ellipse[-1] $X,$Y,$Rayon_Centres_C_Ext,$Rayon_Centres_C_Ext,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Affichage_Contours==3||$Affichage_Contours==4 +ellipse[-1] $X,$Y,$Rayon_Tang,$Rayon_Tang,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +ellipse[-1] $X,$Y,$Rayon_Cercle_Exterieur,$Rayon_Cercle_Exterieur,0,1,$R_CE,$V_CE,$B_CE,$A_CE +ellipse[-1] $X,$Y,$Rayon_Cercle_Centre,$Rayon_Cercle_Centre,0,1,$R_PC,$V_PC,$B_PC,$A_PC +repeat $Nb_Circles_Surrounding +Angle={$Nb_boucles*(360/$Nb_Circles_Surrounding)} +X_ext={$X+($Rayon_Centres_C_Ext*(cos((pi/180*($Angle+$Angle_inclinaison)))))} +Y_ext={$Y+($Rayon_Centres_C_Ext*(sin((pi/180*($Angle+$Angle_inclinaison)))))} +Nb_boucles+=1 +if $Couleurs_aleatoires==1 +R_c={round(u)*255} +V_c={round(u)*255} +B_c={round(u)*255} +R_d={round(u)*255} +V_d={round(u)*255} +B_d={round(u)*255} +fi +if ($Nb_Circles_Surrounding%2)==0 +if ($Nb_boucles%2)==0 +ellipse[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext,$Rayon_Cercles_Ext,0,1,$R_c,$V_c,$B_c,$A_c +else +ellipse[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext,$Rayon_Cercles_Ext,0,1,$R_d,$V_d,$B_d,$A_d +fi +else +ellipse[-1] $X_ext,$Y_ext,$Rayon_Cercles_Ext,$Rayon_Cercles_Ext,0,1,$R_c,$V_c,$B_c,$A_c +fi +if $Affichage_Contours>0 +ellipse[-2] $X_ext,$Y_ext,$Rayon_Cercles_Ext,$Rayon_Cercles_Ext,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +done +if $Affichage_Contours>0 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Chains_Solidify : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Angle_inclinaison=$3 +if $4>0 +Rayon_Cercle_Centre={round({w*$4/{100}})} +else +Rayon_Cercle_Centre={round({-h*$4/{100}})} +fi +Nb_Circles_Surrounding=$5 +Nb_Anneaux=$6 +Angle_Decalage=$7 +Variation_Increment_Anneaux=$8 +R_a=$9 +V_a=$10 +B_a=$11 +A_a=$12 +R_b=$13 +V_b=$14 +B_b=$15 +A_b=$16 +R_c=$17 +V_c=$18 +B_c=$19 +A_c=$20 +R_d=$21 +V_d=$22 +B_d=$23 +A_d=$24 +R_e=$25 +V_e=$26 +B_e=$27 +A_e=$28 +R_f=$29 +V_f=$30 +B_f=$31 +A_f=$32 +R_g=$33 +V_g=$34 +B_g=$35 +A_g=$36 +Rendu=$37 +R_centre=$38 +V_centre=$39 +B_centre=$40 +A_centre=$41 +R_Fond=$42 +V_Fond=$43 +B_Fond=$44 +A_Fond=$45 +Effet=$46 +Largeur_Origine={w} +Hauteur_Origine={h} +rm[0] +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] 0,0,0,0 ++Je_passe_l_hiver_en_Floride[-1] +Angle_Theta={pi/$Nb_Circles_Surrounding} +if $Rayon_Cercle_Centre<1 +Rayon_Cercle_Centre=1 +fi +Rayon_Cercle_Exterieur={$Rayon_Cercle_Centre*((1+(sin($Angle_Theta))))/(1-(sin($Angle_Theta)))} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre+$Rayon_Cercles_Ext} +Rayon_Tang={{{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}}^0.5} +Nb_boucles=0 +X_ext=0 +Y_ext=0 +Angle=0 +Angle_Decalage_En_Cours=0 +Nb_boucles_anneaux=0 +Rayon_Cercle_Centre_En_Cours=0 +Ra_en_cours=0 +Va_en_cours=0 +Ba_en_cours=0 +Aa_en_cours=0 +Suite_Couleurs=0 +point[-1] $X,$Y,0,1,$R_centre,$V_centre,$B_centre,$A_centre +repeat $Nb_Anneaux +Nb_boucles=0 +Suite_Couleurs=0 +Angle_Decalage_En_Cours={360/$Nb_Circles_Surrounding*$Angle_Decalage/100*$Nb_boucles_anneaux} +if $Nb_boucles_anneaux==0 +Rayon_Cercle_Centre_En_Cours={$Rayon_Cercle_Centre} +else +Rayon_Cercle_Centre_En_Cours={$Rayon_Tang+($Rayon_Cercles_Ext*(0.865+$Variation_Increment_Anneaux/100))} +fi +Rayon_Cercle_Exterieur=$Rayon_Cercle_Centre_En_Cours*{{1+{sin($Angle_Theta)}}}/{1-{sin($Angle_Theta)}} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre_En_Cours}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre_En_Cours+$Rayon_Cercles_Ext} +Rayon_Tang={{{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}}^0.5} +repeat $Nb_Circles_Surrounding +if $Rendu==6 +if ($Nb_boucles%7)==0&&$Suite_Couleurs==0 +Ra_en_cours=$R_a +Va_en_cours=$V_a +Ba_en_cours=$B_a +Aa_en_cours=$A_a +Suite_Couleurs=1 +fi +if ($Nb_boucles%7)==1&&$Suite_Couleurs==1 +Ra_en_cours=$R_b +Va_en_cours=$V_b +Ba_en_cours=$B_b +Aa_en_cours=$A_b +Suite_Couleurs=2 +fi +if ($Nb_boucles%7)==2&&$Suite_Couleurs==2 +Ra_en_cours=$R_c +Va_en_cours=$V_c +Ba_en_cours=$B_c +Aa_en_cours=$A_c +Suite_Couleurs=3 +fi +if ($Nb_boucles%7)==3&&$Suite_Couleurs==3 +Ra_en_cours=$R_d +Va_en_cours=$V_d +Ba_en_cours=$B_d +Aa_en_cours=$A_d +Suite_Couleurs=4 +fi +if ($Nb_boucles%7)==4&&$Suite_Couleurs==4 +Ra_en_cours=$R_e +Va_en_cours=$V_e +Ba_en_cours=$B_e +Aa_en_cours=$A_e +Suite_Couleurs=5 +fi +if ($Nb_boucles%7)==5&&$Suite_Couleurs==5 +Ra_en_cours=$R_f +Va_en_cours=$V_f +Ba_en_cours=$B_f +Aa_en_cours=$A_f +Suite_Couleurs=6 +fi +if ($Nb_boucles%7)==6&&$Suite_Couleurs==6 +Ra_en_cours=$R_g +Va_en_cours=$V_g +Ba_en_cours=$B_g +Aa_en_cours=$A_g +Suite_Couleurs=0 +fi +fi +if $Rendu<6 +if {$Nb_boucles%2}==0 +Ra_en_cours=$R_a +Va_en_cours=$V_a +Ba_en_cours=$B_a +Aa_en_cours=$A_a +fi +if {$Nb_boucles%2}==1 +Ra_en_cours=$R_b +Va_en_cours=$V_b +Ba_en_cours=$B_b +Aa_en_cours=$A_b +fi +if {$Nb_boucles%3}==2&&$Rendu>0 +Ra_en_cours=$R_c +Va_en_cours=$V_c +Ba_en_cours=$B_c +Aa_en_cours=$A_c +fi +if {$Nb_boucles%4}==3&&$Rendu>1 +Ra_en_cours=$R_d +Va_en_cours=$V_d +Ba_en_cours=$B_d +Aa_en_cours=$A_d +fi +if {$Nb_boucles%5}==4&&$Rendu>2 +Ra_en_cours=$R_e +Va_en_cours=$V_e +Ba_en_cours=$B_e +Aa_en_cours=$A_e +fi +if {$Nb_boucles%6}==5&&$Rendu>3 +Ra_en_cours=$R_f +Va_en_cours=$V_f +Ba_en_cours=$B_f +Aa_en_cours=$A_f +fi +if {$Nb_boucles%7}==6&&$Rendu>4 +Ra_en_cours=$R_g +Va_en_cours=$V_g +Ba_en_cours=$B_g +Aa_en_cours=$A_g +fi +fi +Angle={$Nb_boucles*(360/$Nb_Circles_Surrounding)} +X_ext={$X+($Rayon_Centres_C_Ext*(cos((pi/180*($Angle+$Angle_inclinaison+$Angle_Decalage_En_Cours)))))} +Y_ext={$Y+($Rayon_Centres_C_Ext*(sin((pi/180*($Angle+$Angle_inclinaison+$Angle_Decalage_En_Cours)))))} +Nb_boucles+=1 +ellipse[-2] $X_ext,$Y_ext,{$Rayon_Cercles_Ext/100*$Effet},{$Rayon_Cercles_Ext/100*$Effet},0,1,0xFFFFFFFF,$R_Fond,$V_Fond,$B_Fond,$A_Fond +point[-1] $X_ext,$Y_ext,0,1,$Ra_en_cours,$Va_en_cours,$Ba_en_cours,$Aa_en_cours +done +Nb_boucles_anneaux+=1 +done +ellipse[-2] $X,$Y,{$Rayon_Centres_C_Ext+$Rayon_Cercles_Ext},{$Rayon_Centres_C_Ext+$Rayon_Cercles_Ext},0,1,0xFFFFFFFF,$R_Fond,$V_Fond,$B_Fond,$A_Fond +samj_blend_20220419[-1,-2] alpha +solidify[-1] +samj_Noel_2016 : +x={round(w/100*$1)} +y={round(h/100*$2)} +rayonA={w/1000*$3} +rayonB={w/1000*$4} +depth_max=$5 +fil=$6 +R_DT=$7 +V_DT=$8 +B_DT=$9 +A_DT=$10 +Variation_Couleur=$11 +K_espacement=$12 +Type_Rendu=$13 +Ball_Specular_light=$14 +Ball_Specular_size=$15 +Ball_Shadow=$16 +Ball_Angle=$17 +Rotation=$18 +Validation_Smooth_Antialias=$19 +V_Amplitude=$20 +V_Edge_Threshold=$21 +V_Smoothness=$22 +depth=0 +L_Origine={w} +H_Origine={h} +to_rgba[-1] +$L_Origine,$H_Origine,1,4 +samj_guirlande[-1] $x,$y,$rayonA,$rayonB,$depth,$depth_max,$fil,$R_DT,$V_DT,$B_DT,$A_DT,$Variation_Couleur,$K_espacement,$L_Origine,$H_Origine,$Type_Rendu,$Ball_Specular_light,$Ball_Specular_size,$Ball_Shadow,$Ball_Angle +if $Rotation!=0 rotate[-1] $Rotation fi +if $Validation_Smooth_Antialias==1 fx_smooth_antialias[-1] $V_Amplitude,$V_Edge_Threshold,$V_Smoothness fi +samj_blend_20220419[-1,-2] alpha +samj_guirlande : +x=$1 +y=$2 +rayonA=$3 +rayonB=$4 +depth=$5 +depth_max=$6 +fil=$7 +R_DT=$8 +V_DT=$9 +B_DT=$10 +A_DT=$11 +Variation_Couleur=$12 +K_espacement=$13 +L_Origine=$14 +H_Origine=$15 +Type_Rendu=$16 +Ball_Specular_light=$17 +Ball_Specular_size=$18 +Ball_Shadow=$19 +Ball_Angle=$20 +if $depth<$depth_max&&$rayonA>1&&$rayonB>1 +if $Type_Rendu==0 +ellipse[-1] $x,$y,$rayonA,$rayonB,1,1,$R_DT,$V_DT,$B_DT,$A_DT +elif $Type_Rendu==1 +$L_Origine,$H_Origine,1,4 +ellipse[-1] $x,$y,$rayonA,$rayonB,1,1,$R_DT,$V_DT,$B_DT,$A_DT +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +elif $Type_Rendu==2 +$L_Origine,$H_Origine,1,4 +ball {$rayonA*2},$R_DT,$V_DT,$B_DT,$Ball_Specular_light,$Ball_Specular_size,$Ball_Shadow +rotate[-1] $Ball_Angle +autocrop[-1] 0 +samj_blend_20220419[-1,-2] alpha +shift[-1] {-1*{{$L_Origine/2}-$x}},{$y-{$H_Origine/2}},0,0,0 +samj_blend_20220419[-1,-2] alpha +elif $Type_Rendu==3 +$L_Origine,$H_Origine,1,4 +$L_Origine,$H_Origine,1,4 +ball {$rayonA*2},$R_DT,$V_DT,$B_DT,$Ball_Specular_light,$Ball_Specular_size,$Ball_Shadow +rotate[-1] $Ball_Angle +autocrop[-1] 0 +samj_blend_20220419[-1,-2] alpha +shift[-1] {-1*{{$L_Origine/2}-$x}},{$y-{$H_Origine/2}},0,0,0 +samj_blend_20220419[-1,-2] alpha +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +fi +R_DT+=$Variation_Couleur +V_DT+=$Variation_Couleur +B_DT+=$Variation_Couleur +if $R_DT>255 +R_DT={255-{$Variation_Couleur*{$depth_max-$depth}}} +fi +if $V_DT>255 +V_DT={255-{$Variation_Couleur*{$depth_max-$depth}}} +fi +if $B_DT>255 +B_DT={255-{$Variation_Couleur*{$depth_max-$depth}}} +fi +if $R_DT<0 +R_DT+=$Variation_Couleur+{$Variation_Couleur*{$depth_max-$depth}} +fi +if $V_DT<0 +V_DT+=$Variation_Couleur+{$Variation_Couleur*{$depth_max-$depth}} +fi +if $B_DT<0 +B_BT={$B_DT+$Variation_Couleur+($Variation_Couleur*($depth_max-$depth))} +fi +samj_guirlande[-1] {$x+{$rayonA*$K_espacement}},$y,{$rayonA/2},{$rayonB/2},{$depth+1},$depth_max,$fil,$R_DT,$V_DT,$B_DT,$A_DT,$Variation_Couleur,$K_espacement,$L_Origine,$H_Origine,$Type_Rendu,$Ball_Specular_light,$Ball_Specular_size,$Ball_Shadow,$Ball_Angle +samj_guirlande[-1] {$x-{$rayonA*$K_espacement}},$y,{$rayonA/2},{$rayonB/2},{$depth+1},$depth_max,$fil,$R_DT,$V_DT,$B_DT,$A_DT,$Variation_Couleur,$K_espacement,$L_Origine,$H_Origine,$Type_Rendu,$Ball_Specular_light,$Ball_Specular_size,$Ball_Shadow,$Ball_Angle +if $fil==1 +$L_Origine,$H_Origine,1,4 +line[-1] {$x+{$rayonA*$K_espacement}},$y,{$x-{$rayonA*2.5}},$y,1,$R_DT,$V_DT,$B_DT,$A_DT +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +fi +fi +samj_Chryzodes : +Dimension={round({{max(w,h)}*$1/100})} +R_fond=$2 +V_fond=$3 +B_fond=$4 +A_fond=$5 +Demo=$6 +X={round({$Dimension*{$7/100}})} +Y={round({$Dimension*{$8/100}})} +Rayon_Cercle={round($Dimension*$9/100)} +Nb_Points=$10 +Multiplicateur=$11 +Premier_Point=$12 +R_l=$13 +V_l=$14 +B_l=$15 +A_l=$16 +Angle_Inclinaison=$17 +Type_De_Lignes=$18 +Couleurs_aleatoires=$19 +Variations_A=$20 +Variations_B=$21 +Variations_C=$22 +Flou=$23 +Dilatation=$24 +Deformation=$25 +Bruit=$26 +Tracer_Cercle=$27 +if $Demo==1 +Nb_Points=431 +Multiplicateur=7 +Variations_A=0 +Variations_B=0 +Variations_C=0 +elif $Demo==2 +Nb_Points=353 +Multiplicateur=3 +Variations_A=0 +Variations_B=0 +Variations_C=0 +elif $Demo==3 +Nb_Points=619 +Multiplicateur=4 +Variations_A=0 +Variations_B=0 +Variations_C=0 +elif $Demo==4 +Nb_Points=691 +Multiplicateur=12 +Variations_A=0 +Variations_B=0 +Variations_C=0 +elif $Demo==5 +Nb_Points=613 +Multiplicateur=20 +Variations_A=0 +Variations_B=0 +Variations_C=0 +elif $Demo==6 +Nb_Points=358 +Multiplicateur=13 +Variations_A=0 +Variations_B=0 +Variations_C=1 +elif $Demo==7 +Nb_Points=118 +Multiplicateur=20 +Variations_A=0 +Variations_B=0 +Variations_C=1 +elif $Demo==8 +Nb_Points=699 +Multiplicateur=6 +Variations_A=0 +Variations_B=0 +Variations_C=0 +Demo=8 +fi +Largeur_Origine={w} +Hauteur_Origine={h} +Angle_Base={360/$Nb_Points} +Point_Origine=0 +Sortie_Boucle_Lignes=0 +Nb_Boucle_Lignes=0 +Nb_Boucle_Points=0 +Point_A=0 +Angle_A=0 +X_Imp_A=0 +Y_Imp_A=0 +Point_B=0 +Angle_B=0 +X_Imp_B=0 +Y_Imp_B=0 +a_Ligne=0 +b_Ligne=0 +X_Ex_a=0 +Y_Ex_a=0 +X_Ex_b=0 +Y_Ex_b=0 +if $Variations_A==0 +Boucles_Rendu=1 +Variations_A=1 +else +Boucles_Rendu=2 +fi +rm[-1] +$Dimension,$Dimension,1,4 +fill_color[-1] 0,0,0,0 +Point_A=$Premier_Point +Angle_A={$Angle_Base*$Point_A} +X_Imp_A={$X+($Rayon_Cercle*(cos((pi/180*($Angle_A+$Angle_Inclinaison)))))} +Y_Imp_A={$Y+($Rayon_Cercle*(sin((pi/180*($Angle_A+$Angle_Inclinaison)))))} +Point_Origine=$Point_A +test=0 +repeat $Boucles_Rendu+$Variations_B +if $Couleurs_aleatoires==1 +R_l={round(u)*255} +V_l={round(u)*255} +B_l={round(u)*255} +fi +do +if $Couleurs_aleatoires==2 +R_l={round(u)*255} +V_l={round(u)*255} +B_l={round(u)*255} +fi +if $Variations_C==0 +Point_B={{$Point_A*$Multiplicateur}%$Nb_Points} +else +Point_B={{$Point_A*$Multiplicateur*2}%$Nb_Points} +fi +Angle_B={$Angle_Base*$Point_B} +X_Imp_B={$X+($Rayon_Cercle*(cos((pi/180*($Angle_B+$Angle_Inclinaison)))))} +Y_Imp_B={$Y+($Rayon_Cercle*(sin((pi/180*($Angle_B+$Angle_Inclinaison)))))} +if $Type_De_Lignes==1 +if {round($X_Imp_A*1000000000000)}=={round($X_Imp_B*1000000000000)} +X_Ex_a=$X_Imp_A +Y_Ex_a=0 +X_Ex_b=$X_Imp_B +Y_Ex_b={$Dimension-1} +line[-1] $X_Ex_a,$Y_Ex_a,$X_Ex_b,$Y_Ex_b,1,$R_l,$V_l,$B_l,$A_l +else +a_Ligne={{$Y_Imp_B-$Y_Imp_A}/{$X_Imp_B-$X_Imp_A}} +b_Ligne={$Y_Imp_B-($a_Ligne*$X_Imp_B)} +X_Ex_a=0 +Y_Ex_a=$b_Ligne +X_Ex_b={$Dimension-1} +Y_Ex_b={{$a_Ligne*$X_Ex_b}+$b_Ligne} +line[-1] $X_Ex_a,$Y_Ex_a,$X_Ex_b,$Y_Ex_b,1,$R_l,$V_l,$B_l,$A_l +fi +else +line[-1] $X_Imp_A,$Y_Imp_A,$X_Imp_B,$Y_Imp_B,1,$R_l,$V_l,$B_l,$A_l +fi +if $Point_B==$Point_Origine Sortie_Boucle_Lignes=1 fi +if $Nb_Boucle_Lignes>$Nb_Points*$Multiplicateur Sortie_Boucle_Lignes=1 fi +if $Variations_C==1 +if $Nb_Boucle_Lignes>$Nb_Points Sortie_Boucle_Lignes=1 fi +fi +Point_A=$Point_B +X_Imp_A=$X_Imp_B +Y_Imp_A=$Y_Imp_B +Nb_Boucle_Lignes+=1 +while $Sortie_Boucle_Lignes==0 +Nb_Boucle_Points+=1 +Point_A={$Premier_Point+(1/$Nb_Points*$Nb_Boucle_Points/$Variations_A)} +Angle_A={$Angle_Base*$Point_A} +X_Imp_A={$X+($Rayon_Cercle*(cos((pi/180*($Angle_A+$Angle_Inclinaison)))))} +Y_Imp_A={$Y+($Rayon_Cercle*(sin((pi/180*($Angle_A+$Angle_Inclinaison)))))} +Point_Origine=$Point_A +Sortie_Boucle_Lignes=0 +Nb_Boucle_Lignes=0 +done +if $Tracer_Cercle==1 +ellipse[-1] $X,$Y,$Rayon_Cercle,$Rayon_Cercle,0,1,0xFFFFFFFF,$R_l,$V_l,$B_l,$A_l +fi +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +$Dimension,$Dimension,1,4 +fill_color[-1] $R_fond,$V_fond,$B_fond,$A_fond +gimp_blend_1651[-2,-1] 1,0,1,0,1 +samj_Contour_Line_Laser_LED : +to_rgba[-1] +if $3==1 +Largeur={w} +Hauteur={h} +expand_x[-1] {$2+$2},0 +expand_y[-1] {$2+$2},0 +replace_color[-1] 1%,0,0,0,0,0,255,255,255,255 +fi +if $1>0 +if $1==1 +erode_circ[-1] {$2+1} +elif $1==2 +erode_circ[-1] {$2+1} +dilate_circ[-1] {$2+1} +elif $1==3 +erode_circ[-1] {$2+$2+1} +dilate_circ[-1] {$2+1} +fi +replace_color[-1] 70%,0,0,0,0,255,0,0,0,255 +fi +if $3==1 +autocrop[-1] +expand_x[-1] {$Largeur/100},0 +expand_y[-1] {$Hauteur/100},0 +replace_color[-1] 1%,0,0,0,0,0,255,255,255,255 +fi +samj_dessiner_un_polygone: +Nombre_de_cotes=$1 +X_centre_cercle_circonscrit={$2/100*w} +Y_centre_cercle_circonscrit={$3/100*h} +Angle_inclinaison=$4 +if $5>0 +Rayon_cercle_circonscrit={round({w*$5/{100}})} +else +Rayon_cercle_circonscrit={round({-h*$5/{100}})} +fi +Rayon_cercle_interieur={round($Rayon_cercle_circonscrit/100*$6)} +Remplir_polygone_exterieur=$7 +R_Couleur_polygone_exterieur=$8 +V_Couleur_polygone_exterieur=$9 +B_Couleur_polygone_exterieur=$10 +Contour_polygone_exterieur=$11 +R_Couleur_contour_polygone_exterieur=$12 +V_Couleur_contour_polygone_exterieur=$13 +B_Couleur_contour_polygone_exterieur=$14 +Remplir_polygone_interieur=$15 +R_Couleur_polygone_interieur=$16 +V_Couleur_polygone_interieur=$17 +B_Couleur_polygone_interieur=$18 +Contour_polygone_interieur=$19 +R_Couleur_contour_polygone_interieur=$20 +V_Couleur_contour_polygone_interieur=$21 +B_Couleur_contour_polygone_interieur=$22 +Variation_de_couleur=$23 +Remplir_cercle_interieur=$24 +R_CI_plein=$25 +V_CI_plein=$26 +B_CI_plein=$27 +Contour_cercle_interieur=$28 +R_CI_contour=$29 +V_CI_contour=$30 +B_CI_contour=$31 +Remplir_cercle_exterieur=$32 +R_CE_plein=$33 +V_CE_plein=$34 +B_CE_plein=$35 +Contour_cercle_exterieur=$36 +R_CE_contour=$37 +V_CE_contour=$38 +B_CE_contour=$39 +Valeur_dilate_circ=$40 +Transparence_des_couleurs=$41 +Flou_polygone=$42 +Spread_polygone=$43 +Deform_polygone=$44 +blend=$45 +{w},{h},1,4 +fill_color[-1] 0,0,0,0 +if $Remplir_cercle_exterieur==1 +ellipse[-1] $X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$Rayon_cercle_circonscrit,$Rayon_cercle_circonscrit,0,1,$R_CE_plein,$V_CE_plein,$B_CE_plein,$Transparence_des_couleurs +fi +if $Contour_cercle_exterieur==1 +ellipse[-1] $X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$Rayon_cercle_circonscrit,$Rayon_cercle_circonscrit,0,1,0xFFFFFF,$R_CE_contour,$V_CE_contour,$B_CE_contour,$Transparence_des_couleurs +fi +Increment_angle={360/$Nombre_de_cotes} +Nb_boucle=$Nombre_de_cotes +do +if $Variation_de_couleur==0 +X_point_exterieur={$X_centre_cercle_circonscrit+(round(($Rayon_cercle_circonscrit*(cos((pi/180*($Increment_angle+$Angle_inclinaison+(360/$Nombre_de_cotes))))))))} +Y_point_exterieur={$Y_centre_cercle_circonscrit+(round(($Rayon_cercle_circonscrit*(sin((pi/180*($Increment_angle+$Angle_inclinaison+(360/$Nombre_de_cotes))))))))} +X_point_interieur={$X_centre_cercle_circonscrit+(round(($Rayon_cercle_interieur*(cos((pi/180*($Increment_angle+$Angle_inclinaison+(360/$Nombre_de_cotes))))))))} +Y_point_interieur={$Y_centre_cercle_circonscrit+(round(($Rayon_cercle_interieur*(sin((pi/180*($Increment_angle+$Angle_inclinaison+(360/$Nombre_de_cotes))))))))} +if $Nb_boucle==$Nombre_de_cotes +Points_polygone_exterieur=$X_point_exterieur,$Y_point_exterieur +Points_polygone_interieur=$X_point_interieur,$Y_point_interieur +else +Points_polygone_exterieur=$Points_polygone_exterieur,$X_point_exterieur,$Y_point_exterieur +Points_polygone_interieur=$Points_polygone_interieur,$X_point_interieur,$Y_point_interieur +fi +if $Nb_boucle==1 +if $Remplir_polygone_exterieur==1 +polygon[-1] $Nombre_de_cotes,$Points_polygone_exterieur,1,$R_Couleur_polygone_exterieur,$V_Couleur_polygone_exterieur,$B_Couleur_polygone_exterieur,$Transparence_des_couleurs +fi +if $Contour_polygone_exterieur==1 +polygon[-1] $Nombre_de_cotes,$Points_polygone_exterieur,1,0xFFFFFF,$R_Couleur_contour_polygone_exterieur,$V_Couleur_contour_polygone_exterieur,$B_Couleur_contour_polygone_exterieur,$Transparence_des_couleurs +fi +if $Remplir_cercle_interieur==1 +ellipse[-1] $X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$Rayon_cercle_interieur,$Rayon_cercle_interieur,0,1,$R_CI_plein,$V_CI_plein,$B_CI_plein,$Transparence_des_couleurs +fi +if $Contour_cercle_interieur==1 +ellipse[-1] $X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$Rayon_cercle_interieur,$Rayon_cercle_interieur,0,1,0xFFFFFF,$R_CI_contour,$V_CI_contour,$B_CI_contour,$Transparence_des_couleurs +fi +if $Remplir_polygone_interieur==1 +polygon[-1] $Nombre_de_cotes,$Points_polygone_interieur,1,$R_Couleur_polygone_interieur,$V_Couleur_polygone_interieur,$B_Couleur_polygone_interieur,$Transparence_des_couleurs +fi +if $Contour_polygone_interieur==1 +polygon[-1] $Nombre_de_cotes,$Points_polygone_interieur,1,0xFFFFFF,$R_Couleur_contour_polygone_interieur,$V_Couleur_contour_polygone_interieur,$B_Couleur_contour_polygone_interieur,$Transparence_des_couleurs +fi +fi +fi +if $Variation_de_couleur==1 +X_point_exterieur_1={$X_centre_cercle_circonscrit+(round(($Rayon_cercle_circonscrit*(cos((pi/180*($Increment_angle+$Angle_inclinaison+(180/$Nombre_de_cotes))))))))} +Y_point_exterieur_1={$Y_centre_cercle_circonscrit+(round(($Rayon_cercle_circonscrit*(sin((pi/180*($Increment_angle+$Angle_inclinaison+(180/$Nombre_de_cotes))))))))} +X_point_exterieur_2={$X_centre_cercle_circonscrit+(round(($Rayon_cercle_circonscrit*(cos((pi/180*($Increment_angle+$Angle_inclinaison-(180/$Nombre_de_cotes))))))))} +Y_point_exterieur_2={$Y_centre_cercle_circonscrit+(round(($Rayon_cercle_circonscrit*(sin((pi/180*($Increment_angle+$Angle_inclinaison-(180/$Nombre_de_cotes))))))))} +if $Remplir_polygone_exterieur==1 +polygon[-1] 3,$X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$X_point_exterieur_1,$Y_point_exterieur_1,$X_point_exterieur_2,$Y_point_exterieur_2,1,{round(u)*255},{round(u)*255},{round(u)*255},$Transparence_des_couleurs +fi +if $Contour_polygone_exterieur==1 +polygon[-1] 3,$X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$X_point_exterieur_1,$Y_point_exterieur_1,$X_point_exterieur_2,$Y_point_exterieur_2,1,0xFFFFFF,{round(u)*255},{round(u)*255},{round(u)*255},$Transparence_des_couleurs +fi +X_point_interieur_1={$X_centre_cercle_circonscrit+(round(($Rayon_cercle_interieur*(cos((pi/180*($Increment_angle+$Angle_inclinaison+(180/$Nombre_de_cotes))))))))} +Y_point_interieur_1={$Y_centre_cercle_circonscrit+(round(($Rayon_cercle_interieur*(sin((pi/180*($Increment_angle+$Angle_inclinaison+(180/$Nombre_de_cotes))))))))} +X_point_interieur_2={$X_centre_cercle_circonscrit+(round(($Rayon_cercle_interieur*(cos((pi/180*($Increment_angle+$Angle_inclinaison-(180/$Nombre_de_cotes))))))))} +Y_point_interieur_2={$Y_centre_cercle_circonscrit+(round(($Rayon_cercle_interieur*(sin((pi/180*($Increment_angle+$Angle_inclinaison-(180/$Nombre_de_cotes))))))))} +if $Remplir_polygone_interieur==1 +polygon[-1] 3,$X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$X_point_interieur_1,$Y_point_interieur_1,$X_point_interieur_2,$Y_point_interieur_2,1,{round(u)*255},{round(u)*255},{round(u)*255},$Transparence_des_couleurs +fi +if $Contour_polygone_interieur==1 +polygon[-1] 3,$X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$X_point_interieur_1,$Y_point_interieur_1,$X_point_interieur_2,$Y_point_interieur_2,1,0xFFFFFF,{round(u)*255},{round(u)*255},{round(u)*255},$Transparence_des_couleurs +fi +if $Nb_boucle==1 +if $Remplir_cercle_interieur==1 +ellipse[-1] $X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$Rayon_cercle_interieur,$Rayon_cercle_interieur,0,1,$R_CI_plein,$V_CI_plein,$B_CI_plein,$Transparence_des_couleurs +fi +if $Contour_cercle_interieur==1 +ellipse[-1] $X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$Rayon_cercle_interieur,$Rayon_cercle_interieur,0,1,0xFFFFFF,$R_CI_contour,$V_CI_contour,$B_CI_contour,$Transparence_des_couleurs +fi +fi +fi +if $Variation_de_couleur>1 +Valeur_variation_couleur=16 +if $Variation_de_couleur==3 +Valeur_variation_couleur=32 +fi +if $Variation_de_couleur==4 +Valeur_variation_couleur=64 +fi +R_Couleur_polygone_exterieur={round({$8+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $R_Couleur_polygone_exterieur>255 +R_Couleur_polygone_exterieur=$8 +fi +if $R_Couleur_polygone_exterieur<0 +R_Couleur_polygone_exterieur=$8 +fi +V_Couleur_polygone_exterieur={round({$9+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $V_Couleur_polygone_exterieur>255 +V_Couleur_polygone_exterieur=$9 +fi +if $V_Couleur_polygone_exterieur<0 +V_Couleur_polygone_exterieur=$9 +fi +B_Couleur_polygone_exterieur={round({$10+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $B_Couleur_polygone_exterieur>255 +B_Couleur_polygone_exterieur=$10 +fi +if $B_Couleur_polygone_exterieur<0 +B_Couleur_polygone_exterieur=$10 +fi +R_Couleur_polygone_interieur={round({$16+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $R_Couleur_polygone_interieur>255 +R_Couleur_polygone_interieur=$16 +fi +if $R_Couleur_polygone_interieur<0 +R_Couleur_polygone_interieur=$16 +fi +V_Couleur_polygone_interieur={round({$17+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $V_Couleur_polygone_interieur>255 +V_Couleur_polygone_interieur=$17 +fi +if $V_Couleur_polygone_interieur<0 +V_Couleur_polygone_interieur=$17 +fi +B_Couleur_polygone_interieur={round({$18+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $B_Couleur_polygone_interieur>255 +B_Couleur_polygone_interieur=$18 +fi +if $B_Couleur_polygone_interieur<0 +B_Couleur_polygone_interieur=$18 +fi +X_point_exterieur_1={$X_centre_cercle_circonscrit+(round(($Rayon_cercle_circonscrit*(cos((pi/180*($Increment_angle+$Angle_inclinaison+(180/$Nombre_de_cotes))))))))} +Y_point_exterieur_1={$Y_centre_cercle_circonscrit+(round(($Rayon_cercle_circonscrit*(sin((pi/180*($Increment_angle+$Angle_inclinaison+(180/$Nombre_de_cotes))))))))} +X_point_exterieur_2={$X_centre_cercle_circonscrit+(round(($Rayon_cercle_circonscrit*(cos((pi/180*($Increment_angle+$Angle_inclinaison-(180/$Nombre_de_cotes))))))))} +Y_point_exterieur_2={$Y_centre_cercle_circonscrit+(round(($Rayon_cercle_circonscrit*(sin((pi/180*($Increment_angle+$Angle_inclinaison-(180/$Nombre_de_cotes))))))))} +if $Remplir_polygone_exterieur==1 +polygon[-1] 3,$X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$X_point_exterieur_1,$Y_point_exterieur_1,$X_point_exterieur_2,$Y_point_exterieur_2,1,$R_Couleur_polygone_exterieur,$V_Couleur_polygone_exterieur,$B_Couleur_polygone_exterieur,$Transparence_des_couleurs +fi +if $Contour_polygone_exterieur==1 +polygon[-1] 3,$X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$X_point_exterieur_1,$Y_point_exterieur_1,$X_point_exterieur_2,$Y_point_exterieur_2,1,0xFFFFFF,$R_Couleur_contour_polygone_exterieur,$V_Couleur_contour_polygone_exterieur,$B_Couleur_contour_polygone_exterieur,$Transparence_des_couleurs +fi +X_point_interieur_1={$X_centre_cercle_circonscrit+(round(($Rayon_cercle_interieur*(cos((pi/180*($Increment_angle+$Angle_inclinaison+(180/$Nombre_de_cotes))))))))} +Y_point_interieur_1={$Y_centre_cercle_circonscrit+(round(($Rayon_cercle_interieur*(sin((pi/180*($Increment_angle+$Angle_inclinaison+(180/$Nombre_de_cotes))))))))} +X_point_interieur_2={$X_centre_cercle_circonscrit+(round(($Rayon_cercle_interieur*(cos((pi/180*($Increment_angle+$Angle_inclinaison-(180/$Nombre_de_cotes))))))))} +Y_point_interieur_2={$Y_centre_cercle_circonscrit+(round(($Rayon_cercle_interieur*(sin((pi/180*($Increment_angle+$Angle_inclinaison-(180/$Nombre_de_cotes))))))))} +if $Remplir_polygone_interieur==1 +polygon[-1] 3,$X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$X_point_interieur_1,$Y_point_interieur_1,$X_point_interieur_2,$Y_point_interieur_2,1,$R_Couleur_polygone_interieur,$V_Couleur_polygone_interieur,$B_Couleur_polygone_interieur,$Transparence_des_couleurs +fi +if $Contour_polygone_interieur==1 +polygon[-1] 3,$X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$X_point_interieur_1,$Y_point_interieur_1,$X_point_interieur_2,$Y_point_interieur_2,1,0xFFFFFF,$R_Couleur_contour_polygone_interieur,$V_Couleur_contour_polygone_interieur,$B_Couleur_contour_polygone_interieur,$Transparence_des_couleurs +fi +if $Nb_boucle==1 +if $Remplir_cercle_interieur==1 +ellipse[-1] $X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$Rayon_cercle_interieur,$Rayon_cercle_interieur,0,1,$R_CI_plein,$V_CI_plein,$B_CI_plein,$Transparence_des_couleurs +fi +if $Contour_cercle_interieur==1 +ellipse[-1] $X_centre_cercle_circonscrit,$Y_centre_cercle_circonscrit,$Rayon_cercle_interieur,$Rayon_cercle_interieur,0,1,0xFFFFFF,$R_CI_contour,$V_CI_contour,$B_CI_contour,$Transparence_des_couleurs +fi +fi +fi +Increment_angle+={360/$Nombre_de_cotes} +Nb_boucle-=1 +while $Nb_boucle>0 +if $Valeur_dilate_circ>1 +dilate_circ[-1] $Valeur_dilate_circ +fi +blur[-1] $Flou_polygone +spread[-1] $Spread_polygone +deform[-1] $Deform_polygone +gimp_blend_1651[-2,-1] $blend,1,1,1 +samj_Egg_Oeuf_Granville : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Decalage_X={round({{min(w,h)}*$3/100})} +Valeur_A={round({{min(w,h)}*$4/40})} +Valeur_B={round({{min(w,h)}*$5/40})} +Valeur_R={round({{min(w,h)}*$6/40})} +Angle_Rotation=$7 +R_Contours=$8 +V_Contours=$9 +B_Contours=$10 +A_Contours=$11 +Affichage_Contours=$12 +R_a=$13 +V_a=$14 +B_a=$15 +A_a=$16 +Couleurs_aleatoires=$17 +Inversions=$18 +Flou=$19 +Dilatation=$20 +Deformation=$21 +Bruit=$22 +Ombre=$23 +X_Ombre=$24 +Y_Ombre=$25 +Smoothness_Ombre=$26 +Curvature_Ombre=$27 +Compensation_Decalage_Ombre_X=$28 +Compensation_Decalage_Ombre_Y=$29 +Canal_Alpha=$30 +Resolution=720 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_boucles=0 +Angle=0 +X_Oeuf_A_Imprimer=0 +Y_Oeuf_A_Imprimer=0 +X_Oeuf_A_Imprimer_Precedent={{$X-{$Valeur_B+{$Valeur_R/2}}}+{$Decalage_X+{$Valeur_B+{$Valeur_R*{cos(pi/180*$Angle)}}}}} +Y_Oeuf_A_Imprimer_Precedent={$Y+((($Valeur_A*$Valeur_R*(sin(pi/180*$Angle)))/($Valeur_B+($Valeur_R*(cos(pi/180*$Angle))))))} +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Affichage_Contours>0 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +fi +if $Affichage_Contours==2 +ellipse[-2] {$X+$Decalage_X},$Y,$Valeur_A,$Valeur_A,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-2] {$X+$Decalage_X},$Y,$Valeur_B,$Valeur_B,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-2] {$X+$Decalage_X},$Y,$Valeur_R,$Valeur_R,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +repeat $Resolution +Nb_boucles+=1 +Angle={$Nb_boucles*(360/$Resolution)} +X_Oeuf_A_Imprimer={{$X-{$Valeur_B+{$Valeur_R/2}}}+{$Decalage_X+{$Valeur_B+{$Valeur_R*{cos(pi/180*$Angle)}}}}} +Y_Oeuf_A_Imprimer={$Y+((($Valeur_A*$Valeur_R*(sin(pi/180*$Angle)))/($Valeur_B+($Valeur_R*(cos(pi/180*$Angle))))))} +polygon[-1] 3,{$X+$Decalage_X},$Y,$X_Oeuf_A_Imprimer_Precedent,$Y_Oeuf_A_Imprimer_Precedent,$X_Oeuf_A_Imprimer,$Y_Oeuf_A_Imprimer,1,$R_a,$V_a,$B_a,$A_a +if $Affichage_Contours>0 +line[-2] $X_Oeuf_A_Imprimer_Precedent,$Y_Oeuf_A_Imprimer_Precedent,$X_Oeuf_A_Imprimer,$Y_Oeuf_A_Imprimer,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +X_Oeuf_A_Imprimer_Precedent=$X_Oeuf_A_Imprimer +Y_Oeuf_A_Imprimer_Precedent=$Y_Oeuf_A_Imprimer +done +if $Affichage_Contours>0 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +if $Angle_Rotation>0 rotate[-1] $Angle_Rotation,1,0,{w/2},{h/2} fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Egg_Oeuf_Hugelschaffer : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Dimension={round({{min(w,h)}*$3/5000})} +Valeur_A=$4 +Valeur_B=$5 +Valeur_D=$6 +Angle_Rotation=$7 +R_Contours=$8 +V_Contours=$9 +B_Contours=$10 +A_Contours=$11 +Affichage_Contours=$12 +R_a=$13 +V_a=$14 +B_a=$15 +A_a=$16 +Couleurs_aleatoires=$17 +Inversions=$18 +Flou=$19 +Dilatation=$20 +Deformation=$21 +Bruit=$22 +Ombre=$23 +X_Ombre=$24 +Y_Ombre=$25 +Smoothness_Ombre=$26 +Curvature_Ombre=$27 +Compensation_Decalage_Ombre_X=$28 +Compensation_Decalage_Ombre_Y=$29 +Canal_Alpha=$30 +Resolution=720 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_boucles=0 +Angle=0 +X_Oeuf_A_Imprimer=0 +Y_Oeuf_A_Imprimer=0 +X_Oeuf_A_Imprimer_Precedent={$X+($Dimension*(((($Valeur_A*$Valeur_A)-($Valeur_D*$Valeur_D*(sin(pi/180*$Angle))*(sin(pi/180*$Angle)))^0.5)+($Valeur_D*(cos(pi/180*$Angle))))*(cos(pi/180*$Angle))))} +Y_Oeuf_A_Imprimer_Precedent={$Y+($Dimension*($Valeur_B*(sin(pi/180*$Angle))))} +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Affichage_Contours>0 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +fi +if $Affichage_Contours==2 +ellipse[-2] $X,$Y,{$Dimension*$Valeur_A},{$Dimension*$Valeur_A},0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-2] $X,$Y,{$Dimension*$Valeur_B},{$Dimension*$Valeur_B},0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +repeat $Resolution +Nb_boucles+=1 +Angle={$Nb_boucles*(360/$Resolution)} +X_Oeuf_A_Imprimer={$X+($Dimension*(((($Valeur_A*$Valeur_A)-($Valeur_D*$Valeur_D*(sin(pi/180*$Angle))*(sin(pi/180*$Angle)))^0.5)+($Valeur_D*(cos(pi/180*$Angle))))*(cos(pi/180*$Angle))))} +Y_Oeuf_A_Imprimer={$Y+($Dimension*($Valeur_B*(sin(pi/180*$Angle))))} +polygon[-1] 3,$X,$Y,$X_Oeuf_A_Imprimer_Precedent,$Y_Oeuf_A_Imprimer_Precedent,$X_Oeuf_A_Imprimer,$Y_Oeuf_A_Imprimer,1,$R_a,$V_a,$B_a,$A_a +if $Affichage_Contours>0 +line[-2] $X_Oeuf_A_Imprimer_Precedent,$Y_Oeuf_A_Imprimer_Precedent,$X_Oeuf_A_Imprimer,$Y_Oeuf_A_Imprimer,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +X_Oeuf_A_Imprimer_Precedent=$X_Oeuf_A_Imprimer +Y_Oeuf_A_Imprimer_Precedent=$Y_Oeuf_A_Imprimer +done +if $Affichage_Contours>0 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +if $Angle_Rotation>0 rotate[-1] $Angle_Rotation,1,0,{w/2},{h/2} fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Egg_Oeuf_Rosillo : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Valeur_A={round({{w+h}*$3/200})} +Valeur_B={$Valeur_A*$4/100} +Valeur_C={$Valeur_A*$5/100} +Angle_Rotation=$6 +R_Contours=$7 +V_Contours=$8 +B_Contours=$9 +A_Contours=$10 +Affichage_Contours=$11 +R_a=$12 +V_a=$13 +B_a=$14 +A_a=$15 +Couleurs_aleatoires=$16 +Inversions=$17 +Flou=$18 +Dilatation=$19 +Deformation=$20 +Bruit=$21 +Ombre=$22 +X_Ombre=$23 +Y_Ombre=$24 +Smoothness_Ombre=$25 +Curvature_Ombre=$26 +Compensation_Decalage_Ombre_X=$27 +Compensation_Decalage_Ombre_Y=$28 +Canal_Alpha=$29 +Resolution=720 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_boucles=0 +Angle=0 +X_Oeuf_A_Imprimer=0 +Y_Oeuf_A_Imprimer=0 +X_Oeuf_A_Imprimer_Precedent={$X+($Valeur_A*(cos(pi/180*$Angle)))} +Y_Oeuf_A_Imprimer_Precedent={$Y+(($Valeur_B-($Valeur_A*(cos(pi/180*$Angle))))/($Valeur_C-($Valeur_A*(cos(pi/180*$Angle))))*($Valeur_A*(sin(pi/180*$Angle))))} +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Affichage_Contours>0 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +fi +if $Affichage_Contours==2 +ellipse[-2] $X,$Y,$Valeur_A,$Valeur_A,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-2] $X,$Y,$Valeur_B,$Valeur_B,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-2] $X,$Y,$Valeur_C,$Valeur_C,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +repeat $Resolution +Nb_boucles+=1 +Angle={$Nb_boucles*(360/$Resolution)} +X_Oeuf_A_Imprimer={$X+($Valeur_A*(cos(pi/180*$Angle)))} +Y_Oeuf_A_Imprimer={$Y+(($Valeur_B-($Valeur_A*(cos(pi/180*$Angle))))/($Valeur_C-($Valeur_A*(cos(pi/180*$Angle))))*($Valeur_A*(sin(pi/180*$Angle))))} +polygon[-1] 3,$X,$Y,$X_Oeuf_A_Imprimer_Precedent,$Y_Oeuf_A_Imprimer_Precedent,$X_Oeuf_A_Imprimer,$Y_Oeuf_A_Imprimer,1,$R_a,$V_a,$B_a,$A_a +if $Affichage_Contours>0 +line[-2] $X_Oeuf_A_Imprimer_Precedent,$Y_Oeuf_A_Imprimer_Precedent,$X_Oeuf_A_Imprimer,$Y_Oeuf_A_Imprimer,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +X_Oeuf_A_Imprimer_Precedent=$X_Oeuf_A_Imprimer +Y_Oeuf_A_Imprimer_Precedent=$Y_Oeuf_A_Imprimer +done +if $Affichage_Contours>0 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +if $Angle_Rotation>0 rotate[-1] $Angle_Rotation,1,0,{w/2},{h/2} fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Engrenages_Laser_LED : +Module_m={$1+1} +Angle_De_Pression_alpha={round($2*10000)/10000} +Diam_Trou_Arbre=$3 +Nb_Dents_Roue_Z1=$4 +Nb_Dents_Roue_Z2=$5 +Egalite_Primitif=$6 +Contours_Plus=$7 +Trous_Assemb_Nb=$8 +Trous_Assemb_Diam=$9 +Trous_Assemb_Distance_Centre=$10 +Trous_Assemb_Decalage_Angle={{pi}/180*$11} +Rainure_Largeur=$12 +Rainure_Hauteur=$13 +Rainure_Decalage_Angle={{pi}/180*$14} +Echelle=1 +Dimension_Max_Image=7200 +Reserve_Contour_Image=10 +Module_m_Origine={$Module_m-1} +Dia_Primitif_Z1={$Echelle*$Module_m*$Nb_Dents_Roue_Z1} +Dia_Tete_Z1={$Dia_Primitif_Z1+(2*$Echelle*$Module_m)} +Dia_Primitif_Z2={$Echelle*$Module_m*$Nb_Dents_Roue_Z2} +Dia_Tete_Z2={$Dia_Primitif_Z2+(2*$Echelle*$Module_m)} +if $Nb_Dents_Roue_Z1>$Nb_Dents_Roue_Z2 +do +Module_m-=1 +Dia_Primitif_Z1={$Echelle*$Module_m*$Nb_Dents_Roue_Z1} +Dia_Tete_Z1={$Dia_Primitif_Z1+(2*$Echelle*$Module_m)} +while $Dia_Tete_Z1>$Dimension_Max_Image-2*$Reserve_Contour_Image +else +do +Module_m-=1 +Dia_Primitif_Z2={$Echelle*$Module_m*$Nb_Dents_Roue_Z2} +Dia_Tete_Z2={$Dia_Primitif_Z2+(2*$Echelle*$Module_m)} +while $Dia_Tete_Z2>$Dimension_Max_Image-2*$Reserve_Contour_Image +fi +Dia_Primitif_Z1={$Echelle*$Module_m*$Nb_Dents_Roue_Z1} +Dia_Tete_Z1={$Dia_Primitif_Z1+(2*$Echelle*$Module_m)} +Dia_Pied_Z1={$Dia_Primitif_Z1-(2.5*$Echelle*$Module_m)} +Dia_Primitif_Z2={$Echelle*$Module_m*$Nb_Dents_Roue_Z2} +Dia_Tete_Z2={$Dia_Primitif_Z2+(2*$Echelle*$Module_m)} +Dia_Pied_Z2={$Dia_Primitif_Z2-(2.5*$Echelle*$Module_m)} +Angle_De_Pression_alpha_Origine=$Angle_De_Pression_alpha +Angle_De_Pression_alpha+=0.1 +if $Nb_Dents_Roue_Z1>$Nb_Dents_Roue_Z2 +do +Angle_De_Pression_alpha-=0.1 +Diametre_Cercle_De_Base_Z1={$Dia_Primitif_Z1*cos(((pi)/180*$Angle_De_Pression_alpha))} +Rayon_Developpante_Z1={$Diametre_Cercle_De_Base_Z1/2} +while $Dia_Pied_Z1/2>$Rayon_Developpante_Z1 +else +do +Angle_De_Pression_alpha-=0.1 +Diametre_Cercle_De_Base_Z2={$Dia_Primitif_Z2*cos(((pi)/180*$Angle_De_Pression_alpha))} +Rayon_Developpante_Z2={$Diametre_Cercle_De_Base_Z2/2} +while $Dia_Pied_Z2/2>$Rayon_Developpante_Z2 +fi +Angle_De_Pression_alpha={round($Angle_De_Pression_alpha*10000)/10000} +Dia_Primitif_Z1={$Echelle*$Module_m*$Nb_Dents_Roue_Z1} +Dia_Tete_Z1={$Dia_Primitif_Z1+(2*$Echelle*$Module_m)} +Diametre_Cercle_De_Base_Z1={$Dia_Primitif_Z1*cos(((pi)/180*$Angle_De_Pression_alpha))} +Dia_Pied_Z1={$Dia_Primitif_Z1-(2.5*$Echelle*$Module_m)} +Rayon_Developpante_Z1={$Diametre_Cercle_De_Base_Z1/2} +Dia_Primitif_Z2={$Echelle*$Module_m*$Nb_Dents_Roue_Z2} +Dia_Tete_Z2={$Dia_Primitif_Z2+(2*$Echelle*$Module_m)} +Dia_Pied_Z2={$Dia_Primitif_Z2-(2.5*$Echelle*$Module_m)} +Diametre_Cercle_De_Base_Z2={$Dia_Primitif_Z2*cos(((pi)/180*$Angle_De_Pression_alpha))} +Rayon_Developpante_Z2={$Diametre_Cercle_De_Base_Z2/2} +if $Nb_Dents_Roue_Z1>$Nb_Dents_Roue_Z2 +Largeur={round({$Dia_Tete_Z1+{2*{$Reserve_Contour_Image}}})} +else +Largeur={round({$Dia_Tete_Z2+{2*{$Reserve_Contour_Image}}})} +fi +Hauteur=$Largeur +Entraxe_Engrenages_theorique={{$Echelle*$Module_m*{$Nb_Dents_Roue_Z1+$Nb_Dents_Roue_Z2}}/2} +Creux_b={$Echelle*$Module_m*1.25} +Saillie_a={$Echelle*$Module_m} +Vide_Fond_De_Dent_c={$Creux_b-$Saillie_a} +Hauteur_de_dent_ht={$Creux_b+$Saillie_a} +Pas_Primitif_p={$Echelle*$Module_m*(pi)} +Epaisseur_Circulaire_t={$Pas_Primitif_p/2} +Hauteur_Active_hk={2*$Saillie_a} +X_Origine={$Largeur/2} +Y_Origine={$Hauteur/2} +Increment_Developpante={{pi}*0.0002} +Precision_Tracage_Cercles=500 +rm[0] +$Largeur,$Hauteur,1,4 +fill_color[-1] 255,255,255,255 +Rayon_Developpante={$Diametre_Cercle_De_Base_Z1/2} +Dimension_Developpante=0 +Condition_Arret={$Dia_Tete_Z1/2} +Angle_Rotation=0 +Increment_Rotation={2*{pi}/$Nb_Dents_Roue_Z1} +Angle_Dent={{pi}/$Nb_Dents_Roue_Z1} +Base_Dent={2*{{$Diametre_Cercle_De_Base_Z1/2}*sin({{pi}/{$Nb_Dents_Roue_Z1*4}})}} +Angle_Porte_Au_Cercle_Pied={2*asin($Base_Dent/$Dia_Pied_Z1)} +Angle_Decalage_Rainure_Pied={{$Angle_Porte_Au_Cercle_Pied-{$Increment_Rotation/4}}/2} +X_Developpante_Tracage=0 +Y_Developpante_Tracage=0 +Angle_Decalage_Developpante_B={{{pi}/{$Nb_Dents_Roue_Z1*2}}-{{pi}/2}+{{{pi}/$Nb_Dents_Roue_Z1}/2}} +if $Egalite_Primitif==1 +Intersection_Developpante_Cercle_primitif=0 +X_Developpante_Memo=0 +Y_Developpante_Memo=0 +X_Intersection=0 +Y_Intersection=0 +Angle_Developpante_Rad=0 +Nb_boucles=0 +do +X_Developpante={$Rayon_Developpante*(cos($Angle_Developpante_Rad)+($Angle_Developpante_Rad*sin($Angle_Developpante_Rad)))} +Y_Developpante={$Rayon_Developpante*(sin($Angle_Developpante_Rad)-($Angle_Developpante_Rad*cos($Angle_Developpante_Rad)))} +Dimension_Developpante={({{($X_Developpante)^2}+{($Y_Developpante)^2}})^0.5} +X_Developpante_Tracage={$X_Origine+(($X_Developpante*cos($Angle_Rotation))-($Y_Developpante*sin($Angle_Rotation)))} +Y_Developpante_Tracage={$Y_Origine+(($X_Developpante*sin($Angle_Rotation))+($Y_Developpante*cos($Angle_Rotation)))} +if $Intersection_Developpante_Cercle_primitif==0 +if $Dimension_Developpante>{$Dia_Primitif_Z1/2} +Angle_Intersection={atan2({$Y_Developpante_Memo-$Y_Origine},{$X_Developpante_Memo-$X_Origine})} +Angle_Alpha_Base_Primitif={$Angle_Rotation-$Angle_Intersection} +Intersection_Developpante_Cercle_primitif=1 +fi +X_Developpante_Memo=$X_Developpante_Tracage +Y_Developpante_Memo=$Y_Developpante_Tracage +fi +Angle_Developpante_Rad+=$Increment_Developpante +Nb_boucles+=1 +while $Dimension_Developpante<$Condition_Arret +Angle_Rotation=0 +Dimension_Developpante=0 +X_Developpante_Tracage=0 +Y_Developpante_Tracage=0 +fi +repeat $Nb_Dents_Roue_Z1 +Angle_Developpante_Rad=0 +Nb_boucles=0 +do +X_Developpante={$Rayon_Developpante*(cos($Angle_Developpante_Rad)+($Angle_Developpante_Rad*sin($Angle_Developpante_Rad)))} +Y_Developpante={$Rayon_Developpante*(sin($Angle_Developpante_Rad)-($Angle_Developpante_Rad*cos($Angle_Developpante_Rad)))} +Dimension_Developpante={({{($X_Developpante)^2}+{($Y_Developpante)^2}})^0.5} +X_Developpante_Tracage={$X_Origine+(($X_Developpante*cos($Angle_Rotation))-($Y_Developpante*sin($Angle_Rotation)))} +Y_Developpante_Tracage={$Y_Origine+(($X_Developpante*sin($Angle_Rotation))+($Y_Developpante*cos($Angle_Rotation)))} +if $Nb_boucles==0 +X_Debut_Developpante_Tracage_A=$X_Developpante_Tracage +Y_Debut_Developpante_Tracage_A=$Y_Developpante_Tracage +fi +X_Fin_Developpante_Tracage_A=$X_Developpante_Tracage +Y_Fin_Developpante_Tracage_A=$Y_Developpante_Tracage +point[-1] $X_Developpante_Tracage,$Y_Developpante_Tracage,0,1,0,0,0,255 +X_Developpante={$Rayon_Developpante*(sin($Angle_Developpante_Rad)-($Angle_Developpante_Rad*cos($Angle_Developpante_Rad)))} +Y_Developpante={$Rayon_Developpante*(cos($Angle_Developpante_Rad)+($Angle_Developpante_Rad*sin($Angle_Developpante_Rad)))} +if $Egalite_Primitif==1 +X_Developpante_Tracage={$X_Origine+(($X_Developpante*cos($Angle_Rotation-(2*$Angle_Alpha_Base_Primitif)+$Angle_Decalage_Developpante_B))-($Y_Developpante*sin($Angle_Rotation-(2*$Angle_Alpha_Base_Primitif)+$Angle_Decalage_Developpante_B)))} +Y_Developpante_Tracage={$Y_Origine+(($X_Developpante*sin($Angle_Rotation-(2*$Angle_Alpha_Base_Primitif)+$Angle_Decalage_Developpante_B))+($Y_Developpante*cos($Angle_Rotation-(2*$Angle_Alpha_Base_Primitif)+$Angle_Decalage_Developpante_B)))} +else +X_Developpante_Tracage={$X_Origine+(($X_Developpante*cos($Angle_Rotation+$Angle_Decalage_Developpante_B))-($Y_Developpante*sin($Angle_Rotation+$Angle_Decalage_Developpante_B)))} +Y_Developpante_Tracage={$Y_Origine+(($X_Developpante*sin($Angle_Rotation+$Angle_Decalage_Developpante_B))+($Y_Developpante*cos($Angle_Rotation+$Angle_Decalage_Developpante_B)))} +fi +if $Nb_boucles==0 +X_Debut_Developpante_Tracage_B=$X_Developpante_Tracage +Y_Debut_Developpante_Tracage_B=$Y_Developpante_Tracage +fi +X_Fin_Developpante_Tracage_B=$X_Developpante_Tracage +Y_Fin_Developpante_Tracage_B=$Y_Developpante_Tracage +point[-1] $X_Developpante_Tracage,$Y_Developpante_Tracage,0,1,0,0,0,255 +Angle_Developpante_Rad+=$Increment_Developpante +Nb_boucles+=1 +while $Dimension_Developpante<$Condition_Arret +Angle_Fin_Developpante_Tracage_A={atan2({$Y_Fin_Developpante_Tracage_A-$Y_Origine},{$X_Fin_Developpante_Tracage_A-$X_Origine})} +Angle_Fin_Developpante_Tracage_B={atan2({$Y_Fin_Developpante_Tracage_B-$Y_Origine},{$X_Fin_Developpante_Tracage_B-$X_Origine})} +Angle_Tracage=$Angle_Fin_Developpante_Tracage_A +Increment_Angle_Tracage={{$Angle_Fin_Developpante_Tracage_B-$Angle_Fin_Developpante_Tracage_A}/$Precision_Tracage_Cercles} +repeat $Precision_Tracage_Cercles +point[-1] {$X_Origine+{{$Dia_Tete_Z1/2}*{cos($Angle_Tracage)}}},{$Y_Origine+{{$Dia_Tete_Z1/2}*{sin($Angle_Tracage)}}},0,1,0,0,0,255 +Angle_Tracage+=$Increment_Angle_Tracage +done +Angle_Debut_Developpante_Tracage_A={atan2({$Y_Debut_Developpante_Tracage_A-$Y_Origine},{$X_Debut_Developpante_Tracage_A-$X_Origine})} +Angle_Debut_Developpante_Tracage_B={atan2({$Y_Debut_Developpante_Tracage_B-$Y_Origine},{$X_Debut_Developpante_Tracage_B-$X_Origine})} +Angle_Debut_Rainure_Pied={$Angle_Debut_Developpante_Tracage_A-$Angle_Decalage_Rainure_Pied} +Angle_Fin_Rainure_Pied={$Angle_Debut_Developpante_Tracage_B+$Angle_Decalage_Rainure_Pied} +X_Debut_Rainure_Pied={$X_Origine+(($Dia_Pied_Z1/2)*(cos($Angle_Debut_Rainure_Pied)))} +Y_Debut_Rainure_Pied={$Y_Origine+(($Dia_Pied_Z1/2)*(sin($Angle_Debut_Rainure_Pied)))} +X_Fin_Rainure_Pied={$X_Origine+(($Dia_Pied_Z1/2)*(cos($Angle_Fin_Rainure_Pied)))} +Y_Fin_Rainure_Pied={$Y_Origine+(($Dia_Pied_Z1/2)*(sin($Angle_Fin_Rainure_Pied)))} +line[-1] {$X_Origine+{{$Diametre_Cercle_De_Base_Z1/2}*{cos($Angle_Debut_Developpante_Tracage_A)}}},{$Y_Origine+{{$Diametre_Cercle_De_Base_Z1/2}*{sin($Angle_Debut_Developpante_Tracage_A)}}},$X_Debut_Rainure_Pied,$Y_Debut_Rainure_Pied,1,0,0,0,255 +line[-1] {$X_Origine+{{$Diametre_Cercle_De_Base_Z1/2}*{cos($Angle_Debut_Developpante_Tracage_B)}}},{$Y_Origine+{{$Diametre_Cercle_De_Base_Z1/2}*{sin($Angle_Debut_Developpante_Tracage_B)}}},$X_Fin_Rainure_Pied,$Y_Fin_Rainure_Pied,1,0,0,0,255 +Angle_Debut_Rainure_Pied_Suivant={$Angle_Fin_Rainure_Pied+($Increment_Rotation/2)-($Angle_Decalage_Rainure_Pied*2)} +if $Egalite_Primitif==1 +X_Debut_Rainure_Pied_Suivant={$X_Origine+(($Dia_Pied_Z1/2)*(cos($Angle_Debut_Rainure_Pied_Suivant+(2*$Angle_Alpha_Base_Primitif))))} +Y_Debut_Rainure_Pied_Suivant={$Y_Origine+(($Dia_Pied_Z1/2)*(sin($Angle_Debut_Rainure_Pied_Suivant+(2*$Angle_Alpha_Base_Primitif))))} +line[-1] $X_Debut_Rainure_Pied_Suivant,$Y_Debut_Rainure_Pied_Suivant,$X_Fin_Rainure_Pied,$Y_Fin_Rainure_Pied,1,0,0,0,255 +else +X_Debut_Rainure_Pied_Suivant={$X_Origine+(($Dia_Pied_Z1/2)*(cos($Angle_Debut_Rainure_Pied_Suivant)))} +Y_Debut_Rainure_Pied_Suivant={$Y_Origine+(($Dia_Pied_Z1/2)*(sin($Angle_Debut_Rainure_Pied_Suivant)))} +line[-1] $X_Debut_Rainure_Pied_Suivant,$Y_Debut_Rainure_Pied_Suivant,$X_Fin_Rainure_Pied,$Y_Fin_Rainure_Pied,1,0,0,0,255 +fi +Angle_Rotation+=$Increment_Rotation +done +X_Origine={$Largeur/2} +Y_Origine={$Hauteur/2} +Increment_Developpante={{pi}*0.0002} +Precision_Tracage_Cercles=500 +$Largeur,$Hauteur,1,4 +fill_color[-1] 255,255,255,255 +Rayon_Developpante={$Diametre_Cercle_De_Base_Z2/2} +Dimension_Developpante=0 +Condition_Arret={$Dia_Tete_Z2/2} +Angle_Rotation=0 +Increment_Rotation={2*{pi}/$Nb_Dents_Roue_Z2} +Angle_Dent={{pi}/$Nb_Dents_Roue_Z2} +Base_Dent={2*{{$Diametre_Cercle_De_Base_Z2/2}*sin({{pi}/{$Nb_Dents_Roue_Z2*4}})}} +Angle_Porte_Au_Cercle_Pied={2*asin($Base_Dent/$Dia_Pied_Z2)} +Angle_Decalage_Rainure_Pied={{$Angle_Porte_Au_Cercle_Pied-{$Increment_Rotation/4}}/2} +X_Developpante_Tracage=0 +Y_Developpante_Tracage=0 +Angle_Decalage_Developpante_B={{{pi}/{$Nb_Dents_Roue_Z2*2}}-{{pi}/2}+{{{pi}/$Nb_Dents_Roue_Z2}/2}} +if $Egalite_Primitif==1 +Intersection_Developpante_Cercle_primitif=0 +X_Developpante_Memo=0 +Y_Developpante_Memo=0 +X_Intersection=0 +Y_Intersection=0 +Angle_Developpante_Rad=0 +Nb_boucles=0 +do +X_Developpante={$Rayon_Developpante*(cos($Angle_Developpante_Rad)+($Angle_Developpante_Rad*sin($Angle_Developpante_Rad)))} +Y_Developpante={$Rayon_Developpante*(sin($Angle_Developpante_Rad)-($Angle_Developpante_Rad*cos($Angle_Developpante_Rad)))} +Dimension_Developpante={({{($X_Developpante)^2}+{($Y_Developpante)^2}})^0.5} +X_Developpante_Tracage={$X_Origine+(($X_Developpante*cos($Angle_Rotation))-($Y_Developpante*sin($Angle_Rotation)))} +Y_Developpante_Tracage={$Y_Origine+(($X_Developpante*sin($Angle_Rotation))+($Y_Developpante*cos($Angle_Rotation)))} +if $Intersection_Developpante_Cercle_primitif==0 +if $Dimension_Developpante>{$Dia_Primitif_Z2/2} +Angle_Intersection={atan2({$Y_Developpante_Memo-$Y_Origine},{$X_Developpante_Memo-$X_Origine})} +Angle_Alpha_Base_Primitif={$Angle_Rotation-$Angle_Intersection} +Intersection_Developpante_Cercle_primitif=1 +fi +X_Developpante_Memo=$X_Developpante_Tracage +Y_Developpante_Memo=$Y_Developpante_Tracage +fi +Angle_Developpante_Rad+=$Increment_Developpante +Nb_boucles+=1 +while $Dimension_Developpante<$Condition_Arret +Angle_Rotation=0 +Dimension_Developpante=0 +X_Developpante_Tracage=0 +Y_Developpante_Tracage=0 +fi +repeat $Nb_Dents_Roue_Z2 +Angle_Developpante_Rad=0 +Nb_boucles=0 +do +X_Developpante={$Rayon_Developpante*(cos($Angle_Developpante_Rad)+($Angle_Developpante_Rad*sin($Angle_Developpante_Rad)))} +Y_Developpante={$Rayon_Developpante*(sin($Angle_Developpante_Rad)-($Angle_Developpante_Rad*cos($Angle_Developpante_Rad)))} +Dimension_Developpante={({{($X_Developpante)^2}+{($Y_Developpante)^2}})^0.5} +X_Developpante_Tracage={$X_Origine+(($X_Developpante*cos($Angle_Rotation))-($Y_Developpante*sin($Angle_Rotation)))} +Y_Developpante_Tracage={$Y_Origine+(($X_Developpante*sin($Angle_Rotation))+($Y_Developpante*cos($Angle_Rotation)))} +if $Nb_boucles==0 +X_Debut_Developpante_Tracage_A=$X_Developpante_Tracage +Y_Debut_Developpante_Tracage_A=$Y_Developpante_Tracage +fi +X_Fin_Developpante_Tracage_A=$X_Developpante_Tracage +Y_Fin_Developpante_Tracage_A=$Y_Developpante_Tracage +point[-1] $X_Developpante_Tracage,$Y_Developpante_Tracage,0,1,0,0,0,255 +X_Developpante={$Rayon_Developpante*(sin($Angle_Developpante_Rad)-($Angle_Developpante_Rad*cos($Angle_Developpante_Rad)))} +Y_Developpante={$Rayon_Developpante*(cos($Angle_Developpante_Rad)+($Angle_Developpante_Rad*sin($Angle_Developpante_Rad)))} +if $Egalite_Primitif==1 +X_Developpante_Tracage={$X_Origine+(($X_Developpante*cos($Angle_Rotation-(2*$Angle_Alpha_Base_Primitif)+$Angle_Decalage_Developpante_B))-($Y_Developpante*sin($Angle_Rotation-(2*$Angle_Alpha_Base_Primitif)+$Angle_Decalage_Developpante_B)))} +Y_Developpante_Tracage={$Y_Origine+(($X_Developpante*sin($Angle_Rotation-(2*$Angle_Alpha_Base_Primitif)+$Angle_Decalage_Developpante_B))+($Y_Developpante*cos($Angle_Rotation-(2*$Angle_Alpha_Base_Primitif)+$Angle_Decalage_Developpante_B)))} +else +X_Developpante_Tracage={$X_Origine+(($X_Developpante*cos($Angle_Rotation+$Angle_Decalage_Developpante_B))-($Y_Developpante*sin($Angle_Rotation+$Angle_Decalage_Developpante_B)))} +Y_Developpante_Tracage={$Y_Origine+(($X_Developpante*sin($Angle_Rotation+$Angle_Decalage_Developpante_B))+($Y_Developpante*cos($Angle_Rotation+$Angle_Decalage_Developpante_B)))} +fi +if $Nb_boucles==0 +X_Debut_Developpante_Tracage_B=$X_Developpante_Tracage +Y_Debut_Developpante_Tracage_B=$Y_Developpante_Tracage +fi +X_Fin_Developpante_Tracage_B=$X_Developpante_Tracage +Y_Fin_Developpante_Tracage_B=$Y_Developpante_Tracage +point[-1] $X_Developpante_Tracage,$Y_Developpante_Tracage,0,1,0,0,0,255 +Angle_Developpante_Rad+=$Increment_Developpante +Nb_boucles+=1 +while $Dimension_Developpante<$Condition_Arret +Angle_Fin_Developpante_Tracage_A={atan2({$Y_Fin_Developpante_Tracage_A-$Y_Origine},{$X_Fin_Developpante_Tracage_A-$X_Origine})} +Angle_Fin_Developpante_Tracage_B={atan2({$Y_Fin_Developpante_Tracage_B-$Y_Origine},{$X_Fin_Developpante_Tracage_B-$X_Origine})} +Angle_Tracage=$Angle_Fin_Developpante_Tracage_A +Increment_Angle_Tracage={{$Angle_Fin_Developpante_Tracage_B-$Angle_Fin_Developpante_Tracage_A}/$Precision_Tracage_Cercles} +repeat $Precision_Tracage_Cercles +point[-1] {$X_Origine+{{$Dia_Tete_Z2/2}*{cos($Angle_Tracage)}}},{$Y_Origine+{{$Dia_Tete_Z2/2}*{sin($Angle_Tracage)}}},0,1,0,0,0,255 +Angle_Tracage+=$Increment_Angle_Tracage +done +Angle_Debut_Developpante_Tracage_A={atan2({$Y_Debut_Developpante_Tracage_A-$Y_Origine},{$X_Debut_Developpante_Tracage_A-$X_Origine})} +Angle_Debut_Developpante_Tracage_B={atan2({$Y_Debut_Developpante_Tracage_B-$Y_Origine},{$X_Debut_Developpante_Tracage_B-$X_Origine})} +Angle_Debut_Rainure_Pied={$Angle_Debut_Developpante_Tracage_A-$Angle_Decalage_Rainure_Pied} +Angle_Fin_Rainure_Pied={$Angle_Debut_Developpante_Tracage_B+$Angle_Decalage_Rainure_Pied} +X_Debut_Rainure_Pied={$X_Origine+(($Dia_Pied_Z2/2)*(cos($Angle_Debut_Rainure_Pied)))} +Y_Debut_Rainure_Pied={$Y_Origine+(($Dia_Pied_Z2/2)*(sin($Angle_Debut_Rainure_Pied)))} +X_Fin_Rainure_Pied={$X_Origine+(($Dia_Pied_Z2/2)*(cos($Angle_Fin_Rainure_Pied)))} +Y_Fin_Rainure_Pied={$Y_Origine+(($Dia_Pied_Z2/2)*(sin($Angle_Fin_Rainure_Pied)))} +line[-1] {$X_Origine+{{$Diametre_Cercle_De_Base_Z2/2}*{cos($Angle_Debut_Developpante_Tracage_A)}}},{$Y_Origine+{{$Diametre_Cercle_De_Base_Z2/2}*{sin($Angle_Debut_Developpante_Tracage_A)}}},$X_Debut_Rainure_Pied,$Y_Debut_Rainure_Pied,1,0,0,0,255 +line[-1] {$X_Origine+{{$Diametre_Cercle_De_Base_Z2/2}*{cos($Angle_Debut_Developpante_Tracage_B)}}},{$Y_Origine+{{$Diametre_Cercle_De_Base_Z2/2}*{sin($Angle_Debut_Developpante_Tracage_B)}}},$X_Fin_Rainure_Pied,$Y_Fin_Rainure_Pied,1,0,0,0,255 +Angle_Debut_Rainure_Pied_Suivant={$Angle_Fin_Rainure_Pied+($Increment_Rotation/2)-($Angle_Decalage_Rainure_Pied*2)} +if $Egalite_Primitif==1 +X_Debut_Rainure_Pied_Suivant={$X_Origine+(($Dia_Pied_Z2/2)*(cos($Angle_Debut_Rainure_Pied_Suivant+(2*$Angle_Alpha_Base_Primitif))))} +Y_Debut_Rainure_Pied_Suivant={$Y_Origine+(($Dia_Pied_Z2/2)*(sin($Angle_Debut_Rainure_Pied_Suivant+(2*$Angle_Alpha_Base_Primitif))))} +line[-1] $X_Debut_Rainure_Pied_Suivant,$Y_Debut_Rainure_Pied_Suivant,$X_Fin_Rainure_Pied,$Y_Fin_Rainure_Pied,1,0,0,0,255 +else +X_Debut_Rainure_Pied_Suivant={$X_Origine+(($Dia_Pied_Z2/2)*(cos($Angle_Debut_Rainure_Pied_Suivant)))} +Y_Debut_Rainure_Pied_Suivant={$Y_Origine+(($Dia_Pied_Z2/2)*(sin($Angle_Debut_Rainure_Pied_Suivant)))} +line[-1] $X_Debut_Rainure_Pied_Suivant,$Y_Debut_Rainure_Pied_Suivant,$X_Fin_Rainure_Pied,$Y_Fin_Rainure_Pied,1,0,0,0,255 +fi +Angle_Rotation+=$Increment_Rotation +done +$Largeur,$Hauteur,1,4 +fill_color[-1] 0,0,0,0 +Angle_Rot=0 +Inc_Angle={2*{pi}/$Trous_Assemb_Nb} +repeat $Trous_Assemb_Nb +X_Centre={$X_Origine+($Trous_Assemb_Distance_Centre*cos($Trous_Assemb_Decalage_Angle+$Angle_Rot))} +Y_Centre={$Y_Origine+($Trous_Assemb_Distance_Centre*sin($Trous_Assemb_Decalage_Angle+$Angle_Rot))} +circle[-2,-3] $X_Centre,$Y_Centre,{$Trous_Assemb_Diam/2},1,0xFFFFFFFF,0,0,0,255 +circle[-1] $X_Centre,$Y_Centre,{$Trous_Assemb_Diam/2},1,0xFFFFFFFF,255,0,255,255 +Angle_Rot+=$Inc_Angle +done +circle[-1] $X_Origine,$Y_Origine,$Trous_Assemb_Distance_Centre,1,0xFFFFFFFF,255,0,255,255 +Trous_Assemb_Erreur=0 +if {$Trous_Assemb_Distance_Centre+{$Trous_Assemb_Diam/2}}>{$Dia_Pied_Z1/2} Trous_Assemb_Erreur+=1 fi +if {$Trous_Assemb_Distance_Centre-{$Trous_Assemb_Diam/2}}<{$Diam_Trou_Arbre/2} Trous_Assemb_Erreur+=10 fi +if $Trous_Assemb_Nb>3 +Rayon_Cercle_Exterieur={$Trous_Assemb_Distance_Centre+$Trous_Assemb_Diam} +Angle_Theta={pi/$Trous_Assemb_Nb} +Rayon_Cercle_Centre={{$Rayon_Cercle_Exterieur*{1-{sin($Angle_Theta)}}}/{{1+{sin($Angle_Theta)}}}} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre+$Rayon_Cercles_Ext} +Rayon_Tang={({{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}})^0.5} +if $Trous_Assemb_Distance_Centre<$Rayon_Tang Trous_Assemb_Erreur+=100 fi +fi +circle[-1,-2,-3] $X_Origine,$Y_Origine,{$Diam_Trou_Arbre/2},1,0xFFFFFFFF,0,0,0,255 +polygon[-1,-2,-3] 4,2,2,{$Largeur-2},2,{$Largeur-2},{$Hauteur-2},2,{$Hauteur-2},1,0xFFFFFFFF,0,0,0,255 +Erreur_Rainure=0 +if $Rainure_Hauteur>{{$Diam_Trou_Arbre/2}-1} +Erreur_Rainure+=1 +fi +if $Rainure_Largeur>{{$Diam_Trou_Arbre/2}-1} +Erreur_Rainure+=10 +fi +if $Rainure_Largeur>0&&$Rainure_Hauteur>0&&$Rainure_Hauteur<{{$Diam_Trou_Arbre/2}-1}&&$Rainure_Largeur<{{$Diam_Trou_Arbre/2}-1} +Angle_Rainure={acos((($Diam_Trou_Arbre/2)^2*2-$Rainure_Largeur^2)/(2*($Diam_Trou_Arbre/2)^2))} +X_Sommet_A={$X_Origine+($Diam_Trou_Arbre/2)*cos($Rainure_Decalage_Angle+$Angle_Rainure)} +Y_Sommet_A={$Y_Origine+($Diam_Trou_Arbre/2)*sin($Rainure_Decalage_Angle+$Angle_Rainure)} +X_Sommet_B={$X_Origine+($Diam_Trou_Arbre/2)*cos($Rainure_Decalage_Angle)} +Y_Sommet_B={$Y_Origine+($Diam_Trou_Arbre/2)*sin($Rainure_Decalage_Angle)} +Angle_Tracage=0 +Increment_Angle_Tracage={$Angle_Rainure/$Precision_Tracage_Cercles} +repeat $Precision_Tracage_Cercles +point[-2,-3] {$X_Origine+{{$Diam_Trou_Arbre/2}*{cos($Rainure_Decalage_Angle+$Angle_Rainure+$Angle_Tracage)}}},{$Y_Origine+{{$Diam_Trou_Arbre/2}*{sin($Rainure_Decalage_Angle+$Angle_Rainure+$Angle_Tracage)}}},0,1,255,255,255,255 +Angle_Tracage-=$Increment_Angle_Tracage +done +line[-1] $X_Sommet_A,$Y_Sommet_A,$X_Sommet_B,$Y_Sommet_B,1,0,255,255,255 +Rayon_CD={(($Diam_Trou_Arbre/2)^2+$Rainure_Hauteur^2-2*($Diam_Trou_Arbre/2)*$Rainure_Hauteur*cos((pi-$Angle_Rainure)/2+(pi/2)))^0.5} +circle[-1] $X_Origine,$Y_Origine,$Rayon_CD,1,0xFFFFFFFF,0,255,255,255 +Angle_CD={acos(($Rayon_CD^2*2-$Rainure_Largeur^2)/(2*($Rayon_CD)^2))} +Angle_BC_DA={{$Angle_Rainure-$Angle_CD}/2} +X_Sommet_C={$X_Origine+($Rayon_CD*cos($Rainure_Decalage_Angle+$Angle_BC_DA))} +Y_Sommet_C={$Y_Origine+($Rayon_CD*sin($Rainure_Decalage_Angle+$Angle_BC_DA))} +X_Sommet_D={$X_Origine+($Rayon_CD*cos($Rainure_Decalage_Angle+$Angle_BC_DA+$Angle_CD))} +Y_Sommet_D={$Y_Origine+($Rayon_CD*sin($Rainure_Decalage_Angle+$Angle_BC_DA+$Angle_CD))} +line[-2,-3] $X_Sommet_C,$Y_Sommet_C,$X_Sommet_D,$Y_Sommet_D,1,0,0,0,255 +line[-2,-3] $X_Sommet_C,$Y_Sommet_C,$X_Sommet_B,$Y_Sommet_B,1,0,0,0,255 +line[-2,-3] $X_Sommet_A,$Y_Sommet_A,$X_Sommet_D,$Y_Sommet_D,1,0,0,0,255 +line[-1] $X_Sommet_C,$Y_Sommet_C,$X_Sommet_D,$Y_Sommet_D,1,0,255,255,255 +line[-1] $X_Sommet_C,$Y_Sommet_C,$X_Sommet_B,$Y_Sommet_B,1,0,255,255,255 +line[-1] $X_Sommet_A,$Y_Sommet_A,$X_Sommet_D,$Y_Sommet_D,1,0,255,255,255 +fi +L_O=10 +H_O=0 +I_T=32 +H_P=30 +R_P=0 +V_P=0 +B_P=0 +H_O+=$I_T +text[-1] "***** Engrenages Gears Laser : samj_Engrenages_Laser_LED *****",$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +H_O+=$I_T +if $Module_m-$Module_m_Origine==0 +text[-1] "Module m : "$Module_m" Demande/Settings : "$Module_m_Origine,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +else +text[-1] "Module m : "$Module_m" Demande/Settings : "$Module_m_Origine,$L_O,$H_O,{$H_P+2},1,255,0,0,255 +fi +H_O+=$I_T +if $Angle_De_Pression_alpha-$Angle_De_Pression_alpha_Origine==0 +text[-1] "Angle de Pression/Pressure Angle : "$Angle_De_Pression_alpha" Demande/Settings : "$Angle_De_Pression_alpha_Origine,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +else +text[-1] "Angle de Pression/Pressure Angle : "$Angle_De_Pression_alpha" Demande/Settings : "$Angle_De_Pression_alpha_Origine,$L_O,$H_O,{$H_P+2},1,255,0,0,255 +fi +H_O+=$I_T +text[-1] "Diam. trou central [pixels] : "$Diam_Trou_Arbre,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Nb de dents roue Z1 / Nb of teeth gear Z1 : "$Nb_Dents_Roue_Z1,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Nb de dents roue Z2 / Nb of teeth gear Z2 : "$Nb_Dents_Roue_Z2,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +if $Trous_Assemb_Erreur>0 +H_O+=$I_T +text[-1] "Erreur : "$Trous_Assemb_Erreur" . Modifier section : Trous pour assemblage / Mechanical assembly.",$L_O,$H_O,{$H_P+2},1,255,0,0,255 +fi +H_O+=$I_T +text[-1] "Nb. trous assemblage : "$Trous_Assemb_Nb,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Diam. trous assemblage [pixels] : "$Trous_Assemb_Diam,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Distance du centre [pixels] : "$Trous_Assemb_Distance_Centre,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Decalage angulaire trous [degres] : "$Trous_Assemb_Decalage_Angle,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +if $Erreur_Rainure>0 +H_O+=$I_T +text[-1] "Erreur : "$Erreur_Rainure" . Modifier section : Mortaise clavette trou central / Keyway cutting.",$L_O,$H_O,{$H_P+2},1,255,0,0,255 +fi +H_O+=$I_T +text[-1] "Mortaise/Keyway Largeur / Width [pixels] : "$Rainure_Largeur,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Mortaise/Keyway Hauteur / Height [pixels] : "$Rainure_Hauteur,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Mortaise/Keyway Decalage Angulaire [degres] : "$14,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Creux b [pixels] : "$Creux_b,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Saillie a [pixels] : "$Saillie_a,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Vide Fond De Dent c [pixels] : "$Vide_Fond_De_Dent_c,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Hauteur de dent ht [pixels] : "$Hauteur_de_dent_ht,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Pas Primitif p [pixels] : "$Pas_Primitif_p,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Epaisseur Circulaire t [pixels] : "$Epaisseur_Circulaire_t,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Hauteur Active hk [pixels] : "$Hauteur_Active_hk,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Primitif Z1 Rouge/Red [pixels] : "$Dia_Primitif_Z1,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Cercle De Base Z1 Jaune/Yellow [pixels] : "$Diametre_Cercle_De_Base_Z1,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Tete Z1 Bleu/Blue [pixels] : "$Dia_Tete_Z1,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Pied Z1 Vert/Green [pixels] : "$Dia_Pied_Z1,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Primitif Z2 Rouge/Red [pixels] : "$Dia_Primitif_Z2,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Cercle De Base Z2 Jaune/Yellow [pixels] : "$Diametre_Cercle_De_Base_Z2,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Tete Z2 Bleu/Blue [pixels] : "$Dia_Tete_Z2,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Pied Z2 Vert/Green [pixels] : "$Dia_Pied_Z2,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +circle[-1] $X_Origine,$Y_Origine,{$Dia_Tete_Z1/2},1,0xFFFFFFFF,0,0,255,255 +circle[-1] $X_Origine,$Y_Origine,{$Dia_Primitif_Z1/2},1,0xFFFFFFFF,255,0,0,255 +circle[-1] $X_Origine,$Y_Origine,{$Dia_Pied_Z1/2},1,0xFFFFFFFF,0,255,0,255 +circle[-1] $X_Origine,$Y_Origine,{$Diametre_Cercle_De_Base_Z1/2},1,0xFFFFFFFF,255,255,0,255 +circle[-1] $X_Origine,$Y_Origine,{$Dia_Tete_Z2/2},1,0xFFFFFFFF,0,0,255,255 +circle[-1] $X_Origine,$Y_Origine,{$Dia_Primitif_Z2/2},1,0xFFFFFFFF,255,0,0,255 +circle[-1] $X_Origine,$Y_Origine,{$Dia_Pied_Z2/2},1,0xFFFFFFFF,0,255,0,255 +circle[-1] $X_Origine,$Y_Origine,{$Diametre_Cercle_De_Base_Z2/2},1,0xFFFFFFFF,255,255,0,255 +if $Contours_Plus==1 erode_circ[-2,-3] 2 fi +line[-1] {$X_Origine-5},$Y_Origine,{$X_Origine+5},$Y_Origine,1,170,85,255,255 +line[-1] $X_Origine,{$Y_Origine-5},$X_Origine,{$Y_Origine+5},1,170,85,255,255 +reverse[-1,-2,-3] +samj_Engrenages_Laser_LED_Preview : +rm[0] +1080,1080,1,4 +fill_color[-1] 255,255,255,255 +Module_m={$1+1} +Angle_De_Pression_alpha={round($2*10000)/10000} +Diam_Trou_Arbre=$3 +Nb_Dents_Roue_Z1=$4 +Nb_Dents_Roue_Z2=$5 +Egalite_Primitif=$6 +Contours_Plus=$7 +Trous_Assemb_Nb=$8 +Trous_Assemb_Diam=$9 +Trous_Assemb_Distance_Centre=$10 +Trous_Assemb_Decalage_Angle={{pi}/180*$11} +Rainure_Largeur=$12 +Rainure_Hauteur=$13 +Rainure_Decalage_Angle={{pi}/180*$14} +Echelle=1 +Dimension_Max_Image=7200 +Reserve_Contour_Image=10 +Module_m_Origine={$Module_m-1} +Dia_Primitif_Z1={$Echelle*$Module_m*$Nb_Dents_Roue_Z1} +Dia_Tete_Z1={$Dia_Primitif_Z1+(2*$Echelle*$Module_m)} +Dia_Primitif_Z2={$Echelle*$Module_m*$Nb_Dents_Roue_Z2} +Dia_Tete_Z2={$Dia_Primitif_Z2+(2*$Echelle*$Module_m)} +if $Nb_Dents_Roue_Z1>$Nb_Dents_Roue_Z2 +do +Module_m-=1 +Dia_Primitif_Z1={$Echelle*$Module_m*$Nb_Dents_Roue_Z1} +Dia_Tete_Z1={$Dia_Primitif_Z1+(2*$Echelle*$Module_m)} +while $Dia_Tete_Z1>$Dimension_Max_Image-2*$Reserve_Contour_Image +else +do +Module_m-=1 +Dia_Primitif_Z2={$Echelle*$Module_m*$Nb_Dents_Roue_Z2} +Dia_Tete_Z2={$Dia_Primitif_Z2+(2*$Echelle*$Module_m)} +while $Dia_Tete_Z2>$Dimension_Max_Image-2*$Reserve_Contour_Image +fi +Dia_Primitif_Z1={$Echelle*$Module_m*$Nb_Dents_Roue_Z1} +Dia_Tete_Z1={$Dia_Primitif_Z1+(2*$Echelle*$Module_m)} +Dia_Pied_Z1={$Dia_Primitif_Z1-(2.5*$Echelle*$Module_m)} +Dia_Primitif_Z2={$Echelle*$Module_m*$Nb_Dents_Roue_Z2} +Dia_Tete_Z2={$Dia_Primitif_Z2+(2*$Echelle*$Module_m)} +Dia_Pied_Z2={$Dia_Primitif_Z2-(2.5*$Echelle*$Module_m)} +Angle_De_Pression_alpha_Origine=$Angle_De_Pression_alpha +Angle_De_Pression_alpha+=0.1 +if $Nb_Dents_Roue_Z1>$Nb_Dents_Roue_Z2 +do +Angle_De_Pression_alpha-=0.1 +Diametre_Cercle_De_Base_Z1={$Dia_Primitif_Z1*cos(((pi)/180*$Angle_De_Pression_alpha))} +Rayon_Developpante_Z1={$Diametre_Cercle_De_Base_Z1/2} +while $Dia_Pied_Z1/2>$Rayon_Developpante_Z1 +else +do +Angle_De_Pression_alpha-=0.1 +Diametre_Cercle_De_Base_Z2={$Dia_Primitif_Z2*cos(((pi)/180*$Angle_De_Pression_alpha))} +Rayon_Developpante_Z2={$Diametre_Cercle_De_Base_Z2/2} +while $Dia_Pied_Z2/2>$Rayon_Developpante_Z2 +fi +Angle_De_Pression_alpha={round($Angle_De_Pression_alpha*10000)/10000} +Dia_Primitif_Z1={$Echelle*$Module_m*$Nb_Dents_Roue_Z1} +Dia_Tete_Z1={$Dia_Primitif_Z1+(2*$Echelle*$Module_m)} +Diametre_Cercle_De_Base_Z1={$Dia_Primitif_Z1*cos(((pi)/180*$Angle_De_Pression_alpha))} +Dia_Pied_Z1={$Dia_Primitif_Z1-(2.5*$Echelle*$Module_m)} +Dia_Primitif_Z2={$Echelle*$Module_m*$Nb_Dents_Roue_Z2} +Dia_Tete_Z2={$Dia_Primitif_Z2+(2*$Echelle*$Module_m)} +Dia_Pied_Z2={$Dia_Primitif_Z2-(2.5*$Echelle*$Module_m)} +Diametre_Cercle_De_Base_Z2={$Dia_Primitif_Z2*cos(((pi)/180*$Angle_De_Pression_alpha))} +Creux_b={$Echelle*$Module_m*1.25} +Saillie_a={$Echelle*$Module_m} +Vide_Fond_De_Dent_c={$Creux_b-$Saillie_a} +Hauteur_de_dent_ht={$Creux_b+$Saillie_a} +Pas_Primitif_p={$Echelle*$Module_m*(pi)} +Epaisseur_Circulaire_t={$Pas_Primitif_p/2} +Hauteur_Active_hk={2*$Saillie_a} +Trous_Assemb_Erreur=0 +if {{$Trous_Assemb_Distance_Centre+{$Trous_Assemb_Diam/2}}>{$Dia_Pied_Z1/2}} Trous_Assemb_Erreur+=1 fi +if {$Trous_Assemb_Distance_Centre-{$Trous_Assemb_Diam/2}}<{$Diam_Trou_Arbre/2} Trous_Assemb_Erreur+=10 fi +if $Trous_Assemb_Nb>3 +Rayon_Cercle_Exterieur={$Trous_Assemb_Distance_Centre+$Trous_Assemb_Diam} +Angle_Theta={pi/$Trous_Assemb_Nb} +Rayon_Cercle_Centre={{$Rayon_Cercle_Exterieur*{1-{sin($Angle_Theta)}}}/{{1+{sin($Angle_Theta)}}}} +Rayon_Cercles_Ext={{$Rayon_Cercle_Exterieur-$Rayon_Cercle_Centre}/2} +Rayon_Centres_C_Ext={$Rayon_Cercle_Centre+$Rayon_Cercles_Ext} +Rayon_Tang={({{$Rayon_Centres_C_Ext*$Rayon_Centres_C_Ext}-{$Rayon_Cercles_Ext*$Rayon_Cercles_Ext}})^0.5} +if $Trous_Assemb_Distance_Centre<$Rayon_Tang Trous_Assemb_Erreur+=100 fi +fi +Erreur_Rainure=0 +if $Rainure_Hauteur>{{$Diam_Trou_Arbre/2}-1} +Erreur_Rainure+=1 +fi +if $Rainure_Largeur>{{$Diam_Trou_Arbre/2}-1} +Erreur_Rainure+=10 +fi +L_O=10 +H_O=0 +I_T=32 +H_P=30 +R_P=0 +V_P=0 +B_P=0 +H_O+=$I_T +text[-1] "***** Engrenages Gears Laser : samj_Engrenages_Laser_LED *****",$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +H_O+=$I_T +if $Module_m-$Module_m_Origine==0 +text[-1] "Module m : "$Module_m" Demande/Settings : "$Module_m_Origine,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +else +text[-1] "Module m : "$Module_m" Demande/Settings : "$Module_m_Origine,$L_O,$H_O,{$H_P+2},1,255,0,0,255 +fi +H_O+=$I_T +if $Angle_De_Pression_alpha-$Angle_De_Pression_alpha_Origine==0 +text[-1] "Angle de Pression/Pressure Angle : "$Angle_De_Pression_alpha" Demande/Settings : "$Angle_De_Pression_alpha_Origine,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +else +text[-1] "Angle de Pression/Pressure Angle : "$Angle_De_Pression_alpha" Demande/Settings : "$Angle_De_Pression_alpha_Origine,$L_O,$H_O,{$H_P+2},1,255,0,0,255 +fi +H_O+=$I_T +text[-1] "Diam. trou central [pixels] : "$Diam_Trou_Arbre,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Nb de dents roue Z1 / Nb of teeth gear Z1 : "$Nb_Dents_Roue_Z1,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Nb de dents roue Z2 / Nb of teeth gear Z2 : "$Nb_Dents_Roue_Z2,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +if $Trous_Assemb_Erreur>0 +H_O+=$I_T +text[-1] "Erreur : "$Trous_Assemb_Erreur" . Modifier section : Trous pour assemblage / Mechanical assembly.",$L_O,$H_O,{$H_P+2},1,255,0,0,255 +fi +H_O+=$I_T +text[-1] "Nb. trous assemblage : "$Trous_Assemb_Nb,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Diam. trous assemblage [pixels] : "$Trous_Assemb_Diam,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Distance du centre [pixels] : "$Trous_Assemb_Distance_Centre,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Decalage angulaire trous [degres] : "$Trous_Assemb_Decalage_Angle,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +if $Erreur_Rainure>0 +H_O+=$I_T +text[-1] "Erreur : "$Erreur_Rainure" . Modifier section : Mortaise clavette trou central / Keyway cutting.",$L_O,$H_O,{$H_P+2},1,255,0,0,255 +fi +H_O+=$I_T +text[-1] "Mortaise/Keyway Largeur / Width [pixels] : "$Rainure_Largeur,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Mortaise/Keyway Hauteur / Height [pixels] : "$Rainure_Hauteur,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Mortaise/Keyway Decalage Angulaire [degres] : "$14,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Creux b [pixels] : "$Creux_b,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Saillie a [pixels] : "$Saillie_a,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Vide Fond De Dent c [pixels] : "$Vide_Fond_De_Dent_c,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Hauteur de dent ht [pixels] : "$Hauteur_de_dent_ht,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Pas Primitif p [pixels] : "$Pas_Primitif_p,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Epaisseur Circulaire t [pixels] : "$Epaisseur_Circulaire_t,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Hauteur Active hk [pixels] : "$Hauteur_Active_hk,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Primitif Z1 [pixels] : "$Dia_Primitif_Z1,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Cercle De Base Z1 [pixels] : "$Diametre_Cercle_De_Base_Z1,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Tete Z1 [pixels] : "$Dia_Tete_Z1,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Pied Z1 [pixels] : "$Dia_Pied_Z1,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Primitif Z2 [pixels] : "$Dia_Primitif_Z2,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Cercle De Base Z2 [pixels] : "$Diametre_Cercle_De_Base_Z2,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Tete Z2 [pixels] : "$Dia_Tete_Z2,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +H_O+=$I_T +text[-1] "Dia. Pied Z2 [pixels] : "$Dia_Pied_Z2,$L_O,$H_O,$H_P,1,$R_P,$V_P,$B_P,255 +samj_etoile_de_pompei_153 : +Angle_inclinaison=$3 +R_C1=$5 +V_C1=$6 +B_C1=$7 +A_C1=$8 +R_C2=$9 +V_C2=$10 +B_C2=$11 +A_C2=$12 +R_C3=$13 +V_C3=$14 +B_C3=$15 +A_C3=$16 +R_C4=$17 +V_C4=$18 +B_C4=$19 +A_C4=$20 +Remplir_cercle=$21 +angle_point1_carre={0+$Angle_inclinaison} +angle_point2_carre={60+$Angle_inclinaison} +angle_point3_carre={45+$Angle_inclinaison} +angle_point4_carre={15+$Angle_inclinaison} +angle_point5_triangle={30+$Angle_inclinaison} +foreach { +X={round({{w}*{$1/100}})} +Y={round({{h}*{$2/100}})} +Dimension={round(min({w},{h})/547*$4)} +Rayon_Cercle_1=$Dimension +Rayon_Cercle_2={{{2*$Dimension*$Dimension}-{2*$Dimension*$Dimension*{cos(pi/180*150)}}}^0.5} +Rayon_Cercle_3={$Dimension+{$Dimension*{3^0.5}}} +{w},{h},1,4 +rm.. +if {$Remplir_cercle==1} +ellipse[-1] $X,$Y,$Rayon_Cercle_3,$Rayon_Cercle_3,0,1,$R_C4,$V_C4,$B_C4,$A_C4 +fi +ellipse[-1] $X,$Y,$Rayon_Cercle_1,$Rayon_Cercle_1,0,1,$R_C3,$V_C3,$B_C3,$A_C3 +repeat 6 +point1_X={round({$Rayon_Cercle_1*{cos(pi/180*$angle_point1_carre)}})} +point1_Y={round({$Rayon_Cercle_1*{sin(pi/180*$angle_point1_carre)}})} +point2_X={round({$Rayon_Cercle_1*{cos(pi/180*{$angle_point2_carre})}})} +point2_Y={round({$Rayon_Cercle_1*{sin(pi/180*{$angle_point2_carre})}})} +point3_X={round({$Rayon_Cercle_2*{cos(pi/180*{$angle_point3_carre})}})} +point3_Y={round({$Rayon_Cercle_2*{sin(pi/180*{$angle_point3_carre})}})} +point4_X={round({$Rayon_Cercle_2*{cos(pi/180*{$angle_point4_carre})}})} +point4_Y={round({$Rayon_Cercle_2*{sin(pi/180*{$angle_point4_carre})}})} +polygon[-1] 4,{$X+$point1_X},{$Y+$point1_Y},{$X+$point2_X},{$Y+$point2_Y},{$X+$point3_X},{$Y+$point3_Y},{$X+$point4_X},{$Y+$point4_Y},1,$R_C1,$V_C1,$B_C1,$A_C1 +point5_X={round({$Rayon_Cercle_3*{cos(pi/180*{$angle_point5_triangle})}})} +point5_Y={round({$Rayon_Cercle_3*{sin(pi/180*{$angle_point5_triangle})}})} +polygon[-1] 3,{$X+$point3_X},{$Y+$point3_Y},{$X+$point4_X},{$Y+$point4_Y},{$X+$point5_X},{$Y+$point5_Y},1,$R_C2,$V_C2,$B_C2,$A_C2 +point6_X={round({$Rayon_Cercle_3*{cos(pi/180*{$angle_point2_carre})}})} +point6_Y={round({$Rayon_Cercle_3*{sin(pi/180*{$angle_point2_carre})}})} +polygon[-1] 3,{$X+$point2_X},{$Y+$point2_Y},{$X+$point3_X},{$Y+$point3_Y},{$X+$point6_X},{$Y+$point6_Y},1,$R_C3,$V_C3,$B_C3,$A_C3 +point7_X={round({$Rayon_Cercle_3*{cos(pi/180*{$angle_point1_carre})}})} +point7_Y={round({$Rayon_Cercle_3*{sin(pi/180*{$angle_point1_carre})}})} +polygon[-1] 3,{$X+$point1_X},{$Y+$point1_Y},{$X+$point4_X},{$Y+$point4_Y},{$X+$point7_X},{$Y+$point7_Y},1,$R_C3,$V_C3,$B_C3,$A_C3 +angle_point1_carre={$angle_point1_carre+60} +angle_point2_carre={$angle_point2_carre+60} +angle_point3_carre={$angle_point3_carre+60} +angle_point4_carre={$angle_point4_carre+60} +angle_point5_triangle={$angle_point5_triangle+60} +done +if $22>0 smooth $22 fi +} +samj_Etoile_De_Pompei_Triangles_Sierpinski : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Angle_inclinaison=$3 +if $4>0 +Dimension={round({w*$4/{400*{2^0.5}}})} +else +Dimension={round({-h*$4/{400*{2^0.5}}})} +fi +R_Cadre=$5 +V_Cadre=$6 +B_Cadre=$7 +A_Cadre=$8 +Afficher_Cadre=$9 +Recursions_Sierpinski=$10 +R_Centre=$11 +V_Centre=$12 +B_Centre=$13 +A_Centre=$14 +R_Centreb=$15 +V_Centreb=$16 +B_Centreb=$17 +A_Centreb=$18 +R_Triangle=$19 +V_Triangle=$20 +B_Triangle=$21 +A_Triangle=$22 +R_Demi_Losange=$23 +V_Demi_Losange=$24 +B_Demi_Losange=$25 +A_Demi_Losange=$26 +R_Demi_Losange_Deux=$27 +V_Demi_Losange_Deux=$28 +B_Demi_Losange_Deux=$29 +A_Demi_Losange_Deux=$30 +R_Cercle=$31 +V_Cercle=$32 +B_Cercle=$33 +A_Cercle=$34 +Couleurs_aleatoires=$35 +Inversions=$36 +Flou=$37 +Dilatation=$38 +Deformation=$39 +Bruit=$40 +Ombre=$41 +X_Ombre=$42 +Y_Ombre=$43 +Smoothness_Ombre=$44 +Curvature_Ombre=$45 +Compensation_Decalage_Ombre_X=$46 +Compensation_Decalage_Ombre_Y=$47 +Canal_Alpha=$48 +Largeur_Origine={w} +Hauteur_Origine={h} +Rayon_Cercle_1=$Dimension +Rayon_Cercle_2={{{2*$Dimension*$Dimension}-{2*$Dimension*$Dimension*{cos(pi/180*150)}}}^0.5} +Rayon_Cercle_3={$Dimension+{$Dimension*{3^0.5}}} +dephasage_point1_carre={0+$Angle_inclinaison} +dephasage_point2_carre={60+$Angle_inclinaison} +dephasage_point3_carre={45+$Angle_inclinaison} +dephasage_point4_carre={15+$Angle_inclinaison} +dephasage_point5_triangle={30+$Angle_inclinaison} +Nb_Boucle=0 +H_X_a=0 +H_Y_a=0 +H_X_b=0 +H_Y_b=0 +H_X_c=0 +H_Y_c=0 +H_X_d=0 +H_Y_d=0 +H_X_e=0 +H_Y_e=0 +H_X_f=0 +H_Y_f=0 +xca=0 +yca=0 +Angle_C=0 +xcb=0 +ycb=0 +xcc=0 +ycc=0 +xcd=0 +ycd=0 +xce=0 +yce=0 +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Couleurs_aleatoires==1 +R_Centre={round(u)*255} +V_Centre={round(u)*255} +B_Centre={round(u)*255} +R_Centreb={round(u)*255} +V_Centreb={round(u)*255} +B_Centreb={round(u)*255} +R_Triangle={round(u)*255} +V_Triangle={round(u)*255} +B_Triangle={round(u)*255} +R_Demi_Losange={round(u)*255} +V_Demi_Losange={round(u)*255} +B_Demi_Losange={round(u)*255} +R_Demi_Losange_Deux={round(u)*255} +V_Demi_Losange_Deux={round(u)*255} +B_Demi_Losange_Deux={round(u)*255} +R_Cercle={round(u)*255} +V_Cercle={round(u)*255} +B_Cercle={round(u)*255} +fi +if $Afficher_Cadre>0 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +if $Afficher_Cadre==2 +ellipse[-2] $X,$Y,$Rayon_Cercle_3,$Rayon_Cercle_3,0,1,0xFFFFFFFF,$R_Cadre,$V_Cadre,$B_Cadre,$A_Cadre +ellipse[-1] $X,$Y,$Rayon_Cercle_3,$Rayon_Cercle_3,0,1,$R_Cercle,$V_Cercle,$B_Cercle,$A_Cercle +fi +repeat 6 +Nb_Boucle={$Nb_Boucle+1} +if $Couleurs_aleatoires==1 +R_Centreb={round(u)*255} +V_Centreb={round(u)*255} +B_Centreb={round(u)*255} +R_Triangle={round(u)*255} +V_Triangle={round(u)*255} +B_Triangle={round(u)*255} +R_Demi_Losange_Deux={round(u)*255} +V_Demi_Losange_Deux={round(u)*255} +B_Demi_Losange_Deux={round(u)*255} +fi +point1_X={round({$Rayon_Cercle_1*{cos(pi/180*$dephasage_point1_carre)}})} +point1_Y={round({$Rayon_Cercle_1*{sin(pi/180*$dephasage_point1_carre)}})} +point2_X={round({$Rayon_Cercle_1*{cos(pi/180*{$dephasage_point2_carre})}})} +point2_Y={round({$Rayon_Cercle_1*{sin(pi/180*{$dephasage_point2_carre})}})} +point3_X={round({$Rayon_Cercle_2*{cos(pi/180*{$dephasage_point3_carre})}})} +point3_Y={round({$Rayon_Cercle_2*{sin(pi/180*{$dephasage_point3_carre})}})} +point4_X={round({$Rayon_Cercle_2*{cos(pi/180*{$dephasage_point4_carre})}})} +point4_Y={round({$Rayon_Cercle_2*{sin(pi/180*{$dephasage_point4_carre})}})} +if $Nb_Boucle==1 +H_X_a={$X+$point1_X} +H_Y_a={$Y+$point1_Y} +elif $Nb_Boucle==2 +H_X_b={$X+$point1_X} +H_Y_b={$Y+$point1_Y} +elif $Nb_Boucle==3 +H_X_c={$X+$point1_X} +H_Y_c={$Y+$point1_Y} +elif $Nb_Boucle==4 +H_X_d={$X+$point1_X} +H_Y_d={$Y+$point1_Y} +elif $Nb_Boucle==5 +H_X_e={$X+$point1_X} +H_Y_e={$Y+$point1_Y} +elif $Nb_Boucle==6 +H_X_f={$X+$point1_X} +H_Y_f={$Y+$point1_Y} +fi +point5_X={round({$Rayon_Cercle_3*{cos(pi/180*{$dephasage_point5_triangle})}})} +point5_Y={round({$Rayon_Cercle_3*{sin(pi/180*{$dephasage_point5_triangle})}})} +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,{$X+$point3_X},{$Y+$point3_Y},{$X+$point4_X},{$Y+$point4_Y},{$X+$point5_X},{$Y+$point5_Y},$R_Triangle,$V_Triangle,$B_Triangle,$A_Triangle +point6_X={round({$Rayon_Cercle_3*{cos(pi/180*{$dephasage_point2_carre})}})} +point6_Y={round({$Rayon_Cercle_3*{sin(pi/180*{$dephasage_point2_carre})}})} +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,{$X+$point2_X},{$Y+$point2_Y},{$X+$point3_X},{$Y+$point3_Y},{$X+$point6_X},{$Y+$point6_Y},$R_Demi_Losange_Deux,$V_Demi_Losange_Deux,$B_Demi_Losange_Deux,$A_Demi_Losange_Deux +point7_X={round({$Rayon_Cercle_3*{cos(pi/180*{$dephasage_point1_carre})}})} +point7_Y={round({$Rayon_Cercle_3*{sin(pi/180*{$dephasage_point1_carre})}})} +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,{$X+$point1_X},{$Y+$point1_Y},{$X+$point4_X},{$Y+$point4_Y},{$X+$point7_X},{$Y+$point7_Y},$R_Demi_Losange,$V_Demi_Losange,$B_Demi_Losange,$A_Demi_Losange +if $Afficher_Cadre>0 +polygon[-2] 3,{$X+$point3_X},{$Y+$point3_Y},{$X+$point4_X},{$Y+$point4_Y},{$X+$point5_X},{$Y+$point5_Y},1,0xFFFFFFFF,$R_Cadre,$V_Cadre,$B_Cadre,$A_Cadre +polygon[-2] 3,{$X+$point2_X},{$Y+$point2_Y},{$X+$point3_X},{$Y+$point3_Y},{$X+$point6_X},{$Y+$point6_Y},1,0xFFFFFFFF,$R_Cadre,$V_Cadre,$B_Cadre,$A_Cadre +polygon[-2] 3,{$X+$point1_X},{$Y+$point1_Y},{$X+$point4_X},{$Y+$point4_Y},{$X+$point7_X},{$Y+$point7_Y},1,0xFFFFFFFF,$R_Cadre,$V_Cadre,$B_Cadre,$A_Cadre +fi +if $Afficher_Cadre==2 +polygon[-2] 4,{$X+$point1_X},{$Y+$point1_Y},{$X+$point2_X},{$Y+$point2_Y},{$X+$point3_X},{$Y+$point3_Y},{$X+$point4_X},{$Y+$point4_Y},1,0xFFFFFFFF,$R_Cadre,$V_Cadre,$B_Cadre,$A_Cadre +fi +dephasage_point1_carre={$dephasage_point1_carre+60} +dephasage_point2_carre={$dephasage_point2_carre+60} +dephasage_point3_carre={$dephasage_point3_carre+60} +dephasage_point4_carre={$dephasage_point4_carre+60} +dephasage_point5_triangle={$dephasage_point5_triangle+60} +done +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$H_X_a,$H_Y_a,$H_X_b,$H_Y_b,$X,$Y,$R_Centre,$V_Centre,$B_Centre,$A_Centre +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$H_X_b,$H_Y_b,$H_X_c,$H_Y_c,$X,$Y,$R_Centreb,$V_Centreb,$B_Centreb,$A_Centreb +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$H_X_c,$H_Y_c,$H_X_d,$H_Y_d,$X,$Y,$R_Centre,$V_Centre,$B_Centre,$A_Centre +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$H_X_d,$H_Y_d,$H_X_e,$H_Y_e,$X,$Y,$R_Centreb,$V_Centreb,$B_Centreb,$A_Centreb +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$H_X_e,$H_Y_e,$H_X_f,$H_Y_f,$X,$Y,$R_Centre,$V_Centre,$B_Centre,$A_Centre +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$H_X_f,$H_Y_f,$H_X_a,$H_Y_a,$X,$Y,$R_Centreb,$V_Centreb,$B_Centreb,$A_Centreb +if $Afficher_Cadre==0 +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +elif $Afficher_Cadre==1 +polygon[-2] 6,$H_X_a,$H_Y_a,$H_X_b,$H_Y_b,$H_X_c,$H_Y_c,$H_X_d,$H_Y_d,$H_X_e,$H_Y_e,$H_X_f,$H_Y_f,1,0xFFFFFFFF,$R_Cadre,$V_Cadre,$B_Cadre,$A_Cadre +fi +if $Afficher_Cadre>0 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Etoiles_Remplies_Triangles_Sierpinski : +Nombre_de_sommets=$1 +X={round({w*{$2/100}})} +Y={round({h*{$3/100}})} +if $4>0 +Rayon_cercle_exterieur={round({w*$4/{100}})} +else +Rayon_cercle_exterieur={round({-h*$4/{100}})} +fi +Rayon_cercle_interieur={round($Rayon_cercle_exterieur*$5/100)} +Angle_inclinaison=$6 +Pourcentage_excentricite=$7 +Angle_excentricite=$8 +R_Contours=$9 +V_Contours=$10 +B_Contours=$11 +A_Contours=$12 +Affichage=$13 +Recursions_Sierpinski=$14 +R_Centre=$15 +V_Centre=$16 +B_Centre=$17 +A_Centre=$18 +R_Centreb=$19 +V_Centreb=$20 +B_Centreb=$21 +A_Centreb=$22 +R_Sommet=$23 +V_Sommet=$24 +B_Sommet=$25 +A_Sommet=$26 +R_Sommetb=$27 +V_Sommetb=$28 +B_Sommetb=$29 +A_Sommetb=$30 +R_Cercle=$31 +V_Cercle=$32 +B_Cercle=$33 +A_Cercle=$34 +Couleurs_aleatoires=$35 +Inversions=$36 +Flou=$37 +Dilatation=$38 +Deformation=$39 +Bruit=$40 +Ombre=$41 +X_Ombre=$42 +Y_Ombre=$43 +Smoothness_Ombre=$44 +Curvature_Ombre=$45 +Compensation_Decalage_Ombre_X=$46 +Compensation_Decalage_Ombre_Y=$47 +Canal_Alpha=$48 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_Boucle=0 +Angle=0 +Increment_angle={360/$Nombre_de_sommets} +Longueur_excentricite={$Pourcentage_excentricite/100*($Rayon_cercle_exterieur-$Rayon_cercle_interieur)} +Decalage_X_excentricite={round({$Longueur_excentricite*{cos(pi/180*$Angle_excentricite)}})} +Decalage_Y_excentricite={round({$Longueur_excentricite*{sin(pi/180*$Angle_excentricite)}})} +X_centre_cercle_interieur={$X+$Decalage_X_excentricite} +Y_centre_cercle_interieur={$Y+$Decalage_Y_excentricite} +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Couleurs_aleatoires==1 +R_Centre={round(u)*255} +V_Centre={round(u)*255} +B_Centre={round(u)*255} +R_Centreb={round(u)*255} +V_Centreb={round(u)*255} +B_Centreb={round(u)*255} +R_Sommet={round(u)*255} +V_Sommet={round(u)*255} +B_Sommet={round(u)*255} +R_Sommetb={round(u)*255} +V_Sommetb={round(u)*255} +B_Sommetb={round(u)*255} +R_Sommetb_Deux={round(u)*255} +V_Sommetb_Deux={round(u)*255} +B_Sommetb_Deux={round(u)*255} +R_Cercle={round(u)*255} +V_Cercle={round(u)*255} +B_Cercle={round(u)*255} +fi +if $Affichage>3 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +if $Affichage==2||$Affichage==3||$Affichage==6||$Affichage==7 +ellipse[-1] $X,$Y,$Rayon_cercle_exterieur,$Rayon_cercle_exterieur,0,1,$R_Cercle,$V_Cercle,$B_Cercle,$A_Cercle +fi +repeat $Nombre_de_sommets +if $Couleurs_aleatoires==1 +R_Centre={round(u)*255} +V_Centre={round(u)*255} +B_Centre={round(u)*255} +R_Centreb={round(u)*255} +V_Centreb={round(u)*255} +B_Centreb={round(u)*255} +R_Sommet={round(u)*255} +V_Sommet={round(u)*255} +B_Sommet={round(u)*255} +R_Sommetb={round(u)*255} +V_Sommetb={round(u)*255} +B_Sommetb={round(u)*255} +R_Sommetb_Deux={round(u)*255} +V_Sommetb_Deux={round(u)*255} +B_Sommetb_Deux={round(u)*255} +R_Cercle={round(u)*255} +V_Cercle={round(u)*255} +B_Cercle={round(u)*255} +fi +Nb_Boucle+=1 +X_point_exterieur={$X+(round(($Rayon_cercle_exterieur*(cos((pi/180*($Angle+$Angle_inclinaison)))))))} +Y_point_exterieur={$Y+(round(($Rayon_cercle_exterieur*(sin((pi/180*($Angle+$Angle_inclinaison)))))))} +X_point_interieur_a={$X_centre_cercle_interieur+(round(($Rayon_cercle_interieur*(cos((pi/180*($Angle+$Angle_inclinaison+(180/$Nombre_de_sommets))))))))} +Y_point_interieur_a={$Y_centre_cercle_interieur+(round(($Rayon_cercle_interieur*(sin((pi/180*($Angle+$Angle_inclinaison+(180/$Nombre_de_sommets))))))))} +X_point_interieur_b={$X_centre_cercle_interieur+(round(($Rayon_cercle_interieur*(cos((pi/180*($Angle+$Angle_inclinaison-(180/$Nombre_de_sommets))))))))} +Y_point_interieur_b={$Y_centre_cercle_interieur+(round(($Rayon_cercle_interieur*(sin((pi/180*($Angle+$Angle_inclinaison-(180/$Nombre_de_sommets))))))))} +if ($Nombre_de_sommets%2)==0 +if ($Nb_Boucle%2)==0 +if $Recursions_Sierpinski==0 +polygon[-1] 3,$X_point_exterieur,$Y_point_exterieur,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,1,$R_Sommet,$V_Sommet,$B_Sommet,$A_Sommet +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_point_exterieur,$Y_point_exterieur,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,$R_Sommet,$V_Sommet,$B_Sommet,$A_Sommet +fi +if ($Affichage%2)==1 +if $Recursions_Sierpinski==0 +polygon[-1] 3,$X,$Y,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,1,$R_Centre,$V_Centre,$B_Centre,$A_Centre +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X,$Y,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,$R_Centre,$V_Centre,$B_Centre,$A_Centre +fi +fi +else +if $Recursions_Sierpinski==0 +polygon[-1] 3,$X_point_exterieur,$Y_point_exterieur,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,1,$R_Sommetb,$V_Sommetb,$B_Sommetb,$A_Sommetb +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_point_exterieur,$Y_point_exterieur,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,$R_Sommetb,$V_Sommetb,$B_Sommetb,$A_Sommetb +fi +if ($Affichage%2)==1 +if $Recursions_Sierpinski==0 +polygon[-1] 3,$X,$Y,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,1,$R_Centreb,$V_Centreb,$B_Centreb,$A_Centreb +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X,$Y,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,$R_Centreb,$V_Centreb,$B_Centreb,$A_Centreb +fi +fi +fi +else +if $Recursions_Sierpinski==0 +polygon[-1] 3,$X_point_exterieur,$Y_point_exterieur,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,1,$R_Sommet,$V_Sommet,$B_Sommet,$A_Sommet +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_point_exterieur,$Y_point_exterieur,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,$R_Sommet,$V_Sommet,$B_Sommet,$A_Sommet +fi +if ($Affichage%2)==1 +if $Recursions_Sierpinski==0 +polygon[-1] 3,$X,$Y,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,1,$R_Centre,$V_Centre,$B_Centre,$A_Centre +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X,$Y,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,$R_Centre,$V_Centre,$B_Centre,$A_Centre +fi +fi +fi +if $Affichage>3 +polygon[-2] 3,$X_point_exterieur,$Y_point_exterieur,$X_point_interieur_a,$Y_point_interieur_a,$X_point_interieur_b,$Y_point_interieur_b,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +Angle={$Increment_angle*$Nb_Boucle} +done +if $Affichage>5 +ellipse[-2] $X,$Y,$Rayon_cercle_exterieur,$Rayon_cercle_exterieur,0,1,0xFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Affichage>3 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Etoiles_Laser_LED : +rm[0] +$1,$1,1,4 +fill_color[-1] 255,255,255,255 +if $3==0 +samj_Etoile_De_Pompei_Triangles_Sierpinski[-1] 50,50,30,96,0,0,0,255,1,1,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,$5,0,0,0,0.5,0.5,1.8,0,0,0,0 +elif $3==1 +samj_Etoile_De_Pompei_Triangles_Sierpinski[-1] 50,50,30,96,0,0,0,255,1,2,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,$5,0,0,0,0.5,0.5,1.8,0,0,0,0 +elif $3==2 +samj_en_Formes_Geometriques_Simples[-1] 50,50,255,255,255,255,0,0,0,255,255,255,255,255,3,48,48,$2,0,$5,1 +elif $3==3 +samj_Annular_Steiner_Chains[-1] 50,50,46,$2,0,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,$5,0,0,0,0.5,0.5,1.8,0,0,0,1 +elif $3==4 +Traits_Strokes_samj[-1] 50,50,46,0,100,0,$2,0,360,0,0,0,255,0,$5,0,20,0,0,0,1,1 +elif $3==5 +shape_gear[-1] {$1*0.96},$2,100,0,0 +n[-1] 0,255 +samj_blend_20220419[-1,-2] alpha,1,0 +to_rgb[-1] +negate[-1] +to_rgba[-1] +elif $3==6 +Spirographe_samj[-1] 50,50,208,52,150,0,0,0,255,0,0,1,0,1,0,0,0,0,0,0,255,$5,0,0,0,255,0,0,0,1,1 +fi +if $6>0 +circle[-1] {$1/2},{$1/2},{$1*$6/100},1,0,0,0,255 +fi +if $7>0 +circle[-1] {$1/2},{$1/2},{$1*$7/100},1,255,255,255,255 +fi +to_rgba[-1] +if $4==1 +polygon[-1] 4,1%,1%,99%,1%,99%,99%,1%,99%,1,0xFFFFFFFF,0,0,0,1 +elif $4==2 +gradient_norm[-1] +negate[-1] +elif $4==3 +gradient_norm[-1] +negate[-1] +polygon[-1] 4,1%,1%,99%,1%,99%,99%,1%,99%,1,0xFFFFFFFF,0,0,0,1 +fi +replace_color[-1] 70%,0,0,0,0,255,0,0,0,255 +samj_Flocon_Laser_LED : +rm[0] +$1,$1,1,4 +fill_color[-1] 255,255,255,255 +samj_Flocon_De_Neige[-1] 50,50,$2,45,40,0,1,0,0,0,1,2,1,0,0,0,0.7,$3,0,0,0,44,0,0,0,0.5,0.5,1.8,0,0,0,0 +if $4==1 +polygon[-1] 4,1%,1%,99%,1%,99%,99%,1%,99%,1,0xFFFFFFFF,0,0,0,1 +elif $4==2 +gradient_norm[-1] +negate[-1] +replace_color[-1] 70%,0,0,0,0,255,0,0,0,255 +elif $4==3 +gradient_norm[-1] +negate[-1] +polygon[-1] 4,1%,1%,99%,1%,99%,99%,1%,99%,1,0xFFFFFFFF,0,0,0,1 +replace_color[-1] 70%,0,0,0,0,255,0,0,0,255 +fi +samj_Fractal_Tree : +foreach { +x1={round(w/100*$1)} +y1={round(h/100*$2)} +angle=$3 +depth=$4 +Variation_Dimension={w/1000*$5} +Variation_angle=$6 +R_a=$7 +V_a=$8 +B_a=$9 +A_a=$10 +Variation_Couleur=$11 +Motif=$12 +Dimension_Motif=$13 +Dilatation=$14 +Validation_Smooth_Antialias=$15 +V_Amplitude=$16 +V_Edge_Threshold=$17 +V_Smoothness=$18 +to_rgba[-1] +{w},{h},1,4 +samj_drawTree[-1] $x1,$y1,$angle,$depth,$Variation_Dimension,$Variation_angle,$R_a,$V_a,$B_a,$A_a,$Variation_Couleur,$Motif,$Dimension_Motif +dilate[-1] $Dilatation +if $Validation_Smooth_Antialias==1 fx_smooth_antialias[-1] $V_Amplitude,$V_Edge_Threshold,$V_Smoothness fi +samj_blend_20220419[-1,-2] alpha +} +samj_drawTree : +if $4!=0 +R_DT=$7 +V_DT=$8 +B_DT=$9 +A_DT=$10 +if $11<0 +R_DT={round(u(0,255))} +V_DT={round(u(0,255))} +B_DT={round(u(0,255))} +elif $11>0 +R_DT+=$11 +V_DT+=$11 +B_DT+=$11 +if $R_DT>255 +R_DT={255-{$11*$4}} +fi +if $V_DT>255 +V_DT={255-{$11*$4}} +fi +if $B_DT>255 +B_DT={255-{$11*$4}} +fi +fi +x2={$1+(cos(($3*(pi/180)))*$4*$5)} +y2={$2+(sin(($3*(pi/180)))*$4*$5)} +if $12==0 +line[-1] $1,$2,$x2,$y2,1,$7,$8,$9,$10 +elif $12==1 +line[-1] $1,$2,$x2,$y2,1,$7,$8,$9,$10 +circle[-1] $x2,$y2,$13,1,$R_DT,$V_DT,$B_DT,$A_DT +elif $12==2 +line[-1] $1,$2,$x2,$y2,1,$7,$8,$9,$10 +circle[-1] $x2,$y2,$13,1,0xFFFFFFFF,$R_DT,$V_DT,$B_DT,$A_DT +fi +samj_drawTree[-1] $x2,$y2,{$3-$6},{$4-1},$5,$6,$R_DT,$V_DT,$B_DT,$A_DT,$11,$12,$13 +if $11<0 +R_DT={round(u(0,255))} +V_DT={round(u(0,255))} +B_DT={round(u(0,255))} +fi +samj_drawTree[-1] $x2,$y2,{$3+$6},{$4-1},$5,$6,$R_DT,$V_DT,$B_DT,$A_DT,$11,$12,$13 +fi +samj_rien_repair : +Je_passe_l_hiver_en_Floride[-1] +samj_Linear_Gradient_CIE_Lab : +Type_Degrade=$1 +Swap_colors=$2 +Ra=$3 +Ga=$4 +Ba=$5 +Aa=$6 +Rb=$7 +Gb=$8 +Bb=$9 +Ab=$10 +if $Swap_colors==1 +Ra=$7 +Ga=$8 +Ba=$9 +Aa=$10 +Rb=$3 +Gb=$4 +Bb=$5 +Ab=$6 +fi +nt_Ra={$Ra/255} +nt_Ga={$Ga/255} +nt_Ba={$Ba/255} +if $nt_Ra>0.04045 +nt_Ra={({{$nt_Ra+0.055}/1.055})^2.4} +else +nt_Ra/=12.92 +fi +if $nt_Ga>0.04045 +nt_Ga={({{$nt_Ga+0.055}/1.055})^2.4} +else +nt_Ga/=12.92 +fi +if $nt_Ba>0.04045 +nt_Ba={({{$nt_Ba+0.055}/1.055})^2.4} +else +nt_Ba/=12.92 +fi +nt_Ra*=100 +nt_Ga*=100 +nt_Ba*=100 +Xa={$nt_Ra*0.4124564+$nt_Ga*0.3575761+$nt_Ba*0.1804375} +Ya={$nt_Ra*0.2126729+$nt_Ga*0.7151522+$nt_Ba*0.0721750} +Za={$nt_Ra*0.0193339+$nt_Ga*0.1191920+$nt_Ba*0.9503041} +Xca=$Xa +Yca=$Ya +Zca=$Za +ref_Xa=95.047 +ref_Ya=100.000 +ref_Za=108.883 +nt_Xa={$Xca/$ref_Xa} +nt_Ya={$Yca/$ref_Ya} +nt_Za={$Zca/$ref_Za} +if $nt_Xa>0.008856 +nt_Xa={($nt_Xa)^{1/3}} +else +nt_Xa={{7.787*$nt_Xa}+{16/116}} +fi +if $nt_Ya>0.008856 +nt_Ya={($nt_Ya)^{1/3}} +else +nt_Ya={{7.787*$nt_Ya}+{16/116}} +fi +if $nt_Za>0.008856 +nt_Za={($nt_Za)^{1/3}} +else +nt_Za={{7.787*$nt_Za}+{16/116}} +fi +CIE_La={{116*$nt_Ya}-16} +CIE_aa={500*{$nt_Xa-$nt_Ya}} +CIE_ba={200*{$nt_Ya-$nt_Za}} +nt_Ra={$Rb/255} +nt_Ga={$Gb/255} +nt_Ba={$Bb/255} +if $nt_Ra>0.04045 +nt_Ra={({{$nt_Ra+0.055}/1.055})^2.4} +else +nt_Ra/=12.92 +fi +if $nt_Ga>0.04045 +nt_Ga={({{$nt_Ga+0.055}/1.055})^2.4} +else +nt_Ga/=12.92 +fi +if $nt_Ba>0.04045 +nt_Ba={({{$nt_Ba+0.055}/1.055})^2.4} +else +nt_Ba/=12.92 +fi +nt_Ra*=100 +nt_Ga*=100 +nt_Ba*=100 +Xb={$nt_Ra*0.4124564+$nt_Ga*0.3575761+$nt_Ba*0.1804375} +Yb={$nt_Ra*0.2126729+$nt_Ga*0.7151522+$nt_Ba*0.0721750} +Zb={$nt_Ra*0.0193339+$nt_Ga*0.1191920+$nt_Ba*0.9503041} +Xca=$Xb +Yca=$Yb +Zca=$Zb +ref_Xa=95.047 +ref_Ya=100.000 +ref_Za=108.883 +nt_Xa={$Xca/$ref_Xa} +nt_Ya={$Yca/$ref_Ya} +nt_Za={$Zca/$ref_Za} +if $nt_Xa>0.008856 +nt_Xa={($nt_Xa)^{1/3}} +else +nt_Xa={{7.787*$nt_Xa}+{16/116}} +fi +if $nt_Ya>0.008856 +nt_Ya={($nt_Ya)^{1/3}} +else +nt_Ya={{7.787*$nt_Ya}+{16/116}} +fi +if $nt_Za>0.008856 +nt_Za={($nt_Za)^{1/3}} +else +nt_Za={{7.787*$nt_Za}+{16/116}} +fi +CIE_Lb={{116*$nt_Ya}-16} +CIE_ab={500*{$nt_Xa-$nt_Ya}} +CIE_bb={200*{$nt_Ya-$nt_Za}} +{w},{h},1,4 +rm[-2] +Nb_Boucles=0 +Decalage_L=0 +Decalage_a=0 +Decalage_b=0 +if $Type_Degrade==0 +Dimensions={w} +Inc_L={{$CIE_La-$CIE_Lb}/w} +Inc_a={{$CIE_aa-$CIE_ab}/w} +Inc_b={{$CIE_ba-$CIE_bb}/w} +Inc_Alpha={{$Ab-$Aa}/w} +elif $Type_Degrade==1 +Dimensions={h} +Inc_L={{$CIE_La-$CIE_Lb}/h} +Inc_a={{$CIE_aa-$CIE_ab}/h} +Inc_b={{$CIE_ba-$CIE_bb}/h} +Inc_Alpha={{$Ab-$Aa}/h} +fi +repeat $Dimensions +Aa+=$Inc_Alpha +if $Aa>255 Aa=255 fi +if $Aa<0 Aa=0 fi +CIE_Lca={$CIE_La+$Decalage_L-($Nb_Boucles*$Inc_L)} +CIE_aca={$CIE_aa+$Decalage_a-($Nb_Boucles*$Inc_a)} +CIE_bca={$CIE_ba+$Decalage_b-($Nb_Boucles*$Inc_b)} +if $CIE_Lca>100 CIE_Lca=100 fi +if $CIE_Lca<0 CIE_Lca=0 fi +if $CIE_aca>127 CIE_aca=127 fi +if $CIE_aca<-128 CIE_aca=-128 fi +if $CIE_bca>127 CIE_bca=127 fi +if $CIE_bca<-128 CIE_bca=-128 fi +nt_Yca={{$CIE_Lca+16}/116} +nt_Xca={$CIE_aca/500+$nt_Yca} +nt_Zca={$nt_Yca-$CIE_bca/200} +if {($nt_Yca)^3}>0.008856 +nt_Yca={($nt_Yca)^3} +else +nt_Yca={{$nt_Yca-16/116}/7.787} +fi +if {($nt_Xca)^3}>0.008856 +nt_Xca={($nt_Xca)^3} +else +nt_Xca={{$nt_Xca-16/116}/7.787} +fi +if {($nt_Zca)^3}>0.008856 +nt_Zca={($nt_Zca)^3} +else +nt_Zca={{$nt_Zca-16/116}/7.787} +fi +ref_Xca=95.047 +ref_Yca=100.000 +ref_Zca=108.883 +Xca={$ref_Xca*$nt_Xca} +Yca={$ref_Yca*$nt_Yca} +Zca={$ref_Zca*$nt_Zca} +vcXa=$Xca +vcYa=$Yca +vcZa=$Zca +nt_X={$vcXa/100} +nt_Y={$vcYa/100} +nt_Z={$vcZa/100} +nt_R={$nt_X*3.2404542+$nt_Y*-1.5371385+$nt_Z*-0.4985314} +nt_G={$nt_X*-0.9692660+$nt_Y*1.8760108+$nt_Z*0.0415560} +nt_B={$nt_X*0.0556434+$nt_Y*-0.2040259+$nt_Z*1.0572252} +if $nt_R>0.0031308 +nt_R={1.055*{($nt_R)^{1/2.4}}-0.055} +else +nt_R={12.92*$nt_R} +fi +if $nt_G>0.0031308 +nt_G={1.055*{($nt_G)^{1/2.4}}-0.055} +else +nt_G={12.92*$nt_G} +fi +if $nt_B>0.0031308 +nt_B={1.055*{($nt_B)^{1/2.4}}-0.055} +else +nt_B={12.92*$nt_B} +fi +Rconv={$nt_R*255} +Gconv={$nt_G*255} +Bconv={$nt_B*255} +if $Rconv>255 Rconv=255 fi +if $Rconv<0 Rconv=0 fi +if $Gconv>255 Gconv=255 fi +if $Gconv<0 Gconv=0 fi +if $Bconv>255 Bconv=255 fi +if $Bconv<0 Bconv=0 fi +if $Type_Degrade==0 +line[-1] $Nb_Boucles,0,$Nb_Boucles,{h-1},1,$Rconv,$Gconv,$Bconv,$Aa +elif $Type_Degrade==1 +line[-1] 0,$Nb_Boucles,{w-1},$Nb_Boucles,1,$Rconv,$Gconv,$Bconv,$Aa +fi +Nb_Boucles+=1 +done +samj_Shape_Linear_Gradient_CIE_Lab : +Xo={round(w/100*$1)} +Yo={round(h/100*$2)} +Xf={round(w/100*$3)} +Yf={round(h/100*$4)} +Type_Degrade=$5 +Swap_colors=$6 +Ra=$7 +Ga=$8 +Ba=$9 +Aa=$10 +Rb=$11 +Gb=$12 +Bb=$13 +Ab=$14 +Background=$15 +Rback=$16 +Gback=$17 +Bback=$18 +Aback=$19 +Examples=$20 +if $Swap_colors==1 +Ra=$11 +Ga=$12 +Ba=$13 +Aa=$14 +Rb=$7 +Gb=$8 +Bb=$9 +Ab=$10 +fi +if $Xo>$Xf +Xo=$3 +Xf=$1 +elif $Xo==$Xf +Xo={$Xf-1} +fi +if $Yo>$Yf +Yo=$4 +Yf=$2 +elif $Yo==$Yf +Yo={$Yf-1} +fi +if $Type_Degrade==4||$Type_Degrade==5 +Xo={round(w/100*$1)} +Yo={round(h/100*$2)} +Xf={round(w/100*$3)} +Yf={round(h/100*$4)} +fi +if $Examples==1 +Xo={round(w*0.1)} +Yo={round(h*0.1)} +Xf={round(w*0.9)} +Yf={round(h*0.9)} +Type_Degrade=0 +elif $Examples==2 +Xo={round(w*0.1)} +Yo={round(h*0.1)} +Xf={round(w*0.9)} +Yf={round(h*0.9)} +Type_Degrade=1 +elif $Examples==3 +Xo={round(w*0.1)} +Yo={round(h*0.1)} +Xf={round(w*0.9)} +Yf={round(h*0.9)} +Type_Degrade=2 +elif $Examples==4 +Xo={round(w*0.1)} +Yo={round(h*0.1)} +Xf={round(w*0.9)} +Yf={round(h*0.9)} +Type_Degrade=3 +elif $Examples==5 +Xo={round(w*0.4)} +Yo={round(h*0.4)} +Xf={round(w*0.5)} +Yf={round(h*0.5)} +Type_Degrade=4 +elif $Examples==6 +Xo={round(w*0.4)} +Yo={round(h*0.4)} +Xf={round(w*0.5)} +Yf={round(h*0.5)} +Type_Degrade=5 +elif $Examples==7 +Xo={round(w*0.71)} +Yo={round(h*0.71)} +Xf={w} +Yf={h} +Type_Degrade=5 +fi +nt_Ra={$Ra/255} +nt_Ga={$Ga/255} +nt_Ba={$Ba/255} +if $nt_Ra>0.04045 +nt_Ra={({{$nt_Ra+0.055}/1.055})^2.4} +else +nt_Ra/=12.92 +fi +if $nt_Ga>0.04045 +nt_Ga={({{$nt_Ga+0.055}/1.055})^2.4} +else +nt_Ga/=12.92 +fi +if $nt_Ba>0.04045 +nt_Ba={({{$nt_Ba+0.055}/1.055})^2.4} +else +nt_Ba/=12.92 +fi +nt_Ra*=100 +nt_Ga*=100 +nt_Ba*=100 +Xa={$nt_Ra*0.4124564+$nt_Ga*0.3575761+$nt_Ba*0.1804375} +Ya={$nt_Ra*0.2126729+$nt_Ga*0.7151522+$nt_Ba*0.0721750} +Za={$nt_Ra*0.0193339+$nt_Ga*0.1191920+$nt_Ba*0.9503041} +Xca=$Xa +Yca=$Ya +Zca=$Za +ref_Xa=95.047 +ref_Ya=100.000 +ref_Za=108.883 +nt_Xa={$Xca/$ref_Xa} +nt_Ya={$Yca/$ref_Ya} +nt_Za={$Zca/$ref_Za} +if $nt_Xa>0.008856 +nt_Xa={($nt_Xa)^{1/3}} +else +nt_Xa={{7.787*$nt_Xa}+{16/116}} +fi +if $nt_Ya>0.008856 +nt_Ya={($nt_Ya)^{1/3}} +else +nt_Ya={{7.787*$nt_Ya}+{16/116}} +fi +if $nt_Za>0.008856 +nt_Za={($nt_Za)^{1/3}} +else +nt_Za={{7.787*$nt_Za}+{16/116}} +fi +CIE_La={{116*$nt_Ya}-16} +CIE_aa={500*{$nt_Xa-$nt_Ya}} +CIE_ba={200*{$nt_Ya-$nt_Za}} +nt_Ra={$Rb/255} +nt_Ga={$Gb/255} +nt_Ba={$Bb/255} +if $nt_Ra>0.04045 +nt_Ra={({{$nt_Ra+0.055}/1.055})^2.4} +else +nt_Ra/=12.92 +fi +if $nt_Ga>0.04045 +nt_Ga={({{$nt_Ga+0.055}/1.055})^2.4} +else +nt_Ga/=12.92 +fi +if $nt_Ba>0.04045 +nt_Ba={({{$nt_Ba+0.055}/1.055})^2.4} +else +nt_Ba/=12.92 +fi +nt_Ra*=100 +nt_Ga*=100 +nt_Ba*=100 +Xb={$nt_Ra*0.4124564+$nt_Ga*0.3575761+$nt_Ba*0.1804375} +Yb={$nt_Ra*0.2126729+$nt_Ga*0.7151522+$nt_Ba*0.0721750} +Zb={$nt_Ra*0.0193339+$nt_Ga*0.1191920+$nt_Ba*0.9503041} +Xca=$Xb +Yca=$Yb +Zca=$Zb +ref_Xa=95.047 +ref_Ya=100.000 +ref_Za=108.883 +nt_Xa={$Xca/$ref_Xa} +nt_Ya={$Yca/$ref_Ya} +nt_Za={$Zca/$ref_Za} +if $nt_Xa>0.008856 +nt_Xa={($nt_Xa)^{1/3}} +else +nt_Xa={{7.787*$nt_Xa}+{16/116}} +fi +if $nt_Ya>0.008856 +nt_Ya={($nt_Ya)^{1/3}} +else +nt_Ya={{7.787*$nt_Ya}+{16/116}} +fi +if $nt_Za>0.008856 +nt_Za={($nt_Za)^{1/3}} +else +nt_Za={{7.787*$nt_Za}+{16/116}} +fi +CIE_Lb={{116*$nt_Ya}-16} +CIE_ab={500*{$nt_Xa-$nt_Ya}} +CIE_bb={200*{$nt_Ya-$nt_Za}} +if $Background==1 +{w},{h},1,4 +rm[-2] +elif $Background==2 +{w},{h},1,4 +fill_color[-1] $Rback,$Gback,$Bback,$Aback +rm[-2] +fi +Nb_Boucles=0 +if $Type_Degrade==0 +Dimensions={$Xf-$Xo} +elif $Type_Degrade==1 +Dimensions={$Yf-$Yo} +elif $Type_Degrade==2 +if {$Xf-$Xo}>{$Yf-$Yo} +Dimensions={round({{$Yf-$Yo+1}/2})} +else +Dimensions={round({{$Xf-$Xo+1}/2})} +fi +elif $Type_Degrade==3 +if {$Xf-$Xo}>{$Yf-$Yo} +Dimensions={round({{$Xf-$Xo+1}/2})} +else +Dimensions={round({{$Yf-$Yo+1}/2})} +fi +elif $Type_Degrade==4 +Dimensions=$Xo +elif $Type_Degrade==5 +Dimensions={$Xo+$Yo} +fi +Inc_L={{$CIE_La-$CIE_Lb}/$Dimensions} +Inc_a={{$CIE_aa-$CIE_ab}/$Dimensions} +Inc_b={{$CIE_ba-$CIE_bb}/$Dimensions} +Inc_Alpha={{$Ab-$Aa}/$Dimensions} +Decalage_L=0 +Decalage_a=0 +Decalage_b=0 +repeat $Dimensions +Aa+=$Inc_Alpha +if $Aa>255 Aa=255 fi +if $Aa<0 Aa=0 fi +CIE_Lca={$CIE_La+$Decalage_L-($Nb_Boucles*$Inc_L)} +CIE_aca={$CIE_aa+$Decalage_a-($Nb_Boucles*$Inc_a)} +CIE_bca={$CIE_ba+$Decalage_b-($Nb_Boucles*$Inc_b)} +if $CIE_Lca>100 CIE_Lca=100 fi +if $CIE_Lca<0 CIE_Lca=0 fi +if $CIE_aca>127 CIE_aca=127 fi +if $CIE_aca<-128 CIE_aca=-128 fi +if $CIE_bca>127 CIE_bca=127 fi +if $CIE_bca<-128 CIE_bca=-128 fi +nt_Yca={{$CIE_Lca+16}/116} +nt_Xca={$CIE_aca/500+$nt_Yca} +nt_Zca={$nt_Yca-$CIE_bca/200} +if {($nt_Yca)^3}>0.008856 +nt_Yca={($nt_Yca)^3} +else +nt_Yca={{$nt_Yca-16/116}/7.787} +fi +if {($nt_Xca)^3}>0.008856 +nt_Xca={($nt_Xca)^3} +else +nt_Xca={{$nt_Xca-16/116}/7.787} +fi +if {($nt_Zca)^3}>0.008856 +nt_Zca={($nt_Zca)^3} +else +nt_Zca={{$nt_Zca-16/116}/7.787} +fi +ref_Xca=95.047 +ref_Yca=100.000 +ref_Zca=108.883 +Xca={$ref_Xca*$nt_Xca} +Yca={$ref_Yca*$nt_Yca} +Zca={$ref_Zca*$nt_Zca} +vcXa=$Xca +vcYa=$Yca +vcZa=$Zca +nt_X={$vcXa/100} +nt_Y={$vcYa/100} +nt_Z={$vcZa/100} +nt_R={$nt_X*3.2404542+$nt_Y*-1.5371385+$nt_Z*-0.4985314} +nt_G={$nt_X*-0.9692660+$nt_Y*1.8760108+$nt_Z*0.0415560} +nt_B={$nt_X*0.0556434+$nt_Y*-0.2040259+$nt_Z*1.0572252} +if $nt_R>0.0031308 +nt_R={1.055*{($nt_R)^{1/2.4}}-0.055} +else +nt_R={12.92*$nt_R} +fi +if $nt_G>0.0031308 +nt_G={1.055*{($nt_G)^{1/2.4}}-0.055} +else +nt_G={12.92*$nt_G} +fi +if $nt_B>0.0031308 +nt_B={1.055*{($nt_B)^{1/2.4}}-0.055} +else +nt_B={12.92*$nt_B} +fi +Rconv={$nt_R*255} +Gconv={$nt_G*255} +Bconv={$nt_B*255} +if $Rconv>255 Rconv=255 fi +if $Rconv<0 Rconv=0 fi +if $Gconv>255 Gconv=255 fi +if $Gconv<0 Gconv=0 fi +if $Bconv>255 Bconv=255 fi +if $Bconv<0 Bconv=0 fi +if $Type_Degrade==0 +line[-1] {$Xo+$Nb_Boucles},$Yo,{$Xo+$Nb_Boucles},$Yf,1,$Rconv,$Gconv,$Bconv,$Aa +elif $Type_Degrade==1 +line[-1] $Xo,{$Yo+$Nb_Boucles},$Xf,{$Yo+$Nb_Boucles},1,$Rconv,$Gconv,$Bconv,$Aa +elif $Type_Degrade==2 +polygon[-1] 4,{$Xo+$Nb_Boucles},{$Yo+$Nb_Boucles},{$Xf-$Nb_Boucles},{$Yo+$Nb_Boucles},{$Xf-$Nb_Boucles},{$Yf-$Nb_Boucles},{$Xo+$Nb_Boucles},{$Yf-$Nb_Boucles},1,0xFFFFFFFF,$Rconv,$Gconv,$Bconv,$Aa +elif $Type_Degrade==3 +polygon[-1] 4,{$Xo+$Nb_Boucles},{$Yo+$Nb_Boucles},{$Xf-$Nb_Boucles},{$Yo+$Nb_Boucles},{$Xf-$Nb_Boucles},{$Yf-$Nb_Boucles},{$Xo+$Nb_Boucles},{$Yf-$Nb_Boucles},1,0xFFFFFFFF,$Rconv,$Gconv,$Bconv,$Aa +elif $Type_Degrade==4 +ellipse[-1] $Xf,$Yf,{$Dimensions-$Nb_Boucles},{$Dimensions-$Nb_Boucles},0,1,$Rconv,$Gconv,$Bconv,$Aa +elif $Type_Degrade==5 +ellipse[-1] $Xf,$Yf,{$Dimensions-$Nb_Boucles},{$Dimensions-$Nb_Boucles},0,1,$Rconv,$Gconv,$Bconv,$Aa +fi +Nb_Boucles+=1 +done +Harmonograph_samj : +centre_origine_X={$1/100*w} +centre_origine_Y={$2/100*h} +R_Couleur_Stylo=$3 +V_Couleur_Stylo=$4 +B_Couleur_Stylo=$5 +A_Couleur_Stylo=$6 +Variation_de_couleur=$7 +Dilate_Stylo=$8 +Iterations=$9 +Multiplier_Iterations=$10 +Increment_temps=$11 +if $12>0 +Amplitude1={w*$12/{1000}} +else +Amplitude1={-h*$12/{1000}} +fi +if $13>0 +Amplitude2={w*$13/{1000}} +else +Amplitude2={-h*$13/{1000}} +fi +if $14>0 +Amplitude3={w*$14/{1000}} +else +Amplitude3={-h*$14/{1000}} +fi +if $15>0 +Amplitude4={w*$15/{1000}} +else +Amplitude4={-h*$15/{1000}} +fi +Frequence1=$16 +Frequence2=$17 +Frequence3=$18 +Frequence4=$19 +Phase1=$20 +Phase2=$21 +Phase3=$22 +Phase4=$23 +Amort1=$24 +Amort2=$25 +Amort3=$26 +Amort4=$27 +Flou_Harmonograph=$28 +Spread_Harmonograph=$29 +Deform_Harmonograph=$30 +blend=$31 +opacite=$32 +Revert_layers=0 +to_rgba +{w},{h},1,4 +Nb_Boucle=1 +temps=0 +Ancien_point_X=0 +Nouveau_point_X=0 +Ancien_point_Y=0 +Nouveau_point_Y=0 +R_Couleur_origine=$R_Couleur_Stylo +V_Couleur_origine=$V_Couleur_Stylo +B_Couleur_origine=$B_Couleur_Stylo +A_Couleur_origine=$A_Couleur_Stylo +Increment_temps/=10000 +Phase1/=180*{pi} +Phase2/=180*{pi} +Phase3/=180*{pi} +Phase4/=180*{pi} +if $Multiplier_Iterations>0 +Iterations*=$Multiplier_Iterations*5 +fi +repeat $Iterations +if $Variation_de_couleur==1 +R_Couleur_Stylo={round(u)*255} +V_Couleur_Stylo={round(u)*255} +B_Couleur_Stylo={round(u)*255} +fi +if $Variation_de_couleur>1 +Valeur_variation_couleur=16 +if $Variation_de_couleur==3 +Valeur_variation_couleur=32 +fi +if $Variation_de_couleur==4 +Valeur_variation_couleur=64 +fi +R_Couleur_Stylo={round({$R_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $R_Couleur_Stylo>255 +R_Couleur_Stylo=$R_Couleur_origine +fi +if $R_Couleur_Stylo<0 +R_Couleur_Stylo=$R_Couleur_origine +fi +V_Couleur_Stylo={round({$V_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $V_Couleur_Stylo>255 +V_Couleur_Stylo=$V_Couleur_origine +fi +if $V_Couleur_Stylo<0 +V_Couleur_Stylo=$V_Couleur_origine +fi +B_Couleur_Stylo={round({$B_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $B_Couleur_Stylo>255 +B_Couleur_Stylo=$B_Couleur_origine +fi +if $B_Couleur_Stylo<0 +B_Couleur_Stylo=$B_Couleur_origine +fi +fi +Nouveau_point_X={$centre_origine_X+(($Amplitude1*(sin((($Frequence1*$temps)+$Phase1)))*(exp(-$Amort1*$temps)))+($Amplitude2*(sin((($Frequence2*$temps)+$Phase2)))*(exp(-$Amort2*$temps))))} +Nouveau_point_Y={$centre_origine_Y+(($Amplitude3*(sin((($Frequence3*$temps)+$Phase3)))*(exp(-$Amort3*$temps)))+($Amplitude4*(sin((($Frequence4*$temps)+$Phase4)))*(exp(-$Amort4*$temps))))} +if $Nb_Boucle>1 +line[-1] $Ancien_point_X,$Ancien_point_Y,$Nouveau_point_X,$Nouveau_point_Y,1,$R_Couleur_Stylo,$V_Couleur_Stylo,$B_Couleur_Stylo,$A_Couleur_Stylo +fi +Ancien_point_X=$Nouveau_point_X +Ancien_point_Y=$Nouveau_point_Y +temps+=$Increment_temps +Nb_Boucle+=1 +done +if $Dilate_Stylo>0 dilate_circ[-1] $Dilate_Stylo fi +if $Flou_Harmonograph>0 blur[-1] $Flou_Harmonograph,0 fi +if $Spread_Harmonograph>1 spread[-1] $Spread_Harmonograph fi +if $Deform_Harmonograph>0 deform[-1] $Deform_Harmonograph fi +gimp_blend_1651[-1,-2] $blend,1,$opacite,$Revert_layers,1 +samj_Hawaiian_Earring : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Rayon_Cercle_Exterieur={round({{w+h}*$3/200})} +Nb_Circles=$4 +Type_n=$5 +Angle_inclinaison=$6 +R_Contours=$7 +V_Contours=$8 +B_Contours=$9 +A_Contours=$10 +Affichage_Contours=$11 +R_a=$12 +V_a=$13 +B_a=$14 +A_a=$15 +R_b=$16 +V_b=$17 +B_b=$18 +A_b=$19 +Couleurs_aleatoires=$20 +Inversions=$21 +Flou=$22 +Dilatation=$23 +Deformation=$24 +Bruit=$25 +Ombre=$26 +X_Ombre=$27 +Y_Ombre=$28 +Smoothness_Ombre=$29 +Curvature_Ombre=$30 +Compensation_Decalage_Ombre_X=$31 +Compensation_Decalage_Ombre_Y=$32 +Canal_Alpha=$33 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_boucles=0 +X_Cercle_A_Imprimer=$X +Y_Cercle_A_Imprimer=$Y +Rayon_Centre_Cercle_A_Imprimer=0 +Rayon_Cercle_A_Imprimer=$Rayon_Cercle_Exterieur +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Affichage_Contours==1 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +repeat $Nb_Circles +Nb_boucles+=1 +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +R_b={round(u)*255} +V_b={round(u)*255} +B_b={round(u)*255} +fi +if ($Nb_boucles%2)==0 +ellipse[-1] $X_Cercle_A_Imprimer,$Y_Cercle_A_Imprimer,$Rayon_Cercle_A_Imprimer,$Rayon_Cercle_A_Imprimer,0,1,$R_a,$V_a,$B_a,$A_a +else +ellipse[-1] $X_Cercle_A_Imprimer,$Y_Cercle_A_Imprimer,$Rayon_Cercle_A_Imprimer,$Rayon_Cercle_A_Imprimer,0,1,$R_b,$V_b,$B_b,$A_b +fi +if $Affichage_Contours==1 +ellipse[-2] $X_Cercle_A_Imprimer,$Y_Cercle_A_Imprimer,$Rayon_Cercle_A_Imprimer,$Rayon_Cercle_A_Imprimer,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Type_n==0 +Rayon_Cercle_A_Imprimer={$Rayon_Cercle_Exterieur/($Nb_boucles+1)} +elif $Type_n==1 +Rayon_Cercle_A_Imprimer={$Rayon_Cercle_A_Imprimer-($Rayon_Cercle_A_Imprimer*0.1)} +elif $Type_n==2 +Rayon_Cercle_A_Imprimer={$Rayon_Cercle_A_Imprimer-($Rayon_Cercle_A_Imprimer*0.2)} +elif $Type_n==3 +Rayon_Cercle_A_Imprimer={$Rayon_Cercle_A_Imprimer-($Rayon_Cercle_A_Imprimer*0.3)} +elif $Type_n==4 +Rayon_Cercle_A_Imprimer={$Rayon_Cercle_A_Imprimer-($Rayon_Cercle_A_Imprimer*(u(0.1,0.3)))} +fi +Rayon_Centre_Cercle_A_Imprimer={$Rayon_Cercle_Exterieur-$Rayon_Cercle_A_Imprimer} +X_Cercle_A_Imprimer={$X-($Rayon_Centre_Cercle_A_Imprimer*(cos(pi/180*$Angle_inclinaison)))} +Y_Cercle_A_Imprimer={$Y-($Rayon_Centre_Cercle_A_Imprimer*(sin(pi/180*$Angle_inclinaison)))} +done +if $Affichage_Contours==1 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Lignes_Epaisseur_Variable : +Motif_Sprite=$1 +Resolution_Largeur=$2 +Trait_Largeur=$3 +R_fond=$4 +V_fond=$5 +B_fond=$6 +A_fond=$7 +R_a=$8 +V_a=$9 +B_a=$10 +A_a=$11 +Inverser_Fond_Trait=$12 +Couleurs_aleatoires=$13 +Resize_Image=$14 +Antialiasing=$15 +R_Deblur=$16 +Dilatation=$17 +Deformation=$18 +Bruit=$19 +Ombre=$20 +X_Ombre=$21 +Y_Ombre=$22 +Smoothness_Ombre=$23 +Curvature_Ombre=$24 +Canal_Alpha=$25 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_boucles=0 +Nb_boucles_motif=0 +Origine_Trait=0 +if $Inverser_Fond_Trait==0 +R_F=$R_fond +V_F=$V_fond +B_F=$B_fond +A_F=$A_fond +R_M=$R_a +V_M=$V_a +B_M=$B_a +A_M=$A_a +else +R_F=$R_a +V_F=$V_a +B_F=$B_a +A_F=$A_a +R_M=$R_fond +V_M=$V_fond +B_M=$B_fond +A_M=$A_fond +fi +Largeur_Sprite={{7*2}+{7*$Trait_Largeur}} +Hauteur_Sprite=$Largeur_Sprite +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +resize[-1] $Resolution_Largeur,{round($Hauteur_Origine/$Largeur_Origine*$Resolution_Largeur)} +repeat 7 +Nb_boucles+=1 +if $Nb_boucles==1 +if $Couleurs_aleatoires==1 +R_F={round(u)*255} +V_F={round(u)*255} +B_F={round(u)*255} +fi +$Largeur_Sprite,$Hauteur_Sprite,1,4 +fill_color[-1] $R_F,$V_F,$B_F,$A_F +fi +if $Couleurs_aleatoires==1 +R_F={round(u)*255} +V_F={round(u)*255} +B_F={round(u)*255} +R_M={round(u)*255} +V_M={round(u)*255} +B_M={round(u)*255} +fi +$Largeur_Sprite,$Hauteur_Sprite,1,4 +fill_color[-1] $R_F,$V_F,$B_F,$A_F +Nb_boucles_motif=0 +if $Motif_Sprite==0||$Motif_Sprite==1 +Origine_Trait={round({{$Largeur_Sprite-{$Trait_Largeur*$Nb_boucles}}/2})} +repeat $Trait_Largeur*$Nb_boucles +line[-1] {$Origine_Trait+$Nb_boucles_motif},0,{$Origine_Trait+$Nb_boucles_motif},{$Hauteur_Sprite-1},1,$R_M,$V_M,$B_M,$A_M +Nb_boucles_motif+=1 +done +fi +done +if $Motif_Sprite==1 +rotate[-1,-2,-3,-4,-5,-6,-7,-8] 90,0,0 +fi +map_sprites[-1,-2,-3,-4,-5,-6,-7,-8,-9] 8,0 +if $Resize_Image==1 +resize[-1] $Largeur_Origine,$Hauteur_Origine +fi +if $Antialiasing>0 apply_channels[-1] "smooth "$Antialiasing",0.7,0.3,0.6,5,5,0",1 fi +if $R_Deblur>0 apply_channels[-1] "deblur "$R_Deblur",10,20,0.1,1",1 fi +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +fi +samj_Orbites : +Dimension={round({{max(w,h)}*$1/100})} +R_fond=$2 +V_fond=$3 +B_fond=$4 +A_fond=$5 +X={round({$Dimension*{$6/100}})} +Y={round({$Dimension*{$7/100}})} +Rayon_Cercle_A={round($Dimension*$8/100)} +Nb_Points_A=$9 +Rayon_Cercle_B={round($Dimension*$10/100)} +Multiplicateur=$11 +R_a=$12 +V_a=$13 +B_a=$14 +A_a=$15 +Angle_Inclinaison_A=$16 +Angle_Inclinaison_B=$17 +Couleurs_aleatoires=$18 +Flou=$19 +Dilatation=$20 +Deformation=$21 +Bruit=$22 +Tracer_Les_Cercles=$23 +Largeur_Origine={w} +Hauteur_Origine={h} +Variation_Angle_A={360/$Nb_Points_A} +Variation_Angle_B={360/{$Nb_Points_A*$Multiplicateur}} +Sortie_Boucle_Lignes=0 +Nb_Boucle_Lignes=0 +Nb_Boucle_Points=0 +Boucles_Rendu={round({{$Nb_Points_A*$Multiplicateur}+$Nb_Points_A}+1)} +rm[-1] +$Dimension,$Dimension,1,4 +fill_color[-1] 0,0,0,0 +Angle_A=0 +X_Imp_A={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle_A+$Angle_Inclinaison_A)))))} +Y_Imp_A={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle_A+$Angle_Inclinaison_A)))))} +Angle_B=0 +X_Imp_B={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle_B+$Angle_Inclinaison_B)))))} +Y_Imp_B={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle_B+$Angle_Inclinaison_B)))))} +repeat $Boucles_Rendu +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +fi +line[-1] $X_Imp_A,$Y_Imp_A,$X_Imp_B,$Y_Imp_B,1,$R_a,$V_a,$B_a,$A_a +Angle_A+=$Variation_Angle_A +X_Imp_A={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle_A+$Angle_Inclinaison_A)))))} +Y_Imp_A={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle_A+$Angle_Inclinaison_A)))))} +Angle_B+=$Variation_Angle_B +X_Imp_B={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle_B+$Angle_Inclinaison_B)))))} +Y_Imp_B={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle_B+$Angle_Inclinaison_B)))))} +done +if $Tracer_Les_Cercles==1 +ellipse[-1] $X,$Y,$Rayon_Cercle_A,$Rayon_Cercle_A,0,1,0xFFFFFFFF,$R_a,$V_a,$B_a,$A_a +ellipse[-1] $X,$Y,$Rayon_Cercle_B,$Rayon_Cercle_B,0,1,0xFFFFFFFF,$R_a,$V_a,$B_a,$A_a +fi +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +$Dimension,$Dimension,1,4 +fill_color[-1] $R_fond,$V_fond,$B_fond,$A_fond +gimp_blend_1651[-2,-1] 1,0,1,0,1 +samj_Palette_De_Degrades : +R_a=$1 +V_a=$2 +B_a=$3 +R_b=$4 +V_b=$5 +B_b=$6 +R_c=$7 +V_c=$8 +B_c=$9 +R_d=$10 +V_d=$11 +B_d=$12 +R_e=$13 +V_e=$14 +B_e=$15 +R_f=$16 +V_f=$17 +B_f=$16 +R_g=$19 +V_g=$20 +B_g=$21 +R_h=$22 +V_h=$23 +B_h=$25 +R_i=$25 +V_i=$26 +B_i=$27 +R_j=$28 +V_j=$29 +B_j=$30 +R_k=$31 +V_k=$32 +B_k=$33 +R_l=$34 +V_l=$35 +B_l=$36 +Ajouter_Noir=$37 +Ajouter_Blanc=$38 +Etendue_Degrade=$39 +Hauteur_De_Un_Degrade=$40 +Hauteur_Degrade={66*$Hauteur_De_Un_Degrade} +Hauteur_Origine_Degrade=-1 +if {$Ajouter_Noir+$Ajouter_Blanc}==1 +Hauteur_Degrade={78*$Hauteur_De_Un_Degrade} +fi +if {$Ajouter_Noir+$Ajouter_Blanc}==2 +Hauteur_Degrade={91*$Hauteur_De_Un_Degrade} +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_b,$V_b,$B_b,255 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_c,$V_c,$B_c,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_d,$V_d,$B_d,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_e,$V_e,$B_e,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_f,$V_f,$B_f,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_g,$V_g,$B_g,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_h,$V_h,$B_h,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_i,$V_i,$B_i,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_j,$V_j,$B_j,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_k,$V_k,$B_k,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_a,$V_a,$B_a,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,$R_c,$V_c,$B_c,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,$R_d,$V_d,$B_d,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,$R_e,$V_e,$B_e,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,$R_f,$V_f,$B_f,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,$R_g,$V_g,$B_g,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,$R_h,$V_h,$B_h,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,$R_i,$V_i,$B_i,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,$R_j,$V_j,$B_j,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,$R_k,$V_k,$B_k,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_b,$V_b,$B_b,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,$R_d,$V_d,$B_d,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,$R_e,$V_e,$B_e,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,$R_f,$V_f,$B_f,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,$R_g,$V_g,$B_g,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,$R_h,$V_h,$B_h,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,$R_i,$V_i,$B_i,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,$R_j,$V_j,$B_j,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,$R_k,$V_k,$B_k,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_c,$V_c,$B_c,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_d,$V_d,$B_d,255,$R_e,$V_e,$B_e,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_d,$V_d,$B_d,255,$R_f,$V_f,$B_f,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_d,$V_d,$B_d,255,$R_g,$V_g,$B_g,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_d,$V_d,$B_d,255,$R_h,$V_h,$B_h,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_d,$V_d,$B_d,255,$R_i,$V_i,$B_i,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_d,$V_d,$B_d,255,$R_j,$V_j,$B_j,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_d,$V_d,$B_d,255,$R_k,$V_k,$B_k,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_d,$V_d,$B_d,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_d,$V_d,$B_d,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_d,$V_d,$B_d,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_e,$V_e,$B_e,255,$R_f,$V_f,$B_f,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_e,$V_e,$B_e,255,$R_g,$V_g,$B_g,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_e,$V_e,$B_e,255,$R_h,$V_h,$B_h,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_e,$V_e,$B_e,255,$R_i,$V_i,$B_i,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_e,$V_e,$B_e,255,$R_j,$V_j,$B_j,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_e,$V_e,$B_e,255,$R_k,$V_k,$B_k,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_e,$V_e,$B_e,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_e,$V_e,$B_e,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_e,$V_e,$B_e,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_f,$V_f,$B_f,255,$R_g,$V_g,$B_g,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_f,$V_f,$B_f,255,$R_h,$V_h,$B_h,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_f,$V_f,$B_f,255,$R_i,$V_i,$B_i,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_f,$V_f,$B_f,255,$R_j,$V_j,$B_j,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_f,$V_f,$B_f,255,$R_k,$V_k,$B_k,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_f,$V_f,$B_f,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_f,$V_f,$B_f,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_f,$V_f,$B_f,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_g,$V_g,$B_g,255,$R_h,$V_h,$B_h,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_g,$V_g,$B_g,255,$R_i,$V_i,$B_i,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_g,$V_g,$B_g,255,$R_j,$V_j,$B_j,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_g,$V_g,$B_g,255,$R_k,$V_k,$B_k,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_g,$V_g,$B_g,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_g,$V_g,$B_g,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_g,$V_g,$B_g,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_h,$V_h,$B_h,255,$R_i,$V_i,$B_i,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_h,$V_h,$B_h,255,$R_j,$V_j,$B_j,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_h,$V_h,$B_h,255,$R_k,$V_k,$B_k,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_h,$V_h,$B_h,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_h,$V_h,$B_h,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_h,$V_h,$B_h,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_i,$V_i,$B_i,255,$R_j,$V_j,$B_j,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_i,$V_i,$B_i,255,$R_k,$V_k,$B_k,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_i,$V_i,$B_i,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_i,$V_i,$B_i,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_i,$V_i,$B_i,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_j,$V_j,$B_j,255,$R_k,$V_k,$B_k,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_j,$V_j,$B_j,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_j,$V_j,$B_j,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_j,$V_j,$B_j,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_k,$V_k,$B_k,255,$R_l,$V_l,$B_l,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_k,$V_k,$B_k,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_k,$V_k,$B_k,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Noir==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_l,$V_l,$B_l,255,0,0,0,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +if $Ajouter_Blanc==1 +$Etendue_Degrade,$Hauteur_Degrade,1,4 +samj_Linear_Gradient_CIE_Lab[-1] 0,0,$R_l,$V_l,$B_l,255,255,255,255,255 +Hauteur_Origine_Degrade={$Hauteur_Origine_Degrade+$Hauteur_De_Un_Degrade} rectangle[-1] 0,0,$Etendue_Degrade,$Hauteur_Origine_Degrade,1,0,0,0,0 samj_blend_20220419[-1,-2] alpha,1,1 +fi +rv[-2,-1] +samj_Palette_De_Degrades_preview : +samj_Palette_De_Degrades[-1] $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,2 +samj_Cercles_Tangents_Dans_Cercle : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +if $3>0 +Rayon_Cercle_Exterieur={round({w*$3/{100}})} +else +Rayon_Cercle_Exterieur={round({-h*$3/{100}})} +fi +Rayon_Premier_Cercle={round($Rayon_Cercle_Exterieur*$4/100)} +Angle_inclinaison=$5 +R_Contours=$6 +V_Contours=$7 +B_Contours=$8 +A_Contours=$9 +Affichage_Contours=$10 +R_CE=$11 +V_CE=$12 +B_CE=$13 +A_CE=$14 +R_PC=$15 +V_PC=$16 +B_PC=$17 +A_PC=$18 +R_c=$19 +V_c=$20 +B_c=$21 +A_c=$22 +R_d=$23 +V_d=$24 +B_d=$25 +A_d=$26 +R_e=$27 +V_e=$28 +B_e=$29 +A_e=$30 +R_f=$31 +V_f=$32 +B_f=$33 +A_f=$34 +R_g=$35 +V_g=$36 +B_g=$37 +A_g=$38 +R_h=$39 +V_h=$40 +B_h=$41 +A_h=$42 +R_i=$43 +V_i=$44 +B_i=$45 +A_i=$46 +R_j=$47 +V_j=$48 +B_j=$49 +A_j=$50 +R_k=$51 +V_k=$52 +B_k=$53 +A_k=$54 +Couleurs_aleatoires=$55 +Inversions=$56 +Flou=$57 +Dilatation=$58 +Deformation=$59 +Bruit=$60 +Ombre=$61 +X_Ombre=$62 +Y_Ombre=$63 +Smoothness_Ombre=$64 +Curvature_Ombre=$65 +Compensation_Decalage_Ombre_X=$66 +Compensation_Decalage_Ombre_Y=$67 +Canal_Alpha=$68 +Largeur_Origine={w} +Hauteur_Origine={h} +X_Cb={{$Rayon_Cercle_Exterieur-$Rayon_Premier_Cercle}*{cos(pi/180*$Angle_inclinaison)}} +Y_Cb={{$Rayon_Cercle_Exterieur-$Rayon_Premier_Cercle}*{sin(pi/180*$Angle_inclinaison)}} +X_Cc={$Rayon_Premier_Cercle*(cos((pi/180*($Angle_inclinaison+180))))} +Y_Cc={$Rayon_Premier_Cercle*(sin((pi/180*($Angle_inclinaison+180))))} +R_Cc={$Rayon_Cercle_Exterieur-$Rayon_Premier_Cercle} +R_Pappus={$R_Cc/$Rayon_Cercle_Exterieur} +n_Pappus=1 +b_Pappus={$R_Cc} +a_Pappus={$Rayon_Premier_Cercle} +R_Cercle_d={{$a_Pappus*$b_Pappus*{$a_Pappus+$b_Pappus}}/{{$n_Pappus*$a_Pappus*$a_Pappus}+{$b_Pappus*{$a_Pappus+$b_Pappus}}}} +Va={$R_Cc+$R_Cercle_d} +Vb={$Rayon_Premier_Cercle+$R_Cercle_d} +d_x={$X_Cb-$X_Cc} +d_y={$Y_Cb-$Y_Cc} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cc+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cc+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_da={$c_x2+$o_rx} +Y_Cercle_da={$c_y2+$o_ry} +X_Cercle_db={$c_x2-$o_rx} +Y_Cercle_db={$c_y2-$o_ry} +R_Pappus={$R_Cc/$Rayon_Cercle_Exterieur} +n_Pappus=4 +b_Pappus={$R_Cc} +a_Pappus={$Rayon_Premier_Cercle} +R_Cercle_e={{$a_Pappus*$b_Pappus*{$a_Pappus+$b_Pappus}}/{{$n_Pappus*$a_Pappus*$a_Pappus}+{$b_Pappus*{$a_Pappus+$b_Pappus}}}} +Vb={$R_Cc+$R_Cercle_e} +Va={$R_Cercle_d+$R_Cercle_e} +d_x={$X_Cc-$X_Cercle_da} +d_y={$Y_Cc-$Y_Cercle_da} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_da+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_da+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_eb={$c_x2-$o_rx} +Y_Cercle_eb={$c_y2-$o_ry} +d_x={$X_Cc-$X_Cercle_db} +d_y={$Y_Cc-$Y_Cercle_db} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_db+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_db+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_ea={$c_x2+$o_rx} +Y_Cercle_ea={$c_y2+$o_ry} +R_Pappus={$R_Cc/$Rayon_Cercle_Exterieur} +n_Pappus=9 +b_Pappus={$R_Cc} +a_Pappus={$Rayon_Premier_Cercle} +R_Cercle_f={{$a_Pappus*$b_Pappus*{$a_Pappus+$b_Pappus}}/{{$n_Pappus*$a_Pappus*$a_Pappus}+{$b_Pappus*{$a_Pappus+$b_Pappus}}}} +Vb={$R_Cc+$R_Cercle_f} +Va={$R_Cercle_e+$R_Cercle_f} +d_x={$X_Cc-$X_Cercle_ea} +d_y={$Y_Cc-$Y_Cercle_ea} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_ea+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_ea+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_fa={$c_x2+$o_rx} +Y_Cercle_fa={$c_y2+$o_ry} +d_x={$X_Cc-$X_Cercle_eb} +d_y={$Y_Cc-$Y_Cercle_eb} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_eb+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_eb+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_fb={$c_x2-$o_rx} +Y_Cercle_fb={$c_y2-$o_ry} +R_Pappus={$R_Cc/$Rayon_Cercle_Exterieur} +n_Pappus=16 +b_Pappus={$R_Cc} +a_Pappus={$Rayon_Premier_Cercle} +R_Cercle_g={{$a_Pappus*$b_Pappus*{$a_Pappus+$b_Pappus}}/{{$n_Pappus*$a_Pappus*$a_Pappus}+{$b_Pappus*{$a_Pappus+$b_Pappus}}}} +Vb={$R_Cc+$R_Cercle_g} +Va={$R_Cercle_f+$R_Cercle_g} +d_x={$X_Cc-$X_Cercle_fa} +d_y={$Y_Cc-$Y_Cercle_fa} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_fa+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_fa+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_ga={$c_x2+$o_rx} +Y_Cercle_ga={$c_y2+$o_ry} +d_x={$X_Cc-$X_Cercle_fb} +d_y={$Y_Cc-$Y_Cercle_fb} +d_between_centers={{{$d_y*$d_y}+{$d_x*$d_x}}^0.5} +d_p0_p2={{{$Va*$Va}-{$Vb*$Vb}+{$d_between_centers*$d_between_centers}}/{2*$d_between_centers}} +c_x2={$X_Cercle_fb+($d_x*$d_p0_p2/$d_between_centers)} +c_y2={$Y_Cercle_fb+($d_y*$d_p0_p2/$d_between_centers)} +d_h={{{$Va*$Va}-{$d_p0_p2*$d_p0_p2}}^0.5} +o_rx={-$d_y*$d_h/$d_between_centers} +o_ry={$d_x*$d_h/$d_between_centers} +X_Cercle_gb={$c_x2-$o_rx} +Y_Cercle_gb={$c_y2-$o_ry} +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Couleurs_aleatoires==1 +R_CE={round(u)*255} +V_CE={round(u)*255} +B_CE={round(u)*255} +R_PC={round(u)*255} +V_PC={round(u)*255} +B_PC={round(u)*255} +R_c={round(u)*255} +V_c={round(u)*255} +B_c={round(u)*255} +R_d={round(u)*255} +V_d={round(u)*255} +B_d={round(u)*255} +R_e={round(u)*255} +V_e={round(u)*255} +B_e={round(u)*255} +R_f={round(u)*255} +V_f={round(u)*255} +B_f={round(u)*255} +R_g={round(u)*255} +V_g={round(u)*255} +B_g={round(u)*255} +R_h={round(u)*255} +V_h={round(u)*255} +B_h={round(u)*255} +R_i={round(u)*255} +V_i={round(u)*255} +B_i={round(u)*255} +R_j={round(u)*255} +V_j={round(u)*255} +B_j={round(u)*255} +R_k={round(u)*255} +V_k={round(u)*255} +B_k={round(u)*255} +fi +if $Affichage_Contours>0 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +ellipse[-1] $X,$Y,$Rayon_Cercle_Exterieur,$Rayon_Cercle_Exterieur,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-1] {$X+$X_Cb},{$Y+$Y_Cb},$Rayon_Premier_Cercle,$Rayon_Premier_Cercle,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-1] {$X+$X_Cc},{$Y+$Y_Cc},$R_Cc,$R_Cc,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-1] {$X+$X_Cercle_da},{$Y+$Y_Cercle_da},$R_Cercle_d,$R_Cercle_d,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-1] {$X+$X_Cercle_db},{$Y+$Y_Cercle_db},$R_Cercle_d,$R_Cercle_d,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-1] {$X+$X_Cercle_ea},{$Y+$Y_Cercle_ea},$R_Cercle_e,$R_Cercle_e,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-1] {$X+$X_Cercle_eb},{$Y+$Y_Cercle_eb},$R_Cercle_e,$R_Cercle_e,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-1] {$X+$X_Cercle_fa},{$Y+$Y_Cercle_fa},$R_Cercle_f,$R_Cercle_f,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-1] {$X+$X_Cercle_fb},{$Y+$Y_Cercle_fb},$R_Cercle_f,$R_Cercle_f,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-1] {$X+$X_Cercle_ga},{$Y+$Y_Cercle_ga},$R_Cercle_g,$R_Cercle_g,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-1] {$X+$X_Cercle_gb},{$Y+$Y_Cercle_gb},$R_Cercle_g,$R_Cercle_g,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +ellipse[-1] $X,$Y,$Rayon_Cercle_Exterieur,$Rayon_Cercle_Exterieur,0,1,$R_CE,$V_CE,$B_CE,$A_CE +ellipse[-1] {$X+$X_Cb},{$Y+$Y_Cb},$Rayon_Premier_Cercle,$Rayon_Premier_Cercle,0,1,$R_PC,$V_PC,$B_PC,$A_PC +ellipse[-1] {$X+$X_Cc},{$Y+$Y_Cc},$R_Cc,$R_Cc,0,1,$R_c,$V_c,$B_c,$A_c +ellipse[-1] {$X+$X_Cercle_da},{$Y+$Y_Cercle_da},$R_Cercle_d,$R_Cercle_d,0,1,$R_d,$V_d,$B_d,$A_d +ellipse[-1] {$X+$X_Cercle_db},{$Y+$Y_Cercle_db},$R_Cercle_d,$R_Cercle_d,0,1,$R_e,$V_e,$B_e,$A_e +ellipse[-1] {$X+$X_Cercle_ea},{$Y+$Y_Cercle_ea},$R_Cercle_e,$R_Cercle_e,0,1,$R_f,$V_f,$B_f,$A_f +ellipse[-1] {$X+$X_Cercle_eb},{$Y+$Y_Cercle_eb},$R_Cercle_e,$R_Cercle_e,0,1,$R_g,$V_g,$B_g,$A_g +ellipse[-1] {$X+$X_Cercle_fa},{$Y+$Y_Cercle_fa},$R_Cercle_f,$R_Cercle_f,0,1,$R_h,$V_h,$B_h,$A_h +ellipse[-1] {$X+$X_Cercle_fb},{$Y+$Y_Cercle_fb},$R_Cercle_f,$R_Cercle_f,0,1,$R_i,$V_i,$B_i,$A_i +ellipse[-1] {$X+$X_Cercle_ga},{$Y+$Y_Cercle_ga},$R_Cercle_g,$R_Cercle_g,0,1,$R_j,$V_j,$B_j,$A_j +ellipse[-1] {$X+$X_Cercle_gb},{$Y+$Y_Cercle_gb},$R_Cercle_g,$R_Cercle_g,0,1,$R_k,$V_k,$B_k,$A_k +if $Affichage_Contours>0 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +samj_blend_20220419[-1,-2] alpha,1,0 +Pintograph_samj : +centre_origine_X={$1/100*w} +centre_origine_Y={$2/100*h} +R_Couleur_Stylo=$3 +V_Couleur_Stylo=$4 +B_Couleur_Stylo=$5 +A_Couleur_Stylo=$6 +Variation_de_couleur=$7 +Dilate_Stylo=$8 +Iterations=$9 +Multiplier_Iterations=$10 +Increment_temps=$11 +if $12>0 +Amplitude1={w*$12/{1000}} +else +Amplitude1={-h*$12/{1000}} +fi +if $13>0 +Amplitude2={w*$13/{1000}} +else +Amplitude2={-h*$13/{1000}} +fi +if $14>0 +Amplitude3={w*$14/{1000}} +else +Amplitude3={-h*$14/{1000}} +fi +if $15>0 +Amplitude4={w*$15/{1000}} +else +Amplitude4={-h*$15/{1000}} +fi +Frequence1=$16 +Frequence2=$17 +Frequence3=$18 +Frequence4=$19 +Phase1=$20 +Phase2=$21 +Phase3=$22 +Phase4=$23 +Flou_Pintograph=$24 +Spread_Pintograph=$25 +Deform_Pintograph=$26 +blend=$27 +opacite=$28 +Revert_layers=0 +to_rgba +{w},{h},1,4 +Nb_Boucle=1 +temps=0 +Ancien_point_X=0 +Nouveau_point_X=0 +Ancien_point_Y=0 +Nouveau_point_Y=0 +R_Couleur_origine=$R_Couleur_Stylo +V_Couleur_origine=$V_Couleur_Stylo +B_Couleur_origine=$B_Couleur_Stylo +A_Couleur_origine=$A_Couleur_Stylo +Increment_temps/=10000 +Phase1/=180*{pi} +Phase2/=180*{pi} +Phase3/=180*{pi} +Phase4/=180*{pi} +if $Multiplier_Iterations>0 +Iterations*=$Multiplier_Iterations*5 +fi +repeat $Iterations +if $Variation_de_couleur==1 +R_Couleur_Stylo={round(u)*255} +V_Couleur_Stylo={round(u)*255} +B_Couleur_Stylo={round(u)*255} +fi +if $Variation_de_couleur>1 +Valeur_variation_couleur=16 +if $Variation_de_couleur==3 +Valeur_variation_couleur=32 +fi +if $Variation_de_couleur==4 +Valeur_variation_couleur=64 +fi +R_Couleur_Stylo={round({$R_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $R_Couleur_Stylo>255 +R_Couleur_Stylo=$R_Couleur_origine +fi +if $R_Couleur_Stylo<0 +R_Couleur_Stylo=$R_Couleur_origine +fi +V_Couleur_Stylo={round({$V_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $V_Couleur_Stylo>255 +V_Couleur_Stylo=$V_Couleur_origine +fi +if $V_Couleur_Stylo<0 +V_Couleur_Stylo=$V_Couleur_origine +fi +B_Couleur_Stylo={round({$B_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $B_Couleur_Stylo>255 +B_Couleur_Stylo=$B_Couleur_origine +fi +if $B_Couleur_Stylo<0 +B_Couleur_Stylo=$B_Couleur_origine +fi +fi +Nouveau_point_X={$centre_origine_X+(($Amplitude1*(sin((($Frequence1*$temps)+$Phase1))))+($Amplitude2*(sin((($Frequence2*$temps)+$Phase2)))))} +Nouveau_point_Y={$centre_origine_Y+(($Amplitude3*(sin((($Frequence3*$temps)+$Phase3))))+($Amplitude4*(sin((($Frequence4*$temps)+$Phase4)))))} +if $Nb_Boucle>1 +line[-1] $Ancien_point_X,$Ancien_point_Y,$Nouveau_point_X,$Nouveau_point_Y,1,$R_Couleur_Stylo,$V_Couleur_Stylo,$B_Couleur_Stylo,$A_Couleur_Stylo +fi +Ancien_point_X=$Nouveau_point_X +Ancien_point_Y=$Nouveau_point_Y +temps+=$Increment_temps +Nb_Boucle+=1 +done +if $Dilate_Stylo>0 dilate_circ[-1] $Dilate_Stylo fi +if $Flou_Pintograph>0 blur[-1] $Flou_Pintograph,0 fi +if $Spread_Pintograph>1 spread[-1] $Spread_Pintograph fi +if $Deform_Pintograph>0 deform[-1] $Deform_Pintograph fi +gimp_blend_1651[-1,-2] $blend,1,$opacite,$Revert_layers,1 +samj_Poisson_D_Avril : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Valeur_A={round({{w+h}*$3/500})} +Valeur_K=$4 +Angle_Rotation=$5 +R_Contours=$6 +V_Contours=$7 +B_Contours=$8 +A_Contours=$9 +Affichage_Contours=$10 +R_a=$11 +V_a=$12 +B_a=$13 +A_a=$14 +R_b=$15 +V_b=$16 +B_b=$17 +A_b=$18 +Couleurs_aleatoires=$19 +Inversions=$20 +Flou=$21 +Dilatation=$22 +Deformation=$23 +Bruit=$24 +Ombre=$25 +X_Ombre=$26 +Y_Ombre=$27 +Smoothness_Ombre=$28 +Curvature_Ombre=$29 +Compensation_Decalage_Ombre_X=$30 +Compensation_Decalage_Ombre_Y=$31 +Canal_Alpha=$32 +Resolution=720 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_boucles=0 +Angle=0 +X_Poisson_A_Imprimer=0 +Y_Poisson_A_Imprimer=0 +X_Poisson_A_Imprimer_Precedent={{$X-$Valeur_A}+{$Valeur_A*{{cos(pi/180*$Angle)}+{$Valeur_K*{cos({pi/180*{$Angle/2}})}}}}} +Y_Poisson_A_Imprimer_Precedent={$Y+($Valeur_A*(sin(pi/180*$Angle)))} +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Affichage_Contours>0 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +if $Affichage_Contours==2 +ellipse[-2] $X,$Y,$Valeur_A,$Valeur_A,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +fi +repeat $Resolution +Nb_boucles+=1 +Angle={$Nb_boucles*(360/$Resolution)} +X_Poisson_A_Imprimer={{$X-$Valeur_A}+{$Valeur_A*{{cos(pi/180*$Angle)}+{$Valeur_K*{cos({pi/180*{$Angle/2}})}}}}} +Y_Poisson_A_Imprimer={$Y+($Valeur_A*(sin(pi/180*$Angle)))} +polygon[-1] 3,{$X-{2*$Valeur_A}},$Y,$X_Poisson_A_Imprimer_Precedent,$Y_Poisson_A_Imprimer_Precedent,$X_Poisson_A_Imprimer,$Y_Poisson_A_Imprimer,1,$R_a,$V_a,$B_a,$A_a +if $Affichage_Contours>0 +line[-2] $X_Poisson_A_Imprimer_Precedent,$Y_Poisson_A_Imprimer_Precedent,$X_Poisson_A_Imprimer,$Y_Poisson_A_Imprimer,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +X_Poisson_A_Imprimer_Precedent=$X_Poisson_A_Imprimer +Y_Poisson_A_Imprimer_Precedent=$Y_Poisson_A_Imprimer +done +Nb_boucles=0 +Angle=0 +X_Poisson_A_Imprimer_Precedent={{$X-$Valeur_A}+{$Valeur_A*{{cos(pi/180*$Angle)}+{$Valeur_K*{cos({pi/180*{$Angle/2}})}}}}} +Y_Poisson_A_Imprimer_Precedent={$Y-($Valeur_A*(sin(pi/180*$Angle)))} +if $Couleurs_aleatoires==1 +R_b={round(u)*255} +V_b={round(u)*255} +B_b={round(u)*255} +fi +repeat $Resolution +Nb_boucles+=1 +Angle={$Nb_boucles*(360/$Resolution)} +X_Poisson_A_Imprimer={{$X-$Valeur_A}+{$Valeur_A*{{cos(pi/180*$Angle)}+{$Valeur_K*{cos({pi/180*{$Angle/2}})}}}}} +Y_Poisson_A_Imprimer={$Y-($Valeur_A*(sin(pi/180*$Angle)))} +polygon[-1] 3,{$X-{2*$Valeur_A}},$Y,$X_Poisson_A_Imprimer_Precedent,$Y_Poisson_A_Imprimer_Precedent,$X_Poisson_A_Imprimer,$Y_Poisson_A_Imprimer,1,$R_b,$V_b,$B_b,$A_b +if $Affichage_Contours>0 +line[-2] $X_Poisson_A_Imprimer_Precedent,$Y_Poisson_A_Imprimer_Precedent,$X_Poisson_A_Imprimer,$Y_Poisson_A_Imprimer,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +X_Poisson_A_Imprimer_Precedent=$X_Poisson_A_Imprimer +Y_Poisson_A_Imprimer_Precedent=$Y_Poisson_A_Imprimer +done +if $Affichage_Contours>0 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +if $Angle_Rotation>0 rotate[-1] $Angle_Rotation,1,0,{w/2},{h/2} fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Arbre_Pythagore : +foreach { +x1={round(w/100*$1)} +y1={round(h/100*$2)} +depth_max=$3 +diff={round(w/$4)} +R_a=$5 +V_a=$6 +B_a=$7 +A_a=$8 +Variation_Couleur=$9 +Rendu=$10 +Dilatation=$11 +Rotation=$12 +Validation_Smooth_Antialias=$13 +V_Amplitude=$14 +V_Edge_Threshold=$15 +V_Smoothness=$16 +to_rgba[-1] +{w},{h},1,4 +samj_pythagoras_tree[-1] {$x1-$diff},$y1,{$x1+$diff},$y1,0,$R_a,$V_a,$B_a,$A_a,$Variation_Couleur,$depth_max,$Rendu +if $Rotation!=0 rotate[-1] $Rotation fi +dilate[-1] $Dilatation +if $Validation_Smooth_Antialias==1 fx_smooth_antialias[-1] $V_Amplitude,$V_Edge_Threshold,$V_Smoothness fi +samj_blend_20220419[-1,-2] alpha +} +samj_pythagoras_tree : +x1=$1 +y1=$2 +x2=$3 +y2=$4 +depth=$5 +R_DT=$6 +V_DT=$7 +B_DT=$8 +A_DT=$9 +Variation_Couleur=$10 +depth_max=$11 +Rendu=$12 +if $depth<$depth_max +dx={$x2-$x1} +dy={$y1-$y2} +x3={$x2-$dy} +y3={$y2-$dx} +x4={$x1-$dy} +y4={$y1-$dx} +x5={$x4+(($dx-$dy)/2)} +y5={$y4-(($dx+$dy)/2)} +if $Variation_Couleur<0 +R_DT={round(u(0,255))} +V_DT={round(u(0,255))} +B_DT={round(u(0,255))} +elif $Variation_Couleur>0 +R_DT+=$Variation_Couleur +V_DT+=$Variation_Couleur +B_DT+=$Variation_Couleur +if $R_DT>255 +R_DT={255-{$Variation_Couleur*{$depth_max-$depth}}} +fi +if $V_DT>255 +V_DT={255-{$Variation_Couleur*{$depth_max-$depth}}} +fi +if $B_DT>255 +B_DT={255-{$Variation_Couleur*{$depth_max-$depth}}} +fi +fi +if $Rendu==0 +line[-1] $x1,$y1,$x2,$y2,1,$R_DT,$V_DT,$B_DT,$A_DT +line[-1] $x2,$y2,$x3,$y3,1,$R_DT,$V_DT,$B_DT,$A_DT +line[-1] $x3,$y3,$x4,$y4,1,$R_DT,$V_DT,$B_DT,$A_DT +line[-1] $x4,$y4,$x1,$y1,1,$R_DT,$V_DT,$B_DT,$A_DT +elif $Rendu==1 +if ($depth%2)==0 +line[-1] $x1,$y1,$x2,$y2,1,$R_DT,$V_DT,$B_DT,$A_DT +line[-1] $x2,$y2,$x3,$y3,1,$R_DT,$V_DT,$B_DT,$A_DT +line[-1] $x3,$y3,$x4,$y4,1,$R_DT,$V_DT,$B_DT,$A_DT +line[-1] $x4,$y4,$x1,$y1,1,$R_DT,$V_DT,$B_DT,$A_DT +else +line[-1] $x1,$y1,$x2,$y2,1,{255-$R_DT},{255-$V_DT},{255-$B_DT},$A_DT +line[-1] $x2,$y2,$x3,$y3,1,{255-$R_DT},{255-$V_DT},{255-$B_DT},$A_DT +line[-1] $x3,$y3,$x4,$y4,1,{255-$R_DT},{255-$V_DT},{255-$B_DT},$A_DT +line[-1] $x4,$y4,$x1,$y1,1,{255-$R_DT},{255-$V_DT},{255-$B_DT},$A_DT +fi +elif $Rendu==2 +if ($depth%2)==0 +line[-1] $x1,$y1,$x2,$y2,1,{255-$R_DT},{255-$V_DT},{255-$B_DT},$A_DT +line[-1] $x2,$y2,$x3,$y3,1,{255-$R_DT},{255-$V_DT},{255-$B_DT},$A_DT +line[-1] $x3,$y3,$x4,$y4,1,{255-$R_DT},{255-$V_DT},{255-$B_DT},$A_DT +line[-1] $x4,$y4,$x1,$y1,1,{255-$R_DT},{255-$V_DT},{255-$B_DT},$A_DT +else +line[-1] $x1,$y1,$x2,$y2,1,$R_DT,$V_DT,$B_DT,$A_DT +line[-1] $x2,$y2,$x3,$y3,1,$R_DT,$V_DT,$B_DT,$A_DT +line[-1] $x3,$y3,$x4,$y4,1,$R_DT,$V_DT,$B_DT,$A_DT +line[-1] $x4,$y4,$x1,$y1,1,$R_DT,$V_DT,$B_DT,$A_DT +fi +fi +samj_pythagoras_tree[-1] $x4,$y4,$x5,$y5,{$depth+1},$R_DT,$V_DT,$B_DT,$A_DT,$Variation_Couleur,$depth_max,$Rendu +samj_pythagoras_tree[-1] $x5,$y5,$x3,$y3,{$depth+1},$R_DT,$V_DT,$B_DT,$A_DT,$Variation_Couleur,$depth_max,$Rendu +fi +samj_Rosace_Triangles_Sierpinski : +Nombre_de_zones=$1 +Nombre_de_couches=$2 +X={round({w*{$3/100}})} +Y={round({h*{$4/100}})} +if $5>0 +Rayon_Premier_Cecle={round({w*$5/{400*{2^0.5}}})} +else +Rayon_Premier_Cecle={round({-h*$5/{400*{2^0.5}}})} +fi +Decalage_Angle=$6 +Hauteur_Triangle={round({{w+h}*$7/2400})} +Recouvrement_Triangle={round({{w+h}*$8/4800})} +Angle_inclinaison=$9 +R_Contours=$10 +V_Contours=$11 +B_Contours=$12 +A_Contours=$13 +Affichage_Contours=$14 +Type_Triangles_A=$15 +Type_Triangles_B=$16 +Type_Decalage=$17 +Recursions_Sierpinski=$18 +R_Tr=$19 +V_Tr=$20 +B_Tr=$21 +A_Tr=$22 +R_Trb=$23 +V_Trb=$24 +B_Trb=$25 +A_Trb=$26 +R_Tr_B=$27 +V_Tr_B=$28 +B_Tr_B=$29 +A_Tr_B=$30 +R_Tr_Bb=$31 +V_Tr_Bb=$32 +B_Tr_Bb=$33 +A_Tr_Bb=$34 +R_Cercle=$35 +V_Cercle=$36 +B_Cercle=$37 +A_Cercle=$38 +Afficher_Cercle=$39 +Couleurs_aleatoires=$40 +Inversions=$41 +Flou=$42 +Dilatation=$43 +Deformation=$44 +Bruit=$45 +Ombre=$46 +X_Ombre=$47 +Y_Ombre=$48 +Smoothness_Ombre=$49 +Curvature_Ombre=$50 +Compensation_Decalage_Ombre_X=$51 +Compensation_Decalage_Ombre_Y=$52 +Canal_Alpha=$53 +Largeur_Origine={w} +Hauteur_Origine={h} +Angle=$Angle_inclinaison +Increment_angle={360/$Nombre_de_zones} +Rayon_Cercle_Origine=$Rayon_Premier_Cecle +Rayon_Cercle_A=0 +Rayon_Cercle_B=0 +Rayon_Cercle_C=0 +Rayon_Cercle_D=0 +H_Tr_A=0 +H_Tr_B=0 +H_Tr_C=0 +H_Tr_D=0 +Nb_Cercles=0 +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Affichage_Contours>0 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +Nb_boucles_couches=0 +repeat $Nombre_de_couches +Nb_boucles_couches+=1 +H_Tr_A={$Hauteur_Triangle*$Nb_Cercles} +Nb_Cercles+=1 +H_Tr_B={$Hauteur_Triangle*$Nb_Cercles} +Nb_Cercles+=1 +H_Tr_C={$Hauteur_Triangle*$Nb_Cercles} +Nb_Cercles+=1 +H_Tr_D={$Hauteur_Triangle*$Nb_Cercles} +Rayon_Cercle_A={$Rayon_Cercle_Origine+$H_Tr_A} +Rayon_Cercle_B={$Rayon_Cercle_Origine+$H_Tr_B} +Rayon_Cercle_C={$Rayon_Cercle_Origine+$H_Tr_C} +Rayon_Cercle_D={$Rayon_Cercle_Origine+$H_Tr_D} +Angle=$Angle_inclinaison +Nb_boucles_zones=0 +repeat $Nombre_de_zones +Nb_boucles_zones+=1 +if $Couleurs_aleatoires==1 +R_Tr={round(u)*255} +V_Tr={round(u)*255} +B_Tr={round(u)*255} +R_Trb={round(u)*255} +V_Trb={round(u)*255} +B_Trb={round(u)*255} +R_Tr_B={round(u)*255} +V_Tr_B={round(u)*255} +B_Tr_B={round(u)*255} +R_Tr_Bb={round(u)*255} +V_Tr_Bb={round(u)*255} +B_Tr_Bb={round(u)*255} +R_Cercle={round(u)*255} +V_Cercle={round(u)*255} +B_Cercle={round(u)*255} +fi +if $Type_Decalage==0 +X_A={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)+(180/$Nombre_de_zones))))))} +Y_A={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)+(180/$Nombre_de_zones))))))} +X_B={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches))))))} +Y_B={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches))))))} +X_C={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)-(180/$Nombre_de_zones))))))} +Y_C={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)-(180/$Nombre_de_zones))))))} +X_D={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)+(180/$Nombre_de_zones))))))} +Y_D={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)+(180/$Nombre_de_zones))))))} +X_E={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches))))))} +Y_E={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches))))))} +X_F={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)-(180/$Nombre_de_zones))))))} +Y_F={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)-(180/$Nombre_de_zones))))))} +X_G={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)+(180/$Nombre_de_zones))))))} +Y_G={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)+(180/$Nombre_de_zones))))))} +X_H={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches))))))} +Y_H={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches))))))} +X_I={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)-(180/$Nombre_de_zones))))))} +Y_I={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)-(180/$Nombre_de_zones))))))} +X_J={$X+(($Recouvrement_Triangle+$Rayon_Cercle_D)*(cos((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)+(180/$Nombre_de_zones))))))} +Y_J={$Y+(($Recouvrement_Triangle+$Rayon_Cercle_D)*(sin((pi/180*($Angle+($Decalage_Angle*$Nb_boucles_couches)+(180/$Nombre_de_zones))))))} +elif $Type_Decalage==1 +X_A={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-3))+(180/$Nombre_de_zones))))))} +Y_A={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-3))+(180/$Nombre_de_zones))))))} +X_B={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-3)))))))} +Y_B={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-3)))))))} +X_C={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-3))-(180/$Nombre_de_zones))))))} +Y_C={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-3))-(180/$Nombre_de_zones))))))} +X_D={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-2))+(180/$Nombre_de_zones))))))} +Y_D={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-2))+(180/$Nombre_de_zones))))))} +X_E={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-2)))))))} +Y_E={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-2)))))))} +X_F={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-2))-(180/$Nombre_de_zones))))))} +Y_F={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-2))-(180/$Nombre_de_zones))))))} +X_G={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-1))+(180/$Nombre_de_zones))))))} +Y_G={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-1))+(180/$Nombre_de_zones))))))} +X_H={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-1)))))))} +Y_H={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-1)))))))} +X_I={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-1))-(180/$Nombre_de_zones))))))} +Y_I={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle+($Decalage_Angle/3*($Nb_Cercles-1))-(180/$Nombre_de_zones))))))} +X_J={$X+(($Recouvrement_Triangle+$Rayon_Cercle_D)*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_Cercles)+(180/$Nombre_de_zones))))))} +Y_J={$Y+(($Recouvrement_Triangle+$Rayon_Cercle_D)*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_Cercles)+(180/$Nombre_de_zones))))))} +elif $Type_Decalage==2 +X_A={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-3))+(180/$Nombre_de_zones))))))} +Y_A={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-3))+(180/$Nombre_de_zones))))))} +X_B={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-3)))))))} +Y_B={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-3)))))))} +X_C={$X+($Rayon_Cercle_A*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-3))-(180/$Nombre_de_zones))))))} +Y_C={$Y+($Rayon_Cercle_A*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-3))-(180/$Nombre_de_zones))))))} +X_D={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-2))+(180/$Nombre_de_zones))))))} +Y_D={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-2))+(180/$Nombre_de_zones))))))} +X_E={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-2)))))))} +Y_E={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-2)))))))} +X_F={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-2))-(180/$Nombre_de_zones))))))} +Y_F={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-2))-(180/$Nombre_de_zones))))))} +X_G={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-1))+(180/$Nombre_de_zones))))))} +Y_G={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-1))+(180/$Nombre_de_zones))))))} +X_H={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-1)))))))} +Y_H={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-1)))))))} +X_I={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-1))-(180/$Nombre_de_zones))))))} +Y_I={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*($Nb_Cercles-1))-(180/$Nombre_de_zones))))))} +X_J={$X+(($Recouvrement_Triangle+$Rayon_Cercle_D)*(cos((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*$Nb_Cercles)+(180/$Nombre_de_zones))))))} +Y_J={$Y+(($Recouvrement_Triangle+$Rayon_Cercle_D)*(sin((pi/180*($Angle+($Decalage_Angle/3*$Nb_boucles_couches*$Nb_Cercles)+(180/$Nombre_de_zones))))))} +fi +if $Type_Triangles_A==0 +if ($Nb_boucles_couches%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_D,$Y_D,$X_H,$Y_H,$R_Tr,$V_Tr,$B_Tr,$A_Tr +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_D,$Y_D,$X_H,$Y_H,$R_Trb,$V_Trb,$B_Trb,$A_Trb +fi +if $Affichage_Contours==1||$Affichage_Contours==2||$Affichage_Contours==4||$Affichage_Contours==5 +polygon[-2] 3,$X_J,$Y_J,$X_D,$Y_D,$X_H,$Y_H,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +elif $Type_Triangles_A==1 +if ($Nb_boucles_couches%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_D,$Y_D,$X_E,$Y_E,$R_Tr,$V_Tr,$B_Tr,$A_Tr +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_D,$Y_D,$X_E,$Y_E,$R_Trb,$V_Trb,$B_Trb,$A_Trb +fi +if $Affichage_Contours==1||$Affichage_Contours==2||$Affichage_Contours==4||$Affichage_Contours==5 +polygon[-2] 3,$X_J,$Y_J,$X_D,$Y_D,$X_E,$Y_E,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +elif $Type_Triangles_A==2 +if ($Nb_boucles_couches%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_D,$Y_D,$X_B,$Y_B,$R_Tr,$V_Tr,$B_Tr,$A_Tr +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_D,$Y_D,$X_B,$Y_B,$R_Trb,$V_Trb,$B_Trb,$A_Trb +fi +if $Affichage_Contours==1||$Affichage_Contours==2||$Affichage_Contours==4||$Affichage_Contours==5 +polygon[-2] 3,$X_J,$Y_J,$X_D,$Y_D,$X_B,$Y_B,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +elif $Type_Triangles_A==3 +if ($Nb_boucles_couches%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_A,$Y_A,$X_H,$Y_H,$R_Tr,$V_Tr,$B_Tr,$A_Tr +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_A,$Y_A,$X_H,$Y_H,$R_Trb,$V_Trb,$B_Trb,$A_Trb +fi +if $Affichage_Contours==1||$Affichage_Contours==2||$Affichage_Contours==4||$Affichage_Contours==5 +polygon[-2] 3,$X_J,$Y_J,$X_A,$Y_A,$X_H,$Y_H,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +elif $Type_Triangles_A==4 +if ($Nb_boucles_couches%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_A,$Y_A,$X_E,$Y_E,$R_Tr,$V_Tr,$B_Tr,$A_Tr +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_A,$Y_A,$X_E,$Y_E,$R_Trb,$V_Trb,$B_Trb,$A_Trb +fi +if $Affichage_Contours==1||$Affichage_Contours==2||$Affichage_Contours==4||$Affichage_Contours==5 +polygon[-2] 3,$X_J,$Y_J,$X_A,$Y_A,$X_E,$Y_E,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +elif $Type_Triangles_A==5 +if ($Nb_boucles_couches%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_A,$Y_A,$X_B,$Y_B,$R_Tr,$V_Tr,$B_Tr,$A_Tr +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_J,$Y_J,$X_A,$Y_A,$X_B,$Y_B,$R_Trb,$V_Trb,$B_Trb,$A_Trb +fi +if $Affichage_Contours==1||$Affichage_Contours==2||$Affichage_Contours==4||$Affichage_Contours==5 +polygon[-2] 3,$X_J,$Y_J,$X_A,$Y_A,$X_B,$Y_B,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +fi +if $Type_Triangles_B==0 +if ($Nb_boucles_couches%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_H,$Y_H,$X_B,$Y_B,$X_I,$Y_I,$R_Tr_B,$V_Tr_B,$B_Tr_B,$A_Tr_B +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_H,$Y_H,$X_B,$Y_B,$X_I,$Y_I,$R_Tr_Bb,$V_Tr_Bb,$B_Tr_Bb,$A_Tr_Bb +fi +if $Affichage_Contours==1||$Affichage_Contours==3||$Affichage_Contours==4||$Affichage_Contours==6 +polygon[-2] 3,$X_H,$Y_H,$X_B,$Y_B,$X_I,$Y_I,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +elif $Type_Triangles_B==1 +if ($Nb_boucles_couches%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_H,$Y_H,$X_B,$Y_B,$X_F,$Y_F,$R_Tr_B,$V_Tr_B,$B_Tr_B,$A_Tr_B +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_H,$Y_H,$X_B,$Y_B,$X_F,$Y_F,$R_Tr_Bb,$V_Tr_Bb,$B_Tr_Bb,$A_Tr_Bb +fi +if $Affichage_Contours==1||$Affichage_Contours==3||$Affichage_Contours==4||$Affichage_Contours==6 +polygon[-2] 3,$X_H,$Y_H,$X_B,$Y_B,$X_F,$Y_F,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +elif $Type_Triangles_B==2 +if ($Nb_boucles_couches%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_H,$Y_H,$X_B,$Y_B,$X_C,$Y_C,$R_Tr_B,$V_Tr_B,$B_Tr_B,$A_Tr_B +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_H,$Y_H,$X_B,$Y_B,$X_C,$Y_C,$R_Tr_Bb,$V_Tr_Bb,$B_Tr_Bb,$A_Tr_Bb +fi +if $Affichage_Contours==1||$Affichage_Contours==3||$Affichage_Contours==4||$Affichage_Contours==6 +polygon[-2] 3,$X_H,$Y_H,$X_B,$Y_B,$X_C,$Y_C,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +fi +Angle={$Angle_inclinaison+($Increment_angle*$Nb_boucles_zones)} +done +Nb_Cercles-=3 +H_Tr=$H_Tr_C +Rayon_Cercle_Origine=$Rayon_Cercle_D +done +if $Afficher_Cercle==1 +$Largeur_Origine,$Hauteur_Origine,1,4 +polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 +ellipse[-1] $X,$Y,$Rayon_Cercle_D,$Rayon_Cercle_D,0,1,$R_Cercle,$V_Cercle,$B_Cercle,$A_Cercle +samj_blend_20220419[-2,-1] alpha,1,1 +fi +if $Affichage_Contours>0 +if $Affichage_Contours>3 +ellipse[-2,-3] $X,$Y,$Rayon_Cercle_D,$Rayon_Cercle_D,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Cercles_Qui_Tournent : +Dimension=$1 +R_fond=$2 +V_fond=$3 +B_fond=$4 +A_fond=$5 +Exemples=$6 +Cax=$7 +Cbx=$8 +Ccx=$9 +Vbx=$10 +Vcx=$11 +Cay=$12 +Cby=$13 +Ccy=$14 +Vby=$15 +Vcy=$16 +Egalite_Param_X_Y=$17 +Theta=$18 +R_a=$19 +V_a=$20 +B_a=$21 +A_a=$22 +Angle_Rotation=$23 +Couleurs_aleatoires=$24 +Flou=$25 +Dilatation=$26 +Deformation=$27 +Bruit=$28 +Ombre=$29 +X_Ombre=$30 +Y_Ombre=$31 +Smoothness_Ombre=$32 +Curvature_Ombre=$33 +if $Exemples==1 +Egalite_Param_X_Y=1 +Cax=1 +Cbx=0.5 +Ccx=0.25 +Vbx=7 +Vcx=21 +Theta=1000 +elif $Exemples==2 +Egalite_Param_X_Y=1 +Cax=1 +Cbx=5 +Ccx=2 +Vbx=3 +Vcx=10 +Theta=4693 +elif $Exemples==3 +Egalite_Param_X_Y=0 +Cax=1 +Cbx=0.5 +Ccx=0.33 +Vbx=7 +Vcx=17 +Cay=1 +Cby=0.5 +Ccy=0.33 +Vby=11 +Vcy=17 +Theta=4886 +elif $Exemples==4 +Egalite_Param_X_Y=0 +Cax=1 +Cbx=0.5 +Ccx=0.33 +Vbx=7 +Vcx=17 +Cay=1 +Cby=0.5 +Ccy=0.33 +Vby=7 +Vcy=3 +Theta=4520 +elif $Exemples==5 +Egalite_Param_X_Y=0 +Cax=1 +Cbx=0.5 +Ccx=0.25 +Vbx=1 +Vcx=6 +Cay=0.8 +Cby=0.2 +Ccy=1 +Vby=9 +Vcy=12 +Theta=493 +elif $Exemples==6 +Egalite_Param_X_Y=1 +Cax=1 +Cbx=0.5 +Ccx=0.33 +Vbx=-5 +Vcx=17 +Theta=10 +fi +if $Egalite_Param_X_Y==1 +Cay=$Cax +Cby=$Cbx +Ccy=$Ccx +Vby=$Vbx +Vcy=$Vcx +fi +rm[-1] +$Dimension,$Dimension,1,4 +fill_color[-1] 0,0,0,0 +fx_equation_parametric[-1] "(cos(t)*"$Cax")+("$Cbx"*cos("$Vbx"*t))+((cos(("{pi/2}")-("$Vcx"*t)))*"$Ccx")","(sin(t)*"$Cay")+("$Cby"*sin("$Vby"*t))+((sin(("{pi/2}")-("$Vcy"*t)))*"$Ccy")",0,$Theta,$Dimension,1,1,0,0,0,0,0,0,1,0,0 +to_rgba[-1] +replace_color[-1] 0%,0,255,255,255,255,0,0,0,0 +replace_color[-1] 0%,0,0,0,0,255,$R_a,$V_a,$B_a,$A_a +if $Couleurs_aleatoires==0 +replace_color[-1] 0%,0,0,0,0,255,$R_a,$V_a,$B_a,$A_a +else +$Dimension,$Dimension,1,4 +fill_color[-1] 0,0,0,0 +fx_corner_gradient[-1] {round(u)*255},{round(u)*255},{round(u)*255},255,{round(u)*255},{round(u)*255},{round(u)*255},255,{round(u)*255},{round(u)*255},{round(u)*255},255,{round(u)*255},{round(u)*255},{round(u)*255},255 +samj_blend_20220419[-1,-2] add,1,0 +to_rgba[-1] +fi +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +fi +if $Angle_Rotation>0 rotate[-1] $Angle_Rotation,1,0,{$Dimension/2},{$Dimension/2} fi +$Dimension,$Dimension,1,4 +fill_color[-1] $R_fond,$V_fond,$B_fond,$A_fond +if $Bruit>0 apply_channels[-1] "fx_noise "$Bruit",0,22,1",1 fi +gimp_blend_1651[-2,-1] 1,0,1,0,1 +samj_Lignes_Colonnes : +to_rgba +if $3==0||$3==1 +IncX={w/$1} +Xorg=0 +Yorg=0 +Xfin=0 +Yfin={h} +repeat $1 +line $Xorg,$Yorg,$Xfin,$Yfin,1,$4,$5,$6,$7 +Xorg+=$IncX +Xfin+=$IncX +done +fi +if $3==0||$3==2 +IncY={h/$2} +Xorg=0 +Yorg=0 +Xfin={w} +Yfin=0 +repeat $2 +line $Xorg,$Yorg,$Xfin,$Yfin,1,$4,$5,$6,$7 +Yorg+=$IncY +Yfin+=$IncY +done +fi +samj_Formes_Geometriques_Simples : +X_Position={round({w*{$1/100}})} +Y_Position={round({h*{$2/100}})} +R_Externe=$3 +V_Externe=$4 +B_Externe=$5 +A_Externe=$6 +R_Interne=$7 +V_Interne=$8 +B_Interne=$9 +A_Interne=$10 +R_Contour=$11 +V_Contour=$12 +B_Contour=$13 +A_Contour=$14 +Forme=$15 +Dimension_Un={round({w*{$16/100}})} +Dimension_Deux={round({h*{$17/100}})} +Nb_Cotes=$18 +Angle_Inclinaison=$19 +Dilatation=$20 +Melange=$21 +Largeur_Origine={w} +Hauteur_Origine={h} +Valeur_Angle=0 +Nb_Boucles=0 +Rayon_Cercle_Circonscrit=0 +if $Forme==0 +Rayon_Cercle_Circonscrit=$Dimension_Un +elif $Forme==1 +Rayon_Cercle_Circonscrit=$Dimension_Deux +elif $Forme==3 +Rayon_Cercle_Circonscrit=$Dimension_Un +if $Nb_Cotes<5 Nb_Cotes=5 fi +elif $Forme==4 +Rayon_Cercle_Circonscrit=$Dimension_Deux +if $Nb_Cotes<5 Nb_Cotes=5 fi +elif $Forme==5 +Rayon_Cercle_Circonscrit=$Dimension_Un +if $Nb_Cotes<5 Nb_Cotes=5 fi +elif $Forme==6 +Rayon_Cercle_Circonscrit=$Dimension_Deux +if $Nb_Cotes<5 Nb_Cotes=5 fi +fi +if $Melange==0 +rm[-1] +else +to_rgba[-1] +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +fill_color[-1] $R_Externe,$V_Externe,$B_Externe,$A_Externe +if $Forme==2 +ellipse[-1] $X_Position,$Y_Position,$Dimension_Un,$Dimension_Deux,$Angle_Inclinaison,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +ellipse[-1] $X_Position,$Y_Position,$Dimension_Un,$Dimension_Deux,$Angle_Inclinaison,1,0xFFFFFFFF,$R_Contour,$V_Contour,$B_Contour,$A_Contour +else +repeat $Nb_Cotes +Nb_Boucles+=1 +if $Nb_Boucles==1 +X_a={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_a={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==2 +X_b={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_b={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==3 +X_c={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_c={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==4 +X_d={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_d={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==5 +X_e={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_e={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==6 +X_f={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_f={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==7 +X_g={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_g={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==8 +X_h={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_h={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==9 +X_i={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_i={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==10 +X_j={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_j={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==11 +X_k={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_k={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==12 +X_l={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_l={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==13 +X_m={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_m={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==14 +X_n={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_n={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==15 +X_o={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_o={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==16 +X_p={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_p={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==17 +X_q={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_q={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==18 +X_r={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_r={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==19 +X_s={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_s={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==20 +X_t={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_t={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==21 +X_u={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_u={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==22 +X_v={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_v={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==23 +X_w={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_w={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==24 +X_x={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_x={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==25 +X_y={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_y={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +elif $Nb_Boucles==26 +X_z={$X_Position+(round(($Rayon_Cercle_Circonscrit*(cos((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +Y_z={$Y_Position+(round(($Rayon_Cercle_Circonscrit*(sin((pi/180*($Valeur_Angle+$Angle_Inclinaison+(360/$Nb_Cotes))))))))} +fi +Valeur_Angle+=360/$Nb_Cotes +done +fi +if $Forme==0||$Forme==1 +if $Nb_Cotes==3 +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,1,0xFFFFFFFF,$R_Contour,$V_Contour,$B_Contour,$A_Contour +elif $Nb_Cotes==4 +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,1,0xFFFFFFFF,$R_Contour,$V_Contour,$B_Contour,$A_Contour +elif $Nb_Cotes==5 +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,$X_e,$Y_e,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,$X_e,$Y_e,1,0xFFFFFFFF,$R_Contour,$V_Contour,$B_Contour,$A_Contour +elif $Nb_Cotes==6 +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,$X_e,$Y_e,$X_f,$Y_f,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,$X_e,$Y_e,$X_f,$Y_f,1,0xFFFFFFFF,$R_Contour,$V_Contour,$B_Contour,$A_Contour +elif $Nb_Cotes==7 +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,$X_e,$Y_e,$X_f,$Y_f,$X_g,$Y_g,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,$X_e,$Y_e,$X_f,$Y_f,$X_g,$Y_g,1,0xFFFFFFFF,$R_Contour,$V_Contour,$B_Contour,$A_Contour +elif $Nb_Cotes==8 +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,$X_e,$Y_e,$X_f,$Y_f,$X_g,$Y_g,$X_h,$Y_h,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,$X_e,$Y_e,$X_f,$Y_f,$X_g,$Y_g,$X_h,$Y_h,1,0xFFFFFFFF,$R_Contour,$V_Contour,$B_Contour,$A_Contour +elif $Nb_Cotes==9 +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,$X_e,$Y_e,$X_f,$Y_f,$X_g,$Y_g,$X_h,$Y_h,$X_i,$Y_i,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,$X_e,$Y_e,$X_f,$Y_f,$X_g,$Y_g,$X_h,$Y_h,$X_i,$Y_i,1,0xFFFFFFFF,$R_Contour,$V_Contour,$B_Contour,$A_Contour +elif $Nb_Cotes==10 +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,$X_e,$Y_e,$X_f,$Y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interne +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_m,$Y_m,$X_y,$Y_y,$X_l,$Y_l,$X_x,$Y_x,$X_k,$Y_k,$X_w,$Y_w,$X_j,$Y_j,$X_v,$Y_v,$X_i,$Y_i,$X_u,$Y_u,$X_h,$Y_h,$X_t,$Y_t,$X_g,$Y_g,$X_s,$Y_s,$X_f,$Y_f,$X_r,$Y_r,$X_e,$Y_e,$X_q,$Y_q,$X_d,$Y_d,$X_p,$Y_p,$X_c,$Y_c,$X_o,$Y_o,$X_b,$Y_b,$X_n,$Y_n,1,0xFFFFFFFF,$R_Contour,$V_Contour,$B_Contour,$A_Contour +elif $Nb_Cotes==6 +polygon[-1] {$Nb_Cotes/2},$X_a,$Y_a,$X_c,$Y_c,$X_e,$Y_e,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +polygon[-1] {$Nb_Cotes/2},$X_b,$Y_b,$X_d,$Y_d,$X_f,$Y_f,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +polygon[-1] {$Nb_Cotes/2},$X_a,$Y_a,$X_c,$Y_c,$X_e,$Y_e,1,0xFFFFFFFF,$R_Contour,$V_Contour,$B_Contour,$A_Contour +polygon[-1] {$Nb_Cotes/2},$X_b,$Y_b,$X_d,$Y_d,$X_f,$Y_f,1,0xFFFFFFFF,$R_Contour,$V_Contour,$B_Contour,$A_Contour +elif $Nb_Cotes==8 +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_d,$Y_d,$X_g,$Y_g,$X_b,$Y_b,$X_e,$Y_e,$X_h,$Y_h,$X_c,$Y_c,$X_f,$Y_f,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_d,$Y_d,$X_g,$Y_g,$X_b,$Y_b,$X_e,$Y_e,$X_h,$Y_h,$X_c,$Y_c,$X_f,$Y_f,1,0xFFFFFFFF,$R_Contour,$V_Contour,$B_Contour,$A_Contour +elif $Nb_Cotes==10 +polygon[-1] $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Y_x,$X_k,$Y_k,$X_w,$Y_w,$X_j,$Y_j,$X_v,$Y_v,$X_i,$Y_i,$X_u,$Y_u,$X_h,$Y_h,$X_t,$Y_t,$X_g,$Y_g,$X_s,$Y_s,$X_f,$Y_f,$X_r,$Y_r,$X_e,$Y_e,$X_q,$Y_q,$X_d,$Y_d,$X_p,$Y_p,$X_c,$Y_c,$X_o,$Y_o,$X_b,$Y_b,$X_n,$Y_n,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +elif $Nb_Cotes==6 +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,$X_e,$Y_e,$X_f,$Y_f,1,$R_Contour,$V_Contour,$B_Contour,$A_Contour +polygon[-1] {$Nb_Cotes/2},$X_a,$Y_a,$X_c,$Y_c,$X_e,$Y_e,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +polygon[-1] {$Nb_Cotes/2},$X_b,$Y_b,$X_d,$Y_d,$X_f,$Y_f,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +elif $Nb_Cotes==8 +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,$X_e,$Y_e,$X_f,$Y_f,$X_g,$Y_g,$X_h,$Y_h,1,$R_Contour,$V_Contour,$B_Contour,$A_Contour +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_d,$Y_d,$X_g,$Y_g,$X_b,$Y_b,$X_e,$Y_e,$X_h,$Y_h,$X_c,$Y_c,$X_f,$Y_f,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +elif $Nb_Cotes==10 +polygon[-1] $Nb_Cotes,$X_a,$Y_a,$X_b,$Y_b,$X_c,$Y_c,$X_d,$Y_d,$X_e,$Y_e,$X_f,$Y_f,$X_g,$Y_g,$X_h,$Y_h,$X_i,$Y_i,$X_j,$Y_j,1,$R_Contour,$V_Contour,$B_Contour,$A_Contour +polygon[-1] $Nb_Cotes,$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_d,$Y_d,$X_o,$Y_o,$X_z,$Y_z,$X_k,$Y_k,$X_v,$Y_v,$X_g,$Y_g,$X_r,$Y_r,$X_c,$Y_c,$X_n,$Y_n,$X_y,$Y_y,$X_j,$Y_j,$X_u,$Y_u,$X_f,$Y_f,$X_q,$Y_q,$X_b,$Y_b,$X_m,$Y_m,$X_x,$Y_x,$X_i,$Y_i,$X_t,$Y_t,$X_e,$Y_e,$X_p,$Y_p,1,$R_Interne,$V_Interne,$B_Interne,$A_Interne +fi +fi +if $Dilatation>1 +dilate_circ[-1] $Dilatation +fi +if $Melange==1 +samj_blend_20220419[-1,-2] alpha,1,0 +fi +samj_en_Formes_Geometriques_Simples : +samj_Formes_Geometriques_Simples $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21 +samj_Flocon_De_Neige : +X={round({w*{$1/100}})} +Y={round({h*{$2/100}})} +Nb_Branches=$3 +if $4>0 +Rayon_cercle_exterieur_flocon={round({w*$4/{100}})} +else +Rayon_cercle_exterieur_flocon={round({-h*$4/{100}})} +fi +Rayon_Cercle_Milieu={round($Rayon_cercle_exterieur_flocon*2)} +Rayon_Cercle_Milieu={round($Rayon_cercle_exterieur_flocon*$5/100)} +Angle_inclinaison=$6 +Recursions_Contours=$7 +R_Contours=$8 +V_Contours=$9 +B_Contours=$10 +Opacity_Contours=$11 +Affichage_Contours=$12 +Recursions_Flocon=$13 +R_F=$14 +V_F=$15 +B_F=$16 +Opacity_Flocon=$17 +Type_Flocon=$18 +Couleurs_aleatoires=$19 +Inversions=$20 +Flou=$21 +Dilatation=$22 +Deformation=$23 +Bruit=$24 +Ombre=$25 +X_Ombre=$26 +Y_Ombre=$27 +Smoothness_Ombre=$28 +Curvature_Ombre=$29 +Compensation_Decalage_Ombre_X=$30 +Compensation_Decalage_Ombre_Y=$31 +Canal_Alpha=$32 +Largeur_Origine={w} +Hauteur_Origine={h} +Angle_Theta={360/$Nb_Branches} +Nb_boucles=0 +X_ext=0 +Y_ext=0 +X_exta=0 +Y_exta=0 +X_extb=0 +Y_extb=0 +X_mil=0 +Y_mil=0 +Angle=0 +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Affichage_Contours>0 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +repeat $Nb_Branches +Angle={$Nb_boucles*$Angle_Theta} +X_ext={$X+($Rayon_cercle_exterieur_flocon*(cos((pi/180*($Angle+$Angle_inclinaison+$Angle_Theta)))))} +Y_ext={$Y+($Rayon_cercle_exterieur_flocon*(sin((pi/180*($Angle+$Angle_inclinaison+$Angle_Theta)))))} +X_exta={$X+($Rayon_cercle_exterieur_flocon/3*(cos((pi/180*($Angle+$Angle_inclinaison+$Angle_Theta)))))} +Y_exta={$Y+($Rayon_cercle_exterieur_flocon/3*(sin((pi/180*($Angle+$Angle_inclinaison+$Angle_Theta)))))} +X_extb={$X+($Rayon_cercle_exterieur_flocon/3*2*(cos((pi/180*($Angle+$Angle_inclinaison+$Angle_Theta)))))} +Y_extb={$Y+($Rayon_cercle_exterieur_flocon/3*2*(sin((pi/180*($Angle+$Angle_inclinaison+$Angle_Theta)))))} +X_mil={$X+($Rayon_Cercle_Milieu*(cos((pi/180*($Angle+$Angle_inclinaison+($Angle_Theta/2))))))} +Y_mil={$Y+($Rayon_Cercle_Milieu*(sin((pi/180*($Angle+$Angle_inclinaison+($Angle_Theta/2))))))} +Nb_boucles+=1 +if $Couleurs_aleatoires==1 +R_F={round(u)*255} +V_F={round(u)*255} +B_F={round(u)*255} +fi +if $Type_Flocon==0 +if $Affichage_Contours<2 +samj_snowflake_absolu[-1] $Recursions_Flocon,$X,$Y,$X_extb,$Y_extb,$X,$Y,$Opacity_Flocon,$R_F,$V_F,$B_F +samj_snowflake_absolu[-1] $Recursions_Flocon,$X_extb,$Y_extb,$X_ext,$Y_ext,$X_extb,$Y_extb,$Opacity_Flocon,$R_F,$V_F,$B_F +samj_snowflake_absolu[-1] $Recursions_Flocon,$X,$Y,$X_mil,$Y_mil,$X,$Y,$Opacity_Flocon,$R_F,$V_F,$B_F +fi +if $Affichage_Contours>0 +samj_snowflake_contours_absolu[-2] $Recursions_Flocon,$X,$Y,$X_extb,$Y_extb,$X,$Y,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +samj_snowflake_contours_absolu[-2] $Recursions_Flocon,$X_extb,$Y_extb,$X_ext,$Y_ext,$X_extb,$Y_extb,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +samj_snowflake_contours_absolu[-2] $Recursions_Contours,$X,$Y,$X_mil,$Y_mil,$X,$Y,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +fi +elif $Type_Flocon==1 +if $Affichage_Contours<2 +samj_snowflake_absolu[-1] $Recursions_Flocon,$X,$Y,$X_exta,$Y_exta,$X,$Y,$Opacity_Flocon,$R_F,$V_F,$B_F +samj_snowflake_absolu[-1] $Recursions_Flocon,$X_exta,$Y_exta,$X_extb,$Y_extb,$X_exta,$Y_exta,$Opacity_Flocon,$R_F,$V_F,$B_F +samj_snowflake_absolu[-1] $Recursions_Flocon,$X_extb,$Y_extb,$X_ext,$Y_ext,$X_extb,$Y_extb,$Opacity_Flocon,$R_F,$V_F,$B_F +samj_snowflake_absolu[-1] $Recursions_Flocon,$X,$Y,$X_mil,$Y_mil,$X,$Y,$Opacity_Flocon,$R_F,$V_F,$B_F +fi +if $Affichage_Contours>0 +samj_snowflake_contours_absolu[-2] $Recursions_Flocon,$X,$Y,$X_exta,$Y_exta,$X,$Y,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +samj_snowflake_contours_absolu[-2] $Recursions_Flocon,$X_exta,$Y_exta,$X_extb,$Y_extb,$X_exta,$Y_exta,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +samj_snowflake_contours_absolu[-2] $Recursions_Flocon,$X_extb,$Y_extb,$X_ext,$Y_ext,$X_extb,$Y_extb,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +samj_snowflake_contours_absolu[-2] $Recursions_Contours,$X,$Y,$X_mil,$Y_mil,$X,$Y,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +fi +elif $Type_Flocon==2 +if $Affichage_Contours<2 +samj_snowflake_absolu[-1] $Recursions_Flocon,$X,$Y,$X_ext,$Y_ext,$X,$Y,$Opacity_Flocon,$R_F,$V_F,$B_F +samj_snowflake_absolu[-1] $Recursions_Flocon,$X,$Y,$X_mil,$Y_mil,$X,$Y,$Opacity_Flocon,$R_F,$V_F,$B_F +fi +if $Affichage_Contours>0 +samj_snowflake_contours_absolu[-2] $Recursions_Contours,$X,$Y,$X_ext,$Y_ext,$X,$Y,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +samj_snowflake_contours_absolu[-2] $Recursions_Contours,$X,$Y,$X_mil,$Y_mil,$X,$Y,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +fi +elif $Type_Flocon==3 +if $Affichage_Contours<2 +samj_snowflake_absolu[-1] $Recursions_Flocon,$X,$Y,$X_extb,$Y_extb,$X,$Y,$Opacity_Flocon,$R_F,$V_F,$B_F +samj_snowflake_absolu[-1] $Recursions_Flocon,$X_extb,$Y_extb,$X_ext,$Y_ext,$X_extb,$Y_extb,$Opacity_Flocon,$R_F,$V_F,$B_F +fi +if $Affichage_Contours>0 +samj_snowflake_contours_absolu[-2] $Recursions_Flocon,$X,$Y,$X_extb,$Y_extb,$X,$Y,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +samj_snowflake_contours_absolu[-2] $Recursions_Flocon,$X_extb,$Y_extb,$X_ext,$Y_ext,$X_extb,$Y_extb,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +fi +elif $Type_Flocon==4 +if $Affichage_Contours<2 +samj_snowflake_absolu[-1] $Recursions_Flocon,$X,$Y,$X_exta,$Y_exta,$X,$Y,$Opacity_Flocon,$R_F,$V_F,$B_F +samj_snowflake_absolu[-1] $Recursions_Flocon,$X_exta,$Y_exta,$X_extb,$Y_extb,$X_exta,$Y_exta,$Opacity_Flocon,$R_F,$V_F,$B_F +samj_snowflake_absolu[-1] $Recursions_Flocon,$X_extb,$Y_extb,$X_ext,$Y_ext,$X_extb,$Y_extb,$Opacity_Flocon,$R_F,$V_F,$B_F +fi +if $Affichage_Contours>0 +samj_snowflake_contours_absolu[-2] $Recursions_Flocon,$X,$Y,$X_exta,$Y_exta,$X,$Y,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +samj_snowflake_contours_absolu[-2] $Recursions_Flocon,$X_exta,$Y_exta,$X_extb,$Y_extb,$X_exta,$Y_exta,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +samj_snowflake_contours_absolu[-2] $Recursions_Flocon,$X_extb,$Y_extb,$X_ext,$Y_ext,$X_extb,$Y_extb,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +fi +elif $Type_Flocon==5 +if $Affichage_Contours<2 +samj_snowflake_absolu[-1] $Recursions_Flocon,$X,$Y,$X_ext,$Y_ext,$X,$Y,$Opacity_Flocon,$R_F,$V_F,$B_F +fi +if $Affichage_Contours>0 +samj_snowflake_contours_absolu[-2] $Recursions_Contours,$X,$Y,$X_ext,$Y_ext,$X,$Y,$Opacity_Contours,$R_Contours,$V_Contours,$B_Contours +fi +fi +done +if $Affichage_Contours>0 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +samj_blend_20220419[-1,-2] alpha,1,0 +Spirographe_samj : +centre_origine_X={$1/100*w} +centre_origine_Y={$2/100*h} +if $3>0 +Rayon_1={w*$3/{1000}} +else +Rayon_1={-h*$3/{1000}} +fi +if $4>0 +Rayon_2={w*$4/{1000}} +else +Rayon_2={-h*$4/{1000}} +fi +if $5>0 +Position_Stylo={w*$5/{1000}} +else +Position_Stylo={-h*$5/{1000}} +fi +R_Couleur_Stylo=$6 +V_Couleur_Stylo=$7 +B_Couleur_Stylo=$8 +A_Couleur_Stylo=$9 +Variation_de_couleur=$10 +Dilate_Stylo=$11 +Nombre_de_tours=$12 +Multiplier_tours=$13 +Increment_angulaire=$14 +Diviser_Increment_angulaire=$15 +Type_de_rendu=$16 +Points_Rayon=$17 +R_Couleur_Points=$18 +V_Couleur_Points=$19 +B_Couleur_Points=$20 +A_Couleur_Points=$21 +Lignes_epaisseur=$22 +R_Couleur_Lignes=$23 +V_Couleur_Lignes=$24 +B_Couleur_Lignes=$25 +A_Couleur_Lignes=$26 +Flou_Spirographe=$27 +Spread_Spirographe=$28 +Deform_Spirographe=$29 +blend=$30 +opacite=$31 +Revert_layers=0 +to_rgba +{w},{h},1,4 +Nb_Boucle=1 +theta=0 +Ancien_point_X=0 +Nouveau_point_X=0 +Ancien_point_Y=0 +Nouveau_point_Y=0 +if $Rayon_2==0 +Rayon_2=1 +fi +if $Multiplier_tours==1 +Nombre_de_tours={$Nombre_de_tours*10} +fi +if $Multiplier_tours==2 +Nombre_de_tours={$Nombre_de_tours*100} +fi +if $Diviser_Increment_angulaire==1 +Increment_angulaire={$Increment_angulaire/10} +fi +if $Diviser_Increment_angulaire==2 +Increment_angulaire={$Increment_angulaire/100} +fi +Nombre_de_tours={$Nombre_de_tours/$Increment_angulaire*360} +R_Couleur_origine=$R_Couleur_Stylo +V_Couleur_origine=$V_Couleur_Stylo +B_Couleur_origine=$B_Couleur_Stylo +A_Couleur_origine=$A_Couleur_Stylo +if $Dilate_Stylo>0 +repeat $Nombre_de_tours +if $Variation_de_couleur==1 +R_Couleur_Stylo={round(u)*255} +V_Couleur_Stylo={round(u)*255} +B_Couleur_Stylo={round(u)*255} +fi +if $Variation_de_couleur>1 +Valeur_variation_couleur=16 +if $Variation_de_couleur==3 +Valeur_variation_couleur=32 +fi +if $Variation_de_couleur==4 +Valeur_variation_couleur=64 +fi +R_Couleur_Stylo={round({$R_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $R_Couleur_Stylo>255 +R_Couleur_Stylo=$R_Couleur_origine +fi +if $R_Couleur_Stylo<0 +R_Couleur_Stylo=$R_Couleur_origine +fi +V_Couleur_Stylo={round({$V_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $V_Couleur_Stylo>255 +V_Couleur_Stylo=$V_Couleur_origine +fi +if $V_Couleur_Stylo<0 +V_Couleur_Stylo=$V_Couleur_origine +fi +B_Couleur_Stylo={round({$B_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $B_Couleur_Stylo>255 +B_Couleur_Stylo=$B_Couleur_origine +fi +if $B_Couleur_Stylo<0 +B_Couleur_Stylo=$B_Couleur_origine +fi +fi +if $Type_de_rendu==0 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==1 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==2 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==3 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==4 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==5 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==6 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==7 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Nb_Boucle>1 +line[-1] $Ancien_point_X,$Ancien_point_Y,$Nouveau_point_X,$Nouveau_point_Y,1,$R_Couleur_Stylo,$V_Couleur_Stylo,$B_Couleur_Stylo,$A_Couleur_Stylo +fi +Ancien_point_X=$Nouveau_point_X +Ancien_point_Y=$Nouveau_point_Y +theta={$theta+$Increment_angulaire} +Nb_Boucle={$Nb_Boucle+1} +done +dilate_circ[-1] $Dilate_Stylo +Nb_Boucle=1 +theta=0 +Ancien_point_X=0 +Nouveau_point_X=0 +Ancien_point_Y=0 +Nouveau_point_Y=0 +if $Lignes_epaisseur>0||$Points_Rayon>0 +repeat $Nombre_de_tours +if $Type_de_rendu==0 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==1 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==2 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==3 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==4 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==5 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==6 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==7 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Nb_Boucle>1 +if $Lignes_epaisseur>0 +if $Points_Rayon>0 +circle[-1] $Ancien_point_X,$Ancien_point_Y,$Points_Rayon,1,$R_Couleur_Points,$V_Couleur_Points,$B_Couleur_Points,$A_Couleur_Points +fi +trait_epais_samj $Ancien_point_X,$Ancien_point_Y,$Nouveau_point_X,$Nouveau_point_Y,$Lignes_epaisseur,1,$R_Couleur_Lignes,$V_Couleur_Lignes,$B_Couleur_Lignes,$A_Couleur_Lignes +if $Points_Rayon>0 +circle[-1] $Nouveau_point_X,$Nouveau_point_Y,$Points_Rayon,1,$R_Couleur_Points,$V_Couleur_Points,$B_Couleur_Points,$A_Couleur_Points +fi +fi +if $Points_Rayon>0 +if $Variation_de_couleur==1 +R_Couleur_Points={round(u)*255} +V_Couleur_Points={round(u)*255} +B_Couleur_Points={round(u)*255} +fi +circle[-1] $Ancien_point_X,$Ancien_point_Y,$Points_Rayon,1,$R_Couleur_Points,$V_Couleur_Points,$B_Couleur_Points,$A_Couleur_Points +fi +fi +Ancien_point_X=$Nouveau_point_X +Ancien_point_Y=$Nouveau_point_Y +theta={$theta+$Increment_angulaire} +Nb_Boucle={$Nb_Boucle+1} +done +fi +else +repeat $Nombre_de_tours +if $Variation_de_couleur==1 +R_Couleur_Stylo={round(u)*255} +V_Couleur_Stylo={round(u)*255} +B_Couleur_Stylo={round(u)*255} +fi +if $Variation_de_couleur>1 +Valeur_variation_couleur=16 +if $Variation_de_couleur==3 +Valeur_variation_couleur=32 +fi +if $Variation_de_couleur==4 +Valeur_variation_couleur=64 +fi +R_Couleur_Stylo={round({$R_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $R_Couleur_Stylo>255 +R_Couleur_Stylo=$R_Couleur_origine +fi +if $R_Couleur_Stylo<0 +R_Couleur_Stylo=$R_Couleur_origine +fi +V_Couleur_Stylo={round({$V_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $V_Couleur_Stylo>255 +V_Couleur_Stylo=$V_Couleur_origine +fi +if $V_Couleur_Stylo<0 +V_Couleur_Stylo=$V_Couleur_origine +fi +B_Couleur_Stylo={round({$B_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $B_Couleur_Stylo>255 +B_Couleur_Stylo=$B_Couleur_origine +fi +if $B_Couleur_Stylo<0 +B_Couleur_Stylo=$B_Couleur_origine +fi +fi +if $Type_de_rendu==0 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==1 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==2 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==3 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1+$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1+$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==4 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==5 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1-$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==6 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{{$Rayon_2+$Position_Stylo}*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Type_de_rendu==7 +Nouveau_point_X={$centre_origine_X+{{{$Rayon_1-$Rayon_2}*{cos(pi/180*$theta)}}-{$Position_Stylo*{cos({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +Nouveau_point_Y={$centre_origine_Y+{{{$Rayon_1-$Rayon_2}*{sin(pi/180*$theta)}}-{$Position_Stylo*{sin({{$Rayon_1+$Rayon_2}/$Rayon_2}*{pi/180*$theta})}}}} +fi +if $Nb_Boucle>1 +if $Lignes_epaisseur>0 +if $Points_Rayon>0 +circle[-1] $Ancien_point_X,$Ancien_point_Y,$Points_Rayon,1,$R_Couleur_Points,$V_Couleur_Points,$B_Couleur_Points,$A_Couleur_Points +fi +trait_epais_samj $Ancien_point_X,$Ancien_point_Y,$Nouveau_point_X,$Nouveau_point_Y,$Lignes_epaisseur,1,$R_Couleur_Lignes,$V_Couleur_Lignes,$B_Couleur_Lignes,$A_Couleur_Lignes +if $Points_Rayon>0 +circle[-1] $Nouveau_point_X,$Nouveau_point_Y,$Points_Rayon,1,$R_Couleur_Points,$V_Couleur_Points,$B_Couleur_Points,$A_Couleur_Points +fi +fi +if $Lignes_epaisseur<1 +line[-1] $Ancien_point_X,$Ancien_point_Y,$Nouveau_point_X,$Nouveau_point_Y,1,$R_Couleur_Stylo,$V_Couleur_Stylo,$B_Couleur_Stylo,$A_Couleur_Stylo +fi +if $Points_Rayon>0 +if $Variation_de_couleur==1 +R_Couleur_Points={round(u)*255} +V_Couleur_Points={round(u)*255} +B_Couleur_Points={round(u)*255} +fi +circle[-1] $Ancien_point_X,$Ancien_point_Y,$Points_Rayon,1,$R_Couleur_Points,$V_Couleur_Points,$B_Couleur_Points,$A_Couleur_Points +fi +fi +Ancien_point_X=$Nouveau_point_X +Ancien_point_Y=$Nouveau_point_Y +theta={$theta+$Increment_angulaire} +Nb_Boucle={$Nb_Boucle+1} +done +fi +if $Flou_Spirographe>0 blur[-1] $Flou_Spirographe,0 fi +if $Spread_Spirographe>1 spread[-1] $Spread_Spirographe fi +if $Deform_Spirographe>0 deform[-1] $Deform_Spirographe fi +gimp_blend_1651[-1,-2] $blend,1,$opacite,$Revert_layers,1 +samj_Splines_Test : +XO={round(w/100*$1)} +YO={round(h/100*$2)} +Angle_Origine=$3 +Variation_Angle=$4 +Var_Dim=$5 +Repetition_Spline=$6 +Repetition_Dim=$7 +Inc_Angle=$8 +uA0={round({{w+h}/200*$9})} +vA0={round({{w+h}/200*$10})} +uA1={round({{w+h}/200*$11})} +vA1={round({{w+h}/200*$12})} +uB0={round({{w+h}/200*$13})} +vB0={round({{w+h}/200*$14})} +uB1={round({{w+h}/200*$15})} +vB1={round({{w+h}/200*$16})} +R_a=$17 +V_a=$18 +B_a=$19 +A_a=$20 +R_b=$21 +V_b=$22 +B_b=$23 +A_b=$24 +Dilatation=$25 +Validation_Blend=$26 +Version_Spline=$27 +deg_to_rad={pi/180} +X_Debut=$XO +Y_Debut=$YO +XF=0 +YF=0 +XA=0 +YA=0 +XB=0 +YB=0 +to_rgba[-1] +{w},{h},1,4 +repeat $Repetition_Spline +XO=$X_Debut +YO=$Y_Debut +Angle_Origine+=$Inc_Angle +repeat $Repetition_Dim +XF={$XO+(cos(($Angle_Origine+$Variation_Angle)*$deg_to_rad)*$Var_Dim)} +YF={$YO+(sin(($Angle_Origine+$Variation_Angle)*$deg_to_rad)*$Var_Dim)} +XA={round({$XO+{{$XF-$XO}/100*$uA0}})} +YA={round({$YO+{{$YF-$YO}/100*$vA0}})} +XB={round({$XF-{{$XF-$XO}/100*$uA1}})} +YB={round({$YF-{{$YF-$YO}/100*$vA1}})} +if $Version_Spline==0 +spline[-1] $XO,$YO,$XA,$YA,$XF,$YF,$XB,$YB,1,$R_a,$V_a,$B_a,$A_a +else +spline[-1] $XO,$YO,$XA,$YA,$XF,$YF,$XB,$YB,1024,1,$R_a,$V_a,$B_a,$A_a +fi +XO=$XF +YO=$YF +XF={$XO+(cos(($Angle_Origine-$Variation_Angle)*$deg_to_rad)*$Var_Dim)} +YF={$YO+(sin(($Angle_Origine-$Variation_Angle)*$deg_to_rad)*$Var_Dim)} +XA={round({$XO+{{$XF-$XO}/100*$uB0}})} +YA={round({$YO+{{$YF-$YO}/100*$vB0}})} +XB={round({$XF-{{$XF-$XO}/100*$uB1}})} +YB={round({$YF-{{$YF-$YO}/100*$vB1}})} +if $Version_Spline==0 +spline[-1] $XO,$YO,$XA,$YA,$XF,$YF,$XB,$YB,1,$R_b,$V_b,$B_b,$A_b +else +spline[-1] $XO,$YO,$XA,$YA,$XF,$YF,$XB,$YB,1024,1,$R_b,$V_b,$B_b,$A_b +fi +XO=$XF +YO=$YF +done +done +dilate[-1] $Dilatation +if $Validation_Blend==1 samj_blend_20220419[-1,-2] alpha else rv[-1,-2] fi +samj_Splines_Test_preview : +samj_Splines_Test[-1] $1,$2,$3,$4,{$5/2},$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27 +if $26==0 rm[-1] fi +samj_Des_Lignes_002 : +Nombre_Lignes=$1 +Random_Colors=$2 +Gris=$3 +R_Couleur=$4 +V_Couleur=$5 +B_Couleur=$6 +A_Couleur=$7 +Symetrie=$8 +Effet=$9 +Etendue=$10 +point_X={w/100*$11} +point_Y={h/100*$12} +Flou=$13 +Dilatation=$14 +Deformation=$15 +Bruit=$16 +Melange=$17 +Inc_L={w/{{$Nombre_Lignes+1}*$Etendue}} +Inc_H={h/{{$Nombre_Lignes+1}*$Etendue}} +Origine_L=0 +Origine_H=0 +if $Melange==1 +{w},{h},1,4 +else +to_rgba[-1] +fill_color[-1] 0,0,0,0 +fi +repeat $Nombre_Lignes +Origine_L+=$Inc_L +Origine_H+=$Inc_H +if $Random_Colors==1 +R_Couleur={round(u)*255} +V_Couleur={round(u)*255} +B_Couleur={round(u)*255} +fi +if $Gris==1 +R_Couleur={{$R_Couleur+$V_Couleur+$B_Couleur}/3} +V_Couleur=$R_Couleur +B_Couleur=$R_Couleur +fi +if $Effet==0 +line[-1] $Origine_L,0,{w},$Origine_H,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==1 +line[-1] $Origine_L,0,{w},$Origine_H,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==3 +line[-1] $Origine_L,0,{w},$Origine_H,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==5 +line[-1] $Origine_L,0,{w},$Origine_H,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==9 +line[-1] $Origine_L,0,{w},$Origine_H,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==11 +line[-1] $point_X,$point_Y,{w},$Origine_H,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +line[-1] $point_X,$point_Y,{w-$Origine_L},{h},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +line[-1] $point_X,$point_Y,0,{h-$Origine_H},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +line[-1] $point_X,$point_Y,$Origine_L,0,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +fi +if $Random_Colors==1 +R_Couleur={round(u)*255} +V_Couleur={round(u)*255} +B_Couleur={round(u)*255} +fi +if $Gris==1 +R_Couleur={{$R_Couleur+$V_Couleur+$B_Couleur}/3} +V_Couleur=$R_Couleur +B_Couleur=$R_Couleur +fi +if $Effet==0 +line[-1] {w},$Origine_H,{w-$Origine_L},{h},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==2 +line[-1] {w},$Origine_H,{w-$Origine_L},{h},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==3 +line[-1] {w},$Origine_H,{w-$Origine_L},{h},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==6 +line[-1] {w},$Origine_H,{w-$Origine_L},{h},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==10 +line[-1] {w},$Origine_H,{w-$Origine_L},{h},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +fi +if $Random_Colors==1 +R_Couleur={round(u)*255} +V_Couleur={round(u)*255} +B_Couleur={round(u)*255} +fi +if $Gris==1 +R_Couleur={{$R_Couleur+$V_Couleur+$B_Couleur}/3} +V_Couleur=$R_Couleur +B_Couleur=$R_Couleur +fi +if $Effet==0 +line[-1] {w-$Origine_L},{h},0,{h-$Origine_H},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==1 +line[-1] {w-$Origine_L},{h},0,{h-$Origine_H},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==4 +line[-1] {w-$Origine_L},{h},0,{h-$Origine_H},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==7 +line[-1] {w-$Origine_L},{h},0,{h-$Origine_H},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==10 +line[-1] {w-$Origine_L},{h},0,{h-$Origine_H},1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +fi +if $Random_Colors==1 +R_Couleur={round(u)*255} +V_Couleur={round(u)*255} +B_Couleur={round(u)*255} +fi +if $Gris==1 +R_Couleur={{$R_Couleur+$V_Couleur+$B_Couleur}/3} +V_Couleur=$R_Couleur +B_Couleur=$R_Couleur +fi +if $Effet==0 +line[-1] 0,{h-$Origine_H},$Origine_L,0,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==2 +line[-1] 0,{h-$Origine_H},$Origine_L,0,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==4 +line[-1] 0,{h-$Origine_H},$Origine_L,0,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==8 +line[-1] 0,{h-$Origine_H},$Origine_L,0,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +elif $Effet==9 +line[-1] 0,{h-$Origine_H},$Origine_L,0,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +fi +done +if $Symetrie==1 +mirror[-1] x +elif $Symetrie==2 +mirror[-1] y +elif $Symetrie==3 +mirror[-1] x +mirror[-1] y +fi +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Melange==1 +samj_blend_20220419[-1,-2] alpha,1,0 +fi +samj_Superposition_Triangles_Sierpinski : +Nombre_de_zones=$1 +Nombre_de_superpositions=$2 +X={round({w*{$3/100}})} +Y={round({h*{$4/100}})} +if $5>0 +Rayon_Premier_Cecle={round({w*$5/{200*{2^0.5}}})} +else +Rayon_Premier_Cecle={round({-h*$5/{200*{2^0.5}}})} +fi +Coeff_Superpositions=$6 +Hauteur_Triangle={round({{w+h}*$7/2400})} +Angle_inclinaison=$8 +R_Contours=$9 +V_Contours=$10 +B_Contours=$11 +A_Contours=$12 +Affichage=$13 +Recursions_Sierpinski=$14 +R_Tr=$15 +V_Tr=$16 +B_Tr=$17 +A_Tr=$18 +R_Trb=$19 +V_Trb=$20 +B_Trb=$21 +A_Trb=$22 +R_Lat=$23 +V_Lat=$24 +B_Lat=$25 +A_Lat=$26 +R_Latb=$27 +V_Latb=$28 +B_Latb=$29 +A_Latb=$30 +R_Cercle=$31 +V_Cercle=$32 +B_Cercle=$33 +A_Cercle=$34 +Afficher_Cercle=$35 +Couleurs_aleatoires=$36 +Inversions=$37 +Flou=$38 +Dilatation=$39 +Deformation=$40 +Bruit=$41 +Ombre=$42 +X_Ombre=$43 +Y_Ombre=$44 +Smoothness_Ombre=$45 +Curvature_Ombre=$46 +Compensation_Decalage_Ombre_X=$47 +Compensation_Decalage_Ombre_Y=$48 +Canal_Alpha=$49 +Largeur_Origine={w} +Hauteur_Origine={h} +Angle=$Angle_inclinaison +Increment_angle={360/$Nombre_de_zones} +Rayon_Cercle_A=$Rayon_Premier_Cecle +H_Tr=$Hauteur_Triangle +Rayon_Cercle_B=0 +Rayon_Cercle_C=0 +Rayon_Contour=0 +if $Canal_Alpha==0 +to_rgb[-1] +else +to_rgba[-1] +fi +if $Affichage>3 +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +fi +$Largeur_Origine,$Hauteur_Origine,1,4 +if $Ombre>0 polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 fi +Nb_boucles_superpositions=0 +repeat $Nombre_de_superpositions +Nb_boucles_superpositions+=1 +Nb_boucles_zones=0 +Angle=$Angle_inclinaison +repeat $Nombre_de_zones +Nb_boucles_zones+=1 +if $Couleurs_aleatoires==1 +R_Tr={round(u)*255} +V_Tr={round(u)*255} +B_Tr={round(u)*255} +R_Trb={round(u)*255} +V_Trb={round(u)*255} +B_Trb={round(u)*255} +R_Lat={round(u)*255} +V_Lat={round(u)*255} +B_Lat={round(u)*255} +R_Latb={round(u)*255} +V_Latb={round(u)*255} +B_Latb={round(u)*255} +R_Cercle={round(u)*255} +V_Cercle={round(u)*255} +B_Cercle={round(u)*255} +fi +Rayon_Cercle_B={{{$Rayon_Cercle_A*$Rayon_Cercle_A}+{{$Rayon_Cercle_A*{tan({pi/180*{180/$Nombre_de_zones}})}}*{$Rayon_Cercle_A*{tan({pi/180*{180/$Nombre_de_zones}})}}}}^0.5} +X_A={$X+(($Rayon_Cercle_A+$H_Tr)*(cos(pi/180*$Angle)))} +Y_A={$Y+(($Rayon_Cercle_A+$H_Tr)*(sin(pi/180*$Angle)))} +X_B={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle+(180/$Nombre_de_zones))))))} +Y_B={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle+(180/$Nombre_de_zones))))))} +X_C={$X+($Rayon_Cercle_B*(cos((pi/180*($Angle-(180/$Nombre_de_zones))))))} +Y_C={$Y+($Rayon_Cercle_B*(sin((pi/180*($Angle-(180/$Nombre_de_zones))))))} +Rayon_Cercle_C={{{{$Rayon_Cercle_A+$H_Tr}*{$Rayon_Cercle_A+$H_Tr}}+{{{$Rayon_Cercle_A+$H_Tr}*{tan({pi/180*{180/$Nombre_de_zones}})}}*{{$Rayon_Cercle_A+$H_Tr}*{tan({pi/180*{180/$Nombre_de_zones}})}}}}^0.5} +X_D={$X+($Rayon_Cercle_A*(cos(pi/180*$Angle)))} +Y_D={$Y+($Rayon_Cercle_A*(sin(pi/180*$Angle)))} +X_E={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle+(180/$Nombre_de_zones))))))} +Y_E={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle+(180/$Nombre_de_zones))))))} +X_F={$X+($Rayon_Cercle_C*(cos((pi/180*($Angle-(180/$Nombre_de_zones))))))} +Y_F={$Y+($Rayon_Cercle_C*(sin((pi/180*($Angle-(180/$Nombre_de_zones))))))} +if ($Affichage%2)==0 +Rayon_Contour={$Rayon_Cercle_A+$H_Tr} +if $Recursions_Sierpinski==0 +if ($Nb_boucles_superpositions%2)==0 +polygon[-1] 3,$X_A,$Y_A,$X_B,$Y_B,$X_C,$Y_C,1,$R_Tr,$V_Tr,$B_Tr,$A_Tr +else +polygon[-1] 3,$X_A,$Y_A,$X_B,$Y_B,$X_C,$Y_C,1,$R_Trb,$V_Trb,$B_Trb,$A_Trb +fi +else +if ($Nb_boucles_superpositions%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_A,$Y_A,$X_B,$Y_B,$X_C,$Y_C,$R_Tr,$V_Tr,$B_Tr,$A_Tr +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_A,$Y_A,$X_B,$Y_B,$X_C,$Y_C,$R_Trb,$V_Trb,$B_Trb,$A_Trb +fi +fi +if $Affichage==2||$Affichage==6 +if ($Nb_boucles_superpositions%2)==0 +polygon[-1] 3,$X_A,$Y_A,$X_B,$Y_B,$X_E,$Y_E,1,$R_Lat,$V_Lat,$B_Lat,$A_Lat +polygon[-1] 3,$X_A,$Y_A,$X_C,$Y_C,$X_F,$Y_F,1,$R_Lat,$V_Lat,$B_Lat,$A_Lat +else +polygon[-1] 3,$X_A,$Y_A,$X_B,$Y_B,$X_E,$Y_E,1,$R_Latb,$V_Latb,$B_Latb,$A_Latb +polygon[-1] 3,$X_A,$Y_A,$X_C,$Y_C,$X_F,$Y_F,1,$R_Latb,$V_Latb,$B_Latb,$A_Latb +fi +fi +if $Affichage>3 +polygon[-2] 3,$X_A,$Y_A,$X_B,$Y_B,$X_C,$Y_C,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +else +Rayon_Contour=$Rayon_Cercle_C +if $Recursions_Sierpinski==0 +if ($Nb_boucles_superpositions%2)==0 +polygon[-1] 3,$X_D,$Y_D,$X_E,$Y_E,$X_F,$Y_F,1,$R_Tr,$V_Tr,$B_Tr,$A_Tr +else +polygon[-1] 3,$X_D,$Y_D,$X_E,$Y_E,$X_F,$Y_F,1,$R_Trb,$V_Trb,$B_Trb,$A_Trb +fi +else +if ($Nb_boucles_superpositions%2)==0 +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_D,$Y_D,$X_E,$Y_E,$X_F,$Y_F,$R_Tr,$V_Tr,$B_Tr,$A_Tr +else +samj_sierpinski_absolu[-1] $Recursions_Sierpinski,$X_D,$Y_D,$X_E,$Y_E,$X_F,$Y_F,$R_Trb,$V_Trb,$B_Trb,$A_Trb +fi +fi +if $Affichage==3||$Affichage==7 +if ($Nb_boucles_superpositions%2)==0 +polygon[-1] 3,$X_D,$Y_D,$X_B,$Y_B,$X_E,$Y_E,1,$R_Lat,$V_Lat,$B_Lat,$A_Lat +polygon[-1] 3,$X_D,$Y_D,$X_C,$Y_C,$X_F,$Y_F,1,$R_Lat,$V_Lat,$B_Lat,$A_Lat +else +polygon[-1] 3,$X_D,$Y_D,$X_B,$Y_B,$X_E,$Y_E,1,$R_Latb,$V_Latb,$B_Latb,$A_Latb +polygon[-1] 3,$X_D,$Y_D,$X_C,$Y_C,$X_F,$Y_F,1,$R_Latb,$V_Latb,$B_Latb,$A_Latb +fi +fi +if $Affichage>3 +polygon[-2] 3,$X_D,$Y_D,$X_E,$Y_E,$X_F,$Y_F,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +fi +Angle={$Angle_inclinaison+($Increment_angle*$Nb_boucles_zones)} +done +Rayon_Cercle_A+=$H_Tr +H_Tr={$Hauteur_Triangle*$Nb_boucles_superpositions*$Coeff_Superpositions} +done +if $Afficher_Cercle==1 +$Largeur_Origine,$Hauteur_Origine,1,4 +polygon[-1] 4,0,0,{$Largeur_Origine-1},0,{$Largeur_Origine-1},{$Hauteur_Origine-1},0,{$Hauteur_Origine-1},1,0xFFFFFFFF,0,0,0,1 +ellipse[-1] $X,$Y,$Rayon_Contour,$Rayon_Contour,0,1,$R_Cercle,$V_Cercle,$B_Cercle,$A_Cercle +samj_blend_20220419[-2,-1] alpha,1,1 +if $Affichage>3 +ellipse[-2] $X,$Y,$Rayon_Contour,$Rayon_Contour,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +fi +if $Affichage>3 +if $Dilatation>1 dilate_circ[-2] $Dilatation fi +if $Flou>0 blur[-1,-2] $Flou,0 fi +if $Deformation>0 deform[-1,-2] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-2] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-2] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +samj_blend_20220419[-2,-1] alpha,1,1 +else +if $Dilatation>1 dilate_circ[-1] $Dilatation fi +if $Flou>0 blur[-1] $Flou,0 fi +if $Deformation>0 deform[-1] $Deformation fi +if $Bruit>0 fx_noise[-1] {$Bruit+50},0,22,1 fi +if $Ombre>0 +drop_shadow[-1] $X_Ombre,$Y_Ombre,$Smoothness_Ombre,$Curvature_Ombre +shift[-1] {$Compensation_Decalage_Ombre_X}%,{$Compensation_Decalage_Ombre_Y}%,0,0,0 +fi +fi +if $Inversions==1 +mirror[-1] x +elif $Inversions==2 +mirror[-1] y +elif $Inversions==3 +mirror[-1] x +mirror[-1] y +fi +samj_blend_20220419[-1,-2] alpha,1,0 +samj_Test_Visu_3D : +Choix=$1 +Fichier=$2 +Val_Elevation=$3 +R_U=$4 +R_V=$5 +R_W=$6 +R_angle=$7 +G_Size=$8 +G_Opacity=$9 +Type_Rendu=$10 +Valider_Autocrop=$11 +Dimensions_Origine=$12 +Width=$13 +Height=$14 +Object_size=$15 +X_angle=$16 +Y_angle=$17 +Z_angle=$18 +FOV=$19 +X_light=$20 +Y_light=$21 +Z_light=$22 +Specular_lightness=$23 +Specular_shininess=$24 +Rendering_mode=$25 +Antialiasing=$26 +S_Dimension=$27 +S_Zoom=$28 +S_R=$29 +S_V=$30 +S_B=$31 +S_A=$32 +Largeur_Origine={w} +Hauteur_Origine={h} +if $Choix==0 +rm[0] +input $Fichier +elif $Choix==1 +elevation3d[-1] $Val_Elevation +elif $Choix==2 +imageplane3d[-1] +elif $Choix==3 +imagecube3d[-1] +elif $Choix==4 +rm[-1] +gmic3d +fi +rotate3d[-1] $R_U,$R_V,$R_W,$R_angle +if $G_Size>0 gaussians3d[-1] $G_Size,$G_Opacity fi +if $Type_Rendu==0 +fx_render3d[-1] $Width,$Height,$Object_size,$X_angle,$Y_angle,$Z_angle,$FOV,$X_light,$Y_light,$Z_light,$Specular_lightness,$Specular_shininess,$Rendering_mode,$Antialiasing +elif $Type_Rendu==1 +snapshot3d[-1] $S_Dimension,$S_Zoom,$S_R,$S_V,$S_B,$S_A +fi +if $Valider_Autocrop==1 autocrop[-1] fi +if $Dimensions_Origine==1 resize[-1] $Largeur_Origine,$Hauteur_Origine fi +Traits_Strokes_samj: +Position_X={round({w*{$1/100}})} +Position_Y={round({h*{$2/100}})} +if $3>0 +Longueur={w*$3/{100}} +else +Longueur={-h*$3/{100}} +fi +Variations_Formes=$4 +Variations_Longueur=$5 +if $6>0 +Eloignement_du_centre={w*$6/{100}} +else +Eloignement_du_centre={-h*$6/{100}} +fi +Nombre_de_traits=$7 +Angle_Depart=$8 +Angle_Fin=$9 +R_Couleur=$10 +V_Couleur=$11 +B_Couleur=$12 +A_Couleur=$13 +Variation_de_couleur=$14 +Epaisseur=$15 +Symetrie=$16 +Pourcent_Longueur_Sym=$17 +Flou_traits=$18 +Spread_traits=$19 +Deform_traits=$20 +blend=$21 +opacite=$22 +Revert_layers=0 +to_rgba +{w},{h},1,4 +Angle=$Angle_Depart +if $Angle_Depart>$Angle_Fin +Angle_Fin+=360 +fi +increment_theta={{$Angle_Fin-$Angle_Depart}/$Nombre_de_traits} +if $Variations_Formes==1 +Variation={{$Longueur/100*$Variations_Longueur}/$Nombre_de_traits} +fi +if $Variations_Formes==2 +Variation={{-$Longueur/1000*$Variations_Longueur}/$Nombre_de_traits} +fi +if $Variations_Formes==3 +Variation={{$Longueur/100*$Variations_Longueur}/{$Nombre_de_traits/2}} +fi +if $Variations_Formes==4 +Variation={{-$Longueur/1000*$Variations_Longueur}/{$Nombre_de_traits/2}} +fi +Longueur_calculee=$Longueur +Nb_Boucle=1 +R_Couleur_origine=$R_Couleur +V_Couleur_origine=$V_Couleur +B_Couleur_origine=$B_Couleur +A_Couleur_origine=$A_Couleur +repeat $Nombre_de_traits +if $Variation_de_couleur==1 +R_Couleur={round(u)*255} +V_Couleur={round(u)*255} +B_Couleur={round(u)*255} +A_Couleur={{round(u)*200}+55} +fi +if $Variation_de_couleur>1 +Valeur_variation_couleur=16 +if $Variation_de_couleur==3 +Valeur_variation_couleur=32 +fi +if $Variation_de_couleur==4 +Valeur_variation_couleur=64 +fi +R_Couleur={round({$R_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $R_Couleur>255 +R_Couleur=$R_Couleur_origine +fi +if $R_Couleur<0 +R_Couleur=$R_Couleur_origine +fi +V_Couleur={round({$V_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $V_Couleur>255 +V_Couleur=$V_Couleur_origine +fi +if $V_Couleur<0 +V_Couleur=$V_Couleur_origine +fi +B_Couleur={round({$B_Couleur_origine+{u(-$Valeur_variation_couleur,$Valeur_variation_couleur)}})} +if $B_Couleur>255 +B_Couleur=$B_Couleur_origine +fi +if $B_Couleur<0 +B_Couleur=$B_Couleur_origine +fi +fi +Debut_X={$Position_X+(round(cos(pi/180*$Angle)*$Eloignement_du_centre))} +Debut_Y={$Position_Y+(round(sin(pi/180*$Angle)*$Eloignement_du_centre))} +Extremite_X={$Position_X+(round(cos(pi/180*$Angle)*($Longueur_calculee+$Eloignement_du_centre)))} +Extremite_Y={$Position_Y+(round(sin(pi/180*$Angle)*($Longueur_calculee+$Eloignement_du_centre)))} +line[-1] $Debut_X,$Debut_Y,$Extremite_X,$Extremite_Y,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +if $Symetrie==1 +Debut_X={$Position_X+(round(cos(pi/180*($Angle+180))*$Eloignement_du_centre))} +Debut_Y={$Position_Y+(round(sin(pi/180*($Angle+180))*$Eloignement_du_centre))} +Extremite_X={$Position_X+(round(cos(pi/180*($Angle+180))*(($Longueur_calculee/100*$Pourcent_Longueur_Sym)+$Eloignement_du_centre)))} +Extremite_Y={$Position_Y+(round(sin(pi/180*($Angle+180))*(($Longueur_calculee/100*$Pourcent_Longueur_Sym)+$Eloignement_du_centre)))} +line[-1] $Debut_X,$Debut_Y,$Extremite_X,$Extremite_Y,1,$R_Couleur,$V_Couleur,$B_Couleur,$A_Couleur +fi +Angle+=$increment_theta +if $Variations_Formes==1||$Variations_Formes==2 +Longueur_calculee+=$Variation +fi +if $Variations_Formes==3||$Variations_Formes==4 +if $Nb_Boucle<{$Nombre_de_traits/2} +Longueur_calculee+=$Variation +else +Longueur_calculee-=$Variation +fi +fi +Nb_Boucle+=1 +done +if $Epaisseur>0 +dilate_circ[-1] $Epaisseur +fi +blur[-1] $Flou_traits +spread[-1] $Spread_traits +deform[-1] $Deform_traits +gimp_blend_1651[-1,-2] $blend,1,$opacite,$Revert_layers,1 +Triangles_Shades_Adjacents: +Supprimer_Calque_Origine=$1 +Position_Centre_X=$2 +Position_Centre_Y=$3 +Nombre_De_Triangles=$4 +Artefacts=$5 +Angle_Decalage_Couleurs=$6 +R_Centre=$7 +V_Centre=$8 +B_Centre=$9 +R_a=$10 +V_a=$11 +B_a=$12 +R_b=$13 +V_b=$14 +B_b=$15 +R_c=$16 +V_c=$17 +B_c=$18 +R_d=$19 +V_d=$20 +B_d=$21 +R_e=$22 +V_e=$23 +B_e=$24 +R_f=$25 +V_f=$26 +B_f=$27 +R_g=$28 +V_g=$29 +B_g=$30 +Rendu=$31 +Couleurs_aleatoires=$32 +Activer_Color_Balance=$33 +R_Neutral_color=$34 +V_Neutral_color=$35 +B_Neutral_color=$36 +Stretch_colors=$37 +Activer_Melange=$38 +Mode=$39 +Opacity=$40 +Revert_layers=$41 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_boucles=0 +Ra_en_cours=0 +Va_en_cours=0 +Ba_en_cours=0 +Rb_en_cours=0 +Vb_en_cours=0 +Bb_en_cours=0 +Rc_en_cours=0 +Vc_en_cours=0 +Bc_en_cours=0 +Rayon_De_Couleur={round({{{{$Largeur_Origine^2}+{$Hauteur_Origine^2}}^0.5}+1})} +Angle_Rayon_De_Couleur={360/$Nombre_De_Triangles} +Angle_Artefacts=0 +Angle_Rayon_De_Couleur_Ref=0 +Angle_Rayon_De_Couleur_En_Cours=0 +Angle_Rayon_De_Couleur_En_Cours_Fin=0 +if $Nombre_De_Triangles==3 Rayon_De_Couleur*=3 fi +if {$Nombre_De_Triangles-($Rendu+2)}<0 Rendu={$Nombre_De_Triangles-2} fi +if $Artefacts==-1 Angle_Artefacts={0.5-{0.1/$Nombre_De_Triangles}} else Angle_Artefacts=$Artefacts fi +to_rgba[0] +$Largeur_Origine,$Hauteur_Origine,1,3 +fill_color[-1] 0,0,0,255 +repeat $Nombre_De_Triangles +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +R_b={round(u)*255} +V_b={round(u)*255} +B_b={round(u)*255} +R_c={round(u)*255} +V_c={round(u)*255} +B_c={round(u)*255} +R_d={round(u)*255} +V_d={round(u)*255} +B_d={round(u)*255} +R_e={round(u)*255} +V_e={round(u)*255} +B_e={round(u)*255} +R_f={round(u)*255} +V_f={round(u)*255} +B_f={round(u)*255} +R_g={round(u)*255} +V_g={round(u)*255} +B_g={round(u)*255} +fi +if ($Nb_boucles%{$Rendu+2})==0 +Ra_en_cours=$R_Centre +Va_en_cours=$V_Centre +Ba_en_cours=$B_Centre +Rb_en_cours=$R_a +Vb_en_cours=$V_a +Bb_en_cours=$B_a +Rc_en_cours=$R_b +Vc_en_cours=$V_b +Bc_en_cours=$B_b +fi +if ($Nb_boucles%{$Rendu+2})==1 +Ra_en_cours=$R_Centre +Va_en_cours=$V_Centre +Ba_en_cours=$B_Centre +Rb_en_cours=$R_b +Vb_en_cours=$V_b +Bb_en_cours=$B_b +if {$Rendu==0} +Rc_en_cours=$R_a +Vc_en_cours=$V_a +Bc_en_cours=$B_a +else +Rc_en_cours=$R_c +Vc_en_cours=$V_c +Bc_en_cours=$B_c +fi +fi +if ($Nb_boucles%{$Rendu+2})==2&&$Rendu>0 +Ra_en_cours=$R_Centre +Va_en_cours=$V_Centre +Ba_en_cours=$B_Centre +Rb_en_cours=$R_c +Vb_en_cours=$V_c +Bb_en_cours=$B_c +if {$Rendu==1} +Rc_en_cours=$R_a +Vc_en_cours=$V_a +Bc_en_cours=$B_a +else +Rc_en_cours=$R_d +Vc_en_cours=$V_d +Bc_en_cours=$B_d +fi +fi +if ($Nb_boucles%{$Rendu+2})==3&&$Rendu>1 +Ra_en_cours=$R_Centre +Va_en_cours=$V_Centre +Ba_en_cours=$B_Centre +Rb_en_cours=$R_d +Vb_en_cours=$V_d +Bb_en_cours=$B_d +if {$Rendu==2} +Rc_en_cours=$R_a +Vc_en_cours=$V_a +Bc_en_cours=$B_a +else +Rc_en_cours=$R_e +Vc_en_cours=$V_e +Bc_en_cours=$B_e +fi +fi +if ($Nb_boucles%{$Rendu+2})==4&&$Rendu>2 +Ra_en_cours=$R_Centre +Va_en_cours=$V_Centre +Ba_en_cours=$B_Centre +Rb_en_cours=$R_e +Vb_en_cours=$V_e +Bb_en_cours=$B_e +if {$Rendu==3} +Rc_en_cours=$R_a +Vc_en_cours=$V_a +Bc_en_cours=$B_a +else +Rc_en_cours=$R_f +Vc_en_cours=$V_f +Bc_en_cours=$B_f +fi +fi +if ($Nb_boucles%{$Rendu+2})==5&&$Rendu>3 +Ra_en_cours=$R_Centre +Va_en_cours=$V_Centre +Ba_en_cours=$B_Centre +Rb_en_cours=$R_f +Vb_en_cours=$V_f +Bb_en_cours=$B_f +if {$Rendu==4} +Rb_en_cours=$R_a +Vb_en_cours=$V_a +Bb_en_cours=$B_a +else +Rc_en_cours=$R_g +Vc_en_cours=$V_g +Bc_en_cours=$B_g +fi +fi +if ($Nb_boucles%{$Rendu+2})==6&&$Rendu>4 +R_en_cours=$R_g +V_en_cours=$V_g +B_en_cours=$B_g +fi +Angle_Rayon_De_Couleur_Ref={{$Nb_boucles*$Angle_Rayon_De_Couleur}+$Angle_Decalage_Couleurs+$Angle_Artefacts} +if $Nb_boucles==0 +else +fi +Angle_Rayon_De_Couleur_En_Cours={$Angle_Rayon_De_Couleur_Ref-$Angle_Artefacts} +Angle_Rayon_De_Couleur_En_Cours_Fin={$Angle_Rayon_De_Couleur_Ref+$Angle_Rayon_De_Couleur+$Angle_Artefacts} +triangle_shade[-1] {$Position_Centre_X*$Largeur_Origine/100},{$Position_Centre_Y*$Hauteur_Origine/100},{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*{$Angle_Rayon_De_Couleur_En_Cours}})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*{$Angle_Rayon_De_Couleur_En_Cours}})}}},{{w/2}+{$Rayon_De_Couleur*{cos({pi/180*{$Angle_Rayon_De_Couleur_En_Cours_Fin}})}}},{{h/2}+{$Rayon_De_Couleur*{sin({pi/180*{$Angle_Rayon_De_Couleur_En_Cours_Fin}})}}},$Ra_en_cours,$Va_en_cours,$Ba_en_cours,$Rb_en_cours,$Vb_en_cours,$Bb_en_cours,$Rc_en_cours,$Vc_en_cours,$Bc_en_cours +Nb_boucles+=1 +done +if $Activer_Color_Balance==1 +fx_balance_gamma[-1] $R_Neutral_color,$V_Neutral_color,$B_Neutral_color,$Stretch_colors=$34 +fi +if $Supprimer_Calque_Origine==1 +rm[0] +else +if $Activer_Melange==1 +if $Revert_layers==1 +rv[-1,-2] +fi +gimp_blend_1651[-2,-1] $Mode,0,$Opacity,0 +else +rv[-1,-2] +fi +fi +Twisted_Rays: +Dimension_Finale=$1 +Supprimer_Calque_Origine=$2 +Amplitude_Twirl=$3 +Melanges_Rayons=$4 +Rendu=$5 +Nb_De_Rayon_De_Couleur=$6 +Angle_Decalage_Couleurs_A=$7 +Angle_Decalage_Couleurs_B=$8 +R_a=$9 +V_a=$10 +B_a=$11 +A_a=$12 +R_b=$13 +V_b=$14 +B_b=$15 +A_b=$16 +R_c=$17 +V_c=$18 +B_c=$19 +A_c=$20 +R_d=$21 +V_d=$22 +B_d=$23 +A_d=$24 +R_e=$25 +V_e=$26 +B_e=$27 +A_e=$28 +R_f=$29 +V_f=$30 +B_f=$31 +A_f=$32 +R_g=$33 +V_g=$34 +B_g=$35 +A_g=$36 +Couleurs_aleatoires=$37 +R_Contours=$38 +V_Contours=$39 +B_Contours=$40 +A_Contours=$41 +Affichage_Contours=$42 +Dilate_Contours=$43 +Flou_Contours=$44 +Sharpen_Contours=$45 +Filtre_Symmetrizoscope=$46 +Iterations_Symmetrizoscope=$47 +Angle_Symmetrizoscope=$48 +Symmetry_Sides=$49 +Largeur_Origine={w} +Hauteur_Origine={h} +Nb_boucles=0 +Rayon_Cercle_Final={round({{$Dimension_Finale/2}-1})} +Rayon_De_Couleur={round({1+{$Dimension_Finale*{2^0.5}}})} +Angle_Rayon_De_Couleur={360/$Nb_De_Rayon_De_Couleur} +Angle_Rayon_De_Couleur_En_Cours_A=0 +Angle_Rayon_De_Couleur_En_Cours_Fin_A=0 +Angle_Rayon_De_Couleur_En_Cours_B=0 +Angle_Rayon_De_Couleur_En_Cours_Fin_B=0 +R_en_cours=0 +V_en_cours=0 +B_en_cours=0 +A_en_cours=0 +if $Supprimer_Calque_Origine==1 +rm[0] +fi +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,0 +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,0 +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,0 +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,0 +repeat $Nb_De_Rayon_De_Couleur +if $Couleurs_aleatoires==1 +R_a={round(u)*255} +V_a={round(u)*255} +B_a={round(u)*255} +R_b={round(u)*255} +V_b={round(u)*255} +B_b={round(u)*255} +R_c={round(u)*255} +V_c={round(u)*255} +B_c={round(u)*255} +R_d={round(u)*255} +V_d={round(u)*255} +B_d={round(u)*255} +R_e={round(u)*255} +V_e={round(u)*255} +B_e={round(u)*255} +R_f={round(u)*255} +V_f={round(u)*255} +B_f={round(u)*255} +R_g={round(u)*255} +V_g={round(u)*255} +B_g={round(u)*255} +fi +if ($Nb_boucles%{$Rendu+2})==0 +R_en_cours=$R_a +V_en_cours=$V_a +B_en_cours=$B_a +A_en_cours=$A_a +fi +if ($Nb_boucles%{$Rendu+2})==1 +R_en_cours=$R_b +V_en_cours=$V_b +B_en_cours=$B_b +A_en_cours=$A_b +fi +if ($Nb_boucles%{$Rendu+2})==2&&$Rendu>0 +R_en_cours=$R_c +V_en_cours=$V_c +B_en_cours=$B_c +A_en_cours=$A_c +fi +if ($Nb_boucles%{$Rendu+2})==3&&$Rendu>1 +R_en_cours=$R_d +V_en_cours=$V_d +B_en_cours=$B_d +A_en_cours=$A_d +fi +if ($Nb_boucles%{$Rendu+2})==4&&$Rendu>2 +R_en_cours=$R_e +V_en_cours=$V_e +B_en_cours=$B_e +A_en_cours=$A_e +fi +if ($Nb_boucles%{$Rendu+2})==5&&$Rendu>3 +R_en_cours=$R_f +V_en_cours=$V_f +B_en_cours=$B_f +A_en_cours=$A_f +fi +if ($Nb_boucles%{$Rendu+2})==6&&$Rendu>4 +R_en_cours=$R_g +V_en_cours=$V_g +B_en_cours=$B_g +A_en_cours=$A_g +fi +Angle_Rayon_De_Couleur_En_Cours_A={{$Nb_boucles*$Angle_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_A} +Angle_Rayon_De_Couleur_En_Cours_Fin_A={{{$Nb_boucles+1}*$Angle_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_A} +Angle_Rayon_De_Couleur_En_Cours_B={{$Nb_boucles*$Angle_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_B} +Angle_Rayon_De_Couleur_En_Cours_Fin_B={{{$Nb_boucles+1}*$Angle_Rayon_De_Couleur}+$Angle_Decalage_Couleurs_B} +polygon[-1] 3,50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos(pi/180*$Angle_Rayon_De_Couleur_En_Cours_A)}}},{{h/2}+{$Rayon_De_Couleur*{sin(pi/180*$Angle_Rayon_De_Couleur_En_Cours_A)}}},{{w/2}+{$Rayon_De_Couleur*{cos(pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin_A)}}},{{h/2}+{$Rayon_De_Couleur*{sin(pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin_A)}}},1,$R_en_cours,$V_en_cours,$B_en_cours,$A_en_cours +polygon[-2] 3,50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos(pi/180*$Angle_Rayon_De_Couleur_En_Cours_B)}}},{{h/2}+{$Rayon_De_Couleur*{sin(pi/180*$Angle_Rayon_De_Couleur_En_Cours_B)}}},{{w/2}+{$Rayon_De_Couleur*{cos(pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin_B)}}},{{h/2}+{$Rayon_De_Couleur*{sin(pi/180*$Angle_Rayon_De_Couleur_En_Cours_Fin_B)}}},1,$R_en_cours,$V_en_cours,$B_en_cours,$A_en_cours +if $Affichage_Contours==1 +line[-3] 50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos(pi/180*$Angle_Rayon_De_Couleur_En_Cours_A)}}},{{h/2}+{$Rayon_De_Couleur*{sin(pi/180*$Angle_Rayon_De_Couleur_En_Cours_A)}}},1,$R_Contours,$V_Contours,$B_Contours,$A_Contours +line[-4] 50%,50%,{{w/2}+{$Rayon_De_Couleur*{cos(pi/180*$Angle_Rayon_De_Couleur_En_Cours_B)}}},{{h/2}+{$Rayon_De_Couleur*{sin(pi/180*$Angle_Rayon_De_Couleur_En_Cours_B)}}},1,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +Nb_boucles+=1 +done +dilate_circ[-3,-4] 2 +twirl[-1,-3] $Amplitude_Twirl,50%,50%,0 +twirl[-2,-4] -$Amplitude_Twirl,50%,50%,0 +samj_blend_20220419[-3,-4] alpha,1,0 +if $Affichage_Contours==1 +ellipse[-3] 50%,50%,$Rayon_Cercle_Final,$Rayon_Cercle_Final,0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-3] 50%,50%,{$Rayon_Cercle_Final-1},{$Rayon_Cercle_Final-1},0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +ellipse[-3] 50%,50%,{$Rayon_Cercle_Final-2},{$Rayon_Cercle_Final-2},0,1,0xFFFFFFFF,$R_Contours,$V_Contours,$B_Contours,$A_Contours +fi +if $Dilate_Contours>1 dilate_circ[-3] $Dilate_Contours fi +if $Flou_Contours>0 blur[-3] $Flou_Contours,0 fi +if $Sharpen_Contours>0 sharpen[-3] $Sharpen_Contours fi +if $Filtre_Symmetrizoscope==1 +fx_symmetrizoscope[-1,-2,-3] $Iterations_Symmetrizoscope,$Angle_Symmetrizoscope,0,$Symmetry_Sides +fi +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 255,255,255,255 +circle[-1] 50%,50%,$Rayon_Cercle_Final,1,0,0,0,0 +samj_blend_20220419[-4,-1] alpha,1,0 +replace_color[-3] 100%,0,255,255,255,255,0,0,0,0 +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,0 +circle[-1] 50%,50%,$Rayon_Cercle_Final,1,0,0,0,255 +rv[-1,-3] +samj_blend_20220419[-3,-1] add,1,0 +$Dimension_Finale,$Dimension_Finale,1,4 +fill_color[-1] 0,0,0,0 +circle[-1] 50%,50%,$Rayon_Cercle_Final,1,0,0,0,255 +rv[-1,-2] +samj_blend_20220419[-2,-1] add,1,0 +if $Melanges_Rayons==0 +samj_blend_20220419[-1,-2] add,1,0 +elif $Melanges_Rayons==1 +samj_blend_20220419[-1,-2] and,1,0 +elif $Melanges_Rayons==2 +samj_blend_20220419[-1,-2] average,1,0 +elif $Melanges_Rayons==3 +samj_blend_20220419[-1,-2] darken,1,0 +elif $Melanges_Rayons==4 +samj_blend_20220419[-1,-2] difference,1,0 +elif $Melanges_Rayons==5 +samj_blend_20220419[-1,-2] edges,1,0 +elif $Melanges_Rayons==6 +samj_blend_20220419[-1,-2] grainextract,1,0 +elif $Melanges_Rayons==7 +samj_blend_20220419[-1,-2] grainmerge,1,0 +elif $Melanges_Rayons==8 +samj_blend_20220419[-1,-2] multiply,1,0 +elif $Melanges_Rayons==9 +samj_blend_20220419[-1,-2] negation,1,0 +elif $Melanges_Rayons==10 +samj_blend_20220419[-1,-2] or,1,0 +elif $Melanges_Rayons==11 +samj_blend_20220419[-1,-2] screen,1,0 +elif $Melanges_Rayons==12 +samj_blend_20220419[-1,-2] softburn,1,0 +elif $Melanges_Rayons==13 +samj_blend_20220419[-1,-2] softdodge,1,0 +elif $Melanges_Rayons==14 +samj_blend_20220419[-1,-2] subtract,1,0 +elif $Melanges_Rayons==15 +samj_blend_20220419[-1,-2] xor,1,0 +elif $Melanges_Rayons==16 +fi +c[-1,-2] 0,255 +if $Supprimer_Calque_Origine==1 +if $Melanges_Rayons==16 +rv[-3,-2,-1] +else +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha,1,0 +fi +else +if $Melanges_Rayons==16 +rv[-3,-2,-1,0] +else +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha,1,0 +rv[0,-1] +fi +fi +samj_CorLine: +Balance_Couleurs=$1 +Chroma_Couleurs=$2 +Nettete_A=$3 +Nettete_B=$4 +Type_Reparation=$5 +Amplitude_Reparation=$6 +Repetition_Reparation=$7 ++Je_passe_l_hiver_en_Floride[0] +to_rgb[-1] +fx_balance_gamma[-1] {127+$Balance_Couleurs},{127+$Balance_Couleurs},{127+$Balance_Couleurs},1 +fx_boost_chroma[-1] {$Chroma_Couleurs/100},1 +fx_unsharp_octave[-1] 1,5,$Nettete_A,0,2,0,24 +if $Type_Reparation==0 +repeat $Repetition_Reparation +fx_smooth_anisotropic[-1] $Amplitude_Reparation,0.7,0.3,0.6,1.1,0.8,30,2,0,1,1,2 +done +elif $Type_Reparation==1 +repeat $Repetition_Reparation +fx_smooth_diffusion[-1] 0.7,0.3,0.6,{0.5+{$Amplitude_Reparation/100}},15,8,0,0,24 +done +fi +if $Nettete_B>0 fx_unsharp_octave[-1] 1,5,$Nettete_B,0,2,0,24 fi +rv[-1,-2] +samj_CorLine_preview : +gui_split_preview "samj_CorLine $*",$-1 +samj_rien_sequences : +Je_passe_l_hiver_en_Floride[-1] +samj_CorLine_B: +Balance_Couleurs=$1 +Valeur_Gamma=$2 +Chroma_Couleurs=$3 +Cyan=$4 +Magenta=$5 +Jaune=$6 +Nettete_A=$7 +Nettete_B=$8 +Type_Reparation=$9 +Amplitude_Reparation=$10 +Repetition_Reparation=$11 ++Je_passe_l_hiver_en_Floride[0] +to_rgb[-1] +fx_balance_gamma[-1] {127+$Balance_Couleurs},{127+$Balance_Couleurs},{127+$Balance_Couleurs},1 +fx_boost_chroma[-1] {$Chroma_Couleurs/100},1 +fx_unsharp_octave[-1] 1,5,$Nettete_A,0,2,0,24 +apply_gamma[-1] $Valeur_Gamma +if $Type_Reparation==0 +repeat $Repetition_Reparation +fx_smooth_anisotropic[-1] $Amplitude_Reparation,0.7,0.3,0.6,1.1,0.8,30,2,0,1,1,2 +done +elif $Type_Reparation==1 +repeat $Repetition_Reparation +fx_smooth_diffusion[-1] 0.7,0.3,0.6,{0.5+{$Amplitude_Reparation/100}},15,8,0,0,24 +done +fi +if $Nettete_B>0 fx_unsharp_octave[-1] 1,5,$Nettete_B,0,2,0,24 fi +if $Cyan!=0 +Cyan={127+$Cyan} +apply_channels[-1] "apply_curve 1,0,0,128,"$Cyan",255,255",cmy_c,0 +fi +if $Magenta!=0 +Magenta={127+$Magenta} +apply_channels[-1] "apply_curve 1,0,0,128,"$Magenta",255,255",cmy_m,0 +fi +if $Jaune!=0 +Jaune={127+$Jaune} +apply_channels[-1] "apply_curve 1,0,0,128,"$Jaune",255,255",cmy_y,0 +fi +rv[-1,-2] +samj_CorLine_B_preview : +gui_split_preview "samj_CorLine_B $*",$-1 +samj_fx_spatial_transition_to_PNG : +Index=0 +repeat {{258*$!}+10} +if $Index<10 +Supprimer="_00000" +elif $Index>9&&$Index<100 +Supprimer="_0000" +elif $Index>99&&$Index<1000 +Supprimer="_000" +elif $Index>999&&$Index<10000 +Supprimer="_00" +elif $Index>9999&&$Index<100000 +Supprimer="_0" +elif $Index>99999&&$Index<1000000 +Supprimer="_" +fi +Supprimer.=$Index +Supprimer.=".png" +if '$_os'=='windows' +delete $_path_rc"\Spatial_Transition"$Supprimer +else +delete $_path_rc"/Spatial_Transition"$Supprimer +fi +Index+=1 +done +fx_spatial_transition $1,$2,$3,$4,$5,$6,$7,$8 +if '$_os'=='windows' +o $_path_rc"\Spatial_Transition.png" +else +o $_path_rc"/Spatial_Transition.png" +fi +if $9 display0[{-round($!/2)}] fi +samj_rien_various : +Je_passe_l_hiver_en_Floride[-1] +samj_transition_H_V_to_PNG : +if $!>0 +Lo={w} +Ho={h} +if $!==1 +- fi +if $3==0 +if $2==1||$2==3 rv fi +else +if $2==0||$2==2 rv fi +fi +if $2==0||$2==1 +append x +Lap={w} +Hap={h} +Int={{$Lap-$Lo}/{$1-1}} +Index=0 +repeat {$1-1} ++crop. {$Index*$Int},0,{$Lo+{$Index*$Int}-1},{$Ho-1},0 +rv[-1,-2] +Index+=1 +done ++crop[-1] {$Lap-$Lo+1},0,$Lap,{$Ho-1},0 +elif $2==2||$2==3 +append y +Lap={w} +Hap={h} +Int={{$Hap-$Ho}/{$1-1}} +Index=0 +repeat {$1-1} ++crop. 0,{$Index*$Int},{$Lo-1},{$Ho+{$Index*$Int}-1},0 +rv[-1,-2] +Index+=1 +done ++crop[-1] 0,{$Hap-$Ho+1},{$Lo-1},$Hap,0 +fi +rm[-2] +if $3==0 rv fi +Index=0 +repeat 300 +if $Index<10 +Supprimer="_00000" +elif $Index>9&&$Index<100 +Supprimer="_0000" +elif $Index>99&&$Index<1000 +Supprimer="_000" +fi +Supprimer.=$Index +Supprimer.=".png" +if '$_os'=='windows' +delete $_path_rc"\TransitionHV"$Supprimer +else +delete $_path_rc"/TransitionHV"$Supprimer +fi +Index+=1 +done +if '$_os'=='windows' +o $_path_rc"\TransitionHV.png" +else +o $_path_rc"/TransitionHV.png" +fi +if $4 display0[{-round($!/2)}] fi +fi +samj_transition_H_V_to_PNG_Preview : +if $!==1 +- fi +if $2==0||$2==2 rv fi +if $2==0||$2==1 +append x +elif $2==2||$2==3 +append y +fi +text "TransitionHV_000000.png",20,20,24,1,255,255,255,255 +samj_BoxFiter_Map : +Flou=$1 +Valeur_X=$2 +Valeur_Y=$3 +Codage=$4 +Melange=$5 +samj_Wavelet_Sharpen=$6 +Iterations_Wavelet_Sharpen=$7 +Valeur_Equalize=$8 +Valeur_Colormap=$9 +Valeur_Dithering=$10 +Autorisation_Transfer=$11 +Transfer_Luminosity_Constraints=$12 +Transfer_Gamma=0.3 +Transfer_Regularization=8 +Transfer_RGB_Resolution=16 +Transfer_Is_Constraints=0 +Val_Max_Norm=255 +if $Melange==1 Val_Max_Norm=127 fi ++Je_passe_l_hiver_en_Floride[-1] +blur[-1] $Flou ++Je_passe_l_hiver_en_Floride[-1] +boxfilter[-1] y,$Valeur_Y,1 +n[-1] 0,$Val_Max_Norm +to_graya[-1] +rv[-2,-1] +boxfilter[-1] x,$Valeur_X,1 +n[-1] 0,$Val_Max_Norm +to_graya[-1] +if $Codage==1 luminance[-1,-2] fi +if $Melange==0 samj_blend_20220419[-1,-2] alpha else samj_blend_20220419[-1,-2] add fi +to_rgb[-1] +if $samj_Wavelet_Sharpen>0 samj_Wavelet_Sharpen_Test_en[-1] {$samj_Wavelet_Sharpen-1},$Iterations_Wavelet_Sharpen fi +equalize[-1] $Valeur_Equalize,0,255 +n[-1] 0,255 +rv[-2,-1] +to_rgb[-1] +if $Autorisation_Transfer==1 Valeur_Colormap={round({{256*0.8}+{$Valeur_Colormap*0.2}})} fi +colormap[-1] $Valeur_Colormap +index[-2] [-1],$Valeur_Dithering,0 +if $Autorisation_Transfer==1 transfer_rgb[-2] [-1],$Transfer_Gamma,$Transfer_Regularization,$Transfer_Luminosity_Constraints,$Transfer_RGB_Resolution,$Transfer_Is_Constraints fi +rm[-1] +n[-1] 0,255 +samj_BoxFiter_Test : +Flou=$1 +Valeur_X=$2 +Valeur_Y=$3 +samj_Wavelet_Sharpen=$4 +Iterations_Wavelet_Sharpen=$5 +blur[-1] $Flou ++Je_passe_l_hiver_en_Floride[-1] +boxfilter[-1] y,$Valeur_Y,1 +n[-1] 0,255 +to_graya[-1] +rv[-2,-1] +boxfilter[-1] x,$Valeur_X,1 +n[-1] 0,255 +to_graya[-1] +samj_blend_20220419[-1,-2] alpha +to_graya[-1] +if $samj_Wavelet_Sharpen>0 samj_Wavelet_Sharpen_Test_en[-1] {$samj_Wavelet_Sharpen-1},$Iterations_Wavelet_Sharpen fi +n[-1] 0,255 +samj_Carres_Lignes : +Quantite=$1 +Variation=$2 +Graine=$3 +Degradation=$4 +AlphaPoly=$5 +PCL=$6 +AlphaLA=$7 +AlphaLB=$8 +DilateLignes=$9 +FR=$10 +VR=$11 +BR=$12 +AR=$13 +foreach { +MaxL={round($Quantite/100*$PCL)+1} +srand $Graine +to_rgba +{w},{h},1,4 +{w},{h},1,4 +rv +repeat $Quantite +Index=$> +Angle={round(u*90)} +Xori={round(u*{w})} +Yori={round(u*{h})} +Diag={round(u*$Variation/400*{w+h})+1} +X1p={$Xori+round($Diag*cos(pi/180*$Angle))} +Y1p={$Yori+round($Diag*sin(pi/180*$Angle))} +X2p={$Xori+round($Diag*cos(pi/180*{$Angle+90}))} +Y2p={$Yori+round($Diag*sin(pi/180*{$Angle+90}))} +X3p={$Xori+round($Diag*cos(pi/180*{$Angle+180}))} +Y3p={$Yori+round($Diag*sin(pi/180*{$Angle+180}))} +X4p={$Xori+round($Diag*cos(pi/180*{$Angle+270}))} +Y4p={$Yori+round($Diag*sin(pi/180*{$Angle+270}))} +couleur_pixel={I(#-1,$Xori,$Yori)} +Rp={arg(1,$couleur_pixel)} +Vp={arg(2,$couleur_pixel)} +Bp={arg(3,$couleur_pixel)} +Ap={arg(4,$couleur_pixel)} +polygon.. 4,$X1p,$Y1p,$X2p,$Y2p,$X3p,$Y3p,$X4p,$Y4p,1,$Rp,$Vp,$Bp,{$AlphaPoly*$Ap} +if $Index<$MaxL +a_Ligne={{$Y3p-$Y1p}/{$X3p-$X1p}} +b_Ligne={$Y3p-($a_Ligne*$X3p)} +X_Ex_a=0 +Y_Ex_a=$b_Ligne +X_Ex_b={{w}-1} +Y_Ex_b={{$a_Ligne*$X_Ex_b}+$b_Ligne} +if $Y_Ex_b>=0 line... $X_Ex_a,$Y_Ex_a,$X_Ex_b,$Y_Ex_b,1,$Rp,$Vp,$Bp,{$AlphaLA*$Ap} fi +a_Ligne={{$Y4p-$Y2p}/{$X4p-$X2p}} +b_Ligne={$Y4p-($a_Ligne*$X4p)} +X_Ex_a=0 +Y_Ex_a=$b_Ligne +X_Ex_b={{w}-1} +Y_Ex_b={{$a_Ligne*$X_Ex_b}+$b_Ligne} +if $Y_Ex_b>=0 line... $X_Ex_a,$Y_Ex_a,$X_Ex_b,$Y_Ex_b,1,$Rp,$Vp,$Bp,{$AlphaLB*$Ap} fi +fi +done +if $DilateLignes>1 dilate_circ... $DilateLignes fi +rm. +blend alpha +{w},{h},1,4 +fill_color. $FR,$VR,$BR,$AR +rv +blend alpha +if $Degradation>0 kuwahara. $Degradation fi +} +samj_CeKoaSa_001 : +Smoothness_thin_edges=$1 +Threshold_thin_edges=$2 +Amplitude_ripple=$3 +Boost=$4 +Size_morpho=$5 ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +fx_thin_edges[-1] $Smoothness_thin_edges,$Threshold_thin_edges,0 ++Je_passe_l_hiver_en_Floride[-1] +ripple[-1] $Amplitude_ripple,20,2,0 +samj_blend_20220419[-1,-2] average,1,1 +ripple[-1] {1.2*{$Amplitude_ripple}},20,2,0 +fx_edges[-2] 0,15,0,0 +samj_blend_20220419[-1,-2] average,1,1 +if $Boost==1 +fx_balance_gamma[-1] 128,128,128,1 +fi +ancien_gimp_morpho[-1] 0,$Size_morpho,0,2,0,1 +fx_normalize_local[-2] 2,6,5,20,1,3 +samj_blend_20220419[-1,-2] softlight,1,0 +fx_LCE[-1] 80,0.5,1,1,3,0 +samj_CeKoaSa_002 : +Smoothness_thin_edges=$1 +Threshold_thin_edges=$2 +Amplitude_ripple=$3 +Boost=$4 +Size_morpho=$5 +Valider_Otsu=$6 +to_rgba[-1] +fx_frame[-1] 0,100,0,100,1,1,0,0,0,255,1,255,255,255,255 +if $Valider_Otsu==1 +otsu[-1] 4 n[-1] 0,255 +fi ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +fx_thin_edges[-1] $Smoothness_thin_edges,$Threshold_thin_edges,0 ++Je_passe_l_hiver_en_Floride[-1] +ripple[-1] $Amplitude_ripple,20,2,0 +samj_blend_20220419[-1,-2] average,1,1 +ripple[-1] {1.2*{$Amplitude_ripple}},20,2,0 +fx_edges[-2] 0,15,0,0 +samj_blend_20220419[-1,-2] average,1,1 +if $Boost==1 +fx_balance_gamma[-1] 128,128,128,1 +fi +ancien_gimp_morpho[-1] 0,$Size_morpho,0,2,0,1 +fx_normalize_local[-2] 2,6,5,20,1,3 +samj_blend_20220419[-1,-2] softlight,1,0 +polygonize_GUI[-1] 10,10,10,10,10,0 +fx_LCE[-1] 80,0.5,1,1,3,0 +samj_CeKoaSa_003 : +Smoothness_thin_edges=$1 +Threshold_thin_edges=$2 +Amplitude_ripple=$3 +Boost=$4 +Size_morpho=$5 ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +fx_thin_edges[-1] $Smoothness_thin_edges,$Threshold_thin_edges,0 ++Je_passe_l_hiver_en_Floride[-1] +ripple[-1] $Amplitude_ripple,20,2,0 +samj_blend_20220419[-1,-2] average,1,1 +ripple[-1] {1.2*{$Amplitude_ripple}},20,2,0 +fx_edges[-2] 0,15,0,0 +samj_blend_20220419[-1,-2] average,1,1 +if $Boost==1 +fx_balance_gamma[-1] 128,128,128,1 +fi +ancien_gimp_morpho[-1] 0,$Size_morpho,0,2,0,1 +fx_normalize_local[-2] 2,6,5,20,1,3 +samj_blend_20220419[-1,-2] softlight,1,0 +fx_LCE[-1] 80,0.5,1,1,3,0 +polygonize_GUI[-2] 10,10,10,10,10,0 +fx_gaussian_blur[-2] 20,0,0,1,0,0 +samj_blend_20220419[-1,-2] average,0.5,1 +samj_CeKoaSa_004 : +Modulo=$1 +Negatif=$2 +B_W_pencil_amplitude=$3 +Opacity_blend_edges=$4 +Denoise_Image=$5 +to_rgb[-1] ++Je_passe_l_hiver_en_Floride[-1] +mod[-1] {20+$Modulo} +n[-1] 0,255 +fx_ditheredbw[-1] 0,1,0,0,0,0 +if $Negatif==1 +negate[-1] +fi +if $B_W_pencil_amplitude>0 +pencilbw[-1] 0.3,$B_W_pencil_amplitude +fi +fx_blend_edges[-1,-2] 1,$Opacity_blend_edges,0 +if $Denoise_Image>0 +denoise[-1] $Denoise_Image,$Denoise_Image,5,6,1,0 +fi +samj_CeKoaSa_005 : +Grille_X=$1 +Grille_Y=$2 +Grille_Carree_X=$3 +Grille_Carree_Y=$4 +Intensite=$5 +Mode_Melange=$6 +Opacity_Melange=$7 +Revert_layers_Melange=$8 +Normaliser=$9 ++Je_passe_l_hiver_en_Floride[-1] +if $Grille_Carree_X==1 +Grille_Y=$Grille_X +fi +if $Grille_Carree_Y==1 +Grille_X=$Grille_Y +fi +rand[-1] 0,255 +imagegrid[-1,-2] $Grille_X,$Grille_Y ++Je_passe_l_hiver_en_Floride[-1] +samj_blend_20220419[-1,-2] add,$Intensite,0 +gimp_blend_1651[-1,-2] $Mode_Melange,0,$Opacity_Melange,$Revert_layers_Melange,1 +if $Normaliser==1 +n[-1] 0,255 +fi +to_colormode[-1] 4 +samj_CeKoaSa_007 : +Val_Max_Patch=$1 +Val_Min_Patch=$2 +Val_Dilate=$3 +Val_Pixelize=$4 +Flou=$5 ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +max_patch[-1] $Val_Max_Patch +n[-1] 0,255 +min_patch[-2] $Val_Min_Patch +n[-2] 0,255 +dilate[-1,-2] $Val_Dilate +samj_blend_20220419[-1,-2] edges +blur[-1] $Flou +pixelize[-1,-2,-3] $Val_Pixelize,$Val_Pixelize ++luminance[-1] +samj_blend_20220419[-1,-2,-3] edges +samj_blend_20220419[-1,-2] grainmerge +samj_CeKoaSa_008: +Detection_A=$1 +Detection_B=$2 +Flou_Lissage=$3 +Couleur=$4 +Type_Rendu=$5 +Niveaux_TM=$6 +Adoucissement_TM=$7 +Edges_SG=$8 +Shading_SG=$9 +Is_Precise_SG=$10 +Intensite_SG=$11 +Isophotes_Nb_Levels=$12 +Validation_Smooth_Antialias=$13 +V_Amplitude=$14 +V_Edge_Threshold=$15 +V_Smoothness=$16 +R_a=$17 +V_a=$18 +B_a=$19 +A_a=$20 +blur[-1] $Flou_Lissage +n[-1] 0,255 +c[-1] {127-$Detection_A},{127+$Detection_B} +n[-1] 0,255 +mul[-1] $Couleur +topographic_map[-1] $Niveaux_TM,$Adoucissement_TM ++Je_passe_l_hiver_en_Floride[-1] +stained_glass[-1] $Edges_SG,$Shading_SG,$Is_Precise_SG +repeat $Intensite_SG ++Je_passe_l_hiver_en_Floride[-1] +samj_blend_20220419[-1,-2] overlay +done +if $Type_Rendu==1 +to_graya[-1] +samj_blend_20220419[-1,-2] overlay +elif $Type_Rendu==2 +to_graya[-1] +samj_blend_20220419[-1,-2] alpha +elif $Type_Rendu==3 +to_graya[-1] +samj_blend_20220419[-1,-2] edges +elif $Type_Rendu==4 +samj_blend_20220419[-1,-2] overlay +elif $Type_Rendu==5 +samj_blend_20220419[-1,-2] alpha +elif $Type_Rendu==6 +samj_blend_20220419[-1,-2] edges +elif $Type_Rendu==7 +samj_blend_20220419[-1,-2] average +fi +isophotes[-1] $Isophotes_Nb_Levels +if $Validation_Smooth_Antialias==1 fx_smooth_antialias[-1] $V_Amplitude,$V_Edge_Threshold,$V_Smoothness fi +{w},{h},1,4 +fill_color[-1] $R_a,$V_a,$B_a,$A_a +rv[-1,-2] +samj_blend_20220419[-1,-2] alpha +samj_CeKoaSa_008_preview : +gui_split_preview "samj_CeKoaSa_008 $*",$-1 +samj_CeKoaSa_009: +SM_Iterations=$1 +SM_Amplitude=$2 +SM_Sharpness=$3 +SM_Anisotropy=$4 +SM_Gradient_smoothness=$5 +SM_Tensor_smoothness=$6 +SM_Spatial_precision=$7 +SM_Angular_precision=$8 +SM_Value_precision=$9 +SM_Interpolation=$10 +SM_Fast_approximation=$11 +SC_Edge_Sensitivity=$12 +SC_Iterations=$13 +SC_Paint_effect=$14 +SC_Channels=$15 +SC_Pre_gamma=$16 +SC_Post_gamma=$17 +SC_Blacks=$18 +SC_Dark_grey=$19 +SC_Mid_grey=$20 +SC_Light_grey=$21 +SC_Whites=$22 +SC_Parallel_Processing=$23 +Wavelet_Sharpen=$24 +Wavelet_Sharpen_Type=$25 +Wavelet_Sharpen_Iterations=$26 +Script_Origine=$27 +Utiliser_courbes=$28 +if $Script_Origine==1 ++fx_smooth_anisotropic[0] 10,0.16,0.63,0.6,2.35,0.8,30,2,0,1,1,0,1 +sub[0] [1] +simplelocalcontrast_p[1] 25,1,50,1,1,1.2,1,1,1,1,1,1 +fx_graphic_novelfxl[1] 1,2,6,5,20,0,1,100,0,1,0,0.78,1.92,0,0,2,1,1,1,1.26,0.37,1.05 +add +c 0,255 +else ++Je_passe_l_hiver_en_Floride[-1] +repeat $SM_Iterations +smooth[-1] $SM_Amplitude,$SM_Sharpness,$SM_Anisotropy,$SM_Gradient_smoothness,$SM_Tensor_smoothness,$SM_Spatial_precision,$SM_Angular_precision,$SM_Value_precision,$SM_Interpolation,$SM_Fast_approximation +done +sub[-2] [-1] +simplelocalcontrast_p[-1] $SC_Edge_Sensitivity,$SC_Iterations,$SC_Paint_effect,$SC_Channels,$SC_Pre_gamma,$SC_Post_gamma,$SC_Blacks,$SC_Dark_grey,$SC_Mid_grey,$SC_Light_grey,$SC_Whites,$SC_Parallel_Processing +if $Wavelet_Sharpen==0 +samj_Wavelet_Sharpen_Test_en[-1] $Wavelet_Sharpen_Type,$Wavelet_Sharpen_Iterations +elif $Wavelet_Sharpen==0 +fx_graphic_novelfxl[-1] 1,2,6,5,20,0,1,100,0,1,0,0.78,1.92,0,0,2,1,1,1,1.26,0.37,1.05 +fi +rm[-2] +c[-1] 0,255 +fi +if $Utiliser_courbes==1 +fx_curves_interactive[-1] $29,$30,$31,$32,$33 +fi +samj_CeKoaSa_010 : +FlouA=$1 +FlouB=$2 +DiffA=$3 +DiffB=$4 +Isop=$5 +to_rgba[-1] ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +blur[-1] $FlouA +blur[-2] $FlouB +diffusiontensors[-1] 0,1,1,$DiffA,1 +diffusiontensors[-2] 0,1,1,$DiffB,1 +abs[-1,-2] +n[-1,-2] 0,255 +transfer_colors[-1] [-3] +transfer_colors[-2] [-3] +samj_blend_20220419[-1,-2] add +c[-1] 0,255 +n[-1] 0,255 +isophotes[-1] $Isop +blur[-2] {{w+h}/4} +samj_blend_20220419[-1,-2] alpha +samj_CeKoaSa_011 : +Larg={w} +Haut={h} +if $5==1 ++samj_Masque_CeKoaSa_011[-1] $1,$2,$3,$4 +samj_blend_20220419[-1,-2] average,100,0 +else +samj_Masque_CeKoaSa_011[-1] $1,$2,$3,$4 +fi +if $17==1 c[-1] $18,$19 n[-1] 0,255 fi +if $6==1 +to_rgba[-1] +$Larg,$Haut,1,4 +samj_Linear_Gradient_CIE_Lab[-1] $7,$8,$9,$10,$11,$12,$13,$14,$15,$16 +samj_blend_20220419[-1,-2] average,100,0 +fi +samj_Masque_CeKoaSa_011 : +gradient[-1] +if $2==1 ditheredbw[-1] elif $2==2 ditheredbw[-2] elif $2==3 ditheredbw[-1,-2] fi +append c +blur $1 +if $4==0 +gradient_orientation 1 +elif $4==1 +gradient_orientation 2 rm[-1] +elif $4==2 +gradient_orientation 3 rm[-1,-2] +elif $4==3 +gradient_orientation 2 rm[-2] +elif $4==4 +gradient_orientation 3 rm[-1,-2] +elif $4==5 +orientation +fi +direction2rgb +if $3==1 bump2normal fi +n 0,255 +to_gray +samj_diaporama : +if $2==0 +samj_diapo $1 +else +do +if {{*,ESC}||{*,Q}} break fi +samj_diapo $1 +while 1 +fi +rm[-$!--1] +samj_diapo : +Delai={$1*1000} +Bc=$! +do +if {{*,ESC}||{*,Q}} break fi +if {*,PAGEUP} +Bc+=2 +if $Bc>$! Bc=$! fi +fi +if {*,PAGEDOWN} Bc-=2 fi ++samj_full_screen_display[{$Bc-$!-1}] 1,,,$Delai +Bc-=1 +while $Bc>=1 +Je_passe_l_hiver_en_Floride : +samj_Layers_To_PNG : +if '$_os'=='windows' +o $_path_rc"\samj_Layers.png" +else +o $_path_rc"/samj_Layers.png" +fi +samj_Layers_To_PNG_Texte $! +samj_Layers_To_PNG_Preview : +Calques=$! +rm +samj_Layers_To_PNG_Texte $Calques +samj_Layers_To_PNG_Texte : +1500,120,1,3 +fill_color. 255,255,255 +text. "Enregistre chaque calque comme image PNG / Save all layers as PNG file.",20,20,16,1,0,0,0 +if '$_os'=='windows' +if $1==1 +text. $_path_rc"\samj_Layers.png",20,50,16,1,0,0,0 +elif $1>1 +text. $_path_rc"\samj_Layers_xxxxxx.png",20,50,16,1,0,0,0 +fi +else +if $1==1 +text. $_path_rc"/samj_Layers.png",20,50,16,1,0,0,0 +elif $1>1 +text. $_path_rc"/samj_Layers_xxxxxx.png",20,50,16,1,0,0,0 +fi +fi +if $1<2 +text. $1" Fichier/File",20,80,20,1,255,0,0 +else +text. $1" Fichiers/Files",20,80,20,1,255,0,0 +fi +autocrop. +polygonize_GUI : +if $6>0 to_rgba fx_frame 0,100,0,100,1,1,0,0,0,255,1,255,255,255,255 otsu {$6+3} n 0,255 fi +polygonize $1,$2,$3,$4,$5 +gimp_recolorize_20130115_modifie : +Smoothness=$1 +Nuances=$2 +Normalize_A=$3 +Normalize_B=$4 +Degoulinade_A=$5 +Degoulinade_B=$6 +Precision=$7 +rv[-2,-1] +dilate_circ[-1] $Degoulinade_A +if $Nuances==0 +channels[-2] 0 +elif $Nuances==1 +fx_decompose_channels[-2] 4,0,1,0 remove[-2,-3] +elif $Nuances==2 +to_rgb[-2] rgb2hsl8[-2] split[-2] c rm[-3,-4] +elif $Nuances==3 +to_rgb[-2] rgb2lab8[-2] split[-2] c rm[-2,-3] +elif $Nuances==4 +to_rgb[-2] rgb2cmyk[-2] split[-2] c rm[-3,-4,-5] negate[-2] +fi +to_rgb[-2] to_rgba[-1] +n[-2] $Normalize_A,$Normalize_B +split_opacity[-1] +neq[-1] 0 +srgb2rgb[-3,-2] +rgb2lab8[-3,-2] +channels[-3] 0 +channels[-2] 1,2 ++[-2] 1 +*[-2] [-1] ++gradient_norm[-3] +blur[-1] $Degoulinade_B +*[-1] -1 +watershed[-3] [-1] +rm[-1] +--[-2] 1 +if $Precision==1 ++diffusiontensors[-3] 0,1,1,1 +eq[-2] 0 +*[-1] [-2] +rm[-2] +smooth[-2] [-1],$Smoothness,0.8,45,2,0 +fi +rm[-1] +a[-2,-1] c +lab82rgb[-1] +rgb2srgb[-1] +samj_Relief_A : +V_variation=$1 +V_order=$2 +V_axis=$3 +V_boundary=$4 +SC_Edge_Sensitivity=$5 +SC_Iterations=$6 +SC_Paint_effect=$7 +SC_Channels=$8 +SC_Pre_gamma=$9 +SC_Post_gamma=$10 +SC_Blacks=$11 +SC_Dark_grey=$12 +SC_Mid_grey=$13 +SC_Light_grey=$14 +SC_Whites=$15 +SC_Parallel_Processing=$16 +Wavelet_Sharpen_Selection=$17 +Wavelet_Sharpen_Type_A=$18 +Wavelet_Sharpen_Iterations_A=$19 +Wavelet_Sharpen_Type_B=$20 +Wavelet_Sharpen_Iterations_B=$21 +Cut_A=$22 +Cut_B=$23 ++Je_passe_l_hiver_en_Floride[-1] +if $V_axis==0 +vanvliet[-1] $V_variation,$V_order,x,$V_boundary +elif $V_axis==1 +vanvliet[-1] $V_variation,$V_order,y,$V_boundary +elif $V_axis==2 +mirror[-1] x +vanvliet[-1] $V_variation,$V_order,x,$V_boundary +mirror[-1] x +elif $V_axis==3 +mirror[-1] y +vanvliet[-1] $V_variation,$V_order,y,$V_boundary +mirror[-1] y +fi +n[-1] 0,{{iM}-{im}} +c[-1] {{iM}/100*$Cut_A},{iM} +n[-1] 0,{iM} +c[-1] 0,{{iM}/100*$Cut_B} +n[-1] 0,255 +to_gray[-1] +if $Wavelet_Sharpen_Selection==1||$Wavelet_Sharpen_Selection==2 +samj_Wavelet_Sharpen_Test_en[-1] $Wavelet_Sharpen_Type_B,$Wavelet_Sharpen_Iterations_B +fi +simplelocalcontrast_p[-2] $SC_Edge_Sensitivity,$SC_Iterations,$SC_Paint_effect,$SC_Channels,$SC_Pre_gamma,$SC_Post_gamma,$SC_Blacks,$SC_Dark_grey,$SC_Mid_grey,$SC_Light_grey,$SC_Whites,$SC_Parallel_Processing +if $Wavelet_Sharpen_Selection==0||$Wavelet_Sharpen_Selection==2 +samj_Wavelet_Sharpen_Test_en[-2] $Wavelet_Sharpen_Type_A,$Wavelet_Sharpen_Iterations_A +fi +samj_blend_20220419[-1,-2] grainextract +samj_TSP_Segments_GUI : +foreach { +if $5>0 srand $5 fi +if $13 ++samj_TSP_Segments. $1,$2,$3,$4 +mirror.. x +samj_TSP_Segments.. $1,$2,$3,$4 +mirror.. x +blend alpha +else +samj_TSP_Segments. $1,$2,$3,$4 +fi +if $6>0 dilate_circ. {$6+1} fi +if $11 dilate. {$6+1} deform $11 fi +if $12>1 pow. $12 fi +{w},{h},1,4 fill_color. $7,$8,$9,$10 rv blend alpha +} +samj_TSP_Segments : +skip ${1=3},${2=50},${3=5},${4=1} +Flou=$1 +Masque=$2 +Variation=$3 +Echelle=$4 +to_rgba +Wor={w} +Hor={h} +{w},{h},1,4 ++samj_Masques_Noir_Et_Blanc.. $Flou,$Masque +blend[-1,-2] alpha +to_gray. +negate. +dilate. 10 +pointcloud. 3 +channels. 0,1 +resize. $Echelle%,1 +tsp. 200 +repeat w#-1 +Index=$> ++crop. $Index,0,{$Index+1},0 +X1p={i0} +Y1p={i1} +rm. +Pixel={I(#-3,$X1p,$Y1p)} +X2p={$X1p+round(u*$Variation/100*$Wor)+1} +Y2p={$Y1p+round(u*$Variation/100*$Hor)+1} +line.. $X1p,$Y1p,$X2p,$Y2p,1,$Pixel +done +rm[-1,-3] +samj_Test_Liste_Points_TSP_Splines : +skip ${1=0.5},${2=2.1},${3=1200},${4=0},${5=0},${6=0},${7=2},${8=1},${9=0} +Echelle=$1 +Deformation=$2 +Blanc=$8 +if w>h +resize. $3,{h/w*$3} +else +resize. {w/h*$3},$3 +fi +Wf={w} +Hf={h} +if $Blanc==1 +samj_Masques_Noir_Et_Blanc. 3,50 +blend alpha +to_gray. +negate. +if $9==1 dilate. 4 else dilate_circ. 15 fi +else +to_gray. +autoindex. 2 +variance_patch. 2 +dilate. 6 +fi +pointcloud. 3 +channels. 0,1 +resize. $Echelle%,1 +tsp. 200 +Iter={{w}-2} +$Wf,$Hf,1,3 +fill_color. 255,255,255 +rv +Index=0 +if $9==1 ++crop. {$Index},0,{$Index+1},0 +Xd={i0} +Yd={i1} +rm. ++crop. {$Index+1},0,{$Index+2},0 +Xu={i0} +Yu={i1} +rm. ++crop. {$Index+2},0,{$Index+3},0 +Xt={i0} +Yt={i1} +rm. +repeat $Iter ++crop. {$Index+3},0,{$Index+4},0 +Xq={i0} +Yq={i1} +rm. +Xds={$Xu+$Xu-{$Xd*$Deformation}} +Yds={$Yu+$Yu-{$Yd*$Deformation}} +Xqs={$Xt+$Xt-{$Xq*$Deformation}} +Yqs={$Yt+$Yt-{$Yq*$Deformation}} +spline.. $Xu,$Yu,$Xds,$Yds,$Xt,$Yt,$Xqs,$Yqs,1,$4,$5,$6 +Index+=1 +Xd=$Xu +Yd=$Yu +Xu=$Xt +Yu=$Yt +Xt=$Xq +Yt=$Yq +done +else +Segments=round({{$Wf+$Hf}/200}) +repeat {$Iter/3} ++crop. {$Index},0,{$Index+1},0 +Xu={i0} +Yu={i1} +rm. ++crop. {$Index+1},0,{$Index+2},0 +Xd={i0} +Yd={i1} +rm. ++crop. {$Index+2},0,{$Index+3},0 +Xt={i0} +Yt={i1} +rm. ++crop. {$Index+3},0,{$Index+4},0 +Xq={i0} +Yq={i1} +rm. +samj_Bezier_Quatre_Points.. $Xu,$Yu,$Xd,$Yd,$Xt,$Yt,$Xq,$Yq,$Segments,$4,$5,$6,255 +Index+=3 +done +fi +rm. +erode. $7 +samj_blend_20220419 : skip ${1=alpha},${2=1},${3=1},${4=0} +if ${"is_image_arg $1"} +n={narg($*)} mode=${arg\ 1+($n>=2),alpha,$2} +e[^-1] "Blend image$? with "${arg\ 1+$4,base,top}" layer $1, using '"$mode"' mode and opacity $3." +repeat $! { pass$1 l[$>,-1] { if $4 rv fi blend $mode,$3 } } return +fi +e[^-1] "Blend all image$? together, using '$1' mode and opacity $2." +repeat $!-1 { l[0,1] { +r[1] [0],[0],[0],100%,0,0,0.5,0.5 +s={"s0 = s#0<3?1:3; s1 = s<3?1:3; max(s0,s1)"} # Target color format (G or RGB). +to_colormode[0] {$s+1-(s#0%2)} # Target format (G,GA,RGB or RGBA). +to_colormode[1] {$s+1-(s%2)} +if {0,"s==2 || s==4"} +if "s==2 || s==4" +sh[0,1] 0,{s-2} _blend_$1[2,3] rm[2,3] +if ['"$1"']=='alpha' +sh[0,1] 0,{{0,s}-2} sh[0,1] 100% *[2,4] *[3,4] rm[2,3] ++channels[1] 100% sh[1] 100% f[3] 255 rm[3] +j[0] [1],0,0,0,0,{max(0,min(1,$2))},[2],255 rm[1,2] +sh[0] 0,{s-2} sh[0] 100% +[2] 1e-10 /[1,2] rm[1] c 0,255 +else +sh[1] 0,{s-2} sh[1] 100% j[0] [2],0,0,0,0,{max(0,min(1,$2))},[3],255 rm[^0] +fi +else +sh[0] 0,{{0,s}-2} rv[1,2] _blend_$1[1,2] j[1] [2],0,0,0,0,{max(0,min(1,$2))} rm[^0] +fi +else +if "s==2 || s==4" +sh[1] 0,{s-2} _blend_$1[0,2] rm[2] +sh[1] 100% j[0] [1],0,0,0,0,{max(0,min(1,$2))},[2],255 rm[^0] +else +_blend_$1 j[0] [1],0,0,0,0,{max(0,min(1,$2))} rm[1] +fi +fi +} } +_blend_alpha : +_blend_normal : +_blend_and : +&[1] [0] +_blend_add : ++[1] [0] c[1] 0,255 +_blend_average : ++[1] [0] /[1] 2 +_blend_blue : +sh[0] 0,1 j[1] [2] rm[2] +_blend_burn : ++-[0] 255 +[1] 0.1 /[2] [1] rm[1] +[1] 1 *[1] 255 c[1] 0,255 +_blend_darken : +min[1] [0] +_blend_difference : +-[1] [0] abs[1] +_blend_divide : ++[1] 0.1 ^[1] -1 *[1] [0] *[1] 255 c[1] 0,255 +_blend_dodge : +-[1] 255.1 ^[1] -1 *[1] [0] *[1] -255 c[1] 0,255 +_blend_edges : ++blend_edges 0.5 rm[1] +_blend_exclusion : ++*[0,1] /[2] -127.5 +[1,2] +[1] [0] +_blend_freeze : +*[1] -255 -[1] 0.1 +-[0] 255 sqr[2] /[2] [1] rm[1] +[1] 1 *[1] 255 c[1] 0,255 +_blend_grainextract : +-[1] [0] *[1] -1 +[1] 128 c[1] 0,255 +_blend_grainmerge : ++[1] [0] -[1] 128 c[1] 0,255 +_blend_green : +sh[0] 0 sh[0] 2 j[1] [2] j[1] [3],0,0,0,2 rm[2,3] +_blend_hardlight : ++*[0,1] /[2] 127.5 ++[0,1] *[3] 2 -[3] 255 -[3] [2] >[1] 128 +j[2] [3],0,0,0,0,1,[1] rm[1,3] c[1] 0,255 +_blend_hardmix : ++[1] [0] >=[1] 255 *[1] 255 +_blend_hue : +to_color sh 0,2 rgb2hsv[2,3] sh[2] 1,2 j[1] [4],0,0,0,1 rm[4] hsv2rgb[2,3] rm[2,3] +_blend_interpolation : ++*[0] {pi/255} *[1] {pi/255} cos[1,2] +[1,2] -[1] 2 *[1] -63.75 c[1] 0,255 +_blend_lighten : +max[1] [0] +_blend_lightness : +to_color sh 0,2 rgb2lab[2,3] sh[2] 1,2 j[1] [4],0,0,0,1 rm[4] lab2rgb[2,3] rm[2,3] +_blend_lchlightness : +_blend_lightness +_blend_luminance : +to_color sh 0,2 rgb2ycbcr[2,3] sh[2] 1,2 j[1] [4],0,0,0,1 rm[4] ycbcr2rgb[2,3] rm[2,3] +_blend_linearburn : ++[1] [0] -[1] 255 c. 0,255 +_blend_linearlight : +*[1] 2 +[1] [0] -[1] 255 c[1] 0,255 +_blend_multiply : +*[1] [0] /[1] 255 +_blend_negation : ++[1] [0] -[1] 255 abs[1] *[1] -1 +[1] 255 +_blend_or : +-|[1] [0] +_blend_overlay : ++*[0,1] /[2] 127.5 +[1] [0] *[1] 2 -[1] 255 -[1] [2] +<[0] 128 j[1] [2],0,0,0,0,1,[3] rm[2,3] c[1] 0,255 +_blend_pinlight : +*[1] 2 +blend darken -[1] 256 +blend[0,1] lighten >=[1] 0 +j[2] [3],0,0,0,0,1,[1] rm[1,3] +_blend_reflect : +-[1] 255.1 *[1] -1 +sqr[0] /[2] [1] rm[1] c[1] 0,255 +_blend_red : +sh[0] 1,100% j[1] [2],0,0,0,1 rm[2] +_blend_saturation : +to_color sh 0,2 rgb2hsv[2,3] shift[2,3] 0,0,0,-1,2 sh[2] 1,2 j[1] [4],0,0,0,1 rm[4] shift[2,3] 0,0,0,1,2 +hsv2rgb[2,3] rm[2,3] +_blend_screen : ++-[0] 255 -[1] 255 *[1,2] /[1] 255 *[1] -1 +[1] 255 +_blend_shapeareamax : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[1] round[1] 0.01 label[1] 0 ++f[0] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[2] round[2] 0.01 area[2] 0,0 +{1,iM+1},1,1,{0,s+1} +f[1] ">area = i(#2); best = I[#3,i]; if (area>best[size(best) - 1], I[#3,i] = [ I(#0),area ]);i" +rm[2] channels[2] 0,{s-2} map[1] [2] rm[2] +_blend_shapeareamax0 : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I!=0?I+A:I" norm[1] round[1] 0.01 label_fg[1] 0 ++f[0] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[2] round[2] 0.01 area[2] 0,0 +{1,iM+1},1,1,{0,s+1} +f[1] ">area = i(#2); best = I[#3,i]; if (area>best[size(best) - 1], I[#3,i] = [ I(#0),area ]);i" +rm[2] channels[2] 0,{s-2} point[2] 0,0,0,1,0 map[1] [2] rm[2] +_blend_shapeareamin : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[1] round[1] 0.01 label[1] 0 ++f[0] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[2] round[2] 0.01 area[2] 0,0 +{1,iM+1},1,1,{0,s+1},inf +f[1] ">area = i(#2); best = I[#3,i]; if (areaarea = i(#2); best = I[#3,i]; if (areai(#2,i(#1,x,y,z,0),0,0,c)+=i;i" ++histogram[1] {w},0,{w-1} /[-2,-1] map[1] . rm. +_blend_shapeaverage0 : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I!=0?I+A:I" norm[1] round[1] 0.01 label_fg[1] 0 {iM+1},1,1,{0,s} +f[0] ">i(#2,i(#1,x,y,z,0),0,0,c)+=i;i" ++histogram[1] {w},0,{w-1} /[-2,-1] point. 0,0,0,1,0 map[1] . rm. +_blend_shapemedian : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[1] round[1] 0.01 label[1] 0 +N={iM+1} $N,1,1,{s#0} $N,8,1,{s#0} s. x +f[1] "> +begin(siz = vector"$N"()); +k = i; +k3 = k + 3; +hk3 = h(#k3); +copy(i[#k3,siz[k]++],I(#0),s#0,hk3,whd#0); +if (siz[k]>=hk3,resize(#k3,1,round(1.5*hk3+1),1,s#0,0,0)); +end(repeat (size(siz),k, resize(#k+3,1,siz[k],1,s#0,0,0))); +i" +repeat s#0 { sh[3--1] $> $N,1,1,1,"ic(#"$N"+3+x)" j[2] .,0,0,0,$> rm[-{$N+1}--1] } +map[1] [2] k[0,1] +_blend_shapemedian0 : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I!=0?I+A:I" norm[1] round[1] 0.01 label_fg[1] 0 +N={iM} {$N+1},1,1,{s#0} $N,8,1,{s#0} s. x +f[1] "> +begin(siz = vector"$N"()); +k = i; +if (k, +k1 = k - 1; +k2 = k + 2; +hk2 = h(#k2); +copy(i[#k2,siz[k1]++],I(#0),s#0,hk2,whd#0); +if (siz[k1]>=hk2,resize(#k2,1,round(1.5*hk2+1),1,s#0,0,0)); +); +end(repeat (size(siz),k, resize(#k+3,1,siz[k],1,s#0,0,0))); +i" +repeat s#0 { sh[3--1] $> $N,1,1,1,"ic(#"$N"+3+x)" j[2] .,1,0,0,$> rm[-{$N+1}--1] } +map[1] [2] k[0,1] +_blend_shapemin : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[1] round[1] 0.01 label[1] 0 {iM+1},1,1,{0,s},inf +f[0] ">i(#2,i(#1,x,y,z,0),0,0,c) = min(i(#2,i(#1,x,y,z,0),0,0,c),i);i" +map[1] [2] rm. +_blend_shapemin0 : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I!=0?I+A:I" norm[1] round[1] 0.01 label_fg[1] 0 {iM+1},1,1,{0,s},inf +f[0] ">i(#2,i(#1,x,y,z,0),0,0,c) = min(i(#2,i(#1,x,y,z,0),0,0,c),i);i" +point. 0,0,0,1,0 map[1] [2] rm. +_blend_shapemax : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[1] round[1] 0.01 label[1] 0 {iM+1},1,1,{0,s},-inf +f[0] ">i(#2,i(#1,x,y,z,0),0,0,c) = max(i(#2,i(#1,x,y,z,0),0,0,c),i);i" +map[1] [2] rm. +_blend_shapemax0 : +f[1] "begin(A = resize([ 0,(s-1)/s ],s,3));I!=0?I+A:I" norm[1] round[1] 0.01 label_fg[1] 0 {iM+1},1,1,{0,s},-inf +f[0] ">i(#2,i(#1,x,y,z,0),0,0,c) = max(i(#2,i(#1,x,y,z,0),0,0,c),i);i" +point. 0,0,0,1,0 map[1] [2] rm. +_blend_softburn : ++-[0] 255.1 ^[2] -1 *[2] [1] *[2] -127.5 +-[0] 255 ++[1] 0.1 /[3,4] *[3] 127.5 +[3] 255 +[1] [0] >[1] 255 +j[2] [3],0,0,0,0,1,[1] rm[1,3] c[1] 0,255 +_blend_softdodge : ++-[1] 255.1 ^[2] -1 *[2] [0] *[2] -127.5 +-[1] 255 ++[0] 0.1 /[3,4] *[3] 127.5 +[3] 255 +[1] [0] >[1] 255 +j[2] [3],0,0,0,0,1,[1] rm[1,3] c[1] 0,255 +_blend_softlight : ++/[0] 255 /[1] 255 +sqr. *[2] [1] *[1] [3] *[1] -2 *[2] 2 +[1-3] *[1] 255 c[1] 0,255 +_blend_stamp : +*[1] 2 +[1] [0] -[1] 255 c[1] 0,255 +_blend_subtract : +-[1] [0] *[1] -1 c[1] 0,255 +_blend_value : +to_color sh 0,2 rgb2hsv[2,3] sh[2] 0,1 j[1] [4] rm[4] hsv2rgb[2,3] rm[2,3] +_blend_vividlight : +*[1] 2 +blend burn -[1] 256 +blend[0,1] dodge >=[1] 0 +j[2] [3],0,0,0,0,1,[1] rm[1,3] +_blend_xor : +xor[1] [0] +samj_SVG_Symetries_A: +Dim=1024 +Ray=500 +Ra={$Ray*$2} +Rb={$Ray*$4} +Rc={$Ray*$6} +Rd={$Ray*$8} +Angle={360/$1} +CRLF="\r\n" +Liste=""$CRLF +Liste.=""$CRLF +Liste.="Test GMIC SVG"$CRLF +Liste.="SVG Symetries A"$CRLF +if $12==1 +Couleur=${arg\ 1+$15,Black,Blue,Brown,Chartreuse,Chocolate,Coral,Cyan,DarkRed,DeepPink,FireBrick,ForestGreen,Fuchsia,Gold,Green,HotPink,Indigo,Lime,Magenta,Maroon,Olive,Orange,Orchid,Pink,Purple,Red,Salmon,SeaGreen,Sienna,Violet,Wheat,White,Yellow} +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Couleur=${arg\ 1+$10,Black,Blue,Brown,Chartreuse,Chocolate,Coral,Cyan,DarkRed,DeepPink,FireBrick,ForestGreen,Fuchsia,Gold,Green,HotPink,Indigo,Lime,Magenta,Maroon,Olive,Orange,Orchid,Pink,Purple,Red,Salmon,SeaGreen,Sienna,Violet,Wheat,White,Yellow} +Liste.=""$CRLF +else +Couleur=${arg\ 1+$10,Black,Blue,Brown,Chartreuse,Chocolate,Coral,Cyan,DarkRed,DeepPink,FireBrick,ForestGreen,Fuchsia,Gold,Green,HotPink,Indigo,Lime,Magenta,Maroon,Olive,Orange,Orchid,Pink,Purple,Red,Salmon,SeaGreen,Sienna,Violet,Wheat,White,Yellow} +Liste.=""$CRLF +fi +Index=0 +repeat $1 +AnI={{$Angle*$Index}+{$Angle*$3}} +XoA={{$Dim/2}+{$Ra*cos(pi/180*$AnI)}} +YoA={{$Dim/2}+{$Ra*sin(pi/180*$AnI)}} +AnI={{$Angle*$Index}+{$Angle*$5}} +XoB={{$Dim/2}+{$Rb*cos(pi/180*$AnI)}} +YoB={{$Dim/2}+{$Rb*sin(pi/180*$AnI)}} +AnI={{$Angle*$Index}+{$Angle*$7}} +XoC={{$Dim/2}+{$Rc*cos(pi/180*$AnI)}} +YoC={{$Dim/2}+{$Rc*sin(pi/180*$AnI)}} +AnI={{$Angle*$Index}+{$Angle*$9}} +XoD={{$Dim/2}+{$Rd*cos(pi/180*$AnI)}} +YoD={{$Dim/2}+{$Rd*sin(pi/180*$AnI)}} +Liste.=""$CRLF +AnI={{$Angle*$Index}-{$Angle*$5}} +XoB={{$Dim/2}+{$Rb*cos(pi/180*$AnI)}} +YoB={{$Dim/2}+{$Rb*sin(pi/180*$AnI)}} +AnI={{$Angle*$Index}-{$Angle*$7}} +XoC={{$Dim/2}+{$Rc*cos(pi/180*$AnI)}} +YoC={{$Dim/2}+{$Rc*sin(pi/180*$AnI)}} +Liste.=""$CRLF +Index+=1 +done +Liste.=""$CRLF +Liste.=""$CRLF +('$Liste') +output_text. $_path_rc/Liste_Points_SVG_Symetries_A.svg +rm +1500,100,1,3 +fill_color. 255,255,255 +text. "SVG disponible sur :",20,20,20,1,255,0,0 +if '$_os'=='windows' +text. $_path_rc"\Liste_Points_SVG_Symetries_A.svg",20,50,20,1,255,0,0 +else +text. $_path_rc"/Liste_Points_SVG_Symetries_A.svg",20,50,20,1,255,0,0 +fi +autocrop +samj_SVG_Symetries_A_preview : +rm +Dim=800 +Ray=360 +Ra={$Ray*$2} +Rb={$Ray*$4} +Rc={$Ray*$6} +Rd={$Ray*$8} +Angle={360/$1} +$Dim,$Dim,1,3 +fill_color 255,255,255 +Index=0 +repeat $1 +srand {$Index+123456} +R_Couleur={round(u)*192} +V_Couleur={round(u)*192} +B_Couleur={round(u)*192} +AnI={{$Angle*$Index}+{$Angle*$3}} +XoA={{$Dim/2}+{$Ra*cos(pi/180*$AnI)}} +YoA={{$Dim/2}+{$Ra*sin(pi/180*$AnI)}} +AnI={{$Angle*$Index}+{$Angle*$5}} +XoB={{$Dim/2}+{$Rb*cos(pi/180*$AnI)}} +YoB={{$Dim/2}+{$Rb*sin(pi/180*$AnI)}} +AnI={{$Angle*$Index}+{$Angle*$7}} +XoC={{$Dim/2}+{$Rc*cos(pi/180*$AnI)}} +YoC={{$Dim/2}+{$Rc*sin(pi/180*$AnI)}} +AnI={{$Angle*$Index}+{$Angle*$9}} +XoD={{$Dim/2}+{$Rd*cos(pi/180*$AnI)}} +YoD={{$Dim/2}+{$Rd*sin(pi/180*$AnI)}} +samj_Bezier_Quatre_Points $XoA,$YoA,$XoB,$YoB,$XoC,$YoC,$XoD,$YoD,20,$R_Couleur,$V_Couleur,$B_Couleur,255 +AnI={{$Angle*$Index}-{$Angle*$5}} +XoB={{$Dim/2}+{$Rb*cos(pi/180*$AnI)}} +YoB={{$Dim/2}+{$Rb*sin(pi/180*$AnI)}} +AnI={{$Angle*$Index}-{$Angle*$7}} +XoC={{$Dim/2}+{$Rc*cos(pi/180*$AnI)}} +YoC={{$Dim/2}+{$Rc*sin(pi/180*$AnI)}} +samj_Bezier_Quatre_Points $XoA,$YoA,$XoB,$YoB,$XoC,$YoC,$XoD,$YoD,20,$R_Couleur,$V_Couleur,$B_Couleur,255 +Index+=1 +done +erode 2 +samj_Bezier_Quatre_Points : +Xp1=$1 +Yp1=$2 +Xp2=$3 +Yp2=$4 +Xp3=$5 +Yp3=$6 +Xp4=$7 +Yp4=$8 +Segments=$9 +Index=1 +Xori=$1 +Yori=$2 +repeat $Segments +Tou={$Index/$Segments} +XTou={{{{1-$Tou}^3}*$Xp1}+{{{1-$Tou}^2}*3*$Tou*$Xp2}+{3*{1-$Tou}*{$Tou^2}*$Xp3}+{{$Tou^3}*$Xp4}} +YTou={{{{1-$Tou}^3}*$Yp1}+{{{1-$Tou}^2}*3*$Tou*$Yp2}+{3*{1-$Tou}*{$Tou^2}*$Yp3}+{{$Tou^3}*$Yp4}} +line. $Xori,$Yori,$XTou,$YTou,1,$10,$11,$12,$13 +Xori=$XTou +Yori=$YTou +Index+=1 +done +samj_GUI_Test_Liste_Points_TSP : +if $13==1 +samj_Test_Liste_Points_TSP_Bezier $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12 +else +samj_Test_Liste_Points_TSP $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12 +fi +samj_GUI_Test_Liste_Points_TSP_Preview : +if w>h +resize 600,{h/w*600} +else +resize {w/h*600},600 +fi +if $8==1 ++- +samj_Masques_Noir_Et_Blanc_Preview[-1] $1,$2 +samj_Masques_Noir_Et_Blanc_Preview[-2] $3,$4 +to_gray[-1,-2] +rv +append x +else +samj_Masques_Noir_Et_Blanc_Preview $3,$4 +to_gray +fi +samj_Test_Liste_Points_TSP : +skip ${1=1.25},${2=42},${3=0},${4=32.5},${5=1},${6=0},${7=2},${8=1},${9=1},${10=4},${11=4},${12=1} +Param1Masque1=$1 +Param2Masque1=$2 +Param1Masque2=$3 +Param2Masque2=$4 +Echelle=$5 +CRLF="\r\n" +Liste=""$CRLF +Liste.=""$CRLF +Liste.="Test GMIC SVG"$CRLF +Liste.="Points et Segments"$CRLF +if $9==1 +Couleur=${arg\ 1+$12,Black,Blue,Brown,Chartreuse,Chocolate,Coral,Cyan,DarkRed,DeepPink,FireBrick,ForestGreen,Fuchsia,Gold,Green,HotPink,Indigo,Lime,Magenta,Maroon,Olive,Orange,Orchid,Pink,Purple,Red,Salmon,SeaGreen,Sienna,Violet,Wheat,White,Yellow} +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Couleur=${arg\ 1+$6,Black,Blue,Brown,Chartreuse,Chocolate,Coral,Cyan,DarkRed,DeepPink,FireBrick,ForestGreen,Fuchsia,Gold,Green,HotPink,Indigo,Lime,Magenta,Maroon,Olive,Orange,Orchid,Pink,Purple,Red,Salmon,SeaGreen,Sienna,Violet,Wheat,White,Yellow} +Liste.=""$CRLF +else +Couleur=${arg\ 1+$6,Black,Blue,Brown,Chartreuse,Chocolate,Coral,Cyan,DarkRed,DeepPink,FireBrick,ForestGreen,Fuchsia,Gold,Green,HotPink,Indigo,Lime,Magenta,Maroon,Olive,Orange,Orchid,Pink,Purple,Red,Salmon,SeaGreen,Sienna,Violet,Wheat,White,Yellow} +Liste.=""$CRLF +fi +Liste.="h +resize 1000,{h/w*1000} +else +resize {w/h*1000},1000 +fi ++samj_Masques_Noir_Et_Blanc_Preview $Param1Masque1,$Param2Masque1 +to_gray. +negate. +dilate. 10 +pointcloud. 3 +channels. 0,1 +resize. $Echelle%,1 +add. 12 +tsp. 200 ++crop. 0,0,1,0 +Xend={i0} +Yend={i1} +rm. +repeat w +Index=$> ++crop. $Index,0,{$Index+1},0 +Xa={i0} +Ya={i1} +rm. +Liste.=$Xa" " +Liste.=$Ya" " +done +rm. +if $8==1 +samj_Masques_Noir_Et_Blanc_Preview $Param1Masque2,$Param2Masque2 +to_gray. +negate. +dilate. 10 +pointcloud. 3 +channels. 0,1 +resize. $Echelle%,1 +add. 12 +tsp. 200 +repeat w +Index=$> ++crop. $Index,0,{$Index+1},0 +Xa={i0} +Ya={i1} +rm. +Liste.=$Xa" " +Liste.=$Ya" " +done +fi +Liste.=$Xend" " +Liste.=$Yend" " +Liste.="\"/>"$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +('$Liste') +output_text. $_path_rc/Liste_Points_TSP.svg +rm +1500,100,1,3 +fill_color. 255,255,255 +text. "SVG disponible sur :",20,20,20,1,255,0,0 +if '$_os'=='windows' +text. $_path_rc"\Liste_Points_TSP.svg",20,50,20,1,255,0,0 +else +text. $_path_rc"/Liste_Points_TSP.svg",20,50,20,1,255,0,0 +fi +autocrop +samj_Test_Liste_Points_TSP_Bezier : +skip ${1=1.25},${2=42},${3=0},${4=32.5},${5=1},${6=0},${7=2},${8=1},${9=1},${10=4},${11=4},${12=1} +Param1Masque1=$1 +Param2Masque1=$2 +Param1Masque2=$3 +Param2Masque2=$4 +Echelle=$5 +CRLF="\r\n" +Liste=""$CRLF +Liste.=""$CRLF +Liste.="Test GMIC SVG"$CRLF +Liste.="Points et Courbes de Bezier"$CRLF +if $9==1 +Couleur=${arg\ 1+$12,Black,Blue,Brown,Chartreuse,Chocolate,Coral,Cyan,DarkRed,DeepPink,FireBrick,ForestGreen,Fuchsia,Gold,Green,HotPink,Indigo,Lime,Magenta,Maroon,Olive,Orange,Orchid,Pink,Purple,Red,Salmon,SeaGreen,Sienna,Violet,Wheat,White,Yellow} +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Liste.=""$CRLF +Couleur=${arg\ 1+$6,Black,Blue,Brown,Chartreuse,Chocolate,Coral,Cyan,DarkRed,DeepPink,FireBrick,ForestGreen,Fuchsia,Gold,Green,HotPink,Indigo,Lime,Magenta,Maroon,Olive,Orange,Orchid,Pink,Purple,Red,Salmon,SeaGreen,Sienna,Violet,Wheat,White,Yellow} +Liste.=""$CRLF +else +Couleur=${arg\ 1+$6,Black,Blue,Brown,Chartreuse,Chocolate,Coral,Cyan,DarkRed,DeepPink,FireBrick,ForestGreen,Fuchsia,Gold,Green,HotPink,Indigo,Lime,Magenta,Maroon,Olive,Orange,Orchid,Pink,Purple,Red,Salmon,SeaGreen,Sienna,Violet,Wheat,White,Yellow} +Liste.=""$CRLF +fi +if w>h +resize 1000,{h/w*1000} +else +resize {w/h*1000},1000 +fi ++samj_Masques_Noir_Et_Blanc_Preview $Param1Masque1,$Param2Masque1 +to_gray. +negate. +dilate. 10 +pointcloud. 3 +channels. 0,1 +WWe={round(w/100*$Echelle)} +if {$WWe%2}==0 resize. $WWe,1 else resize. {$WWe-1},1 fi +add. 12 +tsp. 200 ++crop. 0,0,1,0 +Xo={i0} +Yo={i1} +rm[-1] ++crop. 1,0,2,0 +Xs={i0} +Ys={i1} +rm[-1] ++crop. 2,0,3,0 +Xt={i0} +Yt={i1} +rm[-1] ++crop. 3,0,4,0 +Xq={i0} +Yq={i1} +rm[-1] +Liste.=""$CRLF +Index=2 +repeat {{w/2}-1} +Xu=$Xq +Yu=$Yq +Xd=$Xt +Yd=$Yt ++crop {$Index},0,{$Index+1},0 +Xt={i0} +Yt={i1} +rm[-1] +rm[-1] ++crop {$Index+1},0,{$Index+2},0 +Xq={i0} +Yq={i1} +rm[-1] +rm[-1] +Xs={$Xu+$Xu-$Xd} +if $Xs<0 Xs=0 fi +if $Xs>1023 Xs=1023 fi +Ys={$Yu+$Yu-$Yd} +if $Ys<0 Ys=0 fi +if $Ys>1023 Ys=1023 fi +Liste.=""$CRLF +Index={$Index+2} +done +rm. +if $8==1 +samj_Masques_Noir_Et_Blanc_Preview $Param1Masque2,$Param2Masque2 +to_gray. +negate. +dilate. 10 +pointcloud. 3 +channels. 0,1 +WWe={round(w/100*$Echelle)} +if {$WWe%2}==0 resize. $WWe,1 else resize. {$WWe-1},1 fi +add. 12 +tsp. 200 ++crop. 1,0,2,0 +Xs={i0} +Ys={i1} +rm[-1] ++crop. 2,0,3,0 +Xt={i0} +Yt={i1} +rm[-1] ++crop. 3,0,4,0 +Xq={i0} +Yq={i1} +rm[-1] +Liste.=""$CRLF +Index=2 +repeat {{w/2}-1} +Xu=$Xq +Yu=$Yq +Xd=$Xt +Yd=$Yt ++crop {$Index},0,{$Index+1},0 +Xt={i0} +Yt={i1} +rm[-1] ++crop {$Index+1},0,{$Index+2},0 +Xq={i0} +Yq={i1} +rm[-1] +Xs={$Xu+$Xu-$Xd} +if $Xs<0 Xs=0 fi +if $Xs>1023 Xs=1023 fi +Ys={$Yu+$Yu-$Yd} +if $Ys<0 Ys=0 fi +if $Ys>1023 Ys=1023 fi +Liste.=""$CRLF +Index={$Index+2} +done +fi +Liste.=""$CRLF +Liste.=""$CRLF +('$Liste') +output_text. $_path_rc/Liste_Points_TSP_Bezier.svg +rm +1500,100,1,3 +fill_color. 255,255,255 +text. "SVG disponible sur :",20,20,20,1,255,0,0 +if '$_os'=='windows' +text. $_path_rc"\Liste_Points_TSP_Bezier.svg",20,50,20,1,255,0,0 +else +text. $_path_rc"/Liste_Points_TSP_Bezier.svg",20,50,20,1,255,0,0 +fi +autocrop +#@cli samj_resize_screen : expand={ 0 | 1 } +#@cli : Mettre l'image selon les dimensions de l'écran. / Put the image to the dimensions of the screen. +#@cli : $ image.jpg samj_resize_screen +samj_resize_screen : +skip ${1=1} +Screen_W={*,u} +Screen_H={*,v} +Image_W={w} +Image_H={h} +Scr_Rap={$Screen_W/$Screen_H} +Img_Rap={$Image_W/$Image_H} +if {$Scr_Rap}>{$Img_Rap} +resize {$Image_W/$Image_H*$Screen_H},$Screen_H +if $1==1 to_a expand_x {{$Screen_W-w}/2},0 fi +else +resize $Screen_W,{$Image_H/$Image_W*$Screen_W} +if $1==1 to_a expand_y {{$Screen_H-h}/2},0 fi +fi +#@cli samj_full_screen_display : _monitor={ 0 | 1 },_width>0,_height>0,_time_ms>=0 +#@cli : Affiche une image en plein écran, soit selon les caractéristiques de l'écran ou selon les dimensions de $2 et $3. Possibilité d'activer une temporisation en ms ($4). +#@cli : L'appui sur une des touches du clavier 'Q', 'Échappement', 'Barre d'espacement' et 'Entrée' permet d'arrêter l'affichage. +#@cli : Displays a full screen image, depending on the characteristics of the screen or dimensions ($2,$3). Ability to activate a ms delay ($4). +#@cli : The keyboard keys 'Q', 'Escape', 'Space bar' and 'Enter' allows you to stop the display. +#@cli : Valeurs par défaut / Default values: 'monitor=1', 'width=800', 'height=600', 'time_ms=5000'. +#@cli : $ image.jpg +samj_full_screen_display 0,400,300,4000 blur 20 +samj_full_screen_display +samj_full_screen_display : +skip ${1=1},${2=800},${3=600},${4=5000} +if $1==1 +Screen_W={*,u} +Screen_H={*,v} +else +if ["'$2'"]=='' Screen_W=800 else Screen_W=$2 fi +if ["'$3'"]=='' Screen_H=600 else Screen_H=$3 fi +fi +Image_W={w} +Image_H={h} +Scr_Rap={$Screen_W/$Screen_H} +Img_Rap={$Image_W/$Image_H} +if {$Scr_Rap}>{$Img_Rap} +resize {$Image_W/$Image_H*$Screen_H},$Screen_H +expand_x {{$Screen_W-w}/2},0 +else +resize $Screen_W,{$Image_H/$Image_W*$Screen_W} +expand_y {{$Screen_H-h}/2},0 +fi +if $1==1 window $Screen_W,$Screen_H,0,1 else window $Screen_W,$Screen_H,0,0,5%,5%,$Screen_W*$Screen_H fi +if $4>0 +Pre=50 +Bc={$4/$Pre} +repeat $Bc +if {{*,ESC}||{*,Q}||{*,SPACE}||{*,ENTER}} break fi +wait $Pre +done +fi +rm +#@cli samj_test_paint_gmic_gimp : _Iterations>0,_Seed>0,0.01<=_DiffusionTensors<=0.1,0<=_Blur<=10,_ImageSequence={0=No | 1=Yes},_Brush={0=Ellipse | 1=Circle},0.1<=_BrushSize>0<=4 +#@cli : Paint an Image by Randomly Exploring a Space of Brush Strokes by David Tschumperlé. +#@cli : Default values: 'Iterations=200', 'Seed=0', 'DiffusionTensors=0.01', 'Blur=10', 'ImageSequence=0', 'Brush=0' and 'BrushSize=1'. +#@cli : $ image.jpg samj_test_paint_gmic_gimp 300 +samj_test_paint_gmic_gimp : check $1>=1 skip "${1=200},${2=0},${3=0.01},${4=10},${5=0},${6=0},${7=1}" ++diffusiontensors $3,0.95,0.5,1 ++gradient_norm.. ++b[0] $4% +f=0 +if $2>0 Iterations={$1*2} else Iterations=$1 fi +repeat $Iterations t=$> +beta={1-exp(-$t/100)} +100%,100%,1,4 +if $2>0 srand {$2+$f} fi +{u(16,512)},1,1,1,"* +const da = 15; +const dl = 1; +const echelle = $7; +const beta = $beta; +const bs = lerp(60,1,beta); +const anisotropy = lerp(0.5,1,beta); +const opac = lerp(0.5,1,beta); +const alea = $2+$f; +if($2>0, srand(alea) ); +X0 = round(u([w#0,h#0]-1)); +RGBA = [ lerp(I(#0,X0),u([255,255,255]),0),255 ]; +lmax = lerp(1,10,beta^2); +for (a = 0, a<360, a+=da, +X = X0; +U = [cos(0.017453292*$a), sin(0.017453292*$a)]; +for (l = 0, l{2*pi} +crop 0,0,{{h*2*pi}-1},{h-1} +fi +resize[-1] $2,{h/w*$2} +Larg={w} +Haut={h} +RayonInt=$Haut +RayonExt={$RayonInt+$Haut} +AngDep=0 +CirconfInt={2*pi*$RayonInt} +AngArrivee={$Larg/$RayonInt} +elif $1==2 +to_rgba +samj_inclinaison_h 1,{h} +elif $1==3 +to_rgba +samj_inclinaison_h 2,{h} +fi +if $1==1||$1==2||$1==3 +resize[-1] $2,{h/w*$2} +EloigC=$3 +Larg={w} +Haut={h} +if $EloigC>{round({{$Larg/2}/{2*pi}})} +RayonInt={round({{$Larg/2}/{2*pi}})+$EloigC} +else +RayonInt={round({{$Larg/2}/{2*pi}})} +fi +DiamInt={$RayonInt*2} +AngDep=0 +CirconfInt={2*pi*$RayonInt} +AngArrivee={$AngDep+(2*pi)} +RayonExt={$RayonInt+$Haut} +fi +AngDepDeg={pi/180*$4} +CirconfExt={2*pi*$RayonExt} +DimLigneDebut={$RayonInt*$AngArrivee} +DimLigneFin={$RayonExt*$AngArrivee} +Inc={{$DimLigneFin-$DimLigneDebut}/$Haut} +to_rgba +split[-1] y,$Haut +LaTrai=0 +repeat $Haut +LaTrai-=1 +AbsLaTrai={abs($LaTrai)} +resize[$LaTrai] {$CirconfInt+{{abs($LaTrai)-1}*$Inc}},{h} +LargSplit$AbsLaTrai={$CirconfInt+((abs($LaTrai)-1)*$Inc)} +done +append y +DimNewImg={{$RayonExt+3}*2} +$DimNewImg,$DimNewImg,1,4 +fill_color[-1] 0,0,0,0 +Xc={$DimNewImg/2} +Yc={$DimNewImg/2} +LaTrai=0 +IncY=0 +repeat $Haut +LaTrai-=1 +AbsLaTrai={abs($LaTrai)} +LargLigne=${LargSplit$AbsLaTrai} +IncX=0 +IncA={$AngArrivee/$LargLigne} +repeat $LargLigne +Rn={$RayonInt+$IncY} +An={$AngDepDeg+($IncX*$IncA)} +Xp={$Xc+($Rn*cos($An))} +Yp={$Yc+($Rn*sin($An))} +Xf={$Xc+($RayonExt*cos($An))} +Yf={$Yc+($RayonExt*sin($An))} +PosX=$IncX +PosY={{$Haut-1}-$IncY} ++crop[-2] $PosX,$PosY,$PosX,$PosY,0 +line[-2] $Xp,$Yp,$Xf,$Yf,1,{I(#-1)} +rm[-1] +IncX+=1 +done +IncY+=1 +done +$DimNewImg,$DimNewImg,1,4 +fill_color[-1] 0,0,0,0 +circle[-1] $Xc,$Yc,$RayonInt,1,0xFFFFFFFF,255,0,0,255 +circle[-1] $Xc,$Yc,$RayonExt,1,0xFFFFFFFF,0,255,0,255 +Xa={$Xc+($RayonInt*cos($AngDepDeg))} +Ya={$Yc+($RayonInt*sin($AngDepDeg))} +Xb={$Xc+($RayonInt*cos($An))} +Yb={$Yc+($RayonInt*sin($An))} +polygon[-1] 3,$Xc,$Yc,$Xa,$Ya,$Xb,$Yb,1,255,255,0,255 +text[-1] $1-$2-$3-$4-$AngDepDeg,20,20,30,1,255,0,0,255 +text[-1] {$An/pi*180}-$An,20,40,30,1,255,0,0,255 +text[-1] $Haut-$RayonInt-$RayonExt,20,60,30,1,255,0,0,255 +rv[-1,-2,-3] +samj_montage_row : +skip ${7=2} +Type_Proportions_Finales=$1 +LargeurRow=$2 +Contour=$3 +Padding=$4 +Rotation=$5 +Pivoter_En_Colonne=$6 +NbImg=$! +DimensionMini=$7 +if {{$NbImg*{{2*{$3+$4}}+$DimensionMini}}>$2} +echo "ERREUR-ERROR - Diminuer $3,$4 et/ou augmenter $2 / Decrease $3,$4 et/ou increase $2" +rm +else +Index=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +$Wtemp,$Htemp,1,4 +fill_color[-1] 255,255,255,255 +rv[-1,{$Index-1}] +samj_blend_20220419[-1,{$Index-1}] alpha +done +to_rgb +if $Rotation==1 permute yxzc mirror x fi +NbImg=$! +if $Type_Proportions_Finales==0 +Index=0 +Hmax=0 +Wmax=0 +Htot=0 +Wtot=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +Htot+=$Htemp +if $Htemp>$Hmax +Hmax=$Htemp +fi +Wtemp={w(#$Index)} +Wtot+=$Wtemp +if $Wtemp>$Wmax +Wmax=$Wtemp +fi +done +ContourTot={$NbImg*$Contour*2} +PaddingTot={$NbImg*$Padding*2} +LargeurImages={$LargeurRow-$ContourTot-$PaddingTot} +Echelle={$LargeurImages/$Wtot} +Index=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +resize[$Index] {$Wtemp*$Echelle},{$Htemp*$Echelle} +if $Contour>0 frame_xy[$Index] $Contour,$Contour,0 fi +if $Padding>0 frame_xy[$Index] $Padding,$Padding,255 fi +done +else +Index=0 +Hmax=0 +Wmax=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +if $Htemp>$Hmax +Hmax=$Htemp +fi +Wtemp={w(#$Index)} +if $Wtemp>$Wmax +Wmax=$Wtemp +fi +done +Index=0 +Htot=0 +Wtot=0 +repeat $NbImg +Index-=1 +AbsInd={abs($Index)} +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +NewW$AbsInd={$Wtemp/$Htemp*$Hmax} +NewH$AbsInd=$Hmax +done +Index=0 +Hmax=0 +Wmax=0 +Htot=0 +Wtot=0 +repeat $NbImg +Index-=1 +AbsInd={abs($Index)} +Htemp=${NewH$AbsInd} +Htot+=$Htemp +if $Htemp>$Hmax +Hmax=$Htemp +fi +Wtemp=${NewW$AbsInd} +Wtot+=$Wtemp +if $Wtemp>$Wmax +Wmax=$Wtemp +fi +done +ContourTot={$NbImg*$Contour*2} +PaddingTot={$NbImg*$Padding*2} +LargeurImages={$LargeurRow-$ContourTot-$PaddingTot} +Echelle={$LargeurImages/$Wtot} +Index=0 +repeat $NbImg +Index-=1 +AbsInd={abs($Index)} +Htemp=${NewH$AbsInd} +Wtemp=${NewW$AbsInd} +resize[$Index] {$Wtemp*$Echelle},{$Htemp*$Echelle} +if $Contour>0 frame_xy[$Index] $Contour,$Contour,0 fi +if $Padding>0 frame_xy[$Index] $Padding,$Padding,255 fi +done +fi +Index=0 +Hmaxmontage=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +if $Htemp>$Hmaxmontage +Hmaxmontage=$Htemp +fi +Wtemp={w(#$Index)} +done +Index=0 +repeat $NbImg +Index-=1 +Htemp={h(#$Index)} +Wtemp={w(#$Index)} +expand_y[$Index] {{$Hmaxmontage-$Htemp}/2},0 +rectangle[$Index] 0,0,$Wtemp,{{$Hmaxmontage-$Htemp}/2},1,255,255,255 +mirror[$Index] y +rectangle[$Index] 0,0,$Wtemp,{{$Hmaxmontage-$Htemp}/2},1,255,255,255 +mirror[$Index] y +done +append x +Erreur={w-$LargeurRow} +if $Erreur>0 +crop 0,0,{$LargeurRow-1},{h-1} +elif $Erreur<0 +expand_x {-$Erreur-1},0 +rectangle 0,0,{-$Erreur-1},{h},1,255,255,255 +mirror x +rectangle 0,0,{-$Erreur-1},{h},1,255,255,255 +mirror x +crop 0,0,{$LargeurRow-1},{h-1} +fi +to_rgb +if $Pivoter_En_Colonne==1 mirror x permute yx fi +fi +samj_paulmatth_montage_row: +frame $1,$2,$3 +if $9>0 rotate $9,2 fi +frame $4,$5,$6 +montage H +to_rgb +if $7==1 resize $8,{h/w*$8},1,3 fi +samj_RGB_to_LCH_or_Lab: +Type_de_demande=$1 +Ra=$2 +Ga=$3 +Ba=$4 +Matrices_RGB=$5 +XYZ_Tristimulus=$6 +Choix=$7 +nt_Ra={$Ra/255} +nt_Ga={$Ga/255} +nt_Ba={$Ba/255} +if $nt_Ra>0.04045 +nt_Ra={({{$nt_Ra+0.055}/1.055})^2.4} +else +nt_Ra/=12.92 +fi +if $nt_Ga>0.04045 +nt_Ga={({{$nt_Ga+0.055}/1.055})^2.4} +else +nt_Ga/=12.92 +fi +if $nt_Ba>0.04045 +nt_Ba={({{$nt_Ba+0.055}/1.055})^2.4} +else +nt_Ba/=12.92 +fi +nt_Ra*=100 +nt_Ga*=100 +nt_Ba*=100 +Xa={$nt_Ra*1.0000000+$nt_Ga*0.0000000+$nt_Ba*0.0000000} +Ya={$nt_Ra*0.0000000+$nt_Ga*1.0000000+$nt_Ba*0.0000000} +Za={$nt_Ra*0.0000000+$nt_Ga*0.0000000+$nt_Ba*1.0000000} +if $Matrices_RGB==0 +Xa={$nt_Ra*0.5767309+$nt_Ga*0.1855540+$nt_Ba*0.1881852} +Ya={$nt_Ra*0.2973769+$nt_Ga*0.6273491+$nt_Ba*0.0752741} +Za={$nt_Ra*0.0270343+$nt_Ga*0.0706872+$nt_Ba*0.9911085} +elif $Matrices_RGB==1 +Xa={$nt_Ra*0.4497288+$nt_Ga*0.3162486+$nt_Ba*0.1844926} +Ya={$nt_Ra*0.2446525+$nt_Ga*0.6720283+$nt_Ba*0.0833192} +Za={$nt_Ra*0.0251848+$nt_Ga*0.1411824+$nt_Ba*0.9224628} +elif $Matrices_RGB==2 +Xa={$nt_Ra*0.6326696+$nt_Ga*0.2045558+$nt_Ba*0.1269946} +Ya={$nt_Ra*0.2284569+$nt_Ga*0.7373523+$nt_Ba*0.0341908} +Za={$nt_Ra*0.0000000+$nt_Ga*0.0095142+$nt_Ba*0.8156958} +elif $Matrices_RGB==3 +Xa={$nt_Ra*0.6712537+$nt_Ga*0.1745834+$nt_Ba*0.1183829} +Ya={$nt_Ra*0.3032726+$nt_Ga*0.6637861+$nt_Ba*0.0329413} +Za={$nt_Ra*0.0000000+$nt_Ga*0.0407010+$nt_Ba*0.7845090} +elif $Matrices_RGB==4 +Xa={$nt_Ra*0.4674162+$nt_Ga*0.2944512+$nt_Ba*0.1886026} +Ya={$nt_Ra*0.2410115+$nt_Ga*0.6835475+$nt_Ba*0.0754410} +Za={$nt_Ra*0.0219101+$nt_Ga*0.0736128+$nt_Ba*0.9933071} +elif $Matrices_RGB==5 +Xa={$nt_Ra*0.4887180+$nt_Ga*0.3106803+$nt_Ba*0.2006017} +Ya={$nt_Ra*0.1762044+$nt_Ga*0.8129847+$nt_Ba*0.0108109} +Za={$nt_Ra*0.0000000+$nt_Ga*0.0102048+$nt_Ba*0.9897952} +elif $Matrices_RGB==6 +Xa={$nt_Ra*0.5093439+$nt_Ga*0.3209071+$nt_Ba*0.1339691} +Ya={$nt_Ra*0.2748840+$nt_Ga*0.6581315+$nt_Ba*0.0669845} +Za={$nt_Ra*0.0242545+$nt_Ga*0.1087821+$nt_Ba*0.6921735} +elif $Matrices_RGB==7 +Xa={$nt_Ra*0.6457711+$nt_Ga*0.1933511+$nt_Ba*0.1250978} +Ya={$nt_Ra*0.2783496+$nt_Ga*0.6879702+$nt_Ba*0.0336802} +Za={$nt_Ra*0.0037113+$nt_Ga*0.0179861+$nt_Ba*0.8035125} +elif $Matrices_RGB==8 +Xa={$nt_Ra*0.6502043+$nt_Ga*0.1780774+$nt_Ba*0.1359384} +Ya={$nt_Ra*0.3202499+$nt_Ga*0.6020711+$nt_Ba*0.0776791} +Za={$nt_Ra*0.0000000+$nt_Ga*0.0678390+$nt_Ba*0.7573710} +elif $Matrices_RGB==9 +Xa={$nt_Ra*0.5938914+$nt_Ga*0.2729801+$nt_Ba*0.0973485} +Ya={$nt_Ra*0.2606286+$nt_Ga*0.7349465+$nt_Ba*0.0044249} +Za={$nt_Ra*0.0000000+$nt_Ga*0.0419969+$nt_Ba*0.7832131} +elif $Matrices_RGB==10 +Xa={$nt_Ra*0.6068909+$nt_Ga*0.1735011+$nt_Ba*0.2003480} +Ya={$nt_Ra*0.2989164+$nt_Ga*0.5865990+$nt_Ba*0.1144845} +Za={$nt_Ra*0.0000000+$nt_Ga*0.0660957+$nt_Ba*1.1162243} +elif $Matrices_RGB==11 +Xa={$nt_Ra*0.4306190+$nt_Ga*0.3415419+$nt_Ba*0.1783091} +Ya={$nt_Ra*0.2220379+$nt_Ga*0.7066384+$nt_Ba*0.0713236} +Za={$nt_Ra*0.0201853+$nt_Ga*0.1295504+$nt_Ba*0.9390944} +elif $Matrices_RGB==12 +Xa={$nt_Ra*0.7976749+$nt_Ga*0.1351917+$nt_Ba*0.0313534} +Ya={$nt_Ra*0.2880402+$nt_Ga*0.7118741+$nt_Ba*0.0000857} +Za={$nt_Ra*0.0000000+$nt_Ga*0.0000000+$nt_Ba*0.8252100} +elif $Matrices_RGB==13 +Xa={$nt_Ra*0.3935891+$nt_Ga*0.3652497+$nt_Ba*0.1916313} +Ya={$nt_Ra*0.2124132+$nt_Ga*0.7010437+$nt_Ba*0.0865432} +Za={$nt_Ra*0.0187423+$nt_Ga*0.1119313+$nt_Ba*0.9581563} +elif $Matrices_RGB==14 +Xa={$nt_Ra*0.4124564+$nt_Ga*0.3575761+$nt_Ba*0.1804375} +Ya={$nt_Ra*0.2126729+$nt_Ga*0.7151522+$nt_Ba*0.0721750} +Za={$nt_Ra*0.0193339+$nt_Ga*0.1191920+$nt_Ba*0.9503041} +elif $Matrices_RGB==15 +Xa={$nt_Ra*0.7161046+$nt_Ga*0.1009296+$nt_Ba*0.1471858} +Ya={$nt_Ra*0.2581874+$nt_Ga*0.7249378+$nt_Ba*0.0168748} +Za={$nt_Ra*0.0000000+$nt_Ga*0.0517813+$nt_Ba*0.7734287} +fi +Xca=$Xa +Yca=$Ya +Zca=$Za +ref_Xa=100.000 +ref_Ya=100.000 +ref_Za=100.000 +if $XYZ_Tristimulus==0 +ref_Xa=109.850 +ref_Ya=100.000 +ref_Za=35.585 +elif $XYZ_Tristimulus==1 +ref_Xa=98.074 +ref_Ya=100.000 +ref_Za=118.232 +elif $XYZ_Tristimulus==2 +ref_Xa=96.422 +ref_Ya=100.000 +ref_Za=82.521 +elif $XYZ_Tristimulus==3 +ref_Xa=95.682 +ref_Ya=100.000 +ref_Za=92.149 +elif $XYZ_Tristimulus==4 +ref_Xa=95.047 +ref_Ya=100.000 +ref_Za=108.883 +elif $XYZ_Tristimulus==5 +ref_Xa=94.972 +ref_Ya=100.000 +ref_Za=122.638 +elif $XYZ_Tristimulus==6 +ref_Xa=99.187 +ref_Ya=100.000 +ref_Za=67.395 +elif $XYZ_Tristimulus==7 +ref_Xa=95.044 +ref_Ya=100.000 +ref_Za=108.755 +elif $XYZ_Tristimulus==8 +ref_Xa=100.966 +ref_Ya=100.000 +ref_Za=64.370 +elif $XYZ_Tristimulus==10 +ref_Xa=111.144 +ref_Ya=100.000 +ref_Za=35.200 +elif $XYZ_Tristimulus==11 +ref_Xa=97.285 +ref_Ya=100.000 +ref_Za=116.145 +elif $XYZ_Tristimulus==12 +ref_Xa=96.720 +ref_Ya=100.000 +ref_Za=81.427 +elif $XYZ_Tristimulus==13 +ref_Xa=95.799 +ref_Ya=100.000 +ref_Za=90.926 +elif $XYZ_Tristimulus==14 +ref_Xa=94.811 +ref_Ya=100.000 +ref_Za=107.304 +elif $XYZ_Tristimulus==15 +ref_Xa=94.416 +ref_Ya=100.000 +ref_Za=120.641 +elif $XYZ_Tristimulus==16 +ref_Xa=103.280 +ref_Ya=100.000 +ref_Za=69.026 +elif $XYZ_Tristimulus==17 +ref_Xa=95.792 +ref_Ya=100.000 +ref_Za=107.687 +elif $XYZ_Tristimulus==18 +ref_Xa=103.866 +ref_Ya=100.000 +ref_Za=65.627 +fi +nt_Xa={$Xca/$ref_Xa} +nt_Ya={$Yca/$ref_Ya} +nt_Za={$Zca/$ref_Za} +if $nt_Xa>0.008856 +nt_Xa={($nt_Xa)^{1/3}} +else +nt_Xa={{7.787*$nt_Xa}+{16/116}} +fi +if $nt_Ya>0.008856 +nt_Ya={($nt_Ya)^{1/3}} +else +nt_Ya={{7.787*$nt_Ya}+{16/116}} +fi +if $nt_Za>0.008856 +nt_Za={($nt_Za)^{1/3}} +else +nt_Za={{7.787*$nt_Za}+{16/116}} +fi +CIE_La={{116*$nt_Ya}-16} +CIE_aa={500*{$nt_Xa-$nt_Ya}} +CIE_ba={200*{$nt_Ya-$nt_Za}} +if $Choix==1 +if $Type_de_demande==0 u {$CIE_La}","{$CIE_aa}","{$CIE_ba} +elif $Type_de_demande==1 u {$CIE_La} +elif $Type_de_demande==2 u {$CIE_aa} +elif $Type_de_demande==3 u {$CIE_ba} +fi +elif $Choix==0 +var_H={atan2($CIE_ba,$CIE_aa)} +if $var_H>0 +var_H={{$var_H/pi}*180} +else +var_H={360-{{abs($var_H)/pi}*180}} +fi +CIE_L=$CIE_La +CIE_C={({{$CIE_aa*$CIE_aa}+{$CIE_ba*$CIE_ba}})^0.5} +CIE_H=$var_H +if $Type_de_demande==0 u {$CIE_L}","{$CIE_C}","{$CIE_H} +elif $Type_de_demande==1 u {$CIE_L} +elif $Type_de_demande==2 u {$CIE_C} +elif $Type_de_demande==3 u {$CIE_H} +fi +fi +samj_LCH_or_Lab_to_RGB: +Type_de_demande=$1 +Matrices_RGB=$5 +XYZ_Tristimulus=$6 +Choix=$7 +if $Choix==1 +CIE_Lca=$2 +CIE_aca=$3 +CIE_bca=$4 +elif $Choix==0 +CIE_Lca=$2 +CIE_aca={{cos(pi/180*$4)}*$3} +CIE_bca={{sin(pi/180*$4)}*$3} +fi +nt_Yca={{$CIE_Lca+16}/116} +nt_Xca={$CIE_aca/500+$nt_Yca} +nt_Zca={$nt_Yca-$CIE_bca/200} +if {($nt_Yca)^3}>0.008856 +nt_Yca={($nt_Yca)^3} +else +nt_Yca={{$nt_Yca-16/116}/7.787} +fi +if {($nt_Xca)^3}>0.008856 +nt_Xca={($nt_Xca)^3} +else +nt_Xca={{$nt_Xca-16/116}/7.787} +fi +if {($nt_Zca)^3}>0.008856 +nt_Zca={($nt_Zca)^3} +else +nt_Zca={{$nt_Zca-16/116}/7.787} +fi +ref_Xca=100.000 +ref_Yca=100.000 +ref_Zca=100.000 +if $XYZ_Tristimulus==0 +ref_Xca=109.850 +ref_Yca=100.000 +ref_Zca=35.585 +elif $XYZ_Tristimulus==1 +ref_Xca=98.074 +ref_Yca=100.000 +ref_Zca=118.232 +elif $XYZ_Tristimulus==2 +ref_Xca=96.422 +ref_Yca=100.000 +ref_Zca=82.521 +elif $XYZ_Tristimulus==3 +ref_Xca=95.682 +ref_Yca=100.000 +ref_Zca=92.149 +elif $XYZ_Tristimulus==4 +ref_Xca=95.047 +ref_Yca=100.000 +ref_Zca=108.883 +elif $XYZ_Tristimulus==5 +ref_Xca=94.972 +ref_Yca=100.000 +ref_Zca=122.638 +elif $XYZ_Tristimulus==6 +ref_Xca=99.187 +ref_Yca=100.000 +ref_Zca=67.395 +elif $XYZ_Tristimulus==7 +ref_Xca=95.044 +ref_Yca=100.000 +ref_Zca=108.755 +elif $XYZ_Tristimulus==8 +ref_Xca=100.966 +ref_Yca=100.000 +ref_Zca=64.370 +elif $XYZ_Tristimulus==10 +ref_Xca=111.144 +ref_Yca=100.000 +ref_Zca=35.200 +elif $XYZ_Tristimulus==11 +ref_Xca=97.285 +ref_Yca=100.000 +ref_Zca=116.145 +elif $XYZ_Tristimulus==12 +ref_Xca=96.720 +ref_Yca=100.000 +ref_Zca=81.427 +elif $XYZ_Tristimulus==13 +ref_Xca=95.799 +ref_Yca=100.000 +ref_Zca=90.926 +elif $XYZ_Tristimulus==14 +ref_Xca=94.811 +ref_Yca=100.000 +ref_Zca=107.304 +elif $XYZ_Tristimulus==15 +ref_Xca=94.416 +ref_Yca=100.000 +ref_Zca=120.641 +elif $XYZ_Tristimulus==16 +ref_Xca=103.280 +ref_Yca=100.000 +ref_Zca=69.026 +elif $XYZ_Tristimulus==17 +ref_Xca=95.792 +ref_Yca=100.000 +ref_Zca=107.687 +elif $XYZ_Tristimulus==18 +ref_Xca=103.866 +ref_Yca=100.000 +ref_Zca=65.627 +fi +Xca={$ref_Xca*$nt_Xca} +Yca={$ref_Yca*$nt_Yca} +Zca={$ref_Zca*$nt_Zca} +vcXa=$Xca +vcYa=$Yca +vcZa=$Zca +nt_X={$vcXa/100} +nt_Y={$vcYa/100} +nt_Z={$vcZa/100} +nt_R={$nt_X*1.0000000+$nt_Y*0.0000000+$nt_Z*0.0000000} +nt_G={$nt_X*0.0000000+$nt_Y*1.0000000+$nt_Z*0.0000000} +nt_B={$nt_X*0.0000000+$nt_Y*0.0000000+$nt_Z*1.0000000} +if $Matrices_RGB==0 +nt_R={$nt_X*2.0413690+$nt_Y*-0.5649464+$nt_Z*-0.3446944} +nt_G={$nt_X*-0.9692660+$nt_Y*1.8760108+$nt_Z*0.0415560} +nt_B={$nt_X*0.0134474+$nt_Y*-0.1183897+$nt_Z*1.0154096} +elif $Matrices_RGB==1 +nt_R={$nt_X*2.9515373+$nt_Y*-1.2894116+$nt_Z*-0.4738445} +nt_G={$nt_X*-1.0851093+$nt_Y*1.9908566+$nt_Z*0.0372026} +nt_B={$nt_X*0.0854934+$nt_Y*-0.2694964+$nt_Z*1.0912975} +elif $Matrices_RGB==2 +nt_R={$nt_X*1.7552599+$nt_Y*-0.4836786+$nt_Z*-0.2530000} +nt_G={$nt_X*-0.5441336+$nt_Y*1.5068789+$nt_Z*0.0215528} +nt_B={$nt_X*0.0063467+$nt_Y*-0.0175761+$nt_Z*1.2256959} +elif $Matrices_RGB==3 +nt_R={$nt_X*1.6832270+$nt_Y*-0.4282363+$nt_Z*-0.2360185} +nt_G={$nt_X*-0.7710229+$nt_Y*1.7065571+$nt_Z*0.0446900} +nt_B={$nt_X*0.0400013+$nt_Y*-0.0885376+$nt_Z*1.2723640} +elif $Matrices_RGB==4 +nt_R={$nt_X*2.7454669+$nt_Y*-1.1358136+$nt_Z*-0.4350269} +nt_G={$nt_X*-0.9692660+$nt_Y*1.8760108+$nt_Z*0.0415560} +nt_B={$nt_X*0.0112723+$nt_Y*-0.1139754+$nt_Z*1.0132541} +elif $Matrices_RGB==5 +nt_R={$nt_X*2.3706743+$nt_Y*-0.9000405+$nt_Z*-0.4706338} +nt_G={$nt_X*-0.5138850+$nt_Y*1.4253036+$nt_Z*0.0885814} +nt_B={$nt_X*0.0052982+$nt_Y*-0.0146949+$nt_Z*1.0093968} +elif $Matrices_RGB==6 +nt_R={$nt_X*2.6422874+$nt_Y*-1.2234270+$nt_Z*-0.3930143} +nt_G={$nt_X*-1.1119763+$nt_Y*2.0590183+$nt_Z*0.0159614} +nt_B={$nt_X*0.0821699+$nt_Y*-0.2807254+$nt_Z*1.4559877} +elif $Matrices_RGB==7 +nt_R={$nt_X*1.7603902+$nt_Y*-0.4881198+$nt_Z*-0.2536126} +nt_G={$nt_X*-0.7126288+$nt_Y*1.6527432+$nt_Z*0.0416715} +nt_B={$nt_X*0.0078207+$nt_Y*-0.0347411+$nt_Z*1.2447743} +elif $Matrices_RGB==8 +nt_R={$nt_X*1.7827618+$nt_Y*-0.4969847+$nt_Z*-0.2690101} +nt_G={$nt_X*-0.9593623+$nt_Y*1.9477962+$nt_Z*-0.0275807} +nt_B={$nt_X*0.0859317+$nt_Y*-0.1744674+$nt_Z*1.3228273} +elif $Matrices_RGB==9 +nt_R={$nt_X*2.0043819+$nt_Y*-0.7304844+$nt_Z*-0.2450052} +nt_G={$nt_X*-0.7110285+$nt_Y*1.6202126+$nt_Z*0.0792227} +nt_B={$nt_X*0.0381263+$nt_Y*-0.0868780+$nt_Z*1.2725438} +elif $Matrices_RGB==10 +nt_R={$nt_X*1.9099961+$nt_Y*-0.5324542+$nt_Z*-0.2882091} +nt_G={$nt_X*-0.9846663+$nt_Y*1.9991710+$nt_Z*-0.0283082} +nt_B={$nt_X*0.0583056+$nt_Y*-0.1183781+$nt_Z*0.8975535} +elif $Matrices_RGB==11 +nt_R={$nt_X*3.0628971+$nt_Y*-1.3931791+$nt_Z*-0.4757517} +nt_G={$nt_X*-0.9692660+$nt_Y*1.8760108+$nt_Z*0.0415560} +nt_B={$nt_X*0.0678775+$nt_Y*-0.2288548+$nt_Z*1.0693490} +elif $Matrices_RGB==12 +nt_R={$nt_X*1.3459433+$nt_Y*-0.2556075+$nt_Z*-0.0511118} +nt_G={$nt_X*-0.5445989+$nt_Y*1.5081673+$nt_Z*0.0205351} +nt_B={$nt_X*0.0000000+$nt_Y*0.0000000+$nt_Z*1.2118128} +elif $Matrices_RGB==13 +nt_R={$nt_X*3.5053960+$nt_Y*-1.7394894+$nt_Z*-0.5439640} +nt_G={$nt_X*-1.0690722+$nt_Y*1.9778245+$nt_Z*0.0351722} +nt_B={$nt_X*0.0563200+$nt_Y*-0.1970226+$nt_Z*1.0502026} +elif $Matrices_RGB==14 +nt_R={$nt_X*3.2404542+$nt_Y*-1.5371385+$nt_Z*-0.4985314} +nt_G={$nt_X*-0.9692660+$nt_Y*1.8760108+$nt_Z*0.0415560} +nt_B={$nt_X*0.0556434+$nt_Y*-0.2040259+$nt_Z*1.0572252} +elif $Matrices_RGB==15 +nt_R={$nt_X*1.4628067+$nt_Y*-0.1840623+$nt_Z*-0.2743606} +nt_G={$nt_X*-0.5217933+$nt_Y*1.4472381+$nt_Z*0.0677227} +nt_B={$nt_X*0.0349342+$nt_Y*-0.0968930+$nt_Z*1.2884099} +fi +if $nt_R>0.0031308 +nt_R={1.055*{($nt_R)^{1/2.4}}-0.055} +else +nt_R={12.92*$nt_R} +fi +if $nt_G>0.0031308 +nt_G={1.055*{($nt_G)^{1/2.4}}-0.055} +else +nt_G={12.92*$nt_G} +fi +if $nt_B>0.0031308 +nt_B={1.055*{($nt_B)^{1/2.4}}-0.055} +else +nt_B={12.92*$nt_B} +fi +Rconv={$nt_R*255} +Gconv={$nt_G*255} +Bconv={$nt_B*255} +if $Type_de_demande==0 u {$Rconv}","{$Gconv}","{$Bconv} +elif $Type_de_demande==1 u {$Rconv} +elif $Type_de_demande==2 u {$Gconv} +elif $Type_de_demande==3 u {$Bconv} +fi +ancien_Tom_Keil_Colortemp : +foreach { if $2==1 +luminance[-1] to_rgb[-2] +s[-2] c avb={-2,127.5-ia} avg={-3,127.5-ia} avr={-4,127.5-ia} ++[-4] $avr +[-3] $avg +[-2] $avb a[-4,-3,-2] c rv compose_luminance fi +fx_mix_lab 1,0,0,1,{if({$1>=0},{$1/4},{$1*0.75})},0,1,$1,0,0,2,0 } +ancien_gimp_morpho : +apply_channels "__ancien_gimp_morpho ${^0}",$5,$6 +__ancien_gimp_morpho : +if $4==1 suf="_oct" elif $4==0 suf="" else suf="_circ" fi +if $1==0 erode$suf $2 +elif $1==1 dilate$suf $2 +elif $1==2 erode$suf $2 dilate$suf $2 +elif $1==3 dilate$suf $2 erode$suf $2 +elif $1==4 repeat $! +erode$suf $2 --[-2,-1] mv[-1] 0 done +elif $1==5 repeat $! +dilate$suf $2 rv[-2,-1] --[-2,-1] mv[-1] 0 done +elif $1==6 repeat $! +erode$suf $2 dilate$suf[-1] $2 --[-2,-1] mv[-1] 0 done +else repeat $! +dilate$suf $2 erode$suf[-1] $2 rv[-2,-1] --[-2,-1] mv[-1] 0 done +fi +if $3 foreach { split_opacity negative[0] a c } fi +at_ancien : skip ${1=0},${2=0},${3=0} ++z. ${1-3},${1-3} u {^} rm. +gimp_blend_1651 : +mode=${arg\ 1+$1,add,alpha,and,average,blue,burn,darken,difference,divide,dodge,edges,exclusion,freeze,grainextract,grainmerge,green,hardlight,hardmix,hue,interpolation,lighten,lightness,linearburn,linearlight,luminance,multiply,negation,or,overlay,pinlight,red,reflect,saturation,shapeaverage,shapeaverage0,softburn,softdodge,softlight,screen,stamp,subtract,value,vividlight,xor} +if $2==0 repeat int($!/2) l[$>,{$>+1}] rv blend $mode,$3,$4 done done +elif $2==1" && "$!>1 samj_blend_20220419[^0] [0],$mode,$3,1 rm[0] +elif $2==2" && "$!>1 samj_blend_20220419[^-1] [-1],$mode,$3,0 rm[-1] +fi +trait_epais_samj : +if {$3-$1}==0 X1={$1-{$5/2}} Y1=$2 X2={$3-{$5/2}} Y2=$4 X3={$3+{$5/2}} Y3=$4 X4={$1+{$5/2}} Y4=$2 +else +if {$4-$2}==0 X1=$1 Y1={$2+{$5/2}} X2=$3 Y2={$4+{$5/2}} X3=$3 Y3={$4-{$5/2}} X4=$1 Y4={$2-{$5/2}} +else angle_triangle={{{pi}/2}-{atan({{$4-$2}/{$3-$1}})}} X_triangle={{$5/2}*{cos($angle_triangle)}} Y_triangle={{$5/2}*{sin($angle_triangle)}} +X1={$1-$X_triangle} Y1={$2+$Y_triangle} X2={$3-$X_triangle} Y2={$4+$Y_triangle} X3={$3+$X_triangle} Y3={$4-$Y_triangle} X4={$1+$X_triangle} Y4={$2-$Y_triangle} +fi +fi +polygon[-1] 4,$X1,$Y1,$X2,$Y2,$X3,$Y3,$X4,$Y4,1,$7,$8,$9,$10 +if $6==1 circle[-1] $1,$2,{$5/2},1,$7,$8,$9,$10 circle[-1] $3,$4,{$5/2},1,$7,$8,$9,$10 fi +samj_sierpinski_absolu : check ${1=7}>=0 skip ${2=0},${3=0},${4=10},${5=100},${6=150},${7=20},${8=255},${9=255},${10=0},${11=255} +e[^-1] "Draw Sierpinski triangle of degree $1 on image$?." +_samj_sierpinski_absolu ${2-11},$1 +_samj_sierpinski_absolu : +if $11<=0 polygon 3,$1,$2,$3,$4,$5,$6,1,$7,$8,$9,$10 return fi +_samj_sierpinski_absolu $1,$2,{($1+$3)/2},{($2+$4)/2},{($1+$5)/2},{($2+$6)/2},$7,$8,$9,$10,{$11-1} +_samj_sierpinski_absolu {($1+$3)/2},{($2+$4)/2},$3,$4,{($3+$5)/2},{($4+$6)/2},$7,$8,$9,$10,{$11-1} +_samj_sierpinski_absolu {($1+$5)/2},{($2+$6)/2},$5,$6,{($3+$5)/2},{($4+$6)/2},$7,$8,$9,$10,{$11-1} +samj_snowflake_absolu : +to_rgba +polygon 3,$2,$3,$4,$5,$6,$7,${8--1},255 +_samj_snowflake_absolu $1,$2,$3,$6,$7,${8--1} +_samj_snowflake_absolu $1,$6,$7,$4,$5,${8--1} +_samj_snowflake_absolu $1,$4,$5,$2,$3,${8--1} +_samj_snowflake_absolu : +x0={$2+($4-$2)/3} y0={$3+($5-$3)/3} +x1={$2+2*($4-$2)/3} y1={$3+2*($5-$3)/3} +c={cos(-pi/3)} s={sin(-pi/3)} +x2={$x0+($x1-$x0)*$c-($y1-$y0)*$s} y2={$y0+($x1-$x0)*$s+($y1-$y0)*$c} +polygon 3,$x0,$y0,$x1,$y1,$x2,$y2,${6--1},255 +if $1 +_samj_snowflake_absolu {$1-1},$2,$3,$x0,$y0,${6--1} +_samj_snowflake_absolu {$1-1},$x0,$y0,$x2,$y2,${6--1} +_samj_snowflake_absolu {$1-1},$x2,$y2,$x1,$y1,${6--1} +_samj_snowflake_absolu {$1-1},$x1,$y1,$4,$5,${6--1} +fi +samj_snowflake_contours_absolu : +to_rgba +polygon 3,$2,$3,$4,$5,$6,$7,$8,0xFFFFFFFF,$9,$10,$11,255 +_samj_snowflake_contours_absolu $1,$2,$3,$6,$7,${8--1} +_samj_snowflake_contours_absolu $1,$6,$7,$4,$5,${8--1} +_samj_snowflake_contours_absolu $1,$4,$5,$2,$3,${8--1} +_samj_snowflake_contours_absolu : +x0={$2+($4-$2)/3} y0={$3+($5-$3)/3} +x1={$2+2*($4-$2)/3} y1={$3+2*($5-$3)/3} +c={cos(-pi/3)} s={sin(-pi/3)} +x2={$x0+($x1-$x0)*$c-($y1-$y0)*$s} y2={$y0+($x1-$x0)*$s+($y1-$y0)*$c} +polygon 3,$x0,$y0,$x1,$y1,$x2,$y2,$6,0xFFFFFFFF,${7--1},255 +if $1 +_samj_snowflake_contours_absolu {$1-1},$2,$3,$x0,$y0,${6--1} +_samj_snowflake_contours_absolu {$1-1},$x0,$y0,$x2,$y2,${6--1} +_samj_snowflake_contours_absolu {$1-1},$x2,$y2,$x1,$y1,${6--1} +_samj_snowflake_contours_absolu {$1-1},$x1,$y1,$4,$5,${6--1} +fi +twirl_ancien_euclidean2polar_ancien_polar2euclidean : skip ${1=1},${2=50%},${3=50%},${4=1} +e[^-1] "Apply twirl deformation on image$?, with amplitude $1 and center point at ($2%,$3%)." +euclidean2polar_ancien $2,$3,1,$4 repeat $! +[$>],[$>],1,1,$1*x channels[-1] -1,0 warp[$>] [-1],1,1,2 rm[-1] +done polar2euclidean_ancien $2,$3,1,1 +euclidean2polar_ancien : skip ${1=0.5},${2=0.5},${3=1},${4=1} +e[^-1] "Apply euclidean to polar transform on image$?." +foreach { +({w},{h}) ($1,$2) *[-2,-1] ({"sqrt(max("{@0}","{-2,w}"-"{@0}")^2 + max("{@1}","{-2,h}"-"{@1}")^2)"}) +a[-2,-1] x +[-2],[-2],1,1,{@2}"*(x/w)^$3*cos(y*2*pi/h)" +[-1] {-2,@0} +[-1],[-1],1,1,{-2,@2}"*(x/w)^$3*sin(y*2*pi/h)" +[-1] {-3,@1} +rm[-3] a[-2,-1] c warp[-2] [-1],0,1,$4 rm[-1] +} +polar2euclidean_ancien : skip ${1=0.5},${2=0.5},${3=1},${4=1} +e[^-1] "Apply polar to euclidean transform on image$?." +foreach { +({w},{h}) ($1,$2) *[-2,-1] ({"sqrt(max("{@0}","{-2,w}"-"{@0}")^2 + max("{@1}","{-2,h}"-"{@1}")^2)"}) +a[-2,-1] x +[-2],[-2],1,1,"w*(sqrt((x-"{@0}")^2 + (y-"{@1}")^2)/"{@2}")^(1/$3)" +[-1],[-1],1,1,"(atan2(y-"{-2,@1}",x-"{-2,@0}")*h/(2*pi)+h)%h" +rm[-3] a[-2,-1] c warp[-2] [-1],0,1,$4 rm[-1] +} +samj_test_A : +or[-1] {$1} to_rgb[-1] and[-1] {$2} smooth[-1] $3 n[-1] 0,255 Couleurs_Metalliques[-1] 0,0,22,0,0,0,0,6,5,20,1,0,0,0,0.3,60,1,1,0 +samj_test_B : +samj_Points_Aleatoires_001[-1] $1,255,255,0,255,3,1,1 +Je_passe_l_hiver_en_Floride[-1] fx_flower[-1] 30,6,100,0,50,50,1 to_rgb[-1] smooth[-1] 500 n[-1] 0,255 Couleurs_Metalliques[-1] 0,0,22,0,0,0,0,6,5,20,1,0,0,0,0.3,60,1,1,0 fx_boost_chroma[-1] 1,0,0 +samj_test_C : +samj_Points_Aleatoires_001[-1] $1,255,255,0,255,3,1,1 +Je_passe_l_hiver_en_Floride[-1] fx_segment_watershed[-1] 8,0,0,0,0 fx_flower[-1] 10,20,0,360,50,50,1 Couleurs_Metalliques[-1] 0,0,22,0,0,0,0,6,5,20,1,0,0,0,0.3,60,1,1,0 +samj_test_x_color_curves : +Utiliser=$1 +Appliquer_courbes=$2 +if $Utiliser==0 +if $Appliquer_courbes==0 +blur[-1] 5 +elif $Appliquer_courbes==1 +x_color_curves[-1] last +elif $Appliquer_courbes==2 +x_color_curves[-1] rgb +elif $Appliquer_courbes==3 +x_color_curves[-1] cmy +elif $Appliquer_courbes==4 +x_color_curves[-1] cmyk +elif $Appliquer_courbes==5 +x_color_curves[-1] hsi +elif $Appliquer_courbes==6 +x_color_curves[-1] hsl +elif $Appliquer_courbes==7 +x_color_curves[-1] hsv +elif $Appliquer_courbes==8 +x_color_curves[-1] lab +elif $Appliquer_courbes==9 +x_color_curves[-1] lch +elif $Appliquer_courbes==10 +x_color_curves[-1] ycbcr +fi +else +if $Appliquer_courbes==0 +blur[-1] 5 +elif $Appliquer_courbes==1 +deform[-1] 20 +elif $Appliquer_courbes==2 +fx_curves_interactive[-1] 0,0,0,0,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100 +elif $Appliquer_courbes==3 +fx_curves_interactive[-1] 1,0,0,0,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100 +elif $Appliquer_courbes==4 +fx_curves_interactive[-1] 2,0,0,0,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100 +elif $Appliquer_courbes==5 +fx_curves_interactive[-1] 3,0,0,0,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100 +elif $Appliquer_courbes==6 +fx_curves_interactive[-1] 4,0,0,0,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100 +elif $Appliquer_courbes==7 +fx_curves_interactive[-1] 5,0,0,0,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100 +elif $Appliquer_courbes==8 +fx_curves_interactive[-1] 6,0,0,0,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100 +elif $Appliquer_courbes==9 +fx_curves_interactive[-1] 7,0,0,0,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100 +elif $Appliquer_courbes==10 +fx_curves_interactive[-1] 8,0,0,0,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100,-1,0,0,100,100 +fi +fi +samj_test_D : +Var_sub=$1 +Var_n=$2 +Var_spread=$3 +Var_dilate=$4 +Var_blur=$5 +Deformation=$6 +Levels=$7 +Smoothness=$8 +Var_dilate_circ=$9 +Inner_fading=$10 +Outer_fading=$11 ++Je_passe_l_hiver_en_Floride[-1] +if $Var_sub>0 +sub[-1] $Var_sub +abs[-1] +fi +n[-1] 0,$Var_n +if $Var_spread>0 spread[-1] $Var_spread fi +if $Var_dilate>0 dilate[-1] $Var_dilate fi +if $Var_blur>0 blur[-1] $Var_blur fi +if $Deformation>0 deform[-1] $Deformation fi +fx_isophotes[-2] $Levels,$Smoothness,0 +if $Var_dilate_circ>0 dilate_circ[-2] $Var_dilate_circ fi +fx_blend_seamless[-2,-1] 0,$Inner_fading,$Outer_fading,0,0 +samj_test_Dither_Color : +Flou_a=$1 +Dilatation=$2 +R_C=$3 +V_C=$4 +B_C=$5 +Tolerance_C=$6 +Smoothness_C=$7 ++Je_passe_l_hiver_en_Floride[-1] +gradient_norm[-1] +blur[-1] $Flou_a +dilate_circ[-1] $Dilatation +negative[-1] +n[-1] 0,255 +ditheredbw[-1] +to_rgb[-1] +samj_blend_20220419[-1,-2] add +to_rgb[-1] +n[-1] 0,255 +replace_color[-1] $Tolerance_C,$Smoothness_C,255,255,255,$R_C,$V_C,$B_C +samj_test_E : +exemple=$1 +sharpness=$2 +anisotropy=$3 +alpha=$4 +sigma=$5 +is_sqrt=$6 +rf=$7 +vf=$8 +bf=$9 +Mode=$10 +Opacity=$11 +if $exemple==1 +anisotropy=0 +alpha=0 +sigma=0 +elif $exemple==2 +anisotropy=0 +alpha=4 +sigma=0 +elif $exemple==3 +sharpness=0.5 +anisotropy=0.3 +alpha=$4 +sigma/=10 +is_sqrt=1 +fi +diffusiontensors[-1] $sharpness,$anisotropy,$alpha,$sigma,$is_sqrt +n[-1] 0,255 +equalize[-1] +fx_decompose_channels[-1] 4,0,1,0 +remove[-1,-2] +to_rgb[-1] +fx_8bits[-1] 100,10000,256 +{w},{h},1,3 +fill_color[-1] $rf,$vf,$bf +gimp_blend_1651[-1,-2] $Mode,0,$Opacity,0 +samj_test_F : +repeat $3 +fx_custom_deformation "cos(x*$1)*$2*sin(y)*(w+h)/10000","cos(y*$1)*$2*sin(x)*(w+h)/10000",1,1,1 +done +samj_test_G : +fx_spread $1,$1,0,0,0 +fx_boost_fade[-1] $2,0 ++Je_passe_l_hiver_en_Floride[-1] +fx_local_orientation[-1] $3,0,100,0,16,0 +fx_blend[-1,-2] 14,0,1,1,"0" +fx_lightglow[-1] $4,0.5,8,0.8,0,0 +samj_Test_Solidify : +Epaisseur=$1 +Precision=$2 +Coeff_Precision_Pixelise=$3 +Coeff_Precision_Flou=$4 +Nb_Isophotes=$5 +Valider_Solidify=$6 +smoothness=$7 +diffusion_type=$8 +diffusion_iter=$9 +samj_Quelques_Isophotes[-1] $Epaisseur,$Precision,$Coeff_Precision_Pixelise,$Coeff_Precision_Flou,$Nb_Isophotes +if $Valider_Solidify==1 solidify[-1] $smoothness,$diffusion_type,$diffusion_iter fi +samj_Tests_Fill : +if $1==0 +fill "X=x-w/2; Y=y-h/2; R=sqrt(X^2+Y^2); a=atan2(Y,X); if(R<=(w/100*$2),255*abs(cos(c+200*(x/w-0.5)*(y/h-0.5))),850*(a%(0.1*(c+1))))" +elif $1==1 +fill "zr = $3 + $3*-2*x/w; zi = $3 + $3*-2*y/h; for (iter = 0, zr^2+zi^2<=4 && iter<256, ++iter, t = zr^2 - zi^2 + $4; (zi *= 2*zr) += $5; zr = t); zi;" +elif $1==2 +fill "z = 2.4*[ x/w, y/h ] - 1.2; for (iter = 0, cabs(z)<=2 && iter<256, ++iter, z = z**z + [ 0.4,0.2 ]); iter;" +elif $1==3 +fill "t=x/40;if(c==0,sin(t),cos(t))*(exp(cos(t))-2*cos(4*t)-sin(t/12)^5)" +if $6==1 display_parametric 512,512 fi +elif $1==4 +fill "dmax = -1; nmax = 0; for (n = 0, ++n<=8, p = arg(n,-$7,0,$7,-$7,$7,-$7,0,$7); q = arg(n,-$7,-$7,-$7,0,0,$7,$7,$7); d = (j(p,q,0,0,0,1)-i)^2; if(d>dmax,dmax = d; nmax = n,nmax) )" +elif $1==5 +if $8==0 +fill "1/w*x" +elif $8==1 +fill "1/h*y" +elif $8==2 +fill 'y/h+x/w' +elif $8==3 +fill '(i*(x+y))' +elif $8==4 +fill "!c?x:c==1?y:(x+y)/2" +fi +elif $1==6 +fill "[(G+B)/2,(R+B)/2,(R+G)/2]" +elif $1==7 +if $9==0 +fill "x==y*w/h" +elif $9==1 +fill "x!=y*w/h" +elif $9==2 +fill "x==h-y" +elif $9==3 +fill "0,0,0,0,0.5,0.5,0.5,0.5,1,1,1,1" +elif $9==4 +fill "x!=w/2" +fi +elif $1==8 +if $10==0 +Dimension=16 +1,2,1,3 +fill "255,255,0,255,255,0,0,255" +resize[-1] $Dimension,$Dimension +{$Dimension*16},{$Dimension*16},1,4 +fill [-2] +rm[0] +rv[-1,-2] +elif $10==1 +{w},{h},1,3 +rm[0] +fill "x=x-w/2;y=y-h/2;r=sqrt(x*x+y*y);a=atan2(y,x);5*sin(r/10)*[cos(a),sin(a)]" +fi +elif $1==11 +if $14==0 +fill "x%(10+$15)" +elif $14==1 +fill "y%(10+$15)" +elif $14==2 +fill "x&(1+5*$15)" +elif $14==3 +fill "y&(1+5*$15)" +elif $14==4 +fill "i%(10+$15)" +elif $14==5 +fill "xor(i,(10+$15))" +elif $14==6 +fill "xor((x+($15*10)),(y+($15*10)))" +elif $14==7 +fill "xor(i,xor((x+($15*10)),(y+($15*10))))" +elif $14==8 ++blur {$15/4} +repeat 2 +fill[-1] "dmax=-1; nmax=0; for (n=0, ++n<=8, p=arg(n,-4,0,4,-4,4,-4,0,4); q=arg(n,-4,-4,-4,0,0,4,4,4); d=(j(p,q,0,0,0,1)-i)^2; if(d>dmax,dmax=d; nmax=n,nmax))" +done +fill[-1] "[(R+G+B)/3,(R+G+B)/3,(R+G+B)/3]" +fill[-1] "-i" +n[-1] 0,255 +blend grainmerge +fill "[(G+B)/2,(R+B)/2,(R+G)/2]" +elif $14==9 +{w},{h},1,1 +rm[0] +Orientation=(round($15)%4) +if $Orientation==0 ++fill "x%(16+$15)" +fill[-2] "y%(16+$15)" +elif $Orientation==1 ++fill "-x%(15+$15)" +fill[-2] "y%(15+$15)" +elif $Orientation==2 ++fill "x%(14+$15)" +fill[-2] "-y%(14+$15)" +elif $Orientation==3 ++fill "-x%(13+$15)" +fill[-2] "-y%(13+$15)" +fi +n 0,255 +to_rgb +blend average +elif $14==10 +{w},{h},1,4 +if (round($15)%2)==0 +fill[-1] "x=x-w/2;y=y-h/2;r=sqrt(x*x+y*y);r*sin((1+$15*2)*(x-y)/(x+y));" +else +fill[-1] "x=x-w/2;y=y-h/2;r=sqrt(x*x+y*y);r*sin((1+$15*2)*(x+y)/(x-y));" +fi +n[-1] 128,255 +blend alpha +elif $14==11 +if (round($15)%2)==0 +fill "if(i>(255/100*$15),((x+y)%40),((x-y)%40))" +else +fill "if(i<(255/100*$15),((x+y)%40),((x-y)%40))" +fi +elif $14==12 +if (round($15)%2)==0 +fill "(i>(255/100*$15))&&((x+y)%20)&&((x-y)%20)" +else +fill "(i<(255/100*($15-1)))&&((x+y)%20)&&((x-y)%20)" +fi +fi +fi +n 0,255 +if $1==9 +fill "[$11,$12,$13]" +elif $1==10 +min={stats()[0]} +max={stats()[1]} +fill "-i" +n $min,$max +fi +samj_gimp_texture_zero_zero_deux : +Details_TA=$1 +Polygonize_Resolution_TA=$2 +Threshold_Thin_Edges_TA=$3 +Edges_Threshold=$4 +Blend_Colors_Opacity=$5 +Colors_Boost=$6 +Boost_Intensity=$7 +Black_Lines=$8 +Blend_Black_Lines_Opacity=$9 ++Je_passe_l_hiver_en_Floride[-1] +if $Colors_Boost==1 +n[-1] 0,255 +fi +samj_Toile_D_Araignee[-1] $Details_TA,$Polygonize_Resolution_TA,$Threshold_Thin_Edges_TA +if $Black_Lines==1 ++Je_passe_l_hiver_en_Floride[-1] +fx_edges[-1] 0,$Edges_Threshold,0 +fx_local_orientation[-1] 0,0,100,0,0,0 +samj_blend_20220419[-1,-3] average,$Blend_Colors_Opacity,0 +samj_blend_20220419[-1,-2] luminance,$Blend_Black_Lines_Opacity,0 +else +fx_edges[-1] 0,$Edges_Threshold,0 +fx_local_orientation[-1] 0,0,100,0,0,0 +samj_blend_20220419[-1,-2] average,$Blend_Colors_Opacity,0 +fi +if $Colors_Boost==1 ++Je_passe_l_hiver_en_Floride[-1] +n[-1,-2] 0,255 +samj_blend_20220419[-1,-2] softlight,$Boost_Intensity,0 +fi +samj_Texture_Aquarelle_1 : +Amplitude_Noise=$1 +Density_Hardsketchbw=$2 +Spread_Variations=$3 +Amplitude_Water=$4 +R3=$5 +V3=$6 +B3=$7 +Opacite=$8 +{w},{h},1,3 +rm[-2] +fill_color[-1] 255,255,255 +to_rgb[-1] +fx_noise[-1] $Amplitude_Noise,0,2,0 +fx_hardsketchbw[-1] 300,$Density_Hardsketchbw,1,0.1,20,0,0 +{w},{h},1,3 +fill_color[-1] 255,255,255 +to_rgb[-1] +fx_noise[-1] $Amplitude_Noise,0,2,0 +fx_hardsketchbw[-1] 300,$Density_Hardsketchbw,1,0.1,20,0,0 +fx_spread[-1] $Spread_Variations,$Spread_Variations,0,0 +samj_blend_20220419[-1,-2] average,1,0 +water[-1] $Amplitude_Water,0 +{w},{h},1,3 +fill_color[-1] $R3,$V3,$B3 +to_rgb[-1] +if $Opacite>=0 +samj_blend_20220419[-1,-2] average,$Opacite,0 +else +samj_blend_20220419[-1,-2] edges,{1+$Opacite},1 +fi +samj_Toile_D_Araignee : +Details=$1 +Polygonize_Resolution=$2 +Threshold_Thin_Edges=$3 +apply_curve[0] $Details,-1,128,-1,128,-1,128,-1,128,-1,128,255,1,0,0,0,0 ++Je_passe_l_hiver_en_Floride[-1] ++Je_passe_l_hiver_en_Floride[-1] +fx_polygonize[-2] 300,100,0,$Polygonize_Resolution,$Polygonize_Resolution,0,0,0,255 +fx_thin_edges[-1] 0,$Threshold_Thin_Edges,0 +fx_blend[-2,-1] 36,1,1,,"0" +fx_isophotes[-1] 8,0,1 +fx_blend_edges[-2,-1] 1,5,0 +to_rgb[-1] +rgb2hsl8[-1] +split[-1] c +rm[-2,-3] +fx_thin_edges[-1] 0,15,0,0 +samj_test_tout_interactif : +x_paint[-1] +threshold[-1] +n[-1] 0,255 +samj_Triangles_Lignes : +Quantite=$1 +Variation=$2 +Graine=$3 +Degradation=$4 +AlphaPoly=$5 +PCL=$6 +AlphaLA=$7 +AlphaLB=$8 +AlphaLC=$9 +DilateLignes=$10 +FR=$11 +VR=$12 +BR=$13 +AR=$14 +foreach { +MaxL={round($Quantite/100*$PCL)+1} +srand $Graine +to_rgba +{w},{h},1,4 +{w},{h},1,4 +rv +repeat $Quantite +Index=$> +X1p={round(u*{w})} +Y1p={round(u*{h})} +X2p={$X1p+round(u*$Variation/100*{h})+1} +Y2p={$Y1p+round(u*$Variation/100*{h})+1} +X3p={$X1p+round(u*$Variation/100*{h})+1} +Y3p={$Y1p+round(u*$Variation/100*{h})+1} +OrigineH=$X1p +OrigineV=$Y1p +couleur_pixel={I(#-1,$OrigineH,$OrigineV)} +Rp={arg(1,$couleur_pixel)} +Vp={arg(2,$couleur_pixel)} +Bp={arg(3,$couleur_pixel)} +Ap={arg(4,$couleur_pixel)} +polygon.. 3,$X1p,$Y1p,$X2p,$Y2p,$X3p,$Y3p,1,$Rp,$Vp,$Bp,{$AlphaPoly*$Ap} +if $Index<$MaxL +a_Ligne={{$Y2p-$Y1p}/{$X2p-$X1p}} +b_Ligne={$Y2p-($a_Ligne*$X2p)} +X_Ex_a=0 +Y_Ex_a=$b_Ligne +X_Ex_b={{w}-1} +Y_Ex_b={{$a_Ligne*$X_Ex_b}+$b_Ligne} +if $Y_Ex_b>=0 line... $X_Ex_a,$Y_Ex_a,$X_Ex_b,$Y_Ex_b,1,$Rp,$Vp,$Bp,{$AlphaLA*$Ap} fi +a_Ligne={{$Y2p-$Y3p}/{$X2p-$X3p}} +b_Ligne={$Y2p-($a_Ligne*$X2p)} +X_Ex_a=0 +Y_Ex_a=$b_Ligne +X_Ex_b={{w}-1} +Y_Ex_b={{$a_Ligne*$X_Ex_b}+$b_Ligne} +if $Y_Ex_b>=0 line... $X_Ex_a,$Y_Ex_a,$X_Ex_b,$Y_Ex_b,1,$Rp,$Vp,$Bp,{$AlphaLB*$Ap} fi +a_Ligne={{$Y1p-$Y3p}/{$X1p-$X3p}} +b_Ligne={$Y1p-($a_Ligne*$X1p)} +X_Ex_a=0 +Y_Ex_a=$b_Ligne +X_Ex_b={{w}-1} +Y_Ex_b={{$a_Ligne*$X_Ex_b}+$b_Ligne} +if $Y_Ex_b>=0 line... $X_Ex_a,$Y_Ex_a,$X_Ex_b,$Y_Ex_b,1,$Rp,$Vp,$Bp,{$AlphaLC*$Ap} fi +fi +done +if $DilateLignes>1 dilate_circ... $DilateLignes fi +rm. +blend alpha +{w},{h},1,4 +fill_color. $FR,$VR,$BR,$AR +rv +blend alpha +if $Degradation>0 kuwahara. $Degradation fi +} +disco_preview : +disco ${1--1} +disco : +repeat $! l[$>] +sh. 0 +f. " +begin( +rl=$1; +gl=$2; +bl=$3; +zoom=$4; +q=2*pi; +); +X=(2*x/(w-1))-1; +Y=1-(2*y/(h-1)); +a=atan2(Y,X); +if (a<0,a=a+(2*pi)); +r=sqrt(X*X+Y*Y); +rz=r*zoom; +RRR=abs(sin(rz/rl+q)+sin(a*rl+q)); +GGG=abs(sin(rz/gl+q)+sin(a*gl+q)); +BBB=abs(sin(rz/bl+q)+sin(a*bl+q)); +i(#0,x,y,0,1)=GGG*255; +i(#0,x,y,0,2)=BBB*255; +RRR*255" +rm. +done done +KittyRings_preview : +KittyRings ${1--1} +KittyRings : +repeat $! l[$>] +sh. 0 +f. " +begin( +sectors=$1; +zoom=$2; +inner=$3; +outer=$4; +R1=$5; +G1=$6; +B1=$7; +R2=$8; +G2=$9; +B2=$10 +); +X=(2*x/(w-1))-1; +Y=1-(2*y/(h-1)); +a=atan2(Y,X); +if (a<0,a=a+(2*pi)); +r=sqrt(X*X+Y*Y); +rfloor=int(log(r)*zoom); +if(log(r)*zoom<0,rfloor=rfloor-1); +v=(sectors*a/(pi*2))+(rfloor*0.5); +vfloor=int(v); +if(v<0,vfloor=vfloor-1); +v=v-vfloor; +outR=0; +outG=0; +outB=0; +if (r>inner && r0.15 && v <0.5,outR=R1; outG=G1; outB=B1); +if (v>0.5 && v <0.65,outR=255; outG=255; outB=255); +if (v>0.65 && v <1,outR=R2; outG=G2; outB=B2); +); +i(#0,x,y,0,1)=outG; +i(#0,x,y,0,2)=outB; +outR" +rm. +done done +moon2panorama_preview : +moon2panorama ${1--1} +moon2panorama : +repeat $! l[$>] ++f. 0 +sh. 0 +f. " +begin( +center_help=$1; +center_x=$2; +center_y=$3; +span=$4; +shift_x=$5; +shift_y=$6; +Antialias = $7; +XEdgeType = $8; +YEdgeType = $9; +AR=w/h; +if (AR>1, W=2;H=2/AR,H=2;W=2/AR); +minXY=min(W/2,H/2); +); +if (AR>1, +X=(2*x/(w-1))-1; +Y=(1-(2*y/(h-1)))/AR, +X=((2*x/(w-1))-1)/AR; +Y=1-(2*y/(h-1)) +); +scaled=X/W*span; +scaledi=(Y/(1+9*center_help))/W*span; +shifted=(scaled-shift_x)*pi/180; +shiftedi=(scaledi-shift_y)*pi/180; +reshifted=shiftedi; +reshiftedi=-shifted; +remapped=-exp(reshifted)*sin(reshiftedi); +remappedi=exp(reshifted)*cos(reshiftedi); +centered=(remapped*0.8+center_x/100)*minXY; +centeredi=(remappedi*0.8+center_y/100)*minXY; +if (center_help && abs(2*Y/H)<0.01, +outR=255; +outG=255; +outB=0; +outA=255, +if (AR>1, +realx=(centered+1)*(w-1)/2; +realy=(1-AR*centeredi)*(h-1)/2, +realx=(AR*centered+1)*(w-1)/2; +realy=(1-centeredi)*(h-1)/2 +); +if(realx<0 || realx>=w, +if(XEdgeType==1, +realx=realx%w; +if(realx<0,realx=w+realx) +); +if(XEdgeType==2, +realx=abs(realx%w); +if(realx=h, +if(YEdgeType==1, +realy=realy%h; +if(realy<0,realy=h+realy) +); +if(YEdgeType==2, +realy=abs(realy%h); +if(realy] +sh. 0 +f. " +begin( +red_rotations=$1; +green_rotations=$2; +blue_rotations=$3; +if ($4==1,direction=-1,direction=1); +); +X=(2*x/(w-1))-1; +Y=1-(2*y/(h-1)); +a=atan2(Y,X); +if (a<0,a=a+(2*pi)); +r=sqrt(X*X+Y*Y); +RRR=sin(r*red_rotations*pi*2+a*direction+2*pi)*0.5+0.5; +GGG=sin(r*green_rotations*pi*2+a*direction+2*pi)*0.5+0.5; +BBB=sin(r*blue_rotations*pi*2+a*direction+2*pi)*0.5+0.5; +i(#0,x,y,0,1)=GGG*255; +i(#0,x,y,0,2)=BBB*255; +RRR*255" +rm. +done done +#@cli shape_dragonfly : _size>=0 +#@cli : Input a 2d dragonfly binary shape with specified size. +#@cli : Default value: 'size=512'. +#@cli : $ shape_dragonfly , +shape_dragonfly : check "${1=512}>=0" +e[^-1] "Input a $1x$1 dragonfly binary shape." v - +ir={round($1)} +if !$ir 0 +else +base642img "MiBpbnQgbGl0dGxlX2VuZGlhbgoxIDEyMTcgMSAxICMxNjQyCniczZhnjFVFGIYvJVGRJgLSpfcOS28uvSiKgoKioogURSFWFMUGsTcEwW7UoAaixIogRUClCCxV2sLugkAwKLhIkXt835znhsnN8ss//tg8eb5vzjkzc2a+M3cThROJhP4KJeK/BHykQxSdL16YjKKSYmmxjFhOLC9WECuKlcXKYlWxqlhNrCZWF6uLNcWaYi1YW6wt1hHriPXEurCeWB82EBuIDcWGYqOAjcTGsInYRGxaAJuKzWBzsbnYImALsWUaW4mtxNYFsLWYAduIGbCN2LYAthXbi+3OwfZiR7FDwE5iR9hJ7CJ2DthV7CJ2E7vCbmKmeJnYXcwUe4jdA/YUe4i9xJ5ib7G32FfsI74hFhe/i6KoL15OXCHvh1cQf8JnyyuJa+T98SriOvkA3Othg/xycRbrYiP+Or5ZfgXu9bJNPlCcif8aeA1xh/xKcQa+M8134a+x3nbj08mne7b8Ksbpdb+O52bTzuMr634ofmkQXx/F493JOLLpZ1bEc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1LnxT3EH6IuZuMP47vwR6mLKZ+C78Afx7fjT+Db8KnUza34tOTZ85n9aXwT/ix1NAt/Pnn2/Of5eAFfh7/EvK3FX8HX4K/iq/AZ1GGfq33+non/SH4WvoL8bHw5+bfkV4vLyL+NLyX/Lr6Y/Pt8txfhH+AL8Q9p/y0+h/w3+Mf4V/intP+C583F55Ofh39O/jP6P4/8fPJzyX9B/hPyXzJfc8h/jX9E/hvm/wPyC3h/7+ELef/v4IuS8bn4TXwx63kWvoTv9gzc5yuv/+m8/x84L7xMfjnnixfJu756nz5H3u7fX8+Q93nR9WAaebvryVTcdbib+CTtfY5znXuMvOux6+Rkxm93nZ2E+7znOv0A7jrtOn8P7nOgz5MT5Bfi/t07nrz3pb9HY3HXbf+eHh24f4ePxH1+9Pd1ROD+Xg/HXd/9/R9G/32+9HliSJD3+WZQkPd56Yog7/rbN7h/MbF70J8iYhfc/68wiyfPusdZDKZ7Me6X7hecI/5/87Cf/9XT5+W8RHz+LMK82ZN4cfxM4IVoXzQRn5ccL0Hc7fyvptPESyZjP048dOdLBV4U933yC8ify83CsEgyvk+KReHg9lH0L+17LGAxIDI1IDEgMSAjNjIKeJxzZ2Bg8AXiKAYIiAZiIyBOAWIFKF0ExIlAnA7E+UCcB8RpQJwDxJVQdcVAnAFVVwDEqUAcCzUTAKELCFQ=" +decompress_rle. r. $ir,$ir,1,1,5 if $ir>512 b. 0.2% fi >=. 40% +fi +nm "[2d dragonfly shape]" v + +mc_flou: +if $4==0 +to_rgb +apply_gamma[0] $5 +c[0] $6,$7 n[0] 0,255 +s[0] c +apply_gamma[0] $8 +apply_gamma[1] $9 +apply_gamma[2] $10 +a[0,1,2] c +fi ++fx_gradient_norm[0] 0,1.5,0,50.38,1,0 +sharpen[0] $1 +b[1] 0.5 +n[1] 0,255 +equalize[1] 4,0%,98% ++a[0,1] c +b[2] $2 +blend[0,2] alpha,$3 +remove_opacity[0] +k[0] +mc_flou_preview: +gui_split_preview "-mc_flou $*",$-1 +mc_pendraw: +repeat $! l[$>] +split_opacity +l[0] +to_rgb +if $10>0 +[0] +b[0] 1 +negate[0] +luminance[0] +rv[0,1] +blend[0,1] overlay,$10 +fi ++fx_gradient_norm[0] 0,1.5,0,50.38,1,0 +[0] +smooth $1,0.2,1,3,3 +b $2 +sharpen $3 +[0] +r[0] 20,20,1,3,2 +equalize[0] 256,0%,98% +index[3] [0],1,1 +rm[0] +=>[0] linee +=>[1] orig +=>[2] pen +if $7==0 +rv[pen,linee] +blend[pen,linee] multiply,1 +elif $7==1 +rv[orig,linee] +blend[orig,linee] multiply,1 +fi +n[0] 5,250 +autoindex[0] $4,$5 +rv[0,1] +blend[0,1] value,$6 +if $8==1 +equalize 21,30,$9 +fi +done a c done done +mc_pendraw_preview: +gui_split_preview "-mc_pendraw $*",$-1 +fx_tk_about : +fx_logo "Tom Keil's Filters" +tk_fx_channel_processing : +fx_channel_processing {$3*100/255},{$2<1?-min(1,$2-1)*100:min(1,0.25*($2-1))*100},{log($1)},${4--1} +tk_fx_select_color : +($4^$5^$6^$7) _fx_select_color. $1 color={^} rm. +repeat $! +if $8==0 ++_fx_select_color. $1 +select_color. $2%,$color +b. $3% +if $9 *. -1 +. 1 fi +to_rgba.. s.. c *[-2,-1] a[-4--1] c +else +_fx_select_color. $1 +select_color. $2%,$color +b. $3 +if $9 *. -1 +. 1 fi +*. 255 r. 100%,100%,1,4 +fi +mv. 0 done +tk_fx_replace_color : +to_rgba replace_color $1,$2%,${3--1} c 0,255 +fx_tk_retouch : +repeat $! l[$>] +if $8==1 ++fx_edges $5,$4,0,0 fx_gaussian_blur {$5*5},0,0,1,1,0,0 +else ++to_rgba[0] +to_gray[0] fx_edges[2] $5,$4,0,0 +fx_gaussian_blur[2] {$5*5},0,0,1,1,0,0 to_gray[2] +to_rgba[0] +negate[2] +fx_highpass[1] {$1},2,1,1,0 +fx_gaussian_blur[1] $2,0,0,1,1,0,0 +to_rgba[0] +if $9==1 +to_rgba[0] channels[5] 0 +tk_fx_channel_processing[5] 1,1,4,0,0,0,100,256,0,0,0,2,7,0 +fx_gaussian_blur[5] {{w+h}/1000},0,0,1,0,0,0 to_gray[5] fi +split[1] c reverse[4,5] compose_multiply[4,5] +if $9==1 reverse[4,-1] compose_multiply[4,-1] fi +append[-6,-5,-4,-3] c +reverse[0,1] fx_compose_softlight[0,1] {$3/5} +fx_unsharp.. 0,$6,30,$7,0.00,1.00,0.5,1,0,7,0 +split.. c reverse[-1,-2] compose_multiply[-1,-2] append[-4,-3,-2,-1] c +blend[0,1] alpha +fi +done done +fx_tk_retouch_preview : +gui_split_preview "fx_tk_retouch ${1--2}",$-1 +fx_tk_dof : +if $8==0||$8==1 if $!!=1 error[] "Select input mode ACTIVE. This option is available for single layer only." fi fi +if $8==2||$8==3 if $15==3||$15==4||$17==3 error[] "Option not available for individual mask" fi fi +if $8==2||$8==3 if $!!=2 error[] "For individual mask select input mode ACTIVE AND BELOW" fi fi +tr={$5} dfs={$6} bsi={$11} bsb={$12} +if $19==1 scdo=50 scup=200 tr={$5/2} dfs={$6/2} bsi={$11/2} bsb={$12/2} fi +if $19==2 scdo=25 scup=400 tr={$5/4} dfs={$6/4} bsi={$11/4} bsb={$12/4} fi +if $8==0||$8==1 +if $19!=0 +r[0] $scdo%,$scdo% else [0] fi +else +if $19!=0 r. $scdo%,$scdo% fi +fi +if $19!=0 +r[0] $scdo%,$scdo% else [0] fi +if $8==2||$8==3 rv[-1,-2] fi +if $15==0||$15==1||$15==2 +if $8==0 fx_tk_autodepth. +elif $8==1 fx_tk_depthmap. 1,20,0,0,0,0,0 +elif $8==2||$8==3 fi +if $18!=3 if $8!=2 +if $20==1 to_rgb. ++f. if(i>={{255-$3}+{$4/2}},0,i) ++f. if(i<={{255-$3}-{$4/2}},0,i) compose_darken[-1,-2] +n. 0,255 f. if(i>=1,255,i) rm.. +else +local_similarity_mask. $1,$2,$3,$4,4,0 +fi +blur_xy. $tr +fi fi +fi +if $15==1||$15==3 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,1,180,100,$16 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,180,0,$17 +compose_darken[-1,-2] +fi +if $15==2||$15==4 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,1,90,100,$16 ++fx_linear_gradient. 0,0,0,255,255,255,255,255,0,90,0,$17 +compose_darken[-1,-2] +fi +if $15==1||$15==2 rv[-1,-2] compose_lighten[-1,-2] fi +if $15==3||$15==4 rm.. fi +if $18==0||$18==1 +if $14==1 [-1,-2] +blur_xy. {$tr/2} +ir. 1,256 n. 0,255 +tk_fx_replace_color. 1,0,0,0,0,255,0,0,0,0 +inpaint.. . rm[-1,1] rv[-1,-2] +fi +if $7==0 median.. $dfs +elif $7==1 blur_xy.. $dfs +elif $7==2 median.. {$dfs/2} blur_xy. {$dfs/5} +fi +if $9!=0 if $19==0 [0] else +r[0] $scdo%,$scdo% fi +fx_morpho. 1,$bsi,0,{2-$13},0,1,0 +tk_fx_replace_color. {$10*1.765},0,0,0,0,255,0,0,0,0 +blur_xy. $bsb +rv[-1,-3] fx_compose_lighten[-1,-3] $9 +fi +if $19!=0 r[1,2] $scup%,$scup% fi +to_rgba[0] s[0] c rv[3,5] +compose_multiply[3,5] to_gray[3] +a[0,1,2,3] c +if $18==0 rv[0,1] compose_rgba[0,1] fi +fi +if $18!=1 k. fi +if $18==2||$18==3 if $19!=0 r. $scup%,$scup% fi fi +fx_tk_dof_preview : +to_rgba +if $8==0||$8==1 if $!!=1 error[] "Select input mode ACTIVE. This option is available for single layer only." +fi fi +if $8!=2&&$8!=3 +gui_split_preview "fx_tk_dof ${1--2}",$-1 +else fx_tk_dof ${1--1} fi +to_rgba +if $20==0 +line 100%,$2%,{$1+5}%,$2%,1,255,0,0 +line 0%,$2%,{$1-5}%,$2%,1,255,0,0 +line $1%,100%,$1%,{$2+5}%,1,255,0,0 +line $1%,0%,$1%,{$2-5}%,1,255,0,0 +fi +fx_tk_infrared : +repeat $! l[$>] ++fx_hsv_equalizer 0,120,{240*$4},{if({$2==0},0,$3)},{if({$2==0},-$1,{-1+$2})},$1,240,{120*$6},$5,0,-$1,0,0,0,0,0 +b. $7 fx_compose_alpha $1,0 +tk_fx_channel_processing 1,$9,$8,0,0,0,100,256,0,0,0,2,0,0 +fx_mix_lab 1,0,0,$10,0,0,$10,0,0,0,2,0 +if $11==1 fx_blackandwhite 0.299,0,0.587,0,0.114,0,1,1,0,0,0,$12,$12,$12,2,{{w+h}/60000},0,0,16,4,0,0,0 fi +done done +fx_tk_infrared_preview : +gui_split_preview "fx_tk_infrared ${1--2}",$-1 +demo_ra: +mathmap_ra "rmath*$1","amath*$2" +demo_xy: +mathmap_xy "xmath*$1","ymath*$2" +fx_fourier_picture_watermark : +rr2d[0] {1,w*$1},{1,h*$1} to_gray[0] threshold[0] 127 +watermark_fourier2 c 0,255 +#@cli watermark_fourier2 : +watermark_fourier2 : +fft[-1] shift[-2,-1] {int(w/2)},{int(h/2)},0,0,2 +[0],[0],1,{s} +j[-3,-2] [-1],3,3,0,0,1,[0] +mirror[0] x +j[-3,-2] [-1],{{-2,w}-2-{0,w}},3,0,0,1,[0] +mirror[0] y +j[-3,-2] [-1],{{-2,w}-2-{0,w}},{{-2,h}-2-{0,h}},0,0,1,[0] +mirror[0] x +j[-3,-2] [-1],3,{{-2,h}-2-{0,h}},0,0,1,[0] +mirror[0] y +rm[-1] shift[-2,-1] -{int(w/2)},-{int(h/2)},0,0,2 ifft[-2,-1] rm[-1] +mv[-1] 1 +rm[0] +gcd_spiralbw_warp : +to_graya. +sh. 0 +eval. " +begin(P=[0,0];M=0;LX=w-1;LY=h-1;D=[1,0];R=[0,-1,1,0];off=0); +if( +(P[0]==LX && (P[1]==M || P[1]==LY)) || (P[0]==M && P[1]==LY), D=R*D); +if((P[0]==M && P[1]==M+1), D=R*D;M++;LX--;LY--); +P+=D; +I(#-2,P[0],P[1])=[off%w,int(off/w)]; +++off; +" +rm. +#@cli invert_rgb +#@cli : Inverts images in the RGB colour space. +invert_rgb: +repeat $! split_opacity +l[0] c 0,255 *[$>] -1 +[$>] 255 done +a c +done +#@cli invert_alpha +#@cli : Inverts the alpha channel of images. +invert_alpha: +repeat $! split_opacity +l[1] c 0,255 *[$>] -1 +[$>] 255 done +a c +done +#@cli index_table: 0begin(index=-1);index+=1;index" +mathmap_flag: +mathmap_xy "xmath","ymath+$1*sin(pi*$2/1*(-xmath+$4*2*$3/$2))" +mathmap_rel2ellv3: +mathmap_xy "xmath/sqrt(1-4*(ymath/H)*(ymath/H))","ymath/sqrt(1-4*(xmath/W)*(xmath/W))" +mathmap_spiral: +q="sin(rmath*$1*pi*2-amath+$2*2*pi)*0.5+0.5" +mathmap_grayColor $q +mathmap_xy: +e[^-1] "mathmap xy: fonction with formulas : "$1" and "$2"." +repeat $! l[$>] +{w},{h},1,1 [-1] rv +f[0] "H=2*h/max(w,h);W=2*w/max(w,h);x0=(w-1)/2+1e-10; y0=(h-1)/2; xmath=(x-x0)*W/w; ymath=-(y-y0)*H/h; ($1)*w/W+x0" +f[1] "H=2*h/max(w,h);W=2*w/max(w,h);x0=(w-1)/2+1e-10; y0=(h-1)/2; xmath=(x-x0)*W/w; ymath=-(y-y0)*H/h; -($2)*h/H+y0" +a[0,1] c +warp[-1] [0],0,1,0 +k[-1] +done done +mathmap_ra: +e[^-1] "mathmap ra: fonction with formulas : "$1" and "$2"." +repeat $! l[$>] +{w},{h},1,1 [-1] rv +f[0] "x0=(w-1)/2+1e-10; y0=(h-1)/2; rmath=((x-x0)^2+(y-y0)^2)^0.5*2/w; amath=(atan(-(y-y0)/(x-x0))+pi/2*(sign(x-x0)-1))%(2*pi); x0+($1)*x0*cos($2)" +f[1] "x0=(w-1)/2+1e-10; y0=(h-1)/2; rmath=((x-x0)^2+(y-y0)^2)^0.5*2/w; amath=(atan(-(y-y0)/(x-x0))+pi/2*(sign(x-x0)-1))%(2*pi); y0-($1)*x0*sin($2)" +a[0,1] c +warp[-1] [0],0,1,0 +k[-1] +done done +mathmap_grayColor: +e[^-1] "mathmap grayColor: fonction with formulas : "$1"." +repeat $! l[$>] +r 100%,100%,1,1 +f "H=2*h/max(w,h);W=2*w/max(w,h);x0=(w-1)/2+1e-10; y0=(h-1)/2; rmath=((x-x0)^2+(y-y0)^2)^0.5*2/w; amath=(atan(-(y-y0)/(x-x0))+pi/2*(sign(x-x0)-1))%(2*pi); ($1)" +n 0,255 to_rgba +done done +fx_custom_code : skip "${1=-skip ,}" +({'{/"$1"}'}) discard. 92,10 _gcp_arg={t} rm. +m "_fx_custom_code_start : "$_gcp_arg +if $4 +_nb_in=$! +_dim_in="" sep="" +foreach { _dim_in=$_dim_in$sep"["$>"] = "{w}x{h}x{d}x{s}", in ["{_round([im,iM],0.1)}"]" sep="\n" } +fi +if $2 +ac "_fx_custom_code_start _status_out=${}",{$2-1},$3 +else +_fx_custom_code_start _status_out=${} +if $3==1 c 0,255 elif $3==2 n 0,255 fi +fi +if $4 +_nb_out=$! +_dim_out="" sep="" +foreach { _dim_out=$_dim_out$sep"["$>"] = "{w}x{h}x{d}x{s}", in ["{_round([im,iM],0.1)}"]" sep="\n" } +fi +um _fx_custom_code_start +fx_custom_code_preview : skip "${1=-skip ,}" +w,h={w},{h} +l { +({'{/"$1"}'}) discard. 92,10 _gcp_arg={t} rm. +if $6 gui_split_preview "fx_custom_code $_gcp_arg,${2--2}",${-3--1} +else fx_custom_code $_gcp_arg,${2--2} +fi +onfail +error_msg=${} +rr2d $w,$h,2,1 +gui_print_preview "Syntax error:",,{``$error_msg},20,40 +} +if $4 +if !$3 % 256 fi +if $!>1 gui_preview fi +rr2d $_preview_area_width,$_preview_area_height,0,1 +siz0=13 siz1=17 siz2=19 siz3=22 +if ['$_status_out']==0 _status_out=(empty) fi +info="Input images: "#$_nb_in"\n"$_dim_in"\n\n""Output images: "#$_nb_out"\n"$_dim_out"\n\n""Output status: "$_status_out +0 t. {``$info},0,0,${siz$5},1,255 expand_xy. 5,0 +dilate. 3 a[-2,-1] c +rr2d[^-1] ${-max_wh},2,2 +r. ..,..,1,100%,0 drgba[^-1] +/[^-1] 2 blend[^-1] .,alpha rm. +fi +fx_output_565 : +output_565 "$1",$2 +fx_gmic_demos : +coms=2048,blobs,bouncing,connect4,fire,fireworks,fisheye,fourier,hanoi,histogram,hough,jawbreaker,landscape,life,light,mandelbrot,metaballs3d,minesweeper,minimal_path,pacman,paint,plasma,quantize_rgb,reflection3d,rubber3d,shadebobs,spline,starfield3d,tetris,tictactoe,waves,whirl +com=${arg\ {1+$1},$coms} +if $!>0 sel=0 else sel= fi ++l[$sel] { m "foo : x_"$com foo rm um foo } +fx_gmic_demos_preview : +rm input_cached img/gmic_demos.cimgz k[$1,-1] rows. $1 map[0] [1] k[0] +fx_display_histogram : +mode=${arg0\ $2,all,rgba,rgb,rgb_r,rgb_g,rgb_b,rgba_a,lrgb,lrgb_r,lrgb_g,lrgb_b,ycbcr_y,ycbcr_cbcr,ycbcr_cb,ycbcr_cr,ycbcr_cg,lab_l,lab_ab,lab_a,lab_b,lch_ch,lch_c,lch_h,hsv_h,hsv_s,hsv_v,hsi_i,hsl_l,cmyk_c,cmyk_m,cmyk_y,cmyk_k,yiq_y,yiq_iq} +_ac_$mode m "_ac_precond : "$_p m "_ac_forward : "$_f m "_ac_backward : "$_b +foreach { +_ac_precond _ac_forward[0] channels $_s +display_histogram {w},{h},$1,0,255 +if s==2" || "s==4 channels 0,2 fi +} +fx_import_image : skip "${1=}" +rm i "$1" s z if $2 n 0,255 else c 0,255 fi +fx_input_565 : skip "${1=}" +l[] { +check "isint($2) && $2>0 && isint($3) && $3>0" +onfail error "Invalid Specified Dimensions" +} +if ['"$1"']==0 gui_warning_preview "Choose a filename" +elif !isfile(['"$1"']) gui_warning_preview "Filename not found!" +else input_565 "$1",${2-4} mv. 0 +fi +fx_intarsia : +to_rgb ++foreach { +nm=${gui_layer_name.} +if max(w,h)>$3 rr2d $3,$3,0 fi ++colormap 0 +if w>$4 rm. +colormap $4,1 fi +round[1] index[0] [1] +0 => $nm ('{b}') f. "x?i:i>=97 && i<=122?i - 32:i" image_basename={t} rm[-2,-1] +('"\n\n
\n

"$image_basename" ("{0,w}x{0,h}")

\n
\n\n"') +0 => "$2" image_name={b} rm. +nb_cols={1,w} +repeat $nb_cols { +color={1,I($>)} +R,G,B=$color +('${dec2hex\ {$R*65536+$G*256+$B}}') -. {'0'} r. 6,1,1,1,0,0,1,0 +. {'0'} +f. i>=_'a'" && "i<=_'z'?i+_'A'-_'a':i +hcolor={t} rm. +48,32,1,4 fc. $color,255 frame. 1,1,0,0,0,255 o. "$1/"${image_name}_$>.png rm. +('"\n"') +} +('"
Colour "$>".png"\" />#"$hcolor"
\n
"') +starting=${"arg {1+$5},\"Top left\",\"Top right\",\"Bottom left\",\"Bottom right\""} +label=${"arg {1+$6},Row,Column"} +if $6 dir0="T → B" dir1="B → T" else dir0="L → R" dir1="R → L" fi +dir:=arg(1+2*$5+$6,0,0,1,0,0,1,1,1) ++map[0] [1] ++fx_intarsia_preview. ${1-7},63 drgba. +rr2d.. 200,200,1,1 +to_rgba[-2,-1] frame[-2,-1] 1,1,0,0,0,255 frame[-2,-1] 0,20,0,0,0,0 +t.. "Result",0,0,16,1,0,0,0,255 +t. "Ordering overview",0,0,16,1,0,0,0,255 +frame[-2,-1] 20,20,0,0,0,0 +o.. "$1/"${image_name}_A.png +o. "$1/"${image_name}_B.png +rm[-2,-1] +('"
""
\n"') +if $7 ('"

Additional comments:

\n"') fi +('"

Starting point: "$starting"          Orientation: "$label" by "$label"

\n"') +rm[1] +('"\n"') +_fx_intarsia[0] $5,$6,0 ++l[0] { +s y +foreach { +if $>%2 mirror. x fi +im:=im compress_rle 0,0 rows 6,100% +('"\n"') +rm[0] a x +dir:=!$dir +} +a x +} +rm[0] +('"
"$label" "{1+$>}""${dir$dir}"\n"') +i=0 n=0 do +val={0,i[$i]} i+=1 +if $val>=0 occ=1 +else +occ:=-$val +val={0,i[$i]} +if $val<0 val=0 else i+=1 fi +fi +val+=$im +('"colour:"$val" "$occ') +if {0,$i\n"') fi +while $i
\n
\n"') +a x ot "$1/$2" +rm +} +fx_intarsia_preview : +to_rgb +foreach { +if max(w,h)>$3 rr2d $3,$3,0 fi +to_rgba +_fx_intarsia $5,$6,0 +100%,100%,1,1,"(y%2?y*w+w-1-x:y*w+x)<$8*wh/100" * +if min(w,h)<140 rr2d 140,140,1,1 fi +expand_xy 16,0 +100%,100% circle. 16,16,1%,1,1 +arrow3d. 0,0,0,{w/4},0,0,2%,15%,10% col3d. 1 j3d.. .,16,16,0,1,2,0,0 rm. ++dilate. 3 r.. 100%,100%,1,3,0,0,0,0,0,0.5 a[-2,-1] c *. 255 +blend alpha +_fx_intarsia $5,$6,1 +} +_fx_intarsia : +if $3" && "$2 transpose fi +if !$1 +elif $1==1 +mirror x +elif $1==2 +mirror y +elif $1==3 +mirror xy +fi +if !$3" && "$2 transpose fi +fx_image_sample : +if $1 sp {$1-1},$2,$3 else sp ?,$2,$3 fi +mv. 0 +fx_image_sample_preview : +w,h={w},{h} rm +fx_image_sample $1,{$w>$h?$w:0},{$h>$w?$h:0} +fx_solve_maze : +repeat $! { ++norm. >=. 50% +if !$10 negate. fi +*. 255 +b. $5% *.. 1e10 +[-2,-1] +minimal_path. $1%,$2%,0,$3%,$4%,0 transpose. +pointcloud. 0 dilate. $6 r. ..,..,1,1,0 +to_rgba. +replace_color. 0,0,1,1,1,255,${7-9},255 +replace_color. 0,0,0,0,0,255,0,0,0,0 +ellipse. $1%,$2%,5,5,0,1,${7-9},255 +ellipse. $3%,$4%,5,5,0,1,${7-9},255 +rv[-2,-1] +mv[-2,-1] 0 } +fx_solve_maze_preview : +drgba +line $1%,$2%,$3%,$4%,1,0xCCCCCCCC,${7-9} +ellipse $1%,$2%,3,3,0,1,${7-9} +ellipse $1%,$2%,3,3,0,1,0x1,0 +ellipse $3%,$4%,3,3,0,1,${7-9} +ellipse $3%,$4%,3,3,0,1,0x1,0 +#@cli :: Additional Gallery Images +#@cli _gallery_arrays +#@cli : This entry defines some examples of array filters for the G'MIC gallery page. +#@cli : $ image.jpg fx_frame_blur 30,30,0,5,0,0,128,128,128,0,5,255,255,255,2,2,1,0,0.5,0.5,0 _label="Frame~[blur]" +#@cli : $ sample tiger,leno,monkey,duck,eagle frame 3,3,0 frame 3,3,255 montage A _label="Montage" +#@cli : $ image.jpg fx_puzzle 5,5,0.5,0,0,0.3,100,0.2,255,100,0,0,0,0,0,0 _label="Puzzle" +#@cli _gallery_artistic +#@cli : This entry defines some examples of artistic filters for the G'MIC gallery page. +#@cli : $ image.jpg fx_engrave 0.5,4,0,7.68,15.2,0,0,1,10,1,0,0,0,1,0 gui_merge_layers _label="Engrave" +#@cli : $ image.jpg fx_bokeh 3,8,0,30,8,4,0.3,0.2,210,210,80,160,0.7,30,20,20,1,2,170,130,20,110,0.15,0 _label="Bokeh" +#@cli : $ image.jpg fx_8bits 25,800,16,0 _label="Oldschool~8bits" +#@cli : $ image.jpg fire_edges 0.7,0.25,0.5,25,20 _fps=6 _label="Edges~on~fire" +#@cli : $ image.jpg fx_diffusiontensors 10,5,3,1,0.15,1,0,3,0 _label="Diffusion~tensors" +#@cli : $ image.jpg fx_dreamsmooth 3,1,1,0.8,0,0.8,1,24,0 _label="Dream~smoothing" +#@cli : $ image.jpg fx_feltpen 300,50,1,0.1,20,5,0 _label="Felt~pen" +#@cli : $ image.jpg gtutor_fpaint 0.5,0.5,0,0,45,0.5,0.5,0.5,0 _label="Finger~paint" +#@cli : $ image.jpg fx_graphic_novelfxl 0,2,6,5,20,0,0.62,14,0,1,0.5,0.78,1.92,0,0,0,1,1,1,0.5,0.8,1.28 _label="Novel~FX" +#@cli : $ image.jpg fx_illustration_look 100,0,0,0,0 _label="Illustration~look" +#@cli : $ image.jpg fx_lylejk_painting 10,2,4,10,0 _label="Lylejk~painting" +#@cli : $ image.jpg fx_painting 5,2.5,1.5,50,1,0 _label="Painting" +#@cli : $ image.jpg fx_posterize 150,30,1,6,0,0,1,0 _label="Posterize" +#@cli : $ image.jpg fx_quadtree 2,1024,1.05,0,2.33,0.68,0.39,1,0 _label="Quadtree~variations" +#@cli : $ image.jpg fx_vector_painting 9.37,0 _label="Vector~painting" +#@cli : $ image.jpg cl_comic 0,2,0,1,1,15,15,1,10,20,6,2,0,0,0,0,0,0,50,50 _label="Comic~Book" +#@cli : $ image.jpg fx_cpencil 1.3,50,20,2,2,1,0 _label="Colored~Pencils" +#@cli : $ image.jpg fx_paint_with_brush 6,"6",1,16,30,100,100,0,95,0.5,8,-1,-1,2,2,30,0,0,0,100,20,1,0,0,0,30,0,0,0,0,0,0,1,45,0,0,50,50 _label="Whirls" +#@cli : $ image.jpg fx_paint_with_brush 5,"5",0,16,10,100,100,10,80,0.5,3,135,50,6,1,20,0,0,0,90,3,10,0,0,0,30,0,15,15,15,15,15,1,45,0,0,50,50 _label="Fuzzy~Painting" +#@cli : $ sample portrait4 blur 1 fx_polygonize_delaunay 40,5,75,0.5,3,50,0,0,0,255,1,0,50,50 _label="Polygonize" +#@cli : $ image.jpg fx_posterize 150,30,1,12,0,0,0,0,50,50 _label="Posterize" +#@cli : $ sample portrait2 samj_Test_Skeletik 10,1,0,0,0,3,1,0,0,0,255 _label="Skeletik" +#@cli : $ sample portrait6 fx_sketchbw 3,45,180,30,1.75,0.02,0.5,0.75,0.1,0.7,3,6,0,1,4,0,0,50,50 _label="Sketch" +#@cli : $ image.jpg warhol 3,3,2,40 _label="Warhol" +#@cli _gallery_blackandwhite +#@cli : This entry defines some examples of black-and-white filters for the G'MIC gallery page. +#@cli : $ image.jpg fx_freaky_bw 90,20,0,0,0,0 _label="Freaky~B&W" +#@cli : $ image.jpg fx_engrave 0.5,50,0,8,40,0,0,0,10,1,0,0,0,1,0 _label="Engrave" +#@cli : $ image.jpg fx_gcd_layeretch 11,4,12,0.12,100,8.5,5,0,0,3,1,1,0 _label="Multi-layer~etch" +#@cli : $ image.jpg fx_pencil_portraitbw 30,120,1,0.5,144,79,21,0 _label="Pencil~portrait" +#@cli : $ image.jpg fx_gcd_etch 125,153,171,185,0.1,50,80,50,10,15,12,20,0,1,0.3,1,0,0 _label="Threshold~etch" +#@cli : $ image.jpg fx_ghost 200,2,2,1,3,16,0,0,50,50 _label="Ghost" +#@cli : $ image.jpg cl_lineart 0,0,2,1,15,15,1,0,6,2,2,0,0,0,50,50 _label="Lineart" +#@cli : $ image.jpg gcd_emboss 128,0 _label="Emboss" +#@cli _gallery_colors +#@cli : This entry defines some examples of color filters for the G'MIC gallery page. +#@cli : $ image.jpg fx_color_abstraction 1,10,0.2,0 _label="Color~abstraction" +#@cli : $ image.jpg fx_boost_chroma 90,0,0 _label="Boost~chromaticity" +#@cli : $ image.jpg fx_retrofade 20,6,40,0 _label="Retro~fade" +#@cli : $ image.jpg fx_tk_vintage 2,0.85,0.7,80,200,5,147,26,161,0.3,235,220,176,0.4,190,181,108,0.2,0,0,100,0,0.3,25,0,0 _label="Vintage~style" +#@cli : $ image.jpg fx_retinex 75,16,1,1,1,5,15,80,250,0,50,50 _label="Retinex" +#@cli _gallery_deformations +#@cli : This entry defines some examples of deformation filters for the G'MIC gallery page. +#@cli : $ image.jpg animate "flower","30,10,0,0","30,10,0,360",10 rm. _fps=6 _label="flower" +#@cli : $ image.jpg fx_conformal_maps 8,1,0,"((1.1 + i*z/6)/(1.04 - i*z/6))^6.2",0,0,0,0,0,3,0,0,"1024","1024" _label="Conformal~maps" +#@cli : $ image.jpg souphead_droste10 40,100,1,1,1,0,0,0,0,0,1,10,1,0,90,0,0,0,0,1,0,1,1,0,0,0,0,0,1,0,0 _label="Continuous~droste" +#@cli : $ image.jpg fx_crease 30,10,3 _label="Crease" +#@cli : $ image.jpg fx_distort_lens 0.29,0,0.23,50,50,0,0 _label="Distort~lens" +#@cli : $ image.jpg fx_drop_water 0,20,2,80,0,3,35,10,1,0.5,0.25,0.5,0.75,0.05,0.15,1 gui_merge_layers _label="Drop~water" +#@cli : $ image.jpg fx_reflect 50,1,110,160,190,64,0,1.5,0,-3.3,7,1.5 _label="Reflection" +#@cli : $ image.jpg fx_square_circle 0,1,0,0,0,0,0,0 _label="Square~to~circle" +#@cli : $ image.jpg fx_textured_glass 40,40,1,1,0,2,0,0 _label="Textured~glass" +#@cli : $ sample lena,leno,320 morph 40 _fps=5 _label="morph" +#@cli : $ image.jpg fx_breaks 0,30,30,0.5,3 _label="Breaks" +#@cli : $ image.jpg fx_circle_transform 50,50,75,50,-2,-2,0,1,3,1 _label="Circle~Transform" +#@cli : $ image.jpg fx_symmetrizoscope 4,45,3,0 _label="Kaleidoscope" +#@cli : $ image.jpg fx_spherize 50,1,0,50,50,0,0,2,0 _label="Spherize" +#@cli _gallery_filtering +#@cli : This entry defines some examples of filters for the G'MIC gallery page. +#@cli : $ image.jpg fx_gcd_crt 1.8,1.8,0,0 equalize 256 _label="CRT~sub-pixels" +#@cli : $ image.jpg fx_dirty 30,1,0,0,0 _label="Dirty" +#@cli : $ image.jpg fx_freaky_details 2,10,1,11,0,32,0 _label="Freaky~details" +#@cli : $ image.jpg jeje_normalize_local_variance 50,5,5,1,0,0 _label="Local~variance~normalization" +#@cli : $ image.jpg fx_mighty_details 25,1,25,1,11,0 _label="Mighty~details" +#@cli : $ image.jpg samj_Barbouillage_Paint_Daub 2,2,100,0.2,1,4,1,0,8 _label="Barbouillage" +#@cli : $ image.jpg fx_blur_bloom 1,2,5,0,1,0,0,0,7,0,50,50 _label="Blur~Bloom" +#@cli : $ image.jpg fx_glow 6,7,0,0,50,50 _label="Glow" +#@cli : $ image.jpg fx_jpeg_artefacts 25,0,50,50 _label="JPEG~Artefacts" +#@cli : $ image.jpg fx_lomo 20,0,50,50 _label="Lomo" +#@cli : $ image.jpg fx_noise_perlin 0,100,8,0,0,4,0,0,2,0,0,1,0,2,0,50,50 _label="Perlin~Noise" +#@cli _gallery_patterns +#@cli : This entry defines some examples of pattern filters for the G'MIC gallery page. +#@cli : $ image.jpg fx_rain 65,10,50,0.1,1,1,0 gui_merge_layers _label="Rain~&~snow" +#@cli : $ 400,400,1,3 fx_camouflage 9,12,100,30,46,33,75,90,65,179,189,117,255,246,158 _label="Camouflage" +#@cli : $ image.jpg jeje_clouds 50,0.5 _label="Clouds" +#@cli : $ image.jpg fx_crystal 50,0.2,20,0 _label="Crystal" +#@cli : $ 400,400,1,3 fx_crystal_background 10,25,0,100,1 _label="Crystal~background" +#@cli : $ image.jpg fx_marble 0.5,1,0,0,0.4,0.6,0.6,1.1,0,100 _label="Marble" +#@cli : $ image.jpg fx_mineral_mosaic 1,2,1,100,0 _label="Mineral~mosaic" +#@cli : $ image.jpg fx_shapes 1,16,10,2,5,106.8,2,0,0,1,0 _label="Op~art" +#@cli : $ 400,400,1,3 fx_satin 20,1,0,0,0,0,255,255,255,255,255,0,0,0,-50,0,0 _label="Satin" +#@cli : $ 400,400,1,3 fx_seamless_turbulence 15,20,0,1,3,1 _label="Seamless~turbulence" +#@cli : $ image.jpg fx_shockwaves 10,10,20,0,0 _label="Shock~waves" +#@cli : $ 400,400,1,3 fx_equation_parametric "sin(t)*(exp(cos(t))-2*cos(4*t)-sin(t/12)^5)","cos(t)*(exp(cos(t))-2*cos(4*t)-sin(t/12)^5)",0,100,4096,1,0,64,0,0,128,0,0,1,1,1 _label="Equation~plot~[parametric]" +#@cli : $ 400,400,1,3 KittyRings 30,8,0,1,113,0,113,0,255,0 _label="Kitaoka~spin~illusion" +#@cli : $ 400,400,1,3 fx_neon_lightning 50,50,0,50,50,100,50,0.7,3,130,80,50,0.25,0 _label="Neon~lighting" +#@cli : $ image.jpg fx_lava 8,5,3,0,0 _label="Lava" +#@cli : $ sample monkey,lion,monkey 100%,100% plasma. equalize. 256 transition[0,1,2] [3],10 rm. _fps=10 _label="transition" +#@cli : $ image.jpg fx_shapeism 2,7,0.38,0,1,5,32,8,3,1,5,0.5,1,0,0,0,255 _label="Shapeism" +#@cli : $ image.jpg fx_generic_halftone 0,1,100,12,1,0,4,0,90,1,0,0 _label="Halftone" +#@cli : $ image.jpg fx_rebuild_from_similar_blocks 5,10,0.75,1 _label="Rebuild~From~Similar~Blocks" +#@cli : $ image.jpg fx_warp_by_intensity 1.62,0.6,128,128,0,1,3,0,0,50,50 _label="Warp~by~Intensity" +#@cli : $ image.jpg fx_memoakten_algorithm_a 0,20,30,30,2,50,10,50,40,3,60,1,0,0,0,255,255,255,255,0,0,255,128,0,255,255,0,0,0,0 _label="Algorithm A" +#@cli _gallery_3dmeshes +#@cli : This entry defines some examples of 3D rendering filters for the G'MIC gallery page. +#@cli : $ sample leno,lion,leno resize 400,400 transition3d 20,5,5 rm. _fps=10 _label="transition3d" +#@cli : $ 256,192 fx_text_pointcloud3d 64,"G'MIC","Rocks!",1,200,220,255,255,255,255,255,2,2,1,19 _fps=10 _label="3D~text~pointcloud" +#@cli : $ sphere3d 10 repeat 5 { +add3d[-1] 10,{u(-10,10)},0 color3d[-1] ${-rgb} } add3d _fps=10 _label="3D~Spheres" +#@cli : $ repeat 20 { torus3d 15,2 color3d[-1] ${-rgb} mul3d[-1] 0.5,1 if $>%2 rotate3d[-1] 0,1,0,90 fi add3d[-1] 70 add3d rotate3d[-1] 0,0,1,18 } double3d 0 _fps=10 _label="3D~Ring" +#@cli : $ image.jpg distribution3d circles3d 5 o3d 0.5 colorcube3d primitives3d[-1] 1 add3d _fps=10 _label="RGB~Color~Distribution" +#@cli : $ image.jpg blur 5 elevation3d. 0.75 _fps=10 _label="3D~Elevation" +#@cli : 128,128,1,3,u(255) plasma 10,3 blur 4 sharpen 10000 n 0,255 elevation3d[-1] 'X=(x-64)/6;Y=(y-64)/6;-100*exp(-(X^2+Y^2)/30)*abs(cos(X)*sin(Y))' _fps=10 _label="3D~Elevation" +#@cli : $ gmic3d _fps=10 _label="3D~G'MIC~Logo" +#@cli : $ image.jpg resize2dy 32 imageblocks3d -20 mode3d 3 _fps=10 _label="3D~Image~Blocks" +#@cli : $ image.jpg imagerubik3d , _fps=10 _label="Rubik~Cube" +#@cli : $ shape_cupid 480 skeleton3d , _fps=10 _label="3D~Skeleton" +#@cli : $ spherical3d "abs(1+0.5*cos(3*phi)*sin(4*theta))" _fps=10 _label="3D~Spherical~Function" +#@cli : $ 6,6,6,9,"U = [x,y,z] - [w,h,d]/2; U/=norm(U); mul(U,U,3) + 0.3*eye(3)" tensors3d 0.8 _fps=10 _label="3D~Tensors" +#@cli : $ text3d "G'MIC Rocks!" _fps=10 _label="3D~Text" +#@cli : $ torus3d 10,3 color3d[-1] ${-rgb} _fps=10 _label="3D~Torus" +#@cli : $ weird3d 48 color3d[-1] ${-rgb} _fps=10 _label="3D~Weird" +#@cli _gallery_stylization +#@cli : This entry defines some examples of image stylization for the G'MIC gallery page. +#@cli : $ sample car _fx_stylize starrynight _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,5,2,1.85,0 _label="from~Van~Gogh:~Starry~Night" +#@cli : $ sample car _fx_stylize graytree _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,2,2,1.85,0 _label="from~Mondrian:~Gray~Tree" +#@cli : $ sample car _fx_stylize yellowredblue _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,10,2,1.85,0 _label="from~Kandinsky:~Yellow-Red-Blue" +#@cli : $ sample car _fx_stylize littlebayatlaciotat _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,2,2,1.85,0 _label="from~Braque:~Little~Bay~at~La~Ciotat" +#@cli : $ sample car _fx_stylize leviaducalestaque _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Braque:~Le~Viaduc~a~l'Estaque" +#@cli : $ sample car _fx_stylize greatwave _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Hokusai:~The~Great~Wave" +#@cli : $ sample elephant input ../img/hatching.png _output_mode=1 +fx_stylize 1,4,0,0,1,2,3,0.5,0.1,3,3,0,0.7,0,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Hatch~Drawing" +#@cli : $ sample cat input ../img/hatching.png _output_mode=1 +fx_stylize 1,4,0,0,1,2,3,0.5,0.1,3,3,0,0.7,0,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Hatch~Drawing" +#@cli : $ sample bottles _fx_stylize starrynight _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Van~Gogh:~Starry~Night" +#@cli : $ sample cat _fx_stylize summertime9a _output_mode=1 +fx_stylize 1,6,0,0,2,0,1,0.5,0.1,3,3,0,0.7,0,2,1,0,5,5,7,1,130,10,2,1.85,0 _label="from~Pollock:~Summertime~No~9A" +#@cli : $ sample cat _fx_stylize greatwave _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Hokusai:~The~Great~Wave" +#@cli : $ sample dog _fx_stylize convergence _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,5,2,1.85,0 _label="from~Pollock:~Convergence" +#@cli : $ sample dog _fx_stylize irises _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,1,5,0,0.7,1,0,1,0,5,5,7,1,30,20,2,1.85,0 _label="from~Van~Gogh:~Irises" +#@cli : $ sample mandrill _fx_stylize themandola _output_mode=1 +fx_stylize 1,5,0,0,0,3,1,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Braque:~The~Mandola" +#@cli : $ sample square _fx_stylize orientalpleasuregardenanagoria _output_mode=1 +fx_stylize 1,6,0,0,0.52,0.5,3,0.14,0.1,3,3,0,0.7,3.39,0,1,0,5,5,7,5,30,4,2,1.85,0 _label="from~Klee:~Oriental~Pleasure~Garden~Anagoria" +#@cli : $ sample monalisa _fx_stylize squareswithconcentriccircles _output_mode=1 +fx_stylize 1,4,0,0,0.15,3,2,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Kandisnky:~Squares~with~Concentric~Circles" +#@cli : $ sample monalisa _fx_stylize inthestyleofkairouan _output_mode=1 +fx_stylize 1,4,2,0,0.15,3,2,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,5,2,1.85,0 _label="from~Klee:~In~the~Style~of~Kairouan" +#@cli : $ sample square _fx_stylize polyphony2 _output_mode=1 +fx_stylize 1,6,0,0,0.15,3,2,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Klee:~Polyphony~2" +#@cli : $ sample square _fx_stylize wheatstacksendofsummer _output_mode=1 +fx_stylize 1,6,0,0,0.15,3,2,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Monet:~Wheatstacks~-~End~of~Summer" +#@cli : $ sample square _fx_stylize portraitdemetzinger _output_mode=1 +fx_stylize 1,5,0,0,0.1,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,10,2,1.85,0 _label="from~Delaunay:~Portrait~de~Metzinger" +#@cli : $ sample monalisa input ../img/mandelbrot.jpg _output_mode=1 +fx_stylize 1,3,3,0,0.15,4,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,5,2,1.85,0 _label="from~Mandelbrot~Fractal~Set" +#@cli : $ sample bottles _fx_stylize redtree _output_mode=1 +fx_stylize 1,5,0,0,2.12,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Mondrian:~Evening;~Red~Tree" +#@cli : $ sample bottles _fx_stylize redwaistcoat _output_mode=1 +fx_stylize 1,4,0,0,0.67,3.17,3,0.5,0.06,3,3,0,0.7,5,0,2,0,5,5,7,1,30,5,1.05,1.85,0 _label="from~Klee:~Red~Waistcoat" +#@cli : $ sample bottles _fx_stylize reservoirhortadeebro _output_mode=1 +fx_stylize 1,6,0,0,0.5,2,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Picasso:~The~Reservoir" +#@cli : $ sample bottles _fx_stylize almondblossom _output_mode=1 +fx_stylize 1,6,0,0,0,3,3,0.5,0.1,3,3,0,0.7,5,0,2,0,5,5,7,1,30,1,2,1.85,0 _label="from~Van~Gogh:~Almond~Blossom" +#@cli : $ sample bottles _fx_stylize landscapenearantwerp _output_mode=1 +fx_stylize 1,6,0,0,2.17,3.65,3,0.5,0.1,3,3,0,0.7,1,0,1,0,5,5,7,1,30,1,2,1.85,0 _label="from~Braque:~Landscape~near~Antwerp" +#@cli : $ sample bottles _fx_stylize wheatfieldwithcrows _output_mode=1 +fx_stylize 1,6,0,0,3.86,2,3,0.5,0.1,3,3,0,0.7,3.35,1,1,0,5,5,7,1,30,1,5,1.85,0 _label="from~Van~Gogh:~Wheat~Field~with~Crows" +#@cli _gallery_codesamples +#@cli : This entry defines some examples of coding fun filters for the G'MIC gallery page. +#@cli : $ https://gmic.eu/samples/lissajous.gmic go _fps=10 _label="Lissajous" +#@cli : $ https://gmic.eu/samples/torus3d.gmic go _fps=10 _label="3D~torus" +#@cli : $ https://gmic.eu/samples/pacman.gmic go _fps=25 _label="Pacman" +#@cli : $ https://gmic.eu/samples/scrolling.gmic go _fps=25 _label="Scrolling" +#@cli : $ https://gmic.eu/samples/landscape.gmic go _fps=12 _label="Landscape" +#@cli : $ https://gmic.eu/samples/mandelbrot.gmic go _fps=8 _label="Mandelbrot" +#@cli : $ https://gmic.eu/samples/heart.gmic go _fps=15 _label="Heart" +#@cli : $ https://gmic.eu/samples/distortion.gmic go _fps=20 _label="Distortion" +#@cli : $ https://gmic.eu/samples/rotozoom.gmic go _fps=15 _label="Rotozoom" +#@cli : $ https://gmic.eu/samples/french_flag.gmic go _fps=20 _label="French~Flag" +# Local Variables: +# mode: sh +# End: +# +# (End of G'MIC update file) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index efea194..0361840 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,5 @@ human_id==0.2.0 -gmic==2.8.1.dev7 +gmic==2.9.4-a1 scikit-image==0.25.2 numpy==2.2.3 pillow==11.1.0 -